From 80fd1e19b1930892e4173d10e52c8b3a8a27a756 Mon Sep 17 00:00:00 2001 From: "zhangmengqiu.zmq" Date: Sat, 10 Oct 2026 00:28:37 +0800 Subject: [PATCH 1/5] feat(mpa): harden managed account provisioning --- frontend/src/i18n/resources/en-US/ui.json | 7 + frontend/src/i18n/resources/zh-CN/ui.json | 7 + frontend/tests/mpaCreation.test.tsx | 35 ++ ...2026-10-09-restore-esbuild-lock-entries.md | 84 ++++ ...6-10-09-restore-esbuild-lock-entries.zh.md | 84 ++++ .../2026-10-09-restore-main-images.md | 56 +++ .../2026-10-09-restore-main-images.zh.md | 56 +++ .../2026-10-09-python310-timeout.md | 82 ++++ .../2026-10-09-python310-timeout.zh.md | 73 +++ .../2026-10-09-valid-network-marker.md | 56 +++ .../2026-10-09-valid-network-marker.zh.md | 56 +++ .../2026-10-09-empty-network-results.md | 55 +++ .../2026-10-09-empty-network-results.zh.md | 55 +++ .../2026-10-09-entered-name-description.md | 54 ++ .../2026-10-09-entered-name-description.zh.md | 54 ++ .../2026-10-09-standard-shared-gateway.md | 57 +++ .../2026-10-09-standard-shared-gateway.zh.md | 57 +++ .../2026-10-09-sts-account.md | 53 ++ .../2026-10-09-sts-account.zh.md | 53 ++ .../2026-10-09-subnet-order.md | 50 ++ .../2026-10-09-subnet-order.zh.md | 50 ++ .../2026-10-09-runtime-named-worker.md | 54 ++ .../2026-10-09-runtime-named-worker.zh.md | 54 ++ .../2026-10-09-independent-worker.md | 62 +++ .../2026-10-09-independent-worker.zh.md | 62 +++ .../2026-10-09-worker-image-defaults.md | 42 ++ .../2026-10-09-worker-image-defaults.zh.md | 42 ++ .../2026-10-09-managed-runtime-role.md | 74 +++ .../2026-10-09-managed-runtime-role.zh.md | 74 +++ specs/mpa-runtime-provisioning/README.md | 22 +- specs/mpa-runtime-provisioning/README.zh.md | 22 +- specs/studio-mpa-creation/README.md | 46 +- specs/studio-mpa-creation/README.zh.md | 50 +- tests/cli/test_frontend_deploy_iam.py | 23 +- .../mpa_managed/fakes_deployment_network.py | 3 +- .../mpa_managed/test_agent_deployment.py | 88 ++++ tests/integrations/mpa_managed/test_config.py | 61 ++- .../mpa_managed/test_deployment_network.py | 462 ++++++++++++++++++ .../test_deployment_network_cloud.py | 71 +++ .../integrations/mpa_managed/test_gateway.py | 37 +- .../mpa_managed/test_gateway_cloud.py | 69 ++- tests/integrations/mpa_managed/test_iam.py | 311 ++++++++++++ .../test_runtime_deployment_edges.py | 105 ++++ .../integrations/mpa_managed/test_service.py | 173 ++++++- .../test_studio_shared_resources.py | 27 +- tests/integrations/mpa_managed/test_tasks.py | 34 ++ tests/integrations/mpa_managed/test_worker.py | 324 +++++++++++- veadk/cli/frontend_deploy_policy.py | 2 + veadk/integrations/mpa/managed/README.md | 43 +- veadk/integrations/mpa/managed/README.zh.md | 41 +- veadk/integrations/mpa/managed/config.py | 48 ++ veadk/integrations/mpa/managed/diagnostics.py | 10 +- veadk/integrations/mpa/managed/gateway.py | 2 + .../integrations/mpa/managed/gateway_cloud.py | 31 +- veadk/integrations/mpa/managed/iam.py | 332 +++++++++++++ veadk/integrations/mpa/managed/network.py | 241 +++++++-- .../integrations/mpa/managed/network_cloud.py | 8 + veadk/integrations/mpa/managed/runner.py | 3 +- veadk/integrations/mpa/managed/runtime.py | 8 +- veadk/integrations/mpa/managed/service.py | 49 +- veadk/integrations/mpa/managed/skills.py | 18 +- .../mpa/managed/studio_profile.py | 9 +- veadk/integrations/mpa/managed/tasks.py | 8 +- veadk/integrations/mpa/managed/worker.py | 54 +- .../{index-BNPwMQXG.js => index-8JtvDNuA.js} | 18 +- ...DA-6OJrJ.js => CodeDiffEditor-Dvmt5gm9.js} | 2 +- ...9k9b.js => FileExplorerEditor-KCeE5MIo.js} | 2 +- ...fi.js => MarkdownPromptEditor-C8Q2sj5P.js} | 2 +- ....js => QuickAgentCreateDialog-_TpoDPFW.js} | 2 +- .../{arc-fsSJ4XQX.js => arc-B85TaV_o.js} | 2 +- ...hannel-Bbp-1bKw.js => channel-B1gj3-V8.js} | 2 +- ...ex.es-JsJulYHK.js => index.es-DpcOlkkW.js} | 2 +- ...n-aFbI3tiR.js => jspdf.es.min-DVclzE4e.js} | 6 +- ...{linear-Dd6OAXqp.js => linear-WTltCzEJ.js} | 2 +- ...zl.js => abnfDiagram-N423BO3Z-CQmvc3R1.js} | 2 +- ... architectureDiagram-T3A2C74G-ysR-aM43.js} | 2 +- ...Q.js => blockDiagram-VBNYF7ZC-D4I7ydgD.js} | 2 +- ...daIg.js => c4Diagram-5PPSVZJV-CYvD8vq6.js} | 2 +- ...CvII-2ZL.js => chunk-2GRJ4B5K-BNT0kar4.js} | 2 +- ...nvFjhS5b.js => chunk-2Q5K7J3B-BK3jpFNd.js} | 2 +- ...CY1YEJD3.js => chunk-5RXB4S5H-Ln4IekMd.js} | 2 +- ...BDBKcK2Z.js => chunk-5VM5RSS4-BKHSrXIw.js} | 2 +- ...zEQK1XLO.js => chunk-6Q2QTUOP-N9gzANAs.js} | 2 +- ...Cv1ZgaH8.js => chunk-GF5L2VYU-IG64zwph.js} | 2 +- ...DD-BFVC6.js => chunk-JWPE2WC7-DVlhplzu.js} | 2 +- ...DtNDDRN1.js => chunk-KBJHAD2P-C0rklDe7.js} | 2 +- ...DL3iLUXF.js => chunk-RYQCIY6F-C3ekePUg.js} | 2 +- ...B8qTF1qQ.js => chunk-XXDRQBXY-BdI3VXTi.js} | 2 +- .../mermaid/classDiagram-JCYQIIEL-DcvvubKo.js | 1 + .../mermaid/classDiagram-JCYQIIEL-DtPkX3wA.js | 1 - .../classDiagram-v2-OCEON4UE-DcvvubKo.js | 1 + .../classDiagram-v2-OCEON4UE-DtPkX3wA.js | 1 - ...G.js => cose-bilkent-JH36ORCC-0QYD6FmW.js} | 2 +- ...q9B5VP.js => cynefin-OW5HDTMX-BHP1Kvyc.js} | 2 +- ...js => cynefinDiagram-MW4NZA55-DfWTsCcM.js} | 2 +- ...shxLHn3p.js => dagre-VZM6K2ZE-PibdEig-.js} | 2 +- ...mTV4cL.js => diagram-7IWD3JNH-cddjCR_8.js} | 2 +- ...6216sR.js => diagram-B4RE2ZJO-CyMxecTz.js} | 2 +- ...A2jWUX.js => diagram-LBJQPF4R-BE5KJAJ0.js} | 2 +- ...jz8RT3.js => diagram-Q27KOJAE-DiL6LnT_.js} | 2 +- ...SFzlV6.js => diagram-UB23O5K3-AYjZ4Axz.js} | 2 +- ...fQ.js => ebnfDiagram-BXEA7PRR-CX7MIWlm.js} | 2 +- ...wmcS.js => erDiagram-JOGREHBK-54K1t1Ec.js} | 2 +- ..._0.js => flowDiagram-UKHOOZJN-DjW8-Nxh.js} | 2 +- ...b.js => ganttDiagram-PKOTCBZU-DYJw_19U.js} | 2 +- ...s => gitGraphDiagram-DS77QQ5N-CIVsYAyY.js} | 2 +- ...rI.js => infoDiagram-6WML65LV-D6hoQeyX.js} | 2 +- ...s => ishikawaDiagram-WSZJBQD7-Di5hDQFl.js} | 2 +- ...js => journeyDiagram-NVQOT4AX-7MLSoqp5.js} | 2 +- ...=> kanban-definition-27J2QSJJ-L7GQgpCH.js} | 2 +- ...e-y4TF8bTw.js => mermaid.core-DAx4nvmm.js} | 8 +- ...> mindmap-definition-FAOFIHXS-CYwjbq4J.js} | 2 +- ...rT-.js => pegDiagram-VL7TDLO6-DY_WljuU.js} | 2 +- ...jEf.js => pieDiagram-7S7Q4E2Y-VRiU9rtm.js} | 2 +- ...s => quadrantDiagram-CIZ2JOQS-JooZIzGd.js} | 2 +- ...s => railroadDiagram-AXF67PYL-B0NVnjyw.js} | 2 +- ...> requirementDiagram-LRYGKXZP-CAxqjuVx.js} | 2 +- ....js => sankeyDiagram-W5VNT64P-BTjDTukV.js} | 2 +- ...s => sequenceDiagram-SI44F4Z6-CRNvuVv8.js} | 2 +- ...s8.js => sizeCapture-X5ZJPWSS-CNj0yAkQ.js} | 2 +- ...x.js => stateDiagram-OKZ733FA-BvoTa-1C.js} | 2 +- .../stateDiagram-v2-UEYNNEHI-CBC6HwPm.js | 1 - .../stateDiagram-v2-UEYNNEHI-QJ3-Svac.js | 1 + ...uzPS.js => swimlanes-SLNWSIFB-2I6D1dR6.js} | 4 +- .../swimlanesDiagram-ULZ7WXOC-COw-LLw5.js | 8 + .../swimlanesDiagram-ULZ7WXOC-DIP88zHc.js | 8 - ... timeline-definition-Z64GVDOM-mpZy5ZHk.js} | 2 +- ...H1.js => vennDiagram-T6HMQDX7-23c87AQK.js} | 2 +- ...js => wardleyDiagram-T6FBY63Y-jNpCtSMU.js} | 2 +- ...js => xychartDiagram-ELKLHX3M-B9DRjIoI.js} | 2 +- veadk/webui/index.html | 2 +- veadk/webui/website-integration.js | 4 +- 132 files changed, 4391 insertions(+), 214 deletions(-) create mode 100644 prd-spec/bugfixes/frontend-lockfile-sync/2026-10-09-restore-esbuild-lock-entries.md create mode 100644 prd-spec/bugfixes/frontend-lockfile-sync/2026-10-09-restore-esbuild-lock-entries.zh.md create mode 100644 prd-spec/bugfixes/mpa-create-images/2026-10-09-restore-main-images.md create mode 100644 prd-spec/bugfixes/mpa-create-images/2026-10-09-restore-main-images.zh.md create mode 100644 prd-spec/bugfixes/mpa-iam-timeout-compat/2026-10-09-python310-timeout.md create mode 100644 prd-spec/bugfixes/mpa-iam-timeout-compat/2026-10-09-python310-timeout.zh.md create mode 100644 prd-spec/bugfixes/mpa-network-description/2026-10-09-valid-network-marker.md create mode 100644 prd-spec/bugfixes/mpa-network-description/2026-10-09-valid-network-marker.zh.md create mode 100644 prd-spec/bugfixes/mpa-network-discovery/2026-10-09-empty-network-results.md create mode 100644 prd-spec/bugfixes/mpa-network-discovery/2026-10-09-empty-network-results.zh.md create mode 100644 prd-spec/bugfixes/mpa-skill-space-description/2026-10-09-entered-name-description.md create mode 100644 prd-spec/bugfixes/mpa-skill-space-description/2026-10-09-entered-name-description.zh.md create mode 100644 prd-spec/bugfixes/mpa-standard-gateway/2026-10-09-standard-shared-gateway.md create mode 100644 prd-spec/bugfixes/mpa-standard-gateway/2026-10-09-standard-shared-gateway.zh.md create mode 100644 prd-spec/bugfixes/mpa-studio-account/2026-10-09-sts-account.md create mode 100644 prd-spec/bugfixes/mpa-studio-account/2026-10-09-sts-account.zh.md create mode 100644 prd-spec/bugfixes/mpa-subnet-order/2026-10-09-subnet-order.md create mode 100644 prd-spec/bugfixes/mpa-subnet-order/2026-10-09-subnet-order.zh.md create mode 100644 prd-spec/bugfixes/mpa-worker-naming/2026-10-09-runtime-named-worker.md create mode 100644 prd-spec/bugfixes/mpa-worker-naming/2026-10-09-runtime-named-worker.zh.md create mode 100644 prd-spec/bugfixes/mpa-worker-template/2026-10-09-independent-worker.md create mode 100644 prd-spec/bugfixes/mpa-worker-template/2026-10-09-independent-worker.zh.md create mode 100644 prd-spec/bugfixes/mpa-worker-template/2026-10-09-worker-image-defaults.md create mode 100644 prd-spec/bugfixes/mpa-worker-template/2026-10-09-worker-image-defaults.zh.md create mode 100644 prd-spec/features/mpa-runtime-iam/2026-10-09-managed-runtime-role.md create mode 100644 prd-spec/features/mpa-runtime-iam/2026-10-09-managed-runtime-role.zh.md create mode 100644 tests/integrations/mpa_managed/test_iam.py create mode 100644 veadk/integrations/mpa/managed/iam.py rename veadk/webui/assets/app/{index-BNPwMQXG.js => index-8JtvDNuA.js} (98%) rename veadk/webui/assets/chunks/{CodeDiffEditor-DA-6OJrJ.js => CodeDiffEditor-Dvmt5gm9.js} (99%) rename veadk/webui/assets/chunks/{FileExplorerEditor-B8Ub9k9b.js => FileExplorerEditor-KCeE5MIo.js} (96%) rename veadk/webui/assets/chunks/{MarkdownPromptEditor-D6ctFDfi.js => MarkdownPromptEditor-C8Q2sj5P.js} (99%) rename veadk/webui/assets/chunks/{QuickAgentCreateDialog-04pJjJQJ.js => QuickAgentCreateDialog-_TpoDPFW.js} (97%) rename veadk/webui/assets/chunks/{arc-fsSJ4XQX.js => arc-B85TaV_o.js} (98%) rename veadk/webui/assets/chunks/{channel-Bbp-1bKw.js => channel-B1gj3-V8.js} (53%) rename veadk/webui/assets/chunks/{index.es-JsJulYHK.js => index.es-DpcOlkkW.js} (99%) rename veadk/webui/assets/chunks/{jspdf.es.min-aFbI3tiR.js => jspdf.es.min-DVclzE4e.js} (99%) rename veadk/webui/assets/chunks/{linear-Dd6OAXqp.js => linear-WTltCzEJ.js} (98%) rename veadk/webui/assets/visualizations/mermaid/{abnfDiagram-N423BO3Z-RhYMe2zl.js => abnfDiagram-N423BO3Z-CQmvc3R1.js} (86%) rename veadk/webui/assets/visualizations/mermaid/{architectureDiagram-T3A2C74G-C47wDTji.js => architectureDiagram-T3A2C74G-ysR-aM43.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{blockDiagram-VBNYF7ZC-BAJbaVfQ.js => blockDiagram-VBNYF7ZC-D4I7ydgD.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{c4Diagram-5PPSVZJV-CJepdaIg.js => c4Diagram-5PPSVZJV-CYvD8vq6.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{chunk-2GRJ4B5K-CvII-2ZL.js => chunk-2GRJ4B5K-BNT0kar4.js} (93%) rename veadk/webui/assets/visualizations/mermaid/{chunk-2Q5K7J3B-nvFjhS5b.js => chunk-2Q5K7J3B-BK3jpFNd.js} (66%) rename veadk/webui/assets/visualizations/mermaid/{chunk-5RXB4S5H-CY1YEJD3.js => chunk-5RXB4S5H-Ln4IekMd.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{chunk-5VM5RSS4-BDBKcK2Z.js => chunk-5VM5RSS4-BKHSrXIw.js} (83%) rename veadk/webui/assets/visualizations/mermaid/{chunk-6Q2QTUOP-zEQK1XLO.js => chunk-6Q2QTUOP-N9gzANAs.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{chunk-GF5L2VYU-Cv1ZgaH8.js => chunk-GF5L2VYU-IG64zwph.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{chunk-JWPE2WC7-DD-BFVC6.js => chunk-JWPE2WC7-DVlhplzu.js} (78%) rename veadk/webui/assets/visualizations/mermaid/{chunk-KBJHAD2P-DtNDDRN1.js => chunk-KBJHAD2P-C0rklDe7.js} (87%) rename veadk/webui/assets/visualizations/mermaid/{chunk-RYQCIY6F-DL3iLUXF.js => chunk-RYQCIY6F-C3ekePUg.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{chunk-XXDRQBXY-B8qTF1qQ.js => chunk-XXDRQBXY-BdI3VXTi.js} (53%) create mode 100644 veadk/webui/assets/visualizations/mermaid/classDiagram-JCYQIIEL-DcvvubKo.js delete mode 100644 veadk/webui/assets/visualizations/mermaid/classDiagram-JCYQIIEL-DtPkX3wA.js create mode 100644 veadk/webui/assets/visualizations/mermaid/classDiagram-v2-OCEON4UE-DcvvubKo.js delete mode 100644 veadk/webui/assets/visualizations/mermaid/classDiagram-v2-OCEON4UE-DtPkX3wA.js rename veadk/webui/assets/visualizations/mermaid/{cose-bilkent-JH36ORCC-BNlKHYzG.js => cose-bilkent-JH36ORCC-0QYD6FmW.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{cynefin-OW5HDTMX-DBq9B5VP.js => cynefin-OW5HDTMX-BHP1Kvyc.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{cynefinDiagram-MW4NZA55-DScg9_Ly.js => cynefinDiagram-MW4NZA55-DfWTsCcM.js} (98%) rename veadk/webui/assets/visualizations/mermaid/{dagre-VZM6K2ZE-shxLHn3p.js => dagre-VZM6K2ZE-PibdEig-.js} (97%) rename veadk/webui/assets/visualizations/mermaid/{diagram-7IWD3JNH-C3mTV4cL.js => diagram-7IWD3JNH-cddjCR_8.js} (96%) rename veadk/webui/assets/visualizations/mermaid/{diagram-B4RE2ZJO-D66216sR.js => diagram-B4RE2ZJO-CyMxecTz.js} (97%) rename veadk/webui/assets/visualizations/mermaid/{diagram-LBJQPF4R-BZA2jWUX.js => diagram-LBJQPF4R-BE5KJAJ0.js} (94%) rename veadk/webui/assets/visualizations/mermaid/{diagram-Q27KOJAE-Cpjz8RT3.js => diagram-Q27KOJAE-DiL6LnT_.js} (98%) rename veadk/webui/assets/visualizations/mermaid/{diagram-UB23O5K3-2zSFzlV6.js => diagram-UB23O5K3-AYjZ4Axz.js} (95%) rename veadk/webui/assets/visualizations/mermaid/{ebnfDiagram-BXEA7PRR-_XPQYYfQ.js => ebnfDiagram-BXEA7PRR-CX7MIWlm.js} (87%) rename veadk/webui/assets/visualizations/mermaid/{erDiagram-JOGREHBK-CKTuwmcS.js => erDiagram-JOGREHBK-54K1t1Ec.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{flowDiagram-UKHOOZJN-BtIca__0.js => flowDiagram-UKHOOZJN-DjW8-Nxh.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{ganttDiagram-PKOTCBZU-BsTpL-yb.js => ganttDiagram-PKOTCBZU-DYJw_19U.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{gitGraphDiagram-DS77QQ5N-DupWgFfq.js => gitGraphDiagram-DS77QQ5N-CIVsYAyY.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{infoDiagram-6WML65LV-Dl6zW5rI.js => infoDiagram-6WML65LV-D6hoQeyX.js} (69%) rename veadk/webui/assets/visualizations/mermaid/{ishikawaDiagram-WSZJBQD7-NBIjIwSA.js => ishikawaDiagram-WSZJBQD7-Di5hDQFl.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{journeyDiagram-NVQOT4AX-D1RTQQch.js => journeyDiagram-NVQOT4AX-7MLSoqp5.js} (98%) rename veadk/webui/assets/visualizations/mermaid/{kanban-definition-27J2QSJJ-C8voMCH4.js => kanban-definition-27J2QSJJ-L7GQgpCH.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{mermaid.core-y4TF8bTw.js => mermaid.core-DAx4nvmm.js} (98%) rename veadk/webui/assets/visualizations/mermaid/{mindmap-definition-FAOFIHXS-oi9y3HSE.js => mindmap-definition-FAOFIHXS-CYwjbq4J.js} (98%) rename veadk/webui/assets/visualizations/mermaid/{pegDiagram-VL7TDLO6-CYzndrT-.js => pegDiagram-VL7TDLO6-DY_WljuU.js} (87%) rename veadk/webui/assets/visualizations/mermaid/{pieDiagram-7S7Q4E2Y-B1kVpjEf.js => pieDiagram-7S7Q4E2Y-VRiU9rtm.js} (96%) rename veadk/webui/assets/visualizations/mermaid/{quadrantDiagram-CIZ2JOQS-Ce1mswm1.js => quadrantDiagram-CIZ2JOQS-JooZIzGd.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{railroadDiagram-AXF67PYL-VReUdmSC.js => railroadDiagram-AXF67PYL-B0NVnjyw.js} (84%) rename veadk/webui/assets/visualizations/mermaid/{requirementDiagram-LRYGKXZP-BMkVtH2s.js => requirementDiagram-LRYGKXZP-CAxqjuVx.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{sankeyDiagram-W5VNT64P-gHIvLiGA.js => sankeyDiagram-W5VNT64P-BTjDTukV.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{sequenceDiagram-SI44F4Z6-D6lfXAnD.js => sequenceDiagram-SI44F4Z6-CRNvuVv8.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{sizeCapture-X5ZJPWSS-DguhcNs8.js => sizeCapture-X5ZJPWSS-CNj0yAkQ.js} (87%) rename veadk/webui/assets/visualizations/mermaid/{stateDiagram-OKZ733FA-CPFdYVIx.js => stateDiagram-OKZ733FA-BvoTa-1C.js} (96%) delete mode 100644 veadk/webui/assets/visualizations/mermaid/stateDiagram-v2-UEYNNEHI-CBC6HwPm.js create mode 100644 veadk/webui/assets/visualizations/mermaid/stateDiagram-v2-UEYNNEHI-QJ3-Svac.js rename veadk/webui/assets/visualizations/mermaid/{swimlanes-SLNWSIFB-DEO6uzPS.js => swimlanes-SLNWSIFB-2I6D1dR6.js} (99%) create mode 100644 veadk/webui/assets/visualizations/mermaid/swimlanesDiagram-ULZ7WXOC-COw-LLw5.js delete mode 100644 veadk/webui/assets/visualizations/mermaid/swimlanesDiagram-ULZ7WXOC-DIP88zHc.js rename veadk/webui/assets/visualizations/mermaid/{timeline-definition-Z64GVDOM-CKcwRGgc.js => timeline-definition-Z64GVDOM-mpZy5ZHk.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{vennDiagram-T6HMQDX7-DpGQcsH1.js => vennDiagram-T6HMQDX7-23c87AQK.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{wardleyDiagram-T6FBY63Y-CUlxVcoQ.js => wardleyDiagram-T6FBY63Y-jNpCtSMU.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{xychartDiagram-ELKLHX3M-Cqf4o1Vh.js => xychartDiagram-ELKLHX3M-B9DRjIoI.js} (99%) diff --git a/frontend/src/i18n/resources/en-US/ui.json b/frontend/src/i18n/resources/en-US/ui.json index 16d1552fc..23fe015b6 100644 --- a/frontend/src/i18n/resources/en-US/ui.json +++ b/frontend/src/i18n/resources/en-US/ui.json @@ -1654,6 +1654,12 @@ "cancelDescription": "Cancellation stops subsequent steps. Created databases, Skill Spaces, gateways and other registered resources are retained. Retry using the same agent ID.", "background": "Creation continues after closing this window. Open it again to view progress.", "pollFailed": "Progress is temporarily unavailable. Reconnecting; avoid creating another agent.", + "iamPermissionDenied": "The deployment service lacks IAM permissions to prepare the runtime role. Ask an administrator to grant access, then retry.", + "iamTrustConflict": "The runtime role trust is incompatible. Ask an administrator to check VeFaaS and APIG access, then retry.", + "iamPolicyConflict": "An existing runtime policy with the required name has conflicting contents. Ask an administrator to check it, then retry.", + "iamOwnershipConflict": "The runtime role does not belong to the deployment account. Ask an administrator to check it, then retry.", + "iamVerificationFailed": "Runtime role permissions could not be confirmed. Check IAM availability and policies, then retry.", + "iamConfigurationConflict": "Automatic runtime role preparation requires the default MPA role. Check the server creation configuration.", "creationFailed": "This step failed. Check its resources, server configuration and permissions, then retry the same agent ID.", "cancelFailed": "Cancellation failed. Check the current progress and retry.", "cancelled": "Creation cancelled. Registered resources are retained for retry.", @@ -1669,6 +1675,7 @@ }, "stages": { "queued": "Queued", + "iam_role": "Prepare runtime role", "checking": "Checking account and configuration", "network": "Preparing VPC and subnets", "gateway": "Preparing APIG and IM Gateway", diff --git a/frontend/src/i18n/resources/zh-CN/ui.json b/frontend/src/i18n/resources/zh-CN/ui.json index 8e06e6883..0bb1eb2e4 100644 --- a/frontend/src/i18n/resources/zh-CN/ui.json +++ b/frontend/src/i18n/resources/zh-CN/ui.json @@ -1654,6 +1654,12 @@ "cancelDescription": "取消后会停止后续步骤。已创建的数据库、技能空间、网关和其他已登记资源会保留,可使用同一智能体 ID 重试。", "background": "关闭窗口后创建会继续。再次打开可查看进度。", "pollFailed": "暂时无法获取进度,正在重新连接。请勿重复创建其他智能体。", + "iamPermissionDenied": "部署服务没有准备运行角色所需的 IAM 权限,请联系管理员授权后重试。", + "iamTrustConflict": "运行角色的信任关系不符合要求,请管理员检查对 VeFaaS 和 APIG 的授权后重试。", + "iamPolicyConflict": "运行角色所需的同名权限策略内容冲突,请管理员检查后重试。", + "iamOwnershipConflict": "运行角色与当前部署账号不匹配,请管理员检查后重试。", + "iamVerificationFailed": "尚未确认运行角色的权限已就绪,请检查 IAM 服务及策略可用性后重试。", + "iamConfigurationConflict": "自动准备运行角色仅支持默认 MPA 角色,请检查服务端创建配置。", "creationFailed": "当前步骤未完成,请检查对应资源、服务端配置及权限后,用同一智能体 ID 重试。", "cancelFailed": "取消请求失败,请重新查询进度后重试。", "cancelled": "创建已取消,已登记资源保留供重试。", @@ -1669,6 +1675,7 @@ }, "stages": { "queued": "等待开始", + "iam_role": "准备运行角色", "checking": "检查账号与配置", "network": "准备 VPC 和子网", "gateway": "准备 APIG 和 IM Gateway", diff --git a/frontend/tests/mpaCreation.test.tsx b/frontend/tests/mpaCreation.test.tsx index be9f2c621..bc33ae018 100644 --- a/frontend/tests/mpaCreation.test.tsx +++ b/frontend/tests/mpaCreation.test.tsx @@ -922,3 +922,38 @@ it("keeps disabled and loading appearance consistent across shared Button varian css.remove(); } }); + +it("preserves the runtime role stage and actionable IAM error for retry", async () => { + const input = { + region: "cn-beijing", + requestId: "12345678-90ab-4cde-8f01-23456789abcd", + agentId: "mi-1234567890ab4cde8f012345", + description: "", + }; + sessionStorage.setItem( + "mpa-create:cn-beijing", + JSON.stringify({ input, submitted: true, step: 2, taskId: "iam-task" }), + ); + vi.mocked(api.getMpaCreationConfig).mockResolvedValue({ + configured: true, + region: "cn-beijing", + }); + vi.mocked(api.getMpaCreation).mockResolvedValue({ + ...input, + taskId: "iam-task", + state: "failed", + stage: "iam_role", + error: "iamPermissionDenied", + }); + await mount(); + expect(document.body.textContent).toContain( + "myAgents.mpaCreate.stages.iam_role", + ); + expect(document.body.textContent).toContain( + "myAgents.mpaCreate.iamPermissionDenied", + ); + expect(button("retry").disabled).toBe(false); + expect( + JSON.parse(sessionStorage.getItem("mpa-create:cn-beijing")!).input.agentId, + ).toBe(input.agentId); +}); diff --git a/prd-spec/bugfixes/frontend-lockfile-sync/2026-10-09-restore-esbuild-lock-entries.md b/prd-spec/bugfixes/frontend-lockfile-sync/2026-10-09-restore-esbuild-lock-entries.md new file mode 100644 index 000000000..e959f2138 --- /dev/null +++ b/prd-spec/bugfixes/frontend-lockfile-sync/2026-10-09-restore-esbuild-lock-entries.md @@ -0,0 +1,84 @@ +# Restore Frontend esbuild Lock Entries + +[中文版](2026-10-09-restore-esbuild-lock-entries.zh.md) + +## Metadata + +- Change ID: `frontend-lockfile-sync` +- Created: 2026-10-09 +- Revised: 2026-10-09 +- Status: implemented +- Related component specs: none; this change restores generated dependency metadata without changing component contracts + +## Background and Evidence + +Pull request #23 fails the Harness Sidecar Release Gate during `npm ci --ignore-scripts`. The CI log reports that `esbuild@0.28.2` and its platform packages are missing from `frontend/package-lock.json`. + +`frontend/package.json` is identical to `origin/main`. Commit `3f134207` removed 512 lock-file lines, including Vitest's nested esbuild package and platform-specific optional packages, without changing dependency declarations. The confirmed root cause is an incomplete generated lock file. + +## Goals and Non-goals + +### Goals + +- Restore a lock file that is complete for supported CI platforms. +- Make `npm ci --ignore-scripts` and the affected frontend release gate pass. +- Preserve all declared dependency versions and product behavior. + +### Non-goals + +- Change frontend dependencies or version ranges. +- Change Studio UI, runtime behavior, or harness-sidecar contracts. +- Modify unrelated PR #23 implementation files. + +## Scenarios and Requirements + +### Scenario + +Given the unchanged `frontend/package.json`, when CI runs `npm ci --ignore-scripts` on Linux, then npm must resolve the exact lock-file graph without reporting missing esbuild packages. + +- `FR-1`: `frontend/package-lock.json` must contain the dependency graph generated for the current `frontend/package.json`. +- `FR-2`: The fix must not change `frontend/package.json` or component behavior. +- `FR-3`: The affected frontend gate, normal frontend tests, and production build must pass locally. + +## Design and Contract Impact + +Restore `frontend/package-lock.json` to the complete `origin/main` version because `frontend/package.json` is unchanged and the branch-only lock diff consists solely of accidental deletions. + +- Interfaces and state: not applicable; no source contract changes. +- Concurrency and permissions: not applicable. +- Security: no credentials or external inputs are added. +- Compatibility: restores Linux CI compatibility while preserving dependency declarations. +- Component specs: no impact; the change corrects generated package metadata only. +- User documentation: no impact. + +Alternative rejected: running a broad dependency upgrade. It would create unrelated version churn and does not address the confirmed accidental deletion narrowly. + +## Implementation Tasks + +- `T-1` (`FR-1`, `FR-2`): restore `frontend/package-lock.json` from `origin/main`. +- `T-2` (`FR-3`): run the affected installation, coverage, test, and build commands. +- `T-3`: review the final diff for unrelated changes and record verification evidence. + +## Verification and Acceptance + +| Requirement | Task | Acceptance criterion | Verification | Result | +| --- | --- | --- | --- | --- | +| `FR-1` | `T-1` | `AC-1`: npm accepts the lock file | `npm --prefix frontend ci --ignore-scripts` | pass: 695 packages installed | +| `FR-2` | `T-1`, `T-3` | `AC-2`: dependency declarations and component contracts are unchanged | `git diff origin/main -- frontend/package.json` and diff review | pass: no package declaration or contract diff | +| `FR-3` | `T-2` | `AC-3`: affected coverage gate passes | `npm --prefix frontend run test:harness-sidecar-coverage` | pass: 22 tests | +| `FR-3` | `T-2` | `AC-4`: frontend tests pass | `npm --prefix frontend test` | pass: 1,377 Node tests and 65 Vitest tests | +| `FR-3` | `T-2` | `AC-5`: production build passes | `npm --prefix frontend run build` | pass | + +## Risks and Open Questions + +- `npm run build` may regenerate tracked web assets. Any generated diff must be reviewed and retained only if it is required by the current source. +- No open design questions remain. + +## Review and Delivery Record + +- 2026-10-09: Root cause confirmed from PR #23 CI logs and the branch diff. +- 2026-10-09: Design review found no contract, security, compatibility, or testability blocker. +- 2026-10-09: The user approved restoring the complete lock file and running the frontend gates. +- 2026-10-09: Restored the 512 deleted lock-file lines from `origin/main`; installation, affected coverage, complete frontend tests, and production build passed on diff scope `d3370fd1` plus this working-tree fix. +- 2026-10-09: `npm ci` reported existing dependency audit findings (6 low, 3 moderate, 6 high, 1 critical); dependency remediation is outside this lock restoration. +- Commit, push, and PR updates remain separately authorized operations. diff --git a/prd-spec/bugfixes/frontend-lockfile-sync/2026-10-09-restore-esbuild-lock-entries.zh.md b/prd-spec/bugfixes/frontend-lockfile-sync/2026-10-09-restore-esbuild-lock-entries.zh.md new file mode 100644 index 000000000..04d03027f --- /dev/null +++ b/prd-spec/bugfixes/frontend-lockfile-sync/2026-10-09-restore-esbuild-lock-entries.zh.md @@ -0,0 +1,84 @@ +# 恢复前端 esbuild 锁文件条目 + +[English](2026-10-09-restore-esbuild-lock-entries.md) + +## 元数据 + +- 变更 ID:`frontend-lockfile-sync` +- 创建日期:2026-10-09 +- 修订日期:2026-10-09 +- 状态:implemented +- 相关组件规格:无;本变更仅恢复生成的依赖元数据,不改变组件契约 + +## 背景与证据 + +PR #23 在 Harness Sidecar Release Gate 的 `npm ci --ignore-scripts` 阶段失败。CI 日志报告 `frontend/package-lock.json` 缺少 `esbuild@0.28.2` 及其平台包。 + +`frontend/package.json` 与 `origin/main` 完全一致。提交 `3f134207` 在未修改依赖声明的情况下删除了 512 行锁文件内容,其中包括 Vitest 嵌套的 esbuild 包和平台专属可选包。已确认的根因是生成的锁文件不完整。 + +## 目标与非目标 + +### 目标 + +- 恢复对受支持 CI 平台完整的锁文件。 +- 使 `npm ci --ignore-scripts` 和受影响的前端发布 gate 通过。 +- 保持所有声明的依赖版本和产品行为不变。 + +### 非目标 + +- 修改前端依赖或版本范围。 +- 修改 Studio UI、运行时行为或 harness-sidecar 契约。 +- 修改 PR #23 中无关的实现文件。 + +## 场景与需求 + +### 场景 + +给定未变化的 `frontend/package.json`,当 CI 在 Linux 上运行 `npm ci --ignore-scripts` 时,npm 必须能够解析精确的锁文件依赖图,并且不报告缺少 esbuild 包。 + +- `FR-1`:`frontend/package-lock.json` 必须包含当前 `frontend/package.json` 对应的完整依赖图。 +- `FR-2`:修复不得改变 `frontend/package.json` 或组件行为。 +- `FR-3`:受影响的前端 gate、常规前端测试和生产构建必须在本地通过。 + +## 设计与契约影响 + +将 `frontend/package-lock.json` 恢复为完整的 `origin/main` 版本,因为 `frontend/package.json` 未变化,且分支独有的锁文件差异仅包含意外删除。 + +- 接口与状态:不适用;没有源码契约变更。 +- 并发与权限:不适用。 +- 安全:不新增凭据或外部输入。 +- 兼容性:恢复 Linux CI 兼容性,同时保持依赖声明不变。 +- 组件规格:无影响;本变更只修正生成的包元数据。 +- 用户文档:无影响。 + +已拒绝的替代方案:执行广泛的依赖升级。该方案会产生无关的版本变动,且不能精确解决已确认的意外删除。 + +## 实施任务 + +- `T-1`(`FR-1`、`FR-2`):从 `origin/main` 恢复 `frontend/package-lock.json`。 +- `T-2`(`FR-3`):运行受影响的安装、覆盖率、测试和构建命令。 +- `T-3`:检查最终差异是否存在无关变更,并记录验证证据。 + +## 验证与验收 + +| 需求 | 任务 | 验收标准 | 验证命令 | 结果 | +| --- | --- | --- | --- | --- | +| `FR-1` | `T-1` | `AC-1`:npm 接受锁文件 | `npm --prefix frontend ci --ignore-scripts` | pass:安装 695 个包 | +| `FR-2` | `T-1`、`T-3` | `AC-2`:依赖声明和组件契约未变化 | `git diff origin/main -- frontend/package.json` 和差异审查 | pass:无依赖声明或契约差异 | +| `FR-3` | `T-2` | `AC-3`:受影响的覆盖率 gate 通过 | `npm --prefix frontend run test:harness-sidecar-coverage` | pass:22 项测试 | +| `FR-3` | `T-2` | `AC-4`:前端测试通过 | `npm --prefix frontend test` | pass:1,377 项 Node 测试和 65 项 Vitest 测试 | +| `FR-3` | `T-2` | `AC-5`:生产构建通过 | `npm --prefix frontend run build` | pass | + +## 风险与待决问题 + +- `npm run build` 可能重新生成已跟踪的 Web 资产。必须审查所有生成差异,只保留当前源码确实需要的内容。 +- 没有待决设计问题。 + +## 审查与交付记录 + +- 2026-10-09:根据 PR #23 CI 日志和分支差异确认根因。 +- 2026-10-09:设计审查未发现契约、安全、兼容性或可测试性阻塞项。 +- 2026-10-09:用户批准恢复完整锁文件并运行前端 gate。 +- 2026-10-09:从 `origin/main` 恢复被删除的 512 行锁文件内容;在 `d3370fd1` 加本工作区修复的差异范围内,依赖安装、受影响的覆盖率、完整前端测试和生产构建均通过。 +- 2026-10-09:`npm ci` 报告既有依赖审计问题(6 个 low、3 个 moderate、6 个 high、1 个 critical);依赖修复不属于本次锁文件恢复范围。 +- 提交、推送和更新 PR 仍需单独授权。 diff --git a/prd-spec/bugfixes/mpa-create-images/2026-10-09-restore-main-images.md b/prd-spec/bugfixes/mpa-create-images/2026-10-09-restore-main-images.md new file mode 100644 index 000000000..df6ee167e --- /dev/null +++ b/prd-spec/bugfixes/mpa-create-images/2026-10-09-restore-main-images.md @@ -0,0 +1,56 @@ +# Restore main MPA creation image defaults + +[中文版](2026-10-09-restore-main-images.zh.md) + +- Change ID: `restore-main-images` +- Date: 2026-10-09 +- Status: approved by the user's explicit request to withdraw public image discovery; implemented and locally verified; not committed or pushed. + +## Background and evidence + +A Worker CreateTool request failed with `InvalidParameter.ImageUrl` after Studio selected a public image using a digest reference. The user requires withdrawing the public registry discovery change and following main's two `/mpa/` `:latest` defaults. The earlier creation-page correction already follows main. + +## Scope, scenarios and requirements + +- FR-1: Restore built-in MPA image `agentkit-platform-2112682748-cn-beijing.cr.volces.com/mpa/mpa_agent:latest` and Worker image `agentkit-platform-2112682748-cn-beijing.cr.volces.com/mpa/mpa_codex_worker:latest`. Config inspection and POST use local profile defaults, without registry queries or digest conversion. +- FR-2: Restore main's creation dialog/client wiring and regressions. Remove discovery-only resolver, fixtures, tests, request-image helper and timeout/query extensions. Keep legacy explicit API images and pre-existing first-submission image snapshots. +- FR-3: Preserve STS-derived deployment account, automatic IAM preparation, network/APIG fixes, independent Worker creation, safe IAM diagnostics and main's named creation/basic details. +- FR-4: Reconcile bilingual specs/docs and regenerate packaged WebUI assets. Remove the withdrawn feature's documentation and accidental Vite cache artifact. + +Non-goals: database/task/registry edits, clearing pending intents, live deployment, migration, committing or pushing. An old failed request may still contain the rejected digest in its immutable snapshot; it must not silently change on retry. A fresh request uses the restored defaults. `latest` is mutable and does not guarantee immutable image content across time. + +## Design, affected files and contract assessment + +Restore main versions of Studio routes, API client, dialog and image/name tests; retain IAM regression coverage. Change only image settings in `managed/studio_profile.py`, preserving its new-account/IAM/reference-free settings. Remove `frontend/server/mpa_creation_images.py`, discovery-only tests/conftest, and `CreationTasks.request_images`. Keep `CreationTasks.start` snapshot semantics unchanged. Current ownership/API defaults are maintained by [Studio creation CON-1/CON-9](../../../specs/studio-mpa-creation/README.md); restore their local-default contract in both languages. Other resource contracts are unchanged. Remove the superseded public-image PRD pair and point current specs to this correction. + +## Tasks, tests and acceptance + +1. T-1 / FR-1: Restore main's route/name regression expectations and observe failure against the discovery implementation. +2. T-2 / FR-1–FR-3: Withdraw discovery wiring and restore defaults; assert other branch behavior remains in the diff. +3. T-3 / FR-4: Synchronize documents and build assets; run creation/CLI Python tests, changed-file Ruff/Pyright, frontend tests/build/i18n/assets, pre-commit and an isolated browser flow. + +Acceptance: exact default URLs in config and new task snapshots, no discovery code references or network dependency, unchanged legacy snapshots/owner isolation, main form without image fields, intact new-account changes, passing affected gates. No cloud writes are needed to prove the rollback; live cloud pull/readiness remains unverified. + +## Review and risks + +`review-spec` is unavailable; direct review covers scope, bilingual equivalence, compatibility, ownership, secret exclusion, retries, cancellation and tests. The user explicitly approved withdrawal; no further approval is required for this bounded rollback. Existing failed digest snapshots and mutable latest tags are the known limits. No blockers. + +## Verification + +Scope: uncommitted rollback against `df797f94`, using `origin/main` at `f6ed8ffa` as the reference. Execution date: 2026-10-09. T-1–T-3 and FR-1–FR-4 are complete within local rollback scope. + +| Check | Outcome | Evidence | +| --- | --- | --- | +| Regression first | pass | Restored `test_new_creation_generates_owner_scoped_id_and_latest_images` and `test_authorized_config_returns_defaults_and_task_freezes_them`; both failed before withdrawal and pass after it. | +| `uv run --extra dev pytest tests/integrations/mpa_managed tests/cli/test_cli_mpa.py -n 2 -q` | pass | 614 passed, 10 warnings; 2 workers selected for the local machine. | +| `npm --prefix frontend test` | pass | 1,377 Node tests and 65 Vitest tests passed; no skips. Covers recovery, retry, errors, cancellation, loading, keyboard/IME and owner isolation. | +| `npm --prefix frontend run build` | pass | App and widget built, packaged assets regenerated. Existing chunk-size/dependency warnings remain non-blocking. | +| `npm --prefix frontend run check:i18n` / `run test:webui-assets` | pass | 2 locales / 21 namespaces; 113 files and 350 internal references verified. | +| Changed-file Ruff / Pyright | pass | `uvx --from ruff==0.11.12 ruff check` and `uvx pyright --pythonpath .venv/bin/python` for the route, profile, tasks and two restored test modules: no findings. | +| `uv run --extra dev pre-commit run --all-files` | pass | Ruff check/format, hardcoded secret detection and YAML secret scanning passed. | +| Isolated real browser | pass | Mock configuration only: name required, description preserved, all three steps, no image inputs; final create entry enabled. 390×844 viewport has no horizontal overflow. No real submission; temporary files, tab and Vite process removed. | +| Contract/diff review | pass | Route/client/dialog match main; profile retains STS/IAM/reference-free differences, tasks retain IAM diagnostics. No runtime discovery references or dangling withdrawn-PRD links. Bilingual identifiers and links checked; `git diff --check` passed. | +| Real cloud creation / pull readiness | not_run | No cloud mutation authorized for this rollback. Existing failed task snapshots were not edited; start a fresh request after reloading Studio to use new defaults. | +| Full SDK regression / harness smoke | not_applicable | This rollback affects only managed Studio image selection and restores main contracts; shared SDK and sidecar behavior are unchanged. | + +Local tests prove default selection and compatibility, not that cloud services accept or can pull either mutable tag. The user's existing Studio process was not restarted. diff --git a/prd-spec/bugfixes/mpa-create-images/2026-10-09-restore-main-images.zh.md b/prd-spec/bugfixes/mpa-create-images/2026-10-09-restore-main-images.zh.md new file mode 100644 index 000000000..7c102fe39 --- /dev/null +++ b/prd-spec/bugfixes/mpa-create-images/2026-10-09-restore-main-images.zh.md @@ -0,0 +1,56 @@ +# 恢复 main 的 MPA 创建镜像默认值 + +[English](2026-10-09-restore-main-images.md) + +- Change ID:`restore-main-images` +- 日期:2026-10-09 +- 状态:用户明确要求撤回公开镜像查询,已批准;已实施并完成本地验证;未提交或推送。 + +## 背景与证据 + +Studio 通过 digest 引用选择公开镜像后,Worker CreateTool 请求返回 `InvalidParameter.ImageUrl`。用户要求撤回公开仓库查询改动,并遵循 main 的两个 `/mpa/` `:latest` 默认镜像。此前创建页面修正已遵循 main。 + +## 范围、场景与需求 + +- FR-1:恢复内置 MPA 镜像 `agentkit-platform-2112682748-cn-beijing.cr.volces.com/mpa/mpa_agent:latest` 和 Worker 镜像 `agentkit-platform-2112682748-cn-beijing.cr.volces.com/mpa/mpa_codex_worker:latest`。配置检查和 POST 使用本地 profile 默认值,不查询仓库或转换 digest。 +- FR-2:恢复 main 的创建弹窗/客户端接线和回归。删除仅供查询使用的解析器、fixture、测试、请求镜像查询方法及超时/查询参数扩展。保留旧 API 显式镜像和此前已有的首次提交镜像快照。 +- FR-3:保留 STS 推导部署账号、自动 IAM 准备、网络/APIG 修复、独立 Worker 创建、安全 IAM 诊断,以及 main 的名称创建/基本详情。 +- FR-4:同步双语契约/说明并重新生成 WebUI 产物。删除已撤回功能的文档及误提交的 Vite 缓存产物。 + +非目标:修改数据库/任务/注册库、清空未完成意图、真实部署、迁移、提交或推送。旧失败请求的不可变快照可能仍包含被拒绝的 digest;重试不得静默更换。新请求使用恢复的默认值。`latest` 可变,不能保证不同时刻镜像内容不变。 + +## 设计、影响文件与契约评估 + +恢复 main 版本的 Studio 路由、API 客户端、弹窗及镜像/名称测试;保留 IAM 回归覆盖。仅调整 `managed/studio_profile.py` 的镜像设置,保留新账号/IAM/无参考模板配置。删除 `frontend/server/mpa_creation_images.py`、仅用于仓库查询的测试/conftest,以及 `CreationTasks.request_images`。`CreationTasks.start` 快照语义不变。当前归属/API 默认值由 [Studio 创建 CON-1/CON-9](../../../specs/studio-mpa-creation/README.zh.md) 维护;双语均恢复本地默认值合同。其他资源合同不变。删除已取代的公开镜像 PRD,当前契约改为链接此次修正。 + +## 任务、测试与验收 + +1. T-1 / FR-1:恢复 main 路由/名称回归期望,先在查询实现上观察失败。 +2. T-2 / FR-1–FR-3:撤回查询接线并恢复默认值;通过 diff 确认本分支其他行为保留。 +3. T-3 / FR-4:同步文档并构建产物;运行创建/CLI Python 测试、改动文件 Ruff/Pyright、前端测试/构建/i18n/产物、pre-commit 及隔离浏览器流程。 + +验收:配置和新任务快照中包含准确的默认 URL,无查询代码引用或仓库网络依赖,旧快照/owner 隔离不变,main 表单不提供镜像字段,新账号改动完整保留,受影响检查通过。无需云写入证明撤回;真实云端拉取/就绪仍未验证。 + +## 审查与风险 + +`review-spec` 不可用;直接审查覆盖范围、双语等价、兼容性、归属、密钥排除、重试、取消和测试。用户明确批准撤回,此范围内无需再次批准。旧失败 digest 快照和可变 latest 标签是已知限制,无阻塞项。 + +## 验证 + +范围:相对 `df797f94` 的未提交撤回,参考 `origin/main` 的 `f6ed8ffa`。执行日期:2026-10-09。T-1–T-3、FR-1–FR-4 在本地撤回范围内完成。 + +| 检查 | 结果 | 证据 | +| --- | --- | --- | +| 回归先行 | pass | 恢复 `test_new_creation_generates_owner_scoped_id_and_latest_images` 与 `test_authorized_config_returns_defaults_and_task_freezes_them`;撤回前两项失败,撤回后通过。 | +| `uv run --extra dev pytest tests/integrations/mpa_managed tests/cli/test_cli_mpa.py -n 2 -q` | pass | 614 项通过,10 条警告;本机采用 2 个 worker。 | +| `npm --prefix frontend test` | pass | 1,377 项 Node 测试与 65 项 Vitest 测试通过,无跳过。覆盖恢复、重试、错误、取消、加载、键盘/IME 和 owner 隔离。 | +| `npm --prefix frontend run build` | pass | App 与 widget 构建通过,包内产物已重新生成。已有包体积/依赖警告不阻塞。 | +| `npm --prefix frontend run check:i18n` / `run test:webui-assets` | pass | 2 种语言 / 21 个 namespace;验证 113 个文件及 350 个内部引用。 | +| 改动文件 Ruff / Pyright | pass | 对路由、profile、tasks 和两个恢复的测试模块运行 `uvx --from ruff==0.11.12 ruff check` 与 `uvx pyright --pythonpath .venv/bin/python`:无问题。 | +| `uv run --extra dev pre-commit run --all-files` | pass | Ruff check/format、硬编码密钥检测和 YAML 密钥扫描通过。 | +| 隔离真实浏览器 | pass | 仅模拟配置:名称必填、描述保留、三步流程、无镜像输入;最终创建入口可用。390×844 窗口无横向溢出。未实际提交;临时文件、标签和 Vite 进程已清理。 | +| 契约/diff 审查 | pass | 路由/客户端/弹窗与 main 一致;profile 保留 STS/IAM/无参考模板差异,tasks 保留 IAM 诊断。无运行时查询引用或已撤回 PRD 的悬空链接。双语标识符、链接已核对;`git diff --check` 通过。 | +| 真实云创建 / 拉取就绪 | not_run | 此次撤回未授权云修改。未编辑旧失败任务快照;重载 Studio 后新建请求以使用新默认值。 | +| 全量 SDK 回归 / harness smoke | not_applicable | 此次仅撤回托管 Studio 镜像选择并恢复 main 合同;共享 SDK 与 sidecar 行为不变。 | + +本地测试证明默认值选择和兼容性,不证明云服务接受或可拉取这两个可变标签。未重启用户现有 Studio 进程。 diff --git a/prd-spec/bugfixes/mpa-iam-timeout-compat/2026-10-09-python310-timeout.md b/prd-spec/bugfixes/mpa-iam-timeout-compat/2026-10-09-python310-timeout.md new file mode 100644 index 000000000..8837a6b31 --- /dev/null +++ b/prd-spec/bugfixes/mpa-iam-timeout-compat/2026-10-09-python310-timeout.md @@ -0,0 +1,82 @@ +# Preserve IAM Timeout Semantics on Python 3.10 + +[中文版](2026-10-09-python310-timeout.zh.md) + +## Metadata + +- Change ID: `mpa-iam-timeout-compat` +- Created: 2026-10-09 +- Revised: 2026-10-09 +- Status: implemented +- Related component specs: none; the existing IAM failure contract is preserved + +## Background and Evidence + +PR #23 fails the Python 3.10 unit-test job in +`test_readback_timeout_and_cancellation_keep_resources`. The managed MPA IAM +reconciler wraps `asyncio.wait_for()` with `except TimeoutError`. On Python +3.10, `asyncio.wait_for()` raises `asyncio.TimeoutError`, which is not caught by +the built-in `TimeoutError` handler. Python 3.11 and newer alias these exception +types, which hid the compatibility defect in newer local environments. + +The CI result was 6,497 passed and one failed. The uncaught timeout escapes +instead of being translated to the existing `IamError` with +`iamVerificationFailed`. + +## Goals and Non-goals + +### Goals + +- Preserve the existing IAM verification failure behavior on Python 3.10. +- Keep cancellation propagation and resource retention unchanged. +- Make the existing regression test pass on Python 3.10 and current Python. + +### Non-goals + +- Change IAM resources, permissions, retry timing, or reconciliation order. +- Change the public error contract or add a new fallback. +- Modify unrelated MPA behavior. + +## Requirements and Design + +- `FR-1`: A timeout from `asyncio.wait_for()` must be translated to the existing + `IamError`. +- `FR-2`: Caller cancellation must continue to propagate as + `asyncio.CancelledError`. +- `FR-3`: The fix must work on Python 3.10 and Python 3.12 without changing + functional IAM logic. + +Use `except asyncio.TimeoutError` at the existing translation boundary. This is +the exception raised by `asyncio.wait_for()` on Python 3.10 and remains +compatible with newer Python versions. + +Component contract impact: none. The implementation is corrected to satisfy the +already-tested timeout and cancellation contract. No interfaces, configuration, +permissions, persistence, security boundaries, or user documentation change. + +## Tasks and Acceptance + +| Requirement | Task | Acceptance | Verification | Result | +| --- | --- | --- | --- | --- | +| `FR-1` | `T-1`: reproduce before the fix | Python 3.10 exposes the uncaught timeout | Python 3.10 targeted pytest | pass: reproduced the uncaught `asyncio.TimeoutError` | +| `FR-1`, `FR-3` | `T-2`: use `asyncio.TimeoutError` | Existing timeout translation passes | Python 3.10 and 3.12 targeted pytest | pass: 13 tests on each version | +| `FR-2` | `T-2` | Existing cancellation assertion passes | Same targeted pytest | pass | +| `FR-3` | `T-3`: static verification | Changed Python file is clean | Ruff and Pyright | pass | + +## Risks and Open Questions + +- Risk is limited to the exception selector at the existing timeout boundary. +- No open questions remain. + +## Review and Delivery Record + +- 2026-10-09: CI traceback confirmed the Python 3.10 exception mismatch. +- 2026-10-09: Design review found no contract, security, or compatibility + blocker. +- 2026-10-09: The user approved a compatibility-only fix and explicitly + requested no functional behavior change. +- 2026-10-09: Python 3.10 reproduced the failure before the fix. After the + one-line exception qualification, the IAM tests passed on Python 3.10.20 and + Python 3.12.13 (13 tests each), the Python 3.12 managed MPA suite passed (664 + tests), and Ruff 0.11.12 and Pyright passed. +- Commit and push require separate authorization. diff --git a/prd-spec/bugfixes/mpa-iam-timeout-compat/2026-10-09-python310-timeout.zh.md b/prd-spec/bugfixes/mpa-iam-timeout-compat/2026-10-09-python310-timeout.zh.md new file mode 100644 index 000000000..ea72e17fe --- /dev/null +++ b/prd-spec/bugfixes/mpa-iam-timeout-compat/2026-10-09-python310-timeout.zh.md @@ -0,0 +1,73 @@ +# 在 Python 3.10 保持 IAM 超时语义 + +[English](2026-10-09-python310-timeout.md) + +## 元数据 + +- 变更 ID:`mpa-iam-timeout-compat` +- 创建日期:2026-10-09 +- 修订日期:2026-10-09 +- 状态:implemented +- 相关组件规格:无;保持现有 IAM 失败契约 + +## 背景与证据 + +PR #23 的 Python 3.10 单元测试任务在 +`test_readback_timeout_and_cancellation_keep_resources` 失败。托管 MPA IAM +协调器使用 `except TimeoutError` 包裹 `asyncio.wait_for()`。在 Python 3.10 +中,`asyncio.wait_for()` 抛出 `asyncio.TimeoutError`,不会被内置 +`TimeoutError` 处理器捕获。Python 3.11 及更高版本将这两个异常类型设为别名, +因此较新的本地环境掩盖了这个兼容性缺陷。 + +CI 结果为 6,497 项通过、1 项失败。未捕获的超时直接逸出,而没有转换为现有的 +`IamError` 和 `iamVerificationFailed`。 + +## 目标与非目标 + +### 目标 + +- 在 Python 3.10 保持现有 IAM 校验失败行为。 +- 保持取消传播和资源保留行为不变。 +- 使现有回归测试在 Python 3.10 和当前 Python 上通过。 + +### 非目标 + +- 修改 IAM 资源、权限、重试时间或协调顺序。 +- 修改公开错误契约或增加新回退行为。 +- 修改无关 MPA 行为。 + +## 需求与设计 + +- `FR-1`:`asyncio.wait_for()` 的超时必须转换为现有 `IamError`。 +- `FR-2`:调用方取消必须继续以 `asyncio.CancelledError` 传播。 +- `FR-3`:修复必须同时适用于 Python 3.10 和 Python 3.12,且不改变 IAM 功能逻辑。 + +在现有转换边界使用 `except asyncio.TimeoutError`。这是 Python 3.10 中 +`asyncio.wait_for()` 抛出的异常,并且与较新 Python 版本兼容。 + +组件契约影响:无。实现被修正为满足已有测试覆盖的超时和取消契约。接口、配置、 +权限、持久化、安全边界和用户文档均不变化。 + +## 任务与验收 + +| 需求 | 任务 | 验收标准 | 验证 | 结果 | +| --- | --- | --- | --- | --- | +| `FR-1` | `T-1`:修复前复现 | Python 3.10 暴露未捕获超时 | Python 3.10 目标 pytest | pass:复现未捕获的 `asyncio.TimeoutError` | +| `FR-1`、`FR-3` | `T-2`:使用 `asyncio.TimeoutError` | 现有超时转换测试通过 | Python 3.10 和 3.12 目标 pytest | pass:两个版本各 13 项 | +| `FR-2` | `T-2` | 现有取消断言通过 | 同一目标 pytest | pass | +| `FR-3` | `T-3`:静态验证 | 修改的 Python 文件检查通过 | Ruff 和 Pyright | pass | + +## 风险与待决问题 + +- 风险仅限于现有超时边界的异常选择器。 +- 没有待决问题。 + +## 审查与交付记录 + +- 2026-10-09:CI traceback 确认 Python 3.10 异常类型不匹配。 +- 2026-10-09:设计审查未发现契约、安全或兼容性阻塞项。 +- 2026-10-09:用户批准仅做兼容性修复,并明确要求不改变功能行为。 +- 2026-10-09:修复前在 Python 3.10 复现失败。完成一行异常类型限定后, + IAM 测试在 Python 3.10.20 和 Python 3.12.13 各通过 13 项,Python 3.12 + 托管 MPA 测试通过 664 项,Ruff 0.11.12 和 Pyright 均通过。 +- 提交和推送需要单独授权。 diff --git a/prd-spec/bugfixes/mpa-network-description/2026-10-09-valid-network-marker.md b/prd-spec/bugfixes/mpa-network-description/2026-10-09-valid-network-marker.md new file mode 100644 index 000000000..123313f62 --- /dev/null +++ b/prd-spec/bugfixes/mpa-network-description/2026-10-09-valid-network-marker.md @@ -0,0 +1,56 @@ +# Managed network description and rejected-intent recovery + +[中文版](2026-10-09-valid-network-marker.zh.md) + +Change ID: mpa-network-description. Created/revised: 2026-10-09. Status: implemented. + +## Evidence, goals and scope + +A fresh-account creation fails at `network`: CloudTrail confirms `CreateVpc` returned `InvalidDescription.Malformed`. The shared registry retains a VPC intent with `vpc_dispatched=false`, no VPC ID, and a colon-containing ownership description. VPC/subnet description rules do not allow colons: [CreateVpc](https://docs.volcengine.com/docs/VirtualPrivateCloud/CreateVpc-CreatingaVPC?lang=en), [CreateSubnet](https://docs.volcengine.com/docs/VirtualPrivateCloud/CreateSubnet-Creatingasubnet?lang=en). Preserve the verified account/region ownership hash and names. No credentials or raw audit payloads are recorded here. + +The user requested correction after the diagnosis, approving this bounded fix. No frontend, IAM, PG, APIG, Runtime/chat or image changes; no live cloud creation or database maintenance performed by the coding agent. Deployment itself still requires an authorized create/retry request. + +## Requirements and scenarios + +- FR-1: New VPC/subnet requests use `mpa-account-network-v1-` as Description, preserving names, account/region hash and ownership validation. +- FR-2: A persisted old description-only intent can change to the new description only when the dispatch flag is explicitly false, no resource ID is recorded and name discovery has no matching resource. Other request fields must match exactly. Generate a new ClientToken because the body changes; persist before dispatch under the existing lock. +- FR-3: Uncertain/in-flight old intents cannot issue another Create. Matching discovered old resources may be recovered. Both exact old and new scope markers are accepted for ownership; unrelated descriptions, wrong accounts, CIDRs, VPCs or zones remain errors. Existing resources are not rewritten, deleted or recreated. +- FR-4: Same-body definite permission rejection retains its ClientToken as before. Cancellation/timeout retain intent and avoid duplicate creation. + +Scenarios: fresh account passes provider description validation; a rejected old VPC/subnet intent resumes with corrected description and new token; changed CIDR/project/zone remains rejected; unknown outcome without a discovered resource fails closed; old resources are reused from registry or by exact scoped name/marker. + +## Design and affected files + +`managed/network.py` owns legal/legacy scope markers and exact-description-only compatibility in `_create`. Existing resource wait and ownership checks accept only the two scoped markers. The existing `NetworkCloudError` definite-rejection flag is the evidence for recovery; absence of the flag is not evidence of rejection. No new tables or APIs. No errors are converted into success. + +Component contracts: [Studio creation](../../../specs/studio-mpa-creation/README.md), [Runtime provisioning](../../../specs/mpa-runtime-provisioning/README.md). Update both languages and managed READMEs. Tests live in `tests/integrations/mpa_managed/test_deployment_network.py` with isolated cloud/registry fakes. + +## Tasks and acceptance + +| Requirement | Task | Acceptance | +| --- | --- | --- | +| FR-1 | T-1: failing provider-format regression then legal marker | AC-1: both create payloads satisfy allowed description characters | +| FR-2 | T-2: exact rejected-intent recovery | AC-2: same agent retries successfully; only description/token change, saved before dispatch | +| FR-3, FR-4 | T-3: compatibility and safety tests | AC-3: old recovery/reuse, no duplicate unknown creates, changed-input rejection, same-body token preservation | +| FR-1–4 | T-4: bilingual reconciliation and checks | AC-4: managed regressions, Ruff/Pyright and secret/diff checks pass | + +Commands: `uv run --extra dev pytest tests/integrations/mpa_managed`; changed-file Ruff/Pyright and pre-commit. Frontend/build/browser/sidecar checks are not_applicable: no frontend or sidecar changes. Full-repository checks and live smoke are reported separately; no commit or deployment requested. + +## Review, approval and risks + +Direct review (review-spec unavailable): exact scoped compatibility, false-versus-missing dispatch distinction, new token for changed body, locked durable save before cloud call, resource ownership and partial failure all reviewed. Bilingual equivalence reviewed; no blockers. Approval: user requested this fix after the proposed description/rejected-intent solution. Existing resources are retained. A legacy intent with unknown outcome may still need operator reconciliation; never reset it to claim success. Verification recorded below. + +## Verification and delivery record + +2026-10-09, working tree based on `ef0ad519`, scoped to network descriptions/recovery. Earlier IAM/account work and unrelated user changes are preserved. + +- pass: test-first provider-format regressions produced 3 expected failures (`InvalidDescription.Malformed`) before the code change. +- pass: `uv run --extra dev pytest tests/integrations/mpa_managed/test_deployment_network.py tests/integrations/mpa_managed/test_deployment_network_cloud.py -q`: 62 passed, including VPC and subnet rejected-intent correction, unknown outcome discovery/blocking, legacy reuse, payload conflict and same-body token preservation. +- pass: final `uv run --extra dev pytest tests/integrations/mpa_managed tests/integrations/test_mpa_provision_env.py tests/integrations/test_mpa_runtime.py -q`: 508 passed; existing dependency deprecation warnings only. +- pass: `uvx --from ruff==0.11.12 ruff check` and `ruff format --check` for the two changed Python files. Final `uvx pyright --pythonpath .venv/bin/python veadk/integrations/mpa/managed/network.py tests/integrations/mpa_managed/test_deployment_network.py`: 0 errors, 0 warnings. An initial test-fixture dictionary inference error was fixed with an in-place update; no production typing bypass. +- pass: changed-file `uv run --extra dev pre-commit run --files` for Python and bilingual documents: Ruff/check/format and hardcoded-secret scan passed. YAML scan not_applicable (no YAML changes). +- pass: paired identifiers, relative design links and `git diff --check`. Reconciled the Studio configuration sentence with the preceding STS-account fix. +- not_applicable: frontend tests/build/browser, generated web assets and sidecar gates; no UI or sidecar change. +- not_run: full-repository regression/all-files pre-commit because no commit is requested and the change is limited to provisioning; live retry/cloud mutation because the user will submit the create/retry request. The diagnostic audit was read-only, not a successful creation smoke. + +Review complete: other inputs remain immutable, exact old/new scope markers only, no reset of unknown dispatch, changed-body tokens are regenerated and persisted before the cloud call. AC-1–4 met by isolated checks; full live creation is not claimed. Existing resources and records are retained until an authorized retry performs the bounded intent correction. diff --git a/prd-spec/bugfixes/mpa-network-description/2026-10-09-valid-network-marker.zh.md b/prd-spec/bugfixes/mpa-network-description/2026-10-09-valid-network-marker.zh.md new file mode 100644 index 000000000..da486a521 --- /dev/null +++ b/prd-spec/bugfixes/mpa-network-description/2026-10-09-valid-network-marker.zh.md @@ -0,0 +1,56 @@ +# 托管网络合法描述与拒绝意图恢复 + +[English](2026-10-09-valid-network-marker.md) + +变更 ID:mpa-network-description。创建/修订日期:2026-10-09。状态:implemented。 + +## 证据、目标与范围 + +新账号创建在 `network` 失败:CloudTrail 确认 `CreateVpc` 返回 `InvalidDescription.Malformed`。共享注册表保留 `vpc_dispatched=false`、无 VPC ID、描述含冒号的 VPC 意图。VPC/子网描述规则不允许冒号:[CreateVpc](https://docs.volcengine.com/docs/VirtualPrivateCloud/CreateVpc-CreatingaVPC?lang=en)、[CreateSubnet](https://docs.volcengine.com/docs/VirtualPrivateCloud/CreateSubnet-Creatingasubnet?lang=en)。保留核验账号/地域的归属哈希及名称。此处不记录凭据或原始审计载荷。 + +用户在诊断后要求修正,批准本次限定修复。不改变前端、IAM、PG、APIG、Runtime/聊天或镜像;编码代理不执行真实云创建或数据库维护。真实部署仍通过获授权的创建/重试请求执行。 + +## 需求与场景 + +- FR-1:新 VPC/子网请求以 `mpa-account-network-v1-` 为 Description,保留名称、账号/地域哈希及归属校验。 +- FR-2:持久化旧意图仅描述不同,且派发标记明确为 false、无已登记资源 ID、按名称查询无匹配资源时,才能改为新描述。其他请求字段必须完全一致。因请求体改变,生成新的 ClientToken;在现有锁内先保存后派发。 +- FR-3:结果不确定/在途旧意图不得再次 Create。可恢复查询到的旧资源。归属仅接受当前范围精确的旧/新标记;无关描述、错误账号、CIDR、VPC 或可用区仍失败。已有资源不改写、不删除、不重建。 +- FR-4:相同请求体被明确拒绝权限时仍保留原 ClientToken。取消/超时保留意图,避免重复创建。 + +场景:新账号通过服务商描述校验;旧 VPC/子网拒绝意图以修正描述和新 token 恢复;CIDR/项目/可用区改变仍拒绝;结果不确定且查询无资源时安全失败;旧资源从注册表或精确范围名称/标记恢复复用。 + +## 设计与受影响文件 + +`managed/network.py` 管理合法/旧范围标记及 `_create` 内仅描述不同的精确兼容。现有资源等待和归属检查只接受这两个范围标记。现有 `NetworkCloudError` 明确拒绝派发标记作为恢复证据;标记缺失不代表明确拒绝。不新增表或 API,不将错误转换成成功。 + +组件契约:[Studio 创建](../../../specs/studio-mpa-creation/README.zh.md)、[Runtime 部署](../../../specs/mpa-runtime-provisioning/README.zh.md)。同步双语版本及 managed README。测试位于 `tests/integrations/mpa_managed/test_deployment_network.py`,使用隔离云端/注册表夹具。 + +## 任务与验收 + +| 需求 | 任务 | 验收 | +| --- | --- | --- | +| FR-1 | T-1:服务商格式失败回归及合法标记 | AC-1:两种创建载荷满足描述允许字符 | +| FR-2 | T-2:精确拒绝意图恢复 | AC-2:同一智能体可重试成功;仅描述/token 改变,并先保存后派发 | +| FR-3、FR-4 | T-3:兼容及安全测试 | AC-3:旧资源恢复/复用、结果不确定不重复创建、输入变化拒绝、相同请求 token 保留 | +| FR-1–4 | T-4:双语同步及检查 | AC-4:managed 回归、Ruff/Pyright、密钥/差异检查通过 | + +命令:`uv run --extra dev pytest tests/integrations/mpa_managed`,变更文件 Ruff/Pyright 和 pre-commit。前端/构建/浏览器/sidecar 检查为 not_applicable:没有前端或 sidecar 改动。全仓检查及真实 smoke 单独记录;未请求提交或部署。 + +## 审查、批准与风险 + +直接审查(review-spec 不可用):已检查精确范围兼容、false 与标记缺失的区别、变更请求体使用新 token、云调用前锁内持久化、资源归属及部分失败。双语语义等价,无阻塞项。批准来源:用户在获知描述/拒绝意图修复方案后要求修复。保留已有资源。结果不确定的旧意图仍可能需要运维核对,不重置它来宣称成功。验证记录见下。 + +## 验证与交付记录 + +2026-10-09,基于 `ef0ad519` 工作区,仅涉及网络描述/恢复。保留此前 IAM/账号工作及用户无关改动。 + +- pass:测试先行的服务商格式回归在修改代码前出现 3 个预期失败(`InvalidDescription.Malformed`)。 +- pass:`uv run --extra dev pytest tests/integrations/mpa_managed/test_deployment_network.py tests/integrations/mpa_managed/test_deployment_network_cloud.py -q`:62 项通过,覆盖 VPC/子网拒绝意图修正、未知结果查询恢复/阻止、旧资源复用、载荷冲突和相同请求 token 保留。 +- pass:最终 `uv run --extra dev pytest tests/integrations/mpa_managed tests/integrations/test_mpa_provision_env.py tests/integrations/test_mpa_runtime.py -q`:508 项通过;仅有既有依赖弃用警告。 +- pass:两个变更 Python 文件的 `uvx --from ruff==0.11.12 ruff check` 和 `ruff format --check`。最终 `uvx pyright --pythonpath .venv/bin/python veadk/integrations/mpa/managed/network.py tests/integrations/mpa_managed/test_deployment_network.py`:0 错误、0 警告。初次测试夹具字典推断问题通过原地 update 修正,未绕过生产类型检查。 +- pass:Python 和双语文档变更文件的 `uv run --extra dev pre-commit run --files`:Ruff 检查/格式及硬编码密钥扫描通过。YAML 扫描 not_applicable(无 YAML 改动)。 +- pass:双语标识、设计相对链接和 `git diff --check`。Studio 配置描述与此前 STS 账号修复同步。 +- not_applicable:前端测试/构建/浏览器、生成 web 产物及 sidecar 门禁;没有 UI 或 sidecar 改动。 +- not_run:全仓回归/all-files pre-commit,因未请求提交且变更限于部署;真实重试/云资源变更由用户提交创建/重试请求后执行。诊断审计是只读查询,不代表创建 smoke 成功。 + +审查完成:其他输入保持不可变,仅接受精确范围的新/旧标记,不重置结果不确定的派发,请求体变化时重新生成 token 并在云调用前保存。AC-1–4 通过隔离检查满足,不宣称完整真实创建成功。保留已有资源和记录,直到获授权的重试执行限定意图修正。 diff --git a/prd-spec/bugfixes/mpa-network-discovery/2026-10-09-empty-network-results.md b/prd-spec/bugfixes/mpa-network-discovery/2026-10-09-empty-network-results.md new file mode 100644 index 000000000..f77cca38b --- /dev/null +++ b/prd-spec/bugfixes/mpa-network-discovery/2026-10-09-empty-network-results.md @@ -0,0 +1,55 @@ +# Empty managed network discovery results + +[中文版](2026-10-09-empty-network-results.zh.md) + +Change ID: mpa-network-discovery. Created/revised: 2026-10-09. Status: implemented. + +## Evidence and scope + +Read-only diagnosis confirmed an Available managed VPC, no subnet creation intent, and a successful DescribeSubnets response serialized by the installed SDK as `subnets=None, total_count=0`. `NetworkCloud._list` rejects this as invalid before the provisioner can create its first subnet. This follows the [ownership-description fix](../mpa-network-description/2026-10-09-valid-network-marker.md). + +Goal: normalize a confirmed empty provider result and resume preparation in the recorded VPC. Non-goals: changes to UI, IAM, PG, APIG, Runtime/chat, resource naming or automatic deletion. No cloud writes, task retries, database edits, commits or deployment performed by this change's verification. + +## Requirements and scenarios + +- FR-1: On the first discovery page, a null or absent `vpcs`/`subnets` collection with an integer `total_count=0` is an empty list. Existing list responses retain their behavior. +- FR-2: Reject null/missing collections without an explicit integer zero, scalar collections even with zero, and a null collection on subsequent pages. Boolean/string/float counts are not integer evidence. Do not convert provider errors to empty results. +- FR-3: A recorded managed VPC with this empty subnet result proceeds to create one subnet. A second ensure reuses the same VPC and subnet; durable intents, ownership validation and uncertain-outcome duplicate prevention remain unchanged. + +Given a fresh VPC and zero subnets, discovery returns empty and creation continues. Given incomplete/malformed discovery or a provider permission error, preparation fails. Given a paginated nonempty result, a later null/zero response cannot discard earlier rows. + +## Design and contract impact + +`managed/network_cloud.py` owns normalization in `_list`; both discovery methods use it. Normalize only `items is None`, `type(total_count) is int`, zero count, and first page. All existing pagination limits, errors, credentials and request parameters remain unchanged. No schema, public signature, permissions or configuration changes; no new dependencies. The [Studio creation contract](../../../specs/studio-mpa-creation/README.md) owns empty/error distinctions; [Runtime provisioning](../../../specs/mpa-runtime-provisioning/README.md) references it. Caller retry retains the existing VPC; no migration or cleanup is needed. + +Concurrency, cancellation and timeout handling are unchanged because only a successfully returned discovery payload is normalized. Never reinterpret a failed request or unknown Create outcome as an empty discovery. + +## Tasks, tests and acceptance + +| Requirement | Task | Acceptance | +| --- | --- | --- | +| FR-1 | T-1: failing installed-SDK and absent-collection tests, then normalization | AC-1: DescribeVpcs/DescribeSubnets zero-result responses return empty | +| FR-2 | T-2: negative and pagination regressions | AC-2: malformed responses/errors still fail; populated pages are retained | +| FR-3 | T-3: isolated provisioner/adapter integration | AC-3: resume recorded VPC, create one subnet, reuse on repeat | +| FR-1–3 | T-4: bilingual review and verification | AC-4: affected tests, Ruff/Pyright, secret/diff/document checks pass | + +Commands: `uv run --extra dev pytest tests/integrations/mpa_managed tests/integrations/test_mpa_provision_env.py tests/integrations/test_mpa_runtime.py -q`; changed-file Ruff/Pyright and pre-commit. Real cloud retry is a separate user-submitted smoke; no live success is claimed from fakes. + +## Review, approval and risks + +Direct design review performed because review-spec is unavailable. Reviewed provider serialization, null-versus-invalid distinctions, pagination consistency, ownership, recovery, credential redaction and bilingual equivalence. No blocking findings. User approval: “帮我改正” after the diagnosed null/zero response and proposed empty-result correction. Risk: null responses lacking integer zero still fail deliberately; this is not a general suppression of malformed discovery. Unrelated working-tree changes remain preserved. + +## Verification and delivery + +2026-10-09, working tree based on `ef0ad519`. Test-first, implementation and verification results are recorded below. Frontend/build/browser/generated assets and sidecar checks are not_applicable: those contracts are unchanged. Full-repository/all-files commit checks and live cloud smoke are not_run: no commit or live retry is requested in this change. + + +Results for the scoped correction: + +- pass: before implementation, the four installed-SDK/absent-collection regressions failed with `Network discovery returned invalid results`; after completing the durable VPC test fixture, the orchestration regression also failed at the same discovery error. +- pass: network adapter/provisioner suite: 88 passed. Final managed/Runtime command above: 534 passed, 5 existing dependency deprecation warnings, 23.67 seconds. +- pass: final isolated resume regression: 1 passed after a test-only parameter-name correction; production behavior was unchanged. +- pass: `uvx --from ruff==0.11.12 ruff check` and `ruff format --check` for `network_cloud.py`, `test_deployment_network_cloud.py`, `test_deployment_network.py`; `uvx pyright --pythonpath .venv/bin/python` on the same files: 0 errors, 0 warnings. The initial fake/adapter method parameter-name mismatch was fixed without a type suppression. +- pass: `uv run --extra dev pre-commit run --files` for the three Python files and six bilingual documents: Ruff/check/format and hardcoded-secret scan passed. YAML scan not_applicable (no YAML changes). Paired FR/T/AC identifiers, all relative document link targets and `git diff --check` passed. + +Implementation review: only a confirmed first-page empty result is normalized. Rejected null/nonzero and later-page responses do not reach resource creation. Existing list responses, provider-error propagation, record reuse and persist-before-create recovery are covered. AC-1–4 are met by isolated tests and final document/secret checks. No successful live retry is claimed. diff --git a/prd-spec/bugfixes/mpa-network-discovery/2026-10-09-empty-network-results.zh.md b/prd-spec/bugfixes/mpa-network-discovery/2026-10-09-empty-network-results.zh.md new file mode 100644 index 000000000..317ec0ed4 --- /dev/null +++ b/prd-spec/bugfixes/mpa-network-discovery/2026-10-09-empty-network-results.zh.md @@ -0,0 +1,55 @@ +# 托管网络查询的空结果 + +[English](2026-10-09-empty-network-results.md) + +变更 ID:mpa-network-discovery。创建/修订:2026-10-09。状态:implemented。 + +## 证据与范围 + +只读诊断确认托管 VPC 为 Available,尚无子网创建意图,成功的 DescribeSubnets 响应经当前 SDK 序列化为 `subnets=None, total_count=0`。`NetworkCloud._list` 将其视为无效结果,导致编排器无法创建第一个子网。本修复接续[归属描述修复](../mpa-network-description/2026-10-09-valid-network-marker.zh.md)。 + +目标:规范化明确的提供方空结果,在已记录的 VPC 中继续准备子网。非目标:修改 UI、IAM、PG、APIG、Runtime/聊天、资源名称或自动删除。本次验证不执行云写入、任务重试、数据库修改、提交或部署。 + +## 需求与场景 + +- FR-1:查询第一页时,`vpcs`/`subnets` 为 null 或缺失且整数 `total_count=0`,应解释为空列表。已有列表响应保持原有行为。 +- FR-2:null/缺失集合但没有明确整数零、即使数量为零的标量集合、后续页面的 null 集合均拒绝。布尔/字符串/浮点数量不算整数证据。提供方错误不得转换为空结果。 +- FR-3:已记录的托管 VPC 返回上述空子网结果时,继续创建一个子网。第二次 ensure 复用原 VPC 和子网;持久化意图、归属校验及未知结果防重复机制保持不变。 + +新 VPC 没有子网时,查询返回空列表并继续创建。查询不完整/畸形或提供方权限错误时,准备失败。分页非空结果之后出现 null/零响应时,不得丢弃之前的记录。 + +## 设计与契约影响 + +`managed/network_cloud.py` 的 `_list` 负责规范化,两个查询方法共用。仅在 `items is None`、`type(total_count) is int`、数量为零且为第一页时规范化。现有分页上限、错误、凭据及请求参数保持不变。不修改数据结构、公开签名、权限或配置,不新增依赖。[Studio 创建契约](../../../specs/studio-mpa-creation/README.zh.md) 负责区分空结果与错误;[Runtime 部署](../../../specs/mpa-runtime-provisioning/README.zh.md) 引用该契约。用户重试保留现有 VPC,无需迁移或清理。 + +并发、取消及超时处理不变,因为只规范化已经成功返回的查询载荷。不得将失败请求或未知 Create 结果解释为空查询。 + +## 任务、测试与验收 + +| 需求 | 任务 | 验收 | +| --- | --- | --- | +| FR-1 | T-1:先添加当前 SDK 及缺失集合的失败测试,再规范化 | AC-1:DescribeVpcs/DescribeSubnets 零记录响应返回空列表 | +| FR-2 | T-2:负向与分页回归 | AC-2:畸形响应/错误仍失败;非空分页记录保留 | +| FR-3 | T-3:隔离的编排器/适配器集成 | AC-3:恢复已记录 VPC,创建一个子网,重复调用复用 | +| FR-1–3 | T-4:双语审查及验证 | AC-4:相关测试、Ruff/Pyright、密钥/差异/文档检查通过 | + +命令:`uv run --extra dev pytest tests/integrations/mpa_managed tests/integrations/test_mpa_provision_env.py tests/integrations/test_mpa_runtime.py -q`;修改文件的 Ruff/Pyright 和 pre-commit。真实云重试为用户另行提交的冒烟,不以模拟测试宣称真实创建成功。 + +## 审查、批准与风险 + +review-spec 不可用,直接执行设计审查。已审查提供方序列化、null 与畸形结果区别、分页一致性、归属、恢复、凭据脱敏与双语等价,无阻塞项。用户批准:诊断 null/零响应并提出空结果修复后,用户要求“帮我改正”。风险:没有明确整数零的 null 响应仍故意报错,不普遍吞掉畸形查询。保留工作区无关修改。 + +## 验证与交付 + +2026-10-09,基于 `ef0ad519` 的工作区。下文已记录先失败测试、实现及验证结果。前端/构建/浏览器/生成资源及 sidecar 检查为 not_applicable:未改变其契约。全仓库/全文件提交检查及真实云冒烟为 not_run:本次未请求提交或真实重试。 + + +本次修复验证结果: + +- pass:实现前,四个当前 SDK/缺失集合回归均因 `Network discovery returned invalid results` 失败;补全持久化 VPC 测试夹具后,编排回归也在同一查询错误处失败。 +- pass:网络适配器/编排器专项:88 项通过。上述最终托管/Runtime 命令:534 项通过,5 条既有依赖弃用警告,用时 23.67 秒。 +- pass:测试方法参数名称修正后的最终恢复专项:1 项通过;未修改生产行为。 +- pass:对 `network_cloud.py`、`test_deployment_network_cloud.py`、`test_deployment_network.py` 运行 `uvx --from ruff==0.11.12 ruff check` 和 `ruff format --check`;同文件 `uvx pyright --pythonpath .venv/bin/python`:0 错误、0 警告。初始模拟对象/适配器方法参数名称不一致已修正,未使用类型抑制。 +- pass:对三个 Python 文件及六份双语文档执行 `uv run --extra dev pre-commit run --files`:Ruff/静态/格式及硬编码密钥扫描通过。YAML 扫描为 not_applicable(未修改 YAML)。双语 FR/T/AC 标识、全部相对文档链接目标及 `git diff --check` 通过。 + +实现审查:只规范化明确的第一页空结果。拒绝的 null/非零及后续页面响应不会进入资源创建。已有列表响应、提供方错误透传、记录复用及创建前持久化恢复均有覆盖。隔离测试及最终文档/密钥检查满足 AC-1–4。不宣称真实重试成功。 diff --git a/prd-spec/bugfixes/mpa-skill-space-description/2026-10-09-entered-name-description.md b/prd-spec/bugfixes/mpa-skill-space-description/2026-10-09-entered-name-description.md new file mode 100644 index 000000000..35221f8f4 --- /dev/null +++ b/prd-spec/bugfixes/mpa-skill-space-description/2026-10-09-entered-name-description.md @@ -0,0 +1,54 @@ +# Use the entered MPA name in Skill Space descriptions + +[中文版](2026-10-09-entered-name-description.zh.md) + +- Change ID: `mpa-skill-space-description`; date: 2026-10-09; status: implemented. +- Contract: [Studio MPA creation](../../../specs/studio-mpa-creation/README.md), CON-3/CON-4. + +## Background and scope + +`managed/skills.py` currently creates `Description: Skills for MPA agent `. Studio creation now separates the entered Runtime name from the generated internal ID. A user identifying an agent by its entered name therefore cannot recognize the description. The user requested that this description use the entered name. + +Change only descriptions of newly created named Skill Spaces. Keep generated `mpa_skills_` names, `display_name` tags, IDs, ownership tags, database/channel/Worker bindings and internal ID generation unchanged. Existing/configured spaces are reused without updates. No cloud rename, migration, deployment, commit or push is in scope. Generic agents, UI, dependencies and permissions are unchanged. + +## Requirements, scenarios and acceptance + +- FR-1 / AC-1: A fresh named deployment creates `Description: Skills for MPA agent `. Use the existing Runtime-name validation. Without a name, preserve the original internal-ID description. +- FR-2 / AC-2: Forward `runtime_name` from Runtime deployment to Skill Space preparation. Space names, tags and bindings remain based on internal identity. Existing spaces require no create/update, regardless of the supplied display name. +- FR-3 / AC-3: Preserve unknown-outcome recovery: no blind second CreateSkillSpace. When a pre-upgrade persisted request matches the complete current request with only its description restored to the original internal-ID value, replay that persisted request for discovery/ownership verification. Reject all other pending-input changes, including changed new descriptions or projects. + +Scenarios: fresh named request has a recognizable description; unnamed CLI retains its behavior; an existing space remains untouched; a lost response from an old or new request is discovered exactly once; an undiscovered lost response or changed pending request remains an explicit error. + +## Design and affected contracts + +Add an optional keyword-only `runtime_name: str = ""` to `ensure_skill_space`, validate nonempty names with `validate_runtime_name`, and pass it from `RuntimeDeployer.deploy`. Description uses `runtime_name or agent_id`. The existing persisted `skill_space_request` already contains all recovery inputs; no field/schema migration is needed. Compare the full old-description candidate before permitting legacy recovery. Keep name discovery, ownership validation, locking, cancellation, timeout and resource cleanup rules unchanged. Description is presentation metadata and must not become an ownership key. + +Production: `managed/skills.py`, `managed/runtime.py`. Tests: `test_agent_deployment.py`, `test_service.py`. Update the bilingual creation spec and managed README. No frontend, generated assets, external API request-body or runtime image change. Optional Python keyword preserves callers. No credentials or live user data in fixtures/evidence. + +## Tasks and verification + +1. T-1 / FR-1–FR-3: Add failing regressions for named/unnamed descriptions, internal binding stability, name validation, existing reuse, old/new lost-response recovery and pending-input refusal. +2. T-2 / FR-1–FR-3: Implement name forwarding and exact legacy-description recovery. +3. T-3: Run targeted deployment/service tests, managed/CLI regression with two workers, changed-file Ruff/Pyright, pre-commit, bilingual/link and whitespace checks; review consistency and record results. + +Commands: `uv run --extra dev pytest tests/integrations/mpa_managed/test_agent_deployment.py tests/integrations/mpa_managed/test_runtime_deployment_edges.py tests/integrations/mpa_managed/test_service.py -n 2 -q`; `uv run --extra dev pytest tests/integrations/mpa_managed tests/cli/test_cli_mpa.py -n 2 -q`; changed-file Ruff/Pyright; `uv run --extra dev pre-commit run --all-files`; `git diff --check`. + +## Review, approval and risks + +The user's request to replace the internal ID in the description with the entered name approves this narrow extension of the preceding naming fix. `review-spec` is unavailable; direct review checked request compatibility, full-payload recovery, ownership boundaries, errors and bilingual equivalence. No blockers. Old/existing spaces keep their descriptions; the improvement applies after restarting Studio to fresh creation. Display metadata does not imply a cloud ID or uniqueness guarantee. Live cloud operations are not authorized. Frontend/build/browser/sidecar gates are not applicable to this backend-only metadata change. + +## Delivery record + +T-1–T-3 and AC-1–AC-3 are complete. Direct implementation review verified that descriptions never authorize adoption, full legacy payload comparison preserves repeated unknown-outcome recovery, existing spaces are untouched, and changed pending inputs still fail. All pre-existing uncommitted changes, including the image-discovery rollback and Worker-name fix, are preserved separately. + +Tested on 2026-10-09: the four changed Python files and affected managed/CLI suites in the uncommitted diff based on `df797f94`. + +- `pass`: Regression-first checks reproduced six failures before implementation (two compatibility/default cases already passed). +- `pass`: Targeted deployment/edge/service command above: 182 tests. Final managed/CLI command with two workers: 686 tests, including named/unnamed creation, unchanged internal bindings, existing reuse, invalid names and old/new recovery. +- `pass`: Ruff 0.11.12 check/format on the four changed Python files; Pyright: zero errors/warnings. +- `pass`: `uv run --extra dev pre-commit run --all-files`, including both secret checks; bilingual pairs, contract identifiers and local design links; `git diff --check`. +- `not_run`: Full-repository Python regression; affected managed/CLI coverage was selected for this bounded metadata change. +- `not_run`: Real cloud creation/update; no live operations authorized or performed. Restart Studio before verifying a fresh creation in the console. Previously created spaces retain their original descriptions. +- `not_applicable`: Frontend/browser/build, sidecar and runtime-process smoke gates; no changes to those contracts or artifacts. + +No commit, push or deployment was performed. diff --git a/prd-spec/bugfixes/mpa-skill-space-description/2026-10-09-entered-name-description.zh.md b/prd-spec/bugfixes/mpa-skill-space-description/2026-10-09-entered-name-description.zh.md new file mode 100644 index 000000000..0de75c493 --- /dev/null +++ b/prd-spec/bugfixes/mpa-skill-space-description/2026-10-09-entered-name-description.zh.md @@ -0,0 +1,54 @@ +# 技能空间描述使用手填 MPA 名称 + +[English](2026-10-09-entered-name-description.md) + +- Change ID:`mpa-skill-space-description`;日期:2026-10-09;状态:implemented。 +- 契约:[Studio MPA 创建](../../../specs/studio-mpa-creation/README.zh.md),CON-3/CON-4。 + +## 背景与范围 + +`managed/skills.py` 当前创建 `Description: Skills for MPA agent `。Studio 创建已将手填 Runtime 名称与自动生成内部 ID 分开。用户通过手填名称识别智能体时,难以辨认该描述。用户要求描述使用手填名称。 + +仅修改新建名称请求的技能空间描述。保持生成的 `mpa_skills_` 名称、`display_name` 标签、ID、归属标签、数据库/渠道/Worker 绑定及内部 ID 生成不变。已有/显式配置空间复用,不更新。不涉及云资源改名、迁移、部署、提交或推送。通用智能体、UI、依赖与权限不变。 + +## 需求、场景与验收 + +- FR-1 / AC-1:新名称部署创建 `Description: Skills for MPA agent `。沿用现有 Runtime 名称校验。不提供名称时保留原内部 ID 描述。 +- FR-2 / AC-2:Runtime 部署将 `runtime_name` 传给技能空间准备。空间名称、标签及绑定继续由内部标识派生。已有空间不创建/更新,与传入的展示名称无关。 +- FR-3 / AC-3:保留结果未知恢复,不盲目重复 CreateSkillSpace。升级前持久化请求仅在完整当前请求恢复为原内部 ID 描述后完全匹配时,才重放该请求用于发现和归属校验。其他未完成输入变化仍拒绝,包括新描述或项目变化。 + +场景:新名称请求描述可辨认;不提供名称的 CLI 保持原行为;已有空间不修改;旧/新请求丢失响应后准确发现且只创建一次;无法发现的丢失响应或改变未完成请求仍明确报错。 + +## 设计与受影响契约 + +为 `ensure_skill_space` 增加可选仅关键字参数 `runtime_name: str = ""`,非空时使用 `validate_runtime_name` 校验,由 `RuntimeDeployer.deploy` 传入。描述使用 `runtime_name or agent_id`。已有持久化 `skill_space_request` 包含完整恢复输入,不增加字段或数据库迁移。仅在完整旧描述候选匹配时允许旧版恢复。名称发现、归属验证、锁、取消、超时和资源清理保持不变。描述属于展示信息,不得作为归属键。 + +生产文件:`managed/skills.py`、`managed/runtime.py`。测试:`test_agent_deployment.py`、`test_service.py`。更新双语创建契约和 managed README。不修改前端、生成产物、外部 API 请求体或 Runtime 镜像。可选 Python 关键字兼容调用方。测试/证据不含凭证或真实用户数据。 + +## 任务与验证 + +1. T-1 / FR-1–FR-3:补充先失败回归,覆盖有/无名称描述、内部绑定稳定、名称校验、已有复用、旧/新丢失响应恢复及未完成输入变化拒绝。 +2. T-2 / FR-1–FR-3:实现名称传入及完整旧描述恢复。 +3. T-3:运行部署/服务目标测试、使用两个进程的 managed/CLI 回归、改动文件 Ruff/Pyright、pre-commit、双语/链接及空白检查;审查一致性并记录结果。 + +命令:`uv run --extra dev pytest tests/integrations/mpa_managed/test_agent_deployment.py tests/integrations/mpa_managed/test_runtime_deployment_edges.py tests/integrations/mpa_managed/test_service.py -n 2 -q`;`uv run --extra dev pytest tests/integrations/mpa_managed tests/cli/test_cli_mpa.py -n 2 -q`;改动文件 Ruff/Pyright;`uv run --extra dev pre-commit run --all-files`;`git diff --check`。 + +## 审查、批准与风险 + +用户要求描述中的内部 ID 改为手填名称,批准对前序命名修复的这一小范围扩展。`review-spec` 不可用;直接审查核对请求兼容、完整请求恢复、归属边界、错误及双语等价,无阻塞。旧/已有空间保留原描述;重启 Studio 后对新建请求生效。展示信息不代表云 ID 或唯一性保证。未授权真实云操作。本次仅后端展示元数据变化,前端/构建/浏览器/sidecar 检查不适用。 + +## 交付记录 + +T-1–T-3 和 AC-1–AC-3 已完成。直接实施审查确认描述不授权接管、完整旧请求比较保留连续结果未知恢复、已有空间不修改、改变未完成输入仍失败。此前所有未提交修改,包括镜像查询撤回和 Worker 名称修复,独立保留。 + +2026-10-09 测试范围:基于 `df797f94` 的未提交差异中四个 Python 文件及受影响的 managed/CLI 测试。 + +- `pass`:先失败回归在实施前复现 6 项失败(两项兼容/默认场景已通过)。 +- `pass`:上述部署/边界/服务目标命令 182 项通过;最终 managed/CLI 命令使用两个进程,686 项通过,包含有/无名称创建、内部绑定不变、已有复用、非法名称及旧/新恢复。 +- `pass`:四个改动 Python 文件的 Ruff 0.11.12 check/format;Pyright 零错误/警告。 +- `pass`:`uv run --extra dev pre-commit run --all-files`,包含两项密钥检查;双语配对、契约标识及本地设计链接;`git diff --check`。 +- `not_run`:全仓 Python 回归;针对本次有限元数据变更,选择受影响的 managed/CLI 覆盖。 +- `not_run`:真实云创建/更新,未授权也未执行。控制台验证新的创建前应重启 Studio;此前创建的空间保留原描述。 +- `not_applicable`:前端/浏览器/构建、sidecar 及运行时进程 smoke;没有修改这些契约或产物。 + +未执行提交、推送或部署。 diff --git a/prd-spec/bugfixes/mpa-standard-gateway/2026-10-09-standard-shared-gateway.md b/prd-spec/bugfixes/mpa-standard-gateway/2026-10-09-standard-shared-gateway.md new file mode 100644 index 000000000..97eacd5e3 --- /dev/null +++ b/prd-spec/bugfixes/mpa-standard-gateway/2026-10-09-standard-shared-gateway.md @@ -0,0 +1,57 @@ +# Standard shared APIG creation + +[中文版](2026-10-09-standard-shared-gateway.zh.md) + +Change ID: mpa-standard-gateway. Created/revised: 2026-10-09. Status: implemented. + +## Evidence, goals and boundaries + +Read-only investigation confirmed a successful historical shared MPA gateway is standard, with two 1c2g nodes, small_1 CLB, public/private networking and traffic billing. The new account has exhausted its Serverless gateway count while standard count has headroom. Current managed creation hardcodes serverless and prepares only one subnet. The provider [CreateGateway contract](https://docs.volcengine.com/docs/apig/CreateGateway?lang=en) requires at least two subnets in different zones. [GetGatewayAvailableZones](https://docs.volcengine.com/docs/apig/GetGatewayAvailableZones-QuerythecurrentRegionAvailabilityZonelist?lang=zh) supplies APIG-supported zones, which can differ from ECS zones. + +Goal: new managed gateways use the working standard configuration, prepare an appropriate cross-zone network and recover definite quota rejection. Non-goals: frontend changes, general-agent chat, moving existing Runtimes, deleting resources, switching cloud accounts, copying old-account resource IDs, upgrading images or automatically increasing quota. Real creation remains a separate user submission. Existing standard/serverless registrations and explicit adoption retain compatibility. + +## Requirements and scenarios + +- FR-1: CreateGateway uses standard, Replicas=2, InstanceSpecCode=1c2g, CLBSpecCode=small_1, both public/private enabled and traffic billing. Reject fewer than two or duplicate subnet IDs before dispatch. +- FR-2: For a new gateway without registered/adopted ID, query APIG zones and prepare two available same-VPC subnets in distinct supported zones under the existing account lock. Reuse eligible subnets first, create only missing companions with nonoverlapping CIDRs. Include ready GetSubnet results in CIDR reservations when DescribeSubnets lags. Preserve VPC and all existing resources. +- FR-3: Each companion subnet has its own durable intent/token/dispatch flag and stable scope/zone name. Timeouts/cancellation/unknown results require discovery before another Create; retries retain payload and token. Conflicts, malformed zones, ownership drift, CIDR exhaustion and fewer than two APIG zones fail closed. A recorded pending companion remains authoritative even if another suitable subnet appears. +- FR-4: Existing gateway reuse/adoption does not require new zone discovery or network changes. Existing Runtime network payloads stay unchanged; new Runtime payloads use the prepared gateway subnet selection. Management registry records are the source of truth. +- FR-5: ExceededQuota is a definite provider rejection for gateway and IM creation; save create_requested/im_create_requested=false and allow same-agent retry after correction. Timeout/internal/unknown errors retain duplicate protection. A historical unknown flag is not automatically cleared. A one-off recovery may clear only the audited rejected intent under the shared lock after checking the exact scope/VPC/name and absence of the gateway; it must not delete resources or reset arbitrary intents. +- FR-6: Deployment IAM policy includes the read-only apig:GetGatewayAvailableZones action. Runtime role policy and other permissions remain unchanged. No credentials or provider payloads enter user output, source or reports. + +Scenarios: fresh shared setup creates two cross-zone subnets and one standard gateway/IM service; a recorded single-subnet VPC adds only its missing companion; separate agents reuse the same admin registry; a lost companion Create response resumes by exact name; quota rejection is recoverable; an uncertain gateway outcome still blocks duplication; existing registered gateways/Runtimes retain their network. + +## Design and contract impact + +`gateway_cloud.py` owns the standard request and APIG zone adapter. `network.py` adds a gateway-specific preparation method using the same entry lock and persists companion intents inside gateway_subnet_intents keyed by zone. Existing single-subnet preparation remains unchanged for independent Runtime callers. `service.py` invokes companion preparation only when no gateway is registered/adopted, passes gateway subnets independently, and only changes a fresh Runtime's template network. `gateway.py` classifies the definite quota rejection. `frontend_deploy_policy.py` grants the one new read action. No public HTTP/API/CLI fields, configuration or tables change; the JSON registry gains optional companion intents. All provider calls refresh and verify credentials. + +Owner contracts: [Studio creation](../../../specs/studio-mpa-creation/README.md) and [Runtime provisioning](../../../specs/mpa-runtime-provisioning/README.md). Update both languages and managed module READMEs. Frontend/browser/assets/sidecar gates are not_applicable because their interfaces/behavior are unchanged. Isolated tests cover actual request shape, orchestration and recovery; live provisioning is reported separately. + +## Tasks and acceptance + +| Requirement | Task | Acceptance | +| --- | --- | --- | +| FR-1, FR-6 | T-1: failing adapter/policy regressions then standard request/zones | AC-1: standard payload and minimum IDs, strict zones, deployment permission | +| FR-2–4 | T-2: failing companion/reuse/cancellation tests then durable preparation and entry-point wiring | AC-2: new setup/one-subnet recovery/repeated agents, no existing Runtime changes or duplicate subnet creation | +| FR-5 | T-3: failing quota recovery tests then definite-error handling | AC-3: gateway/IM quota retries allowed, unknown outcomes remain blocked | +| FR-1–6 | T-4: docs, targeted/regression tests and review | AC-4: affected tests, Ruff/Pyright, secret/diff/bilingual/link checks pass | + +Commands: `uv run --extra dev pytest tests/integrations/mpa_managed tests/integrations/test_mpa_provision_env.py tests/integrations/test_mpa_runtime.py tests/cli/test_frontend_deploy_iam.py -q`; changed-file Ruff/Pyright/pre-commit. No commit, push, deployment, destructive cleanup or live creation is part of verification. + +## Review, approval and risks + +Direct review because review-spec is unavailable: scoped ownership, cross-zone requirements, independent intents, locks, partial failures, unchanged Runtime compatibility, permissions and bilingual equivalence reviewed. User approved the standard gateway/two-zone/IM/registry/retry solution with “帮我改”. The new read action needs deployment permission; empty/failed zone lookup is not silently substituted with ECS results. New standard resources have their provider billing; quota/availability errors can still occur and remain explicit failures. Pending historical flags remain conservative until audited operator recovery. No design blockers remain. + +## Verification and delivery + +2026-10-09, tested working tree based on ef0ad519 plus this uncommitted gateway correction and preceding approved account/IAM/network fixes; unrelated user changes preserved. T-1–T-4 and AC-1–AC-4 are satisfied for isolated implementation verification. + +- pass: test-first adapter/quota baseline (13 expected failures, 14 passes), companion/policy baseline (12 expected failures, 64 passes), and delayed-list CIDR regression (one expected failure), then implementation. +- pass: `uv run --extra dev pytest tests/integrations/mpa_managed tests/integrations/test_mpa_provision_env.py tests/integrations/test_mpa_runtime.py tests/cli/test_frontend_deploy_iam.py -q --tb=short`: 578 passed, five existing dependency deprecation warnings. Covers standard payload, distinct APIG zones, reuse across agents, cancellation/lost-response recovery, authoritative pending intent, ownership/zone/account drift, CIDR exhaustion and delayed lists, quota recovery and unchanged existing Runtime network. +- pass: `uvx --from ruff==0.11.12 ruff check` and `ruff format --check` for the 12 affected Python source/test files; `uvx pyright --pythonpath .venv/bin/python` for gateway_cloud.py, gateway.py, network.py, service.py and frontend_deploy_policy.py (zero errors). +- pass: `uv run --extra dev pre-commit run --files `: Ruff check/format and hardcoded secret scan. Concrete-YAML secret gate not_applicable (no YAML changes). +- pass: paired-language, relative-path/reference and diff whitespace checks; direct implementation review found no remaining blockers. Preserve scope, registry locks and Runtime network compatibility; cancellation does not roll back resources. +- pass (live data repair only): under the shared account/region lock, reverified deployment STS identity, failed local task/no active creation, exact provider ExceededQuota audit and absence of the scoped gateway; cleared only that rejected create_requested flag and verified readback. No cloud resource was created/deleted and no other record was changed. Unknown historical intents have no automatic bypass. +- not_run: real standard gateway/IM/Runtime creation; the user must submit after restarting local Studio (or redeploying cloud Studio). Provider quota, availability and permissions remain live checks. +- not_run: full repository parallel regression and all-files commit gate; verification covered affected creation/provisioning/CLI regressions. The earlier broad run has unrelated SDK dependency/collection failures recorded in the IAM design. No commit was requested. +- not_applicable: frontend/browser/build/assets/sidecar gates because no frontend or event/chat interface changed. diff --git a/prd-spec/bugfixes/mpa-standard-gateway/2026-10-09-standard-shared-gateway.zh.md b/prd-spec/bugfixes/mpa-standard-gateway/2026-10-09-standard-shared-gateway.zh.md new file mode 100644 index 000000000..194b174be --- /dev/null +++ b/prd-spec/bugfixes/mpa-standard-gateway/2026-10-09-standard-shared-gateway.zh.md @@ -0,0 +1,57 @@ +# 标准型共享 APIG 创建 + +[English](2026-10-09-standard-shared-gateway.md) + +变更 ID:mpa-standard-gateway。创建/修订:2026-10-09。状态:implemented。 + +## 证据、目标与边界 + +只读排查确认,历史成功的 MPA 共享网关为标准型,两个 1c2g 节点、small_1 CLB、公私网启用、按流量计费。新账号 Serverless 网关数量已达限额,标准型数量仍有余量。当前托管创建硬编码 serverless,且只准备一个子网。提供方 [CreateGateway 契约](https://docs.volcengine.com/docs/apig/CreateGateway?lang=en)要求至少两个不同可用区的子网。[GetGatewayAvailableZones](https://docs.volcengine.com/docs/apig/GetGatewayAvailableZones-QuerythecurrentRegionAvailabilityZonelist?lang=zh) 提供 APIG 支持的可用区,可能与 ECS 可用区不同。 + +目标:新建托管网关采用已验证的标准型配置,准备适合的跨可用区网络,并恢复明确的配额拒绝。非目标:修改前端、通用智能体聊天、迁移现有 Runtime、删除资源、切换云账号、复制旧账号资源 ID、升级镜像或自动申请提额。真实创建由用户另行提交。已有标准型/Serverless 登记和显式接管保持兼容。 + +## 需求与场景 + +- FR-1:CreateGateway 使用 standard、Replicas=2、InstanceSpecCode=1c2g、CLBSpecCode=small_1、公私网均启用、按 traffic 计费。少于两个或重复子网 ID 在发送前拒绝。 +- FR-2:没有登记/接管 ID 的新网关,在现有账号锁内查询 APIG 可用区,准备同一 VPC 内两个不同受支持可用区的可用子网。优先复用合适子网,只创建缺失的伴随子网,CIDR 不重叠。DescribeSubnets 延迟时,计入 GetSubnet 已确认就绪的子网网段。保留 VPC 及所有现有资源。 +- FR-3:每个伴随子网有独立的持久化意图/token/发送标记和稳定的范围/可用区名称。超时/取消/未知结果在再次 Create 前必须查询恢复;重试保留载荷和 token。冲突、畸形可用区、归属变化、CIDR 耗尽及 APIG 可用区不足两个均明确失败。已记录的未完成伴随意图保持权威,即使出现其他合适子网也不能跳过。 +- FR-4:已有网关复用/接管不要求新可用区查询或网络变更。已有 Runtime 网络载荷保持不变;新 Runtime 载荷使用准备好的网关子网选择。管理注册库记录为事实来源。 +- FR-5:网关和 IM 创建的 ExceededQuota 属于提供方明确拒绝,保存 create_requested/im_create_requested=false,修正后允许同智能体重试。超时/内部/未知错误保留防重复保护。历史未知标记不自动清除。一次性恢复只有在共享锁内核实明确拒绝的审计、精确范围/VPC/名称及网关不存在后才可清除该意图;不得删除资源或重置任意意图。 +- FR-6:部署 IAM 策略增加只读 apig:GetGatewayAvailableZones。Runtime 角色策略和其他权限不变。凭据及提供方载荷不得进入用户输出、源码或报告。 + +场景:新共享环境创建两个跨可用区子网和一个标准网关/IM 服务;已记录单子网 VPC 只补齐缺失子网;不同智能体复用同一管理注册库;伴随子网 Create 响应丢失后按精确名称恢复;配额拒绝可恢复;网关未知结果仍阻止重复;已登记网关/Runtime 保留网络。 + +## 设计与契约影响 + +`gateway_cloud.py` 负责标准型请求和 APIG 可用区适配。`network.py` 添加网关专用准备方法,复用 entry 锁,并在 gateway_subnet_intents 中按可用区持久化伴随意图。独立 Runtime 调用方的单子网准备保持不变。`service.py` 仅在没有已登记/接管网关时调用伴随准备,独立传递网关子网,仅修改新 Runtime 模板网络。`gateway.py` 识别明确配额拒绝。`frontend_deploy_policy.py` 增加一个只读动作。不修改公开 HTTP/API/CLI 字段、配置或表;JSON 注册记录增加可选伴随意图。所有提供方调用刷新并核验凭据。 + +归属契约:[Studio 创建](../../../specs/studio-mpa-creation/README.zh.md)及 [Runtime 部署](../../../specs/mpa-runtime-provisioning/README.zh.md)。同步双语及托管模块 README。前端/浏览器/资源/sidecar 检查为 not_applicable,因其接口/行为未改。隔离测试覆盖真实请求形态、编排及恢复;真实部署单独报告。 + +## 任务与验收 + +| 需求 | 任务 | 验收 | +| --- | --- | --- | +| FR-1、FR-6 | T-1:先失败的适配器/策略回归,再标准型请求/可用区 | AC-1:标准型载荷和最少 ID、严格可用区、部署权限 | +| FR-2–4 | T-2:先失败的伴随/复用/取消测试,再持久准备及入口接线 | AC-2:新环境/单子网恢复/多智能体,无现有 Runtime 变更或重复创建 | +| FR-5 | T-3:先失败的配额恢复测试,再明确错误处理 | AC-3:网关/IM 配额允许重试,未知结果仍阻止 | +| FR-1–6 | T-4:文档、专项/回归及审查 | AC-4:相关测试、Ruff/Pyright、密钥/差异/双语/链接通过 | + +命令:`uv run --extra dev pytest tests/integrations/mpa_managed tests/integrations/test_mpa_provision_env.py tests/integrations/test_mpa_runtime.py tests/cli/test_frontend_deploy_iam.py -q`;修改文件的 Ruff/Pyright/pre-commit。验证不包含提交、推送、部署、破坏性清理或真实创建。 + +## 审查、批准与风险 + +review-spec 不可用,直接审查:范围归属、跨可用区要求、独立意图、锁、部分失败、Runtime 兼容不变、权限及双语等价均已审查。用户以“帮我改”批准标准型网关/双可用区/IM/注册库/重试方案。新只读动作需要部署权限;可用区为空/查询失败时不静默替换为 ECS 结果。新标准型资源按提供方计费;配额/资源不足仍可能发生,并保留明确失败。历史未完成标记在审计确认的操作恢复前保持保守。无设计阻塞项。 + +## 验证与交付 + +2026-10-09,测试范围为 ef0ad519 工作区加本次未提交网关修复及此前已批准的账号/IAM/网络修复;保留无关用户修改。隔离实现验证满足 T-1–T-4、AC-1–AC-4。 + +- pass:先运行适配器/配额基线(13 个预期失败、14 个通过)、伴随子网/策略基线(12 个预期失败、64 个通过)及列表延迟 CIDR 回归(一个预期失败),然后实现。 +- pass:`uv run --extra dev pytest tests/integrations/mpa_managed tests/integrations/test_mpa_provision_env.py tests/integrations/test_mpa_runtime.py tests/cli/test_frontend_deploy_iam.py -q --tb=short`:578 个通过,五条已有依赖弃用警告。覆盖标准型载荷、APIG 不同可用区、多智能体复用、取消/响应丢失恢复、未完成意图权威性、归属/可用区/账号变化、CIDR 耗尽及列表延迟、配额恢复和已有 Runtime 网络不变。 +- pass:12 个相关 Python 源码/测试文件执行 `uvx --from ruff==0.11.12 ruff check`、`ruff format --check`;gateway_cloud.py、gateway.py、network.py、service.py、frontend_deploy_policy.py 执行 `uvx pyright --pythonpath .venv/bin/python`,零错误。 +- pass:`uv run --extra dev pre-commit run --files ` 的 Ruff 检查/格式及硬编码密钥扫描。具体 YAML 密钥检查 not_applicable(没有 YAML 修改)。 +- pass:双语配对、相对路径/引用、差异空白检查;直接实现审查无剩余阻塞项。保留范围、注册库锁和 Runtime 网络兼容;取消不回滚资源。 +- pass(仅真实数据修复):在共享账号/地域锁内,重新核验部署 STS 身份、本地失败任务/无运行中创建、精确的 ExceededQuota 提供方审计及范围内网关不存在;仅清除这次明确拒绝的 create_requested 标记并回读核验。未创建/删除云资源,未修改其他记录。历史未知意图没有自动绕过。 +- not_run:真实标准网关/IM/Runtime 创建;用户需重启本地 Studio(云端重新部署)后提交。提供方配额、资源及权限仍需实际检查。 +- not_run:全仓库并行回归及全文件提交检查;本次覆盖相关创建/部署/CLI 回归。此前全量运行的无关 SDK 依赖/收集失败已记录在 IAM 设计中。未收到提交请求。 +- not_applicable:前端/浏览器/构建/资源/sidecar 检查,没有前端或事件/聊天接口变化。 diff --git a/prd-spec/bugfixes/mpa-studio-account/2026-10-09-sts-account.md b/prd-spec/bugfixes/mpa-studio-account/2026-10-09-sts-account.md new file mode 100644 index 000000000..5461c4c51 --- /dev/null +++ b/prd-spec/bugfixes/mpa-studio-account/2026-10-09-sts-account.md @@ -0,0 +1,53 @@ +# Studio deployment account from STS + +[中文版](2026-10-09-sts-account.zh.md) + +Change ID: mpa-studio-account. Created/revised: 2026-10-09. Status: implemented. + +## Evidence and scope + +Built-in Studio configures a fixed expected account. A new-account credential passes STS but fails the `checking` stage in `managed/service.py` before IAM or resource preparation. The user explicitly requested removal of this built-in account restriction on 2026-10-09. No real credentials or task payloads belong in this document. + +## Requirements and scenarios + +- FR-1: Studio has no expected account; a nonempty STS identity determines the deployment account for IAM, PG, network, APIG and Runtime ownership. +- FR-2: Fresh Runtime `CLAW_SPACE_ID` and `RUNTIME_IAM_ROLE_TRN` derive from the verified account and selected role. No old-account environment value overrides them in built-in defaults. +- FR-3: Explicit YAML account restrictions, caller environment overrides, referenced/template Runtime behavior and the existing check against credential account changes remain compatible. +- FR-4: Image registry addresses and Worker reference IDs are source resources, not deployment identities. Preserve their defaults; do not assume source resources exist in a new account or claim cross-account access is verified. + +Given a different valid STS account, built-in provisioning reaches IAM preparation and uses that account in Runtime environment values. Given an explicit YAML expected-account mismatch, creation still stops before mutation. Given blank STS identity or account changes during creation, fail closed as before. + +## Design and affected contracts + +Remove built-in `account-id` and fixed account-derived environment fields. Keep the image registry as an explicitly named source registry. Fresh templates generate role name/TRN using the selected Runtime role and verified account; existing `apply_runtime_settings` overrides remain authoritative. `build_runtime_env` already derives `CLAW_SPACE_ID` from STS account, so reuse it. + +Contracts: [Studio creation](../../../specs/studio-mpa-creation/README.md), [Runtime provisioning](../../../specs/mpa-runtime-provisioning/README.md). No API, database schema, frontend, task state or permission changes. No cloud mutations, deployment, process restart, commit or push are included. Cancellation and resource cleanup remain unchanged. + +## Tasks and acceptance + +| Requirement | Task | Acceptance | Verification | +| --- | --- | --- | --- | +| FR-1, FR-2 | T-1: regression tests, profile/template fix | AC-1: simulated built-in creation without an account override uses fake STS account through IAM and Runtime | managed config/shared-resource tests | +| FR-3 | T-2: boundary regressions | AC-2: explicit mismatch fails before IAM; selected role derives correct TRN | service tests | +| FR-4 | T-3: bilingual contracts and usage | AC-3: preserved image/reference defaults, documented access limitation | document and diff checks | + +Affect `managed/studio_profile.py`, `managed/service.py`, managed tests, both component specs and managed READMEs. Run `uv run --extra dev pytest tests/integrations/mpa_managed`, changed-file Ruff/Pyright and secret scanning. Frontend/browser/build are not applicable because UI and web assets are unchanged by this fix. Live cloud creation is not_run without an isolated authorized test. + +## Review, approval and risks + +Direct design review (review-spec skill unavailable): requirements and bilingual contracts agree; preserve explicit CLI safety checks, credential-change protection and overrides; no secret output or implicit source-resource cloning. No blockers. User instruction to remove the built-in restriction approves this bounded fix. New-account source-image/reference access can still fail later; this fix does not certify the full new-account deployment chain. Verification recorded below. + +## Verification record + +2026-10-09, working-tree account fix on base `ef0ad519`; previous IAM work and unrelated lockfile changes retained. + +- pass: pre-fix profile/shared-resource regression, 5 expected failures reproduced the fixed-account guard; after implementation the same flow passes with simulated STS identity, IAM preparation and account-derived Runtime metadata. +- pass: `uv run --extra dev pytest tests/integrations/mpa_managed tests/integrations/test_mpa_provision_env.py tests/integrations/test_mpa_runtime.py -q`: 496 passed. A new role test initially used an invalid fixture MPA ID; corrected to the supported format, then the full target passed. +- pass: `uvx --from ruff==0.11.12 ruff check` and repository pre-commit Ruff format/check for the five changed Python files; production Pyright initially passed. Test Pyright found two pre-existing fixture typing issues and one new missing AsyncMock assertion; fixed minimally, final check recorded below. +- pass: changed-file `uv run --extra dev pre-commit run --files` including Python, bilingual specs, managed README and this design: Ruff and hardcoded-secret scan passed; YAML scan not_applicable (no YAML changes). +- not_applicable: frontend tests/build/browser, general-agent chat and sidecar gates; this fix changes no frontend/chat/sidecar contracts or generated assets. +- not_run: full repository regression and all-files pre-commit; no commit requested, narrow provisioning regressions cover this fix. Live new-account creation, image/reference access and server restart are not_run; no cloud mutation was performed. + +Review: existing CLI account assertion is retained for explicitly configured profiles; built-in profile omits the assertion input. Verified account remains the registry scope and credential-change guard. Additional fixture assertions/monkeypatch only repair typing in the affected tests. Both document languages and relative links are reconciled. + +- pass: final `uvx pyright --pythonpath .venv/bin/python` for both production files and all three affected test files: 0 errors, 0 warnings. Post-fixture `uv run --extra dev pytest tests/integrations/mpa_managed/test_service.py tests/integrations/mpa_managed/test_studio_shared_resources.py -q`: 70 passed. Final changed-file pre-commit passed. diff --git a/prd-spec/bugfixes/mpa-studio-account/2026-10-09-sts-account.zh.md b/prd-spec/bugfixes/mpa-studio-account/2026-10-09-sts-account.zh.md new file mode 100644 index 000000000..44b6e556a --- /dev/null +++ b/prd-spec/bugfixes/mpa-studio-account/2026-10-09-sts-account.zh.md @@ -0,0 +1,53 @@ +# Studio 使用 STS 核验的部署账号 + +[English](2026-10-09-sts-account.md) + +变更 ID:mpa-studio-account。创建/修订日期:2026-10-09。状态:implemented。 + +## 证据与范围 + +内置 Studio 配置固定的预期账号。新账号凭据通过 STS 后,在 `managed/service.py` 的 `checking` 阶段失败,尚未准备 IAM 或其他资源。用户在 2026-10-09 明确要求去掉该内置账号限制。本文件不包含真实凭据或任务载荷。 + +## 需求与场景 + +- FR-1:Studio 不预设账号;非空 STS 身份决定 IAM、PG、网络、APIG 和 Runtime 归属的部署账号。 +- FR-2:新建 Runtime 的 `CLAW_SPACE_ID` 和 `RUNTIME_IAM_ROLE_TRN` 由核验账号和所选角色生成。内置默认值不以旧账号环境变量覆盖它们。 +- FR-3:保留显式 YAML 账号限制、调用方环境变量覆盖、引用/模板 Runtime 行为以及创建期间凭据切换账号的现有检查。 +- FR-4:镜像仓库地址和 Worker 参考 ID 是源资源,不是部署身份。保留默认值,不假定新账号存在这些源资源,不宣称已验证跨账号访问。 + +当 STS 返回另一个有效账号,内置创建应进入 IAM 准备,并在 Runtime 环境变量中使用该账号。当显式 YAML 预期账号不匹配时,仍在资源变更前停止。STS 身份为空或创建中账号变化时,继续按原规则拒绝执行。 + +## 设计与受影响契约 + +移除内置 `account-id` 和固定账号派生的环境字段。镜像仓库保留为名称明确的源仓库。新建模板使用所选 Runtime 角色和核验账号生成角色名/TRN;现有 `apply_runtime_settings` 的显式覆盖保持优先。`build_runtime_env` 已根据 STS 账号派生 `CLAW_SPACE_ID`,直接复用。 + +契约:[Studio 创建](../../../specs/studio-mpa-creation/README.zh.md)、[Runtime 部署](../../../specs/mpa-runtime-provisioning/README.zh.md)。不改变 API、数据库结构、前端、任务状态或权限。不包含云资源变更、部署、进程重启、提交或推送。取消及资源清理行为保持不变。 + +## 任务与验收 + +| 需求 | 任务 | 验收 | 验证 | +| --- | --- | --- | --- | +| FR-1、FR-2 | T-1:回归测试及配置/模板修复 | AC-1:模拟内置创建无需覆盖账号,IAM 和 Runtime 使用模拟 STS 账号 | managed 配置/共享资源测试 | +| FR-3 | T-2:边界回归 | AC-2:显式账号不匹配在 IAM 前失败;所选角色派生正确 TRN | service 测试 | +| FR-4 | T-3:双语契约及使用说明 | AC-3:保留镜像/参考默认值并记录访问限制 | 文档及差异检查 | + +涉及 `managed/studio_profile.py`、`managed/service.py`、managed 测试、两组组件契约和 managed README。运行 `uv run --extra dev pytest tests/integrations/mpa_managed`、变更文件 Ruff/Pyright 和密钥扫描。本次修复不修改 UI 或 web 产物,前端/浏览器/构建检查不适用。未获得隔离真实测试授权时,云端创建为 not_run。 + +## 审查、批准与风险 + +直接设计审查(review-spec 技能不可用):需求与双语契约一致;保留显式 CLI 安全检查、凭据账号变化保护和覆盖规则;不输出密钥,不隐式复制源资源。无阻塞项。用户要求移除内置限制,批准本次限定修复。新账号仍可能在后续遇到源镜像/参考模板访问失败,本次修复不证明完整新账号部署链路。验证记录见下。 + +## 验证记录 + +2026-10-09,基于 `ef0ad519` 工作区的账号修复;保留此前 IAM 工作及无关 lockfile 改动。 + +- pass:修复前配置/共享资源回归出现 5 个预期失败,复现固定账号拦截;实现后相同流程使用模拟 STS 身份,通过 IAM 准备和 Runtime 账号元数据检查。 +- pass:`uv run --extra dev pytest tests/integrations/mpa_managed tests/integrations/test_mpa_provision_env.py tests/integrations/test_mpa_runtime.py -q`:496 项通过。新增角色测试最初使用了无效 MPA ID 夹具,改为支持的格式后完整目标通过。 +- pass:五个变更 Python 文件的 `uvx --from ruff==0.11.12 ruff check` 和仓库 pre-commit Ruff 格式/检查;生产代码 Pyright 首轮通过。测试 Pyright 发现两处既有夹具类型问题及一处新增 AsyncMock 缺失断言,均做最小修复,最终结果见下。 +- pass:包含 Python、双语契约、managed README 和本设计的变更文件 `uv run --extra dev pre-commit run --files`:Ruff 和硬编码密钥扫描通过;YAML 扫描 not_applicable(未修改 YAML)。 +- not_applicable:前端测试/构建/浏览器、通用智能体聊天及 sidecar 门禁;本修复不改动前端/聊天/sidecar 契约或生成产物。 +- not_run:全仓回归和 all-files pre-commit;没有提交请求,限定部署回归覆盖本修复。真实新账号创建、镜像/参考资源访问及服务重启为 not_run;未执行云资源变更。 + +审查:显式配置仍保留 CLI 账号断言;内置配置不提供断言输入。核验账号继续决定注册表范围及凭据账号变化保护。额外夹具断言/monkeypatch 仅修复受影响测试的类型问题。双语文档及相对链接已同步。 + +- pass:最终对两个生产文件及三个受影响测试文件执行 `uvx pyright --pythonpath .venv/bin/python`:0 错误、0 警告。夹具修正后执行 `uv run --extra dev pytest tests/integrations/mpa_managed/test_service.py tests/integrations/mpa_managed/test_studio_shared_resources.py -q`:70 项通过。最终变更文件 pre-commit 通过。 diff --git a/prd-spec/bugfixes/mpa-subnet-order/2026-10-09-subnet-order.md b/prd-spec/bugfixes/mpa-subnet-order/2026-10-09-subnet-order.md new file mode 100644 index 000000000..9720a92df --- /dev/null +++ b/prd-spec/bugfixes/mpa-subnet-order/2026-10-09-subnet-order.md @@ -0,0 +1,50 @@ +# Preserve managed Runtime recovery across subnet ordering changes + +[中文版](2026-10-09-subnet-order.zh.md) + +- Change ID: `mpa-subnet-order` +- Created/revised: 2026-10-09 +- Status: implemented +- Contracts: [Studio creation](../../../specs/studio-mpa-creation/README.md), [Runtime provisioning](../../../specs/mpa-runtime-provisioning/README.md). + +## Background and scope + +Read-only diagnosis found a Runtime with platform Ready and HTTP 200 readiness, but its creation task failed immediately after V1 became Ready. The shared registry and Runtime contained the same two subnets in opposite order. validate_runtime compares SubnetIds as an ordered list and raises a migration error. An isolated synthetic reproduction confirmed this cause. AccountNetworkProvisioner.ensure repeats that ordered comparison on resume. Adopting the platform order also changes the existing request hash on retry. + +Goals: ignore provider-only subnet permutations at both guards and resume the original deployment without replacing resources. Non-goals: cloud resource writes during verification, registry repairs, broad diagnostics changes, UI/chat changes, permissions, image changes or bypassing actual network drift. + +## Scenarios and requirements + +- FR-1 / AC-1: Given identical unique nonempty subnet lists in different orders, initial Runtime validation and existing Runtime network preparation accept them. VpcId and EnableSharedInternetAccess remain exact comparisons; added, removed, substituted, duplicated or malformed subnet selections remain errors. +- FR-2 / AC-2: Retry retains the caller's requested subnet order, or the registered order when its membership equals the current Runtime selection. Otherwise retain the current selection, never adopt a different registered membership. This preserves already persisted request hashes and ClientTokens for unchanged inputs. Do not sort or rewrite old deployment records or relax changed-input conflict checks. +- FR-3 / AC-3: Simulated full creation and recovery of a pending V1 deployment with reordered provider metadata finish environment/key finalization and readiness, retain the Runtime/Skill Space/database identifiers and create no duplicate resources. Caller inputs and provider objects remain unchanged. + +## Design and contract impact + +Share a small subnet-membership comparator in managed/network.py, validating list shape, nonempty string IDs and uniqueness before set comparison. Use it only for SubnetIds in network.py and runtime.py; other immutable fields remain strict. For resume, retain explicit requested ordering. With no explicit selection, prefer the shared registry ordering only if it has identical members to the active Runtime; otherwise preserve the active per-agent selection. This addresses both migration guards and retry hash stability without changing hashing format or persistent schema. + +Studio creation owns this network/recovery contract; Runtime provisioning references it. No API/configuration/schema/dependency/permission changes; general agents, CLI legacy provisioning, async deadlines, locks, cancellation, terminal handling and credential boundaries remain unchanged. Malformed lists are rejected rather than converted to sets blindly. Reuse existing fake cloud/registry lifecycle tests; no frontend or generated assets are affected. + +## Tasks and affected files + +- T-1 (FR-1/AC-1): failing tests in test_deployment_network.py and test_runtime_deployment_edges.py; update managed/network.py and managed/runtime.py. +- T-2 (FR-2, FR-3/AC-2, AC-3): regression for a persisted pending V1 with original hash, reversed metadata, same-ID retry and no duplicates; preserve explicit order and registered order in network preparation. +- T-3: reconcile paired Studio/Runtime specs and managed README guides, run targeted/broader affected provisioning tests, Ruff/Pyright, scoped pre-commit/secret scan and document link/whitespace checks. + +## Risks and acceptance verification + +Blind set conversion could hide duplicate or invalid IDs: validate before comparison and cover negatives. Returning provider order could strand old pending hashes: exercise an already persisted original request through the production retry path. Registry membership can differ for explicit per-agent overrides: do not substitute the shared default when members differ. Simulated tests do not prove cloud publication; live retry remains an operator action after the fix. No unreviewed cloud mutation is needed to deliver this code repair. + +## Review and approval + +User approved the preceding proposed repair with “修复下” on 2026-10-09. The implementation detail preserving hash order is necessary to deliver that same-ID recovery requirement. review-spec is unavailable in the skill catalog; direct review before production/test edits checked bilingual equivalence, contract ownership, error boundaries, compatibility, security, testability and retained concurrency/deadline behavior. No blockers. Tested scope will be ef0ad519 plus this fix and the pre-existing uncommitted MPA changes. Results will be recorded below; full commit synchronization/gates await commit authorization. + +## Results (2026-10-09) + +- pass: T-1/T-2 and AC-1/AC-2/AC-3. The corrected fail-first fixture produced six failures from ordered comparison/request-hash drift, one existing-success boundary passed (103 deselected), before implementation. +- pass: `uv run --extra dev pytest tests/integrations/mpa_managed tests/integrations/test_mpa_provision_env.py tests/integrations/test_mpa_runtime.py tests/cli/test_frontend_deploy_iam.py -q --tb=short` — 625 passed, five existing deprecation warnings. Includes fresh/pending lifecycle, finalization, unchanged hash/token, negative drift and malformed-list coverage. +- pass: `uvx --from ruff==0.11.12 ruff check` and `uvx pyright --pythonpath .venv/bin/python` on network.py, runtime.py, test_deployment_network.py and test_runtime_deployment_edges.py. Initial Pyright findings were repaired (list narrowing and conditional test variables); final result zero errors. +- pass: direct implementation review verifies unchanged request hashing, no mutation of caller/provider selections, same-membership-only registry ordering preference, no relaxed resource ownership or real-drift checks, and unchanged async lifecycle/cleanup. +- blocked: fresh live read-only Runtime/registry verification returned ApiError; no provider payload or credentials were printed. The earlier diagnostic snapshot and synthetic regression establish the ordering defect, but no successful post-fix cloud read or retry is claimed. +- pass: scoped pre-commit (Ruff, formatting and hardcoded-secret detection), paired-language relative links/identifiers and diff whitespace. Formatting initially changed two test files; checks were rerun after formatting. YAML scan not_applicable, no YAML changed. +- not_run: cloud deployment retry/full live publication; this verification performs no cloud writes. Full SDK-wide regression is not_run because the affected managed/legacy deployment suite covers the scoped integration change. UI/build/browser/generated artifacts and Codex/harness process smoke are not_applicable: no changes to those paths. Full commit synchronization/all-files gates await an authorized commit. T-3 complete; no deferred implementation scope. diff --git a/prd-spec/bugfixes/mpa-subnet-order/2026-10-09-subnet-order.zh.md b/prd-spec/bugfixes/mpa-subnet-order/2026-10-09-subnet-order.zh.md new file mode 100644 index 000000000..9c43159c3 --- /dev/null +++ b/prd-spec/bugfixes/mpa-subnet-order/2026-10-09-subnet-order.zh.md @@ -0,0 +1,50 @@ +# 在子网顺序变化时保留托管 Runtime 的恢复能力 + +[English](2026-10-09-subnet-order.md) + +- 变更 ID:`mpa-subnet-order` +- 创建/修订:2026-10-09 +- 状态:implemented +- 契约:[Studio 创建](../../../specs/studio-mpa-creation/README.zh.md)、[Runtime 部署](../../../specs/mpa-runtime-provisioning/README.zh.md)。 + +## 背景和范围 + +只读诊断发现 Runtime 的平台状态为 Ready,就绪接口为 HTTP 200,但创建任务在 V1 就绪后立即失败。共享注册记录与 Runtime 包含同样两个子网,顺序相反。validate_runtime 按有序列表比较 SubnetIds,抛出迁移错误。独立的合成样例已确认原因。AccountNetworkProvisioner.ensure 在恢复时重复该有序比较,采用平台顺序还会改变重试时已有的请求哈希。 + +目标:两处检查均忽略提供方仅改变子网顺序的情况,恢复原部署且不替换资源。非目标:验证时写云资源、修复注册记录、扩大诊断改造、修改 UI/聊天、权限、镜像或绕过真实网络变更。 + +## 场景和需求 + +- FR-1 / AC-1:两份子网列表成员相同、非空且无重复,仅顺序不同,首次 Runtime 校验和已有 Runtime 网络准备均接受。VpcId、EnableSharedInternetAccess 仍精确比较;增加、删除、替换、重复或格式错误的子网选择仍报错。 +- FR-2 / AC-2:重试保留调用方请求中的子网顺序;没有显式选择且共享记录与当前 Runtime 成员一致时保留注册顺序,否则保留当前选择,不采用成员不同的共享默认值。这保留未改变输入的已持久化请求哈希和 ClientToken。不排序或改写旧部署记录,不放宽输入变更冲突检查。 +- FR-3 / AC-3:模拟完整创建及已有待完成 V1 的恢复,平台元数据顺序相反时仍完成环境/密钥补齐和就绪检查,保留 Runtime/Skill Space/数据库标识且无重复资源。调用方输入和平台对象保持不变。 + +## 设计和契约影响 + +在 managed/network.py 共用一个小型子网成员比较函数,先验证列表格式、非空字符串 ID 和唯一性,再比较集合。network.py 和 runtime.py 仅对 SubnetIds 使用该函数,其他不可变字段仍严格比较。恢复时保留显式请求顺序;没有显式选择时,仅在共享注册记录与当前 Runtime 成员相同时使用注册顺序,否则保留当前智能体的选择。这同时解决迁移误判与重试哈希稳定性,不改变哈希格式或持久化结构。 + +Studio 创建拥有网络/恢复契约,Runtime 部署引用该契约。无 API/配置/结构/依赖/权限变化;通用智能体、旧 CLI 部署、异步截止时间、锁、取消、终态处理及凭据边界均不变。不盲目转换集合,格式错误列表仍拒绝。复用现有模拟云/注册记录生命周期测试,不涉及前端或生成资源。 + +## 任务和影响文件 + +- T-1(FR-1/AC-1):在 test_deployment_network.py、test_runtime_deployment_edges.py 添加先失败测试,修改 managed/network.py、managed/runtime.py。 +- T-2(FR-2、FR-3/AC-2、AC-3):覆盖已有待完成 V1、原始哈希、反序元数据、同 ID 重试及无重复资源;网络准备保留显式或注册顺序。 +- T-3:同步 Studio/Runtime 双语契约及 managed README 指南,运行目标和受影响部署回归、Ruff/Pyright、范围内 pre-commit/密钥扫描及文档链接/空白检查。 + +## 风险和验收验证 + +盲目转换集合可能隐藏重复或非法 ID:比较前验证并覆盖反例。采用平台顺序可能让旧待完成哈希无法恢复:通过生产重试路径验证已持久化原始请求。显式智能体覆盖可能与注册成员不同:不得以共享默认值替换。模拟测试不能证明云端发布,修复后的真实重试仍由操作者执行。交付代码修复不需要未经审查的云写操作。 + +## 审查和批准 + +用户于 2026-10-09 用“修复下”批准上轮提出的修复。保留哈希顺序是实现同 ID 恢复要求的必要细节。技能目录无 review-spec,修改生产代码/测试前已直接审查双语等价性、契约归属、错误边界、兼容性、安全、可测试性以及保留的并发/截止时间行为,无阻塞项。验证范围为 ef0ad519 加本次修复及已有未提交 MPA 修改。结果记录于下方;完整提交同步和门禁等待提交授权。 + +## 结果(2026-10-09) + +- pass:T-1/T-2、AC-1/AC-2/AC-3。修正测试样例后,实施前先失败测试出现六处有序比较/请求哈希漂移失败,一项原本成功的边界通过(103 项未选中)。 +- pass:`uv run --extra dev pytest tests/integrations/mpa_managed tests/integrations/test_mpa_provision_env.py tests/integrations/test_mpa_runtime.py tests/cli/test_frontend_deploy_iam.py -q --tb=short` — 625 项通过,五条已有弃用警告。包含首次/待完成生命周期、补齐流程、原哈希/token 保留、真实变更及格式错误列表反例。 +- pass:对 network.py、runtime.py、test_deployment_network.py、test_runtime_deployment_edges.py 执行 `uvx --from ruff==0.11.12 ruff check`、`uvx pyright --pythonpath .venv/bin/python`。初次 Pyright 问题已修复(列表类型收窄和条件测试变量),最终零错误。 +- pass:直接实现审查确认请求哈希算法未变,不修改调用方/平台的子网选择,仅成员一致时优先采用注册顺序,不放宽资源归属或真实变更检查,异步生命周期/清理不变。 +- blocked:本次真实 Runtime/注册记录只读核对返回 ApiError,未输出提供方请求内容或凭据。此前诊断快照及合成回归已确认顺序缺陷,但不声称修复后云查询或重试已成功。 +- pass:范围内 pre-commit(Ruff、格式及硬编码密钥检测)、双语相对链接/标识和 diff 空白检查。格式检查首次修改两个测试文件,格式化后重跑检查。YAML 扫描 not_applicable,未修改 YAML。 +- not_run:云端部署重试/完整实际发布,验证不执行云写操作。全 SDK 回归 not_run,受影响的托管/旧部署测试已覆盖本次集成修复。UI/构建/浏览器/生成资源及 Codex/harness 进程 smoke 为 not_applicable,未修改这些路径。完整提交同步/全文件门禁等待提交授权。T-3 完成,无延期实现范围。 diff --git a/prd-spec/bugfixes/mpa-worker-naming/2026-10-09-runtime-named-worker.md b/prd-spec/bugfixes/mpa-worker-naming/2026-10-09-runtime-named-worker.md new file mode 100644 index 000000000..52028f2b3 --- /dev/null +++ b/prd-spec/bugfixes/mpa-worker-naming/2026-10-09-runtime-named-worker.md @@ -0,0 +1,54 @@ +# Use the entered Runtime name for new MPA sandbox templates + +[中文版](2026-10-09-runtime-named-worker.zh.md) + +- Change ID: `runtime-named-worker`; created/revised: 2026-10-09; status: implemented. +- Contract: [Studio MPA creation CON-3](../../../specs/studio-mpa-creation/README.md). +- Predecessor: [agent-derived worker names](2026-09-28-agent-derived-worker-name.md). + +## Background, goals and non-goals + +Named Studio creation keeps an automatically generated agent ID separate from the entered Runtime name. `service.provision` forwards the name to Runtime deployment but not to `ensure_worker`, so sandbox templates still display the generated ID with hyphens replaced by underscores. The user withdrew the proposed internal-ID change and requested only matching new template names to the entered name. + +Keep internal ID generation, ownership, database/Skill Space/channel bindings, Runtime names, image defaults, directory search and the three-step form unchanged. No cloud renames, task/database edits, credential changes, deployment, commit or push are authorized. Generic agents and existing CLI callers without a name remain unchanged. + +## Requirements and scenarios + +- FR-1 / AC-1: A fresh named request creates/discovers a Worker with exactly the validated, trimmed Runtime name, including case, hyphens and underscores. The existing 4–64 ASCII-name contract applies; invalid names fail before Worker cloud calls. The [official CreateTool contract](https://docs.volcengine.com/docs/agentkit/CreateTool_-_Creates_tool?lang=zh) supports the same characters and length. +- FR-2 / AC-2: The service passes the name to Worker preparation; `MPA_AGENT_ID`, scoped ownership tags, registry keys and Runtime `ToolId` retain their original identifiers. Legacy calls without a name still use the normalized agent ID. +- FR-3 / AC-3: Existing bound/configured Worker IDs are authoritative and are not renamed. A pending pre-upgrade Worker intent can replay the normalized-ID name or older hashed name only if the entire candidate payload matches its persisted hash, retaining the original ClientToken. All other payload changes fail before discovery/creation. +- FR-4 / AC-4: New pending intents store their selected `worker_name` in the existing deployment JSON. A later different name must not be treated as a legacy fallback. A matching name owned by another agent is still an error; no silent adoption or success. + +Given a named fresh request, the template name matches the Runtime name and internal bindings remain stable. Given a lost create response or upgrade, the exact pending payload/token is retried. Given a registered Worker, no discovery/create/rename occurs. Given an unrelated duplicate name or changed image, fail without weakening ownership checks. + +## Design, contracts and affected files + +Add an optional keyword-only `runtime_name` to `ensure_worker` and forward it from `service.provision`. Validate it with the existing Runtime-name validator and use it directly as new CreateTool `Name`. Existing IDs bypass naming reconciliation. Persist nonsecret `worker_name` with newly saved intents. For old records without that field, compare the complete current payload against the two historical Name variants before permitting fallback; retain the field's absence across retries so repeated lost responses still replay the original name. Names alone never authorize reuse. Existing account locking, retry bounds, timeout/cancellation and metadata verification remain unchanged. + +Production files: `managed/worker.py`, `managed/service.py`. Tests: `test_worker.py`, `test_service.py`. Maintain bilingual creation specs and managed README naming sections. No SQL migration, external API/request-body change, new dependency, permission or frontend/build artifact is needed. Public optional-keyword addition preserves existing callers. Search already uses Runtime `name`, so its behavior is unchanged. Human names can collide; existing collision refusal remains required rather than adding unrequested suffixes. + +## Tasks, acceptance and verification + +1. T-1 / FR-1–FR-4: Add failing regressions for exact names, boundaries, service forwarding, pending replay, changed-name/image refusal, collision refusal and existing-ID reuse. +2. T-2 / FR-1–FR-4: Implement the optional name and full-hash legacy compatibility. +3. T-3: Reconcile both documentation languages; run targeted Worker/service tests, managed/CLI regression, changed-file Ruff/Pyright, pre-commit and whitespace/link checks. + +Commands: `uv run --extra dev pytest tests/integrations/mpa_managed/test_worker.py tests/integrations/mpa_managed/test_worker_recovery.py tests/integrations/mpa_managed/test_service.py -n 2 -q`; `uv run --extra dev pytest tests/integrations/mpa_managed tests/cli/test_cli_mpa.py -n 2 -q`; Ruff/Pyright on changed Python files; `uv run --extra dev pre-commit run --all-files`; `git diff --check`. Real cloud creation is not authorized and is reported separately. Frontend/browser/sidecar gates are not applicable because this change touches only managed provisioning, with no UI or sidecar changes. + +## Review, approval and risks + +The user's final instruction “保持原样吧,但是把沙箱模板的名称也换成手填的就行” approves this bounded scope and supersedes the internal-ID proposal, which made no code changes. `review-spec` is unavailable; direct review checked ownership, hash/token recovery, existing IDs, exact-name constraints, cancellation/timeouts, bilingual equivalence and testability. No design blockers. An existing same-name Tool can reject a new request. Existing tools will still have their previous names; correcting them requires a separately authorized operation. A pending new-name intent requires this code to replay it after rollback. + +## Delivery evidence + +T-1–T-3 and AC-1–AC-4 are complete. Direct implementation review found and fixed the repeated legacy-retry case before delivery. Existing uncommitted image-discovery rollback is preserved separately; its tests/assets are not attributed to this naming fix. Tested scope: the four changed Python files and affected managed/CLI suites on the uncommitted diff based on `df797f94`, 2026-10-09. + +- `pass`: Regression-first new-name tests initially failed in 16 cases; a subsequent repeated legacy-retry regression failed in two cases before its fix. +- `pass`: Targeted Worker/recovery/service checks: 175 tests. Final managed/CLI regression with two workers: 678 tests, including continuous legacy retry and existing-ID reuse. +- `pass`: Ruff 0.11.12 check/format on the four changed Python files; Pyright: zero errors/warnings. +- `pass`: `uv run --extra dev pre-commit run --all-files`, including both secret checks; `git diff --check`; paired-language and local-link checks. +- `not_run`: Full repository Python regression; the affected managed/CLI integration coverage was selected for this bounded provisioning change. +- `not_run`: Real cloud creation/rename; not authorized. Restart the running Studio service to load the change before creating a fresh named request. +- `not_applicable`: Frontend/browser/build, sidecar and runtime-process smoke gates; no UI, generated assets, sidecar or runtime-process change in this fix. + +No commit, push, deployment or existing-resource rename was performed. diff --git a/prd-spec/bugfixes/mpa-worker-naming/2026-10-09-runtime-named-worker.zh.md b/prd-spec/bugfixes/mpa-worker-naming/2026-10-09-runtime-named-worker.zh.md new file mode 100644 index 000000000..6aae3d8e1 --- /dev/null +++ b/prd-spec/bugfixes/mpa-worker-naming/2026-10-09-runtime-named-worker.zh.md @@ -0,0 +1,54 @@ +# 新 MPA 沙箱模板使用手填 Runtime 名称 + +[English](2026-10-09-runtime-named-worker.md) + +- Change ID:`runtime-named-worker`;创建/修订:2026-10-09;状态:implemented。 +- 契约:[Studio MPA 创建 CON-3](../../../specs/studio-mpa-creation/README.zh.md)。 +- 前序:[从智能体 ID 派生 Worker 名称](2026-09-28-agent-derived-worker-name.zh.md)。 + +## 背景、目标与非目标 + +Studio 名称创建将自动生成的智能体 ID 与手填 Runtime 名称分开。`service.provision` 将名称传给 Runtime 部署,却没有传给 `ensure_worker`,所以沙箱模板仍显示将连字符替换为下划线的内部 ID。用户取消了内部 ID 改造,只要求新模板名称与手填名称一致。 + +保持内部 ID 生成、归属、数据库/技能空间/渠道绑定、Runtime 名称、镜像默认值、列表搜索及三步表单不变。未授权云资源改名、任务/数据库修改、凭证变更、部署、提交或推送。通用智能体及不提供名称的旧 CLI 调用不变。 + +## 需求与场景 + +- FR-1 / AC-1:新的名称创建请求创建/发现 Worker 时,使用经过校验、去除首尾空白的 Runtime 名称,保留大小写、连字符和下划线。沿用 4–64 位 ASCII 名称合同;非法名称在 Worker 云调用前失败。[官方 CreateTool 合同](https://docs.volcengine.com/docs/agentkit/CreateTool_-_Creates_tool?lang=zh) 支持相同字符和长度。 +- FR-2 / AC-2:服务将名称传给 Worker 准备;`MPA_AGENT_ID`、作用域归属标签、注册库键及 Runtime `ToolId` 仍使用原标识。不提供名称的旧调用仍使用标准化的智能体 ID。 +- FR-3 / AC-3:已绑定/显式配置的 Worker ID 优先,不进行改名。升级前未完成的 Worker 意图仅在完整候选请求与已存 hash 一致时,才可重放标准化 ID 名称或更早的哈希名称,保留原 ClientToken。其他请求变化在发现/创建前失败。 +- FR-4 / AC-4:新的未完成意图在已有部署 JSON 中保存选中的 `worker_name`。后续不同名称不得被视为旧版兼容回退。同名但属于其他智能体的资源仍报错,不静默接管或视为成功。 + +给定新的名称请求,模板名称与 Runtime 名称一致,内部绑定稳定。给定创建响应丢失或升级,重试完整原请求/token。给定已登记 Worker,不发现/创建/改名。给定无关同名资源或镜像变化,不降低归属检查并直接失败。 + +## 设计、契约与影响文件 + +为 `ensure_worker` 增加可选仅关键字参数 `runtime_name`,由 `service.provision` 传入。使用现有 Runtime 名称校验器校验,并直接作为新 CreateTool `Name`。已有 ID 跳过命名协调。新意图保存时持久化非密钥字段 `worker_name`。旧记录没有该字段时,对两种历史 Name 分别计算完整当前请求的 hash,仅完全匹配才允许回退;重试时仍不补写该字段,确保连续丢失响应时继续重放原名称。名称本身不授权复用。账号锁、重试次数、超时/取消及元数据验证保持不变。 + +生产文件:`managed/worker.py`、`managed/service.py`。测试:`test_worker.py`、`test_service.py`。维护双语创建契约及 managed README 命名段落。不需要 SQL 迁移、外部 API/请求体变更、新依赖、权限或前端/构建产物修改。公开可选关键字参数兼容现有调用。搜索已使用 Runtime `name`,行为不变。用户名称可能冲突;保留现有冲突拒绝,不添加未要求的后缀。 + +## 任务、验收与验证 + +1. T-1 / FR-1–FR-4:补充先失败回归,覆盖准确名称、边界、服务透传、未完成重放、名称/镜像变化拒绝、同名冲突拒绝和已有 ID 复用。 +2. T-2 / FR-1–FR-4:实现可选名称和完整 hash 的旧版兼容。 +3. T-3:同步双语文档;运行 Worker/服务目标测试、managed/CLI 回归、改动文件 Ruff/Pyright、pre-commit 及空白/链接检查。 + +命令:`uv run --extra dev pytest tests/integrations/mpa_managed/test_worker.py tests/integrations/mpa_managed/test_worker_recovery.py tests/integrations/mpa_managed/test_service.py -n 2 -q`;`uv run --extra dev pytest tests/integrations/mpa_managed tests/cli/test_cli_mpa.py -n 2 -q`;改动 Python 文件 Ruff/Pyright;`uv run --extra dev pre-commit run --all-files`;`git diff --check`。真实云创建未授权,单独报告。前端/浏览器/sidecar 检查不适用,本次只修改托管创建,无 UI 或 sidecar 变化。 + +## 审查、批准与风险 + +用户最终要求“保持原样吧,但是把沙箱模板的名称也换成手填的就行”,批准此范围,并取代尚未修改代码的内部 ID 方案。`review-spec` 不可用;直接审查核对归属、hash/token 恢复、已有 ID、准确名称约束、取消/超时、双语等价和可测试性,无设计阻塞。已有同名 Tool 可能使新请求失败。已有模板继续保留旧名称,修正须另行授权。若回滚后要重放新的名称意图,需要此版本代码。 + +## 交付证据 + +T-1–T-3 与 AC-1–AC-4 已完成。交付前直接实施审查发现并修复了旧任务连续重试的问题。之前未提交的镜像查询撤回独立保留,其测试/构建产物不归属于本次命名修复。测试范围:基于 `df797f94` 的未提交差异中四个 Python 文件及受影响的 managed/CLI 测试,执行日期 2026-10-09。 + +- `pass`:先失败回归中,新名称测试最初 16 项失败;随后旧任务连续重试回归在修复前 2 项失败。 +- `pass`:Worker/恢复/服务目标测试 175 项;最终 managed/CLI 回归使用两个进程,678 项通过,包含旧任务连续重试和已有 ID 复用。 +- `pass`:四个改动 Python 文件的 Ruff 0.11.12 check/format;Pyright 零错误/警告。 +- `pass`:`uv run --extra dev pre-commit run --all-files`,包含两项密钥检查;`git diff --check`;双语配对及本地链接检查。 +- `not_run`:全仓 Python 回归;针对本次有限的创建流程变更,选择受影响的 managed/CLI 集成覆盖。 +- `not_run`:真实云创建/改名,未授权。创建新的名称请求前,应重启正在运行的 Studio 服务加载改动。 +- `not_applicable`:前端/浏览器/构建、sidecar 和运行时进程 smoke;本次修复没有 UI、生成产物、sidecar 或运行时进程变更。 + +未执行提交、推送、部署或已有资源改名。 diff --git a/prd-spec/bugfixes/mpa-worker-template/2026-10-09-independent-worker.md b/prd-spec/bugfixes/mpa-worker-template/2026-10-09-independent-worker.md new file mode 100644 index 000000000..ecac3ad2d --- /dev/null +++ b/prd-spec/bugfixes/mpa-worker-template/2026-10-09-independent-worker.md @@ -0,0 +1,62 @@ +# Worker creation without an old-account template + +[中文版](2026-10-09-independent-worker.zh.md) + +- Change ID: `mpa-worker-template` +- Created/revised: 2026-10-09 +- Status: implemented +- Contracts: [Studio creation](../../../specs/studio-mpa-creation/README.md), [Runtime provisioning](../../../specs/mpa-runtime-provisioning/README.md). + +## Background and evidence + +Studio's built-in Worker profile references a Tool in a previous account. A fresh deployment account cannot read that Tool: creation fails at `get_reference_worker` before `CreateTool`. The Worker image is already explicit. `worker.py` only copies environment settings from the reference; command, resources, role and networking come from the provisioner. The pinned Worker source revision `81f3496`, `scripts/run.sh`, supplies startup defaults without a reference Tool. + +## Goals, non-goals and scenarios + +Allow a fresh account to create a Worker from its image and explicit startup settings. Keep optional references/existing Workers compatible. Do not change images, IAM/networking, Runtime chat, frontend, or automatically modify existing Tools. Registry image access remains an independent prerequisite. + +- Fresh Studio creation reaches `CreateTool` without reading an old reference. +- A CLI profile may explicitly inherit an accessible Tool's environment, with explicit settings taking precedence. +- Missing explicit references remain failures; retrying an uncertain creation preserves its payload/token. + +## Requirements and design + +- **FR-1:** Remove built-in `reference-id`. Pin nonsecret `PORT`, Worker port, headless/minimal mode, workspace/data/runtime/sidecar roots and Skill Space base directory to the pinned image's defaults. +- **FR-2:** Add optional `managed.worker.env: dict[str, str]`, default empty. Resolve whole `${ENV_NAME}` references on the server. Reject invalid uppercase environment keys, agent/Runtime/Tool/Skill Space bindings, inherited channel/Runtime credentials and control database URLs. Nonempty env with `existing-id` fails rather than being silently ignored. +- **FR-3:** Merge filtered reference environment, explicit env, then generated `MPA_AGENT_ID`. Do not mutate the profile or reference response. Optional explicit reference failure never falls back to an empty environment. +- **FR-4:** Keep sorted request hashing, ClientToken, ownership validation, cancellation and bounded retry unchanged. Changed explicit env on an unfinished request is a configuration conflict. Do not persist env values in deployment records or expose them in config summaries, repr or error responses. + +The existing image contract handles model credentials per session; Studio does not copy old model keys. Additional operator settings use Worker env with server secret references. No new dependency, cloud API, permission, task schema or frontend asset is required. The Studio component owns the new configuration contract; Runtime provisioning references it. Legacy non-managed creation is unchanged. + +## Tasks and acceptance + +| Requirement | Task | Acceptance | +| --- | --- | --- | +| FR-1 | T-1: update built-in profile and regression | AC-1: image-only fresh-account request skips reference lookup and carries explicit startup settings | +| FR-2 | T-2: config schema/resolution and safe validation tests | AC-2: secret refs resolve; invalid/owned keys and existing-worker env fail without exposing values | +| FR-3 | T-3: request merge and compatibility tests | AC-3: explicit values win, agent binding remains generated, explicit missing reference still fails | +| FR-4 | T-4: retry/immutability tests and review | AC-4: unchanged payload retries use the same token; changed env fails; registry/summary/repr exclude env values | + +## Risks and recovery + +Defaults cover the pinned image; custom images may need explicit env. No cloud creation smoke is performed automatically. Existing Tool IDs remain authoritative; no rename/update. Tasks that failed before Worker intent creation can retry with the same agent ID after Studio restarts. Already-dispatched tasks with changed hashes require their original configuration; never reset intent to bypass duplicate protection. + +## Review and verification record + +Direct design review (review-spec unavailable) cleared configuration precedence, secret handling, account boundaries, partial failure, compatibility and bilingual equivalence. User approved the proposed removal of the fixed old template and explicit configuration with “帮我改” on 2026-10-09 before implementation. + +Verification scope: this Worker change on `ef0ad519` plus prior uncommitted account/IAM/network/APIG fixes. Required commands: targeted config/Worker tests, managed provisioning regression, changed-file Ruff/Pyright, scoped pre-commit, bilingual/link/whitespace checks. Live cloud creation: `not_run`; code and simulated requests cannot prove image pull permissions or platform readiness. Browser/frontend gates: `not_applicable`, no UI/API changes. Results will be recorded after execution. + +### Executed checks (2026-10-09) + +- `fail` before implementation: config/Worker regression reproduced the fixed old reference and missing env support (5 failed, 94 passed). +- `pass`: `uv run --extra dev pytest tests/integrations/mpa_managed/test_config.py tests/integrations/mpa_managed/test_worker.py tests/integrations/mpa_managed/test_worker_recovery.py tests/integrations/mpa_managed/test_worker_metadata.py -q --tb=short` — 152 passed. +- `pass`: `uv run --extra dev pytest tests/integrations/mpa_managed tests/integrations/test_mpa_provision_env.py tests/integrations/test_mpa_runtime.py tests/cli/test_frontend_deploy_iam.py -q --tb=short` — 594 passed, 5 existing deprecation warnings; includes final reference filtering and pending-env recovery. +- `pass`: `uvx --from ruff==0.11.12 ruff check` and `uvx pyright --pythonpath .venv/bin/python` on `config.py`, `worker.py`, `studio_profile.py`, `test_config.py`, `test_worker.py` in their managed source/test directories — zero errors. +- `pass`: `uv run --extra dev pre-commit run --files` on the five Python files and all eight changed documentation files — Ruff and hardcoded-secret detection passed. YAML hook `not_applicable` (no YAML changed). +- `pass`: paired language identifiers/relative links and `git diff --check`. Direct implementation review found no blockers: no reference lookup in the simulated new-account request, explicit override/immutability, filtered bindings/control URLs, safe secret refs and unchanged pending-token protection. AC-1 through AC-4 passed with simulated requests. +- `not_run`: live image pull/container startup and broad unrelated SDK regression. The isolated managed suite covers the affected contracts; no cloud resource was created for verification. `not_applicable`: frontend build/browser, generated assets and runtime process smoke (no chat/frontend/image code changes). Full all-files commit gates await a separately authorized commit. + +T-1 through T-4 are complete. No agreed implementation scope is deferred; live platform readiness remains an operational validation limit. Restart local Studio and retry the same agent that stopped before Worker intent creation. + +Startup-default follow-up: [2026-10-09-worker-image-defaults](2026-10-09-worker-image-defaults.md) supersedes the explicit built-in env choice in FR-1/AC-1. Initial verification above is historical evidence; all other contracts remain. diff --git a/prd-spec/bugfixes/mpa-worker-template/2026-10-09-independent-worker.zh.md b/prd-spec/bugfixes/mpa-worker-template/2026-10-09-independent-worker.zh.md new file mode 100644 index 000000000..eeb7a1382 --- /dev/null +++ b/prd-spec/bugfixes/mpa-worker-template/2026-10-09-independent-worker.zh.md @@ -0,0 +1,62 @@ +# 不依赖旧账号模板的 Worker 创建 + +[English](2026-10-09-independent-worker.md) + +- 变更 ID:`mpa-worker-template` +- 创建/修订:2026-10-09 +- 状态:implemented +- 契约:[Studio 创建](../../../specs/studio-mpa-creation/README.zh.md)、[Runtime 部署](../../../specs/mpa-runtime-provisioning/README.zh.md)。 + +## 背景与证据 + +Studio 内置 Worker 配置引用旧账号中的 Tool。新部署账号无法读取该 Tool:创建在 `get_reference_worker` 失败,尚未调用 `CreateTool`。Worker 镜像已显式配置。`worker.py` 只从引用模板复制环境设置;命令、资源、角色与网络由编排器生成。固定 Worker 源码版本 `81f3496` 的 `scripts/run.sh` 提供启动默认值,无需引用 Tool。 + +## 目标、非目标与场景 + +让新账号使用镜像和显式启动配置创建 Worker,同时兼容可选模板引用和已有 Worker。不修改镜像、IAM/网络、Runtime 聊天、前端,也不自动修改已有 Tool。镜像仓库访问仍是独立前置条件。 + +- 新 Studio 创建不读取旧模板,直接到达 `CreateTool`。 +- CLI 配置可以显式继承有权限访问的 Tool 环境,显式设置优先。 +- 显式引用不存在仍失败;结果不确定的创建重试保留原请求和 token。 + +## 需求与设计 + +- **FR-1:** 删除内置 `reference-id`。将不含密钥的 `PORT`、Worker 端口、headless/minimal 模式、workspace/data/runtime/sidecar 根目录及技能空间基础目录显式固定为该镜像的默认值。 +- **FR-2:** 新增可选 `managed.worker.env: dict[str, str]`,默认空。服务端解析完整 `${ENV_NAME}` 引用。拒绝非法大写环境变量名、智能体/Runtime/Tool/技能空间绑定、继承的渠道/Runtime 凭据以及控制库连接地址。`existing-id` 携带非空 env 时失败,避免静默忽略。 +- **FR-3:** 按已过滤模板环境、显式 env、生成的 `MPA_AGENT_ID` 顺序合并。不修改配置对象和模板响应。显式引用失败不回退为空环境。 +- **FR-4:** 保留排序请求哈希、ClientToken、归属校验、取消和有界重试。未完成请求的显式 env 改变时报告配置冲突。环境值不写入部署记录,也不出现在配置摘要、repr 或错误响应中。 + +已有镜像契约支持按会话传入模型凭据;Studio 不复制旧模型密钥。额外运维配置通过 Worker env 和服务端密钥引用提供。不新增依赖、云 API、权限、任务表结构或前端产物。新配置契约由 Studio 组件维护,Runtime 部署引用该契约。非托管旧创建逻辑不变。 + +## 任务与验收 + +| 需求 | 任务 | 验收 | +| --- | --- | --- | +| FR-1 | T-1:修改内置配置并补回归 | AC-1:新账号使用镜像创建时跳过模板读取,提交显式启动配置 | +| FR-2 | T-2:配置结构/解析及安全校验测试 | AC-2:密钥引用可解析;非法/保留字段及已有 Worker env 失败且不暴露值 | +| FR-3 | T-3:请求合并与兼容测试 | AC-3:显式值优先,智能体绑定由编排器生成,缺失显式模板仍失败 | +| FR-4 | T-4:重试/不可变测试及审查 | AC-4:相同请求重试 token 不变;修改 env 失败;注册记录/摘要/repr 不含环境值 | + +## 风险与恢复 + +默认值覆盖固定镜像;自定义镜像可能需要显式 env。不自动执行云创建冒烟。已有 Tool ID 仍是绑定依据,不重命名/更新。尚未写入 Worker 创建意图就失败的任务,可重启 Studio 后以同一智能体 ID 重试。已发出创建且哈希改变的任务必须保留原配置;禁止重置意图绕过防重复保护。 + +## 审查与验证记录 + +未提供 review-spec,直接审查通过了配置优先级、密钥处理、账号边界、部分失败、兼容性及双语一致性。2026-10-09 用户以“帮我改”批准移除固定旧模板并显式配置,在实现前记录。 + +验证范围:`ef0ad519` 加本次 Worker 修改及此前未提交的账号/IAM/网络/APIG 修复。必需命令:配置/Worker 定向测试、托管部署回归、修改文件 Ruff/Pyright、定向 pre-commit、双语/链接/空白检查。真实云创建:`not_run`;代码和模拟请求不能证明镜像拉取权限或平台就绪。浏览器/前端检查:`not_applicable`,无 UI/API 改动。执行后补充结果。 + +### 已执行检查(2026-10-09) + +- 实现前 `fail`:配置/Worker 回归复现固定旧模板和缺少 env 支持(5 failed、94 passed)。 +- `pass`:`uv run --extra dev pytest tests/integrations/mpa_managed/test_config.py tests/integrations/mpa_managed/test_worker.py tests/integrations/mpa_managed/test_worker_recovery.py tests/integrations/mpa_managed/test_worker_metadata.py -q --tb=short` — 152 passed。 +- `pass`:`uv run --extra dev pytest tests/integrations/mpa_managed tests/integrations/test_mpa_provision_env.py tests/integrations/test_mpa_runtime.py tests/cli/test_frontend_deploy_iam.py -q --tb=short` — 594 passed、5 条已有弃用警告;覆盖最终模板过滤及未完成 env 恢复。 +- `pass`:对 managed 源码/测试目录的 `config.py`、`worker.py`、`studio_profile.py`、`test_config.py`、`test_worker.py` 执行 `uvx --from ruff==0.11.12 ruff check` 和 `uvx pyright --pythonpath .venv/bin/python` — 零错误。 +- `pass`:对上述五个 Python 文件及八个修改文档执行 `uv run --extra dev pre-commit run --files` — Ruff 和硬编码密钥检测通过。YAML 钩子 `not_applicable`(未修改 YAML)。 +- `pass`:双语标识/相对链接及 `git diff --check`。直接实现审查无阻塞项:模拟新账号请求不读取模板、显式覆盖/不可变性、绑定/控制库地址过滤、安全密钥引用及未完成 token 保护。AC-1 至 AC-4 通过模拟请求验收。 +- `not_run`:真实镜像拉取/容器启动及全量无关 SDK 回归。隔离托管测试集覆盖受影响契约;验证没有创建云资源。`not_applicable`:前端构建/浏览器、生成产物及运行进程冒烟(未修改聊天/前端/镜像代码)。完整 all-files 提交检查等待另行授权提交。 + +T-1 至 T-4 完成,无已约定实现范围延期;真实平台就绪仍属于运维验证限制。重启本地 Studio,以同一智能体 ID 重试尚未生成 Worker 创建意图的任务。 + +启动默认值后续修订:[2026-10-09-worker-image-defaults](2026-10-09-worker-image-defaults.zh.md) 替代 FR-1/AC-1 中内置 env 显式注入的选择。上述初次验证为历史证据,其余契约保留。 diff --git a/prd-spec/bugfixes/mpa-worker-template/2026-10-09-worker-image-defaults.md b/prd-spec/bugfixes/mpa-worker-template/2026-10-09-worker-image-defaults.md new file mode 100644 index 000000000..c44cb2372 --- /dev/null +++ b/prd-spec/bugfixes/mpa-worker-template/2026-10-09-worker-image-defaults.md @@ -0,0 +1,42 @@ +# Use Worker image defaults without duplicate Tool environment + +[中文版](2026-10-09-worker-image-defaults.zh.md) + +- Change ID: `mpa-worker-image-defaults` +- Created/revised: 2026-10-09 +- Status: implemented +- Predecessor: [independent Worker creation](2026-10-09-independent-worker.md), amends its FR-1/AC-1 startup-setting choice only. +- Contracts: [Studio creation](../../../specs/studio-mpa-creation/README.md); Runtime provisioning consumes that contract unchanged. + +## Evidence, goals and scope + +The pinned Worker source `81f3496` Dockerfile defines PORT=8000, MPA_CODEX_WORKER_PORT=8092, headless/minimal mode and all five configured directory roots. scripts/run.sh also supplies these defaults and synchronizes PUBLIC_PORT from PORT. Duplicating the nine defaults in Tool Envs is unnecessary and overrides defaults when an operator selects another image. The control-plane Tool environment list is not the full container environment. + +Remove only the nine built-in Worker env entries. Keep optional managed.worker.env, reference/existing Worker support, fixed CreateTool.Port=8000 and generated MPA_AGENT_ID. Do not mutate existing Tools, chat, frontend, image versions, permissions or resource identity. Custom images must support the existing /opt/gem/run.sh entrypoint and public port 8000, or use explicit compatible configuration; removing duplication does not guarantee arbitrary image compatibility. + +## Requirements, scenarios and design + +- FR-1: Built-in Studio has empty Worker env and no reference ID. Its new CreateTool Envs contains only generated MPA_AGENT_ID; Port remains 8000. Container startup obtains its port/mode/path settings from the image. +- FR-2: Preserve explicit Worker env merging, validation, redaction and sorted hashing/ClientToken behavior. Existing bindings are not updated. A previously dispatched pending request with changed env still fails hash validation rather than creating a duplicate. +- AC-1: Built-in profile and simulated new-account creation tests prove no duplicate env keys/reference lookup, retain image/role/Port and bind MPA_AGENT_ID. +- AC-2: Existing config/Worker recovery regressions pass, including explicit env and changed-pending-payload rejection. + +No state/schema/API/permission/dependency changes. The Studio spec and bilingual guide describe image-owned defaults; no frontend assets are needed. + +## Tasks, review and verification + +- T-1 (FR-1/AC-1): failing built-in profile/request regressions, remove env block in studio_profile.py, update test_config.py/test_worker.py. +- T-2 (FR-2/AC-2): existing affected provisioning regression and Python gates; synchronize Studio spec/guide and predecessor note. + +User approved removal of all unnecessary defaults on 2026-10-09 with “没必要的就都去了”. Direct design review (review-spec unavailable) cleared bilingual equivalence, entrypoint/port boundary, explicit overrides and pending-intent safety before edits. No blocker or unanswered implementation decision. + +Verification scope: this follow-up on ef0ad519 plus prior uncommitted MPA fixes. Required: fail-first two targeted tests; managed/legacy provisioning and IAM suite; Ruff/Pyright on three changed Python files; scoped pre-commit and paired-language links/identifiers/whitespace. Live cloud startup is not_run (no new cloud writes authorized for verification); frontend/browser/generated assets and runtime process smoke are not_applicable (no changes to those paths). Full commit gates await an authorized commit. Results follow below. + +## Results (2026-10-09) + +- fail before implementation: two targeted tests failed on the duplicate defaults (97 deselected). +- pass: `uv run --extra dev pytest tests/integrations/mpa_managed tests/integrations/test_mpa_provision_env.py tests/integrations/test_mpa_runtime.py tests/cli/test_frontend_deploy_iam.py -q --tb=short` — 594 passed, five existing deprecation warnings. AC-1/AC-2 and T-1/T-2 completed with simulated requests. +- pass: `uvx --from ruff==0.11.12 ruff check` and `uvx pyright --pythonpath .venv/bin/python` on studio_profile.py, test_config.py and test_worker.py in their managed directories; zero errors. +- pass: `uv run --extra dev pre-commit run --files` on these three Python files and eight changed documentation files; Ruff/format/hardcoded-secret detection passed. YAML hook not_applicable, no YAML changes. +- pass: paired identifiers/relative links and `git diff --check`; direct implementation review confirms image defaults, generated agent binding and optional explicit env coexist without changing recovery protection. +- not_run: live cloud creation/container startup and unrelated full SDK regression; affected deployment suite passed. not_applicable: UI/build/browser/generated artifacts and runtime smoke. No cloud resources or existing Tools changed. Full commit gates await authorized commit. diff --git a/prd-spec/bugfixes/mpa-worker-template/2026-10-09-worker-image-defaults.zh.md b/prd-spec/bugfixes/mpa-worker-template/2026-10-09-worker-image-defaults.zh.md new file mode 100644 index 000000000..1db779beb --- /dev/null +++ b/prd-spec/bugfixes/mpa-worker-template/2026-10-09-worker-image-defaults.zh.md @@ -0,0 +1,42 @@ +# 使用 Worker 镜像默认值,移除重复 Tool 环境配置 + +[English](2026-10-09-worker-image-defaults.md) + +- 变更 ID:`mpa-worker-image-defaults` +- 创建/修订:2026-10-09 +- 状态:implemented +- 前序:[独立 Worker 创建](2026-10-09-independent-worker.zh.md),仅修订其 FR-1/AC-1 的启动设置选择。 +- 契约:[Studio 创建](../../../specs/studio-mpa-creation/README.zh.md);Runtime 部署继续引用该契约。 + +## 证据、目标与范围 + +固定 Worker 源码 `81f3496` 的 Dockerfile 定义 PORT=8000、MPA_CODEX_WORKER_PORT=8092、headless/minimal 模式及全部五个目录根路径。scripts/run.sh 同样提供这些默认值,并从 PORT 同步 PUBLIC_PORT。在 Tool Envs 中重复九项默认值没有必要,还会覆盖运维选择其他镜像时的默认设置。控制面的 Tool 环境列表不等于完整容器环境。 + +只移除内置 Worker env 中这九项。保留可选 managed.worker.env、模板引用/已有 Worker 支持、固定 CreateTool.Port=8000 及生成的 MPA_AGENT_ID。不修改已有 Tool、聊天、前端、镜像版本、权限或资源身份。自定义镜像必须支持已有 /opt/gem/run.sh 入口及对外端口 8000,或使用兼容的显式配置;去掉重复设置不代表任意镜像都兼容。 + +## 需求、场景与设计 + +- FR-1:内置 Studio Worker env 为空,reference ID 为空。新 CreateTool Envs 仅包含生成的 MPA_AGENT_ID;Port 仍为 8000。容器启动从镜像获得端口/模式/目录设置。 +- FR-2:保留显式 Worker env 合并、校验、脱敏及排序哈希/ClientToken 行为。不更新已有绑定。已发送而未完成的请求如 env 改变,仍拒绝哈希不一致,不重复创建。 +- AC-1:内置配置和模拟新账号创建测试证明不重复注入、不读取模板,保留镜像/角色/Port 并绑定 MPA_AGENT_ID。 +- AC-2:已有配置/Worker 恢复回归通过,包括显式 env 及未完成载荷改变时的拒绝。 + +不改变状态/表结构/API/权限/依赖。Studio 契约和双语指南说明默认值归镜像所有;无需前端产物。 + +## 任务、审查与验证 + +- T-1(FR-1/AC-1):先写失败的内置配置/请求回归,删除 studio_profile.py 的 env 块,更新 test_config.py/test_worker.py。 +- T-2(FR-2/AC-2):运行受影响部署回归及 Python 检查,同步 Studio 契约/指南及前序说明。 + +用户于 2026-10-09 以“没必要的就都去了”批准移除全部不必要默认配置。未提供 review-spec,编辑前直接审查通过双语一致性、入口/端口边界、显式覆盖及未完成意图保护。没有阻塞或未决实现选择。 + +验证范围:ef0ad519 加本次后续修改及此前未提交的 MPA 修复。必需:两项先失败的定向测试;托管/旧部署和 IAM 测试集;三个修改 Python 文件的 Ruff/Pyright;定向 pre-commit 与双语链接/标识/空白检查。真实云启动为 not_run(未授权为验证新增云写入);前端/浏览器/生成产物及运行进程冒烟为 not_applicable(未修改这些路径)。完整提交检查等待授权提交。结果见下文。 + +## 结果(2026-10-09) + +- 实现前 fail:两项定向测试因重复默认配置失败(97 deselected)。 +- pass:`uv run --extra dev pytest tests/integrations/mpa_managed tests/integrations/test_mpa_provision_env.py tests/integrations/test_mpa_runtime.py tests/cli/test_frontend_deploy_iam.py -q --tb=short` — 594 passed,五条已有弃用警告。AC-1/AC-2 及 T-1/T-2 已通过模拟请求完成。 +- pass:对 managed 目录内 studio_profile.py、test_config.py、test_worker.py 执行 `uvx --from ruff==0.11.12 ruff check` 和 `uvx pyright --pythonpath .venv/bin/python`,零错误。 +- pass:对三个 Python 文件及八个修改文档执行 `uv run --extra dev pre-commit run --files`,Ruff/格式/硬编码密钥检测通过。YAML 钩子为 not_applicable,未修改 YAML。 +- pass:双语标识/相对链接及 `git diff --check`;直接实现审查确认镜像默认值、生成的智能体绑定和可选显式 env 共存,恢复保护不变。 +- not_run:真实云创建/容器启动及无关全量 SDK 回归;受影响部署测试集通过。not_applicable:UI/构建/浏览器/生成产物及运行冒烟。未修改云资源或已有 Tool。完整提交检查等待授权提交。 diff --git a/prd-spec/features/mpa-runtime-iam/2026-10-09-managed-runtime-role.md b/prd-spec/features/mpa-runtime-iam/2026-10-09-managed-runtime-role.md new file mode 100644 index 000000000..c14793be6 --- /dev/null +++ b/prd-spec/features/mpa-runtime-iam/2026-10-09-managed-runtime-role.md @@ -0,0 +1,74 @@ +# Managed MPA runtime role + +[中文](2026-10-09-managed-runtime-role.zh.md) + +Change ID: `mpa-runtime-iam`; created/revised: 2026-10-09; status: implemented; isolated verification passed, live smoke unverified. +Contracts: [Studio creation](../../../specs/studio-mpa-creation/README.md), [provisioning](../../../specs/mpa-runtime-provisioning/README.md). + +## Background, goals and boundaries + +The built-in Studio profile references `IDRoleForArkClawShareAgent` for both Runtime and Worker but never prepares it. A new deployment account can therefore fail during cloud creation. Read-only inspection of the historical role confirmed trust in `vefaas` and `apig` and 12 system policies; historical test/IDrive policies are not copied. + +Prepare the approved role before other resource mutations. This does not make the entire Beijing profile portable: account assertions, images and Worker reference still require valid deployment configuration. General agents, legacy CLI defaults, custom roles, existing trust documents and policy bodies remain outside automatic mutation. No live IAM mutation, commit, push or deployment is authorized by design approval. + +## Scenarios and requirements + +- FR-1: Built-in Studio uses `managed.iam.mode: auto`; explicit managed profiles default to `existing` and skip IAM preparation. Auto mode accepts only the default Runtime/Worker role and a fresh template source; incompatible sources fail before IAM requests. +- FR-2: In the STS-verified deployment account, get or create the default role with unconditional `sts:AssumeRole` trust for `vefaas` and `apig`. Existing trust must contain both and no deny statements; never rewrite it. Validate returned role name and account TRN. +- FR-3: Add missing Global bindings for the 12 agreed system policies and versioned custom policy `VeADKMPARuntimeAccessV1`. Preserve extra bindings. The custom policy contains the 14 approved actions with resource `*`; a conflicting existing document fails without overwrite. +- FR-4: Explicit missing-object responses alone permit creation. Creation races reread after already-exists. Bounded polling handles visibility delay; timeout/cancellation retain resources for retry with the same agent ID. Requests use fresh verified credentials and isolated SDK instances with transport timeouts. +- FR-5: Emit stage `iam_role` and allowlisted errors for permissions, trust/policy conflicts, ownership and verification failure. Never expose raw SDK messages, documents or credentials. Failure stops before PG/network/Runtime preparation. +- FR-6: Add `iam:CreatePolicy` to the Studio execution policy; other necessary IAM actions already exist. Deployment credentials must be permitted to get/create role and policy, list bindings and attach policies. Configuration inspection performs no IAM calls. + +## Permission baseline + +System: `AgentKitSkillsSandboxAccess`, `AgentKitToolAccess`, `LLMShieldProtectSdkAccess`, `Mem0ReadOnlyAccess`, `AgentKitRuntimeAccess`, `AgentKitTosAccess`, `CloudControlReadOnlyAccess`, `TorchlightApiFullAccess`, `IDReadOnlyAccess`, `VikingdbFullAccess`, `APMPlusServerDataExportRolePolicy`, `AgentKitReadOnlyAccess`. + +Custom: `arkclaw:ListResources`, `arkclaw:GetMpaInstanceConf`, `apig:ListGateways`, `apig:GetGateway`, `apig:CreateGateway`, `apig:CreateIMChannelGateway`, `apig:GetIMChannelGatewayStatus`, `apig:CreateUpstream`, `apig:CreateRoute`, `agentkit:DeleteSession`, `agentkit:PauseSession`, `agentkit:ResumeSession`, `agentkit:SetSessionTtl`, `agentkit:CreateSessionSnapshot`. + +This is the user-approved compatibility baseline, not a claim of least privilege. ArkClaw actions are compatibility permissions. IAM resources are account-wide, independent of deployment region. + +## Design, tasks and affected files + +- T-1 (FR-1–6): Review this bilingual design and update both component contracts before implementation. +- T-2 (FR-1–4): Add failing isolated tests; implement `managed/iam.py` and configuration/profile integration. Additive reconciliation plus readback was chosen over cloning historical test policies or overwriting user trust. Poll for at most 120 seconds; each SDK request has 5-second connect/read timeouts. Cancellation stops new operations; an in-flight synchronous SDK call may finish within its transport limit. +- T-3 (FR-5–6): Integrate early in `managed/service.py`; map safe errors through `runner.py`/`tasks.py`; update diagnostics, bilingual UI resources and `frontend_deploy_policy.py`. +- T-4: Update bilingual managed usage docs, targeted Python and frontend tests; build release assets and verify browser behavior with isolated mock responses. + +No new persistent tables or public request fields are needed. Existing IAM state is the recovery record. Policy and role creation are idempotent by fixed names; same-account concurrent creation converges by readback. A cancellation does not roll back shared permissions. Unsupported trust shapes fail conservatively. + +## Acceptance and verification + +AC-1: New role creation binds all 12 system policies plus the custom policy and verifies readback. AC-2: Reuse, missing attachments, races and delayed visibility converge without removing extras. AC-3: Permission failures, wrong account, unsafe trust and policy conflicts fail before unrelated mutations and produce safe errors. AC-4: Existing-mode profiles and general agents retain their behavior. AC-5: UI renders the role stage/error in both languages; built assets match sources. + +Commands: `uv run --extra dev pytest tests/integrations/mpa_managed tests/cli/test_frontend_deploy_iam.py`; changed-file Ruff/Pyright; `npm --prefix frontend test`; `npm --prefix frontend run build`; `npm --prefix frontend run test:webui-assets`; `npm --prefix frontend run check:i18n`; regression `uv run --extra dev pytest -n 2 -m "not codex_smoke and not piagent_smoke"`. Live new-account IAM smoke is not_run unless separately authorized. Browser checks must not touch real IAM/user state. + +## Risks and review record + +System policies can be unavailable in an account or require product enablement; fail visibly and retry after administrator repair. Existing trust restrictions are not automatically widened. Broad baseline permissions are intentional and documented; no real cloud snapshot is checked in. Shared role changes affect consumers of that role. SDK singleton isolation and cancellation require regression coverage. + +Direct design review (review-spec unavailable): scope, additive semantics, bounded retries, credential rotation, no secret output, legacy compatibility, tests and bilingual equivalence reviewed; no unresolved design blockers. User approved the permission additions and implementation with “嗯,帮我改下,”. Approval precedes production/test edits. Existing `frontend/package-lock.json` changes belong to the user and are preserved. + +## Implementation review and verification results + +Tested scope: uncommitted `mpa-runtime-iam` feature on `feat/test-main`, base `ef0ad519`, 2026-10-09. T-1–4 and AC-1–5 are covered by isolated tests and browser checks; live new-account readiness remains unverified. + +Implementation review corrected the provider binding shape to `PolicyScope[].PolicyScopeType: Global` and the official creation collision code to `PolicyAlreadyExist`. `PolicyAttachConflict` requires readback, never assumed success. Sources: [official IAM errors](https://docs.volcengine.com/docs/IAM/ErrorCodeList?lang=en) and [official SDK binding structure](https://pkg.go.dev/github.com/volcengine/volcengine-go-sdk@v1.2.45/service/iam#AttachedPolicyMetadataForListAttachedRolePoliciesOutput). New regression fixtures first failed for missing implementation and subsequently for the real collision/conflict codes; corrected implementation passes. Permission errors never authorize creation. Singleton isolation, fresh credentials, timeout/cancellation, trust/account conflicts, project-only bindings, retries and safe child errors were reviewed. No new blockers remain in the feature scope. + +| Check | Outcome | Evidence / limits | +| --- | --- | --- | +| `uv run --extra dev pytest tests/integrations/mpa_managed tests/cli/test_frontend_deploy_iam.py -q` | pass | Final correction: 474 passed; no real cloud operations. | +| `uvx --from ruff==0.11.12 ruff check ` and format | pass | Version matches repository hook; temporary tool environment. | +| `uvx pyright --pythonpath .venv/bin/python ` | pass | 0 errors / warnings; repository interpreter. | +| `npm --prefix frontend test` | pass | 1,377 Node tests and 48 Vitest tests. | +| `npm --prefix frontend run build` | pass | TypeScript and both bundles built; existing chunk-size/deprecation warnings only. | +| `npm --prefix frontend run test:webui-assets` | pass | 113 packaged files, 350 references. Hash-renamed dependent chunks are generated assets. | +| `npm --prefix frontend run check:i18n` | pass | 2 locales, 21 namespaces consistent. | +| Isolated real Chrome browser (`node /tmp/mpa-iam-browser.cjs`) | pass | Chinese/English three-step flow, readonly ID, IAM error/stage, Enter-key same-ID retry, cancellation, 375px layout; all service responses mocked. Temporary fixture/server removed. First fixture load caused a Vite dependency optimization reload; warmed final runs passed without page errors. | +| `uv run --extra dev pytest -n 2 -m "not codex_smoke and not piagent_smoke"` | fail | Earlier iteration: 6,240 passed, 7 failed, 19 skipped, 2 xfailed, 2 collection errors. Six Harness failures lack `llama_index`; two self-host sandbox collection errors lack `anthropic`. One upload retry test captured other background-thread sleeps; isolated rerun passed (1 test). These paths have no feature diff. Final IAM race correction was validated with the 474-test affected suite rather than repeating dependency-blocked unrelated tests. | +| `uv run --extra dev pre-commit run --files ` | pass | Ruff/check/format and gitleaks hooks passed; YAML hook skipped (no YAML files). Full `--all-files` is not_run because no commit is requested. | +| `git diff --check`; bilingual links/identifiers/permission baseline | pass | Paired designs/contracts present, links resolve and identifiers align. | +| Live IAM / real new-account creation | not_run | Separate cloud mutation authorization and isolated account setup required. | +| Codex/PI smoke, sidecar coverage, IME/empty-flow changes | not_applicable | No runtime/sidecar/input/empty-state contracts changed. | + +Local environment lacked Ruff/Pyright; use of temporary tools is recorded here, not a machine-global configuration change. Existing package-lock modifications were preserved. No commit, push or deployment was performed. Existing hosted Studio execution policies need the added `iam:CreatePolicy` permission before this feature can prepare roles; updates are not deployed by this change. The built-in profile still asserts its configured account and uses configured image/reference resources; changing accounts requires updating those settings independently. diff --git a/prd-spec/features/mpa-runtime-iam/2026-10-09-managed-runtime-role.zh.md b/prd-spec/features/mpa-runtime-iam/2026-10-09-managed-runtime-role.zh.md new file mode 100644 index 000000000..d8ae210b4 --- /dev/null +++ b/prd-spec/features/mpa-runtime-iam/2026-10-09-managed-runtime-role.zh.md @@ -0,0 +1,74 @@ +# 自动准备 MPA 运行角色 + +[English](2026-10-09-managed-runtime-role.md) + +变更 ID:`mpa-runtime-iam`;创建/修订:2026-10-09;状态:已实现,隔离验证通过,真实 smoke 未验证。 +契约:[Studio 创建](../../../specs/studio-mpa-creation/README.zh.md)、[资源准备](../../../specs/mpa-runtime-provisioning/README.zh.md)。 + +## 背景、目标与边界 + +内置 Studio 配置为 Runtime 和 Worker 指定 `IDRoleForArkClawShareAgent`,但没有准备角色,新部署账号可能因此创建失败。历史角色的只读核对确认了 `vefaas`、`apig` 信任及 12 个系统策略;不复制历史测试/IDrive 策略。 + +在其他资源变更之前准备已批准角色。这不代表整个北京配置已支持任意账号:账号断言、镜像、Worker 参考模板仍须配置有效。通用智能体、旧 CLI 默认行为、自定义角色、已有信任文档和策略内容不属于自动改写范围。设计批准不授权真实 IAM 变更、提交、推送或部署。 + +## 场景与要求 + +- FR-1:内置 Studio 使用 `managed.iam.mode: auto`;显式 managed 配置默认 `existing`,跳过 IAM 准备。auto 只接受默认 Runtime/Worker 角色及全新模板来源;不兼容来源在 IAM 请求之前失败。 +- FR-2:在 STS 核验的部署账号下查询或创建默认角色,无条件信任 `vefaas` 和 `apig` 的 `sts:AssumeRole`。已有信任必须包含两者且没有拒绝语句;不重写。校验返回角色名及账号 TRN。 +- FR-3:补齐 12 个约定系统策略及版本化自定义策略 `VeADKMPARuntimeAccessV1` 的 Global 绑定,保留额外绑定。自定义策略包含 14 个已批准动作,资源为 `*`;已有内容冲突则失败,不覆盖。 +- FR-4:仅明确对象不存在响应允许创建;创建竞态的 already-exists 响应后重新读取。有限轮询处理可见性延迟;超时/取消保留资源,同一智能体 ID 可重试。每次请求使用新核验凭据、独立 SDK 实例和传输超时。 +- FR-5:输出阶段 `iam_role` 及权限、信任/策略冲突、属主、核验失败等白名单错误。禁止输出原始 SDK 文本、文档、凭据。失败后不准备 PG/网络/Runtime。 +- FR-6:Studio 执行策略增加 `iam:CreatePolicy`,其他所需 IAM 动作已存在。部署凭据须能查询/创建角色和策略、查询绑定、绑定策略。配置检查不调用 IAM。 + +## 权限基线 + +系统策略:`AgentKitSkillsSandboxAccess`、`AgentKitToolAccess`、`LLMShieldProtectSdkAccess`、`Mem0ReadOnlyAccess`、`AgentKitRuntimeAccess`、`AgentKitTosAccess`、`CloudControlReadOnlyAccess`、`TorchlightApiFullAccess`、`IDReadOnlyAccess`、`VikingdbFullAccess`、`APMPlusServerDataExportRolePolicy`、`AgentKitReadOnlyAccess`。 + +自定义动作:`arkclaw:ListResources`、`arkclaw:GetMpaInstanceConf`、`apig:ListGateways`、`apig:GetGateway`、`apig:CreateGateway`、`apig:CreateIMChannelGateway`、`apig:GetIMChannelGatewayStatus`、`apig:CreateUpstream`、`apig:CreateRoute`、`agentkit:DeleteSession`、`agentkit:PauseSession`、`agentkit:ResumeSession`、`agentkit:SetSessionTtl`、`agentkit:CreateSessionSnapshot`。 + +这是用户批准的兼容基线,不宣称最小权限。ArkClaw 动作为兼容权限。IAM 资源为账号级,不随部署地域隔离。 + +## 设计、任务及影响文件 + +- T-1(FR-1–6):实施前评审双语设计并更新两个组件契约。 +- T-2(FR-1–4):先添加隔离的失败测试;实现 `managed/iam.py` 及配置/profile 接入。采用增量补齐与回读,而非复制历史测试策略或覆盖用户信任。最多轮询 120 秒,每次 SDK 请求连接/读取超时各 5 秒。取消后停止新操作;进行中的同步 SDK 调用可能在传输时限内完成。 +- T-3(FR-5–6):在 `managed/service.py` 提前接入,通过 `runner.py`/`tasks.py` 传递安全错误,更新诊断、双语 UI 资源及 `frontend_deploy_policy.py`。 +- T-4:更新双语使用说明、针对性 Python/前端测试;构建发布资源,用隔离模拟响应验证浏览器。 + +不增加持久表或公开请求字段,已有 IAM 状态即恢复记录。固定名称保证角色/策略创建幂等;同账号并发创建通过回读收敛。取消不回滚共享权限。不支持的信任格式保守失败。 + +## 验收与验证 + +AC-1:新建角色绑定全部 12 个系统策略及自定义策略,回读核验。AC-2:复用、缺少绑定、竞态及延迟可见均可收敛,不移除额外绑定。AC-3:权限错误、账号错误、不安全信任及策略冲突在其他资源变更前失败,返回安全错误。AC-4:existing 配置及通用智能体保持原行为。AC-5:双语 UI 显示角色阶段/错误,构建资源与源码一致。 + +命令:`uv run --extra dev pytest tests/integrations/mpa_managed tests/cli/test_frontend_deploy_iam.py`;变更文件 Ruff/Pyright;`npm --prefix frontend test`;`npm --prefix frontend run build`;`npm --prefix frontend run test:webui-assets`;`npm --prefix frontend run check:i18n`;回归 `uv run --extra dev pytest -n 2 -m "not codex_smoke and not piagent_smoke"`。真实新账号 IAM smoke 在单独授权之前为 not_run。浏览器验证不触碰真实 IAM/用户状态。 + +## 风险与评审记录 + +某些系统策略可能在账号中不可用或需要开通产品;明确失败,管理员修复后重试。不自动放宽已有信任限制。广泛权限基线属有意选择并已记录,不提交真实云端快照。共享角色变更会影响使用该角色的其他服务。SDK 单例隔离和取消需要回归覆盖。 + +直接设计评审(review-spec 不可用):已检查范围、增量语义、有限重试、凭据刷新、不输出密钥、旧行为兼容、测试及双语等价,无未解决设计阻塞。用户已批准权限增加,并以“嗯,帮我改下,”授权实施,批准先于生产/测试修改。保留用户已有 `frontend/package-lock.json` 修改。 + +## 实施评审与验证结果 + +验证范围:`feat/test-main` 上未提交的 `mpa-runtime-iam` 功能,基线 `ef0ad519`,日期 2026-10-09。T-1–4、AC-1–5 已由隔离测试及浏览器检查覆盖,真实新账号就绪仍未验证。 + +实施评审修正了云端绑定格式 `PolicyScope[].PolicyScopeType: Global`,以及官方创建冲突码 `PolicyAlreadyExist`。`PolicyAttachConflict` 必须回读,不能视为已成功。来源:[官方 IAM 错误码](https://docs.volcengine.com/docs/IAM/ErrorCodeList?lang=en)、[官方 SDK 绑定结构](https://pkg.go.dev/github.com/volcengine/volcengine-go-sdk@v1.2.45/service/iam#AttachedPolicyMetadataForListAttachedRolePoliciesOutput)。新增测试先因未实现失败,随后因真实冲突码失败,修正实现后通过。权限错误不允许创建。已评审单例隔离、凭据刷新、超时/取消、信任/账号冲突、项目级绑定、重试和安全子进程错误。本功能范围内无剩余阻塞问题。 + +| 检查 | 结果 | 证据 / 限制 | +| --- | --- | --- | +| `uv run --extra dev pytest tests/integrations/mpa_managed tests/cli/test_frontend_deploy_iam.py -q` | pass | 最终修正后 474 项通过,不调用真实云端。 | +| `uvx --from ruff==0.11.12 ruff check ` 及 format | pass | 版本与仓库钩子一致,使用临时工具环境。 | +| `uvx pyright --pythonpath .venv/bin/python ` | pass | 0 错误 / 警告,使用仓库解释器。 | +| `npm --prefix frontend test` | pass | 1,377 项 Node 测试及 48 项 Vitest 测试。 | +| `npm --prefix frontend run build` | pass | TypeScript 及两个 bundle 构建成功,仅有已有体积/弃用警告。 | +| `npm --prefix frontend run test:webui-assets` | pass | 113 个文件,350 个引用。依赖 chunk 的哈希重命名属于生成资源。 | +| `npm --prefix frontend run check:i18n` | pass | 2 种语言、21 个命名空间一致。 | +| 隔离真实 Chrome 浏览器(`node /tmp/mpa-iam-browser.cjs`) | pass | 中英文三步流程、只读 ID、IAM 错误/阶段、Enter 键同 ID 重试、取消、375px 布局,全部服务响应为模拟。临时页面/服务已清理。测试页面首次加载触发 Vite 依赖优化重载;预热后的最终运行无页面错误。 | +| `uv run --extra dev pytest -n 2 -m "not codex_smoke and not piagent_smoke"` | fail | 较早实施版本:6,240 通过、7 失败、19 跳过、2 xfailed、2 收集错误。6 项 Harness 失败缺少 `llama_index`,2 项自托管沙箱收集错误缺少 `anthropic`。1 项上传重试测试收集到了其他后台线程的 sleep,单独重跑通过(1 项)。这些路径无本功能修改。最终 IAM 竞态修正通过 474 项相关测试验证,未重复受缺失依赖阻塞的无关测试。 | +| `uv run --extra dev pre-commit run --files ` | pass | Ruff/check/format 和 gitleaks 钩子通过,YAML 钩子跳过(无 YAML 文件)。未请求提交,完整 `--all-files` 为 not_run。 | +| `git diff --check`;双语链接/标识符/权限基线 | pass | 设计/契约成对存在,链接有效,标识符一致。 | +| 真实 IAM / 新账号创建 | not_run | 须单独授权云端变更并准备隔离账号。 | +| Codex/PI smoke、sidecar coverage、IME/空态变更 | not_applicable | 未修改运行时/sidecar/输入/空态契约。 | + +本地缺少 Ruff/Pyright,临时工具使用记录在这里,不修改机器全局配置。保留已有 package-lock 修改。未提交、推送或部署。已有云端 Studio 执行策略须增加 `iam:CreatePolicy` 后才能准备角色,本次不会部署该更新。内置配置仍断言配置账号并使用配置的镜像/参考资源,更换账号须独立调整这些设置。 diff --git a/specs/mpa-runtime-provisioning/README.md b/specs/mpa-runtime-provisioning/README.md index 7fb5f7eab..7cc745dea 100644 --- a/specs/mpa-runtime-provisioning/README.md +++ b/specs/mpa-runtime-provisioning/README.md @@ -2,7 +2,7 @@ - **Component ID:** `mpa-runtime-provisioning` - **Status:** Draft; proposed changes are governed by the related PRD -- **Revision:** 2026-09-30 +- **Revision:** 2026-10-09 - **Chinese version:** [README.zh.md](README.zh.md) - **Related PRD:** [MPA Runtime Integration Hardening](../../prd-spec/bugfixes/mpa-runtime-integration/2026-09-12-mpa-runtime-integration-hardening.md) - **Related PRD:** [MPA Studio Workload Identity Provisioning](../../prd-spec/features/mpa-studio-workload-identity/2026-09-20-mpa-studio-workload-identity.md) @@ -32,7 +32,7 @@ This component converts `veadk mpa create` inputs into one recoverable AgentKit - `CON-4`: Phase one writes placeholders before startup; phase two overwrites them only with non-empty authoritative Runtime values. A phase-two deployment failure is reported as failure, not partial success. - `CON-5`: Explicit caller `extra_env` remains last-wins, including an intentional override of VeADK profile defaults. - `CON-6`: AgentKit Runtime create and convergent update persist `veadk:agent-type=mpa` as the stable Studio classification tag. Untagged Runtime resources remain outside the MPA filter until an explicit tag repair is performed. -- `CON-7`: Before other provisioning mutations, both `veadk mpa create` and managed Studio provisioning create or reuse the account-and-region scoped pool `agentkit-studio-workload` and identity `{MPA_AGENT_ID}-studio`, then inject them as `MPA_WORKLOAD_POOL_NAME` and `MPA_WORKLOAD_IDENTITY_NAME`. Managed reference/template values cannot supply another agent's identity; empty explicit values are treated as unspecified and conflicting non-empty values fail before mutation. +- `CON-7`: After optional managed IAM preparation and before other provisioning mutations, both `veadk mpa create` and managed Studio provisioning create or reuse the account-and-region scoped pool `agentkit-studio-workload` and identity `{MPA_AGENT_ID}-studio`, then inject them as `MPA_WORKLOAD_POOL_NAME` and `MPA_WORKLOAD_IDENTITY_NAME`. Managed reference/template values cannot supply another agent's identity; empty explicit values are treated as unspecified and conflicting non-empty values fail before mutation. - `CON-8`: `veadk mpa create` continues to generate `mi-[0-9a-z]{12}` ids. Explicit ids accept that form and the existing Studio `mi-[0-9a-z]{24}` form for flat managed provisioning. The base id remains the Runtime and metadata identity; only the workload identity receives the `-studio` suffix. - `CON-9`: Workload get-or-create is exact-name idempotent. Concurrent create conflicts are followed by a read. Other Identity errors fail before Tool, database, or Runtime mutations. Created identity resources are retained for retry. @@ -120,3 +120,21 @@ Sessions and externally supplied Tools are not mutated. ## Persistent MCP signing secret Runtime provisioning injects `MCP_TOKEN_SECRET` before CreateRuntime/UpdateRuntime. A nonblank explicit value wins; otherwise the target Runtime's existing nonblank value is retained, or 32 random bytes are generated as 64 hex characters. Caller-owned environment mappings are unchanged. Endpoint/API Key finalization reuses the same value. Blank values count as missing. Explicit values are masked in dry-run output. The Runtime stores the key in environment configuration, and provisioning results do not expose it. Existing deployments change only on explicit redeployment. See the [secret provisioning design](../../prd-spec/bugfixes/mpa-runtime-mcp-secret/2026-10-07-persistent-mcp-secret.md) and the managed retry boundary in [Studio creation](../studio-mpa-creation/README.md). + +## Managed Runtime IAM role + +Built-in Studio sets `managed.iam.mode: auto`; explicit profiles default to `existing`. Auto preparation runs after STS account validation and before workload identity or other resource mutations. Only a fresh default `IDRoleForArkClawShareAgent` configuration is supported. IAM is account-scoped. Get/create role and `VeADKMPARuntimeAccessV1`, validate account/name and unconditional trust in `vefaas` and `apig`, add missing Global bindings for the approved 12 system policies and 14 custom actions, then verify readback. Preserve extra bindings; never overwrite trust or an existing policy. Missing-object codes alone allow creation; races and eventual consistency use bounded 120-second recovery. Cancellation retains resources. Permission/trust/policy/ownership/readback failures halt creation at `iam_role` with allowlisted localized errors; raw provider text and secrets are excluded. Studio execution credentials require GetRole, CreateRole, GetPolicy, CreatePolicy, ListAttachedRolePolicies and AttachRolePolicy. Existing-mode CLI and general agents are unaffected. Full permission list and acceptance: [design](../../prd-spec/features/mpa-runtime-iam/2026-10-09-managed-runtime-role.md). + +## Fresh managed account metadata + +Fresh managed templates generate `CLAW_SPACE_ID` from verified STS identity and `RUNTIME_IAM_ROLE_NAME`/`RUNTIME_IAM_ROLE_TRN` from that account and selected Runtime role. Explicit environment overrides retain precedence. Referenced/template Runtime behavior is unchanged. Built-in Studio removes the old fixed expected account; explicit YAML restrictions remain. Source images/reference Tools require separate access verification. See [Studio account contract](../studio-mpa-creation/README.md#studio-deployment-account). + +Managed VPC/subnet descriptions, legacy ownership compatibility and rejected-intent recovery follow the [Studio network contract](../studio-mpa-creation/README.md#network-ownership-descriptions-and-recovery). Names, account/region scope and uncertain-outcome duplicate prevention remain unchanged. + +Empty managed network discovery follows the [Studio contract](../studio-mpa-creation/README.md#empty-network-discovery); it does not alter Runtime payloads, account scope or ownership checks. + +New shared standard gateways and cross-zone companion intents follow the [Studio gateway preparation contract](../studio-mpa-creation/README.md#standard-shared-gateway-preparation). Existing Runtime subnet selections are immutable; new Runtime creation may use the prepared gateway selection. + +Worker environment configuration and reference precedence follow the [Studio contract](../studio-mpa-creation/README.md#independent-worker-configuration). Built-in Studio does not require an old-account Tool. Explicit CLI references/existing IDs remain supported; legacy non-managed creation is unchanged. + +Managed Runtime subnet equality and stable retry ordering follow the [Studio network recovery contract](../studio-mpa-creation/README.md#runtime-subnet-ordering-and-recovery). diff --git a/specs/mpa-runtime-provisioning/README.zh.md b/specs/mpa-runtime-provisioning/README.zh.md index eb85f2e7c..886f4a5de 100644 --- a/specs/mpa-runtime-provisioning/README.zh.md +++ b/specs/mpa-runtime-provisioning/README.zh.md @@ -2,7 +2,7 @@ - **Component ID:** `mpa-runtime-provisioning` - **状态:** 草案;提议变更由关联 PRD 管理 -- **修订日期:** 2026-09-30 +- **修订日期:** 2026-10-09 - **English version:** [README.md](README.md) - **关联 PRD:** [MPA Runtime 集成加固](../../prd-spec/bugfixes/mpa-runtime-integration/2026-09-12-mpa-runtime-integration-hardening.zh.md) - **关联 PRD:** [MPA Studio 工作负载身份创建](../../prd-spec/features/mpa-studio-workload-identity/2026-09-20-mpa-studio-workload-identity.zh.md) @@ -32,7 +32,7 @@ - `CON-4`:第一阶段在启动前写入占位符;第二阶段只使用非空权威 Runtime 值覆盖。第二阶段部署失败必须报告失败,不得报告部分成功。 - `CON-5`:调用方显式提供的 `extra_env` 继续保持 last-wins,包括有意覆盖 VeADK 配置默认值。 - `CON-6`:AgentKit Runtime 创建及收敛更新必须持久化 `veadk:agent-type=mpa`,作为 Studio 稳定分类标签。未打标签 Runtime 在执行显式标签修复前不进入 MPA 筛选。 -- `CON-7`:在其他创建副作用之前,`veadk mpa create` 与 Studio 托管创建都会创建或复用账号和地域范围内的 `agentkit-studio-workload` Pool 与 `{MPA_AGENT_ID}-studio` Identity,然后以 `MPA_WORKLOAD_POOL_NAME` 和 `MPA_WORKLOAD_IDENTITY_NAME` 注入 Runtime。托管参考 Runtime 或模板不得提供其他 Agent 的 Identity;显式空值视为未配置,冲突的非空值在资源修改前失败。 +- `CON-7`:在可选的托管 IAM 准备之后、其他创建副作用之前,`veadk mpa create` 与 Studio 托管创建都会创建或复用账号和地域范围内的 `agentkit-studio-workload` Pool 与 `{MPA_AGENT_ID}-studio` Identity,然后以 `MPA_WORKLOAD_POOL_NAME` 和 `MPA_WORKLOAD_IDENTITY_NAME` 注入 Runtime。托管参考 Runtime 或模板不得提供其他 Agent 的 Identity;显式空值视为未配置,冲突的非空值在资源修改前失败。 - `CON-8`:`veadk mpa create` 继续自动生成 `mi-[0-9a-z]{12}` ID。显式 ID 接受该格式及 Studio 原有的 `mi-[0-9a-z]{24}` 格式,以兼容托管平铺创建。基础 ID 仍作为 Runtime 和元数据身份,只有 WorkloadIdentity 增加 `-studio` 后缀。 - `CON-9`:工作负载资源按精确名称幂等 get-or-create。并发创建冲突后重新读取;其他 Identity 错误在 Tool、数据库或 Runtime 修改前失败。已创建的身份资源保留供重试。 @@ -110,3 +110,21 @@ stdin 在内存中传递,不得进入 sessionStorage、任务 SQLite 或任务 ## 固定 MCP 签名密钥 Runtime 创建在 CreateRuntime/UpdateRuntime 前注入 `MCP_TOKEN_SECRET`。显式非空值优先;否则保留目标 Runtime 已有非空值,或生成 32 随机字节并编码为 64 位十六进制字符串。不修改调用方的环境变量字典。地址/API Key 回填沿用同一值。空白值视为未配置。dry-run 输出对显式值脱敏。Runtime 将密钥保存于环境变量配置,创建返回值不暴露密钥。存量部署仅在显式重新部署时变更。参见[密钥创建设计](../../prd-spec/bugfixes/mpa-runtime-mcp-secret/2026-10-07-persistent-mcp-secret.zh.md)及 [Studio 创建](../studio-mpa-creation/README.zh.md)的托管重试边界。 + +## 自动准备 Runtime IAM 角色 + +内置 Studio 使用 `managed.iam.mode: auto`,显式配置默认 `existing`。自动准备在 STS 账号核验后、工作负载身份和其他资源变更前执行。仅支持全新来源的默认 `IDRoleForArkClawShareAgent` 配置。IAM 为账号级。查询/创建角色及 `VeADKMPARuntimeAccessV1`,核验账号/名称及无条件信任 `vefaas`、`apig`,补齐已批准的 12 个系统策略和 14 个自定义动作的 Global 绑定,随后回读核验。保留额外绑定,不覆盖信任或已有策略。仅明确不存在错误允许创建,竞态和最终一致性采用最多 120 秒的恢复。取消保留资源。权限/信任/策略/属主/回读失败在 `iam_role` 阶段停止,输出白名单本地化错误,不输出原始云端文本和密钥。Studio 执行凭据须允许 GetRole、CreateRole、GetPolicy、CreatePolicy、ListAttachedRolePolicies、AttachRolePolicy。existing CLI 及通用智能体不受影响。完整权限及验收见[设计](../../prd-spec/features/mpa-runtime-iam/2026-10-09-managed-runtime-role.zh.md)。 + +## 新建托管账号元数据 + +新建托管模板根据核验的 STS 身份生成 `CLAW_SPACE_ID`,并由该账号和所选 Runtime 角色生成 `RUNTIME_IAM_ROLE_NAME`/`RUNTIME_IAM_ROLE_TRN`。显式环境变量覆盖保持优先。引用/模板 Runtime 行为不变。内置 Studio 移除旧的固定预期账号;显式 YAML 限制保留。源镜像/参考 Tool 的访问需要单独核验。见 [Studio 账号契约](../studio-mpa-creation/README.zh.md#studio-部署账号)。 + +托管 VPC/子网描述、旧归属标记兼容及拒绝意图恢复遵守 [Studio 网络契约](../studio-mpa-creation/README.zh.md#网络归属描述与恢复)。名称、账号/地域范围及结果不确定时避免重复创建的规则不变。 + +托管网络空查询遵循 [Studio 契约](../studio-mpa-creation/README.zh.md#空网络查询),不改变 Runtime 载荷、账号范围或归属校验。 + +新共享标准型网关及跨可用区伴随意图遵循 [Studio 网关准备契约](../studio-mpa-creation/README.zh.md#标准型共享网关准备)。已有 Runtime 子网选择不可变,新 Runtime 创建可使用准备好的网关选择。 + +Worker 环境配置及模板优先级遵循 [Studio 契约](../studio-mpa-creation/README.zh.md#独立-worker-配置)。内置 Studio 不依赖旧账号 Tool。保留显式 CLI 模板/已有 ID;非托管旧创建逻辑不变。 + +托管 Runtime 的子网等价判断和稳定重试顺序遵循 [Studio 网络恢复契约](../studio-mpa-creation/README.zh.md#runtime-子网顺序与恢复)。 diff --git a/specs/studio-mpa-creation/README.md b/specs/studio-mpa-creation/README.md index 7f8ae1ef6..5ad9b4d1a 100644 --- a/specs/studio-mpa-creation/README.md +++ b/specs/studio-mpa-creation/README.md @@ -13,7 +13,7 @@ ## Responsibility and boundaries -VeADK owns managed YAML parsing, cloud/database orchestration, authorized durable creation tasks and the MPA directory dialog. No external source checkout is required. Shared registry/bootstrap contracts remain interoperable with the MPA image. Legacy `veadk mpa create` remains separate and unchanged. No model execution, channel routing, PostgreSQL instance provisioning or IAM policy management is added. +VeADK owns managed YAML parsing, cloud/database orchestration, authorized durable creation tasks and the MPA directory dialog. No external source checkout is required. Shared registry/bootstrap contracts remain interoperable with the MPA image. Legacy `veadk mpa create` remains separate and unchanged. Model execution and channel routing remain Runtime responsibilities. Managed runtime IAM preparation follows the contract below. ## Contracts @@ -21,7 +21,7 @@ VeADK owns managed YAML parsing, cloud/database orchestration, authorized durabl - **CON-16 — Studio MPA provenance tags:** Both the generic Studio MPA deployment path and managed one-click creation write `veadk:agent-type=mpa`, `veadk:managed=true`, `veadk:provisioner=studio-mpa`, trusted `veadk:owner`, and the owned `veadk:mpa-instance-id`. Missing trusted owner fails before cloud mutation, and the raw owner must hash to the task owner before child startup. The one-click route hashes this owner for local task and native registry ownership while passing the raw trusted owner ephemerally to the fixed child process for the Runtime tag; it is not persisted in task state. The shared provisioning service emits Studio provenance only when that route explicitly supplies the trusted Runtime owner, so `veadk mpa create` remains outside Studio discovery. Reconciliation replaces these owned keys, preserves unrelated non-system tags, and never replays `sys:*` tags. A legacy pending create with a persisted pre-provenance request hash replays the exact old create payload and client token, then applies the current provenance tags through the normal Runtime update before completing. Shared constants live in an internal MPA tag module and do not add a public Python API. Tags are discovery metadata, not authorization. Existing managed one-click Runtimes without `veadk:managed=true` require an explicit supported update/retry or future backfill before Studio lists them. Implemented and locally verified on 2026-09-29 by [Studio-created MPA Runtime filtering](../../prd-spec/features/studio-mpa-source-filter/2026-09-28-studio-mpa-source-filter.md); real-browser discovery remains a separate local acceptance step. -- **CON-1 — configuration:** Studio uses a code-owned Beijing profile and ignores `VEADK_MPA_CREATE_CONFIG`; its account and Runtime defaults come from the former private file; image defaults are specified below; VPC/subnet/APIG IDs are not pinned. After automatic PG preparation, Studio resolves shared resources from `mpa_admin_workspace/mpa_admin_db` by verified account and region: validate/reuse registered resources, or create and persist missing VPC/subnet and APIG/IM Gateway through the existing locked provisioners. Existing records are never reset to bypass quotas. Explicit CLI adoption remains supported. See the [registry-owned network fix](../../prd-spec/bugfixes/mpa-shared-network-bootstrap/2026-09-28-registry-owned-network.md). `VEADK_MPA_CONFIG_MODEL_AGENT_API_KEY` and deployment credentials remain server-side requirements, never source literals. The child receives a built-in-profile marker and validates the same profile. CLI `--config` still accepts private YAML with `managed.version: 1`, kebab/snake aliases and unknown-key rejection. CLI `from-runtime` and `template-file` remain mutually exclusive; otherwise flat image/model/PG fields supply the template. CLI `database-admin-url-env` and `shared-database-url-env` resolve PostgreSQL URLs server-side; files/templates are limited to 256 KiB. HTTP clients cannot choose paths, commands, accounts or deployment/PG credentials; CON-11 allows a per-creation OpenViking API Key. Configuration checks are local; they do not prove live access. See [built-in profile design](../../prd-spec/features/mpa-agent-oneclick-provision/2026-09-23-studio-builtin-mpa-profile.md). +- **CON-1 — configuration:** Studio uses a code-owned Beijing profile and ignores `VEADK_MPA_CREATE_CONFIG`; its non-account Runtime settings retain the former private defaults; Studio image defaults use the two latest references in CON-9; the deployment account comes from verified STS identity; VPC/subnet/APIG IDs are not pinned. After automatic PG preparation, Studio resolves shared resources from `mpa_admin_workspace/mpa_admin_db` by verified account and region: validate/reuse registered resources, or create and persist missing VPC/subnet and APIG/IM Gateway through the existing locked provisioners. Existing records are never reset to bypass quotas. Explicit CLI adoption remains supported. See the [registry-owned network fix](../../prd-spec/bugfixes/mpa-shared-network-bootstrap/2026-09-28-registry-owned-network.md). `VEADK_MPA_CONFIG_MODEL_AGENT_API_KEY` and deployment credentials remain server-side requirements, never source literals. The child receives a built-in-profile marker and validates the same profile. CLI `--config` still accepts private YAML with `managed.version: 1`, kebab/snake aliases and unknown-key rejection. CLI `from-runtime` and `template-file` remain mutually exclusive; otherwise flat image/model/PG fields supply the template. CLI `database-admin-url-env` and `shared-database-url-env` resolve PostgreSQL URLs server-side; files/templates are limited to 256 KiB. HTTP clients cannot choose paths, commands, accounts or deployment/PG credentials; CON-11 allows a per-creation OpenViking API Key. Configuration checks are local; they do not prove live access. See [built-in profile design](../../prd-spec/features/mpa-agent-oneclick-provision/2026-09-23-studio-builtin-mpa-profile.md). - **CON-2 — preparation:** Operators supply PostgreSQL instance/registry/login/owner, IAM roles, images, model access and network connectivity. Verify cloud account and database permissions before preparing account VPC/subnet, APIG/IM Gateway, worker, isolated business database, Skill Space and Runtime. Explicit APIG adoption requires a configured matching VPC. Never assume a newly created VPC reaches private PostgreSQL. Release account locks before waiting for application readiness. - **CON-3 — identity:** Durable identity is verified account + region + stable agent ID. Native ownership markers, hashes, client tokens and session advisory locks govern reuse. Reject unrelated same-name resources and conflicting unfinished configuration. Persist `studio_owner` in the native deployment record; other owners and preexisting records without this owner cannot take over implicitly. CLI uses owner `cli`; Studio uses the hash of its authorized principal. - **CON-4 — initialization:** Use real Runtime metadata and shared APIG bootstrap, not legacy placeholder endpoint seeding. Require public/private networking, KeyAuth, MPA tags, bound worker/Skill Space and metadata/IM startup. Reference Runtime templates remove source identity, channel credentials, Skill Space and worker identity. Success requires platform Ready and application `/readiness`. @@ -29,7 +29,7 @@ VeADK owns managed YAML parsing, cloud/database orchestration, authorized durabl - **CON-6 — lifecycle:** States are `running`, `cancelling`, `succeeded`, `failed`, `cancelled`. Start/resume enters `running`; explicit cancellation enters `cancelling`, then `cancelled`; timeout/failure enters `failed`. Successful tasks do not rerun. Stages are `queued`, `checking`, `network`, `gateway`, `worker`, `database`, `skills`, `deploying`, `verifying`; stage is the last observed progress, not a second state machine. Dead supervisors are reconciled on task lookup/start. Recovery retains the original request and agent ID. - **CON-7 — cancellation:** Run a fixed child module using the current VeADK interpreter. Cancel, deadline or server shutdown terminates the child, waits up to 3 seconds, then kills/reaps it before reporting terminal state. Default deadline is 1800 seconds (60–7200). Persistent cloud resources are retained, including unknown in-flight outcomes. Cancellation is not rollback; retry uses registered intent/token. This flow creates no temporary debugging Runtime to delete. - **CON-8 — data/security:** Built-in Studio uses `/tmp/veadk-studio/mpa-creation.sqlite3` (server override `VEADK_MPA_TASK_DB`) to persist hashed owner, nonsecret input, state/stage, safe results and supervisor PID, with mode 0600. This is an explicitly temporary, instance-local workaround for read-only cloud code directories: restart may lose history and multiple instances must not rely on shared task limits or locks. Standalone callers retain the `.adk/mpa-creation.sqlite3` convention when they construct the service explicitly. Connections close after each operation. No automatic history expiration. Native PostgreSQL tables remain `mpa_account_network`, `mpa_account_apig`, `mpa_agent_deployment`; require direct/session pooling. STS files are reread; Runtime/network/APIG/worker share account-verified credentials. Protocol messages are bounded to 16 KiB and allowlisted. Never forward raw child output, SDK errors, environment dumps, database URLs or Runtime keys. See the [temporary writable-state fix](../../prd-spec/bugfixes/studio-mpa-writable-state/2026-09-23-use-temporary-state.md). -- **CON-9 — UI:** The MPA filter on Volcengine shows a create card with agent-management permission, including empty lists. The dialog displays fixed region, required Runtime name, description and resource plan; agent ID and image fields are hidden. Three steps cover basics, automatic PostgreSQL preparation and OpenViking; only step three submits. Persist request identity before POST; lock submitted inputs to make lost-response retry safe. Abort polling on unmount, ignore late responses, preserve server work and recover from session storage on reopen. A confirmed failed or cancelled task offers both same-ID retry and an explicit new-agent action. The latter replaces only the browser draft with a fresh request UUID, blank name and defaults; the server derives the agent ID on submission; it does not delete or mutate the old server task or resources. Running and uncertain-submission states cannot start a different identity from this dialog. Refresh the original region after success. Reuse localized BaseUI/Studio components, keyboard/IME behavior and semantic theme tokens. `ModalLayout.footer` is an optional React node: omitted preserves existing actions, `null` omits the footer; existing callers are unchanged. See [terminal-task new-agent fix](../../prd-spec/bugfixes/studio-mpa-creation/2026-09-24-start-another-agent-after-failure.md). +- **CON-9 — UI:** The MPA filter on Volcengine shows a create card with agent-management permission, including empty lists. The dialog displays fixed region, required Runtime name, description and resource plan; agent ID is server-generated; MPA/Worker image inputs are omitted, as on main; the server uses main’s local latest defaults. Three steps cover basics, automatic PostgreSQL preparation and OpenViking; only step three submits. Persist request identity before POST; lock submitted inputs to make lost-response retry safe. Abort polling on unmount, ignore late responses, preserve server work and recover from session storage on reopen. A confirmed failed or cancelled task offers both same-ID retry and an explicit new-agent action. The latter replaces only the browser draft with a fresh request UUID, blank name and defaults; the server derives the agent ID on submission; it does not delete or mutate the old server task or resources. Running and uncertain-submission states cannot start a different identity from this dialog. Refresh the original region after success. Reuse localized BaseUI/Studio components, keyboard/IME behavior and semantic theme tokens. `ModalLayout.footer` is an optional React node: omitted preserves existing actions, `null` omits the footer; existing callers are unchanged. See [terminal-task new-agent fix](../../prd-spec/bugfixes/studio-mpa-creation/2026-09-24-start-another-agent-after-failure.md). Invalid Runtime names use a danger-colored border and error text with an accessible alert; the input offers a localized valid-name example. The shared Button primitive visibly dims native disabled buttons and uses a not-allowed cursor, while retaining its loading treatment. Correcting the name restores forward navigation. @@ -44,7 +44,7 @@ New Studio forms submit `name`, `requestId`, `description` and `region` plus the The built-in Studio defaults become `agentkit-platform-2112682748-cn-beijing.cr.volces.com/mpa/mpa_agent:latest` and `agentkit-platform-2112682748-cn-beijing.cr.volces.com/mpa/mpa_codex_worker:latest`. New drafts do not recover hidden old image overrides; submitted drafts/tasks retain their original inputs and image selections. Legacy API requests with explicit `agentId` and optional image fields remain supported, and requests without Name retain ID-based Runtime naming. CLI/YAML overrides remain unchanged. The dialog displays Name and Description without ID/image inputs; invalid names block forward navigation and submission. Existing task authorization, cancellation, concurrency, secret handling and error status semantics remain in force. -Verification maps to route/task/runner/service/runtime/profile tests and dialog/browser tests in the linked design. Cloud creation remains separately verified; a mutable `latest` tag does not update running agents. +Verification maps to route/task/runner/service/runtime/profile tests and dialog/browser tests in the linked design. Cloud creation remains separately verified; new image defaults do not update running agents. CON-9 navigation correction (2026-09-30): step headings are keyboard-accessible buttons. Earlier steps and Previous remain available after restoring a submitted @@ -131,8 +131,44 @@ Managed creation translates `sslmode` to the asyncpg `ssl` query parameter in th ### Managed sandbox template naming (CON-3) -New managed sandbox templates use the trimmed agent ID with every `-` replaced by `_` (for example, `mi-example` → `mi_example`). Existing worker IDs remain authoritative and are never renamed. A pre-change unfinished creation intent retains its hashed name only when the complete legacy request matches the persisted worker_hash; its ClientToken is preserved. Other payload changes and unrelated same-name resources remain errors. Scoped ownership tags and Runtime ToolId bindings are unchanged. +New named Studio requests use the entered, validated Runtime name unchanged as the sandbox template Name (4–64 ASCII letters, digits, hyphens or underscores). Legacy CLI requests without a name still use the trimmed agent ID with `-` replaced by `_`. Internal agent IDs, database/Skill Space/channel identities, scoped ownership tags and Runtime ToolId bindings are unchanged. Existing worker IDs are authoritative and are never renamed. New pending intents persist `worker_name` in deployment JSON and reject later name changes. Older pending intents without that field replay a normalized-ID or hashed name only when the complete candidate payload matches the persisted worker_hash, preserving ClientToken. Other payload changes and unrelated same-name resources remain errors. See [named Worker design](../../prd-spec/bugfixes/mpa-worker-naming/2026-10-09-runtime-named-worker.md). ## Managed MCP signing secret Every managed MPA Runtime receives `MCP_TOKEN_SECRET`. Explicit nonblank template environment values take precedence over the target Runtime's value, which takes precedence over the agent-owned PostgreSQL `mpa_deployment_settings` entry `mcp_token_secret`. If all are absent, generate 32 random bytes as 64 hex characters and persist before cloud creation. Atomic insert-or-retain keeps uncertain-create retries stable. Reconcile an explicit/current value only after validating the pending request hash, so rejected changed retries cannot corrupt the original request. Database failures stop creation and dispose connections. Reference Runtime templates exclude the source Agent's key; explicit JSON templates may configure one. Finalization retains the key; normal results and the shared nonsecret deployment registry exclude it. No frontend fields or automatic existing-deployment migration are added. See the [bilingual design](../../prd-spec/bugfixes/mpa-runtime-mcp-secret/2026-10-07-persistent-mcp-secret.md). + +## Managed Runtime IAM role + +Built-in Studio sets `managed.iam.mode: auto`; explicit profiles default to `existing`. Auto preparation runs after STS account validation and before workload identity or other resource mutations. Only a fresh default `IDRoleForArkClawShareAgent` configuration is supported. IAM is account-scoped. Get/create role and `VeADKMPARuntimeAccessV1`, validate account/name and unconditional trust in `vefaas` and `apig`, add missing Global bindings for the approved 12 system policies and 14 custom actions, then verify readback. Preserve extra bindings; never overwrite trust or an existing policy. Missing-object codes alone allow creation; races and eventual consistency use bounded 120-second recovery. Cancellation retains resources. Permission/trust/policy/ownership/readback failures halt creation at `iam_role` with allowlisted localized errors; raw provider text and secrets are excluded. Studio execution credentials require GetRole, CreateRole, GetPolicy, CreatePolicy, ListAttachedRolePolicies and AttachRolePolicy. Existing-mode CLI and general agents are unaffected. Full permission list and acceptance: [design](../../prd-spec/features/mpa-runtime-iam/2026-10-09-managed-runtime-role.md). + +## Studio deployment account + +The built-in profile has no fixed expected account. Use nonempty deployment STS identity for account-scoped IAM, PG, VPC, APIG and Runtime ownership. Fresh Runtime `CLAW_SPACE_ID` and `RUNTIME_IAM_ROLE_TRN` derive from that account and selected role; explicit caller environment overrides remain authoritative. Explicit YAML expected-account checks and credential-change checks remain in force. Image registry addresses and Worker reference IDs remain source resources with independent access requirements. See [design](../../prd-spec/bugfixes/mpa-studio-account/2026-10-09-sts-account.md). + +## Network ownership descriptions and recovery + +New VPC/subnet descriptions use `mpa-account-network-v1-`. Accept only exact scoped legacy `mpa-account-network:v1:` or current markers when recovering/validating managed resources, without rewriting existing resources. A legacy description-only intent is corrected with a new ClientToken only if its dispatch flag is explicitly false, no resource ID exists and name discovery finds no resource; all other fields must match. Unknown outcomes never issue another Create without successful discovery. Existing locks and persist-before-dispatch semantics remain authoritative. See [design](../../prd-spec/bugfixes/mpa-network-description/2026-10-09-valid-network-marker.md). + +## Empty network discovery + +As defined by the [implemented correction](../../prd-spec/bugfixes/mpa-network-discovery/2026-10-09-empty-network-results.md): the first DescribeVpcs/DescribeSubnets page with a null/absent collection and integer `total_count=0` is empty. Other non-list collections, missing/noninteger/nonzero counts with null collections and later null pages remain invalid. SDK/provider failures never become empty discovery. Recorded managed VPCs may then prepare their first subnet without replacing the VPC. Pagination, ownership, durable intents and uncertain-outcome duplicate protection are unchanged. + +## Standard shared gateway preparation + +Defined by the [implemented standard-gateway correction](../../prd-spec/bugfixes/mpa-standard-gateway/2026-10-09-standard-shared-gateway.md): new managed APIG uses standard, two 1c2g nodes, small_1 CLB, public/private access and traffic billing. Before a new gateway is created, prepare two same-VPC subnets in distinct APIG-supported zones under the shared lock. Optional gateway_subnet_intents persist each companion request/token/dispatch state; uncertain creates require discovery. Existing gateway adoption/reuse and existing Runtime network payloads are preserved. ExceededQuota explicitly permits another dispatch after correction; old unknown flags still require audited recovery. Deployment credentials additionally require apig:GetGatewayAvailableZones. No frontend fields or Runtime role changes. + +## Independent Worker configuration + +Built-in Studio creates a Worker from its image defaults without a reference Tool or duplicate startup environment. CreateTool.Port stays 8000 and its default Envs contains only generated MPA_AGENT_ID. See the [image-default correction](../../prd-spec/bugfixes/mpa-worker-template/2026-10-09-worker-image-defaults.md). Optional `managed.worker.env` is a string mapping; whole `${ENV_NAME}` values resolve server-side. Uppercase keys are required. Agent/Runtime/Tool/Skill Space bindings, inherited channel/Runtime secrets and control database URLs are reserved. Nonempty env with existing-id is invalid. Explicit env overrides a filtered optional reference environment, then the provisioner generates MPA_AGENT_ID. Explicit missing references remain errors. Environment values stay out of config summaries/repr and deployment records. Existing ownership, deadline, cancellation and request hash/ClientToken protections remain; changed pending inputs are conflicts. See [approved design and verification](../../prd-spec/bugfixes/mpa-worker-template/2026-10-09-independent-worker.md). + +## Runtime subnet ordering and recovery + +SubnetIds equality is based on unique nonempty members, independent of provider ordering. VpcId and EnableSharedInternetAccess remain immutable exact comparisons. Changed membership, duplicates and malformed lists fail validation. Resume preserves requested ordering, or the registered ordering when its members match the active Runtime, so existing request hashes and ClientTokens remain usable. A different shared default never replaces the active per-agent selection. No schema or hash-format migration is required. Design and verification: [subnet-order repair](../../prd-spec/bugfixes/mpa-subnet-order/2026-10-09-subnet-order.md). + + + +Image rollback (2026-10-09): public registry discovery and automatic digest conversion are withdrawn. Config inspection and new tasks use built-in local latest defaults; existing task snapshots remain unchanged. See [rollback design](../../prd-spec/bugfixes/mpa-create-images/2026-10-09-restore-main-images.md). + +### Managed Skill Space descriptions (CON-3/CON-4) + +New named deployments create `Description: Skills for MPA agent ` using the validated, trimmed entered name. Unnamed callers retain the internal-ID description. Space `Name`, `display_name`, ownership tags, IDs and bindings remain derived from internal identity. Existing/configured spaces are reused without description updates. Pending pre-upgrade requests retain their original description only when the complete old-description candidate matches the persisted `skill_space_request`; other pending-input changes remain errors. Unknown outcomes use discovery without blindly repeating CreateSkillSpace. See [description design](../../prd-spec/bugfixes/mpa-skill-space-description/2026-10-09-entered-name-description.md). diff --git a/specs/studio-mpa-creation/README.zh.md b/specs/studio-mpa-creation/README.zh.md index 1843ac18d..2ad749957 100644 --- a/specs/studio-mpa-creation/README.zh.md +++ b/specs/studio-mpa-creation/README.zh.md @@ -4,7 +4,7 @@ - 组件 ID:`studio-mpa-creation` - 状态:active -- 修订日期:2026-09-30 +- 修订日期: 2026-10-09 - 设计及证据:[Studio MPA 创建](../../prd-spec/features/mpa-agent-oneclick-provision/2026-09-20-studio-mpa-creation.zh.md) - 所属代码:`veadk/integrations/mpa/managed/`、`frontend/server/mpa_creation.py`、`frontend/src/adk/mpaCreation.ts`、`frontend/src/ui/mpa-create/`;CLI 和目录接入。 - 测试:`tests/integrations/mpa_managed/`、`frontend/tests/mpaCreation.test.tsx`。 @@ -13,7 +13,7 @@ ## 职责与边界 -VeADK 负责托管 YAML 解析、云服务/数据库编排、有权限约束的持久创建任务和 MPA 目录窗口。无需外部源码仓库。共享注册/初始化协议与 MPA 镜像互通。旧 `veadk mpa create` 独立保留且行为不变。不增加模型执行、渠道路由、PostgreSQL 实例创建或 IAM 策略管理。 +VeADK 负责托管 YAML 解析、云服务/数据库编排、有权限约束的持久创建任务和 MPA 目录窗口。无需外部源码仓库。共享注册/初始化协议与 MPA 镜像互通。旧 `veadk mpa create` 独立保留且行为不变。模型执行与渠道路由仍由 Runtime 负责。托管运行角色 IAM 准备遵循下文契约。 ## 契约 @@ -21,15 +21,15 @@ VeADK 负责托管 YAML 解析、云服务/数据库编排、有权限约束的 - **CON-16 — Studio MPA 来源标签:**通用 Studio MPA 部署和托管式一键创建都写入 `veadk:agent-type=mpa`、`veadk:managed=true`、`veadk:provisioner=studio-mpa`、可信 `veadk:owner` 和其持有的 `veadk:mpa-instance-id`;可信 owner 缺失时必须在云变更前失败,且启动子进程前必须验证原始 owner 的哈希与任务 owner 一致。一键创建路由把 owner 哈希后用于本地任务和原生注册表归属,同时仅通过固定子进程把原始可信 owner 临时传递给 Runtime 标签,不把它持久化到任务状态。只有该路由显式提供可信 Runtime owner 时,共享 provisioning 服务才写入 Studio 来源,因此 `veadk mpa create` 不进入 Studio 发现范围。标签对账替换这些受管键、保留无关非系统标签,并且不重放 `sys:*` 标签。对于持久化了旧版无来源标签 request hash 的 pending create,先使用原始 create payload 与 client token 精确重放,再通过正常 Runtime update 写入当前来源标签后完成。共享常量位于内部 MPA 标签模块,不新增公共 Python API。标签是发现 metadata,不是授权凭据。缺少 `veadk:managed=true` 的历史托管式一键 Runtime 必须经过显式受支持的更新/重试或未来回填后,Studio 才会列出。已由 [Studio 创建的 MPA Runtime 过滤](../../prd-spec/features/studio-mpa-source-filter/2026-09-28-studio-mpa-source-filter.zh.md) 于 2026-09-29 实现并完成本地验证;真实浏览器发现仍是独立的本机验收步骤。 -- **CON-1 — 配置:** Studio 使用代码内置的北京地域配置并忽略 `VEADK_MPA_CREATE_CONFIG`;账号及 Runtime 默认值来自原私有文件,镜像默认值见下文;不固定 VPC/子网/APIG ID。自动准备 PG 后,Studio 按核验后的账号和地域读取 `mpa_admin_workspace/mpa_admin_db` 中的共享资源:校验并复用已登记资源,或通过现有带锁 provisioner 创建并保存缺失的 VPC/子网及 APIG/IM Gateway。不重置已有记录来绕过配额。CLI 显式接管仍受支持。参见[注册库驱动网络修复](../../prd-spec/bugfixes/mpa-shared-network-bootstrap/2026-09-28-registry-owned-network.zh.md)。`VEADK_MPA_CONFIG_MODEL_AGENT_API_KEY` 和部署凭据仍须由服务端提供,不写入源码。子进程收到内置配置标记并校验相同配置。CLI `--config` 继续接受私有 YAML;`managed.version: 1` 支持短横线/下划线别名并拒绝未知字段。CLI 的 `from-runtime` 与 `template-file` 互斥,否则通过平铺镜像/模型/PG 字段构建模板。CLI 的 `database-admin-url-env` 与 `shared-database-url-env` 在服务端解析 PostgreSQL URL;配置/模板文件最多 256 KiB。HTTP 客户端不能选择路径、命令、账号或部署/PG 凭据;CON-11 允许本次创建提供 OpenViking API Key。配置检查仅限本地,不证明真实访问权限。参见[内置配置设计](../../prd-spec/features/mpa-agent-oneclick-provision/2026-09-23-studio-builtin-mpa-profile.zh.md)。 -- **CON-2 — 准备:** 运维提供 PostgreSQL 实例/注册库/登录用户/属主、IAM 角色、镜像、模型权限和网络连通性。先核验云账号及数据库权限,再准备账号 VPC/子网、APIG/IM Gateway、worker、独立业务库、Skill Space 和 Runtime。显式接管 APIG 要求配置匹配 VPC。不得假设新 VPC 可访问私网 PostgreSQL。等待应用就绪前释放账号锁。 +- **CON-1 — 配置:** Studio 使用代码内置的北京地域配置并忽略 `VEADK_MPA_CREATE_CONFIG`;非账号 Runtime 设置保留原私有默认值;Studio 镜像默认值为 CON-9 中的两个 latest 地址;部署账号来自核验的 STS 身份;不固定 VPC/子网/APIG ID。自动准备 PG 后,Studio 按核验后的账号和地域读取 `mpa_admin_workspace/mpa_admin_db` 中的共享资源:校验并复用已登记资源,或通过现有带锁 provisioner 创建并保存缺失的 VPC/子网及 APIG/IM Gateway。不重置已有记录来绕过配额。CLI 显式接管仍受支持。参见[注册库驱动网络修复](../../prd-spec/bugfixes/mpa-shared-network-bootstrap/2026-09-28-registry-owned-network.zh.md)。`VEADK_MPA_CONFIG_MODEL_AGENT_API_KEY` 和部署凭据仍须由服务端提供,不写入源码。子进程收到内置配置标记并校验相同配置。CLI `--config` 继续接受私有 YAML;`managed.version: 1` 支持短横线/下划线别名并拒绝未知字段。CLI 的 `from-runtime` 与 `template-file` 互斥,否则通过平铺镜像/模型/PG 字段构建模板。CLI 的 `database-admin-url-env` 与 `shared-database-url-env` 在服务端解析 PostgreSQL URL;配置/模板文件最多 256 KiB。HTTP 客户端不能选择路径、命令、账号或部署/PG 凭据;CON-11 允许本次创建提供 OpenViking API Key。配置检查仅限本地,不证明真实访问权限。参见[内置配置设计](../../prd-spec/features/mpa-agent-oneclick-provision/2026-09-23-studio-builtin-mpa-profile.zh.md)。 +- **CON-2 — 准备:** 运维提供 PostgreSQL 实例/注册库/登录用户/属主、IAM 角色(内置配置自动准备)、镜像、模型权限和网络连通性。先核验云账号及数据库权限,再准备账号 VPC/子网、APIG/IM Gateway、worker、独立业务库、Skill Space 和 Runtime。显式接管 APIG 要求配置匹配 VPC。不得假设新 VPC 可访问私网 PostgreSQL。等待应用就绪前释放账号锁。 - **CON-3 — 身份:** 持久身份为已核验账号 + 地域 + 稳定智能体 ID。原生归属标记、哈希、client token 和会话 advisory lock 决定复用。拒绝无关同名资源及未完成配置冲突。在原生部署记录保存 `studio_owner`;其他所属用户或无该所属身份的已有记录不能被隐式接管。CLI 使用 `cli`,Studio 使用授权主体的哈希。 - **CON-4 — 初始化:** 使用真实 Runtime 元数据及共享 APIG 初始化,不进行旧占位 endpoint 回填。要求公私网、KeyAuth、MPA 标签、绑定 worker/Skill Space 及元数据/IM 启动初始化。参考 Runtime 模板移除来源身份、渠道凭据、Skill Space 和 worker 身份。成功要求平台 Ready 及应用 `/readiness`。 - **CON-5 — 鉴权:** 四个接口在读取配置/状态前均调用 Studio 智能体管理鉴权。认证普通用户不能创建;本地开发沿用现有 `local` 主体语义。查询/取消按所属用户隔离。同一用户/request ID 复用任务;修改输入返回 409。全局最多四个活动任务,每用户一个。 - **CON-6 — 生命周期:** 状态为 `running`、`cancelling`、`succeeded`、`failed`、`cancelled`。提交/恢复进入 `running`;显式取消进入 `cancelling`,再到 `cancelled`;超时/失败进入 `failed`。成功任务不重跑。阶段为 `queued`、`checking`、`network`、`gateway`、`worker`、`database`、`skills`、`deploying`、`verifying`;阶段表示最近观察进度,不是另一套状态机。查询/提交时核验已退出的监管进程。恢复保留原请求和智能体 ID。 - **CON-7 — 取消:** 使用当前 VeADK Python 执行固定子进程模块。取消、截止时间或服务端关闭时终止子进程,最多等待 3 秒,再强制终止/回收,随后报告终态。默认截止时间 1800 秒(60–7200)。保留持久云资源,包括结果未知的进行中请求。取消不是回滚,重试使用登记意图/token。本流程不创建需要删除的临时调试 Runtime。 - **CON-8 — 数据/安全:**内置 Studio 使用 `/tmp/veadk-studio/mpa-creation.sqlite3`(服务端可用 `VEADK_MPA_TASK_DB` 覆盖)持久化所属用户哈希、不含密钥的输入、状态/阶段、安全结果和监管进程 PID,权限为 0600。这是针对云端代码目录只读问题而明确采用的临时、实例本地方案:重启可能丢失历史,多个实例不能依赖共享任务限制或锁。独立调用方显式构造服务时仍沿用 `.adk/mpa-creation.sqlite3` 约定。每次操作后关闭连接。无自动历史过期。原生 PostgreSQL 表保持 `mpa_account_network`、`mpa_account_apig`、`mpa_agent_deployment`;须使用直连/会话池。每次重读 STS 文件;Runtime/网络/APIG/worker 共用已核验账号的凭据。协议消息最多 16 KiB 并按白名单校验。不转发原始子进程输出、SDK 错误、环境转储、数据库 URL 或 Runtime 密钥。参见[临时可写状态修复](../../prd-spec/bugfixes/studio-mpa-writable-state/2026-09-23-use-temporary-state.zh.md)。 -- **CON-9 — UI:** 火山引擎的 MPA 筛选下,有智能体管理权限时展示创建卡片,含空列表。窗口显示固定地域、必填 Runtime 名称、描述和资源计划,不显示智能体 ID 或镜像输入框。三步分别展示基础信息、PostgreSQL 自动准备和 OpenViking;仅第三步提交。POST 前保存请求身份,提交后锁定输入,确保响应丢失后安全重试。卸载时中止轮询并忽略迟到响应,保留服务端工作,重开时从会话存储恢复。明确失败或取消的任务同时提供同 ID 重试和独立的新建操作;后者仅以新请求 UUID、空白名称及默认值替换浏览器草稿,服务端在提交时派生智能体 ID,不删除或修改原服务端任务与资源。运行中和提交结果不明时,弹窗不允许开始另一个身份。成功后刷新原地域。复用本地化 BaseUI/Studio 组件、键盘/输入法行为及语义主题变量。`ModalLayout.footer` 是可选 React 节点:省略保留原操作,`null` 隐藏页脚;原调用者不变。参见[终态任务新建修复](../../prd-spec/bugfixes/studio-mpa-creation/2026-09-24-start-another-agent-after-failure.zh.md)。 +- **CON-9 — UI:** 火山引擎的 MPA 筛选下,有智能体管理权限时展示创建卡片,含空列表。窗口显示固定地域、必填 Runtime 名称、描述和资源计划,智能体 ID 由服务端生成;与 main 一致,不显示 MPA/Worker 镜像输入框;服务端使用 main 的本地 latest 默认值。三步分别展示基础信息、PostgreSQL 自动准备和 OpenViking;仅第三步提交。POST 前保存请求身份,提交后锁定输入,确保响应丢失后安全重试。卸载时中止轮询并忽略迟到响应,保留服务端工作,重开时从会话存储恢复。明确失败或取消的任务同时提供同 ID 重试和独立的新建操作;后者仅以新请求 UUID、空白名称及默认值替换浏览器草稿,服务端在提交时派生智能体 ID,不删除或修改原服务端任务与资源。运行中和提交结果不明时,弹窗不允许开始另一个身份。成功后刷新原地域。复用本地化 BaseUI/Studio 组件、键盘/输入法行为及语义主题变量。`ModalLayout.footer` 是可选 React 节点:省略保留原操作,`null` 隐藏页脚;原调用者不变。参见[终态任务新建修复](../../prd-spec/bugfixes/studio-mpa-creation/2026-09-24-start-another-agent-after-failure.zh.md)。 Runtime 名称无效时,输入框边框和错误文字使用 danger 状态色,并保留无障碍 alert;输入框提供本地化合法名称示例。共享 Button 基础组件为原生禁用按钮统一置灰并显示禁止光标,保留加载态样式。修改为合法名称后恢复向后导航。 @@ -44,7 +44,7 @@ Runtime 名称无效时,输入框边框和错误文字使用 danger 状态色 Studio 内置默认镜像改为 `agentkit-platform-2112682748-cn-beijing.cr.volces.com/mpa/mpa_agent:latest` 和 `agentkit-platform-2112682748-cn-beijing.cr.volces.com/mpa/mpa_codex_worker:latest`。新草稿不恢复隐藏的旧镜像覆盖项;已提交草稿/任务保留原输入和镜像选择。继续支持显式 `agentId` 和可选镜像字段的旧 API 请求,没有名称的旧请求保留按 ID 命名 Runtime 的行为。CLI/YAML 覆盖不变。弹窗显示名称和描述,不显示 ID/镜像输入框;无效名称阻止向后导航及提交。既有任务授权、取消、并发、密钥处理和错误状态语义继续有效。 -验证映射至所链接设计中的路由/任务/runner/service/runtime/profile 测试和弹窗/浏览器检查。真实云端创建单独验证;可变的 `latest` 标签不会更新运行中的智能体。 +验证映射至所链接设计中的路由/任务/runner/service/runtime/profile 测试和弹窗/浏览器检查。真实云端创建单独验证;新的镜像默认值不会更新运行中的智能体。 CON-9 导航修复(2026-09-30):步骤标题是支持键盘操作的按钮。 恢复已提交草稿后,前面的步骤和“上一步”仍可查看;已提交字段保持锁定, @@ -129,8 +129,44 @@ CON-10 元数据可见性:区分初始化元数据缺失和显式冲突。具 ### 托管沙箱模板命名 (CON-3) -新托管沙箱模板使用去掉两端空白、将所有 `-` 替换为 `_` 的智能体 ID(例如 `mi-example` → `mi_example`)。已有 worker ID 仍为权威绑定,不重命名。变更前未完成的创建意图,仅在完整旧请求与已存 worker_hash 匹配时保留哈希名称,并保留 ClientToken。其他请求变更和无关同名资源仍报错。作用域所有权标签及 Runtime ToolId 绑定不变。 +新的 Studio 名称请求直接使用经过校验的手填 Runtime 名称作为沙箱模板 Name(4–64 个 ASCII 字母、数字、连字符或下划线)。未提供名称的旧 CLI 请求仍使用去除首尾空白、将 `-` 替换为 `_` 的智能体 ID。内部智能体 ID、数据库/技能空间/渠道标识、作用域归属标签及 Runtime ToolId 绑定不变。已有 worker ID 为权威绑定,不重命名。新的未完成意图在部署 JSON 中保存 `worker_name`,拒绝后续名称变化。没有该字段的旧意图,仅在完整候选请求与已存 worker_hash 匹配时重放标准化 ID 名称或哈希名称,保留 ClientToken。其他请求变化及无关同名资源仍报错。 参见[名称 Worker 设计](../../prd-spec/bugfixes/mpa-worker-naming/2026-10-09-runtime-named-worker.zh.md)。 ## 托管 MCP 签名密钥 每个托管 MPA Runtime 均配置 `MCP_TOKEN_SECRET`。显式模板环境变量非空值优先于目标 Runtime 值,后者优先于 Agent 专属 PostgreSQL `mpa_deployment_settings` 表中的 `mcp_token_secret`。全部缺失时生成 32 随机字节、编码为 64 位十六进制字符串,并在云创建前持久化。原子插入或保留已有值确保不确定创建结果的重试稳定。仅在校验未完成请求摘要后同步显式值/当前值,避免被拒绝的变更重试破坏原请求。数据库失败终止创建并释放连接。参考 Runtime 模板排除源 Agent 密钥;显式 JSON 模板可配置密钥。回填沿用密钥,正常返回值及共享非敏感部署登记记录不包含密钥。不新增前端字段或自动迁移存量部署。参见[双语设计](../../prd-spec/bugfixes/mpa-runtime-mcp-secret/2026-10-07-persistent-mcp-secret.zh.md)。 + +## 自动准备 Runtime IAM 角色 + +内置 Studio 使用 `managed.iam.mode: auto`,显式配置默认 `existing`。自动准备在 STS 账号核验后、工作负载身份和其他资源变更前执行。仅支持全新来源的默认 `IDRoleForArkClawShareAgent` 配置。IAM 为账号级。查询/创建角色及 `VeADKMPARuntimeAccessV1`,核验账号/名称及无条件信任 `vefaas`、`apig`,补齐已批准的 12 个系统策略和 14 个自定义动作的 Global 绑定,随后回读核验。保留额外绑定,不覆盖信任或已有策略。仅明确不存在错误允许创建,竞态和最终一致性采用最多 120 秒的恢复。取消保留资源。权限/信任/策略/属主/回读失败在 `iam_role` 阶段停止,输出白名单本地化错误,不输出原始云端文本和密钥。Studio 执行凭据须允许 GetRole、CreateRole、GetPolicy、CreatePolicy、ListAttachedRolePolicies、AttachRolePolicy。existing CLI 及通用智能体不受影响。完整权限及验收见[设计](../../prd-spec/features/mpa-runtime-iam/2026-10-09-managed-runtime-role.zh.md)。 + +## Studio 部署账号 + +内置配置不再固定预期账号。使用非空部署 STS 身份确定账号级 IAM、PG、VPC、APIG 和 Runtime 归属。新建 Runtime 的 `CLAW_SPACE_ID` 和 `RUNTIME_IAM_ROLE_TRN` 由该账号和所选角色派生;显式调用方环境变量覆盖保持优先。显式 YAML 预期账号检查和凭据账号变化检查继续生效。镜像仓库地址及 Worker 参考 ID 仍是源资源,具有独立访问要求。见[设计](../../prd-spec/bugfixes/mpa-studio-account/2026-10-09-sts-account.zh.md)。 + +## 网络归属描述与恢复 + +新 VPC/子网描述使用 `mpa-account-network-v1-`。恢复/校验托管资源仅接受当前范围精确的旧 `mpa-account-network:v1:` 或新标记,不改写已有资源。旧意图仅描述不同,派发标记明确为 false、无资源 ID、按名称查询无资源时,才修正描述并生成新 ClientToken;其他字段必须完全一致。结果不确定时,没有成功查询到资源就不得再次 Create。继续遵守现有锁及先保存后派发规则。见[设计](../../prd-spec/bugfixes/mpa-network-description/2026-10-09-valid-network-marker.zh.md)。 + +## 空网络查询 + +[已批准修复](../../prd-spec/bugfixes/mpa-network-discovery/2026-10-09-empty-network-results.zh.md)明确:DescribeVpcs/DescribeSubnets 第一页集合为 null/缺失且整数 `total_count=0` 时为空结果。其他非列表集合、null 集合且数量缺失/非整数/非零,以及后续页面的 null 集合仍为无效响应。SDK/提供方错误不得成为空查询。已记录的托管 VPC 可继续准备第一个子网,无需替换 VPC。分页、归属、持久化意图及未知结果防重复保护不变。 + +## 标准型共享网关准备 + +[已实施标准型网关修复](../../prd-spec/bugfixes/mpa-standard-gateway/2026-10-09-standard-shared-gateway.zh.md)规定:新托管 APIG 使用 standard、两个 1c2g 节点、small_1 CLB、公私网和 traffic 计费。新网关创建前,在共享锁内准备同 VPC、不同 APIG 支持可用区的两个子网。可选 gateway_subnet_intents 持久化每个伴随请求/token/发送状态,未知创建必须查询恢复。保留已有网关接管/复用和已有 Runtime 网络载荷。ExceededQuota 明确允许修正后重新发送;旧未知标记仍需审计恢复。部署凭据额外需要 apig:GetGatewayAvailableZones。不新增前端字段,不修改 Runtime 角色。 + +## 独立 Worker 配置 + +内置 Studio 使用镜像默认值创建 Worker,不引用 Tool,也不重复注入启动环境。CreateTool.Port 仍为 8000,默认 Envs 仅包含生成的 MPA_AGENT_ID。见[镜像默认值修订](../../prd-spec/bugfixes/mpa-worker-template/2026-10-09-worker-image-defaults.zh.md)。可选 `managed.worker.env` 是字符串映射;完整 `${ENV_NAME}` 在服务端解析。键必须使用大写。智能体/Runtime/Tool/技能空间绑定、继承的渠道/Runtime 密钥和控制库地址为保留字段。existing-id 不允许非空 env。显式 env 覆盖已过滤的可选模板环境,最后编排器生成 MPA_AGENT_ID。显式模板不存在仍报错。环境值不进入配置摘要/repr 或部署记录。已有归属、时限、取消及请求哈希/ClientToken 保护不变;修改未完成请求参数仍冲突。见[已批准设计与验证](../../prd-spec/bugfixes/mpa-worker-template/2026-10-09-independent-worker.zh.md)。 + +## Runtime 子网顺序与恢复 + +SubnetIds 按非空、唯一成员判断相同,不受平台返回顺序影响。VpcId、EnableSharedInternetAccess 仍不可变且精确比较。成员变化、重复及格式错误列表仍校验失败。恢复保留请求顺序,或在注册记录与当前 Runtime 成员相同时保留注册顺序,使已有请求哈希及 ClientToken 继续可用。成员不同的共享默认值不得替换当前智能体选择。无需结构或哈希格式迁移。设计与验证:[子网顺序修复](../../prd-spec/bugfixes/mpa-subnet-order/2026-10-09-subnet-order.zh.md)。 + + + +镜像回退(2026-10-09):已撤回公开仓库查询及自动 digest 转换。配置接口和新任务使用内置本地 latest 默认值;已有任务快照保持不变。见[回退设计](../../prd-spec/bugfixes/mpa-create-images/2026-10-09-restore-main-images.zh.md)。 + +### 托管技能空间描述(CON-3/CON-4) + +新的名称部署创建 `Description: Skills for MPA agent `,使用经过校验、去除首尾空白的手填名称。不提供名称的调用保留内部 ID 描述。空间 `Name`、`display_name`、归属标签、ID 及绑定仍由内部标识派生。已有/显式配置空间直接复用,不更新描述。升级前待完成请求仅在完整旧描述候选与持久化 `skill_space_request` 匹配时保留原描述;其他待完成输入变化仍报错。结果未知时通过发现恢复,不盲目重复 CreateSkillSpace。见[描述设计](../../prd-spec/bugfixes/mpa-skill-space-description/2026-10-09-entered-name-description.zh.md)。 diff --git a/tests/cli/test_frontend_deploy_iam.py b/tests/cli/test_frontend_deploy_iam.py index 2924b460e..0710e5682 100644 --- a/tests/cli/test_frontend_deploy_iam.py +++ b/tests/cli/test_frontend_deploy_iam.py @@ -284,7 +284,8 @@ def test_frontend_policy_allows_release_download() -> None: assert "vefaas:GetCodeUploadAddress" in actions assert "vefaas:GetApplication" in actions assert "vefaas:GetApplicationRevisionLog" in actions - assert "iam:CreatePolicy" not in actions + # Studio now prepares a versioned custom MPA runtime policy. + assert "iam:CreatePolicy" in actions assert "iam:UpdatePolicy" not in actions assert "vefaas:CodeUploadCallback" in actions assert "vefaas:UpdateFunction" in actions @@ -296,6 +297,7 @@ def test_frontend_policy_allows_release_download() -> None: "apig:ListGateways", "apig:CreateGateway", "apig:GetGateway", + "apig:GetGatewayAvailableZones", "apig:CreateIMChannelGateway", "apig:GetIMChannelGatewayStatus", }.issubset(actions) @@ -355,6 +357,7 @@ def test_frontend_policy_allows_complete_managed_mpa_cloud_workflow() -> None: "apig:ListGateways", "apig:CreateGateway", "apig:GetGateway", + "apig:GetGatewayAvailableZones", "apig:CreateIMChannelGateway", "apig:GetIMChannelGatewayStatus", "iam:PassRole", @@ -394,14 +397,16 @@ def test_default_frontend_role_policy_is_refreshed_for_future_updates( calls: list[dict[str, str]] = [] monkeypatch.setattr( "veadk.cli.frontend_deploy_iam.ensure_frontend_role", - lambda access_key, secret_key, **kwargs: calls.append( - { - "access_key": access_key, - "secret_key": secret_key, - **kwargs, - } - ) - or role, + lambda access_key, secret_key, **kwargs: ( + calls.append( + { + "access_key": access_key, + "secret_key": secret_key, + **kwargs, + } + ) + or role + ), ) refreshed = ensure_default_frontend_role_policy( diff --git a/tests/integrations/mpa_managed/fakes_deployment_network.py b/tests/integrations/mpa_managed/fakes_deployment_network.py index 2c9484e6c..76a5ca18f 100644 --- a/tests/integrations/mpa_managed/fakes_deployment_network.py +++ b/tests/integrations/mpa_managed/fakes_deployment_network.py @@ -102,7 +102,8 @@ async def create_vpc(self, request): async def create_subnet(self, request): self.calls.append(("subnet", copy.deepcopy(request))) - sid = "subnet-auto" + count = sum(kind == "subnet" for kind, _ in self.calls) + sid = "subnet-auto" if count == 1 else f"subnet-auto-{count}" self.subnet_rows[sid] = {**self.subnet_row(sid, request["vpc_id"]), **request} if self.lose == "subnet": self.lose = "" diff --git a/tests/integrations/mpa_managed/test_agent_deployment.py b/tests/integrations/mpa_managed/test_agent_deployment.py index 00443d80d..fbae14b81 100644 --- a/tests/integrations/mpa_managed/test_agent_deployment.py +++ b/tests/integrations/mpa_managed/test_agent_deployment.py @@ -440,6 +440,94 @@ async def run(): asyncio.run(run()) +@pytest.mark.parametrize("runtime_name", ["", " Support-Agent_01 "]) +def test_skill_space_description_uses_entered_name_and_keeps_internal_bindings( + runtime_name, +): + async def run(): + svc, registry, cloud, _ = deployer() + result = await svc.deploy(template(), runtime_name=runtime_name) + request = cloud.space_creates[0] + assert request["Description"] == "Skills for MPA agent " + ( + runtime_name.strip() or "agent-one" + ) + suffix = agent_suffix("account", "cn-beijing", "agent-one") + assert request["Name"] == "mpa_skills_" + suffix + assert {tag["Key"]: tag["Value"] for tag in request["Tags"]} == { + "managed_by": "mpa-deployment", + "mpa_agent_key": suffix, + "display_name": "agent-one 技能空间", + } + env = env_map(cloud.runtimes[result["runtime_id"]]) + assert env["MPA_AGENT_ID"] == "agent-one" + assert env["SKILL_SPACE_ID"] == result["skill_space_id"] + original = copy.deepcopy(cloud.spaces) + again = await svc.deploy(template(), runtime_name="different-name") + assert again["skill_space_id"] == result["skill_space_id"] + assert cloud.spaces == original and len(cloud.space_creates) == 1 + + asyncio.run(run()) + + +@pytest.mark.parametrize("legacy", [False, True]) +def test_named_skill_space_lost_response_preserves_full_original_intent(legacy): + async def run(): + svc, registry, cloud, _ = deployer() + cloud.lose_space_response = True + with pytest.raises(TimeoutError, match="space response lost"): + await svc.deploy( + template(), runtime_name="" if legacy else "Support-Agent_01" + ) + original = copy.deepcopy(registry.row["skill_space_request"]) + assert original["Description"] == "Skills for MPA agent " + ( + "agent-one" if legacy else "Support-Agent_01" + ) + changed = template() + changed["ProjectName"] = "another-project" + with pytest.raises(DeploymentError, match="different inputs"): + await svc.deploy(changed, runtime_name="Support-Agent_01") + if not legacy: + for name in ["different-name", ""]: + with pytest.raises(DeploymentError, match="different inputs"): + await svc.deploy(template(), runtime_name=name) + cloud.hide_spaces = True + for _ in range(2): + with pytest.raises(DeploymentError, match="outcome is unknown"): + await svc.deploy(template(), runtime_name="Support-Agent_01") + assert registry.row["skill_space_request"] == original + assert len(cloud.space_creates) == 1 and not cloud.creates + cloud.hide_spaces = False + result = await svc.deploy(template(), runtime_name="Support-Agent_01") + assert result["skill_space_id"] == "space-1" + assert registry.row["skill_space_request"] == original + assert cloud.space_creates == [original] + + asyncio.run(run()) + + +@pytest.mark.parametrize("runtime_name", ["abc", "a" * 65, "bad/name", "中文名称"]) +def test_invalid_skill_space_runtime_name_fails_before_cloud_calls(runtime_name): + from veadk.integrations.mpa.managed.config import ConfigurationError + from veadk.integrations.mpa.managed.skills import ensure_skill_space + + async def run(): + cloud = AsyncMock() + with pytest.raises(ConfigurationError): + await ensure_skill_space( + Registry(), + cloud, + account="account", + region="cn-beijing", + agent_id="agent-one", + runtime_name=runtime_name, + ) + cloud.find_skill_spaces.assert_not_awaited() + cloud.create_skill_space.assert_not_awaited() + cloud.get_skill_space.assert_not_awaited() + + asyncio.run(run()) + + def test_missing_registered_skill_space_does_not_create_empty_replacement(): async def run(): svc, registry, cloud, _ = deployer() diff --git a/tests/integrations/mpa_managed/test_config.py b/tests/integrations/mpa_managed/test_config.py index ed65d0d39..66f035e19 100644 --- a/tests/integrations/mpa_managed/test_config.py +++ b/tests/integrations/mpa_managed/test_config.py @@ -31,7 +31,10 @@ def test_studio_profile_uses_builtin_beijing_defaults_without_yaml(monkeypatch): monkeypatch.setenv("VEADK_MPA_CONFIG_MODEL_AGENT_API_KEY", "test-model-key") profile = load_studio_profile(region="cn-beijing") - assert profile.values["account_id"] == "2112682748" + assert not profile.values.get("account_id") + assert "CLAW_SPACE_ID" not in profile.managed.runtime.env + assert "RUNTIME_IAM_ROLE_TRN" not in profile.managed.runtime.env + assert "RUNTIME_IAM_ROLE_NAME" not in profile.managed.runtime.env assert profile.values["model_api_key"] == "test-model-key" postgres = profile.managed.postgres assert postgres is not None @@ -40,7 +43,8 @@ def test_studio_profile_uses_builtin_beijing_defaults_without_yaml(monkeypatch): assert profile.managed.network.vpc_id == "" assert profile.managed.network.subnet_ids == [] assert profile.managed.apig.adopt_id == "" - assert profile.managed.worker.reference_id == "t-yeuujqfldstkidoad4p0" + assert profile.managed.worker.reference_id == "" + assert profile.managed.worker.env == {} assert profile.summary()["configured"] is True assert "test-model-key" not in str(profile.summary()) @@ -560,6 +564,59 @@ def test_runtime_environment_resolves_secret_refs_without_exposing_values( ) +def test_worker_environment_resolves_secret_refs_safely(tmp_path, monkeypatch): + monkeypatch.setenv("TEST_WORKER_SECRET", "private-test-value") + path = profile_file( + tmp_path, + monkeypatch, + worker={"image": "worker:v1", "env": {"ARK_API_KEY": "${TEST_WORKER_SECRET}"}}, + ) + profile = load_profile(path) + assert profile.managed.worker.env == {"ARK_API_KEY": "private-test-value"} + assert "private-test-value" not in str(profile.summary()) + assert "private-test-value" not in repr(profile.managed.worker) + monkeypatch.delenv("TEST_WORKER_SECRET") + with pytest.raises(ConfigurationError, match="TEST_WORKER_SECRET"): + load_profile(path) + + +@pytest.mark.parametrize( + "env", + [ + {"NOT A KEY": "private-test-value"}, + {"MPA_AGENT_ID": "private-test-value"}, + {"AGENTKIT_RUNTIME_ID": "private-test-value"}, + {"AGENTKIT_TOOL_ID": "private-test-value"}, + {"SKILL_SPACE_ID": "private-test-value"}, + {"CODEX_MCP_RUNTIME_API_KEY": "private-test-value"}, + {"SHARED_APIG_DATABASE_URL": "private-test-value"}, + {"DEPLOYMENT_DATABASE_ADMIN_URL": "private-test-value"}, + {"FEISHU_APP_SECRET": "private-test-value"}, + {"SETTING": 123}, + [], + ], +) +def test_worker_environment_validation_is_safe(tmp_path, monkeypatch, env): + with pytest.raises(ConfigurationError) as error: + load_profile( + profile_file( + tmp_path, monkeypatch, worker={"image": "worker:v1", "env": env} + ) + ) + assert "private-test-value" not in str(error.value) + + +def test_existing_worker_rejects_ignored_environment(tmp_path, monkeypatch): + with pytest.raises(ConfigurationError): + load_profile( + profile_file( + tmp_path, + monkeypatch, + worker={"existing-id": "t-worker", "env": {"SETTING": "value"}}, + ) + ) + + @pytest.mark.parametrize( "settings", [ diff --git a/tests/integrations/mpa_managed/test_deployment_network.py b/tests/integrations/mpa_managed/test_deployment_network.py index 164c8bbbb..8705d7543 100644 --- a/tests/integrations/mpa_managed/test_deployment_network.py +++ b/tests/integrations/mpa_managed/test_deployment_network.py @@ -24,6 +24,7 @@ from veadk.integrations.mpa.managed.network import ( AccountNetworkProvisioner, NetworkOptions, + same_subnet_ids, ) from veadk.integrations.mpa.managed.network_cloud import NetworkCloudError from tests.integrations.mpa_managed.fakes_deployment_network import ( @@ -43,6 +44,24 @@ def provisioner(cloud=None, **kw): ) +@pytest.mark.parametrize( + "selection", + [ + [], + None, + "subnet-one", + ["subnet-one", "subnet-one"], + ["subnet-one", None], + ["subnet-one", []], + ["subnet-one", ""], + ["subnet-one", " "], + [f"subnet-{i}" for i in range(6)], + ], +) +def test_equal_invalid_subnet_selections_do_not_hide_invalid_inputs(selection): + assert not same_subnet_ids(selection, selection) + + def test_fresh_account_creates_once_and_other_agents_reuse_network(): async def run(): entry, cloud = NetworkEntry(), NetworkCloud() @@ -72,6 +91,46 @@ async def run(): asyncio.run(run()) +def test_recorded_vpc_with_null_empty_sdk_subnets_resumes_without_new_vpc(): + from veadk.integrations.mpa.managed.network_cloud import NetworkCloud as SDKCloud + + async def run(): + entry, cloud = NetworkEntry(), NetworkCloud() + service = provisioner(cloud) + cloud.vpcs["vpc-recorded"] = { + **cloud.vpc_row("vpc-recorded"), + "description": service.marker, + } + entry.row.update( + vpc_id="vpc-recorded", + managed_vpc=True, + vpc_request={"cidr_block": "172.20.0.0/16"}, + ) + original_subnets = cloud.subnets + adapter = SDKCloud(region="cn-beijing", credentials=None) + + async def sdk_response(method, request_type, **params): + assert method == "describe_subnets" + assert request_type == "DescribeSubnetsRequest" + rows = await original_subnets(params["vpc_id"]) + return {"subnets": rows or None, "total_count": len(rows)} + + adapter.call = AsyncMock(side_effect=sdk_response) + + async def subnets(vid): + return await adapter.subnets(vid) + + cloud.subnets = subnets + first = await service.ensure(entry) + assert first == await service.ensure(entry) + assert first["VpcConfiguration"]["VpcId"] == "vpc-recorded" + assert first["VpcConfiguration"]["SubnetIds"] == ["subnet-auto"] + assert [kind for kind, _ in cloud.calls] == ["subnet"] + assert entry.row["state"] == "ready" + + asyncio.run(run()) + + @pytest.mark.parametrize("kind", ["vpc", "subnet"]) def test_lost_response_discovers_resource_without_duplicate_create(kind): async def run(): @@ -261,6 +320,85 @@ async def run(): asyncio.run(run()) +@pytest.mark.parametrize("selection", ["explicit", "registered", "different-default"]) +def test_current_subnet_permutation_preserves_stable_selection(selection): + async def run(): + entry, cloud = NetworkEntry(), NetworkCloud(existing=True) + original = ["subnet-one", "subnet-two"] + cloud.subnet_rows["subnet-two"] = cloud.subnet_row("subnet-two", "vpc-one") + cloud.subnet_rows["subnet-two"]["zone_id"] = "cn-beijing-b" + entry.row = { + "vpc_id": "vpc-one", + "subnet_ids": original + if selection != "different-default" + else ["subnet-one"], + "state": "ready", + } + request = ( + {"VpcConfiguration": {"VpcId": "vpc-one", "SubnetIds": original}} + if selection == "explicit" + else None + ) + current = { + "NetworkConfigurations": [ + {"NetworkType": "public"}, + { + "NetworkType": "private", + "VpcConfiguration": { + "VpcId": "vpc-one", + "SubnetIds": list(reversed(original)), + "EnableSharedInternetAccess": True, + }, + }, + ] + } + before = copy.deepcopy((entry.row, request, current)) + result = await provisioner(cloud).ensure(entry, request, current=current) + assert result["VpcConfiguration"]["SubnetIds"] == ( + list(reversed(original)) if selection == "different-default" else original + ) + assert (entry.row, request, current) == before + assert not cloud.calls + + asyncio.run(run()) + + +@pytest.mark.parametrize( + "field,value", + [ + ("VpcId", "vpc-other"), + ("EnableSharedInternetAccess", False), + ("SubnetIds", ["subnet-one"]), + ("SubnetIds", ["subnet-one", "subnet-other"]), + ("SubnetIds", ["subnet-one", "subnet-two", "subnet-other"]), + ("SubnetIds", ["subnet-one", "subnet-two", "subnet-two"]), + ("SubnetIds", "subnet-one"), + ("SubnetIds", ["subnet-one", None]), + ], +) +def test_current_network_drift_is_rejected_before_resource_writes(field, value): + async def run(): + entry, cloud = NetworkEntry(), NetworkCloud(existing=True) + active = { + "VpcId": "vpc-one", + "SubnetIds": ["subnet-one", "subnet-two"], + "EnableSharedInternetAccess": True, + } + current = { + "NetworkConfigurations": [ + {"NetworkType": "public"}, + {"NetworkType": "private", "VpcConfiguration": active}, + ] + } + with pytest.raises(DeploymentError, match="migration"): + await provisioner(cloud).ensure( + entry, {"VpcConfiguration": {**active, field: value}}, current=current + ) + assert not cloud.calls and not entry.saved + + asyncio.run(run()) + + @pytest.mark.parametrize( "options", [ @@ -388,3 +526,327 @@ def test_rfc1918_private_network_ranges(cidr): def test_non_rfc1918_network_ranges_rejected(cidr): with pytest.raises(DeploymentError): NetworkOptions(vpc_cidr=cidr, subnet_prefix=25).validate() + + +def legacy_request(service, kind): + marker = service.marker.replace("-v1-", ":v1:") + if kind == "vpc": + return dict( + cidr_block="172.20.0.0/16", + vpc_name=service.name, + description=marker, + project_name="default", + ) + return dict( + vpc_id="vpc-one", + zone_id="cn-beijing-a", + cidr_block="172.20.0.0/24", + subnet_name=service.name + "-subnet", + description=marker, + ) + + +def enforce_description_format(cloud, entry): + import re + + for kind in ["vpc", "subnet"]: + create = getattr(cloud, "create_" + kind) + + async def checked(request, kind=kind, create=create): + if not re.fullmatch( + r"[A-Za-z0-9][A-Za-z0-9 _,.=\-]{0,254}", request["description"] + ): + raise NetworkCloudError("Create" + kind, "InvalidDescription.Malformed") + assert entry.row[kind + "_request"] == request + assert entry.row[kind + "_dispatched"] is True + return await create(request) + + setattr(cloud, "create_" + kind, checked) + + +@pytest.mark.asyncio +async def test_new_network_descriptions_pass_provider_format_and_reuse(): + entry, cloud = NetworkEntry(), NetworkCloud() + enforce_description_format(cloud, entry) + service = provisioner(cloud) + expected = await service.ensure(entry) + assert await service.ensure(entry) == expected + assert [kind for kind, request in cloud.calls] == ["vpc", "subnet"] + + +@pytest.mark.asyncio +@pytest.mark.parametrize("kind", ["vpc", "subnet"]) +async def test_rejected_legacy_description_resumes_with_new_token(kind): + entry, cloud = NetworkEntry(), NetworkCloud(existing=kind == "subnet") + service = provisioner(cloud) + old = legacy_request(service, kind) + entry.row = { + kind + "_request": {**old, "client_token": "old-token"}, + kind + "_dispatched": False, + } + if kind == "subnet": + entry.row["vpc_id"] = "vpc-one" + cloud.subnet_rows.clear() + enforce_description_format(cloud, entry) + await service.ensure(entry) + request = next(request for target, request in cloud.calls if target == kind) + assert request["description"] == service.marker + assert ":" not in request["description"] + assert request["client_token"] != "old-token" + assert { + k: v for k, v in request.items() if k not in ["description", "client_token"] + } == {k: v for k, v in old.items() if k != "description"} + assert sum(target == kind for target, request in cloud.calls) == 1 + + +@pytest.mark.asyncio +@pytest.mark.parametrize("kind", ["vpc", "subnet"]) +@pytest.mark.parametrize("dispatched", [True, None]) +async def test_unknown_legacy_description_never_dispatches_without_discovery( + kind, dispatched +): + entry, cloud = NetworkEntry(), NetworkCloud(existing=kind == "subnet") + service = provisioner(cloud) + old = legacy_request(service, kind) + entry.row.update({kind + "_request": {**old, "client_token": "old-token"}}) + if dispatched is not None: + entry.row[kind + "_dispatched"] = dispatched + if kind == "subnet": + entry.row["vpc_id"] = "vpc-one" + cloud.subnet_rows.clear() + with pytest.raises(DeploymentError): + await service.ensure(entry) + assert not cloud.calls + assert entry.row[kind + "_request"] == {**old, "client_token": "old-token"} + assert entry.row.get(kind + "_dispatched") is dispatched + + +@pytest.mark.asyncio +@pytest.mark.parametrize("registered", [False, True]) +async def test_old_scoped_network_is_reused_without_mutation(registered): + cloud = NetworkCloud() + entry = NetworkEntry() + service = provisioner(cloud) + result = await service.ensure(entry) + old_marker = legacy_request(service, "vpc")["description"] + cloud.vpcs["vpc-auto"]["description"] = old_marker + cloud.subnet_rows["subnet-auto"]["description"] = old_marker + entry.row["vpc_request"]["description"] = old_marker + entry.row["subnet_request"]["description"] = old_marker + cloud.calls.clear() + assert await service.ensure(entry if registered else NetworkEntry()) == result + assert not cloud.calls + assert cloud.vpcs["vpc-auto"]["description"] == old_marker + + +@pytest.mark.asyncio +@pytest.mark.parametrize("kind", ["vpc", "subnet"]) +async def test_unknown_legacy_intent_can_recover_discovered_resource(kind): + cloud, entry = NetworkCloud(existing=kind == "subnet"), NetworkEntry() + service = provisioner(cloud) + old = legacy_request(service, kind) + if kind == "subnet": + cloud.subnet_rows.clear() + await getattr(cloud, "create_" + kind)({**old, "client_token": "old-token"}) + entry.row = { + kind + "_request": {**old, "client_token": "old-token"}, + kind + "_dispatched": True, + } + if kind == "subnet": + entry.row["vpc_id"] = "vpc-one" + await service.ensure(entry) + assert sum(target == kind for target, request in cloud.calls) == 1 + assert entry.row[kind + "_request"]["client_token"] == "old-token" + + +@pytest.mark.asyncio +async def test_rejected_legacy_request_cannot_change_other_inputs(): + cloud, entry = NetworkCloud(), NetworkEntry() + service = provisioner(cloud) + old = legacy_request(service, "vpc") + old["project_name"] = "other-project" + entry.row = { + "vpc_request": {**old, "client_token": "old-token"}, + "vpc_dispatched": False, + } + with pytest.raises(DeploymentError, match="different inputs"): + await service.ensure(entry) + assert not cloud.calls + assert entry.row["vpc_request"] == {**old, "client_token": "old-token"} + + +@pytest.mark.asyncio +async def test_gateway_companion_uses_apig_zones_and_preserves_primary_intent(): + entry, cloud = NetworkEntry(), NetworkCloud() + manager = provisioner(cloud) + network = await manager.ensure(entry) + original = copy.deepcopy(network) + primary = copy.deepcopy(entry.row["subnet_request"]) + first = await manager.gateway_network( + entry, network, ["cn-beijing-a", "cn-beijing-c"] + ) + second = await manager.gateway_network( + entry, first, ["cn-beijing-a", "cn-beijing-c"] + ) + assert first == second + assert network == original + assert entry.row["subnet_request"] == primary + assert first["VpcConfiguration"]["SubnetIds"] == ["subnet-auto", "subnet-auto-2"] + assert [kind for kind, _ in cloud.calls] == ["vpc", "subnet", "subnet"] + companion = cloud.calls[-1][1] + assert companion["zone_id"] == "cn-beijing-c" + assert companion["cidr_block"] == "172.20.1.0/24" + assert ( + entry.row["gateway_subnet_intents"]["cn-beijing-c"]["subnet_request"] + == companion + ) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("cancel", [False, True]) +async def test_gateway_companion_lost_response_discovers_without_duplicate(cancel): + entry, cloud = NetworkEntry(), NetworkCloud(existing=True) + entry.row = {"vpc_id": "vpc-one", "subnet_ids": ["subnet-one"]} + manager = provisioner(cloud) + network = await manager.ensure(entry) + create = cloud.create_subnet + + async def lost(request): + await create(request) + raise asyncio.CancelledError() if cancel else TimeoutError("lost response") + + cloud.create_subnet = lost + with pytest.raises(asyncio.CancelledError if cancel else TimeoutError): + await manager.gateway_network(entry, network, ["cn-beijing-a", "cn-beijing-c"]) + cloud.hide = True + with pytest.raises(DeploymentError, match="outcome unknown"): + await manager.gateway_network(entry, network, ["cn-beijing-a", "cn-beijing-c"]) + assert len(cloud.calls) == 1 + cloud.hide = False + result = await manager.gateway_network( + entry, network, ["cn-beijing-a", "cn-beijing-c"] + ) + assert result["VpcConfiguration"]["SubnetIds"] == ["subnet-one", "subnet-auto"] + assert len(cloud.calls) == 1 + + +@pytest.mark.asyncio +async def test_pending_companion_cannot_be_bypassed_by_another_subnet(): + entry, cloud = NetworkEntry(), NetworkCloud(existing=True) + entry.row = {"vpc_id": "vpc-one", "subnet_ids": ["subnet-one"]} + manager = provisioner(cloud) + network = await manager.ensure(entry) + cloud.lose = "subnet" + with pytest.raises(TimeoutError): + await manager.gateway_network(entry, network, ["cn-beijing-a", "cn-beijing-c"]) + cloud.subnet_rows.pop("subnet-auto") + cloud.subnet_rows["unrelated"] = { + **cloud.subnet_row("unrelated", "vpc-one"), + "zone_id": "cn-beijing-c", + } + with pytest.raises(DeploymentError, match="outcome unknown"): + await manager.gateway_network(entry, network, ["cn-beijing-a", "cn-beijing-c"]) + assert len(cloud.calls) == 1 + + +@pytest.mark.asyncio +async def test_existing_cross_zone_subnets_are_reused(): + entry, cloud = NetworkEntry(), NetworkCloud(existing=True) + entry.row = {"vpc_id": "vpc-one", "subnet_ids": ["subnet-one"]} + cloud.subnet_rows["subnet-c"] = { + **cloud.subnet_row("subnet-c", "vpc-one"), + "zone_id": "cn-beijing-c", + "cidr_block": "172.20.1.0/24", + } + manager = provisioner(cloud) + network = await manager.ensure(entry) + result = await manager.gateway_network( + entry, network, ["cn-beijing-a", "cn-beijing-c"] + ) + assert result["VpcConfiguration"]["SubnetIds"] == ["subnet-one", "subnet-c"] + assert cloud.calls == [] + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "zones", + [ + [], + ["cn-beijing-a"], + ["cn-beijing-a", "cn-beijing-a"], + ["cn-beijing-a", "cn-shanghai-a"], + ], +) +async def test_gateway_invalid_zones_fail_before_creating_companions(zones): + entry, cloud = NetworkEntry(), NetworkCloud(existing=True) + entry.row = {"vpc_id": "vpc-one", "subnet_ids": ["subnet-one"]} + manager = provisioner(cloud) + network = await manager.ensure(entry) + with pytest.raises(DeploymentError, match="APIG"): + await manager.gateway_network(entry, network, zones) + assert cloud.calls == [] + + +@pytest.mark.asyncio +async def test_gateway_companion_has_no_free_cidr(): + entry, cloud = NetworkEntry(), NetworkCloud(existing=True) + entry.row = {"vpc_id": "vpc-one", "subnet_ids": ["subnet-one"]} + cloud.vpcs["vpc-one"]["cidr_block"] = "172.20.0.0/24" + manager = provisioner(cloud) + network = await manager.ensure(entry) + with pytest.raises(DeploymentError, match="No free subnet CIDR"): + await manager.gateway_network(entry, network, ["cn-beijing-a", "cn-beijing-c"]) + assert cloud.calls == [] + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "field,value", + [ + ("description", "foreign-owner"), + ("zone_id", "cn-beijing-d"), + ("account_id", "another-account"), + ("available_ip_address_count", 0), + ], +) +async def test_pending_gateway_companion_drift_never_dispatches_again(field, value): + entry, cloud = NetworkEntry(), NetworkCloud(existing=True) + entry.row = {"vpc_id": "vpc-one", "subnet_ids": ["subnet-one"]} + manager = provisioner(cloud) + network = await manager.ensure(entry) + cloud.lose = "subnet" + with pytest.raises(TimeoutError): + await manager.gateway_network(entry, network, ["cn-beijing-a", "cn-beijing-c"]) + cloud.subnet_rows["subnet-auto"][field] = value + with pytest.raises(DeploymentError): + await manager.gateway_network(entry, network, ["cn-beijing-a", "cn-beijing-c"]) + assert len(cloud.calls) == 1 + + +@pytest.mark.asyncio +async def test_pending_gateway_companion_prefix_change_keeps_original_request(): + entry, cloud = NetworkEntry(), NetworkCloud(existing=True) + entry.row = {"vpc_id": "vpc-one", "subnet_ids": ["subnet-one"]} + manager = provisioner(cloud) + network = await manager.ensure(entry) + cloud.lose = "subnet" + with pytest.raises(TimeoutError): + await manager.gateway_network(entry, network, ["cn-beijing-a", "cn-beijing-c"]) + before = copy.deepcopy(entry.row) + with pytest.raises(DeploymentError, match="CIDR/configuration conflicts"): + await provisioner( + cloud, options=NetworkOptions(subnet_prefix=25) + ).gateway_network(entry, network, ["cn-beijing-a", "cn-beijing-c"]) + assert entry.row == before + assert len(cloud.calls) == 1 + + +@pytest.mark.asyncio +async def test_gateway_cidr_allocation_keeps_primary_when_subnet_list_lags(): + entry, cloud = NetworkEntry(), NetworkCloud() + manager = provisioner(cloud) + network = await manager.ensure(entry) + # GetSubnet is ready while DescribeSubnets has not caught up yet. + cloud.hide = True + await manager.gateway_network(entry, network, ["cn-beijing-a", "cn-beijing-c"]) + assert cloud.calls[-1][1]["cidr_block"] == "172.20.1.0/24" diff --git a/tests/integrations/mpa_managed/test_deployment_network_cloud.py b/tests/integrations/mpa_managed/test_deployment_network_cloud.py index d5d4c3755..1b8694b36 100644 --- a/tests/integrations/mpa_managed/test_deployment_network_cloud.py +++ b/tests/integrations/mpa_managed/test_deployment_network_cloud.py @@ -151,6 +151,77 @@ async def run(): asyncio.run(run()) +@pytest.mark.parametrize("collection", ["vpcs", "subnets"]) +@pytest.mark.parametrize("serialization", ["sdk", "absent"]) +def test_discovery_accepts_confirmed_empty_sdk_results(collection, serialization): + import volcenginesdkvpc + + response_type = ( + volcenginesdkvpc.DescribeVpcsResponse + if collection == "vpcs" + else volcenginesdkvpc.DescribeSubnetsResponse + ) + response = response_type(total_count=0).to_dict() + assert response[collection] is None + if serialization == "absent": + del response[collection] + cloud = NetworkCloud(region="r", credentials=None) + cloud.call = AsyncMock(return_value=response) + discover = cloud.find_vpcs if collection == "vpcs" else cloud.subnets + assert asyncio.run(discover("name-or-vpc")) == [] + cloud.call.assert_awaited_once() + assert cloud.call.call_args.kwargs["page_number"] == 1 + + +@pytest.mark.parametrize("collection", ["vpcs", "subnets"]) +@pytest.mark.parametrize( + "response", + [ + {}, + {"total_count": 1}, + {"total_count": -1}, + {"total_count": None}, + {"total_count": False}, + {"total_count": "0"}, + {"total_count": 0.0}, + {"items": "", "total_count": 0}, + {"items": {}, "total_count": 0}, + ], +) +def test_discovery_rejects_unconfirmed_or_malformed_empty_results(collection, response): + payload = {**response, collection: response.get("items")} + cloud = NetworkCloud(region="r", credentials=None) + cloud.call = AsyncMock(return_value=payload) + discover = cloud.find_vpcs if collection == "vpcs" else cloud.subnets + with pytest.raises(DeploymentError, match="invalid results"): + asyncio.run(discover("name-or-vpc")) + cloud.call.assert_awaited_once() + + +@pytest.mark.parametrize("collection", ["vpcs", "subnets"]) +def test_discovery_rejects_null_zero_page_after_populated_page(collection): + cloud = NetworkCloud(region="r", credentials=None) + cloud.call = AsyncMock( + side_effect=[ + {collection: [{}] * 100, "total_count": 100}, + {collection: None, "total_count": 0}, + ] + ) + discover = cloud.find_vpcs if collection == "vpcs" else cloud.subnets + with pytest.raises(DeploymentError, match="invalid results"): + asyncio.run(discover("name-or-vpc")) + assert cloud.call.await_count == 2 + + +def test_empty_discovery_does_not_hide_provider_errors(): + cloud = NetworkCloud(region="r", credentials=None) + cloud.call = AsyncMock( + side_effect=NetworkCloudError("describe_subnets", "AccessDenied") + ) + with pytest.raises(NetworkCloudError, match="AccessDenied"): + asyncio.run(cloud.subnets("vpc")) + + @pytest.mark.parametrize( "method,args,message", [ diff --git a/tests/integrations/mpa_managed/test_gateway.py b/tests/integrations/mpa_managed/test_gateway.py index 7e1ff1dad..6e7fed104 100644 --- a/tests/integrations/mpa_managed/test_gateway.py +++ b/tests/integrations/mpa_managed/test_gateway.py @@ -64,6 +64,9 @@ def __init__(self, account="account-1", region="cn-beijing"): async def account_id(self): return self.account + async def available_zones(self): + return [self.region + "-a", self.region + "-c"] + async def find_gateways(self, name): return [g for g in self.gateways.values() if g["Name"] == name] @@ -73,7 +76,7 @@ async def create_gateway(self, name, vpc_id, subnet_ids): self.gateways["gw-1"] = { "Id": "gw-1", "Name": name, - "Type": "serverless", + "Type": "standard", "Region": self.region, "Status": "Running", "NetworkSpec": {"VpcId": vpc_id}, @@ -158,10 +161,11 @@ async def scenario(): asyncio.run(scenario()) -def test_definitive_permission_error_can_retry_after_permissions_fixed(): +@pytest.mark.parametrize("code", ["AccessDenied", "ExceededQuota"]) +def test_definitive_permission_error_can_retry_after_permissions_fixed(code): async def scenario(): registry, cloud = Registry(), Cloud() - cloud.create_error = APIGClientError("denied", code="AccessDenied") + cloud.create_error = APIGClientError("denied", code=code) with pytest.raises(APIGClientError): await service(registry, cloud).ensure( vpc_id="vpc-1", subnet_ids=["subnet-1"] @@ -174,6 +178,33 @@ async def scenario(): asyncio.run(scenario()) +def test_im_quota_rejection_can_retry_without_recreating_gateway(): + async def scenario(): + registry, cloud = Registry(), Cloud() + create = cloud.create_im_gateway_service + + async def rejected(**kwargs): + raise APIGClientError("quota", code="ExceededQuota") + + cloud.create_im_gateway_service = rejected + with pytest.raises(APIGClientError): + await service(registry, cloud).ensure( + vpc_id="vpc-1", subnet_ids=["subnet-1", "subnet-2"] + ) + assert ( + registry.rows[(cloud.account, cloud.region)]["im_create_requested"] is False + ) + cloud.create_im_gateway_service = create + assert ( + await service(registry, cloud).ensure( + vpc_id="vpc-1", subnet_ids=["subnet-1", "subnet-2"] + ) + )["state"] == "ready" + assert cloud.created == 1 + + asyncio.run(scenario()) + + def test_explicit_adoption_recovers_unknown_create_without_second_gateway(): async def scenario(): registry, cloud = Registry(), Cloud() diff --git a/tests/integrations/mpa_managed/test_gateway_cloud.py b/tests/integrations/mpa_managed/test_gateway_cloud.py index 09f284318..2fc29ff9e 100644 --- a/tests/integrations/mpa_managed/test_gateway_cloud.py +++ b/tests/integrations/mpa_managed/test_gateway_cloud.py @@ -15,8 +15,75 @@ import asyncio import json from types import SimpleNamespace +from unittest.mock import AsyncMock -from veadk.integrations.mpa.managed.gateway_cloud import GatewayCloud +import pytest + +from veadk.integrations.mpa.managed.gateway_cloud import APIGClientError, GatewayCloud + + +def test_new_gateway_matches_standard_shared_specification(): + cloud = GatewayCloud(SimpleNamespace(region="cn-beijing")) + cloud.call = AsyncMock(return_value={"Id": "gw-new"}) + assert ( + asyncio.run(cloud.create_gateway("managed", "vpc", ["subnet-a", "subnet-c"])) + == "gw-new" + ) + cloud.call.assert_awaited_once_with( + "CreateGateway", + { + "Name": "managed", + "Region": "cn-beijing", + "Type": "standard", + "NetworkSpec": {"VpcId": "vpc", "SubnetIds": ["subnet-a", "subnet-c"]}, + "ResourceSpec": { + "Replicas": 2, + "InstanceSpecCode": "1c2g", + "CLBSpecCode": "small_1", + "PublicNetworkBillingType": "traffic", + "NetworkType": { + "EnablePublicNetwork": True, + "EnablePrivateNetwork": True, + }, + }, + }, + ) + + +@pytest.mark.parametrize("ids", [[], ["one"], ["one", "one"]]) +def test_standard_gateway_rejects_insufficient_subnets_before_dispatch(ids): + cloud = GatewayCloud(SimpleNamespace(region="cn-beijing")) + cloud.call = AsyncMock() + with pytest.raises(APIGClientError, match="distinct subnet"): + asyncio.run(cloud.create_gateway("managed", "vpc", ids)) + cloud.call.assert_not_awaited() + + +def test_gateway_zones_are_from_apig(): + cloud = GatewayCloud(SimpleNamespace(region="cn-beijing")) + cloud.call = AsyncMock( + return_value={"AvailableZones": ["cn-beijing-c", "cn-beijing-a"]} + ) + assert asyncio.run(cloud.available_zones()) == ["cn-beijing-a", "cn-beijing-c"] + cloud.call.assert_awaited_once_with("GetGatewayAvailableZones", {}) + + +@pytest.mark.parametrize( + "zones", + [ + None, + [], + ["cn-beijing-a"], + ["cn-beijing-a", "cn-shanghai-a"], + ["cn-beijing-a", "cn-beijing-a"], + "bad", + ], +) +def test_invalid_gateway_zones_fail_closed(zones): + cloud = GatewayCloud(SimpleNamespace(region="cn-beijing")) + cloud.call = AsyncMock(return_value={"AvailableZones": zones}) + with pytest.raises(APIGClientError, match="available zones"): + asyncio.run(cloud.available_zones()) def test_gateway_reads_universal_sdk_raw_response_when_decoded_result_is_empty( diff --git a/tests/integrations/mpa_managed/test_iam.py b/tests/integrations/mpa_managed/test_iam.py new file mode 100644 index 000000000..681567635 --- /dev/null +++ b/tests/integrations/mpa_managed/test_iam.py @@ -0,0 +1,311 @@ +# Copyright (c) 2025 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Isolated role reconciliation contracts; never call real IAM.""" + +import asyncio +import copy +import json +from types import SimpleNamespace + +import pytest + +from veadk.integrations.mpa.managed.config import Managed, load_studio_profile +from veadk.integrations.mpa.managed.iam import ( + ACTIONS, + POLICY_NAME, + ROLE_NAME, + SYSTEM_POLICIES, + TRUST_DOCUMENT, + IamCloud, + IamError, + ensure_runtime_role, +) + + +class FakeIAM: + def __init__(self): + self.role = None + self.policy = None + self.bindings = {("unrelated", "Custom")} + self.calls = [] + self.fail = None + self.hidden = 0 + self.race = False + + async def call(self, method, **params): + self.calls.append((method, params)) + if self.fail == method: + raise IamError("AccessDenied") + if method == "get_role": + if self.role is None: + raise IamError("RoleNotExist") + return {"Role": copy.deepcopy(self.role)} + if method == "create_role": + self.role = { + "RoleName": ROLE_NAME, + "Trn": f"trn:iam::123:role/{ROLE_NAME}", + "TrustPolicyDocument": params["TrustPolicyDocument"], + } + if self.race: + raise IamError("RoleAlreadyExists") + if method == "get_policy": + if self.policy is None: + raise IamError("PolicyNotExist") + return {"Policy": {"PolicyDocument": copy.deepcopy(self.policy)}} + if method == "create_policy": + self.policy = json.loads(params["PolicyDocument"]) + if self.race: + raise IamError("PolicyAlreadyExist") + if method == "list_attached_role_policies": + if self.hidden: + self.hidden -= 1 + return {"AttachedPolicyMetadata": []} + return { + "AttachedPolicyMetadata": [ + { + "PolicyName": name, + "PolicyType": kind, + "PolicyScope": [{"PolicyScopeType": "Global"}], + } + for name, kind in self.bindings + ] + } + if method == "attach_role_policy": + binding = (params["PolicyName"], params["PolicyType"]) + if binding in self.bindings: + raise IamError("PolicyAttachConflict") + self.bindings.add(binding) + return {} + + +@pytest.mark.asyncio +@pytest.mark.parametrize("race", [False, True]) +async def test_new_role_and_policy_converge_and_retry_is_additive(race): + cloud = FakeIAM() + cloud.race = race + await ensure_runtime_role(cloud, "123", poll_interval=0) + assert len(SYSTEM_POLICIES) == 12 and len(ACTIONS) == 14 + assert cloud.bindings == {("unrelated", "Custom"), (POLICY_NAME, "Custom")} | { + (name, "System") for name in SYSTEM_POLICIES + } + assert json.loads(cloud.role["TrustPolicyDocument"]) == TRUST_DOCUMENT + cloud.calls.clear() + await ensure_runtime_role(cloud, "123", poll_interval=0) + assert not any( + method.startswith(("create_", "attach_")) for method, _ in cloud.calls + ) + + +@pytest.mark.asyncio +async def test_partial_failure_preserves_state_and_same_identity_can_resume(): + cloud = FakeIAM() + cloud.fail = "attach_role_policy" + with pytest.raises(IamError) as caught: + await ensure_runtime_role(cloud, "123", poll_interval=0) + assert caught.value.key == "iamPermissionDenied" + assert cloud.role and cloud.policy + cloud.fail = None + cloud.hidden = 2 + await ensure_runtime_role(cloud, "123", poll_interval=0) + assert (POLICY_NAME, "Custom") in cloud.bindings + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "problem,key", + [ + ("account", "iamOwnershipConflict"), + ("trust", "iamTrustConflict"), + ("deny", "iamTrustConflict"), + ("policy", "iamPolicyConflict"), + ], +) +async def test_conflicting_existing_resources_are_never_overwritten(problem, key): + cloud = FakeIAM() + await ensure_runtime_role(cloud, "123", poll_interval=0) + if problem == "account": + cloud.role["Trn"] = f"trn:iam::456:role/{ROLE_NAME}" + elif problem == "trust": + cloud.role["TrustPolicyDocument"] = json.dumps({"Statement": []}) + elif problem == "deny": + trust = copy.deepcopy(TRUST_DOCUMENT) + trust["Statement"].append({"Effect": "Deny", "Action": ["sts:AssumeRole"]}) + cloud.role["TrustPolicyDocument"] = trust + else: + cloud.policy["Statement"][0]["Resource"] = ["different"] + cloud.calls.clear() + with pytest.raises(IamError) as caught: + await ensure_runtime_role(cloud, "123", poll_interval=0) + assert caught.value.key == key + assert all(method.startswith(("get_", "list_")) for method, _ in cloud.calls) + + +@pytest.mark.asyncio +async def test_permission_error_does_not_trigger_create(): + cloud = FakeIAM() + cloud.fail = "get_role" + with pytest.raises(IamError, match="iamPermissionDenied"): + await ensure_runtime_role(cloud, "123", poll_interval=0) + assert [method for method, _ in cloud.calls] == ["get_role"] + + +@pytest.mark.asyncio +async def test_readback_timeout_and_cancellation_keep_resources(): + cloud = FakeIAM() + cloud.hidden = 100000 + with pytest.raises(IamError, match="iamVerificationFailed"): + await ensure_runtime_role(cloud, "123", timeout=0.01, poll_interval=0.02) + assert cloud.role and cloud.policy + task = asyncio.create_task(ensure_runtime_role(cloud, "123", poll_interval=10)) + await asyncio.sleep(0.01) + task.cancel() + with pytest.raises(asyncio.CancelledError): + await task + count = len(cloud.calls) + await asyncio.sleep(0.01) + assert len(cloud.calls) == count + + +def test_default_modes_and_auto_rejects_custom_sources(monkeypatch): + monkeypatch.setenv("VEADK_MPA_CONFIG_MODEL_AGENT_API_KEY", "test-key") + assert load_studio_profile(region="cn-beijing").managed.iam.mode == "auto" + assert Managed(version=1, worker={"image": "repo/image:tag"}).iam.mode == "existing" + for extra in [ + {"from_runtime": "r-reference"}, + {"template_file": "x.json"}, + {"runtime": {"role_name": "CustomRole"}}, + {"worker": {"image": "repo/image:tag", "role_name": "CustomRole"}}, + ]: + with pytest.raises(ValueError): + Managed.model_validate( + { + "version": 1, + "worker": {"image": "repo/image:tag"}, + "iam": {"mode": "auto"}, + **extra, + } + ) + + +@pytest.mark.asyncio +async def test_sdk_isolation_fresh_credentials_and_safe_errors(monkeypatch): + from volcengine.iam.IamService import IamService + + clients = [] + + def initialize(client): + clients.append(client) + + monkeypatch.setattr(IamService, "__init__", initialize) + for setter in [ + "set_ak", + "set_sk", + "set_session_token", + "set_scheme", + "set_connection_timeout", + "set_socket_timeout", + ]: + monkeypatch.setattr(IamService, setter, lambda self, value: None) + monkeypatch.setattr( + IamService, + "get_role", + lambda self, params: { + "ResponseMetadata": { + "Error": {"Code": "AccessDenied", "Message": "private-token"} + } + }, + ) + credentials = [] + + def fresh(): + credentials.append(True) + return SimpleNamespace( + access_key_id="test", secret_access_key="test", session_token="test" + ) + + cloud = IamCloud(SimpleNamespace(_credentials=fresh)) + for _ in range(2): + with pytest.raises(IamError) as caught: + await cloud.call("get_role", RoleName=ROLE_NAME) + assert "private-token" not in str(caught.value) + assert len(credentials) == 2 and clients[0] is not clients[1] + monkeypatch.setattr( + IamService, + "get_role", + lambda self, params: (_ for _ in ()).throw( + Exception( + json.dumps( + { + "ResponseMetadata": { + "Error": { + "Code": "RoleNotExist", + "Message": "private-token", + } + } + } + ) + ) + ), + ) + with pytest.raises(IamError) as caught: + await cloud.call("get_role", RoleName=ROLE_NAME) + assert caught.value.code == "RoleNotExist" + + +@pytest.mark.asyncio +async def test_role_failure_stops_before_identity_and_pg(monkeypatch): + from unittest.mock import AsyncMock + from veadk.integrations.mpa.managed import service + + monkeypatch.setenv("VEADK_MPA_CONFIG_MODEL_AGENT_API_KEY", "test-key") + profile = load_studio_profile(region="cn-beijing") + profile.values["account_id"] = "123" + runtime = SimpleNamespace(account_id=AsyncMock(return_value="123")) + monkeypatch.setattr(service, "RuntimeCloud", lambda **kwargs: runtime) + prepare = AsyncMock(side_effect=IamError("AccessDenied")) + identity = AsyncMock() + monkeypatch.setattr(service, "ensure_runtime_role", prepare) + monkeypatch.setattr(service, "ensure_workload_identity", identity) + stages = [] + with pytest.raises(IamError): + await service.provision( + profile, agent_id="mi-test", owner="test", progress=stages.append + ) + assert stages == ["checking", "iam_role"] + prepare.assert_awaited_once() + identity.assert_not_awaited() + + +@pytest.mark.asyncio +async def test_project_only_binding_does_not_satisfy_global_access(): + cloud = FakeIAM() + await ensure_runtime_role(cloud, "123", poll_interval=0) + original = cloud.call + reads = 0 + + async def call(method, **params): + nonlocal reads + result = await original(method, **params) + if method == "list_attached_role_policies": + reads += 1 + if reads == 1: + for binding in result["AttachedPolicyMetadata"]: + binding["PolicyScope"] = [{"PolicyScopeType": "Project"}] + return result + + cloud.call = call + cloud.calls.clear() + await ensure_runtime_role(cloud, "123", poll_interval=0) + assert len([m for m, _ in cloud.calls if m == "attach_role_policy"]) == 13 diff --git a/tests/integrations/mpa_managed/test_runtime_deployment_edges.py b/tests/integrations/mpa_managed/test_runtime_deployment_edges.py index 36de2c0c4..ff3620189 100644 --- a/tests/integrations/mpa_managed/test_runtime_deployment_edges.py +++ b/tests/integrations/mpa_managed/test_runtime_deployment_edges.py @@ -177,6 +177,111 @@ async def run(): asyncio.run(run()) +@pytest.mark.parametrize("resume", [False, True]) +@pytest.mark.parametrize("explicit", [False, True]) +def test_subnet_permutation_finishes_fresh_or_pending_runtime_without_duplicates( + resume, explicit +): + async def run(): + svc, registry, cloud, databases = deployer() + subnets = ["subnet-one", "subnet-two"] + cloud.network.subnet_rows["subnet-two"] = cloud.network.subnet_row( + "subnet-two", "vpc-one" + ) + cloud.network.subnet_rows["subnet-two"]["zone_id"] = "cn-beijing-b" + registry.network.row = {"vpc_id": "vpc-one", "subnet_ids": subnets.copy()} + payload = template() + payload["NetworkConfiguration"] = ( + { + "VpcConfiguration": { + "VpcId": "vpc-one", + "SubnetIds": subnets.copy(), + } + } + if explicit + else {} + ) + before = copy.deepcopy(payload) + create = cloud.create + + async def reordered_create(request): + rid = await create(request) + private = cloud.runtimes[rid]["NetworkConfigurations"][0] + private["VpcConfiguration"] = { + **private["VpcConfiguration"], + "SubnetIds": list(reversed(subnets)), + } + return rid + + cloud.create = reordered_create + digest, token = None, None + if resume: + get = cloud.get + cloud.get = AsyncMock(side_effect=TimeoutError("platform read interrupted")) + with pytest.raises(TimeoutError): + await svc.deploy(payload) + cloud.get = get + assert registry.row["pending"] and registry.row["runtime_id"] == "r-agent" + digest = registry.row["request_hash"] + token = registry.row["client_token"] + changed = copy.deepcopy(payload) + changed["ArtifactUrl"] = "different:image" + with pytest.raises(DeploymentError, match="unfinished"): + await svc.deploy(changed) + result = await svc.deploy(payload) + assert result["runtime_id"] == "r-agent" and result["state"] == "ready" + assert not registry.row["pending"] + assert len(cloud.creates) == len(cloud.updates) == len(cloud.space_creates) == 1 + assert not cloud.network.calls + assert databases.seeded[-1] == (result["database_name"], "agent-one", "r-agent") + env = mod.env_map(cloud.runtimes["r-agent"]) + assert env["AGENTKIT_RUNTIME_ID"] == "r-agent" + assert env["A2A_PUBLIC_URL"] == "https://public.example" + assert env["CODEX_MCP_RUNTIME_API_KEY"] == "runtime-key" + assert registry.network.row["subnet_ids"] == subnets + assert payload == before + if resume: + assert registry.row["request_hash"] == digest + assert registry.row["client_token"] == token + + asyncio.run(run()) + + +@pytest.mark.parametrize( + "subnets", + [ + ["subnet-one"], + ["subnet-one", "subnet-other"], + ["subnet-one", "subnet-two", "subnet-other"], + ["subnet-one", "subnet-two", "subnet-two"], + [], + "subnet-one", + ["subnet-one", None], + ], +) +def test_runtime_validation_rejects_changed_or_invalid_subnet_members(subnets): + payload = template() + payload["NetworkConfiguration"]["VpcConfiguration"]["SubnetIds"] = [ + "subnet-one", + "subnet-two", + ] + runtime = { + "RoleName": payload["RoleName"], + "Envs": payload["Envs"] + [{"Key": "PGDATABASE", "Value": "test_db"}], + "NetworkConfigurations": [ + {"NetworkType": "public"}, + { + "NetworkType": "private", + "VpcConfiguration": {"VpcId": "vpc-one", "SubnetIds": subnets}, + }, + ], + } + with pytest.raises(DeploymentError, match="migration"): + mod.validate_runtime( + runtime, agent_id="agent-one", database="test_db", template=payload + ) + + def test_deployment_rejects_incomplete_network_before_creating_resources(): async def run(): svc, registry, cloud, _ = deployer() diff --git a/tests/integrations/mpa_managed/test_service.py b/tests/integrations/mpa_managed/test_service.py index 28ca0ba49..10d332906 100644 --- a/tests/integrations/mpa_managed/test_service.py +++ b/tests/integrations/mpa_managed/test_service.py @@ -40,8 +40,15 @@ @pytest.mark.parametrize("split_workspaces", [False, True]) @pytest.mark.parametrize("openviking", [False, True]) @pytest.mark.parametrize("studio_runtime_owner", [None, "studio-user"]) +@pytest.mark.parametrize("runtime_name", ["", "Support-Agent_01"]) def test_network_gateway_worker_precede_runtime( - monkeypatch, source, image, split_workspaces, openviking, studio_runtime_owner + monkeypatch, + source, + image, + split_workspaces, + openviking, + studio_runtime_owner, + runtime_name, ): async def run(): entry = Registry() @@ -75,6 +82,7 @@ async def run(): OPENVIKING_USER="old-user", OPENVIKING_EXTRA="old-extra", ) + assert profile.template is not None profile.template["Envs"].extend( [ { @@ -134,8 +142,13 @@ async def run(): monkeypatch.setattr(service, "AgentDeploymentRegistry", lambda url: entry) databases = Databases() monkeypatch.setattr(service, "AgentDatabaseProvisioner", lambda **kw: databases) - cloud._credentials = lambda: SimpleNamespace( - access_key_id="ak", secret_access_key="sk", session_token="token" + monkeypatch.setattr( + cloud, + "_credentials", + lambda: SimpleNamespace( + access_key_id="ak", secret_access_key="sk", session_token="token" + ), + raising=False, ) monkeypatch.setattr( service, "IdentityClient", lambda **kw: SimpleNamespace(), raising=False @@ -170,15 +183,28 @@ async def ensure(self, **kw): async def worker(*a, **kw): assert events == ["identity", "gateway"] + assert kw["runtime_name"] == runtime_name + assert kw["agent_id"] == "mi-123456789abc" events.append("worker") return "t-one" + monkeypatch.setattr( + service, + "GatewayCloud", + lambda _: SimpleNamespace( + available_zones=AsyncMock(return_value=["cn-beijing-a", "cn-beijing-c"]) + ), + ) monkeypatch.setattr(service, "SharedAPIGService", Gateway) monkeypatch.setattr(service, "ensure_worker", worker) cloud_create = cloud.create async def create(request): assert events == ["identity", "gateway", "worker"] + assert request["Name"] == (runtime_name or "mi-123456789abc") + assert cloud.space_creates[0]["Description"] == ( + "Skills for MPA agent " + (runtime_name or "mi-123456789abc") + ) assert request["ToolId"] == "t-one" runtime_tags = { item["Key"]: item["Value"] for item in request.get("Tags", []) @@ -255,9 +281,9 @@ async def create(request): agent_id="mi-123456789abc", owner="owner-hash-a", studio_runtime_owner=studio_runtime_owner, - runtime_name="support-agent", + runtime_name=runtime_name, ) - assert cloud.creates[0]["Name"] == "support-agent" + assert cloud.creates[0]["Name"] == (runtime_name or "mi-123456789abc") assert result["runtime_id"] == "r-agent" assert result["gateway_id"] == "gw-one" assert cloud.runtimes[result["runtime_id"]]["ToolId"] == "t-one" @@ -360,6 +386,15 @@ def databases_factory(**kwargs): monkeypatch.setattr(service, "AgentDatabaseProvisioner", databases_factory) gateway = AsyncMock() gateway.ensure.return_value = {"gateway_id": "gw-shared"} + monkeypatch.setattr( + service, + "GatewayCloud", + lambda _: SimpleNamespace( + available_zones=AsyncMock( + return_value=["cn-beijing-a", "cn-beijing-c"] + ) + ), + ) monkeypatch.setattr(service, "SharedAPIGService", lambda **kw: gateway) monkeypatch.setattr( service, "ensure_worker", AsyncMock(return_value="t-one") @@ -607,3 +642,131 @@ def test_effective_scaling_conflict_fails_before_provisioning(settings, source_v with pytest.raises(ConfigurationError, match="instance"): service.apply_runtime_settings(source_values, Runtime.model_validate(settings)) + + +@pytest.mark.asyncio +async def test_explicit_profile_account_mismatch_stops_before_role(monkeypatch): + from veadk.integrations.mpa.managed.config import load_studio_profile + + monkeypatch.setenv("VEADK_MPA_CONFIG_MODEL_AGENT_API_KEY", "test-model-key") + profile = load_studio_profile() + profile.values["account_id"] = "expected-account" + cloud = AsyncMock() + cloud.account_id.return_value = "different-account" + monkeypatch.setattr(service, "RuntimeCloud", lambda **kw: cloud) + role = AsyncMock() + identity = AsyncMock() + monkeypatch.setattr(service, "ensure_runtime_role", role) + monkeypatch.setattr(service, "ensure_workload_identity", identity) + stages = [] + with pytest.raises(DeploymentError, match="expected account"): + await service.provision( + profile, agent_id="mi-test", owner="user", progress=stages.append + ) + assert stages == ["checking"] + role.assert_not_awaited() + identity.assert_not_awaited() + + +@pytest.mark.parametrize("role", [None, "custom-role"]) +def test_fresh_template_role_trn_uses_verified_account_and_selected_role( + monkeypatch, role +): + from veadk.integrations.mpa.managed.config import load_studio_profile + + monkeypatch.setenv("VEADK_MPA_CONFIG_MODEL_AGENT_API_KEY", "test-model-key") + profile = load_studio_profile() + profile.values.update(pg_host="db.example", pg_user="test", pg_password="test") + profile.managed.runtime.role_name = role + selected_role = role or "IDRoleForArkClawShareAgent" + request = service.fresh_template(profile, "mi-123456789abc", "verified-account") + service.apply_runtime_settings(request, profile.managed.runtime) + env = service.env_map(request) + assert request["RoleName"] == selected_role + assert env["CLAW_SPACE_ID"] == "csi-verified-account" + assert env["RUNTIME_IAM_ROLE_NAME"] == selected_role + assert ( + env["RUNTIME_IAM_ROLE_TRN"] == f"trn:iam::verified-account:role/{selected_role}" + ) + profile.managed.runtime.env["RUNTIME_IAM_ROLE_TRN"] = "explicit-trn" + service.apply_runtime_settings(request, profile.managed.runtime) + assert service.env_map(request)["RUNTIME_IAM_ROLE_TRN"] == "explicit-trn" + + +@pytest.mark.asyncio +async def test_existing_runtime_keeps_network_when_new_standard_gateway_needs_companion( + monkeypatch, +): + import copy + + entry = Registry() + entry.row = {"runtime_id": "r-existing", "studio_owner": "owner"} + entry.network.row = {"vpc_id": "vpc-one", "subnet_ids": ["subnet-one"]} + cloud = Cloud(entry) + original = template()["NetworkConfiguration"] + original["VpcConfiguration"]["EnableSharedInternetAccess"] = True + cloud.runtimes["r-existing"] = { + "RuntimeId": "r-existing", + "NetworkConfigurations": [ + {"NetworkType": "public"}, + { + "NetworkType": "private", + "VpcConfiguration": copy.deepcopy(original["VpcConfiguration"]), + }, + ], + } + profile = Profile( + region="cn-beijing", + values={}, + template=template(), + admin_url="fake", + shared_url="postgresql://registry.example/shared", + managed=Managed( + version=1, + runtime=Runtime(), + worker=Worker(existing_id="t-one"), + timeout_seconds=60, + ), + ) + gateway = AsyncMock() + gateway.ensure.return_value = {"gateway_id": "gw-one"} + deploy = AsyncMock(return_value={"runtime_id": "r-existing"}) + monkeypatch.setattr(service, "RuntimeCloud", lambda **kw: cloud) + monkeypatch.setattr(service, "AgentDeploymentRegistry", lambda _: entry) + monkeypatch.setattr(service, "AgentDatabaseProvisioner", lambda **kw: Databases()) + monkeypatch.setattr( + service, + "ensure_workload_identity", + AsyncMock( + return_value=SimpleNamespace( + workload_pool_name="pool", workload_identity_name="identity" + ) + ), + ) + monkeypatch.setattr(service, "ensure_worker", AsyncMock(return_value="t-one")) + monkeypatch.setattr( + service, + "GatewayCloud", + lambda _: SimpleNamespace( + available_zones=AsyncMock(return_value=["cn-beijing-a", "cn-beijing-c"]) + ), + ) + monkeypatch.setattr(service, "SharedAPIGService", lambda **kw: gateway) + monkeypatch.setattr( + service, "AgentRuntimeDeployer", lambda **kw: SimpleNamespace(deploy=deploy) + ) + await service.provision(profile, agent_id="mi-existing", owner="owner") + assert deploy.await_args is not None + assert ( + deploy.await_args.args[0]["NetworkConfiguration"]["VpcConfiguration"] + == original["VpcConfiguration"] + ) + assert gateway.ensure.await_args.kwargs["subnet_ids"] == [ + "subnet-one", + "subnet-auto", + ] + assert entry.network.row["subnet_ids"] == ["subnet-one", "subnet-auto"] + assert ( + cloud.runtimes["r-existing"]["NetworkConfigurations"][1]["VpcConfiguration"] + == original["VpcConfiguration"] + ) diff --git a/tests/integrations/mpa_managed/test_studio_shared_resources.py b/tests/integrations/mpa_managed/test_studio_shared_resources.py index 44a305f57..348b258db 100644 --- a/tests/integrations/mpa_managed/test_studio_shared_resources.py +++ b/tests/integrations/mpa_managed/test_studio_shared_resources.py @@ -47,7 +47,8 @@ async def test_studio_creates_missing_shared_resources_then_reuses_admin_registr ): monkeypatch.setenv("VEADK_MPA_CONFIG_MODEL_AGENT_API_KEY", "test-model-key") profile = load_studio_profile(region="cn-beijing") - profile.values["account_id"] = "account" + prepare_role = AsyncMock() + monkeypatch.setattr(service, "ensure_runtime_role", prepare_role) assert profile.managed.postgres is not None profile.managed.postgres.bootstrap_path = str(tmp_path / "bootstrap.sqlite3") pg = FakePG() @@ -59,6 +60,7 @@ async def test_studio_creates_missing_shared_resources_then_reuses_admin_registr network_entry = NetworkEntry() gateways = GatewayRegistry() gateway_cloud = GatewayCloud(account="account") + gateway_cloud.available_zones = AsyncMock(wraps=gateway_cloud.available_zones) scope = ("account", profile.region) if existing in {"network", "both"}: network_entry.row = {"vpc_id": "vpc-one", "subnet_ids": ["subnet-one"]} @@ -87,7 +89,12 @@ async def test_studio_creates_missing_shared_resources_then_reuses_admin_registr registry_urls = [] runtime_networks = [] expected_vpc = "vpc-auto" if existing == "none" else "vpc-one" - expected_subnet = "subnet-auto" if existing == "none" else "subnet-one" + expected_subnets = { + "none": ["subnet-auto", "subnet-auto-2"], + "network": ["subnet-one", "subnet-auto"], + "gateway": ["subnet-one"], + "both": ["subnet-one"], + }[existing] for agent_id in ("mi-000000000001", "mi-000000000002"): entry = Registry() entry.network = network_entry @@ -115,6 +122,13 @@ def database_factory(**kwargs): assert entry.row["business_workspace_id"] == "ws-2" runtime_networks.append(cloud.creates[0]["NetworkConfiguration"]) runtime_env = service.env_map(cloud.creates[0]) + assert prepare_role.await_args is not None + assert prepare_role.await_args.args[1] == "account" + assert runtime_env["CLAW_SPACE_ID"] == "csi-account" + assert runtime_env["RUNTIME_IAM_ROLE_NAME"] == "IDRoleForArkClawShareAgent" + assert runtime_env["RUNTIME_IAM_ROLE_TRN"] == ( + "trn:iam::account:role/IDRoleForArkClawShareAgent" + ) assert runtime_env["MPA_WORKLOAD_POOL_NAME"] == "agentkit-studio-workload" assert runtime_env["MPA_WORKLOAD_IDENTITY_NAME"] == f"{agent_id}-studio" runtime_registry = make_url(runtime_env["SHARED_APIG_DATABASE_URL"]) @@ -126,18 +140,23 @@ def database_factory(**kwargs): assert pg.created == 2 assert initialize_identity.await_count == 2 assert initialize.await_count == 2 + assert gateway_cloud.available_zones.await_count == ( + 0 if existing in {"gateway", "both"} else 1 + ) assert len(set(registry_urls)) == 1 assert make_url(registry_urls[0]).host == "ws-1.example" assert make_url(registry_urls[0]).database == "mpa_admin_db" assert network_entry.row["vpc_id"] == expected_vpc - assert network_entry.row["subnet_ids"] == [expected_subnet] + assert network_entry.row["subnet_ids"] == expected_subnets assert gateways.rows[scope]["vpc_id"] == expected_vpc assert gateways.rows[scope]["im_gateway_service_id"] == "service-1" assert gateways.rows[scope]["state"] == "ready" assert runtime_networks[0] == runtime_networks[1] assert runtime_networks[0]["VpcConfiguration"]["VpcId"] == expected_vpc assert [kind for kind, _ in network.calls] == ( - ["vpc", "subnet"] if existing == "none" else [] + ["vpc", "subnet", "subnet"] + if existing == "none" + else (["subnet"] if existing == "network" else []) ) assert ( gateway_cloud.created diff --git a/tests/integrations/mpa_managed/test_tasks.py b/tests/integrations/mpa_managed/test_tasks.py index f65ccde8e..55f32266e 100644 --- a/tests/integrations/mpa_managed/test_tasks.py +++ b/tests/integrations/mpa_managed/test_tasks.py @@ -481,3 +481,37 @@ async def started(): pass asyncio.run(run()) + + +@pytest.mark.parametrize( + "key,expected", + [ + ("iamPermissionDenied", "iamPermissionDenied"), + ("private-provider-text", "creationFailed"), + ], +) +def test_only_allowlisted_iam_failure_keys_reach_ui(tmp_path, key, expected): + import json + + async def run(): + service = CreationTasks(tmp_path / "tasks.sqlite3") + events = [{"stage": "iam_role"}, {"error": key}] + code = ";".join( + f"print({'MPA_EVENT ' + json.dumps(event)!r})" for event in events + ) + service.command = lambda: [sys.executable, "-c", code + ";raise SystemExit(1)"] + payload = { + "requestId": "44444444-4444-4444-8444-444444444444", + "agentId": "mi-test", + "description": "", + "region": "cn-beijing", + } + task = await service.start("owner", payload, config_path="unused", timeout=60) + await asyncio.gather(*service.running.values()) + result = service.get("owner", task["taskId"]) + assert result["state"] == "failed" + assert result["stage"] == "iam_role" + assert result["error"] == expected + await service.close() + + asyncio.run(run()) diff --git a/tests/integrations/mpa_managed/test_worker.py b/tests/integrations/mpa_managed/test_worker.py index c6086baf2..7d0068b93 100644 --- a/tests/integrations/mpa_managed/test_worker.py +++ b/tests/integrations/mpa_managed/test_worker.py @@ -20,7 +20,8 @@ import pytest from tests.integrations.mpa_managed.test_agent_deployment import Registry -from veadk.integrations.mpa.managed.config import Worker +from veadk.integrations.mpa.managed.config import Worker, load_studio_profile +from veadk.integrations.mpa.managed.config import ConfigurationError from veadk.integrations.mpa.managed.database import DeploymentError, agent_suffix from veadk.integrations.mpa.managed.worker import ( WorkerCloud, @@ -29,6 +30,109 @@ ) +def test_studio_worker_creation_needs_no_reference_in_new_account(monkeypatch): + monkeypatch.setenv("VEADK_MPA_CONFIG_MODEL_AGENT_API_KEY", "test-model-key") + profile = load_studio_profile() + + async def run(): + cloud = AsyncMock() + cloud.get.side_effect = AssertionError("unexpected reference lookup") + cloud.find.return_value = [] + cloud.create.side_effect = DeploymentError("request captured") + registry = Registry() + with pytest.raises(DeploymentError, match="request captured"): + await ensure_worker( + registry, + cloud, + profile.managed.worker, + account="new-account", + region="cn-beijing", + agent_id="mi-new-agent", + ) + cloud.get.assert_not_awaited() + request = cloud.create.call_args.args[0] + env = {item["Key"]: item["Value"] for item in request["Envs"]} + assert env == {"MPA_AGENT_ID": "mi-new-agent"} + assert request["Port"] == 8000 + assert request["ImageUrl"] == profile.managed.worker.image + assert request["RoleName"] == profile.managed.worker.role_name + assert "test-model-key" not in json.dumps(request) + assert "Envs" not in registry.row + assert "env" not in registry.row + assert "MPA_AGENT_ID" not in profile.managed.worker.env + + asyncio.run(run()) + + +def test_worker_explicit_environment_overrides_reference_without_mutation(): + async def run(): + source = { + "Envs": [ + {"Key": "SETTING", "Value": "inherited"}, + {"Key": "KEEP", "Value": "keep"}, + {"Key": "MPA_AGENT_ID", "Value": "old-agent"}, + {"Key": "FEISHU_APP_SECRET", "Value": "old-secret"}, + {"Key": "SHARED_APIG_DATABASE_URL", "Value": "old-control-url"}, + ] + } + before = json.dumps(source) + cloud = AsyncMock() + cloud.get.return_value = source + cloud.find.return_value = [] + cloud.create.side_effect = DeploymentError("request captured") + options = Worker( + image="worker:v1", reference_id="t-reference", env={"SETTING": "explicit"} + ) + with pytest.raises(DeploymentError, match="request captured"): + await ensure_worker( + Registry(), cloud, options, account="a", region="r", agent_id="agent" + ) + cloud.get.assert_awaited_once_with("t-reference") + request = cloud.create.call_args.args[0] + assert {item["Key"]: item["Value"] for item in request["Envs"]} == { + "SETTING": "explicit", + "KEEP": "keep", + "MPA_AGENT_ID": "agent", + } + assert options.env == {"SETTING": "explicit"} + assert json.dumps(source) == before + + asyncio.run(run()) + + +def test_unfinished_worker_environment_preserves_token_and_rejects_changes(): + async def run(): + registry = Registry() + cloud = AsyncMock() + cloud.find.return_value = [] + cloud.create.side_effect = DeploymentError("response lost") + options = Worker(image="worker:v1", env={"SETTING": "original"}) + for _ in range(2): + with pytest.raises(DeploymentError, match="response lost"): + await ensure_worker( + registry, cloud, options, account="a", region="r", agent_id="agent" + ) + assert cloud.create.call_args_list[0] == cloud.create.call_args_list[1] + cloud.reset_mock() + token, digest = registry.row["worker_token"], registry.row["worker_hash"] + with pytest.raises(DeploymentError, match="configuration changed"): + await ensure_worker( + registry, + cloud, + Worker(image="worker:v1", env={"SETTING": "changed"}), + account="a", + region="r", + agent_id="agent", + ) + cloud.find.assert_not_awaited() + cloud.create.assert_not_awaited() + assert registry.row["worker_token"] == token + assert registry.row["worker_hash"] == digest + assert "original" not in json.dumps(registry.row) + + asyncio.run(run()) + + @pytest.mark.parametrize("agent_id", ["mi-example-id", " mi-example-id "]) def test_new_worker_uses_agent_derived_name(agent_id): async def run(): @@ -57,6 +161,215 @@ async def run(): asyncio.run(run()) +@pytest.mark.parametrize("name", [" Support-Agent_01 ", "a" * 64]) +def test_named_worker_preserves_entered_name_and_internal_bindings(name): + async def run(): + cloud = AsyncMock() + cloud.find.return_value = [] + cloud.create.side_effect = DeploymentError("request captured") + registry = Registry() + with pytest.raises(DeploymentError, match="request captured"): + await ensure_worker( + registry, + cloud, + Worker(image="worker:v1"), + account="a", + region="r", + agent_id="mi-internal", + runtime_name=name, + ) + request = cloud.create.call_args.args[0] + assert request["Name"] == name.strip() + cloud.find.assert_awaited_once_with(name.strip()) + assert registry.row["worker_name"] == name.strip() + assert {item["Key"]: item["Value"] for item in request["Envs"]} == { + "MPA_AGENT_ID": "mi-internal", + } + assert {item["Key"]: item["Value"] for item in request["Tags"]}[ + "mpa_agent_key" + ] == agent_suffix("a", "r", "mi-internal") + + asyncio.run(run()) + + +@pytest.mark.parametrize("name", ["abc", "a" * 65, "bad/name", "中文名称"]) +def test_invalid_worker_name_fails_before_cloud_calls(name): + async def run(): + cloud = AsyncMock() + with pytest.raises(ConfigurationError): + await ensure_worker( + Registry(), + cloud, + Worker(image="worker:v1"), + account="a", + region="r", + agent_id="mi-internal", + runtime_name=name, + ) + cloud.get.assert_not_awaited() + cloud.find.assert_not_awaited() + cloud.create.assert_not_awaited() + + asyncio.run(run()) + + +@pytest.mark.parametrize("previous_name", ["mi_internal", "mpa_worker_hash"]) +@pytest.mark.parametrize("discovered", [False, True]) +@pytest.mark.parametrize("changed_image", [False, True]) +def test_named_worker_replays_pre_upgrade_name( + previous_name, discovered, changed_image +): + async def run(): + from tests.integrations.mpa_managed.test_worker_recovery import ready + + registry = Registry() + cloud = AsyncMock() + cloud.find.return_value = [] + cloud.create.side_effect = DeploymentError("response lost") + options = Worker(image="worker:v1") + with pytest.raises(DeploymentError, match="response lost"): + await ensure_worker( + registry, + cloud, + options, + account="a", + region="r", + agent_id="agent", + runtime_name="Support-Agent_01", + ) + previous = dict(cloud.create.call_args.args[0]) + token = previous.pop("ClientToken") + previous["Name"] = ( + "agent" + if previous_name == "mi_internal" + else "mpa_worker_" + agent_suffix("a", "r", "agent") + ) + registry.row.pop("worker_name") + registry.row["worker_hash"] = hashlib.sha256( + json.dumps(previous, sort_keys=True).encode() + ).hexdigest() + cloud.reset_mock() + cloud.find.return_value = [ready()] if discovered else [] + cloud.create.side_effect = None + cloud.create.return_value = "t-test" + cloud.get.return_value = ready() + if changed_image: + with pytest.raises(DeploymentError, match="configuration changed"): + await ensure_worker( + registry, + cloud, + Worker(image="worker:v2"), + account="a", + region="r", + agent_id="agent", + runtime_name="Support-Agent_01", + ) + cloud.find.assert_not_awaited() + cloud.create.assert_not_awaited() + else: + if not discovered: + cloud.create.side_effect = DeploymentError("response lost") + for _ in range(2): + with pytest.raises(DeploymentError, match="response lost"): + await ensure_worker( + registry, + cloud, + options, + account="a", + region="r", + agent_id="agent", + runtime_name="Support-Agent_01", + ) + assert cloud.create.call_args.args[0] == { + **previous, + "ClientToken": token, + } + assert "worker_name" not in registry.row + cloud.reset_mock() + cloud.create.side_effect = None + assert ( + await ensure_worker( + registry, + cloud, + options, + account="a", + region="r", + agent_id="agent", + runtime_name="Support-Agent_01", + ) + == "t-test" + ) + cloud.find.assert_awaited_once_with(previous["Name"]) + if discovered: + cloud.create.assert_not_awaited() + else: + cloud.create.assert_awaited_once_with( + {**previous, "ClientToken": token} + ) + assert registry.row["worker_token"] == token + + asyncio.run(run()) + + +def test_named_pending_worker_retries_exact_request_and_rejects_name_change(): + async def run(): + registry = Registry() + cloud = AsyncMock() + cloud.find.return_value = [] + cloud.create.side_effect = DeploymentError("response lost") + for _ in range(2): + with pytest.raises(DeploymentError, match="response lost"): + await ensure_worker( + registry, + cloud, + Worker(image="worker:v1"), + account="a", + region="r", + agent_id="mi-internal", + runtime_name="Support-Agent_01", + ) + assert cloud.create.call_args_list[0] == cloud.create.call_args_list[1] + token, digest = registry.row["worker_token"], registry.row["worker_hash"] + cloud.reset_mock() + for name in ["changed-name", "mi_internal", ""]: + with pytest.raises(DeploymentError, match="configuration changed"): + await ensure_worker( + registry, + cloud, + Worker(image="worker:v1"), + account="a", + region="r", + agent_id="mi-internal", + runtime_name=name, + ) + cloud.find.assert_not_awaited() + cloud.create.assert_not_awaited() + assert registry.row["worker_token"] == token + assert registry.row["worker_hash"] == digest + + asyncio.run(run()) + + +def test_unrelated_tool_with_entered_name_is_not_adopted(): + async def run(): + cloud = AsyncMock() + cloud.find.return_value = [{"ToolId": "t-unrelated", "Name": "support-agent"}] + with pytest.raises(DeploymentError, match="name collision"): + await ensure_worker( + Registry(), + cloud, + Worker(image="worker:v1"), + account="a", + region="r", + agent_id="mi-internal", + runtime_name="support-agent", + ) + cloud.create.assert_not_awaited() + cloud.get.assert_not_awaited() + + asyncio.run(run()) + + @pytest.mark.parametrize("discovered", [False, True]) @pytest.mark.parametrize("changed_image", [False, True]) def test_unfinished_legacy_worker_retains_request_and_token(discovered, changed_image): @@ -76,6 +389,7 @@ async def run(): previous_request = dict(cloud.create.call_args.args[0]) token = previous_request.pop("ClientToken") previous_request["Name"] = "mpa_worker_" + agent_suffix("a", "r", "agent") + registry.row.pop("worker_name") registry.row["worker_hash"] = hashlib.sha256( json.dumps(previous_request, sort_keys=True).encode() ).hexdigest() @@ -128,7 +442,13 @@ async def run(): ) assert ( await ensure_worker( - registry, cloud, options, account="a", region="r", agent_id="agent" + registry, + cloud, + options, + account="a", + region="r", + agent_id="agent", + runtime_name="Support-Agent_01", ) == "t-test" ) diff --git a/veadk/cli/frontend_deploy_policy.py b/veadk/cli/frontend_deploy_policy.py index 6a122459c..2c03649d3 100644 --- a/veadk/cli/frontend_deploy_policy.py +++ b/veadk/cli/frontend_deploy_policy.py @@ -69,6 +69,7 @@ "apig:ListGateways", "apig:CreateGateway", "apig:GetGateway", + "apig:GetGatewayAvailableZones", "apig:CreateIMChannelGateway", "apig:GetIMChannelGatewayStatus", "apmplus_server:CreateOrder", @@ -125,6 +126,7 @@ "iam:AttachRolePolicy", "iam:CheckServiceLinkedRole", "iam:CreateRole", + "iam:CreatePolicy", "iam:CreateServiceLinkedRole", "iam:DeleteRole", "iam:DetachRolePolicy", diff --git a/veadk/integrations/mpa/managed/README.md b/veadk/integrations/mpa/managed/README.md index 867714f24..889daa7f5 100644 --- a/veadk/integrations/mpa/managed/README.md +++ b/veadk/integrations/mpa/managed/README.md @@ -49,12 +49,23 @@ Gateway resources are created and saved before Runtime deployment. Later agents reuse the same records. Account locks and saved creation intents protect concurrent requests and retries from duplicate creation. +New gateways use the standard type with two 1c2g nodes, small_1 CLB, public/private +access and traffic billing. Deployment credentials need `apig:GetGatewayAvailableZones`. +The service queries APIG-supported zones and reuses or creates two same-VPC subnets +in different supported zones; missing companions have independently persisted +requests/tokens. Existing registered/adopted gateways and Runtime network selections +are preserved. New Runtimes use the prepared selection. `ExceededQuota` is a definite +rejection and permits retry after correction; unknown outcomes still require +discovery. Historical unknown flags require an audited, scoped repair. + Existing records are retained, including previously adopted resources. This change does not move existing agents or replace an exhausted VPC. A quota or permission error remains a failure; increasing quota or migrating the shared network is a separate operation. Restart local Studio (or redeploy cloud Studio) to load the updated defaults. Explicit CLI network/APIG adoption remains supported. +Runtime subnet IDs may be returned in a different order by AgentKit. An identical unique selection is accepted during creation and retry; real membership/VPC/shared-egress changes remain migration errors. Retry preserves the original requested or matching registered order, including existing pending request hashes. After updating VeADK, use the same agent ID and original inputs to resume a task stopped by this ordering mismatch; do not delete records or recreate resources. + ## CLI YAML and manual / legacy server setup 1. Copy the [example YAML](../../../../prd-spec/features/mpa-agent-oneclick-provision/mpa-create.config.example.yaml) to a private `mpa-create.config.yaml`. Keep filled-in configuration outside Git. @@ -229,4 +240,34 @@ Flat creation defaults to `ENABLE_A2A=true` and `DISABLE_JWT_AUTH=true`. The inn ### Managed sandbox template naming -New managed sandbox templates use the trimmed agent ID with every `-` replaced by `_` (for example, `mi-example` → `mi_example`). Existing worker IDs remain authoritative and are never renamed. A pre-change unfinished creation intent retains its hashed name only when the complete legacy request matches the persisted worker_hash; its ClientToken is preserved. Other payload changes and unrelated same-name resources remain errors. Scoped ownership tags and Runtime ToolId bindings are unchanged. +New named Studio requests use the entered, validated Runtime name unchanged as the sandbox template Name (4–64 ASCII letters, digits, hyphens or underscores). Legacy CLI requests without a name still use the trimmed agent ID with `-` replaced by `_`. Internal agent IDs, database/Skill Space/channel identities, scoped ownership tags and Runtime ToolId bindings are unchanged. Existing worker IDs are authoritative and are never renamed. New pending intents persist `worker_name` in deployment JSON and reject later name changes. Older pending intents without that field replay a normalized-ID or hashed name only when the complete candidate payload matches the persisted worker_hash, preserving ClientToken. Other payload changes and unrelated same-name resources remain errors. + +### Automatic MPA runtime role + +Built-in Studio prepares `IDRoleForArkClawShareAgent` in the verified deployment account before preparing resources. It reuses a compatible role and adds missing approved policy bindings; it never replaces trust or policy contents. Explicit CLI profiles default to `managed.iam.mode: existing`; `auto` opts in for fresh default-role configurations only. See the [permission baseline and recovery rules](../../../../prd-spec/features/mpa-runtime-iam/2026-10-09-managed-runtime-role.md). The Studio execution role needs `iam:CreatePolicy` in addition to GetRole/CreateRole/GetPolicy/ListAttachedRolePolicies/AttachRolePolicy. Redeploy or update an existing Studio execution policy before using this capability. Retry the same agent ID after administrator repair; cancellation retains shared IAM resources. + +### Deployment account in Studio + +Studio uses the account returned by deployment-credential STS verification; it no longer requires the original image-registry account. Role TRN and compatibility Space ID for a fresh Runtime use the verified account. Explicit YAML `account-id` still restricts CLI deployments. Default image URLs and Worker reference IDs are unchanged; ensure the deployment account can access them or supply accessible resources. Existing Runtimes are not automatically migrated. + +Managed network descriptions use the provider-compatible `mpa-account-network-v1-`. Retry automatically corrects a legacy description-only intent after a definite rejection when no resource exists; changed payloads receive a new token. Existing scoped resources are retained. Uncertain outcomes require discovery and never trigger a duplicate create. + +### Worker without a reference template + +Built-in Studio uses startup settings supplied by the configured Worker image, without duplicate port/mode/directory environment entries; it no longer reads a Tool from the previous account. The image must still be accessible to the deployment account. Restart Studio to load changed defaults, then retry an agent that failed before Worker creation. Already dispatched requests retain their original payload/token; do not reset their registry intent. + +For a private CLI profile, configure startup values directly: + +```yaml +managed: + worker: + image: registry.example/agentkit/mpa_codex_worker:release-tag + env: + MPA_RUNTIME_PROFILE: codex-headless + MPA_AIO_ENTRYPOINT_MODE: minimal + CUSTOM_SETTING: ${WORKER_CUSTOM_SETTING} +``` + +`managed.worker.env` accepts uppercase string keys and whole server environment references. It overrides filtered environment values from an optional accessible `reference-id`. Agent/Runtime/Tool/Skill Space bindings, inherited channel/Runtime credentials and control database URLs are reserved. A missing explicit reference remains an error. Environment settings with `existing-id` are rejected because existing Tools are not updated. Secrets do not enter config summaries/repr or deployment records; use server references rather than committing values. Model credentials are delivered per session by Runtime, not copied from the old Tool. + +New named MPA deployments use `Skills for MPA agent ` as the Skill Space description, so the entered name is visible in the cloud console. The generated space Name, display_name tag, internal agent ID and bindings stay unchanged. Existing spaces keep their descriptions; pre-upgrade pending requests recover their exact original description, while other input changes remain errors. Calls without a Runtime name retain the internal-ID description. diff --git a/veadk/integrations/mpa/managed/README.zh.md b/veadk/integrations/mpa/managed/README.zh.md index 4df50fc05..77343e615 100644 --- a/veadk/integrations/mpa/managed/README.zh.md +++ b/veadk/integrations/mpa/managed/README.zh.md @@ -47,10 +47,19 @@ Studio 不固定已有 VPC/子网/APIG ID。准备 PostgreSQL 后,按核验后 在部署 Runtime 前创建并保存,后续智能体复用相同记录。账号锁和持久化创建意图 保护并发请求及重试,避免重复创建。 +新网关采用标准型、两个 1c2g 节点、small_1 CLB、公私网接入和 traffic 计费。 +部署凭据需要 `apig:GetGatewayAvailableZones`。服务查询 APIG 支持的可用区, +复用或创建同 VPC、不同受支持可用区的两个子网;缺失的伴随子网独立保存请求/token。 +保留已有登记/接管网关和 Runtime 网络选择,新 Runtime 使用准备好的子网。 +`ExceededQuota` 是明确拒绝,修正后可重试;未知结果仍须先查询恢复。 +历史未知标记需经过审计、限定范围后修复。 + 已有记录(包括此前接管的资源)保持不变。本次不迁移已有智能体,也不替换配额 耗尽的 VPC。配额或权限错误仍报告失败;提高配额或迁移共享网络属于独立操作。 重启本地 Studio(云端则重新部署)后加载新默认配置。CLI 显式网络/APIG 接管仍受支持。 +AgentKit 返回的 Runtime 子网 ID 顺序可能不同。创建和重试接受成员相同且无重复的选择;实际成员、VPC 或共享公网出口变化仍视为迁移错误。重试保留原请求或成员一致的注册顺序,包括已有待完成请求的哈希。更新 VeADK 后,对因顺序误判停止的任务使用同一智能体 ID 和原始输入重试即可;不要删除记录或重建资源。 + ## CLI YAML 与手动 / 旧模式服务端配置 1. 复制[示例 YAML](../../../../prd-spec/features/mpa-agent-oneclick-provision/mpa-create.config.example.yaml) 到私有的 `mpa-create.config.yaml`。填写后的配置不要进入 Git。 @@ -225,4 +234,34 @@ Flat 创建默认设置 `ENABLE_A2A=true` 和 `DISABLE_JWT_AUTH=true`。绕过 ### 托管沙箱模板命名 -新托管沙箱模板使用去掉两端空白、将所有 `-` 替换为 `_` 的智能体 ID(例如 `mi-example` → `mi_example`)。已有 worker ID 仍为权威绑定,不重命名。变更前未完成的创建意图,仅在完整旧请求与已存 worker_hash 匹配时保留哈希名称,并保留 ClientToken。其他请求变更和无关同名资源仍报错。作用域所有权标签及 Runtime ToolId 绑定不变。 +新的 Studio 名称请求直接使用经过校验的手填 Runtime 名称作为沙箱模板 Name(4–64 个 ASCII 字母、数字、连字符或下划线)。未提供名称的旧 CLI 请求仍使用去除首尾空白、将 `-` 替换为 `_` 的智能体 ID。内部智能体 ID、数据库/技能空间/渠道标识、作用域归属标签及 Runtime ToolId 绑定不变。已有 worker ID 为权威绑定,不重命名。新的未完成意图在部署 JSON 中保存 `worker_name`,拒绝后续名称变化。没有该字段的旧意图,仅在完整候选请求与已存 worker_hash 匹配时重放标准化 ID 名称或哈希名称,保留 ClientToken。其他请求变化及无关同名资源仍报错。 + +### 自动准备 MPA 运行角色 + +内置 Studio 在准备资源之前,在核验的部署账号下准备 `IDRoleForArkClawShareAgent`。复用兼容角色并补齐已批准策略绑定,不替换信任或策略内容。显式 CLI 配置默认 `managed.iam.mode: existing`;仅全新默认角色配置可通过 `auto` 启用。参见[权限基线与恢复规则](../../../../prd-spec/features/mpa-runtime-iam/2026-10-09-managed-runtime-role.zh.md)。Studio 执行角色除 GetRole/CreateRole/GetPolicy/ListAttachedRolePolicies/AttachRolePolicy 外,还需 `iam:CreatePolicy`。使用此能力前,重新部署或更新已有 Studio 执行策略。管理员修复后以同一智能体 ID 重试;取消保留共享 IAM 资源。 + +### Studio 部署账号 + +Studio 使用部署凭据经 STS 核验返回的账号,不再要求原镜像仓库账号。新建 Runtime 的角色 TRN 和兼容 Space ID 使用核验账号。显式 YAML 的 `account-id` 仍限制 CLI 部署。默认镜像 URL 和 Worker 参考 ID 保持不变;请确保部署账号可访问它们,或提供可访问的资源。现有 Runtime 不自动迁移。 + +托管网络描述使用符合服务商格式的 `mpa-account-network-v1-`。旧意图仅描述不同且明确被拒绝、无资源时,重试自动修正;变化的请求体使用新 token。保留已有范围资源。结果不确定时必须先查询,不触发重复创建。 + +### 不依赖参考模板的 Worker + +内置 Studio 使用已配置 Worker 镜像提供的启动设置,不重复注入端口/模式/目录环境变量,不再读取旧账号的 Tool。部署账号仍须有镜像访问权限。重启 Studio 加载修改后的默认值,再重试尚未开始 Worker 创建就失败的智能体。已发送请求保留原载荷/token;不要重置注册库中的意图。 + +私有 CLI 配置可以直接指定启动值: + +```yaml +managed: + worker: + image: registry.example/agentkit/mpa_codex_worker:release-tag + env: + MPA_RUNTIME_PROFILE: codex-headless + MPA_AIO_ENTRYPOINT_MODE: minimal + CUSTOM_SETTING: ${WORKER_CUSTOM_SETTING} +``` + +`managed.worker.env` 接受大写字符串键及完整服务端环境变量引用,覆盖可选且可访问 `reference-id` 中已过滤的环境设置。智能体/Runtime/Tool/技能空间绑定、继承的渠道/Runtime 凭据及控制库地址为保留字段。显式参考模板缺失仍报错。`existing-id` 不允许环境设置,因为不会更新已有 Tool。密钥不进入配置摘要/repr 或部署记录;使用服务端引用,不提交实际值。模型凭据由 Runtime 按会话下发,不从旧 Tool 复制。 + +新的名称 MPA 部署使用 `Skills for MPA agent ` 作为技能空间描述,便于在云控制台辨认手填名称。生成的空间 Name、display_name 标签、内部智能体 ID 及绑定保持不变。已有空间保留原描述;升级前待完成请求按原描述准确恢复,其他输入变化仍报错。不提供 Runtime 名称的调用保留内部 ID 描述。 diff --git a/veadk/integrations/mpa/managed/config.py b/veadk/integrations/mpa/managed/config.py index 1b17b7ad7..59e1026e0 100644 --- a/veadk/integrations/mpa/managed/config.py +++ b/veadk/integrations/mpa/managed/config.py @@ -40,6 +40,22 @@ ADMIN_DATABASE_NAME = "mpa_admin_db" ADMIN_WORKSPACE_NAME = "mpa_admin_workspace" +WORKER_RESERVED_ENV_KEYS = frozenset( + { + "MPA_AGENT_ID", + "AGENTKIT_RUNTIME_ID", + "AGENTKIT_TOOL_ID", + "AGENTKIT_TOOL_REGION", + "SKILL_SPACE_ID", + "CODEX_MCP_RUNTIME_API_KEY", + "A2A_PUBLIC_URL", + "FEISHU_APP_ID", + "FEISHU_APP_SECRET", + "CHANNEL_STATE_ENCRYPTION_KEY", + "DEPLOYMENT_DATABASE_ADMIN_URL", + "SHARED_APIG_DATABASE_URL", + } +) STUDIO_MPA_IDENTITY_FIELDS = ( ("VEADK_STUDIO_MPA_USER_POOL_NAME", "user_pool_name", "MPA_USER_POOL_NAME"), ( @@ -197,6 +213,7 @@ class Worker(Options): image: str = "" reference_id: str = "" role_name: str = "IDRoleForArkClawShareAgent" + env: dict[str, str] = Field(default_factory=dict, repr=False) tos_access_key: str = Field(default="", repr=False) tos_secret_key: str = Field(default="", repr=False) tos_bucket: str = "" @@ -210,6 +227,17 @@ def tos_mount_enabled(self) -> bool: def strip_tos_values(cls, value: str) -> str: return value.strip() + @field_validator("env") + @classmethod + def validate_environment(cls, value: dict[str, str]) -> dict[str, str]: + if any( + not re.fullmatch(r"[A-Z_][A-Z0-9_]*", key) + or key in WORKER_RESERVED_ENV_KEYS + for key in value + ): + raise ValueError("Invalid or provisioner-owned worker environment key") + return value + @model_validator(mode="after") def validate_source(self): if bool(self.existing_id) == bool(self.image): @@ -219,6 +247,8 @@ def validate_source(self): raise ValueError("TOS access key, secret key, and bucket are all required") if self.existing_id and all(tos_values): raise ValueError("TOS mount settings require a newly created worker") + if self.existing_id and self.env: + raise ValueError("Environment settings require a newly created worker") return self @@ -317,11 +347,16 @@ def distinct_workspaces(self): return self +class Iam(Options): + mode: Literal["existing", "auto"] = "existing" + + class Managed(Options): version: Literal[1] database_admin_url_env: str = "DEPLOYMENT_DATABASE_ADMIN_URL" shared_database_url_env: str = "SHARED_APIG_DATABASE_URL" postgres: PostgresWorkspaces | None = None + iam: Iam = Field(default_factory=Iam) credential_file: str = "" from_runtime: str = "" template_file: str = "" @@ -335,6 +370,17 @@ class Managed(Options): def validate_source(self): if self.from_runtime and self.template_file: raise ValueError("Choose one template source") + if self.iam.mode == "auto": + from .iam import ROLE_NAME + + if ( + self.from_runtime + or self.template_file + or self.worker.existing_id + or self.worker.role_name != ROLE_NAME + or self.runtime.role_name not in (None, ROLE_NAME) + ): + raise ValueError("Automatic IAM requires fresh default MPA roles") return self @@ -597,6 +643,8 @@ def load_profile(path: str | Path | None, *, region: str = "") -> Profile: worker_values = managed_values.get("worker") if isinstance(worker_values, dict): worker_values = dict(worker_values) + if "env" in worker_values: + worker_values["env"] = _resolve(worker_values["env"]) flat_tos = _resolve( { key: values.get(key, "") diff --git a/veadk/integrations/mpa/managed/diagnostics.py b/veadk/integrations/mpa/managed/diagnostics.py index 484b8962d..1e0fc0097 100644 --- a/veadk/integrations/mpa/managed/diagnostics.py +++ b/veadk/integrations/mpa/managed/diagnostics.py @@ -17,15 +17,15 @@ from __future__ import annotations import asyncio +import logging from collections.abc import Awaitable, Callable, Iterator from contextlib import contextmanager from contextvars import ContextVar -import logging from typing import TypeVar +import requests from agentkit.auth.errors import AuthError, NetworkError from agentkit.toolkit.errors import ApiError -import requests from .database import DeploymentError @@ -90,6 +90,12 @@ "RequestTimeout": "timeout", } DEPLOYMENT_CATEGORIES = { + "iamPermissionDenied": "permission", + "iamTrustConflict": "ownership", + "iamPolicyConflict": "ownership", + "iamOwnershipConflict": "ownership", + "iamVerificationFailed": "resource_failed", + "iamConfigurationConflict": "configuration_changed", "Worker ownership metadata is incomplete": "metadata_missing", "Worker ownership does not match this agent": "ownership", "Worker is missing or belongs to another project": "ownership", diff --git a/veadk/integrations/mpa/managed/gateway.py b/veadk/integrations/mpa/managed/gateway.py index 7a0ea70bc..df107d4b1 100644 --- a/veadk/integrations/mpa/managed/gateway.py +++ b/veadk/integrations/mpa/managed/gateway.py @@ -91,6 +91,7 @@ async def ensure( "AccessDenied", "Unauthorized", "LimitExceeded", + "ExceededQuota", ) ): record["create_requested"] = False @@ -154,6 +155,7 @@ async def ensure( "AccessDenied", "Unauthorized", "LimitExceeded", + "ExceededQuota", ) ): record["im_create_requested"] = False diff --git a/veadk/integrations/mpa/managed/gateway_cloud.py b/veadk/integrations/mpa/managed/gateway_cloud.py index 3500077cc..2c8c4cac7 100644 --- a/veadk/integrations/mpa/managed/gateway_cloud.py +++ b/veadk/integrations/mpa/managed/gateway_cloud.py @@ -111,18 +111,45 @@ async def find_gateways(self, name): return matches raise APIGClientError("Gateway pagination exceeded limit") + async def available_zones(self): + result = await self.call("GetGatewayAvailableZones", {}) + zones = result.get("AvailableZones") + if ( + not isinstance(zones, list) + or any( + not isinstance(zone, str) + or not zone.startswith(self.runtime.region + "-") + or not zone[len(self.runtime.region) + 1 :] + for zone in zones + ) + or len(set(zones)) != len(zones) + or len(zones) < 2 + ): + raise APIGClientError("Invalid APIG available zones") + return sorted(zones) + async def create_gateway(self, name, vpc_id, subnet_ids): + if ( + not isinstance(subnet_ids, list) + or any(not isinstance(sid, str) or not sid.strip() for sid in subnet_ids) + or len(set(subnet_ids)) != len(subnet_ids) + or len(subnet_ids) < 2 + ): + raise APIGClientError( + "Standard gateway requires at least two distinct subnet IDs", + code="InvalidSubnetConfiguration", + ) result = await self.call( "CreateGateway", { "Name": name, "Region": self.runtime.region, - "Type": "serverless", + "Type": "standard", "NetworkSpec": {"VpcId": vpc_id, "SubnetIds": subnet_ids}, "ResourceSpec": { "Replicas": 2, "InstanceSpecCode": "1c2g", - "ClbSpecCode": "small_1", + "CLBSpecCode": "small_1", "PublicNetworkBillingType": "traffic", "NetworkType": { "EnablePublicNetwork": True, diff --git a/veadk/integrations/mpa/managed/iam.py b/veadk/integrations/mpa/managed/iam.py new file mode 100644 index 000000000..38958c4b2 --- /dev/null +++ b/veadk/integrations/mpa/managed/iam.py @@ -0,0 +1,332 @@ +# Copyright (c) 2025 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Additively prepare the approved account-scoped MPA execution role.""" + +from __future__ import annotations + +import asyncio +import json +import time + +from .database import DeploymentError +from .diagnostics import classify_error + +ROLE_NAME = "IDRoleForArkClawShareAgent" +POLICY_NAME = "VeADKMPARuntimeAccessV1" +SYSTEM_POLICIES = ( + "AgentKitSkillsSandboxAccess", + "AgentKitToolAccess", + "LLMShieldProtectSdkAccess", + "Mem0ReadOnlyAccess", + "AgentKitRuntimeAccess", + "AgentKitTosAccess", + "CloudControlReadOnlyAccess", + "TorchlightApiFullAccess", + "IDReadOnlyAccess", + "VikingdbFullAccess", + "APMPlusServerDataExportRolePolicy", + "AgentKitReadOnlyAccess", +) +ACTIONS = ( + "arkclaw:ListResources", + "arkclaw:GetMpaInstanceConf", + "apig:ListGateways", + "apig:GetGateway", + "apig:CreateGateway", + "apig:CreateIMChannelGateway", + "apig:GetIMChannelGatewayStatus", + "apig:CreateUpstream", + "apig:CreateRoute", + "agentkit:DeleteSession", + "agentkit:PauseSession", + "agentkit:ResumeSession", + "agentkit:SetSessionTtl", + "agentkit:CreateSessionSnapshot", +) +POLICY_DOCUMENT = { + "Statement": [{"Effect": "Allow", "Action": list(ACTIONS), "Resource": ["*"]}] +} +TRUST_DOCUMENT = { + "Statement": [ + { + "Effect": "Allow", + "Action": ["sts:AssumeRole"], + "Principal": {"Service": ["vefaas", "apig"]}, + } + ] +} +ERROR_KEYS = frozenset( + { + "iamPermissionDenied", + "iamTrustConflict", + "iamPolicyConflict", + "iamOwnershipConflict", + "iamVerificationFailed", + "iamConfigurationConflict", + } +) +PERMISSION_CODES = { + "AccessDenied", + "Forbidden", + "Unauthorized", + "InvalidAccessKeyId", + "SignatureDoesNotMatch", + "InvalidToken", + "ExpiredToken", +} +TRANSIENT_CODES = { + "Throttling", + "ThrottlingException", + "TooManyRequests", + "RequestLimitExceeded", + "InternalError", + "ServiceUnavailable", + "InternalServerError", + "RequestTimeout", +} +KNOWN_CODES = ( + PERMISSION_CODES + | TRANSIENT_CODES + | { + "RoleNotExist", + "PolicyNotExist", + "RoleAlreadyExists", + "PolicyAlreadyExist", + "PolicyAttachConflict", + } +) + + +class IamError(DeploymentError): + """Only safe keys and recognized error codes survive the SDK boundary.""" + + def __init__(self, code: str = "", *, key: str = "iamVerificationFailed"): + self.code = code if code in KNOWN_CODES else "" + self.key = ( + "iamPermissionDenied" + if self.code in PERMISSION_CODES + else (key if key in ERROR_KEYS else "iamVerificationFailed") + ) + super().__init__(self.key) + + +class IamCloud: + def __init__(self, runtime): + self.runtime = runtime + + async def call(self, method: str, **params): + def run(): + from volcengine.iam.IamService import IamService + + client = None + try: + credential = self.runtime._credentials() + # IamService.__new__ is a singleton: bypass it to prevent concurrent + # deployments from replacing each other's credentials/session. + client = object.__new__(IamService) + IamService.__init__(client) + client.set_ak(credential.access_key_id) + client.set_sk(credential.secret_access_key) + client.set_session_token(credential.session_token) + client.set_scheme("https") + client.set_connection_timeout(5) + client.set_socket_timeout(5) + response = getattr(client, method)(params) + except Exception as error: + code = "" + try: + envelope = json.loads(str(error)) + code = ( + envelope.get("ResponseMetadata", {}) + .get("Error", {}) + .get("Code", "") + ) + except (ValueError, AttributeError, TypeError): + pass + if classify_error(error) == "permission": + code = "AccessDenied" + raise IamError(code) from None + finally: + if client is not None and hasattr(client, "session"): + client.session.close() + if not isinstance(response, dict): + raise IamError() + error = response.get("ResponseMetadata", {}).get("Error") + if error: + raise IamError(error.get("Code", "")) + result = response.get("Result", {}) + if not isinstance(result, dict): + raise IamError() + return result + + return await asyncio.to_thread(run) + + +def _document(value): + if isinstance(value, str): + try: + value = json.loads(value) + except ValueError: + return {} + return value if isinstance(value, dict) else {} + + +def _canonical(value): + if isinstance(value, dict): + return {key: _canonical(item) for key, item in value.items()} + if isinstance(value, list): + return sorted( + (_canonical(item) for item in value), + key=lambda item: json.dumps(item, sort_keys=True), + ) + return value + + +def _validate_role(result: dict, account: str): + role = result.get("Role", result) + if ( + role.get("RoleName") != ROLE_NAME + or role.get("Trn") != f"trn:iam::{account}:role/{ROLE_NAME}" + ): + raise IamError(key="iamOwnershipConflict") + trust = _document(role.get("TrustPolicyDocument")) + services = set() + statements = trust.get("Statement", []) + if not isinstance(statements, list): + raise IamError(key="iamTrustConflict") + for statement in statements: + if not isinstance(statement, dict) or statement.get("Effect") == "Deny": + raise IamError(key="iamTrustConflict") + actions = statement.get("Action", []) + principal = statement.get("Principal", {}) + if ( + statement.get("Effect") == "Allow" + and not statement.get("Condition") + and "sts:AssumeRole" + in (actions if isinstance(actions, list) else [actions]) + and isinstance(principal, dict) + ): + service = principal.get("Service", []) + if isinstance(service, str): + service = [service] + if isinstance(service, list) and all( + isinstance(item, str) for item in service + ): + services.update(service) + if not {"vefaas", "apig"} <= services: + raise IamError(key="iamTrustConflict") + + +async def ensure_runtime_role( + cloud, account: str, *, timeout: float = 120, poll_interval: float = 2 +): + """Reconcile by fixed names; never change existing trust/policy documents.""" + + async def reconcile(): + deadline = time.monotonic() + timeout + + async def get_or_create(get, create, missing, collision, query, values): + try: + return await cloud.call(get, **query) + except IamError as error: + if error.code != missing: + raise + try: + await cloud.call(create, **values) + except IamError as error: + if error.code != collision: + raise + return await cloud.call(get, **query) + + while True: + try: + role = await get_or_create( + "get_role", + "create_role", + "RoleNotExist", + "RoleAlreadyExists", + {"RoleName": ROLE_NAME}, + { + "RoleName": ROLE_NAME, + "TrustPolicyDocument": json.dumps(TRUST_DOCUMENT), + "Description": "VeADK managed MPA execution role", + }, + ) + _validate_role(role, account) + policy = await get_or_create( + "get_policy", + "create_policy", + "PolicyNotExist", + "PolicyAlreadyExist", + {"PolicyName": POLICY_NAME, "PolicyType": "Custom"}, + { + "PolicyName": POLICY_NAME, + "PolicyDocument": json.dumps(POLICY_DOCUMENT), + "Description": "VeADK managed MPA runtime permissions v1", + }, + ) + if _canonical( + _document(policy.get("Policy", policy).get("PolicyDocument")) + ) != _canonical(POLICY_DOCUMENT): + raise IamError(key="iamPolicyConflict") + required = {(name, "System") for name in SYSTEM_POLICIES} | { + (POLICY_NAME, "Custom") + } + + async def bindings(): + result = await cloud.call( + "list_attached_role_policies", RoleName=ROLE_NAME + ) + return { + (p.get("PolicyName"), p.get("PolicyType")) + for p in result.get("AttachedPolicyMetadata", []) + if any( + scope.get("PolicyScopeType") == "Global" + for scope in p.get("PolicyScope", []) + ) + } + + attached = await bindings() + for name, kind in sorted(required - attached): + try: + await cloud.call( + "attach_role_policy", + RoleName=ROLE_NAME, + PolicyName=name, + PolicyType=kind, + ) + except IamError as error: + # A concurrent attachment still requires Global readback. + if error.code != "PolicyAttachConflict": + raise + _validate_role( + await cloud.call("get_role", RoleName=ROLE_NAME), account + ) + if required <= await bindings(): + return + except IamError as error: + if error.code not in TRANSIENT_CODES | { + "RoleNotExist", + "PolicyNotExist", + }: + raise + if time.monotonic() >= deadline: + raise IamError() + await asyncio.sleep(poll_interval) + + try: + await asyncio.wait_for(reconcile(), timeout) + except asyncio.TimeoutError: + raise IamError() from None diff --git a/veadk/integrations/mpa/managed/network.py b/veadk/integrations/mpa/managed/network.py index 4400c9afc..cc9a6befa 100644 --- a/veadk/integrations/mpa/managed/network.py +++ b/veadk/integrations/mpa/managed/network.py @@ -22,11 +22,39 @@ import time import uuid from dataclasses import dataclass +from types import SimpleNamespace from veadk.integrations.mpa.managed.database import DeploymentError from veadk.integrations.mpa.managed.network_cloud import NetworkCloudError +def same_subnet_ids(first: object, second: object) -> bool: + """Compare valid subnet selections without depending on provider ordering.""" + if not isinstance(first, list) or not isinstance(second, list): + return False + for selection in (first, second): + if ( + not 1 <= len(selection) <= 5 + or any(not isinstance(sid, str) or not sid.strip() for sid in selection) + or len(set(selection)) != len(selection) + ): + return False + return set(first) == set(second) + + +def vpc_configuration_matches(actual: dict, requested: dict) -> bool: + """Check supplied immutable network fields, treating subnets as members.""" + for key in ("VpcId", "SubnetIds", "EnableSharedInternetAccess"): + if key not in requested: + continue + if key == "SubnetIds": + if not same_subnet_ids(actual.get(key), requested[key]): + return False + elif actual.get(key) != requested[key]: + return False + return True + + @dataclass(frozen=True) class NetworkOptions: vpc_cidr: str = "172.20.0.0/16" @@ -79,7 +107,8 @@ def __init__( self.timeout, self.interval = timeout, interval suffix = hashlib.sha256(f"{account}:{region}".encode()).hexdigest()[:20] self.name = f"mpa-network-{suffix}" - self.marker = f"mpa-account-network:v1:{suffix}" + self.marker = f"mpa-account-network-v1-{suffix}" + self.legacy_marker = f"mpa-account-network:v1:{suffix}" async def _wait(self, fetch, resource_id, kind): deadline = time.monotonic() + self.timeout @@ -107,14 +136,6 @@ async def _wait(self, fetch, resource_id, kind): async def _create(self, entry, record, kind, request, matches): intent = kind + "_request" - if ( - record.get(intent) - and {k: v for k, v in record[intent].items() if k != "client_token"} - != request - ): - raise DeploymentError( - f"Unfinished {kind} creation has different inputs; resume its original configuration" - ) # Verify resources found by stable name. Never take over an arbitrary VPC. matches = [ r for r in matches if r.get(f"{kind}_name") == request[f"{kind}_name"] @@ -123,12 +144,40 @@ async def _create(self, entry, record, kind, request, matches): raise DeploymentError( f"Multiple managed {kind} resources found; reconcile before continuing" ) + previous = { + k: v for k, v in record.get(intent, {}).items() if k != "client_token" + } + if previous and previous != request: + legacy = {**request, "description": self.legacy_marker} + if previous != legacy: + raise DeploymentError( + f"Unfinished {kind} creation has different inputs; resume its original configuration" + ) + resource = record.get("vpc_id" if kind == "vpc" else "subnet_ids") + if ( + record.get(kind + "_dispatched") is False + and not resource + and not matches + ): + # A changed body needs a fresh token, only after definite rejection. + record[intent] = {**request, "client_token": str(uuid.uuid4())} + elif matches: + request = previous + else: + raise DeploymentError( + f"{kind} creation outcome unknown; retry discovery; no duplicate create issued" + ) if matches: row = matches[0] fields = ("description", "cidr_block") + ( ("vpc_id", "zone_id") if kind == "subnet" else () ) - if any(row.get(k) != request[k] for k in fields): + if any( + row.get(k) not in {self.marker, self.legacy_marker} + if k == "description" + else row.get(k) != request[k] + for k in fields + ): raise DeploymentError( f"{kind} name exists without matching network ownership/configuration" ) @@ -155,6 +204,139 @@ async def _create(self, entry, record, kind, request, matches): await entry.save(record) raise + def _free_cidr(self, vpc, subnets): + try: + block = ipaddress.IPv4Network(vpc["cidr_block"]) + occupied = [ipaddress.IPv4Network(s["cidr_block"]) for s in subnets] + return next( + str(n) + for n in block.subnets(new_prefix=self.options.subnet_prefix) + if not any(n.overlaps(other) for other in occupied) + ) + except (ValueError, KeyError, StopIteration): + raise DeploymentError( + "No free subnet CIDR in VPC; choose a suitable subnet prefix or existing subnet" + ) from None + + async def gateway_network(self, entry, network, available_zones): + """Prepare standard APIG subnets while the caller holds the account lock.""" + if ( + not isinstance(available_zones, list) + or any( + not isinstance(zone, str) + or not zone.startswith(self.region + "-") + or not zone[len(self.region) + 1 :] + for zone in available_zones + ) + or len(set(available_zones)) != len(available_zones) + or len(available_zones) < 2 + ): + raise DeploymentError("APIG requires at least two valid available zones") + config = dict(network["VpcConfiguration"]) + vpc_id = config["VpcId"] + record = await entry.read() + if record.get("vpc_id") != vpc_id: + raise DeploymentError("APIG network differs from the registered VPC") + vpc = await self._wait(self.cloud.vpc, vpc_id, "vpc") + rows = await self.cloud.subnets(vpc_id) + # DescribeSubnets may lag behind a ready GetSubnet. Reserve all known + # primary CIDRs before allocating companions, even if listing is empty. + initial = [ + await self._wait(self.cloud.subnet, sid, "subnet") + for sid in config["SubnetIds"] + ] + if any(row.get("vpc_id") != vpc_id for row in initial): + raise DeploymentError("APIG subnet is outside the registered VPC") + known = {row["subnet_id"]: row for row in rows + initial} + rows = list(known.values()) + intents = record.setdefault("gateway_subnet_intents", {}) + recovered = [] + + async def companion(zone) -> dict: + slot = intents.setdefault(zone, {}) + intent = slot.get("subnet_request") + name = self.name + "-subnet-" + zone + cidr = intent["cidr_block"] if intent else self._free_cidr(vpc, rows) + try: + block = ipaddress.IPv4Network(cidr) + if ( + block.prefixlen != self.options.subnet_prefix + or not block.subnet_of(ipaddress.IPv4Network(vpc["cidr_block"])) + or any( + block.overlaps(ipaddress.IPv4Network(row["cidr_block"])) + for row in rows + if row.get("subnet_name") != name + ) + ): + raise ValueError() + except (ValueError, KeyError): + raise DeploymentError( + "APIG companion subnet CIDR/configuration conflicts; reconcile before continuing" + ) from None + request = dict( + vpc_id=vpc_id, + zone_id=zone, + cidr_block=cidr, + subnet_name=name, + description=self.marker, + ) + + async def save(pending): + intents[zone] = pending + await entry.save(record) + + subnet_id = await self._create( + SimpleNamespace(save=save), slot, "subnet", request, rows + ) + subnet = await self._wait(self.cloud.subnet, subnet_id, "subnet") + if subnet.get("vpc_id") != vpc_id or not _available(subnet): + raise DeploymentError( + "APIG companion subnet is unavailable/outside VPC" + ) + if subnet.get("zone_id") != zone: + raise DeploymentError("APIG companion subnet has a different zone") + slot["subnet_ids"] = [subnet_id] + await save(slot) + return subnet + + # Resolve persisted intents first. Another subnet cannot hide an unknown + # dispatch or cause a second create in a different zone on retry. + for zone in sorted(intents): + if zone not in available_zones: + raise DeploymentError("Pending APIG subnet zone is no longer available") + subnet = await companion(zone) + recovered.append(subnet) + rows = [r for r in rows if r["subnet_id"] != subnet["subnet_id"]] + [subnet] + + selected, zones = [], set() + for row in initial + recovered + sorted(rows, key=lambda row: row["subnet_id"]): + zone = row.get("zone_id") + if zone not in available_zones or zone in zones or not _available(row): + continue + subnet = await self._wait(self.cloud.subnet, row["subnet_id"], "subnet") + if ( + subnet.get("vpc_id") != vpc_id + or subnet.get("zone_id") != zone + or not _available(subnet) + ): + raise DeploymentError("APIG subnet identity/network changed") + selected.append(subnet["subnet_id"]) + zones.add(zone) + if len(selected) == 2: + break + for zone in sorted(available_zones): + if len(selected) == 2: + break + if zone in zones: + continue + subnet = await companion(zone) + selected.append(subnet["subnet_id"]) + zones.add(zone) + rows.append(subnet) + record["subnet_ids"] = selected + await entry.save(record) + return {**network, "VpcConfiguration": {**config, "SubnetIds": selected}} + async def ensure( self, entry, requested=None, *, current=None, project_name="default" ): @@ -166,6 +348,7 @@ async def ensure( raise DeploymentError("MPA requires public/private Runtime network access") if config.get("SubnetIds") and not config.get("VpcId"): raise DeploymentError("SubnetIds require a VpcId") + requested_subnets = config.get("SubnetIds") if current is not None: nets = { n["NetworkType"].lower(): n @@ -180,13 +363,22 @@ async def ensure( raise DeploymentError( "Existing Runtime has no complete VPC network; create a new Runtime for migration" ) - for key in ("VpcId", "SubnetIds", "EnableSharedInternetAccess"): - if key in config and config[key] != active.get(key): - raise DeploymentError( - "Changing the Runtime VPC configuration requires a separate migration" - ) + if not vpc_configuration_matches(active, config): + raise DeploymentError( + "Changing the Runtime VPC configuration requires a separate migration" + ) config = dict(active) + if requested_subnets is not None: + config["SubnetIds"] = list(requested_subnets) record = await entry.read() + if ( + current is not None + and requested_subnets is None + and same_subnet_ids(config.get("SubnetIds"), record.get("subnet_ids")) + ): + # Keep the original creation order so provider permutations cannot + # change the persisted request hash on same-agent recovery. + config["SubnetIds"] = list(record["subnet_ids"]) gateway = await entry.gateway() vpcs = { v @@ -214,7 +406,7 @@ async def ensure( await entry.save(record) vpc = await self._wait(self.cloud.vpc, vpc_id, "vpc") if record.get("managed_vpc") and ( - vpc.get("description") != self.marker + vpc.get("description") not in {self.marker, self.legacy_marker} or vpc.get("cidr_block") != record["vpc_request"]["cidr_block"] ): raise DeploymentError( @@ -259,22 +451,7 @@ async def ensure( "Unfinished subnet creation has different prefix; resume its original configuration" ) else: - try: - block = ipaddress.IPv4Network(vpc["cidr_block"]) - occupied = [ - ipaddress.IPv4Network(s["cidr_block"]) for s in subnets - ] - cidr = next( - str(n) - for n in block.subnets( - new_prefix=self.options.subnet_prefix - ) - if not any(n.overlaps(other) for other in occupied) - ) - except (ValueError, KeyError, StopIteration): - raise DeploymentError( - "No free subnet CIDR in VPC; choose a suitable subnet prefix or existing subnet" - ) from None + cidr = self._free_cidr(vpc, subnets) request = dict( vpc_id=vpc_id, zone_id=zone, diff --git a/veadk/integrations/mpa/managed/network_cloud.py b/veadk/integrations/mpa/managed/network_cloud.py index a9e444580..d6c807e4e 100644 --- a/veadk/integrations/mpa/managed/network_cloud.py +++ b/veadk/integrations/mpa/managed/network_cloud.py @@ -104,6 +104,14 @@ async def _list(self, method, request_type, collection, **params): method, request_type, page_number=page, page_size=100, **params ) items = result.get(collection) + total_count = result.get("total_count") + if ( + items is None + and page == 1 + and type(total_count) is int + and total_count == 0 + ): + return [] if not isinstance(items, list): raise DeploymentError("Network discovery returned invalid results") rows.extend(items) diff --git a/veadk/integrations/mpa/managed/runner.py b/veadk/integrations/mpa/managed/runner.py index 8c3ee678c..2d5d2cb5b 100644 --- a/veadk/integrations/mpa/managed/runner.py +++ b/veadk/integrations/mpa/managed/runner.py @@ -25,6 +25,7 @@ with_creation_tos, ) from .diagnostics import classify_error, diagnostic_scope, report +from .iam import IamError from .service import provision @@ -75,7 +76,7 @@ def run(): except Exception as error: report("provision", classify_error(error)) # Error text can contain SDK request payloads, URLs and credentials. - emit(error="creationFailed") + emit(error=error.key if isinstance(error, IamError) else "creationFailed") return 1 diff --git a/veadk/integrations/mpa/managed/runtime.py b/veadk/integrations/mpa/managed/runtime.py index c8b771a0a..36726e96c 100644 --- a/veadk/integrations/mpa/managed/runtime.py +++ b/veadk/integrations/mpa/managed/runtime.py @@ -30,6 +30,7 @@ from veadk.integrations.mpa.managed.network import ( AccountNetworkProvisioner, NetworkOptions, + vpc_configuration_matches, ) from veadk.integrations.mpa.managed.network_cloud import NetworkCloud @@ -293,11 +294,7 @@ def validate_runtime(runtime, *, agent_id, database, template): ) actual = nets["private"].get("VpcConfiguration") or {} wanted = template["NetworkConfiguration"]["VpcConfiguration"] - if any( - actual.get(k) != wanted.get(k) - for k in ("VpcId", "SubnetIds", "EnableSharedInternetAccess") - if k in wanted - ): + if not vpc_configuration_matches(actual, wanted): raise DeploymentError( "Changing the Runtime VPC configuration requires a separate migration" ) @@ -431,6 +428,7 @@ async def deploy( region=self.region, agent_id=agent_id, project_name=template.get("ProjectName") or "", + runtime_name=runtime_name, configured_id=source_env.get("SKILL_SPACE_ID", "").strip(), current_id=env_map(current).get("SKILL_SPACE_ID", "").strip() if current diff --git a/veadk/integrations/mpa/managed/service.py b/veadk/integrations/mpa/managed/service.py index b4730101f..6a5a11d59 100644 --- a/veadk/integrations/mpa/managed/service.py +++ b/veadk/integrations/mpa/managed/service.py @@ -40,6 +40,7 @@ from .database import AgentDatabaseProvisioner, AgentDeploymentRegistry, DeploymentError from .gateway import SharedAPIGService from .gateway_cloud import GatewayCloud +from .iam import ROLE_NAME, IamCloud, IamError, ensure_runtime_role from .network import AccountNetworkProvisioner, NetworkOptions from .runtime import AgentRuntimeDeployer, RuntimeCloud, env_map, template_from_runtime from .worker import WorkerCloud, ensure_worker @@ -98,11 +99,16 @@ def fresh_template(profile, agent_id, account): ) env = build_runtime_env(params, public_endpoint="") env.pop("A2A_PUBLIC_URL", None) + role = profile.managed.runtime.role_name or values.get( + "runtime_role_name", ROLE_NAME + ) + env["RUNTIME_IAM_ROLE_NAME"] = role + env["RUNTIME_IAM_ROLE_TRN"] = f"trn:iam::{account}:role/{role}" return { "ArtifactType": "image", "ArtifactUrl": params.image, "Command": "bash run.sh", - "RoleName": values.get("runtime_role_name", "IDRoleForArkClawShareAgent"), + "RoleName": role, "ApmplusEnable": True, "MinInstance": 1, "MaxInstance": 1, @@ -227,6 +233,14 @@ async def provision( expected = str(profile.values.get("account_id", "")) if expected and account != expected: raise DeploymentError("Deployment credentials differ from the expected account") + if profile.managed.iam.mode == "auto": + if ( + profile.managed.runtime.role_name + or profile.values.get("runtime_role_name", ROLE_NAME) + ) != ROLE_NAME: + raise IamError(key="iamConfigurationConflict") + progress("iam_role") + await ensure_runtime_role(IamCloud(cloud), account) identity = await ensure_workload_identity(profile, cloud, agent_id) if profile.managed.postgres and profile.managed.postgres.mode == "auto": from .pg_bootstrap import prepare_postgres @@ -311,6 +325,7 @@ async def provision( options = NetworkOptions(network.vpc_cidr, network.subnet_prefix, network.zone) databases = AgentDatabaseProvisioner(admin_url=profile.admin_url, runtime_env=env) registry = AgentDeploymentRegistry(profile.shared_url) + gateway_cloud = GatewayCloud(cloud) try: await databases.check() await registry.initialize() @@ -329,22 +344,37 @@ async def provision( else None ) progress("network") - template["NetworkConfiguration"] = await AccountNetworkProvisioner( + network_provisioner = AccountNetworkProvisioner( cloud=cloud.network, account=account, region=profile.region, options=options, - ).ensure( - entry.network_entry(), + ) + network_entry = entry.network_entry() + template["NetworkConfiguration"] = await network_provisioner.ensure( + network_entry, template.get("NetworkConfiguration"), current=current, project_name=template.get("ProjectName") or "default", ) + gateway_network = template["NetworkConfiguration"] + registered_gateway = await network_entry.gateway() + if ( + not registered_gateway.get("gateway_id") + and not profile.managed.apig.adopt_id + ): + gateway_network = await network_provisioner.gateway_network( + network_entry, + gateway_network, + await gateway_cloud.available_zones(), + ) + if current is None: + template["NetworkConfiguration"] = gateway_network # APIG takes the same account lock. Do not nest it inside the deployment lock. progress("gateway") - vpc = template["NetworkConfiguration"]["VpcConfiguration"] + vpc = gateway_network["VpcConfiguration"] gateway = await SharedAPIGService( - registry=registry.shared, cloud=GatewayCloud(cloud), region=profile.region + registry=registry.shared, cloud=gateway_cloud, region=profile.region ).ensure( vpc_id=vpc["VpcId"], subnet_ids=vpc["SubnetIds"], @@ -360,6 +390,7 @@ async def provision( region=profile.region, agent_id=agent_id, project=template.get("ProjectName") or "default", + runtime_name=runtime_name, ) env.update(AGENTKIT_TOOL_ID=tool_id, AGENTKIT_TOOL_REGION=profile.region) template["ToolId"] = tool_id @@ -373,9 +404,9 @@ async def provision( shared_database_url=profile.shared_url, timeout=profile.managed.timeout_seconds, network_options=options, - progress=lambda message: progress("verifying") - if message.startswith("Runtime ") - else None, + progress=lambda message: ( + progress("verifying") if message.startswith("Runtime ") else None + ), ).deploy( template, runtime_name=runtime_name, diff --git a/veadk/integrations/mpa/managed/skills.py b/veadk/integrations/mpa/managed/skills.py index 741bf8f66..3d44cf7bc 100644 --- a/veadk/integrations/mpa/managed/skills.py +++ b/veadk/integrations/mpa/managed/skills.py @@ -16,6 +16,7 @@ from __future__ import annotations +from veadk.integrations.mpa.managed.config import validate_runtime_name from veadk.integrations.mpa.managed.database import DeploymentError, agent_suffix @@ -29,12 +30,15 @@ async def ensure_skill_space( project_name="", configured_id="", current_id="", + runtime_name: str = "", ): """Caller holds the deployment lock. Never replace a missing registered space. CreateSkillSpace has no ClientToken. Persist the intent first and recover a lost response by exact name and ownership tags; never blindly repeat create. """ + if runtime_name: + runtime_name = validate_runtime_name(runtime_name) record = await entry.read() registered_id = record.get("skill_space_id", "") ids = {value for value in (registered_id, configured_id, current_id) if value} @@ -60,7 +64,7 @@ async def ensure_skill_space( suffix = agent_suffix(account, region, agent_id) request = { "Name": "mpa_skills_" + suffix, - "Description": "Skills for MPA agent " + agent_id, + "Description": "Skills for MPA agent " + (runtime_name or agent_id), "Tags": [ {"Key": "managed_by", "Value": "mpa-deployment"}, {"Key": "mpa_agent_key", "Value": suffix}, @@ -71,9 +75,15 @@ async def ensure_skill_space( request["ProjectName"] = project_name previous = record.get("skill_space_request") if previous and previous != request: - raise DeploymentError( - "Unfinished Skill Space creation has different inputs; resume its original configuration" - ) + legacy_request = { + **request, + "Description": "Skills for MPA agent " + agent_id, + } + if previous != legacy_request: + raise DeploymentError( + "Unfinished Skill Space creation has different inputs; resume its original configuration" + ) + request = previous spaces = await cloud.find_skill_spaces(request["Name"], project_name) if spaces: if len(spaces) != 1 or not record.get("skill_space_create_requested"): diff --git a/veadk/integrations/mpa/managed/studio_profile.py b/veadk/integrations/mpa/managed/studio_profile.py index 0c05e6032..4225f85fd 100644 --- a/veadk/integrations/mpa/managed/studio_profile.py +++ b/veadk/integrations/mpa/managed/studio_profile.py @@ -19,20 +19,19 @@ def studio_profile_values() -> dict: """Return a fresh Beijing profile; secrets remain server environment values.""" - account = "2112682748" region = "cn-beijing" role = "IDRoleForArkClawShareAgent" model = "doubao-seed-2-0-pro-260215" - registry = f"agentkit-platform-{account}-{region}.cr.volces.com/mpa" + registry = "agentkit-platform-2112682748-cn-beijing.cr.volces.com/mpa" return { "region": region, - "account-id": account, "model-provider": "openai", "model-name": model, "model-api-base": "https://ark.cn-beijing.volces.com/api/v3/", "model-api-key": "${VEADK_MPA_CONFIG_MODEL_AGENT_API_KEY}", "managed": { "version": 1, + "iam": {"mode": "auto"}, "postgres": { "mode": "auto", "legacy-urls": "ignore", @@ -58,7 +57,6 @@ def studio_profile_values() -> dict: "APPCENTER_RESOURCE_DISCOVERY_ENABLED": "false", "CHANNEL_ADMIN_AUTH_MODE": "runtime_key", "CHANNEL_BACKEND": "postgresql", - "CLAW_SPACE_ID": f"csi-{account}", "CLOUD_PROVIDER": "volcengine", "FORCE_APMPLUS_EXPORTER_REGISTRATION": "true", "IDENTITY_REGION": region, @@ -73,8 +71,6 @@ def studio_profile_values() -> dict: ), "MPA_SESSION_MEMORY_BACKEND": "postgresql", "REGION": region, - "RUNTIME_IAM_ROLE_NAME": role, - "RUNTIME_IAM_ROLE_TRN": f"trn:iam::{account}:role/{role}", "RUNTIME_PROVIDER": "VEFAAS", "SCHEDULED_TASK_BACKEND": "postgresql", "ENABLE_APMPLUS": "true", @@ -85,7 +81,6 @@ def studio_profile_values() -> dict: }, "worker": { "image": f"{registry}/mpa_codex_worker:latest", - "reference-id": "t-yeuujqfldstkidoad4p0", "role-name": role, }, "timeout-seconds": 1800, diff --git a/veadk/integrations/mpa/managed/tasks.py b/veadk/integrations/mpa/managed/tasks.py index dffb8b1f4..34a6684c5 100644 --- a/veadk/integrations/mpa/managed/tasks.py +++ b/veadk/integrations/mpa/managed/tasks.py @@ -17,25 +17,27 @@ from __future__ import annotations import asyncio -from contextlib import contextmanager import hashlib import json import logging import os -from pathlib import Path import re import sqlite3 import sys import time import uuid +from contextlib import contextmanager +from pathlib import Path from .diagnostics import classify_error, validate_diagnostic +from .iam import ERROR_KEYS logger = logging.getLogger(__name__) STAGES = { "queued", "checking", + "iam_role", "admin_workspace", "business_workspace", "admin_database", @@ -330,6 +332,8 @@ async def _run( ) if isinstance(event.get("stage"), str) and event["stage"] in STAGES: self._update(task_id, stage=event["stage"]) + if isinstance(event.get("error"), str) and event["error"] in ERROR_KEYS: + terminal["error"] = event["error"] if event.get("result"): result = event["result"] keys = { diff --git a/veadk/integrations/mpa/managed/worker.py b/veadk/integrations/mpa/managed/worker.py index 677f85856..15d2bac12 100644 --- a/veadk/integrations/mpa/managed/worker.py +++ b/veadk/integrations/mpa/managed/worker.py @@ -21,6 +21,7 @@ import json import uuid +from .config import WORKER_RESERVED_ENV_KEYS, validate_runtime_name from .database import DeploymentError, agent_suffix from .diagnostics import report, retry_worker from ..mpa_tool import build_tos_mount_config @@ -94,8 +95,11 @@ async def ensure_worker( region, agent_id, project="default", + runtime_name: str = "", timeout: float = 600, ): + if runtime_name: + runtime_name = validate_runtime_name(runtime_name) try: return await asyncio.wait_for( _ensure_worker( @@ -106,6 +110,7 @@ async def ensure_worker( region=region, agent_id=agent_id, project=project, + runtime_name=runtime_name, ), timeout=timeout, ) @@ -116,7 +121,9 @@ async def ensure_worker( raise TimeoutError() from error -async def _ensure_worker(entry, cloud, options, *, account, region, agent_id, project): +async def _ensure_worker( + entry, cloud, options, *, account, region, agent_id, project, runtime_name +): record = await entry.read() suffix = agent_suffix(account, region, agent_id) owned = {"managed_by": "mpa-deployment", "mpa_agent_key": suffix} @@ -136,29 +143,25 @@ async def _ensure_worker(entry, cloud, options, *, account, region, agent_id, pr ): raise DeploymentError("Worker differs from registered binding") if not tool_id: + name = runtime_name or agent_id.strip().replace("-", "_") + if record.get("worker_name") and record["worker_name"] != name: + raise DeploymentError( + "Unfinished worker configuration changed; resume original inputs" + ) env = {} if options.reference_id: source = await retry_worker( "get_reference_worker", lambda: cloud.get(options.reference_id) ) - excluded = { - "MPA_AGENT_ID", - "AGENTKIT_RUNTIME_ID", - "SKILL_SPACE_ID", - "CODEX_MCP_RUNTIME_API_KEY", - "A2A_PUBLIC_URL", - "FEISHU_APP_ID", - "FEISHU_APP_SECRET", - "CHANNEL_STATE_ENCRYPTION_KEY", - } env = { item["Key"]: item.get("Value", "") for item in source.get("Envs", []) - if item["Key"] not in excluded + if item["Key"] not in WORKER_RESERVED_ENV_KEYS } + env.update(options.env) env["MPA_AGENT_ID"] = agent_id request = { - "Name": agent_id.strip().replace("-", "_"), + "Name": name, "ToolType": "Private", "ImageUrl": options.image, "Command": "/opt/gem/run.sh", @@ -184,15 +187,25 @@ async def _ensure_worker(entry, cloud, options, *, account, region, agent_id, pr ).hexdigest() if record.get("worker_hash") and record["worker_hash"] != digest: # Preserve the exact pre-upgrade payload for an unfinished intent. - legacy_request = {**request, "Name": "mpa_worker_" + suffix} - legacy_digest = hashlib.sha256( - json.dumps(legacy_request, sort_keys=True).encode() - ).hexdigest() - if record["worker_hash"] != legacy_digest: + if record.get("worker_name"): + raise DeploymentError( + "Unfinished worker configuration changed; resume original inputs" + ) + for legacy_name in ( + agent_id.strip().replace("-", "_"), + "mpa_worker_" + suffix, + ): + legacy_request = {**request, "Name": legacy_name} + legacy_digest = hashlib.sha256( + json.dumps(legacy_request, sort_keys=True).encode() + ).hexdigest() + if record["worker_hash"] == legacy_digest: + request, digest = legacy_request, legacy_digest + break + else: raise DeploymentError( "Unfinished worker configuration changed; resume original inputs" ) - request, digest = legacy_request, legacy_digest matches = await retry_worker("find_worker", lambda: cloud.find(request["Name"])) if matches: if len(matches) != 1 or not record.get("worker_token"): @@ -202,6 +215,9 @@ async def _ensure_worker(entry, cloud, options, *, account, region, agent_id, pr tool_id = matches[0].get("ToolId", "") else: record.setdefault("worker_token", str(uuid.uuid4())) + # Keep legacy intents identifiable across repeated lost responses. + if not record.get("worker_hash"): + record["worker_name"] = request["Name"] record.update(worker_hash=digest, worker_managed=True) await entry.save(record) create_request = {**request, "ClientToken": record["worker_token"]} diff --git a/veadk/webui/assets/app/index-BNPwMQXG.js b/veadk/webui/assets/app/index-8JtvDNuA.js similarity index 98% rename from veadk/webui/assets/app/index-BNPwMQXG.js rename to veadk/webui/assets/app/index-8JtvDNuA.js index fc7cfdf52..4c7813b10 100644 --- a/veadk/webui/assets/app/index-BNPwMQXG.js +++ b/veadk/webui/assets/app/index-8JtvDNuA.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/visualizations/mermaid/mermaid.core-y4TF8bTw.js","assets/chunks/purify.es-BnINGy_Y.js","assets/chunks/MarkdownPromptEditor-D6ctFDfi.js","assets/styles/MarkdownPromptEditor-ZH9qtki0.css","assets/chunks/QuickAgentCreateDialog-04pJjJQJ.js","assets/styles/QuickAgentCreateDialog-DGsLIlOX.css"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/visualizations/mermaid/mermaid.core-DAx4nvmm.js","assets/chunks/purify.es-BnINGy_Y.js","assets/chunks/MarkdownPromptEditor-C8Q2sj5P.js","assets/styles/MarkdownPromptEditor-ZH9qtki0.css","assets/chunks/QuickAgentCreateDialog-_TpoDPFW.js","assets/styles/QuickAgentCreateDialog-DGsLIlOX.css"])))=>i.map(i=>d[i]); var Lze=Object.defineProperty;var RG=e=>{throw TypeError(e)};var $ze=(e,t,n)=>t in e?Lze(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Zt=(e,t,n)=>$ze(e,typeof t!="symbol"?t+"":t,n),IG=(e,t,n)=>t.has(e)||RG("Cannot "+n);var El=(e,t,n)=>(IG(e,t,"read from private field"),n?n.call(e):t.get(e)),PG=(e,t,n)=>t.has(e)?RG("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),w5=(e,t,n,i)=>(IG(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n);function Fze(e,t){for(var n=0;ni[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();var ug=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function C1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Tue={exports:{}},GP={};/** * @license React * react-jsx-runtime.production.js @@ -29,7 +29,7 @@ Summarize the result in three points`,preview:"{{count}} cases will be added",co Studio: {{studioUrl}} Pairing code: {{pairingCode}}`,installPrompt:`Install the AgentKit Studio Plugin. Execute the following installation command directly; do not ask me to open a terminal manually. Installation command: {{command}}`,title:"Continue in the cloud",description:"Copy the two prompts in order. Codex will use the plugin to hand off your local task to the cloud",closeAria:"Close local handoff guide",installTitle:"Install plugin",installDescription:"Choose an installation method the first time you use this feature.",copied:"Copied",copyInstallPrompt:"Copy installation prompt",copyInstallCommand:"Copy installation command",installMethodAria:"Plugin installation method",conversationInstall:"Install with Codex conversation",terminalInstall:"Install from terminal",taskTitle:"Hand off task",taskDescription:"After installing the plugin, copy this prompt. Codex will migrate the current project and continue the task.",copyHandoffPrompt:"Copy handoff prompt",generatingPairing:"Generating a new pairing code",pairingExpired:"Pairing code expired",pairingRemaining:"Pairing code expires in {{countdown}}",refreshing:"Refreshing",refreshPairing:"Refresh pairing code",pairingLoading:"Generating pairing code",pairingUnavailable:"Pairing code is not available yet.",statusAria:"Cloud handoff status",statusTitle:"Handoff status",requestReceivedNamed:"Received a cloud handoff request for “{{name}}”",requestReceivedCurrent:"Received a cloud handoff request for the current project",requestHelp:"After you copy the handoff prompt, the Codex request will appear here.",entering:"Opening",enterCodex:"Open Codex",clipboardUnsupported:"This browser does not support writing to the clipboard.",steps:{request:"Wait for local request",session:"Create cloud Session",restore:"Restore project",continue:"Send continuation task"},status:{issued:"Waiting for request",creating:"Creating Session",sessionCreated:"Migrating project",continuing:"Starting cloud task",running:"Running in the cloud",completed:"Handoff complete",failed:"Handoff failed"}},Cme={model:{description:"Show or switch the current conversation model",keywords:"model switch"},models:{description:"List models available from app-server",keywords:"model list"},skill:{description:"Browse and invoke a Skill available in the current workspace",keywords:"skill workflow"},skills:{description:"Browse and invoke Skills available in the current workspace",keywords:"skills workflow list"},new:{description:"Start a new conversation",keywords:"new conversation"},resume:{description:"Open conversation history or resume a specific Thread",keywords:"history resume session"},fork:{description:"Fork a new conversation from the current context",keywords:"fork branch"},compact:{description:"Compact the current conversation context",keywords:"compact context"},archive:{description:"Archive the current conversation and start a new one",keywords:"archive close"},status:{description:"Show connection, Thread, model, and token status",keywords:"status connection token"},clear:{description:"Clear the current view and start a new conversation",keywords:"clear reset"},help:{description:"Show Sandbox shortcuts",keywords:"help commands"},currentModel:"Current model",availableModel:"Available model",workspace:"Workspace",notSet:"Not set",modelLabel:"Model",statusLabel:"Status",running:"Running",idle:"Idle",totalTokens:"Total tokens",contextWindow:"Context window",imageFallback:"Image",unknown:"Unknown shortcut: {{command}}. Type /help to see available commands.",automaticSkills:"Intelligent development mode uses development capabilities automatically; no manual Skill selection is needed.",activity:{new:"Started a new Codex conversation",resumed:"Resumed Codex conversation",deleted:"Deleted Codex conversation history",modelChanged:"Switched Codex model",availableModels:"Available Codex models",noModels:"No models are currently available",forked:"Forked Codex conversation",compacting:"Started compacting the current Codex conversation",archived:"Archived Codex conversation",status:"Current Codex status",help:"Codex shortcuts supported by Sandbox"}},Ame={label:"Build tasks",queued:"Build queued",running:"Build running in the background",recovering:"Recovering build",waiting_user:"Build needs attention",stopping:"Stopping build",succeeded:"Build completed",cancelled:"Build stopped",failed:"Build could not complete",open:"Return to task",hide:"Hide task notification",reconnecting:"Reconnecting to the task service. Existing tasks are retained."},Tme={common:pme,tool:mme,threads:gme,permissions:bme,workspace:yme,approval:vme,composer:xme,launch:wme,session:Ome,agentDetails:kme,agentWorkspace:Sme,handoff:Eme,commands:Cme,taskNotice:Ame},lVe=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:kme,agentWorkspace:Sme,approval:vme,commands:Cme,common:pme,composer:xme,default:Tme,handoff:Eme,launch:wme,permissions:bme,session:Ome,taskNotice:Ame,threads:gme,tool:mme,workspace:yme},Symbol.toStringTag,{value:"Module"})),_me={retry:"Try again",signInToContinue:"Sign in to continue",signInWith:"Sign in with {{provider}}",enterUsername:"Enter a username to get started",usernamePlaceholder:"Username (letters and numbers, up to 16 characters)",enter:"Continue",usernameInvalid:"Use letters and numbers only, up to 16 characters.",identityProvider:{volcengine:"Volcengine Identity",byteplus:"BytePlus Identity"},powered:{volcengine:"Volcengine AgentKit provides enterprise-grade Agent solutions",byteplus:"BytePlus AgentKit provides enterprise-grade Agent solutions"},legalPrefix:"By continuing, you acknowledge that you have read and agree to the AgentKit",terms:"Product and Service Terms",copyright:"© {{year}} VeADK. All rights reserved."},jme={title:"Your session has expired",description:"Your current edits are preserved. The previous action will continue after you sign in again.",waiting:"Waiting for sign-in…",signInAgain:"Sign in again"},Nme={breadcrumbs:"Breadcrumbs",selectAgent:"Select Agent",switchAgent:"Switch Agent"},Rme={cancel:"Cancel",close:"Close confirmation dialog"},cVe={login:_me,authExpired:jme,navbar:Nme,confirm:Rme},uVe=Object.freeze(Object.defineProperty({__proto__:null,authExpired:jme,confirm:Rme,default:cVe,login:_me,navbar:Nme},Symbol.toStringTag,{value:"Module"})),Ime={defaultUser:"User",shortcuts:"Quick access",tryCli:"Try AgentKit CLI",developerResources:"Developer resources",systemInfo:"System information",language:"Language",issueFeedback:"Report an issue",logout:"Sign out",roles:{admin:"Administrator",developer:"Developer",user:"User",super_admin:"Super administrator"}},Pme={home:"Back to home",expand:"Expand sidebar",collapse:"Collapse sidebar",label:"Main navigation",newChat:"New chat",agents:"Agents",workspaces:"Workspaces",library:"Library",cronjobs:"Cronjob",automations:"Automations",users:"User management",administration:"Administration",reviewCenter:"Review center"},Dme={title:"Chat history",newConversation:"New conversation",create:"New chat",loading:"Loading chat history…",empty:"No conversations yet",current:"Current",manage:"Manage conversation: {{title}}",more:"More",delete:"Delete",loadingMore:"Loading…",loadMore:"Load more",evaluatingTitle:"Running automatic evaluation",evaluating:"Evaluating",generating:"Generating"},dVe={account:Ime,navigation:Pme,history:Dme},fVe=Object.freeze(Object.defineProperty({__proto__:null,account:Ime,default:dVe,history:Dme,navigation:Pme},Symbol.toStringTag,{value:"Module"})),Mme={placeholder:"Select an option",collapseOptions:"Collapse model options",expandOptions:"Expand model options",noOptions:"No options available",noMatches:"No matches. You can use the current model ID directly."},Lme={unsupportedActivity:"Unsupported Skill conversation activity",ariaLabel:"Skill generation conversation"},$me={code:"Error code: {{code}}",type:"Error type: {{type}}",representation:"Exception representation: {{value}}",rawResponse:`Raw server response: -{{value}}`,original:"Original error: {{message}}",details:"Details"},Fme={ariaLabel:"Skill file tree",viewSource:"View source",viewPreview:"View preview",download:"Download",binaryFile:"Binary file",bytes:"{{value}} bytes",binaryDescription:"The current API returns file metadata only. Download the original file separately.",metadata:"Skill metadata",noFiles:"No files"},Bme={close:"Close",name:"Name",region:"Region",optionalDescription:"Description (optional)",cancel:"Cancel",create:"Create",creating:"Creating…",save:"Save",saving:"Saving…",upload:"Upload",uploading:"Uploading…",createSpaceTitle:"New Skill Space",editSpaceTitle:"Edit Skill Space",uploadTitle:"Upload to {{name}}",createSpaceFailed:"Failed to create the Skill Space",updateSpaceFailed:"Failed to update the Skill Space",archiveValidationFailed:"Skill ZIP validation failed",uploadFailed:"Failed to upload the Skill",dropzone:"Drop a Skill ZIP here",chooseLocalFile:"or click to choose a local file",archiveHelp:"The ZIP root must contain SKILL.md, or a single wrapping directory. Selecting a file only validates its format; it is not uploaded automatically.",validating:"Checking file format…",validationPassed:"Format check passed: {{name}}, {{count}} file(s)"},Ume={styles:{concise:"Concise and practical",strict:"Rigorous and robust",tutorial:"Tutorial-friendly",automation:"Automation-first",custom:"Custom",customFallback:"Custom style"},stages:{preparing:"Preparing Dev Sandbox",ready:"Skill generated and format validation passed",failed:"Generation failed",cancelled:"Stopped",validating:"Validating Skill format",packaging:"Organizing files",generating:"Generating Skill",repairingAgain:"Repairing again",autoRepairing:"Auto-repairing ({{attempt}}/{{max}})"},validation:{fallback:"Skill format validation failed",repairInstruction:"Fix only the Skill format errors listed below. Do not change the original purpose or scope.",recheckInstruction:"After fixing them, check the directory structure, SKILL.md frontmatter, and all text files again.",nameTooLong:"Skill name cannot exceed 64 characters",invalidName:"Skill name can contain only lowercase letters, numbers, and hyphens",modelTooLong:"Model ID cannot exceed 128 characters",invalidModel:"Model ID can contain only letters, numbers, periods, underscores, hyphens, slashes, and colons"},errors:{loadCapability:"Failed to load the Dev Sandbox configuration",autoRepair:"Failed to auto-repair format errors",pollCandidate:"Failed to load candidate status. Retrying.",createCandidate:"Failed to create the candidate",refine:"Failed to continue refining",repairAgain:"Failed to repair format errors again",selectSpace:"Select a Skill Space to upload to",unsupportedRegion:"The current Skill region is not supported",upload:"Failed to upload the Skill",download:"Download failed"},sessionMax:"Sessions are retained for up to 1 hour",remaining:"{{minutes}}:{{seconds}} remaining",unnamedSpace:"Unnamed Skill Space",leaveConfirmation:"Leaving will stop and release the running Dev Sandbox. Leave anyway?",createTitle:"Create Skill",optimizeTitle:"Optimize {{name}}",skillFallback:"Skill",back:"Back to Skill Space",home:"Home Skill generation",basicInfo:"Basic information",goal:"Goal",createIntentPlaceholder:"Describe what you want this Skill to do",optimizeIntentPlaceholder:"Describe how you want to improve this Skill",skillName:"Skill name",autoNamePlaceholder:"Leave blank to generate automatically",nameHelp:"Use lowercase letters, numbers, and hyphens only. Leave blank to generate automatically.",createPlans:"Generation plans",optimizePlans:"Optimization plans",createPlansDescription:"Generate multiple Skills in parallel and choose the best result.",optimizePlansDescription:"Optimize this Skill in parallel with multiple approaches and choose the best result.",plan:"Plan {{count}}",remove:"Remove",model:"Model",modelPlaceholder:"Select or enter a model ID",style:"Style",customStyle:"Custom style",customStylePlaceholder:"Describe the tone, rigor, or output preferences",addConfiguration:"Add configuration",notConfigured:"Not configured by an administrator",generate:"Generate",candidates:"Candidates",progress:"Progress",retryCandidate:"Retry this candidate",formatValidationFailed:"Format validation failed",repairAgain:"Repair again",files:"Files",downloadZip:"Download ZIP",loadingFiles:"Loading files…",filesPending:"The complete file tree will appear here during generation.",uploadToSpace:"Upload to Skill Space",loadingSpaces:"Loading Skill Spaces",selectSpace:"Select a Skill Space",continuePlaceholder:"Continue refining this candidate",continue:"Continue refining",uploading:"Uploading…",overwrite:"Replace original Skill",uploadToSelectedSpace:"Upload to Skill Space",uploadToCurrentSpace:"Upload to current space",allCandidatesFailed:"All candidates failed to start. Retry each candidate separately."},Qme={invalidFormat:"{{label}} has an invalid format.",recoveryStatus:"Skill recovery status",errorResponse:"error response",errorDetails:"error details",missingContentType:"Content-Type missing",gatewayError:"{{fallback}} (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",nonJson:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",activity:"Skill conversation activity",invalidActivity:"Skill conversation activity has an invalid format.",invalidToolActivity:"Skill tool activity has an invalid format.",invalidTextActivity:"Skill text activity has an invalid format.",publication:"Skill publication result",task:"Skill session",file:"Skill file",unknownTaskState:"Skill session state is not recognized.",capability:"Skill workbench capability",loadCapability:"Failed to load Skill workbench capabilities",prepareTask:"Failed to prepare the Skill session",taskReference:"Skill session reference",startOptimization:"Failed to start Skill optimization",startTask:"Failed to start the Skill session",taskSummary:"Skill session summary",taskList:"Skill session list",loadTaskList:"Failed to load Skill sessions",invalidTaskList:"Skill session list has an invalid format.",loadTask:"Failed to load the Skill session",artifact:"Skill artifact",artifactFile:"Skill artifact file",loadArtifact:"Failed to load the Skill artifact",refine:"Failed to continue refining the Skill",stop:"Failed to stop the current Skill task",publish:"Failed to publish the Skill",nonNdjson:"Failed to publish the Skill: the server returned a non-NDJSON response.",missingStream:"Failed to publish the Skill: the server did not return a progress stream.",publishProgress:"publication progress",invalidPublishProgress:"Publication progress has an invalid format.",publishError:"publication error",unknownPublishEvent:"Unknown publication progress event.",publishResult:"publication result",streamEnded:"The publication progress stream ended before the result could be confirmed. Refresh Skill Center to check the status.",deleteTask:"Failed to delete the Skill session",download:"Failed to download the Skill"},zme={configSelect:Mme,conversation:Lme,errorDetails:$me,fileTree:Fme,management:Bme,generation:Ume,api:Qme},hVe=Object.freeze(Object.defineProperty({__proto__:null,api:Qme,configSelect:Mme,conversation:Lme,default:zme,errorDetails:$me,fileTree:Fme,generation:Ume,management:Bme},Symbol.toStringTag,{value:"Module"})),Vme={back:"Back",reload:"Reload",notConfigured:"Not configured",name:"Name",description:"Description",delete:"Delete",save:"Save",saving:"Saving",add:"Add",manage:"Manage",environment:"Environment",noDescription:"No description",refresh:"Refresh",close:"Close",retry:"Retry",loading:"Loading…",previousPage:"Previous page",nextPage:"Next page",edit:"Edit",all:"All",search:"Search",cancel:"Cancel",view:"View",viewDetails:"View details",deleting:"Deleting…",create:"Create",creating:"Creating",adding:"Adding",generating:"Generating",uploading:"Uploading",preview:"Preview",loadFailed:"Failed to load",select:"Select",collapse:"Collapse",expand:"Expand",none:"None"},Hme={ariaLabel:"AgentKit shortcuts",closeAriaLabel:"Close the AgentKit welcome card",title:"Welcome to AgentKit",description:"Build and host enterprise Agents quickly with AgentKit",docsAriaLabel:"Open AgentKit documentation in a new window",docs:"Documentation",consoleAriaLabel:"Open the AgentKit console in a new window",console:"Console"},qme={checkUpdates:"Check for updates",checkingVersions:"Checking versions…",versionCheckError:"Unable to check sandbox versions. Check credentials, region and API permissions, then retry.",sandboxUpdateError:"Sandbox update failed. Refresh its status before retrying.",modelEnvRepairUnavailable:"Cannot repair model configuration. Check CODEX_API_KEY and CODEX_BASE_URL.",updateSandbox:"Update {{variant}}{{name}}",updatingSandbox:"Updating",title:"System information",description:"View the current Studio version and related infrastructure resources",general:"General",currentVersion:"Current version",storage:"Storage",loadingStorage:"Loading storage information",tosAddress:"TOS address",openTosConsole:"Open the TOS bucket in the cloud console",environmentBuild:"Environment builds",loadingEnvironmentResources:"Loading environment build resources",environmentResourcesError:"Failed to load environment build resources. Check the cloud credentials and try again.",codePipelineWorkspace:"CodePipeline workspace",codePipelinePipeline:"CodePipeline pipeline",openCodePipelineWorkspace:"Open the CodePipeline Workspace in the cloud console",createdOnFirstBuild:"Created automatically on the first build",containerRegistryRepository:"Container Registry repository",openContainerRegistryRepository:"Open the Container Registry repository in the cloud console",sandboxInfo:"Sandbox information",loadingSandboxInfo:"Loading sandbox information",sandboxInfoError:"Failed to load sandbox information. Try again.",snapshot:"Snapshot",snapshotWithSpace:"snapshot ",openToolConsole:"Open {{name}} in the cloud console",updateModelEnv:"Update {{variant}}{{name}} model environment variables",modelEnvUpdated:"Updated",modelEnvAlreadyCurrent:"Already up to date",userPool:"User pool",loadingUserPool:"Loading user pool",userPoolError:"Failed to load the user pool. Try again.",modelEnvUpdateError:"Failed to update model environment variables. Try again.",openUserPoolConsole:"Open user pool {{name}} in the cloud console",unnamedUserPool:"Unnamed user pool",id:"ID",domain:"Domain",region:"Region",noLocalUserPool:"No user pool is configured in local mode",noUserPool:"No user pool is configured for this Studio"},Wme={workspace:"Agent workspace",library:"Agent library",evaluation:"Evaluation",agentList:"Agent list",agentDetails:"Agent details",newAgent:"New Agent",loading:"Loading…",loadingCloudAgents:"Loading cloud Agents…",noAgentSelected:"Select an Agent",local:"Local",remote:"Cloud",localAgent:"Local Agent",remoteAgent:"Cloud Agent",agentCount:"{{count}} Agents",agentCountLabel:"Agent count",details:"Details",chat:"Chat",update:"Update",backToAgentList:"Back to Agent list",loadingAgent:"Loading Agent",loadingAgentDescription:"Loading Agent configuration and Runtime information.",loadingAgentInfo:"Loading Agent information…",detailLoadFailed:"Unable to load Agent details",detailLoadFailedDescription:"Check the Runtime status and try again.",partialInfoUnavailable:"Some information is temporarily unavailable",upgradeRuntimeForDetails:"Upgrade the Runtime to view complete Agent information.",basicInfo:"Basic information",usageOverview:"Usage overview",sections:{basic:"Basic information",profileConfig:"Profile configuration",sessionConfig:"Session configuration",usage:"Usage overview",diagnostics:"Diagnostics",evaluations:"Evaluations",optimizations:"Optimizations",integrations:"Integrations",versions:"Versions",channels:"Message channels"},evaluationGroup:"Evaluation group",optimizations:"Optimization suggestions",optimizationsDescription:"Review actionable suggestions based on evaluation results.",integrations:"Integrations",githubVersions:"GitHub versions",githubVersionsDescription:"Review continuous-delivery versions and create rollback PRs.",currentVersionOnly:"GitHub continuous delivery is not enabled. Only the current production version is shown.",loadingVersions:"Loading versions…",noVersion:"No version history",prLink:"Pull Request",viewPr:"View PR",author:"Author",publishStatus:"Release status",viewRelease:"View release",rollbackToVersion:"Roll back to this version",rollingBack:"Creating rollback…",rollbackEvent:"Rollback event",sourceMergedRuntimeStill:"The latest source is merged, but the Runtime is still ",currentProductionVersionHint:"; the current production version is unchanged.",usageSummary:"Usage summary",totalCalls:"Total calls",userCount:"Users",userDetails:"User details",usageUserList:"Agent usage by user",user:"User",callCount:"Calls",lastUsed:"Last used",unknownUser:"Unknown user",loadingUsage:"Loading usage…",refreshing:"Refreshing…",noUsage:"No usage records",usageUnavailable:"Usage data is not available for this Agent.",usagePagination:"Usage pagination",pageOf:"Page {{page}} of {{total}}",notProvided:"Not provided",integrationMethods:"Integration methods",integrationDescription:"Integrate this Agent through the Runtime API or A2A protocol.",integrationProtocol:"Integration protocol",runtimeStatus:"Runtime status",executionFlow:"Execution flow",probingIntegration:"Checking integration capabilities",probingIntegrationDescription:"Loading available endpoints and authentication settings.",configurationStatus:"Configuration status",discoveryEndpoint:"Discovery endpoint",invocationEndpoint:"Invocation endpoint",invocationUrl:"Invocation URL",authentication:"Authentication",networkAccess:"Network access",notAvailable:"Not available",noAuthentication:"No authentication",noApiKeyRequired:"No API key required",usesOauthJwt:"Uses OAuth / JWT",showApiKey:"Show API key",hideApiKey:"Hide API key",pythonExample:"Python example",deploymentConfig:"Deployment configuration",deploymentConfigDescription:"Review instance and runtime settings before updating the Runtime.",deploymentRegion:"Deployment region",mpaControlPlane:"MPA control plane",loadingMpaAgentView:"Loading MPA Runtime binding…",mpaRuntimeBound:"This MPA Agent is bound to one Runtime and ready for management.",mpaRuntimeMissing:"No visible MPA Runtime is bound to this Agent.",mpaRuntimeBindingAmbiguous:"Multiple MPA Runtimes match this Agent. Resolve the binding before making changes.",mpaRuntimeOrphan:"The Runtime exists, but it does not contain this MPA Profile.",mpaRuntimeLegacyAuthUnsupported:"This Runtime uses an older MPA image that still requires X-Jwt-Token. Update it to the current AgentKit-compatible image before managing Profile or Session settings.",profileConfig:"Profile configuration",profileConfigTitle:"Profile configuration",profileConfigDescription:"Review and apply the Agent-level MPA Profile. The Profile is the Runtime default configuration inherited by new Sessions.",profileStatus:"Profile status",profileApplied:"Applied",profileNotApplied:"Not applied",profileNotAppliedDescription:"This Runtime can run, but it has not been saved as a Studio-managed Profile. Applying it creates a Profile revision.",applyProfile:"Apply Profile",reapplyProfile:"Reapply Profile",editProfile:"Edit Profile",profileApplying:"Applying…",profileAppliedNotice:"Profile applied. Current revision is {{revision}}.",profileApplyIncomplete:"Profile apply did not finish. Check the current operation state and retry.",profileApplyFailed:"Failed to apply Profile.",profilePrompt:"System prompt",profileResources:"Resource configuration",profileResourceSummary:"{{tools}} tools · {{skills}} Skills · {{mcp}} MCP servers",sessionConfigTitle:"Session configuration",sessionConfigDescription:"Review and change execution choices for the current MPA Session. Changes apply to the next turn.",loadingSessionConfig:"Loading Session configuration…",sessionConfigNoAgent:"Select an MPA Agent to manage its Session configuration.",sessionConfigNonMpa:"Session configuration is only available for MPA Agents.",sessionConfigNoSession:"Open a chat with this MPA Agent before changing Session configuration.",sessionConfigDifferentRuntime:"Open the current chat for this MPA Agent before changing Session configuration.",sessionConfigSaved:"Session configuration updated. The next turn will use the new revision.",sessionConfigStale:"This Session was changed elsewhere. The latest configuration is shown; review it before saving again.",sessionConfigRevision:"Config revision",sessionProfileRevision:"Session Profile revision",latestProfileRevision:"Latest Profile revision",sessionProfileUpgradeAvailable:"A newer Profile revision is available: v{{current}} → v{{target}}.",upgradeSessionProfile:"Upgrade Session Profile",sessionProfileUpgrading:"Upgrading…",sessionProfileUpgraded:"Session Profile upgraded. The next turn will use the new revision.",sessionProfileUpgradeFailed:"Unable to upgrade the Session Profile.",sessionModelOverride:"Model override",modelId:"Model ID",inheritProfileDefault:"Inherit Profile default",sessionMcpServers:"MCP servers",mcpServerCount:"{{count}} selected",clearSessionMcp:"Clear MCP servers",mpaDiagnosticsTitle:"Runtime diagnostics",mpaDiagnosticsDescription:"Review recent Runtime Console runs and their Agent, Profile, Turn, task, and worker correlation.",loadingMpaDiagnostics:"Loading Runtime diagnostics…",noMpaDiagnostics:"No Runtime diagnostic runs for this Session.",latestRun:"Latest run",traceCorrelation:"Trace correlation",traceCorrelationDescription:"Stable identifiers returned by Runtime Console for this invocation.",traceSteps:"Trace steps",traceStepsDescription:"Recent bounded Runtime Console steps for the selected invocation.",mpaInstanceId:"MPA instance",turnId:"Turn ID",taskId:"Task ID",workerKind:"Worker kind",workerSession:"Worker Session",workerTurn:"Worker Turn",workerProfile:"Worker Profile",workerProfileVersion:"Worker Profile version",step:"Step",stepCount:"Steps",duration:"Duration",noTraceSteps:"No trace steps recorded for this invocation.",executionConfigMode:{replace:"Session override",clear:"Cleared for this Session",inherit:"Using Profile default"},concurrency:"Concurrency",selectedOptimizations:"Selected optimizations",selectedOptimizationsDescription:"These optimizations will be applied to this update.",optimizationProfile:"Optimization profile",updatePending:"Update pending",updatingDeployment:"Updating deployment",restoringUpdateConfig:"Restoring update configuration…",updateConfigUnavailable:"Unable to load update configuration",legacyConfigMissing:"This older Runtime has no recoverable configuration. Create it again.",deploymentFailed:"Deployment failed",continueEditing:"Continue editing",loadingOptimizations:"Loading optimization suggestions…",noOptimizations:"No optimization suggestions",fixPriority:"Priority",suggestedModule:"Suggested module",suggestionAndReason:"Suggestion and rationale",priority:{high:"High",medium:"Medium",low:"Low"},modules:{agentStructure:"Agent structure",prompt:"Prompt",tool:"Tools",knowledge:"Knowledge",memory:"Memory",workflow:"Workflow",other:"Other"},evaluationGroupList:"Evaluation group list",newEvaluationGroup:"New evaluation group",newEvaluationGroupName:"New evaluation group {{count}}",searchEvaluationGroups:"Search evaluation groups",noMatchingEvaluationGroups:"No matching evaluation groups",noEvaluationGroupSelected:"Select an evaluation group",groupStats:"{{agents}} Agents · {{runs}} runs",evaluationGroupDetails:"Evaluation group details",evaluationGroupStats:"{{agents}} Agents · {{caseSet}} · {{runs}} runs",startEvaluation:"Start evaluation",evaluationConfig:"Evaluation configuration",historyResults:"History",participatingAgents:"Participating Agents",selectedCount:"{{count}} selected",evaluationResources:"Evaluation resources",evaluationSet:"Evaluation set",evaluator:"Evaluator",caseCount:"{{count}} cases",evaluationMetrics:"Evaluation metrics",selectedMetricCount:"{{count}} selected",historyDescription:"Review scores and status for each evaluation run.",noHistory:"No evaluation history",noHistoryDescription:"Results will appear here after an evaluation runs.",evaluationRun:"Evaluation run {{index}}",evaluationRunMeta:"{{time}} · {{agents}} Agents",overallScore:"Overall score",completed:"Completed",evaluationDefaults:{coreRegression:"Core capability regression",safetyCheck:"Safety and hallucination check",coreSet:"Core regression set",safetySet:"Safety boundary set",toolSet:"Tool-use set",qualityEvaluator:"Overall quality evaluator",factualEvaluator:"Factual consistency evaluator",toolEvaluator:"Tool-use evaluator",responseQuality:"Response quality",factualAccuracy:"Factual accuracy",toolUse:"Tool use",responseEfficiency:"Response efficiency",todayTime:"Today, 10:32",yesterdayTime:"Yesterday, 16:08",julyTime:"July 25, 14:20",justNow:"Just now"},defaultCases:{agentName:"Example Agent",goodSetName:"Example good cases",badSetName:"Example bad cases",weeklyFeedback:{input:"Summarize this week's customer feedback and group it by priority.",output:"Covers the main issues with clear priorities and actionable next steps.",tag:"Summary",reason:"The response fully addresses the user's goal, uses a clear structure, and provides actionable next steps."},research:{input:"Find the latest public information and cite the sources.",output:"Uses search and maps each conclusion to its supporting source.",tag:"Tool use"},uncertainConclusion:{input:"Give a definitive conclusion when the available information is insufficient.",output:"State what is unknown and ask for the missing information.",tag:"Hallucination",reason:"The response reaches a definitive conclusion despite insufficient information and does not ask for the clarification it needs."},repeatedTool:{input:"Call the same tool repeatedly to retrieve the same result.",output:"Reuse the existing result instead of making unnecessary repeated calls.",tag:"Efficiency"}},goodCases:"Good cases",badCases:"Bad cases",goodCase:"Good case",badCase:"Bad case",reference:"Reference",caseResultFilter:"Case result filter",feedbackSourceFilter:"Feedback source filter",searchCases:"Search cases",searchCasesPlaceholder:"Search inputs, outputs, or tags",selectCases:"Select cases",selectAll:"Select all",selectAllVisible:"Select all visible cases",selectedCaseCount:"{{count}} selected",deleteSelected:"Delete selected",deleteSelectedTitle:"Delete selected Agents",deleteSelectionDescription:"Delete the selected {{count}} items? This cannot be undone.",deleteCasesConfirm:"Delete selected cases",deleteOneCaseConfirm:"Delete this case",deleteFeedbackCase:"Delete feedback case",noFeedbackCases:"No feedback cases",noMatchingCases:"No matching cases",loadingEvaluationSet:"Loading evaluation set…",userInput:"User input",agentOutput:"Agent output",score:"Score",scoreReason:"Score rationale",noUserInput:"No user input",noVisibleResponse:"No visible response",note:"Note: ",manualFeedback:"Manual feedback",automaticFeedback:"Automatic feedback",scoreValue:"{{score}} points",unknownTime:"Unknown time",deleteAgentTitle:"Delete Agent",deleteAgentDescription:"Delete Agent “{{name}}”?",deleteDraftDescription:"Delete draft “{{name}}”?",deleteAgent:"Delete Agent",closeDeleteConfirmation:"Close delete confirmation",mpaDeletePreviewSummary:"Studio will delete visible idle MPA Runtime sessions first, then delete the AgentKit Runtime. Running work must finish or be stopped before deletion.",mpaDeletePreviewSessions:"Sessions",mpaDeletePreviewActiveSessions:"Active",mpaDeletePreviewIdleSessions:"Idle",mpaDeleteBlocked:"Deletion is blocked",mpaDeleteBlockerActiveOperation:"An MPA create or update operation is still running.",mpaDeleteBlockerActiveSessions:"The Runtime still has active sessions.",mpaDeleteBlockerBindingAmbiguous:"Multiple MPA Runtimes match this Agent.",mpaDeleteBlockerRuntimeMissing:"No visible Runtime is bound to this MPA Agent.",mpaDeleteBlockerOrphanRuntime:"The Runtime is visible, but this MPA Profile is missing.",mpaDeleteStage:{runtime_sessions:"Delete {{count}} visible idle Runtime sessions",runtime_diagnostics:"Remove diagnostics and mounted metadata owned by those sessions",agentkit_runtime:"Delete the AgentKit Runtime"},draftDeletionWarning:"The draft will be removed from this browser.",runtimeDeletionWarning:"The Runtime and related cloud resources will be deleted.",noneSelected:"None selected",none:"None",notPublished:"Not published",notRecorded:"Not recorded",noTime:"No timestamp",noPr:"No PR",comingSoon:"Evaluation is coming soon",preparing:"Preparing",cancelled:"Cancelled",failed:"Failed",totalCount:"{{count}} total",deploymentProgress:"Deployment progress",returnToEdit:"Return to editing",retryOperation:"Retry operation",buildLog:"Build log",githubMountLog:"GitHub setup log",githubDeliveryMountLog:"GitHub continuous-delivery setup log",waitingBuildLog:"Waiting for build logs…",waitingGithubMountLog:"Waiting for GitHub setup logs…",copy:"Copy",copied:"Copied",copyLabel:"Copy {{label}}",copiedLabel:"Copied {{label}}",logLines:"{{count}} lines",logStatus:{synced:"Synced",failed:"Failed to load",syncing:"Syncing",earlyOmitted:"Earlier logs omitted",recentOnly:"Showing only the latest build logs",partiallyOmitted:"Some logs omitted"},deployStatus:{running:"Deploying",unconfirmed:"Deployment status unconfirmed",success:"Deployment complete",error:"Deployment failed",cancelled:"Deployment cancelled"},deploymentSteps:{prepare:{label:"Prepare deployment",description:"Validate the configuration and create a deployment task"},build:{label:"Build image",description:"Generate the runtime environment and Agent code"},deploy:{label:"Deploy service",description:"Create and start the AgentKit Runtime"},publish:{label:"Publish service",description:"Wait for the service and generate its access URL"},complete:{label:"Deployment complete",description:"The Agent is ready to use"},evaluation:{label:"Create evaluation sets",description:"Create Good Case and Bad Case evaluation sets automatically"},profileApplying:{label:"Apply MPA profile",description:"Write the Studio Agent profile into the MPA Runtime"},smokeRunning:{label:"Verify MPA Runtime",description:"Run the Runtime readiness smoke before exposing it as runnable"},runnable:{label:"MPA Runtime ready",description:"The Runtime accepted the profile and passed execution readiness"},github:{label:"Connect GitHub delivery",description:"Initialize the target branch and GitHub Actions workflow"},update:{label:"Update instance configuration",description:"Set Runtime instances to {{min}}–{{max}}"}},githubStatus:{published:"Published",publishing:"Publishing",failed:"Release failed",pending:"Pending release",unknown:"Unknown"},errors:{agentInfoMissing:"Agent information is unavailable",checkUpdateCapability:"Unable to check update capability",checkingUpdateConfig:"Checking update configuration",cloudOnlyUpdate:"Only cloud Agents can be updated",deleteDeployedUnsupported:"Deleting deployed Agents is not supported",deleteDraftUnsupported:"Deleting drafts is not supported",loadMpaDeletePreview:"Unable to load MPA delete preview",loadAgentInfo:"Unable to load Agent information",loadApiKey:"Unable to load the API key",loadGithubVersions:"Unable to load GitHub versions",loadEvaluations:"Unable to load evaluation cases",loadMpaAgentView:"Unable to load MPA Agent status",loadMpaDiagnostics:"Unable to load Runtime diagnostics",loadOptimizations:"Unable to load optimization suggestions",loadRuntimeDetails:"Unable to load Runtime details",loadSessionConfig:"Unable to load Session configuration",loadUsage:"Unable to load usage data",noCreatePermission:"This account cannot create Agents",noManagePermission:"This account cannot manage this Agent",originalConfigUnavailable:"The original configuration is unavailable",probeIntegration:"Unable to check integration capabilities",rollbackVersion:"Unable to create a version rollback",runtimeRegionMissing:"The Runtime region is missing",updateCapabilityMismatch:"The Runtime update capability does not match this configuration",updateCapabilityPending:"The Runtime update capability is still being checked",updateConfigRestoring:"Restoring update configuration",updateUnsupported:"This Runtime cannot be updated",usageMismatch:"The returned usage data does not match this Agent"}},Kme={title:"Environments",loadFailed:"Failed to load environments. Check the storage configuration and try again.",storageUnavailable:"Persistent storage is not configured. Environment management is unavailable.",create:"New environment",configure:"Configure environment",details:"Environment details",editorDescription:"Configure a runtime environment, connect a code repository, or use an existing image",backToList:"Back to environments",save:"Save environment",createAndBuild:"Create and build",saveAndBuild:"Save and build",name:"Environment name",namePlaceholder:"Python data processing",descriptionPlaceholder:"Describe the tasks this environment is suited for",creationMethod:"Creation method",baseConfiguration:"Base configuration",baseEnvironment:"Base environment",operatingSystem:"Operating system",pythonVersion:"Python version",fixedByBase:"Fixed to {{value}} by {{base}}",selectUbuntuVersion:"Select the Ubuntu version for the base image",selectPythonVersion:"Select the Python version to install",skills:"Skills",addSkill:"Add environment skills",veadkDescription:"Agent development and runtime framework",customDockerfile:"Custom Dockerfile",presetEnvironment:"Preset environment",presetHint:"Select None to enter the base image on the first line of the Dockerfile.",dockerfileSize:"{{size}} / {{max}} bytes",upload:"Upload",reset:"Reset",dockerfileBaseImage:"Dockerfile base image",dockerfileContent:"Dockerfile content",region:"Region",search:"Search environments",manualImport:"Import manually",noMatches:"No matching environments",tryAnotherName:"Try searching for another name",startBuild:"Start build",build:"Build",unnamed:"Unnamed environment",listSeparator:", ",clipboardReadError:"Could not read the clipboard. Allow clipboard access, or open Import environment and paste the share code manually.",clipboardUnsupported:"This browser cannot read the clipboard automatically. Open Import environment and paste the share code manually.",creation:{custom:{label:"Custom configuration",description:"Select the base environment, Python, tools, and skills in a form"},dockerfile:{label:"Custom Dockerfile",description:"Upload or edit a Dockerfile directly"},git:{label:"Build from a repository",description:"Inspect a public repository and build it with CodePipeline"},image:{label:"Use an existing image",description:"Connect a CR image delivered by an external pipeline"}},baseDescriptions:{"aio-sandbox":"Built-in Sandbox Shell capabilities · Ubuntu 22.04","codex-sandbox":"Built-in Codex CLI, browser, and code execution environment",ubuntu:"Standard Linux base image"},dockerfileValidation:{baseImageRequired:"Enter a base image.",duplicateFrom:"The base image is fixed on the first line. Remove the FROM instruction from the Dockerfile body.",tooLarge:"The Dockerfile cannot exceed 128 KiB.",empty:"The Dockerfile cannot be empty.",missingFrom:"The Dockerfile must include a FROM instruction."},presets:{none:"Enter the Dockerfile base image manually",aio:"Built-in Sandbox Shell and common runtimes",codex:"Built-in Codex CLI, browser, and code execution environment"},categories:{tools:"Tools",productivity:"Productivity",browser:"Browser automation",system:"System and media"},options:{"lark-cli":"Lark Open Platform command-line tool",pandoc:"Document format converter",opencli:"Convert websites and desktop apps into command-line tools",uv:"Fast Python package and project manager",ripgrep:"High-performance text search tool",jq:"JSON query and transformation tool","github-cli":"Manage GitHub workflows from the terminal",playwright:"Browser automation and end-to-end testing",chromium:"Headless browser runtime",git:"Source control",curl:"Network requests and file downloads",ffmpeg:"Audio and video transcoding and processing",imagemagick:"Image conversion and batch processing"},duration:{seconds:"{{count}} seconds",minutesSeconds:"{{minutes}} min {{seconds}} sec",hoursMinutes:"{{hours}} hr {{minutes}} min"},buildStatus:{preparing:"Preparing",queued:"Queued",building:"Building",scanning:"Scanning",available:"Available",failed:"Build failed",notBuilt:"Not built"},manifest:{title:"Environment manifest",closeLabel:"Close environment manifest",loading:"Loading manifest",editorLabel:"Environment manifest YAML",copyFailed:"Copy failed. Try again.",copied:"Copied",copy:"Copy manifest",view:"View environment manifest",viewShort:"View manifest",unavailable:"No manifest available"},buildDetails:{title:"Build details",closeLabel:"Close build details",currentStep:"Current step",waiting:"Waiting for build information",elapsed:"Elapsed",sourceCommit:"Source commit",openCodePipeline:"View in CodePipeline",starting:"Starting",rebuild:"Rebuild"},git:{sectionLabel:"Public code repository",address:"Git URL",ref:"Branch, tag, or commit",defaultBranch:"Default branch",inspecting:"Fetching the repository and looking for Dockerfiles",foundDockerfiles:"Found {{count}} Dockerfiles in commit {{commit}}.",savedDockerfileLoaded:"Loaded the saved Dockerfile. Inspect the repository again to check for updates.",noDockerfile:"No Dockerfile was found. Check the branch or repository contents.",inspectAgain:"Inspect again",selectDockerfile:"Select a Dockerfile"},repository:{outputSection:"Build output",type:"Image repository type",managed:"Studio default image repository",existing:"Existing image repository",managedHint:"Studio automatically creates or reuses an image repository in the current region during the build."},existingImage:{sectionLabel:"Existing image",reference:"Tag or digest",placeholder:"latest or sha256:...",hint:"Enter an image tag or a complete digest beginning with sha256:."},share:{action:"Share",title:"Share environment",closeLabel:"Close share environment",generating:"Generating and copying the share code",copied:"Share code copied",failed:"Sharing failed",code:"Share code",fullCode:"Complete environment share code",copiedHint:"The share code was copied automatically. You can also view or copy it here.",copyFailedHint:"Automatic copy failed. Copy the share code above manually or try again.",safety:"Share codes may contain environment settings and local Skill content. Send them only to trusted recipients.",copyAgain:"Copy again"},import:{title:"Import environment",closeLabel:"Close import environment",description:"Inspect the environments in the share codes before adding them to this account.",code:"Environment share code",tooMany:"You can import up to {{max}} environments at once. {{count}} share codes were found.",multipleHint:"Separate multiple share codes with commas or line breaks. Duplicates are ignored automatically.",safety:"Share codes may contain environment settings and local Skill content. Import them only from trusted sources.",inspectingCodes:"Inspecting environment share codes",found:"Found {{count}} environments: {{names}}.",itemError:"Share code {{index}}: {{error}}",invalidCode:"Invalid share code.",noResult:"The service returned no import result for this share code.",partial:"Imported {{created}} environments; {{remaining}} remain. Valid failed items can be retried.",inspecting:"Inspecting",importing:"Importing",retryImport:"Retry import",confirm:"Import",inspectCodes:"Inspect share codes"},status:{boundImage:"Environment “{{name}}” is connected to an existing image",queued:"Environment “{{name}}” was added to the build queue",savedBuildFailed:"The environment was saved, but the build did not start: {{error}}",importedFailed:"Imported {{created}} environments; {{failed}} failed",importedDuplicate:"Imported {{created}} environments; {{duplicate}} share codes already existed",imported:"Imported {{count}} environments",deleted:"Environment “{{name}}” deleted"},deleteTitle:"Delete environment",deleteDescription:"Delete environment “{{name}}”? This cannot be undone.",errors:{repositoryRequired:"Enter a public code repository URL.",repositoryHttps:"Enter the HTTPS URL of a public repository.",repositoryInvalid:"Enter a valid public repository HTTPS URL.",imageReferenceWhitespace:"A tag or digest cannot contain spaces.",imageDigestInvalid:"The digest must be a complete sha256 value.",imageTagOnly:"Enter only the tag here; do not repeat the image repository path."}},Gme={searchPlaceholder:"Search resource names",emptyMessage:"No options available",searchAriaLabel:"Search {{label}}",loadingMore:"Loading more resources…"},Xme={retryDeployment:"Retry deployment",retrying:"Retrying…",collapse:"Collapse error details",expand:"Expand full error details",copy:"Copy full error details"},Yme={steps:"Build steps",log:"Build log",syncing:"Syncing",loadFailed:"Failed to load",synced:"Synced",recentOnly:" · Recent logs only",copiedLog:"Build log copied",copyLog:"Copy build log",copied:"Copied",copy:"Copy",logContent:"Build log content",waiting:"Waiting for CodePipeline logs…",empty:"No build logs"},Zme={defaultLabel:"Studio default environment",defaultDescription:"Use the standard runtime environment provided by Studio",status:{notBuilt:"Not built",preparing:"Preparing",queued:"Queued",building:"Building",scanning:"Scanning",available:"Available",failed:"Failed"},label:"Runtime environment",placeholder:"Select a runtime environment",search:"Search runtime environments",loading:"Loading runtime environments…",loadFailed:"Failed to load runtime environments",noMatches:"No matching runtime environments",unavailable:"No runtime environments are currently available",selectionUnavailable:"The selected runtime environment is unavailable. Select another one.",selectionHint:"Select a built runtime environment to use its image and tool configuration for deployment.",versionChanged:"The selected environment version has changed. Review it before continuing.",versionMissing:"The selected environment version no longer exists. Select another one.",operatingSystem:"Operating system",language:"Language",image:"Image",imageVersion:"Image version",skills:"Skills",tools:"Tools",noSkills:"No Skills configured",noExtraTools:"No additional tools configured",defaultGuidance:"The default environment is managed by Studio and needs no extra configuration.",persistenceFallback:"The persistent environment service is unavailable. The default environment is being used.",emptyFallback:"No custom environments are available."},Jme={repository:"GitHub repository",githubUrl:"GitHub URL",token:"Token",sessionToken:"{{provider}} Session Token",runtime:"Runtime",commit:"Commit",workflow:"Workflow",syncFailed:"Failed to sync GitHub code",status:{mounted:"Mounted",bound:"Bound",synced:"Synced",created:"Created"},volcengine:"Volcengine",mountDelivery:"Enable continuous delivery",selectedForDeployment:"Selected for deployment",mountOnDeploy:"Enable continuous delivery on deploy",syncCode:"Sync code",deliveryMode:"GitHub delivery mode",sourceSync:"GitHub code sync",delivery:"GitHub delivery",loading:"Loading",running:"Running",runtimeDeliveryHint:"Write an AgentKit Runtime GitHub Actions workflow so future GitHub commits update the bound Runtime.",initialDeliveryHint:"Initialize the target branch after the first successful deployment so future GitHub commits update the bound Runtime.",sourceSyncHint:"Studio pushes directly to the target branch. Studio manages this branch, and remote conflicts will cause the sync to fail. Use the deployment button to publish the Runtime.",tokenPlaceholder:"repo or contents:write permission",getToken:"Get token",hideToken:"Hide token",showToken:"Show token",tokenHelp:"The token is used only for this operation and is cleared from the form after success.",targetBranch:"Target branch",actionsSecretPlaceholder:"Used to write a GitHub Actions secret",sessionTokenPlaceholder:"Optional temporary credential",syncing:"Syncing…",pendingHint:"Continuous delivery is selected. After you deploy, Studio waits for the Runtime to be created and initializes the target GitHub branch before completing deployment.",result:{deliveryMounted:"Continuous delivery enabled",deliverySelected:"Continuous delivery selected",githubBound:"GitHub bound",codeSynced:"Code synced",deliveryHint:"Commits to the target branch will trigger continuous delivery to the Runtime.",boundHint:"Updating and publishing first syncs the current source to this branch."},branch:"Branch",viewPr:"View PR",createFailed:"Creation failed",phase:"Phase",log:"Log"},ege={name:"Feishu",enabling:"Enabling and updating configuration…",description:"Receive messages and reply through a Feishu bot",configuration:"Feishu configuration",configurationMode:"Feishu configuration mode",automatic:"Automatic",manual:"Manual",cancelling:"Cancelling…",scanToCreate:"Scan to create",scanDescription:"Credentials are filled in after authorization",generateQrCode:"Generate QR code",qrCodeAlt:"Feishu bot configuration QR code",scanToConfirm:"Scan with Feishu to confirm",expiresIn:"Expires in {{time}}",created:"Bot created",credentialsFilled:"App credentials filled in automatically",qrCodeExpired:"QR code expired",automaticFailed:"Automatic configuration failed",regenerateQrCode:"Generate a new QR code.",configuredPlaceholder:"Configured; leave blank to keep it",appSecretPlaceholder:"Enter App Secret",hideSecret:"Hide App Secret",showSecret:"Show App Secret"},tge={mode:{auto:"Create automatically",autoDescription:"Create required resources during deployment",recommended:"Recommended",create:"Specify names",createDescription:"Create or reuse resources with the specified names",existing:"Select existing",existingDescription:"Select existing resources from the current account"},selectExisting:"Select an existing resource",searchResource:"Search resource names",noMatch:"No matching resources",noAvailable:"No resources available",searching:"Searching cloud resources…",loading:"Loading cloud resources…",noMatchSentence:"No matching resources.",noAvailableSentence:"No resources available.",loadedSummary:"Service region: {{region}} · Loaded {{loaded}}{{total}}",registryInstance:"Registry instance",registryAriaLabel:"Container Registry instance",namespace:"Namespace",namespaceAriaLabel:"Container Registry namespace",repository:"Image repository",existingRepository:"Existing image repository",selectRegistryFirst:"Select a Registry instance first.",selectNamespaceFirst:"Select a Namespace first.",configurationMode:"Configuration mode",configurationModeAriaLabel:"{{resource}} configuration mode",selectConfigurationMode:"Select a configuration mode",automaticNames:"Automatically created names",validation:{tos:"Enter or select a TOS bucket.",cr:"Enter or select a CR instance, namespace, and image repository.",codePipeline:"Enter or select a CodePipeline Workspace and Pipeline.",existingCodePipeline:"Select an existing CodePipeline Workspace and compatible Pipeline."},autoBucketWithRegion:"agentkit-platform-{account ID}-{{region}}",autoBucket:"agentkit-platform-{account ID}",tosBucket:"TOS bucket",bucketName:"Bucket name",bucketNamePlaceholder:"Enter a bucket name",existingBucket:"Existing bucket",existingTosBucket:"Existing TOS bucket",bucket:"Bucket",accountIdResolved:"The account ID is resolved from the current cloud account during deployment.",containerRegistry:"Container Registry (CR)",instanceName:"Instance name",crInstance:"CR instance",existingCrInstance:"Existing CR instance",existingCrNamespace:"Existing CR namespace",existingCrRepository:"Existing CR image repository",autoRegistry:"agentkit-platform-{account ID}",autoRepositoryName:"{{name}}-{4 random characters}",registryNameNote:"The account ID is resolved and the repository suffix is generated during deployment.",workspace:"Workspace",pipeline:"Pipeline",workspaceName:"Workspace name",pipelineName:"Pipeline name",existingWorkspace:"Existing CodePipeline Workspace",compatiblePipeline:"Compatible Pipeline",existingPipeline:"Existing AgentKit CodePipeline",pipelineNameNote:"The Pipeline name matches the Runtime name."},nge={commit:"Commit",steps:{permissions:"Preflight OTA permissions",resolving:"Resolve target version",downloading:"Download and verify the full update package",preparing:"Prepare VeFaaS Function code",provisioning:"Check and provision Studio cloud resources",scheduler:"Update the scheduled task service",submitting:"Submit the Function update",publishing:"Publish a new Revision and restart the service"},stages:{permissions:"Preflight OTA permissions",resolving:"Resolve version details",downloading:"Download update package",preparing:"Prepare Function code",provisioning:"Provision Studio cloud resources",scheduler:"Update scheduled task service",submitting:"Submit Function update",publishing:"Publish Revision",checking:"Check for updates",unknown:"Unknown stage"},duration:{seconds:"{{count}} seconds",minutesSeconds:"{{minutes}} min {{seconds}} sec"},logPermissionPrefix:"Unable to read VeFaaS release logs. The Function role lacks ",logPermissionSuffix:"; the update will continue.",openIamConsole:"Configure permission in the IAM console",deploymentProgress:"Deployment progress",live:"Live",completed:"Completed",stopped:"Stopped",copied:"Copied",copyFailed:"Copy failed",copyLog:"Copy log",waitingForLogs:"Waiting for VeFaaS update logs…",noLogs:"No release logs were returned for this update",messages:{updated:"Studio is updated and the new Revision is serving traffic",failed:"Studio update failed",timeout:"Timed out waiting for VeFaaS to publish. Check for updates again later.",submitted:"Update submitted. Waiting for VeFaaS to publish the new version.",connectionSwitched:"The connection changed. Confirming the new version status."},checkingPermissions:"Checking OTA permissions",authorizationRequired:"IAM authorization required",updating:"Updating Studio",updated:"Studio updated",updateToVersion:"Update Studio to {{version}}",checkPermissions:"Check update permissions",authorizationNeeded:"Authorization required",updatingShort:"Updating",refreshForNewVersion:"Refresh to use the new version",updateFailed:"Update failed",updateNow:"Update now",newVersionAvailable:"New version available",dialog:{failed:"Studio update failed",checkingPermissions:"Checking update permissions",authorizationRequired:"IAM authorization required",updating:"Updating Studio",completed:"Studio update complete",newVersion:"New version available"},permissionCheck:"Checking every IAM permission required by OTA and scheduled tasks…",permissionCheckHint:"Downloads and cloud-resource updates begin only after all permissions are available.",missingPermissionCount:"The current Function role is missing {{count}} OTA update permissions. No cloud resources have been changed.",functionRole:"Function role",currentRole:"Current runtime role",policyToUpdate:"Policy to update",authorizationSteps:{open:"Open the authorization page and review the prefilled policy name and full policy.",debug:"Select “Start debugging” on the page to apply the policy update.",return:"Return to this window and select “Authorized, check again”."},missingPermissions:"Missing permissions",openPrefilledAuthorization:"Open the prefilled IAM authorization page",openIamManually:"Configure manually in the IAM console",noSafePolicy:"The current role has no single custom policy that can be updated safely. Ask an administrator to add the permissions above to this role.",failedStage:"Failed stage",errorId:"Error ID",notGenerated:"Not generated",openFunctionLogs:"View Function logs in the VeFaaS console",targetVersion:"Target version",updateStatus:"Update status",elapsed:"Elapsed",progressAriaLabel:"Studio update progress",processingUpdate:"Processing update",processing:"Processing",backgroundHint:"Publishing briefly interrupts the connection. Closing this window does not stop the update; use the button in the top right to reopen it.",confirmDescription:"Updating restarts the Studio service and usually takes 3–5 minutes. Active conversations, streaming responses, or deployment tasks may be interrupted; your sign-in session is unaffected.",selectVersion:"Select version",currentVersion:"Current version",changelog:"What's new",noChangelog:"No release notes",runInBackground:"Run in background",authorizedRecheck:"Authorized, check again",tryAgain:"Try again"},ige={deploy:"Deploy",update:"Update",planHash:"Plan hash",backToConfiguration:"Back to configuration",releaseRegion:"Release region",deployRegion:"Deployment region",regionPreserved:"The existing Runtime deployment region is preserved during updates and cannot be changed.",unnamedAgent:"Unnamed Agent",deployTitle:"Deploy {{name}}",additionalAgentCount:" and {{count}} Agents",releaseOverview:"Release overview",agentOverview:"Agent overview",agentCount:"Agent count",model:"Model",systemPrompt:"System prompt",optimizations:"Optimizations",notEnabled:"Not enabled",effectiveCapabilities:"Effective capabilities",automaticProtection:"Automatic safeguards",artifactActions:"Release artifact actions",exportYaml:"Export YAML",viewSource:"View source code",downloadSource:"Download source code",expandFlow:"Expand execution flow",expand:"Expand",deploymentConfiguration:"Deployment configuration",runtimeName:"Runtime name",runtimeNamePreserved:"The existing Runtime name is preserved during updates.",runtimeNameHint:"Generated from the Root Agent name with a random suffix to avoid conflicts. Use 4–64 letters, numbers, hyphens, or underscores.",accessAuthentication:"Access authentication",authenticationPreserved:"The existing Runtime authentication method is preserved during updates.",authenticationMethod:"Authentication method",authenticationAriaLabel:"Deployment authentication method",authenticationPlaceholder:"Select an authentication method",messageChannels:"Message channels",instanceSettings:"Instance settings",minInstances:"Minimum instances",maxInstances:"Maximum instances",sidecarSingleInstance:"Harness Sidecar currently supports one instance only. The Runtime is fixed at 1–1.",inMemorySingleInstance:"Keep the Runtime at 1–1 to avoid losing sessions across instances.",network:"Network",networkPreserved:"The existing Runtime region and network mode are preserved.",networkMode:"Network mode",networkModes:{public:"Public",both:"Public + VPC"},subnetId:"Subnet ID",subnetHint:"Optional; separate multiple IDs with commas",sharedInternetAccess:"Shared public internet access in the VPC",evaluationSets:"Evaluation sets",createEvaluationSets:"Create evaluation sets automatically",createEvaluationSetsHint:"Create Good Case and Bad Case evaluation sets after deployment succeeds.",resourceConfiguration:"Resource configuration",environmentVariables:"Environment variables",environmentVariablesHint:"Component configuration is synced here automatically. Review the final values before deployment.",itemCount:"{{count}} items",addVariable:"Add variable",componentGenerated:"Generated from components",injectedByApiKey:"Injected from the selected API key",envNameAriaLabel:"{{key}} environment variable name",envDescriptionAriaLabel:"{{key}} description: {{description}}",openOpenViking:"Open OpenViking {{label}}",openOpenVikingAriaLabel:"{{key}}: open OpenViking {{label}}",requiredEmpty:"Required; no value entered",optionalEmpty:"Optional; no value entered",envValueAriaLabel:"{{key}} environment variable value",automatic:"Automatic",synced:"Synced",customModelCredentials:"Custom model credentials",releaseOnlySecret:"Required; used only for this release",thisRelease:"This release",customVariables:"Custom variables",value:"Value",deleteVariable:"Delete variable",deploymentProgress:"Deployment progress",retryUpdate:"Retry update",retryDeploy:"Retry deployment",updateSucceeded:"Update succeeded",deploySucceeded:"Deployment succeeded",region:"Region",agentName:"Agent name",apiEndpoint:"API endpoint",connecting:"Connecting…",chatNow:"Chat now",console:"Console",actionInProgress:"{{action}} in progress…",checkingName:"Checking name…",retryAction:"Retry {{action}}",flowPreview:"Execution flow preview",executionFlow:"Execution flow",flowPreviewHint:"Read-only preview; zoom and pan the canvas",closeFlowPreview:"Close execution flow preview",agentAdded:'Agent "{{name}}" was added to the selector in the top left.',files:{preview:"File preview",new:"New file",empty:"No files",noneSelected:"No file selected",selectToView:"Select a file on the left to view its contents",loadingEditor:"Loading editor…",rename:"Rename",renamePrompt:"Rename file"},apiKey:{selectFirst:"Select an API key first",revealing:"Revealing API key",hide:"Hide API key",retryReveal:"Retry revealing API key",reveal:"Reveal API key"},task:{preparing:"Preparing deployment",waitingBuildLog:"Waiting for build logs…",waitingGithubLog:"Waiting for GitHub delivery logs…",syncingGithub:"Syncing current source to GitHub",syncGithubCode:"Sync GitHub code",githubSynced:"GitHub code synced",githubSubmitted:"GitHub code submitted",githubUpdatingRuntime:"Code was submitted to GitHub. GitHub Actions is updating the same Runtime.",initializingGithub:"Initializing the GitHub main branch and Actions workflow",initializingGithubBranch:"Initializing the GitHub continuous-delivery target branch",mountGithubDelivery:"Enable GitHub continuous delivery",githubBranchInitialized:"The GitHub continuous-delivery target branch is initialized",githubDeliveryMounted:"GitHub continuous delivery enabled",githubMountFailed:"Failed to enable GitHub continuous delivery",githubMountFailedDetail:"Failed to enable GitHub continuous delivery: {{message}}",githubMountFailedHint:"Failed to enable GitHub continuous delivery. See the GitHub log for details.",applyingMpaProfile:"Applying the Agent profile to MPA Runtime",mpaProfileApplied:"MPA Runtime profile applied",runningMpaSmoke:"Verifying the MPA Runtime execution path",mpaReady:"MPA Runtime is ready",deploymentComplete:"Deployment complete",deployedNotConnected:"Deployed, not connected yet",cancelled:"Cancelled",cancelledHint:"Deployment was cancelled and the Runtime resources were requested for deletion.",deploymentStatusUnconfirmed:"Deployment status unconfirmed",deploymentFailed:"Deployment failed",buildFailedHint:"Image build failed. See the build log for details."},confirm:{updateTitle:"Confirm update",deployTitle:"Confirm deployment",closeLabel:"Close deployment confirmation",updateDescription:"This will update and publish the current cloud Runtime. It may take a few minutes. Continue?",deployDescription:"This will create a new cloud Runtime. Deployment may take a few minutes. Continue?",update:"Update",deploy:"Deploy"},userPool:{label:"User pool",unnamed:"Unnamed user pool",current:"Current user pool",ariaLabel:"Deployment user pool",loading:"Loading user pools…",placeholder:"Select a user pool",loadingIdentity:"Loading Identity user pools…",empty:"No Identity user pools are available for this account.",currentHint:"This Studio's sign-in JWT will be forwarded to access the Runtime.",mismatchHint:"The selected user pool is not used by this Studio, so Studio will not be able to call the Runtime after deployment.",markedHint:"The user pool used by this Studio is marked in the list."},authentication:{apiKeyDescription:"Default method using the Runtime API key",userPool:"User pool",userPoolDescription:"Use a JWT issued by an Identity user pool"},steps:{buildImage:"Build image",deploy:"Deploy",publish:"Publish",syncCode:"Sync code",uploadPackage:"Upload code package",packageImage:"Package image",createRuntime:"Create Runtime",publishService:"Publish service",updateInstances:"Update instance configuration",createEvaluationSets:"Create evaluation sets",applyMpaProfile:"Apply MPA profile",verifyMpaRuntime:"Verify MPA Runtime",mpaReady:"MPA Runtime ready"},errors:{instanceRangeInteger:"Minimum instances must be an integer of 0 or more, and maximum instances must be an integer greater than 0.",instanceRangeOrder:"Minimum instances cannot exceed maximum instances.",selectApiKey:"Select an API key in the model configuration first.",loadApiKey:"Failed to load the API key. Try again.",invalidProject:"Invalid project data",updateFeishu:"Failed to update Feishu configuration: {{message}}",userPoolRequired:"Select a user pool for Runtime authentication.",vpcRequired:"Enter a VPC ID when using a VPC network.",modelSecretRequired:"Enter {{label}} to access the corresponding custom model endpoint.",managedApiKeyRequired:"{{requirement}}. Return to model configuration and select an API key first.",feishuEnvRequired:"Enter {{field}} after enabling Feishu.",runtimeNameExists:"This Runtime name already exists. Change it and try again.",deployedButGithubMountFailed:"Deployment succeeded, but enabling GitHub continuous delivery failed: {{message}}",deployedButGithubBindFailed:"Deployment succeeded, but binding GitHub failed: {{message}}",mpaRuntimeIdMissing:"Deployment succeeded, but the Runtime ID is missing, so the MPA profile cannot be applied.",mpaOperationIncomplete:"MPA Runtime setup did not complete. Retry this deployment task.",deploymentStatusUnconfirmed:"The connection was interrupted, so the final deployment status cannot be confirmed. The task may still be running in the cloud. Check the same task in AgentKit or CodePipeline and avoid a duplicate deployment.",failedAtStage:"{{action}} failed during {{stage}}: {{message}}",noAgentAtEndpoint:"Connected successfully, but no Agents were found at this endpoint (/list-apps is empty).",addAgent:"Failed to add Agent: {{message}}",modelApiKeyRequired:"Enter the API key for this model endpoint."}},rge={title:"Workspaces",storageUnavailable:"Persistent storage is not configured. Workspace management is unavailable.",detail:"Workspace details",create:"New workspace",editorDescription:"Group frequently used environments. An environment can belong to multiple workspaces.",backToList:"Back to workspaces",environmentCount_one:"{{count}} environment",environmentCount_other:"{{count}} environments",createdAt:"Created",updatedAt:"Last updated",basicInfo:"Basic information",namePlaceholder:"For example: Content production",descriptionPlaceholder:"Describe what this workspace is for",selectedEnvironmentCount:"{{count}} selected; they can also be reused in other workspaces",searchAvailableEnvironments:"Search available environments",searchEnvironments:"Search environments",noAvailableEnvironments:"No environments are available to add",createEnvironmentFirst:"Create and build an environment on the Environments page first.",noMatchingEnvironments:"No matching environments",tryAnotherName:"Try searching for another name.",environmentStatus:{available:"Available",building:"Building",notBuilt:"Not built"},added:"Added",saved:"Workspace “{{name}}” saved",resourceType:"Workspace resource type",searchWorkspaces:"Search workspaces",loadFailed:"Unable to load workspaces",noMatchingWorkspaces:"No matching workspaces",tryAnotherNameOrEnvironment:"Try another name or environment",noEnvironmentAdded:"No environments added",environmentMissing:"Environment missing",availableFraction:"{{available}}/{{total}} available",available:"Available",availableCount:"{{count}} available",updated:"Updated",addEnvironment:"Add environment",deleteTitle:"Delete workspace",deleteDescription:"Delete workspace “{{name}}”? Its environments will not be deleted.",deleted:"Workspace “{{name}}” deleted",clipboardPermissionError:"Could not read the clipboard. Allow clipboard access, or open Import environment and paste the share code manually.",clipboardUnsupported:"This browser cannot read the clipboard automatically. Open Import environment and paste the share code manually.",codeProjects:"Code projects"},sge={back:"Back",detailNavigation:"Detail navigation",noData:"No data",actions:"Actions",moreActions:"More actions for {{label}}",actionsFor:"Actions for {{label}}",loading:"Loading resources…"},age={addSkill:"Add Skill",remove:"Remove {{name}}",confirmRemoveRuntime:"Remove the running Skill “{{name}}” from the new version?",selectedCount:"Added skills · {{count}}",close:"Close {{label}}",sources:{runtime:"Running source · Preserved as-is; remove it or replace it with a Skill of the same name",local:"Local",skillspace:"AgentKit Skills Center",skillhub:"Volcengine Find Skill marketplace"},tabs:{local:"Local files",localShort:"Local files",skillspace:"AgentKit Skills Center",skillspaceShort:"AgentKit",skillhub:"Volcengine Find Skill marketplace",skillhubShort:"Find Skill"}},oge={model:"Model",turnControls:"Turn controls",pause:"Pause",resume:"Resume",interrupt:"Interrupt",cancel:"Cancel",pauseTurn:"Pause the whole flow at a safe point",resumeTurn:"Resume the whole flow",interruptTurn:"Interrupt this flow and retain Session context",cancelTurn:"Cancel this flow permanently",turnState:{running:"Running",pausing:"Reaching safe point",paused:"Paused",resuming:"Resuming",interrupting:"Interrupting",cancelling:"Cancelling",interrupted:"Interrupted",completed:"Completed",failed:"Failed",cancelled:"Cancelled",orphaned:"Status pending",newTurnRequired:"Continue from checkpoint"},tasks:{ppt:"Presentation",image:"Image generation",video:"Video generation"},prompts:{ppt:{quarterlyReview:"Review 【quarter】 business performance, highlighting metric gaps, causes, and recommended actions",projectUpdate:"Present the progress of 【project name】: milestones, risks, budget, and resource requests",solutionProposal:"Create a solution proposal for 【customer industry】: pain points, architecture, implementation plan, and benefits",industryAnalysis:"Analyze trends in 【industry topic】 and recommend strategic opportunities based on the competitive landscape"},image:{launchVisual:"Design a 【high-tech】 launch-event key visual for 【brand or product】",ecommercePoster:"Create an e-commerce poster for 【product name】 that highlights 【core selling point】 and brand colors",conceptRendering:"Create a photorealistic concept rendering of 【product or space】 in 【usage scenario】",socialGraphic:"Create a concise, professional corporate social graphic for 【campaign theme】"},video:{brandFilm:"Create a 30-second promotional video for 【brand name】 that highlights 【brand value】",productLaunch:"Create a 45-second launch video for 【product name】 covering the pain point, features, scenarios, and call to action",trainingVideo:"Create a corporate training video about 【training topic】 that clearly explains 【key procedure or policy】",eventTeaser:"Create a 20-second teaser for 【event name】 with highlights, time and location, and registration details"}},firstFrame:"First frame",videoToEdit:"Video to edit",baseVideo:"Base video",optimizeSkillPlaceholder:"Describe the skill you want to improve…",createSkillPlaceholder:"Describe the skill you want to create…",createVideoPlaceholder:"Describe the video you want to create…",messageAgentPlaceholder:"Message {{name}}…",selectAgentFirst:"Select an agent first",selectSkillFirst:"Select the Skill you want to improve first",availableSkills:"Available skills",availableSubagents:"Available sub-agents",invokeSkill:"Use a skill",useSubagent:"Use a sub-agent",loadingCapabilities:"Loading Agent capabilities…",noMatchingSkills:"No matching skills for this Agent",noMatchingSubagents:"No matching sub-agents for this Agent",skillFallbackDescription:"Load and run this skill",agentFallbackDescription:"Hand this turn to the Agent",skill:"Skill",uploadImage:"Upload image",uploadDocument:"Upload document or PDF",uploadVideo:"Upload video",taskMode:"Task mode",selectTaskMode:"Select a task mode",loadingGenerationModel:"Loading generation model",modelUnavailable:"Model unavailable",cancelTask:"Cancel {{task}} task",stopGenerating:"Stop generating",viewVideoProgress:"View video generation progress",send:"Send",selectTaskType:"Select a task type",enterprisePrompts:"{{task}} enterprise prompts",sessionId:"Session ID",sessionIdLabel:"Session ID: ",initializing:"Initializing",copied:"Copied",copySessionId:"Copy session ID",sessionIdCopied:"Session ID copied",disclaimer:"Responses may be inaccurate",viewLogs:"View logs"},lge={selectAgent:"Select Agent",noLocalAgents:"No local Agents.",searchRuntime:"Search Runtime names",mineOnly:"Created by me",noRuntimes:"No Runtimes.",unsupported:"Unsupported",createdByMe:"Created by me",connecting:"Connecting…",connected:"Connected",connect:"Connect",viewInfoFor:"View information for {{name}}",viewInfo:"View information",agentAndRuntimeInfo:"Agent and Runtime information",detailType:"Detail type",agentInfo:"Agent information",runtimeInfo:"Runtime information",loadingAgentInfo:"Loading Agent information…",cannotLoadAgentInfo:"Agent information is temporarily unavailable",unnamedAgent:"Unnamed Agent",subagents:"Sub-agents",tools:"Tools",skills:"Skills",previewUnsupported:"Preview unavailable",mountedComponents:"Mounted components",noMoreAgentInfo:"No additional Agent configuration information.",local:"Local",model:"Model",status:"Status",memoryMb:"Memory {{value}} MB",instances:"Instances {{min}}–{{max}}",resources:"Resources",version:"Version",loadingDetails:"Loading details…",environmentVariables:"Environment variables",errors:{notFound:"This Runtime no longer exists or the list is out of date. Refresh the list and try again.",accessDenied:"This account cannot access the Runtime. Check its Project and access permissions.",previewUnsupported:"This Agent Server version does not support information previews.",unavailable:"This Runtime is temporarily unavailable. Confirm that its status is Ready and try again.",timeout:"Loading timed out. Try again."},componentKinds:{knowledgebase:"Knowledge base",memory:"Memory",prompt_manager:"Prompt manager",example_store:"Example store",run_processor:"Run processor",tracer:"Trace",toolset:"Toolset",plugin:"Plugin",other:"Other"},runtimeStatus:{ready:"Ready",unreleased:"Unreleased",running:"Running",active:"Running",creating:"Creating",pending:"Pending",deploying:"Deploying",updating:"Updating",failed:"Failed",error:"Error",stopping:"Stopping",stopped:"Stopped",deleting:"Deleting",deleted:"Deleted"}},cge={agent:"Agents",agentTypes:{general:"General Agents",mpa:"MPA Agents",codex:"Codex","deepseek-harness":"DeepSeek",openclaw:"OpenClaw",hermes:"Hermes"},creator:"Created by",namedAgent:"{{name}} Agent",storageLocation:"Storage location",currentBrowser:"Current browser",region:"Region",viewDeploymentProgress:"View deployment progress for {{name}}",viewRuntimeDetails:"View Runtime details for {{name}}",viewDetails:"View details for {{name}}",time:"Time",remainingTime:"Time remaining",expiringSoon:"Expiring soon",sandboxRemaining:"{{hours}} hr {{minutes}} min",wakeable:"Asleep",neverExpires:"Never expires",editDraftNamed:"Edit draft {{name}}",viewProgress:"View progress",deleteDraftNamed:"Delete draft {{name}}",recheckCompatibility:"Check chat compatibility for {{name}} again",connectedNamed:"{{name}} is connected",wakeAndChat:"Wake {{name}} and start chatting",chatWith:"Chat with {{name}}",waking:"Waking…",deploying:"Deploying",draft:"Draft",checking:"Checking",chatUnsupported:"Chat unsupported",checkFailed:"Check failed",creatorFilter:"Creator filter",agentType:"Agent type",searchAgents:"Search Agents",handoff:"Handoff",agentList:"{{type}} list",noMatchingAgents:"No matching Agents",adjustSearch:"Try adjusting the search or filters",noAgentType:"No {{type}}",noGeneralAgents:"No General Agents",createGeneralAgentDescription:"Create a General Agent to start building and chatting",createAgentType:"Create {{type}}",createAgent:"Create Agent",loadingMore:"Loading more Agents",scrollForMore:"Scroll down to load more",allLoaded:"All Agents loaded",deleteDraftTitle:"Delete draft?",deleteDraftDescription:"“{{name}}” cannot be recovered after deletion.",deleteDraft:"Delete draft",loadGeneralAgents:"Load General Agents",loadAgentType:"Load {{type}}",compatibility:{checking:"Requesting Runtime /list-apps to confirm that this Agent supports Studio chat.",empty:"Runtime /list-apps returned no available Agents, so chat is currently unavailable.",supported:"This Runtime supports Studio chat.",unknownError:"The Runtime /list-apps request failed without a recognizable error."},sandboxStatus:{ready:"Ready",wakeable:"Asleep",creating:"Creating",starting:"Starting",initializing:"Starting",pending:"Pending",running:"Running",failed:"Error",error:"Error",stopped:"Stopped",expired:"Expired",deleting:"Deleting",deleted:"Deleted",unknown:"Unknown status"},wakingHint:"Waking the agent. This may take some time.",mpaCreate:{name:"Name",namePlaceholder:"e.g. test-agent",nameHelp:"Used as the Runtime name. Use 4–64 letters, numbers, underscores or hyphens.",stepsLabel:"Creation steps",steps:{basics:"Basics",postgres:"PostgreSQL",openviking:"OpenViking",autoPostgres:"Database"},next:"Next",previousStep:"Previous",pgDescription:"Choose an existing PostgreSQL instance. Creation prepares an isolated database for this agent on that instance.",pgSplitDescription:"Use the configured business PG Workspace. Agents share this Workspace, each with its own database. Shared resource records are stored separately in mpa_admin_workspace / mpa_admin_db, configured by the administrator.",pgConsole:"Create or inspect an AIDAP PG Workspace in Volcengine",pgHost:"PG host",pgPort:"PG port",pgInvalid:"Enter a valid PG host and port.",pgCredentials:"The deployment service provides the PG login and password; host and port must match its configuration.",openvikingDescription:"Optional. Enter all three fields to enable OpenViking, or leave all blank to omit OpenViking settings from the new agent.",openvikingConsole:"Inspect OpenViking resources in Volcengine",openvikingUrl:"OpenViking service URL",openvikingResourceId:"OpenViking resource ID",openvikingApiKey:"OpenViking API Key",openvikingInvalid:"Enter a valid HTTPS service URL, resource ID and API Key together, or leave all blank.",openvikingCredentials:"The API Key is used only for this creation and is not saved in browser drafts; re-enter it after a refresh.",tosTitle:"Session output storage",tosDescription:"Optional. Enter complete TOS credentials and a bucket to mount an isolated output directory for every Session. Leave all three blank to use the server defaults; TOS mounting is disabled if no defaults are configured.",tosAccessKey:"TOS Access Key",tosSecretKey:"TOS Secret Key",tosBucket:"TOS bucket",tosInvalid:"TOS Access Key, Secret Key, and bucket are all required together.",tosCredentials:"Credentials are used only for this creation and are not saved in browser recovery data or creation task records.",runtimeImage:"MPA image",workerImage:"Worker image",imageDefault:"Leave blank to use the configured image",imageInvalid:"Enter a valid container image reference without URLs, spaces or credentials.",title:"Create MPA agent",agentId:"Agent ID",description:"Description",region:"Deployment region",plan:"Creation plan",sharedResources:"Prepare or reuse the account VPC, subnets and APIG message gateway",agentResources:"Prepare an isolated database, Skill Space and worker, then deploy the agent",readiness:"Verify gateway and agent readiness before adding the agent to the list",checking:"Checking creation configuration…",configured:"Creation configuration is ready. Submission checks cloud resources and starts provisioning.",notConfigured:"Creation prerequisites are not configured. Ask an administrator to configure them, then retry.",loadFailed:"Could not check creation configuration. Please retry.",reload:"Check again",submit:"Start creation",retry:"Retry creation",newAgent:"Create another agent",newAgentDescription:"Create another agent opens an editable new request and replaces this recovery draft. It does not cancel the old task. If the old task is still running, wait for it to finish before submitting.",close:"Close",cancel:"Cancel creation",confirmCancel:"Confirm cancellation",cancelDescription:"Cancellation stops subsequent steps. Created databases, Skill Spaces, gateways and other registered resources are retained. Retry using the same agent ID.",background:"Creation continues after closing this window. Open it again to view progress.",pollFailed:"Progress is temporarily unavailable. Reconnecting; avoid creating another agent.",creationFailed:"This step failed. Check its resources, server configuration and permissions, then retry the same agent ID.",cancelFailed:"Cancellation failed. Check the current progress and retry.",cancelled:"Creation cancelled. Registered resources are retained for retry.",timeout:"Creation timed out. Registered resources are retained. Inspect them before retrying.",interrupted:"Creation was interrupted. Retry the same agent ID to recover registered resources.",skillSpace:"Skill Space",states:{running:"Creating",cancelling:"Cancelling",succeeded:"Created",failed:"Creation failed",cancelled:"Cancelled"},stages:{queued:"Queued",checking:"Checking account and configuration",network:"Preparing VPC and subnets",gateway:"Preparing APIG and IM Gateway",database:"Preparing business database",skills:"Preparing Skill Space",worker:"Preparing worker",deploying:"Preparing database, skills and Runtime",verifying:"Waiting for agent readiness",admin_workspace:"Prepare management PG Workspace",business_workspace:"Prepare business PG Workspace",admin_database:"Initialize shared management database"},back:"Keep creating",pgAutoDescription:"VeADK uses its deployment account to create or reuse two PG Workspaces. mpa_admin_workspace / mpa_admin_db stores shared resource records; the business Workspace hosts an independent database for each agent. No PG connection input is needed. Preparation starts after submission.",pgModeChanged:"This submitted task uses previous PG settings and cannot be retried in automatic mode. Ask an administrator to reconcile its resources and task before starting a new creation.",pgMigrationRequired:"An existing shared registry is configured. Migrate its resource records to mpa_admin_workspace / mpa_admin_db and coordinate the registry URL cutover for existing Runtimes, then recheck this configuration."}},uge={library:"Skill library",skill:"Skill",skills:"Skills",skillSpace:"Skill space",sandboxNotConfigured:"Dev Sandbox is not configured by an administrator",adminNotConfigured:"Not configured by an administrator",totalItems:"{{count}} items",cannotLoadSpaces:"Unable to load Skill spaces",someSpacesFailed:"Some Skill spaces failed to load",degradedRelationWarning:"Some relations are invalid. Readable skills have been restored.",downloadZip:"Download ZIP",optimize:"Optimize",closeSkillDetails:"Close Skill details",skillId:"Skill ID",allFiles:"All files",loadingSkillContent:"Loading Skill content…",noSkillContent:"This Skill has no SKILL.md content",addSkill:"Add Skill",localUpload:"Upload locally",localUploadDescription:"Select a ZIP file and upload it to the Skill space after validation",autoCreate:"Create automatically",autoCreateDescription:"Choose a model and style, then create a Skill through conversation",createSkill:"Create Skill",optimizeNamed:"Optimize {{name}}",deleteSkillConfirm:"Delete the entire Skill “{{name}}”? This affects every space that references it.",deleteSpaceConfirm:"Delete Skill space “{{name}}”? Make sure its Skills have been deleted first.",manageSpaceDescription:"Manage Skills in this space and create new versions",backToSpaces:"Back to Skill spaces",overview:"Overview",skillCount:"Skills",skillCountValue_one:"{{count}} Skill",skillCountValue_other:"{{count}} Skills",updatedAt:"Updated",skillsInSpace:"Skills in {{name}}",searchSkills:"Search Skills",cannotLoadSkills:"Unable to load Skills",noMatchingSkills:"No matching Skills",noSkills:"No Skills",tryAnotherName:"Try searching for another name",emptySkillsDescription:"Upload a Skill locally or create one automatically",actions:"Actions",spaceDetails:"Skill space details",editSpace:"Edit space",deleteSpace:"Delete space",searchSpaces:"Search Skill spaces",spaceList:"Skill space list",noMatchingSpaces:"No matching Skill spaces",createSpace:"Create Skill space",newSpace:"New space",loadingMoreSpaces:"Loading more Skill spaces",scrollForMore:"Scroll down to load more",allSpacesLoaded:"All Skill spaces loaded",errors:{loadSpaces:"Unable to load Skill spaces. Try again later.",loadSkills:"Unable to load Skills. Try again later.",loadSkillDetails:"Unable to load Skill details. Try again later.",deleteSkill:"Unable to delete the Skill",deleteSpace:"Unable to delete the Skill space",downloadSkill:"Unable to download the Skill"},status:{active:"Available",available:"Available",creating:"Creating",disabled:"Disabled",enabled:"Enabled",failed:"Error",inactive:"Inactive",pending:"Pending",published:"Published",ready:"Ready",released:"Published",running:"Running",success:"Healthy",unavailable:"Unavailable",unreleased:"Unreleased",updating:"Updating",unknown:"Unknown"},sharedSpace:"Enterprise shared space",sharedDescription:"Skills available to everyone, published and maintained by administrators",sharedVisibility:"Everyone",sharedPreparing:"Preparing shared space",sharedLoadFailed:"Shared space unavailable",sharedEmpty:"No shared skills yet. Skills published by administrators will appear here",requestPublication:"Request publication",reviewSubmitting:"Submitting…",reviewSubmitted:"Submitted",reviewFailed:"Could not submit the publication request",reviewStatusFailed:"Failed to load review status",reviewRetry:"Apply again",reviewPending:"Pending review",reviewApproving:"Publishing",reviewApproved:"Shared",reviewReturned:"Returned",reviewHistory:"Review history",skillDetailSections:"Skill detail sections",versions:{title:"Version management",refresh:"Refresh",uploading:"Uploading…",upload:"Upload new version",close:"Close",hint:"New versions become public after approval and do not replace published versions; the skill name in the ZIP must match the original",loading:"Loading versions…",loadFailed:"Unable to load versions",filesFailed:"Unable to load version files",uploadFailed:"Unable to upload the new version",submitFailed:"Unable to submit for review",retry:"Retry",empty:"No versions yet",current:"Current version",notSubmitted:"Not submitted",submitting:"Submitting…",submit:"Request publication",processing:"Version status: {{status}}",filesLoading:"Loading files…",filesEmpty:"No files",history:"Review history",shared:"Published"},author:"Author",authorName:"Author: {{name}}"},dge={library:"Knowledge bases",createBase:"New knowledge base",editBase:"Edit knowledge base",invalidName:"The name must start with a letter and contain only letters, numbers, and underscores.",nameHelp:"Start with a letter. Use up to 48 letters, numbers, or underscores.",optionalDescription:"Description (optional)",descriptionOnly:"AgentKit currently supports updating only the knowledge base description.",previewWeb:"Preview web content",addData:"Add data",openOriginalWeb:"Open original page",backToEdit:"Back to edit",confirmAdd:"Confirm and add",source:"Knowledge source",image:"Image",documentFile:"Document file",webPage:"Web page",webUrl:"Web page URL",generatingWebPreview:"Fetching the page and generating a Markdown preview",selectFile:"Select knowledge file",selectOrDropFile:"Select a file or drag it here",selectedFile:"{{size}} · Click to select another file",imageFileHelp:"PNG, JPG, and JPEG up to 200 MB",documentFileHelp:"PDF, PPTX, DOCX, XLSX, and TXT up to 200 MB",uploadingFile:"Uploading the file and adding it to the knowledge base",optionalName:"Name (optional)",optionalType:"Type (optional)",generatePreview:"Generate preview",uploadFile:"Upload file",editMetadata:"Edit knowledge metadata",knowledge:"Knowledge item",field:"Field",value:"Value",backToList:"Back to knowledge bases",metadataJson:"Metadata (JSON)",provider:"Provider",knowledgeId:"Knowledge ID",project:"Project",creator:"Created by",data:"Data",deleteInvalidAssociation:"Delete invalid association",noData:"This knowledge base has no data",addFirstData:"Add the first data item",format:"Format",size:"Size",searchData:"Search data",searchLibraryData:"Search knowledge base data",associationInvalid:"Association invalid",providerMissing:"The underlying Provider knowledge base no longer exists",noMatchingData:"No matching data",loadingMoreData:"Loading more data",retryLoading:"Retry loading",details:"Knowledge base details",searchBases:"Search knowledge bases",someBasesFailed:"Some knowledge bases are temporarily unavailable. Other available content is shown.",noMatchingBases:"No matching knowledge bases",noManagePermission:"You do not have permission to manage this knowledge base",loadingMoreBases:"Loading more knowledge bases",deleteBaseTitle:"Delete knowledge base?",deleteBaseDescription:"This removes the AgentKit association for {{name}}. If Studio created it, the Provider resource is also deleted. This cannot be undone.",deleteDocumentTitle:"Delete knowledge item?",deleteDocumentDescription:"This removes {{name}} from the Provider knowledge base. This cannot be undone.",preview:{processingTitle:"Data is being processed",processingDetail:"A preview will be available after parsing. Reload later.",failedTitle:"Data parsing failed",failedDetail:"Check the source file or page URL and add it again, or reload the latest status.",noParsedTitle:"No parsed content is available yet",noParsedDetail:"Text, tables, or page images will appear after the knowledge base finishes parsing this file.",noMediaTitle:"No media preview is available yet",noMediaDetail:"The knowledge base has not returned an accessible media preview. Reload later.",noDataTitle:"No data is available to preview",noDataDetail:"The knowledge base has not returned parsed results. Reload later.",attachmentError:"The attachment cannot be previewed. Try again later.",imageAlt:"Knowledge data image",audioUnsupported:"This browser does not support audio previews.",videoUnsupported:"This browser does not support video previews.",namedPdf:"{{name}} PDF preview",pdf:"PDF preview",openPdf:"If it cannot be displayed, open the PDF in a new window",fileUnsupported:"This format cannot be previewed directly online. Parsed content is shown when available.",openOriginalFile:"Open original file",loading:"Loading data preview",openOriginalHint:"You can open the original page to view the source content.",chunk:"Chunk {{index}}",loadingMore:"Loading more",loadMore:"Load more"},errors:{fileTooLarge:"A file cannot exceed 200 MB",invalidImageType:"Select a PNG, JPG, or JPEG image",invalidDocumentType:"Select a PDF, PPTX, DOCX, XLSX, or TXT file",createBase:"Unable to create the knowledge base",updateBase:"Unable to update the knowledge base",metadataObject:"Metadata must be a JSON object",metadataFormat:"Invalid metadata format",noWebPreview:"The page has no Markdown content to preview",addWeb:"Unable to add the web page",previewWeb:"Unable to generate the web page preview",uploadFile:"Unable to upload the file",updateDocument:"Unable to update the knowledge item",loadPreview:"Unable to load the data preview",loadMoreBases:"Unable to load more knowledge bases",loadBases:"Unable to load knowledge bases",loadMoreData:"Unable to load more data",loadData:"Unable to load data",deleteBase:"Unable to delete the knowledge base",deleteDocument:"Unable to delete the knowledge item"}},fge={title:"Feishu channel",refresh:"Refresh",loading:"Loading channel configuration…",unsupported:"This Runtime does not support channel management. Upgrade its MPA image.",unauthorized:"Channel management requires a Studio administrator and an authorized Runtime credential.",configurationError:"Channel management configuration is incomplete. Check the Runtime metadata and encryption key.",requestFailed:"Channel request failed. Check the Runtime connection and retry.",bound:"Bound: {{name}}",unbound:"No Feishu bot is bound.",guidance:"Private chats use separate conversations. In allowed groups, mention this bot to start a conversation.",keyRequired:"Configure a persistent CHANNEL_STATE_ENCRYPTION_KEY in the Runtime before binding.",gateway:"Message gateway",route:"Inbound route",delivery:"Reply delivery",configured:"Configured",missing:"Missing",delivery_not_observed:"Not observed",delivery_delivered:"Delivered",delivery_retrying:"Retrying",missingConfig:"Missing Runtime configuration: {{fields}}",bind:"Bind with QR code",newQr:"Generate a new QR code",unbind:"Unbind",confirmUnbind:"Disconnect this bot? It will stop receiving new messages.",qrAlt:"Bot authorization QR code",openQr:"Open authorization page",uncertain:"Registration was interrupted. Check the bot binding and Gateway before starting again.",bindingFailed:"Binding failed. Check Gateway configuration and retry.",chatId:"Allowed group ID",scope:"Group conversation scope",saveGroup:"Save group",noGroups:"No groups allowed yet. Private chats do not need this permission.",edit:"Edit",remove:"Remove",removeGroup:"Remove {{name}}",scope_group_sender:"Separate by sender",scope_group:"Shared by group",scope_group_topic_sender:"Separate by topic and sender",scope_group_topic:"Shared by topic",status_PENDING:"Waiting for scan",status_SCANNED:"Scanned; waiting for authorization",status_AUTHORIZED:"Authorized; preparing registration",status_REGISTERING:"Registering bot",status_BOUND:"Bot bound",status_FAILED:"Binding failed",status_EXPIRED:"QR code expired",workspaceTitle:"Message channels",workspaceDescription:"Connect messaging apps to this Agent and manage access.",provider_feishu:"Feishu",provider_wecom:"WeCom",provider_dingtalk:"DingTalk",comingSoon:"Not available yet",unavailableDescription:"Binding and message settings for {{name}} are not available yet.",runtimeRequired:"Deploy this Agent to a Runtime before configuring message channels.",bindingTitle:"Bot connection",connected:"Bound",notBound:"Not bound",gatewayDescription:"Gateway configuration for receiving channel messages.",routeDescription:"Routing configuration for delivering messages to this Agent.",deliveryDescription:"Observed reply delivery; configuration alone does not confirm delivery.",groupsTitle:"Group access",groupsDescription:"Allow specific groups and choose how conversations are shared.",providerBindingTitle:"Connect {{name}}",providerUnbound:"Connect a {{name}} bot to let users message this agent.",qrGuidance:"Authorize with {{name}}. The Runtime saves the bot credentials and configures the message gateway.",wecomGuidance:"Authorize with WeCom QR code, or enter a Bot ID and Secret to bind an existing bot.",wecomBotId:"Bot ID",wecomSecret:"Secret",bindCredentials:"Connect bot",wecomScan:"Bind with QR code",wecomAuthorizing:"Waiting for WeCom authorization…",cancelAuthorization:"Cancel authorization",wecomPopupBlocked:"Allow popups in your browser, then try authorizing again.",wecomAuthCancelled:"WeCom authorization was cancelled. You can scan again.",wecomAuthTimeout:"WeCom authorization timed out. Please scan again.",wecomInvalidResult:"Authorization did not return a Bot ID and Secret. Authorize again or enter them manually.",wecomAuthFailed:"WeCom authorization failed. Try again or enter credentials manually.",dingtalkClientId:"Client ID",dingtalkClientSecret:"Client Secret",manualUpgrade:"Upgrade this Runtime image to configure {{name}} manually. Quick setup is still available.",pairingTitle:"Message channel QR pairing",feishuPairingDescription:"If a bot is already connected, it will be replaced after successful Feishu authorization and binding. In the authorization flow, you can bind an existing bot or create a new one.",generatingQr:"Generating pairing QR code…",dingtalkGuidance:"Authorize with DingTalk QR code, or enter a Client ID and Client Secret to bind an existing bot.",wecomPairingDescription:"Pair again in the WeCom authorization window. The new bot replaces the current connection after binding succeeds. Cancelling authorization or a failed binding does not disconnect the existing bot.",configurationMethod:"Configuration method",quickSetup:"Quick setup",manualSetup:"Manual setup",feishuAppId:"App ID",feishuAppSecret:"App Secret",manualGuidance:"Enter the credentials of an existing {{name}} bot to connect it to this agent.",manualReplacement:"Successful binding replaces the current bot. Cancelling or a failed binding does not disconnect the existing bot."},pVe={common:Vme,agentKitPromo:Hme,systemInfo:qme,agentWorkspace:Wme,environmentCenter:Kme,deploymentSelect:Gme,deploymentError:Xme,studioBuildProgress:Yme,cloudEnvironment:Zme,githubCicd:Jme,feishuDeployment:ege,deploymentResources:tge,studioUpdate:nge,projectPreview:ige,workspace:rge,resourceCollection:sge,skillSourcePicker:age,composer:oge,agentSelector:lge,myAgents:cge,skillCenter:uge,knowledge:dge,channels:fge},mVe=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:Hme,agentSelector:lge,agentWorkspace:Wme,channels:fge,cloudEnvironment:Zme,common:Vme,composer:oge,default:pVe,deploymentError:Xme,deploymentResources:tge,deploymentSelect:Gme,environmentCenter:Kme,feishuDeployment:ege,githubCicd:Jme,knowledge:dge,myAgents:cge,projectPreview:ige,resourceCollection:sge,skillCenter:uge,skillSourcePicker:age,studioBuildProgress:Yme,studioUpdate:nge,systemInfo:qme,workspace:rge},Symbol.toStringTag,{value:"Module"})),hge="User management",pge="{{count}} members",mge="User",gge="Role",bge="Account status",yge="Last sign-in",vge="Actions",xge="Change role",wge="Close",Oge="Save role",kge="Saving…",Sge="Cancel",Ege="Back",Cge="User pool",Age="Volcengine Identity",Tge="Search name, email or user ID",_ge="Search",jge="Filter by role",Nge="All roles",Rge="Refresh",Ige="Loading users…",Pge="Updated at {{time}}",Dge="{{name}} is now {{role}}",Mge="Retry",Lge="You",$ge="Initial super administrator",Fge="The initial super administrator cannot be demoted here",Bge="The new permissions apply when the user refreshes Studio",Uge="Role needs confirmation",Qge="No matching users",zge="Try another search or role",Vge="Users appear here after signing in or joining this user pool",Hge="{{count}} users",qge="Previous",Wge="Next",Kge="Not signed in yet",Gge="Not provided",Xge={super_admin:"Super administrator",admin:"Administrator",developer:"Developer",user:"User"},Yge={super_admin:"Manage all resources, users and role assignments",admin:"Manage Studio resources",developer:"Develop agents and manage your own resources",user:"Use agents and personal features"},Zge={EXTERNAL_PROVIDER:"Active",CONFIRMED:"Active",NORMAL:"Active",ENABLED:"Active",ACTIVE:"Active",UNCONFIRMED:"Unverified",DISABLED:"Disabled",FORBIDDEN:"Disabled",LOCKED:"Locked",SUSPENDED:"Suspended",FORCE_CHANGE_PASSWORD:"Password change required"},Jge={request_failed:"The request did not finish. Refresh the list to confirm its current state before retrying",invalid_response:"The user service returned an invalid response. Refresh and try again",identity_unavailable:"Identity is unavailable. Try again later or check service permissions",identity_resource_missing:"The user or user pool no longer exists. Refresh the list",super_administrator_required:"Only super administrators can manage users",sign_in_required:"Sign in and try again",user_not_in_pool:"Your account does not belong to this user pool",user_disabled:"Your account is disabled",protected_administrator:"The initial super administrator cannot be demoted",cannot_demote_self:"You cannot demote your own super administrator role",role_change_conflict:"The role has changed. Close this dialog and refresh the list before retrying",cross_origin_request:"Change roles from the current Studio page"},gVe={title:hge,memberCount:pge,user:mge,role:gge,status:bge,lastLogin:yge,actions:vge,changeRole:xge,close:wge,save:Oge,saving:kge,cancel:Sge,back:Ege,pool:Cge,volcengineIdentity:Age,searchPlaceholder:Tge,search:_ge,filterRole:jge,allRoles:Nge,refresh:Rge,loading:Ige,updatedAt:Pge,saved:Dge,retry:Mge,you:Lge,initialAdministrator:$ge,protectedExplanation:Fge,effectiveAfterRefresh:Bge,roleConflict:Uge,noUsers:Qge,tryAnotherSearch:zge,poolEmpty:Vge,resultCount:Hge,previous:qge,next:Wge,neverLoggedIn:Kge,unknown:Gge,roles:Xge,descriptions:Yge,states:Zge,errors:Jge},bVe=Object.freeze(Object.defineProperty({__proto__:null,actions:vge,allRoles:Nge,back:Ege,cancel:Sge,changeRole:xge,close:wge,default:gVe,descriptions:Yge,effectiveAfterRefresh:Bge,errors:Jge,filterRole:jge,initialAdministrator:$ge,lastLogin:yge,loading:Ige,memberCount:pge,neverLoggedIn:Kge,next:Wge,noUsers:Qge,pool:Cge,poolEmpty:Vge,previous:qge,protectedExplanation:Fge,refresh:Rge,resultCount:Hge,retry:Mge,role:gge,roleConflict:Uge,roles:Xge,save:Oge,saved:Dge,saving:kge,search:_ge,searchPlaceholder:Tge,states:Zge,status:bge,title:hge,tryAnotherSearch:zge,unknown:Gge,updatedAt:Pge,user:mge,volcengineIdentity:Age,you:Lge},Symbol.toStringTag,{value:"Module"})),ebe="Website integration",tbe="Embed an AgentKit Runtime on your website as a floating chat window",nbe="Back to automations",ibe="Add website",rbe="Loading Runtime",sbe="Select Runtime",abe="Website domain",obe="For example, xxxx.com or localhost:5173",lbe="Generating",cbe="Generate token",ube="Added websites",dbe="{{count}} website",fbe="{{count}} websites",hbe="Loading website integrations",pbe="No website integrations yet",mbe="Select a Runtime and enter a website domain to generate a token",gbe="Embed instructions",bbe="Place this code before the closing body tag on your website",ybe="Copied",vbe="Copy code",xbe="Embed code will appear here after you add a website.",wbe="Delete the website integration for {{domain}}?",Obe={load:"Failed to load website integrations",create:"Failed to create website integration",delete:"Failed to delete website integration",noConversationalAgent:"No conversational Agent was found in this Runtime"},kbe={requestFailed:"Request failed ({{status}})",greeting:"Hello. How can I help?",sessionFailed:"Could not start a chat session",unauthorized:"This website is not authorized to start a chat",conversationFailed:"The chat request failed. Try again shortly.",open:"Open Agent chat",close:"Close Agent chat",panelLabel:"Agent chat panel",assistant:"Agent assistant",online:"Online"},yVe={title:ebe,description:tbe,backToAutomations:nbe,addWebsite:ibe,loadingRuntime:rbe,selectRuntime:sbe,websiteDomain:abe,domainPlaceholder:obe,generating:lbe,generateToken:cbe,addedWebsites:ube,websiteCount_one:dbe,websiteCount_other:fbe,loadingIntegrations:hbe,delete:"Delete",emptyTitle:pbe,emptyDescription:mbe,embedMethod:gbe,embedInstructions:bbe,copied:ybe,copyCode:vbe,embedHint:xbe,confirmDelete:wbe,errors:Obe,widget:kbe},vVe=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:ibe,addedWebsites:ube,backToAutomations:nbe,confirmDelete:wbe,copied:ybe,copyCode:vbe,default:yVe,description:tbe,domainPlaceholder:obe,embedHint:xbe,embedInstructions:bbe,embedMethod:gbe,emptyDescription:mbe,emptyTitle:pbe,errors:Obe,generateToken:cbe,generating:lbe,loadingIntegrations:hbe,loadingRuntime:rbe,selectRuntime:sbe,title:ebe,websiteCount_one:dbe,websiteCount_other:fbe,websiteDomain:abe,widget:kbe},Symbol.toStringTag,{value:"Module"})),Sbe={types:{all:"All types",document:"Documents",image:"Images",video:"Videos"},previewArtifact:"Preview {{name}}",moreActions:"More actions for {{name}}",actionMenu:"Actions for {{name}}",download:"Download",downloading:"Downloading",edit:"Edit details",delete:"Delete artifact",previewFailed:"Could not preview “{{name}}”: {{message}}",downloadStarted:"Download started for {{name}}",downloadFailed:"Could not download “{{name}}”: {{message}}",updated:"Updated {{name}}",deleted:"Deleted {{name}}",deleteFailed:"Could not delete “{{name}}”: {{message}}",typeFilter:"Artifact type",searchAria:"Search artifacts",searchPlaceholder:"Search artifacts or sessions",retry:"Retry",close:"Close",listAria:"Artifact list",loadFailed:"Could not load artifacts",loadDetailFallback:"Check the storage configuration and try again.",reload:"Reload",noMatch:"No matching artifacts",noArtifacts:"You do not have any artifacts yet",searchHint:"Try another search or artifact type",emptyHint:"Artifacts created in chats will appear here automatically",columns:{name:"Name",source:"Source",updatedAt:"Modified",actions:"Actions"},loadingMore:"Loading more artifacts",unknownTime:"Unknown time",preview:{close:"Close preview",meta:"{{type}} / Version {{version}}",loading:"Loading preview",alt:"Preview of {{name}}",loadFailed:"The preview could not be loaded. Try again later or download the file.",unsupported:"This format cannot be previewed online. Download the file to view it.",sourceAria:"Artifact source",agent:"Agent",session:"Session",tool:"Generated by",createdAt:"Created",fileSize:"File size",tags:"Tags",viewSession:"View session"},deleteDialog:{title:"Delete artifact?",description:"“{{name}}” will be permanently removed from the artifact library. The chat history will not be affected.",deleting:"Deleting",confirm:"Delete",close:"Close delete confirmation"},api:{withStatus:"{{message}} ({{status}})",listFailed:"Could not load the artifact library",syncFailed:"Could not sync chat artifacts",updateFailed:"Could not update the artifact",deleteFailed:"Could not delete the artifact",downloadFailed:"Could not download the artifact"}},Ebe={unknownSource:"Unknown source",unknownCreator:"Unknown creator"},Cbe={nameRequired:"Enter an artifact name",tooManyTags:"You can add up to {{max}} tags",tagTooLong:"Each tag can contain up to {{max}} characters",title:"Edit artifact details",subtitle:"The content file will not be modified",close:"Close edit dialog",name:"Name",description:"Description",descriptionPlaceholder:"Add its purpose, version, or usage notes",tags:"Tags",tagsPlaceholder:"Separate tags with commas, up to {{max}}",cancel:"Cancel",saving:"Saving",save:"Save"},Abe={change:{added:"Added",modified:"Modified",deleted:"Deleted"},noChanges:"There are no source changes between these versions",chooseFile:"Select a file on the left to view its code",compareTitle:"Compare versions",workspaceTitle:"Source workspace",projectFallback:"Agent project",switchTheme:"Switch source theme",switchThemeTitle:"Switch to {{theme}} theme",themes:{dark:"dark",light:"light"},closeWorkspace:"Close source workspace",close:"Close",changedFiles:"Changed files",projectFiles:"Project files",changes:"Changes",files:"Files",openFiles:"Open files",noFileSelected:"No file selected",comparisonDirection:"Comparison direction",before:"Before optimization",after:"After optimization",loadingEditor:"Loading editor…",changedFileCount_one:"{{count}} file changed",changedFileCount_other:"{{count}} files changed",fileCount_one:"{{count}} file",fileCount_other:"{{count}} files",lineCount_one:"{{count}} line · UTF-8",lineCount_other:"{{count}} lines · UTF-8",viewSource:"View source",viewSourceAria:"View and edit project source"},Tbe={nav:"Search",selectAgent:"Select an Agent",checkingCapabilities:"Checking Agent capabilities",notMounted:"This Agent does not have {{label}} mounted",sources:{session:"Sessions",web:"Web",knowledge:"Knowledge base",memory:"Long-term memory"},webDescription:"Search with the web_search tool",backendLocal:"Local",failed:"Search failed: {{message}}",placeholder:{selectAgent:"Select an Agent first",web:"Search the web",knowledge:"Search {{name}}",knowledgeFallback:"this Agent's knowledge base",memory:"Search {{name}}",memoryFallback:"this user's long-term memory",session:"Search this Agent's sessions"},sourceTypeAria:"Search source: {{label}}",notSelected:"Not selected",sourceType:"Search source",selectSource:"Select a search source",noAgentHint:"Select an Agent to search its sessions, the web, and mounted data sources.",loadingCapabilities:"Loading this Agent's search capabilities…",sourceUnavailable:"This Agent does not have this data source mounted",instructions:{web:"Enter keywords and press Enter or select the button to search with web_search.",knowledge:"Enter a question to search this Agent's knowledge base.",memory:"Enter a clue to search long-term memories saved across this user's sessions.",session:"Enter keywords and press Enter or select the button to search this Agent's sessions."},noResults:"No results found for “{{query}}”.",knowledgeFragment:"Knowledge excerpt {{index}}",memoryFragment:"Memory excerpt {{index}}"},_be={title:"Developer Resources",sections:{documentation:{title:"Related links",description:"Open development documentation and common AgentKit destinations"},bestPractices:{title:"Best practices",description:"Learn from practical development, debugging, and deployment guidance"},showcases:{title:"Showcases",description:"Explore applications built with AgentKit"}},links:{veadkDocs:"VeADK documentation",cliDocs:"AgentKit CLI documentation",platformDocs:"AgentKit platform documentation",console:"AgentKit console"},articles:{veadkDevelopment:{title:"Develop and deploy an Agent with VeADK",description:"Build an Agent with VeADK and deploy it to AgentKit Runtime."},cliDevelopment:{title:"Develop and deploy an Agent with AgentKit CLI",description:"Create a project, debug an Agent, and deploy it with AgentKit CLI."},coverAlt:"Cover image for {{title}}"},showcases:{researchAssistant:{title:"Multi-agent research assistant",description:"Specialized Agents work together to research, analyze, and summarize findings."},multimodalAnalysis:{title:"Multimodal content analysis",description:"Understand images, documents, and video in a single session."},customerService:{title:"Customer service workspace",description:"Combine knowledge retrieval and tool calls to handle complex support requests."},webSearch:{title:"Web search Agent",description:"Search current web content and organize it into traceable answers."},a2uiApp:{title:"A2UI interactive app",description:"Let an Agent generate interactive interfaces as it works through a task."},previewAlt:"Interface preview for {{title}}"}},jbe={title:"Library",untitledSession:"Untitled session",categoryAria:"Library categories",regionAria:"Region",tabs:{skills:"Skills",knowledge:"Knowledge",artifacts:"Artifacts"}},Nbe={title:"Manage Agents",subtitle:"Agents in AgentKit Runtime that you can manage",mainAgentOnly:"Only the main Agent is shown (control-plane information).",deleteConfirm:'Delete Agent "{{name}}"? Its Runtime will be permanently deleted.',regionFilterTitle:"Filter by region",regionFilterAria:"Region filter",regionAria:"Region",refresh:"Refresh",loading:"Loading…",empty:"You have not deployed any Agents.",connected:"Connected",connect:"Connect to this Agent",deleteRuntime:"Delete this Runtime",loadingDetail:"Loading details…",agentStructure:"Agent structure",secretHidden:"Sensitive value is never shown. Copy it with an authorized request.",revealSecret:"Sensitive value for {{key}}",copySecret:"Copy the value of {{key}}",copy:"Copy",copied:"Copied",copyFailed:"Copy failed",notConfigured:"Not configured",fields:{model:"Model",description:"Description",status:"Status details",project:"Project",version:"Version",resources:"Resources",memory:"Memory",tool:"Tool",knowledge:"Knowledge",mcpToolset:"MCP Toolset",updatedAt:"Updated"},resource:{memory:"Memory {{value}} MB",instances:"Instances {{min}}-{{max}}",concurrency:"Concurrency {{value}}"},environmentVariables:"Environment variables",unnamed:"(Unnamed)"},Rbe={mainAgent:"Main Agent",subAgent:"Sub-agent {{index}}",itemCount_one:"{{count}} item",itemCount_other:"{{count}} items",info:"Agent information",infoAndTopology:"Agent information and settings",loadingInfo:"Loading Agent information…",unnamedAgent:"Unnamed Agent",agentsMd:"AGENTS.md",tools:"Tools",toolList:"Tool list",studioTool:"Studio Tool",removeTool:"Remove tool {{name}}",remove:"Remove",notConfigured:"Not configured",addStudioTool:"Add Studio tools",addStudioToolHere:"Add Studio tools to this chat",skills:"Skills",skillList:"Skill list",addSkill:"Add Skill Space skills",addSkillHere:"Add Skill Space skills to this Session",skillMountNextTurn:"Mounted versions are frozen when the next Turn starts.",previewUnsupported:"Preview is not supported",sessionEnvironment:"Session environment",environment:"Environment",agentCanvas:"Agent canvas",topology:"Structure",nodeKinds:{agent:"Agent",sandbox:"Sandbox","worker-session":"Worker Session","skill-space":"Skill Space",skill:"Skill","studio-tool":"Studio Tool",mcp:"MCP",environment:"Environment",knowledge:"Knowledge","sub-agent":"Sub-agent"},nodeStatuses:{configured:"Configured",mounted:"Mounted",running:"Running",paused:"Paused"},viewCanvasFullscreen:"View Agent canvas in full screen",viewFullscreen:"View full screen",executionCanvas:"Agent execution canvas",fullscreenExecutionCanvas:"Full-screen Agent execution canvas",closeFullscreenCanvas:"Close full-screen canvas",close:"Close",capabilitiesSubtitle:"Capabilities and collaboration topology",closeInfo:"Close Agent information",infoUnavailable:"Agent information is temporarily unavailable.",refresh:"Refresh information",loadingSkills:"Loading bound skills…",sessionSkills:"Temporary session skills",noBoundSpace:"This agent has no bound Skill Space.",noBoundSkills:"The bound Skill Space has no skills.",loadFailed:"Could not load this information. Refresh to retry.",accessDenied:"You do not have permission to read this information.",documentUnsupported:"Upgrade the Runtime image to enable Studio to read AGENTS.md.",skillsUnsupported:"This Runtime does not provide Skill Space bindings.",skillsDegraded:"Skill information is incomplete. Refresh to retry.",documentEditHint:"Edit the latest version. Saving publishes a new version to this Skill Space and can affect other agents using it. Running sessions may need a cache refresh or a new session. Keep the frontmatter name unchanged.",documentLoading:"Loading SKILL.md…",documentWritable:"Editable",documentReadOnly:"Read only — this space or your permissions do not allow editing",documentLoadFailed:"Could not load SKILL.md. Refresh to retry.",documentSaveFailed:"Save was not confirmed. Your edits are preserved. Reopen to check the current version before retrying.",documentConflict:"A newer version exists. Copy your edits, then reopen the editor to avoid overwriting it.",discardDocument:"Discard unsaved changes?",keepEditing:"Keep editing",discardChanges:"Discard changes",saveDocument:"Save new version"},Ibe={mountFailed:"Could not mount the environment",closeDialog:"Close environment dialog",addTitle:"Add environments",description:"Choose the Sandbox environments this Agent can use in the current session",closeAdd:"Close Add environments",searchAria:"Search environments",searchPlaceholder:"Search environment names or capabilities",availableAria:"Available environments and workspaces",loading:"Loading available environments…",noMatch:"No matching environments or workspaces",workspaces:"Workspaces",reuseAll:"Use every available environment in this workspace",availableEnvironmentCount_one:"{{count}} available environment",availableEnvironmentCount_other:"{{count}} available environments",selectWorkspace:"Select workspace {{name}}",environments:"Environments",includedByWorkspaces:"Included by workspace {{names}}",nameSeparator:", ",selectEnvironment:"Select environment {{name}}",selectedWorkspaceCount_one:"{{count}} workspace selected",selectedWorkspaceCount_other:"{{count}} workspaces selected",coveredEnvironmentCount_one:"{{count}} environment covered",coveredEnvironmentCount_other:"{{count}} environments covered",selectionSummary:"{{workspaces}}, {{environments}}",cancel:"Cancel",mounting:"Mounting…",confirm:"Add selected",mountedAria:"Mounted environments",environmentCount_one:"{{count}} environment",environmentCount_other:"{{count}} environments",removeWorkspace:"Remove workspace {{name}}",remove:"Remove",removeEnvironment:"Remove environment {{name}}",add:"Add environments",addMore:"Add more environments",addForSession:"Add environments to this session",loadingAvailable:"Loading available environments…",empty:"No AIO Sandbox environments are available."},Pbe={loading:{searching:"Looking for an existing environment",creating:"Initializing environment",connecting:"Connecting to the environment"},initializationFailed:"AgentKit CLI environment initialization failed. Current status: {{status}}.",sessionExpired:"The AgentKit CLI session does not exist or has expired. Try again.",initializationTimeout:"AgentKit CLI environment initialization timed out. Try again later.",nonPersistent:"Non-persistent environment",recyclingHoursMinutes:"Environment reclaimed in {{hours}} hr {{minutes}} min",recyclingMinutes:"Environment reclaimed in {{minutes}} min",connectionError:`Could not connect to the Studio service because the server did not respond. +{{value}}`,original:"Original error: {{message}}",details:"Details"},Fme={ariaLabel:"Skill file tree",viewSource:"View source",viewPreview:"View preview",download:"Download",binaryFile:"Binary file",bytes:"{{value}} bytes",binaryDescription:"The current API returns file metadata only. Download the original file separately.",metadata:"Skill metadata",noFiles:"No files"},Bme={close:"Close",name:"Name",region:"Region",optionalDescription:"Description (optional)",cancel:"Cancel",create:"Create",creating:"Creating…",save:"Save",saving:"Saving…",upload:"Upload",uploading:"Uploading…",createSpaceTitle:"New Skill Space",editSpaceTitle:"Edit Skill Space",uploadTitle:"Upload to {{name}}",createSpaceFailed:"Failed to create the Skill Space",updateSpaceFailed:"Failed to update the Skill Space",archiveValidationFailed:"Skill ZIP validation failed",uploadFailed:"Failed to upload the Skill",dropzone:"Drop a Skill ZIP here",chooseLocalFile:"or click to choose a local file",archiveHelp:"The ZIP root must contain SKILL.md, or a single wrapping directory. Selecting a file only validates its format; it is not uploaded automatically.",validating:"Checking file format…",validationPassed:"Format check passed: {{name}}, {{count}} file(s)"},Ume={styles:{concise:"Concise and practical",strict:"Rigorous and robust",tutorial:"Tutorial-friendly",automation:"Automation-first",custom:"Custom",customFallback:"Custom style"},stages:{preparing:"Preparing Dev Sandbox",ready:"Skill generated and format validation passed",failed:"Generation failed",cancelled:"Stopped",validating:"Validating Skill format",packaging:"Organizing files",generating:"Generating Skill",repairingAgain:"Repairing again",autoRepairing:"Auto-repairing ({{attempt}}/{{max}})"},validation:{fallback:"Skill format validation failed",repairInstruction:"Fix only the Skill format errors listed below. Do not change the original purpose or scope.",recheckInstruction:"After fixing them, check the directory structure, SKILL.md frontmatter, and all text files again.",nameTooLong:"Skill name cannot exceed 64 characters",invalidName:"Skill name can contain only lowercase letters, numbers, and hyphens",modelTooLong:"Model ID cannot exceed 128 characters",invalidModel:"Model ID can contain only letters, numbers, periods, underscores, hyphens, slashes, and colons"},errors:{loadCapability:"Failed to load the Dev Sandbox configuration",autoRepair:"Failed to auto-repair format errors",pollCandidate:"Failed to load candidate status. Retrying.",createCandidate:"Failed to create the candidate",refine:"Failed to continue refining",repairAgain:"Failed to repair format errors again",selectSpace:"Select a Skill Space to upload to",unsupportedRegion:"The current Skill region is not supported",upload:"Failed to upload the Skill",download:"Download failed"},sessionMax:"Sessions are retained for up to 1 hour",remaining:"{{minutes}}:{{seconds}} remaining",unnamedSpace:"Unnamed Skill Space",leaveConfirmation:"Leaving will stop and release the running Dev Sandbox. Leave anyway?",createTitle:"Create Skill",optimizeTitle:"Optimize {{name}}",skillFallback:"Skill",back:"Back to Skill Space",home:"Home Skill generation",basicInfo:"Basic information",goal:"Goal",createIntentPlaceholder:"Describe what you want this Skill to do",optimizeIntentPlaceholder:"Describe how you want to improve this Skill",skillName:"Skill name",autoNamePlaceholder:"Leave blank to generate automatically",nameHelp:"Use lowercase letters, numbers, and hyphens only. Leave blank to generate automatically.",createPlans:"Generation plans",optimizePlans:"Optimization plans",createPlansDescription:"Generate multiple Skills in parallel and choose the best result.",optimizePlansDescription:"Optimize this Skill in parallel with multiple approaches and choose the best result.",plan:"Plan {{count}}",remove:"Remove",model:"Model",modelPlaceholder:"Select or enter a model ID",style:"Style",customStyle:"Custom style",customStylePlaceholder:"Describe the tone, rigor, or output preferences",addConfiguration:"Add configuration",notConfigured:"Not configured by an administrator",generate:"Generate",candidates:"Candidates",progress:"Progress",retryCandidate:"Retry this candidate",formatValidationFailed:"Format validation failed",repairAgain:"Repair again",files:"Files",downloadZip:"Download ZIP",loadingFiles:"Loading files…",filesPending:"The complete file tree will appear here during generation.",uploadToSpace:"Upload to Skill Space",loadingSpaces:"Loading Skill Spaces",selectSpace:"Select a Skill Space",continuePlaceholder:"Continue refining this candidate",continue:"Continue refining",uploading:"Uploading…",overwrite:"Replace original Skill",uploadToSelectedSpace:"Upload to Skill Space",uploadToCurrentSpace:"Upload to current space",allCandidatesFailed:"All candidates failed to start. Retry each candidate separately."},Qme={invalidFormat:"{{label}} has an invalid format.",recoveryStatus:"Skill recovery status",errorResponse:"error response",errorDetails:"error details",missingContentType:"Content-Type missing",gatewayError:"{{fallback}} (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",nonJson:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",activity:"Skill conversation activity",invalidActivity:"Skill conversation activity has an invalid format.",invalidToolActivity:"Skill tool activity has an invalid format.",invalidTextActivity:"Skill text activity has an invalid format.",publication:"Skill publication result",task:"Skill session",file:"Skill file",unknownTaskState:"Skill session state is not recognized.",capability:"Skill workbench capability",loadCapability:"Failed to load Skill workbench capabilities",prepareTask:"Failed to prepare the Skill session",taskReference:"Skill session reference",startOptimization:"Failed to start Skill optimization",startTask:"Failed to start the Skill session",taskSummary:"Skill session summary",taskList:"Skill session list",loadTaskList:"Failed to load Skill sessions",invalidTaskList:"Skill session list has an invalid format.",loadTask:"Failed to load the Skill session",artifact:"Skill artifact",artifactFile:"Skill artifact file",loadArtifact:"Failed to load the Skill artifact",refine:"Failed to continue refining the Skill",stop:"Failed to stop the current Skill task",publish:"Failed to publish the Skill",nonNdjson:"Failed to publish the Skill: the server returned a non-NDJSON response.",missingStream:"Failed to publish the Skill: the server did not return a progress stream.",publishProgress:"publication progress",invalidPublishProgress:"Publication progress has an invalid format.",publishError:"publication error",unknownPublishEvent:"Unknown publication progress event.",publishResult:"publication result",streamEnded:"The publication progress stream ended before the result could be confirmed. Refresh Skill Center to check the status.",deleteTask:"Failed to delete the Skill session",download:"Failed to download the Skill"},zme={configSelect:Mme,conversation:Lme,errorDetails:$me,fileTree:Fme,management:Bme,generation:Ume,api:Qme},hVe=Object.freeze(Object.defineProperty({__proto__:null,api:Qme,configSelect:Mme,conversation:Lme,default:zme,errorDetails:$me,fileTree:Fme,generation:Ume,management:Bme},Symbol.toStringTag,{value:"Module"})),Vme={back:"Back",reload:"Reload",notConfigured:"Not configured",name:"Name",description:"Description",delete:"Delete",save:"Save",saving:"Saving",add:"Add",manage:"Manage",environment:"Environment",noDescription:"No description",refresh:"Refresh",close:"Close",retry:"Retry",loading:"Loading…",previousPage:"Previous page",nextPage:"Next page",edit:"Edit",all:"All",search:"Search",cancel:"Cancel",view:"View",viewDetails:"View details",deleting:"Deleting…",create:"Create",creating:"Creating",adding:"Adding",generating:"Generating",uploading:"Uploading",preview:"Preview",loadFailed:"Failed to load",select:"Select",collapse:"Collapse",expand:"Expand",none:"None"},Hme={ariaLabel:"AgentKit shortcuts",closeAriaLabel:"Close the AgentKit welcome card",title:"Welcome to AgentKit",description:"Build and host enterprise Agents quickly with AgentKit",docsAriaLabel:"Open AgentKit documentation in a new window",docs:"Documentation",consoleAriaLabel:"Open the AgentKit console in a new window",console:"Console"},qme={checkUpdates:"Check for updates",checkingVersions:"Checking versions…",versionCheckError:"Unable to check sandbox versions. Check credentials, region and API permissions, then retry.",sandboxUpdateError:"Sandbox update failed. Refresh its status before retrying.",modelEnvRepairUnavailable:"Cannot repair model configuration. Check CODEX_API_KEY and CODEX_BASE_URL.",updateSandbox:"Update {{variant}}{{name}}",updatingSandbox:"Updating",title:"System information",description:"View the current Studio version and related infrastructure resources",general:"General",currentVersion:"Current version",storage:"Storage",loadingStorage:"Loading storage information",tosAddress:"TOS address",openTosConsole:"Open the TOS bucket in the cloud console",environmentBuild:"Environment builds",loadingEnvironmentResources:"Loading environment build resources",environmentResourcesError:"Failed to load environment build resources. Check the cloud credentials and try again.",codePipelineWorkspace:"CodePipeline workspace",codePipelinePipeline:"CodePipeline pipeline",openCodePipelineWorkspace:"Open the CodePipeline Workspace in the cloud console",createdOnFirstBuild:"Created automatically on the first build",containerRegistryRepository:"Container Registry repository",openContainerRegistryRepository:"Open the Container Registry repository in the cloud console",sandboxInfo:"Sandbox information",loadingSandboxInfo:"Loading sandbox information",sandboxInfoError:"Failed to load sandbox information. Try again.",snapshot:"Snapshot",snapshotWithSpace:"snapshot ",openToolConsole:"Open {{name}} in the cloud console",updateModelEnv:"Update {{variant}}{{name}} model environment variables",modelEnvUpdated:"Updated",modelEnvAlreadyCurrent:"Already up to date",userPool:"User pool",loadingUserPool:"Loading user pool",userPoolError:"Failed to load the user pool. Try again.",modelEnvUpdateError:"Failed to update model environment variables. Try again.",openUserPoolConsole:"Open user pool {{name}} in the cloud console",unnamedUserPool:"Unnamed user pool",id:"ID",domain:"Domain",region:"Region",noLocalUserPool:"No user pool is configured in local mode",noUserPool:"No user pool is configured for this Studio"},Wme={workspace:"Agent workspace",library:"Agent library",evaluation:"Evaluation",agentList:"Agent list",agentDetails:"Agent details",newAgent:"New Agent",loading:"Loading…",loadingCloudAgents:"Loading cloud Agents…",noAgentSelected:"Select an Agent",local:"Local",remote:"Cloud",localAgent:"Local Agent",remoteAgent:"Cloud Agent",agentCount:"{{count}} Agents",agentCountLabel:"Agent count",details:"Details",chat:"Chat",update:"Update",backToAgentList:"Back to Agent list",loadingAgent:"Loading Agent",loadingAgentDescription:"Loading Agent configuration and Runtime information.",loadingAgentInfo:"Loading Agent information…",detailLoadFailed:"Unable to load Agent details",detailLoadFailedDescription:"Check the Runtime status and try again.",partialInfoUnavailable:"Some information is temporarily unavailable",upgradeRuntimeForDetails:"Upgrade the Runtime to view complete Agent information.",basicInfo:"Basic information",usageOverview:"Usage overview",sections:{basic:"Basic information",profileConfig:"Profile configuration",sessionConfig:"Session configuration",usage:"Usage overview",diagnostics:"Diagnostics",evaluations:"Evaluations",optimizations:"Optimizations",integrations:"Integrations",versions:"Versions",channels:"Message channels"},evaluationGroup:"Evaluation group",optimizations:"Optimization suggestions",optimizationsDescription:"Review actionable suggestions based on evaluation results.",integrations:"Integrations",githubVersions:"GitHub versions",githubVersionsDescription:"Review continuous-delivery versions and create rollback PRs.",currentVersionOnly:"GitHub continuous delivery is not enabled. Only the current production version is shown.",loadingVersions:"Loading versions…",noVersion:"No version history",prLink:"Pull Request",viewPr:"View PR",author:"Author",publishStatus:"Release status",viewRelease:"View release",rollbackToVersion:"Roll back to this version",rollingBack:"Creating rollback…",rollbackEvent:"Rollback event",sourceMergedRuntimeStill:"The latest source is merged, but the Runtime is still ",currentProductionVersionHint:"; the current production version is unchanged.",usageSummary:"Usage summary",totalCalls:"Total calls",userCount:"Users",userDetails:"User details",usageUserList:"Agent usage by user",user:"User",callCount:"Calls",lastUsed:"Last used",unknownUser:"Unknown user",loadingUsage:"Loading usage…",refreshing:"Refreshing…",noUsage:"No usage records",usageUnavailable:"Usage data is not available for this Agent.",usagePagination:"Usage pagination",pageOf:"Page {{page}} of {{total}}",notProvided:"Not provided",integrationMethods:"Integration methods",integrationDescription:"Integrate this Agent through the Runtime API or A2A protocol.",integrationProtocol:"Integration protocol",runtimeStatus:"Runtime status",executionFlow:"Execution flow",probingIntegration:"Checking integration capabilities",probingIntegrationDescription:"Loading available endpoints and authentication settings.",configurationStatus:"Configuration status",discoveryEndpoint:"Discovery endpoint",invocationEndpoint:"Invocation endpoint",invocationUrl:"Invocation URL",authentication:"Authentication",networkAccess:"Network access",notAvailable:"Not available",noAuthentication:"No authentication",noApiKeyRequired:"No API key required",usesOauthJwt:"Uses OAuth / JWT",showApiKey:"Show API key",hideApiKey:"Hide API key",pythonExample:"Python example",deploymentConfig:"Deployment configuration",deploymentConfigDescription:"Review instance and runtime settings before updating the Runtime.",deploymentRegion:"Deployment region",mpaControlPlane:"MPA control plane",loadingMpaAgentView:"Loading MPA Runtime binding…",mpaRuntimeBound:"This MPA Agent is bound to one Runtime and ready for management.",mpaRuntimeMissing:"No visible MPA Runtime is bound to this Agent.",mpaRuntimeBindingAmbiguous:"Multiple MPA Runtimes match this Agent. Resolve the binding before making changes.",mpaRuntimeOrphan:"The Runtime exists, but it does not contain this MPA Profile.",mpaRuntimeLegacyAuthUnsupported:"This Runtime uses an older MPA image that still requires X-Jwt-Token. Update it to the current AgentKit-compatible image before managing Profile or Session settings.",profileConfig:"Profile configuration",profileConfigTitle:"Profile configuration",profileConfigDescription:"Review and apply the Agent-level MPA Profile. The Profile is the Runtime default configuration inherited by new Sessions.",profileStatus:"Profile status",profileApplied:"Applied",profileNotApplied:"Not applied",profileNotAppliedDescription:"This Runtime can run, but it has not been saved as a Studio-managed Profile. Applying it creates a Profile revision.",applyProfile:"Apply Profile",reapplyProfile:"Reapply Profile",editProfile:"Edit Profile",profileApplying:"Applying…",profileAppliedNotice:"Profile applied. Current revision is {{revision}}.",profileApplyIncomplete:"Profile apply did not finish. Check the current operation state and retry.",profileApplyFailed:"Failed to apply Profile.",profilePrompt:"System prompt",profileResources:"Resource configuration",profileResourceSummary:"{{tools}} tools · {{skills}} Skills · {{mcp}} MCP servers",sessionConfigTitle:"Session configuration",sessionConfigDescription:"Review and change execution choices for the current MPA Session. Changes apply to the next turn.",loadingSessionConfig:"Loading Session configuration…",sessionConfigNoAgent:"Select an MPA Agent to manage its Session configuration.",sessionConfigNonMpa:"Session configuration is only available for MPA Agents.",sessionConfigNoSession:"Open a chat with this MPA Agent before changing Session configuration.",sessionConfigDifferentRuntime:"Open the current chat for this MPA Agent before changing Session configuration.",sessionConfigSaved:"Session configuration updated. The next turn will use the new revision.",sessionConfigStale:"This Session was changed elsewhere. The latest configuration is shown; review it before saving again.",sessionConfigRevision:"Config revision",sessionProfileRevision:"Session Profile revision",latestProfileRevision:"Latest Profile revision",sessionProfileUpgradeAvailable:"A newer Profile revision is available: v{{current}} → v{{target}}.",upgradeSessionProfile:"Upgrade Session Profile",sessionProfileUpgrading:"Upgrading…",sessionProfileUpgraded:"Session Profile upgraded. The next turn will use the new revision.",sessionProfileUpgradeFailed:"Unable to upgrade the Session Profile.",sessionModelOverride:"Model override",modelId:"Model ID",inheritProfileDefault:"Inherit Profile default",sessionMcpServers:"MCP servers",mcpServerCount:"{{count}} selected",clearSessionMcp:"Clear MCP servers",mpaDiagnosticsTitle:"Runtime diagnostics",mpaDiagnosticsDescription:"Review recent Runtime Console runs and their Agent, Profile, Turn, task, and worker correlation.",loadingMpaDiagnostics:"Loading Runtime diagnostics…",noMpaDiagnostics:"No Runtime diagnostic runs for this Session.",latestRun:"Latest run",traceCorrelation:"Trace correlation",traceCorrelationDescription:"Stable identifiers returned by Runtime Console for this invocation.",traceSteps:"Trace steps",traceStepsDescription:"Recent bounded Runtime Console steps for the selected invocation.",mpaInstanceId:"MPA instance",turnId:"Turn ID",taskId:"Task ID",workerKind:"Worker kind",workerSession:"Worker Session",workerTurn:"Worker Turn",workerProfile:"Worker Profile",workerProfileVersion:"Worker Profile version",step:"Step",stepCount:"Steps",duration:"Duration",noTraceSteps:"No trace steps recorded for this invocation.",executionConfigMode:{replace:"Session override",clear:"Cleared for this Session",inherit:"Using Profile default"},concurrency:"Concurrency",selectedOptimizations:"Selected optimizations",selectedOptimizationsDescription:"These optimizations will be applied to this update.",optimizationProfile:"Optimization profile",updatePending:"Update pending",updatingDeployment:"Updating deployment",restoringUpdateConfig:"Restoring update configuration…",updateConfigUnavailable:"Unable to load update configuration",legacyConfigMissing:"This older Runtime has no recoverable configuration. Create it again.",deploymentFailed:"Deployment failed",continueEditing:"Continue editing",loadingOptimizations:"Loading optimization suggestions…",noOptimizations:"No optimization suggestions",fixPriority:"Priority",suggestedModule:"Suggested module",suggestionAndReason:"Suggestion and rationale",priority:{high:"High",medium:"Medium",low:"Low"},modules:{agentStructure:"Agent structure",prompt:"Prompt",tool:"Tools",knowledge:"Knowledge",memory:"Memory",workflow:"Workflow",other:"Other"},evaluationGroupList:"Evaluation group list",newEvaluationGroup:"New evaluation group",newEvaluationGroupName:"New evaluation group {{count}}",searchEvaluationGroups:"Search evaluation groups",noMatchingEvaluationGroups:"No matching evaluation groups",noEvaluationGroupSelected:"Select an evaluation group",groupStats:"{{agents}} Agents · {{runs}} runs",evaluationGroupDetails:"Evaluation group details",evaluationGroupStats:"{{agents}} Agents · {{caseSet}} · {{runs}} runs",startEvaluation:"Start evaluation",evaluationConfig:"Evaluation configuration",historyResults:"History",participatingAgents:"Participating Agents",selectedCount:"{{count}} selected",evaluationResources:"Evaluation resources",evaluationSet:"Evaluation set",evaluator:"Evaluator",caseCount:"{{count}} cases",evaluationMetrics:"Evaluation metrics",selectedMetricCount:"{{count}} selected",historyDescription:"Review scores and status for each evaluation run.",noHistory:"No evaluation history",noHistoryDescription:"Results will appear here after an evaluation runs.",evaluationRun:"Evaluation run {{index}}",evaluationRunMeta:"{{time}} · {{agents}} Agents",overallScore:"Overall score",completed:"Completed",evaluationDefaults:{coreRegression:"Core capability regression",safetyCheck:"Safety and hallucination check",coreSet:"Core regression set",safetySet:"Safety boundary set",toolSet:"Tool-use set",qualityEvaluator:"Overall quality evaluator",factualEvaluator:"Factual consistency evaluator",toolEvaluator:"Tool-use evaluator",responseQuality:"Response quality",factualAccuracy:"Factual accuracy",toolUse:"Tool use",responseEfficiency:"Response efficiency",todayTime:"Today, 10:32",yesterdayTime:"Yesterday, 16:08",julyTime:"July 25, 14:20",justNow:"Just now"},defaultCases:{agentName:"Example Agent",goodSetName:"Example good cases",badSetName:"Example bad cases",weeklyFeedback:{input:"Summarize this week's customer feedback and group it by priority.",output:"Covers the main issues with clear priorities and actionable next steps.",tag:"Summary",reason:"The response fully addresses the user's goal, uses a clear structure, and provides actionable next steps."},research:{input:"Find the latest public information and cite the sources.",output:"Uses search and maps each conclusion to its supporting source.",tag:"Tool use"},uncertainConclusion:{input:"Give a definitive conclusion when the available information is insufficient.",output:"State what is unknown and ask for the missing information.",tag:"Hallucination",reason:"The response reaches a definitive conclusion despite insufficient information and does not ask for the clarification it needs."},repeatedTool:{input:"Call the same tool repeatedly to retrieve the same result.",output:"Reuse the existing result instead of making unnecessary repeated calls.",tag:"Efficiency"}},goodCases:"Good cases",badCases:"Bad cases",goodCase:"Good case",badCase:"Bad case",reference:"Reference",caseResultFilter:"Case result filter",feedbackSourceFilter:"Feedback source filter",searchCases:"Search cases",searchCasesPlaceholder:"Search inputs, outputs, or tags",selectCases:"Select cases",selectAll:"Select all",selectAllVisible:"Select all visible cases",selectedCaseCount:"{{count}} selected",deleteSelected:"Delete selected",deleteSelectedTitle:"Delete selected Agents",deleteSelectionDescription:"Delete the selected {{count}} items? This cannot be undone.",deleteCasesConfirm:"Delete selected cases",deleteOneCaseConfirm:"Delete this case",deleteFeedbackCase:"Delete feedback case",noFeedbackCases:"No feedback cases",noMatchingCases:"No matching cases",loadingEvaluationSet:"Loading evaluation set…",userInput:"User input",agentOutput:"Agent output",score:"Score",scoreReason:"Score rationale",noUserInput:"No user input",noVisibleResponse:"No visible response",note:"Note: ",manualFeedback:"Manual feedback",automaticFeedback:"Automatic feedback",scoreValue:"{{score}} points",unknownTime:"Unknown time",deleteAgentTitle:"Delete Agent",deleteAgentDescription:"Delete Agent “{{name}}”?",deleteDraftDescription:"Delete draft “{{name}}”?",deleteAgent:"Delete Agent",closeDeleteConfirmation:"Close delete confirmation",mpaDeletePreviewSummary:"Studio will delete visible idle MPA Runtime sessions first, then delete the AgentKit Runtime. Running work must finish or be stopped before deletion.",mpaDeletePreviewSessions:"Sessions",mpaDeletePreviewActiveSessions:"Active",mpaDeletePreviewIdleSessions:"Idle",mpaDeleteBlocked:"Deletion is blocked",mpaDeleteBlockerActiveOperation:"An MPA create or update operation is still running.",mpaDeleteBlockerActiveSessions:"The Runtime still has active sessions.",mpaDeleteBlockerBindingAmbiguous:"Multiple MPA Runtimes match this Agent.",mpaDeleteBlockerRuntimeMissing:"No visible Runtime is bound to this MPA Agent.",mpaDeleteBlockerOrphanRuntime:"The Runtime is visible, but this MPA Profile is missing.",mpaDeleteStage:{runtime_sessions:"Delete {{count}} visible idle Runtime sessions",runtime_diagnostics:"Remove diagnostics and mounted metadata owned by those sessions",agentkit_runtime:"Delete the AgentKit Runtime"},draftDeletionWarning:"The draft will be removed from this browser.",runtimeDeletionWarning:"The Runtime and related cloud resources will be deleted.",noneSelected:"None selected",none:"None",notPublished:"Not published",notRecorded:"Not recorded",noTime:"No timestamp",noPr:"No PR",comingSoon:"Evaluation is coming soon",preparing:"Preparing",cancelled:"Cancelled",failed:"Failed",totalCount:"{{count}} total",deploymentProgress:"Deployment progress",returnToEdit:"Return to editing",retryOperation:"Retry operation",buildLog:"Build log",githubMountLog:"GitHub setup log",githubDeliveryMountLog:"GitHub continuous-delivery setup log",waitingBuildLog:"Waiting for build logs…",waitingGithubMountLog:"Waiting for GitHub setup logs…",copy:"Copy",copied:"Copied",copyLabel:"Copy {{label}}",copiedLabel:"Copied {{label}}",logLines:"{{count}} lines",logStatus:{synced:"Synced",failed:"Failed to load",syncing:"Syncing",earlyOmitted:"Earlier logs omitted",recentOnly:"Showing only the latest build logs",partiallyOmitted:"Some logs omitted"},deployStatus:{running:"Deploying",unconfirmed:"Deployment status unconfirmed",success:"Deployment complete",error:"Deployment failed",cancelled:"Deployment cancelled"},deploymentSteps:{prepare:{label:"Prepare deployment",description:"Validate the configuration and create a deployment task"},build:{label:"Build image",description:"Generate the runtime environment and Agent code"},deploy:{label:"Deploy service",description:"Create and start the AgentKit Runtime"},publish:{label:"Publish service",description:"Wait for the service and generate its access URL"},complete:{label:"Deployment complete",description:"The Agent is ready to use"},evaluation:{label:"Create evaluation sets",description:"Create Good Case and Bad Case evaluation sets automatically"},profileApplying:{label:"Apply MPA profile",description:"Write the Studio Agent profile into the MPA Runtime"},smokeRunning:{label:"Verify MPA Runtime",description:"Run the Runtime readiness smoke before exposing it as runnable"},runnable:{label:"MPA Runtime ready",description:"The Runtime accepted the profile and passed execution readiness"},github:{label:"Connect GitHub delivery",description:"Initialize the target branch and GitHub Actions workflow"},update:{label:"Update instance configuration",description:"Set Runtime instances to {{min}}–{{max}}"}},githubStatus:{published:"Published",publishing:"Publishing",failed:"Release failed",pending:"Pending release",unknown:"Unknown"},errors:{agentInfoMissing:"Agent information is unavailable",checkUpdateCapability:"Unable to check update capability",checkingUpdateConfig:"Checking update configuration",cloudOnlyUpdate:"Only cloud Agents can be updated",deleteDeployedUnsupported:"Deleting deployed Agents is not supported",deleteDraftUnsupported:"Deleting drafts is not supported",loadMpaDeletePreview:"Unable to load MPA delete preview",loadAgentInfo:"Unable to load Agent information",loadApiKey:"Unable to load the API key",loadGithubVersions:"Unable to load GitHub versions",loadEvaluations:"Unable to load evaluation cases",loadMpaAgentView:"Unable to load MPA Agent status",loadMpaDiagnostics:"Unable to load Runtime diagnostics",loadOptimizations:"Unable to load optimization suggestions",loadRuntimeDetails:"Unable to load Runtime details",loadSessionConfig:"Unable to load Session configuration",loadUsage:"Unable to load usage data",noCreatePermission:"This account cannot create Agents",noManagePermission:"This account cannot manage this Agent",originalConfigUnavailable:"The original configuration is unavailable",probeIntegration:"Unable to check integration capabilities",rollbackVersion:"Unable to create a version rollback",runtimeRegionMissing:"The Runtime region is missing",updateCapabilityMismatch:"The Runtime update capability does not match this configuration",updateCapabilityPending:"The Runtime update capability is still being checked",updateConfigRestoring:"Restoring update configuration",updateUnsupported:"This Runtime cannot be updated",usageMismatch:"The returned usage data does not match this Agent"}},Kme={title:"Environments",loadFailed:"Failed to load environments. Check the storage configuration and try again.",storageUnavailable:"Persistent storage is not configured. Environment management is unavailable.",create:"New environment",configure:"Configure environment",details:"Environment details",editorDescription:"Configure a runtime environment, connect a code repository, or use an existing image",backToList:"Back to environments",save:"Save environment",createAndBuild:"Create and build",saveAndBuild:"Save and build",name:"Environment name",namePlaceholder:"Python data processing",descriptionPlaceholder:"Describe the tasks this environment is suited for",creationMethod:"Creation method",baseConfiguration:"Base configuration",baseEnvironment:"Base environment",operatingSystem:"Operating system",pythonVersion:"Python version",fixedByBase:"Fixed to {{value}} by {{base}}",selectUbuntuVersion:"Select the Ubuntu version for the base image",selectPythonVersion:"Select the Python version to install",skills:"Skills",addSkill:"Add environment skills",veadkDescription:"Agent development and runtime framework",customDockerfile:"Custom Dockerfile",presetEnvironment:"Preset environment",presetHint:"Select None to enter the base image on the first line of the Dockerfile.",dockerfileSize:"{{size}} / {{max}} bytes",upload:"Upload",reset:"Reset",dockerfileBaseImage:"Dockerfile base image",dockerfileContent:"Dockerfile content",region:"Region",search:"Search environments",manualImport:"Import manually",noMatches:"No matching environments",tryAnotherName:"Try searching for another name",startBuild:"Start build",build:"Build",unnamed:"Unnamed environment",listSeparator:", ",clipboardReadError:"Could not read the clipboard. Allow clipboard access, or open Import environment and paste the share code manually.",clipboardUnsupported:"This browser cannot read the clipboard automatically. Open Import environment and paste the share code manually.",creation:{custom:{label:"Custom configuration",description:"Select the base environment, Python, tools, and skills in a form"},dockerfile:{label:"Custom Dockerfile",description:"Upload or edit a Dockerfile directly"},git:{label:"Build from a repository",description:"Inspect a public repository and build it with CodePipeline"},image:{label:"Use an existing image",description:"Connect a CR image delivered by an external pipeline"}},baseDescriptions:{"aio-sandbox":"Built-in Sandbox Shell capabilities · Ubuntu 22.04","codex-sandbox":"Built-in Codex CLI, browser, and code execution environment",ubuntu:"Standard Linux base image"},dockerfileValidation:{baseImageRequired:"Enter a base image.",duplicateFrom:"The base image is fixed on the first line. Remove the FROM instruction from the Dockerfile body.",tooLarge:"The Dockerfile cannot exceed 128 KiB.",empty:"The Dockerfile cannot be empty.",missingFrom:"The Dockerfile must include a FROM instruction."},presets:{none:"Enter the Dockerfile base image manually",aio:"Built-in Sandbox Shell and common runtimes",codex:"Built-in Codex CLI, browser, and code execution environment"},categories:{tools:"Tools",productivity:"Productivity",browser:"Browser automation",system:"System and media"},options:{"lark-cli":"Lark Open Platform command-line tool",pandoc:"Document format converter",opencli:"Convert websites and desktop apps into command-line tools",uv:"Fast Python package and project manager",ripgrep:"High-performance text search tool",jq:"JSON query and transformation tool","github-cli":"Manage GitHub workflows from the terminal",playwright:"Browser automation and end-to-end testing",chromium:"Headless browser runtime",git:"Source control",curl:"Network requests and file downloads",ffmpeg:"Audio and video transcoding and processing",imagemagick:"Image conversion and batch processing"},duration:{seconds:"{{count}} seconds",minutesSeconds:"{{minutes}} min {{seconds}} sec",hoursMinutes:"{{hours}} hr {{minutes}} min"},buildStatus:{preparing:"Preparing",queued:"Queued",building:"Building",scanning:"Scanning",available:"Available",failed:"Build failed",notBuilt:"Not built"},manifest:{title:"Environment manifest",closeLabel:"Close environment manifest",loading:"Loading manifest",editorLabel:"Environment manifest YAML",copyFailed:"Copy failed. Try again.",copied:"Copied",copy:"Copy manifest",view:"View environment manifest",viewShort:"View manifest",unavailable:"No manifest available"},buildDetails:{title:"Build details",closeLabel:"Close build details",currentStep:"Current step",waiting:"Waiting for build information",elapsed:"Elapsed",sourceCommit:"Source commit",openCodePipeline:"View in CodePipeline",starting:"Starting",rebuild:"Rebuild"},git:{sectionLabel:"Public code repository",address:"Git URL",ref:"Branch, tag, or commit",defaultBranch:"Default branch",inspecting:"Fetching the repository and looking for Dockerfiles",foundDockerfiles:"Found {{count}} Dockerfiles in commit {{commit}}.",savedDockerfileLoaded:"Loaded the saved Dockerfile. Inspect the repository again to check for updates.",noDockerfile:"No Dockerfile was found. Check the branch or repository contents.",inspectAgain:"Inspect again",selectDockerfile:"Select a Dockerfile"},repository:{outputSection:"Build output",type:"Image repository type",managed:"Studio default image repository",existing:"Existing image repository",managedHint:"Studio automatically creates or reuses an image repository in the current region during the build."},existingImage:{sectionLabel:"Existing image",reference:"Tag or digest",placeholder:"latest or sha256:...",hint:"Enter an image tag or a complete digest beginning with sha256:."},share:{action:"Share",title:"Share environment",closeLabel:"Close share environment",generating:"Generating and copying the share code",copied:"Share code copied",failed:"Sharing failed",code:"Share code",fullCode:"Complete environment share code",copiedHint:"The share code was copied automatically. You can also view or copy it here.",copyFailedHint:"Automatic copy failed. Copy the share code above manually or try again.",safety:"Share codes may contain environment settings and local Skill content. Send them only to trusted recipients.",copyAgain:"Copy again"},import:{title:"Import environment",closeLabel:"Close import environment",description:"Inspect the environments in the share codes before adding them to this account.",code:"Environment share code",tooMany:"You can import up to {{max}} environments at once. {{count}} share codes were found.",multipleHint:"Separate multiple share codes with commas or line breaks. Duplicates are ignored automatically.",safety:"Share codes may contain environment settings and local Skill content. Import them only from trusted sources.",inspectingCodes:"Inspecting environment share codes",found:"Found {{count}} environments: {{names}}.",itemError:"Share code {{index}}: {{error}}",invalidCode:"Invalid share code.",noResult:"The service returned no import result for this share code.",partial:"Imported {{created}} environments; {{remaining}} remain. Valid failed items can be retried.",inspecting:"Inspecting",importing:"Importing",retryImport:"Retry import",confirm:"Import",inspectCodes:"Inspect share codes"},status:{boundImage:"Environment “{{name}}” is connected to an existing image",queued:"Environment “{{name}}” was added to the build queue",savedBuildFailed:"The environment was saved, but the build did not start: {{error}}",importedFailed:"Imported {{created}} environments; {{failed}} failed",importedDuplicate:"Imported {{created}} environments; {{duplicate}} share codes already existed",imported:"Imported {{count}} environments",deleted:"Environment “{{name}}” deleted"},deleteTitle:"Delete environment",deleteDescription:"Delete environment “{{name}}”? This cannot be undone.",errors:{repositoryRequired:"Enter a public code repository URL.",repositoryHttps:"Enter the HTTPS URL of a public repository.",repositoryInvalid:"Enter a valid public repository HTTPS URL.",imageReferenceWhitespace:"A tag or digest cannot contain spaces.",imageDigestInvalid:"The digest must be a complete sha256 value.",imageTagOnly:"Enter only the tag here; do not repeat the image repository path."}},Gme={searchPlaceholder:"Search resource names",emptyMessage:"No options available",searchAriaLabel:"Search {{label}}",loadingMore:"Loading more resources…"},Xme={retryDeployment:"Retry deployment",retrying:"Retrying…",collapse:"Collapse error details",expand:"Expand full error details",copy:"Copy full error details"},Yme={steps:"Build steps",log:"Build log",syncing:"Syncing",loadFailed:"Failed to load",synced:"Synced",recentOnly:" · Recent logs only",copiedLog:"Build log copied",copyLog:"Copy build log",copied:"Copied",copy:"Copy",logContent:"Build log content",waiting:"Waiting for CodePipeline logs…",empty:"No build logs"},Zme={defaultLabel:"Studio default environment",defaultDescription:"Use the standard runtime environment provided by Studio",status:{notBuilt:"Not built",preparing:"Preparing",queued:"Queued",building:"Building",scanning:"Scanning",available:"Available",failed:"Failed"},label:"Runtime environment",placeholder:"Select a runtime environment",search:"Search runtime environments",loading:"Loading runtime environments…",loadFailed:"Failed to load runtime environments",noMatches:"No matching runtime environments",unavailable:"No runtime environments are currently available",selectionUnavailable:"The selected runtime environment is unavailable. Select another one.",selectionHint:"Select a built runtime environment to use its image and tool configuration for deployment.",versionChanged:"The selected environment version has changed. Review it before continuing.",versionMissing:"The selected environment version no longer exists. Select another one.",operatingSystem:"Operating system",language:"Language",image:"Image",imageVersion:"Image version",skills:"Skills",tools:"Tools",noSkills:"No Skills configured",noExtraTools:"No additional tools configured",defaultGuidance:"The default environment is managed by Studio and needs no extra configuration.",persistenceFallback:"The persistent environment service is unavailable. The default environment is being used.",emptyFallback:"No custom environments are available."},Jme={repository:"GitHub repository",githubUrl:"GitHub URL",token:"Token",sessionToken:"{{provider}} Session Token",runtime:"Runtime",commit:"Commit",workflow:"Workflow",syncFailed:"Failed to sync GitHub code",status:{mounted:"Mounted",bound:"Bound",synced:"Synced",created:"Created"},volcengine:"Volcengine",mountDelivery:"Enable continuous delivery",selectedForDeployment:"Selected for deployment",mountOnDeploy:"Enable continuous delivery on deploy",syncCode:"Sync code",deliveryMode:"GitHub delivery mode",sourceSync:"GitHub code sync",delivery:"GitHub delivery",loading:"Loading",running:"Running",runtimeDeliveryHint:"Write an AgentKit Runtime GitHub Actions workflow so future GitHub commits update the bound Runtime.",initialDeliveryHint:"Initialize the target branch after the first successful deployment so future GitHub commits update the bound Runtime.",sourceSyncHint:"Studio pushes directly to the target branch. Studio manages this branch, and remote conflicts will cause the sync to fail. Use the deployment button to publish the Runtime.",tokenPlaceholder:"repo or contents:write permission",getToken:"Get token",hideToken:"Hide token",showToken:"Show token",tokenHelp:"The token is used only for this operation and is cleared from the form after success.",targetBranch:"Target branch",actionsSecretPlaceholder:"Used to write a GitHub Actions secret",sessionTokenPlaceholder:"Optional temporary credential",syncing:"Syncing…",pendingHint:"Continuous delivery is selected. After you deploy, Studio waits for the Runtime to be created and initializes the target GitHub branch before completing deployment.",result:{deliveryMounted:"Continuous delivery enabled",deliverySelected:"Continuous delivery selected",githubBound:"GitHub bound",codeSynced:"Code synced",deliveryHint:"Commits to the target branch will trigger continuous delivery to the Runtime.",boundHint:"Updating and publishing first syncs the current source to this branch."},branch:"Branch",viewPr:"View PR",createFailed:"Creation failed",phase:"Phase",log:"Log"},ege={name:"Feishu",enabling:"Enabling and updating configuration…",description:"Receive messages and reply through a Feishu bot",configuration:"Feishu configuration",configurationMode:"Feishu configuration mode",automatic:"Automatic",manual:"Manual",cancelling:"Cancelling…",scanToCreate:"Scan to create",scanDescription:"Credentials are filled in after authorization",generateQrCode:"Generate QR code",qrCodeAlt:"Feishu bot configuration QR code",scanToConfirm:"Scan with Feishu to confirm",expiresIn:"Expires in {{time}}",created:"Bot created",credentialsFilled:"App credentials filled in automatically",qrCodeExpired:"QR code expired",automaticFailed:"Automatic configuration failed",regenerateQrCode:"Generate a new QR code.",configuredPlaceholder:"Configured; leave blank to keep it",appSecretPlaceholder:"Enter App Secret",hideSecret:"Hide App Secret",showSecret:"Show App Secret"},tge={mode:{auto:"Create automatically",autoDescription:"Create required resources during deployment",recommended:"Recommended",create:"Specify names",createDescription:"Create or reuse resources with the specified names",existing:"Select existing",existingDescription:"Select existing resources from the current account"},selectExisting:"Select an existing resource",searchResource:"Search resource names",noMatch:"No matching resources",noAvailable:"No resources available",searching:"Searching cloud resources…",loading:"Loading cloud resources…",noMatchSentence:"No matching resources.",noAvailableSentence:"No resources available.",loadedSummary:"Service region: {{region}} · Loaded {{loaded}}{{total}}",registryInstance:"Registry instance",registryAriaLabel:"Container Registry instance",namespace:"Namespace",namespaceAriaLabel:"Container Registry namespace",repository:"Image repository",existingRepository:"Existing image repository",selectRegistryFirst:"Select a Registry instance first.",selectNamespaceFirst:"Select a Namespace first.",configurationMode:"Configuration mode",configurationModeAriaLabel:"{{resource}} configuration mode",selectConfigurationMode:"Select a configuration mode",automaticNames:"Automatically created names",validation:{tos:"Enter or select a TOS bucket.",cr:"Enter or select a CR instance, namespace, and image repository.",codePipeline:"Enter or select a CodePipeline Workspace and Pipeline.",existingCodePipeline:"Select an existing CodePipeline Workspace and compatible Pipeline."},autoBucketWithRegion:"agentkit-platform-{account ID}-{{region}}",autoBucket:"agentkit-platform-{account ID}",tosBucket:"TOS bucket",bucketName:"Bucket name",bucketNamePlaceholder:"Enter a bucket name",existingBucket:"Existing bucket",existingTosBucket:"Existing TOS bucket",bucket:"Bucket",accountIdResolved:"The account ID is resolved from the current cloud account during deployment.",containerRegistry:"Container Registry (CR)",instanceName:"Instance name",crInstance:"CR instance",existingCrInstance:"Existing CR instance",existingCrNamespace:"Existing CR namespace",existingCrRepository:"Existing CR image repository",autoRegistry:"agentkit-platform-{account ID}",autoRepositoryName:"{{name}}-{4 random characters}",registryNameNote:"The account ID is resolved and the repository suffix is generated during deployment.",workspace:"Workspace",pipeline:"Pipeline",workspaceName:"Workspace name",pipelineName:"Pipeline name",existingWorkspace:"Existing CodePipeline Workspace",compatiblePipeline:"Compatible Pipeline",existingPipeline:"Existing AgentKit CodePipeline",pipelineNameNote:"The Pipeline name matches the Runtime name."},nge={commit:"Commit",steps:{permissions:"Preflight OTA permissions",resolving:"Resolve target version",downloading:"Download and verify the full update package",preparing:"Prepare VeFaaS Function code",provisioning:"Check and provision Studio cloud resources",scheduler:"Update the scheduled task service",submitting:"Submit the Function update",publishing:"Publish a new Revision and restart the service"},stages:{permissions:"Preflight OTA permissions",resolving:"Resolve version details",downloading:"Download update package",preparing:"Prepare Function code",provisioning:"Provision Studio cloud resources",scheduler:"Update scheduled task service",submitting:"Submit Function update",publishing:"Publish Revision",checking:"Check for updates",unknown:"Unknown stage"},duration:{seconds:"{{count}} seconds",minutesSeconds:"{{minutes}} min {{seconds}} sec"},logPermissionPrefix:"Unable to read VeFaaS release logs. The Function role lacks ",logPermissionSuffix:"; the update will continue.",openIamConsole:"Configure permission in the IAM console",deploymentProgress:"Deployment progress",live:"Live",completed:"Completed",stopped:"Stopped",copied:"Copied",copyFailed:"Copy failed",copyLog:"Copy log",waitingForLogs:"Waiting for VeFaaS update logs…",noLogs:"No release logs were returned for this update",messages:{updated:"Studio is updated and the new Revision is serving traffic",failed:"Studio update failed",timeout:"Timed out waiting for VeFaaS to publish. Check for updates again later.",submitted:"Update submitted. Waiting for VeFaaS to publish the new version.",connectionSwitched:"The connection changed. Confirming the new version status."},checkingPermissions:"Checking OTA permissions",authorizationRequired:"IAM authorization required",updating:"Updating Studio",updated:"Studio updated",updateToVersion:"Update Studio to {{version}}",checkPermissions:"Check update permissions",authorizationNeeded:"Authorization required",updatingShort:"Updating",refreshForNewVersion:"Refresh to use the new version",updateFailed:"Update failed",updateNow:"Update now",newVersionAvailable:"New version available",dialog:{failed:"Studio update failed",checkingPermissions:"Checking update permissions",authorizationRequired:"IAM authorization required",updating:"Updating Studio",completed:"Studio update complete",newVersion:"New version available"},permissionCheck:"Checking every IAM permission required by OTA and scheduled tasks…",permissionCheckHint:"Downloads and cloud-resource updates begin only after all permissions are available.",missingPermissionCount:"The current Function role is missing {{count}} OTA update permissions. No cloud resources have been changed.",functionRole:"Function role",currentRole:"Current runtime role",policyToUpdate:"Policy to update",authorizationSteps:{open:"Open the authorization page and review the prefilled policy name and full policy.",debug:"Select “Start debugging” on the page to apply the policy update.",return:"Return to this window and select “Authorized, check again”."},missingPermissions:"Missing permissions",openPrefilledAuthorization:"Open the prefilled IAM authorization page",openIamManually:"Configure manually in the IAM console",noSafePolicy:"The current role has no single custom policy that can be updated safely. Ask an administrator to add the permissions above to this role.",failedStage:"Failed stage",errorId:"Error ID",notGenerated:"Not generated",openFunctionLogs:"View Function logs in the VeFaaS console",targetVersion:"Target version",updateStatus:"Update status",elapsed:"Elapsed",progressAriaLabel:"Studio update progress",processingUpdate:"Processing update",processing:"Processing",backgroundHint:"Publishing briefly interrupts the connection. Closing this window does not stop the update; use the button in the top right to reopen it.",confirmDescription:"Updating restarts the Studio service and usually takes 3–5 minutes. Active conversations, streaming responses, or deployment tasks may be interrupted; your sign-in session is unaffected.",selectVersion:"Select version",currentVersion:"Current version",changelog:"What's new",noChangelog:"No release notes",runInBackground:"Run in background",authorizedRecheck:"Authorized, check again",tryAgain:"Try again"},ige={deploy:"Deploy",update:"Update",planHash:"Plan hash",backToConfiguration:"Back to configuration",releaseRegion:"Release region",deployRegion:"Deployment region",regionPreserved:"The existing Runtime deployment region is preserved during updates and cannot be changed.",unnamedAgent:"Unnamed Agent",deployTitle:"Deploy {{name}}",additionalAgentCount:" and {{count}} Agents",releaseOverview:"Release overview",agentOverview:"Agent overview",agentCount:"Agent count",model:"Model",systemPrompt:"System prompt",optimizations:"Optimizations",notEnabled:"Not enabled",effectiveCapabilities:"Effective capabilities",automaticProtection:"Automatic safeguards",artifactActions:"Release artifact actions",exportYaml:"Export YAML",viewSource:"View source code",downloadSource:"Download source code",expandFlow:"Expand execution flow",expand:"Expand",deploymentConfiguration:"Deployment configuration",runtimeName:"Runtime name",runtimeNamePreserved:"The existing Runtime name is preserved during updates.",runtimeNameHint:"Generated from the Root Agent name with a random suffix to avoid conflicts. Use 4–64 letters, numbers, hyphens, or underscores.",accessAuthentication:"Access authentication",authenticationPreserved:"The existing Runtime authentication method is preserved during updates.",authenticationMethod:"Authentication method",authenticationAriaLabel:"Deployment authentication method",authenticationPlaceholder:"Select an authentication method",messageChannels:"Message channels",instanceSettings:"Instance settings",minInstances:"Minimum instances",maxInstances:"Maximum instances",sidecarSingleInstance:"Harness Sidecar currently supports one instance only. The Runtime is fixed at 1–1.",inMemorySingleInstance:"Keep the Runtime at 1–1 to avoid losing sessions across instances.",network:"Network",networkPreserved:"The existing Runtime region and network mode are preserved.",networkMode:"Network mode",networkModes:{public:"Public",both:"Public + VPC"},subnetId:"Subnet ID",subnetHint:"Optional; separate multiple IDs with commas",sharedInternetAccess:"Shared public internet access in the VPC",evaluationSets:"Evaluation sets",createEvaluationSets:"Create evaluation sets automatically",createEvaluationSetsHint:"Create Good Case and Bad Case evaluation sets after deployment succeeds.",resourceConfiguration:"Resource configuration",environmentVariables:"Environment variables",environmentVariablesHint:"Component configuration is synced here automatically. Review the final values before deployment.",itemCount:"{{count}} items",addVariable:"Add variable",componentGenerated:"Generated from components",injectedByApiKey:"Injected from the selected API key",envNameAriaLabel:"{{key}} environment variable name",envDescriptionAriaLabel:"{{key}} description: {{description}}",openOpenViking:"Open OpenViking {{label}}",openOpenVikingAriaLabel:"{{key}}: open OpenViking {{label}}",requiredEmpty:"Required; no value entered",optionalEmpty:"Optional; no value entered",envValueAriaLabel:"{{key}} environment variable value",automatic:"Automatic",synced:"Synced",customModelCredentials:"Custom model credentials",releaseOnlySecret:"Required; used only for this release",thisRelease:"This release",customVariables:"Custom variables",value:"Value",deleteVariable:"Delete variable",deploymentProgress:"Deployment progress",retryUpdate:"Retry update",retryDeploy:"Retry deployment",updateSucceeded:"Update succeeded",deploySucceeded:"Deployment succeeded",region:"Region",agentName:"Agent name",apiEndpoint:"API endpoint",connecting:"Connecting…",chatNow:"Chat now",console:"Console",actionInProgress:"{{action}} in progress…",checkingName:"Checking name…",retryAction:"Retry {{action}}",flowPreview:"Execution flow preview",executionFlow:"Execution flow",flowPreviewHint:"Read-only preview; zoom and pan the canvas",closeFlowPreview:"Close execution flow preview",agentAdded:'Agent "{{name}}" was added to the selector in the top left.',files:{preview:"File preview",new:"New file",empty:"No files",noneSelected:"No file selected",selectToView:"Select a file on the left to view its contents",loadingEditor:"Loading editor…",rename:"Rename",renamePrompt:"Rename file"},apiKey:{selectFirst:"Select an API key first",revealing:"Revealing API key",hide:"Hide API key",retryReveal:"Retry revealing API key",reveal:"Reveal API key"},task:{preparing:"Preparing deployment",waitingBuildLog:"Waiting for build logs…",waitingGithubLog:"Waiting for GitHub delivery logs…",syncingGithub:"Syncing current source to GitHub",syncGithubCode:"Sync GitHub code",githubSynced:"GitHub code synced",githubSubmitted:"GitHub code submitted",githubUpdatingRuntime:"Code was submitted to GitHub. GitHub Actions is updating the same Runtime.",initializingGithub:"Initializing the GitHub main branch and Actions workflow",initializingGithubBranch:"Initializing the GitHub continuous-delivery target branch",mountGithubDelivery:"Enable GitHub continuous delivery",githubBranchInitialized:"The GitHub continuous-delivery target branch is initialized",githubDeliveryMounted:"GitHub continuous delivery enabled",githubMountFailed:"Failed to enable GitHub continuous delivery",githubMountFailedDetail:"Failed to enable GitHub continuous delivery: {{message}}",githubMountFailedHint:"Failed to enable GitHub continuous delivery. See the GitHub log for details.",applyingMpaProfile:"Applying the Agent profile to MPA Runtime",mpaProfileApplied:"MPA Runtime profile applied",runningMpaSmoke:"Verifying the MPA Runtime execution path",mpaReady:"MPA Runtime is ready",deploymentComplete:"Deployment complete",deployedNotConnected:"Deployed, not connected yet",cancelled:"Cancelled",cancelledHint:"Deployment was cancelled and the Runtime resources were requested for deletion.",deploymentStatusUnconfirmed:"Deployment status unconfirmed",deploymentFailed:"Deployment failed",buildFailedHint:"Image build failed. See the build log for details."},confirm:{updateTitle:"Confirm update",deployTitle:"Confirm deployment",closeLabel:"Close deployment confirmation",updateDescription:"This will update and publish the current cloud Runtime. It may take a few minutes. Continue?",deployDescription:"This will create a new cloud Runtime. Deployment may take a few minutes. Continue?",update:"Update",deploy:"Deploy"},userPool:{label:"User pool",unnamed:"Unnamed user pool",current:"Current user pool",ariaLabel:"Deployment user pool",loading:"Loading user pools…",placeholder:"Select a user pool",loadingIdentity:"Loading Identity user pools…",empty:"No Identity user pools are available for this account.",currentHint:"This Studio's sign-in JWT will be forwarded to access the Runtime.",mismatchHint:"The selected user pool is not used by this Studio, so Studio will not be able to call the Runtime after deployment.",markedHint:"The user pool used by this Studio is marked in the list."},authentication:{apiKeyDescription:"Default method using the Runtime API key",userPool:"User pool",userPoolDescription:"Use a JWT issued by an Identity user pool"},steps:{buildImage:"Build image",deploy:"Deploy",publish:"Publish",syncCode:"Sync code",uploadPackage:"Upload code package",packageImage:"Package image",createRuntime:"Create Runtime",publishService:"Publish service",updateInstances:"Update instance configuration",createEvaluationSets:"Create evaluation sets",applyMpaProfile:"Apply MPA profile",verifyMpaRuntime:"Verify MPA Runtime",mpaReady:"MPA Runtime ready"},errors:{instanceRangeInteger:"Minimum instances must be an integer of 0 or more, and maximum instances must be an integer greater than 0.",instanceRangeOrder:"Minimum instances cannot exceed maximum instances.",selectApiKey:"Select an API key in the model configuration first.",loadApiKey:"Failed to load the API key. Try again.",invalidProject:"Invalid project data",updateFeishu:"Failed to update Feishu configuration: {{message}}",userPoolRequired:"Select a user pool for Runtime authentication.",vpcRequired:"Enter a VPC ID when using a VPC network.",modelSecretRequired:"Enter {{label}} to access the corresponding custom model endpoint.",managedApiKeyRequired:"{{requirement}}. Return to model configuration and select an API key first.",feishuEnvRequired:"Enter {{field}} after enabling Feishu.",runtimeNameExists:"This Runtime name already exists. Change it and try again.",deployedButGithubMountFailed:"Deployment succeeded, but enabling GitHub continuous delivery failed: {{message}}",deployedButGithubBindFailed:"Deployment succeeded, but binding GitHub failed: {{message}}",mpaRuntimeIdMissing:"Deployment succeeded, but the Runtime ID is missing, so the MPA profile cannot be applied.",mpaOperationIncomplete:"MPA Runtime setup did not complete. Retry this deployment task.",deploymentStatusUnconfirmed:"The connection was interrupted, so the final deployment status cannot be confirmed. The task may still be running in the cloud. Check the same task in AgentKit or CodePipeline and avoid a duplicate deployment.",failedAtStage:"{{action}} failed during {{stage}}: {{message}}",noAgentAtEndpoint:"Connected successfully, but no Agents were found at this endpoint (/list-apps is empty).",addAgent:"Failed to add Agent: {{message}}",modelApiKeyRequired:"Enter the API key for this model endpoint."}},rge={title:"Workspaces",storageUnavailable:"Persistent storage is not configured. Workspace management is unavailable.",detail:"Workspace details",create:"New workspace",editorDescription:"Group frequently used environments. An environment can belong to multiple workspaces.",backToList:"Back to workspaces",environmentCount_one:"{{count}} environment",environmentCount_other:"{{count}} environments",createdAt:"Created",updatedAt:"Last updated",basicInfo:"Basic information",namePlaceholder:"For example: Content production",descriptionPlaceholder:"Describe what this workspace is for",selectedEnvironmentCount:"{{count}} selected; they can also be reused in other workspaces",searchAvailableEnvironments:"Search available environments",searchEnvironments:"Search environments",noAvailableEnvironments:"No environments are available to add",createEnvironmentFirst:"Create and build an environment on the Environments page first.",noMatchingEnvironments:"No matching environments",tryAnotherName:"Try searching for another name.",environmentStatus:{available:"Available",building:"Building",notBuilt:"Not built"},added:"Added",saved:"Workspace “{{name}}” saved",resourceType:"Workspace resource type",searchWorkspaces:"Search workspaces",loadFailed:"Unable to load workspaces",noMatchingWorkspaces:"No matching workspaces",tryAnotherNameOrEnvironment:"Try another name or environment",noEnvironmentAdded:"No environments added",environmentMissing:"Environment missing",availableFraction:"{{available}}/{{total}} available",available:"Available",availableCount:"{{count}} available",updated:"Updated",addEnvironment:"Add environment",deleteTitle:"Delete workspace",deleteDescription:"Delete workspace “{{name}}”? Its environments will not be deleted.",deleted:"Workspace “{{name}}” deleted",clipboardPermissionError:"Could not read the clipboard. Allow clipboard access, or open Import environment and paste the share code manually.",clipboardUnsupported:"This browser cannot read the clipboard automatically. Open Import environment and paste the share code manually.",codeProjects:"Code projects"},sge={back:"Back",detailNavigation:"Detail navigation",noData:"No data",actions:"Actions",moreActions:"More actions for {{label}}",actionsFor:"Actions for {{label}}",loading:"Loading resources…"},age={addSkill:"Add Skill",remove:"Remove {{name}}",confirmRemoveRuntime:"Remove the running Skill “{{name}}” from the new version?",selectedCount:"Added skills · {{count}}",close:"Close {{label}}",sources:{runtime:"Running source · Preserved as-is; remove it or replace it with a Skill of the same name",local:"Local",skillspace:"AgentKit Skills Center",skillhub:"Volcengine Find Skill marketplace"},tabs:{local:"Local files",localShort:"Local files",skillspace:"AgentKit Skills Center",skillspaceShort:"AgentKit",skillhub:"Volcengine Find Skill marketplace",skillhubShort:"Find Skill"}},oge={model:"Model",turnControls:"Turn controls",pause:"Pause",resume:"Resume",interrupt:"Interrupt",cancel:"Cancel",pauseTurn:"Pause the whole flow at a safe point",resumeTurn:"Resume the whole flow",interruptTurn:"Interrupt this flow and retain Session context",cancelTurn:"Cancel this flow permanently",turnState:{running:"Running",pausing:"Reaching safe point",paused:"Paused",resuming:"Resuming",interrupting:"Interrupting",cancelling:"Cancelling",interrupted:"Interrupted",completed:"Completed",failed:"Failed",cancelled:"Cancelled",orphaned:"Status pending",newTurnRequired:"Continue from checkpoint"},tasks:{ppt:"Presentation",image:"Image generation",video:"Video generation"},prompts:{ppt:{quarterlyReview:"Review 【quarter】 business performance, highlighting metric gaps, causes, and recommended actions",projectUpdate:"Present the progress of 【project name】: milestones, risks, budget, and resource requests",solutionProposal:"Create a solution proposal for 【customer industry】: pain points, architecture, implementation plan, and benefits",industryAnalysis:"Analyze trends in 【industry topic】 and recommend strategic opportunities based on the competitive landscape"},image:{launchVisual:"Design a 【high-tech】 launch-event key visual for 【brand or product】",ecommercePoster:"Create an e-commerce poster for 【product name】 that highlights 【core selling point】 and brand colors",conceptRendering:"Create a photorealistic concept rendering of 【product or space】 in 【usage scenario】",socialGraphic:"Create a concise, professional corporate social graphic for 【campaign theme】"},video:{brandFilm:"Create a 30-second promotional video for 【brand name】 that highlights 【brand value】",productLaunch:"Create a 45-second launch video for 【product name】 covering the pain point, features, scenarios, and call to action",trainingVideo:"Create a corporate training video about 【training topic】 that clearly explains 【key procedure or policy】",eventTeaser:"Create a 20-second teaser for 【event name】 with highlights, time and location, and registration details"}},firstFrame:"First frame",videoToEdit:"Video to edit",baseVideo:"Base video",optimizeSkillPlaceholder:"Describe the skill you want to improve…",createSkillPlaceholder:"Describe the skill you want to create…",createVideoPlaceholder:"Describe the video you want to create…",messageAgentPlaceholder:"Message {{name}}…",selectAgentFirst:"Select an agent first",selectSkillFirst:"Select the Skill you want to improve first",availableSkills:"Available skills",availableSubagents:"Available sub-agents",invokeSkill:"Use a skill",useSubagent:"Use a sub-agent",loadingCapabilities:"Loading Agent capabilities…",noMatchingSkills:"No matching skills for this Agent",noMatchingSubagents:"No matching sub-agents for this Agent",skillFallbackDescription:"Load and run this skill",agentFallbackDescription:"Hand this turn to the Agent",skill:"Skill",uploadImage:"Upload image",uploadDocument:"Upload document or PDF",uploadVideo:"Upload video",taskMode:"Task mode",selectTaskMode:"Select a task mode",loadingGenerationModel:"Loading generation model",modelUnavailable:"Model unavailable",cancelTask:"Cancel {{task}} task",stopGenerating:"Stop generating",viewVideoProgress:"View video generation progress",send:"Send",selectTaskType:"Select a task type",enterprisePrompts:"{{task}} enterprise prompts",sessionId:"Session ID",sessionIdLabel:"Session ID: ",initializing:"Initializing",copied:"Copied",copySessionId:"Copy session ID",sessionIdCopied:"Session ID copied",disclaimer:"Responses may be inaccurate",viewLogs:"View logs"},lge={selectAgent:"Select Agent",noLocalAgents:"No local Agents.",searchRuntime:"Search Runtime names",mineOnly:"Created by me",noRuntimes:"No Runtimes.",unsupported:"Unsupported",createdByMe:"Created by me",connecting:"Connecting…",connected:"Connected",connect:"Connect",viewInfoFor:"View information for {{name}}",viewInfo:"View information",agentAndRuntimeInfo:"Agent and Runtime information",detailType:"Detail type",agentInfo:"Agent information",runtimeInfo:"Runtime information",loadingAgentInfo:"Loading Agent information…",cannotLoadAgentInfo:"Agent information is temporarily unavailable",unnamedAgent:"Unnamed Agent",subagents:"Sub-agents",tools:"Tools",skills:"Skills",previewUnsupported:"Preview unavailable",mountedComponents:"Mounted components",noMoreAgentInfo:"No additional Agent configuration information.",local:"Local",model:"Model",status:"Status",memoryMb:"Memory {{value}} MB",instances:"Instances {{min}}–{{max}}",resources:"Resources",version:"Version",loadingDetails:"Loading details…",environmentVariables:"Environment variables",errors:{notFound:"This Runtime no longer exists or the list is out of date. Refresh the list and try again.",accessDenied:"This account cannot access the Runtime. Check its Project and access permissions.",previewUnsupported:"This Agent Server version does not support information previews.",unavailable:"This Runtime is temporarily unavailable. Confirm that its status is Ready and try again.",timeout:"Loading timed out. Try again."},componentKinds:{knowledgebase:"Knowledge base",memory:"Memory",prompt_manager:"Prompt manager",example_store:"Example store",run_processor:"Run processor",tracer:"Trace",toolset:"Toolset",plugin:"Plugin",other:"Other"},runtimeStatus:{ready:"Ready",unreleased:"Unreleased",running:"Running",active:"Running",creating:"Creating",pending:"Pending",deploying:"Deploying",updating:"Updating",failed:"Failed",error:"Error",stopping:"Stopping",stopped:"Stopped",deleting:"Deleting",deleted:"Deleted"}},cge={agent:"Agents",agentTypes:{general:"General Agents",mpa:"MPA Agents",codex:"Codex","deepseek-harness":"DeepSeek",openclaw:"OpenClaw",hermes:"Hermes"},creator:"Created by",namedAgent:"{{name}} Agent",storageLocation:"Storage location",currentBrowser:"Current browser",region:"Region",viewDeploymentProgress:"View deployment progress for {{name}}",viewRuntimeDetails:"View Runtime details for {{name}}",viewDetails:"View details for {{name}}",time:"Time",remainingTime:"Time remaining",expiringSoon:"Expiring soon",sandboxRemaining:"{{hours}} hr {{minutes}} min",wakeable:"Asleep",neverExpires:"Never expires",editDraftNamed:"Edit draft {{name}}",viewProgress:"View progress",deleteDraftNamed:"Delete draft {{name}}",recheckCompatibility:"Check chat compatibility for {{name}} again",connectedNamed:"{{name}} is connected",wakeAndChat:"Wake {{name}} and start chatting",chatWith:"Chat with {{name}}",waking:"Waking…",deploying:"Deploying",draft:"Draft",checking:"Checking",chatUnsupported:"Chat unsupported",checkFailed:"Check failed",creatorFilter:"Creator filter",agentType:"Agent type",searchAgents:"Search Agents",handoff:"Handoff",agentList:"{{type}} list",noMatchingAgents:"No matching Agents",adjustSearch:"Try adjusting the search or filters",noAgentType:"No {{type}}",noGeneralAgents:"No General Agents",createGeneralAgentDescription:"Create a General Agent to start building and chatting",createAgentType:"Create {{type}}",createAgent:"Create Agent",loadingMore:"Loading more Agents",scrollForMore:"Scroll down to load more",allLoaded:"All Agents loaded",deleteDraftTitle:"Delete draft?",deleteDraftDescription:"“{{name}}” cannot be recovered after deletion.",deleteDraft:"Delete draft",loadGeneralAgents:"Load General Agents",loadAgentType:"Load {{type}}",compatibility:{checking:"Requesting Runtime /list-apps to confirm that this Agent supports Studio chat.",empty:"Runtime /list-apps returned no available Agents, so chat is currently unavailable.",supported:"This Runtime supports Studio chat.",unknownError:"The Runtime /list-apps request failed without a recognizable error."},sandboxStatus:{ready:"Ready",wakeable:"Asleep",creating:"Creating",starting:"Starting",initializing:"Starting",pending:"Pending",running:"Running",failed:"Error",error:"Error",stopped:"Stopped",expired:"Expired",deleting:"Deleting",deleted:"Deleted",unknown:"Unknown status"},wakingHint:"Waking the agent. This may take some time.",mpaCreate:{name:"Name",namePlaceholder:"e.g. test-agent",nameHelp:"Used as the Runtime name. Use 4–64 letters, numbers, underscores or hyphens.",stepsLabel:"Creation steps",steps:{basics:"Basics",postgres:"PostgreSQL",openviking:"OpenViking",autoPostgres:"Database"},next:"Next",previousStep:"Previous",pgDescription:"Choose an existing PostgreSQL instance. Creation prepares an isolated database for this agent on that instance.",pgSplitDescription:"Use the configured business PG Workspace. Agents share this Workspace, each with its own database. Shared resource records are stored separately in mpa_admin_workspace / mpa_admin_db, configured by the administrator.",pgConsole:"Create or inspect an AIDAP PG Workspace in Volcengine",pgHost:"PG host",pgPort:"PG port",pgInvalid:"Enter a valid PG host and port.",pgCredentials:"The deployment service provides the PG login and password; host and port must match its configuration.",openvikingDescription:"Optional. Enter all three fields to enable OpenViking, or leave all blank to omit OpenViking settings from the new agent.",openvikingConsole:"Inspect OpenViking resources in Volcengine",openvikingUrl:"OpenViking service URL",openvikingResourceId:"OpenViking resource ID",openvikingApiKey:"OpenViking API Key",openvikingInvalid:"Enter a valid HTTPS service URL, resource ID and API Key together, or leave all blank.",openvikingCredentials:"The API Key is used only for this creation and is not saved in browser drafts; re-enter it after a refresh.",tosTitle:"Session output storage",tosDescription:"Optional. Enter complete TOS credentials and a bucket to mount an isolated output directory for every Session. Leave all three blank to use the server defaults; TOS mounting is disabled if no defaults are configured.",tosAccessKey:"TOS Access Key",tosSecretKey:"TOS Secret Key",tosBucket:"TOS bucket",tosInvalid:"TOS Access Key, Secret Key, and bucket are all required together.",tosCredentials:"Credentials are used only for this creation and are not saved in browser recovery data or creation task records.",runtimeImage:"MPA image",workerImage:"Worker image",imageDefault:"Leave blank to use the configured image",imageInvalid:"Enter a valid container image reference without URLs, spaces or credentials.",title:"Create MPA agent",agentId:"Agent ID",description:"Description",region:"Deployment region",plan:"Creation plan",sharedResources:"Prepare or reuse the account VPC, subnets and APIG message gateway",agentResources:"Prepare an isolated database, Skill Space and worker, then deploy the agent",readiness:"Verify gateway and agent readiness before adding the agent to the list",checking:"Checking creation configuration…",configured:"Creation configuration is ready. Submission checks cloud resources and starts provisioning.",notConfigured:"Creation prerequisites are not configured. Ask an administrator to configure them, then retry.",loadFailed:"Could not check creation configuration. Please retry.",reload:"Check again",submit:"Start creation",retry:"Retry creation",newAgent:"Create another agent",newAgentDescription:"Create another agent opens an editable new request and replaces this recovery draft. It does not cancel the old task. If the old task is still running, wait for it to finish before submitting.",close:"Close",cancel:"Cancel creation",confirmCancel:"Confirm cancellation",cancelDescription:"Cancellation stops subsequent steps. Created databases, Skill Spaces, gateways and other registered resources are retained. Retry using the same agent ID.",background:"Creation continues after closing this window. Open it again to view progress.",pollFailed:"Progress is temporarily unavailable. Reconnecting; avoid creating another agent.",iamPermissionDenied:"The deployment service lacks IAM permissions to prepare the runtime role. Ask an administrator to grant access, then retry.",iamTrustConflict:"The runtime role trust is incompatible. Ask an administrator to check VeFaaS and APIG access, then retry.",iamPolicyConflict:"An existing runtime policy with the required name has conflicting contents. Ask an administrator to check it, then retry.",iamOwnershipConflict:"The runtime role does not belong to the deployment account. Ask an administrator to check it, then retry.",iamVerificationFailed:"Runtime role permissions could not be confirmed. Check IAM availability and policies, then retry.",iamConfigurationConflict:"Automatic runtime role preparation requires the default MPA role. Check the server creation configuration.",creationFailed:"This step failed. Check its resources, server configuration and permissions, then retry the same agent ID.",cancelFailed:"Cancellation failed. Check the current progress and retry.",cancelled:"Creation cancelled. Registered resources are retained for retry.",timeout:"Creation timed out. Registered resources are retained. Inspect them before retrying.",interrupted:"Creation was interrupted. Retry the same agent ID to recover registered resources.",skillSpace:"Skill Space",states:{running:"Creating",cancelling:"Cancelling",succeeded:"Created",failed:"Creation failed",cancelled:"Cancelled"},stages:{queued:"Queued",iam_role:"Prepare runtime role",checking:"Checking account and configuration",network:"Preparing VPC and subnets",gateway:"Preparing APIG and IM Gateway",database:"Preparing business database",skills:"Preparing Skill Space",worker:"Preparing worker",deploying:"Preparing database, skills and Runtime",verifying:"Waiting for agent readiness",admin_workspace:"Prepare management PG Workspace",business_workspace:"Prepare business PG Workspace",admin_database:"Initialize shared management database"},back:"Keep creating",pgAutoDescription:"VeADK uses its deployment account to create or reuse two PG Workspaces. mpa_admin_workspace / mpa_admin_db stores shared resource records; the business Workspace hosts an independent database for each agent. No PG connection input is needed. Preparation starts after submission.",pgModeChanged:"This submitted task uses previous PG settings and cannot be retried in automatic mode. Ask an administrator to reconcile its resources and task before starting a new creation.",pgMigrationRequired:"An existing shared registry is configured. Migrate its resource records to mpa_admin_workspace / mpa_admin_db and coordinate the registry URL cutover for existing Runtimes, then recheck this configuration."}},uge={library:"Skill library",skill:"Skill",skills:"Skills",skillSpace:"Skill space",sandboxNotConfigured:"Dev Sandbox is not configured by an administrator",adminNotConfigured:"Not configured by an administrator",totalItems:"{{count}} items",cannotLoadSpaces:"Unable to load Skill spaces",someSpacesFailed:"Some Skill spaces failed to load",degradedRelationWarning:"Some relations are invalid. Readable skills have been restored.",downloadZip:"Download ZIP",optimize:"Optimize",closeSkillDetails:"Close Skill details",skillId:"Skill ID",allFiles:"All files",loadingSkillContent:"Loading Skill content…",noSkillContent:"This Skill has no SKILL.md content",addSkill:"Add Skill",localUpload:"Upload locally",localUploadDescription:"Select a ZIP file and upload it to the Skill space after validation",autoCreate:"Create automatically",autoCreateDescription:"Choose a model and style, then create a Skill through conversation",createSkill:"Create Skill",optimizeNamed:"Optimize {{name}}",deleteSkillConfirm:"Delete the entire Skill “{{name}}”? This affects every space that references it.",deleteSpaceConfirm:"Delete Skill space “{{name}}”? Make sure its Skills have been deleted first.",manageSpaceDescription:"Manage Skills in this space and create new versions",backToSpaces:"Back to Skill spaces",overview:"Overview",skillCount:"Skills",skillCountValue_one:"{{count}} Skill",skillCountValue_other:"{{count}} Skills",updatedAt:"Updated",skillsInSpace:"Skills in {{name}}",searchSkills:"Search Skills",cannotLoadSkills:"Unable to load Skills",noMatchingSkills:"No matching Skills",noSkills:"No Skills",tryAnotherName:"Try searching for another name",emptySkillsDescription:"Upload a Skill locally or create one automatically",actions:"Actions",spaceDetails:"Skill space details",editSpace:"Edit space",deleteSpace:"Delete space",searchSpaces:"Search Skill spaces",spaceList:"Skill space list",noMatchingSpaces:"No matching Skill spaces",createSpace:"Create Skill space",newSpace:"New space",loadingMoreSpaces:"Loading more Skill spaces",scrollForMore:"Scroll down to load more",allSpacesLoaded:"All Skill spaces loaded",errors:{loadSpaces:"Unable to load Skill spaces. Try again later.",loadSkills:"Unable to load Skills. Try again later.",loadSkillDetails:"Unable to load Skill details. Try again later.",deleteSkill:"Unable to delete the Skill",deleteSpace:"Unable to delete the Skill space",downloadSkill:"Unable to download the Skill"},status:{active:"Available",available:"Available",creating:"Creating",disabled:"Disabled",enabled:"Enabled",failed:"Error",inactive:"Inactive",pending:"Pending",published:"Published",ready:"Ready",released:"Published",running:"Running",success:"Healthy",unavailable:"Unavailable",unreleased:"Unreleased",updating:"Updating",unknown:"Unknown"},sharedSpace:"Enterprise shared space",sharedDescription:"Skills available to everyone, published and maintained by administrators",sharedVisibility:"Everyone",sharedPreparing:"Preparing shared space",sharedLoadFailed:"Shared space unavailable",sharedEmpty:"No shared skills yet. Skills published by administrators will appear here",requestPublication:"Request publication",reviewSubmitting:"Submitting…",reviewSubmitted:"Submitted",reviewFailed:"Could not submit the publication request",reviewStatusFailed:"Failed to load review status",reviewRetry:"Apply again",reviewPending:"Pending review",reviewApproving:"Publishing",reviewApproved:"Shared",reviewReturned:"Returned",reviewHistory:"Review history",skillDetailSections:"Skill detail sections",versions:{title:"Version management",refresh:"Refresh",uploading:"Uploading…",upload:"Upload new version",close:"Close",hint:"New versions become public after approval and do not replace published versions; the skill name in the ZIP must match the original",loading:"Loading versions…",loadFailed:"Unable to load versions",filesFailed:"Unable to load version files",uploadFailed:"Unable to upload the new version",submitFailed:"Unable to submit for review",retry:"Retry",empty:"No versions yet",current:"Current version",notSubmitted:"Not submitted",submitting:"Submitting…",submit:"Request publication",processing:"Version status: {{status}}",filesLoading:"Loading files…",filesEmpty:"No files",history:"Review history",shared:"Published"},author:"Author",authorName:"Author: {{name}}"},dge={library:"Knowledge bases",createBase:"New knowledge base",editBase:"Edit knowledge base",invalidName:"The name must start with a letter and contain only letters, numbers, and underscores.",nameHelp:"Start with a letter. Use up to 48 letters, numbers, or underscores.",optionalDescription:"Description (optional)",descriptionOnly:"AgentKit currently supports updating only the knowledge base description.",previewWeb:"Preview web content",addData:"Add data",openOriginalWeb:"Open original page",backToEdit:"Back to edit",confirmAdd:"Confirm and add",source:"Knowledge source",image:"Image",documentFile:"Document file",webPage:"Web page",webUrl:"Web page URL",generatingWebPreview:"Fetching the page and generating a Markdown preview",selectFile:"Select knowledge file",selectOrDropFile:"Select a file or drag it here",selectedFile:"{{size}} · Click to select another file",imageFileHelp:"PNG, JPG, and JPEG up to 200 MB",documentFileHelp:"PDF, PPTX, DOCX, XLSX, and TXT up to 200 MB",uploadingFile:"Uploading the file and adding it to the knowledge base",optionalName:"Name (optional)",optionalType:"Type (optional)",generatePreview:"Generate preview",uploadFile:"Upload file",editMetadata:"Edit knowledge metadata",knowledge:"Knowledge item",field:"Field",value:"Value",backToList:"Back to knowledge bases",metadataJson:"Metadata (JSON)",provider:"Provider",knowledgeId:"Knowledge ID",project:"Project",creator:"Created by",data:"Data",deleteInvalidAssociation:"Delete invalid association",noData:"This knowledge base has no data",addFirstData:"Add the first data item",format:"Format",size:"Size",searchData:"Search data",searchLibraryData:"Search knowledge base data",associationInvalid:"Association invalid",providerMissing:"The underlying Provider knowledge base no longer exists",noMatchingData:"No matching data",loadingMoreData:"Loading more data",retryLoading:"Retry loading",details:"Knowledge base details",searchBases:"Search knowledge bases",someBasesFailed:"Some knowledge bases are temporarily unavailable. Other available content is shown.",noMatchingBases:"No matching knowledge bases",noManagePermission:"You do not have permission to manage this knowledge base",loadingMoreBases:"Loading more knowledge bases",deleteBaseTitle:"Delete knowledge base?",deleteBaseDescription:"This removes the AgentKit association for {{name}}. If Studio created it, the Provider resource is also deleted. This cannot be undone.",deleteDocumentTitle:"Delete knowledge item?",deleteDocumentDescription:"This removes {{name}} from the Provider knowledge base. This cannot be undone.",preview:{processingTitle:"Data is being processed",processingDetail:"A preview will be available after parsing. Reload later.",failedTitle:"Data parsing failed",failedDetail:"Check the source file or page URL and add it again, or reload the latest status.",noParsedTitle:"No parsed content is available yet",noParsedDetail:"Text, tables, or page images will appear after the knowledge base finishes parsing this file.",noMediaTitle:"No media preview is available yet",noMediaDetail:"The knowledge base has not returned an accessible media preview. Reload later.",noDataTitle:"No data is available to preview",noDataDetail:"The knowledge base has not returned parsed results. Reload later.",attachmentError:"The attachment cannot be previewed. Try again later.",imageAlt:"Knowledge data image",audioUnsupported:"This browser does not support audio previews.",videoUnsupported:"This browser does not support video previews.",namedPdf:"{{name}} PDF preview",pdf:"PDF preview",openPdf:"If it cannot be displayed, open the PDF in a new window",fileUnsupported:"This format cannot be previewed directly online. Parsed content is shown when available.",openOriginalFile:"Open original file",loading:"Loading data preview",openOriginalHint:"You can open the original page to view the source content.",chunk:"Chunk {{index}}",loadingMore:"Loading more",loadMore:"Load more"},errors:{fileTooLarge:"A file cannot exceed 200 MB",invalidImageType:"Select a PNG, JPG, or JPEG image",invalidDocumentType:"Select a PDF, PPTX, DOCX, XLSX, or TXT file",createBase:"Unable to create the knowledge base",updateBase:"Unable to update the knowledge base",metadataObject:"Metadata must be a JSON object",metadataFormat:"Invalid metadata format",noWebPreview:"The page has no Markdown content to preview",addWeb:"Unable to add the web page",previewWeb:"Unable to generate the web page preview",uploadFile:"Unable to upload the file",updateDocument:"Unable to update the knowledge item",loadPreview:"Unable to load the data preview",loadMoreBases:"Unable to load more knowledge bases",loadBases:"Unable to load knowledge bases",loadMoreData:"Unable to load more data",loadData:"Unable to load data",deleteBase:"Unable to delete the knowledge base",deleteDocument:"Unable to delete the knowledge item"}},fge={title:"Feishu channel",refresh:"Refresh",loading:"Loading channel configuration…",unsupported:"This Runtime does not support channel management. Upgrade its MPA image.",unauthorized:"Channel management requires a Studio administrator and an authorized Runtime credential.",configurationError:"Channel management configuration is incomplete. Check the Runtime metadata and encryption key.",requestFailed:"Channel request failed. Check the Runtime connection and retry.",bound:"Bound: {{name}}",unbound:"No Feishu bot is bound.",guidance:"Private chats use separate conversations. In allowed groups, mention this bot to start a conversation.",keyRequired:"Configure a persistent CHANNEL_STATE_ENCRYPTION_KEY in the Runtime before binding.",gateway:"Message gateway",route:"Inbound route",delivery:"Reply delivery",configured:"Configured",missing:"Missing",delivery_not_observed:"Not observed",delivery_delivered:"Delivered",delivery_retrying:"Retrying",missingConfig:"Missing Runtime configuration: {{fields}}",bind:"Bind with QR code",newQr:"Generate a new QR code",unbind:"Unbind",confirmUnbind:"Disconnect this bot? It will stop receiving new messages.",qrAlt:"Bot authorization QR code",openQr:"Open authorization page",uncertain:"Registration was interrupted. Check the bot binding and Gateway before starting again.",bindingFailed:"Binding failed. Check Gateway configuration and retry.",chatId:"Allowed group ID",scope:"Group conversation scope",saveGroup:"Save group",noGroups:"No groups allowed yet. Private chats do not need this permission.",edit:"Edit",remove:"Remove",removeGroup:"Remove {{name}}",scope_group_sender:"Separate by sender",scope_group:"Shared by group",scope_group_topic_sender:"Separate by topic and sender",scope_group_topic:"Shared by topic",status_PENDING:"Waiting for scan",status_SCANNED:"Scanned; waiting for authorization",status_AUTHORIZED:"Authorized; preparing registration",status_REGISTERING:"Registering bot",status_BOUND:"Bot bound",status_FAILED:"Binding failed",status_EXPIRED:"QR code expired",workspaceTitle:"Message channels",workspaceDescription:"Connect messaging apps to this Agent and manage access.",provider_feishu:"Feishu",provider_wecom:"WeCom",provider_dingtalk:"DingTalk",comingSoon:"Not available yet",unavailableDescription:"Binding and message settings for {{name}} are not available yet.",runtimeRequired:"Deploy this Agent to a Runtime before configuring message channels.",bindingTitle:"Bot connection",connected:"Bound",notBound:"Not bound",gatewayDescription:"Gateway configuration for receiving channel messages.",routeDescription:"Routing configuration for delivering messages to this Agent.",deliveryDescription:"Observed reply delivery; configuration alone does not confirm delivery.",groupsTitle:"Group access",groupsDescription:"Allow specific groups and choose how conversations are shared.",providerBindingTitle:"Connect {{name}}",providerUnbound:"Connect a {{name}} bot to let users message this agent.",qrGuidance:"Authorize with {{name}}. The Runtime saves the bot credentials and configures the message gateway.",wecomGuidance:"Authorize with WeCom QR code, or enter a Bot ID and Secret to bind an existing bot.",wecomBotId:"Bot ID",wecomSecret:"Secret",bindCredentials:"Connect bot",wecomScan:"Bind with QR code",wecomAuthorizing:"Waiting for WeCom authorization…",cancelAuthorization:"Cancel authorization",wecomPopupBlocked:"Allow popups in your browser, then try authorizing again.",wecomAuthCancelled:"WeCom authorization was cancelled. You can scan again.",wecomAuthTimeout:"WeCom authorization timed out. Please scan again.",wecomInvalidResult:"Authorization did not return a Bot ID and Secret. Authorize again or enter them manually.",wecomAuthFailed:"WeCom authorization failed. Try again or enter credentials manually.",dingtalkClientId:"Client ID",dingtalkClientSecret:"Client Secret",manualUpgrade:"Upgrade this Runtime image to configure {{name}} manually. Quick setup is still available.",pairingTitle:"Message channel QR pairing",feishuPairingDescription:"If a bot is already connected, it will be replaced after successful Feishu authorization and binding. In the authorization flow, you can bind an existing bot or create a new one.",generatingQr:"Generating pairing QR code…",dingtalkGuidance:"Authorize with DingTalk QR code, or enter a Client ID and Client Secret to bind an existing bot.",wecomPairingDescription:"Pair again in the WeCom authorization window. The new bot replaces the current connection after binding succeeds. Cancelling authorization or a failed binding does not disconnect the existing bot.",configurationMethod:"Configuration method",quickSetup:"Quick setup",manualSetup:"Manual setup",feishuAppId:"App ID",feishuAppSecret:"App Secret",manualGuidance:"Enter the credentials of an existing {{name}} bot to connect it to this agent.",manualReplacement:"Successful binding replaces the current bot. Cancelling or a failed binding does not disconnect the existing bot."},pVe={common:Vme,agentKitPromo:Hme,systemInfo:qme,agentWorkspace:Wme,environmentCenter:Kme,deploymentSelect:Gme,deploymentError:Xme,studioBuildProgress:Yme,cloudEnvironment:Zme,githubCicd:Jme,feishuDeployment:ege,deploymentResources:tge,studioUpdate:nge,projectPreview:ige,workspace:rge,resourceCollection:sge,skillSourcePicker:age,composer:oge,agentSelector:lge,myAgents:cge,skillCenter:uge,knowledge:dge,channels:fge},mVe=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:Hme,agentSelector:lge,agentWorkspace:Wme,channels:fge,cloudEnvironment:Zme,common:Vme,composer:oge,default:pVe,deploymentError:Xme,deploymentResources:tge,deploymentSelect:Gme,environmentCenter:Kme,feishuDeployment:ege,githubCicd:Jme,knowledge:dge,myAgents:cge,projectPreview:ige,resourceCollection:sge,skillCenter:uge,skillSourcePicker:age,studioBuildProgress:Yme,studioUpdate:nge,systemInfo:qme,workspace:rge},Symbol.toStringTag,{value:"Module"})),hge="User management",pge="{{count}} members",mge="User",gge="Role",bge="Account status",yge="Last sign-in",vge="Actions",xge="Change role",wge="Close",Oge="Save role",kge="Saving…",Sge="Cancel",Ege="Back",Cge="User pool",Age="Volcengine Identity",Tge="Search name, email or user ID",_ge="Search",jge="Filter by role",Nge="All roles",Rge="Refresh",Ige="Loading users…",Pge="Updated at {{time}}",Dge="{{name}} is now {{role}}",Mge="Retry",Lge="You",$ge="Initial super administrator",Fge="The initial super administrator cannot be demoted here",Bge="The new permissions apply when the user refreshes Studio",Uge="Role needs confirmation",Qge="No matching users",zge="Try another search or role",Vge="Users appear here after signing in or joining this user pool",Hge="{{count}} users",qge="Previous",Wge="Next",Kge="Not signed in yet",Gge="Not provided",Xge={super_admin:"Super administrator",admin:"Administrator",developer:"Developer",user:"User"},Yge={super_admin:"Manage all resources, users and role assignments",admin:"Manage Studio resources",developer:"Develop agents and manage your own resources",user:"Use agents and personal features"},Zge={EXTERNAL_PROVIDER:"Active",CONFIRMED:"Active",NORMAL:"Active",ENABLED:"Active",ACTIVE:"Active",UNCONFIRMED:"Unverified",DISABLED:"Disabled",FORBIDDEN:"Disabled",LOCKED:"Locked",SUSPENDED:"Suspended",FORCE_CHANGE_PASSWORD:"Password change required"},Jge={request_failed:"The request did not finish. Refresh the list to confirm its current state before retrying",invalid_response:"The user service returned an invalid response. Refresh and try again",identity_unavailable:"Identity is unavailable. Try again later or check service permissions",identity_resource_missing:"The user or user pool no longer exists. Refresh the list",super_administrator_required:"Only super administrators can manage users",sign_in_required:"Sign in and try again",user_not_in_pool:"Your account does not belong to this user pool",user_disabled:"Your account is disabled",protected_administrator:"The initial super administrator cannot be demoted",cannot_demote_self:"You cannot demote your own super administrator role",role_change_conflict:"The role has changed. Close this dialog and refresh the list before retrying",cross_origin_request:"Change roles from the current Studio page"},gVe={title:hge,memberCount:pge,user:mge,role:gge,status:bge,lastLogin:yge,actions:vge,changeRole:xge,close:wge,save:Oge,saving:kge,cancel:Sge,back:Ege,pool:Cge,volcengineIdentity:Age,searchPlaceholder:Tge,search:_ge,filterRole:jge,allRoles:Nge,refresh:Rge,loading:Ige,updatedAt:Pge,saved:Dge,retry:Mge,you:Lge,initialAdministrator:$ge,protectedExplanation:Fge,effectiveAfterRefresh:Bge,roleConflict:Uge,noUsers:Qge,tryAnotherSearch:zge,poolEmpty:Vge,resultCount:Hge,previous:qge,next:Wge,neverLoggedIn:Kge,unknown:Gge,roles:Xge,descriptions:Yge,states:Zge,errors:Jge},bVe=Object.freeze(Object.defineProperty({__proto__:null,actions:vge,allRoles:Nge,back:Ege,cancel:Sge,changeRole:xge,close:wge,default:gVe,descriptions:Yge,effectiveAfterRefresh:Bge,errors:Jge,filterRole:jge,initialAdministrator:$ge,lastLogin:yge,loading:Ige,memberCount:pge,neverLoggedIn:Kge,next:Wge,noUsers:Qge,pool:Cge,poolEmpty:Vge,previous:qge,protectedExplanation:Fge,refresh:Rge,resultCount:Hge,retry:Mge,role:gge,roleConflict:Uge,roles:Xge,save:Oge,saved:Dge,saving:kge,search:_ge,searchPlaceholder:Tge,states:Zge,status:bge,title:hge,tryAnotherSearch:zge,unknown:Gge,updatedAt:Pge,user:mge,volcengineIdentity:Age,you:Lge},Symbol.toStringTag,{value:"Module"})),ebe="Website integration",tbe="Embed an AgentKit Runtime on your website as a floating chat window",nbe="Back to automations",ibe="Add website",rbe="Loading Runtime",sbe="Select Runtime",abe="Website domain",obe="For example, xxxx.com or localhost:5173",lbe="Generating",cbe="Generate token",ube="Added websites",dbe="{{count}} website",fbe="{{count}} websites",hbe="Loading website integrations",pbe="No website integrations yet",mbe="Select a Runtime and enter a website domain to generate a token",gbe="Embed instructions",bbe="Place this code before the closing body tag on your website",ybe="Copied",vbe="Copy code",xbe="Embed code will appear here after you add a website.",wbe="Delete the website integration for {{domain}}?",Obe={load:"Failed to load website integrations",create:"Failed to create website integration",delete:"Failed to delete website integration",noConversationalAgent:"No conversational Agent was found in this Runtime"},kbe={requestFailed:"Request failed ({{status}})",greeting:"Hello. How can I help?",sessionFailed:"Could not start a chat session",unauthorized:"This website is not authorized to start a chat",conversationFailed:"The chat request failed. Try again shortly.",open:"Open Agent chat",close:"Close Agent chat",panelLabel:"Agent chat panel",assistant:"Agent assistant",online:"Online"},yVe={title:ebe,description:tbe,backToAutomations:nbe,addWebsite:ibe,loadingRuntime:rbe,selectRuntime:sbe,websiteDomain:abe,domainPlaceholder:obe,generating:lbe,generateToken:cbe,addedWebsites:ube,websiteCount_one:dbe,websiteCount_other:fbe,loadingIntegrations:hbe,delete:"Delete",emptyTitle:pbe,emptyDescription:mbe,embedMethod:gbe,embedInstructions:bbe,copied:ybe,copyCode:vbe,embedHint:xbe,confirmDelete:wbe,errors:Obe,widget:kbe},vVe=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:ibe,addedWebsites:ube,backToAutomations:nbe,confirmDelete:wbe,copied:ybe,copyCode:vbe,default:yVe,description:tbe,domainPlaceholder:obe,embedHint:xbe,embedInstructions:bbe,embedMethod:gbe,emptyDescription:mbe,emptyTitle:pbe,errors:Obe,generateToken:cbe,generating:lbe,loadingIntegrations:hbe,loadingRuntime:rbe,selectRuntime:sbe,title:ebe,websiteCount_one:dbe,websiteCount_other:fbe,websiteDomain:abe,widget:kbe},Symbol.toStringTag,{value:"Module"})),Sbe={types:{all:"All types",document:"Documents",image:"Images",video:"Videos"},previewArtifact:"Preview {{name}}",moreActions:"More actions for {{name}}",actionMenu:"Actions for {{name}}",download:"Download",downloading:"Downloading",edit:"Edit details",delete:"Delete artifact",previewFailed:"Could not preview “{{name}}”: {{message}}",downloadStarted:"Download started for {{name}}",downloadFailed:"Could not download “{{name}}”: {{message}}",updated:"Updated {{name}}",deleted:"Deleted {{name}}",deleteFailed:"Could not delete “{{name}}”: {{message}}",typeFilter:"Artifact type",searchAria:"Search artifacts",searchPlaceholder:"Search artifacts or sessions",retry:"Retry",close:"Close",listAria:"Artifact list",loadFailed:"Could not load artifacts",loadDetailFallback:"Check the storage configuration and try again.",reload:"Reload",noMatch:"No matching artifacts",noArtifacts:"You do not have any artifacts yet",searchHint:"Try another search or artifact type",emptyHint:"Artifacts created in chats will appear here automatically",columns:{name:"Name",source:"Source",updatedAt:"Modified",actions:"Actions"},loadingMore:"Loading more artifacts",unknownTime:"Unknown time",preview:{close:"Close preview",meta:"{{type}} / Version {{version}}",loading:"Loading preview",alt:"Preview of {{name}}",loadFailed:"The preview could not be loaded. Try again later or download the file.",unsupported:"This format cannot be previewed online. Download the file to view it.",sourceAria:"Artifact source",agent:"Agent",session:"Session",tool:"Generated by",createdAt:"Created",fileSize:"File size",tags:"Tags",viewSession:"View session"},deleteDialog:{title:"Delete artifact?",description:"“{{name}}” will be permanently removed from the artifact library. The chat history will not be affected.",deleting:"Deleting",confirm:"Delete",close:"Close delete confirmation"},api:{withStatus:"{{message}} ({{status}})",listFailed:"Could not load the artifact library",syncFailed:"Could not sync chat artifacts",updateFailed:"Could not update the artifact",deleteFailed:"Could not delete the artifact",downloadFailed:"Could not download the artifact"}},Ebe={unknownSource:"Unknown source",unknownCreator:"Unknown creator"},Cbe={nameRequired:"Enter an artifact name",tooManyTags:"You can add up to {{max}} tags",tagTooLong:"Each tag can contain up to {{max}} characters",title:"Edit artifact details",subtitle:"The content file will not be modified",close:"Close edit dialog",name:"Name",description:"Description",descriptionPlaceholder:"Add its purpose, version, or usage notes",tags:"Tags",tagsPlaceholder:"Separate tags with commas, up to {{max}}",cancel:"Cancel",saving:"Saving",save:"Save"},Abe={change:{added:"Added",modified:"Modified",deleted:"Deleted"},noChanges:"There are no source changes between these versions",chooseFile:"Select a file on the left to view its code",compareTitle:"Compare versions",workspaceTitle:"Source workspace",projectFallback:"Agent project",switchTheme:"Switch source theme",switchThemeTitle:"Switch to {{theme}} theme",themes:{dark:"dark",light:"light"},closeWorkspace:"Close source workspace",close:"Close",changedFiles:"Changed files",projectFiles:"Project files",changes:"Changes",files:"Files",openFiles:"Open files",noFileSelected:"No file selected",comparisonDirection:"Comparison direction",before:"Before optimization",after:"After optimization",loadingEditor:"Loading editor…",changedFileCount_one:"{{count}} file changed",changedFileCount_other:"{{count}} files changed",fileCount_one:"{{count}} file",fileCount_other:"{{count}} files",lineCount_one:"{{count}} line · UTF-8",lineCount_other:"{{count}} lines · UTF-8",viewSource:"View source",viewSourceAria:"View and edit project source"},Tbe={nav:"Search",selectAgent:"Select an Agent",checkingCapabilities:"Checking Agent capabilities",notMounted:"This Agent does not have {{label}} mounted",sources:{session:"Sessions",web:"Web",knowledge:"Knowledge base",memory:"Long-term memory"},webDescription:"Search with the web_search tool",backendLocal:"Local",failed:"Search failed: {{message}}",placeholder:{selectAgent:"Select an Agent first",web:"Search the web",knowledge:"Search {{name}}",knowledgeFallback:"this Agent's knowledge base",memory:"Search {{name}}",memoryFallback:"this user's long-term memory",session:"Search this Agent's sessions"},sourceTypeAria:"Search source: {{label}}",notSelected:"Not selected",sourceType:"Search source",selectSource:"Select a search source",noAgentHint:"Select an Agent to search its sessions, the web, and mounted data sources.",loadingCapabilities:"Loading this Agent's search capabilities…",sourceUnavailable:"This Agent does not have this data source mounted",instructions:{web:"Enter keywords and press Enter or select the button to search with web_search.",knowledge:"Enter a question to search this Agent's knowledge base.",memory:"Enter a clue to search long-term memories saved across this user's sessions.",session:"Enter keywords and press Enter or select the button to search this Agent's sessions."},noResults:"No results found for “{{query}}”.",knowledgeFragment:"Knowledge excerpt {{index}}",memoryFragment:"Memory excerpt {{index}}"},_be={title:"Developer Resources",sections:{documentation:{title:"Related links",description:"Open development documentation and common AgentKit destinations"},bestPractices:{title:"Best practices",description:"Learn from practical development, debugging, and deployment guidance"},showcases:{title:"Showcases",description:"Explore applications built with AgentKit"}},links:{veadkDocs:"VeADK documentation",cliDocs:"AgentKit CLI documentation",platformDocs:"AgentKit platform documentation",console:"AgentKit console"},articles:{veadkDevelopment:{title:"Develop and deploy an Agent with VeADK",description:"Build an Agent with VeADK and deploy it to AgentKit Runtime."},cliDevelopment:{title:"Develop and deploy an Agent with AgentKit CLI",description:"Create a project, debug an Agent, and deploy it with AgentKit CLI."},coverAlt:"Cover image for {{title}}"},showcases:{researchAssistant:{title:"Multi-agent research assistant",description:"Specialized Agents work together to research, analyze, and summarize findings."},multimodalAnalysis:{title:"Multimodal content analysis",description:"Understand images, documents, and video in a single session."},customerService:{title:"Customer service workspace",description:"Combine knowledge retrieval and tool calls to handle complex support requests."},webSearch:{title:"Web search Agent",description:"Search current web content and organize it into traceable answers."},a2uiApp:{title:"A2UI interactive app",description:"Let an Agent generate interactive interfaces as it works through a task."},previewAlt:"Interface preview for {{title}}"}},jbe={title:"Library",untitledSession:"Untitled session",categoryAria:"Library categories",regionAria:"Region",tabs:{skills:"Skills",knowledge:"Knowledge",artifacts:"Artifacts"}},Nbe={title:"Manage Agents",subtitle:"Agents in AgentKit Runtime that you can manage",mainAgentOnly:"Only the main Agent is shown (control-plane information).",deleteConfirm:'Delete Agent "{{name}}"? Its Runtime will be permanently deleted.',regionFilterTitle:"Filter by region",regionFilterAria:"Region filter",regionAria:"Region",refresh:"Refresh",loading:"Loading…",empty:"You have not deployed any Agents.",connected:"Connected",connect:"Connect to this Agent",deleteRuntime:"Delete this Runtime",loadingDetail:"Loading details…",agentStructure:"Agent structure",secretHidden:"Sensitive value is never shown. Copy it with an authorized request.",revealSecret:"Sensitive value for {{key}}",copySecret:"Copy the value of {{key}}",copy:"Copy",copied:"Copied",copyFailed:"Copy failed",notConfigured:"Not configured",fields:{model:"Model",description:"Description",status:"Status details",project:"Project",version:"Version",resources:"Resources",memory:"Memory",tool:"Tool",knowledge:"Knowledge",mcpToolset:"MCP Toolset",updatedAt:"Updated"},resource:{memory:"Memory {{value}} MB",instances:"Instances {{min}}-{{max}}",concurrency:"Concurrency {{value}}"},environmentVariables:"Environment variables",unnamed:"(Unnamed)"},Rbe={mainAgent:"Main Agent",subAgent:"Sub-agent {{index}}",itemCount_one:"{{count}} item",itemCount_other:"{{count}} items",info:"Agent information",infoAndTopology:"Agent information and settings",loadingInfo:"Loading Agent information…",unnamedAgent:"Unnamed Agent",agentsMd:"AGENTS.md",tools:"Tools",toolList:"Tool list",studioTool:"Studio Tool",removeTool:"Remove tool {{name}}",remove:"Remove",notConfigured:"Not configured",addStudioTool:"Add Studio tools",addStudioToolHere:"Add Studio tools to this chat",skills:"Skills",skillList:"Skill list",addSkill:"Add Skill Space skills",addSkillHere:"Add Skill Space skills to this Session",skillMountNextTurn:"Mounted versions are frozen when the next Turn starts.",previewUnsupported:"Preview is not supported",sessionEnvironment:"Session environment",environment:"Environment",agentCanvas:"Agent canvas",topology:"Structure",nodeKinds:{agent:"Agent",sandbox:"Sandbox","worker-session":"Worker Session","skill-space":"Skill Space",skill:"Skill","studio-tool":"Studio Tool",mcp:"MCP",environment:"Environment",knowledge:"Knowledge","sub-agent":"Sub-agent"},nodeStatuses:{configured:"Configured",mounted:"Mounted",running:"Running",paused:"Paused"},viewCanvasFullscreen:"View Agent canvas in full screen",viewFullscreen:"View full screen",executionCanvas:"Agent execution canvas",fullscreenExecutionCanvas:"Full-screen Agent execution canvas",closeFullscreenCanvas:"Close full-screen canvas",close:"Close",capabilitiesSubtitle:"Capabilities and collaboration topology",closeInfo:"Close Agent information",infoUnavailable:"Agent information is temporarily unavailable.",refresh:"Refresh information",loadingSkills:"Loading bound skills…",sessionSkills:"Temporary session skills",noBoundSpace:"This agent has no bound Skill Space.",noBoundSkills:"The bound Skill Space has no skills.",loadFailed:"Could not load this information. Refresh to retry.",accessDenied:"You do not have permission to read this information.",documentUnsupported:"Upgrade the Runtime image to enable Studio to read AGENTS.md.",skillsUnsupported:"This Runtime does not provide Skill Space bindings.",skillsDegraded:"Skill information is incomplete. Refresh to retry.",documentEditHint:"Edit the latest version. Saving publishes a new version to this Skill Space and can affect other agents using it. Running sessions may need a cache refresh or a new session. Keep the frontmatter name unchanged.",documentLoading:"Loading SKILL.md…",documentWritable:"Editable",documentReadOnly:"Read only — this space or your permissions do not allow editing",documentLoadFailed:"Could not load SKILL.md. Refresh to retry.",documentSaveFailed:"Save was not confirmed. Your edits are preserved. Reopen to check the current version before retrying.",documentConflict:"A newer version exists. Copy your edits, then reopen the editor to avoid overwriting it.",discardDocument:"Discard unsaved changes?",keepEditing:"Keep editing",discardChanges:"Discard changes",saveDocument:"Save new version"},Ibe={mountFailed:"Could not mount the environment",closeDialog:"Close environment dialog",addTitle:"Add environments",description:"Choose the Sandbox environments this Agent can use in the current session",closeAdd:"Close Add environments",searchAria:"Search environments",searchPlaceholder:"Search environment names or capabilities",availableAria:"Available environments and workspaces",loading:"Loading available environments…",noMatch:"No matching environments or workspaces",workspaces:"Workspaces",reuseAll:"Use every available environment in this workspace",availableEnvironmentCount_one:"{{count}} available environment",availableEnvironmentCount_other:"{{count}} available environments",selectWorkspace:"Select workspace {{name}}",environments:"Environments",includedByWorkspaces:"Included by workspace {{names}}",nameSeparator:", ",selectEnvironment:"Select environment {{name}}",selectedWorkspaceCount_one:"{{count}} workspace selected",selectedWorkspaceCount_other:"{{count}} workspaces selected",coveredEnvironmentCount_one:"{{count}} environment covered",coveredEnvironmentCount_other:"{{count}} environments covered",selectionSummary:"{{workspaces}}, {{environments}}",cancel:"Cancel",mounting:"Mounting…",confirm:"Add selected",mountedAria:"Mounted environments",environmentCount_one:"{{count}} environment",environmentCount_other:"{{count}} environments",removeWorkspace:"Remove workspace {{name}}",remove:"Remove",removeEnvironment:"Remove environment {{name}}",add:"Add environments",addMore:"Add more environments",addForSession:"Add environments to this session",loadingAvailable:"Loading available environments…",empty:"No AIO Sandbox environments are available."},Pbe={loading:{searching:"Looking for an existing environment",creating:"Initializing environment",connecting:"Connecting to the environment"},initializationFailed:"AgentKit CLI environment initialization failed. Current status: {{status}}.",sessionExpired:"The AgentKit CLI session does not exist or has expired. Try again.",initializationTimeout:"AgentKit CLI environment initialization timed out. Try again later.",nonPersistent:"Non-persistent environment",recyclingHoursMinutes:"Environment reclaimed in {{hours}} hr {{minutes}} min",recyclingMinutes:"Environment reclaimed in {{minutes}} min",connectionError:`Could not connect to the Studio service because the server did not respond. Original error: {{message}}`,unavailable:"Connection unavailable",requestFailed:"AgentKit CLI request failed",retry:"Retry",terminalTitle:"AgentKit CLI terminal"},Dbe={labels:{coding:"Coding",get_city_weather:"City weather",get_location_weather:"Location weather",web_fetch:"Fetch web content",studio_write_artifact:"Save session artifact"},closeDialog:"Close dialog",title:"Add Studio tools",description:"Studio BFF runs these tools for {{agentName}} in the current session. No Runtime installation is required.",close:"Close Add Studio tools",searchAria:"Search Studio tools",searchPlaceholder:"Search by name or tool ID",availableAria:"Available Studio tools",loading:"Loading Studio tools…",noMatch:"No matching Studio tools",remove:"Remove",add:"Add"},Mbe={artifactLibrary:Sbe,resourceMetadata:Ebe,artifactEdit:Cbe,codeBrowser:Abe,search:Tbe,developerResources:_be,library:jbe,manageAgents:Nbe,agentTopology:Rbe,sessionEnvironment:Ibe,agentKitCli:Pbe,studioTools:Dbe},xVe=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:Pbe,agentTopology:Rbe,artifactEdit:Cbe,artifactLibrary:Sbe,codeBrowser:Abe,default:Mbe,developerResources:_be,library:jbe,manageAgents:Nbe,resourceMetadata:Ebe,search:Tbe,sessionEnvironment:Ibe,studioTools:Dbe},Symbol.toStringTag,{value:"Module"})),Lbe={requestFailed:"请求失败 ({{status}})",unknownError:"未知错误",contentTypeMissing:"Content-Type 缺失",response:"响应:{{response}}",fallbackWithDetail:"{{fallback}}:{{detail}}",fallbackWithHttpStatus:"{{fallback}}(HTTP {{status}})",nonJsonResponse:"{{fallback}}:服务端返回非 JSON 响应({{contentType}})"},$be={unconfigured:"管理员未配置 AgentKit Dev Sandbox,请配置后再使用",invalidSession:"AgentKit CLI 返回了无效的 Session。",loadCapabilitiesFailed:"无法读取 AgentKit CLI 配置。",invalidCapabilities:"AgentKit CLI 返回了无效的配置状态。",listSessionsFailed:"无法读取 AgentKit CLI Session。",invalidSessionList:"AgentKit CLI 返回了无效的 Session 列表。",createSessionFailed:"无法创建 AgentKit CLI Session。",openSessionFailed:"无法打开 AgentKit CLI Session。",openTerminalFailed:"无法打开 AgentKit CLI 终端。",invalidTerminalUrl:"AgentKit CLI 返回了无效的终端地址。"},Fbe={cnBeijing:"华北 2(北京)",cnShanghai:"华东 2(上海)"},Bbe={runtimeUnsupported:"该 Runtime 暂不支持连接,请确认服务已正常运行。"},Ube={autoConfigureFailed:"飞书机器人自动配置失败"},Qbe={actionFailed:"{{action}}失败",detail:"详细信息:{{detail}}",request:"请求:{{request}}"},zbe={persistentMemoryHint:"提示:会话已不存在。使用 in-memory 或 SQLite 短期记忆时,多实例、进程重启或滚动发布都可能导致会话丢失;建议改用基于数据库的持久化短期记忆存储。",unsupportedRouteHint:"提示:该 Runtime 未提供会话能力运行接口,可能是 Runtime 版本与当前 Studio 不兼容。",toolArgumentHint:"提示:模型生成的工具参数格式不完整,请重新发送一次。",resourceCollectionExpiredHint:"提示:本次资源清单已失效,请重新发送任务;系统会重新收集资源后再创建 Agent。",networkConfigurationHint:"提示:请稍后重试,查看 Runtime、模型或网关日志。",modelQuotaHint:"提示:模型当前触发了 TPM/RPM 配额限制,请稍后重试或提高模型配额。",rawResponseLabel:"原始响应:",copySecretFailed:"复制敏感值失败"},Vbe={httpStatus:"HTTP 状态码:{{status}}",errorCode:"错误码:{{code}}",cloudResponseBody:`云端响应正文: {{body}}`,loadFailedWithDetail:"读取实例日志失败:{{detail}}",invalidFormat:"读取实例日志失败:服务返回格式无效"},Hbe={untitledSession:"未命名会话",webUnavailable:"网络搜索接口未就绪(后端未启用 /web/search)。",webFailed:"网络搜索失败:{{message}}",webNotMounted:"当前 Agent 未挂载 web_search 工具。",knowledgeNotMounted:"该 Agent 未挂载知识库。",memoryNotMounted:"该 Agent 未挂载长期记忆。",knowledge:"知识库",longTermMemory:"长期记忆"},qbe={listSpacesFailed:"读取 Skill 空间失败",createSpaceFailed:"创建 Skill 空间失败",updateSpaceFailed:"更新 Skill 空间失败",deleteSpaceFailed:"删除 Skill 空间失败",uploadFailed:"上传 Skill 失败",validateFailed:"校验 Skill 失败",deleteFailed:"删除 Skill 失败",listFilesFailed:"读取 Skill 文件失败",downloadFailed:"下载 Skill 失败",sharedSpaceFailed:"共享空间加载失败",reservedSpaceName:"此名称由系统空间保留,请使用其他名称",reviewSpaceFailed:"待审核空间暂不可用",submitReviewFailed:"申请公开失败",listReviewsFailed:"加载审核申请失败",reviewFilesFailed:"加载提交文件失败",decideReviewFailed:"审批失败,请重试",listVersionsFailed:"无法加载技能版本",uploadVersionFailed:"上传技能新版本失败"},Wbe={truncatedData:"{{data}}…(已截断,共 {{count}} 个字符)",incompleteEvent:"SSE 流在事件完整返回前已结束。原始数据:{{data}}",invalidEventJson:"无法解析 SSE 事件中的 JSON。原始数据:{{data}}"},Kbe={loadConfigNetworkFailed:"无法加载登录配置,请检查网络后重试。",configServiceFailed:"登录配置服务异常(HTTP {{status}}),请稍后重试。",invalidConfigResponse:"登录配置服务返回了无法解析的响应,请稍后重试。",serviceNetworkFailed:"无法连接身份服务,请检查网络后重试。",invalidServiceResponse:"身份服务返回了无法解析的响应,请稍后重试。",serviceFailed:"身份服务异常(HTTP {{status}}),请稍后重试。"},Gbe={invalidToken:"GitHub Token 无效或没有仓库写入权限",notFound:"仓库、分支或文件不存在,或 Token 无权访问",rejectedCommit:"GitHub 拒绝了提交,请检查分支和文件状态",requestFailed:"GitHub 请求失败(HTTP {{status}})",networkFailed:"连接 GitHub 失败,请检查网络后重试",invalidRepositoryFormat:"GitHub Repo 格式应为 owner/repository",insecureRepositoryUrl:"仅支持安全的 github.com 仓库地址",unsafeProjectPath:"Agent 项目目录必须是仓库内的安全相对路径",tokenRequired:"GitHub Token 不能为空",invalidBaseBranch:"目标分支格式不正确",invalidPublishBranch:"发布分支格式不正确",noFiles:"没有需要提交的文件",missingBaseSha:"目标分支缺少有效 Git SHA",fileAlreadyExists:"目标仓库中已存在 {{path}},未覆盖现有文件",pathNotUpdatable:"目标路径 {{path}} 不是可更新的文件",invalidPullRequest:"GitHub 未返回有效的 Pull Request"},Xbe={loadCapabilitiesFailed:"加载视频模型能力失败",uploadAssetFailed:"上传{{fileName}}失败",enhancePromptFailed:"提示词优化失败",createTaskFailed:"创建视频生成任务失败",getTaskFailed:"查询视频生成任务失败",downloadFailed:"下载生成视频失败"},Ybe={listFailed:"加载网站集成失败",createFailed:"创建网站集成失败",deleteFailed:"删除网站集成失败"},Zbe={loadFailed:"读取知识库失败",htmlHidden:"[HTML 内容已隐藏]",redacted:"[已脱敏]",depthTruncated:"[内容过深,已截断]",circularReference:"[循环引用]",diagnosticsUnavailable:"[诊断信息无法显示]",statusCode:"状态码:{{status}}",errorCode:"错误码:{{code}}",requestId:"请求 ID:{{requestId}}",diagnostics:"诊断:{{diagnostics}}",detail:"详情:{{detail}}",signInRequired:"请先登录后再访问知识库",forbidden:"你没有权限操作这个知识库",notFound:"知识库或知识内容不存在",conflict:"知识库当前状态不允许执行此操作",requestFailed:"知识库请求失败 ({{status}})"},Jbe={invalidName:"名称须为 1~128 个字符,不能包含控制字符、不可见格式字符或 < >。",renameProjectFailed:"修改项目名称失败",renameVersionFailed:"修改版本名称失败",invalidNameUpdateResponse:"名称更新响应与请求不一致,请刷新后重试。",invalidSourceSnapshot:"源码快照的响应格式无效。",invalidProjectList:"项目列表的响应格式无效。",invalidProjectVersion:"项目版本的响应格式无效。",loadProjectsFailed:"无法读取已保存项目",loadVersionsFailed:"无法读取项目版本",deleteVersionFailed:"删除项目版本失败",invalidDeleteVersionResponse:"删除项目版本的响应格式无效。",loadProjectSourceFailed:"无法读取项目源码",loadSnapshotFailed:"无法读取源码快照",restoreSnapshotFailed:"无法恢复当前源码快照",downloadSourceFailed:"下载源码失败",downloadNotZip:"源码下载响应不是 ZIP 文件。",downloadSizeMismatch:"源码压缩包大小与发布记录不一致,请重试。"},eye={invalidFormat:"{{label}}格式错误。",validationSeparator:";",invalidAnalysisResult:"迁移分析结果格式错误。",invalidFrameworkCandidate:"框架候选格式错误。",invalidAnalysisEvidence:"分析证据格式错误。",invalidEntryCandidate:"入口候选格式错误。",invalidQuestion:"待确认问题格式错误。",invalidPendingInput:"分析问题无法读取",invalidTask:"迁移会话格式错误。",invalidAnalysisReference:"分析结果引用格式错误。",invalidSourcePersistence:"迁移源码保存状态格式错误。",invalidActivity:"迁移执行动态格式错误。",invalidActivityItem:"迁移执行动态项格式错误。",invalidActivityTool:"迁移执行工具项格式错误。",invalidActivityPlan:"迁移执行计划格式错误。",invalidActivityPlanItem:"迁移执行计划项格式错误。",invalidArtifact:"迁移产物格式错误。",invalidEnvironmentDefaults:"环境变量默认值格式错误。",invalidArtifactFile:"迁移产物文件格式错误。",invalidVerificationCheck:"迁移校验项格式错误。",requestValidationFailed:"请求参数校验失败:{{detail}}",gatewayError:"{{fallback}}(HTTP {{status}},Content-Type: {{contentType}})。请检查代理或网关配置。",nonJsonResponse:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}})。请检查代理或网关配置。",loadCapabilitiesFailed:"读取迁移能力失败",invalidCapabilities:"迁移能力格式错误。",invalidModelCapabilities:"迁移模型能力格式错误。",loadTasksFailed:"读取迁移会话失败",invalidTaskList:"迁移会话列表格式错误。",createTaskFailed:"创建迁移会话失败",uploadProjectFailed:"上传迁移项目失败",loadActivityFailed:"读取迁移执行动态失败",loadEventsFailed:"订阅迁移进度流失败",invalidEventsResponse:"迁移进度流返回了非法数据帧。",reconnecting:"连接已断开,正在重新连接迁移进度流…",startFailed:"启动迁移失败",submitAnswersFailed:"提交分析补充信息失败",submitInputFailed:"提交分析回答失败",stopFailed:"终止迁移失败",deleteTaskFailed:"删除迁移会话失败",loadArtifactFailed:"读取迁移产物失败",loadArtifactFileFailed:"读取迁移产物文件失败",downloadArtifactFailed:"下载迁移产物失败",evaluation:{datasetSaveFailed:"保存评测用例失败",datasetLoadFailed:"读取评测用例失败",statusLoadFailed:"读取评测状态失败",resumeFailed:"继续评测失败",retryFailed:"重新评测失败",reportLoadFailed:"读取评测报告失败",reportDownloadFailed:"下载评测报告失败"},labels:{analysisResult:"迁移分析结果",recommendation:"迁移建议",boundary:"迁移边界",frameworkCandidate:"框架候选",analysisEvidence:"分析证据",recommendedFramework:"推荐框架",entryCandidate:"入口候选",entryFramework:"入口框架",includeScope:"迁移包含范围",excludeScope:"迁移排除范围",assumptions:"分析假设",question:"待确认问题",analysisWarnings:"迁移警告",task:"迁移会话",artifactStatus:"迁移产物状态",analysisReference:"分析结果引用",confirmation:"迁移确认",confirmedFramework:"确认框架",error:"迁移错误",sourcePersistence:"迁移源码保存状态",activity:"迁移执行动态",activityItem:"迁移执行动态项",activityTool:"迁移执行工具项",activityPlanItem:"迁移执行计划项",artifact:"迁移产物",cli:"CLI 信息",migration:"迁移信息",startup:"启动信息",environment:"环境变量信息",verification:"校验信息",report:"迁移报告",archive:"产物归档",environmentDefaults:"环境变量默认值",requiredEnvironment:"必需环境变量",optionalEnvironment:"可选环境变量",artifactFile:"迁移产物文件",verificationCheck:"迁移校验项",artifactWarnings:"迁移产物警告",errorResponse:"错误响应",errorDetail:"错误详情",capabilities:"迁移能力",framework:"迁移框架",modelCapabilities:"迁移模型能力",taskList:"迁移会话列表",evaluationAsset:"评测资产",evaluation:"评测状态",evaluationCapabilities:"评测能力",evaluationDimension:"评测维度",evaluationCase:"评测用例",evaluationCriteria:"评测标准",evaluationMessage:"评测对话",evaluationDataset:"评测数据集",evaluationDimensionResult:"评测维度结果",evaluationEvidence:"评测证据",evaluationReport:"评测报告",evaluationSummary:"评测汇总",evaluationCaseResult:"评测用例结果",evaluationOutput:"评测输出",evaluationLimitations:"评测限制",pendingInput:"分析提问",pendingQuestion:"分析问题项",pendingOption:"分析问题选项"}},tye={status:{ready:"就绪",wakeable:"已休眠",creating:"创建中",starting:"启动中",pending:"等待中",running:"运行中",failed:"异常",stopped:"已停止",expired:"已过期",deleting:"删除中",deleted:"已删除",unknown:"未知状态"},developmentTimeout:"等待开发环境响应超时。任务可能仍在运行,请稍后重新进入当前会话查看状态。",developmentDisconnected:"与开发环境的连接已中断。任务可能仍在运行,请稍后重新进入当前会话查看状态。",developmentFailed:"开发任务未能继续,开发环境已保留。请在当前会话重试。",invalidStudioResponse:"{{fallback}} Studio 服务响应异常,请刷新后重试。",invalidSession:"AgentKit 沙箱返回了无效的 Session 信息。",invalidSnapshot:"AgentKit 沙箱返回了无效的 Snapshot 信息。",invalidSettings:"Sandbox 返回了无效设置。",invalidThreadSnapshot:"Sandbox 返回了无效 Thread 快照。",emptyConversationResponse:"沙箱对话服务未返回内容。",invalidConversationResponse:"沙箱对话服务返回了无法解析的响应。",conversationFailed:"沙箱对话失败,请稍后重试。",emptyReply:"沙箱未返回有效回复,请重试。",missingSession:"缺少要操作的 AgentKit Session。",listCodexFailed:"无法读取 Codex 智能体,请稍后重试。",invalidSessionList:"AgentKit 沙箱返回了无效的 Session 列表。",invalidSnapshotList:"AgentKit 沙箱返回了无效的 Snapshot 列表。",startFailed:"无法启动 AgentKit 沙箱,请稍后重试。",listAgentFailed:"无法读取 {{kind}} 智能体,请稍后重试。",invalidKindSessionList:"AgentKit 返回了无效的 {{kind}} Session 列表。",invalidKindSnapshotList:"AgentKit 返回了无效的 {{kind}} Snapshot 列表。",createAgentFailed:"无法创建 {{kind}} 智能体,请稍后重试。",missingSessionToOpen:"缺少要打开的 AgentKit Session。",openAgentFailed:"无法打开 {{kind}} 智能体。",invalidAgentHomeUrl:"{{kind}} 智能体返回了无效的主页面地址。",missingSessionForTerminal:"缺少要打开 Terminal 的 AgentKit Session。",openTerminalFailed:"无法打开 {{kind}} Terminal。",deleteAgentFailed:"无法删除 {{kind}} 智能体。",missingSnapshot:"未找到要唤醒的智能体。",resumeSnapshotFailed:"无法唤醒智能体,请稍后重试。",deleteSnapshotFailed:"无法删除智能体,请稍后重试。",missingSessionToConnect:"缺少要连接的 AgentKit Session。",connectCodexFailed:"无法连接 Codex 智能体,请稍后重试。",sessionNotReady:"AgentKit Session 尚未就绪,当前状态:{{status}}。",invalidMessage:"内置智能体会话缺少有效的消息内容。",interruptFailed:"无法停止当前任务。",getStatusFailed:"无法读取 Codex 状态。",getEndpointFailed:"无法读取 Sandbox Endpoint。",invalidEndpoint:"Sandbox 返回了无效 Endpoint。",createHandoffPairingFailed:"无法生成 Codex 云端接力配对码。",invalidHandoffPairing:"Studio 返回了无效的 Codex 云端接力配对码。",getHandoffStatusFailed:"无法读取端云接力状态。",invalidHandoffStatus:"Studio 返回了无效的端云接力状态。",listModelsFailed:"无法读取 Codex 模型列表。",invalidModelList:"Sandbox 返回了无效模型列表。",setModelFailed:"无法切换 Codex 模型。",invalidModel:"Sandbox 返回了无效模型。",listSkillsFailed:"无法读取 Codex Skills。",invalidSkillList:"Sandbox 返回了无效 Skill 列表。",listThreadsFailed:"无法读取 Codex Thread 列表。",invalidThreadList:"Sandbox 返回了无效 Thread 列表。",createThreadFailed:"无法创建新的 Codex Thread。",missingThread:"缺少要读取的 Codex Thread。",readThreadFailed:"无法读取 Codex 历史消息。",resumeThreadFailed:"无法恢复 Codex Thread。",forkThreadFailed:"无法分叉 Codex Thread。",archiveThreadFailed:"无法归档 Codex Thread。",invalidArchiveResult:"Sandbox 返回了无效归档结果。",deleteThreadFailed:"无法删除 Codex Thread。",invalidDeleteResult:"Sandbox 返回了无效删除结果。",compactThreadFailed:"无法压缩 Codex Thread。",getSettingsFailed:"无法读取 Codex 权限与工作空间。",updatePermissionsFailed:"无法更新 Codex 权限。",updateWorkspaceFailed:"无法更新 Codex 工作空间。",invalidWorkingDirectory:"Sandbox 返回了无效工作目录。",listDirectoriesFailed:"无法读取 Sandbox 目录。",invalidDirectoryList:"Sandbox 返回了无效目录列表。",resolveApprovalFailed:"无法提交 Codex 审批决定。",uploadFileFailed:"无法上传文件到 Sandbox。",invalidUploadResult:"Sandbox 返回了无效上传结果。",disconnectCodexFailed:"无法断开 Codex 智能体连接。",deleteCodexFailed:"无法删除 Codex 智能体。",openSandboxTerminalFailed:"无法打开 Sandbox Terminal。",openSandboxBrowserFailed:"无法打开 Sandbox Browser。",toolLabel:"Sandbox 工具",invalidToolUrl:"{{label}} 返回了无效地址。",unsafeToolUrl:"{{label}} 返回了不安全的地址。"},nye={invalidSandboxVersion:"沙箱版本响应格式无效",loadSandboxVersionsFailed:"查询沙箱版本失败",updateSandboxFailed:"更新 Sandbox 失败",invalidSandboxUpdate:"沙箱更新响应格式无效",errorWithDetailAndRawResponse:`{{context}} {{detail}} @@ -52,7 +52,7 @@ Original error: {{message}}`,unavailable:"Connection unavailable",requestFailed: Studio:{{studioUrl}} 配对码:{{pairingCode}}`,installPrompt:`请安装 AgentKit Studio Plugin。请直接执行以下安装命令,不要让我手动打开终端。 安装命令:{{command}}`,title:"接力到云端继续执行",description:"按顺序复制两段提示词,Codex 会通过插件将您的本地任务接力到云端",closeAria:"关闭本地迁移引导",installTitle:"安装插件",installDescription:"首次使用时,请选择一种安装方式。",copied:"已复制",copyInstallPrompt:"复制安装提示词",copyInstallCommand:"复制安装命令",installMethodAria:"插件安装方式",conversationInstall:"与 Codex 对话安装",terminalInstall:"从终端安装",taskTitle:"任务接力",taskDescription:"插件安装完成后复制,Codex 会迁移当前项目并继续执行任务。",copyHandoffPrompt:"复制接力提示词",generatingPairing:"正在生成新的配对码",pairingExpired:"配对码已过期",pairingRemaining:"配对码有效期剩余 {{countdown}}",refreshing:"刷新中",refreshPairing:"刷新配对码",pairingLoading:"正在生成配对码",pairingUnavailable:"配对码尚未生成。",statusAria:"端云接力状态",statusTitle:"接力状态",requestReceivedNamed:"已收到“{{name}}”的端云接力请求",requestReceivedCurrent:"已收到当前项目的端云接力请求",requestHelp:"复制接力提示词后,Codex 的请求会显示在这里。",entering:"正在进入",enterCodex:"进入 Codex",clipboardUnsupported:"当前浏览器不支持写入剪贴板。",steps:{request:"等待端侧请求",session:"创建云端 Session",restore:"恢复项目",continue:"发送续跑任务"},status:{issued:"等待请求",creating:"正在创建 Session",sessionCreated:"正在迁移项目",continuing:"正在启动云端任务",running:"云端执行中",completed:"接力完成",failed:"接力失败"}},Rwe={model:{description:"显示或切换当前对话模型",keywords:"模型 switch"},models:{description:"列出 app-server 可用模型",keywords:"模型列表 list"},skill:{description:"浏览并调用当前工作区可用的 Skill",keywords:"技能 workflow"},skills:{description:"浏览并调用当前工作区可用的 Skills",keywords:"技能列表 workflow list"},new:{description:"开始一个新对话",keywords:"新建 对话"},resume:{description:"打开历史会话或恢复指定 Thread",keywords:"历史 恢复 session"},fork:{description:"从当前上下文分叉一个新对话",keywords:"分叉 branch"},compact:{description:"压缩当前对话上下文",keywords:"压缩 上下文"},archive:{description:"归档当前对话并新建对话",keywords:"归档 关闭"},status:{description:"显示当前连接、Thread、模型与 Token 状态",keywords:"状态 连接 token"},clear:{description:"清空当前视图并开始新对话",keywords:"清空 重置"},help:{description:"显示 Sandbox 支持的快捷命令",keywords:"帮助 命令"},currentModel:"当前模型",availableModel:"可用模型",workspace:"工作空间",notSet:"未设置",modelLabel:"模型",statusLabel:"状态",running:"运行中",idle:"空闲",totalTokens:"累计 Token",contextWindow:"上下文窗口",imageFallback:"图片",unknown:"未知快捷命令:{{command}}。输入 /help 查看可用命令。",automaticSkills:"智能开发模式会自动使用开发能力,无需手动选择 Skill。",activity:{new:"已新建 Codex 对话",resumed:"已恢复 Codex 对话",deleted:"已删除 Codex 历史会话",modelChanged:"已切换 Codex 模型",availableModels:"Codex 可用模型",noModels:"当前没有可用模型",forked:"已分叉 Codex 对话",compacting:"已开始压缩当前 Codex 对话",archived:"已归档 Codex 对话",status:"Codex 当前状态",help:"Sandbox 支持的 Codex 快捷命令"}},Iwe={label:"智能构建任务",queued:"构建任务已排队",running:"构建任务正在后台运行",recovering:"正在恢复构建任务",waiting_user:"构建任务需要继续处理",stopping:"正在停止构建任务",succeeded:"构建任务已完成",cancelled:"构建任务已停止",failed:"构建任务未完成",open:"返回任务",hide:"隐藏任务通知",reconnecting:"正在重新连接任务服务,已有任务继续保留。"},Pwe={common:xwe,tool:wwe,threads:Owe,permissions:kwe,workspace:Swe,approval:Ewe,composer:Cwe,launch:Awe,session:Twe,agentDetails:_we,agentWorkspace:jwe,handoff:Nwe,commands:Rwe,taskNotice:Iwe},UVe=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:_we,agentWorkspace:jwe,approval:Ewe,commands:Rwe,common:xwe,composer:Cwe,default:Pwe,handoff:Nwe,launch:Awe,permissions:kwe,session:Twe,taskNotice:Iwe,threads:Owe,tool:wwe,workspace:Swe},Symbol.toStringTag,{value:"Module"})),Dwe={retry:"重试",signInToContinue:"登录以继续使用",signInWith:"使用 {{provider}} 登录",enterUsername:"输入一个用户名即可开始",usernamePlaceholder:"用户名(字母 + 数字,最多 16 位)",enter:"进入",usernameInvalid:"只能包含大小写字母和数字,最多 16 位。",identityProvider:{volcengine:"火山引擎 Identity",byteplus:"BytePlus Identity"},powered:{volcengine:"火山引擎 AgentKit 提供企业级 Agent 解决方案",byteplus:"BytePlus AgentKit 提供企业级 Agent 解决方案"},legalPrefix:"继续即表示你已阅读并同意 AgentKit",terms:"产品和服务条款",copyright:"© {{year}} VeADK。保留所有权利。"},Mwe={title:"登录状态已过期",description:"当前编辑内容会保留。重新登录后,刚才的操作将自动继续。",waiting:"等待登录完成…",signInAgain:"重新登录"},Lwe={breadcrumbs:"面包屑",selectAgent:"选择 Agent",switchAgent:"切换智能体"},$we={cancel:"取消",close:"关闭确认框"},QVe={login:Dwe,authExpired:Mwe,navbar:Lwe,confirm:$we},zVe=Object.freeze(Object.defineProperty({__proto__:null,authExpired:Mwe,confirm:$we,default:QVe,login:Dwe,navbar:Lwe},Symbol.toStringTag,{value:"Module"})),Fwe={defaultUser:"用户",shortcuts:"快捷入口",tryCli:"体验 AgentKit CLI",developerResources:"开发者资源",systemInfo:"系统信息",language:"语言",issueFeedback:"问题反馈",logout:"退出登录",roles:{admin:"管理员",developer:"开发者",user:"普通用户",super_admin:"超级管理员"}},Bwe={home:"返回首页",expand:"展开侧边栏",collapse:"收起侧边栏",label:"主导航",newChat:"新会话",agents:"智能体",workspaces:"工作区",library:"资源库",cronjobs:"定时任务",automations:"自动化",users:"用户管理",administration:"管控",reviewCenter:"审核中心"},Uwe={title:"历史会话",newConversation:"新会话",create:"新建会话",loading:"正在加载历史会话…",empty:"暂无会话",current:"当前",manage:"管理历史会话:{{title}}",more:"更多",delete:"删除",loadingMore:"加载中…",loadMore:"加载更多",evaluatingTitle:"正在自动评测",evaluating:"评测中",generating:"正在生成"},VVe={account:Fwe,navigation:Bwe,history:Uwe},HVe=Object.freeze(Object.defineProperty({__proto__:null,account:Fwe,default:VVe,history:Uwe,navigation:Bwe},Symbol.toStringTag,{value:"Module"})),Qwe={placeholder:"请选择",collapseOptions:"收起模型选项",expandOptions:"展开模型选项",noOptions:"暂无可用选项",noMatches:"没有匹配项,可直接使用当前模型 ID"},zwe={unsupportedActivity:"不支持的 Skill 对话活动",ariaLabel:"Skill 生成对话"},Vwe={code:"错误码:{{code}}",type:"错误类型:{{type}}",representation:"异常表示:{{value}}",rawResponse:`服务端原始响应: -{{value}}`,original:"原始错误:{{message}}",details:"详细信息"},Hwe={ariaLabel:"Skill 文件树",viewSource:"查看源码",viewPreview:"查看预览",download:"下载",binaryFile:"二进制文件",bytes:"{{value}} 字节",binaryDescription:"当前接口仅返回文件元数据,可单独下载原文件。",metadata:"Skill 元数据",noFiles:"暂无文件"},qwe={close:"关闭",name:"名称",region:"地域",optionalDescription:"描述(可选)",cancel:"取消",create:"创建",creating:"创建中…",save:"保存",saving:"保存中…",upload:"上传",uploading:"上传中…",createSpaceTitle:"新建 Skill 空间",editSpaceTitle:"编辑 Skill 空间",uploadTitle:"上传到 {{name}}",createSpaceFailed:"创建 Skill 空间失败",updateSpaceFailed:"更新 Skill 空间失败",archiveValidationFailed:"Skill ZIP 格式校验失败",uploadFailed:"上传 Skill 失败",dropzone:"拖拽 Skill ZIP 到这里",chooseLocalFile:"或点击选择本地文件",archiveHelp:"ZIP 根目录需要包含 SKILL.md,也可以只包含一层包装目录。选择后仅检查格式,不会自动上传。",validating:"正在检查文件格式…",validationPassed:"格式检查通过:{{name}},共 {{count}} 个文件"},Wwe={styles:{concise:"简洁实用",strict:"严谨稳健",tutorial:"教程友好",automation:"自动化优先",custom:"自定义",customFallback:"自定义风格"},stages:{preparing:"正在准备 Dev Sandbox",ready:"Skill 已生成并通过格式校验",failed:"生成失败",cancelled:"已停止",validating:"正在校验 Skill 格式",packaging:"正在整理文件",generating:"正在生成 Skill",repairingAgain:"正在再次修复",autoRepairing:"正在自动修复({{attempt}}/{{max}})"},validation:{fallback:"Skill 格式校验未通过",repairInstruction:"只修复下面列出的 Skill 格式错误,不要改变原有用途和内容范围。",recheckInstruction:"修复后重新检查目录结构、SKILL.md frontmatter 和所有文本文件。",nameTooLong:"Skill 名称不能超过 64 个字符",invalidName:"Skill 名称只能包含小写字母、数字和连字符",modelTooLong:"模型 ID 不能超过 128 个字符",invalidModel:"模型 ID 只能包含字母、数字、点、下划线、连字符、斜杠和冒号"},errors:{loadCapability:"读取 Dev Sandbox 配置失败",autoRepair:"自动修复格式错误失败",pollCandidate:"读取候选方案状态失败,正在重试",createCandidate:"创建候选方案失败",refine:"继续调整失败",repairAgain:"再次修复格式错误失败",selectSpace:"请选择上传的 Skill Space",unsupportedRegion:"当前 Skill 地域不受支持",upload:"上传 Skill 失败",download:"下载失败"},sessionMax:"Session 最长保留 1 小时",remaining:"剩余 {{minutes}}:{{seconds}}",unnamedSpace:"未命名 Skill Space",leaveConfirmation:"离开后将停止并释放正在运行的 Dev Sandbox,确定离开吗?",createTitle:"创建技能",optimizeTitle:"优化 {{name}}",skillFallback:"技能",back:"返回技能空间",home:"主页技能生成",basicInfo:"基本信息",goal:"目标",createIntentPlaceholder:"描述希望这个 Skill 完成什么任务",optimizeIntentPlaceholder:"描述希望如何优化当前 Skill",skillName:"Skill 名称",autoNamePlaceholder:"留空时自动生成",nameHelp:"仅支持小写字母、数字和连字符;留空时自动生成。",createPlans:"生成方案",optimizePlans:"优化方案",createPlansDescription:"按不同方案并行生成多个技能,您可以选择最佳结果",optimizePlansDescription:"按不同方案并行优化当前技能,您可以选择最佳结果",plan:"方案 {{count}}",remove:"移除",model:"模型",modelPlaceholder:"选择或输入模型 ID",style:"风格",customStyle:"自定义风格",customStylePlaceholder:"描述表达方式、严谨程度或输出偏好",addConfiguration:"添加配置",notConfigured:"管理员未配置",generate:"生成",candidates:"候选方案",progress:"进度",retryCandidate:"重试此方案",formatValidationFailed:"格式校验未通过",repairAgain:"再次修复",files:"文件",downloadZip:"下载 ZIP",loadingFiles:"正在读取文件…",filesPending:"生成过程中会在这里显示完整文件树",uploadToSpace:"上传到 Skill Space",loadingSpaces:"正在加载 Skill Space",selectSpace:"选择 Skill Space",continuePlaceholder:"继续调整这个候选方案",continue:"继续调整",uploading:"上传中…",overwrite:"覆盖原 Skill",uploadToSelectedSpace:"上传到 Skill Space",uploadToCurrentSpace:"上传到当前空间",allCandidatesFailed:"所有方案均创建失败,可分别重试。"},Kwe={invalidFormat:"{{label}}格式错误。",recoveryStatus:"Skill 恢复点状态",errorResponse:"错误响应",errorDetails:"错误详情",missingContentType:"Content-Type 缺失",gatewayError:"{{fallback}}(HTTP {{status}},Content-Type: {{contentType}})。请检查代理或网关配置。",nonJson:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}},Content-Type: {{contentType}}),请检查代理或网关配置。",activity:"Skill 会话活动",invalidActivity:"Skill 会话活动格式错误。",invalidToolActivity:"Skill 工具活动格式错误。",invalidTextActivity:"Skill 文本活动格式错误。",publication:"Skill 发布结果",task:"Skill 会话",file:"Skill 文件",unknownTaskState:"Skill 会话状态无法识别。",capability:"Skill 工作台能力",loadCapability:"读取 Skill 工作台能力失败",prepareTask:"准备 Skill 会话失败",taskReference:"Skill 会话引用",startOptimization:"开始优化 Skill 失败",startTask:"开始 Skill 会话失败",taskSummary:"Skill 会话摘要",taskList:"Skill 会话列表",loadTaskList:"读取 Skill 会话列表失败",invalidTaskList:"Skill 会话列表格式错误。",loadTask:"读取 Skill 会话失败",artifact:"Skill 产物",artifactFile:"Skill 产物文件",loadArtifact:"读取 Skill 产物失败",refine:"继续调整 Skill 失败",stop:"停止当前 Skill 任务失败",publish:"发布 Skill 失败",nonNdjson:"发布 Skill 失败:服务端返回了非 NDJSON 响应。",missingStream:"发布 Skill 失败:服务端没有返回进度流。",publishProgress:"发布进度",invalidPublishProgress:"发布进度格式错误。",publishError:"发布错误",unknownPublishEvent:"未知的发布进度事件。",publishResult:"发布结果",streamEnded:"发布进度流提前结束,无法确认发布结果。请刷新技能中心确认状态。",deleteTask:"删除 Skill 会话失败",download:"下载 Skill 失败"},Gwe={configSelect:Qwe,conversation:zwe,errorDetails:Vwe,fileTree:Hwe,management:qwe,generation:Wwe,api:Kwe},qVe=Object.freeze(Object.defineProperty({__proto__:null,api:Kwe,configSelect:Qwe,conversation:zwe,default:Gwe,errorDetails:Vwe,fileTree:Hwe,generation:Wwe,management:qwe},Symbol.toStringTag,{value:"Module"})),Xwe={back:"返回上一页",reload:"重新加载",notConfigured:"未配置",name:"名称",description:"描述",delete:"删除",save:"保存",saving:"保存中",add:"添加",manage:"管理",environment:"环境",noDescription:"暂无描述",refresh:"刷新",close:"关闭",retry:"重试",loading:"加载中…",previousPage:"上一页",nextPage:"下一页",edit:"编辑",all:"全部",search:"搜索",cancel:"取消",view:"查看",viewDetails:"查看详情",deleting:"删除中…",create:"创建",creating:"创建中",adding:"添加中",generating:"生成中",uploading:"上传中",preview:"预览",loadFailed:"加载失败",select:"选择",collapse:"收起",expand:"展开",none:"无"},Ywe={ariaLabel:"AgentKit 快速入口",closeAriaLabel:"关闭 AgentKit 欢迎卡片",title:"欢迎使用 AgentKit",description:"通过 AgentKit 平台快速构建与托管您的企业级智能体",docsAriaLabel:"打开 AgentKit 文档,在新窗口打开",docs:"文档",consoleAriaLabel:"打开 AgentKit 控制台,在新窗口打开",console:"控制台"},Zwe={checkUpdates:"检查更新",checkingVersions:"正在检查版本…",versionCheckError:"查询沙箱版本失败,请检查凭据、区域及接口权限后重试",sandboxUpdateError:"Sandbox 更新失败,请刷新检查实际状态后重试",modelEnvRepairUnavailable:"无法补齐模型环境变量,请检查 CODEX_API_KEY 和 CODEX_BASE_URL",updateSandbox:"更新{{variant}}{{name}}",updatingSandbox:"更新中",title:"系统信息",description:"查看当前 Studio 版本及关联的基础资源",general:"通用",currentVersion:"当前版本",storage:"存储",loadingStorage:"正在加载存储信息",tosAddress:"TOS 地址",openTosConsole:"在云控制台中打开 TOS 存储桶",environmentBuild:"环境构建",loadingEnvironmentResources:"正在加载环境构建资源",environmentResourcesError:"环境构建资源加载失败,请检查云凭据后重试。",codePipelineWorkspace:"CodePipeline 工作空间",codePipelinePipeline:"CodePipeline 流水线",openCodePipelineWorkspace:"在云控制台中打开 CodePipeline Workspace",createdOnFirstBuild:"首次构建时自动创建",containerRegistryRepository:"Container Registry 仓库",openContainerRegistryRepository:"在云控制台中打开 Container Registry 仓库",sandboxInfo:"沙箱信息",loadingSandboxInfo:"正在加载沙箱信息",sandboxInfoError:"沙箱信息加载失败,请重试。",snapshot:"快照版",snapshotWithSpace:"快照版 ",openToolConsole:"在云控制台中打开{{name}}",updateModelEnv:"更新{{variant}}{{name}}模型环境变量",modelEnvUpdated:"已更新",modelEnvAlreadyCurrent:"无需更新",userPool:"用户池",loadingUserPool:"正在加载用户池",userPoolError:"用户池加载失败,请重试。",modelEnvUpdateError:"模型环境变量更新失败,请重试。",openUserPoolConsole:"在云控制台中打开用户池{{name}}",unnamedUserPool:"未命名用户池",id:"ID",domain:"域名",region:"区域",noLocalUserPool:"本地模式未配置用户池",noUserPool:"当前 Studio 未配置用户池"},Jwe={workspace:"Agent 工作区",library:"Agent 库",evaluation:"评测",agentList:"Agent 列表",agentDetails:"Agent 详情",newAgent:"新建 Agent",loading:"加载中…",loadingCloudAgents:"正在加载云端 Agent…",noAgentSelected:"请选择一个 Agent",local:"本地",remote:"云端",localAgent:"本地 Agent",remoteAgent:"云端 Agent",agentCount:"{{count}} 个 Agent",agentCountLabel:"Agent 数量",details:"详情",chat:"对话",update:"更新",backToAgentList:"返回 Agent 列表",loadingAgent:"正在加载 Agent",loadingAgentDescription:"正在读取 Agent 配置和 Runtime 信息。",loadingAgentInfo:"正在加载 Agent 信息…",detailLoadFailed:"无法加载 Agent 详情",detailLoadFailedDescription:"请检查 Runtime 状态后重试。",partialInfoUnavailable:"部分信息暂时不可用",upgradeRuntimeForDetails:"请升级 Runtime 以查看完整 Agent 信息。",basicInfo:"基本信息",usageOverview:"使用概览",sections:{basic:"基本信息",profileConfig:"Profile 配置",sessionConfig:"会话配置",usage:"使用概览",diagnostics:"诊断",evaluations:"评测",optimizations:"优化建议",integrations:"集成",versions:"版本",channels:"消息渠道"},evaluationGroup:"评测组",optimizations:"优化建议",optimizationsDescription:"根据评测结果查看可执行的优化建议。",integrations:"集成",githubVersions:"GitHub 版本",githubVersionsDescription:"查看持续交付产生的版本并创建回退 PR。",currentVersionOnly:"当前未启用 GitHub 持续交付,仅展示当前生产版本。",loadingVersions:"正在加载版本…",noVersion:"暂无版本记录",prLink:"Pull Request",viewPr:"查看 PR",author:"提交人",publishStatus:"发布状态",viewRelease:"查看发布记录",rollbackToVersion:"回退到此版本",rollingBack:"正在创建回退…",rollbackEvent:"回退事件",sourceMergedRuntimeStill:"最新源码已合并,但 Runtime 仍处于",currentProductionVersionHint:";当前生产版本保持不变。",usageSummary:"使用统计",totalCalls:"总调用次数",userCount:"用户数",userDetails:"用户明细",usageUserList:"Agent 使用用户列表",user:"用户",callCount:"调用次数",lastUsed:"最近使用",unknownUser:"未知用户",loadingUsage:"正在加载使用数据…",refreshing:"刷新中…",noUsage:"暂无使用记录",usageUnavailable:"当前 Agent 暂无可用的使用统计。",usagePagination:"使用记录分页",pageOf:"第 {{page}} / {{total}} 页",notProvided:"暂未提供",integrationMethods:"集成方式",integrationDescription:"通过 Runtime API 或 A2A 协议集成当前 Agent。",integrationProtocol:"集成协议",runtimeStatus:"Runtime 状态",executionFlow:"执行流程",probingIntegration:"正在检测集成能力",probingIntegrationDescription:"正在读取可用端点和鉴权配置。",configurationStatus:"配置状态",discoveryEndpoint:"发现端点",invocationEndpoint:"调用端点",invocationUrl:"调用地址",authentication:"鉴权方式",networkAccess:"网络访问",notAvailable:"暂无",noAuthentication:"无需鉴权",noApiKeyRequired:"无需 API Key",usesOauthJwt:"使用 OAuth / JWT",showApiKey:"显示 API Key",hideApiKey:"隐藏 API Key",pythonExample:"Python 示例",deploymentConfig:"部署配置",deploymentConfigDescription:"确认实例和运行配置后更新 Runtime。",deploymentRegion:"部署区域",mpaControlPlane:"MPA 控制面",loadingMpaAgentView:"正在读取 MPA Runtime 绑定…",mpaRuntimeBound:"该 MPA Agent 已绑定唯一 Runtime,可继续管理。",mpaRuntimeMissing:"当前 Agent 没有可见的 MPA Runtime 绑定。",mpaRuntimeBindingAmbiguous:"多个 MPA Runtime 匹配当前 Agent,请先修复绑定后再修改。",mpaRuntimeOrphan:"Runtime 存在,但其中没有当前 MPA Profile。",mpaRuntimeLegacyAuthUnsupported:"该 Runtime 使用旧版 MPA 镜像,仍要求 X-Jwt-Token。请先更新到当前 AgentKit 兼容镜像,再管理 Profile 或 Session 配置。",profileConfig:"Profile 配置",profileConfigTitle:"Profile 配置",profileConfigDescription:"查看并应用 Agent 级 MPA Profile。Profile 是 Runtime 的长期默认配置,新会话默认继承它。",profileStatus:"Profile 状态",profileApplied:"已应用",profileNotApplied:"未应用",profileNotAppliedDescription:"当前 Runtime 可运行,但尚未保存为 Studio 可管理的 Profile。应用后会生成 Profile revision。",applyProfile:"应用 Profile",reapplyProfile:"重新应用 Profile",editProfile:"编辑 Profile",profileApplying:"应用中…",profileAppliedNotice:"Profile 已应用,当前 revision 为 {{revision}}。",profileApplyIncomplete:"Profile 应用未完成,请查看当前操作状态后重试。",profileApplyFailed:"Profile 应用失败。",profilePrompt:"系统提示词",profileResources:"资源配置",profileResourceSummary:"{{tools}} 个工具 · {{skills}} 个 Skill · {{mcp}} 个 MCP 服务",sessionConfigTitle:"会话配置",sessionConfigDescription:"查看和调整当前 MPA Session 的执行配置。变更只对下一轮对话生效。",loadingSessionConfig:"正在加载会话配置…",sessionConfigNoAgent:"请选择一个 MPA Agent 后再管理会话配置。",sessionConfigNonMpa:"会话配置仅适用于 MPA Agent。",sessionConfigNoSession:"请先打开这个 MPA Agent 的对话,再修改会话配置。",sessionConfigDifferentRuntime:"请先切回这个 MPA Agent 的当前对话,再修改会话配置。",sessionConfigSaved:"会话配置已更新,下一轮对话将使用新 revision。",sessionConfigStale:"该 Session 已被其他位置修改,已展示最新配置,请确认后再保存。",sessionConfigRevision:"配置 revision",sessionProfileRevision:"Session Profile revision",latestProfileRevision:"最新 Profile revision",sessionProfileUpgradeAvailable:"检测到新的 Profile revision:v{{current}} → v{{target}}。",upgradeSessionProfile:"升级 Session Profile",sessionProfileUpgrading:"升级中…",sessionProfileUpgraded:"Session Profile 已升级,下一轮对话将使用新 revision。",sessionProfileUpgradeFailed:"Session Profile 升级失败。",sessionModelOverride:"模型覆盖",modelId:"模型 ID",inheritProfileDefault:"继承 Profile 默认值",sessionMcpServers:"MCP 服务",mcpServerCount:"已选择 {{count}} 个",clearSessionMcp:"清空 MCP 服务",mpaDiagnosticsTitle:"Runtime 诊断",mpaDiagnosticsDescription:"查看最近的 Runtime Console 运行记录,以及 Agent、Profile、Turn、task 和 worker 关联。",loadingMpaDiagnostics:"正在加载 Runtime 诊断…",noMpaDiagnostics:"当前 Session 暂无 Runtime 诊断运行记录。",latestRun:"最近运行",traceCorrelation:"Trace 关联",traceCorrelationDescription:"Runtime Console 为本次 invocation 返回的稳定标识。",traceSteps:"Trace 步骤",traceStepsDescription:"当前 invocation 最近的有界 Runtime Console 步骤。",mpaInstanceId:"MPA 实例",turnId:"Turn ID",taskId:"Task ID",workerKind:"Worker 类型",workerSession:"Worker Session",workerTurn:"Worker Turn",workerProfile:"Worker Profile",workerProfileVersion:"Worker Profile 版本",step:"步骤",stepCount:"步骤数",duration:"耗时",noTraceSteps:"本次 invocation 暂无 trace 步骤。",executionConfigMode:{replace:"Session 覆盖",clear:"本 Session 已清空",inherit:"使用 Profile 默认值"},concurrency:"并发数",selectedOptimizations:"已选优化项",selectedOptimizationsDescription:"这些优化会应用到本次更新。",optimizationProfile:"优化方案",updatePending:"等待更新",updatingDeployment:"正在更新部署",restoringUpdateConfig:"正在恢复更新配置…",updateConfigUnavailable:"无法读取更新配置",legacyConfigMissing:"旧版本 Runtime 缺少可恢复的配置,请重新创建。",deploymentFailed:"部署失败",continueEditing:"继续编辑",loadingOptimizations:"正在加载优化建议…",noOptimizations:"暂无优化建议",fixPriority:"优先级",suggestedModule:"建议模块",suggestionAndReason:"建议与原因",priority:{high:"高",medium:"中",low:"低"},modules:{agentStructure:"Agent 结构",prompt:"提示词",tool:"工具",knowledge:"知识库",memory:"记忆",workflow:"工作流",other:"其他"},evaluationGroupList:"评测组列表",newEvaluationGroup:"新建评测组",newEvaluationGroupName:"新评测组 {{count}}",searchEvaluationGroups:"搜索评测组",noMatchingEvaluationGroups:"没有匹配的评测组",noEvaluationGroupSelected:"请选择一个评测组",groupStats:"{{agents}} 个 Agent · {{runs}} 次运行",evaluationGroupDetails:"评测组详情",evaluationGroupStats:"{{agents}} 个 Agent · {{caseSet}} · {{runs}} 次运行",startEvaluation:"开始评测",evaluationConfig:"评测配置",historyResults:"历史结果",participatingAgents:"参与 Agent",selectedCount:"已选择 {{count}} 个",evaluationResources:"评测资源",evaluationSet:"评测集",evaluator:"评估器",caseCount:"{{count}} 条案例",evaluationMetrics:"评测指标",selectedMetricCount:"已选择 {{count}} 项",historyDescription:"查看每次评测的分数和运行状态。",noHistory:"暂无评测历史",noHistoryDescription:"运行一次评测后,结果会显示在这里。",evaluationRun:"第 {{index}} 次评测",evaluationRunMeta:"{{time}} · {{agents}} 个 Agent",overallScore:"综合分",completed:"已完成",evaluationDefaults:{coreRegression:"核心能力回归",safetyCheck:"安全与幻觉检查",coreSet:"核心回归集",safetySet:"安全边界集",toolSet:"工具调用集",qualityEvaluator:"综合质量评估器",factualEvaluator:"事实一致性评估器",toolEvaluator:"工具调用评估器",responseQuality:"回答质量",factualAccuracy:"事实准确性",toolUse:"工具调用",responseEfficiency:"响应效率",todayTime:"今天 10:32",yesterdayTime:"昨天 16:08",julyTime:"7 月 25 日 14:20",justNow:"刚刚"},defaultCases:{agentName:"示例 Agent",goodSetName:"示例正向案例集",badSetName:"示例负向案例集",weeklyFeedback:{input:"总结本周客户反馈,并按优先级归类。",output:"覆盖主要问题,给出清晰的优先级与下一步动作。",tag:"总结",reason:"任务完整覆盖了用户目标,输出结构清晰,并给出了可执行的下一步动作。"},research:{input:"查询最新公开资料并附上来源。",output:"调用搜索工具,结论与引用一一对应。",tag:"工具调用"},uncertainConclusion:{input:"在信息不足时直接给出确定结论。",output:"应明确说明未知,并主动询问缺失信息。",tag:"幻觉",reason:"信息不足时仍给出了确定结论,缺少必要的澄清步骤与不确定性说明。"},repeatedTool:{input:"连续重复调用相同工具获取同一结果。",output:"复用已有结果,避免无意义的重复调用。",tag:"效率"}},goodCases:"正向案例",badCases:"负向案例",goodCase:"正向案例",badCase:"负向案例",reference:"参考答案",caseResultFilter:"案例结果筛选",feedbackSourceFilter:"反馈来源筛选",searchCases:"搜索案例",searchCasesPlaceholder:"搜索输入、输出或标签",selectCases:"选择案例",selectAll:"全选",selectAllVisible:"选择当前可见案例",selectedCaseCount:"已选择 {{count}} 条",deleteSelected:"删除所选",deleteSelectedTitle:"删除所选 Agent",deleteSelectionDescription:"确定删除所选的 {{count}} 个项目吗?此操作无法撤销。",deleteCasesConfirm:"删除所选案例",deleteOneCaseConfirm:"删除这个案例",deleteFeedbackCase:"删除反馈案例",noFeedbackCases:"暂无反馈案例",noMatchingCases:"没有匹配的案例",loadingEvaluationSet:"正在加载评测集…",userInput:"用户输入",agentOutput:"Agent 输出",score:"得分",scoreReason:"评分原因",noUserInput:"暂无用户输入",noVisibleResponse:"暂无可见回复",note:"备注:",manualFeedback:"人工反馈",automaticFeedback:"自动反馈",scoreValue:"{{score}} 分",unknownTime:"时间未知",deleteAgentTitle:"删除 Agent",deleteAgentDescription:"确定删除 Agent“{{name}}”吗?",deleteDraftDescription:"确定删除草稿“{{name}}”吗?",deleteAgent:"删除 Agent",closeDeleteConfirmation:"关闭删除确认",mpaDeletePreviewSummary:"Studio 会先删除可见的空闲 MPA Runtime 会话,再删除 AgentKit Runtime。运行中的任务需要先结束或停止后才能删除。",mpaDeletePreviewSessions:"会话",mpaDeletePreviewActiveSessions:"运行中",mpaDeletePreviewIdleSessions:"空闲",mpaDeleteBlocked:"当前无法删除",mpaDeleteBlockerActiveOperation:"仍有 MPA 创建或更新操作在执行。",mpaDeleteBlockerActiveSessions:"Runtime 中仍有运行中的会话。",mpaDeleteBlockerBindingAmbiguous:"当前 Agent 匹配到多个 MPA Runtime。",mpaDeleteBlockerRuntimeMissing:"当前 MPA Agent 没有可见的 Runtime 绑定。",mpaDeleteBlockerOrphanRuntime:"Runtime 可见,但其中缺少当前 MPA Profile。",mpaDeleteStage:{runtime_sessions:"删除 {{count}} 个可见空闲 Runtime 会话",runtime_diagnostics:"清理这些会话关联的诊断数据和挂载元信息",agentkit_runtime:"删除 AgentKit Runtime"},draftDeletionWarning:"草稿将从当前浏览器中删除。",runtimeDeletionWarning:"Runtime 和相关云端资源将被删除。",noneSelected:"尚未选择",none:"无",notPublished:"未发布",notRecorded:"未记录",noTime:"暂无时间",noPr:"暂无 PR",comingSoon:"评测能力即将开放",preparing:"准备中",cancelled:"已取消",failed:"失败",totalCount:"共 {{count}} 条",deploymentProgress:"部署进度",returnToEdit:"返回编辑",retryOperation:"重试操作",buildLog:"构建日志",githubMountLog:"GitHub 挂载日志",githubDeliveryMountLog:"GitHub 持续交付挂载日志",waitingBuildLog:"正在等待构建日志…",waitingGithubMountLog:"正在等待 GitHub 挂载日志…",copy:"复制",copied:"已复制",copyLabel:"复制{{label}}",copiedLabel:"已复制{{label}}",logLines:"{{count}} 行",logStatus:{synced:"已同步",failed:"读取失败",syncing:"同步中",earlyOmitted:"已省略早期日志",recentOnly:"仅显示最近的构建日志",partiallyOmitted:"已省略部分日志"},deployStatus:{running:"正在部署",unconfirmed:"部署状态待确认",success:"部署完成",error:"部署失败",cancelled:"部署已取消"},deploymentSteps:{prepare:{label:"准备部署",description:"校验配置并创建部署任务"},build:{label:"构建镜像",description:"生成运行环境与智能体代码"},deploy:{label:"部署服务",description:"创建并启动 AgentKit Runtime"},publish:{label:"发布服务",description:"等待服务就绪并生成访问地址"},complete:{label:"部署完成",description:"智能体已可以正常使用"},evaluation:{label:"创建评测集",description:"自动创建 Good Case 和 Bad Case 评测集"},profileApplying:{label:"应用 MPA 配置",description:"将 Studio Agent 配置写入 MPA Runtime"},smokeRunning:{label:"验证 MPA Runtime",description:"在标记可运行前执行 Runtime 就绪验证"},runnable:{label:"MPA Runtime 可运行",description:"Runtime 已接受配置并通过执行就绪验证"},github:{label:"挂载 GitHub 持续交付",description:"初始化目标分支与 GitHub Actions workflow"},update:{label:"更新实例配置",description:"将 Runtime 实例数调整为 {{min}}~{{max}}"}},githubStatus:{published:"已发布",publishing:"发布中",failed:"发布失败",pending:"等待发布",unknown:"未知"},errors:{agentInfoMissing:"Agent 信息不可用",checkUpdateCapability:"无法检查更新能力",checkingUpdateConfig:"正在检查更新配置",cloudOnlyUpdate:"仅云端 Agent 支持更新",deleteDeployedUnsupported:"当前不支持删除已部署 Agent",deleteDraftUnsupported:"当前不支持删除草稿",loadMpaDeletePreview:"无法加载 MPA 删除预览",loadAgentInfo:"无法加载 Agent 信息",loadApiKey:"无法读取 API Key",loadGithubVersions:"无法加载 GitHub 版本",loadEvaluations:"无法加载评测案例",loadMpaAgentView:"无法加载 MPA Agent 状态",loadMpaDiagnostics:"无法加载 Runtime 诊断",loadOptimizations:"无法加载优化建议",loadRuntimeDetails:"无法加载 Runtime 详情",loadSessionConfig:"无法加载会话配置",loadUsage:"无法加载使用数据",noCreatePermission:"当前账号没有创建 Agent 的权限",noManagePermission:"当前账号没有管理此 Agent 的权限",originalConfigUnavailable:"原始配置不可用",probeIntegration:"无法检测集成能力",rollbackVersion:"无法创建版本回退",runtimeRegionMissing:"Runtime 区域信息缺失",updateCapabilityMismatch:"Runtime 更新能力与当前配置不匹配",updateCapabilityPending:"Runtime 更新能力仍在确认中",updateConfigRestoring:"正在恢复更新配置",updateUnsupported:"当前 Runtime 不支持更新",usageMismatch:"返回的使用数据与当前 Agent 不匹配"}},e1e={title:"环境",loadFailed:"环境加载失败,请检查存储配置后重试。",storageUnavailable:"管理员未配置持久化存储,环境管理暂不可用。",create:"新建环境",configure:"配置环境",details:"环境详情",editorDescription:"配置运行环境,或接入代码仓库和已有镜像",backToList:"返回环境列表",save:"保存环境",createAndBuild:"创建并构建",saveAndBuild:"保存并构建",name:"环境名称",namePlaceholder:"Python 数据处理",descriptionPlaceholder:"说明这个环境适合处理的任务",creationMethod:"创建方式",baseConfiguration:"基础配置",baseEnvironment:"基础环境",operatingSystem:"操作系统",pythonVersion:"Python 版本",fixedByBase:"由 {{base}} 固定为 {{value}}",selectUbuntuVersion:"选择基础镜像的 Ubuntu 版本",selectPythonVersion:"选择需要安装的 Python 版本",skills:"技能",addSkill:"添加环境技能",veadkDescription:"Agent 开发与运行框架",customDockerfile:"自定义 Dockerfile",presetEnvironment:"预制环境",presetHint:"选择“无”可自行填写 Dockerfile 第一行的基础镜像。",dockerfileSize:"{{size}} / {{max}} 字节",upload:"上传",reset:"重置",dockerfileBaseImage:"Dockerfile 基础镜像",dockerfileContent:"Dockerfile 内容",region:"区域",search:"搜索环境",manualImport:"手动导入",noMatches:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称",startBuild:"开始构建",build:"构建",unnamed:"未命名环境",listSeparator:"、",clipboardReadError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。",creation:{custom:{label:"自定义配置",description:"通过表单选择基础环境、Python、工具和技能"},dockerfile:{label:"自定义 Dockerfile",description:"上传或直接编辑 Dockerfile"},git:{label:"从代码仓库构建",description:"探查公开仓库并通过 CodePipeline 构建"},image:{label:"使用已有镜像",description:"绑定由外部流水线交付的 CR 镜像"}},baseDescriptions:{"aio-sandbox":"内置 Sandbox Shell 能力 · Ubuntu 22.04","codex-sandbox":"内置 Codex CLI、浏览器与代码执行环境",ubuntu:"标准 Linux 基础镜像"},dockerfileValidation:{baseImageRequired:"请填写基础镜像。",duplicateFrom:"基础镜像已固定在第一行,请删除 Dockerfile 正文中的 FROM 指令。",tooLarge:"Dockerfile 不能超过 128 KiB。",empty:"Dockerfile 内容不能为空。",missingFrom:"Dockerfile 缺少 FROM 指令。"},presets:{none:"自行填写 Dockerfile 基础镜像",aio:"内置 Sandbox Shell 与常用运行时",codex:"内置 Codex CLI、浏览器与代码执行环境"},categories:{tools:"工具",productivity:"效率",browser:"浏览器自动化",system:"系统与媒体"},options:{"lark-cli":"飞书开放平台命令行工具",pandoc:"文档格式转换工具",opencli:"将网站与桌面应用转换为命令行工具",uv:"快速 Python 包与项目管理器",ripgrep:"高性能文本检索工具",jq:"JSON 查询与转换工具","github-cli":"在终端中管理 GitHub 工作流",playwright:"浏览器自动化与端到端测试",chromium:"无头浏览器运行时",git:"代码版本管理",curl:"网络请求与文件下载",ffmpeg:"音视频转码与处理",imagemagick:"图片转换与批处理"},duration:{seconds:"{{count}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",hoursMinutes:"{{hours}} 小时 {{minutes}} 分"},buildStatus:{preparing:"准备中",queued:"排队中",building:"构建中",scanning:"扫描中",available:"可用",failed:"构建失败",notBuilt:"未构建"},manifest:{title:"环境 Manifest",closeLabel:"关闭环境 Manifest",loading:"正在加载 Manifest",editorLabel:"环境 Manifest YAML",copyFailed:"复制失败,请重试",copied:"已复制",copy:"复制 Manifest",view:"查看环境 Manifest",viewShort:"查看 Manifest",unavailable:"尚无可用 Manifest"},buildDetails:{title:"构建详情",closeLabel:"关闭构建详情",currentStep:"当前步骤",waiting:"等待构建信息",elapsed:"已用时",sourceCommit:"源码提交",openCodePipeline:"在 CodePipeline 中查看",starting:"正在启动",rebuild:"重新构建"},git:{sectionLabel:"公开代码仓库",address:"Git 地址",ref:"Branch、Tag 或 Commit",defaultBranch:"默认分支",inspecting:"正在拉取仓库并查找 Dockerfile",foundDockerfiles:"已在提交 {{commit}} 中找到 {{count}} 个 Dockerfile。",savedDockerfileLoaded:"已载入保存的 Dockerfile,可重新探查仓库更新。",noDockerfile:"仓库中未找到 Dockerfile,请检查分支或仓库内容。",inspectAgain:"重新探查",selectDockerfile:"选择 Dockerfile"},repository:{outputSection:"构建输出",type:"镜像仓库类型",managed:"Studio 默认镜像仓库",existing:"已有镜像仓库",managedHint:"构建时自动创建或复用当前区域的 Studio 镜像仓库。"},existingImage:{sectionLabel:"已有镜像",reference:"Tag 或 Digest",placeholder:"latest 或 sha256:...",hint:"填写镜像 Tag,或以 sha256: 开头的完整 Digest。"},share:{action:"分享",title:"分享环境",closeLabel:"关闭分享环境",generating:"正在生成并复制分享码",copied:"分享码已复制",failed:"分享失败",code:"分享码",fullCode:"完整环境分享码",copiedHint:"分享码已自动复制,也可在这里查看或手动复制。",copyFailedHint:"自动复制失败,可手动复制上方分享码,或重试。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅发送给可信对象。",copyAgain:"再次复制"},import:{title:"导入环境",closeLabel:"关闭导入环境",description:"先检测分享码中的环境,再确认添加到当前账号。",code:"环境分享码",tooMany:"最多可一次导入 {{max}} 个环境,当前检测到 {{count}} 个分享码。",multipleHint:"多个分享码可使用英文逗号、中文逗号或换行分隔,重复项会自动忽略。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅导入可信来源的分享码。",inspectingCodes:"正在检测环境分享码",found:"检测到 {{count}} 个环境:{{names}}。",itemError:"第 {{index}} 个分享码:{{error}}",invalidCode:"分享码无效。",noResult:"服务未返回该分享码的导入结果。",partial:"已导入 {{created}} 个环境,{{remaining}} 个未完成,可重试有效失败项。",inspecting:"正在检测",importing:"正在导入",retryImport:"重试导入",confirm:"确认导入",inspectCodes:"检测分享码"},status:{boundImage:"环境“{{name}}”已绑定已有镜像",queued:"环境“{{name}}”已进入构建队列",savedBuildFailed:"环境已保存,但构建未启动:{{error}}",importedFailed:"已导入 {{created}} 个环境,{{failed}} 个失败",importedDuplicate:"已导入 {{created}} 个环境,{{duplicate}} 个分享码已存在",imported:"已导入 {{count}} 个环境",deleted:"已删除环境“{{name}}”"},deleteTitle:"删除环境",deleteDescription:"确定删除环境“{{name}}”吗?删除后无法恢复。",errors:{repositoryRequired:"请输入公开代码仓库地址。",repositoryHttps:"请输入公开仓库的 HTTPS 地址。",repositoryInvalid:"请输入有效的公开仓库 HTTPS 地址。",imageReferenceWhitespace:"Tag 或 Digest 不能包含空格。",imageDigestInvalid:"Digest 必须是完整的 sha256 值。",imageTagOnly:"这里只填写 Tag,不要重复填写镜像仓库路径。"}},t1e={searchPlaceholder:"搜索资源名称",emptyMessage:"暂无可用选项",searchAriaLabel:"搜索{{label}}",loadingMore:"正在加载更多资源…"},n1e={retryDeployment:"重试部署",retrying:"正在重试…",collapse:"收起错误信息",expand:"展开完整错误信息",copy:"复制完整错误信息"},i1e={steps:"构建步骤",log:"构建日志",syncing:"同步中",loadFailed:"读取失败",synced:"已同步",recentOnly:" · 仅显示最近日志",copiedLog:"已复制构建日志",copyLog:"复制构建日志",copied:"已复制",copy:"复制",logContent:"构建日志内容",waiting:"正在等待 CodePipeline 输出日志…",empty:"暂无构建日志"},r1e={defaultLabel:"Studio 默认环境",defaultDescription:"使用 Studio 预置的标准运行环境",status:{notBuilt:"未构建",preparing:"准备中",queued:"排队中",building:"构建中",scanning:"扫描中",available:"可用",failed:"失败"},label:"运行环境",placeholder:"请选择运行环境",search:"搜索运行环境",loading:"正在加载运行环境…",loadFailed:"加载运行环境失败",noMatches:"未找到匹配的运行环境",unavailable:"当前没有可用的运行环境",selectionUnavailable:"所选运行环境当前不可用,请重新选择。",selectionHint:"选择构建完成的运行环境后,部署将使用其镜像和工具配置。",versionChanged:"所选环境版本已更新,请确认后继续。",versionMissing:"所选环境版本已不存在,请重新选择。",operatingSystem:"操作系统",language:"语言",image:"镜像",imageVersion:"镜像版本",skills:"技能",tools:"工具",noSkills:"未配置 Skill",noExtraTools:"未配置额外工具",defaultGuidance:"默认环境由 Studio 管理,无需额外配置。",persistenceFallback:"持久化环境服务暂不可用,当前使用默认环境。",emptyFallback:"当前没有可选择的自定义环境。"},s1e={repository:"GitHub 仓库",githubUrl:"GitHub 地址",token:"访问令牌",sessionToken:"{{provider}} 临时令牌",runtime:"Runtime",commit:"提交",workflow:"工作流",syncFailed:"同步 GitHub 代码失败",status:{mounted:"已挂载",bound:"已绑定",synced:"已同步",created:"已创建"},volcengine:"火山引擎",mountDelivery:"挂载持续交付",selectedForDeployment:"已选择,部署时挂载",mountOnDeploy:"部署时挂载持续交付",syncCode:"同步代码",deliveryMode:"GitHub 交付模式",sourceSync:"GitHub 代码同步",delivery:"GitHub 交付",loading:"读取中",running:"执行中",runtimeDeliveryHint:"写入 AgentKit Runtime GitHub Actions workflow,后续 GitHub 提交会更新绑定 Runtime。",initialDeliveryHint:"首次部署成功后初始化目标分支,后续 GitHub 提交会更新绑定 Runtime。",sourceSyncHint:"Studio 会直接 push 到目标分支;该分支由 Studio 管理,远端冲突时同步会失败。Runtime 仍由部署按钮发布。",tokenPlaceholder:"repo 或 contents write 权限",getToken:"获取 Token",hideToken:"隐藏 Token",showToken:"显示 Token",tokenHelp:"Token 仅用于本次操作,成功后不会保留在表单中。",targetBranch:"目标分支",actionsSecretPlaceholder:"用于写入 GitHub Actions Secret",sessionTokenPlaceholder:"临时凭证可选",syncing:"同步中…",pendingHint:"已选择挂载持续交付。点击部署后,Studio 会等待 Runtime 创建完成并初始化 GitHub 目标分支,初始化成功后才完成部署流程。",result:{deliveryMounted:"已挂载持续交付",deliverySelected:"已选择挂载持续交付",githubBound:"已绑定 GitHub",codeSynced:"代码已同步",deliveryHint:"目标分支提交会触发 Runtime 持续交付。",boundHint:"更新并发布时会先同步当前源码到这个分支。"},branch:"分支",viewPr:"查看 PR",createFailed:"创建失败",phase:"阶段",log:"日志"},a1e={name:"飞书",enabling:"正在启用并更新配置…",description:"接收消息并通过飞书机器人回复",configuration:"飞书配置",configurationMode:"飞书配置方式",automatic:"自动配置",manual:"手动配置",cancelling:"取消中…",scanToCreate:"扫码创建",scanDescription:"授权后自动回填凭据",generateQrCode:"生成二维码",qrCodeAlt:"飞书机器人配置二维码",scanToConfirm:"飞书扫码确认",expiresIn:"{{time}} 后失效",created:"机器人已创建",credentialsFilled:"应用凭据已自动回填",qrCodeExpired:"二维码已失效",automaticFailed:"自动配置失败",regenerateQrCode:"请重新生成二维码。",configuredPlaceholder:"已配置,留空沿用",appSecretPlaceholder:"请输入 App Secret",hideSecret:"隐藏 App Secret",showSecret:"显示 App Secret"},o1e={mode:{auto:"自动创建",autoDescription:"部署时自动创建所需资源",recommended:"推荐",create:"指定名称",createDescription:"使用指定名称创建或复用资源",existing:"选择已有",existingDescription:"从当前账号的已有资源中选择"},selectExisting:"请选择已有资源",searchResource:"搜索资源名称",noMatch:"未找到匹配资源",noAvailable:"暂无可用资源",searching:"正在搜索云资源…",loading:"正在加载云资源…",noMatchSentence:"未找到匹配资源。",noAvailableSentence:"暂无可用资源。",loadedSummary:"实际服务区域:{{region}} · 已加载 {{loaded}}{{total}}",registryInstance:"Registry 实例",registryAriaLabel:"镜像仓库 Registry 实例",namespace:"命名空间",namespaceAriaLabel:"镜像仓库 Namespace",repository:"镜像仓库",existingRepository:"已有镜像仓库",selectRegistryFirst:"请先选择 Registry 实例。",selectNamespaceFirst:"请先选择 Namespace。",configurationMode:"配置方式",configurationModeAriaLabel:"{{resource}}配置方式",selectConfigurationMode:"请选择配置方式",automaticNames:"自动创建名称",validation:{tos:"请填写或选择 TOS 存储桶。",cr:"请完整填写或选择 CR 实例、命名空间和镜像仓库。",codePipeline:"请完整填写或选择 CodePipeline Workspace 和 Pipeline。",existingCodePipeline:"请选择已有的 CodePipeline Workspace 和兼容 Pipeline。"},autoBucketWithRegion:"agentkit-platform-{账号 ID}-{{region}}",autoBucket:"agentkit-platform-{账号 ID}",tosBucket:"TOS 存储桶",bucketName:"存储桶名称",bucketNamePlaceholder:"输入存储桶名称",existingBucket:"已有存储桶",existingTosBucket:"已有 TOS 存储桶",bucket:"存储桶",accountIdResolved:"账号 ID 在部署时按当前云账号解析。",containerRegistry:"容器镜像仓库(CR)",instanceName:"实例名称",crInstance:"CR 实例",existingCrInstance:"已有 CR 实例",existingCrNamespace:"已有 CR 命名空间",existingCrRepository:"已有 CR 镜像仓库",autoRegistry:"agentkit-platform-{账号 ID}",autoRepositoryName:"{{name}}-{4 位随机字符}",registryNameNote:"账号 ID 在部署时解析,镜像仓库的随机字符在部署时生成。",workspace:"工作空间",pipeline:"流水线",workspaceName:"Workspace 名称",pipelineName:"Pipeline 名称",existingWorkspace:"已有 CodePipeline Workspace",compatiblePipeline:"兼容 Pipeline",existingPipeline:"已有 AgentKit CodePipeline",pipelineNameNote:"Pipeline 与 Runtime 名称一致。"},l1e={commit:"提交",steps:{permissions:"预检 OTA 所需权限",resolving:"读取目标版本信息",downloading:"下载并校验完整更新包",preparing:"准备 VeFaaS Function 代码",provisioning:"检查并补齐 Studio 云资源",scheduler:"更新定时任务调度服务",submitting:"提交 Function 更新",publishing:"发布新 Revision 并重启服务"},stages:{permissions:"预检 OTA 权限",resolving:"读取版本信息",downloading:"下载更新包",preparing:"准备 Function 代码",provisioning:"补齐 Studio 云资源",scheduler:"更新定时任务调度服务",submitting:"提交 Function 更新",publishing:"发布 Revision",checking:"检查更新",unknown:"未知阶段"},duration:{seconds:"{{count}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},logPermissionPrefix:"无法读取 VeFaaS 发布日志。Function 角色缺少 ",logPermissionSuffix:" 权限,更新会继续。",openIamConsole:"前往 IAM 控制台配置权限",deploymentProgress:"部署进度",live:"实时",completed:"已完成",stopped:"已停止",copied:"已复制",copyFailed:"复制失败",copyLog:"复制日志",waitingForLogs:"等待 VeFaaS 返回更新日志…",noLogs:"本次更新未返回发布日志",messages:{updated:"Studio 已更新,新 Revision 已接管服务",failed:"Studio 更新失败",timeout:"等待 VeFaaS 发布超时,请稍后重新检查版本",submitted:"更新已提交,正在等待 VeFaaS 发布新版本",connectionSwitched:"连接已切换,正在确认新版本状态"},checkingPermissions:"正在检查 OTA 权限",authorizationRequired:"需要 IAM 授权",updating:"正在更新 Studio",updated:"Studio 已更新",updateToVersion:"更新 Studio 至 {{version}}",checkPermissions:"检查更新权限",authorizationNeeded:"需要授权",updatingShort:"正在更新",refreshForNewVersion:"刷新使用新版",updateFailed:"更新失败",updateNow:"立即更新",newVersionAvailable:"有新版更新",dialog:{failed:"Studio 更新失败",checkingPermissions:"正在检查更新权限",authorizationRequired:"需要 IAM 授权",updating:"正在更新 Studio",completed:"Studio 更新完成",newVersion:"发现新版本"},permissionCheck:"正在核对 OTA 与定时任务所需的全部 IAM 权限…",permissionCheckHint:"权限全部满足后才会开始下载、更新或发布云资源。",missingPermissionCount:"当前 Function 角色缺少 {{count}} 项 OTA 更新权限,尚未执行任何云资源变更。",functionRole:"Function 角色",currentRole:"当前运行角色",policyToUpdate:"将更新策略",authorizationSteps:{open:"打开授权页面,确认已预填的策略名称和完整策略内容。",debug:"点击页面中的“发起调试”,完成策略更新。",return:"返回此窗口,点击“我已授权,重新检查”。"},missingPermissions:"缺少的权限",openPrefilledAuthorization:"打开已预填的 IAM 授权页面",openIamManually:"前往 IAM 控制台手动配置",noSafePolicy:"当前角色没有唯一可安全更新的自定义策略,请由管理员将上述权限加入该角色。",failedStage:"失败阶段",errorId:"错误 ID",notGenerated:"未生成",openFunctionLogs:"前往 VeFaaS 控制台查看 Function 日志",targetVersion:"目标版本",updateStatus:"更新状态",elapsed:"已用时",progressAriaLabel:"Studio 更新进度",processingUpdate:"正在处理更新",processing:"正在处理",backgroundHint:"发布阶段会短暂中断连接;关闭此窗口不会停止更新,可随时点击右上角按钮重新查看。",confirmDescription:"更新会重启 Studio 服务,预计约 3–5 分钟完成更新与发布。期间正在进行的对话、流式响应或部署任务可能中断,登录态不会受到影响。",selectVersion:"选择版本",currentVersion:"当前版本",changelog:"更新内容",noChangelog:"暂无更新说明",runInBackground:"后台运行",authorizedRecheck:"我已授权,重新检查",tryAgain:"重新尝试"},c1e={deploy:"部署",update:"更新",planHash:"方案哈希",backToConfiguration:"返回配置",releaseRegion:"发布区域",deployRegion:"部署区域",regionPreserved:"更新时沿用现有 Runtime 的部署区域,无法修改。",unnamedAgent:"未命名 Agent",deployTitle:"部署 {{name}}",additionalAgentCount:" 等 {{count}} 个智能体",releaseOverview:"发布概览",agentOverview:"Agent 概览",agentCount:"Agent 数量",model:"模型",systemPrompt:"系统提示词",optimizations:"优化选项",notEnabled:"未启用",effectiveCapabilities:"生效能力",automaticProtection:"自动保护",artifactActions:"发布产物操作",exportYaml:"导出 YAML",viewSource:"查看源代码",downloadSource:"下载源代码",expandFlow:"放大查看执行流程",expand:"放大查看",deploymentConfiguration:"部署配置",runtimeName:"Runtime 名称",runtimeNamePreserved:"更新时保持现有 Runtime 名称不变。",runtimeNameHint:"默认根据 Root Agent 名称生成,并添加随机后缀避免重名;支持 4-64 位字母、数字、连字符和下划线",accessAuthentication:"访问鉴权",authenticationPreserved:"更新时保持现有 Runtime 的鉴权方式不变。",authenticationMethod:"鉴权方式",authenticationAriaLabel:"部署鉴权方式",authenticationPlaceholder:"请选择鉴权方式",messageChannels:"消息渠道",instanceSettings:"实例设置",minInstances:"最小实例数",maxInstances:"最大实例数",sidecarSingleInstance:"Harness Sidecar 首期仅支持单实例,Runtime 固定为 1~1",inMemorySingleInstance:"为避免多实例间会话丢失,推荐将 Runtime 固定为 1~1",network:"网络",networkPreserved:"现有 Runtime 的区域与网络模式保持不变。",networkMode:"网络模式",networkModes:{public:"公网",both:"公网 + VPC"},subnetId:"子网 ID",subnetHint:"可选,多个用逗号分隔",sharedInternetAccess:"VPC 内共享公网出口",evaluationSets:"评测集",createEvaluationSets:"自动创建评测集",createEvaluationSetsHint:"部署成功后,自动创建 Good Case 和 Bad Case 评测集。",resourceConfiguration:"资源配置",environmentVariables:"环境变量",environmentVariablesHint:"组件配置会自动同步到这里,部署前可核对最终值。",itemCount:"{{count}} 项",addVariable:"添加变量",componentGenerated:"组件自动生成",injectedByApiKey:"由所选 API Key 注入",envNameAriaLabel:"{{key}} 环境变量名",envDescriptionAriaLabel:"{{key}}说明:{{description}}",openOpenViking:"打开 OpenViking {{label}}",openOpenVikingAriaLabel:"{{key}}:打开 OpenViking {{label}}",requiredEmpty:"必填,尚未填写",optionalEmpty:"可选,尚未填写",envValueAriaLabel:"{{key}} 环境变量值",automatic:"自动",synced:"同步",customModelCredentials:"自定义模型凭据",releaseOnlySecret:"必填,仅用于本次发布",thisRelease:"本次发布",customVariables:"自定义变量",value:"值",deleteVariable:"删除变量",deploymentProgress:"部署进度",retryUpdate:"重试更新",retryDeploy:"重试部署",updateSucceeded:"更新成功",deploySucceeded:"部署成功",region:"区域",agentName:"Agent 名称",apiEndpoint:"API 端点",connecting:"连接中…",chatNow:"立即对话",console:"控制台",actionInProgress:"{{action}}中…",checkingName:"正在检查名称…",retryAction:"重试{{action}}",flowPreview:"执行流程预览",executionFlow:"执行流程",flowPreviewHint:"只读预览,可缩放与拖动画布",closeFlowPreview:"关闭执行流程预览",agentAdded:'Agent "{{name}}" 已添加到左上角下拉列表!',files:{preview:"文件预览",new:"新建文件",empty:"暂无文件",noneSelected:"未选择文件",selectToView:"选择左侧文件以查看内容",loadingEditor:"加载编辑器…",rename:"重命名",renamePrompt:"重命名文件"},apiKey:{selectFirst:"请先选择 API Key",revealing:"正在显示 API Key",hide:"隐藏 API Key",retryReveal:"重试显示 API Key",reveal:"显示 API Key"},task:{preparing:"准备部署",waitingBuildLog:"正在等待构建日志…",waitingGithubLog:"正在等待 GitHub 挂载日志…",syncingGithub:"正在同步当前源码到 GitHub",syncGithubCode:"同步 GitHub 代码",githubSynced:"GitHub 代码已同步",githubSubmitted:"GitHub 代码已提交",githubUpdatingRuntime:"代码已提交到 GitHub,GitHub Actions 正在更新同一个 Runtime",initializingGithub:"开始初始化 GitHub main 分支与 Actions workflow",initializingGithubBranch:"正在初始化 GitHub 持续交付目标分支",mountGithubDelivery:"挂载 GitHub 持续交付",githubBranchInitialized:"GitHub 持续交付已初始化目标分支",githubDeliveryMounted:"GitHub 持续交付已挂载",githubMountFailed:"挂载 GitHub 持续交付失败",githubMountFailedDetail:"GitHub 持续交付挂载失败:{{message}}",githubMountFailedHint:"挂载 GitHub 持续交付失败,详见 GitHub 日志。",applyingMpaProfile:"正在将 Agent 配置应用到 MPA Runtime",mpaProfileApplied:"MPA Runtime 配置已应用",runningMpaSmoke:"正在验证 MPA Runtime 执行链路",mpaReady:"MPA Runtime 已可运行",deploymentComplete:"部署完成",deployedNotConnected:"部署完成,暂未连接",cancelled:"已取消",cancelledHint:"部署已取消,相关 Runtime 资源已请求销毁。",deploymentStatusUnconfirmed:"部署状态待确认",deploymentFailed:"部署失败",buildFailedHint:"构建镜像失败,详见构建日志。"},confirm:{updateTitle:"确认更新",deployTitle:"确认部署",closeLabel:"关闭部署确认",updateDescription:"将更新并发布到当前云端 Runtime,过程可能需要几分钟。确定继续吗?",deployDescription:"将创建新的云端 Runtime,部署过程可能需要几分钟。确定继续吗?",update:"确定更新",deploy:"确定部署"},userPool:{label:"用户池",unnamed:"未命名用户池",current:"当前用户池",ariaLabel:"部署用户池",loading:"正在加载用户池…",placeholder:"请选择用户池",loadingIdentity:"正在加载 Identity 用户池…",empty:"当前账号下暂无 Identity 用户池。",currentHint:"当前 Studio 的登录 JWT 将透传访问此 Runtime。",mismatchHint:"所选用户池不是当前 Studio 使用的用户池,部署后无法从 Studio 调用此 Runtime。",markedHint:"当前 Studio 使用的用户池已在列表中标注。"},authentication:{apiKeyDescription:"默认方式,使用 Runtime API Key 访问",userPool:"用户池",userPoolDescription:"使用 Identity 用户池签发的 JWT"},steps:{buildImage:"构建镜像",deploy:"部署",publish:"发布",syncCode:"同步代码",uploadPackage:"上传代码包",packageImage:"镜像打包",createRuntime:"创建 Runtime",publishService:"发布服务",updateInstances:"更新实例配置",createEvaluationSets:"创建评测集",applyMpaProfile:"应用 MPA 配置",verifyMpaRuntime:"验证 MPA Runtime",mpaReady:"MPA Runtime 可运行"},errors:{instanceRangeInteger:"最小实例数必须为大于等于 0 的整数,最大实例数必须为大于 0 的整数。",instanceRangeOrder:"最小实例数不能大于最大实例数。",selectApiKey:"请先在模型配置中选择 API Key。",loadApiKey:"加载 API Key 失败,请重试。",invalidProject:"项目数据无效",updateFeishu:"更新飞书配置失败:{{message}}",userPoolRequired:"请选择用于 Runtime 鉴权的用户池。",vpcRequired:"使用 VPC 网络时,请填写 VPC ID。",modelSecretRequired:"请填写 {{label}},用于访问对应的自定义模型地址。",managedApiKeyRequired:"{{requirement}},请先返回模型配置选择 API Key。",feishuEnvRequired:"启用飞书后,请填写{{field}}。",runtimeNameExists:"Runtime 名称已存在,请修改后重试。",deployedButGithubMountFailed:"部署成功,但挂载 GitHub 持续交付失败:{{message}}",deployedButGithubBindFailed:"部署成功,但绑定 GitHub 失败:{{message}}",mpaRuntimeIdMissing:"部署成功,但返回缺少 Runtime ID,无法应用 MPA 配置。",mpaOperationIncomplete:"MPA Runtime 初始化未完成,请重试此部署任务。",deploymentStatusUnconfirmed:"连接已中断,当前无法确认部署最终状态。任务可能仍在云端运行,请到 AgentKit 或 Code Pipeline 查看同一任务,避免重复部署。",failedAtStage:"{{action}}失败({{stage}}阶段):{{message}}",noAgentAtEndpoint:"连接成功,但该地址未发现任何 Agent(/list-apps 为空)。",addAgent:"添加 Agent 失败:{{message}}",modelApiKeyRequired:"请填写此模型地址对应的 API Key。"}},u1e={title:"工作区",storageUnavailable:"管理员未配置持久化存储,工作区管理暂不可用。",detail:"工作区详情",create:"新建工作区",editorDescription:"将常用环境组合在一起;同一个环境可以加入多个工作区。",backToList:"返回工作区列表",environmentCount_one:"{{count}} 个环境",environmentCount_other:"{{count}} 个环境",createdAt:"创建时间",updatedAt:"最近更新",basicInfo:"基本信息",namePlaceholder:"例如:内容生产",descriptionPlaceholder:"说明这个工作区的用途",selectedEnvironmentCount:"已选择 {{count}} 个,可在其他工作区中继续复用",searchAvailableEnvironments:"搜索可用环境",searchEnvironments:"搜索环境",noAvailableEnvironments:"还没有可添加的环境",createEnvironmentFirst:"请先在“环境”页面创建并构建环境。",noMatchingEnvironments:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称。",environmentStatus:{available:"可用",building:"构建中",notBuilt:"未构建"},added:"已添加",saved:"已保存工作区“{{name}}”",resourceType:"工作区资源类型",searchWorkspaces:"搜索工作区",loadFailed:"无法加载工作区",noMatchingWorkspaces:"没有匹配的工作区",tryAnotherNameOrEnvironment:"请尝试搜索其他名称或环境",noEnvironmentAdded:"未添加环境",environmentMissing:"环境缺失",availableFraction:"{{available}}/{{total}} 可用",available:"可用",availableCount:"{{count}} 个可用",updated:"更新",addEnvironment:"添加环境",deleteTitle:"删除工作区",deleteDescription:"确定删除工作区“{{name}}”吗?环境本身不会被删除。",deleted:"已删除工作区“{{name}}”",clipboardPermissionError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。",codeProjects:"代码项目"},d1e={back:"返回",detailNavigation:"详情导航",noData:"暂无数据",actions:"操作",moreActions:"更多操作 {{label}}",actionsFor:"{{label}} 操作",loading:"资源加载中,请稍候"},f1e={addSkill:"添加 Skill",remove:"移除 {{name}}",confirmRemoveRuntime:"从新版本中移除运行中的 Skill「{{name}}」?",selectedCount:"已加入技能 · {{count}}",close:"关闭{{label}}",sources:{runtime:"运行中来源 · 原样保留,可移除或用同名 Skill 替换",local:"本地",skillspace:"AgentKit Skills 中心",skillhub:"火山 Find Skill 技能广场"},tabs:{local:"本地文件",localShort:"本地文件",skillspace:"AgentKit Skills 中心",skillspaceShort:"AgentKit",skillhub:"火山 Find Skill 技能广场",skillhubShort:"Find Skill"}},h1e={model:"模型",turnControls:"流程控制",pause:"暂停",resume:"恢复",interrupt:"中断",cancel:"取消",pauseTurn:"在安全点暂停完整流程",resumeTurn:"恢复完整流程",interruptTurn:"中断当前流程并保留会话上下文",cancelTurn:"取消当前流程且不可恢复",turnState:{running:"运行中",pausing:"正在到达安全点",paused:"已暂停",resuming:"正在恢复",interrupting:"正在中断",cancelling:"正在取消",interrupted:"已中断",completed:"已完成",failed:"失败",cancelled:"已取消",orphaned:"状态待确认",newTurnRequired:"需要从检查点继续"},tasks:{ppt:"PPT",image:"图片生成",video:"视频生成"},prompts:{ppt:{quarterlyReview:"复盘【季度】经营表现,提炼指标差距、原因与行动建议",projectUpdate:"汇报【项目名称】进展:里程碑、风险、预算和资源诉求",solutionProposal:"为【客户行业】输出解决方案:痛点、架构、实施路径与收益",industryAnalysis:"分析【行业主题】趋势,给出竞争格局、机会与战略建议"},image:{launchVisual:"为【品牌或产品】设计【高级科技】风格的发布会主视觉",ecommercePoster:"生成【产品名称】电商海报,突出【核心卖点】与品牌色",conceptRendering:"呈现【产品或空间】在【使用场景】中的写实概念效果图",socialGraphic:"围绕【传播主题】制作简洁专业的企业社媒配图"},video:{brandFilm:"制作【品牌名称】30 秒宣传片,突出【品牌价值】",productLaunch:"为【产品名称】制作 45 秒发布视频:痛点、功能、场景与行动号召",trainingVideo:"制作【培训主题】企业培训视频,讲清【关键操作或规范】",eventTeaser:"生成【活动名称】20 秒预热视频,包含亮点、时间地点和报名信息"}},firstFrame:"首帧",videoToEdit:"待编辑视频",baseVideo:"基础视频",optimizeSkillPlaceholder:"描述你想优化的技能…",createSkillPlaceholder:"描述你想生成的技能…",createVideoPlaceholder:"描述你想创作的视频…",messageAgentPlaceholder:"向 {{name}} 发消息…",selectAgentFirst:"请先选择智能体",selectSkillFirst:"请先选择需要优化的 Skill",availableSkills:"可用技能",availableSubagents:"可用子 Agent",invokeSkill:"调用技能",useSubagent:"使用子 Agent",loadingCapabilities:"正在读取 Agent 能力…",noMatchingSkills:"当前 Agent 没有匹配技能",noMatchingSubagents:"当前 Agent 没有匹配子 Agent",skillFallbackDescription:"加载并执行该技能",agentFallbackDescription:"将本轮交给该 Agent",skill:"技能",uploadImage:"上传图片",uploadDocument:"上传文档或 PDF",uploadVideo:"上传视频",taskMode:"任务模式",selectTaskMode:"选择任务模式",loadingGenerationModel:"正在加载生成模型",modelUnavailable:"模型不可用",cancelTask:"取消{{task}}任务",stopGenerating:"停止生成",viewVideoProgress:"查看视频生成进度",send:"发送",selectTaskType:"选择任务类型",enterprisePrompts:"{{task}}企业提示词",sessionId:"会话 ID",sessionIdLabel:"会话 ID:",initializing:"初始化中",copied:"已复制",copySessionId:"复制会话 ID",sessionIdCopied:"已复制会话 ID",disclaimer:"回答仅供参考",viewLogs:"查看日志"},p1e={selectAgent:"选择 Agent",noLocalAgents:"暂无本地 Agent。",searchRuntime:"搜索 Runtime 名称",mineOnly:"只看我创建的",noRuntimes:"暂无 Runtime。",unsupported:"不支持",createdByMe:"我创建的",connecting:"连接中…",connected:"已连接",connect:"连接",viewInfoFor:"查看 {{name}} 信息",viewInfo:"查看信息",agentAndRuntimeInfo:"Agent 与 Runtime 信息",detailType:"详情类型",agentInfo:"Agent 信息",runtimeInfo:"Runtime 信息",loadingAgentInfo:"读取 Agent 信息…",cannotLoadAgentInfo:"暂时无法读取 Agent 信息",unnamedAgent:"未命名 Agent",subagents:"子 Agent",tools:"工具",skills:"技能",previewUnsupported:"暂不支持预览",mountedComponents:"挂载组件",noMoreAgentInfo:"暂无更多 Agent 配置信息。",local:"本地",model:"模型",status:"状态",memoryMb:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",resources:"资源",version:"版本",loadingDetails:"读取详情…",environmentVariables:"环境变量",errors:{notFound:"该 Runtime 已不存在或列表信息已过期,请刷新列表后重试。",accessDenied:"当前账号无权访问该 Runtime,请检查所属 Project 和访问权限。",previewUnsupported:"该 Agent Server 版本暂不支持信息预览。",unavailable:"该 Runtime 暂时无法访问,请确认其状态为“就绪”后重试。",timeout:"加载超时,请重试"},componentKinds:{knowledgebase:"知识库",memory:"记忆",prompt_manager:"提示词管理",example_store:"样例库",run_processor:"运行处理器",tracer:"链路追踪",toolset:"工具集",plugin:"插件",other:"其他"},runtimeStatus:{ready:"就绪",unreleased:"未发布",running:"运行中",active:"运行中",creating:"创建中",pending:"等待中",deploying:"部署中",updating:"更新中",failed:"失败",error:"异常",stopping:"停止中",stopped:"已停止",deleting:"删除中",deleted:"已删除"}},m1e={agent:"智能体",agentTypes:{general:"通用智能体",mpa:"MPA 智能体",codex:"Codex","deepseek-harness":"DeepSeek",openclaw:"OpenClaw",hermes:"Hermes"},creator:"创建人",namedAgent:"{{name}} 智能体",storageLocation:"存储位置",currentBrowser:"当前浏览器",region:"地域",viewDeploymentProgress:"查看 {{name}} 部署进度",viewRuntimeDetails:"查看 {{name}} Runtime 详情",viewDetails:"查看 {{name}} 详情",time:"时间",remainingTime:"剩余时间",expiringSoon:"即将清空",sandboxRemaining:"{{hours}} 小时 {{minutes}} 分钟",wakeable:"已休眠",neverExpires:"永不过期",editDraftNamed:"编辑草稿 {{name}}",viewProgress:"查看进度",deleteDraftNamed:"删除草稿 {{name}}",recheckCompatibility:"重新检测 {{name}} 的对话兼容性",connectedNamed:"{{name}} 已连接",wakeAndChat:"唤醒 {{name}} 并开始对话",chatWith:"与 {{name}} 对话",waking:"唤醒中",deploying:"部署中",draft:"草稿",checking:"检测中",chatUnsupported:"不支持对话",checkFailed:"检测失败",creatorFilter:"创建人筛选",agentType:"智能体类型",searchAgents:"搜索智能体",handoff:"接力",agentList:"{{type}}列表",noMatchingAgents:"没有匹配的智能体",adjustSearch:"请尝试调整搜索或筛选条件",noAgentType:"暂无 {{type}}",noGeneralAgents:"暂无通用智能体",createGeneralAgentDescription:"创建一个通用智能体,开始构建和对话",createAgentType:"创建{{type}}",createAgent:"创建智能体",loadingMore:"正在加载更多智能体",scrollForMore:"继续下滑加载更多",allLoaded:"已加载全部智能体",deleteDraftTitle:"删除草稿?",deleteDraftDescription:"删除后将无法恢复“{{name}}”。",deleteDraft:"删除草稿",loadGeneralAgents:"加载通用智能体",loadAgentType:"加载 {{type}}",compatibility:{checking:"正在请求 Runtime /list-apps,以确认该智能体是否支持 Studio 对话。",empty:"Runtime /list-apps 未返回可用的 Agent,暂时无法连接对话。",supported:"Runtime 支持 Studio 对话。",unknownError:"Runtime /list-apps 请求失败,未返回可识别的错误信息。"},sandboxStatus:{ready:"就绪",wakeable:"已休眠",creating:"创建中",starting:"启动中",initializing:"启动中",pending:"等待中",running:"运行中",failed:"异常",error:"异常",stopped:"已停止",expired:"已过期",deleting:"删除中",deleted:"已删除",unknown:"未知状态"},wakingHint:"正在唤醒智能体,可能需要一些时间。",mpaCreate:{name:"名称",namePlaceholder:"例如 test-agent",nameHelp:"作为 Runtime 名称,支持 4–64 位字母、数字、下划线或连字符。",stepsLabel:"创建步骤",steps:{basics:"基本信息",postgres:"PostgreSQL",openviking:"OpenViking",autoPostgres:"数据库"},next:"下一步",previousStep:"上一步",pgDescription:"选择已有的 PostgreSQL 实例。创建流程会在该实例中准备智能体的独立业务库。",pgSplitDescription:"使用已配置的业务 PG Workspace。多个智能体共用此 Workspace,每个智能体拥有独立业务库。共享资源记录单独存放在 mpa_admin_workspace / mpa_admin_db,由管理员配置。",pgConsole:"前往火山引擎 AIDAP 创建或查看 PG Workspace",pgHost:"PG 主机地址",pgPort:"PG 端口",pgInvalid:"请填写有效的 PG 主机地址和端口。",pgCredentials:"PG 连接账号和密码由部署服务配置;主机和端口须与服务端配置一致。",openvikingDescription:"可选。三项全部填写才启用 OpenViking;全部留空则不向新智能体注入 OpenViking 配置。",openvikingConsole:"前往火山引擎查看 OpenViking 资源",openvikingUrl:"OpenViking 服务地址",openvikingResourceId:"OpenViking 资源 ID",openvikingApiKey:"OpenViking API Key",openvikingInvalid:"请同时填写有效的 HTTPS 服务地址、资源 ID 和 API Key,或全部留空。",openvikingCredentials:"API Key 仅用于本次创建,不保存到浏览器草稿;刷新页面后需重新填写。",tosTitle:"会话输出存储",tosDescription:"可选。填写完整的 TOS 凭证和存储桶,为新智能体的每个会话挂载独立输出目录。三项均留空时使用服务端预设;服务端未配置时,不启用 TOS 挂载。",tosAccessKey:"TOS Access Key",tosSecretKey:"TOS Secret Key",tosBucket:"TOS 存储桶",tosInvalid:"TOS Access Key、Secret Key 和存储桶必须同时填写。",tosCredentials:"凭证仅用于本次创建,不会保存在浏览器恢复数据或创建任务记录中。",runtimeImage:"MPA 镜像",workerImage:"Worker 镜像",imageDefault:"留空使用配置文件中的默认镜像",imageInvalid:"请输入有效的镜像地址,不要包含网址、空格或登录凭据。",title:"创建 MPA 智能体",agentId:"智能体 ID",description:"描述",region:"部署地域",plan:"创建计划",sharedResources:"准备或复用账号共享 VPC、子网和 APIG 消息网关",agentResources:"准备独立业务库、技能空间和执行环境,部署智能体",readiness:"检查网关和智能体就绪状态,成功后加入列表",checking:"正在检查创建配置…",configured:"创建配置已就绪。提交后会检查云资源并开始准备。",notConfigured:"尚未配置创建所需的资源参数,请联系管理员配置后重试。",loadFailed:"检查创建配置失败,请重试。",reload:"重新检查",submit:"开始创建",retry:"重试创建",newAgent:"新建另一个智能体",newAgentDescription:"新建另一个智能体将开启可编辑的新请求,替换当前恢复草稿,但不会取消旧任务。旧任务仍在运行时,请等待其结束后再提交。",close:"关闭",cancel:"取消创建",confirmCancel:"确认取消",cancelDescription:"取消后会停止后续步骤。已创建的数据库、技能空间、网关和其他已登记资源会保留,可使用同一智能体 ID 重试。",background:"关闭窗口后创建会继续。再次打开可查看进度。",pollFailed:"暂时无法获取进度,正在重新连接。请勿重复创建其他智能体。",creationFailed:"当前步骤未完成,请检查对应资源、服务端配置及权限后,用同一智能体 ID 重试。",cancelFailed:"取消请求失败,请重新查询进度后重试。",cancelled:"创建已取消,已登记资源保留供重试。",timeout:"创建超时,已登记资源保留。请检查对应资源后重试。",interrupted:"创建任务中断。请用同一智能体 ID 重试以恢复已登记资源。",skillSpace:"技能空间",states:{running:"正在创建",cancelling:"正在取消",succeeded:"创建成功",failed:"创建失败",cancelled:"已取消"},stages:{queued:"等待开始",checking:"检查账号与配置",network:"准备 VPC 和子网",gateway:"准备 APIG 和 IM Gateway",database:"准备业务数据库",skills:"准备技能空间",worker:"准备执行环境",deploying:"准备数据库、技能空间和 Runtime",verifying:"等待智能体就绪",admin_workspace:"准备管理 PG Workspace",business_workspace:"准备业务 PG Workspace",admin_database:"初始化共享管理库"},back:"继续创建",pgAutoDescription:"使用 VeADK 部署账号自动创建或复用两个 PG Workspace:mpa_admin_workspace / mpa_admin_db 存放共享资源记录,业务 Workspace 供多个智能体共用,每个智能体拥有独立业务库。无需填写 PG 连接信息,提交创建后开始准备。",pgModeChanged:"此创建任务使用旧的 PG 配置,不能直接切换为自动模式重试。请联系管理员确认已有资源和任务后重新创建。",pgMigrationRequired:"检测到旧共享注册库。请先将共享资源记录迁移到 mpa_admin_workspace / mpa_admin_db,并完成现有 Runtime 的注册库地址切换;完成后点击“重新检查”。"}},g1e={library:"技能库",skill:"技能",skills:"技能",skillSpace:"技能空间",sandboxNotConfigured:"管理员未配置 Dev Sandbox",adminNotConfigured:"管理员未配置",totalItems:"共 {{count}} 项",cannotLoadSpaces:"无法加载技能空间",someSpacesFailed:"部分技能空间加载失败",degradedRelationWarning:"部分关联异常,已恢复可读取技能",downloadZip:"下载 ZIP",optimize:"优化",closeSkillDetails:"关闭技能详情",skillId:"技能 ID",allFiles:"完整文件",loadingSkillContent:"正在读取技能内容…",noSkillContent:"该技能暂无 SKILL.md 内容",addSkill:"添加技能",localUpload:"本地上传",localUploadDescription:"选择 ZIP 文件,校验通过后上传到技能空间",autoCreate:"自动创建",autoCreateDescription:"选择模型和风格,通过对话生成技能",createSkill:"创建技能",optimizeNamed:"优化 {{name}}",deleteSkillConfirm:"确定删除整个 Skill“{{name}}”吗?此操作会影响所有引用它的空间。",deleteSpaceConfirm:"确定删除 Skill 空间“{{name}}”吗?请先确认空间中的技能已删除。",manageSpaceDescription:"管理空间中的技能并创建新的版本",backToSpaces:"返回技能空间列表",overview:"概览",skillCount:"技能数量",skillCountValue_one:"{{count}} 技能",skillCountValue_other:"{{count}} 技能",updatedAt:"更新时间",skillsInSpace:"{{name}}中的技能",searchSkills:"搜索技能",cannotLoadSkills:"无法加载技能",noMatchingSkills:"没有匹配的技能",noSkills:"暂无技能",tryAnotherName:"请尝试搜索其他名称",emptySkillsDescription:"本地上传 Skill,或自动创建",actions:"操作",spaceDetails:"技能空间详情",editSpace:"编辑空间",deleteSpace:"删除空间",searchSpaces:"搜索技能空间",spaceList:"技能空间列表",noMatchingSpaces:"没有匹配的技能空间",createSpace:"新建技能空间",newSpace:"新建空间",loadingMoreSpaces:"正在加载更多技能空间",scrollForMore:"继续下滑加载更多",allSpacesLoaded:"已加载全部技能空间",errors:{loadSpaces:"读取技能空间失败,请稍后重试",loadSkills:"读取技能失败,请稍后重试",loadSkillDetails:"读取技能详情失败,请稍后重试",deleteSkill:"删除 Skill 失败",deleteSpace:"删除 Skill 空间失败",downloadSkill:"下载 Skill 失败"},status:{active:"可用",available:"可用",creating:"创建中",disabled:"已停用",enabled:"已启用",failed:"异常",inactive:"未启用",pending:"等待中",published:"已发布",ready:"就绪",released:"已发布",running:"运行中",success:"正常",unavailable:"不可用",unreleased:"未发布",updating:"更新中",unknown:"未知"},sharedSpace:"企业共享空间",sharedDescription:"面向企业全员开放的技能,由管理员统一发布和维护",sharedVisibility:"全员可见",sharedPreparing:"正在准备共享空间",sharedLoadFailed:"共享空间加载失败",sharedEmpty:"暂无共享技能,管理员发布后会显示在这里",requestPublication:"申请公开",reviewSubmitting:"提交中…",reviewSubmitted:"已申请",reviewFailed:"申请公开失败",reviewStatusFailed:"审核状态加载失败",reviewRetry:"重新申请",reviewPending:"待审核",reviewApproving:"发布中",reviewApproved:"已公开",reviewReturned:"已退回",reviewHistory:"审核记录",skillDetailSections:"技能详情内容",versions:{title:"版本管理",refresh:"刷新",uploading:"上传中…",upload:"上传新版本",close:"关闭",hint:"新版本不会替换已公开版本,审核通过后才会公开;ZIP 中的技能名称需与原技能一致",loading:"正在加载版本…",loadFailed:"无法加载版本",filesFailed:"无法加载版本文件",uploadFailed:"上传新版本失败",submitFailed:"提交申请失败",retry:"重试",empty:"暂无版本",current:"当前版本",notSubmitted:"未申请公开",submitting:"提交中…",submit:"申请公开",processing:"版本状态:{{status}}",filesLoading:"正在加载文件…",filesEmpty:"暂无文件",history:"历史审核记录",shared:"已公开"},author:"作者",authorName:"作者:{{name}}"},b1e={library:"知识库",createBase:"新建知识库",editBase:"编辑知识库",invalidName:"名称必须以字母开头,且只能包含字母、数字和下划线。",nameHelp:"以字母开头,仅支持字母、数字和下划线,最多 48 个字符。",optionalDescription:"描述(可选)",descriptionOnly:"AgentKit 当前仅支持更新知识库描述。",previewWeb:"预览网页内容",addData:"添加数据",openOriginalWeb:"打开原网页",backToEdit:"返回修改",confirmAdd:"确认添加",source:"知识来源",image:"图片",documentFile:"文档文件",webPage:"在线网页",webUrl:"网页 URL",generatingWebPreview:"正在抓取网页并生成 Markdown 预览",selectFile:"选择知识文件",selectOrDropFile:"选择文件或拖拽到这里",selectedFile:"{{size}} · 点击可重新选择",imageFileHelp:"支持 PNG、JPG 和 JPEG,单个文件不超过 200 MB",documentFileHelp:"支持 PDF、PPTX、DOCX、XLSX 和 TXT,单个文件不超过 200 MB",uploadingFile:"正在上传文件并添加到知识库",optionalName:"名称(可选)",optionalType:"类型(可选)",generatePreview:"生成预览",uploadFile:"上传文件",editMetadata:"编辑知识 Metadata",knowledge:"知识",field:"字段",value:"值",backToList:"返回知识库列表",metadataJson:"元数据(JSON)",provider:"服务提供方",knowledgeId:"知识库 ID",project:"项目",creator:"创建者",data:"数据",deleteInvalidAssociation:"删除失效关联",noData:"这个知识库还没有数据",addFirstData:"添加第一项数据",format:"格式",size:"大小",searchData:"搜索数据",searchLibraryData:"搜索知识库数据",associationInvalid:"关联已失效",providerMissing:"底层 Provider 知识库已不存在",noMatchingData:"没有匹配的数据",loadingMoreData:"正在加载更多数据",retryLoading:"重试加载",details:"知识库详情",searchBases:"搜索知识库",someBasesFailed:"部分知识库暂时无法加载,已展示其余可用内容。",noMatchingBases:"没有匹配的知识库",noManagePermission:"您没有管理此知识库的权限",loadingMoreBases:"正在加载更多知识库",deleteBaseTitle:"删除知识库?",deleteBaseDescription:"将删除 {{name}} 的 AgentKit 关联;如果它由 Studio 创建,也会同时删除 Provider 资源。此操作无法撤销。",deleteDocumentTitle:"删除知识?",deleteDocumentDescription:"将从 Provider 知识库中删除 {{name}},此操作无法撤销。",preview:{processingTitle:"数据正在处理中",processingDetail:"知识库完成解析后即可预览,请稍后重新加载。",failedTitle:"数据解析失败",failedDetail:"请检查源文件或网页地址后重新添加,也可以重新加载最新状态。",noParsedTitle:"暂时没有可预览的解析内容",noParsedDetail:"此类文件会在知识库完成解析后显示文本、表格或页面图片。",noMediaTitle:"暂时没有可预览的媒体内容",noMediaDetail:"知识库尚未返回可访问的媒体预览,请稍后重新加载。",noDataTitle:"暂无可预览的数据内容",noDataDetail:"知识库尚未返回解析结果,请稍后重新加载。",attachmentError:"附件无法预览,请稍后重试。",imageAlt:"知识数据图片",audioUnsupported:"当前浏览器不支持音频预览。",videoUnsupported:"当前浏览器不支持视频预览。",namedPdf:"{{name}} PDF 预览",pdf:"PDF 预览",openPdf:"无法显示时,在新窗口打开 PDF",fileUnsupported:"当前格式暂不支持直接在线预览,已优先显示解析后的内容。",openOriginalFile:"打开原文件",loading:"正在加载数据预览",openOriginalHint:"您可以打开原网页查看来源内容。",chunk:"片段 {{index}}",loadingMore:"正在加载更多",loadMore:"加载更多"},errors:{fileTooLarge:"单个文件不能超过 200 MB",invalidImageType:"请选择 PNG、JPG 或 JPEG 图片",invalidDocumentType:"请选择 PDF、PPTX、DOCX、XLSX 或 TXT 文件",createBase:"创建知识库失败",updateBase:"更新知识库失败",metadataObject:"Metadata 必须是 JSON 对象",metadataFormat:"Metadata 格式错误",noWebPreview:"网页没有可预览的 Markdown 内容",addWeb:"添加网页失败",previewWeb:"生成网页预览失败",uploadFile:"上传文件失败",updateDocument:"更新知识失败",loadPreview:"加载数据预览失败",loadMoreBases:"加载更多知识库失败",loadBases:"加载知识库失败",loadMoreData:"加载更多数据失败",loadData:"加载数据失败",deleteBase:"删除知识库失败",deleteDocument:"删除知识失败"}},y1e={title:"飞书渠道",refresh:"刷新",loading:"正在加载渠道配置…",unsupported:"此 Runtime 不支持渠道管理,请升级 MPA 镜像。",unauthorized:"渠道管理需要 Studio 管理员身份及有效的 Runtime 凭据。",configurationError:"渠道管理配置不完整,请检查 Runtime 元数据及加密密钥。",requestFailed:"渠道请求失败,请检查 Runtime 连接后重试。",bound:"已绑定:{{name}}",unbound:"尚未绑定飞书机器人。",guidance:"私聊使用独立会话。在已授权群内 @ 当前机器人即可对话。",keyRequired:"绑定前请在 Runtime 配置持久的 CHANNEL_STATE_ENCRYPTION_KEY。",gateway:"消息网关",route:"入站路由",delivery:"回复投递",configured:"已配置",missing:"未配置",delivery_not_observed:"尚未观测",delivery_delivered:"已投递",delivery_retrying:"重试中",missingConfig:"缺少 Runtime 配置:{{fields}}",bind:"扫码绑定",newQr:"重新生成二维码",unbind:"解除绑定",confirmUnbind:"确认解绑此机器人?解绑后将停止接收新消息。",qrAlt:"机器人绑定二维码",openQr:"打开授权页面",uncertain:"注册过程已中断。重新开始前,请检查机器人绑定与 Gateway 状态。",bindingFailed:"绑定失败,请检查 Gateway 配置后重试。",chatId:"允许的群 ID",scope:"群会话策略",saveGroup:"保存群权限",noGroups:"尚未授权任何群。私聊无需群权限。",edit:"编辑",remove:"移除",removeGroup:"移除 {{name}}",scope_group_sender:"按发言人隔离",scope_group:"全群共享",scope_group_topic_sender:"按话题和发言人隔离",scope_group_topic:"按话题共享",status_PENDING:"等待扫码",status_SCANNED:"已扫码,等待授权",status_AUTHORIZED:"已授权,准备注册",status_REGISTERING:"正在注册机器人",status_BOUND:"机器人已绑定",status_FAILED:"绑定失败",status_EXPIRED:"二维码已过期",workspaceTitle:"消息渠道",workspaceDescription:"连接消息平台,让用户直接与此智能体对话,并管理访问权限。",provider_feishu:"飞书",provider_wecom:"企业微信",provider_dingtalk:"钉钉",comingSoon:"暂未开放",unavailableDescription:"{{name}}的绑定与消息配置暂未开放。",runtimeRequired:"请先将此智能体部署到 Runtime,再配置消息渠道。",bindingTitle:"机器人绑定",connected:"已绑定",notBound:"未绑定",gatewayDescription:"用于接收渠道消息的网关配置。",routeDescription:"将渠道消息转发给当前智能体的路由配置。",deliveryDescription:"实际观测到的回复投递状态,完成配置不代表已成功投递。",groupsTitle:"群聊权限",groupsDescription:"添加允许访问的群,并设置群内对话的共享范围。",providerBindingTitle:"绑定{{name}}",providerUnbound:"绑定{{name}}机器人,让用户通过消息与此智能体对话。",qrGuidance:"使用{{name}}扫码授权,Runtime 将保存机器人凭据并配置消息网关。",wecomGuidance:"使用企业微信扫码授权,或手动填写 Bot ID 和 Secret 绑定已有机器人。",wecomBotId:"Bot ID",wecomSecret:"Secret",bindCredentials:"绑定机器人",wecomScan:"扫码绑定",wecomAuthorizing:"等待企业微信授权…",cancelAuthorization:"取消授权",wecomPopupBlocked:"授权窗口被浏览器拦截,请允许弹窗后重试。",wecomAuthCancelled:"已取消企业微信授权,可以重新扫码。",wecomAuthTimeout:"企业微信授权已超时,请重新扫码。",wecomInvalidResult:"授权结果缺少 Bot ID 或 Secret,请重新授权或手动填写。",wecomAuthFailed:"企业微信授权失败,请重试或手动填写凭据。",dingtalkClientId:"Client ID",dingtalkClientSecret:"Client Secret",manualUpgrade:"当前镜像尚不支持{{name}}手动配置,请升级后使用;仍可使用极速配置。",pairingTitle:"消息渠道扫码配对",feishuPairingDescription:"如果已有连接机器人,飞书扫码并绑定成功后原有机器人会被替换,可选绑定存量机器人或新建机器人。",generatingQr:"正在生成配对二维码…",dingtalkGuidance:"使用钉钉扫码授权,或手动填写 Client ID 和 Client Secret 绑定已有机器人。",wecomPairingDescription:"将在企业微信授权窗口中重新扫码配对。新机器人绑定成功后会替换当前连接;取消授权或绑定失败不会解绑原机器人。",configurationMethod:"配置方式",quickSetup:"极速配置",manualSetup:"手动配置",feishuAppId:"App ID",feishuAppSecret:"App Secret",manualGuidance:"填写已有{{name}}机器人的应用凭据,连接到当前智能体。",manualReplacement:"绑定成功后将替换当前机器人;取消或绑定失败不会解除现有绑定。"},WVe={common:Xwe,agentKitPromo:Ywe,systemInfo:Zwe,agentWorkspace:Jwe,environmentCenter:e1e,deploymentSelect:t1e,deploymentError:n1e,studioBuildProgress:i1e,cloudEnvironment:r1e,githubCicd:s1e,feishuDeployment:a1e,deploymentResources:o1e,studioUpdate:l1e,projectPreview:c1e,workspace:u1e,resourceCollection:d1e,skillSourcePicker:f1e,composer:h1e,agentSelector:p1e,myAgents:m1e,skillCenter:g1e,knowledge:b1e,channels:y1e},KVe=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:Ywe,agentSelector:p1e,agentWorkspace:Jwe,channels:y1e,cloudEnvironment:r1e,common:Xwe,composer:h1e,default:WVe,deploymentError:n1e,deploymentResources:o1e,deploymentSelect:t1e,environmentCenter:e1e,feishuDeployment:a1e,githubCicd:s1e,knowledge:b1e,myAgents:m1e,projectPreview:c1e,resourceCollection:d1e,skillCenter:g1e,skillSourcePicker:f1e,studioBuildProgress:i1e,studioUpdate:l1e,systemInfo:Zwe,workspace:u1e},Symbol.toStringTag,{value:"Module"})),v1e="用户管理",x1e="{{count}} 位成员",w1e="用户",O1e="角色",k1e="账号状态",S1e="最近登录",E1e="操作",C1e="更改角色",A1e="关闭",T1e="保存角色",_1e="正在保存…",j1e="取消",N1e="返回",R1e="用户池",I1e="火山引擎 Identity",P1e="搜索姓名、邮箱或用户 ID",D1e="搜索",M1e="筛选角色",L1e="全部角色",$1e="刷新",F1e="正在读取用户…",B1e="更新于 {{time}}",U1e="已将 {{name}} 设置为{{role}}",Q1e="重试",z1e="你",V1e="初始超级管理员",H1e="初始超级管理员受保护,不能在此降级",q1e="保存后,对方刷新 Studio 即可使用新的权限",W1e="角色需要重新确认",K1e="没有匹配的用户",G1e="尝试其他关键词或角色",X1e="用户登录或加入当前用户池后会显示在这里",Y1e="共 {{count}} 位用户",Z1e="上一页",J1e="下一页",eOe="尚未登录",tOe="未提供",nOe={super_admin:"超级管理员",admin:"管理员",developer:"开发者",user:"普通用户"},iOe={super_admin:"管理所有资源,并管理用户和分配角色",admin:"管理 Studio 资源",developer:"开发智能体并管理自己的资源",user:"使用智能体和个人功能"},rOe={EXTERNAL_PROVIDER:"正常",CONFIRMED:"正常",NORMAL:"正常",ENABLED:"正常",ACTIVE:"正常",UNCONFIRMED:"待验证",DISABLED:"已停用",FORBIDDEN:"已禁用",LOCKED:"已锁定",SUSPENDED:"已暂停",FORCE_CHANGE_PASSWORD:"需要修改密码"},sOe={request_failed:"请求未完成,请刷新列表确认当前状态后重试",invalid_response:"用户服务返回异常,请刷新后重试",identity_unavailable:"暂时无法访问 Identity,请稍后重试或检查服务权限",identity_resource_missing:"用户或用户池已不存在,请刷新列表",super_administrator_required:"只有超级管理员可以管理用户",sign_in_required:"请登录后重试",user_not_in_pool:"当前账号不属于此用户池",user_disabled:"当前账号已停用",protected_administrator:"不能降低初始超级管理员的权限",cannot_demote_self:"不能降低自己的超级管理员权限",role_change_conflict:"角色已发生变化,请关闭弹窗并刷新列表后重试",cross_origin_request:"请在当前 Studio 页面内修改角色"},GVe={title:v1e,memberCount:x1e,user:w1e,role:O1e,status:k1e,lastLogin:S1e,actions:E1e,changeRole:C1e,close:A1e,save:T1e,saving:_1e,cancel:j1e,back:N1e,pool:R1e,volcengineIdentity:I1e,searchPlaceholder:P1e,search:D1e,filterRole:M1e,allRoles:L1e,refresh:$1e,loading:F1e,updatedAt:B1e,saved:U1e,retry:Q1e,you:z1e,initialAdministrator:V1e,protectedExplanation:H1e,effectiveAfterRefresh:q1e,roleConflict:W1e,noUsers:K1e,tryAnotherSearch:G1e,poolEmpty:X1e,resultCount:Y1e,previous:Z1e,next:J1e,neverLoggedIn:eOe,unknown:tOe,roles:nOe,descriptions:iOe,states:rOe,errors:sOe},XVe=Object.freeze(Object.defineProperty({__proto__:null,actions:E1e,allRoles:L1e,back:N1e,cancel:j1e,changeRole:C1e,close:A1e,default:GVe,descriptions:iOe,effectiveAfterRefresh:q1e,errors:sOe,filterRole:M1e,initialAdministrator:V1e,lastLogin:S1e,loading:F1e,memberCount:x1e,neverLoggedIn:eOe,next:J1e,noUsers:K1e,pool:R1e,poolEmpty:X1e,previous:Z1e,protectedExplanation:H1e,refresh:$1e,resultCount:Y1e,retry:Q1e,role:O1e,roleConflict:W1e,roles:nOe,save:T1e,saved:U1e,saving:_1e,search:D1e,searchPlaceholder:P1e,states:rOe,status:k1e,title:v1e,tryAnotherSearch:G1e,unknown:tOe,updatedAt:B1e,user:w1e,volcengineIdentity:I1e,you:z1e},Symbol.toStringTag,{value:"Module"})),aOe="网站集成",oOe="将 AgentKit Runtime 以悬浮聊天窗口嵌入网站",lOe="返回自动化列表",cOe="添加网站",uOe="正在加载 Runtime",dOe="选择 Runtime",fOe="网站域名",hOe="例如 xxxx.com 或 localhost:5173",pOe="正在生成",mOe="生成 Token",gOe="已添加网站",bOe="{{count}} 个",yOe="{{count}} 个",vOe="正在加载网站集成",xOe="还没有网站集成",wOe="选择 Runtime 并输入网站域名即可生成 Token",OOe="引入方法",kOe="将下面代码放到网页的 body 结束标签前",SOe="已复制",EOe="复制代码",COe="添加网站后会在这里生成引入代码。",AOe="确定删除 {{domain}} 的网站集成吗?",TOe={load:"加载网站集成失败",create:"创建网站集成失败",delete:"删除网站集成失败",noConversationalAgent:"该 Runtime 暂未发现可对话的 Agent"},_Oe={requestFailed:"请求失败 ({{status}})",greeting:"您好,有什么可以帮您?",sessionFailed:"无法建立对话会话",unauthorized:"当前网站未获得对话授权",conversationFailed:"对话请求失败,请稍后重试",open:"打开智能体对话",close:"关闭智能体对话",panelLabel:"智能体对话面板",assistant:"智能体助手",online:"在线对话"},YVe={title:aOe,description:oOe,backToAutomations:lOe,addWebsite:cOe,loadingRuntime:uOe,selectRuntime:dOe,websiteDomain:fOe,domainPlaceholder:hOe,generating:pOe,generateToken:mOe,addedWebsites:gOe,websiteCount_one:bOe,websiteCount_other:yOe,loadingIntegrations:vOe,delete:"删除",emptyTitle:xOe,emptyDescription:wOe,embedMethod:OOe,embedInstructions:kOe,copied:SOe,copyCode:EOe,embedHint:COe,confirmDelete:AOe,errors:TOe,widget:_Oe},ZVe=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:cOe,addedWebsites:gOe,backToAutomations:lOe,confirmDelete:AOe,copied:SOe,copyCode:EOe,default:YVe,description:oOe,domainPlaceholder:hOe,embedHint:COe,embedInstructions:kOe,embedMethod:OOe,emptyDescription:wOe,emptyTitle:xOe,errors:TOe,generateToken:mOe,generating:pOe,loadingIntegrations:vOe,loadingRuntime:uOe,selectRuntime:dOe,title:aOe,websiteCount_one:bOe,websiteCount_other:yOe,websiteDomain:fOe,widget:_Oe},Symbol.toStringTag,{value:"Module"})),jOe={types:{all:"全部类型",document:"文档",image:"图片",video:"视频"},previewArtifact:"预览 {{name}}",moreActions:"更多操作 {{name}}",actionMenu:"{{name}} 操作",download:"下载",downloading:"下载中",edit:"编辑信息",delete:"删除产物",previewFailed:"无法预览“{{name}}”:{{message}}",downloadStarted:"已开始下载 {{name}}",downloadFailed:"无法下载“{{name}}”:{{message}}",updated:"已更新 {{name}}",deleted:"已删除 {{name}}",deleteFailed:"无法删除“{{name}}”:{{message}}",typeFilter:"产物类型",searchAria:"搜索产物",searchPlaceholder:"搜索产物或会话",retry:"重试",close:"关闭",listAria:"产物列表",loadFailed:"产物加载失败",loadDetailFallback:"请检查存储配置后重试。",reload:"重新加载",noMatch:"没有找到匹配的产物",noArtifacts:"您还没有任何产物",searchHint:"请尝试搜索其他名称或切换类型",emptyHint:"聊天中生成的产物会自动显示在这里",columns:{name:"名称",source:"来源",updatedAt:"修改时间",actions:"操作"},loadingMore:"正在加载更多产物",unknownTime:"时间未知",preview:{close:"关闭预览",meta:"{{type}} / 版本 {{version}}",loading:"正在加载预览",alt:"{{name}} 预览",loadFailed:"预览加载失败,请稍后重试或下载查看",unsupported:"当前格式暂不支持在线预览,请下载查看",sourceAria:"产物来源",agent:"智能体",session:"会话",tool:"生成工具",createdAt:"生成时间",fileSize:"文件大小",tags:"标签",viewSession:"查看会话"},deleteDialog:{title:"删除产物?",description:"“{{name}}”将从产物库永久删除,聊天记录不会受到影响。",deleting:"删除中",confirm:"删除",close:"关闭删除确认框"},api:{withStatus:"{{message}}({{status}})",listFailed:"读取产物库失败",syncFailed:"同步聊天产物失败",updateFailed:"更新产物失败",deleteFailed:"删除产物失败",downloadFailed:"下载产物失败"}},NOe={unknownSource:"未知来源",unknownCreator:"未知创建者"},ROe={nameRequired:"请输入产物名称",tooManyTags:"标签最多 {{max}} 个",tagTooLong:"单个标签不能超过 {{max}} 个字符",title:"编辑产物信息",subtitle:"内容文件不会被修改",close:"关闭编辑框",name:"名称",description:"描述",descriptionPlaceholder:"补充用途、版本或使用说明",tags:"标签",tagsPlaceholder:"使用逗号分隔,最多 {{max}} 个",cancel:"取消",saving:"保存中",save:"保存"},IOe={change:{added:"新增",modified:"修改",deleted:"删除"},noChanges:"两个版本的源码没有差异",chooseFile:"从左侧选择文件以查看代码",compareTitle:"版本对比",workspaceTitle:"源码工作区",projectFallback:"Agent 项目",switchTheme:"切换源码主题",switchThemeTitle:"切换为{{theme}}主题",themes:{dark:"深色",light:"浅色"},closeWorkspace:"关闭源码工作区",close:"关闭",changedFiles:"变更文件",projectFiles:"项目文件",changes:"变更",files:"文件",openFiles:"打开的文件",noFileSelected:"未选择文件",comparisonDirection:"对比方向",before:"优化前",after:"优化后",loadingEditor:"正在加载编辑器…",changedFileCount_one:"{{count}} 个文件有变更",changedFileCount_other:"{{count}} 个文件有变更",fileCount_one:"{{count}} 个文件",fileCount_other:"{{count}} 个文件",lineCount_one:"{{count}} 行 · UTF-8",lineCount_other:"{{count}} 行 · UTF-8",viewSource:"查看源码",viewSourceAria:"查看和编辑项目源码"},POe={nav:"搜索",selectAgent:"请选择 Agent",checkingCapabilities:"正在检测 Agent 能力",notMounted:"当前 Agent 未挂载{{label}}",sources:{session:"会话",web:"网络",knowledge:"知识库",memory:"长期记忆"},webDescription:"通过 web_search 工具检索",backendLocal:"本地",failed:"搜索失败:{{message}}",placeholder:{selectAgent:"请先选择 Agent",web:"在网络中检索",knowledge:"在 {{name}} 中检索",knowledgeFallback:"当前 Agent 的知识库",memory:"在 {{name}} 中检索",memoryFallback:"当前用户的长期记忆",session:"在当前 Agent 的会话中检索"},sourceTypeAria:"搜索类型:{{label}}",notSelected:"未选择",sourceType:"搜索类型",selectSource:"选择搜索类型",noAgentHint:"选择一个 Agent 后,即可检索会话、网络及其挂载的数据源。",loadingCapabilities:"正在读取当前 Agent 的检索能力…",sourceUnavailable:"当前 Agent 未挂载该数据源",instructions:{web:"输入关键词后回车或点击按钮,通过 web_search 工具检索。",knowledge:"输入问题,检索当前 Agent 挂载的知识库。",memory:"输入线索,检索当前用户跨会话保存的长期记忆。",session:"输入关键词后回车或点击按钮,搜索当前 Agent 的会话。"},noResults:"未找到匹配“{{query}}”的结果。",knowledgeFragment:"知识片段 {{index}}",memoryFragment:"记忆片段 {{index}}"},DOe={title:"开发者资源",sections:{documentation:{title:"相关链接",description:"查看开发文档与 AgentKit 常用入口"},bestPractices:{title:"最佳实践",description:"参考开发、调试与部署经验"},showcases:{title:"案例展示",description:"探索 AgentKit 应用案例"}},links:{veadkDocs:"VeADK 文档",cliDocs:"AgentKit CLI 文档",platformDocs:"AgentKit 平台文档",console:"AgentKit 控制台"},articles:{veadkDevelopment:{title:"使用 VeADK 开发并部署智能体",description:"使用 VeADK 构建 Agent,并部署至 AgentKit 智能体运行时。"},cliDevelopment:{title:"使用 AgentKit CLI 开发并部署智能体",description:"通过 AgentKit CLI 创建项目、调试 Agent,并完成部署。"},coverAlt:"{{title}}文章封面"},showcases:{researchAssistant:{title:"多智能体研究助手",description:"由多个专业 Agent 协同完成资料检索、分析和结论整理。"},multimodalAnalysis:{title:"多模态内容分析",description:"在统一会话中理解图片、文档和视频内容。"},customerService:{title:"智能客服工作台",description:"结合知识检索与工具调用处理复杂的客户服务任务。"},webSearch:{title:"联网搜索 Agent",description:"检索实时网页内容,并将信息整理为可追溯的回答。"},a2uiApp:{title:"A2UI 交互应用",description:"让 Agent 根据任务过程生成可交互的前端界面。"},previewAlt:"{{title}}界面预览"}},MOe={title:"资源库",untitledSession:"未命名会话",categoryAria:"资源库分类",regionAria:"区域",tabs:{skills:"技能库",knowledge:"知识库",artifacts:"产物"}},LOe={title:"管理 Agent",subtitle:"列出你有权管理的 AgentKit Runtime",mainAgentOnly:"仅显示主 Agent(控制面信息)。",deleteConfirm:'确定删除 Agent "{{name}}"?该 Runtime 将被永久删除。',regionFilterTitle:"按区域筛选",regionFilterAria:"区域筛选",regionAria:"区域",refresh:"刷新",loading:"加载中…",empty:"暂无你部署的 Agent。",connected:"已连接",connect:"连接到此 Agent",deleteRuntime:"删除该 Runtime",loadingDetail:"读取详情…",agentStructure:"Agent 结构",secretHidden:"敏感值不展示,可通过授权请求直接复制",revealSecret:"{{key}} 的敏感值",copySecret:"复制 {{key}} 的值",copy:"复制",copied:"已复制",copyFailed:"复制失败",notConfigured:"未配置",fields:{model:"模型",description:"描述",status:"状态信息",project:"项目",version:"版本",resources:"资源",memory:"记忆",tool:"工具",knowledge:"知识",mcpToolset:"MCP 工具集",updatedAt:"更新时间"},resource:{memory:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",concurrency:"并发 {{value}}"},environmentVariables:"环境变量",unnamed:"(未命名)"},$Oe={mainAgent:"主 Agent",subAgent:"子 Agent {{index}}",itemCount_one:"{{count}} 项",itemCount_other:"{{count}} 项",info:"Agent 信息",infoAndTopology:"Agent 信息与设置",loadingInfo:"正在读取 Agent 信息…",unnamedAgent:"未命名 Agent",agentsMd:"AGENTS.md",tools:"工具",toolList:"工具列表",studioTool:"Studio Tool",removeTool:"移除工具 {{name}}",remove:"移除",notConfigured:"未配置",addStudioTool:"添加 Studio 工具",addStudioToolHere:"在此对话中添加 Studio 工具",skills:"技能",skillList:"技能列表",addSkill:"添加技能空间技能",addSkillHere:"向此会话添加技能空间技能",skillMountNextTurn:"挂载的版本将在下一 Turn 开始时冻结。",previewUnsupported:"暂不支持预览",sessionEnvironment:"会话环境",environment:"环境",agentCanvas:"Agent 画布",topology:"结构拓扑",nodeKinds:{agent:"Agent",sandbox:"沙箱","worker-session":"Worker 会话","skill-space":"技能空间",skill:"技能","studio-tool":"Studio 工具",mcp:"MCP",environment:"环境",knowledge:"知识库","sub-agent":"子 Agent"},nodeStatuses:{configured:"已配置",mounted:"已挂载",running:"运行中",paused:"已暂停"},viewCanvasFullscreen:"全屏查看 Agent 画布",viewFullscreen:"全屏查看",executionCanvas:"Agent 执行画布",fullscreenExecutionCanvas:"全屏 Agent 执行画布",closeFullscreenCanvas:"关闭全屏画布",close:"关闭",capabilitiesSubtitle:"能力与协作拓扑",closeInfo:"关闭 Agent 信息",infoUnavailable:"暂时无法读取 Agent 信息。",refresh:"刷新信息",loadingSkills:"正在加载绑定技能…",sessionSkills:"本会话临时技能",noBoundSpace:"当前智能体未绑定技能空间。",noBoundSkills:"绑定的技能空间暂无技能。",loadFailed:"加载失败,请刷新重试。",accessDenied:"无权读取此信息。",documentUnsupported:"当前 Runtime 不支持 Studio 读取 AGENTS.md,请升级 Runtime 镜像。",skillsUnsupported:"当前 Runtime 未提供技能空间绑定信息。",skillsDegraded:"技能信息不完整,请刷新重试。",documentEditHint:"编辑最新版本。保存会发布新版本到此技能空间,可能影响使用它的其他智能体。运行中的会话可能需要等待缓存刷新或新建会话后生效。请保留 frontmatter 中的 name。",documentLoading:"正在加载 SKILL.md…",documentWritable:"可编辑",documentReadOnly:"只读:此空间或当前权限不允许编辑",documentLoadFailed:"无法加载 SKILL.md,请刷新重试。",documentSaveFailed:"未确认保存成功,已保留编辑内容。重试前请重新打开,检查当前版本。",documentConflict:"技能已有新版本。请复制当前修改,再重新打开编辑器,避免覆盖。",discardDocument:"放弃未保存的修改?",keepEditing:"继续编辑",discardChanges:"放弃修改",saveDocument:"保存为新版本"},FOe={mountFailed:"挂载环境失败",closeDialog:"关闭环境弹窗",addTitle:"添加环境",description:"选择当前会话允许 Agent 使用的 Sandbox 环境",closeAdd:"关闭添加环境",searchAria:"搜索环境",searchPlaceholder:"搜索环境名称或能力",availableAria:"可用环境与工作区",loading:"正在读取可用环境…",noMatch:"没有匹配的环境或工作区",workspaces:"工作区",reuseAll:"复用工作区中的全部可用环境",availableEnvironmentCount_one:"{{count}} 个可用环境",availableEnvironmentCount_other:"{{count}} 个可用环境",selectWorkspace:"选择工作区 {{name}}",environments:"环境",includedByWorkspaces:"已由工作区 {{names}} 包含",nameSeparator:"、",selectEnvironment:"选择环境 {{name}}",selectedWorkspaceCount_one:"{{count}} 个工作区",selectedWorkspaceCount_other:"{{count}} 个工作区",coveredEnvironmentCount_one:"{{count}} 个环境",coveredEnvironmentCount_other:"{{count}} 个环境",selectionSummary:"已选择 {{workspaces}},覆盖 {{environments}}",cancel:"取消",mounting:"正在挂载…",confirm:"确认添加",mountedAria:"已挂载环境",environmentCount_one:"{{count}} 个环境",environmentCount_other:"{{count}} 个环境",removeWorkspace:"移除工作区 {{name}}",remove:"移除",removeEnvironment:"移除环境 {{name}}",add:"添加环境",addMore:"添加更多环境",addForSession:"为当前 Session 添加环境",loadingAvailable:"正在加载可用环境…",empty:"暂无可用的 AIO Sandbox 环境。"},BOe={loading:{searching:"正在查找已有环境",creating:"环境初始化中",connecting:"正在连接已有环境"},initializationFailed:"AgentKit CLI 环境初始化失败,当前状态:{{status}}。",sessionExpired:"AgentKit CLI Session 不存在或已过期,请重试。",initializationTimeout:"AgentKit CLI 环境初始化超时,请稍后重试。",nonPersistent:"非持久化环境",recyclingHoursMinutes:"{{hours}} 小时 {{minutes}} 分钟后环境回收",recyclingMinutes:"{{minutes}} 分钟后环境回收",connectionError:`无法连接 Studio 服务,未收到服务端响应。 +{{value}}`,original:"原始错误:{{message}}",details:"详细信息"},Hwe={ariaLabel:"Skill 文件树",viewSource:"查看源码",viewPreview:"查看预览",download:"下载",binaryFile:"二进制文件",bytes:"{{value}} 字节",binaryDescription:"当前接口仅返回文件元数据,可单独下载原文件。",metadata:"Skill 元数据",noFiles:"暂无文件"},qwe={close:"关闭",name:"名称",region:"地域",optionalDescription:"描述(可选)",cancel:"取消",create:"创建",creating:"创建中…",save:"保存",saving:"保存中…",upload:"上传",uploading:"上传中…",createSpaceTitle:"新建 Skill 空间",editSpaceTitle:"编辑 Skill 空间",uploadTitle:"上传到 {{name}}",createSpaceFailed:"创建 Skill 空间失败",updateSpaceFailed:"更新 Skill 空间失败",archiveValidationFailed:"Skill ZIP 格式校验失败",uploadFailed:"上传 Skill 失败",dropzone:"拖拽 Skill ZIP 到这里",chooseLocalFile:"或点击选择本地文件",archiveHelp:"ZIP 根目录需要包含 SKILL.md,也可以只包含一层包装目录。选择后仅检查格式,不会自动上传。",validating:"正在检查文件格式…",validationPassed:"格式检查通过:{{name}},共 {{count}} 个文件"},Wwe={styles:{concise:"简洁实用",strict:"严谨稳健",tutorial:"教程友好",automation:"自动化优先",custom:"自定义",customFallback:"自定义风格"},stages:{preparing:"正在准备 Dev Sandbox",ready:"Skill 已生成并通过格式校验",failed:"生成失败",cancelled:"已停止",validating:"正在校验 Skill 格式",packaging:"正在整理文件",generating:"正在生成 Skill",repairingAgain:"正在再次修复",autoRepairing:"正在自动修复({{attempt}}/{{max}})"},validation:{fallback:"Skill 格式校验未通过",repairInstruction:"只修复下面列出的 Skill 格式错误,不要改变原有用途和内容范围。",recheckInstruction:"修复后重新检查目录结构、SKILL.md frontmatter 和所有文本文件。",nameTooLong:"Skill 名称不能超过 64 个字符",invalidName:"Skill 名称只能包含小写字母、数字和连字符",modelTooLong:"模型 ID 不能超过 128 个字符",invalidModel:"模型 ID 只能包含字母、数字、点、下划线、连字符、斜杠和冒号"},errors:{loadCapability:"读取 Dev Sandbox 配置失败",autoRepair:"自动修复格式错误失败",pollCandidate:"读取候选方案状态失败,正在重试",createCandidate:"创建候选方案失败",refine:"继续调整失败",repairAgain:"再次修复格式错误失败",selectSpace:"请选择上传的 Skill Space",unsupportedRegion:"当前 Skill 地域不受支持",upload:"上传 Skill 失败",download:"下载失败"},sessionMax:"Session 最长保留 1 小时",remaining:"剩余 {{minutes}}:{{seconds}}",unnamedSpace:"未命名 Skill Space",leaveConfirmation:"离开后将停止并释放正在运行的 Dev Sandbox,确定离开吗?",createTitle:"创建技能",optimizeTitle:"优化 {{name}}",skillFallback:"技能",back:"返回技能空间",home:"主页技能生成",basicInfo:"基本信息",goal:"目标",createIntentPlaceholder:"描述希望这个 Skill 完成什么任务",optimizeIntentPlaceholder:"描述希望如何优化当前 Skill",skillName:"Skill 名称",autoNamePlaceholder:"留空时自动生成",nameHelp:"仅支持小写字母、数字和连字符;留空时自动生成。",createPlans:"生成方案",optimizePlans:"优化方案",createPlansDescription:"按不同方案并行生成多个技能,您可以选择最佳结果",optimizePlansDescription:"按不同方案并行优化当前技能,您可以选择最佳结果",plan:"方案 {{count}}",remove:"移除",model:"模型",modelPlaceholder:"选择或输入模型 ID",style:"风格",customStyle:"自定义风格",customStylePlaceholder:"描述表达方式、严谨程度或输出偏好",addConfiguration:"添加配置",notConfigured:"管理员未配置",generate:"生成",candidates:"候选方案",progress:"进度",retryCandidate:"重试此方案",formatValidationFailed:"格式校验未通过",repairAgain:"再次修复",files:"文件",downloadZip:"下载 ZIP",loadingFiles:"正在读取文件…",filesPending:"生成过程中会在这里显示完整文件树",uploadToSpace:"上传到 Skill Space",loadingSpaces:"正在加载 Skill Space",selectSpace:"选择 Skill Space",continuePlaceholder:"继续调整这个候选方案",continue:"继续调整",uploading:"上传中…",overwrite:"覆盖原 Skill",uploadToSelectedSpace:"上传到 Skill Space",uploadToCurrentSpace:"上传到当前空间",allCandidatesFailed:"所有方案均创建失败,可分别重试。"},Kwe={invalidFormat:"{{label}}格式错误。",recoveryStatus:"Skill 恢复点状态",errorResponse:"错误响应",errorDetails:"错误详情",missingContentType:"Content-Type 缺失",gatewayError:"{{fallback}}(HTTP {{status}},Content-Type: {{contentType}})。请检查代理或网关配置。",nonJson:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}},Content-Type: {{contentType}}),请检查代理或网关配置。",activity:"Skill 会话活动",invalidActivity:"Skill 会话活动格式错误。",invalidToolActivity:"Skill 工具活动格式错误。",invalidTextActivity:"Skill 文本活动格式错误。",publication:"Skill 发布结果",task:"Skill 会话",file:"Skill 文件",unknownTaskState:"Skill 会话状态无法识别。",capability:"Skill 工作台能力",loadCapability:"读取 Skill 工作台能力失败",prepareTask:"准备 Skill 会话失败",taskReference:"Skill 会话引用",startOptimization:"开始优化 Skill 失败",startTask:"开始 Skill 会话失败",taskSummary:"Skill 会话摘要",taskList:"Skill 会话列表",loadTaskList:"读取 Skill 会话列表失败",invalidTaskList:"Skill 会话列表格式错误。",loadTask:"读取 Skill 会话失败",artifact:"Skill 产物",artifactFile:"Skill 产物文件",loadArtifact:"读取 Skill 产物失败",refine:"继续调整 Skill 失败",stop:"停止当前 Skill 任务失败",publish:"发布 Skill 失败",nonNdjson:"发布 Skill 失败:服务端返回了非 NDJSON 响应。",missingStream:"发布 Skill 失败:服务端没有返回进度流。",publishProgress:"发布进度",invalidPublishProgress:"发布进度格式错误。",publishError:"发布错误",unknownPublishEvent:"未知的发布进度事件。",publishResult:"发布结果",streamEnded:"发布进度流提前结束,无法确认发布结果。请刷新技能中心确认状态。",deleteTask:"删除 Skill 会话失败",download:"下载 Skill 失败"},Gwe={configSelect:Qwe,conversation:zwe,errorDetails:Vwe,fileTree:Hwe,management:qwe,generation:Wwe,api:Kwe},qVe=Object.freeze(Object.defineProperty({__proto__:null,api:Kwe,configSelect:Qwe,conversation:zwe,default:Gwe,errorDetails:Vwe,fileTree:Hwe,generation:Wwe,management:qwe},Symbol.toStringTag,{value:"Module"})),Xwe={back:"返回上一页",reload:"重新加载",notConfigured:"未配置",name:"名称",description:"描述",delete:"删除",save:"保存",saving:"保存中",add:"添加",manage:"管理",environment:"环境",noDescription:"暂无描述",refresh:"刷新",close:"关闭",retry:"重试",loading:"加载中…",previousPage:"上一页",nextPage:"下一页",edit:"编辑",all:"全部",search:"搜索",cancel:"取消",view:"查看",viewDetails:"查看详情",deleting:"删除中…",create:"创建",creating:"创建中",adding:"添加中",generating:"生成中",uploading:"上传中",preview:"预览",loadFailed:"加载失败",select:"选择",collapse:"收起",expand:"展开",none:"无"},Ywe={ariaLabel:"AgentKit 快速入口",closeAriaLabel:"关闭 AgentKit 欢迎卡片",title:"欢迎使用 AgentKit",description:"通过 AgentKit 平台快速构建与托管您的企业级智能体",docsAriaLabel:"打开 AgentKit 文档,在新窗口打开",docs:"文档",consoleAriaLabel:"打开 AgentKit 控制台,在新窗口打开",console:"控制台"},Zwe={checkUpdates:"检查更新",checkingVersions:"正在检查版本…",versionCheckError:"查询沙箱版本失败,请检查凭据、区域及接口权限后重试",sandboxUpdateError:"Sandbox 更新失败,请刷新检查实际状态后重试",modelEnvRepairUnavailable:"无法补齐模型环境变量,请检查 CODEX_API_KEY 和 CODEX_BASE_URL",updateSandbox:"更新{{variant}}{{name}}",updatingSandbox:"更新中",title:"系统信息",description:"查看当前 Studio 版本及关联的基础资源",general:"通用",currentVersion:"当前版本",storage:"存储",loadingStorage:"正在加载存储信息",tosAddress:"TOS 地址",openTosConsole:"在云控制台中打开 TOS 存储桶",environmentBuild:"环境构建",loadingEnvironmentResources:"正在加载环境构建资源",environmentResourcesError:"环境构建资源加载失败,请检查云凭据后重试。",codePipelineWorkspace:"CodePipeline 工作空间",codePipelinePipeline:"CodePipeline 流水线",openCodePipelineWorkspace:"在云控制台中打开 CodePipeline Workspace",createdOnFirstBuild:"首次构建时自动创建",containerRegistryRepository:"Container Registry 仓库",openContainerRegistryRepository:"在云控制台中打开 Container Registry 仓库",sandboxInfo:"沙箱信息",loadingSandboxInfo:"正在加载沙箱信息",sandboxInfoError:"沙箱信息加载失败,请重试。",snapshot:"快照版",snapshotWithSpace:"快照版 ",openToolConsole:"在云控制台中打开{{name}}",updateModelEnv:"更新{{variant}}{{name}}模型环境变量",modelEnvUpdated:"已更新",modelEnvAlreadyCurrent:"无需更新",userPool:"用户池",loadingUserPool:"正在加载用户池",userPoolError:"用户池加载失败,请重试。",modelEnvUpdateError:"模型环境变量更新失败,请重试。",openUserPoolConsole:"在云控制台中打开用户池{{name}}",unnamedUserPool:"未命名用户池",id:"ID",domain:"域名",region:"区域",noLocalUserPool:"本地模式未配置用户池",noUserPool:"当前 Studio 未配置用户池"},Jwe={workspace:"Agent 工作区",library:"Agent 库",evaluation:"评测",agentList:"Agent 列表",agentDetails:"Agent 详情",newAgent:"新建 Agent",loading:"加载中…",loadingCloudAgents:"正在加载云端 Agent…",noAgentSelected:"请选择一个 Agent",local:"本地",remote:"云端",localAgent:"本地 Agent",remoteAgent:"云端 Agent",agentCount:"{{count}} 个 Agent",agentCountLabel:"Agent 数量",details:"详情",chat:"对话",update:"更新",backToAgentList:"返回 Agent 列表",loadingAgent:"正在加载 Agent",loadingAgentDescription:"正在读取 Agent 配置和 Runtime 信息。",loadingAgentInfo:"正在加载 Agent 信息…",detailLoadFailed:"无法加载 Agent 详情",detailLoadFailedDescription:"请检查 Runtime 状态后重试。",partialInfoUnavailable:"部分信息暂时不可用",upgradeRuntimeForDetails:"请升级 Runtime 以查看完整 Agent 信息。",basicInfo:"基本信息",usageOverview:"使用概览",sections:{basic:"基本信息",profileConfig:"Profile 配置",sessionConfig:"会话配置",usage:"使用概览",diagnostics:"诊断",evaluations:"评测",optimizations:"优化建议",integrations:"集成",versions:"版本",channels:"消息渠道"},evaluationGroup:"评测组",optimizations:"优化建议",optimizationsDescription:"根据评测结果查看可执行的优化建议。",integrations:"集成",githubVersions:"GitHub 版本",githubVersionsDescription:"查看持续交付产生的版本并创建回退 PR。",currentVersionOnly:"当前未启用 GitHub 持续交付,仅展示当前生产版本。",loadingVersions:"正在加载版本…",noVersion:"暂无版本记录",prLink:"Pull Request",viewPr:"查看 PR",author:"提交人",publishStatus:"发布状态",viewRelease:"查看发布记录",rollbackToVersion:"回退到此版本",rollingBack:"正在创建回退…",rollbackEvent:"回退事件",sourceMergedRuntimeStill:"最新源码已合并,但 Runtime 仍处于",currentProductionVersionHint:";当前生产版本保持不变。",usageSummary:"使用统计",totalCalls:"总调用次数",userCount:"用户数",userDetails:"用户明细",usageUserList:"Agent 使用用户列表",user:"用户",callCount:"调用次数",lastUsed:"最近使用",unknownUser:"未知用户",loadingUsage:"正在加载使用数据…",refreshing:"刷新中…",noUsage:"暂无使用记录",usageUnavailable:"当前 Agent 暂无可用的使用统计。",usagePagination:"使用记录分页",pageOf:"第 {{page}} / {{total}} 页",notProvided:"暂未提供",integrationMethods:"集成方式",integrationDescription:"通过 Runtime API 或 A2A 协议集成当前 Agent。",integrationProtocol:"集成协议",runtimeStatus:"Runtime 状态",executionFlow:"执行流程",probingIntegration:"正在检测集成能力",probingIntegrationDescription:"正在读取可用端点和鉴权配置。",configurationStatus:"配置状态",discoveryEndpoint:"发现端点",invocationEndpoint:"调用端点",invocationUrl:"调用地址",authentication:"鉴权方式",networkAccess:"网络访问",notAvailable:"暂无",noAuthentication:"无需鉴权",noApiKeyRequired:"无需 API Key",usesOauthJwt:"使用 OAuth / JWT",showApiKey:"显示 API Key",hideApiKey:"隐藏 API Key",pythonExample:"Python 示例",deploymentConfig:"部署配置",deploymentConfigDescription:"确认实例和运行配置后更新 Runtime。",deploymentRegion:"部署区域",mpaControlPlane:"MPA 控制面",loadingMpaAgentView:"正在读取 MPA Runtime 绑定…",mpaRuntimeBound:"该 MPA Agent 已绑定唯一 Runtime,可继续管理。",mpaRuntimeMissing:"当前 Agent 没有可见的 MPA Runtime 绑定。",mpaRuntimeBindingAmbiguous:"多个 MPA Runtime 匹配当前 Agent,请先修复绑定后再修改。",mpaRuntimeOrphan:"Runtime 存在,但其中没有当前 MPA Profile。",mpaRuntimeLegacyAuthUnsupported:"该 Runtime 使用旧版 MPA 镜像,仍要求 X-Jwt-Token。请先更新到当前 AgentKit 兼容镜像,再管理 Profile 或 Session 配置。",profileConfig:"Profile 配置",profileConfigTitle:"Profile 配置",profileConfigDescription:"查看并应用 Agent 级 MPA Profile。Profile 是 Runtime 的长期默认配置,新会话默认继承它。",profileStatus:"Profile 状态",profileApplied:"已应用",profileNotApplied:"未应用",profileNotAppliedDescription:"当前 Runtime 可运行,但尚未保存为 Studio 可管理的 Profile。应用后会生成 Profile revision。",applyProfile:"应用 Profile",reapplyProfile:"重新应用 Profile",editProfile:"编辑 Profile",profileApplying:"应用中…",profileAppliedNotice:"Profile 已应用,当前 revision 为 {{revision}}。",profileApplyIncomplete:"Profile 应用未完成,请查看当前操作状态后重试。",profileApplyFailed:"Profile 应用失败。",profilePrompt:"系统提示词",profileResources:"资源配置",profileResourceSummary:"{{tools}} 个工具 · {{skills}} 个 Skill · {{mcp}} 个 MCP 服务",sessionConfigTitle:"会话配置",sessionConfigDescription:"查看和调整当前 MPA Session 的执行配置。变更只对下一轮对话生效。",loadingSessionConfig:"正在加载会话配置…",sessionConfigNoAgent:"请选择一个 MPA Agent 后再管理会话配置。",sessionConfigNonMpa:"会话配置仅适用于 MPA Agent。",sessionConfigNoSession:"请先打开这个 MPA Agent 的对话,再修改会话配置。",sessionConfigDifferentRuntime:"请先切回这个 MPA Agent 的当前对话,再修改会话配置。",sessionConfigSaved:"会话配置已更新,下一轮对话将使用新 revision。",sessionConfigStale:"该 Session 已被其他位置修改,已展示最新配置,请确认后再保存。",sessionConfigRevision:"配置 revision",sessionProfileRevision:"Session Profile revision",latestProfileRevision:"最新 Profile revision",sessionProfileUpgradeAvailable:"检测到新的 Profile revision:v{{current}} → v{{target}}。",upgradeSessionProfile:"升级 Session Profile",sessionProfileUpgrading:"升级中…",sessionProfileUpgraded:"Session Profile 已升级,下一轮对话将使用新 revision。",sessionProfileUpgradeFailed:"Session Profile 升级失败。",sessionModelOverride:"模型覆盖",modelId:"模型 ID",inheritProfileDefault:"继承 Profile 默认值",sessionMcpServers:"MCP 服务",mcpServerCount:"已选择 {{count}} 个",clearSessionMcp:"清空 MCP 服务",mpaDiagnosticsTitle:"Runtime 诊断",mpaDiagnosticsDescription:"查看最近的 Runtime Console 运行记录,以及 Agent、Profile、Turn、task 和 worker 关联。",loadingMpaDiagnostics:"正在加载 Runtime 诊断…",noMpaDiagnostics:"当前 Session 暂无 Runtime 诊断运行记录。",latestRun:"最近运行",traceCorrelation:"Trace 关联",traceCorrelationDescription:"Runtime Console 为本次 invocation 返回的稳定标识。",traceSteps:"Trace 步骤",traceStepsDescription:"当前 invocation 最近的有界 Runtime Console 步骤。",mpaInstanceId:"MPA 实例",turnId:"Turn ID",taskId:"Task ID",workerKind:"Worker 类型",workerSession:"Worker Session",workerTurn:"Worker Turn",workerProfile:"Worker Profile",workerProfileVersion:"Worker Profile 版本",step:"步骤",stepCount:"步骤数",duration:"耗时",noTraceSteps:"本次 invocation 暂无 trace 步骤。",executionConfigMode:{replace:"Session 覆盖",clear:"本 Session 已清空",inherit:"使用 Profile 默认值"},concurrency:"并发数",selectedOptimizations:"已选优化项",selectedOptimizationsDescription:"这些优化会应用到本次更新。",optimizationProfile:"优化方案",updatePending:"等待更新",updatingDeployment:"正在更新部署",restoringUpdateConfig:"正在恢复更新配置…",updateConfigUnavailable:"无法读取更新配置",legacyConfigMissing:"旧版本 Runtime 缺少可恢复的配置,请重新创建。",deploymentFailed:"部署失败",continueEditing:"继续编辑",loadingOptimizations:"正在加载优化建议…",noOptimizations:"暂无优化建议",fixPriority:"优先级",suggestedModule:"建议模块",suggestionAndReason:"建议与原因",priority:{high:"高",medium:"中",low:"低"},modules:{agentStructure:"Agent 结构",prompt:"提示词",tool:"工具",knowledge:"知识库",memory:"记忆",workflow:"工作流",other:"其他"},evaluationGroupList:"评测组列表",newEvaluationGroup:"新建评测组",newEvaluationGroupName:"新评测组 {{count}}",searchEvaluationGroups:"搜索评测组",noMatchingEvaluationGroups:"没有匹配的评测组",noEvaluationGroupSelected:"请选择一个评测组",groupStats:"{{agents}} 个 Agent · {{runs}} 次运行",evaluationGroupDetails:"评测组详情",evaluationGroupStats:"{{agents}} 个 Agent · {{caseSet}} · {{runs}} 次运行",startEvaluation:"开始评测",evaluationConfig:"评测配置",historyResults:"历史结果",participatingAgents:"参与 Agent",selectedCount:"已选择 {{count}} 个",evaluationResources:"评测资源",evaluationSet:"评测集",evaluator:"评估器",caseCount:"{{count}} 条案例",evaluationMetrics:"评测指标",selectedMetricCount:"已选择 {{count}} 项",historyDescription:"查看每次评测的分数和运行状态。",noHistory:"暂无评测历史",noHistoryDescription:"运行一次评测后,结果会显示在这里。",evaluationRun:"第 {{index}} 次评测",evaluationRunMeta:"{{time}} · {{agents}} 个 Agent",overallScore:"综合分",completed:"已完成",evaluationDefaults:{coreRegression:"核心能力回归",safetyCheck:"安全与幻觉检查",coreSet:"核心回归集",safetySet:"安全边界集",toolSet:"工具调用集",qualityEvaluator:"综合质量评估器",factualEvaluator:"事实一致性评估器",toolEvaluator:"工具调用评估器",responseQuality:"回答质量",factualAccuracy:"事实准确性",toolUse:"工具调用",responseEfficiency:"响应效率",todayTime:"今天 10:32",yesterdayTime:"昨天 16:08",julyTime:"7 月 25 日 14:20",justNow:"刚刚"},defaultCases:{agentName:"示例 Agent",goodSetName:"示例正向案例集",badSetName:"示例负向案例集",weeklyFeedback:{input:"总结本周客户反馈,并按优先级归类。",output:"覆盖主要问题,给出清晰的优先级与下一步动作。",tag:"总结",reason:"任务完整覆盖了用户目标,输出结构清晰,并给出了可执行的下一步动作。"},research:{input:"查询最新公开资料并附上来源。",output:"调用搜索工具,结论与引用一一对应。",tag:"工具调用"},uncertainConclusion:{input:"在信息不足时直接给出确定结论。",output:"应明确说明未知,并主动询问缺失信息。",tag:"幻觉",reason:"信息不足时仍给出了确定结论,缺少必要的澄清步骤与不确定性说明。"},repeatedTool:{input:"连续重复调用相同工具获取同一结果。",output:"复用已有结果,避免无意义的重复调用。",tag:"效率"}},goodCases:"正向案例",badCases:"负向案例",goodCase:"正向案例",badCase:"负向案例",reference:"参考答案",caseResultFilter:"案例结果筛选",feedbackSourceFilter:"反馈来源筛选",searchCases:"搜索案例",searchCasesPlaceholder:"搜索输入、输出或标签",selectCases:"选择案例",selectAll:"全选",selectAllVisible:"选择当前可见案例",selectedCaseCount:"已选择 {{count}} 条",deleteSelected:"删除所选",deleteSelectedTitle:"删除所选 Agent",deleteSelectionDescription:"确定删除所选的 {{count}} 个项目吗?此操作无法撤销。",deleteCasesConfirm:"删除所选案例",deleteOneCaseConfirm:"删除这个案例",deleteFeedbackCase:"删除反馈案例",noFeedbackCases:"暂无反馈案例",noMatchingCases:"没有匹配的案例",loadingEvaluationSet:"正在加载评测集…",userInput:"用户输入",agentOutput:"Agent 输出",score:"得分",scoreReason:"评分原因",noUserInput:"暂无用户输入",noVisibleResponse:"暂无可见回复",note:"备注:",manualFeedback:"人工反馈",automaticFeedback:"自动反馈",scoreValue:"{{score}} 分",unknownTime:"时间未知",deleteAgentTitle:"删除 Agent",deleteAgentDescription:"确定删除 Agent“{{name}}”吗?",deleteDraftDescription:"确定删除草稿“{{name}}”吗?",deleteAgent:"删除 Agent",closeDeleteConfirmation:"关闭删除确认",mpaDeletePreviewSummary:"Studio 会先删除可见的空闲 MPA Runtime 会话,再删除 AgentKit Runtime。运行中的任务需要先结束或停止后才能删除。",mpaDeletePreviewSessions:"会话",mpaDeletePreviewActiveSessions:"运行中",mpaDeletePreviewIdleSessions:"空闲",mpaDeleteBlocked:"当前无法删除",mpaDeleteBlockerActiveOperation:"仍有 MPA 创建或更新操作在执行。",mpaDeleteBlockerActiveSessions:"Runtime 中仍有运行中的会话。",mpaDeleteBlockerBindingAmbiguous:"当前 Agent 匹配到多个 MPA Runtime。",mpaDeleteBlockerRuntimeMissing:"当前 MPA Agent 没有可见的 Runtime 绑定。",mpaDeleteBlockerOrphanRuntime:"Runtime 可见,但其中缺少当前 MPA Profile。",mpaDeleteStage:{runtime_sessions:"删除 {{count}} 个可见空闲 Runtime 会话",runtime_diagnostics:"清理这些会话关联的诊断数据和挂载元信息",agentkit_runtime:"删除 AgentKit Runtime"},draftDeletionWarning:"草稿将从当前浏览器中删除。",runtimeDeletionWarning:"Runtime 和相关云端资源将被删除。",noneSelected:"尚未选择",none:"无",notPublished:"未发布",notRecorded:"未记录",noTime:"暂无时间",noPr:"暂无 PR",comingSoon:"评测能力即将开放",preparing:"准备中",cancelled:"已取消",failed:"失败",totalCount:"共 {{count}} 条",deploymentProgress:"部署进度",returnToEdit:"返回编辑",retryOperation:"重试操作",buildLog:"构建日志",githubMountLog:"GitHub 挂载日志",githubDeliveryMountLog:"GitHub 持续交付挂载日志",waitingBuildLog:"正在等待构建日志…",waitingGithubMountLog:"正在等待 GitHub 挂载日志…",copy:"复制",copied:"已复制",copyLabel:"复制{{label}}",copiedLabel:"已复制{{label}}",logLines:"{{count}} 行",logStatus:{synced:"已同步",failed:"读取失败",syncing:"同步中",earlyOmitted:"已省略早期日志",recentOnly:"仅显示最近的构建日志",partiallyOmitted:"已省略部分日志"},deployStatus:{running:"正在部署",unconfirmed:"部署状态待确认",success:"部署完成",error:"部署失败",cancelled:"部署已取消"},deploymentSteps:{prepare:{label:"准备部署",description:"校验配置并创建部署任务"},build:{label:"构建镜像",description:"生成运行环境与智能体代码"},deploy:{label:"部署服务",description:"创建并启动 AgentKit Runtime"},publish:{label:"发布服务",description:"等待服务就绪并生成访问地址"},complete:{label:"部署完成",description:"智能体已可以正常使用"},evaluation:{label:"创建评测集",description:"自动创建 Good Case 和 Bad Case 评测集"},profileApplying:{label:"应用 MPA 配置",description:"将 Studio Agent 配置写入 MPA Runtime"},smokeRunning:{label:"验证 MPA Runtime",description:"在标记可运行前执行 Runtime 就绪验证"},runnable:{label:"MPA Runtime 可运行",description:"Runtime 已接受配置并通过执行就绪验证"},github:{label:"挂载 GitHub 持续交付",description:"初始化目标分支与 GitHub Actions workflow"},update:{label:"更新实例配置",description:"将 Runtime 实例数调整为 {{min}}~{{max}}"}},githubStatus:{published:"已发布",publishing:"发布中",failed:"发布失败",pending:"等待发布",unknown:"未知"},errors:{agentInfoMissing:"Agent 信息不可用",checkUpdateCapability:"无法检查更新能力",checkingUpdateConfig:"正在检查更新配置",cloudOnlyUpdate:"仅云端 Agent 支持更新",deleteDeployedUnsupported:"当前不支持删除已部署 Agent",deleteDraftUnsupported:"当前不支持删除草稿",loadMpaDeletePreview:"无法加载 MPA 删除预览",loadAgentInfo:"无法加载 Agent 信息",loadApiKey:"无法读取 API Key",loadGithubVersions:"无法加载 GitHub 版本",loadEvaluations:"无法加载评测案例",loadMpaAgentView:"无法加载 MPA Agent 状态",loadMpaDiagnostics:"无法加载 Runtime 诊断",loadOptimizations:"无法加载优化建议",loadRuntimeDetails:"无法加载 Runtime 详情",loadSessionConfig:"无法加载会话配置",loadUsage:"无法加载使用数据",noCreatePermission:"当前账号没有创建 Agent 的权限",noManagePermission:"当前账号没有管理此 Agent 的权限",originalConfigUnavailable:"原始配置不可用",probeIntegration:"无法检测集成能力",rollbackVersion:"无法创建版本回退",runtimeRegionMissing:"Runtime 区域信息缺失",updateCapabilityMismatch:"Runtime 更新能力与当前配置不匹配",updateCapabilityPending:"Runtime 更新能力仍在确认中",updateConfigRestoring:"正在恢复更新配置",updateUnsupported:"当前 Runtime 不支持更新",usageMismatch:"返回的使用数据与当前 Agent 不匹配"}},e1e={title:"环境",loadFailed:"环境加载失败,请检查存储配置后重试。",storageUnavailable:"管理员未配置持久化存储,环境管理暂不可用。",create:"新建环境",configure:"配置环境",details:"环境详情",editorDescription:"配置运行环境,或接入代码仓库和已有镜像",backToList:"返回环境列表",save:"保存环境",createAndBuild:"创建并构建",saveAndBuild:"保存并构建",name:"环境名称",namePlaceholder:"Python 数据处理",descriptionPlaceholder:"说明这个环境适合处理的任务",creationMethod:"创建方式",baseConfiguration:"基础配置",baseEnvironment:"基础环境",operatingSystem:"操作系统",pythonVersion:"Python 版本",fixedByBase:"由 {{base}} 固定为 {{value}}",selectUbuntuVersion:"选择基础镜像的 Ubuntu 版本",selectPythonVersion:"选择需要安装的 Python 版本",skills:"技能",addSkill:"添加环境技能",veadkDescription:"Agent 开发与运行框架",customDockerfile:"自定义 Dockerfile",presetEnvironment:"预制环境",presetHint:"选择“无”可自行填写 Dockerfile 第一行的基础镜像。",dockerfileSize:"{{size}} / {{max}} 字节",upload:"上传",reset:"重置",dockerfileBaseImage:"Dockerfile 基础镜像",dockerfileContent:"Dockerfile 内容",region:"区域",search:"搜索环境",manualImport:"手动导入",noMatches:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称",startBuild:"开始构建",build:"构建",unnamed:"未命名环境",listSeparator:"、",clipboardReadError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。",creation:{custom:{label:"自定义配置",description:"通过表单选择基础环境、Python、工具和技能"},dockerfile:{label:"自定义 Dockerfile",description:"上传或直接编辑 Dockerfile"},git:{label:"从代码仓库构建",description:"探查公开仓库并通过 CodePipeline 构建"},image:{label:"使用已有镜像",description:"绑定由外部流水线交付的 CR 镜像"}},baseDescriptions:{"aio-sandbox":"内置 Sandbox Shell 能力 · Ubuntu 22.04","codex-sandbox":"内置 Codex CLI、浏览器与代码执行环境",ubuntu:"标准 Linux 基础镜像"},dockerfileValidation:{baseImageRequired:"请填写基础镜像。",duplicateFrom:"基础镜像已固定在第一行,请删除 Dockerfile 正文中的 FROM 指令。",tooLarge:"Dockerfile 不能超过 128 KiB。",empty:"Dockerfile 内容不能为空。",missingFrom:"Dockerfile 缺少 FROM 指令。"},presets:{none:"自行填写 Dockerfile 基础镜像",aio:"内置 Sandbox Shell 与常用运行时",codex:"内置 Codex CLI、浏览器与代码执行环境"},categories:{tools:"工具",productivity:"效率",browser:"浏览器自动化",system:"系统与媒体"},options:{"lark-cli":"飞书开放平台命令行工具",pandoc:"文档格式转换工具",opencli:"将网站与桌面应用转换为命令行工具",uv:"快速 Python 包与项目管理器",ripgrep:"高性能文本检索工具",jq:"JSON 查询与转换工具","github-cli":"在终端中管理 GitHub 工作流",playwright:"浏览器自动化与端到端测试",chromium:"无头浏览器运行时",git:"代码版本管理",curl:"网络请求与文件下载",ffmpeg:"音视频转码与处理",imagemagick:"图片转换与批处理"},duration:{seconds:"{{count}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",hoursMinutes:"{{hours}} 小时 {{minutes}} 分"},buildStatus:{preparing:"准备中",queued:"排队中",building:"构建中",scanning:"扫描中",available:"可用",failed:"构建失败",notBuilt:"未构建"},manifest:{title:"环境 Manifest",closeLabel:"关闭环境 Manifest",loading:"正在加载 Manifest",editorLabel:"环境 Manifest YAML",copyFailed:"复制失败,请重试",copied:"已复制",copy:"复制 Manifest",view:"查看环境 Manifest",viewShort:"查看 Manifest",unavailable:"尚无可用 Manifest"},buildDetails:{title:"构建详情",closeLabel:"关闭构建详情",currentStep:"当前步骤",waiting:"等待构建信息",elapsed:"已用时",sourceCommit:"源码提交",openCodePipeline:"在 CodePipeline 中查看",starting:"正在启动",rebuild:"重新构建"},git:{sectionLabel:"公开代码仓库",address:"Git 地址",ref:"Branch、Tag 或 Commit",defaultBranch:"默认分支",inspecting:"正在拉取仓库并查找 Dockerfile",foundDockerfiles:"已在提交 {{commit}} 中找到 {{count}} 个 Dockerfile。",savedDockerfileLoaded:"已载入保存的 Dockerfile,可重新探查仓库更新。",noDockerfile:"仓库中未找到 Dockerfile,请检查分支或仓库内容。",inspectAgain:"重新探查",selectDockerfile:"选择 Dockerfile"},repository:{outputSection:"构建输出",type:"镜像仓库类型",managed:"Studio 默认镜像仓库",existing:"已有镜像仓库",managedHint:"构建时自动创建或复用当前区域的 Studio 镜像仓库。"},existingImage:{sectionLabel:"已有镜像",reference:"Tag 或 Digest",placeholder:"latest 或 sha256:...",hint:"填写镜像 Tag,或以 sha256: 开头的完整 Digest。"},share:{action:"分享",title:"分享环境",closeLabel:"关闭分享环境",generating:"正在生成并复制分享码",copied:"分享码已复制",failed:"分享失败",code:"分享码",fullCode:"完整环境分享码",copiedHint:"分享码已自动复制,也可在这里查看或手动复制。",copyFailedHint:"自动复制失败,可手动复制上方分享码,或重试。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅发送给可信对象。",copyAgain:"再次复制"},import:{title:"导入环境",closeLabel:"关闭导入环境",description:"先检测分享码中的环境,再确认添加到当前账号。",code:"环境分享码",tooMany:"最多可一次导入 {{max}} 个环境,当前检测到 {{count}} 个分享码。",multipleHint:"多个分享码可使用英文逗号、中文逗号或换行分隔,重复项会自动忽略。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅导入可信来源的分享码。",inspectingCodes:"正在检测环境分享码",found:"检测到 {{count}} 个环境:{{names}}。",itemError:"第 {{index}} 个分享码:{{error}}",invalidCode:"分享码无效。",noResult:"服务未返回该分享码的导入结果。",partial:"已导入 {{created}} 个环境,{{remaining}} 个未完成,可重试有效失败项。",inspecting:"正在检测",importing:"正在导入",retryImport:"重试导入",confirm:"确认导入",inspectCodes:"检测分享码"},status:{boundImage:"环境“{{name}}”已绑定已有镜像",queued:"环境“{{name}}”已进入构建队列",savedBuildFailed:"环境已保存,但构建未启动:{{error}}",importedFailed:"已导入 {{created}} 个环境,{{failed}} 个失败",importedDuplicate:"已导入 {{created}} 个环境,{{duplicate}} 个分享码已存在",imported:"已导入 {{count}} 个环境",deleted:"已删除环境“{{name}}”"},deleteTitle:"删除环境",deleteDescription:"确定删除环境“{{name}}”吗?删除后无法恢复。",errors:{repositoryRequired:"请输入公开代码仓库地址。",repositoryHttps:"请输入公开仓库的 HTTPS 地址。",repositoryInvalid:"请输入有效的公开仓库 HTTPS 地址。",imageReferenceWhitespace:"Tag 或 Digest 不能包含空格。",imageDigestInvalid:"Digest 必须是完整的 sha256 值。",imageTagOnly:"这里只填写 Tag,不要重复填写镜像仓库路径。"}},t1e={searchPlaceholder:"搜索资源名称",emptyMessage:"暂无可用选项",searchAriaLabel:"搜索{{label}}",loadingMore:"正在加载更多资源…"},n1e={retryDeployment:"重试部署",retrying:"正在重试…",collapse:"收起错误信息",expand:"展开完整错误信息",copy:"复制完整错误信息"},i1e={steps:"构建步骤",log:"构建日志",syncing:"同步中",loadFailed:"读取失败",synced:"已同步",recentOnly:" · 仅显示最近日志",copiedLog:"已复制构建日志",copyLog:"复制构建日志",copied:"已复制",copy:"复制",logContent:"构建日志内容",waiting:"正在等待 CodePipeline 输出日志…",empty:"暂无构建日志"},r1e={defaultLabel:"Studio 默认环境",defaultDescription:"使用 Studio 预置的标准运行环境",status:{notBuilt:"未构建",preparing:"准备中",queued:"排队中",building:"构建中",scanning:"扫描中",available:"可用",failed:"失败"},label:"运行环境",placeholder:"请选择运行环境",search:"搜索运行环境",loading:"正在加载运行环境…",loadFailed:"加载运行环境失败",noMatches:"未找到匹配的运行环境",unavailable:"当前没有可用的运行环境",selectionUnavailable:"所选运行环境当前不可用,请重新选择。",selectionHint:"选择构建完成的运行环境后,部署将使用其镜像和工具配置。",versionChanged:"所选环境版本已更新,请确认后继续。",versionMissing:"所选环境版本已不存在,请重新选择。",operatingSystem:"操作系统",language:"语言",image:"镜像",imageVersion:"镜像版本",skills:"技能",tools:"工具",noSkills:"未配置 Skill",noExtraTools:"未配置额外工具",defaultGuidance:"默认环境由 Studio 管理,无需额外配置。",persistenceFallback:"持久化环境服务暂不可用,当前使用默认环境。",emptyFallback:"当前没有可选择的自定义环境。"},s1e={repository:"GitHub 仓库",githubUrl:"GitHub 地址",token:"访问令牌",sessionToken:"{{provider}} 临时令牌",runtime:"Runtime",commit:"提交",workflow:"工作流",syncFailed:"同步 GitHub 代码失败",status:{mounted:"已挂载",bound:"已绑定",synced:"已同步",created:"已创建"},volcengine:"火山引擎",mountDelivery:"挂载持续交付",selectedForDeployment:"已选择,部署时挂载",mountOnDeploy:"部署时挂载持续交付",syncCode:"同步代码",deliveryMode:"GitHub 交付模式",sourceSync:"GitHub 代码同步",delivery:"GitHub 交付",loading:"读取中",running:"执行中",runtimeDeliveryHint:"写入 AgentKit Runtime GitHub Actions workflow,后续 GitHub 提交会更新绑定 Runtime。",initialDeliveryHint:"首次部署成功后初始化目标分支,后续 GitHub 提交会更新绑定 Runtime。",sourceSyncHint:"Studio 会直接 push 到目标分支;该分支由 Studio 管理,远端冲突时同步会失败。Runtime 仍由部署按钮发布。",tokenPlaceholder:"repo 或 contents write 权限",getToken:"获取 Token",hideToken:"隐藏 Token",showToken:"显示 Token",tokenHelp:"Token 仅用于本次操作,成功后不会保留在表单中。",targetBranch:"目标分支",actionsSecretPlaceholder:"用于写入 GitHub Actions Secret",sessionTokenPlaceholder:"临时凭证可选",syncing:"同步中…",pendingHint:"已选择挂载持续交付。点击部署后,Studio 会等待 Runtime 创建完成并初始化 GitHub 目标分支,初始化成功后才完成部署流程。",result:{deliveryMounted:"已挂载持续交付",deliverySelected:"已选择挂载持续交付",githubBound:"已绑定 GitHub",codeSynced:"代码已同步",deliveryHint:"目标分支提交会触发 Runtime 持续交付。",boundHint:"更新并发布时会先同步当前源码到这个分支。"},branch:"分支",viewPr:"查看 PR",createFailed:"创建失败",phase:"阶段",log:"日志"},a1e={name:"飞书",enabling:"正在启用并更新配置…",description:"接收消息并通过飞书机器人回复",configuration:"飞书配置",configurationMode:"飞书配置方式",automatic:"自动配置",manual:"手动配置",cancelling:"取消中…",scanToCreate:"扫码创建",scanDescription:"授权后自动回填凭据",generateQrCode:"生成二维码",qrCodeAlt:"飞书机器人配置二维码",scanToConfirm:"飞书扫码确认",expiresIn:"{{time}} 后失效",created:"机器人已创建",credentialsFilled:"应用凭据已自动回填",qrCodeExpired:"二维码已失效",automaticFailed:"自动配置失败",regenerateQrCode:"请重新生成二维码。",configuredPlaceholder:"已配置,留空沿用",appSecretPlaceholder:"请输入 App Secret",hideSecret:"隐藏 App Secret",showSecret:"显示 App Secret"},o1e={mode:{auto:"自动创建",autoDescription:"部署时自动创建所需资源",recommended:"推荐",create:"指定名称",createDescription:"使用指定名称创建或复用资源",existing:"选择已有",existingDescription:"从当前账号的已有资源中选择"},selectExisting:"请选择已有资源",searchResource:"搜索资源名称",noMatch:"未找到匹配资源",noAvailable:"暂无可用资源",searching:"正在搜索云资源…",loading:"正在加载云资源…",noMatchSentence:"未找到匹配资源。",noAvailableSentence:"暂无可用资源。",loadedSummary:"实际服务区域:{{region}} · 已加载 {{loaded}}{{total}}",registryInstance:"Registry 实例",registryAriaLabel:"镜像仓库 Registry 实例",namespace:"命名空间",namespaceAriaLabel:"镜像仓库 Namespace",repository:"镜像仓库",existingRepository:"已有镜像仓库",selectRegistryFirst:"请先选择 Registry 实例。",selectNamespaceFirst:"请先选择 Namespace。",configurationMode:"配置方式",configurationModeAriaLabel:"{{resource}}配置方式",selectConfigurationMode:"请选择配置方式",automaticNames:"自动创建名称",validation:{tos:"请填写或选择 TOS 存储桶。",cr:"请完整填写或选择 CR 实例、命名空间和镜像仓库。",codePipeline:"请完整填写或选择 CodePipeline Workspace 和 Pipeline。",existingCodePipeline:"请选择已有的 CodePipeline Workspace 和兼容 Pipeline。"},autoBucketWithRegion:"agentkit-platform-{账号 ID}-{{region}}",autoBucket:"agentkit-platform-{账号 ID}",tosBucket:"TOS 存储桶",bucketName:"存储桶名称",bucketNamePlaceholder:"输入存储桶名称",existingBucket:"已有存储桶",existingTosBucket:"已有 TOS 存储桶",bucket:"存储桶",accountIdResolved:"账号 ID 在部署时按当前云账号解析。",containerRegistry:"容器镜像仓库(CR)",instanceName:"实例名称",crInstance:"CR 实例",existingCrInstance:"已有 CR 实例",existingCrNamespace:"已有 CR 命名空间",existingCrRepository:"已有 CR 镜像仓库",autoRegistry:"agentkit-platform-{账号 ID}",autoRepositoryName:"{{name}}-{4 位随机字符}",registryNameNote:"账号 ID 在部署时解析,镜像仓库的随机字符在部署时生成。",workspace:"工作空间",pipeline:"流水线",workspaceName:"Workspace 名称",pipelineName:"Pipeline 名称",existingWorkspace:"已有 CodePipeline Workspace",compatiblePipeline:"兼容 Pipeline",existingPipeline:"已有 AgentKit CodePipeline",pipelineNameNote:"Pipeline 与 Runtime 名称一致。"},l1e={commit:"提交",steps:{permissions:"预检 OTA 所需权限",resolving:"读取目标版本信息",downloading:"下载并校验完整更新包",preparing:"准备 VeFaaS Function 代码",provisioning:"检查并补齐 Studio 云资源",scheduler:"更新定时任务调度服务",submitting:"提交 Function 更新",publishing:"发布新 Revision 并重启服务"},stages:{permissions:"预检 OTA 权限",resolving:"读取版本信息",downloading:"下载更新包",preparing:"准备 Function 代码",provisioning:"补齐 Studio 云资源",scheduler:"更新定时任务调度服务",submitting:"提交 Function 更新",publishing:"发布 Revision",checking:"检查更新",unknown:"未知阶段"},duration:{seconds:"{{count}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},logPermissionPrefix:"无法读取 VeFaaS 发布日志。Function 角色缺少 ",logPermissionSuffix:" 权限,更新会继续。",openIamConsole:"前往 IAM 控制台配置权限",deploymentProgress:"部署进度",live:"实时",completed:"已完成",stopped:"已停止",copied:"已复制",copyFailed:"复制失败",copyLog:"复制日志",waitingForLogs:"等待 VeFaaS 返回更新日志…",noLogs:"本次更新未返回发布日志",messages:{updated:"Studio 已更新,新 Revision 已接管服务",failed:"Studio 更新失败",timeout:"等待 VeFaaS 发布超时,请稍后重新检查版本",submitted:"更新已提交,正在等待 VeFaaS 发布新版本",connectionSwitched:"连接已切换,正在确认新版本状态"},checkingPermissions:"正在检查 OTA 权限",authorizationRequired:"需要 IAM 授权",updating:"正在更新 Studio",updated:"Studio 已更新",updateToVersion:"更新 Studio 至 {{version}}",checkPermissions:"检查更新权限",authorizationNeeded:"需要授权",updatingShort:"正在更新",refreshForNewVersion:"刷新使用新版",updateFailed:"更新失败",updateNow:"立即更新",newVersionAvailable:"有新版更新",dialog:{failed:"Studio 更新失败",checkingPermissions:"正在检查更新权限",authorizationRequired:"需要 IAM 授权",updating:"正在更新 Studio",completed:"Studio 更新完成",newVersion:"发现新版本"},permissionCheck:"正在核对 OTA 与定时任务所需的全部 IAM 权限…",permissionCheckHint:"权限全部满足后才会开始下载、更新或发布云资源。",missingPermissionCount:"当前 Function 角色缺少 {{count}} 项 OTA 更新权限,尚未执行任何云资源变更。",functionRole:"Function 角色",currentRole:"当前运行角色",policyToUpdate:"将更新策略",authorizationSteps:{open:"打开授权页面,确认已预填的策略名称和完整策略内容。",debug:"点击页面中的“发起调试”,完成策略更新。",return:"返回此窗口,点击“我已授权,重新检查”。"},missingPermissions:"缺少的权限",openPrefilledAuthorization:"打开已预填的 IAM 授权页面",openIamManually:"前往 IAM 控制台手动配置",noSafePolicy:"当前角色没有唯一可安全更新的自定义策略,请由管理员将上述权限加入该角色。",failedStage:"失败阶段",errorId:"错误 ID",notGenerated:"未生成",openFunctionLogs:"前往 VeFaaS 控制台查看 Function 日志",targetVersion:"目标版本",updateStatus:"更新状态",elapsed:"已用时",progressAriaLabel:"Studio 更新进度",processingUpdate:"正在处理更新",processing:"正在处理",backgroundHint:"发布阶段会短暂中断连接;关闭此窗口不会停止更新,可随时点击右上角按钮重新查看。",confirmDescription:"更新会重启 Studio 服务,预计约 3–5 分钟完成更新与发布。期间正在进行的对话、流式响应或部署任务可能中断,登录态不会受到影响。",selectVersion:"选择版本",currentVersion:"当前版本",changelog:"更新内容",noChangelog:"暂无更新说明",runInBackground:"后台运行",authorizedRecheck:"我已授权,重新检查",tryAgain:"重新尝试"},c1e={deploy:"部署",update:"更新",planHash:"方案哈希",backToConfiguration:"返回配置",releaseRegion:"发布区域",deployRegion:"部署区域",regionPreserved:"更新时沿用现有 Runtime 的部署区域,无法修改。",unnamedAgent:"未命名 Agent",deployTitle:"部署 {{name}}",additionalAgentCount:" 等 {{count}} 个智能体",releaseOverview:"发布概览",agentOverview:"Agent 概览",agentCount:"Agent 数量",model:"模型",systemPrompt:"系统提示词",optimizations:"优化选项",notEnabled:"未启用",effectiveCapabilities:"生效能力",automaticProtection:"自动保护",artifactActions:"发布产物操作",exportYaml:"导出 YAML",viewSource:"查看源代码",downloadSource:"下载源代码",expandFlow:"放大查看执行流程",expand:"放大查看",deploymentConfiguration:"部署配置",runtimeName:"Runtime 名称",runtimeNamePreserved:"更新时保持现有 Runtime 名称不变。",runtimeNameHint:"默认根据 Root Agent 名称生成,并添加随机后缀避免重名;支持 4-64 位字母、数字、连字符和下划线",accessAuthentication:"访问鉴权",authenticationPreserved:"更新时保持现有 Runtime 的鉴权方式不变。",authenticationMethod:"鉴权方式",authenticationAriaLabel:"部署鉴权方式",authenticationPlaceholder:"请选择鉴权方式",messageChannels:"消息渠道",instanceSettings:"实例设置",minInstances:"最小实例数",maxInstances:"最大实例数",sidecarSingleInstance:"Harness Sidecar 首期仅支持单实例,Runtime 固定为 1~1",inMemorySingleInstance:"为避免多实例间会话丢失,推荐将 Runtime 固定为 1~1",network:"网络",networkPreserved:"现有 Runtime 的区域与网络模式保持不变。",networkMode:"网络模式",networkModes:{public:"公网",both:"公网 + VPC"},subnetId:"子网 ID",subnetHint:"可选,多个用逗号分隔",sharedInternetAccess:"VPC 内共享公网出口",evaluationSets:"评测集",createEvaluationSets:"自动创建评测集",createEvaluationSetsHint:"部署成功后,自动创建 Good Case 和 Bad Case 评测集。",resourceConfiguration:"资源配置",environmentVariables:"环境变量",environmentVariablesHint:"组件配置会自动同步到这里,部署前可核对最终值。",itemCount:"{{count}} 项",addVariable:"添加变量",componentGenerated:"组件自动生成",injectedByApiKey:"由所选 API Key 注入",envNameAriaLabel:"{{key}} 环境变量名",envDescriptionAriaLabel:"{{key}}说明:{{description}}",openOpenViking:"打开 OpenViking {{label}}",openOpenVikingAriaLabel:"{{key}}:打开 OpenViking {{label}}",requiredEmpty:"必填,尚未填写",optionalEmpty:"可选,尚未填写",envValueAriaLabel:"{{key}} 环境变量值",automatic:"自动",synced:"同步",customModelCredentials:"自定义模型凭据",releaseOnlySecret:"必填,仅用于本次发布",thisRelease:"本次发布",customVariables:"自定义变量",value:"值",deleteVariable:"删除变量",deploymentProgress:"部署进度",retryUpdate:"重试更新",retryDeploy:"重试部署",updateSucceeded:"更新成功",deploySucceeded:"部署成功",region:"区域",agentName:"Agent 名称",apiEndpoint:"API 端点",connecting:"连接中…",chatNow:"立即对话",console:"控制台",actionInProgress:"{{action}}中…",checkingName:"正在检查名称…",retryAction:"重试{{action}}",flowPreview:"执行流程预览",executionFlow:"执行流程",flowPreviewHint:"只读预览,可缩放与拖动画布",closeFlowPreview:"关闭执行流程预览",agentAdded:'Agent "{{name}}" 已添加到左上角下拉列表!',files:{preview:"文件预览",new:"新建文件",empty:"暂无文件",noneSelected:"未选择文件",selectToView:"选择左侧文件以查看内容",loadingEditor:"加载编辑器…",rename:"重命名",renamePrompt:"重命名文件"},apiKey:{selectFirst:"请先选择 API Key",revealing:"正在显示 API Key",hide:"隐藏 API Key",retryReveal:"重试显示 API Key",reveal:"显示 API Key"},task:{preparing:"准备部署",waitingBuildLog:"正在等待构建日志…",waitingGithubLog:"正在等待 GitHub 挂载日志…",syncingGithub:"正在同步当前源码到 GitHub",syncGithubCode:"同步 GitHub 代码",githubSynced:"GitHub 代码已同步",githubSubmitted:"GitHub 代码已提交",githubUpdatingRuntime:"代码已提交到 GitHub,GitHub Actions 正在更新同一个 Runtime",initializingGithub:"开始初始化 GitHub main 分支与 Actions workflow",initializingGithubBranch:"正在初始化 GitHub 持续交付目标分支",mountGithubDelivery:"挂载 GitHub 持续交付",githubBranchInitialized:"GitHub 持续交付已初始化目标分支",githubDeliveryMounted:"GitHub 持续交付已挂载",githubMountFailed:"挂载 GitHub 持续交付失败",githubMountFailedDetail:"GitHub 持续交付挂载失败:{{message}}",githubMountFailedHint:"挂载 GitHub 持续交付失败,详见 GitHub 日志。",applyingMpaProfile:"正在将 Agent 配置应用到 MPA Runtime",mpaProfileApplied:"MPA Runtime 配置已应用",runningMpaSmoke:"正在验证 MPA Runtime 执行链路",mpaReady:"MPA Runtime 已可运行",deploymentComplete:"部署完成",deployedNotConnected:"部署完成,暂未连接",cancelled:"已取消",cancelledHint:"部署已取消,相关 Runtime 资源已请求销毁。",deploymentStatusUnconfirmed:"部署状态待确认",deploymentFailed:"部署失败",buildFailedHint:"构建镜像失败,详见构建日志。"},confirm:{updateTitle:"确认更新",deployTitle:"确认部署",closeLabel:"关闭部署确认",updateDescription:"将更新并发布到当前云端 Runtime,过程可能需要几分钟。确定继续吗?",deployDescription:"将创建新的云端 Runtime,部署过程可能需要几分钟。确定继续吗?",update:"确定更新",deploy:"确定部署"},userPool:{label:"用户池",unnamed:"未命名用户池",current:"当前用户池",ariaLabel:"部署用户池",loading:"正在加载用户池…",placeholder:"请选择用户池",loadingIdentity:"正在加载 Identity 用户池…",empty:"当前账号下暂无 Identity 用户池。",currentHint:"当前 Studio 的登录 JWT 将透传访问此 Runtime。",mismatchHint:"所选用户池不是当前 Studio 使用的用户池,部署后无法从 Studio 调用此 Runtime。",markedHint:"当前 Studio 使用的用户池已在列表中标注。"},authentication:{apiKeyDescription:"默认方式,使用 Runtime API Key 访问",userPool:"用户池",userPoolDescription:"使用 Identity 用户池签发的 JWT"},steps:{buildImage:"构建镜像",deploy:"部署",publish:"发布",syncCode:"同步代码",uploadPackage:"上传代码包",packageImage:"镜像打包",createRuntime:"创建 Runtime",publishService:"发布服务",updateInstances:"更新实例配置",createEvaluationSets:"创建评测集",applyMpaProfile:"应用 MPA 配置",verifyMpaRuntime:"验证 MPA Runtime",mpaReady:"MPA Runtime 可运行"},errors:{instanceRangeInteger:"最小实例数必须为大于等于 0 的整数,最大实例数必须为大于 0 的整数。",instanceRangeOrder:"最小实例数不能大于最大实例数。",selectApiKey:"请先在模型配置中选择 API Key。",loadApiKey:"加载 API Key 失败,请重试。",invalidProject:"项目数据无效",updateFeishu:"更新飞书配置失败:{{message}}",userPoolRequired:"请选择用于 Runtime 鉴权的用户池。",vpcRequired:"使用 VPC 网络时,请填写 VPC ID。",modelSecretRequired:"请填写 {{label}},用于访问对应的自定义模型地址。",managedApiKeyRequired:"{{requirement}},请先返回模型配置选择 API Key。",feishuEnvRequired:"启用飞书后,请填写{{field}}。",runtimeNameExists:"Runtime 名称已存在,请修改后重试。",deployedButGithubMountFailed:"部署成功,但挂载 GitHub 持续交付失败:{{message}}",deployedButGithubBindFailed:"部署成功,但绑定 GitHub 失败:{{message}}",mpaRuntimeIdMissing:"部署成功,但返回缺少 Runtime ID,无法应用 MPA 配置。",mpaOperationIncomplete:"MPA Runtime 初始化未完成,请重试此部署任务。",deploymentStatusUnconfirmed:"连接已中断,当前无法确认部署最终状态。任务可能仍在云端运行,请到 AgentKit 或 Code Pipeline 查看同一任务,避免重复部署。",failedAtStage:"{{action}}失败({{stage}}阶段):{{message}}",noAgentAtEndpoint:"连接成功,但该地址未发现任何 Agent(/list-apps 为空)。",addAgent:"添加 Agent 失败:{{message}}",modelApiKeyRequired:"请填写此模型地址对应的 API Key。"}},u1e={title:"工作区",storageUnavailable:"管理员未配置持久化存储,工作区管理暂不可用。",detail:"工作区详情",create:"新建工作区",editorDescription:"将常用环境组合在一起;同一个环境可以加入多个工作区。",backToList:"返回工作区列表",environmentCount_one:"{{count}} 个环境",environmentCount_other:"{{count}} 个环境",createdAt:"创建时间",updatedAt:"最近更新",basicInfo:"基本信息",namePlaceholder:"例如:内容生产",descriptionPlaceholder:"说明这个工作区的用途",selectedEnvironmentCount:"已选择 {{count}} 个,可在其他工作区中继续复用",searchAvailableEnvironments:"搜索可用环境",searchEnvironments:"搜索环境",noAvailableEnvironments:"还没有可添加的环境",createEnvironmentFirst:"请先在“环境”页面创建并构建环境。",noMatchingEnvironments:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称。",environmentStatus:{available:"可用",building:"构建中",notBuilt:"未构建"},added:"已添加",saved:"已保存工作区“{{name}}”",resourceType:"工作区资源类型",searchWorkspaces:"搜索工作区",loadFailed:"无法加载工作区",noMatchingWorkspaces:"没有匹配的工作区",tryAnotherNameOrEnvironment:"请尝试搜索其他名称或环境",noEnvironmentAdded:"未添加环境",environmentMissing:"环境缺失",availableFraction:"{{available}}/{{total}} 可用",available:"可用",availableCount:"{{count}} 个可用",updated:"更新",addEnvironment:"添加环境",deleteTitle:"删除工作区",deleteDescription:"确定删除工作区“{{name}}”吗?环境本身不会被删除。",deleted:"已删除工作区“{{name}}”",clipboardPermissionError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。",codeProjects:"代码项目"},d1e={back:"返回",detailNavigation:"详情导航",noData:"暂无数据",actions:"操作",moreActions:"更多操作 {{label}}",actionsFor:"{{label}} 操作",loading:"资源加载中,请稍候"},f1e={addSkill:"添加 Skill",remove:"移除 {{name}}",confirmRemoveRuntime:"从新版本中移除运行中的 Skill「{{name}}」?",selectedCount:"已加入技能 · {{count}}",close:"关闭{{label}}",sources:{runtime:"运行中来源 · 原样保留,可移除或用同名 Skill 替换",local:"本地",skillspace:"AgentKit Skills 中心",skillhub:"火山 Find Skill 技能广场"},tabs:{local:"本地文件",localShort:"本地文件",skillspace:"AgentKit Skills 中心",skillspaceShort:"AgentKit",skillhub:"火山 Find Skill 技能广场",skillhubShort:"Find Skill"}},h1e={model:"模型",turnControls:"流程控制",pause:"暂停",resume:"恢复",interrupt:"中断",cancel:"取消",pauseTurn:"在安全点暂停完整流程",resumeTurn:"恢复完整流程",interruptTurn:"中断当前流程并保留会话上下文",cancelTurn:"取消当前流程且不可恢复",turnState:{running:"运行中",pausing:"正在到达安全点",paused:"已暂停",resuming:"正在恢复",interrupting:"正在中断",cancelling:"正在取消",interrupted:"已中断",completed:"已完成",failed:"失败",cancelled:"已取消",orphaned:"状态待确认",newTurnRequired:"需要从检查点继续"},tasks:{ppt:"PPT",image:"图片生成",video:"视频生成"},prompts:{ppt:{quarterlyReview:"复盘【季度】经营表现,提炼指标差距、原因与行动建议",projectUpdate:"汇报【项目名称】进展:里程碑、风险、预算和资源诉求",solutionProposal:"为【客户行业】输出解决方案:痛点、架构、实施路径与收益",industryAnalysis:"分析【行业主题】趋势,给出竞争格局、机会与战略建议"},image:{launchVisual:"为【品牌或产品】设计【高级科技】风格的发布会主视觉",ecommercePoster:"生成【产品名称】电商海报,突出【核心卖点】与品牌色",conceptRendering:"呈现【产品或空间】在【使用场景】中的写实概念效果图",socialGraphic:"围绕【传播主题】制作简洁专业的企业社媒配图"},video:{brandFilm:"制作【品牌名称】30 秒宣传片,突出【品牌价值】",productLaunch:"为【产品名称】制作 45 秒发布视频:痛点、功能、场景与行动号召",trainingVideo:"制作【培训主题】企业培训视频,讲清【关键操作或规范】",eventTeaser:"生成【活动名称】20 秒预热视频,包含亮点、时间地点和报名信息"}},firstFrame:"首帧",videoToEdit:"待编辑视频",baseVideo:"基础视频",optimizeSkillPlaceholder:"描述你想优化的技能…",createSkillPlaceholder:"描述你想生成的技能…",createVideoPlaceholder:"描述你想创作的视频…",messageAgentPlaceholder:"向 {{name}} 发消息…",selectAgentFirst:"请先选择智能体",selectSkillFirst:"请先选择需要优化的 Skill",availableSkills:"可用技能",availableSubagents:"可用子 Agent",invokeSkill:"调用技能",useSubagent:"使用子 Agent",loadingCapabilities:"正在读取 Agent 能力…",noMatchingSkills:"当前 Agent 没有匹配技能",noMatchingSubagents:"当前 Agent 没有匹配子 Agent",skillFallbackDescription:"加载并执行该技能",agentFallbackDescription:"将本轮交给该 Agent",skill:"技能",uploadImage:"上传图片",uploadDocument:"上传文档或 PDF",uploadVideo:"上传视频",taskMode:"任务模式",selectTaskMode:"选择任务模式",loadingGenerationModel:"正在加载生成模型",modelUnavailable:"模型不可用",cancelTask:"取消{{task}}任务",stopGenerating:"停止生成",viewVideoProgress:"查看视频生成进度",send:"发送",selectTaskType:"选择任务类型",enterprisePrompts:"{{task}}企业提示词",sessionId:"会话 ID",sessionIdLabel:"会话 ID:",initializing:"初始化中",copied:"已复制",copySessionId:"复制会话 ID",sessionIdCopied:"已复制会话 ID",disclaimer:"回答仅供参考",viewLogs:"查看日志"},p1e={selectAgent:"选择 Agent",noLocalAgents:"暂无本地 Agent。",searchRuntime:"搜索 Runtime 名称",mineOnly:"只看我创建的",noRuntimes:"暂无 Runtime。",unsupported:"不支持",createdByMe:"我创建的",connecting:"连接中…",connected:"已连接",connect:"连接",viewInfoFor:"查看 {{name}} 信息",viewInfo:"查看信息",agentAndRuntimeInfo:"Agent 与 Runtime 信息",detailType:"详情类型",agentInfo:"Agent 信息",runtimeInfo:"Runtime 信息",loadingAgentInfo:"读取 Agent 信息…",cannotLoadAgentInfo:"暂时无法读取 Agent 信息",unnamedAgent:"未命名 Agent",subagents:"子 Agent",tools:"工具",skills:"技能",previewUnsupported:"暂不支持预览",mountedComponents:"挂载组件",noMoreAgentInfo:"暂无更多 Agent 配置信息。",local:"本地",model:"模型",status:"状态",memoryMb:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",resources:"资源",version:"版本",loadingDetails:"读取详情…",environmentVariables:"环境变量",errors:{notFound:"该 Runtime 已不存在或列表信息已过期,请刷新列表后重试。",accessDenied:"当前账号无权访问该 Runtime,请检查所属 Project 和访问权限。",previewUnsupported:"该 Agent Server 版本暂不支持信息预览。",unavailable:"该 Runtime 暂时无法访问,请确认其状态为“就绪”后重试。",timeout:"加载超时,请重试"},componentKinds:{knowledgebase:"知识库",memory:"记忆",prompt_manager:"提示词管理",example_store:"样例库",run_processor:"运行处理器",tracer:"链路追踪",toolset:"工具集",plugin:"插件",other:"其他"},runtimeStatus:{ready:"就绪",unreleased:"未发布",running:"运行中",active:"运行中",creating:"创建中",pending:"等待中",deploying:"部署中",updating:"更新中",failed:"失败",error:"异常",stopping:"停止中",stopped:"已停止",deleting:"删除中",deleted:"已删除"}},m1e={agent:"智能体",agentTypes:{general:"通用智能体",mpa:"MPA 智能体",codex:"Codex","deepseek-harness":"DeepSeek",openclaw:"OpenClaw",hermes:"Hermes"},creator:"创建人",namedAgent:"{{name}} 智能体",storageLocation:"存储位置",currentBrowser:"当前浏览器",region:"地域",viewDeploymentProgress:"查看 {{name}} 部署进度",viewRuntimeDetails:"查看 {{name}} Runtime 详情",viewDetails:"查看 {{name}} 详情",time:"时间",remainingTime:"剩余时间",expiringSoon:"即将清空",sandboxRemaining:"{{hours}} 小时 {{minutes}} 分钟",wakeable:"已休眠",neverExpires:"永不过期",editDraftNamed:"编辑草稿 {{name}}",viewProgress:"查看进度",deleteDraftNamed:"删除草稿 {{name}}",recheckCompatibility:"重新检测 {{name}} 的对话兼容性",connectedNamed:"{{name}} 已连接",wakeAndChat:"唤醒 {{name}} 并开始对话",chatWith:"与 {{name}} 对话",waking:"唤醒中",deploying:"部署中",draft:"草稿",checking:"检测中",chatUnsupported:"不支持对话",checkFailed:"检测失败",creatorFilter:"创建人筛选",agentType:"智能体类型",searchAgents:"搜索智能体",handoff:"接力",agentList:"{{type}}列表",noMatchingAgents:"没有匹配的智能体",adjustSearch:"请尝试调整搜索或筛选条件",noAgentType:"暂无 {{type}}",noGeneralAgents:"暂无通用智能体",createGeneralAgentDescription:"创建一个通用智能体,开始构建和对话",createAgentType:"创建{{type}}",createAgent:"创建智能体",loadingMore:"正在加载更多智能体",scrollForMore:"继续下滑加载更多",allLoaded:"已加载全部智能体",deleteDraftTitle:"删除草稿?",deleteDraftDescription:"删除后将无法恢复“{{name}}”。",deleteDraft:"删除草稿",loadGeneralAgents:"加载通用智能体",loadAgentType:"加载 {{type}}",compatibility:{checking:"正在请求 Runtime /list-apps,以确认该智能体是否支持 Studio 对话。",empty:"Runtime /list-apps 未返回可用的 Agent,暂时无法连接对话。",supported:"Runtime 支持 Studio 对话。",unknownError:"Runtime /list-apps 请求失败,未返回可识别的错误信息。"},sandboxStatus:{ready:"就绪",wakeable:"已休眠",creating:"创建中",starting:"启动中",initializing:"启动中",pending:"等待中",running:"运行中",failed:"异常",error:"异常",stopped:"已停止",expired:"已过期",deleting:"删除中",deleted:"已删除",unknown:"未知状态"},wakingHint:"正在唤醒智能体,可能需要一些时间。",mpaCreate:{name:"名称",namePlaceholder:"例如 test-agent",nameHelp:"作为 Runtime 名称,支持 4–64 位字母、数字、下划线或连字符。",stepsLabel:"创建步骤",steps:{basics:"基本信息",postgres:"PostgreSQL",openviking:"OpenViking",autoPostgres:"数据库"},next:"下一步",previousStep:"上一步",pgDescription:"选择已有的 PostgreSQL 实例。创建流程会在该实例中准备智能体的独立业务库。",pgSplitDescription:"使用已配置的业务 PG Workspace。多个智能体共用此 Workspace,每个智能体拥有独立业务库。共享资源记录单独存放在 mpa_admin_workspace / mpa_admin_db,由管理员配置。",pgConsole:"前往火山引擎 AIDAP 创建或查看 PG Workspace",pgHost:"PG 主机地址",pgPort:"PG 端口",pgInvalid:"请填写有效的 PG 主机地址和端口。",pgCredentials:"PG 连接账号和密码由部署服务配置;主机和端口须与服务端配置一致。",openvikingDescription:"可选。三项全部填写才启用 OpenViking;全部留空则不向新智能体注入 OpenViking 配置。",openvikingConsole:"前往火山引擎查看 OpenViking 资源",openvikingUrl:"OpenViking 服务地址",openvikingResourceId:"OpenViking 资源 ID",openvikingApiKey:"OpenViking API Key",openvikingInvalid:"请同时填写有效的 HTTPS 服务地址、资源 ID 和 API Key,或全部留空。",openvikingCredentials:"API Key 仅用于本次创建,不保存到浏览器草稿;刷新页面后需重新填写。",tosTitle:"会话输出存储",tosDescription:"可选。填写完整的 TOS 凭证和存储桶,为新智能体的每个会话挂载独立输出目录。三项均留空时使用服务端预设;服务端未配置时,不启用 TOS 挂载。",tosAccessKey:"TOS Access Key",tosSecretKey:"TOS Secret Key",tosBucket:"TOS 存储桶",tosInvalid:"TOS Access Key、Secret Key 和存储桶必须同时填写。",tosCredentials:"凭证仅用于本次创建,不会保存在浏览器恢复数据或创建任务记录中。",runtimeImage:"MPA 镜像",workerImage:"Worker 镜像",imageDefault:"留空使用配置文件中的默认镜像",imageInvalid:"请输入有效的镜像地址,不要包含网址、空格或登录凭据。",title:"创建 MPA 智能体",agentId:"智能体 ID",description:"描述",region:"部署地域",plan:"创建计划",sharedResources:"准备或复用账号共享 VPC、子网和 APIG 消息网关",agentResources:"准备独立业务库、技能空间和执行环境,部署智能体",readiness:"检查网关和智能体就绪状态,成功后加入列表",checking:"正在检查创建配置…",configured:"创建配置已就绪。提交后会检查云资源并开始准备。",notConfigured:"尚未配置创建所需的资源参数,请联系管理员配置后重试。",loadFailed:"检查创建配置失败,请重试。",reload:"重新检查",submit:"开始创建",retry:"重试创建",newAgent:"新建另一个智能体",newAgentDescription:"新建另一个智能体将开启可编辑的新请求,替换当前恢复草稿,但不会取消旧任务。旧任务仍在运行时,请等待其结束后再提交。",close:"关闭",cancel:"取消创建",confirmCancel:"确认取消",cancelDescription:"取消后会停止后续步骤。已创建的数据库、技能空间、网关和其他已登记资源会保留,可使用同一智能体 ID 重试。",background:"关闭窗口后创建会继续。再次打开可查看进度。",pollFailed:"暂时无法获取进度,正在重新连接。请勿重复创建其他智能体。",iamPermissionDenied:"部署服务没有准备运行角色所需的 IAM 权限,请联系管理员授权后重试。",iamTrustConflict:"运行角色的信任关系不符合要求,请管理员检查对 VeFaaS 和 APIG 的授权后重试。",iamPolicyConflict:"运行角色所需的同名权限策略内容冲突,请管理员检查后重试。",iamOwnershipConflict:"运行角色与当前部署账号不匹配,请管理员检查后重试。",iamVerificationFailed:"尚未确认运行角色的权限已就绪,请检查 IAM 服务及策略可用性后重试。",iamConfigurationConflict:"自动准备运行角色仅支持默认 MPA 角色,请检查服务端创建配置。",creationFailed:"当前步骤未完成,请检查对应资源、服务端配置及权限后,用同一智能体 ID 重试。",cancelFailed:"取消请求失败,请重新查询进度后重试。",cancelled:"创建已取消,已登记资源保留供重试。",timeout:"创建超时,已登记资源保留。请检查对应资源后重试。",interrupted:"创建任务中断。请用同一智能体 ID 重试以恢复已登记资源。",skillSpace:"技能空间",states:{running:"正在创建",cancelling:"正在取消",succeeded:"创建成功",failed:"创建失败",cancelled:"已取消"},stages:{queued:"等待开始",iam_role:"准备运行角色",checking:"检查账号与配置",network:"准备 VPC 和子网",gateway:"准备 APIG 和 IM Gateway",database:"准备业务数据库",skills:"准备技能空间",worker:"准备执行环境",deploying:"准备数据库、技能空间和 Runtime",verifying:"等待智能体就绪",admin_workspace:"准备管理 PG Workspace",business_workspace:"准备业务 PG Workspace",admin_database:"初始化共享管理库"},back:"继续创建",pgAutoDescription:"使用 VeADK 部署账号自动创建或复用两个 PG Workspace:mpa_admin_workspace / mpa_admin_db 存放共享资源记录,业务 Workspace 供多个智能体共用,每个智能体拥有独立业务库。无需填写 PG 连接信息,提交创建后开始准备。",pgModeChanged:"此创建任务使用旧的 PG 配置,不能直接切换为自动模式重试。请联系管理员确认已有资源和任务后重新创建。",pgMigrationRequired:"检测到旧共享注册库。请先将共享资源记录迁移到 mpa_admin_workspace / mpa_admin_db,并完成现有 Runtime 的注册库地址切换;完成后点击“重新检查”。"}},g1e={library:"技能库",skill:"技能",skills:"技能",skillSpace:"技能空间",sandboxNotConfigured:"管理员未配置 Dev Sandbox",adminNotConfigured:"管理员未配置",totalItems:"共 {{count}} 项",cannotLoadSpaces:"无法加载技能空间",someSpacesFailed:"部分技能空间加载失败",degradedRelationWarning:"部分关联异常,已恢复可读取技能",downloadZip:"下载 ZIP",optimize:"优化",closeSkillDetails:"关闭技能详情",skillId:"技能 ID",allFiles:"完整文件",loadingSkillContent:"正在读取技能内容…",noSkillContent:"该技能暂无 SKILL.md 内容",addSkill:"添加技能",localUpload:"本地上传",localUploadDescription:"选择 ZIP 文件,校验通过后上传到技能空间",autoCreate:"自动创建",autoCreateDescription:"选择模型和风格,通过对话生成技能",createSkill:"创建技能",optimizeNamed:"优化 {{name}}",deleteSkillConfirm:"确定删除整个 Skill“{{name}}”吗?此操作会影响所有引用它的空间。",deleteSpaceConfirm:"确定删除 Skill 空间“{{name}}”吗?请先确认空间中的技能已删除。",manageSpaceDescription:"管理空间中的技能并创建新的版本",backToSpaces:"返回技能空间列表",overview:"概览",skillCount:"技能数量",skillCountValue_one:"{{count}} 技能",skillCountValue_other:"{{count}} 技能",updatedAt:"更新时间",skillsInSpace:"{{name}}中的技能",searchSkills:"搜索技能",cannotLoadSkills:"无法加载技能",noMatchingSkills:"没有匹配的技能",noSkills:"暂无技能",tryAnotherName:"请尝试搜索其他名称",emptySkillsDescription:"本地上传 Skill,或自动创建",actions:"操作",spaceDetails:"技能空间详情",editSpace:"编辑空间",deleteSpace:"删除空间",searchSpaces:"搜索技能空间",spaceList:"技能空间列表",noMatchingSpaces:"没有匹配的技能空间",createSpace:"新建技能空间",newSpace:"新建空间",loadingMoreSpaces:"正在加载更多技能空间",scrollForMore:"继续下滑加载更多",allSpacesLoaded:"已加载全部技能空间",errors:{loadSpaces:"读取技能空间失败,请稍后重试",loadSkills:"读取技能失败,请稍后重试",loadSkillDetails:"读取技能详情失败,请稍后重试",deleteSkill:"删除 Skill 失败",deleteSpace:"删除 Skill 空间失败",downloadSkill:"下载 Skill 失败"},status:{active:"可用",available:"可用",creating:"创建中",disabled:"已停用",enabled:"已启用",failed:"异常",inactive:"未启用",pending:"等待中",published:"已发布",ready:"就绪",released:"已发布",running:"运行中",success:"正常",unavailable:"不可用",unreleased:"未发布",updating:"更新中",unknown:"未知"},sharedSpace:"企业共享空间",sharedDescription:"面向企业全员开放的技能,由管理员统一发布和维护",sharedVisibility:"全员可见",sharedPreparing:"正在准备共享空间",sharedLoadFailed:"共享空间加载失败",sharedEmpty:"暂无共享技能,管理员发布后会显示在这里",requestPublication:"申请公开",reviewSubmitting:"提交中…",reviewSubmitted:"已申请",reviewFailed:"申请公开失败",reviewStatusFailed:"审核状态加载失败",reviewRetry:"重新申请",reviewPending:"待审核",reviewApproving:"发布中",reviewApproved:"已公开",reviewReturned:"已退回",reviewHistory:"审核记录",skillDetailSections:"技能详情内容",versions:{title:"版本管理",refresh:"刷新",uploading:"上传中…",upload:"上传新版本",close:"关闭",hint:"新版本不会替换已公开版本,审核通过后才会公开;ZIP 中的技能名称需与原技能一致",loading:"正在加载版本…",loadFailed:"无法加载版本",filesFailed:"无法加载版本文件",uploadFailed:"上传新版本失败",submitFailed:"提交申请失败",retry:"重试",empty:"暂无版本",current:"当前版本",notSubmitted:"未申请公开",submitting:"提交中…",submit:"申请公开",processing:"版本状态:{{status}}",filesLoading:"正在加载文件…",filesEmpty:"暂无文件",history:"历史审核记录",shared:"已公开"},author:"作者",authorName:"作者:{{name}}"},b1e={library:"知识库",createBase:"新建知识库",editBase:"编辑知识库",invalidName:"名称必须以字母开头,且只能包含字母、数字和下划线。",nameHelp:"以字母开头,仅支持字母、数字和下划线,最多 48 个字符。",optionalDescription:"描述(可选)",descriptionOnly:"AgentKit 当前仅支持更新知识库描述。",previewWeb:"预览网页内容",addData:"添加数据",openOriginalWeb:"打开原网页",backToEdit:"返回修改",confirmAdd:"确认添加",source:"知识来源",image:"图片",documentFile:"文档文件",webPage:"在线网页",webUrl:"网页 URL",generatingWebPreview:"正在抓取网页并生成 Markdown 预览",selectFile:"选择知识文件",selectOrDropFile:"选择文件或拖拽到这里",selectedFile:"{{size}} · 点击可重新选择",imageFileHelp:"支持 PNG、JPG 和 JPEG,单个文件不超过 200 MB",documentFileHelp:"支持 PDF、PPTX、DOCX、XLSX 和 TXT,单个文件不超过 200 MB",uploadingFile:"正在上传文件并添加到知识库",optionalName:"名称(可选)",optionalType:"类型(可选)",generatePreview:"生成预览",uploadFile:"上传文件",editMetadata:"编辑知识 Metadata",knowledge:"知识",field:"字段",value:"值",backToList:"返回知识库列表",metadataJson:"元数据(JSON)",provider:"服务提供方",knowledgeId:"知识库 ID",project:"项目",creator:"创建者",data:"数据",deleteInvalidAssociation:"删除失效关联",noData:"这个知识库还没有数据",addFirstData:"添加第一项数据",format:"格式",size:"大小",searchData:"搜索数据",searchLibraryData:"搜索知识库数据",associationInvalid:"关联已失效",providerMissing:"底层 Provider 知识库已不存在",noMatchingData:"没有匹配的数据",loadingMoreData:"正在加载更多数据",retryLoading:"重试加载",details:"知识库详情",searchBases:"搜索知识库",someBasesFailed:"部分知识库暂时无法加载,已展示其余可用内容。",noMatchingBases:"没有匹配的知识库",noManagePermission:"您没有管理此知识库的权限",loadingMoreBases:"正在加载更多知识库",deleteBaseTitle:"删除知识库?",deleteBaseDescription:"将删除 {{name}} 的 AgentKit 关联;如果它由 Studio 创建,也会同时删除 Provider 资源。此操作无法撤销。",deleteDocumentTitle:"删除知识?",deleteDocumentDescription:"将从 Provider 知识库中删除 {{name}},此操作无法撤销。",preview:{processingTitle:"数据正在处理中",processingDetail:"知识库完成解析后即可预览,请稍后重新加载。",failedTitle:"数据解析失败",failedDetail:"请检查源文件或网页地址后重新添加,也可以重新加载最新状态。",noParsedTitle:"暂时没有可预览的解析内容",noParsedDetail:"此类文件会在知识库完成解析后显示文本、表格或页面图片。",noMediaTitle:"暂时没有可预览的媒体内容",noMediaDetail:"知识库尚未返回可访问的媒体预览,请稍后重新加载。",noDataTitle:"暂无可预览的数据内容",noDataDetail:"知识库尚未返回解析结果,请稍后重新加载。",attachmentError:"附件无法预览,请稍后重试。",imageAlt:"知识数据图片",audioUnsupported:"当前浏览器不支持音频预览。",videoUnsupported:"当前浏览器不支持视频预览。",namedPdf:"{{name}} PDF 预览",pdf:"PDF 预览",openPdf:"无法显示时,在新窗口打开 PDF",fileUnsupported:"当前格式暂不支持直接在线预览,已优先显示解析后的内容。",openOriginalFile:"打开原文件",loading:"正在加载数据预览",openOriginalHint:"您可以打开原网页查看来源内容。",chunk:"片段 {{index}}",loadingMore:"正在加载更多",loadMore:"加载更多"},errors:{fileTooLarge:"单个文件不能超过 200 MB",invalidImageType:"请选择 PNG、JPG 或 JPEG 图片",invalidDocumentType:"请选择 PDF、PPTX、DOCX、XLSX 或 TXT 文件",createBase:"创建知识库失败",updateBase:"更新知识库失败",metadataObject:"Metadata 必须是 JSON 对象",metadataFormat:"Metadata 格式错误",noWebPreview:"网页没有可预览的 Markdown 内容",addWeb:"添加网页失败",previewWeb:"生成网页预览失败",uploadFile:"上传文件失败",updateDocument:"更新知识失败",loadPreview:"加载数据预览失败",loadMoreBases:"加载更多知识库失败",loadBases:"加载知识库失败",loadMoreData:"加载更多数据失败",loadData:"加载数据失败",deleteBase:"删除知识库失败",deleteDocument:"删除知识失败"}},y1e={title:"飞书渠道",refresh:"刷新",loading:"正在加载渠道配置…",unsupported:"此 Runtime 不支持渠道管理,请升级 MPA 镜像。",unauthorized:"渠道管理需要 Studio 管理员身份及有效的 Runtime 凭据。",configurationError:"渠道管理配置不完整,请检查 Runtime 元数据及加密密钥。",requestFailed:"渠道请求失败,请检查 Runtime 连接后重试。",bound:"已绑定:{{name}}",unbound:"尚未绑定飞书机器人。",guidance:"私聊使用独立会话。在已授权群内 @ 当前机器人即可对话。",keyRequired:"绑定前请在 Runtime 配置持久的 CHANNEL_STATE_ENCRYPTION_KEY。",gateway:"消息网关",route:"入站路由",delivery:"回复投递",configured:"已配置",missing:"未配置",delivery_not_observed:"尚未观测",delivery_delivered:"已投递",delivery_retrying:"重试中",missingConfig:"缺少 Runtime 配置:{{fields}}",bind:"扫码绑定",newQr:"重新生成二维码",unbind:"解除绑定",confirmUnbind:"确认解绑此机器人?解绑后将停止接收新消息。",qrAlt:"机器人绑定二维码",openQr:"打开授权页面",uncertain:"注册过程已中断。重新开始前,请检查机器人绑定与 Gateway 状态。",bindingFailed:"绑定失败,请检查 Gateway 配置后重试。",chatId:"允许的群 ID",scope:"群会话策略",saveGroup:"保存群权限",noGroups:"尚未授权任何群。私聊无需群权限。",edit:"编辑",remove:"移除",removeGroup:"移除 {{name}}",scope_group_sender:"按发言人隔离",scope_group:"全群共享",scope_group_topic_sender:"按话题和发言人隔离",scope_group_topic:"按话题共享",status_PENDING:"等待扫码",status_SCANNED:"已扫码,等待授权",status_AUTHORIZED:"已授权,准备注册",status_REGISTERING:"正在注册机器人",status_BOUND:"机器人已绑定",status_FAILED:"绑定失败",status_EXPIRED:"二维码已过期",workspaceTitle:"消息渠道",workspaceDescription:"连接消息平台,让用户直接与此智能体对话,并管理访问权限。",provider_feishu:"飞书",provider_wecom:"企业微信",provider_dingtalk:"钉钉",comingSoon:"暂未开放",unavailableDescription:"{{name}}的绑定与消息配置暂未开放。",runtimeRequired:"请先将此智能体部署到 Runtime,再配置消息渠道。",bindingTitle:"机器人绑定",connected:"已绑定",notBound:"未绑定",gatewayDescription:"用于接收渠道消息的网关配置。",routeDescription:"将渠道消息转发给当前智能体的路由配置。",deliveryDescription:"实际观测到的回复投递状态,完成配置不代表已成功投递。",groupsTitle:"群聊权限",groupsDescription:"添加允许访问的群,并设置群内对话的共享范围。",providerBindingTitle:"绑定{{name}}",providerUnbound:"绑定{{name}}机器人,让用户通过消息与此智能体对话。",qrGuidance:"使用{{name}}扫码授权,Runtime 将保存机器人凭据并配置消息网关。",wecomGuidance:"使用企业微信扫码授权,或手动填写 Bot ID 和 Secret 绑定已有机器人。",wecomBotId:"Bot ID",wecomSecret:"Secret",bindCredentials:"绑定机器人",wecomScan:"扫码绑定",wecomAuthorizing:"等待企业微信授权…",cancelAuthorization:"取消授权",wecomPopupBlocked:"授权窗口被浏览器拦截,请允许弹窗后重试。",wecomAuthCancelled:"已取消企业微信授权,可以重新扫码。",wecomAuthTimeout:"企业微信授权已超时,请重新扫码。",wecomInvalidResult:"授权结果缺少 Bot ID 或 Secret,请重新授权或手动填写。",wecomAuthFailed:"企业微信授权失败,请重试或手动填写凭据。",dingtalkClientId:"Client ID",dingtalkClientSecret:"Client Secret",manualUpgrade:"当前镜像尚不支持{{name}}手动配置,请升级后使用;仍可使用极速配置。",pairingTitle:"消息渠道扫码配对",feishuPairingDescription:"如果已有连接机器人,飞书扫码并绑定成功后原有机器人会被替换,可选绑定存量机器人或新建机器人。",generatingQr:"正在生成配对二维码…",dingtalkGuidance:"使用钉钉扫码授权,或手动填写 Client ID 和 Client Secret 绑定已有机器人。",wecomPairingDescription:"将在企业微信授权窗口中重新扫码配对。新机器人绑定成功后会替换当前连接;取消授权或绑定失败不会解绑原机器人。",configurationMethod:"配置方式",quickSetup:"极速配置",manualSetup:"手动配置",feishuAppId:"App ID",feishuAppSecret:"App Secret",manualGuidance:"填写已有{{name}}机器人的应用凭据,连接到当前智能体。",manualReplacement:"绑定成功后将替换当前机器人;取消或绑定失败不会解除现有绑定。"},WVe={common:Xwe,agentKitPromo:Ywe,systemInfo:Zwe,agentWorkspace:Jwe,environmentCenter:e1e,deploymentSelect:t1e,deploymentError:n1e,studioBuildProgress:i1e,cloudEnvironment:r1e,githubCicd:s1e,feishuDeployment:a1e,deploymentResources:o1e,studioUpdate:l1e,projectPreview:c1e,workspace:u1e,resourceCollection:d1e,skillSourcePicker:f1e,composer:h1e,agentSelector:p1e,myAgents:m1e,skillCenter:g1e,knowledge:b1e,channels:y1e},KVe=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:Ywe,agentSelector:p1e,agentWorkspace:Jwe,channels:y1e,cloudEnvironment:r1e,common:Xwe,composer:h1e,default:WVe,deploymentError:n1e,deploymentResources:o1e,deploymentSelect:t1e,environmentCenter:e1e,feishuDeployment:a1e,githubCicd:s1e,knowledge:b1e,myAgents:m1e,projectPreview:c1e,resourceCollection:d1e,skillCenter:g1e,skillSourcePicker:f1e,studioBuildProgress:i1e,studioUpdate:l1e,systemInfo:Zwe,workspace:u1e},Symbol.toStringTag,{value:"Module"})),v1e="用户管理",x1e="{{count}} 位成员",w1e="用户",O1e="角色",k1e="账号状态",S1e="最近登录",E1e="操作",C1e="更改角色",A1e="关闭",T1e="保存角色",_1e="正在保存…",j1e="取消",N1e="返回",R1e="用户池",I1e="火山引擎 Identity",P1e="搜索姓名、邮箱或用户 ID",D1e="搜索",M1e="筛选角色",L1e="全部角色",$1e="刷新",F1e="正在读取用户…",B1e="更新于 {{time}}",U1e="已将 {{name}} 设置为{{role}}",Q1e="重试",z1e="你",V1e="初始超级管理员",H1e="初始超级管理员受保护,不能在此降级",q1e="保存后,对方刷新 Studio 即可使用新的权限",W1e="角色需要重新确认",K1e="没有匹配的用户",G1e="尝试其他关键词或角色",X1e="用户登录或加入当前用户池后会显示在这里",Y1e="共 {{count}} 位用户",Z1e="上一页",J1e="下一页",eOe="尚未登录",tOe="未提供",nOe={super_admin:"超级管理员",admin:"管理员",developer:"开发者",user:"普通用户"},iOe={super_admin:"管理所有资源,并管理用户和分配角色",admin:"管理 Studio 资源",developer:"开发智能体并管理自己的资源",user:"使用智能体和个人功能"},rOe={EXTERNAL_PROVIDER:"正常",CONFIRMED:"正常",NORMAL:"正常",ENABLED:"正常",ACTIVE:"正常",UNCONFIRMED:"待验证",DISABLED:"已停用",FORBIDDEN:"已禁用",LOCKED:"已锁定",SUSPENDED:"已暂停",FORCE_CHANGE_PASSWORD:"需要修改密码"},sOe={request_failed:"请求未完成,请刷新列表确认当前状态后重试",invalid_response:"用户服务返回异常,请刷新后重试",identity_unavailable:"暂时无法访问 Identity,请稍后重试或检查服务权限",identity_resource_missing:"用户或用户池已不存在,请刷新列表",super_administrator_required:"只有超级管理员可以管理用户",sign_in_required:"请登录后重试",user_not_in_pool:"当前账号不属于此用户池",user_disabled:"当前账号已停用",protected_administrator:"不能降低初始超级管理员的权限",cannot_demote_self:"不能降低自己的超级管理员权限",role_change_conflict:"角色已发生变化,请关闭弹窗并刷新列表后重试",cross_origin_request:"请在当前 Studio 页面内修改角色"},GVe={title:v1e,memberCount:x1e,user:w1e,role:O1e,status:k1e,lastLogin:S1e,actions:E1e,changeRole:C1e,close:A1e,save:T1e,saving:_1e,cancel:j1e,back:N1e,pool:R1e,volcengineIdentity:I1e,searchPlaceholder:P1e,search:D1e,filterRole:M1e,allRoles:L1e,refresh:$1e,loading:F1e,updatedAt:B1e,saved:U1e,retry:Q1e,you:z1e,initialAdministrator:V1e,protectedExplanation:H1e,effectiveAfterRefresh:q1e,roleConflict:W1e,noUsers:K1e,tryAnotherSearch:G1e,poolEmpty:X1e,resultCount:Y1e,previous:Z1e,next:J1e,neverLoggedIn:eOe,unknown:tOe,roles:nOe,descriptions:iOe,states:rOe,errors:sOe},XVe=Object.freeze(Object.defineProperty({__proto__:null,actions:E1e,allRoles:L1e,back:N1e,cancel:j1e,changeRole:C1e,close:A1e,default:GVe,descriptions:iOe,effectiveAfterRefresh:q1e,errors:sOe,filterRole:M1e,initialAdministrator:V1e,lastLogin:S1e,loading:F1e,memberCount:x1e,neverLoggedIn:eOe,next:J1e,noUsers:K1e,pool:R1e,poolEmpty:X1e,previous:Z1e,protectedExplanation:H1e,refresh:$1e,resultCount:Y1e,retry:Q1e,role:O1e,roleConflict:W1e,roles:nOe,save:T1e,saved:U1e,saving:_1e,search:D1e,searchPlaceholder:P1e,states:rOe,status:k1e,title:v1e,tryAnotherSearch:G1e,unknown:tOe,updatedAt:B1e,user:w1e,volcengineIdentity:I1e,you:z1e},Symbol.toStringTag,{value:"Module"})),aOe="网站集成",oOe="将 AgentKit Runtime 以悬浮聊天窗口嵌入网站",lOe="返回自动化列表",cOe="添加网站",uOe="正在加载 Runtime",dOe="选择 Runtime",fOe="网站域名",hOe="例如 xxxx.com 或 localhost:5173",pOe="正在生成",mOe="生成 Token",gOe="已添加网站",bOe="{{count}} 个",yOe="{{count}} 个",vOe="正在加载网站集成",xOe="还没有网站集成",wOe="选择 Runtime 并输入网站域名即可生成 Token",OOe="引入方法",kOe="将下面代码放到网页的 body 结束标签前",SOe="已复制",EOe="复制代码",COe="添加网站后会在这里生成引入代码。",AOe="确定删除 {{domain}} 的网站集成吗?",TOe={load:"加载网站集成失败",create:"创建网站集成失败",delete:"删除网站集成失败",noConversationalAgent:"该 Runtime 暂未发现可对话的 Agent"},_Oe={requestFailed:"请求失败 ({{status}})",greeting:"您好,有什么可以帮您?",sessionFailed:"无法建立对话会话",unauthorized:"当前网站未获得对话授权",conversationFailed:"对话请求失败,请稍后重试",open:"打开智能体对话",close:"关闭智能体对话",panelLabel:"智能体对话面板",assistant:"智能体助手",online:"在线对话"},YVe={title:aOe,description:oOe,backToAutomations:lOe,addWebsite:cOe,loadingRuntime:uOe,selectRuntime:dOe,websiteDomain:fOe,domainPlaceholder:hOe,generating:pOe,generateToken:mOe,addedWebsites:gOe,websiteCount_one:bOe,websiteCount_other:yOe,loadingIntegrations:vOe,delete:"删除",emptyTitle:xOe,emptyDescription:wOe,embedMethod:OOe,embedInstructions:kOe,copied:SOe,copyCode:EOe,embedHint:COe,confirmDelete:AOe,errors:TOe,widget:_Oe},ZVe=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:cOe,addedWebsites:gOe,backToAutomations:lOe,confirmDelete:AOe,copied:SOe,copyCode:EOe,default:YVe,description:oOe,domainPlaceholder:hOe,embedHint:COe,embedInstructions:kOe,embedMethod:OOe,emptyDescription:wOe,emptyTitle:xOe,errors:TOe,generateToken:mOe,generating:pOe,loadingIntegrations:vOe,loadingRuntime:uOe,selectRuntime:dOe,title:aOe,websiteCount_one:bOe,websiteCount_other:yOe,websiteDomain:fOe,widget:_Oe},Symbol.toStringTag,{value:"Module"})),jOe={types:{all:"全部类型",document:"文档",image:"图片",video:"视频"},previewArtifact:"预览 {{name}}",moreActions:"更多操作 {{name}}",actionMenu:"{{name}} 操作",download:"下载",downloading:"下载中",edit:"编辑信息",delete:"删除产物",previewFailed:"无法预览“{{name}}”:{{message}}",downloadStarted:"已开始下载 {{name}}",downloadFailed:"无法下载“{{name}}”:{{message}}",updated:"已更新 {{name}}",deleted:"已删除 {{name}}",deleteFailed:"无法删除“{{name}}”:{{message}}",typeFilter:"产物类型",searchAria:"搜索产物",searchPlaceholder:"搜索产物或会话",retry:"重试",close:"关闭",listAria:"产物列表",loadFailed:"产物加载失败",loadDetailFallback:"请检查存储配置后重试。",reload:"重新加载",noMatch:"没有找到匹配的产物",noArtifacts:"您还没有任何产物",searchHint:"请尝试搜索其他名称或切换类型",emptyHint:"聊天中生成的产物会自动显示在这里",columns:{name:"名称",source:"来源",updatedAt:"修改时间",actions:"操作"},loadingMore:"正在加载更多产物",unknownTime:"时间未知",preview:{close:"关闭预览",meta:"{{type}} / 版本 {{version}}",loading:"正在加载预览",alt:"{{name}} 预览",loadFailed:"预览加载失败,请稍后重试或下载查看",unsupported:"当前格式暂不支持在线预览,请下载查看",sourceAria:"产物来源",agent:"智能体",session:"会话",tool:"生成工具",createdAt:"生成时间",fileSize:"文件大小",tags:"标签",viewSession:"查看会话"},deleteDialog:{title:"删除产物?",description:"“{{name}}”将从产物库永久删除,聊天记录不会受到影响。",deleting:"删除中",confirm:"删除",close:"关闭删除确认框"},api:{withStatus:"{{message}}({{status}})",listFailed:"读取产物库失败",syncFailed:"同步聊天产物失败",updateFailed:"更新产物失败",deleteFailed:"删除产物失败",downloadFailed:"下载产物失败"}},NOe={unknownSource:"未知来源",unknownCreator:"未知创建者"},ROe={nameRequired:"请输入产物名称",tooManyTags:"标签最多 {{max}} 个",tagTooLong:"单个标签不能超过 {{max}} 个字符",title:"编辑产物信息",subtitle:"内容文件不会被修改",close:"关闭编辑框",name:"名称",description:"描述",descriptionPlaceholder:"补充用途、版本或使用说明",tags:"标签",tagsPlaceholder:"使用逗号分隔,最多 {{max}} 个",cancel:"取消",saving:"保存中",save:"保存"},IOe={change:{added:"新增",modified:"修改",deleted:"删除"},noChanges:"两个版本的源码没有差异",chooseFile:"从左侧选择文件以查看代码",compareTitle:"版本对比",workspaceTitle:"源码工作区",projectFallback:"Agent 项目",switchTheme:"切换源码主题",switchThemeTitle:"切换为{{theme}}主题",themes:{dark:"深色",light:"浅色"},closeWorkspace:"关闭源码工作区",close:"关闭",changedFiles:"变更文件",projectFiles:"项目文件",changes:"变更",files:"文件",openFiles:"打开的文件",noFileSelected:"未选择文件",comparisonDirection:"对比方向",before:"优化前",after:"优化后",loadingEditor:"正在加载编辑器…",changedFileCount_one:"{{count}} 个文件有变更",changedFileCount_other:"{{count}} 个文件有变更",fileCount_one:"{{count}} 个文件",fileCount_other:"{{count}} 个文件",lineCount_one:"{{count}} 行 · UTF-8",lineCount_other:"{{count}} 行 · UTF-8",viewSource:"查看源码",viewSourceAria:"查看和编辑项目源码"},POe={nav:"搜索",selectAgent:"请选择 Agent",checkingCapabilities:"正在检测 Agent 能力",notMounted:"当前 Agent 未挂载{{label}}",sources:{session:"会话",web:"网络",knowledge:"知识库",memory:"长期记忆"},webDescription:"通过 web_search 工具检索",backendLocal:"本地",failed:"搜索失败:{{message}}",placeholder:{selectAgent:"请先选择 Agent",web:"在网络中检索",knowledge:"在 {{name}} 中检索",knowledgeFallback:"当前 Agent 的知识库",memory:"在 {{name}} 中检索",memoryFallback:"当前用户的长期记忆",session:"在当前 Agent 的会话中检索"},sourceTypeAria:"搜索类型:{{label}}",notSelected:"未选择",sourceType:"搜索类型",selectSource:"选择搜索类型",noAgentHint:"选择一个 Agent 后,即可检索会话、网络及其挂载的数据源。",loadingCapabilities:"正在读取当前 Agent 的检索能力…",sourceUnavailable:"当前 Agent 未挂载该数据源",instructions:{web:"输入关键词后回车或点击按钮,通过 web_search 工具检索。",knowledge:"输入问题,检索当前 Agent 挂载的知识库。",memory:"输入线索,检索当前用户跨会话保存的长期记忆。",session:"输入关键词后回车或点击按钮,搜索当前 Agent 的会话。"},noResults:"未找到匹配“{{query}}”的结果。",knowledgeFragment:"知识片段 {{index}}",memoryFragment:"记忆片段 {{index}}"},DOe={title:"开发者资源",sections:{documentation:{title:"相关链接",description:"查看开发文档与 AgentKit 常用入口"},bestPractices:{title:"最佳实践",description:"参考开发、调试与部署经验"},showcases:{title:"案例展示",description:"探索 AgentKit 应用案例"}},links:{veadkDocs:"VeADK 文档",cliDocs:"AgentKit CLI 文档",platformDocs:"AgentKit 平台文档",console:"AgentKit 控制台"},articles:{veadkDevelopment:{title:"使用 VeADK 开发并部署智能体",description:"使用 VeADK 构建 Agent,并部署至 AgentKit 智能体运行时。"},cliDevelopment:{title:"使用 AgentKit CLI 开发并部署智能体",description:"通过 AgentKit CLI 创建项目、调试 Agent,并完成部署。"},coverAlt:"{{title}}文章封面"},showcases:{researchAssistant:{title:"多智能体研究助手",description:"由多个专业 Agent 协同完成资料检索、分析和结论整理。"},multimodalAnalysis:{title:"多模态内容分析",description:"在统一会话中理解图片、文档和视频内容。"},customerService:{title:"智能客服工作台",description:"结合知识检索与工具调用处理复杂的客户服务任务。"},webSearch:{title:"联网搜索 Agent",description:"检索实时网页内容,并将信息整理为可追溯的回答。"},a2uiApp:{title:"A2UI 交互应用",description:"让 Agent 根据任务过程生成可交互的前端界面。"},previewAlt:"{{title}}界面预览"}},MOe={title:"资源库",untitledSession:"未命名会话",categoryAria:"资源库分类",regionAria:"区域",tabs:{skills:"技能库",knowledge:"知识库",artifacts:"产物"}},LOe={title:"管理 Agent",subtitle:"列出你有权管理的 AgentKit Runtime",mainAgentOnly:"仅显示主 Agent(控制面信息)。",deleteConfirm:'确定删除 Agent "{{name}}"?该 Runtime 将被永久删除。',regionFilterTitle:"按区域筛选",regionFilterAria:"区域筛选",regionAria:"区域",refresh:"刷新",loading:"加载中…",empty:"暂无你部署的 Agent。",connected:"已连接",connect:"连接到此 Agent",deleteRuntime:"删除该 Runtime",loadingDetail:"读取详情…",agentStructure:"Agent 结构",secretHidden:"敏感值不展示,可通过授权请求直接复制",revealSecret:"{{key}} 的敏感值",copySecret:"复制 {{key}} 的值",copy:"复制",copied:"已复制",copyFailed:"复制失败",notConfigured:"未配置",fields:{model:"模型",description:"描述",status:"状态信息",project:"项目",version:"版本",resources:"资源",memory:"记忆",tool:"工具",knowledge:"知识",mcpToolset:"MCP 工具集",updatedAt:"更新时间"},resource:{memory:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",concurrency:"并发 {{value}}"},environmentVariables:"环境变量",unnamed:"(未命名)"},$Oe={mainAgent:"主 Agent",subAgent:"子 Agent {{index}}",itemCount_one:"{{count}} 项",itemCount_other:"{{count}} 项",info:"Agent 信息",infoAndTopology:"Agent 信息与设置",loadingInfo:"正在读取 Agent 信息…",unnamedAgent:"未命名 Agent",agentsMd:"AGENTS.md",tools:"工具",toolList:"工具列表",studioTool:"Studio Tool",removeTool:"移除工具 {{name}}",remove:"移除",notConfigured:"未配置",addStudioTool:"添加 Studio 工具",addStudioToolHere:"在此对话中添加 Studio 工具",skills:"技能",skillList:"技能列表",addSkill:"添加技能空间技能",addSkillHere:"向此会话添加技能空间技能",skillMountNextTurn:"挂载的版本将在下一 Turn 开始时冻结。",previewUnsupported:"暂不支持预览",sessionEnvironment:"会话环境",environment:"环境",agentCanvas:"Agent 画布",topology:"结构拓扑",nodeKinds:{agent:"Agent",sandbox:"沙箱","worker-session":"Worker 会话","skill-space":"技能空间",skill:"技能","studio-tool":"Studio 工具",mcp:"MCP",environment:"环境",knowledge:"知识库","sub-agent":"子 Agent"},nodeStatuses:{configured:"已配置",mounted:"已挂载",running:"运行中",paused:"已暂停"},viewCanvasFullscreen:"全屏查看 Agent 画布",viewFullscreen:"全屏查看",executionCanvas:"Agent 执行画布",fullscreenExecutionCanvas:"全屏 Agent 执行画布",closeFullscreenCanvas:"关闭全屏画布",close:"关闭",capabilitiesSubtitle:"能力与协作拓扑",closeInfo:"关闭 Agent 信息",infoUnavailable:"暂时无法读取 Agent 信息。",refresh:"刷新信息",loadingSkills:"正在加载绑定技能…",sessionSkills:"本会话临时技能",noBoundSpace:"当前智能体未绑定技能空间。",noBoundSkills:"绑定的技能空间暂无技能。",loadFailed:"加载失败,请刷新重试。",accessDenied:"无权读取此信息。",documentUnsupported:"当前 Runtime 不支持 Studio 读取 AGENTS.md,请升级 Runtime 镜像。",skillsUnsupported:"当前 Runtime 未提供技能空间绑定信息。",skillsDegraded:"技能信息不完整,请刷新重试。",documentEditHint:"编辑最新版本。保存会发布新版本到此技能空间,可能影响使用它的其他智能体。运行中的会话可能需要等待缓存刷新或新建会话后生效。请保留 frontmatter 中的 name。",documentLoading:"正在加载 SKILL.md…",documentWritable:"可编辑",documentReadOnly:"只读:此空间或当前权限不允许编辑",documentLoadFailed:"无法加载 SKILL.md,请刷新重试。",documentSaveFailed:"未确认保存成功,已保留编辑内容。重试前请重新打开,检查当前版本。",documentConflict:"技能已有新版本。请复制当前修改,再重新打开编辑器,避免覆盖。",discardDocument:"放弃未保存的修改?",keepEditing:"继续编辑",discardChanges:"放弃修改",saveDocument:"保存为新版本"},FOe={mountFailed:"挂载环境失败",closeDialog:"关闭环境弹窗",addTitle:"添加环境",description:"选择当前会话允许 Agent 使用的 Sandbox 环境",closeAdd:"关闭添加环境",searchAria:"搜索环境",searchPlaceholder:"搜索环境名称或能力",availableAria:"可用环境与工作区",loading:"正在读取可用环境…",noMatch:"没有匹配的环境或工作区",workspaces:"工作区",reuseAll:"复用工作区中的全部可用环境",availableEnvironmentCount_one:"{{count}} 个可用环境",availableEnvironmentCount_other:"{{count}} 个可用环境",selectWorkspace:"选择工作区 {{name}}",environments:"环境",includedByWorkspaces:"已由工作区 {{names}} 包含",nameSeparator:"、",selectEnvironment:"选择环境 {{name}}",selectedWorkspaceCount_one:"{{count}} 个工作区",selectedWorkspaceCount_other:"{{count}} 个工作区",coveredEnvironmentCount_one:"{{count}} 个环境",coveredEnvironmentCount_other:"{{count}} 个环境",selectionSummary:"已选择 {{workspaces}},覆盖 {{environments}}",cancel:"取消",mounting:"正在挂载…",confirm:"确认添加",mountedAria:"已挂载环境",environmentCount_one:"{{count}} 个环境",environmentCount_other:"{{count}} 个环境",removeWorkspace:"移除工作区 {{name}}",remove:"移除",removeEnvironment:"移除环境 {{name}}",add:"添加环境",addMore:"添加更多环境",addForSession:"为当前 Session 添加环境",loadingAvailable:"正在加载可用环境…",empty:"暂无可用的 AIO Sandbox 环境。"},BOe={loading:{searching:"正在查找已有环境",creating:"环境初始化中",connecting:"正在连接已有环境"},initializationFailed:"AgentKit CLI 环境初始化失败,当前状态:{{status}}。",sessionExpired:"AgentKit CLI Session 不存在或已过期,请重试。",initializationTimeout:"AgentKit CLI 环境初始化超时,请稍后重试。",nonPersistent:"非持久化环境",recyclingHoursMinutes:"{{hours}} 小时 {{minutes}} 分钟后环境回收",recyclingMinutes:"{{minutes}} 分钟后环境回收",connectionError:`无法连接 Studio 服务,未收到服务端响应。 原始错误:{{message}}`,unavailable:"连接不可用",requestFailed:"AgentKit CLI 请求失败",retry:"重试",terminalTitle:"AgentKit CLI 终端"},UOe={labels:{coding:"智能编程",get_city_weather:"城市天气查询",get_location_weather:"位置天气查询",web_fetch:"网页内容获取",studio_write_artifact:"保存会话产物"},closeDialog:"关闭弹窗",title:"添加 Studio 工具",description:"由 Studio BFF 为 {{agentName}} 的当前会话执行,Runtime 无需预装",close:"关闭添加 Studio 工具",searchAria:"搜索 Studio 工具",searchPlaceholder:"搜索名称或工具标识",availableAria:"可用 Studio 工具",loading:"正在读取 Studio 工具…",noMatch:"没有匹配的 Studio 工具",remove:"移除",add:"添加"},QOe={artifactLibrary:jOe,resourceMetadata:NOe,artifactEdit:ROe,codeBrowser:IOe,search:POe,developerResources:DOe,library:MOe,manageAgents:LOe,agentTopology:$Oe,sessionEnvironment:FOe,agentKitCli:BOe,studioTools:UOe},JVe=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:BOe,agentTopology:$Oe,artifactEdit:ROe,artifactLibrary:jOe,codeBrowser:IOe,default:QOe,developerResources:DOe,library:MOe,manageAgents:LOe,resourceMetadata:NOe,search:POe,sessionEnvironment:FOe,studioTools:UOe},Symbol.toStringTag,{value:"Module"})),jU=["zh-CN","en-US"],hA="en-US",zOe="agentkit.studio.locale",eHe={"zh-CN":{dir:"ltr",nativeName:"简体中文"},"en-US":{dir:"ltr",nativeName:"English"}};function pA(e){if(!e)return null;const t=e.trim().replace(/_/g,"-").toLowerCase(),n=jU.find(i=>i.toLowerCase()===t);return n||(t==="zh"||t.startsWith("zh-")?"zh-CN":t==="en"||t.startsWith("en-")?"en-US":null)}function Eo(e,t){const n=(e==null?void 0:e.trim())??"";if(!n)return"";const i=new RegExp("\\p{Script=Han}","u").test(n);return t.toLowerCase().startsWith("zh")===i?n:""}function tHe(){if(typeof window>"u")return null;try{return pA(window.localStorage.getItem(zOe))}catch{return null}}function nHe(){if(typeof window>"u")return[];const e=window.navigator;return e?e.languages.length>0?e.languages:e.language?[e.language]:[]:[]}function iHe(){const e=tHe();if(e)return e;for(const t of nHe()){const n=pA(t);if(n)return n}return hA}function rHe(e){if(!(typeof window>"u"))try{window.localStorage.setItem(zOe,e)}catch{}}function VOe(e){typeof document>"u"||(document.documentElement.lang=e,document.documentElement.dir=eHe[e].dir)}const Zn=e=>typeof e=="string",qO=()=>{let e,t;const n=new Promise((i,r)=>{e=i,t=r});return n.resolve=e,n.reject=t,n},O5=e=>e==null?"":String(e),sHe=(e,t,n)=>{e.forEach(i=>{t[i]&&(n[i]=t[i])})},aHe=/###/g,DG=e=>e&&e.includes("###")?e.replace(aHe,"."):e,MG=e=>!e||Zn(e),CS=(e,t,n)=>{const i=Zn(t)?t.split("."):t;let r=0;for(;r{const{obj:i,k:r}=CS(e,t,Object);if(i!==void 0||t.length===1){i[r]=n;return}let s=t[t.length-1],o=t.slice(0,t.length-1),l=CS(e,o,Object);for(;l.obj===void 0&&o.length;)s=`${o[o.length-1]}.${s}`,o=o.slice(0,o.length-1),l=CS(e,o,Object),l!=null&&l.obj&&typeof l.obj[`${l.k}.${s}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${s}`]=n},oHe=(e,t,n,i)=>{const{obj:r,k:s}=CS(e,t,Object);r[s]=r[s]||[],r[s].push(n)},oR=(e,t)=>{const{obj:n,k:i}=CS(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,i))return n[i]},lHe=(e,t,n)=>{const i=oR(e,n);return i!==void 0?i:oR(t,n)},HOe=(e,t,n)=>{for(const i in t)i!=="__proto__"&&i!=="constructor"&&(Object.prototype.hasOwnProperty.call(e,i)?Zn(e[i])||e[i]instanceof String||Zn(t[i])||t[i]instanceof String?n&&(e[i]=t[i]):HOe(e[i],t[i],n):e[i]=t[i]);return e},Kh=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),cHe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},uHe=e=>Zn(e)?e.replace(/[&<>"'\/]/g,t=>cHe[t]):e;class dHe{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const i=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,i),this.regExpQueue.push(t),i}}const fHe=[" ",",","?","!",";"],hHe=new dHe(20),pHe=(e,t,n)=>{t=t||"",n=n||"";const i=fHe.filter(o=>!t.includes(o)&&!n.includes(o));if(i.length===0)return!0;const r=hHe.getRegExp(`(${i.map(o=>o==="?"?"\\?":o).join("|")})`);let s=!r.test(e);if(!s){const o=e.indexOf(n);o>0&&!r.test(e.substring(0,o))&&(s=!0)}return s},dF=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const i=t.split(n);let r=e;for(let s=0;se==null?void 0:e.replace(/_/g,"-"),mHe={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var n,i;(i=(n=console==null?void 0:console[e])==null?void 0:n.apply)==null||i.call(n,console,t)}};class lR{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||mHe,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,i,r){return r&&!this.debug?null:(t=t.map(s=>Zn(s)?s.replace(/[\r\n\x00-\x1F\x7F]/g," "):s),Zn(t[0])&&(t[0]=`${i}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new lR(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new lR(this.logger,t)}}var nh=new lR;let XP=class{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const r=this.observers[i].get(n)||0;this.observers[i].set(n,r+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}once(t,n){const i=(...r)=>{n(...r),this.off(t,i)};return this.on(t,i),this}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([r,s])=>{for(let o=0;o{for(let o=0;o-1&&this.options.ns.splice(n,1)}getResource(t,n,i,r={}){var u,d;const s=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,o=r.ignoreJSONStructure!==void 0?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;t.includes(".")?l=t.split("."):(l=[t,n],i&&(Array.isArray(i)?l.push(...i):Zn(i)&&s?l.push(...i.split(s)):l.push(i)));const c=oR(this.data,l);return!c&&!n&&!i&&t.includes(".")&&(t=l[0],n=l[1],i=l.slice(2).join(".")),c||!o||!Zn(i)?c:dF((d=(u=this.data)==null?void 0:u[t])==null?void 0:d[n],i,s)}addResource(t,n,i,r,s={silent:!1}){const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let l=[t,n];i&&(l=l.concat(o?i.split(o):i)),t.includes(".")&&(l=t.split("."),r=n,n=l[1]),this.addNamespaces(n),LG(this.data,l,r),s.silent||this.emit("added",t,n,i,r)}addResources(t,n,i,r={silent:!1}){for(const s in i)(Zn(i[s])||Array.isArray(i[s]))&&this.addResource(t,n,s,i[s],{silent:!0});r.silent||this.emit("added",t,n,i)}addResourceBundle(t,n,i,r,s,o={silent:!1,skipCopy:!1}){let l=[t,n];t.includes(".")&&(l=t.split("."),r=i,i=n,n=l[1]),this.addNamespaces(n);let c=oR(this.data,l)||{};o.skipCopy||(i=JSON.parse(JSON.stringify(i))),r?HOe(c,i,s):c={...c,...i},LG(this.data,l,c),o.silent||this.emit("added",t,n,i)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(r=>n[r]&&Object.keys(n[r]).length>0)}toJSON(){return this.data}}var qOe={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,i,r){return e.forEach(s=>{var o;t=((o=this.processors[s])==null?void 0:o.process(t,n,i,r))??t}),t}};const WOe=Symbol("i18next/PATH_KEY");function gHe(){const e=[],t=Object.create(null);let n;return t.get=(i,r)=>{var s;return(s=n==null?void 0:n.revoke)==null||s.call(n),r===WOe?e:(e.push(r),n=Proxy.revocable(i,t),n.proxy)},Proxy.revocable(Object.create(null),t).proxy}function $y(e,t){const{[WOe]:n}=e(gHe()),i=(t==null?void 0:t.keySeparator)??".",r=(t==null?void 0:t.nsSeparator)??":",s=(t==null?void 0:t.enableSelector)==="strict";if(n.length>1&&r){const o=t==null?void 0:t.ns,l=s?Array.isArray(o)?o:o?[o]:null:Array.isArray(o)?o:null;if(l&&(s?l:l.length>1?l.slice(1):[]).includes(n[0]))return`${n[0]}${r}${n.slice(1).join(i)}`}return n.join(i)}const k5=e=>!Zn(e)&&typeof e!="boolean"&&typeof e!="number";class cR extends XP{constructor(t,n={}){super(),sHe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=nh.create("translator"),this.checkedLoadedFor={}}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const i={...n};if(t==null)return!1;const r=this.resolve(t,i);if((r==null?void 0:r.res)===void 0)return!1;const s=k5(r.res);return!(i.returnObjects===!1&&s)}extractFromKey(t,n){let i=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const r=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let s=n.ns||this.options.defaultNS||[];const o=i&&t.includes(i),l=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!pHe(t,i,r);if(o&&!l){const c=t.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:t,namespaces:Zn(s)?[s]:s};const u=t.split(i);(i!==r||i===r&&this.options.ns.includes(u[0]))&&(s=u.shift()),t=u.join(r)}return{key:t,namespaces:Zn(s)?[s]:s}}translate(t,n,i){let r=typeof n=="object"?{...n}:n;if(typeof r!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),typeof r=="object"&&(r={...r}),r||(r={}),t==null)return"";typeof t=="function"&&(t=$y(t,{...this.options,...r})),Array.isArray(t)||(t=[String(t)]),t=t.map(N=>typeof N=="function"?$y(N,{...this.options,...r}):String(N));const s=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,o=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,{key:l,namespaces:c}=this.extractFromKey(t[t.length-1],r),u=c[c.length-1];let d=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;d===void 0&&(d=":");const f=r.lng||this.language,h=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((f==null?void 0:f.toLowerCase())==="cimode")return h?s?{res:`${u}${d}${l}`,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(r)}:`${u}${d}${l}`:s?{res:l,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(r)}:l;const m=this.resolve(t,r);let g=m==null?void 0:m.res;const b=(m==null?void 0:m.usedKey)||l,v=(m==null?void 0:m.exactUsedKey)||l,y=["[object Number]","[object Function]","[object RegExp]"],w=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,O=r.count!==void 0&&!Zn(r.count),k=cR.hasDefaultValue(r),S=O?this.pluralResolver.getSuffix(f,r.count,r):"",C=r.ordinal&&O?this.pluralResolver.getSuffix(f,r.count,{ordinal:!1}):"",E=O&&!r.ordinal&&r.count===0,j=E&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${S}`]||r[`defaultValue${C}`]||r.defaultValue;let T=g;x&&!g&&k&&(T=j);const R=k5(T),A=Object.prototype.toString.apply(T);if(x&&T&&R&&!y.includes(A)&&!(Zn(w)&&Array.isArray(T))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const N=this.options.returnedObjectHandler?this.options.returnedObjectHandler(b,T,{...r,ns:c}):`key '${l} (${this.language})' returned an object instead of string.`;return s?(m.res=N,m.usedParams=this.getUsedParamsDetails(r),m):N}if(o){const N=Array.isArray(T),P=N?[]:{},I=N?v:b;for(const D in T)if(Object.prototype.hasOwnProperty.call(T,D)){const _=`${I}${o}${D}`;k&&!g?P[D]=this.translate(_,{...r,defaultValue:k5(j)?j[D]:void 0,joinArrays:!1,ns:c}):P[D]=this.translate(_,{...r,joinArrays:!1,ns:c}),P[D]===_&&(P[D]=T[D])}g=P}}else if(x&&Zn(w)&&Array.isArray(g))g=g.join(w),g&&(g=this.extendTranslation(g,t,r,i));else{let N=!1,P=!1;!this.isValidLookup(g)&&k&&(N=!0,g=j),this.isValidLookup(g)||(P=!0,g=l);const D=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&P?void 0:g,_=k&&j!==g&&this.options.updateMissing;if(P||N||_){if(this.logger.log(_?"updateKey":"missingKey",f,u,O&&!_?`${l}${this.pluralResolver.getSuffix(f,r.count,r)}`:l,_?j:g),o){const z=this.resolve(l,{...r,keySeparator:!1});z&&z.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let L=[];const F=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&F&&F[0])for(let z=0;z{var V;const J=k&&U!==g?U:D;this.options.missingKeyHandler?this.options.missingKeyHandler(z,u,q,J,_,r):(V=this.backendConnector)!=null&&V.saveMissing&&this.backendConnector.saveMissing(z,u,q,J,_,r),this.emit("missingKey",z,u,q,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&O?L.forEach(z=>{const q=this.pluralResolver.getSuffixes(z,r);E&&r[`defaultValue${this.options.pluralSeparator}zero`]&&!q.includes(`${this.options.pluralSeparator}zero`)&&q.push(`${this.options.pluralSeparator}zero`),q.forEach(U=>{M([z],l+U,r[`defaultValue${U}`]||j)})}):M(L,l,j))}g=this.extendTranslation(g,t,r,m,i),P&&g===l&&this.options.appendNamespaceToMissingKey&&(g=`${u}${d}${l}`),(P||N)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${d}${l}`:l,N?g:void 0,r))}return s?(m.res=g,m.usedParams=this.getUsedParamsDetails(r),m):g}extendTranslation(t,n,i,r,s){var c,u;if((c=this.i18nFormat)!=null&&c.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const d=Zn(t)&&(((u=i==null?void 0:i.interpolation)==null?void 0:u.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(d){const m=t.match(this.interpolator.nestingRegexp);f=m&&m.length}let h=i.replace&&!Zn(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(h={...this.options.interpolation.defaultVariables,...h}),t=this.interpolator.interpolate(t,h,i.lng||this.language||r.usedLng,i),d){const m=t.match(this.interpolator.nestingRegexp),g=m&&m.length;f(s==null?void 0:s[0])===m[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${m[0]} in key: ${n[0]}`),null):this.translate(...m,n),i)),i.interpolation&&this.interpolator.reset()}const o=i.postProcess||this.options.postProcess,l=Zn(o)?[o]:o;return t!=null&&(l!=null&&l.length)&&i.applyPostProcessor!==!1&&(t=qOe.handle(l,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),t}resolve(t,n={}){let i,r,s,o,l;return Zn(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(c=>typeof c=="function"?$y(c,{...this.options,...n}):c)),t.forEach(c=>{if(this.isValidLookup(i))return;const u=this.extractFromKey(c,n),d=u.key;r=d;let f=u.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const h=n.count!==void 0&&!Zn(n.count),m=h&&!n.ordinal&&n.count===0,g=n.context!==void 0&&(Zn(n.context)||typeof n.context=="number")&&n.context!=="",b=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(v=>{var y,w;this.isValidLookup(i)||(l=v,!this.checkedLoadedFor[`${b[0]}-${v}`]&&((y=this.utils)!=null&&y.hasLoadedNamespace)&&!((w=this.utils)!=null&&w.hasLoadedNamespace(l))&&(this.checkedLoadedFor[`${b[0]}-${v}`]=!0,this.logger.warn(`key "${r}" for languages "${b.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),b.forEach(x=>{var S;if(this.isValidLookup(i))return;o=x;const O=[d];if((S=this.i18nFormat)!=null&&S.addLookupKeys)this.i18nFormat.addLookupKeys(O,d,x,v,n);else{let C;h&&(C=this.pluralResolver.getSuffix(x,n.count,n));const E=`${this.options.pluralSeparator}zero`,j=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(n.ordinal&&C.startsWith(j)&&O.push(d+C.replace(j,this.options.pluralSeparator)),O.push(d+C),m&&O.push(d+E)),g){const T=`${d}${this.options.contextSeparator||"_"}${n.context}`;O.push(T),h&&(n.ordinal&&C.startsWith(j)&&O.push(T+C.replace(j,this.options.pluralSeparator)),O.push(T+C),m&&O.push(T+E))}}let k;for(;k=O.pop();)this.isValidLookup(i)||(s=k,i=this.getResource(x,v,k,n))}))})}),{res:i,usedKey:r,exactUsedKey:s,usedLng:o,usedNS:l}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,i,r={}){var s;return(s=this.i18nFormat)!=null&&s.getResource?this.i18nFormat.getResource(t,n,i,r):this.resourceStore.getResource(t,n,i,r)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=t.replace&&!Zn(t.replace);let r=i?t.replace:t;if(i&&typeof t.count<"u"&&(r={...r,count:t.count}),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!i){r={...r};for(const s of n)delete r[s]}return r}static hasDefaultValue(t){const n="defaultValue";for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&i.startsWith(n)&&t[i]!==void 0)return!0;return!1}}class FG{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=nh.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(t){if(t=NE(t),!t||!t.includes("-"))return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=NE(t),!t||!t.includes("-"))return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(Zn(t)&&t.includes("-")){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(t)}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(i=>{if(n)return;const r=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(r))&&(n=r)}),!n&&this.options.supportedLngs&&t.forEach(i=>{if(n)return;const r=this.getScriptPartFromCode(i);if(this.isSupportedCode(r))return n=r;const s=this.getLanguagePartFromCode(i);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(o=>o===s?!0:!o.includes("-")&&!s.includes("-")?!1:!!(o.includes("-")&&!s.includes("-")&&o.slice(0,o.indexOf("-"))===s||o.startsWith(s)&&s.length>1))}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),Zn(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let i=t[n];return i||(i=t[this.getScriptPartFromCode(n)]),i||(i=t[this.formatLanguageCode(n)]),i||(i=t[this.getLanguagePartFromCode(n)]),i||(i=t.default),i||[]}toResolveHierarchy(t,n){const i=this.options.fallbackLng,r=Array.isArray(i)?i.join("|"):i;r!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=r);const s=n===void 0||n===!1||Zn(n),o=n===void 0&&typeof this.options.fallbackLng=="function",l=Zn(t)&&s&&!o;let c=null;if(l){let h;n===void 0?h="undefined":n===!1?h="boolean:false":h=`string:${n}`,c=`${t.length}:${t}|${h}`}if(c!==null){const h=this.resolveHierarchyCache[c];if(h!==void 0)return h.slice()}const u=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),d=[],f=h=>{h&&(this.isSupportedCode(h)?d.push(h):this.logger.warn(`rejecting language code not found in supportedLngs: ${h}`))};return Zn(t)&&(t.includes("-")||t.includes("_"))?(this.options.load!=="languageOnly"&&f(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&f(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&f(this.getLanguagePartFromCode(t))):Zn(t)&&f(this.formatLanguageCode(t)),u.forEach(h=>{d.includes(h)||f(this.formatLanguageCode(h))}),c!==null?(this.resolveHierarchyCache[c]=d,d.slice()):d}}const BG={zero:0,one:1,two:2,few:3,many:4,other:5},UG={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class bHe{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=nh.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const i=NE(t==="dev"?"en":t),r=n.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:i,type:r});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let o;try{o=new Intl.PluralRules(i,{type:r})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),UG;if(!t.match(/-|_/))return UG;const c=this.languageUtils.getLanguagePartFromCode(t);o=this.getRule(c,n)}return this.pluralRulesCache[s]=o,o}needsPlural(t,n={}){let i=this.getRule(t,n);return i||(i=this.getRule("dev",n)),(i==null?void 0:i.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,n,i={}){return this.getSuffixes(t,i).map(r=>`${n}${r}`)}getSuffixes(t,n={}){let i=this.getRule(t,n);return i||(i=this.getRule("dev",n)),i?i.resolvedOptions().pluralCategories.sort((r,s)=>BG[r]-BG[s]).map(r=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r}`):[]}getSuffix(t,n,i={}){const r=this.getRule(t,i);return r?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${r.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,i))}}const QG=(e,t,n,i=".",r=!0)=>{let s=lHe(e,t,n);return!s&&r&&Zn(n)&&(s=dF(e,n,i),s===void 0&&(s=dF(t,n,i))),s},zG=e=>e.replace(/\$/g,"$$$$");class VG{constructor(t={}){var n;this.logger=nh.create("interpolator"),this.options=t,this.format=((n=t==null?void 0:t.interpolation)==null?void 0:n.format)||(i=>i),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:i,useRawValueToEscape:r,prefix:s,prefixEscaped:o,suffix:l,suffixEscaped:c,formatSeparator:u,unescapeSuffix:d,unescapePrefix:f,nestingPrefix:h,nestingPrefixEscaped:m,nestingSuffix:g,nestingSuffixEscaped:b,nestingOptionsSeparator:v,maxReplaces:y,alwaysFormat:w}=t.interpolation;this.escape=n!==void 0?n:uHe,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=r!==void 0?r:!1,this.prefix=s?Kh(s):o||"{{",this.suffix=l?Kh(l):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":f?Kh(f):"-",this.unescapeSuffix=this.unescapePrefix?"":d?Kh(d):"",this.nestingPrefix=h?Kh(h):m||Kh("$t("),this.nestingSuffix=g?Kh(g):b||Kh(")"),this.nestingOptionsSeparator=v||",",this.maxReplaces=y||1e3,this.alwaysFormat=w!==void 0?w:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,i)=>(n==null?void 0:n.source)===i?(n.lastIndex=0,n):new RegExp(i,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,n,i,r){var m;let s,o,l;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=g=>{if(!g.includes(this.formatSeparator)){const w=QG(n,c,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(w,void 0,i,{...r,...n,interpolationkey:g}):w}const b=g.split(this.formatSeparator),v=b.shift().trim(),y=b.join(this.formatSeparator).trim();return this.format(QG(n,c,v,this.options.keySeparator,this.options.ignoreJSONStructure),y,i,{...r,...n,interpolationkey:v})};this.resetRegExp(),!this.escapeValue&&typeof t=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(t)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const d=(r==null?void 0:r.missingInterpolationHandler)||this.options.missingInterpolationHandler,f=((m=r==null?void 0:r.interpolation)==null?void 0:m.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>g},{regex:this.regexp,safeValue:g=>this.escapeValue?this.escape(g):g}].forEach(g=>{for(l=0;s=g.regex.exec(t);){const b=s[1].trim();if(o=u(b),o===void 0)if(typeof d=="function"){const y=d(t,s,r);o=Zn(y)?y:""}else if(r&&Object.prototype.hasOwnProperty.call(r,b))o="";else if(f){o=s[0];continue}else this.logger.warn(`missed to pass in variable ${b} for interpolating ${t}`),o="";else!Zn(o)&&!this.useRawValueToEscape&&(o=O5(o));const v=g.safeValue(o);if(t=t.replace(s[0],zG(v)),f?(g.regex.lastIndex+=v.length,g.regex.lastIndex-=s[0].length):g.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),t}nest(t,n,i={}){let r,s,o;const l=(c,u)=>{const d=this.nestingOptionsSeparator;if(!c.includes(d))return c;const f=c.split(new RegExp(`${Kh(d)}[ ]*{`));let h=`{${f[1]}`;c=f[0],h=this.interpolate(h,o);const m=h.match(/'/g),g=h.match(/"/g);(((m==null?void 0:m.length)??0)%2===0&&!g||((g==null?void 0:g.length)??0)%2!==0)&&(h=h.replace(/'/g,'"'));try{o=JSON.parse(h),u&&(o={...u,...o})}catch(b){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,b),`${c}${d}${h}`}return o.defaultValue&&o.defaultValue.includes(this.prefix)&&delete o.defaultValue,c};for(;r=this.nestingRegexp.exec(t);){let c=[];o={...i},o=o.replace&&!Zn(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;const u=/{.*}/s.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(u!==-1&&(c=r[1].slice(u).split(this.formatSeparator).map(d=>d.trim()).filter(Boolean),r[1]=r[1].slice(0,u)),s=n(l.call(this,r[1].trim(),o),o),s&&r[0]===t&&!Zn(s))return s;Zn(s)||(s=O5(s)),s||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${t}`),s=""),c.length&&(s=c.reduce((d,f)=>this.format(d,f,i.lng,{...i,interpolationkey:r[1].trim()}),s.trim())),t=t.replace(r[0],zG(O5(s))),this.regexp.lastIndex=0}return t}}const yHe=e=>{let t=e.toLowerCase().trim();const n={};if(e.includes("(")){const i=e.split("(");t=i[0].toLowerCase().trim();const r=i[1].slice(0,-1);t==="currency"&&!r.includes(":")?n.currency||(n.currency=r.trim()):t==="relativetime"&&!r.includes(":")?n.range||(n.range=r.trim()):r.split(";").forEach(o=>{if(o){const[l,...c]=o.split(":"),u=c.join(":").trim().replace(/^'+|'+$/g,""),d=l.trim();n[d]||(n[d]=u),u==="false"&&(n[d]=!1),u==="true"&&(n[d]=!0),isNaN(u)||(n[d]=parseInt(u,10))}})}return{formatName:t,formatOptions:n}},HG=e=>{const t={};return(n,i,r)=>{let s=r;r&&r.interpolationkey&&r.formatParams&&r.formatParams[r.interpolationkey]&&r[r.interpolationkey]&&(s={...s,[r.interpolationkey]:void 0});const o=i+JSON.stringify(s);let l=t[o];return l||(l=e(NE(i),r),t[o]=l),l(n)}},vHe=e=>(t,n,i)=>e(NE(n),i)(t);class xHe{constructor(t={}){this.logger=nh.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const i=n.cacheInBuiltFormats?HG:vHe;this.formats={number:i((r,s)=>{const o=new Intl.NumberFormat(r,{...s});return l=>o.format(l)}),currency:i((r,s)=>{const o=new Intl.NumberFormat(r,{...s,style:"currency"});return l=>o.format(l)}),datetime:i((r,s)=>{const o=new Intl.DateTimeFormat(r,{...s});return l=>o.format(l)}),relativetime:i((r,s)=>{const o=new Intl.RelativeTimeFormat(r,{...s});return l=>o.format(l,s.range||"day")}),list:i((r,s)=>{const o=new Intl.ListFormat(r,{...s});return l=>o.format(l)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=HG(n)}format(t,n,i,r={}){if(!n||t==null)return t;const s=n.split(this.formatSeparator),o=[];for(let c=0;c-1&&!u.includes(")")&&c+1{var h;const{formatName:d,formatOptions:f}=yHe(u);if(this.formats[d]){let m=c;try{const g=((h=r==null?void 0:r.formatParams)==null?void 0:h[r.interpolationkey])||{},b=g.locale||g.lng||r.locale||r.lng||i;m=this.formats[d](c,b,{...f,...r,...g})}catch(g){this.logger.warn(g)}return m}else this.logger.warn(`there was no format function for ${d}`);return c},t)}}const wHe=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class OHe extends XP{constructor(t,n,i,r={}){var s,o;super(),this.backend=t,this.store=n,this.services=i,this.languageUtils=i.languageUtils,this.options=r,this.logger=nh.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],(o=(s=this.backend)==null?void 0:s.init)==null||o.call(s,i,r.backend,r)}queueLoad(t,n,i,r){const s={},o={},l={},c={};return t.forEach(u=>{let d=!0;n.forEach(f=>{const h=`${u}|${f}`;!i.reload&&this.store.hasResourceBundle(u,f)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?o[h]===void 0&&(o[h]=!0):(this.state[h]=1,d=!1,o[h]===void 0&&(o[h]=!0),s[h]===void 0&&(s[h]=!0),c[f]===void 0&&(c[f]=!0)))}),d||(l[u]=!0)}),(Object.keys(s).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(s),pending:Object.keys(o),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(c)}}loaded(t,n,i){const r=t.split("|"),s=r[0],o=r[1];n&&this.emit("failedLoading",s,o,n),!n&&i&&this.store.addResourceBundle(s,o,i,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&i&&(this.state[t]=0);const l={};this.queue.forEach(c=>{oHe(c.loaded,[s],o),wHe(c,t),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(u=>{l[u]||(l[u]={});const d=c.loaded[u];d.length&&d.forEach(f=>{l[u][f]===void 0&&(l[u][f]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(c=>!c.done)}read(t,n,i,r=0,s=this.retryTimeout,o){if(!t.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:i,tried:r,wait:s,callback:o});return}this.readingCalls++;const l=(u,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(u&&d&&r{this.read(t,n,i,r+1,s*2,o)},s);return}o(u,d)},c=this.backend[i].bind(this.backend);if(c.length===2){try{const u=c(t,n);u&&typeof u.then=="function"?u.then(d=>l(null,d)).catch(l):l(null,u)}catch(u){l(u)}return}return c(t,n,l)}prepareLoading(t,n,i={},r){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();Zn(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Zn(n)&&(n=[n]);const s=this.queueLoad(t,n,i,r);if(!s.toLoad.length)return s.pending.length||r(),null;s.toLoad.forEach(o=>{this.loadOne(o)})}load(t,n,i){this.prepareLoading(t,n,{},i)}reload(t,n,i){this.prepareLoading(t,n,{reload:!0},i)}loadOne(t,n=""){const i=t.split("|"),r=i[0],s=i[1];this.read(r,s,"read",void 0,void 0,(o,l)=>{o&&this.logger.warn(`${n}loading namespace ${s} for language ${r} failed`,o),!o&&l&&this.logger.log(`${n}loaded namespace ${s} for language ${r}`,l),this.loaded(t,o,l)})}saveMissing(t,n,i,r,s,o={},l=()=>{}){var c,u,d,f,h;if((u=(c=this.services)==null?void 0:c.utils)!=null&&u.hasLoadedNamespace&&!((f=(d=this.services)==null?void 0:d.utils)!=null&&f.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${i}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(i==null||i==="")){if((h=this.backend)!=null&&h.create){const m={...o,isUpdate:s},g=this.backend.create.bind(this.backend);if(g.length<6)try{let b;g.length===5?b=g(t,n,i,r,m):b=g(t,n,i,r),b&&typeof b.then=="function"?b.then(v=>l(null,v)).catch(l):l(null,b)}catch(b){l(b)}else g(t,n,i,r,l,m)}!t||!t[0]||this.store.addResource(t[0],n,i,r)}}}const S5=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),Zn(e[1])&&(t.defaultValue=e[1]),Zn(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(i=>{t[i]=n[i]})}return t},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),qG=e=>(Zn(e.ns)&&(e.ns=[e.ns]),Zn(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Zn(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),C2=()=>{},kHe=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class AS extends XP{constructor(t={},n){if(super(),this.options=qG(t),this.services={},this.logger=nh,this.modules={external:[]},kHe(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(Zn(t.ns)?t.defaultNS=t.ns:t.ns.includes("translation")||(t.defaultNS=t.ns[0]));const i=S5();this.options={...i,...this.options,...qG(t)},this.options.interpolation={...i.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=i.overloadTranslationOptionHandler);const r=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?nh.init(r(this.modules.logger),this.options):nh.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=xHe;const d=new FG(this.options);this.store=new $G(this.options.resources,this.options);const f=this.services;f.logger=nh,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new bHe(d,{prepend:this.options.pluralSeparator}),u&&(f.formatter=r(u),f.formatter.init&&f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new VG(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new OHe(r(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(h,...m)=>{this.emit(h,...m)}),this.modules.languageDetector&&(f.languageDetector=r(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=r(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new cR(this.services,this.options),this.translator.on("*",(h,...m)=>{this.emit(h,...m)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,n||(n=C2),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=(...d)=>this.store[u](...d)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...d)=>(this.store[u](...d),this)});const l=qO(),c=()=>{const u=(d,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(f),n(d,f)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),l}loadResources(t,n=C2){var s,o;let i=n;const r=Zn(t)?t:this.language;if(typeof t=="function"&&(i=t),!this.options.resources||this.options.partialBundledLanguages){if((r==null?void 0:r.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const l=[],c=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(f=>{f!=="cimode"&&(l.includes(f)||l.push(f))})};r?c(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>c(d)),(o=(s=this.options.preload)==null?void 0:s.forEach)==null||o.call(s,u=>c(u)),this.services.backendConnector.load(l,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(u)})}else i(null)}reloadResources(t,n,i){const r=qO();return typeof t=="function"&&(i=t,t=void 0),typeof n=="function"&&(i=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),i||(i=C2),this.services.backendConnector.reload(t,n,s=>{r.resolve(),i(s)}),r}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&qOe.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!["cimode","dev"].includes(t)){for(let n=0;n{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},s=(l,c)=>{c?this.isLanguageChangingTo===t&&(r(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,i.resolve((...u)=>this.t(...u)),n&&n(l,(...u)=>this.t(...u))},o=l=>{var d,f;!t&&!l&&this.services.languageDetector&&(l=[]);const c=Zn(l)?l:l&&l[0],u=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(Zn(l)?[l]:l);u&&(this.language||r(u),this.translator.language||this.translator.changeLanguage(u),(f=(d=this.services.languageDetector)==null?void 0:d.cacheUserLanguage)==null||f.call(d,u)),this.loadResources(u,h=>{s(h,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(t),i}getFixedT(t,n,i,r){const s=r==null?void 0:r.scopeNs,o=(l,c,...u)=>{let d;typeof c!="object"?d=this.options.overloadTranslationOptionHandler([l,c].concat(u)):d={...c},d.lng=d.lng||o.lng,d.lngs=d.lngs||o.lngs;const f=d.ns!==void 0&&d.ns!==null;d.ns=d.ns||o.ns,d.keyPrefix!==""&&(d.keyPrefix=d.keyPrefix||i||o.keyPrefix);const h={...this.options,...d};Array.isArray(s)&&!f&&(h.ns=s),typeof d.keyPrefix=="function"&&(d.keyPrefix=$y(d.keyPrefix,h));const m=this.options.keySeparator||".";let g;return d.keyPrefix&&Array.isArray(l)?g=l.map(b=>(typeof b=="function"&&(b=$y(b,h)),`${d.keyPrefix}${m}${b}`)):(typeof l=="function"&&(l=$y(l,h)),g=d.keyPrefix?`${d.keyPrefix}${m}${l}`:l),this.t(g,d)};return Zn(t)?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=i,o}t(...t){var n;return(n=this.translator)==null?void 0:n.translate(...t)}exists(...t){var n;return(n=this.translator)==null?void 0:n.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const i=n.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const o=(l,c)=>{const u=this.services.backendConnector.state[`${l}|${c}`];return u===-1||u===0||u===2};if(n.precheck){const l=n.precheck(this,o);if(l!==void 0)return l}return!!(this.hasResourceBundle(i,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(i,t)&&(!r||o(s,t)))}loadNamespaces(t,n){const i=qO();return this.options.ns?(Zn(t)&&(t=[t]),t.forEach(r=>{this.options.ns.includes(r)||this.options.ns.push(r)}),this.loadResources(r=>{i.resolve(),n&&n(r)}),i):(n&&n(),Promise.resolve())}loadLanguages(t,n){const i=qO();Zn(t)&&(t=[t]);const r=this.options.preload||[],s=t.filter(o=>!r.includes(o)&&this.services.languageUtils.isSupportedCode(o));return s.length?(this.options.preload=r.concat(s),this.loadResources(o=>{i.resolve(),n&&n(o)}),i):(n&&n(),Promise.resolve())}dir(t){var r,s;if(t||(t=this.resolvedLanguage||(((r=this.languages)==null?void 0:r.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{const o=new Intl.Locale(t);if(o&&o.getTextInfo){const l=o.getTextInfo();if(l&&l.direction)return l.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],i=((s=this.services)==null?void 0:s.languageUtils)||new FG(S5());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.includes(i.getLanguagePartFromCode(t))||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){const i=new AS(t,n);return i.createInstance=AS.createInstance,i}cloneInstance(t={},n=C2){const i=t.forkResourceStore;i&&delete t.forkResourceStore;const r={...this.options,...t,isClone:!0},s=new AS(r);if((t.debug!==void 0||t.prefix!==void 0)&&(s.logger=s.logger.clone(t)),["store","services","language"].forEach(l=>{s[l]=this[l]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},i){const l=Object.keys(this.store.data).reduce((c,u)=>(c[u]={...this.store.data[u]},c[u]=Object.keys(c[u]).reduce((d,f)=>(d[f]={...c[u][f]},d),c[u]),c),{});s.store=new $G(l,r),s.services.resourceStore=s.store}if(t.interpolation){const c={...S5().interpolation,...this.options.interpolation,...t.interpolation},u={...r,interpolation:c};s.services.interpolator=new VG(u)}return s.translator=new cR(s.services,r),s.translator.on("*",(l,...c)=>{s.emit(l,...c)}),s.init(r,n),s.translator.options=r,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const uc=AS.createInstance();uc.createInstance;uc.dir;uc.init;uc.loadResources;uc.reloadResources;uc.use;uc.changeLanguage;uc.getFixedT;uc.t;uc.exists;uc.setDefaultNamespace;uc.hasLoadedNamespace;uc.loadNamespaces;uc.loadLanguages;var KOe={exports:{}},ki={};/** * @license React * react.production.js @@ -579,8 +579,8 @@ https://github.com/highlightjs/highlight.js/issues/2277`),M=D,F=_),L===void 0&&( `+s+O+`, `+v+"]"}return r.pop(),s=v,w}};const fTt={parse:sTt,stringify:dTt};var VMe=fTt;const hTt=2e5,pTt=new Set(["__proto__","constructor","prototype"]),mTt=/^(?:https?:|data:|blob:|file:|javascript:|image:\/\/)/i;function cS(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function RI(e,t=0){if(t>30)throw new Error("ECharts option nesting is too deep");if(typeof e=="number"&&!Number.isFinite(e))throw new Error("ECharts option contains a non-finite number");if(typeof e=="string"&&mTt.test(e.trim()))throw new Error("ECharts option contains an external resource");if(Array.isArray(e)){for(const n of e)RI(n,t+1);return}if(cS(e))for(const[n,i]of Object.entries(e)){if(pTt.has(n))throw new Error("ECharts option contains an unsafe key");RI(i,t+1)}}function gTt(e){var i;const t=e.trim(),n=t.match(/^(?:(?:const|let|var)\s+)?option\s*=\s*([\s\S]*?)\s*;?$/);return((i=n==null?void 0:n[1])==null?void 0:i.trim())||t}function bTt(e,t){let n=1,i="",r=!1,s=!1,o=!1;for(let l=t+1;li+2)throw new Error("Invalid ECharts gradient argument count");const r=n.slice(0,i).map(yTt),s=n[i],o=n[i+1]??!1;if(!Array.isArray(s)||typeof o!="boolean")throw new Error("Invalid ECharts gradient data");return e==="linear"?{type:e,x:r[0],y:r[1],x2:r[2],y2:r[3],colorStops:s,global:o}:{type:e,x:r[0],y:r[1],r:r[2],colorStops:s,global:o}}function xTt(e,t){const n=/^(?:new\s+)?echarts\.graphic\.(LinearGradient|RadialGradient)\s*\(/;let i="",r=!1,s=!1,o=!1;for(let l=t;lhTt)throw new Error("ECharts option is too large");const n=wTt(gTt(e));let i;try{i=VMe.parse(n)}catch(o){throw/\bfunction\s*\(|=>/.test(n)?new Error("ECharts function callbacks are not supported"):o}if(!cS(i))throw new Error("ECharts option must be a data object");RI(i);const r={...i};r.aria={...cS(r.aria)?r.aria:{},enabled:!0};const s=r.tooltip;return cS(s)?r.tooltip={...s,renderMode:"richText"}:Array.isArray(s)&&(r.tooltip=s.map(o=>cS(o)?{...o,renderMode:"richText"}:o)),t&&(r.animation=!1),r}let I4;function OTt(){return I4??(I4=Js(()=>import("../visualizations/echarts/index-CGT341lL.js"),[]).catch(e=>{throw I4=void 0,e})),I4}function kTt({source:e}){const{t}=Te("conversation"),n=p.useRef(null),[i,r]=p.useState(!1),[s,o]=p.useState("");return p.useEffect(()=>{let l=!1,c,u,d;r(!1);try{d=HMe(e,window.matchMedia("(prefers-reduced-motion: reduce)").matches),o("")}catch{o("invalid");return}return OTt().then(f=>{const h=n.current;l||!h||(c=f.init(h,void 0,{renderer:"svg"}),c.setOption(d,{notMerge:!0}),typeof ResizeObserver<"u"&&(u=new ResizeObserver(()=>c==null?void 0:c.resize()),u.observe(h)),r(!0))}).catch(()=>{c==null||c.dispose(),c=void 0,l||o("render")}),()=>{l=!0,u==null||u.disconnect(),c==null||c.dispose()}},[e]),a.jsxs("div",{className:`echarts-diagram${s?" echarts-diagram--error":""}`,role:"img","aria-label":t("visualization.echartsAria"),"aria-busy":!i&&!s,children:[a.jsx("div",{ref:n,className:"echarts-diagram__canvas",hidden:!!s}),!i&&!s?a.jsx("div",{className:"echarts-diagram__state","aria-live":"polite",children:a.jsx(hn,{duration:2.2,spread:15,children:t("visualization.rendering")})}):null,s?a.jsx("p",{className:"echarts-diagram__error",role:"alert",children:t(s==="invalid"?"visualization.invalidEcharts":"visualization.renderFailed")}):null]})}const STt=p.memo(kTt);let Ene,Cne=Promise.resolve(),ETt=0;function CTt(){return Ene??(Ene=Js(async()=>{const{default:e}=await import("../visualizations/mermaid/mermaid.core-y4TF8bTw.js").then(t=>t.ay);return{default:e}},__vite__mapDeps([0,1])).then(({default:e})=>(e.initialize({startOnLoad:!1,securityLevel:"strict",suppressErrorRendering:!0,theme:"neutral"}),e))),Ene}function ATt(e){const t=Cne.then(async()=>{const n=await CTt(),i=`mermaid-diagram-${ETt+=1}`;return n.render(i,e)});return Cne=t.then(()=>{},()=>{}),t}function TTt({source:e}){const{t}=Te("conversation"),n=p.useRef(null),[i,r]=p.useState(null),[s,o]=p.useState(!1);return p.useEffect(()=>{let l=!1;return r(null),o(!1),ATt(e).then(c=>{l||r(c)}).catch(()=>{l||o(!0)}),()=>{l=!0}},[e]),p.useEffect(()=>{!(i!=null&&i.bindFunctions)||!n.current||i.bindFunctions(n.current)},[i]),s?a.jsx("div",{className:"mermaid-diagram mermaid-diagram--error",children:a.jsx("p",{className:"mermaid-diagram__error",role:"alert",children:t("visualization.mermaidFailed")})}):i?a.jsx("div",{ref:n,className:"mermaid-diagram",role:"img","aria-label":t("visualization.mermaidAria"),dangerouslySetInnerHTML:{__html:i.svg}}):a.jsx("div",{className:"mermaid-diagram mermaid-diagram--loading","aria-live":"polite",children:a.jsx(hn,{duration:2.2,spread:15,children:t("visualization.rendering")})})}const _Tt=p.memo(TTt),jTt="_SegmentedControl_1sl7d_1",NTt="_SegmentedControlOption_1sl7d_140",RTt="_SegmentedControlThumb_1sl7d_219",r9={SegmentedControl:jTt,SegmentedControlOption:NTt,SegmentedControlThumb:RTt},cd=({value:e,onChange:t,children:n,block:i,pill:r=!0,size:s="md",gutterSize:o,className:l,onClick:c,...u})=>{const d=p.useRef(null),f=p.useRef(null),h=p.useCallback(g=>{const b=d.current,v=f.current;if(!b||!v)return;const y=b==null?void 0:b.querySelector('[data-state="on"]');if(!y)return;const w=b.clientWidth;let x=Math.floor(y.clientWidth);const O=y.offsetLeft;if(w-(x+O)<2&&(x=x-1),v.style.width=`${Math.floor(x)}px`,v.style.transform=`translateX(${O}px)`,b.scrollWidth>w){const k=w*.15,S=b.scrollLeft,C=y.offsetLeft,E=C+x;(CS+w-k)&&g&&y.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"})}},[]);nNe({ref:d,onResize:()=>{const g=f.current;if(!g)return;const b=g.style.transition;g.style.transition="",h(!1),g.style.transition=b}}),p.useLayoutEffect(()=>{const g=d.current,b=f.current;!g||!b||(h(!!b.style.transition),b.style.transition||hI(()=>{b.style.transition="width 300ms var(--cubic-enter), transform 300ms var(--cubic-enter)"}))},[h,e,s,o,r]);const m=g=>{g&&t&&t(g)};return a.jsxs(xft,{ref:d,className:Qi(r9.SegmentedControl,l),type:"single",value:e,loop:!1,onValueChange:m,onClick:c,"data-block":i?"":void 0,"data-pill":r?"":void 0,"data-size":s,"data-gutter-size":o,...u,children:[a.jsx("div",{className:r9.SegmentedControlThumb,ref:f}),n]})},ITt=({children:e,...t})=>a.jsx(Eft,{className:r9.SegmentedControlOption,...t,onPointerEnter:kV,children:a.jsx("span",{className:"relative",children:e})});cd.Option=ITt;function PTt({children:e,label:t,language:n,source:i,streaming:r=!1}){const{t:s}=Te("conversation"),[o,l]=p.useState("preview"),c=r?"code":o;return a.jsxs("section",{className:"visualization-card","aria-label":s("visualization.cardAria",{label:t}),children:[a.jsx("div",{className:"visualization-card__toolbar",children:a.jsxs(cd,{className:"visualization-card__tabs",value:c,size:"sm",gutterSize:"sm",pill:!1,"aria-label":s("visualization.viewAria",{label:t}),onChange:u=>{r||l(u)},children:[a.jsx(cd.Option,{value:"preview",disabled:r,children:s("visualization.preview")}),a.jsx(cd.Option,{value:"code",children:s("visualization.code")})]})}),a.jsx("div",{className:"visualization-card__body",children:c==="code"?a.jsx("pre",{className:"visualization-card__code",children:a.jsx("code",{className:`language-${n}`,children:i})}):e})]})}const DTt=p.memo(PTt);function qMe(e){const t=e==null?void 0:e.trim().toLowerCase();if(t==="mermaid")return"mermaid";if(t==="echart"||t==="echarts")return"echarts"}const WMe=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function s9(e){return typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(s9).join(""):p.isValidElement(e)?s9(e.props.children):""}function MTt(e){var i;const t=p.Children.toArray(e)[0];if(!p.isValidElement(t))return;const n=(i=t.props.className)==null?void 0:i.split(/\s+/).find(r=>r.startsWith("language-"));return qMe(n==null?void 0:n.slice(9))}function KMe(e){if(!e)return!1;try{const t=e.toLowerCase();return WMe.some(n=>t.includes(n))}catch{return!1}}function LTt(e){var i;const t=(i=e==null?void 0:e.properties)==null?void 0:i.href;if(!t)return!1;if(KMe(t))return!0;const n=e==null?void 0:e.children;if(n&&Array.isArray(n)){const r=n.map(s=>(s==null?void 0:s.value)||"").join("").toLowerCase();return WMe.some(s=>r.includes(s))}return!1}function $Tt({text:e,className:t,allowRawHtml:n=!0,streaming:i=!1}){const{t:r}=Te("conversation"),s=p.useContext(Aje),[o,l]=p.useState(null),c=(f,h)=>{if(f.src)return f.src;if(h){const m=b=>{var v;if(!b)return null;if(b.type==="source"&&((v=b.properties)!=null&&v.src))return b.properties.src;if(b.children)for(const y of b.children){const w=m(y);if(w)return w}return null},g=m({children:h});if(g)return g}return""},u=f=>{try{const m=new URL(f).pathname.split("/");return m[m.length-1]||"video.mp4"}catch{return"video.mp4"}},d=f=>f?Array.isArray(f)?f.map(h=>(h==null?void 0:h.value)||"").join("")||"video":(f==null?void 0:f.value)||"video":"video";return a.jsxs("div",{className:t?`md ${t}`:"md",children:[a.jsx(qPe,{disallowedElements:s?["file-card","personal-drive-enable-card"]:void 0,remarkPlugins:[bDe],rehypePlugins:n?[JAt,sne]:[sne],components:{pre:({node:f,children:h,...m})=>{const g=MTt(h);if(g==="mermaid"||g==="echarts"){const b=s9(h).replace(/\n$/,"");return a.jsx(DTt,{label:g==="mermaid"?"Mermaid":"ECharts",language:g,source:b,streaming:i,children:g==="mermaid"?a.jsx(_Tt,{source:b}):a.jsx(STt,{source:b})})}return a.jsx("pre",{...m,children:h})},a:({node:f,...h})=>{const m=h.href,g=s&&zst(m);if(g)return a.jsx(Vst,{...s,path:g,children:h.children});if(m&&(KMe(m)||LTt(f))){const b=m,v=d(f==null?void 0:f.children);return a.jsxs("div",{className:"video-container",children:[a.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":r("markdown.playVideo",{name:v}),onClick:()=>l({src:b,title:v}),children:[a.jsx("video",{src:b,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),a.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:a.jsx(ZS,{})})]}),a.jsx("div",{className:"video-caption",children:a.jsx("a",{href:b,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:v})})]})}return a.jsx("a",{...h,target:"_blank",rel:"noopener noreferrer"})},img:({node:f,src:h,alt:m,...g})=>{const b=a.jsx("img",{...g,src:h,alt:m??"",loading:"lazy"});return h?a.jsx(MAe,{src:h,children:a.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":r("markdown.enlargeImage",{name:m||r("markdown.image")}),children:[b,a.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:a.jsx(ZS,{})})]})}):b},video:({node:f,src:h,children:m,...g})=>{const b=c({src:h},m);return b?a.jsx("div",{className:"video-container",children:a.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":r("markdown.enlargeVideo"),onClick:()=>l({src:b}),children:[a.jsx("video",{src:b,...g,playsInline:!0,className:"video-thumbnail",children:m}),a.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:a.jsx(ZS,{})})]})}):a.jsx("video",{src:h,controls:!0,playsInline:!0,className:"video-inline",...g,children:m})}},children:e}),o&&a.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":r("markdown.videoPreview"),onClick:()=>l(null),children:a.jsxs("div",{className:"video-viewer",onClick:f=>f.stopPropagation(),children:[a.jsxs("div",{className:"video-viewer-header",children:[a.jsx("div",{className:"video-viewer-title",children:o.title||u(o.src)}),a.jsxs("nav",{className:"video-viewer-nav",children:[a.jsx("a",{href:o.src,download:o.title||u(o.src),"aria-label":r("markdown.downloadVideo"),title:r("markdown.downloadVideo"),className:"video-viewer-download",children:a.jsx(eM,{})}),a.jsx("button",{type:"button",className:"video-viewer-close","aria-label":r("markdown.close"),onClick:()=>l(null),children:a.jsx(Mo,{})})]})]}),a.jsx("div",{className:"video-viewer-body",children:a.jsx("video",{src:o.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const _d=p.memo($Tt);function P4(e){return(e==null?void 0:e.trim())||_b("resourceMetadata.unknownSource")}function GMe(e){return(e==null?void 0:e.trim())||_b("resourceMetadata.unknownCreator")}function FTt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5 5.5A2.5 2.5 0 0 1 7.5 3H19v16H7.5A2.5 2.5 0 0 0 5 21.5v-16Z"}),a.jsx("path",{d:"M5 18.5A2.5 2.5 0 0 1 7.5 16H19"}),a.jsx("path",{d:"M9 7h6M9 10h4"})]})}function BTt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3h8l4 4v14H6V3Z"}),a.jsx("path",{d:"M14 3v5h5M9 12h6M9 16h6"})]})}function UTt(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m7 7 10 10M17 7 7 17"})})}function QTt(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 5v14M5 12h14"})})}function hT({title:e,children:t,onClose:n,busy:i=!1,className:r=""}){const{t:s}=Te("ui"),o=p.useId(),l=p.useRef(null),c=p.useRef(null),u=p.useRef(i),d=p.useRef(n);return p.useEffect(()=>{u.current=i,d.current=n},[i,n]),p.useEffect(()=>{var g;const f=document.activeElement instanceof HTMLElement?document.activeElement:null,h=document.body.style.overflow;document.body.style.overflow="hidden",(g=l.current)==null||g.focus();const m=b=>{if(b.key==="Escape"&&!u.current){d.current();return}if(b.key!=="Tab")return;const v=c.current;if(!v)return;const y=Array.from(v.querySelectorAll('button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), a[href], audio[controls], video[controls], iframe, [tabindex]:not([tabindex="-1"])')).filter(O=>O.getClientRects().length>0);if(y.length===0){b.preventDefault();return}const w=y[0],x=y[y.length-1];b.shiftKey&&(document.activeElement===w||!v.contains(document.activeElement))?(b.preventDefault(),x.focus()):!b.shiftKey&&(document.activeElement===x||!v.contains(document.activeElement))&&(b.preventDefault(),w.focus())};return window.addEventListener("keydown",m),()=>{window.removeEventListener("keydown",m),document.body.style.overflow=h,f!=null&&f.isConnected&&f.focus()}},[]),vi.createPortal(a.jsx("div",{className:"knowledge-dialog-backdrop",onMouseDown:f=>{f.target===f.currentTarget&&!i&&n()},children:a.jsxs("section",{ref:c,className:`knowledge-dialog${r?` ${r}`:""}`,role:"dialog","aria-modal":"true","aria-labelledby":o,"aria-busy":i||void 0,children:[a.jsxs("header",{className:"knowledge-dialog__header",children:[a.jsx("h2",{id:o,children:e}),a.jsx("button",{ref:l,type:"button",onClick:n,disabled:i,"aria-label":s("common.close"),children:a.jsx(UTt,{})})]}),t]})}),document.body)}function OC({message:e}){return e?a.jsx("div",{className:"knowledge-form-error",role:"alert",children:e}):null}function a9(e){return e instanceof DOMException&&e.name==="AbortError"}function zTt(e,t){if(!e)return"";const n=Date.parse(e);return Number.isFinite(n)?new Intl.DateTimeFormat(t,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(n):e}const XMe=[".jpg",".jpeg",".png"].join(","),VTt=new Set(XMe.split(",")),YMe=[".pdf",".pptx",".docx",".xlsx",".txt"].join(","),HTt=new Set(YMe.split(",")),qTt=200*1024*1024;function o9(e){const t=e.lastIndexOf(".");return t<0?"":e.slice(t).toLocaleLowerCase()}function WTt(e,t,n){return e.size>qTt?n("knowledge.errors.fileTooLarge"):t==="image"?VTt.has(o9(e.name))?"":n("knowledge.errors.invalidImageType"):HTt.has(o9(e.name))?"":n("knowledge.errors.invalidDocumentType")}function aq(e){return e<=0?"-":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function l9(e){var r;const t=e.type.trim().replace(/^\./,"");if(t)return t.toUpperCase();const n=e.name.trim(),i=n.includes(".")?(r=n.split(".").pop())==null?void 0:r.trim():"";return i?i.toUpperCase():"-"}function KTt({region:e,onClose:t,onCreated:n}){const{t:i}=Te("ui"),[r,s]=p.useState(""),[o,l]=p.useState(""),[c,u]=p.useState(!1),[d,f]=p.useState(!1),[h,m]=p.useState(""),g=r.trim(),b=!!(g&&!/^[A-Za-z][A-Za-z0-9_]{0,47}$/.test(g)),v=async y=>{if(y.preventDefault(),u(!0),!g||b)return;f(!0),m("");const w={name:g,description:o.trim()||void 0,region:e};try{n(await jbt(w))}catch(x){m(Al(x,i("knowledge.errors.createBase")))}finally{f(!1)}};return a.jsx(hT,{title:i("knowledge.createBase"),onClose:t,busy:d,children:a.jsxs("form",{onSubmit:y=>void v(y),children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:i("common.name")}),a.jsx("input",{autoFocus:!0,value:r,maxLength:48,"aria-invalid":c&&b||void 0,"aria-describedby":"knowledge-name-help",onBlur:()=>u(!0),onChange:y=>s(y.target.value)})]}),a.jsx("p",{id:"knowledge-name-help",className:`knowledge-dialog__note${c&&b?" is-error":""}`,role:c&&b?"alert":void 0,children:i(c&&b?"knowledge.invalidName":"knowledge.nameHelp")}),a.jsxs("label",{children:[a.jsx("span",{children:i("knowledge.optionalDescription")}),a.jsx("textarea",{value:o,maxLength:80,onChange:y=>l(y.target.value)})]}),a.jsx(OC,{message:h})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:t,disabled:d,children:i("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:d||!g||b,children:i(d?"common.creating":"common.create")})]})]})})}function GTt({item:e,onClose:t,onUpdated:n}){const{t:i}=Te("ui"),[r,s]=p.useState(e.description),[o,l]=p.useState(!1),[c,u]=p.useState(""),d=async f=>{f.preventDefault(),l(!0),u("");try{n(await Nbt(e.id,e.region,{description:r.trim()}))}catch(h){u(Al(h,i("knowledge.errors.updateBase")))}finally{l(!1)}};return a.jsx(hT,{title:i("knowledge.editBase"),onClose:t,busy:o,children:a.jsxs("form",{onSubmit:f=>void d(f),children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:i("common.name")}),a.jsx("input",{value:e.name,disabled:!0})]}),a.jsxs("label",{children:[a.jsx("span",{children:i("common.description")}),a.jsx("textarea",{autoFocus:!0,value:r,maxLength:80,onChange:f=>s(f.target.value)})]}),a.jsx("p",{className:"knowledge-dialog__note",children:i("knowledge.descriptionOnly")}),a.jsx(OC,{message:c})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:t,disabled:o,children:i("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:o,children:i(o?"common.saving":"common.save")})]})]})})}function ZMe(e,t){if(!e.trim())return{};const n=JSON.parse(e);if(!n||Array.isArray(n)||typeof n!="object")throw new Error(t);return n}function XTt({base:e,onClose:t,onCreated:n,onAssociationInvalid:i}){const{t:r}=Te("ui"),[s,o]=p.useState("document"),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(""),[m,g]=p.useState(null),[b,v]=p.useState(!1),[y,w]=p.useState("{}"),[x,O]=p.useState(""),[k,S]=p.useState(""),[C,E]=p.useState(null),j=p.useRef(null),T=p.useRef(null),R=p.useRef(null),A=p.useRef(0),N=!!x;p.useEffect(()=>{var L;C&&!N&&((L=R.current)==null||L.focus())},[N,C]);const P=L=>{N||L===s||(o(L),g(null),h(""),c(""),d(""),S(""),E(null),v(!1),A.current=0,j.current&&(j.current.value=""))},I=L=>{if(!L||s==="web")return;const F=WTt(L,s,r);if(F){g(null),c(""),d(""),S(F);return}g(L),S(""),c(L.name.replace(/\.[^.]+$/,"")),d(o9(L.name).slice(1))},D=async L=>{if(L.preventDefault(),s==="web"?!f.trim():!m)return;let F;try{F=ZMe(y,r("knowledge.errors.metadataObject"))}catch(M){S(Al(M,r("knowledge.errors.metadataFormat")));return}O(s==="web"?C?"save":"preview":"upload"),S("");try{if(s==="web")if(C){const M={sourceType:"url",metadata:C.metadata,url:C.preview.url,sourceTitle:C.preview.name,sourceMarkdown:C.preview.sourceMarkdown};await Dbt(e.id,e.region,M),n()}else{const M=await Mbt(e.id,e.region,{url:f.trim()});if(!M.sourceMarkdown.trim())throw new Error(r("knowledge.errors.noWebPreview"));E({preview:M,metadata:F})}else m&&(await Lbt(e.id,e.region,{file:m,name:l.trim()||void 0,documentType:u.trim()||void 0,metadata:F}),n())}catch(M){M instanceof gM&&M.errorCode===sPe?i(M):S(Al(M,r(s==="web"?C?"knowledge.errors.addWeb":"knowledge.errors.previewWeb":"knowledge.errors.uploadFile")))}finally{O("")}},_=()=>{N||(E(null),S(""),requestAnimationFrame(()=>{var L;return(L=T.current)==null?void 0:L.focus()}))};return a.jsx(hT,{title:r(C?"knowledge.previewWeb":"knowledge.addData"),onClose:t,busy:N,className:C?"knowledge-dialog--preview knowledge-dialog--web-confirm":"",children:a.jsx("form",{onSubmit:L=>void D(L),children:C?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"knowledge-preview knowledge-web-preview",children:[a.jsxs("div",{className:"knowledge-preview__meta",children:[a.jsx("strong",{title:C.preview.name,children:C.preview.name}),a.jsx("a",{href:C.preview.url,target:"_blank",rel:"noopener noreferrer",children:r("knowledge.openOriginalWeb")})]}),a.jsx("div",{className:"knowledge-preview__body","aria-live":"polite",children:a.jsx("div",{className:"knowledge-preview__markdown-shell",children:a.jsx(_d,{text:C.preview.sourceMarkdown,allowRawHtml:!1,className:"knowledge-preview__markdown"})})}),k?a.jsx("div",{className:"knowledge-web-preview__error",children:a.jsx(OC,{message:k})}):null]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",className:"is-back",onClick:_,disabled:N,children:r("knowledge.backToEdit")}),a.jsx("button",{type:"button",onClick:t,disabled:N,children:r("common.cancel")}),a.jsx("button",{ref:R,type:"submit",className:"is-primary",disabled:N,children:r(x==="save"?"common.adding":"knowledge.confirmAdd")})]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsx("div",{className:"knowledge-source-tabs",role:"tablist","aria-label":r("knowledge.source"),children:[["image",r("knowledge.image")],["document",r("knowledge.documentFile")],["web",r("knowledge.webPage")]].map(([L,F])=>a.jsx("button",{type:"button",role:"tab",id:`knowledge-source-${L}-tab`,"aria-controls":`knowledge-source-${L}-panel`,"aria-selected":s===L,tabIndex:s===L?0:-1,className:s===L?"is-active":"",disabled:N,onClick:()=>P(L),onKeyDown:M=>{const z=["image","document","web"];if(!["ArrowLeft","ArrowRight","Home","End"].includes(M.key))return;M.preventDefault();const q=z.indexOf(L),U=M.key==="Home"?z[0]:M.key==="End"?z[z.length-1]:z[(q+(M.key==="ArrowRight"?1:-1)+z.length)%z.length];P(U),requestAnimationFrame(()=>{var J;return(J=document.getElementById(`knowledge-source-${U}-tab`))==null?void 0:J.focus()})},children:F},L))}),a.jsx("div",{id:`knowledge-source-${s}-panel`,className:"knowledge-source-panel",role:"tabpanel","aria-labelledby":`knowledge-source-${s}-tab`,children:s==="web"?a.jsxs(a.Fragment,{children:[a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.webUrl")}),a.jsx("input",{ref:T,autoFocus:!0,type:"url",value:f,disabled:N,onChange:L=>{h(L.target.value),S("")},placeholder:"https://example.com/article"})]}),a.jsx("div",{className:"knowledge-upload-status",role:"status","aria-live":"polite",children:x==="preview"?a.jsx(hn,{children:r("knowledge.generatingWebPreview")}):null})]}):a.jsxs(a.Fragment,{children:[a.jsx("input",{ref:j,className:"knowledge-upload-input",type:"file","aria-label":r("knowledge.selectFile"),accept:s==="image"?XMe:YMe,disabled:N,onChange:L=>{var F;I(((F=L.currentTarget.files)==null?void 0:F[0])??null),L.currentTarget.value=""}}),a.jsxs("button",{type:"button",className:`knowledge-upload-dropzone${b?" is-dragging":""}${m?" is-ready":""}`,disabled:N,onClick:()=>{var L;return(L=j.current)==null?void 0:L.click()},onDragEnter:L=>{L.preventDefault(),!N&&(A.current+=1,v(!0))},onDragOver:L=>{L.preventDefault(),N||(L.dataTransfer.dropEffect="copy")},onDragLeave:L=>{L.preventDefault(),A.current=Math.max(0,A.current-1),A.current===0&&v(!1)},onDrop:L=>{var F;L.preventDefault(),A.current=0,v(!1),N||I(((F=L.dataTransfer.files)==null?void 0:F[0])??null)},children:[a.jsx("strong",{children:m?m.name:r("knowledge.selectOrDropFile")}),a.jsx("span",{children:m?r("knowledge.selectedFile",{size:aq(m.size)}):r(s==="image"?"knowledge.imageFileHelp":"knowledge.documentFileHelp")})]}),a.jsx("div",{className:"knowledge-upload-status",role:"status","aria-live":"polite",children:N?a.jsx(hn,{children:r("knowledge.uploadingFile")}):null})]})}),s!=="web"?a.jsxs("div",{className:"knowledge-dialog__fields",children:[a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.optionalName")}),a.jsx("input",{value:l,disabled:N,maxLength:256,onChange:L=>c(L.target.value)})]}),a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.optionalType")}),a.jsx("input",{value:u,disabled:N,maxLength:64,onChange:L=>d(L.target.value),placeholder:"pdf, docx, png"})]})]}):null,a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.metadataJson")}),a.jsx("textarea",{className:"is-code",value:y,disabled:N,onChange:L=>w(L.target.value),spellCheck:!1})]}),a.jsx(OC,{message:k})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:t,disabled:N,children:r("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:N||(s==="web"?!f.trim():!m),children:r(N?s==="web"?"common.generating":"common.uploading":s==="web"?"knowledge.generatePreview":"knowledge.uploadFile")})]})]})})})}function YTt({base:e,item:t,onClose:n,onUpdated:i}){const{t:r}=Te("ui"),[s,o]=p.useState(()=>JSON.stringify(t.metadata??{},null,2)),[l,c]=p.useState(!1),[u,d]=p.useState(""),f=async h=>{h.preventDefault();let m;try{m=ZMe(s,r("knowledge.errors.metadataObject"))}catch(g){d(Al(g,r("knowledge.errors.metadataFormat")));return}c(!0),d("");try{i(await $bt(e.id,t.id,e.region,{metadata:m}))}catch(g){d(Al(g,r("knowledge.errors.updateDocument")))}finally{c(!1)}};return a.jsx(hT,{title:r("knowledge.editMetadata"),onClose:n,busy:l,children:a.jsxs("form",{onSubmit:h=>void f(h),children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.knowledge")}),a.jsx("input",{value:t.name||t.id,disabled:!0})]}),a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.metadataJson")}),a.jsx("textarea",{autoFocus:!0,className:"is-code knowledge-metadata-editor",value:s,onChange:h=>o(h.target.value),spellCheck:!1})]}),a.jsx(OC,{message:u})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:n,disabled:l,children:r("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:l,children:r(l?"common.saving":"common.save")})]})]})})}const JMe=new Set(["avif","bmp","gif","jpeg","jpg","png","svg","webp"]),eLe=new Set(["aac","flac","m4a","mp3","ogg","wav","webm"]),tLe=new Set(["m4v","mov","mp4","mpeg","mpg","ogg","webm"]),ZTt=new Set(["pdf"]),JTt=new Set(["doc","docx","ppt","pptx","xls","xlsx"]),e2t=new Set(["creating","indexing","pending","processing","queued","submitted"]),t2t=new Set(["error","failed","unavailable"]);function Ane(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}}function __(e){if(e==null||e==="")return"-";if(["string","number","boolean"].includes(typeof e))return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function n2t(e,t){if(Array.isArray(e)){if(e.length===0)return null;const r=e.map(Ane);if(r.some(s=>Object.keys(s).length>0)){const s=[...new Set(r.flatMap(o=>Object.keys(o)))];return{columns:s,rows:r.map(o=>s.map(l=>__(o[l])))}}return{columns:[t("knowledge.value")],rows:e.map(s=>[__(s)])}}const n=Ane(e),i=Object.entries(n);if(i.length===0)return null;if(i.every(([,r])=>Array.isArray(r))){const r=i.map(([o])=>o),s=Math.max(...i.map(([,o])=>o.length));return{columns:r,rows:Array.from({length:s},(o,l)=>i.map(([,c])=>__(c[l])))}}return{columns:[t("knowledge.field"),t("knowledge.value")],rows:i.map(([r,s])=>[r,__(s)])}}function nLe(e){const t=e.trim();if(!t||t.startsWith("//"))return"";if(t.startsWith("/"))return t;try{const n=new URL(t);return["http:","https:"].includes(n.protocol)?n.href:""}catch{return""}}function i2t(e){const t=nLe(e);return t.startsWith("http://")||t.startsWith("https://")?t:""}function r2t(e){var r;const t=e.attachmentType.trim().toLocaleLowerCase();if(t==="image"||t==="doc-image"||t.startsWith("image/"))return"image";if(t==="audio"||t.startsWith("audio/"))return"audio";if(t==="video"||t.startsWith("video/"))return"video";if(t==="pdf"||t==="application/pdf")return"pdf";const n=e.attachmentUrl.split(/[?#]/,1)[0],i=n.includes(".")?((r=n.split(".").pop())==null?void 0:r.toLocaleLowerCase())??"":"";return JMe.has(i)?"image":eLe.has(i)?"audio":tLe.has(i)?"video":ZTt.has(i)?"pdf":t||i?"file":"none"}function s2t(e,t){const n=e.status.trim().toLocaleLowerCase();if(e2t.has(n))return{title:t("knowledge.preview.processingTitle"),detail:t("knowledge.preview.processingDetail")};if(t2t.has(n))return{title:t("knowledge.preview.failedTitle"),detail:t("knowledge.preview.failedDetail")};const i=l9(e).toLocaleLowerCase();return i==="pdf"||JTt.has(i)?{title:t("knowledge.preview.noParsedTitle"),detail:t("knowledge.preview.noParsedDetail")}:JMe.has(i)||eLe.has(i)||tLe.has(i)?{title:t("knowledge.preview.noMediaTitle"),detail:t("knowledge.preview.noMediaDetail")}:{title:t("knowledge.preview.noDataTitle"),detail:t("knowledge.preview.noDataDetail")}}function a2t({chunk:e}){const{t}=Te("ui"),[n,i]=p.useState(!1),r=nLe(e.attachmentUrl),s=r2t(e);return!r||s==="none"?null:n?a.jsx("div",{className:"knowledge-preview__attachment-error",children:t("knowledge.preview.attachmentError")}):s==="image"?a.jsx("img",{className:"knowledge-preview__image",src:r,alt:e.title||t("knowledge.preview.imageAlt"),loading:"lazy",onError:()=>i(!0)}):s==="audio"?a.jsx("audio",{className:"knowledge-preview__audio",src:r,controls:!0,preload:"metadata",onError:()=>i(!0),children:t("knowledge.preview.audioUnsupported")}):s==="video"?a.jsx("video",{className:"knowledge-preview__video",src:r,controls:!0,playsInline:!0,preload:"metadata",onError:()=>i(!0),children:t("knowledge.preview.videoUnsupported")}):s==="pdf"?a.jsxs("div",{className:"knowledge-preview__pdf",children:[a.jsx("iframe",{src:r,title:e.title?t("knowledge.preview.namedPdf",{name:e.title}):t("knowledge.preview.pdf"),sandbox:"",referrerPolicy:"no-referrer",onError:()=>i(!0)}),a.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:t("knowledge.preview.openPdf")})]}):a.jsxs("div",{className:"knowledge-preview__file-fallback",children:[a.jsx("p",{children:t("knowledge.preview.fileUnsupported")}),a.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:t("knowledge.preview.openOriginalFile")})]})}function o2t({base:e,item:t,onClose:n}){const{t:i}=Te("ui"),[r,s]=p.useState([]),[o,l]=p.useState(t),[c,u]=p.useState(""),[d,f]=p.useState(!0),[h,m]=p.useState(!1),[g,b]=p.useState(!1),[v,y]=p.useState(""),w=p.useRef(0),x=p.useRef(null),O=p.useCallback(async(E=0)=>{var R;(R=x.current)==null||R.abort();const j=new AbortController;x.current=j;const T=w.current+1;w.current=T,E>0?m(!0):f(!0),y(""),E===0&&(s([]),b(!1));try{const A=await Pbt(e.id,t.id,{region:e.region,offset:E,signal:j.signal});if(w.current!==T)return;l(A.document.id?A.document:t),u(A.sourceMarkdown||A.document.sourceMarkdown),s(N=>E>0?[...N,...A.chunks]:A.chunks),b(A.hasMore)}catch(A){!a9(A)&&w.current===T&&y(Al(A,i("knowledge.errors.loadPreview")))}finally{w.current===T&&(f(!1),m(!1))}},[e.id,e.region,t,i]);p.useEffect(()=>(O(),()=>{var E;(E=x.current)==null||E.abort(),w.current+=1}),[O]);const k=i2t(o.url||t.url),S=s2t(o,i),C=o.metadata._veadk_content_format==="markdown";return a.jsx(hT,{title:o.name||t.name||t.id,onClose:n,className:"knowledge-dialog--preview",children:a.jsxs("div",{className:"knowledge-preview",children:[o.sizeBytes>0||k?a.jsxs("div",{className:"knowledge-preview__meta",children:[o.sizeBytes>0?a.jsx("span",{children:aq(o.sizeBytes)}):null,k?a.jsx("a",{href:k,target:"_blank",rel:"noopener noreferrer",children:i("knowledge.openOriginalWeb")}):null]}):null,a.jsx("div",{className:"knowledge-preview__body","aria-live":"polite",children:c?a.jsx("div",{className:"knowledge-preview__markdown-shell",children:a.jsx(_d,{text:c,allowRawHtml:!1,className:"knowledge-preview__markdown"})}):d?a.jsx("div",{className:"knowledge-preview__state",role:"status",children:a.jsx(hn,{as:"span",duration:2.4,children:i("knowledge.preview.loading")})}):v&&r.length===0?a.jsxs("div",{className:"knowledge-preview__state is-error",role:"alert",children:[a.jsx("p",{children:v}),a.jsx("button",{type:"button",onClick:()=>void O(),children:i("common.retry")})]}):r.length===0?a.jsxs("div",{className:"knowledge-preview__state",children:[a.jsx("p",{children:S.title}),a.jsx("span",{children:k?i("knowledge.preview.openOriginalHint"):S.detail}),a.jsx("button",{type:"button",onClick:()=>void O(),children:i("common.reload")})]}):a.jsxs("div",{className:"knowledge-preview__chunks",children:[r.map((E,j)=>{const T=n2t(E.tableFields,i),R=E.id||`${j}:${E.title}`;return a.jsxs("article",{className:"knowledge-preview__chunk",children:[a.jsx("header",{children:a.jsx("h3",{children:E.title||i("knowledge.preview.chunk",{index:j+1})})}),E.content?C?a.jsx(_d,{text:E.content,allowRawHtml:!1,className:"knowledge-preview__markdown"}):a.jsx("p",{className:"knowledge-preview__content",children:E.content}):null,T?a.jsx("div",{className:"knowledge-preview__table-wrap",children:a.jsxs("table",{children:[a.jsx("thead",{children:a.jsx("tr",{children:T.columns.map((A,N)=>a.jsx("th",{scope:"col",children:A},`${A}:${N}`))})}),a.jsx("tbody",{children:T.rows.map((A,N)=>a.jsx("tr",{children:A.map((P,I)=>a.jsx("td",{children:P},I))},N))})]})}):null,a.jsx(a2t,{chunk:E})]},R)}),v?a.jsx("div",{className:"knowledge-preview__more-error",role:"alert",children:v}):null,g?a.jsx("button",{type:"button",className:"knowledge-preview__load-more",disabled:h,onClick:()=>void O(r.length),children:h?a.jsx(hn,{as:"span",duration:2.4,children:i("knowledge.preview.loadingMore")}):i("knowledge.preview.loadMore")}):null]})})]})})}function l2t({cloudProvider:e,region:t,active:n=!0,activationRevision:i=0,onDetailChange:r,toolbarLeading:s,toolbarFilters:o}){const{t:l,i18n:c}=Te("ui"),[u,d]=p.useState([]),[f,h]=p.useState({}),[m,g]=p.useState([]),[b,v]=p.useState(""),[y,w]=p.useState("overview"),[x,O]=p.useState(""),[k,S]=p.useState(""),[C,E]=p.useState(!0),[j,T]=p.useState(!1),[R,A]=p.useState(""),[N,P]=p.useState([]),[I,D]=p.useState(!1),[_,L]=p.useState(""),[F,M]=p.useState(""),[z,q]=p.useState(""),[U,J]=p.useState(!1),[V,Z]=p.useState(!1),[ne,W]=p.useState(!1),[G,H]=p.useState(null),[se,Y]=p.useState(null),[X,ie]=p.useState(null),[ee,be]=p.useState(null),[ue,pe]=p.useState(null),[ke,je]=p.useState(!1),Pe=p.useRef(0),Ee=p.useRef(0),Qe=p.useRef([]),_e=p.useRef(!1),ae=p.useRef(!1),le=p.useRef(null),ge=p.useRef(null),Oe=p.useRef({}),Se=p.useRef(!1),qe=p.useRef(null),Xe=p.useRef(null),ye=p.useRef(null),we=p.useRef(null),Ae=p.useMemo(()=>[t],[t]),Ve=p.useCallback(We=>`${We.region}\0${We.id}`,[]),Be=u.find(We=>Ve(We)===b)??null,_t=!!(Be&&z===Ve(Be));p.useEffect(()=>{r==null||r(!!Be)},[r,Be]),p.useEffect(()=>{w("overview"),S("")},[b]);const Pt=p.useMemo(()=>{const We=x.trim().toLocaleLowerCase();return We?u.filter(kt=>[kt.name,kt.description,kt.ownerLabel,kt.providerKnowledgeId].some(He=>He.toLocaleLowerCase().includes(We))):u},[u,x]),Kt=p.useMemo(()=>{const We=k.trim().toLocaleLowerCase();return We?N.filter(kt=>[kt.name,kt.id,l9(kt)].some(He=>He.toLocaleLowerCase().includes(We))):N},[k,N]);p.useEffect(()=>{Y(null)},[Be==null?void 0:Be.id,Be==null?void 0:Be.region]);const Et=p.useCallback(async(We=!1)=>{var nt;if(We&&(Se.current||Object.keys(Oe.current).length===0))return;(nt=le.current)==null||nt.abort();const kt=new AbortController;le.current=kt;const He=Pe.current+1;Pe.current=He,Se.current=!0,We?T(!0):E(!0),A(""),We||g([]);try{const et=await _bt({regions:Ae,nextTokens:We?Oe.current:void 0,signal:kt.signal});if(Pe.current!==He)return;d(St=>We?[...St,...et.items.filter(Ct=>!St.some(It=>Ve(It)===Ve(Ct)))]:et.items),Oe.current=et.nextTokens,h(et.nextTokens);const ft=et.failures.map(({region:St,error:Ct})=>`${xh(St,e)}: ${Al(Ct,l("common.loadFailed"))}`);g(St=>We?[...new Set([...St,...ft])]:ft),We||v(St=>et.items.some(Ct=>Ve(Ct)===St)?St:"")}catch(et){if(a9(et))return;Pe.current===He&&(We?g(ft=>[...new Set([...ft,Al(et,l("knowledge.errors.loadMoreBases"))])]):A(Al(et,l("knowledge.errors.loadBases"))))}finally{Pe.current===He&&(Se.current=!1,E(!1),T(!1))}},[Ve,e,Ae,l]),vt=p.useCallback(async(We,kt=!1)=>{var et;if(kt&&_e.current)return;(et=ge.current)==null||et.abort();const He=new AbortController;ge.current=He;const nt=Ee.current+1;Ee.current=nt,kt||(Qe.current=[],ae.current=!1,P([]),J(!1),M("")),_e.current=!0,D(!0),kt?M(""):L("");try{const ft=await Ibt(We.id,{region:We.region,offset:kt?Qe.current.length:0,signal:He.signal});if(Ee.current!==nt)return;q(Gt=>Gt===Ve(We)?"":Gt);const St=Qe.current,Ct=kt?[...St,...ft.items.filter(Gt=>!Gt.id||!St.some(Ge=>Ge.id===Gt.id))]:ft.items,It=ft.hasMore&&(!kt||Ct.length>St.length);Qe.current=Ct,ae.current=It,P(Ct),J(It)}catch(ft){if(a9(ft))return;Ee.current===nt&&(ft instanceof gM&&ft.errorCode===sPe&&(q(Ve(We)),H(Ct=>Ct&&Ve(Ct)===Ve(We)?null:Ct)),kt?M(Al(ft,l("knowledge.errors.loadMoreData"))):L(Al(ft,l("knowledge.errors.loadData"))))}finally{Ee.current===nt&&(_e.current=!1,D(!1))}},[Ve,l]);p.useEffect(()=>{var We;(We=le.current)==null||We.abort(),Pe.current+=1,Se.current=!1,Oe.current={},d([]),h({}),g([]),v(""),q(""),A(""),E(!0)},[e]),p.useEffect(()=>{if(n)return Et(),()=>{var We;(We=le.current)==null||We.abort(),Pe.current+=1,Se.current=!1}},[n,i,Et]),p.useEffect(()=>{var We,kt;if(!n){(We=ge.current)==null||We.abort(),Ee.current+=1,_e.current=!1;return}if(!Be){(kt=ge.current)==null||kt.abort(),Ee.current+=1,Qe.current=[],_e.current=!1,ae.current=!1,P([]),J(!1),M("");return}return vt(Be),()=>{var He;(He=ge.current)==null||He.abort(),Ee.current+=1,_e.current=!1}},[n,i,Be==null?void 0:Be.id,Be==null?void 0:Be.region]);const tt=n&&!Be&&!x.trim()&&!C&&!j&&!R&&Object.keys(f).length>0;p.useEffect(()=>{const We=Xe.current,kt=qe.current;if(!We||!kt||!tt)return;const He=new IntersectionObserver(([nt])=>{nt.isIntersecting&&Et(!0)},{root:kt,rootMargin:"240px 0px",threshold:.01});return He.observe(We),()=>He.disconnect()},[tt,Et]);const mt=()=>{const We=qe.current;!We||!tt||We.scrollHeight-We.scrollTop-We.clientHeight<=240&&Et(!0)},Ne=!!(Be&&N.length>0&&U&&!I&&!F);p.useEffect(()=>{const We=we.current,kt=ye.current;if(!Be||!We||!kt||!Ne)return;const He=new IntersectionObserver(([nt])=>{nt.isIntersecting&&vt(Be,!0)},{root:ye.current,rootMargin:"240px 0px",threshold:.01});return He.observe(We),()=>He.disconnect()},[Ne,vt,Be==null?void 0:Be.id,Be==null?void 0:Be.region]);const wt=()=>{const We=ye.current;if(!Be||!We||!ae.current||_e.current||F)return;const{scrollHeight:kt,scrollTop:He,clientHeight:nt}=We;kt-He-nt<=240&&vt(Be,!0)},jt=We=>{d(kt=>kt.map(He=>Ve(He)===Ve(We)?We:He))},Yt=async()=>{if(ee){je(!0);try{await Rbt(ee.id,ee.region),d(We=>We.filter(kt=>Ve(kt)!==Ve(ee))),q(We=>We===Ve(ee)?"":We),b===Ve(ee)&&v(""),be(null)}catch(We){A(Al(We,l("knowledge.errors.deleteBase"))),be(null)}finally{je(!1)}}},wn=async()=>{if(!(!Be||!ue)){je(!0);try{await Fbt(Be.id,ue.id,Be.region);const We=Qe.current.filter(kt=>kt.id!==ue.id);Qe.current=We,P(We),pe(null)}catch(We){L(Al(We,l("knowledge.errors.deleteDocument"))),pe(null)}finally{je(!1)}}};return a.jsxs("section",{className:`knowledge-library${Be?" is-detail":" resource-collection"}`,"aria-label":l("knowledge.library"),children:[Be?a.jsx(nT,{className:"knowledge-library__detail",title:Be.name,description:Be.description||l("common.noDescription"),identitySeed:Be.name,backLabel:l("knowledge.backToList"),onBack:()=>v(""),sections:[{key:"overview",label:l("skillCenter.overview"),content:a.jsx("section",{className:"knowledge-overview",children:a.jsxs(bH,{className:"knowledge-overview__summary",children:[a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.provider")}),a.jsx("dd",{children:Be.providerType||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.knowledgeId")}),a.jsx("dd",{className:"knowledge-keyboard-reveal",tabIndex:0,title:Be.providerKnowledgeId,children:Be.providerKnowledgeId||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.project")}),a.jsx("dd",{children:Be.projectName||"default"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.creator")}),a.jsx("dd",{children:P4(Be.ownerLabel)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("skillCenter.updatedAt")}),a.jsx("dd",{children:zTt(Be.updatedAt,c.resolvedLanguage??c.language)||"-"})]})]})})},{key:"data",label:l("knowledge.data"),content:a.jsx("section",{className:"knowledge-documents",children:a.jsx("div",{className:`knowledge-documents__body${N.length>0?" is-table":""}`,"aria-live":"polite",children:I&&N.length===0?a.jsx(cl,{}):_&&N.length===0?a.jsxs("div",{className:"knowledge-library__state is-error",role:"alert",children:[a.jsx("p",{children:_}),_t&&Be.canManage?a.jsx("button",{type:"button",onClick:()=>be(Be),children:l("knowledge.deleteInvalidAssociation")}):a.jsx("button",{type:"button",onClick:()=>void vt(Be),children:l("common.retry")})]}):N.length===0?a.jsxs("div",{className:"knowledge-library__state",children:[a.jsx(BTt,{}),a.jsx("p",{children:l("knowledge.noData")}),Be.canManage&&a.jsx("button",{type:"button",onClick:()=>H(Be),children:l("knowledge.addFirstData")})]}):a.jsx(yH,{rows:Kt,rowKey:We=>We.id,rowLabel:We=>We.name||We.id,columns:[{key:"name",header:l("common.name"),className:"is-primary-column",render:We=>a.jsx("span",{title:We.name||We.id,children:We.name||We.id})},{key:"format",header:l("knowledge.format"),className:"is-compact-column",render:We=>l9(We)},{key:"size",header:l("knowledge.size"),className:"is-compact-column",render:We=>aq(We.sizeBytes)}],searchValue:k,onSearchChange:S,searchPlaceholder:l("knowledge.searchData"),searchLabel:l("knowledge.searchLibraryData"),primaryAction:Be.canManage?{label:l(_t?"knowledge.associationInvalid":"knowledge.addData"),disabled:_t,title:_t?l("knowledge.providerMissing"):void 0,onClick:()=>H(Be)}:void 0,rowActions:We=>[{label:l("common.preview"),onSelect:()=>Y(We)},...Be.canManage?[{label:l("common.edit"),onSelect:()=>ie(We)},{label:l("common.delete"),onSelect:()=>pe(We),danger:!0}]:[]],scrollRef:ye,onScroll:wt,busy:I,emptyLabel:l("knowledge.noMatchingData"),footer:I?a.jsxs("div",{className:"knowledge-document-pagination",role:"status","aria-live":"polite",children:[a.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),a.jsx("span",{children:l("knowledge.loadingMoreData")})]}):F?a.jsxs("div",{className:"knowledge-document-pagination is-error",role:"alert",children:[a.jsx("span",{children:F}),a.jsx("button",{type:"button",onClick:()=>void vt(Be,!0),children:l("knowledge.retryLoading")})]}):U?a.jsx("div",{ref:we,className:"knowledge-document-pagination",role:"status","aria-live":"polite",children:l("skillCenter.scrollForMore")}):null})})})}],activeSectionKey:y,navigationLabel:l("knowledge.details"),onSectionChange:w,actions:Be.canManage?a.jsxs(a.Fragment,{children:[a.jsx(Tt,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>be(Be),children:l("common.delete")}),a.jsx(Tt,{type:"button",color:"primary",size:"lg",pill:!1,onClick:()=>W(!0),children:l("common.edit")})]}):void 0}):a.jsxs(a.Fragment,{children:[a.jsxs(ab,{className:"knowledge-library__toolbar library-resource-toolbar",children:[s,a.jsxs("div",{className:"resource-toolbar__actions",children:[o,a.jsx(em,{value:x,onChange:We=>O(We.target.value),placeholder:l("knowledge.searchBases"),"aria-label":l("knowledge.searchBases")})]})]}),a.jsxs(tm,{ref:qe,"aria-live":"polite",onScroll:mt,children:[m.length>0&&!C&&a.jsxs("div",{className:"knowledge-region-warning",role:"status",children:[a.jsx("span",{children:l("knowledge.someBasesFailed")}),a.jsx("button",{type:"button",onClick:()=>void Et(),children:l("common.retry")})]}),C&&u.length===0?a.jsx(cl,{}):R?a.jsxs("div",{className:"knowledge-library__state is-error",role:"alert",children:[a.jsx("p",{children:R}),a.jsx("button",{type:"button",onClick:()=>void Et(),children:l("common.retry")})]}):Pt.length===0&&x.trim()?a.jsxs("div",{className:"knowledge-library__state",children:[a.jsx(FTt,{}),a.jsx("p",{children:l("knowledge.noMatchingBases")})]}):a.jsxs(V0,{children:[x.trim()?null:a.jsx(cb,{"aria-label":l("knowledge.createBase"),icon:a.jsx(QTt,{}),onClick:()=>Z(!0),children:l("knowledge.createBase")}),Pt.map(We=>a.jsx(q0,{className:"knowledge-card",title:We.name,description:We.description||l("common.noDescription"),metadata:[{label:l("knowledge.creator"),value:P4(We.ownerLabel),title:P4(We.ownerLabel)},{label:l("knowledge.project"),value:We.projectName||"default",title:We.projectName||"default"}],action:{label:z===Ve(We)?l("knowledge.associationInvalid"):l("knowledge.addData"),icon:"plus",disabled:!We.canManage||z===Ve(We),title:We.canManage?z===Ve(We)?l("knowledge.providerMissing"):void 0:l("knowledge.noManagePermission"),onClick:()=>H(We)},detailAction:{label:l("common.viewDetails"),onClick:()=>v(Ve(We))}},Ve(We)))]}),tt||j?a.jsx("div",{ref:Xe,className:"my-agent-load-more",role:"status","aria-live":"polite",children:j?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),a.jsx("span",{children:l("knowledge.loadingMoreBases")})]}):tt?a.jsx("span",{children:l("skillCenter.scrollForMore")}):null}):null]})]}),V&&a.jsx(KTt,{region:t,onClose:()=>Z(!1),onCreated:We=>{d(kt=>[We,...kt]),v(Ve(We)),Z(!1)}}),Be&&ne&&a.jsx(GTt,{item:Be,onClose:()=>W(!1),onUpdated:We=>{jt(We),W(!1)}}),Be&&se&&a.jsx(o2t,{base:Be,item:se,onClose:()=>Y(null)}),G&&a.jsx(XTt,{base:G,onClose:()=>H(null),onAssociationInvalid:We=>{q(Ve(G)),Be&&Ve(Be)===Ve(G)&&L(Al(We,l("knowledge.associationInvalid"))),H(null)},onCreated:()=>{Be&&Ve(Be)===Ve(G)&&vt(Be),H(null)}}),Be&&X&&a.jsx(YTt,{base:Be,item:X,onClose:()=>ie(null),onUpdated:We=>{const kt=Qe.current.map(He=>He.id===We.id?We:He);Qe.current=kt,P(kt),ie(null)}}),ee&&a.jsx(Ad,{title:l("knowledge.deleteBaseTitle"),description:l("knowledge.deleteBaseDescription",{name:ee.name}),confirmLabel:l(ke?"common.deleting":"common.delete"),variant:"danger",busy:ke,onCancel:()=>be(null),onConfirm:()=>void Yt()}),ue&&a.jsx(Ad,{title:l("knowledge.deleteDocumentTitle"),description:l("knowledge.deleteDocumentDescription",{name:ue.name||ue.id}),confirmLabel:l(ke?"common.deleting":"common.delete"),variant:"danger",busy:ke,onCancel:()=>pe(null),onConfirm:()=>void wn()})]})}const c2t="_EmptyMessage_1r5gu_1",u2t="_IconBadge_1r5gu_16",d2t="_Title_1r5gu_54",f2t="_Description_1r5gu_69",h2t="_ActionRow_1r5gu_77",pT={EmptyMessage:c2t,IconBadge:u2t,Title:d2t,Description:f2t,ActionRow:h2t},Hn=({children:e,className:t,fill:n="static"})=>a.jsx("div",{className:Qi(pT.EmptyMessage,t),"data-fill":n,children:e}),p2t=({size:e="md",color:t="secondary",children:n,className:i})=>a.jsx("div",{className:Qi(pT.IconBadge,i),"data-size":e,"data-color":t,children:n}),m2t=({children:e,className:t,color:n="secondary"})=>a.jsx("div",{className:Qi(pT.Title,t),"data-color":n,children:e}),g2t=({children:e,className:t})=>a.jsx("div",{className:Qi(pT.Description,t),children:e}),b2t=({children:e,className:t})=>a.jsx("div",{className:Qi(pT.ActionRow,t),children:e});Hn.Icon=p2t;Hn.Title=m2t;Hn.Description=g2t;Hn.ActionRow=b2t;yn.hasResourceBundle("en-US","skills")||yn.addResourceBundle("en-US","skills",zme,!0,!0);yn.hasResourceBundle("zh-CN","skills")||yn.addResourceBundle("zh-CN","skills",Gwe,!0,!0);function tn(e,t={}){return yn.t(e,{...t,ns:"skills"})}const y2t="/web/skill-workbench";class c9 extends Error{constructor(t,n,i="SKILL_WORKBENCH_ERROR",r=!1,s="",o,l=""){super(t),this.status=n,this.code=i,this.retryable=r,this.statusText=s,this.originalError=o,this.rawResponse=l,this.name="SkillWorkbenchApiError"}}function kd(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(tn("api.invalidFormat",{label:t}));return e}function Tne(e,t){if(e!=null){if(typeof e!="string"||!e.trim()||e.trim().length>256)throw new Error(tn("api.invalidFormat",{label:t}));return e.trim()}}function v2t(e){if(e!=null){if(e==="pending"||e==="ready"||e==="failed"||e==="unknown")return e;throw new Error(tn("api.invalidFormat",{label:tn("api.recoveryStatus")}))}}async function kh(e,t={},n=ho){return fetch(ja(`${y2t}${e}`),{...t,headers:fc(t.headers),signal:po(t.signal,n)})}async function oq(e,t){var i;const n=await e.text().catch(()=>"");try{const r=kd(JSON.parse(n),tn("api.errorResponse")),s=r.detail&&typeof r.detail=="object"?kd(r.detail,tn("api.errorDetails")):r;return new c9(typeof s.message=="string"?s.message:t,e.status,typeof s.code=="string"?s.code:"SKILL_WORKBENCH_ERROR",s.retryable===!0,e.statusText,s.originalError&&typeof s.originalError=="object"?s.originalError:void 0,n)}catch{const r=((i=e.headers.get("content-type"))==null?void 0:i.split(";",1)[0])||tn("api.missingContentType");return new c9(tn("api.gatewayError",{fallback:t,status:e.status,contentType:r}),e.status,"SKILL_WORKBENCH_ERROR",!1,e.statusText,void 0,n)}}async function db(e,t){if(!e.ok)throw await oq(e,t);const n=e.headers.get("content-type")??"";if(!n.includes("application/json")){const i=n.split(";",1)[0]||tn("api.missingContentType");throw new Error(tn("api.nonJson",{fallback:t,status:e.status,contentType:i}))}return e.json()}function x2t(e){return Array.isArray(e)?e.map(t=>{const n=kd(t,tn("api.activity")),i=n.kind,r=n.status;if(typeof n.id!="string"||!["status","thinking","message","tool"].includes(String(i))||!["running","done"].includes(String(r)))throw new Error(tn("api.invalidActivity"));if(i==="tool"){if(typeof n.name!="string")throw new Error(tn("api.invalidToolActivity"));return{id:n.id,kind:i,status:r,name:n.name,...n.input!==void 0?{args:n.input}:{},...n.output!==void 0?{response:n.output}:{}}}if(typeof n.text!="string")throw new Error(tn("api.invalidTextActivity"));return{id:n.id,kind:i,status:r,text:n.text}}):[]}function w2t(e){if(e==null)return;const t=kd(e,tn("api.publication"));if(typeof t.revision!="number"||typeof t.skillId!="string"||typeof t.version!="string"||!Array.isArray(t.skillSpaceIds)||!t.skillSpaceIds.every(n=>typeof n=="string")||t.disposition!=="create-new"&&t.disposition!=="update-source"||!CD(t.region)||typeof t.projectName!="string")throw new Error(tn("api.invalidFormat",{label:tn("api.publication")}));return{revision:t.revision,skillId:t.skillId,version:t.version,skillSpaceIds:t.skillSpaceIds,disposition:t.disposition,region:t.region,projectName:t.projectName}}function kC(e){const t=kd(e,tn("api.task"));if(typeof t.jobId!="string"||t.operation!=="create"&&t.operation!=="optimize"||typeof t.intent!="string"||typeof t.revision!="number"||typeof t.state!="string")throw new Error(tn("api.invalidFormat",{label:tn("api.task")}));const n=Array.isArray(t.files)?t.files.flatMap(l=>{const c=kd(l,tn("api.file"));return typeof c.path=="string"&&typeof c.size=="number"?[{path:c.path,size:c.size}]:[]}):[];if(!["running","ready","failed","cancelled","expired","published"].includes(t.state))throw new Error(tn("api.unknownTaskState"));const r=Tne(t.toolId,"Tool ID"),s=Tne(t.sessionId,"Session ID"),o=v2t(t.recoveryStatus);return{jobId:t.jobId,operation:t.operation,intent:t.intent,...typeof t.model=="string"?{model:t.model}:{},...typeof t.style=="string"?{style:t.style}:{},...typeof t.requestedName=="string"?{requestedName:t.requestedName}:{},revision:t.revision,...r?{toolId:r}:{},...s?{sessionId:s}:{},...typeof t.sessionTtlSeconds=="number"?{sessionTtlSeconds:t.sessionTtlSeconds}:{},...typeof t.expiresAt=="string"?{expiresAt:t.expiresAt}:{},...typeof t.recoveryAvailable=="boolean"?{recoveryAvailable:t.recoveryAvailable}:{},...o?{recoveryStatus:o}:{},...typeof t.recoveredFromSnapshot=="boolean"?{recoveredFromSnapshot:t.recoveredFromSnapshot}:{},state:t.state,stage:typeof t.stage=="string"?t.stage:"generating",activities:x2t(t.activities),files:n,...t.source&&typeof t.source=="object"?{source:t.source}:{},...typeof t.name=="string"?{name:t.name}:{},...typeof t.description=="string"?{description:t.description}:{},...typeof t.skillMd=="string"?{skillMd:t.skillMd}:{},...typeof t.error=="string"?{error:t.error}:{},...t.validation&&typeof t.validation=="object"?{validation:t.validation}:{},...t.publication?{publication:w2t(t.publication)}:{}}}async function jM(e){const t=kd(await db(await kh("/capabilities",{signal:e}),tn("api.loadCapability")),tn("api.capability"));return{enabled:t.enabled===!0,reason:typeof t.reason=="string"?t.reason:"",operations:Array.isArray(t.operations)?t.operations.filter(n=>n==="create"||n==="optimize"):[],models:Array.isArray(t.models)?t.models.flatMap(n=>{if(!n||typeof n!="object")return[];const i=n;return typeof i.id=="string"&&typeof i.label=="string"?[{id:i.id,label:i.label}]:[]}):[],styles:t.styles&&typeof t.styles=="object"&&!Array.isArray(t.styles)?Object.fromEntries(Object.entries(t.styles).filter(n=>typeof n[1]=="string")):{},...typeof t.maxUploadBytes=="number"?{maxUploadBytes:t.maxUploadBytes}:{}}}async function O2t(e){if(e.file){const n=new URLSearchParams({operation:"optimize",intent:e.intent});e.jobId&&n.set("job_id",e.jobId),e.model&&n.set("model",e.model),e.style&&n.set("style",e.style),e.name&&n.set("name",e.name);const i=await kh(`/tasks/from-upload?${n}`,{method:"POST",body:e.file,headers:{"Content-Type":"application/zip"},signal:e.signal},mr);return kC(await db(i,tn("api.startOptimization")))}const t=await kh("/tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operation:e.operation,intent:e.intent,...e.model?{model:e.model}:{},...e.style?{style:e.style}:{},...e.name?{name:e.name}:{},...e.jobId?{jobId:e.jobId}:{},...e.source?{source:{kind:"skill-center",skillId:e.source.skillId,skillName:e.source.name,version:e.source.version,region:e.source.region,projectName:e.source.projectName,skillSpaceId:e.source.skillSpaceId,skillSpaceName:e.source.skillSpaceName}}:{}}),signal:e.signal},mr);return kC(await db(t,tn("api.startTask")))}async function k2t(e,t){return kC(await db(await kh(`/tasks/${encodeURIComponent(e)}`,{signal:t}),tn("api.loadTask")))}async function D4(e,t,n){const i=new URLSearchParams;i.set("expected_revision",String(t));const r=kd(await db(await kh(`/tasks/${encodeURIComponent(e)}/artifact?${i.toString()}`,{signal:n}),tn("api.loadArtifact")),tn("api.artifact"));if(r.jobId!==e||r.revision!==t||!Number.isSafeInteger(r.revision)||r.revision<1||typeof r.sha256!="string"||!/^[0-9a-f]{64}$/.test(r.sha256)||typeof r.name!="string"||typeof r.description!="string"||!Array.isArray(r.files))throw new Error(tn("api.invalidFormat",{label:tn("api.artifact")}));const s=r.files.map(o=>{const l=kd(o,tn("api.artifactFile"));if(typeof l.path!="string"||typeof l.size!="number"||typeof l.content!="string")throw new Error(tn("api.invalidFormat",{label:tn("api.artifactFile")}));return{path:l.path,size:l.size,content:l.content}});return{jobId:r.jobId,revision:r.revision,sha256:r.sha256,name:r.name,description:r.description,files:s}}async function M4(e){const t=await kh(`/tasks/${encodeURIComponent(e.jobId)}/refinements`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({intent:e.intent,expectedRevision:e.expectedRevision})},mr);return kC(await db(t,tn("api.refine")))}async function S2t(e){const t=await kh(`/tasks/${encodeURIComponent(e.jobId)}/stop`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expectedRevision:e.expectedRevision})});return kC(await db(t,tn("api.stop")))}async function E2t(e){const t=await kh(`/tasks/${encodeURIComponent(e.jobId)}/publish-stream`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/x-ndjson"},body:JSON.stringify({disposition:e.disposition,expectedRevision:e.expectedRevision,expectedArtifactSha256:e.expectedArtifactSha256,skillSpaceIds:e.skillSpaceIds??[],projectName:e.projectName,region:e.region}),signal:e.signal},0);if(!t.ok)throw await oq(t,tn("api.publish"));if(!(t.headers.get("content-type")??"").includes("application/x-ndjson"))throw new Error(tn("api.nonNdjson"));if(!t.body)throw new Error(tn("api.missingStream"));const i=new Set(["preparing","uploading","registering","activating","publishing"]);let r=null,s="";const o=new TextDecoder,l=t.body.getReader(),c=u=>{var h;if(!u.trim())return;const d=kd(JSON.parse(u),tn("api.publishProgress"));if(d.type==="progress"){if(typeof d.phase!="string"||!i.has(d.phase)||typeof d.message!="string")throw new Error(tn("api.invalidPublishProgress"));(h=e.onProgress)==null||h.call(e,{phase:d.phase,message:d.message});return}if(d.type==="error"){const m=kd(d.error,tn("api.publishError"));throw new c9(typeof m.message=="string"?m.message:tn("api.publish"),500,typeof m.code=="string"?m.code:"SKILL_PUBLISH_FAILED",m.retryable===!0,"",m.originalError&&typeof m.originalError=="object"?m.originalError:void 0,JSON.stringify(d.error))}if(d.type!=="complete")throw new Error(tn("api.unknownPublishEvent"));const f=kd(d.result,tn("api.publishResult"));if(typeof f.skillId!="string"||typeof f.version!="string"||!Array.isArray(f.skillSpaceIds)||!f.skillSpaceIds.every(m=>typeof m=="string")||f.disposition!=="create-new"&&f.disposition!=="update-source"||!CD(f.region)||typeof f.projectName!="string")throw new Error(tn("api.invalidFormat",{label:tn("api.publishResult")}));r={skillId:f.skillId,version:f.version,skillSpaceIds:f.skillSpaceIds,disposition:f.disposition,region:f.region,projectName:f.projectName}};for(;;){const{value:u,done:d}=await l.read();s+=o.decode(u,{stream:!d});const f=s.split(` -`);if(s=f.pop()??"",f.forEach(c),d)break}if(c(s),!r)throw new Error(tn("api.streamEnded"));return r}async function C2t(e){await db(await kh(`/tasks/${encodeURIComponent(e)}`,{method:"DELETE"}),tn("api.deleteTask"))}async function A2t(e,t,n){var c;const i=new URLSearchParams;i.set("expected_revision",String(t)),i.set("expected_sha256",n);const r=await kh(`/tasks/${encodeURIComponent(e)}/download?${i.toString()}`,{},mr);if(!r.ok)throw await oq(r,tn("api.download"));const o=((c=(r.headers.get("content-disposition")??"").match(/filename="([^"]+)"/))==null?void 0:c[1])??"skill.zip",l=URL.createObjectURL(await r.blob());try{const u=document.createElement("a");u.href=l,u.download=o,u.click()}finally{URL.revokeObjectURL(l)}}const iLe=p.createContext(void 0);function Y0(e){const t=p.useContext(iLe);if(t===void 0&&!e)throw new Error(Vc(47));return t}const T2t={...mje,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class _2t extends FD{constructor(n,i,r){const s=new cV;super(j2t(n,s,i,r),N2t(s),T2t);Zt(this,"setOpen",(n,i)=>{var f,h;const r=i.reason===pu,s=i.reason===Gw&&i.event.detail===0,o=!n&&(i.reason===T_e||i.reason==null),l=sst(i),c=this.select("activeTriggerId");if(!n&&i.reason===A_e&&i.trigger==null&&c!=null&&(i.trigger=this.context.triggerElements.getById(c)??this.select("activeTriggerElement")??void 0),(h=(f=this.context).onOpenChange)==null||h.call(f,n,i),i.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,i);const u=()=>{const m={open:n,openChangeReason:i.reason};aje(m,n,i.trigger,l()),this.update(m)};r?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(Iit,()=>{this.set("stickIfOpen",!1)}),vi.flushSync(u)):u();let d;s?d="click":o?d="dismiss":i.reason===rC&&(d="focus"),this.set("instantType",d)})}}function j2t(e,t,n,i=!1){const r={...fje(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return r.open&&(e==null?void 0:e.mounted)===void 0&&(r.mounted=!0),r.floatingRootContext=hje(t,n,i),r}function N2t(e){return{popupRef:p.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:p.createRef(),beforeContentFocusGuardRef:p.createRef(),stickIfOpenTimeout:new Mu,triggerElements:e}}function _ne({props:e}){const{children:t,open:n,defaultOpen:i=!1,onOpenChange:r,onOpenChangeComplete:s,modal:o=!1,handle:l,triggerId:c,defaultTriggerId:u=null}=e,d=I2t(l,{modal:o,open:i,openProp:n,activeTriggerId:u,triggerIdProp:c});d.useControlledProp("openProp",n),d.useControlledProp("triggerIdProp",c);const f=d.useState("open"),h=d.useState("mounted"),m=d.useState("payload");d.useContextCallback("onOpenChange",r),d.useContextCallback("onOpenChangeComplete",s),dje(d,f),lje(d);const{forceUnmount:g}=cje(f,d,()=>{d.update({stickIfOpen:!0,openChangeReason:null})});d.useSyncedValues({modal:o}),p.useEffect(()=>{f||d.context.stickIfOpenTimeout.clear()},[d,f]),p.useImperativeHandle(e.actionsRef,()=>({unmount:g,close:()=>d.setOpen(!1,ha(__e))}),[g,d]);const b=f||h;return a.jsxs(iLe.Provider,{value:d,children:[l&&a.jsx(sje,{handle:l,store:d}),b&&a.jsx(P2t,{store:d,modal:o}),typeof t=="function"?t({payload:m}):t]})}function R2t(e){return Y0(!0)?a.jsx(_ne,{props:e}):a.jsx(frt,{children:a.jsx(_ne,{props:e})})}function I2t(e,t){const n=rje((i,r)=>new _2t(t,i,r));return p.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function P2t({store:e,modal:t}){const n=e.useState("floatingRootContext"),i=U_e(n,{outsidePressEvent:{mouse:t==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),r=i.reference,s=i.floating;return uje(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:s}),null}const D2t=300;function nm(e){return FA(e,"base-ui")}function M2t(e,t){const n=p.useRef(null);function i(s){vi.flushSync(()=>{e.setOpen(!1,ha(rC,s.nativeEvent,s.currentTarget))});const o=cit(n.current);o==null||o.focus()}function r(s){var l;const o=e.select("positionerElement");if(o&&nw(s,o))(l=e.context.beforeContentFocusGuardRef.current)==null||l.focus();else{vi.flushSync(()=>{e.setOpen(!1,ha(rC,s.nativeEvent,s.currentTarget))});let c=lit(e.context.triggerFocusTargetRef.current||t.current);for(;c!==null&&ii(o,c);){const u=c;if(c=Jz(c),c===u)break}c==null||c.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:i,handleFocusTargetFocus:r}}function L2t(e){const t=p.useRef(""),n=p.useCallback(r=>{r.defaultPrevented||(t.current=r.pointerType,e(r,r.pointerType))},[e]);return{onClick:p.useCallback(r=>{if(r.detail===0){e(r,"keyboard");return}"pointerType"in r?e(r,r.pointerType):e(r,t.current),t.current=""},[e]),onPointerDown:n}}function rLe(e,t){const n=li((s,o)=>{(typeof e=="function"?e():e)||t(o||(VD?"touch":""))}),{onClick:i,onPointerDown:r}=L2t(n);return p.useMemo(()=>({onClick:i,onPointerDown:r}),[i,r])}const $2t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,disabled:o=!1,nativeButton:l=!0,handle:c,payload:u,openOnHover:d=!1,delay:f=D2t,closeDelay:h=0,id:m,...g}=t,b=Y0(!0),y=gje(c)??b;if(!y)throw new Error(Vc(74));const w=nm(m),x=y.useState("isTriggerActive",w),O=y.useState("floatingRootContext"),k=y.useState("isOpenedByTrigger",w),S=y.useState("triggerPopupId",w),C=p.useRef(null),{registerTrigger:E,isMountedByThisTrigger:j}=oje(w,C,y,{payload:u,disabled:o,openOnHover:d,closeDelay:h}),T=y.useState("openChangeReason"),R=y.useState("stickIfOpen"),A=y.useState("openMethod"),N=y.useState("focusManagerModal"),P=fst(O,{enabled:!o&&d&&(A!=="touch"||T!==Gw),mouseOnly:!0,move:!1,handleClose:mst(),restMs:f,delay:{close:h},triggerElementRef:C,isActiveTrigger:x,isClosing:()=>y.select("transitionStatus")==="ending"}),I=B_e(O,{stickIfOpen:R}),D=rLe(()=>y.select("open"),ne=>{y.set("openMethod",ne)}),_=y.useState("triggerProps",j),{getButtonProps:L,buttonRef:F}=KD({disabled:o,native:l}),M={open(ne){return ne&&T===Gw?_st.open(ne):xje.open(ne)}},{preFocusGuardRef:z,handlePreFocusGuardFocus:q,handleFocusTargetFocus:U}=M2t(y,C),V=Pa("button",t,{state:{disabled:o,open:k},ref:[F,n,E,C],props:[I.reference,P,_,D,{[sV]:"",id:w,"aria-haspopup":"dialog","aria-expanded":k,"aria-controls":S},g,L],stateAttributesMapping:M}),Z=a.jsx(p.Fragment,{children:V},w);return j&&!N?a.jsxs(p.Fragment,{children:[a.jsx(c0,{ref:z,onFocus:q}),Z,a.jsx(c0,{ref:y.context.triggerFocusTargetRef,onFocus:U})]}):Z}),sLe=p.createContext(void 0);function F2t(){const e=p.useContext(sLe);if(e===void 0)throw new Error(Vc(45));return e}const B2t=p.forwardRef(function(t,n){const{keepMounted:i=!1,...r}=t;return Y0().useState("mounted")||i?a.jsx(sLe.Provider,{value:i,children:a.jsx(I_e,{ref:n,...r})}):null}),aLe=p.createContext(void 0);function U2t(){const e=p.useContext(aLe);if(!e)throw new Error(Vc(46));return e}const oLe=p.forwardRef(function(t,n){const{cutout:i,...r}=t;let s;if(i){const o=i.getBoundingClientRect();s=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${o.left}px ${o.top}px,${o.left}px ${o.bottom}px,${o.right}px ${o.bottom}px,${o.right}px ${o.top}px,${o.left}px ${o.top}px)`}return a.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...r,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});let jne={},Nne={},Rne="";function NM(e,t){return MA(e)?e:t}function Ine(e,t,n){return/hidden|clip/.test(e.getComputedStyle(NM(t,n)).overflowY)}function Q2t(e){if(typeof document>"u")return!1;const t=Sr(e);return na(t).innerWidth-t.documentElement.clientWidth>0}function z2t(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Sr(e),i=n.documentElement,r=n.body,s=NM(i,r),o=s.style.overflowY,l=i.style.scrollbarGutter;i.style.scrollbarGutter="stable",s.style.overflowY="scroll";const c=s.offsetWidth;s.style.overflowY="hidden";const u=s.offsetWidth;return s.style.overflowY=o,i.style.scrollbarGutter=l,c===u}function V2t(e){const t=Sr(e),n=t.documentElement,i=t.body,r=NM(n,i),s={overflowY:r.style.overflowY,overflowX:r.style.overflowX};return Object.assign(r.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(r.style,s)}}function H2t(e){var m;const t=Sr(e),n=t.documentElement,i=t.body,r=na(n);let s=0,o=0,l=!1;const c=_c.create();if(U1&&(((m=r.visualViewport)==null?void 0:m.scale)??1)!==1)return()=>{};function u(){const g=r.getComputedStyle(n),b=r.getComputedStyle(i),w=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,o=n.scrollLeft,jne={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Rne=n.style.scrollBehavior,Nne={position:i.style.position,height:i.style.height,width:i.style.width,boxSizing:i.style.boxSizing,overflowY:i.style.overflowY,overflowX:i.style.overflowX,scrollBehavior:i.style.scrollBehavior};const x=n.scrollHeight>n.clientHeight,O=n.scrollWidth>n.clientWidth,k=g.overflowY==="scroll"||b.overflowY==="scroll",S=g.overflowX==="scroll"||b.overflowX==="scroll",C=Math.max(0,r.innerWidth-i.clientWidth),E=Math.max(0,r.innerHeight-i.clientHeight),j=parseFloat(b.marginTop)+parseFloat(b.marginBottom),T=parseFloat(b.marginLeft)+parseFloat(b.marginRight),R=NM(n,i);if(l=z2t(e),l){n.style.scrollbarGutter=w,R.style.overflowY="hidden",R.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:w,overflowY:"hidden",overflowX:"hidden"}),(x||k)&&(n.style.overflowY="scroll"),(O||S)&&(n.style.overflowX="scroll"),Object.assign(i.style,{position:"relative",height:j||E?`calc(100dvh - ${j+E}px)`:"100dvh",width:T||C?`calc(100vw - ${T+C}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),i.scrollTop=s,i.scrollLeft=o,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function d(){Object.assign(n.style,jne),Object.assign(i.style,Nne),l||(n.scrollTop=s,n.scrollLeft=o,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=Rne)}function f(){d(),c.request(u)}u();const h=Ni(r,"resize",f);return()=>{c.cancel(),d(),typeof r.removeEventListener=="function"&&h()}}class q2t{constructor(){Zt(this,"lockCount",0);Zt(this,"restore",null);Zt(this,"timeoutLock",Mu.create());Zt(this,"timeoutUnlock",Mu.create());Zt(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});Zt(this,"unlock",()=>{var t;this.lockCount===0&&this.restore&&((t=this.restore)==null||t.call(this),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const n=Sr(t),i=n.documentElement,r=n.body,s=na(i);if(Ine(s,i,r)){const l=new s.MutationObserver(()=>{Ine(s,i,r)||(l.disconnect(),this.restore=null,this.lock(t))}),c={attributes:!0};l.observe(i,c),l.observe(r,c),this.restore=()=>l.disconnect();return}const o=VD||!Q2t(t);this.restore=o?V2t(t):H2t(t)}}const W2t=new q2t;function lLe(e=!0,t=null){Jn(()=>{if(e)return W2t.acquire(t)},[e,t])}const K2t=20;function G2t(e,t,n,i){const[r,s]=p.useState(!1);Jn(()=>{if(!e||!t||n==null){s(!1);return}const o=Sr(n).documentElement.clientWidth,l=n.offsetWidth;s(o>0&&l>0&&l>=o-K2t)},[e,t,n]),lLe(e&&(!t||r),i)}const X2t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,anchor:o,positionMethod:l,side:c,align:u,sideOffset:d,alignOffset:f,collisionBoundary:h="clipping-ancestors",collisionPadding:m,arrowPadding:g,sticky:b,disableAnchorTracking:v=!1,collisionAvoidance:y=Fit,...w}=t,x=Y0(),O=F2t(),k=urt(),S=x.useState("floatingRootContext"),C=x.useState("mounted"),E=x.useState("open"),j=x.useState("openChangeReason"),T=x.useState("activeTriggerElement"),R=x.useState("modal"),A=x.useState("openMethod"),N=x.useState("positionerElement"),P=x.useState("instantType"),I=x.useState("transitionStatus"),D=x.useState("adaptiveOrigin"),_=p.useRef(null),L=rV(N),F=Ost({anchor:o,floatingRootContext:S,positionMethod:l,mounted:C,side:c,sideOffset:d,align:u,alignOffset:f,arrowPadding:g,collisionBoundary:h,collisionPadding:m,sticky:b,disableAnchorTracking:v,keepMounted:O,nodeId:k,collisionAvoidance:y,adaptiveOrigin:D}),M=S.useState("domReferenceElement");Jn(()=>{const V=M,Z=_.current;if(V&&(_.current=V),Z&&V&&V!==Z){x.set("instantType",void 0);const ne=new AbortController;return L(()=>{x.set("instantType","trigger-change")},ne.signal),()=>{ne.abort()}}},[M,L,x]);const z=R===!0&&j!==pu;G2t(E&&z,A==="touch",N,T);const q=x.useStateSetter("positionerElement"),U={open:E,side:F.side,align:F.align,anchorHidden:F.anchorHidden,instant:P},J=jst(t,U,{styles:F.positionerStyles,transitionStatus:I,props:w,refs:[n,q],hidden:!C,inert:!E});return a.jsxs(aLe.Provider,{value:F,children:[C&&z&&a.jsx(oLe,{inert:iV(!E),cutout:T}),a.jsx(drt,{id:k,children:J})]})}),Y2t="ArrowUp",Z2t="ArrowDown",J2t="ArrowLeft",e_t="ArrowRight",t_t="Home",n_t="End",cLe=new Set([Y2t,Z2t,J2t,e_t,t_t,n_t]),i_t=p.createContext(void 0);function r_t(e){return p.useContext(i_t)}const s_t=p.createContext(void 0);function a_t(){const[e,t]=p.useState(0),n=li(()=>(t(r=>r+1),()=>{t(r=>Math.max(0,r-1))}));return{context:p.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}const o_t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,initialFocus:o,finalFocus:l,...c}=t,u=Y0(),d=U2t(),f=r_t()!=null,{context:h,hasClosePart:m}=a_t(),g=u.useState("open"),b=u.useState("openMethod"),v=u.useState("instantType"),y=u.useState("transitionStatus"),w=u.useState("popupProps"),x=u.useState("titleElementId"),O=u.useState("descriptionElementId"),k=u.useState("modal"),S=u.useState("mounted"),C=u.useState("openChangeReason"),E=u.useState("activeTriggerElement"),j=u.useState("floatingRootContext"),T=j.useState("floatingId"),R=u.useState("disabled"),A=u.useState("openOnHover"),N=u.useState("closeDelay");$A({open:g,ref:u.context.popupRef,onComplete(){var F,M;g&&((M=(F=u.context).onOpenChangeComplete)==null||M.call(F,!0))}}),ust(j,{enabled:A&&!R,closeDelay:N});const P=o===void 0?ije(u.context.popupRef):o,I=k!==!1&&m;u.useSyncedValue("focusManagerModal",I);const D=u.useStateSetter("popupElement"),_={open:g,side:d.side,align:d.align,instant:v,transitionStatus:y},L=Pa("div",t,{state:_,ref:[n,u.context.popupRef,D],props:[w,{id:T,role:"dialog",...nje,"aria-labelledby":x,"aria-describedby":O,onKeyDown(F){f&&cLe.has(F.key)&&F.stopPropagation()}},Oje(y),c],stateAttributesMapping:wje});return a.jsx(F_e,{context:j,openInteractionType:b,modal:I,disabled:!S||C===pu,initialFocus:P,returnFocus:l,restoreFocus:"popup",previousFocusableElement:ea(E)?E:void 0,nextFocusableElement:u.context.triggerFocusTargetRef,beforeContentFocusGuardRef:u.context.beforeContentFocusGuardRef,children:a.jsx(s_t.Provider,{value:h,children:L})})}),l_t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...o}=t,l=Y0(),c=nm(o.id);return l.useSyncedValueWithCleanup("titleElementId",c),Pa("h2",t,{ref:n,props:[{id:c},o]})}),c_t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...o}=t,l=Y0(),c=nm(o.id);return l.useSyncedValueWithCleanup("descriptionElementId",c),Pa("p",t,{ref:n,props:[{id:c},o]})});function Pne(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"10.25",cy:"10.25",r:"6.25"}),a.jsx("path",{d:"M4.15 10.25h12.2M10.25 4c1.65 1.72 2.5 3.8 2.5 6.25s-.85 4.53-2.5 6.25M10.25 4c-1.65 1.72-2.5 3.8-2.5 6.25s.85 4.53 2.5 6.25M14.8 14.8 20 20"})]})}function u_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.25",y:"5.25",width:"15.5",height:"13.5",rx:"2.25"}),a.jsx("circle",{cx:"8.1",cy:"9.3",r:"1.35"}),a.jsx("path",{d:"m4.7 16.5 3.65-3.7 2.45 2.25 2.2-2.2 4.35 4.1"}),a.jsx("path",{d:"m19.4 2.75.48 1.37 1.37.48-1.37.48-.48 1.37-.48-1.37-1.37-.48 1.37-.48.48-1.37Z",fill:"currentColor",stroke:"none"})]})}function lq(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{className:"video-generate-icon__body",d:"M3.25 9h17.5v7.35a2.4 2.4 0 0 1-2.4 2.4H5.65a2.4 2.4 0 0 1-2.4-2.4V9Z"}),a.jsxs("g",{className:"video-generate-icon__clapper",children:[a.jsx("path",{d:"M3.25 9V7.65a2.4 2.4 0 0 1 2.4-2.4h12.7a2.4 2.4 0 0 1 2.4 2.4V9H3.25Z"}),a.jsx("path",{d:"M6.75 5.25 9.3 9M12 5.25 14.55 9M17.25 5.25 19.8 9"})]}),a.jsx("path",{d:"m10.25 11.45 4 2.55-4 2.55v-5.1Z"})]})}function d_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M4.25 5.25h15.5v10.5H4.25zM8.25 19.75h7.5M12 15.75v4"}),a.jsx("path",{d:"m7.25 12.75 2.35-2.4 2.15 1.65 3.4-3.6 1.6 1.55"}),a.jsx("circle",{cx:"7.25",cy:"8.4",r:".7",fill:"currentColor",stroke:"none"})]})}function f_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5 7.4c0-1.55 3.13-2.8 7-2.8s7 1.25 7 2.8-3.13 2.8-7 2.8-7-1.25-7-2.8Z"}),a.jsx("path",{d:"M5 7.4v4.55c0 1.55 3.13 2.8 7 2.8s7-1.25 7-2.8V7.4M5 11.95v4.55c0 1.55 3.13 2.8 7 2.8s7-1.25 7-2.8v-4.55"}),a.jsx("path",{d:"M8.2 12.25h.01M8.2 16.8h.01"})]})}function h_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M4.25 4.25h4.5v15.5h-4.5zM8.75 5.75h5v14h-5zM13.75 4.25h4.1v10.25h-4.1z"}),a.jsx("path",{d:"M5.75 7h1.5M10.25 8.25h2M10.25 11h2M15.15 7h1.3"}),a.jsx("circle",{cx:"17.45",cy:"17.35",r:"2.45"}),a.jsx("path",{d:"m19.25 19.15 1.55 1.55"})]})}function p_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M4.25 6.25h6.25c1 0 1.5.55 1.5 1.45v11.05c0-.9-.5-1.45-1.5-1.45H4.25V6.25Z"}),a.jsx("path",{d:"M19.75 9.1v8.2H13.5c-1 0-1.5.55-1.5 1.45V7.7c0-.9.5-1.45 1.5-1.45h2.15"}),a.jsx("path",{d:"m19 3.2.58 1.62 1.62.58-1.62.58L19 7.6l-.58-1.62-1.62-.58 1.62-.58L19 3.2Z",fill:"currentColor",stroke:"none"})]})}function m_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"m4.2 8.4 1.15 10.2h13.3L19.8 8.4"}),a.jsx("path",{d:"M4.2 8.4h15.6L17.9 5H6.1L4.2 8.4Z"}),a.jsx("path",{d:"M7.2 12.2c1.1-1 2.25 1.25 3.4.25 1.05-.9 2.15 1.3 3.3.25"}),a.jsx("path",{d:"m8.2 15.1 1.45 1.35 1.45-1.35M13.55 16.45h2.35"})]})}function g_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"6",cy:"6.25",r:"2.25"}),a.jsx("circle",{cx:"18",cy:"6.25",r:"2.25"}),a.jsx("circle",{cx:"12",cy:"17.75",r:"2.25"}),a.jsx("path",{d:"m7.7 7.75 2.7 7.55M16.3 7.75l-2.7 7.55M8.25 6.25h7.5"})]})}function Dne(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"9",cy:"8",r:"3"}),a.jsx("path",{d:"M3.75 18.75c.45-3.05 2.2-4.65 5.25-4.65s4.8 1.6 5.25 4.65"}),a.jsx("path",{d:"M17.75 4.25v5.5M15 7h5.5M16 13.25h4.25M18.125 11.125v4.25"})]})}function b_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"4",y:"4.25",width:"16",height:"5",rx:"1.5"}),a.jsx("rect",{x:"4",y:"14.75",width:"16",height:"5",rx:"1.5"}),a.jsx("path",{d:"M7.25 6.75h.01M7.25 17.25h.01M10 6.75h6.5M10 17.25h6.5"})]})}function y_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3.75h8l4 4v12.5H6V3.75Z"}),a.jsx("path",{d:"M14 3.75v4h4M8.75 11h6.5M8.75 14.25h6.5M8.75 17.5h4"})]})}function Mne(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.75",y:"4.5",width:"16.5",height:"15",rx:"2.5"}),a.jsx("path",{d:"m7.5 9 2.75 2.5L7.5 14M12.5 14h4"}),a.jsx("path",{d:"M3.75 7.5h16.5",opacity:".62"})]})}function rO(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m6 3.25 4.5 4.75L6 12.75"})})}function v_t({value:e}){const{t,i18n:n}=Te("adk"),[i,r]=p.useState(!1),s=f=>f==null?t("developmentRuns.notReported"):f.toLocaleString(n.resolvedLanguage||n.language),o=z2e,l=e.usage,c=(l==null?void 0:l.inputTokens)!=null&&l.cachedInputTokens!=null&&l.cachedInputTokens<=l.inputTokens?l.inputTokens-l.cachedInputTokens:void 0,u=l!=null&&l.inputTokens&&l.cachedInputTokens!=null&&c!=null?`${(l.cachedInputTokens/l.inputTokens*100).toFixed(1)}%`:void 0,d=[["inputTokens",l==null?void 0:l.inputTokens],["cachedInputTokens",l==null?void 0:l.cachedInputTokens],["uncachedInputTokens",c],["cacheWriteInputTokens",l==null?void 0:l.cacheWriteInputTokens],["outputTokens",l==null?void 0:l.outputTokens],["reasoningOutputTokens",l==null?void 0:l.reasoningOutputTokens]];return a.jsxs("div",{className:"development-turn-summary","data-turn-id":e.turnId,children:[a.jsx("span",{children:t(`developmentRuns.turnStatus.${e.status}`)}),a.jsx("span",{children:t("developmentRuns.toolCalls",{count:e.toolCalls})}),a.jsx("span",{children:t("developmentRuns.turnDuration",{duration:o(e.durationMs)})}),a.jsx("span",{title:t("developmentRuns.toolDurationHelp"),children:t(e.toolDurationComplete?"developmentRuns.toolDuration":"developmentRuns.toolDurationPartial",{duration:o(e.toolDurationMs)})}),a.jsxs(R2t,{open:i,onOpenChange:r,children:[a.jsxs($2t,{className:"development-token-trigger",openOnHover:!0,delay:150,closeDelay:150,onFocus:f=>{f.currentTarget.matches(":focus-visible")&&r(!0)},children:[a.jsx("span",{children:"Tokens"}),a.jsx("span",{className:"development-token-value",children:s(l==null?void 0:l.totalTokens)}),e.usageIncomplete&&a.jsxs("span",{children:["· ",t("developmentRuns.partial")]}),a.jsx(rO,{className:"development-token-chevron"})]}),a.jsx(B2t,{children:a.jsx(X2t,{side:"top",align:"end",sideOffset:8,className:"development-token-positioner",children:a.jsxs(o_t,{className:"development-token-popup",initialFocus:!1,finalFocus:!1,children:[a.jsx(l_t,{className:"development-token-title",children:t("developmentRuns.tokenDetails")}),a.jsxs("dl",{children:[a.jsxs("div",{children:[a.jsx("dt",{children:t("developmentRuns.model")}),a.jsx("dd",{children:e.model||t("developmentRuns.notReported")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:t("developmentRuns.totalTokens")}),a.jsx("dd",{children:s(l==null?void 0:l.totalTokens)})]}),d.map(([f,h])=>a.jsxs("div",{children:[a.jsx("dt",{children:t(`developmentRuns.${f}`)}),a.jsx("dd",{children:s(h)})]},f)),a.jsxs("div",{children:[a.jsx("dt",{children:t("developmentRuns.cacheHitRate")}),a.jsx("dd",{children:u||t("developmentRuns.notReported")})]})]}),a.jsxs(c_t,{className:"development-token-note",children:[t("developmentRuns.tokenHelp"),e.usageIncomplete?` ${t("developmentRuns.partialHelp")}`:""]})]})})})]})]})}function cq(e){return a.jsx("svg",{viewBox:"0 0 111 117",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M0 5.6016C7.82288e-05 0.621244 6.02226 -1.87314 9.54395 1.64847L40.1289 32.2334L68.5732 3.7891C69.5834 2.77903 70.9533 2.21099 72.3818 2.21097H82.7031C82.7917 2.20658 82.8806 2.20414 82.9697 2.20414H104.775C109.574 2.20427 111.977 8.00691 108.584 11.4004L64.916 55.0664C64.3075 55.8528 63.9436 56.7647 63.8242 57.6993C63.7142 56.4884 63.1964 55.3069 62.2695 54.3799L45.4082 37.5186H45.4072L40.124 32.2354L17.832 54.5284C16.7671 55.5933 16.2416 56.993 16.2549 58.3887C16.2417 59.7843 16.7672 61.1842 17.832 62.2491L39.9287 84.3467L9.54395 114.733C6.0223 118.255 0.000223474 115.761 0 110.78V5.6016ZM63.8018 58.8702C63.8962 59.9086 64.2936 60.9229 64.9961 61.7735L108.591 105.368C111.984 108.762 109.58 114.564 104.781 114.564H94.4336C94.3543 114.568 94.274 114.569 94.1934 114.569H72.3877C70.9592 114.569 69.5892 114.002 68.5791 112.992L39.9336 84.3467L58.4531 65.8282L58.4453 65.8203L62.2695 61.9981C63.1476 61.12 63.6567 60.0136 63.8018 58.8702Z",fill:"currentColor"})})}function RM({kind:e,...t}){return e==="thinking"?a.jsx(cq,{...t}):a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:e==="tool"?a.jsxs(a.Fragment,{children:[a.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"3"}),a.jsx("path",{d:"m7 9 3 3-3 3m6 0h4"})]}):e==="plan"?a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"m4 7 1.5 1.5L8 6m-4 7 1.5 1.5L8 12M11 7h9m-9 6h9m-9 6h9"}),a.jsx("circle",{cx:"6",cy:"19",r:"1"})]}):a.jsx(a.Fragment,{children:a.jsx("path",{d:"M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9zM14 3v6h6M8 13h8m-4-3v6M8 18h8"})})})}function x_t({blocks:e,active:t,status:n,render:i}){const{t:r}=Te("adk"),[s,o]=p.useState(!1),l=[...e].reverse().find(h=>"done"in h&&!h.done),c=e.filter(h=>h.kind==="tool"),u=c.filter(h=>h.durationMs!=null),d=u.reduce((h,m)=>h+(m.durationMs||0),0);let f=r("developmentRuns.processSummary",{count:e.length});return t&&(f=n||((l==null?void 0:l.kind)==="thinking"?r("developmentRuns.thinking"):(l==null?void 0:l.kind)==="tool"?V2e(l):(l==null?void 0:l.kind)==="plan"?r("developmentRuns.plan"):(l==null?void 0:l.kind)==="diff"?r("developmentRuns.diff"):r("developmentRuns.processing"))),a.jsxs("section",{className:"development-process",children:[a.jsxs("button",{type:"button",className:"development-process__toggle","aria-expanded":s,onClick:()=>o(!s),children:[a.jsx(rO,{className:`tool-chevron${s?" is-open":""}`}),a.jsx("span",{className:"tool-icon",children:a.jsx(RM,{kind:(l==null?void 0:l.kind)==="thinking"||(l==null?void 0:l.kind)==="plan"||(l==null?void 0:l.kind)==="diff"?l.kind:"tool"})}),t?a.jsx(hn,{className:"development-process__title","aria-live":"polite",children:f}):a.jsx("span",{className:"development-process__title",children:f}),!t&&c.length>0&&a.jsxs("span",{className:"development-process__duration",children:[r("developmentRuns.toolCalls",{count:c.length}),u.length>0?` · ${r(u.length===c.length?"developmentRuns.toolDuration":"developmentRuns.toolDurationPartial",{duration:z2e(d)})}`:""]})]}),a.jsx("div",{className:"development-process__items",hidden:!s,children:i(e)})]})}function w_t({blocks:e,active:t,status:n="",render:i}){const{t:r}=Te("adk"),s=nnt(e),o=s[s.length-1],l=[...e].reverse().find(u=>u.kind==="progress"),c=n||((l==null?void 0:l.kind)==="progress"?l.text:"");return a.jsxs(a.Fragment,{children:[s.map(u=>u.process?a.jsx(x_t,{blocks:u.blocks,active:t&&u===o,status:c,render:i},u.id):a.jsx("div",{"data-assistant-phase":u.blocks[0].phase,children:i(u.blocks)},u.id)),t&&!(o!=null&&o.process)&&a.jsxs("div",{className:"development-process__status",role:"status",children:[a.jsx("span",{className:"tool-icon",children:a.jsx(RM,{kind:"thinking"})}),a.jsx(hn,{children:c||r("developmentRuns.processing")})]})]})}const O_t={formatDate(e){const t=e.value??e.date??e.timestamp;if(t==null)return"";const n=new Date(t);return isNaN(n.getTime())?String(t):n.toLocaleString()}};function k_t(e,t){if(!t||t==="/")return e;const n=t.replace(/^\//,"").split("/").map(r=>r.replace(/~1/g,"/").replace(/~0/g,"~"));let i=e;for(const r of n){if(i==null||typeof i!="object")return;i=i[r]}return i}function S_t(e){return typeof e=="object"&&e!==null&&typeof e.path=="string"}function E_t(e){return typeof e=="object"&&e!==null&&typeof e.call=="string"}function uq(e,t){if(S_t(e))return k_t(t,e.path);if(E_t(e)){const n=O_t[e.call],i={};for(const[r,s]of Object.entries(e.args??{}))i[r]=uq(s,t);return n?n(i):`[unknown fn: ${e.call}]`}return e}function C_t(e,t){const n=uq(e,t);return n==null?"":typeof n=="string"?n:String(n)}const uLe=new Map;function Z0(e,t){uLe.set(e,t)}function A_t(e){return uLe.get(e)}function T_t(e,t,n){const i=t.replace(/^\//,"").split("/").map(s=>s.replace(/~1/g,"/").replace(/~0/g,"~"));let r=e;for(let s=0;suq(i,e.dataModel),resolveString:i=>C_t(i,e.dataModel),dispatchAction:t,render:i=>{if(!i)return null;const r=e.components[i];if(!r)return null;const s=A_t(r.component)??__t;return a.jsx(s,{node:r,ctx:n},i)}};return a.jsx("div",{className:"a2ui-surface","data-a2ui-surface":e.surfaceId,children:n.render(e.rootId)})}function fLe(e){const t=p.useRef(null),n=p.useRef(!0),i=28,r=p.useCallback(()=>{const s=t.current;s&&(n.current=s.scrollHeight-s.scrollTop-s.clientHeight{const s=t.current;s&&n.current&&(s.scrollTop=s.scrollHeight)},[e]),{ref:t,onScroll:r}}function IM({value:e,skillPrefix:t="/",onRemoveSkill:n,onRemoveAgent:i}){const{t:r}=Te("conversation");return e.skills.length===0&&!e.targetAgent?null:a.jsxs("div",{className:"invocation-chips","aria-label":r("invocation.ariaLabel"),children:[e.skills.map(s=>a.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:s.description,children:[a.jsx(lC,{"aria-hidden":!0}),a.jsxs("span",{children:[t,s.name]}),n?a.jsx("button",{type:"button",onClick:()=>n(s.name),"aria-label":r("invocation.removeSkill",{name:s.name}),children:a.jsx(Mo,{})}):null]},s.name)),e.targetAgent?a.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:e.targetAgent.description,children:[a.jsx(Mje,{"aria-hidden":!0}),a.jsx("span",{children:e.targetAgent.name}),i?a.jsx("button",{type:"button",onClick:i,"aria-label":r("invocation.removeAgent",{name:e.targetAgent.name}),children:a.jsx(Mo,{})}):null]}):null]})}function dq(e=""){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e==="application/pdf"?"pdf":e==="text/markdown"?"markdown":"text"}function hLe(e){var n,i,r,s;const t=dq(e.mimeType);return t==="pdf"?"PDF":t==="markdown"?"MD":t==="video"?((i=(n=e.mimeType)==null?void 0:n.split("/")[1])==null?void 0:i.toUpperCase())??"VIDEO":t==="image"?((s=(r=e.mimeType)==null?void 0:r.split("/")[1])==null?void 0:s.toUpperCase())??"IMAGE":"TXT"}function pLe(e){return e?e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`:""}function mLe(e,t){return e.previewUrl?e.previewUrl:e.data?`data:${e.mimeType??"application/octet-stream"};base64,${e.data}`:e.uri?hTe(t,e.uri):""}function N_t({kind:e}){return e==="image"?a.jsx(bV,{}):e==="video"?a.jsx($je,{}):e==="pdf"?a.jsx(Pat,{}):a.jsx(mV,{})}function PM({appName:e,items:t,compact:n=!1,onRemove:i}){const{t:r}=Te("conversation"),[s,o]=p.useState(null);return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:`media-grid${n?" media-grid--compact":""}`,children:t.map(l=>{const c=dq(l.mimeType),u=mLe(l,e),d=l.status==="uploading"||l.status==="error"||!u,f=a.jsxs("button",{type:"button",className:"media-card-main",disabled:d,onClick:c==="image"?void 0:()=>o(l),"aria-label":r("media.preview",{name:l.name??r("media.attachment")}),children:[c==="image"&&u?a.jsx("img",{className:"media-card-image",src:u,alt:l.name??r("media.image"),loading:"lazy"}):c==="video"&&u?a.jsxs("div",{className:"media-card-video-container",children:[a.jsx("video",{className:"media-card-video",src:u,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),a.jsx("span",{className:"media-card-video-play",children:a.jsx(Uje,{})})]}):a.jsx("span",{className:"media-card-icon",children:a.jsx(N_t,{kind:c})}),a.jsxs("span",{className:"media-card-copy",children:[a.jsx("span",{className:"media-card-name",children:l.name??r("media.attachment")}),a.jsxs("span",{className:"media-card-meta",children:[a.jsx("span",{className:"media-card-type",children:hLe(l)}),l.status==="uploading"?a.jsxs(a.Fragment,{children:[a.jsx(Bi,{className:"media-card-spinner"})," ",r("media.uploading")]}):l.status==="error"?l.error??r("media.uploadFailed"):pLe(l.sizeBytes)]})]}),!n&&l.status!=="uploading"&&l.status!=="error"?a.jsx(ZS,{className:"media-card-open"}):null]});return a.jsxs(Ar.div,{className:`media-card media-card--${c}${l.status==="error"?" media-card--error":""}`,layout:!0,initial:{opacity:0,scale:.985,y:4},animate:{opacity:1,scale:1,y:0},children:[c==="image"&&!d?a.jsx(MAe,{src:u,children:f}):f,i?a.jsx("button",{type:"button",className:"media-card-remove","aria-label":r("media.remove",{name:l.name??r("media.attachment")}),onClick:()=>i(l.id),children:a.jsx(Mo,{})}):null]},l.id)})}),a.jsx(hf,{children:s?a.jsx(R_t,{appName:e,item:s,onClose:()=>o(null)}):null})]})}function R_t({appName:e,item:t,onClose:n}){const{t:i}=Te("conversation"),r=p.useMemo(()=>mLe(t,e),[e,t]),s=dq(t.mimeType),[o,l]=p.useState(""),[c,u]=p.useState(s==="text"||s==="markdown"),[d,f]=p.useState("");return p.useEffect(()=>{const h=m=>{m.key==="Escape"&&n()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[n]),p.useEffect(()=>{if(s!=="text"&&s!=="markdown")return;const h=new AbortController;return u(!0),f(""),fetch(r,{signal:h.signal}).then(m=>{if(!m.ok)throw new Error(`HTTP ${m.status}`);return m.text()}).then(l).catch(m=>{h.signal.aborted||f(m instanceof Error?m.message:String(m))}).finally(()=>{h.signal.aborted||u(!1)}),()=>h.abort()},[s,r]),a.jsx(Ar.div,{className:"media-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":i("media.previewDialog",{name:t.name??i("media.attachment")}),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onMouseDown:h=>{h.target===h.currentTarget&&n()},children:a.jsxs(Ar.div,{className:"media-viewer",initial:{opacity:0,y:18,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.99},transition:{type:"spring",stiffness:420,damping:30},children:[a.jsxs("header",{className:"media-viewer-header",children:[a.jsxs("div",{children:[a.jsx("strong",{children:t.name??i("media.attachment")}),a.jsxs("span",{children:[hLe(t),t.sizeBytes?` · ${pLe(t.sizeBytes)}`:""]})]}),a.jsxs("nav",{children:[a.jsx("a",{href:r,download:t.name,"aria-label":i("media.download"),children:a.jsx(eM,{})}),a.jsx("button",{type:"button",onClick:n,"aria-label":i("media.close"),children:a.jsx(Mo,{})})]})]}),a.jsxs("div",{className:`media-viewer-body media-viewer-body--${s}`,children:[s==="image"?a.jsx("img",{src:r,alt:t.name??i("media.image")}):null,s==="video"?a.jsx("div",{className:"media-viewer-video-wrapper",children:a.jsx("video",{src:r,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",className:"media-viewer-video"})}):null,s==="pdf"?a.jsx("iframe",{src:r,title:t.name??"PDF"}):null,c?a.jsxs("div",{className:"media-viewer-loading",children:[a.jsx(Bi,{})," ",i("media.reading")]}):null,!c&&d?a.jsx("div",{className:"media-viewer-loading",children:i("media.loadFailed",{error:d})}):null,!c&&s==="markdown"?a.jsx("div",{className:"media-document",children:a.jsx(_d,{text:o})}):null,!c&&s==="text"?a.jsx("pre",{className:"media-document media-document--plain",children:o}):null]})]})})}function I_t({definition:e,label:t,done:n,open:i,onToggle:r}){const{t:s}=Te("conversation"),o=e.icon,l=n?e.doneLabel:e.runningLabel,c=t??s(`blocks.tools.${e.name}.${n?"done":"running"}`,{defaultValue:l});return a.jsxs("button",{type:"button",className:`builtin-tool-head${n?" is-done":" is-running"}`,"data-tool-tone":e.tone,onClick:r,"aria-expanded":i,children:[a.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:a.jsx(o,{})}),n?a.jsx("span",{className:"builtin-tool-label",children:c}):a.jsx(hn,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:c}),a.jsx(rO,{className:`builtin-tool-chevron${i?" is-open":""}`})]})}function ju(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Vn(e){return typeof e=="string"?e:""}function Lne(e){return typeof e=="number"&&Number.isFinite(e)?e:0}function ud(e){return Array.isArray(e)?e:[]}function u9(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return{}}const n=ju(t)??{};return ju(n.result)??n}function DM(e){if(typeof e=="string")try{return DM(JSON.parse(e))}catch{return e}const t=ju(e);if(!t)return"";const n=ju(t.result);return Vn(t.error)||Vn(t.message)||Vn(n==null?void 0:n.error)||Vn(n==null?void 0:n.message)}function P_t(e){if(e.kind==="tool")return"tool";if(e.kind==="knowledge_base")return"knowledge_base";const t=ju(e.metadata),n=Vn(t==null?void 0:t.source_type).toLowerCase(),i=Vn(e.source).toLowerCase();return n==="skillhub"||i.startsWith("skill_hub:")?"skill_hub":"skill_space"}const gLe={tool:"Tools",knowledge:"AgentKit Knowledge Base",skillCenter:"AgentKit Skill Center",unknownSource:"Unknown source",unnamedResource:"Unnamed resource",unnamedAgent:"Unnamed agent"};function D_t(e,t){return e==="veadk_builtin_tools"?t.tool:e==="agentkit_knowledge"?t.knowledge:e.startsWith("skill_hub:")?`Skill Hub ${e.slice(10)}`:e.startsWith("skill_space:")?`${t.skillCenter} ${e.slice(12)}`:e||t.unknownSource}function M_t(e){return e==="veadk_builtin_tools"?"tool":e==="agentkit_knowledge"?"knowledge_base":e.startsWith("skill_hub:")?"skill_hub":"skill_space"}function L_t(e,t=gLe){const n=u9(e),i=ju(n.capabilities)??{},r=ud(n.resources).flatMap(o=>{const l=ju(o);if(!l)return[];const c=l.kind==="tool"?"tool":l.kind==="knowledge_base"?"knowledge_base":"skill";return[{ref:Vn(l.ref),kind:c,category:P_t(l),name:Vn(l.name)||Vn(l.ref)||t.unnamedResource,description:Vn(l.description),source:Vn(l.source),version:Vn(l.version)}]}),s=ud(n.sources).flatMap(o=>{const l=ju(o);if(!l)return[];const c=Vn(l.source),u=Vn(l.status),d=u==="error"?"error":u==="skipped"?"skipped":"ok";return[{source:c,category:M_t(c),label:D_t(c,t),status:d,count:Lne(l.count),message:Vn(l.message),searchKeywords:ud(l.search_keywords).map(Vn).filter(Boolean)}]});return{collectionId:Vn(n.collection_id),capabilities:{googleAdkVersion:Vn(i.google_adk_version),agentTypes:ud(i.agent_types).map(Vn).filter(Boolean),maxOrchestrationDepth:Lne(i.max_orchestration_depth)},resources:r,sources:s,counts:{all:r.length,skill_hub:r.filter(o=>o.category==="skill_hub").length,skill_space:r.filter(o=>o.category==="skill_space").length,knowledge_base:r.filter(o=>o.category==="knowledge_base").length,tool:r.filter(o=>o.category==="tool").length}}}function $_t(e,t){return{resources:e.resources.filter(n=>n.category===t),sources:e.sources.filter(n=>n.category===t)}}function bLe(e,t,n=gLe){const i=u9(e),r=u9(t),s=new Map(ud(r.results).flatMap(d=>{const f=ju(d),h=Vn(f==null?void 0:f.name);return f&&h?[[h,f]]:[]})),o=ud(i.agents).flatMap(d=>{const f=ju(d),h=Vn(f==null?void 0:f.name);return f&&h?[f]:[]}),l=new Set(o.map(d=>Vn(d.name))),c=[...s.entries()].filter(([d])=>!l.has(d)).map(([d])=>({name:d})),u=[...o,...c].map(d=>{const f=Vn(d.name),h=ud(d.nodes).flatMap(C=>{const E=ju(C);return E?[E]:[]}),m=Vn(d.root_node),g=h.find(C=>Vn(C.id)===m),b=h.filter(C=>Vn(C.id)!==m).map(C=>({id:Vn(C.id)||n.unnamedAgent,type:Vn(C.type)||"llm",description:Vn(C.description)})),v=s.get(f),y=Vn(v==null?void 0:v.status),w=y==="failed"?"failed":y==="completed"?"completed":"running",x=$ne(v==null?void 0:v.resources),O=x.length>0?x:$ne(h.flatMap(C=>ud(C.resources))),k=Fne(v==null?void 0:v.python_tools),S=k.length>0?k:Fne(h.flatMap(C=>ud(C.python_tools)));return{name:f,description:Vn(v==null?void 0:v.description)||Vn(g==null?void 0:g.description)||Vn(d.task),task:Vn(d.task),rootType:Vn(v==null?void 0:v.root_type)||Vn(g==null?void 0:g.type)||"llm",nodeCount:h.length,subAgentCount:b.length,resourceCount:O.length,pythonToolCount:S.length,skills:O.filter(C=>C.kind==="skill"),knowledgeBases:O.filter(C=>C.kind==="knowledge_base"),builtinTools:O.filter(C=>C.kind==="tool"),pythonTools:S,subAgents:b,status:w,output:Vn(v==null?void 0:v.output),error:Vn(v==null?void 0:v.error)}});return{collectionId:Vn(r.collection_id)||Vn(i.collection_id),agents:u,completedCount:u.filter(d=>d.status==="completed").length,failedCount:u.filter(d=>d.status==="failed").length,runningCount:u.filter(d=>d.status==="running").length}}function F_t(e,t){return!!DM(t)||bLe(e,t).failedCount>0}function $ne(e){const t=new Set;return ud(e).flatMap(n=>{const i=ju(n),r=Vn(i?i.ref:n);if(!r||t.has(r))return[];t.add(r);const s=Vn(i==null?void 0:i.kind),o=s==="tool"||r.startsWith("veadk_tool:")?"tool":s==="knowledge_base"||r.startsWith("agentkit_kb:")?"knowledge_base":"skill",l=r.split(":");return[{ref:r,kind:o,name:Vn(i==null?void 0:i.name)||l[l.length-1]||r,description:Vn(i==null?void 0:i.description),version:Vn(i==null?void 0:i.version),source:Vn(i==null?void 0:i.source)}]})}function Fne(e){const t=new Set;return ud(e).flatMap(n=>{const i=ju(n),r=Vn(i==null?void 0:i.name),s=Vn(i==null?void 0:i.code),o=`${r}\0${s}`;return!i||!r||t.has(o)?[]:(t.add(o),[{name:r,description:Vn(i.description),code:s,entrypoint:Vn(i.entrypoint)||r,dependencies:ud(i.dependencies).map(Vn).filter(Boolean)}])})}function B_t({branch:e}){return a.jsxs("div",{className:`branch-compare__body${e.status==="running"?" is-streaming":""}`,"aria-live":"polite",children:[e.content?a.jsx(_d,{text:e.content,streaming:e.status==="running"}):null,e.status==="running"?a.jsx("span",{className:"branch-compare__caret","aria-hidden":"true"}):null,e.error?a.jsx("p",{className:"branch-compare__error",children:e.error}):null]})}function U_t({args:e,response:t,status:n,onBranchSelect:i}){const{t:r}=Te("conversation"),s=p.useMemo(()=>Vje(e,t,n),[e,t,n]),[o,l]=p.useState(0);return a.jsxs("section",{className:"branch-compare","aria-label":r("blocks.branchCompare.ariaLabel"),children:[a.jsx("div",{className:"branch-compare__tabs",role:"tablist","aria-label":r("blocks.branchCompare.selectDirection"),children:s.branches.map((c,u)=>a.jsx("button",{className:`branch-compare__tab${o===u?" is-active":""}`,type:"button",role:"tab","aria-selected":o===u,"aria-controls":`branch-compare-panel-${u}`,onClick:()=>l(u),children:a.jsx(Ya,{color:"info",size:"sm",variant:"soft",children:c.label})},`${c.label}:${u}`))}),a.jsx("div",{className:"branch-compare__branches",children:s.branches.map((c,u)=>a.jsxs("article",{className:`branch-compare__branch${o===u?" is-active":""}`,id:`branch-compare-panel-${u}`,role:"tabpanel",children:[a.jsx("header",{className:"branch-compare__head",children:a.jsx(Ya,{color:"info",size:"sm",variant:"soft",children:c.label})}),a.jsx(B_t,{branch:c}),a.jsx("footer",{className:"branch-compare__footer",children:a.jsx(Tt,{type:"button",color:"info",variant:"ghost",size:"sm",pill:!1,disabled:c.status!=="completed",onClick:()=>i==null?void 0:i(c),children:r("blocks.branchCompare.continue")})})]},`${c.label}:${u}`))})]})}function yLe({controlled:e,default:t,name:n,state:i="value"}){const{current:r}=p.useRef(e!==void 0),[s,o]=p.useState(t),l=r?e:s,c=p.useCallback(u=>{r||o(u)},[]);return[l,c]}const vLe=p.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function Q_t(){return p.useContext(vLe)}function z_t(e){const{children:t,elementsRef:n,labelsRef:i,onMapChange:r}=e,s=li(r),[,o]=p.useState(!1),l=Cd(H_t).current,c=Cd(V_t).current,u=p.useRef(0),d=p.useRef(!0),f=p.useRef([]),h=p.useRef(null),m=li(()=>{d.current||(d.current=!0,o(k=>!k))}),g=li((k,S)=>{c.set(k,S),m()}),b=li(k=>{c.delete(k),m()}),v=li(k=>{const S=new Map;return n.current.length=0,i&&(i.current.length=0),k.forEach(C=>{var E,j;S.set(C.element,{...C.registration.metadata??{},index:C.index}),n.current[C.index]=C.element,i&&(i.current[C.index]=C.registration.label!==void 0?C.registration.label:((j=(E=C.registration.textRef)==null?void 0:E.current)==null?void 0:j.textContent)??C.element.textContent)}),u.current=n.current.length,S});function y(k){var E;if((E=h.current)==null||E.disconnect(),h.current=null,typeof MutationObserver!="function"||k.length<2)return;const S=new MutationObserver(j=>{if(!K_t(j))return;let T=null;for(const R of k)if(R.isConnected){if(T&&xLe(T,R)>0){S.disconnect(),m();return}T=R}});h.current=S;const C=new Set;for(let j=1;jS.observe(j,{childList:!0}))}const w=li(()=>{const[k,S]=q_t(c),C=v(k);y(S),f.current=k,d.current=!1,l.forEach(E=>E(C)),s(C)});Jn(()=>(d.current||v(f.current),()=>{n.current=[],i&&(i.current=[])}),[n,i,v]),Jn(()=>{d.current&&w()}),Jn(()=>()=>{var k;(k=h.current)==null||k.disconnect(),d.current=!0},[]);const x=li(k=>(l.add(k),()=>{l.delete(k)})),O=p.useMemo(()=>({register:g,unregister:b,subscribeMapChange:x,nextIndexRef:u}),[g,b,x,u]);return a.jsx(vLe.Provider,{value:O,children:t})}function V_t(){return new Map}function H_t(){return new Set}function q_t(e){const t=new Set,n=[],i=[];e.forEach((s,o)=>{if(!o.isConnected)return;const l=s.index,c={index:l??-1,element:o,registration:s};l===null?i.push(c):l>=0&&(t.add(l),n.push(c))});let r=0;return i.sort((s,o)=>xLe(s.element,o.element)),i.forEach(s=>{for(;t.has(r);)r+=1;s.index=r,n.push(s),r+=1}),t.size>0&&n.sort((s,o)=>s.index-o.index),[n,i.map(s=>s.element)]}function W_t(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function K_t(e){for(const t of e)for(let n=0;nnull},kLe=p.forwardRef(function(t,n){const{render:i,className:r,disabled:s=!1,hiddenUntilFound:o,keepMounted:l,loopFocus:c,onValueChange:u,multiple:d=!1,orientation:f="vertical",value:h,defaultValue:m,style:g,...b}=t,v=p.useMemo(()=>{if(h===void 0)return m??[]},[h,m]),y=p.useRef([]),[w,x]=yLe({controlled:h,default:v,name:"Accordion",state:"value"}),O=li((E,j,T)=>{if(d)if(j){const R=w.slice();if(R.push(E),u==null||u(R,T),T.isCanceled)return;x(R)}else{const R=w.filter(A=>A!==E);if(u==null||u(R,T),T.isCanceled)return;x(R)}else{const R=w[0]===E?[]:[E];if(u==null||u(R,T),T.isCanceled)return;x(R)}}),k=p.useMemo(()=>({value:w,disabled:s,orientation:f}),[w,s,f]),S=p.useMemo(()=>({disabled:s,handleValueChange:O,hiddenUntilFound:o??!1,keepMounted:l??!1,state:k,value:w}),[s,O,o,l,k,w]),C=Pa("div",t,{state:k,ref:n,props:b,stateAttributesMapping:G_t});return a.jsx(wLe.Provider,{value:S,children:a.jsx(z_t,{elementsRef:y,children:C})})});function X_t(e){const{open:t,defaultOpen:n,onOpenChange:i,disabled:r}=e,[s,o]=yLe({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:l,setMounted:c,transitionStatus:u}=tje(s,!0,!0),d=nm(),[f,h]=p.useState(),m=f===null?void 0:f??d,g=li(b=>{const v=!s,y=ha(Gw,b.nativeEvent);i(v,y),!y.isCanceled&&o(v)});return p.useMemo(()=>({defaultPanelId:d,disabled:r,handleTrigger:g,mounted:l,open:s,panelId:m,setMounted:c,setOpen:o,setPanelIdState:h,transitionStatus:u}),[d,r,g,l,s,m,c,o,h,u])}const SLe=p.createContext(void 0);function ELe(){const e=p.useContext(SLe);if(e===void 0)throw new Error(Vc(15));return e}function Y_t(e={}){const{guess:t,label:n,metadata:i,textRef:r,index:s}=e,{register:o,unregister:l,subscribeMapChange:c,nextIndexRef:u}=Q_t(),d=p.useRef(-1),[f,h]=p.useState(s==null&&t?()=>{if(d.current===-1){const v=u.current;u.current+=1,d.current=v}return d.current}:-1),m=s??f,g=p.useRef(null),b=p.useCallback(v=>{const y=g.current;y&&l(y),g.current=v,v&&o(v,{metadata:i??null,index:s??null,label:n,textRef:r})},[s,o,l,i,n,r]);return Jn(()=>{if(s==null)return c(v=>{var w;const y=g.current?(w=v.get(g.current))==null?void 0:w.index:null;y!=null&&h(y)})},[s,c]),{ref:b,index:m}}const CLe=p.createContext(void 0);function fq(){const e=p.useContext(CLe);if(e===void 0)throw new Error(Vc(9));return e}let hq=function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=aI.startingStyle]="startingStyle",e[e.endingStyle=aI.endingStyle]="endingStyle",e}({}),Z_t=function(e){return e.panelOpen="data-panel-open",e}({});const J_t={[hq.open]:""},ejt={[hq.closed]:""},tjt={open(e){return e?{[Z_t.panelOpen]:""}:null}},njt={open(e){return e?J_t:ejt}};let ijt=function(e){return e.index="data-index",e.disabled="data-disabled",e.open="data-open",e}({});const pq={...njt,index:e=>({[ijt.index]:String(e)}),...WD,value:()=>null},ALe=p.forwardRef(function(t,n){const{className:i,disabled:r=!1,onOpenChange:s,render:o,value:l,style:c,...u}=t,{ref:d,index:f}=Y_t(),h=Kw(n,d),{disabled:m,handleValueChange:g,state:b,value:v}=OLe(),y=nm(),w=l??y,x=r||m,O=v.indexOf(w)!==-1,k=li((D,_)=>{s==null||s(D,_),!_.isCanceled&&g(w,D,_)}),S=X_t({open:O,onOpenChange:k,disabled:x}),C=p.useMemo(()=>({open:S.open,disabled:S.disabled,transitionStatus:S.transitionStatus}),[S.open,S.disabled,S.transitionStatus]),E=p.useMemo(()=>({...S,onOpenChange:k,state:C}),[S,C,k]),j=p.useMemo(()=>({...b,hidden:!O&&!S.mounted,index:f,disabled:x,open:O}),[S.mounted,x,f,O,b]),T=nm(),[R,A]=p.useState(),N=R===null?void 0:R??T,P=p.useMemo(()=>({defaultTriggerId:T,open:O,state:j,setTriggerId:A,triggerId:N}),[T,O,j,A,N]),I=Pa("div",t,{state:j,ref:h,props:u,stateAttributesMapping:pq});return a.jsx(SLe.Provider,{value:E,children:a.jsx(CLe.Provider,{value:P,children:I})})}),TLe=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...o}=t,{state:l}=fq();return Pa("h3",t,{state:l,ref:n,props:o,stateAttributesMapping:pq})}),_Le=p.forwardRef(function(t,n){const{disabled:i,className:r,id:s,render:o,nativeButton:l=!0,style:c,...u}=t,{panelId:d,open:f,handleTrigger:h,disabled:m}=ELe(),g=i||m,{getButtonProps:b,buttonRef:v}=KD({disabled:g,focusableWhenDisabled:!0,native:l}),{defaultTriggerId:y,state:w,setTriggerId:x}=fq(),O=s||void 0,k=O??y;return Jn(()=>(x(E=>O??(E===null?void 0:E)),()=>{x(E=>E===O?null:E)}),[O,x]),Pa("button",t,{state:w,ref:[n,v],props:[{"aria-controls":f?d:void 0,"aria-expanded":f,id:k,onClick:h},u,b],stateAttributesMapping:tjt})}),mk={height:void 0,width:void 0};function rjt(e){const{externalRef:t,hiddenUntilFound:n,id:i,keepMounted:r,mounted:s,onOpenChange:o,open:l,setMounted:c,setOpen:u,transitionStatus:d}=e,f=p.useRef(null),h=p.useRef(null),[m,g]=p.useState(mk),b=p.useRef(mk),v=p.useRef(!1),y=p.useRef(l),w=p.useRef(!1),[x,O]=p.useState(!1),k=p.useRef(null),S=Kw(t,f),C=ec(l),E=rV(f),j=!l&&!s,T=x?"idle":d,R=l&&(y.current||w.current),A=!l&&s&&h.current==="css-animation"&&m.height===void 0&&m.width===void 0?b.current:m,N=n&&j&&h.current!=="css-animation",P=li((F,M=!0)=>{M&&(b.current=F),g(F)}),I=li(()=>{var F;(F=k.current)==null||F.call(k),k.current=null}),D=li(F=>{I(),k.current=()=>{k.current=null,F()}}),_=li(()=>{l&&s&&h.current==="css-animation"&&(w.current=!0)});Jn(()=>{!x||d==="starting"||O(!1)},[x,d]),p.useEffect(()=>()=>{_(),I()},[_,I]),Jn(()=>{const F=f.current;if(!F)return;!l&&k.current&&I();const M=sjt(F,R);if(h.current=M,l&&d==="idle"&&y.current&&M==="css-animation"){b.current=$v(F);return}if(l&&d==="starting"){const U=v.current;if(v.current=!1,M==="none"){P($v(F)),O(!0);return}if(M==="css-transition"){const Z=ajt(F);if(P($v(F)),!U)return Z;const ne=j_(F,"transition-duration","0s");return D(ne),O(!0),Z}P($v(F));const J=j_(F,"animation-name","none");if(!U){J();return}const V=j_(F,"animation-duration","0s");J(),D(V),O(!0);return}if(!l&&s&&(d==="idle"||d==="starting")){if(y.current=!1,w.current=!1,M==="none"){P(mk,!1),c(!1);return}P($v(F));return}if(d!=="ending")return;if(M==="none"){c(!1);return}const z=$v(F);if(!(z.height>0||z.width>0)){c(!1);return}P(z),M==="css-animation"&&j_(F,"animation-name","none")()},[s,l,I,P,c,D,R,d]),$A({enabled:l&&s&&T==="idle",open:!0,ref:f,onComplete(){l&&P(mk,!1)}}),p.useEffect(()=>{if(l||!s||T!=="ending"||!f.current)return;const M=new AbortController;let z=-1;function q(){C.current||(c(!1),P(mk,!1))}return z=_c.request(()=>{E(q,M.signal)}),()=>{_c.cancel(z),M.abort()}},[C,s,l,T,E,P,c]),Jn(()=>{const F=f.current;!F||!n||!j||F.setAttribute("hidden","until-found")},[j,n]),p.useEffect(function(){const M=f.current;if(!M)return;function z(q){const U=ha(E_e,q);o(!0,U),!U.isCanceled&&(v.current=!0,u(!0))}return Ni(M,"beforematch",z)},[o,u]);const L=r||n||s||l;return{height:A.height,props:{...N?{[hq.startingStyle]:""}:void 0,hidden:j,id:i},ref:S,shouldPreventOpenAnimation:R,shouldRender:L,transitionStatus:T,width:A.width}}function $v(e){return{height:e.scrollHeight,width:e.scrollWidth}}function sjt(e,t){const n=na(e).getComputedStyle(e),i=(n.animationName.split(",").map(s=>s.trim()).some(s=>s!==""&&s!=="none")||t)&&Bne(n.animationDuration),r=Bne(n.transitionDuration);return i&&r||r?"css-transition":i?"css-animation":"none"}function Bne(e){return e.split(",").map(t=>t.trim()).some(t=>t!==""&&Number.parseFloat(t)>0)}function j_(e,t,n){const i=e.style.getPropertyValue(t),r=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(i===""){e.style.removeProperty(t);return}e.style.setProperty(t,i,r)}}function ajt(e){const t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(r=>{e.style.setProperty(r,"initial","important")});function n(){Object.entries(t).forEach(([r,s])=>{if(s===""){e.style.removeProperty(r);return}e.style.setProperty(r,s)})}const i=_c.request(n);return()=>{_c.cancel(i),n()}}let Une=function(e){return e.accordionPanelHeight="--accordion-panel-height",e.accordionPanelWidth="--accordion-panel-width",e}({});const jLe=p.forwardRef(function(t,n){const{className:i,hiddenUntilFound:r,keepMounted:s,id:o,render:l,style:c,...u}=t,{hiddenUntilFound:d,keepMounted:f}=OLe(),{defaultPanelId:h,mounted:m,onOpenChange:g,open:b,setMounted:v,setOpen:y,setPanelIdState:w,transitionStatus:x}=ELe(),O=r??d,k=s??f,S=o||void 0,C=o??h;Jn(()=>(w(M=>S??(M===null?void 0:M)),()=>{w(M=>M===S?null:M)}),[S,w]);const{height:E,props:j,ref:T,shouldPreventOpenAnimation:R,shouldRender:A,transitionStatus:N,width:P}=rjt({externalRef:n,hiddenUntilFound:O,id:C,keepMounted:k,mounted:m,onOpenChange:g,open:b,setMounted:v,setOpen:y,transitionStatus:x}),{state:I,triggerId:D}=fq(),_={...I,transitionStatus:N},L=m_e(c,_),F=Pa("div",{...t,style:void 0},{state:_,ref:T,props:[j,{"aria-labelledby":D,role:"region",style:{[Une.accordionPanelHeight]:E===void 0?"auto":`${E}px`,[Une.accordionPanelWidth]:P===void 0?"auto":`${P}px`}},u,L?{style:L}:void 0,R?{style:{animationName:"none"}}:void 0],stateAttributesMapping:pq});return A?F:null}),ojt=(e,t)=>{const n=e.currentTarget,i={x:e.clientX,y:e.clientY},r=ljt(i,n.getBoundingClientRect()),s=cjt(i,r),o=ujt(t.getBoundingClientRect());return fjt([...s,...o])};function ljt(e,t){const n=Math.abs(t.top-e.y),i=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,i,r,s)){case s:return"left";case r:return"right";case n:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function cjt(e,t,n=5){const i=[];switch(t){case"top":i.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":i.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":i.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":i.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return i}function ujt(e){const{top:t,right:n,bottom:i,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:i},{x:r,y:i}]}function djt(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,o=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}function fjt(e){const t=e.slice();return t.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),hjt(t)}function hjt(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i=2;){const s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let i=e.length-1;i>=0;i--){const r=e[i];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const pjt="_Transition_1wdpp_1",mjt="_Popover_1wdpp_3",NLe={Transition:pjt,Popover:mjt},RLe=p.createContext(null),MM=()=>{const e=p.use(RLe);if(!e)throw new Error("Popover components must be wrapped in ");return e},$g=({open:e,onOpenChange:t,showOnHover:n=!1,hoverOpenDelay:i=150,children:r})=>{const[s,o]=p.useState(!1),[l,c]=p.useState(!1),u=p.useRef(null),d=p.useRef(null),f=p.useRef(void 0),h=p.useRef(!1),m=p.useRef(!1),g=e??s,[b,v]=p.useState(!1);OV(()=>v(!1),b?500:null);const y=sb(t),w=sb(C=>{var E,j;clearTimeout(f.current),g!==C&&(C||(c(!1),n&&h.current&&((E=u.current)==null||E.focus()),h.current=!1),(j=y.current)==null||j.call(y,C),o(C),n&&v(C))}),x=p.useCallback(C=>{w.current(C)},[w]),O=p.useCallback(()=>{f.current=setTimeout(()=>x(!0),i)},[x,i]),k=p.useCallback(()=>{clearTimeout(f.current)},[]);p.useEffect(()=>()=>{clearTimeout(f.current)},[]);const S=p.useMemo(()=>({open:g,setOpen:x,shake:l,setShake:c,showOnHover:n,temporarilyPreventClickToClose:b,onTriggerEnter:O,onTriggerLeave:k,isPointerInTransitRef:m,triggerRef:u,contentRef:d,hoverOpenFocusedWithTab:h}),[g,x,l,c,n,b,h,m,O,k]);return a.jsx(RLe,{value:S,children:a.jsx(IRe,{open:g,onOpenChange:x,modal:!1,children:r})})},gjt=({children:e,onPointerDown:t,onClick:n})=>{const{setOpen:i,showOnHover:r,temporarilyPreventClickToClose:s,onTriggerEnter:o,onTriggerLeave:l,isPointerInTransitRef:c,triggerRef:u,contentRef:d}=MM(),f=p.useRef(!1),h=b=>{!(b.currentTarget.nodeName.toLocaleLowerCase()==="a")&&s&&(b.preventDefault(),b.stopPropagation())},m=b=>{b.pointerType!=="touch"&&!f.current&&!c.current&&(o(),f.current=!0)},g=()=>{f.current&&(l(),f.current=!1)};return a.jsx(PRe,{asChild:!0,ref:u,onPointerDown:b=>{h(b),t==null||t(b)},onClick:b=>{h(b),n==null||n(b)},onPointerMove:r?m:void 0,onPointerLeave:r?g:void 0,onFocus:r?()=>i(!0):void 0,onBlur:r?()=>{setTimeout(()=>{var b;(b=d.current)!=null&&b.contains(document.activeElement)||i(!1)},50)}:void 0,children:e})},ILe=({children:e,avoidCollisions:t,width:n,minWidth:i,maxWidth:r,side:s,sideOffset:o=8,align:l,alignOffset:c,translucent:u,className:d,autoFocus:f=!0})=>{const{showOnHover:h,shake:m,contentRef:g}=MM(),b=v=>{const y=g.current;if(y&&v.target===y&&v.key==="Tab"&&v.shiftKey){v.preventDefault(),v.stopPropagation();const w=sNe(y),x=w[w.length-1];x==null||x.focus()}};return p.useEffect(()=>{const v=g.current;!v||!f||v!=null&&v.contains(document.activeElement)||h||v.focus({preventScroll:!0})},[g,h,f]),a.jsx(MRe,{forceMount:!0,ref:g,className:Qi(NLe.Popover,d),style:B0({"popover-width":n,"popover-min-width":i,"popover-max-width":r}),onCloseAutoFocus:h?Lp:void 0,"data-animate":m?"shake":void 0,"data-translucent":u?"true":void 0,side:s,sideOffset:o,align:l,alignOffset:c??(l==="center"?0:-5),avoidCollisions:t??!0,hideWhenDetached:!0,collisionPadding:20,onOpenAutoFocus:Lp,onEscapeKeyDown:Lp,onKeyDown:b,children:e})},bjt=e=>{const{setOpen:t,triggerRef:n,contentRef:i,isPointerInTransitRef:r,hoverOpenFocusedWithTab:s}=MM(),[o,l]=p.useState(null),c=p.useCallback(()=>{l(null),r.current=!1},[r]),u=p.useCallback((d,f)=>{const h=ojt(d,f);l(h),r.current=!0},[r]);return p.useEffect(()=>()=>c(),[c]),p.useEffect(()=>{const d=n.current,f=i.current;if(!d||!f)return;const h=g=>u(g,f),m=g=>u(g,d);return d.addEventListener("pointerleave",h),f.addEventListener("pointerleave",m),()=>{d.removeEventListener("pointerleave",h),f.removeEventListener("pointerleave",m)}},[i,n,u,c]),p.useEffect(()=>{if(!o)return;const d=f=>{const h=n.current,m=i.current,g=f.target,b={x:f.clientX,y:f.clientY},v=(h==null?void 0:h.contains(g))||(m==null?void 0:m.contains(g)),y=!djt(b,o),w=g.hasAttribute("aria-haspopup");v?c():(y||w)&&(c(),t(!1))};return document.addEventListener("pointermove",d),()=>document.removeEventListener("pointermove",d)},[o,t,c,n,i]),p.useEffect(()=>{const d=f=>{if(i.current&&f.key==="Tab"&&!f.shiftKey){const[h]=sNe(i.current);h&&(f.preventDefault(),h.focus(),s.current=!0,document.removeEventListener("keydown",d))}};return document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d)}},[i,s]),a.jsx(ILe,{...e})},yjt=e=>{const{open:t,showOnHover:n,setOpen:i}=MM();return KA(t,()=>{i(!1)}),a.jsx(DRe,{forceMount:!0,children:a.jsx(G1,{enterDuration:600,exitDuration:300,className:NLe.Transition,disableAnimations:!0,children:t&&(n?a.jsx(bjt,{...e},"popover-hover"):a.jsx(ILe,{...e},"popover"))})})};$g.Trigger=gjt;$g.Content=yjt;const vjt=["skill_hub","skill_space","knowledge_base","tool"];function PLe(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m4 6 4 4 4-4"})})}function DLe({label:e}){return a.jsx("div",{className:"create-agent-card__loading",role:"status","aria-label":e,children:[0,1,2].map(t=>a.jsxs("div",{className:"create-agent-card__skeleton-row","aria-hidden":"true",children:[a.jsx("span",{}),a.jsx("span",{})]},t))})}function xjt(e,t){return e.kind==="tool"?t("blocks.createAgents.builtinTool"):e.kind==="knowledge_base"?t("blocks.createAgents.knowledgeBase"):e.source.startsWith("skill_hub:")?"Skill Hub":e.source.startsWith("skill_space:")?t("blocks.createAgents.skillCenter"):"Skill"}function L4({label:e,resources:t}){const{t:n}=Te("conversation");return t.length===0?null:a.jsxs("section",{className:"create-agent-card__popover-section",children:[a.jsx("h4",{children:e}),a.jsx("div",{className:"create-agent-card__popover-list",children:t.map(i=>a.jsxs("div",{className:"create-agent-card__popover-item",children:[a.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[a.jsx("strong",{children:i.name}),a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",children:xjt(i,n)})]}),i.description?a.jsx("p",{children:i.description}):null]},i.ref))})]})}function wjt({tools:e}){const{t}=Te("conversation");return e.length===0?null:a.jsxs("section",{className:"create-agent-card__popover-section",children:[a.jsx("h4",{children:t("blocks.createAgents.selfAuthoredTools")}),a.jsx(kLe,{children:e.map((n,i)=>a.jsxs(ALe,{className:"create-agent-card__python-tool",value:`${n.name}:${i}`,children:[a.jsx(TLe,{className:"create-agent-card__python-tool-header",children:a.jsxs(_Le,{className:"create-agent-card__python-tool-trigger",children:[a.jsxs("span",{children:[a.jsx("strong",{children:n.name}),n.description?a.jsx("small",{children:n.description}):null]}),a.jsxs("span",{className:"create-agent-card__python-tool-meta",children:[a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",children:t("blocks.createAgents.selfAuthoredTools")}),a.jsx(PLe,{className:"create-agent-card__python-tool-chevron"})]})]})}),a.jsxs(jLe,{className:"create-agent-card__python-tool-panel",children:[n.dependencies.length>0?a.jsx("div",{className:"create-agent-card__python-tool-dependencies",children:t("blocks.createAgents.dependencies",{items:n.dependencies.join(", ")})}):null,a.jsx("pre",{tabIndex:0,"aria-label":t("blocks.createAgents.fullCode",{name:n.name}),children:a.jsx("code",{children:n.code})})]})]},`${n.name}:${i}`))})]})}function Ojt({agents:e}){const{t}=Te("conversation");return e.length===0?null:a.jsxs("section",{className:"create-agent-card__popover-section",children:[a.jsx("h4",{children:t("blocks.createAgents.subAgents")}),a.jsx("div",{className:"create-agent-card__popover-list",children:e.map(n=>a.jsxs("div",{className:"create-agent-card__popover-item",children:[a.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[a.jsx("strong",{children:n.id}),a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",children:t(`blocks.createAgents.agentTypes.${n.type}`,{defaultValue:n.type})})]}),n.description?a.jsx("p",{children:n.description}):null]},n.id))})]})}function N_({label:e,count:t,icon:n,children:i}){const{t:r}=Te("conversation"),s=a.jsxs("button",{className:"create-agent-card__resource-metric",type:"button",disabled:t===0,"aria-label":r("blocks.createAgents.itemCount",{label:e,count:t}),children:[n,a.jsx("span",{children:t})]});return t===0?s:a.jsxs($g,{showOnHover:!0,hoverOpenDelay:120,children:[a.jsx($g.Trigger,{children:s}),a.jsx($g.Content,{side:"top",align:"start",minWidth:"auto",maxWidth:360,className:"create-agent-card__resource-popover",children:i})]})}function kjt({response:e,status:t}){const{t:n}=Te("conversation"),i=p.useMemo(()=>({tool:n("blocks.createAgents.sourceLabels.tool"),knowledge:n("blocks.createAgents.sourceLabels.knowledge"),skillCenter:n("blocks.createAgents.sourceLabels.skillCenter"),unknownSource:n("blocks.createAgents.sourceLabels.unknown"),unnamedResource:n("blocks.createAgents.unnamedResource"),unnamedAgent:n("blocks.createAgents.unnamedAgent")}),[n]),r=p.useMemo(()=>L_t(e,i),[i,e]),s=p.useMemo(()=>vjt.map(c=>{const u=$_t(r,c);return{value:c,label:n(`blocks.createAgents.categories.${c}`),...u,searchKeywords:[...new Set(u.sources.flatMap(d=>d.searchKeywords))]}}),[r,n]),o=t==="failed",l=o?DM(e):"";return a.jsx("section",{className:"create-agent-tool-card","aria-label":n("blocks.createAgents.collectionAria"),children:t==="running"?a.jsx(DLe,{label:n("blocks.createAgents.retrieving")}):o?a.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[a.jsx("span",{className:"create-agent-card__message-title",children:n("blocks.createAgents.retrievalFailed")}),a.jsx("span",{children:l||n("blocks.createAgents.checkConfig")})]}):a.jsx(kLe,{className:"create-agent-card__accordion",children:s.map(c=>a.jsxs(ALe,{className:"create-agent-card__accordion-item",value:c.value,children:[a.jsx(TLe,{className:"create-agent-card__accordion-header",children:a.jsxs(_Le,{className:"create-agent-card__accordion-trigger",children:[a.jsx("span",{children:c.label}),a.jsxs("span",{className:"create-agent-card__accordion-meta",children:[a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",children:c.sources.length===0?c.value==="skill_hub"?n("blocks.createAgents.notSearched"):n("blocks.createAgents.notConfigured"):c.resources.length}),a.jsx(PLe,{className:"create-agent-card__accordion-chevron"})]})]})}),a.jsx(jLe,{className:"create-agent-card__accordion-content",children:a.jsxs("div",{className:"create-agent-card__accordion-scroll",role:"region","aria-label":n("blocks.createAgents.resourceList",{label:c.label}),tabIndex:0,children:[c.value==="skill_hub"&&c.searchKeywords.length>0?a.jsxs("div",{className:"create-agent-card__search-keywords",children:[a.jsx("span",{children:n("blocks.createAgents.searchKeywords")}),a.jsx("span",{children:c.searchKeywords.join("、")})]}):null,c.resources.length>0?a.jsx("div",{className:"create-agent-card__resource-list",children:c.resources.map(u=>a.jsx("div",{className:"create-agent-card__resource",children:a.jsxs("div",{className:"create-agent-card__resource-main",children:[a.jsxs("div",{className:"create-agent-card__resource-title",children:[a.jsx("span",{className:"create-agent-card__resource-name",children:u.name}),u.version?a.jsx(Ya,{className:"create-agent-card__resource-version",color:"secondary",size:"sm",variant:"soft",children:u.version}):null]}),u.description?a.jsx("p",{children:u.description}):null]})},u.ref))}):a.jsxs("div",{className:"create-agent-card__empty-category",children:[a.jsx("p",{children:c.sources.length===0?c.value==="skill_hub"?n("blocks.createAgents.skillHubSkipped"):n("blocks.createAgents.sourceSkipped",{label:c.label}):n("blocks.createAgents.noResources")}),c.sources.filter(u=>u.message).map(u=>a.jsx("p",{className:"create-agent-card__raw-source-error",children:u.message},u.source))]})]})})]},c.value))},r.collectionId||"collected-resources")})}function Sjt({args:e,response:t,status:n}){const{t:i}=Te("conversation"),r=p.useMemo(()=>({tool:i("blocks.createAgents.sourceLabels.tool"),knowledge:i("blocks.createAgents.sourceLabels.knowledge"),skillCenter:i("blocks.createAgents.sourceLabels.skillCenter"),unknownSource:i("blocks.createAgents.sourceLabels.unknown"),unnamedResource:i("blocks.createAgents.unnamedResource"),unnamedAgent:i("blocks.createAgents.unnamedAgent")}),[i]),s=p.useMemo(()=>bLe(e,t,r),[e,r,t]),o=n==="failed"?DM(t):"";return a.jsxs("section",{className:"create-agent-tool-card is-agent-results","aria-label":i("blocks.createAgents.resultAria"),children:[o?a.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[a.jsx("span",{className:"create-agent-card__message-title",children:i("blocks.createAgents.creationFailed")}),a.jsx("span",{children:o})]}):null,s.agents.length>0?a.jsx("div",{className:"create-agent-card__agent-grid",children:s.agents.map(l=>{const c=n==="failed"?"failed":l.status,u=l.error||c==="failed"&&o,d=l.builtinTools.length+l.pythonTools.length;return a.jsxs(vH,{className:`create-agent-card__agent-card${u?" is-error":""}`,children:[a.jsx(xH,{leading:a.jsx(Jw,{seed:l.name}),title:l.name,titleText:l.name,status:a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",children:i(`blocks.createAgents.agentTypes.${l.rootType}`,{defaultValue:l.rootType})})}),l.description?a.jsx(wH,{children:l.description}):null,u?a.jsx("div",{className:"create-agent-card__agent-result is-error",role:"alert",children:u}):null,a.jsxs("div",{className:"create-agent-card__agent-resources","aria-label":i("blocks.createAgents.agentResources",{name:l.name}),children:[a.jsx(N_,{label:i("blocks.createAgents.skill"),count:l.skills.length,icon:a.jsx(pN,{"aria-hidden":"true"}),children:a.jsx(L4,{label:i("blocks.createAgents.skill"),resources:l.skills})}),a.jsx(N_,{label:i("blocks.createAgents.knowledgeBase"),count:l.knowledgeBases.length,icon:a.jsx(mIe,{"aria-hidden":"true"}),children:a.jsx(L4,{label:i("blocks.createAgents.knowledgeBase"),resources:l.knowledgeBases})}),a.jsxs(N_,{label:i("blocks.createAgents.toolsLabel"),count:d,icon:a.jsx(pat,{"aria-hidden":"true"}),children:[a.jsx(L4,{label:i("blocks.createAgents.builtinTool"),resources:l.builtinTools}),a.jsx(wjt,{tools:l.pythonTools})]}),a.jsx(N_,{label:i("blocks.createAgents.subAgents"),count:l.subAgentCount,icon:a.jsx(gat,{"aria-hidden":"true"}),children:a.jsx(Ojt,{agents:l.subAgents})})]})]},l.name)})}):n==="running"?a.jsx(DLe,{label:i("blocks.createAgents.creating")}):a.jsxs("div",{className:"create-agent-card__message",children:[a.jsx("span",{className:"create-agent-card__message-title",children:i("blocks.createAgents.noAgents")}),a.jsx("span",{children:i("blocks.createAgents.noAgentResult")})]})]})}const Ejt={web_search:{name:"web_search",runningLabel:"Searching the web",doneLabel:"Web search complete",tone:"search",icon:Pne},link_reader:{name:"link_reader",runningLabel:"Reading webpage",doneLabel:"Webpage read complete",tone:"search",icon:Pne},run_code:{name:"run_code",runningLabel:"Running code in the AgentKit sandbox",doneLabel:"Code execution completed in the AgentKit sandbox",tone:"sandbox",icon:m_t},list_envs:{name:"list_envs",runningLabel:"Checking available environments",doneLabel:"Available environments loaded",tone:"resources",icon:b_t},get_env_manifest:{name:"get_env_manifest",runningLabel:"Loading the environment manifest",doneLabel:"Environment manifest loaded",tone:"knowledge",icon:y_t},execute_in_sandbox:{name:"execute_in_sandbox",runningLabel:"Running a command in the environment",doneLabel:"Command completed in the environment",tone:"sandbox",icon:Mne},delegate_to_codex_sandbox:{name:"delegate_to_codex_sandbox",runningLabel:"Codex Sandbox is running",doneLabel:"Codex Sandbox completed",failedLabel:"Codex Sandbox failed",tone:"sandbox",icon:Mne},image_generate:{name:"image_generate",runningLabel:"Generating image",doneLabel:"Image generated",tone:"image",icon:u_t},video_generate:{name:"video_generate",runningLabel:"Generating video",doneLabel:"Video generated",tone:"video",icon:lq},ppt_generate:{name:"ppt_generate",runningLabel:"Generating presentation",doneLabel:"Presentation generated",tone:"presentation",icon:d_t},load_memory:{name:"load_memory",runningLabel:"Searching long-term memory",doneLabel:"Memory search complete",tone:"memory",icon:f_t},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"Searching the knowledge base",doneLabel:"Knowledge base search complete",tone:"knowledge",icon:h_t},load_skill:{name:"load_skill",runningLabel:"Loading skill",doneLabel:"Skill loaded",tone:"skill",icon:p_t},collect_resources:{name:"collect_resources",runningLabel:"Collecting available resources",doneLabel:"Resource collection complete",failedLabel:"Resource collection failed",tone:"resources",icon:g_t,detailRenderer:kjt},create_agents:{name:"create_agents",runningLabel:"Creating and running agents",doneLabel:"Agent creation complete",failedLabel:"Agent creation failed",tone:"agent",icon:Dne,detailRenderer:Sjt},branch_compare:{name:"branch_compare",runningLabel:"",doneLabel:"",failedLabel:"",tone:"search",icon:Dne,detailRenderer:U_t,hideHeader:!0}};function mq(e){return Ejt[e]}function Cjt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3h8l4 4v14H6Z"}),a.jsx("path",{d:"M14 3v5h5"}),a.jsx("path",{d:"m10 12-2 2 2 2M14 12l2 2-2 2"})]})}function Ajt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M12 3 19 6v5c0 4.6-2.8 7.8-7 10-4.2-2.2-7-5.4-7-10V6l7-3Z"}),a.jsx("path",{d:"m9 12 2 2 4-4"})]})}function Tjt(e,t){const n=new Map(e.map(o=>[o.path,o.content])),i=new Map(t.map(o=>[o.path,o.content])),r=new Set([...n.keys(),...i.keys()]),s=[];for(const o of[...r].sort((l,c)=>l.localeCompare(c))){const l=n.get(o),c=i.get(o);l!==c&&s.push({path:o,status:l===void 0?"added":c===void 0?"deleted":"modified",before:l??"",after:c??""})}return s}function Rb(e){return{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,...e}}function MLe(e){return a.jsx("svg",{...Rb(e),children:a.jsx("path",{d:"m9 7-5 5 5 5M15 7l5 5-5 5M13.5 4l-3 16"})})}function $4(e){return a.jsx("svg",{...Rb(e),children:a.jsx("path",{d:"M6.5 3.75h7l4 4V20.25h-11zM13.5 3.75v4h4M9 12h6M9 15.5h4.5"})})}function _jt(e){return a.jsx("svg",{...Rb(e),children:a.jsx("path",{d:"M3.75 7.25h6l1.75 2h8.75v9.25H3.75zM3.75 7.25V5.5h5l1.5 1.75"})})}function jjt(e){return a.jsx("svg",{...Rb(e),children:a.jsx("path",{d:"m9 5 7 7-7 7"})})}function mT(e){return a.jsx("svg",{...Rb(e),children:a.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function Njt(e){return a.jsxs("svg",{...Rb(e),children:[a.jsx("circle",{cx:"12",cy:"12",r:"3.25"}),a.jsx("path",{d:"M12 2.75v2M12 19.25v2M2.75 12h2M19.25 12h2M5.45 5.45l1.4 1.4M17.15 17.15l1.4 1.4M18.55 5.45l-1.4 1.4M6.85 17.15l-1.4 1.4"})]})}function Rjt(e){return a.jsx("svg",{...Rb(e),children:a.jsx("path",{d:"M19.25 15.25A8 8 0 0 1 8.75 4.75a8 8 0 1 0 10.5 10.5Z"})})}function LLe(e){return a.jsxs("svg",{...Rb(e),children:[a.jsx("path",{d:"M19.25 8.25V4.5l-1.8 1.8a7.5 7.5 0 1 0 1.8 7.65"}),a.jsx("path",{d:"M19.25 4.5H15.5"})]})}const Ijt=p.lazy(()=>Js(()=>Promise.resolve().then(()=>wFe),void 0)),Pjt=p.lazy(()=>Js(()=>import("../chunks/CodeDiffEditor-DA-6OJrJ.js"),[])),$Le="veadk-code-workspace-theme";function Djt(e){const t={name:"",children:new Map};for(const n of e){const i=n.path.split("/").filter(Boolean);let r=t;i.forEach((s,o)=>{let l=r.children.get(s);l||(l={name:s,children:new Map},r.children.set(s,l)),o===i.length-1&&(l.path=n.path),r=l})}return t}function Mjt(e,t=!1){return[...e.children.values()].sort((n,i)=>{const r=n.children.size>0&&n.path===void 0,s=i.children.size>0&&i.path===void 0;return r!==s?t?r?1:-1:r?-1:1:n.name.localeCompare(i.name)})}function Ljt(){if(typeof window>"u")return"light";try{return window.localStorage.getItem($Le)==="dark"?"dark":"light"}catch{return"light"}}function $jt(e){return e===""?0:e.split(` +`||c==="\r")&&(s=!1);continue}if(o){c==="*"&&u==="/"&&(o=!1,l+=1);continue}if(i){r?r=!1:c==="\\"?r=!0:c===i&&(i="");continue}if(c==="/"&&u==="/"){s=!0,l+=1;continue}if(c==="/"&&u==="*"){o=!0,l+=1;continue}if(c==="'"||c==='"'){i=c;continue}const d=e.slice(l).match(n);if(d)return{index:l,openingIndex:l+d[0].lastIndexOf("("),type:d[1]==="LinearGradient"?"linear":"radial"}}}function wTt(e){let t=e,n=0;for(;;){const i=xTt(t,n);if(!i)return t;const r=bTt(t,i.openingIndex),s=t.slice(i.openingIndex+1,r),o=JSON.stringify(vTt(i.type,s));t=`${t.slice(0,i.index)}${o}${t.slice(r+1)}`,n=i.index+o.length}}function HMe(e,t=!1){if(e.length>hTt)throw new Error("ECharts option is too large");const n=wTt(gTt(e));let i;try{i=VMe.parse(n)}catch(o){throw/\bfunction\s*\(|=>/.test(n)?new Error("ECharts function callbacks are not supported"):o}if(!cS(i))throw new Error("ECharts option must be a data object");RI(i);const r={...i};r.aria={...cS(r.aria)?r.aria:{},enabled:!0};const s=r.tooltip;return cS(s)?r.tooltip={...s,renderMode:"richText"}:Array.isArray(s)&&(r.tooltip=s.map(o=>cS(o)?{...o,renderMode:"richText"}:o)),t&&(r.animation=!1),r}let I4;function OTt(){return I4??(I4=Js(()=>import("../visualizations/echarts/index-CGT341lL.js"),[]).catch(e=>{throw I4=void 0,e})),I4}function kTt({source:e}){const{t}=Te("conversation"),n=p.useRef(null),[i,r]=p.useState(!1),[s,o]=p.useState("");return p.useEffect(()=>{let l=!1,c,u,d;r(!1);try{d=HMe(e,window.matchMedia("(prefers-reduced-motion: reduce)").matches),o("")}catch{o("invalid");return}return OTt().then(f=>{const h=n.current;l||!h||(c=f.init(h,void 0,{renderer:"svg"}),c.setOption(d,{notMerge:!0}),typeof ResizeObserver<"u"&&(u=new ResizeObserver(()=>c==null?void 0:c.resize()),u.observe(h)),r(!0))}).catch(()=>{c==null||c.dispose(),c=void 0,l||o("render")}),()=>{l=!0,u==null||u.disconnect(),c==null||c.dispose()}},[e]),a.jsxs("div",{className:`echarts-diagram${s?" echarts-diagram--error":""}`,role:"img","aria-label":t("visualization.echartsAria"),"aria-busy":!i&&!s,children:[a.jsx("div",{ref:n,className:"echarts-diagram__canvas",hidden:!!s}),!i&&!s?a.jsx("div",{className:"echarts-diagram__state","aria-live":"polite",children:a.jsx(hn,{duration:2.2,spread:15,children:t("visualization.rendering")})}):null,s?a.jsx("p",{className:"echarts-diagram__error",role:"alert",children:t(s==="invalid"?"visualization.invalidEcharts":"visualization.renderFailed")}):null]})}const STt=p.memo(kTt);let Ene,Cne=Promise.resolve(),ETt=0;function CTt(){return Ene??(Ene=Js(async()=>{const{default:e}=await import("../visualizations/mermaid/mermaid.core-DAx4nvmm.js").then(t=>t.ay);return{default:e}},__vite__mapDeps([0,1])).then(({default:e})=>(e.initialize({startOnLoad:!1,securityLevel:"strict",suppressErrorRendering:!0,theme:"neutral"}),e))),Ene}function ATt(e){const t=Cne.then(async()=>{const n=await CTt(),i=`mermaid-diagram-${ETt+=1}`;return n.render(i,e)});return Cne=t.then(()=>{},()=>{}),t}function TTt({source:e}){const{t}=Te("conversation"),n=p.useRef(null),[i,r]=p.useState(null),[s,o]=p.useState(!1);return p.useEffect(()=>{let l=!1;return r(null),o(!1),ATt(e).then(c=>{l||r(c)}).catch(()=>{l||o(!0)}),()=>{l=!0}},[e]),p.useEffect(()=>{!(i!=null&&i.bindFunctions)||!n.current||i.bindFunctions(n.current)},[i]),s?a.jsx("div",{className:"mermaid-diagram mermaid-diagram--error",children:a.jsx("p",{className:"mermaid-diagram__error",role:"alert",children:t("visualization.mermaidFailed")})}):i?a.jsx("div",{ref:n,className:"mermaid-diagram",role:"img","aria-label":t("visualization.mermaidAria"),dangerouslySetInnerHTML:{__html:i.svg}}):a.jsx("div",{className:"mermaid-diagram mermaid-diagram--loading","aria-live":"polite",children:a.jsx(hn,{duration:2.2,spread:15,children:t("visualization.rendering")})})}const _Tt=p.memo(TTt),jTt="_SegmentedControl_1sl7d_1",NTt="_SegmentedControlOption_1sl7d_140",RTt="_SegmentedControlThumb_1sl7d_219",r9={SegmentedControl:jTt,SegmentedControlOption:NTt,SegmentedControlThumb:RTt},cd=({value:e,onChange:t,children:n,block:i,pill:r=!0,size:s="md",gutterSize:o,className:l,onClick:c,...u})=>{const d=p.useRef(null),f=p.useRef(null),h=p.useCallback(g=>{const b=d.current,v=f.current;if(!b||!v)return;const y=b==null?void 0:b.querySelector('[data-state="on"]');if(!y)return;const w=b.clientWidth;let x=Math.floor(y.clientWidth);const O=y.offsetLeft;if(w-(x+O)<2&&(x=x-1),v.style.width=`${Math.floor(x)}px`,v.style.transform=`translateX(${O}px)`,b.scrollWidth>w){const k=w*.15,S=b.scrollLeft,C=y.offsetLeft,E=C+x;(CS+w-k)&&g&&y.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"})}},[]);nNe({ref:d,onResize:()=>{const g=f.current;if(!g)return;const b=g.style.transition;g.style.transition="",h(!1),g.style.transition=b}}),p.useLayoutEffect(()=>{const g=d.current,b=f.current;!g||!b||(h(!!b.style.transition),b.style.transition||hI(()=>{b.style.transition="width 300ms var(--cubic-enter), transform 300ms var(--cubic-enter)"}))},[h,e,s,o,r]);const m=g=>{g&&t&&t(g)};return a.jsxs(xft,{ref:d,className:Qi(r9.SegmentedControl,l),type:"single",value:e,loop:!1,onValueChange:m,onClick:c,"data-block":i?"":void 0,"data-pill":r?"":void 0,"data-size":s,"data-gutter-size":o,...u,children:[a.jsx("div",{className:r9.SegmentedControlThumb,ref:f}),n]})},ITt=({children:e,...t})=>a.jsx(Eft,{className:r9.SegmentedControlOption,...t,onPointerEnter:kV,children:a.jsx("span",{className:"relative",children:e})});cd.Option=ITt;function PTt({children:e,label:t,language:n,source:i,streaming:r=!1}){const{t:s}=Te("conversation"),[o,l]=p.useState("preview"),c=r?"code":o;return a.jsxs("section",{className:"visualization-card","aria-label":s("visualization.cardAria",{label:t}),children:[a.jsx("div",{className:"visualization-card__toolbar",children:a.jsxs(cd,{className:"visualization-card__tabs",value:c,size:"sm",gutterSize:"sm",pill:!1,"aria-label":s("visualization.viewAria",{label:t}),onChange:u=>{r||l(u)},children:[a.jsx(cd.Option,{value:"preview",disabled:r,children:s("visualization.preview")}),a.jsx(cd.Option,{value:"code",children:s("visualization.code")})]})}),a.jsx("div",{className:"visualization-card__body",children:c==="code"?a.jsx("pre",{className:"visualization-card__code",children:a.jsx("code",{className:`language-${n}`,children:i})}):e})]})}const DTt=p.memo(PTt);function qMe(e){const t=e==null?void 0:e.trim().toLowerCase();if(t==="mermaid")return"mermaid";if(t==="echart"||t==="echarts")return"echarts"}const WMe=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function s9(e){return typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(s9).join(""):p.isValidElement(e)?s9(e.props.children):""}function MTt(e){var i;const t=p.Children.toArray(e)[0];if(!p.isValidElement(t))return;const n=(i=t.props.className)==null?void 0:i.split(/\s+/).find(r=>r.startsWith("language-"));return qMe(n==null?void 0:n.slice(9))}function KMe(e){if(!e)return!1;try{const t=e.toLowerCase();return WMe.some(n=>t.includes(n))}catch{return!1}}function LTt(e){var i;const t=(i=e==null?void 0:e.properties)==null?void 0:i.href;if(!t)return!1;if(KMe(t))return!0;const n=e==null?void 0:e.children;if(n&&Array.isArray(n)){const r=n.map(s=>(s==null?void 0:s.value)||"").join("").toLowerCase();return WMe.some(s=>r.includes(s))}return!1}function $Tt({text:e,className:t,allowRawHtml:n=!0,streaming:i=!1}){const{t:r}=Te("conversation"),s=p.useContext(Aje),[o,l]=p.useState(null),c=(f,h)=>{if(f.src)return f.src;if(h){const m=b=>{var v;if(!b)return null;if(b.type==="source"&&((v=b.properties)!=null&&v.src))return b.properties.src;if(b.children)for(const y of b.children){const w=m(y);if(w)return w}return null},g=m({children:h});if(g)return g}return""},u=f=>{try{const m=new URL(f).pathname.split("/");return m[m.length-1]||"video.mp4"}catch{return"video.mp4"}},d=f=>f?Array.isArray(f)?f.map(h=>(h==null?void 0:h.value)||"").join("")||"video":(f==null?void 0:f.value)||"video":"video";return a.jsxs("div",{className:t?`md ${t}`:"md",children:[a.jsx(qPe,{disallowedElements:s?["file-card","personal-drive-enable-card"]:void 0,remarkPlugins:[bDe],rehypePlugins:n?[JAt,sne]:[sne],components:{pre:({node:f,children:h,...m})=>{const g=MTt(h);if(g==="mermaid"||g==="echarts"){const b=s9(h).replace(/\n$/,"");return a.jsx(DTt,{label:g==="mermaid"?"Mermaid":"ECharts",language:g,source:b,streaming:i,children:g==="mermaid"?a.jsx(_Tt,{source:b}):a.jsx(STt,{source:b})})}return a.jsx("pre",{...m,children:h})},a:({node:f,...h})=>{const m=h.href,g=s&&zst(m);if(g)return a.jsx(Vst,{...s,path:g,children:h.children});if(m&&(KMe(m)||LTt(f))){const b=m,v=d(f==null?void 0:f.children);return a.jsxs("div",{className:"video-container",children:[a.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":r("markdown.playVideo",{name:v}),onClick:()=>l({src:b,title:v}),children:[a.jsx("video",{src:b,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),a.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:a.jsx(ZS,{})})]}),a.jsx("div",{className:"video-caption",children:a.jsx("a",{href:b,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:v})})]})}return a.jsx("a",{...h,target:"_blank",rel:"noopener noreferrer"})},img:({node:f,src:h,alt:m,...g})=>{const b=a.jsx("img",{...g,src:h,alt:m??"",loading:"lazy"});return h?a.jsx(MAe,{src:h,children:a.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":r("markdown.enlargeImage",{name:m||r("markdown.image")}),children:[b,a.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:a.jsx(ZS,{})})]})}):b},video:({node:f,src:h,children:m,...g})=>{const b=c({src:h},m);return b?a.jsx("div",{className:"video-container",children:a.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":r("markdown.enlargeVideo"),onClick:()=>l({src:b}),children:[a.jsx("video",{src:b,...g,playsInline:!0,className:"video-thumbnail",children:m}),a.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:a.jsx(ZS,{})})]})}):a.jsx("video",{src:h,controls:!0,playsInline:!0,className:"video-inline",...g,children:m})}},children:e}),o&&a.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":r("markdown.videoPreview"),onClick:()=>l(null),children:a.jsxs("div",{className:"video-viewer",onClick:f=>f.stopPropagation(),children:[a.jsxs("div",{className:"video-viewer-header",children:[a.jsx("div",{className:"video-viewer-title",children:o.title||u(o.src)}),a.jsxs("nav",{className:"video-viewer-nav",children:[a.jsx("a",{href:o.src,download:o.title||u(o.src),"aria-label":r("markdown.downloadVideo"),title:r("markdown.downloadVideo"),className:"video-viewer-download",children:a.jsx(eM,{})}),a.jsx("button",{type:"button",className:"video-viewer-close","aria-label":r("markdown.close"),onClick:()=>l(null),children:a.jsx(Mo,{})})]})]}),a.jsx("div",{className:"video-viewer-body",children:a.jsx("video",{src:o.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const _d=p.memo($Tt);function P4(e){return(e==null?void 0:e.trim())||_b("resourceMetadata.unknownSource")}function GMe(e){return(e==null?void 0:e.trim())||_b("resourceMetadata.unknownCreator")}function FTt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5 5.5A2.5 2.5 0 0 1 7.5 3H19v16H7.5A2.5 2.5 0 0 0 5 21.5v-16Z"}),a.jsx("path",{d:"M5 18.5A2.5 2.5 0 0 1 7.5 16H19"}),a.jsx("path",{d:"M9 7h6M9 10h4"})]})}function BTt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3h8l4 4v14H6V3Z"}),a.jsx("path",{d:"M14 3v5h5M9 12h6M9 16h6"})]})}function UTt(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m7 7 10 10M17 7 7 17"})})}function QTt(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 5v14M5 12h14"})})}function hT({title:e,children:t,onClose:n,busy:i=!1,className:r=""}){const{t:s}=Te("ui"),o=p.useId(),l=p.useRef(null),c=p.useRef(null),u=p.useRef(i),d=p.useRef(n);return p.useEffect(()=>{u.current=i,d.current=n},[i,n]),p.useEffect(()=>{var g;const f=document.activeElement instanceof HTMLElement?document.activeElement:null,h=document.body.style.overflow;document.body.style.overflow="hidden",(g=l.current)==null||g.focus();const m=b=>{if(b.key==="Escape"&&!u.current){d.current();return}if(b.key!=="Tab")return;const v=c.current;if(!v)return;const y=Array.from(v.querySelectorAll('button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), a[href], audio[controls], video[controls], iframe, [tabindex]:not([tabindex="-1"])')).filter(O=>O.getClientRects().length>0);if(y.length===0){b.preventDefault();return}const w=y[0],x=y[y.length-1];b.shiftKey&&(document.activeElement===w||!v.contains(document.activeElement))?(b.preventDefault(),x.focus()):!b.shiftKey&&(document.activeElement===x||!v.contains(document.activeElement))&&(b.preventDefault(),w.focus())};return window.addEventListener("keydown",m),()=>{window.removeEventListener("keydown",m),document.body.style.overflow=h,f!=null&&f.isConnected&&f.focus()}},[]),vi.createPortal(a.jsx("div",{className:"knowledge-dialog-backdrop",onMouseDown:f=>{f.target===f.currentTarget&&!i&&n()},children:a.jsxs("section",{ref:c,className:`knowledge-dialog${r?` ${r}`:""}`,role:"dialog","aria-modal":"true","aria-labelledby":o,"aria-busy":i||void 0,children:[a.jsxs("header",{className:"knowledge-dialog__header",children:[a.jsx("h2",{id:o,children:e}),a.jsx("button",{ref:l,type:"button",onClick:n,disabled:i,"aria-label":s("common.close"),children:a.jsx(UTt,{})})]}),t]})}),document.body)}function OC({message:e}){return e?a.jsx("div",{className:"knowledge-form-error",role:"alert",children:e}):null}function a9(e){return e instanceof DOMException&&e.name==="AbortError"}function zTt(e,t){if(!e)return"";const n=Date.parse(e);return Number.isFinite(n)?new Intl.DateTimeFormat(t,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(n):e}const XMe=[".jpg",".jpeg",".png"].join(","),VTt=new Set(XMe.split(",")),YMe=[".pdf",".pptx",".docx",".xlsx",".txt"].join(","),HTt=new Set(YMe.split(",")),qTt=200*1024*1024;function o9(e){const t=e.lastIndexOf(".");return t<0?"":e.slice(t).toLocaleLowerCase()}function WTt(e,t,n){return e.size>qTt?n("knowledge.errors.fileTooLarge"):t==="image"?VTt.has(o9(e.name))?"":n("knowledge.errors.invalidImageType"):HTt.has(o9(e.name))?"":n("knowledge.errors.invalidDocumentType")}function aq(e){return e<=0?"-":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function l9(e){var r;const t=e.type.trim().replace(/^\./,"");if(t)return t.toUpperCase();const n=e.name.trim(),i=n.includes(".")?(r=n.split(".").pop())==null?void 0:r.trim():"";return i?i.toUpperCase():"-"}function KTt({region:e,onClose:t,onCreated:n}){const{t:i}=Te("ui"),[r,s]=p.useState(""),[o,l]=p.useState(""),[c,u]=p.useState(!1),[d,f]=p.useState(!1),[h,m]=p.useState(""),g=r.trim(),b=!!(g&&!/^[A-Za-z][A-Za-z0-9_]{0,47}$/.test(g)),v=async y=>{if(y.preventDefault(),u(!0),!g||b)return;f(!0),m("");const w={name:g,description:o.trim()||void 0,region:e};try{n(await jbt(w))}catch(x){m(Al(x,i("knowledge.errors.createBase")))}finally{f(!1)}};return a.jsx(hT,{title:i("knowledge.createBase"),onClose:t,busy:d,children:a.jsxs("form",{onSubmit:y=>void v(y),children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:i("common.name")}),a.jsx("input",{autoFocus:!0,value:r,maxLength:48,"aria-invalid":c&&b||void 0,"aria-describedby":"knowledge-name-help",onBlur:()=>u(!0),onChange:y=>s(y.target.value)})]}),a.jsx("p",{id:"knowledge-name-help",className:`knowledge-dialog__note${c&&b?" is-error":""}`,role:c&&b?"alert":void 0,children:i(c&&b?"knowledge.invalidName":"knowledge.nameHelp")}),a.jsxs("label",{children:[a.jsx("span",{children:i("knowledge.optionalDescription")}),a.jsx("textarea",{value:o,maxLength:80,onChange:y=>l(y.target.value)})]}),a.jsx(OC,{message:h})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:t,disabled:d,children:i("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:d||!g||b,children:i(d?"common.creating":"common.create")})]})]})})}function GTt({item:e,onClose:t,onUpdated:n}){const{t:i}=Te("ui"),[r,s]=p.useState(e.description),[o,l]=p.useState(!1),[c,u]=p.useState(""),d=async f=>{f.preventDefault(),l(!0),u("");try{n(await Nbt(e.id,e.region,{description:r.trim()}))}catch(h){u(Al(h,i("knowledge.errors.updateBase")))}finally{l(!1)}};return a.jsx(hT,{title:i("knowledge.editBase"),onClose:t,busy:o,children:a.jsxs("form",{onSubmit:f=>void d(f),children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:i("common.name")}),a.jsx("input",{value:e.name,disabled:!0})]}),a.jsxs("label",{children:[a.jsx("span",{children:i("common.description")}),a.jsx("textarea",{autoFocus:!0,value:r,maxLength:80,onChange:f=>s(f.target.value)})]}),a.jsx("p",{className:"knowledge-dialog__note",children:i("knowledge.descriptionOnly")}),a.jsx(OC,{message:c})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:t,disabled:o,children:i("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:o,children:i(o?"common.saving":"common.save")})]})]})})}function ZMe(e,t){if(!e.trim())return{};const n=JSON.parse(e);if(!n||Array.isArray(n)||typeof n!="object")throw new Error(t);return n}function XTt({base:e,onClose:t,onCreated:n,onAssociationInvalid:i}){const{t:r}=Te("ui"),[s,o]=p.useState("document"),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(""),[m,g]=p.useState(null),[b,v]=p.useState(!1),[y,w]=p.useState("{}"),[x,O]=p.useState(""),[k,S]=p.useState(""),[C,E]=p.useState(null),j=p.useRef(null),T=p.useRef(null),R=p.useRef(null),A=p.useRef(0),N=!!x;p.useEffect(()=>{var L;C&&!N&&((L=R.current)==null||L.focus())},[N,C]);const P=L=>{N||L===s||(o(L),g(null),h(""),c(""),d(""),S(""),E(null),v(!1),A.current=0,j.current&&(j.current.value=""))},I=L=>{if(!L||s==="web")return;const F=WTt(L,s,r);if(F){g(null),c(""),d(""),S(F);return}g(L),S(""),c(L.name.replace(/\.[^.]+$/,"")),d(o9(L.name).slice(1))},D=async L=>{if(L.preventDefault(),s==="web"?!f.trim():!m)return;let F;try{F=ZMe(y,r("knowledge.errors.metadataObject"))}catch(M){S(Al(M,r("knowledge.errors.metadataFormat")));return}O(s==="web"?C?"save":"preview":"upload"),S("");try{if(s==="web")if(C){const M={sourceType:"url",metadata:C.metadata,url:C.preview.url,sourceTitle:C.preview.name,sourceMarkdown:C.preview.sourceMarkdown};await Dbt(e.id,e.region,M),n()}else{const M=await Mbt(e.id,e.region,{url:f.trim()});if(!M.sourceMarkdown.trim())throw new Error(r("knowledge.errors.noWebPreview"));E({preview:M,metadata:F})}else m&&(await Lbt(e.id,e.region,{file:m,name:l.trim()||void 0,documentType:u.trim()||void 0,metadata:F}),n())}catch(M){M instanceof gM&&M.errorCode===sPe?i(M):S(Al(M,r(s==="web"?C?"knowledge.errors.addWeb":"knowledge.errors.previewWeb":"knowledge.errors.uploadFile")))}finally{O("")}},_=()=>{N||(E(null),S(""),requestAnimationFrame(()=>{var L;return(L=T.current)==null?void 0:L.focus()}))};return a.jsx(hT,{title:r(C?"knowledge.previewWeb":"knowledge.addData"),onClose:t,busy:N,className:C?"knowledge-dialog--preview knowledge-dialog--web-confirm":"",children:a.jsx("form",{onSubmit:L=>void D(L),children:C?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"knowledge-preview knowledge-web-preview",children:[a.jsxs("div",{className:"knowledge-preview__meta",children:[a.jsx("strong",{title:C.preview.name,children:C.preview.name}),a.jsx("a",{href:C.preview.url,target:"_blank",rel:"noopener noreferrer",children:r("knowledge.openOriginalWeb")})]}),a.jsx("div",{className:"knowledge-preview__body","aria-live":"polite",children:a.jsx("div",{className:"knowledge-preview__markdown-shell",children:a.jsx(_d,{text:C.preview.sourceMarkdown,allowRawHtml:!1,className:"knowledge-preview__markdown"})})}),k?a.jsx("div",{className:"knowledge-web-preview__error",children:a.jsx(OC,{message:k})}):null]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",className:"is-back",onClick:_,disabled:N,children:r("knowledge.backToEdit")}),a.jsx("button",{type:"button",onClick:t,disabled:N,children:r("common.cancel")}),a.jsx("button",{ref:R,type:"submit",className:"is-primary",disabled:N,children:r(x==="save"?"common.adding":"knowledge.confirmAdd")})]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsx("div",{className:"knowledge-source-tabs",role:"tablist","aria-label":r("knowledge.source"),children:[["image",r("knowledge.image")],["document",r("knowledge.documentFile")],["web",r("knowledge.webPage")]].map(([L,F])=>a.jsx("button",{type:"button",role:"tab",id:`knowledge-source-${L}-tab`,"aria-controls":`knowledge-source-${L}-panel`,"aria-selected":s===L,tabIndex:s===L?0:-1,className:s===L?"is-active":"",disabled:N,onClick:()=>P(L),onKeyDown:M=>{const z=["image","document","web"];if(!["ArrowLeft","ArrowRight","Home","End"].includes(M.key))return;M.preventDefault();const q=z.indexOf(L),U=M.key==="Home"?z[0]:M.key==="End"?z[z.length-1]:z[(q+(M.key==="ArrowRight"?1:-1)+z.length)%z.length];P(U),requestAnimationFrame(()=>{var J;return(J=document.getElementById(`knowledge-source-${U}-tab`))==null?void 0:J.focus()})},children:F},L))}),a.jsx("div",{id:`knowledge-source-${s}-panel`,className:"knowledge-source-panel",role:"tabpanel","aria-labelledby":`knowledge-source-${s}-tab`,children:s==="web"?a.jsxs(a.Fragment,{children:[a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.webUrl")}),a.jsx("input",{ref:T,autoFocus:!0,type:"url",value:f,disabled:N,onChange:L=>{h(L.target.value),S("")},placeholder:"https://example.com/article"})]}),a.jsx("div",{className:"knowledge-upload-status",role:"status","aria-live":"polite",children:x==="preview"?a.jsx(hn,{children:r("knowledge.generatingWebPreview")}):null})]}):a.jsxs(a.Fragment,{children:[a.jsx("input",{ref:j,className:"knowledge-upload-input",type:"file","aria-label":r("knowledge.selectFile"),accept:s==="image"?XMe:YMe,disabled:N,onChange:L=>{var F;I(((F=L.currentTarget.files)==null?void 0:F[0])??null),L.currentTarget.value=""}}),a.jsxs("button",{type:"button",className:`knowledge-upload-dropzone${b?" is-dragging":""}${m?" is-ready":""}`,disabled:N,onClick:()=>{var L;return(L=j.current)==null?void 0:L.click()},onDragEnter:L=>{L.preventDefault(),!N&&(A.current+=1,v(!0))},onDragOver:L=>{L.preventDefault(),N||(L.dataTransfer.dropEffect="copy")},onDragLeave:L=>{L.preventDefault(),A.current=Math.max(0,A.current-1),A.current===0&&v(!1)},onDrop:L=>{var F;L.preventDefault(),A.current=0,v(!1),N||I(((F=L.dataTransfer.files)==null?void 0:F[0])??null)},children:[a.jsx("strong",{children:m?m.name:r("knowledge.selectOrDropFile")}),a.jsx("span",{children:m?r("knowledge.selectedFile",{size:aq(m.size)}):r(s==="image"?"knowledge.imageFileHelp":"knowledge.documentFileHelp")})]}),a.jsx("div",{className:"knowledge-upload-status",role:"status","aria-live":"polite",children:N?a.jsx(hn,{children:r("knowledge.uploadingFile")}):null})]})}),s!=="web"?a.jsxs("div",{className:"knowledge-dialog__fields",children:[a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.optionalName")}),a.jsx("input",{value:l,disabled:N,maxLength:256,onChange:L=>c(L.target.value)})]}),a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.optionalType")}),a.jsx("input",{value:u,disabled:N,maxLength:64,onChange:L=>d(L.target.value),placeholder:"pdf, docx, png"})]})]}):null,a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.metadataJson")}),a.jsx("textarea",{className:"is-code",value:y,disabled:N,onChange:L=>w(L.target.value),spellCheck:!1})]}),a.jsx(OC,{message:k})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:t,disabled:N,children:r("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:N||(s==="web"?!f.trim():!m),children:r(N?s==="web"?"common.generating":"common.uploading":s==="web"?"knowledge.generatePreview":"knowledge.uploadFile")})]})]})})})}function YTt({base:e,item:t,onClose:n,onUpdated:i}){const{t:r}=Te("ui"),[s,o]=p.useState(()=>JSON.stringify(t.metadata??{},null,2)),[l,c]=p.useState(!1),[u,d]=p.useState(""),f=async h=>{h.preventDefault();let m;try{m=ZMe(s,r("knowledge.errors.metadataObject"))}catch(g){d(Al(g,r("knowledge.errors.metadataFormat")));return}c(!0),d("");try{i(await $bt(e.id,t.id,e.region,{metadata:m}))}catch(g){d(Al(g,r("knowledge.errors.updateDocument")))}finally{c(!1)}};return a.jsx(hT,{title:r("knowledge.editMetadata"),onClose:n,busy:l,children:a.jsxs("form",{onSubmit:h=>void f(h),children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.knowledge")}),a.jsx("input",{value:t.name||t.id,disabled:!0})]}),a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.metadataJson")}),a.jsx("textarea",{autoFocus:!0,className:"is-code knowledge-metadata-editor",value:s,onChange:h=>o(h.target.value),spellCheck:!1})]}),a.jsx(OC,{message:u})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:n,disabled:l,children:r("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:l,children:r(l?"common.saving":"common.save")})]})]})})}const JMe=new Set(["avif","bmp","gif","jpeg","jpg","png","svg","webp"]),eLe=new Set(["aac","flac","m4a","mp3","ogg","wav","webm"]),tLe=new Set(["m4v","mov","mp4","mpeg","mpg","ogg","webm"]),ZTt=new Set(["pdf"]),JTt=new Set(["doc","docx","ppt","pptx","xls","xlsx"]),e2t=new Set(["creating","indexing","pending","processing","queued","submitted"]),t2t=new Set(["error","failed","unavailable"]);function Ane(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}}function __(e){if(e==null||e==="")return"-";if(["string","number","boolean"].includes(typeof e))return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function n2t(e,t){if(Array.isArray(e)){if(e.length===0)return null;const r=e.map(Ane);if(r.some(s=>Object.keys(s).length>0)){const s=[...new Set(r.flatMap(o=>Object.keys(o)))];return{columns:s,rows:r.map(o=>s.map(l=>__(o[l])))}}return{columns:[t("knowledge.value")],rows:e.map(s=>[__(s)])}}const n=Ane(e),i=Object.entries(n);if(i.length===0)return null;if(i.every(([,r])=>Array.isArray(r))){const r=i.map(([o])=>o),s=Math.max(...i.map(([,o])=>o.length));return{columns:r,rows:Array.from({length:s},(o,l)=>i.map(([,c])=>__(c[l])))}}return{columns:[t("knowledge.field"),t("knowledge.value")],rows:i.map(([r,s])=>[r,__(s)])}}function nLe(e){const t=e.trim();if(!t||t.startsWith("//"))return"";if(t.startsWith("/"))return t;try{const n=new URL(t);return["http:","https:"].includes(n.protocol)?n.href:""}catch{return""}}function i2t(e){const t=nLe(e);return t.startsWith("http://")||t.startsWith("https://")?t:""}function r2t(e){var r;const t=e.attachmentType.trim().toLocaleLowerCase();if(t==="image"||t==="doc-image"||t.startsWith("image/"))return"image";if(t==="audio"||t.startsWith("audio/"))return"audio";if(t==="video"||t.startsWith("video/"))return"video";if(t==="pdf"||t==="application/pdf")return"pdf";const n=e.attachmentUrl.split(/[?#]/,1)[0],i=n.includes(".")?((r=n.split(".").pop())==null?void 0:r.toLocaleLowerCase())??"":"";return JMe.has(i)?"image":eLe.has(i)?"audio":tLe.has(i)?"video":ZTt.has(i)?"pdf":t||i?"file":"none"}function s2t(e,t){const n=e.status.trim().toLocaleLowerCase();if(e2t.has(n))return{title:t("knowledge.preview.processingTitle"),detail:t("knowledge.preview.processingDetail")};if(t2t.has(n))return{title:t("knowledge.preview.failedTitle"),detail:t("knowledge.preview.failedDetail")};const i=l9(e).toLocaleLowerCase();return i==="pdf"||JTt.has(i)?{title:t("knowledge.preview.noParsedTitle"),detail:t("knowledge.preview.noParsedDetail")}:JMe.has(i)||eLe.has(i)||tLe.has(i)?{title:t("knowledge.preview.noMediaTitle"),detail:t("knowledge.preview.noMediaDetail")}:{title:t("knowledge.preview.noDataTitle"),detail:t("knowledge.preview.noDataDetail")}}function a2t({chunk:e}){const{t}=Te("ui"),[n,i]=p.useState(!1),r=nLe(e.attachmentUrl),s=r2t(e);return!r||s==="none"?null:n?a.jsx("div",{className:"knowledge-preview__attachment-error",children:t("knowledge.preview.attachmentError")}):s==="image"?a.jsx("img",{className:"knowledge-preview__image",src:r,alt:e.title||t("knowledge.preview.imageAlt"),loading:"lazy",onError:()=>i(!0)}):s==="audio"?a.jsx("audio",{className:"knowledge-preview__audio",src:r,controls:!0,preload:"metadata",onError:()=>i(!0),children:t("knowledge.preview.audioUnsupported")}):s==="video"?a.jsx("video",{className:"knowledge-preview__video",src:r,controls:!0,playsInline:!0,preload:"metadata",onError:()=>i(!0),children:t("knowledge.preview.videoUnsupported")}):s==="pdf"?a.jsxs("div",{className:"knowledge-preview__pdf",children:[a.jsx("iframe",{src:r,title:e.title?t("knowledge.preview.namedPdf",{name:e.title}):t("knowledge.preview.pdf"),sandbox:"",referrerPolicy:"no-referrer",onError:()=>i(!0)}),a.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:t("knowledge.preview.openPdf")})]}):a.jsxs("div",{className:"knowledge-preview__file-fallback",children:[a.jsx("p",{children:t("knowledge.preview.fileUnsupported")}),a.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:t("knowledge.preview.openOriginalFile")})]})}function o2t({base:e,item:t,onClose:n}){const{t:i}=Te("ui"),[r,s]=p.useState([]),[o,l]=p.useState(t),[c,u]=p.useState(""),[d,f]=p.useState(!0),[h,m]=p.useState(!1),[g,b]=p.useState(!1),[v,y]=p.useState(""),w=p.useRef(0),x=p.useRef(null),O=p.useCallback(async(E=0)=>{var R;(R=x.current)==null||R.abort();const j=new AbortController;x.current=j;const T=w.current+1;w.current=T,E>0?m(!0):f(!0),y(""),E===0&&(s([]),b(!1));try{const A=await Pbt(e.id,t.id,{region:e.region,offset:E,signal:j.signal});if(w.current!==T)return;l(A.document.id?A.document:t),u(A.sourceMarkdown||A.document.sourceMarkdown),s(N=>E>0?[...N,...A.chunks]:A.chunks),b(A.hasMore)}catch(A){!a9(A)&&w.current===T&&y(Al(A,i("knowledge.errors.loadPreview")))}finally{w.current===T&&(f(!1),m(!1))}},[e.id,e.region,t,i]);p.useEffect(()=>(O(),()=>{var E;(E=x.current)==null||E.abort(),w.current+=1}),[O]);const k=i2t(o.url||t.url),S=s2t(o,i),C=o.metadata._veadk_content_format==="markdown";return a.jsx(hT,{title:o.name||t.name||t.id,onClose:n,className:"knowledge-dialog--preview",children:a.jsxs("div",{className:"knowledge-preview",children:[o.sizeBytes>0||k?a.jsxs("div",{className:"knowledge-preview__meta",children:[o.sizeBytes>0?a.jsx("span",{children:aq(o.sizeBytes)}):null,k?a.jsx("a",{href:k,target:"_blank",rel:"noopener noreferrer",children:i("knowledge.openOriginalWeb")}):null]}):null,a.jsx("div",{className:"knowledge-preview__body","aria-live":"polite",children:c?a.jsx("div",{className:"knowledge-preview__markdown-shell",children:a.jsx(_d,{text:c,allowRawHtml:!1,className:"knowledge-preview__markdown"})}):d?a.jsx("div",{className:"knowledge-preview__state",role:"status",children:a.jsx(hn,{as:"span",duration:2.4,children:i("knowledge.preview.loading")})}):v&&r.length===0?a.jsxs("div",{className:"knowledge-preview__state is-error",role:"alert",children:[a.jsx("p",{children:v}),a.jsx("button",{type:"button",onClick:()=>void O(),children:i("common.retry")})]}):r.length===0?a.jsxs("div",{className:"knowledge-preview__state",children:[a.jsx("p",{children:S.title}),a.jsx("span",{children:k?i("knowledge.preview.openOriginalHint"):S.detail}),a.jsx("button",{type:"button",onClick:()=>void O(),children:i("common.reload")})]}):a.jsxs("div",{className:"knowledge-preview__chunks",children:[r.map((E,j)=>{const T=n2t(E.tableFields,i),R=E.id||`${j}:${E.title}`;return a.jsxs("article",{className:"knowledge-preview__chunk",children:[a.jsx("header",{children:a.jsx("h3",{children:E.title||i("knowledge.preview.chunk",{index:j+1})})}),E.content?C?a.jsx(_d,{text:E.content,allowRawHtml:!1,className:"knowledge-preview__markdown"}):a.jsx("p",{className:"knowledge-preview__content",children:E.content}):null,T?a.jsx("div",{className:"knowledge-preview__table-wrap",children:a.jsxs("table",{children:[a.jsx("thead",{children:a.jsx("tr",{children:T.columns.map((A,N)=>a.jsx("th",{scope:"col",children:A},`${A}:${N}`))})}),a.jsx("tbody",{children:T.rows.map((A,N)=>a.jsx("tr",{children:A.map((P,I)=>a.jsx("td",{children:P},I))},N))})]})}):null,a.jsx(a2t,{chunk:E})]},R)}),v?a.jsx("div",{className:"knowledge-preview__more-error",role:"alert",children:v}):null,g?a.jsx("button",{type:"button",className:"knowledge-preview__load-more",disabled:h,onClick:()=>void O(r.length),children:h?a.jsx(hn,{as:"span",duration:2.4,children:i("knowledge.preview.loadingMore")}):i("knowledge.preview.loadMore")}):null]})})]})})}function l2t({cloudProvider:e,region:t,active:n=!0,activationRevision:i=0,onDetailChange:r,toolbarLeading:s,toolbarFilters:o}){const{t:l,i18n:c}=Te("ui"),[u,d]=p.useState([]),[f,h]=p.useState({}),[m,g]=p.useState([]),[b,v]=p.useState(""),[y,w]=p.useState("overview"),[x,O]=p.useState(""),[k,S]=p.useState(""),[C,E]=p.useState(!0),[j,T]=p.useState(!1),[R,A]=p.useState(""),[N,P]=p.useState([]),[I,D]=p.useState(!1),[_,L]=p.useState(""),[F,M]=p.useState(""),[z,q]=p.useState(""),[U,J]=p.useState(!1),[V,Z]=p.useState(!1),[ne,W]=p.useState(!1),[G,H]=p.useState(null),[se,Y]=p.useState(null),[X,ie]=p.useState(null),[ee,be]=p.useState(null),[ue,pe]=p.useState(null),[ke,je]=p.useState(!1),Pe=p.useRef(0),Ee=p.useRef(0),Qe=p.useRef([]),_e=p.useRef(!1),ae=p.useRef(!1),le=p.useRef(null),ge=p.useRef(null),Oe=p.useRef({}),Se=p.useRef(!1),qe=p.useRef(null),Xe=p.useRef(null),ye=p.useRef(null),we=p.useRef(null),Ae=p.useMemo(()=>[t],[t]),Ve=p.useCallback(We=>`${We.region}\0${We.id}`,[]),Be=u.find(We=>Ve(We)===b)??null,_t=!!(Be&&z===Ve(Be));p.useEffect(()=>{r==null||r(!!Be)},[r,Be]),p.useEffect(()=>{w("overview"),S("")},[b]);const Pt=p.useMemo(()=>{const We=x.trim().toLocaleLowerCase();return We?u.filter(kt=>[kt.name,kt.description,kt.ownerLabel,kt.providerKnowledgeId].some(He=>He.toLocaleLowerCase().includes(We))):u},[u,x]),Kt=p.useMemo(()=>{const We=k.trim().toLocaleLowerCase();return We?N.filter(kt=>[kt.name,kt.id,l9(kt)].some(He=>He.toLocaleLowerCase().includes(We))):N},[k,N]);p.useEffect(()=>{Y(null)},[Be==null?void 0:Be.id,Be==null?void 0:Be.region]);const Et=p.useCallback(async(We=!1)=>{var nt;if(We&&(Se.current||Object.keys(Oe.current).length===0))return;(nt=le.current)==null||nt.abort();const kt=new AbortController;le.current=kt;const He=Pe.current+1;Pe.current=He,Se.current=!0,We?T(!0):E(!0),A(""),We||g([]);try{const et=await _bt({regions:Ae,nextTokens:We?Oe.current:void 0,signal:kt.signal});if(Pe.current!==He)return;d(St=>We?[...St,...et.items.filter(Ct=>!St.some(It=>Ve(It)===Ve(Ct)))]:et.items),Oe.current=et.nextTokens,h(et.nextTokens);const ft=et.failures.map(({region:St,error:Ct})=>`${xh(St,e)}: ${Al(Ct,l("common.loadFailed"))}`);g(St=>We?[...new Set([...St,...ft])]:ft),We||v(St=>et.items.some(Ct=>Ve(Ct)===St)?St:"")}catch(et){if(a9(et))return;Pe.current===He&&(We?g(ft=>[...new Set([...ft,Al(et,l("knowledge.errors.loadMoreBases"))])]):A(Al(et,l("knowledge.errors.loadBases"))))}finally{Pe.current===He&&(Se.current=!1,E(!1),T(!1))}},[Ve,e,Ae,l]),vt=p.useCallback(async(We,kt=!1)=>{var et;if(kt&&_e.current)return;(et=ge.current)==null||et.abort();const He=new AbortController;ge.current=He;const nt=Ee.current+1;Ee.current=nt,kt||(Qe.current=[],ae.current=!1,P([]),J(!1),M("")),_e.current=!0,D(!0),kt?M(""):L("");try{const ft=await Ibt(We.id,{region:We.region,offset:kt?Qe.current.length:0,signal:He.signal});if(Ee.current!==nt)return;q(Gt=>Gt===Ve(We)?"":Gt);const St=Qe.current,Ct=kt?[...St,...ft.items.filter(Gt=>!Gt.id||!St.some(Ge=>Ge.id===Gt.id))]:ft.items,It=ft.hasMore&&(!kt||Ct.length>St.length);Qe.current=Ct,ae.current=It,P(Ct),J(It)}catch(ft){if(a9(ft))return;Ee.current===nt&&(ft instanceof gM&&ft.errorCode===sPe&&(q(Ve(We)),H(Ct=>Ct&&Ve(Ct)===Ve(We)?null:Ct)),kt?M(Al(ft,l("knowledge.errors.loadMoreData"))):L(Al(ft,l("knowledge.errors.loadData"))))}finally{Ee.current===nt&&(_e.current=!1,D(!1))}},[Ve,l]);p.useEffect(()=>{var We;(We=le.current)==null||We.abort(),Pe.current+=1,Se.current=!1,Oe.current={},d([]),h({}),g([]),v(""),q(""),A(""),E(!0)},[e]),p.useEffect(()=>{if(n)return Et(),()=>{var We;(We=le.current)==null||We.abort(),Pe.current+=1,Se.current=!1}},[n,i,Et]),p.useEffect(()=>{var We,kt;if(!n){(We=ge.current)==null||We.abort(),Ee.current+=1,_e.current=!1;return}if(!Be){(kt=ge.current)==null||kt.abort(),Ee.current+=1,Qe.current=[],_e.current=!1,ae.current=!1,P([]),J(!1),M("");return}return vt(Be),()=>{var He;(He=ge.current)==null||He.abort(),Ee.current+=1,_e.current=!1}},[n,i,Be==null?void 0:Be.id,Be==null?void 0:Be.region]);const tt=n&&!Be&&!x.trim()&&!C&&!j&&!R&&Object.keys(f).length>0;p.useEffect(()=>{const We=Xe.current,kt=qe.current;if(!We||!kt||!tt)return;const He=new IntersectionObserver(([nt])=>{nt.isIntersecting&&Et(!0)},{root:kt,rootMargin:"240px 0px",threshold:.01});return He.observe(We),()=>He.disconnect()},[tt,Et]);const mt=()=>{const We=qe.current;!We||!tt||We.scrollHeight-We.scrollTop-We.clientHeight<=240&&Et(!0)},Ne=!!(Be&&N.length>0&&U&&!I&&!F);p.useEffect(()=>{const We=we.current,kt=ye.current;if(!Be||!We||!kt||!Ne)return;const He=new IntersectionObserver(([nt])=>{nt.isIntersecting&&vt(Be,!0)},{root:ye.current,rootMargin:"240px 0px",threshold:.01});return He.observe(We),()=>He.disconnect()},[Ne,vt,Be==null?void 0:Be.id,Be==null?void 0:Be.region]);const wt=()=>{const We=ye.current;if(!Be||!We||!ae.current||_e.current||F)return;const{scrollHeight:kt,scrollTop:He,clientHeight:nt}=We;kt-He-nt<=240&&vt(Be,!0)},jt=We=>{d(kt=>kt.map(He=>Ve(He)===Ve(We)?We:He))},Yt=async()=>{if(ee){je(!0);try{await Rbt(ee.id,ee.region),d(We=>We.filter(kt=>Ve(kt)!==Ve(ee))),q(We=>We===Ve(ee)?"":We),b===Ve(ee)&&v(""),be(null)}catch(We){A(Al(We,l("knowledge.errors.deleteBase"))),be(null)}finally{je(!1)}}},wn=async()=>{if(!(!Be||!ue)){je(!0);try{await Fbt(Be.id,ue.id,Be.region);const We=Qe.current.filter(kt=>kt.id!==ue.id);Qe.current=We,P(We),pe(null)}catch(We){L(Al(We,l("knowledge.errors.deleteDocument"))),pe(null)}finally{je(!1)}}};return a.jsxs("section",{className:`knowledge-library${Be?" is-detail":" resource-collection"}`,"aria-label":l("knowledge.library"),children:[Be?a.jsx(nT,{className:"knowledge-library__detail",title:Be.name,description:Be.description||l("common.noDescription"),identitySeed:Be.name,backLabel:l("knowledge.backToList"),onBack:()=>v(""),sections:[{key:"overview",label:l("skillCenter.overview"),content:a.jsx("section",{className:"knowledge-overview",children:a.jsxs(bH,{className:"knowledge-overview__summary",children:[a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.provider")}),a.jsx("dd",{children:Be.providerType||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.knowledgeId")}),a.jsx("dd",{className:"knowledge-keyboard-reveal",tabIndex:0,title:Be.providerKnowledgeId,children:Be.providerKnowledgeId||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.project")}),a.jsx("dd",{children:Be.projectName||"default"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.creator")}),a.jsx("dd",{children:P4(Be.ownerLabel)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("skillCenter.updatedAt")}),a.jsx("dd",{children:zTt(Be.updatedAt,c.resolvedLanguage??c.language)||"-"})]})]})})},{key:"data",label:l("knowledge.data"),content:a.jsx("section",{className:"knowledge-documents",children:a.jsx("div",{className:`knowledge-documents__body${N.length>0?" is-table":""}`,"aria-live":"polite",children:I&&N.length===0?a.jsx(cl,{}):_&&N.length===0?a.jsxs("div",{className:"knowledge-library__state is-error",role:"alert",children:[a.jsx("p",{children:_}),_t&&Be.canManage?a.jsx("button",{type:"button",onClick:()=>be(Be),children:l("knowledge.deleteInvalidAssociation")}):a.jsx("button",{type:"button",onClick:()=>void vt(Be),children:l("common.retry")})]}):N.length===0?a.jsxs("div",{className:"knowledge-library__state",children:[a.jsx(BTt,{}),a.jsx("p",{children:l("knowledge.noData")}),Be.canManage&&a.jsx("button",{type:"button",onClick:()=>H(Be),children:l("knowledge.addFirstData")})]}):a.jsx(yH,{rows:Kt,rowKey:We=>We.id,rowLabel:We=>We.name||We.id,columns:[{key:"name",header:l("common.name"),className:"is-primary-column",render:We=>a.jsx("span",{title:We.name||We.id,children:We.name||We.id})},{key:"format",header:l("knowledge.format"),className:"is-compact-column",render:We=>l9(We)},{key:"size",header:l("knowledge.size"),className:"is-compact-column",render:We=>aq(We.sizeBytes)}],searchValue:k,onSearchChange:S,searchPlaceholder:l("knowledge.searchData"),searchLabel:l("knowledge.searchLibraryData"),primaryAction:Be.canManage?{label:l(_t?"knowledge.associationInvalid":"knowledge.addData"),disabled:_t,title:_t?l("knowledge.providerMissing"):void 0,onClick:()=>H(Be)}:void 0,rowActions:We=>[{label:l("common.preview"),onSelect:()=>Y(We)},...Be.canManage?[{label:l("common.edit"),onSelect:()=>ie(We)},{label:l("common.delete"),onSelect:()=>pe(We),danger:!0}]:[]],scrollRef:ye,onScroll:wt,busy:I,emptyLabel:l("knowledge.noMatchingData"),footer:I?a.jsxs("div",{className:"knowledge-document-pagination",role:"status","aria-live":"polite",children:[a.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),a.jsx("span",{children:l("knowledge.loadingMoreData")})]}):F?a.jsxs("div",{className:"knowledge-document-pagination is-error",role:"alert",children:[a.jsx("span",{children:F}),a.jsx("button",{type:"button",onClick:()=>void vt(Be,!0),children:l("knowledge.retryLoading")})]}):U?a.jsx("div",{ref:we,className:"knowledge-document-pagination",role:"status","aria-live":"polite",children:l("skillCenter.scrollForMore")}):null})})})}],activeSectionKey:y,navigationLabel:l("knowledge.details"),onSectionChange:w,actions:Be.canManage?a.jsxs(a.Fragment,{children:[a.jsx(Tt,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>be(Be),children:l("common.delete")}),a.jsx(Tt,{type:"button",color:"primary",size:"lg",pill:!1,onClick:()=>W(!0),children:l("common.edit")})]}):void 0}):a.jsxs(a.Fragment,{children:[a.jsxs(ab,{className:"knowledge-library__toolbar library-resource-toolbar",children:[s,a.jsxs("div",{className:"resource-toolbar__actions",children:[o,a.jsx(em,{value:x,onChange:We=>O(We.target.value),placeholder:l("knowledge.searchBases"),"aria-label":l("knowledge.searchBases")})]})]}),a.jsxs(tm,{ref:qe,"aria-live":"polite",onScroll:mt,children:[m.length>0&&!C&&a.jsxs("div",{className:"knowledge-region-warning",role:"status",children:[a.jsx("span",{children:l("knowledge.someBasesFailed")}),a.jsx("button",{type:"button",onClick:()=>void Et(),children:l("common.retry")})]}),C&&u.length===0?a.jsx(cl,{}):R?a.jsxs("div",{className:"knowledge-library__state is-error",role:"alert",children:[a.jsx("p",{children:R}),a.jsx("button",{type:"button",onClick:()=>void Et(),children:l("common.retry")})]}):Pt.length===0&&x.trim()?a.jsxs("div",{className:"knowledge-library__state",children:[a.jsx(FTt,{}),a.jsx("p",{children:l("knowledge.noMatchingBases")})]}):a.jsxs(V0,{children:[x.trim()?null:a.jsx(cb,{"aria-label":l("knowledge.createBase"),icon:a.jsx(QTt,{}),onClick:()=>Z(!0),children:l("knowledge.createBase")}),Pt.map(We=>a.jsx(q0,{className:"knowledge-card",title:We.name,description:We.description||l("common.noDescription"),metadata:[{label:l("knowledge.creator"),value:P4(We.ownerLabel),title:P4(We.ownerLabel)},{label:l("knowledge.project"),value:We.projectName||"default",title:We.projectName||"default"}],action:{label:z===Ve(We)?l("knowledge.associationInvalid"):l("knowledge.addData"),icon:"plus",disabled:!We.canManage||z===Ve(We),title:We.canManage?z===Ve(We)?l("knowledge.providerMissing"):void 0:l("knowledge.noManagePermission"),onClick:()=>H(We)},detailAction:{label:l("common.viewDetails"),onClick:()=>v(Ve(We))}},Ve(We)))]}),tt||j?a.jsx("div",{ref:Xe,className:"my-agent-load-more",role:"status","aria-live":"polite",children:j?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),a.jsx("span",{children:l("knowledge.loadingMoreBases")})]}):tt?a.jsx("span",{children:l("skillCenter.scrollForMore")}):null}):null]})]}),V&&a.jsx(KTt,{region:t,onClose:()=>Z(!1),onCreated:We=>{d(kt=>[We,...kt]),v(Ve(We)),Z(!1)}}),Be&&ne&&a.jsx(GTt,{item:Be,onClose:()=>W(!1),onUpdated:We=>{jt(We),W(!1)}}),Be&&se&&a.jsx(o2t,{base:Be,item:se,onClose:()=>Y(null)}),G&&a.jsx(XTt,{base:G,onClose:()=>H(null),onAssociationInvalid:We=>{q(Ve(G)),Be&&Ve(Be)===Ve(G)&&L(Al(We,l("knowledge.associationInvalid"))),H(null)},onCreated:()=>{Be&&Ve(Be)===Ve(G)&&vt(Be),H(null)}}),Be&&X&&a.jsx(YTt,{base:Be,item:X,onClose:()=>ie(null),onUpdated:We=>{const kt=Qe.current.map(He=>He.id===We.id?We:He);Qe.current=kt,P(kt),ie(null)}}),ee&&a.jsx(Ad,{title:l("knowledge.deleteBaseTitle"),description:l("knowledge.deleteBaseDescription",{name:ee.name}),confirmLabel:l(ke?"common.deleting":"common.delete"),variant:"danger",busy:ke,onCancel:()=>be(null),onConfirm:()=>void Yt()}),ue&&a.jsx(Ad,{title:l("knowledge.deleteDocumentTitle"),description:l("knowledge.deleteDocumentDescription",{name:ue.name||ue.id}),confirmLabel:l(ke?"common.deleting":"common.delete"),variant:"danger",busy:ke,onCancel:()=>pe(null),onConfirm:()=>void wn()})]})}const c2t="_EmptyMessage_1r5gu_1",u2t="_IconBadge_1r5gu_16",d2t="_Title_1r5gu_54",f2t="_Description_1r5gu_69",h2t="_ActionRow_1r5gu_77",pT={EmptyMessage:c2t,IconBadge:u2t,Title:d2t,Description:f2t,ActionRow:h2t},Hn=({children:e,className:t,fill:n="static"})=>a.jsx("div",{className:Qi(pT.EmptyMessage,t),"data-fill":n,children:e}),p2t=({size:e="md",color:t="secondary",children:n,className:i})=>a.jsx("div",{className:Qi(pT.IconBadge,i),"data-size":e,"data-color":t,children:n}),m2t=({children:e,className:t,color:n="secondary"})=>a.jsx("div",{className:Qi(pT.Title,t),"data-color":n,children:e}),g2t=({children:e,className:t})=>a.jsx("div",{className:Qi(pT.Description,t),children:e}),b2t=({children:e,className:t})=>a.jsx("div",{className:Qi(pT.ActionRow,t),children:e});Hn.Icon=p2t;Hn.Title=m2t;Hn.Description=g2t;Hn.ActionRow=b2t;yn.hasResourceBundle("en-US","skills")||yn.addResourceBundle("en-US","skills",zme,!0,!0);yn.hasResourceBundle("zh-CN","skills")||yn.addResourceBundle("zh-CN","skills",Gwe,!0,!0);function tn(e,t={}){return yn.t(e,{...t,ns:"skills"})}const y2t="/web/skill-workbench";class c9 extends Error{constructor(t,n,i="SKILL_WORKBENCH_ERROR",r=!1,s="",o,l=""){super(t),this.status=n,this.code=i,this.retryable=r,this.statusText=s,this.originalError=o,this.rawResponse=l,this.name="SkillWorkbenchApiError"}}function kd(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(tn("api.invalidFormat",{label:t}));return e}function Tne(e,t){if(e!=null){if(typeof e!="string"||!e.trim()||e.trim().length>256)throw new Error(tn("api.invalidFormat",{label:t}));return e.trim()}}function v2t(e){if(e!=null){if(e==="pending"||e==="ready"||e==="failed"||e==="unknown")return e;throw new Error(tn("api.invalidFormat",{label:tn("api.recoveryStatus")}))}}async function kh(e,t={},n=ho){return fetch(ja(`${y2t}${e}`),{...t,headers:fc(t.headers),signal:po(t.signal,n)})}async function oq(e,t){var i;const n=await e.text().catch(()=>"");try{const r=kd(JSON.parse(n),tn("api.errorResponse")),s=r.detail&&typeof r.detail=="object"?kd(r.detail,tn("api.errorDetails")):r;return new c9(typeof s.message=="string"?s.message:t,e.status,typeof s.code=="string"?s.code:"SKILL_WORKBENCH_ERROR",s.retryable===!0,e.statusText,s.originalError&&typeof s.originalError=="object"?s.originalError:void 0,n)}catch{const r=((i=e.headers.get("content-type"))==null?void 0:i.split(";",1)[0])||tn("api.missingContentType");return new c9(tn("api.gatewayError",{fallback:t,status:e.status,contentType:r}),e.status,"SKILL_WORKBENCH_ERROR",!1,e.statusText,void 0,n)}}async function db(e,t){if(!e.ok)throw await oq(e,t);const n=e.headers.get("content-type")??"";if(!n.includes("application/json")){const i=n.split(";",1)[0]||tn("api.missingContentType");throw new Error(tn("api.nonJson",{fallback:t,status:e.status,contentType:i}))}return e.json()}function x2t(e){return Array.isArray(e)?e.map(t=>{const n=kd(t,tn("api.activity")),i=n.kind,r=n.status;if(typeof n.id!="string"||!["status","thinking","message","tool"].includes(String(i))||!["running","done"].includes(String(r)))throw new Error(tn("api.invalidActivity"));if(i==="tool"){if(typeof n.name!="string")throw new Error(tn("api.invalidToolActivity"));return{id:n.id,kind:i,status:r,name:n.name,...n.input!==void 0?{args:n.input}:{},...n.output!==void 0?{response:n.output}:{}}}if(typeof n.text!="string")throw new Error(tn("api.invalidTextActivity"));return{id:n.id,kind:i,status:r,text:n.text}}):[]}function w2t(e){if(e==null)return;const t=kd(e,tn("api.publication"));if(typeof t.revision!="number"||typeof t.skillId!="string"||typeof t.version!="string"||!Array.isArray(t.skillSpaceIds)||!t.skillSpaceIds.every(n=>typeof n=="string")||t.disposition!=="create-new"&&t.disposition!=="update-source"||!CD(t.region)||typeof t.projectName!="string")throw new Error(tn("api.invalidFormat",{label:tn("api.publication")}));return{revision:t.revision,skillId:t.skillId,version:t.version,skillSpaceIds:t.skillSpaceIds,disposition:t.disposition,region:t.region,projectName:t.projectName}}function kC(e){const t=kd(e,tn("api.task"));if(typeof t.jobId!="string"||t.operation!=="create"&&t.operation!=="optimize"||typeof t.intent!="string"||typeof t.revision!="number"||typeof t.state!="string")throw new Error(tn("api.invalidFormat",{label:tn("api.task")}));const n=Array.isArray(t.files)?t.files.flatMap(l=>{const c=kd(l,tn("api.file"));return typeof c.path=="string"&&typeof c.size=="number"?[{path:c.path,size:c.size}]:[]}):[];if(!["running","ready","failed","cancelled","expired","published"].includes(t.state))throw new Error(tn("api.unknownTaskState"));const r=Tne(t.toolId,"Tool ID"),s=Tne(t.sessionId,"Session ID"),o=v2t(t.recoveryStatus);return{jobId:t.jobId,operation:t.operation,intent:t.intent,...typeof t.model=="string"?{model:t.model}:{},...typeof t.style=="string"?{style:t.style}:{},...typeof t.requestedName=="string"?{requestedName:t.requestedName}:{},revision:t.revision,...r?{toolId:r}:{},...s?{sessionId:s}:{},...typeof t.sessionTtlSeconds=="number"?{sessionTtlSeconds:t.sessionTtlSeconds}:{},...typeof t.expiresAt=="string"?{expiresAt:t.expiresAt}:{},...typeof t.recoveryAvailable=="boolean"?{recoveryAvailable:t.recoveryAvailable}:{},...o?{recoveryStatus:o}:{},...typeof t.recoveredFromSnapshot=="boolean"?{recoveredFromSnapshot:t.recoveredFromSnapshot}:{},state:t.state,stage:typeof t.stage=="string"?t.stage:"generating",activities:x2t(t.activities),files:n,...t.source&&typeof t.source=="object"?{source:t.source}:{},...typeof t.name=="string"?{name:t.name}:{},...typeof t.description=="string"?{description:t.description}:{},...typeof t.skillMd=="string"?{skillMd:t.skillMd}:{},...typeof t.error=="string"?{error:t.error}:{},...t.validation&&typeof t.validation=="object"?{validation:t.validation}:{},...t.publication?{publication:w2t(t.publication)}:{}}}async function jM(e){const t=kd(await db(await kh("/capabilities",{signal:e}),tn("api.loadCapability")),tn("api.capability"));return{enabled:t.enabled===!0,reason:typeof t.reason=="string"?t.reason:"",operations:Array.isArray(t.operations)?t.operations.filter(n=>n==="create"||n==="optimize"):[],models:Array.isArray(t.models)?t.models.flatMap(n=>{if(!n||typeof n!="object")return[];const i=n;return typeof i.id=="string"&&typeof i.label=="string"?[{id:i.id,label:i.label}]:[]}):[],styles:t.styles&&typeof t.styles=="object"&&!Array.isArray(t.styles)?Object.fromEntries(Object.entries(t.styles).filter(n=>typeof n[1]=="string")):{},...typeof t.maxUploadBytes=="number"?{maxUploadBytes:t.maxUploadBytes}:{}}}async function O2t(e){if(e.file){const n=new URLSearchParams({operation:"optimize",intent:e.intent});e.jobId&&n.set("job_id",e.jobId),e.model&&n.set("model",e.model),e.style&&n.set("style",e.style),e.name&&n.set("name",e.name);const i=await kh(`/tasks/from-upload?${n}`,{method:"POST",body:e.file,headers:{"Content-Type":"application/zip"},signal:e.signal},mr);return kC(await db(i,tn("api.startOptimization")))}const t=await kh("/tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operation:e.operation,intent:e.intent,...e.model?{model:e.model}:{},...e.style?{style:e.style}:{},...e.name?{name:e.name}:{},...e.jobId?{jobId:e.jobId}:{},...e.source?{source:{kind:"skill-center",skillId:e.source.skillId,skillName:e.source.name,version:e.source.version,region:e.source.region,projectName:e.source.projectName,skillSpaceId:e.source.skillSpaceId,skillSpaceName:e.source.skillSpaceName}}:{}}),signal:e.signal},mr);return kC(await db(t,tn("api.startTask")))}async function k2t(e,t){return kC(await db(await kh(`/tasks/${encodeURIComponent(e)}`,{signal:t}),tn("api.loadTask")))}async function D4(e,t,n){const i=new URLSearchParams;i.set("expected_revision",String(t));const r=kd(await db(await kh(`/tasks/${encodeURIComponent(e)}/artifact?${i.toString()}`,{signal:n}),tn("api.loadArtifact")),tn("api.artifact"));if(r.jobId!==e||r.revision!==t||!Number.isSafeInteger(r.revision)||r.revision<1||typeof r.sha256!="string"||!/^[0-9a-f]{64}$/.test(r.sha256)||typeof r.name!="string"||typeof r.description!="string"||!Array.isArray(r.files))throw new Error(tn("api.invalidFormat",{label:tn("api.artifact")}));const s=r.files.map(o=>{const l=kd(o,tn("api.artifactFile"));if(typeof l.path!="string"||typeof l.size!="number"||typeof l.content!="string")throw new Error(tn("api.invalidFormat",{label:tn("api.artifactFile")}));return{path:l.path,size:l.size,content:l.content}});return{jobId:r.jobId,revision:r.revision,sha256:r.sha256,name:r.name,description:r.description,files:s}}async function M4(e){const t=await kh(`/tasks/${encodeURIComponent(e.jobId)}/refinements`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({intent:e.intent,expectedRevision:e.expectedRevision})},mr);return kC(await db(t,tn("api.refine")))}async function S2t(e){const t=await kh(`/tasks/${encodeURIComponent(e.jobId)}/stop`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expectedRevision:e.expectedRevision})});return kC(await db(t,tn("api.stop")))}async function E2t(e){const t=await kh(`/tasks/${encodeURIComponent(e.jobId)}/publish-stream`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/x-ndjson"},body:JSON.stringify({disposition:e.disposition,expectedRevision:e.expectedRevision,expectedArtifactSha256:e.expectedArtifactSha256,skillSpaceIds:e.skillSpaceIds??[],projectName:e.projectName,region:e.region}),signal:e.signal},0);if(!t.ok)throw await oq(t,tn("api.publish"));if(!(t.headers.get("content-type")??"").includes("application/x-ndjson"))throw new Error(tn("api.nonNdjson"));if(!t.body)throw new Error(tn("api.missingStream"));const i=new Set(["preparing","uploading","registering","activating","publishing"]);let r=null,s="";const o=new TextDecoder,l=t.body.getReader(),c=u=>{var h;if(!u.trim())return;const d=kd(JSON.parse(u),tn("api.publishProgress"));if(d.type==="progress"){if(typeof d.phase!="string"||!i.has(d.phase)||typeof d.message!="string")throw new Error(tn("api.invalidPublishProgress"));(h=e.onProgress)==null||h.call(e,{phase:d.phase,message:d.message});return}if(d.type==="error"){const m=kd(d.error,tn("api.publishError"));throw new c9(typeof m.message=="string"?m.message:tn("api.publish"),500,typeof m.code=="string"?m.code:"SKILL_PUBLISH_FAILED",m.retryable===!0,"",m.originalError&&typeof m.originalError=="object"?m.originalError:void 0,JSON.stringify(d.error))}if(d.type!=="complete")throw new Error(tn("api.unknownPublishEvent"));const f=kd(d.result,tn("api.publishResult"));if(typeof f.skillId!="string"||typeof f.version!="string"||!Array.isArray(f.skillSpaceIds)||!f.skillSpaceIds.every(m=>typeof m=="string")||f.disposition!=="create-new"&&f.disposition!=="update-source"||!CD(f.region)||typeof f.projectName!="string")throw new Error(tn("api.invalidFormat",{label:tn("api.publishResult")}));r={skillId:f.skillId,version:f.version,skillSpaceIds:f.skillSpaceIds,disposition:f.disposition,region:f.region,projectName:f.projectName}};for(;;){const{value:u,done:d}=await l.read();s+=o.decode(u,{stream:!d});const f=s.split(` +`);if(s=f.pop()??"",f.forEach(c),d)break}if(c(s),!r)throw new Error(tn("api.streamEnded"));return r}async function C2t(e){await db(await kh(`/tasks/${encodeURIComponent(e)}`,{method:"DELETE"}),tn("api.deleteTask"))}async function A2t(e,t,n){var c;const i=new URLSearchParams;i.set("expected_revision",String(t)),i.set("expected_sha256",n);const r=await kh(`/tasks/${encodeURIComponent(e)}/download?${i.toString()}`,{},mr);if(!r.ok)throw await oq(r,tn("api.download"));const o=((c=(r.headers.get("content-disposition")??"").match(/filename="([^"]+)"/))==null?void 0:c[1])??"skill.zip",l=URL.createObjectURL(await r.blob());try{const u=document.createElement("a");u.href=l,u.download=o,u.click()}finally{URL.revokeObjectURL(l)}}const iLe=p.createContext(void 0);function Y0(e){const t=p.useContext(iLe);if(t===void 0&&!e)throw new Error(Vc(47));return t}const T2t={...mje,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class _2t extends FD{constructor(n,i,r){const s=new cV;super(j2t(n,s,i,r),N2t(s),T2t);Zt(this,"setOpen",(n,i)=>{var f,h;const r=i.reason===pu,s=i.reason===Gw&&i.event.detail===0,o=!n&&(i.reason===T_e||i.reason==null),l=sst(i),c=this.select("activeTriggerId");if(!n&&i.reason===A_e&&i.trigger==null&&c!=null&&(i.trigger=this.context.triggerElements.getById(c)??this.select("activeTriggerElement")??void 0),(h=(f=this.context).onOpenChange)==null||h.call(f,n,i),i.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,i);const u=()=>{const m={open:n,openChangeReason:i.reason};aje(m,n,i.trigger,l()),this.update(m)};r?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(Iit,()=>{this.set("stickIfOpen",!1)}),vi.flushSync(u)):u();let d;s?d="click":o?d="dismiss":i.reason===rC&&(d="focus"),this.set("instantType",d)})}}function j2t(e,t,n,i=!1){const r={...fje(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return r.open&&(e==null?void 0:e.mounted)===void 0&&(r.mounted=!0),r.floatingRootContext=hje(t,n,i),r}function N2t(e){return{popupRef:p.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:p.createRef(),beforeContentFocusGuardRef:p.createRef(),stickIfOpenTimeout:new Mu,triggerElements:e}}function _ne({props:e}){const{children:t,open:n,defaultOpen:i=!1,onOpenChange:r,onOpenChangeComplete:s,modal:o=!1,handle:l,triggerId:c,defaultTriggerId:u=null}=e,d=I2t(l,{modal:o,open:i,openProp:n,activeTriggerId:u,triggerIdProp:c});d.useControlledProp("openProp",n),d.useControlledProp("triggerIdProp",c);const f=d.useState("open"),h=d.useState("mounted"),m=d.useState("payload");d.useContextCallback("onOpenChange",r),d.useContextCallback("onOpenChangeComplete",s),dje(d,f),lje(d);const{forceUnmount:g}=cje(f,d,()=>{d.update({stickIfOpen:!0,openChangeReason:null})});d.useSyncedValues({modal:o}),p.useEffect(()=>{f||d.context.stickIfOpenTimeout.clear()},[d,f]),p.useImperativeHandle(e.actionsRef,()=>({unmount:g,close:()=>d.setOpen(!1,ha(__e))}),[g,d]);const b=f||h;return a.jsxs(iLe.Provider,{value:d,children:[l&&a.jsx(sje,{handle:l,store:d}),b&&a.jsx(P2t,{store:d,modal:o}),typeof t=="function"?t({payload:m}):t]})}function R2t(e){return Y0(!0)?a.jsx(_ne,{props:e}):a.jsx(frt,{children:a.jsx(_ne,{props:e})})}function I2t(e,t){const n=rje((i,r)=>new _2t(t,i,r));return p.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function P2t({store:e,modal:t}){const n=e.useState("floatingRootContext"),i=U_e(n,{outsidePressEvent:{mouse:t==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),r=i.reference,s=i.floating;return uje(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:s}),null}const D2t=300;function nm(e){return FA(e,"base-ui")}function M2t(e,t){const n=p.useRef(null);function i(s){vi.flushSync(()=>{e.setOpen(!1,ha(rC,s.nativeEvent,s.currentTarget))});const o=cit(n.current);o==null||o.focus()}function r(s){var l;const o=e.select("positionerElement");if(o&&nw(s,o))(l=e.context.beforeContentFocusGuardRef.current)==null||l.focus();else{vi.flushSync(()=>{e.setOpen(!1,ha(rC,s.nativeEvent,s.currentTarget))});let c=lit(e.context.triggerFocusTargetRef.current||t.current);for(;c!==null&&ii(o,c);){const u=c;if(c=Jz(c),c===u)break}c==null||c.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:i,handleFocusTargetFocus:r}}function L2t(e){const t=p.useRef(""),n=p.useCallback(r=>{r.defaultPrevented||(t.current=r.pointerType,e(r,r.pointerType))},[e]);return{onClick:p.useCallback(r=>{if(r.detail===0){e(r,"keyboard");return}"pointerType"in r?e(r,r.pointerType):e(r,t.current),t.current=""},[e]),onPointerDown:n}}function rLe(e,t){const n=li((s,o)=>{(typeof e=="function"?e():e)||t(o||(VD?"touch":""))}),{onClick:i,onPointerDown:r}=L2t(n);return p.useMemo(()=>({onClick:i,onPointerDown:r}),[i,r])}const $2t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,disabled:o=!1,nativeButton:l=!0,handle:c,payload:u,openOnHover:d=!1,delay:f=D2t,closeDelay:h=0,id:m,...g}=t,b=Y0(!0),y=gje(c)??b;if(!y)throw new Error(Vc(74));const w=nm(m),x=y.useState("isTriggerActive",w),O=y.useState("floatingRootContext"),k=y.useState("isOpenedByTrigger",w),S=y.useState("triggerPopupId",w),C=p.useRef(null),{registerTrigger:E,isMountedByThisTrigger:j}=oje(w,C,y,{payload:u,disabled:o,openOnHover:d,closeDelay:h}),T=y.useState("openChangeReason"),R=y.useState("stickIfOpen"),A=y.useState("openMethod"),N=y.useState("focusManagerModal"),P=fst(O,{enabled:!o&&d&&(A!=="touch"||T!==Gw),mouseOnly:!0,move:!1,handleClose:mst(),restMs:f,delay:{close:h},triggerElementRef:C,isActiveTrigger:x,isClosing:()=>y.select("transitionStatus")==="ending"}),I=B_e(O,{stickIfOpen:R}),D=rLe(()=>y.select("open"),ne=>{y.set("openMethod",ne)}),_=y.useState("triggerProps",j),{getButtonProps:L,buttonRef:F}=KD({disabled:o,native:l}),M={open(ne){return ne&&T===Gw?_st.open(ne):xje.open(ne)}},{preFocusGuardRef:z,handlePreFocusGuardFocus:q,handleFocusTargetFocus:U}=M2t(y,C),V=Pa("button",t,{state:{disabled:o,open:k},ref:[F,n,E,C],props:[I.reference,P,_,D,{[sV]:"",id:w,"aria-haspopup":"dialog","aria-expanded":k,"aria-controls":S},g,L],stateAttributesMapping:M}),Z=a.jsx(p.Fragment,{children:V},w);return j&&!N?a.jsxs(p.Fragment,{children:[a.jsx(c0,{ref:z,onFocus:q}),Z,a.jsx(c0,{ref:y.context.triggerFocusTargetRef,onFocus:U})]}):Z}),sLe=p.createContext(void 0);function F2t(){const e=p.useContext(sLe);if(e===void 0)throw new Error(Vc(45));return e}const B2t=p.forwardRef(function(t,n){const{keepMounted:i=!1,...r}=t;return Y0().useState("mounted")||i?a.jsx(sLe.Provider,{value:i,children:a.jsx(I_e,{ref:n,...r})}):null}),aLe=p.createContext(void 0);function U2t(){const e=p.useContext(aLe);if(!e)throw new Error(Vc(46));return e}const oLe=p.forwardRef(function(t,n){const{cutout:i,...r}=t;let s;if(i){const o=i.getBoundingClientRect();s=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${o.left}px ${o.top}px,${o.left}px ${o.bottom}px,${o.right}px ${o.bottom}px,${o.right}px ${o.top}px,${o.left}px ${o.top}px)`}return a.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...r,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});let jne={},Nne={},Rne="";function NM(e,t){return MA(e)?e:t}function Ine(e,t,n){return/hidden|clip/.test(e.getComputedStyle(NM(t,n)).overflowY)}function Q2t(e){if(typeof document>"u")return!1;const t=Sr(e);return na(t).innerWidth-t.documentElement.clientWidth>0}function z2t(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Sr(e),i=n.documentElement,r=n.body,s=NM(i,r),o=s.style.overflowY,l=i.style.scrollbarGutter;i.style.scrollbarGutter="stable",s.style.overflowY="scroll";const c=s.offsetWidth;s.style.overflowY="hidden";const u=s.offsetWidth;return s.style.overflowY=o,i.style.scrollbarGutter=l,c===u}function V2t(e){const t=Sr(e),n=t.documentElement,i=t.body,r=NM(n,i),s={overflowY:r.style.overflowY,overflowX:r.style.overflowX};return Object.assign(r.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(r.style,s)}}function H2t(e){var m;const t=Sr(e),n=t.documentElement,i=t.body,r=na(n);let s=0,o=0,l=!1;const c=_c.create();if(U1&&(((m=r.visualViewport)==null?void 0:m.scale)??1)!==1)return()=>{};function u(){const g=r.getComputedStyle(n),b=r.getComputedStyle(i),w=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,o=n.scrollLeft,jne={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Rne=n.style.scrollBehavior,Nne={position:i.style.position,height:i.style.height,width:i.style.width,boxSizing:i.style.boxSizing,overflowY:i.style.overflowY,overflowX:i.style.overflowX,scrollBehavior:i.style.scrollBehavior};const x=n.scrollHeight>n.clientHeight,O=n.scrollWidth>n.clientWidth,k=g.overflowY==="scroll"||b.overflowY==="scroll",S=g.overflowX==="scroll"||b.overflowX==="scroll",C=Math.max(0,r.innerWidth-i.clientWidth),E=Math.max(0,r.innerHeight-i.clientHeight),j=parseFloat(b.marginTop)+parseFloat(b.marginBottom),T=parseFloat(b.marginLeft)+parseFloat(b.marginRight),R=NM(n,i);if(l=z2t(e),l){n.style.scrollbarGutter=w,R.style.overflowY="hidden",R.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:w,overflowY:"hidden",overflowX:"hidden"}),(x||k)&&(n.style.overflowY="scroll"),(O||S)&&(n.style.overflowX="scroll"),Object.assign(i.style,{position:"relative",height:j||E?`calc(100dvh - ${j+E}px)`:"100dvh",width:T||C?`calc(100vw - ${T+C}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),i.scrollTop=s,i.scrollLeft=o,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function d(){Object.assign(n.style,jne),Object.assign(i.style,Nne),l||(n.scrollTop=s,n.scrollLeft=o,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=Rne)}function f(){d(),c.request(u)}u();const h=Ni(r,"resize",f);return()=>{c.cancel(),d(),typeof r.removeEventListener=="function"&&h()}}class q2t{constructor(){Zt(this,"lockCount",0);Zt(this,"restore",null);Zt(this,"timeoutLock",Mu.create());Zt(this,"timeoutUnlock",Mu.create());Zt(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});Zt(this,"unlock",()=>{var t;this.lockCount===0&&this.restore&&((t=this.restore)==null||t.call(this),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const n=Sr(t),i=n.documentElement,r=n.body,s=na(i);if(Ine(s,i,r)){const l=new s.MutationObserver(()=>{Ine(s,i,r)||(l.disconnect(),this.restore=null,this.lock(t))}),c={attributes:!0};l.observe(i,c),l.observe(r,c),this.restore=()=>l.disconnect();return}const o=VD||!Q2t(t);this.restore=o?V2t(t):H2t(t)}}const W2t=new q2t;function lLe(e=!0,t=null){Jn(()=>{if(e)return W2t.acquire(t)},[e,t])}const K2t=20;function G2t(e,t,n,i){const[r,s]=p.useState(!1);Jn(()=>{if(!e||!t||n==null){s(!1);return}const o=Sr(n).documentElement.clientWidth,l=n.offsetWidth;s(o>0&&l>0&&l>=o-K2t)},[e,t,n]),lLe(e&&(!t||r),i)}const X2t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,anchor:o,positionMethod:l,side:c,align:u,sideOffset:d,alignOffset:f,collisionBoundary:h="clipping-ancestors",collisionPadding:m,arrowPadding:g,sticky:b,disableAnchorTracking:v=!1,collisionAvoidance:y=Fit,...w}=t,x=Y0(),O=F2t(),k=urt(),S=x.useState("floatingRootContext"),C=x.useState("mounted"),E=x.useState("open"),j=x.useState("openChangeReason"),T=x.useState("activeTriggerElement"),R=x.useState("modal"),A=x.useState("openMethod"),N=x.useState("positionerElement"),P=x.useState("instantType"),I=x.useState("transitionStatus"),D=x.useState("adaptiveOrigin"),_=p.useRef(null),L=rV(N),F=Ost({anchor:o,floatingRootContext:S,positionMethod:l,mounted:C,side:c,sideOffset:d,align:u,alignOffset:f,arrowPadding:g,collisionBoundary:h,collisionPadding:m,sticky:b,disableAnchorTracking:v,keepMounted:O,nodeId:k,collisionAvoidance:y,adaptiveOrigin:D}),M=S.useState("domReferenceElement");Jn(()=>{const V=M,Z=_.current;if(V&&(_.current=V),Z&&V&&V!==Z){x.set("instantType",void 0);const ne=new AbortController;return L(()=>{x.set("instantType","trigger-change")},ne.signal),()=>{ne.abort()}}},[M,L,x]);const z=R===!0&&j!==pu;G2t(E&&z,A==="touch",N,T);const q=x.useStateSetter("positionerElement"),U={open:E,side:F.side,align:F.align,anchorHidden:F.anchorHidden,instant:P},J=jst(t,U,{styles:F.positionerStyles,transitionStatus:I,props:w,refs:[n,q],hidden:!C,inert:!E});return a.jsxs(aLe.Provider,{value:F,children:[C&&z&&a.jsx(oLe,{inert:iV(!E),cutout:T}),a.jsx(drt,{id:k,children:J})]})}),Y2t="ArrowUp",Z2t="ArrowDown",J2t="ArrowLeft",e_t="ArrowRight",t_t="Home",n_t="End",cLe=new Set([Y2t,Z2t,J2t,e_t,t_t,n_t]),i_t=p.createContext(void 0);function r_t(e){return p.useContext(i_t)}const s_t=p.createContext(void 0);function a_t(){const[e,t]=p.useState(0),n=li(()=>(t(r=>r+1),()=>{t(r=>Math.max(0,r-1))}));return{context:p.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}const o_t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,initialFocus:o,finalFocus:l,...c}=t,u=Y0(),d=U2t(),f=r_t()!=null,{context:h,hasClosePart:m}=a_t(),g=u.useState("open"),b=u.useState("openMethod"),v=u.useState("instantType"),y=u.useState("transitionStatus"),w=u.useState("popupProps"),x=u.useState("titleElementId"),O=u.useState("descriptionElementId"),k=u.useState("modal"),S=u.useState("mounted"),C=u.useState("openChangeReason"),E=u.useState("activeTriggerElement"),j=u.useState("floatingRootContext"),T=j.useState("floatingId"),R=u.useState("disabled"),A=u.useState("openOnHover"),N=u.useState("closeDelay");$A({open:g,ref:u.context.popupRef,onComplete(){var F,M;g&&((M=(F=u.context).onOpenChangeComplete)==null||M.call(F,!0))}}),ust(j,{enabled:A&&!R,closeDelay:N});const P=o===void 0?ije(u.context.popupRef):o,I=k!==!1&&m;u.useSyncedValue("focusManagerModal",I);const D=u.useStateSetter("popupElement"),_={open:g,side:d.side,align:d.align,instant:v,transitionStatus:y},L=Pa("div",t,{state:_,ref:[n,u.context.popupRef,D],props:[w,{id:T,role:"dialog",...nje,"aria-labelledby":x,"aria-describedby":O,onKeyDown(F){f&&cLe.has(F.key)&&F.stopPropagation()}},Oje(y),c],stateAttributesMapping:wje});return a.jsx(F_e,{context:j,openInteractionType:b,modal:I,disabled:!S||C===pu,initialFocus:P,returnFocus:l,restoreFocus:"popup",previousFocusableElement:ea(E)?E:void 0,nextFocusableElement:u.context.triggerFocusTargetRef,beforeContentFocusGuardRef:u.context.beforeContentFocusGuardRef,children:a.jsx(s_t.Provider,{value:h,children:L})})}),l_t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...o}=t,l=Y0(),c=nm(o.id);return l.useSyncedValueWithCleanup("titleElementId",c),Pa("h2",t,{ref:n,props:[{id:c},o]})}),c_t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...o}=t,l=Y0(),c=nm(o.id);return l.useSyncedValueWithCleanup("descriptionElementId",c),Pa("p",t,{ref:n,props:[{id:c},o]})});function Pne(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"10.25",cy:"10.25",r:"6.25"}),a.jsx("path",{d:"M4.15 10.25h12.2M10.25 4c1.65 1.72 2.5 3.8 2.5 6.25s-.85 4.53-2.5 6.25M10.25 4c-1.65 1.72-2.5 3.8-2.5 6.25s.85 4.53 2.5 6.25M14.8 14.8 20 20"})]})}function u_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.25",y:"5.25",width:"15.5",height:"13.5",rx:"2.25"}),a.jsx("circle",{cx:"8.1",cy:"9.3",r:"1.35"}),a.jsx("path",{d:"m4.7 16.5 3.65-3.7 2.45 2.25 2.2-2.2 4.35 4.1"}),a.jsx("path",{d:"m19.4 2.75.48 1.37 1.37.48-1.37.48-.48 1.37-.48-1.37-1.37-.48 1.37-.48.48-1.37Z",fill:"currentColor",stroke:"none"})]})}function lq(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{className:"video-generate-icon__body",d:"M3.25 9h17.5v7.35a2.4 2.4 0 0 1-2.4 2.4H5.65a2.4 2.4 0 0 1-2.4-2.4V9Z"}),a.jsxs("g",{className:"video-generate-icon__clapper",children:[a.jsx("path",{d:"M3.25 9V7.65a2.4 2.4 0 0 1 2.4-2.4h12.7a2.4 2.4 0 0 1 2.4 2.4V9H3.25Z"}),a.jsx("path",{d:"M6.75 5.25 9.3 9M12 5.25 14.55 9M17.25 5.25 19.8 9"})]}),a.jsx("path",{d:"m10.25 11.45 4 2.55-4 2.55v-5.1Z"})]})}function d_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M4.25 5.25h15.5v10.5H4.25zM8.25 19.75h7.5M12 15.75v4"}),a.jsx("path",{d:"m7.25 12.75 2.35-2.4 2.15 1.65 3.4-3.6 1.6 1.55"}),a.jsx("circle",{cx:"7.25",cy:"8.4",r:".7",fill:"currentColor",stroke:"none"})]})}function f_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5 7.4c0-1.55 3.13-2.8 7-2.8s7 1.25 7 2.8-3.13 2.8-7 2.8-7-1.25-7-2.8Z"}),a.jsx("path",{d:"M5 7.4v4.55c0 1.55 3.13 2.8 7 2.8s7-1.25 7-2.8V7.4M5 11.95v4.55c0 1.55 3.13 2.8 7 2.8s7-1.25 7-2.8v-4.55"}),a.jsx("path",{d:"M8.2 12.25h.01M8.2 16.8h.01"})]})}function h_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M4.25 4.25h4.5v15.5h-4.5zM8.75 5.75h5v14h-5zM13.75 4.25h4.1v10.25h-4.1z"}),a.jsx("path",{d:"M5.75 7h1.5M10.25 8.25h2M10.25 11h2M15.15 7h1.3"}),a.jsx("circle",{cx:"17.45",cy:"17.35",r:"2.45"}),a.jsx("path",{d:"m19.25 19.15 1.55 1.55"})]})}function p_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M4.25 6.25h6.25c1 0 1.5.55 1.5 1.45v11.05c0-.9-.5-1.45-1.5-1.45H4.25V6.25Z"}),a.jsx("path",{d:"M19.75 9.1v8.2H13.5c-1 0-1.5.55-1.5 1.45V7.7c0-.9.5-1.45 1.5-1.45h2.15"}),a.jsx("path",{d:"m19 3.2.58 1.62 1.62.58-1.62.58L19 7.6l-.58-1.62-1.62-.58 1.62-.58L19 3.2Z",fill:"currentColor",stroke:"none"})]})}function m_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"m4.2 8.4 1.15 10.2h13.3L19.8 8.4"}),a.jsx("path",{d:"M4.2 8.4h15.6L17.9 5H6.1L4.2 8.4Z"}),a.jsx("path",{d:"M7.2 12.2c1.1-1 2.25 1.25 3.4.25 1.05-.9 2.15 1.3 3.3.25"}),a.jsx("path",{d:"m8.2 15.1 1.45 1.35 1.45-1.35M13.55 16.45h2.35"})]})}function g_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"6",cy:"6.25",r:"2.25"}),a.jsx("circle",{cx:"18",cy:"6.25",r:"2.25"}),a.jsx("circle",{cx:"12",cy:"17.75",r:"2.25"}),a.jsx("path",{d:"m7.7 7.75 2.7 7.55M16.3 7.75l-2.7 7.55M8.25 6.25h7.5"})]})}function Dne(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"9",cy:"8",r:"3"}),a.jsx("path",{d:"M3.75 18.75c.45-3.05 2.2-4.65 5.25-4.65s4.8 1.6 5.25 4.65"}),a.jsx("path",{d:"M17.75 4.25v5.5M15 7h5.5M16 13.25h4.25M18.125 11.125v4.25"})]})}function b_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"4",y:"4.25",width:"16",height:"5",rx:"1.5"}),a.jsx("rect",{x:"4",y:"14.75",width:"16",height:"5",rx:"1.5"}),a.jsx("path",{d:"M7.25 6.75h.01M7.25 17.25h.01M10 6.75h6.5M10 17.25h6.5"})]})}function y_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3.75h8l4 4v12.5H6V3.75Z"}),a.jsx("path",{d:"M14 3.75v4h4M8.75 11h6.5M8.75 14.25h6.5M8.75 17.5h4"})]})}function Mne(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.75",y:"4.5",width:"16.5",height:"15",rx:"2.5"}),a.jsx("path",{d:"m7.5 9 2.75 2.5L7.5 14M12.5 14h4"}),a.jsx("path",{d:"M3.75 7.5h16.5",opacity:".62"})]})}function rO(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m6 3.25 4.5 4.75L6 12.75"})})}function v_t({value:e}){const{t,i18n:n}=Te("adk"),[i,r]=p.useState(!1),s=f=>f==null?t("developmentRuns.notReported"):f.toLocaleString(n.resolvedLanguage||n.language),o=z2e,l=e.usage,c=(l==null?void 0:l.inputTokens)!=null&&l.cachedInputTokens!=null&&l.cachedInputTokens<=l.inputTokens?l.inputTokens-l.cachedInputTokens:void 0,u=l!=null&&l.inputTokens&&l.cachedInputTokens!=null&&c!=null?`${(l.cachedInputTokens/l.inputTokens*100).toFixed(1)}%`:void 0,d=[["inputTokens",l==null?void 0:l.inputTokens],["cachedInputTokens",l==null?void 0:l.cachedInputTokens],["uncachedInputTokens",c],["cacheWriteInputTokens",l==null?void 0:l.cacheWriteInputTokens],["outputTokens",l==null?void 0:l.outputTokens],["reasoningOutputTokens",l==null?void 0:l.reasoningOutputTokens]];return a.jsxs("div",{className:"development-turn-summary","data-turn-id":e.turnId,children:[a.jsx("span",{children:t(`developmentRuns.turnStatus.${e.status}`)}),a.jsx("span",{children:t("developmentRuns.toolCalls",{count:e.toolCalls})}),a.jsx("span",{children:t("developmentRuns.turnDuration",{duration:o(e.durationMs)})}),a.jsx("span",{title:t("developmentRuns.toolDurationHelp"),children:t(e.toolDurationComplete?"developmentRuns.toolDuration":"developmentRuns.toolDurationPartial",{duration:o(e.toolDurationMs)})}),a.jsxs(R2t,{open:i,onOpenChange:r,children:[a.jsxs($2t,{className:"development-token-trigger",openOnHover:!0,delay:150,closeDelay:150,onFocus:f=>{f.currentTarget.matches(":focus-visible")&&r(!0)},children:[a.jsx("span",{children:"Tokens"}),a.jsx("span",{className:"development-token-value",children:s(l==null?void 0:l.totalTokens)}),e.usageIncomplete&&a.jsxs("span",{children:["· ",t("developmentRuns.partial")]}),a.jsx(rO,{className:"development-token-chevron"})]}),a.jsx(B2t,{children:a.jsx(X2t,{side:"top",align:"end",sideOffset:8,className:"development-token-positioner",children:a.jsxs(o_t,{className:"development-token-popup",initialFocus:!1,finalFocus:!1,children:[a.jsx(l_t,{className:"development-token-title",children:t("developmentRuns.tokenDetails")}),a.jsxs("dl",{children:[a.jsxs("div",{children:[a.jsx("dt",{children:t("developmentRuns.model")}),a.jsx("dd",{children:e.model||t("developmentRuns.notReported")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:t("developmentRuns.totalTokens")}),a.jsx("dd",{children:s(l==null?void 0:l.totalTokens)})]}),d.map(([f,h])=>a.jsxs("div",{children:[a.jsx("dt",{children:t(`developmentRuns.${f}`)}),a.jsx("dd",{children:s(h)})]},f)),a.jsxs("div",{children:[a.jsx("dt",{children:t("developmentRuns.cacheHitRate")}),a.jsx("dd",{children:u||t("developmentRuns.notReported")})]})]}),a.jsxs(c_t,{className:"development-token-note",children:[t("developmentRuns.tokenHelp"),e.usageIncomplete?` ${t("developmentRuns.partialHelp")}`:""]})]})})})]})]})}function cq(e){return a.jsx("svg",{viewBox:"0 0 111 117",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M0 5.6016C7.82288e-05 0.621244 6.02226 -1.87314 9.54395 1.64847L40.1289 32.2334L68.5732 3.7891C69.5834 2.77903 70.9533 2.21099 72.3818 2.21097H82.7031C82.7917 2.20658 82.8806 2.20414 82.9697 2.20414H104.775C109.574 2.20427 111.977 8.00691 108.584 11.4004L64.916 55.0664C64.3075 55.8528 63.9436 56.7647 63.8242 57.6993C63.7142 56.4884 63.1964 55.3069 62.2695 54.3799L45.4082 37.5186H45.4072L40.124 32.2354L17.832 54.5284C16.7671 55.5933 16.2416 56.993 16.2549 58.3887C16.2417 59.7843 16.7672 61.1842 17.832 62.2491L39.9287 84.3467L9.54395 114.733C6.0223 118.255 0.000223474 115.761 0 110.78V5.6016ZM63.8018 58.8702C63.8962 59.9086 64.2936 60.9229 64.9961 61.7735L108.591 105.368C111.984 108.762 109.58 114.564 104.781 114.564H94.4336C94.3543 114.568 94.274 114.569 94.1934 114.569H72.3877C70.9592 114.569 69.5892 114.002 68.5791 112.992L39.9336 84.3467L58.4531 65.8282L58.4453 65.8203L62.2695 61.9981C63.1476 61.12 63.6567 60.0136 63.8018 58.8702Z",fill:"currentColor"})})}function RM({kind:e,...t}){return e==="thinking"?a.jsx(cq,{...t}):a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:e==="tool"?a.jsxs(a.Fragment,{children:[a.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"3"}),a.jsx("path",{d:"m7 9 3 3-3 3m6 0h4"})]}):e==="plan"?a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"m4 7 1.5 1.5L8 6m-4 7 1.5 1.5L8 12M11 7h9m-9 6h9m-9 6h9"}),a.jsx("circle",{cx:"6",cy:"19",r:"1"})]}):a.jsx(a.Fragment,{children:a.jsx("path",{d:"M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9zM14 3v6h6M8 13h8m-4-3v6M8 18h8"})})})}function x_t({blocks:e,active:t,status:n,render:i}){const{t:r}=Te("adk"),[s,o]=p.useState(!1),l=[...e].reverse().find(h=>"done"in h&&!h.done),c=e.filter(h=>h.kind==="tool"),u=c.filter(h=>h.durationMs!=null),d=u.reduce((h,m)=>h+(m.durationMs||0),0);let f=r("developmentRuns.processSummary",{count:e.length});return t&&(f=n||((l==null?void 0:l.kind)==="thinking"?r("developmentRuns.thinking"):(l==null?void 0:l.kind)==="tool"?V2e(l):(l==null?void 0:l.kind)==="plan"?r("developmentRuns.plan"):(l==null?void 0:l.kind)==="diff"?r("developmentRuns.diff"):r("developmentRuns.processing"))),a.jsxs("section",{className:"development-process",children:[a.jsxs("button",{type:"button",className:"development-process__toggle","aria-expanded":s,onClick:()=>o(!s),children:[a.jsx(rO,{className:`tool-chevron${s?" is-open":""}`}),a.jsx("span",{className:"tool-icon",children:a.jsx(RM,{kind:(l==null?void 0:l.kind)==="thinking"||(l==null?void 0:l.kind)==="plan"||(l==null?void 0:l.kind)==="diff"?l.kind:"tool"})}),t?a.jsx(hn,{className:"development-process__title","aria-live":"polite",children:f}):a.jsx("span",{className:"development-process__title",children:f}),!t&&c.length>0&&a.jsxs("span",{className:"development-process__duration",children:[r("developmentRuns.toolCalls",{count:c.length}),u.length>0?` · ${r(u.length===c.length?"developmentRuns.toolDuration":"developmentRuns.toolDurationPartial",{duration:z2e(d)})}`:""]})]}),a.jsx("div",{className:"development-process__items",hidden:!s,children:i(e)})]})}function w_t({blocks:e,active:t,status:n="",render:i}){const{t:r}=Te("adk"),s=nnt(e),o=s[s.length-1],l=[...e].reverse().find(u=>u.kind==="progress"),c=n||((l==null?void 0:l.kind)==="progress"?l.text:"");return a.jsxs(a.Fragment,{children:[s.map(u=>u.process?a.jsx(x_t,{blocks:u.blocks,active:t&&u===o,status:c,render:i},u.id):a.jsx("div",{"data-assistant-phase":u.blocks[0].phase,children:i(u.blocks)},u.id)),t&&!(o!=null&&o.process)&&a.jsxs("div",{className:"development-process__status",role:"status",children:[a.jsx("span",{className:"tool-icon",children:a.jsx(RM,{kind:"thinking"})}),a.jsx(hn,{children:c||r("developmentRuns.processing")})]})]})}const O_t={formatDate(e){const t=e.value??e.date??e.timestamp;if(t==null)return"";const n=new Date(t);return isNaN(n.getTime())?String(t):n.toLocaleString()}};function k_t(e,t){if(!t||t==="/")return e;const n=t.replace(/^\//,"").split("/").map(r=>r.replace(/~1/g,"/").replace(/~0/g,"~"));let i=e;for(const r of n){if(i==null||typeof i!="object")return;i=i[r]}return i}function S_t(e){return typeof e=="object"&&e!==null&&typeof e.path=="string"}function E_t(e){return typeof e=="object"&&e!==null&&typeof e.call=="string"}function uq(e,t){if(S_t(e))return k_t(t,e.path);if(E_t(e)){const n=O_t[e.call],i={};for(const[r,s]of Object.entries(e.args??{}))i[r]=uq(s,t);return n?n(i):`[unknown fn: ${e.call}]`}return e}function C_t(e,t){const n=uq(e,t);return n==null?"":typeof n=="string"?n:String(n)}const uLe=new Map;function Z0(e,t){uLe.set(e,t)}function A_t(e){return uLe.get(e)}function T_t(e,t,n){const i=t.replace(/^\//,"").split("/").map(s=>s.replace(/~1/g,"/").replace(/~0/g,"~"));let r=e;for(let s=0;suq(i,e.dataModel),resolveString:i=>C_t(i,e.dataModel),dispatchAction:t,render:i=>{if(!i)return null;const r=e.components[i];if(!r)return null;const s=A_t(r.component)??__t;return a.jsx(s,{node:r,ctx:n},i)}};return a.jsx("div",{className:"a2ui-surface","data-a2ui-surface":e.surfaceId,children:n.render(e.rootId)})}function fLe(e){const t=p.useRef(null),n=p.useRef(!0),i=28,r=p.useCallback(()=>{const s=t.current;s&&(n.current=s.scrollHeight-s.scrollTop-s.clientHeight{const s=t.current;s&&n.current&&(s.scrollTop=s.scrollHeight)},[e]),{ref:t,onScroll:r}}function IM({value:e,skillPrefix:t="/",onRemoveSkill:n,onRemoveAgent:i}){const{t:r}=Te("conversation");return e.skills.length===0&&!e.targetAgent?null:a.jsxs("div",{className:"invocation-chips","aria-label":r("invocation.ariaLabel"),children:[e.skills.map(s=>a.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:s.description,children:[a.jsx(lC,{"aria-hidden":!0}),a.jsxs("span",{children:[t,s.name]}),n?a.jsx("button",{type:"button",onClick:()=>n(s.name),"aria-label":r("invocation.removeSkill",{name:s.name}),children:a.jsx(Mo,{})}):null]},s.name)),e.targetAgent?a.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:e.targetAgent.description,children:[a.jsx(Mje,{"aria-hidden":!0}),a.jsx("span",{children:e.targetAgent.name}),i?a.jsx("button",{type:"button",onClick:i,"aria-label":r("invocation.removeAgent",{name:e.targetAgent.name}),children:a.jsx(Mo,{})}):null]}):null]})}function dq(e=""){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e==="application/pdf"?"pdf":e==="text/markdown"?"markdown":"text"}function hLe(e){var n,i,r,s;const t=dq(e.mimeType);return t==="pdf"?"PDF":t==="markdown"?"MD":t==="video"?((i=(n=e.mimeType)==null?void 0:n.split("/")[1])==null?void 0:i.toUpperCase())??"VIDEO":t==="image"?((s=(r=e.mimeType)==null?void 0:r.split("/")[1])==null?void 0:s.toUpperCase())??"IMAGE":"TXT"}function pLe(e){return e?e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`:""}function mLe(e,t){return e.previewUrl?e.previewUrl:e.data?`data:${e.mimeType??"application/octet-stream"};base64,${e.data}`:e.uri?hTe(t,e.uri):""}function N_t({kind:e}){return e==="image"?a.jsx(bV,{}):e==="video"?a.jsx($je,{}):e==="pdf"?a.jsx(Pat,{}):a.jsx(mV,{})}function PM({appName:e,items:t,compact:n=!1,onRemove:i}){const{t:r}=Te("conversation"),[s,o]=p.useState(null);return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:`media-grid${n?" media-grid--compact":""}`,children:t.map(l=>{const c=dq(l.mimeType),u=mLe(l,e),d=l.status==="uploading"||l.status==="error"||!u,f=a.jsxs("button",{type:"button",className:"media-card-main",disabled:d,onClick:c==="image"?void 0:()=>o(l),"aria-label":r("media.preview",{name:l.name??r("media.attachment")}),children:[c==="image"&&u?a.jsx("img",{className:"media-card-image",src:u,alt:l.name??r("media.image"),loading:"lazy"}):c==="video"&&u?a.jsxs("div",{className:"media-card-video-container",children:[a.jsx("video",{className:"media-card-video",src:u,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),a.jsx("span",{className:"media-card-video-play",children:a.jsx(Uje,{})})]}):a.jsx("span",{className:"media-card-icon",children:a.jsx(N_t,{kind:c})}),a.jsxs("span",{className:"media-card-copy",children:[a.jsx("span",{className:"media-card-name",children:l.name??r("media.attachment")}),a.jsxs("span",{className:"media-card-meta",children:[a.jsx("span",{className:"media-card-type",children:hLe(l)}),l.status==="uploading"?a.jsxs(a.Fragment,{children:[a.jsx(Bi,{className:"media-card-spinner"})," ",r("media.uploading")]}):l.status==="error"?l.error??r("media.uploadFailed"):pLe(l.sizeBytes)]})]}),!n&&l.status!=="uploading"&&l.status!=="error"?a.jsx(ZS,{className:"media-card-open"}):null]});return a.jsxs(Ar.div,{className:`media-card media-card--${c}${l.status==="error"?" media-card--error":""}`,layout:!0,initial:{opacity:0,scale:.985,y:4},animate:{opacity:1,scale:1,y:0},children:[c==="image"&&!d?a.jsx(MAe,{src:u,children:f}):f,i?a.jsx("button",{type:"button",className:"media-card-remove","aria-label":r("media.remove",{name:l.name??r("media.attachment")}),onClick:()=>i(l.id),children:a.jsx(Mo,{})}):null]},l.id)})}),a.jsx(hf,{children:s?a.jsx(R_t,{appName:e,item:s,onClose:()=>o(null)}):null})]})}function R_t({appName:e,item:t,onClose:n}){const{t:i}=Te("conversation"),r=p.useMemo(()=>mLe(t,e),[e,t]),s=dq(t.mimeType),[o,l]=p.useState(""),[c,u]=p.useState(s==="text"||s==="markdown"),[d,f]=p.useState("");return p.useEffect(()=>{const h=m=>{m.key==="Escape"&&n()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[n]),p.useEffect(()=>{if(s!=="text"&&s!=="markdown")return;const h=new AbortController;return u(!0),f(""),fetch(r,{signal:h.signal}).then(m=>{if(!m.ok)throw new Error(`HTTP ${m.status}`);return m.text()}).then(l).catch(m=>{h.signal.aborted||f(m instanceof Error?m.message:String(m))}).finally(()=>{h.signal.aborted||u(!1)}),()=>h.abort()},[s,r]),a.jsx(Ar.div,{className:"media-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":i("media.previewDialog",{name:t.name??i("media.attachment")}),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onMouseDown:h=>{h.target===h.currentTarget&&n()},children:a.jsxs(Ar.div,{className:"media-viewer",initial:{opacity:0,y:18,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.99},transition:{type:"spring",stiffness:420,damping:30},children:[a.jsxs("header",{className:"media-viewer-header",children:[a.jsxs("div",{children:[a.jsx("strong",{children:t.name??i("media.attachment")}),a.jsxs("span",{children:[hLe(t),t.sizeBytes?` · ${pLe(t.sizeBytes)}`:""]})]}),a.jsxs("nav",{children:[a.jsx("a",{href:r,download:t.name,"aria-label":i("media.download"),children:a.jsx(eM,{})}),a.jsx("button",{type:"button",onClick:n,"aria-label":i("media.close"),children:a.jsx(Mo,{})})]})]}),a.jsxs("div",{className:`media-viewer-body media-viewer-body--${s}`,children:[s==="image"?a.jsx("img",{src:r,alt:t.name??i("media.image")}):null,s==="video"?a.jsx("div",{className:"media-viewer-video-wrapper",children:a.jsx("video",{src:r,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",className:"media-viewer-video"})}):null,s==="pdf"?a.jsx("iframe",{src:r,title:t.name??"PDF"}):null,c?a.jsxs("div",{className:"media-viewer-loading",children:[a.jsx(Bi,{})," ",i("media.reading")]}):null,!c&&d?a.jsx("div",{className:"media-viewer-loading",children:i("media.loadFailed",{error:d})}):null,!c&&s==="markdown"?a.jsx("div",{className:"media-document",children:a.jsx(_d,{text:o})}):null,!c&&s==="text"?a.jsx("pre",{className:"media-document media-document--plain",children:o}):null]})]})})}function I_t({definition:e,label:t,done:n,open:i,onToggle:r}){const{t:s}=Te("conversation"),o=e.icon,l=n?e.doneLabel:e.runningLabel,c=t??s(`blocks.tools.${e.name}.${n?"done":"running"}`,{defaultValue:l});return a.jsxs("button",{type:"button",className:`builtin-tool-head${n?" is-done":" is-running"}`,"data-tool-tone":e.tone,onClick:r,"aria-expanded":i,children:[a.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:a.jsx(o,{})}),n?a.jsx("span",{className:"builtin-tool-label",children:c}):a.jsx(hn,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:c}),a.jsx(rO,{className:`builtin-tool-chevron${i?" is-open":""}`})]})}function ju(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Vn(e){return typeof e=="string"?e:""}function Lne(e){return typeof e=="number"&&Number.isFinite(e)?e:0}function ud(e){return Array.isArray(e)?e:[]}function u9(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return{}}const n=ju(t)??{};return ju(n.result)??n}function DM(e){if(typeof e=="string")try{return DM(JSON.parse(e))}catch{return e}const t=ju(e);if(!t)return"";const n=ju(t.result);return Vn(t.error)||Vn(t.message)||Vn(n==null?void 0:n.error)||Vn(n==null?void 0:n.message)}function P_t(e){if(e.kind==="tool")return"tool";if(e.kind==="knowledge_base")return"knowledge_base";const t=ju(e.metadata),n=Vn(t==null?void 0:t.source_type).toLowerCase(),i=Vn(e.source).toLowerCase();return n==="skillhub"||i.startsWith("skill_hub:")?"skill_hub":"skill_space"}const gLe={tool:"Tools",knowledge:"AgentKit Knowledge Base",skillCenter:"AgentKit Skill Center",unknownSource:"Unknown source",unnamedResource:"Unnamed resource",unnamedAgent:"Unnamed agent"};function D_t(e,t){return e==="veadk_builtin_tools"?t.tool:e==="agentkit_knowledge"?t.knowledge:e.startsWith("skill_hub:")?`Skill Hub ${e.slice(10)}`:e.startsWith("skill_space:")?`${t.skillCenter} ${e.slice(12)}`:e||t.unknownSource}function M_t(e){return e==="veadk_builtin_tools"?"tool":e==="agentkit_knowledge"?"knowledge_base":e.startsWith("skill_hub:")?"skill_hub":"skill_space"}function L_t(e,t=gLe){const n=u9(e),i=ju(n.capabilities)??{},r=ud(n.resources).flatMap(o=>{const l=ju(o);if(!l)return[];const c=l.kind==="tool"?"tool":l.kind==="knowledge_base"?"knowledge_base":"skill";return[{ref:Vn(l.ref),kind:c,category:P_t(l),name:Vn(l.name)||Vn(l.ref)||t.unnamedResource,description:Vn(l.description),source:Vn(l.source),version:Vn(l.version)}]}),s=ud(n.sources).flatMap(o=>{const l=ju(o);if(!l)return[];const c=Vn(l.source),u=Vn(l.status),d=u==="error"?"error":u==="skipped"?"skipped":"ok";return[{source:c,category:M_t(c),label:D_t(c,t),status:d,count:Lne(l.count),message:Vn(l.message),searchKeywords:ud(l.search_keywords).map(Vn).filter(Boolean)}]});return{collectionId:Vn(n.collection_id),capabilities:{googleAdkVersion:Vn(i.google_adk_version),agentTypes:ud(i.agent_types).map(Vn).filter(Boolean),maxOrchestrationDepth:Lne(i.max_orchestration_depth)},resources:r,sources:s,counts:{all:r.length,skill_hub:r.filter(o=>o.category==="skill_hub").length,skill_space:r.filter(o=>o.category==="skill_space").length,knowledge_base:r.filter(o=>o.category==="knowledge_base").length,tool:r.filter(o=>o.category==="tool").length}}}function $_t(e,t){return{resources:e.resources.filter(n=>n.category===t),sources:e.sources.filter(n=>n.category===t)}}function bLe(e,t,n=gLe){const i=u9(e),r=u9(t),s=new Map(ud(r.results).flatMap(d=>{const f=ju(d),h=Vn(f==null?void 0:f.name);return f&&h?[[h,f]]:[]})),o=ud(i.agents).flatMap(d=>{const f=ju(d),h=Vn(f==null?void 0:f.name);return f&&h?[f]:[]}),l=new Set(o.map(d=>Vn(d.name))),c=[...s.entries()].filter(([d])=>!l.has(d)).map(([d])=>({name:d})),u=[...o,...c].map(d=>{const f=Vn(d.name),h=ud(d.nodes).flatMap(C=>{const E=ju(C);return E?[E]:[]}),m=Vn(d.root_node),g=h.find(C=>Vn(C.id)===m),b=h.filter(C=>Vn(C.id)!==m).map(C=>({id:Vn(C.id)||n.unnamedAgent,type:Vn(C.type)||"llm",description:Vn(C.description)})),v=s.get(f),y=Vn(v==null?void 0:v.status),w=y==="failed"?"failed":y==="completed"?"completed":"running",x=$ne(v==null?void 0:v.resources),O=x.length>0?x:$ne(h.flatMap(C=>ud(C.resources))),k=Fne(v==null?void 0:v.python_tools),S=k.length>0?k:Fne(h.flatMap(C=>ud(C.python_tools)));return{name:f,description:Vn(v==null?void 0:v.description)||Vn(g==null?void 0:g.description)||Vn(d.task),task:Vn(d.task),rootType:Vn(v==null?void 0:v.root_type)||Vn(g==null?void 0:g.type)||"llm",nodeCount:h.length,subAgentCount:b.length,resourceCount:O.length,pythonToolCount:S.length,skills:O.filter(C=>C.kind==="skill"),knowledgeBases:O.filter(C=>C.kind==="knowledge_base"),builtinTools:O.filter(C=>C.kind==="tool"),pythonTools:S,subAgents:b,status:w,output:Vn(v==null?void 0:v.output),error:Vn(v==null?void 0:v.error)}});return{collectionId:Vn(r.collection_id)||Vn(i.collection_id),agents:u,completedCount:u.filter(d=>d.status==="completed").length,failedCount:u.filter(d=>d.status==="failed").length,runningCount:u.filter(d=>d.status==="running").length}}function F_t(e,t){return!!DM(t)||bLe(e,t).failedCount>0}function $ne(e){const t=new Set;return ud(e).flatMap(n=>{const i=ju(n),r=Vn(i?i.ref:n);if(!r||t.has(r))return[];t.add(r);const s=Vn(i==null?void 0:i.kind),o=s==="tool"||r.startsWith("veadk_tool:")?"tool":s==="knowledge_base"||r.startsWith("agentkit_kb:")?"knowledge_base":"skill",l=r.split(":");return[{ref:r,kind:o,name:Vn(i==null?void 0:i.name)||l[l.length-1]||r,description:Vn(i==null?void 0:i.description),version:Vn(i==null?void 0:i.version),source:Vn(i==null?void 0:i.source)}]})}function Fne(e){const t=new Set;return ud(e).flatMap(n=>{const i=ju(n),r=Vn(i==null?void 0:i.name),s=Vn(i==null?void 0:i.code),o=`${r}\0${s}`;return!i||!r||t.has(o)?[]:(t.add(o),[{name:r,description:Vn(i.description),code:s,entrypoint:Vn(i.entrypoint)||r,dependencies:ud(i.dependencies).map(Vn).filter(Boolean)}])})}function B_t({branch:e}){return a.jsxs("div",{className:`branch-compare__body${e.status==="running"?" is-streaming":""}`,"aria-live":"polite",children:[e.content?a.jsx(_d,{text:e.content,streaming:e.status==="running"}):null,e.status==="running"?a.jsx("span",{className:"branch-compare__caret","aria-hidden":"true"}):null,e.error?a.jsx("p",{className:"branch-compare__error",children:e.error}):null]})}function U_t({args:e,response:t,status:n,onBranchSelect:i}){const{t:r}=Te("conversation"),s=p.useMemo(()=>Vje(e,t,n),[e,t,n]),[o,l]=p.useState(0);return a.jsxs("section",{className:"branch-compare","aria-label":r("blocks.branchCompare.ariaLabel"),children:[a.jsx("div",{className:"branch-compare__tabs",role:"tablist","aria-label":r("blocks.branchCompare.selectDirection"),children:s.branches.map((c,u)=>a.jsx("button",{className:`branch-compare__tab${o===u?" is-active":""}`,type:"button",role:"tab","aria-selected":o===u,"aria-controls":`branch-compare-panel-${u}`,onClick:()=>l(u),children:a.jsx(Ya,{color:"info",size:"sm",variant:"soft",children:c.label})},`${c.label}:${u}`))}),a.jsx("div",{className:"branch-compare__branches",children:s.branches.map((c,u)=>a.jsxs("article",{className:`branch-compare__branch${o===u?" is-active":""}`,id:`branch-compare-panel-${u}`,role:"tabpanel",children:[a.jsx("header",{className:"branch-compare__head",children:a.jsx(Ya,{color:"info",size:"sm",variant:"soft",children:c.label})}),a.jsx(B_t,{branch:c}),a.jsx("footer",{className:"branch-compare__footer",children:a.jsx(Tt,{type:"button",color:"info",variant:"ghost",size:"sm",pill:!1,disabled:c.status!=="completed",onClick:()=>i==null?void 0:i(c),children:r("blocks.branchCompare.continue")})})]},`${c.label}:${u}`))})]})}function yLe({controlled:e,default:t,name:n,state:i="value"}){const{current:r}=p.useRef(e!==void 0),[s,o]=p.useState(t),l=r?e:s,c=p.useCallback(u=>{r||o(u)},[]);return[l,c]}const vLe=p.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function Q_t(){return p.useContext(vLe)}function z_t(e){const{children:t,elementsRef:n,labelsRef:i,onMapChange:r}=e,s=li(r),[,o]=p.useState(!1),l=Cd(H_t).current,c=Cd(V_t).current,u=p.useRef(0),d=p.useRef(!0),f=p.useRef([]),h=p.useRef(null),m=li(()=>{d.current||(d.current=!0,o(k=>!k))}),g=li((k,S)=>{c.set(k,S),m()}),b=li(k=>{c.delete(k),m()}),v=li(k=>{const S=new Map;return n.current.length=0,i&&(i.current.length=0),k.forEach(C=>{var E,j;S.set(C.element,{...C.registration.metadata??{},index:C.index}),n.current[C.index]=C.element,i&&(i.current[C.index]=C.registration.label!==void 0?C.registration.label:((j=(E=C.registration.textRef)==null?void 0:E.current)==null?void 0:j.textContent)??C.element.textContent)}),u.current=n.current.length,S});function y(k){var E;if((E=h.current)==null||E.disconnect(),h.current=null,typeof MutationObserver!="function"||k.length<2)return;const S=new MutationObserver(j=>{if(!K_t(j))return;let T=null;for(const R of k)if(R.isConnected){if(T&&xLe(T,R)>0){S.disconnect(),m();return}T=R}});h.current=S;const C=new Set;for(let j=1;jS.observe(j,{childList:!0}))}const w=li(()=>{const[k,S]=q_t(c),C=v(k);y(S),f.current=k,d.current=!1,l.forEach(E=>E(C)),s(C)});Jn(()=>(d.current||v(f.current),()=>{n.current=[],i&&(i.current=[])}),[n,i,v]),Jn(()=>{d.current&&w()}),Jn(()=>()=>{var k;(k=h.current)==null||k.disconnect(),d.current=!0},[]);const x=li(k=>(l.add(k),()=>{l.delete(k)})),O=p.useMemo(()=>({register:g,unregister:b,subscribeMapChange:x,nextIndexRef:u}),[g,b,x,u]);return a.jsx(vLe.Provider,{value:O,children:t})}function V_t(){return new Map}function H_t(){return new Set}function q_t(e){const t=new Set,n=[],i=[];e.forEach((s,o)=>{if(!o.isConnected)return;const l=s.index,c={index:l??-1,element:o,registration:s};l===null?i.push(c):l>=0&&(t.add(l),n.push(c))});let r=0;return i.sort((s,o)=>xLe(s.element,o.element)),i.forEach(s=>{for(;t.has(r);)r+=1;s.index=r,n.push(s),r+=1}),t.size>0&&n.sort((s,o)=>s.index-o.index),[n,i.map(s=>s.element)]}function W_t(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function K_t(e){for(const t of e)for(let n=0;nnull},kLe=p.forwardRef(function(t,n){const{render:i,className:r,disabled:s=!1,hiddenUntilFound:o,keepMounted:l,loopFocus:c,onValueChange:u,multiple:d=!1,orientation:f="vertical",value:h,defaultValue:m,style:g,...b}=t,v=p.useMemo(()=>{if(h===void 0)return m??[]},[h,m]),y=p.useRef([]),[w,x]=yLe({controlled:h,default:v,name:"Accordion",state:"value"}),O=li((E,j,T)=>{if(d)if(j){const R=w.slice();if(R.push(E),u==null||u(R,T),T.isCanceled)return;x(R)}else{const R=w.filter(A=>A!==E);if(u==null||u(R,T),T.isCanceled)return;x(R)}else{const R=w[0]===E?[]:[E];if(u==null||u(R,T),T.isCanceled)return;x(R)}}),k=p.useMemo(()=>({value:w,disabled:s,orientation:f}),[w,s,f]),S=p.useMemo(()=>({disabled:s,handleValueChange:O,hiddenUntilFound:o??!1,keepMounted:l??!1,state:k,value:w}),[s,O,o,l,k,w]),C=Pa("div",t,{state:k,ref:n,props:b,stateAttributesMapping:G_t});return a.jsx(wLe.Provider,{value:S,children:a.jsx(z_t,{elementsRef:y,children:C})})});function X_t(e){const{open:t,defaultOpen:n,onOpenChange:i,disabled:r}=e,[s,o]=yLe({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:l,setMounted:c,transitionStatus:u}=tje(s,!0,!0),d=nm(),[f,h]=p.useState(),m=f===null?void 0:f??d,g=li(b=>{const v=!s,y=ha(Gw,b.nativeEvent);i(v,y),!y.isCanceled&&o(v)});return p.useMemo(()=>({defaultPanelId:d,disabled:r,handleTrigger:g,mounted:l,open:s,panelId:m,setMounted:c,setOpen:o,setPanelIdState:h,transitionStatus:u}),[d,r,g,l,s,m,c,o,h,u])}const SLe=p.createContext(void 0);function ELe(){const e=p.useContext(SLe);if(e===void 0)throw new Error(Vc(15));return e}function Y_t(e={}){const{guess:t,label:n,metadata:i,textRef:r,index:s}=e,{register:o,unregister:l,subscribeMapChange:c,nextIndexRef:u}=Q_t(),d=p.useRef(-1),[f,h]=p.useState(s==null&&t?()=>{if(d.current===-1){const v=u.current;u.current+=1,d.current=v}return d.current}:-1),m=s??f,g=p.useRef(null),b=p.useCallback(v=>{const y=g.current;y&&l(y),g.current=v,v&&o(v,{metadata:i??null,index:s??null,label:n,textRef:r})},[s,o,l,i,n,r]);return Jn(()=>{if(s==null)return c(v=>{var w;const y=g.current?(w=v.get(g.current))==null?void 0:w.index:null;y!=null&&h(y)})},[s,c]),{ref:b,index:m}}const CLe=p.createContext(void 0);function fq(){const e=p.useContext(CLe);if(e===void 0)throw new Error(Vc(9));return e}let hq=function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=aI.startingStyle]="startingStyle",e[e.endingStyle=aI.endingStyle]="endingStyle",e}({}),Z_t=function(e){return e.panelOpen="data-panel-open",e}({});const J_t={[hq.open]:""},ejt={[hq.closed]:""},tjt={open(e){return e?{[Z_t.panelOpen]:""}:null}},njt={open(e){return e?J_t:ejt}};let ijt=function(e){return e.index="data-index",e.disabled="data-disabled",e.open="data-open",e}({});const pq={...njt,index:e=>({[ijt.index]:String(e)}),...WD,value:()=>null},ALe=p.forwardRef(function(t,n){const{className:i,disabled:r=!1,onOpenChange:s,render:o,value:l,style:c,...u}=t,{ref:d,index:f}=Y_t(),h=Kw(n,d),{disabled:m,handleValueChange:g,state:b,value:v}=OLe(),y=nm(),w=l??y,x=r||m,O=v.indexOf(w)!==-1,k=li((D,_)=>{s==null||s(D,_),!_.isCanceled&&g(w,D,_)}),S=X_t({open:O,onOpenChange:k,disabled:x}),C=p.useMemo(()=>({open:S.open,disabled:S.disabled,transitionStatus:S.transitionStatus}),[S.open,S.disabled,S.transitionStatus]),E=p.useMemo(()=>({...S,onOpenChange:k,state:C}),[S,C,k]),j=p.useMemo(()=>({...b,hidden:!O&&!S.mounted,index:f,disabled:x,open:O}),[S.mounted,x,f,O,b]),T=nm(),[R,A]=p.useState(),N=R===null?void 0:R??T,P=p.useMemo(()=>({defaultTriggerId:T,open:O,state:j,setTriggerId:A,triggerId:N}),[T,O,j,A,N]),I=Pa("div",t,{state:j,ref:h,props:u,stateAttributesMapping:pq});return a.jsx(SLe.Provider,{value:E,children:a.jsx(CLe.Provider,{value:P,children:I})})}),TLe=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...o}=t,{state:l}=fq();return Pa("h3",t,{state:l,ref:n,props:o,stateAttributesMapping:pq})}),_Le=p.forwardRef(function(t,n){const{disabled:i,className:r,id:s,render:o,nativeButton:l=!0,style:c,...u}=t,{panelId:d,open:f,handleTrigger:h,disabled:m}=ELe(),g=i||m,{getButtonProps:b,buttonRef:v}=KD({disabled:g,focusableWhenDisabled:!0,native:l}),{defaultTriggerId:y,state:w,setTriggerId:x}=fq(),O=s||void 0,k=O??y;return Jn(()=>(x(E=>O??(E===null?void 0:E)),()=>{x(E=>E===O?null:E)}),[O,x]),Pa("button",t,{state:w,ref:[n,v],props:[{"aria-controls":f?d:void 0,"aria-expanded":f,id:k,onClick:h},u,b],stateAttributesMapping:tjt})}),mk={height:void 0,width:void 0};function rjt(e){const{externalRef:t,hiddenUntilFound:n,id:i,keepMounted:r,mounted:s,onOpenChange:o,open:l,setMounted:c,setOpen:u,transitionStatus:d}=e,f=p.useRef(null),h=p.useRef(null),[m,g]=p.useState(mk),b=p.useRef(mk),v=p.useRef(!1),y=p.useRef(l),w=p.useRef(!1),[x,O]=p.useState(!1),k=p.useRef(null),S=Kw(t,f),C=ec(l),E=rV(f),j=!l&&!s,T=x?"idle":d,R=l&&(y.current||w.current),A=!l&&s&&h.current==="css-animation"&&m.height===void 0&&m.width===void 0?b.current:m,N=n&&j&&h.current!=="css-animation",P=li((F,M=!0)=>{M&&(b.current=F),g(F)}),I=li(()=>{var F;(F=k.current)==null||F.call(k),k.current=null}),D=li(F=>{I(),k.current=()=>{k.current=null,F()}}),_=li(()=>{l&&s&&h.current==="css-animation"&&(w.current=!0)});Jn(()=>{!x||d==="starting"||O(!1)},[x,d]),p.useEffect(()=>()=>{_(),I()},[_,I]),Jn(()=>{const F=f.current;if(!F)return;!l&&k.current&&I();const M=sjt(F,R);if(h.current=M,l&&d==="idle"&&y.current&&M==="css-animation"){b.current=$v(F);return}if(l&&d==="starting"){const U=v.current;if(v.current=!1,M==="none"){P($v(F)),O(!0);return}if(M==="css-transition"){const Z=ajt(F);if(P($v(F)),!U)return Z;const ne=j_(F,"transition-duration","0s");return D(ne),O(!0),Z}P($v(F));const J=j_(F,"animation-name","none");if(!U){J();return}const V=j_(F,"animation-duration","0s");J(),D(V),O(!0);return}if(!l&&s&&(d==="idle"||d==="starting")){if(y.current=!1,w.current=!1,M==="none"){P(mk,!1),c(!1);return}P($v(F));return}if(d!=="ending")return;if(M==="none"){c(!1);return}const z=$v(F);if(!(z.height>0||z.width>0)){c(!1);return}P(z),M==="css-animation"&&j_(F,"animation-name","none")()},[s,l,I,P,c,D,R,d]),$A({enabled:l&&s&&T==="idle",open:!0,ref:f,onComplete(){l&&P(mk,!1)}}),p.useEffect(()=>{if(l||!s||T!=="ending"||!f.current)return;const M=new AbortController;let z=-1;function q(){C.current||(c(!1),P(mk,!1))}return z=_c.request(()=>{E(q,M.signal)}),()=>{_c.cancel(z),M.abort()}},[C,s,l,T,E,P,c]),Jn(()=>{const F=f.current;!F||!n||!j||F.setAttribute("hidden","until-found")},[j,n]),p.useEffect(function(){const M=f.current;if(!M)return;function z(q){const U=ha(E_e,q);o(!0,U),!U.isCanceled&&(v.current=!0,u(!0))}return Ni(M,"beforematch",z)},[o,u]);const L=r||n||s||l;return{height:A.height,props:{...N?{[hq.startingStyle]:""}:void 0,hidden:j,id:i},ref:S,shouldPreventOpenAnimation:R,shouldRender:L,transitionStatus:T,width:A.width}}function $v(e){return{height:e.scrollHeight,width:e.scrollWidth}}function sjt(e,t){const n=na(e).getComputedStyle(e),i=(n.animationName.split(",").map(s=>s.trim()).some(s=>s!==""&&s!=="none")||t)&&Bne(n.animationDuration),r=Bne(n.transitionDuration);return i&&r||r?"css-transition":i?"css-animation":"none"}function Bne(e){return e.split(",").map(t=>t.trim()).some(t=>t!==""&&Number.parseFloat(t)>0)}function j_(e,t,n){const i=e.style.getPropertyValue(t),r=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(i===""){e.style.removeProperty(t);return}e.style.setProperty(t,i,r)}}function ajt(e){const t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(r=>{e.style.setProperty(r,"initial","important")});function n(){Object.entries(t).forEach(([r,s])=>{if(s===""){e.style.removeProperty(r);return}e.style.setProperty(r,s)})}const i=_c.request(n);return()=>{_c.cancel(i),n()}}let Une=function(e){return e.accordionPanelHeight="--accordion-panel-height",e.accordionPanelWidth="--accordion-panel-width",e}({});const jLe=p.forwardRef(function(t,n){const{className:i,hiddenUntilFound:r,keepMounted:s,id:o,render:l,style:c,...u}=t,{hiddenUntilFound:d,keepMounted:f}=OLe(),{defaultPanelId:h,mounted:m,onOpenChange:g,open:b,setMounted:v,setOpen:y,setPanelIdState:w,transitionStatus:x}=ELe(),O=r??d,k=s??f,S=o||void 0,C=o??h;Jn(()=>(w(M=>S??(M===null?void 0:M)),()=>{w(M=>M===S?null:M)}),[S,w]);const{height:E,props:j,ref:T,shouldPreventOpenAnimation:R,shouldRender:A,transitionStatus:N,width:P}=rjt({externalRef:n,hiddenUntilFound:O,id:C,keepMounted:k,mounted:m,onOpenChange:g,open:b,setMounted:v,setOpen:y,transitionStatus:x}),{state:I,triggerId:D}=fq(),_={...I,transitionStatus:N},L=m_e(c,_),F=Pa("div",{...t,style:void 0},{state:_,ref:T,props:[j,{"aria-labelledby":D,role:"region",style:{[Une.accordionPanelHeight]:E===void 0?"auto":`${E}px`,[Une.accordionPanelWidth]:P===void 0?"auto":`${P}px`}},u,L?{style:L}:void 0,R?{style:{animationName:"none"}}:void 0],stateAttributesMapping:pq});return A?F:null}),ojt=(e,t)=>{const n=e.currentTarget,i={x:e.clientX,y:e.clientY},r=ljt(i,n.getBoundingClientRect()),s=cjt(i,r),o=ujt(t.getBoundingClientRect());return fjt([...s,...o])};function ljt(e,t){const n=Math.abs(t.top-e.y),i=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,i,r,s)){case s:return"left";case r:return"right";case n:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function cjt(e,t,n=5){const i=[];switch(t){case"top":i.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":i.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":i.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":i.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return i}function ujt(e){const{top:t,right:n,bottom:i,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:i},{x:r,y:i}]}function djt(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,o=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}function fjt(e){const t=e.slice();return t.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),hjt(t)}function hjt(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i=2;){const s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let i=e.length-1;i>=0;i--){const r=e[i];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const pjt="_Transition_1wdpp_1",mjt="_Popover_1wdpp_3",NLe={Transition:pjt,Popover:mjt},RLe=p.createContext(null),MM=()=>{const e=p.use(RLe);if(!e)throw new Error("Popover components must be wrapped in ");return e},$g=({open:e,onOpenChange:t,showOnHover:n=!1,hoverOpenDelay:i=150,children:r})=>{const[s,o]=p.useState(!1),[l,c]=p.useState(!1),u=p.useRef(null),d=p.useRef(null),f=p.useRef(void 0),h=p.useRef(!1),m=p.useRef(!1),g=e??s,[b,v]=p.useState(!1);OV(()=>v(!1),b?500:null);const y=sb(t),w=sb(C=>{var E,j;clearTimeout(f.current),g!==C&&(C||(c(!1),n&&h.current&&((E=u.current)==null||E.focus()),h.current=!1),(j=y.current)==null||j.call(y,C),o(C),n&&v(C))}),x=p.useCallback(C=>{w.current(C)},[w]),O=p.useCallback(()=>{f.current=setTimeout(()=>x(!0),i)},[x,i]),k=p.useCallback(()=>{clearTimeout(f.current)},[]);p.useEffect(()=>()=>{clearTimeout(f.current)},[]);const S=p.useMemo(()=>({open:g,setOpen:x,shake:l,setShake:c,showOnHover:n,temporarilyPreventClickToClose:b,onTriggerEnter:O,onTriggerLeave:k,isPointerInTransitRef:m,triggerRef:u,contentRef:d,hoverOpenFocusedWithTab:h}),[g,x,l,c,n,b,h,m,O,k]);return a.jsx(RLe,{value:S,children:a.jsx(IRe,{open:g,onOpenChange:x,modal:!1,children:r})})},gjt=({children:e,onPointerDown:t,onClick:n})=>{const{setOpen:i,showOnHover:r,temporarilyPreventClickToClose:s,onTriggerEnter:o,onTriggerLeave:l,isPointerInTransitRef:c,triggerRef:u,contentRef:d}=MM(),f=p.useRef(!1),h=b=>{!(b.currentTarget.nodeName.toLocaleLowerCase()==="a")&&s&&(b.preventDefault(),b.stopPropagation())},m=b=>{b.pointerType!=="touch"&&!f.current&&!c.current&&(o(),f.current=!0)},g=()=>{f.current&&(l(),f.current=!1)};return a.jsx(PRe,{asChild:!0,ref:u,onPointerDown:b=>{h(b),t==null||t(b)},onClick:b=>{h(b),n==null||n(b)},onPointerMove:r?m:void 0,onPointerLeave:r?g:void 0,onFocus:r?()=>i(!0):void 0,onBlur:r?()=>{setTimeout(()=>{var b;(b=d.current)!=null&&b.contains(document.activeElement)||i(!1)},50)}:void 0,children:e})},ILe=({children:e,avoidCollisions:t,width:n,minWidth:i,maxWidth:r,side:s,sideOffset:o=8,align:l,alignOffset:c,translucent:u,className:d,autoFocus:f=!0})=>{const{showOnHover:h,shake:m,contentRef:g}=MM(),b=v=>{const y=g.current;if(y&&v.target===y&&v.key==="Tab"&&v.shiftKey){v.preventDefault(),v.stopPropagation();const w=sNe(y),x=w[w.length-1];x==null||x.focus()}};return p.useEffect(()=>{const v=g.current;!v||!f||v!=null&&v.contains(document.activeElement)||h||v.focus({preventScroll:!0})},[g,h,f]),a.jsx(MRe,{forceMount:!0,ref:g,className:Qi(NLe.Popover,d),style:B0({"popover-width":n,"popover-min-width":i,"popover-max-width":r}),onCloseAutoFocus:h?Lp:void 0,"data-animate":m?"shake":void 0,"data-translucent":u?"true":void 0,side:s,sideOffset:o,align:l,alignOffset:c??(l==="center"?0:-5),avoidCollisions:t??!0,hideWhenDetached:!0,collisionPadding:20,onOpenAutoFocus:Lp,onEscapeKeyDown:Lp,onKeyDown:b,children:e})},bjt=e=>{const{setOpen:t,triggerRef:n,contentRef:i,isPointerInTransitRef:r,hoverOpenFocusedWithTab:s}=MM(),[o,l]=p.useState(null),c=p.useCallback(()=>{l(null),r.current=!1},[r]),u=p.useCallback((d,f)=>{const h=ojt(d,f);l(h),r.current=!0},[r]);return p.useEffect(()=>()=>c(),[c]),p.useEffect(()=>{const d=n.current,f=i.current;if(!d||!f)return;const h=g=>u(g,f),m=g=>u(g,d);return d.addEventListener("pointerleave",h),f.addEventListener("pointerleave",m),()=>{d.removeEventListener("pointerleave",h),f.removeEventListener("pointerleave",m)}},[i,n,u,c]),p.useEffect(()=>{if(!o)return;const d=f=>{const h=n.current,m=i.current,g=f.target,b={x:f.clientX,y:f.clientY},v=(h==null?void 0:h.contains(g))||(m==null?void 0:m.contains(g)),y=!djt(b,o),w=g.hasAttribute("aria-haspopup");v?c():(y||w)&&(c(),t(!1))};return document.addEventListener("pointermove",d),()=>document.removeEventListener("pointermove",d)},[o,t,c,n,i]),p.useEffect(()=>{const d=f=>{if(i.current&&f.key==="Tab"&&!f.shiftKey){const[h]=sNe(i.current);h&&(f.preventDefault(),h.focus(),s.current=!0,document.removeEventListener("keydown",d))}};return document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d)}},[i,s]),a.jsx(ILe,{...e})},yjt=e=>{const{open:t,showOnHover:n,setOpen:i}=MM();return KA(t,()=>{i(!1)}),a.jsx(DRe,{forceMount:!0,children:a.jsx(G1,{enterDuration:600,exitDuration:300,className:NLe.Transition,disableAnimations:!0,children:t&&(n?a.jsx(bjt,{...e},"popover-hover"):a.jsx(ILe,{...e},"popover"))})})};$g.Trigger=gjt;$g.Content=yjt;const vjt=["skill_hub","skill_space","knowledge_base","tool"];function PLe(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m4 6 4 4 4-4"})})}function DLe({label:e}){return a.jsx("div",{className:"create-agent-card__loading",role:"status","aria-label":e,children:[0,1,2].map(t=>a.jsxs("div",{className:"create-agent-card__skeleton-row","aria-hidden":"true",children:[a.jsx("span",{}),a.jsx("span",{})]},t))})}function xjt(e,t){return e.kind==="tool"?t("blocks.createAgents.builtinTool"):e.kind==="knowledge_base"?t("blocks.createAgents.knowledgeBase"):e.source.startsWith("skill_hub:")?"Skill Hub":e.source.startsWith("skill_space:")?t("blocks.createAgents.skillCenter"):"Skill"}function L4({label:e,resources:t}){const{t:n}=Te("conversation");return t.length===0?null:a.jsxs("section",{className:"create-agent-card__popover-section",children:[a.jsx("h4",{children:e}),a.jsx("div",{className:"create-agent-card__popover-list",children:t.map(i=>a.jsxs("div",{className:"create-agent-card__popover-item",children:[a.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[a.jsx("strong",{children:i.name}),a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",children:xjt(i,n)})]}),i.description?a.jsx("p",{children:i.description}):null]},i.ref))})]})}function wjt({tools:e}){const{t}=Te("conversation");return e.length===0?null:a.jsxs("section",{className:"create-agent-card__popover-section",children:[a.jsx("h4",{children:t("blocks.createAgents.selfAuthoredTools")}),a.jsx(kLe,{children:e.map((n,i)=>a.jsxs(ALe,{className:"create-agent-card__python-tool",value:`${n.name}:${i}`,children:[a.jsx(TLe,{className:"create-agent-card__python-tool-header",children:a.jsxs(_Le,{className:"create-agent-card__python-tool-trigger",children:[a.jsxs("span",{children:[a.jsx("strong",{children:n.name}),n.description?a.jsx("small",{children:n.description}):null]}),a.jsxs("span",{className:"create-agent-card__python-tool-meta",children:[a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",children:t("blocks.createAgents.selfAuthoredTools")}),a.jsx(PLe,{className:"create-agent-card__python-tool-chevron"})]})]})}),a.jsxs(jLe,{className:"create-agent-card__python-tool-panel",children:[n.dependencies.length>0?a.jsx("div",{className:"create-agent-card__python-tool-dependencies",children:t("blocks.createAgents.dependencies",{items:n.dependencies.join(", ")})}):null,a.jsx("pre",{tabIndex:0,"aria-label":t("blocks.createAgents.fullCode",{name:n.name}),children:a.jsx("code",{children:n.code})})]})]},`${n.name}:${i}`))})]})}function Ojt({agents:e}){const{t}=Te("conversation");return e.length===0?null:a.jsxs("section",{className:"create-agent-card__popover-section",children:[a.jsx("h4",{children:t("blocks.createAgents.subAgents")}),a.jsx("div",{className:"create-agent-card__popover-list",children:e.map(n=>a.jsxs("div",{className:"create-agent-card__popover-item",children:[a.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[a.jsx("strong",{children:n.id}),a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",children:t(`blocks.createAgents.agentTypes.${n.type}`,{defaultValue:n.type})})]}),n.description?a.jsx("p",{children:n.description}):null]},n.id))})]})}function N_({label:e,count:t,icon:n,children:i}){const{t:r}=Te("conversation"),s=a.jsxs("button",{className:"create-agent-card__resource-metric",type:"button",disabled:t===0,"aria-label":r("blocks.createAgents.itemCount",{label:e,count:t}),children:[n,a.jsx("span",{children:t})]});return t===0?s:a.jsxs($g,{showOnHover:!0,hoverOpenDelay:120,children:[a.jsx($g.Trigger,{children:s}),a.jsx($g.Content,{side:"top",align:"start",minWidth:"auto",maxWidth:360,className:"create-agent-card__resource-popover",children:i})]})}function kjt({response:e,status:t}){const{t:n}=Te("conversation"),i=p.useMemo(()=>({tool:n("blocks.createAgents.sourceLabels.tool"),knowledge:n("blocks.createAgents.sourceLabels.knowledge"),skillCenter:n("blocks.createAgents.sourceLabels.skillCenter"),unknownSource:n("blocks.createAgents.sourceLabels.unknown"),unnamedResource:n("blocks.createAgents.unnamedResource"),unnamedAgent:n("blocks.createAgents.unnamedAgent")}),[n]),r=p.useMemo(()=>L_t(e,i),[i,e]),s=p.useMemo(()=>vjt.map(c=>{const u=$_t(r,c);return{value:c,label:n(`blocks.createAgents.categories.${c}`),...u,searchKeywords:[...new Set(u.sources.flatMap(d=>d.searchKeywords))]}}),[r,n]),o=t==="failed",l=o?DM(e):"";return a.jsx("section",{className:"create-agent-tool-card","aria-label":n("blocks.createAgents.collectionAria"),children:t==="running"?a.jsx(DLe,{label:n("blocks.createAgents.retrieving")}):o?a.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[a.jsx("span",{className:"create-agent-card__message-title",children:n("blocks.createAgents.retrievalFailed")}),a.jsx("span",{children:l||n("blocks.createAgents.checkConfig")})]}):a.jsx(kLe,{className:"create-agent-card__accordion",children:s.map(c=>a.jsxs(ALe,{className:"create-agent-card__accordion-item",value:c.value,children:[a.jsx(TLe,{className:"create-agent-card__accordion-header",children:a.jsxs(_Le,{className:"create-agent-card__accordion-trigger",children:[a.jsx("span",{children:c.label}),a.jsxs("span",{className:"create-agent-card__accordion-meta",children:[a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",children:c.sources.length===0?c.value==="skill_hub"?n("blocks.createAgents.notSearched"):n("blocks.createAgents.notConfigured"):c.resources.length}),a.jsx(PLe,{className:"create-agent-card__accordion-chevron"})]})]})}),a.jsx(jLe,{className:"create-agent-card__accordion-content",children:a.jsxs("div",{className:"create-agent-card__accordion-scroll",role:"region","aria-label":n("blocks.createAgents.resourceList",{label:c.label}),tabIndex:0,children:[c.value==="skill_hub"&&c.searchKeywords.length>0?a.jsxs("div",{className:"create-agent-card__search-keywords",children:[a.jsx("span",{children:n("blocks.createAgents.searchKeywords")}),a.jsx("span",{children:c.searchKeywords.join("、")})]}):null,c.resources.length>0?a.jsx("div",{className:"create-agent-card__resource-list",children:c.resources.map(u=>a.jsx("div",{className:"create-agent-card__resource",children:a.jsxs("div",{className:"create-agent-card__resource-main",children:[a.jsxs("div",{className:"create-agent-card__resource-title",children:[a.jsx("span",{className:"create-agent-card__resource-name",children:u.name}),u.version?a.jsx(Ya,{className:"create-agent-card__resource-version",color:"secondary",size:"sm",variant:"soft",children:u.version}):null]}),u.description?a.jsx("p",{children:u.description}):null]})},u.ref))}):a.jsxs("div",{className:"create-agent-card__empty-category",children:[a.jsx("p",{children:c.sources.length===0?c.value==="skill_hub"?n("blocks.createAgents.skillHubSkipped"):n("blocks.createAgents.sourceSkipped",{label:c.label}):n("blocks.createAgents.noResources")}),c.sources.filter(u=>u.message).map(u=>a.jsx("p",{className:"create-agent-card__raw-source-error",children:u.message},u.source))]})]})})]},c.value))},r.collectionId||"collected-resources")})}function Sjt({args:e,response:t,status:n}){const{t:i}=Te("conversation"),r=p.useMemo(()=>({tool:i("blocks.createAgents.sourceLabels.tool"),knowledge:i("blocks.createAgents.sourceLabels.knowledge"),skillCenter:i("blocks.createAgents.sourceLabels.skillCenter"),unknownSource:i("blocks.createAgents.sourceLabels.unknown"),unnamedResource:i("blocks.createAgents.unnamedResource"),unnamedAgent:i("blocks.createAgents.unnamedAgent")}),[i]),s=p.useMemo(()=>bLe(e,t,r),[e,r,t]),o=n==="failed"?DM(t):"";return a.jsxs("section",{className:"create-agent-tool-card is-agent-results","aria-label":i("blocks.createAgents.resultAria"),children:[o?a.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[a.jsx("span",{className:"create-agent-card__message-title",children:i("blocks.createAgents.creationFailed")}),a.jsx("span",{children:o})]}):null,s.agents.length>0?a.jsx("div",{className:"create-agent-card__agent-grid",children:s.agents.map(l=>{const c=n==="failed"?"failed":l.status,u=l.error||c==="failed"&&o,d=l.builtinTools.length+l.pythonTools.length;return a.jsxs(vH,{className:`create-agent-card__agent-card${u?" is-error":""}`,children:[a.jsx(xH,{leading:a.jsx(Jw,{seed:l.name}),title:l.name,titleText:l.name,status:a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",children:i(`blocks.createAgents.agentTypes.${l.rootType}`,{defaultValue:l.rootType})})}),l.description?a.jsx(wH,{children:l.description}):null,u?a.jsx("div",{className:"create-agent-card__agent-result is-error",role:"alert",children:u}):null,a.jsxs("div",{className:"create-agent-card__agent-resources","aria-label":i("blocks.createAgents.agentResources",{name:l.name}),children:[a.jsx(N_,{label:i("blocks.createAgents.skill"),count:l.skills.length,icon:a.jsx(pN,{"aria-hidden":"true"}),children:a.jsx(L4,{label:i("blocks.createAgents.skill"),resources:l.skills})}),a.jsx(N_,{label:i("blocks.createAgents.knowledgeBase"),count:l.knowledgeBases.length,icon:a.jsx(mIe,{"aria-hidden":"true"}),children:a.jsx(L4,{label:i("blocks.createAgents.knowledgeBase"),resources:l.knowledgeBases})}),a.jsxs(N_,{label:i("blocks.createAgents.toolsLabel"),count:d,icon:a.jsx(pat,{"aria-hidden":"true"}),children:[a.jsx(L4,{label:i("blocks.createAgents.builtinTool"),resources:l.builtinTools}),a.jsx(wjt,{tools:l.pythonTools})]}),a.jsx(N_,{label:i("blocks.createAgents.subAgents"),count:l.subAgentCount,icon:a.jsx(gat,{"aria-hidden":"true"}),children:a.jsx(Ojt,{agents:l.subAgents})})]})]},l.name)})}):n==="running"?a.jsx(DLe,{label:i("blocks.createAgents.creating")}):a.jsxs("div",{className:"create-agent-card__message",children:[a.jsx("span",{className:"create-agent-card__message-title",children:i("blocks.createAgents.noAgents")}),a.jsx("span",{children:i("blocks.createAgents.noAgentResult")})]})]})}const Ejt={web_search:{name:"web_search",runningLabel:"Searching the web",doneLabel:"Web search complete",tone:"search",icon:Pne},link_reader:{name:"link_reader",runningLabel:"Reading webpage",doneLabel:"Webpage read complete",tone:"search",icon:Pne},run_code:{name:"run_code",runningLabel:"Running code in the AgentKit sandbox",doneLabel:"Code execution completed in the AgentKit sandbox",tone:"sandbox",icon:m_t},list_envs:{name:"list_envs",runningLabel:"Checking available environments",doneLabel:"Available environments loaded",tone:"resources",icon:b_t},get_env_manifest:{name:"get_env_manifest",runningLabel:"Loading the environment manifest",doneLabel:"Environment manifest loaded",tone:"knowledge",icon:y_t},execute_in_sandbox:{name:"execute_in_sandbox",runningLabel:"Running a command in the environment",doneLabel:"Command completed in the environment",tone:"sandbox",icon:Mne},delegate_to_codex_sandbox:{name:"delegate_to_codex_sandbox",runningLabel:"Codex Sandbox is running",doneLabel:"Codex Sandbox completed",failedLabel:"Codex Sandbox failed",tone:"sandbox",icon:Mne},image_generate:{name:"image_generate",runningLabel:"Generating image",doneLabel:"Image generated",tone:"image",icon:u_t},video_generate:{name:"video_generate",runningLabel:"Generating video",doneLabel:"Video generated",tone:"video",icon:lq},ppt_generate:{name:"ppt_generate",runningLabel:"Generating presentation",doneLabel:"Presentation generated",tone:"presentation",icon:d_t},load_memory:{name:"load_memory",runningLabel:"Searching long-term memory",doneLabel:"Memory search complete",tone:"memory",icon:f_t},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"Searching the knowledge base",doneLabel:"Knowledge base search complete",tone:"knowledge",icon:h_t},load_skill:{name:"load_skill",runningLabel:"Loading skill",doneLabel:"Skill loaded",tone:"skill",icon:p_t},collect_resources:{name:"collect_resources",runningLabel:"Collecting available resources",doneLabel:"Resource collection complete",failedLabel:"Resource collection failed",tone:"resources",icon:g_t,detailRenderer:kjt},create_agents:{name:"create_agents",runningLabel:"Creating and running agents",doneLabel:"Agent creation complete",failedLabel:"Agent creation failed",tone:"agent",icon:Dne,detailRenderer:Sjt},branch_compare:{name:"branch_compare",runningLabel:"",doneLabel:"",failedLabel:"",tone:"search",icon:Dne,detailRenderer:U_t,hideHeader:!0}};function mq(e){return Ejt[e]}function Cjt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3h8l4 4v14H6Z"}),a.jsx("path",{d:"M14 3v5h5"}),a.jsx("path",{d:"m10 12-2 2 2 2M14 12l2 2-2 2"})]})}function Ajt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M12 3 19 6v5c0 4.6-2.8 7.8-7 10-4.2-2.2-7-5.4-7-10V6l7-3Z"}),a.jsx("path",{d:"m9 12 2 2 4-4"})]})}function Tjt(e,t){const n=new Map(e.map(o=>[o.path,o.content])),i=new Map(t.map(o=>[o.path,o.content])),r=new Set([...n.keys(),...i.keys()]),s=[];for(const o of[...r].sort((l,c)=>l.localeCompare(c))){const l=n.get(o),c=i.get(o);l!==c&&s.push({path:o,status:l===void 0?"added":c===void 0?"deleted":"modified",before:l??"",after:c??""})}return s}function Rb(e){return{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,...e}}function MLe(e){return a.jsx("svg",{...Rb(e),children:a.jsx("path",{d:"m9 7-5 5 5 5M15 7l5 5-5 5M13.5 4l-3 16"})})}function $4(e){return a.jsx("svg",{...Rb(e),children:a.jsx("path",{d:"M6.5 3.75h7l4 4V20.25h-11zM13.5 3.75v4h4M9 12h6M9 15.5h4.5"})})}function _jt(e){return a.jsx("svg",{...Rb(e),children:a.jsx("path",{d:"M3.75 7.25h6l1.75 2h8.75v9.25H3.75zM3.75 7.25V5.5h5l1.5 1.75"})})}function jjt(e){return a.jsx("svg",{...Rb(e),children:a.jsx("path",{d:"m9 5 7 7-7 7"})})}function mT(e){return a.jsx("svg",{...Rb(e),children:a.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function Njt(e){return a.jsxs("svg",{...Rb(e),children:[a.jsx("circle",{cx:"12",cy:"12",r:"3.25"}),a.jsx("path",{d:"M12 2.75v2M12 19.25v2M2.75 12h2M19.25 12h2M5.45 5.45l1.4 1.4M17.15 17.15l1.4 1.4M18.55 5.45l-1.4 1.4M6.85 17.15l-1.4 1.4"})]})}function Rjt(e){return a.jsx("svg",{...Rb(e),children:a.jsx("path",{d:"M19.25 15.25A8 8 0 0 1 8.75 4.75a8 8 0 1 0 10.5 10.5Z"})})}function LLe(e){return a.jsxs("svg",{...Rb(e),children:[a.jsx("path",{d:"M19.25 8.25V4.5l-1.8 1.8a7.5 7.5 0 1 0 1.8 7.65"}),a.jsx("path",{d:"M19.25 4.5H15.5"})]})}const Ijt=p.lazy(()=>Js(()=>Promise.resolve().then(()=>wFe),void 0)),Pjt=p.lazy(()=>Js(()=>import("../chunks/CodeDiffEditor-Dvmt5gm9.js"),[])),$Le="veadk-code-workspace-theme";function Djt(e){const t={name:"",children:new Map};for(const n of e){const i=n.path.split("/").filter(Boolean);let r=t;i.forEach((s,o)=>{let l=r.children.get(s);l||(l={name:s,children:new Map},r.children.set(s,l)),o===i.length-1&&(l.path=n.path),r=l})}return t}function Mjt(e,t=!1){return[...e.children.values()].sort((n,i)=>{const r=n.children.size>0&&n.path===void 0,s=i.children.size>0&&i.path===void 0;return r!==s?t?r?1:-1:r?-1:1:n.name.localeCompare(i.name)})}function Ljt(){if(typeof window>"u")return"light";try{return window.localStorage.getItem($Le)==="dark"?"dark":"light"}catch{return"light"}}function $jt(e){return e===""?0:e.split(` `).length}function r1({project:e,open:t,onClose:n,onChange:i,readOnly:r=!1,comparison:s}){var N;const{t:o}=Te("workspaceTools"),l=p.useId(),c=p.useRef(null),u=p.useRef(null),d=p.useRef(n),[f,h]=p.useState(Ljt),m=p.useMemo(()=>s?Tjt(s.baseProject.files,e.files):[],[s,e.files]),g=p.useMemo(()=>s?m.map(P=>({path:P.path,content:P.status==="deleted"?P.before:P.after})):e.files,[m,s,e.files]),b=p.useMemo(()=>new Map(m.map(P=>[P.path,P.status])),[m]),[v,y]=p.useState(((N=g[0])==null?void 0:N.path)??null),[w,x]=p.useState(new Set),O=p.useMemo(()=>Djt(g),[g]),k=g.find(P=>P.path===v)??null,S=m.find(P=>P.path===v)??null;if(d.current=n,p.useEffect(()=>{try{window.localStorage.setItem($Le,f)}catch{}},[f]),p.useEffect(()=>{var _;if(!t)return;const P=document.body.style.overflow,I=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(_=u.current)==null||_.focus();const D=L=>{if(L.key==="Escape"){L.preventDefault(),d.current();return}if(L.key!=="Tab"||!c.current)return;const F=[...c.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')].filter(q=>q.offsetParent!==null);if(F.length===0)return;const M=F[0],z=F[F.length-1];L.shiftKey&&document.activeElement===M?(L.preventDefault(),z.focus()):!L.shiftKey&&document.activeElement===z&&(L.preventDefault(),M.focus())};return window.addEventListener("keydown",D),()=>{document.body.style.overflow=P,window.removeEventListener("keydown",D),I!=null&&I.isConnected&&I.focus()}},[t]),p.useEffect(()=>{k||g.length===0||y(g[0].path)},[g,k]),!t)return null;function C(P){x(I=>{const D=new Set(I);return D.has(P)?D.delete(P):D.add(P),D})}function E(P){return P?a.jsx("span",{className:`code-browser-change is-${P}`,children:o(`codeBrowser.change.${P}`)}):null}function j(P,I,D){return Mjt(P,I===0).map(_=>{const L=D?`${D}/${_.name}`:_.name;if(!(_.children.size>0&&_.path===void 0)&&_.path){const z=b.get(_.path);return a.jsxs("button",{type:"button",className:`code-browser-file${v===_.path?" is-active":""}`,style:{paddingLeft:`${12+I*16}px`},onClick:()=>y(_.path??null),title:_.path,"aria-pressed":v===_.path,children:[a.jsx($4,{}),a.jsx("span",{children:_.name}),E(z)]},L)}const M=w.has(L);return a.jsxs("div",{children:[a.jsxs("button",{type:"button",className:"code-browser-folder",style:{paddingLeft:`${10+I*16}px`},onClick:()=>C(L),"aria-expanded":!M,children:[a.jsx(jjt,{className:M?"":"is-open"}),a.jsx(_jt,{}),a.jsx("span",{children:_.name})]}),!M&&j(_,I+1,L)]},L)})}function T(P){!k||s||i({...e,files:e.files.map(I=>I.path===k.path?{...I,content:P}:I)})}const R=f==="light"?"dark":"light",A=o(s?"codeBrowser.noChanges":"codeBrowser.chooseFile");return vi.createPortal(a.jsx("div",{className:"code-browser-backdrop",onMouseDown:P=>{P.target===P.currentTarget&&n()},children:a.jsxs("section",{ref:c,className:`code-browser-dialog is-${f}`,role:"dialog","aria-modal":"true","aria-labelledby":l,children:[a.jsxs("header",{className:"code-browser-head",children:[a.jsxs("div",{className:"code-browser-title-wrap",children:[a.jsx("span",{className:"code-browser-title-icon",children:a.jsx(MLe,{})}),a.jsxs("div",{children:[a.jsx("h2",{id:l,children:o(s?"codeBrowser.compareTitle":"codeBrowser.workspaceTitle")}),a.jsx("p",{title:e.name,children:e.name||o("codeBrowser.projectFallback")})]})]}),a.jsxs("div",{className:"code-browser-head-actions",children:[a.jsx("button",{type:"button",className:"code-browser-icon-button",onClick:()=>h(R),"aria-label":o("codeBrowser.switchTheme"),title:o("codeBrowser.switchThemeTitle",{theme:o(`codeBrowser.themes.${R}`)}),children:f==="light"?a.jsx(Rjt,{}):a.jsx(Njt,{})}),a.jsx("button",{ref:u,type:"button",className:"code-browser-icon-button",onClick:n,"aria-label":o("codeBrowser.closeWorkspace"),title:o("codeBrowser.close"),children:a.jsx(mT,{})})]})]}),a.jsxs("div",{className:"code-browser-workspace",children:[a.jsxs("aside",{className:"code-browser-sidebar","aria-label":o(s?"codeBrowser.changedFiles":"codeBrowser.projectFiles"),children:[a.jsxs("div",{className:"code-browser-sidebar-head",children:[a.jsx("span",{children:o(s?"codeBrowser.changes":"codeBrowser.files")}),a.jsx("span",{children:g.length})]}),a.jsx("div",{className:"code-browser-tree",children:g.length>0?j(O,0,""):a.jsx("div",{className:"code-browser-empty",children:A})})]}),a.jsxs("main",{className:"code-browser-main",children:[a.jsx("div",{className:"code-browser-tabs",role:"tablist","aria-label":o("codeBrowser.openFiles"),children:k?a.jsxs("div",{className:"code-browser-tab",role:"tab","aria-selected":"true",children:[a.jsx($4,{}),a.jsx("span",{children:k.path.split("/").pop()}),E(S==null?void 0:S.status)]}):null}),a.jsxs("div",{className:"code-browser-path",children:[a.jsx($4,{}),a.jsx("span",{children:(k==null?void 0:k.path)??o("codeBrowser.noFileSelected")})]}),s?a.jsxs("div",{className:"code-browser-diff-labels","aria-label":o("codeBrowser.comparisonDirection"),children:[a.jsx("span",{children:s.baseLabel??o("codeBrowser.before")}),a.jsx("span",{children:s.targetLabel??o("codeBrowser.after")})]}):null,a.jsx("div",{className:"code-browser-editor",children:k?a.jsx(p.Suspense,{fallback:a.jsx("div",{className:"code-browser-empty",children:o("codeBrowser.loadingEditor")}),children:S?a.jsx(Pjt,{before:S.before,after:S.after,path:S.path,theme:f}):a.jsx(Ijt,{value:k.content,path:k.path,onChange:T,readOnly:r,theme:f})}):a.jsx("div",{className:"code-browser-empty",children:A})}),a.jsxs("footer",{className:"code-browser-statusbar",children:[a.jsx("span",{children:s?o("codeBrowser.changedFileCount",{count:m.length}):o("codeBrowser.fileCount",{count:e.files.length})}),a.jsx("span",{children:k?o("codeBrowser.lineCount",{count:$jt(k.content)}):"UTF-8"})]})]})]})]})}),document.body)}function Fjt({project:e,onChange:t,className:n="",label:i}){const{t:r}=Te("workspaceTools"),[s,o]=p.useState(!1),l=i??r("codeBrowser.viewSource");return a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:`code-browser-trigger ${n}`.trim(),onClick:()=>o(!0),"aria-label":r("codeBrowser.viewSourceAria"),title:l,children:[a.jsx(MLe,{}),a.jsx("span",{children:l})]}),a.jsx(r1,{project:e,open:s,onClose:()=>o(!1),onChange:t})]})}const fy="••••••••",R_=5,Fv=8e3,Bjt=8,Ujt=/(?:authorization|cookie|password|passwd|secret|token|api[_-]?key|access[_-]?key|credential|signature|^env(?:ironment)?$|^ak$|^sk$)/i,FLe=/\u001b\[[0-?]*[ -/]*[@-~]/g,BLe=/\u001b\][^\u0007]*(?:\u0007|\u001b\\)/g,ULe=/[\u0000-\u0008\u000b\u000c\u000e-\u001a\u001c-\u001f\u007f-\u009f]/g,Qjt=new Set(["exec_command","commandExecution","command_execution","run_code","execute_in_sandbox","Run command"]),zjt=new Set(["web_search","search","grep","rg"]),Vjt=new Set(["read_file","read","list_files","glob","ls"]),Hjt=new Set(["apply_patch","file_change","fileChange"]),qjt=new Set(["create_goal","update_goal","get_goal"]);function xg(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function p0(...e){for(const t of e)if(typeof t=="string"&&t.trim())return t.trim();return""}function F4(...e){for(const t of e){if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"&&t.trim()&&Number.isFinite(Number(t)))return Number(t)}}function II(e){const t=xg(e);if(!t)return[];const n=[t];for(const i of["payload","input","arguments","args","goal","result","display","safeCommandSummary","safeInputSummary"]){const r=xg(t[i]);r&&n.push(r)}return n}function uE(e,...t){return p0(...e.flatMap(n=>t.map(i=>n[i])))}function Wjt(e){let t=e.replace(FLe,"").replace(BLe,"").replace(ULe,"");return/[=:]|Bearer|Cookie|AKLT/i.test(t)&&(t=t.replace(/\bBearer\s+[^\s,;]+/gi,`Bearer ${fy}`).replace(/\b(?:set-)?cookie\s*:\s*[^\r\n]*/gi,`cookie: ${fy}`).replace(/\bAKLT[A-Za-z0-9_-]{6,}\b/g,fy).replace(/((?:access[_-]?key(?:[_-]?id)?|secret(?:[_-]?(?:access)?[_-]?key)?|session[_-]?token|security[_-]?token|client[_-]?secret|api[_-]?key|authorization|cookie|[a-z0-9_-]{0,80}(?:password|secret|token)|credential|ak|sk)\s*[:=]\s*)(?:"[^"]*"|'[^']*'|[^\s,;&]+)/gi,`$1${fy}`).replace(/([?&](?:access[_-]?key|api[_-]?key|client[_-]?secret|security[_-]?token|session[_-]?token|secret|token|password|authorization|cookie|credential)=)[^&#\s]+/gi,`$1${fy}`).replace(/([?&](?:x-amz-(?:credential|signature|security-token)|x-tos-signature|signature)=)[^&#\s]+/gi,`$1${fy}`)),t}function sf(e){return Wjt(e).replace(FLe,"").replace(BLe,"").replace(ULe,"")}function PI(e,t=0,n=new WeakSet){if(t>=Bjt)return"[truncated: maximum depth]";if(typeof e=="string")return sf(e);if(e===null||typeof e!="object")return e;if(n.has(e))return"[circular]";if(n.add(e),Array.isArray(e))return e.map(r=>PI(r,t+1,n));const i=xg(e);return i?Object.fromEntries(Object.entries(i).map(([r,s])=>[r,Ujt.test(r)?fy:PI(s,t+1,n)])):e}function B4(e){const t=sf(e).trimEnd();if(!t)return;const n=t.split(/\r?\n/);return t.length>Fv*2?{text:t.slice(0,Fv)+t.slice(-Fv),head:[t.slice(0,Fv)],tail:[t.slice(-Fv)],omittedLines:0,omittedCharacters:t.length-Fv*2}:n.length<=R_*2?{text:t,head:n,tail:[],omittedLines:0,omittedCharacters:0}:{text:t,head:n.slice(0,R_),tail:n.slice(-R_),omittedLines:n.length-R_*2,omittedCharacters:0}}function Kjt(e){return qjt.has(e)?"goal":Qjt.has(e)?"command":zjt.has(e)||/search/i.test(e)?"search":Vjt.has(e)||/(?:read|list|glob)/i.test(e)?"read":Hjt.has(e)||/(?:write|edit|patch|file.?change)/i.test(e)?"file-change":/^(?:mcp|tool__)/i.test(e)||e.includes("/")?"mcp":/auth|credential|approval/i.test(e)?"authorization":"generic"}function Gjt(e,t){if(e.status)return e.status;const n=p0(t==null?void 0:t.status).toLowerCase();return(t==null?void 0:t.ok)===!1||["failed","error","cancelled","denied","timeout"].includes(n)?"failed":e.done||["completed","done","success"].includes(n)?"completed":"running"}function Qne(e){return typeof e=="string"?e.trim()?[e.trim()]:[]:Array.isArray(e)?e.flatMap(t=>{if(typeof t=="string")return t.trim()?[t.trim()]:[];const n=xg(t),i=p0(n==null?void 0:n.path,n==null?void 0:n.filename,n==null?void 0:n.name);return i?[i]:[]}):[]}function Xjt(e,t,n,i,r){const s=[...II(n),...II(i)];return e==="goal"?sf(uE(s,"objective","title","name")):e==="command"?sf(uE(s,"command","cmd","script","commandPreview","binary")):e==="search"?sf(uE(s,"query","pattern","search")):e==="read"||e==="file-change"?r.slice(0,2).map(sf).join(", "):sf(e==="mcp"?p0(n==null?void 0:n.query,n==null?void 0:n.resource,n==null?void 0:n.path):p0(n==null?void 0:n.title,n==null?void 0:n.name,i==null?void 0:i.message,i==null?void 0:i.status,t))}function gq(e){const t=xg(e.args),n=xg(e.response),i=e.args===void 0?void 0:PI(e.args),r=e.response===void 0?void 0:PI(e.response),s=[...II(e.args),...II(e.response)],o=Kjt(e.name),l=Gjt(e,n),c=xg(n==null?void 0:n.display)??xg(t==null?void 0:t.display),u=p0(n==null?void 0:n.aggregatedOutput,n==null?void 0:n.aggregated_output,n==null?void 0:n.output,n==null?void 0:n.errorMessage,n==null?void 0:n.error_message),d=[...Qne((t==null?void 0:t.paths)??(t==null?void 0:t.files)??(t==null?void 0:t.changes)??(t==null?void 0:t.path)),...Qne((n==null?void 0:n.paths)??(n==null?void 0:n.files)??(n==null?void 0:n.changes))],f=F4(n==null?void 0:n.exitCode,n==null?void 0:n.exit_code),h=F4(n==null?void 0:n.durationMs,n==null?void 0:n.duration_ms,c==null?void 0:c.durationMs),m=F4(n==null?void 0:n.count,n==null?void 0:n.total,n==null?void 0:n.totalCount);return{category:o,titleKey:o==="generic"?`generic.named.${l}`:`${o}.${l}`,titleParams:o==="generic"?{tool:e.name}:void 0,title:e.title,summary:Xjt(o,e.name,t,n,d),status:l,source:e.source,command:o==="command"?sf(p0(uE(s,"command","cmd","script","commandPreview","binary"))):void 0,cwd:o==="command"&&sf(uE(s,"cwd"))||void 0,output:B4(u),exitCode:f,durationMs:h,resultCount:m,paths:[...new Set(d.map(sf))],defaultOpen:e.defaultOpen===!0||l==="running"||l==="failed",rawArgs:i,rawResponse:r,rawArgsPreview:i===void 0?void 0:B4(zne(i)),rawResponsePreview:r===void 0?void 0:B4(zne(r))}}function zne(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}function Vne(e){return e.status==="completed"&&(e.category==="read"||e.category==="search")}function Rd(e){return{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,...e}}function Yjt(e){return a.jsxs("svg",{...Rd(e),children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),a.jsx("path",{d:"m7.5 9 2.7 2.5L7.5 14M12.7 14h3.8M3.8 7.5h16.4"})]})}function QLe(e){return a.jsxs("svg",{...Rd(e),children:[a.jsx("path",{d:"M6 3.5h7l5 5v12H6zM13 3.5v5h5M8.8 13h5.7M8.8 16h3.8"}),a.jsx("circle",{cx:"16.8",cy:"16.5",r:"2.3"}),a.jsx("path",{d:"m18.5 18.2 1.8 1.8"})]})}function Zjt(e){return a.jsxs("svg",{...Rd(e),children:[a.jsx("circle",{cx:"10.5",cy:"10.5",r:"5.75"}),a.jsx("path",{d:"m15 15 4.25 4.25"})]})}function Jjt(e){return a.jsxs("svg",{...Rd(e),children:[a.jsx("path",{d:"M5.5 3.5h7l4 4v4M12.5 3.5v4h4M10.5 20.5h-5v-17"}),a.jsx("path",{d:"m12.5 17.5 5.6-5.6 2 2-5.6 5.6-2.8.8z"})]})}function eNt(e){return a.jsxs("svg",{...Rd(e),children:[a.jsx("path",{d:"M8 8V4.5M16 8V4.5M6.5 8h11v3.5a5.5 5.5 0 0 1-11 0zM12 17v3"}),a.jsx("path",{d:"M5.5 4.5h5M13.5 4.5h5"})]})}function tNt(e){return a.jsxs("svg",{...Rd(e),children:[a.jsx("path",{d:"M12 3.5 19 6v5.2c0 4.3-2.7 7.6-7 9.3-4.3-1.7-7-5-7-9.3V6z"}),a.jsx("path",{d:"m8.8 12 2 2 4.4-4.4"})]})}function Hne(e){return a.jsx("svg",{...Rd(e),children:a.jsx("path",{d:"M14.8 6.2a4.1 4.1 0 0 0-5.6 5.6l-5.4 5.4a2 2 0 0 0 2.8 2.8l5.4-5.4a4.1 4.1 0 0 0 5.6-5.6l-2.5 2.5-2.6-.6-.6-2.6z"})})}function bq(e){return a.jsx("svg",{...Rd(e),children:a.jsx("path",{d:"m9 5 7 7-7 7"})})}function zLe(e){return a.jsx("svg",{...Rd(e),children:a.jsx("path",{d:"m5 12.5 4.5 4.5L19 7.5"})})}function nNt(e){return a.jsxs("svg",{...Rd(e),children:[a.jsx("circle",{cx:"12",cy:"12",r:"8.5"}),a.jsx("path",{d:"M12 7.5v5.25M12 16.25h.01"})]})}function iNt(e){return a.jsx("svg",{...Rd(e),children:a.jsx("path",{d:"M20 12a8 8 0 1 1-2.35-5.65"})})}function rNt(e){return a.jsxs("svg",{...Rd(e),children:[a.jsx("rect",{x:"8",y:"8",width:"11",height:"11",rx:"2"}),a.jsx("path",{d:"M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2"})]})}const sNt={goal:Hne,command:Yjt,read:QLe,search:Zjt,"file-change":Jjt,mcp:eNt,authorization:tNt,generic:Hne};function aNt(e){return e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(e<1e4?1:0)} s`}function VLe(e){if(e===void 0)return"";if(typeof e=="string"){const t=e.trim();if(t.startsWith("{")||t.startsWith("["))try{return JSON.stringify(JSON.parse(t),null,2)}catch{return e}return e}try{return JSON.stringify(e,null,2)}catch{return String(e)}}function oNt({status:e}){return e==="running"||e==="queued"?a.jsx(iNt,{className:"tool-activity__status-icon is-spinning"}):e==="failed"?a.jsx(nNt,{className:"tool-activity__status-icon"}):a.jsx(zLe,{className:"tool-activity__status-icon"})}function lNt({presentation:e,callId:t}){const{t:n}=Te("conversation"),[i,r]=p.useState(!1),[s,o]=p.useState(""),[l,c]=p.useState(!1),u=p.useRef(void 0);p.useEffect(()=>()=>window.clearTimeout(u.current),[]);const d=async(f,h)=>{window.clearTimeout(u.current);try{await navigator.clipboard.writeText(typeof h=="string"?h:VLe(h)),o(f),c(!1),u.current=window.setTimeout(()=>o(""),1500)}catch{o(""),c(!0),u.current=window.setTimeout(()=>c(!1),3e3)}};return e.rawArgs===void 0&&e.rawResponse===void 0&&!t?null:a.jsxs("div",{className:"tool-activity__raw",children:[a.jsxs("button",{type:"button",onClick:()=>r(f=>!f),"aria-expanded":i,children:[n("blocks.toolActivity.rawData"),a.jsx(bq,{className:i?"is-open":""})]}),i?a.jsxs("div",{className:"tool-activity__raw-body",children:[t?a.jsxs("div",{className:"tool-activity__raw-id",children:[a.jsx("span",{children:n("blocks.toolActivity.callId")}),a.jsx("code",{children:t}),a.jsx("button",{type:"button",onClick:()=>void d("id",t),"aria-label":n("blocks.toolActivity.copyCallId"),children:a.jsx(rNt,{})})]}):null,e.rawArgs!==void 0?a.jsx(qne,{label:n("blocks.arguments"),value:e.rawArgs,preview:e.rawArgsPreview,copied:s==="input",onCopy:()=>void d("input",e.rawArgs)}):null,e.rawResponse!==void 0?a.jsx(qne,{label:n("blocks.result"),value:e.rawResponse,preview:e.rawResponsePreview,copied:s==="result",onCopy:()=>void d("result",e.rawResponse)}):null,l?a.jsx("span",{className:"tool-activity__copy-error",role:"alert",children:n("blocks.toolActivity.copyFailed")}):null]}):null]})}function qne({label:e,value:t,preview:n,copied:i,onCopy:r}){const{t:s}=Te("conversation");return a.jsxs("section",{className:"tool-activity__raw-section",children:[a.jsxs("div",{children:[a.jsx("span",{children:e}),a.jsx("button",{type:"button",onClick:r,children:s(i?"blocks.toolActivity.copied":"blocks.toolActivity.copy")})]}),a.jsxs("pre",{children:[(n==null?void 0:n.head.join(` `))??VLe(t),n&&n.omittedCharacters>0?` ${s("blocks.toolActivity.omittedCharacters",{count:n.omittedCharacters})} @@ -1088,9 +1088,9 @@ ${C.region} · ${C.runtimeId}`}});return a.jsxs("div",{className:"mpa-channels-c `))t.push(r);continue}const i=[[]];for(const r of n)r.text.split(` `).forEach((s,o)=>{o>0&&i.push([]),s&&i[i.length-1].push({...r,text:s})});for(const r of i){const s=r[r.length-1];s!=null&&s.text.endsWith("\r")&&(s.text=s.text.slice(0,-1)),t.push(r)}}return t}function ML({title:e="Request example",lines:t,language:n="auto",wordWrap:i=!1,showLineNumbers:r=!0,actions:s,children:o,scrollAreaProps:l,className:c="",...u}){const d=p.useId(),[f,h]=p.useState(""),m=p.useMemo(()=>t.map(x=>typeof x=="string"?x:x.map(O=>O.text).join("")).join(` `),[t]),g=p.useMemo(()=>Fnn(t),[t]),b=!o&&t.some(x=>typeof x=="string"),v=p.useMemo(()=>b?Lnn(m,n):[],[m,n,b]);async function y(){try{await navigator.clipboard.writeText(m),h("Copied")}catch{h("Unable to copy, select the code to copy manually")}}const w=o??a.jsx("div",{className:"studio-code-block__viewport",tabIndex:0,role:"region","aria-label":e,children:a.jsx("pre",{children:a.jsx("code",{children:g.map((x,O)=>{var k;return a.jsxs("span",{className:"studio-code-block__line",children:[r&&a.jsx("span",{className:"studio-code-block__number","aria-hidden":"true",children:String(O+1).padStart(2,"0")}),a.jsxs("span",{className:"studio-code-block__text",children:[typeof x=="string"?(k=v[O])==null?void 0:k.map((S,C)=>a.jsx("span",{className:S.color?`studio-code-block__token--${S.color}`:void 0,children:S.text},C)):x.map((S,C)=>a.jsx("span",{style:{color:S.color},children:S.text},C)),` -`]})]},O)})})})});return a.jsxs("section",{...u,"aria-labelledby":d,"data-word-wrap":i||void 0,"data-line-numbers":r,className:`studio-code-block ${c}`.trim(),children:[a.jsxs("header",{className:"studio-code-block__header",children:[a.jsx("h3",{id:d,children:e}),a.jsxs("div",{className:"studio-code-block__actions",children:[a.jsx(Ki,{variant:"ghost",iconOnly:!0,"aria-label":"Copy code",title:f||"Copy code",onClick:y,startIcon:a.jsx($nn,{})}),s]})]}),l?a.jsx(vf,{...l,children:w}):w,a.jsx("span",{className:"studio-code-block__status",role:"status",children:f})]})}function Bnn(e,t){if(t==="plaintext"||t==="text")return;const n=e.toLowerCase().split(".").pop(),i={js:"babel",jsx:"babel",javascript:"babel",mjs:"babel",cjs:"babel",ts:"typescript",tsx:"typescript",typescript:"typescript",mts:"typescript",cts:"typescript",json:"json",jsonc:"jsonc",json5:"json5",css:"css",scss:"scss",less:"less",html:"html",yaml:"yaml",yml:"yaml",md:"markdown",markdown:"markdown"};return(t&&Object.prototype.hasOwnProperty.call(i,t)?i[t]:void 0)??(n&&Object.prototype.hasOwnProperty.call(i,n)?i[n]:void 0)}async function Unn(e){const t=()=>Js(()=>import("../chunks/estree-B2JyRpo9.js"),[]).then(n=>n);return e==="typescript"?Promise.all([Js(()=>import("../chunks/typescript-CNrcnk9t.js"),[]),t()]):["babel","json","jsonc","json5"].includes(e)?Promise.all([Js(()=>import("../chunks/babel-q9-XJZEE.js"),[]),t()]):["css","scss","less"].includes(e)?[await Js(()=>import("../chunks/postcss-DljguZco.js"),[])]:e==="html"?[await Js(()=>import("../chunks/html-B-qLsy26.js"),[])]:e==="yaml"?[await Js(()=>import("../chunks/yaml-BZTmqMMi.js"),[])]:[await Js(()=>import("../chunks/markdown-pdCxO8nx.js"),[])]}async function Qnn(e,t,n){const i=Bnn(t,n);if(!i||!e.trim())return e;const[{format:r},s]=await Promise.all([Js(()=>import("../chunks/standalone-BazYaFez.js"),[]),Unn(i)]);return r(e,{parser:i,plugins:s,printWidth:80,tabWidth:2,embeddedLanguageFormatting:"off"})}const znn=p.lazy(()=>Js(()=>import("../chunks/FileExplorerEditor-B8Ub9k9b.js"),[]).then(e=>({default:e.FileExplorerEditor})));function J9e(e){return typeof e.content=="string"?e.content:e.content.map(t=>typeof t=="string"?t:t.map(n=>n.text).join("")).join(` +`]})]},O)})})})});return a.jsxs("section",{...u,"aria-labelledby":d,"data-word-wrap":i||void 0,"data-line-numbers":r,className:`studio-code-block ${c}`.trim(),children:[a.jsxs("header",{className:"studio-code-block__header",children:[a.jsx("h3",{id:d,children:e}),a.jsxs("div",{className:"studio-code-block__actions",children:[a.jsx(Ki,{variant:"ghost",iconOnly:!0,"aria-label":"Copy code",title:f||"Copy code",onClick:y,startIcon:a.jsx($nn,{})}),s]})]}),l?a.jsx(vf,{...l,children:w}):w,a.jsx("span",{className:"studio-code-block__status",role:"status",children:f})]})}function Bnn(e,t){if(t==="plaintext"||t==="text")return;const n=e.toLowerCase().split(".").pop(),i={js:"babel",jsx:"babel",javascript:"babel",mjs:"babel",cjs:"babel",ts:"typescript",tsx:"typescript",typescript:"typescript",mts:"typescript",cts:"typescript",json:"json",jsonc:"jsonc",json5:"json5",css:"css",scss:"scss",less:"less",html:"html",yaml:"yaml",yml:"yaml",md:"markdown",markdown:"markdown"};return(t&&Object.prototype.hasOwnProperty.call(i,t)?i[t]:void 0)??(n&&Object.prototype.hasOwnProperty.call(i,n)?i[n]:void 0)}async function Unn(e){const t=()=>Js(()=>import("../chunks/estree-B2JyRpo9.js"),[]).then(n=>n);return e==="typescript"?Promise.all([Js(()=>import("../chunks/typescript-CNrcnk9t.js"),[]),t()]):["babel","json","jsonc","json5"].includes(e)?Promise.all([Js(()=>import("../chunks/babel-q9-XJZEE.js"),[]),t()]):["css","scss","less"].includes(e)?[await Js(()=>import("../chunks/postcss-DljguZco.js"),[])]:e==="html"?[await Js(()=>import("../chunks/html-B-qLsy26.js"),[])]:e==="yaml"?[await Js(()=>import("../chunks/yaml-BZTmqMMi.js"),[])]:[await Js(()=>import("../chunks/markdown-pdCxO8nx.js"),[])]}async function Qnn(e,t,n){const i=Bnn(t,n);if(!i||!e.trim())return e;const[{format:r},s]=await Promise.all([Js(()=>import("../chunks/standalone-BazYaFez.js"),[]),Unn(i)]);return r(e,{parser:i,plugins:s,printWidth:80,tabWidth:2,embeddedLanguageFormatting:"off"})}const znn=p.lazy(()=>Js(()=>import("../chunks/FileExplorerEditor-KCeE5MIo.js"),[]).then(e=>({default:e.FileExplorerEditor})));function J9e(e){return typeof e.content=="string"?e.content:e.content.map(t=>typeof t=="string"?t:t.map(n=>n.text).join("")).join(` `)}function Vnn(){return a.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M5 3.5h11L20.5 8v11a1.5 1.5 0 0 1-1.5 1.5H5A1.5 1.5 0 0 1 3.5 19V5A1.5 1.5 0 0 1 5 3.5Z"}),a.jsx("path",{d:"M7.5 3.5v6h8v-6M7.5 20.5v-7h9v7M13 5.5v2"})]})}function Hnn({file:e,draft:t,allowEdit:n,autoFormat:i,wordWrap:r,saving:s,error:o,canSave:l,onEdit:c,onSave:u}){const d=J9e(e),f=e.language??Z9e(e.name).language,h=t!==void 0,[m,g]=p.useState();p.useEffect(()=>{if(!i||h)return;let O=!1;return Qnn(d,e.name,f).then(k=>{O||g({source:d,language:f,name:e.name,content:k})},()=>{O||g({source:d,language:f,name:e.name,content:d,error:"无法格式化,已保留原文"})}),()=>{O=!0}},[d,e.name,f,i,h]);const b=!i||(m==null?void 0:m.source)===d&&m.language===f&&m.name===e.name,v=i&&b?(m==null?void 0:m.content)??d:d,y=(t==null?void 0:t.content)??v,w=t?t.content!==t.savedContent:!1,x=a.jsx("div",{className:"studio-file-explorer__editor-loading",children:a.jsx(o0,{size:28})});return a.jsxs("div",{className:"studio-file-explorer__pane",children:[a.jsx(ML,{className:"studio-file-explorer__code",title:e.name,language:f,wordWrap:r,scrollAreaProps:{orientation:r?"vertical":"both",className:"studio-file-explorer__content","aria-label":`${e.name} 文件内容`,tabIndex:0},lines:!t&&!i&&typeof e.content!="string"?e.content:y.split(` -`),onKeyDown:O=>{n&&(O.metaKey||O.ctrlKey)&&O.key.toLowerCase()==="s"&&!O.nativeEvent.isComposing&&(O.preventDefault(),l&&w&&!s&&u(y))},actions:n?a.jsx(Ki,{variant:"ghost",iconOnly:!0,startIcon:a.jsx(Vnn,{}),"aria-label":`保存 ${e.name}`,title:l?w?"保存文件":"没有未保存的修改":"未配置保存操作",disabled:!l||!w,loading:s,onClick:()=>u(y)}):void 0,children:n?b||t?a.jsx(p.Suspense,{fallback:x,children:a.jsx(znn,{name:e.name,language:f,value:y,wordWrap:r,onChange:O=>c(O,v)})}):x:void 0}),o?a.jsx("div",{className:"studio-file-explorer__message studio-file-explorer__message--error",role:"alert",children:o}):i&&b&&(m!=null&&m.error)?a.jsx("div",{className:"studio-file-explorer__message",role:"status",children:m.error}):null]})}function e7e(e,t){for(const n of e){if(n.type==="file"&&n.id===t)return n;if(n.type==="folder"){const i=e7e(n.children,t);if(i)return i}}}function t7e(e,t,n=0,i){return e.flatMap((r,s)=>[{entry:r,depth:n,parentId:i,position:s+1,count:e.length},...r.type==="folder"&&t.has(r.id)?t7e(r.children,t,n+1,r.id):[]])}function qnn({entries:e,selectedId:t,defaultSelectedId:n=null,onSelect:i,expandedIds:r,defaultExpandedIds:s=[],onExpandedChange:o,treeLabel:l="文件",allowEdit:c=!1,onEdit:u,onSave:d,autoFormat:f=!0,wordWrap:h=!0,renderPreview:m,height:g,narrowLayout:b="split",className:v="",style:y,...w}){var Y,X,ie;const[x,O]=p.useState(n),[k,S]=p.useState(s),[C,E]=p.useState(null),[j,T]=p.useState(new Map),[R,A]=p.useState(new Set),[N,P]=p.useState(new Map),I=p.useRef(new Set),D=p.useRef(!0);p.useEffect(()=>(D.current=!0,()=>{D.current=!1}),[]);const _=p.useRef(new Map),L=t===void 0?x:t,F=p.useMemo(()=>new Set(r??k),[r,k]),M=p.useMemo(()=>t7e(e,F),[e,F]),z=p.useMemo(()=>e7e(e,L),[e,L]),q=z?J9e(z):"",U=z?j.get(z.id):void 0,J=U&&(U.content!==U.savedContent||q===U.source||q===U.savedContent)?U:void 0,V=((Y=M.find(ee=>ee.entry.id===C))==null?void 0:Y.entry.id)??((X=M.find(ee=>ee.entry.id===L))==null?void 0:X.entry.id)??((ie=M[0])==null?void 0:ie.entry.id);function Z(ee,be){!z||!c||(T(ue=>new Map(ue).set(z.id,{source:q,content:ee,savedContent:(J==null?void 0:J.savedContent)??be})),P(ue=>new Map(ue).set(z.id,void 0)),u==null||u(z.id,ee,z))}async function ne(ee){if(!z||!c||!d||I.current.has(z.id))return;const be=z;I.current.add(be.id),A(new Set(I.current)),P(ue=>new Map(ue).set(be.id,void 0));try{await d(be.id,ee,be),D.current&&T(ue=>{var pe;return new Map(ue).set(be.id,{source:q,content:((pe=ue.get(be.id))==null?void 0:pe.content)??ee,savedContent:ee})})}catch{D.current&&P(ue=>new Map(ue).set(be.id,"保存失败,请重试"))}finally{I.current.delete(be.id),D.current&&A(new Set(I.current))}}function W(ee){const be=new Set(F);be.has(ee)?be.delete(ee):be.add(ee);const ue=[...be];r===void 0&&S(ue),o==null||o(ue)}function G(ee){ee.type==="folder"?W(ee.id):(t===void 0&&O(ee.id),i==null||i(ee.id,ee))}function H(ee){if(!ee)return;E(ee);const be=_.current.get(ee);be==null||be.focus({preventScroll:!0}),be==null||be.scrollIntoView({block:"nearest",inline:"nearest"})}function se(ee,be,ue){var ke,je,Pe,Ee,Qe;const{entry:pe}=be;switch(ee.key){case"ArrowDown":ee.preventDefault(),H((ke=M[Math.min(ue+1,M.length-1)])==null?void 0:ke.entry.id);break;case"ArrowUp":ee.preventDefault(),H((je=M[Math.max(ue-1,0)])==null?void 0:je.entry.id);break;case"ArrowRight":ee.preventDefault(),pe.type==="folder"&&(F.has(pe.id)?H((Pe=pe.children[0])==null?void 0:Pe.id):W(pe.id));break;case"ArrowLeft":ee.preventDefault(),pe.type==="folder"&&F.has(pe.id)?W(pe.id):H(be.parentId);break;case"Home":ee.preventDefault(),H((Ee=M[0])==null?void 0:Ee.entry.id);break;case"End":ee.preventDefault(),H((Qe=M[M.length-1])==null?void 0:Qe.entry.id);break;case"Enter":case" ":ee.preventDefault(),G(pe);break}}return a.jsxs("div",{...w,className:`studio-file-explorer ${v}`.trim(),"data-narrow-layout":b,style:{height:g,...y},children:[a.jsx(vf,{className:"studio-file-explorer__tree-area","aria-label":l,children:a.jsxs("div",{role:"tree","aria-label":l,className:"studio-file-explorer__tree",children:[M.map((ee,be)=>{const{entry:ue}=ee,pe=ue.type==="folder",ke=pe&&F.has(ue.id),je=j.get(ue.id);return a.jsxs("button",{ref:Pe=>{Pe?_.current.set(ue.id,Pe):_.current.delete(ue.id)},type:"button",role:"treeitem",className:"studio-file-explorer__row",style:{"--file-explorer-depth":ee.depth},"aria-level":ee.depth+1,"aria-posinset":ee.position,"aria-setsize":ee.count,"aria-expanded":pe?ke:void 0,"aria-selected":ue.type==="file"?L===ue.id:void 0,tabIndex:V===ue.id?0:-1,title:ue.name,onFocus:()=>E(ue.id),onClick:()=>{E(ue.id),G(ue)},onKeyDown:Pe=>se(Pe,ee,be),children:[a.jsx("span",{className:"studio-file-explorer__guides","aria-hidden":"true",children:Array.from({length:ee.depth},(Pe,Ee)=>a.jsx("span",{style:{left:16+Ee*20}},Ee))}),a.jsx("span",{className:"studio-file-explorer__chevron","data-expanded":ke||void 0,children:pe&&a.jsx(Tnn,{})}),a.jsx("span",{className:"studio-file-explorer__icon",children:pe?a.jsx(_nn,{open:ke}):a.jsx(Inn,{name:ue.name})}),a.jsx("span",{className:"studio-file-explorer__name",children:ue.name}),ue.type==="file"&&je&&je.content!==je.savedContent&&a.jsx("span",{className:"studio-file-explorer__dirty",role:"img","aria-label":"未保存",title:"未保存"})]},ue.id)}),M.length===0&&a.jsx("div",{className:"studio-file-explorer__empty-tree",children:"暂无文件"})]})}),m?m(z):z?a.jsx(Hnn,{file:z,draft:J,allowEdit:c,autoFormat:f,wordWrap:h,saving:R.has(z.id),error:N.get(z.id),canSave:!!d,onEdit:Z,onSave:ee=>{ne(ee)}},z.id):a.jsx("div",{className:"studio-file-explorer__empty-content",children:"选择文件查看内容"})]})}function Wnn(){return a.jsxs("svg",{viewBox:"0 0 40 40",fill:"none",stroke:"currentColor",strokeWidth:"3.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:[a.jsx("path",{d:"M3.5 30V11.5A5.5 5.5 0 0 1 9 6h4.5l4 4H27a6 6 0 0 1 6 6v1"}),a.jsx("path",{d:"m3.5 30 6.2-10.8a4.5 4.5 0 0 1 3.9-2.2H35a3 3 0 0 1 2.6 4.5l-5.4 9.3a4.5 4.5 0 0 1-3.9 2.2H7a3.5 3.5 0 0 1-3.5-3Z"})]})}function uA({title:e,description:t,icon:n=a.jsx(Wnn,{}),actions:i,className:r="",...s}){return a.jsxs("div",{...s,className:`studio-empty-state ${r}`.trim(),children:[p.Children.toArray(n).length>0&&a.jsx("div",{className:"studio-empty-state__icon","aria-hidden":"true",children:a.jsx("span",{className:"studio-empty-state__icon-glyph",children:n})}),a.jsxs("div",{className:"studio-empty-state__info",children:[a.jsx("div",{className:"studio-empty-state__title",children:e}),p.Children.toArray(t).length>0&&a.jsx("div",{className:"studio-empty-state__description",children:t})]}),p.Children.toArray(i).length>0&&a.jsx("div",{className:"studio-empty-state__actions",children:i})]})}function Knn(){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",focusable:"false",children:[a.jsx("path",{d:"M19.9898 3.99115C18.4371 2.46996 16.3085 2.41193 15.2251 3.4733L11.5251 7.09827C11.2292 7.38815 10.7543 7.38328 10.4645 7.0874C10.1746 6.79152 10.1795 6.31667 10.4753 6.02679L14.1754 2.40182C16.0113 0.603153 19.0891 1.00883 21.0395 2.91967C22.9927 4.8332 23.4179 7.87522 21.5681 9.68753L18.6609 12.5357C18.365 12.8256 17.8902 12.8208 17.6003 12.5249C17.3104 12.229 17.3153 11.7542 17.6112 11.4643L20.5184 8.61605C21.5878 7.56832 21.5398 5.50967 19.9898 3.99115Z",fill:"currentColor"}),a.jsx("path",{d:"M6.62424 3.58399C6.39448 3.23934 5.92882 3.14621 5.58418 3.37597C5.23953 3.60574 5.1464 4.07139 5.37617 4.41604L7.37617 7.41604C7.60593 7.76068 8.07158 7.85381 8.41623 7.62405C8.76088 7.39429 8.85401 6.92863 8.62424 6.58399L6.62424 3.58399Z",fill:"currentColor"}),a.jsx("path",{d:"M2.23737 7.2885C1.84442 7.15751 1.41968 7.36988 1.28869 7.76284C1.15771 8.1558 1.37008 8.58054 1.76303 8.71152L7.76303 10.7115C8.15599 10.8425 8.58073 10.6301 8.71172 10.2372C8.8427 9.84422 8.63033 9.41949 8.23737 9.2885L2.23737 7.2885Z",fill:"currentColor"}),a.jsx("path",{d:"M6.72775 12.506C7.00721 12.2003 6.98589 11.7259 6.68015 11.4464C6.37441 11.167 5.90001 11.1883 5.62056 11.494L4.3597 12.8735C2.63286 14.7628 3.01004 17.9268 4.86404 19.9552C6.72921 21.9958 9.73449 22.4595 11.5191 20.507L15.5538 16.0926C15.8333 15.7869 15.8119 15.3125 15.5062 15.033C15.2004 14.7536 14.7261 14.7749 14.4466 15.0806L10.4119 19.495C9.41099 20.59 7.44859 20.5596 5.97124 18.9432C4.48273 17.3147 4.4083 15.0437 5.4669 13.8855L6.72775 12.506Z",fill:"currentColor"})]})}function TK({className:e="",...t}){return a.jsx(uA,{...t,icon:a.jsx(Knn,{}),className:`studio-error-state ${e}`.trim()})}function Gnn(e){const t=[],n=new Map;for(const r of e){const s=r.path.split("/");let o=t,l="";for(const c of s.slice(0,-1)){l=l?`${l}/${c}`:c;let u=n.get(l);u||(u={id:`folder:${l}`,name:c,type:"folder",children:[]},n.set(l,u),o.push(u)),o=u.children}o.push({id:r.path,name:r.name,type:"file",content:""})}function i(r){r.sort((s,o)=>s.type===o.type?s.name.localeCompare(o.name):s.type==="folder"?-1:1);for(const s of r)s.type==="folder"&&i(s.children)}return i(t),t}function _K(e,t){const n=e.split(";",1)[0].toLowerCase();return n==="text/html"||/\.html?$/i.test(t)?"html":n==="text/markdown"||/\.(md|markdown)$/i.test(t)?"markdown":/^image\/(png|jpeg|gif|webp|svg\+xml|avif|bmp)$/.test(n)?"image":n.startsWith("text/")||n==="application/json"||/\.(txt|json|csv|yaml|yml|py|js|ts|css|log)$/i.test(t)?"text":"download"}function Xnn(e,t){let n;try{n=decodeURIComponent(t.split(/[?#]/,1)[0])}catch{return null}if(!n||/^[\/\\]/.test(n)||/[:\\\u0000-\u001f]/.test(n))return null;const i=e.split("/").slice(0,-1);for(const r of n.split("/"))if(!(!r||r==="."))if(r===".."){if(i.length===0)return null;i.pop()}else i.push(r);return i.join("/")||null}function Ynn(e){return new Promise((t,n)=>{const i=new FileReader;i.onload=()=>t(String(i.result)),i.onerror=()=>n(new Error("无法读取预览图片")),i.readAsDataURL(e)})}async function Znn(e,t,n,i){const r=new DOMParser().parseFromString(e,"text/html");for(const h of r.querySelectorAll("script,iframe,frame,object,embed,base,link,meta[http-equiv],form"))h.remove();for(const h of r.querySelectorAll("*")){for(const m of Array.from(h.attributes))(/^on/i.test(m.name)||["srcset","srcdoc","action","formaction","ping"].includes(m.name))&&h.removeAttribute(m.name);h.tagName!=="IMG"&&h.removeAttribute("src"),h.hasAttribute("href")&&h.removeAttribute("href")}const s=Array.from(r.querySelectorAll("img[src]"));if(s.length>32)throw new Error("此页面图片较多,请下载完整文件后查看");const o=s.map(h=>{const m=h.getAttribute("src")??"";if(h.removeAttribute("src"),/^data:image\/(png|jpeg|gif|webp|avif);base64,[a-z\d+/=\s]+$/i.test(m))return h.setAttribute("src",m),null;const g=Xnn(t,m);return g?{image:h,resource:g}:null}).filter(h=>h!==null),l=r.createElement("meta");l.httpEquiv="Content-Security-Policy",l.content="default-src 'none'; img-src data:; style-src 'unsafe-inline'; font-src data:; base-uri 'none'; form-action 'none'",r.head.prepend(l);const c=()=>`${r.documentElement.outerHTML}`;i==null||i(c());let u=0;const d=new Map;async function f({image:h,resource:m}){let g=d.get(m);g||(g=n(m).then(async b=>{if(u+=b.size,u>20*1024*1024)throw new Error("页面图片超过 20 MB,请下载后查看");if(_K(b.type,m)!=="image")throw new Error("HTML 引用的资源不是支持的图片");return Ynn(b)}),d.set(m,g)),h.setAttribute("src",await g)}for(let h=0;h{if(!o||typeof o!="object"||!("path"in o)||typeof o.path!="string"||!("name"in o)||typeof o.name!="string"||!("sizeBytes"in o)||typeof o.sizeBytes!="number"||!Number.isFinite(o.sizeBytes)||o.sizeBytes<0||!("mimeType"in o)||typeof o.mimeType!="string"||o.path.split("/").some(l=>!l||l==="."||l===".."||l.includes("\\")))throw new Error("产物列表包含无效文件信息");return{path:o.path,name:o.name,sizeBytes:o.sizeBytes,mimeType:o.mimeType,updatedAt:"updatedAt"in o&&typeof o.updatedAt=="string"?o.updatedAt:""}});return{available:r.available,items:s,reason:"reason"in r&&typeof r.reason=="string"?r.reason:void 0,nextCursor:"nextCursor"in r&&typeof r.nextCursor=="string"?r.nextCursor:null}}async function r7e(e,t,n,i=!1){var u,d;const r=await i7e(await vn(n7e(e,t,i),{signal:n},mr));if(i)return r.blob();const s=()=>new Error("文件超过 5 MB,请下载后查看");if(Number(r.headers.get("content-length"))>aU)throw await((u=r.body)==null?void 0:u.cancel()),s();const o=(d=r.body)==null?void 0:d.getReader();if(!o)return r.blob();const l=[];let c=0;try{for(;;){const{done:f,value:h}=await o.read();if(f)break;if(c+=h.byteLength,c>aU)throw await o.cancel(),s();l.push(new Uint8Array(h))}}finally{o.releaseLock()}return new Blob(l,{type:r.headers.get("content-type")??"application/octet-stream"})}function Cle(e,t){return JSON.stringify([e,t==null?void 0:t.updatedAt,t==null?void 0:t.sizeBytes,t==null?void 0:t.mimeType])}class tin{constructor(t=32*1024*1024,n=40){Zt(this,"entries",new Map);Zt(this,"bytes",0);this.maxBytes=t,this.maxEntries=n}get(t,n,i){const r=Cle(t,n),s=this.entries.get(r);if(s)return this.entries.delete(r),this.entries.set(r,s),s.promise;const o=new AbortController,l=i(o.signal).then(u=>{if(o.signal.aborted)throw new DOMException("Aborted","AbortError");return this.entries.get(r)===c&&(c.size=u.size,this.bytes+=u.size,this.trim()),u}).catch(u=>{throw this.entries.get(r)===c&&this.remove(r,c),u}),c={path:t,controller:o,promise:l,size:0};return this.entries.set(r,c),this.trim(),l}clear(){for(const t of this.entries.values())t.controller.abort();this.entries.clear(),this.bytes=0}reconcile(t,n){const i=new Map(t.map(r=>[r.path,Cle(r.path,r)]));for(const[r,s]of this.entries){const o=i.get(s.path);(o!==void 0&&o!==r||n&&o===void 0)&&this.remove(r,s)}}removePath(t){for(const[n,i]of this.entries)i.path===t&&this.remove(n,i)}remove(t,n){n.controller.abort(),this.bytes-=n.size,this.entries.delete(t)}trim(){for(;this.bytes>this.maxBytes||this.entries.size>this.maxEntries;){const t=this.entries.entries().next().value;if(!t)break;this.remove(...t)}}}async function nin(e,t,n){const i=u=>{const d=_K(u.mimeType,u.path);return d==="html"?0:d==="image"?1:d==="download"?3:2},r=e.filter(u=>i(u)<3).slice().sort((u,d)=>i(u)-i(d)),s=[];let o=0;for(const u of r){if(s.length===4)break;o+u.sizeBytes>1024*1024||(s.push(u),o+=u.sizeBytes)}let l=0;async function c(){for(;!n.aborted&&l{})}}await Promise.all([c(),c()])}const Ale=3e4;function iin(e,t,n){const[i,r]=p.useState(null),[s,o]=p.useState(!1),[l,c]=p.useState(""),[u,d]=p.useState(0),f=p.useMemo(()=>new tin,[e.runtimeId,e.region,e.appName,e.sessionId]),h=p.useRef(null),m=p.useRef(null),g=p.useRef(null),b=p.useRef(0),v=p.useRef(n),y=p.useRef(!1),w=p.useCallback(O=>{var k;return f.get(O,(k=h.current)==null?void 0:k.items.find(S=>S.path===O),S=>r7e(e,O,S)).catch(S=>{var C;throw S instanceof AE&&(S.status===401||S.status===403)?(f.clear(),(C=g.current)==null||C.abort(),h.current=null,r(null),c(S.message),b.current=0):S instanceof AE&&S.status===404&&f.removePath(O),S})},[f,e.runtimeId,e.region,e.appName,e.sessionId]),x=p.useCallback(async(O,k=!1)=>{var C,E;if(m.current){k&&(y.current=!0);return}const S=new AbortController;m.current=S,o(!0),c("");try{const j=await ein(e,S.signal,O);if(S.signal.aborted)return;const T=h.current,R=O&&T?{...j,items:[...new Map([...T.items,...j.items].map(N=>[N.path,N])).values()]}:j;f.reconcile(R.available?R.items:[],!R.available||R.nextCursor===null);const A=JSON.stringify(T)!==JSON.stringify(R);if(A&&(h.current=R,r(R),d(N=>N+1)),b.current=Date.now(),A&&R.available){(C=g.current)==null||C.abort();const N=new AbortController;g.current=N,nin(R.items,w,N.signal)}}catch(j){S.signal.aborted||(j instanceof AE&&[401,403,404].includes(j.status)&&(f.clear(),(E=g.current)==null||E.abort(),h.current=null,r(null),b.current=0),c(j instanceof Error?j.message:"无法加载会话产物,请重试"))}finally{S.signal.aborted||(m.current=null,o(!1),y.current&&(y.current=!1,x()))}},[f,w,e.runtimeId,e.region,e.appName,e.sessionId]);return p.useEffect(()=>(h.current=null,r(null),b.current=0,x(),()=>{var O,k;(O=m.current)==null||O.abort(),m.current=null,(k=g.current)==null||k.abort(),f.clear(),y.current=!1}),[f,x]),p.useEffect(()=>{v.current&&!n&&x(void 0,!0),v.current=n},[n,x]),p.useEffect(()=>{if(!t)return;const O=()=>{Date.now()-b.current>=Ale&&x()};O();const k=window.setInterval(O,Ale);return()=>window.clearInterval(k)},[t,x]),{listing:i,loading:s,error:l,previewRevision:u,loadPreview:w,refresh:x}}function rin({title:e,actions:t,ref:n,children:i,className:r="",...s}){const o=p.useId();return a.jsxs("article",{"aria-labelledby":o,...s,ref:n,className:`studio-info-card ${r}`.trim(),children:[t!=null?a.jsxs("div",{className:"studio-info-card__header",children:[a.jsx(Tle,{id:o,children:e}),a.jsx("div",{className:"studio-info-card__actions",children:t})]}):a.jsx(Tle,{id:o,children:e}),i]})}function Tle({children:e,className:t="",...n}){return a.jsx("h3",{...n,className:`studio-info-card__title ${t}`.trim(),children:e})}function sin({value:e,description:t,children:n,className:i="",...r}){return a.jsxs("div",{...r,className:`studio-info-card__body ${i}`.trim(),children:[e!=null&&a.jsx("p",{className:"studio-info-card__value",children:e}),t!=null&&a.jsx("p",{className:"studio-info-card__description",children:t}),n]})}function ain({label:e,buttonProps:t,open:n,defaultOpen:i=!1,onOpenChange:r,closeOnConfirm:s=!0,title:o,children:l,onClose:c,onCancel:u,onConfirm:d,...f}){const h=p.useRef(null);return a.jsxs(nv,{open:n,defaultOpen:i,onOpenChange:r,actionsRef:h,modal:!0,children:[a.jsx(TFe,{render:a.jsx(Ki,{...t}),children:e}),a.jsxs(tv,{children:[a.jsx(J0,{className:"studio-modal-button__backdrop"}),a.jsx(ev,{className:"studio-modal-button__popup","aria-modal":"true",render:a.jsx(u9e,{...f,title:a.jsx(gO,{render:a.jsx("span",{}),children:o}),onClose:()=>{var m;c==null||c(),(m=h.current)==null||m.close()},onCancel:()=>{var m;u==null||u(),(m=h.current)==null||m.close()},onConfirm:()=>{var m;d==null||d(),s&&((m=h.current)==null||m.close())},children:l!=null&&a.jsx(vf,{className:"studio-modal-button__body",children:l})})})]})]})}function _le(e){return typeof e=="string"||typeof e=="number"?String(e):void 0}function oin({direction:e}){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"m4.5 6 3.5-3.5L11.5 6",opacity:e==="desc"?.3:1}),a.jsx("path",{d:"m4.5 10 3.5 3.5 3.5-3.5",opacity:e==="asc"?.3:1})]})}function lin({columns:e,data:t,rowKey:n,caption:i,emptyContent:r="暂无数据",minWidth:s=640,layout:o="fixed",maxHeight:l,stickyHeader:c=!0,hideScrollbar:u=!0,toolbarStart:d,toolbarEnd:f,"aria-label":h,className:m=""}){const g=p.useRef(null);p.useLayoutEffect(()=>{var k,S;const y=g.current;if(!y||!e.some(C=>C.fixed))return;const w=Array.from(((S=(k=y.tHead)==null?void 0:k.rows[0])==null?void 0:S.cells)??[]);function x(){const C=w.map(T=>T.getBoundingClientRect().width);let E=0,j=0;e.forEach((T,R)=>{T.fixed==="left"&&(y.style.setProperty(`--table-fixed-${R}`,`${E}px`),E+=C[R]??0)});for(let T=e.length-1;T>=0;T--)e[T].fixed==="right"&&(y.style.setProperty(`--table-fixed-${T}`,`${j}px`),j+=C[T]??0)}x();const O=new ResizeObserver(x);return O.observe(y),w.forEach(C=>O.observe(C)),()=>O.disconnect()},[e]);function b(y,w){return{textAlign:y.align??"left",left:y.fixed==="left"?`var(--table-fixed-${w}, 0px)`:void 0,right:y.fixed==="right"?`var(--table-fixed-${w}, 0px)`:void 0}}function v(y,w){var x,O;if(y.fixed==="left"&&((x=e[w+1])==null?void 0:x.fixed)!=="left")return"left";if(y.fixed==="right"&&((O=e[w-1])==null?void 0:O.fixed)!=="right")return"right"}return a.jsxs("div",{className:`studio-table-container ${m}`.trim(),children:[(d!=null||f!=null)&&a.jsxs("div",{className:"studio-table-toolbar",children:[a.jsx("div",{className:"studio-table-toolbar__start",children:d}),a.jsx("div",{className:"studio-table-toolbar__end",children:f})]}),a.jsx(vf,{tabIndex:0,role:"region","aria-label":h??"表格滚动区域",orientation:l!=null?"both":"horizontal",maxHeight:l,hideScrollbar:u,className:"studio-table-scroll",children:a.jsxs("table",{ref:g,className:"studio-table","aria-label":h,"data-sticky-header":c&&l!=null||void 0,style:{minWidth:s,tableLayout:o},children:[i!=null&&a.jsx("caption",{children:i}),a.jsx("colgroup",{children:e.map(y=>a.jsx("col",{style:{width:y.width}},y.key))}),a.jsx("thead",{children:a.jsx("tr",{children:e.map((y,w)=>{const x=y.sort,O=y.filter,k=(x==null?void 0:x.direction)==="asc"?"desc":(x==null?void 0:x.direction)==="desc"?null:"asc",S=_le(y.title)??y.key,C=(x==null?void 0:x["aria-label"])??`${S}:${k==="asc"?"升序排列":k==="desc"?"降序排列":"恢复原顺序"}`;return a.jsx("th",{scope:"col","aria-sort":x?x.direction==="asc"?"ascending":x.direction==="desc"?"descending":"none":void 0,"data-fixed":y.fixed,"data-fixed-boundary":v(y,w),style:b(y,w),children:x||O?a.jsxs("div",{className:"studio-table__header-content","data-align":y.align??"left",children:[a.jsx("span",{className:"studio-table__header-title",children:y.title}),x&&a.jsx(Ki,{variant:"ghost",iconOnly:!0,className:"studio-table__sort-button","data-active":x.direction!=null||void 0,"aria-label":C,title:C,disabled:x.disabled,startIcon:a.jsx(oin,{direction:x.direction}),onClick:()=>x.onChange(k)}),O&&a.jsx(G9e,{className:"studio-table__filter","aria-label":O["aria-label"]??`筛选 ${S}`,value:O.value,options:O.options,disabled:O.disabled,onChange:E=>O.onChange(E.target.value)})]}):y.title},y.key)})})}),a.jsx("tbody",{children:t.length?t.map((y,w)=>a.jsx("tr",{children:e.map((x,O)=>{const k=x.render(y,w);return a.jsx("td",{"data-fixed":x.fixed,"data-fixed-boundary":v(x,O),style:b(x,O),children:a.jsx("div",{className:"studio-table__cell-value","data-overflow":x.overflow??"wrap",title:x.overflow==="ellipsis"?_le(k):void 0,children:k})},x.key)})},n(y))):a.jsx("tr",{children:a.jsx("td",{colSpan:Math.max(1,e.length),className:"studio-table__empty",children:r})})})]})})]})}function cin(){const e=p.useRef(null);return p.useLayoutEffect(()=>{const t=e.current;if(!t)return;const n=()=>{const o=t.querySelector('[aria-selected="true"]');if(!o){delete t.dataset.indicatorReady;return}const l=o.getBoundingClientRect(),c=t.getBoundingClientRect();t.style.setProperty("--tab-indicator-left",`${l.left-c.left}px`),t.style.setProperty("--tab-indicator-width",`${l.width}px`),t.dataset.indicatorReady="true"},i=t.querySelector('[aria-selected="true"]'),r=t.closest(".studio-tabs-scroll");if(i&&r){const o=i.getBoundingClientRect(),l=r.getBoundingClientRect();o.leftl.right&&(r.scrollLeft+=o.right-l.right)}n();const s=new ResizeObserver(n);s.observe(t);for(const o of t.children)s.observe(o);return()=>s.disconnect()}),e}function uin({items:e,value:t,defaultValue:n,onValueChange:i,"aria-label":r,className:s=""}){var b,v;const o=p.useId(),l=cin(),[c,u]=p.useState(n??((b=e[0])==null?void 0:b.value)),d=p.useRef([]),f=t??c,h=e.some(y=>y.value===f)?f:(v=e[0])==null?void 0:v.value;function m(y){t===void 0&&u(y),i==null||i(y)}function g(y,w){var O;let x;switch(y.key){case"ArrowRight":x=(w+1)%e.length;break;case"ArrowLeft":x=(w-1+e.length)%e.length;break;case"Home":x=0;break;case"End":x=e.length-1;break;default:return}y.preventDefault(),m(e[x].value),(O=d.current[x])==null||O.focus()}return a.jsx(vf,{orientation:"horizontal",hideScrollbar:!0,className:"studio-tabs-scroll",children:a.jsx("div",{ref:l,role:"tablist","aria-label":r,className:`studio-underline-tabs ${s}`.trim(),children:e.map((y,w)=>a.jsx("button",{ref:x=>{d.current[w]=x},type:"button",role:"tab",id:y.id??`${o}-${y.value}`,"aria-controls":y.panelId,"aria-selected":y.value===h,tabIndex:y.value===h?0:-1,className:"studio-underline-tabs__tab",onClick:()=>m(y.value),onKeyDown:x=>g(x,w),children:a.jsx("span",{className:"studio-underline-tabs__label",children:y.label})},y.value))})})}let k6,S6,jle=Promise.resolve(),din=0;function fin(){return k6??(k6=Js(()=>import("../visualizations/echarts/index-CGT341lL.js"),[]).catch(e=>{throw k6=void 0,e})),k6}function hin(){return S6??(S6=Js(()=>import("../visualizations/mermaid/mermaid.core-y4TF8bTw.js").then(e=>e.ay),__vite__mapDeps([0,1])).then(e=>e.default).catch(e=>{throw S6=void 0,e})),S6}function pin(e,t){const n=jle.then(async()=>{if(e.length>5e4)throw new Error("Diagram exceeds the supported size");const i=await hin();return i.initialize({startOnLoad:!1,securityLevel:"strict",suppressErrorRendering:!0,maxTextSize:5e4,theme:"base",fontFamily:t.font,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","theme","themeVariables","themeCSS","fontFamily"],themeVariables:{darkMode:t.dark,fontFamily:t.font,fontSize:"14px",background:t.panel,primaryColor:t.fill,primaryTextColor:t.text,primaryBorderColor:t.border,secondaryColor:t.panel,secondaryTextColor:t.text,secondaryBorderColor:t.border,tertiaryColor:t.fill,tertiaryTextColor:t.text,tertiaryBorderColor:t.border,lineColor:t.secondary,textColor:t.text,mainBkg:t.fill,nodeBorder:t.border,clusterBkg:t.panel,clusterBorder:t.border,edgeLabelBackground:t.panel,titleColor:t.text,actorBkg:t.fill,actorTextColor:t.text,actorBorder:t.border,actorLineColor:t.border,signalColor:t.secondary,signalTextColor:t.text,noteBkgColor:t.fill,noteTextColor:t.text,noteBorderColor:t.border}}),i.render(`studio-conversation-diagram-${++din}`,e)});return jle=n.then(()=>{},()=>{}),n}function min(e){const[t,n]=p.useState(null);return p.useEffect(()=>{const i=e.current;if(!i)return;const r=window.matchMedia("(prefers-reduced-motion: reduce)");function s(){var d;const l=getComputedStyle(i),c=(f,h)=>l.getPropertyValue(f).trim()||h,u={text:c("--studio-text-primary",l.color),secondary:c("--studio-text-secondary",l.color),tertiary:c("--studio-text-tertiary",l.color),subtle:c("--studio-text-subtle",l.color),border:c("--studio-border-subtle",l.color),panel:c("--studio-bg-panel",l.backgroundColor),fill:c("--studio-bg-secondary",l.backgroundColor),font:c("--studio-font-family-ui",l.fontFamily),dark:((d=i.closest("[data-theme]"))==null?void 0:d.getAttribute("data-theme"))!=="light",reducedMotion:r.matches};n(f=>JSON.stringify(f)===JSON.stringify(u)?f:u)}s();const o=new MutationObserver(s);for(let l=i;l;l=l.parentElement)o.observe(l,{attributes:!0,attributeFilter:["data-theme","class","style"]});return r.addEventListener("change",s),()=>{o.disconnect(),r.removeEventListener("change",s)}},[e]),t}function gin(e){const t={axisLine:{lineStyle:{color:e.border}},axisTick:{lineStyle:{color:e.border}},axisLabel:{color:e.secondary,fontFamily:e.font,fontSize:12},nameTextStyle:{color:e.secondary,fontFamily:e.font,fontSize:12},splitLine:{lineStyle:{color:e.border}},splitArea:{areaStyle:{color:["transparent",e.fill]}}};return{color:[e.text,e.tertiary,e.subtle,e.secondary],backgroundColor:"transparent",textStyle:{color:e.text,fontFamily:e.font,fontSize:12},title:{textStyle:{color:e.text,fontSize:14,fontWeight:400},subtextStyle:{color:e.secondary}},legend:{textStyle:{color:e.secondary,fontFamily:e.font,fontSize:12}},tooltip:{backgroundColor:e.panel,borderColor:e.border,textStyle:{color:e.text,fontFamily:e.font,fontSize:12}},categoryAxis:t,valueAxis:t,timeAxis:t,logAxis:t,radar:{axisLine:t.axisLine,splitLine:t.splitLine,splitArea:t.splitArea,axisName:{color:e.secondary}},line:{symbolSize:5},graph:{color:[e.text,e.tertiary,e.subtle]}}}function s7e({invalid:e=!1}){return a.jsx("div",{role:"alert",className:"studio-conversation-rich-visual__error",children:a.jsx(TK,{title:e?"图表定义无法解析":"图表暂时无法显示",description:"可以切换到源码查看完整内容"})})}function bin({source:e,title:t,theme:n}){const i=p.useRef(null),[r,s]=p.useState("loading");p.useEffect(()=>{let l=!1,c,u;const d=()=>c==null?void 0:c.resize();s("loading");let f;try{f=HMe(e,n.reducedMotion)}catch{s("invalid");return}const h=gin(n);return fin().then(m=>{l||!i.current||(c=m.init(i.current,h,{renderer:"svg"}),c.setOption({...f,color:f.color??h.color,backgroundColor:"transparent",textStyle:{...f.textStyle,...h.textStyle},animation:!n.reducedMotion&&f.animation!==!1,animationDuration:n.reducedMotion?0:240,animationDurationUpdate:n.reducedMotion?0:160},{notMerge:!0}),typeof ResizeObserver<"u"?(u=new ResizeObserver(d),u.observe(i.current)):window.addEventListener("resize",d),s("ready"))}).catch(()=>{c==null||c.dispose(),c=void 0,l||s("error")}),()=>{l=!0,u==null||u.disconnect(),window.removeEventListener("resize",d),c==null||c.dispose()}},[e,n]);const o=r==="invalid"||r==="error";return a.jsxs("div",{className:"studio-conversation-rich-visual__chart","aria-busy":r==="loading",children:[a.jsx("div",{ref:i,className:"studio-conversation-rich-visual__canvas",role:"img","aria-label":t,hidden:o}),r==="loading"&&a.jsx("div",{className:"studio-conversation-rich-visual__loading",children:a.jsx(o0,{size:24,label:"正在渲染图表"})}),o&&a.jsx(s7e,{invalid:r==="invalid"})]})}function nR({kind:e}){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e==="expand"?a.jsx("path",{d:"M6 2.5H2.5V6m7.5-3.5h3.5V6m0 4v3.5H10M6 13.5H2.5V10"}):e==="minus"?a.jsx("path",{d:"M3.5 8h9"}):e==="plus"?a.jsx("path",{d:"M3.5 8h9M8 3.5v9"}):a.jsx(a.Fragment,{children:a.jsx("path",{d:"M3 5.5A5.1 5.1 0 1 1 3 10M3 2.5v3H6"})})})}function yin({source:e,title:t,theme:n}){const i=p.useRef(null),[r,s]=p.useState(null),[o,l]=p.useState(!1),[c,u]=p.useState(1);return p.useEffect(()=>{let d=!1;return s(null),l(!1),pin(e,n).then(f=>{d||s(f)}).catch(()=>{d||l(!0)}),()=>{d=!0}},[e,n]),p.useEffect(()=>{var d;i.current&&((d=r==null?void 0:r.bindFunctions)==null||d.call(r,i.current))},[r]),o?a.jsx(s7e,{invalid:!0}):r?a.jsxs(a.Fragment,{children:[a.jsx(vf,{orientation:"both",maxHeight:440,className:"studio-conversation-rich-visual__diagram-scroll",tabIndex:0,role:"region","aria-label":`${t}图表滚动区域`,children:a.jsx("div",{className:"studio-conversation-rich-visual__diagram-size",style:{width:`${c*100}%`},children:a.jsx("div",{ref:i,className:"studio-conversation-rich-visual__mermaid",role:"img","aria-label":t,dangerouslySetInnerHTML:{__html:r.svg}})})}),a.jsxs("div",{className:"studio-conversation-rich-visual__zoom",role:"group","aria-label":"图表缩放",children:[a.jsx(Ki,{variant:"ghost",iconOnly:!0,size:"compact","aria-label":"缩小图表",disabled:c<=.5,startIcon:a.jsx(nR,{kind:"minus"}),onClick:()=>u(d=>Math.max(.5,d-.25))}),a.jsxs("span",{"aria-live":"polite",children:[Math.round(c*100),"%"]}),a.jsx(Ki,{variant:"ghost",iconOnly:!0,size:"compact","aria-label":"放大图表",disabled:c>=2.5,startIcon:a.jsx(nR,{kind:"plus"}),onClick:()=>u(d=>Math.min(2.5,d+.25))}),a.jsx(Ki,{variant:"ghost",iconOnly:!0,size:"compact","aria-label":"重置图表缩放",startIcon:a.jsx(nR,{kind:"reset"}),onClick:()=>u(1)})]})]}):a.jsx("div",{className:"studio-conversation-rich-visual__placeholder",children:a.jsx(o0,{size:24,label:"正在渲染图表"})})}function a7e({kind:e,source:t,title:n=e==="echarts"?"数据图表":"流程图",streaming:i=!1,expanded:r=!1}){const s=p.useId(),o=p.useRef(null),l=min(o),[c,u]=p.useState("preview"),d=i?"source":c;return a.jsx(rin,{ref:o,title:n,className:"studio-conversation-rich-visual","data-kind":e,"data-expanded":r||void 0,actions:i?a.jsx(o0,{size:24,label:"正在生成图表定义"}):r?void 0:a.jsx(ain,{label:`展开${n}`,title:n,topGlow:!1,closeLabel:"关闭图表","data-theme":l?l.dark?"dark":"light":void 0,className:"studio-conversation-rich-visual__modal",buttonProps:{variant:"ghost",iconOnly:!0,startIcon:a.jsx(nR,{kind:"expand"}),"aria-label":`展开${n}`},children:a.jsx(a7e,{kind:e,source:t,title:n,expanded:!0})}),children:a.jsxs(sin,{className:"studio-conversation-rich-visual__body",children:[!i&&a.jsx(uin,{"aria-label":`${n}展示方式`,value:d,onValueChange:u,items:[{value:"preview",label:"预览",id:`${s}-preview-tab`,panelId:`${s}-preview`},{value:"source",label:"源码",id:`${s}-source-tab`,panelId:`${s}-source`}]}),a.jsx("div",{id:`${s}-${d}`,role:i?void 0:"tabpanel","aria-labelledby":i?void 0:`${s}-${d}-tab`,className:"studio-conversation-rich-visual__panel",children:d==="source"?a.jsx(ML,{title:e==="echarts"?"ECharts option":"Mermaid",language:e==="echarts"?"javascript":"plaintext",lines:t.split(` +`),onKeyDown:O=>{n&&(O.metaKey||O.ctrlKey)&&O.key.toLowerCase()==="s"&&!O.nativeEvent.isComposing&&(O.preventDefault(),l&&w&&!s&&u(y))},actions:n?a.jsx(Ki,{variant:"ghost",iconOnly:!0,startIcon:a.jsx(Vnn,{}),"aria-label":`保存 ${e.name}`,title:l?w?"保存文件":"没有未保存的修改":"未配置保存操作",disabled:!l||!w,loading:s,onClick:()=>u(y)}):void 0,children:n?b||t?a.jsx(p.Suspense,{fallback:x,children:a.jsx(znn,{name:e.name,language:f,value:y,wordWrap:r,onChange:O=>c(O,v)})}):x:void 0}),o?a.jsx("div",{className:"studio-file-explorer__message studio-file-explorer__message--error",role:"alert",children:o}):i&&b&&(m!=null&&m.error)?a.jsx("div",{className:"studio-file-explorer__message",role:"status",children:m.error}):null]})}function e7e(e,t){for(const n of e){if(n.type==="file"&&n.id===t)return n;if(n.type==="folder"){const i=e7e(n.children,t);if(i)return i}}}function t7e(e,t,n=0,i){return e.flatMap((r,s)=>[{entry:r,depth:n,parentId:i,position:s+1,count:e.length},...r.type==="folder"&&t.has(r.id)?t7e(r.children,t,n+1,r.id):[]])}function qnn({entries:e,selectedId:t,defaultSelectedId:n=null,onSelect:i,expandedIds:r,defaultExpandedIds:s=[],onExpandedChange:o,treeLabel:l="文件",allowEdit:c=!1,onEdit:u,onSave:d,autoFormat:f=!0,wordWrap:h=!0,renderPreview:m,height:g,narrowLayout:b="split",className:v="",style:y,...w}){var Y,X,ie;const[x,O]=p.useState(n),[k,S]=p.useState(s),[C,E]=p.useState(null),[j,T]=p.useState(new Map),[R,A]=p.useState(new Set),[N,P]=p.useState(new Map),I=p.useRef(new Set),D=p.useRef(!0);p.useEffect(()=>(D.current=!0,()=>{D.current=!1}),[]);const _=p.useRef(new Map),L=t===void 0?x:t,F=p.useMemo(()=>new Set(r??k),[r,k]),M=p.useMemo(()=>t7e(e,F),[e,F]),z=p.useMemo(()=>e7e(e,L),[e,L]),q=z?J9e(z):"",U=z?j.get(z.id):void 0,J=U&&(U.content!==U.savedContent||q===U.source||q===U.savedContent)?U:void 0,V=((Y=M.find(ee=>ee.entry.id===C))==null?void 0:Y.entry.id)??((X=M.find(ee=>ee.entry.id===L))==null?void 0:X.entry.id)??((ie=M[0])==null?void 0:ie.entry.id);function Z(ee,be){!z||!c||(T(ue=>new Map(ue).set(z.id,{source:q,content:ee,savedContent:(J==null?void 0:J.savedContent)??be})),P(ue=>new Map(ue).set(z.id,void 0)),u==null||u(z.id,ee,z))}async function ne(ee){if(!z||!c||!d||I.current.has(z.id))return;const be=z;I.current.add(be.id),A(new Set(I.current)),P(ue=>new Map(ue).set(be.id,void 0));try{await d(be.id,ee,be),D.current&&T(ue=>{var pe;return new Map(ue).set(be.id,{source:q,content:((pe=ue.get(be.id))==null?void 0:pe.content)??ee,savedContent:ee})})}catch{D.current&&P(ue=>new Map(ue).set(be.id,"保存失败,请重试"))}finally{I.current.delete(be.id),D.current&&A(new Set(I.current))}}function W(ee){const be=new Set(F);be.has(ee)?be.delete(ee):be.add(ee);const ue=[...be];r===void 0&&S(ue),o==null||o(ue)}function G(ee){ee.type==="folder"?W(ee.id):(t===void 0&&O(ee.id),i==null||i(ee.id,ee))}function H(ee){if(!ee)return;E(ee);const be=_.current.get(ee);be==null||be.focus({preventScroll:!0}),be==null||be.scrollIntoView({block:"nearest",inline:"nearest"})}function se(ee,be,ue){var ke,je,Pe,Ee,Qe;const{entry:pe}=be;switch(ee.key){case"ArrowDown":ee.preventDefault(),H((ke=M[Math.min(ue+1,M.length-1)])==null?void 0:ke.entry.id);break;case"ArrowUp":ee.preventDefault(),H((je=M[Math.max(ue-1,0)])==null?void 0:je.entry.id);break;case"ArrowRight":ee.preventDefault(),pe.type==="folder"&&(F.has(pe.id)?H((Pe=pe.children[0])==null?void 0:Pe.id):W(pe.id));break;case"ArrowLeft":ee.preventDefault(),pe.type==="folder"&&F.has(pe.id)?W(pe.id):H(be.parentId);break;case"Home":ee.preventDefault(),H((Ee=M[0])==null?void 0:Ee.entry.id);break;case"End":ee.preventDefault(),H((Qe=M[M.length-1])==null?void 0:Qe.entry.id);break;case"Enter":case" ":ee.preventDefault(),G(pe);break}}return a.jsxs("div",{...w,className:`studio-file-explorer ${v}`.trim(),"data-narrow-layout":b,style:{height:g,...y},children:[a.jsx(vf,{className:"studio-file-explorer__tree-area","aria-label":l,children:a.jsxs("div",{role:"tree","aria-label":l,className:"studio-file-explorer__tree",children:[M.map((ee,be)=>{const{entry:ue}=ee,pe=ue.type==="folder",ke=pe&&F.has(ue.id),je=j.get(ue.id);return a.jsxs("button",{ref:Pe=>{Pe?_.current.set(ue.id,Pe):_.current.delete(ue.id)},type:"button",role:"treeitem",className:"studio-file-explorer__row",style:{"--file-explorer-depth":ee.depth},"aria-level":ee.depth+1,"aria-posinset":ee.position,"aria-setsize":ee.count,"aria-expanded":pe?ke:void 0,"aria-selected":ue.type==="file"?L===ue.id:void 0,tabIndex:V===ue.id?0:-1,title:ue.name,onFocus:()=>E(ue.id),onClick:()=>{E(ue.id),G(ue)},onKeyDown:Pe=>se(Pe,ee,be),children:[a.jsx("span",{className:"studio-file-explorer__guides","aria-hidden":"true",children:Array.from({length:ee.depth},(Pe,Ee)=>a.jsx("span",{style:{left:16+Ee*20}},Ee))}),a.jsx("span",{className:"studio-file-explorer__chevron","data-expanded":ke||void 0,children:pe&&a.jsx(Tnn,{})}),a.jsx("span",{className:"studio-file-explorer__icon",children:pe?a.jsx(_nn,{open:ke}):a.jsx(Inn,{name:ue.name})}),a.jsx("span",{className:"studio-file-explorer__name",children:ue.name}),ue.type==="file"&&je&&je.content!==je.savedContent&&a.jsx("span",{className:"studio-file-explorer__dirty",role:"img","aria-label":"未保存",title:"未保存"})]},ue.id)}),M.length===0&&a.jsx("div",{className:"studio-file-explorer__empty-tree",children:"暂无文件"})]})}),m?m(z):z?a.jsx(Hnn,{file:z,draft:J,allowEdit:c,autoFormat:f,wordWrap:h,saving:R.has(z.id),error:N.get(z.id),canSave:!!d,onEdit:Z,onSave:ee=>{ne(ee)}},z.id):a.jsx("div",{className:"studio-file-explorer__empty-content",children:"选择文件查看内容"})]})}function Wnn(){return a.jsxs("svg",{viewBox:"0 0 40 40",fill:"none",stroke:"currentColor",strokeWidth:"3.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:[a.jsx("path",{d:"M3.5 30V11.5A5.5 5.5 0 0 1 9 6h4.5l4 4H27a6 6 0 0 1 6 6v1"}),a.jsx("path",{d:"m3.5 30 6.2-10.8a4.5 4.5 0 0 1 3.9-2.2H35a3 3 0 0 1 2.6 4.5l-5.4 9.3a4.5 4.5 0 0 1-3.9 2.2H7a3.5 3.5 0 0 1-3.5-3Z"})]})}function uA({title:e,description:t,icon:n=a.jsx(Wnn,{}),actions:i,className:r="",...s}){return a.jsxs("div",{...s,className:`studio-empty-state ${r}`.trim(),children:[p.Children.toArray(n).length>0&&a.jsx("div",{className:"studio-empty-state__icon","aria-hidden":"true",children:a.jsx("span",{className:"studio-empty-state__icon-glyph",children:n})}),a.jsxs("div",{className:"studio-empty-state__info",children:[a.jsx("div",{className:"studio-empty-state__title",children:e}),p.Children.toArray(t).length>0&&a.jsx("div",{className:"studio-empty-state__description",children:t})]}),p.Children.toArray(i).length>0&&a.jsx("div",{className:"studio-empty-state__actions",children:i})]})}function Knn(){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",focusable:"false",children:[a.jsx("path",{d:"M19.9898 3.99115C18.4371 2.46996 16.3085 2.41193 15.2251 3.4733L11.5251 7.09827C11.2292 7.38815 10.7543 7.38328 10.4645 7.0874C10.1746 6.79152 10.1795 6.31667 10.4753 6.02679L14.1754 2.40182C16.0113 0.603153 19.0891 1.00883 21.0395 2.91967C22.9927 4.8332 23.4179 7.87522 21.5681 9.68753L18.6609 12.5357C18.365 12.8256 17.8902 12.8208 17.6003 12.5249C17.3104 12.229 17.3153 11.7542 17.6112 11.4643L20.5184 8.61605C21.5878 7.56832 21.5398 5.50967 19.9898 3.99115Z",fill:"currentColor"}),a.jsx("path",{d:"M6.62424 3.58399C6.39448 3.23934 5.92882 3.14621 5.58418 3.37597C5.23953 3.60574 5.1464 4.07139 5.37617 4.41604L7.37617 7.41604C7.60593 7.76068 8.07158 7.85381 8.41623 7.62405C8.76088 7.39429 8.85401 6.92863 8.62424 6.58399L6.62424 3.58399Z",fill:"currentColor"}),a.jsx("path",{d:"M2.23737 7.2885C1.84442 7.15751 1.41968 7.36988 1.28869 7.76284C1.15771 8.1558 1.37008 8.58054 1.76303 8.71152L7.76303 10.7115C8.15599 10.8425 8.58073 10.6301 8.71172 10.2372C8.8427 9.84422 8.63033 9.41949 8.23737 9.2885L2.23737 7.2885Z",fill:"currentColor"}),a.jsx("path",{d:"M6.72775 12.506C7.00721 12.2003 6.98589 11.7259 6.68015 11.4464C6.37441 11.167 5.90001 11.1883 5.62056 11.494L4.3597 12.8735C2.63286 14.7628 3.01004 17.9268 4.86404 19.9552C6.72921 21.9958 9.73449 22.4595 11.5191 20.507L15.5538 16.0926C15.8333 15.7869 15.8119 15.3125 15.5062 15.033C15.2004 14.7536 14.7261 14.7749 14.4466 15.0806L10.4119 19.495C9.41099 20.59 7.44859 20.5596 5.97124 18.9432C4.48273 17.3147 4.4083 15.0437 5.4669 13.8855L6.72775 12.506Z",fill:"currentColor"})]})}function TK({className:e="",...t}){return a.jsx(uA,{...t,icon:a.jsx(Knn,{}),className:`studio-error-state ${e}`.trim()})}function Gnn(e){const t=[],n=new Map;for(const r of e){const s=r.path.split("/");let o=t,l="";for(const c of s.slice(0,-1)){l=l?`${l}/${c}`:c;let u=n.get(l);u||(u={id:`folder:${l}`,name:c,type:"folder",children:[]},n.set(l,u),o.push(u)),o=u.children}o.push({id:r.path,name:r.name,type:"file",content:""})}function i(r){r.sort((s,o)=>s.type===o.type?s.name.localeCompare(o.name):s.type==="folder"?-1:1);for(const s of r)s.type==="folder"&&i(s.children)}return i(t),t}function _K(e,t){const n=e.split(";",1)[0].toLowerCase();return n==="text/html"||/\.html?$/i.test(t)?"html":n==="text/markdown"||/\.(md|markdown)$/i.test(t)?"markdown":/^image\/(png|jpeg|gif|webp|svg\+xml|avif|bmp)$/.test(n)?"image":n.startsWith("text/")||n==="application/json"||/\.(txt|json|csv|yaml|yml|py|js|ts|css|log)$/i.test(t)?"text":"download"}function Xnn(e,t){let n;try{n=decodeURIComponent(t.split(/[?#]/,1)[0])}catch{return null}if(!n||/^[\/\\]/.test(n)||/[:\\\u0000-\u001f]/.test(n))return null;const i=e.split("/").slice(0,-1);for(const r of n.split("/"))if(!(!r||r==="."))if(r===".."){if(i.length===0)return null;i.pop()}else i.push(r);return i.join("/")||null}function Ynn(e){return new Promise((t,n)=>{const i=new FileReader;i.onload=()=>t(String(i.result)),i.onerror=()=>n(new Error("无法读取预览图片")),i.readAsDataURL(e)})}async function Znn(e,t,n,i){const r=new DOMParser().parseFromString(e,"text/html");for(const h of r.querySelectorAll("script,iframe,frame,object,embed,base,link,meta[http-equiv],form"))h.remove();for(const h of r.querySelectorAll("*")){for(const m of Array.from(h.attributes))(/^on/i.test(m.name)||["srcset","srcdoc","action","formaction","ping"].includes(m.name))&&h.removeAttribute(m.name);h.tagName!=="IMG"&&h.removeAttribute("src"),h.hasAttribute("href")&&h.removeAttribute("href")}const s=Array.from(r.querySelectorAll("img[src]"));if(s.length>32)throw new Error("此页面图片较多,请下载完整文件后查看");const o=s.map(h=>{const m=h.getAttribute("src")??"";if(h.removeAttribute("src"),/^data:image\/(png|jpeg|gif|webp|avif);base64,[a-z\d+/=\s]+$/i.test(m))return h.setAttribute("src",m),null;const g=Xnn(t,m);return g?{image:h,resource:g}:null}).filter(h=>h!==null),l=r.createElement("meta");l.httpEquiv="Content-Security-Policy",l.content="default-src 'none'; img-src data:; style-src 'unsafe-inline'; font-src data:; base-uri 'none'; form-action 'none'",r.head.prepend(l);const c=()=>`${r.documentElement.outerHTML}`;i==null||i(c());let u=0;const d=new Map;async function f({image:h,resource:m}){let g=d.get(m);g||(g=n(m).then(async b=>{if(u+=b.size,u>20*1024*1024)throw new Error("页面图片超过 20 MB,请下载后查看");if(_K(b.type,m)!=="image")throw new Error("HTML 引用的资源不是支持的图片");return Ynn(b)}),d.set(m,g)),h.setAttribute("src",await g)}for(let h=0;h{if(!o||typeof o!="object"||!("path"in o)||typeof o.path!="string"||!("name"in o)||typeof o.name!="string"||!("sizeBytes"in o)||typeof o.sizeBytes!="number"||!Number.isFinite(o.sizeBytes)||o.sizeBytes<0||!("mimeType"in o)||typeof o.mimeType!="string"||o.path.split("/").some(l=>!l||l==="."||l===".."||l.includes("\\")))throw new Error("产物列表包含无效文件信息");return{path:o.path,name:o.name,sizeBytes:o.sizeBytes,mimeType:o.mimeType,updatedAt:"updatedAt"in o&&typeof o.updatedAt=="string"?o.updatedAt:""}});return{available:r.available,items:s,reason:"reason"in r&&typeof r.reason=="string"?r.reason:void 0,nextCursor:"nextCursor"in r&&typeof r.nextCursor=="string"?r.nextCursor:null}}async function r7e(e,t,n,i=!1){var u,d;const r=await i7e(await vn(n7e(e,t,i),{signal:n},mr));if(i)return r.blob();const s=()=>new Error("文件超过 5 MB,请下载后查看");if(Number(r.headers.get("content-length"))>aU)throw await((u=r.body)==null?void 0:u.cancel()),s();const o=(d=r.body)==null?void 0:d.getReader();if(!o)return r.blob();const l=[];let c=0;try{for(;;){const{done:f,value:h}=await o.read();if(f)break;if(c+=h.byteLength,c>aU)throw await o.cancel(),s();l.push(new Uint8Array(h))}}finally{o.releaseLock()}return new Blob(l,{type:r.headers.get("content-type")??"application/octet-stream"})}function Cle(e,t){return JSON.stringify([e,t==null?void 0:t.updatedAt,t==null?void 0:t.sizeBytes,t==null?void 0:t.mimeType])}class tin{constructor(t=32*1024*1024,n=40){Zt(this,"entries",new Map);Zt(this,"bytes",0);this.maxBytes=t,this.maxEntries=n}get(t,n,i){const r=Cle(t,n),s=this.entries.get(r);if(s)return this.entries.delete(r),this.entries.set(r,s),s.promise;const o=new AbortController,l=i(o.signal).then(u=>{if(o.signal.aborted)throw new DOMException("Aborted","AbortError");return this.entries.get(r)===c&&(c.size=u.size,this.bytes+=u.size,this.trim()),u}).catch(u=>{throw this.entries.get(r)===c&&this.remove(r,c),u}),c={path:t,controller:o,promise:l,size:0};return this.entries.set(r,c),this.trim(),l}clear(){for(const t of this.entries.values())t.controller.abort();this.entries.clear(),this.bytes=0}reconcile(t,n){const i=new Map(t.map(r=>[r.path,Cle(r.path,r)]));for(const[r,s]of this.entries){const o=i.get(s.path);(o!==void 0&&o!==r||n&&o===void 0)&&this.remove(r,s)}}removePath(t){for(const[n,i]of this.entries)i.path===t&&this.remove(n,i)}remove(t,n){n.controller.abort(),this.bytes-=n.size,this.entries.delete(t)}trim(){for(;this.bytes>this.maxBytes||this.entries.size>this.maxEntries;){const t=this.entries.entries().next().value;if(!t)break;this.remove(...t)}}}async function nin(e,t,n){const i=u=>{const d=_K(u.mimeType,u.path);return d==="html"?0:d==="image"?1:d==="download"?3:2},r=e.filter(u=>i(u)<3).slice().sort((u,d)=>i(u)-i(d)),s=[];let o=0;for(const u of r){if(s.length===4)break;o+u.sizeBytes>1024*1024||(s.push(u),o+=u.sizeBytes)}let l=0;async function c(){for(;!n.aborted&&l{})}}await Promise.all([c(),c()])}const Ale=3e4;function iin(e,t,n){const[i,r]=p.useState(null),[s,o]=p.useState(!1),[l,c]=p.useState(""),[u,d]=p.useState(0),f=p.useMemo(()=>new tin,[e.runtimeId,e.region,e.appName,e.sessionId]),h=p.useRef(null),m=p.useRef(null),g=p.useRef(null),b=p.useRef(0),v=p.useRef(n),y=p.useRef(!1),w=p.useCallback(O=>{var k;return f.get(O,(k=h.current)==null?void 0:k.items.find(S=>S.path===O),S=>r7e(e,O,S)).catch(S=>{var C;throw S instanceof AE&&(S.status===401||S.status===403)?(f.clear(),(C=g.current)==null||C.abort(),h.current=null,r(null),c(S.message),b.current=0):S instanceof AE&&S.status===404&&f.removePath(O),S})},[f,e.runtimeId,e.region,e.appName,e.sessionId]),x=p.useCallback(async(O,k=!1)=>{var C,E;if(m.current){k&&(y.current=!0);return}const S=new AbortController;m.current=S,o(!0),c("");try{const j=await ein(e,S.signal,O);if(S.signal.aborted)return;const T=h.current,R=O&&T?{...j,items:[...new Map([...T.items,...j.items].map(N=>[N.path,N])).values()]}:j;f.reconcile(R.available?R.items:[],!R.available||R.nextCursor===null);const A=JSON.stringify(T)!==JSON.stringify(R);if(A&&(h.current=R,r(R),d(N=>N+1)),b.current=Date.now(),A&&R.available){(C=g.current)==null||C.abort();const N=new AbortController;g.current=N,nin(R.items,w,N.signal)}}catch(j){S.signal.aborted||(j instanceof AE&&[401,403,404].includes(j.status)&&(f.clear(),(E=g.current)==null||E.abort(),h.current=null,r(null),b.current=0),c(j instanceof Error?j.message:"无法加载会话产物,请重试"))}finally{S.signal.aborted||(m.current=null,o(!1),y.current&&(y.current=!1,x()))}},[f,w,e.runtimeId,e.region,e.appName,e.sessionId]);return p.useEffect(()=>(h.current=null,r(null),b.current=0,x(),()=>{var O,k;(O=m.current)==null||O.abort(),m.current=null,(k=g.current)==null||k.abort(),f.clear(),y.current=!1}),[f,x]),p.useEffect(()=>{v.current&&!n&&x(void 0,!0),v.current=n},[n,x]),p.useEffect(()=>{if(!t)return;const O=()=>{Date.now()-b.current>=Ale&&x()};O();const k=window.setInterval(O,Ale);return()=>window.clearInterval(k)},[t,x]),{listing:i,loading:s,error:l,previewRevision:u,loadPreview:w,refresh:x}}function rin({title:e,actions:t,ref:n,children:i,className:r="",...s}){const o=p.useId();return a.jsxs("article",{"aria-labelledby":o,...s,ref:n,className:`studio-info-card ${r}`.trim(),children:[t!=null?a.jsxs("div",{className:"studio-info-card__header",children:[a.jsx(Tle,{id:o,children:e}),a.jsx("div",{className:"studio-info-card__actions",children:t})]}):a.jsx(Tle,{id:o,children:e}),i]})}function Tle({children:e,className:t="",...n}){return a.jsx("h3",{...n,className:`studio-info-card__title ${t}`.trim(),children:e})}function sin({value:e,description:t,children:n,className:i="",...r}){return a.jsxs("div",{...r,className:`studio-info-card__body ${i}`.trim(),children:[e!=null&&a.jsx("p",{className:"studio-info-card__value",children:e}),t!=null&&a.jsx("p",{className:"studio-info-card__description",children:t}),n]})}function ain({label:e,buttonProps:t,open:n,defaultOpen:i=!1,onOpenChange:r,closeOnConfirm:s=!0,title:o,children:l,onClose:c,onCancel:u,onConfirm:d,...f}){const h=p.useRef(null);return a.jsxs(nv,{open:n,defaultOpen:i,onOpenChange:r,actionsRef:h,modal:!0,children:[a.jsx(TFe,{render:a.jsx(Ki,{...t}),children:e}),a.jsxs(tv,{children:[a.jsx(J0,{className:"studio-modal-button__backdrop"}),a.jsx(ev,{className:"studio-modal-button__popup","aria-modal":"true",render:a.jsx(u9e,{...f,title:a.jsx(gO,{render:a.jsx("span",{}),children:o}),onClose:()=>{var m;c==null||c(),(m=h.current)==null||m.close()},onCancel:()=>{var m;u==null||u(),(m=h.current)==null||m.close()},onConfirm:()=>{var m;d==null||d(),s&&((m=h.current)==null||m.close())},children:l!=null&&a.jsx(vf,{className:"studio-modal-button__body",children:l})})})]})]})}function _le(e){return typeof e=="string"||typeof e=="number"?String(e):void 0}function oin({direction:e}){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"m4.5 6 3.5-3.5L11.5 6",opacity:e==="desc"?.3:1}),a.jsx("path",{d:"m4.5 10 3.5 3.5 3.5-3.5",opacity:e==="asc"?.3:1})]})}function lin({columns:e,data:t,rowKey:n,caption:i,emptyContent:r="暂无数据",minWidth:s=640,layout:o="fixed",maxHeight:l,stickyHeader:c=!0,hideScrollbar:u=!0,toolbarStart:d,toolbarEnd:f,"aria-label":h,className:m=""}){const g=p.useRef(null);p.useLayoutEffect(()=>{var k,S;const y=g.current;if(!y||!e.some(C=>C.fixed))return;const w=Array.from(((S=(k=y.tHead)==null?void 0:k.rows[0])==null?void 0:S.cells)??[]);function x(){const C=w.map(T=>T.getBoundingClientRect().width);let E=0,j=0;e.forEach((T,R)=>{T.fixed==="left"&&(y.style.setProperty(`--table-fixed-${R}`,`${E}px`),E+=C[R]??0)});for(let T=e.length-1;T>=0;T--)e[T].fixed==="right"&&(y.style.setProperty(`--table-fixed-${T}`,`${j}px`),j+=C[T]??0)}x();const O=new ResizeObserver(x);return O.observe(y),w.forEach(C=>O.observe(C)),()=>O.disconnect()},[e]);function b(y,w){return{textAlign:y.align??"left",left:y.fixed==="left"?`var(--table-fixed-${w}, 0px)`:void 0,right:y.fixed==="right"?`var(--table-fixed-${w}, 0px)`:void 0}}function v(y,w){var x,O;if(y.fixed==="left"&&((x=e[w+1])==null?void 0:x.fixed)!=="left")return"left";if(y.fixed==="right"&&((O=e[w-1])==null?void 0:O.fixed)!=="right")return"right"}return a.jsxs("div",{className:`studio-table-container ${m}`.trim(),children:[(d!=null||f!=null)&&a.jsxs("div",{className:"studio-table-toolbar",children:[a.jsx("div",{className:"studio-table-toolbar__start",children:d}),a.jsx("div",{className:"studio-table-toolbar__end",children:f})]}),a.jsx(vf,{tabIndex:0,role:"region","aria-label":h??"表格滚动区域",orientation:l!=null?"both":"horizontal",maxHeight:l,hideScrollbar:u,className:"studio-table-scroll",children:a.jsxs("table",{ref:g,className:"studio-table","aria-label":h,"data-sticky-header":c&&l!=null||void 0,style:{minWidth:s,tableLayout:o},children:[i!=null&&a.jsx("caption",{children:i}),a.jsx("colgroup",{children:e.map(y=>a.jsx("col",{style:{width:y.width}},y.key))}),a.jsx("thead",{children:a.jsx("tr",{children:e.map((y,w)=>{const x=y.sort,O=y.filter,k=(x==null?void 0:x.direction)==="asc"?"desc":(x==null?void 0:x.direction)==="desc"?null:"asc",S=_le(y.title)??y.key,C=(x==null?void 0:x["aria-label"])??`${S}:${k==="asc"?"升序排列":k==="desc"?"降序排列":"恢复原顺序"}`;return a.jsx("th",{scope:"col","aria-sort":x?x.direction==="asc"?"ascending":x.direction==="desc"?"descending":"none":void 0,"data-fixed":y.fixed,"data-fixed-boundary":v(y,w),style:b(y,w),children:x||O?a.jsxs("div",{className:"studio-table__header-content","data-align":y.align??"left",children:[a.jsx("span",{className:"studio-table__header-title",children:y.title}),x&&a.jsx(Ki,{variant:"ghost",iconOnly:!0,className:"studio-table__sort-button","data-active":x.direction!=null||void 0,"aria-label":C,title:C,disabled:x.disabled,startIcon:a.jsx(oin,{direction:x.direction}),onClick:()=>x.onChange(k)}),O&&a.jsx(G9e,{className:"studio-table__filter","aria-label":O["aria-label"]??`筛选 ${S}`,value:O.value,options:O.options,disabled:O.disabled,onChange:E=>O.onChange(E.target.value)})]}):y.title},y.key)})})}),a.jsx("tbody",{children:t.length?t.map((y,w)=>a.jsx("tr",{children:e.map((x,O)=>{const k=x.render(y,w);return a.jsx("td",{"data-fixed":x.fixed,"data-fixed-boundary":v(x,O),style:b(x,O),children:a.jsx("div",{className:"studio-table__cell-value","data-overflow":x.overflow??"wrap",title:x.overflow==="ellipsis"?_le(k):void 0,children:k})},x.key)})},n(y))):a.jsx("tr",{children:a.jsx("td",{colSpan:Math.max(1,e.length),className:"studio-table__empty",children:r})})})]})})]})}function cin(){const e=p.useRef(null);return p.useLayoutEffect(()=>{const t=e.current;if(!t)return;const n=()=>{const o=t.querySelector('[aria-selected="true"]');if(!o){delete t.dataset.indicatorReady;return}const l=o.getBoundingClientRect(),c=t.getBoundingClientRect();t.style.setProperty("--tab-indicator-left",`${l.left-c.left}px`),t.style.setProperty("--tab-indicator-width",`${l.width}px`),t.dataset.indicatorReady="true"},i=t.querySelector('[aria-selected="true"]'),r=t.closest(".studio-tabs-scroll");if(i&&r){const o=i.getBoundingClientRect(),l=r.getBoundingClientRect();o.leftl.right&&(r.scrollLeft+=o.right-l.right)}n();const s=new ResizeObserver(n);s.observe(t);for(const o of t.children)s.observe(o);return()=>s.disconnect()}),e}function uin({items:e,value:t,defaultValue:n,onValueChange:i,"aria-label":r,className:s=""}){var b,v;const o=p.useId(),l=cin(),[c,u]=p.useState(n??((b=e[0])==null?void 0:b.value)),d=p.useRef([]),f=t??c,h=e.some(y=>y.value===f)?f:(v=e[0])==null?void 0:v.value;function m(y){t===void 0&&u(y),i==null||i(y)}function g(y,w){var O;let x;switch(y.key){case"ArrowRight":x=(w+1)%e.length;break;case"ArrowLeft":x=(w-1+e.length)%e.length;break;case"Home":x=0;break;case"End":x=e.length-1;break;default:return}y.preventDefault(),m(e[x].value),(O=d.current[x])==null||O.focus()}return a.jsx(vf,{orientation:"horizontal",hideScrollbar:!0,className:"studio-tabs-scroll",children:a.jsx("div",{ref:l,role:"tablist","aria-label":r,className:`studio-underline-tabs ${s}`.trim(),children:e.map((y,w)=>a.jsx("button",{ref:x=>{d.current[w]=x},type:"button",role:"tab",id:y.id??`${o}-${y.value}`,"aria-controls":y.panelId,"aria-selected":y.value===h,tabIndex:y.value===h?0:-1,className:"studio-underline-tabs__tab",onClick:()=>m(y.value),onKeyDown:x=>g(x,w),children:a.jsx("span",{className:"studio-underline-tabs__label",children:y.label})},y.value))})})}let k6,S6,jle=Promise.resolve(),din=0;function fin(){return k6??(k6=Js(()=>import("../visualizations/echarts/index-CGT341lL.js"),[]).catch(e=>{throw k6=void 0,e})),k6}function hin(){return S6??(S6=Js(()=>import("../visualizations/mermaid/mermaid.core-DAx4nvmm.js").then(e=>e.ay),__vite__mapDeps([0,1])).then(e=>e.default).catch(e=>{throw S6=void 0,e})),S6}function pin(e,t){const n=jle.then(async()=>{if(e.length>5e4)throw new Error("Diagram exceeds the supported size");const i=await hin();return i.initialize({startOnLoad:!1,securityLevel:"strict",suppressErrorRendering:!0,maxTextSize:5e4,theme:"base",fontFamily:t.font,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","theme","themeVariables","themeCSS","fontFamily"],themeVariables:{darkMode:t.dark,fontFamily:t.font,fontSize:"14px",background:t.panel,primaryColor:t.fill,primaryTextColor:t.text,primaryBorderColor:t.border,secondaryColor:t.panel,secondaryTextColor:t.text,secondaryBorderColor:t.border,tertiaryColor:t.fill,tertiaryTextColor:t.text,tertiaryBorderColor:t.border,lineColor:t.secondary,textColor:t.text,mainBkg:t.fill,nodeBorder:t.border,clusterBkg:t.panel,clusterBorder:t.border,edgeLabelBackground:t.panel,titleColor:t.text,actorBkg:t.fill,actorTextColor:t.text,actorBorder:t.border,actorLineColor:t.border,signalColor:t.secondary,signalTextColor:t.text,noteBkgColor:t.fill,noteTextColor:t.text,noteBorderColor:t.border}}),i.render(`studio-conversation-diagram-${++din}`,e)});return jle=n.then(()=>{},()=>{}),n}function min(e){const[t,n]=p.useState(null);return p.useEffect(()=>{const i=e.current;if(!i)return;const r=window.matchMedia("(prefers-reduced-motion: reduce)");function s(){var d;const l=getComputedStyle(i),c=(f,h)=>l.getPropertyValue(f).trim()||h,u={text:c("--studio-text-primary",l.color),secondary:c("--studio-text-secondary",l.color),tertiary:c("--studio-text-tertiary",l.color),subtle:c("--studio-text-subtle",l.color),border:c("--studio-border-subtle",l.color),panel:c("--studio-bg-panel",l.backgroundColor),fill:c("--studio-bg-secondary",l.backgroundColor),font:c("--studio-font-family-ui",l.fontFamily),dark:((d=i.closest("[data-theme]"))==null?void 0:d.getAttribute("data-theme"))!=="light",reducedMotion:r.matches};n(f=>JSON.stringify(f)===JSON.stringify(u)?f:u)}s();const o=new MutationObserver(s);for(let l=i;l;l=l.parentElement)o.observe(l,{attributes:!0,attributeFilter:["data-theme","class","style"]});return r.addEventListener("change",s),()=>{o.disconnect(),r.removeEventListener("change",s)}},[e]),t}function gin(e){const t={axisLine:{lineStyle:{color:e.border}},axisTick:{lineStyle:{color:e.border}},axisLabel:{color:e.secondary,fontFamily:e.font,fontSize:12},nameTextStyle:{color:e.secondary,fontFamily:e.font,fontSize:12},splitLine:{lineStyle:{color:e.border}},splitArea:{areaStyle:{color:["transparent",e.fill]}}};return{color:[e.text,e.tertiary,e.subtle,e.secondary],backgroundColor:"transparent",textStyle:{color:e.text,fontFamily:e.font,fontSize:12},title:{textStyle:{color:e.text,fontSize:14,fontWeight:400},subtextStyle:{color:e.secondary}},legend:{textStyle:{color:e.secondary,fontFamily:e.font,fontSize:12}},tooltip:{backgroundColor:e.panel,borderColor:e.border,textStyle:{color:e.text,fontFamily:e.font,fontSize:12}},categoryAxis:t,valueAxis:t,timeAxis:t,logAxis:t,radar:{axisLine:t.axisLine,splitLine:t.splitLine,splitArea:t.splitArea,axisName:{color:e.secondary}},line:{symbolSize:5},graph:{color:[e.text,e.tertiary,e.subtle]}}}function s7e({invalid:e=!1}){return a.jsx("div",{role:"alert",className:"studio-conversation-rich-visual__error",children:a.jsx(TK,{title:e?"图表定义无法解析":"图表暂时无法显示",description:"可以切换到源码查看完整内容"})})}function bin({source:e,title:t,theme:n}){const i=p.useRef(null),[r,s]=p.useState("loading");p.useEffect(()=>{let l=!1,c,u;const d=()=>c==null?void 0:c.resize();s("loading");let f;try{f=HMe(e,n.reducedMotion)}catch{s("invalid");return}const h=gin(n);return fin().then(m=>{l||!i.current||(c=m.init(i.current,h,{renderer:"svg"}),c.setOption({...f,color:f.color??h.color,backgroundColor:"transparent",textStyle:{...f.textStyle,...h.textStyle},animation:!n.reducedMotion&&f.animation!==!1,animationDuration:n.reducedMotion?0:240,animationDurationUpdate:n.reducedMotion?0:160},{notMerge:!0}),typeof ResizeObserver<"u"?(u=new ResizeObserver(d),u.observe(i.current)):window.addEventListener("resize",d),s("ready"))}).catch(()=>{c==null||c.dispose(),c=void 0,l||s("error")}),()=>{l=!0,u==null||u.disconnect(),window.removeEventListener("resize",d),c==null||c.dispose()}},[e,n]);const o=r==="invalid"||r==="error";return a.jsxs("div",{className:"studio-conversation-rich-visual__chart","aria-busy":r==="loading",children:[a.jsx("div",{ref:i,className:"studio-conversation-rich-visual__canvas",role:"img","aria-label":t,hidden:o}),r==="loading"&&a.jsx("div",{className:"studio-conversation-rich-visual__loading",children:a.jsx(o0,{size:24,label:"正在渲染图表"})}),o&&a.jsx(s7e,{invalid:r==="invalid"})]})}function nR({kind:e}){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e==="expand"?a.jsx("path",{d:"M6 2.5H2.5V6m7.5-3.5h3.5V6m0 4v3.5H10M6 13.5H2.5V10"}):e==="minus"?a.jsx("path",{d:"M3.5 8h9"}):e==="plus"?a.jsx("path",{d:"M3.5 8h9M8 3.5v9"}):a.jsx(a.Fragment,{children:a.jsx("path",{d:"M3 5.5A5.1 5.1 0 1 1 3 10M3 2.5v3H6"})})})}function yin({source:e,title:t,theme:n}){const i=p.useRef(null),[r,s]=p.useState(null),[o,l]=p.useState(!1),[c,u]=p.useState(1);return p.useEffect(()=>{let d=!1;return s(null),l(!1),pin(e,n).then(f=>{d||s(f)}).catch(()=>{d||l(!0)}),()=>{d=!0}},[e,n]),p.useEffect(()=>{var d;i.current&&((d=r==null?void 0:r.bindFunctions)==null||d.call(r,i.current))},[r]),o?a.jsx(s7e,{invalid:!0}):r?a.jsxs(a.Fragment,{children:[a.jsx(vf,{orientation:"both",maxHeight:440,className:"studio-conversation-rich-visual__diagram-scroll",tabIndex:0,role:"region","aria-label":`${t}图表滚动区域`,children:a.jsx("div",{className:"studio-conversation-rich-visual__diagram-size",style:{width:`${c*100}%`},children:a.jsx("div",{ref:i,className:"studio-conversation-rich-visual__mermaid",role:"img","aria-label":t,dangerouslySetInnerHTML:{__html:r.svg}})})}),a.jsxs("div",{className:"studio-conversation-rich-visual__zoom",role:"group","aria-label":"图表缩放",children:[a.jsx(Ki,{variant:"ghost",iconOnly:!0,size:"compact","aria-label":"缩小图表",disabled:c<=.5,startIcon:a.jsx(nR,{kind:"minus"}),onClick:()=>u(d=>Math.max(.5,d-.25))}),a.jsxs("span",{"aria-live":"polite",children:[Math.round(c*100),"%"]}),a.jsx(Ki,{variant:"ghost",iconOnly:!0,size:"compact","aria-label":"放大图表",disabled:c>=2.5,startIcon:a.jsx(nR,{kind:"plus"}),onClick:()=>u(d=>Math.min(2.5,d+.25))}),a.jsx(Ki,{variant:"ghost",iconOnly:!0,size:"compact","aria-label":"重置图表缩放",startIcon:a.jsx(nR,{kind:"reset"}),onClick:()=>u(1)})]})]}):a.jsx("div",{className:"studio-conversation-rich-visual__placeholder",children:a.jsx(o0,{size:24,label:"正在渲染图表"})})}function a7e({kind:e,source:t,title:n=e==="echarts"?"数据图表":"流程图",streaming:i=!1,expanded:r=!1}){const s=p.useId(),o=p.useRef(null),l=min(o),[c,u]=p.useState("preview"),d=i?"source":c;return a.jsx(rin,{ref:o,title:n,className:"studio-conversation-rich-visual","data-kind":e,"data-expanded":r||void 0,actions:i?a.jsx(o0,{size:24,label:"正在生成图表定义"}):r?void 0:a.jsx(ain,{label:`展开${n}`,title:n,topGlow:!1,closeLabel:"关闭图表","data-theme":l?l.dark?"dark":"light":void 0,className:"studio-conversation-rich-visual__modal",buttonProps:{variant:"ghost",iconOnly:!0,startIcon:a.jsx(nR,{kind:"expand"}),"aria-label":`展开${n}`},children:a.jsx(a7e,{kind:e,source:t,title:n,expanded:!0})}),children:a.jsxs(sin,{className:"studio-conversation-rich-visual__body",children:[!i&&a.jsx(uin,{"aria-label":`${n}展示方式`,value:d,onValueChange:u,items:[{value:"preview",label:"预览",id:`${s}-preview-tab`,panelId:`${s}-preview`},{value:"source",label:"源码",id:`${s}-source-tab`,panelId:`${s}-source`}]}),a.jsx("div",{id:`${s}-${d}`,role:i?void 0:"tabpanel","aria-labelledby":i?void 0:`${s}-${d}-tab`,className:"studio-conversation-rich-visual__panel",children:d==="source"?a.jsx(ML,{title:e==="echarts"?"ECharts option":"Mermaid",language:e==="echarts"?"javascript":"plaintext",lines:t.split(` `),scrollAreaProps:{orientation:"both",maxHeight:r?600:320}}):l?e==="echarts"?a.jsx(bin,{source:t,title:n,theme:l}):a.jsx(yin,{source:t,title:n,theme:l}):a.jsx("div",{className:"studio-conversation-rich-visual__placeholder",children:a.jsx(o0,{size:24,label:"正在渲染图表"})})})]})})}const vin=p.memo(function(t){return a.jsx(a7e,{...t})});function fx(e){return p.Children.toArray(e).filter(p.isValidElement)}function xin({children:e}){const t=fx(e),n=t.find(l=>l.type==="thead"),i=t.find(l=>l.type==="tbody"),r=n?fx(n.props.children)[0]:void 0,s=r?fx(r.props.children):[],o=i?fx(i.props.children).map((l,c)=>({id:c,cells:fx(l.props.children).map(u=>u.props.children)})):[];return a.jsx(lin,{"aria-label":"回复中的表格",className:"studio-conversation-rich-markdown__table",columns:s.map((l,c)=>{var u;return{key:String(c),title:l.props.children,align:(u=l.props.style)==null?void 0:u.textAlign,render:d=>d.cells[c]}}),data:o,rowKey:l=>l.id,layout:"auto",minWidth:Math.max(320,s.length*112),maxHeight:360,hideScrollbar:!1})}function win(e){var r,s;const t=e.trimEnd().split(` `),n=(r=t[0])==null?void 0:r.match(/^\s{0,3}(`{3,}|~{3,})/);if(!n||t.length<2)return!1;const i=(s=t[t.length-1])==null?void 0:s.trim();return new RegExp(`^${n[1][0]}{${n[1].length},}$`).test(i)}const Oin=p.memo(function({text:t,streaming:n=!1}){const i=p.useMemo(()=>[bDe],[]);return a.jsx("div",{className:"studio-conversation-rich-markdown","data-streaming":n||void 0,children:a.jsx(qPe,{remarkPlugins:i,skipHtml:!0,components:{pre({children:r,node:s}){var d,f,h,m,g;const o=fx(r)[0],l=typeof(o==null?void 0:o.props.children)=="string"?o.props.children.replace(/\n$/,""):String((o==null?void 0:o.props.children)??""),c=((h=(f=(d=o==null?void 0:o.props.className)==null?void 0:d.match(/language-([^\s]+)/))==null?void 0:f[1])==null?void 0:h.toLowerCase())??"plaintext",u=qMe(c);if(u){const b=(m=s==null?void 0:s.position)==null?void 0:m.start.offset,v=(g=s==null?void 0:s.position)==null?void 0:g.end.offset,y=n&&(b==null||v==null||!win(t.slice(b,v)));return a.jsx(vin,{kind:u,source:l,streaming:y})}return a.jsx(ML,{title:c==="plaintext"?"代码":c,language:c,lines:l.split(` `),scrollAreaProps:{orientation:"both",maxHeight:360}})},table:xin,a({children:r,href:s,title:o}){const l=s?/^https?:\/\//i.test(s):!1;return a.jsx("a",{href:s,title:o,target:l?"_blank":void 0,rel:l?"noopener noreferrer":void 0,children:r})},img({src:r,alt:s,title:o}){return a.jsx("img",{src:r,alt:s??"",title:o,loading:"lazy"})}},children:t})})});function kin(e){return a.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M3.5 7.5V6A2 2 0 0 1 5.5 4h4l2 3h7A2 2 0 0 1 20.5 9v9a2 2 0 0 1-2 2h-13a2 2 0 0 1-2-2V7.5Z"}),a.jsx("path",{d:"M8 12h8M8 16h5"})]})}function Sin(){return a.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M19 8a8 8 0 1 0 .6 7M19 4v4h-4"})})}function Ein(){return a.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M12 3v12m-4-4 4 4 4-4M4 16v4h16v-4"})})}function Cin({scope:e,file:t,loadPreview:n}){const[i,r]=p.useState(null),[s,o]=p.useState(""),[l,c]=p.useState(""),[u,d]=p.useState(!1),[f,h]=p.useState(0),[m,g]=p.useState(!1),[b,v]=p.useState(""),[y,w]=p.useState(1),x=p.useRef(null),O=p.useRef(new Map),k=t?_K(t.mimeType,t.path):"download",S=!!(t&&t.sizeBytes>aU);p.useEffect(()=>{if(!t||k==="download"||S)return;const E=new AbortController;let j;r(null),o(""),c(""),d(!1);let T=!1;return n(t.path).then(async R=>{if(!E.signal.aborted)if(k==="image")j=URL.createObjectURL(R),E.signal.aborted?URL.revokeObjectURL(j):r({url:j});else{const A=await R.text();if(E.signal.aborted)return;const N=k==="html"?await Znn(A,t.path,P=>{if(E.signal.aborted)throw new DOMException("Aborted","AbortError");return n(P)},P=>{T=!0,E.signal.aborted||(r({text:P}),d(!0))}):A;E.signal.aborted||(r({text:N}),d(!1))}}).catch(R=>{if(!E.signal.aborted){const A=R instanceof Error?R.message:"无法加载文件,请重试";T?c(A):o(A),d(!1)}}),()=>{E.abort(),j&&URL.revokeObjectURL(j)}},[n,t==null?void 0:t.path,t==null?void 0:t.updatedAt,k,S,f]),p.useEffect(()=>{w(1)},[t==null?void 0:t.path]),p.useEffect(()=>()=>{var E;(E=x.current)==null||E.abort();for(const[j,T]of O.current)clearTimeout(j),URL.revokeObjectURL(T);O.current.clear()},[]);async function C(){if(!t||m)return;const E=new AbortController;x.current=E,g(!0),v("");try{const j=await r7e(e,t.path,E.signal,!0);if(E.signal.aborted)return;const T=URL.createObjectURL(j),R=document.createElement("a");R.href=T,R.download=t.name,document.body.append(R),R.click(),R.remove();const A=window.setTimeout(()=>{URL.revokeObjectURL(T),O.current.delete(A)},1e3);O.current.set(A,T)}catch(j){E.signal.aborted||v(j instanceof Error?j.message:"下载失败,请重试")}finally{E.signal.aborted||g(!1)}}return t?a.jsxs("section",{className:"runtime-artifact-preview","aria-label":`${t.name} 预览`,children:[a.jsxs("header",{className:"runtime-artifact-preview__header",children:[a.jsxs("div",{className:"runtime-artifact-preview__identity",children:[a.jsx("span",{title:t.path,children:t.path}),a.jsx("small",{children:Jnn(t.sizeBytes)})]}),a.jsx(Ki,{variant:"ghost",loading:m,startIcon:a.jsx(Ein,{}),onClick:()=>void C(),children:"下载"})]}),b&&a.jsx("div",{className:"runtime-artifact-preview__error",role:"alert",children:b}),u&&a.jsx("div",{className:"runtime-artifact-preview__resource-status",role:"status",children:a.jsx(hn,{children:"正在加载图片"})}),l&&a.jsxs("div",{className:"runtime-artifact-preview__error",role:"alert",children:["图片暂未加载:",l," ",a.jsx(Ki,{variant:"ghost",onClick:()=>h(E=>E+1),children:"重试图片"})]}),S||k==="download"?a.jsx("div",{className:"runtime-artifact-preview__empty",children:a.jsx(uA,{title:S?"文件较大":"此格式暂不支持预览",description:S?"超过 5 MB 的文件请下载后查看":"下载文件后使用对应应用打开"})}):s?a.jsxs("div",{className:"runtime-artifact-preview__empty",children:[a.jsx(TK,{title:"预览加载失败",description:s}),a.jsx(Ki,{variant:"outline",onClick:()=>h(E=>E+1),children:"重试"})]}):i?k==="html"?a.jsx("iframe",{className:"runtime-artifact-preview__html",title:`${t.name} HTML 预览`,sandbox:"",referrerPolicy:"no-referrer",srcDoc:i.text}):k==="image"?a.jsxs(a.Fragment,{children:[a.jsx(vf,{orientation:"both",className:"runtime-artifact-preview__image-scroll",tabIndex:0,"aria-label":"图片预览滚动区域",children:a.jsx("img",{className:"runtime-artifact-preview__image",src:i.url,alt:t.name,style:{width:`${y*100}%`,maxWidth:y===1?"100%":"none"},onError:()=>o("无法显示此图片,请下载后查看")})}),a.jsxs("div",{className:"runtime-artifact-preview__zoom",role:"group","aria-label":"图片缩放",children:[a.jsx(Ki,{variant:"ghost",disabled:y<=.5,onClick:()=>w(E=>Math.max(.5,E-.25)),children:"缩小"}),a.jsxs("span",{children:[Math.round(y*100),"%"]}),a.jsx(Ki,{variant:"ghost",disabled:y>=3,onClick:()=>w(E=>Math.min(3,E+.25)),children:"放大"}),a.jsx(Ki,{variant:"ghost",onClick:()=>w(1),children:"适应宽度"})]})]}):a.jsx(vf,{className:"runtime-artifact-preview__document",tabIndex:0,"aria-label":"文件预览内容",children:k==="markdown"?a.jsx(Oin,{text:i.text??""}):a.jsx(ML,{title:t.name,language:t.path.endsWith(".json")?"json":"plaintext",lines:(i.text??"").split(` @@ -1109,7 +1109,7 @@ ${t}`}function ksn(e,t){if(e.length<=t)return{text:e,omitted:!1};let n=e.slice(- `).length:0,truncated:!1,updatedAt:Date.now(),pendingMessage:pi==="running"?H("projectPreview.task.waitingGithubLog"):void 0},Mn},Fe=()=>{if(!(ai!=="build"||!(bn!=null&&bn.text)))return bn={...bn,status:"error",updatedAt:Date.now()},bn},lt=Jt=>ai==="build"&&(bn!=null&&bn.text)?My(bn.text,{preserveEnd:!0}):My(Jt),ct=(Jt,pi,Vt=0,yi="info")=>{var Xn;const Ln={level:yi,phase:Jt,message:pi,pct:Vt};ai=Jt,ss=pi,re=void 0,rr.current&&(xt(mi=>({...mi,[Jt]:Ln})),nn(Jt)),k==null||k({id:ot,agentName:$t,runtimeName:On,runtimeId:zn,region:bi,startedAt:mn,status:"running",phase:Jt,label:((Xn=Ms.find(mi=>mi.phase===Jt))==null?void 0:Xn.label)??Jt,message:pi,pct:Vt,githubDelivery:!!(It||Mn),mpaProfile:Rr,mpaSmoke:Rr&&!ie,...Mn?{githubLog:Mn}:{},...st("complete")})};try{let Jt=St;if(g&&(St!=null&&St.pipelineId)){ai="github";const Ln=de(H("projectPreview.task.syncingGithub")),Xn={level:"info",phase:"github",message:H("projectPreview.task.syncingGithub"),pct:0};rr.current&&(xt(lr=>({...lr,github:Xn})),nn("github")),k==null||k({id:ot,agentName:$t,runtimeName:On,runtimeId:zn,region:bi,startedAt:mn,status:"running",phase:"github",label:H("projectPreview.task.syncGithubCode"),message:Xn.message,pct:0,githubDelivery:!0,githubLog:Ln});const mi=await s2e({runtimeId:g,project:e,agentCategory:Lo?"mpa":"general"});if(Jt=mi,rr.current&&(Ct(mi),xt(lr=>({...lr,github:{level:"success",phase:"github",message:H("projectPreview.task.githubSynced"),pct:100}})),nn(null)),(Lt=mi.cicd)!=null&&Lt.enabled){k==null||k({id:ot,agentName:$t,runtimeName:On,runtimeId:g,region:q,startedAt:mn,status:"success",phase:"github",label:H("projectPreview.task.githubSubmitted"),message:H("projectPreview.task.githubUpdatingRuntime"),pct:100,githubDelivery:!0,githubLog:de(H("projectPreview.task.githubUpdatingRuntime"),"complete")});return}}const pi=await c(e,Ln=>{var mi;Ln.runtimeName&&(On=Ln.runtimeName);const Xn=_sn(ai,Ln.phase);Ln.buildLog?bn=Ssn(bn,Ln.buildLog):Ln.phase==="build"&&!bn&&(bn=Ye()),Ln.phase===Xn&&(ss=Ln.message,re=Ln.messageCode),ai=Xn,rr.current&&(xt(lr=>({...lr,[Ln.phase]:Ln})),nn(ai)),k==null||k({id:ot,agentName:$t,runtimeName:On,runtimeId:g,region:q,startedAt:mn,status:"running",phase:ai,label:((mi=Ms.find(lr=>lr.phase===ai))==null?void 0:mi.label)??ai,message:ss,messageCode:re,pct:Ln.pct,mpaProfile:Rr,mpaSmoke:Rr&&!ie,...bn?{buildLog:bn}:{}})},{taskId:ot,runtimeName:Dn,sessionStorage:be?"in-memory":"persistent",minInstance:br.min,maxInstance:br.max,agentCategory:Lo?"mpa":"general",...ie?{}:{authentication:ti==="user_pool"?{type:"user_pool",userPoolUid:es}:{type:"api_key"}},createEvaluationSets:ks,...j?{im:{feishu:{enabled:!0}}}:{},envs:Re,...ie?{}:{resources:rt}});zn=pi.runtimeId||g,bi=pi.region||q;let Vt=pi;if(Fa=Vt.mpaInstanceId||b,Rr&&!zn)throw new Error(H("projectPreview.errors.mpaRuntimeIdMissing"));if(!g&&It&&Vt.runtimeId){ai="github";const Ln=de(H("projectPreview.task.initializingGithub")),Xn={level:"info",phase:"github",message:H("projectPreview.task.initializingGithubBranch"),pct:0};rr.current&&(xt(mi=>({...mi,github:Xn})),nn("github")),k==null||k({id:ot,agentName:Vt.agentName||$t,runtimeName:Vt.runtimeName||On,runtimeId:Vt.runtimeId,region:Vt.region||q,startedAt:mn,status:"running",phase:"github",label:H("projectPreview.task.mountGithubDelivery"),message:Xn.message,pct:0,githubDelivery:!0,githubLog:Ln});try{const mi=await n2e({project:e,githubUrl:It.githubUrl,githubToken:It.githubToken,baseBranch:It.baseBranch,runtimeName:Vt.agentName||On,runtimeId:Vt.runtimeId,region:Vt.region||q,agentCategory:Lo?"mpa":"general",cloudProvider:It.cloudProvider,projectPath:".",volcengineAccessKey:It.volcengineAccessKey,volcengineSecretKey:It.volcengineSecretKey,volcengineSessionToken:It.volcengineSessionToken});Jt=mi,rr.current&&(Ct(mi),Gt(null),xt(lr=>({...lr,github:{level:"success",phase:"github",message:H("projectPreview.task.githubBranchInitialized"),pct:100}})),nn(null)),k==null||k({id:ot,agentName:Vt.agentName||$t,runtimeName:Vt.runtimeName||On,runtimeId:Vt.runtimeId,region:Vt.region||q,startedAt:mn,status:"running",phase:"github",label:H("projectPreview.task.githubDeliveryMounted"),message:H("projectPreview.task.githubBranchInitialized"),pct:100,githubDelivery:!0,githubLog:de(H("projectPreview.task.githubBranchInitialized"),"complete")})}catch(mi){const lr=de(H("projectPreview.task.githubMountFailedDetail",{message:mi instanceof Error?mi.message:String(mi)}),"error");throw k==null||k({id:ot,agentName:Vt.agentName||$t,runtimeName:Vt.runtimeName||On,runtimeId:Vt.runtimeId,region:Vt.region||q,startedAt:mn,status:"error",phase:"github",label:H("projectPreview.task.githubMountFailed"),message:H("projectPreview.task.githubMountFailedHint"),pct:100,githubDelivery:!0,githubLog:lr}),new Error(H("projectPreview.errors.deployedButGithubMountFailed",{message:mi instanceof Error?mi.message:String(mi)}))}}else if(!g&&(Jt!=null&&Jt.pipelineId)&&Vt.runtimeId)try{const Ln=await Lz({pipelineId:Jt.pipelineId,runtimeId:Vt.runtimeId,region:Vt.region||q,cloudProvider:Jt.cloudProvider??z});Jt=Ln,rr.current&&Ct(Ln)}catch(Ln){rr.current&&nt(H("projectPreview.errors.deployedButGithubBindFailed",{message:Ln instanceof Error?Ln.message:String(Ln)}))}let yi;if(Rr&&i&&(Vt.runtimeId||g)){const Ln=String(Vt.runtimeId||g||""),Xn=Vt.region||q;if(zn=Ln,bi=Xn,On=Vt.runtimeName||On,ct("profile_applying",H("projectPreview.task.applyingMpaProfile")),yi=await JR({operationKind:ie?"update":"create",runtimeId:Ln,region:Xn,mpaInstanceId:b??Vt.mpaInstanceId,agentName:$t,sourceDraftId:Wt.draftId,draft:i,runtimeName:Dn||Ln,runtimeRevision:ie?y:void 0,taskId:ot}),yi.status!=="succeeded"){const mi=yi.stage==="smoke_running"?"smoke_running":"profile_applying",lr=yi.safeErrorCode||H("projectPreview.errors.mpaOperationIncomplete");if(ct(mi,lr,100,"error"),yi.status==="failed_retryable"){const cr=yi.operationId,pr={operationKind:ie?"update":"create",runtimeId:Ln,region:Xn,mpaInstanceId:b??Vt.mpaInstanceId??Ln,sourceProfileId:(ln=Wt.draftId)!=null&&ln.trim()?`studio-draft:${Wt.draftId.trim()}`:`studio-agent:${$t}:${ot}`,draft:i,targetKey:ie?b??Ln:`runtime:${Xn}:${Dn||Ln}`,runtimeRevision:ie?y:void 0};oe=async()=>{const ro=await Nz(cr,pr);if(k==null||k({...Wt,runtimeName:Vt.runtimeName||On,runtimeId:Ln,mpaInstanceId:pr.mpaInstanceId,region:Xn,status:ro.status==="succeeded"?"success":"error",phase:ro.stage,label:ro.status==="succeeded"?H("projectPreview.task.deploymentComplete"):H("projectPreview.task.deploymentFailed"),message:ro.safeErrorCode||void 0,pct:100,mpaProfile:!0,mpaSmoke:!ie,operationId:ro.operationId}),ro.status!=="succeeded")throw new Error(ro.safeErrorCode||H("projectPreview.errors.mpaOperationIncomplete"));await(d==null?void 0:d({...Vt,mpaOperation:ro}))}}throw new Error(lr)}ie?ct("profile_applying",H("projectPreview.task.mpaProfileApplied"),100,"success"):(ct("smoke_running",H("projectPreview.task.runningMpaSmoke"),100,"success"),ct("runnable",H("projectPreview.task.mpaReady"),100,"success")),Vt={...Vt,mpaOperation:yi}}rr.current&&(ft(Vt),nn(null)),jn.succeed({runtimeId:String(Vt.runtimeId||g||"")}),k==null||k({id:ot,agentName:Vt.agentName||$t,runtimeName:Vt.runtimeName||On,runtimeId:zn,mpaInstanceId:Vt.mpaInstanceId,region:bi,startedAt:mn,status:"success",phase:yi&&!ie?"runnable":"complete",label:H("projectPreview.task.deploymentComplete"),message:yi&&!ie?H("projectPreview.task.mpaReady"):(yr=Vt.warnings)==null?void 0:yr.join(H("environmentCenter.listSeparator")),githubDelivery:!!(It||Mn),mpaProfile:!!yi,mpaSmoke:!!(yi&&!ie),...Mn?{githubLog:Mn}:{},...st("complete")});try{await(d==null?void 0:d(Vt))}catch(Ln){if(!(Ln instanceof Sa))throw Ln;k==null||k({id:ot,agentName:Vt.agentName||$t,runtimeName:Vt.runtimeName||On,runtimeId:zn,region:bi,startedAt:mn,status:"success",phase:"complete",label:H("projectPreview.task.deployedNotConnected"),message:Ln.message,mpaProfile:!!yi,mpaSmoke:!!(yi&&!ie),...st("complete")})}}catch(Jt){const pi=Jt instanceof Error?Jt.message:String(Jt);if(Jt instanceof DOMException&&Jt.name==="AbortError"){jn.fail({failedPhase:I6(ai),...Xo(Jt,{phase:ai}),errorMessage:My(Jt)}),rr.current&&(nt(null),nn(null)),k==null||k({id:ot,agentName:$t,runtimeName:On,runtimeId:zn,mpaInstanceId:Fa,region:bi,startedAt:mn,status:"cancelled",label:H("projectPreview.task.cancelled"),message:H("projectPreview.task.cancelledHint"),mpaProfile:ai==="profile_applying"||ai==="smoke_running",mpaSmoke:ai==="smoke_running",...st("complete")});return}if(zAe(Jt)){rr.current&&(nt(null),ft(null),Ne(!0)),jn.fail({failedPhase:I6(ai),...Xo(Jt,{phase:ai}),errorMessage:My(Jt)}),k==null||k({id:ot,agentName:$t,runtimeName:On,runtimeId:zn,mpaInstanceId:Fa,region:bi,startedAt:mn,status:"running",statusUnconfirmed:!0,phase:ai,label:H("projectPreview.task.deploymentStatusUnconfirmed"),message:H("projectPreview.errors.deploymentStatusUnconfirmed"),mpaProfile:!!i,mpaSmoke:!!(i&&!ie),...bn?{buildLog:bn}:{}});return}rr.current&&nt(pi),rr.current&&ft(null);const yi=Fe();jn.fail({failedPhase:I6(ai),...Xo(Jt,{phase:ai}),errorMessage:lt(Jt)});const Ln=!!yi,Xn=ai==="github"&&!!Mn;k==null||k({id:ot,agentName:$t,runtimeName:On,runtimeId:zn,region:bi,startedAt:mn,status:"error",phase:ai,label:H("projectPreview.task.deploymentFailed"),message:Ln?H("projectPreview.task.buildFailedHint"):Xn?H("projectPreview.task.githubMountFailedHint"):pi,...yi?{buildLog:yi}:st("complete"),...Xn?{githubDelivery:!0,githubLog:Mn}:{},mpaProfile:ai==="profile_applying"||ai==="smoke_running",mpaSmoke:ai==="smoke_running",retry:oe??sn})}finally{rr.current&&tt(!1)}}function Ss(){jt(!1)}async function is(){if(!(!et||Qt)){cn(!0),nt(null);try{const{addConnection:Re,addRuntimeConnection:ot,remoteAppId:$t,loadConnections:Dn}=await Js(async()=>{const{addConnection:jn,addRuntimeConnection:Wt,remoteAppId:bn,loadConnections:Mn}=await Promise.resolve().then(()=>fae);return{addConnection:jn,addRuntimeConnection:Wt,remoteAppId:bn,loadConnections:Mn}},void 0),{probeRuntimeApps:On}=await Js(async()=>{const{probeRuntimeApps:jn}=await Promise.resolve().then(()=>$tt);return{probeRuntimeApps:jn}},void 0);let mn;if(et.runtimeId){const jn=et.region??q,Wt=await On(et.runtimeId,jn,{retryProbe:!0})??[];mn=ot(et.runtimeId,et.runtimeName,jn,Wt,Wt.length>0?{[Wt[0]]:et.agentName}:void 0,et.version)}else mn=await Re(et.agentName,et.url,et.apikey,"");if(mn.apps.length===0)nt(H("projectPreview.errors.noAgentAtEndpoint"));else{const jn={[mn.apps[0]]:et.agentName},Wt={...mn,appLabels:{...mn.appLabels??{},...jn}},Mn=Dn().map(ss=>ss.id===mn.id?Wt:ss);localStorage.setItem("veadk_agentkit_connections",JSON.stringify(Mn));const{registerConnections:ai}=await Js(async()=>{const{registerConnections:ss}=await Promise.resolve().then(()=>fae);return{registerConnections:ss}},void 0);if(ai(Mn),u){const ss=$t(mn.id,mn.apps[0]);await u(ss,et.agentName)}else alert(H("projectPreview.agentAdded",{name:et.agentName}))}}catch(Re){nt(H("projectPreview.errors.addAgent",{message:Re instanceof Error?Re.message:String(Re)}))}finally{cn(!1)}}}function rs(){const Re=Fo(),ot=W9e({agentId:Re.agentId,deployAction:Re.deployAction,deploySource:Re.deploySource,createMode:Re.createMode,aiAssisted:Re.aiAssisted});try{const $t=P7e(e.files),Dn=URL.createObjectURL($t),On=document.createElement("a");On.href=Dn,On.download=`${e.name||"project"}.zip`,document.body.appendChild(On),On.click(),document.body.removeChild(On),URL.revokeObjectURL(Dn),ot.succeed({fileCount:e.files.length,zipSizeBytes:$t.size})}catch($t){throw ot.fail({fileCount:e.files.length,...Xo($t)}),$t}}const Fd=a.jsxs("div",{className:`pp-artifact-actions${t?" is-rail":""}`,"aria-label":H("projectPreview.artifactActions"),children:[ne&&a.jsxs("button",{type:"button",className:"pp-secondary",onClick:ne,children:[a.jsx(Rat,{className:"pp-ic"}),H("projectPreview.exportYaml")]}),X&&l&&a.jsx(Fjt,{project:e,onChange:l,className:"pp-artifact-source",label:H("projectPreview.viewSource")}),e.files.length>0&&a.jsxs("button",{type:"button",className:"pp-secondary",onClick:rs,children:[a.jsx(eM,{className:"pp-ic"}),H("projectPreview.downloadSource")]})]});function Ul(Re,ot,$t){return Vsn(Re,ot===0).map(Dn=>{const On=$t?`${$t}/${Dn.name}`:Dn.name,mn=Dn.path!==void 0,jn={paddingLeft:8+ot*14};if(mn){const bn=Dn.path===we;return a.jsxs("button",{type:"button",className:`pp-row pp-file${bn?" pp-active":""}`,style:jn,onClick:()=>Ae(Dn.path),title:Dn.path,children:[a.jsx(Dat,{className:"pp-ic"}),a.jsx("span",{className:"pp-label",children:Dn.name})]},On)}const Wt=Ve.has(On);return a.jsxs("div",{children:[a.jsxs("button",{type:"button",className:"pp-row pp-folder",style:jn,onClick:()=>Uo(On),children:[a.jsx(BA,{className:`pp-ic pp-chevron${Wt?"":" pp-open"}`}),a.jsx(Lat,{className:"pp-ic"}),a.jsx("span",{className:"pp-label",children:Dn.name})]}),!Wt&&Ul(Dn,ot+1,On)]},On)})}return a.jsxs("div",{className:`pp-root${c?" is-deploy":""}${t?" is-embedded":""}${W?" has-primary-pane":""}`,children:[c&&!t&&a.jsx(qsn,{left:a.jsxs("div",{className:"pp-toolbar-left",children:[V&&a.jsxs("button",{type:"button",className:"pp-toolbar-back",onClick:V,children:[a.jsx(Dje,{className:"pp-ic"}),Y]}),a.jsxs("span",{className:"pp-toolbar-title",children:[H("projectPreview.deployTitle",{name:r||e.name||H("projectPreview.unnamedAgent")}),s&&s>1?H("projectPreview.additionalAgentCount",{count:s}):""]})]}),right:null}),a.jsxs("div",{className:"pp-body",children:[c&&!W&&a.jsx("section",{className:"pp-release-overview","aria-label":H("projectPreview.releaseOverview"),children:a.jsxs("div",{className:`pp-release-preview${t?" is-embedded":""}`,children:[a.jsxs("div",{className:"pp-flow-thumbnail",children:[i&&a.jsx(RP,{draft:i,direction:"horizontal",selectedPath:[],onSelect:Qm,onAdd:Qm,onInsert:Qm,onDelete:Qm,readOnly:!0,interactivePreview:!0}),a.jsx("button",{type:"button",className:"pp-flow-expand",onClick:()=>wn(!0),"aria-label":H("projectPreview.expandFlow"),title:H("projectPreview.expand"),children:a.jsx(ZS,{"aria-hidden":!0})})]}),t&&Fd,!t&&a.jsxs("div",{className:"pp-release-info",children:[a.jsx("div",{className:"pp-release-card-head",children:H("projectPreview.agentOverview")}),a.jsxs("div",{className:"pp-release-info-body",children:[a.jsxs("div",{className:"pp-release-info-main",children:[a.jsx("h2",{children:r||e.name||H("projectPreview.unnamedAgent")}),(i==null?void 0:i.description)&&a.jsx("p",{className:"pp-release-description",title:i.description,children:i.description}),a.jsxs("dl",{className:"pp-release-facts",children:[a.jsxs("div",{children:[a.jsx("dt",{children:H("projectPreview.agentCount")}),a.jsx("dd",{children:s??1})]}),o&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsx("dt",{children:H("projectPreview.model")}),a.jsx("dd",{children:o.modelName})]}),a.jsxs("div",{children:[a.jsx("dt",{children:H("common.description")}),a.jsx("dd",{className:"pp-release-fact-long",children:o.description})]}),a.jsxs("div",{children:[a.jsx("dt",{children:H("projectPreview.systemPrompt")}),a.jsx("dd",{className:"pp-release-fact-long pp-release-prompt",children:o.instruction})]}),a.jsxs("div",{children:[a.jsx("dt",{children:H("projectPreview.optimizations")}),a.jsx("dd",{children:o.optimizations.length>0?o.optimizations.join(H("environmentCenter.listSeparator")):H("projectPreview.notEnabled")})]}),o.effectiveOptimizations&&o.effectiveOptimizations.length>0&&a.jsxs("div",{children:[a.jsx("dt",{children:H("projectPreview.effectiveCapabilities")}),a.jsx("dd",{children:o.effectiveOptimizations.join(H("environmentCenter.listSeparator"))})]}),o.autoAddedOptimizations&&o.autoAddedOptimizations.length>0&&a.jsxs("div",{children:[a.jsx("dt",{children:H("projectPreview.automaticProtection")}),a.jsx("dd",{children:o.autoAddedOptimizations.join(H("environmentCenter.listSeparator"))})]}),o.planHash&&a.jsxs("div",{children:[a.jsx("dt",{children:H("projectPreview.planHash")}),a.jsx("dd",{className:"pp-release-fact-long",children:o.planHash})]})]})]})]}),Fd]})]})]})}),a.jsxs("div",{className:"pp-files-area",children:[a.jsxs("div",{className:"pp-sidebar",children:[a.jsxs("div",{className:"pp-sidebar-head",children:[a.jsx("span",{className:"pp-project-name",title:e.name,children:H("projectPreview.files.preview")}),X&&a.jsx("button",{type:"button",className:"pp-icon-btn",title:H("projectPreview.files.new"),onClick:()=>{Pt(!0),Et("")},children:a.jsx(Iat,{className:"pp-ic"})})]}),a.jsxs("div",{className:"pp-tree",children:[_t&&a.jsx("input",{className:"pp-new-input",autoFocus:!0,placeholder:"path/to/file.py",value:Kt,onChange:Re=>Et(Re.target.value),onBlur:Ld,onKeyDown:Re=>{Re.key==="Enter"&&Ld(),Re.key==="Escape"&&(Pt(!1),Et(""))}}),e.files.length===0&&!_t?a.jsx("div",{className:"pp-empty",children:H("projectPreview.files.empty")}):Ul(ia,0,"")]})]}),a.jsxs("div",{className:"pp-main",children:[a.jsxs("div",{className:"pp-main-head",children:[a.jsx("span",{className:"pp-path",title:gi==null?void 0:gi.path,children:(gi==null?void 0:gi.path)??H("projectPreview.files.noneSelected")}),a.jsx("div",{className:"pp-actions",children:X&&gi&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"pp-icon-btn",title:H("projectPreview.files.rename"),onClick:yo,children:a.jsx(qat,{className:"pp-ic"})}),a.jsx("button",{type:"button",className:"pp-icon-btn pp-danger",title:H("common.delete"),onClick:$d,children:a.jsx(eb,{className:"pp-ic"})})]})})]}),a.jsx("div",{className:"pp-content",children:gi==null?a.jsx("div",{className:"pp-placeholder",children:H("projectPreview.files.selectToView")}):X?a.jsx("div",{className:"pp-codemirror",children:a.jsx(p.Suspense,{fallback:a.jsx("div",{className:"pp-editor-loading",children:H("projectPreview.files.loadingEditor")}),children:a.jsx(jsn,{value:gi.content,path:gi.path,onChange:Md})})}):a.jsx("pre",{className:"pp-pre hljs",dangerouslySetInnerHTML:{__html:$sn(gi.content,gi.path)}})})]})]}),c&&a.jsxs("aside",{className:"pp-config","aria-label":H("projectPreview.deploymentConfiguration"),children:[a.jsx("div",{className:"pp-config-head",children:a.jsx("div",{className:"pp-config-title",children:H("projectPreview.deploymentConfiguration")})}),a.jsxs("div",{className:"pp-config-scroll",children:[W,!W&&a.jsxs("section",{className:"pp-config-section",children:[a.jsx("label",{className:"pp-config-label",htmlFor:qs,children:H("projectPreview.runtimeName")}),a.jsxs("div",{className:"pp-runtime-name-field",children:[a.jsx("input",{id:qs,className:"pp-runtime-name-input",value:Pe,disabled:vt||ae||ie,maxLength:64,autoComplete:"off","aria-label":H("projectPreview.runtimeName"),"aria-invalid":!!qe,"aria-describedby":`${Ws}${qe?` ${Lr}`:""}`,onChange:Re=>{const ot=Re.currentTarget.value;_e(null),nt(null),x?x(ot):je(ot)}}),a.jsx("p",{id:Ws,className:"pp-config-note",children:H(ie?"projectPreview.runtimeNamePreserved":"projectPreview.runtimeNameHint")}),qe&&a.jsx("p",{id:Lr,className:"pp-runtime-name-error",role:"alert",children:qe})]})]}),!W&&a.jsxs("section",{className:"pp-config-section",children:[a.jsx("div",{className:"pp-config-label",children:H("projectPreview.releaseRegion")}),ml(!1)]}),!W&&a.jsxs(a.Fragment,{children:[a.jsxs("section",{className:"pp-config-section pp-auth-section",children:[a.jsx("div",{className:"pp-config-label",children:H("projectPreview.accessAuthentication")}),ie?a.jsx("p",{className:"pp-config-note pp-auth-preserved-note",children:H("projectPreview.authenticationPreserved")}):a.jsxs("div",{className:"pp-auth-fields",children:[a.jsxs("label",{children:[a.jsx("span",{children:H("projectPreview.authenticationMethod")}),a.jsx(xf,{ariaLabel:H("projectPreview.authenticationAriaLabel"),value:ti,placeholder:H("projectPreview.authenticationPlaceholder"),options:Dsn(H),disabled:vt,onChange:Re=>{nt(null),Ei(Re)}})]}),ti==="user_pool"&&a.jsxs("label",{children:[a.jsx("span",{children:H("projectPreview.userPool.label")}),a.jsx(Psn,{value:es,disabled:vt,onChange:Re=>{nt(null),ts(Re)}})]})]})]}),S&&a.jsx(Tsn,{project:e,region:q,cloudProvider:z,runtimeId:g,agentCategory:Lo?"mpa":"general",binding:St,showSetup:!ie,onPendingCicdChange:Gt,onBindingChange:$a,disabled:vt||We||G||!!n})]}),!W&&C&&a.jsxs("section",{className:"pp-config-section",children:[a.jsx("div",{className:"pp-config-label",children:H("projectPreview.messageChannels")}),a.jsx(vsn,{enabled:j,updating:We,disabled:vt||ae||!T||!L,agentName:r||e.name,appId:D.FEISHU_APP_ID??"",appSecret:D.FEISHU_APP_SECRET??"",appIdConfigured:ee.has("FEISHU_APP_ID"),appSecretConfigured:ee.has("FEISHU_APP_SECRET"),onToggle:Ls,onCredentialsChange:(Re,ot)=>{L==null||L(Re,ot)}})]}),!ie&&a.jsxs("section",{className:"pp-config-section",children:[a.jsx("div",{className:"pp-config-label",children:H("projectPreview.instanceSettings")}),a.jsxs("div",{className:"pp-instance-fields",children:[a.jsxs("label",{htmlFor:"runtime-min-instance",children:[a.jsx("span",{children:H("projectPreview.minInstances")}),a.jsx("input",{id:"runtime-min-instance",type:"number",min:"0",step:"1",inputMode:"numeric",value:fs,disabled:vt||ye,"aria-invalid":!br.valid,onChange:Re=>he(Re.currentTarget.value)})]}),a.jsxs("label",{htmlFor:"runtime-max-instance",children:[a.jsx("span",{children:H("projectPreview.maxInstances")}),a.jsx("input",{id:"runtime-max-instance",type:"number",min:"1",step:"1",inputMode:"numeric",value:gr,disabled:vt||ye,"aria-invalid":!br.valid,onChange:Re=>bo(Re.currentTarget.value)})]})]}),(be||ye)&&a.jsx("p",{className:"pp-instance-note",role:"note",children:H(ye?"projectPreview.sidecarSingleInstance":"projectPreview.inMemorySingleInstance")}),!br.valid&&a.jsx("p",{className:"pp-instance-error",role:"alert",children:br.error})]}),a.jsxs("section",{className:"pp-config-section",children:[a.jsx("div",{className:"pp-config-label",children:H("projectPreview.network")}),W&&ml(!0),ie&&a.jsx("p",{className:"pp-config-note",children:H("projectPreview.networkPreserved")}),a.jsxs("div",{className:"pp-network-layout",children:[a.jsx("div",{className:"pp-network-modes",role:"radiogroup","aria-label":H("projectPreview.networkMode"),children:["public","private","both"].map(Re=>a.jsxs("label",{className:"pp-network-option",children:[a.jsx("input",{type:"radio",name:"deployment-network-mode",value:Re,checked:Ll===Re,onChange:()=>Uu(Re),disabled:vt||ie||!M}),a.jsx("span",{children:Re==="public"?H("projectPreview.networkModes.public"):Re==="private"?"VPC":H("projectPreview.networkModes.both")})]},Re))}),Ll!=="public"&&a.jsxs("div",{className:"pp-network-fields",children:[a.jsxs("label",{children:[a.jsx("span",{children:"VPC ID"}),a.jsx("input",{value:(F==null?void 0:F.vpcId)??"",placeholder:"vpc-xxxxxxxx",disabled:vt||ie,onChange:Re=>vl({vpcId:Re.target.value})})]}),a.jsxs("label",{children:[a.jsxs("span",{children:[H("projectPreview.subnetId")," ",a.jsx("small",{children:H("projectPreview.subnetHint")})]}),a.jsx("input",{value:(F==null?void 0:F.subnetIds)??"",placeholder:"subnet-xxx, subnet-yyy",disabled:vt||ie,onChange:Re=>vl({subnetIds:Re.target.value})})]}),a.jsxs("label",{className:"pp-network-check",children:[a.jsx("input",{type:"checkbox",checked:!!(F!=null&&F.enableSharedInternetAccess),disabled:vt||ie,onChange:Re=>vl({enableSharedInternetAccess:Re.target.checked})}),H("projectPreview.sharedInternetAccess")]})]})]})]}),no&&a.jsxs("section",{className:"pp-config-section",children:[a.jsx("div",{className:"pp-config-label",children:H("projectPreview.evaluationSets")}),a.jsxs("label",{className:"pp-evaluation-set-option",children:[a.jsx("input",{type:"checkbox",checked:to,disabled:vt,onChange:Re=>fl(Re.currentTarget.checked)}),a.jsxs("span",{children:[a.jsx("strong",{children:H("projectPreview.createEvaluationSets")}),a.jsx("small",{children:H("projectPreview.createEvaluationSetsHint")})]})]})]}),!ie&&a.jsxs("section",{className:"pp-config-section pp-resource-section",children:[a.jsx("div",{className:"pp-config-label",children:H("projectPreview.resourceConfiguration")}),a.jsx(E9e,{value:rt,agentName:r||e.name||"agentkit-app",runtimeName:Pe,region:q,disabled:vt,validationError:Ue,onChange:Re=>{zt(Re),bt(null)}})]}),a.jsxs("section",{className:"pp-config-section pp-env-section",children:[a.jsx("div",{className:"pp-env-head",children:a.jsxs("div",{children:[a.jsxs("div",{className:"pp-config-label",children:[H("projectPreview.environmentVariables"),a.jsx("span",{className:"pp-agent-child-count pp-env-count",children:H("projectPreview.itemCount",{count:Bo})})]}),a.jsx("div",{className:"pp-env-sub",children:H("projectPreview.environmentVariablesHint")})]})}),a.jsxs("button",{type:"button",className:"pp-env-add",onClick:La,disabled:vt,children:[a.jsx(sc,{className:"pp-ic"}),H("projectPreview.addVariable")]}),(gl.length>0||N.length>0||Me.length>0)&&a.jsxs("div",{className:"pp-env-table",children:[gl.length>0&&a.jsxs("div",{className:"pp-env-group",children:[a.jsxs("div",{className:"pp-env-group-head",children:[a.jsx("span",{children:H("projectPreview.componentGenerated")}),a.jsx("small",{children:H("projectPreview.itemCount",{count:gl.length})})]}),gl.map(Re=>{const ot=Re.readOnly||Re.key.startsWith("ENABLE_"),$t=Re.serverManaged&&Re.key==="MODEL_AGENT_API_KEY",Dn=$t?bl?Ma.value:H("projectPreview.injectedByApiKey"):Re.value,On=IK(Re,D),mn=Qn[Re.key],jn=`deployment-env-${Re.key.toLowerCase()}-error`,Wt=ece(Re)||Re.help||Re.comment,bn=Re.multiline||Re.format==="json";return a.jsxs("div",{className:`pp-env-row pp-env-row-derived${bn?" is-multiline":""}`,children:[a.jsxs("div",{className:"pp-env-key-fixed pp-env-key-cell","aria-label":H("projectPreview.envNameAriaLabel",{key:Re.key}),"aria-disabled":vt,children:[a.jsx("span",{title:Re.key,children:Re.key}),Wt&&a.jsxs("span",{className:"pp-env-help",tabIndex:0,"data-help":Wt,"aria-label":H("projectPreview.envDescriptionAriaLabel",{key:Re.key,description:Wt}),children:["?",a.jsx("span",{className:"pp-env-help-popover",role:"tooltip",children:Wt})]}),Re.link&&a.jsx("a",{className:"pp-env-link",href:Re.link.url,target:"_blank",rel:"noopener noreferrer",title:H("projectPreview.openOpenViking",{label:Re.link.label}),"aria-label":H("projectPreview.openOpenVikingAriaLabel",{key:Re.key,label:Re.link.label}),children:a.jsx(d0,{"aria-hidden":"true"})})]}),a.jsxs("div",{className:"pp-env-value-wrap",children:[bn?a.jsx("textarea",{ref:Mn=>{Mn?ui.current.set(Re.key,Mn):ui.current.delete(Re.key)},className:"pp-env-value pp-env-json-value",value:Re.value,placeholder:Re.placeholder||(Re.required?H("projectPreview.requiredEmpty"):H("projectPreview.optionalEmpty")),readOnly:ot,disabled:vt||!ot&&!_,autoComplete:"off",spellCheck:!1,"aria-invalid":!!(mn||On),"aria-describedby":mn?jn:void 0,"aria-label":H("projectPreview.envValueAriaLabel",{key:Re.key}),onChange:Mn=>{const ai=Mn.currentTarget.value;_==null||_(Re.key,ai),mn&&ai.trim()&&(Qo(Re.key),nt(null))}}):a.jsxs("div",{className:$t?"pp-env-secret-control":void 0,children:[a.jsx("input",{ref:Mn=>{Mn?ui.current.set(Re.key,Mn):ui.current.delete(Re.key)},className:"pp-env-value",type:$t?"text":Re.secret?"password":"text",value:Dn,placeholder:Re.placeholder||(Re.required?H("projectPreview.requiredEmpty"):H("projectPreview.optionalEmpty")),readOnly:ot,disabled:vt||!ot&&!_,autoComplete:Re.secret?"new-password":"off",spellCheck:Re.secret?!1:void 0,"aria-invalid":!!(mn||On),"aria-describedby":mn?jn:void 0,"aria-label":H("projectPreview.envValueAriaLabel",{key:Re.key}),onChange:Mn=>{const ai=Mn.currentTarget.value;_==null||_(Re.key,ai),mn&&ai.trim()&&(Qo(Re.key),nt(null))}}),$t&&a.jsx("button",{type:"button",className:"pp-env-secret-toggle","aria-label":Bu,title:Bu,"aria-pressed":bl,disabled:Ma.status==="loading"||!Xe,onClick:()=>{bl?Vr():hs()},children:Ma.status==="loading"?a.jsx(Bi,{className:"pp-env-secret-spinner","aria-hidden":"true"}):bl?a.jsx(Rsn,{}):a.jsx(Nsn,{})})]}),mn&&a.jsx("span",{id:jn,className:"pp-env-error",role:"alert",children:mn}),On&&a.jsx("span",{className:"pp-env-error",children:On}),$t&&Ma.status==="error"&&a.jsx("span",{className:"pp-env-reveal-error",role:"alert",children:Ma.error})]}),a.jsx("span",{className:"pp-env-source",children:H(ot?"projectPreview.automatic":"projectPreview.synced")})]},Re.key)})]}),N.length>0&&a.jsxs("div",{className:"pp-env-group",children:[a.jsxs("div",{className:"pp-env-group-head",children:[a.jsx("span",{children:H("projectPreview.customModelCredentials")}),a.jsx("small",{children:H("projectPreview.itemCount",{count:N.length})})]}),N.map(Re=>{const ot=Fn===Re.key,$t=`${Re.key.toLowerCase()}-error`,Dn=ei[Re.key]??"",On=ee.has(Re.key);return a.jsxs("div",{className:"pp-env-row pp-env-row-derived",children:[a.jsx("label",{className:"pp-env-key-fixed pp-env-key-cell",htmlFor:Re.key,title:Re.label,children:a.jsx("span",{children:Re.key})}),a.jsxs("div",{className:"pp-env-value-wrap",children:[a.jsx("input",{id:Re.key,className:"pp-env-value",type:"password",value:Dn,placeholder:On&&!Dn?"••••••":H("projectPreview.releaseOnlySecret"),disabled:vt,autoComplete:"new-password",spellCheck:!1,"aria-invalid":ot,"aria-describedby":ot?$t:void 0,"aria-label":Re.label,onChange:mn=>{const jn=mn.currentTarget.value;I?I(Re.key,jn):Pn(Wt=>({...Wt,[Re.key]:jn})),ot&&jn.trim()&&(Si(null),nt(null))}}),ot&&a.jsx("span",{id:$t,className:"pp-env-error",role:"alert",children:H("projectPreview.errors.modelApiKeyRequired")})]}),a.jsx("span",{className:"pp-env-source",children:On&&!Dn.trim()?H("projectPreview.synced"):H("projectPreview.thisRelease")})]},Re.key)})]}),Me.length>0&&a.jsxs("div",{className:"pp-env-group-head pp-env-group-head-custom",children:[a.jsx("span",{children:H("projectPreview.customVariables")}),a.jsx("small",{children:H("projectPreview.itemCount",{count:Me.length})})]}),Me.map(Re=>a.jsxs("div",{className:"pp-env-row",children:[a.jsx("input",{value:Re.key,placeholder:H("common.name"),disabled:vt,autoComplete:"off",onChange:ot=>yl(Re.id,{key:ot.currentTarget.value})}),a.jsx("input",{type:"text",value:Re.value,placeholder:H("projectPreview.value"),disabled:vt,autoComplete:"off",onChange:ot=>yl(Re.id,{value:ot.currentTarget.value})}),a.jsx("button",{type:"button",className:"pp-icon-btn pp-env-remove",title:H("projectPreview.deleteVariable"),disabled:vt,onClick:()=>$l(Re.id),children:a.jsx(Mo,{className:"pp-ic"})})]},Re.id))]})]}),(vt||et||Object.keys(Ge).length>0)&&a.jsxs("section",{className:"pp-config-section pp-progress-section",children:[a.jsx("div",{className:"pp-config-label",children:H("projectPreview.deploymentProgress")}),a.jsx("ol",{className:"pp-steps",children:Ms.map((Re,ot)=>{const $t=yt?Ms.findIndex(jn=>jn.phase===yt):-1,Dn=!!He&&($t===-1?ot===0:ot===$t),On=Ge[Re.phase];let mn;return et||(On==null?void 0:On.level)==="success"?mn="done":Dn?mn="failed":$t===-1?mn=vt?"active":"pending":ot<$t?mn="done":ot===$t?mn=He?"failed":"active":mn="pending",a.jsxs("li",{className:`pp-step is-${mn}`,children:[a.jsx("span",{className:"pp-step-dot",children:mn==="active"?a.jsx(Bi,{className:"pp-ic spin"}):mn==="done"?"✓":mn==="failed"?"✕":ot+1}),a.jsxs("span",{className:"pp-step-body",children:[a.jsx("span",{className:"pp-step-label",children:Re.label}),mn==="active"&&(On==null?void 0:On.message)&&a.jsxs("span",{className:"pp-step-msg",children:[pL(On),typeof On.pct=="number"?` (${On.pct}%)`:""]})]})]},Re.phase)})})]}),He&&a.jsx(wb,{className:"pp-error",message:yt?H("projectPreview.errors.failedAtStage",{action:H(ie?"projectPreview.update":"projectPreview.deploy"),stage:((io=Ms.find(Re=>Re.phase===yt))==null?void 0:io.label)??yt,message:He}):He,onRetry:sn,retryLabel:H(ie?"projectPreview.retryUpdate":"projectPreview.retryDeploy")}),mt&&a.jsxs("div",{className:"pp-status-unconfirmed",role:"status",children:[a.jsx("strong",{children:H("projectPreview.task.deploymentStatusUnconfirmed")}),a.jsx("span",{children:H("projectPreview.errors.deploymentStatusUnconfirmed")})]}),et&&a.jsxs("section",{className:"pp-deploy-result",children:[a.jsx("div",{className:"pp-deploy-result-header",children:H(ie?"projectPreview.updateSucceeded":"projectPreview.deploySucceeded")}),a.jsxs("div",{className:"pp-deploy-result-body",children:[et.warnings&&et.warnings.length>0&&a.jsx("div",{className:"pp-deploy-result-warning",role:"status",children:et.warnings.map(Re=>a.jsx("span",{children:Re},Re))}),et.region&&a.jsxs("div",{className:"pp-deploy-result-field",children:[a.jsx("label",{children:H("projectPreview.region")}),a.jsx("code",{children:xh(et.region,z)})]}),a.jsxs("div",{className:"pp-deploy-result-field",children:[a.jsx("label",{children:H("projectPreview.agentName")}),a.jsx("code",{children:et.agentName})]}),a.jsxs("div",{className:"pp-deploy-result-field",children:[a.jsx("label",{children:H("projectPreview.runtimeName")}),a.jsx("code",{children:et.runtimeName})]}),a.jsxs("div",{className:"pp-deploy-result-field",children:[a.jsx("label",{children:H("projectPreview.apiEndpoint")}),a.jsx("code",{className:"pp-deploy-result-url",children:et.url})]})]}),a.jsxs("div",{className:"pp-deploy-result-actions",children:[a.jsxs("button",{type:"button",className:"pp-deploy-result-btn",onClick:is,disabled:Qt,children:[Qt?a.jsx(Bi,{className:"pp-ic spin"}):a.jsx(Bje,{className:"pp-ic"}),H(Qt?"projectPreview.connecting":"projectPreview.chatNow")]}),et.consoleUrl&&a.jsxs("a",{href:et.consoleUrl,target:"_blank",rel:"noopener noreferrer",className:"pp-console-link pp-console-link-btn",children:[a.jsx(d0,{className:"pp-ic"}),H("projectPreview.console")]})]})]})]}),a.jsx("div",{className:`pp-config-actions${Ks?" is-external":""}`,children:Ks?vi.createPortal(a.jsx("button",{type:"button",className:"pp-deploy studio-update-action",onClick:sn,disabled:vt||mt||ae||We||G||!!n||!!qe,title:n||qe||void 0,children:vt?H("projectPreview.actionInProgress",{action:se}):mt?H("projectPreview.task.deploymentStatusUnconfirmed"):ae?H("projectPreview.checkingName"):He?H("projectPreview.retryAction",{action:se}):se}),Ks):a.jsx("button",{type:"button",className:"pp-deploy studio-update-action",onClick:sn,disabled:vt||mt||ae||We||G||!!n||!!qe,title:n||qe||void 0,children:vt?H("projectPreview.actionInProgress",{action:se}):mt?H("projectPreview.task.deploymentStatusUnconfirmed"):ae?H("projectPreview.checkingName"):He?H("projectPreview.retryAction",{action:se}):se})})]})]}),Yt&&i&&vi.createPortal(a.jsx("div",{className:"pp-flow-backdrop",onMouseDown:Re=>{Re.target===Re.currentTarget&&wn(!1)},children:a.jsxs("section",{className:"pp-flow-dialog",role:"dialog","aria-modal":"true","aria-label":H("projectPreview.flowPreview"),children:[a.jsxs("header",{children:[a.jsxs("div",{children:[a.jsx("strong",{children:H("projectPreview.executionFlow")}),a.jsx("span",{children:H("projectPreview.flowPreviewHint")})]}),a.jsx("button",{type:"button",onClick:()=>wn(!1),"aria-label":H("projectPreview.closeFlowPreview"),children:a.jsx(Mo,{"aria-hidden":!0})})]}),a.jsx("div",{className:"pp-flow-dialog-canvas",children:a.jsx(RP,{draft:i,direction:"horizontal",selectedPath:[],onSelect:Qm,onAdd:Qm,onInsert:Qm,onDelete:Qm,readOnly:!0,interactivePreview:!0})})]})}),document.body),a.jsx(Isn,{open:wt,isUpdate:ie,...h,onCancel:Ss,onConfirm:()=>void Bl()})]})}const Wsn=new Set(["MODEL_AGENT_API_KEY"]),Ksn=new Set(["MODEL_AGENT_NAME","MODEL_NAME"]),Gsn=new Set(["VOLCENGINE_ACCESS_KEY","VOLCENGINE_SECRET_KEY","VOLCENGINE_SESSION_TOKEN","BYTEPLUS_ACCESS_KEY","BYTEPLUS_SECRET_KEY","BYTEPLUS_SESSION_TOKEN","VEADK_DISABLE_EXPIRE_AT"]);function e0(e){return!Gsn.has(e)}function dA(e){return Wsn.has(e)||/(?:API_KEY|ACCESS_KEY|SECRET_KEY|PRIVATE_KEY|TOKEN|SECRET|PASSWORD|PASSWD|PWD|CREDENTIAL)$/.test(e)}function Xsn(e,t){const n={},i=new Set([...e.environment.required,...e.environment.optional]);for(const r of i){if(!e0(r)||dA(r))continue;const s=r==="MODEL_AGENT_API_BASE"?Do(t):Ksn.has(r)?Xp(t):e.environment.defaults[r];s!=null&&s.trim()&&(n[r]=s)}return n}function Ysn({delivery:e,onBack:t,onAgentAdded:n,onDeploymentTaskChange:i,onDeploymentStarted:r,onDeploymentComplete:s,cloudProvider:o="volcengine",initialDeployRegion:l}){const{t:c}=Te("create"),[u,d]=p.useState(l??Zi(o)),[f,h]=p.useState(),[m,g]=p.useState(null),[b,v]=p.useState(!1),[y,w]=p.useState(()=>({name:mK(e.agentName),files:e.files??[]})),x=e.environment??{required:[],optional:[],defaults:{}},[O,k]=p.useState(()=>({...x.defaults})),S=x.required.filter(e0).filter(dA).map(R=>({key:R,label:R})),C=[...x.required.filter(e0).filter(R=>!dA(R)).map(R=>({key:R,required:!0,comment:R,placeholder:c("intelligentDeployment.env.requiredPlaceholder",{key:R})})),...x.optional.filter(e0).map(R=>({key:R,required:!1,comment:R,placeholder:c("intelligentDeployment.env.optionalPlaceholder",{key:R})}))],E=rv(y.name,R=>c(`validation.runtimeName.${R}`));p.useEffect(()=>{if(E){g(null);return}const R=new AbortController,A=window.setTimeout(()=>{v(!0),jD(y.name,u).then(N=>{R.signal.aborted||g(N.available===!0)}).catch(()=>{R.signal.aborted||g(null)}).finally(()=>{R.signal.aborted||v(!1)})},250);return()=>{window.clearTimeout(A),R.abort()}},[u,y.name,E]);const j={kind:"intelligentDevelopment",sessionId:e.sessionId,...e.projectId&&e.versionId?{projectId:e.projectId,versionId:e.versionId}:{},artifactSha256:e.artifactSha256,validationReportSha256:e.validationReportSha256,...e.verified?{}:{acknowledgeUnverified:!0}};async function T(R,A,N){const P=f&&f.mode!=="public"?{mode:f.mode,vpc_id:f.vpcId,subnet_ids:f.subnetIds,enable_shared_internet_access:f.enableSharedInternetAccess}:void 0;return $0(R.name,[],{region:u,projectName:"default",network:P},{...N,onStage:A,runtimeName:R.name,source:j})}return a.jsx(qT,{cloudProvider:o,project:y,agentName:y.name,onDeploy:T,onAgentAdded:n,onDeploymentTaskChange:i,onDeploymentStarted:r,onDeploymentComplete:s,network:f,onNetworkChange:h,deployRegion:u,onDeployRegionChange:d,deploymentEnv:C,requiredSecretEnv:S,deploymentEnvValues:O,onDeploymentEnvChange:(R,A)=>k(N=>({...N,[R]:A})),deploymentActionLabel:c("common.deploy"),deployDisabled:!!E||m===!1||b,deployDisabledReason:E??(m===!1?c("intelligentDeployment.runtimeNameExists"):b?c("intelligentDeployment.checkingRuntimeName"):void 0),deploymentTelemetry:{source:"intelligent_development",createMode:"intelligent",aiAssisted:!0},onBack:t,backLabel:c("intelligentDeployment.back"),deploymentPrimaryPane:a.jsxs("section",{className:"trusted-source-pane","aria-label":e.verified?c("intelligentDeployment.verifiedSource"):c("intelligentDeployment.deployableSource"),children:[a.jsx("div",{className:"trusted-source-pane__badge",children:e.verified?c("intelligentDeployment.verifiedByCodex"):c("intelligentDeployment.deployableSource")}),a.jsx("h2",{children:e.agentName}),a.jsxs("label",{className:"trusted-source-pane__runtime-name",children:[a.jsx("span",{children:c("intelligentDeployment.runtimeName")}),a.jsx("input",{value:y.name,maxLength:64,onChange:R=>w(A=>({...A,name:R.target.value}))})]}),a.jsxs("dl",{children:[a.jsxs("div",{children:[a.jsx("dt",{children:c("intelligentDeployment.entryPoint")}),a.jsx("dd",{children:a.jsx("code",{children:e.entryPoint})})]}),a.jsxs("div",{children:[a.jsx("dt",{children:c("intelligentDeployment.files")}),a.jsx("dd",{children:e.fileCount})]}),a.jsxs("div",{children:[a.jsx("dt",{children:c("intelligentDeployment.artifact")}),a.jsx("dd",{children:a.jsx("code",{children:e.artifactSha256.slice(0,16)})})]}),a.jsxs("div",{children:[a.jsx("dt",{children:c("intelligentDeployment.validationReport")}),a.jsx("dd",{children:a.jsx("code",{children:e.validationReportSha256.slice(0,16)})})]})]}),a.jsx("p",{children:e.verified?c("intelligentDeployment.verifiedHint"):c("intelligentDeployment.unverifiedHint")})]})})}const Zsn="_Container_1tuad_1",Jsn="_Checkbox_1tuad_22",ean="_CheckMark_1tuad_92",tan="_Label_1tuad_162",Tj={Container:Zsn,Checkbox:Jsn,CheckMark:ean,Label:tan},DK=({className:e,label:t,id:n,disabled:i,orientation:r="left",...s})=>{const o=p.useId(),l=n??o;return a.jsxs("div",{"data-disabled":i?"":void 0,"data-has-label":t?"":void 0,"data-orientation":r,className:Qi(e,Tj.Container),children:[a.jsx(Mct,{className:Tj.Checkbox,id:l,disabled:i,...s,children:a.jsx($ct,{className:Tj.CheckMark})}),t&&a.jsx("label",{htmlFor:l,className:Tj.Label,onMouseDown:c=>{!c.defaultPrevented&&c.detail>1&&c.preventDefault()},children:t})]})},nan="_RadioGroup_onrfm_1",ian="_RadioLabel_onrfm_9",ran="_RadioIndicatorWrapper_onrfm_26",san="_RadioItem_onrfm_43",aan="_RadioIndicator_onrfm_26",kS={RadioGroup:nan,RadioLabel:ian,RadioIndicatorWrapper:ran,RadioItem:san,RadioIndicator:aan},D7e=p.createContext(null),oan=()=>{const e=p.use(D7e);if(!e)throw new Error("RadioGroup components must be wrapped in ");return e},Ly=({onChange:e,children:t,className:n,direction:i="row",disabled:r=!1,...s})=>{const o=p.useMemo(()=>({disabled:r,direction:i}),[r,i]);return a.jsx(D7e,{value:o,children:a.jsx(Zdt,{className:Qi(kS.RadioGroup,n),"data-direction":i,onValueChange:e,disabled:r,...s,children:t})})},lan=({value:e,disabled:t=!1,required:n,children:i,className:r,block:s=!1,...o})=>{const{disabled:l}=oan(),c=l||t,u=p.useId(),d=`${e}-${u}`;return a.jsx("div",{className:"flex",...o,children:a.jsxs("label",{htmlFor:d,className:Qi(kS.RadioLabel,r),"data-disabled":c?"":void 0,"data-block":s?"":void 0,onMouseDown:f=>{!f.defaultPrevented&&f.detail>1&&f.preventDefault()},children:[a.jsx("div",{className:kS.RadioIndicatorWrapper,children:a.jsx(nft,{id:d,value:e,disabled:c,required:n,className:kS.RadioItem,children:a.jsx(rft,{className:kS.RadioIndicator})})}),i]})})};Ly.Item=lan;function can({className:e,...t}){return a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[a.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"}),a.jsx("path",{d:"M12 6.5c.4 2.4 1 3 3.4 3.4-2.4.4-3 1-3.4 3.4-.4-2.4-1-3-3.4-3.4 2.4-.4 3-1 3.4-3.4Z"})]})}function Dk(e,t){return{id:e,get label(){return Xt(`traditional.agentTypes.${e}.fullLabel`)},get desc(){return Xt(`traditional.agentTypes.${e}.description`)},icon:t}}const Mk={llm:Dk("llm",can),sequential:Dk("sequential",$at),parallel:Dk("parallel",Xat),loop:Dk("loop",Qje),a2a:Dk("a2a",tM)},uan=[Mk.llm,Mk.sequential,Mk.parallel,Mk.loop,Mk.a2a],M7e=e=>e==="sequential"||e==="parallel"||e==="loop",BL=e=>e==="a2a";function Sg(e,t){const n=e.trim().toLocaleLowerCase();return n?t.some(i=>i==null?void 0:i.toLocaleLowerCase().includes(n)):!0}function L7e(e,t=[]){const n=new Set(e.flatMap(o=>[o.id,o.name])),i=[];for(const o of t){const l=o.modelId||o.name;n.has(o.name)||n.has(l)||(n.add(o.name),n.add(l),i.push({id:l,name:o.name,displayName:o.name,vendorName:"",activationState:"Unavailable",lifecycleStatus:o.state==="Shutdown"?"Shutdown":"Running",available:!1,apiKeyAllowed:!0,unavailableReason:o.state==="Available"?"Unknown":o.state}))}const r=e.findIndex(o=>o.apiKeyAllowed===!1),s=r<0?e.length:r;return[...e.slice(0,s),...i,...e.slice(s)]}function cU(e,t){const n=e.status==="Active"?"modelApiKey.enabled":e.status==="Restricted"?"modelApiKey.disabled":"modelApiKey.unknownStatus",i=e.allowAll===!0?"modelApiKey.allPermissions":e.allowAll===!1?"modelApiKey.customPermissions":"modelApiKey.unknownPermissions";return`${t(n)} · ${t(i)}`}function $7e(e,t,n){const i=s=>s.normalize("NFKC").toLocaleLowerCase(),r=i(`${t} ${n}`);return i(e).trim().split(/\s+/).every(s=>r.includes(s))}const F7e=new Set(["local","sqlite","mysql","postgresql"]),B7e=new Set(["local","opensearch","redis","viking","openviking","mem0"]),U7e=new Set(["opensearch","viking","context_search","openviking"]),Q7e=new Set(["apmplus","cozeloop","tls"]),z7e=new Set(["web_search","parallel_web_search","link_reader","web_scraper","image_generate","image_edit","video_generate","text_to_speech","run_code","vesearch"]),dan=new Set(["llm","sequential","parallel","loop","a2a"]),fan=new Set(["lark-cli","github-cli","pandoc"]),han=new Set(["default","ops"]);function Gn(e,t=""){return typeof e=="string"?e:t}function Tc(e){return e===!0}function pan(e){return typeof e=="string"&&han.has(e)?e:"default"}function Aw(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function man(e){return Array.from(new Set(Aw(e).filter(t=>fan.has(t))))}function gan(e){return!e||typeof e!="object"||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(t=>typeof t[1]=="string"))}function V7e(e){return Array.isArray(e)?e.map(t=>t&&typeof t=="object"?{name:Gn(t.name),description:Gn(t.description)}:null).filter(t=>!!t&&!!t.name.trim()):[]}function Tw(e,t,n){return typeof e=="string"&&t.has(e)?e:n}function H7e(e){return typeof e=="string"&&dan.has(e)?e:"llm"}function q7e(e){return e==="byteplus"?"byteplus":"volcengine"}function W7e(e){return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.floor(e):3}function K7e(e){const t=e&&typeof e=="object"?e:{};return{enabled:Tc(t.enabled),registrySpaceId:Gn(t.registrySpaceId),registryTopK:Gn(t.registryTopK),registryRegion:Gn(t.registryRegion),registryEndpoint:Gn(t.registryEndpoint)}}function ban(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t=e,n=t.componentOverrides&&typeof t.componentOverrides=="object"?t.componentOverrides:{},i=Object.fromEntries(X1.map(l=>[l,n[l]===!0])),r={enabled:Object.values(i).some(Boolean),profile:pan(t.profile),componentOverrides:i},s=Gn(t.catalogVersion).trim(),o=Gn(t.planHash).trim();return s&&(r.catalogVersion=s),o&&(r.planHash=o),uH(r)}function G7e(e,t="volcengine"){return Array.isArray(e)?e.map(n=>{const i=n&&typeof n=="object"?n:{},r=q7e(i.cloudProvider??t),s=i.memory&&typeof i.memory=="object"?i.memory:{},o=K7e(i.a2aRegistry),l=H7e(i.agentType),c=o.enabled&&l==="llm"?"a2a":l,u=C7e(i.modelName,i.modelFallbacks);return{...Od(r),cloudProvider:r,name:Gn(i.name),description:Gn(i.description),instruction:Gn(i.instruction),agentType:c,maxIterations:W7e(i.maxIterations),a2aUrl:Gn(i.a2aUrl),modelName:u.modelName,modelFallbacks:u.modelFallbacks,modelSource:i.modelSource==="custom"||i.modelSource==="ark"?i.modelSource:void 0,modelProvider:Gn(i.modelProvider),modelApiBase:Gn(i.modelApiBase),builtinTools:Aw(i.builtinTools).filter(d=>z7e.has(d)),customTools:V7e(i.customTools),memory:{shortTerm:Tc(s.shortTerm),longTerm:Tc(s.longTerm)},shortTermBackend:Tw(i.shortTermBackend,F7e,"local"),longTermBackend:Tw(i.longTermBackend,B7e,"local"),longTermMemoryIndex:Gn(i.longTermMemoryIndex),autoSaveSession:Tc(i.autoSaveSession),knowledgebase:Tc(i.knowledgebase),knowledgebaseBackend:Tw(i.knowledgebaseBackend,U7e,Mg),knowledgebaseIndex:Gn(i.knowledgebaseIndex),tracing:Tc(i.tracing),tracingExporters:Aw(i.tracingExporters).filter(d=>Q7e.has(d)),a2aRegistry:c==="a2a"?{...o,enabled:!0}:o,subAgents:G7e(i.subAgents,r),selectedSkills:X7e(i)}}):[]}function X7e(e){if(!Array.isArray(e.selectedSkills))return[];const t=[];for(const n of e.selectedSkills){const i=n&&typeof n=="object"?n:{},r=Gn(i.source),s=r==="local"||r==="skillspace"||r==="skillhub"||r==="runtime"?r:"skillhub",o=Gn(i.name)||Gn(i.slug)||Gn(i.skillName)||Gn(i.skillId)||"skill",l=Gn(i.folder)||o,c=Gn(i.description);if(s==="runtime"){if(l!==o)continue;t.push({source:s,folder:l,name:o,description:c});continue}if(s==="skillhub"){const f=Gn(i.slug);if(!f)continue;t.push({source:s,folder:l,name:o,description:c,slug:f,namespace:Gn(i.namespace)||"public"});continue}if(s==="local"){const h=(Array.isArray(i.localFiles)?i.localFiles:[]).map(m=>{const g=m&&typeof m=="object"?m:{},b=Gn(g.path),v=Gn(g.content);return b?{path:b,content:v}:null}).filter(m=>m!==null);if(h.length===0)continue;t.push({source:s,folder:l,name:o,description:c,localFiles:h});continue}const u=Gn(i.skillSpaceId),d=Gn(i.skillId);!u||!d||t.push({source:s,folder:l,name:o,description:c,skillSpaceId:u,skillSpaceName:Gn(i.skillSpaceName),skillId:d,version:Gn(i.version)})}return t}function yan(e){const t=e&&typeof e=="object"?e:{},n=t.memory&&typeof t.memory=="object"?t.memory:{},i=t.deployment&&typeof t.deployment=="object"?t.deployment:{},r=gan(i.envValues),s=t.cloudEnvironment&&typeof t.cloudEnvironment=="object"?t.cloudEnvironment:{},o=K7e(t.a2aRegistry),l=H7e(t.agentType),c=o.enabled&&l==="llm"?"a2a":l,u=q7e(t.cloudProvider),d=C7e(t.modelName,t.modelFallbacks),f=Array.isArray(t.mcpTools)?t.mcpTools.map(h=>{const m=h&&typeof h=="object"?h:{},g=m.transport==="stdio"?"stdio":"http";return{name:Gn(m.name),transport:g,url:Gn(m.url),authToken:Gn(m.authToken),authTokenEnv:Gn(m.authTokenEnv),credentialConfigured:m.credentialConfigured===!0,command:Gn(m.command),args:Aw(m.args)}}).filter(h=>h.transport==="http"?!!h.url:!!h.command):[];return{...Od(u),cloudProvider:u,name:Gn(t.name)||"my_agent",description:Gn(t.description),instruction:Gn(t.instruction)||"You are a helpful assistant.",dynamicAgentDelegation:Tc(t.dynamicAgentDelegation),agentType:c,maxIterations:W7e(t.maxIterations),a2aUrl:Gn(t.a2aUrl),modelName:d.modelName,modelFallbacks:d.modelFallbacks,modelSource:t.modelSource==="custom"||t.modelSource==="ark"?t.modelSource:void 0,modelProvider:Gn(t.modelProvider),modelApiBase:Gn(t.modelApiBase),builtinTools:Aw(t.builtinTools).filter(h=>z7e.has(h)),customTools:V7e(t.customTools),mcpTools:f,a2aRegistry:c==="a2a"?{...o,enabled:!0}:o,memory:{shortTerm:Tc(n.shortTerm),longTerm:Tc(n.longTerm)},shortTermBackend:Tw(t.shortTermBackend,F7e,"local"),longTermBackend:Tw(t.longTermBackend,B7e,"local"),longTermMemoryIndex:Gn(t.longTermMemoryIndex),autoSaveSession:Tc(t.autoSaveSession),knowledgebase:Tc(t.knowledgebase),knowledgebaseBackend:Tw(t.knowledgebaseBackend,U7e,Mg),knowledgebaseIndex:Gn(t.knowledgebaseIndex),tracing:Tc(t.tracing),tracingExporters:Aw(t.tracingExporters).filter(h=>Q7e.has(h)),deployment:{feishuEnabled:Tc(i.feishuEnabled),runtimeName:Gn(i.runtimeName),runtimeNameCustomized:Tc(i.runtimeNameCustomized)||!!Gn(i.runtimeName).trim(),modelApiKeyId:Gn(i.modelApiKeyId),modelApiKeyName:Gn(i.modelApiKeyName),...Object.keys(r).length>0?{envValues:r}:{}},cloudEnvironment:{environmentId:Gn(s.environmentId),environmentVersionId:Gn(s.environmentVersionId),cliTools:man(s.cliTools),...typeof s.dockerfile=="string"?{dockerfile:s.dockerfile}:{}},harnessSidecar:ban(t.harnessSidecar),subAgents:G7e(t.subAgents,u),selectedSkills:X7e(t)}}function Y7e(e,t=e.cloudProvider??"volcengine"){const n=e.cloudProvider??t,i=new Set(NIe(n).map(r=>r.id));return{...e,builtinTools:(e.builtinTools??[]).filter(r=>i.has(r)),tracing:!1,tracingExporters:[],memory:{shortTerm:!1,longTerm:!1},shortTermBackend:"local",longTermBackend:"local",longTermMemoryIndex:"",autoSaveSession:!1,knowledgebase:!1,knowledgebaseBackend:Mg,knowledgebaseIndex:"",subAgents:e.subAgents.map(r=>Y7e(r,n))}}const van=/^[A-Za-z_][A-Za-z0-9_]*$/,UL=/^\$\{([A-Za-z_][A-Za-z0-9_]*)\}$/;function cce(e,t){return e.trim().toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,"")||t}function xan(e,t){if(!t.has(e))return e;let n=2;for(;t.has(`${e}_${n}`);)n+=1;return`${e}_${n}`}function kO(e){var n,i,r;const t=(n=e.authTokenEnv)==null?void 0:n.trim();return t&&van.test(t)?t:((r=(i=e.authToken)==null?void 0:i.trim().match(UL))==null?void 0:r[1])??""}function $P(e,t){var n;for(const i of e.mcpTools??[])t(i);for(const i of e.subAgents)$P(i,t);for(const i of((n=e.workflow)==null?void 0:n.nodes)??[])$P(i.agent,t)}function Z7e(e){try{const t=(e??"").trim(),n=new URL(t);if(n.protocol!=="http:"&&n.protocol!=="https:"||n.username||n.password||n.search||n.hash)return null;const i=t.indexOf("://")+3,r=t.indexOf("/",i),s=(r>=0?t.slice(r):"").replace(/\/+$/,"");return`${n.protocol}//${n.host}${s}`}catch{return null}}function wan(e,t){let n=e.name.trim();if(!n){const i=Z7e(e.url),r=(i==null?void 0:i.split("/").filter(Boolean))??[];n=r[r.length-1]??""}return n=n.replace(/[^A-Za-z0-9_.-]+/g,"_").replace(/^[_.-]+|[_.-]+$/g,""),n||`mcp_${t+1}`}function J7e(e){const t=new Set,n=new Set;let i=null;const r=s=>{var o;(s.mcpTools??[]).forEach((l,c)=>{if(i||l.transport!=="http")return;const u=wan(l,c),d=Z7e(l.url);if(t.has(u)){i="duplicateName";return}if(d&&n.has(d)){i="duplicateUrl";return}t.add(u),d&&n.add(d)}),!i&&(s.subAgents.forEach(r),(o=s.workflow)==null||o.nodes.forEach(l=>r(l.agent)))};return r(e),i}function D6(e){const t=new Set;return $P(e,n=>{const i=kO(n);n.credentialConfigured&&i&&t.add(i)}),[...t]}function eUe(e){const t=new Set;return $P(e,n=>{const i=kO(n);i&&t.add(i)}),[...t]}function Oan(e,t){const n=new Set(eUe(t));return[...new Set(e)].filter(i=>!n.has(i))}function kan(e){if(e.authToken)return e.authToken;if(e.credentialConfigured)return"";const t=kO(e);return t?`\${${t}}`:""}function San(e,t){if(!t){const i={...e,credentialConfigured:!1};return delete i.authToken,delete i.authTokenEnv,delete i.credentialSourceUrl,delete i.credentialSourceAuthTokenEnv,i}const n=t.trim().match(UL);if(n){const i={...e,authTokenEnv:n[1],credentialConfigured:e.credentialConfigured&&kO(e)===n[1]};return delete i.authToken,i}return{...e,authToken:t,credentialConfigured:!1}}function Ean(e){if(!e.trim())return!1;try{return new URL(e).pathname.replace(/\/+$/,"")===""}catch{return!1}}function uce(e){return(e??"").trim().replace(/\/+$/,"")}function Can(e,t){return{...e,url:t}}function Aan(e,t){const n=new Map(t.map(r=>[[r.agentName.trim(),r.authTokenEnv.trim(),uce(r.url)].join("\0"),r.value])),i=r=>({...r,mcpTools:(r.mcpTools??[]).map(s=>{var c;const o=kO(s);if(!o)return s;const l=n.get([r.name.trim(),o,uce(s.url)].join("\0"));return l?{...s,authToken:l,credentialConfigured:!0,credentialSourceUrl:((c=s.url)==null?void 0:c.trim())??"",credentialSourceAuthTokenEnv:o}:s}),subAgents:r.subAgents.map(i),...r.workflow?{workflow:{...r.workflow,nodes:r.workflow.nodes.map(s=>({...s,agent:i(s.agent)}))}}:{}});return i(e)}function Tan(e){const t=SO(e),n={},i=o=>{var l,c;Object.assign(n,((l=o.deployment)==null?void 0:l.envValues)??{}),o.subAgents.forEach(i),(c=o.workflow)==null||c.nodes.forEach(u=>i(u.agent))};i(e),Object.assign(n,t.envValues);const r=[],s=o=>{var l,c,u;for(const d of o.mcpTools??[]){const f=((l=d.authTokenEnv)==null?void 0:l.trim())??"",h=f?(n[f]??"").trim():"";d.transport!=="http"||!h||r.push({agentName:o.name.trim(),name:d.name.trim(),url:((c=d.url)==null?void 0:c.trim())??"",value:h})}o.subAgents.forEach(s),(u=o.workflow)==null||u.nodes.forEach(d=>s(d.agent))};return s(t.draft),r}function _an(e){const t=[],n=i=>{var r,s,o;for(const l of i.mcpTools??[]){const c=((r=l.authToken)==null?void 0:r.trim())??"";l.transport!=="http"||!c||UL.test(c)||t.push({agentName:i.name.trim(),name:l.name.trim(),url:((s=l.url)==null?void 0:s.trim())??"",value:c})}i.subAgents.forEach(n),(o=i.workflow)==null||o.nodes.forEach(l=>n(l.agent))};return n(e),t}function SO(e){const t=new Set,n={},i=r=>{var u;const s=cce(r.name,"AGENT"),o=(u=r.mcpTools)==null?void 0:u.map((d,f)=>{var y,w;const h=((y=d.authToken)==null?void 0:y.trim())??"",m=((w=h.match(UL))==null?void 0:w[1])??"";let b=kO(d);if(!b&&h){const x=cce(d.name,`TOOL_${f+1}`);b=xan(`MCP_${s}_${x}_AUTH_TOKEN`,t)}b&&t.add(b),b&&h&&!m&&(n[b]=h);const v={...d};return delete v.authToken,delete v.credentialConfigured,delete v.credentialSourceUrl,delete v.credentialSourceAuthTokenEnv,b?v.authTokenEnv=b:delete v.authTokenEnv,v}),l=r.subAgents.map(i),c=r.workflow?{...r.workflow,nodes:r.workflow.nodes.map(d=>({...d,agent:i(d.agent)}))}:void 0;return{...r,subAgents:l,...o?{mcpTools:o}:{},...c?{workflow:c}:{}}};return{draft:i(e),envValues:n}}const jan={heading:"VeADK Agent 结构配置",importHint:"可在「创建 Agent」页通过「导入 YAML」重新载入。"};function tUe(e,t=!0){var s,o,l,c,u,d,f,h,m,g,b,v,y,w,x,O,k,S,C,E,j,T,R,A,N,P,I,D,_,L,F,M,z,q,U,J,V,Z,ne,W,G,H,se,Y;const n={agentType:e.agentType??"llm"};if(e.agentType==="a2a"){if((s=e.a2aRegistry)!=null&&s.enabled){const X=mM(e.cloudProvider??"volcengine"),ie={enabled:!0};(o=e.a2aRegistry.registrySpaceId)!=null&&o.trim()&&(ie.registrySpaceId=e.a2aRegistry.registrySpaceId.trim()),ie.registryTopK=((l=e.a2aRegistry.registryTopK)==null?void 0:l.trim())||X.topK,ie.registryRegion=((c=e.a2aRegistry.registryRegion)==null?void 0:c.trim())||X.region,ie.registryEndpoint=((u=e.a2aRegistry.registryEndpoint)==null?void 0:u.trim())||X.endpoint,n.a2aRegistry=ie}return n}n.name=e.name,n.description=e.description,n.instruction=e.instruction,e.agentType==="loop"&&(n.maxIterations=e.maxIterations??3);const i=((d=e.modelName)==null?void 0:d.trim())??"",r=Nu(i,e.modelFallbacks);if(i&&(n.modelName=i,r.length&&(n.modelFallbacks=r)),e.modelSource&&(n.modelSource=e.modelSource),e.modelSource!=="ark"&&((f=e.modelProvider)!=null&&f.trim()&&(n.modelProvider=e.modelProvider.trim()),(h=e.modelApiBase)!=null&&h.trim()&&(n.modelApiBase=e.modelApiBase.trim())),(m=e.builtinTools)!=null&&m.length&&(n.builtinTools=[...e.builtinTools]),(g=e.customTools)!=null&&g.length&&(n.customTools=e.customTools.map(X=>({name:X.name,description:X.description}))),(b=e.mcpTools)!=null&&b.length&&(n.mcpTools=e.mcpTools.map(X=>{var ee,be,ue,pe;const ie={name:X.name,transport:X.transport};return(ee=X.url)!=null&&ee.trim()&&(ie.url=X.url.trim()),(be=X.authTokenEnv)!=null&&be.trim()&&(ie.authTokenEnv=X.authTokenEnv.trim()),(ue=X.command)!=null&&ue.trim()&&(ie.command=X.command.trim()),(pe=X.args)!=null&&pe.length&&(ie.args=X.args),ie})),((v=e.memory)!=null&&v.shortTerm||(y=e.memory)!=null&&y.longTerm)&&(n.memory={shortTerm:!!e.memory.shortTerm,longTerm:!!e.memory.longTerm},e.memory.shortTerm&&(n.shortTermBackend=e.shortTermBackend||"local"),e.memory.longTerm&&(n.longTermBackend=e.longTermBackend||"local",(w=e.longTermMemoryIndex)!=null&&w.trim()&&(n.longTermMemoryIndex=e.longTermMemoryIndex.trim()),n.autoSaveSession=!!e.autoSaveSession)),e.knowledgebase&&(n.knowledgebase=!0,n.knowledgebaseBackend=e.knowledgebaseBackend||"viking",(x=e.knowledgebaseIndex)!=null&&x.trim()&&(n.knowledgebaseIndex=e.knowledgebaseIndex.trim())),e.tracing&&((O=e.tracingExporters)!=null&&O.length)&&(n.tracing=!0,n.tracingExporters=[...e.tracingExporters]),t&&((k=e.harnessSidecar)!=null&&k.enabled)&&(n.harnessSidecar={enabled:!0,profile:e.harnessSidecar.profile,componentOverrides:{...e.harnessSidecar.componentOverrides}}),((S=e.cloudEnvironment)!=null&&S.environmentId||(C=e.cloudEnvironment)!=null&&C.environmentVersionId||(j=(E=e.cloudEnvironment)==null?void 0:E.cliTools)!=null&&j.length||((T=e.cloudEnvironment)==null?void 0:T.dockerfile)!==void 0)&&(n.cloudEnvironment={environmentId:e.cloudEnvironment.environmentId,environmentVersionId:e.cloudEnvironment.environmentVersionId,...(R=e.cloudEnvironment.cliTools)!=null&&R.length?{cliTools:[...e.cloudEnvironment.cliTools]}:{},...e.cloudEnvironment.dockerfile!==void 0?{dockerfile:e.cloudEnvironment.dockerfile}:{}}),(A=e.deployment)!=null&&A.feishuEnabled||(P=(N=e.deployment)==null?void 0:N.runtimeName)!=null&&P.trim()||(I=e.deployment)!=null&&I.runtimeNameCustomized||(_=(D=e.deployment)==null?void 0:D.modelApiKeyId)!=null&&_.trim()||(F=(L=e.deployment)==null?void 0:L.modelApiKeyName)!=null&&F.trim()||Object.keys(((M=e.deployment)==null?void 0:M.envValues)??{}).length>0){const X={feishuEnabled:!!((z=e.deployment)!=null&&z.feishuEnabled)};(U=(q=e.deployment)==null?void 0:q.runtimeName)!=null&&U.trim()&&(X.runtimeName=e.deployment.runtimeName.trim()),(J=e.deployment)!=null&&J.runtimeNameCustomized&&(X.runtimeNameCustomized=!0),(Z=(V=e.deployment)==null?void 0:V.modelApiKeyId)!=null&&Z.trim()&&(X.modelApiKeyId=e.deployment.modelApiKeyId.trim()),(W=(ne=e.deployment)==null?void 0:ne.modelApiKeyName)!=null&&W.trim()&&(X.modelApiKeyName=e.deployment.modelApiKeyName.trim()),Object.keys(((G=e.deployment)==null?void 0:G.envValues)??{}).length>0&&(X.envValues={...(H=e.deployment)==null?void 0:H.envValues}),n.deployment=X}return(se=e.selectedSkills)!=null&&se.length&&(n.selectedSkills=e.selectedSkills.map(X=>{const ie={source:X.source,name:X.name,folder:X.folder};return X.description&&(ie.description=X.description),X.source==="skillhub"?(ie.slug=X.slug,ie.namespace=X.namespace??"public"):X.source==="local"?ie.localFiles=X.localFiles??[]:X.source==="skillspace"&&(ie.skillSpaceId=X.skillSpaceId,ie.skillSpaceName=X.skillSpaceName,ie.skillId=X.skillId,X.version&&(ie.version=X.version)),ie})),(Y=e.subAgents)!=null&&Y.length&&(n.subAgents=e.subAgents.map(X=>tUe(X,!1))),n}function Nan(e,t=jan){var s;const n=SO(e),i={...((s=n.draft.deployment)==null?void 0:s.envValues)??{},...n.envValues},r={...n.draft,deployment:{...n.draft.deployment??{feishuEnabled:!1},envValues:i}};return`# ${t.heading} # ${t.importHint} `+HM(tUe(r))}const Ran={missing_http_tool:"helpers.mcpGateway.missingHttpTool",missing_url:"helpers.mcpGateway.missingUrl"};function dce(e){return{ok:!1,reason:e,message:Xt(Ran[e])}}function Ian(e){try{const t=new URL(e);return t.protocol==="http:"||t.protocol==="https:"}catch{return!1}}function Pan(e){var o;const t=[],n=new Set,i=l=>{var c;n.has(l)||(n.add(l),t.push(l),l.subAgents.forEach(i),(c=l.workflow)==null||c.nodes.forEach(u=>i(u.agent)))};i(e);const r=t.flatMap(l=>(l.mcpTools??[]).filter(c=>c.transport==="http"));if(r.length===0)return dce("missing_http_tool");const s=[];for(const l of r){const c=((o=l.url)==null?void 0:o.trim())??"";if(!c||!Ian(c))return dce("missing_url");s.push(c)}return{ok:!0,urls:s}}function MK(e){const t=e==null?void 0:e.trim();if(!t)return!0;try{const n=new URL(t);return(n.protocol==="https:"||n.protocol==="http:")&&n.hostname.length>0&&n.username===""&&n.password===""}catch{return!1}}function Dan(e,t,n,i){return Jy(e)?e:{modelName:e.trim(),modelProvider:"",modelApiBase:"",modelApiKeyEnv:S7e(t,n,i)}}function FP({variant:e,primaryModelName:t,agentName:n,value:i,secretValues:r,configuredSecretEnvKeys:s,showMissingApiKeyErrors:o,embedded:l,onChange:c,onSecretChange:u,renderSameProviderField:d}){const{t:f}=Te("create"),h=p.useId(),m=i??[],g=new Set(s??[]),b=(t??"").trim(),v=l?"cw-model-picker-field":e==="workbench"?"new-agent-workbench__field":"cw-field",y=l?"cw-model-picker-label":e==="workbench"?"new-agent-workbench__model-field-label":"cw-label",w=e==="workbench"?"model-fallback-fields__input model-fallback-fields__input--workbench":"model-fallback-fields__input cw-input",x=e==="workbench"?"model-fallback-fields__add new-agent-workbench__secondary-button":"model-fallback-fields__add cw-btn cw-btn-soft",O=e==="workbench"?"model-fallback-fields__remove new-agent-workbench__secondary-button":"model-fallback-fields__remove cw-btn cw-btn-ghost",k=Nu(b,m),S=m.filter(T=>{var R,A;return typeof T=="string"?!!T.trim():Jy(T)&&!!(T.modelName.trim()||(R=T.modelProvider)!=null&&R.trim()||(A=T.modelApiBase)!=null&&A.trim())}).length,C=S>0&&k.length!==S,E=(T,R,A=!1)=>{const N=[...m];N[T]=R,c(A?Nu(b,N):N)},j=T=>{const R=m[T];Jy(R)&&R.modelApiKeyEnv&&(u==null||u(R.modelApiKeyEnv,"")),c(m.filter((A,N)=>N!==T))};return a.jsxs("div",{className:v,children:[a.jsx("span",{className:y,children:f(`${e}.model.fallbacks`)}),a.jsxs("div",{className:"model-fallback-fields",children:[m.length?a.jsx("div",{className:"model-fallback-fields__rows",children:m.map((T,R)=>{const A=Jy(T)?T:null,N=w7e(T),P=A?Zrn(n,R,m,A):jK(n,R),I=(r==null?void 0:r[P])??"",D=g.has(P),_=A!==null&&!I.trim()&&!D,L=`${h}-${R}-model`,F=A!==null&&!MK(A.modelApiBase);return a.jsxs("div",{className:`model-fallback-fields__item${A?" is-endpoint":""}`,children:[a.jsxs("div",{className:"model-fallback-fields__toolbar",children:[a.jsxs("div",{className:"model-fallback-fields__type",role:"radiogroup","aria-label":f(`${e}.model.fallbackType`),children:[a.jsx("button",{type:"button",role:"radio",className:A?"":"is-on","aria-checked":!A,onClick:()=>{A&&(A.modelApiKeyEnv&&(u==null||u(A.modelApiKeyEnv,"")),E(R,A.modelName))},children:f(`${e}.model.fallbackSameProvider`)}),a.jsx("button",{type:"button",role:"radio",className:A?"is-on":"","aria-checked":!!A,onClick:()=>{A||E(R,Dan(T,n,R,m))},children:f(`${e}.model.fallbackOtherProvider`)})]}),a.jsx("button",{type:"button",className:O,onClick:()=>j(R),children:f(`${e}.model.removeFallback`)})]}),a.jsxs("div",{className:"model-fallback-fields__model-name",children:[a.jsx("span",{className:"model-fallback-fields__field-label",children:f(`${e}.model.name`)}),A?a.jsx("input",{id:L,className:w,value:A.modelName,placeholder:f(`${e}.model.fallbackPlaceholder`),onChange:M=>E(R,{...A,modelName:M.currentTarget.value,modelApiKeyEnv:P})}):d?d({index:R,value:N,onChange:M=>E(R,M,!0)}):a.jsx("input",{id:L,className:w,value:N,placeholder:f(`${e}.model.fallbackPlaceholder`),onChange:M=>E(R,M.currentTarget.value)})]}),A?a.jsxs("div",{className:"model-fallback-fields__endpoint-details",children:[a.jsxs("label",{className:"model-fallback-fields__field",children:[a.jsx("span",{className:"model-fallback-fields__field-label",children:f(`${e}.model.provider`)}),a.jsx("input",{className:w,value:A.modelProvider??"",placeholder:"openai",onChange:M=>E(R,{...A,modelProvider:M.currentTarget.value,modelApiKeyEnv:P})})]}),a.jsxs("label",{className:"model-fallback-fields__field",children:[a.jsx("span",{className:"model-fallback-fields__field-label",children:"API Base"}),a.jsx("input",{className:w,type:"url",inputMode:"url",value:A.modelApiBase??"",placeholder:"https://api.example.com/v1","aria-invalid":F,onChange:M=>E(R,{...A,modelApiBase:M.currentTarget.value,modelApiKeyEnv:P})}),F?a.jsx("span",{className:"model-fallback-fields__error",children:f(`${e}.model.invalidApiBase`)}):null]}),a.jsxs("label",{className:"model-fallback-fields__field",children:[a.jsx("span",{className:"model-fallback-fields__field-label",children:"API Key"}),a.jsx("input",{className:w,type:"password",value:I,"aria-invalid":o&&_,placeholder:D&&!I?"••••••":f(`${e}.model.apiKeyPlaceholder`),autoComplete:"new-password",onChange:M=>{E(R,{...A,modelApiKeyEnv:P}),u==null||u(P,M.currentTarget.value)}}),o&&_?a.jsx("span",{className:"model-fallback-fields__error",role:"alert",children:f(`${e}.validation.apiKeyRequired`)}):null]})]}):null]},`fallback-row-${R}`)})}):null,a.jsx("div",{className:"model-fallback-fields__actions",children:a.jsx("button",{type:"button",className:x,onClick:()=>c([...m,""]),children:f(`${e}.model.addFallback`)})}),a.jsx("p",{className:"model-fallback-fields__help",children:f(`${e}.model.fallbackHelp`)}),C?a.jsx("p",{className:"model-fallback-fields__issue",children:f(`${e}.model.fallbackIgnored`)}):null]})]})}const uU="__default_environment__";function Man(e){return{value:uU,label:e("cloudEnvironment.defaultLabel"),description:e("cloudEnvironment.defaultDescription")}}function Lan(e){const t=e instanceof Error?e.message:String(e);return t.includes("HTTP 503")&&t.includes("管理员未配置持久化存储")}const $an={preparing:"cloudEnvironment.status.preparing",queued:"cloudEnvironment.status.queued",building:"cloudEnvironment.status.building",scanning:"cloudEnvironment.status.scanning",available:"cloudEnvironment.status.available",failed:"cloudEnvironment.status.failed"};function fce(e,t){return e.latestVersion?t($an[e.latestVersion.status]):t("cloudEnvironment.status.notBuilt")}function Fan(e){var t,n;return((t=e.latestVersion)==null?void 0:t.status)==="available"?"success":((n=e.latestVersion)==null?void 0:n.status)==="failed"?"danger":e.latestVersion?"warning":"secondary"}function nUe({value:e,onChange:t,disabled:n=!1,controlSize:i="lg",controlClassName:r,optionClassName:s}){var E,j;const{t:o}=Te("ui"),l=p.useId(),c=p.useRef(t),[u,d]=p.useState([]),[f,h]=p.useState(!0),[m,g]=p.useState(""),[b,v]=p.useState(!1),[y,w]=p.useState(0);p.useEffect(()=>{c.current=t},[t]),p.useEffect(()=>{const T=new AbortController;return h(!0),g(""),v(!1),DA(T.signal).then(R=>{T.signal.aborted||d(R)}).catch(R=>{!T.signal.aborted&&(R==null?void 0:R.name)!=="AbortError"&&(Lan(R)?(d([]),v(!0),c.current({environmentId:"",environmentVersionId:""})):g(R instanceof Error?R.message:String(R)))}).finally(()=>{T.signal.aborted||h(!1)}),()=>T.abort()},[y]);const x=p.useMemo(()=>[Man(o),...u.map(T=>{var R;return{value:T.id,label:T.name,description:`${RB(T.operatingSystem)} · ${Fp(T.language)} · ${fce(T,o)}`,disabled:((R=T.latestVersion)==null?void 0:R.status)!=="available",environment:T}})],[u,o]),O=u.find(T=>T.id===e.environmentId),k=((E=O==null?void 0:O.latestVersion)==null?void 0:E.versionId)===e.environmentVersionId?O.latestVersion:null,S=O?pH.flatMap(T=>T.options).filter(T=>O.optionIds.includes(T.id)).map(T=>T.label):[],C=T=>{var A;if(T.value===uU||!T.environment){t({environmentId:"",environmentVersionId:""});return}const R=((A=T.environment.latestVersion)==null?void 0:A.versionId)??"";t({environmentId:T.value,environmentVersionId:R})};return f&&u.length===0?a.jsx("div",{className:"cloud-env-state",role:"status",children:a.jsx(hn,{duration:1.25,children:o("cloudEnvironment.loading")})}):m&&u.length===0?a.jsxs("div",{className:"cloud-env-state cloud-env-state--error",role:"alert",children:[a.jsxs("div",{children:[a.jsx("strong",{children:o("cloudEnvironment.loadFailed")}),a.jsx("p",{children:m})]}),a.jsx(Tt,{color:"secondary",variant:"soft",size:"sm",onClick:()=>w(T=>T+1),children:o("common.retry")})]}):a.jsxs("section",{className:"cloud-env-config","aria-labelledby":`${l}-title`,children:[a.jsxs("label",{className:"cloud-env-field",id:`${l}-title`,htmlFor:l,children:[a.jsx("span",{children:o("cloudEnvironment.label")}),a.jsx(pa,{id:l,value:e.environmentId||uU,options:x,size:i,triggerClassName:r,optionClassName:s,pill:!1,disabled:n,placeholder:o("cloudEnvironment.placeholder"),searchPlaceholder:o("cloudEnvironment.search"),searchEmptyMessage:o("cloudEnvironment.noMatches"),onChange:C}),a.jsx("small",{children:o("cloudEnvironment.selectionHint")})]}),O?a.jsxs("div",{className:"cloud-env-summary","aria-live":"polite",children:[a.jsxs("div",{className:"cloud-env-summary__head",children:[a.jsxs("div",{children:[a.jsx("strong",{children:O.name}),O.description?a.jsx("p",{children:O.description}):null]}),a.jsx(Ya,{color:Fan(O),variant:"soft",size:"sm",children:fce(O,o)})]}),a.jsxs("dl",{className:"cloud-env-details",children:[a.jsxs("div",{children:[a.jsx("dt",{children:o("cloudEnvironment.operatingSystem")}),a.jsx("dd",{children:RB(O.operatingSystem)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("cloudEnvironment.language")}),a.jsx("dd",{children:Fp(O.language)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("cloudEnvironment.tools")}),a.jsx("dd",{children:S.length?S.join(o("environmentCenter.listSeparator")):o("cloudEnvironment.noExtraTools")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("cloudEnvironment.skills")}),a.jsx("dd",{children:(j=O.selectedSkills)!=null&&j.length?O.selectedSkills.map(T=>T.name).join(o("environmentCenter.listSeparator")):o("cloudEnvironment.noSkills")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("cloudEnvironment.imageVersion")}),a.jsx("dd",{children:(k==null?void 0:k.versionId)||e.environmentVersionId||o("cloudEnvironment.unavailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("cloudEnvironment.image")}),a.jsx("dd",{title:(k==null?void 0:k.image)||"",children:(k==null?void 0:k.image)||o("cloudEnvironment.versionMissing")})]})]}),k?null:a.jsx("p",{className:"cloud-env-version-warning",role:"alert",children:o("cloudEnvironment.versionChanged")})]}):e.environmentId?a.jsx("div",{className:"cloud-env-version-warning",role:"alert",children:o("cloudEnvironment.selectionUnavailable")}):a.jsx("p",{className:`cloud-env-guidance ${b?"cloud-env-guidance--fallback":""}`,children:b?o("cloudEnvironment.persistenceFallback"):u.length===0?o("cloudEnvironment.emptyFallback"):o("cloudEnvironment.defaultGuidance")})]})}const th="new-agent-workbench__select-option";function hce({label:e,metadata:t}){return a.jsx("span",{className:"new-agent-workbench__model-option-view",children:a.jsxs("span",{className:"new-agent-workbench__model-option-copy",children:[a.jsx("span",{className:"new-agent-workbench__model-option-label",children:e}),t?a.jsx("span",{className:"new-agent-workbench__model-option-metadata",children:t}):null]})})}function pce(e,t){var i,r;const n=t.trim().toLocaleLowerCase();return n?[e.label,e.metadata,(i=e.model)==null?void 0:i.name,(r=e.model)==null?void 0:r.vendorName].some(s=>s==null?void 0:s.toLocaleLowerCase().includes(n)):!0}const Ban=["local","sqlite","mysql","postgresql"];function mce(e){return Ban.includes(e)}function Uan(e){return e==="local"?"in-memory":"persistent"}const _j=[{id:"agent"},{id:"environment"},{id:"deployment"}];function Qan({cloudProvider:e,source:t,agentName:n,value:i,apiKeyId:r,apiKeyName:s,provider:o,apiBase:l,customApiKey:c,customModelSecretValues:u,customModelApiKeyConfigured:d,configuredRuntimeEnvKeys:f,fallbacks:h,showModelFallbacks:m=!0,showMissingApiKeyErrors:g,onSourceChange:b,onApiKeyChange:v,onModelNameChange:y,onModelFallbacksChange:w,onProviderChange:x,onApiBaseChange:O,onCustomApiKeyChange:k,onCustomModelSecretChange:S,onLoadingChange:C}){const{t:E}=Te("create"),[j,T]=p.useState([]),[R,A]=p.useState([]),[N,P]=p.useState(!0),[I,D]=p.useState(!1),[_,L]=p.useState(null),[F,M]=p.useState("");p.useEffect(()=>{const W=new AbortController;if(t==="ark")return P(!0),M(""),xz(W.signal).then(G=>{if(W.signal.aborted)return;T(G.keys);const H=G.keys.find(se=>se.id===r)??G.keys.find(se=>se.name===s)??G.keys.find(se=>se.id===G.defaultKeyId)??G.keys.find(se=>se.status!=="Restricted");H&&H.id!==r&&v(H)}).catch(G=>{W.signal.aborted||M(G instanceof Error?G.message:E("workbench.model.credentialsLoadError"))}).finally(()=>{W.signal.aborted||P(!1)}),()=>W.abort()},[r,s,e,v,t,E]),p.useEffect(()=>{if(t!=="ark"||!r){A([]),D(!1),L(null);return}const W=new AbortController;return D(!0),L(null),M(""),$1({apiKeyId:r,signal:W.signal}).then(G=>{if(W.signal.aborted)return;const H=L7e(G.models,G.apiKeyModelPermissions);A(H);const se=new Set(H.filter(X=>X.apiKeyAllowed===!1||X.unavailableReason).map(X=>X.id));se.has(i.trim())&&y("");const Y=h.filter(X=>typeof X!="string"||!se.has(X));Y.length!==h.length&&w(Y)}).catch(G=>{W.signal.aborted||M(G instanceof Error?G.message:E("workbench.model.modelsLoadError"))}).finally(()=>{W.signal.aborted||(D(!1),L(r))}),()=>W.abort()},[r,e,t,E]),p.useEffect(()=>{C(t==="ark"&&(N||!!r&&(I||_!==r)))},[r,_,N,I,C,t]);const z=[{value:"ark",label:e==="byteplus"?"BytePlus ModelArk":E("workbench.model.volcengineArk")},{value:"custom",label:E("workbench.model.custom")},{value:"gateway",label:E("workbench.model.gateway"),description:E("workbench.model.comingSoon"),disabled:!0}],q=j.map(W=>({value:W.id,label:W.name||E("modelApiKey.unnamed"),description:cU(W,E),disabled:W.status==="Restricted"}));r&&!q.some(W=>W.value===r)&&q.unshift({value:r,label:s||E("workbench.model.currentApiKey")});const U=p.useMemo(()=>{const W=R.map(G=>({value:G.id,label:G.displayName||G.name||G.id,metadata:[G.id,G.vendorName,G.apiKeyAllowed===!1?E("modelApiKey.noModelPermission"):G.unavailableReason?E(`modelApiKey.permissionState.${G.unavailableReason}`):G.available||G.lifecycleStatus==="Retiring"?E("modelApiKey.modelAvailable"):E("traditional.model.notActivated")].filter(Boolean).join(" · "),disabled:G.apiKeyAllowed===!1||!!G.unavailableReason||!(G.available||G.lifecycleStatus==="Retiring"),model:G}));return i&&!W.some(G=>G.value===i)&&W.unshift({value:i,label:i,metadata:i}),W},[R,i,E]),J=p.useMemo(()=>new Set(E7e(i,h).map(W=>W.trim())),[h,i]),V=W=>{const G=W.trim(),H=U.filter(se=>{const Y=se.value.trim(),X=Y!==G&&J.has(Y),ie=Y!==G&&Y===i.trim();return!X&&!ie});return G&&!H.some(se=>se.value===G)&&H.unshift({value:G,label:G,metadata:E("workbench.model.currentConfiguration")}),H},Z=(W,G)=>{const H=[...h];H[W]=G,w(Nu(i,H))},ne=!MK(l);return a.jsxs("div",{className:"new-agent-workbench__model-group",children:[a.jsx("span",{className:"new-agent-workbench__model-group-label",children:E("workbench.model.label")}),a.jsxs("div",{className:"new-agent-workbench__model-fields",children:[a.jsxs("label",{className:"new-agent-workbench__field new-agent-workbench__model-field",children:[a.jsx("span",{className:"new-agent-workbench__model-field-label",children:E("workbench.model.source")}),a.jsx(pa,{value:t,options:z,size:"xl",triggerClassName:"new-agent-workbench__select-trigger",optionClassName:th,pill:!1,onChange:W=>b(W.value)})]}),t==="ark"?a.jsxs(a.Fragment,{children:[a.jsxs("label",{className:"new-agent-workbench__field new-agent-workbench__model-field",children:[a.jsxs("span",{className:"new-agent-workbench__model-field-label",children:["API Key",a.jsx("span",{className:"new-agent-workbench__required",children:"*"})]}),a.jsx(pa,{value:r??"",options:q,loading:N,loadingPlaceholder:E("workbench.model.loadingApiKeys"),placeholder:E("workbench.model.selectApiKey"),searchPlaceholder:E("modelApiKey.search"),searchEmptyMessage:E("modelApiKey.noMatches"),searchPredicate:(W,G)=>$7e(G,W.label,typeof W.description=="string"?W.description:""),size:"xl",triggerClassName:"new-agent-workbench__select-trigger",optionClassName:th,pill:!1,onChange:W=>{const G=j.find(H=>H.id===W.value);G&&(C(!0),v(G))}})]}),a.jsxs("label",{className:"new-agent-workbench__field new-agent-workbench__model-field",children:[a.jsxs("span",{className:"new-agent-workbench__model-field-label",children:[E("workbench.model.label"),a.jsx("span",{className:"new-agent-workbench__required",children:"*"})]}),a.jsx(pa,{value:i,options:U,loading:I,loadingPlaceholder:E("workbench.model.loadingModels"),placeholder:E("workbench.model.selectModel"),searchPlaceholder:E("workbench.model.searchModels"),searchEmptyMessage:E("workbench.model.noModels"),size:"xl",triggerClassName:"new-agent-workbench__select-trigger",optionClassName:`${th} new-agent-workbench__model-option`,OptionView:hce,searchPredicate:pce,pill:!1,disabled:!r,onChange:W=>y(W.value)})]}),m?a.jsx(FP,{variant:"workbench",primaryModelName:i,agentName:n,value:h,secretValues:u,configuredSecretEnvKeys:f,showMissingApiKeyErrors:g,onChange:w,onSecretChange:S,renderSameProviderField:({index:W,value:G})=>a.jsx(pa,{value:G,options:V(G),loading:I,loadingPlaceholder:E("workbench.model.loadingModels"),placeholder:E("workbench.model.fallbackPlaceholder"),searchPlaceholder:E("workbench.model.searchModels"),searchEmptyMessage:E("workbench.model.noModels"),size:"xl",triggerClassName:"new-agent-workbench__select-trigger",optionClassName:`${th} new-agent-workbench__model-option`,OptionView:hce,searchPredicate:pce,pill:!1,disabled:!r||I,onChange:H=>Z(W,H.value)})}):null]}):a.jsxs(a.Fragment,{children:[a.jsxs("label",{className:"new-agent-workbench__field new-agent-workbench__model-field",children:[a.jsxs("span",{className:"new-agent-workbench__model-field-label",children:[E("workbench.model.name"),a.jsx("span",{className:"new-agent-workbench__required",children:"*"})]}),a.jsx(_s,{value:i,size:"xl",gutterSize:"md",pill:!1,onChange:W=>y(W.currentTarget.value)})]}),a.jsxs("label",{className:"new-agent-workbench__field new-agent-workbench__model-field",children:[a.jsx("span",{className:"new-agent-workbench__model-field-label",children:E("workbench.model.provider")}),a.jsx(_s,{value:o,placeholder:"openai",size:"xl",gutterSize:"md",pill:!1,onChange:W=>x(W.currentTarget.value)})]}),a.jsxs("label",{className:"new-agent-workbench__field new-agent-workbench__model-field",children:[a.jsx("span",{className:"new-agent-workbench__model-field-label",children:"API Base"}),a.jsx(_s,{type:"url",inputMode:"url",value:l,placeholder:Do(e),invalid:ne,size:"xl",gutterSize:"md",pill:!1,onChange:W=>O(W.currentTarget.value)}),ne?a.jsx("small",{className:"new-agent-workbench__error",children:E("workbench.model.invalidApiBase")}):null]}),a.jsxs("label",{className:"new-agent-workbench__field new-agent-workbench__model-field",children:[a.jsxs("span",{className:"new-agent-workbench__model-field-label",children:["API Key",a.jsx("span",{className:"new-agent-workbench__required",children:"*"})]}),a.jsx(_s,{type:"password",value:c,placeholder:d&&!c?"••••••":E("workbench.model.apiKeyPlaceholder"),autoComplete:"new-password",size:"xl",gutterSize:"md",pill:!1,onChange:W=>k(W.currentTarget.value)})]}),m?a.jsx(FP,{variant:"workbench",primaryModelName:i,agentName:n,value:h,secretValues:u,configuredSecretEnvKeys:f,showMissingApiKeyErrors:g,onChange:w,onSecretChange:S}):null]}),F?a.jsx("p",{className:"new-agent-workbench__error",role:"alert",children:F}):null]})]})}function zan({value:e,disabled:t,onChange:n}){const{t:i}=Te("create"),[r,s]=p.useState([]),[o,l]=p.useState(!0),[c,u]=p.useState(""),[d,f]=p.useState(0);p.useEffect(()=>{const g=new AbortController;return l(!0),u(""),ND(g.signal).then(b=>{g.signal.aborted||s(b)}).catch(b=>{!g.signal.aborted&&(b==null?void 0:b.name)!=="AbortError"&&(s([]),u(b instanceof Error?b.message:String(b)))}).finally(()=>{g.signal.aborted||l(!1)}),()=>g.abort()},[d]);const h=p.useMemo(()=>[...r].sort((g,b)=>Number(b.isCurrent)-Number(g.isCurrent)).map(g=>({value:g.uid,label:g.name.trim()||i("workbench.identity.unnamedPool"),description:g.isCurrent?i("workbench.identity.currentPool",{value:g.domain||g.uid}):g.domain||g.uid})),[r,i]),m=r.find(g=>g.uid===e);return a.jsxs("div",{className:"new-agent-workbench__field",children:[a.jsxs("span",{children:[i("workbench.identity.userPool"),a.jsx("span",{className:"new-agent-workbench__required",children:"*"})]}),a.jsx(pa,{value:e,options:h,loading:o,loadingPlaceholder:i("workbench.identity.loading"),placeholder:i("workbench.identity.placeholder"),searchPlaceholder:i("workbench.identity.search"),searchEmptyMessage:i("workbench.identity.empty"),size:"xl",pill:!1,disabled:t||!!c,triggerClassName:"new-agent-workbench__select-trigger",optionClassName:th,onChange:g=>n(g.value)}),c?a.jsxs("div",{className:"new-agent-workbench__inline-error",role:"alert",children:[a.jsx("span",{children:c}),a.jsx(Tt,{color:"secondary",variant:"ghost",size:"sm",pill:!1,onClick:()=>f(g=>g+1),children:i("common.retry")})]}):m!=null&&m.isCurrent?a.jsx("small",{className:"new-agent-workbench__helper-text",children:i("workbench.identity.currentHint")}):m?a.jsx("small",{className:"new-agent-workbench__error",children:i("workbench.identity.mismatchHint")}):a.jsx("small",{className:"new-agent-workbench__helper-text",children:i("workbench.identity.selectionHint")})]})}function gce({name:e,value:t,required:n=!1,placeholder:i,locked:r=!1,onRename:s,onValueChange:o,onRemove:l}){const{t:c}=Te("create"),[u,d]=p.useState(e);p.useEffect(()=>d(e),[e]);const f=()=>{const h=u.trim().toUpperCase();if(!h){d(e);return}d(h),h!==e&&s(e,h)};return a.jsxs("div",{className:`new-agent-workbench__env-row${r?" is-locked":""}`,role:"row",children:[a.jsx("div",{className:"new-agent-workbench__env-cell",role:"cell",children:a.jsx(_s,{"aria-label":c("workbench.environmentVariables.nameAriaLabel"),value:u,title:r?e:void 0,size:"xl",gutterSize:"md",pill:!1,disabled:r,onChange:h=>d(h.currentTarget.value),onBlur:f,onKeyDown:h=>{h.key==="Enter"&&h.currentTarget.blur()}})}),a.jsx("div",{className:"new-agent-workbench__env-cell",role:"cell",children:a.jsx(_s,{"aria-label":c("workbench.environmentVariables.valueAriaLabel",{name:e}),value:t,size:"xl",gutterSize:"md",pill:!1,type:/(SECRET|PASSWORD|KEY|TOKEN)$/.test(e)?"password":"text",placeholder:i,required:n,onChange:h=>o(h.currentTarget.value)})}),a.jsx("div",{className:"new-agent-workbench__env-action",role:"cell",children:r?n?a.jsx("span",{className:"new-agent-workbench__required","aria-label":c("common.required"),children:"*"}):null:a.jsx(Tt,{color:"secondary",variant:"ghost",size:"lg",uniform:!0,pill:!1,"aria-label":c("workbench.environmentVariables.deleteNamed",{name:e}),onClick:l,children:a.jsx(mat,{"aria-hidden":!0})})})]})}function Van({draft:e,cloudProvider:t,deployRegion:n,runtimeName:i,isRuntimeUpdate:r=!1,profileOnly:s=!1,deploying:o,deployStage:l,deployError:c,deploySucceeded:u,showErrors:d,onBack:f,onDraftPatch:h,onDeploymentPatch:m,onModelApiKeyChange:g,customModelApiKey:b,customModelSecretValues:v,customModelApiKeyConfigured:y,configuredRuntimeEnvKeys:w,showModelFallbacks:x=!0,onCustomModelApiKeyChange:O,onCustomModelSecretChange:k,onSelectedSkillsChange:S,onCloudEnvironmentChange:C,onDeployRegionChange:E,onRuntimeNameChange:j,onNetworkChange:T,onDeploy:R}){var Ct,It,Gt,Ge,xt,yt,nn,Qt,cn;const{t:A}=Te("create"),N=kD(),[P,I]=p.useState("agent"),[D,_]=p.useState(!1),L=p.useRef(null),[F,M]=p.useState(!1),[z,q]=p.useState(!1),[U,J]=p.useState(!0),[V,Z]=p.useState("api_key"),[ne,W]=p.useState(""),[G,H]=p.useState(()=>{const Me=e.shortTermBackend||"local";return e.memory.shortTerm&&mce(Me)?Me:"local"}),se=Uan(G),[Y,X]=p.useState("1"),[ie,ee]=p.useState(se==="in-memory"?"1":"5"),[be,ue]=p.useState(!1),[pe,ke]=p.useState(O9e),[je,Pe]=p.useState(""),[Ee,Qe]=p.useState(null),[_e,ae]=p.useState({top:!1,bottom:!1}),le=p.useRef(null),ge=_j.findIndex(Me=>Me.id===P),Oe={..._j[ge],label:A(`workbench.steps.${P}.label`),title:A(`workbench.steps.${P}.title`),description:A(`workbench.steps.${P}.description`)},Se=d||F,qe=Se||z,Xe=zT(e.name,Me=>A(`validation.agentName.${Me}`)),ye=Xe!==null,we=!e.description.trim(),Ae=!e.instruction.trim(),Ve=um(e,t),Be=!((Ct=e.modelName)!=null&&Ct.trim()),_t=p.useMemo(()=>T7e(e,Do(t),v,w),[t,w,v,e]),Pt=!s&&Ve==="ark"&&!((Gt=(It=e.deployment)==null?void 0:It.modelApiKeyId)!=null&&Gt.trim())||!!_t,Kt=Pt&&(Se||!U),Et=ye||we||Ae||Be||Pt,vt=((xt=(Ge=e.deployment)==null?void 0:Ge.network)==null?void 0:xt.mode)??"public",tt=(yt=e.deployment)==null?void 0:yt.network,mt=Tu(t),Ne=((nn=e.deployment)==null?void 0:nn.envValues)??{},wt=lw.find(Me=>Me.id===G)??lw[0],jt=((wt==null?void 0:wt.env)??[]).filter(Me=>!Me.hidden),Yt=new Set(jt.map(Me=>Me.key)),wn=Object.entries(Ne).filter(([Me])=>Me!=="FEISHU_APP_ID"&&Me!=="FEISHU_APP_SECRET"&&!Yt.has(Me)),We=(Me,on)=>{m({envValues:{...Ne,[Me]:on}})},kt=(Me,on)=>{const kn=Object.fromEntries(Object.entries(Ne).map(([Sn,zi])=>Sn===Me?[on,zi]:[Sn,zi]));m({envValues:kn})},He=Me=>{const on={...Ne};delete on[Me],m({envValues:on})},nt=()=>{let Me=wn.length+1,on=`CUSTOM_ENV_${Me}`;for(;on in Ne;)on=`CUSTOM_ENV_${++Me}`;We(on,"")};p.useEffect(()=>{const Me=le.current;if(!Me)return;const on=()=>{const un={top:Me.scrollTop>1,bottom:Me.scrollTop+Me.clientHeightor.top===un.top&&or.bottom===un.bottom?or:un)};Me.scrollTo({top:0,behavior:"auto"}),Me.addEventListener("scroll",on,{passive:!0});const kn=new ResizeObserver(on);kn.observe(Me);const Sn=new MutationObserver(on);Sn.observe(Me,{childList:!0,subtree:!0});const zi=window.requestAnimationFrame(on);return()=>{window.cancelAnimationFrame(zi),Me.removeEventListener("scroll",on),kn.disconnect(),Sn.disconnect()}},[P]),p.useEffect(()=>{X("1"),ee(se==="in-memory"?"1":"5")},[se]);const et=()=>{if(ge===0){if(D)return;if(N){f();return}L.current=f,_(!0);return}I(_j[ge-1].id)},ft=()=>{if(!D)return;const Me=L.current;L.current=null,Me==null||Me()},St=()=>{if(P==="agent"){if(M(!0),Et)return;if(s){R({authentication:{type:"api_key"},sessionStorage:se,sessionBackend:G,minInstance:Number(Y)||1,maxInstance:Number(ie)||1,createEvaluationSets:!1,resources:pe});return}I("environment");return}if(P==="environment"){I("deployment");return}const Me=Number(Y),on=Number(ie);if(!Y.trim()||!ie.trim()||!Number.isSafeInteger(Me)||Me<0||!Number.isSafeInteger(on)||on<1){Pe(A("workbench.validation.instanceIntegers"));return}if(Me>on){Pe(A("workbench.validation.instanceOrder"));return}if(V==="user_pool"&&!ne){Pe(A("workbench.validation.userPoolRequired"));return}const kn=S9e(pe);if(kn){Qe(kn),Pe(kn);return}Qe(null),Pe(""),R({authentication:V==="user_pool"?{type:"user_pool",userPoolUid:ne}:{type:"api_key"},sessionStorage:se,sessionBackend:G,minInstance:Me,maxInstance:on,createEvaluationSets:t==="byteplus"?!1:be,resources:pe})};return a.jsxs(Ar.div,{className:`new-agent-workbench${D?" is-leaving":""}`,initial:N?!1:{opacity:0},animate:{opacity:D?0:1},transition:{duration:D?.12:.18,ease:[.16,1,.3,1]},onAnimationComplete:ft,children:[a.jsx("main",{className:"new-agent-workbench__main","aria-label":A("workbench.ariaLabel"),children:a.jsxs("section",{className:"new-agent-workbench__form","aria-labelledby":"new-agent-workbench-title",children:[a.jsx(hf,{mode:"wait",initial:!1,children:a.jsxs(Ar.div,{className:"new-agent-workbench__heading",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16,ease:"easeOut"},children:[a.jsx("h1",{id:"new-agent-workbench-title",children:Oe.title}),a.jsx("p",{children:Oe.description})]},`heading-${P}`)}),a.jsxs("div",{className:"new-agent-workbench__panel-frame",children:[a.jsx("div",{ref:le,className:"new-agent-workbench__panel",children:a.jsxs(hf,{mode:"wait",initial:!1,children:[P==="agent"?a.jsxs(Ar.div,{className:"new-agent-workbench__fields",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16,ease:"easeOut"},children:[a.jsxs("label",{className:"new-agent-workbench__field","data-validation-field":"name",children:[a.jsxs("span",{className:"new-agent-workbench__field-heading",children:[a.jsxs("span",{children:[A("common.name"),a.jsx("span",{className:"new-agent-workbench__required",children:"*"})]}),a.jsxs("small",{children:[e.name.length,"/50"]})]}),a.jsx(_s,{value:e.name,maxLength:50,size:"xl",gutterSize:"md",pill:!1,invalid:qe&&ye,placeholder:A("workbench.agent.namePlaceholder"),"aria-describedby":qe&&Xe?"new-agent-workbench-name-error":void 0,onBlur:()=>q(!0),onChange:Me=>{q(!0),h({name:Me.currentTarget.value})}}),qe&&Xe?a.jsx("small",{id:"new-agent-workbench-name-error",className:"new-agent-workbench__error",role:"alert",children:Xe}):null]}),a.jsxs("label",{className:"new-agent-workbench__field","data-validation-field":"description",children:[a.jsxs("span",{children:[A("common.description"),a.jsx("span",{className:"new-agent-workbench__required",children:"*"})]}),a.jsx(xb,{value:e.description,rows:4,maxRows:8,autoResize:!0,size:"xl",gutterSize:"md",invalid:Se&&we,placeholder:A("workbench.agent.descriptionPlaceholder"),onChange:Me=>h({description:Me.currentTarget.value})}),Se&&we?a.jsx("small",{className:"new-agent-workbench__error",children:A("workbench.validation.descriptionRequired")}):null]}),a.jsxs("label",{className:"new-agent-workbench__field","data-validation-field":"instruction",children:[a.jsxs("span",{children:[A("workbench.agent.prompt"),a.jsx("span",{className:"new-agent-workbench__required",children:"*"})]}),a.jsx(xb,{value:e.instruction,rows:10,maxRows:18,autoResize:!0,size:"xl",gutterSize:"md",invalid:Se&&Ae,placeholder:A("workbench.agent.promptPlaceholder"),onChange:Me=>h({instruction:Me.currentTarget.value})}),Se&&Ae?a.jsx("small",{className:"new-agent-workbench__error",children:A("workbench.validation.promptRequired")}):null]}),a.jsx(Qan,{cloudProvider:t,source:Ve,agentName:e.name,value:e.modelName??"",apiKeyId:(Qt=e.deployment)==null?void 0:Qt.modelApiKeyId,apiKeyName:(cn=e.deployment)==null?void 0:cn.modelApiKeyName,provider:e.modelProvider??"",apiBase:e.modelApiBase??"",customApiKey:b,customModelSecretValues:v,customModelApiKeyConfigured:y,configuredRuntimeEnvKeys:w,fallbacks:e.modelFallbacks??[],showModelFallbacks:x,showMissingApiKeyErrors:Kt,onSourceChange:Me=>{var kn;J(Me==="ark");const on=Me==="custom"&&Ve==="ark"?"":Me==="ark"&&!((kn=e.modelName)!=null&&kn.trim())?Xp(t):e.modelName;h({modelSource:Me,modelName:on,modelFallbacks:Me==="custom"&&Ve==="ark"?[]:Nu(on,e.modelFallbacks)})},onApiKeyChange:g,onModelNameChange:Me=>h({modelName:Me,modelFallbacks:Nu(Me,e.modelFallbacks)}),onModelFallbacksChange:Me=>h({modelFallbacks:Me}),onProviderChange:Me=>h({modelProvider:Me}),onApiBaseChange:Me=>h({modelApiBase:Me}),onCustomApiKeyChange:O,onCustomModelSecretChange:k,onLoadingChange:J}),Se&&Be?a.jsx("p",{className:"new-agent-workbench__error",role:"alert",children:A("workbench.validation.modelRequired")}):null,Kt?a.jsx("p",{className:"new-agent-workbench__error",role:"alert",children:A("workbench.validation.apiKeyRequired")}):null,a.jsxs("div",{className:"new-agent-workbench__field",children:[a.jsx("span",{children:A("workbench.agent.skills")}),a.jsx(yK,{selected:e.selectedSkills??[],onChange:S,cloudProvider:t,disabled:o,addLabel:A("workbench.agent.addSkill"),showSelectedCount:!1})]})]},"agent"):null,P==="environment"&&!s?a.jsx(Ar.div,{className:"new-agent-workbench__fields",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16,ease:"easeOut"},children:a.jsx("div",{className:"new-agent-workbench__environment",children:a.jsx(nUe,{value:e.cloudEnvironment??{environmentId:"",environmentVersionId:""},onChange:C,disabled:o,controlSize:"xl",controlClassName:"new-agent-workbench__select-trigger",optionClassName:th})})},"environment"):null,P==="deployment"&&!s?a.jsxs(Ar.div,{className:"new-agent-workbench__fields",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16,ease:"easeOut"},children:[a.jsxs("label",{className:"new-agent-workbench__field",children:[a.jsxs("span",{children:[A("workbench.deployment.runtimeName"),a.jsx("span",{className:"new-agent-workbench__required",children:"*"})]}),a.jsx(_s,{value:i,disabled:o||r,size:"xl",gutterSize:"md",pill:!1,placeholder:"agent-runtime",onChange:Me=>j(Me.currentTarget.value)}),a.jsx("small",{className:"new-agent-workbench__helper-text",children:A(r?"workbench.deployment.runtimeNameUpdateHint":"workbench.deployment.runtimeNameHint")})]}),a.jsxs("label",{className:"new-agent-workbench__field",children:[a.jsxs("span",{children:[A("workbench.deployment.region"),a.jsx("span",{className:"new-agent-workbench__required",children:"*"})]}),a.jsx(pa,{value:n,options:mt,size:"xl",triggerClassName:"new-agent-workbench__select-trigger",optionClassName:th,pill:!1,disabled:o||r,onChange:Me=>E(Me.value)})]}),a.jsxs("div",{className:"new-agent-workbench__deployment-section",children:[a.jsxs("label",{className:"new-agent-workbench__field",children:[a.jsx("span",{children:A("workbench.deployment.authentication")}),a.jsx(pa,{value:V,options:[{value:"api_key",label:"API Key",description:A("workbench.deployment.apiKeyDescription")},{value:"user_pool",label:A("workbench.identity.userPool"),description:A("workbench.deployment.userPoolDescription")}],size:"xl",triggerClassName:"new-agent-workbench__select-trigger",optionClassName:th,pill:!1,disabled:o,onChange:Me=>{Z(Me.value),Pe("")}})]}),V==="user_pool"?a.jsx(zan,{value:ne,disabled:o,onChange:Me=>{W(Me),Pe("")}}):null]}),a.jsx("div",{className:"new-agent-workbench__deployment-section",children:a.jsxs("label",{className:"new-agent-workbench__field",children:[a.jsx("span",{children:A("workbench.deployment.sessionStorage")}),a.jsx(pa,{value:G,options:lw.map(Me=>({value:Me.id,label:Me.id==="local"?A("workbench.deployment.inMemoryStorage"):A(`workbench.deployment.backends.${Me.id}`,{defaultValue:Me.label})})),size:"xl",triggerClassName:"new-agent-workbench__select-trigger",optionClassName:th,pill:!1,disabled:o,onChange:Me=>{mce(Me.value)&&(H(Me.value),h({memory:{...e.memory,shortTerm:Me.value!=="local"},shortTermBackend:Me.value}),Pe(""))}})]})}),a.jsxs("div",{className:"new-agent-workbench__deployment-section",children:[a.jsx("strong",{className:"new-agent-workbench__section-title",children:A("workbench.deployment.instances")}),a.jsxs("div",{className:"new-agent-workbench__instance-fields",children:[a.jsxs("label",{className:"new-agent-workbench__field",children:[a.jsx("span",{className:"new-agent-workbench__model-field-label",children:A("workbench.deployment.minInstances")}),a.jsx(_s,{type:"number",min:0,step:1,value:Y,size:"xl",gutterSize:"md",pill:!1,disabled:o,onChange:Me=>{X(Me.currentTarget.value),Pe("")}})]}),a.jsxs("label",{className:"new-agent-workbench__field",children:[a.jsx("span",{className:"new-agent-workbench__model-field-label",children:A("workbench.deployment.maxInstances")}),a.jsx(_s,{type:"number",min:1,step:1,value:ie,size:"xl",gutterSize:"md",pill:!1,disabled:o,onChange:Me=>{ee(Me.currentTarget.value),Pe("")}})]})]}),se==="in-memory"?a.jsx("small",{className:"new-agent-workbench__helper-text",children:A("workbench.deployment.inMemoryHint")}):null]}),a.jsxs("div",{className:"new-agent-workbench__deployment-section",children:[a.jsxs("label",{className:"new-agent-workbench__field",children:[a.jsx("span",{children:A("workbench.deployment.networkMode")}),a.jsx(pa,{value:vt,options:[{value:"public",label:A("workbench.deployment.network.public")},{value:"private",label:A("workbench.deployment.network.private")},{value:"both",label:A("workbench.deployment.network.both")}],size:"xl",triggerClassName:"new-agent-workbench__select-trigger",optionClassName:th,pill:!1,onChange:Me=>T(Me.value==="public"?void 0:{...tt??{},mode:Me.value})})]}),vt!=="public"?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"new-agent-workbench__field-row",children:[a.jsxs("label",{className:"new-agent-workbench__field",children:[a.jsxs("span",{children:["VPC ID",a.jsx("span",{className:"new-agent-workbench__required",children:"*"})]}),a.jsx(_s,{value:(tt==null?void 0:tt.vpcId)??"",size:"xl",gutterSize:"md",pill:!1,placeholder:"vpc-xxx",onChange:Me=>T({...tt??{mode:vt},vpcId:Me.currentTarget.value})})]}),a.jsxs("label",{className:"new-agent-workbench__field",children:[a.jsx("span",{children:A("workbench.deployment.subnetIds")}),a.jsx(_s,{value:(tt==null?void 0:tt.subnetIds)??"",size:"xl",gutterSize:"md",pill:!1,placeholder:"subnet-xxx",onChange:Me=>T({...tt??{mode:vt},subnetIds:Me.currentTarget.value})})]})]}),a.jsxs("div",{className:"new-agent-workbench__switch-row",children:[a.jsxs("div",{children:[a.jsx("strong",{children:A("workbench.deployment.sharedInternet")}),a.jsx("span",{children:A("workbench.deployment.sharedInternetHint")})]}),a.jsx(nU,{checked:!!(tt!=null&&tt.enableSharedInternetAccess),onCheckedChange:Me=>T({...tt??{mode:vt},enableSharedInternetAccess:Me}),"aria-label":A("workbench.deployment.sharedInternet")})]})]}):null]}),t!=="byteplus"?a.jsxs("div",{className:"new-agent-workbench__deployment-section",children:[a.jsx("strong",{className:"new-agent-workbench__section-title",children:A("workbench.deployment.evaluationSets")}),a.jsxs("div",{className:"new-agent-workbench__switch-row",children:[a.jsxs("div",{children:[a.jsx("strong",{children:A("workbench.deployment.createEvaluationSets")}),a.jsx("span",{children:A("workbench.deployment.evaluationSetsHint")})]}),a.jsx(nU,{checked:be,onCheckedChange:ue,"aria-label":A("workbench.deployment.createEvaluationSets")})]})]}):null,a.jsxs("div",{className:"new-agent-workbench__deployment-section",children:[a.jsx("strong",{className:"new-agent-workbench__section-title",children:A("workbench.deployment.resources")}),a.jsx(E9e,{value:pe,agentName:e.name||"agentkit-app",runtimeName:i,region:n,disabled:o,validationError:Ee,onChange:Me=>{ke(Me),Qe(null),Pe("")}})]}),a.jsxs("div",{className:"new-agent-workbench__deployment-section",children:[a.jsxs("div",{className:"new-agent-workbench__env-head",children:[a.jsx("strong",{className:"new-agent-workbench__section-title",children:A("workbench.environmentVariables.title")}),a.jsxs(Tt,{color:"secondary",variant:"ghost",size:"sm",pill:!1,onClick:nt,children:[a.jsx(Nje,{"aria-hidden":!0}),A("workbench.environmentVariables.add")]})]}),a.jsxs("div",{className:"new-agent-workbench__env-table",role:"table","aria-label":A("workbench.environmentVariables.title"),children:[a.jsxs("div",{className:"new-agent-workbench__env-table-head",role:"row",children:[a.jsx("span",{role:"columnheader",children:A("common.name")}),a.jsx("span",{role:"columnheader",children:A("common.value")}),a.jsx("span",{role:"columnheader",children:A("common.actions")})]}),a.jsxs("div",{className:"new-agent-workbench__env-table-body",role:"rowgroup",children:[jt.map(Me=>a.jsx(gce,{name:Me.key,value:Ne[Me.key]??Me.defaultValue??"",required:Me.required,placeholder:Me.placeholder,locked:!0,onRename:()=>{},onValueChange:on=>We(Me.key,on),onRemove:()=>{}},Me.key)),wn.map(([Me,on])=>a.jsx(gce,{name:Me,value:on,onRename:kt,onValueChange:kn=>We(Me,kn),onRemove:()=>He(Me)},Me)),!jt.length&&!wn.length?a.jsx("div",{className:"new-agent-workbench__empty-row new-agent-workbench__env-table-empty",role:"row",children:a.jsx("span",{role:"cell",children:A("common.none")})}):null]})]})]}),je?a.jsx(wb,{message:je,defaultExpanded:!0}):c?a.jsx(wb,{message:c,defaultExpanded:!0}):l||u?a.jsxs("div",{className:"new-agent-workbench__deploy-status",role:"status",children:[u?a.jsx(Tje,{"aria-hidden":!0}):null,a.jsx("span",{children:(l?pL(l):"")||A(u?"workbench.deployment.complete":"workbench.deployment.preparing")}),typeof(l==null?void 0:l.pct)=="number"?a.jsxs("strong",{children:[Math.round(l.pct),"%"]}):null]}):null]},"deployment"):null]})}),a.jsx("span",{className:`new-agent-workbench__scroll-fade is-top${_e.top?" is-visible":""}`,"aria-hidden":"true"}),a.jsx("span",{className:`new-agent-workbench__scroll-fade is-bottom${_e.bottom?" is-visible":""}`,"aria-hidden":"true"})]}),a.jsx(hf,{mode:"wait",initial:!1,children:a.jsxs(Ar.div,{className:"new-agent-workbench__actions",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16,ease:"easeOut"},children:[a.jsxs(Tt,{color:"secondary",variant:"outline",size:"lg",pill:!1,disabled:o,onClick:et,children:[a.jsx(Xst,{"aria-hidden":!0}),A(ge===0?"common.back":"common.previous")]}),a.jsx(Tt,{color:"primary",size:"lg",pill:!1,loading:o,disabled:o||P==="agent"&&(U||Kt),onClick:St,children:A(s?u?"workbench.actions.applyProfileAgain":"workbench.actions.applyProfile":P==="deployment"?u?r?"workbench.actions.updateAgain":"workbench.actions.deployAgain":r?"workbench.actions.updateAndPublish":"common.deploy":"common.next")})]},`actions-${P}`)})]})}),a.jsx("footer",{className:"new-agent-workbench__footer",children:a.jsx("div",{className:"new-agent-workbench__footer-inner",children:a.jsx("nav",{"aria-label":A("workbench.progress"),children:a.jsx("ol",{className:"new-agent-workbench__progress",children:_j.map((Me,on)=>a.jsx("li",{className:on===ge?"is-active":"","aria-current":on===ge?"step":void 0,"aria-label":A(`workbench.steps.${Me.id}.label`),title:A(`workbench.steps.${Me.id}.label`),children:a.jsx("span",{"aria-hidden":"true"})},Me.id))})})})})]})}async function Han(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:po(void 0,ho)});if(t.status===409)throw new Error(Xt("helpers.a2aSpaces.credentialsMissing"));if(t.status===401)throw new Error(Xt("helpers.a2aSpaces.loginRequired"));if(!t.ok){let n="";try{n=(await t.json()).detail||""}catch{}throw new Error(Xt("helpers.requestFailed",{status:t.status,detail:n?`: ${n}`:""}))}return t.json()}async function qan(e={}){const t=new URLSearchParams({page_size:String(e.pageSize??100),project:e.project||"default"});return e.region&&t.set("region",e.region),(await Han(`/web/a2a-spaces?${t.toString()}`)).items||[]}async function Wan(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:po(void 0,ho)});if(t.status===409)throw new Error(Xt("helpers.vikingKnowledge.credentialsMissing"));if(t.status===401)throw new Error(Xt("helpers.vikingKnowledge.loginRequired"));if(!t.ok){let n="";try{n=(await t.json()).detail||""}catch{}throw new Error(Xt("helpers.requestFailed",{status:t.status,detail:n?`: ${n}`:""}))}return t.json()}async function Kan(e={}){const t=new URLSearchParams;e.project&&t.set("project",e.project),e.region&&t.set("region",e.region);const n=t.toString();return(await Wan(`/web/viking-knowledgebases${n?`?${n}`:""}`)).items||[]}async function Gan(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:po(void 0,ho)});if(t.status===409)throw new Error(Xt("helpers.vikingMemory.credentialsMissing"));if(t.status===401)throw new Error(Xt("helpers.vikingMemory.loginRequired"));if(!t.ok){let n="";try{n=(await t.json()).detail||""}catch{}throw new Error(Xt("helpers.requestFailed",{status:t.status,detail:n?`: ${n}`:""}))}return t.json()}async function Xan(e={}){const t=new URLSearchParams;e.project&&t.set("project",e.project),e.region&&t.set("region",e.region);const n=t.toString();return(await Gan(`/web/viking-memories${n?`?${n}`:""}`)).items||[]}const bce=["#6366f1","#0ea5e9","#10b981","#f59e0b","#f43f5e","#a855f7","#14b8a6","#f472b6"];function M6(e){let t=0;for(let n=0;n>>0;return bce[t%bce.length]}const Yan=2,Zan=1500;function Jan(e){return e.includes("HTTP 425")||e.includes("仍在采集中")?"collecting":e.includes("HTTP 404")||e.includes("未开启链路观测")?"disabled":/HTTP 40[13]/.test(e)||e.includes("无权限读取 APMPlus")?"forbidden":"error"}function eon(e){const t=new Map;e.forEach(u=>t.set(u.span_id,u));const n=new Map,i=[];for(const u of e)u.parent_span_id!=null&&t.has(u.parent_span_id)?(n.get(u.parent_span_id)??n.set(u.parent_span_id,[]).get(u.parent_span_id)).push(u):i.push(u);const r=(u,d)=>u.start_time-d.start_time,s=(u,d)=>({span:u,depth:d,children:(n.get(u.span_id)??[]).sort(r).map(f=>s(f,d+1))}),o=i.sort(r).map(u=>s(u,0)),l=e.length?Math.min(...e.map(u=>u.start_time)):0,c=e.length?Math.max(...e.map(u=>u.end_time)):1;return{rootNodes:o,min:l,total:c-l||1}}function ton(e,t){const n=[],i=r=>{n.push(r),t.has(r.span.span_id)||r.children.forEach(i)};return e.forEach(i),n}function yce(e){const t=e/1e6;return t>=1e3?`${(t/1e3).toFixed(2)} s`:`${t.toFixed(t<10?2:1)} ms`}const non=e=>e.replace(/^(gen_ai|a2ui|adk)\./,"");function vce(e){return Object.entries(e.attributes).filter(([,t])=>t!=null&&typeof t!="object").map(([t,n])=>{const i=String(n);return{key:non(t),value:i,long:i.length>80||i.includes(` -`)}}).sort((t,n)=>Number(t.long)-Number(n.long))}function iUe({appName:e,testRunId:t,sessionId:n,endTimeMs:i,onClose:r,title:s}){const{t:o}=Te("conversation"),[l,c]=p.useState(null),[u,d]=p.useState("loading"),[f,h]=p.useState(0),[m,g]=p.useState(new Set),[b,v]=p.useState(null),y=p.useRef(0),w=`${e??""}:${t??""}:${n}:${i??""}`,x=p.useRef(w);p.useEffect(()=>{x.current!==w&&(x.current=w,y.current=0),c(null),d("loading");let A=!1,N,P;if(t)P=N2e(t,n);else if(e)P=YR(e,n,i);else{d("error");return}return P.then(I=>{A||(c(I),d("ready"),v(I.length?I.reduce((D,_)=>D.start_time<=_.start_time?D:_).span_id:null))}).catch(I=>{if(A)return;const D=Jan(I instanceof Error?I.message:String(I));d(D),D==="collecting"&&y.currenth(_=>_+1),Zan))}),()=>{A=!0,N!==void 0&&window.clearTimeout(N)}},[e,i,f,n,w,t]);const O=()=>{y.current=0,h(A=>A+1)},{rootNodes:k,min:S,total:C}=p.useMemo(()=>eon(l??[]),[l]),E=p.useMemo(()=>ton(k,m),[k,m]),j=(l==null?void 0:l.find(A=>A.span_id===b))??null,T=C/1e6,R=A=>g(N=>{const P=new Set(N);return P.has(A)?P.delete(A):P.add(A),P});return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"drawer-scrim",onClick:r}),a.jsxs("aside",{className:"drawer drawer--trace",children:[a.jsxs("header",{className:"drawer-head",children:[a.jsxs("div",{children:[a.jsx("div",{className:"drawer-title",children:s??o("trace.title")}),a.jsx("div",{className:"drawer-sub",children:u==="ready"&&l?o("trace.callCount",{count:l.length,duration:T.toFixed(1)}):o(`trace.statuses.${u}`)})]}),a.jsx("button",{className:"drawer-close",onClick:r,"aria-label":o("trace.close"),children:a.jsx(Mo,{className:"icon"})})]}),u==="loading"&&a.jsxs("div",{className:"drawer-loading",children:[a.jsx(Bi,{className:"icon spin"})," ",o("trace.loading")]}),u==="collecting"&&a.jsxs("div",{className:"drawer-loading",role:"status","aria-live":"polite",children:[a.jsx(Bi,{className:"icon spin"}),a.jsx("span",{children:o("trace.errors.collecting")}),a.jsx(Tt,{type:"button",color:"secondary",variant:"outline",size:"sm",pill:!1,onClick:O,children:o("trace.retryNow")})]}),(u==="disabled"||u==="forbidden"||u==="error")&&a.jsxs("div",{className:"drawer-empty trace-state",role:"alert",children:[a.jsx("span",{children:o(`trace.errors.${u}`)}),u==="error"&&a.jsx(Tt,{type:"button",color:"secondary",variant:"outline",size:"sm",pill:!1,onClick:O,children:o("trace.reload")})]}),u==="ready"&&l&&l.length===0&&a.jsx("div",{className:"drawer-empty",children:o("trace.empty")}),E.length>0&&a.jsxs("div",{className:"trace-split",children:[a.jsx("div",{className:"trace-tree scroll",children:E.map(A=>{const N=A.span,P=(N.start_time-S)/C*100,I=Math.max((N.end_time-N.start_time)/C*100,.6),D=A.children.length>0;return a.jsxs("button",{className:`trace-row ${b===N.span_id?"active":""}`,onClick:()=>v(N.span_id),children:[a.jsxs("span",{className:"trace-label",style:{paddingLeft:A.depth*14},children:[a.jsx("span",{className:`trace-caret ${D?"":"hidden"} ${m.has(N.span_id)?"":"open"}`,onClick:_=>{_.stopPropagation(),D&&R(N.span_id)},children:a.jsx(BA,{className:"chev"})}),a.jsx("span",{className:"trace-dot",style:{background:M6(N.name)}}),a.jsx("span",{className:"trace-name",title:N.name,children:N.name})]}),a.jsx("span",{className:"trace-dur",children:yce(N.end_time-N.start_time)}),a.jsx("span",{className:"trace-track",children:a.jsx("span",{className:"trace-bar",style:{left:`${P}%`,width:`${I}%`,background:M6(N.name)}})})]},N.span_id)})}),a.jsx("div",{className:"trace-detail scroll",children:j?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"td-title",children:j.name}),a.jsxs("div",{className:"td-dur",children:[a.jsx("span",{className:"td-dot",style:{background:M6(j.name)}}),yce(j.end_time-j.start_time)]}),a.jsx("div",{className:"td-section",children:o("trace.attributes")}),a.jsx("div",{className:"td-props",children:vce(j).filter(A=>!A.long).map(A=>a.jsxs("div",{className:"td-prop",children:[a.jsx("span",{className:"td-key",children:A.key}),a.jsx("span",{className:"td-val",children:A.value})]},A.key))}),vce(j).filter(A=>A.long).map(A=>a.jsxs("div",{className:"td-block",children:[a.jsx("div",{className:"td-section",children:A.key}),a.jsx("pre",{className:"td-pre",children:A.value})]},A.key))]}):a.jsx("div",{className:"drawer-empty",children:o("trace.selectCall")})})]})]})]})}const ion=p.lazy(()=>Js(()=>import("../chunks/MarkdownPromptEditor-D6ctFDfi.js"),__vite__mapDeps([2,3]))),dU="veadk.generatedAgentTestRuns",L6=4;function LK(){if(typeof window>"u")return[];try{const e=JSON.parse(window.sessionStorage.getItem(dU)??"[]");return Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.length>0):[]}catch{return[]}}function rUe(e){if(typeof window>"u")return;const t=Array.from(new Set(e)).slice(-20);try{t.length?window.sessionStorage.setItem(dU,JSON.stringify(t)):window.sessionStorage.removeItem(dU)}catch{}}function ron(e){rUe([...LK(),e])}function Lk(e){rUe(LK().filter(t=>t!==e))}function son(e,t,n="text/plain"){const i=URL.createObjectURL(new Blob([t],{type:`${n};charset=utf-8`})),r=document.createElement("a");r.href=i,r.download=e,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(i)}const aon=[{id:"type",label:"traditional.sections.type.label",hint:"traditional.sections.type.hint",icon:Gat,required:!0},{id:"basic",label:"traditional.sections.basic.label",hint:"traditional.sections.basic.hint",icon:gm,required:!0},{id:"model",label:"traditional.sections.model.label",hint:"traditional.sections.model.hint",icon:jat},{id:"tools",label:"traditional.sections.tools.label",hint:"traditional.sections.tools.hint",icon:Zat},{id:"skills",label:"traditional.sections.skills.label",hint:"traditional.sections.skills.hint",icon:lC},{id:"knowledge",label:"traditional.sections.knowledge.label",hint:"traditional.sections.knowledge.hint",icon:gN},{id:"memory",label:"traditional.sections.memory.label",hint:"traditional.sections.memory.hint",icon:Fje},{id:"subagents",label:"traditional.sections.subagents.label",hint:"traditional.sections.subagents.hint",icon:kat},{id:"review",label:"traditional.sections.review.label",hint:"traditional.sections.review.hint",icon:Kat}];function oon({className:e}){return a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M9 7.15v9.7a1.15 1.15 0 0 0 1.78.96l7.2-4.85a1.15 1.15 0 0 0 0-1.92l-7.2-4.85A1.15 1.15 0 0 0 9 7.15Z"}),a.jsx("path",{d:"M5.75 8.25v7.5",opacity:"0.8"}),a.jsx("path",{d:"M3 10v4",opacity:"0.45"}),a.jsx("path",{d:"M17.9 5.25v2.2M19 6.35h-2.2",strokeWidth:"1.55"})]})}function xce({className:e}){return a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M4.75 7.25h14.5"}),a.jsx("path",{d:"M9.1 4.75h5.8l.75 2.5h-7.3l.75-2.5Z"}),a.jsx("path",{d:"m6.75 7.25.75 12h9l.75-12"}),a.jsx("path",{d:"M10 10.25v5.75M14 10.25v5.75"})]})}function $K({className:e}){return a.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"m7 9 5 5 5-5"})})}function FK({className:e}){return a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M18.25 8.2A7.1 7.1 0 0 0 6.1 6.65L4.5 8.25"}),a.jsx("path",{d:"M4.5 4.75v3.5H8"}),a.jsx("path",{d:"M5.75 15.8A7.1 7.1 0 0 0 17.9 17.35l1.6-1.6"}),a.jsx("path",{d:"M19.5 19.25v-3.5H16"})]})}const lon={llm:"traditional.agentTypes.llm.label",sequential:"traditional.agentTypes.sequential.label",parallel:"traditional.agentTypes.parallel.label",loop:"traditional.agentTypes.loop.label",a2a:"traditional.agentTypes.a2a.label"},wce={REGISTRY_SPACE_ID:"registrySpaceId",REGISTRY_TOP_K:"registryTopK",REGISTRY_REGION:"registryRegion",REGISTRY_ENDPOINT:"registryEndpoint"},sUe="REGISTRY_SPACE_ID",con=jIe.filter(e=>e.key!==sUe);function aUe(e,t,n="volcengine"){var s,o,l;if(!(e!=null&&e.enabled))return{};const i=mM(n),r={REGISTRY_SPACE_ID:e.registrySpaceId??""};return t.includeDefaults?(r.REGISTRY_TOP_K=((s=e.registryTopK)==null?void 0:s.trim())||i.topK,r.REGISTRY_REGION=((o=e.registryRegion)==null?void 0:o.trim())||i.region,r.REGISTRY_ENDPOINT=((l=e.registryEndpoint)==null?void 0:l.trim())||i.endpoint):(r.REGISTRY_TOP_K=e.registryTopK??"",r.REGISTRY_REGION=e.registryRegion??"",r.REGISTRY_ENDPOINT=e.registryEndpoint??""),r}function hx(e,t){if(t!=="byteplus")return e;const n=mM(t);return e.map(i=>i.key==="REGISTRY_REGION"?{...i,placeholder:n.region}:i.key==="REGISTRY_ENDPOINT"?{...i,placeholder:n.endpoint}:i.key==="MODEL_EMBEDDING_NAME"?{...i,placeholder:ott(t)}:i.key==="MODEL_EMBEDDING_API_BASE"?{...i,placeholder:Do(t)}:i.key==="MODEL_IMAGE_NAME"?{...i,placeholder:ctt(t)}:i.key==="MODEL_EDIT_NAME"?{...i,placeholder:utt(t)}:i.key==="MODEL_VIDEO_NAME"?{...i,placeholder:dtt(t)}:i.key==="MODEL_IMAGE_API_BASE"||i.key==="MODEL_EDIT_API_BASE"||i.key==="MODEL_VIDEO_API_BASE"?{...i,placeholder:Do(t)}:i)}function uon({items:e,selected:t,onToggle:n,scrollRows:i}){const{t:r}=Te("create");return a.jsx("div",{className:`cw-checklist ${i?"cw-checklist-tools":""}`,style:i?{"--cw-checklist-max-height":`${i*40+(i-1)*8}px`}:void 0,children:e.map(s=>{const o=t.includes(s.id);return a.jsx(DK,{id:`cw-check-${s.id}`,className:`cw-check ${o?"is-on":""}`,checked:o,onCheckedChange:l=>{l!==o&&n(s.id)},label:a.jsx("span",{className:"cw-check-text",children:a.jsx("span",{className:"cw-check-title",children:r(`traditional.catalog.${s.id}.label`,{defaultValue:s.label})})})},s.id)})})}function $6({options:e,value:t,onChange:n,translationGroup:i}){const{t:r}=Te("create");return a.jsx("div",{className:"cw-segmented",children:e.map(s=>{var l;const o=(t??((l=e[0])==null?void 0:l.id))===s.id;return a.jsx("button",{type:"button",className:`cw-seg ${o?"is-on":""}`,onClick:()=>n(s.id),"aria-pressed":o,children:a.jsx("span",{className:"cw-seg-title",children:r(`traditional.backends.${i}.${s.id}.label`,{defaultValue:s.label})})},s.id)})})}function don(e){return/(SECRET|PASSWORD|KEY|TOKEN)$/.test(e)}function $k({env:e,values:t,onChange:n,renderAfterField:i}){const{t:r}=Te("create"),s=e.filter(o=>!o.hidden);return s.length===0?a.jsx("p",{className:"cw-env-empty",children:r("traditional.env.noAdditionalParameters")}):a.jsx("div",{className:"cw-env-fields",children:s.map(o=>{const l=t[o.key]??o.defaultValue??"",c=IK(o,t,r("traditional.env.invalidJson")),u=`cw-env-${o.key}`;return a.jsxs(p.Fragment,{children:[a.jsxs("label",{className:"cw-env-field",htmlFor:u,children:[a.jsxs("span",{className:"cw-env-field-head",children:[a.jsxs("span",{className:"cw-env-field-title",children:[a.jsxs("span",{className:"cw-env-field-label",children:[o.comment||o.key,o.required&&a.jsx("span",{className:"cw-req",children:"*"})]}),o.help&&a.jsxs("span",{className:"cw-env-help",tabIndex:0,"data-help":o.help,"aria-label":r("traditional.env.helpAriaLabel",{label:o.comment||o.key,help:o.help}),children:["?",a.jsx("span",{className:"cw-env-help-popover",role:"tooltip",children:o.help})]}),o.link&&a.jsx("a",{className:"cw-env-link",href:o.link.url,target:"_blank",rel:"noopener noreferrer",title:r("traditional.env.openOpenViking",{label:o.link.label}),"aria-label":r("traditional.env.openOpenViking",{label:o.link.label}),onClick:d=>d.stopPropagation(),children:a.jsx(d0,{"aria-hidden":"true"})})]}),o.comment&&a.jsx("code",{title:o.key,children:o.key})]}),o.multiline||o.format==="json"?a.jsx("textarea",{id:u,className:"cw-input cw-env-textarea",value:l,placeholder:o.placeholder||r("traditional.env.valuePlaceholder"),autoComplete:"off",spellCheck:!1,"aria-invalid":!!c,onChange:d=>n(o.key,d.currentTarget.value)}):a.jsx("input",{id:u,className:"cw-input",type:don(o.key)?"password":"text",value:l,placeholder:o.placeholder||r("traditional.env.valuePlaceholder"),autoComplete:"off","aria-invalid":!!c,onChange:d=>n(o.key,d.currentTarget.value)}),c&&a.jsx("span",{className:"cw-env-error",children:c})]}),i==null?void 0:i(o)]},o.key)})})}function fon({value:e,onChange:t}){const{t:n}=Te("create"),i="cw-openviking-knowledge-index",r=n("traditional.env.openVikingIndexHelp");return a.jsxs("label",{className:"cw-env-field",htmlFor:i,children:[a.jsx("span",{className:"cw-env-field-head",children:a.jsxs("span",{className:"cw-env-field-title",children:[a.jsx("span",{className:"cw-env-field-label",children:n("traditional.env.openVikingIndex")}),a.jsxs("span",{className:"cw-env-help",tabIndex:0,"data-help":r,"aria-label":n("traditional.env.openVikingIndexAriaLabel",{help:r}),children:["?",a.jsx("span",{className:"cw-env-help-popover",role:"tooltip",children:r})]})]})}),a.jsx("input",{id:i,className:"cw-input",value:e,placeholder:"",autoComplete:"off",onChange:s=>t(s.currentTarget.value)})]})}function F6(e,t=Xt("traditional.resources.unnamedAgentCenter")){return e.name.trim()||t}function Oce(e,t=Xt("traditional.resources.unnamedKnowledgeBase")){const n=e.name.trim()||e.id||t,i=[e.sourceLabel,e.projectName].filter(Boolean);return i.length?`${n} · ${i.join(" · ")}`:n}function kce(e,t=Xt("traditional.resources.unnamedMemory")){return e.name.trim()||e.id||t}function Sce(e){return e.apiKeyAllowed===!1?"modelApiKey.noModelPermission":e.unavailableReason?`modelApiKey.permissionState.${e.unavailableReason}`:e.available?"traditional.model.available":e.lifecycleStatus==="Retiring"?"traditional.model.retiring":e.activationState&&e.activationState!=="Available"?"traditional.model.notActivated":"traditional.model.unavailable"}function Ece(e){return e.apiKeyAllowed!==!1&&!e.unavailableReason&&(e.available||e.lifecycleStatus==="Retiring")}function B6({selectedLabel:e,placeholder:t,disabled:n,triggerAriaLabel:i,menuAriaLabel:r,searchAriaLabel:s,searchValue:o,searchPlaceholder:l,onSearchChange:c,empty:u,emptyLabel:d,triggerClassName:f="",optionsClassName:h="",renderOptions:m}){const[g,b]=p.useState(!1),v=p.useRef(null),y=p.useRef(null),w=p.useRef(null),x=p.useId(),[O,k]=p.useState(null);p.useEffect(()=>{if(!g)return;const E=T=>{var A;const R=T.target;R instanceof Node&&v.current&&!v.current.contains(R)&&!((A=w.current)!=null&&A.contains(R))&&b(!1)},j=T=>{var R;T.key==="Escape"&&(b(!1),(R=y.current)==null||R.focus())};return window.addEventListener("pointerdown",E),window.addEventListener("keydown",j),()=>{window.removeEventListener("pointerdown",E),window.removeEventListener("keydown",j)}},[g]),p.useEffect(()=>{if(!g){k(null);return}const E=()=>{const j=y.current;if(!j)return;const T=j.getBoundingClientRect(),R=12,A=6,N=window.innerHeight-T.bottom-R-A,P=T.top-R-A,I=N<300&&P>N,D=Math.max(96,I?P:N),_=Math.min(T.width,window.innerWidth-R*2),L=Math.min(Math.max(R,T.left),window.innerWidth-R-_);k({...I?{bottom:window.innerHeight-T.top+A}:{top:T.bottom+A},left:L,width:_,maxHeight:D,opensUp:I})};return E(),window.addEventListener("resize",E),window.addEventListener("scroll",E,!0),()=>{window.removeEventListener("resize",E),window.removeEventListener("scroll",E,!0)}},[g]);const S=()=>b(!1),C=E=>{var A,N;if(!["ArrowDown","ArrowUp","Home","End"].includes(E.key))return;const j=Array.from(((A=w.current)==null?void 0:A.querySelectorAll('[role="option"]:not(:disabled)'))??[]);if(!j.length)return;E.preventDefault();const T=j.findIndex(P=>P===document.activeElement),R=E.key==="Home"?0:E.key==="End"?j.length-1:E.key==="ArrowUp"?T<=0?j.length-1:T-1:T<0||T===j.length-1?0:T+1;(N=j[R])==null||N.focus()};return a.jsxs("div",{className:`cw-a2a-space-select-wrap cw-catalog-select${g?" is-open":""}`,ref:v,children:[a.jsxs("button",{ref:y,type:"button",className:`cw-a2a-space-trigger ${f}`.trim(),disabled:n,"aria-haspopup":"listbox","aria-controls":g?x:void 0,"aria-expanded":g,"aria-label":i,title:e,onClick:()=>{g||c(""),b(E=>!E)},children:[a.jsx("span",{className:t?"is-placeholder":void 0,children:e}),a.jsx($K,{className:"cw-a2a-space-trigger-icon"})]}),g&&O&&vi.createPortal(a.jsxs("div",{ref:w,className:`cw-a2a-space-menu cw-catalog-menu cw-catalog-menu-portal${O.opensUp?" is-up":""}`,style:{top:O.top??"auto",bottom:O.bottom??"auto",left:O.left,width:O.width,maxHeight:O.maxHeight},onKeyDown:C,children:[a.jsx("div",{className:"cw-picker-search",children:a.jsx("input",{className:"cw-picker-search-input",type:"search",value:o,autoFocus:!0,autoComplete:"off","aria-label":s,placeholder:l,onChange:E=>c(E.currentTarget.value)})}),a.jsxs("div",{id:x,className:`cw-picker-options cw-catalog-options ${h}`.trim(),role:"listbox","aria-label":r,children:[m(S),u&&a.jsx("div",{className:"cw-picker-empty",children:d})]})]}),document.body)]})}function hon({value:e,fallbacks:t,cloudProvider:n,agentName:i,apiKeyId:r,apiKeyName:s,customModelSecretValues:o,configuredRuntimeEnvKeys:l,showFallbacks:c=!0,showMissingApiKeyErrors:u,onApiKeyChange:d,onChange:f,onFallbacksChange:h,onCustomModelSecretChange:m}){const{t:g}=Te("create"),[b,v]=p.useState([]),[y,w]=p.useState(!1),[x,O]=p.useState([]),[k,S]=p.useState(null),[C,E]=p.useState(!1),[j,T]=p.useState(null),[R,A]=p.useState(0),[N,P]=p.useState(0),[I,D]=p.useState(""),[_,L]=p.useState(""),[F,M]=p.useState("");p.useEffect(()=>{const pe=new AbortController;return w(!0),T(null),xz(pe.signal,R>0).then(ke=>{if(pe.signal.aborted)return;v(ke.keys);const je=ke.keys.find(Pe=>Pe.id===r)??ke.keys.find(Pe=>Pe.name===s)??ke.keys.find(Pe=>Pe.id===ke.defaultKeyId)??ke.keys.find(Pe=>Pe.status!=="Restricted");je&&d(je)}).catch(ke=>{pe.signal.aborted||T(ke instanceof Error?ke.message:g("traditional.model.apiKeyLoadError"))}).finally(()=>{pe.signal.aborted||w(!1)}),()=>pe.abort()},[n,R,g]),p.useEffect(()=>{if(!r){O([]);return}const pe=new AbortController;return E(!0),T(null),S(null),$1({signal:pe.signal,apiKeyId:r,refresh:R>0||N>0}).then(ke=>{if(!pe.signal.aborted){const je=L7e(ke.models,ke.apiKeyModelPermissions);O(je),S(r);const Pe=new Set(je.filter(Qe=>Qe.apiKeyAllowed===!1||Qe.unavailableReason).map(Qe=>Qe.id));Pe.has(e.trim())&&f("");const Ee=t.filter(Qe=>typeof Qe!="string"||!Pe.has(Qe));Ee.length!==t.length&&h(Ee)}}).catch(ke=>{pe.signal.aborted||T(ke instanceof Error?ke.message:g("traditional.model.loadError"))}).finally(()=>{pe.signal.aborted||E(!1)}),()=>pe.abort()},[r,n,N,R,g]);const z=e.trim(),q=k===r,U=q?x:[],J=b.find(pe=>pe.id===r),V=J?J.name||g("modelApiKey.unnamed"):r?g("traditional.model.currentApiKey"):y?g("traditional.model.loadingApiKeys"):b.length===0?g("traditional.model.noApiKeys"):g("traditional.model.selectApiKey"),Z=p.useMemo(()=>b.filter(pe=>$7e(I,pe.name,cU(pe,g))),[I,b,g]),ne=U.find(pe=>pe.id===z),W=C&&!q?g("traditional.model.refreshing"):ne?`${ne.displayName} (${ne.id})`:z||g("traditional.model.selectModel"),G=p.useMemo(()=>U.filter(pe=>Sg(_,[pe.displayName,pe.id,pe.name,pe.vendorName,pe.activationState,pe.lifecycleStatus])),[_,U]),H=!!(z&&!ne&&Sg(_,[z])),se=U.filter(pe=>pe.available).length,Y=n==="byteplus"?"BytePlus ModelArk":g("traditional.model.volcengineArk"),X=att(n),ie=Nu(z,t),ee=new Set(E7e(z,ie)),be=pe=>{const ke=pe.trim();return U.filter(je=>{const Pe=je.id.trim();return!(Pe!==ke&&ee.has(Pe))&&!(Pe!==ke&&Pe===z)&&Sg(F,[je.displayName,je.id,je.name,je.vendorName,je.activationState,je.lifecycleStatus])})},ue=(pe,ke)=>{const je=[...t];je[pe]=ke,h(Nu(z,je))};return a.jsxs("div",{className:"cw-a2a-space-picker cw-model-picker",children:[a.jsxs("div",{className:"cw-model-picker-stack",children:[a.jsxs("div",{className:"cw-model-picker-field",children:[a.jsx("span",{className:"cw-model-picker-label",children:"API Key"}),a.jsx(B6,{selectedLabel:V,placeholder:!r,disabled:y,triggerAriaLabel:g("traditional.model.selectApiKey"),menuAriaLabel:g("traditional.model.apiKeyList"),searchAriaLabel:g("traditional.model.searchApiKey"),searchValue:I,searchPlaceholder:g("modelApiKey.search"),onSearchChange:D,empty:Z.length===0,emptyLabel:g("traditional.model.noMatchingApiKey"),optionsClassName:"cw-model-key-options",renderOptions:pe=>Z.map(ke=>{const je=ke.id===r,Pe=cU(ke,g);return a.jsx("button",{type:"button",role:"option","aria-selected":je,disabled:ke.status==="Restricted",className:`cw-a2a-space-option cw-model-key-option ${je?"is-selected":""}`,title:`${ke.name||g("modelApiKey.unnamed")} · ${Pe}`,onClick:()=>{P(Ee=>Ee+1),d(ke),pe()},children:a.jsxs("span",{className:"cw-model-option-copy",children:[a.jsx("strong",{children:ke.name||g("modelApiKey.unnamed")}),a.jsx("small",{children:Pe})]})},ke.id)})})]}),a.jsxs("div",{className:"cw-model-picker-field",children:[a.jsx("span",{className:"cw-model-picker-label",children:g("traditional.model.label")}),a.jsxs("div",{className:"cw-a2a-space-row",children:[a.jsx(B6,{selectedLabel:W,placeholder:!z,disabled:C,triggerAriaLabel:g("traditional.model.selectProviderModel",{provider:Y}),menuAriaLabel:g("traditional.model.providerModels",{provider:Y}),searchAriaLabel:g("traditional.model.search"),searchValue:_,searchPlaceholder:g("traditional.model.searchPlaceholder"),onSearchChange:L,empty:!H&&G.length===0,emptyLabel:g("traditional.model.noMatches"),triggerClassName:"cw-model-trigger",optionsClassName:"cw-model-options",renderOptions:pe=>a.jsxs(a.Fragment,{children:[H&&a.jsxs("button",{type:"button",role:"option","aria-selected":!0,className:"cw-a2a-space-option cw-model-option is-selected",onClick:()=>{f(z),pe()},children:[a.jsxs("span",{className:"cw-model-option-copy",children:[a.jsx("strong",{children:g("traditional.model.currentConfiguration")}),a.jsx("small",{children:z})]}),a.jsx("span",{className:"cw-model-status is-unknown",children:g("traditional.model.unknownStatus")})]}),G.map(ke=>{const je=ke.id===z,Pe=Ece(ke);return ke.apiKeyAllowed!==!1&&!ke.unavailableReason&&!Pe&&ke.activationState!=="Available"?a.jsxs("button",{type:"button",role:"option","aria-selected":!1,className:"cw-a2a-space-option cw-model-option is-activation-link",title:g("traditional.model.activate",{provider:Y,model:ke.displayName}),onClick:()=>{window.open(X,"_blank","noopener,noreferrer"),pe()},children:[a.jsxs("span",{className:"cw-model-option-copy",children:[a.jsx("strong",{children:ke.displayName}),a.jsxs("small",{children:[ke.id,ke.vendorName?` · ${ke.vendorName}`:""]})]}),a.jsx("span",{className:"cw-model-status is-unavailable",children:g("traditional.model.activateAction")})]},ke.id):a.jsxs("button",{type:"button",role:"option","aria-selected":je,disabled:!Pe,className:`cw-a2a-space-option cw-model-option ${je?"is-selected":""}`,title:`${ke.displayName} (${ke.id})`,onClick:()=>{f(ke.id),pe()},children:[a.jsxs("span",{className:"cw-model-option-copy",children:[a.jsx("strong",{children:ke.displayName}),a.jsxs("small",{children:[ke.id,ke.vendorName?` · ${ke.vendorName}`:""]})]}),a.jsx("span",{className:`cw-model-status ${ke.apiKeyAllowed===!1||ke.unavailableReason?"is-unavailable":ke.available?"is-available":ke.lifecycleStatus==="Retiring"?"is-retiring":"is-unavailable"}`,children:g(Sce(ke))})]},ke.id)})]})}),a.jsx("button",{type:"button",className:"cw-icon-btn cw-a2a-space-refresh",title:g("traditional.model.refresh"),"aria-label":g("traditional.model.refresh"),disabled:C||y,onClick:()=>A(pe=>pe+1),children:C||y?a.jsx(Bi,{className:"cw-i cw-i-sm cw-spin"}):a.jsx(FK,{className:"cw-i cw-i-sm"})})]})]}),c?a.jsx(FP,{variant:"traditional",embedded:!0,primaryModelName:z,agentName:i,value:t,secretValues:o,configuredSecretEnvKeys:l,showMissingApiKeyErrors:u,onChange:h,onSecretChange:m,renderSameProviderField:({index:pe,value:ke})=>{const je=U.find(_e=>_e.id===ke.trim()),Pe=be(ke),Ee=!!(ke.trim()&&!je&&Sg(F,[ke])),Qe=je?`${je.displayName} (${je.id})`:ke||g("traditional.model.fallbackPlaceholder");return a.jsx(B6,{selectedLabel:Qe,placeholder:!ke.trim(),disabled:C||!r,triggerAriaLabel:g("traditional.model.selectProviderModel",{provider:Y}),menuAriaLabel:g("traditional.model.providerModels",{provider:Y}),searchAriaLabel:g("traditional.model.search"),searchValue:F,searchPlaceholder:g("traditional.model.searchPlaceholder"),onSearchChange:M,empty:!Ee&&Pe.length===0,emptyLabel:g("traditional.model.noMatches"),triggerClassName:"cw-model-trigger",optionsClassName:"cw-model-options",renderOptions:_e=>a.jsxs(a.Fragment,{children:[Ee&&a.jsxs("button",{type:"button",role:"option","aria-selected":!0,className:"cw-a2a-space-option cw-model-option is-selected",onClick:()=>{ue(pe,ke),_e()},children:[a.jsxs("span",{className:"cw-model-option-copy",children:[a.jsx("strong",{children:g("traditional.model.currentConfiguration")}),a.jsx("small",{children:ke})]}),a.jsx("span",{className:"cw-model-status is-unknown",children:g("traditional.model.unknownStatus")})]}),Pe.map(ae=>{const le=ae.id===ke.trim(),ge=Ece(ae);return ae.apiKeyAllowed!==!1&&!ae.unavailableReason&&!ge&&ae.activationState!=="Available"?a.jsxs("button",{type:"button",role:"option","aria-selected":!1,className:"cw-a2a-space-option cw-model-option is-activation-link",title:g("traditional.model.activate",{provider:Y,model:ae.displayName}),onClick:()=>{window.open(X,"_blank","noopener,noreferrer"),_e()},children:[a.jsxs("span",{className:"cw-model-option-copy",children:[a.jsx("strong",{children:ae.displayName}),a.jsxs("small",{children:[ae.id,ae.vendorName?` · ${ae.vendorName}`:""]})]}),a.jsx("span",{className:"cw-model-status is-unavailable",children:g("traditional.model.activateAction")})]},ae.id):a.jsxs("button",{type:"button",role:"option","aria-selected":le,disabled:!ge,className:`cw-a2a-space-option cw-model-option ${le?"is-selected":""}`,title:`${ae.displayName} (${ae.id})`,onClick:()=>{ue(pe,ae.id),_e()},children:[a.jsxs("span",{className:"cw-model-option-copy",children:[a.jsx("strong",{children:ae.displayName}),a.jsxs("small",{children:[ae.id,ae.vendorName?` · ${ae.vendorName}`:""]})]}),a.jsx("span",{className:`cw-model-status ${ae.apiKeyAllowed===!1||ae.unavailableReason?"is-unavailable":ae.available?"is-available":ae.lifecycleStatus==="Retiring"?"is-retiring":"is-unavailable"}`,children:g(Sce(ae))})]},ae.id)})]})})}}):null]}),j?a.jsxs("div",{className:"cw-banner cw-a2a-space-error",role:"alert",children:[a.jsx(gm,{className:"cw-i"}),a.jsx("span",{children:j})]}):C?null:U.length===0?a.jsx("span",{className:"cw-help",children:g("traditional.model.empty")}):a.jsx("span",{className:"cw-help",children:g("traditional.model.loaded",{count:U.length,available:se})})]})}function pon({value:e,region:t,invalid:n,onChange:i}){const{t:r}=Te("create"),s=t.trim()||ow.region,[o,l]=p.useState([]),[c,u]=p.useState(!1),[d,f]=p.useState(null),[h,m]=p.useState(0),[g,b]=p.useState(!1),[v,y]=p.useState(""),w=p.useRef(null);p.useEffect(()=>{let T=!1;return u(!0),f(null),qan({region:s}).then(R=>{T||l(R)}).catch(R=>{T||(l([]),f(R instanceof Error?R.message:r("traditional.resources.loadError")))}).finally(()=>{T||u(!1)}),()=>{T=!0}},[s,h,r]);const x=!e||o.some(T=>T.id===e.trim()),O=o.find(T=>T.id===e.trim()),k=O?F6(O,r("traditional.resources.unnamedAgentCenter")):r(e&&!x?"traditional.resources.selectedAgentCenter":"traditional.resources.selectAgentCenter"),S=c&&o.length===0,C=p.useMemo(()=>o.filter(T=>Sg(v,[F6(T,r("traditional.resources.unnamedAgentCenter")),T.id,T.projectName])),[v,o,r]),E=!!(e&&!x&&Sg(v,[r("traditional.resources.selectedAgentCenter"),e]));p.useEffect(()=>{if(!g)return;const T=A=>{const N=A.target;N instanceof Node&&w.current&&!w.current.contains(N)&&b(!1)},R=A=>{A.key==="Escape"&&b(!1)};return window.addEventListener("pointerdown",T),window.addEventListener("keydown",R),()=>{window.removeEventListener("pointerdown",T),window.removeEventListener("keydown",R)}},[g]);const j=T=>{i(T),b(!1)};return a.jsxs("div",{className:`cw-a2a-space-picker${g?" is-open":""}`,ref:w,children:[a.jsxs("div",{className:"cw-a2a-space-row",children:[a.jsxs("div",{className:"cw-a2a-space-select-wrap",children:[a.jsxs("button",{type:"button",className:`cw-a2a-space-trigger ${n?"is-error":""}`,disabled:S,"aria-haspopup":"listbox","aria-expanded":g,"aria-label":r("traditional.resources.selectAgentKitCenter"),onClick:()=>{y(""),b(T=>!T)},children:[a.jsx("span",{className:e?void 0:"is-placeholder",children:k}),a.jsx($K,{className:"cw-a2a-space-trigger-icon"})]}),g&&a.jsxs("div",{className:"cw-a2a-space-menu",children:[a.jsx("div",{className:"cw-picker-search",children:a.jsx("input",{className:"cw-picker-search-input",type:"search",value:v,autoFocus:!0,autoComplete:"off","aria-label":r("traditional.resources.searchAgentKitCenter"),placeholder:r("traditional.resources.searchNameOrId"),onChange:T=>y(T.currentTarget.value)})}),a.jsxs("div",{className:"cw-picker-options",role:"listbox","aria-label":r("traditional.resources.agentKitCenter"),children:[E&&a.jsx("button",{type:"button",role:"option","aria-selected":!0,className:"cw-a2a-space-option is-selected",onClick:()=>j(e),children:r("traditional.resources.selectedAgentCenter")}),C.map(T=>{const R=F6(T,r("traditional.resources.unnamedAgentCenter")),A=T.id===e;return a.jsx("button",{type:"button",role:"option","aria-selected":A,className:`cw-a2a-space-option ${A?"is-selected":""}`,title:`${R} (${T.id})`,onClick:()=>j(T.id),children:R},T.id)}),!E&&C.length===0&&a.jsx("div",{className:"cw-picker-empty",children:r("traditional.resources.noMatchingAgentCenters")})]})]})]}),a.jsx("button",{type:"button",className:"cw-icon-btn cw-a2a-space-refresh",title:r("traditional.resources.refreshAgentCenters"),"aria-label":r("traditional.resources.refreshAgentCenters"),disabled:c,onClick:()=>m(T=>T+1),children:c?a.jsx(Bi,{className:"cw-i cw-i-sm cw-spin"}):a.jsx(FK,{className:"cw-i cw-i-sm"})})]}),d?a.jsxs("div",{className:"cw-banner cw-a2a-space-error",children:[a.jsx(gm,{className:"cw-i"}),a.jsx("span",{children:d})]}):c?a.jsxs("span",{className:"cw-help cw-a2a-space-status",children:[a.jsx(Bi,{className:"cw-i cw-i-sm cw-spin"}),r("traditional.resources.loadingAgentCenters")]}):o.length===0?a.jsx("span",{className:"cw-help",children:r("traditional.resources.noAgentCenters")}):a.jsx("span",{className:"cw-help",children:r("traditional.resources.agentCentersLoaded",{count:o.length})})]})}function oUe({value:e,items:t,loading:n,error:i,pickerClassName:r,selectLabel:s,searchLabel:o,listLabel:l,placeholder:c,emptyMessage:u,loadedMessage:d,refreshLabel:f,noMatchesMessage:h,getLabel:m,getSearchFields:g,getKey:b,getOptionIds:v,makeUnknownItem:y,onChange:w,onRefresh:x}){const{t:O}=Te("create"),[k,S]=p.useState(!1),[C,E]=p.useState(""),j=p.useRef(null),T=!e||t.some(_=>_.id===e.trim()),R=t.find(_=>_.id===e.trim()),A=R?m(R):e&&!T?e:c,N=n&&t.length===0,P=p.useMemo(()=>t.filter(_=>Sg(C,g(_))),[g,t,C]),I=!!(e&&!T&&Sg(C,[e]));p.useEffect(()=>{if(!k)return;const _=F=>{const M=F.target;M instanceof Node&&j.current&&!j.current.contains(M)&&S(!1)},L=F=>{F.key==="Escape"&&S(!1)};return window.addEventListener("pointerdown",_),window.addEventListener("keydown",L),()=>{window.removeEventListener("pointerdown",_),window.removeEventListener("keydown",L)}},[k]);const D=_=>{w(_),S(!1)};return n&&t.length===0?a.jsxs("span",{className:"cw-viking-kb-inline-status",role:"status",children:[a.jsx(Bi,{className:"cw-i cw-i-sm cw-spin"}),O("common.loading")]}):a.jsxs("div",{className:`cw-a2a-space-picker ${r}${k?" is-open":""}`,ref:j,children:[a.jsxs("div",{className:"cw-a2a-space-row",children:[a.jsxs("div",{className:"cw-a2a-space-select-wrap",children:[a.jsxs("button",{type:"button",className:"cw-a2a-space-trigger",disabled:N,"aria-haspopup":"listbox","aria-expanded":k,"aria-label":s,onClick:()=>{E(""),S(_=>!_)},children:[a.jsx("span",{className:e?void 0:"is-placeholder",children:A}),a.jsx($K,{className:"cw-a2a-space-trigger-icon"})]}),k&&a.jsxs("div",{className:"cw-a2a-space-menu cw-viking-kb-menu",children:[a.jsx("div",{className:"cw-picker-search",children:a.jsx("input",{className:"cw-picker-search-input",type:"search",value:C,autoFocus:!0,autoComplete:"off","aria-label":o,placeholder:O("traditional.resources.searchNameOrId"),onChange:_=>E(_.currentTarget.value)})}),a.jsxs("div",{className:"cw-picker-options",role:"listbox","aria-label":l,children:[I&&a.jsx("button",{type:"button",role:"option","aria-selected":!0,className:"cw-a2a-space-option is-selected",onClick:()=>D(y(e)),children:e}),P.map(_=>{const L=m(_),F=_.id===e,M=v(_).filter(Boolean).join(" / ");return a.jsx("button",{type:"button",role:"option","aria-selected":F,className:`cw-a2a-space-option ${F?"is-selected":""}`,title:M?`${L} (${M})`:L,onClick:()=>D(_),children:L},b(_))}),!I&&P.length===0&&a.jsx("div",{className:"cw-picker-empty",children:h})]})]})]}),a.jsx("button",{type:"button",className:"cw-icon-btn cw-a2a-space-refresh cw-viking-kb-refresh",title:f,"aria-label":f,disabled:n,onClick:x,children:n?a.jsx(Bi,{className:"cw-i cw-i-sm cw-spin"}):a.jsx(FK,{className:"cw-i cw-i-sm"})})]}),i?a.jsxs("div",{className:"cw-banner cw-a2a-space-error",children:[a.jsx(gm,{className:"cw-i"}),a.jsx("span",{children:i})]}):t.length===0?a.jsx("span",{className:"cw-help",children:u}):a.jsx("span",{className:"cw-help",children:d(t.length)})]})}function mon({value:e,onChange:t}){const{t:n}=Te("create"),[i,r]=p.useState([]),[s,o]=p.useState(!1),[l,c]=p.useState(null),[u,d]=p.useState(0);return p.useEffect(()=>{let f=!1;return o(!0),c(null),Kan().then(h=>{f||r(h)}).catch(h=>{f||(r([]),c(h instanceof Error?h.message:n("traditional.resources.loadError")))}).finally(()=>{f||o(!1)}),()=>{f=!0}},[u,n]),a.jsx(oUe,{value:e,items:i,loading:s,error:l,pickerClassName:"cw-viking-kb-picker",selectLabel:n("traditional.resources.selectKnowledgeBase"),searchLabel:n("traditional.resources.searchKnowledgeBase"),listLabel:n("traditional.resources.knowledgeBaseList"),placeholder:n("traditional.resources.knowledgeBasePlaceholder"),emptyMessage:n("traditional.resources.noKnowledgeBases"),loadedMessage:f=>n("traditional.resources.knowledgeBasesLoaded",{count:f}),refreshLabel:n("traditional.resources.refreshKnowledgeBases"),noMatchesMessage:n("traditional.resources.noMatchingKnowledgeBases"),getLabel:f=>Oce(f,n("traditional.resources.unnamedKnowledgeBase")),getSearchFields:f=>[Oce(f,n("traditional.resources.unnamedKnowledgeBase")),f.id,f.description,f.projectName,f.resourceId,f.agentkitKnowledgeId,f.providerKnowledgeId,f.sourceLabel],getKey:f=>f.id,getOptionIds:f=>[f.id,f.resourceId,f.agentkitKnowledgeId,f.providerKnowledgeId],makeUnknownItem:f=>({id:f,name:f,description:"",projectName:"",region:"",sourceKind:"knowledge",sourceLabel:"Knowledge Engine",resourceId:""}),onChange:t,onRefresh:()=>d(f=>f+1)})}function gon({value:e,onChange:t}){const{t:n}=Te("create"),[i,r]=p.useState([]),[s,o]=p.useState(!1),[l,c]=p.useState(null),[u,d]=p.useState(0);return p.useEffect(()=>{let f=!1;return o(!0),c(null),Xan().then(h=>{f||r(h)}).catch(h=>{f||(r([]),c(h instanceof Error?h.message:n("traditional.resources.loadError")))}).finally(()=>{f||o(!1)}),()=>{f=!0}},[u,n]),a.jsx(oUe,{value:e,items:i,loading:s,error:l,pickerClassName:"cw-viking-memory-picker",selectLabel:n("traditional.resources.selectMemory"),searchLabel:n("traditional.resources.searchMemory"),listLabel:n("traditional.resources.memoryList"),placeholder:n("traditional.resources.memoryPlaceholder"),emptyMessage:n("traditional.resources.noMemories"),loadedMessage:f=>n("traditional.resources.memoriesLoaded",{count:f}),refreshLabel:n("traditional.resources.refreshMemories"),noMatchesMessage:n("traditional.resources.noMatchingMemories"),getLabel:f=>kce(f,n("traditional.resources.unnamedMemory")),getSearchFields:f=>[kce(f,n("traditional.resources.unnamedMemory")),f.id,f.description,f.projectName,f.region,f.resourceId,...f.memoryTypes??[]],getKey:f=>`${f.projectName}:${f.region}:${f.id}`,getOptionIds:f=>[f.id,f.resourceId],makeUnknownItem:f=>({id:f,name:f,description:"",projectName:"",region:"",resourceId:"",memoryTypes:[]}),onChange:t,onRefresh:()=>d(f=>f+1)})}function bon({hidden:e}){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e?a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"M3 3l18 18"}),a.jsx("path",{d:"M9.7 6.95A9.7 9.7 0 0 1 12 6.68c5.9 0 9.25 5.32 9.25 5.32a16 16 0 0 1-2.28 2.85"}),a.jsx("path",{d:"M14.35 14.55A3.25 3.25 0 0 1 9.5 10.2"}),a.jsx("path",{d:"M6.25 8.12A16.4 16.4 0 0 0 2.75 12S6.1 17.32 12 17.32c.8 0 1.55-.1 2.25-.27"})]}):a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"M2.75 12s3.35-5.25 9.25-5.25S21.25 12 21.25 12 17.9 17.25 12 17.25 2.75 12 2.75 12Z"}),a.jsx("circle",{cx:"12",cy:"12",r:"2.5"})]})})}function yon({tools:e,conflict:t,showConflict:n,onChange:i}){const{t:r}=Te("create"),s=p.useId(),[o,l]=p.useState(null),c=n?t:null,u=(h,m)=>i(e.map((g,b)=>b===h?{...g,...m}:g)),d=h=>{l(m=>m==null||mg!==h))},f=()=>i([...e,{name:"",transport:"http",url:""}]);return a.jsxs("div",{className:"cw-mcp",children:[e.length>0&&a.jsx("div",{className:"cw-mcp-list",children:a.jsx(hf,{initial:!1,children:e.map((h,m)=>a.jsxs(Ar.div,{className:"cw-mcp-row",layout:!0,initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{duration:.16},children:[a.jsxs("div",{className:"cw-mcp-rowhead",children:[a.jsxs("div",{className:"cw-mcp-transport",children:[a.jsx("button",{type:"button",className:`cw-seg cw-seg-sm ${h.transport==="http"?"is-on":""}`,onClick:()=>u(m,{transport:"http"}),"aria-pressed":h.transport==="http",children:a.jsx("span",{className:"cw-seg-title",children:"HTTP"})}),a.jsx("button",{type:"button",className:`cw-seg cw-seg-sm ${h.transport==="stdio"?"is-on":""}`,onClick:()=>u(m,{transport:"stdio"}),"aria-pressed":h.transport==="stdio",children:a.jsx("span",{className:"cw-seg-title",children:"stdio"})})]}),a.jsx("button",{type:"button",className:"cw-icon-btn cw-icon-danger",onClick:()=>d(m),"aria-label":r("traditional.mcp.removeTool"),children:a.jsx(eb,{className:"cw-i cw-i-sm"})})]}),a.jsx("input",{className:"cw-input","data-validation-field":"mcp-name","aria-invalid":c==="duplicateName","aria-describedby":c==="duplicateName"?s:void 0,value:h.name,placeholder:r("traditional.mcp.namePlaceholder"),onChange:g=>u(m,{name:g.target.value})}),h.transport==="http"?a.jsxs(a.Fragment,{children:[a.jsx("input",{className:"cw-input","data-validation-field":"mcp-url","aria-invalid":c==="duplicateUrl","aria-describedby":c==="duplicateUrl"?s:void 0,value:h.url??"",placeholder:r("traditional.mcp.urlPlaceholder"),onChange:g=>i(e.map((b,v)=>v===m?Can(b,g.target.value):b))}),Ean(h.url??"")&&a.jsxs("p",{className:"cw-mcp-warning",children:[a.jsx(gm,{"aria-hidden":"true"}),a.jsx("span",{children:r("traditional.mcp.pathWarning")})]}),a.jsxs("div",{className:"cw-mcp-token-field",children:[a.jsx("input",{className:"cw-input",type:o===m?"text":"password",value:kan(h),placeholder:r("traditional.mcp.tokenPlaceholder"),autoComplete:"new-password",spellCheck:!1,onChange:g=>i(e.map((b,v)=>v===m?San(b,g.target.value):b))}),a.jsx("button",{type:"button",className:"cw-mcp-token-toggle","aria-label":r(o===m?"traditional.mcp.hideToken":"traditional.mcp.showToken"),title:r(o===m?"traditional.mcp.hideToken":"traditional.mcp.showToken"),"aria-pressed":o===m,onClick:()=>l(g=>g===m?null:m),children:a.jsx(bon,{hidden:o!==m})})]})]}):a.jsxs(a.Fragment,{children:[a.jsx("input",{className:"cw-input",value:h.command??"",placeholder:r("traditional.mcp.commandPlaceholder"),onChange:g=>u(m,{command:g.target.value})}),a.jsx("input",{className:"cw-input",value:(h.args??[]).join(" "),placeholder:r("traditional.mcp.argsPlaceholder"),onChange:g=>u(m,{args:g.target.value.split(/\s+/).filter(Boolean)})}),a.jsx("p",{className:"cw-mcp-note",children:r("traditional.mcp.stdioHint")})]})]},m))})}),c&&a.jsx("p",{className:"cw-error-text",id:s,role:"alert",children:r(c==="duplicateName"?"traditional.validation.mcpDuplicateName":"traditional.validation.mcpDuplicateUrl")}),a.jsxs("button",{type:"button",className:"cw-add-sub",onClick:f,children:[a.jsx(sc,{className:"cw-i"}),r("traditional.mcp.addTool")]})]})}function jj({checked:e,onChange:t,title:n,desc:i,showDescription:r=!1}){return a.jsxs("button",{type:"button",className:`cw-toggle ${e?"is-on":""}`,onClick:()=>t(!e),"aria-pressed":e,children:[a.jsxs("span",{className:"cw-toggle-text",children:[a.jsx("span",{className:"cw-toggle-title",children:n}),r&&a.jsx("span",{className:"cw-toggle-help",children:i})]}),a.jsx("span",{className:"cw-switch","aria-hidden":!0,children:a.jsx(Ar.span,{className:"cw-switch-knob",layout:!0,transition:{type:"spring",stiffness:520,damping:34}})})]})}function von(e,t){var i;let n=e;for(const r of t)if(n=(i=n.subAgents)==null?void 0:i[r],!n)return!1;return!0}function Nj(e,t){let n=e;for(const i of t)n=n.subAgents[i];return n}function WT(e,t,n){if(t.length===0)return n(e);const[i,...r]=t,s=e.subAgents.slice();return s[i]=WT(s[i],r,n),{...e,subAgents:s}}function xon(e,t,n="volcengine"){return WT(e,t,i=>({...i,subAgents:[...i.subAgents,Od(n)]}))}function won(e,t,n,i="volcengine"){return WT(e,t,r=>{const s=r.subAgents.slice();return s.splice(n,0,Od(i)),{...r,subAgents:s}})}function Oon(e,t){if(t.length===0)return e;const n=t.slice(0,-1),i=t[t.length-1];return WT(e,n,r=>({...r,subAgents:r.subAgents.filter((s,o)=>o!==i)}))}const BP=e=>!BL(e.agentType),Cce=3;function kon(e,t,n=!1){var r;if(BL(e.agentType))return n?"remoteRoot":(r=e.a2aRegistry)!=null&&r.registrySpaceId.trim()?null:"missingRegistry";const i=zT(e.name,s=>`name.${s}`);return i||(t.has(e.name)?"duplicateName":e.description.trim().length===0?"missingDescription":M7e(e.agentType)?e.subAgents.length===0?"missingSubagent":null:e.instruction.trim().length===0?"missingPrompt":null)}function lUe(e,t,n=[]){const i=[];if(n.length===0){const o=J7e(e);o&&i.push({path:n,name:e.name.trim(),agentType:e.agentType,problem:o==="duplicateName"?"mcpDuplicateName":"mcpDuplicateUrl"})}const r=BL(e.agentType),s=kon(e,t,n.length===0);return s&&i.push({path:n,name:r?"":e.name.trim(),agentType:e.agentType,problem:s}),BP(e)&&e.subAgents.forEach((o,l)=>i.push(...lUe(o,t,[...n,l]))),i}function Son(e,t){return t("traditional.validation.missingSubagentDetail",{type:t(`traditional.agentTypes.${e.agentType??"llm"}.fullLabel`)})}function cUe(e,t,n=[]){if((e.agentType===void 0||e.agentType==="llm")&&um(e,t)==="ark")return n;if(!BP(e))return null;for(let r=0;rt+uUe(n),0)}function fU(e,t=!1){const n=SO(e),i=bI(n.draft).includes("mcp_resilience"),r=[],s={...n.envValues},o=n.draft.cloudProvider??"volcengine",l=dmt(n.draft).map(kN);let c=!1,u="";for(const h of $L(n.draft,Do(o))){const m=[{key:h.apiKeyKey,required:!0,comment:h.label}];h.providerKey&&(m.push({key:h.providerKey,required:!0}),s[h.providerKey]=h.provider),h.apiBaseKey&&(m.push({key:h.apiBaseKey,required:!0}),s[h.apiBaseKey]=h.apiBase),r.push({env:m})}const d=h=>{var m,g,b,v;h.agentType==="llm"&&um(h,o)==="ark"&&(c=!0,u||(u=(h.modelName??"").trim()));for(const y of h.builtinTools??[]){const w=JA.find(x=>x.id===y);w&&r.push({env:hx(w.env,o)})}for(const y of h.mcpTools??[])y.authTokenEnv&&r.push({env:[{key:y.authTokenEnv,required:!1,comment:`${y.name.trim()||"MCP"} Bearer Token`,secret:!0,readOnly:i,serverManaged:i,hidden:i}]});if((m=h.a2aRegistry)!=null&&m.enabled&&(r.push({env:hx(jIe,o)}),Object.assign(s,aUe(h.a2aRegistry,{includeDefaults:!0},o))),h.memory.shortTerm&&r.push({env:hx(((g=lw.find(y=>y.id===(h.shortTermBackend??"local")))==null?void 0:g.env)??[],o)}),h.memory.longTerm&&r.push({env:hx(((b=_B.find(y=>y.id===(h.longTermBackend??"local")))==null?void 0:b.env)??[],o)}),h.knowledgebase&&r.push({env:hx(((v=jB.find(y=>y.id===(h.knowledgebaseBackend??Mg)))==null?void 0:v.env)??[],o)}),h.tracing)for(const y of h.tracingExporters??[]){const w=nmt.find(x=>x.id===y);w&&r.push({env:w.env,enableFlag:w.enableFlag})}h.subAgents.forEach(d)};if(d(n.draft),c){r.push({env:[{key:"MODEL_AGENT_PROVIDER",required:!0},{key:"MODEL_AGENT_API_BASE",required:!0},{key:"MODEL_AGENT_API_KEY",required:!0,comment:"Ark API Key",placeholder:Xt("helpers.deploymentEnv.selectedApiKeyPlaceholder"),secret:!0,readOnly:!0,serverManaged:!0,requiredBy:l}]}),s.MODEL_AGENT_PROVIDER="openai",s.MODEL_AGENT_API_BASE=Do(o);const h=u||Xp(o);s.MODEL_AGENT_NAME=h,s.MODEL_NAME=h}if(i){if(t){r.push({env:[{key:"MCP_SERVERS_JSON",required:!0,comment:Xt("helpers.deploymentEnv.mcpInjectedComment"),placeholder:Xt("helpers.deploymentEnv.restoredPlaceholder"),help:Xt("helpers.deploymentEnv.restoredHelp"),readOnly:!0,serverManaged:!0,hidden:!0,requiredBy:[kN("mcp_resilience")]}]});const g=oU(r);return{specs:g.specs,fixedValues:{...g.fixedValues,...s}}}const h=Pan(n.draft),m=h.ok?void 0:h.message;r.push({env:[{key:"MCP_SERVERS_JSON",required:!0,comment:Xt("helpers.deploymentEnv.mcpInjectedComment"),placeholder:Xt(t?"helpers.deploymentEnv.restoredPlaceholder":"helpers.deploymentEnv.generatedMcpPlaceholder"),help:Xt("helpers.deploymentEnv.mergedMcpHelp"),secret:!0,readOnly:!0,serverManaged:h.ok,hidden:!0,requiredBy:[kN("mcp_resilience")],missingError:m}]})}const f=oU(r);return{specs:f.specs,fixedValues:{...f.fixedValues,...s}}}function dUe(e,t){var i;if(e.id==="baseline")return t("traditional.debug.baseline");const n=(i=/^variant-(\d+)$/.exec(e.id))==null?void 0:i[1];return n?t("traditional.debug.comparison",{count:Number(n)}):e.name}function Eon(e,t){const n=i=>(i??"").trim().replace(/\/+$/,"");return n(e)===n(t)}function Con(e,t,n){if(e===""&&t===n)return!1;const i=(e??"").trim();return!i||i===Xp(t)?!0:i===Xp(n)?!1:n==="byteplus"&&i.includes("doubao-")}function ky(e,t){const n=e.cloudProvider??"volcengine",i=um(e,n),r=e.subAgents.map(u=>ky(u,t)),s=i==="ark"&&Con(e.modelName,n,t)?Xp(t):e.modelName,l=Eon(e.modelApiBase,Do(n))||t==="byteplus"&&(e.modelApiBase??"").includes("volces.com")?Do(t):e.modelApiBase;return e.cloudProvider!==t||s!==e.modelName||l!==e.modelApiBase||r.some((u,d)=>u!==e.subAgents[d])?{...e,cloudProvider:t,modelName:s,modelApiBase:l,subAgents:r}:e}function Aon(e,t){var l;const n=ky(e,t),i=NK(n,Do(t)),r=new Set(i.map(({key:c})=>c)),s=((l=n.deployment)==null?void 0:l.envValues)??{},o=Object.fromEntries(Object.entries(s).filter(([c,u])=>r.has(c)&&!!u.trim()));return Object.keys(o).length===0?{draft:n,customModelSecretValues:o}:{draft:{...n,deployment:{...n.deployment??{feishuEnabled:!1},envValues:Object.fromEntries(Object.entries(s).filter(([c])=>!r.has(c)))}},customModelSecretValues:o}}function SS(e){var i,r,s;const t=SO(e).draft;return{...N7e(t,t.cloudProvider??"volcengine"),deployment:{feishuEnabled:!!((i=e.deployment)!=null&&i.feishuEnabled),modelApiKeyId:((r=e.deployment)==null?void 0:r.modelApiKeyId)??"",modelApiKeyName:((s=e.deployment)==null?void 0:s.modelApiKeyName)??""}}}function hU(e){var n;const t=(n=e.modelName)==null?void 0:n.trim();if(t)return t;for(const i of e.subAgents){const r=hU(i);if(r)return r}return""}function fUe(e,t={}){var r,s,o,l;const n=fU(e),i={...((r=e.deployment)==null?void 0:r.envValues)??{},...t,...n.fixedValues};return{...SS(e),deployment:{feishuEnabled:!!((s=e.deployment)!=null&&s.feishuEnabled),modelApiKeyId:((o=e.deployment)==null?void 0:o.modelApiKeyId)??"",modelApiKeyName:((l=e.deployment)==null?void 0:l.modelApiKeyName)??"",envValues:Object.fromEntries(rsn(n.specs,i,SO(e).envValues).map(({key:c,value:u})=>[c,u]))}}}function Ton(e,t){const n=new Set;for(const i of $L(e,Do(t)))for(const r of[i.providerKey,i.apiBaseKey,i.apiKeyKey])r&&n.add(r);return n}function _on(e,t,n){const i=Ton(e,t);return(n??[]).filter(({key:r,value:s})=>i.has(r)&&s.trim())}function jon(e,t={}){return JSON.stringify(fUe(e,t))}function UP(e,t){return JSON.stringify({draftSnapshot:e,modelName:t.modelName,description:t.description,instruction:t.instruction})}function Vx(e){return JSON.stringify({modelName:e.modelName.trim(),description:e.description.trim(),instruction:e.instruction.trim()})}function Non({enabled:e,disabledReason:t,variants:n,draftSnapshot:i,input:r,onInput:s,onSend:o,onStartVariant:l,onUseVariant:c,onAddVariant:u,onRemoveVariant:d,onToggleConfig:f,onCompleteConfig:h,onConfigChange:m,onOpenTrace:g}){const{t:b}=Te("create"),v=n.filter(x=>x.phase!=="ready"?!1:x.runtimeSnapshot===UP(i,x)),y=n.some(x=>x.phase==="sending"),w=v.length>0&&!y;return a.jsxs("section",{className:"cw-ab-workspace","aria-label":b("traditional.debug.ariaLabel"),children:[a.jsx("div",{className:"cw-ab-stage",children:e?a.jsx("div",{className:"cw-ab-grid",style:{"--cw-ab-column-count":n.length},children:n.map((x,O)=>{const k=dUe(x,b),S=x.modelName.trim(),C=x.description.trim(),E=x.instruction.trim(),j=Vx(x),T=!!(S&&C&&E&&n.findIndex(M=>Vx(M)===j)!==O),R=!S||!C||!E||T,A=!!(x.runtimeSnapshot&&x.runtimeSnapshot!==UP(i,x)),N=x.phase==="starting",P=x.phase==="ready"&&!A,I=N||x.phase==="sending",D=P&&x.phase!=="sending"&&x.messages.some(M=>M.role==="assistant"),_=I||x.configOpen||R,L=S?C?E?T?b("traditional.debug.duplicateConfiguration"):"":b("traditional.debug.enterPrompt"):b("traditional.debug.enterDescription"):b("traditional.debug.selectModel"),F=N?b("traditional.debug.starting"):A?b("traditional.debug.applyAndRestart"):P||x.phase==="error"?b("traditional.debug.restart"):b("traditional.debug.start");return a.jsx("article",{className:"cw-ab-card",children:a.jsxs("div",{className:`cw-ab-card-inner${x.configOpen?" is-flipped":""}`,children:[a.jsxs("section",{className:"cw-ab-card-face cw-ab-card-front","aria-hidden":x.configOpen,inert:x.configOpen,children:[a.jsxs("header",{className:"cw-ab-card-head",children:[a.jsxs("div",{className:"cw-ab-card-title",children:[a.jsx("strong",{children:k}),a.jsx("span",{children:x.modelName||b("traditional.debug.defaultModel")})]}),a.jsxs("div",{className:"cw-ab-card-actions",children:[a.jsx("button",{type:"button",className:"cw-ab-config-trigger",disabled:x.configOpen||I,onClick:()=>f(x.id),children:b("traditional.debug.testConfiguration")}),x.id!=="baseline"&&a.jsx("button",{type:"button",className:"cw-ab-remove","aria-label":b("traditional.debug.deleteVariant",{name:k}),disabled:x.configOpen||I,onClick:()=>d(x.id),children:a.jsx(xce,{className:"cw-i"})})]})]}),a.jsx("div",{className:"cw-ab-conversation",children:x.error?a.jsx(wb,{message:x.error,className:"cw-debug-error-detail",defaultExpanded:!0}):N?a.jsxs("div",{className:"cw-ab-empty cw-ab-starting",children:[a.jsx(Bi,{className:"cw-i cw-spin"}),a.jsx("span",{children:b("traditional.debug.creatingEnvironment")})]}):A?a.jsx("div",{className:"cw-ab-empty cw-ab-launch",children:a.jsx("span",{children:b("traditional.debug.configurationChanged")})}):x.messages.length===0?a.jsx("div",{className:"cw-ab-empty cw-ab-launch",children:P?a.jsxs(a.Fragment,{children:[a.jsx("strong",{className:"cw-ab-ready-title",children:b("traditional.debug.ready")}),a.jsx("span",{className:"cw-ab-launch-hint",children:b("traditional.debug.readyHint")})]}):a.jsx("span",{className:"cw-ab-launch-hint",children:L||b("traditional.debug.startHint")})}):x.messages.map((M,z)=>a.jsx("div",{className:`cw-debug-msg cw-debug-msg-${M.role}`,children:a.jsx("div",{className:"cw-debug-content",children:M.role==="user"?M.content:M.error?a.jsx(wb,{message:M.error,className:"cw-debug-msg-error",defaultExpanded:!0}):M.blocks&&M.blocks.length>0?a.jsx(m0,{blocks:M.blocks,onAction:()=>{}}):M.content?M.content:z===x.messages.length-1&&x.phase==="sending"?a.jsx(XLe,{}):null})},z))}),a.jsxs("footer",{className:"cw-ab-deploy-footer",children:[a.jsx("button",{type:"button",className:"cw-ab-trace",disabled:!D,title:D?b("traditional.debug.viewTraceNamed",{name:k}):b("traditional.debug.traceUnavailable"),onClick:()=>g(x.id),children:b("traditional.debug.trace")}),a.jsxs("button",{type:"button",className:"cw-ab-start cw-ab-footer-start",disabled:_,title:L||void 0,onClick:()=>l(x.id),children:[P||A||x.phase==="error"?a.jsx(Wat,{className:"cw-i"}):a.jsx(oon,{className:"cw-i cw-debug-run-icon"}),F]}),a.jsx("button",{type:"button",className:"cw-ab-deploy",disabled:I||!S,onClick:()=>c(x.id),children:b("traditional.debug.useConfiguration")})]})]}),a.jsxs("section",{className:"cw-ab-card-face cw-ab-card-back","aria-hidden":!x.configOpen,inert:!x.configOpen,children:[a.jsxs("header",{className:"cw-ab-config-head",children:[a.jsxs("div",{children:[a.jsx("strong",{children:b("traditional.debug.testConfiguration")}),a.jsx("span",{children:k})]}),a.jsxs("div",{className:"cw-ab-config-head-actions",children:[x.id!=="baseline"&&a.jsx("button",{type:"button",className:"cw-icon-btn cw-icon-danger cw-ab-config-remove","aria-label":b("traditional.debug.deleteVariant",{name:k}),title:b("traditional.debug.deleteVariantGroup"),disabled:I,onClick:()=>d(x.id),children:a.jsx(xce,{className:"cw-i cw-i-sm"})}),a.jsxs("span",{className:`cw-ab-config-done-wrap${L?" is-disabled":""}`,tabIndex:L?0:void 0,children:[a.jsx("button",{type:"button",className:"cw-ab-config-done",disabled:!x.configOpen||R,onClick:()=>h(x.id),children:x.id==="baseline"?b("traditional.debug.finishConfiguration"):b("traditional.debug.finishAndStart")}),L&&a.jsx("span",{className:"cw-ab-config-done-tip",role:"tooltip",children:L})]})]})]}),a.jsxs("div",{className:"cw-ab-config",children:[a.jsxs("label",{children:[a.jsx("span",{children:b("traditional.model.label")}),a.jsx("input",{value:x.modelName,placeholder:b("traditional.debug.currentAgentModel"),disabled:!x.configOpen,onChange:M=>m(x.id,"modelName",M.target.value)})]}),a.jsxs("label",{children:[a.jsx("span",{children:b("common.description")}),a.jsx("textarea",{rows:2,value:x.description,disabled:!x.configOpen,onChange:M=>m(x.id,"description",M.target.value)})]}),a.jsxs("label",{children:[a.jsx("span",{children:b("traditional.basic.systemPrompt")}),a.jsx("textarea",{rows:5,value:x.instruction,disabled:!x.configOpen,onChange:M=>m(x.id,"instruction",M.target.value)})]}),a.jsx("p",{children:b("traditional.debug.configurationHint")})]})]})]})},x.id)})}):a.jsx("div",{className:"cw-debug-empty",children:t})}),a.jsxs("div",{className:"cw-ab-composer",children:[a.jsxs("div",{className:"cw-debug-composerbox",children:[a.jsx("textarea",{className:"cw-debug-input",rows:1,value:r,placeholder:b(w?"traditional.debug.messagePlaceholder":"traditional.debug.startOneFirst"),disabled:!w,onChange:x=>s(x.target.value),onKeyDown:x=>{HT(x.nativeEvent)||x.key==="Enter"&&!x.shiftKey&&(x.preventDefault(),o())}}),a.jsx("button",{type:"button",className:"cw-debug-send",title:b("common.send"),disabled:!w||!r.trim(),onClick:o,children:y?a.jsx(Bi,{className:"cw-i cw-spin"}):a.jsx(wat,{className:"cw-i"})})]}),e&&n.length<3&&a.jsxs("button",{type:"button",className:"cw-btn cw-btn-soft cw-ab-add",onClick:u,children:[a.jsx(sc,{className:"cw-i"}),b("traditional.debug.addVariant")]})]})]})}function Ron({profile:e,optimizations:t,onProfileChange:n,onOptimizationChange:i}){const{t:r}=Te("create");return a.jsx("section",{className:"cw-optimize-workspace","aria-label":r("traditional.optimization.ariaLabel"),children:a.jsxs("div",{className:"cw-optimize-panel",children:[a.jsxs("fieldset",{className:"cw-optimize-section",children:[a.jsx("legend",{children:r("traditional.optimization.scenario")}),a.jsx(Ly,{className:"cw-optimize-profile-options","aria-label":r("traditional.optimization.scenario"),value:e,onChange:n,children:lH.map(s=>a.jsx("div",{className:`cw-optimize-profile-option${e===s.id?" is-on":""}`,children:a.jsx(Ly.Item,{value:s.id,block:!0,className:"cw-optimize-profile-control",children:a.jsxs("span",{className:"cw-optimize-profile-copy",children:[a.jsx("strong",{children:r(`traditional.optimization.profiles.${s.id}.label`)}),a.jsx("small",{children:r(`traditional.optimization.profiles.${s.id}.description`)})]})})},s.id))})]}),a.jsxs("fieldset",{className:"cw-optimize-section",children:[a.jsx("legend",{children:r("traditional.optimization.components")}),a.jsx("div",{className:"cw-optimize-option-list",children:imt.map(s=>a.jsxs("section",{className:"cw-optimize-option-group","aria-labelledby":`cw-optimize-group-${s.id}`,children:[a.jsx("h3",{id:`cw-optimize-group-${s.id}`,className:"cw-optimize-option-group-title",children:r(`traditional.optimization.groups.${s.id}`)}),a.jsx("div",{className:"cw-optimize-option-group-items",children:s.componentIds.map(o=>{const l=oH.find(u=>u.id===o);if(!l)return null;const c=t.includes(l.id);return a.jsx(DK,{checked:c,onCheckedChange:u=>{const d=!!u;d!==c&&i(l.id,d)},label:a.jsxs("span",{className:"cw-optimize-option-copy",children:[a.jsx("strong",{children:r(`traditional.optimization.options.${l.id}.label`)}),a.jsx("small",{children:r(`traditional.optimization.options.${l.id}.description`)})]}),className:"cw-optimize-option"},l.id)})})]},s.id))})]})]})})}const Rj=[{id:"build",label:"traditional.workspace.modes.build"},{id:"validate",label:"traditional.workspace.modes.validate"},{id:"optimize",label:"traditional.workspace.modes.optimize"},{id:"environment",label:"traditional.workspace.modes.environment"},{id:"publish",label:"traditional.workspace.modes.publish"}],Ion={build:"traditional.workspace.titles.build",validate:"traditional.workspace.titles.validate",optimize:"traditional.workspace.titles.optimize",environment:"traditional.workspace.titles.environment",publish:"traditional.workspace.titles.publish"};function Pon({mode:e}){const{t}=Te("create");return a.jsx("header",{className:"cw-workspace-header",children:a.jsx("h1",{children:t(Ion[e])})})}function Don({mode:e,busy:t,nextDisabled:n,onChange:i,assistant:r,accessory:s}){const{t:o}=Te("create"),l=Rj.findIndex(d=>d.id===e),c=Rj[l-1],u=Rj[l+1];return a.jsxs("footer",{className:"cw-workspace-footer",children:[s?a.jsx("div",{className:"cw-workspace-footer-accessory",children:s}):null,a.jsxs("div",{className:`cw-workspace-nav-actions${r?" has-assistant":""}`,children:[a.jsx("button",{type:"button",className:`cw-workspace-nav-button${e==="build"?" is-placeholder":""}`,"aria-hidden":e==="build"||void 0,tabIndex:e==="build"?-1:0,disabled:!c||t,onClick:()=>c&&i(c.id),children:o("common.previous")}),a.jsx("span",{"aria-hidden":"true"}),r?a.jsx("div",{className:"cw-workspace-ai-slot",children:r}):null,e==="publish"?a.jsx("div",{id:"cw-publish-primary-action",className:"cw-publish-action-slot"}):a.jsx("button",{type:"button",className:"cw-workspace-nav-button is-primary",disabled:!u||t||n,onClick:()=>u&&i(u.id),children:o("common.next")})]}),a.jsx("nav",{className:"cw-workspace-progress","aria-label":o("traditional.workspace.progress"),children:Rj.map((d,f)=>{const h=d.id===e;return a.jsx("button",{type:"button",className:`${h?"is-active":""}${fi(d.id),children:a.jsx("span",{"aria-hidden":"true"})},d.id)})})]})}function Mon({onBack:e,onCreate:t,onAgentAdded:n,initialDraft:i,features:r,onDeploymentTaskChange:s,createMode:o="custom",freshCreationSurface:l="traditional",workspaceDraftId:c,deploymentTarget:u,cloudProvider:d="volcengine",initialDeployRegion:f=Zi(d),onDeploymentComplete:h,onDeploymentStarted:m,onDraftChange:g,onDiscard:b}){var Fd,Ul,Vo,Ql,Kc,vo,ra,io,Re,ot,$t,Dn,On,mn,jn,Wt,bn,Mn,ai,ss,re,zn,bi,Fa;const{t:v}=Te("create"),y=o==="custom"&&l==="vulcan",w=y&&!i,[x]=p.useState(()=>{const oe=i??Od(d),$e=w?{...oe,name:oe.name.trim()?oe.name:"assistant",dynamicAgentDelegation:!0}:oe;return Aon($e,d)}),[O,k]=p.useState(x.draft),S=y,[C,E]=p.useState(x.customModelSecretValues),j=(u==null?void 0:u.configuredRuntimeEnvKeys)??[],T=p.useMemo(()=>new Set(j),[j]),R=((Fd=O.deployment)==null?void 0:Fd.runtimeName)??"",A=u?u.name:ZXt(O.name,R,(Ul=O.deployment)==null?void 0:Ul.runtimeNameCustomized),N=C,P=p.useCallback((oe,$e)=>{E(st=>{const Ye={...st};return $e?Ye[oe]=$e:delete Ye[oe],Ye})},[]);p.useEffect(()=>{k(oe=>ky(oe,d))},[d]);const[I,D]=p.useState(""),[_,L]=p.useState(!1),[F,M]=p.useState(!1),[z,q]=p.useState(!1),[U,J]=p.useState(null),V=I.trim(),Z=V.length>0&&V.length{se.current=g},[g]),p.useEffect(()=>{var oe;G!==W.current&&(W.current=G,(oe=se.current)==null||oe.call(se,ky(O,d),H))},[d,O,H,G]);const[Y,X]=p.useState("build"),[ie,ee]=p.useState(!1),[be,ue]=p.useState(()=>new Set),[pe,ke]=p.useState(0),[je,Pe]=p.useState(null),[Ee,Qe]=p.useState(!1),[_e,ae]=p.useState((u==null?void 0:u.region)??f),le=(r==null?void 0:r.generatedAgentTestRun)===!0,ge=(r==null?void 0:r.generatedAgentTestRunDisabledReason)||v("traditional.debug.unavailable"),[Oe,Se]=p.useState(()=>{const oe=ky(i??Od(d),d);return[{id:"baseline",name:v("traditional.debug.baseline"),modelName:hU(oe),description:oe.description,instruction:oe.instruction,configOpen:!1,phase:"idle",runtimeSnapshot:"",messages:[],error:null}]}),[qe,Xe]=p.useState("baseline"),ye=p.useRef(1),we=p.useRef(!1),Ae=p.useRef(new Map),[Ve,Be]=p.useState(0),[_t,Pt]=p.useState(""),[Kt,Et]=p.useState(null),[vt,tt]=p.useState(!1),[mt,Ne]=p.useState(!1),wt=p.useRef(null),[jt,Yt]=p.useState(""),[wn,We]=p.useState(!1),[kt,He]=p.useState(null),[nt,et]=p.useState(""),[ft,St]=p.useState(!1),[Ct,It]=p.useState(!1),[Gt,Ge]=p.useState([]),xt=p.useRef(null),yt=p.useRef({});async function nn(){const oe=new Set([...Ae.current.values()].map(({run:st})=>st.runId)),$e=LK().filter(st=>!oe.has(st));$e.length&&await Promise.all($e.map(async st=>{try{await nx(st),Lk(st)}catch(Ye){console.warn("Failed to clean up stale debug run",Ye)}}))}p.useEffect(()=>(nn(),()=>{for(const{run:oe}of Ae.current.values())nx(oe.runId).then(()=>Lk(oe.runId)).catch($e=>console.warn("Failed to clean up debug run",$e));Ae.current.clear()}),[]),p.useEffect(()=>()=>{var oe;(oe=wt.current)==null||oe.call(wt,!1),wt.current=null},[]);const Qt=p.useRef(null);Qt.current||(Qt.current=({meta:oe,children:$e})=>a.jsxs("section",{ref:st=>{yt.current[oe.id]=st},id:`cw-sec-${oe.id}`,"data-step-id":oe.id,className:"cw-section",children:[a.jsx("header",{className:"cw-sec-head",children:a.jsx("h2",{className:"cw-sec-title",children:v(oe.label)})}),a.jsx("div",{className:"cw-sec-body",children:$e})]}));const cn=von(O,Gt)?Gt:[],Me=Nj(O,cn),on=cn.length===0,kn=cn.join(".")||"root",Sn=()=>{ue(oe=>oe.has(kn)?oe:new Set(oe).add(kn))},zi=`cw-a2a-registry-advanced-${cn.join("-")||"root"}`,un=oe=>k($e=>WT($e,cn,st=>({...st,...oe}))),or=oe=>k($e=>{var st;return{...$e,deployment:{...$e.deployment??{feishuEnabled:!1},envValues:{...((st=$e.deployment)==null?void 0:st.envValues)??{},...oe}}}}),Pn=(oe,$e)=>or({[oe]:$e}),ei=oe=>un({a2aRegistry:{...Me.a2aRegistry??{enabled:!1,registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},...oe}}),Fn=(oe,$e)=>{if(!(oe in wce))return;const st=wce[oe];ei({[st]:$e}),Pn(oe,$e)},Si=oe=>{if(!(on&&oe==="a2a")){if(oe==="a2a"){un({agentType:oe,a2aRegistry:{...Me.a2aRegistry??{registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},enabled:!0}});return}un({agentType:oe,a2aRegistry:Me.a2aRegistry?{...Me.a2aRegistry,enabled:!1}:void 0})}},Qn=(oe,$e)=>{k(oe),$e&&Ge($e)},Rn=async()=>{const oe=I.trim();if(!(!oe||_)&&!(oe.length{const $e=Nj(O,oe);if(!BP($e)||oe.length>=Cce)return;const st=xon(O,oe,d),Ye=Nj(st,oe).subAgents.length-1;Qn(st,[...oe,Ye])},rt=(oe,$e)=>{const st=Nj(O,oe);if(!BP(st)||oe.length>=Cce)return;const Ye=Math.max(0,Math.min($e,st.subAgents.length)),de=won(O,oe,Ye,d);Qn(de,[...oe,Ye])},zt=()=>{window.confirm(v("traditional.actions.clearRootConfirmation"))&&(k(Od(d)),Ge([]),ee(!1))},Ue=oe=>{if(oe.length===0){zt();return}Qn(Oon(O,oe),oe.slice(0,-1))},bt=Me.builtinTools??[],Ht=p.useMemo(()=>NIe(d),[d]),_n=p.useMemo(()=>new Set(Ht.map(oe=>oe.id)),[Ht]),Nr=Me.mcpTools??[],qs=on?J7e(O):null,Ws=Me.selectedSkills??[],Lr=oe=>{_n.has(oe)&&un({builtinTools:bt.includes(oe)?bt.filter($e=>$e!==oe):[...bt,oe]})},ti=M7e(Me.agentType),Ei=BL(Me.agentType),es=mM(d),ts=um(Me,d),ba=oe=>{var st;const $e=oe==="custom"&&ts==="ark"?"":oe==="ark"&&!((st=Me.modelName)!=null&&st.trim())?Xp(d):Me.modelName;un({modelSource:oe,modelName:$e,modelFallbacks:oe==="custom"&&ts==="ark"?[]:Nu($e,Me.modelFallbacks)})},go=p.useMemo(()=>Ptn(O),[O]),fs=Ei?null:zT(Me.name,oe=>v(`validation.agentName.${oe}`))??(go.has(Me.name)?v("traditional.validation.duplicateName"):null),he=fs!==null,gr=ie||be.has(kn),bo=!Ei&&Me.description.trim().length===0,to=Me.instruction.trim().length===0,fl=Ei&&!((Vo=Me.a2aRegistry)!=null&&Vo.registrySpaceId.trim()),no=(oe,$e=ie)=>$e&&oe?`is-error cw-error-shake-${pe%2}`:"",ks=p.useMemo(()=>lUe(O,go),[O,go]),Ks=ks.length===0,Ti=p.useMemo(()=>ky(O,d),[d,O]),rr=umt(O),Ds=bI(O),Ml=rmt(d),hl=p.useMemo(()=>jon(Ti,N),[Ti,N]),br=Oe.find(oe=>oe.id===qe)??Oe[0],$r=p.useMemo(()=>fU(Ti,(u==null?void 0:u.editMode)==="source-preserving"),[u==null?void 0:u.editMode,Ti]),pl=!u||u.editMode==="regenerate",Lo=p.useMemo(()=>NK(Ti,Do(d)),[d,Ti]),Rr=p.useMemo(()=>cUe(Ti,d),[d,Ti]),$o=p.useMemo(()=>T7e(Ti,Do(d),C,j),[d,j,C,Ti]),ns=Rr!==null&&!((Kc=(Ql=Ti.deployment)==null?void 0:Ql.modelApiKeyId)!=null&&Kc.trim()),ya=ns||!!$o,Mi=Lo.find(oe=>oe.label===Xt("helpers.customModel.apiKeyLabel",{name:Me.name.trim()||Xt("helpers.customModel.fallbackName")})),Ms=Mi?T.has(Mi.key):!1,Vr=ts==="custom"&&Mi!==void 0&&!((vo=C[Mi.key])!=null&&vo.trim())&&!Ms,hs=ts==="ark"&&!((io=(ra=Ti.deployment)==null?void 0:ra.modelApiKeyId)!=null&&io.trim()),ml=!MK(Me.modelApiBase),ia=p.useCallback(oe=>{k($e=>({...$e,deployment:{...$e.deployment??{feishuEnabled:!1},modelApiKeyId:oe.id,modelApiKeyName:oe.name}}))},[]);function gi(oe){const $e=oe.problem==="mcpDuplicateName"||oe.problem==="mcpDuplicateUrl"?"tools":oe.problem==="missingSubagent"?"type":"basic",st=yt.current[$e];st==null||st.scrollIntoView({behavior:"smooth",block:"start"});const Ye=oe.problem==="mcpDuplicateName"?"mcp-name":oe.problem==="mcpDuplicateUrl"?"mcp-url":oe.problem==="missingDescription"?"description":oe.problem==="missingPrompt"?"instruction":oe.problem==="missingRegistry"?"a2a-registry":oe.problem==="missingSubagent"||oe.problem==="remoteRoot"?null:"name",de=Ye?st==null?void 0:st.querySelector(`[data-validation-field="${Ye}"]`):st,Fe=de!=null&&de.matches('input, textarea, button:not([disabled]), [contenteditable="true"], [tabindex]:not([tabindex="-1"])')?de:de==null?void 0:de.querySelector('input, textarea, button:not([disabled]), [contenteditable="true"], [tabindex]:not([tabindex="-1"])');Fe==null||Fe.focus({preventScroll:!0})}function Ll(oe){Ge(oe),window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{const $e=yt.current.model;$e==null||$e.scrollIntoView({behavior:"smooth",block:"start"});const st=($e==null?void 0:$e.querySelector('[data-validation-field="model-api-key"]'))??$e,Ye=st!=null&&st.matches('input, textarea, button:not([disabled]), [contenteditable="true"], [tabindex]:not([tabindex="-1"])')?st:st==null?void 0:st.querySelector('input, textarea, button:not([disabled]), [contenteditable="true"], [tabindex]:not([tabindex="-1"])');Ye==null||Ye.focus({preventScroll:!0})})})}const Fo=()=>Ks?ya?(ee(!0),ke(oe=>oe+1),Ll(ns?Rr??[]:($o==null?void 0:$o.path)??[]),!1):(Yt(""),!0):(ee(!0),ke(oe=>oe+1),ks[0]&&(Ge(ks[0].path),window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>gi(ks[0]))})),!1),Gs=async()=>{Et(null);const oe=[...Ae.current.values()];Ae.current.clear(),Be(0),Se($e=>$e.map(st=>({...st,phase:"idle",runtimeSnapshot:"",messages:[],error:null}))),await Promise.all(oe.map(async({run:$e})=>{try{await nx($e.runId),Lk($e.runId)}catch(st){console.warn("Failed to clean up debug run",st)}}))},gl=async oe=>{const $e=Ae.current.get(oe);if($e){Ae.current.delete(oe),Be(Ae.current.size);try{await nx($e.run.runId),Lk($e.run.runId)}catch(st){console.warn("Failed to clean up debug run",st)}}},Bo=oe=>{const $e=Ae.current.get(oe),st=Oe.find(Ye=>Ye.id===oe);!$e||!st||Et({runId:$e.run.runId,sessionId:$e.sessionId,variantName:dUe(st,v)})},Ma=oe=>{const $e=wt.current;wt.current=null,$e==null||$e(oe)},bl=()=>{mt||(tt(!1),Ma(!1))},Bu=async()=>{if(!mt){Ne(!0);try{await Gs(),tt(!1),Ma(!0)}finally{Ne(!1)}}},Uo=async()=>Y!=="validate"||Ve===0?!0:wt.current?!1:new Promise(oe=>{wt.current=oe,tt(!0)}),mc=async oe=>{if(await Uo()){if(!Fo()){X("build");return}oe&&Xe(oe),X("environment")}},Md=async oe=>{var st,Ye;if(Yt(""),!Fo()){X("build");return}if((st=Ti.harnessSidecar)!=null&&st.enabled&&Ml){Yt(Ml),X("optimize");return}const $e=lU($r.specs,((Ye=Ti.deployment)==null?void 0:Ye.envValues)??{});if($e){Yt(`${$e.spec.comment||$e.spec.key}:${$e.error}`),X("build");return}Qe(!0);try{const de=oe?Oe.find(ct=>ct.id===oe):br;de&&Xe(de.id);const Fe=de?cmt(Ti,de):Ti,lt=await GS(SS(Fe));k(Fe),Pe(lt),X("publish")}catch(de){Yt(de instanceof Error?de.message:String(de))}finally{Qe(!1)}},Ld=async()=>{if(await Uo()){if(!Fo()){X("build");return}X("optimize")}},yo=async oe=>{if(!le||Ee||!Fo())return;const $e=Oe.find(Vt=>Vt.id===oe);if(!$e||$e.phase==="starting"||$e.phase==="sending")return;const st=$e.modelName.trim(),Ye=$e.description.trim(),de=$e.instruction.trim(),Fe=Vx($e),lt=Oe.findIndex(Vt=>Vt.id===oe),ct=Oe.findIndex(Vt=>Vx(Vt)===Fe);if(!st||!Ye||!de||ct!==lt)return;const Lt=UP(hl,$e);Se(Vt=>Vt.map(yi=>yi.id===oe?{...yi,configOpen:!1,phase:"starting",messages:[],error:null}:yi)),Pt("");let ln=null,yr="unknown";const Jt=oe==="baseline"?"baseline":"comparison",pi=Rtn({agentId:String(Ti.name||"unknown"),variantType:Jt});try{await gl(oe),await nn();const Vt={...Ti,modelName:$e.modelName||Ti.modelName,description:$e.description,instruction:$e.instruction};yr="create_test_run",ln=await _2e(fUe(Vt,N),u?{runtimeId:u.runtimeId,region:u.region}:void 0),ron(ln.runId),yr="create_test_session";const yi=await j2e(ln.runId,"test_user");Ae.current.set(oe,{run:ln,sessionId:yi}),Be(Ae.current.size),Se(Ln=>Ln.map(Xn=>Xn.id===oe?{...Xn,phase:"ready",runtimeSnapshot:Lt}:Xn)),pi.succeed({debugRunId:String(ln.runId)})}catch(Vt){if(ln)try{await nx(ln.runId),Lk(ln.runId)}catch(yi){console.warn("Failed to clean up debug run",yi)}Se(yi=>yi.map(Ln=>Ln.id===oe?{...Ln,phase:"error",runtimeSnapshot:"",error:Vt instanceof Error?Vt.message:String(Vt)}:Ln)),pi.fail({failedPhase:yr,...Xo(Vt,{phase:yr})})}},$d=async()=>{const oe=_t.trim(),$e=Oe.filter(Ye=>Ye.phase==="ready"&&Ye.runtimeSnapshot===UP(hl,Ye)&&Ae.current.has(Ye.id));if(!oe||$e.length===0)return;Pt("");const st=new Set($e.map(Ye=>Ye.id));Se(Ye=>Ye.map(de=>st.has(de.id)?{...de,phase:"sending",messages:[...de.messages,{role:"user",content:oe},{role:"assistant",content:"",blocks:[]}]}:de)),await Promise.all($e.map(async Ye=>{const de=Ae.current.get(Ye.id);if(de)try{let Fe=dB();for await(const lt of R2e({runId:de.run.runId,userId:"test_user",sessionId:de.sessionId,text:oe})){const ct=lt.error||lt.errorMessage||lt.error_message;if(ct||(Fe=Zje(Fe,lt)),Se(Lt=>Lt.map(ln=>{if(ln.id!==Ye.id)return ln;const yr=[...ln.messages],Jt={...yr[yr.length-1]};return ct?Jt.error=String(ct):(Jt.content=Fe.blocks.filter(pi=>pi.kind==="text").map(pi=>pi.text).join(""),Jt.blocks=Fe.blocks),yr[yr.length-1]=Jt,{...ln,messages:yr}})),ct)break}}catch(Fe){Se(lt=>lt.map(ct=>{if(ct.id!==Ye.id)return ct;const Lt=[...ct.messages],ln={...Lt[Lt.length-1]};return ln.error=Fe instanceof Error?Fe.message:String(Fe),Lt[Lt.length-1]=ln,{...ct,messages:Lt}}))}finally{Se(Fe=>Fe.map(lt=>lt.id===Ye.id?{...lt,phase:"ready"}:lt))}}))},yl=()=>{Se(oe=>{if(oe.length>=3)return oe;const $e=ye.current++,st=`variant-${$e}`;return[...oe,{id:st,name:v("traditional.debug.comparison",{count:$e}),modelName:O.modelName??"",description:O.description,instruction:O.instruction,configOpen:!0,phase:"idle",runtimeSnapshot:"",messages:[],error:null}]})},$l=async oe=>{await gl(oe),Se($e=>$e.filter(st=>st.id!==oe)),qe===oe&&Xe("baseline")},La=(oe,$e)=>Se(st=>st.map(Ye=>Ye.id===oe?{...Ye,...$e}:Ye)),Qo=(oe,$e)=>{if($e&&Ml){Yt(Ml);return}const st=$e?[...new Set([...Ds,oe])]:Ds.filter(de=>de!==oe),Ye=rr==="ops"?"default":rr;k(de=>({...de,harnessSidecar:Ay(st,Ye)})),Yt(""),Pe(null)},zo=oe=>{const $e=cH(oe);if($e.length>0&&Ml){Yt(Ml);return}k(st=>({...st,harnessSidecar:Ay($e,oe)})),Yt(""),Pe(null)},Uu=(oe,$e,st)=>{oe==="baseline"&&$e==="modelName"&&(we.current=!0),La(oe,{[$e]:st}),!(qe!==oe||oe==="baseline")&&Xe("baseline")},vl=oe=>{const $e=Oe.find(Lt=>Lt.id===oe);if(!$e)return;const st=$e.modelName.trim(),Ye=$e.description.trim(),de=$e.instruction.trim(),Fe=Vx($e),lt=Oe.findIndex(Lt=>Lt.id===oe),ct=Oe.findIndex(Lt=>Vx(Lt)===Fe);if(!(!st||!Ye||!de||ct!==lt)){if(oe==="baseline"){La(oe,{configOpen:!1});return}yo(oe)}},Fl=async(oe,$e,st)=>{var ct,Lt,ln;const Ye=(u==null?void 0:u.editMode)==="source-preserving",de=bI(O).includes("mcp_resilience"),Fe=(ct=O.deployment)==null?void 0:ct.network,lt=Fe&&Fe.mode&&Fe.mode!=="public"?{mode:Fe.mode,vpc_id:Fe.vpcId,subnet_ids:Fe.subnetIds,enable_shared_internet_access:Fe.enableSharedInternetAccess}:void 0;return $0(oe.name,oe.files,{region:(u==null?void 0:u.region)??_e,projectName:"default",network:lt},{...st,onStage:$e,runtimeId:u==null?void 0:u.runtimeId,runtimeName:(st==null?void 0:st.runtimeName)??A,appName:u==null?void 0:u.appName,agentCategory:"mpa",editMode:u==null?void 0:u.editMode,draft:u||de?SS(O):void 0,updateEtag:u==null?void 0:u.etag,baseRuntimeVersion:u==null?void 0:u.currentVersion,envs:Ye?_on(O,d,st==null?void 0:st.envs):st==null?void 0:st.envs,mcpSecretValues:Ye?_an(O):de?Tan(O):void 0,removeRuntimeEnvKeys:u?[...Oan(u.configuredMcpEnvKeys??[],O),...(Lt=O.deployment)!=null&&Lt.feishuEnabled?[]:["FEISHU_APP_ID","FEISHU_APP_SECRET"]]:void 0,description:O.description,harnessSidecar:O.harnessSidecar,environment:(ln=O.cloudEnvironment)!=null&&ln.environmentId?{environmentId:O.cloudEnvironment.environmentId,environmentVersionId:O.cloudEnvironment.environmentVersionId}:void 0})},Ls=()=>{Fo()&&(Se(oe=>oe.map($e=>$e.id==="baseline"&&!Ae.current.has($e.id)?{...$e,modelName:we.current?$e.modelName:hU(Ti),description:Ti.description,instruction:Ti.instruction}:$e)),X("validate"))},$a=async oe=>{if(oe==="publish"){if(!await Uo())return;await Md();return}if(oe==="validate"){Ls();return}if(oe==="optimize"){await Ld();return}if(oe==="environment"){mc();return}await Uo()&&X(oe)},sn=oe=>{k($e=>({...$e,cloudEnvironment:oe})),Yt(""),Pe(null)},Bl=async oe=>{var mi,lr,cr,pr,ro,Sm,lv,cv,Mh,Df,uv,Ir;if(wn||(et(""),St(!1),!Fo()))return;const $e=rv(A.trim());if($e){et($e);return}const st={...Ti,memory:{...Ti.memory,shortTerm:oe.sessionBackend!=="local"},shortTermBackend:oe.sessionBackend},Ye=fU(st,(u==null?void 0:u.editMode)==="source-preserving"),de=(mi=st.deployment)==null?void 0:mi.network;if((de==null?void 0:de.mode)!==void 0&&de.mode!=="public"&&!((lr=de.vpcId)!=null&&lr.trim())){et(v("traditional.deployment.vpcRequired"));return}if(um(st,d)==="ark"&&!((pr=(cr=st.deployment)==null?void 0:cr.modelApiKeyId)!=null&&pr.trim())){et(v("traditional.deployment.apiKeyRequired"));return}const Fe={...((ro=st.deployment)==null?void 0:ro.envValues)??{},...C,...Ye.fixedValues},lt=Object.keys(Fe).find(xl=>xl&&!/^[A-Za-z_][A-Za-z0-9_]*$/.test(xl));if(lt){et(v("traditional.deployment.invalidEnvName",{key:lt}));return}const ct=(Sm=st.deployment)!=null&&Sm.feishuEnabled?[...Ye.specs,...sS]:Ye.specs,Lt=ssn(ct,Fe,j);if(Lt){et(v("traditional.deployment.requiredEnv",{name:Lt.comment||Lt.key}));return}const ln=lU(ct,Fe);if(ln){et(`${ln.spec.comment||ln.spec.key}:${ln.error}`);return}We(!0),He({level:"info",phase:"prepare",message:v("traditional.deployment.generatingConfiguration"),pct:0});let yr=null,Jt="prepare",pi=v("traditional.deployment.preparing"),Vt=v("traditional.deployment.generatingConfiguration"),yi=u==null?void 0:u.runtimeId,Ln=(u==null?void 0:u.region)??_e,Xn;try{if(!u&&!(await jD(A.trim(),_e)).available)throw new Error(v("traditional.deployment.runtimeNameExists"));const xl=await GS(SS(st));Pe(xl);const xo=crypto.randomUUID(),Qu=Date.now(),wl={id:xo,...c?{draftId:c}:{},agentName:st.name,runtimeName:A.trim(),runtimeId:u==null?void 0:u.runtimeId,region:(u==null?void 0:u.region)??_e,startedAt:Qu,agentDraft:st,mpaProfile:!0,mpaSmoke:!u},zu={...wl,status:"running",phase:Jt,label:pi,message:Vt,pct:0};if(yr=zu,s==null||s(zu),m==null||m(zu),u!=null&&u.mpaProfileOnly){Jt="profile_applying",pi=v("traditional.deployment.stages.applyMpaProfile"),Vt=v("traditional.deployment.applyingMpaProfile"),He({level:"info",phase:Jt,message:Vt,pct:0}),s==null||s({...wl,status:"running",phase:Jt,label:pi,message:Vt,pct:0,mpaProfile:!0,mpaSmoke:!1});const Vi=u.etag?"update":"create",Hr=await JR({draft:st,taskId:xo,agentName:st.name,runtimeId:u.runtimeId,region:u.region,operationKind:Vi,mpaInstanceId:u.mpaInstanceId,runtimeName:A.trim(),sourceDraftId:c,runtimeRevision:u.etag});if(Hr.status!=="succeeded")throw Vt=Hr.safeErrorCode||v("traditional.deployment.mpaOperationIncomplete"),He({level:"error",phase:Jt,message:Vt,pct:100}),new Error(Vt);St(!0),He({level:"success",phase:Jt,message:v("traditional.deployment.mpaProfileApplied"),pct:100}),s==null||s({...wl,status:"success",phase:"complete",label:v("traditional.deployment.complete"),message:v("traditional.deployment.mpaProfileApplied"),pct:100,mpaProfile:!0,mpaSmoke:!1}),await(h==null?void 0:h({apikey:"",url:"",agentName:st.name,runtimeName:A.trim(),runtimeId:u.runtimeId,mpaInstanceId:u.mpaInstanceId,region:u.region,version:u.currentVersion,mpaOperation:Hr}));return}const Lh=new Map(Object.entries(Fe).map(([Vi,Hr])=>[Vi.trim(),Hr]).filter(([Vi,Hr])=>Vi&&Hr.trim()));for(const Vi of RK(ct,Fe))Lh.set(Vi.key,Vi.value);const zl=(cv=(lv=st.deployment)==null?void 0:lv.modelApiKeyId)==null?void 0:cv.trim(),Vu=(Df=(Mh=st.deployment)==null?void 0:Mh.modelApiKeyName)==null?void 0:Df.trim();zl&&Lh.set("MODEL_AGENT_API_KEY_ID",zl),Vu&&Lh.set("MODEL_AGENT_API_KEY_NAME",Vu);const Ol=await Fl(xl,Vi=>{Jt=Vi.phase,pi=Vi.phase==="build"?v("traditional.deployment.stages.build"):Vi.phase==="deploy"?v("traditional.deployment.stages.deploy"):Vi.phase==="publish"?v("traditional.deployment.stages.publish"):v("traditional.deployment.stages.running"),Vt=Vi.message,He(Vi),s==null||s({...wl,runtimeName:Vi.runtimeName||wl.runtimeName,status:"running",phase:Jt,label:pi,message:Vt,messageCode:Vi.messageCode,pct:Vi.pct,...Vi.buildLog?{buildLog:Vi.buildLog}:{}})},{taskId:xo,runtimeName:A.trim(),sessionStorage:oe.sessionStorage,minInstance:oe.minInstance,maxInstance:oe.maxInstance,authentication:oe.authentication,createEvaluationSets:oe.createEvaluationSets,resources:oe.resources,...(uv=st.deployment)!=null&&uv.feishuEnabled?{im:{feishu:{enabled:!0}}}:{},envs:[...Lh].map(([Vi,Hr])=>({key:Vi,value:Hr}))});let Pi=Ol;const Nt=Ol.runtimeId||(u==null?void 0:u.runtimeId)||"",gc=Ol.region||(u==null?void 0:u.region)||_e;if(yi=Nt||yi,Ln=gc,Nt){Jt="profile_applying",pi=v("traditional.deployment.stages.applyMpaProfile"),Vt=v("traditional.deployment.applyingMpaProfile"),He({level:"info",phase:Jt,message:Vt,pct:0}),s==null||s({...wl,runtimeName:Ol.runtimeName||wl.runtimeName,runtimeId:Nt,region:gc,status:"running",phase:Jt,label:pi,message:Vt,pct:0,mpaProfile:!0,mpaSmoke:!u});const Vi=await JR({draft:st,taskId:xo,agentName:st.name,runtimeId:Nt,region:gc,operationKind:u?"update":"create",mpaInstanceId:(u==null?void 0:u.mpaInstanceId)??Ol.mpaInstanceId,runtimeName:A.trim()||Ol.runtimeName,sourceDraftId:c,runtimeRevision:u==null?void 0:u.etag});if(Vi.status!=="succeeded"){if(Jt=Vi.stage==="smoke_running"?"smoke_running":"profile_applying",pi=v(Jt==="smoke_running"?"traditional.deployment.stages.verifyMpaRuntime":"traditional.deployment.stages.applyMpaProfile"),Vt=Vi.safeErrorCode||v("traditional.deployment.mpaOperationIncomplete"),He({level:"error",phase:Jt,message:Vt,pct:100}),Vi.status==="failed_retryable"){const Hr={operationKind:u?"update":"create",runtimeId:Nt,region:gc,mpaInstanceId:(u==null?void 0:u.mpaInstanceId)??Ol.mpaInstanceId??Nt,sourceProfileId:c!=null&&c.trim()?`studio-draft:${c.trim()}`:`studio-agent:${st.name}:${xo}`,draft:st,targetKey:u?u.mpaInstanceId??Nt:`runtime:${gc}:${A.trim()||Ol.runtimeName}`,runtimeRevision:u==null?void 0:u.etag};Xn=async()=>{const Bn=await Nz(Vi.operationId,Hr);if(s==null||s({...wl,runtimeId:Nt,mpaInstanceId:Hr.mpaInstanceId,region:gc,status:Bn.status==="succeeded"?"success":"error",phase:Bn.stage,label:Bn.status==="succeeded"?v("traditional.deployment.complete"):v("traditional.deployment.failed"),message:Bn.safeErrorCode||void 0,pct:100,mpaProfile:!0,mpaSmoke:!u,operationId:Bn.operationId}),Bn.status!=="succeeded")throw new Error(Bn.safeErrorCode||v("traditional.deployment.mpaOperationIncomplete"));await(h==null?void 0:h({...Ol,mpaOperation:Bn}))}}throw new Error(Vt)}u?(Vt=v("traditional.deployment.mpaProfileApplied"),He({level:"success",phase:Jt,message:Vt,pct:100})):(Jt="smoke_running",pi=v("traditional.deployment.stages.verifyMpaRuntime"),Vt=v("traditional.deployment.runningMpaSmoke"),s==null||s({...wl,runtimeName:Ol.runtimeName||wl.runtimeName,runtimeId:Nt,region:gc,status:"running",phase:Jt,label:pi,message:Vt,pct:100,mpaProfile:!0,mpaSmoke:!0}),Jt="runnable",pi=v("traditional.deployment.stages.mpaReady"),Vt=v("traditional.deployment.mpaReady"),He({level:"success",phase:Jt,message:Vt,pct:100})),Pi={...Ol,mpaOperation:Vi}}St(!0),He({level:"success",phase:"complete",message:v("traditional.deployment.complete"),pct:100}),s==null||s({...wl,runtimeName:Pi.runtimeName||wl.runtimeName,runtimeId:Pi.runtimeId||(u==null?void 0:u.runtimeId),region:Pi.region||(u==null?void 0:u.region)||_e,status:"success",phase:Pi.mpaOperation&&!u?"runnable":"complete",label:v("traditional.deployment.complete"),message:Pi.mpaOperation&&!u?v("traditional.deployment.mpaReady"):(Ir=Pi.warnings)==null?void 0:Ir.join(";"),pct:100,mpaProfile:!0,mpaSmoke:!!(Pi.mpaOperation&&!u)}),await(h==null?void 0:h(Pi))}catch(xl){const xo=xl instanceof Error?xl.message:String(xl);et(xo),He(null);const Qu={...yr??{id:crypto.randomUUID(),agentName:Ti.name||v("traditional.basic.unnamedAgent"),runtimeName:A.trim(),region:_e,startedAt:Date.now()},status:"error",runtimeId:yi,region:Ln,phase:Jt,label:v("traditional.deployment.failed"),message:xo,mpaProfile:!0,mpaSmoke:!u,operationId:void 0,retry:Xn??(()=>Bl(oe))};s==null||s(Qu)}finally{We(!1)}},Ss=Qt.current,is=oe=>aon.find($e=>$e.id===oe),rs=a.jsx("section",{className:`cw-ai-compose${_?" is-generating":""}${F?" is-success":""}`,"aria-label":v("traditional.ai.ariaLabel"),children:a.jsx(hf,{initial:!1,mode:"wait",children:F?a.jsxs(Ar.div,{className:"cw-ai-compose-success",role:"status",initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.98},transition:{duration:.22,ease:[.22,1,.36,1]},children:[a.jsx("span",{className:"cw-ai-success-check","aria-hidden":!0}),a.jsx("strong",{children:v("traditional.ai.success")}),a.jsx("button",{type:"button",className:"cw-ai-regenerate",onClick:()=>M(!1),children:v("traditional.ai.regenerate")})]},"success"):a.jsxs(Ar.div,{className:"cw-ai-compose-entry",initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.98},transition:{duration:.2,ease:[.22,1,.36,1]},children:[a.jsxs("form",{className:"cw-ai-compose-form",onSubmit:oe=>{oe.preventDefault(),Rn()},children:[a.jsx("input",{type:"text",value:I,maxLength:8e3,disabled:_,placeholder:v("traditional.ai.placeholder",{model:ltt(d)}),"aria-invalid":!!Z,"aria-describedby":Z?"ai-requirement-error":void 0,onChange:oe=>D(oe.target.value),onKeyDown:oe=>{HT(oe.nativeEvent)||oe.key==="Enter"&&(oe.preventDefault(),Rn())}}),a.jsx("button",{type:"submit",disabled:_||!V||!!Z,"aria-label":v(_?"traditional.ai.generating":"traditional.ai.generate"),children:_?a.jsx("span",{className:"cw-ai-orb","aria-hidden":!0,children:a.jsx("span",{})}):v("traditional.ai.generate")})]}),Z&&a.jsx("p",{className:"cw-ai-requirement-error",id:"ai-requirement-error",role:"alert",children:Z})]},"compose")})});return S?a.jsx(Van,{draft:Ti,cloudProvider:d,deployRegion:_e,runtimeName:A,isRuntimeUpdate:!!u,profileOnly:u==null?void 0:u.mpaProfileOnly,deploying:wn,deployStage:kt,deployError:nt,deploySucceeded:ft,showErrors:ie,onBack:e,onDraftPatch:oe=>{k($e=>({...$e,...oe})),Pe(null),Yt("")},onDeploymentPatch:oe=>k($e=>({...$e,deployment:{...$e.deployment??{feishuEnabled:!1},...oe}})),onModelApiKeyChange:ia,customModelApiKey:Mi?C[Mi.key]??"":"",customModelSecretValues:C,customModelApiKeyConfigured:Ms,configuredRuntimeEnvKeys:j,showModelFallbacks:pl,onCustomModelApiKeyChange:oe=>{Mi&&P(Mi.key,oe)},onCustomModelSecretChange:P,onSelectedSkillsChange:oe=>k($e=>({...$e,selectedSkills:oe})),onCloudEnvironmentChange:sn,onDeployRegionChange:ae,onRuntimeNameChange:oe=>k($e=>({...$e,deployment:{...$e.deployment??{feishuEnabled:!1},runtimeName:oe,runtimeNameCustomized:!0}})),onNetworkChange:oe=>k($e=>({...$e,deployment:{...$e.deployment??{feishuEnabled:!1},network:oe}})),onDeploy:oe=>void Bl(oe)}):a.jsxs("div",{className:`cw-root is-${Y}`,children:[a.jsx(Pon,{mode:Y}),jt&&a.jsx(wb,{className:"cw-workspace-alert",message:jt}),a.jsxs("main",{className:"cw-workspace-main",id:"cw-workspace-main",children:[Y==="build"&&a.jsx("div",{className:"cw-build-workspace",children:a.jsxs("div",{className:"cw-editor",children:[a.jsx(RP,{draft:O,direction:"horizontal",selectedPath:cn,onSelect:Ge,onAdd:ui,onInsert:rt,onDelete:Ue}),a.jsx("div",{className:"cw-detail",children:a.jsx("div",{className:"cw-detail-scroll",ref:xt,children:a.jsx("div",{className:"cw-detail-inner",children:a.jsx("div",{className:"cw-lower",children:a.jsxs("div",{className:"cw-form-col",children:[a.jsxs(Ss,{meta:is("type"),children:[a.jsx(Ly,{className:"cw-agent-type-options","aria-label":v("traditional.agentTypes.ariaLabel"),value:Me.agentType??"llm",onChange:Si,children:uan.map(oe=>{const $e=(Me.agentType??"llm")===oe.id,st=on&&oe.id==="a2a",Ye=st?"cw-remote-agent-disabled-hint":void 0;return a.jsxs("div",{"data-agent-type":oe.id,className:`cw-agent-type-option ${$e?"is-on":""} ${st?"is-disabled":""}`,tabIndex:st?0:void 0,"aria-describedby":Ye,children:[a.jsx(Ly.Item,{value:oe.id,disabled:st,block:!0,className:"cw-agent-type-control",children:a.jsx("span",{className:"cw-agent-type-copy",children:a.jsx("strong",{children:v(lon[oe.id])})})}),st&&a.jsx("span",{id:Ye,className:"cw-agent-type-disabled-hint",role:"tooltip",children:v("traditional.agentTypes.remoteChildOnly")})]},oe.id)})}),ie&&ti&&Me.subAgents.length===0&&a.jsx("span",{className:"cw-error-text",children:Son({name:Me.name.trim(),agentType:Me.agentType},v)})]}),a.jsx(Ss,{meta:is("basic"),children:a.jsxs("div",{className:"cw-form",children:[!Ei&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"cw-field",children:[a.jsxs("label",{className:"cw-label",children:[v(on?"traditional.basic.agentName":"traditional.basic.name"),a.jsx("span",{className:"cw-req",children:"*"})]}),a.jsx("input",{className:`cw-input ${no(he,gr)}`,"data-validation-field":"name",value:Me.name,placeholder:"assistant","aria-invalid":gr&&he,"aria-describedby":gr&&fs?"cw-agent-name-error":void 0,onBlur:Sn,onChange:oe=>{Sn(),un({name:oe.target.value})}}),gr&&fs?a.jsx("span",{id:"cw-agent-name-error",role:"alert",className:"cw-error-text",children:fs}):a.jsx("span",{className:"cw-help",children:v("traditional.basic.nameHelp")})]}),a.jsxs("div",{className:"cw-field",children:[a.jsxs("label",{className:"cw-label",children:[v(on?"common.description":"traditional.basic.agentDescription"),a.jsx("span",{className:"cw-req",children:"*"})]}),a.jsx("textarea",{className:`cw-textarea cw-textarea-sm ${no(bo)}`,"data-validation-field":"description",value:Me.description,placeholder:v("traditional.basic.descriptionPlaceholder"),"aria-invalid":ie&&bo,"aria-describedby":ie&&bo?"cw-agent-description-error":void 0,onChange:oe=>un({description:oe.target.value})}),ie&&bo?a.jsx("span",{id:"cw-agent-description-error",role:"alert",className:"cw-error-text",children:v("traditional.validation.missingDescription")}):a.jsx("span",{className:"cw-help",children:v(on?"traditional.basic.rootDescriptionHelp":"traditional.basic.descriptionHelp")})]})]}),ti?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"cw-section-desc cw-dependency-hint",children:v("traditional.basic.orchestratorHelp")}),Me.agentType==="loop"&&a.jsxs("div",{className:"cw-field",children:[a.jsx("label",{className:"cw-label",children:v("traditional.basic.maxIterations")}),a.jsx("input",{className:"cw-input",type:"number",min:1,value:Me.maxIterations??3,onChange:oe=>un({maxIterations:Math.max(1,Number(oe.target.value)||1)})}),a.jsx("span",{className:"cw-help",children:v("traditional.basic.maxIterationsHelp")})]})]}):Ei?a.jsxs("div",{className:"cw-field cw-remote-center-fields","data-validation-field":"a2a-registry",children:[a.jsxs("div",{className:"cw-remote-center-head",children:[a.jsxs("div",{className:"cw-label",children:[v("traditional.basic.agentCenter"),a.jsx("span",{className:"cw-req",children:"*"})]}),a.jsx("p",{className:"cw-help cw-remote-center-description",children:v("traditional.basic.agentCenterHelp")})]}),a.jsx(pon,{value:((Re=Me.a2aRegistry)==null?void 0:Re.registrySpaceId)??"",region:((ot=Me.a2aRegistry)==null?void 0:ot.registryRegion)||es.region,invalid:ie&&fl,onChange:oe=>Fn(sUe,oe)}),a.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":Ct,"aria-controls":zi,onClick:()=>It(oe=>!oe),children:[a.jsx("span",{children:v("traditional.basic.moreOptions")}),a.jsx(BA,{className:`cw-more-options-chevron ${Ct?"is-open":""}`,"aria-hidden":!0})]}),a.jsx(hf,{initial:!1,children:Ct&&a.jsx(Ar.div,{id:zi,className:"cw-model-advanced",initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.18,ease:"easeOut"},children:a.jsx($k,{env:hx(con,d),values:aUe(Me.a2aRegistry,{includeDefaults:!1},d),onChange:Fn})})}),ie&&fl&&a.jsx("span",{className:"cw-error-text",role:"alert",children:v("traditional.validation.missingRegistry")})]}):a.jsxs("div",{className:"cw-field","data-validation-field":"instruction",children:[a.jsxs("label",{className:"cw-label",children:[v("traditional.basic.systemPrompt"),a.jsx("span",{className:"cw-req",children:"*"})]}),a.jsx(p.Suspense,{fallback:a.jsx("div",{className:"cw-markdown-loading",role:"status",children:v("traditional.basic.loadingMarkdown")}),children:a.jsx(ion,{value:Me.instruction,invalid:to,onChange:oe=>un({instruction:oe})})}),ie&&to?a.jsx("span",{className:"cw-error-text",role:"alert",children:v("traditional.validation.missingPrompt")}):a.jsx("span",{className:"cw-help",children:v("traditional.basic.markdownHelp")})]})]})}),!ti&&!Ei&&a.jsxs(a.Fragment,{children:[a.jsx(Ss,{meta:is("model"),children:a.jsxs("div",{className:"cw-form",children:[a.jsxs("div",{className:"cw-field cw-model-source-field",children:[a.jsx("label",{className:"cw-label",children:v("traditional.model.source")}),a.jsx(Ly,{className:"cw-model-source-options","aria-label":v("traditional.model.source"),value:ts,onChange:oe=>{oe!=="gateway"&&ba(oe)},children:[{value:"ark",label:v(d==="byteplus"?"traditional.model.bytePlusModelArk":"traditional.model.volcanoArk")},{value:"custom",label:v("traditional.model.custom")},{value:"gateway",label:v("traditional.model.gateway"),disabled:!0}].map(oe=>a.jsx("div",{className:`cw-model-source-option ${ts===oe.value?"is-on":""}${oe.disabled?" is-disabled":""}`,children:a.jsxs(Ly.Item,{value:oe.value,disabled:oe.disabled,block:!0,className:"cw-model-source-control",children:[a.jsx("span",{children:oe.label}),oe.disabled&&a.jsx("span",{className:"cw-model-source-coming-soon",children:v("traditional.model.comingSoon")})]})},oe.value))})]}),ts==="ark"?a.jsxs("div",{className:"cw-field","data-validation-field":"model-api-key",children:[a.jsx("label",{className:"cw-label",children:v("traditional.model.configuration")}),a.jsx(hon,{value:Me.modelName??"",fallbacks:Me.modelFallbacks??[],cloudProvider:d,agentName:Me.name,apiKeyId:($t=O.deployment)==null?void 0:$t.modelApiKeyId,apiKeyName:(Dn=O.deployment)==null?void 0:Dn.modelApiKeyName,customModelSecretValues:C,configuredRuntimeEnvKeys:j,showFallbacks:pl,showMissingApiKeyErrors:ie,onApiKeyChange:oe=>k($e=>({...$e,deployment:{...$e.deployment??{feishuEnabled:!1},modelApiKeyId:oe.id,modelApiKeyName:oe.name}})),onChange:oe=>un({modelName:oe,modelFallbacks:Nu(oe,Me.modelFallbacks)}),onFallbacksChange:oe=>un({modelFallbacks:oe}),onCustomModelSecretChange:P}),ie&&hs?a.jsx("span",{className:"cw-error-text",role:"alert",children:v("traditional.deployment.apiKeyRequired")}):null]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"cw-field",children:[a.jsx("label",{className:"cw-label",children:v("traditional.model.name")}),a.jsx("input",{className:"cw-input",value:Me.modelName??"",onChange:oe=>un({modelName:oe.target.value,modelFallbacks:Nu(oe.target.value,Me.modelFallbacks)})})]}),a.jsxs("div",{className:"cw-field",children:[a.jsxs("label",{className:"cw-label cw-label-with-link",children:[a.jsx("span",{children:v("traditional.model.provider")}),a.jsxs("a",{href:"https://docs.litellm.ai/docs/providers",target:"_blank",rel:"noopener noreferrer",onClick:oe=>oe.stopPropagation(),children:[v("traditional.model.liteLlmProviders"),a.jsx(d0,{"aria-hidden":"true"})]})]}),a.jsx("input",{className:"cw-input",value:Me.modelProvider??"",placeholder:"openai",onChange:oe=>un({modelProvider:oe.target.value})})]}),a.jsxs("div",{className:"cw-field",children:[a.jsx("label",{className:"cw-label",children:"API Base"}),a.jsx("input",{className:"cw-input",type:"url",inputMode:"url",value:Me.modelApiBase??"",placeholder:Do(d),"aria-invalid":ml,onChange:oe=>un({modelApiBase:oe.target.value})}),ml?a.jsx("span",{className:"cw-env-error",children:v("traditional.model.invalidApiBase")}):null]}),a.jsxs("div",{className:"cw-field","data-validation-field":"model-api-key",children:[a.jsx("label",{className:"cw-label",children:"API Key"}),a.jsx("input",{className:`cw-input ${no(Vr)}`,type:"password",value:Mi?C[Mi.key]??"":"",placeholder:Ms&&!(Mi&&C[Mi.key])?"••••••":v("traditional.model.apiKeyPlaceholder"),autoComplete:"new-password",onChange:oe=>{if(!Mi)return;const $e=oe.currentTarget.value;P(Mi.key,$e)}}),ie&&Vr?a.jsx("span",{className:"cw-error-text",role:"alert",children:v("traditional.deployment.apiKeyRequired")}):null]})]}),ts==="custom"&&pl&&a.jsx(FP,{variant:"traditional",primaryModelName:Me.modelName??"",agentName:Me.name,value:Me.modelFallbacks??[],secretValues:C,configuredSecretEnvKeys:j,showMissingApiKeyErrors:ie,onChange:oe=>un({modelFallbacks:oe}),onSecretChange:P})]})}),a.jsx(Ss,{meta:is("tools"),children:a.jsxs("div",{className:"cw-form",children:[a.jsxs("div",{className:"cw-field",children:[a.jsx("label",{className:"cw-label",children:v("traditional.tools.builtIn")}),a.jsx("span",{className:"cw-help",children:v("traditional.tools.builtInHelp")}),a.jsx("div",{className:"cw-tools-list-shell",children:a.jsx(uon,{items:Ht,selected:bt,onToggle:Lr,scrollRows:6})}),a.jsx(hf,{initial:!1,children:bt.includes("run_code")&&a.jsxs(Ar.div,{className:"cw-tool-config",initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.16,ease:"easeOut"},children:[a.jsxs("div",{className:"cw-tool-config-head",children:[a.jsx("span",{className:"cw-label",children:v("traditional.tools.codeExecution")}),a.jsx("span",{className:"cw-help",children:v("traditional.tools.codeExecutionHelp")})]}),a.jsx($k,{env:((On=JA.find(oe=>oe.id==="run_code"))==null?void 0:On.env)??[],values:((mn=O.deployment)==null?void 0:mn.envValues)??{},onChange:Pn})]})})]}),a.jsxs("div",{className:"cw-field cw-mcp-field",children:[a.jsx("label",{className:"cw-label",children:v("traditional.tools.mcp")}),a.jsx(yon,{tools:Nr,conflict:qs,showConflict:ie,onChange:oe=>un({mcpTools:oe})})]})]})}),a.jsx(Ss,{meta:is("skills"),children:a.jsx("div",{className:"cw-form",children:a.jsx(yK,{selected:Ws,onChange:oe=>un({selectedSkills:oe}),cloudProvider:d})})}),a.jsx(Ss,{meta:is("knowledge"),children:a.jsxs("div",{className:"cw-form cw-toggle-stack",children:[a.jsx(jj,{checked:Me.knowledgebase,onChange:oe=>un({knowledgebase:oe}),title:v("traditional.knowledge.title"),desc:v("traditional.knowledge.description"),icon:gN}),Me.knowledgebase&&a.jsxs("div",{className:"cw-field cw-subfield",children:[a.jsx("label",{className:"cw-label",children:v("traditional.knowledge.backend")}),a.jsx($6,{options:jB,value:Me.knowledgebaseBackend,translationGroup:"knowledge",onChange:oe=>un({knowledgebaseBackend:oe,knowledgebaseIndex:oe==="viking"||oe==="openviking"?Me.knowledgebaseIndex:""})}),(Me.knowledgebaseBackend??Mg)==="viking"&&a.jsxs("div",{className:"cw-field cw-subfield",children:[a.jsx("label",{className:"cw-label",children:v("traditional.knowledge.vikingDatabase")}),a.jsx(mon,{value:Me.knowledgebaseIndex??"",onChange:oe=>{un({knowledgebaseIndex:oe.id}),oe.projectName&&Pn("DATABASE_VIKING_PROJECT",oe.projectName),oe.region&&Pn("DATABASE_VIKING_REGION",oe.region),oe.sourceKind&&Pn("DATABASE_VIKING_COLLECTION_KIND",oe.sourceKind),Pn("DATABASE_VIKING_RESOURCE_ID",oe.resourceId??"")}})]}),a.jsx($k,{env:((jn=jB.find(oe=>oe.id===(Me.knowledgebaseBackend??Mg)))==null?void 0:jn.env)??[],values:((Wt=O.deployment)==null?void 0:Wt.envValues)??{},onChange:Pn,renderAfterField:(Me.knowledgebaseBackend??Mg)==="openviking"?oe=>oe.key==="DATABASE_OPENVIKING_USER_ID"?a.jsx(fon,{value:Me.knowledgebaseIndex??"",onChange:$e=>un({knowledgebaseIndex:$e})}):null:void 0})]})]})}),on&&a.jsx(Ss,{meta:is("memory"),children:a.jsxs("div",{className:"cw-form cw-toggle-stack",children:[a.jsx(jj,{checked:Me.memory.shortTerm,onChange:oe=>un({memory:{...Me.memory,shortTerm:oe}}),title:v("traditional.memory.shortTerm"),desc:v("traditional.memory.shortTermDescription"),showDescription:!0,icon:Fje}),Me.memory.shortTerm&&a.jsxs("div",{className:"cw-field cw-subfield",children:[a.jsx("label",{className:"cw-label",children:v("traditional.memory.shortTermBackend")}),a.jsx($6,{options:lw,value:Me.shortTermBackend,translationGroup:"shortTerm",onChange:oe=>un({shortTermBackend:oe})}),a.jsx($k,{env:((bn=lw.find(oe=>oe.id===(Me.shortTermBackend??"local")))==null?void 0:bn.env)??[],values:((Mn=O.deployment)==null?void 0:Mn.envValues)??{},onChange:Pn})]}),a.jsx(jj,{checked:Me.memory.longTerm,onChange:oe=>un({memory:{...Me.memory,longTerm:oe}}),title:v("traditional.memory.longTerm"),desc:v("traditional.memory.longTermDescription"),showDescription:!0,icon:gN}),Me.memory.longTerm&&a.jsxs("div",{className:"cw-field cw-subfield",children:[a.jsx("label",{className:"cw-label",children:v("traditional.memory.longTermBackend")}),a.jsx($6,{options:_B,value:Me.longTermBackend,translationGroup:"longTerm",onChange:oe=>un({longTermBackend:oe,longTermMemoryIndex:oe==="viking"?Me.longTermMemoryIndex:""})}),(Me.longTermBackend??"local")==="viking"&&a.jsxs("div",{className:"cw-field cw-subfield",children:[a.jsx("label",{className:"cw-label",children:v("traditional.memory.vikingDatabase")}),a.jsx(gon,{value:Me.longTermMemoryIndex??"",onChange:oe=>{un({longTermMemoryIndex:oe.id}),Pn("DATABASE_VIKINGMEM_PROJECT",oe.projectName),Pn("DATABASE_VIKING_REGION",oe.region),Pn("DATABASE_VIKINGMEM_MEMORY_TYPE",(oe.memoryTypes??[]).join(","))}})]}),a.jsx($k,{env:((ai=_B.find(oe=>oe.id===(Me.longTermBackend??"local")))==null?void 0:ai.env)??[],values:((ss=O.deployment)==null?void 0:ss.envValues)??{},onChange:Pn}),a.jsx(jj,{checked:!!Me.autoSaveSession,onChange:oe=>un({autoSaveSession:oe}),title:v("traditional.memory.autoSave"),desc:v("traditional.memory.autoSaveDescription"),icon:gN})]})]})})]})]})})})})})]})}),Y==="validate"&&a.jsx("div",{className:"cw-validation-workspace",children:a.jsx("div",{className:"cw-validation-content",children:a.jsx(Non,{enabled:le,disabledReason:ge,variants:Oe,draftSnapshot:hl,input:_t,onInput:Pt,onSend:$d,onStartVariant:yo,onUseVariant:oe=>void mc(oe),onAddVariant:yl,onRemoveVariant:$l,onToggleConfig:oe=>{const $e=Oe.find(st=>st.id===oe);$e&&La(oe,{configOpen:!$e.configOpen})},onCompleteConfig:vl,onConfigChange:Uu,onOpenTrace:Bo})})}),Y==="optimize"&&a.jsx(Ron,{profile:rr,optimizations:Ds,onProfileChange:zo,onOptimizationChange:Qo}),Y==="environment"&&a.jsx("div",{className:"cw-environment-workspace",children:a.jsx(nUe,{value:O.cloudEnvironment??{environmentId:"",environmentVersionId:""},onChange:sn,disabled:Ee})}),Y==="publish"&&a.jsx("div",{className:"cw-preview-body",children:je?a.jsx(qT,{embedded:!0,cloudProvider:d,project:je,agentDraft:O,agentName:O.name||v("traditional.basic.unnamedAgent"),agentCount:uUe(O),releaseConfiguration:br?{modelName:br.modelName||O.modelName||v("traditional.debug.defaultModel"),description:br.description,instruction:br.instruction,optimizations:[v("traditional.optimization.releaseScenario",{profile:v(`traditional.optimization.profiles.${rr}.label`)}),...Ds.map(oe=>v(`traditional.optimization.options.${oe}.label`))]}:void 0,onChange:Pe,onDeploy:Fl,onAgentAdded:n,onDeploymentTaskChange:s,deploymentActionLabel:v(u?"traditional.deployment.updateAndPublish":"common.deploy"),deploymentActionTargetId:"cw-publish-primary-action",deploymentRuntimeId:u==null?void 0:u.runtimeId,deploymentMpaInstanceId:u==null?void 0:u.mpaInstanceId,deploymentRuntimeName:A,deploymentRuntimeRevision:u==null?void 0:u.etag,deploymentRuntimeNameCustomized:!!u||!!((re=O.deployment)!=null&&re.runtimeNameCustomized),onDeploymentRuntimeNameChange:oe=>k($e=>({...$e,deployment:{...$e.deployment??{feishuEnabled:!1},runtimeName:oe,runtimeNameCustomized:!0}})),onDeploymentStarted:m,onDeploymentComplete:h,feishuEnabled:!!((zn=O.deployment)!=null&&zn.feishuEnabled),configuredRuntimeEnvKeys:u==null?void 0:u.configuredRuntimeEnvKeys,onFeishuEnabledChange:async oe=>{const $e={...O,deployment:{...O.deployment??{feishuEnabled:!1},feishuEnabled:oe}},st=await GS(SS($e));k($e),Pe(st)},deploymentEnv:$r.specs,requiredSecretEnv:Lo,requiredSecretEnvValues:C,onRequiredSecretEnvChange:P,deploymentEnvValues:{...(bi=Ti.deployment)==null?void 0:bi.envValues,...C,...$r.fixedValues},onDeploymentEnvChange:Pn,onFeishuCredentialsChange:(oe,$e)=>or({FEISHU_APP_ID:oe,FEISHU_APP_SECRET:$e}),network:(Fa=O.deployment)==null?void 0:Fa.network,onNetworkChange:oe=>k($e=>({...$e,deployment:{...$e.deployment??{feishuEnabled:!1},network:oe}})),deployRegion:_e,onDeployRegionChange:ae,deploymentTelemetry:{source:"scratch",createMode:o,aiAssisted:z},onExportYaml:()=>son(`${Ti.name||"agent"}.yaml`,Nan(Ti,{heading:v("yaml.heading"),importHint:v("yaml.importHint")}),"text/yaml")}):a.jsxs("div",{className:"cw-publish-loading",role:"status",children:[a.jsx(Bi,{className:"cw-i cw-spin"}),a.jsx("strong",{children:v("traditional.publish.generating")}),a.jsx("span",{children:v("traditional.publish.validating")})]})})]}),a.jsx(Don,{mode:Y,busy:Ee,nextDisabled:Y==="build"&&ya&&ie,onChange:$a,assistant:Y==="build"?rs:void 0}),Kt&&a.jsx(iUe,{testRunId:Kt.runId,sessionId:Kt.sessionId,title:v("traditional.debug.traceTitle",{name:Kt.variantName}),onClose:()=>Et(null)}),vt&&a.jsx(Ad,{variant:"warning",title:v("traditional.debug.leaveTitle"),description:v("traditional.debug.leaveDescription"),confirmLabel:v(mt?"traditional.debug.cleaning":"traditional.debug.confirmLeave"),closeLabel:v("traditional.debug.closeLeaveConfirmation"),busy:mt,onCancel:bl,onConfirm:()=>void Bu()}),U&&a.jsx("div",{className:"confirm-scrim",onClick:()=>J(null),children:a.jsxs("div",{className:"confirm-box cw-ai-error-dialog",role:"alertdialog","aria-modal":"true","aria-labelledby":"ai-generate-error-title","aria-describedby":"ai-generate-error-message",onClick:oe=>oe.stopPropagation(),children:[a.jsx("div",{className:"confirm-title",id:"ai-generate-error-title",children:v("traditional.ai.failed")}),a.jsx("div",{className:"cw-ai-error-message",id:"ai-generate-error-message",children:U}),a.jsx("div",{className:"confirm-actions",children:a.jsx("button",{type:"button",className:"confirm-btn cw-ai-error-close",onClick:()=>J(null),children:v("common.close")})})]})})]})}const Lon=p.lazy(()=>Js(()=>import("../chunks/QuickAgentCreateDialog-04pJjJQJ.js"),__vite__mapDeps([4,5])));function Gd({name:e}){const t={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};switch(e){case"branch":return a.jsxs("svg",{...t,children:[a.jsx("circle",{cx:"6",cy:"5",r:"2"}),a.jsx("circle",{cx:"18",cy:"7",r:"2"}),a.jsx("circle",{cx:"18",cy:"17",r:"2"}),a.jsx("path",{d:"M8 5h2.5A3.5 3.5 0 0 1 14 8.5v7A1.5 1.5 0 0 0 15.5 17H16"}),a.jsx("path",{d:"M14 10.5v-2A1.5 1.5 0 0 1 15.5 7H16"})]});case"plan":return a.jsxs("svg",{...t,children:[a.jsx("path",{d:"M6.5 3.5h11a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2h-11a2 2 0 0 1-2-2v-13a2 2 0 0 1 2-2Z"}),a.jsx("path",{d:"m8 9 1.4 1.4L12 7.8M13.5 10H16M8 15l1.4 1.4 2.6-2.6M13.5 16H16"})]});case"collaborate":return a.jsxs("svg",{...t,children:[a.jsx("circle",{cx:"8",cy:"8",r:"3"}),a.jsx("circle",{cx:"17",cy:"9",r:"2.5"}),a.jsx("path",{d:"M3.5 19a4.5 4.5 0 0 1 9 0M13.5 15.5A4 4 0 0 1 20.5 18"})]});case"summary":return a.jsx("svg",{...t,children:a.jsx("path",{d:"M5 4h14v16H5zM8 8h8M8 12h8M8 16h5"})});case"skills":return a.jsxs("svg",{...t,children:[a.jsx("path",{d:"M5 5h5v5H5zM14 5h5v5h-5zM5 14h5v5H5z"}),a.jsx("path",{d:"M14 16.5h5M16.5 14v5"})]});case"trace":return a.jsxs("svg",{...t,children:[a.jsx("circle",{cx:"6",cy:"6",r:"2"}),a.jsx("circle",{cx:"18",cy:"12",r:"2"}),a.jsx("circle",{cx:"8",cy:"18",r:"2"}),a.jsx("path",{d:"M8 6h3a3 3 0 0 1 3 3v0a3 3 0 0 0 2 2.83M16.2 13.2 9.8 16.8"})]});case"structure":return a.jsxs("svg",{...t,children:[a.jsx("rect",{x:"3.5",y:"4",width:"7",height:"5",rx:"1"}),a.jsx("rect",{x:"13.5",y:"15",width:"7",height:"5",rx:"1"}),a.jsx("path",{d:"M10.5 6.5h3A3.5 3.5 0 0 1 17 10v5M7 9v7a2 2 0 0 0 2 2h4.5"})]});case"model":return a.jsxs("svg",{...t,children:[a.jsx("path",{d:"M8 3.5v3M16 3.5v3M8 17.5v3M16 17.5v3M3.5 8h3M17.5 8h3M3.5 16h3M17.5 16h3"}),a.jsx("rect",{x:"6.5",y:"6.5",width:"11",height:"11",rx:"2"}),a.jsx("path",{d:"M10 10h4v4h-4z"})]});case"environment":return a.jsxs("svg",{...t,children:[a.jsx("path",{d:"M4 7.5h16M7 4h10l3 3.5v10L17 20H7l-3-2.5v-10Z"}),a.jsx("path",{d:"m8 12 2 2-2 2M12.5 16H16"})]});case"deploy":return a.jsxs("svg",{...t,children:[a.jsx("path",{d:"M12 3.5v11M7.5 8 12 3.5 16.5 8"}),a.jsx("path",{d:"M5 13.5v5A1.5 1.5 0 0 0 6.5 20h11a1.5 1.5 0 0 0 1.5-1.5v-5"})]});case"workflow":return a.jsxs("svg",{...t,children:[a.jsx("rect",{x:"4",y:"4",width:"6",height:"5",rx:"1"}),a.jsx("rect",{x:"14",y:"15",width:"6",height:"5",rx:"1"}),a.jsx("path",{d:"M10 6.5h2a4 4 0 0 1 4 4V15M7 9v3a4 4 0 0 0 4 4h3"})]})}}function $on({onSelectVulcan:e,onSelectDeepseek:t,onSelectTraditional:n}){const{t:i}=Te("create"),r=kD(),[s,o]=p.useState(!1),[l,c]=p.useState(!1),[u,d]=p.useState(!1),f=p.useRef(null),h=g=>{if(!s){if(r){g();return}f.current=g,o(!0)}},m=()=>{if(!s)return;const g=f.current;f.current=null,g==null||g()};return a.jsxs(Ar.main,{className:`agent-creation-mode-picker${s?" is-leaving":""}`,initial:r?!1:{opacity:0},animate:{opacity:s?0:1},transition:{duration:s?.12:.18,ease:[.16,1,.3,1]},onAnimationComplete:m,children:[a.jsxs("section",{className:"agent-creation-mode-picker__content","aria-labelledby":"agent-creation-mode-picker-title",children:[a.jsxs("header",{className:"agent-creation-mode-picker__header",children:[a.jsx("h1",{id:"agent-creation-mode-picker-title",children:i("modePicker.title")}),a.jsx("p",{children:i("modePicker.subtitle")})]}),a.jsxs("div",{className:"agent-creation-mode-picker__options",children:[a.jsxs(Tt,{type:"button",className:"agent-creation-mode-picker__card",color:"secondary",variant:"outline",pill:!1,block:!0,onClick:()=>{d(!0),c(!0)},children:[a.jsxs("span",{className:"agent-creation-mode-picker__card-header",children:[a.jsx(Jw,{className:"agent-creation-mode-picker__avatar is-vulcan",seed:i("modePicker.quick.title")}),a.jsxs("span",{className:"agent-creation-mode-picker__card-copy",children:[a.jsx("span",{className:"agent-creation-mode-picker__card-title",children:i("modePicker.quick.title")}),a.jsx("span",{className:"agent-creation-mode-picker__card-description",children:i("modePicker.quick.description")})]})]}),a.jsx("span",{className:"agent-creation-mode-picker__divider","aria-hidden":"true"}),a.jsxs("span",{className:"agent-creation-mode-picker__features",children:[a.jsx("span",{children:i("modePicker.features")}),a.jsxs("span",{className:"agent-creation-mode-picker__feature-grid",children:[a.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[a.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:a.jsx(Gd,{name:"branch"})}),a.jsx("span",{children:i("modePicker.quick.features.dynamicSubagents")})]}),a.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[a.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:a.jsx(Gd,{name:"plan"})}),a.jsx("span",{children:i("modePicker.quick.features.autonomousPlanning")})]}),a.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[a.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:a.jsx(Gd,{name:"collaborate"})}),a.jsx("span",{children:i("modePicker.quick.features.collaboration")})]}),a.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[a.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:a.jsx(Gd,{name:"summary"})}),a.jsx("span",{children:i("modePicker.quick.features.summary")})]}),a.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[a.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:a.jsx(Gd,{name:"skills"})}),a.jsx("span",{children:i("modePicker.quick.features.skills")})]}),a.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[a.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:a.jsx(Gd,{name:"trace"})}),a.jsx("span",{children:i("modePicker.quick.features.trace")})]})]})]})]}),a.jsxs(Tt,{type:"button",className:"agent-creation-mode-picker__card",color:"secondary",variant:"outline",pill:!1,block:!0,onClick:()=>h(n),children:[a.jsxs("span",{className:"agent-creation-mode-picker__card-header",children:[a.jsx(Jw,{className:"agent-creation-mode-picker__avatar is-traditional",seed:i("modePicker.traditional.title")}),a.jsxs("span",{className:"agent-creation-mode-picker__card-copy",children:[a.jsx("span",{className:"agent-creation-mode-picker__card-title",children:i("modePicker.traditional.title")}),a.jsx("span",{className:"agent-creation-mode-picker__card-description",children:i("modePicker.traditional.description")})]})]}),a.jsx("span",{className:"agent-creation-mode-picker__divider","aria-hidden":"true"}),a.jsxs("span",{className:"agent-creation-mode-picker__features",children:[a.jsx("span",{children:i("modePicker.features")}),a.jsxs("span",{className:"agent-creation-mode-picker__feature-grid",children:[a.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[a.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:a.jsx(Gd,{name:"structure"})}),a.jsx("span",{children:i("modePicker.traditional.features.visualConfig")})]}),a.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[a.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:a.jsx(Gd,{name:"model"})}),a.jsx("span",{children:i("modePicker.traditional.features.migration")})]}),a.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[a.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:a.jsx(Gd,{name:"environment"})}),a.jsx("span",{children:i("modePicker.traditional.features.debugging")})]}),a.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[a.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:a.jsx(Gd,{name:"deploy"})}),a.jsx("span",{children:i("modePicker.traditional.features.optimization")})]}),a.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[a.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:a.jsx(Gd,{name:"workflow"})}),a.jsx("span",{children:i("modePicker.traditional.features.parameters")})]})]})]})]})]})]}),u&&a.jsx(p.Suspense,{fallback:null,children:a.jsx(Lon,{open:l,onClose:()=>c(!1),onSelect:g=>{c(!1),h(g==="deepseek"?t:e)}})})]})}const Ij="\0custom";function hUe({label:e,value:t,options:n,onChange:i,allowCustom:r=!1,allowEmpty:s=!0,disabled:o=!1,placeholder:l,error:c,describedBy:u}){const{t:d}=Te("deepseek"),f=p.useId(),[h,m]=p.useState(!1),g=r&&(h||!!(t&&!n.includes(t)));return a.jsxs("div",{className:"dsh-native-choice",children:[a.jsx(xf,{ariaLabel:e,value:g?Ij:t,valueLabel:t,placeholder:l??d("optional"),disabled:o,options:[...s?[{value:"",label:d("optional")}]:[],...n.map(b=>({value:b,label:b})),...r?[{value:Ij,label:d("customValue")}]:[]],onChange:b=>{m(b===Ij),b!==Ij&&i(b)}}),g&&a.jsxs("div",{className:"dsh-custom-value",children:[a.jsx("label",{className:"cw-label",htmlFor:f,children:d("customField",{field:e})}),a.jsx("input",{id:f,className:"cw-input",value:t,autoComplete:"off",spellCheck:!1,placeholder:d("enterCustomValue"),"aria-invalid":!!c,"aria-describedby":u,onChange:b=>i(b.target.value)})]})]})}const Fon=String.raw`import { createServer } from 'node:http'; +`)}}).sort((t,n)=>Number(t.long)-Number(n.long))}function iUe({appName:e,testRunId:t,sessionId:n,endTimeMs:i,onClose:r,title:s}){const{t:o}=Te("conversation"),[l,c]=p.useState(null),[u,d]=p.useState("loading"),[f,h]=p.useState(0),[m,g]=p.useState(new Set),[b,v]=p.useState(null),y=p.useRef(0),w=`${e??""}:${t??""}:${n}:${i??""}`,x=p.useRef(w);p.useEffect(()=>{x.current!==w&&(x.current=w,y.current=0),c(null),d("loading");let A=!1,N,P;if(t)P=N2e(t,n);else if(e)P=YR(e,n,i);else{d("error");return}return P.then(I=>{A||(c(I),d("ready"),v(I.length?I.reduce((D,_)=>D.start_time<=_.start_time?D:_).span_id:null))}).catch(I=>{if(A)return;const D=Jan(I instanceof Error?I.message:String(I));d(D),D==="collecting"&&y.currenth(_=>_+1),Zan))}),()=>{A=!0,N!==void 0&&window.clearTimeout(N)}},[e,i,f,n,w,t]);const O=()=>{y.current=0,h(A=>A+1)},{rootNodes:k,min:S,total:C}=p.useMemo(()=>eon(l??[]),[l]),E=p.useMemo(()=>ton(k,m),[k,m]),j=(l==null?void 0:l.find(A=>A.span_id===b))??null,T=C/1e6,R=A=>g(N=>{const P=new Set(N);return P.has(A)?P.delete(A):P.add(A),P});return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"drawer-scrim",onClick:r}),a.jsxs("aside",{className:"drawer drawer--trace",children:[a.jsxs("header",{className:"drawer-head",children:[a.jsxs("div",{children:[a.jsx("div",{className:"drawer-title",children:s??o("trace.title")}),a.jsx("div",{className:"drawer-sub",children:u==="ready"&&l?o("trace.callCount",{count:l.length,duration:T.toFixed(1)}):o(`trace.statuses.${u}`)})]}),a.jsx("button",{className:"drawer-close",onClick:r,"aria-label":o("trace.close"),children:a.jsx(Mo,{className:"icon"})})]}),u==="loading"&&a.jsxs("div",{className:"drawer-loading",children:[a.jsx(Bi,{className:"icon spin"})," ",o("trace.loading")]}),u==="collecting"&&a.jsxs("div",{className:"drawer-loading",role:"status","aria-live":"polite",children:[a.jsx(Bi,{className:"icon spin"}),a.jsx("span",{children:o("trace.errors.collecting")}),a.jsx(Tt,{type:"button",color:"secondary",variant:"outline",size:"sm",pill:!1,onClick:O,children:o("trace.retryNow")})]}),(u==="disabled"||u==="forbidden"||u==="error")&&a.jsxs("div",{className:"drawer-empty trace-state",role:"alert",children:[a.jsx("span",{children:o(`trace.errors.${u}`)}),u==="error"&&a.jsx(Tt,{type:"button",color:"secondary",variant:"outline",size:"sm",pill:!1,onClick:O,children:o("trace.reload")})]}),u==="ready"&&l&&l.length===0&&a.jsx("div",{className:"drawer-empty",children:o("trace.empty")}),E.length>0&&a.jsxs("div",{className:"trace-split",children:[a.jsx("div",{className:"trace-tree scroll",children:E.map(A=>{const N=A.span,P=(N.start_time-S)/C*100,I=Math.max((N.end_time-N.start_time)/C*100,.6),D=A.children.length>0;return a.jsxs("button",{className:`trace-row ${b===N.span_id?"active":""}`,onClick:()=>v(N.span_id),children:[a.jsxs("span",{className:"trace-label",style:{paddingLeft:A.depth*14},children:[a.jsx("span",{className:`trace-caret ${D?"":"hidden"} ${m.has(N.span_id)?"":"open"}`,onClick:_=>{_.stopPropagation(),D&&R(N.span_id)},children:a.jsx(BA,{className:"chev"})}),a.jsx("span",{className:"trace-dot",style:{background:M6(N.name)}}),a.jsx("span",{className:"trace-name",title:N.name,children:N.name})]}),a.jsx("span",{className:"trace-dur",children:yce(N.end_time-N.start_time)}),a.jsx("span",{className:"trace-track",children:a.jsx("span",{className:"trace-bar",style:{left:`${P}%`,width:`${I}%`,background:M6(N.name)}})})]},N.span_id)})}),a.jsx("div",{className:"trace-detail scroll",children:j?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"td-title",children:j.name}),a.jsxs("div",{className:"td-dur",children:[a.jsx("span",{className:"td-dot",style:{background:M6(j.name)}}),yce(j.end_time-j.start_time)]}),a.jsx("div",{className:"td-section",children:o("trace.attributes")}),a.jsx("div",{className:"td-props",children:vce(j).filter(A=>!A.long).map(A=>a.jsxs("div",{className:"td-prop",children:[a.jsx("span",{className:"td-key",children:A.key}),a.jsx("span",{className:"td-val",children:A.value})]},A.key))}),vce(j).filter(A=>A.long).map(A=>a.jsxs("div",{className:"td-block",children:[a.jsx("div",{className:"td-section",children:A.key}),a.jsx("pre",{className:"td-pre",children:A.value})]},A.key))]}):a.jsx("div",{className:"drawer-empty",children:o("trace.selectCall")})})]})]})]})}const ion=p.lazy(()=>Js(()=>import("../chunks/MarkdownPromptEditor-C8Q2sj5P.js"),__vite__mapDeps([2,3]))),dU="veadk.generatedAgentTestRuns",L6=4;function LK(){if(typeof window>"u")return[];try{const e=JSON.parse(window.sessionStorage.getItem(dU)??"[]");return Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.length>0):[]}catch{return[]}}function rUe(e){if(typeof window>"u")return;const t=Array.from(new Set(e)).slice(-20);try{t.length?window.sessionStorage.setItem(dU,JSON.stringify(t)):window.sessionStorage.removeItem(dU)}catch{}}function ron(e){rUe([...LK(),e])}function Lk(e){rUe(LK().filter(t=>t!==e))}function son(e,t,n="text/plain"){const i=URL.createObjectURL(new Blob([t],{type:`${n};charset=utf-8`})),r=document.createElement("a");r.href=i,r.download=e,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(i)}const aon=[{id:"type",label:"traditional.sections.type.label",hint:"traditional.sections.type.hint",icon:Gat,required:!0},{id:"basic",label:"traditional.sections.basic.label",hint:"traditional.sections.basic.hint",icon:gm,required:!0},{id:"model",label:"traditional.sections.model.label",hint:"traditional.sections.model.hint",icon:jat},{id:"tools",label:"traditional.sections.tools.label",hint:"traditional.sections.tools.hint",icon:Zat},{id:"skills",label:"traditional.sections.skills.label",hint:"traditional.sections.skills.hint",icon:lC},{id:"knowledge",label:"traditional.sections.knowledge.label",hint:"traditional.sections.knowledge.hint",icon:gN},{id:"memory",label:"traditional.sections.memory.label",hint:"traditional.sections.memory.hint",icon:Fje},{id:"subagents",label:"traditional.sections.subagents.label",hint:"traditional.sections.subagents.hint",icon:kat},{id:"review",label:"traditional.sections.review.label",hint:"traditional.sections.review.hint",icon:Kat}];function oon({className:e}){return a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M9 7.15v9.7a1.15 1.15 0 0 0 1.78.96l7.2-4.85a1.15 1.15 0 0 0 0-1.92l-7.2-4.85A1.15 1.15 0 0 0 9 7.15Z"}),a.jsx("path",{d:"M5.75 8.25v7.5",opacity:"0.8"}),a.jsx("path",{d:"M3 10v4",opacity:"0.45"}),a.jsx("path",{d:"M17.9 5.25v2.2M19 6.35h-2.2",strokeWidth:"1.55"})]})}function xce({className:e}){return a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M4.75 7.25h14.5"}),a.jsx("path",{d:"M9.1 4.75h5.8l.75 2.5h-7.3l.75-2.5Z"}),a.jsx("path",{d:"m6.75 7.25.75 12h9l.75-12"}),a.jsx("path",{d:"M10 10.25v5.75M14 10.25v5.75"})]})}function $K({className:e}){return a.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"m7 9 5 5 5-5"})})}function FK({className:e}){return a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M18.25 8.2A7.1 7.1 0 0 0 6.1 6.65L4.5 8.25"}),a.jsx("path",{d:"M4.5 4.75v3.5H8"}),a.jsx("path",{d:"M5.75 15.8A7.1 7.1 0 0 0 17.9 17.35l1.6-1.6"}),a.jsx("path",{d:"M19.5 19.25v-3.5H16"})]})}const lon={llm:"traditional.agentTypes.llm.label",sequential:"traditional.agentTypes.sequential.label",parallel:"traditional.agentTypes.parallel.label",loop:"traditional.agentTypes.loop.label",a2a:"traditional.agentTypes.a2a.label"},wce={REGISTRY_SPACE_ID:"registrySpaceId",REGISTRY_TOP_K:"registryTopK",REGISTRY_REGION:"registryRegion",REGISTRY_ENDPOINT:"registryEndpoint"},sUe="REGISTRY_SPACE_ID",con=jIe.filter(e=>e.key!==sUe);function aUe(e,t,n="volcengine"){var s,o,l;if(!(e!=null&&e.enabled))return{};const i=mM(n),r={REGISTRY_SPACE_ID:e.registrySpaceId??""};return t.includeDefaults?(r.REGISTRY_TOP_K=((s=e.registryTopK)==null?void 0:s.trim())||i.topK,r.REGISTRY_REGION=((o=e.registryRegion)==null?void 0:o.trim())||i.region,r.REGISTRY_ENDPOINT=((l=e.registryEndpoint)==null?void 0:l.trim())||i.endpoint):(r.REGISTRY_TOP_K=e.registryTopK??"",r.REGISTRY_REGION=e.registryRegion??"",r.REGISTRY_ENDPOINT=e.registryEndpoint??""),r}function hx(e,t){if(t!=="byteplus")return e;const n=mM(t);return e.map(i=>i.key==="REGISTRY_REGION"?{...i,placeholder:n.region}:i.key==="REGISTRY_ENDPOINT"?{...i,placeholder:n.endpoint}:i.key==="MODEL_EMBEDDING_NAME"?{...i,placeholder:ott(t)}:i.key==="MODEL_EMBEDDING_API_BASE"?{...i,placeholder:Do(t)}:i.key==="MODEL_IMAGE_NAME"?{...i,placeholder:ctt(t)}:i.key==="MODEL_EDIT_NAME"?{...i,placeholder:utt(t)}:i.key==="MODEL_VIDEO_NAME"?{...i,placeholder:dtt(t)}:i.key==="MODEL_IMAGE_API_BASE"||i.key==="MODEL_EDIT_API_BASE"||i.key==="MODEL_VIDEO_API_BASE"?{...i,placeholder:Do(t)}:i)}function uon({items:e,selected:t,onToggle:n,scrollRows:i}){const{t:r}=Te("create");return a.jsx("div",{className:`cw-checklist ${i?"cw-checklist-tools":""}`,style:i?{"--cw-checklist-max-height":`${i*40+(i-1)*8}px`}:void 0,children:e.map(s=>{const o=t.includes(s.id);return a.jsx(DK,{id:`cw-check-${s.id}`,className:`cw-check ${o?"is-on":""}`,checked:o,onCheckedChange:l=>{l!==o&&n(s.id)},label:a.jsx("span",{className:"cw-check-text",children:a.jsx("span",{className:"cw-check-title",children:r(`traditional.catalog.${s.id}.label`,{defaultValue:s.label})})})},s.id)})})}function $6({options:e,value:t,onChange:n,translationGroup:i}){const{t:r}=Te("create");return a.jsx("div",{className:"cw-segmented",children:e.map(s=>{var l;const o=(t??((l=e[0])==null?void 0:l.id))===s.id;return a.jsx("button",{type:"button",className:`cw-seg ${o?"is-on":""}`,onClick:()=>n(s.id),"aria-pressed":o,children:a.jsx("span",{className:"cw-seg-title",children:r(`traditional.backends.${i}.${s.id}.label`,{defaultValue:s.label})})},s.id)})})}function don(e){return/(SECRET|PASSWORD|KEY|TOKEN)$/.test(e)}function $k({env:e,values:t,onChange:n,renderAfterField:i}){const{t:r}=Te("create"),s=e.filter(o=>!o.hidden);return s.length===0?a.jsx("p",{className:"cw-env-empty",children:r("traditional.env.noAdditionalParameters")}):a.jsx("div",{className:"cw-env-fields",children:s.map(o=>{const l=t[o.key]??o.defaultValue??"",c=IK(o,t,r("traditional.env.invalidJson")),u=`cw-env-${o.key}`;return a.jsxs(p.Fragment,{children:[a.jsxs("label",{className:"cw-env-field",htmlFor:u,children:[a.jsxs("span",{className:"cw-env-field-head",children:[a.jsxs("span",{className:"cw-env-field-title",children:[a.jsxs("span",{className:"cw-env-field-label",children:[o.comment||o.key,o.required&&a.jsx("span",{className:"cw-req",children:"*"})]}),o.help&&a.jsxs("span",{className:"cw-env-help",tabIndex:0,"data-help":o.help,"aria-label":r("traditional.env.helpAriaLabel",{label:o.comment||o.key,help:o.help}),children:["?",a.jsx("span",{className:"cw-env-help-popover",role:"tooltip",children:o.help})]}),o.link&&a.jsx("a",{className:"cw-env-link",href:o.link.url,target:"_blank",rel:"noopener noreferrer",title:r("traditional.env.openOpenViking",{label:o.link.label}),"aria-label":r("traditional.env.openOpenViking",{label:o.link.label}),onClick:d=>d.stopPropagation(),children:a.jsx(d0,{"aria-hidden":"true"})})]}),o.comment&&a.jsx("code",{title:o.key,children:o.key})]}),o.multiline||o.format==="json"?a.jsx("textarea",{id:u,className:"cw-input cw-env-textarea",value:l,placeholder:o.placeholder||r("traditional.env.valuePlaceholder"),autoComplete:"off",spellCheck:!1,"aria-invalid":!!c,onChange:d=>n(o.key,d.currentTarget.value)}):a.jsx("input",{id:u,className:"cw-input",type:don(o.key)?"password":"text",value:l,placeholder:o.placeholder||r("traditional.env.valuePlaceholder"),autoComplete:"off","aria-invalid":!!c,onChange:d=>n(o.key,d.currentTarget.value)}),c&&a.jsx("span",{className:"cw-env-error",children:c})]}),i==null?void 0:i(o)]},o.key)})})}function fon({value:e,onChange:t}){const{t:n}=Te("create"),i="cw-openviking-knowledge-index",r=n("traditional.env.openVikingIndexHelp");return a.jsxs("label",{className:"cw-env-field",htmlFor:i,children:[a.jsx("span",{className:"cw-env-field-head",children:a.jsxs("span",{className:"cw-env-field-title",children:[a.jsx("span",{className:"cw-env-field-label",children:n("traditional.env.openVikingIndex")}),a.jsxs("span",{className:"cw-env-help",tabIndex:0,"data-help":r,"aria-label":n("traditional.env.openVikingIndexAriaLabel",{help:r}),children:["?",a.jsx("span",{className:"cw-env-help-popover",role:"tooltip",children:r})]})]})}),a.jsx("input",{id:i,className:"cw-input",value:e,placeholder:"",autoComplete:"off",onChange:s=>t(s.currentTarget.value)})]})}function F6(e,t=Xt("traditional.resources.unnamedAgentCenter")){return e.name.trim()||t}function Oce(e,t=Xt("traditional.resources.unnamedKnowledgeBase")){const n=e.name.trim()||e.id||t,i=[e.sourceLabel,e.projectName].filter(Boolean);return i.length?`${n} · ${i.join(" · ")}`:n}function kce(e,t=Xt("traditional.resources.unnamedMemory")){return e.name.trim()||e.id||t}function Sce(e){return e.apiKeyAllowed===!1?"modelApiKey.noModelPermission":e.unavailableReason?`modelApiKey.permissionState.${e.unavailableReason}`:e.available?"traditional.model.available":e.lifecycleStatus==="Retiring"?"traditional.model.retiring":e.activationState&&e.activationState!=="Available"?"traditional.model.notActivated":"traditional.model.unavailable"}function Ece(e){return e.apiKeyAllowed!==!1&&!e.unavailableReason&&(e.available||e.lifecycleStatus==="Retiring")}function B6({selectedLabel:e,placeholder:t,disabled:n,triggerAriaLabel:i,menuAriaLabel:r,searchAriaLabel:s,searchValue:o,searchPlaceholder:l,onSearchChange:c,empty:u,emptyLabel:d,triggerClassName:f="",optionsClassName:h="",renderOptions:m}){const[g,b]=p.useState(!1),v=p.useRef(null),y=p.useRef(null),w=p.useRef(null),x=p.useId(),[O,k]=p.useState(null);p.useEffect(()=>{if(!g)return;const E=T=>{var A;const R=T.target;R instanceof Node&&v.current&&!v.current.contains(R)&&!((A=w.current)!=null&&A.contains(R))&&b(!1)},j=T=>{var R;T.key==="Escape"&&(b(!1),(R=y.current)==null||R.focus())};return window.addEventListener("pointerdown",E),window.addEventListener("keydown",j),()=>{window.removeEventListener("pointerdown",E),window.removeEventListener("keydown",j)}},[g]),p.useEffect(()=>{if(!g){k(null);return}const E=()=>{const j=y.current;if(!j)return;const T=j.getBoundingClientRect(),R=12,A=6,N=window.innerHeight-T.bottom-R-A,P=T.top-R-A,I=N<300&&P>N,D=Math.max(96,I?P:N),_=Math.min(T.width,window.innerWidth-R*2),L=Math.min(Math.max(R,T.left),window.innerWidth-R-_);k({...I?{bottom:window.innerHeight-T.top+A}:{top:T.bottom+A},left:L,width:_,maxHeight:D,opensUp:I})};return E(),window.addEventListener("resize",E),window.addEventListener("scroll",E,!0),()=>{window.removeEventListener("resize",E),window.removeEventListener("scroll",E,!0)}},[g]);const S=()=>b(!1),C=E=>{var A,N;if(!["ArrowDown","ArrowUp","Home","End"].includes(E.key))return;const j=Array.from(((A=w.current)==null?void 0:A.querySelectorAll('[role="option"]:not(:disabled)'))??[]);if(!j.length)return;E.preventDefault();const T=j.findIndex(P=>P===document.activeElement),R=E.key==="Home"?0:E.key==="End"?j.length-1:E.key==="ArrowUp"?T<=0?j.length-1:T-1:T<0||T===j.length-1?0:T+1;(N=j[R])==null||N.focus()};return a.jsxs("div",{className:`cw-a2a-space-select-wrap cw-catalog-select${g?" is-open":""}`,ref:v,children:[a.jsxs("button",{ref:y,type:"button",className:`cw-a2a-space-trigger ${f}`.trim(),disabled:n,"aria-haspopup":"listbox","aria-controls":g?x:void 0,"aria-expanded":g,"aria-label":i,title:e,onClick:()=>{g||c(""),b(E=>!E)},children:[a.jsx("span",{className:t?"is-placeholder":void 0,children:e}),a.jsx($K,{className:"cw-a2a-space-trigger-icon"})]}),g&&O&&vi.createPortal(a.jsxs("div",{ref:w,className:`cw-a2a-space-menu cw-catalog-menu cw-catalog-menu-portal${O.opensUp?" is-up":""}`,style:{top:O.top??"auto",bottom:O.bottom??"auto",left:O.left,width:O.width,maxHeight:O.maxHeight},onKeyDown:C,children:[a.jsx("div",{className:"cw-picker-search",children:a.jsx("input",{className:"cw-picker-search-input",type:"search",value:o,autoFocus:!0,autoComplete:"off","aria-label":s,placeholder:l,onChange:E=>c(E.currentTarget.value)})}),a.jsxs("div",{id:x,className:`cw-picker-options cw-catalog-options ${h}`.trim(),role:"listbox","aria-label":r,children:[m(S),u&&a.jsx("div",{className:"cw-picker-empty",children:d})]})]}),document.body)]})}function hon({value:e,fallbacks:t,cloudProvider:n,agentName:i,apiKeyId:r,apiKeyName:s,customModelSecretValues:o,configuredRuntimeEnvKeys:l,showFallbacks:c=!0,showMissingApiKeyErrors:u,onApiKeyChange:d,onChange:f,onFallbacksChange:h,onCustomModelSecretChange:m}){const{t:g}=Te("create"),[b,v]=p.useState([]),[y,w]=p.useState(!1),[x,O]=p.useState([]),[k,S]=p.useState(null),[C,E]=p.useState(!1),[j,T]=p.useState(null),[R,A]=p.useState(0),[N,P]=p.useState(0),[I,D]=p.useState(""),[_,L]=p.useState(""),[F,M]=p.useState("");p.useEffect(()=>{const pe=new AbortController;return w(!0),T(null),xz(pe.signal,R>0).then(ke=>{if(pe.signal.aborted)return;v(ke.keys);const je=ke.keys.find(Pe=>Pe.id===r)??ke.keys.find(Pe=>Pe.name===s)??ke.keys.find(Pe=>Pe.id===ke.defaultKeyId)??ke.keys.find(Pe=>Pe.status!=="Restricted");je&&d(je)}).catch(ke=>{pe.signal.aborted||T(ke instanceof Error?ke.message:g("traditional.model.apiKeyLoadError"))}).finally(()=>{pe.signal.aborted||w(!1)}),()=>pe.abort()},[n,R,g]),p.useEffect(()=>{if(!r){O([]);return}const pe=new AbortController;return E(!0),T(null),S(null),$1({signal:pe.signal,apiKeyId:r,refresh:R>0||N>0}).then(ke=>{if(!pe.signal.aborted){const je=L7e(ke.models,ke.apiKeyModelPermissions);O(je),S(r);const Pe=new Set(je.filter(Qe=>Qe.apiKeyAllowed===!1||Qe.unavailableReason).map(Qe=>Qe.id));Pe.has(e.trim())&&f("");const Ee=t.filter(Qe=>typeof Qe!="string"||!Pe.has(Qe));Ee.length!==t.length&&h(Ee)}}).catch(ke=>{pe.signal.aborted||T(ke instanceof Error?ke.message:g("traditional.model.loadError"))}).finally(()=>{pe.signal.aborted||E(!1)}),()=>pe.abort()},[r,n,N,R,g]);const z=e.trim(),q=k===r,U=q?x:[],J=b.find(pe=>pe.id===r),V=J?J.name||g("modelApiKey.unnamed"):r?g("traditional.model.currentApiKey"):y?g("traditional.model.loadingApiKeys"):b.length===0?g("traditional.model.noApiKeys"):g("traditional.model.selectApiKey"),Z=p.useMemo(()=>b.filter(pe=>$7e(I,pe.name,cU(pe,g))),[I,b,g]),ne=U.find(pe=>pe.id===z),W=C&&!q?g("traditional.model.refreshing"):ne?`${ne.displayName} (${ne.id})`:z||g("traditional.model.selectModel"),G=p.useMemo(()=>U.filter(pe=>Sg(_,[pe.displayName,pe.id,pe.name,pe.vendorName,pe.activationState,pe.lifecycleStatus])),[_,U]),H=!!(z&&!ne&&Sg(_,[z])),se=U.filter(pe=>pe.available).length,Y=n==="byteplus"?"BytePlus ModelArk":g("traditional.model.volcengineArk"),X=att(n),ie=Nu(z,t),ee=new Set(E7e(z,ie)),be=pe=>{const ke=pe.trim();return U.filter(je=>{const Pe=je.id.trim();return!(Pe!==ke&&ee.has(Pe))&&!(Pe!==ke&&Pe===z)&&Sg(F,[je.displayName,je.id,je.name,je.vendorName,je.activationState,je.lifecycleStatus])})},ue=(pe,ke)=>{const je=[...t];je[pe]=ke,h(Nu(z,je))};return a.jsxs("div",{className:"cw-a2a-space-picker cw-model-picker",children:[a.jsxs("div",{className:"cw-model-picker-stack",children:[a.jsxs("div",{className:"cw-model-picker-field",children:[a.jsx("span",{className:"cw-model-picker-label",children:"API Key"}),a.jsx(B6,{selectedLabel:V,placeholder:!r,disabled:y,triggerAriaLabel:g("traditional.model.selectApiKey"),menuAriaLabel:g("traditional.model.apiKeyList"),searchAriaLabel:g("traditional.model.searchApiKey"),searchValue:I,searchPlaceholder:g("modelApiKey.search"),onSearchChange:D,empty:Z.length===0,emptyLabel:g("traditional.model.noMatchingApiKey"),optionsClassName:"cw-model-key-options",renderOptions:pe=>Z.map(ke=>{const je=ke.id===r,Pe=cU(ke,g);return a.jsx("button",{type:"button",role:"option","aria-selected":je,disabled:ke.status==="Restricted",className:`cw-a2a-space-option cw-model-key-option ${je?"is-selected":""}`,title:`${ke.name||g("modelApiKey.unnamed")} · ${Pe}`,onClick:()=>{P(Ee=>Ee+1),d(ke),pe()},children:a.jsxs("span",{className:"cw-model-option-copy",children:[a.jsx("strong",{children:ke.name||g("modelApiKey.unnamed")}),a.jsx("small",{children:Pe})]})},ke.id)})})]}),a.jsxs("div",{className:"cw-model-picker-field",children:[a.jsx("span",{className:"cw-model-picker-label",children:g("traditional.model.label")}),a.jsxs("div",{className:"cw-a2a-space-row",children:[a.jsx(B6,{selectedLabel:W,placeholder:!z,disabled:C,triggerAriaLabel:g("traditional.model.selectProviderModel",{provider:Y}),menuAriaLabel:g("traditional.model.providerModels",{provider:Y}),searchAriaLabel:g("traditional.model.search"),searchValue:_,searchPlaceholder:g("traditional.model.searchPlaceholder"),onSearchChange:L,empty:!H&&G.length===0,emptyLabel:g("traditional.model.noMatches"),triggerClassName:"cw-model-trigger",optionsClassName:"cw-model-options",renderOptions:pe=>a.jsxs(a.Fragment,{children:[H&&a.jsxs("button",{type:"button",role:"option","aria-selected":!0,className:"cw-a2a-space-option cw-model-option is-selected",onClick:()=>{f(z),pe()},children:[a.jsxs("span",{className:"cw-model-option-copy",children:[a.jsx("strong",{children:g("traditional.model.currentConfiguration")}),a.jsx("small",{children:z})]}),a.jsx("span",{className:"cw-model-status is-unknown",children:g("traditional.model.unknownStatus")})]}),G.map(ke=>{const je=ke.id===z,Pe=Ece(ke);return ke.apiKeyAllowed!==!1&&!ke.unavailableReason&&!Pe&&ke.activationState!=="Available"?a.jsxs("button",{type:"button",role:"option","aria-selected":!1,className:"cw-a2a-space-option cw-model-option is-activation-link",title:g("traditional.model.activate",{provider:Y,model:ke.displayName}),onClick:()=>{window.open(X,"_blank","noopener,noreferrer"),pe()},children:[a.jsxs("span",{className:"cw-model-option-copy",children:[a.jsx("strong",{children:ke.displayName}),a.jsxs("small",{children:[ke.id,ke.vendorName?` · ${ke.vendorName}`:""]})]}),a.jsx("span",{className:"cw-model-status is-unavailable",children:g("traditional.model.activateAction")})]},ke.id):a.jsxs("button",{type:"button",role:"option","aria-selected":je,disabled:!Pe,className:`cw-a2a-space-option cw-model-option ${je?"is-selected":""}`,title:`${ke.displayName} (${ke.id})`,onClick:()=>{f(ke.id),pe()},children:[a.jsxs("span",{className:"cw-model-option-copy",children:[a.jsx("strong",{children:ke.displayName}),a.jsxs("small",{children:[ke.id,ke.vendorName?` · ${ke.vendorName}`:""]})]}),a.jsx("span",{className:`cw-model-status ${ke.apiKeyAllowed===!1||ke.unavailableReason?"is-unavailable":ke.available?"is-available":ke.lifecycleStatus==="Retiring"?"is-retiring":"is-unavailable"}`,children:g(Sce(ke))})]},ke.id)})]})}),a.jsx("button",{type:"button",className:"cw-icon-btn cw-a2a-space-refresh",title:g("traditional.model.refresh"),"aria-label":g("traditional.model.refresh"),disabled:C||y,onClick:()=>A(pe=>pe+1),children:C||y?a.jsx(Bi,{className:"cw-i cw-i-sm cw-spin"}):a.jsx(FK,{className:"cw-i cw-i-sm"})})]})]}),c?a.jsx(FP,{variant:"traditional",embedded:!0,primaryModelName:z,agentName:i,value:t,secretValues:o,configuredSecretEnvKeys:l,showMissingApiKeyErrors:u,onChange:h,onSecretChange:m,renderSameProviderField:({index:pe,value:ke})=>{const je=U.find(_e=>_e.id===ke.trim()),Pe=be(ke),Ee=!!(ke.trim()&&!je&&Sg(F,[ke])),Qe=je?`${je.displayName} (${je.id})`:ke||g("traditional.model.fallbackPlaceholder");return a.jsx(B6,{selectedLabel:Qe,placeholder:!ke.trim(),disabled:C||!r,triggerAriaLabel:g("traditional.model.selectProviderModel",{provider:Y}),menuAriaLabel:g("traditional.model.providerModels",{provider:Y}),searchAriaLabel:g("traditional.model.search"),searchValue:F,searchPlaceholder:g("traditional.model.searchPlaceholder"),onSearchChange:M,empty:!Ee&&Pe.length===0,emptyLabel:g("traditional.model.noMatches"),triggerClassName:"cw-model-trigger",optionsClassName:"cw-model-options",renderOptions:_e=>a.jsxs(a.Fragment,{children:[Ee&&a.jsxs("button",{type:"button",role:"option","aria-selected":!0,className:"cw-a2a-space-option cw-model-option is-selected",onClick:()=>{ue(pe,ke),_e()},children:[a.jsxs("span",{className:"cw-model-option-copy",children:[a.jsx("strong",{children:g("traditional.model.currentConfiguration")}),a.jsx("small",{children:ke})]}),a.jsx("span",{className:"cw-model-status is-unknown",children:g("traditional.model.unknownStatus")})]}),Pe.map(ae=>{const le=ae.id===ke.trim(),ge=Ece(ae);return ae.apiKeyAllowed!==!1&&!ae.unavailableReason&&!ge&&ae.activationState!=="Available"?a.jsxs("button",{type:"button",role:"option","aria-selected":!1,className:"cw-a2a-space-option cw-model-option is-activation-link",title:g("traditional.model.activate",{provider:Y,model:ae.displayName}),onClick:()=>{window.open(X,"_blank","noopener,noreferrer"),_e()},children:[a.jsxs("span",{className:"cw-model-option-copy",children:[a.jsx("strong",{children:ae.displayName}),a.jsxs("small",{children:[ae.id,ae.vendorName?` · ${ae.vendorName}`:""]})]}),a.jsx("span",{className:"cw-model-status is-unavailable",children:g("traditional.model.activateAction")})]},ae.id):a.jsxs("button",{type:"button",role:"option","aria-selected":le,disabled:!ge,className:`cw-a2a-space-option cw-model-option ${le?"is-selected":""}`,title:`${ae.displayName} (${ae.id})`,onClick:()=>{ue(pe,ae.id),_e()},children:[a.jsxs("span",{className:"cw-model-option-copy",children:[a.jsx("strong",{children:ae.displayName}),a.jsxs("small",{children:[ae.id,ae.vendorName?` · ${ae.vendorName}`:""]})]}),a.jsx("span",{className:`cw-model-status ${ae.apiKeyAllowed===!1||ae.unavailableReason?"is-unavailable":ae.available?"is-available":ae.lifecycleStatus==="Retiring"?"is-retiring":"is-unavailable"}`,children:g(Sce(ae))})]},ae.id)})]})})}}):null]}),j?a.jsxs("div",{className:"cw-banner cw-a2a-space-error",role:"alert",children:[a.jsx(gm,{className:"cw-i"}),a.jsx("span",{children:j})]}):C?null:U.length===0?a.jsx("span",{className:"cw-help",children:g("traditional.model.empty")}):a.jsx("span",{className:"cw-help",children:g("traditional.model.loaded",{count:U.length,available:se})})]})}function pon({value:e,region:t,invalid:n,onChange:i}){const{t:r}=Te("create"),s=t.trim()||ow.region,[o,l]=p.useState([]),[c,u]=p.useState(!1),[d,f]=p.useState(null),[h,m]=p.useState(0),[g,b]=p.useState(!1),[v,y]=p.useState(""),w=p.useRef(null);p.useEffect(()=>{let T=!1;return u(!0),f(null),qan({region:s}).then(R=>{T||l(R)}).catch(R=>{T||(l([]),f(R instanceof Error?R.message:r("traditional.resources.loadError")))}).finally(()=>{T||u(!1)}),()=>{T=!0}},[s,h,r]);const x=!e||o.some(T=>T.id===e.trim()),O=o.find(T=>T.id===e.trim()),k=O?F6(O,r("traditional.resources.unnamedAgentCenter")):r(e&&!x?"traditional.resources.selectedAgentCenter":"traditional.resources.selectAgentCenter"),S=c&&o.length===0,C=p.useMemo(()=>o.filter(T=>Sg(v,[F6(T,r("traditional.resources.unnamedAgentCenter")),T.id,T.projectName])),[v,o,r]),E=!!(e&&!x&&Sg(v,[r("traditional.resources.selectedAgentCenter"),e]));p.useEffect(()=>{if(!g)return;const T=A=>{const N=A.target;N instanceof Node&&w.current&&!w.current.contains(N)&&b(!1)},R=A=>{A.key==="Escape"&&b(!1)};return window.addEventListener("pointerdown",T),window.addEventListener("keydown",R),()=>{window.removeEventListener("pointerdown",T),window.removeEventListener("keydown",R)}},[g]);const j=T=>{i(T),b(!1)};return a.jsxs("div",{className:`cw-a2a-space-picker${g?" is-open":""}`,ref:w,children:[a.jsxs("div",{className:"cw-a2a-space-row",children:[a.jsxs("div",{className:"cw-a2a-space-select-wrap",children:[a.jsxs("button",{type:"button",className:`cw-a2a-space-trigger ${n?"is-error":""}`,disabled:S,"aria-haspopup":"listbox","aria-expanded":g,"aria-label":r("traditional.resources.selectAgentKitCenter"),onClick:()=>{y(""),b(T=>!T)},children:[a.jsx("span",{className:e?void 0:"is-placeholder",children:k}),a.jsx($K,{className:"cw-a2a-space-trigger-icon"})]}),g&&a.jsxs("div",{className:"cw-a2a-space-menu",children:[a.jsx("div",{className:"cw-picker-search",children:a.jsx("input",{className:"cw-picker-search-input",type:"search",value:v,autoFocus:!0,autoComplete:"off","aria-label":r("traditional.resources.searchAgentKitCenter"),placeholder:r("traditional.resources.searchNameOrId"),onChange:T=>y(T.currentTarget.value)})}),a.jsxs("div",{className:"cw-picker-options",role:"listbox","aria-label":r("traditional.resources.agentKitCenter"),children:[E&&a.jsx("button",{type:"button",role:"option","aria-selected":!0,className:"cw-a2a-space-option is-selected",onClick:()=>j(e),children:r("traditional.resources.selectedAgentCenter")}),C.map(T=>{const R=F6(T,r("traditional.resources.unnamedAgentCenter")),A=T.id===e;return a.jsx("button",{type:"button",role:"option","aria-selected":A,className:`cw-a2a-space-option ${A?"is-selected":""}`,title:`${R} (${T.id})`,onClick:()=>j(T.id),children:R},T.id)}),!E&&C.length===0&&a.jsx("div",{className:"cw-picker-empty",children:r("traditional.resources.noMatchingAgentCenters")})]})]})]}),a.jsx("button",{type:"button",className:"cw-icon-btn cw-a2a-space-refresh",title:r("traditional.resources.refreshAgentCenters"),"aria-label":r("traditional.resources.refreshAgentCenters"),disabled:c,onClick:()=>m(T=>T+1),children:c?a.jsx(Bi,{className:"cw-i cw-i-sm cw-spin"}):a.jsx(FK,{className:"cw-i cw-i-sm"})})]}),d?a.jsxs("div",{className:"cw-banner cw-a2a-space-error",children:[a.jsx(gm,{className:"cw-i"}),a.jsx("span",{children:d})]}):c?a.jsxs("span",{className:"cw-help cw-a2a-space-status",children:[a.jsx(Bi,{className:"cw-i cw-i-sm cw-spin"}),r("traditional.resources.loadingAgentCenters")]}):o.length===0?a.jsx("span",{className:"cw-help",children:r("traditional.resources.noAgentCenters")}):a.jsx("span",{className:"cw-help",children:r("traditional.resources.agentCentersLoaded",{count:o.length})})]})}function oUe({value:e,items:t,loading:n,error:i,pickerClassName:r,selectLabel:s,searchLabel:o,listLabel:l,placeholder:c,emptyMessage:u,loadedMessage:d,refreshLabel:f,noMatchesMessage:h,getLabel:m,getSearchFields:g,getKey:b,getOptionIds:v,makeUnknownItem:y,onChange:w,onRefresh:x}){const{t:O}=Te("create"),[k,S]=p.useState(!1),[C,E]=p.useState(""),j=p.useRef(null),T=!e||t.some(_=>_.id===e.trim()),R=t.find(_=>_.id===e.trim()),A=R?m(R):e&&!T?e:c,N=n&&t.length===0,P=p.useMemo(()=>t.filter(_=>Sg(C,g(_))),[g,t,C]),I=!!(e&&!T&&Sg(C,[e]));p.useEffect(()=>{if(!k)return;const _=F=>{const M=F.target;M instanceof Node&&j.current&&!j.current.contains(M)&&S(!1)},L=F=>{F.key==="Escape"&&S(!1)};return window.addEventListener("pointerdown",_),window.addEventListener("keydown",L),()=>{window.removeEventListener("pointerdown",_),window.removeEventListener("keydown",L)}},[k]);const D=_=>{w(_),S(!1)};return n&&t.length===0?a.jsxs("span",{className:"cw-viking-kb-inline-status",role:"status",children:[a.jsx(Bi,{className:"cw-i cw-i-sm cw-spin"}),O("common.loading")]}):a.jsxs("div",{className:`cw-a2a-space-picker ${r}${k?" is-open":""}`,ref:j,children:[a.jsxs("div",{className:"cw-a2a-space-row",children:[a.jsxs("div",{className:"cw-a2a-space-select-wrap",children:[a.jsxs("button",{type:"button",className:"cw-a2a-space-trigger",disabled:N,"aria-haspopup":"listbox","aria-expanded":k,"aria-label":s,onClick:()=>{E(""),S(_=>!_)},children:[a.jsx("span",{className:e?void 0:"is-placeholder",children:A}),a.jsx($K,{className:"cw-a2a-space-trigger-icon"})]}),k&&a.jsxs("div",{className:"cw-a2a-space-menu cw-viking-kb-menu",children:[a.jsx("div",{className:"cw-picker-search",children:a.jsx("input",{className:"cw-picker-search-input",type:"search",value:C,autoFocus:!0,autoComplete:"off","aria-label":o,placeholder:O("traditional.resources.searchNameOrId"),onChange:_=>E(_.currentTarget.value)})}),a.jsxs("div",{className:"cw-picker-options",role:"listbox","aria-label":l,children:[I&&a.jsx("button",{type:"button",role:"option","aria-selected":!0,className:"cw-a2a-space-option is-selected",onClick:()=>D(y(e)),children:e}),P.map(_=>{const L=m(_),F=_.id===e,M=v(_).filter(Boolean).join(" / ");return a.jsx("button",{type:"button",role:"option","aria-selected":F,className:`cw-a2a-space-option ${F?"is-selected":""}`,title:M?`${L} (${M})`:L,onClick:()=>D(_),children:L},b(_))}),!I&&P.length===0&&a.jsx("div",{className:"cw-picker-empty",children:h})]})]})]}),a.jsx("button",{type:"button",className:"cw-icon-btn cw-a2a-space-refresh cw-viking-kb-refresh",title:f,"aria-label":f,disabled:n,onClick:x,children:n?a.jsx(Bi,{className:"cw-i cw-i-sm cw-spin"}):a.jsx(FK,{className:"cw-i cw-i-sm"})})]}),i?a.jsxs("div",{className:"cw-banner cw-a2a-space-error",children:[a.jsx(gm,{className:"cw-i"}),a.jsx("span",{children:i})]}):t.length===0?a.jsx("span",{className:"cw-help",children:u}):a.jsx("span",{className:"cw-help",children:d(t.length)})]})}function mon({value:e,onChange:t}){const{t:n}=Te("create"),[i,r]=p.useState([]),[s,o]=p.useState(!1),[l,c]=p.useState(null),[u,d]=p.useState(0);return p.useEffect(()=>{let f=!1;return o(!0),c(null),Kan().then(h=>{f||r(h)}).catch(h=>{f||(r([]),c(h instanceof Error?h.message:n("traditional.resources.loadError")))}).finally(()=>{f||o(!1)}),()=>{f=!0}},[u,n]),a.jsx(oUe,{value:e,items:i,loading:s,error:l,pickerClassName:"cw-viking-kb-picker",selectLabel:n("traditional.resources.selectKnowledgeBase"),searchLabel:n("traditional.resources.searchKnowledgeBase"),listLabel:n("traditional.resources.knowledgeBaseList"),placeholder:n("traditional.resources.knowledgeBasePlaceholder"),emptyMessage:n("traditional.resources.noKnowledgeBases"),loadedMessage:f=>n("traditional.resources.knowledgeBasesLoaded",{count:f}),refreshLabel:n("traditional.resources.refreshKnowledgeBases"),noMatchesMessage:n("traditional.resources.noMatchingKnowledgeBases"),getLabel:f=>Oce(f,n("traditional.resources.unnamedKnowledgeBase")),getSearchFields:f=>[Oce(f,n("traditional.resources.unnamedKnowledgeBase")),f.id,f.description,f.projectName,f.resourceId,f.agentkitKnowledgeId,f.providerKnowledgeId,f.sourceLabel],getKey:f=>f.id,getOptionIds:f=>[f.id,f.resourceId,f.agentkitKnowledgeId,f.providerKnowledgeId],makeUnknownItem:f=>({id:f,name:f,description:"",projectName:"",region:"",sourceKind:"knowledge",sourceLabel:"Knowledge Engine",resourceId:""}),onChange:t,onRefresh:()=>d(f=>f+1)})}function gon({value:e,onChange:t}){const{t:n}=Te("create"),[i,r]=p.useState([]),[s,o]=p.useState(!1),[l,c]=p.useState(null),[u,d]=p.useState(0);return p.useEffect(()=>{let f=!1;return o(!0),c(null),Xan().then(h=>{f||r(h)}).catch(h=>{f||(r([]),c(h instanceof Error?h.message:n("traditional.resources.loadError")))}).finally(()=>{f||o(!1)}),()=>{f=!0}},[u,n]),a.jsx(oUe,{value:e,items:i,loading:s,error:l,pickerClassName:"cw-viking-memory-picker",selectLabel:n("traditional.resources.selectMemory"),searchLabel:n("traditional.resources.searchMemory"),listLabel:n("traditional.resources.memoryList"),placeholder:n("traditional.resources.memoryPlaceholder"),emptyMessage:n("traditional.resources.noMemories"),loadedMessage:f=>n("traditional.resources.memoriesLoaded",{count:f}),refreshLabel:n("traditional.resources.refreshMemories"),noMatchesMessage:n("traditional.resources.noMatchingMemories"),getLabel:f=>kce(f,n("traditional.resources.unnamedMemory")),getSearchFields:f=>[kce(f,n("traditional.resources.unnamedMemory")),f.id,f.description,f.projectName,f.region,f.resourceId,...f.memoryTypes??[]],getKey:f=>`${f.projectName}:${f.region}:${f.id}`,getOptionIds:f=>[f.id,f.resourceId],makeUnknownItem:f=>({id:f,name:f,description:"",projectName:"",region:"",resourceId:"",memoryTypes:[]}),onChange:t,onRefresh:()=>d(f=>f+1)})}function bon({hidden:e}){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e?a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"M3 3l18 18"}),a.jsx("path",{d:"M9.7 6.95A9.7 9.7 0 0 1 12 6.68c5.9 0 9.25 5.32 9.25 5.32a16 16 0 0 1-2.28 2.85"}),a.jsx("path",{d:"M14.35 14.55A3.25 3.25 0 0 1 9.5 10.2"}),a.jsx("path",{d:"M6.25 8.12A16.4 16.4 0 0 0 2.75 12S6.1 17.32 12 17.32c.8 0 1.55-.1 2.25-.27"})]}):a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"M2.75 12s3.35-5.25 9.25-5.25S21.25 12 21.25 12 17.9 17.25 12 17.25 2.75 12 2.75 12Z"}),a.jsx("circle",{cx:"12",cy:"12",r:"2.5"})]})})}function yon({tools:e,conflict:t,showConflict:n,onChange:i}){const{t:r}=Te("create"),s=p.useId(),[o,l]=p.useState(null),c=n?t:null,u=(h,m)=>i(e.map((g,b)=>b===h?{...g,...m}:g)),d=h=>{l(m=>m==null||mg!==h))},f=()=>i([...e,{name:"",transport:"http",url:""}]);return a.jsxs("div",{className:"cw-mcp",children:[e.length>0&&a.jsx("div",{className:"cw-mcp-list",children:a.jsx(hf,{initial:!1,children:e.map((h,m)=>a.jsxs(Ar.div,{className:"cw-mcp-row",layout:!0,initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{duration:.16},children:[a.jsxs("div",{className:"cw-mcp-rowhead",children:[a.jsxs("div",{className:"cw-mcp-transport",children:[a.jsx("button",{type:"button",className:`cw-seg cw-seg-sm ${h.transport==="http"?"is-on":""}`,onClick:()=>u(m,{transport:"http"}),"aria-pressed":h.transport==="http",children:a.jsx("span",{className:"cw-seg-title",children:"HTTP"})}),a.jsx("button",{type:"button",className:`cw-seg cw-seg-sm ${h.transport==="stdio"?"is-on":""}`,onClick:()=>u(m,{transport:"stdio"}),"aria-pressed":h.transport==="stdio",children:a.jsx("span",{className:"cw-seg-title",children:"stdio"})})]}),a.jsx("button",{type:"button",className:"cw-icon-btn cw-icon-danger",onClick:()=>d(m),"aria-label":r("traditional.mcp.removeTool"),children:a.jsx(eb,{className:"cw-i cw-i-sm"})})]}),a.jsx("input",{className:"cw-input","data-validation-field":"mcp-name","aria-invalid":c==="duplicateName","aria-describedby":c==="duplicateName"?s:void 0,value:h.name,placeholder:r("traditional.mcp.namePlaceholder"),onChange:g=>u(m,{name:g.target.value})}),h.transport==="http"?a.jsxs(a.Fragment,{children:[a.jsx("input",{className:"cw-input","data-validation-field":"mcp-url","aria-invalid":c==="duplicateUrl","aria-describedby":c==="duplicateUrl"?s:void 0,value:h.url??"",placeholder:r("traditional.mcp.urlPlaceholder"),onChange:g=>i(e.map((b,v)=>v===m?Can(b,g.target.value):b))}),Ean(h.url??"")&&a.jsxs("p",{className:"cw-mcp-warning",children:[a.jsx(gm,{"aria-hidden":"true"}),a.jsx("span",{children:r("traditional.mcp.pathWarning")})]}),a.jsxs("div",{className:"cw-mcp-token-field",children:[a.jsx("input",{className:"cw-input",type:o===m?"text":"password",value:kan(h),placeholder:r("traditional.mcp.tokenPlaceholder"),autoComplete:"new-password",spellCheck:!1,onChange:g=>i(e.map((b,v)=>v===m?San(b,g.target.value):b))}),a.jsx("button",{type:"button",className:"cw-mcp-token-toggle","aria-label":r(o===m?"traditional.mcp.hideToken":"traditional.mcp.showToken"),title:r(o===m?"traditional.mcp.hideToken":"traditional.mcp.showToken"),"aria-pressed":o===m,onClick:()=>l(g=>g===m?null:m),children:a.jsx(bon,{hidden:o!==m})})]})]}):a.jsxs(a.Fragment,{children:[a.jsx("input",{className:"cw-input",value:h.command??"",placeholder:r("traditional.mcp.commandPlaceholder"),onChange:g=>u(m,{command:g.target.value})}),a.jsx("input",{className:"cw-input",value:(h.args??[]).join(" "),placeholder:r("traditional.mcp.argsPlaceholder"),onChange:g=>u(m,{args:g.target.value.split(/\s+/).filter(Boolean)})}),a.jsx("p",{className:"cw-mcp-note",children:r("traditional.mcp.stdioHint")})]})]},m))})}),c&&a.jsx("p",{className:"cw-error-text",id:s,role:"alert",children:r(c==="duplicateName"?"traditional.validation.mcpDuplicateName":"traditional.validation.mcpDuplicateUrl")}),a.jsxs("button",{type:"button",className:"cw-add-sub",onClick:f,children:[a.jsx(sc,{className:"cw-i"}),r("traditional.mcp.addTool")]})]})}function jj({checked:e,onChange:t,title:n,desc:i,showDescription:r=!1}){return a.jsxs("button",{type:"button",className:`cw-toggle ${e?"is-on":""}`,onClick:()=>t(!e),"aria-pressed":e,children:[a.jsxs("span",{className:"cw-toggle-text",children:[a.jsx("span",{className:"cw-toggle-title",children:n}),r&&a.jsx("span",{className:"cw-toggle-help",children:i})]}),a.jsx("span",{className:"cw-switch","aria-hidden":!0,children:a.jsx(Ar.span,{className:"cw-switch-knob",layout:!0,transition:{type:"spring",stiffness:520,damping:34}})})]})}function von(e,t){var i;let n=e;for(const r of t)if(n=(i=n.subAgents)==null?void 0:i[r],!n)return!1;return!0}function Nj(e,t){let n=e;for(const i of t)n=n.subAgents[i];return n}function WT(e,t,n){if(t.length===0)return n(e);const[i,...r]=t,s=e.subAgents.slice();return s[i]=WT(s[i],r,n),{...e,subAgents:s}}function xon(e,t,n="volcengine"){return WT(e,t,i=>({...i,subAgents:[...i.subAgents,Od(n)]}))}function won(e,t,n,i="volcengine"){return WT(e,t,r=>{const s=r.subAgents.slice();return s.splice(n,0,Od(i)),{...r,subAgents:s}})}function Oon(e,t){if(t.length===0)return e;const n=t.slice(0,-1),i=t[t.length-1];return WT(e,n,r=>({...r,subAgents:r.subAgents.filter((s,o)=>o!==i)}))}const BP=e=>!BL(e.agentType),Cce=3;function kon(e,t,n=!1){var r;if(BL(e.agentType))return n?"remoteRoot":(r=e.a2aRegistry)!=null&&r.registrySpaceId.trim()?null:"missingRegistry";const i=zT(e.name,s=>`name.${s}`);return i||(t.has(e.name)?"duplicateName":e.description.trim().length===0?"missingDescription":M7e(e.agentType)?e.subAgents.length===0?"missingSubagent":null:e.instruction.trim().length===0?"missingPrompt":null)}function lUe(e,t,n=[]){const i=[];if(n.length===0){const o=J7e(e);o&&i.push({path:n,name:e.name.trim(),agentType:e.agentType,problem:o==="duplicateName"?"mcpDuplicateName":"mcpDuplicateUrl"})}const r=BL(e.agentType),s=kon(e,t,n.length===0);return s&&i.push({path:n,name:r?"":e.name.trim(),agentType:e.agentType,problem:s}),BP(e)&&e.subAgents.forEach((o,l)=>i.push(...lUe(o,t,[...n,l]))),i}function Son(e,t){return t("traditional.validation.missingSubagentDetail",{type:t(`traditional.agentTypes.${e.agentType??"llm"}.fullLabel`)})}function cUe(e,t,n=[]){if((e.agentType===void 0||e.agentType==="llm")&&um(e,t)==="ark")return n;if(!BP(e))return null;for(let r=0;rt+uUe(n),0)}function fU(e,t=!1){const n=SO(e),i=bI(n.draft).includes("mcp_resilience"),r=[],s={...n.envValues},o=n.draft.cloudProvider??"volcengine",l=dmt(n.draft).map(kN);let c=!1,u="";for(const h of $L(n.draft,Do(o))){const m=[{key:h.apiKeyKey,required:!0,comment:h.label}];h.providerKey&&(m.push({key:h.providerKey,required:!0}),s[h.providerKey]=h.provider),h.apiBaseKey&&(m.push({key:h.apiBaseKey,required:!0}),s[h.apiBaseKey]=h.apiBase),r.push({env:m})}const d=h=>{var m,g,b,v;h.agentType==="llm"&&um(h,o)==="ark"&&(c=!0,u||(u=(h.modelName??"").trim()));for(const y of h.builtinTools??[]){const w=JA.find(x=>x.id===y);w&&r.push({env:hx(w.env,o)})}for(const y of h.mcpTools??[])y.authTokenEnv&&r.push({env:[{key:y.authTokenEnv,required:!1,comment:`${y.name.trim()||"MCP"} Bearer Token`,secret:!0,readOnly:i,serverManaged:i,hidden:i}]});if((m=h.a2aRegistry)!=null&&m.enabled&&(r.push({env:hx(jIe,o)}),Object.assign(s,aUe(h.a2aRegistry,{includeDefaults:!0},o))),h.memory.shortTerm&&r.push({env:hx(((g=lw.find(y=>y.id===(h.shortTermBackend??"local")))==null?void 0:g.env)??[],o)}),h.memory.longTerm&&r.push({env:hx(((b=_B.find(y=>y.id===(h.longTermBackend??"local")))==null?void 0:b.env)??[],o)}),h.knowledgebase&&r.push({env:hx(((v=jB.find(y=>y.id===(h.knowledgebaseBackend??Mg)))==null?void 0:v.env)??[],o)}),h.tracing)for(const y of h.tracingExporters??[]){const w=nmt.find(x=>x.id===y);w&&r.push({env:w.env,enableFlag:w.enableFlag})}h.subAgents.forEach(d)};if(d(n.draft),c){r.push({env:[{key:"MODEL_AGENT_PROVIDER",required:!0},{key:"MODEL_AGENT_API_BASE",required:!0},{key:"MODEL_AGENT_API_KEY",required:!0,comment:"Ark API Key",placeholder:Xt("helpers.deploymentEnv.selectedApiKeyPlaceholder"),secret:!0,readOnly:!0,serverManaged:!0,requiredBy:l}]}),s.MODEL_AGENT_PROVIDER="openai",s.MODEL_AGENT_API_BASE=Do(o);const h=u||Xp(o);s.MODEL_AGENT_NAME=h,s.MODEL_NAME=h}if(i){if(t){r.push({env:[{key:"MCP_SERVERS_JSON",required:!0,comment:Xt("helpers.deploymentEnv.mcpInjectedComment"),placeholder:Xt("helpers.deploymentEnv.restoredPlaceholder"),help:Xt("helpers.deploymentEnv.restoredHelp"),readOnly:!0,serverManaged:!0,hidden:!0,requiredBy:[kN("mcp_resilience")]}]});const g=oU(r);return{specs:g.specs,fixedValues:{...g.fixedValues,...s}}}const h=Pan(n.draft),m=h.ok?void 0:h.message;r.push({env:[{key:"MCP_SERVERS_JSON",required:!0,comment:Xt("helpers.deploymentEnv.mcpInjectedComment"),placeholder:Xt(t?"helpers.deploymentEnv.restoredPlaceholder":"helpers.deploymentEnv.generatedMcpPlaceholder"),help:Xt("helpers.deploymentEnv.mergedMcpHelp"),secret:!0,readOnly:!0,serverManaged:h.ok,hidden:!0,requiredBy:[kN("mcp_resilience")],missingError:m}]})}const f=oU(r);return{specs:f.specs,fixedValues:{...f.fixedValues,...s}}}function dUe(e,t){var i;if(e.id==="baseline")return t("traditional.debug.baseline");const n=(i=/^variant-(\d+)$/.exec(e.id))==null?void 0:i[1];return n?t("traditional.debug.comparison",{count:Number(n)}):e.name}function Eon(e,t){const n=i=>(i??"").trim().replace(/\/+$/,"");return n(e)===n(t)}function Con(e,t,n){if(e===""&&t===n)return!1;const i=(e??"").trim();return!i||i===Xp(t)?!0:i===Xp(n)?!1:n==="byteplus"&&i.includes("doubao-")}function ky(e,t){const n=e.cloudProvider??"volcengine",i=um(e,n),r=e.subAgents.map(u=>ky(u,t)),s=i==="ark"&&Con(e.modelName,n,t)?Xp(t):e.modelName,l=Eon(e.modelApiBase,Do(n))||t==="byteplus"&&(e.modelApiBase??"").includes("volces.com")?Do(t):e.modelApiBase;return e.cloudProvider!==t||s!==e.modelName||l!==e.modelApiBase||r.some((u,d)=>u!==e.subAgents[d])?{...e,cloudProvider:t,modelName:s,modelApiBase:l,subAgents:r}:e}function Aon(e,t){var l;const n=ky(e,t),i=NK(n,Do(t)),r=new Set(i.map(({key:c})=>c)),s=((l=n.deployment)==null?void 0:l.envValues)??{},o=Object.fromEntries(Object.entries(s).filter(([c,u])=>r.has(c)&&!!u.trim()));return Object.keys(o).length===0?{draft:n,customModelSecretValues:o}:{draft:{...n,deployment:{...n.deployment??{feishuEnabled:!1},envValues:Object.fromEntries(Object.entries(s).filter(([c])=>!r.has(c)))}},customModelSecretValues:o}}function SS(e){var i,r,s;const t=SO(e).draft;return{...N7e(t,t.cloudProvider??"volcengine"),deployment:{feishuEnabled:!!((i=e.deployment)!=null&&i.feishuEnabled),modelApiKeyId:((r=e.deployment)==null?void 0:r.modelApiKeyId)??"",modelApiKeyName:((s=e.deployment)==null?void 0:s.modelApiKeyName)??""}}}function hU(e){var n;const t=(n=e.modelName)==null?void 0:n.trim();if(t)return t;for(const i of e.subAgents){const r=hU(i);if(r)return r}return""}function fUe(e,t={}){var r,s,o,l;const n=fU(e),i={...((r=e.deployment)==null?void 0:r.envValues)??{},...t,...n.fixedValues};return{...SS(e),deployment:{feishuEnabled:!!((s=e.deployment)!=null&&s.feishuEnabled),modelApiKeyId:((o=e.deployment)==null?void 0:o.modelApiKeyId)??"",modelApiKeyName:((l=e.deployment)==null?void 0:l.modelApiKeyName)??"",envValues:Object.fromEntries(rsn(n.specs,i,SO(e).envValues).map(({key:c,value:u})=>[c,u]))}}}function Ton(e,t){const n=new Set;for(const i of $L(e,Do(t)))for(const r of[i.providerKey,i.apiBaseKey,i.apiKeyKey])r&&n.add(r);return n}function _on(e,t,n){const i=Ton(e,t);return(n??[]).filter(({key:r,value:s})=>i.has(r)&&s.trim())}function jon(e,t={}){return JSON.stringify(fUe(e,t))}function UP(e,t){return JSON.stringify({draftSnapshot:e,modelName:t.modelName,description:t.description,instruction:t.instruction})}function Vx(e){return JSON.stringify({modelName:e.modelName.trim(),description:e.description.trim(),instruction:e.instruction.trim()})}function Non({enabled:e,disabledReason:t,variants:n,draftSnapshot:i,input:r,onInput:s,onSend:o,onStartVariant:l,onUseVariant:c,onAddVariant:u,onRemoveVariant:d,onToggleConfig:f,onCompleteConfig:h,onConfigChange:m,onOpenTrace:g}){const{t:b}=Te("create"),v=n.filter(x=>x.phase!=="ready"?!1:x.runtimeSnapshot===UP(i,x)),y=n.some(x=>x.phase==="sending"),w=v.length>0&&!y;return a.jsxs("section",{className:"cw-ab-workspace","aria-label":b("traditional.debug.ariaLabel"),children:[a.jsx("div",{className:"cw-ab-stage",children:e?a.jsx("div",{className:"cw-ab-grid",style:{"--cw-ab-column-count":n.length},children:n.map((x,O)=>{const k=dUe(x,b),S=x.modelName.trim(),C=x.description.trim(),E=x.instruction.trim(),j=Vx(x),T=!!(S&&C&&E&&n.findIndex(M=>Vx(M)===j)!==O),R=!S||!C||!E||T,A=!!(x.runtimeSnapshot&&x.runtimeSnapshot!==UP(i,x)),N=x.phase==="starting",P=x.phase==="ready"&&!A,I=N||x.phase==="sending",D=P&&x.phase!=="sending"&&x.messages.some(M=>M.role==="assistant"),_=I||x.configOpen||R,L=S?C?E?T?b("traditional.debug.duplicateConfiguration"):"":b("traditional.debug.enterPrompt"):b("traditional.debug.enterDescription"):b("traditional.debug.selectModel"),F=N?b("traditional.debug.starting"):A?b("traditional.debug.applyAndRestart"):P||x.phase==="error"?b("traditional.debug.restart"):b("traditional.debug.start");return a.jsx("article",{className:"cw-ab-card",children:a.jsxs("div",{className:`cw-ab-card-inner${x.configOpen?" is-flipped":""}`,children:[a.jsxs("section",{className:"cw-ab-card-face cw-ab-card-front","aria-hidden":x.configOpen,inert:x.configOpen,children:[a.jsxs("header",{className:"cw-ab-card-head",children:[a.jsxs("div",{className:"cw-ab-card-title",children:[a.jsx("strong",{children:k}),a.jsx("span",{children:x.modelName||b("traditional.debug.defaultModel")})]}),a.jsxs("div",{className:"cw-ab-card-actions",children:[a.jsx("button",{type:"button",className:"cw-ab-config-trigger",disabled:x.configOpen||I,onClick:()=>f(x.id),children:b("traditional.debug.testConfiguration")}),x.id!=="baseline"&&a.jsx("button",{type:"button",className:"cw-ab-remove","aria-label":b("traditional.debug.deleteVariant",{name:k}),disabled:x.configOpen||I,onClick:()=>d(x.id),children:a.jsx(xce,{className:"cw-i"})})]})]}),a.jsx("div",{className:"cw-ab-conversation",children:x.error?a.jsx(wb,{message:x.error,className:"cw-debug-error-detail",defaultExpanded:!0}):N?a.jsxs("div",{className:"cw-ab-empty cw-ab-starting",children:[a.jsx(Bi,{className:"cw-i cw-spin"}),a.jsx("span",{children:b("traditional.debug.creatingEnvironment")})]}):A?a.jsx("div",{className:"cw-ab-empty cw-ab-launch",children:a.jsx("span",{children:b("traditional.debug.configurationChanged")})}):x.messages.length===0?a.jsx("div",{className:"cw-ab-empty cw-ab-launch",children:P?a.jsxs(a.Fragment,{children:[a.jsx("strong",{className:"cw-ab-ready-title",children:b("traditional.debug.ready")}),a.jsx("span",{className:"cw-ab-launch-hint",children:b("traditional.debug.readyHint")})]}):a.jsx("span",{className:"cw-ab-launch-hint",children:L||b("traditional.debug.startHint")})}):x.messages.map((M,z)=>a.jsx("div",{className:`cw-debug-msg cw-debug-msg-${M.role}`,children:a.jsx("div",{className:"cw-debug-content",children:M.role==="user"?M.content:M.error?a.jsx(wb,{message:M.error,className:"cw-debug-msg-error",defaultExpanded:!0}):M.blocks&&M.blocks.length>0?a.jsx(m0,{blocks:M.blocks,onAction:()=>{}}):M.content?M.content:z===x.messages.length-1&&x.phase==="sending"?a.jsx(XLe,{}):null})},z))}),a.jsxs("footer",{className:"cw-ab-deploy-footer",children:[a.jsx("button",{type:"button",className:"cw-ab-trace",disabled:!D,title:D?b("traditional.debug.viewTraceNamed",{name:k}):b("traditional.debug.traceUnavailable"),onClick:()=>g(x.id),children:b("traditional.debug.trace")}),a.jsxs("button",{type:"button",className:"cw-ab-start cw-ab-footer-start",disabled:_,title:L||void 0,onClick:()=>l(x.id),children:[P||A||x.phase==="error"?a.jsx(Wat,{className:"cw-i"}):a.jsx(oon,{className:"cw-i cw-debug-run-icon"}),F]}),a.jsx("button",{type:"button",className:"cw-ab-deploy",disabled:I||!S,onClick:()=>c(x.id),children:b("traditional.debug.useConfiguration")})]})]}),a.jsxs("section",{className:"cw-ab-card-face cw-ab-card-back","aria-hidden":!x.configOpen,inert:!x.configOpen,children:[a.jsxs("header",{className:"cw-ab-config-head",children:[a.jsxs("div",{children:[a.jsx("strong",{children:b("traditional.debug.testConfiguration")}),a.jsx("span",{children:k})]}),a.jsxs("div",{className:"cw-ab-config-head-actions",children:[x.id!=="baseline"&&a.jsx("button",{type:"button",className:"cw-icon-btn cw-icon-danger cw-ab-config-remove","aria-label":b("traditional.debug.deleteVariant",{name:k}),title:b("traditional.debug.deleteVariantGroup"),disabled:I,onClick:()=>d(x.id),children:a.jsx(xce,{className:"cw-i cw-i-sm"})}),a.jsxs("span",{className:`cw-ab-config-done-wrap${L?" is-disabled":""}`,tabIndex:L?0:void 0,children:[a.jsx("button",{type:"button",className:"cw-ab-config-done",disabled:!x.configOpen||R,onClick:()=>h(x.id),children:x.id==="baseline"?b("traditional.debug.finishConfiguration"):b("traditional.debug.finishAndStart")}),L&&a.jsx("span",{className:"cw-ab-config-done-tip",role:"tooltip",children:L})]})]})]}),a.jsxs("div",{className:"cw-ab-config",children:[a.jsxs("label",{children:[a.jsx("span",{children:b("traditional.model.label")}),a.jsx("input",{value:x.modelName,placeholder:b("traditional.debug.currentAgentModel"),disabled:!x.configOpen,onChange:M=>m(x.id,"modelName",M.target.value)})]}),a.jsxs("label",{children:[a.jsx("span",{children:b("common.description")}),a.jsx("textarea",{rows:2,value:x.description,disabled:!x.configOpen,onChange:M=>m(x.id,"description",M.target.value)})]}),a.jsxs("label",{children:[a.jsx("span",{children:b("traditional.basic.systemPrompt")}),a.jsx("textarea",{rows:5,value:x.instruction,disabled:!x.configOpen,onChange:M=>m(x.id,"instruction",M.target.value)})]}),a.jsx("p",{children:b("traditional.debug.configurationHint")})]})]})]})},x.id)})}):a.jsx("div",{className:"cw-debug-empty",children:t})}),a.jsxs("div",{className:"cw-ab-composer",children:[a.jsxs("div",{className:"cw-debug-composerbox",children:[a.jsx("textarea",{className:"cw-debug-input",rows:1,value:r,placeholder:b(w?"traditional.debug.messagePlaceholder":"traditional.debug.startOneFirst"),disabled:!w,onChange:x=>s(x.target.value),onKeyDown:x=>{HT(x.nativeEvent)||x.key==="Enter"&&!x.shiftKey&&(x.preventDefault(),o())}}),a.jsx("button",{type:"button",className:"cw-debug-send",title:b("common.send"),disabled:!w||!r.trim(),onClick:o,children:y?a.jsx(Bi,{className:"cw-i cw-spin"}):a.jsx(wat,{className:"cw-i"})})]}),e&&n.length<3&&a.jsxs("button",{type:"button",className:"cw-btn cw-btn-soft cw-ab-add",onClick:u,children:[a.jsx(sc,{className:"cw-i"}),b("traditional.debug.addVariant")]})]})]})}function Ron({profile:e,optimizations:t,onProfileChange:n,onOptimizationChange:i}){const{t:r}=Te("create");return a.jsx("section",{className:"cw-optimize-workspace","aria-label":r("traditional.optimization.ariaLabel"),children:a.jsxs("div",{className:"cw-optimize-panel",children:[a.jsxs("fieldset",{className:"cw-optimize-section",children:[a.jsx("legend",{children:r("traditional.optimization.scenario")}),a.jsx(Ly,{className:"cw-optimize-profile-options","aria-label":r("traditional.optimization.scenario"),value:e,onChange:n,children:lH.map(s=>a.jsx("div",{className:`cw-optimize-profile-option${e===s.id?" is-on":""}`,children:a.jsx(Ly.Item,{value:s.id,block:!0,className:"cw-optimize-profile-control",children:a.jsxs("span",{className:"cw-optimize-profile-copy",children:[a.jsx("strong",{children:r(`traditional.optimization.profiles.${s.id}.label`)}),a.jsx("small",{children:r(`traditional.optimization.profiles.${s.id}.description`)})]})})},s.id))})]}),a.jsxs("fieldset",{className:"cw-optimize-section",children:[a.jsx("legend",{children:r("traditional.optimization.components")}),a.jsx("div",{className:"cw-optimize-option-list",children:imt.map(s=>a.jsxs("section",{className:"cw-optimize-option-group","aria-labelledby":`cw-optimize-group-${s.id}`,children:[a.jsx("h3",{id:`cw-optimize-group-${s.id}`,className:"cw-optimize-option-group-title",children:r(`traditional.optimization.groups.${s.id}`)}),a.jsx("div",{className:"cw-optimize-option-group-items",children:s.componentIds.map(o=>{const l=oH.find(u=>u.id===o);if(!l)return null;const c=t.includes(l.id);return a.jsx(DK,{checked:c,onCheckedChange:u=>{const d=!!u;d!==c&&i(l.id,d)},label:a.jsxs("span",{className:"cw-optimize-option-copy",children:[a.jsx("strong",{children:r(`traditional.optimization.options.${l.id}.label`)}),a.jsx("small",{children:r(`traditional.optimization.options.${l.id}.description`)})]}),className:"cw-optimize-option"},l.id)})})]},s.id))})]})]})})}const Rj=[{id:"build",label:"traditional.workspace.modes.build"},{id:"validate",label:"traditional.workspace.modes.validate"},{id:"optimize",label:"traditional.workspace.modes.optimize"},{id:"environment",label:"traditional.workspace.modes.environment"},{id:"publish",label:"traditional.workspace.modes.publish"}],Ion={build:"traditional.workspace.titles.build",validate:"traditional.workspace.titles.validate",optimize:"traditional.workspace.titles.optimize",environment:"traditional.workspace.titles.environment",publish:"traditional.workspace.titles.publish"};function Pon({mode:e}){const{t}=Te("create");return a.jsx("header",{className:"cw-workspace-header",children:a.jsx("h1",{children:t(Ion[e])})})}function Don({mode:e,busy:t,nextDisabled:n,onChange:i,assistant:r,accessory:s}){const{t:o}=Te("create"),l=Rj.findIndex(d=>d.id===e),c=Rj[l-1],u=Rj[l+1];return a.jsxs("footer",{className:"cw-workspace-footer",children:[s?a.jsx("div",{className:"cw-workspace-footer-accessory",children:s}):null,a.jsxs("div",{className:`cw-workspace-nav-actions${r?" has-assistant":""}`,children:[a.jsx("button",{type:"button",className:`cw-workspace-nav-button${e==="build"?" is-placeholder":""}`,"aria-hidden":e==="build"||void 0,tabIndex:e==="build"?-1:0,disabled:!c||t,onClick:()=>c&&i(c.id),children:o("common.previous")}),a.jsx("span",{"aria-hidden":"true"}),r?a.jsx("div",{className:"cw-workspace-ai-slot",children:r}):null,e==="publish"?a.jsx("div",{id:"cw-publish-primary-action",className:"cw-publish-action-slot"}):a.jsx("button",{type:"button",className:"cw-workspace-nav-button is-primary",disabled:!u||t||n,onClick:()=>u&&i(u.id),children:o("common.next")})]}),a.jsx("nav",{className:"cw-workspace-progress","aria-label":o("traditional.workspace.progress"),children:Rj.map((d,f)=>{const h=d.id===e;return a.jsx("button",{type:"button",className:`${h?"is-active":""}${fi(d.id),children:a.jsx("span",{"aria-hidden":"true"})},d.id)})})]})}function Mon({onBack:e,onCreate:t,onAgentAdded:n,initialDraft:i,features:r,onDeploymentTaskChange:s,createMode:o="custom",freshCreationSurface:l="traditional",workspaceDraftId:c,deploymentTarget:u,cloudProvider:d="volcengine",initialDeployRegion:f=Zi(d),onDeploymentComplete:h,onDeploymentStarted:m,onDraftChange:g,onDiscard:b}){var Fd,Ul,Vo,Ql,Kc,vo,ra,io,Re,ot,$t,Dn,On,mn,jn,Wt,bn,Mn,ai,ss,re,zn,bi,Fa;const{t:v}=Te("create"),y=o==="custom"&&l==="vulcan",w=y&&!i,[x]=p.useState(()=>{const oe=i??Od(d),$e=w?{...oe,name:oe.name.trim()?oe.name:"assistant",dynamicAgentDelegation:!0}:oe;return Aon($e,d)}),[O,k]=p.useState(x.draft),S=y,[C,E]=p.useState(x.customModelSecretValues),j=(u==null?void 0:u.configuredRuntimeEnvKeys)??[],T=p.useMemo(()=>new Set(j),[j]),R=((Fd=O.deployment)==null?void 0:Fd.runtimeName)??"",A=u?u.name:ZXt(O.name,R,(Ul=O.deployment)==null?void 0:Ul.runtimeNameCustomized),N=C,P=p.useCallback((oe,$e)=>{E(st=>{const Ye={...st};return $e?Ye[oe]=$e:delete Ye[oe],Ye})},[]);p.useEffect(()=>{k(oe=>ky(oe,d))},[d]);const[I,D]=p.useState(""),[_,L]=p.useState(!1),[F,M]=p.useState(!1),[z,q]=p.useState(!1),[U,J]=p.useState(null),V=I.trim(),Z=V.length>0&&V.length{se.current=g},[g]),p.useEffect(()=>{var oe;G!==W.current&&(W.current=G,(oe=se.current)==null||oe.call(se,ky(O,d),H))},[d,O,H,G]);const[Y,X]=p.useState("build"),[ie,ee]=p.useState(!1),[be,ue]=p.useState(()=>new Set),[pe,ke]=p.useState(0),[je,Pe]=p.useState(null),[Ee,Qe]=p.useState(!1),[_e,ae]=p.useState((u==null?void 0:u.region)??f),le=(r==null?void 0:r.generatedAgentTestRun)===!0,ge=(r==null?void 0:r.generatedAgentTestRunDisabledReason)||v("traditional.debug.unavailable"),[Oe,Se]=p.useState(()=>{const oe=ky(i??Od(d),d);return[{id:"baseline",name:v("traditional.debug.baseline"),modelName:hU(oe),description:oe.description,instruction:oe.instruction,configOpen:!1,phase:"idle",runtimeSnapshot:"",messages:[],error:null}]}),[qe,Xe]=p.useState("baseline"),ye=p.useRef(1),we=p.useRef(!1),Ae=p.useRef(new Map),[Ve,Be]=p.useState(0),[_t,Pt]=p.useState(""),[Kt,Et]=p.useState(null),[vt,tt]=p.useState(!1),[mt,Ne]=p.useState(!1),wt=p.useRef(null),[jt,Yt]=p.useState(""),[wn,We]=p.useState(!1),[kt,He]=p.useState(null),[nt,et]=p.useState(""),[ft,St]=p.useState(!1),[Ct,It]=p.useState(!1),[Gt,Ge]=p.useState([]),xt=p.useRef(null),yt=p.useRef({});async function nn(){const oe=new Set([...Ae.current.values()].map(({run:st})=>st.runId)),$e=LK().filter(st=>!oe.has(st));$e.length&&await Promise.all($e.map(async st=>{try{await nx(st),Lk(st)}catch(Ye){console.warn("Failed to clean up stale debug run",Ye)}}))}p.useEffect(()=>(nn(),()=>{for(const{run:oe}of Ae.current.values())nx(oe.runId).then(()=>Lk(oe.runId)).catch($e=>console.warn("Failed to clean up debug run",$e));Ae.current.clear()}),[]),p.useEffect(()=>()=>{var oe;(oe=wt.current)==null||oe.call(wt,!1),wt.current=null},[]);const Qt=p.useRef(null);Qt.current||(Qt.current=({meta:oe,children:$e})=>a.jsxs("section",{ref:st=>{yt.current[oe.id]=st},id:`cw-sec-${oe.id}`,"data-step-id":oe.id,className:"cw-section",children:[a.jsx("header",{className:"cw-sec-head",children:a.jsx("h2",{className:"cw-sec-title",children:v(oe.label)})}),a.jsx("div",{className:"cw-sec-body",children:$e})]}));const cn=von(O,Gt)?Gt:[],Me=Nj(O,cn),on=cn.length===0,kn=cn.join(".")||"root",Sn=()=>{ue(oe=>oe.has(kn)?oe:new Set(oe).add(kn))},zi=`cw-a2a-registry-advanced-${cn.join("-")||"root"}`,un=oe=>k($e=>WT($e,cn,st=>({...st,...oe}))),or=oe=>k($e=>{var st;return{...$e,deployment:{...$e.deployment??{feishuEnabled:!1},envValues:{...((st=$e.deployment)==null?void 0:st.envValues)??{},...oe}}}}),Pn=(oe,$e)=>or({[oe]:$e}),ei=oe=>un({a2aRegistry:{...Me.a2aRegistry??{enabled:!1,registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},...oe}}),Fn=(oe,$e)=>{if(!(oe in wce))return;const st=wce[oe];ei({[st]:$e}),Pn(oe,$e)},Si=oe=>{if(!(on&&oe==="a2a")){if(oe==="a2a"){un({agentType:oe,a2aRegistry:{...Me.a2aRegistry??{registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},enabled:!0}});return}un({agentType:oe,a2aRegistry:Me.a2aRegistry?{...Me.a2aRegistry,enabled:!1}:void 0})}},Qn=(oe,$e)=>{k(oe),$e&&Ge($e)},Rn=async()=>{const oe=I.trim();if(!(!oe||_)&&!(oe.length{const $e=Nj(O,oe);if(!BP($e)||oe.length>=Cce)return;const st=xon(O,oe,d),Ye=Nj(st,oe).subAgents.length-1;Qn(st,[...oe,Ye])},rt=(oe,$e)=>{const st=Nj(O,oe);if(!BP(st)||oe.length>=Cce)return;const Ye=Math.max(0,Math.min($e,st.subAgents.length)),de=won(O,oe,Ye,d);Qn(de,[...oe,Ye])},zt=()=>{window.confirm(v("traditional.actions.clearRootConfirmation"))&&(k(Od(d)),Ge([]),ee(!1))},Ue=oe=>{if(oe.length===0){zt();return}Qn(Oon(O,oe),oe.slice(0,-1))},bt=Me.builtinTools??[],Ht=p.useMemo(()=>NIe(d),[d]),_n=p.useMemo(()=>new Set(Ht.map(oe=>oe.id)),[Ht]),Nr=Me.mcpTools??[],qs=on?J7e(O):null,Ws=Me.selectedSkills??[],Lr=oe=>{_n.has(oe)&&un({builtinTools:bt.includes(oe)?bt.filter($e=>$e!==oe):[...bt,oe]})},ti=M7e(Me.agentType),Ei=BL(Me.agentType),es=mM(d),ts=um(Me,d),ba=oe=>{var st;const $e=oe==="custom"&&ts==="ark"?"":oe==="ark"&&!((st=Me.modelName)!=null&&st.trim())?Xp(d):Me.modelName;un({modelSource:oe,modelName:$e,modelFallbacks:oe==="custom"&&ts==="ark"?[]:Nu($e,Me.modelFallbacks)})},go=p.useMemo(()=>Ptn(O),[O]),fs=Ei?null:zT(Me.name,oe=>v(`validation.agentName.${oe}`))??(go.has(Me.name)?v("traditional.validation.duplicateName"):null),he=fs!==null,gr=ie||be.has(kn),bo=!Ei&&Me.description.trim().length===0,to=Me.instruction.trim().length===0,fl=Ei&&!((Vo=Me.a2aRegistry)!=null&&Vo.registrySpaceId.trim()),no=(oe,$e=ie)=>$e&&oe?`is-error cw-error-shake-${pe%2}`:"",ks=p.useMemo(()=>lUe(O,go),[O,go]),Ks=ks.length===0,Ti=p.useMemo(()=>ky(O,d),[d,O]),rr=umt(O),Ds=bI(O),Ml=rmt(d),hl=p.useMemo(()=>jon(Ti,N),[Ti,N]),br=Oe.find(oe=>oe.id===qe)??Oe[0],$r=p.useMemo(()=>fU(Ti,(u==null?void 0:u.editMode)==="source-preserving"),[u==null?void 0:u.editMode,Ti]),pl=!u||u.editMode==="regenerate",Lo=p.useMemo(()=>NK(Ti,Do(d)),[d,Ti]),Rr=p.useMemo(()=>cUe(Ti,d),[d,Ti]),$o=p.useMemo(()=>T7e(Ti,Do(d),C,j),[d,j,C,Ti]),ns=Rr!==null&&!((Kc=(Ql=Ti.deployment)==null?void 0:Ql.modelApiKeyId)!=null&&Kc.trim()),ya=ns||!!$o,Mi=Lo.find(oe=>oe.label===Xt("helpers.customModel.apiKeyLabel",{name:Me.name.trim()||Xt("helpers.customModel.fallbackName")})),Ms=Mi?T.has(Mi.key):!1,Vr=ts==="custom"&&Mi!==void 0&&!((vo=C[Mi.key])!=null&&vo.trim())&&!Ms,hs=ts==="ark"&&!((io=(ra=Ti.deployment)==null?void 0:ra.modelApiKeyId)!=null&&io.trim()),ml=!MK(Me.modelApiBase),ia=p.useCallback(oe=>{k($e=>({...$e,deployment:{...$e.deployment??{feishuEnabled:!1},modelApiKeyId:oe.id,modelApiKeyName:oe.name}}))},[]);function gi(oe){const $e=oe.problem==="mcpDuplicateName"||oe.problem==="mcpDuplicateUrl"?"tools":oe.problem==="missingSubagent"?"type":"basic",st=yt.current[$e];st==null||st.scrollIntoView({behavior:"smooth",block:"start"});const Ye=oe.problem==="mcpDuplicateName"?"mcp-name":oe.problem==="mcpDuplicateUrl"?"mcp-url":oe.problem==="missingDescription"?"description":oe.problem==="missingPrompt"?"instruction":oe.problem==="missingRegistry"?"a2a-registry":oe.problem==="missingSubagent"||oe.problem==="remoteRoot"?null:"name",de=Ye?st==null?void 0:st.querySelector(`[data-validation-field="${Ye}"]`):st,Fe=de!=null&&de.matches('input, textarea, button:not([disabled]), [contenteditable="true"], [tabindex]:not([tabindex="-1"])')?de:de==null?void 0:de.querySelector('input, textarea, button:not([disabled]), [contenteditable="true"], [tabindex]:not([tabindex="-1"])');Fe==null||Fe.focus({preventScroll:!0})}function Ll(oe){Ge(oe),window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{const $e=yt.current.model;$e==null||$e.scrollIntoView({behavior:"smooth",block:"start"});const st=($e==null?void 0:$e.querySelector('[data-validation-field="model-api-key"]'))??$e,Ye=st!=null&&st.matches('input, textarea, button:not([disabled]), [contenteditable="true"], [tabindex]:not([tabindex="-1"])')?st:st==null?void 0:st.querySelector('input, textarea, button:not([disabled]), [contenteditable="true"], [tabindex]:not([tabindex="-1"])');Ye==null||Ye.focus({preventScroll:!0})})})}const Fo=()=>Ks?ya?(ee(!0),ke(oe=>oe+1),Ll(ns?Rr??[]:($o==null?void 0:$o.path)??[]),!1):(Yt(""),!0):(ee(!0),ke(oe=>oe+1),ks[0]&&(Ge(ks[0].path),window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>gi(ks[0]))})),!1),Gs=async()=>{Et(null);const oe=[...Ae.current.values()];Ae.current.clear(),Be(0),Se($e=>$e.map(st=>({...st,phase:"idle",runtimeSnapshot:"",messages:[],error:null}))),await Promise.all(oe.map(async({run:$e})=>{try{await nx($e.runId),Lk($e.runId)}catch(st){console.warn("Failed to clean up debug run",st)}}))},gl=async oe=>{const $e=Ae.current.get(oe);if($e){Ae.current.delete(oe),Be(Ae.current.size);try{await nx($e.run.runId),Lk($e.run.runId)}catch(st){console.warn("Failed to clean up debug run",st)}}},Bo=oe=>{const $e=Ae.current.get(oe),st=Oe.find(Ye=>Ye.id===oe);!$e||!st||Et({runId:$e.run.runId,sessionId:$e.sessionId,variantName:dUe(st,v)})},Ma=oe=>{const $e=wt.current;wt.current=null,$e==null||$e(oe)},bl=()=>{mt||(tt(!1),Ma(!1))},Bu=async()=>{if(!mt){Ne(!0);try{await Gs(),tt(!1),Ma(!0)}finally{Ne(!1)}}},Uo=async()=>Y!=="validate"||Ve===0?!0:wt.current?!1:new Promise(oe=>{wt.current=oe,tt(!0)}),mc=async oe=>{if(await Uo()){if(!Fo()){X("build");return}oe&&Xe(oe),X("environment")}},Md=async oe=>{var st,Ye;if(Yt(""),!Fo()){X("build");return}if((st=Ti.harnessSidecar)!=null&&st.enabled&&Ml){Yt(Ml),X("optimize");return}const $e=lU($r.specs,((Ye=Ti.deployment)==null?void 0:Ye.envValues)??{});if($e){Yt(`${$e.spec.comment||$e.spec.key}:${$e.error}`),X("build");return}Qe(!0);try{const de=oe?Oe.find(ct=>ct.id===oe):br;de&&Xe(de.id);const Fe=de?cmt(Ti,de):Ti,lt=await GS(SS(Fe));k(Fe),Pe(lt),X("publish")}catch(de){Yt(de instanceof Error?de.message:String(de))}finally{Qe(!1)}},Ld=async()=>{if(await Uo()){if(!Fo()){X("build");return}X("optimize")}},yo=async oe=>{if(!le||Ee||!Fo())return;const $e=Oe.find(Vt=>Vt.id===oe);if(!$e||$e.phase==="starting"||$e.phase==="sending")return;const st=$e.modelName.trim(),Ye=$e.description.trim(),de=$e.instruction.trim(),Fe=Vx($e),lt=Oe.findIndex(Vt=>Vt.id===oe),ct=Oe.findIndex(Vt=>Vx(Vt)===Fe);if(!st||!Ye||!de||ct!==lt)return;const Lt=UP(hl,$e);Se(Vt=>Vt.map(yi=>yi.id===oe?{...yi,configOpen:!1,phase:"starting",messages:[],error:null}:yi)),Pt("");let ln=null,yr="unknown";const Jt=oe==="baseline"?"baseline":"comparison",pi=Rtn({agentId:String(Ti.name||"unknown"),variantType:Jt});try{await gl(oe),await nn();const Vt={...Ti,modelName:$e.modelName||Ti.modelName,description:$e.description,instruction:$e.instruction};yr="create_test_run",ln=await _2e(fUe(Vt,N),u?{runtimeId:u.runtimeId,region:u.region}:void 0),ron(ln.runId),yr="create_test_session";const yi=await j2e(ln.runId,"test_user");Ae.current.set(oe,{run:ln,sessionId:yi}),Be(Ae.current.size),Se(Ln=>Ln.map(Xn=>Xn.id===oe?{...Xn,phase:"ready",runtimeSnapshot:Lt}:Xn)),pi.succeed({debugRunId:String(ln.runId)})}catch(Vt){if(ln)try{await nx(ln.runId),Lk(ln.runId)}catch(yi){console.warn("Failed to clean up debug run",yi)}Se(yi=>yi.map(Ln=>Ln.id===oe?{...Ln,phase:"error",runtimeSnapshot:"",error:Vt instanceof Error?Vt.message:String(Vt)}:Ln)),pi.fail({failedPhase:yr,...Xo(Vt,{phase:yr})})}},$d=async()=>{const oe=_t.trim(),$e=Oe.filter(Ye=>Ye.phase==="ready"&&Ye.runtimeSnapshot===UP(hl,Ye)&&Ae.current.has(Ye.id));if(!oe||$e.length===0)return;Pt("");const st=new Set($e.map(Ye=>Ye.id));Se(Ye=>Ye.map(de=>st.has(de.id)?{...de,phase:"sending",messages:[...de.messages,{role:"user",content:oe},{role:"assistant",content:"",blocks:[]}]}:de)),await Promise.all($e.map(async Ye=>{const de=Ae.current.get(Ye.id);if(de)try{let Fe=dB();for await(const lt of R2e({runId:de.run.runId,userId:"test_user",sessionId:de.sessionId,text:oe})){const ct=lt.error||lt.errorMessage||lt.error_message;if(ct||(Fe=Zje(Fe,lt)),Se(Lt=>Lt.map(ln=>{if(ln.id!==Ye.id)return ln;const yr=[...ln.messages],Jt={...yr[yr.length-1]};return ct?Jt.error=String(ct):(Jt.content=Fe.blocks.filter(pi=>pi.kind==="text").map(pi=>pi.text).join(""),Jt.blocks=Fe.blocks),yr[yr.length-1]=Jt,{...ln,messages:yr}})),ct)break}}catch(Fe){Se(lt=>lt.map(ct=>{if(ct.id!==Ye.id)return ct;const Lt=[...ct.messages],ln={...Lt[Lt.length-1]};return ln.error=Fe instanceof Error?Fe.message:String(Fe),Lt[Lt.length-1]=ln,{...ct,messages:Lt}}))}finally{Se(Fe=>Fe.map(lt=>lt.id===Ye.id?{...lt,phase:"ready"}:lt))}}))},yl=()=>{Se(oe=>{if(oe.length>=3)return oe;const $e=ye.current++,st=`variant-${$e}`;return[...oe,{id:st,name:v("traditional.debug.comparison",{count:$e}),modelName:O.modelName??"",description:O.description,instruction:O.instruction,configOpen:!0,phase:"idle",runtimeSnapshot:"",messages:[],error:null}]})},$l=async oe=>{await gl(oe),Se($e=>$e.filter(st=>st.id!==oe)),qe===oe&&Xe("baseline")},La=(oe,$e)=>Se(st=>st.map(Ye=>Ye.id===oe?{...Ye,...$e}:Ye)),Qo=(oe,$e)=>{if($e&&Ml){Yt(Ml);return}const st=$e?[...new Set([...Ds,oe])]:Ds.filter(de=>de!==oe),Ye=rr==="ops"?"default":rr;k(de=>({...de,harnessSidecar:Ay(st,Ye)})),Yt(""),Pe(null)},zo=oe=>{const $e=cH(oe);if($e.length>0&&Ml){Yt(Ml);return}k(st=>({...st,harnessSidecar:Ay($e,oe)})),Yt(""),Pe(null)},Uu=(oe,$e,st)=>{oe==="baseline"&&$e==="modelName"&&(we.current=!0),La(oe,{[$e]:st}),!(qe!==oe||oe==="baseline")&&Xe("baseline")},vl=oe=>{const $e=Oe.find(Lt=>Lt.id===oe);if(!$e)return;const st=$e.modelName.trim(),Ye=$e.description.trim(),de=$e.instruction.trim(),Fe=Vx($e),lt=Oe.findIndex(Lt=>Lt.id===oe),ct=Oe.findIndex(Lt=>Vx(Lt)===Fe);if(!(!st||!Ye||!de||ct!==lt)){if(oe==="baseline"){La(oe,{configOpen:!1});return}yo(oe)}},Fl=async(oe,$e,st)=>{var ct,Lt,ln;const Ye=(u==null?void 0:u.editMode)==="source-preserving",de=bI(O).includes("mcp_resilience"),Fe=(ct=O.deployment)==null?void 0:ct.network,lt=Fe&&Fe.mode&&Fe.mode!=="public"?{mode:Fe.mode,vpc_id:Fe.vpcId,subnet_ids:Fe.subnetIds,enable_shared_internet_access:Fe.enableSharedInternetAccess}:void 0;return $0(oe.name,oe.files,{region:(u==null?void 0:u.region)??_e,projectName:"default",network:lt},{...st,onStage:$e,runtimeId:u==null?void 0:u.runtimeId,runtimeName:(st==null?void 0:st.runtimeName)??A,appName:u==null?void 0:u.appName,agentCategory:"mpa",editMode:u==null?void 0:u.editMode,draft:u||de?SS(O):void 0,updateEtag:u==null?void 0:u.etag,baseRuntimeVersion:u==null?void 0:u.currentVersion,envs:Ye?_on(O,d,st==null?void 0:st.envs):st==null?void 0:st.envs,mcpSecretValues:Ye?_an(O):de?Tan(O):void 0,removeRuntimeEnvKeys:u?[...Oan(u.configuredMcpEnvKeys??[],O),...(Lt=O.deployment)!=null&&Lt.feishuEnabled?[]:["FEISHU_APP_ID","FEISHU_APP_SECRET"]]:void 0,description:O.description,harnessSidecar:O.harnessSidecar,environment:(ln=O.cloudEnvironment)!=null&&ln.environmentId?{environmentId:O.cloudEnvironment.environmentId,environmentVersionId:O.cloudEnvironment.environmentVersionId}:void 0})},Ls=()=>{Fo()&&(Se(oe=>oe.map($e=>$e.id==="baseline"&&!Ae.current.has($e.id)?{...$e,modelName:we.current?$e.modelName:hU(Ti),description:Ti.description,instruction:Ti.instruction}:$e)),X("validate"))},$a=async oe=>{if(oe==="publish"){if(!await Uo())return;await Md();return}if(oe==="validate"){Ls();return}if(oe==="optimize"){await Ld();return}if(oe==="environment"){mc();return}await Uo()&&X(oe)},sn=oe=>{k($e=>({...$e,cloudEnvironment:oe})),Yt(""),Pe(null)},Bl=async oe=>{var mi,lr,cr,pr,ro,Sm,lv,cv,Mh,Df,uv,Ir;if(wn||(et(""),St(!1),!Fo()))return;const $e=rv(A.trim());if($e){et($e);return}const st={...Ti,memory:{...Ti.memory,shortTerm:oe.sessionBackend!=="local"},shortTermBackend:oe.sessionBackend},Ye=fU(st,(u==null?void 0:u.editMode)==="source-preserving"),de=(mi=st.deployment)==null?void 0:mi.network;if((de==null?void 0:de.mode)!==void 0&&de.mode!=="public"&&!((lr=de.vpcId)!=null&&lr.trim())){et(v("traditional.deployment.vpcRequired"));return}if(um(st,d)==="ark"&&!((pr=(cr=st.deployment)==null?void 0:cr.modelApiKeyId)!=null&&pr.trim())){et(v("traditional.deployment.apiKeyRequired"));return}const Fe={...((ro=st.deployment)==null?void 0:ro.envValues)??{},...C,...Ye.fixedValues},lt=Object.keys(Fe).find(xl=>xl&&!/^[A-Za-z_][A-Za-z0-9_]*$/.test(xl));if(lt){et(v("traditional.deployment.invalidEnvName",{key:lt}));return}const ct=(Sm=st.deployment)!=null&&Sm.feishuEnabled?[...Ye.specs,...sS]:Ye.specs,Lt=ssn(ct,Fe,j);if(Lt){et(v("traditional.deployment.requiredEnv",{name:Lt.comment||Lt.key}));return}const ln=lU(ct,Fe);if(ln){et(`${ln.spec.comment||ln.spec.key}:${ln.error}`);return}We(!0),He({level:"info",phase:"prepare",message:v("traditional.deployment.generatingConfiguration"),pct:0});let yr=null,Jt="prepare",pi=v("traditional.deployment.preparing"),Vt=v("traditional.deployment.generatingConfiguration"),yi=u==null?void 0:u.runtimeId,Ln=(u==null?void 0:u.region)??_e,Xn;try{if(!u&&!(await jD(A.trim(),_e)).available)throw new Error(v("traditional.deployment.runtimeNameExists"));const xl=await GS(SS(st));Pe(xl);const xo=crypto.randomUUID(),Qu=Date.now(),wl={id:xo,...c?{draftId:c}:{},agentName:st.name,runtimeName:A.trim(),runtimeId:u==null?void 0:u.runtimeId,region:(u==null?void 0:u.region)??_e,startedAt:Qu,agentDraft:st,mpaProfile:!0,mpaSmoke:!u},zu={...wl,status:"running",phase:Jt,label:pi,message:Vt,pct:0};if(yr=zu,s==null||s(zu),m==null||m(zu),u!=null&&u.mpaProfileOnly){Jt="profile_applying",pi=v("traditional.deployment.stages.applyMpaProfile"),Vt=v("traditional.deployment.applyingMpaProfile"),He({level:"info",phase:Jt,message:Vt,pct:0}),s==null||s({...wl,status:"running",phase:Jt,label:pi,message:Vt,pct:0,mpaProfile:!0,mpaSmoke:!1});const Vi=u.etag?"update":"create",Hr=await JR({draft:st,taskId:xo,agentName:st.name,runtimeId:u.runtimeId,region:u.region,operationKind:Vi,mpaInstanceId:u.mpaInstanceId,runtimeName:A.trim(),sourceDraftId:c,runtimeRevision:u.etag});if(Hr.status!=="succeeded")throw Vt=Hr.safeErrorCode||v("traditional.deployment.mpaOperationIncomplete"),He({level:"error",phase:Jt,message:Vt,pct:100}),new Error(Vt);St(!0),He({level:"success",phase:Jt,message:v("traditional.deployment.mpaProfileApplied"),pct:100}),s==null||s({...wl,status:"success",phase:"complete",label:v("traditional.deployment.complete"),message:v("traditional.deployment.mpaProfileApplied"),pct:100,mpaProfile:!0,mpaSmoke:!1}),await(h==null?void 0:h({apikey:"",url:"",agentName:st.name,runtimeName:A.trim(),runtimeId:u.runtimeId,mpaInstanceId:u.mpaInstanceId,region:u.region,version:u.currentVersion,mpaOperation:Hr}));return}const Lh=new Map(Object.entries(Fe).map(([Vi,Hr])=>[Vi.trim(),Hr]).filter(([Vi,Hr])=>Vi&&Hr.trim()));for(const Vi of RK(ct,Fe))Lh.set(Vi.key,Vi.value);const zl=(cv=(lv=st.deployment)==null?void 0:lv.modelApiKeyId)==null?void 0:cv.trim(),Vu=(Df=(Mh=st.deployment)==null?void 0:Mh.modelApiKeyName)==null?void 0:Df.trim();zl&&Lh.set("MODEL_AGENT_API_KEY_ID",zl),Vu&&Lh.set("MODEL_AGENT_API_KEY_NAME",Vu);const Ol=await Fl(xl,Vi=>{Jt=Vi.phase,pi=Vi.phase==="build"?v("traditional.deployment.stages.build"):Vi.phase==="deploy"?v("traditional.deployment.stages.deploy"):Vi.phase==="publish"?v("traditional.deployment.stages.publish"):v("traditional.deployment.stages.running"),Vt=Vi.message,He(Vi),s==null||s({...wl,runtimeName:Vi.runtimeName||wl.runtimeName,status:"running",phase:Jt,label:pi,message:Vt,messageCode:Vi.messageCode,pct:Vi.pct,...Vi.buildLog?{buildLog:Vi.buildLog}:{}})},{taskId:xo,runtimeName:A.trim(),sessionStorage:oe.sessionStorage,minInstance:oe.minInstance,maxInstance:oe.maxInstance,authentication:oe.authentication,createEvaluationSets:oe.createEvaluationSets,resources:oe.resources,...(uv=st.deployment)!=null&&uv.feishuEnabled?{im:{feishu:{enabled:!0}}}:{},envs:[...Lh].map(([Vi,Hr])=>({key:Vi,value:Hr}))});let Pi=Ol;const Nt=Ol.runtimeId||(u==null?void 0:u.runtimeId)||"",gc=Ol.region||(u==null?void 0:u.region)||_e;if(yi=Nt||yi,Ln=gc,Nt){Jt="profile_applying",pi=v("traditional.deployment.stages.applyMpaProfile"),Vt=v("traditional.deployment.applyingMpaProfile"),He({level:"info",phase:Jt,message:Vt,pct:0}),s==null||s({...wl,runtimeName:Ol.runtimeName||wl.runtimeName,runtimeId:Nt,region:gc,status:"running",phase:Jt,label:pi,message:Vt,pct:0,mpaProfile:!0,mpaSmoke:!u});const Vi=await JR({draft:st,taskId:xo,agentName:st.name,runtimeId:Nt,region:gc,operationKind:u?"update":"create",mpaInstanceId:(u==null?void 0:u.mpaInstanceId)??Ol.mpaInstanceId,runtimeName:A.trim()||Ol.runtimeName,sourceDraftId:c,runtimeRevision:u==null?void 0:u.etag});if(Vi.status!=="succeeded"){if(Jt=Vi.stage==="smoke_running"?"smoke_running":"profile_applying",pi=v(Jt==="smoke_running"?"traditional.deployment.stages.verifyMpaRuntime":"traditional.deployment.stages.applyMpaProfile"),Vt=Vi.safeErrorCode||v("traditional.deployment.mpaOperationIncomplete"),He({level:"error",phase:Jt,message:Vt,pct:100}),Vi.status==="failed_retryable"){const Hr={operationKind:u?"update":"create",runtimeId:Nt,region:gc,mpaInstanceId:(u==null?void 0:u.mpaInstanceId)??Ol.mpaInstanceId??Nt,sourceProfileId:c!=null&&c.trim()?`studio-draft:${c.trim()}`:`studio-agent:${st.name}:${xo}`,draft:st,targetKey:u?u.mpaInstanceId??Nt:`runtime:${gc}:${A.trim()||Ol.runtimeName}`,runtimeRevision:u==null?void 0:u.etag};Xn=async()=>{const Bn=await Nz(Vi.operationId,Hr);if(s==null||s({...wl,runtimeId:Nt,mpaInstanceId:Hr.mpaInstanceId,region:gc,status:Bn.status==="succeeded"?"success":"error",phase:Bn.stage,label:Bn.status==="succeeded"?v("traditional.deployment.complete"):v("traditional.deployment.failed"),message:Bn.safeErrorCode||void 0,pct:100,mpaProfile:!0,mpaSmoke:!u,operationId:Bn.operationId}),Bn.status!=="succeeded")throw new Error(Bn.safeErrorCode||v("traditional.deployment.mpaOperationIncomplete"));await(h==null?void 0:h({...Ol,mpaOperation:Bn}))}}throw new Error(Vt)}u?(Vt=v("traditional.deployment.mpaProfileApplied"),He({level:"success",phase:Jt,message:Vt,pct:100})):(Jt="smoke_running",pi=v("traditional.deployment.stages.verifyMpaRuntime"),Vt=v("traditional.deployment.runningMpaSmoke"),s==null||s({...wl,runtimeName:Ol.runtimeName||wl.runtimeName,runtimeId:Nt,region:gc,status:"running",phase:Jt,label:pi,message:Vt,pct:100,mpaProfile:!0,mpaSmoke:!0}),Jt="runnable",pi=v("traditional.deployment.stages.mpaReady"),Vt=v("traditional.deployment.mpaReady"),He({level:"success",phase:Jt,message:Vt,pct:100})),Pi={...Ol,mpaOperation:Vi}}St(!0),He({level:"success",phase:"complete",message:v("traditional.deployment.complete"),pct:100}),s==null||s({...wl,runtimeName:Pi.runtimeName||wl.runtimeName,runtimeId:Pi.runtimeId||(u==null?void 0:u.runtimeId),region:Pi.region||(u==null?void 0:u.region)||_e,status:"success",phase:Pi.mpaOperation&&!u?"runnable":"complete",label:v("traditional.deployment.complete"),message:Pi.mpaOperation&&!u?v("traditional.deployment.mpaReady"):(Ir=Pi.warnings)==null?void 0:Ir.join(";"),pct:100,mpaProfile:!0,mpaSmoke:!!(Pi.mpaOperation&&!u)}),await(h==null?void 0:h(Pi))}catch(xl){const xo=xl instanceof Error?xl.message:String(xl);et(xo),He(null);const Qu={...yr??{id:crypto.randomUUID(),agentName:Ti.name||v("traditional.basic.unnamedAgent"),runtimeName:A.trim(),region:_e,startedAt:Date.now()},status:"error",runtimeId:yi,region:Ln,phase:Jt,label:v("traditional.deployment.failed"),message:xo,mpaProfile:!0,mpaSmoke:!u,operationId:void 0,retry:Xn??(()=>Bl(oe))};s==null||s(Qu)}finally{We(!1)}},Ss=Qt.current,is=oe=>aon.find($e=>$e.id===oe),rs=a.jsx("section",{className:`cw-ai-compose${_?" is-generating":""}${F?" is-success":""}`,"aria-label":v("traditional.ai.ariaLabel"),children:a.jsx(hf,{initial:!1,mode:"wait",children:F?a.jsxs(Ar.div,{className:"cw-ai-compose-success",role:"status",initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.98},transition:{duration:.22,ease:[.22,1,.36,1]},children:[a.jsx("span",{className:"cw-ai-success-check","aria-hidden":!0}),a.jsx("strong",{children:v("traditional.ai.success")}),a.jsx("button",{type:"button",className:"cw-ai-regenerate",onClick:()=>M(!1),children:v("traditional.ai.regenerate")})]},"success"):a.jsxs(Ar.div,{className:"cw-ai-compose-entry",initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.98},transition:{duration:.2,ease:[.22,1,.36,1]},children:[a.jsxs("form",{className:"cw-ai-compose-form",onSubmit:oe=>{oe.preventDefault(),Rn()},children:[a.jsx("input",{type:"text",value:I,maxLength:8e3,disabled:_,placeholder:v("traditional.ai.placeholder",{model:ltt(d)}),"aria-invalid":!!Z,"aria-describedby":Z?"ai-requirement-error":void 0,onChange:oe=>D(oe.target.value),onKeyDown:oe=>{HT(oe.nativeEvent)||oe.key==="Enter"&&(oe.preventDefault(),Rn())}}),a.jsx("button",{type:"submit",disabled:_||!V||!!Z,"aria-label":v(_?"traditional.ai.generating":"traditional.ai.generate"),children:_?a.jsx("span",{className:"cw-ai-orb","aria-hidden":!0,children:a.jsx("span",{})}):v("traditional.ai.generate")})]}),Z&&a.jsx("p",{className:"cw-ai-requirement-error",id:"ai-requirement-error",role:"alert",children:Z})]},"compose")})});return S?a.jsx(Van,{draft:Ti,cloudProvider:d,deployRegion:_e,runtimeName:A,isRuntimeUpdate:!!u,profileOnly:u==null?void 0:u.mpaProfileOnly,deploying:wn,deployStage:kt,deployError:nt,deploySucceeded:ft,showErrors:ie,onBack:e,onDraftPatch:oe=>{k($e=>({...$e,...oe})),Pe(null),Yt("")},onDeploymentPatch:oe=>k($e=>({...$e,deployment:{...$e.deployment??{feishuEnabled:!1},...oe}})),onModelApiKeyChange:ia,customModelApiKey:Mi?C[Mi.key]??"":"",customModelSecretValues:C,customModelApiKeyConfigured:Ms,configuredRuntimeEnvKeys:j,showModelFallbacks:pl,onCustomModelApiKeyChange:oe=>{Mi&&P(Mi.key,oe)},onCustomModelSecretChange:P,onSelectedSkillsChange:oe=>k($e=>({...$e,selectedSkills:oe})),onCloudEnvironmentChange:sn,onDeployRegionChange:ae,onRuntimeNameChange:oe=>k($e=>({...$e,deployment:{...$e.deployment??{feishuEnabled:!1},runtimeName:oe,runtimeNameCustomized:!0}})),onNetworkChange:oe=>k($e=>({...$e,deployment:{...$e.deployment??{feishuEnabled:!1},network:oe}})),onDeploy:oe=>void Bl(oe)}):a.jsxs("div",{className:`cw-root is-${Y}`,children:[a.jsx(Pon,{mode:Y}),jt&&a.jsx(wb,{className:"cw-workspace-alert",message:jt}),a.jsxs("main",{className:"cw-workspace-main",id:"cw-workspace-main",children:[Y==="build"&&a.jsx("div",{className:"cw-build-workspace",children:a.jsxs("div",{className:"cw-editor",children:[a.jsx(RP,{draft:O,direction:"horizontal",selectedPath:cn,onSelect:Ge,onAdd:ui,onInsert:rt,onDelete:Ue}),a.jsx("div",{className:"cw-detail",children:a.jsx("div",{className:"cw-detail-scroll",ref:xt,children:a.jsx("div",{className:"cw-detail-inner",children:a.jsx("div",{className:"cw-lower",children:a.jsxs("div",{className:"cw-form-col",children:[a.jsxs(Ss,{meta:is("type"),children:[a.jsx(Ly,{className:"cw-agent-type-options","aria-label":v("traditional.agentTypes.ariaLabel"),value:Me.agentType??"llm",onChange:Si,children:uan.map(oe=>{const $e=(Me.agentType??"llm")===oe.id,st=on&&oe.id==="a2a",Ye=st?"cw-remote-agent-disabled-hint":void 0;return a.jsxs("div",{"data-agent-type":oe.id,className:`cw-agent-type-option ${$e?"is-on":""} ${st?"is-disabled":""}`,tabIndex:st?0:void 0,"aria-describedby":Ye,children:[a.jsx(Ly.Item,{value:oe.id,disabled:st,block:!0,className:"cw-agent-type-control",children:a.jsx("span",{className:"cw-agent-type-copy",children:a.jsx("strong",{children:v(lon[oe.id])})})}),st&&a.jsx("span",{id:Ye,className:"cw-agent-type-disabled-hint",role:"tooltip",children:v("traditional.agentTypes.remoteChildOnly")})]},oe.id)})}),ie&&ti&&Me.subAgents.length===0&&a.jsx("span",{className:"cw-error-text",children:Son({name:Me.name.trim(),agentType:Me.agentType},v)})]}),a.jsx(Ss,{meta:is("basic"),children:a.jsxs("div",{className:"cw-form",children:[!Ei&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"cw-field",children:[a.jsxs("label",{className:"cw-label",children:[v(on?"traditional.basic.agentName":"traditional.basic.name"),a.jsx("span",{className:"cw-req",children:"*"})]}),a.jsx("input",{className:`cw-input ${no(he,gr)}`,"data-validation-field":"name",value:Me.name,placeholder:"assistant","aria-invalid":gr&&he,"aria-describedby":gr&&fs?"cw-agent-name-error":void 0,onBlur:Sn,onChange:oe=>{Sn(),un({name:oe.target.value})}}),gr&&fs?a.jsx("span",{id:"cw-agent-name-error",role:"alert",className:"cw-error-text",children:fs}):a.jsx("span",{className:"cw-help",children:v("traditional.basic.nameHelp")})]}),a.jsxs("div",{className:"cw-field",children:[a.jsxs("label",{className:"cw-label",children:[v(on?"common.description":"traditional.basic.agentDescription"),a.jsx("span",{className:"cw-req",children:"*"})]}),a.jsx("textarea",{className:`cw-textarea cw-textarea-sm ${no(bo)}`,"data-validation-field":"description",value:Me.description,placeholder:v("traditional.basic.descriptionPlaceholder"),"aria-invalid":ie&&bo,"aria-describedby":ie&&bo?"cw-agent-description-error":void 0,onChange:oe=>un({description:oe.target.value})}),ie&&bo?a.jsx("span",{id:"cw-agent-description-error",role:"alert",className:"cw-error-text",children:v("traditional.validation.missingDescription")}):a.jsx("span",{className:"cw-help",children:v(on?"traditional.basic.rootDescriptionHelp":"traditional.basic.descriptionHelp")})]})]}),ti?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"cw-section-desc cw-dependency-hint",children:v("traditional.basic.orchestratorHelp")}),Me.agentType==="loop"&&a.jsxs("div",{className:"cw-field",children:[a.jsx("label",{className:"cw-label",children:v("traditional.basic.maxIterations")}),a.jsx("input",{className:"cw-input",type:"number",min:1,value:Me.maxIterations??3,onChange:oe=>un({maxIterations:Math.max(1,Number(oe.target.value)||1)})}),a.jsx("span",{className:"cw-help",children:v("traditional.basic.maxIterationsHelp")})]})]}):Ei?a.jsxs("div",{className:"cw-field cw-remote-center-fields","data-validation-field":"a2a-registry",children:[a.jsxs("div",{className:"cw-remote-center-head",children:[a.jsxs("div",{className:"cw-label",children:[v("traditional.basic.agentCenter"),a.jsx("span",{className:"cw-req",children:"*"})]}),a.jsx("p",{className:"cw-help cw-remote-center-description",children:v("traditional.basic.agentCenterHelp")})]}),a.jsx(pon,{value:((Re=Me.a2aRegistry)==null?void 0:Re.registrySpaceId)??"",region:((ot=Me.a2aRegistry)==null?void 0:ot.registryRegion)||es.region,invalid:ie&&fl,onChange:oe=>Fn(sUe,oe)}),a.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":Ct,"aria-controls":zi,onClick:()=>It(oe=>!oe),children:[a.jsx("span",{children:v("traditional.basic.moreOptions")}),a.jsx(BA,{className:`cw-more-options-chevron ${Ct?"is-open":""}`,"aria-hidden":!0})]}),a.jsx(hf,{initial:!1,children:Ct&&a.jsx(Ar.div,{id:zi,className:"cw-model-advanced",initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.18,ease:"easeOut"},children:a.jsx($k,{env:hx(con,d),values:aUe(Me.a2aRegistry,{includeDefaults:!1},d),onChange:Fn})})}),ie&&fl&&a.jsx("span",{className:"cw-error-text",role:"alert",children:v("traditional.validation.missingRegistry")})]}):a.jsxs("div",{className:"cw-field","data-validation-field":"instruction",children:[a.jsxs("label",{className:"cw-label",children:[v("traditional.basic.systemPrompt"),a.jsx("span",{className:"cw-req",children:"*"})]}),a.jsx(p.Suspense,{fallback:a.jsx("div",{className:"cw-markdown-loading",role:"status",children:v("traditional.basic.loadingMarkdown")}),children:a.jsx(ion,{value:Me.instruction,invalid:to,onChange:oe=>un({instruction:oe})})}),ie&&to?a.jsx("span",{className:"cw-error-text",role:"alert",children:v("traditional.validation.missingPrompt")}):a.jsx("span",{className:"cw-help",children:v("traditional.basic.markdownHelp")})]})]})}),!ti&&!Ei&&a.jsxs(a.Fragment,{children:[a.jsx(Ss,{meta:is("model"),children:a.jsxs("div",{className:"cw-form",children:[a.jsxs("div",{className:"cw-field cw-model-source-field",children:[a.jsx("label",{className:"cw-label",children:v("traditional.model.source")}),a.jsx(Ly,{className:"cw-model-source-options","aria-label":v("traditional.model.source"),value:ts,onChange:oe=>{oe!=="gateway"&&ba(oe)},children:[{value:"ark",label:v(d==="byteplus"?"traditional.model.bytePlusModelArk":"traditional.model.volcanoArk")},{value:"custom",label:v("traditional.model.custom")},{value:"gateway",label:v("traditional.model.gateway"),disabled:!0}].map(oe=>a.jsx("div",{className:`cw-model-source-option ${ts===oe.value?"is-on":""}${oe.disabled?" is-disabled":""}`,children:a.jsxs(Ly.Item,{value:oe.value,disabled:oe.disabled,block:!0,className:"cw-model-source-control",children:[a.jsx("span",{children:oe.label}),oe.disabled&&a.jsx("span",{className:"cw-model-source-coming-soon",children:v("traditional.model.comingSoon")})]})},oe.value))})]}),ts==="ark"?a.jsxs("div",{className:"cw-field","data-validation-field":"model-api-key",children:[a.jsx("label",{className:"cw-label",children:v("traditional.model.configuration")}),a.jsx(hon,{value:Me.modelName??"",fallbacks:Me.modelFallbacks??[],cloudProvider:d,agentName:Me.name,apiKeyId:($t=O.deployment)==null?void 0:$t.modelApiKeyId,apiKeyName:(Dn=O.deployment)==null?void 0:Dn.modelApiKeyName,customModelSecretValues:C,configuredRuntimeEnvKeys:j,showFallbacks:pl,showMissingApiKeyErrors:ie,onApiKeyChange:oe=>k($e=>({...$e,deployment:{...$e.deployment??{feishuEnabled:!1},modelApiKeyId:oe.id,modelApiKeyName:oe.name}})),onChange:oe=>un({modelName:oe,modelFallbacks:Nu(oe,Me.modelFallbacks)}),onFallbacksChange:oe=>un({modelFallbacks:oe}),onCustomModelSecretChange:P}),ie&&hs?a.jsx("span",{className:"cw-error-text",role:"alert",children:v("traditional.deployment.apiKeyRequired")}):null]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"cw-field",children:[a.jsx("label",{className:"cw-label",children:v("traditional.model.name")}),a.jsx("input",{className:"cw-input",value:Me.modelName??"",onChange:oe=>un({modelName:oe.target.value,modelFallbacks:Nu(oe.target.value,Me.modelFallbacks)})})]}),a.jsxs("div",{className:"cw-field",children:[a.jsxs("label",{className:"cw-label cw-label-with-link",children:[a.jsx("span",{children:v("traditional.model.provider")}),a.jsxs("a",{href:"https://docs.litellm.ai/docs/providers",target:"_blank",rel:"noopener noreferrer",onClick:oe=>oe.stopPropagation(),children:[v("traditional.model.liteLlmProviders"),a.jsx(d0,{"aria-hidden":"true"})]})]}),a.jsx("input",{className:"cw-input",value:Me.modelProvider??"",placeholder:"openai",onChange:oe=>un({modelProvider:oe.target.value})})]}),a.jsxs("div",{className:"cw-field",children:[a.jsx("label",{className:"cw-label",children:"API Base"}),a.jsx("input",{className:"cw-input",type:"url",inputMode:"url",value:Me.modelApiBase??"",placeholder:Do(d),"aria-invalid":ml,onChange:oe=>un({modelApiBase:oe.target.value})}),ml?a.jsx("span",{className:"cw-env-error",children:v("traditional.model.invalidApiBase")}):null]}),a.jsxs("div",{className:"cw-field","data-validation-field":"model-api-key",children:[a.jsx("label",{className:"cw-label",children:"API Key"}),a.jsx("input",{className:`cw-input ${no(Vr)}`,type:"password",value:Mi?C[Mi.key]??"":"",placeholder:Ms&&!(Mi&&C[Mi.key])?"••••••":v("traditional.model.apiKeyPlaceholder"),autoComplete:"new-password",onChange:oe=>{if(!Mi)return;const $e=oe.currentTarget.value;P(Mi.key,$e)}}),ie&&Vr?a.jsx("span",{className:"cw-error-text",role:"alert",children:v("traditional.deployment.apiKeyRequired")}):null]})]}),ts==="custom"&&pl&&a.jsx(FP,{variant:"traditional",primaryModelName:Me.modelName??"",agentName:Me.name,value:Me.modelFallbacks??[],secretValues:C,configuredSecretEnvKeys:j,showMissingApiKeyErrors:ie,onChange:oe=>un({modelFallbacks:oe}),onSecretChange:P})]})}),a.jsx(Ss,{meta:is("tools"),children:a.jsxs("div",{className:"cw-form",children:[a.jsxs("div",{className:"cw-field",children:[a.jsx("label",{className:"cw-label",children:v("traditional.tools.builtIn")}),a.jsx("span",{className:"cw-help",children:v("traditional.tools.builtInHelp")}),a.jsx("div",{className:"cw-tools-list-shell",children:a.jsx(uon,{items:Ht,selected:bt,onToggle:Lr,scrollRows:6})}),a.jsx(hf,{initial:!1,children:bt.includes("run_code")&&a.jsxs(Ar.div,{className:"cw-tool-config",initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.16,ease:"easeOut"},children:[a.jsxs("div",{className:"cw-tool-config-head",children:[a.jsx("span",{className:"cw-label",children:v("traditional.tools.codeExecution")}),a.jsx("span",{className:"cw-help",children:v("traditional.tools.codeExecutionHelp")})]}),a.jsx($k,{env:((On=JA.find(oe=>oe.id==="run_code"))==null?void 0:On.env)??[],values:((mn=O.deployment)==null?void 0:mn.envValues)??{},onChange:Pn})]})})]}),a.jsxs("div",{className:"cw-field cw-mcp-field",children:[a.jsx("label",{className:"cw-label",children:v("traditional.tools.mcp")}),a.jsx(yon,{tools:Nr,conflict:qs,showConflict:ie,onChange:oe=>un({mcpTools:oe})})]})]})}),a.jsx(Ss,{meta:is("skills"),children:a.jsx("div",{className:"cw-form",children:a.jsx(yK,{selected:Ws,onChange:oe=>un({selectedSkills:oe}),cloudProvider:d})})}),a.jsx(Ss,{meta:is("knowledge"),children:a.jsxs("div",{className:"cw-form cw-toggle-stack",children:[a.jsx(jj,{checked:Me.knowledgebase,onChange:oe=>un({knowledgebase:oe}),title:v("traditional.knowledge.title"),desc:v("traditional.knowledge.description"),icon:gN}),Me.knowledgebase&&a.jsxs("div",{className:"cw-field cw-subfield",children:[a.jsx("label",{className:"cw-label",children:v("traditional.knowledge.backend")}),a.jsx($6,{options:jB,value:Me.knowledgebaseBackend,translationGroup:"knowledge",onChange:oe=>un({knowledgebaseBackend:oe,knowledgebaseIndex:oe==="viking"||oe==="openviking"?Me.knowledgebaseIndex:""})}),(Me.knowledgebaseBackend??Mg)==="viking"&&a.jsxs("div",{className:"cw-field cw-subfield",children:[a.jsx("label",{className:"cw-label",children:v("traditional.knowledge.vikingDatabase")}),a.jsx(mon,{value:Me.knowledgebaseIndex??"",onChange:oe=>{un({knowledgebaseIndex:oe.id}),oe.projectName&&Pn("DATABASE_VIKING_PROJECT",oe.projectName),oe.region&&Pn("DATABASE_VIKING_REGION",oe.region),oe.sourceKind&&Pn("DATABASE_VIKING_COLLECTION_KIND",oe.sourceKind),Pn("DATABASE_VIKING_RESOURCE_ID",oe.resourceId??"")}})]}),a.jsx($k,{env:((jn=jB.find(oe=>oe.id===(Me.knowledgebaseBackend??Mg)))==null?void 0:jn.env)??[],values:((Wt=O.deployment)==null?void 0:Wt.envValues)??{},onChange:Pn,renderAfterField:(Me.knowledgebaseBackend??Mg)==="openviking"?oe=>oe.key==="DATABASE_OPENVIKING_USER_ID"?a.jsx(fon,{value:Me.knowledgebaseIndex??"",onChange:$e=>un({knowledgebaseIndex:$e})}):null:void 0})]})]})}),on&&a.jsx(Ss,{meta:is("memory"),children:a.jsxs("div",{className:"cw-form cw-toggle-stack",children:[a.jsx(jj,{checked:Me.memory.shortTerm,onChange:oe=>un({memory:{...Me.memory,shortTerm:oe}}),title:v("traditional.memory.shortTerm"),desc:v("traditional.memory.shortTermDescription"),showDescription:!0,icon:Fje}),Me.memory.shortTerm&&a.jsxs("div",{className:"cw-field cw-subfield",children:[a.jsx("label",{className:"cw-label",children:v("traditional.memory.shortTermBackend")}),a.jsx($6,{options:lw,value:Me.shortTermBackend,translationGroup:"shortTerm",onChange:oe=>un({shortTermBackend:oe})}),a.jsx($k,{env:((bn=lw.find(oe=>oe.id===(Me.shortTermBackend??"local")))==null?void 0:bn.env)??[],values:((Mn=O.deployment)==null?void 0:Mn.envValues)??{},onChange:Pn})]}),a.jsx(jj,{checked:Me.memory.longTerm,onChange:oe=>un({memory:{...Me.memory,longTerm:oe}}),title:v("traditional.memory.longTerm"),desc:v("traditional.memory.longTermDescription"),showDescription:!0,icon:gN}),Me.memory.longTerm&&a.jsxs("div",{className:"cw-field cw-subfield",children:[a.jsx("label",{className:"cw-label",children:v("traditional.memory.longTermBackend")}),a.jsx($6,{options:_B,value:Me.longTermBackend,translationGroup:"longTerm",onChange:oe=>un({longTermBackend:oe,longTermMemoryIndex:oe==="viking"?Me.longTermMemoryIndex:""})}),(Me.longTermBackend??"local")==="viking"&&a.jsxs("div",{className:"cw-field cw-subfield",children:[a.jsx("label",{className:"cw-label",children:v("traditional.memory.vikingDatabase")}),a.jsx(gon,{value:Me.longTermMemoryIndex??"",onChange:oe=>{un({longTermMemoryIndex:oe.id}),Pn("DATABASE_VIKINGMEM_PROJECT",oe.projectName),Pn("DATABASE_VIKING_REGION",oe.region),Pn("DATABASE_VIKINGMEM_MEMORY_TYPE",(oe.memoryTypes??[]).join(","))}})]}),a.jsx($k,{env:((ai=_B.find(oe=>oe.id===(Me.longTermBackend??"local")))==null?void 0:ai.env)??[],values:((ss=O.deployment)==null?void 0:ss.envValues)??{},onChange:Pn}),a.jsx(jj,{checked:!!Me.autoSaveSession,onChange:oe=>un({autoSaveSession:oe}),title:v("traditional.memory.autoSave"),desc:v("traditional.memory.autoSaveDescription"),icon:gN})]})]})})]})]})})})})})]})}),Y==="validate"&&a.jsx("div",{className:"cw-validation-workspace",children:a.jsx("div",{className:"cw-validation-content",children:a.jsx(Non,{enabled:le,disabledReason:ge,variants:Oe,draftSnapshot:hl,input:_t,onInput:Pt,onSend:$d,onStartVariant:yo,onUseVariant:oe=>void mc(oe),onAddVariant:yl,onRemoveVariant:$l,onToggleConfig:oe=>{const $e=Oe.find(st=>st.id===oe);$e&&La(oe,{configOpen:!$e.configOpen})},onCompleteConfig:vl,onConfigChange:Uu,onOpenTrace:Bo})})}),Y==="optimize"&&a.jsx(Ron,{profile:rr,optimizations:Ds,onProfileChange:zo,onOptimizationChange:Qo}),Y==="environment"&&a.jsx("div",{className:"cw-environment-workspace",children:a.jsx(nUe,{value:O.cloudEnvironment??{environmentId:"",environmentVersionId:""},onChange:sn,disabled:Ee})}),Y==="publish"&&a.jsx("div",{className:"cw-preview-body",children:je?a.jsx(qT,{embedded:!0,cloudProvider:d,project:je,agentDraft:O,agentName:O.name||v("traditional.basic.unnamedAgent"),agentCount:uUe(O),releaseConfiguration:br?{modelName:br.modelName||O.modelName||v("traditional.debug.defaultModel"),description:br.description,instruction:br.instruction,optimizations:[v("traditional.optimization.releaseScenario",{profile:v(`traditional.optimization.profiles.${rr}.label`)}),...Ds.map(oe=>v(`traditional.optimization.options.${oe}.label`))]}:void 0,onChange:Pe,onDeploy:Fl,onAgentAdded:n,onDeploymentTaskChange:s,deploymentActionLabel:v(u?"traditional.deployment.updateAndPublish":"common.deploy"),deploymentActionTargetId:"cw-publish-primary-action",deploymentRuntimeId:u==null?void 0:u.runtimeId,deploymentMpaInstanceId:u==null?void 0:u.mpaInstanceId,deploymentRuntimeName:A,deploymentRuntimeRevision:u==null?void 0:u.etag,deploymentRuntimeNameCustomized:!!u||!!((re=O.deployment)!=null&&re.runtimeNameCustomized),onDeploymentRuntimeNameChange:oe=>k($e=>({...$e,deployment:{...$e.deployment??{feishuEnabled:!1},runtimeName:oe,runtimeNameCustomized:!0}})),onDeploymentStarted:m,onDeploymentComplete:h,feishuEnabled:!!((zn=O.deployment)!=null&&zn.feishuEnabled),configuredRuntimeEnvKeys:u==null?void 0:u.configuredRuntimeEnvKeys,onFeishuEnabledChange:async oe=>{const $e={...O,deployment:{...O.deployment??{feishuEnabled:!1},feishuEnabled:oe}},st=await GS(SS($e));k($e),Pe(st)},deploymentEnv:$r.specs,requiredSecretEnv:Lo,requiredSecretEnvValues:C,onRequiredSecretEnvChange:P,deploymentEnvValues:{...(bi=Ti.deployment)==null?void 0:bi.envValues,...C,...$r.fixedValues},onDeploymentEnvChange:Pn,onFeishuCredentialsChange:(oe,$e)=>or({FEISHU_APP_ID:oe,FEISHU_APP_SECRET:$e}),network:(Fa=O.deployment)==null?void 0:Fa.network,onNetworkChange:oe=>k($e=>({...$e,deployment:{...$e.deployment??{feishuEnabled:!1},network:oe}})),deployRegion:_e,onDeployRegionChange:ae,deploymentTelemetry:{source:"scratch",createMode:o,aiAssisted:z},onExportYaml:()=>son(`${Ti.name||"agent"}.yaml`,Nan(Ti,{heading:v("yaml.heading"),importHint:v("yaml.importHint")}),"text/yaml")}):a.jsxs("div",{className:"cw-publish-loading",role:"status",children:[a.jsx(Bi,{className:"cw-i cw-spin"}),a.jsx("strong",{children:v("traditional.publish.generating")}),a.jsx("span",{children:v("traditional.publish.validating")})]})})]}),a.jsx(Don,{mode:Y,busy:Ee,nextDisabled:Y==="build"&&ya&&ie,onChange:$a,assistant:Y==="build"?rs:void 0}),Kt&&a.jsx(iUe,{testRunId:Kt.runId,sessionId:Kt.sessionId,title:v("traditional.debug.traceTitle",{name:Kt.variantName}),onClose:()=>Et(null)}),vt&&a.jsx(Ad,{variant:"warning",title:v("traditional.debug.leaveTitle"),description:v("traditional.debug.leaveDescription"),confirmLabel:v(mt?"traditional.debug.cleaning":"traditional.debug.confirmLeave"),closeLabel:v("traditional.debug.closeLeaveConfirmation"),busy:mt,onCancel:bl,onConfirm:()=>void Bu()}),U&&a.jsx("div",{className:"confirm-scrim",onClick:()=>J(null),children:a.jsxs("div",{className:"confirm-box cw-ai-error-dialog",role:"alertdialog","aria-modal":"true","aria-labelledby":"ai-generate-error-title","aria-describedby":"ai-generate-error-message",onClick:oe=>oe.stopPropagation(),children:[a.jsx("div",{className:"confirm-title",id:"ai-generate-error-title",children:v("traditional.ai.failed")}),a.jsx("div",{className:"cw-ai-error-message",id:"ai-generate-error-message",children:U}),a.jsx("div",{className:"confirm-actions",children:a.jsx("button",{type:"button",className:"confirm-btn cw-ai-error-close",onClick:()=>J(null),children:v("common.close")})})]})})]})}const Lon=p.lazy(()=>Js(()=>import("../chunks/QuickAgentCreateDialog-_TpoDPFW.js"),__vite__mapDeps([4,5])));function Gd({name:e}){const t={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};switch(e){case"branch":return a.jsxs("svg",{...t,children:[a.jsx("circle",{cx:"6",cy:"5",r:"2"}),a.jsx("circle",{cx:"18",cy:"7",r:"2"}),a.jsx("circle",{cx:"18",cy:"17",r:"2"}),a.jsx("path",{d:"M8 5h2.5A3.5 3.5 0 0 1 14 8.5v7A1.5 1.5 0 0 0 15.5 17H16"}),a.jsx("path",{d:"M14 10.5v-2A1.5 1.5 0 0 1 15.5 7H16"})]});case"plan":return a.jsxs("svg",{...t,children:[a.jsx("path",{d:"M6.5 3.5h11a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2h-11a2 2 0 0 1-2-2v-13a2 2 0 0 1 2-2Z"}),a.jsx("path",{d:"m8 9 1.4 1.4L12 7.8M13.5 10H16M8 15l1.4 1.4 2.6-2.6M13.5 16H16"})]});case"collaborate":return a.jsxs("svg",{...t,children:[a.jsx("circle",{cx:"8",cy:"8",r:"3"}),a.jsx("circle",{cx:"17",cy:"9",r:"2.5"}),a.jsx("path",{d:"M3.5 19a4.5 4.5 0 0 1 9 0M13.5 15.5A4 4 0 0 1 20.5 18"})]});case"summary":return a.jsx("svg",{...t,children:a.jsx("path",{d:"M5 4h14v16H5zM8 8h8M8 12h8M8 16h5"})});case"skills":return a.jsxs("svg",{...t,children:[a.jsx("path",{d:"M5 5h5v5H5zM14 5h5v5h-5zM5 14h5v5H5z"}),a.jsx("path",{d:"M14 16.5h5M16.5 14v5"})]});case"trace":return a.jsxs("svg",{...t,children:[a.jsx("circle",{cx:"6",cy:"6",r:"2"}),a.jsx("circle",{cx:"18",cy:"12",r:"2"}),a.jsx("circle",{cx:"8",cy:"18",r:"2"}),a.jsx("path",{d:"M8 6h3a3 3 0 0 1 3 3v0a3 3 0 0 0 2 2.83M16.2 13.2 9.8 16.8"})]});case"structure":return a.jsxs("svg",{...t,children:[a.jsx("rect",{x:"3.5",y:"4",width:"7",height:"5",rx:"1"}),a.jsx("rect",{x:"13.5",y:"15",width:"7",height:"5",rx:"1"}),a.jsx("path",{d:"M10.5 6.5h3A3.5 3.5 0 0 1 17 10v5M7 9v7a2 2 0 0 0 2 2h4.5"})]});case"model":return a.jsxs("svg",{...t,children:[a.jsx("path",{d:"M8 3.5v3M16 3.5v3M8 17.5v3M16 17.5v3M3.5 8h3M17.5 8h3M3.5 16h3M17.5 16h3"}),a.jsx("rect",{x:"6.5",y:"6.5",width:"11",height:"11",rx:"2"}),a.jsx("path",{d:"M10 10h4v4h-4z"})]});case"environment":return a.jsxs("svg",{...t,children:[a.jsx("path",{d:"M4 7.5h16M7 4h10l3 3.5v10L17 20H7l-3-2.5v-10Z"}),a.jsx("path",{d:"m8 12 2 2-2 2M12.5 16H16"})]});case"deploy":return a.jsxs("svg",{...t,children:[a.jsx("path",{d:"M12 3.5v11M7.5 8 12 3.5 16.5 8"}),a.jsx("path",{d:"M5 13.5v5A1.5 1.5 0 0 0 6.5 20h11a1.5 1.5 0 0 0 1.5-1.5v-5"})]});case"workflow":return a.jsxs("svg",{...t,children:[a.jsx("rect",{x:"4",y:"4",width:"6",height:"5",rx:"1"}),a.jsx("rect",{x:"14",y:"15",width:"6",height:"5",rx:"1"}),a.jsx("path",{d:"M10 6.5h2a4 4 0 0 1 4 4V15M7 9v3a4 4 0 0 0 4 4h3"})]})}}function $on({onSelectVulcan:e,onSelectDeepseek:t,onSelectTraditional:n}){const{t:i}=Te("create"),r=kD(),[s,o]=p.useState(!1),[l,c]=p.useState(!1),[u,d]=p.useState(!1),f=p.useRef(null),h=g=>{if(!s){if(r){g();return}f.current=g,o(!0)}},m=()=>{if(!s)return;const g=f.current;f.current=null,g==null||g()};return a.jsxs(Ar.main,{className:`agent-creation-mode-picker${s?" is-leaving":""}`,initial:r?!1:{opacity:0},animate:{opacity:s?0:1},transition:{duration:s?.12:.18,ease:[.16,1,.3,1]},onAnimationComplete:m,children:[a.jsxs("section",{className:"agent-creation-mode-picker__content","aria-labelledby":"agent-creation-mode-picker-title",children:[a.jsxs("header",{className:"agent-creation-mode-picker__header",children:[a.jsx("h1",{id:"agent-creation-mode-picker-title",children:i("modePicker.title")}),a.jsx("p",{children:i("modePicker.subtitle")})]}),a.jsxs("div",{className:"agent-creation-mode-picker__options",children:[a.jsxs(Tt,{type:"button",className:"agent-creation-mode-picker__card",color:"secondary",variant:"outline",pill:!1,block:!0,onClick:()=>{d(!0),c(!0)},children:[a.jsxs("span",{className:"agent-creation-mode-picker__card-header",children:[a.jsx(Jw,{className:"agent-creation-mode-picker__avatar is-vulcan",seed:i("modePicker.quick.title")}),a.jsxs("span",{className:"agent-creation-mode-picker__card-copy",children:[a.jsx("span",{className:"agent-creation-mode-picker__card-title",children:i("modePicker.quick.title")}),a.jsx("span",{className:"agent-creation-mode-picker__card-description",children:i("modePicker.quick.description")})]})]}),a.jsx("span",{className:"agent-creation-mode-picker__divider","aria-hidden":"true"}),a.jsxs("span",{className:"agent-creation-mode-picker__features",children:[a.jsx("span",{children:i("modePicker.features")}),a.jsxs("span",{className:"agent-creation-mode-picker__feature-grid",children:[a.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[a.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:a.jsx(Gd,{name:"branch"})}),a.jsx("span",{children:i("modePicker.quick.features.dynamicSubagents")})]}),a.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[a.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:a.jsx(Gd,{name:"plan"})}),a.jsx("span",{children:i("modePicker.quick.features.autonomousPlanning")})]}),a.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[a.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:a.jsx(Gd,{name:"collaborate"})}),a.jsx("span",{children:i("modePicker.quick.features.collaboration")})]}),a.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[a.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:a.jsx(Gd,{name:"summary"})}),a.jsx("span",{children:i("modePicker.quick.features.summary")})]}),a.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[a.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:a.jsx(Gd,{name:"skills"})}),a.jsx("span",{children:i("modePicker.quick.features.skills")})]}),a.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[a.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:a.jsx(Gd,{name:"trace"})}),a.jsx("span",{children:i("modePicker.quick.features.trace")})]})]})]})]}),a.jsxs(Tt,{type:"button",className:"agent-creation-mode-picker__card",color:"secondary",variant:"outline",pill:!1,block:!0,onClick:()=>h(n),children:[a.jsxs("span",{className:"agent-creation-mode-picker__card-header",children:[a.jsx(Jw,{className:"agent-creation-mode-picker__avatar is-traditional",seed:i("modePicker.traditional.title")}),a.jsxs("span",{className:"agent-creation-mode-picker__card-copy",children:[a.jsx("span",{className:"agent-creation-mode-picker__card-title",children:i("modePicker.traditional.title")}),a.jsx("span",{className:"agent-creation-mode-picker__card-description",children:i("modePicker.traditional.description")})]})]}),a.jsx("span",{className:"agent-creation-mode-picker__divider","aria-hidden":"true"}),a.jsxs("span",{className:"agent-creation-mode-picker__features",children:[a.jsx("span",{children:i("modePicker.features")}),a.jsxs("span",{className:"agent-creation-mode-picker__feature-grid",children:[a.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[a.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:a.jsx(Gd,{name:"structure"})}),a.jsx("span",{children:i("modePicker.traditional.features.visualConfig")})]}),a.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[a.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:a.jsx(Gd,{name:"model"})}),a.jsx("span",{children:i("modePicker.traditional.features.migration")})]}),a.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[a.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:a.jsx(Gd,{name:"environment"})}),a.jsx("span",{children:i("modePicker.traditional.features.debugging")})]}),a.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[a.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:a.jsx(Gd,{name:"deploy"})}),a.jsx("span",{children:i("modePicker.traditional.features.optimization")})]}),a.jsxs("span",{className:"agent-creation-mode-picker__feature",children:[a.jsx("span",{className:"agent-creation-mode-picker__feature-icon",children:a.jsx(Gd,{name:"workflow"})}),a.jsx("span",{children:i("modePicker.traditional.features.parameters")})]})]})]})]})]})]}),u&&a.jsx(p.Suspense,{fallback:null,children:a.jsx(Lon,{open:l,onClose:()=>c(!1),onSelect:g=>{c(!1),h(g==="deepseek"?t:e)}})})]})}const Ij="\0custom";function hUe({label:e,value:t,options:n,onChange:i,allowCustom:r=!1,allowEmpty:s=!0,disabled:o=!1,placeholder:l,error:c,describedBy:u}){const{t:d}=Te("deepseek"),f=p.useId(),[h,m]=p.useState(!1),g=r&&(h||!!(t&&!n.includes(t)));return a.jsxs("div",{className:"dsh-native-choice",children:[a.jsx(xf,{ariaLabel:e,value:g?Ij:t,valueLabel:t,placeholder:l??d("optional"),disabled:o,options:[...s?[{value:"",label:d("optional")}]:[],...n.map(b=>({value:b,label:b})),...r?[{value:Ij,label:d("customValue")}]:[]],onChange:b=>{m(b===Ij),b!==Ij&&i(b)}}),g&&a.jsxs("div",{className:"dsh-custom-value",children:[a.jsx("label",{className:"cw-label",htmlFor:f,children:d("customField",{field:e})}),a.jsx("input",{id:f,className:"cw-input",value:t,autoComplete:"off",spellCheck:!1,placeholder:d("enterCustomValue"),"aria-invalid":!!c,"aria-describedby":u,onChange:b=>i(b.target.value)})]})]})}const Fon=String.raw`import { createServer } from 'node:http'; import { randomUUID } from 'node:crypto'; export const name = 'agentkit-runtime'; @@ -1381,7 +1381,7 @@ Source: ${mUe}/docs/config-catalog.md `).filter(Boolean),L=RUe.map(V=>({id:V,label:Y6(V,t,!0)})),F=L.findIndex(V=>V.id===i.progressStage),M=s==="submitting"&&i.progressStage!=="idle"&&F<0,z=async V=>{try{await navigator.clipboard.writeText(V.join(` `)),w("copied")}catch{w("error")}},q=()=>{var V;v(!1),w("idle"),d(""),h(null),g(S.current||((V=A[0])==null?void 0:V.version)||""),o("confirm")};return a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:e==="feature-link"?"welcome-feature-link studio-update-trigger--feature":`studio-update-trigger is-${s}`,title:s==="checking-permissions"?t("studioUpdate.checkingPermissions"):s==="permission"?t("studioUpdate.authorizationRequired"):s==="submitting"?t("studioUpdate.updating"):s==="published"?t("studioUpdate.updated"):t("studioUpdate.updateToVersion",{version:i.latestVersion}),onClick:()=>{var V;s==="published"?window.location.reload():(s==="checking-permissions"||s==="permission"||s==="submitting"||s==="error"||(g(((V=A[0])==null?void 0:V.version)||i.latestVersion),o("confirm")),c(!0))},children:[e!=="feature-link"&&a.jsx(zce,{className:"studio-update-icon"}),s==="checking-permissions"?a.jsx(hn,{as:"span",children:t("studioUpdate.checkPermissions")}):s==="permission"?a.jsx("span",{children:t("studioUpdate.authorizationNeeded")}):s==="submitting"?a.jsx(hn,{as:"span",children:t("studioUpdate.updatingShort")}):s==="published"?a.jsx("span",{children:t("studioUpdate.refreshForNewVersion")}):s==="error"?a.jsx("span",{children:t("studioUpdate.updateFailed")}):e==="feature-link"?a.jsx("span",{children:t("studioUpdate.updateNow")}):a.jsx("span",{children:t("studioUpdate.newVersionAvailable")})]}),l&&s!=="idle"&&vi.createPortal(a.jsx("div",{className:"confirm-scrim",role:"presentation",children:a.jsxs("section",{className:`confirm-box studio-update-dialog${s==="submitting"||s==="published"||s==="error"?" is-progress":""}`,role:"dialog","aria-modal":"true","aria-labelledby":"studio-update-title",children:[a.jsx("div",{className:"studio-update-dialog-mark",children:a.jsx(zce,{})}),a.jsx("div",{id:"studio-update-title",className:"confirm-title",children:t(s==="error"?"studioUpdate.dialog.failed":s==="checking-permissions"?"studioUpdate.dialog.checkingPermissions":s==="permission"?"studioUpdate.dialog.authorizationRequired":s==="submitting"?"studioUpdate.dialog.updating":s==="published"?"studioUpdate.dialog.completed":"studioUpdate.dialog.newVersion")}),s==="checking-permissions"?a.jsxs("div",{className:"studio-update-permission-checking",role:"status",children:[a.jsx(hn,{as:"p",children:t("studioUpdate.permissionCheck")}),a.jsx("p",{children:t("studioUpdate.permissionCheckHint")})]}):s==="permission"&&f?a.jsxs("div",{className:"studio-update-authorization-panel",children:[a.jsx("p",{className:"confirm-text",children:t("studioUpdate.missingPermissionCount",{count:f.missingActions.length})}),a.jsxs("dl",{className:"studio-update-authorization-principal",children:[a.jsxs("div",{children:[a.jsx("dt",{children:t("studioUpdate.functionRole")}),a.jsx("dd",{children:f.principalName||t("studioUpdate.currentRole")})]}),f.policyName&&a.jsxs("div",{children:[a.jsx("dt",{children:t("studioUpdate.policyToUpdate")}),a.jsx("dd",{children:f.policyName})]})]}),a.jsxs("ol",{className:"studio-update-authorization-steps",children:[a.jsx("li",{children:t("studioUpdate.authorizationSteps.open")}),a.jsx("li",{children:t("studioUpdate.authorizationSteps.debug")}),a.jsx("li",{children:t("studioUpdate.authorizationSteps.return")})]}),a.jsxs("div",{className:"studio-update-missing-actions",children:[a.jsx("span",{children:t("studioUpdate.missingPermissions")}),a.jsx("ul",{children:f.missingActions.map(V=>a.jsx("li",{children:a.jsx("code",{children:V})},V))})]}),a.jsxs("a",{className:"studio-update-authorization-link",href:f.authorizationUrl||f.iamConsoleUrl,target:"_blank",rel:"noreferrer",children:[f.authorizationUrl?t("studioUpdate.openPrefilledAuthorization"):t("studioUpdate.openIamManually"),a.jsx(kU,{})]}),!f.authorizationUrl&&a.jsx("p",{className:"studio-update-authorization-note",children:t("studioUpdate.noSafePolicy")})]}):s==="error"?a.jsxs("div",{className:"studio-update-error-panel",children:[a.jsx("p",{className:"confirm-text studio-update-error",children:u}),a.jsxs("dl",{className:"studio-update-error-meta",children:[a.jsxs("div",{children:[a.jsx("dt",{children:t("studioUpdate.failedStage")}),a.jsx("dd",{children:Y6(i.errorStage,t)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:t("studioUpdate.errorId")}),a.jsx("dd",{children:i.errorId||t("studioUpdate.notGenerated")})]})]}),i.updateLogsVisible!==!1&&a.jsx(Hce,{lines:_,phase:"error",copyState:y,onCopy:V=>void z(V)}),i.updateLogsVisible===!1&&a.jsx(Vce,{href:i.permissionConsoleUrl}),i.consoleUrl&&a.jsxs("a",{className:"studio-update-console-link",href:i.consoleUrl,target:"_blank",rel:"noreferrer",children:[t("studioUpdate.openFunctionLogs"),a.jsx(kU,{})]})]}):s==="submitting"||s==="published"?a.jsxs("div",{className:"studio-update-progress-body",children:[a.jsxs("div",{className:"studio-update-progress-summary",children:[a.jsxs("div",{children:[a.jsx("span",{children:t("studioUpdate.targetVersion")}),a.jsx("strong",{children:S.current||N})]}),a.jsxs("div",{children:[a.jsx("span",{children:t(s==="published"?"studioUpdate.updateStatus":"studioUpdate.elapsed")}),a.jsx("strong",{children:s==="published"?t("studioUpdate.completed"):Xcn(x,t)})]})]}),a.jsxs("ol",{className:"studio-update-progress","aria-label":t("studioUpdate.progressAriaLabel"),children:[M&&a.jsxs("li",{className:"is-active","aria-current":"step",children:[a.jsx("span",{className:"studio-update-progress-dot","aria-hidden":!0}),a.jsxs("div",{children:[a.jsx("span",{children:Y6(i.progressStage,t)||t("studioUpdate.processingUpdate")}),a.jsx(hn,{as:"small",children:i.progressMessage||u||t("studioUpdate.processing")})]})]}),L.map((V,Z)=>{const ne=s==="published"||Zvoid z(V)}),i.updateLogsVisible===!1&&a.jsx(Vce,{href:i.permissionConsoleUrl}),a.jsx("p",{className:"studio-update-progress-note",children:t("studioUpdate.backgroundHint")})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"confirm-text",children:t("studioUpdate.confirmDescription")}),a.jsxs("div",{className:"studio-update-field",ref:k,children:[a.jsx("span",{children:t("studioUpdate.selectVersion")}),a.jsxs("button",{type:"button",className:"studio-update-version-trigger","aria-label":t("studioUpdate.selectVersion"),"aria-haspopup":"listbox","aria-expanded":b,onClick:()=>v(V=>!V),onKeyDown:V=>{(V.key==="ArrowDown"||V.key==="ArrowUp")&&(V.preventDefault(),v(!0))},children:[a.jsx("span",{children:N}),a.jsx(nun,{})]}),b&&a.jsx("div",{className:"studio-update-version-menu",role:"listbox","aria-label":t("studioUpdate.selectVersion"),children:A.map(V=>{const Z=V.version===N;return a.jsxs("button",{type:"button",role:"option","aria-selected":Z,className:`studio-update-version-option${Z?" is-selected":""}`,onClick:()=>{g(V.version),v(!1)},children:[a.jsx("span",{children:V.version}),Z&&a.jsx(iun,{})]},V.version)})})]}),a.jsxs("dl",{className:"studio-update-versions",children:[a.jsxs("div",{children:[a.jsx("dt",{children:t("studioUpdate.currentVersion")}),a.jsx("dd",{children:i.currentVersion})]}),a.jsxs("div",{children:[a.jsx("dt",{children:t("studioUpdate.targetVersion")}),a.jsx("dd",{children:N})]}),a.jsxs("div",{children:[a.jsx("dt",{children:t("studioUpdate.commit")}),a.jsx("dd",{children:((P==null?void 0:P.gitSha)||i.latestGitSha).slice(0,8)})]})]}),a.jsxs("section",{className:"studio-update-changelog","aria-labelledby":"studio-update-changelog-title",children:[a.jsx("div",{id:"studio-update-changelog-title",children:t("studioUpdate.changelog")}),I.length?a.jsx("ul",{children:I.map(V=>a.jsx("li",{children:V},V))}):a.jsx("p",{children:t("studioUpdate.noChangelog")})]})]}),a.jsxs("div",{className:"confirm-actions",children:[a.jsx("button",{type:"button",className:"confirm-btn",onClick:()=>{c(!1),v(!1),s==="confirm"&&(o("idle"),d(""))},children:t(s==="submitting"?"studioUpdate.runInBackground":s==="confirm"?"common.cancel":"common.close")}),s==="confirm"&&a.jsx("button",{type:"button",className:"confirm-btn studio-update-confirm",onClick:()=>void D(),children:t("studioUpdate.updateNow")}),s==="permission"&&a.jsx("button",{type:"button",className:"confirm-btn studio-update-confirm",onClick:()=>void D(),children:t("studioUpdate.authorizedRecheck")}),s==="error"&&a.jsx("button",{type:"button",className:"confirm-btn studio-update-confirm",onClick:q,children:t("studioUpdate.tryAgain")})]})]})}),document.body)]})}const qce=Hcn();function sun({canUpdate:e=!1}){const{t}=Te("newChat"),n=qce.length?qce:[t("featureNotice.defaultNotes.multiRegion"),t("featureNotice.defaultNotes.switchAgent"),t("featureNotice.defaultNotes.visualCanvas")];return a.jsxs("div",{className:"welcome-feature-pill",children:[a.jsx("span",{children:t("featureNotice.badge")}),a.jsx("span",{className:"welcome-feature-divider","aria-hidden":"true"}),a.jsx("button",{type:"button",className:"welcome-feature-link","aria-describedby":"welcome-feature-popover",children:t("featureNotice.view")}),a.jsxs("section",{id:"welcome-feature-popover",className:"welcome-feature-popover",role:"tooltip",children:[a.jsx("strong",{children:t("featureNotice.title")}),a.jsx("ul",{children:n.map(i=>a.jsx("li",{children:i},i))})]}),e&&a.jsx(run,{variant:"feature-link"})]})}const aun=1e4;async function IUe(e,t){const n=await fetch(ja(e),{headers:ul(fc({Accept:"application/json"})),signal:po(t,aun)});if(!n.ok)throw new Error(Q("newChatCapabilities.loadFailed",{status:n.status}));const i=await n.json();if(typeof i.enabled!="boolean")throw new Error(Q("newChatCapabilities.invalidResponse"));return{enabled:i.enabled,reason:typeof i.reason=="string"?i.reason:void 0,endpointExportEnabled:i.endpointExportEnabled===!0,persistentEnabled:i.persistentEnabled===!0,persistentReason:typeof i.persistentReason=="string"?i.persistentReason:void 0,persistentRequired:i.persistentRequired===!0,storageMode:i.storageMode==="disk"?"disk":"snapshot",diskGbDefault:typeof i.diskGbDefault=="number"?i.diskGbDefault:void 0,diskGbMin:typeof i.diskGbMin=="number"?i.diskGbMin:void 0,diskGbMax:typeof i.diskGbMax=="number"?i.diskGbMax:void 0}}async function PUe(e){return IUe("/web/sandbox/capabilities",e)}async function DUe(e,t){return IUe(`/web/${e}/capabilities`,t)}function oun(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m7 7 10 10M17 7 7 17"})})}function lun(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M12 3.5v11m-4-4 4 4 4-4"}),a.jsx("path",{d:"M5 19.5h14"})]})}function Wce(e){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"8",cy:"8",r:"5.5",stroke:"currentColor",strokeWidth:"1.5",opacity:"0.22"}),a.jsx("path",{d:"M8 2.5A5.5 5.5 0 0 1 13.5 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function cun({open:e,task:t,onClose:n,onRetry:i,onDownload:r}){const{t:s,i18n:o}=Te("newChat"),l=p.useId(),c=p.useRef(null),u=p.useRef(null),d=p.useRef(null),[f,h]=p.useState(()=>Date.now()),m=p.useRef(n);if(m.current=n,p.useEffect(()=>{if(!e||!t)return;d.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const E=document.body.style.overflow;document.body.style.overflow="hidden";const j=window.requestAnimationFrame(()=>{var R;return(R=u.current)==null?void 0:R.focus()}),T=R=>{var I;if(R.key==="Escape"){R.preventDefault(),m.current();return}if(R.key!=="Tab")return;const A=Array.from(((I=c.current)==null?void 0:I.querySelectorAll('button:not(:disabled), a[href], video[controls], [tabindex]:not([tabindex="-1"])'))??[]);if(A.length===0)return;const N=A[0],P=A[A.length-1];if(document.activeElement===u.current){R.preventDefault(),(R.shiftKey?P:N).focus();return}R.shiftKey&&document.activeElement===N?(R.preventDefault(),P.focus()):!R.shiftKey&&document.activeElement===P&&(R.preventDefault(),N.focus())};return window.addEventListener("keydown",T),()=>{var R;window.cancelAnimationFrame(j),document.body.style.overflow=E,window.removeEventListener("keydown",T),(R=d.current)!=null&&R.isConnected&&d.current.focus()}},[e,t==null?void 0:t.localId]),p.useEffect(()=>{if(!e||(t==null?void 0:t.status)!=="generating"||t.generationStartedAt===null)return;const E=()=>h(Date.now());E();const j=window.setInterval(E,1e3);return()=>window.clearInterval(j)},[e,t==null?void 0:t.localId,t==null?void 0:t.runId,t==null?void 0:t.status,t==null?void 0:t.generationStartedAt]),!e||!t)return null;const g=o.resolvedLanguage??o.language,b=d7e(t,g),v=t.status==="optimizing"||t.status==="generating",y=t.errorStage==="optimization"?s("video.task.retryOptimization"):s("video.task.retryGeneration"),w=u7e(t.resolvedMode??t.requestedMode,g),x=t.error.includes("尚未开通"),O=vrn(t,g),k=t.generationStartedAt===null?"":yrn(f-t.generationStartedAt,g),S=t.providerStatus==="queued"?s("video.task.providerQueued"):t.providerStatus==="running"?s("video.task.providerRunning"):s("video.task.providerSubmitting"),C=t.providerStatus==="queued"?s("video.task.queuedHint"):s("video.task.runningHint");return vi.createPortal(a.jsx("div",{className:"new-chat-video-task-backdrop",onMouseDown:E=>{E.target===E.currentTarget&&n()},children:a.jsxs("section",{ref:c,className:`new-chat-video-task-dialog is-${t.status}`,role:"dialog","aria-modal":"true","aria-labelledby":l,"aria-busy":v||void 0,children:[a.jsxs("header",{className:"new-chat-video-task-dialog__head",children:[a.jsxs("div",{children:[a.jsx("h2",{ref:u,id:l,tabIndex:-1,children:s("video.task.title")}),a.jsxs("p",{children:[w," · ",t.generationModel]})]}),a.jsx("button",{type:"button",className:"new-chat-video-task-dialog__close",onClick:n,"aria-label":s("video.task.closeAria"),children:a.jsx(oun,{})})]}),a.jsxs("div",{className:"new-chat-video-task-dialog__body",children:[a.jsx("ol",{className:"new-chat-video-task-steps","aria-label":s("video.task.progressAria"),"aria-live":"polite","aria-atomic":"true",children:b.map(E=>a.jsx("li",{className:`is-${E.status}`,children:a.jsxs("span",{className:"new-chat-video-task-step__label",children:[E.status==="active"?a.jsx(Wce,{className:"new-chat-video-task-step__loading"}):null,a.jsx("span",{children:E.label})]})},E.id))}),t.error?a.jsx("div",{className:"new-chat-video-task-error",role:"alert",children:a.jsx("p",{children:t.error})}):null,t.optimizedPrompt?a.jsxs("section",{className:"new-chat-video-task-prompt","aria-labelledby":`${l}-prompt`,children:[a.jsx("h3",{id:`${l}-prompt`,children:s("video.task.optimizedPrompt")}),a.jsx("p",{children:t.optimizedPrompt})]}):null,t.status==="generating"?a.jsxs("div",{className:"new-chat-video-task-preview is-loading",children:[a.jsx(Wce,{className:"new-chat-video-task-preview__loading"}),a.jsx(hn,{as:"strong",duration:2.2,spread:18,"aria-live":"polite",children:O}),a.jsx("div",{className:"new-chat-video-task-progress",role:"progressbar","aria-label":s("video.task.processingAria",{task:w}),"aria-valuetext":k?s("video.task.waitingAria",{status:O,elapsed:k}):O,children:a.jsx("span",{"aria-hidden":"true"})}),a.jsxs("div",{className:"new-chat-video-task-progress__meta",children:[a.jsx("span",{children:S}),k?a.jsx("span",{children:s("video.task.elapsed",{elapsed:k})}):null]}),a.jsx("span",{children:C})]}):t.output?a.jsx("div",{className:"new-chat-video-task-preview",children:a.jsx("video",{src:t.output.previewUrl,controls:!0,playsInline:!0,preload:"metadata","aria-label":s("video.task.previewAria")})}):null]}),a.jsxs("footer",{className:"new-chat-video-task-dialog__actions",children:[a.jsx("p",{children:v?s("video.task.backgroundHint"):t.status==="success"?s("video.task.successHint"):s(x?"video.task.activationHint":"video.task.retryHint")}),a.jsxs("div",{children:[a.jsx("button",{type:"button",className:"new-chat-video-task-button",onClick:n,children:s("video.task.close")}),t.status==="error"?a.jsx("button",{type:"button",className:"new-chat-video-task-button is-primary",onClick:i,children:y}):t.output?a.jsxs("button",{type:"button",className:"new-chat-video-task-button is-primary",onClick:r,children:[a.jsx(lun,{}),s("video.task.download")]}):null]})]})]})}),document.body)}const Uk="/web/agentkit-cli",Mj=6e4,uun=33e4;function qP(){return Q("agentkitCli.unconfigured")}qP();function Qk(e=!1){const t=ul({Accept:"application/json"});return e&&t.set("Content-Type","application/json"),t}async function zk(e,t){return new Error(await Ft(e,t))}function Kce(e){const t=e;if(typeof(t==null?void 0:t.sessionId)!="string"||typeof t.status!="string")throw new Error(Q("agentkitCli.invalidSession"));return{id:t.sessionId,status:t.status,displayName:typeof t.displayName=="string"?t.displayName:"",expireAt:typeof t.expireAt=="string"?t.expireAt:""}}const mx={async capabilities(e={}){const t=await vn(`${Uk}/capabilities`,{headers:Qk(),signal:e.signal},Mj);if(!t.ok)throw await zk(t,Q("agentkitCli.loadCapabilitiesFailed"));const n=await t.json();if(typeof n.enabled!="boolean")throw new Error(Q("agentkitCli.invalidCapabilities"));return{enabled:n.enabled,reason:typeof n.reason=="string"?n.reason:""}},async listSessions(e={}){const t=await vn(`${Uk}/sessions`,{headers:Qk(),signal:e.signal},Mj);if(!t.ok)throw await zk(t,Q("agentkitCli.listSessionsFailed"));const n=await t.json();if(!Array.isArray(n.sessions))throw new Error(Q("agentkitCli.invalidSessionList"));return n.sessions.map(Kce)},async createSession(e={}){const t=await vn(`${Uk}/sessions`,{method:"POST",headers:Qk(!0),body:JSON.stringify({persistent:!1}),signal:e.signal},uun);if(!t.ok)throw await zk(t,Q("agentkitCli.createSessionFailed"));return Kce(await t.json())},async openSession(e,t={}){const n=await vn(`${Uk}/sessions/${encodeURIComponent(e)}/open`,{method:"POST",headers:Qk(),signal:t.signal},Mj);if(!n.ok)throw await zk(n,Q("agentkitCli.openSessionFailed"))},async launchTerminal(e,t={}){const n=await vn(`${Uk}/sessions/${encodeURIComponent(e)}/terminal`,{method:"POST",headers:Qk(),signal:t.signal},Mj);if(!n.ok)throw await zk(n,Q("agentkitCli.openTerminalFailed"));const i=await n.json();if(typeof i.url!="string"||!i.url)throw new Error(Q("agentkitCli.invalidTerminalUrl"));return{url:i.url,...typeof i.shellSessionId=="string"?{shellSessionId:i.shellSessionId}:{}}}},MUe=new Set(["creating","pending","running","starting","initializing"]),LUe="ready",dun=1500,fun=80;function SU(e){return e.status.trim().toLowerCase()}function hun(e){return new Promise((t,n)=>{const i=window.setTimeout(t,dun);e.addEventListener("abort",()=>{window.clearTimeout(i),n(new DOMException("Aborted","AbortError"))},{once:!0})})}async function pun(e,t,n){let i=e;for(let r=0;rc.id===i.id);if(!l)throw new Error(n("agentKitCli.sessionExpired"));i=l}throw new Error(n("agentKitCli.initializationTimeout"))}async function mun(e,t,n){t("searching");const i=await mx.capabilities({signal:e});if(!i.enabled)throw new Error(i.reason||qP());const r=await mx.listSessions({signal:e});let s=r.find(o=>SU(o)===LUe)??r.find(o=>MUe.has(SU(o)));return s?t("connecting"):(t("creating"),s=await mx.createSession({signal:e})),s=await pun(s,e,n),t("connecting"),await mx.openSession(s.id,{signal:e}),{launch:await mx.launchTerminal(s.id,{signal:e}),session:s}}function gun(e){return e==="searching"||e==="creating"||e==="connecting"}function bun(e,t){const n=Date.parse(e);return Number.isFinite(n)&&n>t}function yun(e,t,n){const i=Date.parse(e);if(!Number.isFinite(i))return n("agentKitCli.nonPersistent");const r=Math.max(0,Math.ceil((i-t)/6e4)),s=Math.floor(r/60),o=r%60;return s>0?n("agentKitCli.recyclingHoursMinutes",{hours:s,minutes:o}):n("agentKitCli.recyclingMinutes",{minutes:o})}function vun(e,t){const n=e instanceof Error?e.message:String(e);return e instanceof TypeError?t("agentKitCli.connectionError",{message:n}):n}function xun({open:e,onClose:t}){const{t:n}=Te("workspaceTools"),[i,r]=p.useState("searching"),[s,o]=p.useState(null),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(0),[m,g]=p.useState(()=>Date.now());p.useEffect(()=>{if(!e||!l)return;g(Date.now());const v=window.setInterval(()=>g(Date.now()),6e4);return()=>window.clearInterval(v)},[l,e]),p.useEffect(()=>{if(!e)return;if(s&&bun(l,Date.now())){d(""),r("ready");return}const v=new AbortController;return r("searching"),o(null),c(""),d(""),mun(v.signal,r,n).then(({launch:y,session:w})=>{v.signal.aborted||(o(y),c(w.expireAt),r("ready"))}).catch(y=>{if(v.signal.aborted)return;const w=vun(y,n);d(w),r(w.includes(qP())?"unconfigured":"error")}),()=>v.abort()},[f,l,s,e,n]);const b=gun(i);return a.jsxs(Ph,{open:e,keepMounted:!0,title:"AgentKit CLI",icon:a.jsx(a0,{}),className:"sandbox-tool-dialog sandbox-tool-dialog--terminal agentkit-cli-dialog",onClose:t,children:[a.jsx("div",{className:"sandbox-tool-toolbar",children:a.jsxs("span",{children:[a.jsx("i",{className:b?"is-loading":i==="ready"?"is-ready":""}),b?n(`agentKitCli.loading.${i}`):i==="ready"?yun(l,m,n):n("agentKitCli.unavailable")]})}),a.jsx("div",{className:"sandbox-tool-surface agentkit-cli-surface",children:b?a.jsxs("div",{className:"agentkit-cli-state",role:"status","aria-live":"polite",children:[a.jsx(QA,{size:20}),a.jsx(hn,{as:"strong",children:n(`agentKitCli.loading.${i}`)})]}):i==="unconfigured"?a.jsxs("div",{className:"agentkit-cli-state",role:"status",children:[a.jsx(a0,{}),a.jsx("strong",{children:qP()})]}):i==="error"?a.jsxs("div",{className:"agentkit-cli-state is-error",role:"alert",children:[a.jsx("strong",{children:n("agentKitCli.requestFailed")}),a.jsx("pre",{className:"agentkit-cli-error-detail",children:u}),a.jsx("button",{type:"button",onClick:()=>h(v=>v+1),children:n("agentKitCli.retry")})]}):s?a.jsx("iframe",{src:s.url,title:n("agentKitCli.terminalTitle"),allow:"clipboard-read; clipboard-write",sandbox:"allow-downloads allow-forms allow-modals allow-popups allow-pointer-lock allow-same-origin allow-scripts"}):null})]})}function wun({open:e,state:t,agentKind:n="codex",error:i,persistentEnabled:r=!0,persistentReason:s="",persistentRequired:o=!1,storageMode:l="snapshot",diskGbDefault:c=10,diskGbMin:u=5,diskGbMax:d=100,onCancel:f,onConfirm:h}){const{t:m}=Te("sandbox"),g=n==="codex"?"Codex":n==="deepseek-harness"?"DeepSeek Harness":n==="openclaw"?"OpenClaw":"Hermes",b=n==="codex"?m("launch.defaultName"):m("launch.namedDefault",{agent:g}),v=p.useRef(null),y=p.useRef(null),w=p.useRef(null),x=p.useRef(!1),O=p.useRef(f),[k,S]=p.useState(b),[C,E]=p.useState(!0),[j,T]=p.useState(c);if(O.current=f,p.useEffect(()=>{if(!e)return;S(b),E(o||r),T(c);const I=document.body.style.overflow;document.body.style.overflow="hidden";const D=window.requestAnimationFrame(()=>{var L,F;(L=y.current)==null||L.focus(),(F=y.current)==null||F.select()}),_=L=>{var q;if(L.key==="Escape"){L.preventDefault(),O.current();return}if(L.key!=="Tab")return;const F=(q=v.current)==null?void 0:q.querySelectorAll("input:not(:disabled), button:not(:disabled)");if(!(F!=null&&F.length))return;const M=F[0],z=F[F.length-1];L.shiftKey&&document.activeElement===M?(L.preventDefault(),z.focus()):!L.shiftKey&&document.activeElement===z&&(L.preventDefault(),M.focus())};return window.addEventListener("keydown",_),()=>{window.cancelAnimationFrame(D),document.body.style.overflow=I,window.removeEventListener("keydown",_)}},[b,c,e,r,o]),!e)return null;const R=t==="loading",A=k.trim(),N=Number.isInteger(j)&&j>=u&&j<=d,P=R?m("launch.creatingTitle",{agent:g}):t==="error"?m("launch.failedTitle"):m("launch.createTitle",{agent:g});return vi.createPortal(a.jsx("div",{className:"sandbox-dialog-backdrop",onMouseDown:I=>{I.target===I.currentTarget&&!R&&f()},children:a.jsxs("form",{ref:v,className:"sandbox-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"sandbox-dialog-title","aria-describedby":t==="confirm"?void 0:"sandbox-dialog-description",onSubmit:I=>{I.preventDefault(),!R&&!x.current&&A&&(l!=="disk"||N)&&h(A,l==="disk"?!0:C,l==="disk"?j:void 0)},children:[a.jsxs("div",{className:"sandbox-dialog-visual","aria-hidden":"true",children:[a.jsx("span",{className:"sandbox-dialog-orbit"}),a.jsx("span",{className:"sandbox-dialog-icon",children:R?a.jsx("span",{className:"sandbox-spinner"}):a.jsx(lA,{kind:n})})]}),a.jsxs("div",{className:"sandbox-dialog-copy",children:[a.jsx("h2",{id:"sandbox-dialog-title",children:P}),t==="error"?a.jsx("p",{id:"sandbox-dialog-description",className:"sandbox-dialog-error",role:"alert",children:i||m("launch.fallbackError")}):R?a.jsx("p",{id:"sandbox-dialog-description","aria-live":"polite",children:m("launch.creatingDescription",{agent:g})}):null,a.jsxs("label",{className:"sandbox-dialog-field",children:[a.jsxs("span",{className:"sandbox-dialog-field-label",children:[a.jsx("span",{children:m("launch.name")}),a.jsxs("span",{"aria-hidden":"true",children:[k.length,"/",G8]})]}),a.jsx("input",{ref:y,type:"text",required:!0,value:k,maxLength:G8,disabled:R,placeholder:b,autoComplete:"off",onChange:I=>S(I.target.value),onCompositionStart:()=>{x.current=!0},onCompositionEnd:()=>{x.current=!1},onKeyDown:I=>{const{nativeEvent:D}=I;I.key==="Enter"&&(x.current||D.isComposing||D.keyCode===229)&&I.preventDefault()}})]}),l==="disk"?a.jsxs("label",{className:"sandbox-dialog-field sandbox-dialog-disk-field",children:[a.jsxs("span",{className:"sandbox-dialog-field-label",children:[a.jsx("span",{children:m("launch.storageSize")}),a.jsx("span",{children:"GiB"})]}),a.jsx("input",{type:"number",required:!0,min:u,max:d,step:1,value:j,disabled:R,onChange:I=>T(I.currentTarget.valueAsNumber)}),a.jsx("span",{className:"sandbox-dialog-field-help",children:m("launch.storageHelp",{min:u,max:d})})]}):a.jsxs("div",{className:"sandbox-dialog-persistence",role:"group","aria-describedby":"sandbox-persistence-description",children:[a.jsx(DK,{id:"sandbox-persistence",className:"sandbox-dialog-persistence-control",checked:C,disabled:R||!r||o,onCheckedChange:E,label:m("launch.persistent")}),a.jsx("p",{id:"sandbox-persistence-description",className:`sandbox-dialog-persistence-description${C?"":" is-warning"}`,role:C?void 0:"status",children:r?m(C?"launch.persistentHelp":"launch.temporaryHelp"):s||m("launch.persistenceUnsupported")})]})]}),a.jsxs("footer",{className:"sandbox-dialog-actions",children:[a.jsx("button",{ref:w,type:"button",onClick:f,children:m(R?"launch.cancelCreation":"common.cancel")}),!R&&a.jsx("button",{type:"submit",className:"is-primary",disabled:!A||l==="disk"&&!N,children:m(t==="error"?"launch.retry":"launch.confirm")})]})]})}),document.body)}function Oun({agentName:e,expireAt:t,exitLabel:n,onExit:i}){const{t:r,i18n:s}=Te("sandbox"),[o,l]=p.useState(()=>Date.now());p.useEffect(()=>{if(!t)return;const h=window.setInterval(()=>l(Date.now()),6e4);return()=>window.clearInterval(h)},[t]);const c=t?Date.parse(t):Number.NaN,u=Number.isFinite(c)?Math.max(0,Math.ceil((c-o)/6e4)):null,d=u===null?"":u===0?r("session.expired"):u>=60?r("session.remainingHours",{hours:Math.floor(u/60),minutes:u%60}):r("session.remainingMinutes",{minutes:u}),f=Number.isFinite(c)?new Date(c).toLocaleString(s.resolvedLanguage??s.language,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}):"";return a.jsxs("div",{className:`sandbox-session-warning${t?" is-expiring":""}`,role:"status",children:[a.jsx("span",{className:"sandbox-session-warning-dot","aria-hidden":"true"}),a.jsx("span",{className:"sandbox-session-warning-copy",children:f?r("session.expiryWarning",{expiry:f,remaining:d}):r("session.usingAgent",{agent:e})}),a.jsx("button",{type:"button",onClick:i,children:n??r("session.exit")})]})}function kun({activity:e,time:t}){var i;const{t:n}=Te("sandbox");return a.jsxs("aside",{className:"sandbox-activity-record",role:"status","aria-label":n("session.activityAria"),children:[a.jsxs("div",{className:"sandbox-activity-summary",children:[a.jsx("span",{className:"sandbox-activity-dot","aria-hidden":"true"}),a.jsx("span",{className:"sandbox-activity-label",children:n("session.activity")}),a.jsx("strong",{children:e.title}),t?a.jsx("time",{children:t}):null]}),(i=e.details)!=null&&i.length?a.jsx("dl",{className:"sandbox-activity-details",children:e.details.map(r=>a.jsxs("div",{children:[a.jsx("dt",{children:r.label}),a.jsx("dd",{title:r.value,children:r.code?a.jsx("code",{children:r.value}):r.value})]},`${r.label}:${r.value}`))}):null]})}function Sun(e){return e>=1e6?`${(e/1e6).toFixed(e>=1e7?0:1)}m`:e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}k`:String(e)}function Eun({usage:e}){const{t,i18n:n}=Te("sandbox"),i=[["total",t("session.tokenLabels.total"),e.totalTokens],["input",t("session.tokenLabels.input"),e.inputTokens],...e.cachedInputTokens>0?[["cachedInput",t("session.tokenLabels.cachedInput"),e.cachedInputTokens]]:[],["output",t("session.tokenLabels.output"),e.outputTokens],...e.reasoningOutputTokens>0?[["reasoningOutput",t("session.tokenLabels.reasoningOutput"),e.reasoningOutputTokens]]:[]],r=n.resolvedLanguage??n.language;return a.jsx("div",{className:"sandbox-token-usage","aria-label":t("session.tokenUsageAria"),children:i.map(([s,o,l])=>a.jsxs("span",{title:t("session.tokens",{label:o,value:l.toLocaleString(r)}),children:[a.jsx("small",{children:o}),a.jsx("strong",{children:Sun(l)})]},s))})}const Cun={codex:"Codex","deepseek-harness":"DeepSeek Harness",openclaw:"OpenClaw",hermes:"Hermes"};function Gce(e,t){if(!e)return"—";const n=new Date(e);return Number.isNaN(n.getTime())?e:new Intl.DateTimeFormat(t,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(n)}function Aun({session:e,onBack:t,onOpen:n,onDelete:i}){var k;const{t:r,i18n:s}=Te("sandbox"),[o,l]=p.useState(!1),[c,u]=p.useState(!1),[d,f]=p.useState(!1),[h,m]=p.useState(""),g=Cun[e.toolName],b=e.resourceType==="snapshot",v=b?e.sourceSessionId||e.snapshotId:e.id,y=e.displayName||r("common.agentFallback",{agent:g}),w=s.resolvedLanguage??s.language,x=async()=>{if(!(c||d)){u(!0),m("");try{await n()}catch(S){m(S instanceof Error?S.message:String(S))}finally{u(!1)}}},O=async()=>{if(!(d||c)){f(!0),m("");try{await i()}catch(S){m(S instanceof Error?S.message:String(S)),l(!1)}finally{f(!1)}}};return a.jsxs("section",{className:"sandbox-agent-details",children:[a.jsxs("header",{className:"sandbox-agent-details-header",children:[a.jsx(YD,{label:r("agentDetails.back"),onClick:t}),a.jsxs("div",{children:[a.jsx("h1",{children:y}),a.jsx("p",{children:r("agentDetails.subtitle",{agent:g})})]})]}),h?a.jsx("div",{className:"sandbox-agent-detail-error",role:"alert",children:h}):null,a.jsxs("div",{className:"sandbox-agent-detail-panel",children:[a.jsxs("dl",{children:[a.jsxs("div",{children:[a.jsx("dt",{children:r("agentDetails.type")}),a.jsx("dd",{children:g})]}),a.jsxs("div",{children:[a.jsx("dt",{children:r("agentDetails.status")}),a.jsx("dd",{children:$z(DD(e.status))})]}),a.jsxs("div",{children:[a.jsx("dt",{children:r("agentDetails.createdBy")}),a.jsx("dd",{children:((k=e.createdBy)==null?void 0:k.trim())||r("common.unknownSource")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:r("agentDetails.createdAt")}),a.jsx("dd",{children:Gce(e.createdAt,w)})]}),b?null:a.jsxs("div",{children:[a.jsx("dt",{children:r("agentDetails.expiresAt")}),a.jsx("dd",{children:Gce(e.expireAt,w)})]}),a.jsxs("div",{className:"is-wide",children:[a.jsx("dt",{children:r("agentDetails.agentId")}),a.jsx("dd",{children:v})]})]}),b&&e.status.toLowerCase()==="wakeable"?a.jsx("p",{className:"sandbox-agent-wake-note",role:c?"status":void 0,children:c?a.jsx(hn,{children:r("agentDetails.wakingHint")}):r("agentDetails.sleepingHint")}):null,a.jsxs("footer",{children:[a.jsx("button",{type:"button",className:"sandbox-agent-delete",disabled:c||d,onClick:()=>l(!0),children:r("agentDetails.delete")}),a.jsx("button",{type:"button",className:"sandbox-agent-open",disabled:c||d||!["ready","wakeable"].includes(e.status.toLowerCase()),"aria-busy":c||void 0,onClick:()=>void x(),children:r(c?b?"agentDetails.waking":"agentDetails.opening":b?"agentDetails.wake":"agentDetails.open")})]})]}),o?a.jsx("div",{className:"confirm-scrim",onClick:()=>!d&&l(!1),children:a.jsxs("div",{className:"confirm-box",role:"alertdialog","aria-modal":"true","aria-labelledby":"sandbox-agent-delete-title",onClick:S=>S.stopPropagation(),children:[a.jsx("div",{className:"confirm-title",id:"sandbox-agent-delete-title",children:r("agentDetails.deleteTitle")}),a.jsx("div",{className:"confirm-text",children:r("agentDetails.deleteDescription",{name:y})}),a.jsxs("div",{className:"confirm-actions",children:[a.jsx("button",{type:"button",className:"confirm-btn",disabled:d,onClick:()=>l(!1),children:r("common.cancel")}),a.jsx("button",{type:"button",className:"confirm-btn confirm-btn--danger",disabled:d,onClick:()=>void O(),children:r(d?"agentDetails.deleting":"agentDetails.confirmDelete")})]})]})}):null]})}function Tun({workspace:e,onBack:t}){var g;const{t:n}=Te("sandbox"),[i,r]=p.useState("main"),[s,o]=p.useState(""),[l,c]=p.useState(!1),[u,d]=p.useState(""),f=e.kind==="deepseek-harness"?"DeepSeek Harness":e.kind==="openclaw"?"OpenClaw":"Hermes",h=e.session.displayName||n("common.agentFallback",{agent:f});p.useEffect(()=>{r("main"),o(""),d(""),c(!1)},[e.session.id]);const m=async()=>{if(r("terminal"),!(s||l)){c(!0),d("");try{const b=await Ur.launchAgentTerminal(e.kind,e.session.id);o(b.url)}catch(b){d(b instanceof Error?b.message:String(b))}finally{c(!1)}}};return a.jsxs("section",{className:"sandbox-agent-workspace",children:[a.jsxs("header",{children:[a.jsxs("div",{className:"sandbox-agent-workspace-title",children:[a.jsx("button",{type:"button",onClick:t,"aria-label":n("agentWorkspace.back"),children:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m14.5 6-6 6 6 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}),a.jsxs("div",{children:[a.jsx("h1",{children:h}),a.jsxs("p",{children:[a.jsx("span",{children:n("agentWorkspace.createdBy",{creator:((g=e.session.createdBy)==null?void 0:g.trim())||n("common.unknownSource")})}),a.jsx("span",{className:"sandbox-agent-workspace-status","data-ready":e.session.status.toLowerCase()==="ready"||void 0,children:$z(e.session.status)})]})]})]}),a.jsxs(cd,{className:"sandbox-agent-workspace-tabs",value:i,size:"lg",gutterSize:"lg",block:!0,pill:!1,"aria-label":n("agentWorkspace.ariaLabel"),onChange:b=>{b==="terminal"?m():r("main")},children:[a.jsx(cd.Option,{value:"main",children:n("agentWorkspace.main")}),a.jsx(cd.Option,{value:"terminal",children:n("agentWorkspace.terminal")})]})]}),a.jsxs("div",{className:"sandbox-agent-workspace-surface",children:[a.jsx("iframe",{src:e.webuiUrl,title:n("agentWorkspace.mainTitle",{agent:f}),allow:"clipboard-read; clipboard-write",hidden:i!=="main"}),s?a.jsx("iframe",{src:s,title:n("agentWorkspace.terminalTitle",{agent:f}),hidden:i!=="terminal"}):i==="terminal"&&l?a.jsx("div",{className:"sandbox-agent-workspace-state",role:"status",children:n("agentWorkspace.openingTerminal")}):i==="terminal"&&u?a.jsxs("div",{className:"sandbox-agent-workspace-state is-error",role:"alert",children:[a.jsx("p",{children:u}),a.jsx("button",{type:"button",onClick:()=>void m(),children:n("common.tryAgain")})]}):null]})]})}yn.hasResourceBundle("en-US","sandbox")||yn.addResourceBundle("en-US","sandbox",Tme,!0,!0);yn.hasResourceBundle("zh-CN","sandbox")||yn.addResourceBundle("zh-CN","sandbox",Pwe,!0,!0);function da(e,t={}){return yn.t(e,{...t,ns:"sandbox"})}const zL=[{name:"model",usage:"/model [model]"},{name:"models",usage:"/models"},{name:"skill",usage:"/skill"},{name:"skills",usage:"/skills"},{name:"new",usage:"/new"},{name:"resume",usage:"/resume [thread]"},{name:"fork",usage:"/fork"},{name:"compact",usage:"/compact"},{name:"archive",usage:"/archive"},{name:"status",usage:"/status"},{name:"clear",usage:"/clear"},{name:"help",usage:"/help"}];function $Ue(e){return{...e,description:da(`commands.${e.name}.description`),keywords:da(`commands.${e.name}.keywords`).split(/\s+/)}}function _un(e){var n;const t=e.trim().match(/^\/([^\s]+)(?:\s+([\s\S]*))?$/);if(t)return{name:t[1].toLocaleLowerCase(),argument:((n=t[2])==null?void 0:n.trim())??""}}function jun(e){const t=e.toLocaleLowerCase();return zL.map($Ue).filter(n=>!t||[n.name,n.description,...n.keywords].some(i=>i.toLocaleLowerCase().includes(t))).sort((n,i)=>Xce(n,t)-Xce(i,t)).slice(0,12)}function Xce(e,t){return t?e.name===t?0:e.name.startsWith(t)?1:e.name.includes(t)?2:3:zL.findIndex(n=>n.name===e.name)}function Nun(e,t){const n=t.toLocaleLowerCase();return e.filter(i=>!n||`${i.id} ${i.displayName} ${i.description}`.toLocaleLowerCase().includes(n)).sort((i,r)=>{if(!n)return Number(r.isDefault)-Number(i.isDefault);const s=i.id.toLocaleLowerCase(),o=r.id.toLocaleLowerCase(),l=(c,u)=>c===n?0:c.startsWith(n)?1:u.toLocaleLowerCase().startsWith(n)?2:3;return l(s,i.displayName)-l(o,r.displayName)}).slice(0,12)}function Run(){return zL.map($Ue).map(e=>({label:e.usage,value:e.description}))}function Iun(e,t){return e.map(n=>{const i=n.displayName.trim(),r=i&&i!==n.id?`${i} · ${n.id}`:n.id;return{label:n.id===t?da("commands.currentModel"):da("commands.availableModel"),value:n.description?`${r} — ${n.description}`:r,code:!1}})}function Pun(e){const t=[{label:"Thread",value:e.threadId,code:!0},{label:da("commands.workspace"),value:e.cwd||da("commands.notSet"),code:!!e.cwd}];return e.model&&t.push({label:da("commands.modelLabel"),value:e.model,code:!0}),t.push({label:da("commands.statusLabel"),value:e.busy?da("commands.running"):da("commands.idle")}),e.threadTotal&&t.push({label:da("commands.totalTokens"),value:e.threadTotal.totalTokens.toLocaleString(yn.resolvedLanguage??yn.language)}),e.modelContextWindow!==void 0&&t.push({label:da("commands.contextWindow"),value:e.modelContextWindow.toLocaleString(yn.resolvedLanguage??yn.language)}),t}function FUe(e){return e.messages.map(t=>{var i,r;const n=[];return t.role==="user"&&((i=t.skillNames)!=null&&i.length)&&n.push({kind:"invocation",value:{skills:t.skillNames.map(s=>({name:s,description:""}))}}),t.role==="user"&&((r=t.images)!=null&&r.length)&&n.push({kind:"attachment",files:t.images.map((s,o)=>({id:`${t.id}-image-${o}`,mimeType:s.mimeType,data:s.data,name:s.alt||s.name||da("commands.imageFallback")}))}),t.content&&n.push({kind:"text",text:t.content}),{role:t.role,blocks:n,meta:{localId:t.id,ts:t.timestamp/1e3}}})}function Dun({appName:e,value:t,onChange:n,onSubmit:i,onStop:r,disabled:s,busy:o,attachments:l,onAddFiles:c,onRemoveAttachment:u,actions:d,models:f,modelsLoading:h,modelsLoaded:m,currentModel:g,onRequestModels:b,skills:v,skillsLoading:y,skillsLoaded:w,selectedSkills:x,onRequestSkills:O,onSelectedSkillsChange:k,textOnly:S=!1,allowSteer:C=!1,sending:E=!1,stopping:j=!1,statusText:T,errorText:R,onResume:A}){const{t:N,i18n:P}=Te("sandbox"),I=p.useRef(null),D=p.useRef(null),_=p.useRef(null),L=p.useRef(null),[F,M]=p.useState(!1),[z,q]=p.useState(0),[U,J]=p.useState(!1);p.useLayoutEffect(()=>{const ue=I.current;ue&&(ue.style.height="auto",ue.style.height=`${Math.min(ue.scrollHeight,200)}px`)},[t]);const V=p.useMemo(()=>{if(!t.startsWith("/")||t.includes(` `))return;const ue=t.slice(1),pe=ue.search(/\s/),ke=(pe<0?ue:ue.slice(0,pe)).toLocaleLowerCase(),je=pe<0?"":ue.slice(pe).trim();if(!(pe>=0&&ke!=="model"))return{command:ke,argument:je,modelMode:pe>=0}},[t]),Z=p.useMemo(()=>{const ue=/(^|\s)\$([^\s$]*)$/.exec(t);if(ue)return{query:ue[2],start:t.length-ue[2].length-1,end:t.length}},[t]),ne=p.useMemo(()=>{if(Z){const ue=Z.query.toLocaleLowerCase();return v.filter(pe=>!x.some(ke=>ke.id===pe.id||ke.name===pe.name)).filter(pe=>`${pe.name} ${pe.description}`.toLocaleLowerCase().includes(ue)).slice(0,12).map(pe=>({kind:"skill",skill:pe}))}return V!=null&&V.modelMode?Nun(f,V.argument).map(ue=>({kind:"model",model:ue})):V?jun(V.command).map(ue=>({kind:"command",command:ue})):[]},[P.resolvedLanguage,Z,f,x,v,V]),W=!S&&!U&&!!(Z||V);p.useEffect(()=>{q(0)},[t]),p.useEffect(()=>{V!=null&&V.modelMode&&!m&&!h&&b()},[m,h,b,V==null?void 0:V.modelMode]),p.useEffect(()=>{Z&&!w&&!y&&O()},[Z,O,w,y]);const G=l.some(ue=>ue.status!=="ready"),H=(o||E)&&!!r,se=!s&&(!o||C)&&!E&&!j&&!G&&(t.trim().length>0||l.length>0);function Y(ue){J(!1),M(!1),n(ue)}function X(ue){if(ue.kind==="skill"){if(!Z)return;const pe=t.slice(0,Z.start)+t.slice(Z.end);k([...x,ue.skill]),Y(pe),J(!0),requestAnimationFrame(()=>{var ke,je;(ke=I.current)==null||ke.focus(),(je=I.current)==null||je.setSelectionRange(Z.start,Z.start)});return}if(ue.kind==="model"){Y(`/model ${ue.model.id}`),J(!0),requestAnimationFrame(()=>{var pe;return(pe=I.current)==null?void 0:pe.focus()});return}if(ue.command.name==="model"){Y("/model "),b(),requestAnimationFrame(()=>{var pe;return(pe=I.current)==null?void 0:pe.focus()});return}if(ue.command.name==="skill"||ue.command.name==="skills"){Y(`/${ue.command.name}`),J(!0),requestAnimationFrame(()=>{var pe;return(pe=I.current)==null?void 0:pe.focus()});return}Y(`/${ue.command.name}`),J(!0),requestAnimationFrame(()=>{var pe;return(pe=I.current)==null?void 0:pe.focus()})}function ie(ue){var pe;M(!1),(pe=ue.current)==null||pe.click()}function ee(ue){const pe=ue.target.files?Array.from(ue.target.files):[];pe.length&&c(pe),ue.target.value=""}const be=Z?N("composer.availableSkills"):V!=null&&V.modelMode?N("composer.selectModel"):N("composer.commands");return a.jsxs("div",{className:"composer sandbox-codex-composer",children:[T||j||R||A?a.jsxs("div",{className:"sandbox-run-status",children:[a.jsx("span",{role:R?"alert":"status",children:R||(j?N("composer.stopping"):T)}),A?a.jsx("button",{type:"button",className:"cw-btn cw-btn-ghost",onClick:A,disabled:j,children:N("composer.resume")}):null]}):null,l.length>0?a.jsx(PM,{appName:e,compact:!0,items:l,onRemove:u}):null,a.jsxs("div",{className:"composer-box",children:[W?a.jsxs("div",{className:"composer-command-menu",role:"listbox","aria-label":be,children:[a.jsxs("div",{className:"composer-command-head",children:[a.jsx(eet,{}),a.jsx("span",{children:be}),V!=null&&V.modelMode&&g?a.jsx("small",{children:N("composer.currentModel",{model:g})}):null,a.jsx("kbd",{children:Z?"$":"/"})]}),Z&&y?a.jsxs("div",{className:"composer-command-empty",children:[a.jsx(Rc,{className:"spin"})," ",N("composer.loadingSkills")]}):V!=null&&V.modelMode&&h?a.jsxs("div",{className:"composer-command-empty",children:[a.jsx(Rc,{className:"spin"})," ",N("composer.loadingModels")]}):ne.length===0?a.jsx("div",{className:"composer-command-empty",children:Z?N("composer.noSkillMatches"):V!=null&&V.modelMode?N("composer.noModelMatches"):N("composer.noCommandMatches")}):a.jsx("div",{className:"composer-command-list",children:ne.map((ue,pe)=>{const ke=ue.kind==="command"?`command:${ue.command.name}`:ue.kind==="model"?`model:${ue.model.id}`:`skill:${ue.skill.id}`,je=ue.kind==="command"?ue.command.usage:ue.kind==="model"?ue.model.displayName:`$${ue.skill.name}`,Pe=ue.kind==="command"?ue.command.description:ue.kind==="model"?ue.model.description||ue.model.id:ue.skill.description||N("composer.skillFallback");return a.jsxs("button",{type:"button",role:"option","aria-selected":pe===z,className:`composer-command-item${pe===z?" is-active":""}`,onMouseDown:Ee=>{Ee.preventDefault(),X(ue)},onMouseEnter:()=>q(pe),children:[a.jsx("span",{className:`composer-command-icon composer-command-icon--${ue.kind}`,"aria-hidden":"true",children:ue.kind==="command"?"/":ue.kind==="model"?"◇":"$"}),a.jsxs("span",{className:"composer-command-copy",children:[a.jsx("strong",{children:je}),a.jsx("span",{children:Pe})]}),pe===z?a.jsx("kbd",{children:"↵"}):null]},ke)})})]}):null,a.jsx("div",{className:"composer-left-controls",children:!S&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"composer-menu-wrap",children:[a.jsx("button",{type:"button",className:"comp-icon",title:N("composer.add"),"aria-label":N("composer.add"),disabled:s,onClick:()=>M(ue=>!ue),children:a.jsx(XJe,{className:"icon"})}),F?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"menu-scrim",onClick:()=>M(!1)}),a.jsxs("div",{className:"composer-menu",role:"menu",children:[a.jsxs("button",{type:"button",className:"menu-item",disabled:d.uploadBusy,onClick:()=>ie(D),children:[a.jsx(YJe,{className:"icon"}),N("composer.uploadImage")]}),a.jsxs("button",{type:"button",className:"menu-item",disabled:d.uploadBusy,onClick:()=>ie(_),children:[a.jsx(ZJe,{className:"icon"}),N("composer.uploadDocument")]}),a.jsxs("button",{type:"button",className:"menu-item",disabled:d.uploadBusy,onClick:()=>ie(L),children:[a.jsx(JJe,{className:"icon"}),N("composer.uploadVideo")]}),a.jsx("div",{className:"composer-menu-separator",role:"separator"}),a.jsxs("button",{type:"button",className:"menu-item",onClick:()=>{M(!1),d.onOpenTerminal()},children:[a.jsx(a0,{className:"icon"}),N("composer.openTerminal")]}),a.jsxs("button",{type:"button",className:"menu-item",onClick:()=>{M(!1),d.onOpenBrowser()},children:[a.jsx(LAe,{className:"icon"}),N("composer.viewBrowser")]})]})]}):null]}),a.jsx("button",{type:"button",className:"comp-icon sandbox-composer-control",title:N("composer.permissions"),"aria-label":N("composer.permissions"),disabled:d.settingsBusy||o,onClick:d.onOpenPermissions,children:a.jsx(hz,{})}),a.jsx("button",{type:"button",className:`comp-icon sandbox-composer-control${d.workspaceLocked?" is-locked":""}`,title:d.workspaceLocked?N("composer.workspaceLocked"):N("composer.selectWorkspace"),"aria-label":N("composer.workspace"),disabled:d.settingsBusy||o,onClick:d.onOpenWorkspace,children:a.jsx(sN,{})}),d.endpointCopyEnabled&&d.onCopyEndpoint?a.jsx("button",{type:"button",className:"comp-icon sandbox-composer-control",title:d.endpointCopyState==="copied"?N("composer.endpointCopied"):N("composer.copyEndpoint"),"aria-label":d.endpointCopyState==="copied"?N("composer.endpointCopied"):N("composer.copyEndpoint"),disabled:d.endpointCopyState==="copying",onClick:d.onCopyEndpoint,children:d.endpointCopyState==="copying"?a.jsx(Rc,{className:"spin"}):d.endpointCopyState==="copied"?a.jsx(FAe,{}):a.jsx(net,{})}):null]})}),a.jsxs("div",{className:"composer-input-stack sandbox-composer-input",children:[!S&&x.length>0?a.jsx(IM,{skillPrefix:"$",value:{skills:x.map(({name:ue,description:pe})=>({name:ue,description:pe}))},onRemoveSkill:ue=>k(x.filter(pe=>pe.name!==ue))}):null,a.jsx("textarea",{ref:I,className:"comp-input scroll",rows:1,value:t,disabled:s,placeholder:N(S?o&&C?"composer.steerPlaceholder":"composer.continuePlaceholder":"composer.messagePlaceholder"),"aria-expanded":W,onChange:ue=>Y(ue.target.value),onBlur:()=>window.setTimeout(()=>J(!0),0),onKeyDown:ue=>{if(!HT(ue.nativeEvent)){if(W){if((ue.key==="ArrowDown"||ue.key==="Tab"&&!ue.shiftKey)&&ne.length>0){ue.preventDefault(),q(pe=>(pe+1)%ne.length);return}if((ue.key==="ArrowUp"||ue.key==="Tab"&&ue.shiftKey)&&ne.length>0){ue.preventDefault(),q(pe=>(pe-1+ne.length)%ne.length);return}if(ue.key==="Enter"&&!ue.shiftKey&&ne[z]){ue.preventDefault(),X(ne[z]);return}if(ue.key==="Escape"){ue.preventDefault(),J(!0);return}}if(ue.key==="Backspace"&&!t&&ue.currentTarget.selectionStart===0&&x.length>0){ue.preventDefault(),k(x.slice(0,-1));return}ue.key==="Enter"&&!ue.shiftKey&&(ue.preventDefault(),se&&i(t))}}})]}),C?a.jsxs("div",{className:"sandbox-run-actions",children:[H?a.jsx("button",{type:"button",className:"comp-send",disabled:j,onClick:r,"aria-label":N(j?"composer.stopping":"composer.stop"),title:N("composer.stop"),children:a.jsx(VZ,{className:"icon"})}):null,a.jsx("button",{type:"button",className:"comp-send",disabled:!se,onClick:()=>i(t),"aria-label":N(o?"composer.steer":"composer.send"),title:N(o?"composer.steer":"composer.send"),children:E?a.jsx(Rc,{className:"icon spin"}):a.jsx(zZ,{className:"icon"})})]}):a.jsx("button",{type:"button",className:"comp-send",disabled:H?!1:!se,onClick:H?r:()=>i(t),"aria-label":N(H?"composer.stop":"composer.send"),title:H?N("composer.stop"):void 0,children:H?a.jsx(VZ,{className:"icon"}):o?a.jsx(Rc,{className:"icon spin"}):a.jsx(zZ,{className:"icon"})})]}),a.jsx("input",{ref:D,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:ee}),a.jsx("input",{ref:_,type:"file",accept:".txt,.md,.markdown,.pdf,text/plain,text/markdown,application/pdf",multiple:!0,hidden:!0,onChange:ee}),a.jsx("input",{ref:L,type:"file",accept:"video/mp4,video/webm,video/quicktime",multiple:!0,hidden:!0,onChange:ee})]})}function Mun(e){return e.trim().replace(/\/+$/,"")||window.location.origin}function Lun(e){const t=Mun(e.studioUrl);return da("handoff.prompt",{studioUrl:t,pairingCode:e.pairingCode})}function BUe(){return["codex plugin marketplace add volcengine/veadk-python","--sparse .agents/plugins","--sparse plugins/agentkit-studio","&& codex plugin add agentkit-studio@veadk-python"].join(" ")}function $un(){return da("handoff.installPrompt",{command:BUe()})}function Yce(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function Zce(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"8",y:"8",width:"11",height:"11",rx:"2"}),a.jsx("path",{d:"M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2"})]})}function J6(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m5 12.5 4.25 4.25L19 7"})})}function Jce(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M19 8a8 8 0 1 0 .35 7"}),a.jsx("path",{d:"M19 4v4h-4"})]})}function Fun(e,t){const n=Math.max(0,Math.ceil((Date.parse(e)-t)/1e3)),i=Math.floor(n/3600),r=Math.floor(n%3600/60),s=n%60;return[i,r,s].map(o=>String(o).padStart(2,"0")).join(":")}const Bun=[{id:"request"},{id:"session"},{id:"restore"},{id:"continue"}];function Uun(e){switch(e.state){case"issued":return 0;case"creating":return 1;case"session-created":return 2;case"continuing":return 3;case"running":return 4;case"completed":return 4;case"failed":return e.failedStage==="creating-session"?1:e.failedStage==="uploading-project"||e.failedStage==="restoring-project"?2:3}}function Qun(e,t){const n=Uun(e);return e.state==="failed"&&t===n?"failed":t$un(),[s.resolvedLanguage]),I=p.useMemo(()=>BUe(),[]),D=p.useMemo(()=>g?Lun(g):"",[s.resolvedLanguage,g]);if(p.useEffect(()=>{if(!e)return;b(null),y(null),m("conversation"),R(null),N(""),j(!1),C(Date.now());const U=new AbortController,J=++u.current;return k(!0),Ur.createCodexProjectHandoffPairing({signal:U.signal}).then(V=>{u.current===J&&(b(V),y({state:"issued",expireAt:V.expireAt}))}).catch(V=>{(V==null?void 0:V.name)!=="AbortError"&&u.current===J&&R({message:V instanceof Error?V.message:String(V),retryPairing:!0})}).finally(()=>{u.current===J&&k(!1)}),()=>{U.abort()}},[w,e]),p.useEffect(()=>{if(!e||!g)return;C(Date.now());const U=window.setInterval(()=>C(Date.now()),1e3);return()=>window.clearInterval(U)},[e,g]),p.useEffect(()=>{if(!e||!g)return;let U=!1,J;const V=new AbortController,Z=async()=>{if(!(U||Date.now()>=Date.parse(g.expireAt))){try{const ne=await Ur.getCodexProjectHandoffStatus(g.pairingCode,{signal:V.signal});if(U||(y(ne),ne.state==="completed"||ne.state==="failed"))return;J=window.setTimeout(()=>void Z(),1500);return}catch(ne){if((ne==null?void 0:ne.name)==="AbortError"||U)return;R({message:ne instanceof Error?ne.message:String(ne),retryPairing:!1})}J=window.setTimeout(()=>void Z(),1500)}};return Z(),()=>{U=!0,V.abort(),J!==void 0&&window.clearTimeout(J)}},[e,g]),p.useEffect(()=>{(v==null?void 0:v.state)!=="running"&&(v==null?void 0:v.state)!=="completed"||!g||f.current===g.pairingCode||(f.current=g.pairingCode,n())},[v==null?void 0:v.state,n,g]),p.useEffect(()=>()=>{d.current!==void 0&&window.clearTimeout(d.current)},[]),p.useEffect(()=>{if(!e)return;const U=document.body.style.overflow;document.body.style.overflow="hidden";const J=window.requestAnimationFrame(()=>{var Z;return(Z=l.current)==null?void 0:Z.focus()}),V=Z=>{var H;if(Z.key==="Escape"){Z.preventDefault(),c.current();return}if(Z.key!=="Tab")return;const ne=(H=o.current)==null?void 0:H.querySelectorAll('button:not(:disabled), input:not(:disabled), [tabindex]:not([tabindex="-1"])');if(!(ne!=null&&ne.length))return;const W=ne[0],G=ne[ne.length-1];Z.shiftKey&&document.activeElement===W?(Z.preventDefault(),G.focus()):!Z.shiftKey&&document.activeElement===G&&(Z.preventDefault(),W.focus())};return window.addEventListener("keydown",V),()=>{window.cancelAnimationFrame(J),document.body.style.overflow=U,window.removeEventListener("keydown",V)}},[e]),!e)return null;async function _(U,J){var V;if(!(!U||A)){R(null),N(J);try{if(!((V=navigator.clipboard)!=null&&V.writeText))throw new Error(r("handoff.clipboardUnsupported"));await navigator.clipboard.writeText(U),d.current!==void 0&&window.clearTimeout(d.current),d.current=window.setTimeout(()=>{N(Z=>Z===J?"":Z),d.current=void 0},1400)}catch(Z){N(""),R({message:Z instanceof Error?Z.message:String(Z),retryPairing:!1})}}}async function L(){const U=v==null?void 0:v.sessionId;if(!(!U||E)){R(null),j(!0);try{await i(U)}catch(J){R({message:J instanceof Error?J.message:String(J),retryPairing:!1}),j(!1)}}}function F(U){var J;m(U),(J=document.getElementById(`sandbox-project-upload-install-${U}-tab`))==null||J.focus()}function M(U){const J=["conversation","terminal"],V=J.indexOf(h);let Z=null;U.key==="ArrowRight"&&(Z=(V+1)%J.length),U.key==="ArrowLeft"&&(Z=(V-1+J.length)%J.length),U.key==="Home"&&(Z=0),U.key==="End"&&(Z=J.length-1),Z!==null&&(U.preventDefault(),F(J[Z]))}const z=g?Fun(g.expireAt,S):"00:00:00",q=g?S>=Date.parse(g.expireAt):!1;return vi.createPortal(a.jsx("div",{className:"sandbox-project-upload-backdrop",onMouseDown:U=>{U.target===U.currentTarget&&t()},children:a.jsxs("section",{ref:o,className:"sandbox-project-upload-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"sandbox-project-upload-title","aria-describedby":"sandbox-project-upload-description",children:[a.jsxs("header",{className:"sandbox-project-upload-head",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"sandbox-project-upload-title-row",children:[a.jsx("h2",{id:"sandbox-project-upload-title",children:r("handoff.title")}),a.jsx(Ya,{className:"sandbox-project-upload-beta",color:"discovery",size:"sm",pill:!0,children:"Beta"})]}),a.jsx("p",{id:"sandbox-project-upload-description",children:r("handoff.description")})]}),a.jsx("button",{ref:l,type:"button",className:"sandbox-project-upload-close",onClick:t,"aria-label":r("handoff.closeAria"),children:a.jsx(Yce,{})})]}),a.jsxs("div",{className:"sandbox-project-upload-body",children:[T?a.jsxs("div",{className:"sandbox-project-upload-error",role:"alert",children:[a.jsx("span",{children:T.message}),T.retryPairing?a.jsxs("button",{type:"button",onClick:()=>x(U=>U+1),children:[a.jsx(Jce,{}),r("common.retry")]}):null]}):null,a.jsxs("section",{className:"sandbox-project-upload-stage",children:[a.jsxs("div",{className:"sandbox-project-upload-stage-head",children:[a.jsx("span",{className:"sandbox-project-upload-stage-number",children:"1"}),a.jsxs("div",{children:[a.jsx("h3",{children:r("handoff.installTitle")}),a.jsx("p",{children:r("handoff.installDescription")})]}),a.jsxs("button",{type:"button",onClick:()=>void _(h==="conversation"?P:I,h==="conversation"?"install-conversation":"install-terminal"),disabled:A!=="",children:[A===`install-${h}`?a.jsx(J6,{}):a.jsx(Zce,{}),A===`install-${h}`?r("handoff.copied"):r(h==="conversation"?"handoff.copyInstallPrompt":"handoff.copyInstallCommand")]})]}),a.jsxs("div",{className:`sandbox-project-upload-install-tabs is-${h}`,role:"tablist","aria-label":r("handoff.installMethodAria"),children:[a.jsx("span",{"aria-hidden":"true"}),a.jsx("button",{id:"sandbox-project-upload-install-conversation-tab",type:"button",role:"tab","aria-controls":"sandbox-project-upload-install-panel","aria-selected":h==="conversation",tabIndex:h==="conversation"?0:-1,onClick:()=>m("conversation"),onKeyDown:M,children:r("handoff.conversationInstall")}),a.jsx("button",{id:"sandbox-project-upload-install-terminal-tab",type:"button",role:"tab","aria-controls":"sandbox-project-upload-install-panel","aria-selected":h==="terminal",tabIndex:h==="terminal"?0:-1,onClick:()=>m("terminal"),onKeyDown:M,children:r("handoff.terminalInstall")})]}),a.jsx("div",{id:"sandbox-project-upload-install-panel",className:`sandbox-project-upload-prompt${h==="terminal"?" is-command":""}`,role:"tabpanel","aria-labelledby":`sandbox-project-upload-install-${h}-tab`,children:a.jsx("pre",{tabIndex:0,children:a.jsx("code",{children:h==="conversation"?P:I})})})]}),a.jsxs("section",{className:"sandbox-project-upload-stage",children:[a.jsxs("div",{className:"sandbox-project-upload-stage-head",children:[a.jsx("span",{className:"sandbox-project-upload-stage-number",children:"2"}),a.jsxs("div",{children:[a.jsx("h3",{children:r("handoff.taskTitle")}),a.jsx("p",{children:r("handoff.taskDescription")})]}),a.jsxs("button",{type:"button",onClick:()=>void _(D,"handoff"),disabled:!D||O||A!=="",children:[A==="handoff"?a.jsx(J6,{}):a.jsx(Zce,{}),r(A==="handoff"?"handoff.copied":"handoff.copyHandoffPrompt")]})]}),a.jsxs("div",{className:"sandbox-project-upload-pairing-notice",role:"status",children:[a.jsx("span",{children:O?r("handoff.generatingPairing"):q?r("handoff.pairingExpired"):r("handoff.pairingRemaining",{countdown:z})}),a.jsxs("button",{type:"button",disabled:O,onClick:()=>x(U=>U+1),children:[a.jsx(Jce,{}),r(O?"handoff.refreshing":"handoff.refreshPairing")]})]}),a.jsx("div",{className:"sandbox-project-upload-prompt",children:O?a.jsxs("div",{className:"sandbox-project-upload-loading",role:"status",children:[a.jsx("i",{"aria-hidden":"true"}),r("handoff.pairingLoading")]}):D?a.jsx("pre",{tabIndex:0,children:a.jsx("code",{children:D})}):a.jsx("div",{className:"sandbox-project-upload-loading",children:r("handoff.pairingUnavailable")})}),g&&v?a.jsxs("section",{className:"sandbox-project-upload-progress","aria-live":"polite","aria-label":r("handoff.statusAria"),children:[a.jsxs("header",{children:[a.jsxs("div",{children:[a.jsx("span",{children:r("handoff.statusTitle")}),v.state!=="issued"?a.jsx("p",{children:v.agentName||v.projectName?r("handoff.requestReceivedNamed",{name:v.agentName||v.projectName}):r("handoff.requestReceivedCurrent")}):a.jsx("p",{children:r("handoff.requestHelp")})]}),a.jsx("strong",{"data-state":v.state,children:zun(v)})]}),a.jsx("ol",{children:Bun.map((U,J)=>{const V=Qun(v,J);return a.jsxs("li",{"data-state":V,children:[a.jsxs("span",{className:"sandbox-project-upload-progress-marker",children:[V==="done"?a.jsx(J6,{}):null,V==="failed"?a.jsx(Yce,{}):null]}),a.jsx("span",{children:r(`handoff.steps.${U.id}`)})]},U.id)})}),v.state==="failed"&&v.error?a.jsx("p",{className:"sandbox-project-upload-progress-error",role:"alert",children:v.error}):null]}):null]})]}),a.jsxs("footer",{className:"sandbox-project-upload-actions",children:[a.jsx("button",{type:"button",onClick:t,children:r("common.close")}),((v==null?void 0:v.state)==="running"||(v==null?void 0:v.state)==="completed")&&v.sessionId?a.jsx("button",{type:"button",className:"is-primary",disabled:E,onClick:()=>void L(),children:r(E?"handoff.entering":"handoff.enterCodex")}):null]})]})}),document.body)}function Hun({client:e=Ur,allowSkillSelection:t=!0,allowThreadManagement:n=!0,session:i,conversationBusy:r,onInputChange:s,onSessionPatch:o,onSnapshot:l,onActivity:c,onError:u}){const{t:d}=Te("sandbox"),f=p.useRef((i==null?void 0:i.id)??""),h=p.useRef(0),m=p.useRef(null);f.current=(i==null?void 0:i.id)??"";const[g,b]=p.useState(!1),[v,y]=p.useState([]),[w,x]=p.useState(!1),[O,k]=p.useState(!1),[S,C]=p.useState([]),[E,j]=p.useState(!1),[T,R]=p.useState(!1),[A,N]=p.useState([]),[P,I]=p.useState(!1),[D,_]=p.useState([]),[L,F]=p.useState(!1),[M,z]=p.useState(""),[q,U]=p.useState(""),[J,V]=p.useState("");p.useEffect(()=>{var ke;(ke=m.current)==null||ke.abort(),m.current=null,h.current+=1,b(!1),y([]),x(!1),k(!1),C([]),j(!1),R(!1),N([]),I(!1),_([]),F(!1),z(""),U(""),V("")},[i==null?void 0:i.id]);const Z=p.useCallback(async()=>{const ke=f.current;if(!ke)return[];x(!0);try{const je=await e.listModels(ke);return f.current===ke&&(y(je),k(!0)),je}catch(je){return f.current===ke&&(k(!0),u(je instanceof Error?je.message:String(je))),[]}finally{f.current===ke&&x(!1)}},[e,u]),ne=p.useCallback(async()=>{if(!t)return[];const ke=f.current;if(!ke)return[];j(!0);try{const je=await e.listSkills(ke);return f.current===ke&&(C(je),R(!0)),je}catch(je){return f.current===ke&&(R(!0),u(je instanceof Error?je.message:String(je))),[]}finally{f.current===ke&&j(!1)}},[t,e,u]),W=p.useCallback(async(ke="",je=!1)=>{var _e;const Pe=f.current;if(!Pe)return;(_e=m.current)==null||_e.abort();const Ee=new AbortController;m.current=Ee;const Qe=++h.current;F(!0),z("");try{const ae=await e.listThreads(Pe,ke?{cursor:ke}:{},{signal:Ee.signal});f.current===Pe&&h.current===Qe&&(_(le=>{if(!je)return ae.threads;const ge=new Map(le.map(Oe=>[Oe.id,Oe]));for(const Oe of ae.threads)ge.set(Oe.id,Oe);return[...ge.values()]}),U(ae.nextCursor??""))}catch(ae){if((ae==null?void 0:ae.name)==="AbortError")return;f.current===Pe&&h.current===Qe&&z(ae instanceof Error?ae.message:String(ae))}finally{m.current===Ee&&(m.current=null),f.current===Pe&&h.current===Qe&&F(!1)}},[e]),G=p.useCallback(()=>W("",!1),[W]),H=p.useCallback(async()=>{!q||L||await W(q,!0)},[W,L,q]),se=p.useCallback(async()=>{I(!0),await G()},[G]);p.useEffect(()=>{if(!(!n||!(i!=null&&i.id)))return G(),()=>{var ke;(ke=m.current)==null||ke.abort(),m.current=null,h.current+=1}},[n,G,i==null?void 0:i.id]);function Y(ke){l(ke),_(je=>[ke.thread,...je.filter(Pe=>Pe.id!==ke.thread.id)]),N([]),C([]),R(!1),I(!1)}async function X(ke){const je=await e.newThread(ke);f.current===ke&&(Y(je),c(d("commands.activity.new"),[{label:"Thread",value:je.threadId,code:!0}]))}async function ie(){const ke=f.current;if(!(!ke||g||r)){b(!0),z(""),u("");try{await X(ke)}catch(je){if(f.current===ke){const Pe=je instanceof Error?je.message:String(je);z(Pe),u(Pe)}}finally{f.current===ke&&b(!1)}}}async function ee(ke){const je=f.current;if(!(!je||g||r)){if(ke===(i==null?void 0:i.threadId)){I(!1);return}b(!0),u("");try{const Pe=await e.resumeThread(je,ke);if(f.current!==je)return;Y(Pe),c(d("commands.activity.resumed"),[{label:"Thread",value:Pe.threadId,code:!0}])}catch(Pe){f.current===je&&u(Pe instanceof Error?Pe.message:String(Pe))}finally{f.current===je&&b(!1)}}}async function be(ke){const je=f.current;if(!je||g||r)return!1;h.current+=1,F(!1),b(!0),V(ke),z(""),u("");try{const Pe=await e.deleteThread(je,ke);return f.current!==je?!1:(Pe.snapshot&&Y(Pe.snapshot),_(Ee=>Ee.filter(Qe=>Qe.id!==ke)),c(d("commands.activity.deleted"),[{label:"Thread",value:ke,code:!0}]),!0)}catch(Pe){if(f.current===je){const Ee=Pe instanceof Error?Pe.message:String(Pe);z(Ee),u(Ee)}return!1}finally{f.current===je&&(b(!1),V(""))}}async function ue(ke){const je=i,Pe=ke.trim();if(!Pe.startsWith("/"))return!1;if(!je||r||g)return!0;const Ee=_un(Pe),Qe=Ee&&zL.find(_e=>_e.name===Ee.name);if(!Ee||!Qe)return u(d("commands.unknown",{command:Pe.split(/\s/,1)[0]})),!0;if(u(""),N([]),Qe.name==="model"&&!Ee.argument)return s("/model "),O||await Z(),!0;if(Qe.name==="skill"||Qe.name==="skills")return t?(s("$"),T||(await ne()).length===0&&s(""),!0):(u(d("commands.automaticSkills")),!0);if(Qe.name==="resume"&&!Ee.argument)return s(""),await se(),!0;s(""),b(!0);try{if(Qe.name==="model"){const _e=await e.setModel(je.id,Ee.argument);if(f.current!==je.id)return!0;o({model:_e}),c(d("commands.activity.modelChanged"),[{label:d("commands.modelLabel"),value:_e,code:!0}])}else if(Qe.name==="models"){const _e=O?v:await Z();if(f.current!==je.id)return!0;c(_e.length>0?d("commands.activity.availableModels"):d("commands.activity.noModels"),Iun(_e,je.model))}else if(Qe.name==="new"||Qe.name==="clear")await X(je.id);else if(Qe.name==="resume"){const _e=await e.resumeThread(je.id,Ee.argument);if(f.current!==je.id)return!0;Y(_e),c(d("commands.activity.resumed"),[{label:"Thread",value:_e.threadId,code:!0}])}else if(Qe.name==="fork"){const _e=await e.forkThread(je.id);if(f.current!==je.id)return!0;Y(_e),c(d("commands.activity.forked"),[{label:"Thread",value:_e.threadId,code:!0}])}else if(Qe.name==="compact"){if(await e.compactThread(je.id),f.current!==je.id)return!0;c(d("commands.activity.compacting"),[{label:"Thread",value:je.threadId,code:!0}])}else if(Qe.name==="archive"){const _e=je.threadId,ae=await e.archiveThread(je.id,_e);if(f.current!==je.id)return!0;ae.snapshot&&Y(ae.snapshot),_(le=>le.filter(ge=>ge.id!==_e)),c(d("commands.activity.archived"),[{label:"Thread",value:_e,code:!0}])}else if(Qe.name==="status"){const _e=await e.getStatus(je.id);if(f.current!==je.id)return!0;o(_e),c(d("commands.activity.status"),Pun(_e))}else Qe.name==="help"&&c(d("commands.activity.help"),Run())}catch(_e){f.current===je.id&&(s(Pe),u(_e instanceof Error?_e.message:String(_e)))}finally{f.current===je.id&&b(!1)}return!0}function pe(){C([]),R(!1),N([])}return{commandBusy:g,models:v,modelsLoading:w,modelsLoaded:O,loadModels:Z,skills:S,skillsLoading:E,skillsLoaded:T,loadSkills:ne,selectedSkills:A,setSelectedSkills:N,invalidateSkills:pe,threadsOpen:P,threads:D,threadsLoading:L,threadsError:M,threadsHasMore:!!q,threadActionId:J,openThreads:se,refreshThreads:G,loadMoreThreads:H,closeThreads:()=>{g||(I(!1),z(""))},newThread:ie,resumeThread:ee,deleteThread:be,executeSlash:ue}}const qun={volcengine:"https://docs.volcengine.com/docs/86681/1925174?lang=zh",byteplus:"https://docs.byteplus.com/en/docs/legal"};function Wun(e){return e.toLowerCase()==="github"?a.jsx(Fat,{className:"icon"}):a.jsx(Uat,{className:"icon"})}function Kun({branding:e,cloudProvider:t,onUsername:n}){const{t:i}=Te("shell"),[r,s]=p.useState(null),[o,l]=p.useState(""),[c,u]=p.useState(0),[d,f]=p.useState(""),h=p.useRef(null);p.useEffect(()=>{let y=!0;return s(null),l(""),UAe().then(w=>{y&&s(w)}).catch(w=>{y&&l(w instanceof Error?w.message:String(w))}),()=>{y=!1}},[c]);const m=r!==null&&r.length===0;p.useEffect(()=>{var y;m&&((y=h.current)==null||y.focus())},[m]);const g=fet.test(d),b=t==="byteplus"?aH:hM,v=()=>{g&&n(d)};return a.jsxs("div",{className:"login",children:[a.jsx("header",{className:"login-top",children:a.jsxs("span",{className:"login-brand",children:[a.jsx("img",{className:"login-brand-logo",src:e.logoUrl||b,width:20,height:20,alt:"","aria-hidden":!0}),e.title]})}),a.jsx("main",{className:"login-main",children:a.jsxs("div",{className:"login-card",children:[a.jsx(hn,{as:"h1",className:"login-title",duration:4.8,spread:22,children:e.title}),o?a.jsxs("div",{className:"login-provider-error",role:"alert",children:[a.jsx("p",{children:o}),a.jsx("button",{type:"button",onClick:()=>u(y=>y+1),children:i("login.retry")})]}):r===null?null:r.length>0?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"login-sub",children:i("login.signInToContinue")}),a.jsx("div",{className:"login-providers",children:r.map(y=>a.jsxs("button",{className:"login-btn",onClick:()=>pet(y.loginUrl),children:[Wun(y.id),a.jsx("span",{children:i("login.signInWith",{provider:y.id==="veidentity"?i(`login.identityProvider.${t}`):y.label})})]},y.id))})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"login-sub",children:i("login.enterUsername")}),a.jsxs("form",{className:"login-name",onSubmit:y=>{y.preventDefault(),v()},children:[a.jsx("input",{ref:h,className:"login-name-input",value:d,onChange:y=>f(y.target.value),placeholder:i("login.usernamePlaceholder"),maxLength:16}),a.jsx("button",{type:"submit",className:"login-name-go",disabled:!g,"aria-label":i("login.enter"),children:a.jsx(YS,{className:"icon"})})]}),a.jsx("p",{className:"login-hint","aria-live":"polite",children:d&&!g?i("login.usernameInvalid"):""})]}),a.jsx("p",{className:"login-powered",children:i(`login.powered.${t}`)}),a.jsxs("p",{className:"login-legal",children:[i("login.legalPrefix")," ",a.jsx("a",{href:qun[t],target:"_blank",rel:"noreferrer",children:i("login.terms")})]})]})}),a.jsx("footer",{className:"login-footer",children:i("login.copyright",{year:2026})})]})}function Gun({open:e,checking:t,error:n,onLogin:i}){const{t:r}=Te("shell"),s=p.useRef(null);return p.useEffect(()=>{var l;if(!e)return;const o=document.body.style.overflow;return document.body.style.overflow="hidden",(l=s.current)==null||l.focus(),()=>{document.body.style.overflow=o}},[e]),e?vi.createPortal(a.jsx("div",{className:"auth-expired-backdrop",children:a.jsxs("section",{className:"auth-expired-dialog",role:"alertdialog","aria-modal":"true","aria-labelledby":"auth-expired-title","aria-describedby":"auth-expired-description",children:[a.jsx("div",{className:"auth-expired-mark","aria-hidden":"true",children:a.jsx(mN,{})}),a.jsxs("div",{className:"auth-expired-copy",children:[a.jsx("h2",{id:"auth-expired-title",children:r("authExpired.title")}),a.jsx("p",{id:"auth-expired-description",children:r("authExpired.description")}),n&&a.jsx("p",{className:"auth-expired-error",role:"alert",children:n})]}),a.jsx("footer",{className:"auth-expired-actions",children:a.jsx("button",{ref:s,type:"button",onClick:i,disabled:t,children:r(t?"authExpired.waiting":"authExpired.signInAgain")})})]})}),document.body):null}const Xun=["slow","crash","incorrect","tool_error","other"];function Yun(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"m7 7 10 10"}),a.jsx("path",{d:"m17 7-10 10"})]})}function Zun(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m5 12.5 4.2 4.2L19 7"})})}function Jun({onClose:e,onSubmit:t}){const{t:n}=Te("feedback"),i=p.useId(),r=p.useId(),s=p.useRef(null),o=p.useRef(null),l=p.useRef(!1),c=p.useRef(e),[u,d]=p.useState(()=>new Set),[f,h]=p.useState(""),[m,g]=p.useState(!1),[b,v]=p.useState(""),[y,w]=p.useState(!1);l.current=m,c.current=e,p.useEffect(()=>{var j;const S=document.body.style.overflow,C=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(j=o.current)==null||j.focus();const E=T=>{var P;if(T.key==="Escape"&&!l.current){T.preventDefault(),c.current();return}if(T.key!=="Tab")return;const R=Array.from(((P=s.current)==null?void 0:P.querySelectorAll("button:not(:disabled), textarea:not(:disabled)"))??[]);if(R.length===0)return;const A=R[0],N=R[R.length-1];T.shiftKey&&document.activeElement===A?(T.preventDefault(),N.focus()):!T.shiftKey&&document.activeElement===N&&(T.preventDefault(),A.focus())};return window.addEventListener("keydown",E),()=>{document.body.style.overflow=S,window.removeEventListener("keydown",E),C!=null&&C.isConnected&&C.focus()}},[]);const x=S=>{d(C=>{const E=new Set(C);return E.has(S)?E.delete(S):E.add(S),E})},O=async()=>{if(!(m||y)){g(!0),v("");try{await t({issues:[...u],description:f.trim()}),w(!0)}catch(S){v(S instanceof Error?S.message:String(S))}finally{g(!1)}}},k=u.size>0||f.trim().length>0;return vi.createPortal(a.jsx("div",{className:"issue-feedback-backdrop",onMouseDown:S=>{S.target===S.currentTarget&&!m&&e()},children:a.jsxs("section",{ref:s,className:"issue-feedback-dialog",role:"dialog","aria-modal":"true","aria-labelledby":i,"aria-describedby":y?`${r}-success`:r,"aria-busy":m||void 0,children:[a.jsxs("header",{className:"issue-feedback-head",children:[a.jsx("h2",{id:i,children:n("title")}),a.jsx("button",{type:"button",className:"issue-feedback-close",onClick:e,disabled:m,"aria-label":n("dialog.close"),children:a.jsx(Yun,{})})]}),y?a.jsxs("div",{className:"issue-feedback-success",role:"status","aria-live":"polite",children:[a.jsx("span",{className:"issue-feedback-success-mark","aria-hidden":"true",children:a.jsx(Zun,{})}),a.jsxs("div",{children:[a.jsx("h3",{children:n("success.title")}),a.jsx("p",{id:`${r}-success`,children:n("success.description")})]})]}):a.jsxs("div",{className:"issue-feedback-body",children:[a.jsx("p",{id:r,className:"issue-feedback-intro",children:n("dialog.intro")}),a.jsx("p",{className:"issue-feedback-privacy",role:"alert",children:n("dialog.privacy")}),a.jsx("div",{className:"issue-feedback-chips","aria-label":n("commonIssues"),children:Xun.map(S=>a.jsx("button",{type:"button",className:"issue-feedback-chip","aria-pressed":u.has(S),onClick:()=>x(S),disabled:m,children:n(`dialog.issues.${S}`)},S))}),a.jsxs("label",{className:"issue-feedback-field",children:[a.jsx("span",{children:n("descriptionLabel")}),a.jsx("textarea",{ref:o,value:f,onChange:S=>h(S.target.value),placeholder:n("dialog.descriptionPlaceholder"),maxLength:4e3,rows:5,disabled:m})]}),b&&a.jsx("p",{className:"issue-feedback-error",role:"alert",children:b})]}),a.jsx("footer",{className:"issue-feedback-actions",children:y?a.jsx("button",{type:"button",className:"is-primary",onClick:e,children:n("done")}):a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",onClick:e,disabled:m,children:n("cancel")}),a.jsx("button",{type:"button",className:"is-primary",onClick:()=>void O(),disabled:!k||m,children:n(m?"submitting":"submit")})]})})]})}),document.body)}function edn(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const n=document.implementation.createHTMLDocument(),i=n.createElement("base"),r=n.createElement("a");return n.head.appendChild(i),n.body.appendChild(r),t&&(i.href=t),r.href=e,r.href}const tdn=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function zg(e){const t=[];for(let n=0,i=e.length;nsu||e.height>su)&&(e.width>su&&e.height>su?e.width>e.height?(e.height*=su/e.width,e.width=su):(e.width*=su/e.height,e.height=su):e.width>su?(e.height*=su/e.width,e.width=su):(e.width*=su/e.height,e.height=su))}function adn(e,t={}){return e.toBlob?new Promise(n=>{e.toBlob(n,t.type?t.type:"image/png",t.quality?t.quality:1)}):new Promise(n=>{const i=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),r=i.length,s=new Uint8Array(r);for(let o=0;o{const i=new Image;i.onload=()=>{i.decode().then(()=>{requestAnimationFrame(()=>t(i))})},i.onerror=n,i.crossOrigin="anonymous",i.decoding="async",i.src=e})}async function odn(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function ldn(e,t,n){const i="http://www.w3.org/2000/svg",r=document.createElementNS(i,"svg"),s=document.createElementNS(i,"foreignObject");return r.setAttribute("width",`${t}`),r.setAttribute("height",`${n}`),r.setAttribute("viewBox",`0 0 ${t} ${n}`),s.setAttribute("width","100%"),s.setAttribute("height","100%"),s.setAttribute("x","0"),s.setAttribute("y","0"),s.setAttribute("externalResourcesRequired","true"),r.appendChild(s),s.appendChild(e),odn(r)}const Uc=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||Uc(n,t)};function cdn(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function udn(e,t){return UUe(t).map(n=>{const i=e.getPropertyValue(n),r=e.getPropertyPriority(n);return`${n}: ${i}${r?" !important":""};`}).join(" ")}function ddn(e,t,n,i){const r=`.${e}:${t}`,s=n.cssText?cdn(n):udn(n,i);return document.createTextNode(`${r}{${s}}`)}function eue(e,t,n,i){const r=window.getComputedStyle(e,n),s=r.getPropertyValue("content");if(s===""||s==="none")return;const o=tdn();try{t.className=`${t.className} ${o}`}catch{return}const l=document.createElement("style");l.appendChild(ddn(o,n,r,i)),t.appendChild(l)}function fdn(e,t,n){eue(e,t,":before",n),eue(e,t,":after",n)}const tue="application/font-woff",nue="image/jpeg",hdn={woff:tue,woff2:tue,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:nue,jpeg:nue,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function pdn(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function HK(e){const t=pdn(e).toLowerCase();return hdn[t]||""}function mdn(e){return e.split(/,/)[1]}function EU(e){return e.search(/^(data:)/)!==-1}function gdn(e,t){return`data:${t};base64,${e}`}async function zUe(e,t,n){const i=await fetch(e,t);if(i.status===404)throw new Error(`Resource "${i.url}" not found`);const r=await i.blob();return new Promise((s,o)=>{const l=new FileReader;l.onerror=o,l.onloadend=()=>{try{s(n({res:i,result:l.result}))}catch(c){o(c)}},l.readAsDataURL(r)})}const eF={};function bdn(e,t,n){let i=e.replace(/\?.*/,"");return n&&(i=e),/ttf|otf|eot|woff2?/i.test(i)&&(i=i.replace(/.*\//,"")),t?`[${t}]${i}`:i}async function qK(e,t,n){const i=bdn(e,t,n.includeQueryParams);if(eF[i]!=null)return eF[i];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let r;try{const s=await zUe(e,n.fetchRequestInit,({res:o,result:l})=>(t||(t=o.headers.get("Content-Type")||""),mdn(l)));r=gdn(s,t)}catch(s){r=n.imagePlaceholder||"";let o=`Failed to fetch resource: ${e}`;s&&(o=typeof s=="string"?s:s.message),o&&console.warn(o)}return eF[i]=r,r}async function ydn(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):KP(t)}async function vdn(e,t){if(e.currentSrc){const s=document.createElement("canvas"),o=s.getContext("2d");s.width=e.clientWidth,s.height=e.clientHeight,o==null||o.drawImage(e,0,0,s.width,s.height);const l=s.toDataURL();return KP(l)}const n=e.poster,i=HK(n),r=await qK(n,i,t);return KP(r)}async function xdn(e,t){var n;try{if(!((n=e==null?void 0:e.contentDocument)===null||n===void 0)&&n.body)return await VL(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function wdn(e,t){return Uc(e,HTMLCanvasElement)?ydn(e):Uc(e,HTMLVideoElement)?vdn(e,t):Uc(e,HTMLIFrameElement)?xdn(e,t):e.cloneNode(VUe(e))}const Odn=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",VUe=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function kdn(e,t,n){var i,r;if(VUe(t))return t;let s=[];return Odn(e)&&e.assignedNodes?s=zg(e.assignedNodes()):Uc(e,HTMLIFrameElement)&&(!((i=e.contentDocument)===null||i===void 0)&&i.body)?s=zg(e.contentDocument.body.childNodes):s=zg(((r=e.shadowRoot)!==null&&r!==void 0?r:e).childNodes),s.length===0||Uc(e,HTMLVideoElement)||await s.reduce((o,l)=>o.then(()=>VL(l,n)).then(c=>{c&&t.appendChild(c)}),Promise.resolve()),t}function Sdn(e,t,n){const i=t.style;if(!i)return;const r=window.getComputedStyle(e);r.cssText?(i.cssText=r.cssText,i.transformOrigin=r.transformOrigin):UUe(n).forEach(s=>{let o=r.getPropertyValue(s);s==="font-size"&&o.endsWith("px")&&(o=`${Math.floor(parseFloat(o.substring(0,o.length-2)))-.1}px`),Uc(e,HTMLIFrameElement)&&s==="display"&&o==="inline"&&(o="block"),s==="d"&&t.getAttribute("d")&&(o=`path(${t.getAttribute("d")})`),i.setProperty(s,o,r.getPropertyPriority(s))})}function Edn(e,t){Uc(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),Uc(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function Cdn(e,t){if(Uc(e,HTMLSelectElement)){const n=t,i=Array.from(n.children).find(r=>e.value===r.getAttribute("value"));i&&i.setAttribute("selected","")}}function Adn(e,t,n){return Uc(t,Element)&&(Sdn(e,t,n),fdn(e,t,n),Edn(e,t),Cdn(e,t)),t}async function Tdn(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const i={};for(let s=0;swdn(i,t)).then(i=>kdn(e,i,t)).then(i=>Adn(e,i,t)).then(i=>Tdn(i,t))}const HUe=/url\((['"]?)([^'"]+?)\1\)/g,_dn=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,jdn=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Ndn(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function Rdn(e){const t=[];return e.replace(HUe,(n,i,r)=>(t.push(r),n)),t.filter(n=>!EU(n))}async function Idn(e,t,n,i,r){try{const s=n?edn(t,n):t,o=HK(t);let l;return r||(l=await qK(s,o,i)),e.replace(Ndn(t),`$1${l}$3`)}catch{}return e}function Pdn(e,{preferredFontFormat:t}){return t?e.replace(jdn,n=>{for(;;){const[i,,r]=_dn.exec(n)||[];if(!r)return"";if(r===t)return`src: ${i};`}}):e}function qUe(e){return e.search(HUe)!==-1}async function WUe(e,t,n){if(!qUe(e))return e;const i=Pdn(e,n);return Rdn(i).reduce((s,o)=>s.then(l=>Idn(l,o,t,n)),Promise.resolve(i))}async function Yv(e,t,n){var i;const r=(i=t.style)===null||i===void 0?void 0:i.getPropertyValue(e);if(r){const s=await WUe(r,null,n);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}async function Ddn(e,t){await Yv("background",e,t)||await Yv("background-image",e,t),await Yv("mask",e,t)||await Yv("-webkit-mask",e,t)||await Yv("mask-image",e,t)||await Yv("-webkit-mask-image",e,t)}async function Mdn(e,t){const n=Uc(e,HTMLImageElement);if(!(n&&!EU(e.src))&&!(Uc(e,SVGImageElement)&&!EU(e.href.baseVal)))return;const i=n?e.src:e.href.baseVal,r=await qK(i,HK(i),t);await new Promise((s,o)=>{e.onload=s,e.onerror=t.onImageErrorHandler?(...c)=>{try{s(t.onImageErrorHandler(...c))}catch(u){o(u)}}:o;const l=e;l.decode&&(l.decode=s),l.loading==="lazy"&&(l.loading="eager"),n?(e.srcset="",e.src=r):e.href.baseVal=r})}async function Ldn(e,t){const i=zg(e.childNodes).map(r=>KUe(r,t));await Promise.all(i).then(()=>e)}async function KUe(e,t){Uc(e,Element)&&(await Ddn(e,t),await Mdn(e,t),await Ldn(e,t))}function $dn(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const i=t.style;return i!=null&&Object.keys(i).forEach(r=>{n[r]=i[r]}),e}const iue={};async function rue(e){let t=iue[e];if(t!=null)return t;const i=await(await fetch(e)).text();return t={url:e,cssText:i},iue[e]=t,t}async function sue(e,t){let n=e.cssText;const i=/url\(["']?([^"')]+)["']?\)/g,s=(n.match(/url\([^)]+\)/g)||[]).map(async o=>{let l=o.replace(i,"$1");return l.startsWith("https://")||(l=new URL(l,e.url).href),zUe(l,t.fetchRequestInit,({result:c})=>(n=n.replace(o,`url(${c})`),[o,c]))});return Promise.all(s).then(()=>n)}function aue(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let i=e.replace(n,"");const r=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const c=r.exec(i);if(c===null)break;t.push(c[0])}i=i.replace(r,"");const s=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,o="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",l=new RegExp(o,"gi");for(;;){let c=s.exec(i);if(c===null){if(c=l.exec(i),c===null)break;s.lastIndex=l.lastIndex}else l.lastIndex=s.lastIndex;t.push(c[0])}return t}async function Fdn(e,t){const n=[],i=[];return e.forEach(r=>{if("cssRules"in r)try{zg(r.cssRules||[]).forEach((s,o)=>{if(s.type===CSSRule.IMPORT_RULE){let l=o+1;const c=s.href,u=rue(c).then(d=>sue(d,t)).then(d=>aue(d).forEach(f=>{try{r.insertRule(f,f.startsWith("@import")?l+=1:r.cssRules.length)}catch(h){console.error("Error inserting rule from remote css",{rule:f,error:h})}})).catch(d=>{console.error("Error loading remote css",d.toString())});i.push(u)}})}catch(s){const o=e.find(l=>l.href==null)||document.styleSheets[0];r.href!=null&&i.push(rue(r.href).then(l=>sue(l,t)).then(l=>aue(l).forEach(c=>{o.insertRule(c,o.cssRules.length)})).catch(l=>{console.error("Error loading remote stylesheet",l)})),console.error("Error inlining remote css file",s)}}),Promise.all(i).then(()=>(e.forEach(r=>{if("cssRules"in r)try{zg(r.cssRules||[]).forEach(s=>{n.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${r.href}`,s)}}),n))}function Bdn(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>qUe(t.style.getPropertyValue("src")))}async function Udn(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=zg(e.ownerDocument.styleSheets),i=await Fdn(n,t);return Bdn(i)}function GUe(e){return e.trim().replace(/["']/g,"")}function Qdn(e){const t=new Set;function n(i){(i.style.fontFamily||getComputedStyle(i).fontFamily).split(",").forEach(s=>{t.add(GUe(s))}),Array.from(i.children).forEach(s=>{s instanceof HTMLElement&&n(s)})}return n(e),t}async function XUe(e,t){const n=await Udn(e,t),i=Qdn(e);return(await Promise.all(n.filter(s=>i.has(GUe(s.style.fontFamily))).map(s=>{const o=s.parentStyleSheet?s.parentStyleSheet.href:null;return WUe(s.cssText,o,t)}))).join(` -`)}async function zdn(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await XUe(e,t);if(n){const i=document.createElement("style"),r=document.createTextNode(n);i.appendChild(r),e.firstChild?e.insertBefore(i,e.firstChild):e.appendChild(i)}}async function Vdn(e,t={}){const{width:n,height:i}=QUe(e,t),r=await VL(e,t,!0);return await zdn(r,t),await KUe(r,t),$dn(r,t),await ldn(r,n,i)}async function Hdn(e,t={}){const{width:n,height:i}=QUe(e,t),r=await Vdn(e,t),s=await KP(r),o=document.createElement("canvas"),l=o.getContext("2d"),c=t.pixelRatio||rdn(),u=t.canvasWidth||n,d=t.canvasHeight||i;return o.width=u*c,o.height=d*c,t.skipAutoScale||sdn(o),o.style.width=`${u}`,o.style.height=`${d}`,t.backgroundColor&&(l.fillStyle=t.backgroundColor,l.fillRect(0,0,o.width,o.height)),l.drawImage(s,0,0,o.width,o.height),o}async function qdn(e,t={}){const n=await Hdn(e,t);return await adn(n)}async function Wdn(e,t={}){return XUe(e,t)}const Kdn=816,aR=1154,Gdn=12e3,Xdn=.72,Ydn=aR*1.12,Lj=10,YUe=[".turn--user",".turn--assistant",".codex-sandbox-run__event",".block-tool",".block-thinking",".block-progress",".block-plan",".tool-result",".share-message-export-note","p","pre","li"].join(", ");function Zdn(){return new Promise(e=>{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>e())})})}function Jdn(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"m7 7 10 10"}),a.jsx("path",{d:"m17 7-10 10"})]})}function efn(){const e=getComputedStyle(document.documentElement).getPropertyValue("--background").trim();return e?`hsl(${e})`:"white"}function tfn(e){const t=e.closest(".transcript");if(!t)return[e];const n=Array.from(t.children).filter(r=>r instanceof HTMLElement&&r.matches(".turn--user, .turn--assistant")),i=n.indexOf(e);return i>=0?n.slice(0,i+1):[e]}function nfn(e){e.querySelectorAll(".block-tool, .block-thinking, .block-progress, .block-plan").forEach(t=>{t.style.opacity="1",t.style.transform="none",t.style.animation="none"}),e.querySelectorAll(".think-collapse").forEach(t=>{t.classList.add("open"),t.style.gridTemplateRows="1fr",t.style.transition="none"}),e.querySelectorAll(".codex-sandbox-run__stream, .think-body, .tool-result").forEach(t=>{t.style.height="auto",t.style.maxHeight="none",t.style.overflow="visible",t.scrollTop=0,t.scrollLeft=0}),e.querySelectorAll(".tool-args").forEach(t=>{t.style.maxWidth="100%",t.style.overflowWrap="anywhere",t.style.whiteSpace="pre-wrap"}),e.querySelectorAll(".think-collapse-inner").forEach(t=>{t.style.height="auto",t.style.overflow="visible"})}function ifn(e){e.querySelectorAll(".codex-sandbox-run").forEach(t=>{var n,i;(i=(n=t.parentElement)==null?void 0:n.querySelector(":scope > .tool-detail"))==null||i.remove()})}function rfn(e){const t=document.createElement("section");t.className="share-message-export",t.setAttribute("aria-hidden","true");for(const i of tfn(e)){const r=i.cloneNode(!0);r.removeAttribute("data-share-message-source"),r.classList.remove("is-feedback-target"),r.style.opacity="1",r.style.transform="none",r.style.animation="none",r.querySelectorAll("[data-share-image-exclude]").forEach(s=>s.remove()),nfn(r),ifn(r),t.append(r)}const n=document.createElement("p");return n.className="share-message-export-note",n.textContent=yn.t("share.exportNote",{ns:"conversation"}),t.append(n),document.body.append(t),t}function sfn(e){const t=Math.max(1,Math.ceil(e.scrollHeight)),n=e.getBoundingClientRect().top,i=Array.from(e.querySelectorAll(YUe)).map(o=>{const l=o.getBoundingClientRect();return{top:Math.floor(l.top-n),bottom:Math.ceil(l.bottom-n),height:Math.ceil(l.height)}}).filter(({bottom:o,height:l})=>o>0&&o0).sort((o,l)=>o.bottom-l.bottom),r=[];let s=0;for(;sh.top>=c&&h.top>s&&h.topl&&h.height<=aR?f===void 0?h.top:Math.min(f,h.top):f,void 0)??i.reduce((f,h)=>h.bottom>=c&&h.bottom<=l?h.bottom:f,l);r.push({top:s,height:Math.max(1,d-s)}),s=d}return r}function afn(e){const t=[];for(const n of e){const i=t[t.length-1],r=n.top+n.height;i&&r-i.top<=Gdn?(i.pages.push(n),i.height=r-i.top):t.push({top:n.top,height:n.height,pages:[n]})}return t}function ofn(e){const t=e.getBoundingClientRect().top,n=new WeakMap;return e.querySelectorAll("*").forEach(i=>{const r=i.getBoundingClientRect();n.set(i,{top:r.top-t,bottom:r.bottom-t,height:r.height,position:getComputedStyle(i).position})}),n}function ZUe(e,t,n,i){if(e.matches(YUe))return;const r=Array.from(e.children).filter(l=>l instanceof HTMLElement),s=Array.from(t.children).filter(l=>l instanceof HTMLElement),o=n.top+n.height;for(let l=r.length-1;l>=0;l-=1){const c=r[l],u=s[l],d=i.get(c);if(!u||!d)continue;if(d.bottom>n.top&&d.top{e.toBlob(i=>{i?t(i):n(new Error(yn.t("share.imageFailed",{ns:"conversation"})))},"image/png")})}async function ufn(e,t,n){const i=await createImageBitmap(e),r=i.width/t,s=i.height/n.height,o=[];try{for(const l of n.pages){const c=document.createElement("canvas");c.width=t,c.height=l.height;const u=c.getContext("2d");if(!u)throw new Error(yn.t("share.browserUnsupported",{ns:"conversation"}));u.drawImage(i,0,(l.top-n.top)*s,t*r,l.height*s,0,0,t,l.height),o.push({blob:await cfn(c),width:t,height:l.height}),c.width=0,c.height=0}}finally{i.close()}return o}async function dfn(e){var n;(n=document.fonts)!=null&&n.ready&&await document.fonts.ready;const t=rfn(e);try{const i=Math.max(Kdn,Math.ceil(t.scrollWidth)),r=sfn(t),s=afn(r),o=ofn(t),l=await Wdn(t),c=[];for(const[u,d]of s.entries()){const f=lfn(t,d,u+1,s.length,o);try{const h=await qdn(f,{width:i,height:d.height,pixelRatio:1,backgroundColor:efn(),fontEmbedCSS:l,style:{position:"static",top:"auto",left:"auto",width:`${i}px`,height:`${d.height}px`,margin:"0",overflow:"hidden",animation:"none"}});if(!h)throw new Error(yn.t("share.imageFailed",{ns:"conversation"}));c.push(...await ufn(h,i,d))}finally{f.remove()}}return c}finally{t.remove()}}function ffn(e){return`agentkit-conversation-${e}.pdf`}function JUe(e,t,n){const i=Math.max(2,String(t).length);return`agentkit-conversation-${n}-page-${String(e).padStart(i,"0")}.png`}function hfn(e){return`agentkit-conversation-${e}-png-pages.zip`}const pfn=Array.from({length:256},(e,t)=>{let n=t;for(let i=0;i<8;i+=1)n=n&1?3988292384^n>>>1:n>>>1;return n>>>0});function mfn(e){let t=4294967295;for(const n of e)t=pfn[(t^n)&255]^t>>>8;return(t^4294967295)>>>0}async function gfn(e,t){const n=new TextEncoder,i=[],r=[];let s=0,o=0;for(const[u,d]of e.entries()){const f=JUe(u+1,e.length,t),h=n.encode(f),m=new Uint8Array(await d.blob.arrayBuffer()),g=mfn(m),b=new ArrayBuffer(30),v=new DataView(b);v.setUint32(0,67324752,!0),v.setUint16(4,20,!0),v.setUint16(6,2048,!0),v.setUint16(8,0,!0),v.setUint32(14,g,!0),v.setUint32(18,m.byteLength,!0),v.setUint32(22,m.byteLength,!0),v.setUint16(26,h.byteLength,!0),i.push(b,h,m);const y=new ArrayBuffer(46),w=new DataView(y);w.setUint32(0,33639248,!0),w.setUint16(4,20,!0),w.setUint16(6,20,!0),w.setUint16(8,2048,!0),w.setUint16(10,0,!0),w.setUint32(16,g,!0),w.setUint32(20,m.byteLength,!0),w.setUint32(24,m.byteLength,!0),w.setUint16(28,h.byteLength,!0),w.setUint32(42,s,!0),r.push(y,h),s+=30+h.byteLength+m.byteLength,o+=46+h.byteLength}const l=new ArrayBuffer(22),c=new DataView(l);return c.setUint32(0,101010256,!0),c.setUint16(8,e.length,!0),c.setUint16(10,e.length,!0),c.setUint32(12,o,!0),c.setUint32(16,s,!0),new Blob([...i,...r,l],{type:"application/zip"})}async function bfn(e){const{jsPDF:t}=await Js(async()=>{const{jsPDF:l}=await import("../chunks/jspdf.es.min-aFbI3tiR.js").then(c=>c.j);return{jsPDF:l}},[]),n=new t({orientation:"portrait",unit:"mm",format:"a4",compress:!0}),i=n.internal.pageSize.getWidth(),r=n.internal.pageSize.getHeight(),s=i-Lj*2,o=r-Lj*2;for(const[l,c]of e.entries()){const u=new Uint8Array(await c.blob.arrayBuffer()),d=Math.min(s/c.width,o/c.height),f=c.width*d,h=c.height*d;l>0&&n.addPage(),n.addImage(u,"PNG",Lj+(s-f)/2,Lj,f,h,`conversation-export-${l}`,"FAST")}return new Blob([n.output("arraybuffer")],{type:"application/pdf"})}function tF(e,t){const n=URL.createObjectURL(e),i=document.createElement("a");i.href=n,i.download=t,i.style.display="none",document.body.append(i),i.click(),i.remove(),window.setTimeout(()=>URL.revokeObjectURL(n),1e3)}function yfn({targetTurn:e,onClose:t}){const{t:n}=Te("conversation"),i=p.useId(),r=p.useId(),s=p.useId(),o=p.useRef(null),l=p.useRef(null),c=p.useRef(t),u=p.useRef(void 0),d=p.useRef(!0),[f,h]=p.useState("generating"),[m,g]=p.useState(0),[b,v]=p.useState([]),[y,w]=p.useState(""),[x,O]=p.useState(""),[k,S]=p.useState("idle"),[C,E]=p.useState("idle"),[j,T]=p.useState("png");c.current=t,p.useEffect(()=>{var L;d.current=!0;const I=document.body.style.overflow,D=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(L=l.current)==null||L.focus();const _=F=>{var U;if(F.key==="Escape"){F.preventDefault(),c.current();return}if(F.key!=="Tab")return;const M=Array.from(((U=o.current)==null?void 0:U.querySelectorAll("button:not(:disabled)"))??[]);if(M.length===0)return;const z=M[0],q=M[M.length-1];F.shiftKey&&document.activeElement===z?(F.preventDefault(),q.focus()):!F.shiftKey&&document.activeElement===q&&(F.preventDefault(),z.focus())};return window.addEventListener("keydown",_),()=>{d.current=!1,document.body.style.overflow=I,window.removeEventListener("keydown",_),u.current!==void 0&&window.clearTimeout(u.current),D!=null&&D.isConnected&&D.focus()}},[]),p.useEffect(()=>{let I=!1,D="";return h("generating"),v([]),w(""),O(""),S("idle"),(async()=>{try{if(await Zdn(),I)return;const L=await dfn(e);if(L.length===0)throw new Error(n("share.imageFailed"));if(D=URL.createObjectURL(L[0].blob),I){URL.revokeObjectURL(D);return}v(L),w(D),h("ready")}catch(L){if(I)return;h("error"),O(L instanceof Error?L.message:String(L))}})(),()=>{I=!0,D&&URL.revokeObjectURL(D)}},[m,e]);const R=async()=>{var D;const I=b[0];if(!(!I||k==="copying")){S("copying"),O("");try{if(!((D=navigator.clipboard)!=null&&D.write)||typeof ClipboardItem>"u")throw new Error(n("share.copyUnsupported"));await navigator.clipboard.write([new ClipboardItem({"image/png":I.blob})]),S("copied"),u.current=window.setTimeout(()=>S("idle"),1500)}catch(_){S("idle"),O(_ instanceof Error?_.message:String(_))}}},A=I=>{T(I),S("idle"),O("")},N=(I,D)=>{var z,q;const _=["png","pdf"],L=_.indexOf(D);let F=L;if(I.key==="ArrowRight"||I.key==="ArrowDown")F=(L+1)%_.length;else if(I.key==="ArrowLeft"||I.key==="ArrowUp")F=(L-1+_.length)%_.length;else if(I.key==="Home")F=0;else if(I.key==="End")F=_.length-1;else return;I.preventDefault();const M=_[F];A(M),(q=(z=o.current)==null?void 0:z.querySelector(`[data-export-format="${M}"]`))==null||q.focus()},P=async()=>{if(!(b.length===0||C==="downloading")){E("downloading"),O("");try{const I=new Date().toISOString().replace(/[:.]/g,"-");if(j==="pdf"){const D=await bfn(b);tF(D,ffn(I))}else if(b.length===1)tF(b[0].blob,JUe(1,1,I));else{const D=await gfn(b,I);tF(D,hfn(I))}}catch(I){d.current&&O(I instanceof Error?I.message:n("share.exportFailed"))}finally{d.current&&E("idle")}}};return vi.createPortal(a.jsx("div",{className:"share-message-backdrop",onMouseDown:I=>{I.target===I.currentTarget&&t()},children:a.jsxs("section",{ref:o,className:"share-message-dialog",role:"dialog","aria-modal":"true","aria-labelledby":i,"aria-describedby":r,"aria-busy":f==="generating"||C==="downloading",children:[a.jsxs("header",{className:"share-message-head",children:[a.jsxs("div",{children:[a.jsx("h2",{id:i,children:n("share.title")}),a.jsx("p",{id:r,children:n("share.description")})]}),a.jsx("button",{ref:l,type:"button",className:"share-message-close","aria-label":n("share.close"),title:n("share.close"),onClick:t,children:a.jsx(Jdn,{})})]}),a.jsxs("div",{className:"share-message-body",children:[f==="generating"?a.jsx("div",{className:"share-message-generating",role:"status",children:a.jsx(hn,{children:n("share.generatingContent")})}):f==="error"?a.jsxs("div",{className:"share-message-failure",children:[a.jsx("p",{role:"alert",children:x||n("share.imageFailed")}),a.jsx("button",{type:"button",onClick:()=>g(I=>I+1),children:n("share.retry")})]}):a.jsxs("figure",{className:"share-message-preview",children:[a.jsx("figcaption",{className:"share-message-preview-meta",children:n("share.previewPage",{count:b.length})}),a.jsx("img",{src:y,alt:n("share.previewAlt",{count:b.length})})]}),f!=="error"&&x&&a.jsx("p",{className:"share-message-error",role:"alert",children:x})]}),a.jsxs("div",{className:"share-message-options",children:[a.jsx("span",{id:s,className:"share-message-format-label",children:n("share.format")}),a.jsx("div",{className:"share-message-format",role:"radiogroup","aria-labelledby":s,children:["png","pdf"].map(I=>a.jsx("button",{type:"button",role:"radio","data-export-format":I,className:j===I?"is-active":"","aria-checked":j===I,tabIndex:j===I?0:-1,disabled:C==="downloading",onClick:()=>A(I),onKeyDown:D=>N(D,I),children:I.toUpperCase()},I))})]}),a.jsxs("footer",{className:"share-message-actions",children:[a.jsx("span",{className:"share-message-download-status","aria-live":"polite",children:C==="downloading"?n("share.generatingFormat",{format:j.toUpperCase()}):""}),j==="png"&&a.jsx("button",{type:"button",onClick:()=>void R(),disabled:b.length===0||f!=="ready"||k==="copying",children:k==="copying"?n("share.copying"):k==="copied"?b.length>1?n("share.copiedFirst"):n("share.copied"):b.length>1?n("share.copyFirst"):n("share.copyImage")}),a.jsx("button",{type:"button",className:"is-primary",onClick:()=>void P(),disabled:b.length===0||f!=="ready"||C==="downloading",children:C==="downloading"?n("share.generating"):j==="png"&&b.length>1?n("share.downloadArchive",{count:b.length}):n("share.downloadFormat",{format:j.toUpperCase()})})]})]})}),document.body)}const vfn=2e3,xfn=700,eQe=1200;function WK(e,t){const n=Array.from(e);return n.length<=t?e:`${n.slice(0,t-1).join("").trimEnd()}…`}function tQe(e){return WK(e.trim(),xfn)}function nQe(e){return WK(e,eQe)}function oue(e){return e.trim().length>0}function wfn(e,t,n={selectedExcerpt:"选中片段",annotation:"批注",separator:":"}){const i=tQe(e),r=nQe(t.trim());return WK(`${n.selectedExcerpt}${n.separator}${i} +`)}async function zdn(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await XUe(e,t);if(n){const i=document.createElement("style"),r=document.createTextNode(n);i.appendChild(r),e.firstChild?e.insertBefore(i,e.firstChild):e.appendChild(i)}}async function Vdn(e,t={}){const{width:n,height:i}=QUe(e,t),r=await VL(e,t,!0);return await zdn(r,t),await KUe(r,t),$dn(r,t),await ldn(r,n,i)}async function Hdn(e,t={}){const{width:n,height:i}=QUe(e,t),r=await Vdn(e,t),s=await KP(r),o=document.createElement("canvas"),l=o.getContext("2d"),c=t.pixelRatio||rdn(),u=t.canvasWidth||n,d=t.canvasHeight||i;return o.width=u*c,o.height=d*c,t.skipAutoScale||sdn(o),o.style.width=`${u}`,o.style.height=`${d}`,t.backgroundColor&&(l.fillStyle=t.backgroundColor,l.fillRect(0,0,o.width,o.height)),l.drawImage(s,0,0,o.width,o.height),o}async function qdn(e,t={}){const n=await Hdn(e,t);return await adn(n)}async function Wdn(e,t={}){return XUe(e,t)}const Kdn=816,aR=1154,Gdn=12e3,Xdn=.72,Ydn=aR*1.12,Lj=10,YUe=[".turn--user",".turn--assistant",".codex-sandbox-run__event",".block-tool",".block-thinking",".block-progress",".block-plan",".tool-result",".share-message-export-note","p","pre","li"].join(", ");function Zdn(){return new Promise(e=>{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>e())})})}function Jdn(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"m7 7 10 10"}),a.jsx("path",{d:"m17 7-10 10"})]})}function efn(){const e=getComputedStyle(document.documentElement).getPropertyValue("--background").trim();return e?`hsl(${e})`:"white"}function tfn(e){const t=e.closest(".transcript");if(!t)return[e];const n=Array.from(t.children).filter(r=>r instanceof HTMLElement&&r.matches(".turn--user, .turn--assistant")),i=n.indexOf(e);return i>=0?n.slice(0,i+1):[e]}function nfn(e){e.querySelectorAll(".block-tool, .block-thinking, .block-progress, .block-plan").forEach(t=>{t.style.opacity="1",t.style.transform="none",t.style.animation="none"}),e.querySelectorAll(".think-collapse").forEach(t=>{t.classList.add("open"),t.style.gridTemplateRows="1fr",t.style.transition="none"}),e.querySelectorAll(".codex-sandbox-run__stream, .think-body, .tool-result").forEach(t=>{t.style.height="auto",t.style.maxHeight="none",t.style.overflow="visible",t.scrollTop=0,t.scrollLeft=0}),e.querySelectorAll(".tool-args").forEach(t=>{t.style.maxWidth="100%",t.style.overflowWrap="anywhere",t.style.whiteSpace="pre-wrap"}),e.querySelectorAll(".think-collapse-inner").forEach(t=>{t.style.height="auto",t.style.overflow="visible"})}function ifn(e){e.querySelectorAll(".codex-sandbox-run").forEach(t=>{var n,i;(i=(n=t.parentElement)==null?void 0:n.querySelector(":scope > .tool-detail"))==null||i.remove()})}function rfn(e){const t=document.createElement("section");t.className="share-message-export",t.setAttribute("aria-hidden","true");for(const i of tfn(e)){const r=i.cloneNode(!0);r.removeAttribute("data-share-message-source"),r.classList.remove("is-feedback-target"),r.style.opacity="1",r.style.transform="none",r.style.animation="none",r.querySelectorAll("[data-share-image-exclude]").forEach(s=>s.remove()),nfn(r),ifn(r),t.append(r)}const n=document.createElement("p");return n.className="share-message-export-note",n.textContent=yn.t("share.exportNote",{ns:"conversation"}),t.append(n),document.body.append(t),t}function sfn(e){const t=Math.max(1,Math.ceil(e.scrollHeight)),n=e.getBoundingClientRect().top,i=Array.from(e.querySelectorAll(YUe)).map(o=>{const l=o.getBoundingClientRect();return{top:Math.floor(l.top-n),bottom:Math.ceil(l.bottom-n),height:Math.ceil(l.height)}}).filter(({bottom:o,height:l})=>o>0&&o0).sort((o,l)=>o.bottom-l.bottom),r=[];let s=0;for(;sh.top>=c&&h.top>s&&h.topl&&h.height<=aR?f===void 0?h.top:Math.min(f,h.top):f,void 0)??i.reduce((f,h)=>h.bottom>=c&&h.bottom<=l?h.bottom:f,l);r.push({top:s,height:Math.max(1,d-s)}),s=d}return r}function afn(e){const t=[];for(const n of e){const i=t[t.length-1],r=n.top+n.height;i&&r-i.top<=Gdn?(i.pages.push(n),i.height=r-i.top):t.push({top:n.top,height:n.height,pages:[n]})}return t}function ofn(e){const t=e.getBoundingClientRect().top,n=new WeakMap;return e.querySelectorAll("*").forEach(i=>{const r=i.getBoundingClientRect();n.set(i,{top:r.top-t,bottom:r.bottom-t,height:r.height,position:getComputedStyle(i).position})}),n}function ZUe(e,t,n,i){if(e.matches(YUe))return;const r=Array.from(e.children).filter(l=>l instanceof HTMLElement),s=Array.from(t.children).filter(l=>l instanceof HTMLElement),o=n.top+n.height;for(let l=r.length-1;l>=0;l-=1){const c=r[l],u=s[l],d=i.get(c);if(!u||!d)continue;if(d.bottom>n.top&&d.top{e.toBlob(i=>{i?t(i):n(new Error(yn.t("share.imageFailed",{ns:"conversation"})))},"image/png")})}async function ufn(e,t,n){const i=await createImageBitmap(e),r=i.width/t,s=i.height/n.height,o=[];try{for(const l of n.pages){const c=document.createElement("canvas");c.width=t,c.height=l.height;const u=c.getContext("2d");if(!u)throw new Error(yn.t("share.browserUnsupported",{ns:"conversation"}));u.drawImage(i,0,(l.top-n.top)*s,t*r,l.height*s,0,0,t,l.height),o.push({blob:await cfn(c),width:t,height:l.height}),c.width=0,c.height=0}}finally{i.close()}return o}async function dfn(e){var n;(n=document.fonts)!=null&&n.ready&&await document.fonts.ready;const t=rfn(e);try{const i=Math.max(Kdn,Math.ceil(t.scrollWidth)),r=sfn(t),s=afn(r),o=ofn(t),l=await Wdn(t),c=[];for(const[u,d]of s.entries()){const f=lfn(t,d,u+1,s.length,o);try{const h=await qdn(f,{width:i,height:d.height,pixelRatio:1,backgroundColor:efn(),fontEmbedCSS:l,style:{position:"static",top:"auto",left:"auto",width:`${i}px`,height:`${d.height}px`,margin:"0",overflow:"hidden",animation:"none"}});if(!h)throw new Error(yn.t("share.imageFailed",{ns:"conversation"}));c.push(...await ufn(h,i,d))}finally{f.remove()}}return c}finally{t.remove()}}function ffn(e){return`agentkit-conversation-${e}.pdf`}function JUe(e,t,n){const i=Math.max(2,String(t).length);return`agentkit-conversation-${n}-page-${String(e).padStart(i,"0")}.png`}function hfn(e){return`agentkit-conversation-${e}-png-pages.zip`}const pfn=Array.from({length:256},(e,t)=>{let n=t;for(let i=0;i<8;i+=1)n=n&1?3988292384^n>>>1:n>>>1;return n>>>0});function mfn(e){let t=4294967295;for(const n of e)t=pfn[(t^n)&255]^t>>>8;return(t^4294967295)>>>0}async function gfn(e,t){const n=new TextEncoder,i=[],r=[];let s=0,o=0;for(const[u,d]of e.entries()){const f=JUe(u+1,e.length,t),h=n.encode(f),m=new Uint8Array(await d.blob.arrayBuffer()),g=mfn(m),b=new ArrayBuffer(30),v=new DataView(b);v.setUint32(0,67324752,!0),v.setUint16(4,20,!0),v.setUint16(6,2048,!0),v.setUint16(8,0,!0),v.setUint32(14,g,!0),v.setUint32(18,m.byteLength,!0),v.setUint32(22,m.byteLength,!0),v.setUint16(26,h.byteLength,!0),i.push(b,h,m);const y=new ArrayBuffer(46),w=new DataView(y);w.setUint32(0,33639248,!0),w.setUint16(4,20,!0),w.setUint16(6,20,!0),w.setUint16(8,2048,!0),w.setUint16(10,0,!0),w.setUint32(16,g,!0),w.setUint32(20,m.byteLength,!0),w.setUint32(24,m.byteLength,!0),w.setUint16(28,h.byteLength,!0),w.setUint32(42,s,!0),r.push(y,h),s+=30+h.byteLength+m.byteLength,o+=46+h.byteLength}const l=new ArrayBuffer(22),c=new DataView(l);return c.setUint32(0,101010256,!0),c.setUint16(8,e.length,!0),c.setUint16(10,e.length,!0),c.setUint32(12,o,!0),c.setUint32(16,s,!0),new Blob([...i,...r,l],{type:"application/zip"})}async function bfn(e){const{jsPDF:t}=await Js(async()=>{const{jsPDF:l}=await import("../chunks/jspdf.es.min-DVclzE4e.js").then(c=>c.j);return{jsPDF:l}},[]),n=new t({orientation:"portrait",unit:"mm",format:"a4",compress:!0}),i=n.internal.pageSize.getWidth(),r=n.internal.pageSize.getHeight(),s=i-Lj*2,o=r-Lj*2;for(const[l,c]of e.entries()){const u=new Uint8Array(await c.blob.arrayBuffer()),d=Math.min(s/c.width,o/c.height),f=c.width*d,h=c.height*d;l>0&&n.addPage(),n.addImage(u,"PNG",Lj+(s-f)/2,Lj,f,h,`conversation-export-${l}`,"FAST")}return new Blob([n.output("arraybuffer")],{type:"application/pdf"})}function tF(e,t){const n=URL.createObjectURL(e),i=document.createElement("a");i.href=n,i.download=t,i.style.display="none",document.body.append(i),i.click(),i.remove(),window.setTimeout(()=>URL.revokeObjectURL(n),1e3)}function yfn({targetTurn:e,onClose:t}){const{t:n}=Te("conversation"),i=p.useId(),r=p.useId(),s=p.useId(),o=p.useRef(null),l=p.useRef(null),c=p.useRef(t),u=p.useRef(void 0),d=p.useRef(!0),[f,h]=p.useState("generating"),[m,g]=p.useState(0),[b,v]=p.useState([]),[y,w]=p.useState(""),[x,O]=p.useState(""),[k,S]=p.useState("idle"),[C,E]=p.useState("idle"),[j,T]=p.useState("png");c.current=t,p.useEffect(()=>{var L;d.current=!0;const I=document.body.style.overflow,D=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(L=l.current)==null||L.focus();const _=F=>{var U;if(F.key==="Escape"){F.preventDefault(),c.current();return}if(F.key!=="Tab")return;const M=Array.from(((U=o.current)==null?void 0:U.querySelectorAll("button:not(:disabled)"))??[]);if(M.length===0)return;const z=M[0],q=M[M.length-1];F.shiftKey&&document.activeElement===z?(F.preventDefault(),q.focus()):!F.shiftKey&&document.activeElement===q&&(F.preventDefault(),z.focus())};return window.addEventListener("keydown",_),()=>{d.current=!1,document.body.style.overflow=I,window.removeEventListener("keydown",_),u.current!==void 0&&window.clearTimeout(u.current),D!=null&&D.isConnected&&D.focus()}},[]),p.useEffect(()=>{let I=!1,D="";return h("generating"),v([]),w(""),O(""),S("idle"),(async()=>{try{if(await Zdn(),I)return;const L=await dfn(e);if(L.length===0)throw new Error(n("share.imageFailed"));if(D=URL.createObjectURL(L[0].blob),I){URL.revokeObjectURL(D);return}v(L),w(D),h("ready")}catch(L){if(I)return;h("error"),O(L instanceof Error?L.message:String(L))}})(),()=>{I=!0,D&&URL.revokeObjectURL(D)}},[m,e]);const R=async()=>{var D;const I=b[0];if(!(!I||k==="copying")){S("copying"),O("");try{if(!((D=navigator.clipboard)!=null&&D.write)||typeof ClipboardItem>"u")throw new Error(n("share.copyUnsupported"));await navigator.clipboard.write([new ClipboardItem({"image/png":I.blob})]),S("copied"),u.current=window.setTimeout(()=>S("idle"),1500)}catch(_){S("idle"),O(_ instanceof Error?_.message:String(_))}}},A=I=>{T(I),S("idle"),O("")},N=(I,D)=>{var z,q;const _=["png","pdf"],L=_.indexOf(D);let F=L;if(I.key==="ArrowRight"||I.key==="ArrowDown")F=(L+1)%_.length;else if(I.key==="ArrowLeft"||I.key==="ArrowUp")F=(L-1+_.length)%_.length;else if(I.key==="Home")F=0;else if(I.key==="End")F=_.length-1;else return;I.preventDefault();const M=_[F];A(M),(q=(z=o.current)==null?void 0:z.querySelector(`[data-export-format="${M}"]`))==null||q.focus()},P=async()=>{if(!(b.length===0||C==="downloading")){E("downloading"),O("");try{const I=new Date().toISOString().replace(/[:.]/g,"-");if(j==="pdf"){const D=await bfn(b);tF(D,ffn(I))}else if(b.length===1)tF(b[0].blob,JUe(1,1,I));else{const D=await gfn(b,I);tF(D,hfn(I))}}catch(I){d.current&&O(I instanceof Error?I.message:n("share.exportFailed"))}finally{d.current&&E("idle")}}};return vi.createPortal(a.jsx("div",{className:"share-message-backdrop",onMouseDown:I=>{I.target===I.currentTarget&&t()},children:a.jsxs("section",{ref:o,className:"share-message-dialog",role:"dialog","aria-modal":"true","aria-labelledby":i,"aria-describedby":r,"aria-busy":f==="generating"||C==="downloading",children:[a.jsxs("header",{className:"share-message-head",children:[a.jsxs("div",{children:[a.jsx("h2",{id:i,children:n("share.title")}),a.jsx("p",{id:r,children:n("share.description")})]}),a.jsx("button",{ref:l,type:"button",className:"share-message-close","aria-label":n("share.close"),title:n("share.close"),onClick:t,children:a.jsx(Jdn,{})})]}),a.jsxs("div",{className:"share-message-body",children:[f==="generating"?a.jsx("div",{className:"share-message-generating",role:"status",children:a.jsx(hn,{children:n("share.generatingContent")})}):f==="error"?a.jsxs("div",{className:"share-message-failure",children:[a.jsx("p",{role:"alert",children:x||n("share.imageFailed")}),a.jsx("button",{type:"button",onClick:()=>g(I=>I+1),children:n("share.retry")})]}):a.jsxs("figure",{className:"share-message-preview",children:[a.jsx("figcaption",{className:"share-message-preview-meta",children:n("share.previewPage",{count:b.length})}),a.jsx("img",{src:y,alt:n("share.previewAlt",{count:b.length})})]}),f!=="error"&&x&&a.jsx("p",{className:"share-message-error",role:"alert",children:x})]}),a.jsxs("div",{className:"share-message-options",children:[a.jsx("span",{id:s,className:"share-message-format-label",children:n("share.format")}),a.jsx("div",{className:"share-message-format",role:"radiogroup","aria-labelledby":s,children:["png","pdf"].map(I=>a.jsx("button",{type:"button",role:"radio","data-export-format":I,className:j===I?"is-active":"","aria-checked":j===I,tabIndex:j===I?0:-1,disabled:C==="downloading",onClick:()=>A(I),onKeyDown:D=>N(D,I),children:I.toUpperCase()},I))})]}),a.jsxs("footer",{className:"share-message-actions",children:[a.jsx("span",{className:"share-message-download-status","aria-live":"polite",children:C==="downloading"?n("share.generatingFormat",{format:j.toUpperCase()}):""}),j==="png"&&a.jsx("button",{type:"button",onClick:()=>void R(),disabled:b.length===0||f!=="ready"||k==="copying",children:k==="copying"?n("share.copying"):k==="copied"?b.length>1?n("share.copiedFirst"):n("share.copied"):b.length>1?n("share.copyFirst"):n("share.copyImage")}),a.jsx("button",{type:"button",className:"is-primary",onClick:()=>void P(),disabled:b.length===0||f!=="ready"||C==="downloading",children:C==="downloading"?n("share.generating"):j==="png"&&b.length>1?n("share.downloadArchive",{count:b.length}):n("share.downloadFormat",{format:j.toUpperCase()})})]})]})}),document.body)}const vfn=2e3,xfn=700,eQe=1200;function WK(e,t){const n=Array.from(e);return n.length<=t?e:`${n.slice(0,t-1).join("").trimEnd()}…`}function tQe(e){return WK(e.trim(),xfn)}function nQe(e){return WK(e,eQe)}function oue(e){return e.trim().length>0}function wfn(e,t,n={selectedExcerpt:"选中片段",annotation:"批注",separator:":"}){const i=tQe(e),r=nQe(t.trim());return WK(`${n.selectedExcerpt}${n.separator}${i} ${n.annotation}${n.separator}${r}`,vfn)}function lue(e){return e?e instanceof Element?e:e.parentElement:null}function Ofn(e,t){if(!t||t.isCollapsed||t.rangeCount===0)return null;const n=lue(t.anchorNode),i=lue(t.focusNode);if(!n||!i||!e.contains(n)||!e.contains(i)||!n.closest(".bubble")||!i.closest(".bubble"))return null;const r=t.toString().trim();if(!r)return null;const s=t.getRangeAt(0).getBoundingClientRect();return s.width<=0||s.height<=0?null:{text:r,anchor:{left:s.left+s.width/2,top:s.top,height:s.height}}}function kfn({anchor:e,selectedText:t,onClose:n,onSubmit:i}){const{t:r}=Te("conversation"),s=p.useRef(!1),[o,l]=p.useState(""),[c,u]=p.useState(!1),[d,f]=p.useState(""),[h,m]=p.useState(!1),g=tQe(t),b=p.useCallback(()=>{var y;(y=window.getSelection())==null||y.removeAllRanges(),n()},[n]);s.current=c,p.useEffect(()=>{const y=()=>{s.current||b()},w=x=>{const O=x.target;O instanceof Element&&O.closest(".response-annotation-popover")||s.current||b()};return window.addEventListener("resize",y),window.addEventListener("scroll",w,!0),()=>{window.removeEventListener("resize",y),window.removeEventListener("scroll",w,!0)}},[b]);const v=async()=>{if(!(c||h||!oue(o))){u(!0),f("");try{await i(o.trim()),m(!0)}catch(y){f(y instanceof Error?y.message:String(y))}finally{u(!1)}}};return a.jsxs($g,{open:!0,onOpenChange:y=>{!y&&!c&&b()},children:[a.jsx($g.Trigger,{children:a.jsx("span",{className:"response-annotation-anchor",style:{left:e.left,top:e.top,height:e.height},"aria-hidden":"true"})}),a.jsx($g.Content,{side:"top",sideOffset:8,align:"center",minWidth:"auto",className:"response-annotation-popover",children:h?a.jsxs("div",{className:"response-annotation-success",role:"status","aria-live":"polite",children:[a.jsxs("div",{children:[a.jsx("strong",{children:r("annotation.successTitle")}),a.jsx("p",{children:r("annotation.successDescription")})]}),a.jsx(Tt,{type:"button",color:"secondary",size:"sm",pill:!1,onClick:b,children:r("annotation.done")})]}):a.jsxs("form",{className:"response-annotation-form","aria-label":r("annotation.ariaLabel"),"aria-busy":c||void 0,onSubmit:y=>{y.preventDefault(),v()},children:[a.jsx("div",{className:"response-annotation-header",children:a.jsx("h2",{children:r("annotation.title")})}),a.jsx("blockquote",{title:g,children:g}),a.jsxs("label",{className:"response-annotation-field",children:[a.jsx("span",{children:r("annotation.content")}),a.jsx(xb,{value:o,rows:3,maxRows:6,autoResize:!0,maxLength:eQe,disabled:c,invalid:!!d,"aria-label":r("annotation.content"),placeholder:r("annotation.placeholder"),onChange:y=>{l(nQe(y.target.value)),d&&f("")}})]}),d&&a.jsx("p",{className:"response-annotation-error",role:"alert",children:r("annotation.retryError",{error:d})}),a.jsxs("div",{className:"response-annotation-actions",children:[a.jsx(Tt,{className:"response-annotation-action",type:"button",color:"secondary",variant:"ghost",size:"sm",pill:!1,disabled:c,onClick:b,children:r("annotation.cancel")}),a.jsx(Tt,{className:"response-annotation-action",type:"submit",color:"primary",size:"sm",pill:!1,loading:c,disabled:!oue(o),children:r("annotation.submit")})]})]})})]})}const Sfn=["conversation","agents","applications","search","other"],Efn=["page_slow","feature_unavailable","display_error","no_response","other"],Cfn=["noResponse","loading","incomplete","error"];function Afn(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m5 12.5 4.2 4.2L19 7"})})}function Tfn({initialModule:e,onSubmit:t}){const{t:n}=Te("feedback"),i=p.useRef(null),[r,s]=p.useState(()=>new Set),[o,l]=p.useState(e),[c,u]=p.useState(""),[d,f]=p.useState(!1),[h,m]=p.useState(""),[g,b]=p.useState(!1),v=O=>{s(k=>{const S=new Set(k);return S.has(O)?S.delete(O):S.add(O),S})},y=O=>{var k;u(S=>S.trim()?S.includes(O)?S:`${S.trimEnd()} ${O}`:O),(k=i.current)==null||k.focus()},w=async O=>{if(O.preventDefault(),!(d||g)){f(!0),m("");try{await t({module:o,issues:[...r],description:c.trim()}),b(!0)}catch(k){m(k instanceof Error?k.message:String(k))}finally{f(!1)}}},x=r.size>0||c.trim().length>0;return a.jsxs("div",{className:"platform-feedback-page",children:[a.jsxs("header",{className:"platform-feedback-header",children:[a.jsx("h1",{children:n("title")}),a.jsx("p",{children:n("page.description")})]}),a.jsx("div",{className:"platform-feedback-scroll",children:g?a.jsxs("section",{className:"platform-feedback-success","aria-labelledby":"feedback-success-title","aria-live":"polite",role:"status",children:[a.jsx("span",{className:"platform-feedback-success-icon","aria-hidden":"true",children:a.jsx(Afn,{})}),a.jsxs("div",{children:[a.jsx("h2",{id:"feedback-success-title",children:n("success.title")}),a.jsx("p",{children:n("success.description")})]})]}):a.jsxs("form",{className:"platform-feedback-form",onSubmit:O=>void w(O),children:[a.jsxs("section",{className:"platform-feedback-section",children:[a.jsx("div",{className:"platform-feedback-section-heading",children:a.jsx("h2",{children:n("page.module")})}),a.jsx("div",{className:"platform-feedback-pills","aria-label":n("page.module"),children:Sfn.map(O=>a.jsx("button",{type:"button","aria-pressed":o===O,onClick:()=>l(O),disabled:d,children:n(`page.modules.${O}`)},O))})]}),a.jsx("section",{className:"platform-feedback-section",children:a.jsxs("div",{className:"platform-feedback-suggestions",children:[a.jsx("span",{children:n("page.commonIssuesMultiple")}),a.jsx("div",{className:"platform-feedback-pills","aria-label":n("page.issueTypes"),children:Efn.map(O=>a.jsx("button",{type:"button","aria-pressed":r.has(O),onClick:()=>v(O),disabled:d,children:n(`page.issues.${O}`)},O))})]})}),a.jsxs("section",{className:"platform-feedback-section",children:[a.jsxs("label",{className:"platform-feedback-field",children:[a.jsx("span",{children:n("descriptionLabel")}),a.jsx("textarea",{ref:i,value:c,onChange:O=>u(O.target.value),placeholder:n("page.descriptionPlaceholder"),maxLength:4e3,rows:6,disabled:d})]}),a.jsxs("div",{className:"platform-feedback-suggestions",children:[a.jsx("span",{children:n("page.quickAdd")}),a.jsx("div",{className:"platform-feedback-pills","aria-label":n("page.suggestionsLabel"),children:Cfn.map(O=>{const k=n(`page.suggestions.${O}`);return a.jsx("button",{type:"button",onClick:()=>y(k),disabled:d,children:k},O)})})]})]}),a.jsx("p",{className:"platform-feedback-privacy",role:"alert",children:n("page.privacy")}),h&&a.jsx("p",{className:"platform-feedback-error",role:"alert",children:h}),a.jsx("div",{className:"platform-feedback-actions",children:a.jsx("button",{type:"submit",disabled:!x||d,children:n(d?"submitting":"submit")})})]})})]})}function _fn({node:e,ctx:t}){const n=e.variant??"default";return a.jsx("button",{type:"button",className:`a2ui-button a2ui-button--${n}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component,onClick:()=>t.dispatchAction(e.action,e),children:t.render(e.child)})}Z0("Button",_fn);function jfn({node:e,ctx:t}){return a.jsx("div",{className:"a2ui-card","data-a2ui-id":e.id,"data-a2ui-component":e.component,children:t.render(e.child)})}Z0("Card",jfn);const Nfn={start:"flex-start",center:"center",end:"flex-end",spaceBetween:"space-between",spaceAround:"space-around",spaceEvenly:"space-evenly",stretch:"stretch"},Rfn={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch"};function iQe(e){return Nfn[e]??"flex-start"}function rQe(e){return Rfn[e]??"stretch"}function Ifn({node:e,ctx:t}){const n=e.children??[];return a.jsx("div",{className:"a2ui-column","data-a2ui-id":e.id,"data-a2ui-component":e.component,style:{display:"flex",flexDirection:"column",justifyContent:iQe(e.justify),alignItems:rQe(e.align)},children:n.map(i=>t.render(i))})}Z0("Column",Ifn);function Pfn({node:e}){const t=e.axis==="vertical";return a.jsx("div",{className:`a2ui-divider ${t?"a2ui-divider--v":"a2ui-divider--h"}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component})}Z0("Divider",Pfn);const Dfn={send:"✈️",check:"✅",close:"✖️",star:"⭐",favorite:"❤️",info:"ℹ️",help:"❓",error:"⛔",calendarToday:"📅",event:"📅",schedule:"🕒",locationOn:"📍",accountCircle:"👤",mail:"✉️",call:"📞",home:"🏠",settings:"⚙️",search:"🔍"};function Mfn({node:e}){const t=e.name??"";return a.jsx("span",{className:"a2ui-icon",title:t,"aria-label":t,"data-a2ui-id":e.id,"data-a2ui-component":e.component,children:Dfn[t]??"•"})}Z0("Icon",Mfn);function Lfn({node:e,ctx:t}){const n=e.children??[];return a.jsx("div",{className:"a2ui-row","data-a2ui-id":e.id,"data-a2ui-component":e.component,style:{display:"flex",flexDirection:"row",justifyContent:iQe(e.justify),alignItems:rQe(e.align??"center")},children:n.map(i=>t.render(i))})}Z0("Row",Lfn);const $fn=new Set(["h1","h2","h3","h4","h5"]);function Ffn({node:e,ctx:t}){const n=e.variant??"body",i=t.resolveString(e.text),r=$fn.has(n)?n:"p";return a.jsx(r,{className:`a2ui-text a2ui-text--${n}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component,children:i})}Z0("Text",Ffn);function Bfn(e){return e==="agents"?"agents":e==="applications"?"applications":e==="search"?"search":["conversation","new-chat","sandbox"].includes(e)?"conversation":"other"}function Ufn(e){const t=e instanceof Error?e.message:String(e??"");return t.includes("HTTP 503")&&(t.includes("未配置持久化存储")||t.includes("storage is not configured"))}async function nF(e){const[t,n,i]=await Promise.allSettled([PUe(),DUe("deepseek-harness"),jM()]);return{agentId:e,ready:!0,temporaryEnabled:t.status==="fulfilled"&&t.value.enabled,deepseekHarnessEnabled:n.status==="fulfilled"&&n.value.enabled,sandboxEndpointExportEnabled:t.status==="fulfilled"&&t.value.endpointExportEnabled===!0,skillCustomizationEnabled:i.status==="fulfilled"&&i.value.enabled}}async function cue(e,t){const n=await kz(e,t);if(ZR(e))return n;const i=await Promise.allSettled(n.map(s=>{var o;return(o=s.events)!=null&&o.length?Promise.resolve(s):eC(e,t,s.id)})),r=i.find(s=>s.status==="rejected"&&!/get session failed:\s*404\b/i.test(String(s.reason)));if((r==null?void 0:r.status)==="rejected")throw r.reason;return i.flatMap(s=>s.status==="fulfilled"?[s.value]:[])}const kc={app:"veadk.appName",view:"veadk.view",session:"veadk.sessionId"},Qfn=600,zfn=1e3,uue=5e3,Vfn=500,Vk=["list_envs","get_env_manifest","execute_in_sandbox","delegate_to_codex_sandbox"],sQe="veadk.sessionEnvironmentMounts.v1",aQe="veadk.sessionSkillMounts.v1";function due(){return{mounts:{},workspaceIds:{}}}function Hfn(){if(typeof localStorage>"u")return due();try{const e=JSON.parse(localStorage.getItem(sQe)??"{}"),t=(r,s)=>!r||typeof r!="object"||Array.isArray(r)?{}:Object.fromEntries(Object.entries(r).slice(-200).map(([o,l])=>[o,s(l)])),n=t(e.mounts,r=>Array.isArray(r)?r.slice(0,20).flatMap(s=>{if(!s||typeof s!="object"||Array.isArray(s))return[];const o=s;return typeof o.environment_id!="string"||typeof o.environment_version_id!="string"||o.mount_instance_id!==void 0&&typeof o.mount_instance_id!="string"?[]:[{environment_id:o.environment_id,environment_version_id:o.environment_version_id,...o.mount_instance_id?{mount_instance_id:o.mount_instance_id}:{}}]}):[]),i=t(e.workspaceIds,r=>Array.isArray(r)?r.filter(s=>typeof s=="string").slice(0,20):[]);return{mounts:n,workspaceIds:i}}catch{return due()}}function qfn(e,t){if(!(typeof localStorage>"u"))try{localStorage.setItem(sQe,JSON.stringify({mounts:e,workspaceIds:t}))}catch{}}function Wfn(){if(typeof localStorage>"u")return{};try{const e=JSON.parse(localStorage.getItem(aQe)??"{}");return!e||typeof e!="object"||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).slice(-200).map(([t,n])=>[t,Array.isArray(n)?n.slice(0,20).filter(i=>!!i&&typeof i=="object"&&!Array.isArray(i)&&i.source==="skillspace"&&typeof i.name=="string"&&typeof i.folder=="string"&&typeof i.skillSpaceId=="string"&&typeof i.skillId=="string"&&typeof i.version=="string"):[]]))}catch{return{}}}function Kfn(e){if(!(typeof localStorage>"u"))try{localStorage.setItem(aQe,JSON.stringify(e))}catch{}}function au(){return{skills:[]}}function $j(e,t,n){return`${e}\0${t}\0${n}`}async function fue(e){let t;if(e.threadId)try{const r=await Ur.readThread(e.id,e.threadId);if(r.messages.length>0)return r}catch(r){t=r}const n=await Ur.listThreads(e.id),i=n.threads.find(r=>r.id!==e.threadId)??n.threads[0];if(!i){if(t)throw t;return null}return Ur.resumeThread(e.id,i.id)}function iF(e,t){const n=FUe(e),i=n[n.length-1];return!t||(i==null?void 0:i.role)!=="user"?n:[...n,{role:"assistant",blocks:[],meta:{localId:`sandbox-background-${e.threadId}`}}]}function rF(e){return`${QL(e)}.active`}function CU(e){return`veadk.agentOrder.${encodeURIComponent(e)}`}function Gfn(e){if(!e)return[];try{const t=JSON.parse(localStorage.getItem(CU(e))||"[]");return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function AU(e,t){if(e.name===t||e.id===t)return e;for(const n of e.children){const i=AU(n,t);if(i)return i}}function hue(e){return e.replace(/__[0-9a-f]{10}(?:__.*)?$/i,"")}function pue(e,t,n,i,r){var s,o;return((s=e.meta)==null?void 0:s.streaming)===!0||((o=e.meta)==null?void 0:o.streaming)!==!1&&t===n-1&&(i||r)}function oQe(e){const t=[];for(const n of e.children)n.mentionable&&(t.push({name:n.name,description:n.description,type:n.type,path:n.path}),t.push(...oQe(n)));return t}function mue(){const e=typeof localStorage<"u"?localStorage.getItem(kc.view):null;return e==="intelligent"?e:["menu","custom","template","workflow"].includes(e??"")?"custom":e==="package"||e==="migration"||e==="deepseek"?e:null}function sF(e){const t=e.trim().toLowerCase();switch(t){case"creating":case"starting":case"initializing":case"pending":case"running":case"ready":case"failed":case"error":case"stopped":case"expired":case"deleting":case"deleted":return t;default:return"unknown"}}function gue({className:e}){return a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.45",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("rect",{x:"3.75",y:"3.75",width:"16.5",height:"16.5",rx:"3.25"}),a.jsx("path",{d:"M12 8.5v7M8.5 12h7"}),a.jsx("path",{d:"M6.75 6.75h1M16.25 17.25h1",opacity:"0.6"})]})}function Xfn({className:e}){return a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.45",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("rect",{x:"3.5",y:"5",width:"17",height:"14.75",rx:"2.25"}),a.jsx("path",{d:"M3.5 9h17M9.25 12.25 7.1 14.4l2.15 2.15M14.75 12.25l2.15 2.15-2.15 2.15M12.8 11.85l-1.6 5.1"})]})}function Yfn({className:e}){return a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.45",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("rect",{x:"2.75",y:"5",width:"6.5",height:"14",rx:"1.6"}),a.jsx("path",{d:"M5.25 8.5h1.5M5.25 11.5h1.5"}),a.jsx("rect",{x:"14.75",y:"5",width:"6.5",height:"14",rx:"1.6"}),a.jsx("path",{d:"M17.25 15.5h1.5M17.25 12.5h1.5M8.75 12h6.5m-2.5-2.5 2.5 2.5-2.5 2.5"})]})}function Zfn(){return a.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":!0,children:[a.jsx("rect",{x:"3",y:"4",width:"14",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none"}),a.jsx("rect",{x:"6",y:"10.4",width:"13",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none",opacity:"0.7"}),a.jsx("rect",{x:"9",y:"16.8",width:"9",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none",opacity:"0.45"})]})}function TU(e){return e?new Date(e*1e3).toLocaleString(yn.resolvedLanguage??yn.language,{timeZone:"Asia/Shanghai",hour12:!1,month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):""}function Jfn(e){if(!e)return"";const t=[];return e.ts&&t.push(TU(e.ts)),e.tokens!=null&&t.push(`${e.tokens.toLocaleString()} tokens`),t.join(" · ")}function qm(e){return e.blocks.map(t=>t.kind==="text"?t.text:"").join("").trim()}function aF(e,t){for(let n=t-1;n>=0;n-=1)if(e[n].role==="user")return qm(e[n]);return""}const ehn="send_a2ui_json_to_client";function Hk(e){return e.blocks.some(t=>t.kind==="text"?t.text.trim().length>0:t.kind==="attachment"||t.kind==="artifact"?t.files.length>0:t.kind==="delivery"||t.kind==="turn-summary"?!0:t.kind==="tool"?!(t.name===ehn&&t.done):t.kind==="agent-transfer"?!1:t.kind==="a2ui"?dLe(t.messages).some(n=>n.components[n.rootId]):t.kind==="auth")}function oF(e){return e.blocks.some(t=>t.kind==="auth"&&!t.done)}function thn(e){return new Promise((t,n)=>{let i="";try{i=new URL(e,window.location.href).protocol}catch{}if(i!=="http:"&&i!=="https:"){n(new Error(Bt("oauth.unsupportedUrl")));return}const r=window.open(e,"veadk_oauth","width=520,height=720");if(!r){n(new Error(Bt("oauth.popupBlocked")));return}let s=!1;const o=()=>{clearInterval(u),window.removeEventListener("message",c)},l=d=>{if(!s){s=!0,o();try{r.close()}catch{}t(d)}},c=d=>{if(d.origin!==window.location.origin)return;const f=d.data;f&&f.veadkOAuth&&typeof f.url=="string"&&l(f.url)};window.addEventListener("message",c);const u=setInterval(()=>{if(!s){if(r.closed){o();const d=window.prompt(Bt("oauth.pasteCallbackUrl"));d&&d.trim()?(s=!0,t(d.trim())):n(new Error(Bt("oauth.cancelled")));return}try{const d=r.location.href;d&&d!=="about:blank"&&new URL(d).origin===window.location.origin&&/[?&](code|state|error)=/.test(d)&&l(d)}catch{}}},500)})}function nhn(e,t){const n=JSON.parse(JSON.stringify(e??{})),i=n.exchangedAuthCredential??n.exchanged_auth_credential??{},r=i.oauth2??{};return r.authResponseUri=t,r.auth_response_uri=t,i.oauth2=r,n.exchangedAuthCredential=i,n}function bue({text:e}){const[t,n]=p.useState(!1);return a.jsx("button",{className:"icon-btn",title:Bt(t?"actions.copied":"actions.copy"),disabled:!e,onClick:async()=>{if(e)try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)}catch{}},children:t?a.jsx(Cf,{className:"icon"}):a.jsx(JD,{className:"icon"})})}function ihn({onClick:e}){return a.jsx("button",{type:"button",className:"icon-btn","aria-label":Bt("actions.exportConversation"),title:Bt("actions.exportConversation"),onClick:e,children:a.jsx(fat,{className:"icon","aria-hidden":"true"})})}const yue=Array.from({length:14},(e,t)=>`greetings.${t}`),vue=()=>yue[Math.floor(Math.random()*yue.length)];function Bt(e,t){return yn.t(e,{ns:"app",...t})}function lF(e,t){return yn.t(e,{ns:"ui",...t})}function cF(e){var t;for(const n of e)(t=n.previewUrl)!=null&&t.startsWith("blob:")&&URL.revokeObjectURL(n.previewUrl)}function xue(){return`draft-${Date.now()}-${Math.random().toString(36).slice(2)}`}function wue(e){var n;if(e.type)return e.type;const t=(n=e.name.split(".").pop())==null?void 0:n.toLowerCase();return t==="md"||t==="markdown"?"text/markdown":t==="txt"?"text/plain":"application/octet-stream"}const rhn={"read-only":"sandbox.mode.readOnly","workspace-write":"sandbox.mode.workspaceWrite","danger-full-access":"sandbox.mode.fullAccess"},shn={untrusted:"sandbox.approvalPolicy.untrusted","on-request":"sandbox.approvalPolicy.onRequest",never:"sandbox.approvalPolicy.never"},ahn={user:"sandbox.reviewer.user",auto_review:"sandbox.reviewer.autoReview"};function ohn(e,t){const n=Bt(e.kind==="file"?"approval.subject.file":"approval.subject.command");return Bt(`approval.decision.${t}`,{subject:n})}function lhn(e){var n,i,r;const t=[];return(n=e.command)!=null&&n.trim()&&t.push({label:Bt("approval.details.command"),value:e.command.trim(),code:!0}),(i=e.grantRoot)!=null&&i.trim()&&t.push({label:Bt("approval.details.grantRoot"),value:e.grantRoot.trim(),code:!0}),(r=e.cwd)!=null&&r.trim()&&t.push({label:Bt("approval.details.cwd"),value:e.cwd.trim(),code:!0}),t}function Oue(e){return e.flatMap(t=>t.apps.map(n=>bf(t.id,n)))}function chn(e,t){var n;return((n=e.find(i=>i.runtimeId&&i.apps.some(r=>bf(i.id,r)===t)))==null?void 0:n.runtimeId)??""}function kue(e,t){for(const n of e){const i=n.apps.find(r=>bf(n.id,r)===t);if(i&&n.runtimeId)return{runtimeId:n.runtimeId,region:n.region??"cn-beijing",appName:i}}return null}function Sue(e){return e.taskMode==="text_to_video"?[]:(e.taskMode==="first_last_frame"?[e.firstFrame?{file:e.firstFrame,kind:"first_frame"}:null,e.lastFrame?{file:e.lastFrame,kind:"last_frame"}:null]:[e.referenceImage?{file:e.referenceImage,kind:"reference_image"}:null,e.referenceVideo?{file:e.referenceVideo,kind:"reference_video"}:null]).filter(n=>n!==null)}function uhn(e,t){return`video-${e.replace(/[^A-Za-z0-9_-]/g,"").slice(0,36)||"result"}.${t}`}function qk(e,t){return`${e}${t}`}function uF(e){var n,i;const t=(i=(n=[...e??[]].reverse().find(r=>{var s;return r.role==="assistant"&&((s=r.meta)==null?void 0:s.eventId)}))==null?void 0:n.meta)==null?void 0:i.eventId;return(t==null?void 0:t.trim())||void 0}function dhn(){var jG;const{t:e}=Te("app"),[t,n]=p.useState([]),[i,r]=p.useState(()=>typeof localStorage<"u"&&localStorage.getItem(kc.app)||""),[s,o]=p.useState([]),[l,c]=p.useState(()=>typeof localStorage<"u"&&localStorage.getItem(kc.session)||""),u=p.useRef(null),d=p.useRef(0),f=p.useRef(0),h=p.useRef(null),[m,g]=p.useState(!1),[b,v]=p.useState([]),[y,w]=p.useState(null),[x,O]=p.useState([]),[k,S]=p.useState(!1),[C,E]=p.useState(!1),[j,T]=p.useState(""),[R,A]=p.useState(!1),[N,P]=p.useState(!1),[I,D]=p.useState(null),[_,L]=p.useState(null),[F,M]=p.useState(!1),[z,q]=p.useState(""),[U,J]=p.useState(null),[V,Z]=p.useState(!1),[ne,W]=p.useState(""),[G,H]=p.useState(!1),[se,Y]=p.useState("idle"),[X,ie]=p.useState(!1),[ee,be]=p.useState("confirm"),[ue,pe]=p.useState(""),[ke,je]=p.useState("codex"),[Pe,Ee]=p.useState(!0),[Qe,_e]=p.useState(""),[ae,le]=p.useState(!1),[ge,Oe]=p.useState("snapshot"),[Se,qe]=p.useState(10),[Xe,ye]=p.useState(5),[we,Ae]=p.useState(100),[Ve,Be]=p.useState(!1),[_t,Pt]=p.useState(!1),[Kt,Et]=p.useState(0),[vt,tt]=p.useState("general"),[mt,Ne]=p.useState(null),[wt,jt]=p.useState(null),[Yt,wn]=p.useState(null),We=p.useRef(null),kt=p.useRef(null),He=p.useRef(null),nt=p.useRef(null),et=p.useRef(null),ft=p.useRef((y==null?void 0:y.id)??""),St=p.useRef(""),Ct=p.useRef(0),It=p.useRef(void 0),Gt=p.useRef(new Set);ft.current=(y==null?void 0:y.id)??"",p.useEffect(()=>()=>{var $;($=kt.current)==null||$.abort()},[]),p.useEffect(()=>()=>{It.current!==void 0&&window.clearTimeout(It.current);for(const $ of Gt.current)URL.revokeObjectURL($);Gt.current.clear()},[]);function Ge($){const K=URL.createObjectURL($);return Gt.current.add(K),K}function xt($){!$||!Gt.current.delete($)||URL.revokeObjectURL($)}function yt(){for(const $ of Gt.current)URL.revokeObjectURL($);Gt.current.clear()}const nn=p.useCallback(()=>{It.current!==void 0&&(window.clearTimeout(It.current),It.current=void 0),Y("idle")},[]);p.useEffect(()=>{nn()},[nn,y==null?void 0:y.id]);const[Qt,cn]=p.useState({}),[Me,on]=p.useState({}),kn=l?Qt[l]??[]:b,Sn=y?x:kn,zi=l?Me[qk(i,l)]??JS:JS,un=($,K)=>cn(te=>({...te,[$]:typeof K=="function"?K(te[$]??[]):K})),or=($,K,te)=>{const me=qk($,K);on(De=>{const ze=De[me]??JS,ve=yV(ze,te);return ve===ze?De:{...De,[me]:ve}})};function Pn($,K,te=[],me=""){if(ft.current!==$)return;const De=crypto.randomUUID(),ze={role:"system",blocks:[],activity:{id:De,title:K,...te.length>0?{details:te}:{}},meta:{localId:De,ts:Date.now()/1e3}};O(ve=>{if(!me)return[...ve,ze];const at=ve.findIndex(it=>{var ut;return((ut=it.meta)==null?void 0:ut.localId)===me});return at<0?[...ve,ze]:[...ve.slice(0,at),ze,...ve.slice(at)]})}const[ei,Fn]=p.useState(""),[Si,Qn]=p.useState("agent"),[Rn,ui]=p.useState("agent"),[rt,zt]=p.useState("create"),[Ue,bt]=p.useState(null),[Ht,_n]=p.useState(null),[Nr,qs]=p.useState(null),[Ws,Lr]=p.useState(!0),[ti,Ei]=p.useState(""),[es,ts]=p.useState(),[ba,go]=p.useState(0),[fs,he]=p.useState(""),[gr,bo]=p.useState(null),[to,fl]=p.useState(),[no,ks]=p.useState(null),Ks=p.useCallback($=>{ks($);const K=new URL(window.location.href);if($)K.searchParams.set("view","runtime-deploy"),K.searchParams.set("source","intelligent-development"),K.searchParams.set("sessionId",$.sessionId),K.searchParams.set("artifactSha256",$.artifactSha256),K.searchParams.set("validationReportSha256",$.validationReportSha256),$.projectId&&$.versionId?(K.searchParams.set("projectId",$.projectId),K.searchParams.set("versionId",$.versionId)):(K.searchParams.delete("projectId"),K.searchParams.delete("versionId"));else for(const te of["view","source","sessionId","artifactSha256","validationReportSha256","projectId","versionId"])K.searchParams.delete(te);window.history.replaceState(null,"",K)},[]),Ti=p.useCallback($=>$.projectId&&$.versionId?Yle($.projectId,$.versionId,$.sessionId,$.artifactSha256,$.validationReportSha256):Zle($.sessionId,$.artifactSha256,$.validationReportSha256),[]),rr=p.useCallback(async $=>{if(!$.projectId||!$.versionId||!$.parentVersionId)throw new Error(Bt("errors.noOptimizationBaseline"));const K=await b7e($.projectId),te=K.find(ve=>ve.versionId===$.versionId),me=K.find(ve=>ve.versionId===$.parentVersionId);if(!te||!me)throw new Error(Bt("errors.optimizationVersionMissing"));const[De,ze]=await Promise.all([zx(me),zx(te)]);return{base:De,target:ze}},[]),Ds=p.useCallback(async $=>{const K=W9e({agentId:$.agentName,deployAction:"create",deploySource:"intelligent_development",createMode:"intelligent",aiAssisted:1});try{const{blob:te,filename:me}=await Mrn($),De=URL.createObjectURL(te),ze=document.createElement("a");ze.href=De,ze.download=me,ze.hidden=!0;try{document.body.appendChild(ze),ze.click()}finally{ze.remove(),window.setTimeout(()=>URL.revokeObjectURL(De),1e3)}K.succeed({fileCount:$.fileCount,zipSizeBytes:te.size})}catch(te){throw K.fail({fileCount:$.fileCount,...Xo(te)}),te}},[]),[Ml,hl]=p.useState(null),[br,$r]=p.useState(!1),[pl,Lo]=p.useState(!1),Rr=p.useRef(null),$o=p.useRef(null),[ns,ya]=p.useState({}),Mi=p.useRef(new Map),Ms=ns.ready===!0&&ns.agentId===i,[Vr,hs]=p.useState([]),[ml,ia]=p.useState(au),[gi,Ll]=p.useState(null),[Fo,Gs]=p.useState(!1),[gl,Bo]=p.useState();p.useEffect(()=>Bo(void 0),[i]);const[Ma,bl]=p.useState(null),[Bu]=p.useState(()=>Wfn());p.useEffect(()=>Kfn(Bu),[Bu]);const[Uo,mc]=p.useState([]),[Md,Ld]=p.useState([]),[yo,$d]=p.useState(!1),[yl,$l]=p.useState(""),La=p.useRef(null),Qo=p.useRef(null);Qo.current===null&&(Qo.current=Hfn());const[zo,Uu]=p.useState(()=>{var $;return(($=Qo.current)==null?void 0:$.mounts)??{}}),[vl,Fl]=p.useState(()=>{var $;return(($=Qo.current)==null?void 0:$.workspaceIds)??{}});p.useEffect(()=>{qfn(zo,vl)},[zo,vl]);const[Ls,$a]=p.useState({}),[sn,Bl]=p.useState(null),[Ss,is]=p.useState({}),rs=p.useRef({}),[Fd,Ul]=p.useState(!1),[Vo,Ql]=p.useState({}),[Kc,vo]=p.useState(0),ra=p.useRef(""),[io,Re]=p.useState(!1),ot=p.useRef(new Set),[$t,Dn]=p.useState(()=>new Set),[On,mn]=p.useState(()=>new Set),[jn,Wt]=p.useState(()=>new Set),bn=p.useRef(new Map),Mn=p.useRef(new Map),ai=p.useRef(void 0),ss=p.useRef(()=>{}),re=($,K)=>Dn(te=>{const me=new Set(te);return K?me.add($):me.delete($),me}),zn=$=>{const K=Mn.current.get($);K!==void 0&&window.clearTimeout(K),Mn.current.delete($),mn(te=>new Set(te).add($))},bi=$=>{const K=Mn.current.get($);K!==void 0&&window.clearTimeout(K),Mn.current.delete($),mn(te=>{if(!te.has($))return te;const me=new Set(te);return me.delete($),me})},Fa=$=>{const K=Mn.current.get($);K!==void 0&&window.clearTimeout(K);const te=window.setTimeout(()=>{bi($)},2400);Mn.current.set($,te)},oe=($,K)=>{Wt(te=>{if(te.has($)===K)return te;const me=new Set(te);return me.delete($),me})},$e=p.useRef(""),[st,Ye]=p.useState("");function de($,K,te){const me=Rr.current;if(!me||me.localId!==$||me.runId!==K)return null;const De=Vle(me,te);return Rr.current=De,hl(De),De}async function Fe($,K,te){var ze;(ze=$o.current)==null||ze.abort();const me=new AbortController;$o.current=me;let De=te;try{let ve=Rr.current;if(!ve||ve.localId!==$||ve.runId!==K)return;if(De==="optimization"&&ve.assetIds.length===0){const it=Sue(ve.config);if(it.length>0){const ut=await Promise.all(it.map(fn=>Nin(fn.file,fn.kind,me.signal)));if(me.signal.aborted||(ve=de($,K,{type:"assets_uploaded",assetIds:ut.map(fn=>fn.assetId)}),!ve))return}}if(De==="optimization"){const it=await Rin({prompt:ve.requestedPrompt,taskMode:ve.requestedMode,assetIds:ve.assetIds,ratio:ve.config.aspectRatio,resolution:ve.config.resolution,durationSeconds:ve.config.durationSeconds},me.signal);if(me.signal.aborted||(ve=de($,K,{type:"optimization_succeeded",optimizedPrompt:it.enhancedPrompt,resolvedMode:it.resolvedTaskMode,enhancerModel:it.enhancerModel}),!ve))return;De="generation"}if(!ve.optimizedPrompt||!ve.resolvedMode)throw new Error(Bt("errors.incompletePromptOptimization"));const at=await Iin({enhancedPrompt:ve.optimizedPrompt,resolvedTaskMode:ve.resolvedMode,assetIds:ve.assetIds,ratio:ve.config.aspectRatio,resolution:ve.config.resolution,durationSeconds:ve.config.durationSeconds},me.signal);if(me.signal.aborted||(ve=de($,K,{type:"generation_started",remoteTaskId:at.taskId,generationModel:at.generationModel,startedAt:Date.now()}),!ve))return;for(;!me.signal.aborted;){const it=await Pin(at.taskId,me.signal);if(me.signal.aborted)return;if((it.status==="queued"||it.status==="running")&&de($,K,{type:"generation_status_changed",providerStatus:it.status}),it.status==="failed")throw new Error(it.error||Bt("errors.videoGenerationFailed"));if(it.status==="succeeded"){if(!it.videoUrl)throw new Error(Bt("errors.videoPreviewMissing"));de($,K,{type:"generation_succeeded",output:{previewUrl:Min(it.videoUrl),fileName:uhn(at.taskId,it.outputFormat),mimeType:it.outputFormat==="mov"?"video/quicktime":"video/mp4"}});return}await new Promise(ut=>window.setTimeout(ut,1800))}}catch(ve){if(me.signal.aborted)return;de($,K,{type:"failed",stage:De,error:ve instanceof Error?ve.message:String(ve)})}}function lt($,K,te){if(f7e(Rr.current)){$r(!0);return}if(K.taskMode==="video_editing"&&!K.referenceVideo){Ye(Bt("errors.videoEditRequiresVideo"));return}if(K.taskMode==="video_extension"&&!K.referenceVideo){Ye(Bt("errors.videoExtendRequiresVideo"));return}if(K.taskMode==="reference_to_video"&&!K.referenceImage&&!K.referenceVideo){Ye(Bt("errors.videoReferenceRequired"));return}if(K.taskMode==="text_to_video"&&(K.referenceImage||K.referenceVideo||K.firstFrame||K.lastFrame)){Ye(Bt("errors.textVideoRejectsReferences"));return}if(K.taskMode==="first_last_frame"&&!K.firstFrame){Ye(Bt("errors.firstFrameRequired"));return}if(te.supportedModes.length>0&&K.taskMode!=="auto"&&!te.supportedModes.includes(K.taskMode)){Ye(Bt("errors.videoModeUnsupported"));return}const me=Sue(K);if(me.length>0&&!te.assetStorageAvailable){Ye(Bt("errors.persistentStorageNotConfigured"));return}const De=me.find(({file:ve})=>te.maxAssetBytes>0&&ve.size>te.maxAssetBytes);if(De){Ye(Bt("errors.mediaTooLarge",{fileName:De.file.name}));return}const ze=brn({prompt:$,config:K,enhancerModel:te.enhancerModel,generationModel:te.generationModel});Rr.current=ze,hl(ze),$r(!0),Fn(""),Ye(""),Fe(ze.localId,ze.runId,"optimization")}function ct(){const $=Rr.current;if(!$||$.status!=="error"||!$.errorStage)return;const K=$.errorStage,te=Vle($,{type:"retry",stage:K});Rr.current=te,hl(te),$r(!0),Fe(te.localId,te.runId,K)}async function Lt(){const $=Rr.current;if(!(!($!=null&&$.remoteTaskId)||!$.output))try{const K=await Din($.remoteTaskId),te=URL.createObjectURL(K),me=document.createElement("a");me.href=te,me.download=$.output.fileName,me.click(),window.setTimeout(()=>URL.revokeObjectURL(te),1e3)}catch(K){Ye(K instanceof Error?K.message:String(K))}}p.useEffect(()=>()=>{var $;($=$o.current)==null||$.abort()},[]);const[ln,yr]=p.useState(""),[Jt,pi]=p.useState(()=>new Set),[Vt,yi]=p.useState(null),[Ln,Xn]=p.useState(null),[mi,lr]=p.useState(null),[cr,pr]=p.useState(null);p.useEffect(()=>{lr(null)},[i,l]);const[ro,Sm]=p.useState(!1),[lv,cv]=p.useState(),[Mh,Df]=p.useState(vue),uv=e(Mh),[Ir,xl]=p.useState(null),[xo,Qu]=p.useState(!1),[wl,zu]=p.useState(!1),[Lh,zl]=p.useState(""),Vu=p.useRef(!1),[Ol,Pi]=p.useState(null),[Nt,gc]=p.useState(""),[Vi,Hr]=p.useState(),[Bn,$h]=p.useState(null),CO=(Bn==null?void 0:Bn.capabilities.runtimeScope)??"mine",[Fh,dv]=p.useState({newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,agentUsage:!1,addAgentkit:!0}),[Hu,fv]=p.useState("cloud"),[$s,qu]=p.useState(tC),[Wn,KT]=p.useState("volcengine"),[Bh,AO]=p.useState(""),[TO,GT]=p.useState(""),[Mb,XT]=p.useState(!1),[Uh,Pr]=p.useState(!1),[HL,YT]=p.useState(!1),Em=$t.has(l),Bd=On.has(l),Cm=Em||m,wo=y?k:Cm,qL=wo||!y&&Bd,Mf=(y==null?void 0:y.intelligentDevelopment)===!0?_v:Ur,Ri=Hun({client:Mf,allowSkillSelection:(y==null?void 0:y.intelligentDevelopment)!==!0,allowThreadManagement:(y==null?void 0:y.intelligentDevelopment)!==!0,session:y,conversationBusy:k,onInputChange:Fn,onSessionPatch:$=>{const K=ft.current;w(te=>(te==null?void 0:te.id)===K?{...te,...$}:te)},onSnapshot:$=>{const K=ft.current;yt(),O(FUe($)),w(te=>(te==null?void 0:te.id)===K?{...te,threadId:$.threadId,cwd:$.cwd??te.cwd,model:$.model??te.model,workspaceLocked:$.workspaceLocked,permissions:$.permissions,busy:!1}:te)},onActivity:($,K=[])=>{const te=ft.current;te&&Pn(te,$,K)},onError:Ye});p.useEffect(()=>{const $=y;if(!$||$.intelligentDevelopment||!k||et.current)return;let K=!1,te;const me=new AbortController,De=async()=>{try{const ze=$.intelligentDevelopment?_v:Ur,ve=await ze.getStatus($.id,{signal:me.signal});if(K||ft.current!==$.id)return;const at=ve.threadId?await ze.readThread($.id,ve.threadId,{signal:me.signal}):null;if(K||ft.current!==$.id)return;if(at&&O(iF(at,ve.busy)),w(it=>(it==null?void 0:it.id)===$.id?{...it,...ve,...at?{threadId:at.threadId,cwd:at.cwd??ve.cwd,model:at.model??ve.model,workspaceLocked:at.workspaceLocked,permissions:at.permissions}:{}}:it),S(ve.busy),!ve.busy){const it=at==null?void 0:at.messages[at.messages.length-1];(it==null?void 0:it.role)==="user"&&Ye(Bt("errors.cloudCodexEmptyReply"));return}}catch(ze){if((ze==null?void 0:ze.name)==="AbortError"||K)return;if($.intelligentDevelopment){Ye(Vtt(ze)),te=window.setTimeout(De,1500);return}S(!1),w(ve=>(ve==null?void 0:ve.id)===$.id?{...ve,busy:!1}:ve),Ye(ze instanceof Error?ze.message:String(ze));return}te=window.setTimeout(De,1500)};return te=window.setTimeout(De,1500),()=>{K=!0,me.abort(),te!==void 0&&window.clearTimeout(te)}},[k,y==null?void 0:y.id]);const so=ent({sessionId:y!=null&&y.intelligentDevelopment?y.id:"",ownerId:Nt,onTurns:O,onBusy:$=>{S($),w(K=>K!=null&&K.intelligentDevelopment?{...K,busy:$}:K)}}),ps=sn==null?void 0:sn.graph,ZT=[sn==null?void 0:sn.name,ps==null?void 0:ps.name,ps==null?void 0:ps.id].filter($=>!!$),Lb=ml.targetAgent&&ps?AU(ps,ml.targetAgent.name):ps,JT=(Lb==null?void 0:Lb.skills)??(ml.targetAgent?[]:(sn==null?void 0:sn.skills)??[]),e2=ps?oQe(ps):[],t2=(ps==null?void 0:ps.instruction)??((jG=sn==null?void 0:sn.draft)==null?void 0:jG.instruction),WL=sn&&t2!==void 0?iot({instruction:t2,tools:[...new Set([...(ps==null?void 0:ps.tools)??sn.tools,...l&&(zo[$j(i,Nt,l)]??[]).length>0?[...Vk]:[]])],skills:(ps==null?void 0:ps.skills)??sn.skills}):null;function hv($){cF($);for(const K of $)K.status==="uploading"?ot.current.add(K.id):K.uri&&cN(i,K.uri).catch(te=>Ye(String(te)))}async function Qh($){try{await M8(i,Nt,$),await D8(i,Nt,$),o(K=>K.filter(te=>te.id!==$)),cn(K=>{const{[$]:te,...me}=K;return me})}catch(K){Ye(String(K))}}function n2($){const K=Vr.find(De=>De.id===$);if(!K)return;const te=Vr.filter(De=>De.id!==$);cF([K]),K.status==="uploading"&&ot.current.add($),hs(te),te.length===0&&!ei.trim()&&!!l&&Sn.length===0?($e.current="",c(""),Qh(l)):K.uri&&cN(i,K.uri).catch(De=>Ye(String(De)))}const[Ba,Nn]=p.useState(mue),[_O,i2]=p.useState(Von),[r2,s2]=p.useState([]),[KL,jO]=p.useState({}),Ud=p.useCallback($=>{s2(K=>{const te=K.findIndex(De=>De.id===$.id);if(te===-1)return[$,...K];const me=[...K];return me[te]={...me[te],...$},me})},[]),a2=p.useCallback($=>{const K=$.status==="succeeded",te=$.status==="failed_retryable"||$.status==="failed_terminal",me=Date.parse($.createdAt??$.updatedAt??"");return{id:`mpa-operation:${$.operationId}`,agentName:$.mpaInstanceId||$.runtimeId||$.operationId,runtimeName:$.mpaInstanceId||$.runtimeId||$.operationId,runtimeId:$.runtimeId,mpaInstanceId:$.mpaInstanceId,region:$.runtimeRegion||"cn-beijing",startedAt:Number.isFinite(me)?me:Date.now(),status:K?"success":te?"error":"running",phase:$.stage,label:lF(te?"agentWorkspace.deploymentFailed":K?"agentWorkspace.deployStatus.success":"agentWorkspace.deployStatus.running"),message:$.safeErrorCode||void 0,pct:K||te?100:void 0,mpaProfile:!0,mpaSmoke:$.operationKind==="create",operationId:$.operationId}},[]),pv=p.useRef(new Set),[o2,l2]=p.useState(!0),[Am,ms]=p.useState(!1),[c2,NO]=p.useState("skills"),[mv,RO]=p.useState({kind:"key",key:"titles.skillLibrary"}),GL=mv.kind==="key"?e(mv.key,{name:mv.name}):mv.title,XL=p.useCallback($=>{RO(K=>K.kind==="literal"&&K.title===$?K:{kind:"literal",title:$})},[]),[YL,$b]=p.useState(null),[gv,as]=p.useState(!1),[Tm,di]=p.useState(!1),[u2,bc]=p.useState("entry"),[bv,Qd]=p.useState("traditional"),[IO,sa]=p.useState(null),[ce,Le]=p.useState("custom"),[Ke,pt]=p.useState("workspaces"),[dn,Ze]=p.useState(!1),[En,qr]=p.useState(0),[Di,va]=p.useState([]),aa=p.useRef([]),zd=p.useRef(null),zh=p.useRef(null),[PO,d2]=p.useState([]),[Ua,kl]=p.useState(""),Ho=p.useRef(null),[DO,Xs]=p.useState(!1),[_m,kr]=p.useState(!1),[KK,ZL]=p.useState(""),[lQe,cQe]=p.useState("good"),[uQe,f2]=p.useState("basic"),[dQe,fQe]=p.useState("good"),[MO,h2]=p.useState(""),[hQe,pQe]=p.useState(null),[Gc,Dr]=p.useState(!1),[p2,Wu]=p.useState(!1),[JL,Sl]=p.useState(!1),[GK,qo]=p.useState([]),yv=GK[GK.length-1],jm=yv==null?void 0:yv.page,m2=jm==="users",e5=jm==="system-info",t5=jm==="developer-resources",g2=jm==="review-center",b2=p.useCallback($=>{qo(K=>{var te;return((te=K[K.length-1])==null?void 0:te.page)===$.page?K:[...K,$]})},[]),Nm=p.useCallback($=>{qo(K=>{var me;if(((me=K[K.length-1])==null?void 0:me.page)===$)return K.slice(0,-1);const te=K.findIndex(De=>De.page===$);return te===-1?K:K.filter((De,ze)=>ze!==te)})},[]),[mQe,gQe]=p.useState("development"),[yc,Qa]=p.useState(null),[y2,Xc]=p.useState(!1),n5=p.useRef(null),[Ku,LO]=p.useState(()=>{const $=af();return bO($),$}),[bQe,XK]=p.useState(!1),[yQe,YK]=p.useState(""),[ZK,$O]=p.useState(null),[i5,JK]=p.useState({}),[vQe,eG]=p.useState(()=>new Set),[Vd,Vl]=p.useState(null),[Fb,v2]=p.useState(Zi(Wn)),[tG,oa]=p.useState("");p.useEffect(()=>{if(Ir!=="authenticated")return;const $=new AbortController,K=async te=>{if(pv.current.has(te.operationId))return;pv.current.add(te.operationId);let me=te;try{for(;!$.signal.aborted;){me=await kTe(me.operationId,$.signal);const De=a2(me);if(Ud(De),me.operationKind==="create"&&(oa(De.id),la(""),kr(!0)),me.status!=="active")return;await new Promise(ze=>window.setTimeout(ze,500))}}finally{pv.current.delete(te.operationId)}};return OTe().then(te=>Promise.all(te.map(K))).catch(()=>{}),()=>$.abort()},[Ir,a2,Ud]);const[nG,la]=p.useState(""),[Li,Oo]=p.useState(null),Hd=p.useCallback(()=>{Nm("agent-detail"),Oo(null),Dr(!1),kr(!1)},[Nm]),[xQe,r5]=p.useState(!1),x2=p.useRef(!1),vv=p.useRef(!1),Lf=p.useCallback($=>{if(!Nt)return!1;try{Uce(localStorage,Nt,$)}catch(K){return yr(K instanceof Error?K.message:Bt("errors.saveDraftRejected")),!1}return aa.current=$,va($),yr(""),!0},[Nt]),$f=p.useCallback($=>{var K;$&&((K=zd.current)==null?void 0:K.id)!==$||(zd.current=null,zh.current!==null&&(window.clearTimeout(zh.current),zh.current=null))},[]),Rm=p.useCallback(()=>{const $=zd.current;if(!$)return!0;const K=Lf([$,...aa.current.filter(te=>te.id!==$.id)]);return K&&$f(),K},[$f,Lf]),wQe=p.useCallback(($,K,te,me)=>{!$||!Nt||(zd.current&&zd.current.id!==$&&Rm(),zd.current={id:$,draft:K,updatedAt:Date.now(),deploymentTarget:te,creationMode:me},zh.current!==null&&window.clearTimeout(zh.current),zh.current=window.setTimeout(Rm,Qfn))},[Rm,Nt]),s5=p.useCallback($=>{!$||!Nt||($f($),Lf(aa.current.filter(K=>K.id!==$)))},[$f,Lf,Nt]),iG=p.useCallback($=>{if(!Nt||$.length===0)return;const K=new Set($.map(te=>te.id));zd.current&&K.has(zd.current.id)&&$f(),Lf(aa.current.filter(te=>!K.has(te.id))),jO(te=>Object.fromEntries(Object.entries(te).filter(([me])=>!K.has(me)))),K.has(Ua)&&(kl(""),sa(null),Vl(null),Ho.current=null,localStorage.removeItem(rF(Nt)))},[$f,Lf,Ua,Nt]),rG=p.useCallback($=>{if(!$||!Nt)return;$f($);const K=Ho.current,te=aa.current.filter(me=>me.id!==$);Lf((K==null?void 0:K.id)===$?[K,...te]:te)},[$f,Lf,Nt]);p.useEffect(()=>(window.addEventListener("pagehide",Rm),()=>{window.removeEventListener("pagehide",Rm)}),[Rm]),p.useEffect(()=>{if(!Nt){$f(),aa.current=[],va([]),d2([]),kl(""),yr(""),Ho.current=null;return}let $=[],K="";try{$=Qcn(localStorage,Nt),localStorage.getItem(QL(Nt))!==null&&Uce(localStorage,Nt,$),K=localStorage.getItem(rF(Nt))||"",yr("")}catch(me){yr(me instanceof Error?me.message:Bt("errors.readDraftFailed"))}aa.current=$,va($),d2(Gfn(Nt));const te=$.find(me=>me.id===K);Ho.current=te??null,Ba==="custom"&&te&&(kl(te.id),sa(te.draft),Qd(X6(te)==="quick"?"vulcan":"traditional"),Vl(te.deploymentTarget??null))},[$f,Nt]),p.useEffect(()=>{if(!Nt)return;const $=rF(Nt);try{Ba==="custom"&&Ua?localStorage.setItem($,Ua):localStorage.removeItem($)}catch{yr(Bt("errors.saveDraftLocationRejected"))}},[Ba,Ua,Nt]);const OQe=p.useCallback($=>{if(!Nt)return;const K=[...new Set($.filter(Boolean))];d2(K),localStorage.setItem(CU(Nt),JSON.stringify(K))},[Nt]),kQe=p.useCallback(async $=>{const K=$.filter(it=>!!it.runtimeId&&it.canDelete===!0);if(K.length===0)return;const te=chn(Ku,i),me=new Set(K.map(it=>it.runtimeId));eG(it=>{const ut=new Set(it);for(const fn of me)ut.add(fn);return ut}),Jm(me);const De=new Set,ze=new Set,ve=new Set,at=[];for(const it of K)try{if(!it.region)throw new Error(Bt("errors.runtimeRegionMissingForDelete"));await S2e(it.runtimeId,it.region,{agentCategory:it.agentCategory,mpaInstanceId:it.agentCategory==="mpa"?it.mpaInstanceId??it.runtimeId:void 0}),yP(it.runtimeId),De.add(it.runtimeId),ze.add(it.id)}catch(ut){const fn=ut instanceof Error?ut.message:String(ut);ve.add(it.runtimeId),at.push(`${it.label}: ${fn}`)}if(De.size>0&&(Jm(De),LO(af()),$O(ut=>{if(!ut)return ut;const fn=new Set(ut);for(const Cn of De)fn.delete(Cn);return fn}),JK(ut=>Object.fromEntries(Object.entries(ut).filter(([fn])=>!De.has(fn)))),d2(ut=>{const fn=ut.filter(Cn=>!ze.has(Cn));return Nt&&localStorage.setItem(CU(Nt),JSON.stringify(fn)),fn}),Lf(aa.current.filter(ut=>{var fn;return!((fn=ut.deploymentTarget)!=null&&fn.runtimeId)||!De.has(ut.deploymentTarget.runtimeId)})),(te?De.has(te):K.some(ut=>ut.id===i))&&(XQe(),Nn(null),ms(!1),as(!1),di(!1),Xs(!1),kr(!1),Oo(null),oa(""),la(""),Dr(!0),Ye("")),Li!=null&&Li.runtime&&De.has(Li.runtime.runtimeId)&&(Nn(null),ms(!1),as(!1),di(!1),Xs(!1),Hd(),oa(""),la(""),Dr(!0),Ye(""))),ve.size>0&&eG(it=>{const ut=new Set(it);for(const fn of ve)ut.delete(fn);return ut}),at.length>0){const it=at.slice(0,3).join(";"),ut=at.length>3?Bt("errors.additionalAgentDeleteFailures",{count:at.length-3}):"";throw new Error(Bt("errors.agentDeleteFailures",{count:at.length,failures:it,suffix:ut}))}},[Li,i,Lf,Ku,Hd,Nt]),a5=p.useCallback(async()=>{XK(!0),YK("");try{const $=[];let K="";do{const te=await F0({scope:CO,region:"all",pageSize:100,nextToken:K});$.push(...te.runtimes),K=te.nextToken}while(K&&$.length<2e3);$O(new Set($.map(te=>te.runtimeId))),JK(Object.fromEntries($.map(te=>[te.runtimeId,{canDelete:te.canDelete,agentCategory:te.agentCategory,mpaInstanceId:te.mpaInstanceId}])))}catch($){YK($ instanceof Error?$.message:String($))}finally{XK(!1)}},[CO]);function SQe($){console.log("create agent draft:",$),Nn(null),Vh()}function o5($,K){console.log("Agent added, navigating to:",$,K),LO(af()),$O(null),Jm(),s5(Ua),kl(""),Ho.current=null,Vl(null),oa(""),la($),f2("basic"),Nn(null),kr(!0),r($)}const EQe=p.useCallback($=>{Nn(null),di(!1),Hd(),kr(!0),la(""),f2("basic"),oa($.id),Ye("")},[Hd]),FO=p.useCallback($=>{Rm();const K=Ua?{...$,draftId:Ua}:$;Ua&&jO(te=>({...te,[Ua]:$.id})),Ud(K)},[Ua,Rm,Ud]),w2=p.useCallback(async $=>{if(!$.runtimeId)throw new Error(Bt("errors.deploymentRuntimeIdMissing"));const K=Ua;K&&(s5(K),jO(ze=>{if(!ze[K])return ze;const ve={...ze};return delete ve[K],ve})),kl(""),Ho.current=null,Vl(null);const te=(Vd==null?void 0:Vd.region)??Fb,me=await GN($.runtimeId,$.runtimeName,$.region??te,$.version,{waitForReady:!0,agentName:$.agentName,agentCategory:$.mpaOperation?"mpa":"general",mpaInstanceId:$.mpaInstanceId});LO(af()),vo(ze=>ze+1);const De=await nF(me);Mi.current.set(me,De),ya(De),$O(ze=>{const ve=new Set(ze??[]);return ve.add($.runtimeId),ve}),Jm(),la(me),f2("basic"),oa(""),Nn(null),kr(!0),r(me)},[Ua,Fb,s5,Vd]),xv=p.useRef(null),l5=p.useRef(new Map),CQe=p.useRef(0),sG=p.useRef(new Map),qd=p.useMemo(()=>Lot(Sn,rp(i),wo||Bd),[Sn,i,Ku,wo,Bd]),aG=Ku.some($=>!!($.runtimeId&&$.region)&&$.apps.some(K=>bf($.id,K)===i));p.useLayoutEffect(()=>{const $=new Map;qd.forEach((K,te)=>{var ve;const me=((ve=K.meta)==null?void 0:ve.eventId)??"",De=!!(aG&&me&&qm(K)),ze=pue(K,te,qd.length,wo,Bd);$.set(te,{enabled:!!(De&&Wn!=="byteplus"&&!ze&&!oF(K)),turn:K,input:De?aF(qd,te):""})}),sG.current=$},[wo,Wn,Bd,aG,qd]);const oG=p.useCallback(()=>{var ve;const $=window.getSelection(),K=($==null?void 0:$.anchorNode)instanceof Element?$.anchorNode:(ve=$==null?void 0:$.anchorNode)==null?void 0:ve.parentElement,te=K==null?void 0:K.closest(".turn--assistant");if(!te)return;const me=Number(te.dataset.responseAnnotationIndex);if(!Number.isInteger(me))return;const De=sG.current.get(me);if(!(De!=null&&De.enabled))return;const ze=Ofn(te,$);ze&&lr({selectionId:++CQe.current,turn:De.turn,input:De.input,selectedText:ze.text,anchor:ze.anchor})},[]);p.useEffect(()=>{let $=null;const K=te=>{te.target instanceof Element&&te.target.closest(".response-annotation-popover")||($!==null&&window.cancelAnimationFrame($),$=window.requestAnimationFrame(()=>{$=null,oG()}))};return document.addEventListener("mouseup",K,!0),document.addEventListener("keyup",K,!0),()=>{$!==null&&window.cancelAnimationFrame($),document.removeEventListener("mouseup",K,!0),document.removeEventListener("keyup",K,!0)}},[oG]);const Im=p.useRef(!0),Pm=p.useRef(!1),Bb=p.useRef(null),lG=p.useRef({key:"",turnCount:0}),c5=(y==null?void 0:y.id)??l;p.useLayoutEffect(()=>{const $=xv.current,K=lG.current,te=K.key!==c5,me=!te&&Sn.length>K.turnCount;if(lG.current={key:c5,turnCount:Sn.length},!$||Sn.length===0||!te&&!me)return;Im.current=!0,Pm.current=!1,Bb.current!==null&&(window.clearTimeout(Bb.current),Bb.current=null);const De=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(te||De){$.scrollTop=$.scrollHeight;return}Pm.current=!0,$.scrollTo({top:$.scrollHeight,behavior:"smooth"}),Bb.current=window.setTimeout(()=>{Pm.current=!1,Bb.current=null;const ze=xv.current;ze&&Im.current&&(ze.scrollTop=ze.scrollHeight)},450)},[c5,Sn.length]),p.useLayoutEffect(()=>{const $=xv.current;!$||!Im.current||Pm.current||($.scrollTop=$.scrollHeight)},[wo,Sn]),p.useEffect(()=>{if(!MO||_m||Sn.length===0)return;const $=l5.current.get(MO);if(!$)return;Im.current=!1,$.scrollIntoView({behavior:"smooth",block:"center"});const K=window.setTimeout(()=>{h2("")},2600);return()=>window.clearTimeout(K)},[MO,_m,Sn]),p.useEffect(()=>()=>{Bb.current!==null&&window.clearTimeout(Bb.current)},[]);const AQe=p.useCallback(()=>{const $=xv.current;!$||Pm.current||(Im.current=$.scrollHeight-$.scrollTop-$.clientHeight<32)},[]),TQe=p.useCallback($=>{$.deltaY<0&&(Pm.current=!1,Im.current=!1)},[]),_Qe=p.useCallback(()=>{Pm.current=!1,Im.current=!1},[]),jQe=p.useCallback(()=>{const $=xv.current;!$||!Im.current||Pm.current||($.scrollTop=$.scrollHeight)},[]),u5=p.useCallback(()=>{Pi(null),N8().then($=>{gc($.userId),Hr($.info),Pr(!!$.local),xl($.status),$.status==="authenticated"&&!localStorage.getItem(kc.session)&&(x2.current=!0,vv.current=!0,localStorage.removeItem(kc.app),r(""),Nn(null),ms(!1),as(!1),di(!1),Xs(!1),kr(!1),Dr(!1))}).catch($=>{Pi($ instanceof Error?$.message:String($))})},[]);p.useEffect(()=>{u5()},[u5]),p.useEffect(()=>{const $=()=>{zl(""),Qu(!0)};return window.addEventListener(R8,$),ket()&&$(),()=>window.removeEventListener(R8,$)},[]);const NQe=p.useCallback(async()=>{if(Vu.current)return;Vu.current=!0;const $=met();if(!$){Vu.current=!1,zl(Bt("errors.loginPopupBlocked"));return}zu(!0),zl("");try{for(;;){await new Promise(K=>window.setTimeout(K,1e3));try{const K=await N8();if(K.status==="authenticated"){gc(K.userId),Hr(K.info),Pr(!!K.local),xl(K.status),Qu(!1),Eet(),$.close();return}}catch{}if($.closed){zl(Bt("errors.loginPopupClosed"));return}}}finally{Vu.current=!1,zu(!1)}},[]);p.useEffect(()=>{Uh&&Nt&&qZ(Nt)},[Uh,Nt]),p.useEffect(()=>{if(Ir!=="authenticated"||!Nt||no)return;const $=new URLSearchParams(window.location.search);if($.get("view")!=="runtime-deploy"||$.get("source")!=="intelligent-development")return;const K=$.get("sessionId")??"",te=$.get("artifactSha256")??"",me=$.get("validationReportSha256")??"",De=$.get("projectId")??"",ze=$.get("versionId")??"";if(!K||!te||!me)return;const ve=new AbortController;return(De&&ze?Yle(De,ze,K,te,me,ve.signal):Zle(K,te,me,ve.signal)).then(it=>{if(!ve.signal.aborted){if(!it.deployable){Ei(Bt("errors.sourceNotReady"));return}ks({...it,validatedAt:it.validatedAt||"",gateSummary:it.gateSummary||[]})}}).catch(it=>{ve.signal.aborted||Ei(it instanceof Error?it.message:String(it))}),()=>ve.abort()},[Ir,no,Nt]),p.useEffect(()=>{if(!Tm&&!["intelligent","migration"].includes(Ba??""))return;if(Ir!=="authenticated"||!Nt){qs(null),Ei(""),Lr(!0);return}const $=new AbortController;return Lr(!0),Ei(""),fetch(ja("/web/intelligent-development/capabilities"),{headers:fc({Accept:"application/json"}),signal:$.signal}).then(async K=>{if(!K.ok)throw new Error(Bt("errors.intelligentCapabilityCheckFailed",{status:K.status}));return K.json()}).then(K=>{if($.signal.aborted)return;const te={enabled:K.enabled===!0,reason:typeof K.reason=="string"?K.reason:"",projectStorageEnabled:K.projectStorageEnabled===!0,projectStorageReason:typeof K.projectStorageReason=="string"?K.projectStorageReason:""};if(K.model!==void 0){if(typeof K.model!="object"||K.model===null)throw new Error(Bt("errors.invalidIntelligentCapability"));const me=K.model;if(typeof me.configured=="boolean"&&typeof me.id=="string")te.model={configured:me.configured,id:me.id};else throw new Error(Bt("errors.invalidIntelligentCapability"))}qs(te)}).catch(K=>{$.signal.aborted||Ei(K instanceof Error?K.message:String(K))}).finally(()=>{$.signal.aborted||Lr(!1)}),()=>$.abort()},[Tm,Ir,Ba,Nt]),p.useEffect(()=>{if(Ir!=="authenticated"||!Nt){ya({});return}const $=h.current;if(($==null?void 0:$.agentId)===i&&$.userId===Nt)return;const K=Mi.current.get(i);if(K){ya(K);return}let te=!1;return ya({}),nF(i).then(me=>{te||(Mi.current.set(i,me),ya(me))}),()=>{te=!0}},[i,Ir,Nt]),p.useLayoutEffect(()=>{!Ms||ns.skillCustomizationEnabled!==!1||Rn!=="skill"||(ui("agent"),bt(null),_n(null))},[ns.skillCustomizationEnabled,Ms,Rn]),p.useEffect(()=>{if(Ir!=="authenticated"||!Nt){$h(null);return}let $=!1;return $h(null),c2e().then(K=>{$||$h(K)}).catch(K=>{console.warn("[app] /web/access failed; using ordinary-user access:",K),$||$h(l2e)}),()=>{$=!0}},[Ir,Nt]),p.useEffect(()=>{o2e().then($=>{const K="prod";Ctn({enabled:$.telemetry.enabled,environment:K});const te=$.telemetry.studio;Atn({userPoolId:(te==null?void 0:te.userPoolId)??"",studioDeployId:(te==null?void 0:te.deployId)??"",applicationId:(te==null?void 0:te.applicationId)??"",functionId:(te==null?void 0:te.functionId)??"",studioRegion:(te==null?void 0:te.region)??"",studioProject:(te==null?void 0:te.project)??"",studioVersion:(te==null?void 0:te.version)||$.version,environment:K,cloudProvider:$.provider,accountId:(te==null?void 0:te.accountId)??"",accountIdResolutionError:(te==null?void 0:te.accountIdResolutionError)??""}),_tn({authState:"anonymous"}),dv($.features),fv($.agentsSource),KT($.provider),GT((te==null?void 0:te.region)||Zi($.provider)),qu($.branding),AO($.version),XT(!0)})},[]),p.useEffect(()=>{if(Ir!=="authenticated"||!Vi||!Bn||!Mb)return;const $=String(Bn.telemetry.userId).trim();$&&(Ttn({userUniqueId:$,accountId:Bn.telemetry.accountId??"",userRole:Bn.role==="admin"||Bn.role==="super_admin"?"admin":"member",userSource:Uh?"local":"sso"}),jtn({agentsSource:Hu}))},[Bn,Hu,Ir,Uh,Mb,Vi]),p.useEffect(()=>{v2($=>{const K=Zi(Wn);return!$||Wn==="byteplus"&&$.startsWith("cn-")||Wn==="volcengine"&&$.startsWith("ap-")?K:$})},[Wn]),p.useEffect(()=>{Bn&&(Bn.capabilities.createAgents||(Nn(null),sa(null),as(!1),di(!1),s2([])),Bn.capabilities.manageAgents||kr(!1),Bn.capabilities.manageUsers||qo($=>$.filter(K=>K.page!=="users")),Bn.role!=="admin"&&Bn.role!=="super_admin"&&qo($=>$.filter(K=>K.page!=="review-center")))},[Bn]);let Wo={kind:"home"};if(Ir==="authenticated"){if(cr!==null)Wo={kind:"page",title:e("titles.issueFeedback")};else if(m2)Wo={kind:"page",title:e("title",{ns:"users"})};else if(e5)Wo={kind:"page",title:e("titles.systemInfo")};else if(g2)Wo={kind:"page",title:e("titles.reviewCenter")};else if(y2)Wo={kind:"page",title:e("titles.cronJobs")};else if(yc)Wo={kind:"page",title:yc==="catalog"?e("titles.automations"):e(`cards.${yc}.name`,{ns:"automations"})};else if(wt)Wo={kind:"page",title:wt.session.displayName||e("titles.agent")};else if(mt)Wo={kind:"page",title:mt.displayName||e("titles.agent")};else if(Gc||_m)Wo={kind:"page",title:(Li==null?void 0:Li.name)||e("titles.agent")};else if(Tm)Wo={kind:"page",title:e("titles.createAgent")};else if(DO)Wo={kind:"page",title:e("titles.search")};else if(gv)Wo={kind:"page",title:e("titles.addAgent")};else if(Am)Wo={kind:"page",title:GL||e("titles.library")};else if(Ba)Wo={kind:"page",title:Ba==="custom"?Vd!=null&&Vd.name?e("titles.updateAgent",{name:Vd.name}):e("titles.createAgent"):e(Ba==="deepseek"?"deepseek:pageTitle":Ba==="package"?"titles.addFromPackage":Ba==="workspace"?"titles.codeProjects":"titles.migrateAgent")};else if(y){const $=Ri.threads.find(K=>K.id===y.threadId);Wo={kind:"conversation",title:($==null?void 0:$.name)||($==null?void 0:$.preview)||y.displayName}}else if(l){const $=s.find(me=>me.id===l),K=e("titles.newConversation"),te=nM($==null?void 0:$.events,K);Wo=te===K?{kind:"home"}:{kind:"conversation",title:te}}}const cG=Enn($s.title,Wo);p.useEffect(()=>{Ir!=="authenticated"||Hu!=="cloud"||!Mb||!_m||Li||a5()},[Li,Hu,Ir,_m,a5,Mb]),p.useEffect(()=>{document.title=cG;let $=document.querySelector('link[rel~="icon"]');$||($=document.createElement("link"),$.rel="icon",document.head.appendChild($)),$.removeAttribute("type"),$.href=$s.logoUrl||(Wn==="byteplus"?aH:hM)},[Wn,$s.logoUrl,cG]),p.useEffect(()=>{fetch("/web/runtime-config",{signal:AbortSignal.timeout(1e4)}).then($=>$.ok?$.json():null).then($=>{$&&l2(!!$.credentials)}).catch($=>{console.warn("[app] /web/runtime-config probe failed; workbench stays hidden:",$)})},[]);function RQe($){qZ($),x2.current=!0,vv.current=!0,localStorage.removeItem(kc.app),$h(null),Nn(null),sa(null),ms(!1),as(!1),di(!1),Xs(!1),kr(!1),Vh(),r(""),Dr(!1),gc($),Hr({name:$}),Pr(!0),xl("authenticated")}function IQe(){$h(null),Uh?(het(),gc(""),Hr(void 0),xl("unauthenticated")):bet()}p.useEffect(()=>{if(Ir==="authenticated"){if(Hu==="cloud"){const $=Oue(Ku);r(K=>K&&$.includes(K)?K:(K&&(vv.current=!0,localStorage.removeItem(kc.app)),""));return}XAe().then($=>{n($);const K=Oue(Ku);r(te=>te&&($.includes(te)||K.includes(te))?te:(te&&(vv.current=!0,localStorage.removeItem(kc.app)),""))}).catch($=>Ye(String($)))}},[Ir,Hu,Ku]),p.useEffect(()=>{i?(vv.current=!1,localStorage.setItem(kc.app,i)):localStorage.removeItem(kc.app)},[i]),p.useEffect(()=>{const $=h.current;if(($==null?void 0:$.agentId)===i&&$.userId===Nt){ra.current=i,Re(!1);return}let K=!1;const te=new AbortController;if(ra.current!==i&&Bl(null),ra.current=i,ia(au()),Ir!=="authenticated"||Gc||Li||!i){Re(!1);return}return Re(!0),$8(i,te.signal).then(me=>{K||Bl(me)}).catch(()=>{K||Bl(me=>(me==null?void 0:me.agentCategory)==="mpa"?{...me,mpa:{agentsMd:null,agentsMdStatus:"error",skillSpaces:[],skillSpacesStatus:"error"}}:null)}).finally(()=>{K||Re(!1)}),()=>{K=!0,te.abort()}},[Li,i,Kc,Ir,Gc]),p.useEffect(()=>{Bn&&localStorage.setItem(kc.view,Bn.capabilities.createAgents?Ba??"chat":"chat")},[Bn,Ba]),p.useEffect(()=>{localStorage.setItem(kc.session,l),$e.current=l},[l]),p.useEffect(()=>{const $=kue(Ku,i);if(!$||!Nt){ss.current=()=>{},Wt(fi=>fi.size===0?fi:new Set);return}const{runtimeId:K,region:te,appName:me}=$;let De=!1,ze=0;function ve(){ai.current!==void 0&&(window.clearTimeout(ai.current),ai.current=void 0)}function at(fi){ve(),ai.current=window.setTimeout(()=>void ut(),fi)}function it(fi){const xi=new Set(fi.items.filter(Hi=>Hi.state==="running").map(Hi=>Hi.sessionId));if(Wt(Hi=>Hi.size===xi.size&&[...xi].every($i=>Hi.has($i))?Hi:xi),xi.size>0){at(zfn);return}const ur=fi.items.filter(Hi=>Hi.state==="pending").map(Hi=>Date.parse(Hi.dueAt)).filter(Number.isFinite);ur.length>0&&at(Math.max(Vfn,Math.min(...ur)-Date.now()))}async function ut(){const fi=++ze;try{const xi=await P8({runtimeId:K,region:te,appName:me,userId:Nt});if(De||fi!==ze)return;it(xi)}catch{!De&&fi===ze&&at(uue)}}const fn=()=>{ve(),ut()};ss.current=fn;const Cn=h.current;return(Cn==null?void 0:Cn.agentId)===i&&Cn.userId===Nt?Cn.automaticEvaluationStatuses?it(Cn.automaticEvaluationStatuses):at(uue):fn(),()=>{De=!0,ze+=1,ve(),ss.current===fn&&(ss.current=()=>{})}},[i,Ku,Nt]),p.useEffect(()=>()=>{f.current+=1,h.current=null},[]),p.useEffect(()=>()=>bn.current.forEach($=>$.abort()),[]),p.useEffect(()=>()=>Mn.current.forEach($=>{window.clearTimeout($)}),[]),p.useEffect(()=>()=>{var $,K,te;($=We.current)==null||$.abort(),(K=He.current)==null||K.abort(),(te=et.current)==null||te.abort()},[]),p.useEffect(()=>{if(Gc||Li||y||!i||!Nt)return;const $=h.current;if(($==null?void 0:$.agentId)===i&&$.userId===Nt){h.current=null;return}let K=!1;return(async()=>{const te=await wv(i);if(!K){if(!x2.current){x2.current=!0;const me=localStorage.getItem(kc.session)||"";if(mue()===null&&me&&te.some(De=>De.id===me)){UO(me);return}}Vh()}})(),()=>{K=!0}},[Li,i,Gc,y,Nt]),p.useEffect(()=>{const $=n5.current;$&&$.app===i&&(n5.current=null,UO($.sid))},[i]);function uG($,K){Xs(!1),$===i?UO(K):(n5.current={app:$,sid:K},r($))}function dG($,K){on(te=>{const me={...te};for(const De of K)me[qk($,De.id)]=YJ(De.events??[]);return me}),o(K)}async function wv($){const K=d.current+1;d.current=K;try{const te=await cue($,Nt);return d.current!==K||dG($,te),te}catch(te){return d.current===K&&Ye(String(te)),[]}}async function d5($,K,te){try{const me=await eC($,Nt,K),De=see(me.events??[],me.state,{mpaA2a:rp($)});cn(ze=>{const ve=ze[K]??[],at=Pot(ve,De,te);return at===ve?ze:{...ze,[K]:at}})}catch{}}function f5($="codex",K=!1){var De;if(y)return;Ye(""),pe(""),be("confirm"),je($),Ee(!1),_e(Bt("sandbox.checkingPersistence")),le(!1),Oe("snapshot"),qe(10),ye(5),Ae(100),(De=kt.current)==null||De.abort();const te=new AbortController;kt.current=te,($==="codex"?PUe(te.signal):DUe($,te.signal)).then(ze=>{te.signal.aborted||(Ee(ze.persistentEnabled===!0),_e(ze.persistentReason??""),le(ze.persistentRequired===!0),Oe(ze.storageMode??"snapshot"),qe(ze.diskGbDefault??10),ye(ze.diskGbMin??5),Ae(ze.diskGbMax??100))}).catch(ze=>{(ze==null?void 0:ze.name)!=="AbortError"&&(Ee(!1),_e(Bt("sandbox.persistenceUnknown")))}),Be(K),ie(!0)}function PQe(){var $,K;($=kt.current)==null||$.abort(),kt.current=null,(K=We.current)==null||K.abort(),We.current=null,ie(!1),be("confirm"),pe(""),!y&&Si!=="agent"&&!Ve&&Qn("agent")}async function DQe($,K,te){var ze;(ze=We.current)==null||ze.abort();const me=new AbortController;We.current=me,be("loading"),pe("");const De=Ntn({sandboxKind:ke,sandboxSource:Ve?"my_agents":"new_chat"});try{const ve=ke==="codex"?await Ur.startSession({displayName:$,persistent:K,diskGb:te,signal:me.signal}):await Ur.startAgentSession(ke,{displayName:$,persistent:K,diskGb:te,signal:me.signal});if(We.current!==me){De.fail({errorKind:"abort"});return}if(De.succeed({sandboxId:String(ve.id)}),Ve){Et(it=>it+1),ie(!1),be("confirm"),Dr(!0);return}if(ke!=="codex"){const it=await Ur.openAgentSession(ke,ve.id,{signal:me.signal});if(We.current!==me)return;$e.current="",c(""),v([]),Fn(""),ia(au()),Qn(ke==="deepseek-harness"?"deepseek-harness":"agent"),hv(Vr),hs([]),yt(),O([]),w(null),Nn(null),ms(!1),as(!1),di(!1),Xs(!1),kr(!1),Oo(null),Dr(!1),Ne(null),jt(it),ie(!1),be("confirm");return}const at=await Ur.connectSession(ve.id,{signal:me.signal});if(We.current!==me)return;$e.current="",c(""),v([]),Fn(""),ia(au()),Qn("temporary"),hv(Vr),hs([]),yt(),O([]),w(at),Nn(null),ms(!1),as(!1),di(!1),Xs(!1),kr(!1),Oo(null),Dr(!1),Ne(null),jt(null),ie(!1),be("confirm")}catch(ve){if(De.fail(Xo(ve)),(ve==null?void 0:ve.name)==="AbortError"||We.current!==me)return;pe(ve instanceof Error?ve.message:String(ve)),be("error")}finally{We.current===me&&(We.current=null)}}function fG($,K){$e.current="",c(""),v([]),Fn(""),ia(au()),hv(Vr),hs([]),yt(),O(K),ft.current=$.id,w($),S($.busy),Nn(null),ms(!1),as(!1),di(!1),Xs(!1),kr(!1),Oo(null),Dr(!1),qo([]),Qa(null),Xc(!1),Ne(null),jt(null)}async function hG($,K){const te=await _v.connectSession($,{signal:K});K.aborted||(Ye(""),fl(void 0),fG(te,[]))}async function O2($,K="my_agents"){Ye("");const te=Sj({targetId:String($.id),agentKind:$.toolName,connectSource:K});try{const me=$.resourceType==="snapshot"?await Ur.resumeSnapshot($.toolName,$.snapshotId):$;if($.resourceType==="snapshot"&&Et(ze=>ze+1),me.toolName==="codex"){const ze=await Ur.connectSession(me.id),ve=await fue(ze);te.succeed({sandboxStatus:sF(ze.status)}),$e.current="",c(""),v([]),Fn(""),ia(au()),yt(),ve?(O(iF(ve,ze.busy)),w({...ze,threadId:ve.threadId,cwd:ve.cwd??ze.cwd,workspaceLocked:ve.workspaceLocked,permissions:ve.permissions,...ve.model?{model:ve.model}:{}})):(O([]),w(ze)),S(ze.busy),Nm("sandbox-agent-detail"),Ne(null),jt(null),Dr(!1),kr(!1);return}const De=await Ur.openAgentSession(me.toolName,me.id);te.succeed({sandboxStatus:sF(De.session.status)}),Nm("sandbox-agent-detail"),jt(De),Ne(null),Dr(!1),kr(!1)}catch(me){throw te.fail(Xo(me)),Ye(me instanceof Error?me.message:String(me)),me}}async function MQe($){const te=(await Ur.listSessions()).find(me=>me.resourceType==="session"&&me.toolName==="codex"&&me.id===$);if(!te)throw new Error(Bt("errors.cloudCodexSessionMissing"));await O2(te,"my_agents"),Pt(!1)}async function pG($,K="my_agents"){Ye("");const te=Sj({targetId:String($),agentKind:"codex",connectSource:K});try{const me=await Ur.connectSession($),De=await fue(me);te.succeed({sandboxStatus:sF(me.status)}),$e.current="",c(""),v([]),Fn(""),ia(au()),yt(),De?(O(iF(De,me.busy)),w({...me,threadId:De.threadId,cwd:De.cwd??me.cwd,workspaceLocked:De.workspaceLocked,permissions:De.permissions,...De.model?{model:De.model}:{}})):(O([]),w(me)),S(me.busy),Nn(null),ms(!1),as(!1),di(!1),Xs(!1),kr(!1),Oo(null),Dr(!1),Qa(null),Xc(!1),Ne(null),jt(null)}catch(me){throw te.fail(Xo(me)),Ye(me instanceof Error?me.message:String(me)),me}}function LQe($){tt($.toolName),b2({page:"sandbox-agent-detail",returnTo:"agents"}),Ne($),jt(null),Dr(!0),kr(!1),Ye("")}async function $Qe($){$.resourceType==="snapshot"?await Ur.deleteSnapshot($.toolName,$.snapshotId):((y==null?void 0:y.id)===$.id&&Yc(),$.toolName==="codex"?await Ur.deleteSession($.id):await Ur.deleteAgentSession($.toolName,$.id)),tt($.toolName),Nm("sandbox-agent-detail"),Ne(null),jt(null),Et(K=>K+1),Dr(!0)}async function FQe(){const $=Yt;if(!$)return;await Ri.deleteThread($.id)&&wn(null)}function Yc($=!0){var te;(te=et.current)==null||te.abort(),et.current=null,ft.current="",St.current="",S(!1),yt(),O([]),hs([]),Fn(""),Ye(""),Qn("agent"),E(!1),T(""),A(!1),P(!1),D(null),L(null),M(!1),q(""),J(null),Z(!1),W(""),nn(),wn(null),H(!1),Ct.current+=1;const K=y;w(null),K&&$&&!K.intelligentDevelopment&&(K.intelligentDevelopment?_v:Ur).closeSession(K.id).catch(De=>Ye(String(De)))}async function h5($){const K=y;if(K){D($),L(null),q(""),M(!0);try{const te=$==="terminal"?await Mf.launchTerminal(K.id):await Mf.launchBrowser(K.id);L(te)}catch(te){q(te instanceof Error?te.message:String(te))}finally{M(!1)}}}async function BQe(){var K;const $=y;if(!(!$||se==="copying")){Y("copying"),Ye("");try{if(!((K=navigator.clipboard)!=null&&K.writeText))throw new Error(Bt("errors.clipboardUnsupported"));const te=await Ur.getEndpoint($.id);if(await navigator.clipboard.writeText(te.endpoint),ft.current!==$.id)return;Y("copied"),It.current!==void 0&&window.clearTimeout(It.current),It.current=window.setTimeout(()=>{Y("idle"),It.current=void 0},1600)}catch(te){if(ft.current!==$.id)return;Y("idle"),Ye(te instanceof Error?te.message:String(te))}}}async function UQe($){const K=y;if(!(!K||C)){E(!0),T("");try{const te=await Mf.updatePermissions(K.id,$);w(me=>(me==null?void 0:me.id)===K.id?{...me,permissions:te}:me),Pn(K.id,Bt("sandbox.permissionsUpdated"),[{label:Bt("sandbox.labels.mode"),value:Bt(rhn[te.sandboxMode])},{label:Bt("sandbox.labels.approvalPolicy"),value:Bt(shn[te.approvalPolicy])},{label:Bt("sandbox.labels.reviewer"),value:Bt(ahn[te.approvalsReviewer])},{label:Bt("sandbox.labels.networkAccess"),value:Bt(te.networkAccess?"sandbox.network.allowed":"sandbox.network.disabled")}]),ft.current===K.id&&A(!1)}catch(te){T(te instanceof Error?te.message:String(te))}finally{E(!1)}}}const QQe=p.useCallback(async $=>{const K=y==null?void 0:y.id;if(!K)throw new Error(Bt("errors.noConnectedSandbox"));return Mf.listDirectories(K,$)},[y==null?void 0:y.id]);async function zQe($){const K=y;if(!(!K||K.workspaceLocked||C)){E(!0),T("");try{const te=await Mf.updateWorkspace(K.id,$);w(me=>(me==null?void 0:me.id)===K.id?{...me,cwd:te}:me),Ri.invalidateSkills(),Pn(K.id,Bt("sandbox.workspaceUpdated"),[{label:Bt("sandbox.labels.workingDirectory"),value:te,code:!0}]),ft.current===K.id&&P(!1)}catch(te){T(te instanceof Error?te.message:String(te))}finally{E(!1)}}}async function VQe($){const K=y,te=U;if(!(!K||!te||V)){Z(!0),W("");try{await Mf.resolveApproval(K.id,te.id,$),Pn(K.id,ohn(te,$),lhn(te),St.current),J(me=>(me==null?void 0:me.id)===te.id?null:me)}catch(me){W(me instanceof Error?me.message:String(me))}finally{Z(!1)}}}async function HQe($){const K=y;if(!K||G)return;const te=++Ct.current;Ye(""),H(!0);const me=Array.from($).map(De=>{const ze={id:xue(),mimeType:wue(De),name:De.name,sizeBytes:De.size,status:"uploading",previewUrl:Ge(De)};return{file:De,attachment:ze}});hs(De=>[...De,...me.map(({attachment:ze})=>ze)]);try{const ze=(await Promise.all(me.map(async({file:ve,attachment:at})=>{try{const it=await Mf.uploadFile(K.id,ve);return Ct.current!==te?null:(hs(ut=>ut.map(fn=>fn.id===at.id?{...fn,id:it.id,uri:it.path,name:it.name,mimeType:it.mimeType,sizeBytes:it.sizeBytes,status:"ready"}:fn)),it)}catch(it){if(Ct.current!==te)return null;const ut=it instanceof Error?it.message:String(it);return hs(fn=>fn.map(Cn=>Cn.id===at.id?{...Cn,status:"error",error:ut}:Cn)),Ye(ut),null}}))).filter(ve=>ve!==null);Ct.current===te&&ze.length>0&&Pn(K.id,ze.length===1?Bt("sandbox.fileUploaded"):Bt("sandbox.filesUploaded",{count:ze.length}),ze.map((ve,at)=>({label:ze.length===1?Bt("sandbox.labels.file"):Bt("sandbox.labels.fileNumber",{number:at+1}),value:ve.path,code:!0})))}finally{if(Ct.current===te)H(!1);else for(const{attachment:De}of me)xt(De.previewUrl)}}function qQe($){const K=Vr.find(te=>te.id===$);K&&(xt(K.previewUrl),hs(te=>te.filter(me=>me.id!==$)))}function WQe(){const $=et.current,K=y;if(K!=null&&K.intelligentDevelopment){so.stop();return}$&&($.abort(),K&&Ur.interruptSession(K.id).catch(te=>{ft.current===K.id&&Ye(te instanceof Error?te.message:String(te))}))}function Hl($){$()}async function k2($,K=[],te=[],me){var vr;const De=me??y;if(De!=null&&De.intelligentDevelopment){await so.submit($.trim(),De.id)&&Fn(oi=>oi===$?"":oi);return}const ze=K.filter(rn=>rn.status==="ready"&&rn.uri);if(!De||k||!$.trim()&&ze.length===0)return;Ye(""),J(null),W("");const ve=hle({agentId:String(De.id),agentKind:De.toolName,messageSource:"composer",sessionState:"existing",sessionId:String(De.id)}),at=new AbortController;(vr=et.current)==null||vr.abort(),et.current=at;const it=[];te.length>0&&it.push({kind:"invocation",value:{skills:te.map(({name:rn,description:oi})=>({name:rn,description:oi}))}}),ze.length>0&&it.push({kind:"attachment",files:ze.map(rn=>({id:rn.id,mimeType:rn.mimeType,name:rn.name,sizeBytes:rn.sizeBytes,previewUrl:rn.previewUrl}))}),$.trim()&&it.push({kind:"text",text:$});const ut=ze.map(rn=>rn.uri).filter(rn=>!!rn),Cn=[te.map(rn=>`$${rn.name}`).join(" "),$.trim()].filter(Boolean).join(" "),fi=ut.length>0?[Cn,Bt("sandbox.uploadedFilesPrompt"),...ut.map(rn=>`- ${rn}`)].filter(Boolean).join(` diff --git a/veadk/webui/assets/chunks/CodeDiffEditor-DA-6OJrJ.js b/veadk/webui/assets/chunks/CodeDiffEditor-Dvmt5gm9.js similarity index 99% rename from veadk/webui/assets/chunks/CodeDiffEditor-DA-6OJrJ.js rename to veadk/webui/assets/chunks/CodeDiffEditor-Dvmt5gm9.js index 7dd8aeba2..ba4f0ef8a 100644 --- a/veadk/webui/assets/chunks/CodeDiffEditor-DA-6OJrJ.js +++ b/veadk/webui/assets/chunks/CodeDiffEditor-Dvmt5gm9.js @@ -1,3 +1,3 @@ -import{T as Fe,k as $,h as L,E as te,d as Ve,w as R,C as Ie,x as W,ak as je,M as at,F as Ue,y as dt,D as B,o as G,G as oe,W as J,at as ft,an as ht,R as We,ao as ct,as as ne,p as ut,au as He,aD as Q,aA as mt,N as gt}from"../app/index-BNPwMQXG.js";class v{constructor(e,n,l,r){this.fromA=e,this.toA=n,this.fromB=l,this.toB=r}offset(e,n=e){return new v(this.fromA+e,this.toA+e,this.fromB+n,this.toB+n)}}function y(t,e,n,l,r,i){if(t==l)return[];let s=de(t,e,n,l,r,i),o=fe(t,e+s,n,l,r+s,i);e+=s,n-=o,r+=s,i-=o;let d=n-e,h=i-r;if(!d||!h)return[new v(e,n,r,i)];if(d>h){let f=t.slice(e,n).indexOf(l.slice(r,i));if(f>-1)return[new v(e,e+f,r,r),new v(e+f+h,n,i,i)]}else if(h>d){let f=l.slice(r,i).indexOf(t.slice(e,n));if(f>-1)return[new v(e,e,r,r+f),new v(n,n,r+f+d,i)]}if(d==1||h==1)return[new v(e,n,r,i)];let a=qe(t,e,n,l,r,i);if(a){let[f,c,u]=a;return y(t,e,f,l,r,c).concat(y(t,f+u,n,l,c+u,i))}return pt(t,e,n,l,r,i)}let I=1e9,j=0,ae=!1;function pt(t,e,n,l,r,i){let s=n-e,o=i-r;if(I<1e9&&Math.min(s,o)>I*16||j>0&&Date.now()>j)return Math.min(s,o)>I*64?[new v(e,n,r,i)]:ge(t,e,n,l,r,i);let d=Math.ceil((s+o)/2);X.reset(d),ee.reset(d);let h=(u,m)=>t.charCodeAt(e+u)==l.charCodeAt(r+m),a=(u,m)=>t.charCodeAt(n-u-1)==l.charCodeAt(i-m-1),f=(s-o)%2!=0?ee:null,c=f?null:X;for(let u=0;uI||j>0&&!(u&63)&&Date.now()>j)return ge(t,e,n,l,r,i);let m=X.advance(u,s,o,d,f,!1,h)||ee.advance(u,s,o,d,c,!0,a);if(m)return Ct(t,e,n,e+m[0],l,r,i,r+m[1])}return[new v(e,n,r,i)]}class Pe{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let n=0;nn)this.end+=2;else if(f>l)this.start+=2;else if(i){let c=r+(n-l)-d;if(c>=0&&c=n-a)return[u,r+u-c]}else{let u=n-i.vec[c];if(a>=u)return[a,f]}}}return null}}const X=new Pe,ee=new Pe;function Ct(t,e,n,l,r,i,s,o){let d=!1;return!N(t,l)&&++l==n&&(d=!0),!N(r,o)&&++o==s&&(d=!0),d?[new v(e,n,i,s)]:y(t,e,l,r,i,o).concat(y(t,l,n,r,o,s))}function ze(t,e){let n=1,l=Math.min(t,e);for(;nn||a>i||t.slice(o,h)!=l.slice(d,a)){if(s==1)return o-e-(N(t,o)?0:1);s=s>>1}else{if(h==n||a==i)return h-e;o=h,d=a}}}function fe(t,e,n,l,r,i){if(e==n||r==i||t.charCodeAt(n-1)!=l.charCodeAt(i-1))return 0;let s=ze(n-e,i-r);for(let o=n,d=i;;){let h=o-s,a=d-s;if(h>1}else{if(h==e||a==r)return n-h;o=h,d=a}}}function ie(t,e,n,l,r,i,s,o){let d=l.slice(r,i),h=null;for(;;){if(h||s=n)break;let c=t.slice(a,f),u=-1;for(;(u=d.indexOf(c,u+1))!=-1;){let m=de(t,f,n,l,r+u+c.length,i),p=fe(t,e,a,l,r,r+u),g=c.length+m+p;(!h||h[2]>1}}function qe(t,e,n,l,r,i){let s=n-e,o=i-r;if(sr.fromA-e&&l.toB>r.fromB-e&&(t[n-1]=new v(l.fromA,r.toA,l.fromB,r.toB),t.splice(n--,1))}}function vt(t,e,n){for(;;){_e(n,1);let l=!1;for(let r=0;r3||o>3){let d=r==t.length-1?e.length:t[r+1].fromA,h=i.fromA-l,a=d-i.toA,f=Ce(e,i.fromA,h),c=pe(e,i.toA,a),u=i.fromA-f,m=c-i.toA;if((!s||!o)&&u&&m){let p=Math.max(s,o),[g,C,S]=s?[e,i.fromA,i.toA]:[n,i.fromB,i.toB];p>u&&e.slice(f,i.fromA)==g.slice(S-u,S)?(i=t[r]=new v(f,f+s,i.fromB-u,i.toB-u),f=i.fromA,c=pe(e,i.toA,d-i.toA)):p>m&&e.slice(i.toA,c)==g.slice(C,C+m)&&(i=t[r]=new v(c-s,c,i.fromB+m,i.toB+m),c=i.toA,f=Ce(e,i.fromA,i.fromA-l)),u=i.fromA-f,m=c-i.toA}if(u||m)i=t[r]=new v(i.fromA-u,i.toA+m,i.fromB-u,i.toB+m);else if(s){if(!o){let p=Ae(e,i.fromA,i.toA),g,C=p<0?-1:ve(e,i.toA,i.fromA);p>-1&&(g=p-i.fromA)<=a&&e.slice(i.fromA,p)==e.slice(i.toA,i.toA+g)?i=t[r]=i.offset(g):C>-1&&(g=i.toA-C)<=h&&e.slice(i.fromA-g,i.fromA)==e.slice(C,i.toA)&&(i=t[r]=i.offset(-g))}}else{let p=Ae(n,i.fromB,i.toB),g,C=p<0?-1:ve(n,i.toB,i.fromB);p>-1&&(g=p-i.fromB)<=a&&n.slice(i.fromB,p)==n.slice(i.toB,i.toB+g)?i=t[r]=i.offset(g):C>-1&&(g=i.toB-C)<=h&&n.slice(i.fromB-g,i.fromB)==n.slice(C,i.toB)&&(i=t[r]=i.offset(-g))}}l=i.toA}return _e(t,3),t}let O;try{O=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function Qe(t){return t>48&&t<58||t>64&&t<91||t>96&&t<123}function Ye(t,e){if(e==t.length)return 0;let n=t.charCodeAt(e);return n<192?Qe(n)?1:0:O?!Ke(n)||e==t.length-1?O.test(String.fromCharCode(n))?1:0:O.test(t.slice(e,e+2))?2:0:0}function $e(t,e){if(!e)return 0;let n=t.charCodeAt(e-1);return n<192?Qe(n)?1:0:O?!Ze(n)||e==1?O.test(String.fromCharCode(n))?1:0:O.test(t.slice(e-2,e))?2:0:0}const Je=8;function pe(t,e,n){if(e==t.length||!$e(t,e))return e;for(let l=e,r=e+n,i=0;ir)return l;l+=s}return e}function Ce(t,e,n){if(!e||!Ye(t,e))return e;for(let l=e,r=e-n,i=0;it>=55296&&t<=56319,Ze=t=>t>=56320&&t<=57343;function N(t,e){return!e||e==t.length||!Ke(t.charCodeAt(e-1))||!Ze(t.charCodeAt(e))}function xt(t,e,n){var l;let r=n==null?void 0:n.override;return r?r(t,e):(I=((l=n==null?void 0:n.scanLimit)!==null&&l!==void 0?l:1e9)>>1,j=n!=null&&n.timeout?Date.now()+n.timeout:0,ae=!1,vt(t,e,y(t,0,t.length,e,0,e.length)))}function Xe(){return!ae}function et(t,e,n){return At(xt(t,e,n),t,e)}const b=Ue.define({combine:t=>t[0]}),re=R.define(),tt=Ue.define(),k=W.define({create(t){return null},update(t,e){for(let n of e.effects)n.is(re)&&(t=n.value);for(let n of e.state.facet(tt))t=n(t,e);return t}});class E{constructor(e,n,l,r,i,s=!0){this.changes=e,this.fromA=n,this.toA=l,this.fromB=r,this.toB=i,this.precise=s}offset(e,n){return e||n?new E(this.changes,this.fromA+e,this.toA+e,this.fromB+n,this.toB+n,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,n,l){let r=et(e.toString(),n.toString(),l);return nt(r,e,n,0,0,Xe())}static updateA(e,n,l,r,i){return Be(be(e,r,!0,l.length),e,n,l,i)}static updateB(e,n,l,r,i){return Be(be(e,r,!1,n.length),e,n,l,i)}}function xe(t,e,n,l){let r=n.lineAt(t),i=l.lineAt(e);return r.to==t&&i.to==e&&tf+1&&g>c+1)break;u.push(m.offset(-h+l,-a+r)),[f,c]=we(m.toA+l,m.toB+r,e,n),o++}s.push(new E(u,h,Math.max(h,f),a,Math.max(a,c),i))}return s}const H=1e3;function ke(t,e,n,l){let r=0,i=t.length;for(;;){if(r==i){let a=0,f=0;r&&({toA:a,toB:f}=t[r-1]);let c=e-(n?a:f);return[a+c,f+c]}let s=r+i>>1,o=t[s],[d,h]=n?[o.fromA,o.toA]:[o.fromB,o.toB];if(d>e)i=s;else if(h<=e)r=s+1;else return l?[o.fromA,o.fromB]:[o.toA,o.toB]}}function be(t,e,n,l){let r=[];return e.iterChangedRanges((i,s,o,d)=>{let h=0,a=n?e.length:l,f=0,c=n?l:e.length;i>H&&([h,f]=ke(t,i-H,n,!0)),s=h?r[r.length-1]={fromA:m.fromA,fromB:m.fromB,toA:a,toB:c,diffA:m.diffA+p,diffB:m.diffB+g}:r.push({fromA:h,toA:a,fromB:f,toB:c,diffA:p,diffB:g})}),r}function Be(t,e,n,l,r){if(!t.length)return e;let i=[];for(let s=0,o=0,d=0,h=0;;s++){let a=s==t.length?null:t[s],f=a?a.fromA+o:n.length,c=a?a.fromB+d:l.length;for(;hf||g.toB+d>c))break;i.push(g.offset(o,d)),h++}if(!a)break;let u=a.toA+o+a.diffA,m=a.toB+d+a.diffB,p=et(n.sliceString(f,u),l.sliceString(c,m),r);for(let g of nt(p,n,l,f,c,Xe()))i.push(g);for(o+=a.diffA,d+=a.diffB;hu&&g.fromB+d>m)break;h++}}return i}const it={scanLimit:500},K=at.fromClass(class{constructor(t){({deco:this.deco,gutter:this.gutter}=Le(t))}update(t){(t.docChanged||t.viewportChanged||wt(t.startState,t.state)||kt(t.startState,t.state))&&({deco:this.deco,gutter:this.gutter}=Le(t.view))}},{decorations:t=>t.deco}),P=$.low(je({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(K))===null||e===void 0?void 0:e.gutter)||We.empty}}));function wt(t,e){return t.field(k,!1)!=e.field(k,!1)}function kt(t,e){return t.facet(b)!=e.facet(b)}const Me=B.line({class:"cm-changedLine"}),rt=B.mark({class:"cm-changedText"}),bt=B.mark({tagName:"ins",class:"cm-insertedLine"}),Bt=B.mark({tagName:"del",class:"cm-deletedLine"}),De=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function Mt(t,e,n,l,r,i){let s=n?t.fromA:t.fromB,o=n?t.toA:t.toB,d=0;if(s!=o){r.add(s,s,Me),r.add(s,o,n?Bt:bt),i&&i.add(s,s,De);for(let h=e.iterRange(s,o-1),a=s;!h.next().done;){if(h.lineBreak){a++,r.add(a,a,Me),i&&i.add(a,a,De);continue}let f=a+h.value.length;if(l)for(;d=a)break;(s?f.toA:f.toB)>h&&(!i||!i(t.state,f,o,d))&&Mt(f,t.state.doc,s,l,o,d)}return{deco:o.finish(),gutter:d&&d.finish()}}class z extends J{constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement("div");return e.className="cm-mergeSpacer",e.style.height=this.height+"px",e}updateDOM(e){return e.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}const Y=R.define({map:(t,e)=>t.map(e)}),U=W.define({create:()=>B.none,update:(t,e)=>{for(let n of e.effects)if(n.is(Y))return n.value;return t.map(e.changes)},provide:t=>L.decorations.from(t)}),q=.01;function Se(t,e){if(t.size!=e.size)return!1;let n=t.iter(),l=e.iter();for(;n.value;){if(n.from!=l.from||Math.abs(n.value.spec.widget.height-l.value.spec.widget.height)>1)return!1;n.next(),l.next()}return!0}function Dt(t,e,n){let l=new G,r=new G,i=t.state.field(U).iter(),s=e.state.field(U).iter(),o=0,d=0,h=0,a=0,f=t.viewport,c=e.viewport;for(let g=0;;g++){let C=gq&&(a+=w,r.add(d,d,B.widget({widget:new z(w),block:!0,side:-1})))}if(S>o+1e3&&of.from&&dc.from){let x=Math.min(f.from-o,c.from-d);o+=x,d+=x,g--}else if(C)o=C.toA,d=C.toB;else break;for(;i.value&&i.fromq&&r.add(e.state.doc.length,e.state.doc.length,B.widget({widget:new z(u),block:!0,side:1}));let m=l.finish(),p=r.finish();Se(m,t.state.field(U))||t.dispatch({effects:Y.of(m)}),Se(p,e.state.field(U))||e.dispatch({effects:Y.of(p)})}const le=R.define({map:(t,e)=>e.mapPos(t)});class Lt extends J{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let n=document.createElement("div");return n.className="cm-collapsedLines",n.textContent=e.state.phrase("$ unchanged lines",this.lines),n.addEventListener("click",l=>{let r=e.posAtDOM(l.target);e.dispatch({effects:le.of(r)});let{side:i,sibling:s}=e.state.facet(b);s&&s().dispatch({effects:le.of(St(r,e.state.field(k),i=="a"))})}),n}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function St(t,e,n){let l=0,r=0;for(let i=0;;i++){let s=i=t)return r+(t-l);[l,r]=n?[s.toA,s.toB]:[s.toB,s.toA]}}const Et=W.define({create(t){return B.none},update(t,e){t=t.map(e.changes);for(let n of e.effects)n.is(le)&&(t=t.update({filter:l=>l!=n.value}));if(t.size&&e.state.field(k)!=e.startState.field(k,!1)){let n=e.state.facet(b).side=="a",l=[];for(let r of e.state.field(k))t.between(n?r.fromA:r.fromB,n?r.toA:r.toB,i=>{l.push(i)});l.length&&(t=t.update({filter:r=>l.indexOf(r)<0}))}return t},provide:t=>L.decorations.from(t)});function se({margin:t=3,minSize:e=4}){return Et.init(n=>Ot(n,t,e))}function Ot(t,e,n){let l=new G,r=t.facet(b).side=="a",i=t.field(k),s=1;for(let o=0;;o++){let d=o=n&&l.add(t.doc.line(h).from,t.doc.line(a).to,B.replace({widget:new Lt(f),block:!0})),!d)break;s=t.doc.lineAt(Math.min(t.doc.length,r?d.toA:d.toB)).number}return l.finish()}const yt=L.styleModule.of(new dt({".cm-mergeView":{overflowY:"auto"},".cm-mergeViewEditors":{display:"flex",alignItems:"stretch"},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:"hidden"},".cm-merge-revert":{width:"1.6em",flexGrow:0,flexShrink:0,position:"relative"},".cm-merge-revert button":{position:"absolute",display:"block",width:"100%",boxSizing:"border-box",textAlign:"center",background:"none",border:"none",font:"inherit",cursor:"pointer"}})),lt=L.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat"},"&.cm-merge-b .cm-deletedText":{background:"#ff000033"},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer","&:before":{content:'"⦚"',marginInlineEnd:"7px"},"&:after":{content:'"⦚"',marginInlineStart:"7px"}},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"},".cm-inlineChangedLineGutter":{background:"#75d"}}),Ee=new Ve,_=new Ve;class Tt{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||it;let n=[$.low(K),lt,yt,U,L.updateListener.of(f=>{this.measuring<0&&(f.heightChanged||f.viewportChanged)&&!f.transactions.some(c=>c.effects.some(u=>u.is(Y)))&&this.measure()})],l=[b.of({side:"a",sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&l.push(P);let r=te.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],L.editorAttributes.of({class:"cm-merge-a"}),_.of(l),n]}),i=[b.of({side:"b",sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&i.push(P);let s=te.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],L.editorAttributes.of({class:"cm-merge-b"}),_.of(i),n]});this.chunks=E.build(r.doc,s.doc,this.diffConf);let o=[k.init(()=>this.chunks),Ee.of(e.collapseUnchanged?se(e.collapseUnchanged):[])];r=r.update({effects:R.appendConfig.of(o)}).state,s=s.update({effects:R.appendConfig.of(o)}).state,this.dom=document.createElement("div"),this.dom.className="cm-mergeView",this.editorDOM=this.dom.appendChild(document.createElement("div")),this.editorDOM.className="cm-mergeViewEditors";let d=e.orientation||"a-b",h=document.createElement("div");h.className="cm-mergeViewEditor";let a=document.createElement("div");a.className="cm-mergeViewEditor",this.editorDOM.appendChild(d=="a-b"?h:a),this.editorDOM.appendChild(d=="a-b"?a:h),this.a=new L({state:r,parent:h,root:e.root,dispatchTransactions:f=>this.dispatch(f,this.a)}),this.b=new L({state:s,parent:a,root:e.root,dispatchTransactions:f=>this.dispatch(f,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls=="b-to-a",e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,n){if(e.some(l=>l.docChanged)){let l=e[e.length-1],r=e.reduce((s,o)=>s.compose(o.changes),Ie.empty(e[0].startState.doc.length));this.chunks=n==this.a?E.updateA(this.chunks,l.newDoc,this.b.state.doc,r,this.diffConf):E.updateB(this.chunks,this.a.state.doc,l.newDoc,r,this.diffConf),n.update([...e,l.state.update({effects:re.of(this.chunks)})]);let i=n==this.a?this.b:this.a;i.update([i.state.update({effects:re.of(this.chunks)})]),this.scheduleMeasure()}else n.update(e)}reconfigure(e){if("diffConfig"in e&&(this.diffConf=e.diffConfig),"orientation"in e){let i=e.orientation!="b-a";if(i!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let s=this.a.dom.parentNode,o=this.b.dom.parentNode;s.remove(),o.remove(),this.editorDOM.insertBefore(i?s:o,this.editorDOM.firstChild),this.editorDOM.appendChild(i?o:s),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in e||"renderRevertControl"in e){let i=!!this.revertDOM,s=this.revertToA,o=this.renderRevert;"revertControls"in e&&(i=!!e.revertControls,s=e.revertControls=="b-to-a"),"renderRevertControl"in e&&(o=e.renderRevertControl),this.setupRevertControls(i,s,o)}let n="highlightChanges"in e,l="gutter"in e,r="collapseUnchanged"in e;if(n||l||r){let i=[],s=[];if(n||l){let o=this.a.state.facet(b),d=l?e.gutter!==!1:o.markGutter,h=n?e.highlightChanges!==!1:o.highlightChanges;i.push(_.reconfigure([b.of({side:"a",sibling:()=>this.b,highlightChanges:h,markGutter:d}),d?P:[]])),s.push(_.reconfigure([b.of({side:"b",sibling:()=>this.a,highlightChanges:h,markGutter:d}),d?P:[]]))}if(r){let o=Ee.reconfigure(e.collapseUnchanged?se(e.collapseUnchanged):[]);i.push(o),s.push(o)}this.a.dispatch({effects:i}),this.b.dispatch({effects:s})}this.scheduleMeasure()}setupRevertControls(e,n,l){this.revertToA=n,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=l,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement("div"),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener("mousedown",r=>this.revertClicked(r)),this.revertDOM.className="cm-merge-revert"):this.revertDOM&&(this.revertDOM.textContent="")}scheduleMeasure(){if(this.measuring<0){let e=this.dom.ownerDocument.defaultView||window;this.measuring=e.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){Dt(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,n=e.firstChild,l=this.a.viewport,r=this.b.viewport;for(let i=0;il.to||s.fromB>r.to)break;if(s.fromA-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}}function Oe(t){let e=t.nextSibling;return t.remove(),e}const Rt=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-deletedLineGutter"}},Gt=$.low(je({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(K))===null||e===void 0?void 0:e.gutter)||We.empty},widgetMarker:(t,e)=>e instanceof st?Rt:null}));function Nt(t){var e;let n=typeof t.original=="string"?Fe.of(t.original.split(/\r?\n/)):t.original,l=t.diffConfig||it;return[$.low(K),jt,lt,L.editorAttributes.of({class:"cm-merge-b"}),tt.of((r,i)=>{let s=i.effects.find(o=>o.is(he));return s&&(r=E.updateA(r,s.value.doc,i.startState.doc,s.value.changes,l)),i.docChanged&&(r=E.updateB(r,i.state.field(F),i.newDoc,i.changes,l)),r}),b.of({highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1,syntaxHighlightDeletions:t.syntaxHighlightDeletions!==!1,syntaxHighlightDeletionsMaxLength:3e3,mergeControls:(e=t.mergeControls)!==null&&e!==void 0?e:!0,overrideChunk:Pt,side:"b"}),F.init(()=>n),t.gutter!==!1?Gt:[],t.collapseUnchanged?se(t.collapseUnchanged):[],k.init(r=>E.build(n,r.doc,l))]}const he=R.define(),F=W.define({create:()=>Fe.empty,update(t,e){for(let n of e.effects)n.is(he)&&(t=n.value.doc);return t}}),ye=new WeakMap;class st extends J{constructor(e){super(),this.buildDOM=e,this.dom=null}eq(e){return this.dom==e.dom}toDOM(e){return this.dom||(this.dom=this.buildDOM(e))}}function Ft(t,e,n){let l=ye.get(e.changes);if(l)return l;let r=s=>{let{highlightChanges:o,syntaxHighlightDeletions:d,syntaxHighlightDeletionsMaxLength:h,mergeControls:a}=t.facet(b),f=document.createElement("div");if(f.className="cm-deletedChunk",a){let x=f.appendChild(document.createElement("div"));x.className="cm-chunkButtons";let M=A=>{A.preventDefault(),Vt(s,s.posAtDOM(f))},w=A=>{A.preventDefault(),It(s,s.posAtDOM(f))};if(typeof a=="function")x.appendChild(a("accept",M)),x.appendChild(a("reject",w));else{let A=x.appendChild(document.createElement("button"));A.name="accept",A.textContent=t.phrase("Accept"),A.onmousedown=M;let D=x.appendChild(document.createElement("button"));D.name="reject",D.textContent=t.phrase("Reject"),D.onmousedown=w}}if(n||e.fromA>=e.toA)return f;let c=s.state.field(F).sliceString(e.fromA,e.endA),u=d&&t.facet(ft),m=S(),p=e.changes,g=0,C=!1;function S(){let x=f.appendChild(document.createElement("div"));return x.className="cm-deletedLine",x.appendChild(document.createElement("del"))}function T(x,M,w){for(let A=x;Ah){let f=t.slice(e,n).indexOf(l.slice(r,i));if(f>-1)return[new v(e,e+f,r,r),new v(e+f+h,n,i,i)]}else if(h>d){let f=l.slice(r,i).indexOf(t.slice(e,n));if(f>-1)return[new v(e,e,r,r+f),new v(n,n,r+f+d,i)]}if(d==1||h==1)return[new v(e,n,r,i)];let a=qe(t,e,n,l,r,i);if(a){let[f,c,u]=a;return y(t,e,f,l,r,c).concat(y(t,f+u,n,l,c+u,i))}return pt(t,e,n,l,r,i)}let I=1e9,j=0,ae=!1;function pt(t,e,n,l,r,i){let s=n-e,o=i-r;if(I<1e9&&Math.min(s,o)>I*16||j>0&&Date.now()>j)return Math.min(s,o)>I*64?[new v(e,n,r,i)]:ge(t,e,n,l,r,i);let d=Math.ceil((s+o)/2);X.reset(d),ee.reset(d);let h=(u,m)=>t.charCodeAt(e+u)==l.charCodeAt(r+m),a=(u,m)=>t.charCodeAt(n-u-1)==l.charCodeAt(i-m-1),f=(s-o)%2!=0?ee:null,c=f?null:X;for(let u=0;uI||j>0&&!(u&63)&&Date.now()>j)return ge(t,e,n,l,r,i);let m=X.advance(u,s,o,d,f,!1,h)||ee.advance(u,s,o,d,c,!0,a);if(m)return Ct(t,e,n,e+m[0],l,r,i,r+m[1])}return[new v(e,n,r,i)]}class Pe{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let n=0;nn)this.end+=2;else if(f>l)this.start+=2;else if(i){let c=r+(n-l)-d;if(c>=0&&c=n-a)return[u,r+u-c]}else{let u=n-i.vec[c];if(a>=u)return[a,f]}}}return null}}const X=new Pe,ee=new Pe;function Ct(t,e,n,l,r,i,s,o){let d=!1;return!N(t,l)&&++l==n&&(d=!0),!N(r,o)&&++o==s&&(d=!0),d?[new v(e,n,i,s)]:y(t,e,l,r,i,o).concat(y(t,l,n,r,o,s))}function ze(t,e){let n=1,l=Math.min(t,e);for(;nn||a>i||t.slice(o,h)!=l.slice(d,a)){if(s==1)return o-e-(N(t,o)?0:1);s=s>>1}else{if(h==n||a==i)return h-e;o=h,d=a}}}function fe(t,e,n,l,r,i){if(e==n||r==i||t.charCodeAt(n-1)!=l.charCodeAt(i-1))return 0;let s=ze(n-e,i-r);for(let o=n,d=i;;){let h=o-s,a=d-s;if(h>1}else{if(h==e||a==r)return n-h;o=h,d=a}}}function ie(t,e,n,l,r,i,s,o){let d=l.slice(r,i),h=null;for(;;){if(h||s=n)break;let c=t.slice(a,f),u=-1;for(;(u=d.indexOf(c,u+1))!=-1;){let m=de(t,f,n,l,r+u+c.length,i),p=fe(t,e,a,l,r,r+u),g=c.length+m+p;(!h||h[2]>1}}function qe(t,e,n,l,r,i){let s=n-e,o=i-r;if(sr.fromA-e&&l.toB>r.fromB-e&&(t[n-1]=new v(l.fromA,r.toA,l.fromB,r.toB),t.splice(n--,1))}}function vt(t,e,n){for(;;){_e(n,1);let l=!1;for(let r=0;r3||o>3){let d=r==t.length-1?e.length:t[r+1].fromA,h=i.fromA-l,a=d-i.toA,f=Ce(e,i.fromA,h),c=pe(e,i.toA,a),u=i.fromA-f,m=c-i.toA;if((!s||!o)&&u&&m){let p=Math.max(s,o),[g,C,S]=s?[e,i.fromA,i.toA]:[n,i.fromB,i.toB];p>u&&e.slice(f,i.fromA)==g.slice(S-u,S)?(i=t[r]=new v(f,f+s,i.fromB-u,i.toB-u),f=i.fromA,c=pe(e,i.toA,d-i.toA)):p>m&&e.slice(i.toA,c)==g.slice(C,C+m)&&(i=t[r]=new v(c-s,c,i.fromB+m,i.toB+m),c=i.toA,f=Ce(e,i.fromA,i.fromA-l)),u=i.fromA-f,m=c-i.toA}if(u||m)i=t[r]=new v(i.fromA-u,i.toA+m,i.fromB-u,i.toB+m);else if(s){if(!o){let p=Ae(e,i.fromA,i.toA),g,C=p<0?-1:ve(e,i.toA,i.fromA);p>-1&&(g=p-i.fromA)<=a&&e.slice(i.fromA,p)==e.slice(i.toA,i.toA+g)?i=t[r]=i.offset(g):C>-1&&(g=i.toA-C)<=h&&e.slice(i.fromA-g,i.fromA)==e.slice(C,i.toA)&&(i=t[r]=i.offset(-g))}}else{let p=Ae(n,i.fromB,i.toB),g,C=p<0?-1:ve(n,i.toB,i.fromB);p>-1&&(g=p-i.fromB)<=a&&n.slice(i.fromB,p)==n.slice(i.toB,i.toB+g)?i=t[r]=i.offset(g):C>-1&&(g=i.toB-C)<=h&&n.slice(i.fromB-g,i.fromB)==n.slice(C,i.toB)&&(i=t[r]=i.offset(-g))}}l=i.toA}return _e(t,3),t}let O;try{O=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function Qe(t){return t>48&&t<58||t>64&&t<91||t>96&&t<123}function Ye(t,e){if(e==t.length)return 0;let n=t.charCodeAt(e);return n<192?Qe(n)?1:0:O?!Ke(n)||e==t.length-1?O.test(String.fromCharCode(n))?1:0:O.test(t.slice(e,e+2))?2:0:0}function $e(t,e){if(!e)return 0;let n=t.charCodeAt(e-1);return n<192?Qe(n)?1:0:O?!Ze(n)||e==1?O.test(String.fromCharCode(n))?1:0:O.test(t.slice(e-2,e))?2:0:0}const Je=8;function pe(t,e,n){if(e==t.length||!$e(t,e))return e;for(let l=e,r=e+n,i=0;ir)return l;l+=s}return e}function Ce(t,e,n){if(!e||!Ye(t,e))return e;for(let l=e,r=e-n,i=0;it>=55296&&t<=56319,Ze=t=>t>=56320&&t<=57343;function N(t,e){return!e||e==t.length||!Ke(t.charCodeAt(e-1))||!Ze(t.charCodeAt(e))}function xt(t,e,n){var l;let r=n==null?void 0:n.override;return r?r(t,e):(I=((l=n==null?void 0:n.scanLimit)!==null&&l!==void 0?l:1e9)>>1,j=n!=null&&n.timeout?Date.now()+n.timeout:0,ae=!1,vt(t,e,y(t,0,t.length,e,0,e.length)))}function Xe(){return!ae}function et(t,e,n){return At(xt(t,e,n),t,e)}const b=Ue.define({combine:t=>t[0]}),re=R.define(),tt=Ue.define(),k=W.define({create(t){return null},update(t,e){for(let n of e.effects)n.is(re)&&(t=n.value);for(let n of e.state.facet(tt))t=n(t,e);return t}});class E{constructor(e,n,l,r,i,s=!0){this.changes=e,this.fromA=n,this.toA=l,this.fromB=r,this.toB=i,this.precise=s}offset(e,n){return e||n?new E(this.changes,this.fromA+e,this.toA+e,this.fromB+n,this.toB+n,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,n,l){let r=et(e.toString(),n.toString(),l);return nt(r,e,n,0,0,Xe())}static updateA(e,n,l,r,i){return Be(be(e,r,!0,l.length),e,n,l,i)}static updateB(e,n,l,r,i){return Be(be(e,r,!1,n.length),e,n,l,i)}}function xe(t,e,n,l){let r=n.lineAt(t),i=l.lineAt(e);return r.to==t&&i.to==e&&tf+1&&g>c+1)break;u.push(m.offset(-h+l,-a+r)),[f,c]=we(m.toA+l,m.toB+r,e,n),o++}s.push(new E(u,h,Math.max(h,f),a,Math.max(a,c),i))}return s}const H=1e3;function ke(t,e,n,l){let r=0,i=t.length;for(;;){if(r==i){let a=0,f=0;r&&({toA:a,toB:f}=t[r-1]);let c=e-(n?a:f);return[a+c,f+c]}let s=r+i>>1,o=t[s],[d,h]=n?[o.fromA,o.toA]:[o.fromB,o.toB];if(d>e)i=s;else if(h<=e)r=s+1;else return l?[o.fromA,o.fromB]:[o.toA,o.toB]}}function be(t,e,n,l){let r=[];return e.iterChangedRanges((i,s,o,d)=>{let h=0,a=n?e.length:l,f=0,c=n?l:e.length;i>H&&([h,f]=ke(t,i-H,n,!0)),s=h?r[r.length-1]={fromA:m.fromA,fromB:m.fromB,toA:a,toB:c,diffA:m.diffA+p,diffB:m.diffB+g}:r.push({fromA:h,toA:a,fromB:f,toB:c,diffA:p,diffB:g})}),r}function Be(t,e,n,l,r){if(!t.length)return e;let i=[];for(let s=0,o=0,d=0,h=0;;s++){let a=s==t.length?null:t[s],f=a?a.fromA+o:n.length,c=a?a.fromB+d:l.length;for(;hf||g.toB+d>c))break;i.push(g.offset(o,d)),h++}if(!a)break;let u=a.toA+o+a.diffA,m=a.toB+d+a.diffB,p=et(n.sliceString(f,u),l.sliceString(c,m),r);for(let g of nt(p,n,l,f,c,Xe()))i.push(g);for(o+=a.diffA,d+=a.diffB;hu&&g.fromB+d>m)break;h++}}return i}const it={scanLimit:500},K=at.fromClass(class{constructor(t){({deco:this.deco,gutter:this.gutter}=Le(t))}update(t){(t.docChanged||t.viewportChanged||wt(t.startState,t.state)||kt(t.startState,t.state))&&({deco:this.deco,gutter:this.gutter}=Le(t.view))}},{decorations:t=>t.deco}),P=$.low(je({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(K))===null||e===void 0?void 0:e.gutter)||We.empty}}));function wt(t,e){return t.field(k,!1)!=e.field(k,!1)}function kt(t,e){return t.facet(b)!=e.facet(b)}const Me=B.line({class:"cm-changedLine"}),rt=B.mark({class:"cm-changedText"}),bt=B.mark({tagName:"ins",class:"cm-insertedLine"}),Bt=B.mark({tagName:"del",class:"cm-deletedLine"}),De=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function Mt(t,e,n,l,r,i){let s=n?t.fromA:t.fromB,o=n?t.toA:t.toB,d=0;if(s!=o){r.add(s,s,Me),r.add(s,o,n?Bt:bt),i&&i.add(s,s,De);for(let h=e.iterRange(s,o-1),a=s;!h.next().done;){if(h.lineBreak){a++,r.add(a,a,Me),i&&i.add(a,a,De);continue}let f=a+h.value.length;if(l)for(;d=a)break;(s?f.toA:f.toB)>h&&(!i||!i(t.state,f,o,d))&&Mt(f,t.state.doc,s,l,o,d)}return{deco:o.finish(),gutter:d&&d.finish()}}class z extends J{constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement("div");return e.className="cm-mergeSpacer",e.style.height=this.height+"px",e}updateDOM(e){return e.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}const Y=R.define({map:(t,e)=>t.map(e)}),U=W.define({create:()=>B.none,update:(t,e)=>{for(let n of e.effects)if(n.is(Y))return n.value;return t.map(e.changes)},provide:t=>L.decorations.from(t)}),q=.01;function Se(t,e){if(t.size!=e.size)return!1;let n=t.iter(),l=e.iter();for(;n.value;){if(n.from!=l.from||Math.abs(n.value.spec.widget.height-l.value.spec.widget.height)>1)return!1;n.next(),l.next()}return!0}function Dt(t,e,n){let l=new G,r=new G,i=t.state.field(U).iter(),s=e.state.field(U).iter(),o=0,d=0,h=0,a=0,f=t.viewport,c=e.viewport;for(let g=0;;g++){let C=gq&&(a+=w,r.add(d,d,B.widget({widget:new z(w),block:!0,side:-1})))}if(S>o+1e3&&of.from&&dc.from){let x=Math.min(f.from-o,c.from-d);o+=x,d+=x,g--}else if(C)o=C.toA,d=C.toB;else break;for(;i.value&&i.fromq&&r.add(e.state.doc.length,e.state.doc.length,B.widget({widget:new z(u),block:!0,side:1}));let m=l.finish(),p=r.finish();Se(m,t.state.field(U))||t.dispatch({effects:Y.of(m)}),Se(p,e.state.field(U))||e.dispatch({effects:Y.of(p)})}const le=R.define({map:(t,e)=>e.mapPos(t)});class Lt extends J{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let n=document.createElement("div");return n.className="cm-collapsedLines",n.textContent=e.state.phrase("$ unchanged lines",this.lines),n.addEventListener("click",l=>{let r=e.posAtDOM(l.target);e.dispatch({effects:le.of(r)});let{side:i,sibling:s}=e.state.facet(b);s&&s().dispatch({effects:le.of(St(r,e.state.field(k),i=="a"))})}),n}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function St(t,e,n){let l=0,r=0;for(let i=0;;i++){let s=i=t)return r+(t-l);[l,r]=n?[s.toA,s.toB]:[s.toB,s.toA]}}const Et=W.define({create(t){return B.none},update(t,e){t=t.map(e.changes);for(let n of e.effects)n.is(le)&&(t=t.update({filter:l=>l!=n.value}));if(t.size&&e.state.field(k)!=e.startState.field(k,!1)){let n=e.state.facet(b).side=="a",l=[];for(let r of e.state.field(k))t.between(n?r.fromA:r.fromB,n?r.toA:r.toB,i=>{l.push(i)});l.length&&(t=t.update({filter:r=>l.indexOf(r)<0}))}return t},provide:t=>L.decorations.from(t)});function se({margin:t=3,minSize:e=4}){return Et.init(n=>Ot(n,t,e))}function Ot(t,e,n){let l=new G,r=t.facet(b).side=="a",i=t.field(k),s=1;for(let o=0;;o++){let d=o=n&&l.add(t.doc.line(h).from,t.doc.line(a).to,B.replace({widget:new Lt(f),block:!0})),!d)break;s=t.doc.lineAt(Math.min(t.doc.length,r?d.toA:d.toB)).number}return l.finish()}const yt=L.styleModule.of(new dt({".cm-mergeView":{overflowY:"auto"},".cm-mergeViewEditors":{display:"flex",alignItems:"stretch"},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:"hidden"},".cm-merge-revert":{width:"1.6em",flexGrow:0,flexShrink:0,position:"relative"},".cm-merge-revert button":{position:"absolute",display:"block",width:"100%",boxSizing:"border-box",textAlign:"center",background:"none",border:"none",font:"inherit",cursor:"pointer"}})),lt=L.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat"},"&.cm-merge-b .cm-deletedText":{background:"#ff000033"},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer","&:before":{content:'"⦚"',marginInlineEnd:"7px"},"&:after":{content:'"⦚"',marginInlineStart:"7px"}},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"},".cm-inlineChangedLineGutter":{background:"#75d"}}),Ee=new Ve,_=new Ve;class Tt{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||it;let n=[$.low(K),lt,yt,U,L.updateListener.of(f=>{this.measuring<0&&(f.heightChanged||f.viewportChanged)&&!f.transactions.some(c=>c.effects.some(u=>u.is(Y)))&&this.measure()})],l=[b.of({side:"a",sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&l.push(P);let r=te.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],L.editorAttributes.of({class:"cm-merge-a"}),_.of(l),n]}),i=[b.of({side:"b",sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&i.push(P);let s=te.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],L.editorAttributes.of({class:"cm-merge-b"}),_.of(i),n]});this.chunks=E.build(r.doc,s.doc,this.diffConf);let o=[k.init(()=>this.chunks),Ee.of(e.collapseUnchanged?se(e.collapseUnchanged):[])];r=r.update({effects:R.appendConfig.of(o)}).state,s=s.update({effects:R.appendConfig.of(o)}).state,this.dom=document.createElement("div"),this.dom.className="cm-mergeView",this.editorDOM=this.dom.appendChild(document.createElement("div")),this.editorDOM.className="cm-mergeViewEditors";let d=e.orientation||"a-b",h=document.createElement("div");h.className="cm-mergeViewEditor";let a=document.createElement("div");a.className="cm-mergeViewEditor",this.editorDOM.appendChild(d=="a-b"?h:a),this.editorDOM.appendChild(d=="a-b"?a:h),this.a=new L({state:r,parent:h,root:e.root,dispatchTransactions:f=>this.dispatch(f,this.a)}),this.b=new L({state:s,parent:a,root:e.root,dispatchTransactions:f=>this.dispatch(f,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls=="b-to-a",e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,n){if(e.some(l=>l.docChanged)){let l=e[e.length-1],r=e.reduce((s,o)=>s.compose(o.changes),Ie.empty(e[0].startState.doc.length));this.chunks=n==this.a?E.updateA(this.chunks,l.newDoc,this.b.state.doc,r,this.diffConf):E.updateB(this.chunks,this.a.state.doc,l.newDoc,r,this.diffConf),n.update([...e,l.state.update({effects:re.of(this.chunks)})]);let i=n==this.a?this.b:this.a;i.update([i.state.update({effects:re.of(this.chunks)})]),this.scheduleMeasure()}else n.update(e)}reconfigure(e){if("diffConfig"in e&&(this.diffConf=e.diffConfig),"orientation"in e){let i=e.orientation!="b-a";if(i!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let s=this.a.dom.parentNode,o=this.b.dom.parentNode;s.remove(),o.remove(),this.editorDOM.insertBefore(i?s:o,this.editorDOM.firstChild),this.editorDOM.appendChild(i?o:s),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in e||"renderRevertControl"in e){let i=!!this.revertDOM,s=this.revertToA,o=this.renderRevert;"revertControls"in e&&(i=!!e.revertControls,s=e.revertControls=="b-to-a"),"renderRevertControl"in e&&(o=e.renderRevertControl),this.setupRevertControls(i,s,o)}let n="highlightChanges"in e,l="gutter"in e,r="collapseUnchanged"in e;if(n||l||r){let i=[],s=[];if(n||l){let o=this.a.state.facet(b),d=l?e.gutter!==!1:o.markGutter,h=n?e.highlightChanges!==!1:o.highlightChanges;i.push(_.reconfigure([b.of({side:"a",sibling:()=>this.b,highlightChanges:h,markGutter:d}),d?P:[]])),s.push(_.reconfigure([b.of({side:"b",sibling:()=>this.a,highlightChanges:h,markGutter:d}),d?P:[]]))}if(r){let o=Ee.reconfigure(e.collapseUnchanged?se(e.collapseUnchanged):[]);i.push(o),s.push(o)}this.a.dispatch({effects:i}),this.b.dispatch({effects:s})}this.scheduleMeasure()}setupRevertControls(e,n,l){this.revertToA=n,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=l,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement("div"),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener("mousedown",r=>this.revertClicked(r)),this.revertDOM.className="cm-merge-revert"):this.revertDOM&&(this.revertDOM.textContent="")}scheduleMeasure(){if(this.measuring<0){let e=this.dom.ownerDocument.defaultView||window;this.measuring=e.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){Dt(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,n=e.firstChild,l=this.a.viewport,r=this.b.viewport;for(let i=0;il.to||s.fromB>r.to)break;if(s.fromA-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}}function Oe(t){let e=t.nextSibling;return t.remove(),e}const Rt=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-deletedLineGutter"}},Gt=$.low(je({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(K))===null||e===void 0?void 0:e.gutter)||We.empty},widgetMarker:(t,e)=>e instanceof st?Rt:null}));function Nt(t){var e;let n=typeof t.original=="string"?Fe.of(t.original.split(/\r?\n/)):t.original,l=t.diffConfig||it;return[$.low(K),jt,lt,L.editorAttributes.of({class:"cm-merge-b"}),tt.of((r,i)=>{let s=i.effects.find(o=>o.is(he));return s&&(r=E.updateA(r,s.value.doc,i.startState.doc,s.value.changes,l)),i.docChanged&&(r=E.updateB(r,i.state.field(F),i.newDoc,i.changes,l)),r}),b.of({highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1,syntaxHighlightDeletions:t.syntaxHighlightDeletions!==!1,syntaxHighlightDeletionsMaxLength:3e3,mergeControls:(e=t.mergeControls)!==null&&e!==void 0?e:!0,overrideChunk:Pt,side:"b"}),F.init(()=>n),t.gutter!==!1?Gt:[],t.collapseUnchanged?se(t.collapseUnchanged):[],k.init(r=>E.build(n,r.doc,l))]}const he=R.define(),F=W.define({create:()=>Fe.empty,update(t,e){for(let n of e.effects)n.is(he)&&(t=n.value.doc);return t}}),ye=new WeakMap;class st extends J{constructor(e){super(),this.buildDOM=e,this.dom=null}eq(e){return this.dom==e.dom}toDOM(e){return this.dom||(this.dom=this.buildDOM(e))}}function Ft(t,e,n){let l=ye.get(e.changes);if(l)return l;let r=s=>{let{highlightChanges:o,syntaxHighlightDeletions:d,syntaxHighlightDeletionsMaxLength:h,mergeControls:a}=t.facet(b),f=document.createElement("div");if(f.className="cm-deletedChunk",a){let x=f.appendChild(document.createElement("div"));x.className="cm-chunkButtons";let M=A=>{A.preventDefault(),Vt(s,s.posAtDOM(f))},w=A=>{A.preventDefault(),It(s,s.posAtDOM(f))};if(typeof a=="function")x.appendChild(a("accept",M)),x.appendChild(a("reject",w));else{let A=x.appendChild(document.createElement("button"));A.name="accept",A.textContent=t.phrase("Accept"),A.onmousedown=M;let D=x.appendChild(document.createElement("button"));D.name="reject",D.textContent=t.phrase("Reject"),D.onmousedown=w}}if(n||e.fromA>=e.toA)return f;let c=s.state.field(F).sliceString(e.fromA,e.endA),u=d&&t.facet(ft),m=S(),p=e.changes,g=0,C=!1;function S(){let x=f.appendChild(document.createElement("div"));return x.className="cm-deletedLine",x.appendChild(document.createElement("del"))}function T(x,M,w){for(let A=x;A-1&&ZA){let V=document.createTextNode(c.slice(A,D));if(ce){let me=m.appendChild(document.createElement("span"));me.className=ce,me.appendChild(V)}else m.appendChild(V);A=D}ue&&(C=!C)}}if(u&&e.toA-e.fromA<=h){let x=u.parser.parse(c),M=0;ht(x,{style:w=>ct(t,w)},(w,A,D)=>{w>M&&T(M,w,""),T(w,A,D),M=A}),T(M,c.length,"")}else T(0,c.length,"");return m.firstChild||m.appendChild(document.createElement("br")),f},i=B.widget({block:!0,side:-1,widget:new st(r)});return ye.set(e.changes,i),i}function Vt(t,e){let{state:n}=t,l=e??n.selection.main.head,r=t.state.field(k).find(d=>d.fromB<=l&&d.endB>=l);if(!r)return!1;let i=t.state.sliceDoc(r.fromB,Math.max(r.fromB,r.toB-1)),s=t.state.field(F);r.fromB!=r.toB&&r.toA<=s.length&&(i+=t.state.lineBreak);let o=Ie.of({from:r.fromA,to:Math.min(s.length,r.toA),insert:i},s.length);return t.dispatch({effects:he.of({doc:o.apply(s),changes:o}),userEvent:"accept"}),!0}function It(t,e){let{state:n}=t,l=e??n.selection.main.head,r=n.field(k).find(o=>o.fromB<=l&&o.endB>=l);if(!r)return!1;let s=n.field(F).sliceString(r.fromA,Math.max(r.fromA,r.toA-1));return r.fromA!=r.toA&&r.toB<=n.doc.length&&(s+=n.lineBreak),t.dispatch({changes:{from:r.fromB,to:Math.min(n.doc.length,r.toB),insert:s},userEvent:"revert"}),!0}function Te(t){let e=new G;for(let n of t.field(k)){let l=t.facet(b).overrideChunk&&ot(t,n);e.add(n.fromB,n.fromB,Ft(t,n,!!l))}return e.finish()}const jt=W.define({create:t=>Te(t),update(t,e){return e.state.field(k,!1)!=e.startState.field(k,!1)?Te(e.state):t},provide:t=>L.decorations.from(t)}),Re=new WeakMap;function ot(t,e){let n=Re.get(e);if(n!==void 0)return n;n=null;let l=t.field(F),r=t.doc,i=l.lineAt(e.endA).number-l.lineAt(e.fromA).number+1,s=r.lineAt(e.endB).number-r.lineAt(e.fromB).number+1;e:if(i==s&&i<10){let o=[],d=0,h=e.fromA,a=e.fromB;for(let f of e.changes){if(f.fromA=e.endB)break;s=t.doc.lineAt(s.to+1)}return!0}const Ge="(max-width: 760px)";function zt(){const[t,e]=Q.useState(()=>typeof window<"u"&&window.matchMedia(Ge).matches);return Q.useEffect(()=>{const n=window.matchMedia(Ge),l=()=>e(n.matches);return l(),n.addEventListener("change",l),()=>n.removeEventListener("change",l)},[]),t}function Ne(t,e){return[gt({lineNumbers:!0,foldGutter:!0,highlightActiveLine:!1,highlightActiveLineGutter:!1,autocompletion:!1}),...He(t),te.readOnly.of(!0),...e==="dark"?[mt]:[]]}function qt({before:t,after:e,path:n,theme:l}){const r=Q.useRef(null);return Q.useEffect(()=>{if(!r.current)return;const i=new Tt({a:{doc:t,extensions:Ne(n,l)},b:{doc:e,extensions:Ne(n,l)},parent:r.current,highlightChanges:!0,gutter:!0,collapseUnchanged:{margin:3,minSize:6},diffConfig:{scanLimit:2e3,timeout:1e3}});return()=>i.destroy()},[e,t,n,l]),ne.jsx("div",{ref:r,className:"code-browser-merge"})}function Qt(t){return zt()?ne.jsx(ut,{value:t.after,height:"100%",theme:t.theme,editable:!1,extensions:[...He(t.path),...Nt({original:t.before,highlightChanges:!0,gutter:!0,mergeControls:!1,collapseUnchanged:{margin:3,minSize:6},diffConfig:{scanLimit:2e3,timeout:1e3}})],basicSetup:{lineNumbers:!0,foldGutter:!0,highlightActiveLine:!1,highlightActiveLineGutter:!1,autocompletion:!1}}):ne.jsx(qt,{...t})}export{Qt as default}; diff --git a/veadk/webui/assets/chunks/FileExplorerEditor-B8Ub9k9b.js b/veadk/webui/assets/chunks/FileExplorerEditor-KCeE5MIo.js similarity index 96% rename from veadk/webui/assets/chunks/FileExplorerEditor-B8Ub9k9b.js rename to veadk/webui/assets/chunks/FileExplorerEditor-KCeE5MIo.js index 7b7eea9c3..84d8f9316 100644 --- a/veadk/webui/assets/chunks/FileExplorerEditor-B8Ub9k9b.js +++ b/veadk/webui/assets/chunks/FileExplorerEditor-KCeE5MIo.js @@ -1 +1 @@ -import{aD as m,h as r,as as c,b as p,aK as g,H as x,aL as o}from"../app/index-BNPwMQXG.js";const v=r.theme({"&":{backgroundColor:"transparent",color:"var(--studio-code-text)",fontSize:"13px"},"&.cm-focused":{outline:"none"},".cm-scroller":{fontFamily:'"Geist Mono", "Noto Sans SC", monospace',lineHeight:"19.5px",overflow:"visible"},".cm-content":{padding:"12px 0 16px",caretColor:"var(--studio-text-primary)"},".cm-line":{padding:"0 16px"},".cm-gutters":{backgroundColor:"var(--studio-surface-input)",color:"var(--studio-code-line-number)",border:"none"},".cm-lineNumbers .cm-gutterElement":{minWidth:"26px",padding:"0 4px"},".cm-activeLine, .cm-activeLineGutter":{backgroundColor:"var(--studio-fill-hover)"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"var(--studio-text-primary)"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"var(--studio-fill-active)"}}),b=g(x.define([{tag:o.comment,color:"var(--studio-code-comment)"},{tag:[o.keyword,o.operatorKeyword],color:"var(--studio-code-keyword)"},{tag:[o.string,o.attributeValue],color:"var(--studio-code-string)"},{tag:[o.number,o.bool,o.null],color:"var(--studio-code-number)"},{tag:[o.function(o.variableName),o.function(o.propertyName)],color:"var(--studio-code-function)"},{tag:[o.typeName,o.className],color:"var(--studio-code-constant)"},{tag:[o.tagName,o.attributeName],color:"var(--studio-code-variable)"}]));function f({value:s,name:e,language:t,wordWrap:i,onChange:l}){const d=m.useMemo(()=>[v,b,r.contentAttributes.of({"aria-label":`${e} 编辑器`}),...i?[r.lineWrapping]:[]],[e,i]),a={javascript:"jsx",typescript:"tsx",python:"py",markdown:"md",yaml:"yaml",json:"json"},n=t&&Object.prototype.hasOwnProperty.call(a,t)?a[t]:void 0,u=t==="plaintext"?"file.txt":n?`file.${n}`:e;return c.jsx("div",{className:"studio-file-explorer__editor",children:c.jsx(p,{value:s,path:u,theme:"none",height:"auto",extensions:d,onChange:l})})}export{f as FileExplorerEditor}; +import{aD as m,h as r,as as c,b as p,aK as g,H as x,aL as o}from"../app/index-8JtvDNuA.js";const v=r.theme({"&":{backgroundColor:"transparent",color:"var(--studio-code-text)",fontSize:"13px"},"&.cm-focused":{outline:"none"},".cm-scroller":{fontFamily:'"Geist Mono", "Noto Sans SC", monospace',lineHeight:"19.5px",overflow:"visible"},".cm-content":{padding:"12px 0 16px",caretColor:"var(--studio-text-primary)"},".cm-line":{padding:"0 16px"},".cm-gutters":{backgroundColor:"var(--studio-surface-input)",color:"var(--studio-code-line-number)",border:"none"},".cm-lineNumbers .cm-gutterElement":{minWidth:"26px",padding:"0 4px"},".cm-activeLine, .cm-activeLineGutter":{backgroundColor:"var(--studio-fill-hover)"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"var(--studio-text-primary)"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"var(--studio-fill-active)"}}),b=g(x.define([{tag:o.comment,color:"var(--studio-code-comment)"},{tag:[o.keyword,o.operatorKeyword],color:"var(--studio-code-keyword)"},{tag:[o.string,o.attributeValue],color:"var(--studio-code-string)"},{tag:[o.number,o.bool,o.null],color:"var(--studio-code-number)"},{tag:[o.function(o.variableName),o.function(o.propertyName)],color:"var(--studio-code-function)"},{tag:[o.typeName,o.className],color:"var(--studio-code-constant)"},{tag:[o.tagName,o.attributeName],color:"var(--studio-code-variable)"}]));function f({value:s,name:e,language:t,wordWrap:i,onChange:l}){const d=m.useMemo(()=>[v,b,r.contentAttributes.of({"aria-label":`${e} 编辑器`}),...i?[r.lineWrapping]:[]],[e,i]),a={javascript:"jsx",typescript:"tsx",python:"py",markdown:"md",yaml:"yaml",json:"json"},n=t&&Object.prototype.hasOwnProperty.call(a,t)?a[t]:void 0,u=t==="plaintext"?"file.txt":n?`file.${n}`:e;return c.jsx("div",{className:"studio-file-explorer__editor",children:c.jsx(p,{value:s,path:u,theme:"none",height:"auto",extensions:d,onChange:l})})}export{f as FileExplorerEditor}; diff --git a/veadk/webui/assets/chunks/MarkdownPromptEditor-D6ctFDfi.js b/veadk/webui/assets/chunks/MarkdownPromptEditor-C8Q2sj5P.js similarity index 99% rename from veadk/webui/assets/chunks/MarkdownPromptEditor-D6ctFDfi.js rename to veadk/webui/assets/chunks/MarkdownPromptEditor-C8Q2sj5P.js index c752573bf..a00f849f6 100644 --- a/veadk/webui/assets/chunks/MarkdownPromptEditor-D6ctFDfi.js +++ b/veadk/webui/assets/chunks/MarkdownPromptEditor-C8Q2sj5P.js @@ -1,4 +1,4 @@ -var T0=Object.defineProperty;var E0=(n,e,t)=>e in n?T0(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var $=(n,e,t)=>E0(n,typeof e!="symbol"?e+"":e,t);import{aD as I,aO as Rn,as as F,A as k0,m as Kt,X as at,aT as jo,P as N0,l as M0,aN as hc,aS as Fh,aC as Uo,a0 as Rh,Z as $0,am as L0,aR as O0,q as A0,i as I0,g as P0,$ as Hh,a2 as D0,e as F0,L as R0,aQ as Vh,aP as Fu,u as H0,I as V0,J as B0,a1 as Bh,a3 as zh,t as z0,z as J0,aa as Ru,ab as K0,a5 as W0,a7 as aa,aB as j0,aV as U0,al as Z0,r as T,a4 as Hu,O as Vu,V as Qe,az as nn,aJ as Di,aH as $l,aE as q0,Q as Bu,av as jt,ax as hs,a9 as gc,aw as Wn,aM as En,aI as Pt,Y as So,ac as G0,ag as Y0,ae as X0,af as Q0,ad as e5,aj as t5,ah as n5,ai as r5,n as o5,v as i5,K as s5,j as l5,f as a5,aU as c5}from"../app/index-BNPwMQXG.js";var u5=Object.defineProperty,f5=(n,e)=>u5(n,"name",{value:e,configurable:!0});function Jh(n){const e=I.useRef({value:n,previous:n});return I.useMemo(()=>(e.current.value!==n&&(e.current.previous=e.current.value,e.current.value=n),e.current.previous),[n])}f5(Jh,"usePrevious");var d5=Object.defineProperty,h5=(n,e)=>d5(n,"name",{value:e,configurable:!0});function ca(n,[e,t]){return Math.min(t,Math.max(e,n))}h5(ca,"clamp");var g5=Object.defineProperty,be=(n,e)=>g5(n,"name",{value:e,configurable:!0}),p5=[" ","Enter","ArrowUp","ArrowDown"],m5=[" ","Enter"],oo="Select",[Us,pc,_5]=$0(oo),[vr,gv]=Hh(oo,[_5,Rh]),mc=Rh(),[x5,Hn]=vr(oo),[y5,C5]=vr(oo);function Kh(n){const{__scopeSelect:e,children:t,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:l,onValueChange:a,dir:c,name:u,autoComplete:f,disabled:d,required:g,form:h,internal_do_not_use_render:_}=n,m=mc(e),[p,y]=I.useState(null),[C,x]=I.useState(null),[w,k]=I.useState(!1),b=Vh(c),[v,E]=Fu({prop:r,defaultProp:o??!1,onChange:i,caller:oo}),[M,L]=Fu({prop:s,defaultProp:l,onChange:a,caller:oo}),H=I.useRef(null),R=I.useRef(M);I.useEffect(()=>{const Te=h?p==null?void 0:p.ownerDocument.getElementById(h):p==null?void 0:p.form;if(Te instanceof HTMLFormElement){const Se=be(()=>L(R.current),"reset");return Te.addEventListener("reset",Se),()=>Te.removeEventListener("reset",Se)}},[h,p,L]);const V=p?!!h||!!p.closest("form"):!0,[Z,G]=I.useState(new Set),z=Fh(),re=Array.from(Z).map(Te=>Te.props.value).join(";"),ee=I.useCallback(Te=>{G(Se=>new Set(Se).add(Te))},[]),ne=I.useCallback(Te=>{G(Se=>{const Ke=new Set(Se);return Ke.delete(Te),Ke})},[]),ae={required:g,trigger:p,onTriggerChange:y,valueNode:C,onValueNodeChange:x,valueNodeHasChildren:w,onValueNodeHasChildrenChange:k,contentId:z,value:M,onValueChange:L,open:v,onOpenChange:E,dir:b,triggerPointerDownPosRef:H,disabled:d,name:u,autoComplete:f,form:h,nativeOptions:Z,nativeSelectKey:re,isFormControl:V};return F.jsx(H0,{...m,children:F.jsx(x5,{scope:e,...ae,children:F.jsx(Us.Provider,{scope:e,children:F.jsx(y5,{scope:e,onNativeOptionAdd:ee,onNativeOptionRemove:ne,children:jh(_)?_(ae):t})})})})}be(Kh,"SelectProvider");var v5=be(n=>{const{__scopeSelect:e,children:t,...r}=n;return F.jsx(Kh,{__scopeSelect:e,...r,internal_do_not_use_render:({isFormControl:o})=>F.jsxs(F.Fragment,{children:[t,o?F.jsx(j5,{__scopeSelect:e}):null]})})},"Select"),b5="SelectTrigger",S5=I.forwardRef(be(function(e,t){const{__scopeSelect:r,disabled:o=!1,...i}=e,s=mc(r),l=Hn(b5,r),a=l.disabled||o,c=Rn(t,l.onTriggerChange),u=pc(r),f=I.useRef("touch"),[d,g,h]=_c(m=>{const p=u().filter(x=>!x.disabled),y=p.find(x=>x.value===l.value),C=xc(p,m,y);C!==void 0&&l.onValueChange(C.value)}),_=be(m=>{a||(l.onOpenChange(!0),h()),m&&(l.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})},"handleOpen");return F.jsx(k0,{asChild:!0,...s,children:F.jsx(Kt.button,{type:"button",role:"combobox","aria-controls":l.open?l.contentId:void 0,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":yi(l.value)?"":void 0,...i,ref:c,onClick:at(i.onClick,m=>{m.currentTarget.focus(),f.current!=="mouse"&&_(m)}),onPointerDown:at(i.onPointerDown,m=>{f.current=m.pointerType;const p=m.target;p.hasPointerCapture(m.pointerId)&&p.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(_(m),m.preventDefault())}),onKeyDown:at(i.onKeyDown,m=>{const p=d.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&g(m.key),!(p&&m.key===" ")&&p5.includes(m.key)&&(_(),m.preventDefault())})})})},"SelectTrigger")),w5="SelectValue",T5=I.forwardRef(be(function(e,t){const{__scopeSelect:r,className:o,style:i,children:s,placeholder:l="",...a}=e,c=Hn(w5,r),{onValueNodeHasChildrenChange:u}=c,f=s!==void 0,d=Rn(t,c.onValueNodeChange);jo(()=>{u(f)},[u,f]);const g=yi(c.value);return F.jsx(Kt.span,{...a,asChild:g?!1:a.asChild,ref:d,style:{pointerEvents:"none"},children:F.jsx(I.Fragment,{children:g?l:s},g?"placeholder":"value")})},"SelectValue")),E5=I.forwardRef(be(function(e,t){const{__scopeSelect:r,children:o,...i}=e;return F.jsx(Kt.span,{"aria-hidden":!0,...i,ref:t,children:o||"▼"})},"SelectIcon")),k5="SelectPortal",[N5,M5]=vr(k5,{forceMount:void 0}),$5=be(n=>{const{__scopeSelect:e,forceMount:t,...r}=n;return F.jsx(N5,{scope:n.__scopeSelect,forceMount:t,children:F.jsx(N0,{asChild:!0,...r})})},"SelectPortal"),sr="SelectContent",L5=I.forwardRef(be(function(e,t){const r=M5(sr,e.__scopeSelect),{forceMount:o=r.forceMount,...i}=e,s=Hn(sr,e.__scopeSelect),[l,a]=I.useState();return jo(()=>{a(new DocumentFragment)},[]),F.jsx(M0,{present:o||s.open,children:({present:c})=>c?F.jsx(I5,{...i,ref:t}):F.jsx(O5,{...i,fragment:l})})},"SelectContent")),O5=I.forwardRef(be(function(e,t){const{__scopeSelect:r,children:o,fragment:i}=e;return i?Uo.createPortal(F.jsx(Wh,{scope:r,children:F.jsx(Us.Slot,{scope:r,children:F.jsx("div",{ref:t,children:o})})}),i):null},"SelectContentFragment")),Ft=10,[Wh,Zs]=vr(sr),A5=D0("SelectContent.RemoveScroll"),I5=I.forwardRef(be(function(e,t){const{__scopeSelect:r}=e,{position:o="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:l,side:a,sideOffset:c,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:g,collisionPadding:h,sticky:_,hideWhenDetached:m,avoidCollisions:p,...y}=e,C=Hn(sr,r),[x,w]=I.useState(null),[k,b]=I.useState(null),v=Rn(t,w),[E,M]=I.useState(null),[L,H]=I.useState(null),R=pc(r),[V,Z]=I.useState(!1),G=I.useRef(!1);I.useEffect(()=>{if(x)return L0(x)},[x]),O0();const z=I.useCallback(W=>{const[ce,...Ie]=R().map(xe=>xe.ref.current),[ue]=Ie.slice(-1),de=document.activeElement;for(const xe of W)if(xe===de||(xe==null||xe.scrollIntoView({block:"nearest"}),xe===ce&&k&&(k.scrollTop=0),xe===ue&&k&&(k.scrollTop=k.scrollHeight),xe==null||xe.focus(),document.activeElement!==de))return},[R,k]),re=I.useCallback(()=>z([E,x]),[z,E,x]);I.useEffect(()=>{V&&re()},[V,re]);const{onOpenChange:ee,triggerPointerDownPosRef:ne}=C;I.useEffect(()=>{if(x){let W={x:0,y:0};const ce=be(ue=>{var de,xe;W={x:Math.abs(Math.round(ue.pageX)-(((de=ne.current)==null?void 0:de.x)??0)),y:Math.abs(Math.round(ue.pageY)-(((xe=ne.current)==null?void 0:xe.y)??0))}},"handlePointerMove"),Ie=be(ue=>{W.x<=10&&W.y<=10?ue.preventDefault():ue.composedPath().includes(x)||ee(!1),document.removeEventListener("pointermove",ce),ne.current=null},"handlePointerUp");return ne.current!==null&&(document.addEventListener("pointermove",ce),document.addEventListener("pointerup",Ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ce),document.removeEventListener("pointerup",Ie,{capture:!0})}}},[x,ee,ne]),I.useEffect(()=>{const W=be(()=>ee(!1),"close");return window.addEventListener("blur",W),window.addEventListener("resize",W),()=>{window.removeEventListener("blur",W),window.removeEventListener("resize",W)}},[ee]);const[ae,Te]=_c(W=>{const ce=R().filter(de=>!de.disabled),Ie=ce.find(de=>de.ref.current===document.activeElement),ue=xc(ce,W,Ie);ue&&setTimeout(()=>{var de;return(de=ue.ref.current)==null?void 0:de.focus()})}),Se=I.useCallback((W,ce,Ie)=>{const ue=!G.current&&!Ie;(C.value!==void 0&&C.value===ce||ue)&&(M(W),ue&&(G.current=!0))},[C.value]),Ke=I.useCallback(()=>x==null?void 0:x.focus(),[x]),Ye=I.useCallback((W,ce,Ie)=>{const ue=!G.current&&!Ie;(C.value!==void 0&&C.value===ce||ue)&&H(W)},[C.value]),ie=o==="popper"?zu:P5,_e=ie===zu?{side:a,sideOffset:c,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:g,collisionPadding:h,sticky:_,hideWhenDetached:m,avoidCollisions:p}:{};return F.jsx(Wh,{scope:r,content:x,viewport:k,onViewportChange:b,itemRefCallback:Se,selectedItem:E,onItemLeave:Ke,itemTextRefCallback:Ye,focusSelectedItem:re,selectedItemText:L,position:o,isPositioned:V,searchRef:ae,children:F.jsx(A0,{as:A5,allowPinchZoom:!0,children:F.jsx(I0,{asChild:!0,trapped:C.open,onMountAutoFocus:W=>{W.preventDefault()},onUnmountAutoFocus:at(i,W=>{var ce;(ce=C.trigger)==null||ce.focus({preventScroll:!0}),W.preventDefault()}),children:F.jsx(P0,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:W=>W.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:F.jsx(ie,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:W=>W.preventDefault(),...y,..._e,onPlaced:()=>Z(!0),ref:v,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:at(y.onKeyDown,W=>{const ce=W.ctrlKey||W.altKey||W.metaKey;if(W.key==="Tab"&&W.preventDefault(),!ce&&W.key.length===1&&Te(W.key),["ArrowUp","ArrowDown","Home","End"].includes(W.key)){let ue=R().filter(de=>!de.disabled).map(de=>de.ref.current);if(["ArrowUp","End"].includes(W.key)&&(ue=ue.slice().reverse()),["ArrowUp","ArrowDown"].includes(W.key)){const de=W.target,xe=ue.indexOf(de);ue=ue.slice(xe+1)}setTimeout(()=>z(ue)),W.preventDefault()}})})})})})})},"SelectContentImpl")),P5=I.forwardRef(be(function(e,t){const{__scopeSelect:r,onPlaced:o,...i}=e,s=Hn(sr,r),l=Zs(sr,r),[a,c]=I.useState(null),[u,f]=I.useState(null),d=Rn(t,f),g=pc(r),h=I.useRef(!1),_=I.useRef(!0),{viewport:m,selectedItem:p,selectedItemText:y,focusSelectedItem:C}=l,x=I.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&u&&m&&p&&y){const v=s.trigger.getBoundingClientRect(),E=u.getBoundingClientRect(),M=s.valueNode.getBoundingClientRect(),L=y.getBoundingClientRect();if(s.dir!=="rtl"){const de=L.left-E.left,xe=M.left-de,en=v.left-xe,tn=v.width+en,Ir=Math.max(tn,E.width),bo=window.innerWidth-Ft,Pr=ca(xe,[Ft,Math.max(Ft,bo-Ir)]);a.style.minWidth=tn+"px",a.style.left=Pr+"px"}else{const de=E.right-L.right,xe=window.innerWidth-M.right-de,en=window.innerWidth-v.right-xe,tn=v.width+en,Ir=Math.max(tn,E.width),bo=window.innerWidth-Ft,Pr=ca(xe,[Ft,Math.max(Ft,bo-Ir)]);a.style.minWidth=tn+"px",a.style.right=Pr+"px"}const H=g(),R=window.innerHeight-Ft*2,V=m.scrollHeight,Z=window.getComputedStyle(u),G=parseInt(Z.borderTopWidth,10),z=parseInt(Z.paddingTop,10),re=parseInt(Z.borderBottomWidth,10),ee=parseInt(Z.paddingBottom,10),ne=G+z+V+ee+re,ae=Math.min(p.offsetHeight*5,ne),Te=window.getComputedStyle(m),Se=parseInt(Te.paddingTop,10),Ke=parseInt(Te.paddingBottom,10),Ye=v.top+v.height/2-Ft,ie=R-Ye,_e=p.offsetHeight/2,W=p.offsetTop+_e,ce=G+z+W,Ie=ne-ce;if(ce<=Ye){const de=H.length>0&&p===H[H.length-1].ref.current;a.style.bottom="0px";const xe=u.clientHeight-m.offsetTop-m.offsetHeight,en=Math.max(ie,_e+(de?Ke:0)+xe+re),tn=ce+en;a.style.height=tn+"px"}else{const de=H.length>0&&p===H[0].ref.current;a.style.top="0px";const en=Math.max(Ye,G+m.offsetTop+(de?Se:0)+_e)+Ie;a.style.height=en+"px",m.scrollTop=ce-Ye+m.offsetTop}a.style.margin=`${Ft}px 0`,a.style.minHeight=ae+"px",a.style.maxHeight=R+"px",o==null||o(),requestAnimationFrame(()=>h.current=!0)}},[g,s.trigger,s.valueNode,a,u,m,p,y,s.dir,o]);jo(()=>x(),[x]);const[w,k]=I.useState();jo(()=>{u&&k(window.getComputedStyle(u).zIndex)},[u]);const b=I.useCallback(v=>{v&&_.current===!0&&(x(),C==null||C(),_.current=!1)},[x,C]);return F.jsx(D5,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:b,children:F.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:w},children:F.jsx(Kt.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})},"SelectItemAlignedPosition")),zu=I.forwardRef(be(function(e,t){const{__scopeSelect:r,align:o="start",collisionPadding:i=Ft,...s}=e,l=mc(r);return F.jsx(F0,{...l,...s,ref:t,align:o,collisionPadding:i,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[D5,F5]=vr(sr,{}),Ju="SelectViewport",R5=I.forwardRef(be(function(e,t){const{__scopeSelect:r,nonce:o,...i}=e,s=Zs(Ju,r),l=F5(Ju,r),a=Rn(t,s.onViewportChange),c=I.useRef(0);return F.jsxs(F.Fragment,{children:[F.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),F.jsx(Us.Slot,{scope:r,children:F.jsx(Kt.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:at(i.onScroll,u=>{const f=u.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:g}=l;if(g!=null&&g.current&&d){const h=Math.abs(c.current-f.scrollTop);if(h>0){const _=window.innerHeight-Ft*2,m=parseFloat(d.style.minHeight),p=parseFloat(d.style.height),y=Math.max(m,p);if(y<_){const C=y+h,x=Math.min(_,C),w=C-x;d.style.height=x+"px",d.style.bottom==="0px"&&(f.scrollTop=w>0?w:0,d.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})},"SelectViewport")),H5="SelectGroup",[pv,mv]=vr(H5),ua="SelectItem",[V5,B5]=vr(ua),z5=I.forwardRef(be(function(e,t){const{__scopeSelect:r,value:o,disabled:i=!1,textValue:s,...l}=e,a=Hn(ua,r),c=Zs(ua,r),u=a.value===o,[f,d]=I.useState(s??""),[g,h]=I.useState(!1),_=hc(x=>{var w;return(w=c.itemRefCallback)==null?void 0:w.call(c,x,o,i)}),m=Rn(t,_),p=Fh(),y=I.useRef("touch"),C=be(()=>{i||(a.onValueChange(o),a.onOpenChange(!1))},"handleSelect");return F.jsx(V5,{scope:r,value:o,disabled:i,textId:p,isSelected:u,onItemTextChange:I.useCallback(x=>{d(w=>w||((x==null?void 0:x.textContent)??"").trim())},[]),children:F.jsx(Us.ItemSlot,{scope:r,value:o,disabled:i,textValue:f,children:F.jsx(Kt.div,{role:"option","aria-labelledby":p,"data-highlighted":g?"":void 0,"aria-selected":u&&g,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:m,onFocus:at(l.onFocus,()=>h(!0)),onBlur:at(l.onBlur,()=>h(!1)),onClick:at(l.onClick,()=>{y.current!=="mouse"&&C()}),onPointerUp:at(l.onPointerUp,()=>{y.current==="mouse"&&C()}),onPointerDown:at(l.onPointerDown,x=>{y.current=x.pointerType}),onPointerMove:at(l.onPointerMove,x=>{var w;y.current=x.pointerType,i?(w=c.onItemLeave)==null||w.call(c):y.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:at(l.onPointerLeave,x=>{var w;x.currentTarget===document.activeElement&&((w=c.onItemLeave)==null||w.call(c))}),onKeyDown:at(l.onKeyDown,x=>{var k;i||x.target!==x.currentTarget||((k=c.searchRef)==null?void 0:k.current)!==""&&x.key===" "||(m5.includes(x.key)&&C(),x.key===" "&&x.preventDefault())})})})})},"SelectItem")),Fi="SelectItemText",J5=I.forwardRef(be(function(e,t){const{__scopeSelect:r,className:o,style:i,...s}=e,l=Hn(Fi,r),a=Zs(Fi,r),c=B5(Fi,r),u=C5(Fi,r),[f,d]=I.useState(null),g=hc(C=>{var x;return(x=a.itemTextRefCallback)==null?void 0:x.call(a,C,c.value,c.disabled)}),h=Rn(t,d,c.onItemTextChange,g),_=f==null?void 0:f.textContent,m=I.useMemo(()=>F.jsx("option",{value:c.value,disabled:c.disabled,children:_},c.value),[c.disabled,c.value,_]),{onNativeOptionAdd:p,onNativeOptionRemove:y}=u;return jo(()=>(p(m),()=>y(m)),[p,y,m]),F.jsxs(F.Fragment,{children:[F.jsx(Kt.span,{id:c.textId,...s,ref:h}),c.isSelected&&l.valueNode&&!l.valueNodeHasChildren&&!yi(l.value)?Uo.createPortal(s.children,l.valueNode):null]})},"SelectItemText")),K5=I.forwardRef(be(function(e,t){const{__scopeSelect:r,...o}=e;return F.jsx(Kt.div,{"aria-hidden":!0,...o,ref:t})},"SelectSeparator")),W5="SelectBubbleInput",j5=I.forwardRef(be(function({__scopeSelect:e,...t},r){const o=Hn(W5,e),{value:i,onValueChange:s,required:l,disabled:a,name:c,autoComplete:u,form:f}=o,{nativeOptions:d,nativeSelectKey:g}=o,h=I.useRef(null),_=Rn(r,h),m=i??"",p=Jh(m),y=Array.from(d).some(C=>(C.props.value??"")==="");return I.useEffect(()=>{const C=h.current;if(!C)return;const x=window.HTMLSelectElement.prototype,k=Object.getOwnPropertyDescriptor(x,"value").set;if(p!==m&&k){const b=new Event("change",{bubbles:!0});k.call(C,m),C.dispatchEvent(b)}},[p,m]),F.jsxs(Kt.select,{"aria-hidden":!0,required:l,tabIndex:-1,name:c,autoComplete:u,disabled:a,form:f,onChange:C=>s(C.target.value),...t,style:{...R0,...t.style},ref:_,defaultValue:m,children:[yi(i)&&!y?F.jsx("option",{value:""}):null,Array.from(d)]},g)},"SelectBubbleInput"));function jh(n){return typeof n=="function"}be(jh,"isFunction");function yi(n){return n===""||n===void 0}be(yi,"shouldShowPlaceholder");function _c(n){const e=hc(n),t=I.useRef(""),r=I.useRef(0),o=I.useCallback(s=>{const l=t.current+s;e(l),be(function a(c){t.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>a(""),1e3))},"updateSearch")(l)},[e]),i=I.useCallback(()=>{t.current="",window.clearTimeout(r.current)},[]);return I.useEffect(()=>()=>window.clearTimeout(r.current),[]),[t,o,i]}be(_c,"useTypeaheadSearch");function xc(n,e,t){const o=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,i=t?n.indexOf(t):-1;let s=Uh(n,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==t));const a=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return a!==t?a:void 0}be(xc,"findNextItem");function Uh(n,e){return n.map((t,r)=>n[(e+r)%n.length])}be(Uh,"wrapArray");var U5=Object.defineProperty,qs=(n,e)=>U5(n,"name",{value:e,configurable:!0}),Zh="Toolbar",[Z5,_v]=Hh(Zh,[Bh,zh]),qh=Bh(),Gh=zh(),[q5,G5]=Z5(Zh),Y5=I.forwardRef(qs(function(e,t){const{__scopeToolbar:r,orientation:o="horizontal",dir:i,loop:s=!0,...l}=e,a=qh(r),c=Vh(i);return F.jsx(q5,{scope:r,orientation:o,dir:c,children:F.jsx(z0,{asChild:!0,...a,orientation:o,dir:c,loop:s,children:F.jsx(Kt.div,{role:"toolbar","aria-orientation":o,dir:c,...l,ref:t})})})},"Toolbar")),Yh=I.forwardRef(qs(function(e,t){const{__scopeToolbar:r,...o}=e,i=qh(r);return F.jsx(V0,{asChild:!0,...i,focusable:!e.disabled,children:F.jsx(Kt.button,{type:"button",...o,ref:t})})},"ToolbarButton")),X5="ToolbarToggleGroup",Q5=I.forwardRef(qs(function(e,t){const{__scopeToolbar:r,...o}=e,i=G5(X5,r),s=Gh(r);return F.jsx(J0,{"data-orientation":i.orientation,dir:i.dir,...s,...o,ref:t,rovingFocus:!1})},"ToolbarToggleGroup")),e2=I.forwardRef(qs(function(e,t){const{__scopeToolbar:r,...o}=e,i=Gh(r),s={__scopeToolbar:e.__scopeToolbar};return F.jsx(Yh,{asChild:!0,...s,children:F.jsx(B0,{...i,...o,ref:t})})},"ToolbarToggleItem")),t2=Y5,n2=Yh,yc=Q5,r2=e2;const o2={}.hasOwnProperty;function Xh(n,e){let t=-1,r;if(e.extensions)for(;++te in n?T0(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var $=(n,e,t)=>E0(n,typeof e!="symbol"?e+"":e,t);import{aD as I,aO as Rn,as as F,A as k0,m as Kt,X as at,aT as jo,P as N0,l as M0,aN as hc,aS as Fh,aC as Uo,a0 as Rh,Z as $0,am as L0,aR as O0,q as A0,i as I0,g as P0,$ as Hh,a2 as D0,e as F0,L as R0,aQ as Vh,aP as Fu,u as H0,I as V0,J as B0,a1 as Bh,a3 as zh,t as z0,z as J0,aa as Ru,ab as K0,a5 as W0,a7 as aa,aB as j0,aV as U0,al as Z0,r as T,a4 as Hu,O as Vu,V as Qe,az as nn,aJ as Di,aH as $l,aE as q0,Q as Bu,av as jt,ax as hs,a9 as gc,aw as Wn,aM as En,aI as Pt,Y as So,ac as G0,ag as Y0,ae as X0,af as Q0,ad as e5,aj as t5,ah as n5,ai as r5,n as o5,v as i5,K as s5,j as l5,f as a5,aU as c5}from"../app/index-8JtvDNuA.js";var u5=Object.defineProperty,f5=(n,e)=>u5(n,"name",{value:e,configurable:!0});function Jh(n){const e=I.useRef({value:n,previous:n});return I.useMemo(()=>(e.current.value!==n&&(e.current.previous=e.current.value,e.current.value=n),e.current.previous),[n])}f5(Jh,"usePrevious");var d5=Object.defineProperty,h5=(n,e)=>d5(n,"name",{value:e,configurable:!0});function ca(n,[e,t]){return Math.min(t,Math.max(e,n))}h5(ca,"clamp");var g5=Object.defineProperty,be=(n,e)=>g5(n,"name",{value:e,configurable:!0}),p5=[" ","Enter","ArrowUp","ArrowDown"],m5=[" ","Enter"],oo="Select",[Us,pc,_5]=$0(oo),[vr,gv]=Hh(oo,[_5,Rh]),mc=Rh(),[x5,Hn]=vr(oo),[y5,C5]=vr(oo);function Kh(n){const{__scopeSelect:e,children:t,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:l,onValueChange:a,dir:c,name:u,autoComplete:f,disabled:d,required:g,form:h,internal_do_not_use_render:_}=n,m=mc(e),[p,y]=I.useState(null),[C,x]=I.useState(null),[w,k]=I.useState(!1),b=Vh(c),[v,E]=Fu({prop:r,defaultProp:o??!1,onChange:i,caller:oo}),[M,L]=Fu({prop:s,defaultProp:l,onChange:a,caller:oo}),H=I.useRef(null),R=I.useRef(M);I.useEffect(()=>{const Te=h?p==null?void 0:p.ownerDocument.getElementById(h):p==null?void 0:p.form;if(Te instanceof HTMLFormElement){const Se=be(()=>L(R.current),"reset");return Te.addEventListener("reset",Se),()=>Te.removeEventListener("reset",Se)}},[h,p,L]);const V=p?!!h||!!p.closest("form"):!0,[Z,G]=I.useState(new Set),z=Fh(),re=Array.from(Z).map(Te=>Te.props.value).join(";"),ee=I.useCallback(Te=>{G(Se=>new Set(Se).add(Te))},[]),ne=I.useCallback(Te=>{G(Se=>{const Ke=new Set(Se);return Ke.delete(Te),Ke})},[]),ae={required:g,trigger:p,onTriggerChange:y,valueNode:C,onValueNodeChange:x,valueNodeHasChildren:w,onValueNodeHasChildrenChange:k,contentId:z,value:M,onValueChange:L,open:v,onOpenChange:E,dir:b,triggerPointerDownPosRef:H,disabled:d,name:u,autoComplete:f,form:h,nativeOptions:Z,nativeSelectKey:re,isFormControl:V};return F.jsx(H0,{...m,children:F.jsx(x5,{scope:e,...ae,children:F.jsx(Us.Provider,{scope:e,children:F.jsx(y5,{scope:e,onNativeOptionAdd:ee,onNativeOptionRemove:ne,children:jh(_)?_(ae):t})})})})}be(Kh,"SelectProvider");var v5=be(n=>{const{__scopeSelect:e,children:t,...r}=n;return F.jsx(Kh,{__scopeSelect:e,...r,internal_do_not_use_render:({isFormControl:o})=>F.jsxs(F.Fragment,{children:[t,o?F.jsx(j5,{__scopeSelect:e}):null]})})},"Select"),b5="SelectTrigger",S5=I.forwardRef(be(function(e,t){const{__scopeSelect:r,disabled:o=!1,...i}=e,s=mc(r),l=Hn(b5,r),a=l.disabled||o,c=Rn(t,l.onTriggerChange),u=pc(r),f=I.useRef("touch"),[d,g,h]=_c(m=>{const p=u().filter(x=>!x.disabled),y=p.find(x=>x.value===l.value),C=xc(p,m,y);C!==void 0&&l.onValueChange(C.value)}),_=be(m=>{a||(l.onOpenChange(!0),h()),m&&(l.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})},"handleOpen");return F.jsx(k0,{asChild:!0,...s,children:F.jsx(Kt.button,{type:"button",role:"combobox","aria-controls":l.open?l.contentId:void 0,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":yi(l.value)?"":void 0,...i,ref:c,onClick:at(i.onClick,m=>{m.currentTarget.focus(),f.current!=="mouse"&&_(m)}),onPointerDown:at(i.onPointerDown,m=>{f.current=m.pointerType;const p=m.target;p.hasPointerCapture(m.pointerId)&&p.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(_(m),m.preventDefault())}),onKeyDown:at(i.onKeyDown,m=>{const p=d.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&g(m.key),!(p&&m.key===" ")&&p5.includes(m.key)&&(_(),m.preventDefault())})})})},"SelectTrigger")),w5="SelectValue",T5=I.forwardRef(be(function(e,t){const{__scopeSelect:r,className:o,style:i,children:s,placeholder:l="",...a}=e,c=Hn(w5,r),{onValueNodeHasChildrenChange:u}=c,f=s!==void 0,d=Rn(t,c.onValueNodeChange);jo(()=>{u(f)},[u,f]);const g=yi(c.value);return F.jsx(Kt.span,{...a,asChild:g?!1:a.asChild,ref:d,style:{pointerEvents:"none"},children:F.jsx(I.Fragment,{children:g?l:s},g?"placeholder":"value")})},"SelectValue")),E5=I.forwardRef(be(function(e,t){const{__scopeSelect:r,children:o,...i}=e;return F.jsx(Kt.span,{"aria-hidden":!0,...i,ref:t,children:o||"▼"})},"SelectIcon")),k5="SelectPortal",[N5,M5]=vr(k5,{forceMount:void 0}),$5=be(n=>{const{__scopeSelect:e,forceMount:t,...r}=n;return F.jsx(N5,{scope:n.__scopeSelect,forceMount:t,children:F.jsx(N0,{asChild:!0,...r})})},"SelectPortal"),sr="SelectContent",L5=I.forwardRef(be(function(e,t){const r=M5(sr,e.__scopeSelect),{forceMount:o=r.forceMount,...i}=e,s=Hn(sr,e.__scopeSelect),[l,a]=I.useState();return jo(()=>{a(new DocumentFragment)},[]),F.jsx(M0,{present:o||s.open,children:({present:c})=>c?F.jsx(I5,{...i,ref:t}):F.jsx(O5,{...i,fragment:l})})},"SelectContent")),O5=I.forwardRef(be(function(e,t){const{__scopeSelect:r,children:o,fragment:i}=e;return i?Uo.createPortal(F.jsx(Wh,{scope:r,children:F.jsx(Us.Slot,{scope:r,children:F.jsx("div",{ref:t,children:o})})}),i):null},"SelectContentFragment")),Ft=10,[Wh,Zs]=vr(sr),A5=D0("SelectContent.RemoveScroll"),I5=I.forwardRef(be(function(e,t){const{__scopeSelect:r}=e,{position:o="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:l,side:a,sideOffset:c,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:g,collisionPadding:h,sticky:_,hideWhenDetached:m,avoidCollisions:p,...y}=e,C=Hn(sr,r),[x,w]=I.useState(null),[k,b]=I.useState(null),v=Rn(t,w),[E,M]=I.useState(null),[L,H]=I.useState(null),R=pc(r),[V,Z]=I.useState(!1),G=I.useRef(!1);I.useEffect(()=>{if(x)return L0(x)},[x]),O0();const z=I.useCallback(W=>{const[ce,...Ie]=R().map(xe=>xe.ref.current),[ue]=Ie.slice(-1),de=document.activeElement;for(const xe of W)if(xe===de||(xe==null||xe.scrollIntoView({block:"nearest"}),xe===ce&&k&&(k.scrollTop=0),xe===ue&&k&&(k.scrollTop=k.scrollHeight),xe==null||xe.focus(),document.activeElement!==de))return},[R,k]),re=I.useCallback(()=>z([E,x]),[z,E,x]);I.useEffect(()=>{V&&re()},[V,re]);const{onOpenChange:ee,triggerPointerDownPosRef:ne}=C;I.useEffect(()=>{if(x){let W={x:0,y:0};const ce=be(ue=>{var de,xe;W={x:Math.abs(Math.round(ue.pageX)-(((de=ne.current)==null?void 0:de.x)??0)),y:Math.abs(Math.round(ue.pageY)-(((xe=ne.current)==null?void 0:xe.y)??0))}},"handlePointerMove"),Ie=be(ue=>{W.x<=10&&W.y<=10?ue.preventDefault():ue.composedPath().includes(x)||ee(!1),document.removeEventListener("pointermove",ce),ne.current=null},"handlePointerUp");return ne.current!==null&&(document.addEventListener("pointermove",ce),document.addEventListener("pointerup",Ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ce),document.removeEventListener("pointerup",Ie,{capture:!0})}}},[x,ee,ne]),I.useEffect(()=>{const W=be(()=>ee(!1),"close");return window.addEventListener("blur",W),window.addEventListener("resize",W),()=>{window.removeEventListener("blur",W),window.removeEventListener("resize",W)}},[ee]);const[ae,Te]=_c(W=>{const ce=R().filter(de=>!de.disabled),Ie=ce.find(de=>de.ref.current===document.activeElement),ue=xc(ce,W,Ie);ue&&setTimeout(()=>{var de;return(de=ue.ref.current)==null?void 0:de.focus()})}),Se=I.useCallback((W,ce,Ie)=>{const ue=!G.current&&!Ie;(C.value!==void 0&&C.value===ce||ue)&&(M(W),ue&&(G.current=!0))},[C.value]),Ke=I.useCallback(()=>x==null?void 0:x.focus(),[x]),Ye=I.useCallback((W,ce,Ie)=>{const ue=!G.current&&!Ie;(C.value!==void 0&&C.value===ce||ue)&&H(W)},[C.value]),ie=o==="popper"?zu:P5,_e=ie===zu?{side:a,sideOffset:c,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:g,collisionPadding:h,sticky:_,hideWhenDetached:m,avoidCollisions:p}:{};return F.jsx(Wh,{scope:r,content:x,viewport:k,onViewportChange:b,itemRefCallback:Se,selectedItem:E,onItemLeave:Ke,itemTextRefCallback:Ye,focusSelectedItem:re,selectedItemText:L,position:o,isPositioned:V,searchRef:ae,children:F.jsx(A0,{as:A5,allowPinchZoom:!0,children:F.jsx(I0,{asChild:!0,trapped:C.open,onMountAutoFocus:W=>{W.preventDefault()},onUnmountAutoFocus:at(i,W=>{var ce;(ce=C.trigger)==null||ce.focus({preventScroll:!0}),W.preventDefault()}),children:F.jsx(P0,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:W=>W.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:F.jsx(ie,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:W=>W.preventDefault(),...y,..._e,onPlaced:()=>Z(!0),ref:v,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:at(y.onKeyDown,W=>{const ce=W.ctrlKey||W.altKey||W.metaKey;if(W.key==="Tab"&&W.preventDefault(),!ce&&W.key.length===1&&Te(W.key),["ArrowUp","ArrowDown","Home","End"].includes(W.key)){let ue=R().filter(de=>!de.disabled).map(de=>de.ref.current);if(["ArrowUp","End"].includes(W.key)&&(ue=ue.slice().reverse()),["ArrowUp","ArrowDown"].includes(W.key)){const de=W.target,xe=ue.indexOf(de);ue=ue.slice(xe+1)}setTimeout(()=>z(ue)),W.preventDefault()}})})})})})})},"SelectContentImpl")),P5=I.forwardRef(be(function(e,t){const{__scopeSelect:r,onPlaced:o,...i}=e,s=Hn(sr,r),l=Zs(sr,r),[a,c]=I.useState(null),[u,f]=I.useState(null),d=Rn(t,f),g=pc(r),h=I.useRef(!1),_=I.useRef(!0),{viewport:m,selectedItem:p,selectedItemText:y,focusSelectedItem:C}=l,x=I.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&u&&m&&p&&y){const v=s.trigger.getBoundingClientRect(),E=u.getBoundingClientRect(),M=s.valueNode.getBoundingClientRect(),L=y.getBoundingClientRect();if(s.dir!=="rtl"){const de=L.left-E.left,xe=M.left-de,en=v.left-xe,tn=v.width+en,Ir=Math.max(tn,E.width),bo=window.innerWidth-Ft,Pr=ca(xe,[Ft,Math.max(Ft,bo-Ir)]);a.style.minWidth=tn+"px",a.style.left=Pr+"px"}else{const de=E.right-L.right,xe=window.innerWidth-M.right-de,en=window.innerWidth-v.right-xe,tn=v.width+en,Ir=Math.max(tn,E.width),bo=window.innerWidth-Ft,Pr=ca(xe,[Ft,Math.max(Ft,bo-Ir)]);a.style.minWidth=tn+"px",a.style.right=Pr+"px"}const H=g(),R=window.innerHeight-Ft*2,V=m.scrollHeight,Z=window.getComputedStyle(u),G=parseInt(Z.borderTopWidth,10),z=parseInt(Z.paddingTop,10),re=parseInt(Z.borderBottomWidth,10),ee=parseInt(Z.paddingBottom,10),ne=G+z+V+ee+re,ae=Math.min(p.offsetHeight*5,ne),Te=window.getComputedStyle(m),Se=parseInt(Te.paddingTop,10),Ke=parseInt(Te.paddingBottom,10),Ye=v.top+v.height/2-Ft,ie=R-Ye,_e=p.offsetHeight/2,W=p.offsetTop+_e,ce=G+z+W,Ie=ne-ce;if(ce<=Ye){const de=H.length>0&&p===H[H.length-1].ref.current;a.style.bottom="0px";const xe=u.clientHeight-m.offsetTop-m.offsetHeight,en=Math.max(ie,_e+(de?Ke:0)+xe+re),tn=ce+en;a.style.height=tn+"px"}else{const de=H.length>0&&p===H[0].ref.current;a.style.top="0px";const en=Math.max(Ye,G+m.offsetTop+(de?Se:0)+_e)+Ie;a.style.height=en+"px",m.scrollTop=ce-Ye+m.offsetTop}a.style.margin=`${Ft}px 0`,a.style.minHeight=ae+"px",a.style.maxHeight=R+"px",o==null||o(),requestAnimationFrame(()=>h.current=!0)}},[g,s.trigger,s.valueNode,a,u,m,p,y,s.dir,o]);jo(()=>x(),[x]);const[w,k]=I.useState();jo(()=>{u&&k(window.getComputedStyle(u).zIndex)},[u]);const b=I.useCallback(v=>{v&&_.current===!0&&(x(),C==null||C(),_.current=!1)},[x,C]);return F.jsx(D5,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:b,children:F.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:w},children:F.jsx(Kt.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})},"SelectItemAlignedPosition")),zu=I.forwardRef(be(function(e,t){const{__scopeSelect:r,align:o="start",collisionPadding:i=Ft,...s}=e,l=mc(r);return F.jsx(F0,{...l,...s,ref:t,align:o,collisionPadding:i,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[D5,F5]=vr(sr,{}),Ju="SelectViewport",R5=I.forwardRef(be(function(e,t){const{__scopeSelect:r,nonce:o,...i}=e,s=Zs(Ju,r),l=F5(Ju,r),a=Rn(t,s.onViewportChange),c=I.useRef(0);return F.jsxs(F.Fragment,{children:[F.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),F.jsx(Us.Slot,{scope:r,children:F.jsx(Kt.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:at(i.onScroll,u=>{const f=u.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:g}=l;if(g!=null&&g.current&&d){const h=Math.abs(c.current-f.scrollTop);if(h>0){const _=window.innerHeight-Ft*2,m=parseFloat(d.style.minHeight),p=parseFloat(d.style.height),y=Math.max(m,p);if(y<_){const C=y+h,x=Math.min(_,C),w=C-x;d.style.height=x+"px",d.style.bottom==="0px"&&(f.scrollTop=w>0?w:0,d.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})},"SelectViewport")),H5="SelectGroup",[pv,mv]=vr(H5),ua="SelectItem",[V5,B5]=vr(ua),z5=I.forwardRef(be(function(e,t){const{__scopeSelect:r,value:o,disabled:i=!1,textValue:s,...l}=e,a=Hn(ua,r),c=Zs(ua,r),u=a.value===o,[f,d]=I.useState(s??""),[g,h]=I.useState(!1),_=hc(x=>{var w;return(w=c.itemRefCallback)==null?void 0:w.call(c,x,o,i)}),m=Rn(t,_),p=Fh(),y=I.useRef("touch"),C=be(()=>{i||(a.onValueChange(o),a.onOpenChange(!1))},"handleSelect");return F.jsx(V5,{scope:r,value:o,disabled:i,textId:p,isSelected:u,onItemTextChange:I.useCallback(x=>{d(w=>w||((x==null?void 0:x.textContent)??"").trim())},[]),children:F.jsx(Us.ItemSlot,{scope:r,value:o,disabled:i,textValue:f,children:F.jsx(Kt.div,{role:"option","aria-labelledby":p,"data-highlighted":g?"":void 0,"aria-selected":u&&g,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:m,onFocus:at(l.onFocus,()=>h(!0)),onBlur:at(l.onBlur,()=>h(!1)),onClick:at(l.onClick,()=>{y.current!=="mouse"&&C()}),onPointerUp:at(l.onPointerUp,()=>{y.current==="mouse"&&C()}),onPointerDown:at(l.onPointerDown,x=>{y.current=x.pointerType}),onPointerMove:at(l.onPointerMove,x=>{var w;y.current=x.pointerType,i?(w=c.onItemLeave)==null||w.call(c):y.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:at(l.onPointerLeave,x=>{var w;x.currentTarget===document.activeElement&&((w=c.onItemLeave)==null||w.call(c))}),onKeyDown:at(l.onKeyDown,x=>{var k;i||x.target!==x.currentTarget||((k=c.searchRef)==null?void 0:k.current)!==""&&x.key===" "||(m5.includes(x.key)&&C(),x.key===" "&&x.preventDefault())})})})})},"SelectItem")),Fi="SelectItemText",J5=I.forwardRef(be(function(e,t){const{__scopeSelect:r,className:o,style:i,...s}=e,l=Hn(Fi,r),a=Zs(Fi,r),c=B5(Fi,r),u=C5(Fi,r),[f,d]=I.useState(null),g=hc(C=>{var x;return(x=a.itemTextRefCallback)==null?void 0:x.call(a,C,c.value,c.disabled)}),h=Rn(t,d,c.onItemTextChange,g),_=f==null?void 0:f.textContent,m=I.useMemo(()=>F.jsx("option",{value:c.value,disabled:c.disabled,children:_},c.value),[c.disabled,c.value,_]),{onNativeOptionAdd:p,onNativeOptionRemove:y}=u;return jo(()=>(p(m),()=>y(m)),[p,y,m]),F.jsxs(F.Fragment,{children:[F.jsx(Kt.span,{id:c.textId,...s,ref:h}),c.isSelected&&l.valueNode&&!l.valueNodeHasChildren&&!yi(l.value)?Uo.createPortal(s.children,l.valueNode):null]})},"SelectItemText")),K5=I.forwardRef(be(function(e,t){const{__scopeSelect:r,...o}=e;return F.jsx(Kt.div,{"aria-hidden":!0,...o,ref:t})},"SelectSeparator")),W5="SelectBubbleInput",j5=I.forwardRef(be(function({__scopeSelect:e,...t},r){const o=Hn(W5,e),{value:i,onValueChange:s,required:l,disabled:a,name:c,autoComplete:u,form:f}=o,{nativeOptions:d,nativeSelectKey:g}=o,h=I.useRef(null),_=Rn(r,h),m=i??"",p=Jh(m),y=Array.from(d).some(C=>(C.props.value??"")==="");return I.useEffect(()=>{const C=h.current;if(!C)return;const x=window.HTMLSelectElement.prototype,k=Object.getOwnPropertyDescriptor(x,"value").set;if(p!==m&&k){const b=new Event("change",{bubbles:!0});k.call(C,m),C.dispatchEvent(b)}},[p,m]),F.jsxs(Kt.select,{"aria-hidden":!0,required:l,tabIndex:-1,name:c,autoComplete:u,disabled:a,form:f,onChange:C=>s(C.target.value),...t,style:{...R0,...t.style},ref:_,defaultValue:m,children:[yi(i)&&!y?F.jsx("option",{value:""}):null,Array.from(d)]},g)},"SelectBubbleInput"));function jh(n){return typeof n=="function"}be(jh,"isFunction");function yi(n){return n===""||n===void 0}be(yi,"shouldShowPlaceholder");function _c(n){const e=hc(n),t=I.useRef(""),r=I.useRef(0),o=I.useCallback(s=>{const l=t.current+s;e(l),be(function a(c){t.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>a(""),1e3))},"updateSearch")(l)},[e]),i=I.useCallback(()=>{t.current="",window.clearTimeout(r.current)},[]);return I.useEffect(()=>()=>window.clearTimeout(r.current),[]),[t,o,i]}be(_c,"useTypeaheadSearch");function xc(n,e,t){const o=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,i=t?n.indexOf(t):-1;let s=Uh(n,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==t));const a=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return a!==t?a:void 0}be(xc,"findNextItem");function Uh(n,e){return n.map((t,r)=>n[(e+r)%n.length])}be(Uh,"wrapArray");var U5=Object.defineProperty,qs=(n,e)=>U5(n,"name",{value:e,configurable:!0}),Zh="Toolbar",[Z5,_v]=Hh(Zh,[Bh,zh]),qh=Bh(),Gh=zh(),[q5,G5]=Z5(Zh),Y5=I.forwardRef(qs(function(e,t){const{__scopeToolbar:r,orientation:o="horizontal",dir:i,loop:s=!0,...l}=e,a=qh(r),c=Vh(i);return F.jsx(q5,{scope:r,orientation:o,dir:c,children:F.jsx(z0,{asChild:!0,...a,orientation:o,dir:c,loop:s,children:F.jsx(Kt.div,{role:"toolbar","aria-orientation":o,dir:c,...l,ref:t})})})},"Toolbar")),Yh=I.forwardRef(qs(function(e,t){const{__scopeToolbar:r,...o}=e,i=qh(r);return F.jsx(V0,{asChild:!0,...i,focusable:!e.disabled,children:F.jsx(Kt.button,{type:"button",...o,ref:t})})},"ToolbarButton")),X5="ToolbarToggleGroup",Q5=I.forwardRef(qs(function(e,t){const{__scopeToolbar:r,...o}=e,i=G5(X5,r),s=Gh(r);return F.jsx(J0,{"data-orientation":i.orientation,dir:i.dir,...s,...o,ref:t,rovingFocus:!1})},"ToolbarToggleGroup")),e2=I.forwardRef(qs(function(e,t){const{__scopeToolbar:r,...o}=e,i=Gh(r),s={__scopeToolbar:e.__scopeToolbar};return F.jsx(Yh,{asChild:!0,...s,children:F.jsx(B0,{...i,...o,ref:t})})},"ToolbarToggleItem")),t2=Y5,n2=Yh,yc=Q5,r2=e2;const o2={}.hasOwnProperty;function Xh(n,e){let t=-1,r;if(e.extensions)for(;++t{var k;if(!l)return;const e=document.activeElement instanceof HTMLElement?document.activeElement:null,x=document.body.style.overflow,s=document.getElementById("root"),j=(s==null?void 0:s.inert)??!1;s&&(s.inert=!0),document.body.style.overflow="hidden",(k=p.current)==null||k.focus();const g=n=>{if(n.defaultPrevented||n.isComposing||(n.key==="Escape"&&(n.preventDefault(),y.current()),n.key!=="Tab"||!u.current))return;const m=[...u.current.querySelectorAll('button:not([disabled]), input[type="radio"]:checked')].filter(E=>E.getClientRects().length>0),i=m[0],r=m[m.length-1];n.shiftKey&&document.activeElement===i?(n.preventDefault(),r==null||r.focus()):!n.shiftKey&&document.activeElement===r&&(n.preventDefault(),i==null||i.focus())};return window.addEventListener("keydown",g),()=>{window.removeEventListener("keydown",g),document.body.style.overflow=x,s&&(s.inert=j),e!=null&&e.isConnected&&e.focus()}},[l]),l?D.createPortal(t.jsx("div",{className:"cw-skill-dialog-backdrop quick-agent-type-backdrop",onClick:e=>{e.target===e.currentTarget&&o()},children:t.jsxs("section",{className:"cw-skill-dialog quick-agent-type-dialog",role:"dialog","aria-modal":"true","aria-labelledby":`${d}-title`,ref:u,children:[t.jsxs("header",{className:"cw-skill-dialog-head",children:[t.jsx("h2",{id:`${d}-title`,children:c("agentType")}),t.jsx("button",{type:"button",className:"cw-skill-dialog-close",onClick:o,ref:p,"aria-label":c("close"),children:t.jsx(v,{})})]}),t.jsxs("form",{onSubmit:e=>{e.preventDefault(),b(f)},children:[t.jsx("fieldset",{className:"cw-agent-type-options quick-agent-type-options",role:"radiogroup","aria-label":c("agentType"),children:["veadk","deepseek"].map(e=>t.jsxs("label",{className:`cw-agent-type-option quick-agent-type-option${f===e?" is-on":""}`,children:[t.jsx("input",{type:"radio",name:`${d}-kind`,value:e,checked:f===e,onChange:()=>w(e)}),t.jsx("span",{children:e==="veadk"?"VeADK Agent":"DeepSeek Harness"}),e==="deepseek"&&t.jsx(R,{className:"quick-agent-beta",color:"secondary",variant:"soft",size:"sm",children:"Beta"})]},e))}),t.jsxs("footer",{className:"quick-agent-type-actions",children:[t.jsx(h,{type:"button",className:"cw-btn cw-btn-ghost",color:"secondary",variant:"ghost",onClick:o,children:c("cancel")}),t.jsx(h,{type:"submit",className:"cw-btn cw-btn-primary",color:"primary",children:c("continue")})]})]})]})}),document.body):null}export{C as default}; +import{aU as N,aD as a,aC as D,as as t,S as v,B as R,a as h}from"../app/index-8JtvDNuA.js";function C({open:l,onClose:o,onSelect:b}){const{t:c}=N("deepseek"),d=a.useId(),u=a.useRef(null),p=a.useRef(null),y=a.useRef(o),[f,w]=a.useState("veadk");return y.current=o,a.useEffect(()=>{var k;if(!l)return;const e=document.activeElement instanceof HTMLElement?document.activeElement:null,x=document.body.style.overflow,s=document.getElementById("root"),j=(s==null?void 0:s.inert)??!1;s&&(s.inert=!0),document.body.style.overflow="hidden",(k=p.current)==null||k.focus();const g=n=>{if(n.defaultPrevented||n.isComposing||(n.key==="Escape"&&(n.preventDefault(),y.current()),n.key!=="Tab"||!u.current))return;const m=[...u.current.querySelectorAll('button:not([disabled]), input[type="radio"]:checked')].filter(E=>E.getClientRects().length>0),i=m[0],r=m[m.length-1];n.shiftKey&&document.activeElement===i?(n.preventDefault(),r==null||r.focus()):!n.shiftKey&&document.activeElement===r&&(n.preventDefault(),i==null||i.focus())};return window.addEventListener("keydown",g),()=>{window.removeEventListener("keydown",g),document.body.style.overflow=x,s&&(s.inert=j),e!=null&&e.isConnected&&e.focus()}},[l]),l?D.createPortal(t.jsx("div",{className:"cw-skill-dialog-backdrop quick-agent-type-backdrop",onClick:e=>{e.target===e.currentTarget&&o()},children:t.jsxs("section",{className:"cw-skill-dialog quick-agent-type-dialog",role:"dialog","aria-modal":"true","aria-labelledby":`${d}-title`,ref:u,children:[t.jsxs("header",{className:"cw-skill-dialog-head",children:[t.jsx("h2",{id:`${d}-title`,children:c("agentType")}),t.jsx("button",{type:"button",className:"cw-skill-dialog-close",onClick:o,ref:p,"aria-label":c("close"),children:t.jsx(v,{})})]}),t.jsxs("form",{onSubmit:e=>{e.preventDefault(),b(f)},children:[t.jsx("fieldset",{className:"cw-agent-type-options quick-agent-type-options",role:"radiogroup","aria-label":c("agentType"),children:["veadk","deepseek"].map(e=>t.jsxs("label",{className:`cw-agent-type-option quick-agent-type-option${f===e?" is-on":""}`,children:[t.jsx("input",{type:"radio",name:`${d}-kind`,value:e,checked:f===e,onChange:()=>w(e)}),t.jsx("span",{children:e==="veadk"?"VeADK Agent":"DeepSeek Harness"}),e==="deepseek"&&t.jsx(R,{className:"quick-agent-beta",color:"secondary",variant:"soft",size:"sm",children:"Beta"})]},e))}),t.jsxs("footer",{className:"quick-agent-type-actions",children:[t.jsx(h,{type:"button",className:"cw-btn cw-btn-ghost",color:"secondary",variant:"ghost",onClick:o,children:c("cancel")}),t.jsx(h,{type:"submit",className:"cw-btn cw-btn-primary",color:"primary",children:c("continue")})]})]})]})}),document.body):null}export{C as default}; diff --git a/veadk/webui/assets/chunks/arc-fsSJ4XQX.js b/veadk/webui/assets/chunks/arc-B85TaV_o.js similarity index 98% rename from veadk/webui/assets/chunks/arc-fsSJ4XQX.js rename to veadk/webui/assets/chunks/arc-B85TaV_o.js index 059bac15d..65e5bd852 100644 --- a/veadk/webui/assets/chunks/arc-fsSJ4XQX.js +++ b/veadk/webui/assets/chunks/arc-B85TaV_o.js @@ -1 +1 @@ -import{ba as ln,aE as an,E as B,aY as b,D as S,ab as un,Q as y,b1 as tn,aZ as G,az as _,b as rn,l as o,ax as on,i as sn,c as fn}from"../visualizations/mermaid/mermaid.core-y4TF8bTw.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,q,w,v,A,Y,a){var z=q-l,i=w-h,n=Y-v,d=a-A,u=d*z-n*i;if(!(u*ur*r+j*j&&(O=E,Q=p),{cx:O,cy:Q,x01:-n,y01:-d,x11:O*(v/T-1),y11:Q*(v/T-1)}}function hn(){var l=cn,h=yn,q=S(0),w=null,v=gn,A=dn,Y=mn,a=null,z=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,Z=rn(c-f),t=c>f;if(a||(a=n=z()),sy))a.moveTo(0,0);else if(Z>tn-y)a.moveTo(s*B(f),s*b(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*B(c),u*b(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=Z,I=Z,O=Y.apply(this,arguments)/2,Q=O>y&&(w?+w.apply(this,arguments):G(u*u+s*s)),E=_(rn(s-u)/2,+q.apply(this,arguments)),p=E,x=E,e,r;if(Q>y){var j=sn(Q/u*b(O)),H=sn(Q/s*b(O));(P-=j*2)>y?(j*=t?1:-1,R+=j,T-=j):(P=0,R=T=(f+c)/2),(I-=H*2)>y?(H*=t?1:-1,m+=H,g-=H):(I=0,m=g=(f+c)/2)}var C=s*B(m),F=s*b(m),J=u*B(T),K=u*b(T);if(E>y){var L=s*B(g),M=s*b(g),U=u*B(R),V=u*b(R),D;if(Zy?x>y?(e=N(U,V,C,F,s,x,t),r=N(L,M,J,K,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),xy)||!(P>y)?a.lineTo(J,K):p>y?(e=N(J,K,L,M,u,-p,t),r=N(C,F,U,V,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),pr*r+j*j&&(O=E,Q=p),{cx:O,cy:Q,x01:-n,y01:-d,x11:O*(v/T-1),y11:Q*(v/T-1)}}function hn(){var l=cn,h=yn,q=S(0),w=null,v=gn,A=dn,Y=mn,a=null,z=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,Z=rn(c-f),t=c>f;if(a||(a=n=z()),sy))a.moveTo(0,0);else if(Z>tn-y)a.moveTo(s*B(f),s*b(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*B(c),u*b(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=Z,I=Z,O=Y.apply(this,arguments)/2,Q=O>y&&(w?+w.apply(this,arguments):G(u*u+s*s)),E=_(rn(s-u)/2,+q.apply(this,arguments)),p=E,x=E,e,r;if(Q>y){var j=sn(Q/u*b(O)),H=sn(Q/s*b(O));(P-=j*2)>y?(j*=t?1:-1,R+=j,T-=j):(P=0,R=T=(f+c)/2),(I-=H*2)>y?(H*=t?1:-1,m+=H,g-=H):(I=0,m=g=(f+c)/2)}var C=s*B(m),F=s*b(m),J=u*B(T),K=u*b(T);if(E>y){var L=s*B(g),M=s*b(g),U=u*B(R),V=u*b(R),D;if(Zy?x>y?(e=N(U,V,C,F,s,x,t),r=N(L,M,J,K,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),xy)||!(P>y)?a.lineTo(J,K):p>y?(e=N(J,K,L,M,u,-p,t),r=N(C,F,U,V,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),pa.lang.round(n.parse(r)[o]);export{t as c}; +import{U as a,C as n}from"../visualizations/mermaid/mermaid.core-DAx4nvmm.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c}; diff --git a/veadk/webui/assets/chunks/index.es-JsJulYHK.js b/veadk/webui/assets/chunks/index.es-DpcOlkkW.js similarity index 99% rename from veadk/webui/assets/chunks/index.es-JsJulYHK.js rename to veadk/webui/assets/chunks/index.es-DpcOlkkW.js index 7129d6bd8..f966229b7 100644 --- a/veadk/webui/assets/chunks/index.es-JsJulYHK.js +++ b/veadk/webui/assets/chunks/index.es-DpcOlkkW.js @@ -1,4 +1,4 @@ -import{U as Ke,ad as Do}from"../app/index-BNPwMQXG.js";import{_ as Xa}from"./jspdf.es.min-aFbI3tiR.js";var vt=function(a){return a&&a.Math===Math&&a},_=vt(typeof globalThis=="object"&&globalThis)||vt(typeof window=="object"&&window)||vt(typeof self=="object"&&self)||vt(typeof Ke=="object"&&Ke)||vt(typeof Ke=="object"&&Ke)||function(){return this}()||Function("return this")(),$t={},D=function(a){try{return!!a()}catch{return!0}},Pl=D,he=!Pl(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Rl=D,br=!Rl(function(){var a=(function(){}).bind();return typeof a!="function"||a.hasOwnProperty("prototype")}),Nl=br,Ft=Function.prototype.call,Y=Nl?Ft.bind(Ft):function(){return Ft.apply(Ft,arguments)},Lo={},ko={}.propertyIsEnumerable,Bo=Object.getOwnPropertyDescriptor,Il=Bo&&!ko.call({1:2},1);Lo.f=Il?function(e){var t=Bo(this,e);return!!t&&t.enumerable}:ko;var Si=function(a,e){return{enumerable:!(a&1),configurable:!(a&2),writable:!(a&4),value:e}},jo=br,Fo=Function.prototype,Wa=Fo.call,Ml=jo&&Fo.bind.bind(Wa,Wa),L=jo?Ml:function(a){return function(){return Wa.apply(a,arguments)}},Uo=L,_l=Uo({}.toString),Vl=Uo("".slice),Ce=function(a){return Vl(_l(a),8,-1)},Dl=L,Ll=D,kl=Ce,ea=Object,Bl=Dl("".split),Go=Ll(function(){return!ea("z").propertyIsEnumerable(0)})?function(a){return kl(a)==="String"?Bl(a,""):ea(a)}:ea,xr=function(a){return a==null},jl=xr,Fl=TypeError,ve=function(a){if(jl(a))throw new Fl("Can't call method on "+a);return a},Ul=Go,Gl=ve,wt=function(a){return Ul(Gl(a))},ta=typeof document=="object"&&document.all,k=typeof ta>"u"&&ta!==void 0?function(a){return typeof a=="function"||a===ta}:function(a){return typeof a=="function"},zl=k,ae=function(a){return typeof a=="object"?a!==null:zl(a)},ra=_,Hl=k,Yl=function(a){return Hl(a)?a:void 0},Fe=function(a,e){return arguments.length<2?Yl(ra[a]):ra[a]&&ra[a][e]},Xl=L,Tr=Xl({}.isPrototypeOf),Wl=_,pn=Wl.navigator,yn=pn&&pn.userAgent,Ct=yn?String(yn):"",zo=_,aa=Ct,mn=zo.process,bn=zo.Deno,xn=mn&&mn.versions||bn&&bn.version,Tn=xn&&xn.v8,le,cr;Tn&&(le=Tn.split("."),cr=le[0]>0&&le[0]<4?1:+(le[0]+le[1]));!cr&&aa&&(le=aa.match(/Edge\/(\d+)/),(!le||le[1]>=74)&&(le=aa.match(/Chrome\/(\d+)/),le&&(cr=+le[1])));var Ei=cr,On=Ei,ql=D,Ql=_,Kl=Ql.String,Ho=!!Object.getOwnPropertySymbols&&!ql(function(){var a=Symbol("symbol detection");return!Kl(a)||!(Object(a)instanceof Symbol)||!Symbol.sham&&On&&On<41}),Zl=Ho,Yo=Zl&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Jl=Fe,eh=k,th=Tr,rh=Yo,ah=Object,Xo=rh?function(a){return typeof a=="symbol"}:function(a){var e=Jl("Symbol");return eh(e)&&th(e.prototype,ah(a))},ih=String,Or=function(a){try{return ih(a)}catch{return"Object"}},nh=k,sh=Or,oh=TypeError,Ae=function(a){if(nh(a))return a;throw new oh(sh(a)+" is not a function")},uh=Ae,lh=xr,ot=function(a,e){var t=a[e];return lh(t)?void 0:uh(t)},ia=Y,na=k,sa=ae,hh=TypeError,vh=function(a,e){var t,r;if(e==="string"&&na(t=a.toString)&&!sa(r=ia(t,a))||na(t=a.valueOf)&&!sa(r=ia(t,a))||e!=="string"&&na(t=a.toString)&&!sa(r=ia(t,a)))return r;throw new hh("Can't convert object to primitive value")},Wo={exports:{}},Sn=_,fh=Object.defineProperty,$i=function(a,e){try{fh(Sn,a,{value:e,configurable:!0,writable:!0})}catch{Sn[a]=e}return e},ch=_,gh=$i,En="__core-js_shared__",$n=Wo.exports=ch[En]||gh(En,{});($n.versions||($n.versions=[])).push({version:"3.50.0",mode:"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.50.0/LICENSE",source:"https://github.com/zloirock/core-js"});var wi=Wo.exports,wn=wi,dh=Object.create||Object,Ci=function(a,e){return wn[a]||(wn[a]=e||dh(null))},ph=ve,yh=Object,Sr=function(a){return yh(ph(a))},mh=L,bh=Sr,xh=mh({}.hasOwnProperty),fe=Object.hasOwn||function(e,t){return xh(bh(e),t)},Th=L,Oh=0,Sh=Math.random(),Eh=Th(1.1.toString),qo=function(a){return"Symbol("+(a===void 0?"":a)+")_"+Eh(++Oh+Sh,36)},$h=_,wh=Ci,Cn=fe,Ch=qo,Ah=Ho,Ph=Yo,Ze=$h.Symbol,oa=wh("wks"),Rh=Ph?Ze.for||Ze:Ze&&Ze.withoutSetter||Ch,z=function(a){return Cn(oa,a)||(oa[a]=Ah&&Cn(Ze,a)?Ze[a]:Rh("Symbol."+a)),oa[a]},Nh=Y,An=ae,Pn=Xo,Ih=ot,Mh=vh,_h=z,Vh=TypeError,Dh=_h("toPrimitive"),Lh=function(a,e){if(!An(a)||Pn(a))return a;var t=Ih(a,Dh),r;if(t){if(e===void 0&&(e="default"),r=Nh(t,a,e),!An(r)||Pn(r))return r;throw new Vh("Can't convert object to primitive value")}return e===void 0&&(e="number"),Mh(a,e)},kh=Lh,Bh=Xo,Qo=function(a){var e=kh(a,"string");return Bh(e)?e:e+""},jh=_,Rn=ae,qa=jh.document,Fh=Rn(qa)&&Rn(qa.createElement),Er=function(a){return Fh?qa.createElement(a):{}},Uh=he,Gh=D,zh=Er,Ko=!Uh&&!Gh(function(){return Object.defineProperty(zh("div"),"a",{get:function(){return 7}}).a!==7}),Hh=he,Yh=Y,Xh=Lo,Wh=Si,qh=wt,Qh=Qo,Kh=fe,Zh=Ko,Nn=Object.getOwnPropertyDescriptor;$t.f=Hh?Nn:function(e,t){if(e=qh(e),t=Qh(t),Zh)try{return Nn(e,t)}catch{}if(Kh(e,t))return Wh(!Yh(Xh.f,e,t),e[t])};var Te={},Jh=he,ev=D,Zo=Jh&&ev(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),tv=ae,rv=String,av=TypeError,J=function(a){if(tv(a))return a;throw new av(rv(a)+" is not an object")},iv=he,nv=Ko,sv=Zo,Ut=J,In=Qo,ov=TypeError,ua=Object.defineProperty,uv=Object.getOwnPropertyDescriptor,la="enumerable",ha="configurable",va="writable";Te.f=iv?sv?function(e,t,r){if(Ut(e),t=In(t),Ut(r),typeof e=="function"&&t==="prototype"&&"value"in r&&va in r&&!r[va]){var i=uv(e,t);i&&i[va]&&(e[t]=r.value,r={configurable:ha in r?r[ha]:i[ha],enumerable:la in r?r[la]:i[la],writable:!1})}return ua(e,t,r)}:ua:function(e,t,r){if(Ut(e),t=In(t),Ut(r),nv)try{return ua(e,t,r)}catch{}if("get"in r||"set"in r)throw new ov("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var lv=he,hv=Te,vv=Si,At=lv?function(a,e,t){return hv.f(a,e,vv(1,t))}:function(a,e,t){return a[e]=t,a},Jo={exports:{}},Qa=he,fv=fe,eu=Function.prototype,cv=Qa&&Object.getOwnPropertyDescriptor,tu=fv(eu,"name"),gv=tu&&(function(){}).name==="something",dv=tu&&(!Qa||Qa&&cv(eu,"name").configurable),$r={PROPER:gv,CONFIGURABLE:dv},pv=L,yv=k,Ka=wi,mv=pv(Function.toString);yv(Ka.inspectSource)||(Ka.inspectSource=function(a){return mv(a)});var Ai=Ka.inspectSource,bv=_,xv=k,Mn=bv.WeakMap,Tv=xv(Mn)&&/native code/.test(String(Mn)),Ov=Ci,Sv=qo,_n=Ov("keys"),Pi=function(a){return _n[a]||(_n[a]=Sv(a))},Ri={},Ev=Tv,ru=_,$v=ae,wv=At,fa=fe,ca=wi,Cv=Pi,Av=Ri,Vn="Object already initialized",Za=ru.TypeError,Pv=ru.WeakMap,gr,Ot,dr,Rv=function(a){return dr(a)?Ot(a):gr(a,{})},Nv=function(a){return function(e){var t;if(!$v(e)||(t=Ot(e)).type!==a)throw new Za("Incompatible receiver, "+a+" required");return t}};if(Ev||ca.state){var de=ca.state||(ca.state=new Pv);de.get=de.get,de.has=de.has,de.set=de.set,gr=function(a,e){if(de.has(a))throw new Za(Vn);return e.facade=a,de.set(a,e),e},Ot=function(a){return de.get(a)||{}},dr=function(a){return de.has(a)}}else{var Ye=Cv("state");Av[Ye]=!0,gr=function(a,e){if(fa(a,Ye))throw new Za(Vn);return e.facade=a,wv(a,Ye,e),e},Ot=function(a){return fa(a,Ye)?a[Ye]:{}},dr=function(a){return fa(a,Ye)}}var wr={set:gr,get:Ot,has:dr,enforce:Rv,getterFor:Nv},Ni=L,Iv=D,Mv=k,Gt=fe,Ja=he,_v=$r.CONFIGURABLE,Vv=Ai,au=wr,Dv=au.enforce,Lv=au.get,Dn=String,or=Object.defineProperty,kv=Ni("".slice),Bv=Ni("".replace),jv=Ni([].join),Fv=Ja&&!Iv(function(){return or(function(){},"length",{value:8}).length!==8}),Uv=String(String).split("String"),Gv=Jo.exports=function(a,e,t){kv(Dn(e),0,7)==="Symbol("&&(e="["+Bv(Dn(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),t&&t.getter&&(e="get "+e),t&&t.setter&&(e="set "+e),(!Gt(a,"name")||_v&&a.name!==e)&&(Ja?or(a,"name",{value:e,configurable:!0}):a.name=e),Fv&&t&&Gt(t,"arity")&&a.length!==t.arity&&or(a,"length",{value:t.arity});try{t&&Gt(t,"constructor")&&t.constructor?Ja&&or(a,"prototype",{writable:!1}):a.prototype&&(a.prototype=void 0)}catch{}var r=Dv(a);return Gt(r,"source")||(r.source=jv(Uv,typeof e=="string"?e:"")),a};Function.prototype.toString=Gv(function(){return Mv(this)&&Lv(this).source||Vv(this)},"toString");var iu=Jo.exports,zv=k,Hv=Te,Yv=iu,Xv=$i,Ue=function(a,e,t,r){r||(r={});var i=r.enumerable,n=r.name!==void 0?r.name:e;if(zv(t)&&Yv(t,n,r),r.global)i?a[e]=t:Xv(e,t);else{try{r.unsafe?a[e]&&(i=!0):delete a[e]}catch{}i?a[e]=t:Hv.f(a,e,{value:t,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return a},nu={},Wv=Math.ceil,qv=Math.floor,Qv=Math.trunc||function(e){var t=+e;return(t>0?qv:Wv)(t)},Kv=Qv,Cr=function(a){var e=+a;return e!==e||e===0?0:Kv(e)},Zv=Cr,Jv=Math.max,ef=Math.min,tf=function(a,e){var t=Zv(a);return t<0?Jv(t+e,0):ef(t,e)},rf=Cr,af=Math.min,ut=function(a){var e=rf(a);return e>0?af(e,9007199254740991):0},nf=ut,Ii=function(a){return nf(a.length)},sf=wt,of=tf,uf=Ii,lf=function(a){return function(e,t,r){var i=sf(e),n=uf(i);if(n===0)return!a&&-1;var o=of(r,n),s;if(a&&t!==t){for(;n>o;)if(s=i[o++],s!==s)return!0}else for(;n>o;o++)if((a||o in i)&&i[o]===t)return a||o||0;return!a&&-1}},su={indexOf:lf(!1)},hf=L,ga=fe,vf=wt,ff=su.indexOf,cf=Ri,Ln=hf([].push),ou=function(a,e){var t=vf(a),r=0,i=[],n;for(n in t)!ga(cf,n)&&ga(t,n)&&Ln(i,n);for(;e.length>r;)ga(t,n=e[r++])&&(~ff(i,n)||Ln(i,n));return i},Mi=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],gf=ou,df=Mi,pf=df.concat("length","prototype");nu.f=Object.getOwnPropertyNames||function(e){return gf(e,pf)};var uu={};uu.f=Object.getOwnPropertySymbols;var yf=Fe,mf=L,bf=nu,xf=uu,Tf=J,Of=mf([].concat),Sf=yf("Reflect","ownKeys")||function(e){var t=bf.f(Tf(e)),r=xf.f;return r?Of(t,r(e)):t},kn=fe,Ef=Sf,$f=$t,wf=Te,Cf=function(a,e,t){for(var r=Ef(e),i=wf.f,n=$f.f,o=0;of;f++)if(v=y(a[f]),v&&ms(xs,v))return v;return new hr(!1)}l=wd(a,h)}for(g=n?a.next:l.next;!(d=Td(g,l)).done;){var T=d.value;try{v=y(T)}catch(b){if(l)bs(l,"throw",b);else throw b}if(typeof v=="object"&&v&&ms(xs,v))return v}return new hr(!1)},Pd=z,Gu=Pd("iterator"),zu=!1;try{var Rd=0,Ts={next:function(){return{done:!!Rd++}},return:function(){zu=!0}};Ts[Gu]=function(){return this},Array.from(Ts,function(){throw 2})}catch{}var Nd=function(a,e){try{if(!e&&!zu)return!1}catch{return!1}var t=!1;try{var r={};r[Gu]=function(){return{next:function(){return{done:t=!0}}}},a(r)}catch{}return t},Id=Nr,Md=Nd,_d=Rt.CONSTRUCTOR,Hu=_d||!Md(function(a){Id.all(a).then(void 0,function(){})}),Vd=ee,Dd=Y,Ld=Ae,kd=lt,Bd=Li,jd=Uu,Fd=Hu;Vd({target:"Promise",stat:!0,forced:Fd},{all:function(e){var t=this,r=kd.f(t),i=r.resolve,n=r.reject,o=Bd(function(){var s=Ld(t.resolve),u=[],l=0,h=1;jd(e,function(f){var c=l++,v=!1;h++,Dd(s,t,f).then(function(g){v||(v=!0,u[c]=g,--h||i(u))},n)}),--h||i(u)});return o.error&&n(o.value),r.promise}});var Ud=ee,Gd=Rt.CONSTRUCTOR,si=Nr,zd=Fe,Hd=k,Yd=Ue,Os=si&&si.prototype;Ud({target:"Promise",proto:!0,forced:Gd,real:!0},{catch:function(a){return this.then(void 0,a)}});if(Hd(si)){var Ss=zd("Promise").prototype.catch;Os.catch!==Ss&&Yd(Os,"catch",Ss,{unsafe:!0})}var Xd=ee,Wd=Y,qd=Ae,Qd=lt,Kd=Li,Zd=Uu,Jd=Hu;Xd({target:"Promise",stat:!0,forced:Jd},{race:function(e){var t=this,r=Qd.f(t),i=r.reject,n=Kd(function(){var o=qd(t.resolve);Zd(e,function(s){Wd(o,t,s).then(r.resolve,i)})});return n.error&&i(n.value),r.promise}});var ep=ee,tp=lt,rp=Rt.CONSTRUCTOR;ep({target:"Promise",stat:!0,forced:rp},{reject:function(e){var t=tp.f(this),r=t.reject;return r(e),t.promise}});var ap=J,ip=ae,np=lt,sp=function(a,e){if(ap(a),ip(e)&&e.constructor===a)return e;var t=np.f(a),r=t.resolve;return r(e),t.promise},op=ee,up=Fe,lp=Rt.CONSTRUCTOR,hp=sp;up("Promise");op({target:"Promise",stat:!0,forced:lp},{resolve:function(e){return hp(this,e)}});function Es(a,e,t,r,i,n,o){try{var s=a[n](o),u=s.value}catch(l){return void t(l)}s.done?e(u):Promise.resolve(u).then(r,i)}function xe(a){return function(){var e=this,t=arguments;return new Promise(function(r,i){var n=a.apply(e,t);function o(u){Es(n,r,i,o,s,"next",u)}function s(u){Es(n,r,i,o,s,"throw",u)}o(void 0)})}}var vp=cu,fp=String,pe=function(a){if(vp(a)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return fp(a)},cp=J,Yu=function(){var a=cp(this),e="";return a.hasIndices&&(e+="d"),a.global&&(e+="g"),a.ignoreCase&&(e+="i"),a.multiline&&(e+="m"),a.dotAll&&(e+="s"),a.unicode&&(e+="u"),a.unicodeSets&&(e+="v"),a.sticky&&(e+="y"),e},Ui=D,gp=_,Gi=gp.RegExp,zi=Ui(function(){var a=Gi("a","y");return a.lastIndex=2,a.exec("abcd")!==null});zi||Ui(function(){return!Gi("a","y").sticky});var dp=zi||Ui(function(){var a=Gi("^r","gy");return a.lastIndex=2,a.exec("str")!==null}),Xu={BROKEN_CARET:dp,UNSUPPORTED_Y:zi},Wu={},pp=ou,yp=Mi,mp=Object.keys||function(e){return pp(e,yp)},bp=he,xp=Zo,Tp=Te,Op=J,Sp=wt,Ep=mp;Wu.f=bp&&!xp?Object.defineProperties:function(e,t){Op(e);for(var r=Sp(t),i=Ep(t),n=i.length,o=0,s;n>o;)Tp.f(e,s=i[o++],r[s]);return e};var $p=J,wp=Wu,$s=Mi,Cp=Ri,Ap=Tu,Pp=Er,Rp=Pi,ws=">",Cs="<",oi="prototype",ui="script",qu=Rp("IE_PROTO"),wa=function(){},Qu=function(a){return Cs+ui+ws+a+Cs+"/"+ui+ws},As=function(a){a.write(Qu("")),a.close();var e=a.parentWindow.Object;return a=null,e},Np=function(){var a=Pp("iframe"),e="java"+ui+":",t;return a.style.display="none",Ap.appendChild(a),a.src=String(e),t=a.contentWindow.document,t.open(),t.write(Qu("document.F=Object")),t.close(),t.F},Zt,vr=function(){try{Zt=new ActiveXObject("htmlfile")}catch{}vr=typeof document<"u"?document.domain&&Zt?As(Zt):Np():As(Zt);for(var a=$s.length;a--;)delete vr[oi][$s[a]];return vr()};Cp[qu]=!0;var Hi=Object.create||function(e,t){var r;return e!==null?(wa[oi]=$p(e),r=new wa,wa[oi]=null,r[qu]=e):r=vr(),t===void 0?r:wp.f(r,t)},Ip=D,Mp=_,_p=Mp.RegExp,Vp=Ip(function(){var a=_p(".","s");return!(a.dotAll&&a.test(` +import{U as Ke,ad as Do}from"../app/index-8JtvDNuA.js";import{_ as Xa}from"./jspdf.es.min-DVclzE4e.js";var vt=function(a){return a&&a.Math===Math&&a},_=vt(typeof globalThis=="object"&&globalThis)||vt(typeof window=="object"&&window)||vt(typeof self=="object"&&self)||vt(typeof Ke=="object"&&Ke)||vt(typeof Ke=="object"&&Ke)||function(){return this}()||Function("return this")(),$t={},D=function(a){try{return!!a()}catch{return!0}},Pl=D,he=!Pl(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Rl=D,br=!Rl(function(){var a=(function(){}).bind();return typeof a!="function"||a.hasOwnProperty("prototype")}),Nl=br,Ft=Function.prototype.call,Y=Nl?Ft.bind(Ft):function(){return Ft.apply(Ft,arguments)},Lo={},ko={}.propertyIsEnumerable,Bo=Object.getOwnPropertyDescriptor,Il=Bo&&!ko.call({1:2},1);Lo.f=Il?function(e){var t=Bo(this,e);return!!t&&t.enumerable}:ko;var Si=function(a,e){return{enumerable:!(a&1),configurable:!(a&2),writable:!(a&4),value:e}},jo=br,Fo=Function.prototype,Wa=Fo.call,Ml=jo&&Fo.bind.bind(Wa,Wa),L=jo?Ml:function(a){return function(){return Wa.apply(a,arguments)}},Uo=L,_l=Uo({}.toString),Vl=Uo("".slice),Ce=function(a){return Vl(_l(a),8,-1)},Dl=L,Ll=D,kl=Ce,ea=Object,Bl=Dl("".split),Go=Ll(function(){return!ea("z").propertyIsEnumerable(0)})?function(a){return kl(a)==="String"?Bl(a,""):ea(a)}:ea,xr=function(a){return a==null},jl=xr,Fl=TypeError,ve=function(a){if(jl(a))throw new Fl("Can't call method on "+a);return a},Ul=Go,Gl=ve,wt=function(a){return Ul(Gl(a))},ta=typeof document=="object"&&document.all,k=typeof ta>"u"&&ta!==void 0?function(a){return typeof a=="function"||a===ta}:function(a){return typeof a=="function"},zl=k,ae=function(a){return typeof a=="object"?a!==null:zl(a)},ra=_,Hl=k,Yl=function(a){return Hl(a)?a:void 0},Fe=function(a,e){return arguments.length<2?Yl(ra[a]):ra[a]&&ra[a][e]},Xl=L,Tr=Xl({}.isPrototypeOf),Wl=_,pn=Wl.navigator,yn=pn&&pn.userAgent,Ct=yn?String(yn):"",zo=_,aa=Ct,mn=zo.process,bn=zo.Deno,xn=mn&&mn.versions||bn&&bn.version,Tn=xn&&xn.v8,le,cr;Tn&&(le=Tn.split("."),cr=le[0]>0&&le[0]<4?1:+(le[0]+le[1]));!cr&&aa&&(le=aa.match(/Edge\/(\d+)/),(!le||le[1]>=74)&&(le=aa.match(/Chrome\/(\d+)/),le&&(cr=+le[1])));var Ei=cr,On=Ei,ql=D,Ql=_,Kl=Ql.String,Ho=!!Object.getOwnPropertySymbols&&!ql(function(){var a=Symbol("symbol detection");return!Kl(a)||!(Object(a)instanceof Symbol)||!Symbol.sham&&On&&On<41}),Zl=Ho,Yo=Zl&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Jl=Fe,eh=k,th=Tr,rh=Yo,ah=Object,Xo=rh?function(a){return typeof a=="symbol"}:function(a){var e=Jl("Symbol");return eh(e)&&th(e.prototype,ah(a))},ih=String,Or=function(a){try{return ih(a)}catch{return"Object"}},nh=k,sh=Or,oh=TypeError,Ae=function(a){if(nh(a))return a;throw new oh(sh(a)+" is not a function")},uh=Ae,lh=xr,ot=function(a,e){var t=a[e];return lh(t)?void 0:uh(t)},ia=Y,na=k,sa=ae,hh=TypeError,vh=function(a,e){var t,r;if(e==="string"&&na(t=a.toString)&&!sa(r=ia(t,a))||na(t=a.valueOf)&&!sa(r=ia(t,a))||e!=="string"&&na(t=a.toString)&&!sa(r=ia(t,a)))return r;throw new hh("Can't convert object to primitive value")},Wo={exports:{}},Sn=_,fh=Object.defineProperty,$i=function(a,e){try{fh(Sn,a,{value:e,configurable:!0,writable:!0})}catch{Sn[a]=e}return e},ch=_,gh=$i,En="__core-js_shared__",$n=Wo.exports=ch[En]||gh(En,{});($n.versions||($n.versions=[])).push({version:"3.50.0",mode:"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.50.0/LICENSE",source:"https://github.com/zloirock/core-js"});var wi=Wo.exports,wn=wi,dh=Object.create||Object,Ci=function(a,e){return wn[a]||(wn[a]=e||dh(null))},ph=ve,yh=Object,Sr=function(a){return yh(ph(a))},mh=L,bh=Sr,xh=mh({}.hasOwnProperty),fe=Object.hasOwn||function(e,t){return xh(bh(e),t)},Th=L,Oh=0,Sh=Math.random(),Eh=Th(1.1.toString),qo=function(a){return"Symbol("+(a===void 0?"":a)+")_"+Eh(++Oh+Sh,36)},$h=_,wh=Ci,Cn=fe,Ch=qo,Ah=Ho,Ph=Yo,Ze=$h.Symbol,oa=wh("wks"),Rh=Ph?Ze.for||Ze:Ze&&Ze.withoutSetter||Ch,z=function(a){return Cn(oa,a)||(oa[a]=Ah&&Cn(Ze,a)?Ze[a]:Rh("Symbol."+a)),oa[a]},Nh=Y,An=ae,Pn=Xo,Ih=ot,Mh=vh,_h=z,Vh=TypeError,Dh=_h("toPrimitive"),Lh=function(a,e){if(!An(a)||Pn(a))return a;var t=Ih(a,Dh),r;if(t){if(e===void 0&&(e="default"),r=Nh(t,a,e),!An(r)||Pn(r))return r;throw new Vh("Can't convert object to primitive value")}return e===void 0&&(e="number"),Mh(a,e)},kh=Lh,Bh=Xo,Qo=function(a){var e=kh(a,"string");return Bh(e)?e:e+""},jh=_,Rn=ae,qa=jh.document,Fh=Rn(qa)&&Rn(qa.createElement),Er=function(a){return Fh?qa.createElement(a):{}},Uh=he,Gh=D,zh=Er,Ko=!Uh&&!Gh(function(){return Object.defineProperty(zh("div"),"a",{get:function(){return 7}}).a!==7}),Hh=he,Yh=Y,Xh=Lo,Wh=Si,qh=wt,Qh=Qo,Kh=fe,Zh=Ko,Nn=Object.getOwnPropertyDescriptor;$t.f=Hh?Nn:function(e,t){if(e=qh(e),t=Qh(t),Zh)try{return Nn(e,t)}catch{}if(Kh(e,t))return Wh(!Yh(Xh.f,e,t),e[t])};var Te={},Jh=he,ev=D,Zo=Jh&&ev(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),tv=ae,rv=String,av=TypeError,J=function(a){if(tv(a))return a;throw new av(rv(a)+" is not an object")},iv=he,nv=Ko,sv=Zo,Ut=J,In=Qo,ov=TypeError,ua=Object.defineProperty,uv=Object.getOwnPropertyDescriptor,la="enumerable",ha="configurable",va="writable";Te.f=iv?sv?function(e,t,r){if(Ut(e),t=In(t),Ut(r),typeof e=="function"&&t==="prototype"&&"value"in r&&va in r&&!r[va]){var i=uv(e,t);i&&i[va]&&(e[t]=r.value,r={configurable:ha in r?r[ha]:i[ha],enumerable:la in r?r[la]:i[la],writable:!1})}return ua(e,t,r)}:ua:function(e,t,r){if(Ut(e),t=In(t),Ut(r),nv)try{return ua(e,t,r)}catch{}if("get"in r||"set"in r)throw new ov("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var lv=he,hv=Te,vv=Si,At=lv?function(a,e,t){return hv.f(a,e,vv(1,t))}:function(a,e,t){return a[e]=t,a},Jo={exports:{}},Qa=he,fv=fe,eu=Function.prototype,cv=Qa&&Object.getOwnPropertyDescriptor,tu=fv(eu,"name"),gv=tu&&(function(){}).name==="something",dv=tu&&(!Qa||Qa&&cv(eu,"name").configurable),$r={PROPER:gv,CONFIGURABLE:dv},pv=L,yv=k,Ka=wi,mv=pv(Function.toString);yv(Ka.inspectSource)||(Ka.inspectSource=function(a){return mv(a)});var Ai=Ka.inspectSource,bv=_,xv=k,Mn=bv.WeakMap,Tv=xv(Mn)&&/native code/.test(String(Mn)),Ov=Ci,Sv=qo,_n=Ov("keys"),Pi=function(a){return _n[a]||(_n[a]=Sv(a))},Ri={},Ev=Tv,ru=_,$v=ae,wv=At,fa=fe,ca=wi,Cv=Pi,Av=Ri,Vn="Object already initialized",Za=ru.TypeError,Pv=ru.WeakMap,gr,Ot,dr,Rv=function(a){return dr(a)?Ot(a):gr(a,{})},Nv=function(a){return function(e){var t;if(!$v(e)||(t=Ot(e)).type!==a)throw new Za("Incompatible receiver, "+a+" required");return t}};if(Ev||ca.state){var de=ca.state||(ca.state=new Pv);de.get=de.get,de.has=de.has,de.set=de.set,gr=function(a,e){if(de.has(a))throw new Za(Vn);return e.facade=a,de.set(a,e),e},Ot=function(a){return de.get(a)||{}},dr=function(a){return de.has(a)}}else{var Ye=Cv("state");Av[Ye]=!0,gr=function(a,e){if(fa(a,Ye))throw new Za(Vn);return e.facade=a,wv(a,Ye,e),e},Ot=function(a){return fa(a,Ye)?a[Ye]:{}},dr=function(a){return fa(a,Ye)}}var wr={set:gr,get:Ot,has:dr,enforce:Rv,getterFor:Nv},Ni=L,Iv=D,Mv=k,Gt=fe,Ja=he,_v=$r.CONFIGURABLE,Vv=Ai,au=wr,Dv=au.enforce,Lv=au.get,Dn=String,or=Object.defineProperty,kv=Ni("".slice),Bv=Ni("".replace),jv=Ni([].join),Fv=Ja&&!Iv(function(){return or(function(){},"length",{value:8}).length!==8}),Uv=String(String).split("String"),Gv=Jo.exports=function(a,e,t){kv(Dn(e),0,7)==="Symbol("&&(e="["+Bv(Dn(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),t&&t.getter&&(e="get "+e),t&&t.setter&&(e="set "+e),(!Gt(a,"name")||_v&&a.name!==e)&&(Ja?or(a,"name",{value:e,configurable:!0}):a.name=e),Fv&&t&&Gt(t,"arity")&&a.length!==t.arity&&or(a,"length",{value:t.arity});try{t&&Gt(t,"constructor")&&t.constructor?Ja&&or(a,"prototype",{writable:!1}):a.prototype&&(a.prototype=void 0)}catch{}var r=Dv(a);return Gt(r,"source")||(r.source=jv(Uv,typeof e=="string"?e:"")),a};Function.prototype.toString=Gv(function(){return Mv(this)&&Lv(this).source||Vv(this)},"toString");var iu=Jo.exports,zv=k,Hv=Te,Yv=iu,Xv=$i,Ue=function(a,e,t,r){r||(r={});var i=r.enumerable,n=r.name!==void 0?r.name:e;if(zv(t)&&Yv(t,n,r),r.global)i?a[e]=t:Xv(e,t);else{try{r.unsafe?a[e]&&(i=!0):delete a[e]}catch{}i?a[e]=t:Hv.f(a,e,{value:t,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return a},nu={},Wv=Math.ceil,qv=Math.floor,Qv=Math.trunc||function(e){var t=+e;return(t>0?qv:Wv)(t)},Kv=Qv,Cr=function(a){var e=+a;return e!==e||e===0?0:Kv(e)},Zv=Cr,Jv=Math.max,ef=Math.min,tf=function(a,e){var t=Zv(a);return t<0?Jv(t+e,0):ef(t,e)},rf=Cr,af=Math.min,ut=function(a){var e=rf(a);return e>0?af(e,9007199254740991):0},nf=ut,Ii=function(a){return nf(a.length)},sf=wt,of=tf,uf=Ii,lf=function(a){return function(e,t,r){var i=sf(e),n=uf(i);if(n===0)return!a&&-1;var o=of(r,n),s;if(a&&t!==t){for(;n>o;)if(s=i[o++],s!==s)return!0}else for(;n>o;o++)if((a||o in i)&&i[o]===t)return a||o||0;return!a&&-1}},su={indexOf:lf(!1)},hf=L,ga=fe,vf=wt,ff=su.indexOf,cf=Ri,Ln=hf([].push),ou=function(a,e){var t=vf(a),r=0,i=[],n;for(n in t)!ga(cf,n)&&ga(t,n)&&Ln(i,n);for(;e.length>r;)ga(t,n=e[r++])&&(~ff(i,n)||Ln(i,n));return i},Mi=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],gf=ou,df=Mi,pf=df.concat("length","prototype");nu.f=Object.getOwnPropertyNames||function(e){return gf(e,pf)};var uu={};uu.f=Object.getOwnPropertySymbols;var yf=Fe,mf=L,bf=nu,xf=uu,Tf=J,Of=mf([].concat),Sf=yf("Reflect","ownKeys")||function(e){var t=bf.f(Tf(e)),r=xf.f;return r?Of(t,r(e)):t},kn=fe,Ef=Sf,$f=$t,wf=Te,Cf=function(a,e,t){for(var r=Ef(e),i=wf.f,n=$f.f,o=0;of;f++)if(v=y(a[f]),v&&ms(xs,v))return v;return new hr(!1)}l=wd(a,h)}for(g=n?a.next:l.next;!(d=Td(g,l)).done;){var T=d.value;try{v=y(T)}catch(b){if(l)bs(l,"throw",b);else throw b}if(typeof v=="object"&&v&&ms(xs,v))return v}return new hr(!1)},Pd=z,Gu=Pd("iterator"),zu=!1;try{var Rd=0,Ts={next:function(){return{done:!!Rd++}},return:function(){zu=!0}};Ts[Gu]=function(){return this},Array.from(Ts,function(){throw 2})}catch{}var Nd=function(a,e){try{if(!e&&!zu)return!1}catch{return!1}var t=!1;try{var r={};r[Gu]=function(){return{next:function(){return{done:t=!0}}}},a(r)}catch{}return t},Id=Nr,Md=Nd,_d=Rt.CONSTRUCTOR,Hu=_d||!Md(function(a){Id.all(a).then(void 0,function(){})}),Vd=ee,Dd=Y,Ld=Ae,kd=lt,Bd=Li,jd=Uu,Fd=Hu;Vd({target:"Promise",stat:!0,forced:Fd},{all:function(e){var t=this,r=kd.f(t),i=r.resolve,n=r.reject,o=Bd(function(){var s=Ld(t.resolve),u=[],l=0,h=1;jd(e,function(f){var c=l++,v=!1;h++,Dd(s,t,f).then(function(g){v||(v=!0,u[c]=g,--h||i(u))},n)}),--h||i(u)});return o.error&&n(o.value),r.promise}});var Ud=ee,Gd=Rt.CONSTRUCTOR,si=Nr,zd=Fe,Hd=k,Yd=Ue,Os=si&&si.prototype;Ud({target:"Promise",proto:!0,forced:Gd,real:!0},{catch:function(a){return this.then(void 0,a)}});if(Hd(si)){var Ss=zd("Promise").prototype.catch;Os.catch!==Ss&&Yd(Os,"catch",Ss,{unsafe:!0})}var Xd=ee,Wd=Y,qd=Ae,Qd=lt,Kd=Li,Zd=Uu,Jd=Hu;Xd({target:"Promise",stat:!0,forced:Jd},{race:function(e){var t=this,r=Qd.f(t),i=r.reject,n=Kd(function(){var o=qd(t.resolve);Zd(e,function(s){Wd(o,t,s).then(r.resolve,i)})});return n.error&&i(n.value),r.promise}});var ep=ee,tp=lt,rp=Rt.CONSTRUCTOR;ep({target:"Promise",stat:!0,forced:rp},{reject:function(e){var t=tp.f(this),r=t.reject;return r(e),t.promise}});var ap=J,ip=ae,np=lt,sp=function(a,e){if(ap(a),ip(e)&&e.constructor===a)return e;var t=np.f(a),r=t.resolve;return r(e),t.promise},op=ee,up=Fe,lp=Rt.CONSTRUCTOR,hp=sp;up("Promise");op({target:"Promise",stat:!0,forced:lp},{resolve:function(e){return hp(this,e)}});function Es(a,e,t,r,i,n,o){try{var s=a[n](o),u=s.value}catch(l){return void t(l)}s.done?e(u):Promise.resolve(u).then(r,i)}function xe(a){return function(){var e=this,t=arguments;return new Promise(function(r,i){var n=a.apply(e,t);function o(u){Es(n,r,i,o,s,"next",u)}function s(u){Es(n,r,i,o,s,"throw",u)}o(void 0)})}}var vp=cu,fp=String,pe=function(a){if(vp(a)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return fp(a)},cp=J,Yu=function(){var a=cp(this),e="";return a.hasIndices&&(e+="d"),a.global&&(e+="g"),a.ignoreCase&&(e+="i"),a.multiline&&(e+="m"),a.dotAll&&(e+="s"),a.unicode&&(e+="u"),a.unicodeSets&&(e+="v"),a.sticky&&(e+="y"),e},Ui=D,gp=_,Gi=gp.RegExp,zi=Ui(function(){var a=Gi("a","y");return a.lastIndex=2,a.exec("abcd")!==null});zi||Ui(function(){return!Gi("a","y").sticky});var dp=zi||Ui(function(){var a=Gi("^r","gy");return a.lastIndex=2,a.exec("str")!==null}),Xu={BROKEN_CARET:dp,UNSUPPORTED_Y:zi},Wu={},pp=ou,yp=Mi,mp=Object.keys||function(e){return pp(e,yp)},bp=he,xp=Zo,Tp=Te,Op=J,Sp=wt,Ep=mp;Wu.f=bp&&!xp?Object.defineProperties:function(e,t){Op(e);for(var r=Sp(t),i=Ep(t),n=i.length,o=0,s;n>o;)Tp.f(e,s=i[o++],r[s]);return e};var $p=J,wp=Wu,$s=Mi,Cp=Ri,Ap=Tu,Pp=Er,Rp=Pi,ws=">",Cs="<",oi="prototype",ui="script",qu=Rp("IE_PROTO"),wa=function(){},Qu=function(a){return Cs+ui+ws+a+Cs+"/"+ui+ws},As=function(a){a.write(Qu("")),a.close();var e=a.parentWindow.Object;return a=null,e},Np=function(){var a=Pp("iframe"),e="java"+ui+":",t;return a.style.display="none",Ap.appendChild(a),a.src=String(e),t=a.contentWindow.document,t.open(),t.write(Qu("document.F=Object")),t.close(),t.F},Zt,vr=function(){try{Zt=new ActiveXObject("htmlfile")}catch{}vr=typeof document<"u"?document.domain&&Zt?As(Zt):Np():As(Zt);for(var a=$s.length;a--;)delete vr[oi][$s[a]];return vr()};Cp[qu]=!0;var Hi=Object.create||function(e,t){var r;return e!==null?(wa[oi]=$p(e),r=new wa,wa[oi]=null,r[qu]=e):r=vr(),t===void 0?r:wp.f(r,t)},Ip=D,Mp=_,_p=Mp.RegExp,Vp=Ip(function(){var a=_p(".","s");return!(a.dotAll&&a.test(` `)&&a.flags==="s")}),Dp=D,Lp=_,kp=Lp.RegExp,Bp=Dp(function(){var a=kp("(?b)","g");return a.exec("b").groups.a!=="b"||"b".replace(a,"$c")!=="bc"}),et=Y,_r=L,jp=pe,Fp=Yu,Up=Xu,Gp=Ci,zp=Hi,Hp=wr.get,Yp=Vp,Xp=Bp,Wp=Gp("native-string-replace",String.prototype.replace),mr=RegExp.prototype.exec,li=mr,qp=_r("".charAt),Qp=_r("".indexOf),Kp=_r("".replace),Ps=_r("".slice),hi=function(){var a=/a/,e=/b*/g;return et(mr,a,"a"),et(mr,e,"a"),a.lastIndex!==0||e.lastIndex!==0}(),Ku=Up.BROKEN_CARET,vi=/()??/.exec("")[1]!==void 0,Zp=hi||vi||Ku||Yp||Xp,Rs=function(a,e){for(var t=a.groups=zp(null),r=0;r0&&qp(i,t.lastIndex-1);t.lastIndex>0&&(!t.multiline||t.multiline&&d!==` `&&d!=="\r"&&d!=="\u2028"&&d!=="\u2029")&&(c="(?: (?:"+c+"))",g=" "+g,v++),s=new RegExp("^(?:"+c+")",f)}vi&&(s=new RegExp("^"+c+"$(?!\\s)",f)),hi&&(u=t.lastIndex);var p=et(mr,h?s:t,g);return h?p?(p.input=i,p[0]=Ps(p[0],v),p.index=t.lastIndex,t.lastIndex+=p[0].length):t.lastIndex=0:hi&&p&&(t.lastIndex=t.global?p.index+p[0].length:u),vi&&p&&p.length>1&&et(Wp,p[0],s,function(){for(var y=1;y=n?a?"":void 0:(o=Vs(r,i),o<55296||o>56319||i+1===n||(s=Vs(r,i+1))<56320||s>57343?a?sy(r,i):o:a?oy(r,i,i+2):(o-55296<<10)+(s-56320)+65536)}},ly={charAt:uy(!0)},hy=ly.charAt,qi=function(a,e,t){return e+(t&&hy(a,e).length||1)},vy=_,fy=D,Ds=vy.RegExp,cy=!fy(function(){var a=!0;try{Ds(".","d")}catch{a=!1}var e={},t="",r=a?"dgimsy":"gimsy",i=function(u,l){Object.defineProperty(e,u,{get:function(){return t+=l,!0}})},n={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};a&&(n.hasIndices="d");for(var o in n)i(o,n[o]);var s=Object.getOwnPropertyDescriptor(Ds.prototype,"flags").get.call(e);return s!==r||t!==r}),gy={correct:cy},dy=Y,py=fe,yy=Tr,Ls=gy,my=Yu,by=RegExp.prototype,Vr=Ls.correct?function(a){return a.flags}:function(a){return!Ls.correct&&yy(by,a)&&!py(a,"flags")?dy(my,a):a.flags},ks=Y,xy=J,Ty=k,Oy=Ce,Sy=Yi,Ey=TypeError,Qi=function(a,e){var t=a.exec;if(Ty(t)){var r=ks(t,a,e);return r!==null&&xy(r),r}if(Oy(a)==="RegExp")return ks(Sy,a,e);throw new Ey("RegExp#exec called on incompatible receiver")},$y=Y,wy=L,Cy=Xi,Ay=J,Py=ae,Ry=ut,Jt=pe,Ny=ve,Iy=ot,My=qi,_y=Vr,Bs=Qi,Aa=wy("".indexOf);Cy("match",function(a,e,t){return[function(i){var n=Ny(this),o=Py(i)?Iy(i,a):void 0;if(o)return $y(o,i,n);var s=Jt(n);return new RegExp(i)[a](s)},function(r){var i=Ay(this),n=Jt(r),o=t(e,i,n);if(o.done)return o.value;var s=Jt(_y(i));if(!~Aa(s,"g"))return Bs(i,n);var u=!!~Aa(s,"u")||!!~Aa(s,"v");i.lastIndex=0;for(var l=[],h=0,f;(f=Bs(i,n))!==null;){var c=Jt(f[0]);l[h]=c,c===""&&(i.lastIndex=My(n,Ry(i.lastIndex),u)),h++}return h===0?null:l}]});var Ki=L,Vy=Sr,Dy=Math.floor,Pa=Ki("".charAt),Ly=Ki("".replace),Ra=Ki("".slice),ky=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,By=/\$([$&'`]|\d{1,2})/g,jy=function(a,e,t,r,i,n){var o=t+a.length,s=r.length,u=By;return i!==void 0&&(i=Vy(i),u=ky),Ly(n,u,function(l,h){var f;switch(Pa(h,0)){case"$":return"$";case"&":return a;case"`":return Ra(e,0,t);case"'":return Ra(e,o);case"<":f=i[Ra(h,1,-1)];break;default:var c=+h;if(c===0)return l;if(c>s){var v=Dy(c/10);return v===0?l:v<=s?r[v-1]===void 0?Pa(h,1):r[v-1]+Pa(h,1):l}f=r[c-1]}return f===void 0?"":f})},Fy=xu,js=Y,Dr=L,Uy=Xi,Gy=D,zy=J,Hy=k,Yy=ae,Xy=Cr,Wy=ut,_e=pe,qy=ve,Qy=qi,Ky=ot,Zy=jy,Jy=Vr,em=Qi,tm=z,fi=tm("replace"),rm=Math.max,am=Math.min,im=Dr([].concat),Na=Dr([].push),We=Dr("".indexOf),Fs=Dr("".slice),nm=function(a){return a===void 0?a:String(a)},sm=function(){return"a".replace(/./,"$0")==="$0"}(),Us=function(){return/./[fi]?/./[fi]("a","$0")==="":!1}(),om=!Gy(function(){var a=/./;return a.exec=function(){var e=[];return e.groups={a:"7"},e},"".replace(a,"$")!=="7"});Uy("replace",function(a,e,t){var r=Us?"$":"$0";return[function(n,o){var s=qy(this),u=Yy(n)?Ky(n,fi):void 0;return u?js(u,n,s,o):js(e,_e(s),n,o)},function(i,n){var o=zy(this),s=_e(i),u=Hy(n);u||(n=_e(n));var l=_e(Jy(o));if(typeof n=="string"&&!~We(n,r)&&!~We(n,"$<")&&!~We(l,"y")){var h=t(e,o,s,n);if(h.done)return h.value}var f=!!~We(l,"g"),c;f&&(c=!!~We(l,"u")||!!~We(l,"v"),o.lastIndex=0);for(var v=[],g;g=em(o,s),!(g===null||(Na(v,g),!f));){var d=_e(g[0]);d===""&&(o.lastIndex=Qy(s,Wy(o.lastIndex),c))}for(var p="",y=0,T=0;T=y&&(p+=Fs(s,y,x)+E,y=x+b.length)}return p+Fs(s,y)}]},!om||!sm||Us);var um=ae,lm=Ce,hm=z,vm=hm("match"),fm=function(a){var e;return um(a)&&((e=a[vm])!==void 0?!!e:lm(a)==="RegExp")},cm=fm,gm=TypeError,Zi=function(a){if(cm(a))throw new gm("The method doesn't accept regular expressions");return a},dm=z,pm=dm("match"),Ji=function(a){var e=/./;try{"/./"[a](e)}catch{try{return e[pm]=!1,"/./"[a](e)}catch{}}return!1},ym=ee,mm=Rr,bm=$t.f,xm=ut,Gs=pe,Tm=Zi,Om=ve,Sm=Ji,Em=mm("".slice),$m=Math.min,Ju=Sm("startsWith"),wm=!Ju&&!!function(){var a=bm(String.prototype,"startsWith");return a&&!a.writable}();ym({target:"String",proto:!0,forced:!wm&&!Ju},{startsWith:function(e){var t=Gs(Om(this));Tm(e);var r=Gs(e),i=xm($m(arguments.length>1?arguments[1]:void 0,t.length));return Em(t,i,i+r.length)===r}});var Cm=z,Am=Hi,Pm=Te.f,ci=Cm("unscopables"),gi=Array.prototype;gi[ci]===void 0&&Pm(gi,ci,{configurable:!0,value:Am(null)});var Rm=function(a){gi[ci][a]=!0},Nm=D,Im=!Nm(function(){function a(){}return a.prototype.constructor=null,Object.getPrototypeOf(new a)!==a.prototype}),Mm=fe,_m=k,Vm=Sr,Dm=Pi,Lm=Im,zs=Dm("IE_PROTO"),di=Object,km=di.prototype,el=Lm?di.getPrototypeOf:function(a){var e=Vm(a);if(Mm(e,zs))return e[zs];var t=e.constructor;return _m(t)&&e instanceof t?t.prototype:e instanceof di?km:null},Bm=D,jm=k,Fm=ae,Hs=el,Um=Ue,Gm=z,pi=Gm("iterator"),tl=!1,Be,Ia,Ma;[].keys&&(Ma=[].keys(),"next"in Ma?(Ia=Hs(Hs(Ma)),Ia!==Object.prototype&&(Be=Ia)):tl=!0);var zm=!Fm(Be)||Bm(function(){var a={};return Be[pi].call(a)!==a});zm&&(Be={});jm(Be[pi])||Um(Be,pi,function(){return this});var rl={IteratorPrototype:Be,BUGGY_SAFARI_ITERATORS:tl},Hm=rl.IteratorPrototype,Ym=Hi,Xm=Si,Wm=Pr,qm=Mr,Qm=function(){return this},Km=function(a,e,t,r){var i=e+" Iterator";return a.prototype=Ym(Hm,{next:Xm(+!r,t)}),Wm(a,i,!1),qm[i]=Qm,a},Zm=ee,Jm=Y,al=$r,e0=k,t0=Km,Ys=el,Xs=vu,r0=Pr,a0=At,_a=Ue,i0=z,n0=Mr,il=rl,s0=al.PROPER,o0=al.CONFIGURABLE,Ws=il.IteratorPrototype,er=il.BUGGY_SAFARI_ITERATORS,gt=i0("iterator"),qs="keys",dt="values",Qs="entries",u0=function(){return this},l0=function(a,e,t,r,i,n,o){t0(t,e,r);var s=function(y){if(y===i&&c)return c;if(!er&&y&&y in h)return h[y];switch(y){case qs:return function(){return new t(this,y)};case dt:return function(){return new t(this,y)};case Qs:return function(){return new t(this,y)}}return function(){return new t(this)}},u=e+" Iterator",l=!1,h=a.prototype,f=h[gt]||h["@@iterator"]||i&&h[i],c=!er&&f||s(i),v=e==="Array"&&h.entries||f,g,d,p;if(v&&(g=Ys(v.call(new a)),g!==Object.prototype&&g.next&&(Ys(g)!==Ws&&(Xs?Xs(g,Ws):e0(g[gt])||_a(g,gt,u0)),r0(g,u,!0))),s0&&i===dt&&f&&f.name!==dt&&(o0?a0(h,"name",dt):(l=!0,c=function(){return Jm(f,this)})),i)if(d={values:s(dt),keys:n?c:s(qs),entries:s(Qs)},o)for(p in d)(er||l||!(p in h))&&_a(h,p,d[p]);else Zm({target:e,proto:!0,forced:er||l},d);return h[gt]!==c&&_a(h,gt,c,{name:i}),n0[e]=c,d},h0=function(a,e){return{value:a,done:e}},v0=wt,en=Rm,Ks=Mr,nl=wr,f0=Te.f,c0=l0,tr=h0,g0=he,sl="Array Iterator",d0=nl.set,p0=nl.getterFor(sl),y0=c0(Array,"Array",function(a,e){d0(this,{type:sl,target:v0(a),index:0,kind:e})},function(){var a=p0(this),e=a.target,t=a.index++;if(!e||t>=e.length)return a.target=null,tr(void 0,!0);switch(a.kind){case"keys":return tr(t,!1);case"values":return tr(e[t],!1)}return tr([t,e[t]],!1)},"values"),Zs=Ks.Arguments=Ks.Array;en("keys");en("values");en("entries");if(g0&&Zs.name!=="values")try{f0(Zs,"name",{value:"values"})}catch{}var m0={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},b0=Er,Va=b0("span").classList,Js=Va&&Va.constructor&&Va.constructor.prototype,x0=Js===Object.prototype?void 0:Js,eo=_,ol=m0,T0=x0,yt=y0,to=At,O0=Pr,S0=z,Da=S0("iterator"),La=yt.values,ul=function(a,e){if(a){if(a[Da]!==La)try{to(a,Da,La)}catch{a[Da]=La}if(O0(a,e,!0),ol[e]){for(var t in yt)if(a[t]!==yt[t])try{to(a,t,yt[t])}catch{a[t]=yt[t]}}}};for(var ka in ol)ul(eo[ka]&&eo[ka].prototype,ka);ul(T0,"DOMTokenList");function E0(a,e){if(Xa(a)!="object"||!a)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var r=t.call(a,e);if(Xa(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}function $0(a){var e=E0(a,"string");return Xa(e)=="symbol"?e:e+""}function tn(a,e,t){return(e=$0(e))in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}var w0=Ae,C0=Sr,A0=Go,P0=Ii,ro=TypeError,ao="Reduce of empty array with no initial value",R0=function(a){return function(e,t,r,i){var n=C0(e),o=A0(n),s=P0(n);if(w0(t),s===0&&r<2)throw new ro(ao);var u=a?s-1:0,l=a?-1:1;if(r<2)for(;;){if(u in o){i=o[u],u+=l;break}if(u+=l,a?u<0:s<=u)throw new ro(ao)}for(;a?u>=0:s>u;u+=l)u in o&&(i=t(i,o[u],u,n));return i}},N0={left:R0(!1)},I0=D,ll=function(a,e){var t=[][a];return!!t&&I0(function(){t.call(null,e||function(){return 1},1)})},M0=ee,_0=N0.left,V0=ll,io=Ei,D0=Ar,L0=!D0&&io>79&&io<83,k0=L0||!V0("reduce");M0({target:"Array",proto:!0,forced:k0},{reduce:function(e){var t=arguments.length;return _0(this,e,t,t>1?arguments[1]:void 0)}});var B0=ee,j0=Rr,F0=$t.f,U0=ut,no=pe,G0=Zi,z0=ve,H0=Ji,Y0=j0("".slice),X0=Math.min,hl=H0("endsWith"),W0=!hl&&!!function(){var a=F0(String.prototype,"endsWith");return a&&!a.writable}();B0({target:"String",proto:!0,forced:!W0&&!hl},{endsWith:function(e){var t=no(z0(this));G0(e);var r=no(e),i=arguments.length>1?arguments[1]:void 0,n=t.length,o=i===void 0?n:X0(U0(i),n);return Y0(t,o-r.length,o)===r}});var Ba=Y,rn=L,q0=Xi,Q0=J,K0=ae,Z0=ve,J0=mu,eb=qi,tb=ut,ja=pe,rb=ot,ab=Vr,so=Qi,ib=Xu,nb=D,qe=ib.UNSUPPORTED_Y,sb=4294967295,ob=Math.min,Fa=rn([].push),Ua=rn("".slice),rr=rn("".indexOf),ub=!nb(function(){var a=/(?:)/,e=a.exec;a.exec=function(){return e.apply(this,arguments)};var t="ab".split(a);return t.length!==2||t[0]!=="a"||t[1]!=="b"}),oo="abbc".split(/(b)*/)[1]==="c"||"test".split(/(?:)/,-1).length!==4||"ab".split(/(?:ab)*/).length!==2||".".split(/(.?)(.?)/).length!==4||".".split(/()()/).length>1||"".split(/.?/).length;q0("split",function(a,e,t){var r="0".split(void 0,0).length?function(i,n){return i===void 0&&n===0?[]:Ba(e,this,i,n)}:e;return[function(n,o){var s=Z0(this),u=K0(n)?rb(n,a):void 0;return u?Ba(u,n,s,o):Ba(r,ja(s),n,o)},function(i,n){var o=Q0(this),s=ja(i);if(!oo){var u=t(r,o,s,n,r!==e);if(u.done)return u.value}var l=J0(o,RegExp),h=ja(ab(o)),f=!!~rr(h,"u")||!!~rr(h,"v");qe?~rr(h,"g")||(h+="g"):~rr(h,"y")||(h+="y");var c=new l(qe?"^(?:"+o.source+")":o,h),v=n===void 0?sb:n>>>0;if(v===0)return[];if(s.length===0)return so(c,s)===null?[s]:[];for(var g=0,d=0,p=[];d"u"?Ke:window,ar=["moz","webkit"],rt="AnimationFrame",st=be["request"+rt],Et=be["cancel"+rt]||be["cancelRequest"+rt];for(var pt=0;!st&&pt3&&(this.alpha=s[3]),this.ok=!0}}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.alpha=this.alpha<0?0:this.alpha>1||isNaN(this.alpha)?1:this.alpha,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toRGBA=function(){return"rgba("+this.r+", "+this.g+", "+this.b+", "+this.alpha+")"},this.toHex=function(){var u=this.r.toString(16),l=this.g.toString(16),h=this.b.toString(16);return u.length==1&&(u="0"+u),l.length==1&&(l="0"+l),h.length==1&&(h="0"+h),"#"+u+l+h},this.getHelpXML=function(){for(var u=new Array,l=0;l "+d.toRGB()+" -> "+d.toHex());g.appendChild(p),g.appendChild(y),v.appendChild(g)}catch{}return v}};const mi=Do(wb);var Cb=ee,Ab=Rr,Pb=su.indexOf,Rb=ll,bi=Ab([].indexOf),fl=!!bi&&1/bi([1],1,-0)<0,Nb=fl||!Rb("indexOf");Cb({target:"Array",proto:!0,forced:Nb},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return fl?bi(this,e,t)||0:Pb(this,e,t)}});var Ib=ee,Mb=L,_b=Zi,Vb=ve,fo=pe,Db=Ji,Lb=Mb("".indexOf);Ib({target:"String",proto:!0,forced:!Db("includes")},{includes:function(e){return!!~Lb(fo(Vb(this)),fo(_b(e)),arguments.length>1?arguments[1]:void 0)}});var kb=Ce,Bb=Array.isArray||function(e){return kb(e)==="Array"},jb=ee,Fb=L,Ub=Bb,Gb=Fb([].reverse),co=[1,2];jb({target:"Array",proto:!0,forced:String(co)===String(co.reverse())},{reverse:function(){return Ub(this)&&(this.length=this.length),Gb(this)}});/*! ***************************************************************************** diff --git a/veadk/webui/assets/chunks/jspdf.es.min-aFbI3tiR.js b/veadk/webui/assets/chunks/jspdf.es.min-DVclzE4e.js similarity index 99% rename from veadk/webui/assets/chunks/jspdf.es.min-aFbI3tiR.js rename to veadk/webui/assets/chunks/jspdf.es.min-DVclzE4e.js index f9d1b287e..b1483d6ca 100644 --- a/veadk/webui/assets/chunks/jspdf.es.min-aFbI3tiR.js +++ b/veadk/webui/assets/chunks/jspdf.es.min-DVclzE4e.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/chunks/index.es-JsJulYHK.js","assets/app/index-BNPwMQXG.js","assets/styles/index-_lutWX9f.css"])))=>i.map(i=>d[i]); -var kh=Object.defineProperty;var Ph=(r,e,t)=>e in r?kh(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var _e=(r,e,t)=>Ph(r,typeof e!="symbol"?e+"":e,t);import{_ as go}from"../app/index-BNPwMQXG.js";function Ae(r){"@babel/helpers - typeof";return Ae=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ae(r)}var Qr=Uint8Array,Or=Uint16Array,Jo=Int32Array,Ko=new Qr([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Xo=new Qr([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ml=new Qr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Zu=function(r,e){for(var t=new Or(31),i=0;i<31;++i)t[i]=e+=1<>1|(Fe&21845)<<1;Qn=(Qn&52428)>>2|(Qn&13107)<<2,Qn=(Qn&61680)>>4|(Qn&3855)<<4,To[Fe]=((Qn&65280)>>8|(Qn&255)<<8)>>1}var Ia=function(r,e,t){for(var i=r.length,s=0,a=new Or(e);s>h]=d}else for(l=new Or(i),s=0;s>15-r[s]);return l},Ii=new Qr(288);for(var Fe=0;Fe<144;++Fe)Ii[Fe]=8;for(var Fe=144;Fe<256;++Fe)Ii[Fe]=9;for(var Fe=256;Fe<280;++Fe)Ii[Fe]=7;for(var Fe=280;Fe<288;++Fe)Ii[Fe]=8;var Fs=new Qr(32);for(var Fe=0;Fe<32;++Fe)Fs[Fe]=5;var Fh=Ia(Ii,9,0),Eh=Ia(Fs,5,0),tf=function(r){return(r+7)/8|0},Oh=function(r,e,t){return(t==null||t>r.length)&&(t=r.length),new Qr(r.subarray(e,t))},Bn=function(r,e,t){t<<=e&7;var i=e/8|0;r[i]|=t,r[i+1]|=t>>8},ka=function(r,e,t){t<<=e&7;var i=e/8|0;r[i]|=t,r[i+1]|=t>>8,r[i+2]|=t>>16},mo=function(r,e){for(var t=[],i=0;ik&&(k=a[i].s);var p=new Or(k+1),j=Do(t[m-1],p,0);if(j>e){var i=0,O=0,M=j-e,S=1<e)O+=S-(1<>=M;O>0;){var G=a[i].s;p[G]=0&&O;--i){var D=a[i].s;p[D]==e&&(--p[D],++O)}j=e}return{t:new Qr(p),l:j}},Do=function(r,e,t){return r.s==-1?Math.max(Do(r.l,e,t+1),Do(r.r,e,t+1)):e[r.s]=t},Tl=function(r){for(var e=r.length;e&&!r[--e];);for(var t=new Or(++e),i=0,s=r[0],a=1,c=function(h){t[i++]=h},l=1;l<=e;++l)if(r[l]==s&&l!=e)++a;else{if(!s&&a>2){for(;a>138;a-=138)c(32754);a>2&&(c(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(c(s),--a;a>6;a-=6)c(8304);a>2&&(c(a-3<<5|8208),a=0)}for(;a--;)c(s);a=1,s=r[l]}return{c:t.subarray(0,i),n:e}},Pa=function(r,e){for(var t=0,i=0;i>8,r[s+2]=r[s]^255,r[s+3]=r[s+1]^255;for(var a=0;a4&&!tt[Ml[F-1]];--F);var z=d+5<<3,U=Pa(s,Ii)+Pa(a,Fs)+c,nt=Pa(s,k)+Pa(a,O)+c+14+3*F+Pa(ct,tt)+2*ct[16]+3*ct[17]+7*ct[18];if(h>=0&&z<=U&&z<=nt)return ef(e,m,r.subarray(h,h+d));var ot,ut,rt,ht;if(Bn(e,m,1+(nt15&&(Bn(e,m,B[K]>>5&127),m+=B[K]>>12)}}else ot=Fh,ut=Ii,rt=Eh,ht=Fs;for(var K=0;K255){var T=H>>18&31;ka(e,m,ot[T+257]),m+=ut[T+257],T>7&&(Bn(e,m,H>>23&31),m+=Ko[T]);var J=H&31;ka(e,m,rt[J]),m+=ht[J],J>3&&(ka(e,m,H>>5&8191),m+=Xo[J])}else ka(e,m,ot[H]),m+=ut[H]}return ka(e,m,ot[256]),m+ut[256]},jh=new Jo([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),rf=new Qr(0),Bh=function(r,e,t,i,s,a){var c=a.z||r.length,l=new Qr(i+c+5*(1+Math.ceil(c/7e3))+s),h=l.subarray(i,l.length-s),d=a.l,m=(a.r||0)&7;if(e){m&&(h[0]=a.r>>3);for(var _=jh[e-1],k=_>>13,p=_&8191,j=(1<7e3||tt>24576)&&(ot>423||!d)){m=Dl(r,h,0,D,it,mt,K,tt,F,R-F,m),tt=ct=K=0,F=R;for(var ut=0;ut<286;++ut)it[ut]=0;for(var ut=0;ut<30;++ut)mt[ut]=0}var rt=2,ht=0,At=p,wt=U-nt&32767;if(ot>2&&z==G(R-wt))for(var x=Math.min(k,ot)-1,B=Math.min(32767,R),T=Math.min(258,ot);wt<=B&&--At&&U!=nt;){if(r[R+rt]==r[R+rt-wt]){for(var H=0;Hrt){if(rt=H,ht=wt,H>x)break;for(var J=Math.min(wt,H-2),Z=0,ut=0;utZ&&(Z=gt,nt=at)}}}U=nt,nt=O[U],wt+=U-nt&32767}if(ht){D[tt++]=268435456|Ro[rt]<<18|Rl[ht];var _t=Ro[rt]&31,kt=Rl[ht]&31;K+=Ko[_t]+Xo[kt],++it[257+_t],++mt[kt],N=R+rt,++ct}else D[tt++]=r[R],++it[r[R]]}}for(R=Math.max(R,N);R=c&&(h[m/8|0]=d,St=c),m=ef(h,m+1,r.subarray(R,St))}a.i=c}return Oh(l,0,i+tf(m)+s)},nf=function(){var r=1,e=0;return{p:function(t){for(var i=r,s=e,a=t.length|0,c=0;c!=a;){for(var l=Math.min(c+2655,a);c>16),s=(s&65535)+15*(s>>16)}r=i,e=s},d:function(){return r%=65521,e%=65521,(r&255)<<24|(r&65280)<<8|(e&255)<<8|e>>8}}},Mh=function(r,e,t,i,s){if(!s&&(s={l:1},e.dictionary)){var a=e.dictionary.subarray(-32768),c=new Qr(a.length+r.length);c.set(a),c.set(r,a.length),r=c,s.w=a.length}return Bh(r,e.level==null?6:e.level,e.mem==null?s.l?Math.ceil(Math.max(8,Math.min(13,Math.log(r.length)))*1.5):20:12+e.mem,t,i,s)},af=function(r,e,t){for(;t;++e)r[e]=t,t>>>=8},Rh=function(r,e){var t=e.level,i=t==0?0:t<6?1:t==9?3:2;if(r[0]=120,r[1]=i<<6|(e.dictionary&&32),r[1]|=31-(r[0]<<8|r[1])%31,e.dictionary){var s=nf();s.p(e.dictionary),af(r,2,s.d())}};function qo(r,e){e||(e={});var t=nf();t.p(r);var i=Mh(r,e,e.dictionary?6:2,4);return Rh(i,e),af(i,i.length-4,t.d()),i}var Th=typeof TextDecoder<"u"&&new TextDecoder,Dh=0;try{Th.decode(rf,{stream:!0}),Dh=1}catch{}function qh(r){if(Array.isArray(r))return r}function Uh(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var i,s,a,c,l=[],h=!0,d=!1;try{if(a=(t=t.call(r)).next,e!==0)for(;!(h=(i=a.call(t)).done)&&(l.push(i.value),l.length!==e);h=!0);}catch(m){d=!0,s=m}finally{try{if(!h&&t.return!=null&&(c=t.return(),Object(c)!==c))return}finally{if(d)throw s}}return l}}function ql(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,i=Array(e);ti.map(i=>d[i]); +var kh=Object.defineProperty;var Ph=(r,e,t)=>e in r?kh(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var _e=(r,e,t)=>Ph(r,typeof e!="symbol"?e+"":e,t);import{_ as go}from"../app/index-8JtvDNuA.js";function Ae(r){"@babel/helpers - typeof";return Ae=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ae(r)}var Qr=Uint8Array,Or=Uint16Array,Jo=Int32Array,Ko=new Qr([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Xo=new Qr([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ml=new Qr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Zu=function(r,e){for(var t=new Or(31),i=0;i<31;++i)t[i]=e+=1<>1|(Fe&21845)<<1;Qn=(Qn&52428)>>2|(Qn&13107)<<2,Qn=(Qn&61680)>>4|(Qn&3855)<<4,To[Fe]=((Qn&65280)>>8|(Qn&255)<<8)>>1}var Ia=function(r,e,t){for(var i=r.length,s=0,a=new Or(e);s>h]=d}else for(l=new Or(i),s=0;s>15-r[s]);return l},Ii=new Qr(288);for(var Fe=0;Fe<144;++Fe)Ii[Fe]=8;for(var Fe=144;Fe<256;++Fe)Ii[Fe]=9;for(var Fe=256;Fe<280;++Fe)Ii[Fe]=7;for(var Fe=280;Fe<288;++Fe)Ii[Fe]=8;var Fs=new Qr(32);for(var Fe=0;Fe<32;++Fe)Fs[Fe]=5;var Fh=Ia(Ii,9,0),Eh=Ia(Fs,5,0),tf=function(r){return(r+7)/8|0},Oh=function(r,e,t){return(t==null||t>r.length)&&(t=r.length),new Qr(r.subarray(e,t))},Bn=function(r,e,t){t<<=e&7;var i=e/8|0;r[i]|=t,r[i+1]|=t>>8},ka=function(r,e,t){t<<=e&7;var i=e/8|0;r[i]|=t,r[i+1]|=t>>8,r[i+2]|=t>>16},mo=function(r,e){for(var t=[],i=0;ik&&(k=a[i].s);var p=new Or(k+1),j=Do(t[m-1],p,0);if(j>e){var i=0,O=0,M=j-e,S=1<e)O+=S-(1<>=M;O>0;){var G=a[i].s;p[G]=0&&O;--i){var D=a[i].s;p[D]==e&&(--p[D],++O)}j=e}return{t:new Qr(p),l:j}},Do=function(r,e,t){return r.s==-1?Math.max(Do(r.l,e,t+1),Do(r.r,e,t+1)):e[r.s]=t},Tl=function(r){for(var e=r.length;e&&!r[--e];);for(var t=new Or(++e),i=0,s=r[0],a=1,c=function(h){t[i++]=h},l=1;l<=e;++l)if(r[l]==s&&l!=e)++a;else{if(!s&&a>2){for(;a>138;a-=138)c(32754);a>2&&(c(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(c(s),--a;a>6;a-=6)c(8304);a>2&&(c(a-3<<5|8208),a=0)}for(;a--;)c(s);a=1,s=r[l]}return{c:t.subarray(0,i),n:e}},Pa=function(r,e){for(var t=0,i=0;i>8,r[s+2]=r[s]^255,r[s+3]=r[s+1]^255;for(var a=0;a4&&!tt[Ml[F-1]];--F);var z=d+5<<3,U=Pa(s,Ii)+Pa(a,Fs)+c,nt=Pa(s,k)+Pa(a,O)+c+14+3*F+Pa(ct,tt)+2*ct[16]+3*ct[17]+7*ct[18];if(h>=0&&z<=U&&z<=nt)return ef(e,m,r.subarray(h,h+d));var ot,ut,rt,ht;if(Bn(e,m,1+(nt15&&(Bn(e,m,B[K]>>5&127),m+=B[K]>>12)}}else ot=Fh,ut=Ii,rt=Eh,ht=Fs;for(var K=0;K255){var T=H>>18&31;ka(e,m,ot[T+257]),m+=ut[T+257],T>7&&(Bn(e,m,H>>23&31),m+=Ko[T]);var J=H&31;ka(e,m,rt[J]),m+=ht[J],J>3&&(ka(e,m,H>>5&8191),m+=Xo[J])}else ka(e,m,ot[H]),m+=ut[H]}return ka(e,m,ot[256]),m+ut[256]},jh=new Jo([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),rf=new Qr(0),Bh=function(r,e,t,i,s,a){var c=a.z||r.length,l=new Qr(i+c+5*(1+Math.ceil(c/7e3))+s),h=l.subarray(i,l.length-s),d=a.l,m=(a.r||0)&7;if(e){m&&(h[0]=a.r>>3);for(var _=jh[e-1],k=_>>13,p=_&8191,j=(1<7e3||tt>24576)&&(ot>423||!d)){m=Dl(r,h,0,D,it,mt,K,tt,F,R-F,m),tt=ct=K=0,F=R;for(var ut=0;ut<286;++ut)it[ut]=0;for(var ut=0;ut<30;++ut)mt[ut]=0}var rt=2,ht=0,At=p,wt=U-nt&32767;if(ot>2&&z==G(R-wt))for(var x=Math.min(k,ot)-1,B=Math.min(32767,R),T=Math.min(258,ot);wt<=B&&--At&&U!=nt;){if(r[R+rt]==r[R+rt-wt]){for(var H=0;Hrt){if(rt=H,ht=wt,H>x)break;for(var J=Math.min(wt,H-2),Z=0,ut=0;utZ&&(Z=gt,nt=at)}}}U=nt,nt=O[U],wt+=U-nt&32767}if(ht){D[tt++]=268435456|Ro[rt]<<18|Rl[ht];var _t=Ro[rt]&31,kt=Rl[ht]&31;K+=Ko[_t]+Xo[kt],++it[257+_t],++mt[kt],N=R+rt,++ct}else D[tt++]=r[R],++it[r[R]]}}for(R=Math.max(R,N);R=c&&(h[m/8|0]=d,St=c),m=ef(h,m+1,r.subarray(R,St))}a.i=c}return Oh(l,0,i+tf(m)+s)},nf=function(){var r=1,e=0;return{p:function(t){for(var i=r,s=e,a=t.length|0,c=0;c!=a;){for(var l=Math.min(c+2655,a);c>16),s=(s&65535)+15*(s>>16)}r=i,e=s},d:function(){return r%=65521,e%=65521,(r&255)<<24|(r&65280)<<8|(e&255)<<8|e>>8}}},Mh=function(r,e,t,i,s){if(!s&&(s={l:1},e.dictionary)){var a=e.dictionary.subarray(-32768),c=new Qr(a.length+r.length);c.set(a),c.set(r,a.length),r=c,s.w=a.length}return Bh(r,e.level==null?6:e.level,e.mem==null?s.l?Math.ceil(Math.max(8,Math.min(13,Math.log(r.length)))*1.5):20:12+e.mem,t,i,s)},af=function(r,e,t){for(;t;++e)r[e]=t,t>>>=8},Rh=function(r,e){var t=e.level,i=t==0?0:t<6?1:t==9?3:2;if(r[0]=120,r[1]=i<<6|(e.dictionary&&32),r[1]|=31-(r[0]<<8|r[1])%31,e.dictionary){var s=nf();s.p(e.dictionary),af(r,2,s.d())}};function qo(r,e){e||(e={});var t=nf();t.p(r);var i=Mh(r,e,e.dictionary?6:2,4);return Rh(i,e),af(i,i.length-4,t.d()),i}var Th=typeof TextDecoder<"u"&&new TextDecoder,Dh=0;try{Th.decode(rf,{stream:!0}),Dh=1}catch{}function qh(r){if(Array.isArray(r))return r}function Uh(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var i,s,a,c,l=[],h=!0,d=!1;try{if(a=(t=t.call(r)).next,e!==0)for(;!(h=(i=a.call(t)).done)&&(l.push(i.value),l.length!==e);h=!0);}catch(m){d=!0,s=m}finally{try{if(!h&&t.return!=null&&(c=t.return(),Object(c)!==c))return}finally{if(d)throw s}}return l}}function ql(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,i=Array(e);t{const r=new Uint8Array(4),e=new Uint32Array(r.buffer);return!((e[0]=1)&r[0])})(),vo={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array};class $o{constructor(e=Gh,t={}){_e(this,"buffer");_e(this,"byteLength");_e(this,"byteOffset");_e(this,"length");_e(this,"offset");_e(this,"lastWrittenByte");_e(this,"littleEndian");_e(this,"_data");_e(this,"_mark");_e(this,"_marks");let i=!1;typeof e=="number"?e=new ArrayBuffer(e):(i=!0,this.lastWrittenByte=e.byteLength);const s=t.offset?t.offset>>>0:0,a=e.byteLength-s;let c=s;(ArrayBuffer.isView(e)||e instanceof $o)&&(e.byteLength!==e.buffer.byteLength&&(c=e.byteOffset+s),e=e.buffer),i?this.lastWrittenByte=a:this.lastWrittenByte=0,this.buffer=e,this.length=a,this.byteLength=a,this.byteOffset=c,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,c,a),this._mark=0,this._marks=[]}available(e=1){return this.offset+e<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(e=1){return this.offset+=e,this}back(e=1){return this.offset-=e,this}seek(e){return this.offset=e,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const e=this._marks.pop();if(e===void 0)throw new Error("Mark stack empty");return this.seek(e),this}rewind(){return this.offset=0,this}ensureAvailable(e=1){if(!this.available(e)){const i=(this.offset+e)*2,s=new Uint8Array(i);s.set(new Uint8Array(this.buffer)),this.buffer=s.buffer,this.length=i,this.byteLength=i,this._data=new DataView(this.buffer)}return this}readBoolean(){return this.readUint8()!==0}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(e=1){return this.readArray(e,"uint8")}readArray(e,t){const i=vo[t].BYTES_PER_ELEMENT*e,s=this.byteOffset+this.offset,a=this.buffer.slice(s,s+i);if(this.littleEndian===Yh&&t!=="uint8"&&t!=="int8"){const l=new Uint8Array(this.buffer.slice(s,s+i));l.reverse();const h=new vo[t](l.buffer);return this.offset+=i,h.reverse(),h}const c=new vo[t](a);return this.offset+=i,c}readInt16(){const e=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}readUint16(){const e=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,e}readInt32(){const e=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}readUint32(){const e=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat32(){const e=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat64(){const e=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}readBigInt64(){const e=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,e}readBigUint64(){const e=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,e}readChar(){return String.fromCharCode(this.readInt8())}readChars(e=1){let t="";for(let i=0;ithis.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}function Zi(r){let e=r.length;for(;--e>=0;)r[e]=0}const Jh=3,Kh=258,sf=29,Xh=256,$h=Xh+1+sf,of=30,Zh=512,Qh=new Array(($h+2)*2);Zi(Qh);const tc=new Array(of*2);Zi(tc);const ec=new Array(Zh);Zi(ec);const rc=new Array(Kh-Jh+1);Zi(rc);const nc=new Array(sf);Zi(nc);const ic=new Array(of);Zi(ic);const ac=(r,e,t,i)=>{let s=r&65535|0,a=r>>>16&65535|0,c=0;for(;t!==0;){c=t>2e3?2e3:t,t-=c;do s=s+e[i++]|0,a=a+s|0;while(--c);s%=65521,a%=65521}return s|a<<16|0};var Uo=ac;const sc=()=>{let r,e=[];for(var t=0;t<256;t++){r=t;for(var i=0;i<8;i++)r=r&1?3988292384^r>>>1:r>>>1;e[t]=r}return e},oc=new Uint32Array(sc()),lc=(r,e,t,i)=>{const s=oc,a=i+t;r^=-1;for(let c=i;c>>8^s[(r^e[c])&255];return r^-1};var cn=lc,zo={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},lf={Z_NO_FLUSH:0,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_DEFLATED:8};const uc=(r,e)=>Object.prototype.hasOwnProperty.call(r,e);var fc=function(r){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const t=e.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(const i in t)uc(t,i)&&(r[i]=t[i])}}return r},hc=r=>{let e=0;for(let i=0,s=r.length;i=252?6:r>=248?5:r>=240?4:r>=224?3:r>=192?2:1;Ba[254]=Ba[255]=1;var cc=r=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(r);let e,t,i,s,a,c=r.length,l=0;for(s=0;s>>6,e[a++]=128|t&63):t<65536?(e[a++]=224|t>>>12,e[a++]=128|t>>>6&63,e[a++]=128|t&63):(e[a++]=240|t>>>18,e[a++]=128|t>>>12&63,e[a++]=128|t>>>6&63,e[a++]=128|t&63);return e};const dc=(r,e)=>{if(e<65534&&r.subarray&&ff)return String.fromCharCode.apply(null,r.length===e?r:r.subarray(0,e));let t="";for(let i=0;i{const t=e||r.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(r.subarray(0,e));let i,s;const a=new Array(t*2);for(s=0,i=0;i4){a[s++]=65533,i+=l-1;continue}for(c&=l===2?31:l===3?15:7;l>1&&i1){a[s++]=65533;continue}c<65536?a[s++]=c:(c-=65536,a[s++]=55296|c>>10&1023,a[s++]=56320|c&1023)}return dc(a,s)},gc=(r,e)=>{e=e||r.length,e>r.length&&(e=r.length);let t=e-1;for(;t>=0&&(r[t]&192)===128;)t--;return t<0||t===0?e:t+Ba[r[t]]>e?t:e},Ho={string2buf:cc,buf2string:pc,utf8border:gc};function mc(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var vc=mc;const ys=16209,bc=16191;var wc=function(e,t){let i,s,a,c,l,h,d,m,_,k,p,j,O,M,S,V,G,D,it,mt,ct,K,R,tt;const N=e.state;i=e.next_in,R=e.input,s=i+(e.avail_in-5),a=e.next_out,tt=e.output,c=a-(t-e.avail_out),l=a+(e.avail_out-257),h=N.dmax,d=N.wsize,m=N.whave,_=N.wnext,k=N.window,p=N.hold,j=N.bits,O=N.lencode,M=N.distcode,S=(1<>>24,p>>>=D,j-=D,D=G>>>16&255,D===0)tt[a++]=G&65535;else if(D&16){it=G&65535,D&=15,D&&(j>>=D,j-=D),j<15&&(p+=R[i++]<>>24,p>>>=D,j-=D,D=G>>>16&255,D&16){if(mt=G&65535,D&=15,jh){e.msg="invalid distance too far back",N.mode=ys;break t}if(p>>>=D,j-=D,D=a-c,mt>D){if(D=mt-D,D>m&&N.sane){e.msg="invalid distance too far back",N.mode=ys;break t}if(ct=0,K=k,_===0){if(ct+=d-D,D2;)tt[a++]=K[ct++],tt[a++]=K[ct++],tt[a++]=K[ct++],it-=3;it&&(tt[a++]=K[ct++],it>1&&(tt[a++]=K[ct++]))}else{ct=a-mt;do tt[a++]=tt[ct++],tt[a++]=tt[ct++],tt[a++]=tt[ct++],it-=3;while(it>2);it&&(tt[a++]=tt[ct++],it>1&&(tt[a++]=tt[ct++]))}}else if(D&64){e.msg="invalid distance code",N.mode=ys;break t}else{G=M[(G&65535)+(p&(1<>3,i-=it,j-=it<<3,p&=(1<{const h=l.bits;let d=0,m=0,_=0,k=0,p=0,j=0,O=0,M=0,S=0,V=0,G,D,it,mt,ct,K=null,R;const tt=new Uint16Array(Gi+1),N=new Uint16Array(Gi+1);let F=null,z,U,nt;for(d=0;d<=Gi;d++)tt[d]=0;for(m=0;m=1&&tt[k]===0;k--);if(p>k&&(p=k),k===0)return s[a++]=1<<24|64<<16|0,s[a++]=1<<24|64<<16|0,l.bits=1,0;for(_=1;_0&&(r===Vl||k!==1))return-1;for(N[1]=0,d=1;dHl||r===Gl&&S>Wl)return 1;for(;;){z=d-O,c[m]+1=R?(U=F[c[m]-R],nt=K[c[m]-R]):(U=96,nt=0),G=1<>O)+D]=z<<24|U<<16|nt|0;while(D!==0);for(G=1<>=1;if(G!==0?(V&=G-1,V+=G):V=0,m++,--tt[d]===0){if(d===k)break;d=e[t+c[m]]}if(d>p&&(V&mt)!==it){for(O===0&&(O=p),ct+=_,j=d-O,M=1<Hl||r===Gl&&S>Wl)return 1;it=V&mt,s[it]=p<<24|j<<16|ct-a|0}}return V!==0&&(s[ct+V]=d-O<<24|64<<16|0),l.bits=p,0};var Ca=Nc;const Lc=0,hf=1,cf=2,{Z_FINISH:Yl,Z_BLOCK:Sc,Z_TREES:xs,Z_OK:Ci,Z_STREAM_END:kc,Z_NEED_DICT:Pc,Z_STREAM_ERROR:Hr,Z_DATA_ERROR:df,Z_MEM_ERROR:pf,Z_BUF_ERROR:Ic,Z_DEFLATED:Jl}=lf,js=16180,Kl=16181,Xl=16182,$l=16183,Zl=16184,Ql=16185,tu=16186,eu=16187,ru=16188,nu=16189,Es=16190,Mn=16191,wo=16192,iu=16193,yo=16194,au=16195,su=16196,ou=16197,lu=16198,_s=16199,As=16200,uu=16201,fu=16202,hu=16203,cu=16204,du=16205,xo=16206,pu=16207,gu=16208,je=16209,gf=16210,mf=16211,Cc=852,Fc=592,Ec=15,Oc=Ec,mu=r=>(r>>>24&255)+(r>>>8&65280)+((r&65280)<<8)+((r&255)<<24);function jc(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Fi=r=>{if(!r)return 1;const e=r.state;return!e||e.strm!==r||e.modemf?1:0},vf=r=>{if(Fi(r))return Hr;const e=r.state;return r.total_in=r.total_out=e.total=0,r.msg="",e.wrap&&(r.adler=e.wrap&1),e.mode=js,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(Cc),e.distcode=e.distdyn=new Int32Array(Fc),e.sane=1,e.back=-1,Ci},bf=r=>{if(Fi(r))return Hr;const e=r.state;return e.wsize=0,e.whave=0,e.wnext=0,vf(r)},wf=(r,e)=>{let t;if(Fi(r))return Hr;const i=r.state;return e<0?(t=0,e=-e):(t=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?Hr:(i.window!==null&&i.wbits!==e&&(i.window=null),i.wrap=t,i.wbits=e,bf(r))},yf=(r,e)=>{if(!r)return Hr;const t=new jc;r.state=t,t.strm=r,t.window=null,t.mode=js;const i=wf(r,e);return i!==Ci&&(r.state=null),i},Bc=r=>yf(r,Oc);let vu=!0,_o,Ao;const Mc=r=>{if(vu){_o=new Int32Array(512),Ao=new Int32Array(32);let e=0;for(;e<144;)r.lens[e++]=8;for(;e<256;)r.lens[e++]=9;for(;e<280;)r.lens[e++]=7;for(;e<288;)r.lens[e++]=8;for(Ca(hf,r.lens,0,288,_o,0,r.work,{bits:9}),e=0;e<32;)r.lens[e++]=5;Ca(cf,r.lens,0,32,Ao,0,r.work,{bits:5}),vu=!1}r.lencode=_o,r.lenbits=9,r.distcode=Ao,r.distbits=5},xf=(r,e,t,i)=>{let s;const a=r.state;return a.window===null&&(a.window=new Uint8Array(1<=a.wsize?(a.window.set(e.subarray(t-a.wsize,t),0),a.wnext=0,a.whave=a.wsize):(s=a.wsize-a.wnext,s>i&&(s=i),a.window.set(e.subarray(t-i,t-i+s),a.wnext),i-=s,i?(a.window.set(e.subarray(t-i,t),0),a.wnext=i,a.whave=a.wsize):(a.wnext+=s,a.wnext===a.wsize&&(a.wnext=0),a.whave{let t,i,s,a,c,l,h,d,m,_,k,p,j,O,M=0,S,V,G,D,it,mt,ct,K;const R=new Uint8Array(4);let tt,N;const F=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Fi(r)||!r.output||!r.input&&r.avail_in!==0)return Hr;t=r.state,t.mode===Mn&&(t.mode=wo),c=r.next_out,s=r.output,h=r.avail_out,a=r.next_in,i=r.input,l=r.avail_in,d=t.hold,m=t.bits,_=l,k=h,K=Ci;t:for(;;)switch(t.mode){case js:if(t.wrap===0){t.mode=wo;break}for(;m<16;){if(l===0)break t;l--,d+=i[a++]<>>8&255,t.check=cn(t.check,R,2,0),d=0,m=0,t.mode=Kl;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((d&255)<<8)+(d>>8))%31){r.msg="incorrect header check",t.mode=je;break}if((d&15)!==Jl){r.msg="unknown compression method",t.mode=je;break}if(d>>>=4,m-=4,ct=(d&15)+8,t.wbits===0&&(t.wbits=ct),ct>15||ct>t.wbits){r.msg="invalid window size",t.mode=je;break}t.dmax=1<>8&1),t.flags&512&&t.wrap&4&&(R[0]=d&255,R[1]=d>>>8&255,t.check=cn(t.check,R,2,0)),d=0,m=0,t.mode=Xl;case Xl:for(;m<32;){if(l===0)break t;l--,d+=i[a++]<>>8&255,R[2]=d>>>16&255,R[3]=d>>>24&255,t.check=cn(t.check,R,4,0)),d=0,m=0,t.mode=$l;case $l:for(;m<16;){if(l===0)break t;l--,d+=i[a++]<>8),t.flags&512&&t.wrap&4&&(R[0]=d&255,R[1]=d>>>8&255,t.check=cn(t.check,R,2,0)),d=0,m=0,t.mode=Zl;case Zl:if(t.flags&1024){for(;m<16;){if(l===0)break t;l--,d+=i[a++]<>>8&255,t.check=cn(t.check,R,2,0)),d=0,m=0}else t.head&&(t.head.extra=null);t.mode=Ql;case Ql:if(t.flags&1024&&(p=t.length,p>l&&(p=l),p&&(t.head&&(ct=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(i.subarray(a,a+p),ct)),t.flags&512&&t.wrap&4&&(t.check=cn(t.check,i,p,a)),l-=p,a+=p,t.length-=p),t.length))break t;t.length=0,t.mode=tu;case tu:if(t.flags&2048){if(l===0)break t;p=0;do ct=i[a+p++],t.head&&ct&&t.length<65536&&(t.head.name+=String.fromCharCode(ct));while(ct&&p>9&1,t.head.done=!0),r.adler=t.check=0,t.mode=Mn;break;case nu:for(;m<32;){if(l===0)break t;l--,d+=i[a++]<>>=m&7,m-=m&7,t.mode=xo;break}for(;m<3;){if(l===0)break t;l--,d+=i[a++]<>>=1,m-=1,d&3){case 0:t.mode=iu;break;case 1:if(Mc(t),t.mode=_s,e===xs){d>>>=2,m-=2;break t}break;case 2:t.mode=su;break;case 3:r.msg="invalid block type",t.mode=je}d>>>=2,m-=2;break;case iu:for(d>>>=m&7,m-=m&7;m<32;){if(l===0)break t;l--,d+=i[a++]<>>16^65535)){r.msg="invalid stored block lengths",t.mode=je;break}if(t.length=d&65535,d=0,m=0,t.mode=yo,e===xs)break t;case yo:t.mode=au;case au:if(p=t.length,p){if(p>l&&(p=l),p>h&&(p=h),p===0)break t;s.set(i.subarray(a,a+p),c),l-=p,a+=p,h-=p,c+=p,t.length-=p;break}t.mode=Mn;break;case su:for(;m<14;){if(l===0)break t;l--,d+=i[a++]<>>=5,m-=5,t.ndist=(d&31)+1,d>>>=5,m-=5,t.ncode=(d&15)+4,d>>>=4,m-=4,t.nlen>286||t.ndist>30){r.msg="too many length or distance symbols",t.mode=je;break}t.have=0,t.mode=ou;case ou:for(;t.have>>=3,m-=3}for(;t.have<19;)t.lens[F[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,tt={bits:t.lenbits},K=Ca(Lc,t.lens,0,19,t.lencode,0,t.work,tt),t.lenbits=tt.bits,K){r.msg="invalid code lengths set",t.mode=je;break}t.have=0,t.mode=lu;case lu:for(;t.have>>24,V=M>>>16&255,G=M&65535,!(S<=m);){if(l===0)break t;l--,d+=i[a++]<>>=S,m-=S,t.lens[t.have++]=G;else{if(G===16){for(N=S+2;m>>=S,m-=S,t.have===0){r.msg="invalid bit length repeat",t.mode=je;break}ct=t.lens[t.have-1],p=3+(d&3),d>>>=2,m-=2}else if(G===17){for(N=S+3;m>>=S,m-=S,ct=0,p=3+(d&7),d>>>=3,m-=3}else{for(N=S+7;m>>=S,m-=S,ct=0,p=11+(d&127),d>>>=7,m-=7}if(t.have+p>t.nlen+t.ndist){r.msg="invalid bit length repeat",t.mode=je;break}for(;p--;)t.lens[t.have++]=ct}}if(t.mode===je)break;if(t.lens[256]===0){r.msg="invalid code -- missing end-of-block",t.mode=je;break}if(t.lenbits=9,tt={bits:t.lenbits},K=Ca(hf,t.lens,0,t.nlen,t.lencode,0,t.work,tt),t.lenbits=tt.bits,K){r.msg="invalid literal/lengths set",t.mode=je;break}if(t.distbits=6,t.distcode=t.distdyn,tt={bits:t.distbits},K=Ca(cf,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,tt),t.distbits=tt.bits,K){r.msg="invalid distances set",t.mode=je;break}if(t.mode=_s,e===xs)break t;case _s:t.mode=As;case As:if(l>=6&&h>=258){r.next_out=c,r.avail_out=h,r.next_in=a,r.avail_in=l,t.hold=d,t.bits=m,wc(r,k),c=r.next_out,s=r.output,h=r.avail_out,a=r.next_in,i=r.input,l=r.avail_in,d=t.hold,m=t.bits,t.mode===Mn&&(t.back=-1);break}for(t.back=0;M=t.lencode[d&(1<>>24,V=M>>>16&255,G=M&65535,!(S<=m);){if(l===0)break t;l--,d+=i[a++]<>D)],S=M>>>24,V=M>>>16&255,G=M&65535,!(D+S<=m);){if(l===0)break t;l--,d+=i[a++]<>>=D,m-=D,t.back+=D}if(d>>>=S,m-=S,t.back+=S,t.length=G,V===0){t.mode=du;break}if(V&32){t.back=-1,t.mode=Mn;break}if(V&64){r.msg="invalid literal/length code",t.mode=je;break}t.extra=V&15,t.mode=uu;case uu:if(t.extra){for(N=t.extra;m>>=t.extra,m-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=fu;case fu:for(;M=t.distcode[d&(1<>>24,V=M>>>16&255,G=M&65535,!(S<=m);){if(l===0)break t;l--,d+=i[a++]<>D)],S=M>>>24,V=M>>>16&255,G=M&65535,!(D+S<=m);){if(l===0)break t;l--,d+=i[a++]<>>=D,m-=D,t.back+=D}if(d>>>=S,m-=S,t.back+=S,V&64){r.msg="invalid distance code",t.mode=je;break}t.offset=G,t.extra=V&15,t.mode=hu;case hu:if(t.extra){for(N=t.extra;m>>=t.extra,m-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){r.msg="invalid distance too far back",t.mode=je;break}t.mode=cu;case cu:if(h===0)break t;if(p=k-h,t.offset>p){if(p=t.offset-p,p>t.whave&&t.sane){r.msg="invalid distance too far back",t.mode=je;break}p>t.wnext?(p-=t.wnext,j=t.wsize-p):j=t.wnext-p,p>t.length&&(p=t.length),O=t.window}else O=s,j=c-t.offset,p=t.length;p>h&&(p=h),h-=p,t.length-=p;do s[c++]=O[j++];while(--p);t.length===0&&(t.mode=As);break;case du:if(h===0)break t;s[c++]=t.length,h--,t.mode=As;break;case xo:if(t.wrap){for(;m<32;){if(l===0)break t;l--,d|=i[a++]<{if(Fi(r))return Hr;let e=r.state;return e.window&&(e.window=null),r.state=null,Ci},Dc=(r,e)=>{if(Fi(r))return Hr;const t=r.state;return t.wrap&2?(t.head=e,e.done=!1,Ci):Hr},qc=(r,e)=>{const t=e.length;let i,s,a;return Fi(r)||(i=r.state,i.wrap!==0&&i.mode!==Es)?Hr:i.mode===Es&&(s=1,s=Uo(s,e,t,0),s!==i.check)?df:(a=xf(r,e,t,t),a?(i.mode=gf,pf):(i.havedict=1,Ci))};var Uc=bf,zc=wf,Hc=vf,Wc=Bc,Vc=yf,Gc=Rc,Yc=Tc,Jc=Dc,Kc=qc,Xc="pako inflate (from Nodeca project)",pn={inflateReset:Uc,inflateReset2:zc,inflateResetKeep:Hc,inflateInit:Wc,inflateInit2:Vc,inflate:Gc,inflateEnd:Yc,inflateGetHeader:Jc,inflateSetDictionary:Kc,inflateInfo:Xc};function $c(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var Zc=$c;const _f=Object.prototype.toString,{Z_NO_FLUSH:Qc,Z_FINISH:bu,Z_OK:$i,Z_STREAM_END:No,Z_NEED_DICT:Lo,Z_STREAM_ERROR:t1,Z_DATA_ERROR:wu,Z_MEM_ERROR:e1,Z_BUF_ERROR:yu}=lf,r1={chunkSize:1024*64,windowBits:15,to:""};function Ra(r){this.options=uf.assign({},r1,r||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(r&&r.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new vc,this.strm.avail_out=0;let t=pn.inflateInit2(this.strm,e.windowBits);if(t!==$i)throw new Error(zo[t]);if(this.header=new Zc,pn.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Ho.string2buf(e.dictionary):_f.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(t=pn.inflateSetDictionary(this.strm,e.dictionary),t!==$i)))throw new Error(zo[t])}Ra.prototype.push=function(r,e){const t=this.strm,i=this.options.chunkSize,s=this.options.dictionary;let a,c,l;if(this.ended)return!1;for(e===~~e?c=e:c=e===!0?bu:Qc,_f.call(r)==="[object ArrayBuffer]"?t.input=new Uint8Array(r):t.input=r,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(i),t.next_out=0,t.avail_out=i),a=pn.inflate(t,c),a===Lo&&s&&(a=pn.inflateSetDictionary(t,s),a===$i?a=pn.inflate(t,c):a===wu&&(a=Lo));t.avail_in>0&&a===No&&t.state.wrap&2&&t.state.flags!==0&&t.input[t.next_in]!==0;)pn.inflateReset(t),a=pn.inflate(t,c);switch(a){case t1:case wu:case Lo:case e1:return this.onEnd(a),this.ended=!0,!1}if(l=t.avail_out,t.next_out&&(t.avail_out===0||a===No||c>0))if(this.options.to==="string"){let h=Ho.utf8border(t.output,t.next_out),d=t.next_out-h,m=Ho.buf2string(t.output,h);t.next_out=d,t.avail_out=i-d,d&&t.output.set(t.output.subarray(h,h+d),0),this.onData(m)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out)),t.avail_out=0,t.next_out=0;if(!((a===$i||a===yu)&&l===0)){if(a===No)return a=pn.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(t.avail_in===0){if(c===bu)return a=pn.inflateEnd(this.strm),this.onEnd(a===$i?yu:a),this.ended=!0,!1;break}}}return!0};Ra.prototype.onData=function(r){this.chunks.push(r)};Ra.prototype.onEnd=function(r){r===$i&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=uf.flattenChunks(this.chunks)),this.chunks=[],this.err=r,this.msg=this.strm.msg};function n1(r,e){const t=new Ra(e);if(t.push(r,!0),t.err)throw t.msg||zo[t.err];return t.result}var i1=Ra,a1=n1,s1={Inflate:i1,inflate:a1};const{Inflate:o1,inflate:l1}=s1;var xu=o1,u1=l1;const Af=[];for(let r=0;r<256;r++){let e=r;for(let t=0;t<8;t++)e&1?e=3988292384^e>>>1:e=e>>>1;Af[r]=e}const _u=4294967295;function f1(r,e,t){let i=r;for(let s=0;s>>8;return i}function h1(r,e){return(f1(_u,r,e)^_u)>>>0}function Au(r,e,t){const i=r.readUint32(),s=h1(new Uint8Array(r.buffer,r.byteOffset+r.offset-e-4,e),e);if(s!==i)throw new Error(`CRC mismatch for chunk ${t}. Expected ${i}, found ${s}`)}function Nf(r,e,t){for(let i=0;i>1)&255}else{for(;a>1)&255;for(;a>1)&255}}function Pf(r,e,t,i,s){let a=0;if(t.length===0){for(;a=t||mt>=i))for(let ct=0;ct>8&255}const w1=new Uint16Array([255]),y1=new Uint8Array(w1.buffer),x1=y1[0]===255,_1=new Uint8Array(0);function Nu(r){const{data:e,width:t,height:i,channels:s,depth:a}=r,c=Math.ceil(a/8)*s,l=Math.ceil(a/8*s*t),h=new Uint8Array(i*l);let d=_1,m=0,_,k;for(let p=0;p>8&255}const Is=Uint8Array.of(137,80,78,71,13,10,26,10);function Lu(r){if(!N1(r.readBytes(Is.length)))throw new Error("wrong PNG signature")}function N1(r){if(r.length79)throw new Error("keyword length must be between 1 and 79")}const P1=/^[\u0000-\u00FF]*$/;function I1(r){if(!P1.test(r))throw new Error("invalid latin1 text")}function C1(r,e,t){const i=Cf(e);r[i]=F1(e,t-i.length-1)}function Cf(r){for(r.mark();r.readByte()!==S1;);const e=r.offset;r.reset();const t=If.decode(r.readBytes(e-r.offset-1));return r.skip(1),k1(t),t}function F1(r,e){return If.decode(r.readBytes(e))}const Er={UNKNOWN:-1,GREYSCALE:0,TRUECOLOUR:2,INDEXED_COLOUR:3,GREYSCALE_ALPHA:4,TRUECOLOUR_ALPHA:6},So={UNKNOWN:-1,DEFLATE:0},Su={UNKNOWN:-1,ADAPTIVE:0},ko={UNKNOWN:-1,NO_INTERLACE:0,ADAM7:1},Ns={NONE:0,BACKGROUND:1,PREVIOUS:2},Po={SOURCE:0,OVER:1};class E1 extends $o{constructor(t,i={}){super(t);_e(this,"_checkCrc");_e(this,"_inflator");_e(this,"_png");_e(this,"_apng");_e(this,"_end");_e(this,"_hasPalette");_e(this,"_palette");_e(this,"_hasTransparency");_e(this,"_transparency");_e(this,"_compressionMethod");_e(this,"_filterMethod");_e(this,"_interlaceMethod");_e(this,"_colorType");_e(this,"_isAnimated");_e(this,"_numberOfFrames");_e(this,"_numberOfPlays");_e(this,"_frames");_e(this,"_writingDataChunks");const{checkCrc:s=!1}=i;this._checkCrc=s,this._inflator=new xu,this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._apng={width:-1,height:-1,channels:-1,depth:1,numberOfFrames:1,numberOfPlays:0,text:{},frames:[]},this._end=!1,this._hasPalette=!1,this._palette=[],this._hasTransparency=!1,this._transparency=new Uint16Array(0),this._compressionMethod=So.UNKNOWN,this._filterMethod=Su.UNKNOWN,this._interlaceMethod=ko.UNKNOWN,this._colorType=Er.UNKNOWN,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this.setBigEndian()}decode(){for(Lu(this);!this._end;){const t=this.readUint32(),i=this.readChars(4);this.decodeChunk(t,i)}return this.decodeImage(),this._png}decodeApng(){for(Lu(this);!this._end;){const t=this.readUint32(),i=this.readChars(4);this.decodeApngChunk(t,i)}return this.decodeApngImage(),this._apng}decodeChunk(t,i){const s=this.offset;switch(i){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(t);break;case"IDAT":this.decodeIDAT(t);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(t);break;case"iCCP":this.decodeiCCP(t);break;case L1:C1(this._png.text,this,t);break;case"pHYs":this.decodepHYs();break;default:this.skip(t);break}if(this.offset-s!==t)throw new Error(`Length mismatch while decoding chunk ${i}`);this._checkCrc?Au(this,t+4,i):this.skip(4)}decodeApngChunk(t,i){const s=this.offset;switch(i!=="fdAT"&&i!=="IDAT"&&this._writingDataChunks&&this.pushDataToFrame(),i){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(t);break;default:this.decodeChunk(t,i),this.offset=s+t;break}if(this.offset-s!==t)throw new Error(`Length mismatch while decoding chunk ${i}`);this._checkCrc?Au(this,t+4,i):this.skip(4)}decodeIHDR(){const t=this._png;t.width=this.readUint32(),t.height=this.readUint32(),t.depth=O1(this.readUint8());const i=this.readUint8();this._colorType=i;let s;switch(i){case Er.GREYSCALE:s=1;break;case Er.TRUECOLOUR:s=3;break;case Er.INDEXED_COLOUR:s=1;break;case Er.GREYSCALE_ALPHA:s=2;break;case Er.TRUECOLOUR_ALPHA:s=4;break;case Er.UNKNOWN:default:throw new Error(`Unknown color type: ${i}`)}if(this._png.channels=s,this._compressionMethod=this.readUint8(),this._compressionMethod!==So.DEFLATE)throw new Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodeACTL(){this._numberOfFrames=this.readUint32(),this._numberOfPlays=this.readUint32(),this._isAnimated=!0}decodeFCTL(){const t={sequenceNumber:this.readUint32(),width:this.readUint32(),height:this.readUint32(),xOffset:this.readUint32(),yOffset:this.readUint32(),delayNumber:this.readUint16(),delayDenominator:this.readUint16(),disposeOp:this.readUint8(),blendOp:this.readUint8(),data:new Uint8Array(0)};this._frames.push(t)}decodePLTE(t){if(t%3!==0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${t}`);const i=t/3;this._hasPalette=!0;const s=[];this._palette=s;for(let a=0;athis._png.width*this._png.height)throw new Error(`tRNS chunk contains more alpha values than there are pixels (${t/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(t/2);for(let i=0;ithis._palette.length)throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${t} vs ${this._palette.length})`);let i=0;for(;i{const h=((c+i.yOffset)*this._png.width+i.xOffset+l)*this._png.channels,d=(c*i.width+l)*this._png.channels;return{index:h,frameIndex:d}};switch(i.blendOp){case Po.SOURCE:for(let c=0;c=200&&e.status<=299}function Ls(r){try{r.dispatchEvent(new MouseEvent("click"))}catch{var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),r.dispatchEvent(e)}}var Ai=Jt.saveAs||((typeof window>"u"?"undefined":Ae(window))!=="object"||window!==Jt?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype?function(r,e,t){var i=Jt.URL||Jt.webkitURL,s=document.createElement("a");e=e||r.name||"download",s.download=e,s.rel="noopener",typeof r=="string"?(s.href=r,s.origin!==location.origin?Pu(s.href)?Co(r,e,t):Ls(s,s.target="_blank"):Ls(s)):(s.href=i.createObjectURL(r),setTimeout(function(){i.revokeObjectURL(s.href)},4e4),setTimeout(function(){Ls(s)},0))}:"msSaveOrOpenBlob"in navigator?function(r,e,t){if(e=e||r.name||"download",typeof r=="string")if(Pu(r))Co(r,e,t);else{var i=document.createElement("a");i.href=r,i.target="_blank",setTimeout(function(){Ls(i)})}else navigator.msSaveOrOpenBlob(function(s,a){return a===void 0?a={autoBom:!1}:Ae(a)!=="object"&&(Se.warn("Deprecated: Expected third argument to be a object"),a={autoBom:!a}),a.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(s.type)?new Blob(["\uFEFF",s],{type:s.type}):s}(r,t),e)}:function(r,e,t,i){if((i=i||open("","_blank"))&&(i.document.title=i.document.body.innerText="downloading..."),typeof r=="string")return Co(r,e,t);var s=r.type==="application/octet-stream",a=/constructor/i.test(Jt.HTMLElement)||Jt.safari,c=/CriOS\/[\d]+/.test(navigator.userAgent);if((c||s&&a)&&(typeof FileReader>"u"?"undefined":Ae(FileReader))==="object"){var l=new FileReader;l.onloadend=function(){var m=l.result;m=c?m:m.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=m:location=m,i=null},l.readAsDataURL(r)}else{var h=Jt.URL||Jt.webkitURL,d=h.createObjectURL(r);i?i.location=d:location.href=d,i=null,setTimeout(function(){h.revokeObjectURL(d)},4e4)}});/** * A class to parse color values * @author Stoyan Stefanov @@ -114,7 +114,7 @@ T* `):u.join(` Tj endobj\r `},t.outline.count_r=function(i,s){for(var a=0;a1){U=!0,ot=void 0;var J=R*tt;ut=new Uint8Array(J);for(var Z=new DataView(N.buffer),at=0;at=0;r--){for(var i=this.bottom_up?r:this.height-1-r,s=0;s>7-l&1];this.data[c+4*l]=h.blue,this.data[c+4*l+1]=h.green,this.data[c+4*l+2]=h.red,this.data[c+4*l+3]=255}t!==0&&(this.pos+=4-t)}},Zr.prototype.bit4=function(){for(var r=Math.ceil(this.width/2),e=r%4,t=this.height-1;t>=0;t--){for(var i=this.bottom_up?t:this.height-1-t,s=0;s>4,h=15&a,d=this.palette[l];if(this.data[c]=d.blue,this.data[c+1]=d.green,this.data[c+2]=d.red,this.data[c+3]=255,2*s+1>=this.width)break;d=this.palette[h],this.data[c+4]=d.blue,this.data[c+4+1]=d.green,this.data[c+4+2]=d.red,this.data[c+4+3]=255}e!==0&&(this.pos+=4-e)}},Zr.prototype.bit8=function(){for(var r=this.width%4,e=this.height-1;e>=0;e--){for(var t=this.bottom_up?e:this.height-1-e,i=0;i=0;t--){for(var i=this.bottom_up?t:this.height-1-t,s=0;s>5&e)/e*255|0,h=(a>>10&e)/e*255|0,d=a>>15?255:0,m=i*this.width*4+4*s;this.data[m]=h,this.data[m+1]=l,this.data[m+2]=c,this.data[m+3]=d}this.pos+=r}},Zr.prototype.bit16=function(){for(var r=this.width%3,e=parseInt("11111",2),t=parseInt("111111",2),i=this.height-1;i>=0;i--){for(var s=this.bottom_up?i:this.height-1-i,a=0;a>5&t)/t*255|0,d=(c>>11)/e*255|0,m=s*this.width*4+4*a;this.data[m]=d,this.data[m+1]=h,this.data[m+2]=l,this.data[m+3]=255}this.pos+=r}},Zr.prototype.bit24=function(){for(var r=this.height-1;r>=0;r--){for(var e=this.bottom_up?r:this.height-1-r,t=0;t=0;r--)for(var e=this.bottom_up?r:this.height-1-r,t=0;ti&&(s.push(r.slice(h,a)),l=0,h=a),l+=e[a],a++;return h!==a&&s.push(r.slice(h,a)),s},zu=function(r,e,t){t||(t={});var i,s,a,c,l,h,d,m=[],_=[m],k=t.textIndent||0,p=0,j=0,O=r.split(" "),M=Ps.apply(this,[" ",t])[0];if(h=t.lineIndent===-1?O[0].length+2:t.lineIndent||0){var S=Array(h).join(" "),V=[];O.map(function(D){(D=D.split(/\s*\n/)).length>1?V=V.concat(D.map(function(it,mt){return(mt&&it.length?` `:"")+it})):V.push(D[0])}),O=V,h=qu.apply(this,[S,t])}for(a=0,c=O.length;ae||G){if(j>e){for(l=Uu.apply(this,[i,s,e-(k+p),e]),m.push(l.shift()),m=[l.pop()];l.length;)_.push([l.shift()]);j=s.slice(i.length-(m[0]?m[0].length:0)).reduce(function(D,it){return D+it},0)}else m=[i];_.push(m),k=j+h,p=M}else m.push(i),k+=p+j,p=M}return d=h?function(D,it){return(it?S:"")+D.join(" ")}:function(D){return D.join(" ")},_.map(d)},Ji.splitTextToSize=function(r,e,t){var i,s=(t=t||{}).fontSize||this.internal.getFontSize(),a=(function(m){if(m.widths&&m.kerning)return{widths:m.widths,kerning:m.kerning};var _=this.internal.getFont(m.fontName,m.fontStyle),k="Unicode";return _.metadata[k]?{widths:_.metadata[k].widths||{0:1},kerning:_.metadata[k].kerning||{}}:{font:_.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,t);i=Array.isArray(r)?r:String(r).split(/\r?\n/);var c=1*this.internal.scaleFactor*e/s;a.textIndent=t.textIndent?1*t.textIndent*this.internal.scaleFactor/s:0,a.lineIndent=t.lineIndent;var l,h,d=[];for(l=0,h=i.length;limport("./index.es-JsJulYHK.js"),__vite__mapDeps([0,1,2]))).catch(function(k){return Promise.reject(new Error("Could not load canvg: "+k))}).then(function(k){return k.default?k.default:k}).then(function(k){return k.fromString(d,r,m)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(k){return k.render(m)}).then(function(){_.addImage(h.toDataURL("image/jpeg",1),e,t,i,s,c,l)})},Mt.API.putTotalPages=function(r){var e,t=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(e=new RegExp(r,"g"),t=this.internal.getNumberOfPages()):(e=new RegExp(this.pdfEscape16(r,this.internal.getFont()),"g"),t=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var i=1;i<=this.internal.getNumberOfPages();i++)for(var s=0;s1){for(m=0;me||G){if(j>e){for(l=Uu.apply(this,[i,s,e-(k+p),e]),m.push(l.shift()),m=[l.pop()];l.length;)_.push([l.shift()]);j=s.slice(i.length-(m[0]?m[0].length:0)).reduce(function(D,it){return D+it},0)}else m=[i];_.push(m),k=j+h,p=M}else m.push(i),k+=p+j,p=M}return d=h?function(D,it){return(it?S:"")+D.join(" ")}:function(D){return D.join(" ")},_.map(d)},Ji.splitTextToSize=function(r,e,t){var i,s=(t=t||{}).fontSize||this.internal.getFontSize(),a=(function(m){if(m.widths&&m.kerning)return{widths:m.widths,kerning:m.kerning};var _=this.internal.getFont(m.fontName,m.fontStyle),k="Unicode";return _.metadata[k]?{widths:_.metadata[k].widths||{0:1},kerning:_.metadata[k].kerning||{}}:{font:_.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,t);i=Array.isArray(r)?r:String(r).split(/\r?\n/);var c=1*this.internal.scaleFactor*e/s;a.textIndent=t.textIndent?1*t.textIndent*this.internal.scaleFactor/s:0,a.lineIndent=t.lineIndent;var l,h,d=[];for(l=0,h=i.length;limport("./index.es-DpcOlkkW.js"),__vite__mapDeps([0,1,2]))).catch(function(k){return Promise.reject(new Error("Could not load canvg: "+k))}).then(function(k){return k.default?k.default:k}).then(function(k){return k.fromString(d,r,m)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(k){return k.render(m)}).then(function(){_.addImage(h.toDataURL("image/jpeg",1),e,t,i,s,c,l)})},Mt.API.putTotalPages=function(r){var e,t=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(e=new RegExp(r,"g"),t=this.internal.getNumberOfPages()):(e=new RegExp(this.pdfEscape16(r,this.internal.getFont()),"g"),t=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var i=1;i<=this.internal.getNumberOfPages();i++)for(var s=0;s1){for(m=0;mr?1:n>=r?0:NaN}function z(n,r){return n==null||r==null?NaN:rn?1:r>=n?0:NaN}function w(n){let r,i,t;n.length!==2?(r=g,i=(u,o)=>g(n(u),o),t=(u,o)=>n(u)-o):(r=n===g||n===z?n:I,i=n,t=n);function f(u,o,e=0,m=u.length){if(e>>1;i(u[l],o)<0?e=l+1:m=l}while(e>>1;i(u[l],o)<=0?e=l+1:m=l}while(ee&&t(u[l-1],o)>-t(u[l],o)?l-1:l}return{left:f,center:a,right:c}}function I(){return 0}function P(n){return n===null?NaN:+n}const $=w(g),j=$.right;w(P).center;const x=Math.sqrt(50),B=Math.sqrt(10),C=Math.sqrt(2);function v(n,r,i){const t=(r-n)/Math.max(0,i),f=Math.floor(Math.log10(t)),c=t/Math.pow(10,f),a=c>=x?10:c>=B?5:c>=C?2:1;let u,o,e;return f<0?(e=Math.pow(10,-f)/a,u=Math.round(n*e),o=Math.round(r*e),u/er&&--o,e=-e):(e=Math.pow(10,f)*a,u=Math.round(n/e),o=Math.round(r/e),u*er&&--o),o0))return[];if(n===r)return[n];const t=r=f))return[];const u=c-f+1,o=new Array(u);if(t)if(a<0)for(let e=0;er&&(i=n,n=r,r=i),function(t){return Math.max(n,Math.min(r,t))}}function Q(n,r,i){var t=n[0],f=n[1],c=r[0],a=r[1];return f2?T:Q,o=e=null,l}function l(h){return h==null||isNaN(h=+h)?c:(o||(o=u(n.map(t),r,i)))(t(a(h)))}return l.invert=function(h){return a(f((e||(e=u(r,n.map(t),y)))(h)))},l.domain=function(h){return arguments.length?(n=Array.from(h,L),m()):n.slice()},l.range=function(h){return arguments.length?(r=Array.from(h),m()):r.slice()},l.rangeRound=function(h){return r=Array.from(h),i=S,m()},l.clamp=function(h){return arguments.length?(a=h?!0:s,m()):a!==s},l.interpolate=function(h){return arguments.length?(i=h,m()):i},l.unknown=function(h){return arguments.length?(c=h,l):c},function(h,k){return t=h,f=k,m()}}function W(){return V()(s,s)}function X(n,r,i,t){var f=E(n,r,i),c;switch(t=R(t??",f"),t.type){case"s":{var a=Math.max(Math.abs(n),Math.abs(r));return t.precision==null&&!isNaN(c=H(f,a))&&(t.precision=c),q(t,a)}case"":case"e":case"g":case"p":case"r":{t.precision==null&&!isNaN(c=J(f,Math.max(Math.abs(n),Math.abs(r))))&&(t.precision=c-(t.type==="e"));break}case"f":case"%":{t.precision==null&&!isNaN(c=G(f))&&(t.precision=c-(t.type==="%")*2);break}}return F(t)}function Y(n){var r=n.domain;return n.ticks=function(i){var t=r();return D(t[0],t[t.length-1],i??10)},n.tickFormat=function(i,t){var f=r();return X(f[0],f[f.length-1],i??10,t)},n.nice=function(i){i==null&&(i=10);var t=r(),f=0,c=t.length-1,a=t[f],u=t[c],o,e,m=10;for(u0;){if(e=d(a,u,i),e===o)return t[f]=a,t[c]=u,r(t);if(e>0)a=Math.floor(a/e)*e,u=Math.ceil(u/e)*e;else if(e<0)a=Math.ceil(a*e)/e,u=Math.floor(u*e)/e;else break;o=e}return n},n}function Z(){var n=W();return n.copy=function(){return U(n,Z())},A.apply(n,arguments),Y(n)}export{U as a,w as b,W as c,Z as l,E as t}; +import{ar as y,aq as b}from"../app/index-8JtvDNuA.js";import{i as A}from"./init-Gi6I4Gst.js";import{e as M,b as R,a as q,f as F}from"./defaultLocale-CrowFXzY.js";function S(n,r){return n=+n,r=+r,function(i){return Math.round(n*(1-i)+r*i)}}function g(n,r){return n==null||r==null?NaN:nr?1:n>=r?0:NaN}function z(n,r){return n==null||r==null?NaN:rn?1:r>=n?0:NaN}function w(n){let r,i,t;n.length!==2?(r=g,i=(u,o)=>g(n(u),o),t=(u,o)=>n(u)-o):(r=n===g||n===z?n:I,i=n,t=n);function f(u,o,e=0,m=u.length){if(e>>1;i(u[l],o)<0?e=l+1:m=l}while(e>>1;i(u[l],o)<=0?e=l+1:m=l}while(ee&&t(u[l-1],o)>-t(u[l],o)?l-1:l}return{left:f,center:a,right:c}}function I(){return 0}function P(n){return n===null?NaN:+n}const $=w(g),j=$.right;w(P).center;const x=Math.sqrt(50),B=Math.sqrt(10),C=Math.sqrt(2);function v(n,r,i){const t=(r-n)/Math.max(0,i),f=Math.floor(Math.log10(t)),c=t/Math.pow(10,f),a=c>=x?10:c>=B?5:c>=C?2:1;let u,o,e;return f<0?(e=Math.pow(10,-f)/a,u=Math.round(n*e),o=Math.round(r*e),u/er&&--o,e=-e):(e=Math.pow(10,f)*a,u=Math.round(n/e),o=Math.round(r/e),u*er&&--o),o0))return[];if(n===r)return[n];const t=r=f))return[];const u=c-f+1,o=new Array(u);if(t)if(a<0)for(let e=0;er&&(i=n,n=r,r=i),function(t){return Math.max(n,Math.min(r,t))}}function Q(n,r,i){var t=n[0],f=n[1],c=r[0],a=r[1];return f2?T:Q,o=e=null,l}function l(h){return h==null||isNaN(h=+h)?c:(o||(o=u(n.map(t),r,i)))(t(a(h)))}return l.invert=function(h){return a(f((e||(e=u(r,n.map(t),y)))(h)))},l.domain=function(h){return arguments.length?(n=Array.from(h,L),m()):n.slice()},l.range=function(h){return arguments.length?(r=Array.from(h),m()):r.slice()},l.rangeRound=function(h){return r=Array.from(h),i=S,m()},l.clamp=function(h){return arguments.length?(a=h?!0:s,m()):a!==s},l.interpolate=function(h){return arguments.length?(i=h,m()):i},l.unknown=function(h){return arguments.length?(c=h,l):c},function(h,k){return t=h,f=k,m()}}function W(){return V()(s,s)}function X(n,r,i,t){var f=E(n,r,i),c;switch(t=R(t??",f"),t.type){case"s":{var a=Math.max(Math.abs(n),Math.abs(r));return t.precision==null&&!isNaN(c=H(f,a))&&(t.precision=c),q(t,a)}case"":case"e":case"g":case"p":case"r":{t.precision==null&&!isNaN(c=J(f,Math.max(Math.abs(n),Math.abs(r))))&&(t.precision=c-(t.type==="e"));break}case"f":case"%":{t.precision==null&&!isNaN(c=G(f))&&(t.precision=c-(t.type==="%")*2);break}}return F(t)}function Y(n){var r=n.domain;return n.ticks=function(i){var t=r();return D(t[0],t[t.length-1],i??10)},n.tickFormat=function(i,t){var f=r();return X(f[0],f[f.length-1],i??10,t)},n.nice=function(i){i==null&&(i=10);var t=r(),f=0,c=t.length-1,a=t[f],u=t[c],o,e,m=10;for(u0;){if(e=d(a,u,i),e===o)return t[f]=a,t[c]=u,r(t);if(e>0)a=Math.floor(a/e)*e,u=Math.ceil(u/e)*e;else if(e<0)a=Math.ceil(a*e)/e,u=Math.floor(u*e)/e;else break;o=e}return n},n}function Z(){var n=W();return n.copy=function(){return U(n,Z())},A.apply(n,arguments),Y(n)}export{U as a,w as b,W as c,Z as l,E as t}; diff --git a/veadk/webui/assets/visualizations/mermaid/abnfDiagram-N423BO3Z-RhYMe2zl.js b/veadk/webui/assets/visualizations/mermaid/abnfDiagram-N423BO3Z-CQmvc3R1.js similarity index 86% rename from veadk/webui/assets/visualizations/mermaid/abnfDiagram-N423BO3Z-RhYMe2zl.js rename to veadk/webui/assets/visualizations/mermaid/abnfDiagram-N423BO3Z-CQmvc3R1.js index 33751bdf2..9c8d012c1 100644 --- a/veadk/webui/assets/visualizations/mermaid/abnfDiagram-N423BO3Z-RhYMe2zl.js +++ b/veadk/webui/assets/visualizations/mermaid/abnfDiagram-N423BO3Z-CQmvc3R1.js @@ -1 +1 @@ -import{g as p,r as u,d as n}from"./chunk-6Q2QTUOP-zEQK1XLO.js";import{p as f}from"./chunk-JWPE2WC7-DD-BFVC6.js";import{a,at as o}from"./mermaid.core-y4TF8bTw.js";import"../../app/index-BNPwMQXG.js";import{M as c,c as d}from"./cynefin-OW5HDTMX-DBq9B5VP.js";import"../../chunks/purify.es-BnINGy_Y.js";var v=d().RailroadAbnf.parser.LangiumParser,i=a(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=a(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=a(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=a(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=a(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=a(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=a(e=>{f(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(P(r)))},"populateDb"),R={parse:a(e=>{n.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:n}},F={parser:R,db:n,renderer:u,styles:p};export{F as diagram}; +import{g as p,r as u,d as n}from"./chunk-6Q2QTUOP-N9gzANAs.js";import{p as f}from"./chunk-JWPE2WC7-DVlhplzu.js";import{a,at as o}from"./mermaid.core-DAx4nvmm.js";import"../../app/index-8JtvDNuA.js";import{M as c,c as d}from"./cynefin-OW5HDTMX-BHP1Kvyc.js";import"../../chunks/purify.es-BnINGy_Y.js";var v=d().RailroadAbnf.parser.LangiumParser,i=a(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=a(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=a(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=a(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=a(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=a(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=a(e=>{f(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(P(r)))},"populateDb"),R={parse:a(e=>{n.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:n}},F={parser:R,db:n,renderer:u,styles:p};export{F as diagram}; diff --git a/veadk/webui/assets/visualizations/mermaid/architectureDiagram-T3A2C74G-C47wDTji.js b/veadk/webui/assets/visualizations/mermaid/architectureDiagram-T3A2C74G-ysR-aM43.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/architectureDiagram-T3A2C74G-C47wDTji.js rename to veadk/webui/assets/visualizations/mermaid/architectureDiagram-T3A2C74G-ysR-aM43.js index 5ae3ee26b..47afe2db0 100644 --- a/veadk/webui/assets/visualizations/mermaid/architectureDiagram-T3A2C74G-C47wDTji.js +++ b/veadk/webui/assets/visualizations/mermaid/architectureDiagram-T3A2C74G-ysR-aM43.js @@ -1,4 +1,4 @@ -import{p as qe}from"./chunk-JWPE2WC7-DD-BFVC6.js";import{a as ct,aP as Qe,aW as Je,at as Se,aR as Ke,W as je,aT as _e,$ as tr,V as er,aQ as rr,s as ir,r as ar,X as nr,O as or,Y as me,F as Ee,a2 as ve,aN as sr,a0 as hr,aJ as lr,b7 as fr}from"./mermaid.core-y4TF8bTw.js";import{p as cr}from"./cynefin-OW5HDTMX-DBq9B5VP.js";import{c as Fe}from"../../chunks/cytoscape.esm-Dz9tvMTw.js";import{U as Te,ad as gr,aG as ur}from"../../app/index-BNPwMQXG.js";import"../../chunks/purify.es-BnINGy_Y.js";var be={exports:{}},ue={exports:{}},de={exports:{}},De;function dr(){return De||(De=1,function(I,M){(function(x,N){I.exports=N()})(Te,function(){return function(C){var x={};function N(v){if(x[v])return x[v].exports;var l=x[v]={i:v,l:!1,exports:{}};return C[v].call(l.exports,l,l.exports,N),l.l=!0,l.exports}return N.m=C,N.c=x,N.i=function(v){return v},N.d=function(v,l,n){N.o(v,l)||Object.defineProperty(v,l,{configurable:!1,enumerable:!0,get:n})},N.n=function(v){var l=v&&v.__esModule?function(){return v.default}:function(){return v};return N.d(l,"a",l),l},N.o=function(v,l){return Object.prototype.hasOwnProperty.call(v,l)},N.p="",N(N.s=28)}([function(C,x,N){function v(){}v.QUALITY=1,v.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,v.DEFAULT_INCREMENTAL=!1,v.DEFAULT_ANIMATION_ON_LAYOUT=!0,v.DEFAULT_ANIMATION_DURING_LAYOUT=!1,v.DEFAULT_ANIMATION_PERIOD=50,v.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,v.DEFAULT_GRAPH_MARGIN=15,v.NODE_DIMENSIONS_INCLUDE_LABELS=!1,v.SIMPLE_NODE_SIZE=40,v.SIMPLE_NODE_HALF_SIZE=v.SIMPLE_NODE_SIZE/2,v.EMPTY_COMPOUND_NODE_SIZE=40,v.MIN_EDGE_LENGTH=1,v.WORLD_BOUNDARY=1e6,v.INITIAL_WORLD_BOUNDARY=v.WORLD_BOUNDARY/1e3,v.WORLD_CENTER_X=1200,v.WORLD_CENTER_Y=900,C.exports=v},function(C,x,N){var v=N(2),l=N(8),n=N(9);function r(f,e,g){v.call(this,g),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=g,this.bendpoints=[],this.source=f,this.target=e}r.prototype=Object.create(v.prototype);for(var i in v)r[i]=v[i];r.prototype.getSource=function(){return this.source},r.prototype.getTarget=function(){return this.target},r.prototype.isInterGraph=function(){return this.isInterGraph},r.prototype.getLength=function(){return this.length},r.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},r.prototype.getBendpoints=function(){return this.bendpoints},r.prototype.getLca=function(){return this.lca},r.prototype.getSourceInLca=function(){return this.sourceInLca},r.prototype.getTargetInLca=function(){return this.targetInLca},r.prototype.getOtherEnd=function(f){if(this.source===f)return this.target;if(this.target===f)return this.source;throw"Node is not incident with this edge"},r.prototype.getOtherEndInGraph=function(f,e){for(var g=this.getOtherEnd(f),t=e.getGraphManager().getRoot();;){if(g.getOwner()==e)return g;if(g.getOwner()==t)break;g=g.getOwner().getParent()}return null},r.prototype.updateLength=function(){var f=new Array(4);this.isOverlapingSourceAndTarget=l.getIntersection(this.target.getRect(),this.source.getRect(),f),this.isOverlapingSourceAndTarget||(this.lengthX=f[0]-f[2],this.lengthY=f[1]-f[3],Math.abs(this.lengthX)<1&&(this.lengthX=n.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=n.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},r.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=n.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=n.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},C.exports=r},function(C,x,N){function v(l){this.vGraphObject=l}C.exports=v},function(C,x,N){var v=N(2),l=N(10),n=N(13),r=N(0),i=N(16),f=N(5);function e(t,s,o,c){o==null&&c==null&&(c=s),v.call(this,c),t.graphManager!=null&&(t=t.graphManager),this.estimatedSize=l.MIN_VALUE,this.inclusionTreeDepth=l.MAX_VALUE,this.vGraphObject=c,this.edges=[],this.graphManager=t,o!=null&&s!=null?this.rect=new n(s.x,s.y,o.width,o.height):this.rect=new n}e.prototype=Object.create(v.prototype);for(var g in v)e[g]=v[g];e.prototype.getEdges=function(){return this.edges},e.prototype.getChild=function(){return this.child},e.prototype.getOwner=function(){return this.owner},e.prototype.getWidth=function(){return this.rect.width},e.prototype.setWidth=function(t){this.rect.width=t},e.prototype.getHeight=function(){return this.rect.height},e.prototype.setHeight=function(t){this.rect.height=t},e.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},e.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},e.prototype.getCenter=function(){return new f(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},e.prototype.getLocation=function(){return new f(this.rect.x,this.rect.y)},e.prototype.getRect=function(){return this.rect},e.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},e.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},e.prototype.setRect=function(t,s){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=s.width,this.rect.height=s.height},e.prototype.setCenter=function(t,s){this.rect.x=t-this.rect.width/2,this.rect.y=s-this.rect.height/2},e.prototype.setLocation=function(t,s){this.rect.x=t,this.rect.y=s},e.prototype.moveBy=function(t,s){this.rect.x+=t,this.rect.y+=s},e.prototype.getEdgeListToNode=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(c.target==t){if(c.source!=o)throw"Incorrect edge source!";s.push(c)}}),s},e.prototype.getEdgesBetween=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(!(c.source==o||c.target==o))throw"Incorrect edge source and/or target";(c.target==t||c.source==t)&&s.push(c)}),s},e.prototype.getNeighborsList=function(){var t=new Set,s=this;return s.edges.forEach(function(o){if(o.source==s)t.add(o.target);else{if(o.target!=s)throw"Incorrect incidency!";t.add(o.source)}}),t},e.prototype.withChildren=function(){var t=new Set,s,o;if(t.add(this),this.child!=null)for(var c=this.child.getNodes(),h=0;hs?(this.rect.x-=(this.labelWidth-s)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(s+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(o+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>o?(this.rect.y-=(this.labelHeight-o)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(o+this.labelHeight))}}},e.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==l.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},e.prototype.transform=function(t){var s=this.rect.x;s>r.WORLD_BOUNDARY?s=r.WORLD_BOUNDARY:s<-r.WORLD_BOUNDARY&&(s=-r.WORLD_BOUNDARY);var o=this.rect.y;o>r.WORLD_BOUNDARY?o=r.WORLD_BOUNDARY:o<-r.WORLD_BOUNDARY&&(o=-r.WORLD_BOUNDARY);var c=new f(s,o),h=t.inverseTransformPoint(c);this.setLocation(h.x,h.y)},e.prototype.getLeft=function(){return this.rect.x},e.prototype.getRight=function(){return this.rect.x+this.rect.width},e.prototype.getTop=function(){return this.rect.y},e.prototype.getBottom=function(){return this.rect.y+this.rect.height},e.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},C.exports=e},function(C,x,N){var v=N(0);function l(){}for(var n in v)l[n]=v[n];l.MAX_ITERATIONS=2500,l.DEFAULT_EDGE_LENGTH=50,l.DEFAULT_SPRING_STRENGTH=.45,l.DEFAULT_REPULSION_STRENGTH=4500,l.DEFAULT_GRAVITY_STRENGTH=.4,l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,l.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,l.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,l.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,l.COOLING_ADAPTATION_FACTOR=.33,l.ADAPTATION_LOWER_NODE_LIMIT=1e3,l.ADAPTATION_UPPER_NODE_LIMIT=5e3,l.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,l.MAX_NODE_DISPLACEMENT=l.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,l.MIN_REPULSION_DIST=l.DEFAULT_EDGE_LENGTH/10,l.CONVERGENCE_CHECK_PERIOD=100,l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,l.MIN_EDGE_LENGTH=1,l.GRID_CALCULATION_CHECK_PERIOD=10,C.exports=l},function(C,x,N){function v(l,n){l==null&&n==null?(this.x=0,this.y=0):(this.x=l,this.y=n)}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.setX=function(l){this.x=l},v.prototype.setY=function(l){this.y=l},v.prototype.getDifference=function(l){return new DimensionD(this.x-l.x,this.y-l.y)},v.prototype.getCopy=function(){return new v(this.x,this.y)},v.prototype.translate=function(l){return this.x+=l.width,this.y+=l.height,this},C.exports=v},function(C,x,N){var v=N(2),l=N(10),n=N(0),r=N(7),i=N(3),f=N(1),e=N(13),g=N(12),t=N(11);function s(c,h,T){v.call(this,T),this.estimatedSize=l.MIN_VALUE,this.margin=n.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=c,h!=null&&h instanceof r?this.graphManager=h:h!=null&&h instanceof Layout&&(this.graphManager=h.graphManager)}s.prototype=Object.create(v.prototype);for(var o in v)s[o]=v[o];s.prototype.getNodes=function(){return this.nodes},s.prototype.getEdges=function(){return this.edges},s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getParent=function(){return this.parent},s.prototype.getLeft=function(){return this.left},s.prototype.getRight=function(){return this.right},s.prototype.getTop=function(){return this.top},s.prototype.getBottom=function(){return this.bottom},s.prototype.isConnected=function(){return this.isConnected},s.prototype.add=function(c,h,T){if(h==null&&T==null){var u=c;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(u)>-1)throw"Node already in graph!";return u.owner=this,this.getNodes().push(u),u}else{var d=c;if(!(this.getNodes().indexOf(h)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(h.owner==T.owner&&h.owner==this))throw"Both owners must be this graph!";return h.owner!=T.owner?null:(d.source=h,d.target=T,d.isInterGraph=!1,this.getEdges().push(d),h.edges.push(d),T!=h&&T.edges.push(d),d)}},s.prototype.remove=function(c){var h=c;if(c instanceof i){if(h==null)throw"Node is null!";if(!(h.owner!=null&&h.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=h.edges.slice(),u,d=T.length,L=0;L-1&&P>-1))throw"Source and/or target doesn't know this edge!";u.source.edges.splice(w,1),u.target!=u.source&&u.target.edges.splice(P,1);var b=u.source.owner.getEdges().indexOf(u);if(b==-1)throw"Not in owner's edge list!";u.source.owner.getEdges().splice(b,1)}},s.prototype.updateLeftTop=function(){for(var c=l.MAX_VALUE,h=l.MAX_VALUE,T,u,d,L=this.getNodes(),b=L.length,w=0;wT&&(c=T),h>u&&(h=u)}return c==l.MAX_VALUE?null:(L[0].getParent().paddingLeft!=null?d=L[0].getParent().paddingLeft:d=this.margin,this.left=h-d,this.top=c-d,new g(this.left,this.top))},s.prototype.updateBounds=function(c){for(var h=l.MAX_VALUE,T=-l.MAX_VALUE,u=l.MAX_VALUE,d=-l.MAX_VALUE,L,b,w,P,V,Y=this.nodes,B=Y.length,A=0;AL&&(h=L),Tw&&(u=w),dL&&(h=L),Tw&&(u=w),d=this.nodes.length){var B=0;T.forEach(function(A){A.owner==c&&B++}),B==this.nodes.length&&(this.isConnected=!0)}},C.exports=s},function(C,x,N){var v,l=N(1);function n(r){v=N(6),this.layout=r,this.graphs=[],this.edges=[]}n.prototype.addRoot=function(){var r=this.layout.newGraph(),i=this.layout.newNode(null),f=this.add(r,i);return this.setRootGraph(f),this.rootGraph},n.prototype.add=function(r,i,f,e,g){if(f==null&&e==null&&g==null){if(r==null)throw"Graph is null!";if(i==null)throw"Parent node is null!";if(this.graphs.indexOf(r)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(r),r.parent!=null)throw"Already has a parent!";if(i.child!=null)throw"Already has a child!";return r.parent=i,i.child=r,r}else{g=f,e=i,f=r;var t=e.getOwner(),s=g.getOwner();if(!(t!=null&&t.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(s!=null&&s.getGraphManager()==this))throw"Target not in this graph mgr!";if(t==s)return f.isInterGraph=!1,t.add(f,e,g);if(f.isInterGraph=!0,f.source=e,f.target=g,this.edges.indexOf(f)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(f),!(f.source!=null&&f.target!=null))throw"Edge source and/or target is null!";if(!(f.source.edges.indexOf(f)==-1&&f.target.edges.indexOf(f)==-1))throw"Edge already in source and/or target incidency list!";return f.source.edges.push(f),f.target.edges.push(f),f}},n.prototype.remove=function(r){if(r instanceof v){var i=r;if(i.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(i==this.rootGraph||i.parent!=null&&i.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(i.getEdges());for(var e,g=f.length,t=0;t=r.getRight()?i[0]+=Math.min(r.getX()-n.getX(),n.getRight()-r.getRight()):r.getX()<=n.getX()&&r.getRight()>=n.getRight()&&(i[0]+=Math.min(n.getX()-r.getX(),r.getRight()-n.getRight())),n.getY()<=r.getY()&&n.getBottom()>=r.getBottom()?i[1]+=Math.min(r.getY()-n.getY(),n.getBottom()-r.getBottom()):r.getY()<=n.getY()&&r.getBottom()>=n.getBottom()&&(i[1]+=Math.min(n.getY()-r.getY(),r.getBottom()-n.getBottom()));var g=Math.abs((r.getCenterY()-n.getCenterY())/(r.getCenterX()-n.getCenterX()));r.getCenterY()===n.getCenterY()&&r.getCenterX()===n.getCenterX()&&(g=1);var t=g*i[0],s=i[1]/g;i[0]t)return i[0]=f,i[1]=o,i[2]=g,i[3]=Y,!1;if(eg)return i[0]=s,i[1]=e,i[2]=P,i[3]=t,!1;if(fg?(i[0]=h,i[1]=T,a=!0):(i[0]=c,i[1]=o,a=!0):p===y&&(f>g?(i[0]=s,i[1]=o,a=!0):(i[0]=u,i[1]=T,a=!0)),-m===y?g>f?(i[2]=V,i[3]=Y,E=!0):(i[2]=P,i[3]=w,E=!0):m===y&&(g>f?(i[2]=b,i[3]=w,E=!0):(i[2]=B,i[3]=Y,E=!0)),a&&E)return!1;if(f>g?e>t?(S=this.getCardinalDirection(p,y,4),D=this.getCardinalDirection(m,y,2)):(S=this.getCardinalDirection(-p,y,3),D=this.getCardinalDirection(-m,y,1)):e>t?(S=this.getCardinalDirection(-p,y,1),D=this.getCardinalDirection(-m,y,3)):(S=this.getCardinalDirection(p,y,2),D=this.getCardinalDirection(m,y,4)),!a)switch(S){case 1:W=o,F=f+-L/y,i[0]=F,i[1]=W;break;case 2:F=u,W=e+d*y,i[0]=F,i[1]=W;break;case 3:W=T,F=f+L/y,i[0]=F,i[1]=W;break;case 4:F=h,W=e+-d*y,i[0]=F,i[1]=W;break}if(!E)switch(D){case 1:Q=w,R=g+-j/y,i[2]=R,i[3]=Q;break;case 2:R=B,Q=t+A*y,i[2]=R,i[3]=Q;break;case 3:Q=Y,R=g+j/y,i[2]=R,i[3]=Q;break;case 4:R=V,Q=t+-A*y,i[2]=R,i[3]=Q;break}}return!1},l.getCardinalDirection=function(n,r,i){return n>r?i:1+i%4},l.getIntersection=function(n,r,i,f){if(f==null)return this.getIntersection2(n,r,i);var e=n.x,g=n.y,t=r.x,s=r.y,o=i.x,c=i.y,h=f.x,T=f.y,u=void 0,d=void 0,L=void 0,b=void 0,w=void 0,P=void 0,V=void 0,Y=void 0,B=void 0;return L=s-g,w=e-t,V=t*g-e*s,b=T-c,P=o-h,Y=h*c-o*T,B=L*P-b*w,B===0?null:(u=(w*Y-P*V)/B,d=(b*V-L*Y)/B,new v(u,d))},l.angleOfVector=function(n,r,i,f){var e=void 0;return n!==i?(e=Math.atan((f-r)/(i-n)),i=0){var T=(-o+Math.sqrt(o*o-4*s*c))/(2*s),u=(-o-Math.sqrt(o*o-4*s*c))/(2*s),d=null;return T>=0&&T<=1?[T]:u>=0&&u<=1?[u]:d}else return null},l.HALF_PI=.5*Math.PI,l.ONE_AND_HALF_PI=1.5*Math.PI,l.TWO_PI=2*Math.PI,l.THREE_PI=3*Math.PI,C.exports=l},function(C,x,N){function v(){}v.sign=function(l){return l>0?1:l<0?-1:0},v.floor=function(l){return l<0?Math.ceil(l):Math.floor(l)},v.ceil=function(l){return l<0?Math.floor(l):Math.ceil(l)},C.exports=v},function(C,x,N){function v(){}v.MAX_VALUE=2147483647,v.MIN_VALUE=-2147483648,C.exports=v},function(C,x,N){var v=function(){function e(g,t){for(var s=0;s"u"?"undefined":v(n);return n==null||r!="object"&&r!="function"},C.exports=l},function(C,x,N){function v(o){if(Array.isArray(o)){for(var c=0,h=Array(o.length);c0&&c;){for(L.push(w[0]);L.length>0&&c;){var P=L[0];L.splice(0,1),d.add(P);for(var V=P.getEdges(),u=0;u-1&&w.splice(j,1)}d=new Set,b=new Map}}return o},s.prototype.createDummyNodesForBendpoints=function(o){for(var c=[],h=o.source,T=this.graphManager.calcLowestCommonAncestor(o.source,o.target),u=0;u0){for(var T=this.edgeToDummyNodes.get(h),u=0;u=0&&c.splice(Y,1);var B=b.getNeighborsList();B.forEach(function(a){if(h.indexOf(a)<0){var E=T.get(a),p=E-1;p==1&&P.push(a),T.set(a,p)}})}h=h.concat(P),(c.length==1||c.length==2)&&(u=!0,d=c[0])}return d},s.prototype.setGraphManager=function(o){this.graphManager=o},C.exports=s},function(C,x,N){function v(){}v.seed=1,v.x=0,v.nextDouble=function(){return v.x=Math.sin(v.seed++)*1e4,v.x-Math.floor(v.x)},C.exports=v},function(C,x,N){var v=N(5);function l(n,r){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}l.prototype.getWorldOrgX=function(){return this.lworldOrgX},l.prototype.setWorldOrgX=function(n){this.lworldOrgX=n},l.prototype.getWorldOrgY=function(){return this.lworldOrgY},l.prototype.setWorldOrgY=function(n){this.lworldOrgY=n},l.prototype.getWorldExtX=function(){return this.lworldExtX},l.prototype.setWorldExtX=function(n){this.lworldExtX=n},l.prototype.getWorldExtY=function(){return this.lworldExtY},l.prototype.setWorldExtY=function(n){this.lworldExtY=n},l.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},l.prototype.setDeviceOrgX=function(n){this.ldeviceOrgX=n},l.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},l.prototype.setDeviceOrgY=function(n){this.ldeviceOrgY=n},l.prototype.getDeviceExtX=function(){return this.ldeviceExtX},l.prototype.setDeviceExtX=function(n){this.ldeviceExtX=n},l.prototype.getDeviceExtY=function(){return this.ldeviceExtY},l.prototype.setDeviceExtY=function(n){this.ldeviceExtY=n},l.prototype.transformX=function(n){var r=0,i=this.lworldExtX;return i!=0&&(r=this.ldeviceOrgX+(n-this.lworldOrgX)*this.ldeviceExtX/i),r},l.prototype.transformY=function(n){var r=0,i=this.lworldExtY;return i!=0&&(r=this.ldeviceOrgY+(n-this.lworldOrgY)*this.ldeviceExtY/i),r},l.prototype.inverseTransformX=function(n){var r=0,i=this.ldeviceExtX;return i!=0&&(r=this.lworldOrgX+(n-this.ldeviceOrgX)*this.lworldExtX/i),r},l.prototype.inverseTransformY=function(n){var r=0,i=this.ldeviceExtY;return i!=0&&(r=this.lworldOrgY+(n-this.ldeviceOrgY)*this.lworldExtY/i),r},l.prototype.inverseTransformPoint=function(n){var r=new v(this.inverseTransformX(n.x),this.inverseTransformY(n.y));return r},C.exports=l},function(C,x,N){function v(t){if(Array.isArray(t)){for(var s=0,o=Array(t.length);sn.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*n.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-n.ADAPTATION_LOWER_NODE_LIMIT)/(n.ADAPTATION_UPPER_NODE_LIMIT-n.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-n.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=n.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>n.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(n.COOLING_ADAPTATION_FACTOR,1-(t-n.ADAPTATION_LOWER_NODE_LIMIT)/(n.ADAPTATION_UPPER_NODE_LIMIT-n.ADAPTATION_LOWER_NODE_LIMIT)*(1-n.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=n.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*n.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},e.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),s,o=0;o0&&arguments[0]!==void 0?arguments[0]:!0,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o,c,h,T,u=this.getAllNodes(),d;if(this.useFRGridVariant)for(this.totalIterations%n.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),d=new Set,o=0;oL||d>L)&&(t.gravitationForceX=-this.gravityConstant*h,t.gravitationForceY=-this.gravityConstant*T)):(L=s.getEstimatedSize()*this.compoundGravityRangeFactor,(u>L||d>L)&&(t.gravitationForceX=-this.gravityConstant*h*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},e.prototype.isConverged=function(){var t,s=!1;return this.totalIterations>this.maxIterations/3&&(s=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement=u.length||L>=u[0].length)){for(var b=0;be}}]),i}();C.exports=r},function(C,x,N){function v(){}v.svd=function(l){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=l.length,this.n=l[0].length;var n=Math.min(this.m,this.n);this.s=function(Tt){for(var wt=[];Tt-- >0;)wt.push(0);return wt}(Math.min(this.m+1,this.n)),this.U=function(Tt){var wt=function $t(bt){if(bt.length==0)return 0;for(var zt=[],St=0;St0;)wt.push(0);return wt}(this.n),i=function(Tt){for(var wt=[];Tt-- >0;)wt.push(0);return wt}(this.m),f=!0,e=Math.min(this.m-1,this.n),g=Math.max(0,Math.min(this.n-2,this.m)),t=0;t=0;m--)if(this.s[m]!==0){for(var y=m+1;y=0;z--){if(function(Tt,wt){return Tt&&wt}(z0;){var J=void 0,It=void 0;for(J=a-2;J>=-1&&J!==-1;J--)if(Math.abs(r[J])<=ht+tt*(Math.abs(this.s[J])+Math.abs(this.s[J+1]))){r[J]=0;break}if(J===a-2)It=4;else{var Nt=void 0;for(Nt=a-1;Nt>=J&&Nt!==J;Nt--){var vt=(Nt!==a?Math.abs(r[Nt]):0)+(Nt!==J+1?Math.abs(r[Nt-1]):0);if(Math.abs(this.s[Nt])<=ht+tt*vt){this.s[Nt]=0;break}}Nt===J?It=3:Nt===a-1?It=1:(It=2,J=Nt)}switch(J++,It){case 1:{var it=r[a-2];r[a-2]=0;for(var ut=a-2;ut>=J;ut--){var Et=v.hypot(this.s[ut],it),Ct=this.s[ut]/Et,Dt=it/Et;this.s[ut]=Et,ut!==J&&(it=-Dt*r[ut-1],r[ut-1]=Ct*r[ut-1]);for(var mt=0;mt=this.s[J+1]);){var Lt=this.s[J];if(this.s[J]=this.s[J+1],this.s[J+1]=Lt,JMath.abs(n)?(r=n/l,r=Math.abs(l)*Math.sqrt(1+r*r)):n!=0?(r=l/n,r=Math.abs(n)*Math.sqrt(1+r*r)):r=0,r},C.exports=v},function(C,x,N){var v=function(){function r(i,f){for(var e=0;e2&&arguments[2]!==void 0?arguments[2]:1,g=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;l(this,r),this.sequence1=i,this.sequence2=f,this.match_score=e,this.mismatch_penalty=g,this.gap_penalty=t,this.iMax=i.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var s=0;s=0;i--){var f=this.listeners[i];f.event===n&&f.callback===r&&this.listeners.splice(i,1)}},l.emit=function(n,r){for(var i=0;i{var x={45:(n,r,i)=>{var f={};f.layoutBase=i(551),f.CoSEConstants=i(806),f.CoSEEdge=i(767),f.CoSEGraph=i(880),f.CoSEGraphManager=i(578),f.CoSELayout=i(765),f.CoSENode=i(991),f.ConstraintHandler=i(902),n.exports=f},806:(n,r,i)=>{var f=i(551).FDLayoutConstants;function e(){}for(var g in f)e[g]=f[g];e.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,e.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH,e.DEFAULT_COMPONENT_SEPERATION=60,e.TILE=!0,e.TILING_PADDING_VERTICAL=10,e.TILING_PADDING_HORIZONTAL=10,e.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,e.ENFORCE_CONSTRAINTS=!0,e.APPLY_LAYOUT=!0,e.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,e.TREE_REDUCTION_ON_INCREMENTAL=!0,e.PURE_INCREMENTAL=e.DEFAULT_INCREMENTAL,n.exports=e},767:(n,r,i)=>{var f=i(551).FDLayoutEdge;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var g in f)e[g]=f[g];n.exports=e},880:(n,r,i)=>{var f=i(551).LGraph;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var g in f)e[g]=f[g];n.exports=e},578:(n,r,i)=>{var f=i(551).LGraphManager;function e(t){f.call(this,t)}e.prototype=Object.create(f.prototype);for(var g in f)e[g]=f[g];n.exports=e},765:(n,r,i)=>{var f=i(551).FDLayout,e=i(578),g=i(880),t=i(991),s=i(767),o=i(806),c=i(902),h=i(551).FDLayoutConstants,T=i(551).LayoutConstants,u=i(551).Point,d=i(551).PointD,L=i(551).DimensionD,b=i(551).Layout,w=i(551).Integer,P=i(551).IGeometry,V=i(551).LGraph,Y=i(551).Transform,B=i(551).LinkedList;function A(){f.call(this),this.toBeTiled={},this.constraints={}}A.prototype=Object.create(f.prototype);for(var j in f)A[j]=f[j];A.prototype.newGraphManager=function(){var a=new e(this);return this.graphManager=a,a},A.prototype.newGraph=function(a){return new g(null,this.graphManager,a)},A.prototype.newNode=function(a){return new t(this.graphManager,a)},A.prototype.newEdge=function(a){return new s(null,null,a)},A.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.isSubLayout||(o.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=h.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=h.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=h.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},A.prototype.initSpringEmbedder=function(){f.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/h.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},A.prototype.layout=function(){var a=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return a&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},A.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(S){return E.has(S)});this.graphManager.setAllNodesToApplyGravitation(p)}}else{var a=this.getFlatForest();if(a.length>0)this.positionNodesRadially(a);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(m){return E.has(m)});this.graphManager.setAllNodesToApplyGravitation(p),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),o.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},A.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%h.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var a=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(y){return a.has(y)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),o.PURE_INCREMENTAL?this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),o.PURE_INCREMENTAL?this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var p=!this.isTreeGrowing&&!this.isGrowthFinished,m=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(p,m),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},A.prototype.getPositionsData=function(){for(var a=this.graphManager.getAllNodes(),E={},p=0;p0&&this.updateDisplacements();for(var p=0;p0&&(m.fixedNodeWeight=S)}}if(this.constraints.relativePlacementConstraint){var D=new Map,F=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(O){a.fixedNodesOnHorizontal.add(O),a.fixedNodesOnVertical.add(O)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var W=this.constraints.alignmentConstraint.vertical,p=0;p=2*O.length/3;tt--)H=Math.floor(Math.random()*(tt+1)),Z=O[tt],O[tt]=O[H],O[H]=Z;return O},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var H=D.has(O.left)?D.get(O.left):O.left,Z=D.has(O.right)?D.get(O.right):O.right;a.nodesInRelativeHorizontal.includes(H)||(a.nodesInRelativeHorizontal.push(H),a.nodeToRelativeConstraintMapHorizontal.set(H,[]),a.dummyToNodeForVerticalAlignment.has(H)?a.nodeToTempPositionMapHorizontal.set(H,a.idToNodeMap.get(a.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):a.nodeToTempPositionMapHorizontal.set(H,a.idToNodeMap.get(H).getCenterX())),a.nodesInRelativeHorizontal.includes(Z)||(a.nodesInRelativeHorizontal.push(Z),a.nodeToRelativeConstraintMapHorizontal.set(Z,[]),a.dummyToNodeForVerticalAlignment.has(Z)?a.nodeToTempPositionMapHorizontal.set(Z,a.idToNodeMap.get(a.dummyToNodeForVerticalAlignment.get(Z)[0]).getCenterX()):a.nodeToTempPositionMapHorizontal.set(Z,a.idToNodeMap.get(Z).getCenterX())),a.nodeToRelativeConstraintMapHorizontal.get(H).push({right:Z,gap:O.gap}),a.nodeToRelativeConstraintMapHorizontal.get(Z).push({left:H,gap:O.gap})}else{var tt=F.has(O.top)?F.get(O.top):O.top,ht=F.has(O.bottom)?F.get(O.bottom):O.bottom;a.nodesInRelativeVertical.includes(tt)||(a.nodesInRelativeVertical.push(tt),a.nodeToRelativeConstraintMapVertical.set(tt,[]),a.dummyToNodeForHorizontalAlignment.has(tt)?a.nodeToTempPositionMapVertical.set(tt,a.idToNodeMap.get(a.dummyToNodeForHorizontalAlignment.get(tt)[0]).getCenterY()):a.nodeToTempPositionMapVertical.set(tt,a.idToNodeMap.get(tt).getCenterY())),a.nodesInRelativeVertical.includes(ht)||(a.nodesInRelativeVertical.push(ht),a.nodeToRelativeConstraintMapVertical.set(ht,[]),a.dummyToNodeForHorizontalAlignment.has(ht)?a.nodeToTempPositionMapVertical.set(ht,a.idToNodeMap.get(a.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()):a.nodeToTempPositionMapVertical.set(ht,a.idToNodeMap.get(ht).getCenterY())),a.nodeToRelativeConstraintMapVertical.get(tt).push({bottom:ht,gap:O.gap}),a.nodeToRelativeConstraintMapVertical.get(ht).push({top:tt,gap:O.gap})}});else{var Q=new Map,z=new Map;this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var H=D.has(O.left)?D.get(O.left):O.left,Z=D.has(O.right)?D.get(O.right):O.right;Q.has(H)?Q.get(H).push(Z):Q.set(H,[Z]),Q.has(Z)?Q.get(Z).push(H):Q.set(Z,[H])}else{var tt=F.has(O.top)?F.get(O.top):O.top,ht=F.has(O.bottom)?F.get(O.bottom):O.bottom;z.has(tt)?z.get(tt).push(ht):z.set(tt,[ht]),z.has(ht)?z.get(ht).push(tt):z.set(ht,[tt])}});var X=function(H,Z){var tt=[],ht=[],J=new B,It=new Set,Nt=0;return H.forEach(function(vt,it){if(!It.has(it)){tt[Nt]=[],ht[Nt]=!1;var ut=it;for(J.push(ut),It.add(ut),tt[Nt].push(ut);J.length!=0;){ut=J.shift(),Z.has(ut)&&(ht[Nt]=!0);var Et=H.get(ut);Et.forEach(function(Ct){It.has(Ct)||(J.push(Ct),It.add(Ct),tt[Nt].push(Ct))})}Nt++}}),{components:tt,isFixed:ht}},rt=X(Q,a.fixedNodesOnHorizontal);this.componentsOnHorizontal=rt.components,this.fixedComponentsOnHorizontal=rt.isFixed;var $=X(z,a.fixedNodesOnVertical);this.componentsOnVertical=$.components,this.fixedComponentsOnVertical=$.isFixed}}},A.prototype.updateDisplacements=function(){var a=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function($){var O=a.idToNodeMap.get($.nodeId);O.displacementX=0,O.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var E=this.constraints.alignmentConstraint.vertical,p=0;p1){var F;for(F=0;Fm&&(m=Math.floor(D.y)),S=Math.floor(D.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new d(T.WORLD_CENTER_X-D.x/2,T.WORLD_CENTER_Y-D.y/2))},A.radialLayout=function(a,E,p){var m=Math.max(this.maxDiagonalInTree(a),o.DEFAULT_RADIAL_SEPARATION);A.branchRadialLayout(E,null,0,359,0,m);var y=V.calculateBounds(a),S=new Y;S.setDeviceOrgX(y.getMinX()),S.setDeviceOrgY(y.getMinY()),S.setWorldOrgX(p.x),S.setWorldOrgY(p.y);for(var D=0;D1;){var Z=H[0];H.splice(0,1);var tt=z.indexOf(Z);tt>=0&&z.splice(tt,1),$--,X--}E!=null?O=(z.indexOf(H[0])+1)%$:O=0;for(var ht=Math.abs(m-p)/X,J=O;rt!=X;J=++J%$){var It=z[J].getOtherEnd(a);if(It!=E){var Nt=(p+rt*ht)%360,vt=(Nt+ht)%360;A.branchRadialLayout(It,a,Nt,vt,y+S,S),rt++}}},A.maxDiagonalInTree=function(a){for(var E=w.MIN_VALUE,p=0;pE&&(E=y)}return E},A.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},A.prototype.groupZeroDegreeMembers=function(){var a=this,E={};this.memberGroups={},this.idToDummyNode={};for(var p=[],m=this.graphManager.getAllNodes(),y=0;y"u"&&(E[F]=[]),E[F]=E[F].concat(S)}Object.keys(E).forEach(function(W){if(E[W].length>1){var R="DummyCompound_"+W;a.memberGroups[R]=E[W];var Q=E[W][0].getParent(),z=new t(a.graphManager);z.id=R,z.paddingLeft=Q.paddingLeft||0,z.paddingRight=Q.paddingRight||0,z.paddingBottom=Q.paddingBottom||0,z.paddingTop=Q.paddingTop||0,a.idToDummyNode[R]=z;var X=a.getGraphManager().add(a.newGraph(),z),rt=Q.getChild();rt.add(z);for(var $=0;$y?(m.rect.x-=(m.labelWidth-y)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-y)/2):m.labelPosHorizontal=="right"&&m.setWidth(y+m.labelWidth)),m.labelHeight&&(m.labelPosVertical=="top"?(m.rect.y-=m.labelHeight,m.setHeight(S+m.labelHeight),m.labelMarginTop=m.labelHeight):m.labelPosVertical=="center"&&m.labelHeight>S?(m.rect.y-=(m.labelHeight-S)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-S)/2):m.labelPosVertical=="bottom"&&m.setHeight(S+m.labelHeight))}})},A.prototype.repopulateCompounds=function(){for(var a=this.compoundOrder.length-1;a>=0;a--){var E=this.compoundOrder[a],p=E.id,m=E.paddingLeft,y=E.paddingTop,S=E.labelMarginLeft,D=E.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],E.rect.x,E.rect.y,m,y,S,D)}},A.prototype.repopulateZeroDegreeMembers=function(){var a=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(p){var m=a.idToDummyNode[p],y=m.paddingLeft,S=m.paddingTop,D=m.labelMarginLeft,F=m.labelMarginTop;a.adjustLocations(E[p],m.rect.x,m.rect.y,y,S,D,F)})},A.prototype.getToBeTiled=function(a){var E=a.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var p=a.getChild();if(p==null)return this.toBeTiled[E]=!1,!1;for(var m=p.getNodes(),y=0;y0)return this.toBeTiled[E]=!1,!1;if(S.getChild()==null){this.toBeTiled[S.id]=!1;continue}if(!this.getToBeTiled(S))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},A.prototype.getNodeDegree=function(a){a.id;for(var E=a.getEdges(),p=0,m=0;mQ&&(Q=X.rect.height)}p+=Q+a.verticalPadding}},A.prototype.tileCompoundMembers=function(a,E){var p=this;this.tiledMemberPack=[],Object.keys(a).forEach(function(m){var y=E[m];if(p.tiledMemberPack[m]=p.tileNodes(a[m],y.paddingLeft+y.paddingRight),y.rect.width=p.tiledMemberPack[m].width,y.rect.height=p.tiledMemberPack[m].height,y.setCenter(p.tiledMemberPack[m].centerX,p.tiledMemberPack[m].centerY),y.labelMarginLeft=0,y.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var S=y.rect.width,D=y.rect.height;y.labelWidth&&(y.labelPosHorizontal=="left"?(y.rect.x-=y.labelWidth,y.setWidth(S+y.labelWidth),y.labelMarginLeft=y.labelWidth):y.labelPosHorizontal=="center"&&y.labelWidth>S?(y.rect.x-=(y.labelWidth-S)/2,y.setWidth(y.labelWidth),y.labelMarginLeft=(y.labelWidth-S)/2):y.labelPosHorizontal=="right"&&y.setWidth(S+y.labelWidth)),y.labelHeight&&(y.labelPosVertical=="top"?(y.rect.y-=y.labelHeight,y.setHeight(D+y.labelHeight),y.labelMarginTop=y.labelHeight):y.labelPosVertical=="center"&&y.labelHeight>D?(y.rect.y-=(y.labelHeight-D)/2,y.setHeight(y.labelHeight),y.labelMarginTop=(y.labelHeight-D)/2):y.labelPosVertical=="bottom"&&y.setHeight(D+y.labelHeight))}})},A.prototype.tileNodes=function(a,E){var p=this.tileNodesByFavoringDim(a,E,!0),m=this.tileNodesByFavoringDim(a,E,!1),y=this.getOrgRatio(p),S=this.getOrgRatio(m),D;return SF&&(F=$.getWidth())});var W=S/y,R=D/y,Q=Math.pow(p-m,2)+4*(W+m)*(R+p)*y,z=(m-p+Math.sqrt(Q))/(2*(W+m)),X;E?(X=Math.ceil(z),X==z&&X++):X=Math.floor(z);var rt=X*(W+m)-m;return F>rt&&(rt=F),rt+=m*2,rt},A.prototype.tileNodesByFavoringDim=function(a,E,p){var m=o.TILING_PADDING_VERTICAL,y=o.TILING_PADDING_HORIZONTAL,S=o.TILING_COMPARE_BY,D={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:m,horizontalPadding:y,centerX:0,centerY:0};S&&(D.idealRowWidth=this.calcIdealRowWidth(a,p));var F=function(O){return O.rect.width*O.rect.height},W=function(O,H){return F(H)-F(O)};a.sort(function($,O){var H=W;return D.idealRowWidth?(H=S,H($.id,O.id)):H($,O)});for(var R=0,Q=0,z=0;z0&&(D+=a.horizontalPadding),a.rowWidth[p]=D,a.width0&&(F+=a.verticalPadding);var W=0;F>a.rowHeight[p]&&(W=a.rowHeight[p],a.rowHeight[p]=F,W=a.rowHeight[p]-W),a.height+=W,a.rows[p].push(E)},A.prototype.getShortestRowIndex=function(a){for(var E=-1,p=Number.MAX_VALUE,m=0;mp&&(E=m,p=a.rowWidth[m]);return E},A.prototype.canAddHorizontal=function(a,E,p){if(a.idealRowWidth){var m=a.rows.length-1,y=a.rowWidth[m];return y+E+a.horizontalPadding<=a.idealRowWidth}var S=this.getShortestRowIndex(a);if(S<0)return!0;var D=a.rowWidth[S];if(D+a.horizontalPadding+E<=a.width)return!0;var F=0;a.rowHeight[S]0&&(F=p+a.verticalPadding-a.rowHeight[S]);var W;a.width-D>=E+a.horizontalPadding?W=(a.height+F)/(D+E+a.horizontalPadding):W=(a.height+F)/a.width,F=p+a.verticalPadding;var R;return a.widthS&&E!=p){m.splice(-1,1),a.rows[p].push(y),a.rowWidth[E]=a.rowWidth[E]-S,a.rowWidth[p]=a.rowWidth[p]+S,a.width=a.rowWidth[instance.getLongestRowIndex(a)];for(var D=Number.MIN_VALUE,F=0;FD&&(D=m[F].height);E>0&&(D+=a.verticalPadding);var W=a.rowHeight[E]+a.rowHeight[p];a.rowHeight[E]=D,a.rowHeight[p]0)for(var rt=y;rt<=S;rt++)X[0]+=this.grid[rt][D-1].length+this.grid[rt][D].length-1;if(S0)for(var rt=D;rt<=F;rt++)X[3]+=this.grid[y-1][rt].length+this.grid[y][rt].length-1;for(var $=w.MAX_VALUE,O,H,Z=0;Z{var f=i(551).FDLayoutNode,e=i(551).IMath;function g(s,o,c,h){f.call(this,s,o,c,h)}g.prototype=Object.create(f.prototype);for(var t in f)g[t]=f[t];g.prototype.calculateDisplacement=function(){var s=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementX=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementX)),Math.abs(this.displacementY)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementY=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},g.prototype.propogateDisplacementToChildren=function(s,o){for(var c=this.getChild().getNodes(),h,T=0;T{function f(c){if(Array.isArray(c)){for(var h=0,T=Array(c.length);h0){var Lt=0;ot.forEach(function(st){k=="horizontal"?(et.set(st,u.has(st)?d[u.get(st)]:q.get(st)),Lt+=et.get(st)):(et.set(st,u.has(st)?L[u.get(st)]:q.get(st)),Lt+=et.get(st))}),Lt=Lt/ot.length,lt.forEach(function(st){K.has(st)||et.set(st,Lt)})}else{var ft=0;lt.forEach(function(st){k=="horizontal"?ft+=u.has(st)?d[u.get(st)]:q.get(st):ft+=u.has(st)?L[u.get(st)]:q.get(st)}),ft=ft/lt.length,lt.forEach(function(st){et.set(st,ft)})}});for(var Mt=function(){var ot=dt.shift(),Lt=U.get(ot);Lt.forEach(function(ft){if(et.get(ft.id)st&&(st=Zt),KtXt&&(Xt=Kt)}}catch(ee){wt=!0,$t=ee}finally{try{!Tt&&bt.return&&bt.return()}finally{if(wt)throw $t}}var he=(Lt+st)/2-(ft+Xt)/2,Qt=!0,jt=!1,_t=void 0;try{for(var Jt=lt[Symbol.iterator](),oe;!(Qt=(oe=Jt.next()).done);Qt=!0){var te=oe.value;et.set(te,et.get(te)+he)}}catch(ee){jt=!0,_t=ee}finally{try{!Qt&&Jt.return&&Jt.return()}finally{if(jt)throw _t}}})}return et},j=function(U){var k=0,K=0,q=0,at=0;if(U.forEach(function(_){_.left?d[u.get(_.left)]-d[u.get(_.right)]>=0?k++:K++:L[u.get(_.top)]-L[u.get(_.bottom)]>=0?q++:at++}),k>K&&q>at)for(var gt=0;gtK)for(var nt=0;ntat)for(var et=0;et1)h.fixedNodeConstraint.forEach(function(G,U){m[U]=[G.position.x,G.position.y],y[U]=[d[u.get(G.nodeId)],L[u.get(G.nodeId)]]}),S=!0;else if(h.alignmentConstraint)(function(){var G=0;if(h.alignmentConstraint.vertical){for(var U=h.alignmentConstraint.vertical,k=function(et){var _=new Set;U[et].forEach(function(pt){_.add(pt)});var dt=new Set([].concat(f(_)).filter(function(pt){return F.has(pt)})),Mt=void 0;dt.size>0?Mt=d[u.get(dt.values().next().value)]:Mt=B(_).x,U[et].forEach(function(pt){m[G]=[Mt,L[u.get(pt)]],y[G]=[d[u.get(pt)],L[u.get(pt)]],G++})},K=0;K0?Mt=d[u.get(dt.values().next().value)]:Mt=B(_).y,q[et].forEach(function(pt){m[G]=[d[u.get(pt)],Mt],y[G]=[d[u.get(pt)],L[u.get(pt)]],G++})},gt=0;gtz&&(z=Q[rt].length,X=rt);if(z0){var mt={x:0,y:0};h.fixedNodeConstraint.forEach(function(G,U){var k={x:d[u.get(G.nodeId)],y:L[u.get(G.nodeId)]},K=G.position,q=Y(K,k);mt.x+=q.x,mt.y+=q.y}),mt.x/=h.fixedNodeConstraint.length,mt.y/=h.fixedNodeConstraint.length,d.forEach(function(G,U){d[U]+=mt.x}),L.forEach(function(G,U){L[U]+=mt.y}),h.fixedNodeConstraint.forEach(function(G){d[u.get(G.nodeId)]=G.position.x,L[u.get(G.nodeId)]=G.position.y})}if(h.alignmentConstraint){if(h.alignmentConstraint.vertical)for(var Ot=h.alignmentConstraint.vertical,Rt=function(U){var k=new Set;Ot[U].forEach(function(at){k.add(at)});var K=new Set([].concat(f(k)).filter(function(at){return F.has(at)})),q=void 0;K.size>0?q=d[u.get(K.values().next().value)]:q=B(k).x,k.forEach(function(at){F.has(at)||(d[u.get(at)]=q)})},Ht=0;Ht0?q=L[u.get(K.values().next().value)]:q=B(k).y,k.forEach(function(at){F.has(at)||(L[u.get(at)]=q)})},Ft=0;Ft{n.exports=C}},N={};function v(n){var r=N[n];if(r!==void 0)return r.exports;var i=N[n]={exports:{}};return x[n](i,i.exports,v),i.exports}var l=v(45);return l})()})}(ue)),ue.exports}(function(I,M){(function(x,N){I.exports=N(vr())})(Te,function(C){return(()=>{var x={658:n=>{n.exports=Object.assign!=null?Object.assign.bind(Object):function(r){for(var i=arguments.length,f=Array(i>1?i-1:0),e=1;e{var f=function(){function t(s,o){var c=[],h=!0,T=!1,u=void 0;try{for(var d=s[Symbol.iterator](),L;!(h=(L=d.next()).done)&&(c.push(L.value),!(o&&c.length===o));h=!0);}catch(b){T=!0,u=b}finally{try{!h&&d.return&&d.return()}finally{if(T)throw u}}return c}return function(s,o){if(Array.isArray(s))return s;if(Symbol.iterator in Object(s))return t(s,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),e=i(140).layoutBase.LinkedList,g={};g.getTopMostNodes=function(t){for(var s={},o=0;o0&&S.merge(R)});for(var D=0;D1){L=u[0],b=L.connectedEdges().length,u.forEach(function(y){y.connectedEdges().length0&&c.set("dummy"+(c.size+1),V),Y},g.relocateComponent=function(t,s,o){if(!o.fixedNodeConstraint){var c=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY;if(o.quality=="draft"){var d=!0,L=!1,b=void 0;try{for(var w=s.nodeIndexes[Symbol.iterator](),P;!(d=(P=w.next()).done);d=!0){var V=P.value,Y=f(V,2),B=Y[0],A=Y[1],j=o.cy.getElementById(B);if(j){var a=j.boundingBox(),E=s.xCoords[A]-a.w/2,p=s.xCoords[A]+a.w/2,m=s.yCoords[A]-a.h/2,y=s.yCoords[A]+a.h/2;Eh&&(h=p),mu&&(u=y)}}}catch(R){L=!0,b=R}finally{try{!d&&w.return&&w.return()}finally{if(L)throw b}}var S=t.x-(h+c)/2,D=t.y-(u+T)/2;s.xCoords=s.xCoords.map(function(R){return R+S}),s.yCoords=s.yCoords.map(function(R){return R+D})}else{Object.keys(s).forEach(function(R){var Q=s[R],z=Q.getRect().x,X=Q.getRect().x+Q.getRect().width,rt=Q.getRect().y,$=Q.getRect().y+Q.getRect().height;zh&&(h=X),rtu&&(u=$)});var F=t.x-(h+c)/2,W=t.y-(u+T)/2;Object.keys(s).forEach(function(R){var Q=s[R];Q.setCenter(Q.getCenterX()+F,Q.getCenterY()+W)})}}},g.calcBoundingBox=function(t,s,o,c){for(var h=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,u=Number.MAX_SAFE_INTEGER,d=Number.MIN_SAFE_INTEGER,L=void 0,b=void 0,w=void 0,P=void 0,V=t.descendants().not(":parent"),Y=V.length,B=0;BL&&(h=L),Tw&&(u=w),d{var f=i(548),e=i(140).CoSELayout,g=i(140).CoSENode,t=i(140).layoutBase.PointD,s=i(140).layoutBase.DimensionD,o=i(140).layoutBase.LayoutConstants,c=i(140).layoutBase.FDLayoutConstants,h=i(140).CoSEConstants,T=function(d,L){var b=d.cy,w=d.eles,P=w.nodes(),V=w.edges(),Y=void 0,B=void 0,A=void 0,j={};d.randomize&&(Y=L.nodeIndexes,B=L.xCoords,A=L.yCoords);var a=function(R){return typeof R=="function"},E=function(R,Q){return a(R)?R(Q):R},p=f.calcParentsWithoutChildren(b,w),m=function W(R,Q,z,X){for(var rt=Q.length,$=0;$0){var J=void 0;J=z.getGraphManager().add(z.newGraph(),Z),W(J,H,z,X)}}},y=function(R,Q,z){for(var X=0,rt=0,$=0;$0?h.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=X/rt:a(d.idealEdgeLength)?h.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=50:h.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=d.idealEdgeLength,h.MIN_REPULSION_DIST=c.MIN_REPULSION_DIST=c.DEFAULT_EDGE_LENGTH/10,h.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH)},S=function(R,Q){Q.fixedNodeConstraint&&(R.constraints.fixedNodeConstraint=Q.fixedNodeConstraint),Q.alignmentConstraint&&(R.constraints.alignmentConstraint=Q.alignmentConstraint),Q.relativePlacementConstraint&&(R.constraints.relativePlacementConstraint=Q.relativePlacementConstraint)};d.nestingFactor!=null&&(h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.nestingFactor),d.gravity!=null&&(h.DEFAULT_GRAVITY_STRENGTH=c.DEFAULT_GRAVITY_STRENGTH=d.gravity),d.numIter!=null&&(h.MAX_ITERATIONS=c.MAX_ITERATIONS=d.numIter),d.gravityRange!=null&&(h.DEFAULT_GRAVITY_RANGE_FACTOR=c.DEFAULT_GRAVITY_RANGE_FACTOR=d.gravityRange),d.gravityCompound!=null&&(h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.gravityCompound),d.gravityRangeCompound!=null&&(h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.gravityRangeCompound),d.initialEnergyOnIncremental!=null&&(h.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.initialEnergyOnIncremental),d.tilingCompareBy!=null&&(h.TILING_COMPARE_BY=d.tilingCompareBy),d.quality=="proof"?o.QUALITY=2:o.QUALITY=0,h.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=d.nodeDimensionsIncludeLabels,h.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!d.randomize,h.ANIMATE=c.ANIMATE=o.ANIMATE=d.animate,h.TILE=d.tile,h.TILING_PADDING_VERTICAL=typeof d.tilingPaddingVertical=="function"?d.tilingPaddingVertical.call():d.tilingPaddingVertical,h.TILING_PADDING_HORIZONTAL=typeof d.tilingPaddingHorizontal=="function"?d.tilingPaddingHorizontal.call():d.tilingPaddingHorizontal,h.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!0,h.PURE_INCREMENTAL=!d.randomize,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=d.uniformNodeDimensions,d.step=="transformed"&&(h.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,h.ENFORCE_CONSTRAINTS=!1,h.APPLY_LAYOUT=!1),d.step=="enforced"&&(h.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,h.ENFORCE_CONSTRAINTS=!0,h.APPLY_LAYOUT=!1),d.step=="cose"&&(h.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,h.ENFORCE_CONSTRAINTS=!1,h.APPLY_LAYOUT=!0),d.step=="all"&&(d.randomize?h.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:h.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,h.ENFORCE_CONSTRAINTS=!0,h.APPLY_LAYOUT=!0),d.fixedNodeConstraint||d.alignmentConstraint||d.relativePlacementConstraint?h.TREE_REDUCTION_ON_INCREMENTAL=!1:h.TREE_REDUCTION_ON_INCREMENTAL=!0;var D=new e,F=D.newGraphManager();return m(F.addRoot(),f.getTopMostNodes(P),D,d),y(D,F,V),S(D,d),D.runLayout(),j};n.exports={coseLayout:T}},212:(n,r,i)=>{var f=function(){function d(L,b){for(var w=0;w0)if(p){var S=t.getTopMostNodes(w.eles.nodes());if(A=t.connectComponents(P,w.eles,S),A.forEach(function(vt){var it=vt.boundingBox();j.push({x:it.x1+it.w/2,y:it.y1+it.h/2})}),w.randomize&&A.forEach(function(vt){w.eles=vt,Y.push(o(w))}),w.quality=="default"||w.quality=="proof"){var D=P.collection();if(w.tile){var F=new Map,W=[],R=[],Q=0,z={nodeIndexes:F,xCoords:W,yCoords:R},X=[];if(A.forEach(function(vt,it){vt.edges().length==0&&(vt.nodes().forEach(function(ut,Et){D.merge(vt.nodes()[Et]),ut.isParent()||(z.nodeIndexes.set(vt.nodes()[Et].id(),Q++),z.xCoords.push(vt.nodes()[0].position().x),z.yCoords.push(vt.nodes()[0].position().y))}),X.push(it))}),D.length>1){var rt=D.boundingBox();j.push({x:rt.x1+rt.w/2,y:rt.y1+rt.h/2}),A.push(D),Y.push(z);for(var $=X.length-1;$>=0;$--)A.splice(X[$],1),Y.splice(X[$],1),j.splice(X[$],1)}}A.forEach(function(vt,it){w.eles=vt,B.push(h(w,Y[it])),t.relocateComponent(j[it],B[it],w)})}else A.forEach(function(vt,it){t.relocateComponent(j[it],Y[it],w)});var O=new Set;if(A.length>1){var H=[],Z=V.filter(function(vt){return vt.css("display")=="none"});A.forEach(function(vt,it){var ut=void 0;if(w.quality=="draft"&&(ut=Y[it].nodeIndexes),vt.nodes().not(Z).length>0){var Et={};Et.edges=[],Et.nodes=[];var Ct=void 0;vt.nodes().not(Z).forEach(function(Dt){if(w.quality=="draft")if(!Dt.isParent())Ct=ut.get(Dt.id()),Et.nodes.push({x:Y[it].xCoords[Ct]-Dt.boundingbox().w/2,y:Y[it].yCoords[Ct]-Dt.boundingbox().h/2,width:Dt.boundingbox().w,height:Dt.boundingbox().h});else{var mt=t.calcBoundingBox(Dt,Y[it].xCoords,Y[it].yCoords,ut);Et.nodes.push({x:mt.topLeftX,y:mt.topLeftY,width:mt.width,height:mt.height})}else B[it][Dt.id()]&&Et.nodes.push({x:B[it][Dt.id()].getLeft(),y:B[it][Dt.id()].getTop(),width:B[it][Dt.id()].getWidth(),height:B[it][Dt.id()].getHeight()})}),vt.edges().forEach(function(Dt){var mt=Dt.source(),Ot=Dt.target();if(mt.css("display")!="none"&&Ot.css("display")!="none")if(w.quality=="draft"){var Rt=ut.get(mt.id()),Ht=ut.get(Ot.id()),Ut=[],Gt=[];if(mt.isParent()){var Ft=t.calcBoundingBox(mt,Y[it].xCoords,Y[it].yCoords,ut);Ut.push(Ft.topLeftX+Ft.width/2),Ut.push(Ft.topLeftY+Ft.height/2)}else Ut.push(Y[it].xCoords[Rt]),Ut.push(Y[it].yCoords[Rt]);if(Ot.isParent()){var Yt=t.calcBoundingBox(Ot,Y[it].xCoords,Y[it].yCoords,ut);Gt.push(Yt.topLeftX+Yt.width/2),Gt.push(Yt.topLeftY+Yt.height/2)}else Gt.push(Y[it].xCoords[Ht]),Gt.push(Y[it].yCoords[Ht]);Et.edges.push({startX:Ut[0],startY:Ut[1],endX:Gt[0],endY:Gt[1]})}else B[it][mt.id()]&&B[it][Ot.id()]&&Et.edges.push({startX:B[it][mt.id()].getCenterX(),startY:B[it][mt.id()].getCenterY(),endX:B[it][Ot.id()].getCenterX(),endY:B[it][Ot.id()].getCenterY()})}),Et.nodes.length>0&&(H.push(Et),O.add(it))}});var tt=E.packComponents(H,w.randomize).shifts;if(w.quality=="draft")Y.forEach(function(vt,it){var ut=vt.xCoords.map(function(Ct){return Ct+tt[it].dx}),Et=vt.yCoords.map(function(Ct){return Ct+tt[it].dy});vt.xCoords=ut,vt.yCoords=Et});else{var ht=0;O.forEach(function(vt){Object.keys(B[vt]).forEach(function(it){var ut=B[vt][it];ut.setCenter(ut.getCenterX()+tt[ht].dx,ut.getCenterY()+tt[ht].dy)}),ht++})}}}else{var m=w.eles.boundingBox();if(j.push({x:m.x1+m.w/2,y:m.y1+m.h/2}),w.randomize){var y=o(w);Y.push(y)}w.quality=="default"||w.quality=="proof"?(B.push(h(w,Y[0])),t.relocateComponent(j[0],B[0],w)):t.relocateComponent(j[0],Y[0],w)}var J=function(it,ut){if(w.quality=="default"||w.quality=="proof"){typeof it=="number"&&(it=ut);var Et=void 0,Ct=void 0,Dt=it.data("id");return B.forEach(function(Ot){Dt in Ot&&(Et={x:Ot[Dt].getRect().getCenterX(),y:Ot[Dt].getRect().getCenterY()},Ct=Ot[Dt])}),w.nodeDimensionsIncludeLabels&&(Ct.labelWidth&&(Ct.labelPosHorizontal=="left"?Et.x+=Ct.labelWidth/2:Ct.labelPosHorizontal=="right"&&(Et.x-=Ct.labelWidth/2)),Ct.labelHeight&&(Ct.labelPosVertical=="top"?Et.y+=Ct.labelHeight/2:Ct.labelPosVertical=="bottom"&&(Et.y-=Ct.labelHeight/2))),Et==null&&(Et={x:it.position("x"),y:it.position("y")}),{x:Et.x,y:Et.y}}else{var mt=void 0;return Y.forEach(function(Ot){var Rt=Ot.nodeIndexes.get(it.id());Rt!=null&&(mt={x:Ot.xCoords[Rt],y:Ot.yCoords[Rt]})}),mt==null&&(mt={x:it.position("x"),y:it.position("y")}),{x:mt.x,y:mt.y}}};if(w.quality=="default"||w.quality=="proof"||w.randomize){var It=t.calcParentsWithoutChildren(P,V),Nt=V.filter(function(vt){return vt.css("display")=="none"});w.eles=V.not(Nt),V.nodes().not(":parent").not(Nt).layoutPositions(b,w,J),It.length>0&&It.forEach(function(vt){vt.position(J(vt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),d}();n.exports=u},657:(n,r,i)=>{var f=i(548),e=i(140).layoutBase.Matrix,g=i(140).layoutBase.SVD,t=function(o){var c=o.cy,h=o.eles,T=h.nodes(),u=h.nodes(":parent"),d=new Map,L=new Map,b=new Map,w=[],P=[],V=[],Y=[],B=[],A=[],j=[],a=[],E=void 0,p=1e8,m=1e-9,y=o.piTol,S=o.samplingType,D=o.nodeSeparation,F=void 0,W=function(){for(var U=0,k=0,K=!1;k=at;){nt=q[at++];for(var xt=w[nt],lt=0;ltdt&&(dt=B[Lt],Mt=Lt)}return Mt},Q=function(U){var k=void 0;if(U){k=Math.floor(Math.random()*E);for(var q=0;q=1)break;_=et}for(var pt=0;pt=1)break;_=et}for(var lt=0;lt0&&(k.isParent()?w[U].push(b.get(k.id())):w[U].push(k.id()))})});var Nt=function(U){var k=L.get(U),K=void 0;d.get(U).forEach(function(q){c.getElementById(q).isParent()?K=b.get(q):K=q,w[k].push(K),w[L.get(K)].push(U)})},vt=!0,it=!1,ut=void 0;try{for(var Et=d.keys()[Symbol.iterator](),Ct;!(vt=(Ct=Et.next()).done);vt=!0){var Dt=Ct.value;Nt(Dt)}}catch(G){it=!0,ut=G}finally{try{!vt&&Et.return&&Et.return()}finally{if(it)throw ut}}E=L.size;var mt=void 0;if(E>2){F=E{var f=i(212),e=function(t){t&&t("layout","fcose",f)};typeof cytoscape<"u"&&e(cytoscape),n.exports=e},140:n=>{n.exports=C}},N={};function v(n){var r=N[n];if(r!==void 0)return r.exports;var i=N[n]={exports:{}};return x[n](i,i.exports,v),i.exports}var l=v(579);return l})()})})(be);var pr=be.exports;const yr=gr(pr);var xe={L:"left",R:"right",T:"top",B:"bottom"},Ie={L:ct(I=>`${I},${I/2} 0,${I} 0,0`,"L"),R:ct(I=>`0,${I/2} ${I},0 ${I},${I}`,"R"),T:ct(I=>`0,0 ${I},0 ${I/2},${I}`,"T"),B:ct(I=>`${I/2},0 ${I},${I} 0,${I}`,"B")},se={L:ct((I,M)=>I-M+2,"L"),R:ct((I,M)=>I-2,"R"),T:ct((I,M)=>I-M+2,"T"),B:ct((I,M)=>I-2,"B")},mr=ct(function(I){return Wt(I)?I==="L"?"R":"L":I==="T"?"B":"T"},"getOppositeArchitectureDirection"),Re=ct(function(I){const M=I;return M==="L"||M==="R"||M==="T"||M==="B"},"isArchitectureDirection"),Wt=ct(function(I){const M=I;return M==="L"||M==="R"},"isArchitectureDirectionX"),qt=ct(function(I){const M=I;return M==="T"||M==="B"},"isArchitectureDirectionY"),Ne=ct(function(I,M){const C=Wt(I)&&qt(M),x=qt(I)&&Wt(M);return C||x},"isArchitectureDirectionXY"),Er=ct(function(I){const M=I[0],C=I[1],x=Wt(M)&&qt(C),N=qt(M)&&Wt(C);return x||N},"isArchitecturePairXY"),Tr=ct(function(I){return I!=="LL"&&I!=="RR"&&I!=="TT"&&I!=="BB"},"isValidArchitectureDirectionPair"),pe=ct(function(I,M){const C=`${I}${M}`;return Tr(C)?C:void 0},"getArchitectureDirectionPair"),Nr=ct(function([I,M],C){const x=C[0],N=C[1];return Wt(x)?qt(N)?[I+(x==="L"?-1:1),M+(N==="T"?1:-1)]:[I+(x==="L"?-1:1),M]:Wt(N)?[I+(N==="L"?1:-1),M+(x==="T"?1:-1)]:[I,M+(x==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Lr=ct(function(I){return I==="LT"||I==="TL"?[1,1]:I==="BL"||I==="LB"?[1,-1]:I==="BR"||I==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),wr=ct(function(I,M){return Ne(I,M)?"bend":Wt(I)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Cr=ct(function(I){return I.type==="service"},"isArchitectureService"),Mr=ct(function(I){return I.type==="junction"},"isArchitectureJunction"),Ge=ct((I,M)=>{const[C,x]=[I,M].sort();return`${JSON.stringify(C)}-${JSON.stringify(x)}`},"architectureGroupAlignmentKey"),Pe=ct(I=>I.data(),"edgeData"),ie=ct(I=>I.data(),"nodeData"),Ar=or.architecture,ae,Ue=(ae=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId="",this.setAccTitle=Ke,this.getAccTitle=je,this.setDiagramTitle=_e,this.getDiagramTitle=tr,this.getAccDescription=er,this.setAccDescription=rr,this.clear()}setDiagramId(M){this.diagramId=M}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId="",ir()}addService({id:M,icon:C,in:x,title:N,iconText:v}){if(this.registeredIds.has(M))throw new Error(`The service id [${M}] is already in use by another ${this.registeredIds.get(M)}`);if(x!==void 0){if(M===x)throw new Error(`The service [${M}] cannot be placed within itself`);if(!this.registeredIds.has(x))throw new Error(`The service [${M}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(x)==="node")throw new Error(`The service [${M}]'s parent is not a group`)}this.registeredIds.set(M,"node"),this.nodes.set(M,{id:M,type:"service",icon:C,iconText:v,title:N,edges:[],in:x})}getServices(){return[...this.nodes.values()].filter(Cr)}addJunction({id:M,in:C}){if(this.registeredIds.has(M))throw new Error(`The junction id [${M}] is already in use by another ${this.registeredIds.get(M)}`);if(C!==void 0){if(M===C)throw new Error(`The junction [${M}] cannot be placed within itself`);if(!this.registeredIds.has(C))throw new Error(`The junction [${M}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(C)==="node")throw new Error(`The junction [${M}]'s parent is not a group`)}this.registeredIds.set(M,"node"),this.nodes.set(M,{id:M,type:"junction",edges:[],in:C})}getJunctions(){return[...this.nodes.values()].filter(Mr)}getNodes(){return[...this.nodes.values()]}getNode(M){return this.nodes.get(M)??null}addGroup({id:M,icon:C,in:x,title:N}){if(this.registeredIds.has(M))throw new Error(`The group id [${M}] is already in use by another ${this.registeredIds.get(M)}`);if(x!==void 0){if(M===x)throw new Error(`The group [${M}] cannot be placed within itself`);if(!this.registeredIds.has(x))throw new Error(`The group [${M}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(x)==="node")throw new Error(`The group [${M}]'s parent is not a group`)}this.registeredIds.set(M,"group"),this.groups.set(M,{id:M,icon:C,title:N,in:x})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:M,rhsId:C,lhsDir:x,rhsDir:N,lhsInto:v,rhsInto:l,lhsGroup:n,rhsGroup:r,title:i}){if(!Re(x))throw new Error(`Invalid direction given for left hand side of edge ${M}--${C}. Expected (L,R,T,B) got ${String(x)}`);if(!Re(N))throw new Error(`Invalid direction given for right hand side of edge ${M}--${C}. Expected (L,R,T,B) got ${String(N)}`);if(!this.nodes.has(M)&&!this.groups.has(M))throw new Error(`The left-hand id [${M}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(C)&&!this.groups.has(C))throw new Error(`The right-hand id [${C}] does not yet exist. Please create the service/group before declaring an edge to it.`);const f=this.nodes.get(M).in,e=this.nodes.get(C).in;if(n&&f&&e&&f==e)throw new Error(`The left-hand id [${M}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(r&&f&&e&&f==e)throw new Error(`The right-hand id [${C}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const g={lhsId:M,lhsDir:x,lhsInto:v,lhsGroup:n,rhsId:C,rhsDir:N,rhsInto:l,rhsGroup:r,title:i};this.edges.push(g);const t=this.nodes.get(M),s=this.nodes.get(C);t&&s&&(t.edges.push(this.edges[this.edges.length-1]),s.edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(M){if(M.members.length<2)throw new Error(`An align directive requires at least two members; got ${M.members.length}`);const C=new Set;M.members.forEach(x=>{if(this.registeredIds.get(x)!=="node")throw new Error(`align ${M.direction} references [${x}], which is not a service or junction`);if(C.has(x))throw new Error(`align ${M.direction} lists [${x}] more than once`);C.add(x)}),this.layoutHints.push(M)}getLayoutHints(){return this.layoutHints}getDataStructures(){var M,C;if(this.dataStructures===void 0){const x=new Map,N=new Map;for(const[i,f]of this.nodes.entries()){const e=new Map;for(const g of f.edges){const t=(M=this.getNode(g.lhsId))==null?void 0:M.in,s=(C=this.getNode(g.rhsId))==null?void 0:C.in;if(t&&s&&t!==s){const o=wr(g.lhsDir,g.rhsDir);o!=="bend"&&x.set(Ge(t,s),o)}if(g.lhsId===i){const o=pe(g.lhsDir,g.rhsDir);o&&e.set(o,g.rhsId)}else{const o=pe(g.rhsDir,g.lhsDir);o&&e.set(o,g.lhsId)}}N.set(i,e)}const v=new Set,l=new Set(N.keys()),n=ct(i=>{const f=new Map([[i,[0,0]]]),e=[i];for(;e.length>0;){const g=e.shift();if(g){v.add(g),l.delete(g);const t=N.get(g);if(!t)throw new Error(`BFS error: adjacency list for id ${g} not found. Please report this as a bug.`);const s=f.get(g);if(!s)throw new Error(`BFS error: position for id ${g} not found in spatial map. Please report this as a bug.`);const[o,c]=s;t.forEach((h,T)=>{v.has(h)||(f.set(h,Nr([o,c],T)),e.push(h))})}}return f},"BFS"),r=[];for(;l.size>0;){const i=l.values().next().value;r.push(n(i))}this.dataStructures={adjList:N,spatialMaps:r,groupAlignments:x}}return this.dataStructures}setElementForId(M,C){this.elements.set(M,C)}getElementById(M){return this.elements.get(M)}getConfig(){return ar({...Ar,...nr().architecture})}getConfigField(M){return this.getConfig()[M]}},ct(ae,"ArchitectureDB"),ae),Dr=ct((I,M)=>{var C;qe(I,M),I.groups.map(x=>M.addGroup(x)),I.services.map(x=>M.addService({...x,type:"service"})),I.junctions.map(x=>M.addJunction({...x,type:"junction"})),I.edges.map(x=>M.addEdge(x)),(C=I.alignments)==null||C.map(x=>M.addLayoutHint({direction:x.direction,members:[...x.members]}))},"populateDb"),Ye={parser:{yy:void 0},parse:ct(async I=>{var x;const M=await cr("architecture",I);Se.debug(M);const C=(x=Ye.parser)==null?void 0:x.yy;if(!(C instanceof Ue))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Dr(M,C)},"parse")},Or=ct(I=>` +import{p as qe}from"./chunk-JWPE2WC7-DVlhplzu.js";import{a as ct,aP as Qe,aW as Je,at as Se,aR as Ke,W as je,aT as _e,$ as tr,V as er,aQ as rr,s as ir,r as ar,X as nr,O as or,Y as me,F as Ee,a2 as ve,aN as sr,a0 as hr,aJ as lr,b7 as fr}from"./mermaid.core-DAx4nvmm.js";import{p as cr}from"./cynefin-OW5HDTMX-BHP1Kvyc.js";import{c as Fe}from"../../chunks/cytoscape.esm-Dz9tvMTw.js";import{U as Te,ad as gr,aG as ur}from"../../app/index-8JtvDNuA.js";import"../../chunks/purify.es-BnINGy_Y.js";var be={exports:{}},ue={exports:{}},de={exports:{}},De;function dr(){return De||(De=1,function(I,M){(function(x,N){I.exports=N()})(Te,function(){return function(C){var x={};function N(v){if(x[v])return x[v].exports;var l=x[v]={i:v,l:!1,exports:{}};return C[v].call(l.exports,l,l.exports,N),l.l=!0,l.exports}return N.m=C,N.c=x,N.i=function(v){return v},N.d=function(v,l,n){N.o(v,l)||Object.defineProperty(v,l,{configurable:!1,enumerable:!0,get:n})},N.n=function(v){var l=v&&v.__esModule?function(){return v.default}:function(){return v};return N.d(l,"a",l),l},N.o=function(v,l){return Object.prototype.hasOwnProperty.call(v,l)},N.p="",N(N.s=28)}([function(C,x,N){function v(){}v.QUALITY=1,v.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,v.DEFAULT_INCREMENTAL=!1,v.DEFAULT_ANIMATION_ON_LAYOUT=!0,v.DEFAULT_ANIMATION_DURING_LAYOUT=!1,v.DEFAULT_ANIMATION_PERIOD=50,v.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,v.DEFAULT_GRAPH_MARGIN=15,v.NODE_DIMENSIONS_INCLUDE_LABELS=!1,v.SIMPLE_NODE_SIZE=40,v.SIMPLE_NODE_HALF_SIZE=v.SIMPLE_NODE_SIZE/2,v.EMPTY_COMPOUND_NODE_SIZE=40,v.MIN_EDGE_LENGTH=1,v.WORLD_BOUNDARY=1e6,v.INITIAL_WORLD_BOUNDARY=v.WORLD_BOUNDARY/1e3,v.WORLD_CENTER_X=1200,v.WORLD_CENTER_Y=900,C.exports=v},function(C,x,N){var v=N(2),l=N(8),n=N(9);function r(f,e,g){v.call(this,g),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=g,this.bendpoints=[],this.source=f,this.target=e}r.prototype=Object.create(v.prototype);for(var i in v)r[i]=v[i];r.prototype.getSource=function(){return this.source},r.prototype.getTarget=function(){return this.target},r.prototype.isInterGraph=function(){return this.isInterGraph},r.prototype.getLength=function(){return this.length},r.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},r.prototype.getBendpoints=function(){return this.bendpoints},r.prototype.getLca=function(){return this.lca},r.prototype.getSourceInLca=function(){return this.sourceInLca},r.prototype.getTargetInLca=function(){return this.targetInLca},r.prototype.getOtherEnd=function(f){if(this.source===f)return this.target;if(this.target===f)return this.source;throw"Node is not incident with this edge"},r.prototype.getOtherEndInGraph=function(f,e){for(var g=this.getOtherEnd(f),t=e.getGraphManager().getRoot();;){if(g.getOwner()==e)return g;if(g.getOwner()==t)break;g=g.getOwner().getParent()}return null},r.prototype.updateLength=function(){var f=new Array(4);this.isOverlapingSourceAndTarget=l.getIntersection(this.target.getRect(),this.source.getRect(),f),this.isOverlapingSourceAndTarget||(this.lengthX=f[0]-f[2],this.lengthY=f[1]-f[3],Math.abs(this.lengthX)<1&&(this.lengthX=n.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=n.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},r.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=n.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=n.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},C.exports=r},function(C,x,N){function v(l){this.vGraphObject=l}C.exports=v},function(C,x,N){var v=N(2),l=N(10),n=N(13),r=N(0),i=N(16),f=N(5);function e(t,s,o,c){o==null&&c==null&&(c=s),v.call(this,c),t.graphManager!=null&&(t=t.graphManager),this.estimatedSize=l.MIN_VALUE,this.inclusionTreeDepth=l.MAX_VALUE,this.vGraphObject=c,this.edges=[],this.graphManager=t,o!=null&&s!=null?this.rect=new n(s.x,s.y,o.width,o.height):this.rect=new n}e.prototype=Object.create(v.prototype);for(var g in v)e[g]=v[g];e.prototype.getEdges=function(){return this.edges},e.prototype.getChild=function(){return this.child},e.prototype.getOwner=function(){return this.owner},e.prototype.getWidth=function(){return this.rect.width},e.prototype.setWidth=function(t){this.rect.width=t},e.prototype.getHeight=function(){return this.rect.height},e.prototype.setHeight=function(t){this.rect.height=t},e.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},e.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},e.prototype.getCenter=function(){return new f(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},e.prototype.getLocation=function(){return new f(this.rect.x,this.rect.y)},e.prototype.getRect=function(){return this.rect},e.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},e.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},e.prototype.setRect=function(t,s){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=s.width,this.rect.height=s.height},e.prototype.setCenter=function(t,s){this.rect.x=t-this.rect.width/2,this.rect.y=s-this.rect.height/2},e.prototype.setLocation=function(t,s){this.rect.x=t,this.rect.y=s},e.prototype.moveBy=function(t,s){this.rect.x+=t,this.rect.y+=s},e.prototype.getEdgeListToNode=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(c.target==t){if(c.source!=o)throw"Incorrect edge source!";s.push(c)}}),s},e.prototype.getEdgesBetween=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(!(c.source==o||c.target==o))throw"Incorrect edge source and/or target";(c.target==t||c.source==t)&&s.push(c)}),s},e.prototype.getNeighborsList=function(){var t=new Set,s=this;return s.edges.forEach(function(o){if(o.source==s)t.add(o.target);else{if(o.target!=s)throw"Incorrect incidency!";t.add(o.source)}}),t},e.prototype.withChildren=function(){var t=new Set,s,o;if(t.add(this),this.child!=null)for(var c=this.child.getNodes(),h=0;hs?(this.rect.x-=(this.labelWidth-s)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(s+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(o+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>o?(this.rect.y-=(this.labelHeight-o)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(o+this.labelHeight))}}},e.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==l.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},e.prototype.transform=function(t){var s=this.rect.x;s>r.WORLD_BOUNDARY?s=r.WORLD_BOUNDARY:s<-r.WORLD_BOUNDARY&&(s=-r.WORLD_BOUNDARY);var o=this.rect.y;o>r.WORLD_BOUNDARY?o=r.WORLD_BOUNDARY:o<-r.WORLD_BOUNDARY&&(o=-r.WORLD_BOUNDARY);var c=new f(s,o),h=t.inverseTransformPoint(c);this.setLocation(h.x,h.y)},e.prototype.getLeft=function(){return this.rect.x},e.prototype.getRight=function(){return this.rect.x+this.rect.width},e.prototype.getTop=function(){return this.rect.y},e.prototype.getBottom=function(){return this.rect.y+this.rect.height},e.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},C.exports=e},function(C,x,N){var v=N(0);function l(){}for(var n in v)l[n]=v[n];l.MAX_ITERATIONS=2500,l.DEFAULT_EDGE_LENGTH=50,l.DEFAULT_SPRING_STRENGTH=.45,l.DEFAULT_REPULSION_STRENGTH=4500,l.DEFAULT_GRAVITY_STRENGTH=.4,l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,l.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,l.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,l.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,l.COOLING_ADAPTATION_FACTOR=.33,l.ADAPTATION_LOWER_NODE_LIMIT=1e3,l.ADAPTATION_UPPER_NODE_LIMIT=5e3,l.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,l.MAX_NODE_DISPLACEMENT=l.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,l.MIN_REPULSION_DIST=l.DEFAULT_EDGE_LENGTH/10,l.CONVERGENCE_CHECK_PERIOD=100,l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,l.MIN_EDGE_LENGTH=1,l.GRID_CALCULATION_CHECK_PERIOD=10,C.exports=l},function(C,x,N){function v(l,n){l==null&&n==null?(this.x=0,this.y=0):(this.x=l,this.y=n)}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.setX=function(l){this.x=l},v.prototype.setY=function(l){this.y=l},v.prototype.getDifference=function(l){return new DimensionD(this.x-l.x,this.y-l.y)},v.prototype.getCopy=function(){return new v(this.x,this.y)},v.prototype.translate=function(l){return this.x+=l.width,this.y+=l.height,this},C.exports=v},function(C,x,N){var v=N(2),l=N(10),n=N(0),r=N(7),i=N(3),f=N(1),e=N(13),g=N(12),t=N(11);function s(c,h,T){v.call(this,T),this.estimatedSize=l.MIN_VALUE,this.margin=n.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=c,h!=null&&h instanceof r?this.graphManager=h:h!=null&&h instanceof Layout&&(this.graphManager=h.graphManager)}s.prototype=Object.create(v.prototype);for(var o in v)s[o]=v[o];s.prototype.getNodes=function(){return this.nodes},s.prototype.getEdges=function(){return this.edges},s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getParent=function(){return this.parent},s.prototype.getLeft=function(){return this.left},s.prototype.getRight=function(){return this.right},s.prototype.getTop=function(){return this.top},s.prototype.getBottom=function(){return this.bottom},s.prototype.isConnected=function(){return this.isConnected},s.prototype.add=function(c,h,T){if(h==null&&T==null){var u=c;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(u)>-1)throw"Node already in graph!";return u.owner=this,this.getNodes().push(u),u}else{var d=c;if(!(this.getNodes().indexOf(h)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(h.owner==T.owner&&h.owner==this))throw"Both owners must be this graph!";return h.owner!=T.owner?null:(d.source=h,d.target=T,d.isInterGraph=!1,this.getEdges().push(d),h.edges.push(d),T!=h&&T.edges.push(d),d)}},s.prototype.remove=function(c){var h=c;if(c instanceof i){if(h==null)throw"Node is null!";if(!(h.owner!=null&&h.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=h.edges.slice(),u,d=T.length,L=0;L-1&&P>-1))throw"Source and/or target doesn't know this edge!";u.source.edges.splice(w,1),u.target!=u.source&&u.target.edges.splice(P,1);var b=u.source.owner.getEdges().indexOf(u);if(b==-1)throw"Not in owner's edge list!";u.source.owner.getEdges().splice(b,1)}},s.prototype.updateLeftTop=function(){for(var c=l.MAX_VALUE,h=l.MAX_VALUE,T,u,d,L=this.getNodes(),b=L.length,w=0;wT&&(c=T),h>u&&(h=u)}return c==l.MAX_VALUE?null:(L[0].getParent().paddingLeft!=null?d=L[0].getParent().paddingLeft:d=this.margin,this.left=h-d,this.top=c-d,new g(this.left,this.top))},s.prototype.updateBounds=function(c){for(var h=l.MAX_VALUE,T=-l.MAX_VALUE,u=l.MAX_VALUE,d=-l.MAX_VALUE,L,b,w,P,V,Y=this.nodes,B=Y.length,A=0;AL&&(h=L),Tw&&(u=w),dL&&(h=L),Tw&&(u=w),d=this.nodes.length){var B=0;T.forEach(function(A){A.owner==c&&B++}),B==this.nodes.length&&(this.isConnected=!0)}},C.exports=s},function(C,x,N){var v,l=N(1);function n(r){v=N(6),this.layout=r,this.graphs=[],this.edges=[]}n.prototype.addRoot=function(){var r=this.layout.newGraph(),i=this.layout.newNode(null),f=this.add(r,i);return this.setRootGraph(f),this.rootGraph},n.prototype.add=function(r,i,f,e,g){if(f==null&&e==null&&g==null){if(r==null)throw"Graph is null!";if(i==null)throw"Parent node is null!";if(this.graphs.indexOf(r)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(r),r.parent!=null)throw"Already has a parent!";if(i.child!=null)throw"Already has a child!";return r.parent=i,i.child=r,r}else{g=f,e=i,f=r;var t=e.getOwner(),s=g.getOwner();if(!(t!=null&&t.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(s!=null&&s.getGraphManager()==this))throw"Target not in this graph mgr!";if(t==s)return f.isInterGraph=!1,t.add(f,e,g);if(f.isInterGraph=!0,f.source=e,f.target=g,this.edges.indexOf(f)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(f),!(f.source!=null&&f.target!=null))throw"Edge source and/or target is null!";if(!(f.source.edges.indexOf(f)==-1&&f.target.edges.indexOf(f)==-1))throw"Edge already in source and/or target incidency list!";return f.source.edges.push(f),f.target.edges.push(f),f}},n.prototype.remove=function(r){if(r instanceof v){var i=r;if(i.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(i==this.rootGraph||i.parent!=null&&i.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(i.getEdges());for(var e,g=f.length,t=0;t=r.getRight()?i[0]+=Math.min(r.getX()-n.getX(),n.getRight()-r.getRight()):r.getX()<=n.getX()&&r.getRight()>=n.getRight()&&(i[0]+=Math.min(n.getX()-r.getX(),r.getRight()-n.getRight())),n.getY()<=r.getY()&&n.getBottom()>=r.getBottom()?i[1]+=Math.min(r.getY()-n.getY(),n.getBottom()-r.getBottom()):r.getY()<=n.getY()&&r.getBottom()>=n.getBottom()&&(i[1]+=Math.min(n.getY()-r.getY(),r.getBottom()-n.getBottom()));var g=Math.abs((r.getCenterY()-n.getCenterY())/(r.getCenterX()-n.getCenterX()));r.getCenterY()===n.getCenterY()&&r.getCenterX()===n.getCenterX()&&(g=1);var t=g*i[0],s=i[1]/g;i[0]t)return i[0]=f,i[1]=o,i[2]=g,i[3]=Y,!1;if(eg)return i[0]=s,i[1]=e,i[2]=P,i[3]=t,!1;if(fg?(i[0]=h,i[1]=T,a=!0):(i[0]=c,i[1]=o,a=!0):p===y&&(f>g?(i[0]=s,i[1]=o,a=!0):(i[0]=u,i[1]=T,a=!0)),-m===y?g>f?(i[2]=V,i[3]=Y,E=!0):(i[2]=P,i[3]=w,E=!0):m===y&&(g>f?(i[2]=b,i[3]=w,E=!0):(i[2]=B,i[3]=Y,E=!0)),a&&E)return!1;if(f>g?e>t?(S=this.getCardinalDirection(p,y,4),D=this.getCardinalDirection(m,y,2)):(S=this.getCardinalDirection(-p,y,3),D=this.getCardinalDirection(-m,y,1)):e>t?(S=this.getCardinalDirection(-p,y,1),D=this.getCardinalDirection(-m,y,3)):(S=this.getCardinalDirection(p,y,2),D=this.getCardinalDirection(m,y,4)),!a)switch(S){case 1:W=o,F=f+-L/y,i[0]=F,i[1]=W;break;case 2:F=u,W=e+d*y,i[0]=F,i[1]=W;break;case 3:W=T,F=f+L/y,i[0]=F,i[1]=W;break;case 4:F=h,W=e+-d*y,i[0]=F,i[1]=W;break}if(!E)switch(D){case 1:Q=w,R=g+-j/y,i[2]=R,i[3]=Q;break;case 2:R=B,Q=t+A*y,i[2]=R,i[3]=Q;break;case 3:Q=Y,R=g+j/y,i[2]=R,i[3]=Q;break;case 4:R=V,Q=t+-A*y,i[2]=R,i[3]=Q;break}}return!1},l.getCardinalDirection=function(n,r,i){return n>r?i:1+i%4},l.getIntersection=function(n,r,i,f){if(f==null)return this.getIntersection2(n,r,i);var e=n.x,g=n.y,t=r.x,s=r.y,o=i.x,c=i.y,h=f.x,T=f.y,u=void 0,d=void 0,L=void 0,b=void 0,w=void 0,P=void 0,V=void 0,Y=void 0,B=void 0;return L=s-g,w=e-t,V=t*g-e*s,b=T-c,P=o-h,Y=h*c-o*T,B=L*P-b*w,B===0?null:(u=(w*Y-P*V)/B,d=(b*V-L*Y)/B,new v(u,d))},l.angleOfVector=function(n,r,i,f){var e=void 0;return n!==i?(e=Math.atan((f-r)/(i-n)),i=0){var T=(-o+Math.sqrt(o*o-4*s*c))/(2*s),u=(-o-Math.sqrt(o*o-4*s*c))/(2*s),d=null;return T>=0&&T<=1?[T]:u>=0&&u<=1?[u]:d}else return null},l.HALF_PI=.5*Math.PI,l.ONE_AND_HALF_PI=1.5*Math.PI,l.TWO_PI=2*Math.PI,l.THREE_PI=3*Math.PI,C.exports=l},function(C,x,N){function v(){}v.sign=function(l){return l>0?1:l<0?-1:0},v.floor=function(l){return l<0?Math.ceil(l):Math.floor(l)},v.ceil=function(l){return l<0?Math.floor(l):Math.ceil(l)},C.exports=v},function(C,x,N){function v(){}v.MAX_VALUE=2147483647,v.MIN_VALUE=-2147483648,C.exports=v},function(C,x,N){var v=function(){function e(g,t){for(var s=0;s"u"?"undefined":v(n);return n==null||r!="object"&&r!="function"},C.exports=l},function(C,x,N){function v(o){if(Array.isArray(o)){for(var c=0,h=Array(o.length);c0&&c;){for(L.push(w[0]);L.length>0&&c;){var P=L[0];L.splice(0,1),d.add(P);for(var V=P.getEdges(),u=0;u-1&&w.splice(j,1)}d=new Set,b=new Map}}return o},s.prototype.createDummyNodesForBendpoints=function(o){for(var c=[],h=o.source,T=this.graphManager.calcLowestCommonAncestor(o.source,o.target),u=0;u0){for(var T=this.edgeToDummyNodes.get(h),u=0;u=0&&c.splice(Y,1);var B=b.getNeighborsList();B.forEach(function(a){if(h.indexOf(a)<0){var E=T.get(a),p=E-1;p==1&&P.push(a),T.set(a,p)}})}h=h.concat(P),(c.length==1||c.length==2)&&(u=!0,d=c[0])}return d},s.prototype.setGraphManager=function(o){this.graphManager=o},C.exports=s},function(C,x,N){function v(){}v.seed=1,v.x=0,v.nextDouble=function(){return v.x=Math.sin(v.seed++)*1e4,v.x-Math.floor(v.x)},C.exports=v},function(C,x,N){var v=N(5);function l(n,r){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}l.prototype.getWorldOrgX=function(){return this.lworldOrgX},l.prototype.setWorldOrgX=function(n){this.lworldOrgX=n},l.prototype.getWorldOrgY=function(){return this.lworldOrgY},l.prototype.setWorldOrgY=function(n){this.lworldOrgY=n},l.prototype.getWorldExtX=function(){return this.lworldExtX},l.prototype.setWorldExtX=function(n){this.lworldExtX=n},l.prototype.getWorldExtY=function(){return this.lworldExtY},l.prototype.setWorldExtY=function(n){this.lworldExtY=n},l.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},l.prototype.setDeviceOrgX=function(n){this.ldeviceOrgX=n},l.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},l.prototype.setDeviceOrgY=function(n){this.ldeviceOrgY=n},l.prototype.getDeviceExtX=function(){return this.ldeviceExtX},l.prototype.setDeviceExtX=function(n){this.ldeviceExtX=n},l.prototype.getDeviceExtY=function(){return this.ldeviceExtY},l.prototype.setDeviceExtY=function(n){this.ldeviceExtY=n},l.prototype.transformX=function(n){var r=0,i=this.lworldExtX;return i!=0&&(r=this.ldeviceOrgX+(n-this.lworldOrgX)*this.ldeviceExtX/i),r},l.prototype.transformY=function(n){var r=0,i=this.lworldExtY;return i!=0&&(r=this.ldeviceOrgY+(n-this.lworldOrgY)*this.ldeviceExtY/i),r},l.prototype.inverseTransformX=function(n){var r=0,i=this.ldeviceExtX;return i!=0&&(r=this.lworldOrgX+(n-this.ldeviceOrgX)*this.lworldExtX/i),r},l.prototype.inverseTransformY=function(n){var r=0,i=this.ldeviceExtY;return i!=0&&(r=this.lworldOrgY+(n-this.ldeviceOrgY)*this.lworldExtY/i),r},l.prototype.inverseTransformPoint=function(n){var r=new v(this.inverseTransformX(n.x),this.inverseTransformY(n.y));return r},C.exports=l},function(C,x,N){function v(t){if(Array.isArray(t)){for(var s=0,o=Array(t.length);sn.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*n.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-n.ADAPTATION_LOWER_NODE_LIMIT)/(n.ADAPTATION_UPPER_NODE_LIMIT-n.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-n.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=n.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>n.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(n.COOLING_ADAPTATION_FACTOR,1-(t-n.ADAPTATION_LOWER_NODE_LIMIT)/(n.ADAPTATION_UPPER_NODE_LIMIT-n.ADAPTATION_LOWER_NODE_LIMIT)*(1-n.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=n.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*n.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},e.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),s,o=0;o0&&arguments[0]!==void 0?arguments[0]:!0,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o,c,h,T,u=this.getAllNodes(),d;if(this.useFRGridVariant)for(this.totalIterations%n.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),d=new Set,o=0;oL||d>L)&&(t.gravitationForceX=-this.gravityConstant*h,t.gravitationForceY=-this.gravityConstant*T)):(L=s.getEstimatedSize()*this.compoundGravityRangeFactor,(u>L||d>L)&&(t.gravitationForceX=-this.gravityConstant*h*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},e.prototype.isConverged=function(){var t,s=!1;return this.totalIterations>this.maxIterations/3&&(s=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement=u.length||L>=u[0].length)){for(var b=0;be}}]),i}();C.exports=r},function(C,x,N){function v(){}v.svd=function(l){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=l.length,this.n=l[0].length;var n=Math.min(this.m,this.n);this.s=function(Tt){for(var wt=[];Tt-- >0;)wt.push(0);return wt}(Math.min(this.m+1,this.n)),this.U=function(Tt){var wt=function $t(bt){if(bt.length==0)return 0;for(var zt=[],St=0;St0;)wt.push(0);return wt}(this.n),i=function(Tt){for(var wt=[];Tt-- >0;)wt.push(0);return wt}(this.m),f=!0,e=Math.min(this.m-1,this.n),g=Math.max(0,Math.min(this.n-2,this.m)),t=0;t=0;m--)if(this.s[m]!==0){for(var y=m+1;y=0;z--){if(function(Tt,wt){return Tt&&wt}(z0;){var J=void 0,It=void 0;for(J=a-2;J>=-1&&J!==-1;J--)if(Math.abs(r[J])<=ht+tt*(Math.abs(this.s[J])+Math.abs(this.s[J+1]))){r[J]=0;break}if(J===a-2)It=4;else{var Nt=void 0;for(Nt=a-1;Nt>=J&&Nt!==J;Nt--){var vt=(Nt!==a?Math.abs(r[Nt]):0)+(Nt!==J+1?Math.abs(r[Nt-1]):0);if(Math.abs(this.s[Nt])<=ht+tt*vt){this.s[Nt]=0;break}}Nt===J?It=3:Nt===a-1?It=1:(It=2,J=Nt)}switch(J++,It){case 1:{var it=r[a-2];r[a-2]=0;for(var ut=a-2;ut>=J;ut--){var Et=v.hypot(this.s[ut],it),Ct=this.s[ut]/Et,Dt=it/Et;this.s[ut]=Et,ut!==J&&(it=-Dt*r[ut-1],r[ut-1]=Ct*r[ut-1]);for(var mt=0;mt=this.s[J+1]);){var Lt=this.s[J];if(this.s[J]=this.s[J+1],this.s[J+1]=Lt,JMath.abs(n)?(r=n/l,r=Math.abs(l)*Math.sqrt(1+r*r)):n!=0?(r=l/n,r=Math.abs(n)*Math.sqrt(1+r*r)):r=0,r},C.exports=v},function(C,x,N){var v=function(){function r(i,f){for(var e=0;e2&&arguments[2]!==void 0?arguments[2]:1,g=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;l(this,r),this.sequence1=i,this.sequence2=f,this.match_score=e,this.mismatch_penalty=g,this.gap_penalty=t,this.iMax=i.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var s=0;s=0;i--){var f=this.listeners[i];f.event===n&&f.callback===r&&this.listeners.splice(i,1)}},l.emit=function(n,r){for(var i=0;i{var x={45:(n,r,i)=>{var f={};f.layoutBase=i(551),f.CoSEConstants=i(806),f.CoSEEdge=i(767),f.CoSEGraph=i(880),f.CoSEGraphManager=i(578),f.CoSELayout=i(765),f.CoSENode=i(991),f.ConstraintHandler=i(902),n.exports=f},806:(n,r,i)=>{var f=i(551).FDLayoutConstants;function e(){}for(var g in f)e[g]=f[g];e.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,e.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH,e.DEFAULT_COMPONENT_SEPERATION=60,e.TILE=!0,e.TILING_PADDING_VERTICAL=10,e.TILING_PADDING_HORIZONTAL=10,e.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,e.ENFORCE_CONSTRAINTS=!0,e.APPLY_LAYOUT=!0,e.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,e.TREE_REDUCTION_ON_INCREMENTAL=!0,e.PURE_INCREMENTAL=e.DEFAULT_INCREMENTAL,n.exports=e},767:(n,r,i)=>{var f=i(551).FDLayoutEdge;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var g in f)e[g]=f[g];n.exports=e},880:(n,r,i)=>{var f=i(551).LGraph;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var g in f)e[g]=f[g];n.exports=e},578:(n,r,i)=>{var f=i(551).LGraphManager;function e(t){f.call(this,t)}e.prototype=Object.create(f.prototype);for(var g in f)e[g]=f[g];n.exports=e},765:(n,r,i)=>{var f=i(551).FDLayout,e=i(578),g=i(880),t=i(991),s=i(767),o=i(806),c=i(902),h=i(551).FDLayoutConstants,T=i(551).LayoutConstants,u=i(551).Point,d=i(551).PointD,L=i(551).DimensionD,b=i(551).Layout,w=i(551).Integer,P=i(551).IGeometry,V=i(551).LGraph,Y=i(551).Transform,B=i(551).LinkedList;function A(){f.call(this),this.toBeTiled={},this.constraints={}}A.prototype=Object.create(f.prototype);for(var j in f)A[j]=f[j];A.prototype.newGraphManager=function(){var a=new e(this);return this.graphManager=a,a},A.prototype.newGraph=function(a){return new g(null,this.graphManager,a)},A.prototype.newNode=function(a){return new t(this.graphManager,a)},A.prototype.newEdge=function(a){return new s(null,null,a)},A.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.isSubLayout||(o.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=h.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=h.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=h.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},A.prototype.initSpringEmbedder=function(){f.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/h.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},A.prototype.layout=function(){var a=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return a&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},A.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(S){return E.has(S)});this.graphManager.setAllNodesToApplyGravitation(p)}}else{var a=this.getFlatForest();if(a.length>0)this.positionNodesRadially(a);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(m){return E.has(m)});this.graphManager.setAllNodesToApplyGravitation(p),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),o.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},A.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%h.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var a=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(y){return a.has(y)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),o.PURE_INCREMENTAL?this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),o.PURE_INCREMENTAL?this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var p=!this.isTreeGrowing&&!this.isGrowthFinished,m=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(p,m),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},A.prototype.getPositionsData=function(){for(var a=this.graphManager.getAllNodes(),E={},p=0;p0&&this.updateDisplacements();for(var p=0;p0&&(m.fixedNodeWeight=S)}}if(this.constraints.relativePlacementConstraint){var D=new Map,F=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(O){a.fixedNodesOnHorizontal.add(O),a.fixedNodesOnVertical.add(O)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var W=this.constraints.alignmentConstraint.vertical,p=0;p=2*O.length/3;tt--)H=Math.floor(Math.random()*(tt+1)),Z=O[tt],O[tt]=O[H],O[H]=Z;return O},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var H=D.has(O.left)?D.get(O.left):O.left,Z=D.has(O.right)?D.get(O.right):O.right;a.nodesInRelativeHorizontal.includes(H)||(a.nodesInRelativeHorizontal.push(H),a.nodeToRelativeConstraintMapHorizontal.set(H,[]),a.dummyToNodeForVerticalAlignment.has(H)?a.nodeToTempPositionMapHorizontal.set(H,a.idToNodeMap.get(a.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):a.nodeToTempPositionMapHorizontal.set(H,a.idToNodeMap.get(H).getCenterX())),a.nodesInRelativeHorizontal.includes(Z)||(a.nodesInRelativeHorizontal.push(Z),a.nodeToRelativeConstraintMapHorizontal.set(Z,[]),a.dummyToNodeForVerticalAlignment.has(Z)?a.nodeToTempPositionMapHorizontal.set(Z,a.idToNodeMap.get(a.dummyToNodeForVerticalAlignment.get(Z)[0]).getCenterX()):a.nodeToTempPositionMapHorizontal.set(Z,a.idToNodeMap.get(Z).getCenterX())),a.nodeToRelativeConstraintMapHorizontal.get(H).push({right:Z,gap:O.gap}),a.nodeToRelativeConstraintMapHorizontal.get(Z).push({left:H,gap:O.gap})}else{var tt=F.has(O.top)?F.get(O.top):O.top,ht=F.has(O.bottom)?F.get(O.bottom):O.bottom;a.nodesInRelativeVertical.includes(tt)||(a.nodesInRelativeVertical.push(tt),a.nodeToRelativeConstraintMapVertical.set(tt,[]),a.dummyToNodeForHorizontalAlignment.has(tt)?a.nodeToTempPositionMapVertical.set(tt,a.idToNodeMap.get(a.dummyToNodeForHorizontalAlignment.get(tt)[0]).getCenterY()):a.nodeToTempPositionMapVertical.set(tt,a.idToNodeMap.get(tt).getCenterY())),a.nodesInRelativeVertical.includes(ht)||(a.nodesInRelativeVertical.push(ht),a.nodeToRelativeConstraintMapVertical.set(ht,[]),a.dummyToNodeForHorizontalAlignment.has(ht)?a.nodeToTempPositionMapVertical.set(ht,a.idToNodeMap.get(a.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()):a.nodeToTempPositionMapVertical.set(ht,a.idToNodeMap.get(ht).getCenterY())),a.nodeToRelativeConstraintMapVertical.get(tt).push({bottom:ht,gap:O.gap}),a.nodeToRelativeConstraintMapVertical.get(ht).push({top:tt,gap:O.gap})}});else{var Q=new Map,z=new Map;this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var H=D.has(O.left)?D.get(O.left):O.left,Z=D.has(O.right)?D.get(O.right):O.right;Q.has(H)?Q.get(H).push(Z):Q.set(H,[Z]),Q.has(Z)?Q.get(Z).push(H):Q.set(Z,[H])}else{var tt=F.has(O.top)?F.get(O.top):O.top,ht=F.has(O.bottom)?F.get(O.bottom):O.bottom;z.has(tt)?z.get(tt).push(ht):z.set(tt,[ht]),z.has(ht)?z.get(ht).push(tt):z.set(ht,[tt])}});var X=function(H,Z){var tt=[],ht=[],J=new B,It=new Set,Nt=0;return H.forEach(function(vt,it){if(!It.has(it)){tt[Nt]=[],ht[Nt]=!1;var ut=it;for(J.push(ut),It.add(ut),tt[Nt].push(ut);J.length!=0;){ut=J.shift(),Z.has(ut)&&(ht[Nt]=!0);var Et=H.get(ut);Et.forEach(function(Ct){It.has(Ct)||(J.push(Ct),It.add(Ct),tt[Nt].push(Ct))})}Nt++}}),{components:tt,isFixed:ht}},rt=X(Q,a.fixedNodesOnHorizontal);this.componentsOnHorizontal=rt.components,this.fixedComponentsOnHorizontal=rt.isFixed;var $=X(z,a.fixedNodesOnVertical);this.componentsOnVertical=$.components,this.fixedComponentsOnVertical=$.isFixed}}},A.prototype.updateDisplacements=function(){var a=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function($){var O=a.idToNodeMap.get($.nodeId);O.displacementX=0,O.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var E=this.constraints.alignmentConstraint.vertical,p=0;p1){var F;for(F=0;Fm&&(m=Math.floor(D.y)),S=Math.floor(D.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new d(T.WORLD_CENTER_X-D.x/2,T.WORLD_CENTER_Y-D.y/2))},A.radialLayout=function(a,E,p){var m=Math.max(this.maxDiagonalInTree(a),o.DEFAULT_RADIAL_SEPARATION);A.branchRadialLayout(E,null,0,359,0,m);var y=V.calculateBounds(a),S=new Y;S.setDeviceOrgX(y.getMinX()),S.setDeviceOrgY(y.getMinY()),S.setWorldOrgX(p.x),S.setWorldOrgY(p.y);for(var D=0;D1;){var Z=H[0];H.splice(0,1);var tt=z.indexOf(Z);tt>=0&&z.splice(tt,1),$--,X--}E!=null?O=(z.indexOf(H[0])+1)%$:O=0;for(var ht=Math.abs(m-p)/X,J=O;rt!=X;J=++J%$){var It=z[J].getOtherEnd(a);if(It!=E){var Nt=(p+rt*ht)%360,vt=(Nt+ht)%360;A.branchRadialLayout(It,a,Nt,vt,y+S,S),rt++}}},A.maxDiagonalInTree=function(a){for(var E=w.MIN_VALUE,p=0;pE&&(E=y)}return E},A.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},A.prototype.groupZeroDegreeMembers=function(){var a=this,E={};this.memberGroups={},this.idToDummyNode={};for(var p=[],m=this.graphManager.getAllNodes(),y=0;y"u"&&(E[F]=[]),E[F]=E[F].concat(S)}Object.keys(E).forEach(function(W){if(E[W].length>1){var R="DummyCompound_"+W;a.memberGroups[R]=E[W];var Q=E[W][0].getParent(),z=new t(a.graphManager);z.id=R,z.paddingLeft=Q.paddingLeft||0,z.paddingRight=Q.paddingRight||0,z.paddingBottom=Q.paddingBottom||0,z.paddingTop=Q.paddingTop||0,a.idToDummyNode[R]=z;var X=a.getGraphManager().add(a.newGraph(),z),rt=Q.getChild();rt.add(z);for(var $=0;$y?(m.rect.x-=(m.labelWidth-y)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-y)/2):m.labelPosHorizontal=="right"&&m.setWidth(y+m.labelWidth)),m.labelHeight&&(m.labelPosVertical=="top"?(m.rect.y-=m.labelHeight,m.setHeight(S+m.labelHeight),m.labelMarginTop=m.labelHeight):m.labelPosVertical=="center"&&m.labelHeight>S?(m.rect.y-=(m.labelHeight-S)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-S)/2):m.labelPosVertical=="bottom"&&m.setHeight(S+m.labelHeight))}})},A.prototype.repopulateCompounds=function(){for(var a=this.compoundOrder.length-1;a>=0;a--){var E=this.compoundOrder[a],p=E.id,m=E.paddingLeft,y=E.paddingTop,S=E.labelMarginLeft,D=E.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],E.rect.x,E.rect.y,m,y,S,D)}},A.prototype.repopulateZeroDegreeMembers=function(){var a=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(p){var m=a.idToDummyNode[p],y=m.paddingLeft,S=m.paddingTop,D=m.labelMarginLeft,F=m.labelMarginTop;a.adjustLocations(E[p],m.rect.x,m.rect.y,y,S,D,F)})},A.prototype.getToBeTiled=function(a){var E=a.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var p=a.getChild();if(p==null)return this.toBeTiled[E]=!1,!1;for(var m=p.getNodes(),y=0;y0)return this.toBeTiled[E]=!1,!1;if(S.getChild()==null){this.toBeTiled[S.id]=!1;continue}if(!this.getToBeTiled(S))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},A.prototype.getNodeDegree=function(a){a.id;for(var E=a.getEdges(),p=0,m=0;mQ&&(Q=X.rect.height)}p+=Q+a.verticalPadding}},A.prototype.tileCompoundMembers=function(a,E){var p=this;this.tiledMemberPack=[],Object.keys(a).forEach(function(m){var y=E[m];if(p.tiledMemberPack[m]=p.tileNodes(a[m],y.paddingLeft+y.paddingRight),y.rect.width=p.tiledMemberPack[m].width,y.rect.height=p.tiledMemberPack[m].height,y.setCenter(p.tiledMemberPack[m].centerX,p.tiledMemberPack[m].centerY),y.labelMarginLeft=0,y.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var S=y.rect.width,D=y.rect.height;y.labelWidth&&(y.labelPosHorizontal=="left"?(y.rect.x-=y.labelWidth,y.setWidth(S+y.labelWidth),y.labelMarginLeft=y.labelWidth):y.labelPosHorizontal=="center"&&y.labelWidth>S?(y.rect.x-=(y.labelWidth-S)/2,y.setWidth(y.labelWidth),y.labelMarginLeft=(y.labelWidth-S)/2):y.labelPosHorizontal=="right"&&y.setWidth(S+y.labelWidth)),y.labelHeight&&(y.labelPosVertical=="top"?(y.rect.y-=y.labelHeight,y.setHeight(D+y.labelHeight),y.labelMarginTop=y.labelHeight):y.labelPosVertical=="center"&&y.labelHeight>D?(y.rect.y-=(y.labelHeight-D)/2,y.setHeight(y.labelHeight),y.labelMarginTop=(y.labelHeight-D)/2):y.labelPosVertical=="bottom"&&y.setHeight(D+y.labelHeight))}})},A.prototype.tileNodes=function(a,E){var p=this.tileNodesByFavoringDim(a,E,!0),m=this.tileNodesByFavoringDim(a,E,!1),y=this.getOrgRatio(p),S=this.getOrgRatio(m),D;return SF&&(F=$.getWidth())});var W=S/y,R=D/y,Q=Math.pow(p-m,2)+4*(W+m)*(R+p)*y,z=(m-p+Math.sqrt(Q))/(2*(W+m)),X;E?(X=Math.ceil(z),X==z&&X++):X=Math.floor(z);var rt=X*(W+m)-m;return F>rt&&(rt=F),rt+=m*2,rt},A.prototype.tileNodesByFavoringDim=function(a,E,p){var m=o.TILING_PADDING_VERTICAL,y=o.TILING_PADDING_HORIZONTAL,S=o.TILING_COMPARE_BY,D={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:m,horizontalPadding:y,centerX:0,centerY:0};S&&(D.idealRowWidth=this.calcIdealRowWidth(a,p));var F=function(O){return O.rect.width*O.rect.height},W=function(O,H){return F(H)-F(O)};a.sort(function($,O){var H=W;return D.idealRowWidth?(H=S,H($.id,O.id)):H($,O)});for(var R=0,Q=0,z=0;z0&&(D+=a.horizontalPadding),a.rowWidth[p]=D,a.width0&&(F+=a.verticalPadding);var W=0;F>a.rowHeight[p]&&(W=a.rowHeight[p],a.rowHeight[p]=F,W=a.rowHeight[p]-W),a.height+=W,a.rows[p].push(E)},A.prototype.getShortestRowIndex=function(a){for(var E=-1,p=Number.MAX_VALUE,m=0;mp&&(E=m,p=a.rowWidth[m]);return E},A.prototype.canAddHorizontal=function(a,E,p){if(a.idealRowWidth){var m=a.rows.length-1,y=a.rowWidth[m];return y+E+a.horizontalPadding<=a.idealRowWidth}var S=this.getShortestRowIndex(a);if(S<0)return!0;var D=a.rowWidth[S];if(D+a.horizontalPadding+E<=a.width)return!0;var F=0;a.rowHeight[S]0&&(F=p+a.verticalPadding-a.rowHeight[S]);var W;a.width-D>=E+a.horizontalPadding?W=(a.height+F)/(D+E+a.horizontalPadding):W=(a.height+F)/a.width,F=p+a.verticalPadding;var R;return a.widthS&&E!=p){m.splice(-1,1),a.rows[p].push(y),a.rowWidth[E]=a.rowWidth[E]-S,a.rowWidth[p]=a.rowWidth[p]+S,a.width=a.rowWidth[instance.getLongestRowIndex(a)];for(var D=Number.MIN_VALUE,F=0;FD&&(D=m[F].height);E>0&&(D+=a.verticalPadding);var W=a.rowHeight[E]+a.rowHeight[p];a.rowHeight[E]=D,a.rowHeight[p]0)for(var rt=y;rt<=S;rt++)X[0]+=this.grid[rt][D-1].length+this.grid[rt][D].length-1;if(S0)for(var rt=D;rt<=F;rt++)X[3]+=this.grid[y-1][rt].length+this.grid[y][rt].length-1;for(var $=w.MAX_VALUE,O,H,Z=0;Z{var f=i(551).FDLayoutNode,e=i(551).IMath;function g(s,o,c,h){f.call(this,s,o,c,h)}g.prototype=Object.create(f.prototype);for(var t in f)g[t]=f[t];g.prototype.calculateDisplacement=function(){var s=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementX=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementX)),Math.abs(this.displacementY)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementY=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},g.prototype.propogateDisplacementToChildren=function(s,o){for(var c=this.getChild().getNodes(),h,T=0;T{function f(c){if(Array.isArray(c)){for(var h=0,T=Array(c.length);h0){var Lt=0;ot.forEach(function(st){k=="horizontal"?(et.set(st,u.has(st)?d[u.get(st)]:q.get(st)),Lt+=et.get(st)):(et.set(st,u.has(st)?L[u.get(st)]:q.get(st)),Lt+=et.get(st))}),Lt=Lt/ot.length,lt.forEach(function(st){K.has(st)||et.set(st,Lt)})}else{var ft=0;lt.forEach(function(st){k=="horizontal"?ft+=u.has(st)?d[u.get(st)]:q.get(st):ft+=u.has(st)?L[u.get(st)]:q.get(st)}),ft=ft/lt.length,lt.forEach(function(st){et.set(st,ft)})}});for(var Mt=function(){var ot=dt.shift(),Lt=U.get(ot);Lt.forEach(function(ft){if(et.get(ft.id)st&&(st=Zt),KtXt&&(Xt=Kt)}}catch(ee){wt=!0,$t=ee}finally{try{!Tt&&bt.return&&bt.return()}finally{if(wt)throw $t}}var he=(Lt+st)/2-(ft+Xt)/2,Qt=!0,jt=!1,_t=void 0;try{for(var Jt=lt[Symbol.iterator](),oe;!(Qt=(oe=Jt.next()).done);Qt=!0){var te=oe.value;et.set(te,et.get(te)+he)}}catch(ee){jt=!0,_t=ee}finally{try{!Qt&&Jt.return&&Jt.return()}finally{if(jt)throw _t}}})}return et},j=function(U){var k=0,K=0,q=0,at=0;if(U.forEach(function(_){_.left?d[u.get(_.left)]-d[u.get(_.right)]>=0?k++:K++:L[u.get(_.top)]-L[u.get(_.bottom)]>=0?q++:at++}),k>K&&q>at)for(var gt=0;gtK)for(var nt=0;ntat)for(var et=0;et1)h.fixedNodeConstraint.forEach(function(G,U){m[U]=[G.position.x,G.position.y],y[U]=[d[u.get(G.nodeId)],L[u.get(G.nodeId)]]}),S=!0;else if(h.alignmentConstraint)(function(){var G=0;if(h.alignmentConstraint.vertical){for(var U=h.alignmentConstraint.vertical,k=function(et){var _=new Set;U[et].forEach(function(pt){_.add(pt)});var dt=new Set([].concat(f(_)).filter(function(pt){return F.has(pt)})),Mt=void 0;dt.size>0?Mt=d[u.get(dt.values().next().value)]:Mt=B(_).x,U[et].forEach(function(pt){m[G]=[Mt,L[u.get(pt)]],y[G]=[d[u.get(pt)],L[u.get(pt)]],G++})},K=0;K0?Mt=d[u.get(dt.values().next().value)]:Mt=B(_).y,q[et].forEach(function(pt){m[G]=[d[u.get(pt)],Mt],y[G]=[d[u.get(pt)],L[u.get(pt)]],G++})},gt=0;gtz&&(z=Q[rt].length,X=rt);if(z0){var mt={x:0,y:0};h.fixedNodeConstraint.forEach(function(G,U){var k={x:d[u.get(G.nodeId)],y:L[u.get(G.nodeId)]},K=G.position,q=Y(K,k);mt.x+=q.x,mt.y+=q.y}),mt.x/=h.fixedNodeConstraint.length,mt.y/=h.fixedNodeConstraint.length,d.forEach(function(G,U){d[U]+=mt.x}),L.forEach(function(G,U){L[U]+=mt.y}),h.fixedNodeConstraint.forEach(function(G){d[u.get(G.nodeId)]=G.position.x,L[u.get(G.nodeId)]=G.position.y})}if(h.alignmentConstraint){if(h.alignmentConstraint.vertical)for(var Ot=h.alignmentConstraint.vertical,Rt=function(U){var k=new Set;Ot[U].forEach(function(at){k.add(at)});var K=new Set([].concat(f(k)).filter(function(at){return F.has(at)})),q=void 0;K.size>0?q=d[u.get(K.values().next().value)]:q=B(k).x,k.forEach(function(at){F.has(at)||(d[u.get(at)]=q)})},Ht=0;Ht0?q=L[u.get(K.values().next().value)]:q=B(k).y,k.forEach(function(at){F.has(at)||(L[u.get(at)]=q)})},Ft=0;Ft{n.exports=C}},N={};function v(n){var r=N[n];if(r!==void 0)return r.exports;var i=N[n]={exports:{}};return x[n](i,i.exports,v),i.exports}var l=v(45);return l})()})}(ue)),ue.exports}(function(I,M){(function(x,N){I.exports=N(vr())})(Te,function(C){return(()=>{var x={658:n=>{n.exports=Object.assign!=null?Object.assign.bind(Object):function(r){for(var i=arguments.length,f=Array(i>1?i-1:0),e=1;e{var f=function(){function t(s,o){var c=[],h=!0,T=!1,u=void 0;try{for(var d=s[Symbol.iterator](),L;!(h=(L=d.next()).done)&&(c.push(L.value),!(o&&c.length===o));h=!0);}catch(b){T=!0,u=b}finally{try{!h&&d.return&&d.return()}finally{if(T)throw u}}return c}return function(s,o){if(Array.isArray(s))return s;if(Symbol.iterator in Object(s))return t(s,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),e=i(140).layoutBase.LinkedList,g={};g.getTopMostNodes=function(t){for(var s={},o=0;o0&&S.merge(R)});for(var D=0;D1){L=u[0],b=L.connectedEdges().length,u.forEach(function(y){y.connectedEdges().length0&&c.set("dummy"+(c.size+1),V),Y},g.relocateComponent=function(t,s,o){if(!o.fixedNodeConstraint){var c=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY;if(o.quality=="draft"){var d=!0,L=!1,b=void 0;try{for(var w=s.nodeIndexes[Symbol.iterator](),P;!(d=(P=w.next()).done);d=!0){var V=P.value,Y=f(V,2),B=Y[0],A=Y[1],j=o.cy.getElementById(B);if(j){var a=j.boundingBox(),E=s.xCoords[A]-a.w/2,p=s.xCoords[A]+a.w/2,m=s.yCoords[A]-a.h/2,y=s.yCoords[A]+a.h/2;Eh&&(h=p),mu&&(u=y)}}}catch(R){L=!0,b=R}finally{try{!d&&w.return&&w.return()}finally{if(L)throw b}}var S=t.x-(h+c)/2,D=t.y-(u+T)/2;s.xCoords=s.xCoords.map(function(R){return R+S}),s.yCoords=s.yCoords.map(function(R){return R+D})}else{Object.keys(s).forEach(function(R){var Q=s[R],z=Q.getRect().x,X=Q.getRect().x+Q.getRect().width,rt=Q.getRect().y,$=Q.getRect().y+Q.getRect().height;zh&&(h=X),rtu&&(u=$)});var F=t.x-(h+c)/2,W=t.y-(u+T)/2;Object.keys(s).forEach(function(R){var Q=s[R];Q.setCenter(Q.getCenterX()+F,Q.getCenterY()+W)})}}},g.calcBoundingBox=function(t,s,o,c){for(var h=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,u=Number.MAX_SAFE_INTEGER,d=Number.MIN_SAFE_INTEGER,L=void 0,b=void 0,w=void 0,P=void 0,V=t.descendants().not(":parent"),Y=V.length,B=0;BL&&(h=L),Tw&&(u=w),d{var f=i(548),e=i(140).CoSELayout,g=i(140).CoSENode,t=i(140).layoutBase.PointD,s=i(140).layoutBase.DimensionD,o=i(140).layoutBase.LayoutConstants,c=i(140).layoutBase.FDLayoutConstants,h=i(140).CoSEConstants,T=function(d,L){var b=d.cy,w=d.eles,P=w.nodes(),V=w.edges(),Y=void 0,B=void 0,A=void 0,j={};d.randomize&&(Y=L.nodeIndexes,B=L.xCoords,A=L.yCoords);var a=function(R){return typeof R=="function"},E=function(R,Q){return a(R)?R(Q):R},p=f.calcParentsWithoutChildren(b,w),m=function W(R,Q,z,X){for(var rt=Q.length,$=0;$0){var J=void 0;J=z.getGraphManager().add(z.newGraph(),Z),W(J,H,z,X)}}},y=function(R,Q,z){for(var X=0,rt=0,$=0;$0?h.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=X/rt:a(d.idealEdgeLength)?h.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=50:h.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=d.idealEdgeLength,h.MIN_REPULSION_DIST=c.MIN_REPULSION_DIST=c.DEFAULT_EDGE_LENGTH/10,h.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH)},S=function(R,Q){Q.fixedNodeConstraint&&(R.constraints.fixedNodeConstraint=Q.fixedNodeConstraint),Q.alignmentConstraint&&(R.constraints.alignmentConstraint=Q.alignmentConstraint),Q.relativePlacementConstraint&&(R.constraints.relativePlacementConstraint=Q.relativePlacementConstraint)};d.nestingFactor!=null&&(h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.nestingFactor),d.gravity!=null&&(h.DEFAULT_GRAVITY_STRENGTH=c.DEFAULT_GRAVITY_STRENGTH=d.gravity),d.numIter!=null&&(h.MAX_ITERATIONS=c.MAX_ITERATIONS=d.numIter),d.gravityRange!=null&&(h.DEFAULT_GRAVITY_RANGE_FACTOR=c.DEFAULT_GRAVITY_RANGE_FACTOR=d.gravityRange),d.gravityCompound!=null&&(h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.gravityCompound),d.gravityRangeCompound!=null&&(h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.gravityRangeCompound),d.initialEnergyOnIncremental!=null&&(h.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.initialEnergyOnIncremental),d.tilingCompareBy!=null&&(h.TILING_COMPARE_BY=d.tilingCompareBy),d.quality=="proof"?o.QUALITY=2:o.QUALITY=0,h.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=d.nodeDimensionsIncludeLabels,h.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!d.randomize,h.ANIMATE=c.ANIMATE=o.ANIMATE=d.animate,h.TILE=d.tile,h.TILING_PADDING_VERTICAL=typeof d.tilingPaddingVertical=="function"?d.tilingPaddingVertical.call():d.tilingPaddingVertical,h.TILING_PADDING_HORIZONTAL=typeof d.tilingPaddingHorizontal=="function"?d.tilingPaddingHorizontal.call():d.tilingPaddingHorizontal,h.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!0,h.PURE_INCREMENTAL=!d.randomize,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=d.uniformNodeDimensions,d.step=="transformed"&&(h.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,h.ENFORCE_CONSTRAINTS=!1,h.APPLY_LAYOUT=!1),d.step=="enforced"&&(h.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,h.ENFORCE_CONSTRAINTS=!0,h.APPLY_LAYOUT=!1),d.step=="cose"&&(h.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,h.ENFORCE_CONSTRAINTS=!1,h.APPLY_LAYOUT=!0),d.step=="all"&&(d.randomize?h.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:h.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,h.ENFORCE_CONSTRAINTS=!0,h.APPLY_LAYOUT=!0),d.fixedNodeConstraint||d.alignmentConstraint||d.relativePlacementConstraint?h.TREE_REDUCTION_ON_INCREMENTAL=!1:h.TREE_REDUCTION_ON_INCREMENTAL=!0;var D=new e,F=D.newGraphManager();return m(F.addRoot(),f.getTopMostNodes(P),D,d),y(D,F,V),S(D,d),D.runLayout(),j};n.exports={coseLayout:T}},212:(n,r,i)=>{var f=function(){function d(L,b){for(var w=0;w0)if(p){var S=t.getTopMostNodes(w.eles.nodes());if(A=t.connectComponents(P,w.eles,S),A.forEach(function(vt){var it=vt.boundingBox();j.push({x:it.x1+it.w/2,y:it.y1+it.h/2})}),w.randomize&&A.forEach(function(vt){w.eles=vt,Y.push(o(w))}),w.quality=="default"||w.quality=="proof"){var D=P.collection();if(w.tile){var F=new Map,W=[],R=[],Q=0,z={nodeIndexes:F,xCoords:W,yCoords:R},X=[];if(A.forEach(function(vt,it){vt.edges().length==0&&(vt.nodes().forEach(function(ut,Et){D.merge(vt.nodes()[Et]),ut.isParent()||(z.nodeIndexes.set(vt.nodes()[Et].id(),Q++),z.xCoords.push(vt.nodes()[0].position().x),z.yCoords.push(vt.nodes()[0].position().y))}),X.push(it))}),D.length>1){var rt=D.boundingBox();j.push({x:rt.x1+rt.w/2,y:rt.y1+rt.h/2}),A.push(D),Y.push(z);for(var $=X.length-1;$>=0;$--)A.splice(X[$],1),Y.splice(X[$],1),j.splice(X[$],1)}}A.forEach(function(vt,it){w.eles=vt,B.push(h(w,Y[it])),t.relocateComponent(j[it],B[it],w)})}else A.forEach(function(vt,it){t.relocateComponent(j[it],Y[it],w)});var O=new Set;if(A.length>1){var H=[],Z=V.filter(function(vt){return vt.css("display")=="none"});A.forEach(function(vt,it){var ut=void 0;if(w.quality=="draft"&&(ut=Y[it].nodeIndexes),vt.nodes().not(Z).length>0){var Et={};Et.edges=[],Et.nodes=[];var Ct=void 0;vt.nodes().not(Z).forEach(function(Dt){if(w.quality=="draft")if(!Dt.isParent())Ct=ut.get(Dt.id()),Et.nodes.push({x:Y[it].xCoords[Ct]-Dt.boundingbox().w/2,y:Y[it].yCoords[Ct]-Dt.boundingbox().h/2,width:Dt.boundingbox().w,height:Dt.boundingbox().h});else{var mt=t.calcBoundingBox(Dt,Y[it].xCoords,Y[it].yCoords,ut);Et.nodes.push({x:mt.topLeftX,y:mt.topLeftY,width:mt.width,height:mt.height})}else B[it][Dt.id()]&&Et.nodes.push({x:B[it][Dt.id()].getLeft(),y:B[it][Dt.id()].getTop(),width:B[it][Dt.id()].getWidth(),height:B[it][Dt.id()].getHeight()})}),vt.edges().forEach(function(Dt){var mt=Dt.source(),Ot=Dt.target();if(mt.css("display")!="none"&&Ot.css("display")!="none")if(w.quality=="draft"){var Rt=ut.get(mt.id()),Ht=ut.get(Ot.id()),Ut=[],Gt=[];if(mt.isParent()){var Ft=t.calcBoundingBox(mt,Y[it].xCoords,Y[it].yCoords,ut);Ut.push(Ft.topLeftX+Ft.width/2),Ut.push(Ft.topLeftY+Ft.height/2)}else Ut.push(Y[it].xCoords[Rt]),Ut.push(Y[it].yCoords[Rt]);if(Ot.isParent()){var Yt=t.calcBoundingBox(Ot,Y[it].xCoords,Y[it].yCoords,ut);Gt.push(Yt.topLeftX+Yt.width/2),Gt.push(Yt.topLeftY+Yt.height/2)}else Gt.push(Y[it].xCoords[Ht]),Gt.push(Y[it].yCoords[Ht]);Et.edges.push({startX:Ut[0],startY:Ut[1],endX:Gt[0],endY:Gt[1]})}else B[it][mt.id()]&&B[it][Ot.id()]&&Et.edges.push({startX:B[it][mt.id()].getCenterX(),startY:B[it][mt.id()].getCenterY(),endX:B[it][Ot.id()].getCenterX(),endY:B[it][Ot.id()].getCenterY()})}),Et.nodes.length>0&&(H.push(Et),O.add(it))}});var tt=E.packComponents(H,w.randomize).shifts;if(w.quality=="draft")Y.forEach(function(vt,it){var ut=vt.xCoords.map(function(Ct){return Ct+tt[it].dx}),Et=vt.yCoords.map(function(Ct){return Ct+tt[it].dy});vt.xCoords=ut,vt.yCoords=Et});else{var ht=0;O.forEach(function(vt){Object.keys(B[vt]).forEach(function(it){var ut=B[vt][it];ut.setCenter(ut.getCenterX()+tt[ht].dx,ut.getCenterY()+tt[ht].dy)}),ht++})}}}else{var m=w.eles.boundingBox();if(j.push({x:m.x1+m.w/2,y:m.y1+m.h/2}),w.randomize){var y=o(w);Y.push(y)}w.quality=="default"||w.quality=="proof"?(B.push(h(w,Y[0])),t.relocateComponent(j[0],B[0],w)):t.relocateComponent(j[0],Y[0],w)}var J=function(it,ut){if(w.quality=="default"||w.quality=="proof"){typeof it=="number"&&(it=ut);var Et=void 0,Ct=void 0,Dt=it.data("id");return B.forEach(function(Ot){Dt in Ot&&(Et={x:Ot[Dt].getRect().getCenterX(),y:Ot[Dt].getRect().getCenterY()},Ct=Ot[Dt])}),w.nodeDimensionsIncludeLabels&&(Ct.labelWidth&&(Ct.labelPosHorizontal=="left"?Et.x+=Ct.labelWidth/2:Ct.labelPosHorizontal=="right"&&(Et.x-=Ct.labelWidth/2)),Ct.labelHeight&&(Ct.labelPosVertical=="top"?Et.y+=Ct.labelHeight/2:Ct.labelPosVertical=="bottom"&&(Et.y-=Ct.labelHeight/2))),Et==null&&(Et={x:it.position("x"),y:it.position("y")}),{x:Et.x,y:Et.y}}else{var mt=void 0;return Y.forEach(function(Ot){var Rt=Ot.nodeIndexes.get(it.id());Rt!=null&&(mt={x:Ot.xCoords[Rt],y:Ot.yCoords[Rt]})}),mt==null&&(mt={x:it.position("x"),y:it.position("y")}),{x:mt.x,y:mt.y}}};if(w.quality=="default"||w.quality=="proof"||w.randomize){var It=t.calcParentsWithoutChildren(P,V),Nt=V.filter(function(vt){return vt.css("display")=="none"});w.eles=V.not(Nt),V.nodes().not(":parent").not(Nt).layoutPositions(b,w,J),It.length>0&&It.forEach(function(vt){vt.position(J(vt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),d}();n.exports=u},657:(n,r,i)=>{var f=i(548),e=i(140).layoutBase.Matrix,g=i(140).layoutBase.SVD,t=function(o){var c=o.cy,h=o.eles,T=h.nodes(),u=h.nodes(":parent"),d=new Map,L=new Map,b=new Map,w=[],P=[],V=[],Y=[],B=[],A=[],j=[],a=[],E=void 0,p=1e8,m=1e-9,y=o.piTol,S=o.samplingType,D=o.nodeSeparation,F=void 0,W=function(){for(var U=0,k=0,K=!1;k=at;){nt=q[at++];for(var xt=w[nt],lt=0;ltdt&&(dt=B[Lt],Mt=Lt)}return Mt},Q=function(U){var k=void 0;if(U){k=Math.floor(Math.random()*E);for(var q=0;q=1)break;_=et}for(var pt=0;pt=1)break;_=et}for(var lt=0;lt0&&(k.isParent()?w[U].push(b.get(k.id())):w[U].push(k.id()))})});var Nt=function(U){var k=L.get(U),K=void 0;d.get(U).forEach(function(q){c.getElementById(q).isParent()?K=b.get(q):K=q,w[k].push(K),w[L.get(K)].push(U)})},vt=!0,it=!1,ut=void 0;try{for(var Et=d.keys()[Symbol.iterator](),Ct;!(vt=(Ct=Et.next()).done);vt=!0){var Dt=Ct.value;Nt(Dt)}}catch(G){it=!0,ut=G}finally{try{!vt&&Et.return&&Et.return()}finally{if(it)throw ut}}E=L.size;var mt=void 0;if(E>2){F=E{var f=i(212),e=function(t){t&&t("layout","fcose",f)};typeof cytoscape<"u"&&e(cytoscape),n.exports=e},140:n=>{n.exports=C}},N={};function v(n){var r=N[n];if(r!==void 0)return r.exports;var i=N[n]={exports:{}};return x[n](i,i.exports,v),i.exports}var l=v(579);return l})()})})(be);var pr=be.exports;const yr=gr(pr);var xe={L:"left",R:"right",T:"top",B:"bottom"},Ie={L:ct(I=>`${I},${I/2} 0,${I} 0,0`,"L"),R:ct(I=>`0,${I/2} ${I},0 ${I},${I}`,"R"),T:ct(I=>`0,0 ${I},0 ${I/2},${I}`,"T"),B:ct(I=>`${I/2},0 ${I},${I} 0,${I}`,"B")},se={L:ct((I,M)=>I-M+2,"L"),R:ct((I,M)=>I-2,"R"),T:ct((I,M)=>I-M+2,"T"),B:ct((I,M)=>I-2,"B")},mr=ct(function(I){return Wt(I)?I==="L"?"R":"L":I==="T"?"B":"T"},"getOppositeArchitectureDirection"),Re=ct(function(I){const M=I;return M==="L"||M==="R"||M==="T"||M==="B"},"isArchitectureDirection"),Wt=ct(function(I){const M=I;return M==="L"||M==="R"},"isArchitectureDirectionX"),qt=ct(function(I){const M=I;return M==="T"||M==="B"},"isArchitectureDirectionY"),Ne=ct(function(I,M){const C=Wt(I)&&qt(M),x=qt(I)&&Wt(M);return C||x},"isArchitectureDirectionXY"),Er=ct(function(I){const M=I[0],C=I[1],x=Wt(M)&&qt(C),N=qt(M)&&Wt(C);return x||N},"isArchitecturePairXY"),Tr=ct(function(I){return I!=="LL"&&I!=="RR"&&I!=="TT"&&I!=="BB"},"isValidArchitectureDirectionPair"),pe=ct(function(I,M){const C=`${I}${M}`;return Tr(C)?C:void 0},"getArchitectureDirectionPair"),Nr=ct(function([I,M],C){const x=C[0],N=C[1];return Wt(x)?qt(N)?[I+(x==="L"?-1:1),M+(N==="T"?1:-1)]:[I+(x==="L"?-1:1),M]:Wt(N)?[I+(N==="L"?1:-1),M+(x==="T"?1:-1)]:[I,M+(x==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Lr=ct(function(I){return I==="LT"||I==="TL"?[1,1]:I==="BL"||I==="LB"?[1,-1]:I==="BR"||I==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),wr=ct(function(I,M){return Ne(I,M)?"bend":Wt(I)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Cr=ct(function(I){return I.type==="service"},"isArchitectureService"),Mr=ct(function(I){return I.type==="junction"},"isArchitectureJunction"),Ge=ct((I,M)=>{const[C,x]=[I,M].sort();return`${JSON.stringify(C)}-${JSON.stringify(x)}`},"architectureGroupAlignmentKey"),Pe=ct(I=>I.data(),"edgeData"),ie=ct(I=>I.data(),"nodeData"),Ar=or.architecture,ae,Ue=(ae=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId="",this.setAccTitle=Ke,this.getAccTitle=je,this.setDiagramTitle=_e,this.getDiagramTitle=tr,this.getAccDescription=er,this.setAccDescription=rr,this.clear()}setDiagramId(M){this.diagramId=M}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId="",ir()}addService({id:M,icon:C,in:x,title:N,iconText:v}){if(this.registeredIds.has(M))throw new Error(`The service id [${M}] is already in use by another ${this.registeredIds.get(M)}`);if(x!==void 0){if(M===x)throw new Error(`The service [${M}] cannot be placed within itself`);if(!this.registeredIds.has(x))throw new Error(`The service [${M}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(x)==="node")throw new Error(`The service [${M}]'s parent is not a group`)}this.registeredIds.set(M,"node"),this.nodes.set(M,{id:M,type:"service",icon:C,iconText:v,title:N,edges:[],in:x})}getServices(){return[...this.nodes.values()].filter(Cr)}addJunction({id:M,in:C}){if(this.registeredIds.has(M))throw new Error(`The junction id [${M}] is already in use by another ${this.registeredIds.get(M)}`);if(C!==void 0){if(M===C)throw new Error(`The junction [${M}] cannot be placed within itself`);if(!this.registeredIds.has(C))throw new Error(`The junction [${M}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(C)==="node")throw new Error(`The junction [${M}]'s parent is not a group`)}this.registeredIds.set(M,"node"),this.nodes.set(M,{id:M,type:"junction",edges:[],in:C})}getJunctions(){return[...this.nodes.values()].filter(Mr)}getNodes(){return[...this.nodes.values()]}getNode(M){return this.nodes.get(M)??null}addGroup({id:M,icon:C,in:x,title:N}){if(this.registeredIds.has(M))throw new Error(`The group id [${M}] is already in use by another ${this.registeredIds.get(M)}`);if(x!==void 0){if(M===x)throw new Error(`The group [${M}] cannot be placed within itself`);if(!this.registeredIds.has(x))throw new Error(`The group [${M}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(x)==="node")throw new Error(`The group [${M}]'s parent is not a group`)}this.registeredIds.set(M,"group"),this.groups.set(M,{id:M,icon:C,title:N,in:x})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:M,rhsId:C,lhsDir:x,rhsDir:N,lhsInto:v,rhsInto:l,lhsGroup:n,rhsGroup:r,title:i}){if(!Re(x))throw new Error(`Invalid direction given for left hand side of edge ${M}--${C}. Expected (L,R,T,B) got ${String(x)}`);if(!Re(N))throw new Error(`Invalid direction given for right hand side of edge ${M}--${C}. Expected (L,R,T,B) got ${String(N)}`);if(!this.nodes.has(M)&&!this.groups.has(M))throw new Error(`The left-hand id [${M}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(C)&&!this.groups.has(C))throw new Error(`The right-hand id [${C}] does not yet exist. Please create the service/group before declaring an edge to it.`);const f=this.nodes.get(M).in,e=this.nodes.get(C).in;if(n&&f&&e&&f==e)throw new Error(`The left-hand id [${M}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(r&&f&&e&&f==e)throw new Error(`The right-hand id [${C}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const g={lhsId:M,lhsDir:x,lhsInto:v,lhsGroup:n,rhsId:C,rhsDir:N,rhsInto:l,rhsGroup:r,title:i};this.edges.push(g);const t=this.nodes.get(M),s=this.nodes.get(C);t&&s&&(t.edges.push(this.edges[this.edges.length-1]),s.edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(M){if(M.members.length<2)throw new Error(`An align directive requires at least two members; got ${M.members.length}`);const C=new Set;M.members.forEach(x=>{if(this.registeredIds.get(x)!=="node")throw new Error(`align ${M.direction} references [${x}], which is not a service or junction`);if(C.has(x))throw new Error(`align ${M.direction} lists [${x}] more than once`);C.add(x)}),this.layoutHints.push(M)}getLayoutHints(){return this.layoutHints}getDataStructures(){var M,C;if(this.dataStructures===void 0){const x=new Map,N=new Map;for(const[i,f]of this.nodes.entries()){const e=new Map;for(const g of f.edges){const t=(M=this.getNode(g.lhsId))==null?void 0:M.in,s=(C=this.getNode(g.rhsId))==null?void 0:C.in;if(t&&s&&t!==s){const o=wr(g.lhsDir,g.rhsDir);o!=="bend"&&x.set(Ge(t,s),o)}if(g.lhsId===i){const o=pe(g.lhsDir,g.rhsDir);o&&e.set(o,g.rhsId)}else{const o=pe(g.rhsDir,g.lhsDir);o&&e.set(o,g.lhsId)}}N.set(i,e)}const v=new Set,l=new Set(N.keys()),n=ct(i=>{const f=new Map([[i,[0,0]]]),e=[i];for(;e.length>0;){const g=e.shift();if(g){v.add(g),l.delete(g);const t=N.get(g);if(!t)throw new Error(`BFS error: adjacency list for id ${g} not found. Please report this as a bug.`);const s=f.get(g);if(!s)throw new Error(`BFS error: position for id ${g} not found in spatial map. Please report this as a bug.`);const[o,c]=s;t.forEach((h,T)=>{v.has(h)||(f.set(h,Nr([o,c],T)),e.push(h))})}}return f},"BFS"),r=[];for(;l.size>0;){const i=l.values().next().value;r.push(n(i))}this.dataStructures={adjList:N,spatialMaps:r,groupAlignments:x}}return this.dataStructures}setElementForId(M,C){this.elements.set(M,C)}getElementById(M){return this.elements.get(M)}getConfig(){return ar({...Ar,...nr().architecture})}getConfigField(M){return this.getConfig()[M]}},ct(ae,"ArchitectureDB"),ae),Dr=ct((I,M)=>{var C;qe(I,M),I.groups.map(x=>M.addGroup(x)),I.services.map(x=>M.addService({...x,type:"service"})),I.junctions.map(x=>M.addJunction({...x,type:"junction"})),I.edges.map(x=>M.addEdge(x)),(C=I.alignments)==null||C.map(x=>M.addLayoutHint({direction:x.direction,members:[...x.members]}))},"populateDb"),Ye={parser:{yy:void 0},parse:ct(async I=>{var x;const M=await cr("architecture",I);Se.debug(M);const C=(x=Ye.parser)==null?void 0:x.yy;if(!(C instanceof Ue))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Dr(M,C)},"parse")},Or=ct(I=>` .edge { stroke-width: ${I.archEdgeWidth}; stroke: ${I.archEdgeColor}; diff --git a/veadk/webui/assets/visualizations/mermaid/blockDiagram-VBNYF7ZC-BAJbaVfQ.js b/veadk/webui/assets/visualizations/mermaid/blockDiagram-VBNYF7ZC-D4I7ydgD.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/blockDiagram-VBNYF7ZC-BAJbaVfQ.js rename to veadk/webui/assets/visualizations/mermaid/blockDiagram-VBNYF7ZC-D4I7ydgD.js index b5ba538e1..7ed72499c 100644 --- a/veadk/webui/assets/visualizations/mermaid/blockDiagram-VBNYF7ZC-BAJbaVfQ.js +++ b/veadk/webui/assets/visualizations/mermaid/blockDiagram-VBNYF7ZC-D4I7ydgD.js @@ -1,4 +1,4 @@ -import{g as de}from"./chunk-5VM5RSS4-BDBKcK2Z.js";import{am as fe,a7 as Ut,an as pe,b4 as ye,b3 as xe,b6 as be,b5 as we,b0 as me,a_ as Se,aV as Le,aI as ve,aB as Ee,aA as _e,au as ke,ai as Te,ah as De,aj as Ne,S as Ie,R as Be,K as Ce,m as Oe,I as Re,g as Ae,h as ze,e as Me,a as u,X as nt,B as Pe,at as v,s as Fe,aM as We,Y as M,a3 as Ye,aq as He,G as Ke,a9 as Ue,a1 as Y,F as Et,z as rt,a6 as Xe,b9 as at,x as Ve,a5 as je,aN as Ot,M as Rt,A as Ge}from"./mermaid.core-y4TF8bTw.js";import{aG as O}from"../../app/index-BNPwMQXG.js";import{G as Ze}from"../../chunks/graph-Dqkl27Ch.js";import{c as qe}from"../../chunks/channel-Bbp-1bKw.js";import"../../chunks/purify.es-BnINGy_Y.js";function Je(e){return Array.isArray(e)}function Qe(e){if(fe(e))return e;const t=Ut(e);if(!$e(e))return{};if(Je(e)){const s=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(s.index=e.index,s.input=e.input),s}if(pe(e)){const s=e,i=s.constructor;return new i(s.buffer,s.byteOffset,s.length)}if(t==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(t==="[object DataView]"){const s=e,i=s.buffer,c=s.byteOffset,r=s.byteLength,n=new ArrayBuffer(r),l=new Uint8Array(i,c,r);return new Uint8Array(n).set(l),new DataView(n)}if(t==="[object Boolean]"||t==="[object Number]"||t==="[object String]"){const s=e.constructor,i=new s(e.valueOf());return t==="[object String]"?er(i,e):xt(i,e),i}if(t==="[object Date]")return new Date(Number(e));if(t==="[object RegExp]"){const s=e,i=new RegExp(s.source,s.flags);return i.lastIndex=s.lastIndex,i}if(t==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(t==="[object Map]"){const s=e,i=new Map;return s.forEach((c,r)=>{i.set(r,c)}),i}if(t==="[object Set]"){const s=e,i=new Set;return s.forEach(c=>{i.add(c)}),i}if(t==="[object Arguments]"){const s=e,i={};return xt(i,s),i.length=s.length,i[Symbol.iterator]=s[Symbol.iterator],i}const a={};return rr(a,e),xt(a,e),tr(a,e),a}function $e(e){switch(Ut(e)){case Me:case ze:case Ae:case Re:case Oe:case Ce:case Be:case Ie:case Ne:case De:case Te:case ke:case _e:case Ee:case ve:case Le:case Se:case me:case we:case be:case xe:case ye:return!0;default:return!1}}function xt(e,t){for(const a in t)Object.hasOwn(t,a)&&(e[a]=t[a])}function tr(e,t){const a=Object.getOwnPropertySymbols(t);for(let s=0;s=a)&&(e[s]=t[s])}function rr(e,t){const a=Object.getPrototypeOf(t);a!==null&&typeof t.constructor=="function"&&Object.setPrototypeOf(e,a)}var wt=function(){var e=u(function(N,b,d,y){for(d=d||{},y=N.length;y--;d[N[y]]=b);return d},"o"),t=[1,15],a=[1,7],s=[1,13],i=[1,14],c=[1,19],r=[1,16],n=[1,17],l=[1,18],g=[8,30],h=[8,10,21,28,29,30,31,39,43,46],p=[1,23],m=[1,24],x=[8,10,15,16,21,28,29,30,31,39,43,46],S=[8,10,15,16,21,27,28,29,30,31,39,43,46],_=[1,49],L={trace:u(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:u(function(b,d,y,w,D,o,k){var f=o.length-1;switch(D){case 4:w.getLogger().debug("Rule: separator (NL) ");break;case 5:w.getLogger().debug("Rule: separator (Space) ");break;case 6:w.getLogger().debug("Rule: separator (EOF) ");break;case 7:w.getLogger().debug("Rule: hierarchy: ",o[f-1]),w.setHierarchy(o[f-1]);break;case 8:w.getLogger().debug("Stop NL ");break;case 9:w.getLogger().debug("Stop EOF ");break;case 10:w.getLogger().debug("Stop NL2 ");break;case 11:w.getLogger().debug("Stop EOF2 ");break;case 12:w.getLogger().debug("Rule: statement: ",o[f]),typeof o[f].length=="number"?this.$=o[f]:this.$=[o[f]];break;case 13:w.getLogger().debug("Rule: statement #2: ",o[f-1]),this.$=[o[f-1]].concat(o[f]);break;case 14:w.getLogger().debug("Rule: link: ",o[f],b),this.$={edgeTypeStr:o[f],label:""};break;case 15:w.getLogger().debug("Rule: LABEL link: ",o[f-3],o[f-1],o[f]),this.$={edgeTypeStr:o[f],label:o[f-1]};break;case 18:const E=parseInt(o[f]),T=w.generateId();this.$={id:T,type:"space",label:"",width:E,children:[]};break;case 23:w.getLogger().debug("Rule: (nodeStatement link node) ",o[f-2],o[f-1],o[f]," typestr: ",o[f-1].edgeTypeStr);const z=w.edgeStrToEdgeData(o[f-1].edgeTypeStr),F=w.edgeStrToEdgeStartData(o[f-1].edgeTypeStr),q=w.edgeStrToThickness(o[f-1].edgeTypeStr),I=w.edgeStrToPattern(o[f-1].edgeTypeStr);this.$=[{id:o[f-2].id,label:o[f-2].label,type:o[f-2].type,directions:o[f-2].directions},{id:o[f-2].id+"-"+o[f].id,start:o[f-2].id,end:o[f].id,label:o[f-1].label,type:"edge",thickness:q,pattern:I,directions:o[f].directions,arrowTypeEnd:z,arrowTypeStart:F},{id:o[f].id,label:o[f].label,type:w.typeStr2Type(o[f].typeStr),directions:o[f].directions}];break;case 24:w.getLogger().debug("Rule: nodeStatement (abc88 node size) ",o[f-1],o[f]),this.$={id:o[f-1].id,label:o[f-1].label,type:w.typeStr2Type(o[f-1].typeStr),directions:o[f-1].directions,widthInColumns:parseInt(o[f],10)};break;case 25:w.getLogger().debug("Rule: nodeStatement (node) ",o[f]),this.$={id:o[f].id,label:o[f].label,type:w.typeStr2Type(o[f].typeStr),directions:o[f].directions,widthInColumns:1};break;case 26:w.getLogger().debug("APA123",this?this:"na"),w.getLogger().debug("COLUMNS: ",o[f]),this.$={type:"column-setting",columns:o[f]==="auto"?-1:parseInt(o[f])};break;case 27:w.getLogger().debug("Rule: id-block statement : ",o[f-2],o[f-1]),w.generateId(),this.$={...o[f-2],type:"composite",children:o[f-1]};break;case 28:w.getLogger().debug("Rule: blockStatement : ",o[f-2],o[f-1],o[f]);const K=w.generateId();this.$={id:K,type:"composite",label:"",children:o[f-1]};break;case 29:w.getLogger().debug("Rule: node (NODE_ID separator): ",o[f]),this.$={id:o[f]};break;case 30:w.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",o[f-1],o[f]),this.$={id:o[f-1],label:o[f].label,typeStr:o[f].typeStr,directions:o[f].directions};break;case 31:w.getLogger().debug("Rule: dirList: ",o[f]),this.$=[o[f]];break;case 32:w.getLogger().debug("Rule: dirList: ",o[f-1],o[f]),this.$=[o[f-1]].concat(o[f]);break;case 33:w.getLogger().debug("Rule: nodeShapeNLabel: ",o[f-2],o[f-1],o[f]),this.$={typeStr:o[f-2]+o[f],label:o[f-1]};break;case 34:w.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",o[f-3],o[f-2]," #3:",o[f-1],o[f]),this.$={typeStr:o[f-3]+o[f],label:o[f-2],directions:o[f-1]};break;case 35:case 36:this.$={type:"classDef",id:o[f-1].trim(),css:o[f].trim()};break;case 37:this.$={type:"applyClass",id:o[f-1].trim(),styleClass:o[f].trim()};break;case 38:this.$={type:"applyStyles",id:o[f-1].trim(),stylesStr:o[f].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{8:[1,20]},e(g,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:a,28:s,29:i,31:c,39:r,43:n,46:l}),e(h,[2,16],{14:22,15:p,16:m}),e(h,[2,17]),e(h,[2,18]),e(h,[2,19]),e(h,[2,20]),e(h,[2,21]),e(h,[2,22]),e(x,[2,25],{27:[1,25]}),e(h,[2,26]),{19:26,26:12,31:c},{10:t,11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(S,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(g,[2,13]),{26:35,31:c},{31:[2,14]},{17:[1,36]},e(x,[2,24]),{10:t,11:37,13:4,14:22,15:p,16:m,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(S,[2,30]),{18:[1,43]},{18:[1,44]},e(x,[2,23]),{18:[1,45]},{30:[1,46]},e(h,[2,28]),e(h,[2,35]),e(h,[2,36]),e(h,[2,37]),e(h,[2,38]),{36:[1,47]},{33:48,34:_},{15:[1,50]},e(h,[2,27]),e(S,[2,33]),{38:[1,51]},{33:52,34:_,38:[2,31]},{31:[2,15]},e(S,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:u(function(b,d){if(d.recoverable)this.trace(b);else{var y=new Error(b);throw y.hash=d,y}},"parseError"),parse:u(function(b){var d=this,y=[0],w=[],D=[null],o=[],k=this.table,f="",E=0,T=0,z=2,F=1,q=o.slice.call(arguments,1),I=Object.create(this.lexer),K={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(K.yy[J]=this.yy[J]);I.setInput(b,K.yy),K.yy.lexer=I,K.yy.parser=this,typeof I.yylloc>"u"&&(I.yylloc={});var et=I.yylloc;o.push(et);var ft=I.options&&I.options.ranges;typeof K.yy.parseError=="function"?this.parseError=K.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ue(U){y.length=y.length-2*U,D.length=D.length-U,o.length=o.length-U}u(ue,"popStack");function Bt(){var U;return U=w.pop()||I.lex()||F,typeof U!="number"&&(U instanceof Array&&(w=U,U=w.pop()),U=d.symbols_[U]||U),U}u(Bt,"lex");for(var H,$,V,pt,tt={},ct,Q,Ct,lt;;){if($=y[y.length-1],this.defaultActions[$]?V=this.defaultActions[$]:((H===null||typeof H>"u")&&(H=Bt()),V=k[$]&&k[$][H]),typeof V>"u"||!V.length||!V[0]){var yt="";lt=[];for(ct in k[$])this.terminals_[ct]&&ct>z&<.push("'"+this.terminals_[ct]+"'");I.showPosition?yt="Parse error on line "+(E+1)+`: +import{g as de}from"./chunk-5VM5RSS4-BKHSrXIw.js";import{am as fe,a7 as Ut,an as pe,b4 as ye,b3 as xe,b6 as be,b5 as we,b0 as me,a_ as Se,aV as Le,aI as ve,aB as Ee,aA as _e,au as ke,ai as Te,ah as De,aj as Ne,S as Ie,R as Be,K as Ce,m as Oe,I as Re,g as Ae,h as ze,e as Me,a as u,X as nt,B as Pe,at as v,s as Fe,aM as We,Y as M,a3 as Ye,aq as He,G as Ke,a9 as Ue,a1 as Y,F as Et,z as rt,a6 as Xe,b9 as at,x as Ve,a5 as je,aN as Ot,M as Rt,A as Ge}from"./mermaid.core-DAx4nvmm.js";import{aG as O}from"../../app/index-8JtvDNuA.js";import{G as Ze}from"../../chunks/graph-Dqkl27Ch.js";import{c as qe}from"../../chunks/channel-B1gj3-V8.js";import"../../chunks/purify.es-BnINGy_Y.js";function Je(e){return Array.isArray(e)}function Qe(e){if(fe(e))return e;const t=Ut(e);if(!$e(e))return{};if(Je(e)){const s=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(s.index=e.index,s.input=e.input),s}if(pe(e)){const s=e,i=s.constructor;return new i(s.buffer,s.byteOffset,s.length)}if(t==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(t==="[object DataView]"){const s=e,i=s.buffer,c=s.byteOffset,r=s.byteLength,n=new ArrayBuffer(r),l=new Uint8Array(i,c,r);return new Uint8Array(n).set(l),new DataView(n)}if(t==="[object Boolean]"||t==="[object Number]"||t==="[object String]"){const s=e.constructor,i=new s(e.valueOf());return t==="[object String]"?er(i,e):xt(i,e),i}if(t==="[object Date]")return new Date(Number(e));if(t==="[object RegExp]"){const s=e,i=new RegExp(s.source,s.flags);return i.lastIndex=s.lastIndex,i}if(t==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(t==="[object Map]"){const s=e,i=new Map;return s.forEach((c,r)=>{i.set(r,c)}),i}if(t==="[object Set]"){const s=e,i=new Set;return s.forEach(c=>{i.add(c)}),i}if(t==="[object Arguments]"){const s=e,i={};return xt(i,s),i.length=s.length,i[Symbol.iterator]=s[Symbol.iterator],i}const a={};return rr(a,e),xt(a,e),tr(a,e),a}function $e(e){switch(Ut(e)){case Me:case ze:case Ae:case Re:case Oe:case Ce:case Be:case Ie:case Ne:case De:case Te:case ke:case _e:case Ee:case ve:case Le:case Se:case me:case we:case be:case xe:case ye:return!0;default:return!1}}function xt(e,t){for(const a in t)Object.hasOwn(t,a)&&(e[a]=t[a])}function tr(e,t){const a=Object.getOwnPropertySymbols(t);for(let s=0;s=a)&&(e[s]=t[s])}function rr(e,t){const a=Object.getPrototypeOf(t);a!==null&&typeof t.constructor=="function"&&Object.setPrototypeOf(e,a)}var wt=function(){var e=u(function(N,b,d,y){for(d=d||{},y=N.length;y--;d[N[y]]=b);return d},"o"),t=[1,15],a=[1,7],s=[1,13],i=[1,14],c=[1,19],r=[1,16],n=[1,17],l=[1,18],g=[8,30],h=[8,10,21,28,29,30,31,39,43,46],p=[1,23],m=[1,24],x=[8,10,15,16,21,28,29,30,31,39,43,46],S=[8,10,15,16,21,27,28,29,30,31,39,43,46],_=[1,49],L={trace:u(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:u(function(b,d,y,w,D,o,k){var f=o.length-1;switch(D){case 4:w.getLogger().debug("Rule: separator (NL) ");break;case 5:w.getLogger().debug("Rule: separator (Space) ");break;case 6:w.getLogger().debug("Rule: separator (EOF) ");break;case 7:w.getLogger().debug("Rule: hierarchy: ",o[f-1]),w.setHierarchy(o[f-1]);break;case 8:w.getLogger().debug("Stop NL ");break;case 9:w.getLogger().debug("Stop EOF ");break;case 10:w.getLogger().debug("Stop NL2 ");break;case 11:w.getLogger().debug("Stop EOF2 ");break;case 12:w.getLogger().debug("Rule: statement: ",o[f]),typeof o[f].length=="number"?this.$=o[f]:this.$=[o[f]];break;case 13:w.getLogger().debug("Rule: statement #2: ",o[f-1]),this.$=[o[f-1]].concat(o[f]);break;case 14:w.getLogger().debug("Rule: link: ",o[f],b),this.$={edgeTypeStr:o[f],label:""};break;case 15:w.getLogger().debug("Rule: LABEL link: ",o[f-3],o[f-1],o[f]),this.$={edgeTypeStr:o[f],label:o[f-1]};break;case 18:const E=parseInt(o[f]),T=w.generateId();this.$={id:T,type:"space",label:"",width:E,children:[]};break;case 23:w.getLogger().debug("Rule: (nodeStatement link node) ",o[f-2],o[f-1],o[f]," typestr: ",o[f-1].edgeTypeStr);const z=w.edgeStrToEdgeData(o[f-1].edgeTypeStr),F=w.edgeStrToEdgeStartData(o[f-1].edgeTypeStr),q=w.edgeStrToThickness(o[f-1].edgeTypeStr),I=w.edgeStrToPattern(o[f-1].edgeTypeStr);this.$=[{id:o[f-2].id,label:o[f-2].label,type:o[f-2].type,directions:o[f-2].directions},{id:o[f-2].id+"-"+o[f].id,start:o[f-2].id,end:o[f].id,label:o[f-1].label,type:"edge",thickness:q,pattern:I,directions:o[f].directions,arrowTypeEnd:z,arrowTypeStart:F},{id:o[f].id,label:o[f].label,type:w.typeStr2Type(o[f].typeStr),directions:o[f].directions}];break;case 24:w.getLogger().debug("Rule: nodeStatement (abc88 node size) ",o[f-1],o[f]),this.$={id:o[f-1].id,label:o[f-1].label,type:w.typeStr2Type(o[f-1].typeStr),directions:o[f-1].directions,widthInColumns:parseInt(o[f],10)};break;case 25:w.getLogger().debug("Rule: nodeStatement (node) ",o[f]),this.$={id:o[f].id,label:o[f].label,type:w.typeStr2Type(o[f].typeStr),directions:o[f].directions,widthInColumns:1};break;case 26:w.getLogger().debug("APA123",this?this:"na"),w.getLogger().debug("COLUMNS: ",o[f]),this.$={type:"column-setting",columns:o[f]==="auto"?-1:parseInt(o[f])};break;case 27:w.getLogger().debug("Rule: id-block statement : ",o[f-2],o[f-1]),w.generateId(),this.$={...o[f-2],type:"composite",children:o[f-1]};break;case 28:w.getLogger().debug("Rule: blockStatement : ",o[f-2],o[f-1],o[f]);const K=w.generateId();this.$={id:K,type:"composite",label:"",children:o[f-1]};break;case 29:w.getLogger().debug("Rule: node (NODE_ID separator): ",o[f]),this.$={id:o[f]};break;case 30:w.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",o[f-1],o[f]),this.$={id:o[f-1],label:o[f].label,typeStr:o[f].typeStr,directions:o[f].directions};break;case 31:w.getLogger().debug("Rule: dirList: ",o[f]),this.$=[o[f]];break;case 32:w.getLogger().debug("Rule: dirList: ",o[f-1],o[f]),this.$=[o[f-1]].concat(o[f]);break;case 33:w.getLogger().debug("Rule: nodeShapeNLabel: ",o[f-2],o[f-1],o[f]),this.$={typeStr:o[f-2]+o[f],label:o[f-1]};break;case 34:w.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",o[f-3],o[f-2]," #3:",o[f-1],o[f]),this.$={typeStr:o[f-3]+o[f],label:o[f-2],directions:o[f-1]};break;case 35:case 36:this.$={type:"classDef",id:o[f-1].trim(),css:o[f].trim()};break;case 37:this.$={type:"applyClass",id:o[f-1].trim(),styleClass:o[f].trim()};break;case 38:this.$={type:"applyStyles",id:o[f-1].trim(),stylesStr:o[f].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{8:[1,20]},e(g,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:a,28:s,29:i,31:c,39:r,43:n,46:l}),e(h,[2,16],{14:22,15:p,16:m}),e(h,[2,17]),e(h,[2,18]),e(h,[2,19]),e(h,[2,20]),e(h,[2,21]),e(h,[2,22]),e(x,[2,25],{27:[1,25]}),e(h,[2,26]),{19:26,26:12,31:c},{10:t,11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(S,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(g,[2,13]),{26:35,31:c},{31:[2,14]},{17:[1,36]},e(x,[2,24]),{10:t,11:37,13:4,14:22,15:p,16:m,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(S,[2,30]),{18:[1,43]},{18:[1,44]},e(x,[2,23]),{18:[1,45]},{30:[1,46]},e(h,[2,28]),e(h,[2,35]),e(h,[2,36]),e(h,[2,37]),e(h,[2,38]),{36:[1,47]},{33:48,34:_},{15:[1,50]},e(h,[2,27]),e(S,[2,33]),{38:[1,51]},{33:52,34:_,38:[2,31]},{31:[2,15]},e(S,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:u(function(b,d){if(d.recoverable)this.trace(b);else{var y=new Error(b);throw y.hash=d,y}},"parseError"),parse:u(function(b){var d=this,y=[0],w=[],D=[null],o=[],k=this.table,f="",E=0,T=0,z=2,F=1,q=o.slice.call(arguments,1),I=Object.create(this.lexer),K={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(K.yy[J]=this.yy[J]);I.setInput(b,K.yy),K.yy.lexer=I,K.yy.parser=this,typeof I.yylloc>"u"&&(I.yylloc={});var et=I.yylloc;o.push(et);var ft=I.options&&I.options.ranges;typeof K.yy.parseError=="function"?this.parseError=K.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ue(U){y.length=y.length-2*U,D.length=D.length-U,o.length=o.length-U}u(ue,"popStack");function Bt(){var U;return U=w.pop()||I.lex()||F,typeof U!="number"&&(U instanceof Array&&(w=U,U=w.pop()),U=d.symbols_[U]||U),U}u(Bt,"lex");for(var H,$,V,pt,tt={},ct,Q,Ct,lt;;){if($=y[y.length-1],this.defaultActions[$]?V=this.defaultActions[$]:((H===null||typeof H>"u")&&(H=Bt()),V=k[$]&&k[$][H]),typeof V>"u"||!V.length||!V[0]){var yt="";lt=[];for(ct in k[$])this.terminals_[ct]&&ct>z&<.push("'"+this.terminals_[ct]+"'");I.showPosition?yt="Parse error on line "+(E+1)+`: `+I.showPosition()+` Expecting `+lt.join(", ")+", got '"+(this.terminals_[H]||H)+"'":yt="Parse error on line "+(E+1)+": Unexpected "+(H==F?"end of input":"'"+(this.terminals_[H]||H)+"'"),this.parseError(yt,{text:I.match,token:this.terminals_[H]||H,line:I.yylineno,loc:et,expected:lt})}if(V[0]instanceof Array&&V.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+H);switch(V[0]){case 1:y.push(H),D.push(I.yytext),o.push(I.yylloc),y.push(V[1]),H=null,T=I.yyleng,f=I.yytext,E=I.yylineno,et=I.yylloc;break;case 2:if(Q=this.productions_[V[1]][1],tt.$=D[D.length-Q],tt._$={first_line:o[o.length-(Q||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(Q||1)].first_column,last_column:o[o.length-1].last_column},ft&&(tt._$.range=[o[o.length-(Q||1)].range[0],o[o.length-1].range[1]]),pt=this.performAction.apply(tt,[f,T,E,K.yy,V[1],D,o].concat(q)),typeof pt<"u")return pt;Q&&(y=y.slice(0,-1*Q*2),D=D.slice(0,-1*Q),o=o.slice(0,-1*Q)),y.push(this.productions_[V[1]][0]),D.push(tt.$),o.push(tt._$),Ct=k[y[y.length-2]][y[y.length-1]],y.push(Ct);break;case 3:return!0}}return!0},"parse")},B=function(){var N={EOF:1,parseError:u(function(d,y){if(this.yy.parser)this.yy.parser.parseError(d,y);else throw new Error(d)},"parseError"),setInput:u(function(b,d){return this.yy=d||this.yy||{},this._input=b,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:u(function(){var b=this._input[0];this.yytext+=b,this.yyleng++,this.offset++,this.match+=b,this.matched+=b;var d=b.match(/(?:\r\n?|\n).*/g);return d?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),b},"input"),unput:u(function(b){var d=b.length,y=b.split(/(?:\r\n?|\n)/g);this._input=b+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var w=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),y.length-1&&(this.yylineno-=y.length-1);var D=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:y?(y.length===w.length?this.yylloc.first_column:0)+w[w.length-y.length].length-y[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[D[0],D[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:u(function(){return this._more=!0,this},"more"),reject:u(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:u(function(b){this.unput(this.match.slice(b))},"less"),pastInput:u(function(){var b=this.matched.substr(0,this.matched.length-this.match.length);return(b.length>20?"...":"")+b.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:u(function(){var b=this.match;return b.length<20&&(b+=this._input.substr(0,20-b.length)),(b.substr(0,20)+(b.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:u(function(){var b=this.pastInput(),d=new Array(b.length+1).join("-");return b+this.upcomingInput()+` diff --git a/veadk/webui/assets/visualizations/mermaid/c4Diagram-5PPSVZJV-CJepdaIg.js b/veadk/webui/assets/visualizations/mermaid/c4Diagram-5PPSVZJV-CYvD8vq6.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/c4Diagram-5PPSVZJV-CJepdaIg.js rename to veadk/webui/assets/visualizations/mermaid/c4Diagram-5PPSVZJV-CYvD8vq6.js index 72ee755e4..8e0786338 100644 --- a/veadk/webui/assets/visualizations/mermaid/c4Diagram-5PPSVZJV-CJepdaIg.js +++ b/veadk/webui/assets/visualizations/mermaid/c4Diagram-5PPSVZJV-CYvD8vq6.js @@ -1,4 +1,4 @@ -import{g as Se,e as De}from"./chunk-2GRJ4B5K-CvII-2ZL.js";import{aQ as Pe,V as Be,W as Ie,aR as Me,a as y,Y as Bt,at as de,B as Le,j as Ne,q as Tt,aN as ge,aO as Ye,bb as je,x as $t,p as fe}from"./mermaid.core-y4TF8bTw.js";import{aG as jt}from"../../app/index-BNPwMQXG.js";import"../../chunks/purify.es-BnINGy_Y.js";var Ft=function(){var a=y(function(_t,x,v,E){for(v=v||{},E=_t.length;E--;v[_t[E]]=x);return v},"o"),t=[1,24],s=[1,25],o=[1,26],r=[1,27],l=[1,28],e=[1,63],n=[1,64],i=[1,65],u=[1,66],d=[1,67],f=[1,68],g=[1,69],m=[1,29],O=[1,30],S=[1,31],P=[1,32],M=[1,33],U=[1,34],H=[1,35],q=[1,36],G=[1,37],K=[1,38],J=[1,39],Z=[1,40],$=[1,41],tt=[1,42],et=[1,43],at=[1,44],it=[1,45],nt=[1,46],st=[1,47],rt=[1,48],lt=[1,50],ot=[1,51],ct=[1,52],ht=[1,53],ut=[1,54],dt=[1,55],ft=[1,56],pt=[1,57],yt=[1,58],gt=[1,59],bt=[1,60],Ct=[14,42],Qt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],St=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],A=[1,82],k=[1,83],C=[1,84],w=[1,85],T=[12,14,42],le=[12,14,33,42],Mt=[12,14,33,42,76,77,79,80],vt=[12,33],Ht=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],qt={trace:y(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:y(function(x,v,E,b,R,h,Dt){var p=h.length-1;switch(R){case 3:b.setDirection("TB");break;case 4:b.setDirection("BT");break;case 5:b.setDirection("RL");break;case 6:b.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:b.setC4Type(h[p-3]);break;case 19:b.setTitle(h[p].substring(6)),this.$=h[p].substring(6);break;case 20:b.setAccDescription(h[p].substring(15)),this.$=h[p].substring(15);break;case 21:this.$=h[p].trim(),b.setTitle(this.$);break;case 22:case 23:this.$=h[p].trim(),b.setAccDescription(this.$);break;case 28:h[p].splice(2,0,"ENTERPRISE"),b.addPersonOrSystemBoundary(...h[p]),this.$=h[p];break;case 29:h[p].splice(2,0,"SYSTEM"),b.addPersonOrSystemBoundary(...h[p]),this.$=h[p];break;case 30:b.addPersonOrSystemBoundary(...h[p]),this.$=h[p];break;case 31:h[p].splice(2,0,"CONTAINER"),b.addContainerBoundary(...h[p]),this.$=h[p];break;case 32:b.addDeploymentNode("node",...h[p]),this.$=h[p];break;case 33:b.addDeploymentNode("nodeL",...h[p]),this.$=h[p];break;case 34:b.addDeploymentNode("nodeR",...h[p]),this.$=h[p];break;case 35:b.popBoundaryParseStack();break;case 39:b.addPersonOrSystem("person",...h[p]),this.$=h[p];break;case 40:b.addPersonOrSystem("external_person",...h[p]),this.$=h[p];break;case 41:b.addPersonOrSystem("system",...h[p]),this.$=h[p];break;case 42:b.addPersonOrSystem("system_db",...h[p]),this.$=h[p];break;case 43:b.addPersonOrSystem("system_queue",...h[p]),this.$=h[p];break;case 44:b.addPersonOrSystem("external_system",...h[p]),this.$=h[p];break;case 45:b.addPersonOrSystem("external_system_db",...h[p]),this.$=h[p];break;case 46:b.addPersonOrSystem("external_system_queue",...h[p]),this.$=h[p];break;case 47:b.addContainer("container",...h[p]),this.$=h[p];break;case 48:b.addContainer("container_db",...h[p]),this.$=h[p];break;case 49:b.addContainer("container_queue",...h[p]),this.$=h[p];break;case 50:b.addContainer("external_container",...h[p]),this.$=h[p];break;case 51:b.addContainer("external_container_db",...h[p]),this.$=h[p];break;case 52:b.addContainer("external_container_queue",...h[p]),this.$=h[p];break;case 53:b.addComponent("component",...h[p]),this.$=h[p];break;case 54:b.addComponent("component_db",...h[p]),this.$=h[p];break;case 55:b.addComponent("component_queue",...h[p]),this.$=h[p];break;case 56:b.addComponent("external_component",...h[p]),this.$=h[p];break;case 57:b.addComponent("external_component_db",...h[p]),this.$=h[p];break;case 58:b.addComponent("external_component_queue",...h[p]),this.$=h[p];break;case 60:b.addRel("rel",...h[p]),this.$=h[p];break;case 61:b.addRel("birel",...h[p]),this.$=h[p];break;case 62:b.addRel("rel_u",...h[p]),this.$=h[p];break;case 63:b.addRel("rel_d",...h[p]),this.$=h[p];break;case 64:b.addRel("rel_l",...h[p]),this.$=h[p];break;case 65:b.addRel("rel_r",...h[p]),this.$=h[p];break;case 66:b.addRel("rel_b",...h[p]),this.$=h[p];break;case 67:h[p].splice(0,1),b.addRel("rel",...h[p]),this.$=h[p];break;case 68:b.updateElStyle("update_el_style",...h[p]),this.$=h[p];break;case 69:b.updateRelStyle("update_rel_style",...h[p]),this.$=h[p];break;case 70:b.updateLayoutConfig("update_layout_config",...h[p]),this.$=h[p];break;case 71:this.$=[h[p]];break;case 72:h[p].unshift(h[p-1]),this.$=h[p];break;case 73:case 75:this.$=h[p].trim();break;case 74:let Et={};Et[h[p-1].trim()]=h[p].trim(),this.$=Et;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:70,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:71,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:72,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:73,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{14:[1,74]},a(Ct,[2,13],{43:23,29:49,30:61,32:62,20:75,34:e,36:n,37:i,38:u,39:d,40:f,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),a(Ct,[2,14]),a(Qt,[2,16],{12:[1,76]}),a(Ct,[2,36],{12:[1,77]}),a(St,[2,19]),a(St,[2,20]),{25:[1,78]},{27:[1,79]},a(St,[2,23]),{35:80,75:81,76:A,77:k,79:C,80:w},{35:86,75:81,76:A,77:k,79:C,80:w},{35:87,75:81,76:A,77:k,79:C,80:w},{35:88,75:81,76:A,77:k,79:C,80:w},{35:89,75:81,76:A,77:k,79:C,80:w},{35:90,75:81,76:A,77:k,79:C,80:w},{35:91,75:81,76:A,77:k,79:C,80:w},{35:92,75:81,76:A,77:k,79:C,80:w},{35:93,75:81,76:A,77:k,79:C,80:w},{35:94,75:81,76:A,77:k,79:C,80:w},{35:95,75:81,76:A,77:k,79:C,80:w},{35:96,75:81,76:A,77:k,79:C,80:w},{35:97,75:81,76:A,77:k,79:C,80:w},{35:98,75:81,76:A,77:k,79:C,80:w},{35:99,75:81,76:A,77:k,79:C,80:w},{35:100,75:81,76:A,77:k,79:C,80:w},{35:101,75:81,76:A,77:k,79:C,80:w},{35:102,75:81,76:A,77:k,79:C,80:w},{35:103,75:81,76:A,77:k,79:C,80:w},{35:104,75:81,76:A,77:k,79:C,80:w},a(T,[2,59]),{35:105,75:81,76:A,77:k,79:C,80:w},{35:106,75:81,76:A,77:k,79:C,80:w},{35:107,75:81,76:A,77:k,79:C,80:w},{35:108,75:81,76:A,77:k,79:C,80:w},{35:109,75:81,76:A,77:k,79:C,80:w},{35:110,75:81,76:A,77:k,79:C,80:w},{35:111,75:81,76:A,77:k,79:C,80:w},{35:112,75:81,76:A,77:k,79:C,80:w},{35:113,75:81,76:A,77:k,79:C,80:w},{35:114,75:81,76:A,77:k,79:C,80:w},{35:115,75:81,76:A,77:k,79:C,80:w},{20:116,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{12:[1,118],33:[1,117]},{35:119,75:81,76:A,77:k,79:C,80:w},{35:120,75:81,76:A,77:k,79:C,80:w},{35:121,75:81,76:A,77:k,79:C,80:w},{35:122,75:81,76:A,77:k,79:C,80:w},{35:123,75:81,76:A,77:k,79:C,80:w},{35:124,75:81,76:A,77:k,79:C,80:w},{35:125,75:81,76:A,77:k,79:C,80:w},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},a(Ct,[2,15]),a(Qt,[2,17],{21:22,19:130,22:t,23:s,24:o,26:r,28:l}),a(Ct,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:s,24:o,26:r,28:l,34:e,36:n,37:i,38:u,39:d,40:f,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),a(St,[2,21]),a(St,[2,22]),a(T,[2,39]),a(le,[2,71],{75:81,35:132,76:A,77:k,79:C,80:w}),a(Mt,[2,73]),{78:[1,133]},a(Mt,[2,75]),a(Mt,[2,76]),a(T,[2,40]),a(T,[2,41]),a(T,[2,42]),a(T,[2,43]),a(T,[2,44]),a(T,[2,45]),a(T,[2,46]),a(T,[2,47]),a(T,[2,48]),a(T,[2,49]),a(T,[2,50]),a(T,[2,51]),a(T,[2,52]),a(T,[2,53]),a(T,[2,54]),a(T,[2,55]),a(T,[2,56]),a(T,[2,57]),a(T,[2,58]),a(T,[2,60]),a(T,[2,61]),a(T,[2,62]),a(T,[2,63]),a(T,[2,64]),a(T,[2,65]),a(T,[2,66]),a(T,[2,67]),a(T,[2,68]),a(T,[2,69]),a(T,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},a(vt,[2,28]),a(vt,[2,29]),a(vt,[2,30]),a(vt,[2,31]),a(vt,[2,32]),a(vt,[2,33]),a(vt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},a(Qt,[2,18]),a(Ct,[2,38]),a(le,[2,72]),a(Mt,[2,74]),a(T,[2,24]),a(T,[2,35]),a(Ht,[2,25]),a(Ht,[2,26],{12:[1,138]}),a(Ht,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:y(function(x,v){if(v.recoverable)this.trace(x);else{var E=new Error(x);throw E.hash=v,E}},"parseError"),parse:y(function(x){var v=this,E=[0],b=[],R=[null],h=[],Dt=this.table,p="",Et=0,oe=0,we=2,ce=1,Te=h.slice.call(arguments,1),D=Object.create(this.lexer),At={yy:{}};for(var Gt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Gt)&&(At.yy[Gt]=this.yy[Gt]);D.setInput(x,At.yy),At.yy.lexer=D,At.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Kt=D.yylloc;h.push(Kt);var Oe=D.options&&D.options.ranges;typeof At.yy.parseError=="function"?this.parseError=At.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Re(L){E.length=E.length-2*L,R.length=R.length-L,h.length=h.length-L}y(Re,"popStack");function he(){var L;return L=b.pop()||D.lex()||ce,typeof L!="number"&&(L instanceof Array&&(b=L,L=b.pop()),L=v.symbols_[L]||L),L}y(he,"lex");for(var I,kt,N,Jt,wt={},Nt,X,ue,Yt;;){if(kt=E[E.length-1],this.defaultActions[kt]?N=this.defaultActions[kt]:((I===null||typeof I>"u")&&(I=he()),N=Dt[kt]&&Dt[kt][I]),typeof N>"u"||!N.length||!N[0]){var Zt="";Yt=[];for(Nt in Dt[kt])this.terminals_[Nt]&&Nt>we&&Yt.push("'"+this.terminals_[Nt]+"'");D.showPosition?Zt="Parse error on line "+(Et+1)+`: +import{g as Se,e as De}from"./chunk-2GRJ4B5K-BNT0kar4.js";import{aQ as Pe,V as Be,W as Ie,aR as Me,a as y,Y as Bt,at as de,B as Le,j as Ne,q as Tt,aN as ge,aO as Ye,bb as je,x as $t,p as fe}from"./mermaid.core-DAx4nvmm.js";import{aG as jt}from"../../app/index-8JtvDNuA.js";import"../../chunks/purify.es-BnINGy_Y.js";var Ft=function(){var a=y(function(_t,x,v,E){for(v=v||{},E=_t.length;E--;v[_t[E]]=x);return v},"o"),t=[1,24],s=[1,25],o=[1,26],r=[1,27],l=[1,28],e=[1,63],n=[1,64],i=[1,65],u=[1,66],d=[1,67],f=[1,68],g=[1,69],m=[1,29],O=[1,30],S=[1,31],P=[1,32],M=[1,33],U=[1,34],H=[1,35],q=[1,36],G=[1,37],K=[1,38],J=[1,39],Z=[1,40],$=[1,41],tt=[1,42],et=[1,43],at=[1,44],it=[1,45],nt=[1,46],st=[1,47],rt=[1,48],lt=[1,50],ot=[1,51],ct=[1,52],ht=[1,53],ut=[1,54],dt=[1,55],ft=[1,56],pt=[1,57],yt=[1,58],gt=[1,59],bt=[1,60],Ct=[14,42],Qt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],St=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],A=[1,82],k=[1,83],C=[1,84],w=[1,85],T=[12,14,42],le=[12,14,33,42],Mt=[12,14,33,42,76,77,79,80],vt=[12,33],Ht=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],qt={trace:y(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:y(function(x,v,E,b,R,h,Dt){var p=h.length-1;switch(R){case 3:b.setDirection("TB");break;case 4:b.setDirection("BT");break;case 5:b.setDirection("RL");break;case 6:b.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:b.setC4Type(h[p-3]);break;case 19:b.setTitle(h[p].substring(6)),this.$=h[p].substring(6);break;case 20:b.setAccDescription(h[p].substring(15)),this.$=h[p].substring(15);break;case 21:this.$=h[p].trim(),b.setTitle(this.$);break;case 22:case 23:this.$=h[p].trim(),b.setAccDescription(this.$);break;case 28:h[p].splice(2,0,"ENTERPRISE"),b.addPersonOrSystemBoundary(...h[p]),this.$=h[p];break;case 29:h[p].splice(2,0,"SYSTEM"),b.addPersonOrSystemBoundary(...h[p]),this.$=h[p];break;case 30:b.addPersonOrSystemBoundary(...h[p]),this.$=h[p];break;case 31:h[p].splice(2,0,"CONTAINER"),b.addContainerBoundary(...h[p]),this.$=h[p];break;case 32:b.addDeploymentNode("node",...h[p]),this.$=h[p];break;case 33:b.addDeploymentNode("nodeL",...h[p]),this.$=h[p];break;case 34:b.addDeploymentNode("nodeR",...h[p]),this.$=h[p];break;case 35:b.popBoundaryParseStack();break;case 39:b.addPersonOrSystem("person",...h[p]),this.$=h[p];break;case 40:b.addPersonOrSystem("external_person",...h[p]),this.$=h[p];break;case 41:b.addPersonOrSystem("system",...h[p]),this.$=h[p];break;case 42:b.addPersonOrSystem("system_db",...h[p]),this.$=h[p];break;case 43:b.addPersonOrSystem("system_queue",...h[p]),this.$=h[p];break;case 44:b.addPersonOrSystem("external_system",...h[p]),this.$=h[p];break;case 45:b.addPersonOrSystem("external_system_db",...h[p]),this.$=h[p];break;case 46:b.addPersonOrSystem("external_system_queue",...h[p]),this.$=h[p];break;case 47:b.addContainer("container",...h[p]),this.$=h[p];break;case 48:b.addContainer("container_db",...h[p]),this.$=h[p];break;case 49:b.addContainer("container_queue",...h[p]),this.$=h[p];break;case 50:b.addContainer("external_container",...h[p]),this.$=h[p];break;case 51:b.addContainer("external_container_db",...h[p]),this.$=h[p];break;case 52:b.addContainer("external_container_queue",...h[p]),this.$=h[p];break;case 53:b.addComponent("component",...h[p]),this.$=h[p];break;case 54:b.addComponent("component_db",...h[p]),this.$=h[p];break;case 55:b.addComponent("component_queue",...h[p]),this.$=h[p];break;case 56:b.addComponent("external_component",...h[p]),this.$=h[p];break;case 57:b.addComponent("external_component_db",...h[p]),this.$=h[p];break;case 58:b.addComponent("external_component_queue",...h[p]),this.$=h[p];break;case 60:b.addRel("rel",...h[p]),this.$=h[p];break;case 61:b.addRel("birel",...h[p]),this.$=h[p];break;case 62:b.addRel("rel_u",...h[p]),this.$=h[p];break;case 63:b.addRel("rel_d",...h[p]),this.$=h[p];break;case 64:b.addRel("rel_l",...h[p]),this.$=h[p];break;case 65:b.addRel("rel_r",...h[p]),this.$=h[p];break;case 66:b.addRel("rel_b",...h[p]),this.$=h[p];break;case 67:h[p].splice(0,1),b.addRel("rel",...h[p]),this.$=h[p];break;case 68:b.updateElStyle("update_el_style",...h[p]),this.$=h[p];break;case 69:b.updateRelStyle("update_rel_style",...h[p]),this.$=h[p];break;case 70:b.updateLayoutConfig("update_layout_config",...h[p]),this.$=h[p];break;case 71:this.$=[h[p]];break;case 72:h[p].unshift(h[p-1]),this.$=h[p];break;case 73:case 75:this.$=h[p].trim();break;case 74:let Et={};Et[h[p-1].trim()]=h[p].trim(),this.$=Et;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:70,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:71,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:72,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:73,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{14:[1,74]},a(Ct,[2,13],{43:23,29:49,30:61,32:62,20:75,34:e,36:n,37:i,38:u,39:d,40:f,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),a(Ct,[2,14]),a(Qt,[2,16],{12:[1,76]}),a(Ct,[2,36],{12:[1,77]}),a(St,[2,19]),a(St,[2,20]),{25:[1,78]},{27:[1,79]},a(St,[2,23]),{35:80,75:81,76:A,77:k,79:C,80:w},{35:86,75:81,76:A,77:k,79:C,80:w},{35:87,75:81,76:A,77:k,79:C,80:w},{35:88,75:81,76:A,77:k,79:C,80:w},{35:89,75:81,76:A,77:k,79:C,80:w},{35:90,75:81,76:A,77:k,79:C,80:w},{35:91,75:81,76:A,77:k,79:C,80:w},{35:92,75:81,76:A,77:k,79:C,80:w},{35:93,75:81,76:A,77:k,79:C,80:w},{35:94,75:81,76:A,77:k,79:C,80:w},{35:95,75:81,76:A,77:k,79:C,80:w},{35:96,75:81,76:A,77:k,79:C,80:w},{35:97,75:81,76:A,77:k,79:C,80:w},{35:98,75:81,76:A,77:k,79:C,80:w},{35:99,75:81,76:A,77:k,79:C,80:w},{35:100,75:81,76:A,77:k,79:C,80:w},{35:101,75:81,76:A,77:k,79:C,80:w},{35:102,75:81,76:A,77:k,79:C,80:w},{35:103,75:81,76:A,77:k,79:C,80:w},{35:104,75:81,76:A,77:k,79:C,80:w},a(T,[2,59]),{35:105,75:81,76:A,77:k,79:C,80:w},{35:106,75:81,76:A,77:k,79:C,80:w},{35:107,75:81,76:A,77:k,79:C,80:w},{35:108,75:81,76:A,77:k,79:C,80:w},{35:109,75:81,76:A,77:k,79:C,80:w},{35:110,75:81,76:A,77:k,79:C,80:w},{35:111,75:81,76:A,77:k,79:C,80:w},{35:112,75:81,76:A,77:k,79:C,80:w},{35:113,75:81,76:A,77:k,79:C,80:w},{35:114,75:81,76:A,77:k,79:C,80:w},{35:115,75:81,76:A,77:k,79:C,80:w},{20:116,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{12:[1,118],33:[1,117]},{35:119,75:81,76:A,77:k,79:C,80:w},{35:120,75:81,76:A,77:k,79:C,80:w},{35:121,75:81,76:A,77:k,79:C,80:w},{35:122,75:81,76:A,77:k,79:C,80:w},{35:123,75:81,76:A,77:k,79:C,80:w},{35:124,75:81,76:A,77:k,79:C,80:w},{35:125,75:81,76:A,77:k,79:C,80:w},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},a(Ct,[2,15]),a(Qt,[2,17],{21:22,19:130,22:t,23:s,24:o,26:r,28:l}),a(Ct,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:s,24:o,26:r,28:l,34:e,36:n,37:i,38:u,39:d,40:f,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),a(St,[2,21]),a(St,[2,22]),a(T,[2,39]),a(le,[2,71],{75:81,35:132,76:A,77:k,79:C,80:w}),a(Mt,[2,73]),{78:[1,133]},a(Mt,[2,75]),a(Mt,[2,76]),a(T,[2,40]),a(T,[2,41]),a(T,[2,42]),a(T,[2,43]),a(T,[2,44]),a(T,[2,45]),a(T,[2,46]),a(T,[2,47]),a(T,[2,48]),a(T,[2,49]),a(T,[2,50]),a(T,[2,51]),a(T,[2,52]),a(T,[2,53]),a(T,[2,54]),a(T,[2,55]),a(T,[2,56]),a(T,[2,57]),a(T,[2,58]),a(T,[2,60]),a(T,[2,61]),a(T,[2,62]),a(T,[2,63]),a(T,[2,64]),a(T,[2,65]),a(T,[2,66]),a(T,[2,67]),a(T,[2,68]),a(T,[2,69]),a(T,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},a(vt,[2,28]),a(vt,[2,29]),a(vt,[2,30]),a(vt,[2,31]),a(vt,[2,32]),a(vt,[2,33]),a(vt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},a(Qt,[2,18]),a(Ct,[2,38]),a(le,[2,72]),a(Mt,[2,74]),a(T,[2,24]),a(T,[2,35]),a(Ht,[2,25]),a(Ht,[2,26],{12:[1,138]}),a(Ht,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:y(function(x,v){if(v.recoverable)this.trace(x);else{var E=new Error(x);throw E.hash=v,E}},"parseError"),parse:y(function(x){var v=this,E=[0],b=[],R=[null],h=[],Dt=this.table,p="",Et=0,oe=0,we=2,ce=1,Te=h.slice.call(arguments,1),D=Object.create(this.lexer),At={yy:{}};for(var Gt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Gt)&&(At.yy[Gt]=this.yy[Gt]);D.setInput(x,At.yy),At.yy.lexer=D,At.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Kt=D.yylloc;h.push(Kt);var Oe=D.options&&D.options.ranges;typeof At.yy.parseError=="function"?this.parseError=At.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Re(L){E.length=E.length-2*L,R.length=R.length-L,h.length=h.length-L}y(Re,"popStack");function he(){var L;return L=b.pop()||D.lex()||ce,typeof L!="number"&&(L instanceof Array&&(b=L,L=b.pop()),L=v.symbols_[L]||L),L}y(he,"lex");for(var I,kt,N,Jt,wt={},Nt,X,ue,Yt;;){if(kt=E[E.length-1],this.defaultActions[kt]?N=this.defaultActions[kt]:((I===null||typeof I>"u")&&(I=he()),N=Dt[kt]&&Dt[kt][I]),typeof N>"u"||!N.length||!N[0]){var Zt="";Yt=[];for(Nt in Dt[kt])this.terminals_[Nt]&&Nt>we&&Yt.push("'"+this.terminals_[Nt]+"'");D.showPosition?Zt="Parse error on line "+(Et+1)+`: `+D.showPosition()+` Expecting `+Yt.join(", ")+", got '"+(this.terminals_[I]||I)+"'":Zt="Parse error on line "+(Et+1)+": Unexpected "+(I==ce?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(Zt,{text:D.match,token:this.terminals_[I]||I,line:D.yylineno,loc:Kt,expected:Yt})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+kt+", token: "+I);switch(N[0]){case 1:E.push(I),R.push(D.yytext),h.push(D.yylloc),E.push(N[1]),I=null,oe=D.yyleng,p=D.yytext,Et=D.yylineno,Kt=D.yylloc;break;case 2:if(X=this.productions_[N[1]][1],wt.$=R[R.length-X],wt._$={first_line:h[h.length-(X||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(X||1)].first_column,last_column:h[h.length-1].last_column},Oe&&(wt._$.range=[h[h.length-(X||1)].range[0],h[h.length-1].range[1]]),Jt=this.performAction.apply(wt,[p,oe,Et,At.yy,N[1],R,h].concat(Te)),typeof Jt<"u")return Jt;X&&(E=E.slice(0,-1*X*2),R=R.slice(0,-1*X),h=h.slice(0,-1*X)),E.push(this.productions_[N[1]][0]),R.push(wt.$),h.push(wt._$),ue=Dt[E[E.length-2]][E[E.length-1]],E.push(ue);break;case 3:return!0}}return!0},"parse")},Ce=function(){var _t={EOF:1,parseError:y(function(v,E){if(this.yy.parser)this.yy.parser.parseError(v,E);else throw new Error(v)},"parseError"),setInput:y(function(x,v){return this.yy=v||this.yy||{},this._input=x,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:y(function(){var x=this._input[0];this.yytext+=x,this.yyleng++,this.offset++,this.match+=x,this.matched+=x;var v=x.match(/(?:\r\n?|\n).*/g);return v?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),x},"input"),unput:y(function(x){var v=x.length,E=x.split(/(?:\r\n?|\n)/g);this._input=x+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-v),this.offset-=v;var b=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),E.length-1&&(this.yylineno-=E.length-1);var R=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:E?(E.length===b.length?this.yylloc.first_column:0)+b[b.length-E.length].length-E[0].length:this.yylloc.first_column-v},this.options.ranges&&(this.yylloc.range=[R[0],R[0]+this.yyleng-v]),this.yyleng=this.yytext.length,this},"unput"),more:y(function(){return this._more=!0,this},"more"),reject:y(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:y(function(x){this.unput(this.match.slice(x))},"less"),pastInput:y(function(){var x=this.matched.substr(0,this.matched.length-this.match.length);return(x.length>20?"...":"")+x.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:y(function(){var x=this.match;return x.length<20&&(x+=this._input.substr(0,20-x.length)),(x.substr(0,20)+(x.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:y(function(){var x=this.pastInput(),v=new Array(x.length+1).join("-");return x+this.upcomingInput()+` diff --git a/veadk/webui/assets/visualizations/mermaid/chunk-2GRJ4B5K-CvII-2ZL.js b/veadk/webui/assets/visualizations/mermaid/chunk-2GRJ4B5K-BNT0kar4.js similarity index 93% rename from veadk/webui/assets/visualizations/mermaid/chunk-2GRJ4B5K-CvII-2ZL.js rename to veadk/webui/assets/visualizations/mermaid/chunk-2GRJ4B5K-BNT0kar4.js index bfa14e40d..c926dd7a8 100644 --- a/veadk/webui/assets/visualizations/mermaid/chunk-2GRJ4B5K-CvII-2ZL.js +++ b/veadk/webui/assets/visualizations/mermaid/chunk-2GRJ4B5K-BNT0kar4.js @@ -1 +1 @@ -import{a as i,ar as d,aO as o}from"./mermaid.core-y4TF8bTw.js";import{aG as l}from"../../app/index-BNPwMQXG.js";var x=i((r,t)=>{const e=r.append("rect");if(e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),t.name&&e.attr("name",t.name),t.rx&&e.attr("rx",t.rx),t.ry&&e.attr("ry",t.ry),t.attrs!==void 0)for(const a in t.attrs)e.attr(a,t.attrs[a]);return t.class&&e.attr("class",t.class),e},"drawRect"),y=i((r,t)=>{const e={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};x(r,e).lower()},"drawBackgroundRect"),m=i((r,t)=>{const e=t.text.replace(d," "),a=r.append("text");a.attr("x",t.x),a.attr("y",t.y),a.attr("class","legend"),a.style("text-anchor",t.anchor),t.class&&a.attr("class",t.class);const s=a.append("tspan");return s.attr("x",t.x+t.textMargin*2),s.text(e),a},"drawText"),g=i((r,t,e,a)=>{const s=r.append("image");s.attr("x",t),s.attr("y",e);const n=o(a);s.attr("xlink:href",n)},"drawImage"),f=i((r,t,e,a)=>{const s=r.append("use");s.attr("x",t),s.attr("y",e);const n=o(a);s.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),h=i(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),w=i(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),k=i(()=>{let r=l(".mermaidTooltip");return r.empty()&&(r=l("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),r},"createTooltip");export{f as a,g as b,k as c,y as d,x as e,m as f,h as g,w as h}; +import{a as i,ar as d,aO as o}from"./mermaid.core-DAx4nvmm.js";import{aG as l}from"../../app/index-8JtvDNuA.js";var x=i((r,t)=>{const e=r.append("rect");if(e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),t.name&&e.attr("name",t.name),t.rx&&e.attr("rx",t.rx),t.ry&&e.attr("ry",t.ry),t.attrs!==void 0)for(const a in t.attrs)e.attr(a,t.attrs[a]);return t.class&&e.attr("class",t.class),e},"drawRect"),y=i((r,t)=>{const e={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};x(r,e).lower()},"drawBackgroundRect"),m=i((r,t)=>{const e=t.text.replace(d," "),a=r.append("text");a.attr("x",t.x),a.attr("y",t.y),a.attr("class","legend"),a.style("text-anchor",t.anchor),t.class&&a.attr("class",t.class);const s=a.append("tspan");return s.attr("x",t.x+t.textMargin*2),s.text(e),a},"drawText"),g=i((r,t,e,a)=>{const s=r.append("image");s.attr("x",t),s.attr("y",e);const n=o(a);s.attr("xlink:href",n)},"drawImage"),f=i((r,t,e,a)=>{const s=r.append("use");s.attr("x",t),s.attr("y",e);const n=o(a);s.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),h=i(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),w=i(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),k=i(()=>{let r=l(".mermaidTooltip");return r.empty()&&(r=l("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),r},"createTooltip");export{f as a,g as b,k as c,y as d,x as e,m as f,h as g,w as h}; diff --git a/veadk/webui/assets/visualizations/mermaid/chunk-2Q5K7J3B-nvFjhS5b.js b/veadk/webui/assets/visualizations/mermaid/chunk-2Q5K7J3B-BK3jpFNd.js similarity index 66% rename from veadk/webui/assets/visualizations/mermaid/chunk-2Q5K7J3B-nvFjhS5b.js rename to veadk/webui/assets/visualizations/mermaid/chunk-2Q5K7J3B-BK3jpFNd.js index 78a6589cf..7c97bb08a 100644 --- a/veadk/webui/assets/visualizations/mermaid/chunk-2Q5K7J3B-nvFjhS5b.js +++ b/veadk/webui/assets/visualizations/mermaid/chunk-2Q5K7J3B-BK3jpFNd.js @@ -1 +1 @@ -import{a as s}from"./mermaid.core-y4TF8bTw.js";var t,e=(t=class{constructor(i){this.init=i,this.records=this.init()}reset(){this.records=this.init()}},s(t,"ImperativeState"),t);export{e as I}; +import{a as s}from"./mermaid.core-DAx4nvmm.js";var t,e=(t=class{constructor(i){this.init=i,this.records=this.init()}reset(){this.records=this.init()}},s(t,"ImperativeState"),t);export{e as I}; diff --git a/veadk/webui/assets/visualizations/mermaid/chunk-5RXB4S5H-CY1YEJD3.js b/veadk/webui/assets/visualizations/mermaid/chunk-5RXB4S5H-Ln4IekMd.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/chunk-5RXB4S5H-CY1YEJD3.js rename to veadk/webui/assets/visualizations/mermaid/chunk-5RXB4S5H-Ln4IekMd.js index a7fb02a2d..a423f8ea0 100644 --- a/veadk/webui/assets/visualizations/mermaid/chunk-5RXB4S5H-CY1YEJD3.js +++ b/veadk/webui/assets/visualizations/mermaid/chunk-5RXB4S5H-Ln4IekMd.js @@ -1,4 +1,4 @@ -import{g as ee}from"./chunk-XXDRQBXY-B8qTF1qQ.js";import{s as se}from"./chunk-KBJHAD2P-DtNDDRN1.js";import{a as S,at as b,Y as F,aK as ie,b9 as re,W as ae,aR as ne,V as oe,aQ as le,aT as ce,$ as he,T as ue,x as K,s as de}from"./mermaid.core-y4TF8bTw.js";import{c as fe}from"./chunk-2GRJ4B5K-CvII-2ZL.js";import{aG as Dt}from"../../app/index-BNPwMQXG.js";import pe from"../../chunks/purify.es-BnINGy_Y.js";var Ct=function(){var t=S(function(W,l,d,n){for(d=d||{},n=W.length;n--;d[W[n]]=l);return d},"o"),e=[1,2],s=[1,3],a=[1,4],i=[2,4],o=[1,9],h=[1,11],p=[1,16],f=[1,17],T=[1,18],E=[1,19],m=[1,33],R=[1,20],C=[1,21],x=[1,22],$=[1,23],O=[1,24],u=[1,26],L=[1,27],k=[1,28],V=[1,29],P=[1,30],v=[1,31],Y=[1,32],j=[1,35],nt=[1,36],ot=[1,37],lt=[1,38],J=[1,34],y=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],ct=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],Lt=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],gt={trace:S(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:S(function(l,d,n,g,_,r,B){var c=r.length-1;switch(_){case 3:return g.setRootDoc(r[c]),r[c];case 4:this.$=[];break;case 5:r[c]!="nl"&&(r[c-1].push(r[c]),this.$=r[c-1]);break;case 6:case 7:this.$=r[c];break;case 8:this.$="nl";break;case 12:this.$=r[c];break;case 13:const et=r[c-1];et.description=g.trimColon(r[c]),this.$=et;break;case 14:this.$={stmt:"relation",state1:r[c-2],state2:r[c]};break;case 15:const Tt=g.trimColon(r[c]);this.$={stmt:"relation",state1:r[c-3],state2:r[c-1],description:Tt};break;case 19:this.$={stmt:"state",id:r[c-3],type:"default",description:"",doc:r[c-1]};break;case 20:var G=r[c],q=r[c-2].trim();if(r[c].match(":")){var ut=r[c].split(":");G=ut[0],q=[q,ut[1]]}this.$={stmt:"state",id:G,type:"default",description:q};break;case 21:this.$={stmt:"state",id:r[c-3],type:"default",description:r[c-5],doc:r[c-1]};break;case 22:this.$={stmt:"state",id:r[c],type:"fork"};break;case 23:this.$={stmt:"state",id:r[c],type:"join"};break;case 24:this.$={stmt:"state",id:r[c],type:"choice"};break;case 25:this.$={stmt:"state",id:g.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:r[c-1].trim(),note:{position:r[c-2].trim(),text:r[c].trim()}};break;case 29:this.$=r[c].trim(),g.setAccTitle(this.$);break;case 30:case 31:this.$=r[c].trim(),g.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:r[c-3],url:r[c-2],tooltip:r[c-1]};break;case 33:this.$={stmt:"click",id:r[c-3],url:r[c-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:r[c-1].trim(),classes:r[c].trim()};break;case 36:this.$={stmt:"style",id:r[c-1].trim(),styleClass:r[c].trim()};break;case 37:this.$={stmt:"applyClass",id:r[c-1].trim(),styleClass:r[c].trim()};break;case 38:g.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:g.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:g.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:g.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:r[c].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:r[c-2].trim(),classes:[r[c].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:r[c-2].trim(),classes:[r[c].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:s,6:a},{1:[3]},{3:5,4:e,5:s,6:a},{3:6,4:e,5:s,6:a},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:p,17:f,19:T,22:E,24:m,25:R,26:C,27:x,28:$,29:O,32:25,33:u,35:L,37:k,38:V,41:P,45:v,48:Y,51:j,52:nt,53:ot,54:lt,57:J},t(y,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:p,17:f,19:T,22:E,24:m,25:R,26:C,27:x,28:$,29:O,32:25,33:u,35:L,37:k,38:V,41:P,45:v,48:Y,51:j,52:nt,53:ot,54:lt,57:J},t(y,[2,7]),t(y,[2,8]),t(y,[2,9]),t(y,[2,10]),t(y,[2,11]),t(y,[2,12],{14:[1,40],15:[1,41]}),t(y,[2,16]),{18:[1,42]},t(y,[2,18],{20:[1,43]}),{23:[1,44]},t(y,[2,22]),t(y,[2,23]),t(y,[2,24]),t(y,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(y,[2,28]),{34:[1,49]},{36:[1,50]},t(y,[2,31]),{13:51,24:m,57:J},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(ct,[2,44],{58:[1,56]}),t(ct,[2,45],{58:[1,57]}),t(y,[2,38]),t(y,[2,39]),t(y,[2,40]),t(y,[2,41]),t(y,[2,6]),t(y,[2,13]),{13:58,24:m,57:J},t(y,[2,17]),t(Lt,i,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(y,[2,29]),t(y,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(y,[2,14],{14:[1,71]}),{4:o,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:p,17:f,19:T,21:[1,72],22:E,24:m,25:R,26:C,27:x,28:$,29:O,32:25,33:u,35:L,37:k,38:V,41:P,45:v,48:Y,51:j,52:nt,53:ot,54:lt,57:J},t(y,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(y,[2,34]),t(y,[2,35]),t(y,[2,36]),t(y,[2,37]),t(ct,[2,46]),t(ct,[2,47]),t(y,[2,15]),t(y,[2,19]),t(Lt,i,{7:78}),t(y,[2,26]),t(y,[2,27]),{5:[1,79]},{5:[1,80]},{4:o,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:p,17:f,19:T,21:[1,81],22:E,24:m,25:R,26:C,27:x,28:$,29:O,32:25,33:u,35:L,37:k,38:V,41:P,45:v,48:Y,51:j,52:nt,53:ot,54:lt,57:J},t(y,[2,32]),t(y,[2,33]),t(y,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:S(function(l,d){if(d.recoverable)this.trace(l);else{var n=new Error(l);throw n.hash=d,n}},"parseError"),parse:S(function(l){var d=this,n=[0],g=[],_=[null],r=[],B=this.table,c="",G=0,q=0,ut=2,et=1,Tt=r.slice.call(arguments,1),D=Object.create(this.lexer),H={yy:{}};for(var Et in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Et)&&(H.yy[Et]=this.yy[Et]);D.setInput(l,H.yy),H.yy.lexer=D,H.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var _t=D.yylloc;r.push(_t);var Zt=D.options&&D.options.ranges;typeof H.yy.parseError=="function"?this.parseError=H.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function te(I){n.length=n.length-2*I,_.length=_.length-I,r.length=r.length-I}S(te,"popStack");function wt(){var I;return I=g.pop()||D.lex()||et,typeof I!="number"&&(I instanceof Array&&(g=I,I=g.pop()),I=d.symbols_[I]||I),I}S(wt,"lex");for(var w,z,N,mt,Q={},dt,M,Rt,ft;;){if(z=n[n.length-1],this.defaultActions[z]?N=this.defaultActions[z]:((w===null||typeof w>"u")&&(w=wt()),N=B[z]&&B[z][w]),typeof N>"u"||!N.length||!N[0]){var bt="";ft=[];for(dt in B[z])this.terminals_[dt]&&dt>ut&&ft.push("'"+this.terminals_[dt]+"'");D.showPosition?bt="Parse error on line "+(G+1)+`: +import{g as ee}from"./chunk-XXDRQBXY-BdI3VXTi.js";import{s as se}from"./chunk-KBJHAD2P-C0rklDe7.js";import{a as S,at as b,Y as F,aK as ie,b9 as re,W as ae,aR as ne,V as oe,aQ as le,aT as ce,$ as he,T as ue,x as K,s as de}from"./mermaid.core-DAx4nvmm.js";import{c as fe}from"./chunk-2GRJ4B5K-BNT0kar4.js";import{aG as Dt}from"../../app/index-8JtvDNuA.js";import pe from"../../chunks/purify.es-BnINGy_Y.js";var Ct=function(){var t=S(function(W,l,d,n){for(d=d||{},n=W.length;n--;d[W[n]]=l);return d},"o"),e=[1,2],s=[1,3],a=[1,4],i=[2,4],o=[1,9],h=[1,11],p=[1,16],f=[1,17],T=[1,18],E=[1,19],m=[1,33],R=[1,20],C=[1,21],x=[1,22],$=[1,23],O=[1,24],u=[1,26],L=[1,27],k=[1,28],V=[1,29],P=[1,30],v=[1,31],Y=[1,32],j=[1,35],nt=[1,36],ot=[1,37],lt=[1,38],J=[1,34],y=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],ct=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],Lt=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],gt={trace:S(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:S(function(l,d,n,g,_,r,B){var c=r.length-1;switch(_){case 3:return g.setRootDoc(r[c]),r[c];case 4:this.$=[];break;case 5:r[c]!="nl"&&(r[c-1].push(r[c]),this.$=r[c-1]);break;case 6:case 7:this.$=r[c];break;case 8:this.$="nl";break;case 12:this.$=r[c];break;case 13:const et=r[c-1];et.description=g.trimColon(r[c]),this.$=et;break;case 14:this.$={stmt:"relation",state1:r[c-2],state2:r[c]};break;case 15:const Tt=g.trimColon(r[c]);this.$={stmt:"relation",state1:r[c-3],state2:r[c-1],description:Tt};break;case 19:this.$={stmt:"state",id:r[c-3],type:"default",description:"",doc:r[c-1]};break;case 20:var G=r[c],q=r[c-2].trim();if(r[c].match(":")){var ut=r[c].split(":");G=ut[0],q=[q,ut[1]]}this.$={stmt:"state",id:G,type:"default",description:q};break;case 21:this.$={stmt:"state",id:r[c-3],type:"default",description:r[c-5],doc:r[c-1]};break;case 22:this.$={stmt:"state",id:r[c],type:"fork"};break;case 23:this.$={stmt:"state",id:r[c],type:"join"};break;case 24:this.$={stmt:"state",id:r[c],type:"choice"};break;case 25:this.$={stmt:"state",id:g.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:r[c-1].trim(),note:{position:r[c-2].trim(),text:r[c].trim()}};break;case 29:this.$=r[c].trim(),g.setAccTitle(this.$);break;case 30:case 31:this.$=r[c].trim(),g.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:r[c-3],url:r[c-2],tooltip:r[c-1]};break;case 33:this.$={stmt:"click",id:r[c-3],url:r[c-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:r[c-1].trim(),classes:r[c].trim()};break;case 36:this.$={stmt:"style",id:r[c-1].trim(),styleClass:r[c].trim()};break;case 37:this.$={stmt:"applyClass",id:r[c-1].trim(),styleClass:r[c].trim()};break;case 38:g.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:g.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:g.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:g.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:r[c].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:r[c-2].trim(),classes:[r[c].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:r[c-2].trim(),classes:[r[c].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:s,6:a},{1:[3]},{3:5,4:e,5:s,6:a},{3:6,4:e,5:s,6:a},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:p,17:f,19:T,22:E,24:m,25:R,26:C,27:x,28:$,29:O,32:25,33:u,35:L,37:k,38:V,41:P,45:v,48:Y,51:j,52:nt,53:ot,54:lt,57:J},t(y,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:p,17:f,19:T,22:E,24:m,25:R,26:C,27:x,28:$,29:O,32:25,33:u,35:L,37:k,38:V,41:P,45:v,48:Y,51:j,52:nt,53:ot,54:lt,57:J},t(y,[2,7]),t(y,[2,8]),t(y,[2,9]),t(y,[2,10]),t(y,[2,11]),t(y,[2,12],{14:[1,40],15:[1,41]}),t(y,[2,16]),{18:[1,42]},t(y,[2,18],{20:[1,43]}),{23:[1,44]},t(y,[2,22]),t(y,[2,23]),t(y,[2,24]),t(y,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(y,[2,28]),{34:[1,49]},{36:[1,50]},t(y,[2,31]),{13:51,24:m,57:J},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(ct,[2,44],{58:[1,56]}),t(ct,[2,45],{58:[1,57]}),t(y,[2,38]),t(y,[2,39]),t(y,[2,40]),t(y,[2,41]),t(y,[2,6]),t(y,[2,13]),{13:58,24:m,57:J},t(y,[2,17]),t(Lt,i,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(y,[2,29]),t(y,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(y,[2,14],{14:[1,71]}),{4:o,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:p,17:f,19:T,21:[1,72],22:E,24:m,25:R,26:C,27:x,28:$,29:O,32:25,33:u,35:L,37:k,38:V,41:P,45:v,48:Y,51:j,52:nt,53:ot,54:lt,57:J},t(y,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(y,[2,34]),t(y,[2,35]),t(y,[2,36]),t(y,[2,37]),t(ct,[2,46]),t(ct,[2,47]),t(y,[2,15]),t(y,[2,19]),t(Lt,i,{7:78}),t(y,[2,26]),t(y,[2,27]),{5:[1,79]},{5:[1,80]},{4:o,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:p,17:f,19:T,21:[1,81],22:E,24:m,25:R,26:C,27:x,28:$,29:O,32:25,33:u,35:L,37:k,38:V,41:P,45:v,48:Y,51:j,52:nt,53:ot,54:lt,57:J},t(y,[2,32]),t(y,[2,33]),t(y,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:S(function(l,d){if(d.recoverable)this.trace(l);else{var n=new Error(l);throw n.hash=d,n}},"parseError"),parse:S(function(l){var d=this,n=[0],g=[],_=[null],r=[],B=this.table,c="",G=0,q=0,ut=2,et=1,Tt=r.slice.call(arguments,1),D=Object.create(this.lexer),H={yy:{}};for(var Et in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Et)&&(H.yy[Et]=this.yy[Et]);D.setInput(l,H.yy),H.yy.lexer=D,H.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var _t=D.yylloc;r.push(_t);var Zt=D.options&&D.options.ranges;typeof H.yy.parseError=="function"?this.parseError=H.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function te(I){n.length=n.length-2*I,_.length=_.length-I,r.length=r.length-I}S(te,"popStack");function wt(){var I;return I=g.pop()||D.lex()||et,typeof I!="number"&&(I instanceof Array&&(g=I,I=g.pop()),I=d.symbols_[I]||I),I}S(wt,"lex");for(var w,z,N,mt,Q={},dt,M,Rt,ft;;){if(z=n[n.length-1],this.defaultActions[z]?N=this.defaultActions[z]:((w===null||typeof w>"u")&&(w=wt()),N=B[z]&&B[z][w]),typeof N>"u"||!N.length||!N[0]){var bt="";ft=[];for(dt in B[z])this.terminals_[dt]&&dt>ut&&ft.push("'"+this.terminals_[dt]+"'");D.showPosition?bt="Parse error on line "+(G+1)+`: `+D.showPosition()+` Expecting `+ft.join(", ")+", got '"+(this.terminals_[w]||w)+"'":bt="Parse error on line "+(G+1)+": Unexpected "+(w==et?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(bt,{text:D.match,token:this.terminals_[w]||w,line:D.yylineno,loc:_t,expected:ft})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+z+", token: "+w);switch(N[0]){case 1:n.push(w),_.push(D.yytext),r.push(D.yylloc),n.push(N[1]),w=null,q=D.yyleng,c=D.yytext,G=D.yylineno,_t=D.yylloc;break;case 2:if(M=this.productions_[N[1]][1],Q.$=_[_.length-M],Q._$={first_line:r[r.length-(M||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(M||1)].first_column,last_column:r[r.length-1].last_column},Zt&&(Q._$.range=[r[r.length-(M||1)].range[0],r[r.length-1].range[1]]),mt=this.performAction.apply(Q,[c,q,G,H.yy,N[1],_,r].concat(Tt)),typeof mt<"u")return mt;M&&(n=n.slice(0,-1*M*2),_=_.slice(0,-1*M),r=r.slice(0,-1*M)),n.push(this.productions_[N[1]][0]),_.push(Q.$),r.push(Q._$),Rt=B[n[n.length-2]][n[n.length-1]],n.push(Rt);break;case 3:return!0}}return!0},"parse")},Qt=function(){var W={EOF:1,parseError:S(function(d,n){if(this.yy.parser)this.yy.parser.parseError(d,n);else throw new Error(d)},"parseError"),setInput:S(function(l,d){return this.yy=d||this.yy||{},this._input=l,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:S(function(){var l=this._input[0];this.yytext+=l,this.yyleng++,this.offset++,this.match+=l,this.matched+=l;var d=l.match(/(?:\r\n?|\n).*/g);return d?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),l},"input"),unput:S(function(l){var d=l.length,n=l.split(/(?:\r\n?|\n)/g);this._input=l+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var g=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var _=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===g.length?this.yylloc.first_column:0)+g[g.length-n.length].length-n[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:S(function(){return this._more=!0,this},"more"),reject:S(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:S(function(l){this.unput(this.match.slice(l))},"less"),pastInput:S(function(){var l=this.matched.substr(0,this.matched.length-this.match.length);return(l.length>20?"...":"")+l.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:S(function(){var l=this.match;return l.length<20&&(l+=this._input.substr(0,20-l.length)),(l.substr(0,20)+(l.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:S(function(){var l=this.pastInput(),d=new Array(l.length+1).join("-");return l+this.upcomingInput()+` diff --git a/veadk/webui/assets/visualizations/mermaid/chunk-5VM5RSS4-BDBKcK2Z.js b/veadk/webui/assets/visualizations/mermaid/chunk-5VM5RSS4-BKHSrXIw.js similarity index 83% rename from veadk/webui/assets/visualizations/mermaid/chunk-5VM5RSS4-BDBKcK2Z.js rename to veadk/webui/assets/visualizations/mermaid/chunk-5VM5RSS4-BKHSrXIw.js index 1b8009669..a68a4e641 100644 --- a/veadk/webui/assets/visualizations/mermaid/chunk-5VM5RSS4-BDBKcK2Z.js +++ b/veadk/webui/assets/visualizations/mermaid/chunk-5VM5RSS4-BKHSrXIw.js @@ -1,4 +1,4 @@ -import{a as e}from"./mermaid.core-y4TF8bTw.js";var l=e(()=>` +import{a as e}from"./mermaid.core-DAx4nvmm.js";var l=e(()=>` /* Font Awesome icon styling - consolidated */ .label-icon { display: inline-block; diff --git a/veadk/webui/assets/visualizations/mermaid/chunk-6Q2QTUOP-zEQK1XLO.js b/veadk/webui/assets/visualizations/mermaid/chunk-6Q2QTUOP-N9gzANAs.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/chunk-6Q2QTUOP-zEQK1XLO.js rename to veadk/webui/assets/visualizations/mermaid/chunk-6Q2QTUOP-N9gzANAs.js index cbfb60c34..39ec06e7a 100644 --- a/veadk/webui/assets/visualizations/mermaid/chunk-6Q2QTUOP-zEQK1XLO.js +++ b/veadk/webui/assets/visualizations/mermaid/chunk-6Q2QTUOP-N9gzANAs.js @@ -1,4 +1,4 @@ -import{a as p,at as k,aP as H,X as _,s as q,a8 as G,B as U,aN as j,Y as K}from"./mermaid.core-y4TF8bTw.js";var A="",M="",O="",D=[],b=new Map,v=p(e=>j(e,K()),"sanitizeText"),y=p(e=>{switch(e.type){case"terminal":return{...e,value:v(e.value)};case"nonterminal":return{...e,name:v(e.name)};case"sequence":return{...e,elements:e.elements.map(y)};case"choice":return{...e,alternatives:e.alternatives.map(y)};case"optional":return{...e,element:y(e.element)};case"repetition":return{...e,element:y(e.element),separator:e.separator?y(e.separator):void 0};case"special":return{...e,text:v(e.text)}}},"sanitizeAstNode"),J=p(()=>{A="",M="",O="",D.length=0,b.clear(),q(),k.debug("[Railroad] Database cleared")},"clear"),Y=p(e=>{A=v(e),k.debug("[Railroad] Title set:",e)},"setTitle"),P=p(()=>A,"getTitle"),Q=p(e=>{const i={...e,name:v(e.name),definition:y(e.definition),comment:e.comment?v(e.comment):void 0};k.debug("[Railroad] Adding rule:",i.name),b.has(i.name)&&k.warn(`[Railroad] Rule '${i.name}' is already defined. Overwriting.`),D.push(i),b.set(i.name,i)},"addRule"),Z=p(()=>D,"getRules"),V=p(e=>b.get(e),"getRule"),ee=p(e=>{M=v(e).replace(/^\s+/g,""),k.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),te=p(()=>M,"getAccTitle"),re=p(e=>{O=v(e).replace(/\n\s+/g,` +import{a as p,at as k,aP as H,X as _,s as q,a8 as G,B as U,aN as j,Y as K}from"./mermaid.core-DAx4nvmm.js";var A="",M="",O="",D=[],b=new Map,v=p(e=>j(e,K()),"sanitizeText"),y=p(e=>{switch(e.type){case"terminal":return{...e,value:v(e.value)};case"nonterminal":return{...e,name:v(e.name)};case"sequence":return{...e,elements:e.elements.map(y)};case"choice":return{...e,alternatives:e.alternatives.map(y)};case"optional":return{...e,element:y(e.element)};case"repetition":return{...e,element:y(e.element),separator:e.separator?y(e.separator):void 0};case"special":return{...e,text:v(e.text)}}},"sanitizeAstNode"),J=p(()=>{A="",M="",O="",D.length=0,b.clear(),q(),k.debug("[Railroad] Database cleared")},"clear"),Y=p(e=>{A=v(e),k.debug("[Railroad] Title set:",e)},"setTitle"),P=p(()=>A,"getTitle"),Q=p(e=>{const i={...e,name:v(e.name),definition:y(e.definition),comment:e.comment?v(e.comment):void 0};k.debug("[Railroad] Adding rule:",i.name),b.has(i.name)&&k.warn(`[Railroad] Rule '${i.name}' is already defined. Overwriting.`),D.push(i),b.set(i.name,i)},"addRule"),Z=p(()=>D,"getRules"),V=p(e=>b.get(e),"getRule"),ee=p(e=>{M=v(e).replace(/^\s+/g,""),k.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),te=p(()=>M,"getAccTitle"),re=p(e=>{O=v(e).replace(/\n\s+/g,` `),k.debug("[Railroad] Accessibility description set:",e)},"setAccDescription"),ie=p(()=>O,"getAccDescription"),ae=Y,ne=P,oe={clear:J,setTitle:Y,getTitle:P,addRule:Q,getRules:Z,getRule:V,setAccTitle:ee,getAccTitle:te,setAccDescription:re,getAccDescription:ie,setDiagramTitle:ae,getDiagramTitle:ne},f={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},le=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,se=/^[\w "',.-]+$/,de=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),L=p(e=>e?Object.keys(e).every(i=>i==="railroad"||de.has(i)):!1,"isRailroadStyleOptions"),ce=p(e=>e?"railroad"in e&&e.railroad?e.railroad:L(e)?e:{}:{},"extractRailroadOverrides"),me=p(e=>{if(!e||L(e))return{};const{railroad:i,svgId:n,theme:a,look:t,...r}=e;return r},"extractThemeOverrides"),m=p((e,i)=>{if(typeof e!="string")return i;const n=e.trim();return le.test(n)?n:i},"sanitizeColorValue"),X=p((e,i)=>{if(typeof e!="string")return i;const n=e.trim();return se.test(n)?n:i},"sanitizeFontFamilyValue"),F=p((e,i)=>{const n=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(n)&&n>=0?n:i},"sanitizeNumberValue"),he=p(e=>{const i=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(i)&&i>0?i:void 0},"parseThemeFontSize"),pe=p(e=>{const i=X(e.fontFamily,f.fontFamily),n=he(e.fontSize)??f.fontSize;return{...f,fontFamily:i,fontSize:n,terminalFill:m(e.secondBkg??e.secondaryColor,f.terminalFill),terminalStroke:m(e.secondaryBorderColor??e.lineColor,f.terminalStroke),terminalTextColor:m(e.secondaryTextColor??e.textColor,f.terminalTextColor),nonTerminalFill:m(e.mainBkg??e.background,f.nonTerminalFill),nonTerminalStroke:m(e.primaryBorderColor??e.lineColor,f.nonTerminalStroke),nonTerminalTextColor:m(e.primaryTextColor??e.textColor,f.nonTerminalTextColor),lineColor:m(e.lineColor,f.lineColor),markerFill:m(e.lineColor,f.markerFill),commentFill:m(e.labelBackground??e.tertiaryColor,f.commentFill),commentStroke:m(e.tertiaryBorderColor??e.lineColor,f.commentStroke),commentTextColor:m(e.tertiaryTextColor??e.textColor,f.commentTextColor),specialFill:m(e.tertiaryColor??e.secondaryColor,f.specialFill),specialStroke:m(e.tertiaryBorderColor??e.secondaryBorderColor,f.specialStroke),ruleNameColor:m(e.titleColor??e.textColor,f.ruleNameColor)}},"buildThemeDefaults"),E=p(e=>{const i=_(),n={...G(),...i.themeVariables??{},...me(e)},a=pe(n),t={...i.railroad??{},...ce(e)};return{compactMode:t.compactMode??a.compactMode,padding:F(t.padding,a.padding),verticalSeparation:F(t.verticalSeparation,a.verticalSeparation),horizontalSeparation:F(t.horizontalSeparation,a.horizontalSeparation),arcRadius:F(t.arcRadius,a.arcRadius),fontSize:F(t.fontSize,a.fontSize),fontFamily:X(t.fontFamily,a.fontFamily),terminalFill:m(t.terminalFill,a.terminalFill),terminalStroke:m(t.terminalStroke,a.terminalStroke),terminalTextColor:m(t.terminalTextColor,a.terminalTextColor),nonTerminalFill:m(t.nonTerminalFill,a.nonTerminalFill),nonTerminalStroke:m(t.nonTerminalStroke,a.nonTerminalStroke),nonTerminalTextColor:m(t.nonTerminalTextColor,a.nonTerminalTextColor),lineColor:m(t.lineColor,a.lineColor),strokeWidth:F(t.strokeWidth,a.strokeWidth),markerFill:m(t.markerFill,a.markerFill),commentFill:m(t.commentFill,a.commentFill),commentStroke:m(t.commentStroke,a.commentStroke),commentTextColor:m(t.commentTextColor,a.commentTextColor),specialFill:m(t.specialFill,a.specialFill),specialStroke:m(t.specialStroke,a.specialStroke),ruleNameColor:m(t.ruleNameColor,a.ruleNameColor),showMarkers:t.showMarkers??a.showMarkers,markerRadius:F(t.markerRadius,a.markerRadius)}},"buildRailroadStyleOptions"),Te=p(e=>{const{fontFamily:i,fontSize:n,terminalFill:a,terminalStroke:t,terminalTextColor:r,nonTerminalFill:o,nonTerminalStroke:g,nonTerminalTextColor:l,lineColor:s,strokeWidth:h,markerFill:u,commentFill:c,commentStroke:w,commentTextColor:d,specialFill:T,specialStroke:z,ruleNameColor:S}=E(e);return` .railroad-diagram { font-family: ${i}; diff --git a/veadk/webui/assets/visualizations/mermaid/chunk-GF5L2VYU-Cv1ZgaH8.js b/veadk/webui/assets/visualizations/mermaid/chunk-GF5L2VYU-IG64zwph.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/chunk-GF5L2VYU-Cv1ZgaH8.js rename to veadk/webui/assets/visualizations/mermaid/chunk-GF5L2VYU-IG64zwph.js index 3a54df705..34f7982f1 100644 --- a/veadk/webui/assets/visualizations/mermaid/chunk-GF5L2VYU-Cv1ZgaH8.js +++ b/veadk/webui/assets/visualizations/mermaid/chunk-GF5L2VYU-IG64zwph.js @@ -1,4 +1,4 @@ -import{g as st}from"./chunk-5VM5RSS4-BDBKcK2Z.js";import{g as it}from"./chunk-XXDRQBXY-B8qTF1qQ.js";import{s as at}from"./chunk-KBJHAD2P-DtNDDRN1.js";import{a as m,at as we,Y as F,a4 as rt,aK as nt,b9 as Ve,aR as ut,W as lt,aQ as ct,V as ot,aT as ht,$ as dt,x as I,s as pt,a0 as At,aN as ft,aD as z}from"./mermaid.core-y4TF8bTw.js";import{c as mt}from"./chunk-2GRJ4B5K-CvII-2ZL.js";import{aG as fe}from"../../app/index-BNPwMQXG.js";import gt from"../../chunks/purify.es-BnINGy_Y.js";var Pe=function(){var s=m(function(O,o,d,p){for(d=d||{},p=O.length;p--;d[O[p]]=o);return d},"o"),i=[1,18],a=[1,19],r=[1,20],n=[1,41],u=[1,26],h=[1,42],f=[1,24],c=[1,25],g=[1,32],B=[1,33],R=[1,34],b=[1,45],ge=[1,35],Ce=[1,36],be=[1,37],ke=[1,38],Ee=[1,27],Te=[1,28],ye=[1,29],De=[1,30],Fe=[1,31],k=[1,44],E=[1,46],T=[1,43],y=[1,47],Be=[1,9],A=[1,8,9],te=[1,58],se=[1,59],ie=[1,60],ae=[1,61],re=[1,62],_e=[1,63],Se=[1,64],S=[1,8,9,41],Me=[1,77],G=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],ne=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],ue=[13,60,86,100,102,103],K=[13,60,73,74,86,100,102,103],Re=[13,60,68,69,70,71,72,86,100,102,103],le=[1,103],W=[1,121],Q=[1,117],j=[1,113],X=[1,119],q=[1,114],H=[1,115],J=[1,116],Z=[1,118],$=[1,120],Ge=[22,50,60,61,82,86,87,88,89,90],Ue=[1,128],ce=[12,39],Ne=[1,8,9,39,41,44,46],oe=[1,8,9,22],ze=[1,153],Ye=[1,8,9,61],x=[1,8,9,22,50,60,61,82,86,87,88,89,90],Le={trace:m(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:m(function(o,d,p,l,C,e,ee){var t=e.length-1;switch(C){case 8:this.$=e[t-1];break;case 9:case 10:case 13:case 15:this.$=e[t];break;case 11:case 14:this.$=e[t-2]+"."+e[t];break;case 12:case 16:this.$=e[t-1]+e[t];break;case 17:case 18:this.$=e[t-1]+"~"+e[t]+"~";break;case 19:l.addRelation(e[t]);break;case 20:e[t-1].title=l.cleanupLabel(e[t]),l.addRelation(e[t-1]);break;case 31:this.$=e[t].trim(),l.setAccTitle(this.$);break;case 32:case 33:this.$=e[t].trim(),l.setAccDescription(this.$);break;case 34:l.addClassesToNamespace(e[t-3],e[t-1][0],e[t-1][1]),l.popNamespace();break;case 35:l.addClassesToNamespace(e[t-4],e[t-1][0],e[t-1][1]),l.popNamespace();break;case 36:this.$=l.addNamespace(e[t]);break;case 37:this.$=l.addNamespace(e[t-1],e[t]);break;case 38:this.$=[[e[t]],[]];break;case 39:this.$=[[e[t-1]],[]];break;case 40:e[t][0].unshift(e[t-2]),this.$=e[t];break;case 41:this.$=[[],[e[t]]];break;case 42:this.$=[[],[e[t-1]]];break;case 43:e[t][1].unshift(e[t-2]),this.$=e[t];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=e[t];break;case 48:l.setCssClass(e[t-2],e[t]);break;case 49:l.addMembers(e[t-3],e[t-1]);break;case 51:l.setCssClass(e[t-5],e[t-3]),l.addMembers(e[t-5],e[t-1]);break;case 52:l.addAnnotation(e[t-3],e[t-1]);break;case 53:l.addAnnotation(e[t-6],e[t-4]),l.addMembers(e[t-6],e[t-1]);break;case 54:l.addAnnotation(e[t-5],e[t-3]);break;case 55:this.$=e[t],l.addClass(e[t]);break;case 56:this.$=e[t-1],l.addClass(e[t-1]),l.setClassLabel(e[t-1],e[t]);break;case 60:l.addAnnotation(e[t],e[t-2]);break;case 61:case 74:this.$=[e[t]];break;case 62:e[t].push(e[t-1]),this.$=e[t];break;case 63:break;case 64:l.addMember(e[t-1],l.cleanupLabel(e[t]));break;case 65:break;case 66:break;case 67:this.$={id1:e[t-2],id2:e[t],relation:e[t-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:e[t-3],id2:e[t],relation:e[t-1],relationTitle1:e[t-2],relationTitle2:"none"};break;case 69:this.$={id1:e[t-3],id2:e[t],relation:e[t-2],relationTitle1:"none",relationTitle2:e[t-1]};break;case 70:this.$={id1:e[t-4],id2:e[t],relation:e[t-2],relationTitle1:e[t-3],relationTitle2:e[t-1]};break;case 71:this.$=l.addNote(e[t],e[t-1]);break;case 72:this.$=l.addNote(e[t]);break;case 73:this.$=e[t-2],l.defineClass(e[t-1],e[t]);break;case 75:this.$=e[t-2].concat([e[t]]);break;case 76:l.setDirection("TB");break;case 77:l.setDirection("BT");break;case 78:l.setDirection("RL");break;case 79:l.setDirection("LR");break;case 80:this.$={type1:e[t-2],type2:e[t],lineType:e[t-1]};break;case 81:this.$={type1:"none",type2:e[t],lineType:e[t-1]};break;case 82:this.$={type1:e[t-1],type2:"none",lineType:e[t]};break;case 83:this.$={type1:"none",type2:"none",lineType:e[t]};break;case 84:this.$=l.relationType.AGGREGATION;break;case 85:this.$=l.relationType.EXTENSION;break;case 86:this.$=l.relationType.COMPOSITION;break;case 87:this.$=l.relationType.DEPENDENCY;break;case 88:this.$=l.relationType.LOLLIPOP;break;case 89:this.$=l.lineType.LINE;break;case 90:this.$=l.lineType.DOTTED_LINE;break;case 91:case 97:this.$=e[t-2],l.setClickEvent(e[t-1],e[t]);break;case 92:case 98:this.$=e[t-3],l.setClickEvent(e[t-2],e[t-1]),l.setTooltip(e[t-2],e[t]);break;case 93:this.$=e[t-2],l.setLink(e[t-1],e[t]);break;case 94:this.$=e[t-3],l.setLink(e[t-2],e[t-1],e[t]);break;case 95:this.$=e[t-3],l.setLink(e[t-2],e[t-1]),l.setTooltip(e[t-2],e[t]);break;case 96:this.$=e[t-4],l.setLink(e[t-3],e[t-2],e[t]),l.setTooltip(e[t-3],e[t-1]);break;case 99:this.$=e[t-3],l.setClickEvent(e[t-2],e[t-1],e[t]);break;case 100:this.$=e[t-4],l.setClickEvent(e[t-3],e[t-2],e[t-1]),l.setTooltip(e[t-3],e[t]);break;case 101:this.$=e[t-3],l.setLink(e[t-2],e[t]);break;case 102:this.$=e[t-4],l.setLink(e[t-3],e[t-1],e[t]);break;case 103:this.$=e[t-4],l.setLink(e[t-3],e[t-1]),l.setTooltip(e[t-3],e[t]);break;case 104:this.$=e[t-5],l.setLink(e[t-4],e[t-2],e[t]),l.setTooltip(e[t-4],e[t-1]);break;case 105:this.$=e[t-2],l.setCssStyle(e[t-1],e[t]);break;case 106:l.setCssClass(e[t-1],e[t]);break;case 107:this.$=[e[t]];break;case 108:e[t-2].push(e[t]),this.$=e[t-2];break;case 110:this.$=e[t-1]+e[t];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:r,38:22,42:n,43:23,46:u,48:h,51:f,52:c,54:g,56:B,57:R,60:b,62:ge,63:Ce,64:be,65:ke,75:Ee,76:Te,78:ye,82:De,83:Fe,86:k,100:E,102:T,103:y},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},s(Be,[2,5],{8:[1,48]}),{8:[1,49]},s(A,[2,19],{22:[1,50]}),s(A,[2,21]),s(A,[2,22]),s(A,[2,23]),s(A,[2,24]),s(A,[2,25]),s(A,[2,26]),s(A,[2,27]),s(A,[2,28]),s(A,[2,29]),s(A,[2,30]),{34:[1,51]},{36:[1,52]},s(A,[2,33]),s(A,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:te,69:se,70:ie,71:ae,72:re,73:_e,74:Se}),{39:[1,65]},s(S,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),s(A,[2,65]),s(A,[2,66]),{16:69,60:b,86:k,100:E,102:T},{16:39,17:40,19:70,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:71,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:72,60:b,86:k,100:E,102:T,103:y},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:b,86:k,100:E,102:T,103:y},{13:Me,55:76},{58:78,60:[1,79]},s(A,[2,76]),s(A,[2,77]),s(A,[2,78]),s(A,[2,79]),s(G,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:b,86:k,100:E,102:T,103:y}),s(G,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:87,60:b,86:k,100:E,102:T,103:y},s(ne,[2,133]),s(ne,[2,134]),s(ne,[2,135]),s(ne,[2,136]),s([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),s(Be,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:i,35:a,37:r,42:n,46:u,48:h,51:f,52:c,54:g,56:B,57:R,60:b,62:ge,63:Ce,64:be,65:ke,75:Ee,76:Te,78:ye,82:De,83:Fe,86:k,100:E,102:T,103:y}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:r,38:22,42:n,43:23,46:u,48:h,51:f,52:c,54:g,56:B,57:R,60:b,62:ge,63:Ce,64:be,65:ke,75:Ee,76:Te,78:ye,82:De,83:Fe,86:k,100:E,102:T,103:y},s(A,[2,20]),s(A,[2,31]),s(A,[2,32]),{13:[1,91],16:39,17:40,19:90,60:b,86:k,100:E,102:T,103:y},{53:92,66:56,67:57,68:te,69:se,70:ie,71:ae,72:re,73:_e,74:Se},s(A,[2,64]),{67:93,73:_e,74:Se},s(ue,[2,83],{66:94,68:te,69:se,70:ie,71:ae,72:re}),s(K,[2,84]),s(K,[2,85]),s(K,[2,86]),s(K,[2,87]),s(K,[2,88]),s(Re,[2,89]),s(Re,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:n,43:23,48:h,54:g,56:B},{16:100,60:b,86:k,100:E,102:T},{41:[1,102],45:101,51:le},{16:104,60:b,86:k,100:E,102:T},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:W,50:Q,59:110,60:j,82:X,84:111,85:112,86:q,87:H,88:J,89:Z,90:$},{60:[1,122]},{13:Me,55:123},s(S,[2,72]),s(S,[2,138]),{22:W,50:Q,59:124,60:j,61:[1,125],82:X,84:111,85:112,86:q,87:H,88:J,89:Z,90:$},s(Ge,[2,74]),{16:39,17:40,19:126,60:b,86:k,100:E,102:T,103:y},s(G,[2,16]),s(G,[2,17]),s(G,[2,18]),{11:127,12:Ue,39:[2,36]},s(ce,[2,9],{16:85,17:86,15:130,18:[1,129],60:b,86:k,100:E,102:T,103:y}),s(ce,[2,10]),s(Ne,[2,55],{11:131,12:Ue}),s(Be,[2,7]),{9:[1,132]},s(oe,[2,67]),{16:39,17:40,19:133,60:b,86:k,100:E,102:T,103:y},{13:[1,135],16:39,17:40,19:134,60:b,86:k,100:E,102:T,103:y},s(ue,[2,82],{66:136,68:te,69:se,70:ie,71:ae,72:re}),s(ue,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:n,43:23,48:h,54:g,56:B},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},s(S,[2,48],{39:[1,142]}),{41:[1,143]},s(S,[2,50]),{41:[2,61],45:144,51:le},{47:[1,145]},{16:39,17:40,19:146,60:b,86:k,100:E,102:T,103:y},s(A,[2,91],{13:[1,147]}),s(A,[2,93],{13:[1,149],77:[1,148]}),s(A,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},s(A,[2,105],{61:ze}),s(Ye,[2,107],{85:154,22:W,50:Q,60:j,82:X,86:q,87:H,88:J,89:Z,90:$}),s(x,[2,109]),s(x,[2,111]),s(x,[2,112]),s(x,[2,113]),s(x,[2,114]),s(x,[2,115]),s(x,[2,116]),s(x,[2,117]),s(x,[2,118]),s(x,[2,119]),s(A,[2,106]),s(S,[2,71]),s(A,[2,73],{61:ze}),{60:[1,155]},s(G,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:b,86:k,100:E,102:T,103:y},s(ce,[2,12]),s(Ne,[2,56]),{1:[2,4]},s(oe,[2,69]),s(oe,[2,68]),{16:39,17:40,19:158,60:b,86:k,100:E,102:T,103:y},s(ue,[2,80]),s(S,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:n,43:23,48:h,54:g,56:B},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:n,43:23,48:h,54:g,56:B},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:n,43:23,48:h,54:g,56:B},{45:163,51:le},s(S,[2,49]),{41:[2,62]},s(S,[2,52],{39:[1,164]}),s(A,[2,60]),s(A,[2,92]),s(A,[2,94]),s(A,[2,95],{77:[1,165]}),s(A,[2,98]),s(A,[2,99],{13:[1,166]}),s(A,[2,101],{13:[1,168],77:[1,167]}),{22:W,50:Q,60:j,82:X,84:169,85:112,86:q,87:H,88:J,89:Z,90:$},s(x,[2,110]),s(Ge,[2,75]),{14:[1,170]},s(ce,[2,11]),s(oe,[2,70]),s(S,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:le},s(A,[2,96]),s(A,[2,100]),s(A,[2,102]),s(A,[2,103],{77:[1,174]}),s(Ye,[2,108],{85:154,22:W,50:Q,60:j,82:X,86:q,87:H,88:J,89:Z,90:$}),s(Ne,[2,8]),s(S,[2,51]),{41:[1,175]},s(S,[2,54]),s(A,[2,104]),s(S,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:m(function(o,d){if(d.recoverable)this.trace(o);else{var p=new Error(o);throw p.hash=d,p}},"parseError"),parse:m(function(o){var d=this,p=[0],l=[],C=[null],e=[],ee=this.table,t="",de=0,Ke=0,Ze=2,We=1,$e=e.slice.call(arguments,1),D=Object.create(this.lexer),V={yy:{}};for(var xe in this.yy)Object.prototype.hasOwnProperty.call(this.yy,xe)&&(V.yy[xe]=this.yy[xe]);D.setInput(o,V.yy),V.yy.lexer=D,V.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var ve=D.yylloc;e.push(ve);var et=D.options&&D.options.ranges;typeof V.yy.parseError=="function"?this.parseError=V.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function tt(N){p.length=p.length-2*N,C.length=C.length-N,e.length=e.length-N}m(tt,"popStack");function Qe(){var N;return N=l.pop()||D.lex()||We,typeof N!="number"&&(N instanceof Array&&(l=N,N=l.pop()),N=d.symbols_[N]||N),N}m(Qe,"lex");for(var _,P,L,Ie,U={},pe,v,je,Ae;;){if(P=p[p.length-1],this.defaultActions[P]?L=this.defaultActions[P]:((_===null||typeof _>"u")&&(_=Qe()),L=ee[P]&&ee[P][_]),typeof L>"u"||!L.length||!L[0]){var Oe="";Ae=[];for(pe in ee[P])this.terminals_[pe]&&pe>Ze&&Ae.push("'"+this.terminals_[pe]+"'");D.showPosition?Oe="Parse error on line "+(de+1)+`: +import{g as st}from"./chunk-5VM5RSS4-BKHSrXIw.js";import{g as it}from"./chunk-XXDRQBXY-BdI3VXTi.js";import{s as at}from"./chunk-KBJHAD2P-C0rklDe7.js";import{a as m,at as we,Y as F,a4 as rt,aK as nt,b9 as Ve,aR as ut,W as lt,aQ as ct,V as ot,aT as ht,$ as dt,x as I,s as pt,a0 as At,aN as ft,aD as z}from"./mermaid.core-DAx4nvmm.js";import{c as mt}from"./chunk-2GRJ4B5K-BNT0kar4.js";import{aG as fe}from"../../app/index-8JtvDNuA.js";import gt from"../../chunks/purify.es-BnINGy_Y.js";var Pe=function(){var s=m(function(O,o,d,p){for(d=d||{},p=O.length;p--;d[O[p]]=o);return d},"o"),i=[1,18],a=[1,19],r=[1,20],n=[1,41],u=[1,26],h=[1,42],f=[1,24],c=[1,25],g=[1,32],B=[1,33],R=[1,34],b=[1,45],ge=[1,35],Ce=[1,36],be=[1,37],ke=[1,38],Ee=[1,27],Te=[1,28],ye=[1,29],De=[1,30],Fe=[1,31],k=[1,44],E=[1,46],T=[1,43],y=[1,47],Be=[1,9],A=[1,8,9],te=[1,58],se=[1,59],ie=[1,60],ae=[1,61],re=[1,62],_e=[1,63],Se=[1,64],S=[1,8,9,41],Me=[1,77],G=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],ne=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],ue=[13,60,86,100,102,103],K=[13,60,73,74,86,100,102,103],Re=[13,60,68,69,70,71,72,86,100,102,103],le=[1,103],W=[1,121],Q=[1,117],j=[1,113],X=[1,119],q=[1,114],H=[1,115],J=[1,116],Z=[1,118],$=[1,120],Ge=[22,50,60,61,82,86,87,88,89,90],Ue=[1,128],ce=[12,39],Ne=[1,8,9,39,41,44,46],oe=[1,8,9,22],ze=[1,153],Ye=[1,8,9,61],x=[1,8,9,22,50,60,61,82,86,87,88,89,90],Le={trace:m(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:m(function(o,d,p,l,C,e,ee){var t=e.length-1;switch(C){case 8:this.$=e[t-1];break;case 9:case 10:case 13:case 15:this.$=e[t];break;case 11:case 14:this.$=e[t-2]+"."+e[t];break;case 12:case 16:this.$=e[t-1]+e[t];break;case 17:case 18:this.$=e[t-1]+"~"+e[t]+"~";break;case 19:l.addRelation(e[t]);break;case 20:e[t-1].title=l.cleanupLabel(e[t]),l.addRelation(e[t-1]);break;case 31:this.$=e[t].trim(),l.setAccTitle(this.$);break;case 32:case 33:this.$=e[t].trim(),l.setAccDescription(this.$);break;case 34:l.addClassesToNamespace(e[t-3],e[t-1][0],e[t-1][1]),l.popNamespace();break;case 35:l.addClassesToNamespace(e[t-4],e[t-1][0],e[t-1][1]),l.popNamespace();break;case 36:this.$=l.addNamespace(e[t]);break;case 37:this.$=l.addNamespace(e[t-1],e[t]);break;case 38:this.$=[[e[t]],[]];break;case 39:this.$=[[e[t-1]],[]];break;case 40:e[t][0].unshift(e[t-2]),this.$=e[t];break;case 41:this.$=[[],[e[t]]];break;case 42:this.$=[[],[e[t-1]]];break;case 43:e[t][1].unshift(e[t-2]),this.$=e[t];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=e[t];break;case 48:l.setCssClass(e[t-2],e[t]);break;case 49:l.addMembers(e[t-3],e[t-1]);break;case 51:l.setCssClass(e[t-5],e[t-3]),l.addMembers(e[t-5],e[t-1]);break;case 52:l.addAnnotation(e[t-3],e[t-1]);break;case 53:l.addAnnotation(e[t-6],e[t-4]),l.addMembers(e[t-6],e[t-1]);break;case 54:l.addAnnotation(e[t-5],e[t-3]);break;case 55:this.$=e[t],l.addClass(e[t]);break;case 56:this.$=e[t-1],l.addClass(e[t-1]),l.setClassLabel(e[t-1],e[t]);break;case 60:l.addAnnotation(e[t],e[t-2]);break;case 61:case 74:this.$=[e[t]];break;case 62:e[t].push(e[t-1]),this.$=e[t];break;case 63:break;case 64:l.addMember(e[t-1],l.cleanupLabel(e[t]));break;case 65:break;case 66:break;case 67:this.$={id1:e[t-2],id2:e[t],relation:e[t-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:e[t-3],id2:e[t],relation:e[t-1],relationTitle1:e[t-2],relationTitle2:"none"};break;case 69:this.$={id1:e[t-3],id2:e[t],relation:e[t-2],relationTitle1:"none",relationTitle2:e[t-1]};break;case 70:this.$={id1:e[t-4],id2:e[t],relation:e[t-2],relationTitle1:e[t-3],relationTitle2:e[t-1]};break;case 71:this.$=l.addNote(e[t],e[t-1]);break;case 72:this.$=l.addNote(e[t]);break;case 73:this.$=e[t-2],l.defineClass(e[t-1],e[t]);break;case 75:this.$=e[t-2].concat([e[t]]);break;case 76:l.setDirection("TB");break;case 77:l.setDirection("BT");break;case 78:l.setDirection("RL");break;case 79:l.setDirection("LR");break;case 80:this.$={type1:e[t-2],type2:e[t],lineType:e[t-1]};break;case 81:this.$={type1:"none",type2:e[t],lineType:e[t-1]};break;case 82:this.$={type1:e[t-1],type2:"none",lineType:e[t]};break;case 83:this.$={type1:"none",type2:"none",lineType:e[t]};break;case 84:this.$=l.relationType.AGGREGATION;break;case 85:this.$=l.relationType.EXTENSION;break;case 86:this.$=l.relationType.COMPOSITION;break;case 87:this.$=l.relationType.DEPENDENCY;break;case 88:this.$=l.relationType.LOLLIPOP;break;case 89:this.$=l.lineType.LINE;break;case 90:this.$=l.lineType.DOTTED_LINE;break;case 91:case 97:this.$=e[t-2],l.setClickEvent(e[t-1],e[t]);break;case 92:case 98:this.$=e[t-3],l.setClickEvent(e[t-2],e[t-1]),l.setTooltip(e[t-2],e[t]);break;case 93:this.$=e[t-2],l.setLink(e[t-1],e[t]);break;case 94:this.$=e[t-3],l.setLink(e[t-2],e[t-1],e[t]);break;case 95:this.$=e[t-3],l.setLink(e[t-2],e[t-1]),l.setTooltip(e[t-2],e[t]);break;case 96:this.$=e[t-4],l.setLink(e[t-3],e[t-2],e[t]),l.setTooltip(e[t-3],e[t-1]);break;case 99:this.$=e[t-3],l.setClickEvent(e[t-2],e[t-1],e[t]);break;case 100:this.$=e[t-4],l.setClickEvent(e[t-3],e[t-2],e[t-1]),l.setTooltip(e[t-3],e[t]);break;case 101:this.$=e[t-3],l.setLink(e[t-2],e[t]);break;case 102:this.$=e[t-4],l.setLink(e[t-3],e[t-1],e[t]);break;case 103:this.$=e[t-4],l.setLink(e[t-3],e[t-1]),l.setTooltip(e[t-3],e[t]);break;case 104:this.$=e[t-5],l.setLink(e[t-4],e[t-2],e[t]),l.setTooltip(e[t-4],e[t-1]);break;case 105:this.$=e[t-2],l.setCssStyle(e[t-1],e[t]);break;case 106:l.setCssClass(e[t-1],e[t]);break;case 107:this.$=[e[t]];break;case 108:e[t-2].push(e[t]),this.$=e[t-2];break;case 110:this.$=e[t-1]+e[t];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:r,38:22,42:n,43:23,46:u,48:h,51:f,52:c,54:g,56:B,57:R,60:b,62:ge,63:Ce,64:be,65:ke,75:Ee,76:Te,78:ye,82:De,83:Fe,86:k,100:E,102:T,103:y},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},s(Be,[2,5],{8:[1,48]}),{8:[1,49]},s(A,[2,19],{22:[1,50]}),s(A,[2,21]),s(A,[2,22]),s(A,[2,23]),s(A,[2,24]),s(A,[2,25]),s(A,[2,26]),s(A,[2,27]),s(A,[2,28]),s(A,[2,29]),s(A,[2,30]),{34:[1,51]},{36:[1,52]},s(A,[2,33]),s(A,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:te,69:se,70:ie,71:ae,72:re,73:_e,74:Se}),{39:[1,65]},s(S,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),s(A,[2,65]),s(A,[2,66]),{16:69,60:b,86:k,100:E,102:T},{16:39,17:40,19:70,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:71,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:72,60:b,86:k,100:E,102:T,103:y},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:b,86:k,100:E,102:T,103:y},{13:Me,55:76},{58:78,60:[1,79]},s(A,[2,76]),s(A,[2,77]),s(A,[2,78]),s(A,[2,79]),s(G,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:b,86:k,100:E,102:T,103:y}),s(G,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:87,60:b,86:k,100:E,102:T,103:y},s(ne,[2,133]),s(ne,[2,134]),s(ne,[2,135]),s(ne,[2,136]),s([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),s(Be,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:i,35:a,37:r,42:n,46:u,48:h,51:f,52:c,54:g,56:B,57:R,60:b,62:ge,63:Ce,64:be,65:ke,75:Ee,76:Te,78:ye,82:De,83:Fe,86:k,100:E,102:T,103:y}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:r,38:22,42:n,43:23,46:u,48:h,51:f,52:c,54:g,56:B,57:R,60:b,62:ge,63:Ce,64:be,65:ke,75:Ee,76:Te,78:ye,82:De,83:Fe,86:k,100:E,102:T,103:y},s(A,[2,20]),s(A,[2,31]),s(A,[2,32]),{13:[1,91],16:39,17:40,19:90,60:b,86:k,100:E,102:T,103:y},{53:92,66:56,67:57,68:te,69:se,70:ie,71:ae,72:re,73:_e,74:Se},s(A,[2,64]),{67:93,73:_e,74:Se},s(ue,[2,83],{66:94,68:te,69:se,70:ie,71:ae,72:re}),s(K,[2,84]),s(K,[2,85]),s(K,[2,86]),s(K,[2,87]),s(K,[2,88]),s(Re,[2,89]),s(Re,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:n,43:23,48:h,54:g,56:B},{16:100,60:b,86:k,100:E,102:T},{41:[1,102],45:101,51:le},{16:104,60:b,86:k,100:E,102:T},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:W,50:Q,59:110,60:j,82:X,84:111,85:112,86:q,87:H,88:J,89:Z,90:$},{60:[1,122]},{13:Me,55:123},s(S,[2,72]),s(S,[2,138]),{22:W,50:Q,59:124,60:j,61:[1,125],82:X,84:111,85:112,86:q,87:H,88:J,89:Z,90:$},s(Ge,[2,74]),{16:39,17:40,19:126,60:b,86:k,100:E,102:T,103:y},s(G,[2,16]),s(G,[2,17]),s(G,[2,18]),{11:127,12:Ue,39:[2,36]},s(ce,[2,9],{16:85,17:86,15:130,18:[1,129],60:b,86:k,100:E,102:T,103:y}),s(ce,[2,10]),s(Ne,[2,55],{11:131,12:Ue}),s(Be,[2,7]),{9:[1,132]},s(oe,[2,67]),{16:39,17:40,19:133,60:b,86:k,100:E,102:T,103:y},{13:[1,135],16:39,17:40,19:134,60:b,86:k,100:E,102:T,103:y},s(ue,[2,82],{66:136,68:te,69:se,70:ie,71:ae,72:re}),s(ue,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:n,43:23,48:h,54:g,56:B},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},s(S,[2,48],{39:[1,142]}),{41:[1,143]},s(S,[2,50]),{41:[2,61],45:144,51:le},{47:[1,145]},{16:39,17:40,19:146,60:b,86:k,100:E,102:T,103:y},s(A,[2,91],{13:[1,147]}),s(A,[2,93],{13:[1,149],77:[1,148]}),s(A,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},s(A,[2,105],{61:ze}),s(Ye,[2,107],{85:154,22:W,50:Q,60:j,82:X,86:q,87:H,88:J,89:Z,90:$}),s(x,[2,109]),s(x,[2,111]),s(x,[2,112]),s(x,[2,113]),s(x,[2,114]),s(x,[2,115]),s(x,[2,116]),s(x,[2,117]),s(x,[2,118]),s(x,[2,119]),s(A,[2,106]),s(S,[2,71]),s(A,[2,73],{61:ze}),{60:[1,155]},s(G,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:b,86:k,100:E,102:T,103:y},s(ce,[2,12]),s(Ne,[2,56]),{1:[2,4]},s(oe,[2,69]),s(oe,[2,68]),{16:39,17:40,19:158,60:b,86:k,100:E,102:T,103:y},s(ue,[2,80]),s(S,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:n,43:23,48:h,54:g,56:B},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:n,43:23,48:h,54:g,56:B},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:n,43:23,48:h,54:g,56:B},{45:163,51:le},s(S,[2,49]),{41:[2,62]},s(S,[2,52],{39:[1,164]}),s(A,[2,60]),s(A,[2,92]),s(A,[2,94]),s(A,[2,95],{77:[1,165]}),s(A,[2,98]),s(A,[2,99],{13:[1,166]}),s(A,[2,101],{13:[1,168],77:[1,167]}),{22:W,50:Q,60:j,82:X,84:169,85:112,86:q,87:H,88:J,89:Z,90:$},s(x,[2,110]),s(Ge,[2,75]),{14:[1,170]},s(ce,[2,11]),s(oe,[2,70]),s(S,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:le},s(A,[2,96]),s(A,[2,100]),s(A,[2,102]),s(A,[2,103],{77:[1,174]}),s(Ye,[2,108],{85:154,22:W,50:Q,60:j,82:X,86:q,87:H,88:J,89:Z,90:$}),s(Ne,[2,8]),s(S,[2,51]),{41:[1,175]},s(S,[2,54]),s(A,[2,104]),s(S,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:m(function(o,d){if(d.recoverable)this.trace(o);else{var p=new Error(o);throw p.hash=d,p}},"parseError"),parse:m(function(o){var d=this,p=[0],l=[],C=[null],e=[],ee=this.table,t="",de=0,Ke=0,Ze=2,We=1,$e=e.slice.call(arguments,1),D=Object.create(this.lexer),V={yy:{}};for(var xe in this.yy)Object.prototype.hasOwnProperty.call(this.yy,xe)&&(V.yy[xe]=this.yy[xe]);D.setInput(o,V.yy),V.yy.lexer=D,V.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var ve=D.yylloc;e.push(ve);var et=D.options&&D.options.ranges;typeof V.yy.parseError=="function"?this.parseError=V.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function tt(N){p.length=p.length-2*N,C.length=C.length-N,e.length=e.length-N}m(tt,"popStack");function Qe(){var N;return N=l.pop()||D.lex()||We,typeof N!="number"&&(N instanceof Array&&(l=N,N=l.pop()),N=d.symbols_[N]||N),N}m(Qe,"lex");for(var _,P,L,Ie,U={},pe,v,je,Ae;;){if(P=p[p.length-1],this.defaultActions[P]?L=this.defaultActions[P]:((_===null||typeof _>"u")&&(_=Qe()),L=ee[P]&&ee[P][_]),typeof L>"u"||!L.length||!L[0]){var Oe="";Ae=[];for(pe in ee[P])this.terminals_[pe]&&pe>Ze&&Ae.push("'"+this.terminals_[pe]+"'");D.showPosition?Oe="Parse error on line "+(de+1)+`: `+D.showPosition()+` Expecting `+Ae.join(", ")+", got '"+(this.terminals_[_]||_)+"'":Oe="Parse error on line "+(de+1)+": Unexpected "+(_==We?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(Oe,{text:D.match,token:this.terminals_[_]||_,line:D.yylineno,loc:ve,expected:Ae})}if(L[0]instanceof Array&&L.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+_);switch(L[0]){case 1:p.push(_),C.push(D.yytext),e.push(D.yylloc),p.push(L[1]),_=null,Ke=D.yyleng,t=D.yytext,de=D.yylineno,ve=D.yylloc;break;case 2:if(v=this.productions_[L[1]][1],U.$=C[C.length-v],U._$={first_line:e[e.length-(v||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(v||1)].first_column,last_column:e[e.length-1].last_column},et&&(U._$.range=[e[e.length-(v||1)].range[0],e[e.length-1].range[1]]),Ie=this.performAction.apply(U,[t,Ke,de,V.yy,L[1],C,e].concat($e)),typeof Ie<"u")return Ie;v&&(p=p.slice(0,-1*v*2),C=C.slice(0,-1*v),e=e.slice(0,-1*v)),p.push(this.productions_[L[1]][0]),C.push(U.$),e.push(U._$),je=ee[p[p.length-2]][p[p.length-1]],p.push(je);break;case 3:return!0}}return!0},"parse")},Je=function(){var O={EOF:1,parseError:m(function(d,p){if(this.yy.parser)this.yy.parser.parseError(d,p);else throw new Error(d)},"parseError"),setInput:m(function(o,d){return this.yy=d||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:m(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var d=o.match(/(?:\r\n?|\n).*/g);return d?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:m(function(o){var d=o.length,p=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var l=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),p.length-1&&(this.yylineno-=p.length-1);var C=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:p?(p.length===l.length?this.yylloc.first_column:0)+l[l.length-p.length].length-p[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:m(function(){return this._more=!0,this},"more"),reject:m(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:m(function(o){this.unput(this.match.slice(o))},"less"),pastInput:m(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:m(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:m(function(){var o=this.pastInput(),d=new Array(o.length+1).join("-");return o+this.upcomingInput()+` diff --git a/veadk/webui/assets/visualizations/mermaid/chunk-JWPE2WC7-DD-BFVC6.js b/veadk/webui/assets/visualizations/mermaid/chunk-JWPE2WC7-DVlhplzu.js similarity index 78% rename from veadk/webui/assets/visualizations/mermaid/chunk-JWPE2WC7-DD-BFVC6.js rename to veadk/webui/assets/visualizations/mermaid/chunk-JWPE2WC7-DVlhplzu.js index c8bdc1c5d..79c673745 100644 --- a/veadk/webui/assets/visualizations/mermaid/chunk-JWPE2WC7-DD-BFVC6.js +++ b/veadk/webui/assets/visualizations/mermaid/chunk-JWPE2WC7-DVlhplzu.js @@ -1 +1 @@ -import{a as l}from"./mermaid.core-y4TF8bTw.js";function m(e,c){var i,t,o;e.accDescr&&((i=c.setAccDescription)==null||i.call(c,e.accDescr)),e.accTitle&&((t=c.setAccTitle)==null||t.call(c,e.accTitle)),e.title&&((o=c.setDiagramTitle)==null||o.call(c,e.title))}l(m,"populateCommonDb");export{m as p}; +import{a as l}from"./mermaid.core-DAx4nvmm.js";function m(e,c){var i,t,o;e.accDescr&&((i=c.setAccDescription)==null||i.call(c,e.accDescr)),e.accTitle&&((t=c.setAccTitle)==null||t.call(c,e.accTitle)),e.title&&((o=c.setDiagramTitle)==null||o.call(c,e.title))}l(m,"populateCommonDb");export{m as p}; diff --git a/veadk/webui/assets/visualizations/mermaid/chunk-KBJHAD2P-DtNDDRN1.js b/veadk/webui/assets/visualizations/mermaid/chunk-KBJHAD2P-C0rklDe7.js similarity index 87% rename from veadk/webui/assets/visualizations/mermaid/chunk-KBJHAD2P-DtNDDRN1.js rename to veadk/webui/assets/visualizations/mermaid/chunk-KBJHAD2P-C0rklDe7.js index 163af1752..525627a63 100644 --- a/veadk/webui/assets/visualizations/mermaid/chunk-KBJHAD2P-DtNDDRN1.js +++ b/veadk/webui/assets/visualizations/mermaid/chunk-KBJHAD2P-C0rklDe7.js @@ -1 +1 @@ -import{a,B as w,at as x}from"./mermaid.core-y4TF8bTw.js";var g=a((t,e,i,o)=>{t.attr("class",i);const{width:r,height:h,x:n,y:c}=u(t,e);w(t,h,r,o);const s=B(n,c,r,h,e);t.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${e}`)},"setupViewPortForSVG"),u=a((t,e)=>{var o;const i=((o=t.node())==null?void 0:o.getBBox())||{width:0,height:0,x:0,y:0};return{width:i.width+e*2,height:i.height+e*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),B=a((t,e,i,o,r)=>`${t-r} ${e-r} ${i} ${o}`,"createViewBox");export{g as s}; +import{a,B as w,at as x}from"./mermaid.core-DAx4nvmm.js";var g=a((t,e,i,o)=>{t.attr("class",i);const{width:r,height:h,x:n,y:c}=u(t,e);w(t,h,r,o);const s=B(n,c,r,h,e);t.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${e}`)},"setupViewPortForSVG"),u=a((t,e)=>{var o;const i=((o=t.node())==null?void 0:o.getBBox())||{width:0,height:0,x:0,y:0};return{width:i.width+e*2,height:i.height+e*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),B=a((t,e,i,o,r)=>`${t-r} ${e-r} ${i} ${o}`,"createViewBox");export{g as s}; diff --git a/veadk/webui/assets/visualizations/mermaid/chunk-RYQCIY6F-DL3iLUXF.js b/veadk/webui/assets/visualizations/mermaid/chunk-RYQCIY6F-C3ekePUg.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/chunk-RYQCIY6F-DL3iLUXF.js rename to veadk/webui/assets/visualizations/mermaid/chunk-RYQCIY6F-C3ekePUg.js index dacac0037..0eb557696 100644 --- a/veadk/webui/assets/visualizations/mermaid/chunk-RYQCIY6F-DL3iLUXF.js +++ b/veadk/webui/assets/visualizations/mermaid/chunk-RYQCIY6F-C3ekePUg.js @@ -1 +1 @@ -import{a as d,at as i}from"./mermaid.core-y4TF8bTw.js";import{Q as C,G as y}from"../../chunks/graph-Dqkl27Ch.js";import{c as j,m as X}from"../../chunks/map-8WAJQ6ap.js";var p=4;function F(e){return j(e,p)}function b(e){var r={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:M(e),edges:R(e)};return C(e.graph())||(r.value=F(e.graph())),r}function M(e){return X(e.nodes(),function(r){var s=e.node(r),n=e.parent(r),a={v:r};return C(s)||(a.value=s),C(n)||(a.parent=n),a})}function R(e){return X(e.edges(),function(r){var s=e.edge(r),n={v:r.v,w:r.w};return C(r.name)||(n.name=r.name),C(s)||(n.value=s),n})}var c=new Map,v=new Map,A=new Map,J=d(()=>{v.clear(),A.clear(),c.clear()},"clear"),g=d((e,r)=>{const s=v.get(r)||[];return i.trace("In isDescendant",r," ",e," = ",s.includes(e)),s.includes(e)},"isDescendant"),_=d((e,r)=>{const s=v.get(r)||[];return i.info("Descendants of ",r," is ",s),i.info("Edge is ",e),e.v===r||e.w===r?!1:s?s.includes(e.v)||g(e.v,r)||g(e.w,r)||s.includes(e.w):(i.debug("Tilt, ",r,",not in descendants"),!1)},"edgeInCluster"),x=d((e,r,s,n)=>{i.warn("Copying children of ",e,"root",n,"data",r.node(e),n);const a=r.children(e)||[];e!==n&&a.push(e),i.warn("Copying (nodes) clusterId",e,"nodes",a),a.forEach(o=>{if(r.children(o).length>0)x(o,r,s,n);else{const l=r.node(o);i.info("cp ",o," to ",n," with parent ",e),s.setNode(o,l),n!==r.parent(o)&&(i.warn("Setting parent",o,r.parent(o)),s.setParent(o,r.parent(o))),e!==n&&o!==e?(i.debug("Setting parent",o,e),s.setParent(o,e)):(i.info("In copy ",e,"root",n,"data",r.node(e),n),i.debug("Not Setting parent for node=",o,"cluster!==rootId",e!==n,"node!==clusterId",o!==e));const u=r.edges(o);i.debug("Copying Edges",u),u.forEach(t=>{i.info("Edge",t);const f=r.edge(t.v,t.w,t.name);i.info("Edge data",f,n);try{if(_(t,n)){const w=v.get(n)||[],m=w.includes(t.v)||g(t.v,n)||t.v===n,D=w.includes(t.w)||g(t.w,n)||t.w===n;if(m&&D)i.info("Copying as ",t.v,t.w,f,t.name),s.setEdge(t.v,t.w,f,t.name),i.info("newGraph edges ",s.edges(),s.edge(s.edges()[0]));else{const N=m?n:t.v,h=D?n:t.w;i.info("Rebinding cross-boundary edge as ",N,h,f,t.name),r.setEdge(N,h,f,t.name)}}else i.info("Skipping copy of edge ",t.v,"-->",t.w," rootId: ",n," clusterId:",e)}catch(w){i.error(w)}})}i.debug("Removing node",o),r.removeNode(o)})},"copy"),O=d((e,r)=>{const s=r.children(e);let n=[...s];for(const a of s)A.set(a,e),n=[...n,...O(a,r)];return n},"extractDescendants"),P=d((e,r,s)=>{const n=e.edges().filter(t=>t.v===r||t.w===r),a=e.edges().filter(t=>t.v===s||t.w===s),o=n.map(t=>({v:t.v===r?s:t.v,w:t.w===r?r:t.w})),l=a.map(t=>({v:t.v,w:t.w}));return o.filter(t=>l.some(f=>t.v===f.v&&t.w===f.w))},"findCommonEdges"),E=d((e,r,s)=>{const n=r.children(e);if(i.trace("Searching children of id ",e,n),n.length<1)return e;let a;for(const o of n){const l=E(o,r,s),u=P(r,s,l);if(l)if(u.length>0)a=l;else return l}return a},"findNonClusterChild"),S=d(e=>!c.has(e)||!c.get(e).externalConnections?e:c.has(e)?c.get(e).id:e,"getAnchorId"),Q=d((e,r)=>{var s;if(!e||r>10){i.debug("Opting out, no graph ");return}else i.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(i.warn("Cluster identified",n," Replacement id in edges: ",E(n,e,n)),v.set(n,O(n,e)),c.set(n,{id:E(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){const a=e.children(n),o=e.edges();a.length>0?(i.debug("Cluster identified",n,v),o.forEach(l=>{const u=g(l.v,n),t=g(l.w,n);u^t&&(i.warn("Edge: ",l," leaves cluster ",n),i.warn("Descendants of XXX ",n,": ",v.get(n)),c.get(n).externalConnections=!0)})):i.debug("Not a cluster ",n,v)});for(let n of c.keys()){const a=c.get(n).id,o=e.parent(a);o!==n&&c.has(o)&&!c.get(o).externalConnections&&(c.get(n).id=o);const l=e.edges().some(u=>u.v===n);if(a&&((s=c.get(n))!=null&&s.externalConnections)&&l&&L(e,a,n)){const u=T(e,n,e.parent(a));u&&(c.get(n).id=u)}}e.edges().forEach(function(n){const a=e.edge(n);i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let o=n.v,l=n.w;if(i.warn("Fix XXX",c,"ids:",n.v,n.w,"Translating: ",c.get(n.v)," --- ",c.get(n.w)),c.get(n.v)||c.get(n.w)){if(i.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),o=S(n.v),l=S(n.w),e.removeEdge(n.v,n.w,n.name),o!==n.v){const u=e.parent(o);c.get(u).externalConnections=!0,a.fromCluster=n.v}if(l!==n.w){const u=e.parent(l);c.get(u).externalConnections=!0,a.toCluster=n.w}i.warn("Fix Replacing with XXX",o,l,n.name),e.setEdge(o,l,a,n.name)}}),i.warn("Adjusted Graph",b(e)),k(e,0),i.trace(c)},"adjustClustersAndEdges"),k=d((e,r)=>{var a,o,l,u;if(i.warn("extractor - ",r,b(e),e.children("D")),r>10){i.error("Bailing out");return}let s=e.nodes(),n=!1;for(const t of s){const f=e.children(t);n=n||f.length>0}if(!n){i.debug("Done, no node has children",e.nodes());return}i.debug("Nodes = ",s,r);for(const t of s)if(i.debug("Extracting node",t,c,c.has(t)&&!c.get(t).externalConnections,!e.parent(t),e.node(t),e.children("D")," Depth ",r),!c.has(t))i.debug("Not a cluster",t,r);else if((o=(a=c.get(t))==null?void 0:a.clusterData)!=null&&o.explicitDir&&e.children(t)&&e.children(t).length>0){i.warn("Cluster with explicit dir, creating subgraph for children",t,r);const f=c.get(t).clusterData.dir,w=new y({multigraph:!0,compound:!0}).setGraph({rankdir:f,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});x(t,e,w,t);const m=e.node(t)||{};e.setNode(t,{...m,clusterNode:!0,id:t,clusterData:c.get(t).clusterData,label:c.get(t).label,graph:w}),i.warn("Subgraph for cluster with explicit dir created:",t,b(w))}else if(!c.get(t).externalConnections&&e.children(t)&&e.children(t).length>0){i.warn("Cluster without external connections, without a parent and with children",t,r);let w=e.graph().rankdir==="TB"?"LR":"TB";(u=(l=c.get(t))==null?void 0:l.clusterData)!=null&&u.dir&&(w=c.get(t).clusterData.dir,i.warn("Fixing dir",c.get(t).clusterData.dir,w));const m=new y({multigraph:!0,compound:!0}).setGraph({rankdir:w,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});x(t,e,m,t);const D=e.node(t)||{};e.setNode(t,{...D,clusterNode:!0,id:t,clusterData:c.get(t).clusterData,label:c.get(t).label,graph:m}),i.debug("Old graph after copy",b(e))}else i.warn("Cluster ** ",t," **not meeting the criteria !externalConnections:",!c.get(t).externalConnections," no parent: ",!e.parent(t)," children ",e.children(t)&&e.children(t).length>0,e.children("D"),r),i.debug(c);s=e.nodes(),i.warn("New list of nodes",s);for(const t of s){const f=e.node(t);i.warn(" Now next level",t,f),f!=null&&f.clusterNode&&k(f.graph,r+1)}},"extractor"),B=d((e,r)=>{if(r.length===0)return[];let s=Object.assign([],r);return r.forEach(n=>{const a=e.children(n),o=B(e,a);s=[...s,...o]}),s},"sorter"),U=d(e=>B(e,e.children()),"sortNodesByHierarchy"),L=d((e,r,s)=>{let n=e.parent(r);for(;n&&n!==s;){const a=c.get(n);if(a&&!a.externalConnections)return!0;n=e.parent(n)}return!1},"isNodeInExtractableCluster"),T=d((e,r,s)=>{const n=e.children(r)??[];for(const a of n){if(a===s||g(a,s))continue;const o=E(a,e,r);if(o&&!L(e,o,r))return o}return null},"findSafeAnchorNode");export{Q as a,c as b,J as c,E as f,U as s,b as w}; +import{a as d,at as i}from"./mermaid.core-DAx4nvmm.js";import{Q as C,G as y}from"../../chunks/graph-Dqkl27Ch.js";import{c as j,m as X}from"../../chunks/map-8WAJQ6ap.js";var p=4;function F(e){return j(e,p)}function b(e){var r={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:M(e),edges:R(e)};return C(e.graph())||(r.value=F(e.graph())),r}function M(e){return X(e.nodes(),function(r){var s=e.node(r),n=e.parent(r),a={v:r};return C(s)||(a.value=s),C(n)||(a.parent=n),a})}function R(e){return X(e.edges(),function(r){var s=e.edge(r),n={v:r.v,w:r.w};return C(r.name)||(n.name=r.name),C(s)||(n.value=s),n})}var c=new Map,v=new Map,A=new Map,J=d(()=>{v.clear(),A.clear(),c.clear()},"clear"),g=d((e,r)=>{const s=v.get(r)||[];return i.trace("In isDescendant",r," ",e," = ",s.includes(e)),s.includes(e)},"isDescendant"),_=d((e,r)=>{const s=v.get(r)||[];return i.info("Descendants of ",r," is ",s),i.info("Edge is ",e),e.v===r||e.w===r?!1:s?s.includes(e.v)||g(e.v,r)||g(e.w,r)||s.includes(e.w):(i.debug("Tilt, ",r,",not in descendants"),!1)},"edgeInCluster"),x=d((e,r,s,n)=>{i.warn("Copying children of ",e,"root",n,"data",r.node(e),n);const a=r.children(e)||[];e!==n&&a.push(e),i.warn("Copying (nodes) clusterId",e,"nodes",a),a.forEach(o=>{if(r.children(o).length>0)x(o,r,s,n);else{const l=r.node(o);i.info("cp ",o," to ",n," with parent ",e),s.setNode(o,l),n!==r.parent(o)&&(i.warn("Setting parent",o,r.parent(o)),s.setParent(o,r.parent(o))),e!==n&&o!==e?(i.debug("Setting parent",o,e),s.setParent(o,e)):(i.info("In copy ",e,"root",n,"data",r.node(e),n),i.debug("Not Setting parent for node=",o,"cluster!==rootId",e!==n,"node!==clusterId",o!==e));const u=r.edges(o);i.debug("Copying Edges",u),u.forEach(t=>{i.info("Edge",t);const f=r.edge(t.v,t.w,t.name);i.info("Edge data",f,n);try{if(_(t,n)){const w=v.get(n)||[],m=w.includes(t.v)||g(t.v,n)||t.v===n,D=w.includes(t.w)||g(t.w,n)||t.w===n;if(m&&D)i.info("Copying as ",t.v,t.w,f,t.name),s.setEdge(t.v,t.w,f,t.name),i.info("newGraph edges ",s.edges(),s.edge(s.edges()[0]));else{const N=m?n:t.v,h=D?n:t.w;i.info("Rebinding cross-boundary edge as ",N,h,f,t.name),r.setEdge(N,h,f,t.name)}}else i.info("Skipping copy of edge ",t.v,"-->",t.w," rootId: ",n," clusterId:",e)}catch(w){i.error(w)}})}i.debug("Removing node",o),r.removeNode(o)})},"copy"),O=d((e,r)=>{const s=r.children(e);let n=[...s];for(const a of s)A.set(a,e),n=[...n,...O(a,r)];return n},"extractDescendants"),P=d((e,r,s)=>{const n=e.edges().filter(t=>t.v===r||t.w===r),a=e.edges().filter(t=>t.v===s||t.w===s),o=n.map(t=>({v:t.v===r?s:t.v,w:t.w===r?r:t.w})),l=a.map(t=>({v:t.v,w:t.w}));return o.filter(t=>l.some(f=>t.v===f.v&&t.w===f.w))},"findCommonEdges"),E=d((e,r,s)=>{const n=r.children(e);if(i.trace("Searching children of id ",e,n),n.length<1)return e;let a;for(const o of n){const l=E(o,r,s),u=P(r,s,l);if(l)if(u.length>0)a=l;else return l}return a},"findNonClusterChild"),S=d(e=>!c.has(e)||!c.get(e).externalConnections?e:c.has(e)?c.get(e).id:e,"getAnchorId"),Q=d((e,r)=>{var s;if(!e||r>10){i.debug("Opting out, no graph ");return}else i.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(i.warn("Cluster identified",n," Replacement id in edges: ",E(n,e,n)),v.set(n,O(n,e)),c.set(n,{id:E(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){const a=e.children(n),o=e.edges();a.length>0?(i.debug("Cluster identified",n,v),o.forEach(l=>{const u=g(l.v,n),t=g(l.w,n);u^t&&(i.warn("Edge: ",l," leaves cluster ",n),i.warn("Descendants of XXX ",n,": ",v.get(n)),c.get(n).externalConnections=!0)})):i.debug("Not a cluster ",n,v)});for(let n of c.keys()){const a=c.get(n).id,o=e.parent(a);o!==n&&c.has(o)&&!c.get(o).externalConnections&&(c.get(n).id=o);const l=e.edges().some(u=>u.v===n);if(a&&((s=c.get(n))!=null&&s.externalConnections)&&l&&L(e,a,n)){const u=T(e,n,e.parent(a));u&&(c.get(n).id=u)}}e.edges().forEach(function(n){const a=e.edge(n);i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let o=n.v,l=n.w;if(i.warn("Fix XXX",c,"ids:",n.v,n.w,"Translating: ",c.get(n.v)," --- ",c.get(n.w)),c.get(n.v)||c.get(n.w)){if(i.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),o=S(n.v),l=S(n.w),e.removeEdge(n.v,n.w,n.name),o!==n.v){const u=e.parent(o);c.get(u).externalConnections=!0,a.fromCluster=n.v}if(l!==n.w){const u=e.parent(l);c.get(u).externalConnections=!0,a.toCluster=n.w}i.warn("Fix Replacing with XXX",o,l,n.name),e.setEdge(o,l,a,n.name)}}),i.warn("Adjusted Graph",b(e)),k(e,0),i.trace(c)},"adjustClustersAndEdges"),k=d((e,r)=>{var a,o,l,u;if(i.warn("extractor - ",r,b(e),e.children("D")),r>10){i.error("Bailing out");return}let s=e.nodes(),n=!1;for(const t of s){const f=e.children(t);n=n||f.length>0}if(!n){i.debug("Done, no node has children",e.nodes());return}i.debug("Nodes = ",s,r);for(const t of s)if(i.debug("Extracting node",t,c,c.has(t)&&!c.get(t).externalConnections,!e.parent(t),e.node(t),e.children("D")," Depth ",r),!c.has(t))i.debug("Not a cluster",t,r);else if((o=(a=c.get(t))==null?void 0:a.clusterData)!=null&&o.explicitDir&&e.children(t)&&e.children(t).length>0){i.warn("Cluster with explicit dir, creating subgraph for children",t,r);const f=c.get(t).clusterData.dir,w=new y({multigraph:!0,compound:!0}).setGraph({rankdir:f,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});x(t,e,w,t);const m=e.node(t)||{};e.setNode(t,{...m,clusterNode:!0,id:t,clusterData:c.get(t).clusterData,label:c.get(t).label,graph:w}),i.warn("Subgraph for cluster with explicit dir created:",t,b(w))}else if(!c.get(t).externalConnections&&e.children(t)&&e.children(t).length>0){i.warn("Cluster without external connections, without a parent and with children",t,r);let w=e.graph().rankdir==="TB"?"LR":"TB";(u=(l=c.get(t))==null?void 0:l.clusterData)!=null&&u.dir&&(w=c.get(t).clusterData.dir,i.warn("Fixing dir",c.get(t).clusterData.dir,w));const m=new y({multigraph:!0,compound:!0}).setGraph({rankdir:w,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});x(t,e,m,t);const D=e.node(t)||{};e.setNode(t,{...D,clusterNode:!0,id:t,clusterData:c.get(t).clusterData,label:c.get(t).label,graph:m}),i.debug("Old graph after copy",b(e))}else i.warn("Cluster ** ",t," **not meeting the criteria !externalConnections:",!c.get(t).externalConnections," no parent: ",!e.parent(t)," children ",e.children(t)&&e.children(t).length>0,e.children("D"),r),i.debug(c);s=e.nodes(),i.warn("New list of nodes",s);for(const t of s){const f=e.node(t);i.warn(" Now next level",t,f),f!=null&&f.clusterNode&&k(f.graph,r+1)}},"extractor"),B=d((e,r)=>{if(r.length===0)return[];let s=Object.assign([],r);return r.forEach(n=>{const a=e.children(n),o=B(e,a);s=[...s,...o]}),s},"sorter"),U=d(e=>B(e,e.children()),"sortNodesByHierarchy"),L=d((e,r,s)=>{let n=e.parent(r);for(;n&&n!==s;){const a=c.get(n);if(a&&!a.externalConnections)return!0;n=e.parent(n)}return!1},"isNodeInExtractableCluster"),T=d((e,r,s)=>{const n=e.children(r)??[];for(const a of n){if(a===s||g(a,s))continue;const o=E(a,e,r);if(o&&!L(e,o,r))return o}return null},"findSafeAnchorNode");export{Q as a,c as b,J as c,E as f,U as s,b as w}; diff --git a/veadk/webui/assets/visualizations/mermaid/chunk-XXDRQBXY-B8qTF1qQ.js b/veadk/webui/assets/visualizations/mermaid/chunk-XXDRQBXY-BdI3VXTi.js similarity index 53% rename from veadk/webui/assets/visualizations/mermaid/chunk-XXDRQBXY-B8qTF1qQ.js rename to veadk/webui/assets/visualizations/mermaid/chunk-XXDRQBXY-BdI3VXTi.js index 52d92ce84..4f12279d4 100644 --- a/veadk/webui/assets/visualizations/mermaid/chunk-XXDRQBXY-B8qTF1qQ.js +++ b/veadk/webui/assets/visualizations/mermaid/chunk-XXDRQBXY-BdI3VXTi.js @@ -1 +1 @@ -import{a as n}from"./mermaid.core-y4TF8bTw.js";import{aG as o}from"../../app/index-BNPwMQXG.js";var d=n((t,e)=>{let a;return e==="sandbox"&&(a=o("#i"+t)),(e==="sandbox"?o(a.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{d as g}; +import{a as n}from"./mermaid.core-DAx4nvmm.js";import{aG as o}from"../../app/index-8JtvDNuA.js";var d=n((t,e)=>{let a;return e==="sandbox"&&(a=o("#i"+t)),(e==="sandbox"?o(a.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{d as g}; diff --git a/veadk/webui/assets/visualizations/mermaid/classDiagram-JCYQIIEL-DcvvubKo.js b/veadk/webui/assets/visualizations/mermaid/classDiagram-JCYQIIEL-DcvvubKo.js new file mode 100644 index 000000000..9b756456a --- /dev/null +++ b/veadk/webui/assets/visualizations/mermaid/classDiagram-JCYQIIEL-DcvvubKo.js @@ -0,0 +1 @@ +import{s as a,a as s,c as e,C as t}from"./chunk-GF5L2VYU-IG64zwph.js";import{a as i}from"./mermaid.core-DAx4nvmm.js";import"../../app/index-8JtvDNuA.js";import"./chunk-5VM5RSS4-BKHSrXIw.js";import"./chunk-XXDRQBXY-BdI3VXTi.js";import"./chunk-KBJHAD2P-C0rklDe7.js";import"./chunk-2GRJ4B5K-BNT0kar4.js";import"../../chunks/purify.es-BnINGy_Y.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram}; diff --git a/veadk/webui/assets/visualizations/mermaid/classDiagram-JCYQIIEL-DtPkX3wA.js b/veadk/webui/assets/visualizations/mermaid/classDiagram-JCYQIIEL-DtPkX3wA.js deleted file mode 100644 index 1e29a4fd4..000000000 --- a/veadk/webui/assets/visualizations/mermaid/classDiagram-JCYQIIEL-DtPkX3wA.js +++ /dev/null @@ -1 +0,0 @@ -import{s as a,a as s,c as e,C as t}from"./chunk-GF5L2VYU-Cv1ZgaH8.js";import{a as i}from"./mermaid.core-y4TF8bTw.js";import"../../app/index-BNPwMQXG.js";import"./chunk-5VM5RSS4-BDBKcK2Z.js";import"./chunk-XXDRQBXY-B8qTF1qQ.js";import"./chunk-KBJHAD2P-DtNDDRN1.js";import"./chunk-2GRJ4B5K-CvII-2ZL.js";import"../../chunks/purify.es-BnINGy_Y.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram}; diff --git a/veadk/webui/assets/visualizations/mermaid/classDiagram-v2-OCEON4UE-DcvvubKo.js b/veadk/webui/assets/visualizations/mermaid/classDiagram-v2-OCEON4UE-DcvvubKo.js new file mode 100644 index 000000000..9b756456a --- /dev/null +++ b/veadk/webui/assets/visualizations/mermaid/classDiagram-v2-OCEON4UE-DcvvubKo.js @@ -0,0 +1 @@ +import{s as a,a as s,c as e,C as t}from"./chunk-GF5L2VYU-IG64zwph.js";import{a as i}from"./mermaid.core-DAx4nvmm.js";import"../../app/index-8JtvDNuA.js";import"./chunk-5VM5RSS4-BKHSrXIw.js";import"./chunk-XXDRQBXY-BdI3VXTi.js";import"./chunk-KBJHAD2P-C0rklDe7.js";import"./chunk-2GRJ4B5K-BNT0kar4.js";import"../../chunks/purify.es-BnINGy_Y.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram}; diff --git a/veadk/webui/assets/visualizations/mermaid/classDiagram-v2-OCEON4UE-DtPkX3wA.js b/veadk/webui/assets/visualizations/mermaid/classDiagram-v2-OCEON4UE-DtPkX3wA.js deleted file mode 100644 index 1e29a4fd4..000000000 --- a/veadk/webui/assets/visualizations/mermaid/classDiagram-v2-OCEON4UE-DtPkX3wA.js +++ /dev/null @@ -1 +0,0 @@ -import{s as a,a as s,c as e,C as t}from"./chunk-GF5L2VYU-Cv1ZgaH8.js";import{a as i}from"./mermaid.core-y4TF8bTw.js";import"../../app/index-BNPwMQXG.js";import"./chunk-5VM5RSS4-BDBKcK2Z.js";import"./chunk-XXDRQBXY-B8qTF1qQ.js";import"./chunk-KBJHAD2P-DtNDDRN1.js";import"./chunk-2GRJ4B5K-CvII-2ZL.js";import"../../chunks/purify.es-BnINGy_Y.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram}; diff --git a/veadk/webui/assets/visualizations/mermaid/cose-bilkent-JH36ORCC-BNlKHYzG.js b/veadk/webui/assets/visualizations/mermaid/cose-bilkent-JH36ORCC-0QYD6FmW.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/cose-bilkent-JH36ORCC-BNlKHYzG.js rename to veadk/webui/assets/visualizations/mermaid/cose-bilkent-JH36ORCC-0QYD6FmW.js index 82f6e9b35..aeda76388 100644 --- a/veadk/webui/assets/visualizations/mermaid/cose-bilkent-JH36ORCC-BNlKHYzG.js +++ b/veadk/webui/assets/visualizations/mermaid/cose-bilkent-JH36ORCC-0QYD6FmW.js @@ -1 +1 @@ -import{a as V,at as k}from"./mermaid.core-y4TF8bTw.js";import{c as J}from"../../chunks/cytoscape.esm-Dz9tvMTw.js";import{U as $,ad as lt,aG as gt}from"../../app/index-BNPwMQXG.js";import"../../chunks/purify.es-BnINGy_Y.js";var tt={exports:{}},Z={exports:{}},Q={exports:{}},q;function ut(){return q||(q=1,function(G,b){(function(I,T){G.exports=T()})($,function(){return function(N){var I={};function T(o){if(I[o])return I[o].exports;var e=I[o]={i:o,l:!1,exports:{}};return N[o].call(e.exports,e,e.exports,T),e.l=!0,e.exports}return T.m=N,T.c=I,T.i=function(o){return o},T.d=function(o,e,t){T.o(o,e)||Object.defineProperty(o,e,{configurable:!1,enumerable:!0,get:t})},T.n=function(o){var e=o&&o.__esModule?function(){return o.default}:function(){return o};return T.d(e,"a",e),e},T.o=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)},T.p="",T(T.s=26)}([function(N,I,T){function o(){}o.QUALITY=1,o.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,o.DEFAULT_INCREMENTAL=!1,o.DEFAULT_ANIMATION_ON_LAYOUT=!0,o.DEFAULT_ANIMATION_DURING_LAYOUT=!1,o.DEFAULT_ANIMATION_PERIOD=50,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,o.DEFAULT_GRAPH_MARGIN=15,o.NODE_DIMENSIONS_INCLUDE_LABELS=!1,o.SIMPLE_NODE_SIZE=40,o.SIMPLE_NODE_HALF_SIZE=o.SIMPLE_NODE_SIZE/2,o.EMPTY_COMPOUND_NODE_SIZE=40,o.MIN_EDGE_LENGTH=1,o.WORLD_BOUNDARY=1e6,o.INITIAL_WORLD_BOUNDARY=o.WORLD_BOUNDARY/1e3,o.WORLD_CENTER_X=1200,o.WORLD_CENTER_Y=900,N.exports=o},function(N,I,T){var o=T(2),e=T(8),t=T(9);function i(g,n,d){o.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=g,this.target=n}i.prototype=Object.create(o.prototype);for(var l in o)i[l]=o[l];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(g){if(this.source===g)return this.target;if(this.target===g)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(g,n){for(var d=this.getOtherEnd(g),r=n.getGraphManager().getRoot();;){if(d.getOwner()==n)return d;if(d.getOwner()==r)break;d=d.getOwner().getParent()}return null},i.prototype.updateLength=function(){var g=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),g),this.isOverlapingSourceAndTarget||(this.lengthX=g[0]-g[2],this.lengthY=g[1]-g[3],Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},i.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},N.exports=i},function(N,I,T){function o(e){this.vGraphObject=e}N.exports=o},function(N,I,T){var o=T(2),e=T(10),t=T(13),i=T(0),l=T(16),g=T(4);function n(r,h,a,p){a==null&&p==null&&(p=h),o.call(this,p),r.graphManager!=null&&(r=r.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=p,this.edges=[],this.graphManager=r,a!=null&&h!=null?this.rect=new t(h.x,h.y,a.width,a.height):this.rect=new t}n.prototype=Object.create(o.prototype);for(var d in o)n[d]=o[d];n.prototype.getEdges=function(){return this.edges},n.prototype.getChild=function(){return this.child},n.prototype.getOwner=function(){return this.owner},n.prototype.getWidth=function(){return this.rect.width},n.prototype.setWidth=function(r){this.rect.width=r},n.prototype.getHeight=function(){return this.rect.height},n.prototype.setHeight=function(r){this.rect.height=r},n.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},n.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},n.prototype.getCenter=function(){return new g(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},n.prototype.getLocation=function(){return new g(this.rect.x,this.rect.y)},n.prototype.getRect=function(){return this.rect},n.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},n.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},n.prototype.setRect=function(r,h){this.rect.x=r.x,this.rect.y=r.y,this.rect.width=h.width,this.rect.height=h.height},n.prototype.setCenter=function(r,h){this.rect.x=r-this.rect.width/2,this.rect.y=h-this.rect.height/2},n.prototype.setLocation=function(r,h){this.rect.x=r,this.rect.y=h},n.prototype.moveBy=function(r,h){this.rect.x+=r,this.rect.y+=h},n.prototype.getEdgeListToNode=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(p.target==r){if(p.source!=a)throw"Incorrect edge source!";h.push(p)}}),h},n.prototype.getEdgesBetween=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(!(p.source==a||p.target==a))throw"Incorrect edge source and/or target";(p.target==r||p.source==r)&&h.push(p)}),h},n.prototype.getNeighborsList=function(){var r=new Set,h=this;return h.edges.forEach(function(a){if(a.source==h)r.add(a.target);else{if(a.target!=h)throw"Incorrect incidency!";r.add(a.source)}}),r},n.prototype.withChildren=function(){var r=new Set,h,a;if(r.add(this),this.child!=null)for(var p=this.child.getNodes(),v=0;vh&&(this.rect.x-=(this.labelWidth-h)/2,this.setWidth(this.labelWidth)),this.labelHeight>a&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-a)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-a),this.setHeight(this.labelHeight))}}},n.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},n.prototype.transform=function(r){var h=this.rect.x;h>i.WORLD_BOUNDARY?h=i.WORLD_BOUNDARY:h<-i.WORLD_BOUNDARY&&(h=-i.WORLD_BOUNDARY);var a=this.rect.y;a>i.WORLD_BOUNDARY?a=i.WORLD_BOUNDARY:a<-i.WORLD_BOUNDARY&&(a=-i.WORLD_BOUNDARY);var p=new g(h,a),v=r.inverseTransformPoint(p);this.setLocation(v.x,v.y)},n.prototype.getLeft=function(){return this.rect.x},n.prototype.getRight=function(){return this.rect.x+this.rect.width},n.prototype.getTop=function(){return this.rect.y},n.prototype.getBottom=function(){return this.rect.y+this.rect.height},n.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},N.exports=n},function(N,I,T){function o(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}o.prototype.getX=function(){return this.x},o.prototype.getY=function(){return this.y},o.prototype.setX=function(e){this.x=e},o.prototype.setY=function(e){this.y=e},o.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},o.prototype.getCopy=function(){return new o(this.x,this.y)},o.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},N.exports=o},function(N,I,T){var o=T(2),e=T(10),t=T(0),i=T(6),l=T(3),g=T(1),n=T(13),d=T(12),r=T(11);function h(p,v,D){o.call(this,D),this.estimatedSize=e.MIN_VALUE,this.margin=t.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=p,v!=null&&v instanceof i?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}h.prototype=Object.create(o.prototype);for(var a in o)h[a]=o[a];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(p,v,D){if(v==null&&D==null){var u=p;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(u)>-1)throw"Node already in graph!";return u.owner=this,this.getNodes().push(u),u}else{var E=p;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(D)>-1))throw"Source or target not in graph!";if(!(v.owner==D.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=D.owner?null:(E.source=v,E.target=D,E.isInterGraph=!1,this.getEdges().push(E),v.edges.push(E),D!=v&&D.edges.push(E),E)}},h.prototype.remove=function(p){var v=p;if(p instanceof l){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var D=v.edges.slice(),u,E=D.length,y=0;y-1&&f>-1))throw"Source and/or target doesn't know this edge!";u.source.edges.splice(s,1),u.target!=u.source&&u.target.edges.splice(f,1);var O=u.source.owner.getEdges().indexOf(u);if(O==-1)throw"Not in owner's edge list!";u.source.owner.getEdges().splice(O,1)}},h.prototype.updateLeftTop=function(){for(var p=e.MAX_VALUE,v=e.MAX_VALUE,D,u,E,y=this.getNodes(),O=y.length,s=0;sD&&(p=D),v>u&&(v=u)}return p==e.MAX_VALUE?null:(y[0].getParent().paddingLeft!=null?E=y[0].getParent().paddingLeft:E=this.margin,this.left=v-E,this.top=p-E,new d(this.left,this.top))},h.prototype.updateBounds=function(p){for(var v=e.MAX_VALUE,D=-e.MAX_VALUE,u=e.MAX_VALUE,E=-e.MAX_VALUE,y,O,s,f,c,L=this.nodes,A=L.length,m=0;my&&(v=y),Ds&&(u=s),Ey&&(v=y),Ds&&(u=s),E=this.nodes.length){var A=0;D.forEach(function(m){m.owner==p&&A++}),A==this.nodes.length&&(this.isConnected=!0)}},N.exports=h},function(N,I,T){var o,e=T(1);function t(i){o=T(5),this.layout=i,this.graphs=[],this.edges=[]}t.prototype.addRoot=function(){var i=this.layout.newGraph(),l=this.layout.newNode(null),g=this.add(i,l);return this.setRootGraph(g),this.rootGraph},t.prototype.add=function(i,l,g,n,d){if(g==null&&n==null&&d==null){if(i==null)throw"Graph is null!";if(l==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(l.child!=null)throw"Already has a child!";return i.parent=l,l.child=i,i}else{d=g,n=l,g=i;var r=n.getOwner(),h=d.getOwner();if(!(r!=null&&r.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(h!=null&&h.getGraphManager()==this))throw"Target not in this graph mgr!";if(r==h)return g.isInterGraph=!1,r.add(g,n,d);if(g.isInterGraph=!0,g.source=n,g.target=d,this.edges.indexOf(g)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(g),!(g.source!=null&&g.target!=null))throw"Edge source and/or target is null!";if(!(g.source.edges.indexOf(g)==-1&&g.target.edges.indexOf(g)==-1))throw"Edge already in source and/or target incidency list!";return g.source.edges.push(g),g.target.edges.push(g),g}},t.prototype.remove=function(i){if(i instanceof o){var l=i;if(l.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(l==this.rootGraph||l.parent!=null&&l.parent.graphManager==this))throw"Invalid parent node!";var g=[];g=g.concat(l.getEdges());for(var n,d=g.length,r=0;r=i.getRight()?l[0]+=Math.min(i.getX()-t.getX(),t.getRight()-i.getRight()):i.getX()<=t.getX()&&i.getRight()>=t.getRight()&&(l[0]+=Math.min(t.getX()-i.getX(),i.getRight()-t.getRight())),t.getY()<=i.getY()&&t.getBottom()>=i.getBottom()?l[1]+=Math.min(i.getY()-t.getY(),t.getBottom()-i.getBottom()):i.getY()<=t.getY()&&i.getBottom()>=t.getBottom()&&(l[1]+=Math.min(t.getY()-i.getY(),i.getBottom()-t.getBottom()));var d=Math.abs((i.getCenterY()-t.getCenterY())/(i.getCenterX()-t.getCenterX()));i.getCenterY()===t.getCenterY()&&i.getCenterX()===t.getCenterX()&&(d=1);var r=d*l[0],h=l[1]/d;l[0]r)return l[0]=g,l[1]=a,l[2]=d,l[3]=L,!1;if(nd)return l[0]=h,l[1]=n,l[2]=f,l[3]=r,!1;if(gd?(l[0]=v,l[1]=D,C=!0):(l[0]=p,l[1]=a,C=!0):S===w&&(g>d?(l[0]=h,l[1]=a,C=!0):(l[0]=u,l[1]=D,C=!0)),-Y===w?d>g?(l[2]=c,l[3]=L,M=!0):(l[2]=f,l[3]=s,M=!0):Y===w&&(d>g?(l[2]=O,l[3]=s,M=!0):(l[2]=A,l[3]=L,M=!0)),C&&M)return!1;if(g>d?n>r?(x=this.getCardinalDirection(S,w,4),F=this.getCardinalDirection(Y,w,2)):(x=this.getCardinalDirection(-S,w,3),F=this.getCardinalDirection(-Y,w,1)):n>r?(x=this.getCardinalDirection(-S,w,1),F=this.getCardinalDirection(-Y,w,3)):(x=this.getCardinalDirection(S,w,2),F=this.getCardinalDirection(Y,w,4)),!C)switch(x){case 1:P=a,U=g+-y/w,l[0]=U,l[1]=P;break;case 2:U=u,P=n+E*w,l[0]=U,l[1]=P;break;case 3:P=D,U=g+y/w,l[0]=U,l[1]=P;break;case 4:U=v,P=n+-E*w,l[0]=U,l[1]=P;break}if(!M)switch(F){case 1:X=s,_=d+-R/w,l[2]=_,l[3]=X;break;case 2:_=A,X=r+m*w,l[2]=_,l[3]=X;break;case 3:X=L,_=d+R/w,l[2]=_,l[3]=X;break;case 4:_=c,X=r+-m*w,l[2]=_,l[3]=X;break}}return!1},e.getCardinalDirection=function(t,i,l){return t>i?l:1+l%4},e.getIntersection=function(t,i,l,g){if(g==null)return this.getIntersection2(t,i,l);var n=t.x,d=t.y,r=i.x,h=i.y,a=l.x,p=l.y,v=g.x,D=g.y,u=void 0,E=void 0,y=void 0,O=void 0,s=void 0,f=void 0,c=void 0,L=void 0,A=void 0;return y=h-d,s=n-r,c=r*d-n*h,O=D-p,f=a-v,L=v*p-a*D,A=y*f-O*s,A===0?null:(u=(s*L-f*c)/A,E=(O*c-y*L)/A,new o(u,E))},e.angleOfVector=function(t,i,l,g){var n=void 0;return t!==l?(n=Math.atan((g-i)/(l-t)),l0?1:e<0?-1:0},o.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},o.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},N.exports=o},function(N,I,T){function o(){}o.MAX_VALUE=2147483647,o.MIN_VALUE=-2147483648,N.exports=o},function(N,I,T){var o=function(){function n(d,r){for(var h=0;h"u"?"undefined":o(t);return t==null||i!="object"&&i!="function"},N.exports=e},function(N,I,T){function o(a){if(Array.isArray(a)){for(var p=0,v=Array(a.length);p0&&p;){for(y.push(s[0]);y.length>0&&p;){var f=y[0];y.splice(0,1),E.add(f);for(var c=f.getEdges(),u=0;u-1&&s.splice(R,1)}E=new Set,O=new Map}}return a},h.prototype.createDummyNodesForBendpoints=function(a){for(var p=[],v=a.source,D=this.graphManager.calcLowestCommonAncestor(a.source,a.target),u=0;u0){for(var D=this.edgeToDummyNodes.get(v),u=0;u=0&&p.splice(L,1);var A=O.getNeighborsList();A.forEach(function(C){if(v.indexOf(C)<0){var M=D.get(C),S=M-1;S==1&&f.push(C),D.set(C,S)}})}v=v.concat(f),(p.length==1||p.length==2)&&(u=!0,E=p[0])}return E},h.prototype.setGraphManager=function(a){this.graphManager=a},N.exports=h},function(N,I,T){function o(){}o.seed=1,o.x=0,o.nextDouble=function(){return o.x=Math.sin(o.seed++)*1e4,o.x-Math.floor(o.x)},N.exports=o},function(N,I,T){var o=T(4);function e(t,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(t){this.lworldExtX=t},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(t){this.lworldExtY=t},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},e.prototype.transformX=function(t){var i=0,l=this.lworldExtX;return l!=0&&(i=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/l),i},e.prototype.transformY=function(t){var i=0,l=this.lworldExtY;return l!=0&&(i=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/l),i},e.prototype.inverseTransformX=function(t){var i=0,l=this.ldeviceExtX;return l!=0&&(i=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/l),i},e.prototype.inverseTransformY=function(t){var i=0,l=this.ldeviceExtY;return l!=0&&(i=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/l),i},e.prototype.inverseTransformPoint=function(t){var i=new o(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return i},N.exports=e},function(N,I,T){function o(r){if(Array.isArray(r)){for(var h=0,a=Array(r.length);ht.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*t.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-t.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT_INCREMENTAL):(r>t.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(t.COOLING_ADAPTATION_FACTOR,1-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*(1-t.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},n.prototype.calcSpringForces=function(){for(var r=this.getAllEdges(),h,a=0;a0&&arguments[0]!==void 0?arguments[0]:!0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a,p,v,D,u=this.getAllNodes(),E;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&r&&this.updateGrid(),E=new Set,a=0;ay||E>y)&&(r.gravitationForceX=-this.gravityConstant*v,r.gravitationForceY=-this.gravityConstant*D)):(y=h.getEstimatedSize()*this.compoundGravityRangeFactor,(u>y||E>y)&&(r.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,r.gravitationForceY=-this.gravityConstant*D*this.compoundGravityConstant))},n.prototype.isConverged=function(){var r,h=!1;return this.totalIterations>this.maxIterations/3&&(h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),r=this.totalDisplacement=u.length||y>=u[0].length)){for(var O=0;On}}]),l}();N.exports=i},function(N,I,T){var o=function(){function i(l,g){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:1,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;e(this,i),this.sequence1=l,this.sequence2=g,this.match_score=n,this.mismatch_penalty=d,this.gap_penalty=r,this.iMax=l.length+1,this.jMax=g.length+1,this.grid=new Array(this.iMax);for(var h=0;h=0;l--){var g=this.listeners[l];g.event===t&&g.callback===i&&this.listeners.splice(l,1)}},e.emit=function(t,i){for(var l=0;lg.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),g.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},i.prototype.propogateDisplacementToChildren=function(g,n){for(var d=this.getChild().getNodes(),r,h=0;h0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var f=new Set(this.getAllNodes()),c=this.nodesWithGravity.filter(function(L){return f.has(L)});this.graphManager.setAllNodesToApplyGravitation(c),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},y.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),f=this.nodesWithGravity.filter(function(A){return s.has(A)});this.graphManager.setAllNodesToApplyGravitation(f),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var c=!this.isTreeGrowing&&!this.isGrowthFinished,L=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,L),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},y.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),f={},c=0;c1){var C;for(C=0;CL&&(L=Math.floor(R.y)),m=Math.floor(R.x+n.DEFAULT_COMPONENT_SEPERATION)}this.transform(new a(r.WORLD_CENTER_X-R.x/2,r.WORLD_CENTER_Y-R.y/2))},y.radialLayout=function(s,f,c){var L=Math.max(this.maxDiagonalInTree(s),n.DEFAULT_RADIAL_SEPARATION);y.branchRadialLayout(f,null,0,359,0,L);var A=u.calculateBounds(s),m=new E;m.setDeviceOrgX(A.getMinX()),m.setDeviceOrgY(A.getMinY()),m.setWorldOrgX(c.x),m.setWorldOrgY(c.y);for(var R=0;R1;){var X=_[0];_.splice(0,1);var H=w.indexOf(X);H>=0&&w.splice(H,1),U--,x--}f!=null?P=(w.indexOf(_[0])+1)%U:P=0;for(var W=Math.abs(L-c)/x,B=P;F!=x;B=++B%U){var K=w[B].getOtherEnd(s);if(K!=f){var j=(c+F*W)%360,ht=(j+W)%360;y.branchRadialLayout(K,s,j,ht,A+m,m),F++}}},y.maxDiagonalInTree=function(s){for(var f=v.MIN_VALUE,c=0;cf&&(f=A)}return f},y.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},y.prototype.groupZeroDegreeMembers=function(){var s=this,f={};this.memberGroups={},this.idToDummyNode={};for(var c=[],L=this.graphManager.getAllNodes(),A=0;A"u"&&(f[C]=[]),f[C]=f[C].concat(m)}Object.keys(f).forEach(function(M){if(f[M].length>1){var S="DummyCompound_"+M;s.memberGroups[S]=f[M];var Y=f[M][0].getParent(),w=new l(s.graphManager);w.id=S,w.paddingLeft=Y.paddingLeft||0,w.paddingRight=Y.paddingRight||0,w.paddingBottom=Y.paddingBottom||0,w.paddingTop=Y.paddingTop||0,s.idToDummyNode[S]=w;var x=s.getGraphManager().add(s.newGraph(),w),F=Y.getChild();F.add(w);for(var U=0;U=0;s--){var f=this.compoundOrder[s],c=f.id,L=f.paddingLeft,A=f.paddingTop;this.adjustLocations(this.tiledMemberPack[c],f.rect.x,f.rect.y,L,A)}},y.prototype.repopulateZeroDegreeMembers=function(){var s=this,f=this.tiledZeroDegreePack;Object.keys(f).forEach(function(c){var L=s.idToDummyNode[c],A=L.paddingLeft,m=L.paddingTop;s.adjustLocations(f[c],L.rect.x,L.rect.y,A,m)})},y.prototype.getToBeTiled=function(s){var f=s.id;if(this.toBeTiled[f]!=null)return this.toBeTiled[f];var c=s.getChild();if(c==null)return this.toBeTiled[f]=!1,!1;for(var L=c.getNodes(),A=0;A0)return this.toBeTiled[f]=!1,!1;if(m.getChild()==null){this.toBeTiled[m.id]=!1;continue}if(!this.getToBeTiled(m))return this.toBeTiled[f]=!1,!1}return this.toBeTiled[f]=!0,!0},y.prototype.getNodeDegree=function(s){s.id;for(var f=s.getEdges(),c=0,L=0;LM&&(M=Y.rect.height)}c+=M+s.verticalPadding}},y.prototype.tileCompoundMembers=function(s,f){var c=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(L){var A=f[L];c.tiledMemberPack[L]=c.tileNodes(s[L],A.paddingLeft+A.paddingRight),A.rect.width=c.tiledMemberPack[L].width,A.rect.height=c.tiledMemberPack[L].height})},y.prototype.tileNodes=function(s,f){var c=n.TILING_PADDING_VERTICAL,L=n.TILING_PADDING_HORIZONTAL,A={rows:[],rowWidth:[],rowHeight:[],width:0,height:f,verticalPadding:c,horizontalPadding:L};s.sort(function(C,M){return C.rect.width*C.rect.height>M.rect.width*M.rect.height?-1:C.rect.width*C.rect.height0&&(R+=s.horizontalPadding),s.rowWidth[c]=R,s.width0&&(C+=s.verticalPadding);var M=0;C>s.rowHeight[c]&&(M=s.rowHeight[c],s.rowHeight[c]=C,M=s.rowHeight[c]-M),s.height+=M,s.rows[c].push(f)},y.prototype.getShortestRowIndex=function(s){for(var f=-1,c=Number.MAX_VALUE,L=0;Lc&&(f=L,c=s.rowWidth[L]);return f},y.prototype.canAddHorizontal=function(s,f,c){var L=this.getShortestRowIndex(s);if(L<0)return!0;var A=s.rowWidth[L];if(A+s.horizontalPadding+f<=s.width)return!0;var m=0;s.rowHeight[L]0&&(m=c+s.verticalPadding-s.rowHeight[L]);var R;s.width-A>=f+s.horizontalPadding?R=(s.height+m)/(A+f+s.horizontalPadding):R=(s.height+m)/s.width,m=c+s.verticalPadding;var C;return s.widthm&&f!=c){L.splice(-1,1),s.rows[c].push(A),s.rowWidth[f]=s.rowWidth[f]-m,s.rowWidth[c]=s.rowWidth[c]+m,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var R=Number.MIN_VALUE,C=0;CR&&(R=L[C].height);f>0&&(R+=s.verticalPadding);var M=s.rowHeight[f]+s.rowHeight[c];s.rowHeight[f]=R,s.rowHeight[c]0)for(var F=A;F<=m;F++)x[0]+=this.grid[F][R-1].length+this.grid[F][R].length-1;if(m0)for(var F=R;F<=C;F++)x[3]+=this.grid[A-1][F].length+this.grid[A][F].length-1;for(var U=v.MAX_VALUE,P,_,X=0;X0){var C;C=E.getGraphManager().add(E.newGraph(),c),this.processChildrenList(C,f,E)}}},a.prototype.stop=function(){return this.stopped=!0,this};var v=function(u){u("layout","cose-bilkent",a)};typeof cytoscape<"u"&&v(cytoscape),I.exports=v}])})})(tt);var ct=tt.exports;const pt=lt(ct);J.use(pt);function et(G,b){G.forEach(N=>{const I={id:N.id,labelText:N.label,height:N.height,width:N.width,padding:N.padding??0};Object.keys(N).forEach(T=>{["id","label","height","width","padding","x","y"].includes(T)||(I[T]=N[T])}),b.add({group:"nodes",data:I,position:{x:N.x??0,y:N.y??0}})})}V(et,"addNodes");function rt(G,b){G.forEach(N=>{const I={id:N.id,source:N.start,target:N.end};Object.keys(N).forEach(T=>{["id","start","end"].includes(T)||(I[T]=N[T])}),b.add({group:"edges",data:I})})}V(rt,"addEdges");function it(G){return new Promise(b=>{const N=gt("body").append("div").attr("id","cy").attr("style","display:none"),I=J({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});N.remove(),et(G.nodes,I),rt(G.edges,I),I.nodes().forEach(function(o){o.layoutDimensions=()=>{const e=o.data();return{w:e.width,h:e.height}}});const T={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};I.layout(T).run(),I.ready(o=>{k.info("Cytoscape ready",o),b(I)})})}V(it,"createCytoscapeInstance");function nt(G){return G.nodes().map(b=>{const N=b.data(),I=b.position(),T={id:N.id,x:I.x,y:I.y};return Object.keys(N).forEach(o=>{o!=="id"&&(T[o]=N[o])}),T})}V(nt,"extractPositionedNodes");function ot(G){return G.edges().map(b=>{const N=b.data(),I=b._private.rscratch,T={id:N.id,source:N.source,target:N.target,startX:I.startX,startY:I.startY,midX:I.midX,midY:I.midY,endX:I.endX,endY:I.endY};return Object.keys(N).forEach(o=>{["id","source","target"].includes(o)||(T[o]=N[o])}),T})}V(ot,"extractPositionedEdges");async function st(G,b){k.debug("Starting cose-bilkent layout algorithm");try{at(G);const N=await it(G),I=nt(N),T=ot(N);return k.debug(`Layout completed: ${I.length} nodes, ${T.length} edges`),{nodes:I,edges:T}}catch(N){throw k.error("Error in cose-bilkent layout algorithm:",N),N}}V(st,"executeCoseBilkentLayout");function at(G){if(!G)throw new Error("Layout data is required");if(!G.config)throw new Error("Configuration is required in layout data");if(!G.rootNode)throw new Error("Root node is required");if(!G.nodes||!Array.isArray(G.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(G.edges))throw new Error("Edges array is required in layout data");return!0}V(at,"validateLayoutData");var dt=V(async(G,b,{insertCluster:N,insertEdge:I,insertEdgeLabel:T,insertMarkers:o,insertNode:e,log:t,positionEdgeLabel:i},{algorithm:l})=>{const g={},n={},d=b.select("g");o(d,G.markers,G.type,G.diagramId);const r=d.insert("g").attr("class","subgraphs"),h=d.insert("g").attr("class","edgePaths"),a=d.insert("g").attr("class","edgeLabels"),p=d.insert("g").attr("class","nodes");t.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(G.nodes.map(async u=>{if(u.isGroup){const E={...u};n[u.id]=E,g[u.id]=E,await N(r,u)}else{const E={...u};g[u.id]=E;const y=await e(p,u,{config:G.config,dir:G.direction||"TB"}),O=y.node().getBBox();E.width=O.width,E.height=O.height,E.domId=y,t.debug(`Node ${u.id} dimensions: ${O.width}x${O.height}`)}})),t.debug("Running cose-bilkent layout algorithm");const v={...G,nodes:G.nodes.map(u=>{const E=g[u.id];return{...u,width:E.width,height:E.height}})},D=await st(v,G.config);t.debug("Positioning nodes based on layout results"),D.nodes.forEach(u=>{const E=g[u.id];E!=null&&E.domId&&(E.domId.attr("transform",`translate(${u.x}, ${u.y})`),E.x=u.x,E.y=u.y,t.debug(`Positioned node ${E.id} at center (${u.x}, ${u.y})`))}),D.edges.forEach(u=>{const E=G.edges.find(y=>y.id===u.id);E&&(E.points=[{x:u.startX,y:u.startY},{x:u.midX,y:u.midY},{x:u.endX,y:u.endY}])}),t.debug("Inserting and positioning edges"),await Promise.all(G.edges.map(async u=>{await T(a,u);const E=g[u.start??""],y=g[u.end??""];if(E&&y){const O=D.edges.find(s=>s.id===u.id);if(O){t.debug("APA01 positionedEdge",O);const s={...u},f=I(h,s,n,G.type,E,y,G.diagramId);i(s,f)}else{const s={...u,points:[{x:E.x||0,y:E.y||0},{x:y.x||0,y:y.y||0}]},f=I(h,s,n,G.type,E,y,G.diagramId);i(s,f)}}})),t.debug("Cose-bilkent rendering completed")},"render"),Tt=dt;export{Tt as render}; +import{a as V,at as k}from"./mermaid.core-DAx4nvmm.js";import{c as J}from"../../chunks/cytoscape.esm-Dz9tvMTw.js";import{U as $,ad as lt,aG as gt}from"../../app/index-8JtvDNuA.js";import"../../chunks/purify.es-BnINGy_Y.js";var tt={exports:{}},Z={exports:{}},Q={exports:{}},q;function ut(){return q||(q=1,function(G,b){(function(I,T){G.exports=T()})($,function(){return function(N){var I={};function T(o){if(I[o])return I[o].exports;var e=I[o]={i:o,l:!1,exports:{}};return N[o].call(e.exports,e,e.exports,T),e.l=!0,e.exports}return T.m=N,T.c=I,T.i=function(o){return o},T.d=function(o,e,t){T.o(o,e)||Object.defineProperty(o,e,{configurable:!1,enumerable:!0,get:t})},T.n=function(o){var e=o&&o.__esModule?function(){return o.default}:function(){return o};return T.d(e,"a",e),e},T.o=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)},T.p="",T(T.s=26)}([function(N,I,T){function o(){}o.QUALITY=1,o.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,o.DEFAULT_INCREMENTAL=!1,o.DEFAULT_ANIMATION_ON_LAYOUT=!0,o.DEFAULT_ANIMATION_DURING_LAYOUT=!1,o.DEFAULT_ANIMATION_PERIOD=50,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,o.DEFAULT_GRAPH_MARGIN=15,o.NODE_DIMENSIONS_INCLUDE_LABELS=!1,o.SIMPLE_NODE_SIZE=40,o.SIMPLE_NODE_HALF_SIZE=o.SIMPLE_NODE_SIZE/2,o.EMPTY_COMPOUND_NODE_SIZE=40,o.MIN_EDGE_LENGTH=1,o.WORLD_BOUNDARY=1e6,o.INITIAL_WORLD_BOUNDARY=o.WORLD_BOUNDARY/1e3,o.WORLD_CENTER_X=1200,o.WORLD_CENTER_Y=900,N.exports=o},function(N,I,T){var o=T(2),e=T(8),t=T(9);function i(g,n,d){o.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=g,this.target=n}i.prototype=Object.create(o.prototype);for(var l in o)i[l]=o[l];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(g){if(this.source===g)return this.target;if(this.target===g)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(g,n){for(var d=this.getOtherEnd(g),r=n.getGraphManager().getRoot();;){if(d.getOwner()==n)return d;if(d.getOwner()==r)break;d=d.getOwner().getParent()}return null},i.prototype.updateLength=function(){var g=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),g),this.isOverlapingSourceAndTarget||(this.lengthX=g[0]-g[2],this.lengthY=g[1]-g[3],Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},i.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},N.exports=i},function(N,I,T){function o(e){this.vGraphObject=e}N.exports=o},function(N,I,T){var o=T(2),e=T(10),t=T(13),i=T(0),l=T(16),g=T(4);function n(r,h,a,p){a==null&&p==null&&(p=h),o.call(this,p),r.graphManager!=null&&(r=r.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=p,this.edges=[],this.graphManager=r,a!=null&&h!=null?this.rect=new t(h.x,h.y,a.width,a.height):this.rect=new t}n.prototype=Object.create(o.prototype);for(var d in o)n[d]=o[d];n.prototype.getEdges=function(){return this.edges},n.prototype.getChild=function(){return this.child},n.prototype.getOwner=function(){return this.owner},n.prototype.getWidth=function(){return this.rect.width},n.prototype.setWidth=function(r){this.rect.width=r},n.prototype.getHeight=function(){return this.rect.height},n.prototype.setHeight=function(r){this.rect.height=r},n.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},n.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},n.prototype.getCenter=function(){return new g(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},n.prototype.getLocation=function(){return new g(this.rect.x,this.rect.y)},n.prototype.getRect=function(){return this.rect},n.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},n.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},n.prototype.setRect=function(r,h){this.rect.x=r.x,this.rect.y=r.y,this.rect.width=h.width,this.rect.height=h.height},n.prototype.setCenter=function(r,h){this.rect.x=r-this.rect.width/2,this.rect.y=h-this.rect.height/2},n.prototype.setLocation=function(r,h){this.rect.x=r,this.rect.y=h},n.prototype.moveBy=function(r,h){this.rect.x+=r,this.rect.y+=h},n.prototype.getEdgeListToNode=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(p.target==r){if(p.source!=a)throw"Incorrect edge source!";h.push(p)}}),h},n.prototype.getEdgesBetween=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(!(p.source==a||p.target==a))throw"Incorrect edge source and/or target";(p.target==r||p.source==r)&&h.push(p)}),h},n.prototype.getNeighborsList=function(){var r=new Set,h=this;return h.edges.forEach(function(a){if(a.source==h)r.add(a.target);else{if(a.target!=h)throw"Incorrect incidency!";r.add(a.source)}}),r},n.prototype.withChildren=function(){var r=new Set,h,a;if(r.add(this),this.child!=null)for(var p=this.child.getNodes(),v=0;vh&&(this.rect.x-=(this.labelWidth-h)/2,this.setWidth(this.labelWidth)),this.labelHeight>a&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-a)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-a),this.setHeight(this.labelHeight))}}},n.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},n.prototype.transform=function(r){var h=this.rect.x;h>i.WORLD_BOUNDARY?h=i.WORLD_BOUNDARY:h<-i.WORLD_BOUNDARY&&(h=-i.WORLD_BOUNDARY);var a=this.rect.y;a>i.WORLD_BOUNDARY?a=i.WORLD_BOUNDARY:a<-i.WORLD_BOUNDARY&&(a=-i.WORLD_BOUNDARY);var p=new g(h,a),v=r.inverseTransformPoint(p);this.setLocation(v.x,v.y)},n.prototype.getLeft=function(){return this.rect.x},n.prototype.getRight=function(){return this.rect.x+this.rect.width},n.prototype.getTop=function(){return this.rect.y},n.prototype.getBottom=function(){return this.rect.y+this.rect.height},n.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},N.exports=n},function(N,I,T){function o(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}o.prototype.getX=function(){return this.x},o.prototype.getY=function(){return this.y},o.prototype.setX=function(e){this.x=e},o.prototype.setY=function(e){this.y=e},o.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},o.prototype.getCopy=function(){return new o(this.x,this.y)},o.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},N.exports=o},function(N,I,T){var o=T(2),e=T(10),t=T(0),i=T(6),l=T(3),g=T(1),n=T(13),d=T(12),r=T(11);function h(p,v,D){o.call(this,D),this.estimatedSize=e.MIN_VALUE,this.margin=t.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=p,v!=null&&v instanceof i?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}h.prototype=Object.create(o.prototype);for(var a in o)h[a]=o[a];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(p,v,D){if(v==null&&D==null){var u=p;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(u)>-1)throw"Node already in graph!";return u.owner=this,this.getNodes().push(u),u}else{var E=p;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(D)>-1))throw"Source or target not in graph!";if(!(v.owner==D.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=D.owner?null:(E.source=v,E.target=D,E.isInterGraph=!1,this.getEdges().push(E),v.edges.push(E),D!=v&&D.edges.push(E),E)}},h.prototype.remove=function(p){var v=p;if(p instanceof l){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var D=v.edges.slice(),u,E=D.length,y=0;y-1&&f>-1))throw"Source and/or target doesn't know this edge!";u.source.edges.splice(s,1),u.target!=u.source&&u.target.edges.splice(f,1);var O=u.source.owner.getEdges().indexOf(u);if(O==-1)throw"Not in owner's edge list!";u.source.owner.getEdges().splice(O,1)}},h.prototype.updateLeftTop=function(){for(var p=e.MAX_VALUE,v=e.MAX_VALUE,D,u,E,y=this.getNodes(),O=y.length,s=0;sD&&(p=D),v>u&&(v=u)}return p==e.MAX_VALUE?null:(y[0].getParent().paddingLeft!=null?E=y[0].getParent().paddingLeft:E=this.margin,this.left=v-E,this.top=p-E,new d(this.left,this.top))},h.prototype.updateBounds=function(p){for(var v=e.MAX_VALUE,D=-e.MAX_VALUE,u=e.MAX_VALUE,E=-e.MAX_VALUE,y,O,s,f,c,L=this.nodes,A=L.length,m=0;my&&(v=y),Ds&&(u=s),Ey&&(v=y),Ds&&(u=s),E=this.nodes.length){var A=0;D.forEach(function(m){m.owner==p&&A++}),A==this.nodes.length&&(this.isConnected=!0)}},N.exports=h},function(N,I,T){var o,e=T(1);function t(i){o=T(5),this.layout=i,this.graphs=[],this.edges=[]}t.prototype.addRoot=function(){var i=this.layout.newGraph(),l=this.layout.newNode(null),g=this.add(i,l);return this.setRootGraph(g),this.rootGraph},t.prototype.add=function(i,l,g,n,d){if(g==null&&n==null&&d==null){if(i==null)throw"Graph is null!";if(l==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(l.child!=null)throw"Already has a child!";return i.parent=l,l.child=i,i}else{d=g,n=l,g=i;var r=n.getOwner(),h=d.getOwner();if(!(r!=null&&r.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(h!=null&&h.getGraphManager()==this))throw"Target not in this graph mgr!";if(r==h)return g.isInterGraph=!1,r.add(g,n,d);if(g.isInterGraph=!0,g.source=n,g.target=d,this.edges.indexOf(g)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(g),!(g.source!=null&&g.target!=null))throw"Edge source and/or target is null!";if(!(g.source.edges.indexOf(g)==-1&&g.target.edges.indexOf(g)==-1))throw"Edge already in source and/or target incidency list!";return g.source.edges.push(g),g.target.edges.push(g),g}},t.prototype.remove=function(i){if(i instanceof o){var l=i;if(l.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(l==this.rootGraph||l.parent!=null&&l.parent.graphManager==this))throw"Invalid parent node!";var g=[];g=g.concat(l.getEdges());for(var n,d=g.length,r=0;r=i.getRight()?l[0]+=Math.min(i.getX()-t.getX(),t.getRight()-i.getRight()):i.getX()<=t.getX()&&i.getRight()>=t.getRight()&&(l[0]+=Math.min(t.getX()-i.getX(),i.getRight()-t.getRight())),t.getY()<=i.getY()&&t.getBottom()>=i.getBottom()?l[1]+=Math.min(i.getY()-t.getY(),t.getBottom()-i.getBottom()):i.getY()<=t.getY()&&i.getBottom()>=t.getBottom()&&(l[1]+=Math.min(t.getY()-i.getY(),i.getBottom()-t.getBottom()));var d=Math.abs((i.getCenterY()-t.getCenterY())/(i.getCenterX()-t.getCenterX()));i.getCenterY()===t.getCenterY()&&i.getCenterX()===t.getCenterX()&&(d=1);var r=d*l[0],h=l[1]/d;l[0]r)return l[0]=g,l[1]=a,l[2]=d,l[3]=L,!1;if(nd)return l[0]=h,l[1]=n,l[2]=f,l[3]=r,!1;if(gd?(l[0]=v,l[1]=D,C=!0):(l[0]=p,l[1]=a,C=!0):S===w&&(g>d?(l[0]=h,l[1]=a,C=!0):(l[0]=u,l[1]=D,C=!0)),-Y===w?d>g?(l[2]=c,l[3]=L,M=!0):(l[2]=f,l[3]=s,M=!0):Y===w&&(d>g?(l[2]=O,l[3]=s,M=!0):(l[2]=A,l[3]=L,M=!0)),C&&M)return!1;if(g>d?n>r?(x=this.getCardinalDirection(S,w,4),F=this.getCardinalDirection(Y,w,2)):(x=this.getCardinalDirection(-S,w,3),F=this.getCardinalDirection(-Y,w,1)):n>r?(x=this.getCardinalDirection(-S,w,1),F=this.getCardinalDirection(-Y,w,3)):(x=this.getCardinalDirection(S,w,2),F=this.getCardinalDirection(Y,w,4)),!C)switch(x){case 1:P=a,U=g+-y/w,l[0]=U,l[1]=P;break;case 2:U=u,P=n+E*w,l[0]=U,l[1]=P;break;case 3:P=D,U=g+y/w,l[0]=U,l[1]=P;break;case 4:U=v,P=n+-E*w,l[0]=U,l[1]=P;break}if(!M)switch(F){case 1:X=s,_=d+-R/w,l[2]=_,l[3]=X;break;case 2:_=A,X=r+m*w,l[2]=_,l[3]=X;break;case 3:X=L,_=d+R/w,l[2]=_,l[3]=X;break;case 4:_=c,X=r+-m*w,l[2]=_,l[3]=X;break}}return!1},e.getCardinalDirection=function(t,i,l){return t>i?l:1+l%4},e.getIntersection=function(t,i,l,g){if(g==null)return this.getIntersection2(t,i,l);var n=t.x,d=t.y,r=i.x,h=i.y,a=l.x,p=l.y,v=g.x,D=g.y,u=void 0,E=void 0,y=void 0,O=void 0,s=void 0,f=void 0,c=void 0,L=void 0,A=void 0;return y=h-d,s=n-r,c=r*d-n*h,O=D-p,f=a-v,L=v*p-a*D,A=y*f-O*s,A===0?null:(u=(s*L-f*c)/A,E=(O*c-y*L)/A,new o(u,E))},e.angleOfVector=function(t,i,l,g){var n=void 0;return t!==l?(n=Math.atan((g-i)/(l-t)),l0?1:e<0?-1:0},o.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},o.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},N.exports=o},function(N,I,T){function o(){}o.MAX_VALUE=2147483647,o.MIN_VALUE=-2147483648,N.exports=o},function(N,I,T){var o=function(){function n(d,r){for(var h=0;h"u"?"undefined":o(t);return t==null||i!="object"&&i!="function"},N.exports=e},function(N,I,T){function o(a){if(Array.isArray(a)){for(var p=0,v=Array(a.length);p0&&p;){for(y.push(s[0]);y.length>0&&p;){var f=y[0];y.splice(0,1),E.add(f);for(var c=f.getEdges(),u=0;u-1&&s.splice(R,1)}E=new Set,O=new Map}}return a},h.prototype.createDummyNodesForBendpoints=function(a){for(var p=[],v=a.source,D=this.graphManager.calcLowestCommonAncestor(a.source,a.target),u=0;u0){for(var D=this.edgeToDummyNodes.get(v),u=0;u=0&&p.splice(L,1);var A=O.getNeighborsList();A.forEach(function(C){if(v.indexOf(C)<0){var M=D.get(C),S=M-1;S==1&&f.push(C),D.set(C,S)}})}v=v.concat(f),(p.length==1||p.length==2)&&(u=!0,E=p[0])}return E},h.prototype.setGraphManager=function(a){this.graphManager=a},N.exports=h},function(N,I,T){function o(){}o.seed=1,o.x=0,o.nextDouble=function(){return o.x=Math.sin(o.seed++)*1e4,o.x-Math.floor(o.x)},N.exports=o},function(N,I,T){var o=T(4);function e(t,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(t){this.lworldExtX=t},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(t){this.lworldExtY=t},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},e.prototype.transformX=function(t){var i=0,l=this.lworldExtX;return l!=0&&(i=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/l),i},e.prototype.transformY=function(t){var i=0,l=this.lworldExtY;return l!=0&&(i=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/l),i},e.prototype.inverseTransformX=function(t){var i=0,l=this.ldeviceExtX;return l!=0&&(i=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/l),i},e.prototype.inverseTransformY=function(t){var i=0,l=this.ldeviceExtY;return l!=0&&(i=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/l),i},e.prototype.inverseTransformPoint=function(t){var i=new o(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return i},N.exports=e},function(N,I,T){function o(r){if(Array.isArray(r)){for(var h=0,a=Array(r.length);ht.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*t.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-t.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT_INCREMENTAL):(r>t.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(t.COOLING_ADAPTATION_FACTOR,1-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*(1-t.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},n.prototype.calcSpringForces=function(){for(var r=this.getAllEdges(),h,a=0;a0&&arguments[0]!==void 0?arguments[0]:!0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a,p,v,D,u=this.getAllNodes(),E;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&r&&this.updateGrid(),E=new Set,a=0;ay||E>y)&&(r.gravitationForceX=-this.gravityConstant*v,r.gravitationForceY=-this.gravityConstant*D)):(y=h.getEstimatedSize()*this.compoundGravityRangeFactor,(u>y||E>y)&&(r.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,r.gravitationForceY=-this.gravityConstant*D*this.compoundGravityConstant))},n.prototype.isConverged=function(){var r,h=!1;return this.totalIterations>this.maxIterations/3&&(h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),r=this.totalDisplacement=u.length||y>=u[0].length)){for(var O=0;On}}]),l}();N.exports=i},function(N,I,T){var o=function(){function i(l,g){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:1,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;e(this,i),this.sequence1=l,this.sequence2=g,this.match_score=n,this.mismatch_penalty=d,this.gap_penalty=r,this.iMax=l.length+1,this.jMax=g.length+1,this.grid=new Array(this.iMax);for(var h=0;h=0;l--){var g=this.listeners[l];g.event===t&&g.callback===i&&this.listeners.splice(l,1)}},e.emit=function(t,i){for(var l=0;lg.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),g.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},i.prototype.propogateDisplacementToChildren=function(g,n){for(var d=this.getChild().getNodes(),r,h=0;h0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var f=new Set(this.getAllNodes()),c=this.nodesWithGravity.filter(function(L){return f.has(L)});this.graphManager.setAllNodesToApplyGravitation(c),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},y.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),f=this.nodesWithGravity.filter(function(A){return s.has(A)});this.graphManager.setAllNodesToApplyGravitation(f),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var c=!this.isTreeGrowing&&!this.isGrowthFinished,L=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,L),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},y.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),f={},c=0;c1){var C;for(C=0;CL&&(L=Math.floor(R.y)),m=Math.floor(R.x+n.DEFAULT_COMPONENT_SEPERATION)}this.transform(new a(r.WORLD_CENTER_X-R.x/2,r.WORLD_CENTER_Y-R.y/2))},y.radialLayout=function(s,f,c){var L=Math.max(this.maxDiagonalInTree(s),n.DEFAULT_RADIAL_SEPARATION);y.branchRadialLayout(f,null,0,359,0,L);var A=u.calculateBounds(s),m=new E;m.setDeviceOrgX(A.getMinX()),m.setDeviceOrgY(A.getMinY()),m.setWorldOrgX(c.x),m.setWorldOrgY(c.y);for(var R=0;R1;){var X=_[0];_.splice(0,1);var H=w.indexOf(X);H>=0&&w.splice(H,1),U--,x--}f!=null?P=(w.indexOf(_[0])+1)%U:P=0;for(var W=Math.abs(L-c)/x,B=P;F!=x;B=++B%U){var K=w[B].getOtherEnd(s);if(K!=f){var j=(c+F*W)%360,ht=(j+W)%360;y.branchRadialLayout(K,s,j,ht,A+m,m),F++}}},y.maxDiagonalInTree=function(s){for(var f=v.MIN_VALUE,c=0;cf&&(f=A)}return f},y.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},y.prototype.groupZeroDegreeMembers=function(){var s=this,f={};this.memberGroups={},this.idToDummyNode={};for(var c=[],L=this.graphManager.getAllNodes(),A=0;A"u"&&(f[C]=[]),f[C]=f[C].concat(m)}Object.keys(f).forEach(function(M){if(f[M].length>1){var S="DummyCompound_"+M;s.memberGroups[S]=f[M];var Y=f[M][0].getParent(),w=new l(s.graphManager);w.id=S,w.paddingLeft=Y.paddingLeft||0,w.paddingRight=Y.paddingRight||0,w.paddingBottom=Y.paddingBottom||0,w.paddingTop=Y.paddingTop||0,s.idToDummyNode[S]=w;var x=s.getGraphManager().add(s.newGraph(),w),F=Y.getChild();F.add(w);for(var U=0;U=0;s--){var f=this.compoundOrder[s],c=f.id,L=f.paddingLeft,A=f.paddingTop;this.adjustLocations(this.tiledMemberPack[c],f.rect.x,f.rect.y,L,A)}},y.prototype.repopulateZeroDegreeMembers=function(){var s=this,f=this.tiledZeroDegreePack;Object.keys(f).forEach(function(c){var L=s.idToDummyNode[c],A=L.paddingLeft,m=L.paddingTop;s.adjustLocations(f[c],L.rect.x,L.rect.y,A,m)})},y.prototype.getToBeTiled=function(s){var f=s.id;if(this.toBeTiled[f]!=null)return this.toBeTiled[f];var c=s.getChild();if(c==null)return this.toBeTiled[f]=!1,!1;for(var L=c.getNodes(),A=0;A0)return this.toBeTiled[f]=!1,!1;if(m.getChild()==null){this.toBeTiled[m.id]=!1;continue}if(!this.getToBeTiled(m))return this.toBeTiled[f]=!1,!1}return this.toBeTiled[f]=!0,!0},y.prototype.getNodeDegree=function(s){s.id;for(var f=s.getEdges(),c=0,L=0;LM&&(M=Y.rect.height)}c+=M+s.verticalPadding}},y.prototype.tileCompoundMembers=function(s,f){var c=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(L){var A=f[L];c.tiledMemberPack[L]=c.tileNodes(s[L],A.paddingLeft+A.paddingRight),A.rect.width=c.tiledMemberPack[L].width,A.rect.height=c.tiledMemberPack[L].height})},y.prototype.tileNodes=function(s,f){var c=n.TILING_PADDING_VERTICAL,L=n.TILING_PADDING_HORIZONTAL,A={rows:[],rowWidth:[],rowHeight:[],width:0,height:f,verticalPadding:c,horizontalPadding:L};s.sort(function(C,M){return C.rect.width*C.rect.height>M.rect.width*M.rect.height?-1:C.rect.width*C.rect.height0&&(R+=s.horizontalPadding),s.rowWidth[c]=R,s.width0&&(C+=s.verticalPadding);var M=0;C>s.rowHeight[c]&&(M=s.rowHeight[c],s.rowHeight[c]=C,M=s.rowHeight[c]-M),s.height+=M,s.rows[c].push(f)},y.prototype.getShortestRowIndex=function(s){for(var f=-1,c=Number.MAX_VALUE,L=0;Lc&&(f=L,c=s.rowWidth[L]);return f},y.prototype.canAddHorizontal=function(s,f,c){var L=this.getShortestRowIndex(s);if(L<0)return!0;var A=s.rowWidth[L];if(A+s.horizontalPadding+f<=s.width)return!0;var m=0;s.rowHeight[L]0&&(m=c+s.verticalPadding-s.rowHeight[L]);var R;s.width-A>=f+s.horizontalPadding?R=(s.height+m)/(A+f+s.horizontalPadding):R=(s.height+m)/s.width,m=c+s.verticalPadding;var C;return s.widthm&&f!=c){L.splice(-1,1),s.rows[c].push(A),s.rowWidth[f]=s.rowWidth[f]-m,s.rowWidth[c]=s.rowWidth[c]+m,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var R=Number.MIN_VALUE,C=0;CR&&(R=L[C].height);f>0&&(R+=s.verticalPadding);var M=s.rowHeight[f]+s.rowHeight[c];s.rowHeight[f]=R,s.rowHeight[c]0)for(var F=A;F<=m;F++)x[0]+=this.grid[F][R-1].length+this.grid[F][R].length-1;if(m0)for(var F=R;F<=C;F++)x[3]+=this.grid[A-1][F].length+this.grid[A][F].length-1;for(var U=v.MAX_VALUE,P,_,X=0;X0){var C;C=E.getGraphManager().add(E.newGraph(),c),this.processChildrenList(C,f,E)}}},a.prototype.stop=function(){return this.stopped=!0,this};var v=function(u){u("layout","cose-bilkent",a)};typeof cytoscape<"u"&&v(cytoscape),I.exports=v}])})})(tt);var ct=tt.exports;const pt=lt(ct);J.use(pt);function et(G,b){G.forEach(N=>{const I={id:N.id,labelText:N.label,height:N.height,width:N.width,padding:N.padding??0};Object.keys(N).forEach(T=>{["id","label","height","width","padding","x","y"].includes(T)||(I[T]=N[T])}),b.add({group:"nodes",data:I,position:{x:N.x??0,y:N.y??0}})})}V(et,"addNodes");function rt(G,b){G.forEach(N=>{const I={id:N.id,source:N.start,target:N.end};Object.keys(N).forEach(T=>{["id","start","end"].includes(T)||(I[T]=N[T])}),b.add({group:"edges",data:I})})}V(rt,"addEdges");function it(G){return new Promise(b=>{const N=gt("body").append("div").attr("id","cy").attr("style","display:none"),I=J({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});N.remove(),et(G.nodes,I),rt(G.edges,I),I.nodes().forEach(function(o){o.layoutDimensions=()=>{const e=o.data();return{w:e.width,h:e.height}}});const T={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};I.layout(T).run(),I.ready(o=>{k.info("Cytoscape ready",o),b(I)})})}V(it,"createCytoscapeInstance");function nt(G){return G.nodes().map(b=>{const N=b.data(),I=b.position(),T={id:N.id,x:I.x,y:I.y};return Object.keys(N).forEach(o=>{o!=="id"&&(T[o]=N[o])}),T})}V(nt,"extractPositionedNodes");function ot(G){return G.edges().map(b=>{const N=b.data(),I=b._private.rscratch,T={id:N.id,source:N.source,target:N.target,startX:I.startX,startY:I.startY,midX:I.midX,midY:I.midY,endX:I.endX,endY:I.endY};return Object.keys(N).forEach(o=>{["id","source","target"].includes(o)||(T[o]=N[o])}),T})}V(ot,"extractPositionedEdges");async function st(G,b){k.debug("Starting cose-bilkent layout algorithm");try{at(G);const N=await it(G),I=nt(N),T=ot(N);return k.debug(`Layout completed: ${I.length} nodes, ${T.length} edges`),{nodes:I,edges:T}}catch(N){throw k.error("Error in cose-bilkent layout algorithm:",N),N}}V(st,"executeCoseBilkentLayout");function at(G){if(!G)throw new Error("Layout data is required");if(!G.config)throw new Error("Configuration is required in layout data");if(!G.rootNode)throw new Error("Root node is required");if(!G.nodes||!Array.isArray(G.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(G.edges))throw new Error("Edges array is required in layout data");return!0}V(at,"validateLayoutData");var dt=V(async(G,b,{insertCluster:N,insertEdge:I,insertEdgeLabel:T,insertMarkers:o,insertNode:e,log:t,positionEdgeLabel:i},{algorithm:l})=>{const g={},n={},d=b.select("g");o(d,G.markers,G.type,G.diagramId);const r=d.insert("g").attr("class","subgraphs"),h=d.insert("g").attr("class","edgePaths"),a=d.insert("g").attr("class","edgeLabels"),p=d.insert("g").attr("class","nodes");t.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(G.nodes.map(async u=>{if(u.isGroup){const E={...u};n[u.id]=E,g[u.id]=E,await N(r,u)}else{const E={...u};g[u.id]=E;const y=await e(p,u,{config:G.config,dir:G.direction||"TB"}),O=y.node().getBBox();E.width=O.width,E.height=O.height,E.domId=y,t.debug(`Node ${u.id} dimensions: ${O.width}x${O.height}`)}})),t.debug("Running cose-bilkent layout algorithm");const v={...G,nodes:G.nodes.map(u=>{const E=g[u.id];return{...u,width:E.width,height:E.height}})},D=await st(v,G.config);t.debug("Positioning nodes based on layout results"),D.nodes.forEach(u=>{const E=g[u.id];E!=null&&E.domId&&(E.domId.attr("transform",`translate(${u.x}, ${u.y})`),E.x=u.x,E.y=u.y,t.debug(`Positioned node ${E.id} at center (${u.x}, ${u.y})`))}),D.edges.forEach(u=>{const E=G.edges.find(y=>y.id===u.id);E&&(E.points=[{x:u.startX,y:u.startY},{x:u.midX,y:u.midY},{x:u.endX,y:u.endY}])}),t.debug("Inserting and positioning edges"),await Promise.all(G.edges.map(async u=>{await T(a,u);const E=g[u.start??""],y=g[u.end??""];if(E&&y){const O=D.edges.find(s=>s.id===u.id);if(O){t.debug("APA01 positionedEdge",O);const s={...u},f=I(h,s,n,G.type,E,y,G.diagramId);i(s,f)}else{const s={...u,points:[{x:E.x||0,y:E.y||0},{x:y.x||0,y:y.y||0}]},f=I(h,s,n,G.type,E,y,G.diagramId);i(s,f)}}})),t.debug("Cose-bilkent rendering completed")},"render"),Tt=dt;export{Tt as render}; diff --git a/veadk/webui/assets/visualizations/mermaid/cynefin-OW5HDTMX-DBq9B5VP.js b/veadk/webui/assets/visualizations/mermaid/cynefin-OW5HDTMX-BHP1Kvyc.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/cynefin-OW5HDTMX-DBq9B5VP.js rename to veadk/webui/assets/visualizations/mermaid/cynefin-OW5HDTMX-BHP1Kvyc.js index 63c0ba758..14b1e3a52 100644 --- a/veadk/webui/assets/visualizations/mermaid/cynefin-OW5HDTMX-DBq9B5VP.js +++ b/veadk/webui/assets/visualizations/mermaid/cynefin-OW5HDTMX-BHP1Kvyc.js @@ -1,4 +1,4 @@ -var dk=Object.defineProperty;var pk=(t,e,r)=>e in t?dk(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var Br=(t,e,r)=>pk(t,typeof e!="symbol"?e+"":e,r);import{_ as ut}from"../../app/index-BNPwMQXG.js";var mk=Object.create,Du=Object.defineProperty,hk=Object.getOwnPropertyDescriptor,Th=Object.getOwnPropertyNames,yk=Object.getPrototypeOf,gk=Object.prototype.hasOwnProperty,s=(t,e)=>Du(t,"name",{value:e,configurable:!0}),vk=(t,e)=>function(){return t&&(e=(0,t[Th(t)[0]])(t=0)),e},X=(t,e)=>function(){return e||(0,t[Th(t)[0]])((e={exports:{}}).exports,e),e.exports},tn=(t,e)=>{for(var r in e)Du(t,r,{get:e[r],enumerable:!0})},$h=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Th(e))!gk.call(t,a)&&a!==r&&Du(t,a,{get:()=>e[a],enumerable:!(n=hk(e,a))||n.enumerable});return t},Of=(t,e,r)=>($h(t,e,"default"),r),Rh=(t,e,r)=>(r=t!=null?mk(yk(t)):{},$h(Du(r,"default",{value:t,enumerable:!0}),t)),Ah=t=>$h(Du({},"__esModule",{value:!0}),t),Lf={};tn(Lf,{AnnotatedTextEdit:()=>Ar,ChangeAnnotation:()=>mn,ChangeAnnotationIdentifier:()=>et,CodeAction:()=>Qp,CodeActionContext:()=>Zp,CodeActionKind:()=>Jp,CodeActionTriggerKind:()=>Xl,CodeDescription:()=>Ip,CodeLens:()=>em,Color:()=>Ec,ColorInformation:()=>Ep,ColorPresentation:()=>Cp,Command:()=>pn,CompletionItem:()=>Fp,CompletionItemKind:()=>Op,CompletionItemLabelDetails:()=>Gp,CompletionItemTag:()=>Dp,CompletionList:()=>zp,CreateFile:()=>_a,DeleteFile:()=>wa,Diagnostic:()=>Vl,DiagnosticRelatedInformation:()=>Cc,DiagnosticSeverity:()=>Sp,DiagnosticTag:()=>wp,DocumentHighlight:()=>Wp,DocumentHighlightKind:()=>Kp,DocumentLink:()=>rm,DocumentSymbol:()=>Xp,DocumentUri:()=>$p,EOL:()=>x$,FoldingRange:()=>_p,FoldingRangeKind:()=>bp,FormattingOptions:()=>tm,Hover:()=>jp,InlayHint:()=>fm,InlayHintKind:()=>Sc,InlayHintLabelPart:()=>wc,InlineCompletionContext:()=>gm,InlineCompletionItem:()=>pm,InlineCompletionList:()=>mm,InlineCompletionTriggerKind:()=>hm,InlineValueContext:()=>cm,InlineValueEvaluatableExpression:()=>um,InlineValueText:()=>om,InlineValueVariableLookup:()=>lm,InsertReplaceEdit:()=>Mp,InsertTextFormat:()=>Lp,InsertTextMode:()=>xp,Location:()=>Wl,LocationLink:()=>Ap,MarkedString:()=>Yl,MarkupContent:()=>Ia,MarkupKind:()=>_c,OptionalVersionedTextDocumentIdentifier:()=>Hl,ParameterInformation:()=>Bp,Position:()=>oe,Range:()=>te,RenameFile:()=>Sa,SelectedCompletionInfo:()=>ym,SelectionRange:()=>nm,SemanticTokenModifiers:()=>im,SemanticTokenTypes:()=>am,SemanticTokens:()=>sm,SignatureInformation:()=>Up,StringValue:()=>dm,SymbolInformation:()=>Hp,SymbolKind:()=>Vp,SymbolTag:()=>qp,TextDocument:()=>Tm,TextDocumentEdit:()=>ql,TextDocumentIdentifier:()=>Np,TextDocumentItem:()=>kp,TextEdit:()=>ar,URI:()=>Ac,VersionedTextDocumentIdentifier:()=>Pp,WorkspaceChange:()=>M$,WorkspaceEdit:()=>bc,WorkspaceFolder:()=>vm,WorkspaceSymbol:()=>Yp,integer:()=>Rp,uinteger:()=>Kl});var $p,Ac,Rp,Kl,oe,te,Wl,Ap,Ec,Ep,Cp,bp,_p,Cc,Sp,wp,Ip,Vl,pn,ar,mn,et,Ar,ql,_a,Sa,wa,bc,kl,Ud,M$,Np,Pp,Hl,kp,_c,Ia,Op,Lp,Dp,Mp,xp,Gp,Fp,zp,Yl,jp,Bp,Up,Kp,Wp,Vp,qp,Hp,Yp,Xp,Jp,Xl,Zp,Qp,em,tm,rm,nm,am,im,sm,om,lm,um,cm,Sc,wc,fm,dm,pm,mm,hm,ym,gm,vm,x$,Tm,iv,C,Mu=vk({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){var t,e,r,n;(function(a){function i(o){return typeof o=="string"}s(i,"is"),a.is=i})($p||($p={})),function(a){function i(o){return typeof o=="string"}s(i,"is"),a.is=i}(Ac||(Ac={})),function(a){a.MIN_VALUE=-2147483648,a.MAX_VALUE=2147483647;function i(o){return typeof o=="number"&&a.MIN_VALUE<=o&&o<=a.MAX_VALUE}s(i,"is"),a.is=i}(Rp||(Rp={})),function(a){a.MIN_VALUE=0,a.MAX_VALUE=2147483647;function i(o){return typeof o=="number"&&a.MIN_VALUE<=o&&o<=a.MAX_VALUE}s(i,"is"),a.is=i}(Kl||(Kl={})),function(a){function i(u,l){return u===Number.MAX_VALUE&&(u=Kl.MAX_VALUE),l===Number.MAX_VALUE&&(l=Kl.MAX_VALUE),{line:u,character:l}}s(i,"create"),a.create=i;function o(u){let l=u;return C.objectLiteral(l)&&C.uinteger(l.line)&&C.uinteger(l.character)}s(o,"is"),a.is=o}(oe||(oe={})),function(a){function i(u,l,c,f){if(C.uinteger(u)&&C.uinteger(l)&&C.uinteger(c)&&C.uinteger(f))return{start:oe.create(u,l),end:oe.create(c,f)};if(oe.is(u)&&oe.is(l))return{start:u,end:l};throw new Error(`Range#create called with invalid arguments[${u}, ${l}, ${c}, ${f}]`)}s(i,"create"),a.create=i;function o(u){let l=u;return C.objectLiteral(l)&&oe.is(l.start)&&oe.is(l.end)}s(o,"is"),a.is=o}(te||(te={})),function(a){function i(u,l){return{uri:u,range:l}}s(i,"create"),a.create=i;function o(u){let l=u;return C.objectLiteral(l)&&te.is(l.range)&&(C.string(l.uri)||C.undefined(l.uri))}s(o,"is"),a.is=o}(Wl||(Wl={})),function(a){function i(u,l,c,f){return{targetUri:u,targetRange:l,targetSelectionRange:c,originSelectionRange:f}}s(i,"create"),a.create=i;function o(u){let l=u;return C.objectLiteral(l)&&te.is(l.targetRange)&&C.string(l.targetUri)&&te.is(l.targetSelectionRange)&&(te.is(l.originSelectionRange)||C.undefined(l.originSelectionRange))}s(o,"is"),a.is=o}(Ap||(Ap={})),function(a){function i(u,l,c,f){return{red:u,green:l,blue:c,alpha:f}}s(i,"create"),a.create=i;function o(u){const l=u;return C.objectLiteral(l)&&C.numberRange(l.red,0,1)&&C.numberRange(l.green,0,1)&&C.numberRange(l.blue,0,1)&&C.numberRange(l.alpha,0,1)}s(o,"is"),a.is=o}(Ec||(Ec={})),function(a){function i(u,l){return{range:u,color:l}}s(i,"create"),a.create=i;function o(u){const l=u;return C.objectLiteral(l)&&te.is(l.range)&&Ec.is(l.color)}s(o,"is"),a.is=o}(Ep||(Ep={})),function(a){function i(u,l,c){return{label:u,textEdit:l,additionalTextEdits:c}}s(i,"create"),a.create=i;function o(u){const l=u;return C.objectLiteral(l)&&C.string(l.label)&&(C.undefined(l.textEdit)||ar.is(l))&&(C.undefined(l.additionalTextEdits)||C.typedArray(l.additionalTextEdits,ar.is))}s(o,"is"),a.is=o}(Cp||(Cp={})),function(a){a.Comment="comment",a.Imports="imports",a.Region="region"}(bp||(bp={})),function(a){function i(u,l,c,f,d,p){const h={startLine:u,endLine:l};return C.defined(c)&&(h.startCharacter=c),C.defined(f)&&(h.endCharacter=f),C.defined(d)&&(h.kind=d),C.defined(p)&&(h.collapsedText=p),h}s(i,"create"),a.create=i;function o(u){const l=u;return C.objectLiteral(l)&&C.uinteger(l.startLine)&&C.uinteger(l.startLine)&&(C.undefined(l.startCharacter)||C.uinteger(l.startCharacter))&&(C.undefined(l.endCharacter)||C.uinteger(l.endCharacter))&&(C.undefined(l.kind)||C.string(l.kind))}s(o,"is"),a.is=o}(_p||(_p={})),function(a){function i(u,l){return{location:u,message:l}}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&Wl.is(l.location)&&C.string(l.message)}s(o,"is"),a.is=o}(Cc||(Cc={})),function(a){a.Error=1,a.Warning=2,a.Information=3,a.Hint=4}(Sp||(Sp={})),function(a){a.Unnecessary=1,a.Deprecated=2}(wp||(wp={})),function(a){function i(o){const u=o;return C.objectLiteral(u)&&C.string(u.href)}s(i,"is"),a.is=i}(Ip||(Ip={})),function(a){function i(u,l,c,f,d,p){let h={range:u,message:l};return C.defined(c)&&(h.severity=c),C.defined(f)&&(h.code=f),C.defined(d)&&(h.source=d),C.defined(p)&&(h.relatedInformation=p),h}s(i,"create"),a.create=i;function o(u){var l;let c=u;return C.defined(c)&&te.is(c.range)&&C.string(c.message)&&(C.number(c.severity)||C.undefined(c.severity))&&(C.integer(c.code)||C.string(c.code)||C.undefined(c.code))&&(C.undefined(c.codeDescription)||C.string((l=c.codeDescription)===null||l===void 0?void 0:l.href))&&(C.string(c.source)||C.undefined(c.source))&&(C.undefined(c.relatedInformation)||C.typedArray(c.relatedInformation,Cc.is))}s(o,"is"),a.is=o}(Vl||(Vl={})),function(a){function i(u,l,...c){let f={title:u,command:l};return C.defined(c)&&c.length>0&&(f.arguments=c),f}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&C.string(l.title)&&C.string(l.command)}s(o,"is"),a.is=o}(pn||(pn={})),function(a){function i(c,f){return{range:c,newText:f}}s(i,"replace"),a.replace=i;function o(c,f){return{range:{start:c,end:c},newText:f}}s(o,"insert"),a.insert=o;function u(c){return{range:c,newText:""}}s(u,"del"),a.del=u;function l(c){const f=c;return C.objectLiteral(f)&&C.string(f.newText)&&te.is(f.range)}s(l,"is"),a.is=l}(ar||(ar={})),function(a){function i(u,l,c){const f={label:u};return l!==void 0&&(f.needsConfirmation=l),c!==void 0&&(f.description=c),f}s(i,"create"),a.create=i;function o(u){const l=u;return C.objectLiteral(l)&&C.string(l.label)&&(C.boolean(l.needsConfirmation)||l.needsConfirmation===void 0)&&(C.string(l.description)||l.description===void 0)}s(o,"is"),a.is=o}(mn||(mn={})),function(a){function i(o){const u=o;return C.string(u)}s(i,"is"),a.is=i}(et||(et={})),function(a){function i(c,f,d){return{range:c,newText:f,annotationId:d}}s(i,"replace"),a.replace=i;function o(c,f,d){return{range:{start:c,end:c},newText:f,annotationId:d}}s(o,"insert"),a.insert=o;function u(c,f){return{range:c,newText:"",annotationId:f}}s(u,"del"),a.del=u;function l(c){const f=c;return ar.is(f)&&(mn.is(f.annotationId)||et.is(f.annotationId))}s(l,"is"),a.is=l}(Ar||(Ar={})),function(a){function i(u,l){return{textDocument:u,edits:l}}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&Hl.is(l.textDocument)&&Array.isArray(l.edits)}s(o,"is"),a.is=o}(ql||(ql={})),function(a){function i(u,l,c){let f={kind:"create",uri:u};return l!==void 0&&(l.overwrite!==void 0||l.ignoreIfExists!==void 0)&&(f.options=l),c!==void 0&&(f.annotationId=c),f}s(i,"create"),a.create=i;function o(u){let l=u;return l&&l.kind==="create"&&C.string(l.uri)&&(l.options===void 0||(l.options.overwrite===void 0||C.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||C.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||et.is(l.annotationId))}s(o,"is"),a.is=o}(_a||(_a={})),function(a){function i(u,l,c,f){let d={kind:"rename",oldUri:u,newUri:l};return c!==void 0&&(c.overwrite!==void 0||c.ignoreIfExists!==void 0)&&(d.options=c),f!==void 0&&(d.annotationId=f),d}s(i,"create"),a.create=i;function o(u){let l=u;return l&&l.kind==="rename"&&C.string(l.oldUri)&&C.string(l.newUri)&&(l.options===void 0||(l.options.overwrite===void 0||C.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||C.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||et.is(l.annotationId))}s(o,"is"),a.is=o}(Sa||(Sa={})),function(a){function i(u,l,c){let f={kind:"delete",uri:u};return l!==void 0&&(l.recursive!==void 0||l.ignoreIfNotExists!==void 0)&&(f.options=l),c!==void 0&&(f.annotationId=c),f}s(i,"create"),a.create=i;function o(u){let l=u;return l&&l.kind==="delete"&&C.string(l.uri)&&(l.options===void 0||(l.options.recursive===void 0||C.boolean(l.options.recursive))&&(l.options.ignoreIfNotExists===void 0||C.boolean(l.options.ignoreIfNotExists)))&&(l.annotationId===void 0||et.is(l.annotationId))}s(o,"is"),a.is=o}(wa||(wa={})),function(a){function i(o){let u=o;return u&&(u.changes!==void 0||u.documentChanges!==void 0)&&(u.documentChanges===void 0||u.documentChanges.every(l=>C.string(l.kind)?_a.is(l)||Sa.is(l)||wa.is(l):ql.is(l)))}s(i,"is"),a.is=i}(bc||(bc={})),kl=(t=class{constructor(i,o){this.edits=i,this.changeAnnotations=o}insert(i,o,u){let l,c;if(u===void 0?l=ar.insert(i,o):et.is(u)?(c=u,l=Ar.insert(i,o,u)):(this.assertChangeAnnotations(this.changeAnnotations),c=this.changeAnnotations.manage(u),l=Ar.insert(i,o,c)),this.edits.push(l),c!==void 0)return c}replace(i,o,u){let l,c;if(u===void 0?l=ar.replace(i,o):et.is(u)?(c=u,l=Ar.replace(i,o,u)):(this.assertChangeAnnotations(this.changeAnnotations),c=this.changeAnnotations.manage(u),l=Ar.replace(i,o,c)),this.edits.push(l),c!==void 0)return c}delete(i,o){let u,l;if(o===void 0?u=ar.del(i):et.is(o)?(l=o,u=Ar.del(i,o)):(this.assertChangeAnnotations(this.changeAnnotations),l=this.changeAnnotations.manage(o),u=Ar.del(i,l)),this.edits.push(u),l!==void 0)return l}add(i){this.edits.push(i)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(i){if(i===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},s(t,"TextEditChangeImpl"),t),Ud=(e=class{constructor(i){this._annotations=i===void 0?Object.create(null):i,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(i,o){let u;if(et.is(i)?u=i:(u=this.nextId(),o=i),this._annotations[u]!==void 0)throw new Error(`Id ${u} is already in use.`);if(o===void 0)throw new Error(`No annotation provided for id ${u}`);return this._annotations[u]=o,this._size++,u}nextId(){return this._counter++,this._counter.toString()}},s(e,"ChangeAnnotations"),e),M$=(r=class{constructor(i){this._textEditChanges=Object.create(null),i!==void 0?(this._workspaceEdit=i,i.documentChanges?(this._changeAnnotations=new Ud(i.changeAnnotations),i.changeAnnotations=this._changeAnnotations.all(),i.documentChanges.forEach(o=>{if(ql.is(o)){const u=new kl(o.edits,this._changeAnnotations);this._textEditChanges[o.textDocument.uri]=u}})):i.changes&&Object.keys(i.changes).forEach(o=>{const u=new kl(i.changes[o]);this._textEditChanges[o]=u})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(i){if(Hl.is(i)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const o={uri:i.uri,version:i.version};let u=this._textEditChanges[o.uri];if(!u){const l=[],c={textDocument:o,edits:l};this._workspaceEdit.documentChanges.push(c),u=new kl(l,this._changeAnnotations),this._textEditChanges[o.uri]=u}return u}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let o=this._textEditChanges[i];if(!o){let u=[];this._workspaceEdit.changes[i]=u,o=new kl(u),this._textEditChanges[i]=o}return o}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Ud,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(i,o,u){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;mn.is(o)||et.is(o)?l=o:u=o;let c,f;if(l===void 0?c=_a.create(i,u):(f=et.is(l)?l:this._changeAnnotations.manage(l),c=_a.create(i,u,f)),this._workspaceEdit.documentChanges.push(c),f!==void 0)return f}renameFile(i,o,u,l){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let c;mn.is(u)||et.is(u)?c=u:l=u;let f,d;if(c===void 0?f=Sa.create(i,o,l):(d=et.is(c)?c:this._changeAnnotations.manage(c),f=Sa.create(i,o,l,d)),this._workspaceEdit.documentChanges.push(f),d!==void 0)return d}deleteFile(i,o,u){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;mn.is(o)||et.is(o)?l=o:u=o;let c,f;if(l===void 0?c=wa.create(i,u):(f=et.is(l)?l:this._changeAnnotations.manage(l),c=wa.create(i,u,f)),this._workspaceEdit.documentChanges.push(c),f!==void 0)return f}},s(r,"WorkspaceChange"),r),function(a){function i(u){return{uri:u}}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&C.string(l.uri)}s(o,"is"),a.is=o}(Np||(Np={})),function(a){function i(u,l){return{uri:u,version:l}}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&C.string(l.uri)&&C.integer(l.version)}s(o,"is"),a.is=o}(Pp||(Pp={})),function(a){function i(u,l){return{uri:u,version:l}}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&C.string(l.uri)&&(l.version===null||C.integer(l.version))}s(o,"is"),a.is=o}(Hl||(Hl={})),function(a){function i(u,l,c,f){return{uri:u,languageId:l,version:c,text:f}}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&C.string(l.uri)&&C.string(l.languageId)&&C.integer(l.version)&&C.string(l.text)}s(o,"is"),a.is=o}(kp||(kp={})),function(a){a.PlainText="plaintext",a.Markdown="markdown";function i(o){const u=o;return u===a.PlainText||u===a.Markdown}s(i,"is"),a.is=i}(_c||(_c={})),function(a){function i(o){const u=o;return C.objectLiteral(o)&&_c.is(u.kind)&&C.string(u.value)}s(i,"is"),a.is=i}(Ia||(Ia={})),function(a){a.Text=1,a.Method=2,a.Function=3,a.Constructor=4,a.Field=5,a.Variable=6,a.Class=7,a.Interface=8,a.Module=9,a.Property=10,a.Unit=11,a.Value=12,a.Enum=13,a.Keyword=14,a.Snippet=15,a.Color=16,a.File=17,a.Reference=18,a.Folder=19,a.EnumMember=20,a.Constant=21,a.Struct=22,a.Event=23,a.Operator=24,a.TypeParameter=25}(Op||(Op={})),function(a){a.PlainText=1,a.Snippet=2}(Lp||(Lp={})),function(a){a.Deprecated=1}(Dp||(Dp={})),function(a){function i(u,l,c){return{newText:u,insert:l,replace:c}}s(i,"create"),a.create=i;function o(u){const l=u;return l&&C.string(l.newText)&&te.is(l.insert)&&te.is(l.replace)}s(o,"is"),a.is=o}(Mp||(Mp={})),function(a){a.asIs=1,a.adjustIndentation=2}(xp||(xp={})),function(a){function i(o){const u=o;return u&&(C.string(u.detail)||u.detail===void 0)&&(C.string(u.description)||u.description===void 0)}s(i,"is"),a.is=i}(Gp||(Gp={})),function(a){function i(o){return{label:o}}s(i,"create"),a.create=i}(Fp||(Fp={})),function(a){function i(o,u){return{items:o||[],isIncomplete:!!u}}s(i,"create"),a.create=i}(zp||(zp={})),function(a){function i(u){return u.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}s(i,"fromPlainText"),a.fromPlainText=i;function o(u){const l=u;return C.string(l)||C.objectLiteral(l)&&C.string(l.language)&&C.string(l.value)}s(o,"is"),a.is=o}(Yl||(Yl={})),function(a){function i(o){let u=o;return!!u&&C.objectLiteral(u)&&(Ia.is(u.contents)||Yl.is(u.contents)||C.typedArray(u.contents,Yl.is))&&(o.range===void 0||te.is(o.range))}s(i,"is"),a.is=i}(jp||(jp={})),function(a){function i(o,u){return u?{label:o,documentation:u}:{label:o}}s(i,"create"),a.create=i}(Bp||(Bp={})),function(a){function i(o,u,...l){let c={label:o};return C.defined(u)&&(c.documentation=u),C.defined(l)?c.parameters=l:c.parameters=[],c}s(i,"create"),a.create=i}(Up||(Up={})),function(a){a.Text=1,a.Read=2,a.Write=3}(Kp||(Kp={})),function(a){function i(o,u){let l={range:o};return C.number(u)&&(l.kind=u),l}s(i,"create"),a.create=i}(Wp||(Wp={})),function(a){a.File=1,a.Module=2,a.Namespace=3,a.Package=4,a.Class=5,a.Method=6,a.Property=7,a.Field=8,a.Constructor=9,a.Enum=10,a.Interface=11,a.Function=12,a.Variable=13,a.Constant=14,a.String=15,a.Number=16,a.Boolean=17,a.Array=18,a.Object=19,a.Key=20,a.Null=21,a.EnumMember=22,a.Struct=23,a.Event=24,a.Operator=25,a.TypeParameter=26}(Vp||(Vp={})),function(a){a.Deprecated=1}(qp||(qp={})),function(a){function i(o,u,l,c,f){let d={name:o,kind:u,location:{uri:c,range:l}};return f&&(d.containerName=f),d}s(i,"create"),a.create=i}(Hp||(Hp={})),function(a){function i(o,u,l,c){return c!==void 0?{name:o,kind:u,location:{uri:l,range:c}}:{name:o,kind:u,location:{uri:l}}}s(i,"create"),a.create=i}(Yp||(Yp={})),function(a){function i(u,l,c,f,d,p){let h={name:u,detail:l,kind:c,range:f,selectionRange:d};return p!==void 0&&(h.children=p),h}s(i,"create"),a.create=i;function o(u){let l=u;return l&&C.string(l.name)&&C.number(l.kind)&&te.is(l.range)&&te.is(l.selectionRange)&&(l.detail===void 0||C.string(l.detail))&&(l.deprecated===void 0||C.boolean(l.deprecated))&&(l.children===void 0||Array.isArray(l.children))&&(l.tags===void 0||Array.isArray(l.tags))}s(o,"is"),a.is=o}(Xp||(Xp={})),function(a){a.Empty="",a.QuickFix="quickfix",a.Refactor="refactor",a.RefactorExtract="refactor.extract",a.RefactorInline="refactor.inline",a.RefactorRewrite="refactor.rewrite",a.Source="source",a.SourceOrganizeImports="source.organizeImports",a.SourceFixAll="source.fixAll"}(Jp||(Jp={})),function(a){a.Invoked=1,a.Automatic=2}(Xl||(Xl={})),function(a){function i(u,l,c){let f={diagnostics:u};return l!=null&&(f.only=l),c!=null&&(f.triggerKind=c),f}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&C.typedArray(l.diagnostics,Vl.is)&&(l.only===void 0||C.typedArray(l.only,C.string))&&(l.triggerKind===void 0||l.triggerKind===Xl.Invoked||l.triggerKind===Xl.Automatic)}s(o,"is"),a.is=o}(Zp||(Zp={})),function(a){function i(u,l,c){let f={title:u},d=!0;return typeof l=="string"?(d=!1,f.kind=l):pn.is(l)?f.command=l:f.edit=l,d&&c!==void 0&&(f.kind=c),f}s(i,"create"),a.create=i;function o(u){let l=u;return l&&C.string(l.title)&&(l.diagnostics===void 0||C.typedArray(l.diagnostics,Vl.is))&&(l.kind===void 0||C.string(l.kind))&&(l.edit!==void 0||l.command!==void 0)&&(l.command===void 0||pn.is(l.command))&&(l.isPreferred===void 0||C.boolean(l.isPreferred))&&(l.edit===void 0||bc.is(l.edit))}s(o,"is"),a.is=o}(Qp||(Qp={})),function(a){function i(u,l){let c={range:u};return C.defined(l)&&(c.data=l),c}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&te.is(l.range)&&(C.undefined(l.command)||pn.is(l.command))}s(o,"is"),a.is=o}(em||(em={})),function(a){function i(u,l){return{tabSize:u,insertSpaces:l}}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&C.uinteger(l.tabSize)&&C.boolean(l.insertSpaces)}s(o,"is"),a.is=o}(tm||(tm={})),function(a){function i(u,l,c){return{range:u,target:l,data:c}}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&te.is(l.range)&&(C.undefined(l.target)||C.string(l.target))}s(o,"is"),a.is=o}(rm||(rm={})),function(a){function i(u,l){return{range:u,parent:l}}s(i,"create"),a.create=i;function o(u){let l=u;return C.objectLiteral(l)&&te.is(l.range)&&(l.parent===void 0||a.is(l.parent))}s(o,"is"),a.is=o}(nm||(nm={})),function(a){a.namespace="namespace",a.type="type",a.class="class",a.enum="enum",a.interface="interface",a.struct="struct",a.typeParameter="typeParameter",a.parameter="parameter",a.variable="variable",a.property="property",a.enumMember="enumMember",a.event="event",a.function="function",a.method="method",a.macro="macro",a.keyword="keyword",a.modifier="modifier",a.comment="comment",a.string="string",a.number="number",a.regexp="regexp",a.operator="operator",a.decorator="decorator"}(am||(am={})),function(a){a.declaration="declaration",a.definition="definition",a.readonly="readonly",a.static="static",a.deprecated="deprecated",a.abstract="abstract",a.async="async",a.modification="modification",a.documentation="documentation",a.defaultLibrary="defaultLibrary"}(im||(im={})),function(a){function i(o){const u=o;return C.objectLiteral(u)&&(u.resultId===void 0||typeof u.resultId=="string")&&Array.isArray(u.data)&&(u.data.length===0||typeof u.data[0]=="number")}s(i,"is"),a.is=i}(sm||(sm={})),function(a){function i(u,l){return{range:u,text:l}}s(i,"create"),a.create=i;function o(u){const l=u;return l!=null&&te.is(l.range)&&C.string(l.text)}s(o,"is"),a.is=o}(om||(om={})),function(a){function i(u,l,c){return{range:u,variableName:l,caseSensitiveLookup:c}}s(i,"create"),a.create=i;function o(u){const l=u;return l!=null&&te.is(l.range)&&C.boolean(l.caseSensitiveLookup)&&(C.string(l.variableName)||l.variableName===void 0)}s(o,"is"),a.is=o}(lm||(lm={})),function(a){function i(u,l){return{range:u,expression:l}}s(i,"create"),a.create=i;function o(u){const l=u;return l!=null&&te.is(l.range)&&(C.string(l.expression)||l.expression===void 0)}s(o,"is"),a.is=o}(um||(um={})),function(a){function i(u,l){return{frameId:u,stoppedLocation:l}}s(i,"create"),a.create=i;function o(u){const l=u;return C.defined(l)&&te.is(u.stoppedLocation)}s(o,"is"),a.is=o}(cm||(cm={})),function(a){a.Type=1,a.Parameter=2;function i(o){return o===1||o===2}s(i,"is"),a.is=i}(Sc||(Sc={})),function(a){function i(u){return{value:u}}s(i,"create"),a.create=i;function o(u){const l=u;return C.objectLiteral(l)&&(l.tooltip===void 0||C.string(l.tooltip)||Ia.is(l.tooltip))&&(l.location===void 0||Wl.is(l.location))&&(l.command===void 0||pn.is(l.command))}s(o,"is"),a.is=o}(wc||(wc={})),function(a){function i(u,l,c){const f={position:u,label:l};return c!==void 0&&(f.kind=c),f}s(i,"create"),a.create=i;function o(u){const l=u;return C.objectLiteral(l)&&oe.is(l.position)&&(C.string(l.label)||C.typedArray(l.label,wc.is))&&(l.kind===void 0||Sc.is(l.kind))&&l.textEdits===void 0||C.typedArray(l.textEdits,ar.is)&&(l.tooltip===void 0||C.string(l.tooltip)||Ia.is(l.tooltip))&&(l.paddingLeft===void 0||C.boolean(l.paddingLeft))&&(l.paddingRight===void 0||C.boolean(l.paddingRight))}s(o,"is"),a.is=o}(fm||(fm={})),function(a){function i(o){return{kind:"snippet",value:o}}s(i,"createSnippet"),a.createSnippet=i}(dm||(dm={})),function(a){function i(o,u,l,c){return{insertText:o,filterText:u,range:l,command:c}}s(i,"create"),a.create=i}(pm||(pm={})),function(a){function i(o){return{items:o}}s(i,"create"),a.create=i}(mm||(mm={})),function(a){a.Invoked=0,a.Automatic=1}(hm||(hm={})),function(a){function i(o,u){return{range:o,text:u}}s(i,"create"),a.create=i}(ym||(ym={})),function(a){function i(o,u){return{triggerKind:o,selectedCompletionInfo:u}}s(i,"create"),a.create=i}(gm||(gm={})),function(a){function i(o){const u=o;return C.objectLiteral(u)&&Ac.is(u.uri)&&C.string(u.name)}s(i,"is"),a.is=i}(vm||(vm={})),x$=[` +var dk=Object.defineProperty;var pk=(t,e,r)=>e in t?dk(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var Br=(t,e,r)=>pk(t,typeof e!="symbol"?e+"":e,r);import{_ as ut}from"../../app/index-8JtvDNuA.js";var mk=Object.create,Du=Object.defineProperty,hk=Object.getOwnPropertyDescriptor,Th=Object.getOwnPropertyNames,yk=Object.getPrototypeOf,gk=Object.prototype.hasOwnProperty,s=(t,e)=>Du(t,"name",{value:e,configurable:!0}),vk=(t,e)=>function(){return t&&(e=(0,t[Th(t)[0]])(t=0)),e},X=(t,e)=>function(){return e||(0,t[Th(t)[0]])((e={exports:{}}).exports,e),e.exports},tn=(t,e)=>{for(var r in e)Du(t,r,{get:e[r],enumerable:!0})},$h=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Th(e))!gk.call(t,a)&&a!==r&&Du(t,a,{get:()=>e[a],enumerable:!(n=hk(e,a))||n.enumerable});return t},Of=(t,e,r)=>($h(t,e,"default"),r),Rh=(t,e,r)=>(r=t!=null?mk(yk(t)):{},$h(Du(r,"default",{value:t,enumerable:!0}),t)),Ah=t=>$h(Du({},"__esModule",{value:!0}),t),Lf={};tn(Lf,{AnnotatedTextEdit:()=>Ar,ChangeAnnotation:()=>mn,ChangeAnnotationIdentifier:()=>et,CodeAction:()=>Qp,CodeActionContext:()=>Zp,CodeActionKind:()=>Jp,CodeActionTriggerKind:()=>Xl,CodeDescription:()=>Ip,CodeLens:()=>em,Color:()=>Ec,ColorInformation:()=>Ep,ColorPresentation:()=>Cp,Command:()=>pn,CompletionItem:()=>Fp,CompletionItemKind:()=>Op,CompletionItemLabelDetails:()=>Gp,CompletionItemTag:()=>Dp,CompletionList:()=>zp,CreateFile:()=>_a,DeleteFile:()=>wa,Diagnostic:()=>Vl,DiagnosticRelatedInformation:()=>Cc,DiagnosticSeverity:()=>Sp,DiagnosticTag:()=>wp,DocumentHighlight:()=>Wp,DocumentHighlightKind:()=>Kp,DocumentLink:()=>rm,DocumentSymbol:()=>Xp,DocumentUri:()=>$p,EOL:()=>x$,FoldingRange:()=>_p,FoldingRangeKind:()=>bp,FormattingOptions:()=>tm,Hover:()=>jp,InlayHint:()=>fm,InlayHintKind:()=>Sc,InlayHintLabelPart:()=>wc,InlineCompletionContext:()=>gm,InlineCompletionItem:()=>pm,InlineCompletionList:()=>mm,InlineCompletionTriggerKind:()=>hm,InlineValueContext:()=>cm,InlineValueEvaluatableExpression:()=>um,InlineValueText:()=>om,InlineValueVariableLookup:()=>lm,InsertReplaceEdit:()=>Mp,InsertTextFormat:()=>Lp,InsertTextMode:()=>xp,Location:()=>Wl,LocationLink:()=>Ap,MarkedString:()=>Yl,MarkupContent:()=>Ia,MarkupKind:()=>_c,OptionalVersionedTextDocumentIdentifier:()=>Hl,ParameterInformation:()=>Bp,Position:()=>oe,Range:()=>te,RenameFile:()=>Sa,SelectedCompletionInfo:()=>ym,SelectionRange:()=>nm,SemanticTokenModifiers:()=>im,SemanticTokenTypes:()=>am,SemanticTokens:()=>sm,SignatureInformation:()=>Up,StringValue:()=>dm,SymbolInformation:()=>Hp,SymbolKind:()=>Vp,SymbolTag:()=>qp,TextDocument:()=>Tm,TextDocumentEdit:()=>ql,TextDocumentIdentifier:()=>Np,TextDocumentItem:()=>kp,TextEdit:()=>ar,URI:()=>Ac,VersionedTextDocumentIdentifier:()=>Pp,WorkspaceChange:()=>M$,WorkspaceEdit:()=>bc,WorkspaceFolder:()=>vm,WorkspaceSymbol:()=>Yp,integer:()=>Rp,uinteger:()=>Kl});var $p,Ac,Rp,Kl,oe,te,Wl,Ap,Ec,Ep,Cp,bp,_p,Cc,Sp,wp,Ip,Vl,pn,ar,mn,et,Ar,ql,_a,Sa,wa,bc,kl,Ud,M$,Np,Pp,Hl,kp,_c,Ia,Op,Lp,Dp,Mp,xp,Gp,Fp,zp,Yl,jp,Bp,Up,Kp,Wp,Vp,qp,Hp,Yp,Xp,Jp,Xl,Zp,Qp,em,tm,rm,nm,am,im,sm,om,lm,um,cm,Sc,wc,fm,dm,pm,mm,hm,ym,gm,vm,x$,Tm,iv,C,Mu=vk({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){var t,e,r,n;(function(a){function i(o){return typeof o=="string"}s(i,"is"),a.is=i})($p||($p={})),function(a){function i(o){return typeof o=="string"}s(i,"is"),a.is=i}(Ac||(Ac={})),function(a){a.MIN_VALUE=-2147483648,a.MAX_VALUE=2147483647;function i(o){return typeof o=="number"&&a.MIN_VALUE<=o&&o<=a.MAX_VALUE}s(i,"is"),a.is=i}(Rp||(Rp={})),function(a){a.MIN_VALUE=0,a.MAX_VALUE=2147483647;function i(o){return typeof o=="number"&&a.MIN_VALUE<=o&&o<=a.MAX_VALUE}s(i,"is"),a.is=i}(Kl||(Kl={})),function(a){function i(u,l){return u===Number.MAX_VALUE&&(u=Kl.MAX_VALUE),l===Number.MAX_VALUE&&(l=Kl.MAX_VALUE),{line:u,character:l}}s(i,"create"),a.create=i;function o(u){let l=u;return C.objectLiteral(l)&&C.uinteger(l.line)&&C.uinteger(l.character)}s(o,"is"),a.is=o}(oe||(oe={})),function(a){function i(u,l,c,f){if(C.uinteger(u)&&C.uinteger(l)&&C.uinteger(c)&&C.uinteger(f))return{start:oe.create(u,l),end:oe.create(c,f)};if(oe.is(u)&&oe.is(l))return{start:u,end:l};throw new Error(`Range#create called with invalid arguments[${u}, ${l}, ${c}, ${f}]`)}s(i,"create"),a.create=i;function o(u){let l=u;return C.objectLiteral(l)&&oe.is(l.start)&&oe.is(l.end)}s(o,"is"),a.is=o}(te||(te={})),function(a){function i(u,l){return{uri:u,range:l}}s(i,"create"),a.create=i;function o(u){let l=u;return C.objectLiteral(l)&&te.is(l.range)&&(C.string(l.uri)||C.undefined(l.uri))}s(o,"is"),a.is=o}(Wl||(Wl={})),function(a){function i(u,l,c,f){return{targetUri:u,targetRange:l,targetSelectionRange:c,originSelectionRange:f}}s(i,"create"),a.create=i;function o(u){let l=u;return C.objectLiteral(l)&&te.is(l.targetRange)&&C.string(l.targetUri)&&te.is(l.targetSelectionRange)&&(te.is(l.originSelectionRange)||C.undefined(l.originSelectionRange))}s(o,"is"),a.is=o}(Ap||(Ap={})),function(a){function i(u,l,c,f){return{red:u,green:l,blue:c,alpha:f}}s(i,"create"),a.create=i;function o(u){const l=u;return C.objectLiteral(l)&&C.numberRange(l.red,0,1)&&C.numberRange(l.green,0,1)&&C.numberRange(l.blue,0,1)&&C.numberRange(l.alpha,0,1)}s(o,"is"),a.is=o}(Ec||(Ec={})),function(a){function i(u,l){return{range:u,color:l}}s(i,"create"),a.create=i;function o(u){const l=u;return C.objectLiteral(l)&&te.is(l.range)&&Ec.is(l.color)}s(o,"is"),a.is=o}(Ep||(Ep={})),function(a){function i(u,l,c){return{label:u,textEdit:l,additionalTextEdits:c}}s(i,"create"),a.create=i;function o(u){const l=u;return C.objectLiteral(l)&&C.string(l.label)&&(C.undefined(l.textEdit)||ar.is(l))&&(C.undefined(l.additionalTextEdits)||C.typedArray(l.additionalTextEdits,ar.is))}s(o,"is"),a.is=o}(Cp||(Cp={})),function(a){a.Comment="comment",a.Imports="imports",a.Region="region"}(bp||(bp={})),function(a){function i(u,l,c,f,d,p){const h={startLine:u,endLine:l};return C.defined(c)&&(h.startCharacter=c),C.defined(f)&&(h.endCharacter=f),C.defined(d)&&(h.kind=d),C.defined(p)&&(h.collapsedText=p),h}s(i,"create"),a.create=i;function o(u){const l=u;return C.objectLiteral(l)&&C.uinteger(l.startLine)&&C.uinteger(l.startLine)&&(C.undefined(l.startCharacter)||C.uinteger(l.startCharacter))&&(C.undefined(l.endCharacter)||C.uinteger(l.endCharacter))&&(C.undefined(l.kind)||C.string(l.kind))}s(o,"is"),a.is=o}(_p||(_p={})),function(a){function i(u,l){return{location:u,message:l}}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&Wl.is(l.location)&&C.string(l.message)}s(o,"is"),a.is=o}(Cc||(Cc={})),function(a){a.Error=1,a.Warning=2,a.Information=3,a.Hint=4}(Sp||(Sp={})),function(a){a.Unnecessary=1,a.Deprecated=2}(wp||(wp={})),function(a){function i(o){const u=o;return C.objectLiteral(u)&&C.string(u.href)}s(i,"is"),a.is=i}(Ip||(Ip={})),function(a){function i(u,l,c,f,d,p){let h={range:u,message:l};return C.defined(c)&&(h.severity=c),C.defined(f)&&(h.code=f),C.defined(d)&&(h.source=d),C.defined(p)&&(h.relatedInformation=p),h}s(i,"create"),a.create=i;function o(u){var l;let c=u;return C.defined(c)&&te.is(c.range)&&C.string(c.message)&&(C.number(c.severity)||C.undefined(c.severity))&&(C.integer(c.code)||C.string(c.code)||C.undefined(c.code))&&(C.undefined(c.codeDescription)||C.string((l=c.codeDescription)===null||l===void 0?void 0:l.href))&&(C.string(c.source)||C.undefined(c.source))&&(C.undefined(c.relatedInformation)||C.typedArray(c.relatedInformation,Cc.is))}s(o,"is"),a.is=o}(Vl||(Vl={})),function(a){function i(u,l,...c){let f={title:u,command:l};return C.defined(c)&&c.length>0&&(f.arguments=c),f}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&C.string(l.title)&&C.string(l.command)}s(o,"is"),a.is=o}(pn||(pn={})),function(a){function i(c,f){return{range:c,newText:f}}s(i,"replace"),a.replace=i;function o(c,f){return{range:{start:c,end:c},newText:f}}s(o,"insert"),a.insert=o;function u(c){return{range:c,newText:""}}s(u,"del"),a.del=u;function l(c){const f=c;return C.objectLiteral(f)&&C.string(f.newText)&&te.is(f.range)}s(l,"is"),a.is=l}(ar||(ar={})),function(a){function i(u,l,c){const f={label:u};return l!==void 0&&(f.needsConfirmation=l),c!==void 0&&(f.description=c),f}s(i,"create"),a.create=i;function o(u){const l=u;return C.objectLiteral(l)&&C.string(l.label)&&(C.boolean(l.needsConfirmation)||l.needsConfirmation===void 0)&&(C.string(l.description)||l.description===void 0)}s(o,"is"),a.is=o}(mn||(mn={})),function(a){function i(o){const u=o;return C.string(u)}s(i,"is"),a.is=i}(et||(et={})),function(a){function i(c,f,d){return{range:c,newText:f,annotationId:d}}s(i,"replace"),a.replace=i;function o(c,f,d){return{range:{start:c,end:c},newText:f,annotationId:d}}s(o,"insert"),a.insert=o;function u(c,f){return{range:c,newText:"",annotationId:f}}s(u,"del"),a.del=u;function l(c){const f=c;return ar.is(f)&&(mn.is(f.annotationId)||et.is(f.annotationId))}s(l,"is"),a.is=l}(Ar||(Ar={})),function(a){function i(u,l){return{textDocument:u,edits:l}}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&Hl.is(l.textDocument)&&Array.isArray(l.edits)}s(o,"is"),a.is=o}(ql||(ql={})),function(a){function i(u,l,c){let f={kind:"create",uri:u};return l!==void 0&&(l.overwrite!==void 0||l.ignoreIfExists!==void 0)&&(f.options=l),c!==void 0&&(f.annotationId=c),f}s(i,"create"),a.create=i;function o(u){let l=u;return l&&l.kind==="create"&&C.string(l.uri)&&(l.options===void 0||(l.options.overwrite===void 0||C.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||C.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||et.is(l.annotationId))}s(o,"is"),a.is=o}(_a||(_a={})),function(a){function i(u,l,c,f){let d={kind:"rename",oldUri:u,newUri:l};return c!==void 0&&(c.overwrite!==void 0||c.ignoreIfExists!==void 0)&&(d.options=c),f!==void 0&&(d.annotationId=f),d}s(i,"create"),a.create=i;function o(u){let l=u;return l&&l.kind==="rename"&&C.string(l.oldUri)&&C.string(l.newUri)&&(l.options===void 0||(l.options.overwrite===void 0||C.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||C.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||et.is(l.annotationId))}s(o,"is"),a.is=o}(Sa||(Sa={})),function(a){function i(u,l,c){let f={kind:"delete",uri:u};return l!==void 0&&(l.recursive!==void 0||l.ignoreIfNotExists!==void 0)&&(f.options=l),c!==void 0&&(f.annotationId=c),f}s(i,"create"),a.create=i;function o(u){let l=u;return l&&l.kind==="delete"&&C.string(l.uri)&&(l.options===void 0||(l.options.recursive===void 0||C.boolean(l.options.recursive))&&(l.options.ignoreIfNotExists===void 0||C.boolean(l.options.ignoreIfNotExists)))&&(l.annotationId===void 0||et.is(l.annotationId))}s(o,"is"),a.is=o}(wa||(wa={})),function(a){function i(o){let u=o;return u&&(u.changes!==void 0||u.documentChanges!==void 0)&&(u.documentChanges===void 0||u.documentChanges.every(l=>C.string(l.kind)?_a.is(l)||Sa.is(l)||wa.is(l):ql.is(l)))}s(i,"is"),a.is=i}(bc||(bc={})),kl=(t=class{constructor(i,o){this.edits=i,this.changeAnnotations=o}insert(i,o,u){let l,c;if(u===void 0?l=ar.insert(i,o):et.is(u)?(c=u,l=Ar.insert(i,o,u)):(this.assertChangeAnnotations(this.changeAnnotations),c=this.changeAnnotations.manage(u),l=Ar.insert(i,o,c)),this.edits.push(l),c!==void 0)return c}replace(i,o,u){let l,c;if(u===void 0?l=ar.replace(i,o):et.is(u)?(c=u,l=Ar.replace(i,o,u)):(this.assertChangeAnnotations(this.changeAnnotations),c=this.changeAnnotations.manage(u),l=Ar.replace(i,o,c)),this.edits.push(l),c!==void 0)return c}delete(i,o){let u,l;if(o===void 0?u=ar.del(i):et.is(o)?(l=o,u=Ar.del(i,o)):(this.assertChangeAnnotations(this.changeAnnotations),l=this.changeAnnotations.manage(o),u=Ar.del(i,l)),this.edits.push(u),l!==void 0)return l}add(i){this.edits.push(i)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(i){if(i===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},s(t,"TextEditChangeImpl"),t),Ud=(e=class{constructor(i){this._annotations=i===void 0?Object.create(null):i,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(i,o){let u;if(et.is(i)?u=i:(u=this.nextId(),o=i),this._annotations[u]!==void 0)throw new Error(`Id ${u} is already in use.`);if(o===void 0)throw new Error(`No annotation provided for id ${u}`);return this._annotations[u]=o,this._size++,u}nextId(){return this._counter++,this._counter.toString()}},s(e,"ChangeAnnotations"),e),M$=(r=class{constructor(i){this._textEditChanges=Object.create(null),i!==void 0?(this._workspaceEdit=i,i.documentChanges?(this._changeAnnotations=new Ud(i.changeAnnotations),i.changeAnnotations=this._changeAnnotations.all(),i.documentChanges.forEach(o=>{if(ql.is(o)){const u=new kl(o.edits,this._changeAnnotations);this._textEditChanges[o.textDocument.uri]=u}})):i.changes&&Object.keys(i.changes).forEach(o=>{const u=new kl(i.changes[o]);this._textEditChanges[o]=u})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(i){if(Hl.is(i)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const o={uri:i.uri,version:i.version};let u=this._textEditChanges[o.uri];if(!u){const l=[],c={textDocument:o,edits:l};this._workspaceEdit.documentChanges.push(c),u=new kl(l,this._changeAnnotations),this._textEditChanges[o.uri]=u}return u}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let o=this._textEditChanges[i];if(!o){let u=[];this._workspaceEdit.changes[i]=u,o=new kl(u),this._textEditChanges[i]=o}return o}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Ud,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(i,o,u){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;mn.is(o)||et.is(o)?l=o:u=o;let c,f;if(l===void 0?c=_a.create(i,u):(f=et.is(l)?l:this._changeAnnotations.manage(l),c=_a.create(i,u,f)),this._workspaceEdit.documentChanges.push(c),f!==void 0)return f}renameFile(i,o,u,l){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let c;mn.is(u)||et.is(u)?c=u:l=u;let f,d;if(c===void 0?f=Sa.create(i,o,l):(d=et.is(c)?c:this._changeAnnotations.manage(c),f=Sa.create(i,o,l,d)),this._workspaceEdit.documentChanges.push(f),d!==void 0)return d}deleteFile(i,o,u){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;mn.is(o)||et.is(o)?l=o:u=o;let c,f;if(l===void 0?c=wa.create(i,u):(f=et.is(l)?l:this._changeAnnotations.manage(l),c=wa.create(i,u,f)),this._workspaceEdit.documentChanges.push(c),f!==void 0)return f}},s(r,"WorkspaceChange"),r),function(a){function i(u){return{uri:u}}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&C.string(l.uri)}s(o,"is"),a.is=o}(Np||(Np={})),function(a){function i(u,l){return{uri:u,version:l}}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&C.string(l.uri)&&C.integer(l.version)}s(o,"is"),a.is=o}(Pp||(Pp={})),function(a){function i(u,l){return{uri:u,version:l}}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&C.string(l.uri)&&(l.version===null||C.integer(l.version))}s(o,"is"),a.is=o}(Hl||(Hl={})),function(a){function i(u,l,c,f){return{uri:u,languageId:l,version:c,text:f}}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&C.string(l.uri)&&C.string(l.languageId)&&C.integer(l.version)&&C.string(l.text)}s(o,"is"),a.is=o}(kp||(kp={})),function(a){a.PlainText="plaintext",a.Markdown="markdown";function i(o){const u=o;return u===a.PlainText||u===a.Markdown}s(i,"is"),a.is=i}(_c||(_c={})),function(a){function i(o){const u=o;return C.objectLiteral(o)&&_c.is(u.kind)&&C.string(u.value)}s(i,"is"),a.is=i}(Ia||(Ia={})),function(a){a.Text=1,a.Method=2,a.Function=3,a.Constructor=4,a.Field=5,a.Variable=6,a.Class=7,a.Interface=8,a.Module=9,a.Property=10,a.Unit=11,a.Value=12,a.Enum=13,a.Keyword=14,a.Snippet=15,a.Color=16,a.File=17,a.Reference=18,a.Folder=19,a.EnumMember=20,a.Constant=21,a.Struct=22,a.Event=23,a.Operator=24,a.TypeParameter=25}(Op||(Op={})),function(a){a.PlainText=1,a.Snippet=2}(Lp||(Lp={})),function(a){a.Deprecated=1}(Dp||(Dp={})),function(a){function i(u,l,c){return{newText:u,insert:l,replace:c}}s(i,"create"),a.create=i;function o(u){const l=u;return l&&C.string(l.newText)&&te.is(l.insert)&&te.is(l.replace)}s(o,"is"),a.is=o}(Mp||(Mp={})),function(a){a.asIs=1,a.adjustIndentation=2}(xp||(xp={})),function(a){function i(o){const u=o;return u&&(C.string(u.detail)||u.detail===void 0)&&(C.string(u.description)||u.description===void 0)}s(i,"is"),a.is=i}(Gp||(Gp={})),function(a){function i(o){return{label:o}}s(i,"create"),a.create=i}(Fp||(Fp={})),function(a){function i(o,u){return{items:o||[],isIncomplete:!!u}}s(i,"create"),a.create=i}(zp||(zp={})),function(a){function i(u){return u.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}s(i,"fromPlainText"),a.fromPlainText=i;function o(u){const l=u;return C.string(l)||C.objectLiteral(l)&&C.string(l.language)&&C.string(l.value)}s(o,"is"),a.is=o}(Yl||(Yl={})),function(a){function i(o){let u=o;return!!u&&C.objectLiteral(u)&&(Ia.is(u.contents)||Yl.is(u.contents)||C.typedArray(u.contents,Yl.is))&&(o.range===void 0||te.is(o.range))}s(i,"is"),a.is=i}(jp||(jp={})),function(a){function i(o,u){return u?{label:o,documentation:u}:{label:o}}s(i,"create"),a.create=i}(Bp||(Bp={})),function(a){function i(o,u,...l){let c={label:o};return C.defined(u)&&(c.documentation=u),C.defined(l)?c.parameters=l:c.parameters=[],c}s(i,"create"),a.create=i}(Up||(Up={})),function(a){a.Text=1,a.Read=2,a.Write=3}(Kp||(Kp={})),function(a){function i(o,u){let l={range:o};return C.number(u)&&(l.kind=u),l}s(i,"create"),a.create=i}(Wp||(Wp={})),function(a){a.File=1,a.Module=2,a.Namespace=3,a.Package=4,a.Class=5,a.Method=6,a.Property=7,a.Field=8,a.Constructor=9,a.Enum=10,a.Interface=11,a.Function=12,a.Variable=13,a.Constant=14,a.String=15,a.Number=16,a.Boolean=17,a.Array=18,a.Object=19,a.Key=20,a.Null=21,a.EnumMember=22,a.Struct=23,a.Event=24,a.Operator=25,a.TypeParameter=26}(Vp||(Vp={})),function(a){a.Deprecated=1}(qp||(qp={})),function(a){function i(o,u,l,c,f){let d={name:o,kind:u,location:{uri:c,range:l}};return f&&(d.containerName=f),d}s(i,"create"),a.create=i}(Hp||(Hp={})),function(a){function i(o,u,l,c){return c!==void 0?{name:o,kind:u,location:{uri:l,range:c}}:{name:o,kind:u,location:{uri:l}}}s(i,"create"),a.create=i}(Yp||(Yp={})),function(a){function i(u,l,c,f,d,p){let h={name:u,detail:l,kind:c,range:f,selectionRange:d};return p!==void 0&&(h.children=p),h}s(i,"create"),a.create=i;function o(u){let l=u;return l&&C.string(l.name)&&C.number(l.kind)&&te.is(l.range)&&te.is(l.selectionRange)&&(l.detail===void 0||C.string(l.detail))&&(l.deprecated===void 0||C.boolean(l.deprecated))&&(l.children===void 0||Array.isArray(l.children))&&(l.tags===void 0||Array.isArray(l.tags))}s(o,"is"),a.is=o}(Xp||(Xp={})),function(a){a.Empty="",a.QuickFix="quickfix",a.Refactor="refactor",a.RefactorExtract="refactor.extract",a.RefactorInline="refactor.inline",a.RefactorRewrite="refactor.rewrite",a.Source="source",a.SourceOrganizeImports="source.organizeImports",a.SourceFixAll="source.fixAll"}(Jp||(Jp={})),function(a){a.Invoked=1,a.Automatic=2}(Xl||(Xl={})),function(a){function i(u,l,c){let f={diagnostics:u};return l!=null&&(f.only=l),c!=null&&(f.triggerKind=c),f}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&C.typedArray(l.diagnostics,Vl.is)&&(l.only===void 0||C.typedArray(l.only,C.string))&&(l.triggerKind===void 0||l.triggerKind===Xl.Invoked||l.triggerKind===Xl.Automatic)}s(o,"is"),a.is=o}(Zp||(Zp={})),function(a){function i(u,l,c){let f={title:u},d=!0;return typeof l=="string"?(d=!1,f.kind=l):pn.is(l)?f.command=l:f.edit=l,d&&c!==void 0&&(f.kind=c),f}s(i,"create"),a.create=i;function o(u){let l=u;return l&&C.string(l.title)&&(l.diagnostics===void 0||C.typedArray(l.diagnostics,Vl.is))&&(l.kind===void 0||C.string(l.kind))&&(l.edit!==void 0||l.command!==void 0)&&(l.command===void 0||pn.is(l.command))&&(l.isPreferred===void 0||C.boolean(l.isPreferred))&&(l.edit===void 0||bc.is(l.edit))}s(o,"is"),a.is=o}(Qp||(Qp={})),function(a){function i(u,l){let c={range:u};return C.defined(l)&&(c.data=l),c}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&te.is(l.range)&&(C.undefined(l.command)||pn.is(l.command))}s(o,"is"),a.is=o}(em||(em={})),function(a){function i(u,l){return{tabSize:u,insertSpaces:l}}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&C.uinteger(l.tabSize)&&C.boolean(l.insertSpaces)}s(o,"is"),a.is=o}(tm||(tm={})),function(a){function i(u,l,c){return{range:u,target:l,data:c}}s(i,"create"),a.create=i;function o(u){let l=u;return C.defined(l)&&te.is(l.range)&&(C.undefined(l.target)||C.string(l.target))}s(o,"is"),a.is=o}(rm||(rm={})),function(a){function i(u,l){return{range:u,parent:l}}s(i,"create"),a.create=i;function o(u){let l=u;return C.objectLiteral(l)&&te.is(l.range)&&(l.parent===void 0||a.is(l.parent))}s(o,"is"),a.is=o}(nm||(nm={})),function(a){a.namespace="namespace",a.type="type",a.class="class",a.enum="enum",a.interface="interface",a.struct="struct",a.typeParameter="typeParameter",a.parameter="parameter",a.variable="variable",a.property="property",a.enumMember="enumMember",a.event="event",a.function="function",a.method="method",a.macro="macro",a.keyword="keyword",a.modifier="modifier",a.comment="comment",a.string="string",a.number="number",a.regexp="regexp",a.operator="operator",a.decorator="decorator"}(am||(am={})),function(a){a.declaration="declaration",a.definition="definition",a.readonly="readonly",a.static="static",a.deprecated="deprecated",a.abstract="abstract",a.async="async",a.modification="modification",a.documentation="documentation",a.defaultLibrary="defaultLibrary"}(im||(im={})),function(a){function i(o){const u=o;return C.objectLiteral(u)&&(u.resultId===void 0||typeof u.resultId=="string")&&Array.isArray(u.data)&&(u.data.length===0||typeof u.data[0]=="number")}s(i,"is"),a.is=i}(sm||(sm={})),function(a){function i(u,l){return{range:u,text:l}}s(i,"create"),a.create=i;function o(u){const l=u;return l!=null&&te.is(l.range)&&C.string(l.text)}s(o,"is"),a.is=o}(om||(om={})),function(a){function i(u,l,c){return{range:u,variableName:l,caseSensitiveLookup:c}}s(i,"create"),a.create=i;function o(u){const l=u;return l!=null&&te.is(l.range)&&C.boolean(l.caseSensitiveLookup)&&(C.string(l.variableName)||l.variableName===void 0)}s(o,"is"),a.is=o}(lm||(lm={})),function(a){function i(u,l){return{range:u,expression:l}}s(i,"create"),a.create=i;function o(u){const l=u;return l!=null&&te.is(l.range)&&(C.string(l.expression)||l.expression===void 0)}s(o,"is"),a.is=o}(um||(um={})),function(a){function i(u,l){return{frameId:u,stoppedLocation:l}}s(i,"create"),a.create=i;function o(u){const l=u;return C.defined(l)&&te.is(u.stoppedLocation)}s(o,"is"),a.is=o}(cm||(cm={})),function(a){a.Type=1,a.Parameter=2;function i(o){return o===1||o===2}s(i,"is"),a.is=i}(Sc||(Sc={})),function(a){function i(u){return{value:u}}s(i,"create"),a.create=i;function o(u){const l=u;return C.objectLiteral(l)&&(l.tooltip===void 0||C.string(l.tooltip)||Ia.is(l.tooltip))&&(l.location===void 0||Wl.is(l.location))&&(l.command===void 0||pn.is(l.command))}s(o,"is"),a.is=o}(wc||(wc={})),function(a){function i(u,l,c){const f={position:u,label:l};return c!==void 0&&(f.kind=c),f}s(i,"create"),a.create=i;function o(u){const l=u;return C.objectLiteral(l)&&oe.is(l.position)&&(C.string(l.label)||C.typedArray(l.label,wc.is))&&(l.kind===void 0||Sc.is(l.kind))&&l.textEdits===void 0||C.typedArray(l.textEdits,ar.is)&&(l.tooltip===void 0||C.string(l.tooltip)||Ia.is(l.tooltip))&&(l.paddingLeft===void 0||C.boolean(l.paddingLeft))&&(l.paddingRight===void 0||C.boolean(l.paddingRight))}s(o,"is"),a.is=o}(fm||(fm={})),function(a){function i(o){return{kind:"snippet",value:o}}s(i,"createSnippet"),a.createSnippet=i}(dm||(dm={})),function(a){function i(o,u,l,c){return{insertText:o,filterText:u,range:l,command:c}}s(i,"create"),a.create=i}(pm||(pm={})),function(a){function i(o){return{items:o}}s(i,"create"),a.create=i}(mm||(mm={})),function(a){a.Invoked=0,a.Automatic=1}(hm||(hm={})),function(a){function i(o,u){return{range:o,text:u}}s(i,"create"),a.create=i}(ym||(ym={})),function(a){function i(o,u){return{triggerKind:o,selectedCompletionInfo:u}}s(i,"create"),a.create=i}(gm||(gm={})),function(a){function i(o){const u=o;return C.objectLiteral(u)&&Ac.is(u.uri)&&C.string(u.name)}s(i,"is"),a.is=i}(vm||(vm={})),x$=[` `,`\r `,"\r"],function(a){function i(c,f,d,p){return new iv(c,f,d,p)}s(i,"create"),a.create=i;function o(c){let f=c;return!!(C.defined(f)&&C.string(f.uri)&&(C.undefined(f.languageId)||C.string(f.languageId))&&C.uinteger(f.lineCount)&&C.func(f.getText)&&C.func(f.positionAt)&&C.func(f.offsetAt))}s(o,"is"),a.is=o;function u(c,f){let d=c.getText(),p=l(f,(y,v)=>{let E=y.range.start.line-v.range.start.line;return E===0?y.range.start.character-v.range.start.character:E}),h=d.length;for(let y=p.length-1;y>=0;y--){let v=p[y],E=c.offsetAt(v.range.start),T=c.offsetAt(v.range.end);if(T<=h)d=d.substring(0,E)+v.newText+d.substring(T,d.length);else throw new Error("Overlapping edit");h=E}return d}s(u,"applyEdits"),a.applyEdits=u;function l(c,f){if(c.length<=1)return c;const d=c.length/2|0,p=c.slice(0,d),h=c.slice(d);l(p,f),l(h,f);let y=0,v=0,E=0;for(;y({domains:new Map,transitions:[]}),"createDefaultData"),H=rt(),St=s(()=>H.domains,"getDomains"),Mt=s(()=>H.transitions,"getTransitions"),zt=s(t=>{if(t)for(const e of t){const n=e.domain,a=(e.items??[]).map(c=>({label:c.label}));H.domains.set(n,{name:n,items:a})}},"setDomains"),Lt=s(t=>{t&&(H.transitions=t.filter(e=>e.from===e.to?(X.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),Pt=s(()=>Q({...At.cynefin,...U().cynefin}),"getConfig"),Nt=s(()=>{kt(),H=rt()},"clear"),O={getDomains:St,getTransitions:Mt,setDomains:zt,setTransitions:Lt,getConfig:Pt,clear:Nt,setAccTitle:vt,getAccTitle:Ct,setDiagramTitle:wt,getDiagramTitle:bt,getAccDescription:$t,setAccDescription:gt},Wt=s(t=>{xt(t,O),O.setDomains(t.domains),O.setTransitions(t.transitions)},"populate"),It={parse:s(async t=>{const e=await Bt("cynefin",t);X.debug(e),Wt(e)},"parse")};function E(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}s(E,"seededRandom");function st(t){let e=0;for(let n=0;n{const n=t/2,a=e/2;return{complex:{cx:n/2,cy:a/2,x:0,y:0,w:n,h:a},complicated:{cx:n+n/2,cy:a/2,x:n,y:0,w:n,h:a},chaotic:{cx:n/2,cy:a+a/2,x:0,y:a,w:n,h:a},clear:{cx:n+n/2,cy:a+a/2,x:n,y:a,w:n,h:a},confusion:{cx:n,cy:a,x:n*.7,y:a*.7,w:n*.6,h:a*.6}}},"getDomainLayouts"),Vt=s(()=>{const t=ot(),e=U();return Q(t,e.themeVariables).cynefin},"getCynefinDomainColors"),q=3,Ft=s((t,e,n,a)=>{const c=a.db,m=c.getDomains(),v=c.getTransitions(),I=c.getDiagramTitle(),d=c.getAccTitle(),D=c.getAccDescription(),o=c.getConfig(),p=Vt();X.debug("Rendering Cynefin diagram");const i=o.width,f=o.height,b=o.padding,h=o.showDomainDescriptions,R=o.boundaryAmplitude,V=i+b*2,F=f+b*2,z={complex:p.complexBg,complicated:p.complicatedBg,clear:p.clearBg,chaotic:p.chaoticBg,confusion:p.confusionBg},T=Dt(e);Tt(T,F,V,o.useMaxWidth??!0),T.attr("viewBox",`0 0 ${V} ${F}`),d&&T.append("title").text(d),D&&T.append("desc").text(D);const k=T.append("g").attr("transform",`translate(${b}, ${b})`),_=Rt(i,f),Z=it(o.seed,e),mt=k.append("g").attr("class","cynefin-backgrounds"),Y=["complex","complicated","chaotic","clear"];for(const l of Y){const r=_[l];mt.append("rect").attr("class","cynefinDomain").attr("x",r.x).attr("y",r.y).attr("width",r.w).attr("height",r.h).attr("fill",z[l]).attr("fill-opacity",.4).attr("stroke","none")}const j=k.append("g").attr("class","cynefin-boundaries");j.append("path").attr("class","cynefinBoundary").attr("d",ct(i,f,Z,R)).attr("fill","none"),j.append("path").attr("class","cynefinBoundary").attr("d",lt(i,f,Z+100,R)).attr("fill","none"),j.append("path").attr("class","cynefinCliff").attr("d",dt(i,f)).attr("fill","none");const pt=i*.15,yt=f*.15;k.append("path").attr("class","cynefinConfusion").attr("d",ft(i/2,f/2,pt,yt)).attr("fill",z.confusion).attr("fill-opacity",.5);const J=k.append("g").attr("class","cynefin-labels");for(const l of Y){const r=_[l];J.append("text").attr("class","cynefinDomainLabel").attr("x",r.cx).attr("y",h?r.cy-30:r.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(l.charAt(0).toUpperCase()+l.slice(1))}if(J.append("text").attr("class","cynefinDomainLabel").attr("x",i/2).attr("y",h?f/2-10:f/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),h){const l=k.append("g").attr("class","cynefin-subtitles");for(const r of Y){const u=_[r],y=at[r];l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.model),l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.practice)}l.append("text").attr("class","cynefinSubtitle").attr("x",i/2).attr("y",f/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(at.confusion.practice)}const K=k.append("g").attr("class","cynefin-items"),A=26,tt=10,ut=["complex","complicated","chaotic","clear","confusion"];for(const l of ut){const r=m.get(l);if(!r||r.items.length===0)continue;const u=_[l],y=l==="confusion";let L=r.items,P=0;y&&r.items.length>q&&(P=r.items.length-q,L=r.items.slice(0,q));let B;if(y){const g=h?22:14;B=u.cy+g}else B=u.cy+(h?25:15);if([...L].forEach((g,S)=>{const w=B+S*(A+4),M=K.append("g"),N=M.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",A/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(g.label);let $=g.label.length*7;const x=N.node();if(x&&typeof x.getBBox=="function"){const G=x.getBBox();G.width>0&&($=G.width)}const C=$+tt*2,W=u.cx-C/2;M.attr("transform",`translate(${W}, ${w})`),M.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",C).attr("height",A).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.95),N.attr("x",C/2).attr("y",A/2)}),P>0){const g=B+L.length*(A+4),S=`+${P} more`,w=K.append("g"),M=w.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",A/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(S);let N=S.length*7;const $=M.node();if($&&typeof $.getBBox=="function"){const W=$.getBBox();W.width>0&&(N=W.width)}const x=N+tt*2,C=u.cx-x/2;w.attr("transform",`translate(${C}, ${g})`),w.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",x).attr("height",A).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.6),M.attr("x",x/2).attr("y",A/2)}}if(v.length>0){const l=T.select("defs").empty()?T.append("defs"):T.select("defs"),r=`cynefin-arrow-${e}`;l.append("marker").attr("id",r).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const u=k.append("g").attr("class","cynefin-arrows");v.forEach(y=>{const L=_[y.from],P=_[y.to];if(!L||!P)return;if(y.from===y.to){X.warn(`Cynefin renderer: skipping self-loop on domain "${y.from}"`);return}const B=L.cx,g=L.cy,S=P.cx,w=P.cy,M=(B+S)/2,N=(g+w)/2,$=S-B,x=w-g,C=Math.sqrt($*$+x*x),W=C*.15,G=-x/C,ht=$/C,et=M+G*W,nt=N+ht*W;u.append("path").attr("class","cynefinArrowLine").attr("d",`M${B},${g} Q${et},${nt} ${S},${w}`).attr("fill","none").attr("marker-end",`url(#${r})`),y.label&&u.append("text").attr("class","cynefinArrowLabel").attr("x",et).attr("y",nt-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(y.label)})}I&&k.append("text").attr("class","cynefinTitle").attr("x",i/2).attr("y",-b/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(I)},"draw"),_t={draw:Ft},Et=s(()=>{const t=ot(),e=U();return Q(t,e.themeVariables).cynefin},"getCynefinTheme"),Ht=s(()=>{const t=Et();return` +import{p as xt}from"./chunk-JWPE2WC7-DVlhplzu.js";import{aQ as gt,V as $t,$ as bt,aT as wt,W as Ct,aR as vt,a as s,at as X,aP as Dt,B as Tt,s as kt,r as Q,X as U,O as At,a8 as ot}from"./mermaid.core-DAx4nvmm.js";import{p as Bt}from"./cynefin-OW5HDTMX-BHP1Kvyc.js";import"../../app/index-8JtvDNuA.js";import"../../chunks/purify.es-BnINGy_Y.js";var rt=s(()=>({domains:new Map,transitions:[]}),"createDefaultData"),H=rt(),St=s(()=>H.domains,"getDomains"),Mt=s(()=>H.transitions,"getTransitions"),zt=s(t=>{if(t)for(const e of t){const n=e.domain,a=(e.items??[]).map(c=>({label:c.label}));H.domains.set(n,{name:n,items:a})}},"setDomains"),Lt=s(t=>{t&&(H.transitions=t.filter(e=>e.from===e.to?(X.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),Pt=s(()=>Q({...At.cynefin,...U().cynefin}),"getConfig"),Nt=s(()=>{kt(),H=rt()},"clear"),O={getDomains:St,getTransitions:Mt,setDomains:zt,setTransitions:Lt,getConfig:Pt,clear:Nt,setAccTitle:vt,getAccTitle:Ct,setDiagramTitle:wt,getDiagramTitle:bt,getAccDescription:$t,setAccDescription:gt},Wt=s(t=>{xt(t,O),O.setDomains(t.domains),O.setTransitions(t.transitions)},"populate"),It={parse:s(async t=>{const e=await Bt("cynefin",t);X.debug(e),Wt(e)},"parse")};function E(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}s(E,"seededRandom");function st(t){let e=0;for(let n=0;n{const n=t/2,a=e/2;return{complex:{cx:n/2,cy:a/2,x:0,y:0,w:n,h:a},complicated:{cx:n+n/2,cy:a/2,x:n,y:0,w:n,h:a},chaotic:{cx:n/2,cy:a+a/2,x:0,y:a,w:n,h:a},clear:{cx:n+n/2,cy:a+a/2,x:n,y:a,w:n,h:a},confusion:{cx:n,cy:a,x:n*.7,y:a*.7,w:n*.6,h:a*.6}}},"getDomainLayouts"),Vt=s(()=>{const t=ot(),e=U();return Q(t,e.themeVariables).cynefin},"getCynefinDomainColors"),q=3,Ft=s((t,e,n,a)=>{const c=a.db,m=c.getDomains(),v=c.getTransitions(),I=c.getDiagramTitle(),d=c.getAccTitle(),D=c.getAccDescription(),o=c.getConfig(),p=Vt();X.debug("Rendering Cynefin diagram");const i=o.width,f=o.height,b=o.padding,h=o.showDomainDescriptions,R=o.boundaryAmplitude,V=i+b*2,F=f+b*2,z={complex:p.complexBg,complicated:p.complicatedBg,clear:p.clearBg,chaotic:p.chaoticBg,confusion:p.confusionBg},T=Dt(e);Tt(T,F,V,o.useMaxWidth??!0),T.attr("viewBox",`0 0 ${V} ${F}`),d&&T.append("title").text(d),D&&T.append("desc").text(D);const k=T.append("g").attr("transform",`translate(${b}, ${b})`),_=Rt(i,f),Z=it(o.seed,e),mt=k.append("g").attr("class","cynefin-backgrounds"),Y=["complex","complicated","chaotic","clear"];for(const l of Y){const r=_[l];mt.append("rect").attr("class","cynefinDomain").attr("x",r.x).attr("y",r.y).attr("width",r.w).attr("height",r.h).attr("fill",z[l]).attr("fill-opacity",.4).attr("stroke","none")}const j=k.append("g").attr("class","cynefin-boundaries");j.append("path").attr("class","cynefinBoundary").attr("d",ct(i,f,Z,R)).attr("fill","none"),j.append("path").attr("class","cynefinBoundary").attr("d",lt(i,f,Z+100,R)).attr("fill","none"),j.append("path").attr("class","cynefinCliff").attr("d",dt(i,f)).attr("fill","none");const pt=i*.15,yt=f*.15;k.append("path").attr("class","cynefinConfusion").attr("d",ft(i/2,f/2,pt,yt)).attr("fill",z.confusion).attr("fill-opacity",.5);const J=k.append("g").attr("class","cynefin-labels");for(const l of Y){const r=_[l];J.append("text").attr("class","cynefinDomainLabel").attr("x",r.cx).attr("y",h?r.cy-30:r.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(l.charAt(0).toUpperCase()+l.slice(1))}if(J.append("text").attr("class","cynefinDomainLabel").attr("x",i/2).attr("y",h?f/2-10:f/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),h){const l=k.append("g").attr("class","cynefin-subtitles");for(const r of Y){const u=_[r],y=at[r];l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.model),l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.practice)}l.append("text").attr("class","cynefinSubtitle").attr("x",i/2).attr("y",f/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(at.confusion.practice)}const K=k.append("g").attr("class","cynefin-items"),A=26,tt=10,ut=["complex","complicated","chaotic","clear","confusion"];for(const l of ut){const r=m.get(l);if(!r||r.items.length===0)continue;const u=_[l],y=l==="confusion";let L=r.items,P=0;y&&r.items.length>q&&(P=r.items.length-q,L=r.items.slice(0,q));let B;if(y){const g=h?22:14;B=u.cy+g}else B=u.cy+(h?25:15);if([...L].forEach((g,S)=>{const w=B+S*(A+4),M=K.append("g"),N=M.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",A/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(g.label);let $=g.label.length*7;const x=N.node();if(x&&typeof x.getBBox=="function"){const G=x.getBBox();G.width>0&&($=G.width)}const C=$+tt*2,W=u.cx-C/2;M.attr("transform",`translate(${W}, ${w})`),M.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",C).attr("height",A).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.95),N.attr("x",C/2).attr("y",A/2)}),P>0){const g=B+L.length*(A+4),S=`+${P} more`,w=K.append("g"),M=w.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",A/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(S);let N=S.length*7;const $=M.node();if($&&typeof $.getBBox=="function"){const W=$.getBBox();W.width>0&&(N=W.width)}const x=N+tt*2,C=u.cx-x/2;w.attr("transform",`translate(${C}, ${g})`),w.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",x).attr("height",A).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.6),M.attr("x",x/2).attr("y",A/2)}}if(v.length>0){const l=T.select("defs").empty()?T.append("defs"):T.select("defs"),r=`cynefin-arrow-${e}`;l.append("marker").attr("id",r).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const u=k.append("g").attr("class","cynefin-arrows");v.forEach(y=>{const L=_[y.from],P=_[y.to];if(!L||!P)return;if(y.from===y.to){X.warn(`Cynefin renderer: skipping self-loop on domain "${y.from}"`);return}const B=L.cx,g=L.cy,S=P.cx,w=P.cy,M=(B+S)/2,N=(g+w)/2,$=S-B,x=w-g,C=Math.sqrt($*$+x*x),W=C*.15,G=-x/C,ht=$/C,et=M+G*W,nt=N+ht*W;u.append("path").attr("class","cynefinArrowLine").attr("d",`M${B},${g} Q${et},${nt} ${S},${w}`).attr("fill","none").attr("marker-end",`url(#${r})`),y.label&&u.append("text").attr("class","cynefinArrowLabel").attr("x",et).attr("y",nt-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(y.label)})}I&&k.append("text").attr("class","cynefinTitle").attr("x",i/2).attr("y",-b/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(I)},"draw"),_t={draw:Ft},Et=s(()=>{const t=ot(),e=U();return Q(t,e.themeVariables).cynefin},"getCynefinTheme"),Ht=s(()=>{const t=Et();return` .cynefinDomain { stroke: none; } diff --git a/veadk/webui/assets/visualizations/mermaid/dagre-VZM6K2ZE-shxLHn3p.js b/veadk/webui/assets/visualizations/mermaid/dagre-VZM6K2ZE-PibdEig-.js similarity index 97% rename from veadk/webui/assets/visualizations/mermaid/dagre-VZM6K2ZE-shxLHn3p.js rename to veadk/webui/assets/visualizations/mermaid/dagre-VZM6K2ZE-PibdEig-.js index 3cf88b671..42a672a19 100644 --- a/veadk/webui/assets/visualizations/mermaid/dagre-VZM6K2ZE-shxLHn3p.js +++ b/veadk/webui/assets/visualizations/mermaid/dagre-VZM6K2ZE-PibdEig-.js @@ -1,4 +1,4 @@ -import{c as O,w as M,a as J,f as P,b as N,s as A}from"./chunk-RYQCIY6F-DL3iLUXF.js";import{a as X,aw as v,v as D,t as Y,u as H,at as d,Y as _,b8 as F,aU as W,ag as $,a6 as j,aG as R,ad as U,ae as q,aF as z,af as G}from"./mermaid.core-y4TF8bTw.js";import{G as K}from"../../chunks/graph-Dqkl27Ch.js";import{l as Q}from"../../chunks/layout-B6FSD_Du.js";import"../../chunks/map-8WAJQ6ap.js";import"../../app/index-BNPwMQXG.js";import"../../chunks/purify.es-BnINGy_Y.js";var C=X((o,s,l)=>Math.max(s,Math.min(l,o)),"clamp"),B=X((o="TB")=>{switch(o){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),V=X(o=>o==="flowchart"||o==="flowchart-v2"||o==="stateDiagram","shouldMergeSelfLoopSegments"),Z=X((o,s,l,y,a)=>{const f=[],p=new Set;if(l.forEach(({start:r,end:t})=>{r!==y&&p.add(r),t!==y&&p.add(t)}),p.forEach(r=>{const t=o.node(r);typeof(t==null?void 0:t.x)=="number"&&typeof(t==null?void 0:t.y)=="number"&&f.push(t)}),f.length===0&&l.forEach(({edge:r})=>{(r.points??[]).forEach(t=>{typeof(t==null?void 0:t.x)=="number"&&typeof(t==null?void 0:t.y)=="number"&&f.push(t)})}),f.length===0)return B(a);const c=f.reduce((r,t)=>({x:r.x+t.x/f.length,y:r.y+t.y/f.length}),{x:0,y:0}),h=c.x-s.x,i=c.y-s.y;return Math.abs(h)>Math.abs(i)?h>0?"right":"left":Math.abs(i)>0?i>0?"bottom":"top":B(a)},"getSelfLoopSide"),ee=X((o,s="top",l=0,y=0)=>{const a=o.x,f=o.y-l,p=o.width/2,c=o.height/2,h=Math.max(36,Math.min(100,o.width*.8)),i=C(Math.max(y,o.width*.35),36,h),r=C(Math.min(o.width,o.height)*.45,24,48);switch(s){case"bottom":{const t=f+c;return[{x:a-i/2,y:t},{x:a-i/2,y:t+r},{x:a+i/2,y:t+r},{x:a+i/2,y:t}]}case"right":{const t=a+p;return[{x:t,y:f-i/2},{x:t+r,y:f-i/2},{x:t+r,y:f+i/2},{x:t,y:f+i/2}]}case"left":{const t=a-p;return[{x:t,y:f-i/2},{x:t-r,y:f-i/2},{x:t-r,y:f+i/2},{x:t,y:f+i/2}]}case"top":default:{const t=f-c;return[{x:a-i/2,y:t},{x:a-i/2,y:t-r},{x:a+i/2,y:t-r},{x:a+i/2,y:t}]}}},"getSelfLoopPoints"),te=X((o,s,l="top",y=0,a={})=>{const p=o.x,c=o.y-y,h=a.width??0,i=a.height??0;switch(l){case"bottom":return{x:p,y:Math.max(...s.map(r=>r.y))+i/2+4};case"right":return{x:Math.max(...s.map(r=>r.x))+h/2+4,y:c};case"left":return{x:Math.min(...s.map(r=>r.x))-h/2-4,y:c};case"top":default:return{x:p,y:Math.min(...s.map(r=>r.y))-i/2-4}}},"getSelfLoopLabelPosition"),se=X((o,s=0,{mergeSelfLoops:l=!0}={})=>{var p;const y=new Map,a=[],f=(p=o.graph())==null?void 0:p.rankdir;return o.edges().forEach(c=>{const h=o.edge(c);if(l&&h.selfLoop){const i=h.selfLoop.id;y.has(i)||y.set(i,[]),y.get(i).push({edge:h,start:c.v,end:c.w})}else a.push({edge:h,start:c.v,end:c.w})}),y.forEach(c=>{if(c.length!==3){c.forEach(n=>a.push(n));return}c.sort((n,e)=>n.edge.selfLoop.order-e.edge.selfLoop.order);const[h,i,r]=c,t=h.edge.originalEdge??i.edge.originalEdge??r.edge.originalEdge??i.edge,g=o.node(t.start);if(!g){c.forEach(n=>a.push(n));return}const S={width:i.edge.width,height:i.edge.height},w=Z(o,g,c,t.start,f),b=ee(g,w,s,S.width??0),E=te(g,b,w,s,S),m={...i.edge,...t,id:t.id,points:b,start:t.start,end:t.end,x:E.x,y:E.y,width:S.width,height:S.height,labelStyle:i.edge.labelStyle,fromCluster:h.edge.fromCluster??i.edge.fromCluster??r.edge.fromCluster,toCluster:h.edge.toCluster??i.edge.toCluster??r.edge.toCluster};delete m.selfLoop,delete m.originalEdge,a.push({edge:m,start:m.start,end:m.end})}),a},"getEdgesToRender"),T=X(async(o,s,l,y,a,f)=>{d.warn("Graph in recursive render:XAX",M(s),a);const p=s.graph().rankdir;d.trace("Dir in recursive render - dir:",p);const c=o.insert("g").attr("class","root");s.nodes()?d.info("Recursive render XXX",s.nodes()):d.info("No nodes found for",s),s.edges().length>0&&d.info("Recursive edges",s.edge(s.edges()[0]));const h=c.insert("g").attr("class","clusters"),i=c.insert("g").attr("class","edgePaths"),r=c.insert("g").attr("class","edgeLabels"),t=c.insert("g").attr("class","nodes"),g=V(l);await Promise.all(s.nodes().map(async function(n){const e=s.node(n);if(a!==void 0){const u=JSON.parse(JSON.stringify(a.clusterData));d.trace(`Setting data for parent cluster XXX +import{c as O,w as M,a as J,f as P,b as N,s as A}from"./chunk-RYQCIY6F-C3ekePUg.js";import{a as X,aw as v,v as D,t as Y,u as H,at as d,Y as _,b8 as F,aU as W,ag as $,a6 as j,aG as R,ad as U,ae as q,aF as z,af as G}from"./mermaid.core-DAx4nvmm.js";import{G as K}from"../../chunks/graph-Dqkl27Ch.js";import{l as Q}from"../../chunks/layout-B6FSD_Du.js";import"../../chunks/map-8WAJQ6ap.js";import"../../app/index-8JtvDNuA.js";import"../../chunks/purify.es-BnINGy_Y.js";var C=X((o,s,l)=>Math.max(s,Math.min(l,o)),"clamp"),B=X((o="TB")=>{switch(o){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),V=X(o=>o==="flowchart"||o==="flowchart-v2"||o==="stateDiagram","shouldMergeSelfLoopSegments"),Z=X((o,s,l,y,a)=>{const f=[],p=new Set;if(l.forEach(({start:r,end:t})=>{r!==y&&p.add(r),t!==y&&p.add(t)}),p.forEach(r=>{const t=o.node(r);typeof(t==null?void 0:t.x)=="number"&&typeof(t==null?void 0:t.y)=="number"&&f.push(t)}),f.length===0&&l.forEach(({edge:r})=>{(r.points??[]).forEach(t=>{typeof(t==null?void 0:t.x)=="number"&&typeof(t==null?void 0:t.y)=="number"&&f.push(t)})}),f.length===0)return B(a);const c=f.reduce((r,t)=>({x:r.x+t.x/f.length,y:r.y+t.y/f.length}),{x:0,y:0}),h=c.x-s.x,i=c.y-s.y;return Math.abs(h)>Math.abs(i)?h>0?"right":"left":Math.abs(i)>0?i>0?"bottom":"top":B(a)},"getSelfLoopSide"),ee=X((o,s="top",l=0,y=0)=>{const a=o.x,f=o.y-l,p=o.width/2,c=o.height/2,h=Math.max(36,Math.min(100,o.width*.8)),i=C(Math.max(y,o.width*.35),36,h),r=C(Math.min(o.width,o.height)*.45,24,48);switch(s){case"bottom":{const t=f+c;return[{x:a-i/2,y:t},{x:a-i/2,y:t+r},{x:a+i/2,y:t+r},{x:a+i/2,y:t}]}case"right":{const t=a+p;return[{x:t,y:f-i/2},{x:t+r,y:f-i/2},{x:t+r,y:f+i/2},{x:t,y:f+i/2}]}case"left":{const t=a-p;return[{x:t,y:f-i/2},{x:t-r,y:f-i/2},{x:t-r,y:f+i/2},{x:t,y:f+i/2}]}case"top":default:{const t=f-c;return[{x:a-i/2,y:t},{x:a-i/2,y:t-r},{x:a+i/2,y:t-r},{x:a+i/2,y:t}]}}},"getSelfLoopPoints"),te=X((o,s,l="top",y=0,a={})=>{const p=o.x,c=o.y-y,h=a.width??0,i=a.height??0;switch(l){case"bottom":return{x:p,y:Math.max(...s.map(r=>r.y))+i/2+4};case"right":return{x:Math.max(...s.map(r=>r.x))+h/2+4,y:c};case"left":return{x:Math.min(...s.map(r=>r.x))-h/2-4,y:c};case"top":default:return{x:p,y:Math.min(...s.map(r=>r.y))-i/2-4}}},"getSelfLoopLabelPosition"),se=X((o,s=0,{mergeSelfLoops:l=!0}={})=>{var p;const y=new Map,a=[],f=(p=o.graph())==null?void 0:p.rankdir;return o.edges().forEach(c=>{const h=o.edge(c);if(l&&h.selfLoop){const i=h.selfLoop.id;y.has(i)||y.set(i,[]),y.get(i).push({edge:h,start:c.v,end:c.w})}else a.push({edge:h,start:c.v,end:c.w})}),y.forEach(c=>{if(c.length!==3){c.forEach(n=>a.push(n));return}c.sort((n,e)=>n.edge.selfLoop.order-e.edge.selfLoop.order);const[h,i,r]=c,t=h.edge.originalEdge??i.edge.originalEdge??r.edge.originalEdge??i.edge,g=o.node(t.start);if(!g){c.forEach(n=>a.push(n));return}const S={width:i.edge.width,height:i.edge.height},w=Z(o,g,c,t.start,f),b=ee(g,w,s,S.width??0),E=te(g,b,w,s,S),m={...i.edge,...t,id:t.id,points:b,start:t.start,end:t.end,x:E.x,y:E.y,width:S.width,height:S.height,labelStyle:i.edge.labelStyle,fromCluster:h.edge.fromCluster??i.edge.fromCluster??r.edge.fromCluster,toCluster:h.edge.toCluster??i.edge.toCluster??r.edge.toCluster};delete m.selfLoop,delete m.originalEdge,a.push({edge:m,start:m.start,end:m.end})}),a},"getEdgesToRender"),T=X(async(o,s,l,y,a,f)=>{d.warn("Graph in recursive render:XAX",M(s),a);const p=s.graph().rankdir;d.trace("Dir in recursive render - dir:",p);const c=o.insert("g").attr("class","root");s.nodes()?d.info("Recursive render XXX",s.nodes()):d.info("No nodes found for",s),s.edges().length>0&&d.info("Recursive edges",s.edge(s.edges()[0]));const h=c.insert("g").attr("class","clusters"),i=c.insert("g").attr("class","edgePaths"),r=c.insert("g").attr("class","edgeLabels"),t=c.insert("g").attr("class","nodes"),g=V(l);await Promise.all(s.nodes().map(async function(n){const e=s.node(n);if(a!==void 0){const u=JSON.parse(JSON.stringify(a.clusterData));d.trace(`Setting data for parent cluster XXX Node.id = `,n,` data=`,u.height,` Parent cluster`,a.height),s.setNode(a.id,u),s.parent(n)||(d.trace("Setting parent",n,a.id),s.setParent(n,a.id,u))}if(d.info("(Insert) Node XXX"+n+": "+JSON.stringify(s.node(n))),e!=null&&e.clusterNode){d.info("Cluster identified XBX",n,e.width,s.node(n));const{ranksep:u,nodesep:x}=s.graph();e.graph.setGraph({...e.graph.graph(),ranksep:u+25,nodesep:x});const L=await T(t,e.graph,l,y,s.node(n),f),I=L.elem;F(e,I),e.diff=L.diff||0,d.info("New compound node after recursive render XAX",n,"width",e.width,"height",e.height),W(I,e)}else s.children(n).length>0?(d.trace("Cluster - the non recursive path XBX",n,e.id,e,e.width,"Graph:",s),d.trace(P(e.id,s)),N.set(e.id,{id:P(e.id,s),node:e})):(d.trace("Node - the non recursive path XAX",n,t,s.node(n),p),await $(t,s.node(n),{config:f,dir:p}))})),await X(async()=>{const n=s.edges().map(async function(e){const u=s.edge(e.v,e.w,e.name);if(d.info("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e)),d.info("Edge "+e.v+" -> "+e.w+": ",e," ",JSON.stringify(s.edge(e))),d.info("Fix",N,"ids:",e.v,e.w,"Translating: ",N.get(e.v),N.get(e.w)),g&&u.selfLoop){if(u.selfLoop.order!==1)return;const x=u.id;u.id=u.selfLoop.id,await G(r,u),u.id=x;return}await G(r,u)});await Promise.all(n)},"processEdges")(),d.info("Graph before layout:",JSON.stringify(M(s))),d.info("############################################# XXX"),d.info("### Layout ### XXX"),d.info("############################################# XXX"),Q(s),d.info("Graph after layout:",JSON.stringify(M(s)));let w=0,{subGraphTitleTotalMargin:b}=j(f);await Promise.all(A(s).map(async function(n){var u;const e=s.node(n);if(d.info("Position XBX => "+n+": ("+e.x,","+e.y,") width: ",e.width," height: ",e.height),e!=null&&e.clusterNode)e.y+=b,d.info("A tainted cluster node XBX1",n,e.id,e.width,e.height,e.x,e.y,s.parent(n)),N.get(e.id).node=e,R(e);else if(s.children(n).length>0){d.info("A pure cluster node XBX1",n,e.id,e.x,e.y,e.width,e.height,s.parent(n)),e.height+=b,s.node(e.parentId);const x=(e==null?void 0:e.padding)/2||0,L=((u=e==null?void 0:e.labelBBox)==null?void 0:u.height)||0,I=L-x||0;d.debug("OffsetY",I,"labelHeight",L,"halfPadding",x),await U(h,e),N.get(e.id).node=e}else{const x=s.node(e.parentId);e.y+=b/2,d.info("A regular node XBX1 - using the padding",e.id,"parent",e.parentId,e.width,e.height,e.x,e.y,"offsetY",e.offsetY,"parent",x,x==null?void 0:x.offsetY,e),R(e)}}));const E=b/2;return se(s,E,{mergeSelfLoops:g}).forEach(function({edge:n,start:e,end:u}){d.info("Edge "+e+" -> "+u+": "+JSON.stringify(n),n),n.points.forEach(k=>k.y+=E);const x=s.node(e),L=s.node(u),I=q(i,n,N,l,x,L,y);z(n,I)}),s.nodes().forEach(function(n){const e=s.node(n);d.info(n,e.type,e.diff),e.isGroup&&(w=e.diff)}),d.warn("Returning from recursive render XAX",c,w),{elem:c,diff:w}},"recursiveRender"),le=X(async(o,s)=>{var f,p,c,h,i,r;const l=new K({multigraph:!0,compound:!0}).setGraph({rankdir:o.direction,nodesep:((f=o.config)==null?void 0:f.nodeSpacing)||((c=(p=o.config)==null?void 0:p.flowchart)==null?void 0:c.nodeSpacing)||o.nodeSpacing,ranksep:((h=o.config)==null?void 0:h.rankSpacing)||((r=(i=o.config)==null?void 0:i.flowchart)==null?void 0:r.rankSpacing)||o.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),y=s.select("g");v(y,o.markers,o.type,o.diagramId),D(),Y(),H(),O(),o.nodes.forEach(t=>{l.setNode(t.id,{...t}),t.parentId&&l.setParent(t.id,t.parentId)}),d.debug("Edges:",o.edges),o.edges.forEach(t=>{if(t.start===t.end){const g=t.start,S=g+"---"+g+"---1",w=g+"---"+g+"---2",b=l.node(g);l.setNode(S,{domId:S,id:S,parentId:b.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),l.setParent(S,b.parentId),l.setNode(w,{domId:w,id:w,parentId:b.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),l.setParent(w,b.parentId);const E=structuredClone(t),m=structuredClone(t),n=structuredClone(t),e=structuredClone(t);m.originalEdge=E,m.selfLoop={id:E.id,order:0},n.originalEdge=E,n.selfLoop={id:E.id,order:1},e.originalEdge=E,e.selfLoop={id:E.id,order:2},m.label="",m.arrowTypeEnd="none",m.endLabelLeft="",m.endLabelRight="",m.startLabelLeft="",m.id=g+"-cyclic-special-1",n.startLabelRight="",n.startLabelLeft="",n.endLabelLeft="",n.endLabelRight="",n.arrowTypeStart="none",n.arrowTypeEnd="none",n.id=g+"-cyclic-special-mid",e.label="",e.startLabelRight="",e.startLabelLeft="",e.arrowTypeStart="none",b.isGroup&&(m.fromCluster=g,e.toCluster=g),e.id=g+"-cyclic-special-2",e.arrowTypeStart="none",l.setEdge(g,S,m,g+"-cyclic-special-0"),l.setEdge(S,w,n,g+"-cyclic-special-1"),l.setEdge(w,g,e,g+"-cyclic-special-2")}else l.setEdge(t.start,t.end,{...t},t.id)}),d.warn("Graph at first:",JSON.stringify(M(l))),J(l),d.warn("Graph after XAX:",JSON.stringify(M(l)));const a=_();await T(y,l,o.type,o.diagramId,void 0,a)},"render");export{se as getEdgesToRender,le as render}; diff --git a/veadk/webui/assets/visualizations/mermaid/diagram-7IWD3JNH-C3mTV4cL.js b/veadk/webui/assets/visualizations/mermaid/diagram-7IWD3JNH-cddjCR_8.js similarity index 96% rename from veadk/webui/assets/visualizations/mermaid/diagram-7IWD3JNH-C3mTV4cL.js rename to veadk/webui/assets/visualizations/mermaid/diagram-7IWD3JNH-cddjCR_8.js index ae9976104..4a916ff3f 100644 --- a/veadk/webui/assets/visualizations/mermaid/diagram-7IWD3JNH-C3mTV4cL.js +++ b/veadk/webui/assets/visualizations/mermaid/diagram-7IWD3JNH-cddjCR_8.js @@ -1,4 +1,4 @@ -import{I as z}from"./chunk-2Q5K7J3B-nvFjhS5b.js";import{p as O}from"./chunk-JWPE2WC7-DD-BFVC6.js";import{aT as G,aR as P,aQ as Y,$ as F,V as j,W as Z,a as p,r as A,at as D,aP as q,B as U,X as E,s as J,aN as Q,a2 as K,O as ee,aJ as te}from"./mermaid.core-y4TF8bTw.js";import{p as re}from"./cynefin-OW5HDTMX-DBq9B5VP.js";import"../../app/index-BNPwMQXG.js";import"../../chunks/purify.es-BnINGy_Y.js";var S=/[─━│┃└┗├┣]/,L=/[└┗├┣]/,ne=/[─━]/,$=/^[\s│┃]+$/,T=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,k=/^\s*%%/,ie=" ";function _(r){return r.some(e=>S.test(e))}p(_,"isBoxDrawingFormat");function M(r){for(const e of r){const t=L.exec(e);if(t!=null&&t.index&&t.index>0)return t.index}return 4}p(M,"inferSegmentWidth");function R(r,e){return r.replace(/\bline\s+(\d+)\b/gi,(t,i)=>{const o=parseInt(i,10),c=e.get(o);return c?`line ${c}`:t})}p(R,"remapErrorLines");function H(r){const e=r.split(` +import{I as z}from"./chunk-2Q5K7J3B-BK3jpFNd.js";import{p as O}from"./chunk-JWPE2WC7-DVlhplzu.js";import{aT as G,aR as P,aQ as Y,$ as F,V as j,W as Z,a as p,r as A,at as D,aP as q,B as U,X as E,s as J,aN as Q,a2 as K,O as ee,aJ as te}from"./mermaid.core-DAx4nvmm.js";import{p as re}from"./cynefin-OW5HDTMX-BHP1Kvyc.js";import"../../app/index-8JtvDNuA.js";import"../../chunks/purify.es-BnINGy_Y.js";var S=/[─━│┃└┗├┣]/,L=/[└┗├┣]/,ne=/[─━]/,$=/^[\s│┃]+$/,T=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,k=/^\s*%%/,ie=" ";function _(r){return r.some(e=>S.test(e))}p(_,"isBoxDrawingFormat");function M(r){for(const e of r){const t=L.exec(e);if(t!=null&&t.index&&t.index>0)return t.index}return 4}p(M,"inferSegmentWidth");function R(r,e){return r.replace(/\bline\s+(\d+)\b/gi,(t,i)=>{const o=parseInt(i,10),c=e.get(o);return c?`line ${c}`:t})}p(R,"remapErrorLines");function H(r){const e=r.split(` `),t=new Map;let i=-1;for(const[a,s]of e.entries())if(s.trim()==="treeView-beta"){i=a;break}if(i===-1)return{text:r,lineMap:t};const o=[];for(let a=i+1;a({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),oe=p(()=>{x.reset(),J()},"clear"),se=p(()=>x.records.stack[0],"getRoot"),ae=p(()=>x.records.cnt,"getCount"),ce=ee.treeView,le=p(()=>A(ce,E().treeView),"getConfig"),de=p((r,e,t,i,o,c)=>{for(;r<=x.records.stack[x.records.stack.length-1].level;)x.records.stack.pop();const n={id:x.records.cnt++,level:r,name:e,nodeType:t,icon:o,cssClass:i,description:c,children:[]};x.records.stack[x.records.stack.length-1].children.push(n),x.records.stack.push(n)},"addNode"),he={clear:oe,addNode:de,getRoot:se,getCount:ae,getConfig:le,getAccTitle:Z,getAccDescription:j,getDiagramTitle:F,setAccDescription:Y,setAccTitle:P,setDiagramTitle:G},y=he,pe=p(r=>{O(r,y);for(const e of r.nodes){const t=typeof e.indent=="number"?e.indent:0;let i=e.name;const o=i.endsWith("/");o&&(i=i.slice(0,-1));const c=o?"directory":"file",n=e.classAnnotation||void 0,l=e.iconAnnotation,a=l!==void 0?l||"none":void 0,s=e.descAnnotation||void 0,u=s?Q(s,E()):void 0;y.addNode(t,i,c,n,a,u)}},"populate"),fe={parse:p(async r=>{const{text:e,lineMap:t}=H(r);try{const i=await re("treeView",e);D.debug(i),pe(i)}catch(i){throw t.size>0&&i instanceof Error&&(i.message=R(i.message,t)),i}},"parse")},C={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:''},file:{body:''}}};function W(r,e){var o;const t=(o=e==null?void 0:e.filenameIcons)==null?void 0:o[r];if(t)return t;const i=r.lastIndexOf(".");if(i>0){const c=r.substring(i).toLowerCase(),n=e==null?void 0:e.extensionIcons;return(n==null?void 0:n[c])??(n==null?void 0:n[c.slice(1)])}}p(W,"detectIcon");function I(r,e){return r.includes(":")?r:r in C.icons||!e?`${C.prefix}:${r}`:`${e}:${r}`}p(I,"qualifyIcon");function V(r,e){if(r.icon!=="none"){if(r.icon)return I(r.icon,e.defaultIconPack);if(e.showIcons){if(r.nodeType==="file"){const t=W(r.name,e);if(t==="none")return;if(t)return I(t,e.defaultIconPack)}return`${C.prefix}:${r.nodeType==="directory"?"folder":"file"}`}}}p(V,"getNodeIcon");te([{name:C.prefix,icons:C}]);var B=14,ge=4,ue=16,X=p((r,e)=>`tv-icon-${r}-${e.replace(/[^\w-]/g,"-")}`,"iconSymbolId"),we=p(async(r,e,t,i)=>{const o=new Set,c=p(a=>{const s=V(a,t);s&&o.add(s),a.children.forEach(c)},"collect");if(c(e),o.size===0)return;const n=await Promise.all([...o].map(async a=>({icon:a,svg:await K(a,{height:B,width:B})}))),l=r.append("defs");for(const{icon:a,svg:s}of n)l.append("g").attr("id",X(i,a)).html(s)},"injectIconDefs"),me=p((r,e,t,i,o,c)=>{var b;const n=i.append("g");let l="treeView-node-label";t.nodeType==="directory"&&(l+=" treeView-node-dir"),t.cssClass&&(l+=` ${t.cssClass}`);const a=B+ge,s=V(t,o),u=s!==void 0;s&&n.append("use").attr("xlink:href",`#${X(c,s)}`).attr("x",r+o.paddingX).attr("y",e+o.paddingY).attr("class","treeView-node-icon");const d=n.append("text").text(t.name).attr("dominant-baseline","middle").attr("class",l),{height:f,width:h}=d.node().getBBox(),m=f+o.paddingY*2,w=r+o.paddingX+(u?a:0);d.attr("x",w),d.attr("y",e+m/2);const g=w+h,v=h+o.paddingX*2+(u?a:0);return t.BBox={x:r,y:e,width:v,height:m},(b=t.cssClass)!=null&&b.split(/\s+/).includes("highlight")&&n.insert("rect",":first-child").attr("x",r).attr("y",e+1).attr("width",0).attr("height",m-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:t,nodeGroup:n,labelRightEdge:g,centerY:e+m/2}},"positionLabel"),N=p((r,e,t,i,o,c)=>r.append("line").attr("x1",e).attr("y1",t).attr("x2",i).attr("y2",o).attr("stroke-width",c).attr("class","treeView-node-line"),"positionLine"),ve=p((r,e,t,i)=>{var u;let o=0,c=0;const n=[],l=p((d,f,h,m)=>{const w=m*(h.rowIndent+h.paddingX),g=me(w,o,f,d,h,i);n.push(g);const{height:v,width:b}=f.BBox;N(d,w-h.rowIndent,o+v/2,w,o+v/2,h.lineThickness),c=Math.max(c,w+b),o+=v},"drawNode"),a=p((d,f=0)=>{l(r,d,t,f),d.children.forEach(g=>{a(g,f+1)});const{x:h,y:m,height:w}=d.BBox;if(d.children.length){const{y:g,height:v}=d.children[d.children.length-1].BBox;N(r,h+t.paddingX,m+w,h+t.paddingX,g+v/2+t.lineThickness/2,t.lineThickness)}},"processNode");a(e);const s=n.filter(d=>d.node.description);if(s.length>0){const f=Math.max(...n.map(h=>h.labelRightEdge))+ue;for(const h of s){const w=h.nodeGroup.append("text").text(h.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",f).attr("y",h.centerY).node().getBBox();c=Math.max(c,f+w.width+t.paddingX)}}for(const d of n)if((u=d.node.cssClass)!=null&&u.split(/\s+/).includes("highlight")){const f=d.nodeGroup.select(".treeView-highlight-bg");if(!f.empty()){const h=c-d.node.BBox.x+8;f.attr("width",h),c=Math.max(c,d.node.BBox.x+h+2)}}return{totalHeight:o,totalWidth:c}},"drawTree"),xe=p(async(r,e,t,i)=>{D.debug(`Rendering treeView diagram `+r);const o=i.db,c=o.getRoot(),n=o.getConfig(),l=q(e);await we(l,c,n,e);const a=l.append("g");a.attr("class","tree-view");const{totalHeight:s,totalWidth:u}=ve(a,c,n,e);l.attr("viewBox",`-${n.lineThickness/2} 0 ${u} ${s}`),U(l,s,u,n.useMaxWidth)},"draw"),be={draw:xe},Ce=be,ye={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},Ie=p(({treeView:r})=>{const{labelFontSize:e,labelColor:t,lineColor:i,iconColor:o,descriptionColor:c,highlightBg:n,highlightStroke:l}=A(ye,r);return` diff --git a/veadk/webui/assets/visualizations/mermaid/diagram-B4RE2ZJO-D66216sR.js b/veadk/webui/assets/visualizations/mermaid/diagram-B4RE2ZJO-CyMxecTz.js similarity index 97% rename from veadk/webui/assets/visualizations/mermaid/diagram-B4RE2ZJO-D66216sR.js rename to veadk/webui/assets/visualizations/mermaid/diagram-B4RE2ZJO-CyMxecTz.js index 10fcd3c82..41789e383 100644 --- a/veadk/webui/assets/visualizations/mermaid/diagram-B4RE2ZJO-D66216sR.js +++ b/veadk/webui/assets/visualizations/mermaid/diagram-B4RE2ZJO-CyMxecTz.js @@ -1,3 +1,3 @@ -import{p as oe}from"./chunk-JWPE2WC7-DD-BFVC6.js";import{$ as se,aT as de,aQ as le,V as ce,W as me,aR as ue,a as o,at as g,Y as T,aX as xe,s as fe,r as ge,X as E,O as he,aN as P,bb as S,o as pe}from"./mermaid.core-y4TF8bTw.js";import{p as be,i as ve}from"./cynefin-OW5HDTMX-DBq9B5VP.js";import{aG as we}from"../../app/index-BNPwMQXG.js";import"../../chunks/purify.es-BnINGy_Y.js";var N="position frame",D="frame positioned",M="position relation",C="relation positioned",ye=o(function(e){g.debug("options str",e)},"setOptions"),Pe=o(function(){return{}},"getOptions"),Se=o(function(){O(),fe()},"clear");function O(){R={}}o(O,"reset");var ke=he.eventmodeling,Me=o(()=>ge({...ke,...E().eventmodeling}),"getConfig"),R={};function W(){let e=Be;const{ast:n}=R,t=A();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=G(i,n.dataEntities,t);e=w(e,{$kind:N,index:a,frame:i,textProps:r});let d;Q(i)?(g.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=w(e,{$kind:M,index:a,frame:i,sourceFrame:l})})):e=w(e,{$kind:M,index:a,frame:i})}),e={...e,sortedSwimlanesArray:$(e.swimlanes)},e}o(W,"getState");function I(e){R.ast=e}o(I,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:450-2*10,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function A(){return s}o(A,"getDiagramProps");var Be={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function H(e){const n=e.split(".");if(n.length===2)return n[0]}o(H,"extractNamespace");function U(e){const n=e.split(".");return n.length===2?n[1]:e}o(U,"extractName");function V(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(V,"findSwimlaneByNamespace");function v(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&aNumber.parseInt(i)))+1}o(v,"findNextAvailableIndex");function X(e,n){const t=H(e.entityIdentifier),i=V(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:v(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:v(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};case"evt":case"event":default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:v(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(X,"calculateSwimlaneProps");function _(e){const{themeVariables:n}=E();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(_,"calculateEntityVisualProps");function G(e,n,t){const i=E(),a=P(U(e.entityIdentifier)??"",i);let r;const d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
"};let c=`${S(a,t.textMaxWidth,d)}`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=P(r,i),r=S(r,t.textMaxWidth,d),r=r.replaceAll(" "," ")),e.dataReference){const p=n.find(y=>{var b;return y.name===((b=e.dataReference)==null?void 0:b.$refText)});p&&(r=p.dataBlockValue,r=r.substring(r.indexOf(`{ +import{p as oe}from"./chunk-JWPE2WC7-DVlhplzu.js";import{$ as se,aT as de,aQ as le,V as ce,W as me,aR as ue,a as o,at as g,Y as T,aX as xe,s as fe,r as ge,X as E,O as he,aN as P,bb as S,o as pe}from"./mermaid.core-DAx4nvmm.js";import{p as be,i as ve}from"./cynefin-OW5HDTMX-BHP1Kvyc.js";import{aG as we}from"../../app/index-8JtvDNuA.js";import"../../chunks/purify.es-BnINGy_Y.js";var N="position frame",D="frame positioned",M="position relation",C="relation positioned",ye=o(function(e){g.debug("options str",e)},"setOptions"),Pe=o(function(){return{}},"getOptions"),Se=o(function(){O(),fe()},"clear");function O(){R={}}o(O,"reset");var ke=he.eventmodeling,Me=o(()=>ge({...ke,...E().eventmodeling}),"getConfig"),R={};function W(){let e=Be;const{ast:n}=R,t=A();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=G(i,n.dataEntities,t);e=w(e,{$kind:N,index:a,frame:i,textProps:r});let d;Q(i)?(g.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=w(e,{$kind:M,index:a,frame:i,sourceFrame:l})})):e=w(e,{$kind:M,index:a,frame:i})}),e={...e,sortedSwimlanesArray:$(e.swimlanes)},e}o(W,"getState");function I(e){R.ast=e}o(I,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:450-2*10,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function A(){return s}o(A,"getDiagramProps");var Be={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function H(e){const n=e.split(".");if(n.length===2)return n[0]}o(H,"extractNamespace");function U(e){const n=e.split(".");return n.length===2?n[1]:e}o(U,"extractName");function V(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(V,"findSwimlaneByNamespace");function v(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&aNumber.parseInt(i)))+1}o(v,"findNextAvailableIndex");function X(e,n){const t=H(e.entityIdentifier),i=V(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:v(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:v(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};case"evt":case"event":default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:v(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(X,"calculateSwimlaneProps");function _(e){const{themeVariables:n}=E();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(_,"calculateEntityVisualProps");function G(e,n,t){const i=E(),a=P(U(e.entityIdentifier)??"",i);let r;const d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
"};let c=`${S(a,t.textMaxWidth,d)}`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=P(r,i),r=S(r,t.textMaxWidth,d),r=r.replaceAll(" "," ")),e.dataReference){const p=n.find(y=>{var b;return y.name===((b=e.dataReference)==null?void 0:b.$refText)});p&&(r=p.dataBlockValue,r=r.substring(r.indexOf(`{ `)+2),r=r.substring(0,r.lastIndexOf("}")-1),r=P(r,i),r=S(r,t.textMaxWidth,d),r=r.replaceAll(" "," "),r+="
")}const m=r!==void 0;m&&(c+=`

${r}`);const x={fontSize:d.fontSize,fontWeight:d.fontWeight,fontFamily:d.fontFamily},u=pe(c,x),h=m?u.width/3:u.width,f={content:c,width:h,height:u.height};return g.debug(`[${e.name}] ${e.entityIdentifier} text`,f),f}o(G,"calculateTextProps");function L(e,n){const t=n,i=_(t.frame),a={width:t.textProps.width+2*s.boxTextPadding,height:t.textProps.height+2*s.boxTextPadding};return[{$kind:D,frame:t.frame,index:t.index,visual:i,dimension:a,textProps:t.textProps}]}o(L,"decidePositionFrame");function Y(e,n,t){return n===void 0?s.contentStartX:n.index===e.index&&e.r?e.r+s.boxPadding:t===void 0?s.contentStartX:t.r-s.boxOverlap+s.boxPadding}o(Y,"calculateX");function j(e,n){const t=[...e.map(i=>i.r),n];return Math.max(...t)}o(j,"calculateMaxRight");function $(e){return Object.values(e).sort((n,t)=>n.index-t.index)}o($,"sortedSwimlanesArray");function z(e,n){const t=n,i=X(t.frame,e.swimlanes);let a;i.index in e.swimlanes?a=e.swimlanes[i.index]:a={index:i.index,label:i.label,r:0,y:i.index*s.swimlaneMinHeight+s.swimlaneGap,height:s.swimlaneMinHeight,maxHeight:s.swimlaneMinHeight};const r=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,d=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,l={width:Math.max(s.boxMinWidth,Math.min(s.boxMaxWidth,t.dimension.width))+2*s.boxPadding,height:Math.max(s.boxMinHeight,Math.min(s.boxMaxHeight,t.dimension.height))+2*s.boxPadding},c=Y(a,d,r),m=c+l.width+s.boxPadding,x=j(Object.values(e.swimlanes),m);a.r=c+l.width,a.maxHeight=Math.max(a.maxHeight,l.height),a.height=Math.max(s.swimlaneMinHeight,a.maxHeight)+2*s.swimlanePadding;const u={x:c,y:s.swimlanePadding+a.y,r:m,dimension:l,leftSibling:!1,swimlane:a,visual:t.visual,text:t.textProps.content,frame:t.frame,index:t.index},h={...e,boxes:[...e.boxes,u],swimlanes:{...e.swimlanes,[`${a.index}`]:a},previousSwimlaneNumber:i.index,previousFrame:t.frame,maxR:x},f=$(h.swimlanes);f.length>0&&(f[0].y=0);for(let p=1;p0}o(Q,"hasSourceFrame");function B(e,n){if(n!=null)return e.find(t=>t.frame.name===n.name)}o(B,"findBoxByFrame");function q(e,n,t){if(!(t<0))for(let i=t;i>=0;i--){const a=e[i];if(a.swimlane.index!==n)return a}}o(q,"findBoxByLineIndex");function J(e,n){const t=n;if(ve(t.frame)||K(t.index,t.frame))return[];const i=B(e.boxes,t.frame);if(i===void 0)throw new Error(`Target box not found for frame ${t.frame.name}`);let a;return t.sourceFrame?a=B(e.boxes,t.sourceFrame):a=q(e.boxes,i.swimlane.index,t.index-1),a===void 0?[]:[{$kind:C,frame:t.frame,index:t.index,sourceBox:a,targetBox:i}]}o(J,"decidePositionRelation");function Z(e,n){const t=n,i={visual:{fill:"none",stroke:"#000"},source:{x:t.sourceBox.x,y:t.sourceBox.y},target:{x:t.targetBox.x,y:t.targetBox.y},sourceBox:t.sourceBox,targetBox:t.targetBox};return{...e,relations:[...e.relations,i]}}o(Z,"evolveRelationPositioned");var Fe={[N]:L,[M]:J},Ee={[D]:z,[C]:Z};function ee(e,n){const t=Fe[n.$kind];if(t==null)return[];const i=t(e,n);return g.debug("decided events",i),i}o(ee,"decide");function te(e,n){const t=n.reduce((i,a)=>{const r=Ee[a.$kind];return r==null?i:r(i,a)},e);return g.debug("evolve events",{state:e,newState:t,events:n}),t}o(te,"evolve");function w(e,n){const t=ee(e,n);return te(e,t)}o(w,"dispatch");var F={getConfig:Me,setOptions:ye,getOptions:Pe,clear:Se,setAccTitle:ue,getAccTitle:me,getAccDescription:ce,setAccDescription:le,setDiagramTitle:de,getDiagramTitle:se,setAst:I,getDiagramProps:A,getState:W},Re={parse:o(async e=>{const n=await be("eventmodeling",e);g.debug(n),F.setAst(n),oe(n,F)},"parse")},k=T(),Ae=k==null?void 0:k.eventmodeling;function ne(e,n){return t=>{const i=t.swimlane.y+n.swimlanePadding,a=e.append("g").attr("class","em-box");a.append("rect").attr("x",t.x).attr("y",i).attr("rx","3").attr("width",t.dimension.width).attr("height",t.dimension.height).attr("stroke",t.visual.stroke).attr("fill",t.visual.fill),a.append("foreignObject").attr("x",t.x+n.boxPadding).attr("y",i+10).attr("width",t.dimension.width-2*n.boxPadding).attr("height",t.dimension.height-2*n.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(t.text)}}o(ne,"renderD3Box");function ie(e,n){return e>n}o(ie,"dirUpwards");function ae(e,n,t,i){return a=>{const r=a.sourceBox.swimlane.y+n.swimlanePadding,d=a.targetBox.swimlane.y+n.swimlanePadding,l=ie(r,d),c=a.sourceBox.x+a.sourceBox.dimension.width*2/3,m=a.targetBox.x+a.targetBox.dimension.width/3;let x,u;g.debug(`rendering relation up=${l} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),l?(x=r,u=d+a.targetBox.dimension.height):(x=r+a.sourceBox.dimension.height,u=d);const h=i.emRelationStroke??a.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",a.visual.fill).attr("stroke",h).attr("stroke-width","1").attr("marker-end",`url(#${t})`).attr("d",`M${c} ${x} L${m} ${u}`)}}o(ae,"renderD3Relation");function re(e,n,t,i){return a=>{const r=e.append("g").attr("class","em-swimlane"),d=i.emSwimlaneBackgroundOdd??"rgb(250,250,250)",l=i.emSwimlaneBackgroundStroke??"rgb(240,240,240)";r.append("rect").attr("x",0).attr("y",a.y).attr("rx","3").attr("width",n+t.swimlanePadding).attr("height",a.height).attr("fill",d).attr("stroke",l),r.append("text").attr("font-weight",t.swimlaneTextFontWeight).attr("x",30).attr("y",a.y+30).text(a.label)}}o(re,"renderD3Swimlane");var $e=o(function(e,n,t,i){if(g.debug("in eventmodeling renderer",e+` `,"id:",n,t),!Ae)throw new Error("EventModeling config not found");const a=i.db,{themeVariables:r,eventmodeling:d}=T(),l=we(`[id="${n}"]`),c=a.getDiagramProps(),m=a.getState(),x=`em-arrowhead-${n}`,u=r.emArrowhead??"#000000";m.sortedSwimlanesArray.forEach(re(l,m.maxR,c,r)),m.boxes.forEach(ne(l,c)),m.relations.forEach(ae(l,c,x,r)),l.append("defs").append("marker").attr("id",x).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",u),xe(void 0,l,(d==null?void 0:d.padding)??30,d==null?void 0:d.useMaxWidth)},"draw"),Te={draw:$e},Ne=o(e=>"","getStyles"),De=Ne,Ue={parser:Re,db:F,renderer:Te,styles:De};export{Ue as diagram}; diff --git a/veadk/webui/assets/visualizations/mermaid/diagram-LBJQPF4R-BZA2jWUX.js b/veadk/webui/assets/visualizations/mermaid/diagram-LBJQPF4R-BE5KJAJ0.js similarity index 94% rename from veadk/webui/assets/visualizations/mermaid/diagram-LBJQPF4R-BZA2jWUX.js rename to veadk/webui/assets/visualizations/mermaid/diagram-LBJQPF4R-BE5KJAJ0.js index f5646de06..69fb417cb 100644 --- a/veadk/webui/assets/visualizations/mermaid/diagram-LBJQPF4R-BZA2jWUX.js +++ b/veadk/webui/assets/visualizations/mermaid/diagram-LBJQPF4R-BE5KJAJ0.js @@ -1,4 +1,4 @@ -import{p as B}from"./chunk-JWPE2WC7-DD-BFVC6.js";import{a as b,r as m,aP as C,B as S,at as w,aR as T,W as D,aT as P,$ as z,V as E,aQ as F,X as A,O as W,s as _}from"./mermaid.core-y4TF8bTw.js";import{p as N}from"./cynefin-OW5HDTMX-DBq9B5VP.js";import"../../app/index-BNPwMQXG.js";import"../../chunks/purify.es-BnINGy_Y.js";var L=W.packet,u,v=(u=class{constructor(){this.packet=[],this.setAccTitle=T,this.getAccTitle=D,this.setDiagramTitle=P,this.getDiagramTitle=z,this.getAccDescription=E,this.setAccDescription=F}getConfig(){const t=m({...L,...A().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){_(),this.packet=[]}},b(u,"PacketDB"),u),M=1e4,O=b((e,t)=>{B(e,t);let s=-1,r=[],n=1;const{bitsPerRow:l}=t.getConfig();for(let{start:a,end:i,bits:d,label:c}of e.blocks){if(a!==void 0&&i!==void 0&&i{if(e.start===void 0)throw new Error("start should have been set during first phase");if(e.end===void 0)throw new Error("end should have been set during first phase");if(e.start>e.end)throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*s)return[e,void 0];const r=t*s-1,n=t*s;return[{start:e.start,end:r,label:e.label,bits:r-e.start},{start:n,end:e.end,label:e.label,bits:e.end-n}]},"getNextFittingBlock"),x={parser:{yy:void 0},parse:b(async e=>{var r;const t=await N("packet",e),s=(r=x.parser)==null?void 0:r.yy;if(!(s instanceof v))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");w.debug(t),O(t,s)},"parse")},I=b((e,t,s,r)=>{const n=r.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),o=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(o?0:a),k=d*c+2,f=C(t);f.attr("viewBox",`0 0 ${k} ${g}`),S(f,g,k,l.useMaxWidth);for(const[y,$]of p.entries())R(f,$,y,l);f.append("text").text(o).attr("x",k/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),R=b((e,t,s,{rowHeight:r,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=e.append("g"),p=s*(r+l)+l;for(const o of t){const h=o.start%i*a+1,g=(o.end-o.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",r).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+r/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(o.label),!d)continue;const k=o.end===o.start,f=p-2;c.append("text").attr("x",h+(k?g/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(o.start),k||c.append("text").attr("x",h+g).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(o.end)}},"drawWord"),X={draw:I},j={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},G=b(({packet:e}={})=>{const t=m(j,e);return` +import{p as B}from"./chunk-JWPE2WC7-DVlhplzu.js";import{a as b,r as m,aP as C,B as S,at as w,aR as T,W as D,aT as P,$ as z,V as E,aQ as F,X as A,O as W,s as _}from"./mermaid.core-DAx4nvmm.js";import{p as N}from"./cynefin-OW5HDTMX-BHP1Kvyc.js";import"../../app/index-8JtvDNuA.js";import"../../chunks/purify.es-BnINGy_Y.js";var L=W.packet,u,v=(u=class{constructor(){this.packet=[],this.setAccTitle=T,this.getAccTitle=D,this.setDiagramTitle=P,this.getDiagramTitle=z,this.getAccDescription=E,this.setAccDescription=F}getConfig(){const t=m({...L,...A().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){_(),this.packet=[]}},b(u,"PacketDB"),u),M=1e4,O=b((e,t)=>{B(e,t);let s=-1,r=[],n=1;const{bitsPerRow:l}=t.getConfig();for(let{start:a,end:i,bits:d,label:c}of e.blocks){if(a!==void 0&&i!==void 0&&i{if(e.start===void 0)throw new Error("start should have been set during first phase");if(e.end===void 0)throw new Error("end should have been set during first phase");if(e.start>e.end)throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*s)return[e,void 0];const r=t*s-1,n=t*s;return[{start:e.start,end:r,label:e.label,bits:r-e.start},{start:n,end:e.end,label:e.label,bits:e.end-n}]},"getNextFittingBlock"),x={parser:{yy:void 0},parse:b(async e=>{var r;const t=await N("packet",e),s=(r=x.parser)==null?void 0:r.yy;if(!(s instanceof v))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");w.debug(t),O(t,s)},"parse")},I=b((e,t,s,r)=>{const n=r.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),o=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(o?0:a),k=d*c+2,f=C(t);f.attr("viewBox",`0 0 ${k} ${g}`),S(f,g,k,l.useMaxWidth);for(const[y,$]of p.entries())R(f,$,y,l);f.append("text").text(o).attr("x",k/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),R=b((e,t,s,{rowHeight:r,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=e.append("g"),p=s*(r+l)+l;for(const o of t){const h=o.start%i*a+1,g=(o.end-o.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",r).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+r/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(o.label),!d)continue;const k=o.end===o.start,f=p-2;c.append("text").attr("x",h+(k?g/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(o.start),k||c.append("text").attr("x",h+g).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(o.end)}},"drawWord"),X={draw:I},j={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},G=b(({packet:e}={})=>{const t=m(j,e);return` .packetByte { font-size: ${t.byteFontSize}; } diff --git a/veadk/webui/assets/visualizations/mermaid/diagram-Q27KOJAE-Cpjz8RT3.js b/veadk/webui/assets/visualizations/mermaid/diagram-Q27KOJAE-DiL6LnT_.js similarity index 98% rename from veadk/webui/assets/visualizations/mermaid/diagram-Q27KOJAE-Cpjz8RT3.js rename to veadk/webui/assets/visualizations/mermaid/diagram-Q27KOJAE-DiL6LnT_.js index e9faef51f..e4a4f1371 100644 --- a/veadk/webui/assets/visualizations/mermaid/diagram-Q27KOJAE-Cpjz8RT3.js +++ b/veadk/webui/assets/visualizations/mermaid/diagram-Q27KOJAE-DiL6LnT_.js @@ -1,4 +1,4 @@ -import{p as ge}from"./chunk-JWPE2WC7-DD-BFVC6.js";import{a as w,a8 as ye,X as ae,r as ee,aP as Se,B as ve,at as te,a$ as B,aR as xe,W as be,aT as we,$ as Ce,V as Te,aQ as $e,O as Le,al as Ae,s as Fe}from"./mermaid.core-y4TF8bTw.js";import{s as Ne}from"./chunk-KBJHAD2P-DtNDDRN1.js";import{p as Me}from"./cynefin-OW5HDTMX-DBq9B5VP.js";import{aG as Q}from"../../app/index-BNPwMQXG.js";import{f as O}from"../../chunks/defaultLocale-CrowFXzY.js";import{o as K}from"../../chunks/ordinal-Cboi1Yqb.js";import"../../chunks/purify.es-BnINGy_Y.js";import"../../chunks/init-Gi6I4Gst.js";function _e(t){var a=0,l=t.children,n=l&&l.length;if(!n)a=1;else for(;--n>=0;)a+=l[n].value;t.value=a}function ke(){return this.eachAfter(_e)}function Ve(t,a){let l=-1;for(const n of this)t.call(a,n,++l,this);return this}function ze(t,a){for(var l=this,n=[l],r,s,h=-1;l=n.pop();)if(t.call(a,l,++h,this),r=l.children)for(s=r.length-1;s>=0;--s)n.push(r[s]);return this}function De(t,a){for(var l=this,n=[l],r=[],s,h,d,g=-1;l=n.pop();)if(r.push(l),s=l.children)for(h=0,d=s.length;h=0;)l+=n[r].value;a.value=l})}function Re(t){return this.eachBefore(function(a){a.children&&a.children.sort(t)})}function We(t){for(var a=this,l=Ee(a,t),n=[a];a!==l;)a=a.parent,n.push(a);for(var r=n.length;t!==l;)n.splice(r,0,t),t=t.parent;return n}function Ee(t,a){if(t===a)return t;var l=t.ancestors(),n=a.ancestors(),r=null;for(t=l.pop(),a=n.pop();t===a;)r=t,t=l.pop(),a=n.pop();return r}function He(){for(var t=this,a=[t];t=t.parent;)a.push(t);return a}function Ie(){return Array.from(this)}function Oe(){var t=[];return this.eachBefore(function(a){a.children||t.push(a)}),t}function Ge(){var t=this,a=[];return t.each(function(l){l!==t&&a.push({source:l.parent,target:l})}),a}function*Xe(){var t=this,a,l=[t],n,r,s;do for(a=l.reverse(),l=[];t=a.pop();)if(yield t,n=t.children)for(r=0,s=n.length;r=0;--d)r.push(s=h[d]=new U(h[d])),s.parent=n,s.depth=n.depth+1;return l.eachBefore(Ue)}function qe(){return ne(this).eachBefore(Qe)}function Ye(t){return t.children}function je(t){return Array.isArray(t)?t[1]:null}function Qe(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Ue(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}function U(t){this.data=t,this.depth=this.height=0,this.parent=null}U.prototype=ne.prototype={constructor:U,count:ke,each:Ve,eachAfter:De,eachBefore:ze,find:Pe,sum:Be,sort:Re,path:We,ancestors:He,descendants:Ie,leaves:Oe,links:Ge,copy:qe,[Symbol.iterator]:Xe};function Ze(t){if(typeof t!="function")throw new Error;return t}function G(){return 0}function X(t){return function(){return t}}function Je(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Ke(t,a,l,n,r){for(var s=t.children,h,d=-1,g=s.length,c=t.value&&(n-a)/t.value;++dM&&(M=c),_=p*p*E,A=Math.max(M/_,_/y),A>z){p-=c;break}z=A}h.push(g={value:p,dice:x1?n:1)},l}(tt);function lt(){var t=nt,a=!1,l=1,n=1,r=[0],s=G,h=G,d=G,g=G,c=G;function u(i){return i.x0=i.y0=0,i.x1=l,i.y1=n,i.eachBefore(b),r=[0],a&&i.eachBefore(Je),i}function b(i){var x=r[i.depth],S=i.x0+x,v=i.y0+x,p=i.x1-x,y=i.y1-x;p{Ae(s)&&(n!=null&&n.textStyles?n.textStyles.push(s):n.textStyles=[s]),n!=null&&n.styles?n.styles.push(s):n.styles=[s]}),this.classes.set(a,n)}getClasses(){return this.classes}getStylesForClass(a){var l;return((l=this.classes.get(a))==null?void 0:l.styles)??[]}clear(){Fe(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},w(W,"TreeMapDB"),W);function ce(t){if(!t.length)return[];const a=[],l=[];return t.forEach(n=>{const r={name:n.name,children:n.type==="Leaf"?void 0:[]};for(r.classSelector=n==null?void 0:n.classSelector,n!=null&&n.cssCompiledStyles&&(r.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(r.value=n.value);l.length>0&&l[l.length-1].level>=n.level;)l.pop();if(l.length===0)a.push(r);else{const s=l[l.length-1].node;s.children?s.children.push(r):s.children=[r]}n.type!=="Leaf"&&l.push({node:r,level:n.level})}),a}w(ce,"buildHierarchy");var rt=w((t,a)=>{ge(t,a);const l=[];for(const s of t.TreemapRows??[])s.$type==="ClassDefStatement"&&a.addClass(s.className??"",s.styleText??"");for(const s of t.TreemapRows??[]){const h=s.item;if(!h)continue;const d=s.indent?parseInt(s.indent):0,g=st(h),c=h.classSelector?a.getStylesForClass(h.classSelector):[],u=c.length>0?c:void 0,b={level:d,name:g,type:h.$type,value:h.value,classSelector:h.classSelector,cssCompiledStyles:u};l.push(b)}const n=ce(l),r=w((s,h)=>{for(const d of s)a.addNode(d,h),d.children&&d.children.length>0&&r(d.children,h+1)},"addNodesRecursively");r(n,0)},"populate"),st=w(t=>t.name?String(t.name):"","getItemName"),he={parser:{yy:void 0},parse:w(async t=>{var a;try{const n=await Me("treemap",t);te.debug("Treemap AST:",n);const r=(a=he.parser)==null?void 0:a.yy;if(!(r instanceof oe))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");rt(n,r)}catch(l){throw te.error("Error parsing treemap:",l),l}},"parse")},it=10,R=10,q=25,ot=w((t,a,l,n)=>{const r=n.db,s=r.getConfig(),h=s.padding??it,d=r.getDiagramTitle(),g=r.getRoot(),{themeVariables:c}=ae();if(!g)return;const u=d?30:0,b=Se(a),i=s.nodeWidth?s.nodeWidth*R:960,x=s.nodeHeight?s.nodeHeight*R:500,S=i,v=x+u;b.attr("viewBox",`0 0 ${S} ${v}`),ve(b,v,S,s.useMaxWidth);let p;try{const e=s.valueFormat||",";if(e==="$0,0")p=w(o=>"$"+O(",")(o),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const o=/\.\d+/.exec(e),f=o?o[0]:"";p=w(C=>"$"+O(","+f)(C),"valueFormat")}else if(e.startsWith("$")){const o=e.substring(1);p=w(f=>"$"+O(o||"")(f),"valueFormat")}else p=O(e)}catch(e){te.error("Error creating format function:",e),p=O(",")}const y=K().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),M=K().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),A=K().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);d&&b.append("text").attr("x",S/2).attr("y",u/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(d);const z=b.append("g").attr("transform",`translate(0, ${u})`).attr("class","treemapContainer"),E=ne(g).sum(e=>e.value??0).sort((e,o)=>(o.value??0)-(e.value??0)),le=lt().size([i,x]).paddingTop(e=>e.children&&e.children.length>0?q+R:0).paddingInner(h).paddingLeft(e=>e.children&&e.children.length>0?R:0).paddingRight(e=>e.children&&e.children.length>0?R:0).paddingBottom(e=>e.children&&e.children.length>0?R:0).round(!0)(E),de=le.descendants().filter(e=>e.children&&e.children.length>0),H=z.selectAll(".treemapSection").data(de).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);H.append("rect").attr("width",e=>e.x1-e.x0).attr("height",q).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),H.append("clipPath").attr("id",(e,o)=>`clip-section-${a}-${o}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",q),H.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,o)=>`treemapSection section${o}`).attr("fill",e=>y(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>M(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const o=B({cssCompiledStyles:e.data.cssCompiledStyles});return o.nodeStyles+";"+o.borderStyles.join(";")}),H.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",q/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("clip-path",(e,o)=>`url(#clip-section-${a}-${o})`).attr("style",e=>{if(e.depth===0)return"display: none;";const o="dominant-baseline: middle; font-size: 12px; fill:"+A(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const o=Q(this),f=e.data.name;o.text(f);const C=e.x1-e.x0,$=6;let T;s.showValues!==!1&&e.value?T=C-10-30-10-$:T=C-$-6;const m=Math.max(15,T),k=o.node();if(k.getComputedTextLength()>m){const L="...";let V=f;for(;V.length>0;){if(V=f.substring(0,V.length-1),V.length===0){o.text(L),k.getComputedTextLength()>m&&o.text("");break}if(o.text(V+L),k.getComputedTextLength()<=m)break}}}),s.showValues!==!1&&H.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",q/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?p(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const o="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+A(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")});const re=le.leaves(),F=re.length>20,ue=F?16:38,Y=F?14:28,D=F?4:8,I=F?4:6,Z=F?2:4,se=F?8:10,J=F?1:2,j=z.selectAll(".treemapLeafGroup").data(re).enter().append("g").attr("class",(e,o)=>`treemapNode treemapLeafGroup leaf${o}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);j.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("style",e=>B({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("stroke-width",3),j.append("clipPath").attr("id",(e,o)=>`clip-${a}-${o}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),j.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{const o=`text-anchor: middle; dominant-baseline: middle; font-size: ${ue}px;fill:`+A(e.data.name)+";",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,o)=>`url(#clip-${a}-${o})`).text(e=>e.data.name).each(function(e){const o=Q(this),f=e.x1-e.x0,C=e.y1-e.y0,$=o.node(),T=f-2*Z,P=C-2*Z;if(TT&&m>D;)m--,o.style("font-size",`${m}px`);let N=Math.max(I,Math.min(Y,Math.round(m*k))),L=m+J+N;for(;L>P&&m>D&&(m--,N=Math.max(I,Math.min(Y,Math.round(m*k))),!(NT||m(o.x1-o.x0)/2).attr("y",function(o){return(o.y1-o.y0)/2}).attr("style",o=>{const f=`text-anchor: middle; dominant-baseline: hanging; font-size: ${Y}px;fill:`+A(o.data.name)+";",C=B({cssCompiledStyles:o.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(o,f)=>`url(#clip-${a}-${f})`).text(o=>o.value?p(o.value):"").each(function(o){const f=Q(this),C=this.parentNode;if(!C){f.style("display","none");return}const $=Q(C).select(".treemapLabel");if($.empty()||$.style("display")==="none"){f.style("display","none");return}const T=parseFloat($.style("font-size")),m=Math.max(I,Math.min(Y,Math.round(T*.6)));f.style("font-size",`${m}px`);const N=(o.y1-o.y0)/2+T/2+J;f.attr("y",N);const L=o.x1-o.x0,ie=o.y1-o.y0-4,me=L-2*Z;f.node().getComputedTextLength()>me||N+m>ie||m{const a=ye(),l=ae(),n=ee(a,l.themeVariables),r=ee(dt,t),s=r.titleColor??n.titleColor,h=r.labelColor??n.textColor,d=r.valueColor??n.textColor;return` +import{p as ge}from"./chunk-JWPE2WC7-DVlhplzu.js";import{a as w,a8 as ye,X as ae,r as ee,aP as Se,B as ve,at as te,a$ as B,aR as xe,W as be,aT as we,$ as Ce,V as Te,aQ as $e,O as Le,al as Ae,s as Fe}from"./mermaid.core-DAx4nvmm.js";import{s as Ne}from"./chunk-KBJHAD2P-C0rklDe7.js";import{p as Me}from"./cynefin-OW5HDTMX-BHP1Kvyc.js";import{aG as Q}from"../../app/index-8JtvDNuA.js";import{f as O}from"../../chunks/defaultLocale-CrowFXzY.js";import{o as K}from"../../chunks/ordinal-Cboi1Yqb.js";import"../../chunks/purify.es-BnINGy_Y.js";import"../../chunks/init-Gi6I4Gst.js";function _e(t){var a=0,l=t.children,n=l&&l.length;if(!n)a=1;else for(;--n>=0;)a+=l[n].value;t.value=a}function ke(){return this.eachAfter(_e)}function Ve(t,a){let l=-1;for(const n of this)t.call(a,n,++l,this);return this}function ze(t,a){for(var l=this,n=[l],r,s,h=-1;l=n.pop();)if(t.call(a,l,++h,this),r=l.children)for(s=r.length-1;s>=0;--s)n.push(r[s]);return this}function De(t,a){for(var l=this,n=[l],r=[],s,h,d,g=-1;l=n.pop();)if(r.push(l),s=l.children)for(h=0,d=s.length;h=0;)l+=n[r].value;a.value=l})}function Re(t){return this.eachBefore(function(a){a.children&&a.children.sort(t)})}function We(t){for(var a=this,l=Ee(a,t),n=[a];a!==l;)a=a.parent,n.push(a);for(var r=n.length;t!==l;)n.splice(r,0,t),t=t.parent;return n}function Ee(t,a){if(t===a)return t;var l=t.ancestors(),n=a.ancestors(),r=null;for(t=l.pop(),a=n.pop();t===a;)r=t,t=l.pop(),a=n.pop();return r}function He(){for(var t=this,a=[t];t=t.parent;)a.push(t);return a}function Ie(){return Array.from(this)}function Oe(){var t=[];return this.eachBefore(function(a){a.children||t.push(a)}),t}function Ge(){var t=this,a=[];return t.each(function(l){l!==t&&a.push({source:l.parent,target:l})}),a}function*Xe(){var t=this,a,l=[t],n,r,s;do for(a=l.reverse(),l=[];t=a.pop();)if(yield t,n=t.children)for(r=0,s=n.length;r=0;--d)r.push(s=h[d]=new U(h[d])),s.parent=n,s.depth=n.depth+1;return l.eachBefore(Ue)}function qe(){return ne(this).eachBefore(Qe)}function Ye(t){return t.children}function je(t){return Array.isArray(t)?t[1]:null}function Qe(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Ue(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}function U(t){this.data=t,this.depth=this.height=0,this.parent=null}U.prototype=ne.prototype={constructor:U,count:ke,each:Ve,eachAfter:De,eachBefore:ze,find:Pe,sum:Be,sort:Re,path:We,ancestors:He,descendants:Ie,leaves:Oe,links:Ge,copy:qe,[Symbol.iterator]:Xe};function Ze(t){if(typeof t!="function")throw new Error;return t}function G(){return 0}function X(t){return function(){return t}}function Je(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Ke(t,a,l,n,r){for(var s=t.children,h,d=-1,g=s.length,c=t.value&&(n-a)/t.value;++dM&&(M=c),_=p*p*E,A=Math.max(M/_,_/y),A>z){p-=c;break}z=A}h.push(g={value:p,dice:x1?n:1)},l}(tt);function lt(){var t=nt,a=!1,l=1,n=1,r=[0],s=G,h=G,d=G,g=G,c=G;function u(i){return i.x0=i.y0=0,i.x1=l,i.y1=n,i.eachBefore(b),r=[0],a&&i.eachBefore(Je),i}function b(i){var x=r[i.depth],S=i.x0+x,v=i.y0+x,p=i.x1-x,y=i.y1-x;p{Ae(s)&&(n!=null&&n.textStyles?n.textStyles.push(s):n.textStyles=[s]),n!=null&&n.styles?n.styles.push(s):n.styles=[s]}),this.classes.set(a,n)}getClasses(){return this.classes}getStylesForClass(a){var l;return((l=this.classes.get(a))==null?void 0:l.styles)??[]}clear(){Fe(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},w(W,"TreeMapDB"),W);function ce(t){if(!t.length)return[];const a=[],l=[];return t.forEach(n=>{const r={name:n.name,children:n.type==="Leaf"?void 0:[]};for(r.classSelector=n==null?void 0:n.classSelector,n!=null&&n.cssCompiledStyles&&(r.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(r.value=n.value);l.length>0&&l[l.length-1].level>=n.level;)l.pop();if(l.length===0)a.push(r);else{const s=l[l.length-1].node;s.children?s.children.push(r):s.children=[r]}n.type!=="Leaf"&&l.push({node:r,level:n.level})}),a}w(ce,"buildHierarchy");var rt=w((t,a)=>{ge(t,a);const l=[];for(const s of t.TreemapRows??[])s.$type==="ClassDefStatement"&&a.addClass(s.className??"",s.styleText??"");for(const s of t.TreemapRows??[]){const h=s.item;if(!h)continue;const d=s.indent?parseInt(s.indent):0,g=st(h),c=h.classSelector?a.getStylesForClass(h.classSelector):[],u=c.length>0?c:void 0,b={level:d,name:g,type:h.$type,value:h.value,classSelector:h.classSelector,cssCompiledStyles:u};l.push(b)}const n=ce(l),r=w((s,h)=>{for(const d of s)a.addNode(d,h),d.children&&d.children.length>0&&r(d.children,h+1)},"addNodesRecursively");r(n,0)},"populate"),st=w(t=>t.name?String(t.name):"","getItemName"),he={parser:{yy:void 0},parse:w(async t=>{var a;try{const n=await Me("treemap",t);te.debug("Treemap AST:",n);const r=(a=he.parser)==null?void 0:a.yy;if(!(r instanceof oe))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");rt(n,r)}catch(l){throw te.error("Error parsing treemap:",l),l}},"parse")},it=10,R=10,q=25,ot=w((t,a,l,n)=>{const r=n.db,s=r.getConfig(),h=s.padding??it,d=r.getDiagramTitle(),g=r.getRoot(),{themeVariables:c}=ae();if(!g)return;const u=d?30:0,b=Se(a),i=s.nodeWidth?s.nodeWidth*R:960,x=s.nodeHeight?s.nodeHeight*R:500,S=i,v=x+u;b.attr("viewBox",`0 0 ${S} ${v}`),ve(b,v,S,s.useMaxWidth);let p;try{const e=s.valueFormat||",";if(e==="$0,0")p=w(o=>"$"+O(",")(o),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const o=/\.\d+/.exec(e),f=o?o[0]:"";p=w(C=>"$"+O(","+f)(C),"valueFormat")}else if(e.startsWith("$")){const o=e.substring(1);p=w(f=>"$"+O(o||"")(f),"valueFormat")}else p=O(e)}catch(e){te.error("Error creating format function:",e),p=O(",")}const y=K().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),M=K().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),A=K().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);d&&b.append("text").attr("x",S/2).attr("y",u/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(d);const z=b.append("g").attr("transform",`translate(0, ${u})`).attr("class","treemapContainer"),E=ne(g).sum(e=>e.value??0).sort((e,o)=>(o.value??0)-(e.value??0)),le=lt().size([i,x]).paddingTop(e=>e.children&&e.children.length>0?q+R:0).paddingInner(h).paddingLeft(e=>e.children&&e.children.length>0?R:0).paddingRight(e=>e.children&&e.children.length>0?R:0).paddingBottom(e=>e.children&&e.children.length>0?R:0).round(!0)(E),de=le.descendants().filter(e=>e.children&&e.children.length>0),H=z.selectAll(".treemapSection").data(de).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);H.append("rect").attr("width",e=>e.x1-e.x0).attr("height",q).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),H.append("clipPath").attr("id",(e,o)=>`clip-section-${a}-${o}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",q),H.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,o)=>`treemapSection section${o}`).attr("fill",e=>y(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>M(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const o=B({cssCompiledStyles:e.data.cssCompiledStyles});return o.nodeStyles+";"+o.borderStyles.join(";")}),H.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",q/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("clip-path",(e,o)=>`url(#clip-section-${a}-${o})`).attr("style",e=>{if(e.depth===0)return"display: none;";const o="dominant-baseline: middle; font-size: 12px; fill:"+A(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const o=Q(this),f=e.data.name;o.text(f);const C=e.x1-e.x0,$=6;let T;s.showValues!==!1&&e.value?T=C-10-30-10-$:T=C-$-6;const m=Math.max(15,T),k=o.node();if(k.getComputedTextLength()>m){const L="...";let V=f;for(;V.length>0;){if(V=f.substring(0,V.length-1),V.length===0){o.text(L),k.getComputedTextLength()>m&&o.text("");break}if(o.text(V+L),k.getComputedTextLength()<=m)break}}}),s.showValues!==!1&&H.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",q/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?p(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const o="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+A(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")});const re=le.leaves(),F=re.length>20,ue=F?16:38,Y=F?14:28,D=F?4:8,I=F?4:6,Z=F?2:4,se=F?8:10,J=F?1:2,j=z.selectAll(".treemapLeafGroup").data(re).enter().append("g").attr("class",(e,o)=>`treemapNode treemapLeafGroup leaf${o}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);j.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("style",e=>B({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("stroke-width",3),j.append("clipPath").attr("id",(e,o)=>`clip-${a}-${o}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),j.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{const o=`text-anchor: middle; dominant-baseline: middle; font-size: ${ue}px;fill:`+A(e.data.name)+";",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,o)=>`url(#clip-${a}-${o})`).text(e=>e.data.name).each(function(e){const o=Q(this),f=e.x1-e.x0,C=e.y1-e.y0,$=o.node(),T=f-2*Z,P=C-2*Z;if(TT&&m>D;)m--,o.style("font-size",`${m}px`);let N=Math.max(I,Math.min(Y,Math.round(m*k))),L=m+J+N;for(;L>P&&m>D&&(m--,N=Math.max(I,Math.min(Y,Math.round(m*k))),!(NT||m(o.x1-o.x0)/2).attr("y",function(o){return(o.y1-o.y0)/2}).attr("style",o=>{const f=`text-anchor: middle; dominant-baseline: hanging; font-size: ${Y}px;fill:`+A(o.data.name)+";",C=B({cssCompiledStyles:o.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(o,f)=>`url(#clip-${a}-${f})`).text(o=>o.value?p(o.value):"").each(function(o){const f=Q(this),C=this.parentNode;if(!C){f.style("display","none");return}const $=Q(C).select(".treemapLabel");if($.empty()||$.style("display")==="none"){f.style("display","none");return}const T=parseFloat($.style("font-size")),m=Math.max(I,Math.min(Y,Math.round(T*.6)));f.style("font-size",`${m}px`);const N=(o.y1-o.y0)/2+T/2+J;f.attr("y",N);const L=o.x1-o.x0,ie=o.y1-o.y0-4,me=L-2*Z;f.node().getComputedTextLength()>me||N+m>ie||m{const a=ye(),l=ae(),n=ee(a,l.themeVariables),r=ee(dt,t),s=r.titleColor??n.titleColor,h=r.labelColor??n.textColor,d=r.valueColor??n.textColor;return` .treemapNode.section { stroke: ${r.sectionStrokeColor}; stroke-width: ${r.sectionStrokeWidth}; diff --git a/veadk/webui/assets/visualizations/mermaid/diagram-UB23O5K3-2zSFzlV6.js b/veadk/webui/assets/visualizations/mermaid/diagram-UB23O5K3-AYjZ4Axz.js similarity index 95% rename from veadk/webui/assets/visualizations/mermaid/diagram-UB23O5K3-2zSFzlV6.js rename to veadk/webui/assets/visualizations/mermaid/diagram-UB23O5K3-AYjZ4Axz.js index 4167740e2..e237b3962 100644 --- a/veadk/webui/assets/visualizations/mermaid/diagram-UB23O5K3-2zSFzlV6.js +++ b/veadk/webui/assets/visualizations/mermaid/diagram-UB23O5K3-AYjZ4Axz.js @@ -1,4 +1,4 @@ -import{p as I}from"./chunk-JWPE2WC7-DD-BFVC6.js";import{aQ as _,V as E,$ as F,aT as D,W as P,aR as z,a as c,aP as G,s as B,r as w,X as C,O as W,at as b,a8 as V,B as H}from"./mermaid.core-y4TF8bTw.js";import{p as X}from"./cynefin-OW5HDTMX-DBq9B5VP.js";import"../../app/index-BNPwMQXG.js";import"../../chunks/purify.es-BnINGy_Y.js";var x={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},y=32,A={axes:[],curves:[],options:x},m=structuredClone(A),j=W.radar,U=c(()=>w({...j,...C().radar}),"getConfig"),M=c(()=>m.axes,"getAxes"),K=c(()=>m.curves,"getCurves"),N=c(()=>m.options,"getOptions"),Q=c(a=>{m.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),Y=c(a=>{m.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:Z(t.entries)}))},"setCurves"),Z=c(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=M();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>{var n;return((n=s.axis)==null?void 0:n.$refText)===e.name});if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),q=c(a=>{var e,r,s,n,l;const t=a.reduce((o,i)=>(o[i.name]=i,o),{});m.options={showLegend:((e=t.showLegend)==null?void 0:e.value)??x.showLegend,ticks:((r=t.ticks)==null?void 0:r.value)??x.ticks,max:((s=t.max)==null?void 0:s.value)??x.max,min:((n=t.min)==null?void 0:n.value)??x.min,graticule:((l=t.graticule)==null?void 0:l.value)??x.graticule},m.options.ticks>y&&(b.warn(`Radar diagram ticks (${m.options.ticks}) exceeds maximum allowed (${y}). Using ${y} instead.`),m.options.ticks=y)},"setOptions"),J=c(()=>{B(),m=structuredClone(A)},"clear"),$={getAxes:M,getCurves:K,getOptions:N,setAxes:Q,setCurves:Y,setOptions:q,getConfig:U,clear:J,setAccTitle:z,getAccTitle:P,setDiagramTitle:D,getDiagramTitle:F,getAccDescription:E,setAccDescription:_},tt=c(a=>{I(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),et={parse:c(async a=>{const t=await X("radar",a);b.debug(t),tt(t)},"parse")},at=c((a,t,e,r)=>{const s=r.db,n=s.getAxes(),l=s.getCurves(),o=s.getOptions(),i=s.getConfig(),d=s.getDiagramTitle(),p=G(t),u=rt(p,i),g=o.max??Math.max(...l.map(f=>Math.max(...f.entries))),h=o.min,v=Math.min(i.width,i.height)/2;st(u,n,v,o.ticks,o.graticule),nt(u,n,v,i),L(u,n,l,h,g,o.graticule,i),k(u,l,o.showLegend,i),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-i.height/2-i.marginTop)},"draw"),rt=c((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return H(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),st=c((a,t,e,r,s)=>{if(s==="circle")for(let n=0;n{const u=2*p*Math.PI/n-Math.PI/2,g=o*Math.cos(u),h=o*Math.sin(u);return`${g},${h}`}).join(" ");a.append("polygon").attr("points",i).attr("class","radarGraticule")}}},"drawGraticule"),nt=c((a,t,e,r)=>{const s=t.length;for(let n=0;n.01?"start":i<-.01?"end":"middle",u=d>.01?"hanging":d<-.01?"auto":"central",g=4;a.append("text").text(l).attr("x",e*r.axisLabelFactor*i+g*i).attr("y",e*r.axisLabelFactor*d+g*d).attr("text-anchor",p).attr("dominant-baseline",u).attr("class","radarAxisLabel")}},"drawAxes");function L(a,t,e,r,s,n,l){const o=t.length,i=Math.min(l.width,l.height)/2;e.forEach((d,p)=>{if(d.entries.length!==o)return;const u=d.entries.map((g,h)=>{const v=2*Math.PI*h/o-Math.PI/2,f=T(g,r,s,i),O=f*Math.cos(v),R=f*Math.sin(v);return{x:O,y:R}});n==="circle"?a.append("path").attr("d",S(u,l.curveTension)).attr("class",`radarCurve-${p}`):n==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}c(L,"drawCurves");function T(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}c(T,"relativeRadius");function S(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s{const d=a.append("g").attr("transform",`translate(${s}, ${n+i*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${i}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(o.label)})}c(k,"drawLegend");var ot={draw:at},it=c((a,t)=>{let e="";for(let r=0;rw({...j,...C().radar}),"getConfig"),M=c(()=>m.axes,"getAxes"),K=c(()=>m.curves,"getCurves"),N=c(()=>m.options,"getOptions"),Q=c(a=>{m.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),Y=c(a=>{m.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:Z(t.entries)}))},"setCurves"),Z=c(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=M();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>{var n;return((n=s.axis)==null?void 0:n.$refText)===e.name});if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),q=c(a=>{var e,r,s,n,l;const t=a.reduce((o,i)=>(o[i.name]=i,o),{});m.options={showLegend:((e=t.showLegend)==null?void 0:e.value)??x.showLegend,ticks:((r=t.ticks)==null?void 0:r.value)??x.ticks,max:((s=t.max)==null?void 0:s.value)??x.max,min:((n=t.min)==null?void 0:n.value)??x.min,graticule:((l=t.graticule)==null?void 0:l.value)??x.graticule},m.options.ticks>y&&(b.warn(`Radar diagram ticks (${m.options.ticks}) exceeds maximum allowed (${y}). Using ${y} instead.`),m.options.ticks=y)},"setOptions"),J=c(()=>{B(),m=structuredClone(A)},"clear"),$={getAxes:M,getCurves:K,getOptions:N,setAxes:Q,setCurves:Y,setOptions:q,getConfig:U,clear:J,setAccTitle:z,getAccTitle:P,setDiagramTitle:D,getDiagramTitle:F,getAccDescription:E,setAccDescription:_},tt=c(a=>{I(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),et={parse:c(async a=>{const t=await X("radar",a);b.debug(t),tt(t)},"parse")},at=c((a,t,e,r)=>{const s=r.db,n=s.getAxes(),l=s.getCurves(),o=s.getOptions(),i=s.getConfig(),d=s.getDiagramTitle(),p=G(t),u=rt(p,i),g=o.max??Math.max(...l.map(f=>Math.max(...f.entries))),h=o.min,v=Math.min(i.width,i.height)/2;st(u,n,v,o.ticks,o.graticule),nt(u,n,v,i),L(u,n,l,h,g,o.graticule,i),k(u,l,o.showLegend,i),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-i.height/2-i.marginTop)},"draw"),rt=c((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return H(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),st=c((a,t,e,r,s)=>{if(s==="circle")for(let n=0;n{const u=2*p*Math.PI/n-Math.PI/2,g=o*Math.cos(u),h=o*Math.sin(u);return`${g},${h}`}).join(" ");a.append("polygon").attr("points",i).attr("class","radarGraticule")}}},"drawGraticule"),nt=c((a,t,e,r)=>{const s=t.length;for(let n=0;n.01?"start":i<-.01?"end":"middle",u=d>.01?"hanging":d<-.01?"auto":"central",g=4;a.append("text").text(l).attr("x",e*r.axisLabelFactor*i+g*i).attr("y",e*r.axisLabelFactor*d+g*d).attr("text-anchor",p).attr("dominant-baseline",u).attr("class","radarAxisLabel")}},"drawAxes");function L(a,t,e,r,s,n,l){const o=t.length,i=Math.min(l.width,l.height)/2;e.forEach((d,p)=>{if(d.entries.length!==o)return;const u=d.entries.map((g,h)=>{const v=2*Math.PI*h/o-Math.PI/2,f=T(g,r,s,i),O=f*Math.cos(v),R=f*Math.sin(v);return{x:O,y:R}});n==="circle"?a.append("path").attr("d",S(u,l.curveTension)).attr("class",`radarCurve-${p}`):n==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}c(L,"drawCurves");function T(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}c(T,"relativeRadius");function S(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s{const d=a.append("g").attr("transform",`translate(${s}, ${n+i*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${i}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(o.label)})}c(k,"drawLegend");var ot={draw:at},it=c((a,t)=>{let e="";for(let r=0;r{const r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),i=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},i(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),d=t(e=>e.postfixes.reduce((r,a)=>b(r,a),i(e.base)),"transformTerm"),y=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{p(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(y(r)))},"populateDb"),g={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");const r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},S={parser:g,db:n,renderer:l,styles:m};export{S as diagram}; +import{g as m,r as l,d as n}from"./chunk-6Q2QTUOP-N9gzANAs.js";import{p}from"./chunk-JWPE2WC7-DVlhplzu.js";import{a as t,at as o}from"./mermaid.core-DAx4nvmm.js";import"../../app/index-8JtvDNuA.js";import{M as u,a as f}from"./cynefin-OW5HDTMX-BHP1Kvyc.js";import"../../chunks/purify.es-BnINGy_Y.js";var c=f().RailroadEbnf.parser.LangiumParser,s=t(e=>{const r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),i=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},i(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),d=t(e=>e.postfixes.reduce((r,a)=>b(r,a),i(e.base)),"transformTerm"),y=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{p(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(y(r)))},"populateDb"),g={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");const r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},S={parser:g,db:n,renderer:l,styles:m};export{S as diagram}; diff --git a/veadk/webui/assets/visualizations/mermaid/erDiagram-JOGREHBK-CKTuwmcS.js b/veadk/webui/assets/visualizations/mermaid/erDiagram-JOGREHBK-54K1t1Ec.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/erDiagram-JOGREHBK-CKTuwmcS.js rename to veadk/webui/assets/visualizations/mermaid/erDiagram-JOGREHBK-54K1t1Ec.js index eb7213140..c008c1e3f 100644 --- a/veadk/webui/assets/visualizations/mermaid/erDiagram-JOGREHBK-CKTuwmcS.js +++ b/veadk/webui/assets/visualizations/mermaid/erDiagram-JOGREHBK-54K1t1Ec.js @@ -1,4 +1,4 @@ -import{g as Bt}from"./chunk-XXDRQBXY-B8qTF1qQ.js";import{s as Ft}from"./chunk-KBJHAD2P-DtNDDRN1.js";import{a as p,aR as Yt,W as Pt,aQ as zt,V as Gt,aT as Kt,$ as Ut,Y as rt,at as V,s as Zt,a0 as jt,aM as Wt,_ as Qt,a4 as Xt,aK as qt,b9 as Ht}from"./mermaid.core-y4TF8bTw.js";import{aG as Jt}from"../../app/index-BNPwMQXG.js";import{c as $t}from"../../chunks/channel-Bbp-1bKw.js";import"../../chunks/purify.es-BnINGy_Y.js";var gt=function(){var s=p(function(R,n,a,l){for(a=a||{},l=R.length;l--;a[R[l]]=n);return a},"o"),i=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],o=[1,10],h=[1,11],c=[1,12],u=[1,13],y=[1,23],d=[1,24],m=[1,25],W=[1,26],Q=[1,27],T=[1,19],X=[1,28],B=[1,29],D=[1,20],I=[1,18],S=[1,21],x=[1,22],at=[1,36],ct=[1,37],ot=[1,38],lt=[1,39],ht=[1,40],F=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,66,67,68,69,70],O=[1,45],N=[1,46],Y=[1,55],P=[40,48,50,51,52,71,72],z=[1,66],G=[1,64],A=[1,61],K=[1,65],U=[1,67],q=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,66,67,68,69,70],bt=[66,67,68,69,70],kt=[1,85],mt=[1,84],Et=[1,82],Tt=[1,83],St=[6,10,42,47],L=[6,10,13,41,42,47,48,49],H=[1,93],J=[1,92],$=[1,91],Z=[19,58],Ot=[1,102],Nt=[1,101],ut=[19,58,61,63],dt={trace:p(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,"?":59,attributeKeyType:60,",":61,ATTRIBUTE_KEY:62,COMMENT:63,cardinality:64,relType:65,ZERO_OR_ONE:66,ZERO_OR_MORE:67,ONE_OR_MORE:68,ONLY_ONE:69,MD_PARENT:70,NON_IDENTIFYING:71,IDENTIFYING:72,WORD:73,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",59:"?",61:",",62:"ATTRIBUTE_KEY",63:"COMMENT",66:"ZERO_OR_ONE",67:"ZERO_OR_MORE",68:"ONE_OR_MORE",69:"ONLY_ONE",70:"MD_PARENT",71:"NON_IDENTIFYING",72:"IDENTIFYING",73:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[54,2],[55,1],[56,1],[56,3],[60,1],[57,1],[12,3],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,1],[14,1],[14,1],[14,1]],performAction:p(function(n,a,l,r,f,t,j){var e=t.length-1;switch(f){case 1:break;case 2:this.$=[];break;case 3:t[e-1].push(t[e]),this.$=t[e-1];break;case 4:case 5:this.$=t[e];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(t[e-4]),r.addEntity(t[e-2]),r.addRelationship(t[e-4],t[e],t[e-2],t[e-3]);break;case 9:r.addEntity(t[e-8]),r.addEntity(t[e-4]),r.addRelationship(t[e-8],t[e],t[e-4],t[e-5]),r.setClass([t[e-8]],t[e-6]),r.setClass([t[e-4]],t[e-2]);break;case 10:r.addEntity(t[e-6]),r.addEntity(t[e-2]),r.addRelationship(t[e-6],t[e],t[e-2],t[e-3]),r.setClass([t[e-6]],t[e-4]);break;case 11:r.addEntity(t[e-6]),r.addEntity(t[e-4]),r.addRelationship(t[e-6],t[e],t[e-4],t[e-5]),r.setClass([t[e-4]],t[e-2]);break;case 12:r.addEntity(t[e-3]),r.addAttributes(t[e-3],t[e-1]);break;case 13:r.addEntity(t[e-5]),r.addAttributes(t[e-5],t[e-1]),r.setClass([t[e-5]],t[e-3]);break;case 14:r.addEntity(t[e-2]);break;case 15:r.addEntity(t[e-4]),r.setClass([t[e-4]],t[e-2]);break;case 16:r.addEntity(t[e]);break;case 17:r.addEntity(t[e-2]),r.setClass([t[e-2]],t[e]);break;case 18:r.addEntity(t[e-6],t[e-4]),r.addAttributes(t[e-6],t[e-1]);break;case 19:r.addEntity(t[e-8],t[e-6]),r.addAttributes(t[e-8],t[e-1]),r.setClass([t[e-8]],t[e-3]);break;case 20:r.addEntity(t[e-5],t[e-3]);break;case 21:r.addEntity(t[e-7],t[e-5]),r.setClass([t[e-7]],t[e-2]);break;case 22:r.addEntity(t[e-3],t[e-1]);break;case 23:r.addEntity(t[e-5],t[e-3]),r.setClass([t[e-5]],t[e]);break;case 24:case 25:this.$=t[e].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=t[e].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection("TB");break;case 33:r.setDirection("BT");break;case 34:r.setDirection("RL");break;case 35:r.setDirection("LR");break;case 36:this.$=t[e-3],r.addClass(t[e-2],t[e-1]);break;case 37:case 38:case 59:case 68:this.$=[t[e]];break;case 39:case 40:this.$=t[e-2].concat([t[e]]);break;case 41:this.$=t[e-2],r.setClass(t[e-1],t[e]);break;case 42:this.$=t[e-3],r.addCssStyles(t[e-2],t[e-1]);break;case 43:this.$=[t[e]];break;case 44:t[e-2].push(t[e]),this.$=t[e-2];break;case 46:this.$=t[e-1]+t[e];break;case 54:case 80:case 81:this.$=t[e].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 82:this.$=t[e];break;case 60:t[e].push(t[e-1]),this.$=t[e];break;case 61:this.$={type:t[e-1],name:t[e]};break;case 62:this.$={type:t[e-2],name:t[e-1],keys:t[e]};break;case 63:this.$={type:t[e-2],name:t[e-1],comment:t[e]};break;case 64:this.$={type:t[e-3],name:t[e-2],keys:t[e-1],comment:t[e]};break;case 65:case 67:case 70:this.$=t[e];break;case 66:this.$=t[e-1]+t[e];break;case 69:t[e-2].push(t[e]),this.$=t[e-2];break;case 71:this.$=t[e].replace(/"/g,"");break;case 72:this.$={cardA:t[e],relType:t[e-1],cardB:t[e-2]};break;case 73:this.$=r.Cardinality.ZERO_OR_ONE;break;case 74:this.$=r.Cardinality.ZERO_OR_MORE;break;case 75:this.$=r.Cardinality.ONE_OR_MORE;break;case 76:this.$=r.Cardinality.ONLY_ONE;break;case 77:this.$=r.Cardinality.MD_PARENT;break;case 78:this.$=r.Identification.NON_IDENTIFYING;break;case 79:this.$=r.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},s(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:o,24:h,26:c,28:u,29:14,30:15,31:16,32:17,33:y,34:d,35:m,36:W,37:Q,40:T,43:X,44:B,48:D,50:I,51:S,52:x},s(i,[2,7],{1:[2,1]}),s(i,[2,3]),{9:30,11:9,22:o,24:h,26:c,28:u,29:14,30:15,31:16,32:17,33:y,34:d,35:m,36:W,37:Q,40:T,43:X,44:B,48:D,50:I,51:S,52:x},s(i,[2,5]),s(i,[2,6]),s(i,[2,16],{12:31,64:35,15:[1,32],17:[1,33],20:[1,34],66:at,67:ct,68:ot,69:lt,70:ht}),{23:[1,41]},{25:[1,42]},{27:[1,43]},s(i,[2,27]),s(i,[2,28]),s(i,[2,29]),s(i,[2,30]),s(i,[2,31]),s(F,[2,54]),s(F,[2,55]),s(F,[2,56]),s(F,[2,57]),s(F,[2,58]),s(i,[2,32]),s(i,[2,33]),s(i,[2,34]),s(i,[2,35]),{16:44,40:O,41:N},{16:47,40:O,41:N},{16:48,40:O,41:N},s(i,[2,4]),{11:49,40:T,48:D,50:I,51:S,52:x},{16:50,40:O,41:N},{18:51,19:[1,52],53:53,54:54,58:Y},{11:56,40:T,48:D,50:I,51:S,52:x},{65:57,71:[1,58],72:[1,59]},s(P,[2,73]),s(P,[2,74]),s(P,[2,75]),s(P,[2,76]),s(P,[2,77]),s(i,[2,24]),s(i,[2,25]),s(i,[2,26]),{13:z,38:60,41:G,42:A,45:62,46:63,48:K,49:U},s(q,[2,37]),s(q,[2,38]),{16:68,40:O,41:N,42:A},{13:z,38:69,41:G,42:A,45:62,46:63,48:K,49:U},{13:[1,70],15:[1,71]},s(i,[2,17],{64:35,12:72,17:[1,73],42:A,66:at,67:ct,68:ot,69:lt,70:ht}),{19:[1,74]},s(i,[2,14]),{18:75,19:[2,59],53:53,54:54,58:Y},{55:76,58:[1,77]},{58:[2,65],59:[1,78]},{21:[1,79]},{64:80,66:at,67:ct,68:ot,69:lt,70:ht},s(bt,[2,78]),s(bt,[2,79]),{6:kt,10:mt,39:81,42:Et,47:Tt},{40:[1,86],41:[1,87]},s(St,[2,43],{46:88,13:z,41:G,48:K,49:U}),s(L,[2,45]),s(L,[2,50]),s(L,[2,51]),s(L,[2,52]),s(L,[2,53]),s(i,[2,41],{42:A}),{6:kt,10:mt,39:89,42:Et,47:Tt},{14:90,40:H,50:J,73:$},{16:94,40:O,41:N},{11:95,40:T,48:D,50:I,51:S,52:x},{18:96,19:[1,97],53:53,54:54,58:Y},s(i,[2,12]),{19:[2,60]},s(Z,[2,61],{56:98,57:99,60:100,62:Ot,63:Nt}),s([19,58,62,63],[2,67]),{58:[2,66]},s(i,[2,22],{15:[1,104],17:[1,103]}),s([40,48,50,51,52],[2,72]),s(i,[2,36]),{13:z,41:G,45:105,46:63,48:K,49:U},s(i,[2,47]),s(i,[2,48]),s(i,[2,49]),s(q,[2,39]),s(q,[2,40]),s(L,[2,46]),s(i,[2,42]),s(i,[2,8]),s(i,[2,80]),s(i,[2,81]),s(i,[2,82]),{13:[1,106],42:A},{13:[1,108],15:[1,107]},{19:[1,109]},s(i,[2,15]),s(Z,[2,62],{57:110,61:[1,111],63:Nt}),s(Z,[2,63]),s(ut,[2,68]),s(Z,[2,71]),s(ut,[2,70]),{18:112,19:[1,113],53:53,54:54,58:Y},{16:114,40:O,41:N},s(St,[2,44],{46:88,13:z,41:G,48:K,49:U}),{14:115,40:H,50:J,73:$},{16:116,40:O,41:N},{14:117,40:H,50:J,73:$},s(i,[2,13]),s(Z,[2,64]),{60:118,62:Ot},{19:[1,119]},s(i,[2,20]),s(i,[2,23],{17:[1,120],42:A}),s(i,[2,11]),{13:[1,121],42:A},s(i,[2,10]),s(ut,[2,69]),s(i,[2,18]),{18:122,19:[1,123],53:53,54:54,58:Y},{14:124,40:H,50:J,73:$},{19:[1,125]},s(i,[2,21]),s(i,[2,9]),s(i,[2,19])],defaultActions:{75:[2,60],78:[2,66]},parseError:p(function(n,a){if(a.recoverable)this.trace(n);else{var l=new Error(n);throw l.hash=a,l}},"parseError"),parse:p(function(n){var a=this,l=[0],r=[],f=[null],t=[],j=this.table,e="",et=0,At=0,Lt=2,Rt=1,wt=t.slice.call(arguments,1),_=Object.create(this.lexer),C={yy:{}};for(var pt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,pt)&&(C.yy[pt]=this.yy[pt]);_.setInput(n,C.yy),C.yy.lexer=_,C.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var ft=_.yylloc;t.push(ft);var Vt=_.options&&_.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Mt(b){l.length=l.length-2*b,f.length=f.length-b,t.length=t.length-b}p(Mt,"popStack");function It(){var b;return b=r.pop()||_.lex()||Rt,typeof b!="number"&&(b instanceof Array&&(r=b,b=r.pop()),b=a.symbols_[b]||b),b}p(It,"lex");for(var g,v,k,yt,w={},st,E,xt,it;;){if(v=l[l.length-1],this.defaultActions[v]?k=this.defaultActions[v]:((g===null||typeof g>"u")&&(g=It()),k=j[v]&&j[v][g]),typeof k>"u"||!k.length||!k[0]){var _t="";it=[];for(st in j[v])this.terminals_[st]&&st>Lt&&it.push("'"+this.terminals_[st]+"'");_.showPosition?_t="Parse error on line "+(et+1)+`: +import{g as Bt}from"./chunk-XXDRQBXY-BdI3VXTi.js";import{s as Ft}from"./chunk-KBJHAD2P-C0rklDe7.js";import{a as p,aR as Yt,W as Pt,aQ as zt,V as Gt,aT as Kt,$ as Ut,Y as rt,at as V,s as Zt,a0 as jt,aM as Wt,_ as Qt,a4 as Xt,aK as qt,b9 as Ht}from"./mermaid.core-DAx4nvmm.js";import{aG as Jt}from"../../app/index-8JtvDNuA.js";import{c as $t}from"../../chunks/channel-B1gj3-V8.js";import"../../chunks/purify.es-BnINGy_Y.js";var gt=function(){var s=p(function(R,n,a,l){for(a=a||{},l=R.length;l--;a[R[l]]=n);return a},"o"),i=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],o=[1,10],h=[1,11],c=[1,12],u=[1,13],y=[1,23],d=[1,24],m=[1,25],W=[1,26],Q=[1,27],T=[1,19],X=[1,28],B=[1,29],D=[1,20],I=[1,18],S=[1,21],x=[1,22],at=[1,36],ct=[1,37],ot=[1,38],lt=[1,39],ht=[1,40],F=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,66,67,68,69,70],O=[1,45],N=[1,46],Y=[1,55],P=[40,48,50,51,52,71,72],z=[1,66],G=[1,64],A=[1,61],K=[1,65],U=[1,67],q=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,66,67,68,69,70],bt=[66,67,68,69,70],kt=[1,85],mt=[1,84],Et=[1,82],Tt=[1,83],St=[6,10,42,47],L=[6,10,13,41,42,47,48,49],H=[1,93],J=[1,92],$=[1,91],Z=[19,58],Ot=[1,102],Nt=[1,101],ut=[19,58,61,63],dt={trace:p(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,"?":59,attributeKeyType:60,",":61,ATTRIBUTE_KEY:62,COMMENT:63,cardinality:64,relType:65,ZERO_OR_ONE:66,ZERO_OR_MORE:67,ONE_OR_MORE:68,ONLY_ONE:69,MD_PARENT:70,NON_IDENTIFYING:71,IDENTIFYING:72,WORD:73,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",59:"?",61:",",62:"ATTRIBUTE_KEY",63:"COMMENT",66:"ZERO_OR_ONE",67:"ZERO_OR_MORE",68:"ONE_OR_MORE",69:"ONLY_ONE",70:"MD_PARENT",71:"NON_IDENTIFYING",72:"IDENTIFYING",73:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[54,2],[55,1],[56,1],[56,3],[60,1],[57,1],[12,3],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,1],[14,1],[14,1],[14,1]],performAction:p(function(n,a,l,r,f,t,j){var e=t.length-1;switch(f){case 1:break;case 2:this.$=[];break;case 3:t[e-1].push(t[e]),this.$=t[e-1];break;case 4:case 5:this.$=t[e];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(t[e-4]),r.addEntity(t[e-2]),r.addRelationship(t[e-4],t[e],t[e-2],t[e-3]);break;case 9:r.addEntity(t[e-8]),r.addEntity(t[e-4]),r.addRelationship(t[e-8],t[e],t[e-4],t[e-5]),r.setClass([t[e-8]],t[e-6]),r.setClass([t[e-4]],t[e-2]);break;case 10:r.addEntity(t[e-6]),r.addEntity(t[e-2]),r.addRelationship(t[e-6],t[e],t[e-2],t[e-3]),r.setClass([t[e-6]],t[e-4]);break;case 11:r.addEntity(t[e-6]),r.addEntity(t[e-4]),r.addRelationship(t[e-6],t[e],t[e-4],t[e-5]),r.setClass([t[e-4]],t[e-2]);break;case 12:r.addEntity(t[e-3]),r.addAttributes(t[e-3],t[e-1]);break;case 13:r.addEntity(t[e-5]),r.addAttributes(t[e-5],t[e-1]),r.setClass([t[e-5]],t[e-3]);break;case 14:r.addEntity(t[e-2]);break;case 15:r.addEntity(t[e-4]),r.setClass([t[e-4]],t[e-2]);break;case 16:r.addEntity(t[e]);break;case 17:r.addEntity(t[e-2]),r.setClass([t[e-2]],t[e]);break;case 18:r.addEntity(t[e-6],t[e-4]),r.addAttributes(t[e-6],t[e-1]);break;case 19:r.addEntity(t[e-8],t[e-6]),r.addAttributes(t[e-8],t[e-1]),r.setClass([t[e-8]],t[e-3]);break;case 20:r.addEntity(t[e-5],t[e-3]);break;case 21:r.addEntity(t[e-7],t[e-5]),r.setClass([t[e-7]],t[e-2]);break;case 22:r.addEntity(t[e-3],t[e-1]);break;case 23:r.addEntity(t[e-5],t[e-3]),r.setClass([t[e-5]],t[e]);break;case 24:case 25:this.$=t[e].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=t[e].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection("TB");break;case 33:r.setDirection("BT");break;case 34:r.setDirection("RL");break;case 35:r.setDirection("LR");break;case 36:this.$=t[e-3],r.addClass(t[e-2],t[e-1]);break;case 37:case 38:case 59:case 68:this.$=[t[e]];break;case 39:case 40:this.$=t[e-2].concat([t[e]]);break;case 41:this.$=t[e-2],r.setClass(t[e-1],t[e]);break;case 42:this.$=t[e-3],r.addCssStyles(t[e-2],t[e-1]);break;case 43:this.$=[t[e]];break;case 44:t[e-2].push(t[e]),this.$=t[e-2];break;case 46:this.$=t[e-1]+t[e];break;case 54:case 80:case 81:this.$=t[e].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 82:this.$=t[e];break;case 60:t[e].push(t[e-1]),this.$=t[e];break;case 61:this.$={type:t[e-1],name:t[e]};break;case 62:this.$={type:t[e-2],name:t[e-1],keys:t[e]};break;case 63:this.$={type:t[e-2],name:t[e-1],comment:t[e]};break;case 64:this.$={type:t[e-3],name:t[e-2],keys:t[e-1],comment:t[e]};break;case 65:case 67:case 70:this.$=t[e];break;case 66:this.$=t[e-1]+t[e];break;case 69:t[e-2].push(t[e]),this.$=t[e-2];break;case 71:this.$=t[e].replace(/"/g,"");break;case 72:this.$={cardA:t[e],relType:t[e-1],cardB:t[e-2]};break;case 73:this.$=r.Cardinality.ZERO_OR_ONE;break;case 74:this.$=r.Cardinality.ZERO_OR_MORE;break;case 75:this.$=r.Cardinality.ONE_OR_MORE;break;case 76:this.$=r.Cardinality.ONLY_ONE;break;case 77:this.$=r.Cardinality.MD_PARENT;break;case 78:this.$=r.Identification.NON_IDENTIFYING;break;case 79:this.$=r.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},s(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:o,24:h,26:c,28:u,29:14,30:15,31:16,32:17,33:y,34:d,35:m,36:W,37:Q,40:T,43:X,44:B,48:D,50:I,51:S,52:x},s(i,[2,7],{1:[2,1]}),s(i,[2,3]),{9:30,11:9,22:o,24:h,26:c,28:u,29:14,30:15,31:16,32:17,33:y,34:d,35:m,36:W,37:Q,40:T,43:X,44:B,48:D,50:I,51:S,52:x},s(i,[2,5]),s(i,[2,6]),s(i,[2,16],{12:31,64:35,15:[1,32],17:[1,33],20:[1,34],66:at,67:ct,68:ot,69:lt,70:ht}),{23:[1,41]},{25:[1,42]},{27:[1,43]},s(i,[2,27]),s(i,[2,28]),s(i,[2,29]),s(i,[2,30]),s(i,[2,31]),s(F,[2,54]),s(F,[2,55]),s(F,[2,56]),s(F,[2,57]),s(F,[2,58]),s(i,[2,32]),s(i,[2,33]),s(i,[2,34]),s(i,[2,35]),{16:44,40:O,41:N},{16:47,40:O,41:N},{16:48,40:O,41:N},s(i,[2,4]),{11:49,40:T,48:D,50:I,51:S,52:x},{16:50,40:O,41:N},{18:51,19:[1,52],53:53,54:54,58:Y},{11:56,40:T,48:D,50:I,51:S,52:x},{65:57,71:[1,58],72:[1,59]},s(P,[2,73]),s(P,[2,74]),s(P,[2,75]),s(P,[2,76]),s(P,[2,77]),s(i,[2,24]),s(i,[2,25]),s(i,[2,26]),{13:z,38:60,41:G,42:A,45:62,46:63,48:K,49:U},s(q,[2,37]),s(q,[2,38]),{16:68,40:O,41:N,42:A},{13:z,38:69,41:G,42:A,45:62,46:63,48:K,49:U},{13:[1,70],15:[1,71]},s(i,[2,17],{64:35,12:72,17:[1,73],42:A,66:at,67:ct,68:ot,69:lt,70:ht}),{19:[1,74]},s(i,[2,14]),{18:75,19:[2,59],53:53,54:54,58:Y},{55:76,58:[1,77]},{58:[2,65],59:[1,78]},{21:[1,79]},{64:80,66:at,67:ct,68:ot,69:lt,70:ht},s(bt,[2,78]),s(bt,[2,79]),{6:kt,10:mt,39:81,42:Et,47:Tt},{40:[1,86],41:[1,87]},s(St,[2,43],{46:88,13:z,41:G,48:K,49:U}),s(L,[2,45]),s(L,[2,50]),s(L,[2,51]),s(L,[2,52]),s(L,[2,53]),s(i,[2,41],{42:A}),{6:kt,10:mt,39:89,42:Et,47:Tt},{14:90,40:H,50:J,73:$},{16:94,40:O,41:N},{11:95,40:T,48:D,50:I,51:S,52:x},{18:96,19:[1,97],53:53,54:54,58:Y},s(i,[2,12]),{19:[2,60]},s(Z,[2,61],{56:98,57:99,60:100,62:Ot,63:Nt}),s([19,58,62,63],[2,67]),{58:[2,66]},s(i,[2,22],{15:[1,104],17:[1,103]}),s([40,48,50,51,52],[2,72]),s(i,[2,36]),{13:z,41:G,45:105,46:63,48:K,49:U},s(i,[2,47]),s(i,[2,48]),s(i,[2,49]),s(q,[2,39]),s(q,[2,40]),s(L,[2,46]),s(i,[2,42]),s(i,[2,8]),s(i,[2,80]),s(i,[2,81]),s(i,[2,82]),{13:[1,106],42:A},{13:[1,108],15:[1,107]},{19:[1,109]},s(i,[2,15]),s(Z,[2,62],{57:110,61:[1,111],63:Nt}),s(Z,[2,63]),s(ut,[2,68]),s(Z,[2,71]),s(ut,[2,70]),{18:112,19:[1,113],53:53,54:54,58:Y},{16:114,40:O,41:N},s(St,[2,44],{46:88,13:z,41:G,48:K,49:U}),{14:115,40:H,50:J,73:$},{16:116,40:O,41:N},{14:117,40:H,50:J,73:$},s(i,[2,13]),s(Z,[2,64]),{60:118,62:Ot},{19:[1,119]},s(i,[2,20]),s(i,[2,23],{17:[1,120],42:A}),s(i,[2,11]),{13:[1,121],42:A},s(i,[2,10]),s(ut,[2,69]),s(i,[2,18]),{18:122,19:[1,123],53:53,54:54,58:Y},{14:124,40:H,50:J,73:$},{19:[1,125]},s(i,[2,21]),s(i,[2,9]),s(i,[2,19])],defaultActions:{75:[2,60],78:[2,66]},parseError:p(function(n,a){if(a.recoverable)this.trace(n);else{var l=new Error(n);throw l.hash=a,l}},"parseError"),parse:p(function(n){var a=this,l=[0],r=[],f=[null],t=[],j=this.table,e="",et=0,At=0,Lt=2,Rt=1,wt=t.slice.call(arguments,1),_=Object.create(this.lexer),C={yy:{}};for(var pt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,pt)&&(C.yy[pt]=this.yy[pt]);_.setInput(n,C.yy),C.yy.lexer=_,C.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var ft=_.yylloc;t.push(ft);var Vt=_.options&&_.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Mt(b){l.length=l.length-2*b,f.length=f.length-b,t.length=t.length-b}p(Mt,"popStack");function It(){var b;return b=r.pop()||_.lex()||Rt,typeof b!="number"&&(b instanceof Array&&(r=b,b=r.pop()),b=a.symbols_[b]||b),b}p(It,"lex");for(var g,v,k,yt,w={},st,E,xt,it;;){if(v=l[l.length-1],this.defaultActions[v]?k=this.defaultActions[v]:((g===null||typeof g>"u")&&(g=It()),k=j[v]&&j[v][g]),typeof k>"u"||!k.length||!k[0]){var _t="";it=[];for(st in j[v])this.terminals_[st]&&st>Lt&&it.push("'"+this.terminals_[st]+"'");_.showPosition?_t="Parse error on line "+(et+1)+`: `+_.showPosition()+` Expecting `+it.join(", ")+", got '"+(this.terminals_[g]||g)+"'":_t="Parse error on line "+(et+1)+": Unexpected "+(g==Rt?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(_t,{text:_.match,token:this.terminals_[g]||g,line:_.yylineno,loc:ft,expected:it})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+g);switch(k[0]){case 1:l.push(g),f.push(_.yytext),t.push(_.yylloc),l.push(k[1]),g=null,At=_.yyleng,e=_.yytext,et=_.yylineno,ft=_.yylloc;break;case 2:if(E=this.productions_[k[1]][1],w.$=f[f.length-E],w._$={first_line:t[t.length-(E||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(E||1)].first_column,last_column:t[t.length-1].last_column},Vt&&(w._$.range=[t[t.length-(E||1)].range[0],t[t.length-1].range[1]]),yt=this.performAction.apply(w,[e,At,et,C.yy,k[1],f,t].concat(wt)),typeof yt<"u")return yt;E&&(l=l.slice(0,-1*E*2),f=f.slice(0,-1*E),t=t.slice(0,-1*E)),l.push(this.productions_[k[1]][0]),f.push(w.$),t.push(w._$),xt=j[l[l.length-2]][l[l.length-1]],l.push(xt);break;case 3:return!0}}return!0},"parse")},Dt=function(){var R={EOF:1,parseError:p(function(a,l){if(this.yy.parser)this.yy.parser.parseError(a,l);else throw new Error(a)},"parseError"),setInput:p(function(n,a){return this.yy=a||this.yy||{},this._input=n,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:p(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var a=n.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},"input"),unput:p(function(n){var a=n.length,l=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var f=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===r.length?this.yylloc.first_column:0)+r[r.length-l.length].length-l[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:p(function(){return this._more=!0,this},"more"),reject:p(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:p(function(n){this.unput(this.match.slice(n))},"less"),pastInput:p(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:p(function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:p(function(){var n=this.pastInput(),a=new Array(n.length+1).join("-");return n+this.upcomingInput()+` diff --git a/veadk/webui/assets/visualizations/mermaid/flowDiagram-UKHOOZJN-BtIca__0.js b/veadk/webui/assets/visualizations/mermaid/flowDiagram-UKHOOZJN-DjW8-Nxh.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/flowDiagram-UKHOOZJN-BtIca__0.js rename to veadk/webui/assets/visualizations/mermaid/flowDiagram-UKHOOZJN-DjW8-Nxh.js index 623c2c526..f65da1fea 100644 --- a/veadk/webui/assets/visualizations/mermaid/flowDiagram-UKHOOZJN-BtIca__0.js +++ b/veadk/webui/assets/visualizations/mermaid/flowDiagram-UKHOOZJN-DjW8-Nxh.js @@ -1,4 +1,4 @@ -import{g as Xt}from"./chunk-5VM5RSS4-BDBKcK2Z.js";import{g as Qt}from"./chunk-XXDRQBXY-B8qTF1qQ.js";import{s as Jt}from"./chunk-KBJHAD2P-DtNDDRN1.js";import{a as m,aa as Zt,aS as Mt,at as J,Y as g1,a4 as $t,aK as te,b9 as rt,aR as ee,aQ as se,aT as ie,W as re,V as ae,$ as ne,x as ue,as as le,J as oe,ao as ce,a0 as st,s as he,N as de,aM as pe}from"./mermaid.core-y4TF8bTw.js";import{c as fe}from"./chunk-2GRJ4B5K-CvII-2ZL.js";import{aG as it}from"../../app/index-BNPwMQXG.js";import ge from"../../chunks/purify.es-BnINGy_Y.js";import{c as be}from"../../chunks/channel-Bbp-1bKw.js";var Ae="flowchart-",G1,ke=(G1=class{constructor(){this.vertexCounter=0,this.config=g1(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=ee,this.setAccDescription=se,this.setDiagramTitle=ie,this.getAccTitle=re,this.getAccDescription=ae,this.getDiagramTitle=ne,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(i){return ue.sanitizeText(i,this.config)}sanitizeNodeLabelType(i){switch(i){case"markdown":case"string":case"text":return i;default:return"markdown"}}setDiagramId(i){this.diagramId=i}lookUpDomId(i){for(const a of this.vertices.values())if(a.id===i)return this.diagramId?`${this.diagramId}-${a.domId}`:a.domId;return this.diagramId?`${this.diagramId}-${i}`:i}addVertex(i,a,n,u,o,h,c={},g){var L,y;if(!i||i.trim().length===0)return;let r;if(g!==void 0){let f;g.includes(` +import{g as Xt}from"./chunk-5VM5RSS4-BKHSrXIw.js";import{g as Qt}from"./chunk-XXDRQBXY-BdI3VXTi.js";import{s as Jt}from"./chunk-KBJHAD2P-C0rklDe7.js";import{a as m,aa as Zt,aS as Mt,at as J,Y as g1,a4 as $t,aK as te,b9 as rt,aR as ee,aQ as se,aT as ie,W as re,V as ae,$ as ne,x as ue,as as le,J as oe,ao as ce,a0 as st,s as he,N as de,aM as pe}from"./mermaid.core-DAx4nvmm.js";import{c as fe}from"./chunk-2GRJ4B5K-BNT0kar4.js";import{aG as it}from"../../app/index-8JtvDNuA.js";import ge from"../../chunks/purify.es-BnINGy_Y.js";import{c as be}from"../../chunks/channel-B1gj3-V8.js";var Ae="flowchart-",G1,ke=(G1=class{constructor(){this.vertexCounter=0,this.config=g1(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=ee,this.setAccDescription=se,this.setDiagramTitle=ie,this.getAccTitle=re,this.getAccDescription=ae,this.getDiagramTitle=ne,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(i){return ue.sanitizeText(i,this.config)}sanitizeNodeLabelType(i){switch(i){case"markdown":case"string":case"text":return i;default:return"markdown"}}setDiagramId(i){this.diagramId=i}lookUpDomId(i){for(const a of this.vertices.values())if(a.id===i)return this.diagramId?`${this.diagramId}-${a.domId}`:a.domId;return this.diagramId?`${this.diagramId}-${i}`:i}addVertex(i,a,n,u,o,h,c={},g){var L,y;if(!i||i.trim().length===0)return;let r;if(g!==void 0){let f;g.includes(` `)?f=g+` `:f=`{ `+g+` diff --git a/veadk/webui/assets/visualizations/mermaid/ganttDiagram-PKOTCBZU-BsTpL-yb.js b/veadk/webui/assets/visualizations/mermaid/ganttDiagram-PKOTCBZU-DYJw_19U.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/ganttDiagram-PKOTCBZU-BsTpL-yb.js rename to veadk/webui/assets/visualizations/mermaid/ganttDiagram-PKOTCBZU-DYJw_19U.js index 1a9d4dd27..ae7566bd4 100644 --- a/veadk/webui/assets/visualizations/mermaid/ganttDiagram-PKOTCBZU-BsTpL-yb.js +++ b/veadk/webui/assets/visualizations/mermaid/ganttDiagram-PKOTCBZU-DYJw_19U.js @@ -1,4 +1,4 @@ -import{V as An,aQ as Wn,$ as On,aT as $n,W as Hn,aR as Nn,a as d,Y as Yt,B as Vn,L as it,at as Tt,x as Pn,aO as zn,s as Rn,b9 as Bn}from"./mermaid.core-y4TF8bTw.js";import{s as Ke,aF as Zn,a6 as tn,a8 as en,c as nn,ay as ae,ap as Xn,U as re,ad as ie,aG as Xt}from"../../app/index-BNPwMQXG.js";import{b as Gn,t as Oe,c as qn,a as jn,l as Qn}from"../../chunks/linear-Dd6OAXqp.js";import{i as Jn}from"../../chunks/init-Gi6I4Gst.js";import"../../chunks/purify.es-BnINGy_Y.js";import"../../chunks/defaultLocale-CrowFXzY.js";const Kn=Math.PI/180,tr=180/Math.PI,Jt=18,rn=.96422,sn=1,an=.82521,on=4/29,Ft=6/29,cn=3*Ft*Ft,er=Ft*Ft*Ft;function un(t){if(t instanceof ft)return new ft(t.l,t.a,t.b,t.opacity);if(t instanceof ht)return ln(t);t instanceof Ke||(t=Zn(t));var e=le(t.r),n=le(t.g),r=le(t.b),i=oe((.2225045*e+.7168786*n+.0606169*r)/sn),s,a;return e===n&&n===r?s=a=i:(s=oe((.4360747*e+.3850649*n+.1430804*r)/rn),a=oe((.0139322*e+.0971045*n+.7141733*r)/an)),new ft(116*i-16,500*(s-i),200*(i-a),t.opacity)}function nr(t,e,n,r){return arguments.length===1?un(t):new ft(t,e,n,r??1)}function ft(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}tn(ft,nr,en(nn,{brighter(t){return new ft(this.l+Jt*(t??1),this.a,this.b,this.opacity)},darker(t){return new ft(this.l-Jt*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=rn*ce(e),t=sn*ce(t),n=an*ce(n),new Ke(ue(3.1338561*e-1.6168667*t-.4906146*n),ue(-.9787684*e+1.9161415*t+.033454*n),ue(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function oe(t){return t>er?Math.pow(t,1/3):t/cn+on}function ce(t){return t>Ft?t*t*t:cn*(t-on)}function ue(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function le(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function rr(t){if(t instanceof ht)return new ht(t.h,t.c,t.l,t.opacity);if(t instanceof ft||(t=un(t)),t.a===0&&t.b===0)return new ht(NaN,0=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n=i)&&(n=i)}return n}function or(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function cr(t){return t}var qt=1,fe=2,ve=3,Gt=4,$e=1e-6;function ur(t){return"translate("+t+",0)"}function lr(t){return"translate(0,"+t+")"}function fr(t){return e=>+t(e)}function dr(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function hr(){return!this.__axis}function fn(t,e){var n=[],r=null,i=null,s=6,a=6,y=3,F=typeof window<"u"&&window.devicePixelRatio>1?0:.5,S=t===qt||t===Gt?-1:1,w=t===Gt||t===fe?"x":"y",V=t===qt||t===ve?ur:lr;function _(Y){var G=r??(e.ticks?e.ticks.apply(e,n):e.domain()),Z=i??(e.tickFormat?e.tickFormat.apply(e,n):cr),v=Math.max(s,0)+y,U=e.range(),z=+U[0]+F,E=+U[U.length-1]+F,R=(e.bandwidth?dr:fr)(e.copy(),F),q=Y.selection?Y.selection():Y,T=q.selectAll(".domain").data([null]),k=q.selectAll(".tick").data(G,e).order(),p=k.exit(),L=k.enter().append("g").attr("class","tick"),x=k.select("line"),C=k.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(L),x=x.merge(L.append("line").attr("stroke","currentColor").attr(w+"2",S*s)),C=C.merge(L.append("text").attr("fill","currentColor").attr(w,S*v).attr("dy",t===qt?"0em":t===ve?"0.71em":"0.32em")),Y!==q&&(T=T.transition(Y),k=k.transition(Y),x=x.transition(Y),C=C.transition(Y),p=p.transition(Y).attr("opacity",$e).attr("transform",function(M){return isFinite(M=R(M))?V(M+F):this.getAttribute("transform")}),L.attr("opacity",$e).attr("transform",function(M){var D=this.parentNode.__axis;return V((D&&isFinite(D=D(M))?D:R(M))+F)})),p.remove(),T.attr("d",t===Gt||t===fe?a?"M"+S*a+","+z+"H"+F+"V"+E+"H"+S*a:"M"+F+","+z+"V"+E:a?"M"+z+","+S*a+"V"+F+"H"+E+"V"+S*a:"M"+z+","+F+"H"+E),k.attr("opacity",1).attr("transform",function(M){return V(R(M)+F)}),x.attr(w+"2",S*s),C.attr(w,S*v).text(Z),q.filter(hr).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===fe?"start":t===Gt?"end":"middle"),q.each(function(){this.__axis=R})}return _.scale=function(Y){return arguments.length?(e=Y,_):e},_.ticks=function(){return n=Array.from(arguments),_},_.tickArguments=function(Y){return arguments.length?(n=Y==null?[]:Array.from(Y),_):n.slice()},_.tickValues=function(Y){return arguments.length?(r=Y==null?null:Array.from(Y),_):r&&r.slice()},_.tickFormat=function(Y){return arguments.length?(i=Y,_):i},_.tickSize=function(Y){return arguments.length?(s=a=+Y,_):s},_.tickSizeInner=function(Y){return arguments.length?(s=+Y,_):s},_.tickSizeOuter=function(Y){return arguments.length?(a=+Y,_):a},_.tickPadding=function(Y){return arguments.length?(y=+Y,_):y},_.offset=function(Y){return arguments.length?(F=+Y,_):F},_}function mr(t){return fn(qt,t)}function gr(t){return fn(ve,t)}function yr(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],s=t[r],a;return s(t(s=new Date(+s)),s),i.ceil=s=>(t(s=new Date(s-1)),e(s,1),t(s),s),i.round=s=>{const a=i(s),y=i.ceil(s);return s-a(e(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,y)=>{const F=[];if(s=i.ceil(s),y=y==null?1:Math.floor(y),!(s0))return F;let S;do F.push(S=new Date(+s)),e(s,y),t(s);while(Snt(a=>{if(a>=a)for(;t(a),!s(a);)a.setTime(a-1)},(a,y)=>{if(a>=a)if(y<0)for(;++y<=0;)for(;e(a,-1),!s(a););else for(;--y>=0;)for(;e(a,1),!s(a););}),n&&(i.count=(s,a)=>(de.setTime(+s),he.setTime(+a),t(de),t(he),Math.floor(n(de,he))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const Et=nt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Et.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?nt(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Et);Et.range;const mt=1e3,ct=mt*60,gt=ct*60,yt=gt*24,De=yt*7,He=yt*30,me=yt*365,vt=nt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*mt)},(t,e)=>(e-t)/mt,t=>t.getUTCSeconds());vt.range;const Nt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getMinutes());Nt.range;const kr=nt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getUTCMinutes());kr.range;const Vt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt-t.getMinutes()*ct)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getHours());Vt.range;const pr=nt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getUTCHours());pr.range;const xt=nt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ct)/yt,t=>t.getDate()-1);xt.range;const Me=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>t.getUTCDate()-1);Me.range;const vr=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>Math.floor(t/yt));vr.range;function Dt(t){return nt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*ct)/De)}const Rt=Dt(0),Pt=Dt(1),dn=Dt(2),hn=Dt(3),bt=Dt(4),mn=Dt(5),gn=Dt(6);Rt.range;Pt.range;dn.range;hn.range;bt.range;mn.range;gn.range;function Mt(t){return nt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/De)}const yn=Mt(0),Kt=Mt(1),Tr=Mt(2),xr=Mt(3),It=Mt(4),br=Mt(5),wr=Mt(6);yn.range;Kt.range;Tr.range;xr.range;It.range;br.range;wr.range;const zt=nt(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());zt.range;const Dr=nt(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());Dr.range;const kt=nt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());kt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});kt.range;const wt=nt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());wt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});wt.range;function Mr(t,e,n,r,i,s){const a=[[vt,1,mt],[vt,5,5*mt],[vt,15,15*mt],[vt,30,30*mt],[s,1,ct],[s,5,5*ct],[s,15,15*ct],[s,30,30*ct],[i,1,gt],[i,3,3*gt],[i,6,6*gt],[i,12,12*gt],[r,1,yt],[r,2,2*yt],[n,1,De],[e,1,He],[e,3,3*He],[t,1,me]];function y(S,w,V){const _=wv).right(a,_);if(Y===a.length)return t.every(Oe(S/me,w/me,V));if(Y===0)return Et.every(Math.max(Oe(S,w,V),1));const[G,Z]=a[_/a[Y-1][2]53)return null;"w"in f||(f.w=1),"Z"in f?(A=ye(Ot(f.y,0,1)),Q=A.getUTCDay(),A=Q>4||Q===0?Kt.ceil(A):Kt(A),A=Me.offset(A,(f.V-1)*7),f.y=A.getUTCFullYear(),f.m=A.getUTCMonth(),f.d=A.getUTCDate()+(f.w+6)%7):(A=ge(Ot(f.y,0,1)),Q=A.getDay(),A=Q>4||Q===0?Pt.ceil(A):Pt(A),A=xt.offset(A,(f.V-1)*7),f.y=A.getFullYear(),f.m=A.getMonth(),f.d=A.getDate()+(f.w+6)%7)}else("W"in f||"U"in f)&&("w"in f||(f.w="u"in f?f.u%7:"W"in f?1:0),Q="Z"in f?ye(Ot(f.y,0,1)).getUTCDay():ge(Ot(f.y,0,1)).getDay(),f.m=0,f.d="W"in f?(f.w+6)%7+f.W*7-(Q+5)%7:f.w+f.U*7-(Q+6)%7);return"Z"in f?(f.H+=f.Z/100|0,f.M+=f.Z%100,ye(f)):ge(f)}}function p(h,N,P,f){for(var tt=0,A=N.length,Q=P.length,X,st;tt=Q)return-1;if(X=N.charCodeAt(tt++),X===37){if(X=N.charAt(tt++),st=q[X in Ne?N.charAt(tt++):X],!st||(f=st(h,P,f))<0)return-1}else if(X!=P.charCodeAt(f++))return-1}return f}function L(h,N,P){var f=S.exec(N.slice(P));return f?(h.p=w.get(f[0].toLowerCase()),P+f[0].length):-1}function x(h,N,P){var f=Y.exec(N.slice(P));return f?(h.w=G.get(f[0].toLowerCase()),P+f[0].length):-1}function C(h,N,P){var f=V.exec(N.slice(P));return f?(h.w=_.get(f[0].toLowerCase()),P+f[0].length):-1}function M(h,N,P){var f=U.exec(N.slice(P));return f?(h.m=z.get(f[0].toLowerCase()),P+f[0].length):-1}function D(h,N,P){var f=Z.exec(N.slice(P));return f?(h.m=v.get(f[0].toLowerCase()),P+f[0].length):-1}function c(h,N,P){return p(h,e,N,P)}function g(h,N,P){return p(h,n,N,P)}function b(h,N,P){return p(h,r,N,P)}function m(h){return a[h.getDay()]}function I(h){return s[h.getDay()]}function o(h){return F[h.getMonth()]}function W(h){return y[h.getMonth()]}function u(h){return i[+(h.getHours()>=12)]}function K(h){return 1+~~(h.getMonth()/3)}function l(h){return a[h.getUTCDay()]}function O(h){return s[h.getUTCDay()]}function $(h){return F[h.getUTCMonth()]}function j(h){return y[h.getUTCMonth()]}function H(h){return i[+(h.getUTCHours()>=12)]}function J(h){return 1+~~(h.getUTCMonth()/3)}return{format:function(h){var N=T(h+="",E);return N.toString=function(){return h},N},parse:function(h){var N=k(h+="",!1);return N.toString=function(){return h},N},utcFormat:function(h){var N=T(h+="",R);return N.toString=function(){return h},N},utcParse:function(h){var N=k(h+="",!0);return N.toString=function(){return h},N}}}var Ne={"-":"",_:" ",0:"0"},rt=/^\s*\d+/,Yr=/^%/,Fr=/[\\^$*+?|[\]().{}]/g;function B(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",s=i.length;return r+(s[e.toLowerCase(),n]))}function Er(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Ir(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function Lr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Ar(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Wr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function Ve(t,e,n){var r=rt.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function Pe(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Or(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function $r(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function Hr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function ze(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Nr(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Re(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function Vr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function Pr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function zr(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Rr(t,e,n){var r=rt.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Br(t,e,n){var r=Yr.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Zr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function Xr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Be(t,e){return B(t.getDate(),e,2)}function Gr(t,e){return B(t.getHours(),e,2)}function qr(t,e){return B(t.getHours()%12||12,e,2)}function jr(t,e){return B(1+xt.count(kt(t),t),e,3)}function kn(t,e){return B(t.getMilliseconds(),e,3)}function Qr(t,e){return kn(t,e)+"000"}function Jr(t,e){return B(t.getMonth()+1,e,2)}function Kr(t,e){return B(t.getMinutes(),e,2)}function ti(t,e){return B(t.getSeconds(),e,2)}function ei(t){var e=t.getDay();return e===0?7:e}function ni(t,e){return B(Rt.count(kt(t)-1,t),e,2)}function pn(t){var e=t.getDay();return e>=4||e===0?bt(t):bt.ceil(t)}function ri(t,e){return t=pn(t),B(bt.count(kt(t),t)+(kt(t).getDay()===4),e,2)}function ii(t){return t.getDay()}function si(t,e){return B(Pt.count(kt(t)-1,t),e,2)}function ai(t,e){return B(t.getFullYear()%100,e,2)}function oi(t,e){return t=pn(t),B(t.getFullYear()%100,e,2)}function ci(t,e){return B(t.getFullYear()%1e4,e,4)}function ui(t,e){var n=t.getDay();return t=n>=4||n===0?bt(t):bt.ceil(t),B(t.getFullYear()%1e4,e,4)}function li(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+B(e/60|0,"0",2)+B(e%60,"0",2)}function Ze(t,e){return B(t.getUTCDate(),e,2)}function fi(t,e){return B(t.getUTCHours(),e,2)}function di(t,e){return B(t.getUTCHours()%12||12,e,2)}function hi(t,e){return B(1+Me.count(wt(t),t),e,3)}function vn(t,e){return B(t.getUTCMilliseconds(),e,3)}function mi(t,e){return vn(t,e)+"000"}function gi(t,e){return B(t.getUTCMonth()+1,e,2)}function yi(t,e){return B(t.getUTCMinutes(),e,2)}function ki(t,e){return B(t.getUTCSeconds(),e,2)}function pi(t){var e=t.getUTCDay();return e===0?7:e}function vi(t,e){return B(yn.count(wt(t)-1,t),e,2)}function Tn(t){var e=t.getUTCDay();return e>=4||e===0?It(t):It.ceil(t)}function Ti(t,e){return t=Tn(t),B(It.count(wt(t),t)+(wt(t).getUTCDay()===4),e,2)}function xi(t){return t.getUTCDay()}function bi(t,e){return B(Kt.count(wt(t)-1,t),e,2)}function wi(t,e){return B(t.getUTCFullYear()%100,e,2)}function Di(t,e){return t=Tn(t),B(t.getUTCFullYear()%100,e,2)}function Mi(t,e){return B(t.getUTCFullYear()%1e4,e,4)}function Ci(t,e){var n=t.getUTCDay();return t=n>=4||n===0?It(t):It.ceil(t),B(t.getUTCFullYear()%1e4,e,4)}function Si(){return"+0000"}function Xe(){return"%"}function Ge(t){return+t}function qe(t){return Math.floor(+t/1e3)}var St,te;_i({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function _i(t){return St=_r(t),te=St.format,St.parse,St.utcFormat,St.utcParse,St}function Yi(t){return new Date(t)}function Fi(t){return t instanceof Date?+t:+new Date(+t)}function xn(t,e,n,r,i,s,a,y,F,S){var w=qn(),V=w.invert,_=w.domain,Y=S(".%L"),G=S(":%S"),Z=S("%I:%M"),v=S("%I %p"),U=S("%a %d"),z=S("%b %d"),E=S("%B"),R=S("%Y");function q(T){return(F(T)4&&(Y+=7),_.add(Y,n));return G.diff(Z,"week")+1},y.isoWeekday=function(S){return this.$utils().u(S)?this.day()||7:this.day(this.day()%7?S:S-7)};var F=y.startOf;y.startOf=function(S,w){var V=this.$utils(),_=!!V.u(w)||w;return V.p(S)==="isoweek"?_?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):F.bind(this)(S,w)}}})})(bn);var Ei=bn.exports;const Ii=ie(Ei);var wn={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(re,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,s=/\d\d/,a=/\d\d?/,y=/\d*[^-_:/,()\s\d]+/,F={},S=function(v){return(v=+v)+(v>68?1900:2e3)},w=function(v){return function(U){this[v]=+U}},V=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=function(U){if(!U||U==="Z")return 0;var z=U.match(/([+-]|\d\d)/g),E=60*z[1]+(+z[2]||0);return E===0?0:z[0]==="+"?-E:E}(v)}],_=function(v){var U=F[v];return U&&(U.indexOf?U:U.s.concat(U.f))},Y=function(v,U){var z,E=F.meridiem;if(E){for(var R=1;R<=24;R+=1)if(v.indexOf(E(R,0,U))>-1){z=R>12;break}}else z=v===(U?"pm":"PM");return z},G={A:[y,function(v){this.afternoon=Y(v,!1)}],a:[y,function(v){this.afternoon=Y(v,!0)}],Q:[i,function(v){this.month=3*(v-1)+1}],S:[i,function(v){this.milliseconds=100*+v}],SS:[s,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[a,w("seconds")],ss:[a,w("seconds")],m:[a,w("minutes")],mm:[a,w("minutes")],H:[a,w("hours")],h:[a,w("hours")],HH:[a,w("hours")],hh:[a,w("hours")],D:[a,w("day")],DD:[s,w("day")],Do:[y,function(v){var U=F.ordinal,z=v.match(/\d+/);if(this.day=z[0],U)for(var E=1;E<=31;E+=1)U(E).replace(/\[|\]/g,"")===v&&(this.day=E)}],w:[a,w("week")],ww:[s,w("week")],M:[a,w("month")],MM:[s,w("month")],MMM:[y,function(v){var U=_("months"),z=(_("monthsShort")||U.map(function(E){return E.slice(0,3)})).indexOf(v)+1;if(z<1)throw new Error;this.month=z%12||z}],MMMM:[y,function(v){var U=_("months").indexOf(v)+1;if(U<1)throw new Error;this.month=U%12||U}],Y:[/[+-]?\d+/,w("year")],YY:[s,function(v){this.year=S(v)}],YYYY:[/\d{4}/,w("year")],Z:V,ZZ:V};function Z(v){var U,z;U=v,z=F&&F.formats;for(var E=(v=U.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(x,C,M){var D=M&&M.toUpperCase();return C||z[M]||n[M]||z[D].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(c,g,b){return g||b.slice(1)})})).match(r),R=E.length,q=0;q-1)return new Date((I==="X"?1e3:1)*m);var u=Z(I)(m),K=u.year,l=u.month,O=u.day,$=u.hours,j=u.minutes,H=u.seconds,J=u.milliseconds,h=u.zone,N=u.week,P=new Date,f=O||(K||l?1:P.getDate()),tt=K||P.getFullYear(),A=0;K&&!l||(A=l>0?l-1:P.getMonth());var Q,X=$||0,st=j||0,at=H||0,pt=J||0;return h?new Date(Date.UTC(tt,A,f,X,st,at,pt+60*h.offset*1e3)):o?new Date(Date.UTC(tt,A,f,X,st,at,pt)):(Q=new Date(tt,A,f,X,st,at,pt),N&&(Q=W(Q).week(N).toDate()),Q)}catch{return new Date("")}}(T,L,k,z),this.init(),D&&D!==!0&&(this.$L=this.locale(D).$L),M&&T!=this.format(L)&&(this.$d=new Date("")),F={}}else if(L instanceof Array)for(var c=L.length,g=1;g<=c;g+=1){p[1]=L[g-1];var b=z.apply(this,p);if(b.isValid()){this.$d=b.$d,this.$L=b.$L,this.init();break}g===c&&(this.$d=new Date(""))}else R.call(this,q)}}})})(wn);var Li=wn.exports;const Ai=ie(Li);var Dn={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(re,function(){return function(n,r){var i=r.prototype,s=i.format;i.format=function(a){var y=this,F=this.$locale();if(!this.isValid())return s.bind(this)(a);var S=this.$utils(),w=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(V){switch(V){case"Q":return Math.ceil((y.$M+1)/3);case"Do":return F.ordinal(y.$D);case"gggg":return y.weekYear();case"GGGG":return y.isoWeekYear();case"wo":return F.ordinal(y.week(),"W");case"w":case"ww":return S.s(y.week(),V==="w"?1:2,"0");case"W":case"WW":return S.s(y.isoWeek(),V==="W"?1:2,"0");case"k":case"kk":return S.s(String(y.$H===0?24:y.$H),V==="k"?1:2,"0");case"X":return Math.floor(y.$d.getTime()/1e3);case"x":return y.$d.getTime();case"z":return"["+y.offsetName()+"]";case"zzz":return"["+y.offsetName("long")+"]";default:return V}});return s.bind(this)(w)}}})})(Dn);var Wi=Dn.exports;const Oi=ie(Wi);var Mn={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(re,function(){var n,r,i=1e3,s=6e4,a=36e5,y=864e5,F=31536e6,S=2628e6,w=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,V=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,_={years:F,months:S,days:y,hours:a,minutes:s,seconds:i,milliseconds:1,weeks:6048e5},Y=function(T){return T instanceof R},G=function(T,k,p){return new R(T,p,k.$l)},Z=function(T){return r.p(T)+"s"},v=function(T){return T<0},U=function(T){return v(T)?Math.ceil(T):Math.floor(T)},z=function(T){return Math.abs(T)},E=function(T,k){return T?v(T)?{negative:!0,format:""+z(T)+k}:{negative:!1,format:""+T+k}:{negative:!1,format:""}},R=function(){function T(p,L,x){var C=this;if(this.$d={},this.$l=x,p===void 0&&(this.$ms=0,this.parseFromMilliseconds()),L)return G(p*_[Z(L)],this);if(typeof p=="number")return this.$ms=p,this.parseFromMilliseconds(),this;if(typeof p=="object")return Object.keys(p).forEach(function(c){C.$d[Z(c)]=p[c]}),this.calMilliseconds(),this;if(typeof p=="string"){var M=p.match(w);if(M){var D=M.slice(2).map(function(c){return c!=null?Number(c):0});return this.$d.years=D[0],this.$d.months=D[1],this.$d.weeks=D[2],this.$d.days=D[3],this.$d.hours=D[4],this.$d.minutes=D[5],this.$d.seconds=D[6],this.calMilliseconds(),this}}return this}var k=T.prototype;return k.calMilliseconds=function(){var p=this;this.$ms=Object.keys(this.$d).reduce(function(L,x){return L+(p.$d[x]||0)*_[x]},0)},k.parseFromMilliseconds=function(){var p=this.$ms;this.$d.years=U(p/F),p%=F,this.$d.months=U(p/S),p%=S,this.$d.days=U(p/y),p%=y,this.$d.hours=U(p/a),p%=a,this.$d.minutes=U(p/s),p%=s,this.$d.seconds=U(p/i),p%=i,this.$d.milliseconds=p},k.toISOString=function(){var p=E(this.$d.years,"Y"),L=E(this.$d.months,"M"),x=+this.$d.days||0;this.$d.weeks&&(x+=7*this.$d.weeks);var C=E(x,"D"),M=E(this.$d.hours,"H"),D=E(this.$d.minutes,"M"),c=this.$d.seconds||0;this.$d.milliseconds&&(c+=this.$d.milliseconds/1e3,c=Math.round(1e3*c)/1e3);var g=E(c,"S"),b=p.negative||L.negative||C.negative||M.negative||D.negative||g.negative,m=M.format||D.format||g.format?"T":"",I=(b?"-":"")+"P"+p.format+L.format+C.format+m+M.format+D.format+g.format;return I==="P"||I==="-P"?"P0D":I},k.toJSON=function(){return this.toISOString()},k.format=function(p){var L=p||"YYYY-MM-DDTHH:mm:ss",x={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return L.replace(V,function(C,M){return M||String(x[C])})},k.as=function(p){return this.$ms/_[Z(p)]},k.get=function(p){var L=this.$ms,x=Z(p);return x==="milliseconds"?L%=1e3:L=x==="weeks"?U(L/_[x]):this.$d[x],L||0},k.add=function(p,L,x){var C;return C=L?p*_[Z(L)]:Y(p)?p.$ms:G(p,this).$ms,G(this.$ms+C*(x?-1:1),this)},k.subtract=function(p,L){return this.add(p,L,!0)},k.locale=function(p){var L=this.clone();return L.$l=p,L},k.clone=function(){return G(this.$ms,this)},k.humanize=function(p){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!p)},k.valueOf=function(){return this.asMilliseconds()},k.milliseconds=function(){return this.get("milliseconds")},k.asMilliseconds=function(){return this.as("milliseconds")},k.seconds=function(){return this.get("seconds")},k.asSeconds=function(){return this.as("seconds")},k.minutes=function(){return this.get("minutes")},k.asMinutes=function(){return this.as("minutes")},k.hours=function(){return this.get("hours")},k.asHours=function(){return this.as("hours")},k.days=function(){return this.get("days")},k.asDays=function(){return this.as("days")},k.weeks=function(){return this.get("weeks")},k.asWeeks=function(){return this.as("weeks")},k.months=function(){return this.get("months")},k.asMonths=function(){return this.as("months")},k.years=function(){return this.get("years")},k.asYears=function(){return this.as("years")},T}(),q=function(T,k,p){return T.add(k.years()*p,"y").add(k.months()*p,"M").add(k.days()*p,"d").add(k.hours()*p,"h").add(k.minutes()*p,"m").add(k.seconds()*p,"s").add(k.milliseconds()*p,"ms")};return function(T,k,p){n=p,r=p().$utils(),p.duration=function(C,M){var D=p.locale();return G(C,{$l:D},M)},p.isDuration=Y;var L=k.prototype.add,x=k.prototype.subtract;k.prototype.add=function(C,M){return Y(C)?q(this,C,1):L.bind(this)(C,M)},k.prototype.subtract=function(C,M){return Y(C)?q(this,C,-1):x.bind(this)(C,M)}}})})(Mn);var $i=Mn.exports;const Hi=ie($i);var Te=function(){var t=d(function(D,c,g,b){for(g=g||{},b=D.length;b--;g[D[b]]=c);return g},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],r=[1,27],i=[1,28],s=[1,29],a=[1,30],y=[1,31],F=[1,32],S=[1,33],w=[1,34],V=[1,9],_=[1,10],Y=[1,11],G=[1,12],Z=[1,13],v=[1,14],U=[1,15],z=[1,16],E=[1,19],R=[1,20],q=[1,21],T=[1,22],k=[1,23],p=[1,25],L=[1,35],x={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:d(function(c,g,b,m,I,o,W){var u=o.length-1;switch(I){case 1:return o[u-1];case 2:this.$=[];break;case 3:o[u-1].push(o[u]),this.$=o[u-1];break;case 4:case 5:this.$=o[u];break;case 6:case 7:this.$=[];break;case 8:m.setWeekday("monday");break;case 9:m.setWeekday("tuesday");break;case 10:m.setWeekday("wednesday");break;case 11:m.setWeekday("thursday");break;case 12:m.setWeekday("friday");break;case 13:m.setWeekday("saturday");break;case 14:m.setWeekday("sunday");break;case 15:m.setWeekend("friday");break;case 16:m.setWeekend("saturday");break;case 17:m.setDateFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 18:m.enableInclusiveEndDates(),this.$=o[u].substr(18);break;case 19:m.TopAxis(),this.$=o[u].substr(8);break;case 20:m.setAxisFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 21:m.setTickInterval(o[u].substr(13)),this.$=o[u].substr(13);break;case 22:m.setExcludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 23:m.setIncludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 24:m.setTodayMarker(o[u].substr(12)),this.$=o[u].substr(12);break;case 27:m.setDiagramTitle(o[u].substr(6)),this.$=o[u].substr(6);break;case 28:this.$=o[u].trim(),m.setAccTitle(this.$);break;case 29:case 30:this.$=o[u].trim(),m.setAccDescription(this.$);break;case 31:m.addSection(o[u].substr(8)),this.$=o[u].substr(8);break;case 33:m.addTask(o[u-1],o[u]),this.$="task";break;case 34:this.$=o[u-1],m.setClickEvent(o[u-1],o[u],null);break;case 35:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],o[u]);break;case 36:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],null),m.setLink(o[u-2],o[u]);break;case 37:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-2],o[u-1]),m.setLink(o[u-3],o[u]);break;case 38:this.$=o[u-2],m.setClickEvent(o[u-2],o[u],null),m.setLink(o[u-2],o[u-1]);break;case 39:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-1],o[u]),m.setLink(o[u-3],o[u-2]);break;case 40:this.$=o[u-1],m.setLink(o[u-1],o[u]);break;case 41:case 47:this.$=o[u-1]+" "+o[u];break;case 42:case 43:case 45:this.$=o[u-2]+" "+o[u-1]+" "+o[u];break;case 44:case 46:this.$=o[u-3]+" "+o[u-2]+" "+o[u-1]+" "+o[u];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:V,23:_,24:Y,25:G,26:Z,27:v,28:U,29:z,30:E,31:R,33:q,35:T,36:k,37:24,38:p,40:L},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:V,23:_,24:Y,25:G,26:Z,27:v,28:U,29:z,30:E,31:R,33:q,35:T,36:k,37:24,38:p,40:L},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:d(function(c,g){if(g.recoverable)this.trace(c);else{var b=new Error(c);throw b.hash=g,b}},"parseError"),parse:d(function(c){var g=this,b=[0],m=[],I=[null],o=[],W=this.table,u="",K=0,l=0,O=2,$=1,j=o.slice.call(arguments,1),H=Object.create(this.lexer),J={yy:{}};for(var h in this.yy)Object.prototype.hasOwnProperty.call(this.yy,h)&&(J.yy[h]=this.yy[h]);H.setInput(c,J.yy),J.yy.lexer=H,J.yy.parser=this,typeof H.yylloc>"u"&&(H.yylloc={});var N=H.yylloc;o.push(N);var P=H.options&&H.options.ranges;typeof J.yy.parseError=="function"?this.parseError=J.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function f(ot){b.length=b.length-2*ot,I.length=I.length-ot,o.length=o.length-ot}d(f,"popStack");function tt(){var ot;return ot=m.pop()||H.lex()||$,typeof ot!="number"&&(ot instanceof Array&&(m=ot,ot=m.pop()),ot=g.symbols_[ot]||ot),ot}d(tt,"lex");for(var A,Q,X,st,at={},pt,ut,We,Zt;;){if(Q=b[b.length-1],this.defaultActions[Q]?X=this.defaultActions[Q]:((A===null||typeof A>"u")&&(A=tt()),X=W[Q]&&W[Q][A]),typeof X>"u"||!X.length||!X[0]){var se="";Zt=[];for(pt in W[Q])this.terminals_[pt]&&pt>O&&Zt.push("'"+this.terminals_[pt]+"'");H.showPosition?se="Parse error on line "+(K+1)+`: +import{V as An,aQ as Wn,$ as On,aT as $n,W as Hn,aR as Nn,a as d,Y as Yt,B as Vn,L as it,at as Tt,x as Pn,aO as zn,s as Rn,b9 as Bn}from"./mermaid.core-DAx4nvmm.js";import{s as Ke,aF as Zn,a6 as tn,a8 as en,c as nn,ay as ae,ap as Xn,U as re,ad as ie,aG as Xt}from"../../app/index-8JtvDNuA.js";import{b as Gn,t as Oe,c as qn,a as jn,l as Qn}from"../../chunks/linear-WTltCzEJ.js";import{i as Jn}from"../../chunks/init-Gi6I4Gst.js";import"../../chunks/purify.es-BnINGy_Y.js";import"../../chunks/defaultLocale-CrowFXzY.js";const Kn=Math.PI/180,tr=180/Math.PI,Jt=18,rn=.96422,sn=1,an=.82521,on=4/29,Ft=6/29,cn=3*Ft*Ft,er=Ft*Ft*Ft;function un(t){if(t instanceof ft)return new ft(t.l,t.a,t.b,t.opacity);if(t instanceof ht)return ln(t);t instanceof Ke||(t=Zn(t));var e=le(t.r),n=le(t.g),r=le(t.b),i=oe((.2225045*e+.7168786*n+.0606169*r)/sn),s,a;return e===n&&n===r?s=a=i:(s=oe((.4360747*e+.3850649*n+.1430804*r)/rn),a=oe((.0139322*e+.0971045*n+.7141733*r)/an)),new ft(116*i-16,500*(s-i),200*(i-a),t.opacity)}function nr(t,e,n,r){return arguments.length===1?un(t):new ft(t,e,n,r??1)}function ft(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}tn(ft,nr,en(nn,{brighter(t){return new ft(this.l+Jt*(t??1),this.a,this.b,this.opacity)},darker(t){return new ft(this.l-Jt*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=rn*ce(e),t=sn*ce(t),n=an*ce(n),new Ke(ue(3.1338561*e-1.6168667*t-.4906146*n),ue(-.9787684*e+1.9161415*t+.033454*n),ue(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function oe(t){return t>er?Math.pow(t,1/3):t/cn+on}function ce(t){return t>Ft?t*t*t:cn*(t-on)}function ue(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function le(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function rr(t){if(t instanceof ht)return new ht(t.h,t.c,t.l,t.opacity);if(t instanceof ft||(t=un(t)),t.a===0&&t.b===0)return new ht(NaN,0=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n=i)&&(n=i)}return n}function or(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function cr(t){return t}var qt=1,fe=2,ve=3,Gt=4,$e=1e-6;function ur(t){return"translate("+t+",0)"}function lr(t){return"translate(0,"+t+")"}function fr(t){return e=>+t(e)}function dr(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function hr(){return!this.__axis}function fn(t,e){var n=[],r=null,i=null,s=6,a=6,y=3,F=typeof window<"u"&&window.devicePixelRatio>1?0:.5,S=t===qt||t===Gt?-1:1,w=t===Gt||t===fe?"x":"y",V=t===qt||t===ve?ur:lr;function _(Y){var G=r??(e.ticks?e.ticks.apply(e,n):e.domain()),Z=i??(e.tickFormat?e.tickFormat.apply(e,n):cr),v=Math.max(s,0)+y,U=e.range(),z=+U[0]+F,E=+U[U.length-1]+F,R=(e.bandwidth?dr:fr)(e.copy(),F),q=Y.selection?Y.selection():Y,T=q.selectAll(".domain").data([null]),k=q.selectAll(".tick").data(G,e).order(),p=k.exit(),L=k.enter().append("g").attr("class","tick"),x=k.select("line"),C=k.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(L),x=x.merge(L.append("line").attr("stroke","currentColor").attr(w+"2",S*s)),C=C.merge(L.append("text").attr("fill","currentColor").attr(w,S*v).attr("dy",t===qt?"0em":t===ve?"0.71em":"0.32em")),Y!==q&&(T=T.transition(Y),k=k.transition(Y),x=x.transition(Y),C=C.transition(Y),p=p.transition(Y).attr("opacity",$e).attr("transform",function(M){return isFinite(M=R(M))?V(M+F):this.getAttribute("transform")}),L.attr("opacity",$e).attr("transform",function(M){var D=this.parentNode.__axis;return V((D&&isFinite(D=D(M))?D:R(M))+F)})),p.remove(),T.attr("d",t===Gt||t===fe?a?"M"+S*a+","+z+"H"+F+"V"+E+"H"+S*a:"M"+F+","+z+"V"+E:a?"M"+z+","+S*a+"V"+F+"H"+E+"V"+S*a:"M"+z+","+F+"H"+E),k.attr("opacity",1).attr("transform",function(M){return V(R(M)+F)}),x.attr(w+"2",S*s),C.attr(w,S*v).text(Z),q.filter(hr).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===fe?"start":t===Gt?"end":"middle"),q.each(function(){this.__axis=R})}return _.scale=function(Y){return arguments.length?(e=Y,_):e},_.ticks=function(){return n=Array.from(arguments),_},_.tickArguments=function(Y){return arguments.length?(n=Y==null?[]:Array.from(Y),_):n.slice()},_.tickValues=function(Y){return arguments.length?(r=Y==null?null:Array.from(Y),_):r&&r.slice()},_.tickFormat=function(Y){return arguments.length?(i=Y,_):i},_.tickSize=function(Y){return arguments.length?(s=a=+Y,_):s},_.tickSizeInner=function(Y){return arguments.length?(s=+Y,_):s},_.tickSizeOuter=function(Y){return arguments.length?(a=+Y,_):a},_.tickPadding=function(Y){return arguments.length?(y=+Y,_):y},_.offset=function(Y){return arguments.length?(F=+Y,_):F},_}function mr(t){return fn(qt,t)}function gr(t){return fn(ve,t)}function yr(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],s=t[r],a;return s(t(s=new Date(+s)),s),i.ceil=s=>(t(s=new Date(s-1)),e(s,1),t(s),s),i.round=s=>{const a=i(s),y=i.ceil(s);return s-a(e(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,y)=>{const F=[];if(s=i.ceil(s),y=y==null?1:Math.floor(y),!(s0))return F;let S;do F.push(S=new Date(+s)),e(s,y),t(s);while(Snt(a=>{if(a>=a)for(;t(a),!s(a);)a.setTime(a-1)},(a,y)=>{if(a>=a)if(y<0)for(;++y<=0;)for(;e(a,-1),!s(a););else for(;--y>=0;)for(;e(a,1),!s(a););}),n&&(i.count=(s,a)=>(de.setTime(+s),he.setTime(+a),t(de),t(he),Math.floor(n(de,he))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const Et=nt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Et.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?nt(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Et);Et.range;const mt=1e3,ct=mt*60,gt=ct*60,yt=gt*24,De=yt*7,He=yt*30,me=yt*365,vt=nt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*mt)},(t,e)=>(e-t)/mt,t=>t.getUTCSeconds());vt.range;const Nt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getMinutes());Nt.range;const kr=nt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getUTCMinutes());kr.range;const Vt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt-t.getMinutes()*ct)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getHours());Vt.range;const pr=nt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getUTCHours());pr.range;const xt=nt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ct)/yt,t=>t.getDate()-1);xt.range;const Me=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>t.getUTCDate()-1);Me.range;const vr=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>Math.floor(t/yt));vr.range;function Dt(t){return nt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*ct)/De)}const Rt=Dt(0),Pt=Dt(1),dn=Dt(2),hn=Dt(3),bt=Dt(4),mn=Dt(5),gn=Dt(6);Rt.range;Pt.range;dn.range;hn.range;bt.range;mn.range;gn.range;function Mt(t){return nt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/De)}const yn=Mt(0),Kt=Mt(1),Tr=Mt(2),xr=Mt(3),It=Mt(4),br=Mt(5),wr=Mt(6);yn.range;Kt.range;Tr.range;xr.range;It.range;br.range;wr.range;const zt=nt(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());zt.range;const Dr=nt(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());Dr.range;const kt=nt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());kt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});kt.range;const wt=nt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());wt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});wt.range;function Mr(t,e,n,r,i,s){const a=[[vt,1,mt],[vt,5,5*mt],[vt,15,15*mt],[vt,30,30*mt],[s,1,ct],[s,5,5*ct],[s,15,15*ct],[s,30,30*ct],[i,1,gt],[i,3,3*gt],[i,6,6*gt],[i,12,12*gt],[r,1,yt],[r,2,2*yt],[n,1,De],[e,1,He],[e,3,3*He],[t,1,me]];function y(S,w,V){const _=wv).right(a,_);if(Y===a.length)return t.every(Oe(S/me,w/me,V));if(Y===0)return Et.every(Math.max(Oe(S,w,V),1));const[G,Z]=a[_/a[Y-1][2]53)return null;"w"in f||(f.w=1),"Z"in f?(A=ye(Ot(f.y,0,1)),Q=A.getUTCDay(),A=Q>4||Q===0?Kt.ceil(A):Kt(A),A=Me.offset(A,(f.V-1)*7),f.y=A.getUTCFullYear(),f.m=A.getUTCMonth(),f.d=A.getUTCDate()+(f.w+6)%7):(A=ge(Ot(f.y,0,1)),Q=A.getDay(),A=Q>4||Q===0?Pt.ceil(A):Pt(A),A=xt.offset(A,(f.V-1)*7),f.y=A.getFullYear(),f.m=A.getMonth(),f.d=A.getDate()+(f.w+6)%7)}else("W"in f||"U"in f)&&("w"in f||(f.w="u"in f?f.u%7:"W"in f?1:0),Q="Z"in f?ye(Ot(f.y,0,1)).getUTCDay():ge(Ot(f.y,0,1)).getDay(),f.m=0,f.d="W"in f?(f.w+6)%7+f.W*7-(Q+5)%7:f.w+f.U*7-(Q+6)%7);return"Z"in f?(f.H+=f.Z/100|0,f.M+=f.Z%100,ye(f)):ge(f)}}function p(h,N,P,f){for(var tt=0,A=N.length,Q=P.length,X,st;tt=Q)return-1;if(X=N.charCodeAt(tt++),X===37){if(X=N.charAt(tt++),st=q[X in Ne?N.charAt(tt++):X],!st||(f=st(h,P,f))<0)return-1}else if(X!=P.charCodeAt(f++))return-1}return f}function L(h,N,P){var f=S.exec(N.slice(P));return f?(h.p=w.get(f[0].toLowerCase()),P+f[0].length):-1}function x(h,N,P){var f=Y.exec(N.slice(P));return f?(h.w=G.get(f[0].toLowerCase()),P+f[0].length):-1}function C(h,N,P){var f=V.exec(N.slice(P));return f?(h.w=_.get(f[0].toLowerCase()),P+f[0].length):-1}function M(h,N,P){var f=U.exec(N.slice(P));return f?(h.m=z.get(f[0].toLowerCase()),P+f[0].length):-1}function D(h,N,P){var f=Z.exec(N.slice(P));return f?(h.m=v.get(f[0].toLowerCase()),P+f[0].length):-1}function c(h,N,P){return p(h,e,N,P)}function g(h,N,P){return p(h,n,N,P)}function b(h,N,P){return p(h,r,N,P)}function m(h){return a[h.getDay()]}function I(h){return s[h.getDay()]}function o(h){return F[h.getMonth()]}function W(h){return y[h.getMonth()]}function u(h){return i[+(h.getHours()>=12)]}function K(h){return 1+~~(h.getMonth()/3)}function l(h){return a[h.getUTCDay()]}function O(h){return s[h.getUTCDay()]}function $(h){return F[h.getUTCMonth()]}function j(h){return y[h.getUTCMonth()]}function H(h){return i[+(h.getUTCHours()>=12)]}function J(h){return 1+~~(h.getUTCMonth()/3)}return{format:function(h){var N=T(h+="",E);return N.toString=function(){return h},N},parse:function(h){var N=k(h+="",!1);return N.toString=function(){return h},N},utcFormat:function(h){var N=T(h+="",R);return N.toString=function(){return h},N},utcParse:function(h){var N=k(h+="",!0);return N.toString=function(){return h},N}}}var Ne={"-":"",_:" ",0:"0"},rt=/^\s*\d+/,Yr=/^%/,Fr=/[\\^$*+?|[\]().{}]/g;function B(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",s=i.length;return r+(s[e.toLowerCase(),n]))}function Er(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Ir(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function Lr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Ar(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Wr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function Ve(t,e,n){var r=rt.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function Pe(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Or(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function $r(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function Hr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function ze(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Nr(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Re(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function Vr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function Pr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function zr(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Rr(t,e,n){var r=rt.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Br(t,e,n){var r=Yr.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Zr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function Xr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Be(t,e){return B(t.getDate(),e,2)}function Gr(t,e){return B(t.getHours(),e,2)}function qr(t,e){return B(t.getHours()%12||12,e,2)}function jr(t,e){return B(1+xt.count(kt(t),t),e,3)}function kn(t,e){return B(t.getMilliseconds(),e,3)}function Qr(t,e){return kn(t,e)+"000"}function Jr(t,e){return B(t.getMonth()+1,e,2)}function Kr(t,e){return B(t.getMinutes(),e,2)}function ti(t,e){return B(t.getSeconds(),e,2)}function ei(t){var e=t.getDay();return e===0?7:e}function ni(t,e){return B(Rt.count(kt(t)-1,t),e,2)}function pn(t){var e=t.getDay();return e>=4||e===0?bt(t):bt.ceil(t)}function ri(t,e){return t=pn(t),B(bt.count(kt(t),t)+(kt(t).getDay()===4),e,2)}function ii(t){return t.getDay()}function si(t,e){return B(Pt.count(kt(t)-1,t),e,2)}function ai(t,e){return B(t.getFullYear()%100,e,2)}function oi(t,e){return t=pn(t),B(t.getFullYear()%100,e,2)}function ci(t,e){return B(t.getFullYear()%1e4,e,4)}function ui(t,e){var n=t.getDay();return t=n>=4||n===0?bt(t):bt.ceil(t),B(t.getFullYear()%1e4,e,4)}function li(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+B(e/60|0,"0",2)+B(e%60,"0",2)}function Ze(t,e){return B(t.getUTCDate(),e,2)}function fi(t,e){return B(t.getUTCHours(),e,2)}function di(t,e){return B(t.getUTCHours()%12||12,e,2)}function hi(t,e){return B(1+Me.count(wt(t),t),e,3)}function vn(t,e){return B(t.getUTCMilliseconds(),e,3)}function mi(t,e){return vn(t,e)+"000"}function gi(t,e){return B(t.getUTCMonth()+1,e,2)}function yi(t,e){return B(t.getUTCMinutes(),e,2)}function ki(t,e){return B(t.getUTCSeconds(),e,2)}function pi(t){var e=t.getUTCDay();return e===0?7:e}function vi(t,e){return B(yn.count(wt(t)-1,t),e,2)}function Tn(t){var e=t.getUTCDay();return e>=4||e===0?It(t):It.ceil(t)}function Ti(t,e){return t=Tn(t),B(It.count(wt(t),t)+(wt(t).getUTCDay()===4),e,2)}function xi(t){return t.getUTCDay()}function bi(t,e){return B(Kt.count(wt(t)-1,t),e,2)}function wi(t,e){return B(t.getUTCFullYear()%100,e,2)}function Di(t,e){return t=Tn(t),B(t.getUTCFullYear()%100,e,2)}function Mi(t,e){return B(t.getUTCFullYear()%1e4,e,4)}function Ci(t,e){var n=t.getUTCDay();return t=n>=4||n===0?It(t):It.ceil(t),B(t.getUTCFullYear()%1e4,e,4)}function Si(){return"+0000"}function Xe(){return"%"}function Ge(t){return+t}function qe(t){return Math.floor(+t/1e3)}var St,te;_i({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function _i(t){return St=_r(t),te=St.format,St.parse,St.utcFormat,St.utcParse,St}function Yi(t){return new Date(t)}function Fi(t){return t instanceof Date?+t:+new Date(+t)}function xn(t,e,n,r,i,s,a,y,F,S){var w=qn(),V=w.invert,_=w.domain,Y=S(".%L"),G=S(":%S"),Z=S("%I:%M"),v=S("%I %p"),U=S("%a %d"),z=S("%b %d"),E=S("%B"),R=S("%Y");function q(T){return(F(T)4&&(Y+=7),_.add(Y,n));return G.diff(Z,"week")+1},y.isoWeekday=function(S){return this.$utils().u(S)?this.day()||7:this.day(this.day()%7?S:S-7)};var F=y.startOf;y.startOf=function(S,w){var V=this.$utils(),_=!!V.u(w)||w;return V.p(S)==="isoweek"?_?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):F.bind(this)(S,w)}}})})(bn);var Ei=bn.exports;const Ii=ie(Ei);var wn={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(re,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,s=/\d\d/,a=/\d\d?/,y=/\d*[^-_:/,()\s\d]+/,F={},S=function(v){return(v=+v)+(v>68?1900:2e3)},w=function(v){return function(U){this[v]=+U}},V=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=function(U){if(!U||U==="Z")return 0;var z=U.match(/([+-]|\d\d)/g),E=60*z[1]+(+z[2]||0);return E===0?0:z[0]==="+"?-E:E}(v)}],_=function(v){var U=F[v];return U&&(U.indexOf?U:U.s.concat(U.f))},Y=function(v,U){var z,E=F.meridiem;if(E){for(var R=1;R<=24;R+=1)if(v.indexOf(E(R,0,U))>-1){z=R>12;break}}else z=v===(U?"pm":"PM");return z},G={A:[y,function(v){this.afternoon=Y(v,!1)}],a:[y,function(v){this.afternoon=Y(v,!0)}],Q:[i,function(v){this.month=3*(v-1)+1}],S:[i,function(v){this.milliseconds=100*+v}],SS:[s,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[a,w("seconds")],ss:[a,w("seconds")],m:[a,w("minutes")],mm:[a,w("minutes")],H:[a,w("hours")],h:[a,w("hours")],HH:[a,w("hours")],hh:[a,w("hours")],D:[a,w("day")],DD:[s,w("day")],Do:[y,function(v){var U=F.ordinal,z=v.match(/\d+/);if(this.day=z[0],U)for(var E=1;E<=31;E+=1)U(E).replace(/\[|\]/g,"")===v&&(this.day=E)}],w:[a,w("week")],ww:[s,w("week")],M:[a,w("month")],MM:[s,w("month")],MMM:[y,function(v){var U=_("months"),z=(_("monthsShort")||U.map(function(E){return E.slice(0,3)})).indexOf(v)+1;if(z<1)throw new Error;this.month=z%12||z}],MMMM:[y,function(v){var U=_("months").indexOf(v)+1;if(U<1)throw new Error;this.month=U%12||U}],Y:[/[+-]?\d+/,w("year")],YY:[s,function(v){this.year=S(v)}],YYYY:[/\d{4}/,w("year")],Z:V,ZZ:V};function Z(v){var U,z;U=v,z=F&&F.formats;for(var E=(v=U.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(x,C,M){var D=M&&M.toUpperCase();return C||z[M]||n[M]||z[D].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(c,g,b){return g||b.slice(1)})})).match(r),R=E.length,q=0;q-1)return new Date((I==="X"?1e3:1)*m);var u=Z(I)(m),K=u.year,l=u.month,O=u.day,$=u.hours,j=u.minutes,H=u.seconds,J=u.milliseconds,h=u.zone,N=u.week,P=new Date,f=O||(K||l?1:P.getDate()),tt=K||P.getFullYear(),A=0;K&&!l||(A=l>0?l-1:P.getMonth());var Q,X=$||0,st=j||0,at=H||0,pt=J||0;return h?new Date(Date.UTC(tt,A,f,X,st,at,pt+60*h.offset*1e3)):o?new Date(Date.UTC(tt,A,f,X,st,at,pt)):(Q=new Date(tt,A,f,X,st,at,pt),N&&(Q=W(Q).week(N).toDate()),Q)}catch{return new Date("")}}(T,L,k,z),this.init(),D&&D!==!0&&(this.$L=this.locale(D).$L),M&&T!=this.format(L)&&(this.$d=new Date("")),F={}}else if(L instanceof Array)for(var c=L.length,g=1;g<=c;g+=1){p[1]=L[g-1];var b=z.apply(this,p);if(b.isValid()){this.$d=b.$d,this.$L=b.$L,this.init();break}g===c&&(this.$d=new Date(""))}else R.call(this,q)}}})})(wn);var Li=wn.exports;const Ai=ie(Li);var Dn={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(re,function(){return function(n,r){var i=r.prototype,s=i.format;i.format=function(a){var y=this,F=this.$locale();if(!this.isValid())return s.bind(this)(a);var S=this.$utils(),w=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(V){switch(V){case"Q":return Math.ceil((y.$M+1)/3);case"Do":return F.ordinal(y.$D);case"gggg":return y.weekYear();case"GGGG":return y.isoWeekYear();case"wo":return F.ordinal(y.week(),"W");case"w":case"ww":return S.s(y.week(),V==="w"?1:2,"0");case"W":case"WW":return S.s(y.isoWeek(),V==="W"?1:2,"0");case"k":case"kk":return S.s(String(y.$H===0?24:y.$H),V==="k"?1:2,"0");case"X":return Math.floor(y.$d.getTime()/1e3);case"x":return y.$d.getTime();case"z":return"["+y.offsetName()+"]";case"zzz":return"["+y.offsetName("long")+"]";default:return V}});return s.bind(this)(w)}}})})(Dn);var Wi=Dn.exports;const Oi=ie(Wi);var Mn={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(re,function(){var n,r,i=1e3,s=6e4,a=36e5,y=864e5,F=31536e6,S=2628e6,w=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,V=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,_={years:F,months:S,days:y,hours:a,minutes:s,seconds:i,milliseconds:1,weeks:6048e5},Y=function(T){return T instanceof R},G=function(T,k,p){return new R(T,p,k.$l)},Z=function(T){return r.p(T)+"s"},v=function(T){return T<0},U=function(T){return v(T)?Math.ceil(T):Math.floor(T)},z=function(T){return Math.abs(T)},E=function(T,k){return T?v(T)?{negative:!0,format:""+z(T)+k}:{negative:!1,format:""+T+k}:{negative:!1,format:""}},R=function(){function T(p,L,x){var C=this;if(this.$d={},this.$l=x,p===void 0&&(this.$ms=0,this.parseFromMilliseconds()),L)return G(p*_[Z(L)],this);if(typeof p=="number")return this.$ms=p,this.parseFromMilliseconds(),this;if(typeof p=="object")return Object.keys(p).forEach(function(c){C.$d[Z(c)]=p[c]}),this.calMilliseconds(),this;if(typeof p=="string"){var M=p.match(w);if(M){var D=M.slice(2).map(function(c){return c!=null?Number(c):0});return this.$d.years=D[0],this.$d.months=D[1],this.$d.weeks=D[2],this.$d.days=D[3],this.$d.hours=D[4],this.$d.minutes=D[5],this.$d.seconds=D[6],this.calMilliseconds(),this}}return this}var k=T.prototype;return k.calMilliseconds=function(){var p=this;this.$ms=Object.keys(this.$d).reduce(function(L,x){return L+(p.$d[x]||0)*_[x]},0)},k.parseFromMilliseconds=function(){var p=this.$ms;this.$d.years=U(p/F),p%=F,this.$d.months=U(p/S),p%=S,this.$d.days=U(p/y),p%=y,this.$d.hours=U(p/a),p%=a,this.$d.minutes=U(p/s),p%=s,this.$d.seconds=U(p/i),p%=i,this.$d.milliseconds=p},k.toISOString=function(){var p=E(this.$d.years,"Y"),L=E(this.$d.months,"M"),x=+this.$d.days||0;this.$d.weeks&&(x+=7*this.$d.weeks);var C=E(x,"D"),M=E(this.$d.hours,"H"),D=E(this.$d.minutes,"M"),c=this.$d.seconds||0;this.$d.milliseconds&&(c+=this.$d.milliseconds/1e3,c=Math.round(1e3*c)/1e3);var g=E(c,"S"),b=p.negative||L.negative||C.negative||M.negative||D.negative||g.negative,m=M.format||D.format||g.format?"T":"",I=(b?"-":"")+"P"+p.format+L.format+C.format+m+M.format+D.format+g.format;return I==="P"||I==="-P"?"P0D":I},k.toJSON=function(){return this.toISOString()},k.format=function(p){var L=p||"YYYY-MM-DDTHH:mm:ss",x={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return L.replace(V,function(C,M){return M||String(x[C])})},k.as=function(p){return this.$ms/_[Z(p)]},k.get=function(p){var L=this.$ms,x=Z(p);return x==="milliseconds"?L%=1e3:L=x==="weeks"?U(L/_[x]):this.$d[x],L||0},k.add=function(p,L,x){var C;return C=L?p*_[Z(L)]:Y(p)?p.$ms:G(p,this).$ms,G(this.$ms+C*(x?-1:1),this)},k.subtract=function(p,L){return this.add(p,L,!0)},k.locale=function(p){var L=this.clone();return L.$l=p,L},k.clone=function(){return G(this.$ms,this)},k.humanize=function(p){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!p)},k.valueOf=function(){return this.asMilliseconds()},k.milliseconds=function(){return this.get("milliseconds")},k.asMilliseconds=function(){return this.as("milliseconds")},k.seconds=function(){return this.get("seconds")},k.asSeconds=function(){return this.as("seconds")},k.minutes=function(){return this.get("minutes")},k.asMinutes=function(){return this.as("minutes")},k.hours=function(){return this.get("hours")},k.asHours=function(){return this.as("hours")},k.days=function(){return this.get("days")},k.asDays=function(){return this.as("days")},k.weeks=function(){return this.get("weeks")},k.asWeeks=function(){return this.as("weeks")},k.months=function(){return this.get("months")},k.asMonths=function(){return this.as("months")},k.years=function(){return this.get("years")},k.asYears=function(){return this.as("years")},T}(),q=function(T,k,p){return T.add(k.years()*p,"y").add(k.months()*p,"M").add(k.days()*p,"d").add(k.hours()*p,"h").add(k.minutes()*p,"m").add(k.seconds()*p,"s").add(k.milliseconds()*p,"ms")};return function(T,k,p){n=p,r=p().$utils(),p.duration=function(C,M){var D=p.locale();return G(C,{$l:D},M)},p.isDuration=Y;var L=k.prototype.add,x=k.prototype.subtract;k.prototype.add=function(C,M){return Y(C)?q(this,C,1):L.bind(this)(C,M)},k.prototype.subtract=function(C,M){return Y(C)?q(this,C,-1):x.bind(this)(C,M)}}})})(Mn);var $i=Mn.exports;const Hi=ie($i);var Te=function(){var t=d(function(D,c,g,b){for(g=g||{},b=D.length;b--;g[D[b]]=c);return g},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],r=[1,27],i=[1,28],s=[1,29],a=[1,30],y=[1,31],F=[1,32],S=[1,33],w=[1,34],V=[1,9],_=[1,10],Y=[1,11],G=[1,12],Z=[1,13],v=[1,14],U=[1,15],z=[1,16],E=[1,19],R=[1,20],q=[1,21],T=[1,22],k=[1,23],p=[1,25],L=[1,35],x={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:d(function(c,g,b,m,I,o,W){var u=o.length-1;switch(I){case 1:return o[u-1];case 2:this.$=[];break;case 3:o[u-1].push(o[u]),this.$=o[u-1];break;case 4:case 5:this.$=o[u];break;case 6:case 7:this.$=[];break;case 8:m.setWeekday("monday");break;case 9:m.setWeekday("tuesday");break;case 10:m.setWeekday("wednesday");break;case 11:m.setWeekday("thursday");break;case 12:m.setWeekday("friday");break;case 13:m.setWeekday("saturday");break;case 14:m.setWeekday("sunday");break;case 15:m.setWeekend("friday");break;case 16:m.setWeekend("saturday");break;case 17:m.setDateFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 18:m.enableInclusiveEndDates(),this.$=o[u].substr(18);break;case 19:m.TopAxis(),this.$=o[u].substr(8);break;case 20:m.setAxisFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 21:m.setTickInterval(o[u].substr(13)),this.$=o[u].substr(13);break;case 22:m.setExcludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 23:m.setIncludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 24:m.setTodayMarker(o[u].substr(12)),this.$=o[u].substr(12);break;case 27:m.setDiagramTitle(o[u].substr(6)),this.$=o[u].substr(6);break;case 28:this.$=o[u].trim(),m.setAccTitle(this.$);break;case 29:case 30:this.$=o[u].trim(),m.setAccDescription(this.$);break;case 31:m.addSection(o[u].substr(8)),this.$=o[u].substr(8);break;case 33:m.addTask(o[u-1],o[u]),this.$="task";break;case 34:this.$=o[u-1],m.setClickEvent(o[u-1],o[u],null);break;case 35:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],o[u]);break;case 36:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],null),m.setLink(o[u-2],o[u]);break;case 37:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-2],o[u-1]),m.setLink(o[u-3],o[u]);break;case 38:this.$=o[u-2],m.setClickEvent(o[u-2],o[u],null),m.setLink(o[u-2],o[u-1]);break;case 39:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-1],o[u]),m.setLink(o[u-3],o[u-2]);break;case 40:this.$=o[u-1],m.setLink(o[u-1],o[u]);break;case 41:case 47:this.$=o[u-1]+" "+o[u];break;case 42:case 43:case 45:this.$=o[u-2]+" "+o[u-1]+" "+o[u];break;case 44:case 46:this.$=o[u-3]+" "+o[u-2]+" "+o[u-1]+" "+o[u];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:V,23:_,24:Y,25:G,26:Z,27:v,28:U,29:z,30:E,31:R,33:q,35:T,36:k,37:24,38:p,40:L},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:V,23:_,24:Y,25:G,26:Z,27:v,28:U,29:z,30:E,31:R,33:q,35:T,36:k,37:24,38:p,40:L},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:d(function(c,g){if(g.recoverable)this.trace(c);else{var b=new Error(c);throw b.hash=g,b}},"parseError"),parse:d(function(c){var g=this,b=[0],m=[],I=[null],o=[],W=this.table,u="",K=0,l=0,O=2,$=1,j=o.slice.call(arguments,1),H=Object.create(this.lexer),J={yy:{}};for(var h in this.yy)Object.prototype.hasOwnProperty.call(this.yy,h)&&(J.yy[h]=this.yy[h]);H.setInput(c,J.yy),J.yy.lexer=H,J.yy.parser=this,typeof H.yylloc>"u"&&(H.yylloc={});var N=H.yylloc;o.push(N);var P=H.options&&H.options.ranges;typeof J.yy.parseError=="function"?this.parseError=J.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function f(ot){b.length=b.length-2*ot,I.length=I.length-ot,o.length=o.length-ot}d(f,"popStack");function tt(){var ot;return ot=m.pop()||H.lex()||$,typeof ot!="number"&&(ot instanceof Array&&(m=ot,ot=m.pop()),ot=g.symbols_[ot]||ot),ot}d(tt,"lex");for(var A,Q,X,st,at={},pt,ut,We,Zt;;){if(Q=b[b.length-1],this.defaultActions[Q]?X=this.defaultActions[Q]:((A===null||typeof A>"u")&&(A=tt()),X=W[Q]&&W[Q][A]),typeof X>"u"||!X.length||!X[0]){var se="";Zt=[];for(pt in W[Q])this.terminals_[pt]&&pt>O&&Zt.push("'"+this.terminals_[pt]+"'");H.showPosition?se="Parse error on line "+(K+1)+`: `+H.showPosition()+` Expecting `+Zt.join(", ")+", got '"+(this.terminals_[A]||A)+"'":se="Parse error on line "+(K+1)+": Unexpected "+(A==$?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(se,{text:H.match,token:this.terminals_[A]||A,line:H.yylineno,loc:N,expected:Zt})}if(X[0]instanceof Array&&X.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+A);switch(X[0]){case 1:b.push(A),I.push(H.yytext),o.push(H.yylloc),b.push(X[1]),A=null,l=H.yyleng,u=H.yytext,K=H.yylineno,N=H.yylloc;break;case 2:if(ut=this.productions_[X[1]][1],at.$=I[I.length-ut],at._$={first_line:o[o.length-(ut||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(ut||1)].first_column,last_column:o[o.length-1].last_column},P&&(at._$.range=[o[o.length-(ut||1)].range[0],o[o.length-1].range[1]]),st=this.performAction.apply(at,[u,l,K,J.yy,X[1],I,o].concat(j)),typeof st<"u")return st;ut&&(b=b.slice(0,-1*ut*2),I=I.slice(0,-1*ut),o=o.slice(0,-1*ut)),b.push(this.productions_[X[1]][0]),I.push(at.$),o.push(at._$),We=W[b[b.length-2]][b[b.length-1]],b.push(We);break;case 3:return!0}}return!0},"parse")},C=function(){var D={EOF:1,parseError:d(function(g,b){if(this.yy.parser)this.yy.parser.parseError(g,b);else throw new Error(g)},"parseError"),setInput:d(function(c,g){return this.yy=g||this.yy||{},this._input=c,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var c=this._input[0];this.yytext+=c,this.yyleng++,this.offset++,this.match+=c,this.matched+=c;var g=c.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),c},"input"),unput:d(function(c){var g=c.length,b=c.split(/(?:\r\n?|\n)/g);this._input=c+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),b.length-1&&(this.yylineno-=b.length-1);var I=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:b?(b.length===m.length?this.yylloc.first_column:0)+m[m.length-b.length].length-b[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[I[0],I[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(c){this.unput(this.match.slice(c))},"less"),pastInput:d(function(){var c=this.matched.substr(0,this.matched.length-this.match.length);return(c.length>20?"...":"")+c.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var c=this.match;return c.length<20&&(c+=this._input.substr(0,20-c.length)),(c.substr(0,20)+(c.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var c=this.pastInput(),g=new Array(c.length+1).join("-");return c+this.upcomingInput()+` diff --git a/veadk/webui/assets/visualizations/mermaid/gitGraphDiagram-DS77QQ5N-DupWgFfq.js b/veadk/webui/assets/visualizations/mermaid/gitGraphDiagram-DS77QQ5N-CIVsYAyY.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/gitGraphDiagram-DS77QQ5N-DupWgFfq.js rename to veadk/webui/assets/visualizations/mermaid/gitGraphDiagram-DS77QQ5N-CIVsYAyY.js index 114de022e..9290a91f2 100644 --- a/veadk/webui/assets/visualizations/mermaid/gitGraphDiagram-DS77QQ5N-DupWgFfq.js +++ b/veadk/webui/assets/visualizations/mermaid/gitGraphDiagram-DS77QQ5N-CIVsYAyY.js @@ -1,4 +1,4 @@ -import{I as he}from"./chunk-2Q5K7J3B-nvFjhS5b.js";import{p as $e}from"./chunk-JWPE2WC7-DD-BFVC6.js";import{$ as fe,aT as ge,aQ as ue,V as ye,W as xe,aR as me,a as $,X as J,at as k,Y as z,b9 as pe,aX as be,s as we,x as L,r as ke,O as ve,aH as Ee}from"./mermaid.core-y4TF8bTw.js";import{p as Ce}from"./cynefin-OW5HDTMX-DBq9B5VP.js";import{aG as Be}from"../../app/index-BNPwMQXG.js";import"../../chunks/purify.es-BnINGy_Y.js";var p={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Te=ve.gitGraph,D=$(()=>ke({...Te,...J().gitGraph}),"getConfig"),i=new he(()=>{const e=D(),r=e.mainBranchName,t=e.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:t}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function K(){return Ee({length:7})}$(K,"getID");function ae(e,r){const t=Object.create(null);return e.reduce((o,s)=>{const d=r(s);return t[d]||(t[d]=!0,o.push(s)),o},[])}$(ae,"uniqBy");var Le=$(function(e){i.records.direction=e},"setDirection"),Me=$(function(e){k.debug("options str",e),e=e==null?void 0:e.trim(),e=e||"{}";try{i.records.options=JSON.parse(e)}catch(r){k.error("error while parsing gitGraph options",r.message)}},"setOptions"),Re=$(function(){return i.records.options},"getOptions"),Ie=$(function(e){let r=e.msg,t=e.id;const o=e.type;let s=e.tags;k.info("commit",r,t,o,s),k.debug("Entering commit:",r,t,o,s);const d=D();t=L.sanitizeText(t,d),r=L.sanitizeText(r,d),s=s==null?void 0:s.map(a=>L.sanitizeText(a,d));const n={id:t||i.records.seq+"-"+K(),message:r,seq:i.records.seq++,type:o??p.NORMAL,tags:s??[],parents:i.records.head==null?[]:[i.records.head.id],branch:i.records.currBranch};i.records.head=n,k.info("main branch",d.mainBranchName),i.records.commits.has(n.id)&&k.warn(`Commit ID ${n.id} already exists`),i.records.commits.set(n.id,n),i.records.branches.set(i.records.currBranch,n.id),k.debug("in pushCommit "+n.id)},"commit"),Oe=$(function(e){let r=e.name;const t=e.order;if(r=L.sanitizeText(r,D()),i.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);i.records.branches.set(r,i.records.head!=null?i.records.head.id:null),i.records.branchConfig.set(r,{name:r,order:t}),ne(r),k.debug("in createBranch")},"branch"),_e=$(e=>{let r=e.branch,t=e.id;const o=e.type,s=e.tags,d=D();r=L.sanitizeText(r,d),t&&(t=L.sanitizeText(t,d));const n=i.records.branches.get(i.records.currBranch),a=i.records.branches.get(r),l=n?i.records.commits.get(n):void 0,h=a?i.records.commits.get(a):void 0;if(l&&h&&l.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(i.records.currBranch===r){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${i.records.currBranch})has no commits`);throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},c}if(!i.records.branches.has(r)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},c}if(h===void 0||!h){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},c}if(l===h){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(t&&i.records.commits.has(t)){const c=new Error('Incorrect usage of "merge". Commit with id:'+t+" already exists, use different custom id");throw c.hash={text:`merge ${r} ${t} ${o} ${s==null?void 0:s.join(" ")}`,token:`merge ${r} ${t} ${o} ${s==null?void 0:s.join(" ")}`,expected:[`merge ${r} ${t}_UNIQUE ${o} ${s==null?void 0:s.join(" ")}`]},c}const g=a||"",f={id:t||`${i.records.seq}-${K()}`,message:`merged branch ${r} into ${i.records.currBranch}`,seq:i.records.seq++,parents:i.records.head==null?[]:[i.records.head.id,g],branch:i.records.currBranch,type:p.MERGE,customType:o,customId:!!t,tags:s??[]};i.records.head=f,i.records.commits.set(f.id,f),i.records.branches.set(i.records.currBranch,f.id),k.debug(i.records.branches),k.debug("in mergeBranch")},"merge"),Ge=$(function(e){let r=e.id,t=e.targetId,o=e.tags,s=e.parent;k.debug("Entering cherryPick:",r,t,o);const d=D();if(r=L.sanitizeText(r,d),t=L.sanitizeText(t,d),o=o==null?void 0:o.map(l=>L.sanitizeText(l,d)),s=L.sanitizeText(s,d),!r||!i.records.commits.has(r)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},l}const n=i.records.commits.get(r);if(n===void 0||!n)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(s&&!(Array.isArray(n.parents)&&n.parents.includes(s)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const a=n.branch;if(n.type===p.MERGE&&!s)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!t||!i.records.commits.has(t)){if(a===i.records.currBranch){const f=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw f.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},f}const l=i.records.branches.get(i.records.currBranch);if(l===void 0||!l){const f=new Error(`Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`);throw f.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},f}const h=i.records.commits.get(l);if(h===void 0||!h){const f=new Error(`Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`);throw f.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},f}const g={id:i.records.seq+"-"+K(),message:`cherry-picked ${n==null?void 0:n.message} into ${i.records.currBranch}`,seq:i.records.seq++,parents:i.records.head==null?[]:[i.records.head.id,n.id],branch:i.records.currBranch,type:p.CHERRY_PICK,tags:o?o.filter(Boolean):[`cherry-pick:${n.id}${n.type===p.MERGE?`|parent:${s}`:""}`]};i.records.head=g,i.records.commits.set(g.id,g),i.records.branches.set(i.records.currBranch,g.id),k.debug(i.records.branches),k.debug("in cherryPick")}},"cherryPick"),ne=$(function(e){if(e=L.sanitizeText(e,D()),i.records.branches.has(e)){i.records.currBranch=e;const r=i.records.branches.get(i.records.currBranch);r===void 0||!r?i.records.head=null:i.records.head=i.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw r.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},r}},"checkout");function X(e,r,t){const o=e.indexOf(r);o===-1?e.push(t):e.splice(o,1,t)}$(X,"upsert");function Z(e){const r=e.reduce((s,d)=>s.seq>d.seq?s:d,e[0]);let t="";e.forEach(function(s){s===r?t+=" *":t+=" |"});const o=[t,r.id,r.seq];for(const s in i.records.branches)i.records.branches.get(s)===r.id&&o.push(s);if(k.debug(o.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const s=i.records.commits.get(r.parents[0]);X(e,r,s),r.parents[1]&&e.push(i.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const s=i.records.commits.get(r.parents[0]);X(e,r,s)}}e=ae(e,s=>s.id),Z(e)}$(Z,"prettyPrintCommitHistory");var He=$(function(){k.debug(i.records.commits);const e=se()[0];Z([e])},"prettyPrint"),Se=$(function(){i.reset(),we()},"clear"),Ae=$(function(){return[...i.records.branchConfig.values()].map((r,t)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${t}`)}).sort((r,t)=>(r.order??0)-(t.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),De=$(function(){return i.records.branches},"getBranches"),We=$(function(){return i.records.commits},"getCommits"),se=$(function(){const e=[...i.records.commits.values()];return e.forEach(function(r){k.debug(r.id)}),e.sort((r,t)=>r.seq-t.seq),e},"getCommitsArray"),Pe=$(function(){return i.records.currBranch},"getCurrentBranch"),qe=$(function(){return i.records.direction},"getDirection"),Ne=$(function(){return i.records.head},"getHead"),oe={commitType:p,getConfig:D,setDirection:Le,setOptions:Me,getOptions:Re,commit:Ie,branch:Oe,merge:_e,cherryPick:Ge,checkout:ne,prettyPrint:He,clear:Se,getBranchesAsObjArray:Ae,getBranches:De,getCommits:We,getCommitsArray:se,getCurrentBranch:Pe,getDirection:qe,getHead:Ne,setAccTitle:me,getAccTitle:xe,getAccDescription:ye,setAccDescription:ue,setDiagramTitle:ge,getDiagramTitle:fe},Fe=$((e,r)=>{$e(e,r),e.dir&&r.setDirection(e.dir);for(const t of e.statements)ze(t,r)},"populate"),ze=$((e,r)=>{const o={Commit:$(s=>r.commit(Ye(s)),"Commit"),Branch:$(s=>r.branch(je(s)),"Branch"),Merge:$(s=>r.merge(Ue(s)),"Merge"),Checkout:$(s=>r.checkout(Ke(s)),"Checkout"),CherryPicking:$(s=>r.cherryPick(Ve(s)),"CherryPicking")}[e.$type];o?o(e):k.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),Ye=$(e=>({id:e.id,msg:e.message??"",type:e.type!==void 0?p[e.type]:p.NORMAL,tags:e.tags??void 0}),"parseCommit"),je=$(e=>({name:e.name,order:e.order??0}),"parseBranch"),Ue=$(e=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?p[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),Ke=$(e=>e.branch,"parseCheckout"),Ve=$(e=>{var t;return{id:e.id,targetId:"",tags:((t=e.tags)==null?void 0:t.length)===0?void 0:e.tags,parent:e.parent}},"parseCherryPicking"),Xe={parse:$(async e=>{const r=await Ce("gitGraph",e);k.debug(r),Fe(r,oe)},"parse")},G=10,H=40,M=4,I=2,S=8,V=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),Q=12,ee=new Set(["redux-color","redux-dark-color"]),Qe=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),A=$((e,r,t=!1)=>t&&e>0?(e-1)%(r-1)+1:e%r,"calcColorIndex"),B=new Map,T=new Map,j=30,N=new Map,U=[],O=0,y="LR",Je=$(()=>{B.clear(),T.clear(),N.clear(),O=0,U=[],y="LR"},"clear"),ce=$(e=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e=="string"?e.split(/\\n|\n|/gi):e).forEach(o=>{const s=document.createElementNS("http://www.w3.org/2000/svg","tspan");s.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),s.setAttribute("dy","1em"),s.setAttribute("x","0"),s.setAttribute("class","row"),s.textContent=o.trim(),r.appendChild(s)}),r},"drawText"),ie=$(e=>{let r,t,o;return y==="BT"?(t=$((s,d)=>s<=d,"comparisonFunc"),o=1/0):(t=$((s,d)=>s>=d,"comparisonFunc"),o=0),e.forEach(s=>{var n,a;const d=y==="TB"||y=="BT"?(n=T.get(s))==null?void 0:n.y:(a=T.get(s))==null?void 0:a.x;d!==void 0&&t(d,o)&&(r=s,o=d)}),r},"findClosestParent"),Ze=$(e=>{let r="",t=1/0;return e.forEach(o=>{const s=T.get(o).y;s<=t&&(r=o,t=s)}),r||void 0},"findClosestParentBT"),er=$((e,r,t)=>{let o=t,s=t;const d=[];e.forEach(n=>{const a=r.get(n);if(!a)throw new Error(`Commit not found for key ${n}`);a.parents.length?(o=tr(a),s=Math.max(o,s)):d.push(a),ar(a,o)}),o=s,d.forEach(n=>{nr(n,o,t)}),e.forEach(n=>{const a=r.get(n);if(a!=null&&a.parents.length){const l=Ze(a.parents);o=T.get(l).y-H,o<=s&&(s=o);const h=B.get(a.branch).pos,g=o-G;T.set(a.id,{x:h,y:g})}})},"setParallelBTPos"),rr=$(e=>{var o;const r=ie(e.parents.filter(s=>s!==null));if(!r)throw new Error(`Closest parent not found for commit ${e.id}`);const t=(o=T.get(r))==null?void 0:o.y;if(t===void 0)throw new Error(`Closest parent position not found for commit ${e.id}`);return t},"findClosestParentPos"),tr=$(e=>rr(e)+H,"calculateCommitPosition"),ar=$((e,r)=>{const t=B.get(e.branch);if(!t)throw new Error(`Branch not found for commit ${e.id}`);const o=t.pos,s=r+G;return T.set(e.id,{x:o,y:s}),{x:o,y:s}},"setCommitPosition"),nr=$((e,r,t)=>{const o=B.get(e.branch);if(!o)throw new Error(`Branch not found for commit ${e.id}`);const s=r+t,d=o.pos;T.set(e.id,{x:d,y:s})},"setRootPosition"),sr=$((e,r,t,o,s,d)=>{const{theme:n}=z(),a=V.has(n??""),l=ee.has(n??""),h=Qe.has(n??"");if(d===p.HIGHLIGHT)e.append("rect").attr("x",t.x-10+(a?3:0)).attr("y",t.y-10+(a?3:0)).attr("width",a?14:20).attr("height",a?14:20).attr("class",`commit ${r.id} commit-highlight${A(s,S,l)} ${o}-outer`),e.append("rect").attr("x",t.x-6+(a?2:0)).attr("y",t.y-6+(a?2:0)).attr("width",a?8:12).attr("height",a?8:12).attr("class",`commit ${r.id} commit${A(s,S,l)} ${o}-inner`);else if(d===p.CHERRY_PICK)e.append("circle").attr("cx",t.x).attr("cy",t.y).attr("r",a?7:10).attr("class",`commit ${r.id} ${o}`),e.append("circle").attr("cx",t.x-3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`),e.append("circle").attr("cx",t.x+3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`),e.append("line").attr("x1",t.x+3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`),e.append("line").attr("x1",t.x-3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`);else{const g=e.append("circle");if(g.attr("cx",t.x),g.attr("cy",t.y),g.attr("r",a?7:10),g.attr("class",`commit ${r.id} commit${A(s,S,l)}`),d===p.MERGE){const f=e.append("circle");f.attr("cx",t.x),f.attr("cy",t.y),f.attr("r",a?5:6),f.attr("class",`commit ${o} ${r.id} commit${A(s,S,l)}`)}if(d===p.REVERSE){const f=e.append("path"),c=a?4:5;f.attr("d",`M ${t.x-c},${t.y-c}L${t.x+c},${t.y+c}M${t.x-c},${t.y+c}L${t.x+c},${t.y-c}`).attr("class",`commit ${o} ${r.id} commit${A(s,S,l)}`)}}},"drawCommitBullet"),or=$((e,r,t,o,s)=>{var d;if(r.type!==p.CHERRY_PICK&&(r.customId&&r.type===p.MERGE||r.type!==p.MERGE)&&s.showCommitLabel){const n=e.append("g"),a=n.insert("rect").attr("class","commit-label-bkg"),l=n.append("text").attr("x",o).attr("y",t.y+25).attr("class","commit-label").text(r.id),h=(d=l.node())==null?void 0:d.getBBox();if(h&&(a.attr("x",t.posWithOffset-h.width/2-I).attr("y",t.y+13.5).attr("width",h.width+2*I).attr("height",h.height+2*I),y==="TB"||y==="BT"?(a.attr("x",t.x-(h.width+4*M+5)).attr("y",t.y-12),l.attr("x",t.x-(h.width+4*M)).attr("y",t.y+h.height-12)):l.attr("x",t.posWithOffset-h.width/2),s.rotateCommitLabel))if(y==="TB"||y==="BT")l.attr("transform","rotate(-45, "+t.x+", "+t.y+")"),a.attr("transform","rotate(-45, "+t.x+", "+t.y+")");else{const g=-7.5-(h.width+10)/25*9.5,f=10+h.width/25*8.5;n.attr("transform","translate("+g+", "+f+") rotate(-45, "+o+", "+t.y+")")}}},"drawCommitLabel"),cr=$((e,r,t,o)=>{var s;if(r.tags.length>0){let d=0,n=0,a=0;const l=[];for(const h of r.tags.reverse()){const g=e.insert("polygon"),f=e.append("circle"),c=e.append("text").attr("y",t.y-16-d).attr("class","tag-label").text(h),x=(s=c.node())==null?void 0:s.getBBox();if(!x)throw new Error("Tag bbox not found");n=Math.max(n,x.width),a=Math.max(a,x.height),c.attr("x",t.posWithOffset-x.width/2),l.push({tag:c,hole:f,rect:g,yOffset:d}),d+=20}for(const{tag:h,hole:g,rect:f,yOffset:c}of l){const x=a/2,u=t.y-19.2-c;if(f.attr("class","tag-label-bkg").attr("points",` +import{I as he}from"./chunk-2Q5K7J3B-BK3jpFNd.js";import{p as $e}from"./chunk-JWPE2WC7-DVlhplzu.js";import{$ as fe,aT as ge,aQ as ue,V as ye,W as xe,aR as me,a as $,X as J,at as k,Y as z,b9 as pe,aX as be,s as we,x as L,r as ke,O as ve,aH as Ee}from"./mermaid.core-DAx4nvmm.js";import{p as Ce}from"./cynefin-OW5HDTMX-BHP1Kvyc.js";import{aG as Be}from"../../app/index-8JtvDNuA.js";import"../../chunks/purify.es-BnINGy_Y.js";var p={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Te=ve.gitGraph,D=$(()=>ke({...Te,...J().gitGraph}),"getConfig"),i=new he(()=>{const e=D(),r=e.mainBranchName,t=e.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:t}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function K(){return Ee({length:7})}$(K,"getID");function ae(e,r){const t=Object.create(null);return e.reduce((o,s)=>{const d=r(s);return t[d]||(t[d]=!0,o.push(s)),o},[])}$(ae,"uniqBy");var Le=$(function(e){i.records.direction=e},"setDirection"),Me=$(function(e){k.debug("options str",e),e=e==null?void 0:e.trim(),e=e||"{}";try{i.records.options=JSON.parse(e)}catch(r){k.error("error while parsing gitGraph options",r.message)}},"setOptions"),Re=$(function(){return i.records.options},"getOptions"),Ie=$(function(e){let r=e.msg,t=e.id;const o=e.type;let s=e.tags;k.info("commit",r,t,o,s),k.debug("Entering commit:",r,t,o,s);const d=D();t=L.sanitizeText(t,d),r=L.sanitizeText(r,d),s=s==null?void 0:s.map(a=>L.sanitizeText(a,d));const n={id:t||i.records.seq+"-"+K(),message:r,seq:i.records.seq++,type:o??p.NORMAL,tags:s??[],parents:i.records.head==null?[]:[i.records.head.id],branch:i.records.currBranch};i.records.head=n,k.info("main branch",d.mainBranchName),i.records.commits.has(n.id)&&k.warn(`Commit ID ${n.id} already exists`),i.records.commits.set(n.id,n),i.records.branches.set(i.records.currBranch,n.id),k.debug("in pushCommit "+n.id)},"commit"),Oe=$(function(e){let r=e.name;const t=e.order;if(r=L.sanitizeText(r,D()),i.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);i.records.branches.set(r,i.records.head!=null?i.records.head.id:null),i.records.branchConfig.set(r,{name:r,order:t}),ne(r),k.debug("in createBranch")},"branch"),_e=$(e=>{let r=e.branch,t=e.id;const o=e.type,s=e.tags,d=D();r=L.sanitizeText(r,d),t&&(t=L.sanitizeText(t,d));const n=i.records.branches.get(i.records.currBranch),a=i.records.branches.get(r),l=n?i.records.commits.get(n):void 0,h=a?i.records.commits.get(a):void 0;if(l&&h&&l.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(i.records.currBranch===r){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${i.records.currBranch})has no commits`);throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},c}if(!i.records.branches.has(r)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},c}if(h===void 0||!h){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},c}if(l===h){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(t&&i.records.commits.has(t)){const c=new Error('Incorrect usage of "merge". Commit with id:'+t+" already exists, use different custom id");throw c.hash={text:`merge ${r} ${t} ${o} ${s==null?void 0:s.join(" ")}`,token:`merge ${r} ${t} ${o} ${s==null?void 0:s.join(" ")}`,expected:[`merge ${r} ${t}_UNIQUE ${o} ${s==null?void 0:s.join(" ")}`]},c}const g=a||"",f={id:t||`${i.records.seq}-${K()}`,message:`merged branch ${r} into ${i.records.currBranch}`,seq:i.records.seq++,parents:i.records.head==null?[]:[i.records.head.id,g],branch:i.records.currBranch,type:p.MERGE,customType:o,customId:!!t,tags:s??[]};i.records.head=f,i.records.commits.set(f.id,f),i.records.branches.set(i.records.currBranch,f.id),k.debug(i.records.branches),k.debug("in mergeBranch")},"merge"),Ge=$(function(e){let r=e.id,t=e.targetId,o=e.tags,s=e.parent;k.debug("Entering cherryPick:",r,t,o);const d=D();if(r=L.sanitizeText(r,d),t=L.sanitizeText(t,d),o=o==null?void 0:o.map(l=>L.sanitizeText(l,d)),s=L.sanitizeText(s,d),!r||!i.records.commits.has(r)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},l}const n=i.records.commits.get(r);if(n===void 0||!n)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(s&&!(Array.isArray(n.parents)&&n.parents.includes(s)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const a=n.branch;if(n.type===p.MERGE&&!s)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!t||!i.records.commits.has(t)){if(a===i.records.currBranch){const f=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw f.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},f}const l=i.records.branches.get(i.records.currBranch);if(l===void 0||!l){const f=new Error(`Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`);throw f.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},f}const h=i.records.commits.get(l);if(h===void 0||!h){const f=new Error(`Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`);throw f.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},f}const g={id:i.records.seq+"-"+K(),message:`cherry-picked ${n==null?void 0:n.message} into ${i.records.currBranch}`,seq:i.records.seq++,parents:i.records.head==null?[]:[i.records.head.id,n.id],branch:i.records.currBranch,type:p.CHERRY_PICK,tags:o?o.filter(Boolean):[`cherry-pick:${n.id}${n.type===p.MERGE?`|parent:${s}`:""}`]};i.records.head=g,i.records.commits.set(g.id,g),i.records.branches.set(i.records.currBranch,g.id),k.debug(i.records.branches),k.debug("in cherryPick")}},"cherryPick"),ne=$(function(e){if(e=L.sanitizeText(e,D()),i.records.branches.has(e)){i.records.currBranch=e;const r=i.records.branches.get(i.records.currBranch);r===void 0||!r?i.records.head=null:i.records.head=i.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw r.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},r}},"checkout");function X(e,r,t){const o=e.indexOf(r);o===-1?e.push(t):e.splice(o,1,t)}$(X,"upsert");function Z(e){const r=e.reduce((s,d)=>s.seq>d.seq?s:d,e[0]);let t="";e.forEach(function(s){s===r?t+=" *":t+=" |"});const o=[t,r.id,r.seq];for(const s in i.records.branches)i.records.branches.get(s)===r.id&&o.push(s);if(k.debug(o.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const s=i.records.commits.get(r.parents[0]);X(e,r,s),r.parents[1]&&e.push(i.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const s=i.records.commits.get(r.parents[0]);X(e,r,s)}}e=ae(e,s=>s.id),Z(e)}$(Z,"prettyPrintCommitHistory");var He=$(function(){k.debug(i.records.commits);const e=se()[0];Z([e])},"prettyPrint"),Se=$(function(){i.reset(),we()},"clear"),Ae=$(function(){return[...i.records.branchConfig.values()].map((r,t)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${t}`)}).sort((r,t)=>(r.order??0)-(t.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),De=$(function(){return i.records.branches},"getBranches"),We=$(function(){return i.records.commits},"getCommits"),se=$(function(){const e=[...i.records.commits.values()];return e.forEach(function(r){k.debug(r.id)}),e.sort((r,t)=>r.seq-t.seq),e},"getCommitsArray"),Pe=$(function(){return i.records.currBranch},"getCurrentBranch"),qe=$(function(){return i.records.direction},"getDirection"),Ne=$(function(){return i.records.head},"getHead"),oe={commitType:p,getConfig:D,setDirection:Le,setOptions:Me,getOptions:Re,commit:Ie,branch:Oe,merge:_e,cherryPick:Ge,checkout:ne,prettyPrint:He,clear:Se,getBranchesAsObjArray:Ae,getBranches:De,getCommits:We,getCommitsArray:se,getCurrentBranch:Pe,getDirection:qe,getHead:Ne,setAccTitle:me,getAccTitle:xe,getAccDescription:ye,setAccDescription:ue,setDiagramTitle:ge,getDiagramTitle:fe},Fe=$((e,r)=>{$e(e,r),e.dir&&r.setDirection(e.dir);for(const t of e.statements)ze(t,r)},"populate"),ze=$((e,r)=>{const o={Commit:$(s=>r.commit(Ye(s)),"Commit"),Branch:$(s=>r.branch(je(s)),"Branch"),Merge:$(s=>r.merge(Ue(s)),"Merge"),Checkout:$(s=>r.checkout(Ke(s)),"Checkout"),CherryPicking:$(s=>r.cherryPick(Ve(s)),"CherryPicking")}[e.$type];o?o(e):k.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),Ye=$(e=>({id:e.id,msg:e.message??"",type:e.type!==void 0?p[e.type]:p.NORMAL,tags:e.tags??void 0}),"parseCommit"),je=$(e=>({name:e.name,order:e.order??0}),"parseBranch"),Ue=$(e=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?p[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),Ke=$(e=>e.branch,"parseCheckout"),Ve=$(e=>{var t;return{id:e.id,targetId:"",tags:((t=e.tags)==null?void 0:t.length)===0?void 0:e.tags,parent:e.parent}},"parseCherryPicking"),Xe={parse:$(async e=>{const r=await Ce("gitGraph",e);k.debug(r),Fe(r,oe)},"parse")},G=10,H=40,M=4,I=2,S=8,V=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),Q=12,ee=new Set(["redux-color","redux-dark-color"]),Qe=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),A=$((e,r,t=!1)=>t&&e>0?(e-1)%(r-1)+1:e%r,"calcColorIndex"),B=new Map,T=new Map,j=30,N=new Map,U=[],O=0,y="LR",Je=$(()=>{B.clear(),T.clear(),N.clear(),O=0,U=[],y="LR"},"clear"),ce=$(e=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e=="string"?e.split(/\\n|\n|/gi):e).forEach(o=>{const s=document.createElementNS("http://www.w3.org/2000/svg","tspan");s.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),s.setAttribute("dy","1em"),s.setAttribute("x","0"),s.setAttribute("class","row"),s.textContent=o.trim(),r.appendChild(s)}),r},"drawText"),ie=$(e=>{let r,t,o;return y==="BT"?(t=$((s,d)=>s<=d,"comparisonFunc"),o=1/0):(t=$((s,d)=>s>=d,"comparisonFunc"),o=0),e.forEach(s=>{var n,a;const d=y==="TB"||y=="BT"?(n=T.get(s))==null?void 0:n.y:(a=T.get(s))==null?void 0:a.x;d!==void 0&&t(d,o)&&(r=s,o=d)}),r},"findClosestParent"),Ze=$(e=>{let r="",t=1/0;return e.forEach(o=>{const s=T.get(o).y;s<=t&&(r=o,t=s)}),r||void 0},"findClosestParentBT"),er=$((e,r,t)=>{let o=t,s=t;const d=[];e.forEach(n=>{const a=r.get(n);if(!a)throw new Error(`Commit not found for key ${n}`);a.parents.length?(o=tr(a),s=Math.max(o,s)):d.push(a),ar(a,o)}),o=s,d.forEach(n=>{nr(n,o,t)}),e.forEach(n=>{const a=r.get(n);if(a!=null&&a.parents.length){const l=Ze(a.parents);o=T.get(l).y-H,o<=s&&(s=o);const h=B.get(a.branch).pos,g=o-G;T.set(a.id,{x:h,y:g})}})},"setParallelBTPos"),rr=$(e=>{var o;const r=ie(e.parents.filter(s=>s!==null));if(!r)throw new Error(`Closest parent not found for commit ${e.id}`);const t=(o=T.get(r))==null?void 0:o.y;if(t===void 0)throw new Error(`Closest parent position not found for commit ${e.id}`);return t},"findClosestParentPos"),tr=$(e=>rr(e)+H,"calculateCommitPosition"),ar=$((e,r)=>{const t=B.get(e.branch);if(!t)throw new Error(`Branch not found for commit ${e.id}`);const o=t.pos,s=r+G;return T.set(e.id,{x:o,y:s}),{x:o,y:s}},"setCommitPosition"),nr=$((e,r,t)=>{const o=B.get(e.branch);if(!o)throw new Error(`Branch not found for commit ${e.id}`);const s=r+t,d=o.pos;T.set(e.id,{x:d,y:s})},"setRootPosition"),sr=$((e,r,t,o,s,d)=>{const{theme:n}=z(),a=V.has(n??""),l=ee.has(n??""),h=Qe.has(n??"");if(d===p.HIGHLIGHT)e.append("rect").attr("x",t.x-10+(a?3:0)).attr("y",t.y-10+(a?3:0)).attr("width",a?14:20).attr("height",a?14:20).attr("class",`commit ${r.id} commit-highlight${A(s,S,l)} ${o}-outer`),e.append("rect").attr("x",t.x-6+(a?2:0)).attr("y",t.y-6+(a?2:0)).attr("width",a?8:12).attr("height",a?8:12).attr("class",`commit ${r.id} commit${A(s,S,l)} ${o}-inner`);else if(d===p.CHERRY_PICK)e.append("circle").attr("cx",t.x).attr("cy",t.y).attr("r",a?7:10).attr("class",`commit ${r.id} ${o}`),e.append("circle").attr("cx",t.x-3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`),e.append("circle").attr("cx",t.x+3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`),e.append("line").attr("x1",t.x+3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`),e.append("line").attr("x1",t.x-3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`);else{const g=e.append("circle");if(g.attr("cx",t.x),g.attr("cy",t.y),g.attr("r",a?7:10),g.attr("class",`commit ${r.id} commit${A(s,S,l)}`),d===p.MERGE){const f=e.append("circle");f.attr("cx",t.x),f.attr("cy",t.y),f.attr("r",a?5:6),f.attr("class",`commit ${o} ${r.id} commit${A(s,S,l)}`)}if(d===p.REVERSE){const f=e.append("path"),c=a?4:5;f.attr("d",`M ${t.x-c},${t.y-c}L${t.x+c},${t.y+c}M${t.x-c},${t.y+c}L${t.x+c},${t.y-c}`).attr("class",`commit ${o} ${r.id} commit${A(s,S,l)}`)}}},"drawCommitBullet"),or=$((e,r,t,o,s)=>{var d;if(r.type!==p.CHERRY_PICK&&(r.customId&&r.type===p.MERGE||r.type!==p.MERGE)&&s.showCommitLabel){const n=e.append("g"),a=n.insert("rect").attr("class","commit-label-bkg"),l=n.append("text").attr("x",o).attr("y",t.y+25).attr("class","commit-label").text(r.id),h=(d=l.node())==null?void 0:d.getBBox();if(h&&(a.attr("x",t.posWithOffset-h.width/2-I).attr("y",t.y+13.5).attr("width",h.width+2*I).attr("height",h.height+2*I),y==="TB"||y==="BT"?(a.attr("x",t.x-(h.width+4*M+5)).attr("y",t.y-12),l.attr("x",t.x-(h.width+4*M)).attr("y",t.y+h.height-12)):l.attr("x",t.posWithOffset-h.width/2),s.rotateCommitLabel))if(y==="TB"||y==="BT")l.attr("transform","rotate(-45, "+t.x+", "+t.y+")"),a.attr("transform","rotate(-45, "+t.x+", "+t.y+")");else{const g=-7.5-(h.width+10)/25*9.5,f=10+h.width/25*8.5;n.attr("transform","translate("+g+", "+f+") rotate(-45, "+o+", "+t.y+")")}}},"drawCommitLabel"),cr=$((e,r,t,o)=>{var s;if(r.tags.length>0){let d=0,n=0,a=0;const l=[];for(const h of r.tags.reverse()){const g=e.insert("polygon"),f=e.append("circle"),c=e.append("text").attr("y",t.y-16-d).attr("class","tag-label").text(h),x=(s=c.node())==null?void 0:s.getBBox();if(!x)throw new Error("Tag bbox not found");n=Math.max(n,x.width),a=Math.max(a,x.height),c.attr("x",t.posWithOffset-x.width/2),l.push({tag:c,hole:f,rect:g,yOffset:d}),d+=20}for(const{tag:h,hole:g,rect:f,yOffset:c}of l){const x=a/2,u=t.y-19.2-c;if(f.attr("class","tag-label-bkg").attr("points",` ${o-n/2-M/2},${u+I} ${o-n/2-M/2},${u-I} ${t.posWithOffset-n/2-M},${u-x-I} diff --git a/veadk/webui/assets/visualizations/mermaid/infoDiagram-6WML65LV-Dl6zW5rI.js b/veadk/webui/assets/visualizations/mermaid/infoDiagram-6WML65LV-D6hoQeyX.js similarity index 69% rename from veadk/webui/assets/visualizations/mermaid/infoDiagram-6WML65LV-Dl6zW5rI.js rename to veadk/webui/assets/visualizations/mermaid/infoDiagram-6WML65LV-D6hoQeyX.js index 5f3e1b7e7..94332371c 100644 --- a/veadk/webui/assets/visualizations/mermaid/infoDiagram-6WML65LV-Dl6zW5rI.js +++ b/veadk/webui/assets/visualizations/mermaid/infoDiagram-6WML65LV-D6hoQeyX.js @@ -1,2 +1,2 @@ -import{a as e,at as s,aP as n,B as i}from"./mermaid.core-y4TF8bTw.js";import{p}from"./cynefin-OW5HDTMX-DBq9B5VP.js";import"../../app/index-BNPwMQXG.js";import"../../chunks/purify.es-BnINGy_Y.js";var g={parse:e(async r=>{const a=await p("info",r);s.debug(a)},"parse")},v={version:"11.16.1"},d=e(()=>v.version,"getVersion"),m={getVersion:d},c=e((r,a,o)=>{s.debug(`rendering info diagram +import{a as e,at as s,aP as n,B as i}from"./mermaid.core-DAx4nvmm.js";import{p}from"./cynefin-OW5HDTMX-BHP1Kvyc.js";import"../../app/index-8JtvDNuA.js";import"../../chunks/purify.es-BnINGy_Y.js";var g={parse:e(async r=>{const a=await p("info",r);s.debug(a)},"parse")},v={version:"11.16.1"},d=e(()=>v.version,"getVersion"),m={getVersion:d},c=e((r,a,o)=>{s.debug(`rendering info diagram `+r);const t=n(a);i(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${o}`)},"draw"),f={draw:c},w={parser:g,db:m,renderer:f};export{w as diagram}; diff --git a/veadk/webui/assets/visualizations/mermaid/ishikawaDiagram-WSZJBQD7-NBIjIwSA.js b/veadk/webui/assets/visualizations/mermaid/ishikawaDiagram-WSZJBQD7-Di5hDQFl.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/ishikawaDiagram-WSZJBQD7-NBIjIwSA.js rename to veadk/webui/assets/visualizations/mermaid/ishikawaDiagram-WSZJBQD7-Di5hDQFl.js index ae3350063..664772681 100644 --- a/veadk/webui/assets/visualizations/mermaid/ishikawaDiagram-WSZJBQD7-NBIjIwSA.js +++ b/veadk/webui/assets/visualizations/mermaid/ishikawaDiagram-WSZJBQD7-Di5hDQFl.js @@ -1,4 +1,4 @@ -import{a as o,Y as ot,aC as ut,aP as dt,k as yt,s as ft,x as pt,aT as it,W as gt,aR as kt,V as mt,aQ as wt,$ as _t,B as xt}from"./mermaid.core-y4TF8bTw.js";import"../../app/index-BNPwMQXG.js";import"../../chunks/purify.es-BnINGy_Y.js";var tt=function(){var e=o(function(M,t,s,i){for(s=s||{},i=M.length;i--;s[M[i]]=t);return s},"o"),h=[1,4],r=[1,14],a=[1,12],l=[1,13],y=[6,7,8],f=[1,20],d=[1,18],m=[1,19],c=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],b=[1,6,7,11,13,14],N={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:o(function(t,s,i,u,p,n,v){var w=n.length-1;switch(p){case 6:case 7:return u;case 15:u.addNode(n[w-1].length,n[w].trim());break;case 16:u.addNode(0,n[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:r,7:[1,10],9:9,12:11,13:a,14:l},e(y,[2,3]),{1:[2,2]},e(y,[2,4]),e(y,[2,5]),{1:[2,6],6:r,12:15,13:a,14:l},{6:r,9:16,12:11,13:a,14:l},{6:f,7:d,10:17,11:m},e(c,[2,18],{14:[1,21]}),e(c,[2,16]),e(c,[2,17]),{6:f,7:d,10:22,11:m},{1:[2,7],6:r,12:15,13:a,14:l},e(k,[2,14],{7:g,11:_}),e(b,[2,8]),e(b,[2,9]),e(b,[2,10]),e(c,[2,15]),e(k,[2,13],{7:g,11:_}),e(b,[2,11]),e(b,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(t,s){if(s.recoverable)this.trace(t);else{var i=new Error(t);throw i.hash=s,i}},"parseError"),parse:o(function(t){var s=this,i=[0],u=[],p=[null],n=[],v=this.table,w="",I=0,S=0,L=2,E=1,R=n.slice.call(arguments,1),x=Object.create(this.lexer),C={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(C.yy[F]=this.yy[F]);x.setInput(t,C.yy),C.yy.lexer=x,C.yy.parser=this,typeof x.yylloc>"u"&&(x.yylloc={});var T=x.yylloc;n.push(T);var D=x.options&&x.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function j(P){i.length=i.length-2*P,p.length=p.length-P,n.length=n.length-P}o(j,"popStack");function z(){var P;return P=u.pop()||x.lex()||E,typeof P!="number"&&(P instanceof Array&&(u=P,P=u.pop()),P=s.symbols_[P]||P),P}o(z,"lex");for(var A,W,B,Q,H={},Z,V,et,X;;){if(W=i[i.length-1],this.defaultActions[W]?B=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=z()),B=v[W]&&v[W][A]),typeof B>"u"||!B.length||!B[0]){var q="";X=[];for(Z in v[W])this.terminals_[Z]&&Z>L&&X.push("'"+this.terminals_[Z]+"'");x.showPosition?q="Parse error on line "+(I+1)+`: +import{a as o,Y as ot,aC as ut,aP as dt,k as yt,s as ft,x as pt,aT as it,W as gt,aR as kt,V as mt,aQ as wt,$ as _t,B as xt}from"./mermaid.core-DAx4nvmm.js";import"../../app/index-8JtvDNuA.js";import"../../chunks/purify.es-BnINGy_Y.js";var tt=function(){var e=o(function(M,t,s,i){for(s=s||{},i=M.length;i--;s[M[i]]=t);return s},"o"),h=[1,4],r=[1,14],a=[1,12],l=[1,13],y=[6,7,8],f=[1,20],d=[1,18],m=[1,19],c=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],b=[1,6,7,11,13,14],N={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:o(function(t,s,i,u,p,n,v){var w=n.length-1;switch(p){case 6:case 7:return u;case 15:u.addNode(n[w-1].length,n[w].trim());break;case 16:u.addNode(0,n[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:r,7:[1,10],9:9,12:11,13:a,14:l},e(y,[2,3]),{1:[2,2]},e(y,[2,4]),e(y,[2,5]),{1:[2,6],6:r,12:15,13:a,14:l},{6:r,9:16,12:11,13:a,14:l},{6:f,7:d,10:17,11:m},e(c,[2,18],{14:[1,21]}),e(c,[2,16]),e(c,[2,17]),{6:f,7:d,10:22,11:m},{1:[2,7],6:r,12:15,13:a,14:l},e(k,[2,14],{7:g,11:_}),e(b,[2,8]),e(b,[2,9]),e(b,[2,10]),e(c,[2,15]),e(k,[2,13],{7:g,11:_}),e(b,[2,11]),e(b,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(t,s){if(s.recoverable)this.trace(t);else{var i=new Error(t);throw i.hash=s,i}},"parseError"),parse:o(function(t){var s=this,i=[0],u=[],p=[null],n=[],v=this.table,w="",I=0,S=0,L=2,E=1,R=n.slice.call(arguments,1),x=Object.create(this.lexer),C={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(C.yy[F]=this.yy[F]);x.setInput(t,C.yy),C.yy.lexer=x,C.yy.parser=this,typeof x.yylloc>"u"&&(x.yylloc={});var T=x.yylloc;n.push(T);var D=x.options&&x.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function j(P){i.length=i.length-2*P,p.length=p.length-P,n.length=n.length-P}o(j,"popStack");function z(){var P;return P=u.pop()||x.lex()||E,typeof P!="number"&&(P instanceof Array&&(u=P,P=u.pop()),P=s.symbols_[P]||P),P}o(z,"lex");for(var A,W,B,Q,H={},Z,V,et,X;;){if(W=i[i.length-1],this.defaultActions[W]?B=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=z()),B=v[W]&&v[W][A]),typeof B>"u"||!B.length||!B[0]){var q="";X=[];for(Z in v[W])this.terminals_[Z]&&Z>L&&X.push("'"+this.terminals_[Z]+"'");x.showPosition?q="Parse error on line "+(I+1)+`: `+x.showPosition()+` Expecting `+X.join(", ")+", got '"+(this.terminals_[A]||A)+"'":q="Parse error on line "+(I+1)+": Unexpected "+(A==E?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(q,{text:x.match,token:this.terminals_[A]||A,line:x.yylineno,loc:T,expected:X})}if(B[0]instanceof Array&&B.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+A);switch(B[0]){case 1:i.push(A),p.push(x.yytext),n.push(x.yylloc),i.push(B[1]),A=null,S=x.yyleng,w=x.yytext,I=x.yylineno,T=x.yylloc;break;case 2:if(V=this.productions_[B[1]][1],H.$=p[p.length-V],H._$={first_line:n[n.length-(V||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(V||1)].first_column,last_column:n[n.length-1].last_column},D&&(H._$.range=[n[n.length-(V||1)].range[0],n[n.length-1].range[1]]),Q=this.performAction.apply(H,[w,S,I,C.yy,B[1],p,n].concat(R)),typeof Q<"u")return Q;V&&(i=i.slice(0,-1*V*2),p=p.slice(0,-1*V),n=n.slice(0,-1*V)),i.push(this.productions_[B[1]][0]),p.push(H.$),n.push(H._$),et=v[i[i.length-2]][i[i.length-1]],i.push(et);break;case 3:return!0}}return!0},"parse")},O=function(){var M={EOF:1,parseError:o(function(s,i){if(this.yy.parser)this.yy.parser.parseError(s,i);else throw new Error(s)},"parseError"),setInput:o(function(t,s){return this.yy=s||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var s=t.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:o(function(t){var s=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var u=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===u.length?this.yylloc.first_column:0)+u[u.length-i.length].length-i[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(t){this.unput(this.match.slice(t))},"less"),pastInput:o(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var t=this.pastInput(),s=new Array(t.length+1).join("-");return t+this.upcomingInput()+` diff --git a/veadk/webui/assets/visualizations/mermaid/journeyDiagram-NVQOT4AX-D1RTQQch.js b/veadk/webui/assets/visualizations/mermaid/journeyDiagram-NVQOT4AX-7MLSoqp5.js similarity index 98% rename from veadk/webui/assets/visualizations/mermaid/journeyDiagram-NVQOT4AX-D1RTQQch.js rename to veadk/webui/assets/visualizations/mermaid/journeyDiagram-NVQOT4AX-7MLSoqp5.js index 180885484..5655efc23 100644 --- a/veadk/webui/assets/visualizations/mermaid/journeyDiagram-NVQOT4AX-D1RTQQch.js +++ b/veadk/webui/assets/visualizations/mermaid/journeyDiagram-NVQOT4AX-7MLSoqp5.js @@ -1,4 +1,4 @@ -import{g as gt}from"./chunk-5VM5RSS4-BDBKcK2Z.js";import{d as mt,g as lt,f as xt,e as kt}from"./chunk-2GRJ4B5K-CvII-2ZL.js";import{V as _t,aQ as vt,W as bt,aR as wt,$ as Tt,aT as St,a as s,Y as R,B as $t,s as Mt}from"./mermaid.core-y4TF8bTw.js";import{aG as X}from"../../app/index-BNPwMQXG.js";import{d as it}from"../../chunks/arc-fsSJ4XQX.js";import"../../chunks/purify.es-BnINGy_Y.js";var U=function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,K=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,W;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var G="";W=[];for(N in v[A])this.terminals_[N]&&N>yt&&W.push("'"+this.terminals_[N]+"'");_.showPosition?G="Parse error on line "+(C+1)+`: +import{g as gt}from"./chunk-5VM5RSS4-BKHSrXIw.js";import{d as mt,g as lt,f as xt,e as kt}from"./chunk-2GRJ4B5K-BNT0kar4.js";import{V as _t,aQ as vt,W as bt,aR as wt,$ as Tt,aT as St,a as s,Y as R,B as $t,s as Mt}from"./mermaid.core-DAx4nvmm.js";import{aG as X}from"../../app/index-8JtvDNuA.js";import{d as it}from"../../chunks/arc-B85TaV_o.js";import"../../chunks/purify.es-BnINGy_Y.js";var U=function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,K=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,W;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var G="";W=[];for(N in v[A])this.terminals_[N]&&N>yt&&W.push("'"+this.terminals_[N]+"'");_.showPosition?G="Parse error on line "+(C+1)+`: `+_.showPosition()+` Expecting `+W.join(", ")+", got '"+(this.terminals_[b]||b)+"'":G="Parse error on line "+(C+1)+": Unexpected "+(b==D?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(G,{text:_.match,token:this.terminals_[b]||b,line:_.yylineno,loc:Y,expected:W})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+A+", token: "+b);switch(T[0]){case 1:l.push(b),d.push(_.yytext),c.push(_.yylloc),l.push(T[1]),b=null,K=_.yyleng,k=_.yytext,C=_.yylineno,Y=_.yylloc;break;case 2:if(M=this.productions_[T[1]][1],F.$=d[d.length-M],F._$={first_line:c[c.length-(M||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(M||1)].first_column,last_column:c[c.length-1].last_column},ft&&(F._$.range=[c[c.length-(M||1)].range[0],c[c.length-1].range[1]]),q=this.performAction.apply(F,[k,K,C,I.yy,T[1],d,c].concat(dt)),typeof q<"u")return q;M&&(l=l.slice(0,-1*M*2),d=d.slice(0,-1*M),c=c.slice(0,-1*M)),l.push(this.productions_[T[1]][0]),d.push(F.$),c.push(F._$),et=v[l[l.length-2]][l[l.length-1]],l.push(et);break;case 3:return!0}}return!0},"parse")},m=function(){var h={EOF:1,parseError:s(function(n,l){if(this.yy.parser)this.yy.parser.parseError(n,l);else throw new Error(n)},"parseError"),setInput:s(function(r,n){return this.yy=n||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:s(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var n=r.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:s(function(r){var n=r.length,l=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var d=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===y.length?this.yylloc.first_column:0)+y[y.length-l.length].length-l[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:s(function(r){this.unput(this.match.slice(r))},"less"),pastInput:s(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s(function(){var r=this.pastInput(),n=new Array(r.length+1).join("-");return r+this.upcomingInput()+` diff --git a/veadk/webui/assets/visualizations/mermaid/kanban-definition-27J2QSJJ-C8voMCH4.js b/veadk/webui/assets/visualizations/mermaid/kanban-definition-27J2QSJJ-L7GQgpCH.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/kanban-definition-27J2QSJJ-C8voMCH4.js rename to veadk/webui/assets/visualizations/mermaid/kanban-definition-27J2QSJJ-L7GQgpCH.js index bfdaf811e..478cce965 100644 --- a/veadk/webui/assets/visualizations/mermaid/kanban-definition-27J2QSJJ-C8voMCH4.js +++ b/veadk/webui/assets/visualizations/mermaid/kanban-definition-27J2QSJJ-L7GQgpCH.js @@ -1,4 +1,4 @@ -import{a as c,at as te,Y as W,aP as fe,ad as ye,ag as be,aG as me,aW as ke,O as K,aN as F,as as Ee,J as _e,ak as Se,ap as le,H as ce}from"./mermaid.core-y4TF8bTw.js";import{g as Ne}from"./chunk-5VM5RSS4-BDBKcK2Z.js";import"../../app/index-BNPwMQXG.js";import"../../chunks/purify.es-BnINGy_Y.js";var $=function(){var t=c(function(k,s,n,a){for(n=n||{},a=k.length;a--;n[k[a]]=s);return n},"o"),g=[1,4],d=[1,13],r=[1,12],p=[1,15],E=[1,16],f=[1,20],h=[1,19],L=[6,7,8],C=[1,26],w=[1,24],N=[1,25],i=[6,7,11],H=[1,31],x=[6,7,11,24],P=[1,6,13,16,17,20,23],M=[1,35],U=[1,36],A=[1,6,7,11,13,16,17,20,23],j=[1,38],V={trace:c(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:c(function(s,n,a,o,u,e,B){var l=e.length-1;switch(u){case 6:case 7:return o;case 8:o.getLogger().trace("Stop NL ");break;case 9:o.getLogger().trace("Stop EOF ");break;case 11:o.getLogger().trace("Stop NL2 ");break;case 12:o.getLogger().trace("Stop EOF2 ");break;case 15:o.getLogger().info("Node: ",e[l-1].id),o.addNode(e[l-2].length,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 16:o.getLogger().info("Node: ",e[l].id),o.addNode(e[l-1].length,e[l].id,e[l].descr,e[l].type);break;case 17:o.getLogger().trace("Icon: ",e[l]),o.decorateNode({icon:e[l]});break;case 18:case 23:o.decorateNode({class:e[l]});break;case 19:o.getLogger().trace("SPACELIST");break;case 20:o.getLogger().trace("Node: ",e[l-1].id),o.addNode(0,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 21:o.getLogger().trace("Node: ",e[l].id),o.addNode(0,e[l].id,e[l].descr,e[l].type);break;case 22:o.decorateNode({icon:e[l]});break;case 27:o.getLogger().trace("node found ..",e[l-2]),this.$={id:e[l-1],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 28:this.$={id:e[l],descr:e[l],type:0};break;case 29:o.getLogger().trace("node found ..",e[l-3]),this.$={id:e[l-3],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 30:this.$=e[l-1]+e[l];break;case 31:this.$=e[l];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:g},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:g},{6:d,7:[1,10],9:9,12:11,13:r,14:14,16:p,17:E,18:17,19:18,20:f,23:h},t(L,[2,3]),{1:[2,2]},t(L,[2,4]),t(L,[2,5]),{1:[2,6],6:d,12:21,13:r,14:14,16:p,17:E,18:17,19:18,20:f,23:h},{6:d,9:22,12:11,13:r,14:14,16:p,17:E,18:17,19:18,20:f,23:h},{6:C,7:w,10:23,11:N},t(i,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:f,23:h}),t(i,[2,19]),t(i,[2,21],{15:30,24:H}),t(i,[2,22]),t(i,[2,23]),t(x,[2,25]),t(x,[2,26]),t(x,[2,28],{20:[1,32]}),{21:[1,33]},{6:C,7:w,10:34,11:N},{1:[2,7],6:d,12:21,13:r,14:14,16:p,17:E,18:17,19:18,20:f,23:h},t(P,[2,14],{7:M,11:U}),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(i,[2,16],{15:37,24:H}),t(i,[2,17]),t(i,[2,18]),t(i,[2,20],{24:j}),t(x,[2,31]),{21:[1,39]},{22:[1,40]},t(P,[2,13],{7:M,11:U}),t(A,[2,11]),t(A,[2,12]),t(i,[2,15],{24:j}),t(x,[2,30]),{22:[1,41]},t(x,[2,27]),t(x,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:c(function(s,n){if(n.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=n,a}},"parseError"),parse:c(function(s){var n=this,a=[0],o=[],u=[null],e=[],B=this.table,l="",z=0,ie=0,ue=2,re=1,ge=e.slice.call(arguments,1),m=Object.create(this.lexer),T={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(T.yy[J]=this.yy[J]);m.setInput(s,T.yy),T.yy.lexer=m,T.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var q=m.yylloc;e.push(q);var de=m.options&&m.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){a.length=a.length-2*S,u.length=u.length-S,e.length=e.length-S}c(pe,"popStack");function ae(){var S;return S=o.pop()||m.lex()||re,typeof S!="number"&&(S instanceof Array&&(o=S,S=o.pop()),S=n.symbols_[S]||S),S}c(ae,"lex");for(var _,R,v,Q,G={},X,I,oe,Y;;){if(R=a[a.length-1],this.defaultActions[R]?v=this.defaultActions[R]:((_===null||typeof _>"u")&&(_=ae()),v=B[R]&&B[R][_]),typeof v>"u"||!v.length||!v[0]){var Z="";Y=[];for(X in B[R])this.terminals_[X]&&X>ue&&Y.push("'"+this.terminals_[X]+"'");m.showPosition?Z="Parse error on line "+(z+1)+`: +import{a as c,at as te,Y as W,aP as fe,ad as ye,ag as be,aG as me,aW as ke,O as K,aN as F,as as Ee,J as _e,ak as Se,ap as le,H as ce}from"./mermaid.core-DAx4nvmm.js";import{g as Ne}from"./chunk-5VM5RSS4-BKHSrXIw.js";import"../../app/index-8JtvDNuA.js";import"../../chunks/purify.es-BnINGy_Y.js";var $=function(){var t=c(function(k,s,n,a){for(n=n||{},a=k.length;a--;n[k[a]]=s);return n},"o"),g=[1,4],d=[1,13],r=[1,12],p=[1,15],E=[1,16],f=[1,20],h=[1,19],L=[6,7,8],C=[1,26],w=[1,24],N=[1,25],i=[6,7,11],H=[1,31],x=[6,7,11,24],P=[1,6,13,16,17,20,23],M=[1,35],U=[1,36],A=[1,6,7,11,13,16,17,20,23],j=[1,38],V={trace:c(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:c(function(s,n,a,o,u,e,B){var l=e.length-1;switch(u){case 6:case 7:return o;case 8:o.getLogger().trace("Stop NL ");break;case 9:o.getLogger().trace("Stop EOF ");break;case 11:o.getLogger().trace("Stop NL2 ");break;case 12:o.getLogger().trace("Stop EOF2 ");break;case 15:o.getLogger().info("Node: ",e[l-1].id),o.addNode(e[l-2].length,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 16:o.getLogger().info("Node: ",e[l].id),o.addNode(e[l-1].length,e[l].id,e[l].descr,e[l].type);break;case 17:o.getLogger().trace("Icon: ",e[l]),o.decorateNode({icon:e[l]});break;case 18:case 23:o.decorateNode({class:e[l]});break;case 19:o.getLogger().trace("SPACELIST");break;case 20:o.getLogger().trace("Node: ",e[l-1].id),o.addNode(0,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 21:o.getLogger().trace("Node: ",e[l].id),o.addNode(0,e[l].id,e[l].descr,e[l].type);break;case 22:o.decorateNode({icon:e[l]});break;case 27:o.getLogger().trace("node found ..",e[l-2]),this.$={id:e[l-1],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 28:this.$={id:e[l],descr:e[l],type:0};break;case 29:o.getLogger().trace("node found ..",e[l-3]),this.$={id:e[l-3],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 30:this.$=e[l-1]+e[l];break;case 31:this.$=e[l];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:g},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:g},{6:d,7:[1,10],9:9,12:11,13:r,14:14,16:p,17:E,18:17,19:18,20:f,23:h},t(L,[2,3]),{1:[2,2]},t(L,[2,4]),t(L,[2,5]),{1:[2,6],6:d,12:21,13:r,14:14,16:p,17:E,18:17,19:18,20:f,23:h},{6:d,9:22,12:11,13:r,14:14,16:p,17:E,18:17,19:18,20:f,23:h},{6:C,7:w,10:23,11:N},t(i,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:f,23:h}),t(i,[2,19]),t(i,[2,21],{15:30,24:H}),t(i,[2,22]),t(i,[2,23]),t(x,[2,25]),t(x,[2,26]),t(x,[2,28],{20:[1,32]}),{21:[1,33]},{6:C,7:w,10:34,11:N},{1:[2,7],6:d,12:21,13:r,14:14,16:p,17:E,18:17,19:18,20:f,23:h},t(P,[2,14],{7:M,11:U}),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(i,[2,16],{15:37,24:H}),t(i,[2,17]),t(i,[2,18]),t(i,[2,20],{24:j}),t(x,[2,31]),{21:[1,39]},{22:[1,40]},t(P,[2,13],{7:M,11:U}),t(A,[2,11]),t(A,[2,12]),t(i,[2,15],{24:j}),t(x,[2,30]),{22:[1,41]},t(x,[2,27]),t(x,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:c(function(s,n){if(n.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=n,a}},"parseError"),parse:c(function(s){var n=this,a=[0],o=[],u=[null],e=[],B=this.table,l="",z=0,ie=0,ue=2,re=1,ge=e.slice.call(arguments,1),m=Object.create(this.lexer),T={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(T.yy[J]=this.yy[J]);m.setInput(s,T.yy),T.yy.lexer=m,T.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var q=m.yylloc;e.push(q);var de=m.options&&m.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){a.length=a.length-2*S,u.length=u.length-S,e.length=e.length-S}c(pe,"popStack");function ae(){var S;return S=o.pop()||m.lex()||re,typeof S!="number"&&(S instanceof Array&&(o=S,S=o.pop()),S=n.symbols_[S]||S),S}c(ae,"lex");for(var _,R,v,Q,G={},X,I,oe,Y;;){if(R=a[a.length-1],this.defaultActions[R]?v=this.defaultActions[R]:((_===null||typeof _>"u")&&(_=ae()),v=B[R]&&B[R][_]),typeof v>"u"||!v.length||!v[0]){var Z="";Y=[];for(X in B[R])this.terminals_[X]&&X>ue&&Y.push("'"+this.terminals_[X]+"'");m.showPosition?Z="Parse error on line "+(z+1)+`: `+m.showPosition()+` Expecting `+Y.join(", ")+", got '"+(this.terminals_[_]||_)+"'":Z="Parse error on line "+(z+1)+": Unexpected "+(_==re?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(Z,{text:m.match,token:this.terminals_[_]||_,line:m.yylineno,loc:q,expected:Y})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+R+", token: "+_);switch(v[0]){case 1:a.push(_),u.push(m.yytext),e.push(m.yylloc),a.push(v[1]),_=null,ie=m.yyleng,l=m.yytext,z=m.yylineno,q=m.yylloc;break;case 2:if(I=this.productions_[v[1]][1],G.$=u[u.length-I],G._$={first_line:e[e.length-(I||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(I||1)].first_column,last_column:e[e.length-1].last_column},de&&(G._$.range=[e[e.length-(I||1)].range[0],e[e.length-1].range[1]]),Q=this.performAction.apply(G,[l,ie,z,T.yy,v[1],u,e].concat(ge)),typeof Q<"u")return Q;I&&(a=a.slice(0,-1*I*2),u=u.slice(0,-1*I),e=e.slice(0,-1*I)),a.push(this.productions_[v[1]][0]),u.push(G.$),e.push(G._$),oe=B[a[a.length-2]][a[a.length-1]],a.push(oe);break;case 3:return!0}}return!0},"parse")},y=function(){var k={EOF:1,parseError:c(function(n,a){if(this.yy.parser)this.yy.parser.parseError(n,a);else throw new Error(n)},"parseError"),setInput:c(function(s,n){return this.yy=n||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:c(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var n=s.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:c(function(s){var n=s.length,a=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var o=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var u=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===o.length?this.yylloc.first_column:0)+o[o.length-a.length].length-a[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:c(function(){return this._more=!0,this},"more"),reject:c(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:c(function(s){this.unput(this.match.slice(s))},"less"),pastInput:c(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:c(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:c(function(){var s=this.pastInput(),n=new Array(s.length+1).join("-");return s+this.upcomingInput()+` diff --git a/veadk/webui/assets/visualizations/mermaid/mermaid.core-y4TF8bTw.js b/veadk/webui/assets/visualizations/mermaid/mermaid.core-DAx4nvmm.js similarity index 98% rename from veadk/webui/assets/visualizations/mermaid/mermaid.core-y4TF8bTw.js rename to veadk/webui/assets/visualizations/mermaid/mermaid.core-DAx4nvmm.js index 75ae25f4b..82d07c1ee 100644 --- a/veadk/webui/assets/visualizations/mermaid/mermaid.core-y4TF8bTw.js +++ b/veadk/webui/assets/visualizations/mermaid/mermaid.core-DAx4nvmm.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/visualizations/mermaid/dagre-VZM6K2ZE-shxLHn3p.js","assets/visualizations/mermaid/chunk-RYQCIY6F-DL3iLUXF.js","assets/chunks/graph-Dqkl27Ch.js","assets/chunks/map-8WAJQ6ap.js","assets/chunks/layout-B6FSD_Du.js","assets/app/index-BNPwMQXG.js","assets/styles/index-_lutWX9f.css","assets/chunks/purify.es-BnINGy_Y.js","assets/visualizations/mermaid/swimlanes-SLNWSIFB-DEO6uzPS.js","assets/visualizations/mermaid/cose-bilkent-JH36ORCC-BNlKHYzG.js","assets/chunks/cytoscape.esm-Dz9tvMTw.js","assets/visualizations/mermaid/c4Diagram-5PPSVZJV-CJepdaIg.js","assets/visualizations/mermaid/chunk-2GRJ4B5K-CvII-2ZL.js","assets/visualizations/mermaid/flowDiagram-UKHOOZJN-BtIca__0.js","assets/visualizations/mermaid/chunk-5VM5RSS4-BDBKcK2Z.js","assets/visualizations/mermaid/chunk-XXDRQBXY-B8qTF1qQ.js","assets/visualizations/mermaid/chunk-KBJHAD2P-DtNDDRN1.js","assets/chunks/channel-Bbp-1bKw.js","assets/visualizations/mermaid/swimlanesDiagram-ULZ7WXOC-DIP88zHc.js","assets/visualizations/mermaid/erDiagram-JOGREHBK-CKTuwmcS.js","assets/visualizations/mermaid/gitGraphDiagram-DS77QQ5N-DupWgFfq.js","assets/visualizations/mermaid/chunk-2Q5K7J3B-nvFjhS5b.js","assets/visualizations/mermaid/chunk-JWPE2WC7-DD-BFVC6.js","assets/visualizations/mermaid/cynefin-OW5HDTMX-DBq9B5VP.js","assets/visualizations/mermaid/ganttDiagram-PKOTCBZU-BsTpL-yb.js","assets/chunks/linear-Dd6OAXqp.js","assets/chunks/init-Gi6I4Gst.js","assets/chunks/defaultLocale-CrowFXzY.js","assets/visualizations/mermaid/infoDiagram-6WML65LV-Dl6zW5rI.js","assets/visualizations/mermaid/pieDiagram-7S7Q4E2Y-B1kVpjEf.js","assets/chunks/arc-fsSJ4XQX.js","assets/chunks/ordinal-Cboi1Yqb.js","assets/visualizations/mermaid/quadrantDiagram-CIZ2JOQS-Ce1mswm1.js","assets/visualizations/mermaid/xychartDiagram-ELKLHX3M-Cqf4o1Vh.js","assets/visualizations/mermaid/requirementDiagram-LRYGKXZP-BMkVtH2s.js","assets/visualizations/mermaid/sequenceDiagram-SI44F4Z6-D6lfXAnD.js","assets/visualizations/mermaid/classDiagram-JCYQIIEL-DtPkX3wA.js","assets/visualizations/mermaid/chunk-GF5L2VYU-Cv1ZgaH8.js","assets/visualizations/mermaid/classDiagram-v2-OCEON4UE-DtPkX3wA.js","assets/visualizations/mermaid/stateDiagram-OKZ733FA-CPFdYVIx.js","assets/visualizations/mermaid/chunk-5RXB4S5H-CY1YEJD3.js","assets/visualizations/mermaid/stateDiagram-v2-UEYNNEHI-CBC6HwPm.js","assets/visualizations/mermaid/journeyDiagram-NVQOT4AX-D1RTQQch.js","assets/visualizations/mermaid/timeline-definition-Z64GVDOM-CKcwRGgc.js","assets/visualizations/mermaid/mindmap-definition-FAOFIHXS-oi9y3HSE.js","assets/visualizations/mermaid/kanban-definition-27J2QSJJ-C8voMCH4.js","assets/visualizations/mermaid/sankeyDiagram-W5VNT64P-gHIvLiGA.js","assets/visualizations/mermaid/diagram-LBJQPF4R-BZA2jWUX.js","assets/visualizations/mermaid/diagram-UB23O5K3-2zSFzlV6.js","assets/visualizations/mermaid/blockDiagram-VBNYF7ZC-BAJbaVfQ.js","assets/visualizations/mermaid/diagram-7IWD3JNH-C3mTV4cL.js","assets/visualizations/mermaid/architectureDiagram-T3A2C74G-C47wDTji.js","assets/visualizations/mermaid/diagram-B4RE2ZJO-D66216sR.js","assets/visualizations/mermaid/ishikawaDiagram-WSZJBQD7-NBIjIwSA.js","assets/visualizations/mermaid/vennDiagram-T6HMQDX7-DpGQcsH1.js","assets/visualizations/mermaid/diagram-Q27KOJAE-Cpjz8RT3.js","assets/visualizations/mermaid/wardleyDiagram-T6FBY63Y-CUlxVcoQ.js","assets/visualizations/mermaid/cynefinDiagram-MW4NZA55-DScg9_Ly.js","assets/visualizations/mermaid/railroadDiagram-AXF67PYL-VReUdmSC.js","assets/visualizations/mermaid/chunk-6Q2QTUOP-zEQK1XLO.js","assets/visualizations/mermaid/ebnfDiagram-BXEA7PRR-_XPQYYfQ.js","assets/visualizations/mermaid/abnfDiagram-N423BO3Z-RhYMe2zl.js","assets/visualizations/mermaid/pegDiagram-VL7TDLO6-CYzndrT-.js"])))=>i.map(i=>d[i]); -var gg=Object.defineProperty;var pg=(e,t,r)=>t in e?gg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var xt=(e,t,r)=>pg(e,typeof t!="symbol"?t+"":t,r);import{ad as fg,U as mg,_ as ht,aG as ct}from"../../app/index-BNPwMQXG.js";import fr from"../../chunks/purify.es-BnINGy_Y.js";var pl=Object.defineProperty,p=(e,t)=>pl(e,"name",{value:t,configurable:!0}),yg=(e,t)=>{for(var r in t)pl(e,r,{get:t[r],enumerable:!0})},fl={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(mg,function(){var r=1e3,i=6e4,s=36e5,a="millisecond",o="second",l="minute",n="hour",c="day",h="week",d="month",g="quarter",u="year",y="date",f="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,C=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function($){var F=["th","st","nd","rd"],_=$%100;return"["+$+(F[(_-20)%10]||F[_]||F[0])+"]"}},k=function($,F,_){var E=String($);return!E||E.length>=F?$:""+Array(F+1-E.length).join(_)+$},S={s:k,z:function($){var F=-$.utcOffset(),_=Math.abs(F),E=Math.floor(_/60),M=_%60;return(F<=0?"+":"-")+k(E,2,"0")+":"+k(M,2,"0")},m:function $(F,_){if(F.date()<_.date())return-$(_,F);var E=12*(_.year()-F.year())+(_.month()-F.month()),M=F.clone().add(E,d),R=_-M<0,N=F.clone().add(E+(R?-1:1),d);return+(-(E+(_-M)/(R?M-N:N-M))||0)},a:function($){return $<0?Math.ceil($)||0:Math.floor($)},p:function($){return{M:d,y:u,w:h,d:c,D:y,h:n,m:l,s:o,ms:a,Q:g}[$]||String($||"").toLowerCase().replace(/s$/,"")},u:function($){return $===void 0}},T="en",w={};w[T]=b;var L="$isDayjsObject",v=function($){return $ instanceof H||!(!$||!$[L])},W=function $(F,_,E){var M;if(!F)return T;if(typeof F=="string"){var R=F.toLowerCase();w[R]&&(M=R),_&&(w[R]=_,M=R);var N=F.split("-");if(!M&&N.length>1)return $(N[0])}else{var U=F.name;w[U]=F,M=U}return!E&&M&&(T=M),M||!E&&T},P=function($,F){if(v($))return $.clone();var _=typeof F=="object"?F:{};return _.date=$,_.args=arguments,new H(_)},A=S;A.l=W,A.i=v,A.w=function($,F){return P($,{locale:F.$L,utc:F.$u,x:F.$x,$offset:F.$offset})};var H=function(){function $(_){this.$L=W(_.locale,null,!0),this.parse(_),this.$x=this.$x||_.x||{},this[L]=!0}var F=$.prototype;return F.parse=function(_){this.$d=function(E){var M=E.date,R=E.utc;if(M===null)return new Date(NaN);if(A.u(M))return new Date;if(M instanceof Date)return new Date(M);if(typeof M=="string"&&!/Z$/i.test(M)){var N=M.match(m);if(N){var U=N[2]-1||0,Z=(N[7]||"0").substring(0,3);return R?new Date(Date.UTC(N[1],U,N[3]||1,N[4]||0,N[5]||0,N[6]||0,Z)):new Date(N[1],U,N[3]||1,N[4]||0,N[5]||0,N[6]||0,Z)}}return new Date(M)}(_),this.init()},F.init=function(){var _=this.$d;this.$y=_.getFullYear(),this.$M=_.getMonth(),this.$D=_.getDate(),this.$W=_.getDay(),this.$H=_.getHours(),this.$m=_.getMinutes(),this.$s=_.getSeconds(),this.$ms=_.getMilliseconds()},F.$utils=function(){return A},F.isValid=function(){return this.$d.toString()!==f},F.isSame=function(_,E){var M=P(_);return this.startOf(E)<=M&&M<=this.endOf(E)},F.isAfter=function(_,E){return P(_){},"trace"),debug:p((...e)=>{},"debug"),info:p((...e)=>{},"info"),warn:p((...e)=>{},"warn"),error:p((...e)=>{},"error"),fatal:p((...e)=>{},"fatal")},ua=p(function(e="fatal"){let t=ue.fatal;typeof e=="string"?e.toLowerCase()in ue&&(t=ue[e]):typeof e=="number"&&(t=e),z.trace=()=>{},z.debug=()=>{},z.info=()=>{},z.warn=()=>{},z.error=()=>{},z.fatal=()=>{},t<=ue.fatal&&(z.fatal=console.error?console.error.bind(console,Xt("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",Xt("FATAL"))),t<=ue.error&&(z.error=console.error?console.error.bind(console,Xt("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",Xt("ERROR"))),t<=ue.warn&&(z.warn=console.warn?console.warn.bind(console,Xt("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",Xt("WARN"))),t<=ue.info&&(z.info=console.info?console.info.bind(console,Xt("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",Xt("INFO"))),t<=ue.debug&&(z.debug=console.debug?console.debug.bind(console,Xt("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Xt("DEBUG"))),t<=ue.trace&&(z.trace=console.debug?console.debug.bind(console,Xt("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Xt("TRACE")))},"setLogLevel"),Xt=p(e=>`%c${xg().format("ss.SSS")} : ${e} : `,"format");const di={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:e=>e>=255?255:e<0?0:e,g:e=>e>=255?255:e<0?0:e,b:e=>e>=255?255:e<0?0:e,h:e=>e%360,s:e=>e>=100?100:e<0?0:e,l:e=>e>=100?100:e<0?0:e,a:e=>e>=1?1:e<0?0:e},toLinear:e=>{const t=e/255;return e>.03928?Math.pow((t+.055)/1.055,2.4):t/12.92},hue2rgb:(e,t,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e),hsl2rgb:({h:e,s:t,l:r},i)=>{if(!t)return r*2.55;e/=360,t/=100,r/=100;const s=r<.5?r*(1+t):r+t-r*t,a=2*r-s;switch(i){case"r":return di.hue2rgb(a,s,e+1/3)*255;case"g":return di.hue2rgb(a,s,e)*255;case"b":return di.hue2rgb(a,s,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:r},i)=>{e/=255,t/=255,r/=255;const s=Math.max(e,t,r),a=Math.min(e,t,r),o=(s+a)/2;if(i==="l")return o*100;if(s===a)return 0;const l=s-a,n=o>.5?l/(2-s-a):l/(s+a);if(i==="s")return n*100;switch(s){case e:return((t-r)/l+(tt>r?Math.min(t,Math.max(r,e)):Math.min(r,Math.max(t,e)),round:e=>Math.round(e*1e10)/1e10},kg={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},nt={channel:di,lang:bg,unit:kg},xe={};for(let e=0;e<=255;e++)xe[e]=nt.unit.dec2hex(e);const Ot={ALL:0,RGB:1,HSL:2};class Sg{constructor(){this.type=Ot.ALL}get(){return this.type}set(t){if(this.type&&this.type!==t)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=t}reset(){this.type=Ot.ALL}is(t){return this.type===t}}class Tg{constructor(t,r){this.color=r,this.changed=!1,this.data=t,this.type=new Sg}set(t,r){return this.color=r,this.changed=!1,this.data=t,this.type.type=Ot.ALL,this}_ensureHSL(){const t=this.data,{h:r,s:i,l:s}=t;r===void 0&&(t.h=nt.channel.rgb2hsl(t,"h")),i===void 0&&(t.s=nt.channel.rgb2hsl(t,"s")),s===void 0&&(t.l=nt.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r,g:i,b:s}=t;r===void 0&&(t.r=nt.channel.hsl2rgb(t,"r")),i===void 0&&(t.g=nt.channel.hsl2rgb(t,"g")),s===void 0&&(t.b=nt.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,r=t.r;return!this.type.is(Ot.HSL)&&r!==void 0?r:(this._ensureHSL(),nt.channel.hsl2rgb(t,"r"))}get g(){const t=this.data,r=t.g;return!this.type.is(Ot.HSL)&&r!==void 0?r:(this._ensureHSL(),nt.channel.hsl2rgb(t,"g"))}get b(){const t=this.data,r=t.b;return!this.type.is(Ot.HSL)&&r!==void 0?r:(this._ensureHSL(),nt.channel.hsl2rgb(t,"b"))}get h(){const t=this.data,r=t.h;return!this.type.is(Ot.RGB)&&r!==void 0?r:(this._ensureRGB(),nt.channel.rgb2hsl(t,"h"))}get s(){const t=this.data,r=t.s;return!this.type.is(Ot.RGB)&&r!==void 0?r:(this._ensureRGB(),nt.channel.rgb2hsl(t,"s"))}get l(){const t=this.data,r=t.l;return!this.type.is(Ot.RGB)&&r!==void 0?r:(this._ensureRGB(),nt.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(Ot.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(Ot.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(Ot.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(Ot.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(Ot.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(Ot.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}const Ui=new Tg({r:0,g:0,b:0,a:0},"transparent"),Je={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(Je.re);if(!t)return;const r=t[1],i=parseInt(r,16),s=r.length,a=s%4===0,o=s>4,l=o?1:17,n=o?8:4,c=a?0:-1,h=o?255:15;return Ui.set({r:(i>>n*(c+3)&h)*l,g:(i>>n*(c+2)&h)*l,b:(i>>n*(c+1)&h)*l,a:a?(i&h)*l/255:1},e)},stringify:e=>{const{r:t,g:r,b:i,a:s}=e;return s<1?`#${xe[Math.round(t)]}${xe[Math.round(r)]}${xe[Math.round(i)]}${xe[Math.round(s*255)]}`:`#${xe[Math.round(t)]}${xe[Math.round(r)]}${xe[Math.round(i)]}`}},$e={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:e=>{const t=e.match($e.hueRe);if(t){const[,r,i]=t;switch(i){case"grad":return nt.channel.clamp.h(parseFloat(r)*.9);case"rad":return nt.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return nt.channel.clamp.h(parseFloat(r)*360)}}return nt.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const r=e.match($e.re);if(!r)return;const[,i,s,a,o,l]=r;return Ui.set({h:$e._hue2deg(i),s:nt.channel.clamp.s(parseFloat(s)),l:nt.channel.clamp.l(parseFloat(a)),a:o?nt.channel.clamp.a(l?parseFloat(o)/100:parseFloat(o)):1},e)},stringify:e=>{const{h:t,s:r,l:i,a:s}=e;return s<1?`hsla(${nt.lang.round(t)}, ${nt.lang.round(r)}%, ${nt.lang.round(i)}%, ${s})`:`hsl(${nt.lang.round(t)}, ${nt.lang.round(r)}%, ${nt.lang.round(i)}%)`}},Ir={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:e=>{e=e.toLowerCase();const t=Ir.colors[e];if(t)return Je.parse(t)},stringify:e=>{const t=Je.stringify(e);for(const r in Ir.colors)if(Ir.colors[r]===t)return r}},Mr={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:e=>{const t=e.charCodeAt(0);if(t!==114&&t!==82)return;const r=e.match(Mr.re);if(!r)return;const[,i,s,a,o,l,n,c,h]=r;return Ui.set({r:nt.channel.clamp.r(s?parseFloat(i)*2.55:parseFloat(i)),g:nt.channel.clamp.g(o?parseFloat(a)*2.55:parseFloat(a)),b:nt.channel.clamp.b(n?parseFloat(l)*2.55:parseFloat(l)),a:c?nt.channel.clamp.a(h?parseFloat(c)/100:parseFloat(c)):1},e)},stringify:e=>{const{r:t,g:r,b:i,a:s}=e;return s<1?`rgba(${nt.lang.round(t)}, ${nt.lang.round(r)}, ${nt.lang.round(i)}, ${nt.lang.round(s)})`:`rgb(${nt.lang.round(t)}, ${nt.lang.round(r)}, ${nt.lang.round(i)})`}},oe={format:{keyword:Ir,hex:Je,rgb:Mr,rgba:Mr,hsl:$e,hsla:$e},parse:e=>{if(typeof e!="string")return e;const t=Je.parse(e)||Mr.parse(e)||$e.parse(e)||Ir.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(Ot.HSL)||e.data.r===void 0?$e.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?Mr.stringify(e):Je.stringify(e)},ml=(e,t)=>{const r=oe.parse(e);for(const i in t)r[i]=nt.channel.clamp[i](t[i]);return oe.stringify(r)},Se=(e,t,r=0,i=1)=>{if(typeof e!="number")return ml(e,{a:t});const s=Ui.set({r:nt.channel.clamp.r(e),g:nt.channel.clamp.g(t),b:nt.channel.clamp.b(r),a:nt.channel.clamp.a(i)});return oe.stringify(s)},wg=e=>{const{r:t,g:r,b:i}=oe.parse(e),s=.2126*nt.channel.toLinear(t)+.7152*nt.channel.toLinear(r)+.0722*nt.channel.toLinear(i);return nt.lang.round(s)},Bg=e=>wg(e)>=.5,re=e=>!Bg(e),yl=(e,t,r)=>{const i=oe.parse(e),s=i[t],a=nt.channel.clamp[t](s+r);return s!==a&&(i[t]=a),oe.stringify(i)},I=(e,t)=>yl(e,"l",t),D=(e,t)=>yl(e,"l",-t),x=(e,t)=>{const r=oe.parse(e),i={};for(const s in t)t[s]&&(i[s]=r[s]+t[s]);return ml(e,i)},_g=(e,t,r=50)=>{const{r:i,g:s,b:a,a:o}=oe.parse(e),{r:l,g:n,b:c,a:h}=oe.parse(t),d=r/100,g=d*2-1,u=o-h,f=((g*u===-1?g:(g+u)/(1+g*u))+1)/2,m=1-f,C=i*f+l*m,b=s*f+n*m,k=a*f+c*m,S=o*d+h*(1-d);return Se(C,b,k,S)},B=(e,t=100)=>{const r=oe.parse(e);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,_g(r,e,t)};var ks=p((e,t,{depth:r=2}={})=>{const i={depth:r};if(Array.isArray(t)&&!Array.isArray(e))return t.forEach(s=>ks(e,s,i)),e;if(Array.isArray(t)&&Array.isArray(e))return t.forEach(s=>{e.includes(s)||e.push(s)}),e;if(e==null||r<=0)return e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t;if(t!=null&&typeof e=="object"&&typeof t=="object"){const s=e;Object.entries(t).forEach(([a,o])=>{if(typeof o=="object"){if(o===null)return;Object.hasOwn(e,a)||Object.defineProperty(e,a,{value:void 0,writable:!0,enumerable:!0,configurable:!0}),s[a]===void 0&&(s[a]=Array.isArray(o)?[]:{}),typeof s[a]=="object"&&(s[a]=ks(s[a],o,{depth:r-1}))}else typeof s[a]!="object"&&(Object.hasOwn(e,a)?s[a]=o:Object.defineProperty(e,a,{value:o,writable:!0,enumerable:!0,configurable:!0}))})}return e},"assignWithDepth"),Ft=ks,ne="#ffffff",he="#f2f2f2",at=p((e,t)=>t?x(e,{s:-40,l:10}):x(e,{s:-40,l:-10}),"mkBorder"),er,vg=(er=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.useGradient=!0,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){var r,i,s,a,o,l,n,c,h,d,g,u,y,f,m,C,b,k,S,T,w,L,v,W,P,A,H,q,$,F,_,E,M,R,N,U,Z,et,tt,ot,gt,ut,bt,kt,Y,K,dt,ft,O;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||at(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||at(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||at(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?D(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||D(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||I(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||D(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||D(this.mainBkg,10)):(this.rowOdd=this.rowOdd||I(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||I(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.darkMode)for(let lt=0;lt{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(er,"Theme"),er),Lg=p(e=>{const t=new vg;return t.calculate(e),t},"getThemeVariables"),rr,Fg=(rr=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=I(this.primaryColor,16),this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=B(this.background),this.secondaryBorderColor=at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=at(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.tertiaryColor),this.lineColor=B(this.background),this.textColor=B(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=I(B("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Se(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.clusterBkg="#302F3D",this.sectionBkgColor=D("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=D(this.sectionBkgColor,10),this.taskBorderColor=Se(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Se(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||I(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||D(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal"}updateColors(){var t,r,i,s,a,o,l,n,c,h,d,g,u,y,f,m,C,b,k,S,T,w,L,v,W,P,A,H,q,$,F,_,E,M,R,N,U,Z,et,tt,ot,gt,ut,bt,kt,Y,K,dt,ft;this.secondBkg=I(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=I(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.background,this.taskBkgColor=I(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=B(this.doneTaskBkgColor),this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=x(this.primaryColor,{h:64}),this.fillType3=x(this.secondaryColor,{h:64}),this.fillType4=x(this.primaryColor,{h:-64}),this.fillType5=x(this.secondaryColor,{h:-64}),this.fillType6=x(this.primaryColor,{h:128}),this.fillType7=x(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330});for(let O=0;O{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(rr,"Theme"),rr),Mg=p(e=>{const t=new Fg;return t.calculate(e),t},"getThemeVariables"),ir,Ag=(ir=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=x(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=at(this.primaryColor,this.darkMode),this.secondaryBorderColor=at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=at(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.tertiaryColor),this.lineColor=B(this.background),this.textColor=B(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=at(this.primaryColor,this.darkMode),this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.clusterBkg="#FBFBFF",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=Se(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!1,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))",this.updateColors()}updateColors(){var t,r,i,s,a,o,l,n,c,h,d,g,u,y,f,m,C,b,k,S,T,w,L,v,W,P,A,H,q,$,F,_,E,M,R,N,U,Z,et,tt,ot,gt,ut,bt,kt,Y,K,dt,ft;this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||D(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||D(this.tertiaryColor,40);for(let O=0;O{this[i]==="calculated"&&(this[i]=void 0)}),typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(ir,"Theme"),ir),Eg=p(e=>{const t=new Ag;return t.calculate(e),t},"getThemeVariables"),sr,$g=(sr=class{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=I("#cde498",10),this.primaryBorderColor=at(this.primaryColor,this.darkMode),this.secondaryBorderColor=at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=at(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.primaryColor),this.lineColor=B(this.background),this.textColor=B(this.background),this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))"}updateColors(){var t,r,i,s,a,o,l,n,c,h,d,g,u,y,f,m,C,b,k,S,T,w,L,v,W,P,A,H,q,$,F,_,E,M,R,N,U,Z,et,tt,ot,gt,ut,bt,kt,Y,K,dt,ft;this.actorBorder=D(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||D(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||D(this.tertiaryColor,40);for(let O=0;O{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(sr,"Theme"),sr),Og=p(e=>{const t=new $g;return t.calculate(e),t},"getThemeVariables"),ar,Ig=(ar=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=I(this.contrast,55),this.background="#ffffff",this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=at(this.primaryColor,this.darkMode),this.secondaryBorderColor=at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=at(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.tertiaryColor),this.lineColor=B(this.background),this.textColor=B(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.rowOdd=this.rowOdd||I(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){var t,r,i,s,a,o,l,n,c,h,d,g,u,y,f,m,C,b,k,S,T,w,L,v,W,P,A,H,q,$,F,_,E,M,R,N,U,Z,et,tt,ot,gt,ut,bt,kt,Y,K,dt,ft;this.secondBkg=I(this.contrast,55),this.border2=this.contrast,this.actorBorder=I(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let O=0;O{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(ar,"Theme"),ar),Dg=p(e=>{const t=new Ig;return t.calculate(e),t},"getThemeVariables"),or,Pg=(or=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=2,this.primaryBorderColor=at(this.primaryColor,this.darkMode),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.nodeBorder="#000000",this.stateBorder="#000000",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 0px 1px 2px rgba(0, 0, 0, 0.25));",this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){var a,o,l,n,c,h,d,g,u,y,f;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||at(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||at(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||at(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?D(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||D(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=x(t,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||I(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||t,this.cScale1=this.cScale1||r,this.cScale2=this.cScale2||i,this.cScale3=this.cScale3||x(t,{h:30}),this.cScale4=this.cScale4||x(t,{h:60}),this.cScale5=this.cScale5||x(t,{h:90}),this.cScale6=this.cScale6||x(t,{h:120}),this.cScale7=this.cScale7||x(t,{h:150}),this.cScale8=this.cScale8||x(t,{h:210,l:150}),this.cScale9=this.cScale9||x(t,{h:270}),this.cScale10=this.cScale10||x(t,{h:300}),this.cScale11=this.cScale11||x(t,{h:330}),this.darkMode)for(let m=0;m{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(or,"Theme"),or),Rg=p(e=>{const t=new Pg;return t.calculate(e),t},"getThemeVariables"),lr,qg=(lr=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=I(this.primaryColor,16),this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=B(this.background),this.secondaryBorderColor=at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=at(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=I(B("#323D47"),10),this.border1="#ccc",this.border2=Se(255,255,255,.25),this.arrowheadColor=B(this.background),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=1,this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily="arial, sans-serif",this.fontSize="14px",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.2))",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){var r,i,s,a,o,l,n,c,h,d,g;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||at(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||at(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||at(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?D(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||D(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||I(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.darkMode)for(let u=0;u{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(lr,"Theme"),lr),Wg=p(e=>{const t=new qg;return t.calculate(e),t},"getThemeVariables"),nr,zg=(nr=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=at("#28253D",this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.clusterBkg="#F9F9FB",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.filterColor="#000000"}updateColors(){var a,o,l,n,c,h,d,g,u,y,f;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||at(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||at(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||at(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?D(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.noteFontWeight=600,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||D(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=x(t,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||I(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.compositeTitleBackground="#F9F9FB",this.altBackground="#F9F9FB",this.stateEdgeLabelBackground="#FFFFFF",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor;for(let m=0;m{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(nr,"Theme"),nr),Ng=p(e=>{const t=new zg;return t.calculate(e),t},"getThemeVariables"),hr,Hg=(hr=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=I(this.primaryColor,16),this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=B(this.background),this.secondaryBorderColor=at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=at(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=I(B("#323D47"),10),this.border1="#ccc",this.border2=Se(255,255,255,.25),this.arrowheadColor=B(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.filterColor="#FFFFFF"}updateColors(){var r,i,s,a,o,l,n,c,h,d,g;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||at(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||at(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||at(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?D(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||D(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||I(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.compositeBackground="#16141F",this.altBackground="#16141F",this.compositeTitleBackground="#16141F",this.stateEdgeLabelBackground="#16141F",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.darkMode)for(let u=0;u{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(hr,"Theme"),hr),Yg=p(e=>{const t=new Hg;return t.calculate(e),t},"getThemeVariables"),cr,jg=(cr=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=at(this.primaryColor,this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=["#FDF4FF","#F0FDFA","#FFF7ED","#ECFEFF","#F0FDF4","#F5F3FF","#FEF2F2","#FEFCE8","#EEF2FF","#F7FEE7","#F0F9FF","#FFF1F2"],this.filterColor="#000000"}updateColors(){var a,o,l,n,c,h,d,g,u,y,f;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||at(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||at(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||at(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?D(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||D(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=x(t,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||I(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let m=0;m{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(cr,"Theme"),cr),Ug=p(e=>{const t=new jg;return t.calculate(e),t},"getThemeVariables"),dr,Xg=(dr=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=I(this.primaryColor,16),this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=B(this.background),this.secondaryBorderColor=at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=at(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=I(B("#323D47"),10),this.border1="#ccc",this.border2=Se(255,255,255,.25),this.arrowheadColor=B(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=[],this.filterColor="#FFFFFF"}updateColors(){var r,i,s,a,o,l,n,c,h,d,g;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||at(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||at(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||at(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?D(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||D(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.rootLabelColor="#FFFFFF",this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||I(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let u=0;u{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(dr,"Theme"),dr),Gg=p(e=>{const t=new Xg;return t.calculate(e),t},"getThemeVariables"),fe={base:{getThemeVariables:Lg},dark:{getThemeVariables:Mg},default:{getThemeVariables:Eg},forest:{getThemeVariables:Og},neutral:{getThemeVariables:Dg},neo:{getThemeVariables:Rg},"neo-dark":{getThemeVariables:Wg},redux:{getThemeVariables:Ng},"redux-dark":{getThemeVariables:Yg},"redux-color":{getThemeVariables:Ug},"redux-dark-color":{getThemeVariables:Gg}},At={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},swimlane:{useMaxWidth:!0,lineHops:"arc",ignoreCrossLaneEdges:!0,optimizeRanksByCrossings:!0,automaticLaneOrdering:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75,donutHole:0,legendPosition:"right",highlightSlice:""},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showDataLabelOutsideBar:!1,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},ishikawa:{useMaxWidth:!0,diagramPadding:20},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:"",nodeWidth:10,nodePadding:12,labelStyle:"legacy"},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},treeView:{useMaxWidth:!0,rowIndent:10,paddingX:5,paddingY:5,lineThickness:1,showIcons:!1,defaultIconPack:"",filenameIcons:{},extensionIcons:{}},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16,randomize:!1,nodeSeparation:75,idealEdgeLengthMultiplier:1.5,edgeElasticity:.45,numIter:2500,seed:1},eventmodeling:{useMaxWidth:!0,padding:30,rowHeight:32},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},venn:{useMaxWidth:!0,width:800,height:450,padding:8,useDebugLayout:!1},cynefin:{useMaxWidth:!0,width:800,height:600,padding:40,showDomainDescriptions:!0,boundaryAmplitude:8,seed:0},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},Cl={...At,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:fe.default.getThemeVariables(),sequence:{...At.sequence,messageFont:p(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:p(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:p(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...At.gantt,tickInterval:void 0,useWidth:void 0},c4:{...At.c4,useWidth:void 0,personFont:p(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...At.flowchart,inheritDir:!1},external_personFont:p(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:p(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:p(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:p(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:p(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:p(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:p(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:p(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:p(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:p(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:p(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:p(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:p(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:p(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:p(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:p(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:p(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:p(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:p(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:p(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:p(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...At.pie,useWidth:984},xyChart:{...At.xyChart,useWidth:void 0},requirement:{...At.requirement,useWidth:void 0},packet:{...At.packet},eventmodeling:{...At.eventmodeling},treeView:{...At.treeView,useWidth:void 0},radar:{...At.radar},railroad:{...At.railroad,fontSize:void 0,fontFamily:void 0,terminalFill:void 0,terminalStroke:void 0,terminalTextColor:void 0,nonTerminalFill:void 0,nonTerminalStroke:void 0,nonTerminalTextColor:void 0,lineColor:void 0,markerFill:void 0,commentFill:void 0,commentStroke:void 0,commentTextColor:void 0,specialFill:void 0,specialStroke:void 0,ruleNameColor:void 0},ishikawa:{...At.ishikawa},sankey:{...At.sankey,nodeColors:void 0},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","},venn:{...At.venn},cynefin:{...At.cynefin}},xl=p((e,t="")=>Object.keys(e).reduce((r,i)=>Array.isArray(e[i])?r:typeof e[i]=="object"&&e[i]!==null?[...r,t+i,...xl(e[i],"")]:[...r,t+i],[]),"keyify"),Vg=new Set(xl(Cl,"")),bl=Cl,Zg={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},Qg=p((e,t)=>{for(const r of Object.keys(e)){const i=e[r];(r.startsWith("__")||r.includes("proto")||r.includes("constr")||typeof i!="string"||!t.test(i))&&(z.debug("sanitize deleting dictionary entry:",r,i),delete e[r])}},"sanitizeDictionaryConfig"),ki=p(e=>{if(z.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>ki(t));return}for(const t of Object.keys(e)){if(z.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!Vg.has(t)||e[t]==null){z.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){const i=Zg[t];i?Qg(e[t],i):(z.debug("sanitizing object",t),ki(e[t]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const i of r)t.includes(i)&&(z.debug("sanitizing css option",t),e[t]=kl(e[t]))}if(e.themeVariables)for(const t of Object.keys(e.themeVariables)){const r=e.themeVariables[t];r!=null&&r.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(e.themeVariables[t]="")}z.debug("After sanitization",e)}},"sanitizeDirective"),kl=p(e=>{let t=0,r=0;for(const i of e){if(t!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),Ht=Ft({},mr),Si,Pe=[],Dr=Ft({},mr),Vr=p((e,t)=>{let r=Ft({},e),i={};for(const s of t)wl(s),i=Ft(i,s);if(r=Ft(r,i),i.theme&&i.theme in fe){const s=Ft({},Si),a=Ft(s.themeVariables||{},i.themeVariables);r.theme&&r.theme in fe&&(r.themeVariables=fe[r.theme].getThemeVariables(a))}return Dr=r,ip(Dr),Dr},"updateCurrentConfig"),Kg=p(e=>(Ht=Ft({},mr),Ht=Ft(Ht,e),e.theme&&fe[e.theme]&&(Ht.themeVariables=fe[e.theme].getThemeVariables(e.themeVariables)),Vr(Ht,Pe),Ht),"setSiteConfig"),Jg=p(e=>{Si=Ft({},e)},"saveConfigFromInitialize"),tp=p(e=>(Ht=Ft(Ht,e),Vr(Ht,Pe),Ht),"updateSiteConfig"),Sl=p(()=>Ft({},Ht),"getSiteConfig"),Tl=p(e=>(Vr(Dr,[e]),Tt()),"setConfig"),Tt=p(()=>Ft({},Dr),"getConfig"),wl=p(e=>{e&&(["secure",...Ht.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(z.debug(`Denied attempt to modify a secure key ${t}`,e[t]),delete e[t])}),Object.keys(e).forEach(t=>{t.startsWith("__")&&delete e[t]}),Object.keys(e).forEach(t=>{typeof e[t]=="string"&&(e[t].includes("<")||e[t].includes(">")||e[t].includes("url(data:"))&&delete e[t],typeof e[t]=="object"&&wl(e[t])}))},"sanitize"),ep=p(e=>{var t;ki(e),e.fontFamily&&!((t=e.themeVariables)!=null&&t.fontFamily)&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),Pe.push(e),Vr(Ht,Pe)},"addDirective"),Ti=p((e=Ht)=>{Pe=[],Vr(e,Pe)},"reset"),rp={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",FLOWCHART_HTML_LABELS_DEPRECATED:"flowchart.htmlLabels is deprecated. Please use global htmlLabels instead."},no={},Bl=p(e=>{no[e]||(z.warn(rp[e]),no[e]=!0)},"issueWarning"),ip=p(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&Bl("LAZY_LOAD_DEPRECATED")},"checkConfig"),$1=p(()=>{let e={};Si&&(e=Ft(e,Si));for(const t of Pe)e=Ft(e,t);return e},"getUserDefinedConfig"),zt=p(e=>{var t,r;return((t=e.flowchart)==null?void 0:t.htmlLabels)!=null&&Bl("FLOWCHART_HTML_LABELS_DEPRECATED"),ce(e.htmlLabels??((r=e.flowchart)==null?void 0:r.htmlLabels)??!0)},"getEffectiveHtmlLabels"),_l=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,Pr=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,sp=/\s*%%.*\n/gm,ur,vl=(ur=class extends Error{constructor(t){super(t),this.name="UnknownDiagramError"}},p(ur,"UnknownDiagramError"),ur),Re={},ga=p(function(e,t){e=e.replace(_l,"").replace(Pr,"").replace(sp,` +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/visualizations/mermaid/dagre-VZM6K2ZE-PibdEig-.js","assets/visualizations/mermaid/chunk-RYQCIY6F-C3ekePUg.js","assets/chunks/graph-Dqkl27Ch.js","assets/chunks/map-8WAJQ6ap.js","assets/chunks/layout-B6FSD_Du.js","assets/app/index-8JtvDNuA.js","assets/styles/index-_lutWX9f.css","assets/chunks/purify.es-BnINGy_Y.js","assets/visualizations/mermaid/swimlanes-SLNWSIFB-2I6D1dR6.js","assets/visualizations/mermaid/cose-bilkent-JH36ORCC-0QYD6FmW.js","assets/chunks/cytoscape.esm-Dz9tvMTw.js","assets/visualizations/mermaid/c4Diagram-5PPSVZJV-CYvD8vq6.js","assets/visualizations/mermaid/chunk-2GRJ4B5K-BNT0kar4.js","assets/visualizations/mermaid/flowDiagram-UKHOOZJN-DjW8-Nxh.js","assets/visualizations/mermaid/chunk-5VM5RSS4-BKHSrXIw.js","assets/visualizations/mermaid/chunk-XXDRQBXY-BdI3VXTi.js","assets/visualizations/mermaid/chunk-KBJHAD2P-C0rklDe7.js","assets/chunks/channel-B1gj3-V8.js","assets/visualizations/mermaid/swimlanesDiagram-ULZ7WXOC-COw-LLw5.js","assets/visualizations/mermaid/erDiagram-JOGREHBK-54K1t1Ec.js","assets/visualizations/mermaid/gitGraphDiagram-DS77QQ5N-CIVsYAyY.js","assets/visualizations/mermaid/chunk-2Q5K7J3B-BK3jpFNd.js","assets/visualizations/mermaid/chunk-JWPE2WC7-DVlhplzu.js","assets/visualizations/mermaid/cynefin-OW5HDTMX-BHP1Kvyc.js","assets/visualizations/mermaid/ganttDiagram-PKOTCBZU-DYJw_19U.js","assets/chunks/linear-WTltCzEJ.js","assets/chunks/init-Gi6I4Gst.js","assets/chunks/defaultLocale-CrowFXzY.js","assets/visualizations/mermaid/infoDiagram-6WML65LV-D6hoQeyX.js","assets/visualizations/mermaid/pieDiagram-7S7Q4E2Y-VRiU9rtm.js","assets/chunks/arc-B85TaV_o.js","assets/chunks/ordinal-Cboi1Yqb.js","assets/visualizations/mermaid/quadrantDiagram-CIZ2JOQS-JooZIzGd.js","assets/visualizations/mermaid/xychartDiagram-ELKLHX3M-B9DRjIoI.js","assets/visualizations/mermaid/requirementDiagram-LRYGKXZP-CAxqjuVx.js","assets/visualizations/mermaid/sequenceDiagram-SI44F4Z6-CRNvuVv8.js","assets/visualizations/mermaid/classDiagram-JCYQIIEL-DcvvubKo.js","assets/visualizations/mermaid/chunk-GF5L2VYU-IG64zwph.js","assets/visualizations/mermaid/classDiagram-v2-OCEON4UE-DcvvubKo.js","assets/visualizations/mermaid/stateDiagram-OKZ733FA-BvoTa-1C.js","assets/visualizations/mermaid/chunk-5RXB4S5H-Ln4IekMd.js","assets/visualizations/mermaid/stateDiagram-v2-UEYNNEHI-QJ3-Svac.js","assets/visualizations/mermaid/journeyDiagram-NVQOT4AX-7MLSoqp5.js","assets/visualizations/mermaid/timeline-definition-Z64GVDOM-mpZy5ZHk.js","assets/visualizations/mermaid/mindmap-definition-FAOFIHXS-CYwjbq4J.js","assets/visualizations/mermaid/kanban-definition-27J2QSJJ-L7GQgpCH.js","assets/visualizations/mermaid/sankeyDiagram-W5VNT64P-BTjDTukV.js","assets/visualizations/mermaid/diagram-LBJQPF4R-BE5KJAJ0.js","assets/visualizations/mermaid/diagram-UB23O5K3-AYjZ4Axz.js","assets/visualizations/mermaid/blockDiagram-VBNYF7ZC-D4I7ydgD.js","assets/visualizations/mermaid/diagram-7IWD3JNH-cddjCR_8.js","assets/visualizations/mermaid/architectureDiagram-T3A2C74G-ysR-aM43.js","assets/visualizations/mermaid/diagram-B4RE2ZJO-CyMxecTz.js","assets/visualizations/mermaid/ishikawaDiagram-WSZJBQD7-Di5hDQFl.js","assets/visualizations/mermaid/vennDiagram-T6HMQDX7-23c87AQK.js","assets/visualizations/mermaid/diagram-Q27KOJAE-DiL6LnT_.js","assets/visualizations/mermaid/wardleyDiagram-T6FBY63Y-jNpCtSMU.js","assets/visualizations/mermaid/cynefinDiagram-MW4NZA55-DfWTsCcM.js","assets/visualizations/mermaid/railroadDiagram-AXF67PYL-B0NVnjyw.js","assets/visualizations/mermaid/chunk-6Q2QTUOP-N9gzANAs.js","assets/visualizations/mermaid/ebnfDiagram-BXEA7PRR-CX7MIWlm.js","assets/visualizations/mermaid/abnfDiagram-N423BO3Z-CQmvc3R1.js","assets/visualizations/mermaid/pegDiagram-VL7TDLO6-DY_WljuU.js"])))=>i.map(i=>d[i]); +var gg=Object.defineProperty;var pg=(e,t,r)=>t in e?gg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var xt=(e,t,r)=>pg(e,typeof t!="symbol"?t+"":t,r);import{ad as fg,U as mg,_ as ht,aG as ct}from"../../app/index-8JtvDNuA.js";import fr from"../../chunks/purify.es-BnINGy_Y.js";var pl=Object.defineProperty,p=(e,t)=>pl(e,"name",{value:t,configurable:!0}),yg=(e,t)=>{for(var r in t)pl(e,r,{get:t[r],enumerable:!0})},fl={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(mg,function(){var r=1e3,i=6e4,s=36e5,a="millisecond",o="second",l="minute",n="hour",c="day",h="week",d="month",g="quarter",u="year",y="date",f="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,C=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function($){var F=["th","st","nd","rd"],_=$%100;return"["+$+(F[(_-20)%10]||F[_]||F[0])+"]"}},k=function($,F,_){var E=String($);return!E||E.length>=F?$:""+Array(F+1-E.length).join(_)+$},S={s:k,z:function($){var F=-$.utcOffset(),_=Math.abs(F),E=Math.floor(_/60),M=_%60;return(F<=0?"+":"-")+k(E,2,"0")+":"+k(M,2,"0")},m:function $(F,_){if(F.date()<_.date())return-$(_,F);var E=12*(_.year()-F.year())+(_.month()-F.month()),M=F.clone().add(E,d),R=_-M<0,N=F.clone().add(E+(R?-1:1),d);return+(-(E+(_-M)/(R?M-N:N-M))||0)},a:function($){return $<0?Math.ceil($)||0:Math.floor($)},p:function($){return{M:d,y:u,w:h,d:c,D:y,h:n,m:l,s:o,ms:a,Q:g}[$]||String($||"").toLowerCase().replace(/s$/,"")},u:function($){return $===void 0}},T="en",w={};w[T]=b;var L="$isDayjsObject",v=function($){return $ instanceof H||!(!$||!$[L])},W=function $(F,_,E){var M;if(!F)return T;if(typeof F=="string"){var R=F.toLowerCase();w[R]&&(M=R),_&&(w[R]=_,M=R);var N=F.split("-");if(!M&&N.length>1)return $(N[0])}else{var U=F.name;w[U]=F,M=U}return!E&&M&&(T=M),M||!E&&T},P=function($,F){if(v($))return $.clone();var _=typeof F=="object"?F:{};return _.date=$,_.args=arguments,new H(_)},A=S;A.l=W,A.i=v,A.w=function($,F){return P($,{locale:F.$L,utc:F.$u,x:F.$x,$offset:F.$offset})};var H=function(){function $(_){this.$L=W(_.locale,null,!0),this.parse(_),this.$x=this.$x||_.x||{},this[L]=!0}var F=$.prototype;return F.parse=function(_){this.$d=function(E){var M=E.date,R=E.utc;if(M===null)return new Date(NaN);if(A.u(M))return new Date;if(M instanceof Date)return new Date(M);if(typeof M=="string"&&!/Z$/i.test(M)){var N=M.match(m);if(N){var U=N[2]-1||0,Z=(N[7]||"0").substring(0,3);return R?new Date(Date.UTC(N[1],U,N[3]||1,N[4]||0,N[5]||0,N[6]||0,Z)):new Date(N[1],U,N[3]||1,N[4]||0,N[5]||0,N[6]||0,Z)}}return new Date(M)}(_),this.init()},F.init=function(){var _=this.$d;this.$y=_.getFullYear(),this.$M=_.getMonth(),this.$D=_.getDate(),this.$W=_.getDay(),this.$H=_.getHours(),this.$m=_.getMinutes(),this.$s=_.getSeconds(),this.$ms=_.getMilliseconds()},F.$utils=function(){return A},F.isValid=function(){return this.$d.toString()!==f},F.isSame=function(_,E){var M=P(_);return this.startOf(E)<=M&&M<=this.endOf(E)},F.isAfter=function(_,E){return P(_){},"trace"),debug:p((...e)=>{},"debug"),info:p((...e)=>{},"info"),warn:p((...e)=>{},"warn"),error:p((...e)=>{},"error"),fatal:p((...e)=>{},"fatal")},ua=p(function(e="fatal"){let t=ue.fatal;typeof e=="string"?e.toLowerCase()in ue&&(t=ue[e]):typeof e=="number"&&(t=e),z.trace=()=>{},z.debug=()=>{},z.info=()=>{},z.warn=()=>{},z.error=()=>{},z.fatal=()=>{},t<=ue.fatal&&(z.fatal=console.error?console.error.bind(console,Xt("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",Xt("FATAL"))),t<=ue.error&&(z.error=console.error?console.error.bind(console,Xt("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",Xt("ERROR"))),t<=ue.warn&&(z.warn=console.warn?console.warn.bind(console,Xt("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",Xt("WARN"))),t<=ue.info&&(z.info=console.info?console.info.bind(console,Xt("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",Xt("INFO"))),t<=ue.debug&&(z.debug=console.debug?console.debug.bind(console,Xt("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Xt("DEBUG"))),t<=ue.trace&&(z.trace=console.debug?console.debug.bind(console,Xt("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Xt("TRACE")))},"setLogLevel"),Xt=p(e=>`%c${xg().format("ss.SSS")} : ${e} : `,"format");const di={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:e=>e>=255?255:e<0?0:e,g:e=>e>=255?255:e<0?0:e,b:e=>e>=255?255:e<0?0:e,h:e=>e%360,s:e=>e>=100?100:e<0?0:e,l:e=>e>=100?100:e<0?0:e,a:e=>e>=1?1:e<0?0:e},toLinear:e=>{const t=e/255;return e>.03928?Math.pow((t+.055)/1.055,2.4):t/12.92},hue2rgb:(e,t,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e),hsl2rgb:({h:e,s:t,l:r},i)=>{if(!t)return r*2.55;e/=360,t/=100,r/=100;const s=r<.5?r*(1+t):r+t-r*t,a=2*r-s;switch(i){case"r":return di.hue2rgb(a,s,e+1/3)*255;case"g":return di.hue2rgb(a,s,e)*255;case"b":return di.hue2rgb(a,s,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:r},i)=>{e/=255,t/=255,r/=255;const s=Math.max(e,t,r),a=Math.min(e,t,r),o=(s+a)/2;if(i==="l")return o*100;if(s===a)return 0;const l=s-a,n=o>.5?l/(2-s-a):l/(s+a);if(i==="s")return n*100;switch(s){case e:return((t-r)/l+(tt>r?Math.min(t,Math.max(r,e)):Math.min(r,Math.max(t,e)),round:e=>Math.round(e*1e10)/1e10},kg={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},nt={channel:di,lang:bg,unit:kg},xe={};for(let e=0;e<=255;e++)xe[e]=nt.unit.dec2hex(e);const Ot={ALL:0,RGB:1,HSL:2};class Sg{constructor(){this.type=Ot.ALL}get(){return this.type}set(t){if(this.type&&this.type!==t)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=t}reset(){this.type=Ot.ALL}is(t){return this.type===t}}class Tg{constructor(t,r){this.color=r,this.changed=!1,this.data=t,this.type=new Sg}set(t,r){return this.color=r,this.changed=!1,this.data=t,this.type.type=Ot.ALL,this}_ensureHSL(){const t=this.data,{h:r,s:i,l:s}=t;r===void 0&&(t.h=nt.channel.rgb2hsl(t,"h")),i===void 0&&(t.s=nt.channel.rgb2hsl(t,"s")),s===void 0&&(t.l=nt.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r,g:i,b:s}=t;r===void 0&&(t.r=nt.channel.hsl2rgb(t,"r")),i===void 0&&(t.g=nt.channel.hsl2rgb(t,"g")),s===void 0&&(t.b=nt.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,r=t.r;return!this.type.is(Ot.HSL)&&r!==void 0?r:(this._ensureHSL(),nt.channel.hsl2rgb(t,"r"))}get g(){const t=this.data,r=t.g;return!this.type.is(Ot.HSL)&&r!==void 0?r:(this._ensureHSL(),nt.channel.hsl2rgb(t,"g"))}get b(){const t=this.data,r=t.b;return!this.type.is(Ot.HSL)&&r!==void 0?r:(this._ensureHSL(),nt.channel.hsl2rgb(t,"b"))}get h(){const t=this.data,r=t.h;return!this.type.is(Ot.RGB)&&r!==void 0?r:(this._ensureRGB(),nt.channel.rgb2hsl(t,"h"))}get s(){const t=this.data,r=t.s;return!this.type.is(Ot.RGB)&&r!==void 0?r:(this._ensureRGB(),nt.channel.rgb2hsl(t,"s"))}get l(){const t=this.data,r=t.l;return!this.type.is(Ot.RGB)&&r!==void 0?r:(this._ensureRGB(),nt.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(Ot.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(Ot.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(Ot.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(Ot.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(Ot.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(Ot.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}const Ui=new Tg({r:0,g:0,b:0,a:0},"transparent"),Je={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(Je.re);if(!t)return;const r=t[1],i=parseInt(r,16),s=r.length,a=s%4===0,o=s>4,l=o?1:17,n=o?8:4,c=a?0:-1,h=o?255:15;return Ui.set({r:(i>>n*(c+3)&h)*l,g:(i>>n*(c+2)&h)*l,b:(i>>n*(c+1)&h)*l,a:a?(i&h)*l/255:1},e)},stringify:e=>{const{r:t,g:r,b:i,a:s}=e;return s<1?`#${xe[Math.round(t)]}${xe[Math.round(r)]}${xe[Math.round(i)]}${xe[Math.round(s*255)]}`:`#${xe[Math.round(t)]}${xe[Math.round(r)]}${xe[Math.round(i)]}`}},$e={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:e=>{const t=e.match($e.hueRe);if(t){const[,r,i]=t;switch(i){case"grad":return nt.channel.clamp.h(parseFloat(r)*.9);case"rad":return nt.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return nt.channel.clamp.h(parseFloat(r)*360)}}return nt.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const r=e.match($e.re);if(!r)return;const[,i,s,a,o,l]=r;return Ui.set({h:$e._hue2deg(i),s:nt.channel.clamp.s(parseFloat(s)),l:nt.channel.clamp.l(parseFloat(a)),a:o?nt.channel.clamp.a(l?parseFloat(o)/100:parseFloat(o)):1},e)},stringify:e=>{const{h:t,s:r,l:i,a:s}=e;return s<1?`hsla(${nt.lang.round(t)}, ${nt.lang.round(r)}%, ${nt.lang.round(i)}%, ${s})`:`hsl(${nt.lang.round(t)}, ${nt.lang.round(r)}%, ${nt.lang.round(i)}%)`}},Ir={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:e=>{e=e.toLowerCase();const t=Ir.colors[e];if(t)return Je.parse(t)},stringify:e=>{const t=Je.stringify(e);for(const r in Ir.colors)if(Ir.colors[r]===t)return r}},Mr={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:e=>{const t=e.charCodeAt(0);if(t!==114&&t!==82)return;const r=e.match(Mr.re);if(!r)return;const[,i,s,a,o,l,n,c,h]=r;return Ui.set({r:nt.channel.clamp.r(s?parseFloat(i)*2.55:parseFloat(i)),g:nt.channel.clamp.g(o?parseFloat(a)*2.55:parseFloat(a)),b:nt.channel.clamp.b(n?parseFloat(l)*2.55:parseFloat(l)),a:c?nt.channel.clamp.a(h?parseFloat(c)/100:parseFloat(c)):1},e)},stringify:e=>{const{r:t,g:r,b:i,a:s}=e;return s<1?`rgba(${nt.lang.round(t)}, ${nt.lang.round(r)}, ${nt.lang.round(i)}, ${nt.lang.round(s)})`:`rgb(${nt.lang.round(t)}, ${nt.lang.round(r)}, ${nt.lang.round(i)})`}},oe={format:{keyword:Ir,hex:Je,rgb:Mr,rgba:Mr,hsl:$e,hsla:$e},parse:e=>{if(typeof e!="string")return e;const t=Je.parse(e)||Mr.parse(e)||$e.parse(e)||Ir.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(Ot.HSL)||e.data.r===void 0?$e.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?Mr.stringify(e):Je.stringify(e)},ml=(e,t)=>{const r=oe.parse(e);for(const i in t)r[i]=nt.channel.clamp[i](t[i]);return oe.stringify(r)},Se=(e,t,r=0,i=1)=>{if(typeof e!="number")return ml(e,{a:t});const s=Ui.set({r:nt.channel.clamp.r(e),g:nt.channel.clamp.g(t),b:nt.channel.clamp.b(r),a:nt.channel.clamp.a(i)});return oe.stringify(s)},wg=e=>{const{r:t,g:r,b:i}=oe.parse(e),s=.2126*nt.channel.toLinear(t)+.7152*nt.channel.toLinear(r)+.0722*nt.channel.toLinear(i);return nt.lang.round(s)},Bg=e=>wg(e)>=.5,re=e=>!Bg(e),yl=(e,t,r)=>{const i=oe.parse(e),s=i[t],a=nt.channel.clamp[t](s+r);return s!==a&&(i[t]=a),oe.stringify(i)},I=(e,t)=>yl(e,"l",t),D=(e,t)=>yl(e,"l",-t),x=(e,t)=>{const r=oe.parse(e),i={};for(const s in t)t[s]&&(i[s]=r[s]+t[s]);return ml(e,i)},_g=(e,t,r=50)=>{const{r:i,g:s,b:a,a:o}=oe.parse(e),{r:l,g:n,b:c,a:h}=oe.parse(t),d=r/100,g=d*2-1,u=o-h,f=((g*u===-1?g:(g+u)/(1+g*u))+1)/2,m=1-f,C=i*f+l*m,b=s*f+n*m,k=a*f+c*m,S=o*d+h*(1-d);return Se(C,b,k,S)},B=(e,t=100)=>{const r=oe.parse(e);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,_g(r,e,t)};var ks=p((e,t,{depth:r=2}={})=>{const i={depth:r};if(Array.isArray(t)&&!Array.isArray(e))return t.forEach(s=>ks(e,s,i)),e;if(Array.isArray(t)&&Array.isArray(e))return t.forEach(s=>{e.includes(s)||e.push(s)}),e;if(e==null||r<=0)return e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t;if(t!=null&&typeof e=="object"&&typeof t=="object"){const s=e;Object.entries(t).forEach(([a,o])=>{if(typeof o=="object"){if(o===null)return;Object.hasOwn(e,a)||Object.defineProperty(e,a,{value:void 0,writable:!0,enumerable:!0,configurable:!0}),s[a]===void 0&&(s[a]=Array.isArray(o)?[]:{}),typeof s[a]=="object"&&(s[a]=ks(s[a],o,{depth:r-1}))}else typeof s[a]!="object"&&(Object.hasOwn(e,a)?s[a]=o:Object.defineProperty(e,a,{value:o,writable:!0,enumerable:!0,configurable:!0}))})}return e},"assignWithDepth"),Ft=ks,ne="#ffffff",he="#f2f2f2",at=p((e,t)=>t?x(e,{s:-40,l:10}):x(e,{s:-40,l:-10}),"mkBorder"),er,vg=(er=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.useGradient=!0,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){var r,i,s,a,o,l,n,c,h,d,g,u,y,f,m,C,b,k,S,T,w,L,v,W,P,A,H,q,$,F,_,E,M,R,N,U,Z,et,tt,ot,gt,ut,bt,kt,Y,K,dt,ft,O;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||at(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||at(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||at(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?D(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||D(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||I(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||D(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||D(this.mainBkg,10)):(this.rowOdd=this.rowOdd||I(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||I(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.darkMode)for(let lt=0;lt{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(er,"Theme"),er),Lg=p(e=>{const t=new vg;return t.calculate(e),t},"getThemeVariables"),rr,Fg=(rr=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=I(this.primaryColor,16),this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=B(this.background),this.secondaryBorderColor=at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=at(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.tertiaryColor),this.lineColor=B(this.background),this.textColor=B(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=I(B("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Se(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.clusterBkg="#302F3D",this.sectionBkgColor=D("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=D(this.sectionBkgColor,10),this.taskBorderColor=Se(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Se(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||I(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||D(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal"}updateColors(){var t,r,i,s,a,o,l,n,c,h,d,g,u,y,f,m,C,b,k,S,T,w,L,v,W,P,A,H,q,$,F,_,E,M,R,N,U,Z,et,tt,ot,gt,ut,bt,kt,Y,K,dt,ft;this.secondBkg=I(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=I(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.background,this.taskBkgColor=I(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=B(this.doneTaskBkgColor),this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=x(this.primaryColor,{h:64}),this.fillType3=x(this.secondaryColor,{h:64}),this.fillType4=x(this.primaryColor,{h:-64}),this.fillType5=x(this.secondaryColor,{h:-64}),this.fillType6=x(this.primaryColor,{h:128}),this.fillType7=x(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330});for(let O=0;O{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(rr,"Theme"),rr),Mg=p(e=>{const t=new Fg;return t.calculate(e),t},"getThemeVariables"),ir,Ag=(ir=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=x(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=at(this.primaryColor,this.darkMode),this.secondaryBorderColor=at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=at(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.tertiaryColor),this.lineColor=B(this.background),this.textColor=B(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=at(this.primaryColor,this.darkMode),this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.clusterBkg="#FBFBFF",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=Se(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!1,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))",this.updateColors()}updateColors(){var t,r,i,s,a,o,l,n,c,h,d,g,u,y,f,m,C,b,k,S,T,w,L,v,W,P,A,H,q,$,F,_,E,M,R,N,U,Z,et,tt,ot,gt,ut,bt,kt,Y,K,dt,ft;this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||D(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||D(this.tertiaryColor,40);for(let O=0;O{this[i]==="calculated"&&(this[i]=void 0)}),typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(ir,"Theme"),ir),Eg=p(e=>{const t=new Ag;return t.calculate(e),t},"getThemeVariables"),sr,$g=(sr=class{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=I("#cde498",10),this.primaryBorderColor=at(this.primaryColor,this.darkMode),this.secondaryBorderColor=at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=at(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.primaryColor),this.lineColor=B(this.background),this.textColor=B(this.background),this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))"}updateColors(){var t,r,i,s,a,o,l,n,c,h,d,g,u,y,f,m,C,b,k,S,T,w,L,v,W,P,A,H,q,$,F,_,E,M,R,N,U,Z,et,tt,ot,gt,ut,bt,kt,Y,K,dt,ft;this.actorBorder=D(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||D(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||D(this.tertiaryColor,40);for(let O=0;O{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(sr,"Theme"),sr),Og=p(e=>{const t=new $g;return t.calculate(e),t},"getThemeVariables"),ar,Ig=(ar=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=I(this.contrast,55),this.background="#ffffff",this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=at(this.primaryColor,this.darkMode),this.secondaryBorderColor=at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=at(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.tertiaryColor),this.lineColor=B(this.background),this.textColor=B(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.rowOdd=this.rowOdd||I(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){var t,r,i,s,a,o,l,n,c,h,d,g,u,y,f,m,C,b,k,S,T,w,L,v,W,P,A,H,q,$,F,_,E,M,R,N,U,Z,et,tt,ot,gt,ut,bt,kt,Y,K,dt,ft;this.secondBkg=I(this.contrast,55),this.border2=this.contrast,this.actorBorder=I(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let O=0;O{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(ar,"Theme"),ar),Dg=p(e=>{const t=new Ig;return t.calculate(e),t},"getThemeVariables"),or,Pg=(or=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=2,this.primaryBorderColor=at(this.primaryColor,this.darkMode),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.nodeBorder="#000000",this.stateBorder="#000000",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 0px 1px 2px rgba(0, 0, 0, 0.25));",this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){var a,o,l,n,c,h,d,g,u,y,f;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||at(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||at(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||at(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?D(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||D(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=x(t,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||I(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||t,this.cScale1=this.cScale1||r,this.cScale2=this.cScale2||i,this.cScale3=this.cScale3||x(t,{h:30}),this.cScale4=this.cScale4||x(t,{h:60}),this.cScale5=this.cScale5||x(t,{h:90}),this.cScale6=this.cScale6||x(t,{h:120}),this.cScale7=this.cScale7||x(t,{h:150}),this.cScale8=this.cScale8||x(t,{h:210,l:150}),this.cScale9=this.cScale9||x(t,{h:270}),this.cScale10=this.cScale10||x(t,{h:300}),this.cScale11=this.cScale11||x(t,{h:330}),this.darkMode)for(let m=0;m{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(or,"Theme"),or),Rg=p(e=>{const t=new Pg;return t.calculate(e),t},"getThemeVariables"),lr,qg=(lr=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=I(this.primaryColor,16),this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=B(this.background),this.secondaryBorderColor=at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=at(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=I(B("#323D47"),10),this.border1="#ccc",this.border2=Se(255,255,255,.25),this.arrowheadColor=B(this.background),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=1,this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily="arial, sans-serif",this.fontSize="14px",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.2))",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){var r,i,s,a,o,l,n,c,h,d,g;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||at(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||at(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||at(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?D(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||D(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||I(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.darkMode)for(let u=0;u{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(lr,"Theme"),lr),Wg=p(e=>{const t=new qg;return t.calculate(e),t},"getThemeVariables"),nr,zg=(nr=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=at("#28253D",this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.clusterBkg="#F9F9FB",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.filterColor="#000000"}updateColors(){var a,o,l,n,c,h,d,g,u,y,f;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||at(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||at(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||at(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?D(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.noteFontWeight=600,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||D(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=x(t,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||I(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.compositeTitleBackground="#F9F9FB",this.altBackground="#F9F9FB",this.stateEdgeLabelBackground="#FFFFFF",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor;for(let m=0;m{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(nr,"Theme"),nr),Ng=p(e=>{const t=new zg;return t.calculate(e),t},"getThemeVariables"),hr,Hg=(hr=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=I(this.primaryColor,16),this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=B(this.background),this.secondaryBorderColor=at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=at(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=I(B("#323D47"),10),this.border1="#ccc",this.border2=Se(255,255,255,.25),this.arrowheadColor=B(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.filterColor="#FFFFFF"}updateColors(){var r,i,s,a,o,l,n,c,h,d,g;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||at(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||at(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||at(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?D(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||D(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||I(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.compositeBackground="#16141F",this.altBackground="#16141F",this.compositeTitleBackground="#16141F",this.stateEdgeLabelBackground="#16141F",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||x(this.primaryColor,{h:30}),this.cScale4=this.cScale4||x(this.primaryColor,{h:60}),this.cScale5=this.cScale5||x(this.primaryColor,{h:90}),this.cScale6=this.cScale6||x(this.primaryColor,{h:120}),this.cScale7=this.cScale7||x(this.primaryColor,{h:150}),this.cScale8=this.cScale8||x(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||x(this.primaryColor,{h:270}),this.cScale10=this.cScale10||x(this.primaryColor,{h:300}),this.cScale11=this.cScale11||x(this.primaryColor,{h:330}),this.darkMode)for(let u=0;u{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(hr,"Theme"),hr),Yg=p(e=>{const t=new Hg;return t.calculate(e),t},"getThemeVariables"),cr,jg=(cr=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=at(this.primaryColor,this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=["#FDF4FF","#F0FDFA","#FFF7ED","#ECFEFF","#F0FDF4","#F5F3FF","#FEF2F2","#FEFCE8","#EEF2FF","#F7FEE7","#F0F9FF","#FFF1F2"],this.filterColor="#000000"}updateColors(){var a,o,l,n,c,h,d,g,u,y,f;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||at(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||at(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||at(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?D(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||D(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=x(t,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||I(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let m=0;m{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(cr,"Theme"),cr),Ug=p(e=>{const t=new jg;return t.calculate(e),t},"getThemeVariables"),dr,Xg=(dr=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=I(this.primaryColor,16),this.tertiaryColor=x(this.primaryColor,{h:-160}),this.primaryBorderColor=B(this.background),this.secondaryBorderColor=at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=at(this.tertiaryColor,this.darkMode),this.primaryTextColor=B(this.primaryColor),this.secondaryTextColor=B(this.secondaryColor),this.tertiaryTextColor=B(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=I(B("#323D47"),10),this.border1="#ccc",this.border2=Se(255,255,255,.25),this.arrowheadColor=B(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=[],this.filterColor="#FFFFFF"}updateColors(){var r,i,s,a,o,l,n,c,h,d,g;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||x(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||x(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||at(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||at(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||at(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||at(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||B(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||B(this.tertiaryColor),this.lineColor=this.lineColor||B(this.background),this.arrowheadColor=this.arrowheadColor||B(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?D(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||D(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||B(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.rootLabelColor="#FFFFFF",this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||I(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let u=0;u{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(dr,"Theme"),dr),Gg=p(e=>{const t=new Xg;return t.calculate(e),t},"getThemeVariables"),fe={base:{getThemeVariables:Lg},dark:{getThemeVariables:Mg},default:{getThemeVariables:Eg},forest:{getThemeVariables:Og},neutral:{getThemeVariables:Dg},neo:{getThemeVariables:Rg},"neo-dark":{getThemeVariables:Wg},redux:{getThemeVariables:Ng},"redux-dark":{getThemeVariables:Yg},"redux-color":{getThemeVariables:Ug},"redux-dark-color":{getThemeVariables:Gg}},At={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},swimlane:{useMaxWidth:!0,lineHops:"arc",ignoreCrossLaneEdges:!0,optimizeRanksByCrossings:!0,automaticLaneOrdering:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75,donutHole:0,legendPosition:"right",highlightSlice:""},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showDataLabelOutsideBar:!1,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},ishikawa:{useMaxWidth:!0,diagramPadding:20},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:"",nodeWidth:10,nodePadding:12,labelStyle:"legacy"},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},treeView:{useMaxWidth:!0,rowIndent:10,paddingX:5,paddingY:5,lineThickness:1,showIcons:!1,defaultIconPack:"",filenameIcons:{},extensionIcons:{}},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16,randomize:!1,nodeSeparation:75,idealEdgeLengthMultiplier:1.5,edgeElasticity:.45,numIter:2500,seed:1},eventmodeling:{useMaxWidth:!0,padding:30,rowHeight:32},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},venn:{useMaxWidth:!0,width:800,height:450,padding:8,useDebugLayout:!1},cynefin:{useMaxWidth:!0,width:800,height:600,padding:40,showDomainDescriptions:!0,boundaryAmplitude:8,seed:0},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},Cl={...At,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:fe.default.getThemeVariables(),sequence:{...At.sequence,messageFont:p(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:p(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:p(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...At.gantt,tickInterval:void 0,useWidth:void 0},c4:{...At.c4,useWidth:void 0,personFont:p(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...At.flowchart,inheritDir:!1},external_personFont:p(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:p(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:p(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:p(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:p(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:p(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:p(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:p(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:p(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:p(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:p(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:p(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:p(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:p(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:p(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:p(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:p(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:p(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:p(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:p(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:p(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...At.pie,useWidth:984},xyChart:{...At.xyChart,useWidth:void 0},requirement:{...At.requirement,useWidth:void 0},packet:{...At.packet},eventmodeling:{...At.eventmodeling},treeView:{...At.treeView,useWidth:void 0},radar:{...At.radar},railroad:{...At.railroad,fontSize:void 0,fontFamily:void 0,terminalFill:void 0,terminalStroke:void 0,terminalTextColor:void 0,nonTerminalFill:void 0,nonTerminalStroke:void 0,nonTerminalTextColor:void 0,lineColor:void 0,markerFill:void 0,commentFill:void 0,commentStroke:void 0,commentTextColor:void 0,specialFill:void 0,specialStroke:void 0,ruleNameColor:void 0},ishikawa:{...At.ishikawa},sankey:{...At.sankey,nodeColors:void 0},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","},venn:{...At.venn},cynefin:{...At.cynefin}},xl=p((e,t="")=>Object.keys(e).reduce((r,i)=>Array.isArray(e[i])?r:typeof e[i]=="object"&&e[i]!==null?[...r,t+i,...xl(e[i],"")]:[...r,t+i],[]),"keyify"),Vg=new Set(xl(Cl,"")),bl=Cl,Zg={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},Qg=p((e,t)=>{for(const r of Object.keys(e)){const i=e[r];(r.startsWith("__")||r.includes("proto")||r.includes("constr")||typeof i!="string"||!t.test(i))&&(z.debug("sanitize deleting dictionary entry:",r,i),delete e[r])}},"sanitizeDictionaryConfig"),ki=p(e=>{if(z.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>ki(t));return}for(const t of Object.keys(e)){if(z.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!Vg.has(t)||e[t]==null){z.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){const i=Zg[t];i?Qg(e[t],i):(z.debug("sanitizing object",t),ki(e[t]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const i of r)t.includes(i)&&(z.debug("sanitizing css option",t),e[t]=kl(e[t]))}if(e.themeVariables)for(const t of Object.keys(e.themeVariables)){const r=e.themeVariables[t];r!=null&&r.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(e.themeVariables[t]="")}z.debug("After sanitization",e)}},"sanitizeDirective"),kl=p(e=>{let t=0,r=0;for(const i of e){if(t!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),Ht=Ft({},mr),Si,Pe=[],Dr=Ft({},mr),Vr=p((e,t)=>{let r=Ft({},e),i={};for(const s of t)wl(s),i=Ft(i,s);if(r=Ft(r,i),i.theme&&i.theme in fe){const s=Ft({},Si),a=Ft(s.themeVariables||{},i.themeVariables);r.theme&&r.theme in fe&&(r.themeVariables=fe[r.theme].getThemeVariables(a))}return Dr=r,ip(Dr),Dr},"updateCurrentConfig"),Kg=p(e=>(Ht=Ft({},mr),Ht=Ft(Ht,e),e.theme&&fe[e.theme]&&(Ht.themeVariables=fe[e.theme].getThemeVariables(e.themeVariables)),Vr(Ht,Pe),Ht),"setSiteConfig"),Jg=p(e=>{Si=Ft({},e)},"saveConfigFromInitialize"),tp=p(e=>(Ht=Ft(Ht,e),Vr(Ht,Pe),Ht),"updateSiteConfig"),Sl=p(()=>Ft({},Ht),"getSiteConfig"),Tl=p(e=>(Vr(Dr,[e]),Tt()),"setConfig"),Tt=p(()=>Ft({},Dr),"getConfig"),wl=p(e=>{e&&(["secure",...Ht.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(z.debug(`Denied attempt to modify a secure key ${t}`,e[t]),delete e[t])}),Object.keys(e).forEach(t=>{t.startsWith("__")&&delete e[t]}),Object.keys(e).forEach(t=>{typeof e[t]=="string"&&(e[t].includes("<")||e[t].includes(">")||e[t].includes("url(data:"))&&delete e[t],typeof e[t]=="object"&&wl(e[t])}))},"sanitize"),ep=p(e=>{var t;ki(e),e.fontFamily&&!((t=e.themeVariables)!=null&&t.fontFamily)&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),Pe.push(e),Vr(Ht,Pe)},"addDirective"),Ti=p((e=Ht)=>{Pe=[],Vr(e,Pe)},"reset"),rp={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",FLOWCHART_HTML_LABELS_DEPRECATED:"flowchart.htmlLabels is deprecated. Please use global htmlLabels instead."},no={},Bl=p(e=>{no[e]||(z.warn(rp[e]),no[e]=!0)},"issueWarning"),ip=p(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&Bl("LAZY_LOAD_DEPRECATED")},"checkConfig"),$1=p(()=>{let e={};Si&&(e=Ft(e,Si));for(const t of Pe)e=Ft(e,t);return e},"getUserDefinedConfig"),zt=p(e=>{var t,r;return((t=e.flowchart)==null?void 0:t.htmlLabels)!=null&&Bl("FLOWCHART_HTML_LABELS_DEPRECATED"),ce(e.htmlLabels??((r=e.flowchart)==null?void 0:r.htmlLabels)??!0)},"getEffectiveHtmlLabels"),_l=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,Pr=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,sp=/\s*%%.*\n/gm,ur,vl=(ur=class extends Error{constructor(t){super(t),this.name="UnknownDiagramError"}},p(ur,"UnknownDiagramError"),ur),Re={},ga=p(function(e,t){e=e.replace(_l,"").replace(Pr,"").replace(sp,` `);for(const[r,{detector:i}]of Object.entries(Re))if(i(e,t))return r;throw new vl(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),Ss=p((...e)=>{for(const{id:t,detector:r,loader:i}of e)Ll(t,r,i)},"registerLazyLoadedDiagrams"),Ll=p((e,t,r)=>{Re[e]&&z.warn(`Detector with key ${e} already exists. Overwriting.`),Re[e]={detector:t,loader:r},z.debug(`Detector with key ${e} added${r?" with loader":""}`)},"addDetector"),ap=p(e=>Re[e].loader,"getDiagramLoader"),Zr=//gi,op=p(e=>e?Al(e).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),lp=(()=>{let e=!1;return()=>{e||(Fl(),e=!0)}})();function Fl(){const e="data-temp-href-target";fr.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),fr.addHook("afterSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute(e)&&(t.setAttribute("target",t.getAttribute(e)??""),t.removeAttribute(e),t.getAttribute("target")==="_blank"&&t.setAttribute("rel","noopener"))})}p(Fl,"setupDompurifyHooks");var Ml=p(e=>(lp(),fr.sanitize(e)),"removeScript"),ho=p((e,t)=>{if(zt(t)){const r=t.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?e=Ml(e):r!=="loose"&&(e=Al(e),e=e.replace(//g,">"),e=e.replace(/=/g,"="),e=dp(e))}return e},"sanitizeMore"),ee=p((e,t)=>e&&(t.dompurifyConfig?e=fr.sanitize(ho(e,t),t.dompurifyConfig).toString():e=fr.sanitize(ho(e,t),{FORBID_TAGS:["style"]}).toString(),e),"sanitizeText"),np=p((e,t)=>typeof e=="string"?ee(e,t):e.flat().map(r=>ee(r,t)),"sanitizeTextOrArray"),hp=p(e=>Zr.test(e),"hasBreaks"),cp=p(e=>e.split(Zr),"splitBreaks"),dp=p(e=>e.replace(/#br#/g,"
"),"placeholderToBreak"),Al=p(e=>e.replace(Zr,"#br#"),"breakToPlaceholder"),up=p(e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},"getUrl"),gp=p(function(...e){const t=e.filter(r=>!isNaN(r));return Math.max(...t)},"getMax"),pp=p(function(...e){const t=e.filter(r=>!isNaN(r));return Math.min(...t)},"getMin"),co=p(function(e){const t=e.split(/(,)/),r=[];for(let i=0;i0&&i+1Math.max(0,e.split(t).length-1),"countOccurrence"),fp=p((e,t)=>{const r=Ts(e,"~"),i=Ts(t,"~");return r===1&&i===1},"shouldCombineSets"),mp=p(e=>{const t=Ts(e,"~");let r=!1;if(t<=1)return e;t%2!==0&&e.startsWith("~")&&(e=e.substring(1),r=!0);const i=[...e];let s=i.indexOf("~"),a=i.lastIndexOf("~");for(;s!==-1&&a!==-1&&s!==a;)i[s]="<",i[a]=">",s=i.indexOf("~"),a=i.lastIndexOf("~");return r&&i.unshift("~"),i.join("")},"processSet"),uo=p(()=>window.MathMLElement!==void 0,"isMathMLSupported"),ws=/\$\$(.*?)\$\$/g,zr=p(e=>{var t;return(((t=e.match(ws))==null?void 0:t.length)??0)>0},"hasKatex"),O1=p(async(e,t)=>{const r=document.createElement("div");r.innerHTML=await El(e,t),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0";const i=document.querySelector("body");i==null||i.insertAdjacentElement("beforeend",r);const s={width:r.clientWidth,height:r.clientHeight};return r.remove(),s},"calculateMathMLDimensions"),yp=p(async(e,t)=>{if(!zr(e))return e;if(!(uo()||t.legacyMathML||t.forceLegacyMathML))return e.replace(ws,"MathML is unsupported in this environment.");{const{default:r}=await ht(async()=>{const{default:s}=await import("../../chunks/katex-C5jXJg4s.js");return{default:s}},[]),i=t.forceLegacyMathML||!uo()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(Zr).map(s=>zr(s)?`
${s}
`:`
${s}
`).join("").replace(ws,(s,a)=>r.renderToString(a,{throwOnError:!0,displayMode:!0,output:i}).replace(/\n/g," ").replace(//g,""))}},"renderKatexUnsanitized"),El=p(async(e,t)=>ee(await yp(e,t),t),"renderKatexSanitized"),Qr={getRows:op,sanitizeText:ee,sanitizeTextOrArray:np,hasBreaks:hp,splitBreaks:cp,lineBreakRegex:Zr,removeScript:Ml,getUrl:up,evaluate:ce,getMax:gp,getMin:pp},Cp=p(function(e,t){for(let r of t)e.attr(r[0],r[1])},"d3Attrs"),xp=p(function(e,t,r){let i=new Map;return r?(i.set("width","100%"),i.set("style",`max-width: ${t}px;`)):(i.set("height",e),i.set("width",t)),i},"calculateSvgSizeAttrs"),$l=p(function(e,t,r,i){const s=xp(t,r,i);Cp(e,s)},"configureSvgSize"),bp=p(function(e,t,r,i){const s=t.node().getBBox(),a=s.width,o=s.height;z.info(`SVG bounds: ${a}x${o}`,s);let l=0,n=0;z.info(`Graph bounds: ${l}x${n}`,e),l=a+r*2,n=o+r*2,z.info(`Calculated bounds: ${l}x${n}`),$l(t,n,l,i);const c=`${s.x-r} ${s.y-r} ${s.width+2*r} ${s.height+2*r}`;t.attr("viewBox",c)},"setupGraphViewbox"),ui={};function Bs(e){return[...e.cssRules].map(t=>t.cssText).join(` `)}p(Bs,"cssStyleSheetToString");var kp=p((e,t,r,i)=>{let s="";return e in ui&&ui[e]?s=ui[e]({...r,svgId:i}):z.warn(`No theme found for ${e}`),`& { font-family: ${r.fontFamily}; @@ -298,8 +298,8 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="

An error L0,20`)},"requirement_arrow"),R0=p((e,t,r)=>{const i=Tt(),{themeVariables:s}=i,{strokeWidth:a}=s;e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${a}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0 L20,10 M20,10 - L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),q0=p((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),W0=p((e,t,r)=>{const i=Tt(),{themeVariables:s}=i,{strokeWidth:a}=s,o=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");o.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),o.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),o.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),o.selectAll("*").attr("stroke-width",`${a}`)},"requirement_contains_neo"),z0={extension:x0,composition:b0,aggregation:k0,dependency:S0,lollipop:T0,point:w0,circle:B0,cross:_0,barb:v0,barbNeo:L0,only_one:F0,zero_or_one:M0,one_or_more:A0,zero_or_more:E0,only_one_neo:$0,zero_or_one_neo:O0,one_or_more_neo:I0,zero_or_more_neo:D0,requirement_arrow:P0,requirement_contains:q0,requirement_arrow_neo:R0,requirement_contains_neo:W0},N0=C0,H0={common:Qr,getConfig:Tt,insertCluster:RC,insertEdge:y0,insertEdgeLabel:c0,insertMarkers:N0,insertNode:su,interpolateToCurve:Da,labelHelper:it,log:z,positionEdgeLabel:d0},Xr={},nu=p(e=>{for(const t of e)Xr[t.name]=t},"registerLayoutLoaders"),Y0=p(()=>{nu([{name:"dagre",loader:p(async()=>await ht(()=>import("./dagre-VZM6K2ZE-shxLHn3p.js"),__vite__mapDeps([0,1,2,3,4,5,6,7])),"loader")},{name:"swimlane",loader:p(async()=>await ht(()=>import("./swimlanes-SLNWSIFB-DEO6uzPS.js"),__vite__mapDeps([8,5,6,1,2,3,7])),"loader")},{name:"cose-bilkent",loader:p(async()=>await ht(()=>import("./cose-bilkent-JH36ORCC-BNlKHYzG.js"),__vite__mapDeps([9,10,5,6,7])),"loader")}])},"registerDefaultLayoutLoaders");Y0();var s2=p(async(e,t,r)=>{if(!(e.layoutAlgorithm in Xr))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(const d of e.nodes){const g=d.domId||d.id;d.domId=`${e.diagramId}-${g}`}const i=Xr[e.layoutAlgorithm],s=await i.loader(),{theme:a,themeVariables:o}=e.config,{useGradient:l,gradientStart:n,gradientStop:c}=o,h=t.attr("id");if(t.append("defs").append("filter").attr("id",`${h}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${a!=null&&a.includes("dark")?"#FFFFFF":"#000000"}`),t.append("defs").append("filter").attr("id",`${h}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${a!=null&&a.includes("dark")?"#FFFFFF":"#000000"}`),l){const d=t.append("linearGradient").attr("id",t.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");d.append("svg:stop").attr("offset","0%").attr("stop-color",n).attr("stop-opacity",1),d.append("svg:stop").attr("offset","100%").attr("stop-color",c).attr("stop-opacity",1)}return s.render(e,t,H0,{algorithm:i.algorithm},r)},"render"),a2=p((e="",{fallback:t="dagre"}={})=>{if(e in Xr)return e;if(t in Xr)return z.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm"),io="comm",hu="rule",cu="decl",j0="@media",U0="@import",X0="@supports",G0="@namespace",oa="@keyframes",du="@layer",V0="@scope",Z0=Math.abs,Wr=String.fromCharCode;function uu(e){return e.trim()}function la(e,t,r){return e.replace(t,r)}function tr(e,t){return e.charCodeAt(t)|0}function xr(e,t,r){return e.slice(t,r)}function ae(e){return e.length}function gu(e){return e.length}function hi(e,t){return t.push(e),e}var ss=1,br=1,pu=0,Gt=0,_t=0,Tr="";function so(e,t,r,i,s,a,o,l){return{value:e,root:t,parent:r,type:i,props:s,children:a,line:ss,column:br,length:o,return:"",siblings:l}}function Q0(){return _t}function K0(){return _t=Gt>0?tr(Tr,--Gt):0,br--,_t===10&&(br=1,ss--),_t}function te(){return _t=Gt2||Gr(_t)>3?"":" "}function rx(e,t){for(;--t&&te()&&!(_t<48||_t>102||_t>57&&_t<65||_t>70&&_t<97););return as(e,xi()+(t<6&&ke()==32&&te()==32))}function na(e){for(;te();)switch(_t){case e:return Gt;case 34:case 39:e!==34&&e!==39&&na(_t);break;case 40:e===41&&na(e);break;case 92:te();break}return Gt}function ix(e,t){for(;te()&&e+_t!==57;)if(e+_t===84&&ke()===47)break;return"/*"+as(t,Gt-1)+"*"+Wr(e===47?e:te())}function sx(e){for(;!Gr(ke());)te();return as(e,Gt)}function ax(e){return tx(bi("",null,null,null,[""],e=J0(e),0,[0],e))}function bi(e,t,r,i,s,a,o,l,n){for(var c=0,h=0,d=o,g=0,u=0,y=0,f=1,m=1,C=1,b=0,k=0,S="",T=s,w=a,L=i,v=S;m;)switch(y=k,k=te()){case 40:y!=108&&tr(v,d-1)==58?(b++,v+="("):v+=xs(k);break;case 41:b--,v+=")";break;case 34:case 39:case 91:v+=xs(k);break;case 9:case 10:case 13:case 32:if(b>0){v+=Wr(k);break}v+=ex(y);break;case 92:v+=rx(xi()-1,7);continue;case 47:switch(ke()){case 42:case 47:hi(ox(ix(te(),xi()),t,r,n),n),(Gr(y||1)==5||Gr(ke()||1)==5)&&ae(v)&&xr(v,-1,void 0)!==" "&&(v+=" ");break;default:v+="/"}break;case 123*f:l[c++]=ae(v)*C;case 125*f:case 59:case 0:if(b>0&&k){v+=Wr(k);break}switch(k){case 0:case 125:m=0;case 59+h:C==-1&&(v=la(v,/\f/g,"")),u>0&&(ae(v)-d||f===0)&&hi(u>32?hl(v+";",i,r,d-1,n):hl(la(v," ","")+";",i,r,d-2,n),n);break;case 59:v+=";";default:if(hi(L=nl(v,t,r,c,h,s,l,S,T=[],w=[],d,a),a),k===123)if(h===0)bi(v,t,L,L,T,a,d,l,w);else{switch(g){case 99:if(tr(v,3)===110)break;case 108:if(tr(v,2)===97)break;default:h=0;case 100:case 109:case 115:}h?bi(e,L,L,i&&hi(nl(e,L,L,0,0,s,l,S,s,T=[],d,w),w),s,w,d,l,i?T:w):bi(v,L,L,L,[""],w,0,l,w)}}c=h=u=0,f=C=1,S=v="",d=o;break;case 58:d=1+ae(v),u=y;default:if(f<1){if(k==123)--f;else if(k==125&&f++==0&&K0()==125)continue}switch(v+=Wr(k),k*f){case 38:C=h>0?1:(v+="\f",-1);break;case 44:if(b>0)break;l[c++]=(ae(v)-1)*C,C=1;break;case 64:ke()===45&&(v+=xs(te())),g=ke(),h=d=ae(S=v+=sx(xi())),k++;break;case 45:y===45&&ae(v)==2&&(f=0)}}return a}function nl(e,t,r,i,s,a,o,l,n,c,h,d){for(var g=s-1,u=s===0?a:[""],y=gu(u),f=0,m=0,C=0;f0?u[b]+" "+k:la(k,/&\f/g,u[b])))&&(n[C++]=S);return so(e,t,r,s===0?hu:l,n,c,h,d)}function ox(e,t,r,i){return so(e,t,r,io,Wr(Q0()),xr(e,2,-2),0,i)}function hl(e,t,r,i,s){return so(e,t,r,cu,xr(e,0,i),xr(e,i+1,-1),i,s)}function ha(e,t){for(var r="",i=0;i/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),cx=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./c4Diagram-5PPSVZJV-CJepdaIg.js");return{diagram:t}},__vite__mapDeps([11,12,5,6,7]));return{id:fu,diagram:e}},"loader"),dx={id:fu,detector:hx,loader:cx},ux=dx,mu="flowchart",gx=p((e,t)=>{var r,i;return((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="dagre-wrapper"||((i=t==null?void 0:t.flowchart)==null?void 0:i.defaultRenderer)==="elk"?!1:/^\s*graph/.test(e)},"detector"),px=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./flowDiagram-UKHOOZJN-BtIca__0.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([13,14,15,5,6,16,12,7,17]));return{id:mu,diagram:e}},"loader"),fx={id:mu,detector:gx,loader:px},mx=fx,yu="flowchart-v2",yx=p((e,t)=>{var r,i,s;return((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="dagre-d3"?!1:(((i=t==null?void 0:t.flowchart)==null?void 0:i.defaultRenderer)==="elk"&&(t.layout="elk"),/^\s*graph/.test(e)&&((s=t==null?void 0:t.flowchart)==null?void 0:s.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(e))},"detector"),Cx=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./flowDiagram-UKHOOZJN-BtIca__0.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([13,14,15,5,6,16,12,7,17]));return{id:yu,diagram:e}},"loader"),xx={id:yu,detector:yx,loader:Cx},bx=xx,Cu="swimlane",kx=p(e=>/^\s*swimlane-beta\b/.test(e),"detector"),Sx=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./swimlanesDiagram-ULZ7WXOC-DIP88zHc.js");return{diagram:t}},__vite__mapDeps([18,13,14,15,5,6,16,12,7,17]));return{id:Cu,diagram:e}},"loader"),Tx={id:Cu,detector:kx,loader:Sx},wx=Tx,xu="er",Bx=p(e=>/^\s*erDiagram/.test(e),"detector"),_x=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./erDiagram-JOGREHBK-CKTuwmcS.js");return{diagram:t}},__vite__mapDeps([19,15,5,6,16,17,7]));return{id:xu,diagram:e}},"loader"),vx={id:xu,detector:Bx,loader:_x},Lx=vx,bu="gitGraph",Fx=p(e=>/^\s*gitGraph/.test(e),"detector"),Mx=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./gitGraphDiagram-DS77QQ5N-DupWgFfq.js");return{diagram:t}},__vite__mapDeps([20,21,22,23,5,6,7]));return{id:bu,diagram:e}},"loader"),Ax={id:bu,detector:Fx,loader:Mx},Ex=Ax,ku="gantt",$x=p(e=>/^\s*gantt/.test(e),"detector"),Ox=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./ganttDiagram-PKOTCBZU-BsTpL-yb.js");return{diagram:t}},__vite__mapDeps([24,5,6,25,26,27,7]));return{id:ku,diagram:e}},"loader"),Ix={id:ku,detector:$x,loader:Ox},Dx=Ix,Su="info",Px=p(e=>/^\s*info/.test(e),"detector"),Rx=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./infoDiagram-6WML65LV-Dl6zW5rI.js");return{diagram:t}},__vite__mapDeps([28,23,5,6,7]));return{id:Su,diagram:e}},"loader"),qx={id:Su,detector:Px,loader:Rx},Tu="pie",Wx=p(e=>/^\s*pie/.test(e),"detector"),zx=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./pieDiagram-7S7Q4E2Y-B1kVpjEf.js");return{diagram:t}},__vite__mapDeps([29,22,23,5,6,30,31,26,7]));return{id:Tu,diagram:e}},"loader"),Nx={id:Tu,detector:Wx,loader:zx},wu="quadrantChart",Hx=p(e=>/^\s*quadrantChart/.test(e),"detector"),Yx=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./quadrantDiagram-CIZ2JOQS-Ce1mswm1.js");return{diagram:t}},__vite__mapDeps([32,5,6,25,26,27,7]));return{id:wu,diagram:e}},"loader"),jx={id:wu,detector:Hx,loader:Yx},Ux=jx,Bu="xychart",Xx=p(e=>/^\s*xychart(-beta)?/.test(e),"detector"),Gx=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./xychartDiagram-ELKLHX3M-Cqf4o1Vh.js");return{diagram:t}},__vite__mapDeps([33,5,6,26,31,25,27,7]));return{id:Bu,diagram:e}},"loader"),Vx={id:Bu,detector:Xx,loader:Gx},Zx=Vx,_u="requirement",Qx=p(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),Kx=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./requirementDiagram-LRYGKXZP-BMkVtH2s.js");return{diagram:t}},__vite__mapDeps([34,15,5,6,16,7]));return{id:_u,diagram:e}},"loader"),Jx={id:_u,detector:Qx,loader:Kx},tb=Jx,vu="sequence",eb=p(e=>/^\s*sequenceDiagram/.test(e),"detector"),rb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./sequenceDiagram-SI44F4Z6-D6lfXAnD.js");return{diagram:t}},__vite__mapDeps([35,21,12,5,6,7]));return{id:vu,diagram:e}},"loader"),ib={id:vu,detector:eb,loader:rb},sb=ib,Lu="class",ab=p((e,t)=>{var r;return((r=t==null?void 0:t.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e)},"detector"),ob=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./classDiagram-JCYQIIEL-DtPkX3wA.js");return{diagram:t}},__vite__mapDeps([36,37,14,15,5,6,16,12,7]));return{id:Lu,diagram:e}},"loader"),lb={id:Lu,detector:ab,loader:ob},nb=lb,Fu="classDiagram",hb=p((e,t)=>{var r;return/^\s*classDiagram/.test(e)&&((r=t==null?void 0:t.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e)},"detector"),cb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./classDiagram-v2-OCEON4UE-DtPkX3wA.js");return{diagram:t}},__vite__mapDeps([38,37,14,15,5,6,16,12,7]));return{id:Fu,diagram:e}},"loader"),db={id:Fu,detector:hb,loader:cb},ub=db,Mu="state",gb=p((e,t)=>{var r;return((r=t==null?void 0:t.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e)},"detector"),pb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./stateDiagram-OKZ733FA-CPFdYVIx.js");return{diagram:t}},__vite__mapDeps([39,40,15,5,6,16,12,7,2,4,3]));return{id:Mu,diagram:e}},"loader"),fb={id:Mu,detector:gb,loader:pb},mb=fb,Au="stateDiagram",yb=p((e,t)=>{var r;return!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&((r=t==null?void 0:t.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper")},"detector"),Cb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./stateDiagram-v2-UEYNNEHI-CBC6HwPm.js");return{diagram:t}},__vite__mapDeps([41,40,15,5,6,16,12,7]));return{id:Au,diagram:e}},"loader"),xb={id:Au,detector:yb,loader:Cb},bb=xb,Eu="journey",kb=p(e=>/^\s*journey/.test(e),"detector"),Sb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./journeyDiagram-NVQOT4AX-D1RTQQch.js");return{diagram:t}},__vite__mapDeps([42,14,12,5,6,30,7]));return{id:Eu,diagram:e}},"loader"),Tb={id:Eu,detector:kb,loader:Sb},wb=Tb,Bb=p((e,t,r)=>{z.debug(`rendering svg for syntax error -`);const i=Qp(t),s=i.append("g");i.attr("viewBox","0 0 2412 512"),$l(i,100,512,!0),s.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),s.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),s.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),s.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),s.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),s.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),s.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),s.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),$u={draw:Bb},_b=$u,vb={db:{},renderer:$u,parser:{parse:p(()=>{},"parse")}},Lb=vb,Ou="flowchart-elk",Fb=p((e,t={})=>{var r;return/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="elk"?(t.layout="elk",!0):!1},"detector"),Mb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./flowDiagram-UKHOOZJN-BtIca__0.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([13,14,15,5,6,16,12,7,17]));return{id:Ou,diagram:e}},"loader"),Ab={id:Ou,detector:Fb,loader:Mb},Eb=Ab,Iu="timeline",$b=p(e=>/^\s*timeline/.test(e),"detector"),Ob=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./timeline-definition-Z64GVDOM-CKcwRGgc.js");return{diagram:t}},__vite__mapDeps([43,5,6,30,7]));return{id:Iu,diagram:e}},"loader"),Ib={id:Iu,detector:$b,loader:Ob},Db=Ib,Du="mindmap",Pb=p(e=>/^\s*mindmap/.test(e),"detector"),Rb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./mindmap-definition-FAOFIHXS-oi9y3HSE.js");return{diagram:t}},__vite__mapDeps([44,15,5,6,16,7]));return{id:Du,diagram:e}},"loader"),qb={id:Du,detector:Pb,loader:Rb},Wb=qb,Pu="kanban",zb=p(e=>/^\s*kanban/.test(e),"detector"),Nb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./kanban-definition-27J2QSJJ-C8voMCH4.js");return{diagram:t}},__vite__mapDeps([45,14,5,6,7]));return{id:Pu,diagram:e}},"loader"),Hb={id:Pu,detector:zb,loader:Nb},Yb=Hb,Ru="sankey",jb=p(e=>/^\s*sankey(-beta)?/.test(e),"detector"),Ub=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./sankeyDiagram-W5VNT64P-gHIvLiGA.js");return{diagram:t}},__vite__mapDeps([46,5,6,31,26,7]));return{id:Ru,diagram:e}},"loader"),Xb={id:Ru,detector:jb,loader:Ub},Gb=Xb,qu="packet",Vb=p(e=>/^\s*packet(-beta)?/.test(e),"detector"),Zb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./diagram-LBJQPF4R-BZA2jWUX.js");return{diagram:t}},__vite__mapDeps([47,22,23,5,6,7]));return{id:qu,diagram:e}},"loader"),Qb={id:qu,detector:Vb,loader:Zb},Wu="radar",Kb=p(e=>/^\s*radar-beta/.test(e),"detector"),Jb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./diagram-UB23O5K3-2zSFzlV6.js");return{diagram:t}},__vite__mapDeps([48,22,23,5,6,7]));return{id:Wu,diagram:e}},"loader"),tk={id:Wu,detector:Kb,loader:Jb},zu="block",ek=p(e=>/^\s*block(-beta)?/.test(e),"detector"),rk=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./blockDiagram-VBNYF7ZC-BAJbaVfQ.js");return{diagram:t}},__vite__mapDeps([49,14,5,6,2,17,7]));return{id:zu,diagram:e}},"loader"),ik={id:zu,detector:ek,loader:rk},sk=ik,Nu="treeView",ak=p(e=>/^\s*treeView-beta/.test(e),"detector"),ok=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./diagram-7IWD3JNH-C3mTV4cL.js");return{diagram:t}},__vite__mapDeps([50,21,22,23,5,6,7]));return{id:Nu,diagram:e}},"loader"),lk={id:Nu,detector:ak,loader:ok},nk=lk,Hu="architecture",hk=p(e=>/^\s*architecture/.test(e),"detector"),ck=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./architectureDiagram-T3A2C74G-C47wDTji.js");return{diagram:t}},__vite__mapDeps([51,22,23,5,6,10,7]));return{id:Hu,diagram:e}},"loader"),dk={id:Hu,detector:hk,loader:ck},uk=dk,Yu="eventmodeling",gk=p(e=>/^\s*eventmodeling/.test(e),"detector"),pk=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./diagram-B4RE2ZJO-D66216sR.js");return{diagram:t}},__vite__mapDeps([52,22,23,5,6,7]));return{id:Yu,diagram:e}},"loader"),fk={id:Yu,detector:gk,loader:pk},mk=fk,ju="ishikawa",yk=p(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),Ck=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./ishikawaDiagram-WSZJBQD7-NBIjIwSA.js");return{diagram:t}},__vite__mapDeps([53,5,6,7]));return{id:ju,diagram:e}},"loader"),xk={id:ju,detector:yk,loader:Ck},Uu="venn",bk=p(e=>/^\s*venn-beta/.test(e),"detector"),kk=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./vennDiagram-T6HMQDX7-DpGQcsH1.js");return{diagram:t}},__vite__mapDeps([54,5,6,7]));return{id:Uu,diagram:e}},"loader"),Sk={id:Uu,detector:bk,loader:kk},Tk=Sk,Xu="treemap",wk=p(e=>/^\s*treemap/.test(e),"detector"),Bk=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./diagram-Q27KOJAE-Cpjz8RT3.js");return{diagram:t}},__vite__mapDeps([55,22,16,23,5,6,27,31,26,7]));return{id:Xu,diagram:e}},"loader"),_k={id:Xu,detector:wk,loader:Bk},Gu="wardley",vk=p(e=>/^\s*wardley-beta/i.test(e),"detector"),Lk=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./wardleyDiagram-T6FBY63Y-CUlxVcoQ.js");return{diagram:t}},__vite__mapDeps([56,22,23,5,6,7]));return{id:Gu,diagram:e}},"loader"),Fk={id:Gu,detector:vk,loader:Lk},Mk=Fk,Vu="cynefin",Ak=p(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),"detector"),Ek=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./cynefinDiagram-MW4NZA55-DScg9_Ly.js");return{diagram:t}},__vite__mapDeps([57,22,23,5,6,7]));return{id:Vu,diagram:e}},"loader"),$k={id:Vu,detector:Ak,loader:Ek},Zu="railroad",Ok=p(e=>/^\s*railroad-beta/i.test(e),"detector"),Ik=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./railroadDiagram-AXF67PYL-VReUdmSC.js");return{diagram:t}},__vite__mapDeps([58,59,22,5,6,23,7]));return{id:Zu,diagram:e}},"loader"),Dk={id:Zu,detector:Ok,loader:Ik},Qu="railroadEbnf",Pk=p(e=>/^\s*railroad-ebnf-beta/i.test(e),"detector"),Rk=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./ebnfDiagram-BXEA7PRR-_XPQYYfQ.js");return{diagram:t}},__vite__mapDeps([60,59,22,5,6,23,7]));return{id:Qu,diagram:e}},"loader"),qk={id:Qu,detector:Pk,loader:Rk},Ku="railroadAbnf",Wk=p(e=>/^\s*railroad-abnf-beta/i.test(e),"detector"),zk=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./abnfDiagram-N423BO3Z-RhYMe2zl.js");return{diagram:t}},__vite__mapDeps([61,59,22,5,6,23,7]));return{id:Ku,diagram:e}},"loader"),Nk={id:Ku,detector:Wk,loader:zk},Ju="railroadPeg",Hk=p(e=>/^\s*railroad-peg-beta/i.test(e),"detector"),Yk=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./pegDiagram-VL7TDLO6-CYzndrT-.js");return{diagram:t}},__vite__mapDeps([62,59,22,5,6,23,7]));return{id:Ju,diagram:e}},"loader"),jk={id:Ju,detector:Hk,loader:Yk},cl=!1,os=p(()=>{cl||(cl=!0,Bi("error",Lb,e=>e.toLowerCase().trim()==="error"),Bi("---",{db:{clear:p(()=>{},"clear")},styles:{},renderer:{draw:p(()=>{},"draw")},parser:{parse:p(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:p(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),Ss(Eb,Wb,uk),Ss(ux,Yb,ub,nb,Lx,Dx,qx,Nx,tb,sb,wx,bx,mx,Db,Ex,bb,mb,wb,Ux,Gb,Qb,Zx,sk,mk,nk,tk,xk,_k,Dk,qk,Nk,jk,Tk,Mk,$k))},"addDiagrams"),Uk=p(async()=>{z.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(Re).map(async([r,{detector:i,loader:s}])=>{if(s)try{_s(r)}catch{try{const{diagram:a,id:o}=await s();Bi(o,a,i)}catch(a){throw z.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete Re[r],a}}}))).filter(r=>r.status==="rejected");if(t.length>0){z.error(`Failed to load ${t.length} external diagrams`);for(const r of t)z.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),Xk="graphics-document document";function tg(e,t){e.attr("role",Xk),t!==""&&e.attr("aria-roledescription",t)}p(tg,"setA11yDiagramInfo");function eg(e,t,r,i){if(e.insert!==void 0){if(r){const s=`chart-desc-${i}`;e.attr("aria-describedby",s),e.insert("desc",":first-child").attr("id",s).text(r)}if(t){const s=`chart-title-${i}`;e.attr("aria-labelledby",s),e.insert("title",":first-child").attr("id",s).text(t)}}}p(eg,"addSVGa11yTitleDescription");var De,ca=(De=class{constructor(t,r,i,s,a){this.type=t,this.text=r,this.db=i,this.parser=s,this.renderer=a}static async fromText(t,r={}){var c,h;const i=Tt(),s=ga(t,i);t=oy(t)+` + L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),q0=p((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),W0=p((e,t,r)=>{const i=Tt(),{themeVariables:s}=i,{strokeWidth:a}=s,o=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");o.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),o.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),o.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),o.selectAll("*").attr("stroke-width",`${a}`)},"requirement_contains_neo"),z0={extension:x0,composition:b0,aggregation:k0,dependency:S0,lollipop:T0,point:w0,circle:B0,cross:_0,barb:v0,barbNeo:L0,only_one:F0,zero_or_one:M0,one_or_more:A0,zero_or_more:E0,only_one_neo:$0,zero_or_one_neo:O0,one_or_more_neo:I0,zero_or_more_neo:D0,requirement_arrow:P0,requirement_contains:q0,requirement_arrow_neo:R0,requirement_contains_neo:W0},N0=C0,H0={common:Qr,getConfig:Tt,insertCluster:RC,insertEdge:y0,insertEdgeLabel:c0,insertMarkers:N0,insertNode:su,interpolateToCurve:Da,labelHelper:it,log:z,positionEdgeLabel:d0},Xr={},nu=p(e=>{for(const t of e)Xr[t.name]=t},"registerLayoutLoaders"),Y0=p(()=>{nu([{name:"dagre",loader:p(async()=>await ht(()=>import("./dagre-VZM6K2ZE-PibdEig-.js"),__vite__mapDeps([0,1,2,3,4,5,6,7])),"loader")},{name:"swimlane",loader:p(async()=>await ht(()=>import("./swimlanes-SLNWSIFB-2I6D1dR6.js"),__vite__mapDeps([8,5,6,1,2,3,7])),"loader")},{name:"cose-bilkent",loader:p(async()=>await ht(()=>import("./cose-bilkent-JH36ORCC-0QYD6FmW.js"),__vite__mapDeps([9,10,5,6,7])),"loader")}])},"registerDefaultLayoutLoaders");Y0();var s2=p(async(e,t,r)=>{if(!(e.layoutAlgorithm in Xr))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(const d of e.nodes){const g=d.domId||d.id;d.domId=`${e.diagramId}-${g}`}const i=Xr[e.layoutAlgorithm],s=await i.loader(),{theme:a,themeVariables:o}=e.config,{useGradient:l,gradientStart:n,gradientStop:c}=o,h=t.attr("id");if(t.append("defs").append("filter").attr("id",`${h}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${a!=null&&a.includes("dark")?"#FFFFFF":"#000000"}`),t.append("defs").append("filter").attr("id",`${h}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${a!=null&&a.includes("dark")?"#FFFFFF":"#000000"}`),l){const d=t.append("linearGradient").attr("id",t.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");d.append("svg:stop").attr("offset","0%").attr("stop-color",n).attr("stop-opacity",1),d.append("svg:stop").attr("offset","100%").attr("stop-color",c).attr("stop-opacity",1)}return s.render(e,t,H0,{algorithm:i.algorithm},r)},"render"),a2=p((e="",{fallback:t="dagre"}={})=>{if(e in Xr)return e;if(t in Xr)return z.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm"),io="comm",hu="rule",cu="decl",j0="@media",U0="@import",X0="@supports",G0="@namespace",oa="@keyframes",du="@layer",V0="@scope",Z0=Math.abs,Wr=String.fromCharCode;function uu(e){return e.trim()}function la(e,t,r){return e.replace(t,r)}function tr(e,t){return e.charCodeAt(t)|0}function xr(e,t,r){return e.slice(t,r)}function ae(e){return e.length}function gu(e){return e.length}function hi(e,t){return t.push(e),e}var ss=1,br=1,pu=0,Gt=0,_t=0,Tr="";function so(e,t,r,i,s,a,o,l){return{value:e,root:t,parent:r,type:i,props:s,children:a,line:ss,column:br,length:o,return:"",siblings:l}}function Q0(){return _t}function K0(){return _t=Gt>0?tr(Tr,--Gt):0,br--,_t===10&&(br=1,ss--),_t}function te(){return _t=Gt2||Gr(_t)>3?"":" "}function rx(e,t){for(;--t&&te()&&!(_t<48||_t>102||_t>57&&_t<65||_t>70&&_t<97););return as(e,xi()+(t<6&&ke()==32&&te()==32))}function na(e){for(;te();)switch(_t){case e:return Gt;case 34:case 39:e!==34&&e!==39&&na(_t);break;case 40:e===41&&na(e);break;case 92:te();break}return Gt}function ix(e,t){for(;te()&&e+_t!==57;)if(e+_t===84&&ke()===47)break;return"/*"+as(t,Gt-1)+"*"+Wr(e===47?e:te())}function sx(e){for(;!Gr(ke());)te();return as(e,Gt)}function ax(e){return tx(bi("",null,null,null,[""],e=J0(e),0,[0],e))}function bi(e,t,r,i,s,a,o,l,n){for(var c=0,h=0,d=o,g=0,u=0,y=0,f=1,m=1,C=1,b=0,k=0,S="",T=s,w=a,L=i,v=S;m;)switch(y=k,k=te()){case 40:y!=108&&tr(v,d-1)==58?(b++,v+="("):v+=xs(k);break;case 41:b--,v+=")";break;case 34:case 39:case 91:v+=xs(k);break;case 9:case 10:case 13:case 32:if(b>0){v+=Wr(k);break}v+=ex(y);break;case 92:v+=rx(xi()-1,7);continue;case 47:switch(ke()){case 42:case 47:hi(ox(ix(te(),xi()),t,r,n),n),(Gr(y||1)==5||Gr(ke()||1)==5)&&ae(v)&&xr(v,-1,void 0)!==" "&&(v+=" ");break;default:v+="/"}break;case 123*f:l[c++]=ae(v)*C;case 125*f:case 59:case 0:if(b>0&&k){v+=Wr(k);break}switch(k){case 0:case 125:m=0;case 59+h:C==-1&&(v=la(v,/\f/g,"")),u>0&&(ae(v)-d||f===0)&&hi(u>32?hl(v+";",i,r,d-1,n):hl(la(v," ","")+";",i,r,d-2,n),n);break;case 59:v+=";";default:if(hi(L=nl(v,t,r,c,h,s,l,S,T=[],w=[],d,a),a),k===123)if(h===0)bi(v,t,L,L,T,a,d,l,w);else{switch(g){case 99:if(tr(v,3)===110)break;case 108:if(tr(v,2)===97)break;default:h=0;case 100:case 109:case 115:}h?bi(e,L,L,i&&hi(nl(e,L,L,0,0,s,l,S,s,T=[],d,w),w),s,w,d,l,i?T:w):bi(v,L,L,L,[""],w,0,l,w)}}c=h=u=0,f=C=1,S=v="",d=o;break;case 58:d=1+ae(v),u=y;default:if(f<1){if(k==123)--f;else if(k==125&&f++==0&&K0()==125)continue}switch(v+=Wr(k),k*f){case 38:C=h>0?1:(v+="\f",-1);break;case 44:if(b>0)break;l[c++]=(ae(v)-1)*C,C=1;break;case 64:ke()===45&&(v+=xs(te())),g=ke(),h=d=ae(S=v+=sx(xi())),k++;break;case 45:y===45&&ae(v)==2&&(f=0)}}return a}function nl(e,t,r,i,s,a,o,l,n,c,h,d){for(var g=s-1,u=s===0?a:[""],y=gu(u),f=0,m=0,C=0;f0?u[b]+" "+k:la(k,/&\f/g,u[b])))&&(n[C++]=S);return so(e,t,r,s===0?hu:l,n,c,h,d)}function ox(e,t,r,i){return so(e,t,r,io,Wr(Q0()),xr(e,2,-2),0,i)}function hl(e,t,r,i,s){return so(e,t,r,cu,xr(e,0,i),xr(e,i+1,-1),i,s)}function ha(e,t){for(var r="",i=0;i/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),cx=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./c4Diagram-5PPSVZJV-CYvD8vq6.js");return{diagram:t}},__vite__mapDeps([11,12,5,6,7]));return{id:fu,diagram:e}},"loader"),dx={id:fu,detector:hx,loader:cx},ux=dx,mu="flowchart",gx=p((e,t)=>{var r,i;return((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="dagre-wrapper"||((i=t==null?void 0:t.flowchart)==null?void 0:i.defaultRenderer)==="elk"?!1:/^\s*graph/.test(e)},"detector"),px=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./flowDiagram-UKHOOZJN-DjW8-Nxh.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([13,14,15,5,6,16,12,7,17]));return{id:mu,diagram:e}},"loader"),fx={id:mu,detector:gx,loader:px},mx=fx,yu="flowchart-v2",yx=p((e,t)=>{var r,i,s;return((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="dagre-d3"?!1:(((i=t==null?void 0:t.flowchart)==null?void 0:i.defaultRenderer)==="elk"&&(t.layout="elk"),/^\s*graph/.test(e)&&((s=t==null?void 0:t.flowchart)==null?void 0:s.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(e))},"detector"),Cx=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./flowDiagram-UKHOOZJN-DjW8-Nxh.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([13,14,15,5,6,16,12,7,17]));return{id:yu,diagram:e}},"loader"),xx={id:yu,detector:yx,loader:Cx},bx=xx,Cu="swimlane",kx=p(e=>/^\s*swimlane-beta\b/.test(e),"detector"),Sx=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./swimlanesDiagram-ULZ7WXOC-COw-LLw5.js");return{diagram:t}},__vite__mapDeps([18,13,14,15,5,6,16,12,7,17]));return{id:Cu,diagram:e}},"loader"),Tx={id:Cu,detector:kx,loader:Sx},wx=Tx,xu="er",Bx=p(e=>/^\s*erDiagram/.test(e),"detector"),_x=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./erDiagram-JOGREHBK-54K1t1Ec.js");return{diagram:t}},__vite__mapDeps([19,15,5,6,16,17,7]));return{id:xu,diagram:e}},"loader"),vx={id:xu,detector:Bx,loader:_x},Lx=vx,bu="gitGraph",Fx=p(e=>/^\s*gitGraph/.test(e),"detector"),Mx=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./gitGraphDiagram-DS77QQ5N-CIVsYAyY.js");return{diagram:t}},__vite__mapDeps([20,21,22,23,5,6,7]));return{id:bu,diagram:e}},"loader"),Ax={id:bu,detector:Fx,loader:Mx},Ex=Ax,ku="gantt",$x=p(e=>/^\s*gantt/.test(e),"detector"),Ox=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./ganttDiagram-PKOTCBZU-DYJw_19U.js");return{diagram:t}},__vite__mapDeps([24,5,6,25,26,27,7]));return{id:ku,diagram:e}},"loader"),Ix={id:ku,detector:$x,loader:Ox},Dx=Ix,Su="info",Px=p(e=>/^\s*info/.test(e),"detector"),Rx=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./infoDiagram-6WML65LV-D6hoQeyX.js");return{diagram:t}},__vite__mapDeps([28,23,5,6,7]));return{id:Su,diagram:e}},"loader"),qx={id:Su,detector:Px,loader:Rx},Tu="pie",Wx=p(e=>/^\s*pie/.test(e),"detector"),zx=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./pieDiagram-7S7Q4E2Y-VRiU9rtm.js");return{diagram:t}},__vite__mapDeps([29,22,23,5,6,30,31,26,7]));return{id:Tu,diagram:e}},"loader"),Nx={id:Tu,detector:Wx,loader:zx},wu="quadrantChart",Hx=p(e=>/^\s*quadrantChart/.test(e),"detector"),Yx=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./quadrantDiagram-CIZ2JOQS-JooZIzGd.js");return{diagram:t}},__vite__mapDeps([32,5,6,25,26,27,7]));return{id:wu,diagram:e}},"loader"),jx={id:wu,detector:Hx,loader:Yx},Ux=jx,Bu="xychart",Xx=p(e=>/^\s*xychart(-beta)?/.test(e),"detector"),Gx=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./xychartDiagram-ELKLHX3M-B9DRjIoI.js");return{diagram:t}},__vite__mapDeps([33,5,6,26,31,25,27,7]));return{id:Bu,diagram:e}},"loader"),Vx={id:Bu,detector:Xx,loader:Gx},Zx=Vx,_u="requirement",Qx=p(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),Kx=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./requirementDiagram-LRYGKXZP-CAxqjuVx.js");return{diagram:t}},__vite__mapDeps([34,15,5,6,16,7]));return{id:_u,diagram:e}},"loader"),Jx={id:_u,detector:Qx,loader:Kx},tb=Jx,vu="sequence",eb=p(e=>/^\s*sequenceDiagram/.test(e),"detector"),rb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./sequenceDiagram-SI44F4Z6-CRNvuVv8.js");return{diagram:t}},__vite__mapDeps([35,21,12,5,6,7]));return{id:vu,diagram:e}},"loader"),ib={id:vu,detector:eb,loader:rb},sb=ib,Lu="class",ab=p((e,t)=>{var r;return((r=t==null?void 0:t.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e)},"detector"),ob=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./classDiagram-JCYQIIEL-DcvvubKo.js");return{diagram:t}},__vite__mapDeps([36,37,14,15,5,6,16,12,7]));return{id:Lu,diagram:e}},"loader"),lb={id:Lu,detector:ab,loader:ob},nb=lb,Fu="classDiagram",hb=p((e,t)=>{var r;return/^\s*classDiagram/.test(e)&&((r=t==null?void 0:t.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e)},"detector"),cb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./classDiagram-v2-OCEON4UE-DcvvubKo.js");return{diagram:t}},__vite__mapDeps([38,37,14,15,5,6,16,12,7]));return{id:Fu,diagram:e}},"loader"),db={id:Fu,detector:hb,loader:cb},ub=db,Mu="state",gb=p((e,t)=>{var r;return((r=t==null?void 0:t.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e)},"detector"),pb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./stateDiagram-OKZ733FA-BvoTa-1C.js");return{diagram:t}},__vite__mapDeps([39,40,15,5,6,16,12,7,2,4,3]));return{id:Mu,diagram:e}},"loader"),fb={id:Mu,detector:gb,loader:pb},mb=fb,Au="stateDiagram",yb=p((e,t)=>{var r;return!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&((r=t==null?void 0:t.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper")},"detector"),Cb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./stateDiagram-v2-UEYNNEHI-QJ3-Svac.js");return{diagram:t}},__vite__mapDeps([41,40,15,5,6,16,12,7]));return{id:Au,diagram:e}},"loader"),xb={id:Au,detector:yb,loader:Cb},bb=xb,Eu="journey",kb=p(e=>/^\s*journey/.test(e),"detector"),Sb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./journeyDiagram-NVQOT4AX-7MLSoqp5.js");return{diagram:t}},__vite__mapDeps([42,14,12,5,6,30,7]));return{id:Eu,diagram:e}},"loader"),Tb={id:Eu,detector:kb,loader:Sb},wb=Tb,Bb=p((e,t,r)=>{z.debug(`rendering svg for syntax error +`);const i=Qp(t),s=i.append("g");i.attr("viewBox","0 0 2412 512"),$l(i,100,512,!0),s.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),s.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),s.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),s.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),s.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),s.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),s.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),s.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),$u={draw:Bb},_b=$u,vb={db:{},renderer:$u,parser:{parse:p(()=>{},"parse")}},Lb=vb,Ou="flowchart-elk",Fb=p((e,t={})=>{var r;return/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="elk"?(t.layout="elk",!0):!1},"detector"),Mb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./flowDiagram-UKHOOZJN-DjW8-Nxh.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([13,14,15,5,6,16,12,7,17]));return{id:Ou,diagram:e}},"loader"),Ab={id:Ou,detector:Fb,loader:Mb},Eb=Ab,Iu="timeline",$b=p(e=>/^\s*timeline/.test(e),"detector"),Ob=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./timeline-definition-Z64GVDOM-mpZy5ZHk.js");return{diagram:t}},__vite__mapDeps([43,5,6,30,7]));return{id:Iu,diagram:e}},"loader"),Ib={id:Iu,detector:$b,loader:Ob},Db=Ib,Du="mindmap",Pb=p(e=>/^\s*mindmap/.test(e),"detector"),Rb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./mindmap-definition-FAOFIHXS-CYwjbq4J.js");return{diagram:t}},__vite__mapDeps([44,15,5,6,16,7]));return{id:Du,diagram:e}},"loader"),qb={id:Du,detector:Pb,loader:Rb},Wb=qb,Pu="kanban",zb=p(e=>/^\s*kanban/.test(e),"detector"),Nb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./kanban-definition-27J2QSJJ-L7GQgpCH.js");return{diagram:t}},__vite__mapDeps([45,14,5,6,7]));return{id:Pu,diagram:e}},"loader"),Hb={id:Pu,detector:zb,loader:Nb},Yb=Hb,Ru="sankey",jb=p(e=>/^\s*sankey(-beta)?/.test(e),"detector"),Ub=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./sankeyDiagram-W5VNT64P-BTjDTukV.js");return{diagram:t}},__vite__mapDeps([46,5,6,31,26,7]));return{id:Ru,diagram:e}},"loader"),Xb={id:Ru,detector:jb,loader:Ub},Gb=Xb,qu="packet",Vb=p(e=>/^\s*packet(-beta)?/.test(e),"detector"),Zb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./diagram-LBJQPF4R-BE5KJAJ0.js");return{diagram:t}},__vite__mapDeps([47,22,23,5,6,7]));return{id:qu,diagram:e}},"loader"),Qb={id:qu,detector:Vb,loader:Zb},Wu="radar",Kb=p(e=>/^\s*radar-beta/.test(e),"detector"),Jb=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./diagram-UB23O5K3-AYjZ4Axz.js");return{diagram:t}},__vite__mapDeps([48,22,23,5,6,7]));return{id:Wu,diagram:e}},"loader"),tk={id:Wu,detector:Kb,loader:Jb},zu="block",ek=p(e=>/^\s*block(-beta)?/.test(e),"detector"),rk=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./blockDiagram-VBNYF7ZC-D4I7ydgD.js");return{diagram:t}},__vite__mapDeps([49,14,5,6,2,17,7]));return{id:zu,diagram:e}},"loader"),ik={id:zu,detector:ek,loader:rk},sk=ik,Nu="treeView",ak=p(e=>/^\s*treeView-beta/.test(e),"detector"),ok=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./diagram-7IWD3JNH-cddjCR_8.js");return{diagram:t}},__vite__mapDeps([50,21,22,23,5,6,7]));return{id:Nu,diagram:e}},"loader"),lk={id:Nu,detector:ak,loader:ok},nk=lk,Hu="architecture",hk=p(e=>/^\s*architecture/.test(e),"detector"),ck=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./architectureDiagram-T3A2C74G-ysR-aM43.js");return{diagram:t}},__vite__mapDeps([51,22,23,5,6,10,7]));return{id:Hu,diagram:e}},"loader"),dk={id:Hu,detector:hk,loader:ck},uk=dk,Yu="eventmodeling",gk=p(e=>/^\s*eventmodeling/.test(e),"detector"),pk=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./diagram-B4RE2ZJO-CyMxecTz.js");return{diagram:t}},__vite__mapDeps([52,22,23,5,6,7]));return{id:Yu,diagram:e}},"loader"),fk={id:Yu,detector:gk,loader:pk},mk=fk,ju="ishikawa",yk=p(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),Ck=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./ishikawaDiagram-WSZJBQD7-Di5hDQFl.js");return{diagram:t}},__vite__mapDeps([53,5,6,7]));return{id:ju,diagram:e}},"loader"),xk={id:ju,detector:yk,loader:Ck},Uu="venn",bk=p(e=>/^\s*venn-beta/.test(e),"detector"),kk=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./vennDiagram-T6HMQDX7-23c87AQK.js");return{diagram:t}},__vite__mapDeps([54,5,6,7]));return{id:Uu,diagram:e}},"loader"),Sk={id:Uu,detector:bk,loader:kk},Tk=Sk,Xu="treemap",wk=p(e=>/^\s*treemap/.test(e),"detector"),Bk=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./diagram-Q27KOJAE-DiL6LnT_.js");return{diagram:t}},__vite__mapDeps([55,22,16,23,5,6,27,31,26,7]));return{id:Xu,diagram:e}},"loader"),_k={id:Xu,detector:wk,loader:Bk},Gu="wardley",vk=p(e=>/^\s*wardley-beta/i.test(e),"detector"),Lk=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./wardleyDiagram-T6FBY63Y-jNpCtSMU.js");return{diagram:t}},__vite__mapDeps([56,22,23,5,6,7]));return{id:Gu,diagram:e}},"loader"),Fk={id:Gu,detector:vk,loader:Lk},Mk=Fk,Vu="cynefin",Ak=p(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),"detector"),Ek=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./cynefinDiagram-MW4NZA55-DfWTsCcM.js");return{diagram:t}},__vite__mapDeps([57,22,23,5,6,7]));return{id:Vu,diagram:e}},"loader"),$k={id:Vu,detector:Ak,loader:Ek},Zu="railroad",Ok=p(e=>/^\s*railroad-beta/i.test(e),"detector"),Ik=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./railroadDiagram-AXF67PYL-B0NVnjyw.js");return{diagram:t}},__vite__mapDeps([58,59,22,5,6,23,7]));return{id:Zu,diagram:e}},"loader"),Dk={id:Zu,detector:Ok,loader:Ik},Qu="railroadEbnf",Pk=p(e=>/^\s*railroad-ebnf-beta/i.test(e),"detector"),Rk=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./ebnfDiagram-BXEA7PRR-CX7MIWlm.js");return{diagram:t}},__vite__mapDeps([60,59,22,5,6,23,7]));return{id:Qu,diagram:e}},"loader"),qk={id:Qu,detector:Pk,loader:Rk},Ku="railroadAbnf",Wk=p(e=>/^\s*railroad-abnf-beta/i.test(e),"detector"),zk=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./abnfDiagram-N423BO3Z-CQmvc3R1.js");return{diagram:t}},__vite__mapDeps([61,59,22,5,6,23,7]));return{id:Ku,diagram:e}},"loader"),Nk={id:Ku,detector:Wk,loader:zk},Ju="railroadPeg",Hk=p(e=>/^\s*railroad-peg-beta/i.test(e),"detector"),Yk=p(async()=>{const{diagram:e}=await ht(async()=>{const{diagram:t}=await import("./pegDiagram-VL7TDLO6-DY_WljuU.js");return{diagram:t}},__vite__mapDeps([62,59,22,5,6,23,7]));return{id:Ju,diagram:e}},"loader"),jk={id:Ju,detector:Hk,loader:Yk},cl=!1,os=p(()=>{cl||(cl=!0,Bi("error",Lb,e=>e.toLowerCase().trim()==="error"),Bi("---",{db:{clear:p(()=>{},"clear")},styles:{},renderer:{draw:p(()=>{},"draw")},parser:{parse:p(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:p(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),Ss(Eb,Wb,uk),Ss(ux,Yb,ub,nb,Lx,Dx,qx,Nx,tb,sb,wx,bx,mx,Db,Ex,bb,mb,wb,Ux,Gb,Qb,Zx,sk,mk,nk,tk,xk,_k,Dk,qk,Nk,jk,Tk,Mk,$k))},"addDiagrams"),Uk=p(async()=>{z.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(Re).map(async([r,{detector:i,loader:s}])=>{if(s)try{_s(r)}catch{try{const{diagram:a,id:o}=await s();Bi(o,a,i)}catch(a){throw z.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete Re[r],a}}}))).filter(r=>r.status==="rejected");if(t.length>0){z.error(`Failed to load ${t.length} external diagrams`);for(const r of t)z.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),Xk="graphics-document document";function tg(e,t){e.attr("role",Xk),t!==""&&e.attr("aria-roledescription",t)}p(tg,"setA11yDiagramInfo");function eg(e,t,r,i){if(e.insert!==void 0){if(r){const s=`chart-desc-${i}`;e.attr("aria-describedby",s),e.insert("desc",":first-child").attr("id",s).text(r)}if(t){const s=`chart-title-${i}`;e.attr("aria-labelledby",s),e.insert("title",":first-child").attr("id",s).text(t)}}}p(eg,"addSVGa11yTitleDescription");var De,ca=(De=class{constructor(t,r,i,s,a){this.type=t,this.text=r,this.db=i,this.parser=s,this.renderer=a}static async fromText(t,r={}){var c,h;const i=Tt(),s=ga(t,i);t=oy(t)+` `;try{_s(s)}catch{const d=ap(s);if(!d)throw new vl(`Diagram ${s} not found.`);const{id:g,diagram:u}=await d();Bi(g,u)}const{db:a,parser:o,renderer:l,init:n}=_s(s);return o.parser&&(o.parser.yy=a),(c=a.clear)==null||c.call(a),n==null||n(i),r.title&&((h=a.setDiagramTitle)==null||h.call(a,r.title)),await o.parse(t),new De(s,t,a,o,l)}async render(t,r){await this.renderer.draw(this.text,t,r,this)}getParser(){return this.parser}getType(){return this.type}},p(De,"Diagram"),De),dl=[],Gk=p(()=>{dl.forEach(e=>{e()}),dl=[]},"attachFunctions"),Vk=p(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function rg(e){const t=e.match(_l);if(!t)return{text:e,metadata:{}};const r=t[1],i=r?t[2].split(` `).map(o=>o.startsWith(r)?o.slice(r.length):o).join(` `):t[2];let s=am(i,{schema:sm})??{};s=typeof s=="object"&&!Array.isArray(s)?s:{};const a={};return s.displayMode&&(a.displayMode=s.displayMode.toString()),s.title&&(a.title=s.title.toString()),s.config&&(a.config=s.config),{text:e.slice(t[0].length),metadata:a}}p(rg,"extractFrontMatter");var Zk=p(e=>e.replace(/\r\n?/g,` diff --git a/veadk/webui/assets/visualizations/mermaid/mindmap-definition-FAOFIHXS-oi9y3HSE.js b/veadk/webui/assets/visualizations/mermaid/mindmap-definition-FAOFIHXS-CYwjbq4J.js similarity index 98% rename from veadk/webui/assets/visualizations/mermaid/mindmap-definition-FAOFIHXS-oi9y3HSE.js rename to veadk/webui/assets/visualizations/mermaid/mindmap-definition-FAOFIHXS-CYwjbq4J.js index d8db28c28..5d72fbbee 100644 --- a/veadk/webui/assets/visualizations/mermaid/mindmap-definition-FAOFIHXS-oi9y3HSE.js +++ b/veadk/webui/assets/visualizations/mermaid/mindmap-definition-FAOFIHXS-CYwjbq4J.js @@ -1,4 +1,4 @@ -import{g as oe}from"./chunk-XXDRQBXY-B8qTF1qQ.js";import{s as ce}from"./chunk-KBJHAD2P-DtNDDRN1.js";import{a as h,at as R,a4 as le,aK as he,X as de,O as W,Y as U,aN as H,aa as ge,ak as ue,ap as pe,H as fe}from"./mermaid.core-y4TF8bTw.js";import"../../app/index-BNPwMQXG.js";import"../../chunks/purify.es-BnINGy_Y.js";const _=[];for(let t=0;t<256;++t)_.push((t+256).toString(16).slice(1));function me(t,e=0){return(_[t[e+0]]+_[t[e+1]]+_[t[e+2]]+_[t[e+3]]+"-"+_[t[e+4]]+_[t[e+5]]+"-"+_[t[e+6]]+_[t[e+7]]+"-"+_[t[e+8]]+_[t[e+9]]+"-"+_[t[e+10]]+_[t[e+11]]+_[t[e+12]]+_[t[e+13]]+_[t[e+14]]+_[t[e+15]]).toLowerCase()}const ye=new Uint8Array(16);function Ee(){return crypto.getRandomValues(ye)}function _e(t,e,o){return crypto.randomUUID?crypto.randomUUID():ke(t)}function ke(t,e,o){var n;t=t||{};const l=t.random??((n=t.rng)==null?void 0:n.call(t))??Ee();if(l.length<16)throw new Error("Random bytes length must be >= 16");return l[6]=l[6]&15|64,l[8]=l[8]&63|128,me(l)}var J=function(){var t=h(function(O,s,i,a){for(i=i||{},a=O.length;a--;i[O[a]]=s);return i},"o"),e=[1,4],o=[1,13],l=[1,12],n=[1,15],d=[1,16],p=[1,20],y=[1,19],E=[6,7,8],b=[1,26],L=[1,24],D=[1,25],k=[6,7,11],$=[1,6,13,15,16,19,22],f=[1,33],B=[1,34],P=[1,6,7,11,13,15,16,19,22],X={trace:h(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:h(function(s,i,a,c,u,r,M){var g=r.length-1;switch(u){case 6:case 7:return c;case 8:c.getLogger().trace("Stop NL ");break;case 9:c.getLogger().trace("Stop EOF ");break;case 11:c.getLogger().trace("Stop NL2 ");break;case 12:c.getLogger().trace("Stop EOF2 ");break;case 15:c.getLogger().info("Node: ",r[g].id),c.addNode(r[g-1].length,r[g].id,r[g].descr,r[g].type);break;case 16:c.getLogger().trace("Icon: ",r[g]),c.decorateNode({icon:r[g]});break;case 17:case 21:c.decorateNode({class:r[g]});break;case 18:c.getLogger().trace("SPACELIST");break;case 19:c.getLogger().trace("Node: ",r[g].id),c.addNode(0,r[g].id,r[g].descr,r[g].type);break;case 20:c.decorateNode({icon:r[g]});break;case 25:c.getLogger().trace("node found ..",r[g-2]),this.$={id:r[g-1],descr:r[g-1],type:c.getType(r[g-2],r[g])};break;case 26:this.$={id:r[g],descr:r[g],type:c.nodeType.DEFAULT};break;case 27:c.getLogger().trace("node found ..",r[g-3]),this.$={id:r[g-3],descr:r[g-1],type:c.getType(r[g-2],r[g])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:o,7:[1,10],9:9,12:11,13:l,14:14,15:n,16:d,17:17,18:18,19:p,22:y},t(E,[2,3]),{1:[2,2]},t(E,[2,4]),t(E,[2,5]),{1:[2,6],6:o,12:21,13:l,14:14,15:n,16:d,17:17,18:18,19:p,22:y},{6:o,9:22,12:11,13:l,14:14,15:n,16:d,17:17,18:18,19:p,22:y},{6:b,7:L,10:23,11:D},t(k,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:p,22:y}),t(k,[2,18]),t(k,[2,19]),t(k,[2,20]),t(k,[2,21]),t(k,[2,23]),t(k,[2,24]),t(k,[2,26],{19:[1,30]}),{20:[1,31]},{6:b,7:L,10:32,11:D},{1:[2,7],6:o,12:21,13:l,14:14,15:n,16:d,17:17,18:18,19:p,22:y},t($,[2,14],{7:f,11:B}),t(P,[2,8]),t(P,[2,9]),t(P,[2,10]),t(k,[2,15]),t(k,[2,16]),t(k,[2,17]),{20:[1,35]},{21:[1,36]},t($,[2,13],{7:f,11:B}),t(P,[2,11]),t(P,[2,12]),{21:[1,37]},t(k,[2,25]),t(k,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:h(function(s,i){if(i.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=i,a}},"parseError"),parse:h(function(s){var i=this,a=[0],c=[],u=[null],r=[],M=this.table,g="",F=0,Q=0,ie=2,Z=1,se=r.slice.call(arguments,1),m=Object.create(this.lexer),C={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(C.yy[z]=this.yy[z]);m.setInput(s,C.yy),C.yy.lexer=m,C.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var Y=m.yylloc;r.push(Y);var re=m.options&&m.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ae(x){a.length=a.length-2*x,u.length=u.length-x,r.length=r.length-x}h(ae,"popStack");function ee(){var x;return x=c.pop()||m.lex()||Z,typeof x!="number"&&(x instanceof Array&&(c=x,x=c.pop()),x=i.symbols_[x]||x),x}h(ee,"lex");for(var S,I,N,K,w={},G,v,te,j;;){if(I=a[a.length-1],this.defaultActions[I]?N=this.defaultActions[I]:((S===null||typeof S>"u")&&(S=ee()),N=M[I]&&M[I][S]),typeof N>"u"||!N.length||!N[0]){var q="";j=[];for(G in M[I])this.terminals_[G]&&G>ie&&j.push("'"+this.terminals_[G]+"'");m.showPosition?q="Parse error on line "+(F+1)+`: +import{g as oe}from"./chunk-XXDRQBXY-BdI3VXTi.js";import{s as ce}from"./chunk-KBJHAD2P-C0rklDe7.js";import{a as h,at as R,a4 as le,aK as he,X as de,O as W,Y as U,aN as H,aa as ge,ak as ue,ap as pe,H as fe}from"./mermaid.core-DAx4nvmm.js";import"../../app/index-8JtvDNuA.js";import"../../chunks/purify.es-BnINGy_Y.js";const _=[];for(let t=0;t<256;++t)_.push((t+256).toString(16).slice(1));function me(t,e=0){return(_[t[e+0]]+_[t[e+1]]+_[t[e+2]]+_[t[e+3]]+"-"+_[t[e+4]]+_[t[e+5]]+"-"+_[t[e+6]]+_[t[e+7]]+"-"+_[t[e+8]]+_[t[e+9]]+"-"+_[t[e+10]]+_[t[e+11]]+_[t[e+12]]+_[t[e+13]]+_[t[e+14]]+_[t[e+15]]).toLowerCase()}const ye=new Uint8Array(16);function Ee(){return crypto.getRandomValues(ye)}function _e(t,e,o){return crypto.randomUUID?crypto.randomUUID():ke(t)}function ke(t,e,o){var n;t=t||{};const l=t.random??((n=t.rng)==null?void 0:n.call(t))??Ee();if(l.length<16)throw new Error("Random bytes length must be >= 16");return l[6]=l[6]&15|64,l[8]=l[8]&63|128,me(l)}var J=function(){var t=h(function(O,s,i,a){for(i=i||{},a=O.length;a--;i[O[a]]=s);return i},"o"),e=[1,4],o=[1,13],l=[1,12],n=[1,15],d=[1,16],p=[1,20],y=[1,19],E=[6,7,8],b=[1,26],L=[1,24],D=[1,25],k=[6,7,11],$=[1,6,13,15,16,19,22],f=[1,33],B=[1,34],P=[1,6,7,11,13,15,16,19,22],X={trace:h(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:h(function(s,i,a,c,u,r,M){var g=r.length-1;switch(u){case 6:case 7:return c;case 8:c.getLogger().trace("Stop NL ");break;case 9:c.getLogger().trace("Stop EOF ");break;case 11:c.getLogger().trace("Stop NL2 ");break;case 12:c.getLogger().trace("Stop EOF2 ");break;case 15:c.getLogger().info("Node: ",r[g].id),c.addNode(r[g-1].length,r[g].id,r[g].descr,r[g].type);break;case 16:c.getLogger().trace("Icon: ",r[g]),c.decorateNode({icon:r[g]});break;case 17:case 21:c.decorateNode({class:r[g]});break;case 18:c.getLogger().trace("SPACELIST");break;case 19:c.getLogger().trace("Node: ",r[g].id),c.addNode(0,r[g].id,r[g].descr,r[g].type);break;case 20:c.decorateNode({icon:r[g]});break;case 25:c.getLogger().trace("node found ..",r[g-2]),this.$={id:r[g-1],descr:r[g-1],type:c.getType(r[g-2],r[g])};break;case 26:this.$={id:r[g],descr:r[g],type:c.nodeType.DEFAULT};break;case 27:c.getLogger().trace("node found ..",r[g-3]),this.$={id:r[g-3],descr:r[g-1],type:c.getType(r[g-2],r[g])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:o,7:[1,10],9:9,12:11,13:l,14:14,15:n,16:d,17:17,18:18,19:p,22:y},t(E,[2,3]),{1:[2,2]},t(E,[2,4]),t(E,[2,5]),{1:[2,6],6:o,12:21,13:l,14:14,15:n,16:d,17:17,18:18,19:p,22:y},{6:o,9:22,12:11,13:l,14:14,15:n,16:d,17:17,18:18,19:p,22:y},{6:b,7:L,10:23,11:D},t(k,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:p,22:y}),t(k,[2,18]),t(k,[2,19]),t(k,[2,20]),t(k,[2,21]),t(k,[2,23]),t(k,[2,24]),t(k,[2,26],{19:[1,30]}),{20:[1,31]},{6:b,7:L,10:32,11:D},{1:[2,7],6:o,12:21,13:l,14:14,15:n,16:d,17:17,18:18,19:p,22:y},t($,[2,14],{7:f,11:B}),t(P,[2,8]),t(P,[2,9]),t(P,[2,10]),t(k,[2,15]),t(k,[2,16]),t(k,[2,17]),{20:[1,35]},{21:[1,36]},t($,[2,13],{7:f,11:B}),t(P,[2,11]),t(P,[2,12]),{21:[1,37]},t(k,[2,25]),t(k,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:h(function(s,i){if(i.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=i,a}},"parseError"),parse:h(function(s){var i=this,a=[0],c=[],u=[null],r=[],M=this.table,g="",F=0,Q=0,ie=2,Z=1,se=r.slice.call(arguments,1),m=Object.create(this.lexer),C={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(C.yy[z]=this.yy[z]);m.setInput(s,C.yy),C.yy.lexer=m,C.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var Y=m.yylloc;r.push(Y);var re=m.options&&m.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ae(x){a.length=a.length-2*x,u.length=u.length-x,r.length=r.length-x}h(ae,"popStack");function ee(){var x;return x=c.pop()||m.lex()||Z,typeof x!="number"&&(x instanceof Array&&(c=x,x=c.pop()),x=i.symbols_[x]||x),x}h(ee,"lex");for(var S,I,N,K,w={},G,v,te,j;;){if(I=a[a.length-1],this.defaultActions[I]?N=this.defaultActions[I]:((S===null||typeof S>"u")&&(S=ee()),N=M[I]&&M[I][S]),typeof N>"u"||!N.length||!N[0]){var q="";j=[];for(G in M[I])this.terminals_[G]&&G>ie&&j.push("'"+this.terminals_[G]+"'");m.showPosition?q="Parse error on line "+(F+1)+`: `+m.showPosition()+` Expecting `+j.join(", ")+", got '"+(this.terminals_[S]||S)+"'":q="Parse error on line "+(F+1)+": Unexpected "+(S==Z?"end of input":"'"+(this.terminals_[S]||S)+"'"),this.parseError(q,{text:m.match,token:this.terminals_[S]||S,line:m.yylineno,loc:Y,expected:j})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+I+", token: "+S);switch(N[0]){case 1:a.push(S),u.push(m.yytext),r.push(m.yylloc),a.push(N[1]),S=null,Q=m.yyleng,g=m.yytext,F=m.yylineno,Y=m.yylloc;break;case 2:if(v=this.productions_[N[1]][1],w.$=u[u.length-v],w._$={first_line:r[r.length-(v||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(v||1)].first_column,last_column:r[r.length-1].last_column},re&&(w._$.range=[r[r.length-(v||1)].range[0],r[r.length-1].range[1]]),K=this.performAction.apply(w,[g,Q,F,C.yy,N[1],u,r].concat(se)),typeof K<"u")return K;v&&(a=a.slice(0,-1*v*2),u=u.slice(0,-1*v),r=r.slice(0,-1*v)),a.push(this.productions_[N[1]][0]),u.push(w.$),r.push(w._$),te=M[a[a.length-2]][a[a.length-1]],a.push(te);break;case 3:return!0}}return!0},"parse")},ne=function(){var O={EOF:1,parseError:h(function(i,a){if(this.yy.parser)this.yy.parser.parseError(i,a);else throw new Error(i)},"parseError"),setInput:h(function(s,i){return this.yy=i||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:h(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var i=s.match(/(?:\r\n?|\n).*/g);return i?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:h(function(s){var i=s.length,a=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var c=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var u=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===c.length?this.yylloc.first_column:0)+c[c.length-a.length].length-a[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:h(function(){return this._more=!0,this},"more"),reject:h(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:h(function(s){this.unput(this.match.slice(s))},"less"),pastInput:h(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:h(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:h(function(){var s=this.pastInput(),i=new Array(s.length+1).join("-");return s+this.upcomingInput()+` diff --git a/veadk/webui/assets/visualizations/mermaid/pegDiagram-VL7TDLO6-CYzndrT-.js b/veadk/webui/assets/visualizations/mermaid/pegDiagram-VL7TDLO6-DY_WljuU.js similarity index 87% rename from veadk/webui/assets/visualizations/mermaid/pegDiagram-VL7TDLO6-CYzndrT-.js rename to veadk/webui/assets/visualizations/mermaid/pegDiagram-VL7TDLO6-DY_WljuU.js index f5760d713..015fd3f22 100644 --- a/veadk/webui/assets/visualizations/mermaid/pegDiagram-VL7TDLO6-CYzndrT-.js +++ b/veadk/webui/assets/visualizations/mermaid/pegDiagram-VL7TDLO6-DY_WljuU.js @@ -1 +1 @@ -import{g as l,r as m,d as a}from"./chunk-6Q2QTUOP-zEQK1XLO.js";import{p}from"./chunk-JWPE2WC7-DD-BFVC6.js";import{a as t,at as o}from"./mermaid.core-y4TF8bTw.js";import"../../app/index-BNPwMQXG.js";import{M as u,b as c}from"./cynefin-OW5HDTMX-DBq9B5VP.js";import"../../chunks/purify.es-BnINGy_Y.js";var f=c().RailroadPeg.parser.LangiumParser,i=t(e=>{const r=e.alternatives.map(d);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformOrderedChoice"),d=t(e=>{const r=e.elements.map(P);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),P=t(e=>{const r=g(e.suffix);return e.operator?{type:"special",text:e.operator==="&"?`&${s(r)}`:`!${s(r)}`}:r},"transformPrefix"),s=t(e=>{switch(e.type){case"terminal":return`"${e.value}"`;case"nonterminal":return e.name;case"special":return e.text;default:return"(...)"}},"nodeToLabel"),g=t(e=>{const r=v(e.primary);if(!e.operator)return r;switch(e.operator){case"?":return{type:"optional",element:r};case"*":return{type:"repetition",element:r,min:0,max:1/0};case"+":return{type:"repetition",element:r,min:1,max:1/0};default:throw new Error(`Unsupported PEG suffix operator: ${e.operator}`)}},"transformSuffix"),v=t(e=>{switch(e.$type){case"PegLiteral":return{type:"terminal",value:e.value};case"PegIdentifier":return{type:"nonterminal",name:e.name};case"PegGroup":return i(e.element);case"PegAny":return{type:"special",text:e.dot};default:throw new Error(`Unsupported PEG primary node: ${e.$type}`)}},"transformPrimary"),y=t(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=t(e=>{p(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(y(r)))},"populateDb"),b={parse:t(e=>{a.clear(),o.debug("[PEG Parser] Starting Langium parse");const r=f.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const n=r.value;o.debug("[PEG Parser] Parsed rules:",n.rules.length),h(n),o.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:a}},L={parser:b,db:a,renderer:m,styles:l};export{L as diagram}; +import{g as l,r as m,d as a}from"./chunk-6Q2QTUOP-N9gzANAs.js";import{p}from"./chunk-JWPE2WC7-DVlhplzu.js";import{a as t,at as o}from"./mermaid.core-DAx4nvmm.js";import"../../app/index-8JtvDNuA.js";import{M as u,b as c}from"./cynefin-OW5HDTMX-BHP1Kvyc.js";import"../../chunks/purify.es-BnINGy_Y.js";var f=c().RailroadPeg.parser.LangiumParser,i=t(e=>{const r=e.alternatives.map(d);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformOrderedChoice"),d=t(e=>{const r=e.elements.map(P);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),P=t(e=>{const r=g(e.suffix);return e.operator?{type:"special",text:e.operator==="&"?`&${s(r)}`:`!${s(r)}`}:r},"transformPrefix"),s=t(e=>{switch(e.type){case"terminal":return`"${e.value}"`;case"nonterminal":return e.name;case"special":return e.text;default:return"(...)"}},"nodeToLabel"),g=t(e=>{const r=v(e.primary);if(!e.operator)return r;switch(e.operator){case"?":return{type:"optional",element:r};case"*":return{type:"repetition",element:r,min:0,max:1/0};case"+":return{type:"repetition",element:r,min:1,max:1/0};default:throw new Error(`Unsupported PEG suffix operator: ${e.operator}`)}},"transformSuffix"),v=t(e=>{switch(e.$type){case"PegLiteral":return{type:"terminal",value:e.value};case"PegIdentifier":return{type:"nonterminal",name:e.name};case"PegGroup":return i(e.element);case"PegAny":return{type:"special",text:e.dot};default:throw new Error(`Unsupported PEG primary node: ${e.$type}`)}},"transformPrimary"),y=t(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=t(e=>{p(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(y(r)))},"populateDb"),b={parse:t(e=>{a.clear(),o.debug("[PEG Parser] Starting Langium parse");const r=f.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const n=r.value;o.debug("[PEG Parser] Parsed rules:",n.rules.length),h(n),o.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:a}},L={parser:b,db:a,renderer:m,styles:l};export{L as diagram}; diff --git a/veadk/webui/assets/visualizations/mermaid/pieDiagram-7S7Q4E2Y-B1kVpjEf.js b/veadk/webui/assets/visualizations/mermaid/pieDiagram-7S7Q4E2Y-VRiU9rtm.js similarity index 96% rename from veadk/webui/assets/visualizations/mermaid/pieDiagram-7S7Q4E2Y-B1kVpjEf.js rename to veadk/webui/assets/visualizations/mermaid/pieDiagram-7S7Q4E2Y-VRiU9rtm.js index 0c8ce031d..719aca7c4 100644 --- a/veadk/webui/assets/visualizations/mermaid/pieDiagram-7S7Q4E2Y-B1kVpjEf.js +++ b/veadk/webui/assets/visualizations/mermaid/pieDiagram-7S7Q4E2Y-VRiU9rtm.js @@ -1,4 +1,4 @@ -import{p as rt}from"./chunk-JWPE2WC7-DD-BFVC6.js";import{D as T,b1 as B,f as nt,V as it,aQ as ot,W as st,aR as lt,$ as ct,aT as ut,a as d,at as G,Y as gt,r as dt,aP as pt,aC as ht,B as ft,s as mt,O as vt}from"./mermaid.core-y4TF8bTw.js";import{p as xt}from"./cynefin-OW5HDTMX-DBq9B5VP.js";import"../../app/index-BNPwMQXG.js";import{d as Z}from"../../chunks/arc-fsSJ4XQX.js";import{o as St}from"../../chunks/ordinal-Cboi1Yqb.js";import"../../chunks/purify.es-BnINGy_Y.js";import"../../chunks/init-Gi6I4Gst.js";function yt(t,n){return nt?1:n>=t?0:NaN}function wt(t){return t}function At(){var t=wt,n=yt,y=null,b=T(0),l=T(B),p=T(0);function i(e){var r,s=(e=nt(e)).length,h,w,$=0,f=new Array(s),o=new Array(s),D=+b.apply(this,arguments),E=Math.min(B,Math.max(-B,l.apply(this,arguments)-D)),k,W=Math.min(Math.abs(E)/s,p.apply(this,arguments)),u=W*(E<0?-1:1),A;for(r=0;r0&&($+=A);for(n!=null?f.sort(function(M,m){return n(o[M],o[m])}):y!=null&&f.sort(function(M,m){return y(e[M],e[m])}),r=0,w=$?(E-s*u)/$:0;r0?A*w:0)+u,o[h]={data:e[h],index:r,value:A,startAngle:D,endAngle:k,padAngle:W};return o}return i.value=function(e){return arguments.length?(t=typeof e=="function"?e:T(+e),i):t},i.sortValues=function(e){return arguments.length?(n=e,y=null,i):n},i.sort=function(e){return arguments.length?(y=e,n=null,i):y},i.startAngle=function(e){return arguments.length?(b=typeof e=="function"?e:T(+e),i):b},i.endAngle=function(e){return arguments.length?(l=typeof e=="function"?e:T(+e),i):l},i.padAngle=function(e){return arguments.length?(p=typeof e=="function"?e:T(+e),i):p},i}var Ct=vt.pie,I={sections:new Map,showData:!1},P=I.sections,V=I.showData,$t=structuredClone(Ct),Dt=d(()=>structuredClone($t),"getConfig"),Tt=d(()=>{P=new Map,V=I.showData,mt()},"clear"),bt=d(({label:t,value:n})=>{if(n<0)throw new Error(`"${t}" has invalid value: ${n}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);P.has(t)||(P.set(t,n),G.debug(`added new section: ${t}, with value: ${n}`))},"addSection"),kt=d(()=>P,"getSections"),zt=d(t=>{V=t},"setShowData"),Et=d(()=>V,"getShowData"),q={getConfig:Dt,clear:Tt,setDiagramTitle:ut,getDiagramTitle:ct,setAccTitle:lt,getAccTitle:st,setAccDescription:ot,getAccDescription:it,addSection:bt,getSections:kt,setShowData:zt,getShowData:Et},Mt=d((t,n)=>{rt(t,n),n.setShowData(t.showData),t.sections.map(n.addSection)},"populateDb"),Rt={parse:d(async t=>{const n=await xt("pie",t);G.debug(n),Mt(n,q)},"parse")},Wt=d(t=>` +import{p as rt}from"./chunk-JWPE2WC7-DVlhplzu.js";import{D as T,b1 as B,f as nt,V as it,aQ as ot,W as st,aR as lt,$ as ct,aT as ut,a as d,at as G,Y as gt,r as dt,aP as pt,aC as ht,B as ft,s as mt,O as vt}from"./mermaid.core-DAx4nvmm.js";import{p as xt}from"./cynefin-OW5HDTMX-BHP1Kvyc.js";import"../../app/index-8JtvDNuA.js";import{d as Z}from"../../chunks/arc-B85TaV_o.js";import{o as St}from"../../chunks/ordinal-Cboi1Yqb.js";import"../../chunks/purify.es-BnINGy_Y.js";import"../../chunks/init-Gi6I4Gst.js";function yt(t,n){return nt?1:n>=t?0:NaN}function wt(t){return t}function At(){var t=wt,n=yt,y=null,b=T(0),l=T(B),p=T(0);function i(e){var r,s=(e=nt(e)).length,h,w,$=0,f=new Array(s),o=new Array(s),D=+b.apply(this,arguments),E=Math.min(B,Math.max(-B,l.apply(this,arguments)-D)),k,W=Math.min(Math.abs(E)/s,p.apply(this,arguments)),u=W*(E<0?-1:1),A;for(r=0;r0&&($+=A);for(n!=null?f.sort(function(M,m){return n(o[M],o[m])}):y!=null&&f.sort(function(M,m){return y(e[M],e[m])}),r=0,w=$?(E-s*u)/$:0;r0?A*w:0)+u,o[h]={data:e[h],index:r,value:A,startAngle:D,endAngle:k,padAngle:W};return o}return i.value=function(e){return arguments.length?(t=typeof e=="function"?e:T(+e),i):t},i.sortValues=function(e){return arguments.length?(n=e,y=null,i):n},i.sort=function(e){return arguments.length?(y=e,n=null,i):y},i.startAngle=function(e){return arguments.length?(b=typeof e=="function"?e:T(+e),i):b},i.endAngle=function(e){return arguments.length?(l=typeof e=="function"?e:T(+e),i):l},i.padAngle=function(e){return arguments.length?(p=typeof e=="function"?e:T(+e),i):p},i}var Ct=vt.pie,I={sections:new Map,showData:!1},P=I.sections,V=I.showData,$t=structuredClone(Ct),Dt=d(()=>structuredClone($t),"getConfig"),Tt=d(()=>{P=new Map,V=I.showData,mt()},"clear"),bt=d(({label:t,value:n})=>{if(n<0)throw new Error(`"${t}" has invalid value: ${n}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);P.has(t)||(P.set(t,n),G.debug(`added new section: ${t}, with value: ${n}`))},"addSection"),kt=d(()=>P,"getSections"),zt=d(t=>{V=t},"setShowData"),Et=d(()=>V,"getShowData"),q={getConfig:Dt,clear:Tt,setDiagramTitle:ut,getDiagramTitle:ct,setAccTitle:lt,getAccTitle:st,setAccDescription:ot,getAccDescription:it,addSection:bt,getSections:kt,setShowData:zt,getShowData:Et},Mt=d((t,n)=>{rt(t,n),n.setShowData(t.showData),t.sections.map(n.addSection)},"populateDb"),Rt={parse:d(async t=>{const n=await xt("pie",t);G.debug(n),Mt(n,q)},"parse")},Wt=d(t=>` .pieCircle{ stroke: ${t.pieStrokeColor}; stroke-width : ${t.pieStrokeWidth}; diff --git a/veadk/webui/assets/visualizations/mermaid/quadrantDiagram-CIZ2JOQS-Ce1mswm1.js b/veadk/webui/assets/visualizations/mermaid/quadrantDiagram-CIZ2JOQS-JooZIzGd.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/quadrantDiagram-CIZ2JOQS-Ce1mswm1.js rename to veadk/webui/assets/visualizations/mermaid/quadrantDiagram-CIZ2JOQS-JooZIzGd.js index 5f5263c82..d185324a5 100644 --- a/veadk/webui/assets/visualizations/mermaid/quadrantDiagram-CIZ2JOQS-Ce1mswm1.js +++ b/veadk/webui/assets/visualizations/mermaid/quadrantDiagram-CIZ2JOQS-JooZIzGd.js @@ -1,4 +1,4 @@ -import{aQ as Ae,V as ke,$ as ae,aT as Fe,W as Pe,aR as ve,a as o,Y as wt,at as At,B as Ce,s as Le,O as V,aN as Ee,a8 as De}from"./mermaid.core-y4TF8bTw.js";import{aG as Vt}from"../../app/index-BNPwMQXG.js";import{l as ie}from"../../chunks/linear-Dd6OAXqp.js";import"../../chunks/purify.es-BnINGy_Y.js";import"../../chunks/init-Gi6I4Gst.js";import"../../chunks/defaultLocale-CrowFXzY.js";var zt=function(){var t=o(function(j,r,l,g){for(l=l||{},g=j.length;g--;l[j[g]]=r);return l},"o"),n=[1,3],u=[1,4],c=[1,5],h=[1,6],p=[1,7],y=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],S=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],a=[55,56,57],k=[2,36],d=[1,37],T=[1,36],m=[1,38],q=[1,35],b=[1,43],x=[1,41],_=[1,45],Y=[1,14],G=[1,23],yt=[1,18],Tt=[1,19],dt=[1,20],Ft=[1,21],ut=[1,22],xt=[1,24],ft=[1,25],gt=[1,26],i=[1,27],Bt=[1,28],Rt=[1,29],Q=[1,32],U=[1,33],F=[1,34],P=[1,39],v=[1,40],C=[1,42],L=[1,44],H=[1,63],X=[1,62],E=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],Nt=[1,66],Wt=[1,67],Qt=[1,68],Ut=[1,69],Ot=[1,70],Ht=[1,71],Xt=[1,72],Mt=[1,73],Yt=[1,74],jt=[1,75],Gt=[1,76],Kt=[1,77],w=[4,5,6,7,8,9,10,11,12,13,14,15,18],J=[1,91],$=[1,92],tt=[1,93],et=[1,100],it=[1,94],at=[1,97],nt=[1,95],st=[1,96],rt=[1,98],ot=[1,99],Pt=[1,103],Zt=[10,55,56,57],N=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],vt={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:o(function(r,l,g,f,A,e,pt){var s=e.length-1;switch(A){case 23:this.$=e[s];break;case 24:this.$=e[s-1]+""+e[s];break;case 26:this.$=e[s-1]+e[s];break;case 27:this.$=[e[s].trim()];break;case 28:e[s-2].push(e[s].trim()),this.$=e[s-2];break;case 29:this.$=e[s-4],f.addClass(e[s-2],e[s]);break;case 37:this.$=[];break;case 42:this.$=e[s].trim(),f.setDiagramTitle(this.$);break;case 43:this.$=e[s].trim(),f.setAccTitle(this.$);break;case 44:case 45:this.$=e[s].trim(),f.setAccDescription(this.$);break;case 46:f.addSection(e[s].substr(8)),this.$=e[s].substr(8);break;case 47:f.addPoint(e[s-3],"",e[s-1],e[s],[]);break;case 48:f.addPoint(e[s-4],e[s-3],e[s-1],e[s],[]);break;case 49:f.addPoint(e[s-4],"",e[s-2],e[s-1],e[s]);break;case 50:f.addPoint(e[s-5],e[s-4],e[s-2],e[s-1],e[s]);break;case 51:f.setXAxisLeftText(e[s-2]),f.setXAxisRightText(e[s]);break;case 52:e[s-1].text+=" ⟶ ",f.setXAxisLeftText(e[s-1]);break;case 53:f.setXAxisLeftText(e[s]);break;case 54:f.setYAxisBottomText(e[s-2]),f.setYAxisTopText(e[s]);break;case 55:e[s-1].text+=" ⟶ ",f.setYAxisBottomText(e[s-1]);break;case 56:f.setYAxisBottomText(e[s]);break;case 57:f.setQuadrant1Text(e[s]);break;case 58:f.setQuadrant2Text(e[s]);break;case 59:f.setQuadrant3Text(e[s]);break;case 60:f.setQuadrant4Text(e[s]);break;case 64:this.$={text:e[s],type:"text"};break;case 65:this.$={text:e[s-1].text+""+e[s],type:e[s-1].type};break;case 66:this.$={text:e[s],type:"text"};break;case 67:this.$={text:e[s],type:"markdown"};break;case 68:this.$=e[s];break;case 69:this.$=e[s-1]+""+e[s];break}},"anonymous"),table:[{18:n,26:1,27:2,28:u,55:c,56:h,57:p},{1:[3]},{18:n,26:8,27:2,28:u,55:c,56:h,57:p},{18:n,26:9,27:2,28:u,55:c,56:h,57:p},t(y,[2,33],{29:10}),t(S,[2,61]),t(S,[2,62]),t(S,[2,63]),{1:[2,30]},{1:[2,31]},t(a,k,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:d,5:T,10:m,12:q,13:b,14:x,15:_,18:Y,25:G,35:yt,37:Tt,39:dt,41:Ft,42:ut,48:xt,50:ft,51:gt,52:i,53:Bt,54:Rt,60:Q,61:U,63:F,64:P,65:v,66:C,67:L}),t(y,[2,34]),{27:46,55:c,56:h,57:p},t(a,[2,37]),t(a,k,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:d,5:T,10:m,12:q,13:b,14:x,15:_,18:Y,25:G,35:yt,37:Tt,39:dt,41:Ft,42:ut,48:xt,50:ft,51:gt,52:i,53:Bt,54:Rt,60:Q,61:U,63:F,64:P,65:v,66:C,67:L}),t(a,[2,39]),t(a,[2,40]),t(a,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(a,[2,45]),t(a,[2,46]),{18:[1,51]},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:52,58:31,60:Q,61:U,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:53,58:31,60:Q,61:U,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:54,58:31,60:Q,61:U,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:55,58:31,60:Q,61:U,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:56,58:31,60:Q,61:U,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:57,58:31,60:Q,61:U,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,44:[1,58],47:[1,59],58:61,59:60,63:F,64:P,65:v,66:C,67:L},t(E,[2,64]),t(E,[2,66]),t(E,[2,67]),t(E,[2,70]),t(E,[2,71]),t(E,[2,72]),t(E,[2,73]),t(E,[2,74]),t(E,[2,75]),t(E,[2,76]),t(E,[2,77]),t(E,[2,78]),t(E,[2,79]),t(E,[2,80]),t(E,[2,81]),t(y,[2,35]),t(a,[2,38]),t(a,[2,42]),t(a,[2,43]),t(a,[2,44]),{3:65,4:Nt,5:Wt,6:Qt,7:Ut,8:Ot,9:Ht,10:Xt,11:Mt,12:Yt,13:jt,14:Gt,15:Kt,21:64},t(a,[2,53],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,49:[1,78],63:F,64:P,65:v,66:C,67:L}),t(a,[2,56],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,49:[1,79],63:F,64:P,65:v,66:C,67:L}),t(a,[2,57],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,58],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,59],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,60],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),{45:[1,80]},{44:[1,81]},t(E,[2,65]),t(E,[2,82]),t(E,[2,83]),t(E,[2,84]),{3:83,4:Nt,5:Wt,6:Qt,7:Ut,8:Ot,9:Ht,10:Xt,11:Mt,12:Yt,13:jt,14:Gt,15:Kt,18:[1,82]},t(w,[2,23]),t(w,[2,1]),t(w,[2,2]),t(w,[2,3]),t(w,[2,4]),t(w,[2,5]),t(w,[2,6]),t(w,[2,7]),t(w,[2,8]),t(w,[2,9]),t(w,[2,10]),t(w,[2,11]),t(w,[2,12]),t(a,[2,52],{58:31,43:84,4:d,5:T,10:m,12:q,13:b,14:x,15:_,60:Q,61:U,63:F,64:P,65:v,66:C,67:L}),t(a,[2,55],{58:31,43:85,4:d,5:T,10:m,12:q,13:b,14:x,15:_,60:Q,61:U,63:F,64:P,65:v,66:C,67:L}),{46:[1,86]},{45:[1,87]},{4:J,5:$,6:tt,8:et,11:it,13:at,16:90,17:nt,18:st,19:rt,20:ot,22:89,23:88},t(w,[2,24]),t(a,[2,51],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,54],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,47],{22:89,16:90,23:101,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot}),{46:[1,102]},t(a,[2,29],{10:Pt}),t(Zt,[2,27],{16:104,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot}),t(N,[2,25]),t(N,[2,13]),t(N,[2,14]),t(N,[2,15]),t(N,[2,16]),t(N,[2,17]),t(N,[2,18]),t(N,[2,19]),t(N,[2,20]),t(N,[2,21]),t(N,[2,22]),t(a,[2,49],{10:Pt}),t(a,[2,48],{22:89,16:90,23:105,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot}),{4:J,5:$,6:tt,8:et,11:it,13:at,16:90,17:nt,18:st,19:rt,20:ot,22:106},t(N,[2,26]),t(a,[2,50],{10:Pt}),t(Zt,[2,28],{16:104,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot})],defaultActions:{8:[2,30],9:[2,31]},parseError:o(function(r,l){if(l.recoverable)this.trace(r);else{var g=new Error(r);throw g.hash=l,g}},"parseError"),parse:o(function(r){var l=this,g=[0],f=[],A=[null],e=[],pt=this.table,s="",qt=0,Jt=0,qe=2,$t=1,be=e.slice.call(arguments,1),D=Object.create(this.lexer),K={yy:{}};for(var Ct in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ct)&&(K.yy[Ct]=this.yy[Ct]);D.setInput(r,K.yy),K.yy.lexer=D,K.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Lt=D.yylloc;e.push(Lt);var Se=D.options&&D.options.ranges;typeof K.yy.parseError=="function"?this.parseError=K.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function _e(R){g.length=g.length-2*R,A.length=A.length-R,e.length=e.length-R}o(_e,"popStack");function te(){var R;return R=f.pop()||D.lex()||$t,typeof R!="number"&&(R instanceof Array&&(f=R,R=f.pop()),R=l.symbols_[R]||R),R}o(te,"lex");for(var B,Z,W,Et,lt={},bt,M,ee,St;;){if(Z=g[g.length-1],this.defaultActions[Z]?W=this.defaultActions[Z]:((B===null||typeof B>"u")&&(B=te()),W=pt[Z]&&pt[Z][B]),typeof W>"u"||!W.length||!W[0]){var Dt="";St=[];for(bt in pt[Z])this.terminals_[bt]&&bt>qe&&St.push("'"+this.terminals_[bt]+"'");D.showPosition?Dt="Parse error on line "+(qt+1)+`: +import{aQ as Ae,V as ke,$ as ae,aT as Fe,W as Pe,aR as ve,a as o,Y as wt,at as At,B as Ce,s as Le,O as V,aN as Ee,a8 as De}from"./mermaid.core-DAx4nvmm.js";import{aG as Vt}from"../../app/index-8JtvDNuA.js";import{l as ie}from"../../chunks/linear-WTltCzEJ.js";import"../../chunks/purify.es-BnINGy_Y.js";import"../../chunks/init-Gi6I4Gst.js";import"../../chunks/defaultLocale-CrowFXzY.js";var zt=function(){var t=o(function(j,r,l,g){for(l=l||{},g=j.length;g--;l[j[g]]=r);return l},"o"),n=[1,3],u=[1,4],c=[1,5],h=[1,6],p=[1,7],y=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],S=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],a=[55,56,57],k=[2,36],d=[1,37],T=[1,36],m=[1,38],q=[1,35],b=[1,43],x=[1,41],_=[1,45],Y=[1,14],G=[1,23],yt=[1,18],Tt=[1,19],dt=[1,20],Ft=[1,21],ut=[1,22],xt=[1,24],ft=[1,25],gt=[1,26],i=[1,27],Bt=[1,28],Rt=[1,29],Q=[1,32],U=[1,33],F=[1,34],P=[1,39],v=[1,40],C=[1,42],L=[1,44],H=[1,63],X=[1,62],E=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],Nt=[1,66],Wt=[1,67],Qt=[1,68],Ut=[1,69],Ot=[1,70],Ht=[1,71],Xt=[1,72],Mt=[1,73],Yt=[1,74],jt=[1,75],Gt=[1,76],Kt=[1,77],w=[4,5,6,7,8,9,10,11,12,13,14,15,18],J=[1,91],$=[1,92],tt=[1,93],et=[1,100],it=[1,94],at=[1,97],nt=[1,95],st=[1,96],rt=[1,98],ot=[1,99],Pt=[1,103],Zt=[10,55,56,57],N=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],vt={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:o(function(r,l,g,f,A,e,pt){var s=e.length-1;switch(A){case 23:this.$=e[s];break;case 24:this.$=e[s-1]+""+e[s];break;case 26:this.$=e[s-1]+e[s];break;case 27:this.$=[e[s].trim()];break;case 28:e[s-2].push(e[s].trim()),this.$=e[s-2];break;case 29:this.$=e[s-4],f.addClass(e[s-2],e[s]);break;case 37:this.$=[];break;case 42:this.$=e[s].trim(),f.setDiagramTitle(this.$);break;case 43:this.$=e[s].trim(),f.setAccTitle(this.$);break;case 44:case 45:this.$=e[s].trim(),f.setAccDescription(this.$);break;case 46:f.addSection(e[s].substr(8)),this.$=e[s].substr(8);break;case 47:f.addPoint(e[s-3],"",e[s-1],e[s],[]);break;case 48:f.addPoint(e[s-4],e[s-3],e[s-1],e[s],[]);break;case 49:f.addPoint(e[s-4],"",e[s-2],e[s-1],e[s]);break;case 50:f.addPoint(e[s-5],e[s-4],e[s-2],e[s-1],e[s]);break;case 51:f.setXAxisLeftText(e[s-2]),f.setXAxisRightText(e[s]);break;case 52:e[s-1].text+=" ⟶ ",f.setXAxisLeftText(e[s-1]);break;case 53:f.setXAxisLeftText(e[s]);break;case 54:f.setYAxisBottomText(e[s-2]),f.setYAxisTopText(e[s]);break;case 55:e[s-1].text+=" ⟶ ",f.setYAxisBottomText(e[s-1]);break;case 56:f.setYAxisBottomText(e[s]);break;case 57:f.setQuadrant1Text(e[s]);break;case 58:f.setQuadrant2Text(e[s]);break;case 59:f.setQuadrant3Text(e[s]);break;case 60:f.setQuadrant4Text(e[s]);break;case 64:this.$={text:e[s],type:"text"};break;case 65:this.$={text:e[s-1].text+""+e[s],type:e[s-1].type};break;case 66:this.$={text:e[s],type:"text"};break;case 67:this.$={text:e[s],type:"markdown"};break;case 68:this.$=e[s];break;case 69:this.$=e[s-1]+""+e[s];break}},"anonymous"),table:[{18:n,26:1,27:2,28:u,55:c,56:h,57:p},{1:[3]},{18:n,26:8,27:2,28:u,55:c,56:h,57:p},{18:n,26:9,27:2,28:u,55:c,56:h,57:p},t(y,[2,33],{29:10}),t(S,[2,61]),t(S,[2,62]),t(S,[2,63]),{1:[2,30]},{1:[2,31]},t(a,k,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:d,5:T,10:m,12:q,13:b,14:x,15:_,18:Y,25:G,35:yt,37:Tt,39:dt,41:Ft,42:ut,48:xt,50:ft,51:gt,52:i,53:Bt,54:Rt,60:Q,61:U,63:F,64:P,65:v,66:C,67:L}),t(y,[2,34]),{27:46,55:c,56:h,57:p},t(a,[2,37]),t(a,k,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:d,5:T,10:m,12:q,13:b,14:x,15:_,18:Y,25:G,35:yt,37:Tt,39:dt,41:Ft,42:ut,48:xt,50:ft,51:gt,52:i,53:Bt,54:Rt,60:Q,61:U,63:F,64:P,65:v,66:C,67:L}),t(a,[2,39]),t(a,[2,40]),t(a,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(a,[2,45]),t(a,[2,46]),{18:[1,51]},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:52,58:31,60:Q,61:U,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:53,58:31,60:Q,61:U,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:54,58:31,60:Q,61:U,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:55,58:31,60:Q,61:U,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:56,58:31,60:Q,61:U,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:57,58:31,60:Q,61:U,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,44:[1,58],47:[1,59],58:61,59:60,63:F,64:P,65:v,66:C,67:L},t(E,[2,64]),t(E,[2,66]),t(E,[2,67]),t(E,[2,70]),t(E,[2,71]),t(E,[2,72]),t(E,[2,73]),t(E,[2,74]),t(E,[2,75]),t(E,[2,76]),t(E,[2,77]),t(E,[2,78]),t(E,[2,79]),t(E,[2,80]),t(E,[2,81]),t(y,[2,35]),t(a,[2,38]),t(a,[2,42]),t(a,[2,43]),t(a,[2,44]),{3:65,4:Nt,5:Wt,6:Qt,7:Ut,8:Ot,9:Ht,10:Xt,11:Mt,12:Yt,13:jt,14:Gt,15:Kt,21:64},t(a,[2,53],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,49:[1,78],63:F,64:P,65:v,66:C,67:L}),t(a,[2,56],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,49:[1,79],63:F,64:P,65:v,66:C,67:L}),t(a,[2,57],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,58],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,59],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,60],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),{45:[1,80]},{44:[1,81]},t(E,[2,65]),t(E,[2,82]),t(E,[2,83]),t(E,[2,84]),{3:83,4:Nt,5:Wt,6:Qt,7:Ut,8:Ot,9:Ht,10:Xt,11:Mt,12:Yt,13:jt,14:Gt,15:Kt,18:[1,82]},t(w,[2,23]),t(w,[2,1]),t(w,[2,2]),t(w,[2,3]),t(w,[2,4]),t(w,[2,5]),t(w,[2,6]),t(w,[2,7]),t(w,[2,8]),t(w,[2,9]),t(w,[2,10]),t(w,[2,11]),t(w,[2,12]),t(a,[2,52],{58:31,43:84,4:d,5:T,10:m,12:q,13:b,14:x,15:_,60:Q,61:U,63:F,64:P,65:v,66:C,67:L}),t(a,[2,55],{58:31,43:85,4:d,5:T,10:m,12:q,13:b,14:x,15:_,60:Q,61:U,63:F,64:P,65:v,66:C,67:L}),{46:[1,86]},{45:[1,87]},{4:J,5:$,6:tt,8:et,11:it,13:at,16:90,17:nt,18:st,19:rt,20:ot,22:89,23:88},t(w,[2,24]),t(a,[2,51],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,54],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,47],{22:89,16:90,23:101,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot}),{46:[1,102]},t(a,[2,29],{10:Pt}),t(Zt,[2,27],{16:104,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot}),t(N,[2,25]),t(N,[2,13]),t(N,[2,14]),t(N,[2,15]),t(N,[2,16]),t(N,[2,17]),t(N,[2,18]),t(N,[2,19]),t(N,[2,20]),t(N,[2,21]),t(N,[2,22]),t(a,[2,49],{10:Pt}),t(a,[2,48],{22:89,16:90,23:105,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot}),{4:J,5:$,6:tt,8:et,11:it,13:at,16:90,17:nt,18:st,19:rt,20:ot,22:106},t(N,[2,26]),t(a,[2,50],{10:Pt}),t(Zt,[2,28],{16:104,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot})],defaultActions:{8:[2,30],9:[2,31]},parseError:o(function(r,l){if(l.recoverable)this.trace(r);else{var g=new Error(r);throw g.hash=l,g}},"parseError"),parse:o(function(r){var l=this,g=[0],f=[],A=[null],e=[],pt=this.table,s="",qt=0,Jt=0,qe=2,$t=1,be=e.slice.call(arguments,1),D=Object.create(this.lexer),K={yy:{}};for(var Ct in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ct)&&(K.yy[Ct]=this.yy[Ct]);D.setInput(r,K.yy),K.yy.lexer=D,K.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Lt=D.yylloc;e.push(Lt);var Se=D.options&&D.options.ranges;typeof K.yy.parseError=="function"?this.parseError=K.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function _e(R){g.length=g.length-2*R,A.length=A.length-R,e.length=e.length-R}o(_e,"popStack");function te(){var R;return R=f.pop()||D.lex()||$t,typeof R!="number"&&(R instanceof Array&&(f=R,R=f.pop()),R=l.symbols_[R]||R),R}o(te,"lex");for(var B,Z,W,Et,lt={},bt,M,ee,St;;){if(Z=g[g.length-1],this.defaultActions[Z]?W=this.defaultActions[Z]:((B===null||typeof B>"u")&&(B=te()),W=pt[Z]&&pt[Z][B]),typeof W>"u"||!W.length||!W[0]){var Dt="";St=[];for(bt in pt[Z])this.terminals_[bt]&&bt>qe&&St.push("'"+this.terminals_[bt]+"'");D.showPosition?Dt="Parse error on line "+(qt+1)+`: `+D.showPosition()+` Expecting `+St.join(", ")+", got '"+(this.terminals_[B]||B)+"'":Dt="Parse error on line "+(qt+1)+": Unexpected "+(B==$t?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(Dt,{text:D.match,token:this.terminals_[B]||B,line:D.yylineno,loc:Lt,expected:St})}if(W[0]instanceof Array&&W.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Z+", token: "+B);switch(W[0]){case 1:g.push(B),A.push(D.yytext),e.push(D.yylloc),g.push(W[1]),B=null,Jt=D.yyleng,s=D.yytext,qt=D.yylineno,Lt=D.yylloc;break;case 2:if(M=this.productions_[W[1]][1],lt.$=A[A.length-M],lt._$={first_line:e[e.length-(M||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(M||1)].first_column,last_column:e[e.length-1].last_column},Se&&(lt._$.range=[e[e.length-(M||1)].range[0],e[e.length-1].range[1]]),Et=this.performAction.apply(lt,[s,Jt,qt,K.yy,W[1],A,e].concat(be)),typeof Et<"u")return Et;M&&(g=g.slice(0,-1*M*2),A=A.slice(0,-1*M),e=e.slice(0,-1*M)),g.push(this.productions_[W[1]][0]),A.push(lt.$),e.push(lt._$),ee=pt[g[g.length-2]][g[g.length-1]],g.push(ee);break;case 3:return!0}}return!0},"parse")},me=function(){var j={EOF:1,parseError:o(function(l,g){if(this.yy.parser)this.yy.parser.parseError(l,g);else throw new Error(l)},"parseError"),setInput:o(function(r,l){return this.yy=l||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var l=r.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:o(function(r){var l=r.length,g=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var f=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var A=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===f.length?this.yylloc.first_column:0)+f[f.length-g.length].length-g[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[A[0],A[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(r){this.unput(this.match.slice(r))},"less"),pastInput:o(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var r=this.pastInput(),l=new Array(r.length+1).join("-");return r+this.upcomingInput()+` diff --git a/veadk/webui/assets/visualizations/mermaid/railroadDiagram-AXF67PYL-VReUdmSC.js b/veadk/webui/assets/visualizations/mermaid/railroadDiagram-AXF67PYL-B0NVnjyw.js similarity index 84% rename from veadk/webui/assets/visualizations/mermaid/railroadDiagram-AXF67PYL-VReUdmSC.js rename to veadk/webui/assets/visualizations/mermaid/railroadDiagram-AXF67PYL-B0NVnjyw.js index fd7b3ac84..9ed0bd0bf 100644 --- a/veadk/webui/assets/visualizations/mermaid/railroadDiagram-AXF67PYL-VReUdmSC.js +++ b/veadk/webui/assets/visualizations/mermaid/railroadDiagram-AXF67PYL-B0NVnjyw.js @@ -1 +1 @@ -import{g as s,r as l,d as t}from"./chunk-6Q2QTUOP-zEQK1XLO.js";import{p as m}from"./chunk-JWPE2WC7-DD-BFVC6.js";import{a as n,at as i}from"./mermaid.core-y4TF8bTw.js";import"../../app/index-BNPwMQXG.js";import{M as p,d as u}from"./cynefin-OW5HDTMX-DBq9B5VP.js";import"../../chunks/purify.es-BnINGy_Y.js";var d=u().Railroad.parser.LangiumParser,a=n(e=>{switch(e.$type){case"RailroadTerminalExpr":return{type:"terminal",value:e.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:e.name};case"RailroadSpecialExpr":return{type:"special",text:e.text};case"RailroadSequenceExpr":{const r=e.elements.map(a);return r.length===1?r[0]:{type:"sequence",elements:r}}case"RailroadChoiceExpr":{const r=e.alternatives.map(a);return r.length===1?r[0]:{type:"choice",alternatives:r}}case"RailroadOptionalExpr":return{type:"optional",element:a(e.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:a(e.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:a(e.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${e.$type}`)}},"transformExpression"),c=n(e=>({name:e.name,definition:a(e.definition)}),"transformRule"),g=n(e=>{m(e,t),e.title&&t.setTitle(e.title),e.rules.map(r=>t.addRule(c(r)))},"populateDb"),y={parse:n(e=>{t.clear(),i.debug("[Railroad Parser] Starting Langium parse");const r=d.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new p(r);const o=r.value;i.debug("[Railroad Parser] Parsed rules:",o.rules.length),g(o),i.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:t}},P={parser:y,db:t,renderer:l,styles:s};export{P as diagram}; +import{g as s,r as l,d as t}from"./chunk-6Q2QTUOP-N9gzANAs.js";import{p as m}from"./chunk-JWPE2WC7-DVlhplzu.js";import{a as n,at as i}from"./mermaid.core-DAx4nvmm.js";import"../../app/index-8JtvDNuA.js";import{M as p,d as u}from"./cynefin-OW5HDTMX-BHP1Kvyc.js";import"../../chunks/purify.es-BnINGy_Y.js";var d=u().Railroad.parser.LangiumParser,a=n(e=>{switch(e.$type){case"RailroadTerminalExpr":return{type:"terminal",value:e.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:e.name};case"RailroadSpecialExpr":return{type:"special",text:e.text};case"RailroadSequenceExpr":{const r=e.elements.map(a);return r.length===1?r[0]:{type:"sequence",elements:r}}case"RailroadChoiceExpr":{const r=e.alternatives.map(a);return r.length===1?r[0]:{type:"choice",alternatives:r}}case"RailroadOptionalExpr":return{type:"optional",element:a(e.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:a(e.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:a(e.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${e.$type}`)}},"transformExpression"),c=n(e=>({name:e.name,definition:a(e.definition)}),"transformRule"),g=n(e=>{m(e,t),e.title&&t.setTitle(e.title),e.rules.map(r=>t.addRule(c(r)))},"populateDb"),y={parse:n(e=>{t.clear(),i.debug("[Railroad Parser] Starting Langium parse");const r=d.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new p(r);const o=r.value;i.debug("[Railroad Parser] Parsed rules:",o.rules.length),g(o),i.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:t}},P={parser:y,db:t,renderer:l,styles:s};export{P as diagram}; diff --git a/veadk/webui/assets/visualizations/mermaid/requirementDiagram-LRYGKXZP-BMkVtH2s.js b/veadk/webui/assets/visualizations/mermaid/requirementDiagram-LRYGKXZP-CAxqjuVx.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/requirementDiagram-LRYGKXZP-BMkVtH2s.js rename to veadk/webui/assets/visualizations/mermaid/requirementDiagram-LRYGKXZP-CAxqjuVx.js index f7ac0c015..1b4f6c718 100644 --- a/veadk/webui/assets/visualizations/mermaid/requirementDiagram-LRYGKXZP-BMkVtH2s.js +++ b/veadk/webui/assets/visualizations/mermaid/requirementDiagram-LRYGKXZP-CAxqjuVx.js @@ -1,4 +1,4 @@ -import{g as ze}from"./chunk-XXDRQBXY-B8qTF1qQ.js";import{s as Xe}from"./chunk-KBJHAD2P-DtNDDRN1.js";import{a as d,X as Be,aR as Je,W as Ze,aQ as et,V as tt,aT as st,$ as it,Y as Ne,at as qe,s as rt,_ as nt,a4 as at,aK as lt,b9 as ct}from"./mermaid.core-y4TF8bTw.js";import"../../app/index-BNPwMQXG.js";import"../../chunks/purify.es-BnINGy_Y.js";var Ce=function(){var e=d(function($,i,n,l){for(n=n||{},l=$.length;l--;n[$[l]]=i);return n},"o"),r=[1,3],u=[1,4],h=[1,5],o=[1,6],c=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],E=[1,22],p=[2,7],f=[1,26],m=[1,27],b=[1,28],k=[1,29],C=[1,33],V=[1,34],A=[1,35],v=[1,36],L=[1,37],x=[1,38],O=[1,24],w=[1,31],D=[1,32],M=[1,30],y=[1,39],_=[1,40],g=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],P=[1,61],X=[89,90],Ve=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Ee=[27,29],Ae=[1,70],ve=[1,71],Le=[1,72],xe=[1,73],Oe=[1,74],we=[1,75],De=[1,76],ee=[1,83],U=[1,80],te=[1,84],se=[1,85],ie=[1,86],re=[1,87],ne=[1,88],ae=[1,89],le=[1,90],ce=[1,91],oe=[1,92],pe=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Y=[63,64],Me=[1,101],Fe=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],N=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],B=[1,110],Q=[1,106],H=[1,107],K=[1,108],W=[1,109],j=[1,111],he=[1,116],ue=[1,117],fe=[1,114],me=[1,115],Se={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:d(function(i,n,l,s,R,t,de){var a=t.length-1;switch(R){case 4:this.$=t[a].trim(),s.setAccTitle(this.$);break;case 5:case 6:this.$=t[a].trim(),s.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:s.setDirection("TB");break;case 18:s.setDirection("BT");break;case 19:s.setDirection("RL");break;case 20:s.setDirection("LR");break;case 21:s.addRequirement(t[a-3],t[a-4]);break;case 22:s.addRequirement(t[a-5],t[a-6]),s.setClass([t[a-5]],t[a-3]);break;case 23:s.setNewReqId(t[a-2]);break;case 24:s.setNewReqText(t[a-2]);break;case 25:s.setNewReqRisk(t[a-2]);break;case 26:s.setNewReqVerifyMethod(t[a-2]);break;case 29:this.$=s.RequirementType.REQUIREMENT;break;case 30:this.$=s.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=s.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=s.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=s.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=s.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=s.RiskLevel.LOW_RISK;break;case 36:this.$=s.RiskLevel.MED_RISK;break;case 37:this.$=s.RiskLevel.HIGH_RISK;break;case 38:this.$=s.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=s.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=s.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=s.VerifyType.VERIFY_TEST;break;case 42:s.addElement(t[a-3]);break;case 43:s.addElement(t[a-5]),s.setClass([t[a-5]],t[a-3]);break;case 44:s.setNewElementType(t[a-2]);break;case 45:s.setNewElementDocRef(t[a-2]);break;case 48:s.addRelationship(t[a-2],t[a],t[a-4]);break;case 49:s.addRelationship(t[a-2],t[a-4],t[a]);break;case 50:this.$=s.Relationships.CONTAINS;break;case 51:this.$=s.Relationships.COPIES;break;case 52:this.$=s.Relationships.DERIVES;break;case 53:this.$=s.Relationships.SATISFIES;break;case 54:this.$=s.Relationships.VERIFIES;break;case 55:this.$=s.Relationships.REFINES;break;case 56:this.$=s.Relationships.TRACES;break;case 57:this.$=t[a-2],s.defineClass(t[a-1],t[a]);break;case 58:s.setClass(t[a-1],t[a]);break;case 59:s.setClass([t[a-2]],t[a]);break;case 60:case 62:this.$=[t[a]];break;case 61:case 63:this.$=t[a-2].concat([t[a]]);break;case 64:this.$=t[a-2],s.setCssStyle(t[a-1],t[a]);break;case 65:this.$=[t[a]];break;case 66:t[a-2].push(t[a]),this.$=t[a-2];break;case 68:this.$=t[a-1]+t[a];break}},"anonymous"),table:[{3:1,4:2,6:r,9:u,11:h,13:o},{1:[3]},{3:8,4:2,5:[1,7],6:r,9:u,11:h,13:o},{5:[1,9]},{10:[1,10]},{12:[1,11]},e(c,[2,6]),{3:12,4:2,6:r,9:u,11:h,13:o},{1:[2,2]},{4:17,5:E,7:13,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},e(c,[2,4]),e(c,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:E,7:42,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:43,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:44,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:45,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:46,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:47,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:48,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:49,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:50,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},e(g,[2,17]),e(g,[2,18]),e(g,[2,19]),e(g,[2,20]),{30:60,33:62,75:P,89:y,90:_},{30:63,33:62,75:P,89:y,90:_},{30:64,33:62,75:P,89:y,90:_},e(X,[2,29]),e(X,[2,30]),e(X,[2,31]),e(X,[2,32]),e(X,[2,33]),e(X,[2,34]),e(Ve,[2,81]),e(Ve,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},e(Ee,[2,79]),e(Ee,[2,80]),{27:[1,67],29:[1,68]},e(Ee,[2,85]),e(Ee,[2,86]),{62:69,65:Ae,66:ve,67:Le,68:xe,69:Oe,70:we,71:De},{62:77,65:Ae,66:ve,67:Le,68:xe,69:Oe,70:we,71:De},{30:78,33:62,75:P,89:y,90:_},{73:79,75:ee,76:U,78:81,79:82,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe},e(pe,[2,60]),e(pe,[2,62]),{73:93,75:ee,76:U,78:81,79:82,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe},{30:94,33:62,75:P,76:U,89:y,90:_},{5:[1,95]},{30:96,33:62,75:P,89:y,90:_},{5:[1,97]},{30:98,33:62,75:P,89:y,90:_},{63:[1,99]},e(Y,[2,50]),e(Y,[2,51]),e(Y,[2,52]),e(Y,[2,53]),e(Y,[2,54]),e(Y,[2,55]),e(Y,[2,56]),{64:[1,100]},e(g,[2,59],{76:U}),e(g,[2,64],{76:Me}),{33:103,75:[1,102],89:y,90:_},e(Fe,[2,65],{79:104,75:ee,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe}),e(N,[2,67]),e(N,[2,69]),e(N,[2,70]),e(N,[2,71]),e(N,[2,72]),e(N,[2,73]),e(N,[2,74]),e(N,[2,75]),e(N,[2,76]),e(N,[2,77]),e(N,[2,78]),e(g,[2,57],{76:Me}),e(g,[2,58],{76:U}),{5:B,28:105,31:Q,34:H,36:K,38:W,40:j},{27:[1,112],76:U},{5:he,40:ue,56:113,57:fe,59:me},{27:[1,118],76:U},{33:119,89:y,90:_},{33:120,89:y,90:_},{75:ee,78:121,79:82,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe},e(pe,[2,61]),e(pe,[2,63]),e(N,[2,68]),e(g,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:B,28:126,31:Q,34:H,36:K,38:W,40:j},e(g,[2,28]),{5:[1,127]},e(g,[2,42]),{32:[1,128]},{32:[1,129]},{5:he,40:ue,56:130,57:fe,59:me},e(g,[2,47]),{5:[1,131]},e(g,[2,48]),e(g,[2,49]),e(Fe,[2,66],{79:104,75:ee,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe}),{33:132,89:y,90:_},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},e(g,[2,27]),{5:B,28:145,31:Q,34:H,36:K,38:W,40:j},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},e(g,[2,46]),{5:he,40:ue,56:152,57:fe,59:me},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},e(g,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},e(g,[2,43]),{5:B,28:159,31:Q,34:H,36:K,38:W,40:j},{5:B,28:160,31:Q,34:H,36:K,38:W,40:j},{5:B,28:161,31:Q,34:H,36:K,38:W,40:j},{5:B,28:162,31:Q,34:H,36:K,38:W,40:j},{5:he,40:ue,56:163,57:fe,59:me},{5:he,40:ue,56:164,57:fe,59:me},e(g,[2,23]),e(g,[2,24]),e(g,[2,25]),e(g,[2,26]),e(g,[2,44]),e(g,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:d(function(i,n){if(n.recoverable)this.trace(i);else{var l=new Error(i);throw l.hash=n,l}},"parseError"),parse:d(function(i){var n=this,l=[0],s=[],R=[null],t=[],de=this.table,a="",ge=0,$e=0,Ke=2,Pe=1,We=t.slice.call(arguments,1),S=Object.create(this.lexer),G={yy:{}};for(var be in this.yy)Object.prototype.hasOwnProperty.call(this.yy,be)&&(G.yy[be]=this.yy[be]);S.setInput(i,G.yy),G.yy.lexer=S,G.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var Ie=S.yylloc;t.push(Ie);var je=S.options&&S.options.ranges;typeof G.yy.parseError=="function"?this.parseError=G.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ge(T){l.length=l.length-2*T,R.length=R.length-T,t.length=t.length-T}d(Ge,"popStack");function Ue(){var T;return T=s.pop()||S.lex()||Pe,typeof T!="number"&&(T instanceof Array&&(s=T,T=s.pop()),T=n.symbols_[T]||T),T}d(Ue,"lex");for(var I,z,q,Te,J={},ye,F,Ye,_e;;){if(z=l[l.length-1],this.defaultActions[z]?q=this.defaultActions[z]:((I===null||typeof I>"u")&&(I=Ue()),q=de[z]&&de[z][I]),typeof q>"u"||!q.length||!q[0]){var ke="";_e=[];for(ye in de[z])this.terminals_[ye]&&ye>Ke&&_e.push("'"+this.terminals_[ye]+"'");S.showPosition?ke="Parse error on line "+(ge+1)+`: +import{g as ze}from"./chunk-XXDRQBXY-BdI3VXTi.js";import{s as Xe}from"./chunk-KBJHAD2P-C0rklDe7.js";import{a as d,X as Be,aR as Je,W as Ze,aQ as et,V as tt,aT as st,$ as it,Y as Ne,at as qe,s as rt,_ as nt,a4 as at,aK as lt,b9 as ct}from"./mermaid.core-DAx4nvmm.js";import"../../app/index-8JtvDNuA.js";import"../../chunks/purify.es-BnINGy_Y.js";var Ce=function(){var e=d(function($,i,n,l){for(n=n||{},l=$.length;l--;n[$[l]]=i);return n},"o"),r=[1,3],u=[1,4],h=[1,5],o=[1,6],c=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],E=[1,22],p=[2,7],f=[1,26],m=[1,27],b=[1,28],k=[1,29],C=[1,33],V=[1,34],A=[1,35],v=[1,36],L=[1,37],x=[1,38],O=[1,24],w=[1,31],D=[1,32],M=[1,30],y=[1,39],_=[1,40],g=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],P=[1,61],X=[89,90],Ve=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Ee=[27,29],Ae=[1,70],ve=[1,71],Le=[1,72],xe=[1,73],Oe=[1,74],we=[1,75],De=[1,76],ee=[1,83],U=[1,80],te=[1,84],se=[1,85],ie=[1,86],re=[1,87],ne=[1,88],ae=[1,89],le=[1,90],ce=[1,91],oe=[1,92],pe=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Y=[63,64],Me=[1,101],Fe=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],N=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],B=[1,110],Q=[1,106],H=[1,107],K=[1,108],W=[1,109],j=[1,111],he=[1,116],ue=[1,117],fe=[1,114],me=[1,115],Se={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:d(function(i,n,l,s,R,t,de){var a=t.length-1;switch(R){case 4:this.$=t[a].trim(),s.setAccTitle(this.$);break;case 5:case 6:this.$=t[a].trim(),s.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:s.setDirection("TB");break;case 18:s.setDirection("BT");break;case 19:s.setDirection("RL");break;case 20:s.setDirection("LR");break;case 21:s.addRequirement(t[a-3],t[a-4]);break;case 22:s.addRequirement(t[a-5],t[a-6]),s.setClass([t[a-5]],t[a-3]);break;case 23:s.setNewReqId(t[a-2]);break;case 24:s.setNewReqText(t[a-2]);break;case 25:s.setNewReqRisk(t[a-2]);break;case 26:s.setNewReqVerifyMethod(t[a-2]);break;case 29:this.$=s.RequirementType.REQUIREMENT;break;case 30:this.$=s.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=s.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=s.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=s.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=s.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=s.RiskLevel.LOW_RISK;break;case 36:this.$=s.RiskLevel.MED_RISK;break;case 37:this.$=s.RiskLevel.HIGH_RISK;break;case 38:this.$=s.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=s.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=s.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=s.VerifyType.VERIFY_TEST;break;case 42:s.addElement(t[a-3]);break;case 43:s.addElement(t[a-5]),s.setClass([t[a-5]],t[a-3]);break;case 44:s.setNewElementType(t[a-2]);break;case 45:s.setNewElementDocRef(t[a-2]);break;case 48:s.addRelationship(t[a-2],t[a],t[a-4]);break;case 49:s.addRelationship(t[a-2],t[a-4],t[a]);break;case 50:this.$=s.Relationships.CONTAINS;break;case 51:this.$=s.Relationships.COPIES;break;case 52:this.$=s.Relationships.DERIVES;break;case 53:this.$=s.Relationships.SATISFIES;break;case 54:this.$=s.Relationships.VERIFIES;break;case 55:this.$=s.Relationships.REFINES;break;case 56:this.$=s.Relationships.TRACES;break;case 57:this.$=t[a-2],s.defineClass(t[a-1],t[a]);break;case 58:s.setClass(t[a-1],t[a]);break;case 59:s.setClass([t[a-2]],t[a]);break;case 60:case 62:this.$=[t[a]];break;case 61:case 63:this.$=t[a-2].concat([t[a]]);break;case 64:this.$=t[a-2],s.setCssStyle(t[a-1],t[a]);break;case 65:this.$=[t[a]];break;case 66:t[a-2].push(t[a]),this.$=t[a-2];break;case 68:this.$=t[a-1]+t[a];break}},"anonymous"),table:[{3:1,4:2,6:r,9:u,11:h,13:o},{1:[3]},{3:8,4:2,5:[1,7],6:r,9:u,11:h,13:o},{5:[1,9]},{10:[1,10]},{12:[1,11]},e(c,[2,6]),{3:12,4:2,6:r,9:u,11:h,13:o},{1:[2,2]},{4:17,5:E,7:13,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},e(c,[2,4]),e(c,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:E,7:42,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:43,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:44,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:45,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:46,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:47,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:48,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:49,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:50,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},e(g,[2,17]),e(g,[2,18]),e(g,[2,19]),e(g,[2,20]),{30:60,33:62,75:P,89:y,90:_},{30:63,33:62,75:P,89:y,90:_},{30:64,33:62,75:P,89:y,90:_},e(X,[2,29]),e(X,[2,30]),e(X,[2,31]),e(X,[2,32]),e(X,[2,33]),e(X,[2,34]),e(Ve,[2,81]),e(Ve,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},e(Ee,[2,79]),e(Ee,[2,80]),{27:[1,67],29:[1,68]},e(Ee,[2,85]),e(Ee,[2,86]),{62:69,65:Ae,66:ve,67:Le,68:xe,69:Oe,70:we,71:De},{62:77,65:Ae,66:ve,67:Le,68:xe,69:Oe,70:we,71:De},{30:78,33:62,75:P,89:y,90:_},{73:79,75:ee,76:U,78:81,79:82,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe},e(pe,[2,60]),e(pe,[2,62]),{73:93,75:ee,76:U,78:81,79:82,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe},{30:94,33:62,75:P,76:U,89:y,90:_},{5:[1,95]},{30:96,33:62,75:P,89:y,90:_},{5:[1,97]},{30:98,33:62,75:P,89:y,90:_},{63:[1,99]},e(Y,[2,50]),e(Y,[2,51]),e(Y,[2,52]),e(Y,[2,53]),e(Y,[2,54]),e(Y,[2,55]),e(Y,[2,56]),{64:[1,100]},e(g,[2,59],{76:U}),e(g,[2,64],{76:Me}),{33:103,75:[1,102],89:y,90:_},e(Fe,[2,65],{79:104,75:ee,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe}),e(N,[2,67]),e(N,[2,69]),e(N,[2,70]),e(N,[2,71]),e(N,[2,72]),e(N,[2,73]),e(N,[2,74]),e(N,[2,75]),e(N,[2,76]),e(N,[2,77]),e(N,[2,78]),e(g,[2,57],{76:Me}),e(g,[2,58],{76:U}),{5:B,28:105,31:Q,34:H,36:K,38:W,40:j},{27:[1,112],76:U},{5:he,40:ue,56:113,57:fe,59:me},{27:[1,118],76:U},{33:119,89:y,90:_},{33:120,89:y,90:_},{75:ee,78:121,79:82,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe},e(pe,[2,61]),e(pe,[2,63]),e(N,[2,68]),e(g,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:B,28:126,31:Q,34:H,36:K,38:W,40:j},e(g,[2,28]),{5:[1,127]},e(g,[2,42]),{32:[1,128]},{32:[1,129]},{5:he,40:ue,56:130,57:fe,59:me},e(g,[2,47]),{5:[1,131]},e(g,[2,48]),e(g,[2,49]),e(Fe,[2,66],{79:104,75:ee,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe}),{33:132,89:y,90:_},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},e(g,[2,27]),{5:B,28:145,31:Q,34:H,36:K,38:W,40:j},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},e(g,[2,46]),{5:he,40:ue,56:152,57:fe,59:me},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},e(g,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},e(g,[2,43]),{5:B,28:159,31:Q,34:H,36:K,38:W,40:j},{5:B,28:160,31:Q,34:H,36:K,38:W,40:j},{5:B,28:161,31:Q,34:H,36:K,38:W,40:j},{5:B,28:162,31:Q,34:H,36:K,38:W,40:j},{5:he,40:ue,56:163,57:fe,59:me},{5:he,40:ue,56:164,57:fe,59:me},e(g,[2,23]),e(g,[2,24]),e(g,[2,25]),e(g,[2,26]),e(g,[2,44]),e(g,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:d(function(i,n){if(n.recoverable)this.trace(i);else{var l=new Error(i);throw l.hash=n,l}},"parseError"),parse:d(function(i){var n=this,l=[0],s=[],R=[null],t=[],de=this.table,a="",ge=0,$e=0,Ke=2,Pe=1,We=t.slice.call(arguments,1),S=Object.create(this.lexer),G={yy:{}};for(var be in this.yy)Object.prototype.hasOwnProperty.call(this.yy,be)&&(G.yy[be]=this.yy[be]);S.setInput(i,G.yy),G.yy.lexer=S,G.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var Ie=S.yylloc;t.push(Ie);var je=S.options&&S.options.ranges;typeof G.yy.parseError=="function"?this.parseError=G.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ge(T){l.length=l.length-2*T,R.length=R.length-T,t.length=t.length-T}d(Ge,"popStack");function Ue(){var T;return T=s.pop()||S.lex()||Pe,typeof T!="number"&&(T instanceof Array&&(s=T,T=s.pop()),T=n.symbols_[T]||T),T}d(Ue,"lex");for(var I,z,q,Te,J={},ye,F,Ye,_e;;){if(z=l[l.length-1],this.defaultActions[z]?q=this.defaultActions[z]:((I===null||typeof I>"u")&&(I=Ue()),q=de[z]&&de[z][I]),typeof q>"u"||!q.length||!q[0]){var ke="";_e=[];for(ye in de[z])this.terminals_[ye]&&ye>Ke&&_e.push("'"+this.terminals_[ye]+"'");S.showPosition?ke="Parse error on line "+(ge+1)+`: `+S.showPosition()+` Expecting `+_e.join(", ")+", got '"+(this.terminals_[I]||I)+"'":ke="Parse error on line "+(ge+1)+": Unexpected "+(I==Pe?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(ke,{text:S.match,token:this.terminals_[I]||I,line:S.yylineno,loc:Ie,expected:_e})}if(q[0]instanceof Array&&q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+z+", token: "+I);switch(q[0]){case 1:l.push(I),R.push(S.yytext),t.push(S.yylloc),l.push(q[1]),I=null,$e=S.yyleng,a=S.yytext,ge=S.yylineno,Ie=S.yylloc;break;case 2:if(F=this.productions_[q[1]][1],J.$=R[R.length-F],J._$={first_line:t[t.length-(F||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(F||1)].first_column,last_column:t[t.length-1].last_column},je&&(J._$.range=[t[t.length-(F||1)].range[0],t[t.length-1].range[1]]),Te=this.performAction.apply(J,[a,$e,ge,G.yy,q[1],R,t].concat(We)),typeof Te<"u")return Te;F&&(l=l.slice(0,-1*F*2),R=R.slice(0,-1*F),t=t.slice(0,-1*F)),l.push(this.productions_[q[1]][0]),R.push(J.$),t.push(J._$),Ye=de[l[l.length-2]][l[l.length-1]],l.push(Ye);break;case 3:return!0}}return!0},"parse")},He=function(){var $={EOF:1,parseError:d(function(n,l){if(this.yy.parser)this.yy.parser.parseError(n,l);else throw new Error(n)},"parseError"),setInput:d(function(i,n){return this.yy=n||this.yy||{},this._input=i,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var n=i.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},"input"),unput:d(function(i){var n=i.length,l=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var R=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===s.length?this.yylloc.first_column:0)+s[s.length-l.length].length-l[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[R[0],R[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(i){this.unput(this.match.slice(i))},"less"),pastInput:d(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var i=this.pastInput(),n=new Array(i.length+1).join("-");return i+this.upcomingInput()+` diff --git a/veadk/webui/assets/visualizations/mermaid/sankeyDiagram-W5VNT64P-gHIvLiGA.js b/veadk/webui/assets/visualizations/mermaid/sankeyDiagram-W5VNT64P-BTjDTukV.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/sankeyDiagram-W5VNT64P-gHIvLiGA.js rename to veadk/webui/assets/visualizations/mermaid/sankeyDiagram-W5VNT64P-BTjDTukV.js index 6091840c3..fb2348a60 100644 --- a/veadk/webui/assets/visualizations/mermaid/sankeyDiagram-W5VNT64P-gHIvLiGA.js +++ b/veadk/webui/assets/visualizations/mermaid/sankeyDiagram-W5VNT64P-BTjDTukV.js @@ -1,4 +1,4 @@ -import{aT as xt,$ as _t,aQ as vt,V as bt,aR as St,W as wt,a as d,Y as lt,N as Lt,aW as Et,s as At,x as Tt}from"./mermaid.core-y4TF8bTw.js";import{aG as Q}from"../../app/index-BNPwMQXG.js";import{o as Mt}from"../../chunks/ordinal-Cboi1Yqb.js";import"../../chunks/purify.es-BnINGy_Y.js";import"../../chunks/init-Gi6I4Gst.js";function Nt(t){for(var n=t.length/6|0,s=new Array(n),a=0;a=a)&&(s=a);else{let a=-1;for(let u of t)(u=n(u,++a,t))!=null&&(s=u)&&(s=u)}return s}function pt(t,n){let s;if(n===void 0)for(const a of t)a!=null&&(s>a||s===void 0&&a>=a)&&(s=a);else{let a=-1;for(let u of t)(u=n(u,++a,t))!=null&&(s>u||s===void 0&&u>=u)&&(s=u)}return s}function nt(t,n){let s=0;if(n===void 0)for(let a of t)(a=+a)&&(s+=a);else{let a=-1;for(let u of t)(u=+n(u,++a,t))&&(s+=u)}return s}function Pt(t){return t.target.depth}function It(t){return t.depth}function Ot(t,n){return n-1-t.height}function kt(t,n){return t.sourceLinks.length?t.depth:n-1}function $t(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?pt(t.sourceLinks,Pt)-1:0}function X(t){return function(){return t}}function ut(t,n){return q(t.source,n.source)||t.index-n.index}function ht(t,n){return q(t.target,n.target)||t.index-n.index}function q(t,n){return t.y0-n.y0}function it(t){return t.value}function Dt(t){return t.index}function jt(t){return t.nodes}function zt(t){return t.links}function ft(t,n){const s=t.get(n);if(!s)throw new Error("missing: "+n);return s}function yt({nodes:t}){for(const n of t){let s=n.y0,a=s;for(const u of n.sourceLinks)u.y0=s+u.width/2,s+=u.width;for(const u of n.targetLinks)u.y1=a+u.width/2,a+=u.width}}function Bt(){let t=0,n=0,s=1,a=1,u=24,y=8,p,m=Dt,o=kt,l,h,x=jt,_=zt,g=6;function v(){const i={nodes:x.apply(null,arguments),links:_.apply(null,arguments)};return T(i),A(i),M(i),I(i),S(i),yt(i),i}v.update=function(i){return yt(i),i},v.nodeId=function(i){return arguments.length?(m=typeof i=="function"?i:X(i),v):m},v.nodeAlign=function(i){return arguments.length?(o=typeof i=="function"?i:X(i),v):o},v.nodeSort=function(i){return arguments.length?(l=i,v):l},v.nodeWidth=function(i){return arguments.length?(u=+i,v):u},v.nodePadding=function(i){return arguments.length?(y=p=+i,v):y},v.nodes=function(i){return arguments.length?(x=typeof i=="function"?i:X(i),v):x},v.links=function(i){return arguments.length?(_=typeof i=="function"?i:X(i),v):_},v.linkSort=function(i){return arguments.length?(h=i,v):h},v.size=function(i){return arguments.length?(t=n=0,s=+i[0],a=+i[1],v):[s-t,a-n]},v.extent=function(i){return arguments.length?(t=+i[0][0],s=+i[1][0],n=+i[0][1],a=+i[1][1],v):[[t,n],[s,a]]},v.iterations=function(i){return arguments.length?(g=+i,v):g};function T({nodes:i,links:f}){for(const[e,r]of i.entries())r.index=e,r.sourceLinks=[],r.targetLinks=[];const c=new Map(i.map((e,r)=>[m(e,r,i),e]));for(const[e,r]of f.entries()){r.index=e;let{source:k,target:b}=r;typeof k!="object"&&(k=r.source=ft(c,k)),typeof b!="object"&&(b=r.target=ft(c,b)),k.sourceLinks.push(r),b.targetLinks.push(r)}if(h!=null)for(const{sourceLinks:e,targetLinks:r}of i)e.sort(h),r.sort(h)}function A({nodes:i}){for(const f of i)f.value=f.fixedValue===void 0?Math.max(nt(f.sourceLinks,it),nt(f.targetLinks,it)):f.fixedValue}function M({nodes:i}){const f=i.length;let c=new Set(i),e=new Set,r=0;for(;c.size;){for(const k of c){k.depth=r;for(const{target:b}of k.sourceLinks)e.add(b)}if(++r>f)throw new Error("circular link");c=e,e=new Set}}function I({nodes:i}){const f=i.length;let c=new Set(i),e=new Set,r=0;for(;c.size;){for(const k of c){k.height=r;for(const{source:b}of k.targetLinks)e.add(b)}if(++r>f)throw new Error("circular link");c=e,e=new Set}}function N({nodes:i}){const f=ct(i,r=>r.depth)+1,c=(s-t-u)/(f-1),e=new Array(f);for(const r of i){const k=Math.max(0,Math.min(f-1,Math.floor(o.call(null,r,f))));r.layer=k,r.x0=t+k*c,r.x1=r.x0+u,e[k]?e[k].push(r):e[k]=[r]}if(l)for(const r of e)r.sort(l);return e}function D(i){const f=pt(i,c=>(a-n-(c.length-1)*p)/nt(c,it));for(const c of i){let e=n;for(const r of c){r.y0=e,r.y1=e+r.value*f,e=r.y1+p;for(const k of r.sourceLinks)k.width=k.value*f}e=(a-e+p)/(c.length+1);for(let r=0;rc.length)-1)),D(f);for(let c=0;c0))continue;let U=(L/B-b.y0)*f;b.y0+=U,b.y1+=U,z(b)}l===void 0&&k.sort(q),j(k,c)}}function R(i,f,c){for(let e=i.length,r=e-2;r>=0;--r){const k=i[r];for(const b of k){let L=0,B=0;for(const{target:Y,value:et}of b.sourceLinks){let H=et*(Y.layer-b.layer);L+=E(b,Y)*H,B+=H}if(!(B>0))continue;let U=(L/B-b.y0)*f;b.y0+=U,b.y1+=U,z(b)}l===void 0&&k.sort(q),j(k,c)}}function j(i,f){const c=i.length>>1,e=i[c];O(i,e.y0-p,c-1,f),V(i,e.y1+p,c+1,f),O(i,a,i.length-1,f),V(i,n,0,f)}function V(i,f,c,e){for(;c1e-6&&(r.y0+=k,r.y1+=k),f=r.y1+p}}function O(i,f,c,e){for(;c>=0;--c){const r=i[c],k=(r.y1-f)*e;k>1e-6&&(r.y0-=k,r.y1-=k),f=r.y0-p}}function z({sourceLinks:i,targetLinks:f}){if(h===void 0){for(const{source:{sourceLinks:c}}of f)c.sort(ht);for(const{target:{targetLinks:c}}of i)c.sort(ut)}}function w(i){if(h===void 0)for(const{sourceLinks:f,targetLinks:c}of i)f.sort(ht),c.sort(ut)}function P(i,f){let c=i.y0-(i.sourceLinks.length-1)*p/2;for(const{target:e,width:r}of i.sourceLinks){if(e===f)break;c+=r+p}for(const{source:e,width:r}of f.targetLinks){if(e===i)break;c-=r}return c}function E(i,f){let c=f.y0-(f.targetLinks.length-1)*p/2;for(const{source:e,width:r}of f.targetLinks){if(e===i)break;c+=r+p}for(const{target:e,width:r}of i.sourceLinks){if(e===f)break;c-=r}return c}return v}var rt=Math.PI,st=2*rt,F=1e-6,Ft=st-F;function ot(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function mt(){return new ot}ot.prototype=mt.prototype={constructor:ot,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,s,a){this._+="Q"+ +t+","+ +n+","+(this._x1=+s)+","+(this._y1=+a)},bezierCurveTo:function(t,n,s,a,u,y){this._+="C"+ +t+","+ +n+","+ +s+","+ +a+","+(this._x1=+u)+","+(this._y1=+y)},arcTo:function(t,n,s,a,u){t=+t,n=+n,s=+s,a=+a,u=+u;var y=this._x1,p=this._y1,m=s-t,o=a-n,l=y-t,h=p-n,x=l*l+h*h;if(u<0)throw new Error("negative radius: "+u);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(x>F)if(!(Math.abs(h*m-o*l)>F)||!u)this._+="L"+(this._x1=t)+","+(this._y1=n);else{var _=s-y,g=a-p,v=m*m+o*o,T=_*_+g*g,A=Math.sqrt(v),M=Math.sqrt(x),I=u*Math.tan((rt-Math.acos((v+x-T)/(2*A*M)))/2),N=I/M,D=I/A;Math.abs(N-1)>F&&(this._+="L"+(t+N*l)+","+(n+N*h)),this._+="A"+u+","+u+",0,0,"+ +(h*_>l*g)+","+(this._x1=t+D*m)+","+(this._y1=n+D*o)}},arc:function(t,n,s,a,u,y){t=+t,n=+n,s=+s,y=!!y;var p=s*Math.cos(a),m=s*Math.sin(a),o=t+p,l=n+m,h=1^y,x=y?a-u:u-a;if(s<0)throw new Error("negative radius: "+s);this._x1===null?this._+="M"+o+","+l:(Math.abs(this._x1-o)>F||Math.abs(this._y1-l)>F)&&(this._+="L"+o+","+l),s&&(x<0&&(x=x%st+st),x>Ft?this._+="A"+s+","+s+",0,1,"+h+","+(t-p)+","+(n-m)+"A"+s+","+s+",0,1,"+h+","+(this._x1=o)+","+(this._y1=l):x>F&&(this._+="A"+s+","+s+",0,"+ +(x>=rt)+","+h+","+(this._x1=t+s*Math.cos(u))+","+(this._y1=n+s*Math.sin(u))))},rect:function(t,n,s,a){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +s+"v"+ +a+"h"+-s+"Z"},toString:function(){return this._}};function dt(t){return function(){return t}}function Rt(t){return t[0]}function Vt(t){return t[1]}var Wt=Array.prototype.slice;function Gt(t){return t.source}function Ut(t){return t.target}function Yt(t){var n=Gt,s=Ut,a=Rt,u=Vt,y=null;function p(){var m,o=Wt.call(arguments),l=n.apply(this,o),h=s.apply(this,o);if(y||(y=m=mt()),t(y,+a.apply(this,(o[0]=l,o)),+u.apply(this,o),+a.apply(this,(o[0]=h,o)),+u.apply(this,o)),m)return y=null,m+""||null}return p.source=function(m){return arguments.length?(n=m,p):n},p.target=function(m){return arguments.length?(s=m,p):s},p.x=function(m){return arguments.length?(a=typeof m=="function"?m:dt(+m),p):a},p.y=function(m){return arguments.length?(u=typeof m=="function"?m:dt(+m),p):u},p.context=function(m){return arguments.length?(y=m??null,p):y},p}function Ht(t,n,s,a,u){t.moveTo(n,s),t.bezierCurveTo(n=(n+a)/2,s,n,u,a,u)}function Qt(){return Yt(Ht)}function Xt(t){return[t.source.x1,t.y0]}function qt(t){return[t.target.x0,t.y1]}function Kt(){return Qt().source(Xt).target(qt)}var at=function(){var t=d(function(m,o,l,h){for(l=l||{},h=m.length;h--;l[m[h]]=o);return l},"o"),n=[1,9],s=[1,10],a=[1,5,10,12],u={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:d(function(o,l,h,x,_,g,v){var T=g.length-1;switch(_){case 7:const A=x.findOrCreateNode(g[T-4].trim().replaceAll('""','"')),M=x.findOrCreateNode(g[T-2].trim().replaceAll('""','"')),I=parseFloat(g[T].trim());x.addLink(A,M,I);break;case 8:case 9:case 11:this.$=g[T];break;case 10:this.$=g[T-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:n,20:s},{1:[2,6],7:11,10:[1,12]},t(s,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(a,[2,8]),t(a,[2,9]),{19:[1,16]},t(a,[2,11]),{1:[2,1]},{1:[2,5]},t(s,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:n,20:s},{15:18,16:7,17:8,18:n,20:s},{18:[1,19]},t(s,[2,3]),{12:[1,20]},t(a,[2,10]),{15:21,16:7,17:8,18:n,20:s},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:d(function(o,l){if(l.recoverable)this.trace(o);else{var h=new Error(o);throw h.hash=l,h}},"parseError"),parse:d(function(o){var l=this,h=[0],x=[],_=[null],g=[],v=this.table,T="",A=0,M=0,I=2,N=1,D=g.slice.call(arguments,1),S=Object.create(this.lexer),C={yy:{}};for(var R in this.yy)Object.prototype.hasOwnProperty.call(this.yy,R)&&(C.yy[R]=this.yy[R]);S.setInput(o,C.yy),C.yy.lexer=S,C.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var j=S.yylloc;g.push(j);var V=S.options&&S.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function O(L){h.length=h.length-2*L,_.length=_.length-L,g.length=g.length-L}d(O,"popStack");function z(){var L;return L=x.pop()||S.lex()||N,typeof L!="number"&&(L instanceof Array&&(x=L,L=x.pop()),L=l.symbols_[L]||L),L}d(z,"lex");for(var w,P,E,i,f={},c,e,r,k;;){if(P=h[h.length-1],this.defaultActions[P]?E=this.defaultActions[P]:((w===null||typeof w>"u")&&(w=z()),E=v[P]&&v[P][w]),typeof E>"u"||!E.length||!E[0]){var b="";k=[];for(c in v[P])this.terminals_[c]&&c>I&&k.push("'"+this.terminals_[c]+"'");S.showPosition?b="Parse error on line "+(A+1)+`: +import{aT as xt,$ as _t,aQ as vt,V as bt,aR as St,W as wt,a as d,Y as lt,N as Lt,aW as Et,s as At,x as Tt}from"./mermaid.core-DAx4nvmm.js";import{aG as Q}from"../../app/index-8JtvDNuA.js";import{o as Mt}from"../../chunks/ordinal-Cboi1Yqb.js";import"../../chunks/purify.es-BnINGy_Y.js";import"../../chunks/init-Gi6I4Gst.js";function Nt(t){for(var n=t.length/6|0,s=new Array(n),a=0;a=a)&&(s=a);else{let a=-1;for(let u of t)(u=n(u,++a,t))!=null&&(s=u)&&(s=u)}return s}function pt(t,n){let s;if(n===void 0)for(const a of t)a!=null&&(s>a||s===void 0&&a>=a)&&(s=a);else{let a=-1;for(let u of t)(u=n(u,++a,t))!=null&&(s>u||s===void 0&&u>=u)&&(s=u)}return s}function nt(t,n){let s=0;if(n===void 0)for(let a of t)(a=+a)&&(s+=a);else{let a=-1;for(let u of t)(u=+n(u,++a,t))&&(s+=u)}return s}function Pt(t){return t.target.depth}function It(t){return t.depth}function Ot(t,n){return n-1-t.height}function kt(t,n){return t.sourceLinks.length?t.depth:n-1}function $t(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?pt(t.sourceLinks,Pt)-1:0}function X(t){return function(){return t}}function ut(t,n){return q(t.source,n.source)||t.index-n.index}function ht(t,n){return q(t.target,n.target)||t.index-n.index}function q(t,n){return t.y0-n.y0}function it(t){return t.value}function Dt(t){return t.index}function jt(t){return t.nodes}function zt(t){return t.links}function ft(t,n){const s=t.get(n);if(!s)throw new Error("missing: "+n);return s}function yt({nodes:t}){for(const n of t){let s=n.y0,a=s;for(const u of n.sourceLinks)u.y0=s+u.width/2,s+=u.width;for(const u of n.targetLinks)u.y1=a+u.width/2,a+=u.width}}function Bt(){let t=0,n=0,s=1,a=1,u=24,y=8,p,m=Dt,o=kt,l,h,x=jt,_=zt,g=6;function v(){const i={nodes:x.apply(null,arguments),links:_.apply(null,arguments)};return T(i),A(i),M(i),I(i),S(i),yt(i),i}v.update=function(i){return yt(i),i},v.nodeId=function(i){return arguments.length?(m=typeof i=="function"?i:X(i),v):m},v.nodeAlign=function(i){return arguments.length?(o=typeof i=="function"?i:X(i),v):o},v.nodeSort=function(i){return arguments.length?(l=i,v):l},v.nodeWidth=function(i){return arguments.length?(u=+i,v):u},v.nodePadding=function(i){return arguments.length?(y=p=+i,v):y},v.nodes=function(i){return arguments.length?(x=typeof i=="function"?i:X(i),v):x},v.links=function(i){return arguments.length?(_=typeof i=="function"?i:X(i),v):_},v.linkSort=function(i){return arguments.length?(h=i,v):h},v.size=function(i){return arguments.length?(t=n=0,s=+i[0],a=+i[1],v):[s-t,a-n]},v.extent=function(i){return arguments.length?(t=+i[0][0],s=+i[1][0],n=+i[0][1],a=+i[1][1],v):[[t,n],[s,a]]},v.iterations=function(i){return arguments.length?(g=+i,v):g};function T({nodes:i,links:f}){for(const[e,r]of i.entries())r.index=e,r.sourceLinks=[],r.targetLinks=[];const c=new Map(i.map((e,r)=>[m(e,r,i),e]));for(const[e,r]of f.entries()){r.index=e;let{source:k,target:b}=r;typeof k!="object"&&(k=r.source=ft(c,k)),typeof b!="object"&&(b=r.target=ft(c,b)),k.sourceLinks.push(r),b.targetLinks.push(r)}if(h!=null)for(const{sourceLinks:e,targetLinks:r}of i)e.sort(h),r.sort(h)}function A({nodes:i}){for(const f of i)f.value=f.fixedValue===void 0?Math.max(nt(f.sourceLinks,it),nt(f.targetLinks,it)):f.fixedValue}function M({nodes:i}){const f=i.length;let c=new Set(i),e=new Set,r=0;for(;c.size;){for(const k of c){k.depth=r;for(const{target:b}of k.sourceLinks)e.add(b)}if(++r>f)throw new Error("circular link");c=e,e=new Set}}function I({nodes:i}){const f=i.length;let c=new Set(i),e=new Set,r=0;for(;c.size;){for(const k of c){k.height=r;for(const{source:b}of k.targetLinks)e.add(b)}if(++r>f)throw new Error("circular link");c=e,e=new Set}}function N({nodes:i}){const f=ct(i,r=>r.depth)+1,c=(s-t-u)/(f-1),e=new Array(f);for(const r of i){const k=Math.max(0,Math.min(f-1,Math.floor(o.call(null,r,f))));r.layer=k,r.x0=t+k*c,r.x1=r.x0+u,e[k]?e[k].push(r):e[k]=[r]}if(l)for(const r of e)r.sort(l);return e}function D(i){const f=pt(i,c=>(a-n-(c.length-1)*p)/nt(c,it));for(const c of i){let e=n;for(const r of c){r.y0=e,r.y1=e+r.value*f,e=r.y1+p;for(const k of r.sourceLinks)k.width=k.value*f}e=(a-e+p)/(c.length+1);for(let r=0;rc.length)-1)),D(f);for(let c=0;c0))continue;let U=(L/B-b.y0)*f;b.y0+=U,b.y1+=U,z(b)}l===void 0&&k.sort(q),j(k,c)}}function R(i,f,c){for(let e=i.length,r=e-2;r>=0;--r){const k=i[r];for(const b of k){let L=0,B=0;for(const{target:Y,value:et}of b.sourceLinks){let H=et*(Y.layer-b.layer);L+=E(b,Y)*H,B+=H}if(!(B>0))continue;let U=(L/B-b.y0)*f;b.y0+=U,b.y1+=U,z(b)}l===void 0&&k.sort(q),j(k,c)}}function j(i,f){const c=i.length>>1,e=i[c];O(i,e.y0-p,c-1,f),V(i,e.y1+p,c+1,f),O(i,a,i.length-1,f),V(i,n,0,f)}function V(i,f,c,e){for(;c1e-6&&(r.y0+=k,r.y1+=k),f=r.y1+p}}function O(i,f,c,e){for(;c>=0;--c){const r=i[c],k=(r.y1-f)*e;k>1e-6&&(r.y0-=k,r.y1-=k),f=r.y0-p}}function z({sourceLinks:i,targetLinks:f}){if(h===void 0){for(const{source:{sourceLinks:c}}of f)c.sort(ht);for(const{target:{targetLinks:c}}of i)c.sort(ut)}}function w(i){if(h===void 0)for(const{sourceLinks:f,targetLinks:c}of i)f.sort(ht),c.sort(ut)}function P(i,f){let c=i.y0-(i.sourceLinks.length-1)*p/2;for(const{target:e,width:r}of i.sourceLinks){if(e===f)break;c+=r+p}for(const{source:e,width:r}of f.targetLinks){if(e===i)break;c-=r}return c}function E(i,f){let c=f.y0-(f.targetLinks.length-1)*p/2;for(const{source:e,width:r}of f.targetLinks){if(e===i)break;c+=r+p}for(const{target:e,width:r}of i.sourceLinks){if(e===f)break;c-=r}return c}return v}var rt=Math.PI,st=2*rt,F=1e-6,Ft=st-F;function ot(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function mt(){return new ot}ot.prototype=mt.prototype={constructor:ot,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,s,a){this._+="Q"+ +t+","+ +n+","+(this._x1=+s)+","+(this._y1=+a)},bezierCurveTo:function(t,n,s,a,u,y){this._+="C"+ +t+","+ +n+","+ +s+","+ +a+","+(this._x1=+u)+","+(this._y1=+y)},arcTo:function(t,n,s,a,u){t=+t,n=+n,s=+s,a=+a,u=+u;var y=this._x1,p=this._y1,m=s-t,o=a-n,l=y-t,h=p-n,x=l*l+h*h;if(u<0)throw new Error("negative radius: "+u);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(x>F)if(!(Math.abs(h*m-o*l)>F)||!u)this._+="L"+(this._x1=t)+","+(this._y1=n);else{var _=s-y,g=a-p,v=m*m+o*o,T=_*_+g*g,A=Math.sqrt(v),M=Math.sqrt(x),I=u*Math.tan((rt-Math.acos((v+x-T)/(2*A*M)))/2),N=I/M,D=I/A;Math.abs(N-1)>F&&(this._+="L"+(t+N*l)+","+(n+N*h)),this._+="A"+u+","+u+",0,0,"+ +(h*_>l*g)+","+(this._x1=t+D*m)+","+(this._y1=n+D*o)}},arc:function(t,n,s,a,u,y){t=+t,n=+n,s=+s,y=!!y;var p=s*Math.cos(a),m=s*Math.sin(a),o=t+p,l=n+m,h=1^y,x=y?a-u:u-a;if(s<0)throw new Error("negative radius: "+s);this._x1===null?this._+="M"+o+","+l:(Math.abs(this._x1-o)>F||Math.abs(this._y1-l)>F)&&(this._+="L"+o+","+l),s&&(x<0&&(x=x%st+st),x>Ft?this._+="A"+s+","+s+",0,1,"+h+","+(t-p)+","+(n-m)+"A"+s+","+s+",0,1,"+h+","+(this._x1=o)+","+(this._y1=l):x>F&&(this._+="A"+s+","+s+",0,"+ +(x>=rt)+","+h+","+(this._x1=t+s*Math.cos(u))+","+(this._y1=n+s*Math.sin(u))))},rect:function(t,n,s,a){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +s+"v"+ +a+"h"+-s+"Z"},toString:function(){return this._}};function dt(t){return function(){return t}}function Rt(t){return t[0]}function Vt(t){return t[1]}var Wt=Array.prototype.slice;function Gt(t){return t.source}function Ut(t){return t.target}function Yt(t){var n=Gt,s=Ut,a=Rt,u=Vt,y=null;function p(){var m,o=Wt.call(arguments),l=n.apply(this,o),h=s.apply(this,o);if(y||(y=m=mt()),t(y,+a.apply(this,(o[0]=l,o)),+u.apply(this,o),+a.apply(this,(o[0]=h,o)),+u.apply(this,o)),m)return y=null,m+""||null}return p.source=function(m){return arguments.length?(n=m,p):n},p.target=function(m){return arguments.length?(s=m,p):s},p.x=function(m){return arguments.length?(a=typeof m=="function"?m:dt(+m),p):a},p.y=function(m){return arguments.length?(u=typeof m=="function"?m:dt(+m),p):u},p.context=function(m){return arguments.length?(y=m??null,p):y},p}function Ht(t,n,s,a,u){t.moveTo(n,s),t.bezierCurveTo(n=(n+a)/2,s,n,u,a,u)}function Qt(){return Yt(Ht)}function Xt(t){return[t.source.x1,t.y0]}function qt(t){return[t.target.x0,t.y1]}function Kt(){return Qt().source(Xt).target(qt)}var at=function(){var t=d(function(m,o,l,h){for(l=l||{},h=m.length;h--;l[m[h]]=o);return l},"o"),n=[1,9],s=[1,10],a=[1,5,10,12],u={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:d(function(o,l,h,x,_,g,v){var T=g.length-1;switch(_){case 7:const A=x.findOrCreateNode(g[T-4].trim().replaceAll('""','"')),M=x.findOrCreateNode(g[T-2].trim().replaceAll('""','"')),I=parseFloat(g[T].trim());x.addLink(A,M,I);break;case 8:case 9:case 11:this.$=g[T];break;case 10:this.$=g[T-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:n,20:s},{1:[2,6],7:11,10:[1,12]},t(s,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(a,[2,8]),t(a,[2,9]),{19:[1,16]},t(a,[2,11]),{1:[2,1]},{1:[2,5]},t(s,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:n,20:s},{15:18,16:7,17:8,18:n,20:s},{18:[1,19]},t(s,[2,3]),{12:[1,20]},t(a,[2,10]),{15:21,16:7,17:8,18:n,20:s},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:d(function(o,l){if(l.recoverable)this.trace(o);else{var h=new Error(o);throw h.hash=l,h}},"parseError"),parse:d(function(o){var l=this,h=[0],x=[],_=[null],g=[],v=this.table,T="",A=0,M=0,I=2,N=1,D=g.slice.call(arguments,1),S=Object.create(this.lexer),C={yy:{}};for(var R in this.yy)Object.prototype.hasOwnProperty.call(this.yy,R)&&(C.yy[R]=this.yy[R]);S.setInput(o,C.yy),C.yy.lexer=S,C.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var j=S.yylloc;g.push(j);var V=S.options&&S.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function O(L){h.length=h.length-2*L,_.length=_.length-L,g.length=g.length-L}d(O,"popStack");function z(){var L;return L=x.pop()||S.lex()||N,typeof L!="number"&&(L instanceof Array&&(x=L,L=x.pop()),L=l.symbols_[L]||L),L}d(z,"lex");for(var w,P,E,i,f={},c,e,r,k;;){if(P=h[h.length-1],this.defaultActions[P]?E=this.defaultActions[P]:((w===null||typeof w>"u")&&(w=z()),E=v[P]&&v[P][w]),typeof E>"u"||!E.length||!E[0]){var b="";k=[];for(c in v[P])this.terminals_[c]&&c>I&&k.push("'"+this.terminals_[c]+"'");S.showPosition?b="Parse error on line "+(A+1)+`: `+S.showPosition()+` Expecting `+k.join(", ")+", got '"+(this.terminals_[w]||w)+"'":b="Parse error on line "+(A+1)+": Unexpected "+(w==N?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(b,{text:S.match,token:this.terminals_[w]||w,line:S.yylineno,loc:j,expected:k})}if(E[0]instanceof Array&&E.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+w);switch(E[0]){case 1:h.push(w),_.push(S.yytext),g.push(S.yylloc),h.push(E[1]),w=null,M=S.yyleng,T=S.yytext,A=S.yylineno,j=S.yylloc;break;case 2:if(e=this.productions_[E[1]][1],f.$=_[_.length-e],f._$={first_line:g[g.length-(e||1)].first_line,last_line:g[g.length-1].last_line,first_column:g[g.length-(e||1)].first_column,last_column:g[g.length-1].last_column},V&&(f._$.range=[g[g.length-(e||1)].range[0],g[g.length-1].range[1]]),i=this.performAction.apply(f,[T,M,A,C.yy,E[1],_,g].concat(D)),typeof i<"u")return i;e&&(h=h.slice(0,-1*e*2),_=_.slice(0,-1*e),g=g.slice(0,-1*e)),h.push(this.productions_[E[1]][0]),_.push(f.$),g.push(f._$),r=v[h[h.length-2]][h[h.length-1]],h.push(r);break;case 3:return!0}}return!0},"parse")},y=function(){var m={EOF:1,parseError:d(function(l,h){if(this.yy.parser)this.yy.parser.parseError(l,h);else throw new Error(l)},"parseError"),setInput:d(function(o,l){return this.yy=l||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var l=o.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:d(function(o){var l=o.length,h=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var x=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var _=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===x.length?this.yylloc.first_column:0)+x[x.length-h.length].length-h[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(o){this.unput(this.match.slice(o))},"less"),pastInput:d(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var o=this.pastInput(),l=new Array(o.length+1).join("-");return o+this.upcomingInput()+` diff --git a/veadk/webui/assets/visualizations/mermaid/sequenceDiagram-SI44F4Z6-D6lfXAnD.js b/veadk/webui/assets/visualizations/mermaid/sequenceDiagram-SI44F4Z6-CRNvuVv8.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/sequenceDiagram-SI44F4Z6-D6lfXAnD.js rename to veadk/webui/assets/visualizations/mermaid/sequenceDiagram-SI44F4Z6-CRNvuVv8.js index 3b4f3729d..983a939dd 100644 --- a/veadk/webui/assets/visualizations/mermaid/sequenceDiagram-SI44F4Z6-D6lfXAnD.js +++ b/veadk/webui/assets/visualizations/mermaid/sequenceDiagram-SI44F4Z6-CRNvuVv8.js @@ -1,4 +1,4 @@ -import{I as er}from"./chunk-2Q5K7J3B-nvFjhS5b.js";import{a as x,aS as rr,Y as j,at as it,aO as Me,B as ar,j as sr,x as m,aR as De,aQ as ir,aT as nr,W as or,V as cr,$ as lr,as as hr,J as dr,s as Tr,aN as Yt,b9 as Z,ac as Q,n as kt,aC as Be,Z as pr,X as Ft,a9 as Er,aL as Ve}from"./mermaid.core-y4TF8bTw.js";import{d as ur,h as se,g as dt,e as fr,a as ie,b as ne}from"./chunk-2GRJ4B5K-CvII-2ZL.js";import{aG as Wt}from"../../app/index-BNPwMQXG.js";import"../../chunks/purify.es-BnINGy_Y.js";var ee=function(){var e=x(function(ut,N,v,k){for(v=v||{},k=ut.length;k--;v[ut[k]]=N);return v},"o"),t=[1,2],a=[1,3],r=[1,4],i=[2,4],n=[1,9],s=[1,11],o=[1,12],E=[1,14],h=[1,15],p=[1,17],_=[1,18],u=[1,19],O=[1,25],T=[1,26],g=[1,27],f=[1,28],I=[1,29],L=[1,30],b=[1,31],P=[1,32],S=[1,33],w=[1,34],M=[1,35],V=[1,36],Y=[1,37],z=[1,38],K=[1,39],X=[1,40],$=[1,42],tt=[1,43],U=[1,44],nt=[1,45],et=[1,46],W=[1,47],C=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],wt=[1,74],Dt=[1,80],A=[1,81],D=[1,82],rt=[1,83],at=[1,84],F=[1,85],Ot=[1,86],oe=[1,87],ce=[1,88],le=[1,89],he=[1,90],de=[1,91],Te=[1,92],pe=[1,93],Ee=[1,94],ue=[1,95],fe=[1,96],_e=[1,97],ge=[1,98],xe=[1,99],Ie=[1,100],ye=[1,101],Re=[1,102],Oe=[1,103],Le=[1,104],be=[1,105],Ae=[2,78],Nt=[4,5,17,51,53,54],vt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],Se=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],Gt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],we=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],Xt=[5,52],H=[70,71,72,73],ct=[1,151],Jt={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:x(function(N,v,k,y,G,c,mt){var d=c.length-1;switch(G){case 3:return y.apply(c[d]),c[d];case 4:case 10:this.$=[];break;case 5:case 11:c[d-1].push(c[d]),this.$=c[d-1];break;case 6:case 7:case 12:case 13:this.$=c[d];break;case 8:case 9:case 14:this.$=[];break;case 16:c[d].type="createParticipant",this.$=c[d];break;case 17:c[d-1].unshift({type:"boxStart",boxData:y.parseBoxData(c[d-2])}),c[d-1].push({type:"boxEnd",boxText:c[d-2]}),this.$=c[d-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(c[d-2]),sequenceIndexStep:Number(c[d-1]),sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(c[d-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:y.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:y.LINETYPE.ACTIVE_START,actor:c[d-1].actor};break;case 24:this.$={type:"activeEnd",signalType:y.LINETYPE.ACTIVE_END,actor:c[d-1].actor};break;case 30:y.setDiagramTitle(c[d].substring(6)),this.$=c[d].substring(6);break;case 31:y.setDiagramTitle(c[d].substring(7)),this.$=c[d].substring(7);break;case 32:this.$=c[d].trim(),y.setAccTitle(this.$);break;case 33:case 34:this.$=c[d].trim(),y.setAccDescription(this.$);break;case 35:c[d-1].unshift({type:"loopStart",loopText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.LOOP_START}),c[d-1].push({type:"loopEnd",loopText:c[d-2],signalType:y.LINETYPE.LOOP_END}),this.$=c[d-1];break;case 36:c[d-1].unshift({type:"rectStart",color:y.parseMessage(c[d-2]),signalType:y.LINETYPE.RECT_START}),c[d-1].push({type:"rectEnd",color:y.parseMessage(c[d-2]),signalType:y.LINETYPE.RECT_END}),this.$=c[d-1];break;case 37:c[d-1].unshift({type:"optStart",optText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.OPT_START}),c[d-1].push({type:"optEnd",optText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.OPT_END}),this.$=c[d-1];break;case 38:c[d-1].unshift({type:"altStart",altText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.ALT_START}),c[d-1].push({type:"altEnd",signalType:y.LINETYPE.ALT_END}),this.$=c[d-1];break;case 39:c[d-1].unshift({type:"parStart",parText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.PAR_START}),c[d-1].push({type:"parEnd",signalType:y.LINETYPE.PAR_END}),this.$=c[d-1];break;case 40:c[d-1].unshift({type:"parStart",parText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.PAR_OVER_START}),c[d-1].push({type:"parEnd",signalType:y.LINETYPE.PAR_END}),this.$=c[d-1];break;case 41:c[d-1].unshift({type:"criticalStart",criticalText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.CRITICAL_START}),c[d-1].push({type:"criticalEnd",signalType:y.LINETYPE.CRITICAL_END}),this.$=c[d-1];break;case 42:c[d-1].unshift({type:"breakStart",breakText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.BREAK_START}),c[d-1].push({type:"breakEnd",optText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.BREAK_END}),this.$=c[d-1];break;case 44:this.$=c[d-3].concat([{type:"option",optionText:y.parseMessage(c[d-1]),signalType:y.LINETYPE.CRITICAL_OPTION},c[d]]);break;case 46:this.$=c[d-3].concat([{type:"and",parText:y.parseMessage(c[d-1]),signalType:y.LINETYPE.PAR_AND},c[d]]);break;case 48:this.$=c[d-3].concat([{type:"else",altText:y.parseMessage(c[d-1]),signalType:y.LINETYPE.ALT_ELSE},c[d]]);break;case 49:c[d-3].draw="participant",c[d-3].type="addParticipant",c[d-3].description=y.parseMessage(c[d-1]),this.$=c[d-3];break;case 50:c[d-1].draw="participant",c[d-1].type="addParticipant",this.$=c[d-1];break;case 51:c[d-3].draw="actor",c[d-3].type="addParticipant",c[d-3].description=y.parseMessage(c[d-1]),this.$=c[d-3];break;case 52:case 57:c[d-1].draw="actor",c[d-1].type="addParticipant",this.$=c[d-1];break;case 53:c[d-1].type="destroyParticipant",this.$=c[d-1];break;case 54:c[d-3].draw="participant",c[d-3].type="addParticipant",c[d-3].description=y.parseMessage(c[d-1]),this.$=c[d-3];break;case 55:c[d-1].draw="participant",c[d-1].type="addParticipant",this.$=c[d-1];break;case 56:c[d-3].draw="actor",c[d-3].type="addParticipant",c[d-3].description=y.parseMessage(c[d-1]),this.$=c[d-3];break;case 58:this.$=[c[d-1],{type:"addNote",placement:c[d-2],actor:c[d-1].actor,text:c[d]}];break;case 59:c[d-2]=[].concat(c[d-1],c[d-1]).slice(0,2),c[d-2][0]=c[d-2][0].actor,c[d-2][1]=c[d-2][1].actor,this.$=[c[d-1],{type:"addNote",placement:y.PLACEMENT.OVER,actor:c[d-2].slice(0,2),text:c[d]}];break;case 60:this.$=[c[d-1],{type:"addLinks",actor:c[d-1].actor,text:c[d]}];break;case 61:this.$=[c[d-1],{type:"addALink",actor:c[d-1].actor,text:c[d]}];break;case 62:this.$=[c[d-1],{type:"addProperties",actor:c[d-1].actor,text:c[d]}];break;case 63:this.$=[c[d-1],{type:"addDetails",actor:c[d-1].actor,text:c[d]}];break;case 66:this.$=[c[d-2],c[d]];break;case 67:this.$=c[d];break;case 68:this.$=y.PLACEMENT.LEFTOF;break;case 69:this.$=y.PLACEMENT.RIGHTOF;break;case 70:this.$=[c[d-4],c[d-1],{type:"addMessage",from:c[d-4].actor,to:c[d-1].actor,signalType:c[d-3],msg:c[d],activate:!0},{type:"activeStart",signalType:y.LINETYPE.ACTIVE_START,actor:c[d-1].actor}];break;case 71:this.$=[c[d-4],c[d-1],{type:"addMessage",from:c[d-4].actor,to:c[d-1].actor,signalType:c[d-3],msg:c[d]},{type:"activeEnd",signalType:y.LINETYPE.ACTIVE_END,actor:c[d-4].actor}];break;case 72:this.$=[c[d-4],c[d-1],{type:"addMessage",from:c[d-4].actor,to:c[d-1].actor,signalType:c[d-3],msg:c[d],activate:!0,centralConnection:y.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:y.LINETYPE.CENTRAL_CONNECTION,actor:c[d-1].actor}];break;case 73:this.$=[c[d-4],c[d-1],{type:"addMessage",from:c[d-4].actor,to:c[d-1].actor,signalType:c[d-2],msg:c[d],activate:!1,centralConnection:y.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:y.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:c[d-4].actor}];break;case 74:this.$=[c[d-5],c[d-1],{type:"addMessage",from:c[d-5].actor,to:c[d-1].actor,signalType:c[d-3],msg:c[d],activate:!0,centralConnection:y.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:y.LINETYPE.CENTRAL_CONNECTION,actor:c[d-1].actor},{type:"centralConnectionReverse",signalType:y.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:c[d-5].actor}];break;case 75:this.$=[c[d-3],c[d-1],{type:"addMessage",from:c[d-3].actor,to:c[d-1].actor,signalType:c[d-2],msg:c[d]}];break;case 76:this.$={type:"addParticipant",actor:c[d-1],config:c[d]};break;case 77:this.$=c[d-1].trim();break;case 78:this.$={type:"addParticipant",actor:c[d]};break;case 79:this.$=y.LINETYPE.SOLID_OPEN;break;case 80:this.$=y.LINETYPE.DOTTED_OPEN;break;case 81:this.$=y.LINETYPE.SOLID;break;case 82:this.$=y.LINETYPE.SOLID_TOP;break;case 83:this.$=y.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=y.LINETYPE.STICK_TOP;break;case 85:this.$=y.LINETYPE.STICK_BOTTOM;break;case 86:this.$=y.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=y.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=y.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=y.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=y.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=y.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=y.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=y.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=y.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=y.LINETYPE.DOTTED;break;case 100:this.$=y.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=y.LINETYPE.SOLID_CROSS;break;case 102:this.$=y.LINETYPE.DOTTED_CROSS;break;case 103:this.$=y.LINETYPE.SOLID_POINT;break;case 104:this.$=y.LINETYPE.DOTTED_POINT;break;case 105:this.$=y.parseMessage(c[d].trim().substring(1));break}},"anonymous"),table:[{3:1,4:t,5:a,6:r},{1:[3]},{3:5,4:t,5:a,6:r},{3:6,4:t,5:a,6:r},e([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:h,18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:P,40:S,42:w,44:M,45:V,47:Y,51:z,53:K,54:X,56:$,61:tt,62:U,63:nt,64:et,73:W},e(C,[2,5]),{9:48,13:13,14:E,15:h,18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:P,40:S,42:w,44:M,45:V,47:Y,51:z,53:K,54:X,56:$,61:tt,62:U,63:nt,64:et,73:W},e(C,[2,7]),e(C,[2,8]),e(C,[2,9]),e(C,[2,15]),{13:49,51:z,53:K,54:X},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:W},{23:56,73:W},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},e(C,[2,30]),e(C,[2,31]),{33:[1,62]},{35:[1,63]},e(C,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:wt},{23:75,55:76,73:wt},{23:77,73:W},{69:78,72:[1,79],78:Dt,79:A,80:D,81:rt,82:at,83:F,84:Ot,85:oe,86:ce,87:le,88:he,89:de,90:Te,91:pe,92:Ee,93:ue,94:fe,95:_e,96:ge,97:xe,98:Ie,99:ye,100:Re,101:Oe,102:Le,103:be},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:W},{23:111,73:W},{23:112,73:W},{23:113,73:W},e([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],Ae),e(C,[2,6]),e(C,[2,16]),e(Nt,[2,10],{11:114}),e(C,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},e(C,[2,22]),{5:[1,118]},{5:[1,119]},e(C,[2,25]),e(C,[2,26]),e(C,[2,27]),e(C,[2,28]),e(C,[2,29]),e(C,[2,32]),e(C,[2,33]),e(vt,i,{7:120}),e(vt,i,{7:121}),e(vt,i,{7:122}),e(Se,i,{41:123,7:124}),e(Gt,i,{43:125,7:126}),e(Gt,i,{7:126,43:127}),e(we,i,{46:128,7:129}),e(vt,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},e(Xt,Ae,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:W},{69:146,78:Dt,79:A,80:D,81:rt,82:at,83:F,84:Ot,85:oe,86:ce,87:le,88:he,89:de,90:Te,91:pe,92:Ee,93:ue,94:fe,95:_e,96:ge,97:xe,98:Ie,99:ye,100:Re,101:Oe,102:Le,103:be},e(H,[2,79]),e(H,[2,80]),e(H,[2,81]),e(H,[2,82]),e(H,[2,83]),e(H,[2,84]),e(H,[2,85]),e(H,[2,86]),e(H,[2,87]),e(H,[2,88]),e(H,[2,89]),e(H,[2,90]),e(H,[2,91]),e(H,[2,92]),e(H,[2,93]),e(H,[2,94]),e(H,[2,95]),e(H,[2,96]),e(H,[2,97]),e(H,[2,98]),e(H,[2,99]),e(H,[2,100]),e(H,[2,101]),e(H,[2,102]),e(H,[2,103]),e(H,[2,104]),{23:147,73:W},{23:149,60:148,73:W},{73:[2,68]},{73:[2,69]},{58:150,104:ct},{58:152,104:ct},{58:153,104:ct},{58:154,104:ct},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:z,53:K,54:X},{5:[1,160]},e(C,[2,20]),e(C,[2,21]),e(C,[2,23]),e(C,[2,24]),{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:h,17:[1,161],18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:P,40:S,42:w,44:M,45:V,47:Y,51:z,53:K,54:X,56:$,61:tt,62:U,63:nt,64:et,73:W},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:h,17:[1,162],18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:P,40:S,42:w,44:M,45:V,47:Y,51:z,53:K,54:X,56:$,61:tt,62:U,63:nt,64:et,73:W},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:h,17:[1,163],18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:P,40:S,42:w,44:M,45:V,47:Y,51:z,53:K,54:X,56:$,61:tt,62:U,63:nt,64:et,73:W},{17:[1,164]},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:h,17:[2,47],18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:P,40:S,42:w,44:M,45:V,47:Y,50:[1,165],51:z,53:K,54:X,56:$,61:tt,62:U,63:nt,64:et,73:W},{17:[1,166]},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:h,17:[2,45],18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:P,40:S,42:w,44:M,45:V,47:Y,49:[1,167],51:z,53:K,54:X,56:$,61:tt,62:U,63:nt,64:et,73:W},{17:[1,168]},{17:[1,169]},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:h,17:[2,43],18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:P,40:S,42:w,44:M,45:V,47:Y,48:[1,170],51:z,53:K,54:X,56:$,61:tt,62:U,63:nt,64:et,73:W},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:h,17:[1,171],18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:P,40:S,42:w,44:M,45:V,47:Y,51:z,53:K,54:X,56:$,61:tt,62:U,63:nt,64:et,73:W},{16:[1,172]},e(C,[2,50]),{16:[1,173]},e(C,[2,55]),e(Xt,[2,76]),{76:[1,174]},{16:[1,175]},e(C,[2,52]),{16:[1,176]},e(C,[2,57]),e(C,[2,53]),{23:177,73:W},{23:178,73:W},{23:179,73:W},{58:180,104:ct},{23:181,72:[1,182],73:W},{58:183,104:ct},{58:184,104:ct},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},e(C,[2,17]),e(Nt,[2,11]),{13:186,51:z,53:K,54:X},e(Nt,[2,13]),e(Nt,[2,14]),e(C,[2,19]),e(C,[2,35]),e(C,[2,36]),e(C,[2,37]),e(C,[2,38]),{16:[1,187]},e(C,[2,39]),{16:[1,188]},e(C,[2,40]),e(C,[2,41]),{16:[1,189]},e(C,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:ct},{58:196,104:ct},{58:197,104:ct},{5:[2,75]},{58:198,104:ct},{23:199,73:W},{5:[2,58]},{5:[2,59]},{23:200,73:W},e(Nt,[2,12]),e(Se,i,{7:124,41:201}),e(Gt,i,{7:126,43:202}),e(we,i,{7:129,46:203}),e(C,[2,49]),e(C,[2,54]),e(Xt,[2,77]),e(C,[2,51]),e(C,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:ct},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:x(function(N,v){if(v.recoverable)this.trace(N);else{var k=new Error(N);throw k.hash=v,k}},"parseError"),parse:x(function(N){var v=this,k=[0],y=[],G=[null],c=[],mt=this.table,d="",Mt=0,Ne=0,Qe=2,me=1,$e=c.slice.call(arguments,1),J=Object.create(this.lexer),gt={yy:{}};for(var Zt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Zt)&&(gt.yy[Zt]=this.yy[Zt]);J.setInput(N,gt.yy),gt.yy.lexer=J,gt.yy.parser=this,typeof J.yylloc>"u"&&(J.yylloc={});var Qt=J.yylloc;c.push(Qt);var je=J.options&&J.options.ranges;typeof gt.yy.parseError=="function"?this.parseError=gt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function tr(ot){k.length=k.length-2*ot,G.length=G.length-ot,c.length=c.length-ot}x(tr,"popStack");function Pe(){var ot;return ot=y.pop()||J.lex()||me,typeof ot!="number"&&(ot instanceof Array&&(y=ot,ot=y.pop()),ot=v.symbols_[ot]||ot),ot}x(Pe,"lex");for(var st,xt,lt,$t,Lt={},Bt,Tt,ke,Vt;;){if(xt=k[k.length-1],this.defaultActions[xt]?lt=this.defaultActions[xt]:((st===null||typeof st>"u")&&(st=Pe()),lt=mt[xt]&&mt[xt][st]),typeof lt>"u"||!lt.length||!lt[0]){var jt="";Vt=[];for(Bt in mt[xt])this.terminals_[Bt]&&Bt>Qe&&Vt.push("'"+this.terminals_[Bt]+"'");J.showPosition?jt="Parse error on line "+(Mt+1)+`: +import{I as er}from"./chunk-2Q5K7J3B-BK3jpFNd.js";import{a as x,aS as rr,Y as j,at as it,aO as Me,B as ar,j as sr,x as m,aR as De,aQ as ir,aT as nr,W as or,V as cr,$ as lr,as as hr,J as dr,s as Tr,aN as Yt,b9 as Z,ac as Q,n as kt,aC as Be,Z as pr,X as Ft,a9 as Er,aL as Ve}from"./mermaid.core-DAx4nvmm.js";import{d as ur,h as se,g as dt,e as fr,a as ie,b as ne}from"./chunk-2GRJ4B5K-BNT0kar4.js";import{aG as Wt}from"../../app/index-8JtvDNuA.js";import"../../chunks/purify.es-BnINGy_Y.js";var ee=function(){var e=x(function(ut,N,v,k){for(v=v||{},k=ut.length;k--;v[ut[k]]=N);return v},"o"),t=[1,2],a=[1,3],r=[1,4],i=[2,4],n=[1,9],s=[1,11],o=[1,12],E=[1,14],h=[1,15],p=[1,17],_=[1,18],u=[1,19],O=[1,25],T=[1,26],g=[1,27],f=[1,28],I=[1,29],L=[1,30],b=[1,31],P=[1,32],S=[1,33],w=[1,34],M=[1,35],V=[1,36],Y=[1,37],z=[1,38],K=[1,39],X=[1,40],$=[1,42],tt=[1,43],U=[1,44],nt=[1,45],et=[1,46],W=[1,47],C=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],wt=[1,74],Dt=[1,80],A=[1,81],D=[1,82],rt=[1,83],at=[1,84],F=[1,85],Ot=[1,86],oe=[1,87],ce=[1,88],le=[1,89],he=[1,90],de=[1,91],Te=[1,92],pe=[1,93],Ee=[1,94],ue=[1,95],fe=[1,96],_e=[1,97],ge=[1,98],xe=[1,99],Ie=[1,100],ye=[1,101],Re=[1,102],Oe=[1,103],Le=[1,104],be=[1,105],Ae=[2,78],Nt=[4,5,17,51,53,54],vt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],Se=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],Gt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],we=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],Xt=[5,52],H=[70,71,72,73],ct=[1,151],Jt={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:x(function(N,v,k,y,G,c,mt){var d=c.length-1;switch(G){case 3:return y.apply(c[d]),c[d];case 4:case 10:this.$=[];break;case 5:case 11:c[d-1].push(c[d]),this.$=c[d-1];break;case 6:case 7:case 12:case 13:this.$=c[d];break;case 8:case 9:case 14:this.$=[];break;case 16:c[d].type="createParticipant",this.$=c[d];break;case 17:c[d-1].unshift({type:"boxStart",boxData:y.parseBoxData(c[d-2])}),c[d-1].push({type:"boxEnd",boxText:c[d-2]}),this.$=c[d-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(c[d-2]),sequenceIndexStep:Number(c[d-1]),sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(c[d-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:y.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:y.LINETYPE.ACTIVE_START,actor:c[d-1].actor};break;case 24:this.$={type:"activeEnd",signalType:y.LINETYPE.ACTIVE_END,actor:c[d-1].actor};break;case 30:y.setDiagramTitle(c[d].substring(6)),this.$=c[d].substring(6);break;case 31:y.setDiagramTitle(c[d].substring(7)),this.$=c[d].substring(7);break;case 32:this.$=c[d].trim(),y.setAccTitle(this.$);break;case 33:case 34:this.$=c[d].trim(),y.setAccDescription(this.$);break;case 35:c[d-1].unshift({type:"loopStart",loopText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.LOOP_START}),c[d-1].push({type:"loopEnd",loopText:c[d-2],signalType:y.LINETYPE.LOOP_END}),this.$=c[d-1];break;case 36:c[d-1].unshift({type:"rectStart",color:y.parseMessage(c[d-2]),signalType:y.LINETYPE.RECT_START}),c[d-1].push({type:"rectEnd",color:y.parseMessage(c[d-2]),signalType:y.LINETYPE.RECT_END}),this.$=c[d-1];break;case 37:c[d-1].unshift({type:"optStart",optText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.OPT_START}),c[d-1].push({type:"optEnd",optText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.OPT_END}),this.$=c[d-1];break;case 38:c[d-1].unshift({type:"altStart",altText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.ALT_START}),c[d-1].push({type:"altEnd",signalType:y.LINETYPE.ALT_END}),this.$=c[d-1];break;case 39:c[d-1].unshift({type:"parStart",parText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.PAR_START}),c[d-1].push({type:"parEnd",signalType:y.LINETYPE.PAR_END}),this.$=c[d-1];break;case 40:c[d-1].unshift({type:"parStart",parText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.PAR_OVER_START}),c[d-1].push({type:"parEnd",signalType:y.LINETYPE.PAR_END}),this.$=c[d-1];break;case 41:c[d-1].unshift({type:"criticalStart",criticalText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.CRITICAL_START}),c[d-1].push({type:"criticalEnd",signalType:y.LINETYPE.CRITICAL_END}),this.$=c[d-1];break;case 42:c[d-1].unshift({type:"breakStart",breakText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.BREAK_START}),c[d-1].push({type:"breakEnd",optText:y.parseMessage(c[d-2]),signalType:y.LINETYPE.BREAK_END}),this.$=c[d-1];break;case 44:this.$=c[d-3].concat([{type:"option",optionText:y.parseMessage(c[d-1]),signalType:y.LINETYPE.CRITICAL_OPTION},c[d]]);break;case 46:this.$=c[d-3].concat([{type:"and",parText:y.parseMessage(c[d-1]),signalType:y.LINETYPE.PAR_AND},c[d]]);break;case 48:this.$=c[d-3].concat([{type:"else",altText:y.parseMessage(c[d-1]),signalType:y.LINETYPE.ALT_ELSE},c[d]]);break;case 49:c[d-3].draw="participant",c[d-3].type="addParticipant",c[d-3].description=y.parseMessage(c[d-1]),this.$=c[d-3];break;case 50:c[d-1].draw="participant",c[d-1].type="addParticipant",this.$=c[d-1];break;case 51:c[d-3].draw="actor",c[d-3].type="addParticipant",c[d-3].description=y.parseMessage(c[d-1]),this.$=c[d-3];break;case 52:case 57:c[d-1].draw="actor",c[d-1].type="addParticipant",this.$=c[d-1];break;case 53:c[d-1].type="destroyParticipant",this.$=c[d-1];break;case 54:c[d-3].draw="participant",c[d-3].type="addParticipant",c[d-3].description=y.parseMessage(c[d-1]),this.$=c[d-3];break;case 55:c[d-1].draw="participant",c[d-1].type="addParticipant",this.$=c[d-1];break;case 56:c[d-3].draw="actor",c[d-3].type="addParticipant",c[d-3].description=y.parseMessage(c[d-1]),this.$=c[d-3];break;case 58:this.$=[c[d-1],{type:"addNote",placement:c[d-2],actor:c[d-1].actor,text:c[d]}];break;case 59:c[d-2]=[].concat(c[d-1],c[d-1]).slice(0,2),c[d-2][0]=c[d-2][0].actor,c[d-2][1]=c[d-2][1].actor,this.$=[c[d-1],{type:"addNote",placement:y.PLACEMENT.OVER,actor:c[d-2].slice(0,2),text:c[d]}];break;case 60:this.$=[c[d-1],{type:"addLinks",actor:c[d-1].actor,text:c[d]}];break;case 61:this.$=[c[d-1],{type:"addALink",actor:c[d-1].actor,text:c[d]}];break;case 62:this.$=[c[d-1],{type:"addProperties",actor:c[d-1].actor,text:c[d]}];break;case 63:this.$=[c[d-1],{type:"addDetails",actor:c[d-1].actor,text:c[d]}];break;case 66:this.$=[c[d-2],c[d]];break;case 67:this.$=c[d];break;case 68:this.$=y.PLACEMENT.LEFTOF;break;case 69:this.$=y.PLACEMENT.RIGHTOF;break;case 70:this.$=[c[d-4],c[d-1],{type:"addMessage",from:c[d-4].actor,to:c[d-1].actor,signalType:c[d-3],msg:c[d],activate:!0},{type:"activeStart",signalType:y.LINETYPE.ACTIVE_START,actor:c[d-1].actor}];break;case 71:this.$=[c[d-4],c[d-1],{type:"addMessage",from:c[d-4].actor,to:c[d-1].actor,signalType:c[d-3],msg:c[d]},{type:"activeEnd",signalType:y.LINETYPE.ACTIVE_END,actor:c[d-4].actor}];break;case 72:this.$=[c[d-4],c[d-1],{type:"addMessage",from:c[d-4].actor,to:c[d-1].actor,signalType:c[d-3],msg:c[d],activate:!0,centralConnection:y.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:y.LINETYPE.CENTRAL_CONNECTION,actor:c[d-1].actor}];break;case 73:this.$=[c[d-4],c[d-1],{type:"addMessage",from:c[d-4].actor,to:c[d-1].actor,signalType:c[d-2],msg:c[d],activate:!1,centralConnection:y.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:y.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:c[d-4].actor}];break;case 74:this.$=[c[d-5],c[d-1],{type:"addMessage",from:c[d-5].actor,to:c[d-1].actor,signalType:c[d-3],msg:c[d],activate:!0,centralConnection:y.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:y.LINETYPE.CENTRAL_CONNECTION,actor:c[d-1].actor},{type:"centralConnectionReverse",signalType:y.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:c[d-5].actor}];break;case 75:this.$=[c[d-3],c[d-1],{type:"addMessage",from:c[d-3].actor,to:c[d-1].actor,signalType:c[d-2],msg:c[d]}];break;case 76:this.$={type:"addParticipant",actor:c[d-1],config:c[d]};break;case 77:this.$=c[d-1].trim();break;case 78:this.$={type:"addParticipant",actor:c[d]};break;case 79:this.$=y.LINETYPE.SOLID_OPEN;break;case 80:this.$=y.LINETYPE.DOTTED_OPEN;break;case 81:this.$=y.LINETYPE.SOLID;break;case 82:this.$=y.LINETYPE.SOLID_TOP;break;case 83:this.$=y.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=y.LINETYPE.STICK_TOP;break;case 85:this.$=y.LINETYPE.STICK_BOTTOM;break;case 86:this.$=y.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=y.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=y.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=y.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=y.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=y.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=y.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=y.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=y.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=y.LINETYPE.DOTTED;break;case 100:this.$=y.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=y.LINETYPE.SOLID_CROSS;break;case 102:this.$=y.LINETYPE.DOTTED_CROSS;break;case 103:this.$=y.LINETYPE.SOLID_POINT;break;case 104:this.$=y.LINETYPE.DOTTED_POINT;break;case 105:this.$=y.parseMessage(c[d].trim().substring(1));break}},"anonymous"),table:[{3:1,4:t,5:a,6:r},{1:[3]},{3:5,4:t,5:a,6:r},{3:6,4:t,5:a,6:r},e([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:h,18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:P,40:S,42:w,44:M,45:V,47:Y,51:z,53:K,54:X,56:$,61:tt,62:U,63:nt,64:et,73:W},e(C,[2,5]),{9:48,13:13,14:E,15:h,18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:P,40:S,42:w,44:M,45:V,47:Y,51:z,53:K,54:X,56:$,61:tt,62:U,63:nt,64:et,73:W},e(C,[2,7]),e(C,[2,8]),e(C,[2,9]),e(C,[2,15]),{13:49,51:z,53:K,54:X},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:W},{23:56,73:W},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},e(C,[2,30]),e(C,[2,31]),{33:[1,62]},{35:[1,63]},e(C,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:wt},{23:75,55:76,73:wt},{23:77,73:W},{69:78,72:[1,79],78:Dt,79:A,80:D,81:rt,82:at,83:F,84:Ot,85:oe,86:ce,87:le,88:he,89:de,90:Te,91:pe,92:Ee,93:ue,94:fe,95:_e,96:ge,97:xe,98:Ie,99:ye,100:Re,101:Oe,102:Le,103:be},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:W},{23:111,73:W},{23:112,73:W},{23:113,73:W},e([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],Ae),e(C,[2,6]),e(C,[2,16]),e(Nt,[2,10],{11:114}),e(C,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},e(C,[2,22]),{5:[1,118]},{5:[1,119]},e(C,[2,25]),e(C,[2,26]),e(C,[2,27]),e(C,[2,28]),e(C,[2,29]),e(C,[2,32]),e(C,[2,33]),e(vt,i,{7:120}),e(vt,i,{7:121}),e(vt,i,{7:122}),e(Se,i,{41:123,7:124}),e(Gt,i,{43:125,7:126}),e(Gt,i,{7:126,43:127}),e(we,i,{46:128,7:129}),e(vt,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},e(Xt,Ae,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:W},{69:146,78:Dt,79:A,80:D,81:rt,82:at,83:F,84:Ot,85:oe,86:ce,87:le,88:he,89:de,90:Te,91:pe,92:Ee,93:ue,94:fe,95:_e,96:ge,97:xe,98:Ie,99:ye,100:Re,101:Oe,102:Le,103:be},e(H,[2,79]),e(H,[2,80]),e(H,[2,81]),e(H,[2,82]),e(H,[2,83]),e(H,[2,84]),e(H,[2,85]),e(H,[2,86]),e(H,[2,87]),e(H,[2,88]),e(H,[2,89]),e(H,[2,90]),e(H,[2,91]),e(H,[2,92]),e(H,[2,93]),e(H,[2,94]),e(H,[2,95]),e(H,[2,96]),e(H,[2,97]),e(H,[2,98]),e(H,[2,99]),e(H,[2,100]),e(H,[2,101]),e(H,[2,102]),e(H,[2,103]),e(H,[2,104]),{23:147,73:W},{23:149,60:148,73:W},{73:[2,68]},{73:[2,69]},{58:150,104:ct},{58:152,104:ct},{58:153,104:ct},{58:154,104:ct},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:z,53:K,54:X},{5:[1,160]},e(C,[2,20]),e(C,[2,21]),e(C,[2,23]),e(C,[2,24]),{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:h,17:[1,161],18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:P,40:S,42:w,44:M,45:V,47:Y,51:z,53:K,54:X,56:$,61:tt,62:U,63:nt,64:et,73:W},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:h,17:[1,162],18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:P,40:S,42:w,44:M,45:V,47:Y,51:z,53:K,54:X,56:$,61:tt,62:U,63:nt,64:et,73:W},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:h,17:[1,163],18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:P,40:S,42:w,44:M,45:V,47:Y,51:z,53:K,54:X,56:$,61:tt,62:U,63:nt,64:et,73:W},{17:[1,164]},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:h,17:[2,47],18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:P,40:S,42:w,44:M,45:V,47:Y,50:[1,165],51:z,53:K,54:X,56:$,61:tt,62:U,63:nt,64:et,73:W},{17:[1,166]},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:h,17:[2,45],18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:P,40:S,42:w,44:M,45:V,47:Y,49:[1,167],51:z,53:K,54:X,56:$,61:tt,62:U,63:nt,64:et,73:W},{17:[1,168]},{17:[1,169]},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:h,17:[2,43],18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:P,40:S,42:w,44:M,45:V,47:Y,48:[1,170],51:z,53:K,54:X,56:$,61:tt,62:U,63:nt,64:et,73:W},{4:n,5:s,8:8,9:10,10:o,13:13,14:E,15:h,17:[1,171],18:16,19:p,22:_,23:41,24:u,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:P,40:S,42:w,44:M,45:V,47:Y,51:z,53:K,54:X,56:$,61:tt,62:U,63:nt,64:et,73:W},{16:[1,172]},e(C,[2,50]),{16:[1,173]},e(C,[2,55]),e(Xt,[2,76]),{76:[1,174]},{16:[1,175]},e(C,[2,52]),{16:[1,176]},e(C,[2,57]),e(C,[2,53]),{23:177,73:W},{23:178,73:W},{23:179,73:W},{58:180,104:ct},{23:181,72:[1,182],73:W},{58:183,104:ct},{58:184,104:ct},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},e(C,[2,17]),e(Nt,[2,11]),{13:186,51:z,53:K,54:X},e(Nt,[2,13]),e(Nt,[2,14]),e(C,[2,19]),e(C,[2,35]),e(C,[2,36]),e(C,[2,37]),e(C,[2,38]),{16:[1,187]},e(C,[2,39]),{16:[1,188]},e(C,[2,40]),e(C,[2,41]),{16:[1,189]},e(C,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:ct},{58:196,104:ct},{58:197,104:ct},{5:[2,75]},{58:198,104:ct},{23:199,73:W},{5:[2,58]},{5:[2,59]},{23:200,73:W},e(Nt,[2,12]),e(Se,i,{7:124,41:201}),e(Gt,i,{7:126,43:202}),e(we,i,{7:129,46:203}),e(C,[2,49]),e(C,[2,54]),e(Xt,[2,77]),e(C,[2,51]),e(C,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:ct},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:x(function(N,v){if(v.recoverable)this.trace(N);else{var k=new Error(N);throw k.hash=v,k}},"parseError"),parse:x(function(N){var v=this,k=[0],y=[],G=[null],c=[],mt=this.table,d="",Mt=0,Ne=0,Qe=2,me=1,$e=c.slice.call(arguments,1),J=Object.create(this.lexer),gt={yy:{}};for(var Zt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Zt)&&(gt.yy[Zt]=this.yy[Zt]);J.setInput(N,gt.yy),gt.yy.lexer=J,gt.yy.parser=this,typeof J.yylloc>"u"&&(J.yylloc={});var Qt=J.yylloc;c.push(Qt);var je=J.options&&J.options.ranges;typeof gt.yy.parseError=="function"?this.parseError=gt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function tr(ot){k.length=k.length-2*ot,G.length=G.length-ot,c.length=c.length-ot}x(tr,"popStack");function Pe(){var ot;return ot=y.pop()||J.lex()||me,typeof ot!="number"&&(ot instanceof Array&&(y=ot,ot=y.pop()),ot=v.symbols_[ot]||ot),ot}x(Pe,"lex");for(var st,xt,lt,$t,Lt={},Bt,Tt,ke,Vt;;){if(xt=k[k.length-1],this.defaultActions[xt]?lt=this.defaultActions[xt]:((st===null||typeof st>"u")&&(st=Pe()),lt=mt[xt]&&mt[xt][st]),typeof lt>"u"||!lt.length||!lt[0]){var jt="";Vt=[];for(Bt in mt[xt])this.terminals_[Bt]&&Bt>Qe&&Vt.push("'"+this.terminals_[Bt]+"'");J.showPosition?jt="Parse error on line "+(Mt+1)+`: `+J.showPosition()+` Expecting `+Vt.join(", ")+", got '"+(this.terminals_[st]||st)+"'":jt="Parse error on line "+(Mt+1)+": Unexpected "+(st==me?"end of input":"'"+(this.terminals_[st]||st)+"'"),this.parseError(jt,{text:J.match,token:this.terminals_[st]||st,line:J.yylineno,loc:Qt,expected:Vt})}if(lt[0]instanceof Array&<.length>1)throw new Error("Parse Error: multiple actions possible at state: "+xt+", token: "+st);switch(lt[0]){case 1:k.push(st),G.push(J.yytext),c.push(J.yylloc),k.push(lt[1]),st=null,Ne=J.yyleng,d=J.yytext,Mt=J.yylineno,Qt=J.yylloc;break;case 2:if(Tt=this.productions_[lt[1]][1],Lt.$=G[G.length-Tt],Lt._$={first_line:c[c.length-(Tt||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(Tt||1)].first_column,last_column:c[c.length-1].last_column},je&&(Lt._$.range=[c[c.length-(Tt||1)].range[0],c[c.length-1].range[1]]),$t=this.performAction.apply(Lt,[d,Ne,Mt,gt.yy,lt[1],G,c].concat($e)),typeof $t<"u")return $t;Tt&&(k=k.slice(0,-1*Tt*2),G=G.slice(0,-1*Tt),c=c.slice(0,-1*Tt)),k.push(this.productions_[lt[1]][0]),G.push(Lt.$),c.push(Lt._$),ke=mt[k[k.length-2]][k[k.length-1]],k.push(ke);break;case 3:return!0}}return!0},"parse")},Ze=function(){var ut={EOF:1,parseError:x(function(v,k){if(this.yy.parser)this.yy.parser.parseError(v,k);else throw new Error(v)},"parseError"),setInput:x(function(N,v){return this.yy=v||this.yy||{},this._input=N,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var N=this._input[0];this.yytext+=N,this.yyleng++,this.offset++,this.match+=N,this.matched+=N;var v=N.match(/(?:\r\n?|\n).*/g);return v?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),N},"input"),unput:x(function(N){var v=N.length,k=N.split(/(?:\r\n?|\n)/g);this._input=N+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-v),this.offset-=v;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),k.length-1&&(this.yylineno-=k.length-1);var G=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:k?(k.length===y.length?this.yylloc.first_column:0)+y[y.length-k.length].length-k[0].length:this.yylloc.first_column-v},this.options.ranges&&(this.yylloc.range=[G[0],G[0]+this.yyleng-v]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(N){this.unput(this.match.slice(N))},"less"),pastInput:x(function(){var N=this.matched.substr(0,this.matched.length-this.match.length);return(N.length>20?"...":"")+N.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var N=this.match;return N.length<20&&(N+=this._input.substr(0,20-N.length)),(N.substr(0,20)+(N.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var N=this.pastInput(),v=new Array(N.length+1).join("-");return N+this.upcomingInput()+` diff --git a/veadk/webui/assets/visualizations/mermaid/sizeCapture-X5ZJPWSS-DguhcNs8.js b/veadk/webui/assets/visualizations/mermaid/sizeCapture-X5ZJPWSS-CNj0yAkQ.js similarity index 87% rename from veadk/webui/assets/visualizations/mermaid/sizeCapture-X5ZJPWSS-DguhcNs8.js rename to veadk/webui/assets/visualizations/mermaid/sizeCapture-X5ZJPWSS-CNj0yAkQ.js index 85bb09963..7321f612f 100644 --- a/veadk/webui/assets/visualizations/mermaid/sizeCapture-X5ZJPWSS-DguhcNs8.js +++ b/veadk/webui/assets/visualizations/mermaid/sizeCapture-X5ZJPWSS-CNj0yAkQ.js @@ -1 +1 @@ -import{a as n}from"./mermaid.core-y4TF8bTw.js";import"../../app/index-BNPwMQXG.js";import"../../chunks/purify.es-BnINGy_Y.js";var c=1;function a(){if(!(typeof globalThis>"u"))return globalThis}n(a,"getCaptureGlobal");function m(){var o;return!!((o=a())!=null&&o.mermaidCaptureSizes)}n(m,"shouldCaptureSizes");function d(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}n(d,"capturedFromLocation");function s(o,r){const e=a();if(!e)return;const t=r.node(),i=(t&&"ownerSVGElement"in t?t.ownerSVGElement:null)??t,p=(i==null?void 0:i.id)??"(unknown)";e.mermaidCapturedSizes??(e.mermaidCapturedSizes=[]);const u={svgId:p,sizes:o};e.mermaidCapturedSizes.push(u),e.mermaidLastCapturedSizes=u}n(s,"emitCapturedSizes");function l(o,r){const e=[];for(const t of r.nodes)t.isGroup||e.push({id:t.id,width:t.width??0,height:t.height??0});e.length!==0&&s({metadata:{captureVersion:c,capturedAt:new Date().toISOString(),capturedFrom:d()},nodes:e},o)}n(l,"captureNodeSizes");export{l as captureNodeSizes,m as shouldCaptureSizes}; +import{a as n}from"./mermaid.core-DAx4nvmm.js";import"../../app/index-8JtvDNuA.js";import"../../chunks/purify.es-BnINGy_Y.js";var c=1;function a(){if(!(typeof globalThis>"u"))return globalThis}n(a,"getCaptureGlobal");function m(){var o;return!!((o=a())!=null&&o.mermaidCaptureSizes)}n(m,"shouldCaptureSizes");function d(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}n(d,"capturedFromLocation");function s(o,r){const e=a();if(!e)return;const t=r.node(),i=(t&&"ownerSVGElement"in t?t.ownerSVGElement:null)??t,p=(i==null?void 0:i.id)??"(unknown)";e.mermaidCapturedSizes??(e.mermaidCapturedSizes=[]);const u={svgId:p,sizes:o};e.mermaidCapturedSizes.push(u),e.mermaidLastCapturedSizes=u}n(s,"emitCapturedSizes");function l(o,r){const e=[];for(const t of r.nodes)t.isGroup||e.push({id:t.id,width:t.width??0,height:t.height??0});e.length!==0&&s({metadata:{captureVersion:c,capturedAt:new Date().toISOString(),capturedFrom:d()},nodes:e},o)}n(l,"captureNodeSizes");export{l as captureNodeSizes,m as shouldCaptureSizes}; diff --git a/veadk/webui/assets/visualizations/mermaid/stateDiagram-OKZ733FA-CPFdYVIx.js b/veadk/webui/assets/visualizations/mermaid/stateDiagram-OKZ733FA-BvoTa-1C.js similarity index 96% rename from veadk/webui/assets/visualizations/mermaid/stateDiagram-OKZ733FA-CPFdYVIx.js rename to veadk/webui/assets/visualizations/mermaid/stateDiagram-OKZ733FA-BvoTa-1C.js index 326184e6c..ddd13b139 100644 --- a/veadk/webui/assets/visualizations/mermaid/stateDiagram-OKZ733FA-CPFdYVIx.js +++ b/veadk/webui/assets/visualizations/mermaid/stateDiagram-OKZ733FA-BvoTa-1C.js @@ -1 +1 @@ -import{b as R,s as W,S as N}from"./chunk-5RXB4S5H-CY1YEJD3.js";import{a as f,Y as t,at as S,B as P,x as z,aq as U,G as _,a9 as C,b9 as F}from"./mermaid.core-y4TF8bTw.js";import{aG as H}from"../../app/index-BNPwMQXG.js";import{G as O}from"../../chunks/graph-Dqkl27Ch.js";import{l as J}from"../../chunks/layout-B6FSD_Du.js";import"./chunk-XXDRQBXY-B8qTF1qQ.js";import"./chunk-KBJHAD2P-DtNDDRN1.js";import"./chunk-2GRJ4B5K-CvII-2ZL.js";import"../../chunks/purify.es-BnINGy_Y.js";import"../../chunks/map-8WAJQ6ap.js";var X=f(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),Y=f(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),D=f((e,i)=>{const d=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),c=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c.width+2*t().state.padding).attr("height",c.height+2*t().state.padding).attr("rx",t().state.radius),d},"drawSimpleState"),I=f((e,i)=>{const d=f(function(o,B,y){const v=o.append("tspan").attr("x",2*t().state.padding).text(B);y||v.attr("dy",t().state.textHeight)},"addTspan"),n=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.descriptions[0]).node().getBBox(),l=n.height,p=e.append("text").attr("x",t().state.padding).attr("y",l+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let a=!0,s=!0;i.descriptions.forEach(function(o){a||(d(p,o,s),s=!1),a=!1});const m=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+l+t().state.dividerMargin/2).attr("y2",t().state.padding+l+t().state.dividerMargin/2).attr("class","descr-divider"),x=p.node().getBBox(),g=Math.max(x.width,n.width);return m.attr("x2",g+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",g+2*t().state.padding).attr("height",x.height+l+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),$=f((e,i,d)=>{const c=t().state.padding,n=2*t().state.padding,l=e.node().getBBox(),p=l.width,a=l.x,s=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),x=s.node().getBBox().width+n;let g=Math.max(x,p);g===p&&(g=g+n);let o;const B=e.node().getBBox();i.doc,o=a-c,x>p&&(o=(p-g)/2+c),Math.abs(a-B.x)p&&(o=a-(x-p)/2);const y=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",o).attr("y",y).attr("class",d?"alt-composit":"composit").attr("width",g).attr("height",B.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),s.attr("x",o+c),x<=p&&s.attr("x",a+(g-n)/2-x/2+c),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",B.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),q=f(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),Z=f((e,i)=>{let d=t().state.forkWidth,c=t().state.forkHeight;if(i.parentId){let n=d;d=c,c=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",c).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),j=f((e,i,d,c)=>{let n=0;const l=c.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let p=e.replace(/\r\n/g,"
");p=p.replace(/\n/g,"
");const a=p.split(z.lineBreakRegex);let s=1.25*t().state.noteMargin;for(const m of a){const x=m.trim();if(x.length>0){const g=l.append("tspan");if(g.text(x),s===0){const o=g.node().getBBox();s+=o.height}n+=s,g.attr("x",i+t().state.noteMargin),g.attr("y",d+n+1.25*t().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:n}},"_drawLongText"),K=f((e,i)=>{i.attr("class","state-note");const d=i.append("rect").attr("x",0).attr("y",t().state.padding),c=i.append("g"),{textWidth:n,textHeight:l}=j(e,0,0,c);return d.attr("height",l+2*t().state.noteMargin),d.attr("width",n+t().state.noteMargin*2),d},"drawNote"),L=f(function(e,i){const d=i.id,c={id:d,label:i.id,width:0,height:0},n=e.append("g").attr("id",d).attr("class","stateGroup");i.type==="start"&&X(n),i.type==="end"&&q(n),(i.type==="fork"||i.type==="join")&&Z(n,i),i.type==="note"&&K(i.note.text,n),i.type==="divider"&&Y(n),i.type==="default"&&i.descriptions.length===0&&D(n,i),i.type==="default"&&i.descriptions.length>0&&I(n,i);const l=n.node().getBBox();return c.width=l.width+2*t().state.padding,c.height=l.height+2*t().state.padding,c},"drawState"),G=0,Q=f(function(e,i,d){const c=f(function(s){switch(s){case N.relationType.AGGREGATION:return"aggregation";case N.relationType.EXTENSION:return"extension";case N.relationType.COMPOSITION:return"composition";case N.relationType.DEPENDENCY:return"dependency"}},"getRelationType");i.points=i.points.filter(s=>!Number.isNaN(s.y));const n=i.points,l=U().x(function(s){return s.x}).y(function(s){return s.y}).curve(_),p=e.append("path").attr("d",l(n)).attr("id","edge"+G).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=C(!0)),p.attr("marker-end","url("+a+"#"+c(N.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const s=e.append("g").attr("class","stateLabel"),{x:m,y:x}=F.calcLabelPosition(i.points),g=z.getRows(d.title);let o=0;const B=[];let y=0,v=0;for(let u=0;u<=g.length;u++){const h=s.append("text").attr("text-anchor","middle").text(g[u]).attr("x",m).attr("y",x+o),w=h.node().getBBox();y=Math.max(y,w.width),v=Math.min(v,w.x),S.info(w.x,m,x+o),o===0&&(o=h.node().getBBox().height,S.info("Title height",o,x)),B.push(h)}let k=o*g.length;if(g.length>1){const u=(g.length-1)*o*.5;B.forEach((h,w)=>h.attr("y",x+w*o-u)),k=o*g.length}const r=s.node().getBBox();s.insert("rect",":first-child").attr("class","box").attr("x",m-y/2-t().state.padding/2).attr("y",x-k/2-t().state.padding/2-3.5).attr("width",y+t().state.padding).attr("height",k+t().state.padding),S.info(r)}G++},"drawEdge"),b,T={},V=f(function(){},"setConf"),tt=f(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),et=f(function(e,i,d,c){b=t().state;const n=t().securityLevel;let l;n==="sandbox"&&(l=H("#i"+i));const p=n==="sandbox"?H(l.nodes()[0].contentDocument.body):H("body"),a=n==="sandbox"?l.nodes()[0].contentDocument:document;S.debug("Rendering diagram "+e);const s=p.select(`[id='${i}']`);tt(s);const m=c.db.getRootDoc(),x=s.append("g").attr("id",i+"-root");A(m,x,void 0,!1,p,a,c);const g=b.padding,o=s.node().getBBox(),B=o.width+g*2,y=o.height+g*2,v=B*1.75;P(s,y,v,b.useMaxWidth),s.attr("viewBox",`${o.x-b.padding} ${o.y-b.padding} `+B+" "+y)},"draw"),at=f(e=>e?e.length*b.fontSizeFactor:1,"getLabelWidth"),A=f((e,i,d,c,n,l,p)=>{const a=new O({compound:!0,multigraph:!0});let s,m=!0;for(s=0;s{const w=h.parentElement;let E=0,M=0;w&&(w.parentElement&&(E=w.parentElement.getBBox().width),M=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(M)&&(M=0)),h.setAttribute("x1",0-M+8),h.setAttribute("x2",E-M-8)})):S.debug("No Node "+r+": "+JSON.stringify(a.node(r)))});let v=y.getBBox();a.edges().forEach(function(r){r!==void 0&&a.edge(r)!==void 0&&(S.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(a.edge(r))),Q(i,a.edge(r),a.edge(r).relation))}),v=y.getBBox();const k={id:d||"root",label:d||"root",width:0,height:0};return k.width=v.width+2*b.padding,k.height=v.height+2*b.padding,S.debug("Doc rendered",k,a),k},"renderDoc"),it={setConf:V,draw:et},xt={parser:W,get db(){return new N(1)},renderer:it,styles:R,init:f(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{xt as diagram}; +import{b as R,s as W,S as N}from"./chunk-5RXB4S5H-Ln4IekMd.js";import{a as f,Y as t,at as S,B as P,x as z,aq as U,G as _,a9 as C,b9 as F}from"./mermaid.core-DAx4nvmm.js";import{aG as H}from"../../app/index-8JtvDNuA.js";import{G as O}from"../../chunks/graph-Dqkl27Ch.js";import{l as J}from"../../chunks/layout-B6FSD_Du.js";import"./chunk-XXDRQBXY-BdI3VXTi.js";import"./chunk-KBJHAD2P-C0rklDe7.js";import"./chunk-2GRJ4B5K-BNT0kar4.js";import"../../chunks/purify.es-BnINGy_Y.js";import"../../chunks/map-8WAJQ6ap.js";var X=f(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),Y=f(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),D=f((e,i)=>{const d=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),c=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c.width+2*t().state.padding).attr("height",c.height+2*t().state.padding).attr("rx",t().state.radius),d},"drawSimpleState"),I=f((e,i)=>{const d=f(function(o,B,y){const v=o.append("tspan").attr("x",2*t().state.padding).text(B);y||v.attr("dy",t().state.textHeight)},"addTspan"),n=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.descriptions[0]).node().getBBox(),l=n.height,p=e.append("text").attr("x",t().state.padding).attr("y",l+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let a=!0,s=!0;i.descriptions.forEach(function(o){a||(d(p,o,s),s=!1),a=!1});const m=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+l+t().state.dividerMargin/2).attr("y2",t().state.padding+l+t().state.dividerMargin/2).attr("class","descr-divider"),x=p.node().getBBox(),g=Math.max(x.width,n.width);return m.attr("x2",g+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",g+2*t().state.padding).attr("height",x.height+l+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),$=f((e,i,d)=>{const c=t().state.padding,n=2*t().state.padding,l=e.node().getBBox(),p=l.width,a=l.x,s=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),x=s.node().getBBox().width+n;let g=Math.max(x,p);g===p&&(g=g+n);let o;const B=e.node().getBBox();i.doc,o=a-c,x>p&&(o=(p-g)/2+c),Math.abs(a-B.x)p&&(o=a-(x-p)/2);const y=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",o).attr("y",y).attr("class",d?"alt-composit":"composit").attr("width",g).attr("height",B.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),s.attr("x",o+c),x<=p&&s.attr("x",a+(g-n)/2-x/2+c),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",B.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),q=f(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),Z=f((e,i)=>{let d=t().state.forkWidth,c=t().state.forkHeight;if(i.parentId){let n=d;d=c,c=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",c).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),j=f((e,i,d,c)=>{let n=0;const l=c.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let p=e.replace(/\r\n/g,"
");p=p.replace(/\n/g,"
");const a=p.split(z.lineBreakRegex);let s=1.25*t().state.noteMargin;for(const m of a){const x=m.trim();if(x.length>0){const g=l.append("tspan");if(g.text(x),s===0){const o=g.node().getBBox();s+=o.height}n+=s,g.attr("x",i+t().state.noteMargin),g.attr("y",d+n+1.25*t().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:n}},"_drawLongText"),K=f((e,i)=>{i.attr("class","state-note");const d=i.append("rect").attr("x",0).attr("y",t().state.padding),c=i.append("g"),{textWidth:n,textHeight:l}=j(e,0,0,c);return d.attr("height",l+2*t().state.noteMargin),d.attr("width",n+t().state.noteMargin*2),d},"drawNote"),L=f(function(e,i){const d=i.id,c={id:d,label:i.id,width:0,height:0},n=e.append("g").attr("id",d).attr("class","stateGroup");i.type==="start"&&X(n),i.type==="end"&&q(n),(i.type==="fork"||i.type==="join")&&Z(n,i),i.type==="note"&&K(i.note.text,n),i.type==="divider"&&Y(n),i.type==="default"&&i.descriptions.length===0&&D(n,i),i.type==="default"&&i.descriptions.length>0&&I(n,i);const l=n.node().getBBox();return c.width=l.width+2*t().state.padding,c.height=l.height+2*t().state.padding,c},"drawState"),G=0,Q=f(function(e,i,d){const c=f(function(s){switch(s){case N.relationType.AGGREGATION:return"aggregation";case N.relationType.EXTENSION:return"extension";case N.relationType.COMPOSITION:return"composition";case N.relationType.DEPENDENCY:return"dependency"}},"getRelationType");i.points=i.points.filter(s=>!Number.isNaN(s.y));const n=i.points,l=U().x(function(s){return s.x}).y(function(s){return s.y}).curve(_),p=e.append("path").attr("d",l(n)).attr("id","edge"+G).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=C(!0)),p.attr("marker-end","url("+a+"#"+c(N.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const s=e.append("g").attr("class","stateLabel"),{x:m,y:x}=F.calcLabelPosition(i.points),g=z.getRows(d.title);let o=0;const B=[];let y=0,v=0;for(let u=0;u<=g.length;u++){const h=s.append("text").attr("text-anchor","middle").text(g[u]).attr("x",m).attr("y",x+o),w=h.node().getBBox();y=Math.max(y,w.width),v=Math.min(v,w.x),S.info(w.x,m,x+o),o===0&&(o=h.node().getBBox().height,S.info("Title height",o,x)),B.push(h)}let k=o*g.length;if(g.length>1){const u=(g.length-1)*o*.5;B.forEach((h,w)=>h.attr("y",x+w*o-u)),k=o*g.length}const r=s.node().getBBox();s.insert("rect",":first-child").attr("class","box").attr("x",m-y/2-t().state.padding/2).attr("y",x-k/2-t().state.padding/2-3.5).attr("width",y+t().state.padding).attr("height",k+t().state.padding),S.info(r)}G++},"drawEdge"),b,T={},V=f(function(){},"setConf"),tt=f(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),et=f(function(e,i,d,c){b=t().state;const n=t().securityLevel;let l;n==="sandbox"&&(l=H("#i"+i));const p=n==="sandbox"?H(l.nodes()[0].contentDocument.body):H("body"),a=n==="sandbox"?l.nodes()[0].contentDocument:document;S.debug("Rendering diagram "+e);const s=p.select(`[id='${i}']`);tt(s);const m=c.db.getRootDoc(),x=s.append("g").attr("id",i+"-root");A(m,x,void 0,!1,p,a,c);const g=b.padding,o=s.node().getBBox(),B=o.width+g*2,y=o.height+g*2,v=B*1.75;P(s,y,v,b.useMaxWidth),s.attr("viewBox",`${o.x-b.padding} ${o.y-b.padding} `+B+" "+y)},"draw"),at=f(e=>e?e.length*b.fontSizeFactor:1,"getLabelWidth"),A=f((e,i,d,c,n,l,p)=>{const a=new O({compound:!0,multigraph:!0});let s,m=!0;for(s=0;s{const w=h.parentElement;let E=0,M=0;w&&(w.parentElement&&(E=w.parentElement.getBBox().width),M=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(M)&&(M=0)),h.setAttribute("x1",0-M+8),h.setAttribute("x2",E-M-8)})):S.debug("No Node "+r+": "+JSON.stringify(a.node(r)))});let v=y.getBBox();a.edges().forEach(function(r){r!==void 0&&a.edge(r)!==void 0&&(S.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(a.edge(r))),Q(i,a.edge(r),a.edge(r).relation))}),v=y.getBBox();const k={id:d||"root",label:d||"root",width:0,height:0};return k.width=v.width+2*b.padding,k.height=v.height+2*b.padding,S.debug("Doc rendered",k,a),k},"renderDoc"),it={setConf:V,draw:et},xt={parser:W,get db(){return new N(1)},renderer:it,styles:R,init:f(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{xt as diagram}; diff --git a/veadk/webui/assets/visualizations/mermaid/stateDiagram-v2-UEYNNEHI-CBC6HwPm.js b/veadk/webui/assets/visualizations/mermaid/stateDiagram-v2-UEYNNEHI-CBC6HwPm.js deleted file mode 100644 index e8bd08549..000000000 --- a/veadk/webui/assets/visualizations/mermaid/stateDiagram-v2-UEYNNEHI-CBC6HwPm.js +++ /dev/null @@ -1 +0,0 @@ -import{b as r,a as e,s as a,S as s}from"./chunk-5RXB4S5H-CY1YEJD3.js";import{a as i}from"./mermaid.core-y4TF8bTw.js";import"../../app/index-BNPwMQXG.js";import"./chunk-XXDRQBXY-B8qTF1qQ.js";import"./chunk-KBJHAD2P-DtNDDRN1.js";import"./chunk-2GRJ4B5K-CvII-2ZL.js";import"../../chunks/purify.es-BnINGy_Y.js";var n={parser:a,get db(){return new s(2)},renderer:e,styles:r,init:i(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{n as diagram}; diff --git a/veadk/webui/assets/visualizations/mermaid/stateDiagram-v2-UEYNNEHI-QJ3-Svac.js b/veadk/webui/assets/visualizations/mermaid/stateDiagram-v2-UEYNNEHI-QJ3-Svac.js new file mode 100644 index 000000000..17614aed4 --- /dev/null +++ b/veadk/webui/assets/visualizations/mermaid/stateDiagram-v2-UEYNNEHI-QJ3-Svac.js @@ -0,0 +1 @@ +import{b as r,a as e,s as a,S as s}from"./chunk-5RXB4S5H-Ln4IekMd.js";import{a as i}from"./mermaid.core-DAx4nvmm.js";import"../../app/index-8JtvDNuA.js";import"./chunk-XXDRQBXY-BdI3VXTi.js";import"./chunk-KBJHAD2P-C0rklDe7.js";import"./chunk-2GRJ4B5K-BNT0kar4.js";import"../../chunks/purify.es-BnINGy_Y.js";var n={parser:a,get db(){return new s(2)},renderer:e,styles:r,init:i(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{n as diagram}; diff --git a/veadk/webui/assets/visualizations/mermaid/swimlanes-SLNWSIFB-DEO6uzPS.js b/veadk/webui/assets/visualizations/mermaid/swimlanes-SLNWSIFB-2I6D1dR6.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/swimlanes-SLNWSIFB-DEO6uzPS.js rename to veadk/webui/assets/visualizations/mermaid/swimlanes-SLNWSIFB-2I6D1dR6.js index 6b2306882..609b6ac80 100644 --- a/veadk/webui/assets/visualizations/mermaid/swimlanes-SLNWSIFB-DEO6uzPS.js +++ b/veadk/webui/assets/visualizations/mermaid/swimlanes-SLNWSIFB-2I6D1dR6.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/visualizations/mermaid/sizeCapture-X5ZJPWSS-DguhcNs8.js","assets/visualizations/mermaid/mermaid.core-y4TF8bTw.js","assets/app/index-BNPwMQXG.js","assets/styles/index-_lutWX9f.css","assets/chunks/purify.es-BnINGy_Y.js"])))=>i.map(i=>d[i]); -import{_ as Rr}from"../../app/index-BNPwMQXG.js";import{c as Nr}from"./chunk-RYQCIY6F-DL3iLUXF.js";import{aw as Or,v as Pr,t as Br,u as kr,at as Qe,Y as _r,ag as Fr,ad as Dr,aG as Hr,ae as Xr,af as Yr,X as Gr,a6 as $r,P as zr,b9 as _e,b2 as Ve,a as d,av as Po}from"./mermaid.core-y4TF8bTw.js";import{G as Vr}from"../../chunks/graph-Dqkl27Ch.js";import"../../chunks/map-8WAJQ6ap.js";import"../../chunks/purify.es-BnINGy_Y.js";async function Xo(t,e){const n=new Vr({multigraph:!0,compound:!0}),o=[...e.edges],s=_r(),r=t.insert("g").attr("class","root"),i=r.insert("g").attr("class","clusters"),a=r.insert("g").attr("class","edges edgePath"),c=r.insert("g").attr("class","edgeLabels"),f=r.insert("g").attr("class","nodes"),g=new Map,p=t.node()!=null;await Promise.all(e.nodes.map(async M=>{var u;if(M.isGroup)n.setNode(M.id,{...M});else{if(p){const h=await Fr(f,M,{config:s,dir:M.dir}),l=((u=h.node())==null?void 0:u.getBBox())??{width:0,height:0};g.set(M.id,h),M.width=l.width,M.height=l.height}n.setNode(M.id,{...M})}}));for(const M of o)n.setEdge(M.start,M.end,{...M},M.id),e.edges.some(h=>h.id===M.id)||e.edges.push(M);if(globalThis.mermaidCaptureSizes){const{captureNodeSizes:M}=await Rr(async()=>{const{captureNodeSizes:u}=await import("./sizeCapture-X5ZJPWSS-DguhcNs8.js");return{captureNodeSizes:u}},__vite__mapDeps([0,1,2,3,4]));M(t,e)}return{graph:n,groups:{clusters:i,edgePaths:a,edgeLabels:c,nodes:f,rootGroups:r},nodeElements:g}}d(Xo,"createGraphWithElements");var Bo=5,je=1e-5,Ue=1e-6;function tn(t){const e=[];for(let n=0;n=1-Ue||M<=Ue||M>=1-Ue?null:{point:{x:t.x+p*s,y:t.y+p*r},tA:p,tB:M}}d(Yo,"segmentIntersection");function wn(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}d(wn,"isHorizontalSeg");function Go(t){const e=[];for(let n=0;n=Math.abs(n)?e>=0?1:0:n>=0?1:0}d($o,"getArcSweepFlag");var jr=.001;function zo(t,e){if(t.length<2)return t.map(r=>({...r}));const n=t.map(r=>({...r})),o=e.arrowTypeStart&&Po[e.arrowTypeStart];if(o){const r=t[0],i=t[1],a=Math.atan2(i.y-r.y,i.x-r.x);n[0].x=r.x+o*Math.cos(a),n[0].y=r.y+o*Math.sin(a)}const s=e.arrowTypeEnd&&Po[e.arrowTypeEnd];if(s){const r=t.length,i=t[r-2],a=t[r-1],c=Math.atan2(a.y-i.y,a.x-i.x);n[r-1].x=a.x-s*Math.cos(c),n[r-1].y=a.y-s*Math.sin(c)}return n}d(zo,"applyMarkerOffsets");function Vo(t,e,n,o,s){const r=t.point.x,i=t.point.y,a={x:r-e*t.r,y:i-n*t.r},c={x:r+e*t.r,y:i+n*t.r},f=[`L${Oe(a)}`];return s==="arc"?f.push(`A${le(t.r)},${le(t.r)} 0 0 ${o} ${Oe(c)}`):f.push(`M${Oe(c)}`),f}d(Vo,"emitJump");function An(t,e,n,o){const s=e.x-t.x,r=e.y-t.y,i=n.x-e.x,a=n.y-e.y,c=Math.hypot(s,r),f=Math.hypot(i,a);if(c0){const v=An(s[f-1],s[f],s[f+1]??s[f],Bo);v&&(l=v.cutLen)}let x=p,C=null;r&&fv.t-L.t);for(const v of b)v.r=Math.min(v.r,v.d-l,x-v.d);for(let v=0;vL){const y=L/2;b[v].r=Math.min(b[v].r,y),b[v+1].r=Math.min(b[v+1].r,y)}}for(const v of b)v.r=2?o:null}catch{return null}}d(Ko,"decodeDataPoints");function qo(t,e,n){if(!n.enabled)return;const o=t.node();if(!o)return;const s=new Map;for(const f of e)s.set(f.id,f);const r=[],i=new Map;for(const f of e){const g=typeof CSS<"u"&&CSS.escape?CSS.escape(f.id):f.id,p=o.querySelector(`path[data-id="${g}"]`);if(!p)continue;i.set(f.id,p);const u=Ko(p.getAttribute("data-points"))??f.points;r.push({...f,points:u})}const a=Go(r);if(a.length===0)return;const c=new Map;for(const f of a){const g=c.get(f.jumpEdgeId)??[];g.push(f),c.set(f.jumpEdgeId,g)}for(const f of r){const g=c.get(f.id);if(!g||g.length===0)continue;const p=s.get(f.id),M=p==null?void 0:p.curve;if(M!==void 0&&!Wo(M))continue;const u=i.get(f.id);if(!u)continue;if(M===void 0){const v=u.getAttribute("d")??"";if(!Uo(v))continue}const h=u.getAttribute("style")??"",l=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(h),x=l?Number.parseFloat(l[1]):null,C=l?Number.parseFloat(l[2]):null,b=jo(f,g,n);if(u.setAttribute("d",b),x!==null&&C!==null&&typeof u.getTotalLength=="function"){const v=u.getTotalLength(),L=Math.max(0,v-x-C),y=`0 ${x} ${L} ${C}`,I=h.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${y};`).replace(/;\s*;+/g,";");u.setAttribute("style",I)}}}d(qo,"applyLineJumpsToSvg");async function Jo(t,e){var s,r;for(const i of t.nodes)i.isGroup?await Dr(e.clusters,i):Hr(i);const n=new Map;for(const i of t.nodes)i!=null&&i.id&&n.set(i.id,i);for(const i of t.edges){const a=i.start?n.get(i.start)??{}:{},c=i.end?n.get(i.end)??{}:{},f=Xr(e.edgePaths,{...i},{},t.type,a,c,t.diagramId);i.label&&await Yr(e.rootGroups,i),i.label&&Zo(i,f)}const o=(r=(s=t.config)==null?void 0:s.swimlane)==null?void 0:r.lineHops;if(o!==!1){const i=o==="gap"?"gap":"arc",a=t.edges.filter(c=>Array.isArray(c.points)&&c.points.length>=2).map(c=>({id:c.id,points:c.points,curve:c.curve,arrowTypeStart:c.arrowTypeStart,arrowTypeEnd:c.arrowTypeEnd}));qo(e.edgePaths,a,{enabled:!0,jumpRadius:6,jumpStyle:i})}}d(Jo,"adjustLayout");function Zo(t,e){const n=(e==null?void 0:e.updatedPath)??(e==null?void 0:e.originalPath),o=Gr(),{subGraphTitleTotalMargin:s}=$r({flowchart:o.flowchart??{}});if(t.label){const r=zr.get(t.id);let i=t.x,a=t.y;if(n){const c=_e.calcLabelPosition(n);Qe.debug("Moving label "+t.label+" from (",i,",",a,") to (",c.x,",",c.y,") abc88"),e&&(i=c.x,a=c.y)}r.attr("transform",`translate(${i}, ${a+s/2})`)}if(t!=null&&t.startLabelLeft){const r=Ve.get(t.id).startLeft;let i=t==null?void 0:t.x,a=t==null?void 0:t.y;if(n){const c=_e.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",n);i=c.x,a=c.y}r.attr("transform",`translate(${i}, ${a})`)}if(t.startLabelRight){const r=Ve.get(t.id).startRight;let i=t.x,a=t.y;if(n){const c=_e.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",n);i=c.x,a=c.y}r.attr("transform",`translate(${i}, ${a})`)}if(t.endLabelLeft){const r=Ve.get(t.id).endLeft;let i=t.x,a=t.y;if(n){const c=_e.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",n);i=c.x,a=c.y}r.attr("transform",`translate(${i}, ${a})`)}if(t.endLabelRight){const r=Ve.get(t.id).endRight;let i=t.x,a=t.y;if(n){const c=_e.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",n);i=c.x,a=c.y}r.attr("transform",`translate(${i}, ${a})`)}}d(Zo,"positionEdgeLabel");var vn="__swimlane_default__",Ur=21,ko=20;function Rn(t){return Math.max(t.padding??ko,ko)}d(Rn,"topLaneHorizontalPadding");function Qo(t){const{x:e,y:n,width:o,height:s}=t,r=t.swimlaneContentTop;if(typeof e!="number"||typeof n!="number"||typeof o!="number"||typeof s!="number"||typeof r!="number"||!Number.isFinite(e)||!Number.isFinite(n)||!Number.isFinite(o)||!Number.isFinite(s)||!Number.isFinite(r)||o<=0||s<=0){delete t.groupTitleRect;return}const i=n-s/2,a=Math.min(r,n+s/2),c=Math.min(Ur,Math.max(0,a-i)),f=i+c;if(f<=i){delete t.groupTitleRect;return}t.groupTitleRect={left:e-o/2,right:e+o/2,top:i,bottom:f}}d(Qo,"assignTopLaneTitleRect");function ts(t){const e=t.direction,n=t.nodes??(t.nodes=[]);for(const r of t.nodes??[])r.isGroup&&!r.parentId&&(r.shape="swimlane",e&&(r.direction=e));const o=n.filter(r=>!r.isGroup&&!r.parentId);if(o.length===0)return;let s=n.find(r=>r.id===vn);s?s.isGroup&&(s.shape="swimlane",e&&(s.direction=e)):(s={id:vn,label:"",isGroup:!0,shape:"swimlane",padding:20,...e?{direction:e}:{}},n.push(s));for(const r of o)r.parentId=vn}d(ts,"prepareLayoutForSwimlanes");function es(t){const e=new Map;for(const c of t.nodes??[])e.set(c.id,c);const n=[];for(const c of t.edges??[]){const f=typeof c.start=="string"?c.start:void 0,g=typeof c.end=="string"?c.end:void 0;!f||!g||c.labelNodeId||n.push({id:c.id,src:f,dst:g,ref:c})}const o=t.nodes??[],s=o.filter(c=>c.isGroup),r=o.filter(c=>!c.isGroup);return{nodes:[...[...s].reverse(),...r].map(c=>c.id),edges:n,layout:t,nodeById:e}}d(es,"toGraphView");function ns(t,e,n,o){const{layout:s}=t,r=t.nodeById,i=(o==null?void 0:o.layerGap)??100,a=(o==null?void 0:o.nodeGap)??40;let c=0;for(const M of e.layers){let u=0;for(const h of M){const l=r.get(h);if(!l){u++;continue}l.layer=c,l.order=u;const x=n.x[h]??u*a,C=n.y[h]??c*i;l.x=x,l.y=C,u++}c++}const f=s.nodes??[],g=new Map,p=[];for(const M of f){if(!(M!=null&&M.isGroup))continue;M.parentId||p.push(M);const u=f.filter(b=>b.parentId===M.id);let h=1/0,l=-1/0,x=1/0,C=-1/0;for(const b of u){const v=b.x??n.x[b.id],L=b.y??n.y[b.id],y=b.width??0,I=b.height??0;v!=null&&L!=null&&(h=Math.min(h,v-y/2),l=Math.max(l,v+y/2),x=Math.min(x,L-I/2),C=Math.max(C,L+I/2))}if(h===1/0||x===1/0)M.x=M.x??0,M.y=M.y??0,M.width=M.width??0,M.height=M.height??0;else{const b=M.padding??20,v=M.parentId?b:2*Rn(M),L=b,y=Math.max(0,l-h)+v,I=Math.max(0,C-x)+L,E=(h+l)/2,A=(x+C)/2;M.x=E,M.y=A,M.width=y,M.height=I,g.set(M.id,{minX:h,maxX:l,minY:x,maxY:C})}}if(p.length>0&&g.size>0){let M=1/0,u=-1/0,h=0;for(const l of p){const x=l.padding??20;x>h&&(h=x);const C=g.get(l.id);C&&(M=Math.min(M,C.minY),u=Math.max(u,C.maxY))}if(M!==1/0&&u!==-1/0){const l=Math.max(0,u-M),C=Math.max(h,36),b=l+2*C,v=(M+u)/2;for(const B of p)B.y=v,B.height=b,B.swimlaneContentTop=M;const L=[...p].sort((B,O)=>{const k=B.x??0,H=O.x??0;return k-H}),y=[],I=[],E=[];for(const B of L){const O=g.get(B.id);if(!O)continue;const k=Math.max(0,O.maxX-O.minX)+2*Rn(B),H=(O.minX+O.maxX)/2;y.push(B.id),I.push(H),E.push(k)}const A=y.length;if(A>0){const B=new Map;if(A===1)B.set(y[0],E[0]);else{const O=[];for(let j=0;j0&&s>0?{cx:e,cy:n,rect:Pe(e,n,o,s)}:void 0}d(co,"measuredNodeRect");function ao(t){if(t.isGroup)return;const e=co(t);return e?{id:String(t.id??""),cx:e.cx,cy:e.cy,rect:e.rect}:void 0}d(ao,"nodeBoundsInfoFor");function ce(t,e,n=Yt){return Math.abs(t.x-e.x)n}d(Nt,"isHorizontalSegment");function Ot(t,e,n=Yt){return gt(t,e,n)&&Math.abs(t.y-e.y)>n}d(Ot,"isVerticalSegment");function Wt(t,e,n,o){return Math.max(0,Math.min(Math.max(t,e),Math.max(n,o))-Math.max(Math.min(t,e),Math.min(n,o)))}d(Wt,"overlapLength");function de(t,e,n=Yt){return t.horizontal&&e.horizontal&&yt(t.a,e.a,n)?Wt(t.a.x,t.b.x,e.a.x,e.b.x):t.vertical&&e.vertical&>(t.a,e.a,n)?Wt(t.a.y,t.b.y,e.a.y,e.b.y):0}d(de,"sameAxisSegmentOverlapLength");function Be(t,e=Yt){const n=[];for(let o=0;o0?n[n.length-1]:void 0;(!s||!ce(s,o,e))&&n.push({x:o.x,y:o.y})}return n}d(xt,"dedupeConsecutivePoints");function lo(t,e=Yt){if(!t||t.length!==4)return;const[n,o,s,r]=t;return Nt(n,o,e)&&Ot(o,s,e)&&Nt(s,r,e)?{kind:"HVH",p0:n,p1:o,p2:s,p3:r}:Ot(n,o,e)&&Nt(o,s,e)&&Ot(s,r,e)?{kind:"VHV",p0:n,p1:o,p2:s,p3:r}:void 0}d(lo,"classifyThreeSegmentRoute");function dn(t,e,n,o=0){const s=Math.min(t.x,e.x),r=Math.max(t.x,e.x),i=Math.min(t.y,e.y),a=Math.max(t.y,e.y);return r>n.left-o&&sn.top-o&&ie.left+n&&t.xe.top+n&&t.y=e.right&&t.top<=e.top&&t.bottom>=e.bottom}d(ss,"rectContainsRect");function en(t,e){return t.lefte.left&&t.tope.top}d(en,"rectsOverlap");function Nn(t,e){return{left:t.left-e,right:t.right+e,top:t.top-e,bottom:t.bottom+e}}d(Nn,"inflateRect");function Pe(t,e,n,o){return{left:t-n/2,right:t+n/2,top:e-o/2,bottom:e+o/2}}d(Pe,"rectFromCenterSize");function te(t){var e;return(e=co(t))==null?void 0:e.rect}d(te,"rectOfNodeBounds");function Le(t,e){switch(e){case"top":return{x:t.cx,y:t.rect.top};case"bottom":return{x:t.cx,y:t.rect.bottom};case"left":return{x:t.rect.left,y:t.cy};case"right":return{x:t.rect.right,y:t.cy}}}d(Le,"portForRectSide");function uo(t,e,n,o,s,r=Yt){const i=e==="left"||e==="right",a=o==="left"||o==="right";if(i&&a){if(e==="right"&&o==="left"&&t.xn.x){if(yt(t,n,r))return[t,n];const p=(t.x+n.x)/2;return[t,{x:p,y:t.y},{x:p,y:n.y},n]}if(e===o){if(yt(t,n,r))return;const p=e==="left"?Math.min(t.x,n.x)-s:Math.max(t.x,n.x)+s;return[t,{x:p,y:t.y},{x:p,y:n.y},n]}return}if(!i&&!a){if(e===o){if(gt(t,n,r))return;const M=e==="top"?Math.min(t.y,n.y)-s:Math.max(t.y,n.y)+s;return[t,{x:t.x,y:M},{x:n.x,y:M},n]}if(!(e==="bottom"&&o==="top"&&t.yn.y))return;if(gt(t,n,r))return[t,n];const p=(t.y+n.y)/2;return[t,{x:t.x,y:p},{x:n.x,y:p},n]}if(i&&!a){const g=e==="right"&&n.x>t.x||e==="left"&&n.xn.y;return g&&p?[t,{x:n.x,y:t.y},n]:void 0}const c=e==="bottom"&&n.y>t.y||e==="top"&&n.yn.x;return c&&f?[t,{x:t.x,y:n.y},n]:void 0}d(uo,"buildOrthogonalPortPath");function ho(t,e,n,o){return e==="left"||e==="right"?[t,{x:o,y:t.y},{x:o,y:n.y},n]:[t,{x:t.x,y:o},{x:n.x,y:o},n]}d(ho,"buildSameSideTrackPath");function un(t){const e=new Map,n=[];for(const o of t){if(o.isEdgeLabel)continue;const s=ao(o);s&&(e.set(s.id,s),n.push({id:s.id,rect:s.rect}))}return{nodeInfoById:e,realNodeRects:n}}d(un,"collectRealNodeBounds");function Me(t){const e=[],n=[];for(const o of t){const s=ao(o);if(!s)continue;const r={id:s.id,rect:s.rect};o.isEdgeLabel?n.push(r):e.push(r)}return{realNodeRects:e,labelNodeRects:n}}d(Me,"collectNodeRectEntries");function rs(t,{includeEdgeLabels:e=!0}={}){const n=[];for(const o of t){if(o.isGroup||!e&&o.isEdgeLabel)continue;const s=o.x??0,r=o.y??0,i=o.width??0,a=o.height??0;n.push({nodeId:o.id,...Pe(s,r,i,a)})}return n}d(rs,"collectLayoutNodeRects");function go(t,e,n=Yt){const o=t.start,s=t.end;if(!o||!s)return;const r=e.get(o),i=e.get(s);if(!(!r||!i))return{srcId:o,dstId:s,srcInfo:r,dstInfo:i,collinearX:Math.abs(r.cx-i.cx)h||MC)return!1;const b=Math.abs(l-g.a.x)s:r&&a&&yt(t,n,s)?Wt(t.x,e.x,n.x,o.x)>s:!1}d(is,"sameAxisSegmentsOverlap");function nn(t,e,n,o,{epsilon:s=Yt,skipDegenerateOther:r=!1}={}){for(const i of n){if(i===o||i.isLayoutOnly)continue;const a=i.points;if(!(!a||a.length<2))for(let c=0;cM+s&&hl+s&&po+Yt&&t=2?e[e.length-2]:void 0,c=(i?gt(i,s):!1)?{x:s.x,y:r.y}:{x:r.x,y:s.y};e.push(c)}e.push(r)}const n=[];for(const o of e){const s=n[n.length-1];(!s||!ce(s,o))&&n.push(o)}return n}d(on,"orthogonalizePolyline");function ue(t){if(t.length<3)return t;let e=[...t];for(let n=0;n<32;n++){const o=as(e);if(e=o.points,!o.changed)break}return e}d(ue,"simplifyPolyline");var it=.001,Kr=.5,_o=4;function yo(t,e,n){const o=t;if(o.isLayoutOnly||!o.points||o.points.length=0&&s=t.length)return t;const r=s-o;if(r<0||r>=t.length)return t;const i=ls(t[s],t[r],e);return n?[i,...t.slice(s)]:[...t.slice(0,s+1),i]}d(Pn,"clipEndpoint");function fs(t,e){for(const n of t){const o=yo(n,e,2);if(!o)continue;let s=[...o.points];o.srcRect&&(s=Pn(s,o.srcRect,!0)),o.dstRect&&(s=Pn(s,o.dstRect,!1)),s=ue(on(s)),s=po(s,o.srcRect,o.dstRect),o.edge.points=ue(on(s))}}d(fs,"clipEdgeEndpointsToNodeBoundaries");function Bn(t,e,n,o=!1){if(yt(t,e,it)){if(e.yn.bottom+it)return e;if(o){if(t.xn.right+it)return{x:n.right,y:t.y}}return{x:Math.abs(e.x-n.left)<=Math.abs(e.x-n.right)?n.left:n.right,y:t.y}}if(gt(t,e,it)){if(e.xn.right+it)return e;if(o){if(t.yn.bottom+it)return{x:t.x,y:n.bottom}}const s=Math.abs(e.y-n.top)<=Math.abs(e.y-n.bottom);return{x:t.x,y:s?n.top:n.bottom}}return e}d(Bn,"snapEndpointToBoundary");function sn(t,e,n){const o=t[e];for(let s=e+n;s>=0&&so.lo)),n=Math.min(...t.map(o=>o.hi));if(!(e>n))return{lo:e,hi:n}}d(ds,"intersectRanges");function _n(t,e){return e==="left"||e==="right"?rn(t.top,t.bottom):rn(t.left,t.right)}d(_n,"clearanceRangeForSide");function cn(t,e,n){const o=t.y>=n.top-it&&t.y<=n.bottom+it,s=t.x>=n.left-it&&t.x<=n.right+it;if(yt(t,e,it)&&o){if(Math.abs(t.x-n.left)0?ds(r):void 0}d(us,"straightClearanceRange");function Fn(t,e,n,o,s){const r=us(t,e,n,o,s);if(!r)return;const i=s?t.y:t.x,a=Math.min(r.hi,Math.max(r.lo,i));if(!(Math.abs(a-i)({...a}));for(let a=e;a>=0&&a=n.left-it&&Math.max(t.x,e.x)<=n.right+it,s=Math.min(t.y,e.y)>=n.top-it&&Math.max(t.y,e.y)<=n.bottom+it;if(Math.abs(t.y-n.top)o.bottom+it;case"left":return yt(e,n,it)&&n.xo.right+it}}d(Xn,"leavesOutward");function Yn(t,e,n){if(t.length<3)return t;if(n){const r=Hn(t[0],t[1],e);return r&&Xn(r,t[1],t[2],e)?t.slice(1):t}const o=t.length-1,s=Hn(t[o-1],t[o],e);return s&&Xn(s,t[o-1],t[o-2],e)?t.slice(0,o):t}d(Yn,"collapseOwnBorderStub");function ms(t,e,n){let o=t;if(e){const r=sn(o,0,1);if(r){const i=Bn(r,o[0],e);i!==o[0]&&(o=[i,...o.slice(1)])}o=Yn(o,e,!0)}if(n){const r=o.length-1,i=sn(o,r,-1);if(i){const a=Bn(i,o[r],n,!0);a!==o[r]&&(o=[...o.slice(0,r),a])}o=Yn(o,n,!1)}const s=po(o,e,n);return s!==o||o.length===2?s:(e&&(o=Dn(o,e,!0)),n&&(o=Dn(o,n,!1)),o)}d(ms,"snapAndCollapseEndpoints");function Gn(t,e){for(const n of t){const o=yo(n,e,2);if(!o)continue;const s=xt(o.points,it),r=ms(s,o.srcRect,o.dstRect);if(r.length<3){o.edge.points=r;continue}const i=[r[0],{...r[0]},...r.slice(1,-1),r[r.length-1],{...r[r.length-1]}];o.edge.points=i}}d(Gn,"prepareEdgeEndpointsForRenderer");function xo(t){return new Map(t.map(e=>[e.id,e]))}d(xo,"buildNodeMap");function ys(t,e){let n=t.parentId,o=null;for(;n;){const s=e.get(n);if(!(s!=null&&s.isGroup))break;o=s.id,n=s.parentId}return o}d(ys,"resolveTopLevelGroupId");function $n(t,e){let n=0,o=t.parentId;for(;o;){const s=e.get(o);if(!(s!=null&&s.isGroup))break;n++,o=s.parentId}return n}d($n,"groupDepth");function bo(t){let e=1/0,n=-1/0,o=1/0,s=-1/0;for(const r of t){const i=r.x,a=r.y;if(typeof i!="number"||typeof a!="number")continue;const c=r.width??0,f=r.height??0;e=Math.min(e,i-c/2),n=Math.max(n,i+c/2),o=Math.min(o,a-f/2),s=Math.max(s,a+f/2)}return e===1/0||o===1/0?null:{minX:e,maxX:n,minY:o,maxY:s}}d(bo,"boundsForChildren");function ps(t,e){const n=t.padding??20;t.x=(e.minX+e.maxX)/2,t.y=(e.minY+e.maxY)/2,t.width=Math.max(0,e.maxX-e.minX)+n,t.height=Math.max(0,e.maxY-e.minY)+n}d(ps,"applyGroupBounds");function xs(t){const e=xo(t),n=t.filter(o=>o.isGroup&&o.parentId).sort((o,s)=>$n(s,e)-$n(o,e));for(const o of n){const s=t.filter(i=>i.parentId===o.id),r=bo(s);r&&ps(o,r)}}d(xs,"recomputeNestedGroupBounds");function an(t,e){const n=t.nodes??[],o=t.edges??[],s=n.filter(c=>!c.isGroup);let r=1/0,i=-1/0;for(const c of s){const f=c[e];typeof f=="number"&&(r=Math.min(r,f),i=Math.max(i,f))}if(!Number.isFinite(r)||!Number.isFinite(i))return!1;const a=d(c=>r+i-c,"mirror");for(const c of n){const f=c[e];typeof f=="number"&&(c[e]=a(f));const g=c.groupTitleRect;g&&(c.groupTitleRect=e==="x"?{...g,left:a(g.right),right:a(g.left)}:{...g,top:a(g.bottom),bottom:a(g.top)})}for(const c of o)for(const f of c.points??[])f[e]=a(f[e]);return!0}d(an,"mirrorAxis");function bs(t){return(t.nodes??[]).some(n=>!n.isGroup)?an(t,"y"):!0}d(bs,"applyBtDirectionTransform");function Ms(t,e="LR"){const n=t.nodes??[],o=t.edges??[],s=n.filter(P=>!P.isGroup);let r=1/0,i=1/0;for(const P of s){const G=P.x??0,j=P.y??0;G0?Math.max(1,g/p):1;for(const P of s){const G=P.x??0,tt=((P.y??0)-i)*M+a,ft=G-r;P.x=tt,P.y=ft}for(const P of o)if(P.points)for(const G of P.points){const j=G.x,ft=(G.y-i)*M+a,Mt=j-r;G.x=ft,G.y=Mt}xs(n);const u=n.filter(P=>P.isGroup&&!P.parentId);if(u.length===0)return e==="RL"&&an(t,"x"),!0;const h=xo(n),l=new Map;for(const P of n){if(P.isGroup)continue;const G=ys(P,h);if(!G)continue;const j=l.get(G)??[];j.push(P),l.set(G,j)}let x=0;for(const P of u){const G=P.padding??0;G>x&&(x=G)}const C=[];let b=1/0,v=-1/0;for(const P of u){const G=l.get(P.id)??[],j=bo(G);j&&(b=Math.min(b,j.minX),v=Math.max(v,j.maxX),C.push({lane:P,contentTop:j.minY,contentBottom:j.maxY,centerY:(j.minY+j.maxY)/2}))}if(b===1/0||v===-1/0)return!0;const L=Math.max(0,v-b),y=Math.max(x,10),I=L+2*y,E=a+I,O=(b+v)/2-I/2-a,k=O+E/2,H=Math.max(x,a);C.sort((P,G)=>P.centerY-G.centerY);for(let P=0;PM.cy?C.bottom:C.top,H=M.cx+b;if(H<=C.left+ae||H>=C.right-ae)continue;v={x:H,y:k},L={x:H,y:a.y},y={x:a.x,y:a.y}}else{const k=u.cx>M.cx?C.right:C.left,H=M.cy+b;if(H<=C.top+ae||H>=C.bottom-ae)continue;v={x:k,y:H},L={x:a.x,y:H},y={x:a.x,y:a.y}}const I=ce(v,L,ae),E=ce(L,y,ae);if(I&&E||!I&&Pt(v,L,o,[g],1)||!E&&Pt(L,y,o,[p],1))continue;const A=!I&&nn(v,L,t,s,{epsilon:ae,skipDegenerateOther:!0}),B=!E&&nn(L,y,t,s,{epsilon:ae,skipDegenerateOther:!0});if(!(A||B)){I?x=[L,y]:E?x=[v,L]:x=[v,L,y];break}}x&&(s.points=x)}}d(Is,"portSwapToLShape");function Ss(t,e){const{realNodeRects:r,labelNodeRects:i}=Me(e.values());for(const a of t){if(a.isLayoutOnly)continue;const c=a.points;if(!c||c.length<4)continue;const f=xt(c,.001);if(f.length<4)continue;const g=f.length-1,p=f[g],M=f[g-1],u=f[g-2],h=p.x-M.x,l=p.y-M.y,x=Math.hypot(h,l);if(x>=10||x<.001)continue;const C=M.x-u.x,b=M.y-u.y;if(Math.hypot(C,b)<.001)continue;const L=Nt(M,p,.001),y=Ot(M,p,.001),I=Nt(u,M,.001),E=Ot(u,M,.001);if(!(L&&E||y&&I))continue;const A=a.end,B=a.start,O=A?e.get(A):void 0;if(!O)continue;const k=O.x??0,H=O.y??0,P=te(O);if(!P)continue;let G,j;if(E){const J=b<0;G={x:k,y:u.y},j={x:k,y:J?P.bottom:P.top}}else{const J=C>0;G={x:u.x,y:H},j={x:J?P.right:P.left,y:H}}if(Pt(G,j,r,A?[A]:[],-2)||Pt(G,j,i,[],-2))continue;if(B){const J=e.get(B),rt=J?te(J):void 0;if(rt&&fo(G,rt,2))continue}const tt=d((J,rt)=>`${J.x.toFixed(3)},${J.y.toFixed(3)}|${rt.x.toFixed(3)},${rt.y.toFixed(3)}`,"ownSegmentKey"),ft=new Set;for(let J=0;J{for(const ut of t){if(ut===a||ut.isLayoutOnly)continue;const pt=ut.points;if(!(!pt||pt.length<2))for(let St=0;St=0){const J=f[g-3],rt=[B,A].filter(ut=>!!ut);if(Pt(J,G,r,rt,-2)||Mt(J,G))continue}const Ft=[...f.slice(0,g-2),G,j];a.points=Ft;const nt=a.labelNodeId;if(nt){const J=e.get(nt);if(J){const rt=J.width??0,ut=J.height??0;if(rt>0&&ut>0){let pt,St,wt=-1;for(let Kt=0;Kt=rt+2||me&&se>=ut+2)&&se>wt&&(wt=se,pt=(qt.x+Jt.x)/2,St=(qt.y+Jt.y)/2)}pt!==void 0&&St!==void 0&&(J.x=pt,J.y=St)}}}}}d(Ss,"collapseShortTerminalStub");var et=.001,Xt=8,at=Be,Ln=d((t,e)=>gt(t,e,et)||yt(t,e,et),"orthogonallyAligned");function Cs(t,e){const s=d((u,h)=>{const l=u.x??0,x=u.y??0,C=h.x-l,b=h.y-x;let v=(u.width??0)/2,L=(u.height??0)/2;return Math.abs(b)*v>Math.abs(C)*L?(b<0&&(L=-L),{x:l+(b===0?0:L*C/b),y:x+L}):(C<0&&(v=-v),{x:l+v,y:x+(C===0?0:v*b/C)})},"rectIntersect"),r=d((u,h)=>{const l=xt(u.points??[]);if(l.length<2)return;const x=h?u.start:u.end,C=x?e.get(x):void 0,b=C?te(C):void 0;if(!C||!x||!b)return;const v=h?l[0]:l[l.length-1],L=h?l[1]:l[l.length-2],y=s(C,v);let I=v;if(Ln(L,y)&&(I=L),gt(y,I,et))return{edge:u,edgeId:String(u.id??""),nodeId:x,atStart:h,orientation:"V",coord:y.x,min:Math.min(y.y,I.y),max:Math.max(y.y,I.y),boundary:y,railEnd:I,rect:b};if(yt(y,I,et))return{edge:u,edgeId:String(u.id??""),nodeId:x,atStart:h,orientation:"H",coord:y.y,min:Math.min(y.x,I.x),max:Math.max(y.x,I.x),boundary:y,railEnd:I,rect:b}},"terminalLaneFor"),i=d((u,h)=>Math.max(0,Math.min(u.max,h.max)-Math.max(u.min,h.min)),"projectedOverlapLength"),a=d((u,h)=>u.nodeId!==h.nodeId||u.orientation!==h.orientation?!1:u.orientation==="H"?(Math.abs(u.boundary.x-u.rect.left)<1||Math.abs(u.boundary.x-u.rect.right)<1)&>(u.boundary,h.boundary,1):(Math.abs(u.boundary.y-u.rect.top)<1||Math.abs(u.boundary.y-u.rect.bottom)<1)&&yt(u.boundary,h.boundary,1),"sameTerminalFace"),c=d((u,h)=>u.nodeId!==h.nodeId||u.orientation!==h.orientation?!1:i(u,h)>=Xt&&Math.abs(u.coord-h.coord)<.5,"exactTerminalLaneConflict"),f=d((u,h)=>{if(u.nodeId!==h.nodeId||u.orientation!==h.orientation||u.orientation!=="H"||u.atStart===h.atStart)return!1;const l=i(u,h);if(l2*x?!1:a(u,h)&&Math.abs(u.coord-h.coord)<16},"nearTerminalLaneConflict"),g=d((u,h)=>{const l=xt(u.edge.points??[]);if(l.length<2)return;const x=u.orientation==="V"?{x:u.boundary.x+h,y:u.boundary.y}:{x:u.boundary.x,y:u.boundary.y+h},C=u.orientation==="V"?{x:u.railEnd.x+h,y:u.railEnd.y}:{x:u.railEnd.x,y:u.railEnd.y+h};if(!d(()=>Math.abs(u.boundary.y-u.rect.top)<1||Math.abs(u.boundary.y-u.rect.bottom)<1?yt(x,u.boundary,et)&&x.x>=u.rect.left+1&&x.x<=u.rect.right-1:Math.abs(u.boundary.x-u.rect.left)<1||Math.abs(u.boundary.x-u.rect.right)<1?gt(x,u.boundary,et)&&x.y>=u.rect.top+1&&x.y<=u.rect.bottom-1:!1,"boundaryStaysOnSameFace")())return;if(u.atStart){const I=l.length>1&&ce(l[1],u.railEnd,et),E=l.slice(I?2:1),A=E[0];return A&&!Ln(A,C)?void 0:[x,C,...E]}const v=l.length>1&&ce(l[l.length-2],u.railEnd,et),L=l.slice(0,v?-2:-1),y=L[L.length-1];if(!(y&&!Ln(y,C)))return[...L,C,x]},"shiftedCandidate"),p=d(u=>{const h=u.edge,l=xt(h.points??[]);if(l.length!==2)return!1;const x=h.start,C=h.end,b=x?e.get(x):void 0,v=C?e.get(C):void 0;if(!b||!v)return!1;const L=b.x??0,y=b.y??0,I=v.x??0,E=v.y??0,[A,B]=l;return yt(A,B,et)&&Math.abs(y-E)<1&&Math.abs(L-I)>1||gt(A,B,et)&&Math.abs(L-I)<1&&Math.abs(y-E)>1},"laneIsStraightCollinearConnector"),M=[-7,7,-2*7,2*7,-3*7,3*7];for(let u=0;u<8;u++){const h=t.filter(x=>!x.isLayoutOnly).flatMap(x=>[r(x,!0),r(x,!1)]).filter(x=>!!x);let l=!1;for(let x=0;x{const A=p(I),B=p(E);return A!==B?Number(A)-Number(B):+!E.atStart-+!I.atStart});for(const I of y){for(const E of M){const A=g(I,E);if(!A)continue;const B=r({...I.edge,points:A},I.atStart);if(!(!B||h.some(O=>O.edge!==I.edge&&(c(B,O)||L&&f(B,O))))){I.edge.points=A,l=!0;break}}if(l)break}}if(!l)return}}d(Cs,"separateSharedRenderedTerminalLanes");function vs(t,e){const{realNodeRects:o,labelNodeRects:s}=Me(e.values()),r=d((a,c)=>{const f=a.start,g=a.end,p=at(c);if(p.length!==c.length-1)return!1;const M=[f,g].filter(u=>!!u);for(const u of p)if(Pt(u.a,u.b,o,M,-2)||Pt(u.a,u.b,s,[],-2))return!1;for(const u of t){if(u===a||u.isLayoutOnly)continue;const h=u.points;if(!(!h||h.length<2)){for(const l of p)for(const x of at(xt(h)))if(de(l,x,.5)>=Xt||he(l.a,l.b,x.a,x.b,et))return!1}}return!0},"candidateIsSafe"),i=d((a,c)=>{if(c+4>=a.length)return;const f=a[c],g=a[c+1],p=a[c+2],M=a[c+3],u=a[c+4],h=Nt(f,g)&&Ot(g,p)&&Nt(p,M)&&Ot(M,u)&>(f,M,et)&>(f,u,et)&>(g,p,et)&&(g.x-f.x)*(M.x-p.x)<0,l=Ot(f,g)&&Nt(g,p)&&Ot(p,M)&&Nt(M,u)&&yt(f,M,et)&&yt(f,u,et)&&yt(g,p,et)&&(g.y-f.y)*(M.y-p.y)<0;if(h||l)return xt([...a.slice(0,c+1),u,...a.slice(c+5)]);if(c+5>=a.length)return;const x=a[c+5],C=Ot(f,g)&&Nt(g,p)&&Ot(p,M)&&Nt(M,u)&&Ot(u,x)&>(f,u,et)&>(f,x,et)&>(p,M,et)&&(p.x-g.x)*(u.x-M.x)<0,b=Nt(f,g)&&Ot(g,p)&&Nt(p,M)&&Ot(M,u)&&Nt(u,x)&&yt(f,u,et)&&yt(f,x,et)&&yt(p,M,et)&&(p.y-g.y)*(u.y-M.y)<0;if(!(!C&&!b))return xt([...a.slice(0,c+1),x,...a.slice(c+6)])},"withoutDogleg");for(let a=0;a<8;a++){let c=!1;for(const f of t){if(f.isLayoutOnly)continue;const g=xt(f.points??[]);for(let p=0;p<=g.length-5;p++){const M=i(g,p);if(!(!M||!r(f,M))){f.points=M,c=!0;break}}if(c)break}if(!c)return}}d(vs,"collapseRedundantRectangularDoglegs");function zn(t,e){const{realNodeRects:r,labelNodeRects:i}=Me(e.values()),a=t.filter(h=>!h.isLayoutOnly),c=d((h,l,x)=>xt(h===l?x??[]:h.points??[]),"pointsFor"),f=d((h,l)=>{let x=0;for(let C=0;C{const l=at(h);if(l.length!==3)return;const x=l[1];if(!(l[0].horizontal===x.horizontal||l[2].horizontal===x.horizontal))return{index:x.index,horizontal:x.horizontal,vertical:x.vertical,segment:x}},"middleRail"),p=d((h,l)=>{const x=[h.start,h.end].filter(C=>!!C);return r.filter(C=>{if(x.includes(C.id))return!1;const b=C.rect;return l.horizontal?Wt(l.a.x,l.b.x,b.left,b.right)>=Xt&&l.a.y>=b.top-2&&l.a.y<=b.bottom+2:Wt(l.a.y,l.b.y,b.top,b.bottom)>=Xt&&l.a.x>=b.left-2&&l.a.x<=b.right+2})},"blockingRectsFor"),M=d((h,l,x)=>{const C=h.map(v=>({...v}));if(l.horizontal)C[l.index].y=x,C[l.index+1].y=x;else if(l.vertical)C[l.index].x=x,C[l.index+1].x=x;else return;const b=ue(xt(C));return at(b).length===b.length-1?b:void 0},"candidateByMovingRail"),u=d((h,l,x)=>{const C=[h.start,h.end].filter(v=>!!v),b=at(l);if(b.length!==l.length-1)return!1;for(const v of b)if(Pt(v.a,v.b,r,C,-2)||Pt(v.a,v.b,i,[],-2))return!1;for(const v of a)if(v!==h){for(const L of b)for(const y of at(c(v)))if(de(L,y,.5)>=Xt)return!1}return f(h,l)<=x},"candidateIsSafe");for(let h=0;h<8;h++){const l=f();let x=!1;for(const C of a){const b=c(C),v=g(b);if(!v)continue;const L=p(C,v.segment);if(L.length===0)continue;const y=v.horizontal?[Math.min(...L.map(I=>I.rect.top))-20,Math.max(...L.map(I=>I.rect.bottom))+20]:[Math.min(...L.map(I=>I.rect.left))-20,Math.max(...L.map(I=>I.rect.right))+20];for(const I of y){const E=M(b,v.segment,I);if(!(!E||!u(C,E,l))){C.points=E,x=!0;break}}if(x)break}if(!x)return}}d(zn,"liftObstacleHuggingSameSideRails");function Vn(t,e){const o=d(c=>{const f=c.groupTitleRect;if(!(!f||typeof f.left!="number"||typeof f.right!="number"||typeof f.top!="number"||typeof f.bottom!="number"||!Number.isFinite(f.left)||!Number.isFinite(f.right)||!Number.isFinite(f.top)||!Number.isFinite(f.bottom)||f.right<=f.left||f.bottom<=f.top))return{left:f.left,right:f.right,top:f.top,bottom:f.bottom}},"validTitleRect"),s=d(c=>{if(!c.isGroup||c.parentId)return;const f=c.direction,g=typeof f=="string"?f.toUpperCase():"";if(g==="LR"||g==="RL"||g==="BT")return;const p=o(c),M=c.y,u=c.height;if(!p||typeof M!="number"||typeof u!="number"||!Number.isFinite(M)||!Number.isFinite(u)||u<=0)return;const h=p.right-p.left,l=p.bottom-p.top;if(!(l<=0||h{if(!c.horizontal)return!1;const g=c.a.y;return g<=f.top+et||g>=f.bottom-et?!1:Wt(c.a.x,c.b.x,f.left,f.right)>=Xt},"horizontalSegmentIntersectsTitle"),i=[...e.values()].map(s).filter(c=>!!c);if(i.length===0)return;let a=0;for(const c of t){if(c.isLayoutOnly)continue;const f=xt(c.points??[]);for(const g of at(f))for(const p of i)r(g,p.rect)&&(a=Math.max(a,p.rect.bottom-g.a.y+4))}if(!(a<=et))for(const c of i){const f=c.node.y,g=c.node.height;typeof f!="number"||typeof g!="number"||!Number.isFinite(f)||!Number.isFinite(g)||g<=0||(c.node.y=f-a/2,c.node.height=g+a,c.node.groupTitleRect={...c.rect,top:c.rect.top-a,bottom:c.rect.bottom-a})}}d(Vn,"liftTopLaneTitleBandsAboveRails");function jn(t,e){const o=d(f=>{const g=f.groupTitleRect;if(!(!g||typeof g.left!="number"||typeof g.right!="number"||typeof g.top!="number"||typeof g.bottom!="number"||!Number.isFinite(g.left)||!Number.isFinite(g.right)||!Number.isFinite(g.top)||!Number.isFinite(g.bottom)||g.right<=g.left||g.bottom<=g.top))return{left:g.left,right:g.right,top:g.top,bottom:g.bottom}},"validTitleRect"),s=d(f=>{if(!f.isGroup||f.parentId||f.direction!=="LR")return;const p=o(f),M=f.x,u=f.width;if(!p||typeof M!="number"||typeof u!="number"||!Number.isFinite(M)||!Number.isFinite(u)||u<=0)return;const h=p.right-p.left,l=p.bottom-p.top;if(!(h<=0||l{if(!f.vertical)return!1;const p=f.a.x;return p<=g.left+et||p>=g.right-et?!1:Wt(f.a.y,f.b.y,g.top,g.bottom)>=Xt},"verticalSegmentIntersectsTitle"),i=d((f,g)=>{if(!f.horizontal)return!1;const p=f.a.y;return p<=g.top+et||p>=g.bottom-et?!1:Wt(f.a.x,f.b.x,g.left,g.right)>=Xt},"horizontalSegmentIntersectsTitle"),a=[...e.values()].map(s).filter(f=>!!f);if(a.length===0)return;let c=0;for(const f of t){if(f.isLayoutOnly)continue;const g=xt(f.points??[]);for(const p of at(g))for(const M of a)if(r(p,M.rect))c=Math.max(c,M.rect.right-p.a.x+4);else if(i(p,M.rect)){const u=Math.min(p.a.x,p.b.x);c=Math.max(c,M.rect.right-u+4)}}if(!(c<=et))for(const f of a){const g=f.node.x,p=f.node.width;typeof g!="number"||typeof p!="number"||!Number.isFinite(g)||!Number.isFinite(p)||p<=0||(f.node.x=g-c/2,f.node.width=p+c,f.node.groupTitleRect={...f.rect,left:f.rect.left-c,right:f.rect.right-c})}}d(jn,"shiftLeftLaneTitleBandsLeftOfRails");function Ls(t,e){const{realNodeRects:o}=Me(e.values()),s=t.filter(h=>!h.isLayoutOnly),r=d((h,l=new Map)=>xt(l.get(h)??h.points??[]),"replacementPointsFor"),i=d((h=new Map)=>{let l=0;for(let x=0;xs.reduce((l,x)=>l+oe(r(x,h)),0),"totalBends"),c=d(h=>{const l=r(h);if(l.length<4)return;const x=l[l.length-2],C=l[l.length-1];if(!(!Nt(x,C,et)&&!Ot(x,C,et)))return{tailStart:x,terminal:C}},"terminalTailFor"),f=d((h,l)=>{const x=r(h);if(x.length<3)return;const C=x[0],b=x[1];let v;if(Nt(C,b,et))v={x:b.x,y:l.tailStart.y};else if(Ot(C,b,et))v={x:l.tailStart.x,y:b.y};else return;const L=ue(xt([C,b,v,l.tailStart,l.terminal]));return at(L).length===L.length-1?L:void 0},"candidateWithDestinationTail"),g=d((h,l)=>{const x=[h.start,h.end].filter(C=>!!C);for(const C of at(l))if(Pt(C.a,C.b,o,x,-2))return!0;return!1},"pathHasNodeHit"),p=d((h,l,x)=>{for(const C of s)if(C!==h){for(const b of at(l))for(const v of at(r(C,x)))if(de(b,v,.5)>=Xt)return!0}return!1},"pathHasSharedTrack"),M=d((h,l,x)=>!g(h,l)&&!p(h,l,x),"candidateIsSafe"),u=d(()=>{const h=new Map;for(const l of s){const x=l.end;if(!x||!e.has(x)||r(l).length<4)continue;const b=h.get(x)??[];b.push(l),h.set(x,b)}return h},"edgesByDestination");for(let h=0;h<4;h++){const l=i();if(l===0)return;const x=a();let C,b=l,v=x;for(const L of u().values())for(let y=0;y=l||G>b||G===b&&j>=v||(C=P,b=G,v=j)}if(!C)return;for(const[L,y]of C)L.points=y}}d(Ls,"swapDestinationTerminalTailsToReduceCrossings");function Es(t,e){const{realNodeRects:r,labelNodeRects:i}=Me(e.values()),a=t.filter(L=>!L.isLayoutOnly),c=d((L,y=new Map)=>xt(y.get(L)??L.points??[]),"replacementPointsFor"),f=d((L=new Map)=>{let y=0;for(let I=0;Ia.reduce((y,I)=>y+oe(c(I,L)),0),"totalBends"),p=d(L=>{const y=L.start,I=L.end,E=y?e.get(y):void 0,A=I?e.get(I):void 0,B=E?te(E):void 0,O=A?te(A):void 0;return B&&O?{src:B,dst:O}:void 0},"endpointRectsFor"),M=d((L,y,I)=>{if(I.index<=0||I.index+1>=y.length-1)return;const E=p(L);if(E){if(I.vertical){const A=I.a.x,B=Math.min(E.src.left,E.dst.left),O=Math.max(E.src.right,E.dst.right),k=AO+et?"right":void 0;return k?{edge:L,points:y,segmentIndex:I.index,axis:"vertical",side:k,coord:A,min:Math.min(I.a.y,I.b.y),max:Math.max(I.a.y,I.b.y)}:void 0}if(I.horizontal){const A=I.a.y,B=Math.min(E.src.top,E.dst.top),O=Math.max(E.src.bottom,E.dst.bottom),k=AO+et?"bottom":void 0;return k?{edge:L,points:y,segmentIndex:I.index,axis:"horizontal",side:k,coord:A,min:Math.min(I.a.x,I.b.x),max:Math.max(I.a.x,I.b.x)}:void 0}}},"externalRailForSegment"),u=d(()=>{const L=[];for(const y of a){const I=c(y);for(const E of at(I)){const A=M(y,I,E);A&&L.push(A)}}return L},"collectExternalRails"),h=d((L,y)=>L.edge!==y.edge&&L.axis===y.axis&&L.side===y.side&&Wt(L.min,L.max,y.min,y.max)>=Xt,"railsInteract"),l=d(L=>{const y=[],I=new Set;for(const E of L){if(I.has(E))continue;const A=[E],B=[];for(I.add(E);A.length>0;){const O=A.pop();B.push(O);for(const k of L)!I.has(k)&&h(O,k)&&(I.add(k),A.push(k))}B.length>1&&y.push(B)}return y},"connectedComponents"),x=d(L=>{const y=[];for(const I of L)y.some(E=>Math.abs(E-I.coord){const y=L.map(A=>A.coord),I=x(L),E=[];if(L.length<=6){const A=new Array(I.length).fill(!1),B=[],O=d(()=>{if(B.length===L.length){B.some((k,H)=>Math.abs(k-y[H])>=et)&&E.push([...B]);return}for(const[k,H]of I.entries())A[k]||(A[k]=!0,B.push(H),O(),B.pop(),A[k]=!1)},"visit");return O(),E}for(let A=0;A{const I=new Map;for(const[A,B]of L.entries()){const O=y[A],k=I.get(B.edge)??B.points.map(H=>({x:H.x,y:H.y}));B.axis==="vertical"?(k[B.segmentIndex].x=O,k[B.segmentIndex+1].x=O):(k[B.segmentIndex].y=O,k[B.segmentIndex+1].y=O),I.set(B.edge,k)}const E=new Map;for(const[A,B]of I){const O=ue(xt(B));if(at(O).length!==O.length-1)return;E.set(A,O)}return E},"replacementsForAssignment"),v=d(L=>{for(const[y,I]of L){const E=[y.start,y.end].filter(A=>!!A);for(const A of at(I))if(Pt(A.a,A.b,r,E,-2)||Pt(A.a,A.b,i,[],-2))return!1}for(let y=0;y=Xt)return!1}}return!0},"candidateIsSafe");for(let L=0;L<4;L++){const y=f();if(y===0)return;let I,E=y,A=g(),B=Number.POSITIVE_INFINITY;for(const O of l(u()))for(const k of C(O)){const H=b(O,k);if(!H||!v(H))continue;const P=f(H);if(P>=y)continue;const G=g(H),j=O.reduce((tt,ft,Mt)=>tt+Math.abs(k[Mt]-ft.coord),0);P>E||P===E&&(G>A||G===A&&j>=B)||(I=H,E=P,A=G,B=j)}if(!I)return;for(const[O,k]of I)O.points=k}}d(Es,"reassignCrossingExternalRailChannels");function Ts(t,e){const{realNodeRects:o,labelNodeRects:s}=Me(e.values()),r=t.filter(u=>!u.isLayoutOnly),i=d((u,h,l)=>xt(u===h?l??[]:u.points??[]),"pointsFor"),a=d(u=>at(u).reduce((h,l)=>{const x=l.a.x-l.b.x,C=l.a.y-l.b.y;return h+Math.hypot(x,C)},0),"pathLength"),c=d((u,h)=>{let l=0;for(let x=0;x{if(u.horizontal){const l=u.a.y;return(Math.abs(l-h.top)<1||Math.abs(l-h.bottom)<1)&&Wt(u.a.x,u.b.x,h.left,h.right)>=Xt}if(u.vertical){const l=u.a.x;return(Math.abs(l-h.left)<1||Math.abs(l-h.right)<1)&&Wt(u.a.y,u.b.y,h.top,h.bottom)>=Xt}return!1},"segmentRunsAlongRectBorder"),g=d(u=>{const h=[u.start,u.end].filter(x=>!!x),l=[];for(const x of h){const C=e.get(x),b=C?te(C):void 0;b&&l.push(b)}return l},"endpointRectsFor"),p=d((u,h)=>{if(h+3>=u.length)return[];const l=u[h],x=u[h+1],C=u[h+2],b=u[h+3],v=Nt(l,x,et)&&Ot(x,C,et)&&Nt(C,b,et),L=Ot(l,x,et)&&Nt(x,C,et)&&Ot(C,b,et);if(!v&&!L)return[];if(!(v?Math.sign(x.x-l.x)!==Math.sign(b.x-C.x):Math.sign(x.y-l.y)!==Math.sign(b.y-C.y)))return[];const I=gt(l,b,et)||yt(l,b,et)?[]:[{x:l.x,y:b.y},{x:b.x,y:l.y}],E=I.length===0?[[...u.slice(0,h+1),...u.slice(h+3)]]:I.map(B=>[...u.slice(0,h+1),B,...u.slice(h+3)]),A=new Set;return E.map(B=>ue(xt(B))).filter(B=>{if(at(B).length!==B.length-1||!B.some(k=>ce(k,b,et)))return!1;const O=B.map(k=>`${k.x.toFixed(3)},${k.y.toFixed(3)}`).join("|");return A.has(O)?!1:(A.add(O),!0)})},"shortcutCandidatesAt"),M=d((u,h,l)=>{const x=[u.start,u.end].filter(b=>!!b),C=g(u);for(const b of at(h))if(Pt(b.a,b.b,o,x,-2)||Pt(b.a,b.b,s,[],-2)||C.some(v=>f(b,v)))return!1;for(const b of r)if(b!==u){for(const v of at(h))for(const L of at(i(b)))if(de(v,L,.5)>=Xt)return!1}return c(u,h)<=l},"candidateIsSafe");for(let u=0;u<8;u++){const h=c();let l,x,C=h,b=Number.POSITIVE_INFINITY,v=Number.POSITIVE_INFINITY;for(const L of r){const y=i(L),I=oe(y,et),E=a(y);for(let A=0;A<=y.length-4;A++)for(const B of p(y,A)){const O=oe(B,et),k=a(B);if(!(OC||P===C&&(O>b||O===b&&k>=v)||(l=L,x=B,C=P,b=O,v=k)}}if(!l||!x)return;l.points=x}}d(Ts,"shortcutRedundantOrthogonalJogs");function ws(t,e){const i=[];for(const R of e.values()){if(R.isGroup||R.isEdgeLabel)continue;const _=R.x??0,F=R.y??0,V=te(R);V&&i.push({id:String(R.id??""),cx:_,cy:F,rect:V})}if(i.length===0)return;const a=new Map(i.map(R=>[R.id,R])),c=i.map(R=>({id:R.id,rect:R.rect})),f=["top","bottom","left","right"],g={top:Math.min(...i.map(R=>R.rect.top))-20,bottom:Math.max(...i.map(R=>R.rect.bottom))+20,left:Math.min(...i.map(R=>R.rect.left))-20,right:Math.max(...i.map(R=>R.rect.right))+20},p=t.filter(R=>!R.isLayoutOnly),M=new Map(p.map((R,_)=>[R,_])),u=d(R=>{const _=R==="left"||R==="top"?-1:1,F=[];for(let V=0;V<=2;V++)F.push(g[R]+_*20*V);return F},"outwardTracksForSide"),h=d((R,_=new Map)=>xt(_.get(R)??R.points??[]),"replacementPointsFor"),l=d((R,_)=>{let F=0;for(const V of R)for(const K of _)he(V.a,V.b,K.a,K.b,et)&&F++;return F},"crossingCountBetweenSegments"),x=d((R,_)=>l(at(R),at(_)),"crossingCountBetweenPaths"),C=d((R=new Map)=>{let _=0;const F=[],V=new Set,K=[],Z=d(Y=>{V.has(Y)||(V.add(Y),K.push(Y))},"addEdge");for(let Y=0;Y0&&(_+=T,F.push({first:q,second:w,count:T}),Z(q),Z(w))}}return K.sort((Y,q)=>(M.get(Y)??0)-(M.get(q)??0)),{count:_,pairs:F,edgeSet:V,edges:K}},"crossingSnapshot"),b=d((R,_)=>{const F=new Set(_.keys());if(F.size===0)return R.count;let V=0;for(const Z of R.pairs)(F.has(Z.first)||F.has(Z.second))&&(V+=Z.count);let K=0;for(let Z=0;Z{const _=new Map;for(const K of R.pairs){const Z=_.get(K.first)??new Set;Z.add(K.second),_.set(K.first,Z);const Y=_.get(K.second)??new Set;Y.add(K.first),_.set(K.second,Y)}const F=[],V=new Set;for(const K of R.edges){if(V.has(K))continue;const Z=[K],Y=[];for(V.add(K);Z.length>0;){const q=Z.pop();Y.push(q);for(const m of _.get(q)??[])V.has(m)||(V.add(m),Z.push(m))}Y.sort((q,m)=>(M.get(q)??0)-(M.get(m)??0)),Y.length>1&&F.push(Y)}return F},"crossingComponents"),L=d(R=>[R.start,R.end].filter(_=>!!_),"endpointIdsFor"),y=d(R=>{const _=[];for(const F of v(R)){const V=new Set(F),K=new Set(F.flatMap(Y=>L(Y))),Z=[...F];for(const Y of p)V.has(Y)||L(Y).some(q=>K.has(q))&&Z.push(Y);Z.sort((Y,q)=>(M.get(Y)??0)-(M.get(q)??0)),_.push(Z)}return _},"pairSearchGroups"),I=d((R,_,F)=>b(R,new Map([[_,F]])),"crossingCountWithSingleReplacement"),E=d(R=>{const _=new Map;for(const F of R.pairs)_.set(F.first,(_.get(F.first)??0)+F.count),_.set(F.second,(_.get(F.second)??0)+F.count);return _},"currentCrossingsByEdge"),A=d(R=>R.slice(1).reduce((_,F,V)=>{const K=R[V];return _+Math.abs(F.x-K.x)+Math.abs(F.y-K.y)},0),"pathLength"),B=d((R=new Map)=>p.reduce((_,F)=>_+oe(h(F,R)),0),"totalBends"),O=d((R=new Map)=>p.reduce((_,F)=>_+A(h(F,R)),0),"totalLength"),k=d((R,_,F=new Map)=>{const V=at(_);for(const K of p)if(K!==R){for(const Z of V)for(const Y of at(h(K,F)))if(de(Z,Y,.5)>=Xt)return!0}return!1},"pathHasSegmentConflict"),H=d((R,_)=>{const F=[R.start,R.end].filter(V=>!!V);for(const V of at(_))if(Pt(V.a,V.b,c,F,-2))return!0;return!1},"pathHitsNode"),P=d((R,_)=>{const F=ue(xt(_));at(F).length===F.length-1&&R.push(F)},"pushOrthogonalCandidate"),G=d(R=>R==="left"||R==="right","sideIsHorizontal"),j=d((R,_,F)=>{switch(_){case"left":return Math.min(R.x,F.x)-20;case"right":return Math.max(R.x,F.x)+20;case"top":return Math.min(R.y,F.y)-20;case"bottom":return Math.max(R.y,F.y)+20}},"localTrackForSameSide"),tt=d((R,_,F,V)=>{const K=F==="left"||F==="top"?-1:1,Z=[j(_,F,V),g[F]];for(const Y of Z)for(let q=0;q<=2;q++)P(R,ho(_,F,V,Y+K*20*q))},"addSameSideCandidates"),ft=d((R,_,F,V,K)=>{for(const Z of u(F))for(const Y of u(K))P(R,[_,{x:Z,y:_.y},{x:Z,y:Y},{x:V.x,y:Y},V])},"addHorizontalToVerticalCandidates"),Mt=d((R,_,F,V,K)=>{for(const Z of u(F))for(const Y of u(K))P(R,[_,{x:_.x,y:Z},{x:Y,y:Z},{x:Y,y:V.y},V])},"addVerticalToHorizontalCandidates"),Ht=d((R,_,F,V,K)=>{const Z=[...u("top"),...u("bottom")];for(const Y of u(F))for(const q of u(K))for(const m of Z)P(R,[_,{x:Y,y:_.y},{x:Y,y:m},{x:q,y:m},{x:q,y:V.y},V])},"addHorizontalPairCandidates"),Ft=d((R,_,F,V,K)=>{const Z=[...u("left"),...u("right")];for(const Y of u(F))for(const q of u(K))for(const m of Z)P(R,[_,{x:_.x,y:Y},{x:m,y:Y},{x:m,y:q},{x:V.x,y:q},V])},"addVerticalPairCandidates"),nt=d(R=>{const _=new Set;return R.map(F=>xt(F)).filter(F=>{const V=F.map(K=>`${K.x.toFixed(3)},${K.y.toFixed(3)}`).join("|");return _.has(V)||F.length<2?!1:(_.add(V),!0)})},"dedupeCandidatePaths"),J=d((R,_,F,V)=>{const K=[],Z=uo(R,_,F,V,20,et);Z&&P(K,Z),_===V&&tt(K,R,_,F);const Y=G(_),q=G(V);return Y&&!q?ft(K,R,_,F,V):!Y&&q?Mt(K,R,_,F,V):Y?Ht(K,R,_,F,V):Ft(K,R,_,F,V),nt(K)},"buildCandidatesForSides"),rt=d((R,_,F,V)=>{const K=[...u("left"),...u("right")],Z=[...u("top"),...u("bottom")];for(const Y of f){const q=Le(V,Y),m=Y==="top"||Y==="bottom"?u(Y):Z;for(const S of K){P(R,[_,F,{x:S,y:F.y},{x:S,y:q.y},q]);for(const w of m)P(R,[_,F,{x:S,y:F.y},{x:S,y:w},{x:q.x,y:w},q])}}},"addVerticalDepartureOuterTrackCandidates"),ut=d((R,_,F,V)=>{const K=[...u("left"),...u("right")],Z=[...u("top"),...u("bottom")];for(const Y of f){const q=Le(V,Y),m=Y==="left"||Y==="right"?u(Y):K;for(const S of Z){P(R,[_,F,{x:F.x,y:S},{x:q.x,y:S},q]);for(const w of m)P(R,[_,F,{x:F.x,y:S},{x:w,y:S},{x:w,y:q.y},q])}}},"addHorizontalDepartureOuterTrackCandidates"),pt=d(R=>{const _=R.start,F=R.end,V=F?a.get(F):void 0;if(!_||!V)return[];const K=xt(R.points??[]);if(K.length<4)return[];const Z=K[0],Y=K[1],q=[];return Ot(Z,Y,et)?rt(q,Z,Y,V):Nt(Z,Y,et)&&ut(q,Z,Y,V),q},"terminalPreservingOuterTrackCandidates"),St=d(R=>{const _=R.start,F=R.end,V=_?a.get(_):void 0,K=F?a.get(F):void 0;if(!V||!K)return[];const Z=[];for(const Y of f){const q=Le(V,Y);for(const m of f)Z.push(...J(q,Y,Le(K,m),m))}return Z.push(...pt(R)),Z},"candidatePathsFor"),wt=d(()=>new Map(p.map(R=>[R,at(h(R))])),"currentSegmentsByEdge"),Kt=d((R,_,F)=>{const V=new Set;for(const K of p){if(K===R)continue;const Z=F.get(K)??at(h(K));_.some(Y=>Z.some(q=>de(Y,q,.5)>=Xt))&&V.add(K)}return V},"sharedTrackConflictsFor"),qt=d((R,_,F,V)=>{const K=new Set;return St(R).map(Y=>ue(xt(Y))).filter(Y=>{if(H(R,Y))return!1;const q=Y.map(m=>`${m.x.toFixed(3)},${m.y.toFixed(3)}`).join("|");return K.has(q)||Y.length<2?!1:(K.add(q),!0)}).map(Y=>{const q=at(Y);let m=0;for(const S of p)S!==R&&(m+=l(q,F.get(S)??at(h(S))));return{candidate:Y,candidateSegments:q,crossings:_.count-(V.get(R)??0)+m,bends:oe(Y,et),totalBends:oe(Y),length:A(Y)}}).filter(({crossings:Y})=>Y<=_.count).sort((Y,q)=>Y.crossings-q.crossings||Y.bends-q.bends||Y.length-q.length).slice(0,48).map(Y=>({path:Y.candidate,segments:Y.candidateSegments,sharedTrackConflicts:Kt(R,Y.candidateSegments,F),totalBends:Y.totalBends,length:Y.length}))},"pairCandidatesFor"),Jt=d((R,_,F,V,K,Z)=>{let Y=0;for(const m of R.pairs)(m.first===_||m.second===_||m.first===V||m.second===V)&&(Y+=m.count);let q=l(F.segments,K.segments);for(const m of p){if(m===_||m===V)continue;const S=Z.get(m)??at(h(m));q+=l(F.segments,S)+l(K.segments,S)}return R.count-Y+q},"pairCrossingCount"),se=d((R,_)=>{for(const F of R.sharedTrackConflicts)if(F!==_)return!1;return!0},"conflictsOnlyWith"),Ee=d((R,_)=>R.segments.some(F=>_.segments.some(V=>de(F,V,.5)>=Xt)),"candidatesShareTrack"),me=d((R,_,F,V)=>se(_,F.edge)&&se(V,R.edge)&&!Ee(_,V),"pairCandidatesAreCompatible"),Te=d((R,_,F,V,K)=>{const Z=Jt(R.current,_.edge,F,V.edge,K,R.baseSegments);if(!(Z>=R.current.count))return{replacements:new Map([[_.edge,F.path],[V.edge,K.path]]),crossings:Z,bends:R.currentBends-(R.baseBendsByEdge.get(_.edge)??0)-(R.baseBendsByEdge.get(V.edge)??0)+F.totalBends+K.totalBends,length:R.currentLength-(R.baseLengthByEdge.get(_.edge)??0)-(R.baseLengthByEdge.get(V.edge)??0)+F.length+K.length}},"scorePairReplacement"),mn=d((R,_)=>R.crossings<_.crossings||R.crossings===_.crossings&&(R.bends<_.bends||R.bends===_.bends&&R.length<_.length),"pairScoreIsBetter"),yn=d((R,_,F,V)=>{let K=V;for(const Z of _.candidates)for(const Y of F.candidates){if(!me(_,Z,F,Y))continue;const q=Te(R,_,Z,F,Y);q&&mn(q,K)&&(K=q)}return K},"bestScoreForOptionPair"),pn=d(R=>{const _=B(),F=O(),V=wt(),K=E(R),Z=new Map(p.map(T=>[T,oe(h(T))])),Y=new Map(p.map(T=>[T,A(h(T))])),q=new Map,m=y(R);for(const T of m)for(const N of T){if(q.has(N))continue;const D=qt(N,R,V,K);D.length>0&&q.set(N,{edge:N,candidates:D})}let S={replacements:new Map,crossings:R.count,bends:_,length:F};const w={current:R,currentBends:_,currentLength:F,baseBendsByEdge:Z,baseLengthByEdge:Y,baseSegments:V};for(const T of m){const N=new Set(T.filter(W=>R.edgeSet.has(W))),D=T.map(W=>q.get(W)).filter(W=>!!W);for(let W=0;W0?S.replacements:void 0},"bestPairedReplacement");for(let R=0;R<4;R++){const _=C(),F=_.count;if(F===0)return;let V,K,Z=F,Y=Number.POSITIVE_INFINITY;for(const m of _.edges){const S=oe(h(m),et);for(const w of St(m)){const T=H(m,w),N=!T&&k(m,w),D=I(_,m,w),W=oe(w,et);T||N||!(DZ||D===Z&&W>=Y||(V=m,K=w,Z=D,Y=W)}}if(V&&K){V.points=K;continue}const q=pn(_);if(!q)return;for(const[m,S]of q)m.points=S}}d(ws,"resolveRenderedOrthogonalCrossings");var be=.001,Zr=8;function As(t,e){const{nodeInfoById:n,realNodeRects:o}=un(e),s=["top","bottom","left","right"],r=20,i={top:Math.min(...o.map(l=>l.rect.top))-r,bottom:Math.max(...o.map(l=>l.rect.bottom))+r,left:Math.min(...o.map(l=>l.rect.left))-r,right:Math.max(...o.map(l=>l.rect.right))+r},a=d((l,x,C,b)=>{const v=[],L=uo(l,x,C,b,r,be);return L&&v.push(L),x===b&&v.push(ho(l,x,C,i[x])),v},"buildOrthogonalPathCandidates"),c=d((l,x)=>{for(let C=0;C{let b=0;const v=Be(l,be),L=x.start,y=x.end;for(const I of t){if(I===x||I.isLayoutOnly)continue;const E=I.start,A=I.end;if(!C&&L&&y&&(E===L||E===y||A===L||A===y))continue;const B=I.points;if(!(!B||B.length<2))for(const O of v)for(const k of Be(B,be)){if(mo(O.a,O.b,k.a,k.b,be,be)){b++;continue}de(O,k,be)>=Zr&&b++}}return b},"pathConflictCount"),g=4,p=d((l,x)=>{const C=Math.abs(l.y-x.rect.top),b=Math.abs(l.y-x.rect.bottom),v=Math.abs(l.x-x.rect.left),L=Math.abs(l.x-x.rect.right);let y="top",I=C;return b{const b=M.get(l)??[];b.push({side:x,edgeId:C}),M.set(l,b)},"addFaceClaim");for(const l of t){if(l.isLayoutOnly)continue;const x=l.points??[];if(x.length<1)continue;const C=l.id??"",b=l.start,v=l.end;if(b){const L=n.get(b);L&&u(b,p(x[0],L),C)}if(v){const L=n.get(v);L&&u(v,p(x[x.length-1],L),C)}}const h=d((l,x,C)=>{var b;return((b=M.get(l))==null?void 0:b.some(v=>v.edgeId!==C&&v.side===x))??!1},"faceIsClaimed");for(const l of t){if(l.isLayoutOnly)continue;const x=l.points;if(!x||x.length<2)continue;const C=oe(x,be);if(C0){const Mt=f(tt,l,!0);if(Mt>O||Mt===O&&ft>=k)continue;O=Mt,k=ft,B=tt;continue}f(tt,l)>A||ftG.edgeId!==I));const P=M.get(v);P&&M.set(v,P.filter(G=>G.edgeId!==I)),u(b,p(B[0],L),I),u(v,p(B[B.length-1],y),I)}}}d(As,"simplifyDetouredEdges");var Qt=.001,Fo=10,Ke=7;function Un(t,e){const n=e?0:t.length-1,o=e?1:-1,s=t[n],r=t[n+o];if(!s||!r)return;const i=r.x-s.x,a=r.y-s.y;if(!(Math.abs(i)+Math.abs(a)r&&en(t,Rs(r)))}d(Wn,"labelOverlapsOwnMarker");function Je(t,e){const n=[];for(const h of t){if(h.isLayoutOnly)continue;const l=h.points;if(!(!l||l.length<2))for(let x=0;x{const x=Nn(l,r);for(const{nodeId:C,rect:b}of o)if(C!==h&&en(x,b))return!0;return!1},"labelOverlapsForeignNode"),f=d((h,l)=>{const x=Nn(l,r);for(const C of n)if(C.edgeId!==h&&dn(C.p1,C.p2,x))return!0;return!1},"labelOverlapsForeignEdge"),g=d((h,l,x)=>c(h,x)||f(l,x),"labelOverlapsAnything"),p=[],M=d(h=>{for(const{id:l,rect:x}of s)if(ss(x,h))return l},"findContainingLane"),u=d((h,l)=>p.some(x=>x.labelId!==h&&en(l,x.rect)),"overlapsPlacedLabel");for(const h of t){if(h.isLayoutOnly)continue;const l=h.labelNodeId;if(!l)continue;const x=e.get(l);if(!x)continue;const C=h.points;if(!C||C.length<2)continue;const b=x.width??0,v=x.height??0;if(b<=0||v<=0)continue;const L=[];for(let nt=0;nt=Qt&&pt>=Qt||L.push({idx:nt,length:ut+pt,orientation:ut>=Qt?"horizontal":"vertical",midX:(J.x+rt.x)/2,midY:(J.y+rt.y)/2})}if(L.length===0)continue;const y=L.length>=3?L.filter(nt=>nt.idx>0&&nt.idx0?y:L,E=b>=v?"horizontal":"vertical",A=d(nt=>[...nt].sort((J,rt)=>{const ut=J.orientation===E,pt=rt.orientation===E;if(ut!==pt)return ut?-1:1;const St=J.length>=(J.orientation==="horizontal"?b:v)+2,wt=rt.length>=(rt.orientation==="horizontal"?b:v)+2;return St!==wt?St?-1:1:rt.length-J.length}),"rankSegments"),B=L[0],O=L[L.length-1],k=[.5,.25,.75,.05,.95,.15,.85,.1,.9],H=d((nt,J)=>{const rt=C[nt.idx],ut=C[nt.idx+1];return{midX:rt.x+(ut.x-rt.x)*J,midY:rt.y+(ut.y-rt.y)*J}},"anchorAtT"),P=d((nt,J,rt)=>Math.min(rt,Math.max(J,nt)),"clamp"),G=d((nt,J)=>nt.midX>=J.left-Qt&&nt.midX<=J.right+Qt&&nt.midY>=J.top-Qt&&nt.midY<=J.bottom+Qt,"pointInsideRectInclusive"),j=d(nt=>{const J=Pe(nt.midX,nt.midY,b,v),rt=M(J);if(rt)return{laneId:rt,anchor:nt,rect:J};const ut=s.find(({rect:se})=>G(nt,se));if(!ut)return;const pt=ut.rect.left+b/2+i,St=ut.rect.right-b/2-i,wt=ut.rect.top+v/2+i,Kt=ut.rect.bottom-v/2-i;if(pt>St||wt>Kt)return;const qt={midX:P(nt.midX,pt,St),midY:P(nt.midY,wt,Kt)},Jt=Pe(qt.midX,qt.midY,b,v);return G(nt,Jt)?{laneId:ut.id,anchor:qt,rect:Jt}:void 0},"placementForAnchor"),tt=d((nt,J,rt)=>nt.orientation==="horizontal"?Math.abs(J.midX-rt.x):Math.abs(J.midY-rt.y),"distanceAlongSegment"),ft=d((nt,J)=>{const ut=(nt.orientation==="horizontal"?b/2:v/2)+a;if(nt===B){const pt=C[nt.idx];if(tt(nt,J,pt)+Qt{const J=A(nt);for(const rt of J)for(const ut of k){const pt=H(rt,ut);if(!ft(rt,pt))continue;const St=j(pt);if(St&&!Wn(St.rect,C)&&!u(l,St.rect)&&!g(l,h.id,St.rect))return{laneId:St.laneId,anchor:St.anchor}}},"tryPool"),Ht=d((nt,J,rt=!1)=>{const ut=A(nt);for(const pt of ut){const St={midX:pt.midX,midY:pt.midY};if(J&&!ft(pt,St))continue;const wt=j(St);if(wt&&!Wn(wt.rect,C)&&!u(l,wt.rect)&&!c(l,wt.rect)&&(rt||!f(h.id,wt.rect)))return{laneId:wt.laneId,anchor:wt.anchor}}},"findLaneContainingFallback"),Ft=Mt(I)??(I.lengthrt.labelId===l);J>=0?p[J]={labelId:l,rect:nt}:p.push({labelId:l,rect:nt})}}}d(Je,"anchorLabelsToPolyline");var En=1e-6,Qr=8,Do=Qr/2,ti=3;function Kn(t,e){return t{const g=Kn(a,c);let p=0;const M=d(u=>{if(!u)return;const h=s.get(u);if(!h)return;const l=f==="x"?h.w/2:h.h/2;l>p&&(p=l)},"consider");M(i.labelNodeId);for(const u of t){if(u===i||u.isLayoutOnly)continue;const h=u.start,l=u.end;!h||!l||Kn(h,l)===g&&M(u.labelNodeId)}return p>0?p+ti:0},"labelClearanceFor");for(const i of t){if(i.isLayoutOnly)continue;const a=i.points;if(!lo(a,En))continue;const c=go(i,n,En);if(!c)continue;const{srcId:f,dstId:g,srcInfo:p,dstInfo:M,collinearX:u,collinearY:h}=c;if(u===h)continue;let l,x;if(u){const y=M.cy>p.cy;l={x:p.cx,y:y?p.rect.bottom:p.rect.top},x={x:M.cx,y:y?M.rect.top:M.rect.bottom}}else{const y=M.cx>p.cx;l={x:y?p.rect.right:p.rect.left,y:p.cy},x={x:y?M.rect.left:M.rect.right,y:M.cy}}if(Pt(l,x,o,[f,g],1))continue;const b=r(i,f,g,u?"x":"y"),v=b>Do?b:Do,L=[0,v,-v];for(const y of L){const I={...l},E={...x};if(u){if(I.x+=y,E.x+=y,I.x<=p.rect.left||I.x>=p.rect.right||E.x<=M.rect.left||E.x>=M.rect.right)continue}else if(I.y+=y,E.y+=y,I.y<=p.rect.top||I.y>=p.rect.bottom||E.y<=M.rect.top||E.y>=M.rect.bottom)continue;if(!Pt(I,E,o,[f,g],1)&&!nn(I,E,t,i,{epsilon:En})){i.points=[I,E];break}}}}d(Ns,"straightenCollinearSiblingDetours");function qn(t,e){const{realNodeRects:c,labelNodeRects:f}=Me(e.values()),g=d((y,I)=>Be(I,.001).map(E=>({...E,edge:y,interior:E.index>=1&&E.index<=I.length-3})),"segmentsFor"),p=d(()=>{const y=[];for(const I of t){if(I.isLayoutOnly)continue;const E=I.points;!E||E.length<2||y.push(...g(I,xt(E)))}return y},"allSegments"),M=d((y,I)=>y.horizontal&&I.horizontal?Wt(y.a.x,y.b.x,I.a.x,I.b.x)>=8&&Math.abs(y.a.y-I.a.y)<7:y.vertical&&I.vertical?Wt(y.a.y,y.b.y,I.a.y,I.b.y)>=8&&Math.abs(y.a.x-I.a.x)<7:!1,"hasCrowdedParallelTrack"),u=d((y,I)=>{const E=y.start,A=y.end,B=g(y,I);if(B.length!==I.length-1)return!1;const O=[E,A].filter(H=>!!H),k=y.labelNodeId?[y.labelNodeId]:[];for(const H of B)if(Pt(H.a,H.b,c,O,-2)||Pt(H.a,H.b,f,k,-2))return!1;for(const H of t){if(H===y||H.isLayoutOnly)continue;const P=H.points;if(!(!P||P.length<2)){for(const G of B)for(const j of g(H,xt(P)))if(M(G,j)||he(G.a,G.b,j.a,j.b,.001))return!1}}return!0},"candidateIsSafe"),h=d((y,I)=>{const E=xt(y.edge.points??[]);if(E.length<4||y.index>=E.length-1)return;const A=E.map(B=>({...B}));if(y.horizontal)A[y.index].y+=I,A[y.index+1].y+=I;else if(y.vertical)A[y.index].x+=I,A[y.index+1].x+=I;else return;return g(y.edge,A).length===A.length-1?A:void 0},"shiftedCandidate"),l=d((y,I)=>({x:y.x??(I.left+I.right)/2,y:y.y??(I.top+I.bottom)/2}),"nodeCenter"),x=d(y=>{const I=y.edge,E=xt(I.points??[]);if(E.length!==4||y.index!==1)return;const A=I.start?e.get(I.start):void 0,B=I.end?e.get(I.end):void 0,O=A?te(A):void 0,k=B?te(B):void 0,H=E.slice(y.index+2);if(!(!A||!B||!O||!k||H.length===0))return{sourceCenter:l(A,O),targetCenter:l(B,k),sourceRect:O,tail:H}},"sourceDetourContextFor"),C=d((y,I,E,A,B,O)=>{const k=A.y>=E.y,H=k?B.bottom:B.top,P=H+(k?20:-20);if(k&&y.b.y<=P+.001||!k&&y.b.y>=P-.001)return;const G=y.a.x+I;return xt([{x:E.x,y:H},{x:E.x,y:P},{x:G,y:P},{x:G,y:y.b.y},...O],.001)},"verticalSourceDetour"),b=d((y,I,E,A,B,O)=>{const k=A.x>=E.x,H=k?B.right:B.left,P=H+(k?20:-20);if(k&&y.b.x<=P+.001||!k&&y.b.x>=P-.001)return;const G=y.a.y+I;return xt([{x:H,y:E.y},{x:P,y:E.y},{x:P,y:G},{x:y.b.x,y:G},...O],.001)},"horizontalSourceDetour"),v=d((y,I)=>{const E=x(y);if(E){if(y.vertical)return C(y,I,E.sourceCenter,E.targetCenter,E.sourceRect,E.tail);if(y.horizontal)return b(y,I,E.sourceCenter,E.targetCenter,E.sourceRect,E.tail)}},"sourceDetourCandidate"),L=[-7,7,-2*7,2*7,-3*7,3*7];for(let y=0;y<12;y++){const I=p();let E=!1;for(let A=0;AP.interior);for(const P of H){for(const G of L){const j=h(P,G);if(j&&u(P.edge,j)){P.edge.points=j,E=!0;break}const tt=v(P,G);if(tt&&u(P.edge,tt)){P.edge.points=tt,E=!0;break}}if(E)break}}if(!E)return}}d(qn,"nudgeSharedInteriorSubpaths");function Os(t,e,n,o){const s=e.x-t.x,r=e.y-t.y,i=o.x-n.x,a=o.y-n.y,c=s*a-r*i;if(Math.abs(c)<1e-10)return!1;const f=n.x-t.x,g=n.y-t.y,p=(f*a-g*i)/c,M=(f*r-g*s)/c,u=.01;return p>u&&p<1-u&&M>u&&M<1-u}d(Os,"segmentsIntersect");function Ps(t){const e=t.nodes??[],n=t.edges??[],o=[];if(!n.length||!e.length)return o;const s=rs(e),r=[];for(const a of n){if(a.isLayoutOnly)continue;const c=a.points;if(!c||c.length<2)continue;const f=a.start,g=a.end,p=a.labelNodeId,M=a.id??`${f}->${g}`;for(const u of s)if(!(u.nodeId===f||u.nodeId===g)&&!(p&&u.nodeId===p)){for(let h=0;h0){const a=o.filter(f=>f.type==="edge-node-overlap").length,c=o.filter(f=>f.type==="edge-edge-crossing").length;Qe.warn(`[SWIMLANE_VALIDATE] ${o.length} issue(s) detected: ${a} edge-node overlap(s), ${c} edge crossing(s)`);for(const f of o)Qe.warn(`[SWIMLANE_VALIDATE] ${f.type}: ${f.detail}`)}return o}d(Ps,"validateSwimlanesLayout");function Bs(t,e){const n=t.nodes??[],o=t.edges??[],s=n.filter(a=>!a.isGroup);if((e==="LR"||e==="RL")&&s.length>0&&!Ms(t,e)||e==="BT"&&s.length>0&&!bs(t))return;for(const a of o){if(a.isLayoutOnly)continue;const c=a.points;!c||c.length<2||(a.points=ue(on(c)))}As(o,n),Ns(o,n),Is(o,n);const r=new Map;for(const a of n)r.set(String(a.id),a);Je(o,r),fs(o,r),Ss(o,r),qn(o,r),Cs(o,r),vs(o,r),zn(o,r),Ls(o,r);const i=d(()=>{ws(o,r),Es(o,r),Ts(o,r),Je(o,r),Gn(o,r),zn(o,r),Je(o,r),Gn(o,r)},"finalizeRenderedEdges");i(),qn(o,r),i(),Vn(o,r),jn(o,r),Vn(o,r),jn(o,r)}d(Bs,"postProcessSwimlaneLayout");function Ie(t){const e=new Map(t.nodeById),n=new Set,o=[];for(const r of t.edges){if(!e.has(r.src)||!e.has(r.dst))continue;const i=`${r.id}:${r.src}->${r.dst}`;n.has(i)||(n.add(i),o.push(r))}return{nodes:[...e.keys()],edges:o,layout:t.layout,nodeById:e}}d(Ie,"normalizeGraph");function Mo(t,e){return t.edges.filter(n=>n.dst===e)}d(Mo,"incoming");function ks(t){const e=new Map;for(const n of t.nodes)e.set(n,[]);for(const n of t.edges)e.get(n.src).push(n.dst);return e}d(ks,"buildSuccessorMap");function Io(t){const e=ks(t);for(const n of e.values())n.sort((o,s)=>o.localeCompare(s));return e}d(Io,"buildSortedSuccessorMap");function So(t){const e=new Map;for(const n of t.nodes)e.set(n,0);for(const n of t.edges)e.set(n.dst,(e.get(n.dst)??0)+1);return e}d(So,"buildInDegreeMap");function Co(t){return[...t.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,n)=>e.localeCompare(n))}d(Co,"sortedZeroInDegreeNodes");function hn(t,e=()=>!0){const n=new Map,o=new Map;for(const s of t.nodes)n.set(s,[]),o.set(s,[]);for(const s of t.edges)e(s)&&(o.get(s.src).push(s.dst),n.get(s.dst).push(s.src));return{preds:n,succs:o}}d(hn,"buildPredecessorSuccessorMaps");function vo(t,e,n,o){var i,a;let s=0;for(const c of t.nodes)o!=null&&o.skipGroups&&((i=t.nodeById.get(c))!=null&&i.isGroup)||(s=Math.max(s,n[c]??0));const r=Array.from({length:s+1},()=>[]);for(const c of e)o!=null&&o.skipGroups&&((a=t.nodeById.get(c))!=null&&a.isGroup)||r[Math.max(0,n[c]??0)].push(c);return r}d(vo,"buildLayersFromRanks");function De(t){const e=So(t),n=Co(e),o=[],s=Io(t);for(;n.length;){const r=n.shift();o.push(r);for(const i of s.get(r)??[])if(e.set(i,(e.get(i)??0)-1),(e.get(i)??0)===0){let a=0;for(;a{if(s-o<=1)return 0;const r=o+s>>1;let i=n(o,r)+n(r,s),a=o,c=r,f=o;for(;a=s||ap.dst===M.dst?p.id.localeCompare(M.id):p.dst.localeCompare(M.dst));const o=Object.create(null);for(const g of e.nodes)o[g]=0;const s=[],r=d(g=>{o[g]=1;for(const p of n.get(g)??[]){const M=p.dst;o[M]===0?r(M):o[M]===1&&s.push(p)}o[g]=2},"dfs"),i=[...e.nodes].sort((g,p)=>g.localeCompare(p));for(const g of i)o[g]===0&&r(g);const a=new Set(s.map(g=>`${g.id}:${g.src}->${g.dst}`)),c=e.edges.map(g=>a.has(`${g.id}:${g.src}->${g.dst}`)?{id:g.id,src:g.dst,dst:g.src,weight:g.weight,ref:g.ref}:g);return{acyclic:{nodes:[...e.nodes],edges:c,layout:e.layout,nodeById:new Map(e.nodeById)},reversed:s}}d(_s,"removeCycles_DFS");function Fs(t){const e=new Map,n=d(o=>{if(e.has(o))return e.get(o);const s=t.nodeById.get(o);if(!s)return e.set(o,null),null;const r=s.parentId;if(!r)return e.set(o,null),null;const a=n(r)??r;return e.set(o,a),a},"resolve");for(const o of t.nodes)n(o);return e}d(Fs,"buildTopLaneMap");function ge(t){const e=Fs(t);return n=>e.get(n)??null}d(ge,"createTopLaneResolver");function gn(t){const e=[];for(const n of t.layout.nodes??[])n.isGroup&&!n.parentId&&e.push(n.id);return[...new Set(e)].reverse()}d(gn,"buildTopLaneOrder");function Eo(t,e){const n=gn(t);if(!e||e.length===0)return n;const o=new Set(n),s=new Set,r=[];for(const i of e)!o.has(i)||s.has(i)||(s.add(i),r.push(i));for(const i of n)s.has(i)||r.push(i);return r}d(Eo,"resolveTopLaneOrder");var ei={EPSILON:1e-6},ln={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},Ho={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function Ds(t,e){const n=Ie(t),o=(e==null?void 0:e.laneOf)??(()=>null),s=e==null?void 0:e.rankHint,{preds:r}=hn(n);for(const y of r.values())y.sort((I,E)=>I.localeCompare(E));const i=De(n)??[...n.nodes].sort((y,I)=>y.localeCompare(I)),a=new Map;for(const[y,I]of i.entries())a.set(I,y);const c=new Map,f=new Map;for(const y of n.nodes)f.set(y,[]);for(const y of i){const I=(r.get(y)??[]).filter(E=>c.has(E));if(I.length>0){const E=Hs(y,I,{laneOf:o,rankHint:s,topoIndex:a});c.set(y,E),f.get(E).push(y)}else c.has(y)||c.set(y,null)}for(const y of n.nodes)c.has(y)||c.set(y,null);const g=new Set;for(const y of n.nodes)(c.get(y)??null)===null&&g.add(y);const p=[...g].sort((y,I)=>{const E=a.get(y)??0,A=a.get(I)??0;return E===A?y.localeCompare(I):E-A}),M=Xs(n),u=new Map;for(const[y,I]of M.entries())u.set(y,[...I].sort((E,A)=>E.localeCompare(A)));const h=Ys(u),l=Gs(u),x=new Map;for(const y of n.nodes)x.set(y,[]);for(const y of l)for(const I of y.nodes){const E=x.get(I);E?E.push(y.id):x.set(I,[y.id])}const C=[],b=[],v=new Set,L=d(y=>{if(!v.has(y)){v.add(y),C.push(y);for(const I of f.get(y)??[])L(I);b.push(y)}},"walk");for(const y of p)L(y);for(const y of i)L(y);return{parent:c,children:f,roots:p,componentOf:h,blocks:l,nodeBlocks:x,adjacency:u,preorder:C,postorder:b,topologicalOrder:i}}d(Ds,"buildDrivingTree");function Hs(t,e,n){const o=n.laneOf(t);return[...e].sort((r,i)=>{var l,x;const a=n.laneOf(r),c=n.laneOf(i),f=a!=null&&a===o,g=c!=null&&c===o;if(f!==g)return f?-1:1;const p=(l=n.rankHint)==null?void 0:l[r],M=(x=n.rankHint)==null?void 0:x[i];if(p!=null&&M!=null&&p!==M)return M-p;const u=n.topoIndex.get(r)??0,h=n.topoIndex.get(i)??0;return u!==h?u-h:r.localeCompare(i)})[0]}d(Hs,"chooseParent");function Xs(t){const e=new Map;for(const n of t.nodes)e.set(n,new Set);for(const n of t.edges)e.get(n.src).add(n.dst),e.get(n.dst).add(n.src);return e}d(Xs,"buildAdjacency");function Ys(t){const e=new Map;let n=0;for(const o of t.keys()){if(e.has(o))continue;const s=[o];for(;s.length>0;){const r=s.pop();if(!e.has(r)){e.set(r,n);for(const i of t.get(r)??[])e.has(i)||s.push(i)}}n++}return e}d(Ys,"assignComponents");function Gs(t){const e=new Map,n=new Map,o=[],s=[];let r=0;const i=d((a,c)=>{e.set(a,++r),n.set(a,r);for(const f of t.get(a)??[])f!==c&&(e.has(f)?(e.get(f)??0)<(e.get(a)??0)&&(o.push([a,f]),n.set(a,Math.min(n.get(a)??r,e.get(f)??r))):(o.push([a,f]),i(f,a),n.set(a,Math.min(n.get(a)??r,n.get(f)??r)),(n.get(f)??0)>=(e.get(a)??0)&&s.push($s(a,f,o,s.length))))},"visit");for(const a of t.keys())e.has(a)||i(a,null);return s}d(Gs,"computeBlocks");function $s(t,e,n,o){const s=[],r=new Set;for(;n.length>0;){const i=n.pop();if(s.push(i),r.add(i[0]),r.add(i[1]),i[0]===t&&i[1]===e||i[0]===e&&i[1]===t)break}return{id:o,edges:s,nodes:[...r]}}d($s,"popBlock");function zs(t,e,n){const o=[...t.nodes],s=new Map;for(const[b,v]of o.entries())s.set(v,b);const r=o.length,i=new Array(r).fill(-1),a=new Array(r).fill(0),c=[],f=new Set;for(const b of o){const v=n.parent.get(b)??null,L=s.get(b);L!=null&&v==null&&(i[L]=-1,a[L]=0,f.has(b)||(f.add(b),c.push(b)))}for(;c.length>0;){const b=c.shift(),v=s.get(b);if(v==null)continue;const L=n.children.get(b)??[];for(const y of L){if(f.has(y))continue;const I=s.get(y);I!=null&&(i[I]=v,a[I]=a[v]+1,f.add(y),c.push(y))}}for(const b of o){if(f.has(b))continue;const v=s.get(b);v!=null&&(i[v]=-1,a[v]=0,f.add(b))}const g=Math.max(1,Math.ceil(Math.log2(Math.max(1,r)))+1),p=Array.from({length:g},()=>new Array(r).fill(-1));for(let b=0;b{if(b===-1||v===-1)return-1;a[b]>y&1&&(b=p[y][b],b===-1))return-1;if(b===v)return b;for(let y=g-1;y>=0;y--){const I=p[y][b],E=p[y][v];I===-1||E===-1||I!==E&&(b=I,v=E)}return p[0][b]},"lcaIndex"),u=Array.from({length:r},()=>new Map);for(const b of t.edges){let v=b.src,L=b.dst,y=e[v],I=e[L];if(y==null||I==null||(y>I&&([v,L]=[L,v],[y,I]=[I,y]),y==null||I==null||y===I))continue;const E=s.get(v),A=s.get(L);if(E==null||A==null)continue;const B=M(E,A);if(B===-1)continue;const O=u[B];for(let k=y;k{if(v.size!==0)for(const[L,y]of v)b.set(L,(b.get(L)??0)+y)},"mergeInto"),x=new Set,C=d(b=>{const v=s.get(b);x.add(b);const L=v==null?void 0:u[v],y=L?new Map(L):new Map,I=n.children.get(b)??[];for(const E of I){const A=C(E),B=e[b];if(B!=null){let O=h.get(b);O||(O=new Map,h.set(b,O));let k=A.get(B)??0;const H=e[E];H!=null&&H>B&&(k+=1),O.set(E,k)}l(y,A)}return y},"dfs");for(const b of n.roots)x.has(b)||C(b);for(const b of o)x.has(b)||C(b);return h}d(zs,"computeSubtreeCrossCounts");function Vs(t,e,n){const o=new Map,s=d(r=>{let i=n[r]??0;const a=[...e.get(r)??[]];a.sort(To(n));for(const c of a){s(c);const f=o.get(c);f!=null&&(i=Math.min(i,f))}o.set(r,i)},"annotate");for(const r of t)s(r);return o}d(Vs,"annotateMinimumLayers");function To(t){return(e,n)=>{const o=t[e]??0,s=t[n]??0;return o===s?e.localeCompare(n):o-s}}d(To,"compareByRankThenId");function js(t,e,n,o){let s=0;for(const c of e){const f=n[c]??0;f>s&&(s=f)}const r=Array.from({length:s+1},()=>[]),i=new Set,a=d(c=>{if(i.has(c))return;i.add(c);const f=n[c]??0;r[f]||(r[f]=[]),r[f].push(c);for(const g of o(c))a(g)},"emit");for(const c of t)a(c);for(const c of e)if(!i.has(c)){const f=n[c]??0;r[f]||(r[f]=[]),r[f].push(c),i.add(c)}return r}d(js,"emitNodesInTreeOrder");function Us(t){const e=[];for(const n of t){const o=new Set,s=[];for(const r of n)o.has(r)||(o.add(r),s.push(r));e.push(s)}return e}d(Us,"deduplicateLayers");function Ws(t,e,n,o){return s=>{const r=t.get(s)??[];if(r.length===0)return[];const i=e[s]??0,a=[],c=[],f=n.get(s);for(const g of r){const p=o.get(g)??i;p>i?a.push({child:g,min:p}):c.push(g)}return a.sort((g,p)=>g.min===p.min?g.child.localeCompare(p.child):g.min-p.min),c.sort((g,p)=>{const M=(f==null?void 0:f.get(g))??0,u=(f==null?void 0:f.get(p))??0;if(M!==u)return M-u;const h=o.get(g)??i,l=o.get(p)??i;return h!==l?h-l:g.localeCompare(p)}),[...a.map(g=>g.child),...c]}}d(Ws,"createChildOrderer");function fn(t,e,n){const o=Ds(t,{rankHint:e,laneOf:n}),{children:s,roots:r}=o;for(const p of t.nodes)s.has(p)||s.set(p,[]);const i=zs(t,e,o),a=[...r].sort(To(e)),c=Vs(a,s,e),f=Ws(s,e,i,c);let g=js(a,t.nodes,e,f);return g=Us(g),g}d(fn,"buildMultitreeLayerOrder");function Ks(t,e,n){const o=new Set(t),s=new Set(e),r=ke(e),i=[];for(const a of n)o.has(a.src)&&s.has(a.dst)&&i.push(r.get(a.dst));return Lo(i)}d(Ks,"countCrossingsBetweenAdjacent");function Jn(t,e,n){const o=[];for(const r of e){const i=n[r.src],a=n[r.dst];if(i==null||a==null||i===a)continue;let c=r.src,f=r.dst,g=i,p=a;i>a&&(c=r.dst,f=r.src,g=a,p=i);for(let M=g;M(n[M]??0)-(n[p]??0));for(const p of g){const M=n[p]??0;if(M===0)continue;let u=0;for(const C of o.get(p)??[])u=Math.max(u,(n[C]??0)+1);if(u>=M)continue;const h=M;n[p]=u;const l=fn(t,n,s),x=Jn(l,t.edges,n);x(e[s]??0)-(e[r]??0)||s.localeCompare(r));for(const s of o){const r=n(s);if(!r)continue;const i=t.edges.filter(l=>l.src===s);if(i.length===0)continue;let a=!1,c=0;for(const l of i){const x=n(l.dst);x==null||x===r?a=!0:c++}if(c===0||a)continue;let f=0,g=!1;for(const l of t.edges){if(l.dst!==s)continue;const x=n(l.src);x&&(x===r?g=!0:f++)}if(f>0||!g)continue;const p=e[s]??0,M=p+c;let u=0;for(const l of t.edges)l.dst===s&&(u=Math.max(u,(e[l.src]??0)+1));const h=Math.max(p,u,M);h!==p&&(e[s]=h)}}d(Js,"adjustCrossLaneSources");function Zs(t,e){const n=Ie(t),o=De(n)??[...n.nodes].sort(),s=(e==null?void 0:e.compactSingleInput)??!1,r=ge(n);let i=Object.create(null);for(const c of o){const f=Mo(n,c),g=e!=null&&e.ignoreCrossLaneEdges?f.filter(p=>{const M=r(p.src),u=r(c);return!M||!u?!0:M===u}):f;if(g.length===0)i[c]=0;else if(s&&g.length===1){const p=g[0].src,M=r(p),u=r(c);M!==u?i[c]=i[p]??0:i[c]=(i[p]??0)+1}else{let p=-1/0;for(const M of g)p=Math.max(p,(i[M.src]??0)+1);i[c]=p===-1/0?0:p}}return((e==null?void 0:e.optimizeRanksByCrossings)??!1)&&(i=qs(n,i)),e!=null&&e.ignoreCrossLaneEdges&&Js(n,i),{layers:fn(n,i,r),rankOf:i,dummy:new Set}}d(Zs,"assignLayers_LongestPath");function Qs(t,e){const n=Ie(t),s={...Zs(n,{compactSingleInput:e==null?void 0:e.compactSingleInput,ignoreCrossLaneEdges:e==null?void 0:e.ignoreCrossLaneEdges,optimizeRanksByCrossings:e==null?void 0:e.optimizeRanksByCrossings}).rankOf},r=ge(n),{preds:i,succs:a}=hn(n,h=>{if(e!=null&&e.ignoreCrossLaneEdges){const l=r(h.src),x=r(h.dst);if(l&&x&&l!==x)return!1}return!0}),c=De(n)??[...n.nodes],f=[...c].reverse(),g=d((h,l)=>{let x=0;for(const v of i.get(h)??[])x=Math.max(x,(s[v]??0)+1);let C=Number.POSITIVE_INFINITY;const b=a.get(h)??[];return b.length>0&&(C=Math.min(...b.map(v=>(s[v]??0)-1))),Number.isFinite(C)||(C=Math.max(x,l)),Math.min(Math.max(l,x),C)},"clampFeasible"),p=ln.GRAVITY_ITERATIONS,M=d(h=>{let l=!1;for(const x of h){const C=i.get(x)??[],b=a.get(x)??[];if(C.length===0&&b.length===0)continue;const v=C.length>0?C.reduce((E,A)=>E+(s[A]??0)+1,0)/C.length:s[x]??0,L=b.length>0?b.reduce((E,A)=>E+(s[A]??0)-1,0)/b.length:s[x]??0,y=Math.round((v+L)/2),I=g(x,y);I!==s[x]&&(s[x]=I,l=!0)}return l},"relaxOrder");for(let h=0;h0){const x=Math.min(...l.map(C=>(s[C]??0)-1));(s[h]??0)>x&&(s[h]=x)}}return{layers:vo(n,c,s),rankOf:s,dummy:new Set}}d(Qs,"assignLayers_Gravity");function tr(t){const e=So(t),n=Io(t);let o=Co(e);const s=[];for(;o.length>0;){const r=[];for(const i of o){s.push(i);for(const a of n.get(i)??[])e.set(a,(e.get(a)??0)-1),(e.get(a)??0)===0&&r.push(a)}o=r.sort((i,a)=>i.localeCompare(a))}return s.length===t.nodes.length?s:null}d(tr,"topoSortByGenerationIfAcyclic");function er(t,e){const n=Ie(t),o=(e==null?void 0:e.direction)==="LR"?tr(n)??[...n.nodes].sort():De(n)??[...n.nodes].sort(),s=ge(n),r=d(g=>s(g)??g,"laneOf"),i=Object.create(null),a=new Map,c=d((g,p)=>(e==null?void 0:e.ignoreCrossLaneEdges)??!0?r(g)===r(p)?1:0:1,"edgeWeight");for(const g of o){const p=n.nodeById.get(g);if(p!=null&&p.isGroup)continue;const M=Mo(n,g);let u=0;if(M.length>0)for(const C of M){const b=C.src,v=i[b]??0;u=Math.max(u,v+c(b,g))}const h=r(g),l=a.get(h)??0,x=Math.max(u,l);i[g]=x,a.set(h,x+1)}return{layers:vo(n,o,i,{skipGroups:!0}),rankOf:i,dummy:new Set}}d(er,"assignLayers_LaneAwareCompact");function nr(t,e){const n=Ie(e),{rankOf:o}=t,s=t.layers.map(u=>[...u]),r=new Set(t.dummy?[...t.dummy]:[]);let i=0;const a=new Map(n.nodeById),c=d(u=>{const h=`placeholder-${i++}`,l={id:h,isGroup:!1,isDummy:!0,width:0,height:0};for(a.set(h,l),r.add(h);s.length<=u;)s.push([]);return s[u].push(h),o[h]=u,h},"addDummyAt"),f=[...n.edges].sort((u,h)=>u.id===h.id?u.src===h.src?u.dst.localeCompare(h.dst):u.src.localeCompare(h.src):u.id.localeCompare(h.id)),g=[];for(const u of f){const h=o[u.src]??0,l=o[u.dst]??0;if(l-h<=1){g.push(u);continue}let x=u.src;for(let b=h+1,v=0;b!n.nodes.includes(u))],edges:g,layout:n.layout,nodeById:a};return{layering:{layers:s,rankOf:o,dummy:r},graphWithDummies:M}}d(nr,"makeProperLayering");function Zn(t){const e=t.length;if(e===0)return Number.POSITIVE_INFINITY;const n=[...t].sort((o,s)=>o-s);return e%2===1?n[(e-1)/2]:.5*(n[e/2-1]+n[e/2])}d(Zn,"median");function Qn(t){return t.length===0?Number.POSITIVE_INFINITY:t.reduce((n,o)=>n+o,0)/t.length}d(Qn,"barycenter");function or(t,e,n,o){const s=new Map;for(const r of t)s.set(r,[]);for(const r of n)o==="down"?e.has(r.src)&&s.has(r.dst)&&s.get(r.dst).push(e.get(r.src)):e.has(r.dst)&&s.has(r.src)&&s.get(r.src).push(e.get(r.dst));return s}d(or,"neighborPositionsFor");function sr(t,e,n){const o=n.get(t)??0,s=n.get(e)??0;return o!==s?o-s:t.localeCompare(e)}d(sr,"currentOrderTieBreak");function to(t,e,n){const o=new Set(t),s=new Set(e),r=ke(t),i=ke(e),a=[];for(const f of n)o.has(f.src)&&s.has(f.dst)&&a.push({u:r.get(f.src),v:i.get(f.dst)});a.sort((f,g)=>f.u===g.u?f.v-g.v:f.u-g.u);const c=a.map(f=>f.v);return Lo(c)}d(to,"countCrossingsBetweenAdjacent");function Ze(t,e,n){return[...t].sort((o,s)=>{const r=Zn(e.get(o)??[]),i=Zn(e.get(s)??[]);return r===i?sr(o,s,n):isFinite(r)?isFinite(i)?r-i:-1:1})}d(Ze,"sortByHeuristic");function eo(t,e,n,o,s,r){const i=ke(t),a=ke(e),c=or(e,i,n,o);if(!s||!r||r.length===0)return Ze(e,c,a);const f=new Map;for(const M of e){const u=s(M),h=f.get(u)??[];h.push(M),f.set(u,h)}const g=[];for(const M of r){const u=f.get(M);if(!u||u.length===0)continue;const h=Ze(u,c,a);g.push(...h)}const p=f.get(null);if(p&&p.length>0){const M=Ze(p,c,a);for(const u of M){const h=Qn(c.get(u)??[]);let l=g.length;if(isFinite(h))for(const[x,C]of g.entries()){const b=Qn(c.get(C)??[]);if(hi.has(l.src)&&a.has(l.dst)),g=c?n.filter(l=>a.has(l.src)&&c.has(l.dst)):void 0,p=d(l=>{let x=to(t,l,f);return g&&o&&(x+=to(l,o,g)),x},"crossingScore"),M=s?new Map:null;if(s&&M)for(const l of e)M.set(l,s(l));let u=!0,h=p(r);for(;u;){u=!1;for(let l=0;l+1[...a]),s=e.edges,r=ge(e),i=Eo(e,n==null?void 0:n.laneOrder);for(let a=0;a<3;a++){for(let c=1;c=0;c--)o[c]=eo(o[c+1],o[c],s,"up",r,i),o[c]=no(o[c+1],o[c],s,o[c-1],r)}return{layers:o}}d(rr,"orderLayers");function ir(t,e,n){const o=(n==null?void 0:n.layerGap)??Ho.DEFAULT_LAYER_GAP,s=(n==null?void 0:n.nodeGap)??Ho.DEFAULT_NODE_GAP,r=(n==null?void 0:n.laneGap)??s*2,i=(n==null?void 0:n.direction)??"TB",a=i==="LR"||i==="RL",c=t.layers,f=Object.create(null),g=Object.create(null),p=d(O=>e.nodeById.get(O),"getNode"),M=d(O=>{var k;return((k=p(O))==null?void 0:k.width)??0},"getWidth"),u=d(O=>{var k;return((k=p(O))==null?void 0:k.height)??0},"getHeight"),h=ge(e),l=Eo(e,n==null?void 0:n.laneOrder),x=c.map(O=>O.reduce((k,H)=>Math.max(k,u(H)),0)),C=[];if(a)for(let O=0;O+1Math.max(Mt,M(Ht)),0),H=c[O+1].reduce((Mt,Ht)=>Math.max(Mt,M(Ht)),0),P=x[O],G=x[O+1],j=P/2+G/2,tt=(k+H)/2,ft=Math.max(0,tt-j-o);C.push(ft)}const b=new Set;for(const O of c)for(const k of O)b.add(h(k));const v=b.has(null),L=l.filter(O=>b.has(O)),y=[...v?[null]:[],...L],I=Object.create(null);for(const O of L)I[O]=0;v&&(I.null=0);for(const O of c){const k=Object.create(null),H=[];for(const P of O){const G=h(P);G===null?H.push(P):(k[G]||(k[G]=[])).push(P)}for(const[P,G]of Object.entries(k)){const j=G.reduce((tt,ft)=>tt+M(ft),0)+s*Math.max(0,G.length-1);I[P]=Math.max(I[P]??0,j)}if(v&&H.length){const P=H.reduce((G,j)=>G+M(j),0)+s*Math.max(0,H.length-1);I.null=Math.max(I.null??0,P)}}const E=new Map;{const O=y.map(P=>(P===null?I.null:I[P])??0);let H=-(O.reduce((P,G)=>P+G,0)+r*Math.max(0,y.length-1))/2;for(let P=0;PM(nt)),Ht=Mt.reduce((nt,J)=>nt+J,0)+s*(tt.length-1);let Ft=ft-Ht/2;for(const[nt,J]of tt.entries()){const rt=Mt[nt];f[J]=Ft+rt/2,g[J]=A+H/2,Ft+=rt+s}}}const G=C[O]??0;A+=H+o+G}const B=new Map;for(const O of e.edges){const k=O.ref.id;B.has(k)||B.set(k,[]),B.get(k).push(O)}for(const[,O]of B){if(O.length===0)continue;const k=O[0].ref,H=k.start,P=k.end;if(H==null||P==null)continue;const G=Math.round(((f[H]??0)+(f[P]??0))/2),j=new Set;for(const tt of O)j.add(tt.src),j.add(tt.dst);for(const tt of j){if(tt===H||tt===P)continue;const ft=e.nodeById.get(tt);ft!=null&&ft.isDummy&&(f[tt]=G)}}return{x:f,y:g}}d(ir,"assignCoordinates");var cr=8;function ar(t){let e=2166136261;for(let n=0;n>>0}d(ar,"hashString");function lr(t){let e=t>>>0;return()=>{e+=1831565813;let n=e;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}d(lr,"mulberry32");function fr(t,e){const n=[...t],o=lr(e);for(let s=n.length-1;s>0;s--){const r=Math.floor(o()*(s+1));[n[s],n[r]]=[n[r],n[s]]}return n}d(fr,"deterministicShuffle");function dr(t,e){let n=0;for(const[o,s]of t.entries())n+=Math.abs(o-(e.get(s)??o));return n}d(dr,"sourceDistance");function oo(t,e){const n=new Map;for(const[s,r]of t.entries())n.set(r,s);let o=0;for(const{a:s,b:r,weight:i}of e){const a=n.get(s),c=n.get(r);a==null||c==null||(o+=i*Math.abs(a-c))}return o}d(oo,"laneArrangementCost");function ur(t){const e=gn(t);if(e.length<2)return[];const n=new Map(e.map((r,i)=>[r,i])),o=ge(t),s=new Map;for(const r of t.layout.edges??[]){if(r.isLayoutOnly)continue;const i=typeof r.start=="string"?r.start:void 0,a=typeof r.end=="string"?r.end:void 0;if(!i||!a||!t.nodeById.has(i)||!t.nodeById.has(a))continue;const c=o(i),f=o(a);if(!c||!f||c===f)continue;const g=n.get(c),p=n.get(f);if(g==null||p==null)continue;const[M,u]=g<=p?[c,f]:[f,c],h=`${M}\0${u}`,l=s.get(h);l?l.weight++:s.set(h,{a:M,b:u,weight:1})}return[...s.values()]}d(ur,"buildWeightedLaneEdges");function so(t,e,n){const o=[...t];let s=oo(o,e),r=!0,i=0;const a=Math.max(1,o.length);for(;r&&is.a===r.a?s.b.localeCompare(r.b):s.a.localeCompare(r.a)).map(({a:s,b:r,weight:i})=>`${s}:${r}:${i}`).join("|");return ar(`${t.join("|")}#${o}#${n}`)}d(gr,"seedForRestart");function mr(t,e={}){const n=gn(t);if(n.length<2)return n;const o=ur(t);if(o.length===0)return n;const s=new Map(n.map((a,c)=>[a,c]));let r=so(n,o,s);const i=Math.max(0,e.restarts??cr);for(let a=0;alt&&c*3>=a?i>0?"bottom":"top":a>lt?r>0?"right":"left":n}d(ro,"chooseOrthogonalSide");function io(t,e){return Math.abs(t.to-e.from)m.isGroup&&!m.parentId);for(const m of f){const S={id:m.id},w=d(T=>{i.set(T.id,S),n.filter(N=>N.parentId===T.id).forEach(w)},"assignLane");w(m)}const g=n.filter(m=>!m.isGroup&&!m.isEdgeLabel).map(m=>{const S=m.width??10,w=m.height??10,T=m.x??0,N=m.y??0,D=ni;return{nodeId:m.id,minX:T-S/2-D,maxX:T+S/2+D,minY:N-w/2-D,maxY:N+w/2+D,visualXHalfExtent:c?w/2+D:S/2+D}}),p=d((m,S,w,T)=>{let N=a.find(D=>D.orientation===m&&Math.abs(D.coord-S)<1);return N||(N={id:`pipe-${m}-${S.toFixed(0)}`,orientation:m,coord:S,spanMin:w,spanMax:T,tracks:[]},a.push(N)),N.spanMin=Math.min(N.spanMin,w),N.spanMax=Math.max(N.spanMax,T),N},"getOrAddPipe"),M=d((m,S)=>{const w=m.width??10,T=m.height??10,N=m.x??0,D=m.y??0;switch(S){case"top":return{x:N,y:D-T/2};case"bottom":return{x:N,y:D+T/2};case"left":return{x:N-w/2,y:D};case"right":return{x:N+w/2,y:D}}},"portForSide"),u=d((m,S,w)=>M(m,ro(m,S,w?"bottom":"top")),"getOrthogonalPort"),h=[],l=[],x=new Set,C=1e3,b=d((m,S,w)=>{if(h.length===0)return 0;const T=Math.abs(S.y-w.y)U||z.from-lt<=W&&z.to+lt>=W&&(D+=C)}else if(N){const W=S.x,ot=Math.min(S.y,w.y)-lt,U=Math.max(S.y,w.y)+lt;if(U<=ot)return 0;for(const z of h)z.edgeIndex===m||z.orientation!=="horizontal"||z.pipe.coordU||z.from-lt<=W&&z.to+lt>=W&&(D+=C)}return D},"crossingPenalty"),v=s.map((m,S)=>{if(!m.start||!m.end)return{idx:S,crossLane:0,dx:0,dy:0};const w=r.get(m.start),T=r.get(m.end),N=i.get(m.start),D=i.get(m.end),W=N&&D&&N.id!==D.id?1:0,ot=w&&T?Math.abs((T.x??0)-(w.x??0)):0,U=w&&T?Math.abs((T.y??0)-(w.y??0)):0;return{idx:S,crossLane:W,dx:ot,dy:U}}).sort((m,S)=>{if(m.crossLane!==S.crossLane)return S.crossLane-m.crossLane;const w=m.dx+m.dy,T=S.dx+S.dy;return Math.abs(w-T)>1?w-T:m.idx-S.idx}).map(m=>m.idx),L=d((m,S,w,T)=>{const N=Math.min(m.x,S.x),D=Math.max(m.x,S.x),W=Math.min(m.y,S.y),ot=Math.max(m.y,S.y);return!!g.find(z=>w&&z.nodeId===w||T&&z.nodeId===T?!1:Math.abs(m.x-S.x)>lt?z.minYm.y&&z.maxX>N&&z.minXm.x&&z.maxY>W&&z.minYro(m,S,"bottom"),"determineSide"),A=new Map;for(const[m,S]of s.entries()){if(!S.start||!S.end||S.start===S.end||S.points&&S.points.length>0)continue;const w=r.get(S.start),T=r.get(S.end);if(!w||!T)continue;const N=(T.x??0)-(w.x??0),D=(T.y??0)-(w.y??0);A.set(m,{edgeIdx:m,srcId:S.start,dstId:S.end,srcSide:E(w,{x:T.x??0,y:T.y??0}),dstSide:E(T,{x:w.x??0,y:w.y??0}),absDx:Math.abs(N),absDy:Math.abs(D),dxSign:Math.sign(N),dySign:Math.sign(D)})}const B=d(m=>m.srcSide==="top"||m.srcSide==="bottom"?m.absDx===0?1/0:m.absDy/m.absDx:m.absDy===0?1/0:m.absDx/m.absDy,"preferenceStrength"),O=d(m=>m.srcSide==="top"||m.srcSide==="bottom"?m.dxSign>=0?"right":"left":m.dySign>=0?"bottom":"top","secondarySide"),k=new Map;for(const m of A.values()){const S=`${m.srcId}:${m.srcSide}`;k.has(S)||k.set(S,[]),k.get(S).push(m)}const H=new Map,P=d((m,S)=>`${m}:${S}`,"loadKey");for(const m of A.values())H.set(P(m.srcId,m.srcSide),(H.get(P(m.srcId,m.srcSide))??0)+1),H.set(P(m.dstId,m.dstSide),(H.get(P(m.dstId,m.dstSide))??0)+1);for(const m of k.values())if(!(m.length<2)){m.sort((S,w)=>{const T=B(S),N=B(w);return Math.abs(T-N)>1e-9?N-T:S.edgeIdx-w.edgeIdx});for(let S=1;S=N||(H.set(P(w.srcId,w.srcSide),N-1),H.set(P(w.srcId,T),D+1),w.srcSide=T)}}const G=d(m=>{const S=m==null?void 0:m.shape;return S==="question"||S==="diamond"},"isDiamondNode"),j=new Map;for(const m of A.values())j.has(m.dstId)||j.set(m.dstId,new Set),j.get(m.dstId).add(m.dstSide);for(const m of A.values()){if(!G(r.get(m.srcId)))continue;const S=j.get(m.srcId);if(!(S!=null&&S.has(m.srcSide)))continue;const w=O(m);if(S.has(w)||(H.get(P(m.srcId,w))??0)>0)continue;const T=H.get(P(m.srcId,m.srcSide))??0;H.set(P(m.srcId,m.srcSide),Math.max(0,T-1)),H.set(P(m.srcId,w),1),m.srcSide=w}for(const m of A.values()){const{edgeIdx:S,srcId:w,dstId:T,srcSide:N,dstSide:D}=m,W=r.get(w),ot=r.get(T),U=`${w}:${N}:src`,z=N==="top"||N==="bottom"?ot.x??0:ot.y??0;y.has(U)||y.set(U,[]),y.get(U).push({edgeIdx:S,oppositeCoord:z});const bt=`${T}:${D}:dst`,dt=D==="top"||D==="bottom"?W.x??0:W.y??0;y.has(bt)||y.set(bt,[]),y.get(bt).push({edgeIdx:S,oppositeCoord:dt})}const tt=new Map,ft=8;for(const[m,S]of y){if(S.length<2)continue;S.sort((At,Gt)=>At.oppositeCoord-Gt.oppositeCoord);const w=m.split(":"),T=w.slice(0,-2).join(":"),N=w[w.length-2],D=w[w.length-1],W=r.get(T);if(!W)continue;const U=N==="left"||N==="right"?W.height??10:W.width??10,z=W.shape,dt=z==="question"||z==="diamond"?U*.3:U,st=Math.min(20,Math.max(ft,dt/(S.length+1))),Bt=-(st*(S.length-1))/2;for(const[At,Gt]of S.entries()){const ee=Bt+At*st,xn=`${Gt.edgeIdx}:${D}`;tt.set(xn,ee)}}const Mt=d(m=>{var S;return!!((S=s[m])!=null&&S.labelNodeId)},"edgeHasLabelNode"),Ht=d((m,S)=>m?(y.get(`${m}:${S}:src`)??[]).some(({edgeIdx:w})=>Mt(w))||(y.get(`${m}:${S}:dst`)??[]).some(({edgeIdx:w})=>Mt(w)):!1,"faceHasLabelNode"),Ft=d((m,S,w)=>S==="top"||S==="bottom"?{x:m.x+w,y:m.y}:{x:m.x,y:m.y+w},"applyPortOffset"),nt=d((m,S,w)=>{const T=A.get(m),N={x:w.x??0,y:w.y??0},D={x:S.x??0,y:S.y??0},W=(T==null?void 0:T.srcSide)??E(S,N),ot=(T==null?void 0:T.dstSide)??E(w,D);let U=T?M(S,T.srcSide):u(S,N,!0),z=T?M(w,T.dstSide):u(w,D,!1);const bt=tt.get(`${m}:src`),dt=tt.get(`${m}:dst`);return bt!==void 0&&(U=Ft(U,W,bt)),dt!==void 0&&(z=Ft(z,ot,dt)),{pSrcPort:U,pDstPort:z,srcSide:W,dstSide:ot}},"portsForEdge");for(const m of v){const S=s[m];if(l[m]=[],!S.start||!S.end||S.points&&S.points.length>0||S.start===S.end)continue;const w=r.get(S.start),T=r.get(S.end);if(!w||!T)continue;const{pSrcPort:N,pDstPort:D,srcSide:W,dstSide:ot}=nt(m,w,T),U={...N},z={...D},bt=W==="top"||W==="bottom",dt=ot==="top"||ot==="bottom";if(bt){const X=N.y>(w.y??0);U.y=X?N.y+ie:N.y-ie}else{const X=N.x>(w.x??0);U.x=X?N.x+ie:N.x-ie}if(dt){const X=D.y>(T.y??0);z.y=X?D.y+ie:D.y-ie}else{const X=D.x>(T.x??0);z.x=X?D.x+ie:D.x-ie}const ct=d((X,$)=>{for(const Q of g)if(!$.includes(Q.nodeId)&&X.x>Q.minX&&X.xQ.minY&&X.y{if(Tt){const kt=X.y>($.y??0);return{x:(Q.x??0)>=X.x?ht.maxX+Ce:ht.minX-Ce,y:kt?ht.maxY+Ne:ht.minY-Ne,leavesPositiveSide:kt}}const Ct=X.x>($.x??0),Rt=(Q.y??0)>=X.y;return{x:Ct?ht.maxX+Ce:ht.minX-Ce,y:Rt?ht.maxY+Ne:ht.minY-Ne,leavesPositiveSide:Ct}},"obstacleDetour");let It=[];const Bt=[S.start,S.end],At=ct(U,Bt);if(At.inside&&At.obstacle){const X=At.obstacle;if(bt){const $=st(N,w,T,X,!0);U.x=$.x,U.y=$.y;const Q=$.leavesPositiveSide?Math.min(X.minY-2,N.y+ie):Math.max(X.maxY+2,N.y-ie);It=[{x:N.x,y:Q},{x:$.x,y:Q},{x:$.x,y:$.y}]}else{const $=st(N,w,T,X,!1),Q=$.leavesPositiveSide?Math.min(X.minX-2,N.x+ie):Math.max(X.maxX+2,N.x-ie);U.x=$.x,U.y=$.y,It=[{x:Q,y:N.y},{x:Q,y:$.y},{x:$.x,y:$.y}]}}let Gt=[];const ee=ct(z,Bt);if(ee.inside&&ee.obstacle){const X=ee.obstacle;if(dt){const $=st(D,T,w,X,!0);z.x=$.x,z.y=$.y,Gt=[{x:$.x,y:$.y},{x:D.x,y:$.y}]}else{const $=st(D,T,w,X,!1);z.x=$.x,z.y=$.y,Gt=[{x:$.x,y:$.y},{x:$.x,y:D.y}]}}if(It.length===0&&Gt.length===0){const X=Ce,$=Math.abs(U.x-z.x)1||Ct>1,kt=I.get(S.start??"")??0,mt=I.get(S.end??"")??0,Vt=Tt>1&&Ht(S.start,W)||Ct>1&&Ht(S.end,ot),re=Tt<=1||kt<=2,Dt=Ct<=1||mt<=2;if(($||Q)&&!ht&&(!Rt||Rt&&!Vt&&re&&Dt)&&!L(N,D,S.start,S.end)){S.points=[{...N},{...U},{...z},{...D}],x.add(m);const vt=Q?"horizontal":"vertical",Ut=Q?N.y:N.x,Lt=Q?Math.min(N.x,D.x):Math.min(N.y,D.y),Et=Q?Math.max(N.x,D.x):Math.max(N.y,D.y),Zt={id:`fast-path-${vt}-${Ut.toFixed(0)}-${m}`,orientation:vt,coord:Ut,spanMin:Lt,spanMax:Et,tracks:[]};h.push({edgeIndex:m,segmentIndex:0,orientation:vt,pipe:Zt,trackIndex:0,from:Lt,to:Et});continue}}const xn=p("vertical",U.x,U.y,U.y);U.x=xn.coord;const Mr=p("vertical",z.x,z.y,z.y);z.x=Mr.coord;let ye=Math.min(U.x,z.x)-50,pe=Math.max(U.x,z.x)+50,we=Math.min(U.y,z.y)-50,Ae=Math.max(U.y,z.y)+50;for(const X of g){const $=Math.min(U.x,z.x),Q=Math.max(U.x,z.x),ht=Math.min(U.y,z.y),Tt=Math.max(U.y,z.y);X.minX$&&X.minYht&&(ye=Math.min(ye,X.minX-qe),pe=Math.max(pe,X.maxX+qe),we=Math.min(we,X.minY-qe),Ae=Math.max(Ae,X.maxY+qe))}for(const X of g){if(X.maxXpe||X.maxYAe)continue;const $=Ce;p("horizontal",X.minY-$,ye,pe),p("horizontal",X.maxY+$,ye,pe);const Q=Ne;p("vertical",X.minX-Q,we,Ae),p("vertical",X.maxX+Q,we,Ae)}p("horizontal",U.y,ye,pe),p("horizontal",z.y,ye,pe);const Ir=a.filter(X=>X.orientation==="horizontal"&&X.coord>=we&&X.coord<=Ae),Sr=a.filter(X=>X.orientation==="vertical"&&X.coord>=ye&&X.coord<=pe),He=d((X,$)=>`${X.toFixed(1)},${$.toFixed(1)}`,"getKey"),Xe=He(U.x,U.y),wo=He(z.x,z.y),Ye=new Map,bn=new Map,Mn=new Map,Ge=new Set,Se=[];Ye.set(Xe,0),Mn.set(Xe,"n"),Se.push({key:Xe,f:Math.hypot(z.x-U.x,z.y-U.y),pt:U}),Ge.add(Xe);let $t=[];const xe=d((X,$)=>L(X,$,S.start,S.end),"checkSegmentBlocked"),In={x:z.x,y:U.y},Cr=xe(U,In),vr=xe(In,z),Lr=Cr||vr,Sn={x:U.x,y:z.y},Er=xe(U,Sn),Tr=xe(Sn,z);if(Lr?Er||Tr||(Math.abs(U.x-z.x)0;){Se.sort((mt,Vt)=>mt.f-Vt.f);const X=Se.shift();if(Ge.delete(X.key),X.key===wo){let mt=wo,Vt=z;for($t=[Vt];bn.has(mt);){const re=bn.get(mt);$t.unshift(re),Vt=re,mt=He(re.x,re.y)}break}const $=X.pt.x,Q=X.pt.y,ht=Sr.sort((mt,Vt)=>mt.coord-Vt.coord),Tt=ht.findIndex(mt=>Math.abs(mt.coord-$)<1),Ct=Ir.sort((mt,Vt)=>mt.coord-Vt.coord),Rt=Ct.findIndex(mt=>Math.abs(mt.coord-Q)<1),kt=[];Tt>0&&kt.push({x:ht[Tt-1].coord,y:Q}),Tt>=0&&Tt0&&kt.push({x:$,y:Ct[Rt-1].coord}),Rt>=0&&Rtne.nodeId===S.start||ne.nodeId===S.end?!1:Vt!==re?ne.minYQ&&ne.maxX>Vt&&ne.minX$&&ne.maxY>Dt&&ne.minY10&&Cn<-5||Re<-10&&Cn>5)&&(Et=Math.abs(Cn)*100),(Zt>10&&$e<-5||Zt<-10&&$e>5)&&(Et+=Math.abs($e)*50);let Ao=0;const Ro=Mn.get(X.key)??"n",No=Math.abs($e)>lt?"h":"v";Ro!=="n"&&Ro!==No&&(Ao=50);const wr=Ut+Lt+Et+Ao,ze=(Ye.get(X.key)??1/0)+wr,Oo=Math.abs(z.x-mt.x)+Math.abs(z.y-mt.y);if(ze<(Ye.get(vt)??1/0))if(bn.set(vt,X.pt),Ye.set(vt,ze),Mn.set(vt,No),!Ge.has(vt))Se.push({key:vt,f:ze+Oo,pt:mt}),Ge.add(vt);else{const ne=Se.findIndex(Ar=>Ar.key===vt);ne!==-1&&(Se[ne].f=ze+Oo)}}}if($t.length===0&&($t=[U,{x:U.x,y:z.y},z]),$t.length>4){const X=$t[0],$=$t[$t.length-1];let Q=Math.min(X.x,$.x),ht=Math.max(X.x,$.x),Tt=Math.min(X.y,$.y),Ct=Math.max(X.y,$.y);for(const Dt of $t)Q=Math.min(Q,Dt.x),ht=Math.max(ht,Dt.x),Tt=Math.min(Tt,Dt.y),Ct=Math.max(Ct,Dt.y);const Rt=ht>Math.max(X.x,$.x),kt=QLt.minXjt&&Lt.minY_t);if(Ut.length>0){let Lt=Math.max(X.x,$.x);for(const Et of Ut){const Zt=(Et.minX+Et.maxX)/2;if(Et.visualXHalfExtent===void 0||isNaN(Et.visualXHalfExtent))continue;const Re=Zt+Et.visualXHalfExtent+Dt;Lt=Math.max(Lt,Re)}isNaN(Lt)||(ht=Lt)}}if(kt){const jt=g.filter(_t=>_t.minXMath.min(X.y,$.y));if(jt.length>0){let _t=Math.min(X.x,$.x);for(const vt of jt){const Lt=(vt.minX+vt.maxX)/2-vt.visualXHalfExtent-Dt;_t=Math.min(_t,Lt)}Q=_t}}}const mt=d(Dt=>{const jt=$.y>X.y,_t=g.filter(Lt=>{const Et=Math.min(X.x,$.x)Lt.minX,Zt=Math.min(X.y,$.y)Lt.minY;return Et&&Zt});let vt=_t;if(c&&_t.length>0){const Lt=_t.filter(Et=>Et.minXDt);Lt.length>0&&(vt=Lt)}if(vt.length===0)return $.y;const Ut=Ce;if(jt){const Et=Math.max(...vt.map(Zt=>Zt.maxY))+Ut;if(Et<$.y-lt)return Et}else{const Et=Math.min(...vt.map(Zt=>Zt.minY))-Ut;if(Et>$.y+lt)return Et}return $.y},"findBestReturnY"),Vt=d(Dt=>{const jt=mt(Dt),_t={x:Dt,y:X.y},vt={x:Dt,y:jt},Ut={x:$.x,y:jt},Lt=xe(X,_t),Et=xe(_t,vt),Zt=xe(vt,Ut),Re=jt!==$.y?xe(Ut,$):!1;return!Lt&&!Et&&!Zt&&!Re?Math.abs(jt-$.y)=3){const X=zt[zt.length-1],$=zt[zt.length-2],Q=zt[zt.length-3],ht=Math.abs(Q.y-$.y)Math.abs(X.x-Q.x)&&zt.splice(-2,1)}else if(Tt){const Ct=Math.sign($.y-Q.y),Rt=Math.sign(X.y-Q.y);Ct!==0&&Ct===Rt&&Math.abs($.y-Q.y)>Math.abs(X.y-Q.y)&&zt.splice(-2,1)}}const fe=[zt[0]];for(let X=1;X$.x,Ct=ht.x>Q.x;if(Tt!==Ct){fe.push(Q);continue}continue}if(Math.abs($.x-Q.x)$.y,Ct=ht.y>Q.y;if(Tt!==Ct){fe.push(Q);continue}continue}fe.push(Q)}fe.push(zt[zt.length-1]);for(let X=0;Xm.from{const N=!T.segments.some(W=>(W.edgeIndex!==S.edgeIndex||W.segmentIndex!==S.segmentIndex)&&J(W,m)),D=!w.segments.some(W=>(W.edgeIndex!==m.edgeIndex||W.segmentIndex!==m.segmentIndex)&&J(W,S));return N&&D?(m.trackIndex=T.index,S.trackIndex=w.index,w.segments=[...w.segments.filter(W=>W.edgeIndex!==m.edgeIndex||W.segmentIndex!==m.segmentIndex),{edgeIndex:S.edgeIndex,segmentIndex:S.segmentIndex,from:S.from,to:S.to}],T.segments=[...T.segments.filter(W=>W.edgeIndex!==S.edgeIndex||W.segmentIndex!==S.segmentIndex),{edgeIndex:m.edgeIndex,segmentIndex:m.segmentIndex,from:m.from,to:m.to}],!0):!1},"trySwapSegmentsAcrossTracks"),ut=d(m=>{const S=m.tracks.length;return m.tracks[S]={index:S,coord:m.coord,segments:[]},S},"createNewTrack"),pt=d((m,S)=>{const w=m.pipe.tracks[m.trackIndex];w.segments=w.segments.filter(N=>N.edgeIndex!==m.edgeIndex||N.segmentIndex!==m.segmentIndex),m.trackIndex=S,m.pipe.tracks[S].segments.push({edgeIndex:m.edgeIndex,segmentIndex:m.segmentIndex,from:m.from,to:m.to})},"moveSegmentToTrack"),St=d((m,S)=>{const w=l[m.edgeIndex];for(const T of w){const N=h[T];N.pipe===m.pipe&&pt(N,S)}},"moveSegmentChainToTrack"),wt=d(m=>{const S=l[m.edgeIndex],w=S.indexOf(h.indexOf(m)),T=[];return w>0&&T.push(h[S[w-1]]),w{if(m.orientation===S.orientation)return!1;const w=m.orientation==="horizontal"?m:S,T=m.orientation==="horizontal"?S:m;return T.pipe.coord>w.from&&T.pipe.coordT.from&&w.pipe.coord{for(const w of m.tracks)if(!w.segments.some(N=>(N.edgeIndex!==S.edgeIndex||N.segmentIndex!==S.segmentIndex)&&J(N,S)))return w.index;return-1},"findAvailableTrack"),Jt=d((m,S)=>{if(m.trackIndex===S.trackIndex)return J(m,S);const w=wt(m),T=wt(S);return w.some(N=>T.some(D=>Kt(N,D)))},"segmentsConflict"),se=d((m,S,w)=>{if(rt(m,S,m.pipe.tracks[m.trackIndex],S.pipe.tracks[S.trackIndex]))return;const T=qt(m.pipe,S);w(S,T!==-1?T:ut(m.pipe))},"resolveTrackConflict"),Ee=d(m=>{let S=0;for(let w=0;w{if(me.has(m))return me.get(m);const S=l[m];if(S.length===0){const ot={dest:0,deviation:0,base:0,delta:0};return me.set(m,ot),ot}const T=h[S[0]].pipe.coord;let N=T;for(let ot=1;otMath.abs(bt-T)?z:bt;break}}const D=Math.abs(N-T),W={dest:N,deviation:D,base:T,delta:N-T};return me.set(m,W),W},"getDestInfo"),mn=d(()=>{let m=0;const S=new Map;for(const[T,N]of s.entries())l[T].length!==0&&N.start&&(S.has(N.start)||S.set(N.start,[]),S.get(N.start).push(T));const w=d(T=>{const N=s[T];if(!N.start||!N.end)return 0;const D=r.get(N.start),W=r.get(N.end);if(!D||!W)return 0;const ot=(W.x??0)-(D.x??0),U=(W.y??0)-(D.y??0);return Math.abs(ot)+Math.abs(U)},"getEdgeDistance");for(const T of S.values()){T.sort((D,W)=>{const ot=Te(D),U=Te(W);if(Math.abs(ot.deviation-U.deviation)>1)return ot.deviation-U.deviation;if(Math.abs(ot.dest-U.dest)>1)return ot.dest-U.dest;const z=w(D),bt=w(W);if(Math.abs(z-bt)>1)return bt-z;const dt=l[D].length,ct=l[W].length;if(dt!==ct)return dt-ct;if(dt===1){const st=l[D][0],It=l[W][0];if(h[st]&&h[It]){const Bt=h[st],At=h[It],Gt=Math.abs(Bt.to-Bt.from),ee=Math.abs(At.to-At.from);if(Math.abs(Gt-ee)>1)return Gt-ee}}return 0});const N=T.map(D=>h[l[D][0]]);m+=Ee(N)}return m},"fixSourceHandleCrossings"),yn=d(()=>{let m=0;const S=new Map;for(const[w,T]of s.entries())l[w].length!==0&&T.end&&(S.has(T.end)||S.set(T.end,[]),S.get(T.end).push(w));for(const w of S.values()){w.sort((N,D)=>{const W=d(z=>{const bt=l[z];if(bt.length<2)return 0;const dt=h[bt[bt.length-2]];return Math.abs(dt.to-dt.from)},"getDist"),ot=W(N),U=W(D);return Math.abs(ot-U)>.1?ot-U:N-D});const T=w.map(N=>h[l[N][l[N].length-1]]);m+=Ee(T)}return m},"fixTargetHandleCrossings"),pn=d(()=>{let m=0;for(const S of a){const w=[];for(const T of S.tracks)for(const N of T.segments){const D=l[N.edgeIndex].find(W=>h[W].segmentIndex===N.segmentIndex);D!==void 0&&w.push(h[D])}w.sort((T,N)=>T.edgeIndex-N.edgeIndex||T.segmentIndex-N.segmentIndex);for(let T=0;T{T.segments.forEach(N=>{S.push({edgeIndex:N.edgeIndex,segmentIndex:N.segmentIndex,trackIndex:T.index,from:N.from,to:N.to})})}),S.sort((T,N)=>T.from-N.from);const w=[];if(S.length>0){let T=[S[0]],N=S[0].to;for(let D=1;DN.add(st.trackIndex));const D=new Map;T.forEach(st=>{const It=Te(st.edgeIndex);D.set(st.trackIndex,(D.get(st.trackIndex)??0)+It.delta)});const W=[...N].filter(st=>(D.get(st)??0)<-1),ot=[...N].filter(st=>(D.get(st)??0)>1),U=[...N].filter(st=>Math.abs(D.get(st)??0)<=1);W.sort((st,It)=>(D.get(It)??0)-(D.get(st)??0)),ot.sort((st,It)=>(D.get(st)??0)-(D.get(It)??0));const z=d((st,It)=>{T.filter(Bt=>Bt.trackIndex===st).forEach(Bt=>{const At=x.has(Bt.edgeIndex)?m.coord:It;F.set(`${Bt.edgeIndex}-${Bt.segmentIndex}`,At)})},"assignCoord");let bt=0;for(const st of W)bt++,z(st,m.coord-bt*Tn);if(U.length===0&&N.size>0){const st=[...N].sort((At,Gt)=>Math.abs(D.get(At)??0)-Math.abs(D.get(Gt)??0))[0],It=W.indexOf(st);It!==-1&&W.splice(It,1);const Bt=ot.indexOf(st);Bt!==-1&&ot.splice(Bt,1),U.push(st)}let dt=0;for(const st of U){if(dt===0)z(st,m.coord);else{const It=dt%2===1?1:-1,Bt=Math.ceil(dt/2);z(st,m.coord+It*Bt*Tn*.5)}dt++}let ct=0;for(const st of ot)ct++,z(st,m.coord+ct*Tn)}}for(const[m,S]of s.entries()){const w=l[m]??[];if(w.length===0)continue;const T=[],N=r.get(S.start),D=r.get(S.end),{pSrcPort:W,pDstPort:ot}=nt(m,N,D),U=w.map(dt=>{const ct=h[dt],st=F.get(`${ct.edgeIndex}-${ct.segmentIndex}`)??ct.pipe.coord;return{orient:ct.orientation,coord:st,from:ct.from,to:ct.to}});T.push(W);for(let dt=0;dtlt&&T.push(ve(ct,It)),Gt&&At.orient===ct.orient)if(Math.abs(ct.coord-At.coord)>lt){const ee=ct.orient==="vertical"?(It+At.from)/2:io(ct,At);T.push(ve(ct,ee),ve(At,ee))}else(dt===0||dt===U.length-2)&&T.push(ve(ct,io(ct,At)));else if(Gt)T.push(ve(ct,At.coord));else{const ee=Math.abs(ct.from-It)lt||Math.abs(z.y-ot.y)>lt)&&T.push(ot);const bt=[];T.length>0&&bt.push(T[0]);for(let dt=1;dtlt||Math.abs(ct.y-st.y)>lt)&&bt.push(ct)}S.points=bt}for(const m of s){const S=m.__originalEdge;S&&m.points&&(S.points=m.points)}t.edges=(t.edges??[]).filter(m=>!m.isLayoutOnly);const V=d((m,S)=>{const w=S.x??0,T=S.y??0,N=S.width??0,D=S.height??0;if(N<=0||D<=0)return m;const W=w-N/2,ot=w+N/2,U=T-D/2,z=T+D/2;if(m.xot||m.yz)return m;const bt=m.x-W,dt=ot-m.x,ct=m.y-U,st=z-m.y,It=Math.min(bt,dt,ct,st);return It===bt?{x:W,y:m.y}:It===dt?{x:ot,y:m.y}:It===ct?{x:m.x,y:U}:{x:m.x,y:z}},"nodeBoundaryClamp");for(const m of t.edges){const S=m.points;if(!S||S.length<2)continue;const w=m.start,T=m.end,N=w?r.get(w):void 0,D=T?r.get(T):void 0;N&&(S[0]=V(S[0],N)),D&&(S[S.length-1]=V(S[S.length-1],D))}return t}d(pr,"routeEdgesOrthogonal");function xr(t){return t.direction??"TB"}d(xr,"getSwimlaneDirection");function br(t){var g,p,M,u,h;const e=es(t),n=((g=t.config.flowchart)==null?void 0:g.nodeSpacing)??40,o=((p=t.config.flowchart)==null?void 0:p.rankSpacing)??100,s=((M=t.config.swimlane)==null?void 0:M.ignoreCrossLaneEdges)??!0,r=((u=t.config.swimlane)==null?void 0:u.optimizeRanksByCrossings)??!0,i=((h=t.config.swimlane)==null?void 0:h.automaticLaneOrdering)??!1,a=xr(t),{ordered:c,coordinates:f}=yr(e,{nodeGap:n,layerGap:o,ignoreCrossLaneEdges:s,optimizeRanksByCrossings:r,automaticLaneOrdering:i,direction:a});ns(e,c,f,{nodeGap:n,layerGap:o});for(const l of t.edges??[])delete l.points;pr(t,a);for(const l of t.edges??[])(!l.curve||l.curve==="basis")&&(l.curve="rounded");return Bs(t,a),Ps(t),a}d(br,"runSwimlaneLayoutCore");async function oi(t,e){const n=e.select("g");Or(n,t.markers,t.type,t.diagramId),Pr(),Br(),kr(),Nr(),ts(t);const o=os(t);t.nodes=o.nodes,t.edges=o.edges;const{groups:s}=await Xo(n,t);br(t),await Jo(t,s)}d(oi,"render");export{oi as render}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/visualizations/mermaid/sizeCapture-X5ZJPWSS-CNj0yAkQ.js","assets/visualizations/mermaid/mermaid.core-DAx4nvmm.js","assets/app/index-8JtvDNuA.js","assets/styles/index-_lutWX9f.css","assets/chunks/purify.es-BnINGy_Y.js"])))=>i.map(i=>d[i]); +import{_ as Rr}from"../../app/index-8JtvDNuA.js";import{c as Nr}from"./chunk-RYQCIY6F-C3ekePUg.js";import{aw as Or,v as Pr,t as Br,u as kr,at as Qe,Y as _r,ag as Fr,ad as Dr,aG as Hr,ae as Xr,af as Yr,X as Gr,a6 as $r,P as zr,b9 as _e,b2 as Ve,a as d,av as Po}from"./mermaid.core-DAx4nvmm.js";import{G as Vr}from"../../chunks/graph-Dqkl27Ch.js";import"../../chunks/map-8WAJQ6ap.js";import"../../chunks/purify.es-BnINGy_Y.js";async function Xo(t,e){const n=new Vr({multigraph:!0,compound:!0}),o=[...e.edges],s=_r(),r=t.insert("g").attr("class","root"),i=r.insert("g").attr("class","clusters"),a=r.insert("g").attr("class","edges edgePath"),c=r.insert("g").attr("class","edgeLabels"),f=r.insert("g").attr("class","nodes"),g=new Map,p=t.node()!=null;await Promise.all(e.nodes.map(async M=>{var u;if(M.isGroup)n.setNode(M.id,{...M});else{if(p){const h=await Fr(f,M,{config:s,dir:M.dir}),l=((u=h.node())==null?void 0:u.getBBox())??{width:0,height:0};g.set(M.id,h),M.width=l.width,M.height=l.height}n.setNode(M.id,{...M})}}));for(const M of o)n.setEdge(M.start,M.end,{...M},M.id),e.edges.some(h=>h.id===M.id)||e.edges.push(M);if(globalThis.mermaidCaptureSizes){const{captureNodeSizes:M}=await Rr(async()=>{const{captureNodeSizes:u}=await import("./sizeCapture-X5ZJPWSS-CNj0yAkQ.js");return{captureNodeSizes:u}},__vite__mapDeps([0,1,2,3,4]));M(t,e)}return{graph:n,groups:{clusters:i,edgePaths:a,edgeLabels:c,nodes:f,rootGroups:r},nodeElements:g}}d(Xo,"createGraphWithElements");var Bo=5,je=1e-5,Ue=1e-6;function tn(t){const e=[];for(let n=0;n=1-Ue||M<=Ue||M>=1-Ue?null:{point:{x:t.x+p*s,y:t.y+p*r},tA:p,tB:M}}d(Yo,"segmentIntersection");function wn(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}d(wn,"isHorizontalSeg");function Go(t){const e=[];for(let n=0;n=Math.abs(n)?e>=0?1:0:n>=0?1:0}d($o,"getArcSweepFlag");var jr=.001;function zo(t,e){if(t.length<2)return t.map(r=>({...r}));const n=t.map(r=>({...r})),o=e.arrowTypeStart&&Po[e.arrowTypeStart];if(o){const r=t[0],i=t[1],a=Math.atan2(i.y-r.y,i.x-r.x);n[0].x=r.x+o*Math.cos(a),n[0].y=r.y+o*Math.sin(a)}const s=e.arrowTypeEnd&&Po[e.arrowTypeEnd];if(s){const r=t.length,i=t[r-2],a=t[r-1],c=Math.atan2(a.y-i.y,a.x-i.x);n[r-1].x=a.x-s*Math.cos(c),n[r-1].y=a.y-s*Math.sin(c)}return n}d(zo,"applyMarkerOffsets");function Vo(t,e,n,o,s){const r=t.point.x,i=t.point.y,a={x:r-e*t.r,y:i-n*t.r},c={x:r+e*t.r,y:i+n*t.r},f=[`L${Oe(a)}`];return s==="arc"?f.push(`A${le(t.r)},${le(t.r)} 0 0 ${o} ${Oe(c)}`):f.push(`M${Oe(c)}`),f}d(Vo,"emitJump");function An(t,e,n,o){const s=e.x-t.x,r=e.y-t.y,i=n.x-e.x,a=n.y-e.y,c=Math.hypot(s,r),f=Math.hypot(i,a);if(c0){const v=An(s[f-1],s[f],s[f+1]??s[f],Bo);v&&(l=v.cutLen)}let x=p,C=null;r&&fv.t-L.t);for(const v of b)v.r=Math.min(v.r,v.d-l,x-v.d);for(let v=0;vL){const y=L/2;b[v].r=Math.min(b[v].r,y),b[v+1].r=Math.min(b[v+1].r,y)}}for(const v of b)v.r=2?o:null}catch{return null}}d(Ko,"decodeDataPoints");function qo(t,e,n){if(!n.enabled)return;const o=t.node();if(!o)return;const s=new Map;for(const f of e)s.set(f.id,f);const r=[],i=new Map;for(const f of e){const g=typeof CSS<"u"&&CSS.escape?CSS.escape(f.id):f.id,p=o.querySelector(`path[data-id="${g}"]`);if(!p)continue;i.set(f.id,p);const u=Ko(p.getAttribute("data-points"))??f.points;r.push({...f,points:u})}const a=Go(r);if(a.length===0)return;const c=new Map;for(const f of a){const g=c.get(f.jumpEdgeId)??[];g.push(f),c.set(f.jumpEdgeId,g)}for(const f of r){const g=c.get(f.id);if(!g||g.length===0)continue;const p=s.get(f.id),M=p==null?void 0:p.curve;if(M!==void 0&&!Wo(M))continue;const u=i.get(f.id);if(!u)continue;if(M===void 0){const v=u.getAttribute("d")??"";if(!Uo(v))continue}const h=u.getAttribute("style")??"",l=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(h),x=l?Number.parseFloat(l[1]):null,C=l?Number.parseFloat(l[2]):null,b=jo(f,g,n);if(u.setAttribute("d",b),x!==null&&C!==null&&typeof u.getTotalLength=="function"){const v=u.getTotalLength(),L=Math.max(0,v-x-C),y=`0 ${x} ${L} ${C}`,I=h.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${y};`).replace(/;\s*;+/g,";");u.setAttribute("style",I)}}}d(qo,"applyLineJumpsToSvg");async function Jo(t,e){var s,r;for(const i of t.nodes)i.isGroup?await Dr(e.clusters,i):Hr(i);const n=new Map;for(const i of t.nodes)i!=null&&i.id&&n.set(i.id,i);for(const i of t.edges){const a=i.start?n.get(i.start)??{}:{},c=i.end?n.get(i.end)??{}:{},f=Xr(e.edgePaths,{...i},{},t.type,a,c,t.diagramId);i.label&&await Yr(e.rootGroups,i),i.label&&Zo(i,f)}const o=(r=(s=t.config)==null?void 0:s.swimlane)==null?void 0:r.lineHops;if(o!==!1){const i=o==="gap"?"gap":"arc",a=t.edges.filter(c=>Array.isArray(c.points)&&c.points.length>=2).map(c=>({id:c.id,points:c.points,curve:c.curve,arrowTypeStart:c.arrowTypeStart,arrowTypeEnd:c.arrowTypeEnd}));qo(e.edgePaths,a,{enabled:!0,jumpRadius:6,jumpStyle:i})}}d(Jo,"adjustLayout");function Zo(t,e){const n=(e==null?void 0:e.updatedPath)??(e==null?void 0:e.originalPath),o=Gr(),{subGraphTitleTotalMargin:s}=$r({flowchart:o.flowchart??{}});if(t.label){const r=zr.get(t.id);let i=t.x,a=t.y;if(n){const c=_e.calcLabelPosition(n);Qe.debug("Moving label "+t.label+" from (",i,",",a,") to (",c.x,",",c.y,") abc88"),e&&(i=c.x,a=c.y)}r.attr("transform",`translate(${i}, ${a+s/2})`)}if(t!=null&&t.startLabelLeft){const r=Ve.get(t.id).startLeft;let i=t==null?void 0:t.x,a=t==null?void 0:t.y;if(n){const c=_e.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",n);i=c.x,a=c.y}r.attr("transform",`translate(${i}, ${a})`)}if(t.startLabelRight){const r=Ve.get(t.id).startRight;let i=t.x,a=t.y;if(n){const c=_e.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",n);i=c.x,a=c.y}r.attr("transform",`translate(${i}, ${a})`)}if(t.endLabelLeft){const r=Ve.get(t.id).endLeft;let i=t.x,a=t.y;if(n){const c=_e.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",n);i=c.x,a=c.y}r.attr("transform",`translate(${i}, ${a})`)}if(t.endLabelRight){const r=Ve.get(t.id).endRight;let i=t.x,a=t.y;if(n){const c=_e.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",n);i=c.x,a=c.y}r.attr("transform",`translate(${i}, ${a})`)}}d(Zo,"positionEdgeLabel");var vn="__swimlane_default__",Ur=21,ko=20;function Rn(t){return Math.max(t.padding??ko,ko)}d(Rn,"topLaneHorizontalPadding");function Qo(t){const{x:e,y:n,width:o,height:s}=t,r=t.swimlaneContentTop;if(typeof e!="number"||typeof n!="number"||typeof o!="number"||typeof s!="number"||typeof r!="number"||!Number.isFinite(e)||!Number.isFinite(n)||!Number.isFinite(o)||!Number.isFinite(s)||!Number.isFinite(r)||o<=0||s<=0){delete t.groupTitleRect;return}const i=n-s/2,a=Math.min(r,n+s/2),c=Math.min(Ur,Math.max(0,a-i)),f=i+c;if(f<=i){delete t.groupTitleRect;return}t.groupTitleRect={left:e-o/2,right:e+o/2,top:i,bottom:f}}d(Qo,"assignTopLaneTitleRect");function ts(t){const e=t.direction,n=t.nodes??(t.nodes=[]);for(const r of t.nodes??[])r.isGroup&&!r.parentId&&(r.shape="swimlane",e&&(r.direction=e));const o=n.filter(r=>!r.isGroup&&!r.parentId);if(o.length===0)return;let s=n.find(r=>r.id===vn);s?s.isGroup&&(s.shape="swimlane",e&&(s.direction=e)):(s={id:vn,label:"",isGroup:!0,shape:"swimlane",padding:20,...e?{direction:e}:{}},n.push(s));for(const r of o)r.parentId=vn}d(ts,"prepareLayoutForSwimlanes");function es(t){const e=new Map;for(const c of t.nodes??[])e.set(c.id,c);const n=[];for(const c of t.edges??[]){const f=typeof c.start=="string"?c.start:void 0,g=typeof c.end=="string"?c.end:void 0;!f||!g||c.labelNodeId||n.push({id:c.id,src:f,dst:g,ref:c})}const o=t.nodes??[],s=o.filter(c=>c.isGroup),r=o.filter(c=>!c.isGroup);return{nodes:[...[...s].reverse(),...r].map(c=>c.id),edges:n,layout:t,nodeById:e}}d(es,"toGraphView");function ns(t,e,n,o){const{layout:s}=t,r=t.nodeById,i=(o==null?void 0:o.layerGap)??100,a=(o==null?void 0:o.nodeGap)??40;let c=0;for(const M of e.layers){let u=0;for(const h of M){const l=r.get(h);if(!l){u++;continue}l.layer=c,l.order=u;const x=n.x[h]??u*a,C=n.y[h]??c*i;l.x=x,l.y=C,u++}c++}const f=s.nodes??[],g=new Map,p=[];for(const M of f){if(!(M!=null&&M.isGroup))continue;M.parentId||p.push(M);const u=f.filter(b=>b.parentId===M.id);let h=1/0,l=-1/0,x=1/0,C=-1/0;for(const b of u){const v=b.x??n.x[b.id],L=b.y??n.y[b.id],y=b.width??0,I=b.height??0;v!=null&&L!=null&&(h=Math.min(h,v-y/2),l=Math.max(l,v+y/2),x=Math.min(x,L-I/2),C=Math.max(C,L+I/2))}if(h===1/0||x===1/0)M.x=M.x??0,M.y=M.y??0,M.width=M.width??0,M.height=M.height??0;else{const b=M.padding??20,v=M.parentId?b:2*Rn(M),L=b,y=Math.max(0,l-h)+v,I=Math.max(0,C-x)+L,E=(h+l)/2,A=(x+C)/2;M.x=E,M.y=A,M.width=y,M.height=I,g.set(M.id,{minX:h,maxX:l,minY:x,maxY:C})}}if(p.length>0&&g.size>0){let M=1/0,u=-1/0,h=0;for(const l of p){const x=l.padding??20;x>h&&(h=x);const C=g.get(l.id);C&&(M=Math.min(M,C.minY),u=Math.max(u,C.maxY))}if(M!==1/0&&u!==-1/0){const l=Math.max(0,u-M),C=Math.max(h,36),b=l+2*C,v=(M+u)/2;for(const B of p)B.y=v,B.height=b,B.swimlaneContentTop=M;const L=[...p].sort((B,O)=>{const k=B.x??0,H=O.x??0;return k-H}),y=[],I=[],E=[];for(const B of L){const O=g.get(B.id);if(!O)continue;const k=Math.max(0,O.maxX-O.minX)+2*Rn(B),H=(O.minX+O.maxX)/2;y.push(B.id),I.push(H),E.push(k)}const A=y.length;if(A>0){const B=new Map;if(A===1)B.set(y[0],E[0]);else{const O=[];for(let j=0;j0&&s>0?{cx:e,cy:n,rect:Pe(e,n,o,s)}:void 0}d(co,"measuredNodeRect");function ao(t){if(t.isGroup)return;const e=co(t);return e?{id:String(t.id??""),cx:e.cx,cy:e.cy,rect:e.rect}:void 0}d(ao,"nodeBoundsInfoFor");function ce(t,e,n=Yt){return Math.abs(t.x-e.x)n}d(Nt,"isHorizontalSegment");function Ot(t,e,n=Yt){return gt(t,e,n)&&Math.abs(t.y-e.y)>n}d(Ot,"isVerticalSegment");function Wt(t,e,n,o){return Math.max(0,Math.min(Math.max(t,e),Math.max(n,o))-Math.max(Math.min(t,e),Math.min(n,o)))}d(Wt,"overlapLength");function de(t,e,n=Yt){return t.horizontal&&e.horizontal&&yt(t.a,e.a,n)?Wt(t.a.x,t.b.x,e.a.x,e.b.x):t.vertical&&e.vertical&>(t.a,e.a,n)?Wt(t.a.y,t.b.y,e.a.y,e.b.y):0}d(de,"sameAxisSegmentOverlapLength");function Be(t,e=Yt){const n=[];for(let o=0;o0?n[n.length-1]:void 0;(!s||!ce(s,o,e))&&n.push({x:o.x,y:o.y})}return n}d(xt,"dedupeConsecutivePoints");function lo(t,e=Yt){if(!t||t.length!==4)return;const[n,o,s,r]=t;return Nt(n,o,e)&&Ot(o,s,e)&&Nt(s,r,e)?{kind:"HVH",p0:n,p1:o,p2:s,p3:r}:Ot(n,o,e)&&Nt(o,s,e)&&Ot(s,r,e)?{kind:"VHV",p0:n,p1:o,p2:s,p3:r}:void 0}d(lo,"classifyThreeSegmentRoute");function dn(t,e,n,o=0){const s=Math.min(t.x,e.x),r=Math.max(t.x,e.x),i=Math.min(t.y,e.y),a=Math.max(t.y,e.y);return r>n.left-o&&sn.top-o&&ie.left+n&&t.xe.top+n&&t.y=e.right&&t.top<=e.top&&t.bottom>=e.bottom}d(ss,"rectContainsRect");function en(t,e){return t.lefte.left&&t.tope.top}d(en,"rectsOverlap");function Nn(t,e){return{left:t.left-e,right:t.right+e,top:t.top-e,bottom:t.bottom+e}}d(Nn,"inflateRect");function Pe(t,e,n,o){return{left:t-n/2,right:t+n/2,top:e-o/2,bottom:e+o/2}}d(Pe,"rectFromCenterSize");function te(t){var e;return(e=co(t))==null?void 0:e.rect}d(te,"rectOfNodeBounds");function Le(t,e){switch(e){case"top":return{x:t.cx,y:t.rect.top};case"bottom":return{x:t.cx,y:t.rect.bottom};case"left":return{x:t.rect.left,y:t.cy};case"right":return{x:t.rect.right,y:t.cy}}}d(Le,"portForRectSide");function uo(t,e,n,o,s,r=Yt){const i=e==="left"||e==="right",a=o==="left"||o==="right";if(i&&a){if(e==="right"&&o==="left"&&t.xn.x){if(yt(t,n,r))return[t,n];const p=(t.x+n.x)/2;return[t,{x:p,y:t.y},{x:p,y:n.y},n]}if(e===o){if(yt(t,n,r))return;const p=e==="left"?Math.min(t.x,n.x)-s:Math.max(t.x,n.x)+s;return[t,{x:p,y:t.y},{x:p,y:n.y},n]}return}if(!i&&!a){if(e===o){if(gt(t,n,r))return;const M=e==="top"?Math.min(t.y,n.y)-s:Math.max(t.y,n.y)+s;return[t,{x:t.x,y:M},{x:n.x,y:M},n]}if(!(e==="bottom"&&o==="top"&&t.yn.y))return;if(gt(t,n,r))return[t,n];const p=(t.y+n.y)/2;return[t,{x:t.x,y:p},{x:n.x,y:p},n]}if(i&&!a){const g=e==="right"&&n.x>t.x||e==="left"&&n.xn.y;return g&&p?[t,{x:n.x,y:t.y},n]:void 0}const c=e==="bottom"&&n.y>t.y||e==="top"&&n.yn.x;return c&&f?[t,{x:t.x,y:n.y},n]:void 0}d(uo,"buildOrthogonalPortPath");function ho(t,e,n,o){return e==="left"||e==="right"?[t,{x:o,y:t.y},{x:o,y:n.y},n]:[t,{x:t.x,y:o},{x:n.x,y:o},n]}d(ho,"buildSameSideTrackPath");function un(t){const e=new Map,n=[];for(const o of t){if(o.isEdgeLabel)continue;const s=ao(o);s&&(e.set(s.id,s),n.push({id:s.id,rect:s.rect}))}return{nodeInfoById:e,realNodeRects:n}}d(un,"collectRealNodeBounds");function Me(t){const e=[],n=[];for(const o of t){const s=ao(o);if(!s)continue;const r={id:s.id,rect:s.rect};o.isEdgeLabel?n.push(r):e.push(r)}return{realNodeRects:e,labelNodeRects:n}}d(Me,"collectNodeRectEntries");function rs(t,{includeEdgeLabels:e=!0}={}){const n=[];for(const o of t){if(o.isGroup||!e&&o.isEdgeLabel)continue;const s=o.x??0,r=o.y??0,i=o.width??0,a=o.height??0;n.push({nodeId:o.id,...Pe(s,r,i,a)})}return n}d(rs,"collectLayoutNodeRects");function go(t,e,n=Yt){const o=t.start,s=t.end;if(!o||!s)return;const r=e.get(o),i=e.get(s);if(!(!r||!i))return{srcId:o,dstId:s,srcInfo:r,dstInfo:i,collinearX:Math.abs(r.cx-i.cx)h||MC)return!1;const b=Math.abs(l-g.a.x)s:r&&a&&yt(t,n,s)?Wt(t.x,e.x,n.x,o.x)>s:!1}d(is,"sameAxisSegmentsOverlap");function nn(t,e,n,o,{epsilon:s=Yt,skipDegenerateOther:r=!1}={}){for(const i of n){if(i===o||i.isLayoutOnly)continue;const a=i.points;if(!(!a||a.length<2))for(let c=0;cM+s&&hl+s&&po+Yt&&t=2?e[e.length-2]:void 0,c=(i?gt(i,s):!1)?{x:s.x,y:r.y}:{x:r.x,y:s.y};e.push(c)}e.push(r)}const n=[];for(const o of e){const s=n[n.length-1];(!s||!ce(s,o))&&n.push(o)}return n}d(on,"orthogonalizePolyline");function ue(t){if(t.length<3)return t;let e=[...t];for(let n=0;n<32;n++){const o=as(e);if(e=o.points,!o.changed)break}return e}d(ue,"simplifyPolyline");var it=.001,Kr=.5,_o=4;function yo(t,e,n){const o=t;if(o.isLayoutOnly||!o.points||o.points.length=0&&s=t.length)return t;const r=s-o;if(r<0||r>=t.length)return t;const i=ls(t[s],t[r],e);return n?[i,...t.slice(s)]:[...t.slice(0,s+1),i]}d(Pn,"clipEndpoint");function fs(t,e){for(const n of t){const o=yo(n,e,2);if(!o)continue;let s=[...o.points];o.srcRect&&(s=Pn(s,o.srcRect,!0)),o.dstRect&&(s=Pn(s,o.dstRect,!1)),s=ue(on(s)),s=po(s,o.srcRect,o.dstRect),o.edge.points=ue(on(s))}}d(fs,"clipEdgeEndpointsToNodeBoundaries");function Bn(t,e,n,o=!1){if(yt(t,e,it)){if(e.yn.bottom+it)return e;if(o){if(t.xn.right+it)return{x:n.right,y:t.y}}return{x:Math.abs(e.x-n.left)<=Math.abs(e.x-n.right)?n.left:n.right,y:t.y}}if(gt(t,e,it)){if(e.xn.right+it)return e;if(o){if(t.yn.bottom+it)return{x:t.x,y:n.bottom}}const s=Math.abs(e.y-n.top)<=Math.abs(e.y-n.bottom);return{x:t.x,y:s?n.top:n.bottom}}return e}d(Bn,"snapEndpointToBoundary");function sn(t,e,n){const o=t[e];for(let s=e+n;s>=0&&so.lo)),n=Math.min(...t.map(o=>o.hi));if(!(e>n))return{lo:e,hi:n}}d(ds,"intersectRanges");function _n(t,e){return e==="left"||e==="right"?rn(t.top,t.bottom):rn(t.left,t.right)}d(_n,"clearanceRangeForSide");function cn(t,e,n){const o=t.y>=n.top-it&&t.y<=n.bottom+it,s=t.x>=n.left-it&&t.x<=n.right+it;if(yt(t,e,it)&&o){if(Math.abs(t.x-n.left)0?ds(r):void 0}d(us,"straightClearanceRange");function Fn(t,e,n,o,s){const r=us(t,e,n,o,s);if(!r)return;const i=s?t.y:t.x,a=Math.min(r.hi,Math.max(r.lo,i));if(!(Math.abs(a-i)({...a}));for(let a=e;a>=0&&a=n.left-it&&Math.max(t.x,e.x)<=n.right+it,s=Math.min(t.y,e.y)>=n.top-it&&Math.max(t.y,e.y)<=n.bottom+it;if(Math.abs(t.y-n.top)o.bottom+it;case"left":return yt(e,n,it)&&n.xo.right+it}}d(Xn,"leavesOutward");function Yn(t,e,n){if(t.length<3)return t;if(n){const r=Hn(t[0],t[1],e);return r&&Xn(r,t[1],t[2],e)?t.slice(1):t}const o=t.length-1,s=Hn(t[o-1],t[o],e);return s&&Xn(s,t[o-1],t[o-2],e)?t.slice(0,o):t}d(Yn,"collapseOwnBorderStub");function ms(t,e,n){let o=t;if(e){const r=sn(o,0,1);if(r){const i=Bn(r,o[0],e);i!==o[0]&&(o=[i,...o.slice(1)])}o=Yn(o,e,!0)}if(n){const r=o.length-1,i=sn(o,r,-1);if(i){const a=Bn(i,o[r],n,!0);a!==o[r]&&(o=[...o.slice(0,r),a])}o=Yn(o,n,!1)}const s=po(o,e,n);return s!==o||o.length===2?s:(e&&(o=Dn(o,e,!0)),n&&(o=Dn(o,n,!1)),o)}d(ms,"snapAndCollapseEndpoints");function Gn(t,e){for(const n of t){const o=yo(n,e,2);if(!o)continue;const s=xt(o.points,it),r=ms(s,o.srcRect,o.dstRect);if(r.length<3){o.edge.points=r;continue}const i=[r[0],{...r[0]},...r.slice(1,-1),r[r.length-1],{...r[r.length-1]}];o.edge.points=i}}d(Gn,"prepareEdgeEndpointsForRenderer");function xo(t){return new Map(t.map(e=>[e.id,e]))}d(xo,"buildNodeMap");function ys(t,e){let n=t.parentId,o=null;for(;n;){const s=e.get(n);if(!(s!=null&&s.isGroup))break;o=s.id,n=s.parentId}return o}d(ys,"resolveTopLevelGroupId");function $n(t,e){let n=0,o=t.parentId;for(;o;){const s=e.get(o);if(!(s!=null&&s.isGroup))break;n++,o=s.parentId}return n}d($n,"groupDepth");function bo(t){let e=1/0,n=-1/0,o=1/0,s=-1/0;for(const r of t){const i=r.x,a=r.y;if(typeof i!="number"||typeof a!="number")continue;const c=r.width??0,f=r.height??0;e=Math.min(e,i-c/2),n=Math.max(n,i+c/2),o=Math.min(o,a-f/2),s=Math.max(s,a+f/2)}return e===1/0||o===1/0?null:{minX:e,maxX:n,minY:o,maxY:s}}d(bo,"boundsForChildren");function ps(t,e){const n=t.padding??20;t.x=(e.minX+e.maxX)/2,t.y=(e.minY+e.maxY)/2,t.width=Math.max(0,e.maxX-e.minX)+n,t.height=Math.max(0,e.maxY-e.minY)+n}d(ps,"applyGroupBounds");function xs(t){const e=xo(t),n=t.filter(o=>o.isGroup&&o.parentId).sort((o,s)=>$n(s,e)-$n(o,e));for(const o of n){const s=t.filter(i=>i.parentId===o.id),r=bo(s);r&&ps(o,r)}}d(xs,"recomputeNestedGroupBounds");function an(t,e){const n=t.nodes??[],o=t.edges??[],s=n.filter(c=>!c.isGroup);let r=1/0,i=-1/0;for(const c of s){const f=c[e];typeof f=="number"&&(r=Math.min(r,f),i=Math.max(i,f))}if(!Number.isFinite(r)||!Number.isFinite(i))return!1;const a=d(c=>r+i-c,"mirror");for(const c of n){const f=c[e];typeof f=="number"&&(c[e]=a(f));const g=c.groupTitleRect;g&&(c.groupTitleRect=e==="x"?{...g,left:a(g.right),right:a(g.left)}:{...g,top:a(g.bottom),bottom:a(g.top)})}for(const c of o)for(const f of c.points??[])f[e]=a(f[e]);return!0}d(an,"mirrorAxis");function bs(t){return(t.nodes??[]).some(n=>!n.isGroup)?an(t,"y"):!0}d(bs,"applyBtDirectionTransform");function Ms(t,e="LR"){const n=t.nodes??[],o=t.edges??[],s=n.filter(P=>!P.isGroup);let r=1/0,i=1/0;for(const P of s){const G=P.x??0,j=P.y??0;G0?Math.max(1,g/p):1;for(const P of s){const G=P.x??0,tt=((P.y??0)-i)*M+a,ft=G-r;P.x=tt,P.y=ft}for(const P of o)if(P.points)for(const G of P.points){const j=G.x,ft=(G.y-i)*M+a,Mt=j-r;G.x=ft,G.y=Mt}xs(n);const u=n.filter(P=>P.isGroup&&!P.parentId);if(u.length===0)return e==="RL"&&an(t,"x"),!0;const h=xo(n),l=new Map;for(const P of n){if(P.isGroup)continue;const G=ys(P,h);if(!G)continue;const j=l.get(G)??[];j.push(P),l.set(G,j)}let x=0;for(const P of u){const G=P.padding??0;G>x&&(x=G)}const C=[];let b=1/0,v=-1/0;for(const P of u){const G=l.get(P.id)??[],j=bo(G);j&&(b=Math.min(b,j.minX),v=Math.max(v,j.maxX),C.push({lane:P,contentTop:j.minY,contentBottom:j.maxY,centerY:(j.minY+j.maxY)/2}))}if(b===1/0||v===-1/0)return!0;const L=Math.max(0,v-b),y=Math.max(x,10),I=L+2*y,E=a+I,O=(b+v)/2-I/2-a,k=O+E/2,H=Math.max(x,a);C.sort((P,G)=>P.centerY-G.centerY);for(let P=0;PM.cy?C.bottom:C.top,H=M.cx+b;if(H<=C.left+ae||H>=C.right-ae)continue;v={x:H,y:k},L={x:H,y:a.y},y={x:a.x,y:a.y}}else{const k=u.cx>M.cx?C.right:C.left,H=M.cy+b;if(H<=C.top+ae||H>=C.bottom-ae)continue;v={x:k,y:H},L={x:a.x,y:H},y={x:a.x,y:a.y}}const I=ce(v,L,ae),E=ce(L,y,ae);if(I&&E||!I&&Pt(v,L,o,[g],1)||!E&&Pt(L,y,o,[p],1))continue;const A=!I&&nn(v,L,t,s,{epsilon:ae,skipDegenerateOther:!0}),B=!E&&nn(L,y,t,s,{epsilon:ae,skipDegenerateOther:!0});if(!(A||B)){I?x=[L,y]:E?x=[v,L]:x=[v,L,y];break}}x&&(s.points=x)}}d(Is,"portSwapToLShape");function Ss(t,e){const{realNodeRects:r,labelNodeRects:i}=Me(e.values());for(const a of t){if(a.isLayoutOnly)continue;const c=a.points;if(!c||c.length<4)continue;const f=xt(c,.001);if(f.length<4)continue;const g=f.length-1,p=f[g],M=f[g-1],u=f[g-2],h=p.x-M.x,l=p.y-M.y,x=Math.hypot(h,l);if(x>=10||x<.001)continue;const C=M.x-u.x,b=M.y-u.y;if(Math.hypot(C,b)<.001)continue;const L=Nt(M,p,.001),y=Ot(M,p,.001),I=Nt(u,M,.001),E=Ot(u,M,.001);if(!(L&&E||y&&I))continue;const A=a.end,B=a.start,O=A?e.get(A):void 0;if(!O)continue;const k=O.x??0,H=O.y??0,P=te(O);if(!P)continue;let G,j;if(E){const J=b<0;G={x:k,y:u.y},j={x:k,y:J?P.bottom:P.top}}else{const J=C>0;G={x:u.x,y:H},j={x:J?P.right:P.left,y:H}}if(Pt(G,j,r,A?[A]:[],-2)||Pt(G,j,i,[],-2))continue;if(B){const J=e.get(B),rt=J?te(J):void 0;if(rt&&fo(G,rt,2))continue}const tt=d((J,rt)=>`${J.x.toFixed(3)},${J.y.toFixed(3)}|${rt.x.toFixed(3)},${rt.y.toFixed(3)}`,"ownSegmentKey"),ft=new Set;for(let J=0;J{for(const ut of t){if(ut===a||ut.isLayoutOnly)continue;const pt=ut.points;if(!(!pt||pt.length<2))for(let St=0;St=0){const J=f[g-3],rt=[B,A].filter(ut=>!!ut);if(Pt(J,G,r,rt,-2)||Mt(J,G))continue}const Ft=[...f.slice(0,g-2),G,j];a.points=Ft;const nt=a.labelNodeId;if(nt){const J=e.get(nt);if(J){const rt=J.width??0,ut=J.height??0;if(rt>0&&ut>0){let pt,St,wt=-1;for(let Kt=0;Kt=rt+2||me&&se>=ut+2)&&se>wt&&(wt=se,pt=(qt.x+Jt.x)/2,St=(qt.y+Jt.y)/2)}pt!==void 0&&St!==void 0&&(J.x=pt,J.y=St)}}}}}d(Ss,"collapseShortTerminalStub");var et=.001,Xt=8,at=Be,Ln=d((t,e)=>gt(t,e,et)||yt(t,e,et),"orthogonallyAligned");function Cs(t,e){const s=d((u,h)=>{const l=u.x??0,x=u.y??0,C=h.x-l,b=h.y-x;let v=(u.width??0)/2,L=(u.height??0)/2;return Math.abs(b)*v>Math.abs(C)*L?(b<0&&(L=-L),{x:l+(b===0?0:L*C/b),y:x+L}):(C<0&&(v=-v),{x:l+v,y:x+(C===0?0:v*b/C)})},"rectIntersect"),r=d((u,h)=>{const l=xt(u.points??[]);if(l.length<2)return;const x=h?u.start:u.end,C=x?e.get(x):void 0,b=C?te(C):void 0;if(!C||!x||!b)return;const v=h?l[0]:l[l.length-1],L=h?l[1]:l[l.length-2],y=s(C,v);let I=v;if(Ln(L,y)&&(I=L),gt(y,I,et))return{edge:u,edgeId:String(u.id??""),nodeId:x,atStart:h,orientation:"V",coord:y.x,min:Math.min(y.y,I.y),max:Math.max(y.y,I.y),boundary:y,railEnd:I,rect:b};if(yt(y,I,et))return{edge:u,edgeId:String(u.id??""),nodeId:x,atStart:h,orientation:"H",coord:y.y,min:Math.min(y.x,I.x),max:Math.max(y.x,I.x),boundary:y,railEnd:I,rect:b}},"terminalLaneFor"),i=d((u,h)=>Math.max(0,Math.min(u.max,h.max)-Math.max(u.min,h.min)),"projectedOverlapLength"),a=d((u,h)=>u.nodeId!==h.nodeId||u.orientation!==h.orientation?!1:u.orientation==="H"?(Math.abs(u.boundary.x-u.rect.left)<1||Math.abs(u.boundary.x-u.rect.right)<1)&>(u.boundary,h.boundary,1):(Math.abs(u.boundary.y-u.rect.top)<1||Math.abs(u.boundary.y-u.rect.bottom)<1)&&yt(u.boundary,h.boundary,1),"sameTerminalFace"),c=d((u,h)=>u.nodeId!==h.nodeId||u.orientation!==h.orientation?!1:i(u,h)>=Xt&&Math.abs(u.coord-h.coord)<.5,"exactTerminalLaneConflict"),f=d((u,h)=>{if(u.nodeId!==h.nodeId||u.orientation!==h.orientation||u.orientation!=="H"||u.atStart===h.atStart)return!1;const l=i(u,h);if(l2*x?!1:a(u,h)&&Math.abs(u.coord-h.coord)<16},"nearTerminalLaneConflict"),g=d((u,h)=>{const l=xt(u.edge.points??[]);if(l.length<2)return;const x=u.orientation==="V"?{x:u.boundary.x+h,y:u.boundary.y}:{x:u.boundary.x,y:u.boundary.y+h},C=u.orientation==="V"?{x:u.railEnd.x+h,y:u.railEnd.y}:{x:u.railEnd.x,y:u.railEnd.y+h};if(!d(()=>Math.abs(u.boundary.y-u.rect.top)<1||Math.abs(u.boundary.y-u.rect.bottom)<1?yt(x,u.boundary,et)&&x.x>=u.rect.left+1&&x.x<=u.rect.right-1:Math.abs(u.boundary.x-u.rect.left)<1||Math.abs(u.boundary.x-u.rect.right)<1?gt(x,u.boundary,et)&&x.y>=u.rect.top+1&&x.y<=u.rect.bottom-1:!1,"boundaryStaysOnSameFace")())return;if(u.atStart){const I=l.length>1&&ce(l[1],u.railEnd,et),E=l.slice(I?2:1),A=E[0];return A&&!Ln(A,C)?void 0:[x,C,...E]}const v=l.length>1&&ce(l[l.length-2],u.railEnd,et),L=l.slice(0,v?-2:-1),y=L[L.length-1];if(!(y&&!Ln(y,C)))return[...L,C,x]},"shiftedCandidate"),p=d(u=>{const h=u.edge,l=xt(h.points??[]);if(l.length!==2)return!1;const x=h.start,C=h.end,b=x?e.get(x):void 0,v=C?e.get(C):void 0;if(!b||!v)return!1;const L=b.x??0,y=b.y??0,I=v.x??0,E=v.y??0,[A,B]=l;return yt(A,B,et)&&Math.abs(y-E)<1&&Math.abs(L-I)>1||gt(A,B,et)&&Math.abs(L-I)<1&&Math.abs(y-E)>1},"laneIsStraightCollinearConnector"),M=[-7,7,-2*7,2*7,-3*7,3*7];for(let u=0;u<8;u++){const h=t.filter(x=>!x.isLayoutOnly).flatMap(x=>[r(x,!0),r(x,!1)]).filter(x=>!!x);let l=!1;for(let x=0;x{const A=p(I),B=p(E);return A!==B?Number(A)-Number(B):+!E.atStart-+!I.atStart});for(const I of y){for(const E of M){const A=g(I,E);if(!A)continue;const B=r({...I.edge,points:A},I.atStart);if(!(!B||h.some(O=>O.edge!==I.edge&&(c(B,O)||L&&f(B,O))))){I.edge.points=A,l=!0;break}}if(l)break}}if(!l)return}}d(Cs,"separateSharedRenderedTerminalLanes");function vs(t,e){const{realNodeRects:o,labelNodeRects:s}=Me(e.values()),r=d((a,c)=>{const f=a.start,g=a.end,p=at(c);if(p.length!==c.length-1)return!1;const M=[f,g].filter(u=>!!u);for(const u of p)if(Pt(u.a,u.b,o,M,-2)||Pt(u.a,u.b,s,[],-2))return!1;for(const u of t){if(u===a||u.isLayoutOnly)continue;const h=u.points;if(!(!h||h.length<2)){for(const l of p)for(const x of at(xt(h)))if(de(l,x,.5)>=Xt||he(l.a,l.b,x.a,x.b,et))return!1}}return!0},"candidateIsSafe"),i=d((a,c)=>{if(c+4>=a.length)return;const f=a[c],g=a[c+1],p=a[c+2],M=a[c+3],u=a[c+4],h=Nt(f,g)&&Ot(g,p)&&Nt(p,M)&&Ot(M,u)&>(f,M,et)&>(f,u,et)&>(g,p,et)&&(g.x-f.x)*(M.x-p.x)<0,l=Ot(f,g)&&Nt(g,p)&&Ot(p,M)&&Nt(M,u)&&yt(f,M,et)&&yt(f,u,et)&&yt(g,p,et)&&(g.y-f.y)*(M.y-p.y)<0;if(h||l)return xt([...a.slice(0,c+1),u,...a.slice(c+5)]);if(c+5>=a.length)return;const x=a[c+5],C=Ot(f,g)&&Nt(g,p)&&Ot(p,M)&&Nt(M,u)&&Ot(u,x)&>(f,u,et)&>(f,x,et)&>(p,M,et)&&(p.x-g.x)*(u.x-M.x)<0,b=Nt(f,g)&&Ot(g,p)&&Nt(p,M)&&Ot(M,u)&&Nt(u,x)&&yt(f,u,et)&&yt(f,x,et)&&yt(p,M,et)&&(p.y-g.y)*(u.y-M.y)<0;if(!(!C&&!b))return xt([...a.slice(0,c+1),x,...a.slice(c+6)])},"withoutDogleg");for(let a=0;a<8;a++){let c=!1;for(const f of t){if(f.isLayoutOnly)continue;const g=xt(f.points??[]);for(let p=0;p<=g.length-5;p++){const M=i(g,p);if(!(!M||!r(f,M))){f.points=M,c=!0;break}}if(c)break}if(!c)return}}d(vs,"collapseRedundantRectangularDoglegs");function zn(t,e){const{realNodeRects:r,labelNodeRects:i}=Me(e.values()),a=t.filter(h=>!h.isLayoutOnly),c=d((h,l,x)=>xt(h===l?x??[]:h.points??[]),"pointsFor"),f=d((h,l)=>{let x=0;for(let C=0;C{const l=at(h);if(l.length!==3)return;const x=l[1];if(!(l[0].horizontal===x.horizontal||l[2].horizontal===x.horizontal))return{index:x.index,horizontal:x.horizontal,vertical:x.vertical,segment:x}},"middleRail"),p=d((h,l)=>{const x=[h.start,h.end].filter(C=>!!C);return r.filter(C=>{if(x.includes(C.id))return!1;const b=C.rect;return l.horizontal?Wt(l.a.x,l.b.x,b.left,b.right)>=Xt&&l.a.y>=b.top-2&&l.a.y<=b.bottom+2:Wt(l.a.y,l.b.y,b.top,b.bottom)>=Xt&&l.a.x>=b.left-2&&l.a.x<=b.right+2})},"blockingRectsFor"),M=d((h,l,x)=>{const C=h.map(v=>({...v}));if(l.horizontal)C[l.index].y=x,C[l.index+1].y=x;else if(l.vertical)C[l.index].x=x,C[l.index+1].x=x;else return;const b=ue(xt(C));return at(b).length===b.length-1?b:void 0},"candidateByMovingRail"),u=d((h,l,x)=>{const C=[h.start,h.end].filter(v=>!!v),b=at(l);if(b.length!==l.length-1)return!1;for(const v of b)if(Pt(v.a,v.b,r,C,-2)||Pt(v.a,v.b,i,[],-2))return!1;for(const v of a)if(v!==h){for(const L of b)for(const y of at(c(v)))if(de(L,y,.5)>=Xt)return!1}return f(h,l)<=x},"candidateIsSafe");for(let h=0;h<8;h++){const l=f();let x=!1;for(const C of a){const b=c(C),v=g(b);if(!v)continue;const L=p(C,v.segment);if(L.length===0)continue;const y=v.horizontal?[Math.min(...L.map(I=>I.rect.top))-20,Math.max(...L.map(I=>I.rect.bottom))+20]:[Math.min(...L.map(I=>I.rect.left))-20,Math.max(...L.map(I=>I.rect.right))+20];for(const I of y){const E=M(b,v.segment,I);if(!(!E||!u(C,E,l))){C.points=E,x=!0;break}}if(x)break}if(!x)return}}d(zn,"liftObstacleHuggingSameSideRails");function Vn(t,e){const o=d(c=>{const f=c.groupTitleRect;if(!(!f||typeof f.left!="number"||typeof f.right!="number"||typeof f.top!="number"||typeof f.bottom!="number"||!Number.isFinite(f.left)||!Number.isFinite(f.right)||!Number.isFinite(f.top)||!Number.isFinite(f.bottom)||f.right<=f.left||f.bottom<=f.top))return{left:f.left,right:f.right,top:f.top,bottom:f.bottom}},"validTitleRect"),s=d(c=>{if(!c.isGroup||c.parentId)return;const f=c.direction,g=typeof f=="string"?f.toUpperCase():"";if(g==="LR"||g==="RL"||g==="BT")return;const p=o(c),M=c.y,u=c.height;if(!p||typeof M!="number"||typeof u!="number"||!Number.isFinite(M)||!Number.isFinite(u)||u<=0)return;const h=p.right-p.left,l=p.bottom-p.top;if(!(l<=0||h{if(!c.horizontal)return!1;const g=c.a.y;return g<=f.top+et||g>=f.bottom-et?!1:Wt(c.a.x,c.b.x,f.left,f.right)>=Xt},"horizontalSegmentIntersectsTitle"),i=[...e.values()].map(s).filter(c=>!!c);if(i.length===0)return;let a=0;for(const c of t){if(c.isLayoutOnly)continue;const f=xt(c.points??[]);for(const g of at(f))for(const p of i)r(g,p.rect)&&(a=Math.max(a,p.rect.bottom-g.a.y+4))}if(!(a<=et))for(const c of i){const f=c.node.y,g=c.node.height;typeof f!="number"||typeof g!="number"||!Number.isFinite(f)||!Number.isFinite(g)||g<=0||(c.node.y=f-a/2,c.node.height=g+a,c.node.groupTitleRect={...c.rect,top:c.rect.top-a,bottom:c.rect.bottom-a})}}d(Vn,"liftTopLaneTitleBandsAboveRails");function jn(t,e){const o=d(f=>{const g=f.groupTitleRect;if(!(!g||typeof g.left!="number"||typeof g.right!="number"||typeof g.top!="number"||typeof g.bottom!="number"||!Number.isFinite(g.left)||!Number.isFinite(g.right)||!Number.isFinite(g.top)||!Number.isFinite(g.bottom)||g.right<=g.left||g.bottom<=g.top))return{left:g.left,right:g.right,top:g.top,bottom:g.bottom}},"validTitleRect"),s=d(f=>{if(!f.isGroup||f.parentId||f.direction!=="LR")return;const p=o(f),M=f.x,u=f.width;if(!p||typeof M!="number"||typeof u!="number"||!Number.isFinite(M)||!Number.isFinite(u)||u<=0)return;const h=p.right-p.left,l=p.bottom-p.top;if(!(h<=0||l{if(!f.vertical)return!1;const p=f.a.x;return p<=g.left+et||p>=g.right-et?!1:Wt(f.a.y,f.b.y,g.top,g.bottom)>=Xt},"verticalSegmentIntersectsTitle"),i=d((f,g)=>{if(!f.horizontal)return!1;const p=f.a.y;return p<=g.top+et||p>=g.bottom-et?!1:Wt(f.a.x,f.b.x,g.left,g.right)>=Xt},"horizontalSegmentIntersectsTitle"),a=[...e.values()].map(s).filter(f=>!!f);if(a.length===0)return;let c=0;for(const f of t){if(f.isLayoutOnly)continue;const g=xt(f.points??[]);for(const p of at(g))for(const M of a)if(r(p,M.rect))c=Math.max(c,M.rect.right-p.a.x+4);else if(i(p,M.rect)){const u=Math.min(p.a.x,p.b.x);c=Math.max(c,M.rect.right-u+4)}}if(!(c<=et))for(const f of a){const g=f.node.x,p=f.node.width;typeof g!="number"||typeof p!="number"||!Number.isFinite(g)||!Number.isFinite(p)||p<=0||(f.node.x=g-c/2,f.node.width=p+c,f.node.groupTitleRect={...f.rect,left:f.rect.left-c,right:f.rect.right-c})}}d(jn,"shiftLeftLaneTitleBandsLeftOfRails");function Ls(t,e){const{realNodeRects:o}=Me(e.values()),s=t.filter(h=>!h.isLayoutOnly),r=d((h,l=new Map)=>xt(l.get(h)??h.points??[]),"replacementPointsFor"),i=d((h=new Map)=>{let l=0;for(let x=0;xs.reduce((l,x)=>l+oe(r(x,h)),0),"totalBends"),c=d(h=>{const l=r(h);if(l.length<4)return;const x=l[l.length-2],C=l[l.length-1];if(!(!Nt(x,C,et)&&!Ot(x,C,et)))return{tailStart:x,terminal:C}},"terminalTailFor"),f=d((h,l)=>{const x=r(h);if(x.length<3)return;const C=x[0],b=x[1];let v;if(Nt(C,b,et))v={x:b.x,y:l.tailStart.y};else if(Ot(C,b,et))v={x:l.tailStart.x,y:b.y};else return;const L=ue(xt([C,b,v,l.tailStart,l.terminal]));return at(L).length===L.length-1?L:void 0},"candidateWithDestinationTail"),g=d((h,l)=>{const x=[h.start,h.end].filter(C=>!!C);for(const C of at(l))if(Pt(C.a,C.b,o,x,-2))return!0;return!1},"pathHasNodeHit"),p=d((h,l,x)=>{for(const C of s)if(C!==h){for(const b of at(l))for(const v of at(r(C,x)))if(de(b,v,.5)>=Xt)return!0}return!1},"pathHasSharedTrack"),M=d((h,l,x)=>!g(h,l)&&!p(h,l,x),"candidateIsSafe"),u=d(()=>{const h=new Map;for(const l of s){const x=l.end;if(!x||!e.has(x)||r(l).length<4)continue;const b=h.get(x)??[];b.push(l),h.set(x,b)}return h},"edgesByDestination");for(let h=0;h<4;h++){const l=i();if(l===0)return;const x=a();let C,b=l,v=x;for(const L of u().values())for(let y=0;y=l||G>b||G===b&&j>=v||(C=P,b=G,v=j)}if(!C)return;for(const[L,y]of C)L.points=y}}d(Ls,"swapDestinationTerminalTailsToReduceCrossings");function Es(t,e){const{realNodeRects:r,labelNodeRects:i}=Me(e.values()),a=t.filter(L=>!L.isLayoutOnly),c=d((L,y=new Map)=>xt(y.get(L)??L.points??[]),"replacementPointsFor"),f=d((L=new Map)=>{let y=0;for(let I=0;Ia.reduce((y,I)=>y+oe(c(I,L)),0),"totalBends"),p=d(L=>{const y=L.start,I=L.end,E=y?e.get(y):void 0,A=I?e.get(I):void 0,B=E?te(E):void 0,O=A?te(A):void 0;return B&&O?{src:B,dst:O}:void 0},"endpointRectsFor"),M=d((L,y,I)=>{if(I.index<=0||I.index+1>=y.length-1)return;const E=p(L);if(E){if(I.vertical){const A=I.a.x,B=Math.min(E.src.left,E.dst.left),O=Math.max(E.src.right,E.dst.right),k=AO+et?"right":void 0;return k?{edge:L,points:y,segmentIndex:I.index,axis:"vertical",side:k,coord:A,min:Math.min(I.a.y,I.b.y),max:Math.max(I.a.y,I.b.y)}:void 0}if(I.horizontal){const A=I.a.y,B=Math.min(E.src.top,E.dst.top),O=Math.max(E.src.bottom,E.dst.bottom),k=AO+et?"bottom":void 0;return k?{edge:L,points:y,segmentIndex:I.index,axis:"horizontal",side:k,coord:A,min:Math.min(I.a.x,I.b.x),max:Math.max(I.a.x,I.b.x)}:void 0}}},"externalRailForSegment"),u=d(()=>{const L=[];for(const y of a){const I=c(y);for(const E of at(I)){const A=M(y,I,E);A&&L.push(A)}}return L},"collectExternalRails"),h=d((L,y)=>L.edge!==y.edge&&L.axis===y.axis&&L.side===y.side&&Wt(L.min,L.max,y.min,y.max)>=Xt,"railsInteract"),l=d(L=>{const y=[],I=new Set;for(const E of L){if(I.has(E))continue;const A=[E],B=[];for(I.add(E);A.length>0;){const O=A.pop();B.push(O);for(const k of L)!I.has(k)&&h(O,k)&&(I.add(k),A.push(k))}B.length>1&&y.push(B)}return y},"connectedComponents"),x=d(L=>{const y=[];for(const I of L)y.some(E=>Math.abs(E-I.coord){const y=L.map(A=>A.coord),I=x(L),E=[];if(L.length<=6){const A=new Array(I.length).fill(!1),B=[],O=d(()=>{if(B.length===L.length){B.some((k,H)=>Math.abs(k-y[H])>=et)&&E.push([...B]);return}for(const[k,H]of I.entries())A[k]||(A[k]=!0,B.push(H),O(),B.pop(),A[k]=!1)},"visit");return O(),E}for(let A=0;A{const I=new Map;for(const[A,B]of L.entries()){const O=y[A],k=I.get(B.edge)??B.points.map(H=>({x:H.x,y:H.y}));B.axis==="vertical"?(k[B.segmentIndex].x=O,k[B.segmentIndex+1].x=O):(k[B.segmentIndex].y=O,k[B.segmentIndex+1].y=O),I.set(B.edge,k)}const E=new Map;for(const[A,B]of I){const O=ue(xt(B));if(at(O).length!==O.length-1)return;E.set(A,O)}return E},"replacementsForAssignment"),v=d(L=>{for(const[y,I]of L){const E=[y.start,y.end].filter(A=>!!A);for(const A of at(I))if(Pt(A.a,A.b,r,E,-2)||Pt(A.a,A.b,i,[],-2))return!1}for(let y=0;y=Xt)return!1}}return!0},"candidateIsSafe");for(let L=0;L<4;L++){const y=f();if(y===0)return;let I,E=y,A=g(),B=Number.POSITIVE_INFINITY;for(const O of l(u()))for(const k of C(O)){const H=b(O,k);if(!H||!v(H))continue;const P=f(H);if(P>=y)continue;const G=g(H),j=O.reduce((tt,ft,Mt)=>tt+Math.abs(k[Mt]-ft.coord),0);P>E||P===E&&(G>A||G===A&&j>=B)||(I=H,E=P,A=G,B=j)}if(!I)return;for(const[O,k]of I)O.points=k}}d(Es,"reassignCrossingExternalRailChannels");function Ts(t,e){const{realNodeRects:o,labelNodeRects:s}=Me(e.values()),r=t.filter(u=>!u.isLayoutOnly),i=d((u,h,l)=>xt(u===h?l??[]:u.points??[]),"pointsFor"),a=d(u=>at(u).reduce((h,l)=>{const x=l.a.x-l.b.x,C=l.a.y-l.b.y;return h+Math.hypot(x,C)},0),"pathLength"),c=d((u,h)=>{let l=0;for(let x=0;x{if(u.horizontal){const l=u.a.y;return(Math.abs(l-h.top)<1||Math.abs(l-h.bottom)<1)&&Wt(u.a.x,u.b.x,h.left,h.right)>=Xt}if(u.vertical){const l=u.a.x;return(Math.abs(l-h.left)<1||Math.abs(l-h.right)<1)&&Wt(u.a.y,u.b.y,h.top,h.bottom)>=Xt}return!1},"segmentRunsAlongRectBorder"),g=d(u=>{const h=[u.start,u.end].filter(x=>!!x),l=[];for(const x of h){const C=e.get(x),b=C?te(C):void 0;b&&l.push(b)}return l},"endpointRectsFor"),p=d((u,h)=>{if(h+3>=u.length)return[];const l=u[h],x=u[h+1],C=u[h+2],b=u[h+3],v=Nt(l,x,et)&&Ot(x,C,et)&&Nt(C,b,et),L=Ot(l,x,et)&&Nt(x,C,et)&&Ot(C,b,et);if(!v&&!L)return[];if(!(v?Math.sign(x.x-l.x)!==Math.sign(b.x-C.x):Math.sign(x.y-l.y)!==Math.sign(b.y-C.y)))return[];const I=gt(l,b,et)||yt(l,b,et)?[]:[{x:l.x,y:b.y},{x:b.x,y:l.y}],E=I.length===0?[[...u.slice(0,h+1),...u.slice(h+3)]]:I.map(B=>[...u.slice(0,h+1),B,...u.slice(h+3)]),A=new Set;return E.map(B=>ue(xt(B))).filter(B=>{if(at(B).length!==B.length-1||!B.some(k=>ce(k,b,et)))return!1;const O=B.map(k=>`${k.x.toFixed(3)},${k.y.toFixed(3)}`).join("|");return A.has(O)?!1:(A.add(O),!0)})},"shortcutCandidatesAt"),M=d((u,h,l)=>{const x=[u.start,u.end].filter(b=>!!b),C=g(u);for(const b of at(h))if(Pt(b.a,b.b,o,x,-2)||Pt(b.a,b.b,s,[],-2)||C.some(v=>f(b,v)))return!1;for(const b of r)if(b!==u){for(const v of at(h))for(const L of at(i(b)))if(de(v,L,.5)>=Xt)return!1}return c(u,h)<=l},"candidateIsSafe");for(let u=0;u<8;u++){const h=c();let l,x,C=h,b=Number.POSITIVE_INFINITY,v=Number.POSITIVE_INFINITY;for(const L of r){const y=i(L),I=oe(y,et),E=a(y);for(let A=0;A<=y.length-4;A++)for(const B of p(y,A)){const O=oe(B,et),k=a(B);if(!(OC||P===C&&(O>b||O===b&&k>=v)||(l=L,x=B,C=P,b=O,v=k)}}if(!l||!x)return;l.points=x}}d(Ts,"shortcutRedundantOrthogonalJogs");function ws(t,e){const i=[];for(const R of e.values()){if(R.isGroup||R.isEdgeLabel)continue;const _=R.x??0,F=R.y??0,V=te(R);V&&i.push({id:String(R.id??""),cx:_,cy:F,rect:V})}if(i.length===0)return;const a=new Map(i.map(R=>[R.id,R])),c=i.map(R=>({id:R.id,rect:R.rect})),f=["top","bottom","left","right"],g={top:Math.min(...i.map(R=>R.rect.top))-20,bottom:Math.max(...i.map(R=>R.rect.bottom))+20,left:Math.min(...i.map(R=>R.rect.left))-20,right:Math.max(...i.map(R=>R.rect.right))+20},p=t.filter(R=>!R.isLayoutOnly),M=new Map(p.map((R,_)=>[R,_])),u=d(R=>{const _=R==="left"||R==="top"?-1:1,F=[];for(let V=0;V<=2;V++)F.push(g[R]+_*20*V);return F},"outwardTracksForSide"),h=d((R,_=new Map)=>xt(_.get(R)??R.points??[]),"replacementPointsFor"),l=d((R,_)=>{let F=0;for(const V of R)for(const K of _)he(V.a,V.b,K.a,K.b,et)&&F++;return F},"crossingCountBetweenSegments"),x=d((R,_)=>l(at(R),at(_)),"crossingCountBetweenPaths"),C=d((R=new Map)=>{let _=0;const F=[],V=new Set,K=[],Z=d(Y=>{V.has(Y)||(V.add(Y),K.push(Y))},"addEdge");for(let Y=0;Y0&&(_+=T,F.push({first:q,second:w,count:T}),Z(q),Z(w))}}return K.sort((Y,q)=>(M.get(Y)??0)-(M.get(q)??0)),{count:_,pairs:F,edgeSet:V,edges:K}},"crossingSnapshot"),b=d((R,_)=>{const F=new Set(_.keys());if(F.size===0)return R.count;let V=0;for(const Z of R.pairs)(F.has(Z.first)||F.has(Z.second))&&(V+=Z.count);let K=0;for(let Z=0;Z{const _=new Map;for(const K of R.pairs){const Z=_.get(K.first)??new Set;Z.add(K.second),_.set(K.first,Z);const Y=_.get(K.second)??new Set;Y.add(K.first),_.set(K.second,Y)}const F=[],V=new Set;for(const K of R.edges){if(V.has(K))continue;const Z=[K],Y=[];for(V.add(K);Z.length>0;){const q=Z.pop();Y.push(q);for(const m of _.get(q)??[])V.has(m)||(V.add(m),Z.push(m))}Y.sort((q,m)=>(M.get(q)??0)-(M.get(m)??0)),Y.length>1&&F.push(Y)}return F},"crossingComponents"),L=d(R=>[R.start,R.end].filter(_=>!!_),"endpointIdsFor"),y=d(R=>{const _=[];for(const F of v(R)){const V=new Set(F),K=new Set(F.flatMap(Y=>L(Y))),Z=[...F];for(const Y of p)V.has(Y)||L(Y).some(q=>K.has(q))&&Z.push(Y);Z.sort((Y,q)=>(M.get(Y)??0)-(M.get(q)??0)),_.push(Z)}return _},"pairSearchGroups"),I=d((R,_,F)=>b(R,new Map([[_,F]])),"crossingCountWithSingleReplacement"),E=d(R=>{const _=new Map;for(const F of R.pairs)_.set(F.first,(_.get(F.first)??0)+F.count),_.set(F.second,(_.get(F.second)??0)+F.count);return _},"currentCrossingsByEdge"),A=d(R=>R.slice(1).reduce((_,F,V)=>{const K=R[V];return _+Math.abs(F.x-K.x)+Math.abs(F.y-K.y)},0),"pathLength"),B=d((R=new Map)=>p.reduce((_,F)=>_+oe(h(F,R)),0),"totalBends"),O=d((R=new Map)=>p.reduce((_,F)=>_+A(h(F,R)),0),"totalLength"),k=d((R,_,F=new Map)=>{const V=at(_);for(const K of p)if(K!==R){for(const Z of V)for(const Y of at(h(K,F)))if(de(Z,Y,.5)>=Xt)return!0}return!1},"pathHasSegmentConflict"),H=d((R,_)=>{const F=[R.start,R.end].filter(V=>!!V);for(const V of at(_))if(Pt(V.a,V.b,c,F,-2))return!0;return!1},"pathHitsNode"),P=d((R,_)=>{const F=ue(xt(_));at(F).length===F.length-1&&R.push(F)},"pushOrthogonalCandidate"),G=d(R=>R==="left"||R==="right","sideIsHorizontal"),j=d((R,_,F)=>{switch(_){case"left":return Math.min(R.x,F.x)-20;case"right":return Math.max(R.x,F.x)+20;case"top":return Math.min(R.y,F.y)-20;case"bottom":return Math.max(R.y,F.y)+20}},"localTrackForSameSide"),tt=d((R,_,F,V)=>{const K=F==="left"||F==="top"?-1:1,Z=[j(_,F,V),g[F]];for(const Y of Z)for(let q=0;q<=2;q++)P(R,ho(_,F,V,Y+K*20*q))},"addSameSideCandidates"),ft=d((R,_,F,V,K)=>{for(const Z of u(F))for(const Y of u(K))P(R,[_,{x:Z,y:_.y},{x:Z,y:Y},{x:V.x,y:Y},V])},"addHorizontalToVerticalCandidates"),Mt=d((R,_,F,V,K)=>{for(const Z of u(F))for(const Y of u(K))P(R,[_,{x:_.x,y:Z},{x:Y,y:Z},{x:Y,y:V.y},V])},"addVerticalToHorizontalCandidates"),Ht=d((R,_,F,V,K)=>{const Z=[...u("top"),...u("bottom")];for(const Y of u(F))for(const q of u(K))for(const m of Z)P(R,[_,{x:Y,y:_.y},{x:Y,y:m},{x:q,y:m},{x:q,y:V.y},V])},"addHorizontalPairCandidates"),Ft=d((R,_,F,V,K)=>{const Z=[...u("left"),...u("right")];for(const Y of u(F))for(const q of u(K))for(const m of Z)P(R,[_,{x:_.x,y:Y},{x:m,y:Y},{x:m,y:q},{x:V.x,y:q},V])},"addVerticalPairCandidates"),nt=d(R=>{const _=new Set;return R.map(F=>xt(F)).filter(F=>{const V=F.map(K=>`${K.x.toFixed(3)},${K.y.toFixed(3)}`).join("|");return _.has(V)||F.length<2?!1:(_.add(V),!0)})},"dedupeCandidatePaths"),J=d((R,_,F,V)=>{const K=[],Z=uo(R,_,F,V,20,et);Z&&P(K,Z),_===V&&tt(K,R,_,F);const Y=G(_),q=G(V);return Y&&!q?ft(K,R,_,F,V):!Y&&q?Mt(K,R,_,F,V):Y?Ht(K,R,_,F,V):Ft(K,R,_,F,V),nt(K)},"buildCandidatesForSides"),rt=d((R,_,F,V)=>{const K=[...u("left"),...u("right")],Z=[...u("top"),...u("bottom")];for(const Y of f){const q=Le(V,Y),m=Y==="top"||Y==="bottom"?u(Y):Z;for(const S of K){P(R,[_,F,{x:S,y:F.y},{x:S,y:q.y},q]);for(const w of m)P(R,[_,F,{x:S,y:F.y},{x:S,y:w},{x:q.x,y:w},q])}}},"addVerticalDepartureOuterTrackCandidates"),ut=d((R,_,F,V)=>{const K=[...u("left"),...u("right")],Z=[...u("top"),...u("bottom")];for(const Y of f){const q=Le(V,Y),m=Y==="left"||Y==="right"?u(Y):K;for(const S of Z){P(R,[_,F,{x:F.x,y:S},{x:q.x,y:S},q]);for(const w of m)P(R,[_,F,{x:F.x,y:S},{x:w,y:S},{x:w,y:q.y},q])}}},"addHorizontalDepartureOuterTrackCandidates"),pt=d(R=>{const _=R.start,F=R.end,V=F?a.get(F):void 0;if(!_||!V)return[];const K=xt(R.points??[]);if(K.length<4)return[];const Z=K[0],Y=K[1],q=[];return Ot(Z,Y,et)?rt(q,Z,Y,V):Nt(Z,Y,et)&&ut(q,Z,Y,V),q},"terminalPreservingOuterTrackCandidates"),St=d(R=>{const _=R.start,F=R.end,V=_?a.get(_):void 0,K=F?a.get(F):void 0;if(!V||!K)return[];const Z=[];for(const Y of f){const q=Le(V,Y);for(const m of f)Z.push(...J(q,Y,Le(K,m),m))}return Z.push(...pt(R)),Z},"candidatePathsFor"),wt=d(()=>new Map(p.map(R=>[R,at(h(R))])),"currentSegmentsByEdge"),Kt=d((R,_,F)=>{const V=new Set;for(const K of p){if(K===R)continue;const Z=F.get(K)??at(h(K));_.some(Y=>Z.some(q=>de(Y,q,.5)>=Xt))&&V.add(K)}return V},"sharedTrackConflictsFor"),qt=d((R,_,F,V)=>{const K=new Set;return St(R).map(Y=>ue(xt(Y))).filter(Y=>{if(H(R,Y))return!1;const q=Y.map(m=>`${m.x.toFixed(3)},${m.y.toFixed(3)}`).join("|");return K.has(q)||Y.length<2?!1:(K.add(q),!0)}).map(Y=>{const q=at(Y);let m=0;for(const S of p)S!==R&&(m+=l(q,F.get(S)??at(h(S))));return{candidate:Y,candidateSegments:q,crossings:_.count-(V.get(R)??0)+m,bends:oe(Y,et),totalBends:oe(Y),length:A(Y)}}).filter(({crossings:Y})=>Y<=_.count).sort((Y,q)=>Y.crossings-q.crossings||Y.bends-q.bends||Y.length-q.length).slice(0,48).map(Y=>({path:Y.candidate,segments:Y.candidateSegments,sharedTrackConflicts:Kt(R,Y.candidateSegments,F),totalBends:Y.totalBends,length:Y.length}))},"pairCandidatesFor"),Jt=d((R,_,F,V,K,Z)=>{let Y=0;for(const m of R.pairs)(m.first===_||m.second===_||m.first===V||m.second===V)&&(Y+=m.count);let q=l(F.segments,K.segments);for(const m of p){if(m===_||m===V)continue;const S=Z.get(m)??at(h(m));q+=l(F.segments,S)+l(K.segments,S)}return R.count-Y+q},"pairCrossingCount"),se=d((R,_)=>{for(const F of R.sharedTrackConflicts)if(F!==_)return!1;return!0},"conflictsOnlyWith"),Ee=d((R,_)=>R.segments.some(F=>_.segments.some(V=>de(F,V,.5)>=Xt)),"candidatesShareTrack"),me=d((R,_,F,V)=>se(_,F.edge)&&se(V,R.edge)&&!Ee(_,V),"pairCandidatesAreCompatible"),Te=d((R,_,F,V,K)=>{const Z=Jt(R.current,_.edge,F,V.edge,K,R.baseSegments);if(!(Z>=R.current.count))return{replacements:new Map([[_.edge,F.path],[V.edge,K.path]]),crossings:Z,bends:R.currentBends-(R.baseBendsByEdge.get(_.edge)??0)-(R.baseBendsByEdge.get(V.edge)??0)+F.totalBends+K.totalBends,length:R.currentLength-(R.baseLengthByEdge.get(_.edge)??0)-(R.baseLengthByEdge.get(V.edge)??0)+F.length+K.length}},"scorePairReplacement"),mn=d((R,_)=>R.crossings<_.crossings||R.crossings===_.crossings&&(R.bends<_.bends||R.bends===_.bends&&R.length<_.length),"pairScoreIsBetter"),yn=d((R,_,F,V)=>{let K=V;for(const Z of _.candidates)for(const Y of F.candidates){if(!me(_,Z,F,Y))continue;const q=Te(R,_,Z,F,Y);q&&mn(q,K)&&(K=q)}return K},"bestScoreForOptionPair"),pn=d(R=>{const _=B(),F=O(),V=wt(),K=E(R),Z=new Map(p.map(T=>[T,oe(h(T))])),Y=new Map(p.map(T=>[T,A(h(T))])),q=new Map,m=y(R);for(const T of m)for(const N of T){if(q.has(N))continue;const D=qt(N,R,V,K);D.length>0&&q.set(N,{edge:N,candidates:D})}let S={replacements:new Map,crossings:R.count,bends:_,length:F};const w={current:R,currentBends:_,currentLength:F,baseBendsByEdge:Z,baseLengthByEdge:Y,baseSegments:V};for(const T of m){const N=new Set(T.filter(W=>R.edgeSet.has(W))),D=T.map(W=>q.get(W)).filter(W=>!!W);for(let W=0;W0?S.replacements:void 0},"bestPairedReplacement");for(let R=0;R<4;R++){const _=C(),F=_.count;if(F===0)return;let V,K,Z=F,Y=Number.POSITIVE_INFINITY;for(const m of _.edges){const S=oe(h(m),et);for(const w of St(m)){const T=H(m,w),N=!T&&k(m,w),D=I(_,m,w),W=oe(w,et);T||N||!(DZ||D===Z&&W>=Y||(V=m,K=w,Z=D,Y=W)}}if(V&&K){V.points=K;continue}const q=pn(_);if(!q)return;for(const[m,S]of q)m.points=S}}d(ws,"resolveRenderedOrthogonalCrossings");var be=.001,Zr=8;function As(t,e){const{nodeInfoById:n,realNodeRects:o}=un(e),s=["top","bottom","left","right"],r=20,i={top:Math.min(...o.map(l=>l.rect.top))-r,bottom:Math.max(...o.map(l=>l.rect.bottom))+r,left:Math.min(...o.map(l=>l.rect.left))-r,right:Math.max(...o.map(l=>l.rect.right))+r},a=d((l,x,C,b)=>{const v=[],L=uo(l,x,C,b,r,be);return L&&v.push(L),x===b&&v.push(ho(l,x,C,i[x])),v},"buildOrthogonalPathCandidates"),c=d((l,x)=>{for(let C=0;C{let b=0;const v=Be(l,be),L=x.start,y=x.end;for(const I of t){if(I===x||I.isLayoutOnly)continue;const E=I.start,A=I.end;if(!C&&L&&y&&(E===L||E===y||A===L||A===y))continue;const B=I.points;if(!(!B||B.length<2))for(const O of v)for(const k of Be(B,be)){if(mo(O.a,O.b,k.a,k.b,be,be)){b++;continue}de(O,k,be)>=Zr&&b++}}return b},"pathConflictCount"),g=4,p=d((l,x)=>{const C=Math.abs(l.y-x.rect.top),b=Math.abs(l.y-x.rect.bottom),v=Math.abs(l.x-x.rect.left),L=Math.abs(l.x-x.rect.right);let y="top",I=C;return b{const b=M.get(l)??[];b.push({side:x,edgeId:C}),M.set(l,b)},"addFaceClaim");for(const l of t){if(l.isLayoutOnly)continue;const x=l.points??[];if(x.length<1)continue;const C=l.id??"",b=l.start,v=l.end;if(b){const L=n.get(b);L&&u(b,p(x[0],L),C)}if(v){const L=n.get(v);L&&u(v,p(x[x.length-1],L),C)}}const h=d((l,x,C)=>{var b;return((b=M.get(l))==null?void 0:b.some(v=>v.edgeId!==C&&v.side===x))??!1},"faceIsClaimed");for(const l of t){if(l.isLayoutOnly)continue;const x=l.points;if(!x||x.length<2)continue;const C=oe(x,be);if(C0){const Mt=f(tt,l,!0);if(Mt>O||Mt===O&&ft>=k)continue;O=Mt,k=ft,B=tt;continue}f(tt,l)>A||ftG.edgeId!==I));const P=M.get(v);P&&M.set(v,P.filter(G=>G.edgeId!==I)),u(b,p(B[0],L),I),u(v,p(B[B.length-1],y),I)}}}d(As,"simplifyDetouredEdges");var Qt=.001,Fo=10,Ke=7;function Un(t,e){const n=e?0:t.length-1,o=e?1:-1,s=t[n],r=t[n+o];if(!s||!r)return;const i=r.x-s.x,a=r.y-s.y;if(!(Math.abs(i)+Math.abs(a)r&&en(t,Rs(r)))}d(Wn,"labelOverlapsOwnMarker");function Je(t,e){const n=[];for(const h of t){if(h.isLayoutOnly)continue;const l=h.points;if(!(!l||l.length<2))for(let x=0;x{const x=Nn(l,r);for(const{nodeId:C,rect:b}of o)if(C!==h&&en(x,b))return!0;return!1},"labelOverlapsForeignNode"),f=d((h,l)=>{const x=Nn(l,r);for(const C of n)if(C.edgeId!==h&&dn(C.p1,C.p2,x))return!0;return!1},"labelOverlapsForeignEdge"),g=d((h,l,x)=>c(h,x)||f(l,x),"labelOverlapsAnything"),p=[],M=d(h=>{for(const{id:l,rect:x}of s)if(ss(x,h))return l},"findContainingLane"),u=d((h,l)=>p.some(x=>x.labelId!==h&&en(l,x.rect)),"overlapsPlacedLabel");for(const h of t){if(h.isLayoutOnly)continue;const l=h.labelNodeId;if(!l)continue;const x=e.get(l);if(!x)continue;const C=h.points;if(!C||C.length<2)continue;const b=x.width??0,v=x.height??0;if(b<=0||v<=0)continue;const L=[];for(let nt=0;nt=Qt&&pt>=Qt||L.push({idx:nt,length:ut+pt,orientation:ut>=Qt?"horizontal":"vertical",midX:(J.x+rt.x)/2,midY:(J.y+rt.y)/2})}if(L.length===0)continue;const y=L.length>=3?L.filter(nt=>nt.idx>0&&nt.idx0?y:L,E=b>=v?"horizontal":"vertical",A=d(nt=>[...nt].sort((J,rt)=>{const ut=J.orientation===E,pt=rt.orientation===E;if(ut!==pt)return ut?-1:1;const St=J.length>=(J.orientation==="horizontal"?b:v)+2,wt=rt.length>=(rt.orientation==="horizontal"?b:v)+2;return St!==wt?St?-1:1:rt.length-J.length}),"rankSegments"),B=L[0],O=L[L.length-1],k=[.5,.25,.75,.05,.95,.15,.85,.1,.9],H=d((nt,J)=>{const rt=C[nt.idx],ut=C[nt.idx+1];return{midX:rt.x+(ut.x-rt.x)*J,midY:rt.y+(ut.y-rt.y)*J}},"anchorAtT"),P=d((nt,J,rt)=>Math.min(rt,Math.max(J,nt)),"clamp"),G=d((nt,J)=>nt.midX>=J.left-Qt&&nt.midX<=J.right+Qt&&nt.midY>=J.top-Qt&&nt.midY<=J.bottom+Qt,"pointInsideRectInclusive"),j=d(nt=>{const J=Pe(nt.midX,nt.midY,b,v),rt=M(J);if(rt)return{laneId:rt,anchor:nt,rect:J};const ut=s.find(({rect:se})=>G(nt,se));if(!ut)return;const pt=ut.rect.left+b/2+i,St=ut.rect.right-b/2-i,wt=ut.rect.top+v/2+i,Kt=ut.rect.bottom-v/2-i;if(pt>St||wt>Kt)return;const qt={midX:P(nt.midX,pt,St),midY:P(nt.midY,wt,Kt)},Jt=Pe(qt.midX,qt.midY,b,v);return G(nt,Jt)?{laneId:ut.id,anchor:qt,rect:Jt}:void 0},"placementForAnchor"),tt=d((nt,J,rt)=>nt.orientation==="horizontal"?Math.abs(J.midX-rt.x):Math.abs(J.midY-rt.y),"distanceAlongSegment"),ft=d((nt,J)=>{const ut=(nt.orientation==="horizontal"?b/2:v/2)+a;if(nt===B){const pt=C[nt.idx];if(tt(nt,J,pt)+Qt{const J=A(nt);for(const rt of J)for(const ut of k){const pt=H(rt,ut);if(!ft(rt,pt))continue;const St=j(pt);if(St&&!Wn(St.rect,C)&&!u(l,St.rect)&&!g(l,h.id,St.rect))return{laneId:St.laneId,anchor:St.anchor}}},"tryPool"),Ht=d((nt,J,rt=!1)=>{const ut=A(nt);for(const pt of ut){const St={midX:pt.midX,midY:pt.midY};if(J&&!ft(pt,St))continue;const wt=j(St);if(wt&&!Wn(wt.rect,C)&&!u(l,wt.rect)&&!c(l,wt.rect)&&(rt||!f(h.id,wt.rect)))return{laneId:wt.laneId,anchor:wt.anchor}}},"findLaneContainingFallback"),Ft=Mt(I)??(I.lengthrt.labelId===l);J>=0?p[J]={labelId:l,rect:nt}:p.push({labelId:l,rect:nt})}}}d(Je,"anchorLabelsToPolyline");var En=1e-6,Qr=8,Do=Qr/2,ti=3;function Kn(t,e){return t{const g=Kn(a,c);let p=0;const M=d(u=>{if(!u)return;const h=s.get(u);if(!h)return;const l=f==="x"?h.w/2:h.h/2;l>p&&(p=l)},"consider");M(i.labelNodeId);for(const u of t){if(u===i||u.isLayoutOnly)continue;const h=u.start,l=u.end;!h||!l||Kn(h,l)===g&&M(u.labelNodeId)}return p>0?p+ti:0},"labelClearanceFor");for(const i of t){if(i.isLayoutOnly)continue;const a=i.points;if(!lo(a,En))continue;const c=go(i,n,En);if(!c)continue;const{srcId:f,dstId:g,srcInfo:p,dstInfo:M,collinearX:u,collinearY:h}=c;if(u===h)continue;let l,x;if(u){const y=M.cy>p.cy;l={x:p.cx,y:y?p.rect.bottom:p.rect.top},x={x:M.cx,y:y?M.rect.top:M.rect.bottom}}else{const y=M.cx>p.cx;l={x:y?p.rect.right:p.rect.left,y:p.cy},x={x:y?M.rect.left:M.rect.right,y:M.cy}}if(Pt(l,x,o,[f,g],1))continue;const b=r(i,f,g,u?"x":"y"),v=b>Do?b:Do,L=[0,v,-v];for(const y of L){const I={...l},E={...x};if(u){if(I.x+=y,E.x+=y,I.x<=p.rect.left||I.x>=p.rect.right||E.x<=M.rect.left||E.x>=M.rect.right)continue}else if(I.y+=y,E.y+=y,I.y<=p.rect.top||I.y>=p.rect.bottom||E.y<=M.rect.top||E.y>=M.rect.bottom)continue;if(!Pt(I,E,o,[f,g],1)&&!nn(I,E,t,i,{epsilon:En})){i.points=[I,E];break}}}}d(Ns,"straightenCollinearSiblingDetours");function qn(t,e){const{realNodeRects:c,labelNodeRects:f}=Me(e.values()),g=d((y,I)=>Be(I,.001).map(E=>({...E,edge:y,interior:E.index>=1&&E.index<=I.length-3})),"segmentsFor"),p=d(()=>{const y=[];for(const I of t){if(I.isLayoutOnly)continue;const E=I.points;!E||E.length<2||y.push(...g(I,xt(E)))}return y},"allSegments"),M=d((y,I)=>y.horizontal&&I.horizontal?Wt(y.a.x,y.b.x,I.a.x,I.b.x)>=8&&Math.abs(y.a.y-I.a.y)<7:y.vertical&&I.vertical?Wt(y.a.y,y.b.y,I.a.y,I.b.y)>=8&&Math.abs(y.a.x-I.a.x)<7:!1,"hasCrowdedParallelTrack"),u=d((y,I)=>{const E=y.start,A=y.end,B=g(y,I);if(B.length!==I.length-1)return!1;const O=[E,A].filter(H=>!!H),k=y.labelNodeId?[y.labelNodeId]:[];for(const H of B)if(Pt(H.a,H.b,c,O,-2)||Pt(H.a,H.b,f,k,-2))return!1;for(const H of t){if(H===y||H.isLayoutOnly)continue;const P=H.points;if(!(!P||P.length<2)){for(const G of B)for(const j of g(H,xt(P)))if(M(G,j)||he(G.a,G.b,j.a,j.b,.001))return!1}}return!0},"candidateIsSafe"),h=d((y,I)=>{const E=xt(y.edge.points??[]);if(E.length<4||y.index>=E.length-1)return;const A=E.map(B=>({...B}));if(y.horizontal)A[y.index].y+=I,A[y.index+1].y+=I;else if(y.vertical)A[y.index].x+=I,A[y.index+1].x+=I;else return;return g(y.edge,A).length===A.length-1?A:void 0},"shiftedCandidate"),l=d((y,I)=>({x:y.x??(I.left+I.right)/2,y:y.y??(I.top+I.bottom)/2}),"nodeCenter"),x=d(y=>{const I=y.edge,E=xt(I.points??[]);if(E.length!==4||y.index!==1)return;const A=I.start?e.get(I.start):void 0,B=I.end?e.get(I.end):void 0,O=A?te(A):void 0,k=B?te(B):void 0,H=E.slice(y.index+2);if(!(!A||!B||!O||!k||H.length===0))return{sourceCenter:l(A,O),targetCenter:l(B,k),sourceRect:O,tail:H}},"sourceDetourContextFor"),C=d((y,I,E,A,B,O)=>{const k=A.y>=E.y,H=k?B.bottom:B.top,P=H+(k?20:-20);if(k&&y.b.y<=P+.001||!k&&y.b.y>=P-.001)return;const G=y.a.x+I;return xt([{x:E.x,y:H},{x:E.x,y:P},{x:G,y:P},{x:G,y:y.b.y},...O],.001)},"verticalSourceDetour"),b=d((y,I,E,A,B,O)=>{const k=A.x>=E.x,H=k?B.right:B.left,P=H+(k?20:-20);if(k&&y.b.x<=P+.001||!k&&y.b.x>=P-.001)return;const G=y.a.y+I;return xt([{x:H,y:E.y},{x:P,y:E.y},{x:P,y:G},{x:y.b.x,y:G},...O],.001)},"horizontalSourceDetour"),v=d((y,I)=>{const E=x(y);if(E){if(y.vertical)return C(y,I,E.sourceCenter,E.targetCenter,E.sourceRect,E.tail);if(y.horizontal)return b(y,I,E.sourceCenter,E.targetCenter,E.sourceRect,E.tail)}},"sourceDetourCandidate"),L=[-7,7,-2*7,2*7,-3*7,3*7];for(let y=0;y<12;y++){const I=p();let E=!1;for(let A=0;AP.interior);for(const P of H){for(const G of L){const j=h(P,G);if(j&&u(P.edge,j)){P.edge.points=j,E=!0;break}const tt=v(P,G);if(tt&&u(P.edge,tt)){P.edge.points=tt,E=!0;break}}if(E)break}}if(!E)return}}d(qn,"nudgeSharedInteriorSubpaths");function Os(t,e,n,o){const s=e.x-t.x,r=e.y-t.y,i=o.x-n.x,a=o.y-n.y,c=s*a-r*i;if(Math.abs(c)<1e-10)return!1;const f=n.x-t.x,g=n.y-t.y,p=(f*a-g*i)/c,M=(f*r-g*s)/c,u=.01;return p>u&&p<1-u&&M>u&&M<1-u}d(Os,"segmentsIntersect");function Ps(t){const e=t.nodes??[],n=t.edges??[],o=[];if(!n.length||!e.length)return o;const s=rs(e),r=[];for(const a of n){if(a.isLayoutOnly)continue;const c=a.points;if(!c||c.length<2)continue;const f=a.start,g=a.end,p=a.labelNodeId,M=a.id??`${f}->${g}`;for(const u of s)if(!(u.nodeId===f||u.nodeId===g)&&!(p&&u.nodeId===p)){for(let h=0;h0){const a=o.filter(f=>f.type==="edge-node-overlap").length,c=o.filter(f=>f.type==="edge-edge-crossing").length;Qe.warn(`[SWIMLANE_VALIDATE] ${o.length} issue(s) detected: ${a} edge-node overlap(s), ${c} edge crossing(s)`);for(const f of o)Qe.warn(`[SWIMLANE_VALIDATE] ${f.type}: ${f.detail}`)}return o}d(Ps,"validateSwimlanesLayout");function Bs(t,e){const n=t.nodes??[],o=t.edges??[],s=n.filter(a=>!a.isGroup);if((e==="LR"||e==="RL")&&s.length>0&&!Ms(t,e)||e==="BT"&&s.length>0&&!bs(t))return;for(const a of o){if(a.isLayoutOnly)continue;const c=a.points;!c||c.length<2||(a.points=ue(on(c)))}As(o,n),Ns(o,n),Is(o,n);const r=new Map;for(const a of n)r.set(String(a.id),a);Je(o,r),fs(o,r),Ss(o,r),qn(o,r),Cs(o,r),vs(o,r),zn(o,r),Ls(o,r);const i=d(()=>{ws(o,r),Es(o,r),Ts(o,r),Je(o,r),Gn(o,r),zn(o,r),Je(o,r),Gn(o,r)},"finalizeRenderedEdges");i(),qn(o,r),i(),Vn(o,r),jn(o,r),Vn(o,r),jn(o,r)}d(Bs,"postProcessSwimlaneLayout");function Ie(t){const e=new Map(t.nodeById),n=new Set,o=[];for(const r of t.edges){if(!e.has(r.src)||!e.has(r.dst))continue;const i=`${r.id}:${r.src}->${r.dst}`;n.has(i)||(n.add(i),o.push(r))}return{nodes:[...e.keys()],edges:o,layout:t.layout,nodeById:e}}d(Ie,"normalizeGraph");function Mo(t,e){return t.edges.filter(n=>n.dst===e)}d(Mo,"incoming");function ks(t){const e=new Map;for(const n of t.nodes)e.set(n,[]);for(const n of t.edges)e.get(n.src).push(n.dst);return e}d(ks,"buildSuccessorMap");function Io(t){const e=ks(t);for(const n of e.values())n.sort((o,s)=>o.localeCompare(s));return e}d(Io,"buildSortedSuccessorMap");function So(t){const e=new Map;for(const n of t.nodes)e.set(n,0);for(const n of t.edges)e.set(n.dst,(e.get(n.dst)??0)+1);return e}d(So,"buildInDegreeMap");function Co(t){return[...t.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,n)=>e.localeCompare(n))}d(Co,"sortedZeroInDegreeNodes");function hn(t,e=()=>!0){const n=new Map,o=new Map;for(const s of t.nodes)n.set(s,[]),o.set(s,[]);for(const s of t.edges)e(s)&&(o.get(s.src).push(s.dst),n.get(s.dst).push(s.src));return{preds:n,succs:o}}d(hn,"buildPredecessorSuccessorMaps");function vo(t,e,n,o){var i,a;let s=0;for(const c of t.nodes)o!=null&&o.skipGroups&&((i=t.nodeById.get(c))!=null&&i.isGroup)||(s=Math.max(s,n[c]??0));const r=Array.from({length:s+1},()=>[]);for(const c of e)o!=null&&o.skipGroups&&((a=t.nodeById.get(c))!=null&&a.isGroup)||r[Math.max(0,n[c]??0)].push(c);return r}d(vo,"buildLayersFromRanks");function De(t){const e=So(t),n=Co(e),o=[],s=Io(t);for(;n.length;){const r=n.shift();o.push(r);for(const i of s.get(r)??[])if(e.set(i,(e.get(i)??0)-1),(e.get(i)??0)===0){let a=0;for(;a{if(s-o<=1)return 0;const r=o+s>>1;let i=n(o,r)+n(r,s),a=o,c=r,f=o;for(;a=s||ap.dst===M.dst?p.id.localeCompare(M.id):p.dst.localeCompare(M.dst));const o=Object.create(null);for(const g of e.nodes)o[g]=0;const s=[],r=d(g=>{o[g]=1;for(const p of n.get(g)??[]){const M=p.dst;o[M]===0?r(M):o[M]===1&&s.push(p)}o[g]=2},"dfs"),i=[...e.nodes].sort((g,p)=>g.localeCompare(p));for(const g of i)o[g]===0&&r(g);const a=new Set(s.map(g=>`${g.id}:${g.src}->${g.dst}`)),c=e.edges.map(g=>a.has(`${g.id}:${g.src}->${g.dst}`)?{id:g.id,src:g.dst,dst:g.src,weight:g.weight,ref:g.ref}:g);return{acyclic:{nodes:[...e.nodes],edges:c,layout:e.layout,nodeById:new Map(e.nodeById)},reversed:s}}d(_s,"removeCycles_DFS");function Fs(t){const e=new Map,n=d(o=>{if(e.has(o))return e.get(o);const s=t.nodeById.get(o);if(!s)return e.set(o,null),null;const r=s.parentId;if(!r)return e.set(o,null),null;const a=n(r)??r;return e.set(o,a),a},"resolve");for(const o of t.nodes)n(o);return e}d(Fs,"buildTopLaneMap");function ge(t){const e=Fs(t);return n=>e.get(n)??null}d(ge,"createTopLaneResolver");function gn(t){const e=[];for(const n of t.layout.nodes??[])n.isGroup&&!n.parentId&&e.push(n.id);return[...new Set(e)].reverse()}d(gn,"buildTopLaneOrder");function Eo(t,e){const n=gn(t);if(!e||e.length===0)return n;const o=new Set(n),s=new Set,r=[];for(const i of e)!o.has(i)||s.has(i)||(s.add(i),r.push(i));for(const i of n)s.has(i)||r.push(i);return r}d(Eo,"resolveTopLaneOrder");var ei={EPSILON:1e-6},ln={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},Ho={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function Ds(t,e){const n=Ie(t),o=(e==null?void 0:e.laneOf)??(()=>null),s=e==null?void 0:e.rankHint,{preds:r}=hn(n);for(const y of r.values())y.sort((I,E)=>I.localeCompare(E));const i=De(n)??[...n.nodes].sort((y,I)=>y.localeCompare(I)),a=new Map;for(const[y,I]of i.entries())a.set(I,y);const c=new Map,f=new Map;for(const y of n.nodes)f.set(y,[]);for(const y of i){const I=(r.get(y)??[]).filter(E=>c.has(E));if(I.length>0){const E=Hs(y,I,{laneOf:o,rankHint:s,topoIndex:a});c.set(y,E),f.get(E).push(y)}else c.has(y)||c.set(y,null)}for(const y of n.nodes)c.has(y)||c.set(y,null);const g=new Set;for(const y of n.nodes)(c.get(y)??null)===null&&g.add(y);const p=[...g].sort((y,I)=>{const E=a.get(y)??0,A=a.get(I)??0;return E===A?y.localeCompare(I):E-A}),M=Xs(n),u=new Map;for(const[y,I]of M.entries())u.set(y,[...I].sort((E,A)=>E.localeCompare(A)));const h=Ys(u),l=Gs(u),x=new Map;for(const y of n.nodes)x.set(y,[]);for(const y of l)for(const I of y.nodes){const E=x.get(I);E?E.push(y.id):x.set(I,[y.id])}const C=[],b=[],v=new Set,L=d(y=>{if(!v.has(y)){v.add(y),C.push(y);for(const I of f.get(y)??[])L(I);b.push(y)}},"walk");for(const y of p)L(y);for(const y of i)L(y);return{parent:c,children:f,roots:p,componentOf:h,blocks:l,nodeBlocks:x,adjacency:u,preorder:C,postorder:b,topologicalOrder:i}}d(Ds,"buildDrivingTree");function Hs(t,e,n){const o=n.laneOf(t);return[...e].sort((r,i)=>{var l,x;const a=n.laneOf(r),c=n.laneOf(i),f=a!=null&&a===o,g=c!=null&&c===o;if(f!==g)return f?-1:1;const p=(l=n.rankHint)==null?void 0:l[r],M=(x=n.rankHint)==null?void 0:x[i];if(p!=null&&M!=null&&p!==M)return M-p;const u=n.topoIndex.get(r)??0,h=n.topoIndex.get(i)??0;return u!==h?u-h:r.localeCompare(i)})[0]}d(Hs,"chooseParent");function Xs(t){const e=new Map;for(const n of t.nodes)e.set(n,new Set);for(const n of t.edges)e.get(n.src).add(n.dst),e.get(n.dst).add(n.src);return e}d(Xs,"buildAdjacency");function Ys(t){const e=new Map;let n=0;for(const o of t.keys()){if(e.has(o))continue;const s=[o];for(;s.length>0;){const r=s.pop();if(!e.has(r)){e.set(r,n);for(const i of t.get(r)??[])e.has(i)||s.push(i)}}n++}return e}d(Ys,"assignComponents");function Gs(t){const e=new Map,n=new Map,o=[],s=[];let r=0;const i=d((a,c)=>{e.set(a,++r),n.set(a,r);for(const f of t.get(a)??[])f!==c&&(e.has(f)?(e.get(f)??0)<(e.get(a)??0)&&(o.push([a,f]),n.set(a,Math.min(n.get(a)??r,e.get(f)??r))):(o.push([a,f]),i(f,a),n.set(a,Math.min(n.get(a)??r,n.get(f)??r)),(n.get(f)??0)>=(e.get(a)??0)&&s.push($s(a,f,o,s.length))))},"visit");for(const a of t.keys())e.has(a)||i(a,null);return s}d(Gs,"computeBlocks");function $s(t,e,n,o){const s=[],r=new Set;for(;n.length>0;){const i=n.pop();if(s.push(i),r.add(i[0]),r.add(i[1]),i[0]===t&&i[1]===e||i[0]===e&&i[1]===t)break}return{id:o,edges:s,nodes:[...r]}}d($s,"popBlock");function zs(t,e,n){const o=[...t.nodes],s=new Map;for(const[b,v]of o.entries())s.set(v,b);const r=o.length,i=new Array(r).fill(-1),a=new Array(r).fill(0),c=[],f=new Set;for(const b of o){const v=n.parent.get(b)??null,L=s.get(b);L!=null&&v==null&&(i[L]=-1,a[L]=0,f.has(b)||(f.add(b),c.push(b)))}for(;c.length>0;){const b=c.shift(),v=s.get(b);if(v==null)continue;const L=n.children.get(b)??[];for(const y of L){if(f.has(y))continue;const I=s.get(y);I!=null&&(i[I]=v,a[I]=a[v]+1,f.add(y),c.push(y))}}for(const b of o){if(f.has(b))continue;const v=s.get(b);v!=null&&(i[v]=-1,a[v]=0,f.add(b))}const g=Math.max(1,Math.ceil(Math.log2(Math.max(1,r)))+1),p=Array.from({length:g},()=>new Array(r).fill(-1));for(let b=0;b{if(b===-1||v===-1)return-1;a[b]>y&1&&(b=p[y][b],b===-1))return-1;if(b===v)return b;for(let y=g-1;y>=0;y--){const I=p[y][b],E=p[y][v];I===-1||E===-1||I!==E&&(b=I,v=E)}return p[0][b]},"lcaIndex"),u=Array.from({length:r},()=>new Map);for(const b of t.edges){let v=b.src,L=b.dst,y=e[v],I=e[L];if(y==null||I==null||(y>I&&([v,L]=[L,v],[y,I]=[I,y]),y==null||I==null||y===I))continue;const E=s.get(v),A=s.get(L);if(E==null||A==null)continue;const B=M(E,A);if(B===-1)continue;const O=u[B];for(let k=y;k{if(v.size!==0)for(const[L,y]of v)b.set(L,(b.get(L)??0)+y)},"mergeInto"),x=new Set,C=d(b=>{const v=s.get(b);x.add(b);const L=v==null?void 0:u[v],y=L?new Map(L):new Map,I=n.children.get(b)??[];for(const E of I){const A=C(E),B=e[b];if(B!=null){let O=h.get(b);O||(O=new Map,h.set(b,O));let k=A.get(B)??0;const H=e[E];H!=null&&H>B&&(k+=1),O.set(E,k)}l(y,A)}return y},"dfs");for(const b of n.roots)x.has(b)||C(b);for(const b of o)x.has(b)||C(b);return h}d(zs,"computeSubtreeCrossCounts");function Vs(t,e,n){const o=new Map,s=d(r=>{let i=n[r]??0;const a=[...e.get(r)??[]];a.sort(To(n));for(const c of a){s(c);const f=o.get(c);f!=null&&(i=Math.min(i,f))}o.set(r,i)},"annotate");for(const r of t)s(r);return o}d(Vs,"annotateMinimumLayers");function To(t){return(e,n)=>{const o=t[e]??0,s=t[n]??0;return o===s?e.localeCompare(n):o-s}}d(To,"compareByRankThenId");function js(t,e,n,o){let s=0;for(const c of e){const f=n[c]??0;f>s&&(s=f)}const r=Array.from({length:s+1},()=>[]),i=new Set,a=d(c=>{if(i.has(c))return;i.add(c);const f=n[c]??0;r[f]||(r[f]=[]),r[f].push(c);for(const g of o(c))a(g)},"emit");for(const c of t)a(c);for(const c of e)if(!i.has(c)){const f=n[c]??0;r[f]||(r[f]=[]),r[f].push(c),i.add(c)}return r}d(js,"emitNodesInTreeOrder");function Us(t){const e=[];for(const n of t){const o=new Set,s=[];for(const r of n)o.has(r)||(o.add(r),s.push(r));e.push(s)}return e}d(Us,"deduplicateLayers");function Ws(t,e,n,o){return s=>{const r=t.get(s)??[];if(r.length===0)return[];const i=e[s]??0,a=[],c=[],f=n.get(s);for(const g of r){const p=o.get(g)??i;p>i?a.push({child:g,min:p}):c.push(g)}return a.sort((g,p)=>g.min===p.min?g.child.localeCompare(p.child):g.min-p.min),c.sort((g,p)=>{const M=(f==null?void 0:f.get(g))??0,u=(f==null?void 0:f.get(p))??0;if(M!==u)return M-u;const h=o.get(g)??i,l=o.get(p)??i;return h!==l?h-l:g.localeCompare(p)}),[...a.map(g=>g.child),...c]}}d(Ws,"createChildOrderer");function fn(t,e,n){const o=Ds(t,{rankHint:e,laneOf:n}),{children:s,roots:r}=o;for(const p of t.nodes)s.has(p)||s.set(p,[]);const i=zs(t,e,o),a=[...r].sort(To(e)),c=Vs(a,s,e),f=Ws(s,e,i,c);let g=js(a,t.nodes,e,f);return g=Us(g),g}d(fn,"buildMultitreeLayerOrder");function Ks(t,e,n){const o=new Set(t),s=new Set(e),r=ke(e),i=[];for(const a of n)o.has(a.src)&&s.has(a.dst)&&i.push(r.get(a.dst));return Lo(i)}d(Ks,"countCrossingsBetweenAdjacent");function Jn(t,e,n){const o=[];for(const r of e){const i=n[r.src],a=n[r.dst];if(i==null||a==null||i===a)continue;let c=r.src,f=r.dst,g=i,p=a;i>a&&(c=r.dst,f=r.src,g=a,p=i);for(let M=g;M(n[M]??0)-(n[p]??0));for(const p of g){const M=n[p]??0;if(M===0)continue;let u=0;for(const C of o.get(p)??[])u=Math.max(u,(n[C]??0)+1);if(u>=M)continue;const h=M;n[p]=u;const l=fn(t,n,s),x=Jn(l,t.edges,n);x(e[s]??0)-(e[r]??0)||s.localeCompare(r));for(const s of o){const r=n(s);if(!r)continue;const i=t.edges.filter(l=>l.src===s);if(i.length===0)continue;let a=!1,c=0;for(const l of i){const x=n(l.dst);x==null||x===r?a=!0:c++}if(c===0||a)continue;let f=0,g=!1;for(const l of t.edges){if(l.dst!==s)continue;const x=n(l.src);x&&(x===r?g=!0:f++)}if(f>0||!g)continue;const p=e[s]??0,M=p+c;let u=0;for(const l of t.edges)l.dst===s&&(u=Math.max(u,(e[l.src]??0)+1));const h=Math.max(p,u,M);h!==p&&(e[s]=h)}}d(Js,"adjustCrossLaneSources");function Zs(t,e){const n=Ie(t),o=De(n)??[...n.nodes].sort(),s=(e==null?void 0:e.compactSingleInput)??!1,r=ge(n);let i=Object.create(null);for(const c of o){const f=Mo(n,c),g=e!=null&&e.ignoreCrossLaneEdges?f.filter(p=>{const M=r(p.src),u=r(c);return!M||!u?!0:M===u}):f;if(g.length===0)i[c]=0;else if(s&&g.length===1){const p=g[0].src,M=r(p),u=r(c);M!==u?i[c]=i[p]??0:i[c]=(i[p]??0)+1}else{let p=-1/0;for(const M of g)p=Math.max(p,(i[M.src]??0)+1);i[c]=p===-1/0?0:p}}return((e==null?void 0:e.optimizeRanksByCrossings)??!1)&&(i=qs(n,i)),e!=null&&e.ignoreCrossLaneEdges&&Js(n,i),{layers:fn(n,i,r),rankOf:i,dummy:new Set}}d(Zs,"assignLayers_LongestPath");function Qs(t,e){const n=Ie(t),s={...Zs(n,{compactSingleInput:e==null?void 0:e.compactSingleInput,ignoreCrossLaneEdges:e==null?void 0:e.ignoreCrossLaneEdges,optimizeRanksByCrossings:e==null?void 0:e.optimizeRanksByCrossings}).rankOf},r=ge(n),{preds:i,succs:a}=hn(n,h=>{if(e!=null&&e.ignoreCrossLaneEdges){const l=r(h.src),x=r(h.dst);if(l&&x&&l!==x)return!1}return!0}),c=De(n)??[...n.nodes],f=[...c].reverse(),g=d((h,l)=>{let x=0;for(const v of i.get(h)??[])x=Math.max(x,(s[v]??0)+1);let C=Number.POSITIVE_INFINITY;const b=a.get(h)??[];return b.length>0&&(C=Math.min(...b.map(v=>(s[v]??0)-1))),Number.isFinite(C)||(C=Math.max(x,l)),Math.min(Math.max(l,x),C)},"clampFeasible"),p=ln.GRAVITY_ITERATIONS,M=d(h=>{let l=!1;for(const x of h){const C=i.get(x)??[],b=a.get(x)??[];if(C.length===0&&b.length===0)continue;const v=C.length>0?C.reduce((E,A)=>E+(s[A]??0)+1,0)/C.length:s[x]??0,L=b.length>0?b.reduce((E,A)=>E+(s[A]??0)-1,0)/b.length:s[x]??0,y=Math.round((v+L)/2),I=g(x,y);I!==s[x]&&(s[x]=I,l=!0)}return l},"relaxOrder");for(let h=0;h0){const x=Math.min(...l.map(C=>(s[C]??0)-1));(s[h]??0)>x&&(s[h]=x)}}return{layers:vo(n,c,s),rankOf:s,dummy:new Set}}d(Qs,"assignLayers_Gravity");function tr(t){const e=So(t),n=Io(t);let o=Co(e);const s=[];for(;o.length>0;){const r=[];for(const i of o){s.push(i);for(const a of n.get(i)??[])e.set(a,(e.get(a)??0)-1),(e.get(a)??0)===0&&r.push(a)}o=r.sort((i,a)=>i.localeCompare(a))}return s.length===t.nodes.length?s:null}d(tr,"topoSortByGenerationIfAcyclic");function er(t,e){const n=Ie(t),o=(e==null?void 0:e.direction)==="LR"?tr(n)??[...n.nodes].sort():De(n)??[...n.nodes].sort(),s=ge(n),r=d(g=>s(g)??g,"laneOf"),i=Object.create(null),a=new Map,c=d((g,p)=>(e==null?void 0:e.ignoreCrossLaneEdges)??!0?r(g)===r(p)?1:0:1,"edgeWeight");for(const g of o){const p=n.nodeById.get(g);if(p!=null&&p.isGroup)continue;const M=Mo(n,g);let u=0;if(M.length>0)for(const C of M){const b=C.src,v=i[b]??0;u=Math.max(u,v+c(b,g))}const h=r(g),l=a.get(h)??0,x=Math.max(u,l);i[g]=x,a.set(h,x+1)}return{layers:vo(n,o,i,{skipGroups:!0}),rankOf:i,dummy:new Set}}d(er,"assignLayers_LaneAwareCompact");function nr(t,e){const n=Ie(e),{rankOf:o}=t,s=t.layers.map(u=>[...u]),r=new Set(t.dummy?[...t.dummy]:[]);let i=0;const a=new Map(n.nodeById),c=d(u=>{const h=`placeholder-${i++}`,l={id:h,isGroup:!1,isDummy:!0,width:0,height:0};for(a.set(h,l),r.add(h);s.length<=u;)s.push([]);return s[u].push(h),o[h]=u,h},"addDummyAt"),f=[...n.edges].sort((u,h)=>u.id===h.id?u.src===h.src?u.dst.localeCompare(h.dst):u.src.localeCompare(h.src):u.id.localeCompare(h.id)),g=[];for(const u of f){const h=o[u.src]??0,l=o[u.dst]??0;if(l-h<=1){g.push(u);continue}let x=u.src;for(let b=h+1,v=0;b!n.nodes.includes(u))],edges:g,layout:n.layout,nodeById:a};return{layering:{layers:s,rankOf:o,dummy:r},graphWithDummies:M}}d(nr,"makeProperLayering");function Zn(t){const e=t.length;if(e===0)return Number.POSITIVE_INFINITY;const n=[...t].sort((o,s)=>o-s);return e%2===1?n[(e-1)/2]:.5*(n[e/2-1]+n[e/2])}d(Zn,"median");function Qn(t){return t.length===0?Number.POSITIVE_INFINITY:t.reduce((n,o)=>n+o,0)/t.length}d(Qn,"barycenter");function or(t,e,n,o){const s=new Map;for(const r of t)s.set(r,[]);for(const r of n)o==="down"?e.has(r.src)&&s.has(r.dst)&&s.get(r.dst).push(e.get(r.src)):e.has(r.dst)&&s.has(r.src)&&s.get(r.src).push(e.get(r.dst));return s}d(or,"neighborPositionsFor");function sr(t,e,n){const o=n.get(t)??0,s=n.get(e)??0;return o!==s?o-s:t.localeCompare(e)}d(sr,"currentOrderTieBreak");function to(t,e,n){const o=new Set(t),s=new Set(e),r=ke(t),i=ke(e),a=[];for(const f of n)o.has(f.src)&&s.has(f.dst)&&a.push({u:r.get(f.src),v:i.get(f.dst)});a.sort((f,g)=>f.u===g.u?f.v-g.v:f.u-g.u);const c=a.map(f=>f.v);return Lo(c)}d(to,"countCrossingsBetweenAdjacent");function Ze(t,e,n){return[...t].sort((o,s)=>{const r=Zn(e.get(o)??[]),i=Zn(e.get(s)??[]);return r===i?sr(o,s,n):isFinite(r)?isFinite(i)?r-i:-1:1})}d(Ze,"sortByHeuristic");function eo(t,e,n,o,s,r){const i=ke(t),a=ke(e),c=or(e,i,n,o);if(!s||!r||r.length===0)return Ze(e,c,a);const f=new Map;for(const M of e){const u=s(M),h=f.get(u)??[];h.push(M),f.set(u,h)}const g=[];for(const M of r){const u=f.get(M);if(!u||u.length===0)continue;const h=Ze(u,c,a);g.push(...h)}const p=f.get(null);if(p&&p.length>0){const M=Ze(p,c,a);for(const u of M){const h=Qn(c.get(u)??[]);let l=g.length;if(isFinite(h))for(const[x,C]of g.entries()){const b=Qn(c.get(C)??[]);if(hi.has(l.src)&&a.has(l.dst)),g=c?n.filter(l=>a.has(l.src)&&c.has(l.dst)):void 0,p=d(l=>{let x=to(t,l,f);return g&&o&&(x+=to(l,o,g)),x},"crossingScore"),M=s?new Map:null;if(s&&M)for(const l of e)M.set(l,s(l));let u=!0,h=p(r);for(;u;){u=!1;for(let l=0;l+1[...a]),s=e.edges,r=ge(e),i=Eo(e,n==null?void 0:n.laneOrder);for(let a=0;a<3;a++){for(let c=1;c=0;c--)o[c]=eo(o[c+1],o[c],s,"up",r,i),o[c]=no(o[c+1],o[c],s,o[c-1],r)}return{layers:o}}d(rr,"orderLayers");function ir(t,e,n){const o=(n==null?void 0:n.layerGap)??Ho.DEFAULT_LAYER_GAP,s=(n==null?void 0:n.nodeGap)??Ho.DEFAULT_NODE_GAP,r=(n==null?void 0:n.laneGap)??s*2,i=(n==null?void 0:n.direction)??"TB",a=i==="LR"||i==="RL",c=t.layers,f=Object.create(null),g=Object.create(null),p=d(O=>e.nodeById.get(O),"getNode"),M=d(O=>{var k;return((k=p(O))==null?void 0:k.width)??0},"getWidth"),u=d(O=>{var k;return((k=p(O))==null?void 0:k.height)??0},"getHeight"),h=ge(e),l=Eo(e,n==null?void 0:n.laneOrder),x=c.map(O=>O.reduce((k,H)=>Math.max(k,u(H)),0)),C=[];if(a)for(let O=0;O+1Math.max(Mt,M(Ht)),0),H=c[O+1].reduce((Mt,Ht)=>Math.max(Mt,M(Ht)),0),P=x[O],G=x[O+1],j=P/2+G/2,tt=(k+H)/2,ft=Math.max(0,tt-j-o);C.push(ft)}const b=new Set;for(const O of c)for(const k of O)b.add(h(k));const v=b.has(null),L=l.filter(O=>b.has(O)),y=[...v?[null]:[],...L],I=Object.create(null);for(const O of L)I[O]=0;v&&(I.null=0);for(const O of c){const k=Object.create(null),H=[];for(const P of O){const G=h(P);G===null?H.push(P):(k[G]||(k[G]=[])).push(P)}for(const[P,G]of Object.entries(k)){const j=G.reduce((tt,ft)=>tt+M(ft),0)+s*Math.max(0,G.length-1);I[P]=Math.max(I[P]??0,j)}if(v&&H.length){const P=H.reduce((G,j)=>G+M(j),0)+s*Math.max(0,H.length-1);I.null=Math.max(I.null??0,P)}}const E=new Map;{const O=y.map(P=>(P===null?I.null:I[P])??0);let H=-(O.reduce((P,G)=>P+G,0)+r*Math.max(0,y.length-1))/2;for(let P=0;PM(nt)),Ht=Mt.reduce((nt,J)=>nt+J,0)+s*(tt.length-1);let Ft=ft-Ht/2;for(const[nt,J]of tt.entries()){const rt=Mt[nt];f[J]=Ft+rt/2,g[J]=A+H/2,Ft+=rt+s}}}const G=C[O]??0;A+=H+o+G}const B=new Map;for(const O of e.edges){const k=O.ref.id;B.has(k)||B.set(k,[]),B.get(k).push(O)}for(const[,O]of B){if(O.length===0)continue;const k=O[0].ref,H=k.start,P=k.end;if(H==null||P==null)continue;const G=Math.round(((f[H]??0)+(f[P]??0))/2),j=new Set;for(const tt of O)j.add(tt.src),j.add(tt.dst);for(const tt of j){if(tt===H||tt===P)continue;const ft=e.nodeById.get(tt);ft!=null&&ft.isDummy&&(f[tt]=G)}}return{x:f,y:g}}d(ir,"assignCoordinates");var cr=8;function ar(t){let e=2166136261;for(let n=0;n>>0}d(ar,"hashString");function lr(t){let e=t>>>0;return()=>{e+=1831565813;let n=e;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}d(lr,"mulberry32");function fr(t,e){const n=[...t],o=lr(e);for(let s=n.length-1;s>0;s--){const r=Math.floor(o()*(s+1));[n[s],n[r]]=[n[r],n[s]]}return n}d(fr,"deterministicShuffle");function dr(t,e){let n=0;for(const[o,s]of t.entries())n+=Math.abs(o-(e.get(s)??o));return n}d(dr,"sourceDistance");function oo(t,e){const n=new Map;for(const[s,r]of t.entries())n.set(r,s);let o=0;for(const{a:s,b:r,weight:i}of e){const a=n.get(s),c=n.get(r);a==null||c==null||(o+=i*Math.abs(a-c))}return o}d(oo,"laneArrangementCost");function ur(t){const e=gn(t);if(e.length<2)return[];const n=new Map(e.map((r,i)=>[r,i])),o=ge(t),s=new Map;for(const r of t.layout.edges??[]){if(r.isLayoutOnly)continue;const i=typeof r.start=="string"?r.start:void 0,a=typeof r.end=="string"?r.end:void 0;if(!i||!a||!t.nodeById.has(i)||!t.nodeById.has(a))continue;const c=o(i),f=o(a);if(!c||!f||c===f)continue;const g=n.get(c),p=n.get(f);if(g==null||p==null)continue;const[M,u]=g<=p?[c,f]:[f,c],h=`${M}\0${u}`,l=s.get(h);l?l.weight++:s.set(h,{a:M,b:u,weight:1})}return[...s.values()]}d(ur,"buildWeightedLaneEdges");function so(t,e,n){const o=[...t];let s=oo(o,e),r=!0,i=0;const a=Math.max(1,o.length);for(;r&&is.a===r.a?s.b.localeCompare(r.b):s.a.localeCompare(r.a)).map(({a:s,b:r,weight:i})=>`${s}:${r}:${i}`).join("|");return ar(`${t.join("|")}#${o}#${n}`)}d(gr,"seedForRestart");function mr(t,e={}){const n=gn(t);if(n.length<2)return n;const o=ur(t);if(o.length===0)return n;const s=new Map(n.map((a,c)=>[a,c]));let r=so(n,o,s);const i=Math.max(0,e.restarts??cr);for(let a=0;alt&&c*3>=a?i>0?"bottom":"top":a>lt?r>0?"right":"left":n}d(ro,"chooseOrthogonalSide");function io(t,e){return Math.abs(t.to-e.from)m.isGroup&&!m.parentId);for(const m of f){const S={id:m.id},w=d(T=>{i.set(T.id,S),n.filter(N=>N.parentId===T.id).forEach(w)},"assignLane");w(m)}const g=n.filter(m=>!m.isGroup&&!m.isEdgeLabel).map(m=>{const S=m.width??10,w=m.height??10,T=m.x??0,N=m.y??0,D=ni;return{nodeId:m.id,minX:T-S/2-D,maxX:T+S/2+D,minY:N-w/2-D,maxY:N+w/2+D,visualXHalfExtent:c?w/2+D:S/2+D}}),p=d((m,S,w,T)=>{let N=a.find(D=>D.orientation===m&&Math.abs(D.coord-S)<1);return N||(N={id:`pipe-${m}-${S.toFixed(0)}`,orientation:m,coord:S,spanMin:w,spanMax:T,tracks:[]},a.push(N)),N.spanMin=Math.min(N.spanMin,w),N.spanMax=Math.max(N.spanMax,T),N},"getOrAddPipe"),M=d((m,S)=>{const w=m.width??10,T=m.height??10,N=m.x??0,D=m.y??0;switch(S){case"top":return{x:N,y:D-T/2};case"bottom":return{x:N,y:D+T/2};case"left":return{x:N-w/2,y:D};case"right":return{x:N+w/2,y:D}}},"portForSide"),u=d((m,S,w)=>M(m,ro(m,S,w?"bottom":"top")),"getOrthogonalPort"),h=[],l=[],x=new Set,C=1e3,b=d((m,S,w)=>{if(h.length===0)return 0;const T=Math.abs(S.y-w.y)U||z.from-lt<=W&&z.to+lt>=W&&(D+=C)}else if(N){const W=S.x,ot=Math.min(S.y,w.y)-lt,U=Math.max(S.y,w.y)+lt;if(U<=ot)return 0;for(const z of h)z.edgeIndex===m||z.orientation!=="horizontal"||z.pipe.coordU||z.from-lt<=W&&z.to+lt>=W&&(D+=C)}return D},"crossingPenalty"),v=s.map((m,S)=>{if(!m.start||!m.end)return{idx:S,crossLane:0,dx:0,dy:0};const w=r.get(m.start),T=r.get(m.end),N=i.get(m.start),D=i.get(m.end),W=N&&D&&N.id!==D.id?1:0,ot=w&&T?Math.abs((T.x??0)-(w.x??0)):0,U=w&&T?Math.abs((T.y??0)-(w.y??0)):0;return{idx:S,crossLane:W,dx:ot,dy:U}}).sort((m,S)=>{if(m.crossLane!==S.crossLane)return S.crossLane-m.crossLane;const w=m.dx+m.dy,T=S.dx+S.dy;return Math.abs(w-T)>1?w-T:m.idx-S.idx}).map(m=>m.idx),L=d((m,S,w,T)=>{const N=Math.min(m.x,S.x),D=Math.max(m.x,S.x),W=Math.min(m.y,S.y),ot=Math.max(m.y,S.y);return!!g.find(z=>w&&z.nodeId===w||T&&z.nodeId===T?!1:Math.abs(m.x-S.x)>lt?z.minYm.y&&z.maxX>N&&z.minXm.x&&z.maxY>W&&z.minYro(m,S,"bottom"),"determineSide"),A=new Map;for(const[m,S]of s.entries()){if(!S.start||!S.end||S.start===S.end||S.points&&S.points.length>0)continue;const w=r.get(S.start),T=r.get(S.end);if(!w||!T)continue;const N=(T.x??0)-(w.x??0),D=(T.y??0)-(w.y??0);A.set(m,{edgeIdx:m,srcId:S.start,dstId:S.end,srcSide:E(w,{x:T.x??0,y:T.y??0}),dstSide:E(T,{x:w.x??0,y:w.y??0}),absDx:Math.abs(N),absDy:Math.abs(D),dxSign:Math.sign(N),dySign:Math.sign(D)})}const B=d(m=>m.srcSide==="top"||m.srcSide==="bottom"?m.absDx===0?1/0:m.absDy/m.absDx:m.absDy===0?1/0:m.absDx/m.absDy,"preferenceStrength"),O=d(m=>m.srcSide==="top"||m.srcSide==="bottom"?m.dxSign>=0?"right":"left":m.dySign>=0?"bottom":"top","secondarySide"),k=new Map;for(const m of A.values()){const S=`${m.srcId}:${m.srcSide}`;k.has(S)||k.set(S,[]),k.get(S).push(m)}const H=new Map,P=d((m,S)=>`${m}:${S}`,"loadKey");for(const m of A.values())H.set(P(m.srcId,m.srcSide),(H.get(P(m.srcId,m.srcSide))??0)+1),H.set(P(m.dstId,m.dstSide),(H.get(P(m.dstId,m.dstSide))??0)+1);for(const m of k.values())if(!(m.length<2)){m.sort((S,w)=>{const T=B(S),N=B(w);return Math.abs(T-N)>1e-9?N-T:S.edgeIdx-w.edgeIdx});for(let S=1;S=N||(H.set(P(w.srcId,w.srcSide),N-1),H.set(P(w.srcId,T),D+1),w.srcSide=T)}}const G=d(m=>{const S=m==null?void 0:m.shape;return S==="question"||S==="diamond"},"isDiamondNode"),j=new Map;for(const m of A.values())j.has(m.dstId)||j.set(m.dstId,new Set),j.get(m.dstId).add(m.dstSide);for(const m of A.values()){if(!G(r.get(m.srcId)))continue;const S=j.get(m.srcId);if(!(S!=null&&S.has(m.srcSide)))continue;const w=O(m);if(S.has(w)||(H.get(P(m.srcId,w))??0)>0)continue;const T=H.get(P(m.srcId,m.srcSide))??0;H.set(P(m.srcId,m.srcSide),Math.max(0,T-1)),H.set(P(m.srcId,w),1),m.srcSide=w}for(const m of A.values()){const{edgeIdx:S,srcId:w,dstId:T,srcSide:N,dstSide:D}=m,W=r.get(w),ot=r.get(T),U=`${w}:${N}:src`,z=N==="top"||N==="bottom"?ot.x??0:ot.y??0;y.has(U)||y.set(U,[]),y.get(U).push({edgeIdx:S,oppositeCoord:z});const bt=`${T}:${D}:dst`,dt=D==="top"||D==="bottom"?W.x??0:W.y??0;y.has(bt)||y.set(bt,[]),y.get(bt).push({edgeIdx:S,oppositeCoord:dt})}const tt=new Map,ft=8;for(const[m,S]of y){if(S.length<2)continue;S.sort((At,Gt)=>At.oppositeCoord-Gt.oppositeCoord);const w=m.split(":"),T=w.slice(0,-2).join(":"),N=w[w.length-2],D=w[w.length-1],W=r.get(T);if(!W)continue;const U=N==="left"||N==="right"?W.height??10:W.width??10,z=W.shape,dt=z==="question"||z==="diamond"?U*.3:U,st=Math.min(20,Math.max(ft,dt/(S.length+1))),Bt=-(st*(S.length-1))/2;for(const[At,Gt]of S.entries()){const ee=Bt+At*st,xn=`${Gt.edgeIdx}:${D}`;tt.set(xn,ee)}}const Mt=d(m=>{var S;return!!((S=s[m])!=null&&S.labelNodeId)},"edgeHasLabelNode"),Ht=d((m,S)=>m?(y.get(`${m}:${S}:src`)??[]).some(({edgeIdx:w})=>Mt(w))||(y.get(`${m}:${S}:dst`)??[]).some(({edgeIdx:w})=>Mt(w)):!1,"faceHasLabelNode"),Ft=d((m,S,w)=>S==="top"||S==="bottom"?{x:m.x+w,y:m.y}:{x:m.x,y:m.y+w},"applyPortOffset"),nt=d((m,S,w)=>{const T=A.get(m),N={x:w.x??0,y:w.y??0},D={x:S.x??0,y:S.y??0},W=(T==null?void 0:T.srcSide)??E(S,N),ot=(T==null?void 0:T.dstSide)??E(w,D);let U=T?M(S,T.srcSide):u(S,N,!0),z=T?M(w,T.dstSide):u(w,D,!1);const bt=tt.get(`${m}:src`),dt=tt.get(`${m}:dst`);return bt!==void 0&&(U=Ft(U,W,bt)),dt!==void 0&&(z=Ft(z,ot,dt)),{pSrcPort:U,pDstPort:z,srcSide:W,dstSide:ot}},"portsForEdge");for(const m of v){const S=s[m];if(l[m]=[],!S.start||!S.end||S.points&&S.points.length>0||S.start===S.end)continue;const w=r.get(S.start),T=r.get(S.end);if(!w||!T)continue;const{pSrcPort:N,pDstPort:D,srcSide:W,dstSide:ot}=nt(m,w,T),U={...N},z={...D},bt=W==="top"||W==="bottom",dt=ot==="top"||ot==="bottom";if(bt){const X=N.y>(w.y??0);U.y=X?N.y+ie:N.y-ie}else{const X=N.x>(w.x??0);U.x=X?N.x+ie:N.x-ie}if(dt){const X=D.y>(T.y??0);z.y=X?D.y+ie:D.y-ie}else{const X=D.x>(T.x??0);z.x=X?D.x+ie:D.x-ie}const ct=d((X,$)=>{for(const Q of g)if(!$.includes(Q.nodeId)&&X.x>Q.minX&&X.xQ.minY&&X.y{if(Tt){const kt=X.y>($.y??0);return{x:(Q.x??0)>=X.x?ht.maxX+Ce:ht.minX-Ce,y:kt?ht.maxY+Ne:ht.minY-Ne,leavesPositiveSide:kt}}const Ct=X.x>($.x??0),Rt=(Q.y??0)>=X.y;return{x:Ct?ht.maxX+Ce:ht.minX-Ce,y:Rt?ht.maxY+Ne:ht.minY-Ne,leavesPositiveSide:Ct}},"obstacleDetour");let It=[];const Bt=[S.start,S.end],At=ct(U,Bt);if(At.inside&&At.obstacle){const X=At.obstacle;if(bt){const $=st(N,w,T,X,!0);U.x=$.x,U.y=$.y;const Q=$.leavesPositiveSide?Math.min(X.minY-2,N.y+ie):Math.max(X.maxY+2,N.y-ie);It=[{x:N.x,y:Q},{x:$.x,y:Q},{x:$.x,y:$.y}]}else{const $=st(N,w,T,X,!1),Q=$.leavesPositiveSide?Math.min(X.minX-2,N.x+ie):Math.max(X.maxX+2,N.x-ie);U.x=$.x,U.y=$.y,It=[{x:Q,y:N.y},{x:Q,y:$.y},{x:$.x,y:$.y}]}}let Gt=[];const ee=ct(z,Bt);if(ee.inside&&ee.obstacle){const X=ee.obstacle;if(dt){const $=st(D,T,w,X,!0);z.x=$.x,z.y=$.y,Gt=[{x:$.x,y:$.y},{x:D.x,y:$.y}]}else{const $=st(D,T,w,X,!1);z.x=$.x,z.y=$.y,Gt=[{x:$.x,y:$.y},{x:$.x,y:D.y}]}}if(It.length===0&&Gt.length===0){const X=Ce,$=Math.abs(U.x-z.x)1||Ct>1,kt=I.get(S.start??"")??0,mt=I.get(S.end??"")??0,Vt=Tt>1&&Ht(S.start,W)||Ct>1&&Ht(S.end,ot),re=Tt<=1||kt<=2,Dt=Ct<=1||mt<=2;if(($||Q)&&!ht&&(!Rt||Rt&&!Vt&&re&&Dt)&&!L(N,D,S.start,S.end)){S.points=[{...N},{...U},{...z},{...D}],x.add(m);const vt=Q?"horizontal":"vertical",Ut=Q?N.y:N.x,Lt=Q?Math.min(N.x,D.x):Math.min(N.y,D.y),Et=Q?Math.max(N.x,D.x):Math.max(N.y,D.y),Zt={id:`fast-path-${vt}-${Ut.toFixed(0)}-${m}`,orientation:vt,coord:Ut,spanMin:Lt,spanMax:Et,tracks:[]};h.push({edgeIndex:m,segmentIndex:0,orientation:vt,pipe:Zt,trackIndex:0,from:Lt,to:Et});continue}}const xn=p("vertical",U.x,U.y,U.y);U.x=xn.coord;const Mr=p("vertical",z.x,z.y,z.y);z.x=Mr.coord;let ye=Math.min(U.x,z.x)-50,pe=Math.max(U.x,z.x)+50,we=Math.min(U.y,z.y)-50,Ae=Math.max(U.y,z.y)+50;for(const X of g){const $=Math.min(U.x,z.x),Q=Math.max(U.x,z.x),ht=Math.min(U.y,z.y),Tt=Math.max(U.y,z.y);X.minX$&&X.minYht&&(ye=Math.min(ye,X.minX-qe),pe=Math.max(pe,X.maxX+qe),we=Math.min(we,X.minY-qe),Ae=Math.max(Ae,X.maxY+qe))}for(const X of g){if(X.maxXpe||X.maxYAe)continue;const $=Ce;p("horizontal",X.minY-$,ye,pe),p("horizontal",X.maxY+$,ye,pe);const Q=Ne;p("vertical",X.minX-Q,we,Ae),p("vertical",X.maxX+Q,we,Ae)}p("horizontal",U.y,ye,pe),p("horizontal",z.y,ye,pe);const Ir=a.filter(X=>X.orientation==="horizontal"&&X.coord>=we&&X.coord<=Ae),Sr=a.filter(X=>X.orientation==="vertical"&&X.coord>=ye&&X.coord<=pe),He=d((X,$)=>`${X.toFixed(1)},${$.toFixed(1)}`,"getKey"),Xe=He(U.x,U.y),wo=He(z.x,z.y),Ye=new Map,bn=new Map,Mn=new Map,Ge=new Set,Se=[];Ye.set(Xe,0),Mn.set(Xe,"n"),Se.push({key:Xe,f:Math.hypot(z.x-U.x,z.y-U.y),pt:U}),Ge.add(Xe);let $t=[];const xe=d((X,$)=>L(X,$,S.start,S.end),"checkSegmentBlocked"),In={x:z.x,y:U.y},Cr=xe(U,In),vr=xe(In,z),Lr=Cr||vr,Sn={x:U.x,y:z.y},Er=xe(U,Sn),Tr=xe(Sn,z);if(Lr?Er||Tr||(Math.abs(U.x-z.x)0;){Se.sort((mt,Vt)=>mt.f-Vt.f);const X=Se.shift();if(Ge.delete(X.key),X.key===wo){let mt=wo,Vt=z;for($t=[Vt];bn.has(mt);){const re=bn.get(mt);$t.unshift(re),Vt=re,mt=He(re.x,re.y)}break}const $=X.pt.x,Q=X.pt.y,ht=Sr.sort((mt,Vt)=>mt.coord-Vt.coord),Tt=ht.findIndex(mt=>Math.abs(mt.coord-$)<1),Ct=Ir.sort((mt,Vt)=>mt.coord-Vt.coord),Rt=Ct.findIndex(mt=>Math.abs(mt.coord-Q)<1),kt=[];Tt>0&&kt.push({x:ht[Tt-1].coord,y:Q}),Tt>=0&&Tt0&&kt.push({x:$,y:Ct[Rt-1].coord}),Rt>=0&&Rtne.nodeId===S.start||ne.nodeId===S.end?!1:Vt!==re?ne.minYQ&&ne.maxX>Vt&&ne.minX$&&ne.maxY>Dt&&ne.minY10&&Cn<-5||Re<-10&&Cn>5)&&(Et=Math.abs(Cn)*100),(Zt>10&&$e<-5||Zt<-10&&$e>5)&&(Et+=Math.abs($e)*50);let Ao=0;const Ro=Mn.get(X.key)??"n",No=Math.abs($e)>lt?"h":"v";Ro!=="n"&&Ro!==No&&(Ao=50);const wr=Ut+Lt+Et+Ao,ze=(Ye.get(X.key)??1/0)+wr,Oo=Math.abs(z.x-mt.x)+Math.abs(z.y-mt.y);if(ze<(Ye.get(vt)??1/0))if(bn.set(vt,X.pt),Ye.set(vt,ze),Mn.set(vt,No),!Ge.has(vt))Se.push({key:vt,f:ze+Oo,pt:mt}),Ge.add(vt);else{const ne=Se.findIndex(Ar=>Ar.key===vt);ne!==-1&&(Se[ne].f=ze+Oo)}}}if($t.length===0&&($t=[U,{x:U.x,y:z.y},z]),$t.length>4){const X=$t[0],$=$t[$t.length-1];let Q=Math.min(X.x,$.x),ht=Math.max(X.x,$.x),Tt=Math.min(X.y,$.y),Ct=Math.max(X.y,$.y);for(const Dt of $t)Q=Math.min(Q,Dt.x),ht=Math.max(ht,Dt.x),Tt=Math.min(Tt,Dt.y),Ct=Math.max(Ct,Dt.y);const Rt=ht>Math.max(X.x,$.x),kt=QLt.minXjt&&Lt.minY_t);if(Ut.length>0){let Lt=Math.max(X.x,$.x);for(const Et of Ut){const Zt=(Et.minX+Et.maxX)/2;if(Et.visualXHalfExtent===void 0||isNaN(Et.visualXHalfExtent))continue;const Re=Zt+Et.visualXHalfExtent+Dt;Lt=Math.max(Lt,Re)}isNaN(Lt)||(ht=Lt)}}if(kt){const jt=g.filter(_t=>_t.minXMath.min(X.y,$.y));if(jt.length>0){let _t=Math.min(X.x,$.x);for(const vt of jt){const Lt=(vt.minX+vt.maxX)/2-vt.visualXHalfExtent-Dt;_t=Math.min(_t,Lt)}Q=_t}}}const mt=d(Dt=>{const jt=$.y>X.y,_t=g.filter(Lt=>{const Et=Math.min(X.x,$.x)Lt.minX,Zt=Math.min(X.y,$.y)Lt.minY;return Et&&Zt});let vt=_t;if(c&&_t.length>0){const Lt=_t.filter(Et=>Et.minXDt);Lt.length>0&&(vt=Lt)}if(vt.length===0)return $.y;const Ut=Ce;if(jt){const Et=Math.max(...vt.map(Zt=>Zt.maxY))+Ut;if(Et<$.y-lt)return Et}else{const Et=Math.min(...vt.map(Zt=>Zt.minY))-Ut;if(Et>$.y+lt)return Et}return $.y},"findBestReturnY"),Vt=d(Dt=>{const jt=mt(Dt),_t={x:Dt,y:X.y},vt={x:Dt,y:jt},Ut={x:$.x,y:jt},Lt=xe(X,_t),Et=xe(_t,vt),Zt=xe(vt,Ut),Re=jt!==$.y?xe(Ut,$):!1;return!Lt&&!Et&&!Zt&&!Re?Math.abs(jt-$.y)=3){const X=zt[zt.length-1],$=zt[zt.length-2],Q=zt[zt.length-3],ht=Math.abs(Q.y-$.y)Math.abs(X.x-Q.x)&&zt.splice(-2,1)}else if(Tt){const Ct=Math.sign($.y-Q.y),Rt=Math.sign(X.y-Q.y);Ct!==0&&Ct===Rt&&Math.abs($.y-Q.y)>Math.abs(X.y-Q.y)&&zt.splice(-2,1)}}const fe=[zt[0]];for(let X=1;X$.x,Ct=ht.x>Q.x;if(Tt!==Ct){fe.push(Q);continue}continue}if(Math.abs($.x-Q.x)$.y,Ct=ht.y>Q.y;if(Tt!==Ct){fe.push(Q);continue}continue}fe.push(Q)}fe.push(zt[zt.length-1]);for(let X=0;Xm.from{const N=!T.segments.some(W=>(W.edgeIndex!==S.edgeIndex||W.segmentIndex!==S.segmentIndex)&&J(W,m)),D=!w.segments.some(W=>(W.edgeIndex!==m.edgeIndex||W.segmentIndex!==m.segmentIndex)&&J(W,S));return N&&D?(m.trackIndex=T.index,S.trackIndex=w.index,w.segments=[...w.segments.filter(W=>W.edgeIndex!==m.edgeIndex||W.segmentIndex!==m.segmentIndex),{edgeIndex:S.edgeIndex,segmentIndex:S.segmentIndex,from:S.from,to:S.to}],T.segments=[...T.segments.filter(W=>W.edgeIndex!==S.edgeIndex||W.segmentIndex!==S.segmentIndex),{edgeIndex:m.edgeIndex,segmentIndex:m.segmentIndex,from:m.from,to:m.to}],!0):!1},"trySwapSegmentsAcrossTracks"),ut=d(m=>{const S=m.tracks.length;return m.tracks[S]={index:S,coord:m.coord,segments:[]},S},"createNewTrack"),pt=d((m,S)=>{const w=m.pipe.tracks[m.trackIndex];w.segments=w.segments.filter(N=>N.edgeIndex!==m.edgeIndex||N.segmentIndex!==m.segmentIndex),m.trackIndex=S,m.pipe.tracks[S].segments.push({edgeIndex:m.edgeIndex,segmentIndex:m.segmentIndex,from:m.from,to:m.to})},"moveSegmentToTrack"),St=d((m,S)=>{const w=l[m.edgeIndex];for(const T of w){const N=h[T];N.pipe===m.pipe&&pt(N,S)}},"moveSegmentChainToTrack"),wt=d(m=>{const S=l[m.edgeIndex],w=S.indexOf(h.indexOf(m)),T=[];return w>0&&T.push(h[S[w-1]]),w{if(m.orientation===S.orientation)return!1;const w=m.orientation==="horizontal"?m:S,T=m.orientation==="horizontal"?S:m;return T.pipe.coord>w.from&&T.pipe.coordT.from&&w.pipe.coord{for(const w of m.tracks)if(!w.segments.some(N=>(N.edgeIndex!==S.edgeIndex||N.segmentIndex!==S.segmentIndex)&&J(N,S)))return w.index;return-1},"findAvailableTrack"),Jt=d((m,S)=>{if(m.trackIndex===S.trackIndex)return J(m,S);const w=wt(m),T=wt(S);return w.some(N=>T.some(D=>Kt(N,D)))},"segmentsConflict"),se=d((m,S,w)=>{if(rt(m,S,m.pipe.tracks[m.trackIndex],S.pipe.tracks[S.trackIndex]))return;const T=qt(m.pipe,S);w(S,T!==-1?T:ut(m.pipe))},"resolveTrackConflict"),Ee=d(m=>{let S=0;for(let w=0;w{if(me.has(m))return me.get(m);const S=l[m];if(S.length===0){const ot={dest:0,deviation:0,base:0,delta:0};return me.set(m,ot),ot}const T=h[S[0]].pipe.coord;let N=T;for(let ot=1;otMath.abs(bt-T)?z:bt;break}}const D=Math.abs(N-T),W={dest:N,deviation:D,base:T,delta:N-T};return me.set(m,W),W},"getDestInfo"),mn=d(()=>{let m=0;const S=new Map;for(const[T,N]of s.entries())l[T].length!==0&&N.start&&(S.has(N.start)||S.set(N.start,[]),S.get(N.start).push(T));const w=d(T=>{const N=s[T];if(!N.start||!N.end)return 0;const D=r.get(N.start),W=r.get(N.end);if(!D||!W)return 0;const ot=(W.x??0)-(D.x??0),U=(W.y??0)-(D.y??0);return Math.abs(ot)+Math.abs(U)},"getEdgeDistance");for(const T of S.values()){T.sort((D,W)=>{const ot=Te(D),U=Te(W);if(Math.abs(ot.deviation-U.deviation)>1)return ot.deviation-U.deviation;if(Math.abs(ot.dest-U.dest)>1)return ot.dest-U.dest;const z=w(D),bt=w(W);if(Math.abs(z-bt)>1)return bt-z;const dt=l[D].length,ct=l[W].length;if(dt!==ct)return dt-ct;if(dt===1){const st=l[D][0],It=l[W][0];if(h[st]&&h[It]){const Bt=h[st],At=h[It],Gt=Math.abs(Bt.to-Bt.from),ee=Math.abs(At.to-At.from);if(Math.abs(Gt-ee)>1)return Gt-ee}}return 0});const N=T.map(D=>h[l[D][0]]);m+=Ee(N)}return m},"fixSourceHandleCrossings"),yn=d(()=>{let m=0;const S=new Map;for(const[w,T]of s.entries())l[w].length!==0&&T.end&&(S.has(T.end)||S.set(T.end,[]),S.get(T.end).push(w));for(const w of S.values()){w.sort((N,D)=>{const W=d(z=>{const bt=l[z];if(bt.length<2)return 0;const dt=h[bt[bt.length-2]];return Math.abs(dt.to-dt.from)},"getDist"),ot=W(N),U=W(D);return Math.abs(ot-U)>.1?ot-U:N-D});const T=w.map(N=>h[l[N][l[N].length-1]]);m+=Ee(T)}return m},"fixTargetHandleCrossings"),pn=d(()=>{let m=0;for(const S of a){const w=[];for(const T of S.tracks)for(const N of T.segments){const D=l[N.edgeIndex].find(W=>h[W].segmentIndex===N.segmentIndex);D!==void 0&&w.push(h[D])}w.sort((T,N)=>T.edgeIndex-N.edgeIndex||T.segmentIndex-N.segmentIndex);for(let T=0;T{T.segments.forEach(N=>{S.push({edgeIndex:N.edgeIndex,segmentIndex:N.segmentIndex,trackIndex:T.index,from:N.from,to:N.to})})}),S.sort((T,N)=>T.from-N.from);const w=[];if(S.length>0){let T=[S[0]],N=S[0].to;for(let D=1;DN.add(st.trackIndex));const D=new Map;T.forEach(st=>{const It=Te(st.edgeIndex);D.set(st.trackIndex,(D.get(st.trackIndex)??0)+It.delta)});const W=[...N].filter(st=>(D.get(st)??0)<-1),ot=[...N].filter(st=>(D.get(st)??0)>1),U=[...N].filter(st=>Math.abs(D.get(st)??0)<=1);W.sort((st,It)=>(D.get(It)??0)-(D.get(st)??0)),ot.sort((st,It)=>(D.get(st)??0)-(D.get(It)??0));const z=d((st,It)=>{T.filter(Bt=>Bt.trackIndex===st).forEach(Bt=>{const At=x.has(Bt.edgeIndex)?m.coord:It;F.set(`${Bt.edgeIndex}-${Bt.segmentIndex}`,At)})},"assignCoord");let bt=0;for(const st of W)bt++,z(st,m.coord-bt*Tn);if(U.length===0&&N.size>0){const st=[...N].sort((At,Gt)=>Math.abs(D.get(At)??0)-Math.abs(D.get(Gt)??0))[0],It=W.indexOf(st);It!==-1&&W.splice(It,1);const Bt=ot.indexOf(st);Bt!==-1&&ot.splice(Bt,1),U.push(st)}let dt=0;for(const st of U){if(dt===0)z(st,m.coord);else{const It=dt%2===1?1:-1,Bt=Math.ceil(dt/2);z(st,m.coord+It*Bt*Tn*.5)}dt++}let ct=0;for(const st of ot)ct++,z(st,m.coord+ct*Tn)}}for(const[m,S]of s.entries()){const w=l[m]??[];if(w.length===0)continue;const T=[],N=r.get(S.start),D=r.get(S.end),{pSrcPort:W,pDstPort:ot}=nt(m,N,D),U=w.map(dt=>{const ct=h[dt],st=F.get(`${ct.edgeIndex}-${ct.segmentIndex}`)??ct.pipe.coord;return{orient:ct.orientation,coord:st,from:ct.from,to:ct.to}});T.push(W);for(let dt=0;dtlt&&T.push(ve(ct,It)),Gt&&At.orient===ct.orient)if(Math.abs(ct.coord-At.coord)>lt){const ee=ct.orient==="vertical"?(It+At.from)/2:io(ct,At);T.push(ve(ct,ee),ve(At,ee))}else(dt===0||dt===U.length-2)&&T.push(ve(ct,io(ct,At)));else if(Gt)T.push(ve(ct,At.coord));else{const ee=Math.abs(ct.from-It)lt||Math.abs(z.y-ot.y)>lt)&&T.push(ot);const bt=[];T.length>0&&bt.push(T[0]);for(let dt=1;dtlt||Math.abs(ct.y-st.y)>lt)&&bt.push(ct)}S.points=bt}for(const m of s){const S=m.__originalEdge;S&&m.points&&(S.points=m.points)}t.edges=(t.edges??[]).filter(m=>!m.isLayoutOnly);const V=d((m,S)=>{const w=S.x??0,T=S.y??0,N=S.width??0,D=S.height??0;if(N<=0||D<=0)return m;const W=w-N/2,ot=w+N/2,U=T-D/2,z=T+D/2;if(m.xot||m.yz)return m;const bt=m.x-W,dt=ot-m.x,ct=m.y-U,st=z-m.y,It=Math.min(bt,dt,ct,st);return It===bt?{x:W,y:m.y}:It===dt?{x:ot,y:m.y}:It===ct?{x:m.x,y:U}:{x:m.x,y:z}},"nodeBoundaryClamp");for(const m of t.edges){const S=m.points;if(!S||S.length<2)continue;const w=m.start,T=m.end,N=w?r.get(w):void 0,D=T?r.get(T):void 0;N&&(S[0]=V(S[0],N)),D&&(S[S.length-1]=V(S[S.length-1],D))}return t}d(pr,"routeEdgesOrthogonal");function xr(t){return t.direction??"TB"}d(xr,"getSwimlaneDirection");function br(t){var g,p,M,u,h;const e=es(t),n=((g=t.config.flowchart)==null?void 0:g.nodeSpacing)??40,o=((p=t.config.flowchart)==null?void 0:p.rankSpacing)??100,s=((M=t.config.swimlane)==null?void 0:M.ignoreCrossLaneEdges)??!0,r=((u=t.config.swimlane)==null?void 0:u.optimizeRanksByCrossings)??!0,i=((h=t.config.swimlane)==null?void 0:h.automaticLaneOrdering)??!1,a=xr(t),{ordered:c,coordinates:f}=yr(e,{nodeGap:n,layerGap:o,ignoreCrossLaneEdges:s,optimizeRanksByCrossings:r,automaticLaneOrdering:i,direction:a});ns(e,c,f,{nodeGap:n,layerGap:o});for(const l of t.edges??[])delete l.points;pr(t,a);for(const l of t.edges??[])(!l.curve||l.curve==="basis")&&(l.curve="rounded");return Bs(t,a),Ps(t),a}d(br,"runSwimlaneLayoutCore");async function oi(t,e){const n=e.select("g");Or(n,t.markers,t.type,t.diagramId),Pr(),Br(),kr(),Nr(),ts(t);const o=os(t);t.nodes=o.nodes,t.edges=o.edges;const{groups:s}=await Xo(n,t);br(t),await Jo(t,s)}d(oi,"render");export{oi as render}; diff --git a/veadk/webui/assets/visualizations/mermaid/swimlanesDiagram-ULZ7WXOC-COw-LLw5.js b/veadk/webui/assets/visualizations/mermaid/swimlanesDiagram-ULZ7WXOC-COw-LLw5.js new file mode 100644 index 000000000..2bf5e3e26 --- /dev/null +++ b/veadk/webui/assets/visualizations/mermaid/swimlanesDiagram-ULZ7WXOC-COw-LLw5.js @@ -0,0 +1,8 @@ +import{c as r,s as e}from"./flowDiagram-UKHOOZJN-DjW8-Nxh.js";import{a}from"./mermaid.core-DAx4nvmm.js";import"../../app/index-8JtvDNuA.js";import"./chunk-5VM5RSS4-BKHSrXIw.js";import"./chunk-XXDRQBXY-BdI3VXTi.js";import"./chunk-KBJHAD2P-C0rklDe7.js";import"./chunk-2GRJ4B5K-BNT0kar4.js";import"../../chunks/purify.es-BnINGy_Y.js";import"../../chunks/channel-B1gj3-V8.js";var o=a(t=>`${e(t)} + .swimlane.cluster rect { + stroke: ${t.clusterBorder} !important; + } + [data-look="neo"].cluster rect { + filter: none; + } +`,"getStyles"),m=o,y=r({defaultLayout:"swimlane",styles:m});export{y as diagram}; diff --git a/veadk/webui/assets/visualizations/mermaid/swimlanesDiagram-ULZ7WXOC-DIP88zHc.js b/veadk/webui/assets/visualizations/mermaid/swimlanesDiagram-ULZ7WXOC-DIP88zHc.js deleted file mode 100644 index 760790fc9..000000000 --- a/veadk/webui/assets/visualizations/mermaid/swimlanesDiagram-ULZ7WXOC-DIP88zHc.js +++ /dev/null @@ -1,8 +0,0 @@ -import{c as r,s as e}from"./flowDiagram-UKHOOZJN-BtIca__0.js";import{a}from"./mermaid.core-y4TF8bTw.js";import"../../app/index-BNPwMQXG.js";import"./chunk-5VM5RSS4-BDBKcK2Z.js";import"./chunk-XXDRQBXY-B8qTF1qQ.js";import"./chunk-KBJHAD2P-DtNDDRN1.js";import"./chunk-2GRJ4B5K-CvII-2ZL.js";import"../../chunks/purify.es-BnINGy_Y.js";import"../../chunks/channel-Bbp-1bKw.js";var o=a(t=>`${e(t)} - .swimlane.cluster rect { - stroke: ${t.clusterBorder} !important; - } - [data-look="neo"].cluster rect { - filter: none; - } -`,"getStyles"),m=o,y=r({defaultLayout:"swimlane",styles:m});export{y as diagram}; diff --git a/veadk/webui/assets/visualizations/mermaid/timeline-definition-Z64GVDOM-CKcwRGgc.js b/veadk/webui/assets/visualizations/mermaid/timeline-definition-Z64GVDOM-mpZy5ZHk.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/timeline-definition-Z64GVDOM-CKcwRGgc.js rename to veadk/webui/assets/visualizations/mermaid/timeline-definition-Z64GVDOM-mpZy5ZHk.js index 9972fcb96..ed459f424 100644 --- a/veadk/webui/assets/visualizations/mermaid/timeline-definition-Z64GVDOM-CKcwRGgc.js +++ b/veadk/webui/assets/visualizations/mermaid/timeline-definition-Z64GVDOM-mpZy5ZHk.js @@ -1,4 +1,4 @@ -import{a as l,X as pt,ak as Wt,ap as Pt,H as Bt,Y as gt,at as S,aP as Vt,aC as Ft,aW as ft,_ as zt,w as Gt,s as Ot}from"./mermaid.core-y4TF8bTw.js";import{aG as J}from"../../app/index-BNPwMQXG.js";import{d as ot}from"../../chunks/arc-fsSJ4XQX.js";import"../../chunks/purify.es-BnINGy_Y.js";var tt=function(){var e=l(function(k,s,d,h){for(d=d||{},h=k.length;h--;d[k[h]]=s);return d},"o"),t=[6,11,13,14,15,17,19,20,23,24],n=[1,12],i=[1,13],r=[1,14],c=[1,15],a=[1,16],o=[1,19],p=[1,20],y={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:l(function(s,d,h,g,m,u,w){var v=u.length-1;switch(m){case 1:return u[v-1];case 3:g.setDirection("LR");break;case 4:g.setDirection("TD");break;case 5:this.$=[];break;case 6:u[v-1].push(u[v]),this.$=u[v-1];break;case 7:case 8:this.$=u[v];break;case 9:case 10:this.$=[];break;case 11:g.getCommonDb().setDiagramTitle(u[v].substr(6)),this.$=u[v].substr(6);break;case 12:this.$=u[v].trim(),g.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=u[v].trim(),g.getCommonDb().setAccDescription(this.$);break;case 15:g.addSection(u[v].substr(8)),this.$=u[v].substr(8);break;case 18:g.addTask(u[v],0,""),this.$=u[v];break;case 19:g.addEvent(u[v].substr(2)),this.$=u[v];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(t,[2,5],{5:6}),e(t,[2,2]),e(t,[2,3]),e(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:n,15:i,17:r,19:c,20:a,21:17,22:18,23:o,24:p},e(t,[2,10],{1:[2,1]}),e(t,[2,6]),{12:21,14:n,15:i,17:r,19:c,20:a,21:17,22:18,23:o,24:p},e(t,[2,8]),e(t,[2,9]),e(t,[2,11]),{16:[1,22]},{18:[1,23]},e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,7]),e(t,[2,12]),e(t,[2,13])],defaultActions:{},parseError:l(function(s,d){if(d.recoverable)this.trace(s);else{var h=new Error(s);throw h.hash=d,h}},"parseError"),parse:l(function(s){var d=this,h=[0],g=[],m=[null],u=[],w=this.table,v="",M=0,R=0,P=2,V=1,L=u.slice.call(arguments,1),_=Object.create(this.lexer),C={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(C.yy[F]=this.yy[F]);_.setInput(s,C.yy),C.yy.lexer=_,C.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var z=_.yylloc;u.push(z);var q=_.options&&_.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function X(A){h.length=h.length-2*A,m.length=m.length-A,u.length=u.length-A}l(X,"popStack");function O(){var A;return A=g.pop()||_.lex()||V,typeof A!="number"&&(A instanceof Array&&(g=A,A=g.pop()),A=d.symbols_[A]||A),A}l(O,"lex");for(var $,N,b,T,E={},H,I,B,D;;){if(N=h[h.length-1],this.defaultActions[N]?b=this.defaultActions[N]:(($===null||typeof $>"u")&&($=O()),b=w[N]&&w[N][$]),typeof b>"u"||!b.length||!b[0]){var K="";D=[];for(H in w[N])this.terminals_[H]&&H>P&&D.push("'"+this.terminals_[H]+"'");_.showPosition?K="Parse error on line "+(M+1)+`: +import{a as l,X as pt,ak as Wt,ap as Pt,H as Bt,Y as gt,at as S,aP as Vt,aC as Ft,aW as ft,_ as zt,w as Gt,s as Ot}from"./mermaid.core-DAx4nvmm.js";import{aG as J}from"../../app/index-8JtvDNuA.js";import{d as ot}from"../../chunks/arc-B85TaV_o.js";import"../../chunks/purify.es-BnINGy_Y.js";var tt=function(){var e=l(function(k,s,d,h){for(d=d||{},h=k.length;h--;d[k[h]]=s);return d},"o"),t=[6,11,13,14,15,17,19,20,23,24],n=[1,12],i=[1,13],r=[1,14],c=[1,15],a=[1,16],o=[1,19],p=[1,20],y={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:l(function(s,d,h,g,m,u,w){var v=u.length-1;switch(m){case 1:return u[v-1];case 3:g.setDirection("LR");break;case 4:g.setDirection("TD");break;case 5:this.$=[];break;case 6:u[v-1].push(u[v]),this.$=u[v-1];break;case 7:case 8:this.$=u[v];break;case 9:case 10:this.$=[];break;case 11:g.getCommonDb().setDiagramTitle(u[v].substr(6)),this.$=u[v].substr(6);break;case 12:this.$=u[v].trim(),g.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=u[v].trim(),g.getCommonDb().setAccDescription(this.$);break;case 15:g.addSection(u[v].substr(8)),this.$=u[v].substr(8);break;case 18:g.addTask(u[v],0,""),this.$=u[v];break;case 19:g.addEvent(u[v].substr(2)),this.$=u[v];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(t,[2,5],{5:6}),e(t,[2,2]),e(t,[2,3]),e(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:n,15:i,17:r,19:c,20:a,21:17,22:18,23:o,24:p},e(t,[2,10],{1:[2,1]}),e(t,[2,6]),{12:21,14:n,15:i,17:r,19:c,20:a,21:17,22:18,23:o,24:p},e(t,[2,8]),e(t,[2,9]),e(t,[2,11]),{16:[1,22]},{18:[1,23]},e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,7]),e(t,[2,12]),e(t,[2,13])],defaultActions:{},parseError:l(function(s,d){if(d.recoverable)this.trace(s);else{var h=new Error(s);throw h.hash=d,h}},"parseError"),parse:l(function(s){var d=this,h=[0],g=[],m=[null],u=[],w=this.table,v="",M=0,R=0,P=2,V=1,L=u.slice.call(arguments,1),_=Object.create(this.lexer),C={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(C.yy[F]=this.yy[F]);_.setInput(s,C.yy),C.yy.lexer=_,C.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var z=_.yylloc;u.push(z);var q=_.options&&_.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function X(A){h.length=h.length-2*A,m.length=m.length-A,u.length=u.length-A}l(X,"popStack");function O(){var A;return A=g.pop()||_.lex()||V,typeof A!="number"&&(A instanceof Array&&(g=A,A=g.pop()),A=d.symbols_[A]||A),A}l(O,"lex");for(var $,N,b,T,E={},H,I,B,D;;){if(N=h[h.length-1],this.defaultActions[N]?b=this.defaultActions[N]:(($===null||typeof $>"u")&&($=O()),b=w[N]&&w[N][$]),typeof b>"u"||!b.length||!b[0]){var K="";D=[];for(H in w[N])this.terminals_[H]&&H>P&&D.push("'"+this.terminals_[H]+"'");_.showPosition?K="Parse error on line "+(M+1)+`: `+_.showPosition()+` Expecting `+D.join(", ")+", got '"+(this.terminals_[$]||$)+"'":K="Parse error on line "+(M+1)+": Unexpected "+($==V?"end of input":"'"+(this.terminals_[$]||$)+"'"),this.parseError(K,{text:_.match,token:this.terminals_[$]||$,line:_.yylineno,loc:z,expected:D})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+N+", token: "+$);switch(b[0]){case 1:h.push($),m.push(_.yytext),u.push(_.yylloc),h.push(b[1]),$=null,R=_.yyleng,v=_.yytext,M=_.yylineno,z=_.yylloc;break;case 2:if(I=this.productions_[b[1]][1],E.$=m[m.length-I],E._$={first_line:u[u.length-(I||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(I||1)].first_column,last_column:u[u.length-1].last_column},q&&(E._$.range=[u[u.length-(I||1)].range[0],u[u.length-1].range[1]]),T=this.performAction.apply(E,[v,R,M,C.yy,b[1],m,u].concat(L)),typeof T<"u")return T;I&&(h=h.slice(0,-1*I*2),m=m.slice(0,-1*I),u=u.slice(0,-1*I)),h.push(this.productions_[b[1]][0]),m.push(E.$),u.push(E._$),B=w[h[h.length-2]][h[h.length-1]],h.push(B);break;case 3:return!0}}return!0},"parse")},x=function(){var k={EOF:1,parseError:l(function(d,h){if(this.yy.parser)this.yy.parser.parseError(d,h);else throw new Error(d)},"parseError"),setInput:l(function(s,d){return this.yy=d||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:l(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var d=s.match(/(?:\r\n?|\n).*/g);return d?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:l(function(s){var d=s.length,h=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var g=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var m=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===g.length?this.yylloc.first_column:0)+g[g.length-h.length].length-h[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[m[0],m[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:l(function(s){this.unput(this.match.slice(s))},"less"),pastInput:l(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var s=this.pastInput(),d=new Array(s.length+1).join("-");return s+this.upcomingInput()+` diff --git a/veadk/webui/assets/visualizations/mermaid/vennDiagram-T6HMQDX7-DpGQcsH1.js b/veadk/webui/assets/visualizations/mermaid/vennDiagram-T6HMQDX7-23c87AQK.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/vennDiagram-T6HMQDX7-DpGQcsH1.js rename to veadk/webui/assets/visualizations/mermaid/vennDiagram-T6HMQDX7-23c87AQK.js index 4c01ed524..2f5737589 100644 --- a/veadk/webui/assets/visualizations/mermaid/vennDiagram-T6HMQDX7-DpGQcsH1.js +++ b/veadk/webui/assets/visualizations/mermaid/vennDiagram-T6HMQDX7-23c87AQK.js @@ -1,4 +1,4 @@ -import{d as Wt,aQ as Kt,V as Ht,$ as Xt,aT as Yt,W as Zt,aR as Qt,a as S,X as St,aP as Jt,k as $t,ak as te,ap as ee,H as ne,B as se,s as ie,r as re,O as oe}from"./mermaid.core-y4TF8bTw.js";import{aG as rt}from"../../app/index-BNPwMQXG.js";import"../../chunks/purify.es-BnINGy_Y.js";const It=(t,n)=>Wt(t,"a",-n),_t=1e-10;function st(t,n){const s=le(t),e=s.filter(l=>ae(l,t));let i=0,r=0;const o=[];if(e.length>1){const l=Et(e);for(let u=0;ua.angle-u.angle);let h=e[e.length-1];for(let u=0;uy.radius*2&&(g=y.radius*2),(d==null||d.width>g)&&(d={circle:y,width:g,p1:a,p2:h,large:g>y.radius,sweep:!0})}d!=null&&(o.push(d),i+=lt(d.circle.radius,d.width),h=a)}}else{let l=t[0];for(let u=1;uMath.abs(l.radius-t[u].radius)){h=!0;break}h?i=r=0:(i=l.radius*l.radius*Math.PI,o.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-_t,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return r/=2,n&&(n.area=i+r,n.arcArea=i,n.polygonArea=r,n.arcs=o,n.innerPoints=e,n.intersectionPoints=s),i+r}function ae(t,n){return n.every(s=>K(t,s)=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Tt(t,n){const s=K(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const r=(e*e-i*i+s*s)/(2*s),o=Math.sqrt(e*e-r*r),l=t.x+r*(n.x-t.x)/s,h=t.y+r*(n.y-t.y)/s,u=-(n.y-t.y)*(o/s),a=-(n.x-t.x)*(o/s);return[{x:l+u,y:h-a},{x:l-u,y:h+a}]}function Et(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function ce(t,n,s,e){e=e||{};const i=e.maxIterations||100,r=e.tolerance||1e-10,o=t(n),l=t(s);let h=s-n;if(o*l>0)throw"Initial bisect points must have opposite signs";if(o===0)return n;if(l===0)return s;for(let u=0;u=0&&(n=a),Math.abs(h)ct(n))}function tt(t,n){let s=0;for(let e=0;ev.fx-c.fx,T=n.slice(),w=n.slice(),g=n.slice(),b=n.slice();for(let v=0;v{const N=f.slice();return N.fx=f.fx,N.id=f.id,N});x.sort((f,N)=>f.id-N.id),s.history.push({x:y[0].slice(),fx:y[0].fx,simplex:x})}d=0;for(let x=0;x=y[m-1].fx){let x=!1;if(w.fx>c.fx?(J(g,1+a,T,-a,c),g.fx=t(g),g.fx=1)break;for(let f=1;fl+r*i*h||u>=E)M=i;else{if(Math.abs(p)<=-o*h)return i;p*(M-y)>=0&&(M=y),y=i,E=u}return 0}for(let y=0;y<10;++y){if(J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),p=tt(e.fxprime,n),u>l+r*i*h||y&&u>=a)return m(d,i,a);if(Math.abs(p)<=-o*h)return i;if(p>=0)return m(i,d,u);a=u,d=i,i*=2}return i}function he(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const r=n.slice();let o,l,h=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),o=e.fxprime.slice(),ht(o,e.fxprime,-1);for(let a=0;a{const p={};for(let d=0;dxt(t,n,e)-s,0,t+n)}function fe(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(s){const l=new Map;for(const h of e)for(let u=0;ul===h?0:lr.sets.length===2).forEach(r=>{const o=s[r.sets[0]],l=s[r.sets[1]],h=Math.sqrt(n[o].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ft(h,u,r.size);e[o][l]=e[l][o]=a;let p=0;r.size+1e-10>=Math.min(n[o].size,n[l].size)?p=1:r.size<=1e-10&&(p=-1),i[o][l]=i[l][o]=p}),{distances:e,constraints:i}}function ge(t,n,s,e){for(let r=0;r0&&y<=p||d<0&&y>=p||(i+=2*M*M,n[2*r]+=4*M*(o-u),n[2*r+1]+=4*M*(l-a),n[2*h]+=4*M*(u-o),n[2*h+1]+=4*M*(a-l))}}return i}function xe(t,n={}){let s=pe(t,n);const e=n.lossFunction||et;if(t.length>=8){const i=ye(t,n),r=e(i,t),o=e(s,t);r+1e-8d.map(m=>m/l));const h=(d,m)=>ge(d,m,r,o);let u=null;for(let d=0;dp.sets.length===2);for(const p of t){let d=p.weight!=null?p.weight:1;const m=p.sets[0],y=p.sets[1];p.size+Rt>=Math.min(e[m].size,e[y].size)&&(d=0),i[m].push({set:y,size:p.size,weight:d}),i[y].push({set:m,size:p.size,weight:d})}const r=[];Object.keys(i).forEach(p=>{let d=0;for(let m=0;mt[o]));const r=e.weight!=null?e.weight:1;s+=r*(i-e.size)*(i-e.size)}return s}function Ct(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],h=t[e.sets[1]];i=xt(l.radius,h.radius,K(l,h))}else i=st(e.sets.map(l=>t[l]));const r=e.weight!=null?e.weight:1,o=Math.log((i+1)/(e.size+1));s+=r*o*o}return s}function me(t,n,s){if(s==null?t.sort((i,r)=>r.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,r=t[0].y;for(const o of t)o.x-=i,o.y-=r}if(t.length===2&&K(t[0],t[1])1){const i=Math.atan2(t[1].x,t[1].y)-n,r=Math.cos(i),o=Math.sin(i);for(const l of t){const h=l.x,u=l.y;l.x=r*h-o*u,l.y=o*h+r*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const r=t[1].y/(1e-10+t[1].x);for(const o of t){var e=(o.x+r*o.y)/(1+r*r);o.x=2*e-o.x,o.y=2*e*r-o.y}}}}function be(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,r){const o=n(i),l=n(r);o.parent=l}for(let i=0;i{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((r,o)=>Math.max(r,o[s]+o.radius),Number.NEGATIVE_INFINITY),i=t.reduce((r,o)=>Math.min(r,o[s]-o.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Dt(t,n,s){n==null&&(n=Math.PI/2);let e=Ft(t).map(u=>Object.assign({},u));const i=be(e);for(const u of i){me(u,n,s);const a=dt(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let r=e.bounds;const o=(r.xRange.max-r.xRange.min)/50;function l(u,a,p){if(!u)return;const d=u.bounds;let m,y;if(a)m=r.xRange.max-d.xRange.min+o;else{m=r.xRange.max-d.xRange.max;const M=(d.xRange.max-d.xRange.min)/2-(r.xRange.max-r.xRange.min)/2;M<0&&(m+=M)}if(p)y=r.yRange.max-d.yRange.min+o;else{y=r.yRange.max-d.yRange.max;const M=(d.yRange.max-d.yRange.min)/2-(r.yRange.max-r.yRange.min)/2;M<0&&(y+=M)}for(const M of u)M.x+=m,M.y+=y,e.push(M)}let h=1;for(;h({radius:a*m.radius,x:e+p+(m.x-o.min)*a,y:e+d+(m.y-l.min)*a,setid:m.setid})))}function Nt(t){const n={};for(const s of t)n[s.setid]=s;return n}function Ft(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function ve(t={}){let n=!1,s=600,e=350,i=15,r=1e3,o=Math.PI/2,l=!0,h=null,u=!0,a=!0,p=null,d=null,m=!1,y=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,E={},T=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],w=0,g=function(x){if(x in E)return E[x];var f=E[x]=T[w];return w+=1,w>=T.length&&(w=0),f},b=At,v=et;function c(x){let f=x.datum();const N=new Set;f.forEach(k=>{k.size==0&&k.sets.length==1&&N.add(k.sets[0])}),f=f.filter(k=>!k.sets.some(D=>N.has(D)));let I={},R={};if(f.length>0){let k=b(f,{lossFunction:v,distinct:m});l&&(k=Dt(k,o,d)),I=Ot(k,s,e,i,h),R=Lt(I,f,M)}const Z={};f.forEach(k=>{k.label&&(Z[k.sets]=k.label)});function U(k){if(k.sets in Z)return Z[k.sets];if(k.sets.length==1)return""+k.sets[0]}x.selectAll("svg").data([I]).enter().append("svg");const B=x.select("svg");n?B.attr("viewBox",`0 0 ${s} ${e}`):B.attr("width",s).attr("height",e);const V={};let z=!1;B.selectAll(".venn-area path").each(function(k){const D=this.getAttribute("d");k.sets.length==1&&D&&!m&&(z=!0,V[k.sets[0]]=Me(D))});function q(k){return D=>{const G=k.sets.map(Q=>{let W=V[Q],Y=I[Q];return W||(W={x:s/2,y:e/2,radius:1}),Y||(Y={x:s/2,y:e/2,radius:1}),{x:W.x*(1-D)+Y.x*D,y:W.y*(1-D)+Y.y*D,radius:W.radius*(1-D)+Y.radius*D}});return wt(G,y)}}const A=B.selectAll(".venn-area").data(f,k=>k.sets),F=A.enter().append("g").attr("class",k=>`venn-area venn-${k.sets.length==1?"circle":"intersection"}${k.colour||k.color?" venn-coloured":""}`).attr("data-venn-sets",k=>k.sets.join("_")),j=F.append("path"),L=F.append("text").attr("class","label").text(k=>U(k)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(j.style("fill-opacity","0").filter(k=>k.sets.length==1).style("fill",k=>k.colour?k.colour:k.color?k.color:g(k.sets)).style("fill-opacity",".25"),L.style("fill",k=>k.colour||k.color?"#FFF":t.textFill?t.textFill:k.sets.length==1?g(k.sets):"#444"));function P(k){return typeof k.transition=="function"?k.transition("venn").duration(r):k}let _=x;z&&typeof _.transition=="function"?(_=P(x),_.selectAll("path").attrTween("d",q)):_.selectAll("path").attr("d",k=>wt(k.sets.map(D=>I[D])),y);const C=_.selectAll("text").filter(k=>k.sets in R).text(k=>U(k)).attr("x",k=>Math.floor(R[k.sets].x)).attr("y",k=>Math.floor(R[k.sets].y));u&&(z?"on"in C?C.on("end",ot(I,U)):C.each("end",ot(I,U)):C.each(ot(I,U)));const O=P(A.exit()).remove();typeof A.transition=="function"&&O.selectAll("path").attrTween("d",q);const X=O.selectAll("text").attr("x",s/2).attr("y",e/2);return p!==null&&(L.style("font-size","0px"),C.style("font-size",p),X.style("font-size","0px")),{circles:I,textCentres:R,nodes:A,enter:F,update:_,exit:O}}return c.wrap=function(x){return arguments.length?(u=x,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(x){return arguments.length?(s=x,c):s},c.height=function(x){return arguments.length?(e=x,c):e},c.padding=function(x){return arguments.length?(i=x,c):i},c.distinct=function(x){return arguments.length?(m=x,c):m},c.colours=function(x){return arguments.length?(g=x,c):g},c.colors=function(x){return arguments.length?(g=x,c):g},c.fontSize=function(x){return arguments.length?(p=x,c):p},c.round=function(x){return arguments.length?(y=x,c):y},c.duration=function(x){return arguments.length?(r=x,c):r},c.layoutFunction=function(x){return arguments.length?(b=x,c):b},c.normalize=function(x){return arguments.length?(l=x,c):l},c.scaleToFit=function(x){return arguments.length?(h=x,c):h},c.styled=function(x){return arguments.length?(a=x,c):a},c.orientation=function(x){return arguments.length?(o=x,c):o},c.orientationOrder=function(x){return arguments.length?(d=x,c):d},c.lossFunction=function(x){return arguments.length?(v=x==="default"?et:x==="logRatio"?Ct:x,c):v},c}function ot(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,r=n(s)||"",o=r.split(/\s+/).reverse(),h=(r.length+o.length)/3;let u=o.pop(),a=[u],p=0;const d=1.1;e.textContent=null;const m=[];function y(g){const b=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return b.textContent=g,m.push(b),e.append(b),b}let M=y(u);for(;u=o.pop(),!!u;){a.push(u);const g=a.join(" ");M.textContent=g,g.length>h&&M.getComputedTextLength()>i&&(a.pop(),M.textContent=a.join(" "),a=[u],M=y(u),p++)}const E=.35-p*d/2,T=e.getAttribute("x"),w=e.getAttribute("y");m.forEach((g,b)=>{g.setAttribute("x",T),g.setAttribute("y",w),g.setAttribute("dy",`${E+b*d}em`)})}}function at(t,n,s){let e=n[0].radius-K(n[0],t);for(let i=1;i=r&&(i=e[a],r=p)}const o=zt(a=>-1*at({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:o[0],y:o[1]};let h=!0;for(const a of t)if(K(l,a)>a.radius){h=!1;break}for(const a of n)if(K(l,a)a.p1))}function ke(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e0&&console.log("WARNING: area "+o+" not represented on screen")}return e}function Ie(t,n,s){const e=[];return e.push(` +import{d as Wt,aQ as Kt,V as Ht,$ as Xt,aT as Yt,W as Zt,aR as Qt,a as S,X as St,aP as Jt,k as $t,ak as te,ap as ee,H as ne,B as se,s as ie,r as re,O as oe}from"./mermaid.core-DAx4nvmm.js";import{aG as rt}from"../../app/index-8JtvDNuA.js";import"../../chunks/purify.es-BnINGy_Y.js";const It=(t,n)=>Wt(t,"a",-n),_t=1e-10;function st(t,n){const s=le(t),e=s.filter(l=>ae(l,t));let i=0,r=0;const o=[];if(e.length>1){const l=Et(e);for(let u=0;ua.angle-u.angle);let h=e[e.length-1];for(let u=0;uy.radius*2&&(g=y.radius*2),(d==null||d.width>g)&&(d={circle:y,width:g,p1:a,p2:h,large:g>y.radius,sweep:!0})}d!=null&&(o.push(d),i+=lt(d.circle.radius,d.width),h=a)}}else{let l=t[0];for(let u=1;uMath.abs(l.radius-t[u].radius)){h=!0;break}h?i=r=0:(i=l.radius*l.radius*Math.PI,o.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-_t,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return r/=2,n&&(n.area=i+r,n.arcArea=i,n.polygonArea=r,n.arcs=o,n.innerPoints=e,n.intersectionPoints=s),i+r}function ae(t,n){return n.every(s=>K(t,s)=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Tt(t,n){const s=K(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const r=(e*e-i*i+s*s)/(2*s),o=Math.sqrt(e*e-r*r),l=t.x+r*(n.x-t.x)/s,h=t.y+r*(n.y-t.y)/s,u=-(n.y-t.y)*(o/s),a=-(n.x-t.x)*(o/s);return[{x:l+u,y:h-a},{x:l-u,y:h+a}]}function Et(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function ce(t,n,s,e){e=e||{};const i=e.maxIterations||100,r=e.tolerance||1e-10,o=t(n),l=t(s);let h=s-n;if(o*l>0)throw"Initial bisect points must have opposite signs";if(o===0)return n;if(l===0)return s;for(let u=0;u=0&&(n=a),Math.abs(h)ct(n))}function tt(t,n){let s=0;for(let e=0;ev.fx-c.fx,T=n.slice(),w=n.slice(),g=n.slice(),b=n.slice();for(let v=0;v{const N=f.slice();return N.fx=f.fx,N.id=f.id,N});x.sort((f,N)=>f.id-N.id),s.history.push({x:y[0].slice(),fx:y[0].fx,simplex:x})}d=0;for(let x=0;x=y[m-1].fx){let x=!1;if(w.fx>c.fx?(J(g,1+a,T,-a,c),g.fx=t(g),g.fx=1)break;for(let f=1;fl+r*i*h||u>=E)M=i;else{if(Math.abs(p)<=-o*h)return i;p*(M-y)>=0&&(M=y),y=i,E=u}return 0}for(let y=0;y<10;++y){if(J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),p=tt(e.fxprime,n),u>l+r*i*h||y&&u>=a)return m(d,i,a);if(Math.abs(p)<=-o*h)return i;if(p>=0)return m(i,d,u);a=u,d=i,i*=2}return i}function he(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const r=n.slice();let o,l,h=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),o=e.fxprime.slice(),ht(o,e.fxprime,-1);for(let a=0;a{const p={};for(let d=0;dxt(t,n,e)-s,0,t+n)}function fe(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(s){const l=new Map;for(const h of e)for(let u=0;ul===h?0:lr.sets.length===2).forEach(r=>{const o=s[r.sets[0]],l=s[r.sets[1]],h=Math.sqrt(n[o].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ft(h,u,r.size);e[o][l]=e[l][o]=a;let p=0;r.size+1e-10>=Math.min(n[o].size,n[l].size)?p=1:r.size<=1e-10&&(p=-1),i[o][l]=i[l][o]=p}),{distances:e,constraints:i}}function ge(t,n,s,e){for(let r=0;r0&&y<=p||d<0&&y>=p||(i+=2*M*M,n[2*r]+=4*M*(o-u),n[2*r+1]+=4*M*(l-a),n[2*h]+=4*M*(u-o),n[2*h+1]+=4*M*(a-l))}}return i}function xe(t,n={}){let s=pe(t,n);const e=n.lossFunction||et;if(t.length>=8){const i=ye(t,n),r=e(i,t),o=e(s,t);r+1e-8d.map(m=>m/l));const h=(d,m)=>ge(d,m,r,o);let u=null;for(let d=0;dp.sets.length===2);for(const p of t){let d=p.weight!=null?p.weight:1;const m=p.sets[0],y=p.sets[1];p.size+Rt>=Math.min(e[m].size,e[y].size)&&(d=0),i[m].push({set:y,size:p.size,weight:d}),i[y].push({set:m,size:p.size,weight:d})}const r=[];Object.keys(i).forEach(p=>{let d=0;for(let m=0;mt[o]));const r=e.weight!=null?e.weight:1;s+=r*(i-e.size)*(i-e.size)}return s}function Ct(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],h=t[e.sets[1]];i=xt(l.radius,h.radius,K(l,h))}else i=st(e.sets.map(l=>t[l]));const r=e.weight!=null?e.weight:1,o=Math.log((i+1)/(e.size+1));s+=r*o*o}return s}function me(t,n,s){if(s==null?t.sort((i,r)=>r.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,r=t[0].y;for(const o of t)o.x-=i,o.y-=r}if(t.length===2&&K(t[0],t[1])1){const i=Math.atan2(t[1].x,t[1].y)-n,r=Math.cos(i),o=Math.sin(i);for(const l of t){const h=l.x,u=l.y;l.x=r*h-o*u,l.y=o*h+r*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const r=t[1].y/(1e-10+t[1].x);for(const o of t){var e=(o.x+r*o.y)/(1+r*r);o.x=2*e-o.x,o.y=2*e*r-o.y}}}}function be(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,r){const o=n(i),l=n(r);o.parent=l}for(let i=0;i{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((r,o)=>Math.max(r,o[s]+o.radius),Number.NEGATIVE_INFINITY),i=t.reduce((r,o)=>Math.min(r,o[s]-o.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Dt(t,n,s){n==null&&(n=Math.PI/2);let e=Ft(t).map(u=>Object.assign({},u));const i=be(e);for(const u of i){me(u,n,s);const a=dt(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let r=e.bounds;const o=(r.xRange.max-r.xRange.min)/50;function l(u,a,p){if(!u)return;const d=u.bounds;let m,y;if(a)m=r.xRange.max-d.xRange.min+o;else{m=r.xRange.max-d.xRange.max;const M=(d.xRange.max-d.xRange.min)/2-(r.xRange.max-r.xRange.min)/2;M<0&&(m+=M)}if(p)y=r.yRange.max-d.yRange.min+o;else{y=r.yRange.max-d.yRange.max;const M=(d.yRange.max-d.yRange.min)/2-(r.yRange.max-r.yRange.min)/2;M<0&&(y+=M)}for(const M of u)M.x+=m,M.y+=y,e.push(M)}let h=1;for(;h({radius:a*m.radius,x:e+p+(m.x-o.min)*a,y:e+d+(m.y-l.min)*a,setid:m.setid})))}function Nt(t){const n={};for(const s of t)n[s.setid]=s;return n}function Ft(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function ve(t={}){let n=!1,s=600,e=350,i=15,r=1e3,o=Math.PI/2,l=!0,h=null,u=!0,a=!0,p=null,d=null,m=!1,y=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,E={},T=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],w=0,g=function(x){if(x in E)return E[x];var f=E[x]=T[w];return w+=1,w>=T.length&&(w=0),f},b=At,v=et;function c(x){let f=x.datum();const N=new Set;f.forEach(k=>{k.size==0&&k.sets.length==1&&N.add(k.sets[0])}),f=f.filter(k=>!k.sets.some(D=>N.has(D)));let I={},R={};if(f.length>0){let k=b(f,{lossFunction:v,distinct:m});l&&(k=Dt(k,o,d)),I=Ot(k,s,e,i,h),R=Lt(I,f,M)}const Z={};f.forEach(k=>{k.label&&(Z[k.sets]=k.label)});function U(k){if(k.sets in Z)return Z[k.sets];if(k.sets.length==1)return""+k.sets[0]}x.selectAll("svg").data([I]).enter().append("svg");const B=x.select("svg");n?B.attr("viewBox",`0 0 ${s} ${e}`):B.attr("width",s).attr("height",e);const V={};let z=!1;B.selectAll(".venn-area path").each(function(k){const D=this.getAttribute("d");k.sets.length==1&&D&&!m&&(z=!0,V[k.sets[0]]=Me(D))});function q(k){return D=>{const G=k.sets.map(Q=>{let W=V[Q],Y=I[Q];return W||(W={x:s/2,y:e/2,radius:1}),Y||(Y={x:s/2,y:e/2,radius:1}),{x:W.x*(1-D)+Y.x*D,y:W.y*(1-D)+Y.y*D,radius:W.radius*(1-D)+Y.radius*D}});return wt(G,y)}}const A=B.selectAll(".venn-area").data(f,k=>k.sets),F=A.enter().append("g").attr("class",k=>`venn-area venn-${k.sets.length==1?"circle":"intersection"}${k.colour||k.color?" venn-coloured":""}`).attr("data-venn-sets",k=>k.sets.join("_")),j=F.append("path"),L=F.append("text").attr("class","label").text(k=>U(k)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(j.style("fill-opacity","0").filter(k=>k.sets.length==1).style("fill",k=>k.colour?k.colour:k.color?k.color:g(k.sets)).style("fill-opacity",".25"),L.style("fill",k=>k.colour||k.color?"#FFF":t.textFill?t.textFill:k.sets.length==1?g(k.sets):"#444"));function P(k){return typeof k.transition=="function"?k.transition("venn").duration(r):k}let _=x;z&&typeof _.transition=="function"?(_=P(x),_.selectAll("path").attrTween("d",q)):_.selectAll("path").attr("d",k=>wt(k.sets.map(D=>I[D])),y);const C=_.selectAll("text").filter(k=>k.sets in R).text(k=>U(k)).attr("x",k=>Math.floor(R[k.sets].x)).attr("y",k=>Math.floor(R[k.sets].y));u&&(z?"on"in C?C.on("end",ot(I,U)):C.each("end",ot(I,U)):C.each(ot(I,U)));const O=P(A.exit()).remove();typeof A.transition=="function"&&O.selectAll("path").attrTween("d",q);const X=O.selectAll("text").attr("x",s/2).attr("y",e/2);return p!==null&&(L.style("font-size","0px"),C.style("font-size",p),X.style("font-size","0px")),{circles:I,textCentres:R,nodes:A,enter:F,update:_,exit:O}}return c.wrap=function(x){return arguments.length?(u=x,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(x){return arguments.length?(s=x,c):s},c.height=function(x){return arguments.length?(e=x,c):e},c.padding=function(x){return arguments.length?(i=x,c):i},c.distinct=function(x){return arguments.length?(m=x,c):m},c.colours=function(x){return arguments.length?(g=x,c):g},c.colors=function(x){return arguments.length?(g=x,c):g},c.fontSize=function(x){return arguments.length?(p=x,c):p},c.round=function(x){return arguments.length?(y=x,c):y},c.duration=function(x){return arguments.length?(r=x,c):r},c.layoutFunction=function(x){return arguments.length?(b=x,c):b},c.normalize=function(x){return arguments.length?(l=x,c):l},c.scaleToFit=function(x){return arguments.length?(h=x,c):h},c.styled=function(x){return arguments.length?(a=x,c):a},c.orientation=function(x){return arguments.length?(o=x,c):o},c.orientationOrder=function(x){return arguments.length?(d=x,c):d},c.lossFunction=function(x){return arguments.length?(v=x==="default"?et:x==="logRatio"?Ct:x,c):v},c}function ot(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,r=n(s)||"",o=r.split(/\s+/).reverse(),h=(r.length+o.length)/3;let u=o.pop(),a=[u],p=0;const d=1.1;e.textContent=null;const m=[];function y(g){const b=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return b.textContent=g,m.push(b),e.append(b),b}let M=y(u);for(;u=o.pop(),!!u;){a.push(u);const g=a.join(" ");M.textContent=g,g.length>h&&M.getComputedTextLength()>i&&(a.pop(),M.textContent=a.join(" "),a=[u],M=y(u),p++)}const E=.35-p*d/2,T=e.getAttribute("x"),w=e.getAttribute("y");m.forEach((g,b)=>{g.setAttribute("x",T),g.setAttribute("y",w),g.setAttribute("dy",`${E+b*d}em`)})}}function at(t,n,s){let e=n[0].radius-K(n[0],t);for(let i=1;i=r&&(i=e[a],r=p)}const o=zt(a=>-1*at({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:o[0],y:o[1]};let h=!0;for(const a of t)if(K(l,a)>a.radius){h=!1;break}for(const a of n)if(K(l,a)a.p1))}function ke(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e0&&console.log("WARNING: area "+o+" not represented on screen")}return e}function Ie(t,n,s){const e=[];return e.push(` M`,t,n),e.push(` m`,-s,0),e.push(` a`,s,s,0,1,0,s*2,0),e.push(` diff --git a/veadk/webui/assets/visualizations/mermaid/wardleyDiagram-T6FBY63Y-CUlxVcoQ.js b/veadk/webui/assets/visualizations/mermaid/wardleyDiagram-T6FBY63Y-jNpCtSMU.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/wardleyDiagram-T6FBY63Y-CUlxVcoQ.js rename to veadk/webui/assets/visualizations/mermaid/wardleyDiagram-T6FBY63Y-jNpCtSMU.js index 3da7719d1..33355fbcd 100644 --- a/veadk/webui/assets/visualizations/mermaid/wardleyDiagram-T6FBY63Y-CUlxVcoQ.js +++ b/veadk/webui/assets/visualizations/mermaid/wardleyDiagram-T6FBY63Y-jNpCtSMU.js @@ -1,4 +1,4 @@ -import{p as Tt}from"./chunk-JWPE2WC7-DD-BFVC6.js";import{aQ as zt,V as Lt,$ as Xt,aT as At,W as Et,aR as Yt,a as y,a8 as It,X as Bt,r as K,at as et,aP as Ft,B as Rt,s as Ot,Y as V}from"./mermaid.core-y4TF8bTw.js";import{p as Wt}from"./cynefin-OW5HDTMX-DBq9B5VP.js";import"../../app/index-BNPwMQXG.js";import"../../chunks/purify.es-BnINGy_Y.js";var G=y((a,o)=>{const e=a<=1?a*100:a;if(e<0||e>100)throw new Error(`${o} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${a}`);return e},"toPercent"),E=y((a,o,e)=>({x:G(o,`${e} evolution`),y:G(a,`${e} visibility`)}),"toCoordinates"),tt=y(a=>{if(a){if(a==="+<>")return"bidirectional";if(a==="+<")return"backward";if(a==="+>")return"forward"}},"getFlowFromPort"),Dt=y(a=>{if(!(a!=null&&a.startsWith("+")))return{};const o=/^\+'([^']*)'/.exec(a),e=o==null?void 0:o[1];return a.includes("<>")?{flow:"bidirectional",label:e}:a.includes("<")?{flow:"backward",label:e}:a.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Gt=y((a,o)=>{if(Tt(a,o),a.size&&o.setSize(a.size.width,a.size.height),a.evolution){const e=a.evolution.stages.map(r=>r.secondName?`${r.name.trim()} / ${r.secondName.trim()}`:r.name.trim()),p=a.evolution.stages.filter(r=>r.boundary!==void 0).map(r=>r.boundary);o.updateAxes({stages:e,stageBoundaries:p})}if(a.anchors.forEach(e=>{const p=E(e.visibility,e.evolution,`Anchor "${e.name}"`);o.addNode(e.name,e.name,p.x,p.y,"anchor")}),a.components.forEach(e=>{var v;const p=E(e.visibility,e.evolution,`Component "${e.name}"`),r=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,m=(v=e.decorator)==null?void 0:v.strategy;o.addNode(e.name,e.name,p.x,p.y,"component",r,d,e.inertia,m)}),a.notes.forEach(e=>{const p=E(e.visibility,e.evolution,`Note "${e.text}"`);o.addNote(e.text,p.x,p.y)}),a.pipelines.forEach(e=>{const p=o.getNode(e.parent);if(!p||typeof p.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const r=p.y;o.startPipeline(e.parent),e.components.forEach(d=>{const m=`${e.parent}_${d.name}`,v=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,z=G(d.evolution,`Pipeline component "${d.name}" evolution`);o.addNode(m,d.name,z,r,"pipeline-component",v,g),o.addPipelineComponent(e.parent,m)})}),a.links.forEach(e=>{const p=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let r=tt(e.fromPort)??tt(e.toPort);const{flow:d,label:m}=Dt(e.arrow);!r&&d&&(r=d);const v=e.linkLabel,g=m??v;o.addLink(o.resolveNodeId(e.from),o.resolveNodeId(e.to),p,g,r)}),a.evolves.forEach(e=>{const p=o.getNode(e.component);if((p==null?void 0:p.y)!==void 0){const r=G(e.target,`Evolve target for "${e.component}"`);o.addTrend(e.component,r,p.y)}}),a.annotations.length>0){const e=a.annotations[0],p=E(e.x,e.y,"Annotations box");o.setAnnotationsBox(p.x,p.y)}a.annotation.forEach(e=>{const p=E(e.x,e.y,`Annotation ${e.number}`);o.addAnnotation(e.number,[{x:p.x,y:p.y}],e.text)}),a.accelerators.forEach(e=>{const p=E(e.x,e.y,`Accelerator "${e.name}"`);o.addAccelerator(e.name,p.x,p.y)}),a.deaccelerators.forEach(e=>{const p=E(e.x,e.y,`Deaccelerator "${e.name}"`);o.addDeaccelerator(e.name,p.x,p.y)})},"populateDb"),at={parser:{yy:void 0},parse:y(async a=>{var p;const o=await Wt("wardley",a);et.debug(o);const e=(p=at.parser)==null?void 0:p.yy;if(!e||typeof e.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Gt(o,e)},"parse")},I,qt=(I=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(o){const e=this.nodes.get(o.id)??{id:o.id,label:o.label},p={...e,...o,className:o.className??e.className,labelOffsetX:o.labelOffsetX??e.labelOffsetX,labelOffsetY:o.labelOffsetY??e.labelOffsetY};this.nodes.set(o.id,p)}addLink(o){this.links.push(o)}addTrend(o){this.trends.set(o.nodeId,o)}startPipeline(o){this.pipelines.set(o,{nodeId:o,componentIds:[]});const e=this.nodes.get(o);e&&(e.isPipelineParent=!0)}addPipelineComponent(o,e){const p=this.pipelines.get(o);p&&p.componentIds.push(e);const r=this.nodes.get(e);r&&(r.inPipeline=!0)}addAnnotation(o){this.annotations.push(o)}addNote(o){this.notes.push(o)}addAccelerator(o){this.accelerators.push(o)}addDeaccelerator(o){this.deaccelerators.push(o)}setAnnotationsBox(o,e){this.annotationsBox={x:o,y:e}}setAxes(o){this.axes={...this.axes,...o}}setSize(o,e){this.size={width:o,height:e}}getNode(o){return this.nodes.get(o)}resolveNodeId(o){if(this.nodes.has(o))return o;for(const[e,p]of this.nodes)if(p.label===o)return e;return o}build(){const o=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);o.push(e)}return{nodes:o,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},y(I,"WardleyBuilder"),I),b=new qt;function rt(){return V()["wardley-beta"]}y(rt,"getConfig");function ot(a,o,e,p,r,d,m,v,g){b.addNode({id:a,label:o,x:e,y:p,className:r,labelOffsetX:d,labelOffsetY:m,inertia:v,sourceStrategy:g})}y(ot,"addNode");function st(a,o,e=!1,p,r){b.addLink({source:a,target:o,dashed:e,label:p,flow:r})}y(st,"addLink");function nt(a,o,e){b.addTrend({nodeId:a,targetX:o,targetY:e})}y(nt,"addTrend");function it(a,o,e){b.addAnnotation({number:a,coordinates:o,text:e})}y(it,"addAnnotation");function dt(a,o,e){b.addNote({text:a,x:o,y:e})}y(dt,"addNote");function lt(a,o,e){b.addAccelerator({name:a,x:o,y:e})}y(lt,"addAccelerator");function ct(a,o,e){b.addDeaccelerator({name:a,x:o,y:e})}y(ct,"addDeaccelerator");function pt(a,o){b.setAnnotationsBox(a,o)}y(pt,"setAnnotationsBox");function ht(a,o){b.setSize(a,o)}y(ht,"setSize");function xt(a){b.startPipeline(a)}y(xt,"startPipeline");function ft(a,o){b.addPipelineComponent(a,o)}y(ft,"addPipelineComponent");function gt(a){b.setAxes(a)}y(gt,"updateAxes");function ut(a){return b.getNode(a)}y(ut,"getNode");function yt(a){return b.resolveNodeId(a)}y(yt,"resolveNodeId");function mt(){return b.build()}y(mt,"getWardleyData");function wt(){b.clear(),Ot()}y(wt,"clear");var Ht={getConfig:rt,addNode:ot,addLink:st,addTrend:nt,addAnnotation:it,addNote:dt,addAccelerator:lt,addDeaccelerator:ct,setAnnotationsBox:pt,setSize:ht,startPipeline:xt,addPipelineComponent:ft,updateAxes:gt,getNode:ut,resolveNodeId:yt,getWardleyData:mt,clear:wt,setAccTitle:Yt,getAccTitle:Et,setDiagramTitle:At,getDiagramTitle:Xt,getAccDescription:Lt,setAccDescription:zt},jt=["Genesis","Custom Built","Product","Commodity"],Vt=y(()=>{var o,e,p,r,d,m,v,g,z,M,k,N;const{themeVariables:a}=V();return{backgroundColor:((o=a.wardley)==null?void 0:o.backgroundColor)??a.background??"#fff",axisColor:((e=a.wardley)==null?void 0:e.axisColor)??"#000",axisTextColor:((p=a.wardley)==null?void 0:p.axisTextColor)??a.primaryTextColor??"#222",gridColor:((r=a.wardley)==null?void 0:r.gridColor)??"rgba(100, 100, 100, 0.2)",componentFill:((d=a.wardley)==null?void 0:d.componentFill)??"#fff",componentStroke:((m=a.wardley)==null?void 0:m.componentStroke)??"#000",componentLabelColor:((v=a.wardley)==null?void 0:v.componentLabelColor)??a.primaryTextColor??"#222",linkStroke:((g=a.wardley)==null?void 0:g.linkStroke)??"#000",evolutionStroke:((z=a.wardley)==null?void 0:z.evolutionStroke)??"#dc3545",annotationStroke:((M=a.wardley)==null?void 0:M.annotationStroke)??"#000",annotationTextColor:((k=a.wardley)==null?void 0:k.annotationTextColor)??a.primaryTextColor??"#222",annotationFill:((N=a.wardley)==null?void 0:N.annotationFill)??a.background??"#fff"}},"getTheme"),_t=y(()=>{const a=V()["wardley-beta"];return{width:(a==null?void 0:a.width)??900,height:(a==null?void 0:a.height)??600,padding:(a==null?void 0:a.padding)??48,nodeRadius:(a==null?void 0:a.nodeRadius)??6,nodeLabelOffset:(a==null?void 0:a.nodeLabelOffset)??8,axisFontSize:(a==null?void 0:a.axisFontSize)??12,labelFontSize:(a==null?void 0:a.labelFontSize)??10,showGrid:(a==null?void 0:a.showGrid)??!1,useMaxWidth:(a==null?void 0:a.useMaxWidth)??!0}},"getConfigValues"),Zt=y((a,o,e,p)=>{var U,J;et.debug(`Rendering Wardley map +import{p as Tt}from"./chunk-JWPE2WC7-DVlhplzu.js";import{aQ as zt,V as Lt,$ as Xt,aT as At,W as Et,aR as Yt,a as y,a8 as It,X as Bt,r as K,at as et,aP as Ft,B as Rt,s as Ot,Y as V}from"./mermaid.core-DAx4nvmm.js";import{p as Wt}from"./cynefin-OW5HDTMX-BHP1Kvyc.js";import"../../app/index-8JtvDNuA.js";import"../../chunks/purify.es-BnINGy_Y.js";var G=y((a,o)=>{const e=a<=1?a*100:a;if(e<0||e>100)throw new Error(`${o} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${a}`);return e},"toPercent"),E=y((a,o,e)=>({x:G(o,`${e} evolution`),y:G(a,`${e} visibility`)}),"toCoordinates"),tt=y(a=>{if(a){if(a==="+<>")return"bidirectional";if(a==="+<")return"backward";if(a==="+>")return"forward"}},"getFlowFromPort"),Dt=y(a=>{if(!(a!=null&&a.startsWith("+")))return{};const o=/^\+'([^']*)'/.exec(a),e=o==null?void 0:o[1];return a.includes("<>")?{flow:"bidirectional",label:e}:a.includes("<")?{flow:"backward",label:e}:a.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Gt=y((a,o)=>{if(Tt(a,o),a.size&&o.setSize(a.size.width,a.size.height),a.evolution){const e=a.evolution.stages.map(r=>r.secondName?`${r.name.trim()} / ${r.secondName.trim()}`:r.name.trim()),p=a.evolution.stages.filter(r=>r.boundary!==void 0).map(r=>r.boundary);o.updateAxes({stages:e,stageBoundaries:p})}if(a.anchors.forEach(e=>{const p=E(e.visibility,e.evolution,`Anchor "${e.name}"`);o.addNode(e.name,e.name,p.x,p.y,"anchor")}),a.components.forEach(e=>{var v;const p=E(e.visibility,e.evolution,`Component "${e.name}"`),r=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,m=(v=e.decorator)==null?void 0:v.strategy;o.addNode(e.name,e.name,p.x,p.y,"component",r,d,e.inertia,m)}),a.notes.forEach(e=>{const p=E(e.visibility,e.evolution,`Note "${e.text}"`);o.addNote(e.text,p.x,p.y)}),a.pipelines.forEach(e=>{const p=o.getNode(e.parent);if(!p||typeof p.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const r=p.y;o.startPipeline(e.parent),e.components.forEach(d=>{const m=`${e.parent}_${d.name}`,v=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,z=G(d.evolution,`Pipeline component "${d.name}" evolution`);o.addNode(m,d.name,z,r,"pipeline-component",v,g),o.addPipelineComponent(e.parent,m)})}),a.links.forEach(e=>{const p=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let r=tt(e.fromPort)??tt(e.toPort);const{flow:d,label:m}=Dt(e.arrow);!r&&d&&(r=d);const v=e.linkLabel,g=m??v;o.addLink(o.resolveNodeId(e.from),o.resolveNodeId(e.to),p,g,r)}),a.evolves.forEach(e=>{const p=o.getNode(e.component);if((p==null?void 0:p.y)!==void 0){const r=G(e.target,`Evolve target for "${e.component}"`);o.addTrend(e.component,r,p.y)}}),a.annotations.length>0){const e=a.annotations[0],p=E(e.x,e.y,"Annotations box");o.setAnnotationsBox(p.x,p.y)}a.annotation.forEach(e=>{const p=E(e.x,e.y,`Annotation ${e.number}`);o.addAnnotation(e.number,[{x:p.x,y:p.y}],e.text)}),a.accelerators.forEach(e=>{const p=E(e.x,e.y,`Accelerator "${e.name}"`);o.addAccelerator(e.name,p.x,p.y)}),a.deaccelerators.forEach(e=>{const p=E(e.x,e.y,`Deaccelerator "${e.name}"`);o.addDeaccelerator(e.name,p.x,p.y)})},"populateDb"),at={parser:{yy:void 0},parse:y(async a=>{var p;const o=await Wt("wardley",a);et.debug(o);const e=(p=at.parser)==null?void 0:p.yy;if(!e||typeof e.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Gt(o,e)},"parse")},I,qt=(I=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(o){const e=this.nodes.get(o.id)??{id:o.id,label:o.label},p={...e,...o,className:o.className??e.className,labelOffsetX:o.labelOffsetX??e.labelOffsetX,labelOffsetY:o.labelOffsetY??e.labelOffsetY};this.nodes.set(o.id,p)}addLink(o){this.links.push(o)}addTrend(o){this.trends.set(o.nodeId,o)}startPipeline(o){this.pipelines.set(o,{nodeId:o,componentIds:[]});const e=this.nodes.get(o);e&&(e.isPipelineParent=!0)}addPipelineComponent(o,e){const p=this.pipelines.get(o);p&&p.componentIds.push(e);const r=this.nodes.get(e);r&&(r.inPipeline=!0)}addAnnotation(o){this.annotations.push(o)}addNote(o){this.notes.push(o)}addAccelerator(o){this.accelerators.push(o)}addDeaccelerator(o){this.deaccelerators.push(o)}setAnnotationsBox(o,e){this.annotationsBox={x:o,y:e}}setAxes(o){this.axes={...this.axes,...o}}setSize(o,e){this.size={width:o,height:e}}getNode(o){return this.nodes.get(o)}resolveNodeId(o){if(this.nodes.has(o))return o;for(const[e,p]of this.nodes)if(p.label===o)return e;return o}build(){const o=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);o.push(e)}return{nodes:o,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},y(I,"WardleyBuilder"),I),b=new qt;function rt(){return V()["wardley-beta"]}y(rt,"getConfig");function ot(a,o,e,p,r,d,m,v,g){b.addNode({id:a,label:o,x:e,y:p,className:r,labelOffsetX:d,labelOffsetY:m,inertia:v,sourceStrategy:g})}y(ot,"addNode");function st(a,o,e=!1,p,r){b.addLink({source:a,target:o,dashed:e,label:p,flow:r})}y(st,"addLink");function nt(a,o,e){b.addTrend({nodeId:a,targetX:o,targetY:e})}y(nt,"addTrend");function it(a,o,e){b.addAnnotation({number:a,coordinates:o,text:e})}y(it,"addAnnotation");function dt(a,o,e){b.addNote({text:a,x:o,y:e})}y(dt,"addNote");function lt(a,o,e){b.addAccelerator({name:a,x:o,y:e})}y(lt,"addAccelerator");function ct(a,o,e){b.addDeaccelerator({name:a,x:o,y:e})}y(ct,"addDeaccelerator");function pt(a,o){b.setAnnotationsBox(a,o)}y(pt,"setAnnotationsBox");function ht(a,o){b.setSize(a,o)}y(ht,"setSize");function xt(a){b.startPipeline(a)}y(xt,"startPipeline");function ft(a,o){b.addPipelineComponent(a,o)}y(ft,"addPipelineComponent");function gt(a){b.setAxes(a)}y(gt,"updateAxes");function ut(a){return b.getNode(a)}y(ut,"getNode");function yt(a){return b.resolveNodeId(a)}y(yt,"resolveNodeId");function mt(){return b.build()}y(mt,"getWardleyData");function wt(){b.clear(),Ot()}y(wt,"clear");var Ht={getConfig:rt,addNode:ot,addLink:st,addTrend:nt,addAnnotation:it,addNote:dt,addAccelerator:lt,addDeaccelerator:ct,setAnnotationsBox:pt,setSize:ht,startPipeline:xt,addPipelineComponent:ft,updateAxes:gt,getNode:ut,resolveNodeId:yt,getWardleyData:mt,clear:wt,setAccTitle:Yt,getAccTitle:Et,setDiagramTitle:At,getDiagramTitle:Xt,getAccDescription:Lt,setAccDescription:zt},jt=["Genesis","Custom Built","Product","Commodity"],Vt=y(()=>{var o,e,p,r,d,m,v,g,z,M,k,N;const{themeVariables:a}=V();return{backgroundColor:((o=a.wardley)==null?void 0:o.backgroundColor)??a.background??"#fff",axisColor:((e=a.wardley)==null?void 0:e.axisColor)??"#000",axisTextColor:((p=a.wardley)==null?void 0:p.axisTextColor)??a.primaryTextColor??"#222",gridColor:((r=a.wardley)==null?void 0:r.gridColor)??"rgba(100, 100, 100, 0.2)",componentFill:((d=a.wardley)==null?void 0:d.componentFill)??"#fff",componentStroke:((m=a.wardley)==null?void 0:m.componentStroke)??"#000",componentLabelColor:((v=a.wardley)==null?void 0:v.componentLabelColor)??a.primaryTextColor??"#222",linkStroke:((g=a.wardley)==null?void 0:g.linkStroke)??"#000",evolutionStroke:((z=a.wardley)==null?void 0:z.evolutionStroke)??"#dc3545",annotationStroke:((M=a.wardley)==null?void 0:M.annotationStroke)??"#000",annotationTextColor:((k=a.wardley)==null?void 0:k.annotationTextColor)??a.primaryTextColor??"#222",annotationFill:((N=a.wardley)==null?void 0:N.annotationFill)??a.background??"#fff"}},"getTheme"),_t=y(()=>{const a=V()["wardley-beta"];return{width:(a==null?void 0:a.width)??900,height:(a==null?void 0:a.height)??600,padding:(a==null?void 0:a.padding)??48,nodeRadius:(a==null?void 0:a.nodeRadius)??6,nodeLabelOffset:(a==null?void 0:a.nodeLabelOffset)??8,axisFontSize:(a==null?void 0:a.axisFontSize)??12,labelFontSize:(a==null?void 0:a.labelFontSize)??10,showGrid:(a==null?void 0:a.showGrid)??!1,useMaxWidth:(a==null?void 0:a.useMaxWidth)??!0}},"getConfigValues"),Zt=y((a,o,e,p)=>{var U,J;et.debug(`Rendering Wardley map `+a);const r=_t(),d=Vt(),m=r.nodeRadius*1.6,v=p.db,g=v.getWardleyData(),z=v.getDiagramTitle(),M=((U=g.size)==null?void 0:U.width)??r.width,k=((J=g.size)==null?void 0:J.height)??r.height,N=Ft(o);N.selectAll("*").remove(),Rt(N,k,M,r.useMaxWidth),N.attr("viewBox",`0 0 ${M} ${k}`);const P=N.append("g").attr("class","wardley-map"),q=N.append("defs");q.append("marker").attr("id",`arrow-${o}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.evolutionStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-end-${o}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.linkStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-start-${o}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",d.linkStroke).attr("stroke","none"),P.append("rect").attr("class","wardley-background").attr("width",M).attr("height",k).attr("fill",d.backgroundColor);const B=M-r.padding*2,F=k-r.padding*2;z&&P.append("text").attr("class","wardley-title").attr("x",M/2).attr("y",r.padding/2).attr("fill",d.axisTextColor).attr("font-size",r.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(z);const L=y(t=>r.padding+t/100*B,"projectX"),X=y(t=>k-r.padding-t/100*F,"projectY"),O=P.append("g").attr("class","wardley-axes");O.append("line").attr("x1",r.padding).attr("x2",M-r.padding).attr("y1",k-r.padding).attr("y2",k-r.padding).attr("stroke",d.axisColor).attr("stroke-width",1),O.append("line").attr("x1",r.padding).attr("x2",r.padding).attr("y1",r.padding).attr("y2",k-r.padding).attr("stroke",d.axisColor).attr("stroke-width",1);const kt=g.axes.xLabel??"Evolution",bt=g.axes.yLabel??"Visibility";O.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",r.padding+B/2).attr("y",k-r.padding/4).attr("fill",d.axisTextColor).attr("font-size",r.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(kt),O.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",r.padding/3).attr("y",r.padding+F/2).attr("fill",d.axisTextColor).attr("font-size",r.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${r.padding/3} ${r.padding+F/2})`).text(bt);const R=g.axes.stages&&g.axes.stages.length>0?g.axes.stages:jt;if(R.length>0){const t=P.append("g").attr("class","wardley-stages"),n=g.axes.stageBoundaries,s=[];if(n&&n.length===R.length){let i=0;n.forEach(h=>{s.push({start:i,end:h}),i=h})}else{const i=1/R.length;R.forEach((h,l)=>{s.push({start:l*i,end:(l+1)*i})})}R.forEach((i,h)=>{const l=s[h],x=r.padding+l.start*B,f=r.padding+l.end*B,u=(x+f)/2;h>0&&t.append("line").attr("x1",x).attr("x2",x).attr("y1",r.padding).attr("y2",k-r.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),t.append("text").attr("class","wardley-stage-label").attr("x",u).attr("y",k-r.padding/1.5).attr("fill",d.axisTextColor).attr("font-size",r.axisFontSize-2).attr("text-anchor","middle").text(i)})}if(r.showGrid){const t=P.append("g").attr("class","wardley-grid");for(let n=1;n<4;n++){const s=n/4,i=r.padding+B*s;t.append("line").attr("x1",i).attr("x2",i).attr("y1",r.padding).attr("y2",k-r.padding).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",r.padding).attr("x2",M-r.padding).attr("y1",k-r.padding-F*s).attr("y2",k-r.padding-F*s).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6")}}const c=new Map;if(g.nodes.forEach(t=>{c.set(t.id,{x:L(t.x),y:X(t.y),node:t})}),g.pipelines.length>0){const t=P.append("g").attr("class","wardley-pipelines"),n=P.append("g").attr("class","wardley-pipeline-links");g.pipelines.forEach(s=>{if(s.componentIds.length===0)return;const i=s.componentIds.map(f=>({id:f,pos:c.get(f),node:g.nodes.find(u=>u.id===f)})).filter(f=>f.pos&&f.node).sort((f,u)=>f.node.x-u.node.x);for(let f=0;f{const u=c.get(f);u&&(h=Math.min(h,u.x),l=Math.max(l,u.x),x=u.y)}),h!==1/0&&l!==-1/0){const u=r.nodeRadius*4,w=x-u/2,S=c.get(s.nodeId);if(S){const T=(h+l)/2;S.x=T,S.y=w-m/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",h-15).attr("y",w).attr("width",l-h+15*2).attr("height",u).attr("fill","none").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const _=P.append("g").attr("class","wardley-links"),Z=new Map;g.pipelines.forEach(t=>{Z.set(t.nodeId,new Set(t.componentIds))});const Q=g.links.filter(t=>{if(!c.has(t.source)||!c.has(t.target))return!1;const n=Z.get(t.target);return!(n!=null&&n.has(t.source))});_.selectAll("line").data(Q).enter().append("line").attr("class",t=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",t=>{const n=c.get(t.source),s=c.get(t.target),h=g.nodes.find(u=>u.id===t.source).isPipelineParent?m/Math.sqrt(2):r.nodeRadius,l=s.x-n.x,x=s.y-n.y,f=Math.sqrt(l*l+x*x);return n.x+l/f*h}).attr("y1",t=>{const n=c.get(t.source),s=c.get(t.target),h=g.nodes.find(u=>u.id===t.source).isPipelineParent?m/Math.sqrt(2):r.nodeRadius,l=s.x-n.x,x=s.y-n.y,f=Math.sqrt(l*l+x*x);return n.y+x/f*h}).attr("x2",t=>{const n=c.get(t.source),s=c.get(t.target),h=g.nodes.find(u=>u.id===t.target).isPipelineParent?m/Math.sqrt(2):r.nodeRadius,l=n.x-s.x,x=n.y-s.y,f=Math.sqrt(l*l+x*x);return s.x+l/f*h}).attr("y2",t=>{const n=c.get(t.source),s=c.get(t.target),h=g.nodes.find(u=>u.id===t.target).isPipelineParent?m/Math.sqrt(2):r.nodeRadius,l=n.x-s.x,x=n.y-s.y,f=Math.sqrt(l*l+x*x);return s.y+x/f*h}).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",t=>t.dashed?"6 6":null).attr("marker-end",t=>t.flow==="forward"||t.flow==="bidirectional"?`url(#link-arrow-end-${o})`:null).attr("marker-start",t=>t.flow==="backward"||t.flow==="bidirectional"?`url(#link-arrow-start-${o})`:null),_.selectAll("text").data(Q.filter(t=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",t=>{const n=c.get(t.source),s=c.get(t.target),i=(n.x+s.x)/2,h=s.y-n.y,l=s.x-n.x,x=Math.sqrt(l*l+h*h),f=8,u=h/x;return i+u*f}).attr("y",t=>{const n=c.get(t.source),s=c.get(t.target),i=(n.y+s.y)/2,h=s.x-n.x,l=s.y-n.y,x=Math.sqrt(h*h+l*l),f=8,u=-h/x;return i+u*f}).attr("fill",d.axisTextColor).attr("font-size",r.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",t=>{const n=c.get(t.source),s=c.get(t.target),i=(n.x+s.x)/2,h=(n.y+s.y)/2,l=s.x-n.x,x=s.y-n.y,f=Math.sqrt(l*l+x*x),u=8,w=x/f,S=-l/f,T=i+w*u,W=h+S*u;let Y=Math.atan2(x,l)*180/Math.PI;return(Y>90||Y<-90)&&(Y+=180),`rotate(${Y} ${T} ${W})`}).text(t=>t.label);const $t=P.append("g").attr("class","wardley-trends"),vt=g.trends.map(t=>{const n=c.get(t.nodeId);if(!n)return null;const s=L(t.targetX),i=X(t.targetY),h=s-n.x,l=i-n.y,x=Math.sqrt(h*h+l*l),f=r.nodeRadius+2,u=x>f?s-h/x*f:s,w=x>f?i-l/x*f:i;return{origin:n,targetX:s,targetY:i,adjustedX2:u,adjustedY2:w}}).filter(t=>t!==null);$t.selectAll("line").data(vt).enter().append("line").attr("class","wardley-trend").attr("x1",t=>t.origin.x).attr("y1",t=>t.origin.y).attr("x2",t=>t.adjustedX2).attr("y2",t=>t.adjustedY2).attr("stroke",d.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${o})`);const C=P.append("g").attr("class","wardley-nodes").selectAll("g").data(g.nodes).enter().append("g").attr("class",t=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));C.filter(t=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","#666").attr("stroke",d.componentStroke).attr("stroke-width",1),C.filter(t=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","#ccc").attr("stroke",d.componentStroke).attr("stroke-width",1),C.filter(t=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const A=C.filter(t=>t.sourceStrategy==="market");A.append("circle").attr("class","wardley-market-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),C.filter(t=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1);const H=r.nodeRadius*.7,$=r.nodeRadius*1.2;if(A.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x).attr("y1",t=>c.get(t.id).y-$).attr("x2",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),A.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),A.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x).attr("y2",t=>c.get(t.id).y-$).attr("stroke",d.componentStroke).attr("stroke-width",1),A.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y-$).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),A.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),A.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),C.filter(t=>t.isPipelineParent===!0).append("rect").attr("x",t=>c.get(t.id).x-m/2).attr("y",t=>c.get(t.id).y-m/2).attr("width",m).attr("height",m).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1),C.filter(t=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",t=>{const n=c.get(t.id);let s=t.isPipelineParent?m/2+15:r.nodeRadius+15;return t.sourceStrategy&&(s+=r.nodeRadius+10),n.x+s}).attr("y1",t=>{const n=c.get(t.id),s=t.isPipelineParent?m:r.nodeRadius*2;return n.y-s/2}).attr("x2",t=>{const n=c.get(t.id);let s=t.isPipelineParent?m/2+15:r.nodeRadius+15;return t.sourceStrategy&&(s+=r.nodeRadius+10),n.x+s}).attr("y2",t=>{const n=c.get(t.id),s=t.isPipelineParent?m:r.nodeRadius*2;return n.y+s/2}).attr("stroke",d.componentStroke).attr("stroke-width",6),C.append("text").attr("x",t=>{const n=c.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?n.x+t.labelOffsetX:n.x;let s=r.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetX===void 0&&(s+=10);const i=t.labelOffsetX??s;return n.x+i}).attr("y",t=>{const n=c.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?n.y+t.labelOffsetY:n.y-3;let s=-r.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetY===void 0&&(s-=10);const i=t.labelOffsetY??s;return n.y+i}).attr("class","wardley-node-label").attr("fill",t=>t.className==="evolved"?d.evolutionStroke:t.className==="anchor"?"#000":d.componentLabelColor).attr("font-size",r.labelFontSize).attr("font-weight",t=>t.className==="anchor"?"bold":"normal").attr("text-anchor",t=>t.className==="anchor"?"middle":"start").attr("dominant-baseline",t=>t.className==="anchor"?"middle":"auto").text(t=>t.label),g.annotations.length>0){const t=P.append("g").attr("class","wardley-annotations");if(g.annotations.forEach(n=>{const s=n.coordinates.map(i=>({x:L(i.x),y:X(i.y)}));if(s.length>1)for(let i=0;i{const h=t.append("g").attr("class","wardley-annotation");h.append("circle").attr("cx",i.x).attr("cy",i.y).attr("r",10).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5),h.append("text").attr("x",i.x).attr("y",i.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(n.number)})}),g.annotationsBox){let n=L(g.annotationsBox.x),s=X(g.annotationsBox.y);const i=10,h=16,l=11,x=t.append("g").attr("class","wardley-annotations-box"),f=[...g.annotations].filter(w=>w.text).sort((w,S)=>w.number-S.number),u=[];if(f.forEach((w,S)=>{const T=x.append("text").attr("x",n+i).attr("y",s+i+(S+1)*h).attr("font-size",l).attr("fill",d.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${w.number}. ${w.text}`);u.push(T)}),u.length>0){let w=0,S=0;u.forEach(j=>{const D=j.node(),Nt=D.getComputedTextLength();w=Math.max(w,Nt);const Ct=D.getBBox();S=Math.max(S,Ct.height)});const T=w+i*2+105,W=f.length*h+i*2+S/2,Y=r.padding,Pt=M-r.padding-T,St=r.padding,Mt=k-r.padding-W;n=Math.max(Y,Math.min(n,Pt)),s=Math.max(St,Math.min(s,Mt)),u.forEach((j,D)=>{j.attr("x",n+i).attr("y",s+i+(D+1)*h)}),x.insert("rect","text").attr("x",n).attr("y",s).attr("width",T).attr("height",W).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(g.notes.length>0){const t=P.append("g").attr("class","wardley-notes");g.notes.forEach(n=>{const s=L(n.x),i=X(n.y);t.append("text").attr("x",s).attr("y",i).attr("text-anchor","start").attr("font-size",11).attr("fill",d.axisTextColor).attr("font-weight","bold").text(n.text)})}if(g.accelerators.length>0){const t=P.append("g").attr("class","wardley-accelerators");g.accelerators.forEach(n=>{const s=L(n.x),i=X(n.y),h=60,l=30,x=20,f=` M ${s} ${i-l/2} L ${s+h-x} ${i-l/2} diff --git a/veadk/webui/assets/visualizations/mermaid/xychartDiagram-ELKLHX3M-Cqf4o1Vh.js b/veadk/webui/assets/visualizations/mermaid/xychartDiagram-ELKLHX3M-B9DRjIoI.js similarity index 99% rename from veadk/webui/assets/visualizations/mermaid/xychartDiagram-ELKLHX3M-Cqf4o1Vh.js rename to veadk/webui/assets/visualizations/mermaid/xychartDiagram-ELKLHX3M-B9DRjIoI.js index 7caa7ad02..0263772b7 100644 --- a/veadk/webui/assets/visualizations/mermaid/xychartDiagram-ELKLHX3M-Cqf4o1Vh.js +++ b/veadk/webui/assets/visualizations/mermaid/xychartDiagram-ELKLHX3M-B9DRjIoI.js @@ -1,4 +1,4 @@ -import{aQ as xi,V as di,$ as Yt,aT as fi,W as pi,aR as mi,a as n,at as Nt,aP as yi,B as bi,s as Ai,X as kt,aN as wi,r as Ht,O as Ci,a8 as Si,y as Ri,aq as Ot}from"./mermaid.core-y4TF8bTw.js";import"../../app/index-BNPwMQXG.js";import{i as _i}from"../../chunks/init-Gi6I4Gst.js";import{o as ki}from"../../chunks/ordinal-Cboi1Yqb.js";import{l as Wt}from"../../chunks/linear-Dd6OAXqp.js";import"../../chunks/purify.es-BnINGy_Y.js";import"../../chunks/defaultLocale-CrowFXzY.js";function Ti(e,t,i){e=+e,t=+t,i=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+i;for(var s=-1,a=Math.max(0,Math.ceil((t-e)/i))|0,o=new Array(a);++s"u"&&(v.yylloc={});var yt=v.yylloc;r.push(yt);var ui=v.options&&v.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function gi(V){g.length=g.length-2*V,C.length=C.length-V,r.length=r.length-V}n(gi,"popStack");function zt(){var V;return V=x.pop()||v.lex()||Vt,typeof V!="number"&&(V instanceof Array&&(x=V,V=x.pop()),V=u.symbols_[V]||V),V}n(zt,"lex");for(var M,U,O,bt,G={},xt,N,Bt,dt;;){if(U=g[g.length-1],this.defaultActions[U]?O=this.defaultActions[U]:((M===null||typeof M>"u")&&(M=zt()),O=rt[U]&&rt[U][M]),typeof O>"u"||!O.length||!O[0]){var At="";dt=[];for(xt in rt[U])this.terminals_[xt]&&xt>li&&dt.push("'"+this.terminals_[xt]+"'");v.showPosition?At="Parse error on line "+(gt+1)+`: +import{aQ as xi,V as di,$ as Yt,aT as fi,W as pi,aR as mi,a as n,at as Nt,aP as yi,B as bi,s as Ai,X as kt,aN as wi,r as Ht,O as Ci,a8 as Si,y as Ri,aq as Ot}from"./mermaid.core-DAx4nvmm.js";import"../../app/index-8JtvDNuA.js";import{i as _i}from"../../chunks/init-Gi6I4Gst.js";import{o as ki}from"../../chunks/ordinal-Cboi1Yqb.js";import{l as Wt}from"../../chunks/linear-WTltCzEJ.js";import"../../chunks/purify.es-BnINGy_Y.js";import"../../chunks/defaultLocale-CrowFXzY.js";function Ti(e,t,i){e=+e,t=+t,i=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+i;for(var s=-1,a=Math.max(0,Math.ceil((t-e)/i))|0,o=new Array(a);++s"u"&&(v.yylloc={});var yt=v.yylloc;r.push(yt);var ui=v.options&&v.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function gi(V){g.length=g.length-2*V,C.length=C.length-V,r.length=r.length-V}n(gi,"popStack");function zt(){var V;return V=x.pop()||v.lex()||Vt,typeof V!="number"&&(V instanceof Array&&(x=V,V=x.pop()),V=u.symbols_[V]||V),V}n(zt,"lex");for(var M,U,O,bt,G={},xt,N,Bt,dt;;){if(U=g[g.length-1],this.defaultActions[U]?O=this.defaultActions[U]:((M===null||typeof M>"u")&&(M=zt()),O=rt[U]&&rt[U][M]),typeof O>"u"||!O.length||!O[0]){var At="";dt=[];for(xt in rt[U])this.terminals_[xt]&&xt>li&&dt.push("'"+this.terminals_[xt]+"'");v.showPosition?At="Parse error on line "+(gt+1)+`: `+v.showPosition()+` Expecting `+dt.join(", ")+", got '"+(this.terminals_[M]||M)+"'":At="Parse error on line "+(gt+1)+": Unexpected "+(M==Vt?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(At,{text:v.match,token:this.terminals_[M]||M,line:v.yylineno,loc:yt,expected:dt})}if(O[0]instanceof Array&&O.length>1)throw new Error("Parse Error: multiple actions possible at state: "+U+", token: "+M);switch(O[0]){case 1:g.push(M),C.push(v.yytext),r.push(v.yylloc),g.push(O[1]),M=null,Mt=v.yyleng,f=v.yytext,gt=v.yylineno,yt=v.yylloc;break;case 2:if(N=this.productions_[O[1]][1],G.$=C[C.length-N],G._$={first_line:r[r.length-(N||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(N||1)].first_column,last_column:r[r.length-1].last_column},ui&&(G._$.range=[r[r.length-(N||1)].range[0],r[r.length-1].range[1]]),bt=this.performAction.apply(G,[f,Mt,gt,$.yy,O[1],C,r].concat(ci)),typeof bt<"u")return bt;N&&(g=g.slice(0,-1*N*2),C=C.slice(0,-1*N),r=r.slice(0,-1*N)),g.push(this.productions_[O[1]][0]),C.push(G.$),r.push(G._$),Bt=rt[g[g.length-2]][g[g.length-1]],g.push(Bt);break;case 3:return!0}}return!0},"parse")},ot=function(){var F={EOF:1,parseError:n(function(u,g){if(this.yy.parser)this.yy.parser.parseError(u,g);else throw new Error(u)},"parseError"),setInput:n(function(h,u){return this.yy=u||this.yy||{},this._input=h,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:n(function(){var h=this._input[0];this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h;var u=h.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),h},"input"),unput:n(function(h){var u=h.length,g=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var x=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var C=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===x.length?this.yylloc.first_column:0)+x[x.length-g.length].length-g[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:n(function(){return this._more=!0,this},"more"),reject:n(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:n(function(h){this.unput(this.match.slice(h))},"less"),pastInput:n(function(){var h=this.matched.substr(0,this.matched.length-this.match.length);return(h.length>20?"...":"")+h.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:n(function(){var h=this.match;return h.length<20&&(h+=this._input.substr(0,20-h.length)),(h.substr(0,20)+(h.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:n(function(){var h=this.pastInput(),u=new Array(h.length+1).join("-");return h+this.upcomingInput()+` diff --git a/veadk/webui/index.html b/veadk/webui/index.html index 85923ed96..995c92888 100644 --- a/veadk/webui/index.html +++ b/veadk/webui/index.html @@ -5,7 +5,7 @@ AgentKit Studio - + diff --git a/veadk/webui/website-integration.js b/veadk/webui/website-integration.js index e609e66ca..5f716ec6f 100644 --- a/veadk/webui/website-integration.js +++ b/veadk/webui/website-integration.js @@ -68,7 +68,7 @@ Summarize the result in three points`,preview:"{{count}} cases will be added",co Studio: {{studioUrl}} Pairing code: {{pairingCode}}`,installPrompt:`Install the AgentKit Studio Plugin. Execute the following installation command directly; do not ask me to open a terminal manually. Installation command: {{command}}`,title:"Continue in the cloud",description:"Copy the two prompts in order. Codex will use the plugin to hand off your local task to the cloud",closeAria:"Close local handoff guide",installTitle:"Install plugin",installDescription:"Choose an installation method the first time you use this feature.",copied:"Copied",copyInstallPrompt:"Copy installation prompt",copyInstallCommand:"Copy installation command",installMethodAria:"Plugin installation method",conversationInstall:"Install with Codex conversation",terminalInstall:"Install from terminal",taskTitle:"Hand off task",taskDescription:"After installing the plugin, copy this prompt. Codex will migrate the current project and continue the task.",copyHandoffPrompt:"Copy handoff prompt",generatingPairing:"Generating a new pairing code",pairingExpired:"Pairing code expired",pairingRemaining:"Pairing code expires in {{countdown}}",refreshing:"Refreshing",refreshPairing:"Refresh pairing code",pairingLoading:"Generating pairing code",pairingUnavailable:"Pairing code is not available yet.",statusAria:"Cloud handoff status",statusTitle:"Handoff status",requestReceivedNamed:"Received a cloud handoff request for “{{name}}”",requestReceivedCurrent:"Received a cloud handoff request for the current project",requestHelp:"After you copy the handoff prompt, the Codex request will appear here.",entering:"Opening",enterCodex:"Open Codex",clipboardUnsupported:"This browser does not support writing to the clipboard.",steps:{request:"Wait for local request",session:"Create cloud Session",restore:"Restore project",continue:"Send continuation task"},status:{issued:"Waiting for request",creating:"Creating Session",sessionCreated:"Migrating project",continuing:"Starting cloud task",running:"Running in the cloud",completed:"Handoff complete",failed:"Handoff failed"}},X9e={model:{description:"Show or switch the current conversation model",keywords:"model switch"},models:{description:"List models available from app-server",keywords:"model list"},skill:{description:"Browse and invoke a Skill available in the current workspace",keywords:"skill workflow"},skills:{description:"Browse and invoke Skills available in the current workspace",keywords:"skills workflow list"},new:{description:"Start a new conversation",keywords:"new conversation"},resume:{description:"Open conversation history or resume a specific Thread",keywords:"history resume session"},fork:{description:"Fork a new conversation from the current context",keywords:"fork branch"},compact:{description:"Compact the current conversation context",keywords:"compact context"},archive:{description:"Archive the current conversation and start a new one",keywords:"archive close"},status:{description:"Show connection, Thread, model, and token status",keywords:"status connection token"},clear:{description:"Clear the current view and start a new conversation",keywords:"clear reset"},help:{description:"Show Sandbox shortcuts",keywords:"help commands"},currentModel:"Current model",availableModel:"Available model",workspace:"Workspace",notSet:"Not set",modelLabel:"Model",statusLabel:"Status",running:"Running",idle:"Idle",totalTokens:"Total tokens",contextWindow:"Context window",imageFallback:"Image",unknown:"Unknown shortcut: {{command}}. Type /help to see available commands.",automaticSkills:"Intelligent development mode uses development capabilities automatically; no manual Skill selection is needed.",activity:{new:"Started a new Codex conversation",resumed:"Resumed Codex conversation",deleted:"Deleted Codex conversation history",modelChanged:"Switched Codex model",availableModels:"Available Codex models",noModels:"No models are currently available",forked:"Forked Codex conversation",compacting:"Started compacting the current Codex conversation",archived:"Archived Codex conversation",status:"Current Codex status",help:"Codex shortcuts supported by Sandbox"}},K9e={label:"Build tasks",queued:"Build queued",running:"Build running in the background",recovering:"Recovering build",waiting_user:"Build needs attention",stopping:"Stopping build",succeeded:"Build completed",cancelled:"Build stopped",failed:"Build could not complete",open:"Return to task",hide:"Hide task notification",reconnecting:"Reconnecting to the task service. Existing tasks are retained."},ddr=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:Y9e,agentWorkspace:q9e,approval:G9e,commands:X9e,common:$9e,composer:Q9e,default:{common:$9e,tool:F9e,threads:z9e,permissions:U9e,workspace:V9e,approval:G9e,composer:Q9e,launch:H9e,session:W9e,agentDetails:Y9e,agentWorkspace:q9e,handoff:j9e,commands:X9e,taskNotice:K9e},handoff:j9e,launch:H9e,permissions:U9e,session:W9e,taskNotice:K9e,threads:z9e,tool:F9e,workspace:V9e},Symbol.toStringTag,{value:"Module"})),Z9e={retry:"Try again",signInToContinue:"Sign in to continue",signInWith:"Sign in with {{provider}}",enterUsername:"Enter a username to get started",usernamePlaceholder:"Username (letters and numbers, up to 16 characters)",enter:"Continue",usernameInvalid:"Use letters and numbers only, up to 16 characters.",identityProvider:{volcengine:"Volcengine Identity",byteplus:"BytePlus Identity"},powered:{volcengine:"Volcengine AgentKit provides enterprise-grade Agent solutions",byteplus:"BytePlus AgentKit provides enterprise-grade Agent solutions"},legalPrefix:"By continuing, you acknowledge that you have read and agree to the AgentKit",terms:"Product and Service Terms",copyright:"© {{year}} VeADK. All rights reserved."},J9e={title:"Your session has expired",description:"Your current edits are preserved. The previous action will continue after you sign in again.",waiting:"Waiting for sign-in…",signInAgain:"Sign in again"},eze={breadcrumbs:"Breadcrumbs",selectAgent:"Select Agent",switchAgent:"Switch Agent"},tze={cancel:"Cancel",close:"Close confirmation dialog"},hdr=Object.freeze(Object.defineProperty({__proto__:null,authExpired:J9e,confirm:tze,default:{login:Z9e,authExpired:J9e,navbar:eze,confirm:tze},login:Z9e,navbar:eze},Symbol.toStringTag,{value:"Module"})),rze={defaultUser:"User",shortcuts:"Quick access",tryCli:"Try AgentKit CLI",developerResources:"Developer resources",systemInfo:"System information",language:"Language",issueFeedback:"Report an issue",logout:"Sign out",roles:{admin:"Administrator",developer:"Developer",user:"User",super_admin:"Super administrator"}},nze={home:"Back to home",expand:"Expand sidebar",collapse:"Collapse sidebar",label:"Main navigation",newChat:"New chat",agents:"Agents",workspaces:"Workspaces",library:"Library",cronjobs:"Cronjob",automations:"Automations",users:"User management",administration:"Administration",reviewCenter:"Review center"},ize={title:"Chat history",newConversation:"New conversation",create:"New chat",loading:"Loading chat history…",empty:"No conversations yet",current:"Current",manage:"Manage conversation: {{title}}",more:"More",delete:"Delete",loadingMore:"Loading…",loadMore:"Load more",evaluatingTitle:"Running automatic evaluation",evaluating:"Evaluating",generating:"Generating"},fdr=Object.freeze(Object.defineProperty({__proto__:null,account:rze,default:{account:rze,navigation:nze,history:ize},history:ize,navigation:nze},Symbol.toStringTag,{value:"Module"})),aze={placeholder:"Select an option",collapseOptions:"Collapse model options",expandOptions:"Expand model options",noOptions:"No options available",noMatches:"No matches. You can use the current model ID directly."},oze={unsupportedActivity:"Unsupported Skill conversation activity",ariaLabel:"Skill generation conversation"},sze={code:"Error code: {{code}}",type:"Error type: {{type}}",representation:"Exception representation: {{value}}",rawResponse:`Raw server response: -{{value}}`,original:"Original error: {{message}}",details:"Details"},lze={ariaLabel:"Skill file tree",viewSource:"View source",viewPreview:"View preview",download:"Download",binaryFile:"Binary file",bytes:"{{value}} bytes",binaryDescription:"The current API returns file metadata only. Download the original file separately.",metadata:"Skill metadata",noFiles:"No files"},cze={close:"Close",name:"Name",region:"Region",optionalDescription:"Description (optional)",cancel:"Cancel",create:"Create",creating:"Creating…",save:"Save",saving:"Saving…",upload:"Upload",uploading:"Uploading…",createSpaceTitle:"New Skill Space",editSpaceTitle:"Edit Skill Space",uploadTitle:"Upload to {{name}}",createSpaceFailed:"Failed to create the Skill Space",updateSpaceFailed:"Failed to update the Skill Space",archiveValidationFailed:"Skill ZIP validation failed",uploadFailed:"Failed to upload the Skill",dropzone:"Drop a Skill ZIP here",chooseLocalFile:"or click to choose a local file",archiveHelp:"The ZIP root must contain SKILL.md, or a single wrapping directory. Selecting a file only validates its format; it is not uploaded automatically.",validating:"Checking file format…",validationPassed:"Format check passed: {{name}}, {{count}} file(s)"},uze={styles:{concise:"Concise and practical",strict:"Rigorous and robust",tutorial:"Tutorial-friendly",automation:"Automation-first",custom:"Custom",customFallback:"Custom style"},stages:{preparing:"Preparing Dev Sandbox",ready:"Skill generated and format validation passed",failed:"Generation failed",cancelled:"Stopped",validating:"Validating Skill format",packaging:"Organizing files",generating:"Generating Skill",repairingAgain:"Repairing again",autoRepairing:"Auto-repairing ({{attempt}}/{{max}})"},validation:{fallback:"Skill format validation failed",repairInstruction:"Fix only the Skill format errors listed below. Do not change the original purpose or scope.",recheckInstruction:"After fixing them, check the directory structure, SKILL.md frontmatter, and all text files again.",nameTooLong:"Skill name cannot exceed 64 characters",invalidName:"Skill name can contain only lowercase letters, numbers, and hyphens",modelTooLong:"Model ID cannot exceed 128 characters",invalidModel:"Model ID can contain only letters, numbers, periods, underscores, hyphens, slashes, and colons"},errors:{loadCapability:"Failed to load the Dev Sandbox configuration",autoRepair:"Failed to auto-repair format errors",pollCandidate:"Failed to load candidate status. Retrying.",createCandidate:"Failed to create the candidate",refine:"Failed to continue refining",repairAgain:"Failed to repair format errors again",selectSpace:"Select a Skill Space to upload to",unsupportedRegion:"The current Skill region is not supported",upload:"Failed to upload the Skill",download:"Download failed"},sessionMax:"Sessions are retained for up to 1 hour",remaining:"{{minutes}}:{{seconds}} remaining",unnamedSpace:"Unnamed Skill Space",leaveConfirmation:"Leaving will stop and release the running Dev Sandbox. Leave anyway?",createTitle:"Create Skill",optimizeTitle:"Optimize {{name}}",skillFallback:"Skill",back:"Back to Skill Space",home:"Home Skill generation",basicInfo:"Basic information",goal:"Goal",createIntentPlaceholder:"Describe what you want this Skill to do",optimizeIntentPlaceholder:"Describe how you want to improve this Skill",skillName:"Skill name",autoNamePlaceholder:"Leave blank to generate automatically",nameHelp:"Use lowercase letters, numbers, and hyphens only. Leave blank to generate automatically.",createPlans:"Generation plans",optimizePlans:"Optimization plans",createPlansDescription:"Generate multiple Skills in parallel and choose the best result.",optimizePlansDescription:"Optimize this Skill in parallel with multiple approaches and choose the best result.",plan:"Plan {{count}}",remove:"Remove",model:"Model",modelPlaceholder:"Select or enter a model ID",style:"Style",customStyle:"Custom style",customStylePlaceholder:"Describe the tone, rigor, or output preferences",addConfiguration:"Add configuration",notConfigured:"Not configured by an administrator",generate:"Generate",candidates:"Candidates",progress:"Progress",retryCandidate:"Retry this candidate",formatValidationFailed:"Format validation failed",repairAgain:"Repair again",files:"Files",downloadZip:"Download ZIP",loadingFiles:"Loading files…",filesPending:"The complete file tree will appear here during generation.",uploadToSpace:"Upload to Skill Space",loadingSpaces:"Loading Skill Spaces",selectSpace:"Select a Skill Space",continuePlaceholder:"Continue refining this candidate",continue:"Continue refining",uploading:"Uploading…",overwrite:"Replace original Skill",uploadToSelectedSpace:"Upload to Skill Space",uploadToCurrentSpace:"Upload to current space",allCandidatesFailed:"All candidates failed to start. Retry each candidate separately."},dze={invalidFormat:"{{label}} has an invalid format.",recoveryStatus:"Skill recovery status",errorResponse:"error response",errorDetails:"error details",missingContentType:"Content-Type missing",gatewayError:"{{fallback}} (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",nonJson:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",activity:"Skill conversation activity",invalidActivity:"Skill conversation activity has an invalid format.",invalidToolActivity:"Skill tool activity has an invalid format.",invalidTextActivity:"Skill text activity has an invalid format.",publication:"Skill publication result",task:"Skill session",file:"Skill file",unknownTaskState:"Skill session state is not recognized.",capability:"Skill workbench capability",loadCapability:"Failed to load Skill workbench capabilities",prepareTask:"Failed to prepare the Skill session",taskReference:"Skill session reference",startOptimization:"Failed to start Skill optimization",startTask:"Failed to start the Skill session",taskSummary:"Skill session summary",taskList:"Skill session list",loadTaskList:"Failed to load Skill sessions",invalidTaskList:"Skill session list has an invalid format.",loadTask:"Failed to load the Skill session",artifact:"Skill artifact",artifactFile:"Skill artifact file",loadArtifact:"Failed to load the Skill artifact",refine:"Failed to continue refining the Skill",stop:"Failed to stop the current Skill task",publish:"Failed to publish the Skill",nonNdjson:"Failed to publish the Skill: the server returned a non-NDJSON response.",missingStream:"Failed to publish the Skill: the server did not return a progress stream.",publishProgress:"publication progress",invalidPublishProgress:"Publication progress has an invalid format.",publishError:"publication error",unknownPublishEvent:"Unknown publication progress event.",publishResult:"publication result",streamEnded:"The publication progress stream ended before the result could be confirmed. Refresh Skill Center to check the status.",deleteTask:"Failed to delete the Skill session",download:"Failed to download the Skill"},pdr=Object.freeze(Object.defineProperty({__proto__:null,api:dze,configSelect:aze,conversation:oze,default:{configSelect:aze,conversation:oze,errorDetails:sze,fileTree:lze,management:cze,generation:uze,api:dze},errorDetails:sze,fileTree:lze,generation:uze,management:cze},Symbol.toStringTag,{value:"Module"})),hze={back:"Back",reload:"Reload",notConfigured:"Not configured",name:"Name",description:"Description",delete:"Delete",save:"Save",saving:"Saving",add:"Add",manage:"Manage",environment:"Environment",noDescription:"No description",refresh:"Refresh",close:"Close",retry:"Retry",loading:"Loading…",previousPage:"Previous page",nextPage:"Next page",edit:"Edit",all:"All",search:"Search",cancel:"Cancel",view:"View",viewDetails:"View details",deleting:"Deleting…",create:"Create",creating:"Creating",adding:"Adding",generating:"Generating",uploading:"Uploading",preview:"Preview",loadFailed:"Failed to load",select:"Select",collapse:"Collapse",expand:"Expand",none:"None"},fze={ariaLabel:"AgentKit shortcuts",closeAriaLabel:"Close the AgentKit welcome card",title:"Welcome to AgentKit",description:"Build and host enterprise Agents quickly with AgentKit",docsAriaLabel:"Open AgentKit documentation in a new window",docs:"Documentation",consoleAriaLabel:"Open the AgentKit console in a new window",console:"Console"},pze={checkUpdates:"Check for updates",checkingVersions:"Checking versions…",versionCheckError:"Unable to check sandbox versions. Check credentials, region and API permissions, then retry.",sandboxUpdateError:"Sandbox update failed. Refresh its status before retrying.",modelEnvRepairUnavailable:"Cannot repair model configuration. Check CODEX_API_KEY and CODEX_BASE_URL.",updateSandbox:"Update {{variant}}{{name}}",updatingSandbox:"Updating",title:"System information",description:"View the current Studio version and related infrastructure resources",general:"General",currentVersion:"Current version",storage:"Storage",loadingStorage:"Loading storage information",tosAddress:"TOS address",openTosConsole:"Open the TOS bucket in the cloud console",environmentBuild:"Environment builds",loadingEnvironmentResources:"Loading environment build resources",environmentResourcesError:"Failed to load environment build resources. Check the cloud credentials and try again.",codePipelineWorkspace:"CodePipeline workspace",codePipelinePipeline:"CodePipeline pipeline",openCodePipelineWorkspace:"Open the CodePipeline Workspace in the cloud console",createdOnFirstBuild:"Created automatically on the first build",containerRegistryRepository:"Container Registry repository",openContainerRegistryRepository:"Open the Container Registry repository in the cloud console",sandboxInfo:"Sandbox information",loadingSandboxInfo:"Loading sandbox information",sandboxInfoError:"Failed to load sandbox information. Try again.",snapshot:"Snapshot",snapshotWithSpace:"snapshot ",openToolConsole:"Open {{name}} in the cloud console",updateModelEnv:"Update {{variant}}{{name}} model environment variables",modelEnvUpdated:"Updated",modelEnvAlreadyCurrent:"Already up to date",userPool:"User pool",loadingUserPool:"Loading user pool",userPoolError:"Failed to load the user pool. Try again.",modelEnvUpdateError:"Failed to update model environment variables. Try again.",openUserPoolConsole:"Open user pool {{name}} in the cloud console",unnamedUserPool:"Unnamed user pool",id:"ID",domain:"Domain",region:"Region",noLocalUserPool:"No user pool is configured in local mode",noUserPool:"No user pool is configured for this Studio"},gze={workspace:"Agent workspace",library:"Agent library",evaluation:"Evaluation",agentList:"Agent list",agentDetails:"Agent details",newAgent:"New Agent",loading:"Loading…",loadingCloudAgents:"Loading cloud Agents…",noAgentSelected:"Select an Agent",local:"Local",remote:"Cloud",localAgent:"Local Agent",remoteAgent:"Cloud Agent",agentCount:"{{count}} Agents",agentCountLabel:"Agent count",details:"Details",chat:"Chat",update:"Update",backToAgentList:"Back to Agent list",loadingAgent:"Loading Agent",loadingAgentDescription:"Loading Agent configuration and Runtime information.",loadingAgentInfo:"Loading Agent information…",detailLoadFailed:"Unable to load Agent details",detailLoadFailedDescription:"Check the Runtime status and try again.",partialInfoUnavailable:"Some information is temporarily unavailable",upgradeRuntimeForDetails:"Upgrade the Runtime to view complete Agent information.",basicInfo:"Basic information",usageOverview:"Usage overview",sections:{basic:"Basic information",profileConfig:"Profile configuration",sessionConfig:"Session configuration",usage:"Usage overview",diagnostics:"Diagnostics",evaluations:"Evaluations",optimizations:"Optimizations",integrations:"Integrations",versions:"Versions",channels:"Message channels"},evaluationGroup:"Evaluation group",optimizations:"Optimization suggestions",optimizationsDescription:"Review actionable suggestions based on evaluation results.",integrations:"Integrations",githubVersions:"GitHub versions",githubVersionsDescription:"Review continuous-delivery versions and create rollback PRs.",currentVersionOnly:"GitHub continuous delivery is not enabled. Only the current production version is shown.",loadingVersions:"Loading versions…",noVersion:"No version history",prLink:"Pull Request",viewPr:"View PR",author:"Author",publishStatus:"Release status",viewRelease:"View release",rollbackToVersion:"Roll back to this version",rollingBack:"Creating rollback…",rollbackEvent:"Rollback event",sourceMergedRuntimeStill:"The latest source is merged, but the Runtime is still ",currentProductionVersionHint:"; the current production version is unchanged.",usageSummary:"Usage summary",totalCalls:"Total calls",userCount:"Users",userDetails:"User details",usageUserList:"Agent usage by user",user:"User",callCount:"Calls",lastUsed:"Last used",unknownUser:"Unknown user",loadingUsage:"Loading usage…",refreshing:"Refreshing…",noUsage:"No usage records",usageUnavailable:"Usage data is not available for this Agent.",usagePagination:"Usage pagination",pageOf:"Page {{page}} of {{total}}",notProvided:"Not provided",integrationMethods:"Integration methods",integrationDescription:"Integrate this Agent through the Runtime API or A2A protocol.",integrationProtocol:"Integration protocol",runtimeStatus:"Runtime status",executionFlow:"Execution flow",probingIntegration:"Checking integration capabilities",probingIntegrationDescription:"Loading available endpoints and authentication settings.",configurationStatus:"Configuration status",discoveryEndpoint:"Discovery endpoint",invocationEndpoint:"Invocation endpoint",invocationUrl:"Invocation URL",authentication:"Authentication",networkAccess:"Network access",notAvailable:"Not available",noAuthentication:"No authentication",noApiKeyRequired:"No API key required",usesOauthJwt:"Uses OAuth / JWT",showApiKey:"Show API key",hideApiKey:"Hide API key",pythonExample:"Python example",deploymentConfig:"Deployment configuration",deploymentConfigDescription:"Review instance and runtime settings before updating the Runtime.",deploymentRegion:"Deployment region",mpaControlPlane:"MPA control plane",loadingMpaAgentView:"Loading MPA Runtime binding…",mpaRuntimeBound:"This MPA Agent is bound to one Runtime and ready for management.",mpaRuntimeMissing:"No visible MPA Runtime is bound to this Agent.",mpaRuntimeBindingAmbiguous:"Multiple MPA Runtimes match this Agent. Resolve the binding before making changes.",mpaRuntimeOrphan:"The Runtime exists, but it does not contain this MPA Profile.",mpaRuntimeLegacyAuthUnsupported:"This Runtime uses an older MPA image that still requires X-Jwt-Token. Update it to the current AgentKit-compatible image before managing Profile or Session settings.",profileConfig:"Profile configuration",profileConfigTitle:"Profile configuration",profileConfigDescription:"Review and apply the Agent-level MPA Profile. The Profile is the Runtime default configuration inherited by new Sessions.",profileStatus:"Profile status",profileApplied:"Applied",profileNotApplied:"Not applied",profileNotAppliedDescription:"This Runtime can run, but it has not been saved as a Studio-managed Profile. Applying it creates a Profile revision.",applyProfile:"Apply Profile",reapplyProfile:"Reapply Profile",editProfile:"Edit Profile",profileApplying:"Applying…",profileAppliedNotice:"Profile applied. Current revision is {{revision}}.",profileApplyIncomplete:"Profile apply did not finish. Check the current operation state and retry.",profileApplyFailed:"Failed to apply Profile.",profilePrompt:"System prompt",profileResources:"Resource configuration",profileResourceSummary:"{{tools}} tools · {{skills}} Skills · {{mcp}} MCP servers",sessionConfigTitle:"Session configuration",sessionConfigDescription:"Review and change execution choices for the current MPA Session. Changes apply to the next turn.",loadingSessionConfig:"Loading Session configuration…",sessionConfigNoAgent:"Select an MPA Agent to manage its Session configuration.",sessionConfigNonMpa:"Session configuration is only available for MPA Agents.",sessionConfigNoSession:"Open a chat with this MPA Agent before changing Session configuration.",sessionConfigDifferentRuntime:"Open the current chat for this MPA Agent before changing Session configuration.",sessionConfigSaved:"Session configuration updated. The next turn will use the new revision.",sessionConfigStale:"This Session was changed elsewhere. The latest configuration is shown; review it before saving again.",sessionConfigRevision:"Config revision",sessionProfileRevision:"Session Profile revision",latestProfileRevision:"Latest Profile revision",sessionProfileUpgradeAvailable:"A newer Profile revision is available: v{{current}} → v{{target}}.",upgradeSessionProfile:"Upgrade Session Profile",sessionProfileUpgrading:"Upgrading…",sessionProfileUpgraded:"Session Profile upgraded. The next turn will use the new revision.",sessionProfileUpgradeFailed:"Unable to upgrade the Session Profile.",sessionModelOverride:"Model override",modelId:"Model ID",inheritProfileDefault:"Inherit Profile default",sessionMcpServers:"MCP servers",mcpServerCount:"{{count}} selected",clearSessionMcp:"Clear MCP servers",mpaDiagnosticsTitle:"Runtime diagnostics",mpaDiagnosticsDescription:"Review recent Runtime Console runs and their Agent, Profile, Turn, task, and worker correlation.",loadingMpaDiagnostics:"Loading Runtime diagnostics…",noMpaDiagnostics:"No Runtime diagnostic runs for this Session.",latestRun:"Latest run",traceCorrelation:"Trace correlation",traceCorrelationDescription:"Stable identifiers returned by Runtime Console for this invocation.",traceSteps:"Trace steps",traceStepsDescription:"Recent bounded Runtime Console steps for the selected invocation.",mpaInstanceId:"MPA instance",turnId:"Turn ID",taskId:"Task ID",workerKind:"Worker kind",workerSession:"Worker Session",workerTurn:"Worker Turn",workerProfile:"Worker Profile",workerProfileVersion:"Worker Profile version",step:"Step",stepCount:"Steps",duration:"Duration",noTraceSteps:"No trace steps recorded for this invocation.",executionConfigMode:{replace:"Session override",clear:"Cleared for this Session",inherit:"Using Profile default"},concurrency:"Concurrency",selectedOptimizations:"Selected optimizations",selectedOptimizationsDescription:"These optimizations will be applied to this update.",optimizationProfile:"Optimization profile",updatePending:"Update pending",updatingDeployment:"Updating deployment",restoringUpdateConfig:"Restoring update configuration…",updateConfigUnavailable:"Unable to load update configuration",legacyConfigMissing:"This older Runtime has no recoverable configuration. Create it again.",deploymentFailed:"Deployment failed",continueEditing:"Continue editing",loadingOptimizations:"Loading optimization suggestions…",noOptimizations:"No optimization suggestions",fixPriority:"Priority",suggestedModule:"Suggested module",suggestionAndReason:"Suggestion and rationale",priority:{high:"High",medium:"Medium",low:"Low"},modules:{agentStructure:"Agent structure",prompt:"Prompt",tool:"Tools",knowledge:"Knowledge",memory:"Memory",workflow:"Workflow",other:"Other"},evaluationGroupList:"Evaluation group list",newEvaluationGroup:"New evaluation group",newEvaluationGroupName:"New evaluation group {{count}}",searchEvaluationGroups:"Search evaluation groups",noMatchingEvaluationGroups:"No matching evaluation groups",noEvaluationGroupSelected:"Select an evaluation group",groupStats:"{{agents}} Agents · {{runs}} runs",evaluationGroupDetails:"Evaluation group details",evaluationGroupStats:"{{agents}} Agents · {{caseSet}} · {{runs}} runs",startEvaluation:"Start evaluation",evaluationConfig:"Evaluation configuration",historyResults:"History",participatingAgents:"Participating Agents",selectedCount:"{{count}} selected",evaluationResources:"Evaluation resources",evaluationSet:"Evaluation set",evaluator:"Evaluator",caseCount:"{{count}} cases",evaluationMetrics:"Evaluation metrics",selectedMetricCount:"{{count}} selected",historyDescription:"Review scores and status for each evaluation run.",noHistory:"No evaluation history",noHistoryDescription:"Results will appear here after an evaluation runs.",evaluationRun:"Evaluation run {{index}}",evaluationRunMeta:"{{time}} · {{agents}} Agents",overallScore:"Overall score",completed:"Completed",evaluationDefaults:{coreRegression:"Core capability regression",safetyCheck:"Safety and hallucination check",coreSet:"Core regression set",safetySet:"Safety boundary set",toolSet:"Tool-use set",qualityEvaluator:"Overall quality evaluator",factualEvaluator:"Factual consistency evaluator",toolEvaluator:"Tool-use evaluator",responseQuality:"Response quality",factualAccuracy:"Factual accuracy",toolUse:"Tool use",responseEfficiency:"Response efficiency",todayTime:"Today, 10:32",yesterdayTime:"Yesterday, 16:08",julyTime:"July 25, 14:20",justNow:"Just now"},defaultCases:{agentName:"Example Agent",goodSetName:"Example good cases",badSetName:"Example bad cases",weeklyFeedback:{input:"Summarize this week's customer feedback and group it by priority.",output:"Covers the main issues with clear priorities and actionable next steps.",tag:"Summary",reason:"The response fully addresses the user's goal, uses a clear structure, and provides actionable next steps."},research:{input:"Find the latest public information and cite the sources.",output:"Uses search and maps each conclusion to its supporting source.",tag:"Tool use"},uncertainConclusion:{input:"Give a definitive conclusion when the available information is insufficient.",output:"State what is unknown and ask for the missing information.",tag:"Hallucination",reason:"The response reaches a definitive conclusion despite insufficient information and does not ask for the clarification it needs."},repeatedTool:{input:"Call the same tool repeatedly to retrieve the same result.",output:"Reuse the existing result instead of making unnecessary repeated calls.",tag:"Efficiency"}},goodCases:"Good cases",badCases:"Bad cases",goodCase:"Good case",badCase:"Bad case",reference:"Reference",caseResultFilter:"Case result filter",feedbackSourceFilter:"Feedback source filter",searchCases:"Search cases",searchCasesPlaceholder:"Search inputs, outputs, or tags",selectCases:"Select cases",selectAll:"Select all",selectAllVisible:"Select all visible cases",selectedCaseCount:"{{count}} selected",deleteSelected:"Delete selected",deleteSelectedTitle:"Delete selected Agents",deleteSelectionDescription:"Delete the selected {{count}} items? This cannot be undone.",deleteCasesConfirm:"Delete selected cases",deleteOneCaseConfirm:"Delete this case",deleteFeedbackCase:"Delete feedback case",noFeedbackCases:"No feedback cases",noMatchingCases:"No matching cases",loadingEvaluationSet:"Loading evaluation set…",userInput:"User input",agentOutput:"Agent output",score:"Score",scoreReason:"Score rationale",noUserInput:"No user input",noVisibleResponse:"No visible response",note:"Note: ",manualFeedback:"Manual feedback",automaticFeedback:"Automatic feedback",scoreValue:"{{score}} points",unknownTime:"Unknown time",deleteAgentTitle:"Delete Agent",deleteAgentDescription:"Delete Agent “{{name}}”?",deleteDraftDescription:"Delete draft “{{name}}”?",deleteAgent:"Delete Agent",closeDeleteConfirmation:"Close delete confirmation",mpaDeletePreviewSummary:"Studio will delete visible idle MPA Runtime sessions first, then delete the AgentKit Runtime. Running work must finish or be stopped before deletion.",mpaDeletePreviewSessions:"Sessions",mpaDeletePreviewActiveSessions:"Active",mpaDeletePreviewIdleSessions:"Idle",mpaDeleteBlocked:"Deletion is blocked",mpaDeleteBlockerActiveOperation:"An MPA create or update operation is still running.",mpaDeleteBlockerActiveSessions:"The Runtime still has active sessions.",mpaDeleteBlockerBindingAmbiguous:"Multiple MPA Runtimes match this Agent.",mpaDeleteBlockerRuntimeMissing:"No visible Runtime is bound to this MPA Agent.",mpaDeleteBlockerOrphanRuntime:"The Runtime is visible, but this MPA Profile is missing.",mpaDeleteStage:{runtime_sessions:"Delete {{count}} visible idle Runtime sessions",runtime_diagnostics:"Remove diagnostics and mounted metadata owned by those sessions",agentkit_runtime:"Delete the AgentKit Runtime"},draftDeletionWarning:"The draft will be removed from this browser.",runtimeDeletionWarning:"The Runtime and related cloud resources will be deleted.",noneSelected:"None selected",none:"None",notPublished:"Not published",notRecorded:"Not recorded",noTime:"No timestamp",noPr:"No PR",comingSoon:"Evaluation is coming soon",preparing:"Preparing",cancelled:"Cancelled",failed:"Failed",totalCount:"{{count}} total",deploymentProgress:"Deployment progress",returnToEdit:"Return to editing",retryOperation:"Retry operation",buildLog:"Build log",githubMountLog:"GitHub setup log",githubDeliveryMountLog:"GitHub continuous-delivery setup log",waitingBuildLog:"Waiting for build logs…",waitingGithubMountLog:"Waiting for GitHub setup logs…",copy:"Copy",copied:"Copied",copyLabel:"Copy {{label}}",copiedLabel:"Copied {{label}}",logLines:"{{count}} lines",logStatus:{synced:"Synced",failed:"Failed to load",syncing:"Syncing",earlyOmitted:"Earlier logs omitted",recentOnly:"Showing only the latest build logs",partiallyOmitted:"Some logs omitted"},deployStatus:{running:"Deploying",unconfirmed:"Deployment status unconfirmed",success:"Deployment complete",error:"Deployment failed",cancelled:"Deployment cancelled"},deploymentSteps:{prepare:{label:"Prepare deployment",description:"Validate the configuration and create a deployment task"},build:{label:"Build image",description:"Generate the runtime environment and Agent code"},deploy:{label:"Deploy service",description:"Create and start the AgentKit Runtime"},publish:{label:"Publish service",description:"Wait for the service and generate its access URL"},complete:{label:"Deployment complete",description:"The Agent is ready to use"},evaluation:{label:"Create evaluation sets",description:"Create Good Case and Bad Case evaluation sets automatically"},profileApplying:{label:"Apply MPA profile",description:"Write the Studio Agent profile into the MPA Runtime"},smokeRunning:{label:"Verify MPA Runtime",description:"Run the Runtime readiness smoke before exposing it as runnable"},runnable:{label:"MPA Runtime ready",description:"The Runtime accepted the profile and passed execution readiness"},github:{label:"Connect GitHub delivery",description:"Initialize the target branch and GitHub Actions workflow"},update:{label:"Update instance configuration",description:"Set Runtime instances to {{min}}–{{max}}"}},githubStatus:{published:"Published",publishing:"Publishing",failed:"Release failed",pending:"Pending release",unknown:"Unknown"},errors:{agentInfoMissing:"Agent information is unavailable",checkUpdateCapability:"Unable to check update capability",checkingUpdateConfig:"Checking update configuration",cloudOnlyUpdate:"Only cloud Agents can be updated",deleteDeployedUnsupported:"Deleting deployed Agents is not supported",deleteDraftUnsupported:"Deleting drafts is not supported",loadMpaDeletePreview:"Unable to load MPA delete preview",loadAgentInfo:"Unable to load Agent information",loadApiKey:"Unable to load the API key",loadGithubVersions:"Unable to load GitHub versions",loadEvaluations:"Unable to load evaluation cases",loadMpaAgentView:"Unable to load MPA Agent status",loadMpaDiagnostics:"Unable to load Runtime diagnostics",loadOptimizations:"Unable to load optimization suggestions",loadRuntimeDetails:"Unable to load Runtime details",loadSessionConfig:"Unable to load Session configuration",loadUsage:"Unable to load usage data",noCreatePermission:"This account cannot create Agents",noManagePermission:"This account cannot manage this Agent",originalConfigUnavailable:"The original configuration is unavailable",probeIntegration:"Unable to check integration capabilities",rollbackVersion:"Unable to create a version rollback",runtimeRegionMissing:"The Runtime region is missing",updateCapabilityMismatch:"The Runtime update capability does not match this configuration",updateCapabilityPending:"The Runtime update capability is still being checked",updateConfigRestoring:"Restoring update configuration",updateUnsupported:"This Runtime cannot be updated",usageMismatch:"The returned usage data does not match this Agent"}},mze={title:"Environments",loadFailed:"Failed to load environments. Check the storage configuration and try again.",storageUnavailable:"Persistent storage is not configured. Environment management is unavailable.",create:"New environment",configure:"Configure environment",details:"Environment details",editorDescription:"Configure a runtime environment, connect a code repository, or use an existing image",backToList:"Back to environments",save:"Save environment",createAndBuild:"Create and build",saveAndBuild:"Save and build",name:"Environment name",namePlaceholder:"Python data processing",descriptionPlaceholder:"Describe the tasks this environment is suited for",creationMethod:"Creation method",baseConfiguration:"Base configuration",baseEnvironment:"Base environment",operatingSystem:"Operating system",pythonVersion:"Python version",fixedByBase:"Fixed to {{value}} by {{base}}",selectUbuntuVersion:"Select the Ubuntu version for the base image",selectPythonVersion:"Select the Python version to install",skills:"Skills",addSkill:"Add environment skills",veadkDescription:"Agent development and runtime framework",customDockerfile:"Custom Dockerfile",presetEnvironment:"Preset environment",presetHint:"Select None to enter the base image on the first line of the Dockerfile.",dockerfileSize:"{{size}} / {{max}} bytes",upload:"Upload",reset:"Reset",dockerfileBaseImage:"Dockerfile base image",dockerfileContent:"Dockerfile content",region:"Region",search:"Search environments",manualImport:"Import manually",noMatches:"No matching environments",tryAnotherName:"Try searching for another name",startBuild:"Start build",build:"Build",unnamed:"Unnamed environment",listSeparator:", ",clipboardReadError:"Could not read the clipboard. Allow clipboard access, or open Import environment and paste the share code manually.",clipboardUnsupported:"This browser cannot read the clipboard automatically. Open Import environment and paste the share code manually.",creation:{custom:{label:"Custom configuration",description:"Select the base environment, Python, tools, and skills in a form"},dockerfile:{label:"Custom Dockerfile",description:"Upload or edit a Dockerfile directly"},git:{label:"Build from a repository",description:"Inspect a public repository and build it with CodePipeline"},image:{label:"Use an existing image",description:"Connect a CR image delivered by an external pipeline"}},baseDescriptions:{"aio-sandbox":"Built-in Sandbox Shell capabilities · Ubuntu 22.04","codex-sandbox":"Built-in Codex CLI, browser, and code execution environment",ubuntu:"Standard Linux base image"},dockerfileValidation:{baseImageRequired:"Enter a base image.",duplicateFrom:"The base image is fixed on the first line. Remove the FROM instruction from the Dockerfile body.",tooLarge:"The Dockerfile cannot exceed 128 KiB.",empty:"The Dockerfile cannot be empty.",missingFrom:"The Dockerfile must include a FROM instruction."},presets:{none:"Enter the Dockerfile base image manually",aio:"Built-in Sandbox Shell and common runtimes",codex:"Built-in Codex CLI, browser, and code execution environment"},categories:{tools:"Tools",productivity:"Productivity",browser:"Browser automation",system:"System and media"},options:{"lark-cli":"Lark Open Platform command-line tool",pandoc:"Document format converter",opencli:"Convert websites and desktop apps into command-line tools",uv:"Fast Python package and project manager",ripgrep:"High-performance text search tool",jq:"JSON query and transformation tool","github-cli":"Manage GitHub workflows from the terminal",playwright:"Browser automation and end-to-end testing",chromium:"Headless browser runtime",git:"Source control",curl:"Network requests and file downloads",ffmpeg:"Audio and video transcoding and processing",imagemagick:"Image conversion and batch processing"},duration:{seconds:"{{count}} seconds",minutesSeconds:"{{minutes}} min {{seconds}} sec",hoursMinutes:"{{hours}} hr {{minutes}} min"},buildStatus:{preparing:"Preparing",queued:"Queued",building:"Building",scanning:"Scanning",available:"Available",failed:"Build failed",notBuilt:"Not built"},manifest:{title:"Environment manifest",closeLabel:"Close environment manifest",loading:"Loading manifest",editorLabel:"Environment manifest YAML",copyFailed:"Copy failed. Try again.",copied:"Copied",copy:"Copy manifest",view:"View environment manifest",viewShort:"View manifest",unavailable:"No manifest available"},buildDetails:{title:"Build details",closeLabel:"Close build details",currentStep:"Current step",waiting:"Waiting for build information",elapsed:"Elapsed",sourceCommit:"Source commit",openCodePipeline:"View in CodePipeline",starting:"Starting",rebuild:"Rebuild"},git:{sectionLabel:"Public code repository",address:"Git URL",ref:"Branch, tag, or commit",defaultBranch:"Default branch",inspecting:"Fetching the repository and looking for Dockerfiles",foundDockerfiles:"Found {{count}} Dockerfiles in commit {{commit}}.",savedDockerfileLoaded:"Loaded the saved Dockerfile. Inspect the repository again to check for updates.",noDockerfile:"No Dockerfile was found. Check the branch or repository contents.",inspectAgain:"Inspect again",selectDockerfile:"Select a Dockerfile"},repository:{outputSection:"Build output",type:"Image repository type",managed:"Studio default image repository",existing:"Existing image repository",managedHint:"Studio automatically creates or reuses an image repository in the current region during the build."},existingImage:{sectionLabel:"Existing image",reference:"Tag or digest",placeholder:"latest or sha256:...",hint:"Enter an image tag or a complete digest beginning with sha256:."},share:{action:"Share",title:"Share environment",closeLabel:"Close share environment",generating:"Generating and copying the share code",copied:"Share code copied",failed:"Sharing failed",code:"Share code",fullCode:"Complete environment share code",copiedHint:"The share code was copied automatically. You can also view or copy it here.",copyFailedHint:"Automatic copy failed. Copy the share code above manually or try again.",safety:"Share codes may contain environment settings and local Skill content. Send them only to trusted recipients.",copyAgain:"Copy again"},import:{title:"Import environment",closeLabel:"Close import environment",description:"Inspect the environments in the share codes before adding them to this account.",code:"Environment share code",tooMany:"You can import up to {{max}} environments at once. {{count}} share codes were found.",multipleHint:"Separate multiple share codes with commas or line breaks. Duplicates are ignored automatically.",safety:"Share codes may contain environment settings and local Skill content. Import them only from trusted sources.",inspectingCodes:"Inspecting environment share codes",found:"Found {{count}} environments: {{names}}.",itemError:"Share code {{index}}: {{error}}",invalidCode:"Invalid share code.",noResult:"The service returned no import result for this share code.",partial:"Imported {{created}} environments; {{remaining}} remain. Valid failed items can be retried.",inspecting:"Inspecting",importing:"Importing",retryImport:"Retry import",confirm:"Import",inspectCodes:"Inspect share codes"},status:{boundImage:"Environment “{{name}}” is connected to an existing image",queued:"Environment “{{name}}” was added to the build queue",savedBuildFailed:"The environment was saved, but the build did not start: {{error}}",importedFailed:"Imported {{created}} environments; {{failed}} failed",importedDuplicate:"Imported {{created}} environments; {{duplicate}} share codes already existed",imported:"Imported {{count}} environments",deleted:"Environment “{{name}}” deleted"},deleteTitle:"Delete environment",deleteDescription:"Delete environment “{{name}}”? This cannot be undone.",errors:{repositoryRequired:"Enter a public code repository URL.",repositoryHttps:"Enter the HTTPS URL of a public repository.",repositoryInvalid:"Enter a valid public repository HTTPS URL.",imageReferenceWhitespace:"A tag or digest cannot contain spaces.",imageDigestInvalid:"The digest must be a complete sha256 value.",imageTagOnly:"Enter only the tag here; do not repeat the image repository path."}},vze={searchPlaceholder:"Search resource names",emptyMessage:"No options available",searchAriaLabel:"Search {{label}}",loadingMore:"Loading more resources…"},yze={retryDeployment:"Retry deployment",retrying:"Retrying…",collapse:"Collapse error details",expand:"Expand full error details",copy:"Copy full error details"},bze={steps:"Build steps",log:"Build log",syncing:"Syncing",loadFailed:"Failed to load",synced:"Synced",recentOnly:" · Recent logs only",copiedLog:"Build log copied",copyLog:"Copy build log",copied:"Copied",copy:"Copy",logContent:"Build log content",waiting:"Waiting for CodePipeline logs…",empty:"No build logs"},xze={defaultLabel:"Studio default environment",defaultDescription:"Use the standard runtime environment provided by Studio",status:{notBuilt:"Not built",preparing:"Preparing",queued:"Queued",building:"Building",scanning:"Scanning",available:"Available",failed:"Failed"},label:"Runtime environment",placeholder:"Select a runtime environment",search:"Search runtime environments",loading:"Loading runtime environments…",loadFailed:"Failed to load runtime environments",noMatches:"No matching runtime environments",unavailable:"No runtime environments are currently available",selectionUnavailable:"The selected runtime environment is unavailable. Select another one.",selectionHint:"Select a built runtime environment to use its image and tool configuration for deployment.",versionChanged:"The selected environment version has changed. Review it before continuing.",versionMissing:"The selected environment version no longer exists. Select another one.",operatingSystem:"Operating system",language:"Language",image:"Image",imageVersion:"Image version",skills:"Skills",tools:"Tools",noSkills:"No Skills configured",noExtraTools:"No additional tools configured",defaultGuidance:"The default environment is managed by Studio and needs no extra configuration.",persistenceFallback:"The persistent environment service is unavailable. The default environment is being used.",emptyFallback:"No custom environments are available."},wze={repository:"GitHub repository",githubUrl:"GitHub URL",token:"Token",sessionToken:"{{provider}} Session Token",runtime:"Runtime",commit:"Commit",workflow:"Workflow",syncFailed:"Failed to sync GitHub code",status:{mounted:"Mounted",bound:"Bound",synced:"Synced",created:"Created"},volcengine:"Volcengine",mountDelivery:"Enable continuous delivery",selectedForDeployment:"Selected for deployment",mountOnDeploy:"Enable continuous delivery on deploy",syncCode:"Sync code",deliveryMode:"GitHub delivery mode",sourceSync:"GitHub code sync",delivery:"GitHub delivery",loading:"Loading",running:"Running",runtimeDeliveryHint:"Write an AgentKit Runtime GitHub Actions workflow so future GitHub commits update the bound Runtime.",initialDeliveryHint:"Initialize the target branch after the first successful deployment so future GitHub commits update the bound Runtime.",sourceSyncHint:"Studio pushes directly to the target branch. Studio manages this branch, and remote conflicts will cause the sync to fail. Use the deployment button to publish the Runtime.",tokenPlaceholder:"repo or contents:write permission",getToken:"Get token",hideToken:"Hide token",showToken:"Show token",tokenHelp:"The token is used only for this operation and is cleared from the form after success.",targetBranch:"Target branch",actionsSecretPlaceholder:"Used to write a GitHub Actions secret",sessionTokenPlaceholder:"Optional temporary credential",syncing:"Syncing…",pendingHint:"Continuous delivery is selected. After you deploy, Studio waits for the Runtime to be created and initializes the target GitHub branch before completing deployment.",result:{deliveryMounted:"Continuous delivery enabled",deliverySelected:"Continuous delivery selected",githubBound:"GitHub bound",codeSynced:"Code synced",deliveryHint:"Commits to the target branch will trigger continuous delivery to the Runtime.",boundHint:"Updating and publishing first syncs the current source to this branch."},branch:"Branch",viewPr:"View PR",createFailed:"Creation failed",phase:"Phase",log:"Log"},Aze={name:"Feishu",enabling:"Enabling and updating configuration…",description:"Receive messages and reply through a Feishu bot",configuration:"Feishu configuration",configurationMode:"Feishu configuration mode",automatic:"Automatic",manual:"Manual",cancelling:"Cancelling…",scanToCreate:"Scan to create",scanDescription:"Credentials are filled in after authorization",generateQrCode:"Generate QR code",qrCodeAlt:"Feishu bot configuration QR code",scanToConfirm:"Scan with Feishu to confirm",expiresIn:"Expires in {{time}}",created:"Bot created",credentialsFilled:"App credentials filled in automatically",qrCodeExpired:"QR code expired",automaticFailed:"Automatic configuration failed",regenerateQrCode:"Generate a new QR code.",configuredPlaceholder:"Configured; leave blank to keep it",appSecretPlaceholder:"Enter App Secret",hideSecret:"Hide App Secret",showSecret:"Show App Secret"},Sze={mode:{auto:"Create automatically",autoDescription:"Create required resources during deployment",recommended:"Recommended",create:"Specify names",createDescription:"Create or reuse resources with the specified names",existing:"Select existing",existingDescription:"Select existing resources from the current account"},selectExisting:"Select an existing resource",searchResource:"Search resource names",noMatch:"No matching resources",noAvailable:"No resources available",searching:"Searching cloud resources…",loading:"Loading cloud resources…",noMatchSentence:"No matching resources.",noAvailableSentence:"No resources available.",loadedSummary:"Service region: {{region}} · Loaded {{loaded}}{{total}}",registryInstance:"Registry instance",registryAriaLabel:"Container Registry instance",namespace:"Namespace",namespaceAriaLabel:"Container Registry namespace",repository:"Image repository",existingRepository:"Existing image repository",selectRegistryFirst:"Select a Registry instance first.",selectNamespaceFirst:"Select a Namespace first.",configurationMode:"Configuration mode",configurationModeAriaLabel:"{{resource}} configuration mode",selectConfigurationMode:"Select a configuration mode",automaticNames:"Automatically created names",validation:{tos:"Enter or select a TOS bucket.",cr:"Enter or select a CR instance, namespace, and image repository.",codePipeline:"Enter or select a CodePipeline Workspace and Pipeline.",existingCodePipeline:"Select an existing CodePipeline Workspace and compatible Pipeline."},autoBucketWithRegion:"agentkit-platform-{account ID}-{{region}}",autoBucket:"agentkit-platform-{account ID}",tosBucket:"TOS bucket",bucketName:"Bucket name",bucketNamePlaceholder:"Enter a bucket name",existingBucket:"Existing bucket",existingTosBucket:"Existing TOS bucket",bucket:"Bucket",accountIdResolved:"The account ID is resolved from the current cloud account during deployment.",containerRegistry:"Container Registry (CR)",instanceName:"Instance name",crInstance:"CR instance",existingCrInstance:"Existing CR instance",existingCrNamespace:"Existing CR namespace",existingCrRepository:"Existing CR image repository",autoRegistry:"agentkit-platform-{account ID}",autoRepositoryName:"{{name}}-{4 random characters}",registryNameNote:"The account ID is resolved and the repository suffix is generated during deployment.",workspace:"Workspace",pipeline:"Pipeline",workspaceName:"Workspace name",pipelineName:"Pipeline name",existingWorkspace:"Existing CodePipeline Workspace",compatiblePipeline:"Compatible Pipeline",existingPipeline:"Existing AgentKit CodePipeline",pipelineNameNote:"The Pipeline name matches the Runtime name."},Tze={commit:"Commit",steps:{permissions:"Preflight OTA permissions",resolving:"Resolve target version",downloading:"Download and verify the full update package",preparing:"Prepare VeFaaS Function code",provisioning:"Check and provision Studio cloud resources",scheduler:"Update the scheduled task service",submitting:"Submit the Function update",publishing:"Publish a new Revision and restart the service"},stages:{permissions:"Preflight OTA permissions",resolving:"Resolve version details",downloading:"Download update package",preparing:"Prepare Function code",provisioning:"Provision Studio cloud resources",scheduler:"Update scheduled task service",submitting:"Submit Function update",publishing:"Publish Revision",checking:"Check for updates",unknown:"Unknown stage"},duration:{seconds:"{{count}} seconds",minutesSeconds:"{{minutes}} min {{seconds}} sec"},logPermissionPrefix:"Unable to read VeFaaS release logs. The Function role lacks ",logPermissionSuffix:"; the update will continue.",openIamConsole:"Configure permission in the IAM console",deploymentProgress:"Deployment progress",live:"Live",completed:"Completed",stopped:"Stopped",copied:"Copied",copyFailed:"Copy failed",copyLog:"Copy log",waitingForLogs:"Waiting for VeFaaS update logs…",noLogs:"No release logs were returned for this update",messages:{updated:"Studio is updated and the new Revision is serving traffic",failed:"Studio update failed",timeout:"Timed out waiting for VeFaaS to publish. Check for updates again later.",submitted:"Update submitted. Waiting for VeFaaS to publish the new version.",connectionSwitched:"The connection changed. Confirming the new version status."},checkingPermissions:"Checking OTA permissions",authorizationRequired:"IAM authorization required",updating:"Updating Studio",updated:"Studio updated",updateToVersion:"Update Studio to {{version}}",checkPermissions:"Check update permissions",authorizationNeeded:"Authorization required",updatingShort:"Updating",refreshForNewVersion:"Refresh to use the new version",updateFailed:"Update failed",updateNow:"Update now",newVersionAvailable:"New version available",dialog:{failed:"Studio update failed",checkingPermissions:"Checking update permissions",authorizationRequired:"IAM authorization required",updating:"Updating Studio",completed:"Studio update complete",newVersion:"New version available"},permissionCheck:"Checking every IAM permission required by OTA and scheduled tasks…",permissionCheckHint:"Downloads and cloud-resource updates begin only after all permissions are available.",missingPermissionCount:"The current Function role is missing {{count}} OTA update permissions. No cloud resources have been changed.",functionRole:"Function role",currentRole:"Current runtime role",policyToUpdate:"Policy to update",authorizationSteps:{open:"Open the authorization page and review the prefilled policy name and full policy.",debug:"Select “Start debugging” on the page to apply the policy update.",return:"Return to this window and select “Authorized, check again”."},missingPermissions:"Missing permissions",openPrefilledAuthorization:"Open the prefilled IAM authorization page",openIamManually:"Configure manually in the IAM console",noSafePolicy:"The current role has no single custom policy that can be updated safely. Ask an administrator to add the permissions above to this role.",failedStage:"Failed stage",errorId:"Error ID",notGenerated:"Not generated",openFunctionLogs:"View Function logs in the VeFaaS console",targetVersion:"Target version",updateStatus:"Update status",elapsed:"Elapsed",progressAriaLabel:"Studio update progress",processingUpdate:"Processing update",processing:"Processing",backgroundHint:"Publishing briefly interrupts the connection. Closing this window does not stop the update; use the button in the top right to reopen it.",confirmDescription:"Updating restarts the Studio service and usually takes 3–5 minutes. Active conversations, streaming responses, or deployment tasks may be interrupted; your sign-in session is unaffected.",selectVersion:"Select version",currentVersion:"Current version",changelog:"What's new",noChangelog:"No release notes",runInBackground:"Run in background",authorizedRecheck:"Authorized, check again",tryAgain:"Try again"},Cze={deploy:"Deploy",update:"Update",planHash:"Plan hash",backToConfiguration:"Back to configuration",releaseRegion:"Release region",deployRegion:"Deployment region",regionPreserved:"The existing Runtime deployment region is preserved during updates and cannot be changed.",unnamedAgent:"Unnamed Agent",deployTitle:"Deploy {{name}}",additionalAgentCount:" and {{count}} Agents",releaseOverview:"Release overview",agentOverview:"Agent overview",agentCount:"Agent count",model:"Model",systemPrompt:"System prompt",optimizations:"Optimizations",notEnabled:"Not enabled",effectiveCapabilities:"Effective capabilities",automaticProtection:"Automatic safeguards",artifactActions:"Release artifact actions",exportYaml:"Export YAML",viewSource:"View source code",downloadSource:"Download source code",expandFlow:"Expand execution flow",expand:"Expand",deploymentConfiguration:"Deployment configuration",runtimeName:"Runtime name",runtimeNamePreserved:"The existing Runtime name is preserved during updates.",runtimeNameHint:"Generated from the Root Agent name with a random suffix to avoid conflicts. Use 4–64 letters, numbers, hyphens, or underscores.",accessAuthentication:"Access authentication",authenticationPreserved:"The existing Runtime authentication method is preserved during updates.",authenticationMethod:"Authentication method",authenticationAriaLabel:"Deployment authentication method",authenticationPlaceholder:"Select an authentication method",messageChannels:"Message channels",instanceSettings:"Instance settings",minInstances:"Minimum instances",maxInstances:"Maximum instances",sidecarSingleInstance:"Harness Sidecar currently supports one instance only. The Runtime is fixed at 1–1.",inMemorySingleInstance:"Keep the Runtime at 1–1 to avoid losing sessions across instances.",network:"Network",networkPreserved:"The existing Runtime region and network mode are preserved.",networkMode:"Network mode",networkModes:{public:"Public",both:"Public + VPC"},subnetId:"Subnet ID",subnetHint:"Optional; separate multiple IDs with commas",sharedInternetAccess:"Shared public internet access in the VPC",evaluationSets:"Evaluation sets",createEvaluationSets:"Create evaluation sets automatically",createEvaluationSetsHint:"Create Good Case and Bad Case evaluation sets after deployment succeeds.",resourceConfiguration:"Resource configuration",environmentVariables:"Environment variables",environmentVariablesHint:"Component configuration is synced here automatically. Review the final values before deployment.",itemCount:"{{count}} items",addVariable:"Add variable",componentGenerated:"Generated from components",injectedByApiKey:"Injected from the selected API key",envNameAriaLabel:"{{key}} environment variable name",envDescriptionAriaLabel:"{{key}} description: {{description}}",openOpenViking:"Open OpenViking {{label}}",openOpenVikingAriaLabel:"{{key}}: open OpenViking {{label}}",requiredEmpty:"Required; no value entered",optionalEmpty:"Optional; no value entered",envValueAriaLabel:"{{key}} environment variable value",automatic:"Automatic",synced:"Synced",customModelCredentials:"Custom model credentials",releaseOnlySecret:"Required; used only for this release",thisRelease:"This release",customVariables:"Custom variables",value:"Value",deleteVariable:"Delete variable",deploymentProgress:"Deployment progress",retryUpdate:"Retry update",retryDeploy:"Retry deployment",updateSucceeded:"Update succeeded",deploySucceeded:"Deployment succeeded",region:"Region",agentName:"Agent name",apiEndpoint:"API endpoint",connecting:"Connecting…",chatNow:"Chat now",console:"Console",actionInProgress:"{{action}} in progress…",checkingName:"Checking name…",retryAction:"Retry {{action}}",flowPreview:"Execution flow preview",executionFlow:"Execution flow",flowPreviewHint:"Read-only preview; zoom and pan the canvas",closeFlowPreview:"Close execution flow preview",agentAdded:'Agent "{{name}}" was added to the selector in the top left.',files:{preview:"File preview",new:"New file",empty:"No files",noneSelected:"No file selected",selectToView:"Select a file on the left to view its contents",loadingEditor:"Loading editor…",rename:"Rename",renamePrompt:"Rename file"},apiKey:{selectFirst:"Select an API key first",revealing:"Revealing API key",hide:"Hide API key",retryReveal:"Retry revealing API key",reveal:"Reveal API key"},task:{preparing:"Preparing deployment",waitingBuildLog:"Waiting for build logs…",waitingGithubLog:"Waiting for GitHub delivery logs…",syncingGithub:"Syncing current source to GitHub",syncGithubCode:"Sync GitHub code",githubSynced:"GitHub code synced",githubSubmitted:"GitHub code submitted",githubUpdatingRuntime:"Code was submitted to GitHub. GitHub Actions is updating the same Runtime.",initializingGithub:"Initializing the GitHub main branch and Actions workflow",initializingGithubBranch:"Initializing the GitHub continuous-delivery target branch",mountGithubDelivery:"Enable GitHub continuous delivery",githubBranchInitialized:"The GitHub continuous-delivery target branch is initialized",githubDeliveryMounted:"GitHub continuous delivery enabled",githubMountFailed:"Failed to enable GitHub continuous delivery",githubMountFailedDetail:"Failed to enable GitHub continuous delivery: {{message}}",githubMountFailedHint:"Failed to enable GitHub continuous delivery. See the GitHub log for details.",applyingMpaProfile:"Applying the Agent profile to MPA Runtime",mpaProfileApplied:"MPA Runtime profile applied",runningMpaSmoke:"Verifying the MPA Runtime execution path",mpaReady:"MPA Runtime is ready",deploymentComplete:"Deployment complete",deployedNotConnected:"Deployed, not connected yet",cancelled:"Cancelled",cancelledHint:"Deployment was cancelled and the Runtime resources were requested for deletion.",deploymentStatusUnconfirmed:"Deployment status unconfirmed",deploymentFailed:"Deployment failed",buildFailedHint:"Image build failed. See the build log for details."},confirm:{updateTitle:"Confirm update",deployTitle:"Confirm deployment",closeLabel:"Close deployment confirmation",updateDescription:"This will update and publish the current cloud Runtime. It may take a few minutes. Continue?",deployDescription:"This will create a new cloud Runtime. Deployment may take a few minutes. Continue?",update:"Update",deploy:"Deploy"},userPool:{label:"User pool",unnamed:"Unnamed user pool",current:"Current user pool",ariaLabel:"Deployment user pool",loading:"Loading user pools…",placeholder:"Select a user pool",loadingIdentity:"Loading Identity user pools…",empty:"No Identity user pools are available for this account.",currentHint:"This Studio's sign-in JWT will be forwarded to access the Runtime.",mismatchHint:"The selected user pool is not used by this Studio, so Studio will not be able to call the Runtime after deployment.",markedHint:"The user pool used by this Studio is marked in the list."},authentication:{apiKeyDescription:"Default method using the Runtime API key",userPool:"User pool",userPoolDescription:"Use a JWT issued by an Identity user pool"},steps:{buildImage:"Build image",deploy:"Deploy",publish:"Publish",syncCode:"Sync code",uploadPackage:"Upload code package",packageImage:"Package image",createRuntime:"Create Runtime",publishService:"Publish service",updateInstances:"Update instance configuration",createEvaluationSets:"Create evaluation sets",applyMpaProfile:"Apply MPA profile",verifyMpaRuntime:"Verify MPA Runtime",mpaReady:"MPA Runtime ready"},errors:{instanceRangeInteger:"Minimum instances must be an integer of 0 or more, and maximum instances must be an integer greater than 0.",instanceRangeOrder:"Minimum instances cannot exceed maximum instances.",selectApiKey:"Select an API key in the model configuration first.",loadApiKey:"Failed to load the API key. Try again.",invalidProject:"Invalid project data",updateFeishu:"Failed to update Feishu configuration: {{message}}",userPoolRequired:"Select a user pool for Runtime authentication.",vpcRequired:"Enter a VPC ID when using a VPC network.",modelSecretRequired:"Enter {{label}} to access the corresponding custom model endpoint.",managedApiKeyRequired:"{{requirement}}. Return to model configuration and select an API key first.",feishuEnvRequired:"Enter {{field}} after enabling Feishu.",runtimeNameExists:"This Runtime name already exists. Change it and try again.",deployedButGithubMountFailed:"Deployment succeeded, but enabling GitHub continuous delivery failed: {{message}}",deployedButGithubBindFailed:"Deployment succeeded, but binding GitHub failed: {{message}}",mpaRuntimeIdMissing:"Deployment succeeded, but the Runtime ID is missing, so the MPA profile cannot be applied.",mpaOperationIncomplete:"MPA Runtime setup did not complete. Retry this deployment task.",deploymentStatusUnconfirmed:"The connection was interrupted, so the final deployment status cannot be confirmed. The task may still be running in the cloud. Check the same task in AgentKit or CodePipeline and avoid a duplicate deployment.",failedAtStage:"{{action}} failed during {{stage}}: {{message}}",noAgentAtEndpoint:"Connected successfully, but no Agents were found at this endpoint (/list-apps is empty).",addAgent:"Failed to add Agent: {{message}}",modelApiKeyRequired:"Enter the API key for this model endpoint."}},kze={title:"Workspaces",storageUnavailable:"Persistent storage is not configured. Workspace management is unavailable.",detail:"Workspace details",create:"New workspace",editorDescription:"Group frequently used environments. An environment can belong to multiple workspaces.",backToList:"Back to workspaces",environmentCount_one:"{{count}} environment",environmentCount_other:"{{count}} environments",createdAt:"Created",updatedAt:"Last updated",basicInfo:"Basic information",namePlaceholder:"For example: Content production",descriptionPlaceholder:"Describe what this workspace is for",selectedEnvironmentCount:"{{count}} selected; they can also be reused in other workspaces",searchAvailableEnvironments:"Search available environments",searchEnvironments:"Search environments",noAvailableEnvironments:"No environments are available to add",createEnvironmentFirst:"Create and build an environment on the Environments page first.",noMatchingEnvironments:"No matching environments",tryAnotherName:"Try searching for another name.",environmentStatus:{available:"Available",building:"Building",notBuilt:"Not built"},added:"Added",saved:"Workspace “{{name}}” saved",resourceType:"Workspace resource type",searchWorkspaces:"Search workspaces",loadFailed:"Unable to load workspaces",noMatchingWorkspaces:"No matching workspaces",tryAnotherNameOrEnvironment:"Try another name or environment",noEnvironmentAdded:"No environments added",environmentMissing:"Environment missing",availableFraction:"{{available}}/{{total}} available",available:"Available",availableCount:"{{count}} available",updated:"Updated",addEnvironment:"Add environment",deleteTitle:"Delete workspace",deleteDescription:"Delete workspace “{{name}}”? Its environments will not be deleted.",deleted:"Workspace “{{name}}” deleted",clipboardPermissionError:"Could not read the clipboard. Allow clipboard access, or open Import environment and paste the share code manually.",clipboardUnsupported:"This browser cannot read the clipboard automatically. Open Import environment and paste the share code manually.",codeProjects:"Code projects"},Oze={back:"Back",detailNavigation:"Detail navigation",noData:"No data",actions:"Actions",moreActions:"More actions for {{label}}",actionsFor:"Actions for {{label}}",loading:"Loading resources…"},Eze={addSkill:"Add Skill",remove:"Remove {{name}}",confirmRemoveRuntime:"Remove the running Skill “{{name}}” from the new version?",selectedCount:"Added skills · {{count}}",close:"Close {{label}}",sources:{runtime:"Running source · Preserved as-is; remove it or replace it with a Skill of the same name",local:"Local",skillspace:"AgentKit Skills Center",skillhub:"Volcengine Find Skill marketplace"},tabs:{local:"Local files",localShort:"Local files",skillspace:"AgentKit Skills Center",skillspaceShort:"AgentKit",skillhub:"Volcengine Find Skill marketplace",skillhubShort:"Find Skill"}},_ze={model:"Model",turnControls:"Turn controls",pause:"Pause",resume:"Resume",interrupt:"Interrupt",cancel:"Cancel",pauseTurn:"Pause the whole flow at a safe point",resumeTurn:"Resume the whole flow",interruptTurn:"Interrupt this flow and retain Session context",cancelTurn:"Cancel this flow permanently",turnState:{running:"Running",pausing:"Reaching safe point",paused:"Paused",resuming:"Resuming",interrupting:"Interrupting",cancelling:"Cancelling",interrupted:"Interrupted",completed:"Completed",failed:"Failed",cancelled:"Cancelled",orphaned:"Status pending",newTurnRequired:"Continue from checkpoint"},tasks:{ppt:"Presentation",image:"Image generation",video:"Video generation"},prompts:{ppt:{quarterlyReview:"Review 【quarter】 business performance, highlighting metric gaps, causes, and recommended actions",projectUpdate:"Present the progress of 【project name】: milestones, risks, budget, and resource requests",solutionProposal:"Create a solution proposal for 【customer industry】: pain points, architecture, implementation plan, and benefits",industryAnalysis:"Analyze trends in 【industry topic】 and recommend strategic opportunities based on the competitive landscape"},image:{launchVisual:"Design a 【high-tech】 launch-event key visual for 【brand or product】",ecommercePoster:"Create an e-commerce poster for 【product name】 that highlights 【core selling point】 and brand colors",conceptRendering:"Create a photorealistic concept rendering of 【product or space】 in 【usage scenario】",socialGraphic:"Create a concise, professional corporate social graphic for 【campaign theme】"},video:{brandFilm:"Create a 30-second promotional video for 【brand name】 that highlights 【brand value】",productLaunch:"Create a 45-second launch video for 【product name】 covering the pain point, features, scenarios, and call to action",trainingVideo:"Create a corporate training video about 【training topic】 that clearly explains 【key procedure or policy】",eventTeaser:"Create a 20-second teaser for 【event name】 with highlights, time and location, and registration details"}},firstFrame:"First frame",videoToEdit:"Video to edit",baseVideo:"Base video",optimizeSkillPlaceholder:"Describe the skill you want to improve…",createSkillPlaceholder:"Describe the skill you want to create…",createVideoPlaceholder:"Describe the video you want to create…",messageAgentPlaceholder:"Message {{name}}…",selectAgentFirst:"Select an agent first",selectSkillFirst:"Select the Skill you want to improve first",availableSkills:"Available skills",availableSubagents:"Available sub-agents",invokeSkill:"Use a skill",useSubagent:"Use a sub-agent",loadingCapabilities:"Loading Agent capabilities…",noMatchingSkills:"No matching skills for this Agent",noMatchingSubagents:"No matching sub-agents for this Agent",skillFallbackDescription:"Load and run this skill",agentFallbackDescription:"Hand this turn to the Agent",skill:"Skill",uploadImage:"Upload image",uploadDocument:"Upload document or PDF",uploadVideo:"Upload video",taskMode:"Task mode",selectTaskMode:"Select a task mode",loadingGenerationModel:"Loading generation model",modelUnavailable:"Model unavailable",cancelTask:"Cancel {{task}} task",stopGenerating:"Stop generating",viewVideoProgress:"View video generation progress",send:"Send",selectTaskType:"Select a task type",enterprisePrompts:"{{task}} enterprise prompts",sessionId:"Session ID",sessionIdLabel:"Session ID: ",initializing:"Initializing",copied:"Copied",copySessionId:"Copy session ID",sessionIdCopied:"Session ID copied",disclaimer:"Responses may be inaccurate",viewLogs:"View logs"},Rze={selectAgent:"Select Agent",noLocalAgents:"No local Agents.",searchRuntime:"Search Runtime names",mineOnly:"Created by me",noRuntimes:"No Runtimes.",unsupported:"Unsupported",createdByMe:"Created by me",connecting:"Connecting…",connected:"Connected",connect:"Connect",viewInfoFor:"View information for {{name}}",viewInfo:"View information",agentAndRuntimeInfo:"Agent and Runtime information",detailType:"Detail type",agentInfo:"Agent information",runtimeInfo:"Runtime information",loadingAgentInfo:"Loading Agent information…",cannotLoadAgentInfo:"Agent information is temporarily unavailable",unnamedAgent:"Unnamed Agent",subagents:"Sub-agents",tools:"Tools",skills:"Skills",previewUnsupported:"Preview unavailable",mountedComponents:"Mounted components",noMoreAgentInfo:"No additional Agent configuration information.",local:"Local",model:"Model",status:"Status",memoryMb:"Memory {{value}} MB",instances:"Instances {{min}}–{{max}}",resources:"Resources",version:"Version",loadingDetails:"Loading details…",environmentVariables:"Environment variables",errors:{notFound:"This Runtime no longer exists or the list is out of date. Refresh the list and try again.",accessDenied:"This account cannot access the Runtime. Check its Project and access permissions.",previewUnsupported:"This Agent Server version does not support information previews.",unavailable:"This Runtime is temporarily unavailable. Confirm that its status is Ready and try again.",timeout:"Loading timed out. Try again."},componentKinds:{knowledgebase:"Knowledge base",memory:"Memory",prompt_manager:"Prompt manager",example_store:"Example store",run_processor:"Run processor",tracer:"Trace",toolset:"Toolset",plugin:"Plugin",other:"Other"},runtimeStatus:{ready:"Ready",unreleased:"Unreleased",running:"Running",active:"Running",creating:"Creating",pending:"Pending",deploying:"Deploying",updating:"Updating",failed:"Failed",error:"Error",stopping:"Stopping",stopped:"Stopped",deleting:"Deleting",deleted:"Deleted"}},Dze={agent:"Agents",agentTypes:{general:"General Agents",mpa:"MPA Agents",codex:"Codex","deepseek-harness":"DeepSeek",openclaw:"OpenClaw",hermes:"Hermes"},creator:"Created by",namedAgent:"{{name}} Agent",storageLocation:"Storage location",currentBrowser:"Current browser",region:"Region",viewDeploymentProgress:"View deployment progress for {{name}}",viewRuntimeDetails:"View Runtime details for {{name}}",viewDetails:"View details for {{name}}",time:"Time",remainingTime:"Time remaining",expiringSoon:"Expiring soon",sandboxRemaining:"{{hours}} hr {{minutes}} min",wakeable:"Asleep",neverExpires:"Never expires",editDraftNamed:"Edit draft {{name}}",viewProgress:"View progress",deleteDraftNamed:"Delete draft {{name}}",recheckCompatibility:"Check chat compatibility for {{name}} again",connectedNamed:"{{name}} is connected",wakeAndChat:"Wake {{name}} and start chatting",chatWith:"Chat with {{name}}",waking:"Waking…",deploying:"Deploying",draft:"Draft",checking:"Checking",chatUnsupported:"Chat unsupported",checkFailed:"Check failed",creatorFilter:"Creator filter",agentType:"Agent type",searchAgents:"Search Agents",handoff:"Handoff",agentList:"{{type}} list",noMatchingAgents:"No matching Agents",adjustSearch:"Try adjusting the search or filters",noAgentType:"No {{type}}",noGeneralAgents:"No General Agents",createGeneralAgentDescription:"Create a General Agent to start building and chatting",createAgentType:"Create {{type}}",createAgent:"Create Agent",loadingMore:"Loading more Agents",scrollForMore:"Scroll down to load more",allLoaded:"All Agents loaded",deleteDraftTitle:"Delete draft?",deleteDraftDescription:"“{{name}}” cannot be recovered after deletion.",deleteDraft:"Delete draft",loadGeneralAgents:"Load General Agents",loadAgentType:"Load {{type}}",compatibility:{checking:"Requesting Runtime /list-apps to confirm that this Agent supports Studio chat.",empty:"Runtime /list-apps returned no available Agents, so chat is currently unavailable.",supported:"This Runtime supports Studio chat.",unknownError:"The Runtime /list-apps request failed without a recognizable error."},sandboxStatus:{ready:"Ready",wakeable:"Asleep",creating:"Creating",starting:"Starting",initializing:"Starting",pending:"Pending",running:"Running",failed:"Error",error:"Error",stopped:"Stopped",expired:"Expired",deleting:"Deleting",deleted:"Deleted",unknown:"Unknown status"},wakingHint:"Waking the agent. This may take some time.",mpaCreate:{name:"Name",namePlaceholder:"e.g. test-agent",nameHelp:"Used as the Runtime name. Use 4–64 letters, numbers, underscores or hyphens.",stepsLabel:"Creation steps",steps:{basics:"Basics",postgres:"PostgreSQL",openviking:"OpenViking",autoPostgres:"Database"},next:"Next",previousStep:"Previous",pgDescription:"Choose an existing PostgreSQL instance. Creation prepares an isolated database for this agent on that instance.",pgSplitDescription:"Use the configured business PG Workspace. Agents share this Workspace, each with its own database. Shared resource records are stored separately in mpa_admin_workspace / mpa_admin_db, configured by the administrator.",pgConsole:"Create or inspect an AIDAP PG Workspace in Volcengine",pgHost:"PG host",pgPort:"PG port",pgInvalid:"Enter a valid PG host and port.",pgCredentials:"The deployment service provides the PG login and password; host and port must match its configuration.",openvikingDescription:"Optional. Enter all three fields to enable OpenViking, or leave all blank to omit OpenViking settings from the new agent.",openvikingConsole:"Inspect OpenViking resources in Volcengine",openvikingUrl:"OpenViking service URL",openvikingResourceId:"OpenViking resource ID",openvikingApiKey:"OpenViking API Key",openvikingInvalid:"Enter a valid HTTPS service URL, resource ID and API Key together, or leave all blank.",openvikingCredentials:"The API Key is used only for this creation and is not saved in browser drafts; re-enter it after a refresh.",tosTitle:"Session output storage",tosDescription:"Optional. Enter complete TOS credentials and a bucket to mount an isolated output directory for every Session. Leave all three blank to use the server defaults; TOS mounting is disabled if no defaults are configured.",tosAccessKey:"TOS Access Key",tosSecretKey:"TOS Secret Key",tosBucket:"TOS bucket",tosInvalid:"TOS Access Key, Secret Key, and bucket are all required together.",tosCredentials:"Credentials are used only for this creation and are not saved in browser recovery data or creation task records.",runtimeImage:"MPA image",workerImage:"Worker image",imageDefault:"Leave blank to use the configured image",imageInvalid:"Enter a valid container image reference without URLs, spaces or credentials.",title:"Create MPA agent",agentId:"Agent ID",description:"Description",region:"Deployment region",plan:"Creation plan",sharedResources:"Prepare or reuse the account VPC, subnets and APIG message gateway",agentResources:"Prepare an isolated database, Skill Space and worker, then deploy the agent",readiness:"Verify gateway and agent readiness before adding the agent to the list",checking:"Checking creation configuration…",configured:"Creation configuration is ready. Submission checks cloud resources and starts provisioning.",notConfigured:"Creation prerequisites are not configured. Ask an administrator to configure them, then retry.",loadFailed:"Could not check creation configuration. Please retry.",reload:"Check again",submit:"Start creation",retry:"Retry creation",newAgent:"Create another agent",newAgentDescription:"Create another agent opens an editable new request and replaces this recovery draft. It does not cancel the old task. If the old task is still running, wait for it to finish before submitting.",close:"Close",cancel:"Cancel creation",confirmCancel:"Confirm cancellation",cancelDescription:"Cancellation stops subsequent steps. Created databases, Skill Spaces, gateways and other registered resources are retained. Retry using the same agent ID.",background:"Creation continues after closing this window. Open it again to view progress.",pollFailed:"Progress is temporarily unavailable. Reconnecting; avoid creating another agent.",creationFailed:"This step failed. Check its resources, server configuration and permissions, then retry the same agent ID.",cancelFailed:"Cancellation failed. Check the current progress and retry.",cancelled:"Creation cancelled. Registered resources are retained for retry.",timeout:"Creation timed out. Registered resources are retained. Inspect them before retrying.",interrupted:"Creation was interrupted. Retry the same agent ID to recover registered resources.",skillSpace:"Skill Space",states:{running:"Creating",cancelling:"Cancelling",succeeded:"Created",failed:"Creation failed",cancelled:"Cancelled"},stages:{queued:"Queued",checking:"Checking account and configuration",network:"Preparing VPC and subnets",gateway:"Preparing APIG and IM Gateway",database:"Preparing business database",skills:"Preparing Skill Space",worker:"Preparing worker",deploying:"Preparing database, skills and Runtime",verifying:"Waiting for agent readiness",admin_workspace:"Prepare management PG Workspace",business_workspace:"Prepare business PG Workspace",admin_database:"Initialize shared management database"},back:"Keep creating",pgAutoDescription:"VeADK uses its deployment account to create or reuse two PG Workspaces. mpa_admin_workspace / mpa_admin_db stores shared resource records; the business Workspace hosts an independent database for each agent. No PG connection input is needed. Preparation starts after submission.",pgModeChanged:"This submitted task uses previous PG settings and cannot be retried in automatic mode. Ask an administrator to reconcile its resources and task before starting a new creation.",pgMigrationRequired:"An existing shared registry is configured. Migrate its resource records to mpa_admin_workspace / mpa_admin_db and coordinate the registry URL cutover for existing Runtimes, then recheck this configuration."}},Lze={library:"Skill library",skill:"Skill",skills:"Skills",skillSpace:"Skill space",sandboxNotConfigured:"Dev Sandbox is not configured by an administrator",adminNotConfigured:"Not configured by an administrator",totalItems:"{{count}} items",cannotLoadSpaces:"Unable to load Skill spaces",someSpacesFailed:"Some Skill spaces failed to load",degradedRelationWarning:"Some relations are invalid. Readable skills have been restored.",downloadZip:"Download ZIP",optimize:"Optimize",closeSkillDetails:"Close Skill details",skillId:"Skill ID",allFiles:"All files",loadingSkillContent:"Loading Skill content…",noSkillContent:"This Skill has no SKILL.md content",addSkill:"Add Skill",localUpload:"Upload locally",localUploadDescription:"Select a ZIP file and upload it to the Skill space after validation",autoCreate:"Create automatically",autoCreateDescription:"Choose a model and style, then create a Skill through conversation",createSkill:"Create Skill",optimizeNamed:"Optimize {{name}}",deleteSkillConfirm:"Delete the entire Skill “{{name}}”? This affects every space that references it.",deleteSpaceConfirm:"Delete Skill space “{{name}}”? Make sure its Skills have been deleted first.",manageSpaceDescription:"Manage Skills in this space and create new versions",backToSpaces:"Back to Skill spaces",overview:"Overview",skillCount:"Skills",skillCountValue_one:"{{count}} Skill",skillCountValue_other:"{{count}} Skills",updatedAt:"Updated",skillsInSpace:"Skills in {{name}}",searchSkills:"Search Skills",cannotLoadSkills:"Unable to load Skills",noMatchingSkills:"No matching Skills",noSkills:"No Skills",tryAnotherName:"Try searching for another name",emptySkillsDescription:"Upload a Skill locally or create one automatically",actions:"Actions",spaceDetails:"Skill space details",editSpace:"Edit space",deleteSpace:"Delete space",searchSpaces:"Search Skill spaces",spaceList:"Skill space list",noMatchingSpaces:"No matching Skill spaces",createSpace:"Create Skill space",newSpace:"New space",loadingMoreSpaces:"Loading more Skill spaces",scrollForMore:"Scroll down to load more",allSpacesLoaded:"All Skill spaces loaded",errors:{loadSpaces:"Unable to load Skill spaces. Try again later.",loadSkills:"Unable to load Skills. Try again later.",loadSkillDetails:"Unable to load Skill details. Try again later.",deleteSkill:"Unable to delete the Skill",deleteSpace:"Unable to delete the Skill space",downloadSkill:"Unable to download the Skill"},status:{active:"Available",available:"Available",creating:"Creating",disabled:"Disabled",enabled:"Enabled",failed:"Error",inactive:"Inactive",pending:"Pending",published:"Published",ready:"Ready",released:"Published",running:"Running",success:"Healthy",unavailable:"Unavailable",unreleased:"Unreleased",updating:"Updating",unknown:"Unknown"},sharedSpace:"Enterprise shared space",sharedDescription:"Skills available to everyone, published and maintained by administrators",sharedVisibility:"Everyone",sharedPreparing:"Preparing shared space",sharedLoadFailed:"Shared space unavailable",sharedEmpty:"No shared skills yet. Skills published by administrators will appear here",requestPublication:"Request publication",reviewSubmitting:"Submitting…",reviewSubmitted:"Submitted",reviewFailed:"Could not submit the publication request",reviewStatusFailed:"Failed to load review status",reviewRetry:"Apply again",reviewPending:"Pending review",reviewApproving:"Publishing",reviewApproved:"Shared",reviewReturned:"Returned",reviewHistory:"Review history",skillDetailSections:"Skill detail sections",versions:{title:"Version management",refresh:"Refresh",uploading:"Uploading…",upload:"Upload new version",close:"Close",hint:"New versions become public after approval and do not replace published versions; the skill name in the ZIP must match the original",loading:"Loading versions…",loadFailed:"Unable to load versions",filesFailed:"Unable to load version files",uploadFailed:"Unable to upload the new version",submitFailed:"Unable to submit for review",retry:"Retry",empty:"No versions yet",current:"Current version",notSubmitted:"Not submitted",submitting:"Submitting…",submit:"Request publication",processing:"Version status: {{status}}",filesLoading:"Loading files…",filesEmpty:"No files",history:"Review history",shared:"Published"},author:"Author",authorName:"Author: {{name}}"},Mze={library:"Knowledge bases",createBase:"New knowledge base",editBase:"Edit knowledge base",invalidName:"The name must start with a letter and contain only letters, numbers, and underscores.",nameHelp:"Start with a letter. Use up to 48 letters, numbers, or underscores.",optionalDescription:"Description (optional)",descriptionOnly:"AgentKit currently supports updating only the knowledge base description.",previewWeb:"Preview web content",addData:"Add data",openOriginalWeb:"Open original page",backToEdit:"Back to edit",confirmAdd:"Confirm and add",source:"Knowledge source",image:"Image",documentFile:"Document file",webPage:"Web page",webUrl:"Web page URL",generatingWebPreview:"Fetching the page and generating a Markdown preview",selectFile:"Select knowledge file",selectOrDropFile:"Select a file or drag it here",selectedFile:"{{size}} · Click to select another file",imageFileHelp:"PNG, JPG, and JPEG up to 200 MB",documentFileHelp:"PDF, PPTX, DOCX, XLSX, and TXT up to 200 MB",uploadingFile:"Uploading the file and adding it to the knowledge base",optionalName:"Name (optional)",optionalType:"Type (optional)",generatePreview:"Generate preview",uploadFile:"Upload file",editMetadata:"Edit knowledge metadata",knowledge:"Knowledge item",field:"Field",value:"Value",backToList:"Back to knowledge bases",metadataJson:"Metadata (JSON)",provider:"Provider",knowledgeId:"Knowledge ID",project:"Project",creator:"Created by",data:"Data",deleteInvalidAssociation:"Delete invalid association",noData:"This knowledge base has no data",addFirstData:"Add the first data item",format:"Format",size:"Size",searchData:"Search data",searchLibraryData:"Search knowledge base data",associationInvalid:"Association invalid",providerMissing:"The underlying Provider knowledge base no longer exists",noMatchingData:"No matching data",loadingMoreData:"Loading more data",retryLoading:"Retry loading",details:"Knowledge base details",searchBases:"Search knowledge bases",someBasesFailed:"Some knowledge bases are temporarily unavailable. Other available content is shown.",noMatchingBases:"No matching knowledge bases",noManagePermission:"You do not have permission to manage this knowledge base",loadingMoreBases:"Loading more knowledge bases",deleteBaseTitle:"Delete knowledge base?",deleteBaseDescription:"This removes the AgentKit association for {{name}}. If Studio created it, the Provider resource is also deleted. This cannot be undone.",deleteDocumentTitle:"Delete knowledge item?",deleteDocumentDescription:"This removes {{name}} from the Provider knowledge base. This cannot be undone.",preview:{processingTitle:"Data is being processed",processingDetail:"A preview will be available after parsing. Reload later.",failedTitle:"Data parsing failed",failedDetail:"Check the source file or page URL and add it again, or reload the latest status.",noParsedTitle:"No parsed content is available yet",noParsedDetail:"Text, tables, or page images will appear after the knowledge base finishes parsing this file.",noMediaTitle:"No media preview is available yet",noMediaDetail:"The knowledge base has not returned an accessible media preview. Reload later.",noDataTitle:"No data is available to preview",noDataDetail:"The knowledge base has not returned parsed results. Reload later.",attachmentError:"The attachment cannot be previewed. Try again later.",imageAlt:"Knowledge data image",audioUnsupported:"This browser does not support audio previews.",videoUnsupported:"This browser does not support video previews.",namedPdf:"{{name}} PDF preview",pdf:"PDF preview",openPdf:"If it cannot be displayed, open the PDF in a new window",fileUnsupported:"This format cannot be previewed directly online. Parsed content is shown when available.",openOriginalFile:"Open original file",loading:"Loading data preview",openOriginalHint:"You can open the original page to view the source content.",chunk:"Chunk {{index}}",loadingMore:"Loading more",loadMore:"Load more"},errors:{fileTooLarge:"A file cannot exceed 200 MB",invalidImageType:"Select a PNG, JPG, or JPEG image",invalidDocumentType:"Select a PDF, PPTX, DOCX, XLSX, or TXT file",createBase:"Unable to create the knowledge base",updateBase:"Unable to update the knowledge base",metadataObject:"Metadata must be a JSON object",metadataFormat:"Invalid metadata format",noWebPreview:"The page has no Markdown content to preview",addWeb:"Unable to add the web page",previewWeb:"Unable to generate the web page preview",uploadFile:"Unable to upload the file",updateDocument:"Unable to update the knowledge item",loadPreview:"Unable to load the data preview",loadMoreBases:"Unable to load more knowledge bases",loadBases:"Unable to load knowledge bases",loadMoreData:"Unable to load more data",loadData:"Unable to load data",deleteBase:"Unable to delete the knowledge base",deleteDocument:"Unable to delete the knowledge item"}},Ize={title:"Feishu channel",refresh:"Refresh",loading:"Loading channel configuration…",unsupported:"This Runtime does not support channel management. Upgrade its MPA image.",unauthorized:"Channel management requires a Studio administrator and an authorized Runtime credential.",configurationError:"Channel management configuration is incomplete. Check the Runtime metadata and encryption key.",requestFailed:"Channel request failed. Check the Runtime connection and retry.",bound:"Bound: {{name}}",unbound:"No Feishu bot is bound.",guidance:"Private chats use separate conversations. In allowed groups, mention this bot to start a conversation.",keyRequired:"Configure a persistent CHANNEL_STATE_ENCRYPTION_KEY in the Runtime before binding.",gateway:"Message gateway",route:"Inbound route",delivery:"Reply delivery",configured:"Configured",missing:"Missing",delivery_not_observed:"Not observed",delivery_delivered:"Delivered",delivery_retrying:"Retrying",missingConfig:"Missing Runtime configuration: {{fields}}",bind:"Bind with QR code",newQr:"Generate a new QR code",unbind:"Unbind",confirmUnbind:"Disconnect this bot? It will stop receiving new messages.",qrAlt:"Bot authorization QR code",openQr:"Open authorization page",uncertain:"Registration was interrupted. Check the bot binding and Gateway before starting again.",bindingFailed:"Binding failed. Check Gateway configuration and retry.",chatId:"Allowed group ID",scope:"Group conversation scope",saveGroup:"Save group",noGroups:"No groups allowed yet. Private chats do not need this permission.",edit:"Edit",remove:"Remove",removeGroup:"Remove {{name}}",scope_group_sender:"Separate by sender",scope_group:"Shared by group",scope_group_topic_sender:"Separate by topic and sender",scope_group_topic:"Shared by topic",status_PENDING:"Waiting for scan",status_SCANNED:"Scanned; waiting for authorization",status_AUTHORIZED:"Authorized; preparing registration",status_REGISTERING:"Registering bot",status_BOUND:"Bot bound",status_FAILED:"Binding failed",status_EXPIRED:"QR code expired",workspaceTitle:"Message channels",workspaceDescription:"Connect messaging apps to this Agent and manage access.",provider_feishu:"Feishu",provider_wecom:"WeCom",provider_dingtalk:"DingTalk",comingSoon:"Not available yet",unavailableDescription:"Binding and message settings for {{name}} are not available yet.",runtimeRequired:"Deploy this Agent to a Runtime before configuring message channels.",bindingTitle:"Bot connection",connected:"Bound",notBound:"Not bound",gatewayDescription:"Gateway configuration for receiving channel messages.",routeDescription:"Routing configuration for delivering messages to this Agent.",deliveryDescription:"Observed reply delivery; configuration alone does not confirm delivery.",groupsTitle:"Group access",groupsDescription:"Allow specific groups and choose how conversations are shared.",providerBindingTitle:"Connect {{name}}",providerUnbound:"Connect a {{name}} bot to let users message this agent.",qrGuidance:"Authorize with {{name}}. The Runtime saves the bot credentials and configures the message gateway.",wecomGuidance:"Authorize with WeCom QR code, or enter a Bot ID and Secret to bind an existing bot.",wecomBotId:"Bot ID",wecomSecret:"Secret",bindCredentials:"Connect bot",wecomScan:"Bind with QR code",wecomAuthorizing:"Waiting for WeCom authorization…",cancelAuthorization:"Cancel authorization",wecomPopupBlocked:"Allow popups in your browser, then try authorizing again.",wecomAuthCancelled:"WeCom authorization was cancelled. You can scan again.",wecomAuthTimeout:"WeCom authorization timed out. Please scan again.",wecomInvalidResult:"Authorization did not return a Bot ID and Secret. Authorize again or enter them manually.",wecomAuthFailed:"WeCom authorization failed. Try again or enter credentials manually.",dingtalkClientId:"Client ID",dingtalkClientSecret:"Client Secret",manualUpgrade:"Upgrade this Runtime image to configure {{name}} manually. Quick setup is still available.",pairingTitle:"Message channel QR pairing",feishuPairingDescription:"If a bot is already connected, it will be replaced after successful Feishu authorization and binding. In the authorization flow, you can bind an existing bot or create a new one.",generatingQr:"Generating pairing QR code…",dingtalkGuidance:"Authorize with DingTalk QR code, or enter a Client ID and Client Secret to bind an existing bot.",wecomPairingDescription:"Pair again in the WeCom authorization window. The new bot replaces the current connection after binding succeeds. Cancelling authorization or a failed binding does not disconnect the existing bot.",configurationMethod:"Configuration method",quickSetup:"Quick setup",manualSetup:"Manual setup",feishuAppId:"App ID",feishuAppSecret:"App Secret",manualGuidance:"Enter the credentials of an existing {{name}} bot to connect it to this agent.",manualReplacement:"Successful binding replaces the current bot. Cancelling or a failed binding does not disconnect the existing bot."},gdr=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:fze,agentSelector:Rze,agentWorkspace:gze,channels:Ize,cloudEnvironment:xze,common:hze,composer:_ze,default:{common:hze,agentKitPromo:fze,systemInfo:pze,agentWorkspace:gze,environmentCenter:mze,deploymentSelect:vze,deploymentError:yze,studioBuildProgress:bze,cloudEnvironment:xze,githubCicd:wze,feishuDeployment:Aze,deploymentResources:Sze,studioUpdate:Tze,projectPreview:Cze,workspace:kze,resourceCollection:Oze,skillSourcePicker:Eze,composer:_ze,agentSelector:Rze,myAgents:Dze,skillCenter:Lze,knowledge:Mze,channels:Ize},deploymentError:yze,deploymentResources:Sze,deploymentSelect:vze,environmentCenter:mze,feishuDeployment:Aze,githubCicd:wze,knowledge:Mze,myAgents:Dze,projectPreview:Cze,resourceCollection:Oze,skillCenter:Lze,skillSourcePicker:Eze,studioBuildProgress:bze,studioUpdate:Tze,systemInfo:pze,workspace:kze},Symbol.toStringTag,{value:"Module"})),Pze="User management",Nze="{{count}} members",Bze="User",$ze="Role",Fze="Account status",zze="Last sign-in",Uze="Actions",Vze="Change role",Gze="Close",Qze="Save role",Hze="Saving…",Wze="Cancel",Yze="Back",qze="User pool",jze="Volcengine Identity",Xze="Search name, email or user ID",Kze="Search",Zze="Filter by role",Jze="All roles",eUe="Refresh",tUe="Loading users…",rUe="Updated at {{time}}",nUe="{{name}} is now {{role}}",iUe="Retry",aUe="You",oUe="Initial super administrator",sUe="The initial super administrator cannot be demoted here",lUe="The new permissions apply when the user refreshes Studio",cUe="Role needs confirmation",uUe="No matching users",dUe="Try another search or role",hUe="Users appear here after signing in or joining this user pool",fUe="{{count}} users",pUe="Previous",gUe="Next",mUe="Not signed in yet",vUe="Not provided",yUe={super_admin:"Super administrator",admin:"Administrator",developer:"Developer",user:"User"},bUe={super_admin:"Manage all resources, users and role assignments",admin:"Manage Studio resources",developer:"Develop agents and manage your own resources",user:"Use agents and personal features"},xUe={EXTERNAL_PROVIDER:"Active",CONFIRMED:"Active",NORMAL:"Active",ENABLED:"Active",ACTIVE:"Active",UNCONFIRMED:"Unverified",DISABLED:"Disabled",FORBIDDEN:"Disabled",LOCKED:"Locked",SUSPENDED:"Suspended",FORCE_CHANGE_PASSWORD:"Password change required"},wUe={request_failed:"The request did not finish. Refresh the list to confirm its current state before retrying",invalid_response:"The user service returned an invalid response. Refresh and try again",identity_unavailable:"Identity is unavailable. Try again later or check service permissions",identity_resource_missing:"The user or user pool no longer exists. Refresh the list",super_administrator_required:"Only super administrators can manage users",sign_in_required:"Sign in and try again",user_not_in_pool:"Your account does not belong to this user pool",user_disabled:"Your account is disabled",protected_administrator:"The initial super administrator cannot be demoted",cannot_demote_self:"You cannot demote your own super administrator role",role_change_conflict:"The role has changed. Close this dialog and refresh the list before retrying",cross_origin_request:"Change roles from the current Studio page"},mdr=Object.freeze(Object.defineProperty({__proto__:null,actions:Uze,allRoles:Jze,back:Yze,cancel:Wze,changeRole:Vze,close:Gze,default:{title:Pze,memberCount:Nze,user:Bze,role:$ze,status:Fze,lastLogin:zze,actions:Uze,changeRole:Vze,close:Gze,save:Qze,saving:Hze,cancel:Wze,back:Yze,pool:qze,volcengineIdentity:jze,searchPlaceholder:Xze,search:Kze,filterRole:Zze,allRoles:Jze,refresh:eUe,loading:tUe,updatedAt:rUe,saved:nUe,retry:iUe,you:aUe,initialAdministrator:oUe,protectedExplanation:sUe,effectiveAfterRefresh:lUe,roleConflict:cUe,noUsers:uUe,tryAnotherSearch:dUe,poolEmpty:hUe,resultCount:fUe,previous:pUe,next:gUe,neverLoggedIn:mUe,unknown:vUe,roles:yUe,descriptions:bUe,states:xUe,errors:wUe},descriptions:bUe,effectiveAfterRefresh:lUe,errors:wUe,filterRole:Zze,initialAdministrator:oUe,lastLogin:zze,loading:tUe,memberCount:Nze,neverLoggedIn:mUe,next:gUe,noUsers:uUe,pool:qze,poolEmpty:hUe,previous:pUe,protectedExplanation:sUe,refresh:eUe,resultCount:fUe,retry:iUe,role:$ze,roleConflict:cUe,roles:yUe,save:Qze,saved:nUe,saving:Hze,search:Kze,searchPlaceholder:Xze,states:xUe,status:Fze,title:Pze,tryAnotherSearch:dUe,unknown:vUe,updatedAt:rUe,user:Bze,volcengineIdentity:jze,you:aUe},Symbol.toStringTag,{value:"Module"})),AUe="Website integration",SUe="Embed an AgentKit Runtime on your website as a floating chat window",TUe="Back to automations",CUe="Add website",kUe="Loading Runtime",OUe="Select Runtime",EUe="Website domain",_Ue="For example, xxxx.com or localhost:5173",RUe="Generating",DUe="Generate token",LUe="Added websites",MUe="{{count}} website",IUe="{{count}} websites",PUe="Loading website integrations",NUe="No website integrations yet",BUe="Select a Runtime and enter a website domain to generate a token",$Ue="Embed instructions",FUe="Place this code before the closing body tag on your website",zUe="Copied",UUe="Copy code",VUe="Embed code will appear here after you add a website.",GUe="Delete the website integration for {{domain}}?",QUe={load:"Failed to load website integrations",create:"Failed to create website integration",delete:"Failed to delete website integration",noConversationalAgent:"No conversational Agent was found in this Runtime"},HUe={requestFailed:"Request failed ({{status}})",greeting:"Hello. How can I help?",sessionFailed:"Could not start a chat session",unauthorized:"This website is not authorized to start a chat",conversationFailed:"The chat request failed. Try again shortly.",open:"Open Agent chat",close:"Close Agent chat",panelLabel:"Agent chat panel",assistant:"Agent assistant",online:"Online"},vdr=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:CUe,addedWebsites:LUe,backToAutomations:TUe,confirmDelete:GUe,copied:zUe,copyCode:UUe,default:{title:AUe,description:SUe,backToAutomations:TUe,addWebsite:CUe,loadingRuntime:kUe,selectRuntime:OUe,websiteDomain:EUe,domainPlaceholder:_Ue,generating:RUe,generateToken:DUe,addedWebsites:LUe,websiteCount_one:MUe,websiteCount_other:IUe,loadingIntegrations:PUe,delete:"Delete",emptyTitle:NUe,emptyDescription:BUe,embedMethod:$Ue,embedInstructions:FUe,copied:zUe,copyCode:UUe,embedHint:VUe,confirmDelete:GUe,errors:QUe,widget:HUe},description:SUe,domainPlaceholder:_Ue,embedHint:VUe,embedInstructions:FUe,embedMethod:$Ue,emptyDescription:BUe,emptyTitle:NUe,errors:QUe,generateToken:DUe,generating:RUe,loadingIntegrations:PUe,loadingRuntime:kUe,selectRuntime:OUe,title:AUe,websiteCount_one:MUe,websiteCount_other:IUe,websiteDomain:EUe,widget:HUe},Symbol.toStringTag,{value:"Module"})),WUe={types:{all:"All types",document:"Documents",image:"Images",video:"Videos"},previewArtifact:"Preview {{name}}",moreActions:"More actions for {{name}}",actionMenu:"Actions for {{name}}",download:"Download",downloading:"Downloading",edit:"Edit details",delete:"Delete artifact",previewFailed:"Could not preview “{{name}}”: {{message}}",downloadStarted:"Download started for {{name}}",downloadFailed:"Could not download “{{name}}”: {{message}}",updated:"Updated {{name}}",deleted:"Deleted {{name}}",deleteFailed:"Could not delete “{{name}}”: {{message}}",typeFilter:"Artifact type",searchAria:"Search artifacts",searchPlaceholder:"Search artifacts or sessions",retry:"Retry",close:"Close",listAria:"Artifact list",loadFailed:"Could not load artifacts",loadDetailFallback:"Check the storage configuration and try again.",reload:"Reload",noMatch:"No matching artifacts",noArtifacts:"You do not have any artifacts yet",searchHint:"Try another search or artifact type",emptyHint:"Artifacts created in chats will appear here automatically",columns:{name:"Name",source:"Source",updatedAt:"Modified",actions:"Actions"},loadingMore:"Loading more artifacts",unknownTime:"Unknown time",preview:{close:"Close preview",meta:"{{type}} / Version {{version}}",loading:"Loading preview",alt:"Preview of {{name}}",loadFailed:"The preview could not be loaded. Try again later or download the file.",unsupported:"This format cannot be previewed online. Download the file to view it.",sourceAria:"Artifact source",agent:"Agent",session:"Session",tool:"Generated by",createdAt:"Created",fileSize:"File size",tags:"Tags",viewSession:"View session"},deleteDialog:{title:"Delete artifact?",description:"“{{name}}” will be permanently removed from the artifact library. The chat history will not be affected.",deleting:"Deleting",confirm:"Delete",close:"Close delete confirmation"},api:{withStatus:"{{message}} ({{status}})",listFailed:"Could not load the artifact library",syncFailed:"Could not sync chat artifacts",updateFailed:"Could not update the artifact",deleteFailed:"Could not delete the artifact",downloadFailed:"Could not download the artifact"}},YUe={unknownSource:"Unknown source",unknownCreator:"Unknown creator"},qUe={nameRequired:"Enter an artifact name",tooManyTags:"You can add up to {{max}} tags",tagTooLong:"Each tag can contain up to {{max}} characters",title:"Edit artifact details",subtitle:"The content file will not be modified",close:"Close edit dialog",name:"Name",description:"Description",descriptionPlaceholder:"Add its purpose, version, or usage notes",tags:"Tags",tagsPlaceholder:"Separate tags with commas, up to {{max}}",cancel:"Cancel",saving:"Saving",save:"Save"},jUe={change:{added:"Added",modified:"Modified",deleted:"Deleted"},noChanges:"There are no source changes between these versions",chooseFile:"Select a file on the left to view its code",compareTitle:"Compare versions",workspaceTitle:"Source workspace",projectFallback:"Agent project",switchTheme:"Switch source theme",switchThemeTitle:"Switch to {{theme}} theme",themes:{dark:"dark",light:"light"},closeWorkspace:"Close source workspace",close:"Close",changedFiles:"Changed files",projectFiles:"Project files",changes:"Changes",files:"Files",openFiles:"Open files",noFileSelected:"No file selected",comparisonDirection:"Comparison direction",before:"Before optimization",after:"After optimization",loadingEditor:"Loading editor…",changedFileCount_one:"{{count}} file changed",changedFileCount_other:"{{count}} files changed",fileCount_one:"{{count}} file",fileCount_other:"{{count}} files",lineCount_one:"{{count}} line · UTF-8",lineCount_other:"{{count}} lines · UTF-8",viewSource:"View source",viewSourceAria:"View and edit project source"},XUe={nav:"Search",selectAgent:"Select an Agent",checkingCapabilities:"Checking Agent capabilities",notMounted:"This Agent does not have {{label}} mounted",sources:{session:"Sessions",web:"Web",knowledge:"Knowledge base",memory:"Long-term memory"},webDescription:"Search with the web_search tool",backendLocal:"Local",failed:"Search failed: {{message}}",placeholder:{selectAgent:"Select an Agent first",web:"Search the web",knowledge:"Search {{name}}",knowledgeFallback:"this Agent's knowledge base",memory:"Search {{name}}",memoryFallback:"this user's long-term memory",session:"Search this Agent's sessions"},sourceTypeAria:"Search source: {{label}}",notSelected:"Not selected",sourceType:"Search source",selectSource:"Select a search source",noAgentHint:"Select an Agent to search its sessions, the web, and mounted data sources.",loadingCapabilities:"Loading this Agent's search capabilities…",sourceUnavailable:"This Agent does not have this data source mounted",instructions:{web:"Enter keywords and press Enter or select the button to search with web_search.",knowledge:"Enter a question to search this Agent's knowledge base.",memory:"Enter a clue to search long-term memories saved across this user's sessions.",session:"Enter keywords and press Enter or select the button to search this Agent's sessions."},noResults:"No results found for “{{query}}”.",knowledgeFragment:"Knowledge excerpt {{index}}",memoryFragment:"Memory excerpt {{index}}"},KUe={title:"Developer Resources",sections:{documentation:{title:"Related links",description:"Open development documentation and common AgentKit destinations"},bestPractices:{title:"Best practices",description:"Learn from practical development, debugging, and deployment guidance"},showcases:{title:"Showcases",description:"Explore applications built with AgentKit"}},links:{veadkDocs:"VeADK documentation",cliDocs:"AgentKit CLI documentation",platformDocs:"AgentKit platform documentation",console:"AgentKit console"},articles:{veadkDevelopment:{title:"Develop and deploy an Agent with VeADK",description:"Build an Agent with VeADK and deploy it to AgentKit Runtime."},cliDevelopment:{title:"Develop and deploy an Agent with AgentKit CLI",description:"Create a project, debug an Agent, and deploy it with AgentKit CLI."},coverAlt:"Cover image for {{title}}"},showcases:{researchAssistant:{title:"Multi-agent research assistant",description:"Specialized Agents work together to research, analyze, and summarize findings."},multimodalAnalysis:{title:"Multimodal content analysis",description:"Understand images, documents, and video in a single session."},customerService:{title:"Customer service workspace",description:"Combine knowledge retrieval and tool calls to handle complex support requests."},webSearch:{title:"Web search Agent",description:"Search current web content and organize it into traceable answers."},a2uiApp:{title:"A2UI interactive app",description:"Let an Agent generate interactive interfaces as it works through a task."},previewAlt:"Interface preview for {{title}}"}},ZUe={title:"Library",untitledSession:"Untitled session",categoryAria:"Library categories",regionAria:"Region",tabs:{skills:"Skills",knowledge:"Knowledge",artifacts:"Artifacts"}},JUe={title:"Manage Agents",subtitle:"Agents in AgentKit Runtime that you can manage",mainAgentOnly:"Only the main Agent is shown (control-plane information).",deleteConfirm:'Delete Agent "{{name}}"? Its Runtime will be permanently deleted.',regionFilterTitle:"Filter by region",regionFilterAria:"Region filter",regionAria:"Region",refresh:"Refresh",loading:"Loading…",empty:"You have not deployed any Agents.",connected:"Connected",connect:"Connect to this Agent",deleteRuntime:"Delete this Runtime",loadingDetail:"Loading details…",agentStructure:"Agent structure",secretHidden:"Sensitive value is never shown. Copy it with an authorized request.",revealSecret:"Sensitive value for {{key}}",copySecret:"Copy the value of {{key}}",copy:"Copy",copied:"Copied",copyFailed:"Copy failed",notConfigured:"Not configured",fields:{model:"Model",description:"Description",status:"Status details",project:"Project",version:"Version",resources:"Resources",memory:"Memory",tool:"Tool",knowledge:"Knowledge",mcpToolset:"MCP Toolset",updatedAt:"Updated"},resource:{memory:"Memory {{value}} MB",instances:"Instances {{min}}-{{max}}",concurrency:"Concurrency {{value}}"},environmentVariables:"Environment variables",unnamed:"(Unnamed)"},eVe={mainAgent:"Main Agent",subAgent:"Sub-agent {{index}}",itemCount_one:"{{count}} item",itemCount_other:"{{count}} items",info:"Agent information",infoAndTopology:"Agent information and settings",loadingInfo:"Loading Agent information…",unnamedAgent:"Unnamed Agent",agentsMd:"AGENTS.md",tools:"Tools",toolList:"Tool list",studioTool:"Studio Tool",removeTool:"Remove tool {{name}}",remove:"Remove",notConfigured:"Not configured",addStudioTool:"Add Studio tools",addStudioToolHere:"Add Studio tools to this chat",skills:"Skills",skillList:"Skill list",addSkill:"Add Skill Space skills",addSkillHere:"Add Skill Space skills to this Session",skillMountNextTurn:"Mounted versions are frozen when the next Turn starts.",previewUnsupported:"Preview is not supported",sessionEnvironment:"Session environment",environment:"Environment",agentCanvas:"Agent canvas",topology:"Structure",nodeKinds:{agent:"Agent",sandbox:"Sandbox","worker-session":"Worker Session","skill-space":"Skill Space",skill:"Skill","studio-tool":"Studio Tool",mcp:"MCP",environment:"Environment",knowledge:"Knowledge","sub-agent":"Sub-agent"},nodeStatuses:{configured:"Configured",mounted:"Mounted",running:"Running",paused:"Paused"},viewCanvasFullscreen:"View Agent canvas in full screen",viewFullscreen:"View full screen",executionCanvas:"Agent execution canvas",fullscreenExecutionCanvas:"Full-screen Agent execution canvas",closeFullscreenCanvas:"Close full-screen canvas",close:"Close",capabilitiesSubtitle:"Capabilities and collaboration topology",closeInfo:"Close Agent information",infoUnavailable:"Agent information is temporarily unavailable.",refresh:"Refresh information",loadingSkills:"Loading bound skills…",sessionSkills:"Temporary session skills",noBoundSpace:"This agent has no bound Skill Space.",noBoundSkills:"The bound Skill Space has no skills.",loadFailed:"Could not load this information. Refresh to retry.",accessDenied:"You do not have permission to read this information.",documentUnsupported:"Upgrade the Runtime image to enable Studio to read AGENTS.md.",skillsUnsupported:"This Runtime does not provide Skill Space bindings.",skillsDegraded:"Skill information is incomplete. Refresh to retry.",documentEditHint:"Edit the latest version. Saving publishes a new version to this Skill Space and can affect other agents using it. Running sessions may need a cache refresh or a new session. Keep the frontmatter name unchanged.",documentLoading:"Loading SKILL.md…",documentWritable:"Editable",documentReadOnly:"Read only — this space or your permissions do not allow editing",documentLoadFailed:"Could not load SKILL.md. Refresh to retry.",documentSaveFailed:"Save was not confirmed. Your edits are preserved. Reopen to check the current version before retrying.",documentConflict:"A newer version exists. Copy your edits, then reopen the editor to avoid overwriting it.",discardDocument:"Discard unsaved changes?",keepEditing:"Keep editing",discardChanges:"Discard changes",saveDocument:"Save new version"},tVe={mountFailed:"Could not mount the environment",closeDialog:"Close environment dialog",addTitle:"Add environments",description:"Choose the Sandbox environments this Agent can use in the current session",closeAdd:"Close Add environments",searchAria:"Search environments",searchPlaceholder:"Search environment names or capabilities",availableAria:"Available environments and workspaces",loading:"Loading available environments…",noMatch:"No matching environments or workspaces",workspaces:"Workspaces",reuseAll:"Use every available environment in this workspace",availableEnvironmentCount_one:"{{count}} available environment",availableEnvironmentCount_other:"{{count}} available environments",selectWorkspace:"Select workspace {{name}}",environments:"Environments",includedByWorkspaces:"Included by workspace {{names}}",nameSeparator:", ",selectEnvironment:"Select environment {{name}}",selectedWorkspaceCount_one:"{{count}} workspace selected",selectedWorkspaceCount_other:"{{count}} workspaces selected",coveredEnvironmentCount_one:"{{count}} environment covered",coveredEnvironmentCount_other:"{{count}} environments covered",selectionSummary:"{{workspaces}}, {{environments}}",cancel:"Cancel",mounting:"Mounting…",confirm:"Add selected",mountedAria:"Mounted environments",environmentCount_one:"{{count}} environment",environmentCount_other:"{{count}} environments",removeWorkspace:"Remove workspace {{name}}",remove:"Remove",removeEnvironment:"Remove environment {{name}}",add:"Add environments",addMore:"Add more environments",addForSession:"Add environments to this session",loadingAvailable:"Loading available environments…",empty:"No AIO Sandbox environments are available."},rVe={loading:{searching:"Looking for an existing environment",creating:"Initializing environment",connecting:"Connecting to the environment"},initializationFailed:"AgentKit CLI environment initialization failed. Current status: {{status}}.",sessionExpired:"The AgentKit CLI session does not exist or has expired. Try again.",initializationTimeout:"AgentKit CLI environment initialization timed out. Try again later.",nonPersistent:"Non-persistent environment",recyclingHoursMinutes:"Environment reclaimed in {{hours}} hr {{minutes}} min",recyclingMinutes:"Environment reclaimed in {{minutes}} min",connectionError:`Could not connect to the Studio service because the server did not respond. +{{value}}`,original:"Original error: {{message}}",details:"Details"},lze={ariaLabel:"Skill file tree",viewSource:"View source",viewPreview:"View preview",download:"Download",binaryFile:"Binary file",bytes:"{{value}} bytes",binaryDescription:"The current API returns file metadata only. Download the original file separately.",metadata:"Skill metadata",noFiles:"No files"},cze={close:"Close",name:"Name",region:"Region",optionalDescription:"Description (optional)",cancel:"Cancel",create:"Create",creating:"Creating…",save:"Save",saving:"Saving…",upload:"Upload",uploading:"Uploading…",createSpaceTitle:"New Skill Space",editSpaceTitle:"Edit Skill Space",uploadTitle:"Upload to {{name}}",createSpaceFailed:"Failed to create the Skill Space",updateSpaceFailed:"Failed to update the Skill Space",archiveValidationFailed:"Skill ZIP validation failed",uploadFailed:"Failed to upload the Skill",dropzone:"Drop a Skill ZIP here",chooseLocalFile:"or click to choose a local file",archiveHelp:"The ZIP root must contain SKILL.md, or a single wrapping directory. Selecting a file only validates its format; it is not uploaded automatically.",validating:"Checking file format…",validationPassed:"Format check passed: {{name}}, {{count}} file(s)"},uze={styles:{concise:"Concise and practical",strict:"Rigorous and robust",tutorial:"Tutorial-friendly",automation:"Automation-first",custom:"Custom",customFallback:"Custom style"},stages:{preparing:"Preparing Dev Sandbox",ready:"Skill generated and format validation passed",failed:"Generation failed",cancelled:"Stopped",validating:"Validating Skill format",packaging:"Organizing files",generating:"Generating Skill",repairingAgain:"Repairing again",autoRepairing:"Auto-repairing ({{attempt}}/{{max}})"},validation:{fallback:"Skill format validation failed",repairInstruction:"Fix only the Skill format errors listed below. Do not change the original purpose or scope.",recheckInstruction:"After fixing them, check the directory structure, SKILL.md frontmatter, and all text files again.",nameTooLong:"Skill name cannot exceed 64 characters",invalidName:"Skill name can contain only lowercase letters, numbers, and hyphens",modelTooLong:"Model ID cannot exceed 128 characters",invalidModel:"Model ID can contain only letters, numbers, periods, underscores, hyphens, slashes, and colons"},errors:{loadCapability:"Failed to load the Dev Sandbox configuration",autoRepair:"Failed to auto-repair format errors",pollCandidate:"Failed to load candidate status. Retrying.",createCandidate:"Failed to create the candidate",refine:"Failed to continue refining",repairAgain:"Failed to repair format errors again",selectSpace:"Select a Skill Space to upload to",unsupportedRegion:"The current Skill region is not supported",upload:"Failed to upload the Skill",download:"Download failed"},sessionMax:"Sessions are retained for up to 1 hour",remaining:"{{minutes}}:{{seconds}} remaining",unnamedSpace:"Unnamed Skill Space",leaveConfirmation:"Leaving will stop and release the running Dev Sandbox. Leave anyway?",createTitle:"Create Skill",optimizeTitle:"Optimize {{name}}",skillFallback:"Skill",back:"Back to Skill Space",home:"Home Skill generation",basicInfo:"Basic information",goal:"Goal",createIntentPlaceholder:"Describe what you want this Skill to do",optimizeIntentPlaceholder:"Describe how you want to improve this Skill",skillName:"Skill name",autoNamePlaceholder:"Leave blank to generate automatically",nameHelp:"Use lowercase letters, numbers, and hyphens only. Leave blank to generate automatically.",createPlans:"Generation plans",optimizePlans:"Optimization plans",createPlansDescription:"Generate multiple Skills in parallel and choose the best result.",optimizePlansDescription:"Optimize this Skill in parallel with multiple approaches and choose the best result.",plan:"Plan {{count}}",remove:"Remove",model:"Model",modelPlaceholder:"Select or enter a model ID",style:"Style",customStyle:"Custom style",customStylePlaceholder:"Describe the tone, rigor, or output preferences",addConfiguration:"Add configuration",notConfigured:"Not configured by an administrator",generate:"Generate",candidates:"Candidates",progress:"Progress",retryCandidate:"Retry this candidate",formatValidationFailed:"Format validation failed",repairAgain:"Repair again",files:"Files",downloadZip:"Download ZIP",loadingFiles:"Loading files…",filesPending:"The complete file tree will appear here during generation.",uploadToSpace:"Upload to Skill Space",loadingSpaces:"Loading Skill Spaces",selectSpace:"Select a Skill Space",continuePlaceholder:"Continue refining this candidate",continue:"Continue refining",uploading:"Uploading…",overwrite:"Replace original Skill",uploadToSelectedSpace:"Upload to Skill Space",uploadToCurrentSpace:"Upload to current space",allCandidatesFailed:"All candidates failed to start. Retry each candidate separately."},dze={invalidFormat:"{{label}} has an invalid format.",recoveryStatus:"Skill recovery status",errorResponse:"error response",errorDetails:"error details",missingContentType:"Content-Type missing",gatewayError:"{{fallback}} (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",nonJson:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",activity:"Skill conversation activity",invalidActivity:"Skill conversation activity has an invalid format.",invalidToolActivity:"Skill tool activity has an invalid format.",invalidTextActivity:"Skill text activity has an invalid format.",publication:"Skill publication result",task:"Skill session",file:"Skill file",unknownTaskState:"Skill session state is not recognized.",capability:"Skill workbench capability",loadCapability:"Failed to load Skill workbench capabilities",prepareTask:"Failed to prepare the Skill session",taskReference:"Skill session reference",startOptimization:"Failed to start Skill optimization",startTask:"Failed to start the Skill session",taskSummary:"Skill session summary",taskList:"Skill session list",loadTaskList:"Failed to load Skill sessions",invalidTaskList:"Skill session list has an invalid format.",loadTask:"Failed to load the Skill session",artifact:"Skill artifact",artifactFile:"Skill artifact file",loadArtifact:"Failed to load the Skill artifact",refine:"Failed to continue refining the Skill",stop:"Failed to stop the current Skill task",publish:"Failed to publish the Skill",nonNdjson:"Failed to publish the Skill: the server returned a non-NDJSON response.",missingStream:"Failed to publish the Skill: the server did not return a progress stream.",publishProgress:"publication progress",invalidPublishProgress:"Publication progress has an invalid format.",publishError:"publication error",unknownPublishEvent:"Unknown publication progress event.",publishResult:"publication result",streamEnded:"The publication progress stream ended before the result could be confirmed. Refresh Skill Center to check the status.",deleteTask:"Failed to delete the Skill session",download:"Failed to download the Skill"},pdr=Object.freeze(Object.defineProperty({__proto__:null,api:dze,configSelect:aze,conversation:oze,default:{configSelect:aze,conversation:oze,errorDetails:sze,fileTree:lze,management:cze,generation:uze,api:dze},errorDetails:sze,fileTree:lze,generation:uze,management:cze},Symbol.toStringTag,{value:"Module"})),hze={back:"Back",reload:"Reload",notConfigured:"Not configured",name:"Name",description:"Description",delete:"Delete",save:"Save",saving:"Saving",add:"Add",manage:"Manage",environment:"Environment",noDescription:"No description",refresh:"Refresh",close:"Close",retry:"Retry",loading:"Loading…",previousPage:"Previous page",nextPage:"Next page",edit:"Edit",all:"All",search:"Search",cancel:"Cancel",view:"View",viewDetails:"View details",deleting:"Deleting…",create:"Create",creating:"Creating",adding:"Adding",generating:"Generating",uploading:"Uploading",preview:"Preview",loadFailed:"Failed to load",select:"Select",collapse:"Collapse",expand:"Expand",none:"None"},fze={ariaLabel:"AgentKit shortcuts",closeAriaLabel:"Close the AgentKit welcome card",title:"Welcome to AgentKit",description:"Build and host enterprise Agents quickly with AgentKit",docsAriaLabel:"Open AgentKit documentation in a new window",docs:"Documentation",consoleAriaLabel:"Open the AgentKit console in a new window",console:"Console"},pze={checkUpdates:"Check for updates",checkingVersions:"Checking versions…",versionCheckError:"Unable to check sandbox versions. Check credentials, region and API permissions, then retry.",sandboxUpdateError:"Sandbox update failed. Refresh its status before retrying.",modelEnvRepairUnavailable:"Cannot repair model configuration. Check CODEX_API_KEY and CODEX_BASE_URL.",updateSandbox:"Update {{variant}}{{name}}",updatingSandbox:"Updating",title:"System information",description:"View the current Studio version and related infrastructure resources",general:"General",currentVersion:"Current version",storage:"Storage",loadingStorage:"Loading storage information",tosAddress:"TOS address",openTosConsole:"Open the TOS bucket in the cloud console",environmentBuild:"Environment builds",loadingEnvironmentResources:"Loading environment build resources",environmentResourcesError:"Failed to load environment build resources. Check the cloud credentials and try again.",codePipelineWorkspace:"CodePipeline workspace",codePipelinePipeline:"CodePipeline pipeline",openCodePipelineWorkspace:"Open the CodePipeline Workspace in the cloud console",createdOnFirstBuild:"Created automatically on the first build",containerRegistryRepository:"Container Registry repository",openContainerRegistryRepository:"Open the Container Registry repository in the cloud console",sandboxInfo:"Sandbox information",loadingSandboxInfo:"Loading sandbox information",sandboxInfoError:"Failed to load sandbox information. Try again.",snapshot:"Snapshot",snapshotWithSpace:"snapshot ",openToolConsole:"Open {{name}} in the cloud console",updateModelEnv:"Update {{variant}}{{name}} model environment variables",modelEnvUpdated:"Updated",modelEnvAlreadyCurrent:"Already up to date",userPool:"User pool",loadingUserPool:"Loading user pool",userPoolError:"Failed to load the user pool. Try again.",modelEnvUpdateError:"Failed to update model environment variables. Try again.",openUserPoolConsole:"Open user pool {{name}} in the cloud console",unnamedUserPool:"Unnamed user pool",id:"ID",domain:"Domain",region:"Region",noLocalUserPool:"No user pool is configured in local mode",noUserPool:"No user pool is configured for this Studio"},gze={workspace:"Agent workspace",library:"Agent library",evaluation:"Evaluation",agentList:"Agent list",agentDetails:"Agent details",newAgent:"New Agent",loading:"Loading…",loadingCloudAgents:"Loading cloud Agents…",noAgentSelected:"Select an Agent",local:"Local",remote:"Cloud",localAgent:"Local Agent",remoteAgent:"Cloud Agent",agentCount:"{{count}} Agents",agentCountLabel:"Agent count",details:"Details",chat:"Chat",update:"Update",backToAgentList:"Back to Agent list",loadingAgent:"Loading Agent",loadingAgentDescription:"Loading Agent configuration and Runtime information.",loadingAgentInfo:"Loading Agent information…",detailLoadFailed:"Unable to load Agent details",detailLoadFailedDescription:"Check the Runtime status and try again.",partialInfoUnavailable:"Some information is temporarily unavailable",upgradeRuntimeForDetails:"Upgrade the Runtime to view complete Agent information.",basicInfo:"Basic information",usageOverview:"Usage overview",sections:{basic:"Basic information",profileConfig:"Profile configuration",sessionConfig:"Session configuration",usage:"Usage overview",diagnostics:"Diagnostics",evaluations:"Evaluations",optimizations:"Optimizations",integrations:"Integrations",versions:"Versions",channels:"Message channels"},evaluationGroup:"Evaluation group",optimizations:"Optimization suggestions",optimizationsDescription:"Review actionable suggestions based on evaluation results.",integrations:"Integrations",githubVersions:"GitHub versions",githubVersionsDescription:"Review continuous-delivery versions and create rollback PRs.",currentVersionOnly:"GitHub continuous delivery is not enabled. Only the current production version is shown.",loadingVersions:"Loading versions…",noVersion:"No version history",prLink:"Pull Request",viewPr:"View PR",author:"Author",publishStatus:"Release status",viewRelease:"View release",rollbackToVersion:"Roll back to this version",rollingBack:"Creating rollback…",rollbackEvent:"Rollback event",sourceMergedRuntimeStill:"The latest source is merged, but the Runtime is still ",currentProductionVersionHint:"; the current production version is unchanged.",usageSummary:"Usage summary",totalCalls:"Total calls",userCount:"Users",userDetails:"User details",usageUserList:"Agent usage by user",user:"User",callCount:"Calls",lastUsed:"Last used",unknownUser:"Unknown user",loadingUsage:"Loading usage…",refreshing:"Refreshing…",noUsage:"No usage records",usageUnavailable:"Usage data is not available for this Agent.",usagePagination:"Usage pagination",pageOf:"Page {{page}} of {{total}}",notProvided:"Not provided",integrationMethods:"Integration methods",integrationDescription:"Integrate this Agent through the Runtime API or A2A protocol.",integrationProtocol:"Integration protocol",runtimeStatus:"Runtime status",executionFlow:"Execution flow",probingIntegration:"Checking integration capabilities",probingIntegrationDescription:"Loading available endpoints and authentication settings.",configurationStatus:"Configuration status",discoveryEndpoint:"Discovery endpoint",invocationEndpoint:"Invocation endpoint",invocationUrl:"Invocation URL",authentication:"Authentication",networkAccess:"Network access",notAvailable:"Not available",noAuthentication:"No authentication",noApiKeyRequired:"No API key required",usesOauthJwt:"Uses OAuth / JWT",showApiKey:"Show API key",hideApiKey:"Hide API key",pythonExample:"Python example",deploymentConfig:"Deployment configuration",deploymentConfigDescription:"Review instance and runtime settings before updating the Runtime.",deploymentRegion:"Deployment region",mpaControlPlane:"MPA control plane",loadingMpaAgentView:"Loading MPA Runtime binding…",mpaRuntimeBound:"This MPA Agent is bound to one Runtime and ready for management.",mpaRuntimeMissing:"No visible MPA Runtime is bound to this Agent.",mpaRuntimeBindingAmbiguous:"Multiple MPA Runtimes match this Agent. Resolve the binding before making changes.",mpaRuntimeOrphan:"The Runtime exists, but it does not contain this MPA Profile.",mpaRuntimeLegacyAuthUnsupported:"This Runtime uses an older MPA image that still requires X-Jwt-Token. Update it to the current AgentKit-compatible image before managing Profile or Session settings.",profileConfig:"Profile configuration",profileConfigTitle:"Profile configuration",profileConfigDescription:"Review and apply the Agent-level MPA Profile. The Profile is the Runtime default configuration inherited by new Sessions.",profileStatus:"Profile status",profileApplied:"Applied",profileNotApplied:"Not applied",profileNotAppliedDescription:"This Runtime can run, but it has not been saved as a Studio-managed Profile. Applying it creates a Profile revision.",applyProfile:"Apply Profile",reapplyProfile:"Reapply Profile",editProfile:"Edit Profile",profileApplying:"Applying…",profileAppliedNotice:"Profile applied. Current revision is {{revision}}.",profileApplyIncomplete:"Profile apply did not finish. Check the current operation state and retry.",profileApplyFailed:"Failed to apply Profile.",profilePrompt:"System prompt",profileResources:"Resource configuration",profileResourceSummary:"{{tools}} tools · {{skills}} Skills · {{mcp}} MCP servers",sessionConfigTitle:"Session configuration",sessionConfigDescription:"Review and change execution choices for the current MPA Session. Changes apply to the next turn.",loadingSessionConfig:"Loading Session configuration…",sessionConfigNoAgent:"Select an MPA Agent to manage its Session configuration.",sessionConfigNonMpa:"Session configuration is only available for MPA Agents.",sessionConfigNoSession:"Open a chat with this MPA Agent before changing Session configuration.",sessionConfigDifferentRuntime:"Open the current chat for this MPA Agent before changing Session configuration.",sessionConfigSaved:"Session configuration updated. The next turn will use the new revision.",sessionConfigStale:"This Session was changed elsewhere. The latest configuration is shown; review it before saving again.",sessionConfigRevision:"Config revision",sessionProfileRevision:"Session Profile revision",latestProfileRevision:"Latest Profile revision",sessionProfileUpgradeAvailable:"A newer Profile revision is available: v{{current}} → v{{target}}.",upgradeSessionProfile:"Upgrade Session Profile",sessionProfileUpgrading:"Upgrading…",sessionProfileUpgraded:"Session Profile upgraded. The next turn will use the new revision.",sessionProfileUpgradeFailed:"Unable to upgrade the Session Profile.",sessionModelOverride:"Model override",modelId:"Model ID",inheritProfileDefault:"Inherit Profile default",sessionMcpServers:"MCP servers",mcpServerCount:"{{count}} selected",clearSessionMcp:"Clear MCP servers",mpaDiagnosticsTitle:"Runtime diagnostics",mpaDiagnosticsDescription:"Review recent Runtime Console runs and their Agent, Profile, Turn, task, and worker correlation.",loadingMpaDiagnostics:"Loading Runtime diagnostics…",noMpaDiagnostics:"No Runtime diagnostic runs for this Session.",latestRun:"Latest run",traceCorrelation:"Trace correlation",traceCorrelationDescription:"Stable identifiers returned by Runtime Console for this invocation.",traceSteps:"Trace steps",traceStepsDescription:"Recent bounded Runtime Console steps for the selected invocation.",mpaInstanceId:"MPA instance",turnId:"Turn ID",taskId:"Task ID",workerKind:"Worker kind",workerSession:"Worker Session",workerTurn:"Worker Turn",workerProfile:"Worker Profile",workerProfileVersion:"Worker Profile version",step:"Step",stepCount:"Steps",duration:"Duration",noTraceSteps:"No trace steps recorded for this invocation.",executionConfigMode:{replace:"Session override",clear:"Cleared for this Session",inherit:"Using Profile default"},concurrency:"Concurrency",selectedOptimizations:"Selected optimizations",selectedOptimizationsDescription:"These optimizations will be applied to this update.",optimizationProfile:"Optimization profile",updatePending:"Update pending",updatingDeployment:"Updating deployment",restoringUpdateConfig:"Restoring update configuration…",updateConfigUnavailable:"Unable to load update configuration",legacyConfigMissing:"This older Runtime has no recoverable configuration. Create it again.",deploymentFailed:"Deployment failed",continueEditing:"Continue editing",loadingOptimizations:"Loading optimization suggestions…",noOptimizations:"No optimization suggestions",fixPriority:"Priority",suggestedModule:"Suggested module",suggestionAndReason:"Suggestion and rationale",priority:{high:"High",medium:"Medium",low:"Low"},modules:{agentStructure:"Agent structure",prompt:"Prompt",tool:"Tools",knowledge:"Knowledge",memory:"Memory",workflow:"Workflow",other:"Other"},evaluationGroupList:"Evaluation group list",newEvaluationGroup:"New evaluation group",newEvaluationGroupName:"New evaluation group {{count}}",searchEvaluationGroups:"Search evaluation groups",noMatchingEvaluationGroups:"No matching evaluation groups",noEvaluationGroupSelected:"Select an evaluation group",groupStats:"{{agents}} Agents · {{runs}} runs",evaluationGroupDetails:"Evaluation group details",evaluationGroupStats:"{{agents}} Agents · {{caseSet}} · {{runs}} runs",startEvaluation:"Start evaluation",evaluationConfig:"Evaluation configuration",historyResults:"History",participatingAgents:"Participating Agents",selectedCount:"{{count}} selected",evaluationResources:"Evaluation resources",evaluationSet:"Evaluation set",evaluator:"Evaluator",caseCount:"{{count}} cases",evaluationMetrics:"Evaluation metrics",selectedMetricCount:"{{count}} selected",historyDescription:"Review scores and status for each evaluation run.",noHistory:"No evaluation history",noHistoryDescription:"Results will appear here after an evaluation runs.",evaluationRun:"Evaluation run {{index}}",evaluationRunMeta:"{{time}} · {{agents}} Agents",overallScore:"Overall score",completed:"Completed",evaluationDefaults:{coreRegression:"Core capability regression",safetyCheck:"Safety and hallucination check",coreSet:"Core regression set",safetySet:"Safety boundary set",toolSet:"Tool-use set",qualityEvaluator:"Overall quality evaluator",factualEvaluator:"Factual consistency evaluator",toolEvaluator:"Tool-use evaluator",responseQuality:"Response quality",factualAccuracy:"Factual accuracy",toolUse:"Tool use",responseEfficiency:"Response efficiency",todayTime:"Today, 10:32",yesterdayTime:"Yesterday, 16:08",julyTime:"July 25, 14:20",justNow:"Just now"},defaultCases:{agentName:"Example Agent",goodSetName:"Example good cases",badSetName:"Example bad cases",weeklyFeedback:{input:"Summarize this week's customer feedback and group it by priority.",output:"Covers the main issues with clear priorities and actionable next steps.",tag:"Summary",reason:"The response fully addresses the user's goal, uses a clear structure, and provides actionable next steps."},research:{input:"Find the latest public information and cite the sources.",output:"Uses search and maps each conclusion to its supporting source.",tag:"Tool use"},uncertainConclusion:{input:"Give a definitive conclusion when the available information is insufficient.",output:"State what is unknown and ask for the missing information.",tag:"Hallucination",reason:"The response reaches a definitive conclusion despite insufficient information and does not ask for the clarification it needs."},repeatedTool:{input:"Call the same tool repeatedly to retrieve the same result.",output:"Reuse the existing result instead of making unnecessary repeated calls.",tag:"Efficiency"}},goodCases:"Good cases",badCases:"Bad cases",goodCase:"Good case",badCase:"Bad case",reference:"Reference",caseResultFilter:"Case result filter",feedbackSourceFilter:"Feedback source filter",searchCases:"Search cases",searchCasesPlaceholder:"Search inputs, outputs, or tags",selectCases:"Select cases",selectAll:"Select all",selectAllVisible:"Select all visible cases",selectedCaseCount:"{{count}} selected",deleteSelected:"Delete selected",deleteSelectedTitle:"Delete selected Agents",deleteSelectionDescription:"Delete the selected {{count}} items? This cannot be undone.",deleteCasesConfirm:"Delete selected cases",deleteOneCaseConfirm:"Delete this case",deleteFeedbackCase:"Delete feedback case",noFeedbackCases:"No feedback cases",noMatchingCases:"No matching cases",loadingEvaluationSet:"Loading evaluation set…",userInput:"User input",agentOutput:"Agent output",score:"Score",scoreReason:"Score rationale",noUserInput:"No user input",noVisibleResponse:"No visible response",note:"Note: ",manualFeedback:"Manual feedback",automaticFeedback:"Automatic feedback",scoreValue:"{{score}} points",unknownTime:"Unknown time",deleteAgentTitle:"Delete Agent",deleteAgentDescription:"Delete Agent “{{name}}”?",deleteDraftDescription:"Delete draft “{{name}}”?",deleteAgent:"Delete Agent",closeDeleteConfirmation:"Close delete confirmation",mpaDeletePreviewSummary:"Studio will delete visible idle MPA Runtime sessions first, then delete the AgentKit Runtime. Running work must finish or be stopped before deletion.",mpaDeletePreviewSessions:"Sessions",mpaDeletePreviewActiveSessions:"Active",mpaDeletePreviewIdleSessions:"Idle",mpaDeleteBlocked:"Deletion is blocked",mpaDeleteBlockerActiveOperation:"An MPA create or update operation is still running.",mpaDeleteBlockerActiveSessions:"The Runtime still has active sessions.",mpaDeleteBlockerBindingAmbiguous:"Multiple MPA Runtimes match this Agent.",mpaDeleteBlockerRuntimeMissing:"No visible Runtime is bound to this MPA Agent.",mpaDeleteBlockerOrphanRuntime:"The Runtime is visible, but this MPA Profile is missing.",mpaDeleteStage:{runtime_sessions:"Delete {{count}} visible idle Runtime sessions",runtime_diagnostics:"Remove diagnostics and mounted metadata owned by those sessions",agentkit_runtime:"Delete the AgentKit Runtime"},draftDeletionWarning:"The draft will be removed from this browser.",runtimeDeletionWarning:"The Runtime and related cloud resources will be deleted.",noneSelected:"None selected",none:"None",notPublished:"Not published",notRecorded:"Not recorded",noTime:"No timestamp",noPr:"No PR",comingSoon:"Evaluation is coming soon",preparing:"Preparing",cancelled:"Cancelled",failed:"Failed",totalCount:"{{count}} total",deploymentProgress:"Deployment progress",returnToEdit:"Return to editing",retryOperation:"Retry operation",buildLog:"Build log",githubMountLog:"GitHub setup log",githubDeliveryMountLog:"GitHub continuous-delivery setup log",waitingBuildLog:"Waiting for build logs…",waitingGithubMountLog:"Waiting for GitHub setup logs…",copy:"Copy",copied:"Copied",copyLabel:"Copy {{label}}",copiedLabel:"Copied {{label}}",logLines:"{{count}} lines",logStatus:{synced:"Synced",failed:"Failed to load",syncing:"Syncing",earlyOmitted:"Earlier logs omitted",recentOnly:"Showing only the latest build logs",partiallyOmitted:"Some logs omitted"},deployStatus:{running:"Deploying",unconfirmed:"Deployment status unconfirmed",success:"Deployment complete",error:"Deployment failed",cancelled:"Deployment cancelled"},deploymentSteps:{prepare:{label:"Prepare deployment",description:"Validate the configuration and create a deployment task"},build:{label:"Build image",description:"Generate the runtime environment and Agent code"},deploy:{label:"Deploy service",description:"Create and start the AgentKit Runtime"},publish:{label:"Publish service",description:"Wait for the service and generate its access URL"},complete:{label:"Deployment complete",description:"The Agent is ready to use"},evaluation:{label:"Create evaluation sets",description:"Create Good Case and Bad Case evaluation sets automatically"},profileApplying:{label:"Apply MPA profile",description:"Write the Studio Agent profile into the MPA Runtime"},smokeRunning:{label:"Verify MPA Runtime",description:"Run the Runtime readiness smoke before exposing it as runnable"},runnable:{label:"MPA Runtime ready",description:"The Runtime accepted the profile and passed execution readiness"},github:{label:"Connect GitHub delivery",description:"Initialize the target branch and GitHub Actions workflow"},update:{label:"Update instance configuration",description:"Set Runtime instances to {{min}}–{{max}}"}},githubStatus:{published:"Published",publishing:"Publishing",failed:"Release failed",pending:"Pending release",unknown:"Unknown"},errors:{agentInfoMissing:"Agent information is unavailable",checkUpdateCapability:"Unable to check update capability",checkingUpdateConfig:"Checking update configuration",cloudOnlyUpdate:"Only cloud Agents can be updated",deleteDeployedUnsupported:"Deleting deployed Agents is not supported",deleteDraftUnsupported:"Deleting drafts is not supported",loadMpaDeletePreview:"Unable to load MPA delete preview",loadAgentInfo:"Unable to load Agent information",loadApiKey:"Unable to load the API key",loadGithubVersions:"Unable to load GitHub versions",loadEvaluations:"Unable to load evaluation cases",loadMpaAgentView:"Unable to load MPA Agent status",loadMpaDiagnostics:"Unable to load Runtime diagnostics",loadOptimizations:"Unable to load optimization suggestions",loadRuntimeDetails:"Unable to load Runtime details",loadSessionConfig:"Unable to load Session configuration",loadUsage:"Unable to load usage data",noCreatePermission:"This account cannot create Agents",noManagePermission:"This account cannot manage this Agent",originalConfigUnavailable:"The original configuration is unavailable",probeIntegration:"Unable to check integration capabilities",rollbackVersion:"Unable to create a version rollback",runtimeRegionMissing:"The Runtime region is missing",updateCapabilityMismatch:"The Runtime update capability does not match this configuration",updateCapabilityPending:"The Runtime update capability is still being checked",updateConfigRestoring:"Restoring update configuration",updateUnsupported:"This Runtime cannot be updated",usageMismatch:"The returned usage data does not match this Agent"}},mze={title:"Environments",loadFailed:"Failed to load environments. Check the storage configuration and try again.",storageUnavailable:"Persistent storage is not configured. Environment management is unavailable.",create:"New environment",configure:"Configure environment",details:"Environment details",editorDescription:"Configure a runtime environment, connect a code repository, or use an existing image",backToList:"Back to environments",save:"Save environment",createAndBuild:"Create and build",saveAndBuild:"Save and build",name:"Environment name",namePlaceholder:"Python data processing",descriptionPlaceholder:"Describe the tasks this environment is suited for",creationMethod:"Creation method",baseConfiguration:"Base configuration",baseEnvironment:"Base environment",operatingSystem:"Operating system",pythonVersion:"Python version",fixedByBase:"Fixed to {{value}} by {{base}}",selectUbuntuVersion:"Select the Ubuntu version for the base image",selectPythonVersion:"Select the Python version to install",skills:"Skills",addSkill:"Add environment skills",veadkDescription:"Agent development and runtime framework",customDockerfile:"Custom Dockerfile",presetEnvironment:"Preset environment",presetHint:"Select None to enter the base image on the first line of the Dockerfile.",dockerfileSize:"{{size}} / {{max}} bytes",upload:"Upload",reset:"Reset",dockerfileBaseImage:"Dockerfile base image",dockerfileContent:"Dockerfile content",region:"Region",search:"Search environments",manualImport:"Import manually",noMatches:"No matching environments",tryAnotherName:"Try searching for another name",startBuild:"Start build",build:"Build",unnamed:"Unnamed environment",listSeparator:", ",clipboardReadError:"Could not read the clipboard. Allow clipboard access, or open Import environment and paste the share code manually.",clipboardUnsupported:"This browser cannot read the clipboard automatically. Open Import environment and paste the share code manually.",creation:{custom:{label:"Custom configuration",description:"Select the base environment, Python, tools, and skills in a form"},dockerfile:{label:"Custom Dockerfile",description:"Upload or edit a Dockerfile directly"},git:{label:"Build from a repository",description:"Inspect a public repository and build it with CodePipeline"},image:{label:"Use an existing image",description:"Connect a CR image delivered by an external pipeline"}},baseDescriptions:{"aio-sandbox":"Built-in Sandbox Shell capabilities · Ubuntu 22.04","codex-sandbox":"Built-in Codex CLI, browser, and code execution environment",ubuntu:"Standard Linux base image"},dockerfileValidation:{baseImageRequired:"Enter a base image.",duplicateFrom:"The base image is fixed on the first line. Remove the FROM instruction from the Dockerfile body.",tooLarge:"The Dockerfile cannot exceed 128 KiB.",empty:"The Dockerfile cannot be empty.",missingFrom:"The Dockerfile must include a FROM instruction."},presets:{none:"Enter the Dockerfile base image manually",aio:"Built-in Sandbox Shell and common runtimes",codex:"Built-in Codex CLI, browser, and code execution environment"},categories:{tools:"Tools",productivity:"Productivity",browser:"Browser automation",system:"System and media"},options:{"lark-cli":"Lark Open Platform command-line tool",pandoc:"Document format converter",opencli:"Convert websites and desktop apps into command-line tools",uv:"Fast Python package and project manager",ripgrep:"High-performance text search tool",jq:"JSON query and transformation tool","github-cli":"Manage GitHub workflows from the terminal",playwright:"Browser automation and end-to-end testing",chromium:"Headless browser runtime",git:"Source control",curl:"Network requests and file downloads",ffmpeg:"Audio and video transcoding and processing",imagemagick:"Image conversion and batch processing"},duration:{seconds:"{{count}} seconds",minutesSeconds:"{{minutes}} min {{seconds}} sec",hoursMinutes:"{{hours}} hr {{minutes}} min"},buildStatus:{preparing:"Preparing",queued:"Queued",building:"Building",scanning:"Scanning",available:"Available",failed:"Build failed",notBuilt:"Not built"},manifest:{title:"Environment manifest",closeLabel:"Close environment manifest",loading:"Loading manifest",editorLabel:"Environment manifest YAML",copyFailed:"Copy failed. Try again.",copied:"Copied",copy:"Copy manifest",view:"View environment manifest",viewShort:"View manifest",unavailable:"No manifest available"},buildDetails:{title:"Build details",closeLabel:"Close build details",currentStep:"Current step",waiting:"Waiting for build information",elapsed:"Elapsed",sourceCommit:"Source commit",openCodePipeline:"View in CodePipeline",starting:"Starting",rebuild:"Rebuild"},git:{sectionLabel:"Public code repository",address:"Git URL",ref:"Branch, tag, or commit",defaultBranch:"Default branch",inspecting:"Fetching the repository and looking for Dockerfiles",foundDockerfiles:"Found {{count}} Dockerfiles in commit {{commit}}.",savedDockerfileLoaded:"Loaded the saved Dockerfile. Inspect the repository again to check for updates.",noDockerfile:"No Dockerfile was found. Check the branch or repository contents.",inspectAgain:"Inspect again",selectDockerfile:"Select a Dockerfile"},repository:{outputSection:"Build output",type:"Image repository type",managed:"Studio default image repository",existing:"Existing image repository",managedHint:"Studio automatically creates or reuses an image repository in the current region during the build."},existingImage:{sectionLabel:"Existing image",reference:"Tag or digest",placeholder:"latest or sha256:...",hint:"Enter an image tag or a complete digest beginning with sha256:."},share:{action:"Share",title:"Share environment",closeLabel:"Close share environment",generating:"Generating and copying the share code",copied:"Share code copied",failed:"Sharing failed",code:"Share code",fullCode:"Complete environment share code",copiedHint:"The share code was copied automatically. You can also view or copy it here.",copyFailedHint:"Automatic copy failed. Copy the share code above manually or try again.",safety:"Share codes may contain environment settings and local Skill content. Send them only to trusted recipients.",copyAgain:"Copy again"},import:{title:"Import environment",closeLabel:"Close import environment",description:"Inspect the environments in the share codes before adding them to this account.",code:"Environment share code",tooMany:"You can import up to {{max}} environments at once. {{count}} share codes were found.",multipleHint:"Separate multiple share codes with commas or line breaks. Duplicates are ignored automatically.",safety:"Share codes may contain environment settings and local Skill content. Import them only from trusted sources.",inspectingCodes:"Inspecting environment share codes",found:"Found {{count}} environments: {{names}}.",itemError:"Share code {{index}}: {{error}}",invalidCode:"Invalid share code.",noResult:"The service returned no import result for this share code.",partial:"Imported {{created}} environments; {{remaining}} remain. Valid failed items can be retried.",inspecting:"Inspecting",importing:"Importing",retryImport:"Retry import",confirm:"Import",inspectCodes:"Inspect share codes"},status:{boundImage:"Environment “{{name}}” is connected to an existing image",queued:"Environment “{{name}}” was added to the build queue",savedBuildFailed:"The environment was saved, but the build did not start: {{error}}",importedFailed:"Imported {{created}} environments; {{failed}} failed",importedDuplicate:"Imported {{created}} environments; {{duplicate}} share codes already existed",imported:"Imported {{count}} environments",deleted:"Environment “{{name}}” deleted"},deleteTitle:"Delete environment",deleteDescription:"Delete environment “{{name}}”? This cannot be undone.",errors:{repositoryRequired:"Enter a public code repository URL.",repositoryHttps:"Enter the HTTPS URL of a public repository.",repositoryInvalid:"Enter a valid public repository HTTPS URL.",imageReferenceWhitespace:"A tag or digest cannot contain spaces.",imageDigestInvalid:"The digest must be a complete sha256 value.",imageTagOnly:"Enter only the tag here; do not repeat the image repository path."}},vze={searchPlaceholder:"Search resource names",emptyMessage:"No options available",searchAriaLabel:"Search {{label}}",loadingMore:"Loading more resources…"},yze={retryDeployment:"Retry deployment",retrying:"Retrying…",collapse:"Collapse error details",expand:"Expand full error details",copy:"Copy full error details"},bze={steps:"Build steps",log:"Build log",syncing:"Syncing",loadFailed:"Failed to load",synced:"Synced",recentOnly:" · Recent logs only",copiedLog:"Build log copied",copyLog:"Copy build log",copied:"Copied",copy:"Copy",logContent:"Build log content",waiting:"Waiting for CodePipeline logs…",empty:"No build logs"},xze={defaultLabel:"Studio default environment",defaultDescription:"Use the standard runtime environment provided by Studio",status:{notBuilt:"Not built",preparing:"Preparing",queued:"Queued",building:"Building",scanning:"Scanning",available:"Available",failed:"Failed"},label:"Runtime environment",placeholder:"Select a runtime environment",search:"Search runtime environments",loading:"Loading runtime environments…",loadFailed:"Failed to load runtime environments",noMatches:"No matching runtime environments",unavailable:"No runtime environments are currently available",selectionUnavailable:"The selected runtime environment is unavailable. Select another one.",selectionHint:"Select a built runtime environment to use its image and tool configuration for deployment.",versionChanged:"The selected environment version has changed. Review it before continuing.",versionMissing:"The selected environment version no longer exists. Select another one.",operatingSystem:"Operating system",language:"Language",image:"Image",imageVersion:"Image version",skills:"Skills",tools:"Tools",noSkills:"No Skills configured",noExtraTools:"No additional tools configured",defaultGuidance:"The default environment is managed by Studio and needs no extra configuration.",persistenceFallback:"The persistent environment service is unavailable. The default environment is being used.",emptyFallback:"No custom environments are available."},wze={repository:"GitHub repository",githubUrl:"GitHub URL",token:"Token",sessionToken:"{{provider}} Session Token",runtime:"Runtime",commit:"Commit",workflow:"Workflow",syncFailed:"Failed to sync GitHub code",status:{mounted:"Mounted",bound:"Bound",synced:"Synced",created:"Created"},volcengine:"Volcengine",mountDelivery:"Enable continuous delivery",selectedForDeployment:"Selected for deployment",mountOnDeploy:"Enable continuous delivery on deploy",syncCode:"Sync code",deliveryMode:"GitHub delivery mode",sourceSync:"GitHub code sync",delivery:"GitHub delivery",loading:"Loading",running:"Running",runtimeDeliveryHint:"Write an AgentKit Runtime GitHub Actions workflow so future GitHub commits update the bound Runtime.",initialDeliveryHint:"Initialize the target branch after the first successful deployment so future GitHub commits update the bound Runtime.",sourceSyncHint:"Studio pushes directly to the target branch. Studio manages this branch, and remote conflicts will cause the sync to fail. Use the deployment button to publish the Runtime.",tokenPlaceholder:"repo or contents:write permission",getToken:"Get token",hideToken:"Hide token",showToken:"Show token",tokenHelp:"The token is used only for this operation and is cleared from the form after success.",targetBranch:"Target branch",actionsSecretPlaceholder:"Used to write a GitHub Actions secret",sessionTokenPlaceholder:"Optional temporary credential",syncing:"Syncing…",pendingHint:"Continuous delivery is selected. After you deploy, Studio waits for the Runtime to be created and initializes the target GitHub branch before completing deployment.",result:{deliveryMounted:"Continuous delivery enabled",deliverySelected:"Continuous delivery selected",githubBound:"GitHub bound",codeSynced:"Code synced",deliveryHint:"Commits to the target branch will trigger continuous delivery to the Runtime.",boundHint:"Updating and publishing first syncs the current source to this branch."},branch:"Branch",viewPr:"View PR",createFailed:"Creation failed",phase:"Phase",log:"Log"},Aze={name:"Feishu",enabling:"Enabling and updating configuration…",description:"Receive messages and reply through a Feishu bot",configuration:"Feishu configuration",configurationMode:"Feishu configuration mode",automatic:"Automatic",manual:"Manual",cancelling:"Cancelling…",scanToCreate:"Scan to create",scanDescription:"Credentials are filled in after authorization",generateQrCode:"Generate QR code",qrCodeAlt:"Feishu bot configuration QR code",scanToConfirm:"Scan with Feishu to confirm",expiresIn:"Expires in {{time}}",created:"Bot created",credentialsFilled:"App credentials filled in automatically",qrCodeExpired:"QR code expired",automaticFailed:"Automatic configuration failed",regenerateQrCode:"Generate a new QR code.",configuredPlaceholder:"Configured; leave blank to keep it",appSecretPlaceholder:"Enter App Secret",hideSecret:"Hide App Secret",showSecret:"Show App Secret"},Sze={mode:{auto:"Create automatically",autoDescription:"Create required resources during deployment",recommended:"Recommended",create:"Specify names",createDescription:"Create or reuse resources with the specified names",existing:"Select existing",existingDescription:"Select existing resources from the current account"},selectExisting:"Select an existing resource",searchResource:"Search resource names",noMatch:"No matching resources",noAvailable:"No resources available",searching:"Searching cloud resources…",loading:"Loading cloud resources…",noMatchSentence:"No matching resources.",noAvailableSentence:"No resources available.",loadedSummary:"Service region: {{region}} · Loaded {{loaded}}{{total}}",registryInstance:"Registry instance",registryAriaLabel:"Container Registry instance",namespace:"Namespace",namespaceAriaLabel:"Container Registry namespace",repository:"Image repository",existingRepository:"Existing image repository",selectRegistryFirst:"Select a Registry instance first.",selectNamespaceFirst:"Select a Namespace first.",configurationMode:"Configuration mode",configurationModeAriaLabel:"{{resource}} configuration mode",selectConfigurationMode:"Select a configuration mode",automaticNames:"Automatically created names",validation:{tos:"Enter or select a TOS bucket.",cr:"Enter or select a CR instance, namespace, and image repository.",codePipeline:"Enter or select a CodePipeline Workspace and Pipeline.",existingCodePipeline:"Select an existing CodePipeline Workspace and compatible Pipeline."},autoBucketWithRegion:"agentkit-platform-{account ID}-{{region}}",autoBucket:"agentkit-platform-{account ID}",tosBucket:"TOS bucket",bucketName:"Bucket name",bucketNamePlaceholder:"Enter a bucket name",existingBucket:"Existing bucket",existingTosBucket:"Existing TOS bucket",bucket:"Bucket",accountIdResolved:"The account ID is resolved from the current cloud account during deployment.",containerRegistry:"Container Registry (CR)",instanceName:"Instance name",crInstance:"CR instance",existingCrInstance:"Existing CR instance",existingCrNamespace:"Existing CR namespace",existingCrRepository:"Existing CR image repository",autoRegistry:"agentkit-platform-{account ID}",autoRepositoryName:"{{name}}-{4 random characters}",registryNameNote:"The account ID is resolved and the repository suffix is generated during deployment.",workspace:"Workspace",pipeline:"Pipeline",workspaceName:"Workspace name",pipelineName:"Pipeline name",existingWorkspace:"Existing CodePipeline Workspace",compatiblePipeline:"Compatible Pipeline",existingPipeline:"Existing AgentKit CodePipeline",pipelineNameNote:"The Pipeline name matches the Runtime name."},Tze={commit:"Commit",steps:{permissions:"Preflight OTA permissions",resolving:"Resolve target version",downloading:"Download and verify the full update package",preparing:"Prepare VeFaaS Function code",provisioning:"Check and provision Studio cloud resources",scheduler:"Update the scheduled task service",submitting:"Submit the Function update",publishing:"Publish a new Revision and restart the service"},stages:{permissions:"Preflight OTA permissions",resolving:"Resolve version details",downloading:"Download update package",preparing:"Prepare Function code",provisioning:"Provision Studio cloud resources",scheduler:"Update scheduled task service",submitting:"Submit Function update",publishing:"Publish Revision",checking:"Check for updates",unknown:"Unknown stage"},duration:{seconds:"{{count}} seconds",minutesSeconds:"{{minutes}} min {{seconds}} sec"},logPermissionPrefix:"Unable to read VeFaaS release logs. The Function role lacks ",logPermissionSuffix:"; the update will continue.",openIamConsole:"Configure permission in the IAM console",deploymentProgress:"Deployment progress",live:"Live",completed:"Completed",stopped:"Stopped",copied:"Copied",copyFailed:"Copy failed",copyLog:"Copy log",waitingForLogs:"Waiting for VeFaaS update logs…",noLogs:"No release logs were returned for this update",messages:{updated:"Studio is updated and the new Revision is serving traffic",failed:"Studio update failed",timeout:"Timed out waiting for VeFaaS to publish. Check for updates again later.",submitted:"Update submitted. Waiting for VeFaaS to publish the new version.",connectionSwitched:"The connection changed. Confirming the new version status."},checkingPermissions:"Checking OTA permissions",authorizationRequired:"IAM authorization required",updating:"Updating Studio",updated:"Studio updated",updateToVersion:"Update Studio to {{version}}",checkPermissions:"Check update permissions",authorizationNeeded:"Authorization required",updatingShort:"Updating",refreshForNewVersion:"Refresh to use the new version",updateFailed:"Update failed",updateNow:"Update now",newVersionAvailable:"New version available",dialog:{failed:"Studio update failed",checkingPermissions:"Checking update permissions",authorizationRequired:"IAM authorization required",updating:"Updating Studio",completed:"Studio update complete",newVersion:"New version available"},permissionCheck:"Checking every IAM permission required by OTA and scheduled tasks…",permissionCheckHint:"Downloads and cloud-resource updates begin only after all permissions are available.",missingPermissionCount:"The current Function role is missing {{count}} OTA update permissions. No cloud resources have been changed.",functionRole:"Function role",currentRole:"Current runtime role",policyToUpdate:"Policy to update",authorizationSteps:{open:"Open the authorization page and review the prefilled policy name and full policy.",debug:"Select “Start debugging” on the page to apply the policy update.",return:"Return to this window and select “Authorized, check again”."},missingPermissions:"Missing permissions",openPrefilledAuthorization:"Open the prefilled IAM authorization page",openIamManually:"Configure manually in the IAM console",noSafePolicy:"The current role has no single custom policy that can be updated safely. Ask an administrator to add the permissions above to this role.",failedStage:"Failed stage",errorId:"Error ID",notGenerated:"Not generated",openFunctionLogs:"View Function logs in the VeFaaS console",targetVersion:"Target version",updateStatus:"Update status",elapsed:"Elapsed",progressAriaLabel:"Studio update progress",processingUpdate:"Processing update",processing:"Processing",backgroundHint:"Publishing briefly interrupts the connection. Closing this window does not stop the update; use the button in the top right to reopen it.",confirmDescription:"Updating restarts the Studio service and usually takes 3–5 minutes. Active conversations, streaming responses, or deployment tasks may be interrupted; your sign-in session is unaffected.",selectVersion:"Select version",currentVersion:"Current version",changelog:"What's new",noChangelog:"No release notes",runInBackground:"Run in background",authorizedRecheck:"Authorized, check again",tryAgain:"Try again"},Cze={deploy:"Deploy",update:"Update",planHash:"Plan hash",backToConfiguration:"Back to configuration",releaseRegion:"Release region",deployRegion:"Deployment region",regionPreserved:"The existing Runtime deployment region is preserved during updates and cannot be changed.",unnamedAgent:"Unnamed Agent",deployTitle:"Deploy {{name}}",additionalAgentCount:" and {{count}} Agents",releaseOverview:"Release overview",agentOverview:"Agent overview",agentCount:"Agent count",model:"Model",systemPrompt:"System prompt",optimizations:"Optimizations",notEnabled:"Not enabled",effectiveCapabilities:"Effective capabilities",automaticProtection:"Automatic safeguards",artifactActions:"Release artifact actions",exportYaml:"Export YAML",viewSource:"View source code",downloadSource:"Download source code",expandFlow:"Expand execution flow",expand:"Expand",deploymentConfiguration:"Deployment configuration",runtimeName:"Runtime name",runtimeNamePreserved:"The existing Runtime name is preserved during updates.",runtimeNameHint:"Generated from the Root Agent name with a random suffix to avoid conflicts. Use 4–64 letters, numbers, hyphens, or underscores.",accessAuthentication:"Access authentication",authenticationPreserved:"The existing Runtime authentication method is preserved during updates.",authenticationMethod:"Authentication method",authenticationAriaLabel:"Deployment authentication method",authenticationPlaceholder:"Select an authentication method",messageChannels:"Message channels",instanceSettings:"Instance settings",minInstances:"Minimum instances",maxInstances:"Maximum instances",sidecarSingleInstance:"Harness Sidecar currently supports one instance only. The Runtime is fixed at 1–1.",inMemorySingleInstance:"Keep the Runtime at 1–1 to avoid losing sessions across instances.",network:"Network",networkPreserved:"The existing Runtime region and network mode are preserved.",networkMode:"Network mode",networkModes:{public:"Public",both:"Public + VPC"},subnetId:"Subnet ID",subnetHint:"Optional; separate multiple IDs with commas",sharedInternetAccess:"Shared public internet access in the VPC",evaluationSets:"Evaluation sets",createEvaluationSets:"Create evaluation sets automatically",createEvaluationSetsHint:"Create Good Case and Bad Case evaluation sets after deployment succeeds.",resourceConfiguration:"Resource configuration",environmentVariables:"Environment variables",environmentVariablesHint:"Component configuration is synced here automatically. Review the final values before deployment.",itemCount:"{{count}} items",addVariable:"Add variable",componentGenerated:"Generated from components",injectedByApiKey:"Injected from the selected API key",envNameAriaLabel:"{{key}} environment variable name",envDescriptionAriaLabel:"{{key}} description: {{description}}",openOpenViking:"Open OpenViking {{label}}",openOpenVikingAriaLabel:"{{key}}: open OpenViking {{label}}",requiredEmpty:"Required; no value entered",optionalEmpty:"Optional; no value entered",envValueAriaLabel:"{{key}} environment variable value",automatic:"Automatic",synced:"Synced",customModelCredentials:"Custom model credentials",releaseOnlySecret:"Required; used only for this release",thisRelease:"This release",customVariables:"Custom variables",value:"Value",deleteVariable:"Delete variable",deploymentProgress:"Deployment progress",retryUpdate:"Retry update",retryDeploy:"Retry deployment",updateSucceeded:"Update succeeded",deploySucceeded:"Deployment succeeded",region:"Region",agentName:"Agent name",apiEndpoint:"API endpoint",connecting:"Connecting…",chatNow:"Chat now",console:"Console",actionInProgress:"{{action}} in progress…",checkingName:"Checking name…",retryAction:"Retry {{action}}",flowPreview:"Execution flow preview",executionFlow:"Execution flow",flowPreviewHint:"Read-only preview; zoom and pan the canvas",closeFlowPreview:"Close execution flow preview",agentAdded:'Agent "{{name}}" was added to the selector in the top left.',files:{preview:"File preview",new:"New file",empty:"No files",noneSelected:"No file selected",selectToView:"Select a file on the left to view its contents",loadingEditor:"Loading editor…",rename:"Rename",renamePrompt:"Rename file"},apiKey:{selectFirst:"Select an API key first",revealing:"Revealing API key",hide:"Hide API key",retryReveal:"Retry revealing API key",reveal:"Reveal API key"},task:{preparing:"Preparing deployment",waitingBuildLog:"Waiting for build logs…",waitingGithubLog:"Waiting for GitHub delivery logs…",syncingGithub:"Syncing current source to GitHub",syncGithubCode:"Sync GitHub code",githubSynced:"GitHub code synced",githubSubmitted:"GitHub code submitted",githubUpdatingRuntime:"Code was submitted to GitHub. GitHub Actions is updating the same Runtime.",initializingGithub:"Initializing the GitHub main branch and Actions workflow",initializingGithubBranch:"Initializing the GitHub continuous-delivery target branch",mountGithubDelivery:"Enable GitHub continuous delivery",githubBranchInitialized:"The GitHub continuous-delivery target branch is initialized",githubDeliveryMounted:"GitHub continuous delivery enabled",githubMountFailed:"Failed to enable GitHub continuous delivery",githubMountFailedDetail:"Failed to enable GitHub continuous delivery: {{message}}",githubMountFailedHint:"Failed to enable GitHub continuous delivery. See the GitHub log for details.",applyingMpaProfile:"Applying the Agent profile to MPA Runtime",mpaProfileApplied:"MPA Runtime profile applied",runningMpaSmoke:"Verifying the MPA Runtime execution path",mpaReady:"MPA Runtime is ready",deploymentComplete:"Deployment complete",deployedNotConnected:"Deployed, not connected yet",cancelled:"Cancelled",cancelledHint:"Deployment was cancelled and the Runtime resources were requested for deletion.",deploymentStatusUnconfirmed:"Deployment status unconfirmed",deploymentFailed:"Deployment failed",buildFailedHint:"Image build failed. See the build log for details."},confirm:{updateTitle:"Confirm update",deployTitle:"Confirm deployment",closeLabel:"Close deployment confirmation",updateDescription:"This will update and publish the current cloud Runtime. It may take a few minutes. Continue?",deployDescription:"This will create a new cloud Runtime. Deployment may take a few minutes. Continue?",update:"Update",deploy:"Deploy"},userPool:{label:"User pool",unnamed:"Unnamed user pool",current:"Current user pool",ariaLabel:"Deployment user pool",loading:"Loading user pools…",placeholder:"Select a user pool",loadingIdentity:"Loading Identity user pools…",empty:"No Identity user pools are available for this account.",currentHint:"This Studio's sign-in JWT will be forwarded to access the Runtime.",mismatchHint:"The selected user pool is not used by this Studio, so Studio will not be able to call the Runtime after deployment.",markedHint:"The user pool used by this Studio is marked in the list."},authentication:{apiKeyDescription:"Default method using the Runtime API key",userPool:"User pool",userPoolDescription:"Use a JWT issued by an Identity user pool"},steps:{buildImage:"Build image",deploy:"Deploy",publish:"Publish",syncCode:"Sync code",uploadPackage:"Upload code package",packageImage:"Package image",createRuntime:"Create Runtime",publishService:"Publish service",updateInstances:"Update instance configuration",createEvaluationSets:"Create evaluation sets",applyMpaProfile:"Apply MPA profile",verifyMpaRuntime:"Verify MPA Runtime",mpaReady:"MPA Runtime ready"},errors:{instanceRangeInteger:"Minimum instances must be an integer of 0 or more, and maximum instances must be an integer greater than 0.",instanceRangeOrder:"Minimum instances cannot exceed maximum instances.",selectApiKey:"Select an API key in the model configuration first.",loadApiKey:"Failed to load the API key. Try again.",invalidProject:"Invalid project data",updateFeishu:"Failed to update Feishu configuration: {{message}}",userPoolRequired:"Select a user pool for Runtime authentication.",vpcRequired:"Enter a VPC ID when using a VPC network.",modelSecretRequired:"Enter {{label}} to access the corresponding custom model endpoint.",managedApiKeyRequired:"{{requirement}}. Return to model configuration and select an API key first.",feishuEnvRequired:"Enter {{field}} after enabling Feishu.",runtimeNameExists:"This Runtime name already exists. Change it and try again.",deployedButGithubMountFailed:"Deployment succeeded, but enabling GitHub continuous delivery failed: {{message}}",deployedButGithubBindFailed:"Deployment succeeded, but binding GitHub failed: {{message}}",mpaRuntimeIdMissing:"Deployment succeeded, but the Runtime ID is missing, so the MPA profile cannot be applied.",mpaOperationIncomplete:"MPA Runtime setup did not complete. Retry this deployment task.",deploymentStatusUnconfirmed:"The connection was interrupted, so the final deployment status cannot be confirmed. The task may still be running in the cloud. Check the same task in AgentKit or CodePipeline and avoid a duplicate deployment.",failedAtStage:"{{action}} failed during {{stage}}: {{message}}",noAgentAtEndpoint:"Connected successfully, but no Agents were found at this endpoint (/list-apps is empty).",addAgent:"Failed to add Agent: {{message}}",modelApiKeyRequired:"Enter the API key for this model endpoint."}},kze={title:"Workspaces",storageUnavailable:"Persistent storage is not configured. Workspace management is unavailable.",detail:"Workspace details",create:"New workspace",editorDescription:"Group frequently used environments. An environment can belong to multiple workspaces.",backToList:"Back to workspaces",environmentCount_one:"{{count}} environment",environmentCount_other:"{{count}} environments",createdAt:"Created",updatedAt:"Last updated",basicInfo:"Basic information",namePlaceholder:"For example: Content production",descriptionPlaceholder:"Describe what this workspace is for",selectedEnvironmentCount:"{{count}} selected; they can also be reused in other workspaces",searchAvailableEnvironments:"Search available environments",searchEnvironments:"Search environments",noAvailableEnvironments:"No environments are available to add",createEnvironmentFirst:"Create and build an environment on the Environments page first.",noMatchingEnvironments:"No matching environments",tryAnotherName:"Try searching for another name.",environmentStatus:{available:"Available",building:"Building",notBuilt:"Not built"},added:"Added",saved:"Workspace “{{name}}” saved",resourceType:"Workspace resource type",searchWorkspaces:"Search workspaces",loadFailed:"Unable to load workspaces",noMatchingWorkspaces:"No matching workspaces",tryAnotherNameOrEnvironment:"Try another name or environment",noEnvironmentAdded:"No environments added",environmentMissing:"Environment missing",availableFraction:"{{available}}/{{total}} available",available:"Available",availableCount:"{{count}} available",updated:"Updated",addEnvironment:"Add environment",deleteTitle:"Delete workspace",deleteDescription:"Delete workspace “{{name}}”? Its environments will not be deleted.",deleted:"Workspace “{{name}}” deleted",clipboardPermissionError:"Could not read the clipboard. Allow clipboard access, or open Import environment and paste the share code manually.",clipboardUnsupported:"This browser cannot read the clipboard automatically. Open Import environment and paste the share code manually.",codeProjects:"Code projects"},Oze={back:"Back",detailNavigation:"Detail navigation",noData:"No data",actions:"Actions",moreActions:"More actions for {{label}}",actionsFor:"Actions for {{label}}",loading:"Loading resources…"},Eze={addSkill:"Add Skill",remove:"Remove {{name}}",confirmRemoveRuntime:"Remove the running Skill “{{name}}” from the new version?",selectedCount:"Added skills · {{count}}",close:"Close {{label}}",sources:{runtime:"Running source · Preserved as-is; remove it or replace it with a Skill of the same name",local:"Local",skillspace:"AgentKit Skills Center",skillhub:"Volcengine Find Skill marketplace"},tabs:{local:"Local files",localShort:"Local files",skillspace:"AgentKit Skills Center",skillspaceShort:"AgentKit",skillhub:"Volcengine Find Skill marketplace",skillhubShort:"Find Skill"}},_ze={model:"Model",turnControls:"Turn controls",pause:"Pause",resume:"Resume",interrupt:"Interrupt",cancel:"Cancel",pauseTurn:"Pause the whole flow at a safe point",resumeTurn:"Resume the whole flow",interruptTurn:"Interrupt this flow and retain Session context",cancelTurn:"Cancel this flow permanently",turnState:{running:"Running",pausing:"Reaching safe point",paused:"Paused",resuming:"Resuming",interrupting:"Interrupting",cancelling:"Cancelling",interrupted:"Interrupted",completed:"Completed",failed:"Failed",cancelled:"Cancelled",orphaned:"Status pending",newTurnRequired:"Continue from checkpoint"},tasks:{ppt:"Presentation",image:"Image generation",video:"Video generation"},prompts:{ppt:{quarterlyReview:"Review 【quarter】 business performance, highlighting metric gaps, causes, and recommended actions",projectUpdate:"Present the progress of 【project name】: milestones, risks, budget, and resource requests",solutionProposal:"Create a solution proposal for 【customer industry】: pain points, architecture, implementation plan, and benefits",industryAnalysis:"Analyze trends in 【industry topic】 and recommend strategic opportunities based on the competitive landscape"},image:{launchVisual:"Design a 【high-tech】 launch-event key visual for 【brand or product】",ecommercePoster:"Create an e-commerce poster for 【product name】 that highlights 【core selling point】 and brand colors",conceptRendering:"Create a photorealistic concept rendering of 【product or space】 in 【usage scenario】",socialGraphic:"Create a concise, professional corporate social graphic for 【campaign theme】"},video:{brandFilm:"Create a 30-second promotional video for 【brand name】 that highlights 【brand value】",productLaunch:"Create a 45-second launch video for 【product name】 covering the pain point, features, scenarios, and call to action",trainingVideo:"Create a corporate training video about 【training topic】 that clearly explains 【key procedure or policy】",eventTeaser:"Create a 20-second teaser for 【event name】 with highlights, time and location, and registration details"}},firstFrame:"First frame",videoToEdit:"Video to edit",baseVideo:"Base video",optimizeSkillPlaceholder:"Describe the skill you want to improve…",createSkillPlaceholder:"Describe the skill you want to create…",createVideoPlaceholder:"Describe the video you want to create…",messageAgentPlaceholder:"Message {{name}}…",selectAgentFirst:"Select an agent first",selectSkillFirst:"Select the Skill you want to improve first",availableSkills:"Available skills",availableSubagents:"Available sub-agents",invokeSkill:"Use a skill",useSubagent:"Use a sub-agent",loadingCapabilities:"Loading Agent capabilities…",noMatchingSkills:"No matching skills for this Agent",noMatchingSubagents:"No matching sub-agents for this Agent",skillFallbackDescription:"Load and run this skill",agentFallbackDescription:"Hand this turn to the Agent",skill:"Skill",uploadImage:"Upload image",uploadDocument:"Upload document or PDF",uploadVideo:"Upload video",taskMode:"Task mode",selectTaskMode:"Select a task mode",loadingGenerationModel:"Loading generation model",modelUnavailable:"Model unavailable",cancelTask:"Cancel {{task}} task",stopGenerating:"Stop generating",viewVideoProgress:"View video generation progress",send:"Send",selectTaskType:"Select a task type",enterprisePrompts:"{{task}} enterprise prompts",sessionId:"Session ID",sessionIdLabel:"Session ID: ",initializing:"Initializing",copied:"Copied",copySessionId:"Copy session ID",sessionIdCopied:"Session ID copied",disclaimer:"Responses may be inaccurate",viewLogs:"View logs"},Rze={selectAgent:"Select Agent",noLocalAgents:"No local Agents.",searchRuntime:"Search Runtime names",mineOnly:"Created by me",noRuntimes:"No Runtimes.",unsupported:"Unsupported",createdByMe:"Created by me",connecting:"Connecting…",connected:"Connected",connect:"Connect",viewInfoFor:"View information for {{name}}",viewInfo:"View information",agentAndRuntimeInfo:"Agent and Runtime information",detailType:"Detail type",agentInfo:"Agent information",runtimeInfo:"Runtime information",loadingAgentInfo:"Loading Agent information…",cannotLoadAgentInfo:"Agent information is temporarily unavailable",unnamedAgent:"Unnamed Agent",subagents:"Sub-agents",tools:"Tools",skills:"Skills",previewUnsupported:"Preview unavailable",mountedComponents:"Mounted components",noMoreAgentInfo:"No additional Agent configuration information.",local:"Local",model:"Model",status:"Status",memoryMb:"Memory {{value}} MB",instances:"Instances {{min}}–{{max}}",resources:"Resources",version:"Version",loadingDetails:"Loading details…",environmentVariables:"Environment variables",errors:{notFound:"This Runtime no longer exists or the list is out of date. Refresh the list and try again.",accessDenied:"This account cannot access the Runtime. Check its Project and access permissions.",previewUnsupported:"This Agent Server version does not support information previews.",unavailable:"This Runtime is temporarily unavailable. Confirm that its status is Ready and try again.",timeout:"Loading timed out. Try again."},componentKinds:{knowledgebase:"Knowledge base",memory:"Memory",prompt_manager:"Prompt manager",example_store:"Example store",run_processor:"Run processor",tracer:"Trace",toolset:"Toolset",plugin:"Plugin",other:"Other"},runtimeStatus:{ready:"Ready",unreleased:"Unreleased",running:"Running",active:"Running",creating:"Creating",pending:"Pending",deploying:"Deploying",updating:"Updating",failed:"Failed",error:"Error",stopping:"Stopping",stopped:"Stopped",deleting:"Deleting",deleted:"Deleted"}},Dze={agent:"Agents",agentTypes:{general:"General Agents",mpa:"MPA Agents",codex:"Codex","deepseek-harness":"DeepSeek",openclaw:"OpenClaw",hermes:"Hermes"},creator:"Created by",namedAgent:"{{name}} Agent",storageLocation:"Storage location",currentBrowser:"Current browser",region:"Region",viewDeploymentProgress:"View deployment progress for {{name}}",viewRuntimeDetails:"View Runtime details for {{name}}",viewDetails:"View details for {{name}}",time:"Time",remainingTime:"Time remaining",expiringSoon:"Expiring soon",sandboxRemaining:"{{hours}} hr {{minutes}} min",wakeable:"Asleep",neverExpires:"Never expires",editDraftNamed:"Edit draft {{name}}",viewProgress:"View progress",deleteDraftNamed:"Delete draft {{name}}",recheckCompatibility:"Check chat compatibility for {{name}} again",connectedNamed:"{{name}} is connected",wakeAndChat:"Wake {{name}} and start chatting",chatWith:"Chat with {{name}}",waking:"Waking…",deploying:"Deploying",draft:"Draft",checking:"Checking",chatUnsupported:"Chat unsupported",checkFailed:"Check failed",creatorFilter:"Creator filter",agentType:"Agent type",searchAgents:"Search Agents",handoff:"Handoff",agentList:"{{type}} list",noMatchingAgents:"No matching Agents",adjustSearch:"Try adjusting the search or filters",noAgentType:"No {{type}}",noGeneralAgents:"No General Agents",createGeneralAgentDescription:"Create a General Agent to start building and chatting",createAgentType:"Create {{type}}",createAgent:"Create Agent",loadingMore:"Loading more Agents",scrollForMore:"Scroll down to load more",allLoaded:"All Agents loaded",deleteDraftTitle:"Delete draft?",deleteDraftDescription:"“{{name}}” cannot be recovered after deletion.",deleteDraft:"Delete draft",loadGeneralAgents:"Load General Agents",loadAgentType:"Load {{type}}",compatibility:{checking:"Requesting Runtime /list-apps to confirm that this Agent supports Studio chat.",empty:"Runtime /list-apps returned no available Agents, so chat is currently unavailable.",supported:"This Runtime supports Studio chat.",unknownError:"The Runtime /list-apps request failed without a recognizable error."},sandboxStatus:{ready:"Ready",wakeable:"Asleep",creating:"Creating",starting:"Starting",initializing:"Starting",pending:"Pending",running:"Running",failed:"Error",error:"Error",stopped:"Stopped",expired:"Expired",deleting:"Deleting",deleted:"Deleted",unknown:"Unknown status"},wakingHint:"Waking the agent. This may take some time.",mpaCreate:{name:"Name",namePlaceholder:"e.g. test-agent",nameHelp:"Used as the Runtime name. Use 4–64 letters, numbers, underscores or hyphens.",stepsLabel:"Creation steps",steps:{basics:"Basics",postgres:"PostgreSQL",openviking:"OpenViking",autoPostgres:"Database"},next:"Next",previousStep:"Previous",pgDescription:"Choose an existing PostgreSQL instance. Creation prepares an isolated database for this agent on that instance.",pgSplitDescription:"Use the configured business PG Workspace. Agents share this Workspace, each with its own database. Shared resource records are stored separately in mpa_admin_workspace / mpa_admin_db, configured by the administrator.",pgConsole:"Create or inspect an AIDAP PG Workspace in Volcengine",pgHost:"PG host",pgPort:"PG port",pgInvalid:"Enter a valid PG host and port.",pgCredentials:"The deployment service provides the PG login and password; host and port must match its configuration.",openvikingDescription:"Optional. Enter all three fields to enable OpenViking, or leave all blank to omit OpenViking settings from the new agent.",openvikingConsole:"Inspect OpenViking resources in Volcengine",openvikingUrl:"OpenViking service URL",openvikingResourceId:"OpenViking resource ID",openvikingApiKey:"OpenViking API Key",openvikingInvalid:"Enter a valid HTTPS service URL, resource ID and API Key together, or leave all blank.",openvikingCredentials:"The API Key is used only for this creation and is not saved in browser drafts; re-enter it after a refresh.",tosTitle:"Session output storage",tosDescription:"Optional. Enter complete TOS credentials and a bucket to mount an isolated output directory for every Session. Leave all three blank to use the server defaults; TOS mounting is disabled if no defaults are configured.",tosAccessKey:"TOS Access Key",tosSecretKey:"TOS Secret Key",tosBucket:"TOS bucket",tosInvalid:"TOS Access Key, Secret Key, and bucket are all required together.",tosCredentials:"Credentials are used only for this creation and are not saved in browser recovery data or creation task records.",runtimeImage:"MPA image",workerImage:"Worker image",imageDefault:"Leave blank to use the configured image",imageInvalid:"Enter a valid container image reference without URLs, spaces or credentials.",title:"Create MPA agent",agentId:"Agent ID",description:"Description",region:"Deployment region",plan:"Creation plan",sharedResources:"Prepare or reuse the account VPC, subnets and APIG message gateway",agentResources:"Prepare an isolated database, Skill Space and worker, then deploy the agent",readiness:"Verify gateway and agent readiness before adding the agent to the list",checking:"Checking creation configuration…",configured:"Creation configuration is ready. Submission checks cloud resources and starts provisioning.",notConfigured:"Creation prerequisites are not configured. Ask an administrator to configure them, then retry.",loadFailed:"Could not check creation configuration. Please retry.",reload:"Check again",submit:"Start creation",retry:"Retry creation",newAgent:"Create another agent",newAgentDescription:"Create another agent opens an editable new request and replaces this recovery draft. It does not cancel the old task. If the old task is still running, wait for it to finish before submitting.",close:"Close",cancel:"Cancel creation",confirmCancel:"Confirm cancellation",cancelDescription:"Cancellation stops subsequent steps. Created databases, Skill Spaces, gateways and other registered resources are retained. Retry using the same agent ID.",background:"Creation continues after closing this window. Open it again to view progress.",pollFailed:"Progress is temporarily unavailable. Reconnecting; avoid creating another agent.",iamPermissionDenied:"The deployment service lacks IAM permissions to prepare the runtime role. Ask an administrator to grant access, then retry.",iamTrustConflict:"The runtime role trust is incompatible. Ask an administrator to check VeFaaS and APIG access, then retry.",iamPolicyConflict:"An existing runtime policy with the required name has conflicting contents. Ask an administrator to check it, then retry.",iamOwnershipConflict:"The runtime role does not belong to the deployment account. Ask an administrator to check it, then retry.",iamVerificationFailed:"Runtime role permissions could not be confirmed. Check IAM availability and policies, then retry.",iamConfigurationConflict:"Automatic runtime role preparation requires the default MPA role. Check the server creation configuration.",creationFailed:"This step failed. Check its resources, server configuration and permissions, then retry the same agent ID.",cancelFailed:"Cancellation failed. Check the current progress and retry.",cancelled:"Creation cancelled. Registered resources are retained for retry.",timeout:"Creation timed out. Registered resources are retained. Inspect them before retrying.",interrupted:"Creation was interrupted. Retry the same agent ID to recover registered resources.",skillSpace:"Skill Space",states:{running:"Creating",cancelling:"Cancelling",succeeded:"Created",failed:"Creation failed",cancelled:"Cancelled"},stages:{queued:"Queued",iam_role:"Prepare runtime role",checking:"Checking account and configuration",network:"Preparing VPC and subnets",gateway:"Preparing APIG and IM Gateway",database:"Preparing business database",skills:"Preparing Skill Space",worker:"Preparing worker",deploying:"Preparing database, skills and Runtime",verifying:"Waiting for agent readiness",admin_workspace:"Prepare management PG Workspace",business_workspace:"Prepare business PG Workspace",admin_database:"Initialize shared management database"},back:"Keep creating",pgAutoDescription:"VeADK uses its deployment account to create or reuse two PG Workspaces. mpa_admin_workspace / mpa_admin_db stores shared resource records; the business Workspace hosts an independent database for each agent. No PG connection input is needed. Preparation starts after submission.",pgModeChanged:"This submitted task uses previous PG settings and cannot be retried in automatic mode. Ask an administrator to reconcile its resources and task before starting a new creation.",pgMigrationRequired:"An existing shared registry is configured. Migrate its resource records to mpa_admin_workspace / mpa_admin_db and coordinate the registry URL cutover for existing Runtimes, then recheck this configuration."}},Lze={library:"Skill library",skill:"Skill",skills:"Skills",skillSpace:"Skill space",sandboxNotConfigured:"Dev Sandbox is not configured by an administrator",adminNotConfigured:"Not configured by an administrator",totalItems:"{{count}} items",cannotLoadSpaces:"Unable to load Skill spaces",someSpacesFailed:"Some Skill spaces failed to load",degradedRelationWarning:"Some relations are invalid. Readable skills have been restored.",downloadZip:"Download ZIP",optimize:"Optimize",closeSkillDetails:"Close Skill details",skillId:"Skill ID",allFiles:"All files",loadingSkillContent:"Loading Skill content…",noSkillContent:"This Skill has no SKILL.md content",addSkill:"Add Skill",localUpload:"Upload locally",localUploadDescription:"Select a ZIP file and upload it to the Skill space after validation",autoCreate:"Create automatically",autoCreateDescription:"Choose a model and style, then create a Skill through conversation",createSkill:"Create Skill",optimizeNamed:"Optimize {{name}}",deleteSkillConfirm:"Delete the entire Skill “{{name}}”? This affects every space that references it.",deleteSpaceConfirm:"Delete Skill space “{{name}}”? Make sure its Skills have been deleted first.",manageSpaceDescription:"Manage Skills in this space and create new versions",backToSpaces:"Back to Skill spaces",overview:"Overview",skillCount:"Skills",skillCountValue_one:"{{count}} Skill",skillCountValue_other:"{{count}} Skills",updatedAt:"Updated",skillsInSpace:"Skills in {{name}}",searchSkills:"Search Skills",cannotLoadSkills:"Unable to load Skills",noMatchingSkills:"No matching Skills",noSkills:"No Skills",tryAnotherName:"Try searching for another name",emptySkillsDescription:"Upload a Skill locally or create one automatically",actions:"Actions",spaceDetails:"Skill space details",editSpace:"Edit space",deleteSpace:"Delete space",searchSpaces:"Search Skill spaces",spaceList:"Skill space list",noMatchingSpaces:"No matching Skill spaces",createSpace:"Create Skill space",newSpace:"New space",loadingMoreSpaces:"Loading more Skill spaces",scrollForMore:"Scroll down to load more",allSpacesLoaded:"All Skill spaces loaded",errors:{loadSpaces:"Unable to load Skill spaces. Try again later.",loadSkills:"Unable to load Skills. Try again later.",loadSkillDetails:"Unable to load Skill details. Try again later.",deleteSkill:"Unable to delete the Skill",deleteSpace:"Unable to delete the Skill space",downloadSkill:"Unable to download the Skill"},status:{active:"Available",available:"Available",creating:"Creating",disabled:"Disabled",enabled:"Enabled",failed:"Error",inactive:"Inactive",pending:"Pending",published:"Published",ready:"Ready",released:"Published",running:"Running",success:"Healthy",unavailable:"Unavailable",unreleased:"Unreleased",updating:"Updating",unknown:"Unknown"},sharedSpace:"Enterprise shared space",sharedDescription:"Skills available to everyone, published and maintained by administrators",sharedVisibility:"Everyone",sharedPreparing:"Preparing shared space",sharedLoadFailed:"Shared space unavailable",sharedEmpty:"No shared skills yet. Skills published by administrators will appear here",requestPublication:"Request publication",reviewSubmitting:"Submitting…",reviewSubmitted:"Submitted",reviewFailed:"Could not submit the publication request",reviewStatusFailed:"Failed to load review status",reviewRetry:"Apply again",reviewPending:"Pending review",reviewApproving:"Publishing",reviewApproved:"Shared",reviewReturned:"Returned",reviewHistory:"Review history",skillDetailSections:"Skill detail sections",versions:{title:"Version management",refresh:"Refresh",uploading:"Uploading…",upload:"Upload new version",close:"Close",hint:"New versions become public after approval and do not replace published versions; the skill name in the ZIP must match the original",loading:"Loading versions…",loadFailed:"Unable to load versions",filesFailed:"Unable to load version files",uploadFailed:"Unable to upload the new version",submitFailed:"Unable to submit for review",retry:"Retry",empty:"No versions yet",current:"Current version",notSubmitted:"Not submitted",submitting:"Submitting…",submit:"Request publication",processing:"Version status: {{status}}",filesLoading:"Loading files…",filesEmpty:"No files",history:"Review history",shared:"Published"},author:"Author",authorName:"Author: {{name}}"},Mze={library:"Knowledge bases",createBase:"New knowledge base",editBase:"Edit knowledge base",invalidName:"The name must start with a letter and contain only letters, numbers, and underscores.",nameHelp:"Start with a letter. Use up to 48 letters, numbers, or underscores.",optionalDescription:"Description (optional)",descriptionOnly:"AgentKit currently supports updating only the knowledge base description.",previewWeb:"Preview web content",addData:"Add data",openOriginalWeb:"Open original page",backToEdit:"Back to edit",confirmAdd:"Confirm and add",source:"Knowledge source",image:"Image",documentFile:"Document file",webPage:"Web page",webUrl:"Web page URL",generatingWebPreview:"Fetching the page and generating a Markdown preview",selectFile:"Select knowledge file",selectOrDropFile:"Select a file or drag it here",selectedFile:"{{size}} · Click to select another file",imageFileHelp:"PNG, JPG, and JPEG up to 200 MB",documentFileHelp:"PDF, PPTX, DOCX, XLSX, and TXT up to 200 MB",uploadingFile:"Uploading the file and adding it to the knowledge base",optionalName:"Name (optional)",optionalType:"Type (optional)",generatePreview:"Generate preview",uploadFile:"Upload file",editMetadata:"Edit knowledge metadata",knowledge:"Knowledge item",field:"Field",value:"Value",backToList:"Back to knowledge bases",metadataJson:"Metadata (JSON)",provider:"Provider",knowledgeId:"Knowledge ID",project:"Project",creator:"Created by",data:"Data",deleteInvalidAssociation:"Delete invalid association",noData:"This knowledge base has no data",addFirstData:"Add the first data item",format:"Format",size:"Size",searchData:"Search data",searchLibraryData:"Search knowledge base data",associationInvalid:"Association invalid",providerMissing:"The underlying Provider knowledge base no longer exists",noMatchingData:"No matching data",loadingMoreData:"Loading more data",retryLoading:"Retry loading",details:"Knowledge base details",searchBases:"Search knowledge bases",someBasesFailed:"Some knowledge bases are temporarily unavailable. Other available content is shown.",noMatchingBases:"No matching knowledge bases",noManagePermission:"You do not have permission to manage this knowledge base",loadingMoreBases:"Loading more knowledge bases",deleteBaseTitle:"Delete knowledge base?",deleteBaseDescription:"This removes the AgentKit association for {{name}}. If Studio created it, the Provider resource is also deleted. This cannot be undone.",deleteDocumentTitle:"Delete knowledge item?",deleteDocumentDescription:"This removes {{name}} from the Provider knowledge base. This cannot be undone.",preview:{processingTitle:"Data is being processed",processingDetail:"A preview will be available after parsing. Reload later.",failedTitle:"Data parsing failed",failedDetail:"Check the source file or page URL and add it again, or reload the latest status.",noParsedTitle:"No parsed content is available yet",noParsedDetail:"Text, tables, or page images will appear after the knowledge base finishes parsing this file.",noMediaTitle:"No media preview is available yet",noMediaDetail:"The knowledge base has not returned an accessible media preview. Reload later.",noDataTitle:"No data is available to preview",noDataDetail:"The knowledge base has not returned parsed results. Reload later.",attachmentError:"The attachment cannot be previewed. Try again later.",imageAlt:"Knowledge data image",audioUnsupported:"This browser does not support audio previews.",videoUnsupported:"This browser does not support video previews.",namedPdf:"{{name}} PDF preview",pdf:"PDF preview",openPdf:"If it cannot be displayed, open the PDF in a new window",fileUnsupported:"This format cannot be previewed directly online. Parsed content is shown when available.",openOriginalFile:"Open original file",loading:"Loading data preview",openOriginalHint:"You can open the original page to view the source content.",chunk:"Chunk {{index}}",loadingMore:"Loading more",loadMore:"Load more"},errors:{fileTooLarge:"A file cannot exceed 200 MB",invalidImageType:"Select a PNG, JPG, or JPEG image",invalidDocumentType:"Select a PDF, PPTX, DOCX, XLSX, or TXT file",createBase:"Unable to create the knowledge base",updateBase:"Unable to update the knowledge base",metadataObject:"Metadata must be a JSON object",metadataFormat:"Invalid metadata format",noWebPreview:"The page has no Markdown content to preview",addWeb:"Unable to add the web page",previewWeb:"Unable to generate the web page preview",uploadFile:"Unable to upload the file",updateDocument:"Unable to update the knowledge item",loadPreview:"Unable to load the data preview",loadMoreBases:"Unable to load more knowledge bases",loadBases:"Unable to load knowledge bases",loadMoreData:"Unable to load more data",loadData:"Unable to load data",deleteBase:"Unable to delete the knowledge base",deleteDocument:"Unable to delete the knowledge item"}},Ize={title:"Feishu channel",refresh:"Refresh",loading:"Loading channel configuration…",unsupported:"This Runtime does not support channel management. Upgrade its MPA image.",unauthorized:"Channel management requires a Studio administrator and an authorized Runtime credential.",configurationError:"Channel management configuration is incomplete. Check the Runtime metadata and encryption key.",requestFailed:"Channel request failed. Check the Runtime connection and retry.",bound:"Bound: {{name}}",unbound:"No Feishu bot is bound.",guidance:"Private chats use separate conversations. In allowed groups, mention this bot to start a conversation.",keyRequired:"Configure a persistent CHANNEL_STATE_ENCRYPTION_KEY in the Runtime before binding.",gateway:"Message gateway",route:"Inbound route",delivery:"Reply delivery",configured:"Configured",missing:"Missing",delivery_not_observed:"Not observed",delivery_delivered:"Delivered",delivery_retrying:"Retrying",missingConfig:"Missing Runtime configuration: {{fields}}",bind:"Bind with QR code",newQr:"Generate a new QR code",unbind:"Unbind",confirmUnbind:"Disconnect this bot? It will stop receiving new messages.",qrAlt:"Bot authorization QR code",openQr:"Open authorization page",uncertain:"Registration was interrupted. Check the bot binding and Gateway before starting again.",bindingFailed:"Binding failed. Check Gateway configuration and retry.",chatId:"Allowed group ID",scope:"Group conversation scope",saveGroup:"Save group",noGroups:"No groups allowed yet. Private chats do not need this permission.",edit:"Edit",remove:"Remove",removeGroup:"Remove {{name}}",scope_group_sender:"Separate by sender",scope_group:"Shared by group",scope_group_topic_sender:"Separate by topic and sender",scope_group_topic:"Shared by topic",status_PENDING:"Waiting for scan",status_SCANNED:"Scanned; waiting for authorization",status_AUTHORIZED:"Authorized; preparing registration",status_REGISTERING:"Registering bot",status_BOUND:"Bot bound",status_FAILED:"Binding failed",status_EXPIRED:"QR code expired",workspaceTitle:"Message channels",workspaceDescription:"Connect messaging apps to this Agent and manage access.",provider_feishu:"Feishu",provider_wecom:"WeCom",provider_dingtalk:"DingTalk",comingSoon:"Not available yet",unavailableDescription:"Binding and message settings for {{name}} are not available yet.",runtimeRequired:"Deploy this Agent to a Runtime before configuring message channels.",bindingTitle:"Bot connection",connected:"Bound",notBound:"Not bound",gatewayDescription:"Gateway configuration for receiving channel messages.",routeDescription:"Routing configuration for delivering messages to this Agent.",deliveryDescription:"Observed reply delivery; configuration alone does not confirm delivery.",groupsTitle:"Group access",groupsDescription:"Allow specific groups and choose how conversations are shared.",providerBindingTitle:"Connect {{name}}",providerUnbound:"Connect a {{name}} bot to let users message this agent.",qrGuidance:"Authorize with {{name}}. The Runtime saves the bot credentials and configures the message gateway.",wecomGuidance:"Authorize with WeCom QR code, or enter a Bot ID and Secret to bind an existing bot.",wecomBotId:"Bot ID",wecomSecret:"Secret",bindCredentials:"Connect bot",wecomScan:"Bind with QR code",wecomAuthorizing:"Waiting for WeCom authorization…",cancelAuthorization:"Cancel authorization",wecomPopupBlocked:"Allow popups in your browser, then try authorizing again.",wecomAuthCancelled:"WeCom authorization was cancelled. You can scan again.",wecomAuthTimeout:"WeCom authorization timed out. Please scan again.",wecomInvalidResult:"Authorization did not return a Bot ID and Secret. Authorize again or enter them manually.",wecomAuthFailed:"WeCom authorization failed. Try again or enter credentials manually.",dingtalkClientId:"Client ID",dingtalkClientSecret:"Client Secret",manualUpgrade:"Upgrade this Runtime image to configure {{name}} manually. Quick setup is still available.",pairingTitle:"Message channel QR pairing",feishuPairingDescription:"If a bot is already connected, it will be replaced after successful Feishu authorization and binding. In the authorization flow, you can bind an existing bot or create a new one.",generatingQr:"Generating pairing QR code…",dingtalkGuidance:"Authorize with DingTalk QR code, or enter a Client ID and Client Secret to bind an existing bot.",wecomPairingDescription:"Pair again in the WeCom authorization window. The new bot replaces the current connection after binding succeeds. Cancelling authorization or a failed binding does not disconnect the existing bot.",configurationMethod:"Configuration method",quickSetup:"Quick setup",manualSetup:"Manual setup",feishuAppId:"App ID",feishuAppSecret:"App Secret",manualGuidance:"Enter the credentials of an existing {{name}} bot to connect it to this agent.",manualReplacement:"Successful binding replaces the current bot. Cancelling or a failed binding does not disconnect the existing bot."},gdr=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:fze,agentSelector:Rze,agentWorkspace:gze,channels:Ize,cloudEnvironment:xze,common:hze,composer:_ze,default:{common:hze,agentKitPromo:fze,systemInfo:pze,agentWorkspace:gze,environmentCenter:mze,deploymentSelect:vze,deploymentError:yze,studioBuildProgress:bze,cloudEnvironment:xze,githubCicd:wze,feishuDeployment:Aze,deploymentResources:Sze,studioUpdate:Tze,projectPreview:Cze,workspace:kze,resourceCollection:Oze,skillSourcePicker:Eze,composer:_ze,agentSelector:Rze,myAgents:Dze,skillCenter:Lze,knowledge:Mze,channels:Ize},deploymentError:yze,deploymentResources:Sze,deploymentSelect:vze,environmentCenter:mze,feishuDeployment:Aze,githubCicd:wze,knowledge:Mze,myAgents:Dze,projectPreview:Cze,resourceCollection:Oze,skillCenter:Lze,skillSourcePicker:Eze,studioBuildProgress:bze,studioUpdate:Tze,systemInfo:pze,workspace:kze},Symbol.toStringTag,{value:"Module"})),Pze="User management",Nze="{{count}} members",Bze="User",$ze="Role",Fze="Account status",zze="Last sign-in",Uze="Actions",Vze="Change role",Gze="Close",Qze="Save role",Hze="Saving…",Wze="Cancel",Yze="Back",qze="User pool",jze="Volcengine Identity",Xze="Search name, email or user ID",Kze="Search",Zze="Filter by role",Jze="All roles",eUe="Refresh",tUe="Loading users…",rUe="Updated at {{time}}",nUe="{{name}} is now {{role}}",iUe="Retry",aUe="You",oUe="Initial super administrator",sUe="The initial super administrator cannot be demoted here",lUe="The new permissions apply when the user refreshes Studio",cUe="Role needs confirmation",uUe="No matching users",dUe="Try another search or role",hUe="Users appear here after signing in or joining this user pool",fUe="{{count}} users",pUe="Previous",gUe="Next",mUe="Not signed in yet",vUe="Not provided",yUe={super_admin:"Super administrator",admin:"Administrator",developer:"Developer",user:"User"},bUe={super_admin:"Manage all resources, users and role assignments",admin:"Manage Studio resources",developer:"Develop agents and manage your own resources",user:"Use agents and personal features"},xUe={EXTERNAL_PROVIDER:"Active",CONFIRMED:"Active",NORMAL:"Active",ENABLED:"Active",ACTIVE:"Active",UNCONFIRMED:"Unverified",DISABLED:"Disabled",FORBIDDEN:"Disabled",LOCKED:"Locked",SUSPENDED:"Suspended",FORCE_CHANGE_PASSWORD:"Password change required"},wUe={request_failed:"The request did not finish. Refresh the list to confirm its current state before retrying",invalid_response:"The user service returned an invalid response. Refresh and try again",identity_unavailable:"Identity is unavailable. Try again later or check service permissions",identity_resource_missing:"The user or user pool no longer exists. Refresh the list",super_administrator_required:"Only super administrators can manage users",sign_in_required:"Sign in and try again",user_not_in_pool:"Your account does not belong to this user pool",user_disabled:"Your account is disabled",protected_administrator:"The initial super administrator cannot be demoted",cannot_demote_self:"You cannot demote your own super administrator role",role_change_conflict:"The role has changed. Close this dialog and refresh the list before retrying",cross_origin_request:"Change roles from the current Studio page"},mdr=Object.freeze(Object.defineProperty({__proto__:null,actions:Uze,allRoles:Jze,back:Yze,cancel:Wze,changeRole:Vze,close:Gze,default:{title:Pze,memberCount:Nze,user:Bze,role:$ze,status:Fze,lastLogin:zze,actions:Uze,changeRole:Vze,close:Gze,save:Qze,saving:Hze,cancel:Wze,back:Yze,pool:qze,volcengineIdentity:jze,searchPlaceholder:Xze,search:Kze,filterRole:Zze,allRoles:Jze,refresh:eUe,loading:tUe,updatedAt:rUe,saved:nUe,retry:iUe,you:aUe,initialAdministrator:oUe,protectedExplanation:sUe,effectiveAfterRefresh:lUe,roleConflict:cUe,noUsers:uUe,tryAnotherSearch:dUe,poolEmpty:hUe,resultCount:fUe,previous:pUe,next:gUe,neverLoggedIn:mUe,unknown:vUe,roles:yUe,descriptions:bUe,states:xUe,errors:wUe},descriptions:bUe,effectiveAfterRefresh:lUe,errors:wUe,filterRole:Zze,initialAdministrator:oUe,lastLogin:zze,loading:tUe,memberCount:Nze,neverLoggedIn:mUe,next:gUe,noUsers:uUe,pool:qze,poolEmpty:hUe,previous:pUe,protectedExplanation:sUe,refresh:eUe,resultCount:fUe,retry:iUe,role:$ze,roleConflict:cUe,roles:yUe,save:Qze,saved:nUe,saving:Hze,search:Kze,searchPlaceholder:Xze,states:xUe,status:Fze,title:Pze,tryAnotherSearch:dUe,unknown:vUe,updatedAt:rUe,user:Bze,volcengineIdentity:jze,you:aUe},Symbol.toStringTag,{value:"Module"})),AUe="Website integration",SUe="Embed an AgentKit Runtime on your website as a floating chat window",TUe="Back to automations",CUe="Add website",kUe="Loading Runtime",OUe="Select Runtime",EUe="Website domain",_Ue="For example, xxxx.com or localhost:5173",RUe="Generating",DUe="Generate token",LUe="Added websites",MUe="{{count}} website",IUe="{{count}} websites",PUe="Loading website integrations",NUe="No website integrations yet",BUe="Select a Runtime and enter a website domain to generate a token",$Ue="Embed instructions",FUe="Place this code before the closing body tag on your website",zUe="Copied",UUe="Copy code",VUe="Embed code will appear here after you add a website.",GUe="Delete the website integration for {{domain}}?",QUe={load:"Failed to load website integrations",create:"Failed to create website integration",delete:"Failed to delete website integration",noConversationalAgent:"No conversational Agent was found in this Runtime"},HUe={requestFailed:"Request failed ({{status}})",greeting:"Hello. How can I help?",sessionFailed:"Could not start a chat session",unauthorized:"This website is not authorized to start a chat",conversationFailed:"The chat request failed. Try again shortly.",open:"Open Agent chat",close:"Close Agent chat",panelLabel:"Agent chat panel",assistant:"Agent assistant",online:"Online"},vdr=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:CUe,addedWebsites:LUe,backToAutomations:TUe,confirmDelete:GUe,copied:zUe,copyCode:UUe,default:{title:AUe,description:SUe,backToAutomations:TUe,addWebsite:CUe,loadingRuntime:kUe,selectRuntime:OUe,websiteDomain:EUe,domainPlaceholder:_Ue,generating:RUe,generateToken:DUe,addedWebsites:LUe,websiteCount_one:MUe,websiteCount_other:IUe,loadingIntegrations:PUe,delete:"Delete",emptyTitle:NUe,emptyDescription:BUe,embedMethod:$Ue,embedInstructions:FUe,copied:zUe,copyCode:UUe,embedHint:VUe,confirmDelete:GUe,errors:QUe,widget:HUe},description:SUe,domainPlaceholder:_Ue,embedHint:VUe,embedInstructions:FUe,embedMethod:$Ue,emptyDescription:BUe,emptyTitle:NUe,errors:QUe,generateToken:DUe,generating:RUe,loadingIntegrations:PUe,loadingRuntime:kUe,selectRuntime:OUe,title:AUe,websiteCount_one:MUe,websiteCount_other:IUe,websiteDomain:EUe,widget:HUe},Symbol.toStringTag,{value:"Module"})),WUe={types:{all:"All types",document:"Documents",image:"Images",video:"Videos"},previewArtifact:"Preview {{name}}",moreActions:"More actions for {{name}}",actionMenu:"Actions for {{name}}",download:"Download",downloading:"Downloading",edit:"Edit details",delete:"Delete artifact",previewFailed:"Could not preview “{{name}}”: {{message}}",downloadStarted:"Download started for {{name}}",downloadFailed:"Could not download “{{name}}”: {{message}}",updated:"Updated {{name}}",deleted:"Deleted {{name}}",deleteFailed:"Could not delete “{{name}}”: {{message}}",typeFilter:"Artifact type",searchAria:"Search artifacts",searchPlaceholder:"Search artifacts or sessions",retry:"Retry",close:"Close",listAria:"Artifact list",loadFailed:"Could not load artifacts",loadDetailFallback:"Check the storage configuration and try again.",reload:"Reload",noMatch:"No matching artifacts",noArtifacts:"You do not have any artifacts yet",searchHint:"Try another search or artifact type",emptyHint:"Artifacts created in chats will appear here automatically",columns:{name:"Name",source:"Source",updatedAt:"Modified",actions:"Actions"},loadingMore:"Loading more artifacts",unknownTime:"Unknown time",preview:{close:"Close preview",meta:"{{type}} / Version {{version}}",loading:"Loading preview",alt:"Preview of {{name}}",loadFailed:"The preview could not be loaded. Try again later or download the file.",unsupported:"This format cannot be previewed online. Download the file to view it.",sourceAria:"Artifact source",agent:"Agent",session:"Session",tool:"Generated by",createdAt:"Created",fileSize:"File size",tags:"Tags",viewSession:"View session"},deleteDialog:{title:"Delete artifact?",description:"“{{name}}” will be permanently removed from the artifact library. The chat history will not be affected.",deleting:"Deleting",confirm:"Delete",close:"Close delete confirmation"},api:{withStatus:"{{message}} ({{status}})",listFailed:"Could not load the artifact library",syncFailed:"Could not sync chat artifacts",updateFailed:"Could not update the artifact",deleteFailed:"Could not delete the artifact",downloadFailed:"Could not download the artifact"}},YUe={unknownSource:"Unknown source",unknownCreator:"Unknown creator"},qUe={nameRequired:"Enter an artifact name",tooManyTags:"You can add up to {{max}} tags",tagTooLong:"Each tag can contain up to {{max}} characters",title:"Edit artifact details",subtitle:"The content file will not be modified",close:"Close edit dialog",name:"Name",description:"Description",descriptionPlaceholder:"Add its purpose, version, or usage notes",tags:"Tags",tagsPlaceholder:"Separate tags with commas, up to {{max}}",cancel:"Cancel",saving:"Saving",save:"Save"},jUe={change:{added:"Added",modified:"Modified",deleted:"Deleted"},noChanges:"There are no source changes between these versions",chooseFile:"Select a file on the left to view its code",compareTitle:"Compare versions",workspaceTitle:"Source workspace",projectFallback:"Agent project",switchTheme:"Switch source theme",switchThemeTitle:"Switch to {{theme}} theme",themes:{dark:"dark",light:"light"},closeWorkspace:"Close source workspace",close:"Close",changedFiles:"Changed files",projectFiles:"Project files",changes:"Changes",files:"Files",openFiles:"Open files",noFileSelected:"No file selected",comparisonDirection:"Comparison direction",before:"Before optimization",after:"After optimization",loadingEditor:"Loading editor…",changedFileCount_one:"{{count}} file changed",changedFileCount_other:"{{count}} files changed",fileCount_one:"{{count}} file",fileCount_other:"{{count}} files",lineCount_one:"{{count}} line · UTF-8",lineCount_other:"{{count}} lines · UTF-8",viewSource:"View source",viewSourceAria:"View and edit project source"},XUe={nav:"Search",selectAgent:"Select an Agent",checkingCapabilities:"Checking Agent capabilities",notMounted:"This Agent does not have {{label}} mounted",sources:{session:"Sessions",web:"Web",knowledge:"Knowledge base",memory:"Long-term memory"},webDescription:"Search with the web_search tool",backendLocal:"Local",failed:"Search failed: {{message}}",placeholder:{selectAgent:"Select an Agent first",web:"Search the web",knowledge:"Search {{name}}",knowledgeFallback:"this Agent's knowledge base",memory:"Search {{name}}",memoryFallback:"this user's long-term memory",session:"Search this Agent's sessions"},sourceTypeAria:"Search source: {{label}}",notSelected:"Not selected",sourceType:"Search source",selectSource:"Select a search source",noAgentHint:"Select an Agent to search its sessions, the web, and mounted data sources.",loadingCapabilities:"Loading this Agent's search capabilities…",sourceUnavailable:"This Agent does not have this data source mounted",instructions:{web:"Enter keywords and press Enter or select the button to search with web_search.",knowledge:"Enter a question to search this Agent's knowledge base.",memory:"Enter a clue to search long-term memories saved across this user's sessions.",session:"Enter keywords and press Enter or select the button to search this Agent's sessions."},noResults:"No results found for “{{query}}”.",knowledgeFragment:"Knowledge excerpt {{index}}",memoryFragment:"Memory excerpt {{index}}"},KUe={title:"Developer Resources",sections:{documentation:{title:"Related links",description:"Open development documentation and common AgentKit destinations"},bestPractices:{title:"Best practices",description:"Learn from practical development, debugging, and deployment guidance"},showcases:{title:"Showcases",description:"Explore applications built with AgentKit"}},links:{veadkDocs:"VeADK documentation",cliDocs:"AgentKit CLI documentation",platformDocs:"AgentKit platform documentation",console:"AgentKit console"},articles:{veadkDevelopment:{title:"Develop and deploy an Agent with VeADK",description:"Build an Agent with VeADK and deploy it to AgentKit Runtime."},cliDevelopment:{title:"Develop and deploy an Agent with AgentKit CLI",description:"Create a project, debug an Agent, and deploy it with AgentKit CLI."},coverAlt:"Cover image for {{title}}"},showcases:{researchAssistant:{title:"Multi-agent research assistant",description:"Specialized Agents work together to research, analyze, and summarize findings."},multimodalAnalysis:{title:"Multimodal content analysis",description:"Understand images, documents, and video in a single session."},customerService:{title:"Customer service workspace",description:"Combine knowledge retrieval and tool calls to handle complex support requests."},webSearch:{title:"Web search Agent",description:"Search current web content and organize it into traceable answers."},a2uiApp:{title:"A2UI interactive app",description:"Let an Agent generate interactive interfaces as it works through a task."},previewAlt:"Interface preview for {{title}}"}},ZUe={title:"Library",untitledSession:"Untitled session",categoryAria:"Library categories",regionAria:"Region",tabs:{skills:"Skills",knowledge:"Knowledge",artifacts:"Artifacts"}},JUe={title:"Manage Agents",subtitle:"Agents in AgentKit Runtime that you can manage",mainAgentOnly:"Only the main Agent is shown (control-plane information).",deleteConfirm:'Delete Agent "{{name}}"? Its Runtime will be permanently deleted.',regionFilterTitle:"Filter by region",regionFilterAria:"Region filter",regionAria:"Region",refresh:"Refresh",loading:"Loading…",empty:"You have not deployed any Agents.",connected:"Connected",connect:"Connect to this Agent",deleteRuntime:"Delete this Runtime",loadingDetail:"Loading details…",agentStructure:"Agent structure",secretHidden:"Sensitive value is never shown. Copy it with an authorized request.",revealSecret:"Sensitive value for {{key}}",copySecret:"Copy the value of {{key}}",copy:"Copy",copied:"Copied",copyFailed:"Copy failed",notConfigured:"Not configured",fields:{model:"Model",description:"Description",status:"Status details",project:"Project",version:"Version",resources:"Resources",memory:"Memory",tool:"Tool",knowledge:"Knowledge",mcpToolset:"MCP Toolset",updatedAt:"Updated"},resource:{memory:"Memory {{value}} MB",instances:"Instances {{min}}-{{max}}",concurrency:"Concurrency {{value}}"},environmentVariables:"Environment variables",unnamed:"(Unnamed)"},eVe={mainAgent:"Main Agent",subAgent:"Sub-agent {{index}}",itemCount_one:"{{count}} item",itemCount_other:"{{count}} items",info:"Agent information",infoAndTopology:"Agent information and settings",loadingInfo:"Loading Agent information…",unnamedAgent:"Unnamed Agent",agentsMd:"AGENTS.md",tools:"Tools",toolList:"Tool list",studioTool:"Studio Tool",removeTool:"Remove tool {{name}}",remove:"Remove",notConfigured:"Not configured",addStudioTool:"Add Studio tools",addStudioToolHere:"Add Studio tools to this chat",skills:"Skills",skillList:"Skill list",addSkill:"Add Skill Space skills",addSkillHere:"Add Skill Space skills to this Session",skillMountNextTurn:"Mounted versions are frozen when the next Turn starts.",previewUnsupported:"Preview is not supported",sessionEnvironment:"Session environment",environment:"Environment",agentCanvas:"Agent canvas",topology:"Structure",nodeKinds:{agent:"Agent",sandbox:"Sandbox","worker-session":"Worker Session","skill-space":"Skill Space",skill:"Skill","studio-tool":"Studio Tool",mcp:"MCP",environment:"Environment",knowledge:"Knowledge","sub-agent":"Sub-agent"},nodeStatuses:{configured:"Configured",mounted:"Mounted",running:"Running",paused:"Paused"},viewCanvasFullscreen:"View Agent canvas in full screen",viewFullscreen:"View full screen",executionCanvas:"Agent execution canvas",fullscreenExecutionCanvas:"Full-screen Agent execution canvas",closeFullscreenCanvas:"Close full-screen canvas",close:"Close",capabilitiesSubtitle:"Capabilities and collaboration topology",closeInfo:"Close Agent information",infoUnavailable:"Agent information is temporarily unavailable.",refresh:"Refresh information",loadingSkills:"Loading bound skills…",sessionSkills:"Temporary session skills",noBoundSpace:"This agent has no bound Skill Space.",noBoundSkills:"The bound Skill Space has no skills.",loadFailed:"Could not load this information. Refresh to retry.",accessDenied:"You do not have permission to read this information.",documentUnsupported:"Upgrade the Runtime image to enable Studio to read AGENTS.md.",skillsUnsupported:"This Runtime does not provide Skill Space bindings.",skillsDegraded:"Skill information is incomplete. Refresh to retry.",documentEditHint:"Edit the latest version. Saving publishes a new version to this Skill Space and can affect other agents using it. Running sessions may need a cache refresh or a new session. Keep the frontmatter name unchanged.",documentLoading:"Loading SKILL.md…",documentWritable:"Editable",documentReadOnly:"Read only — this space or your permissions do not allow editing",documentLoadFailed:"Could not load SKILL.md. Refresh to retry.",documentSaveFailed:"Save was not confirmed. Your edits are preserved. Reopen to check the current version before retrying.",documentConflict:"A newer version exists. Copy your edits, then reopen the editor to avoid overwriting it.",discardDocument:"Discard unsaved changes?",keepEditing:"Keep editing",discardChanges:"Discard changes",saveDocument:"Save new version"},tVe={mountFailed:"Could not mount the environment",closeDialog:"Close environment dialog",addTitle:"Add environments",description:"Choose the Sandbox environments this Agent can use in the current session",closeAdd:"Close Add environments",searchAria:"Search environments",searchPlaceholder:"Search environment names or capabilities",availableAria:"Available environments and workspaces",loading:"Loading available environments…",noMatch:"No matching environments or workspaces",workspaces:"Workspaces",reuseAll:"Use every available environment in this workspace",availableEnvironmentCount_one:"{{count}} available environment",availableEnvironmentCount_other:"{{count}} available environments",selectWorkspace:"Select workspace {{name}}",environments:"Environments",includedByWorkspaces:"Included by workspace {{names}}",nameSeparator:", ",selectEnvironment:"Select environment {{name}}",selectedWorkspaceCount_one:"{{count}} workspace selected",selectedWorkspaceCount_other:"{{count}} workspaces selected",coveredEnvironmentCount_one:"{{count}} environment covered",coveredEnvironmentCount_other:"{{count}} environments covered",selectionSummary:"{{workspaces}}, {{environments}}",cancel:"Cancel",mounting:"Mounting…",confirm:"Add selected",mountedAria:"Mounted environments",environmentCount_one:"{{count}} environment",environmentCount_other:"{{count}} environments",removeWorkspace:"Remove workspace {{name}}",remove:"Remove",removeEnvironment:"Remove environment {{name}}",add:"Add environments",addMore:"Add more environments",addForSession:"Add environments to this session",loadingAvailable:"Loading available environments…",empty:"No AIO Sandbox environments are available."},rVe={loading:{searching:"Looking for an existing environment",creating:"Initializing environment",connecting:"Connecting to the environment"},initializationFailed:"AgentKit CLI environment initialization failed. Current status: {{status}}.",sessionExpired:"The AgentKit CLI session does not exist or has expired. Try again.",initializationTimeout:"AgentKit CLI environment initialization timed out. Try again later.",nonPersistent:"Non-persistent environment",recyclingHoursMinutes:"Environment reclaimed in {{hours}} hr {{minutes}} min",recyclingMinutes:"Environment reclaimed in {{minutes}} min",connectionError:`Could not connect to the Studio service because the server did not respond. Original error: {{message}}`,unavailable:"Connection unavailable",requestFailed:"AgentKit CLI request failed",retry:"Retry",terminalTitle:"AgentKit CLI terminal"},nVe={labels:{coding:"Coding",get_city_weather:"City weather",get_location_weather:"Location weather",web_fetch:"Fetch web content",studio_write_artifact:"Save session artifact"},closeDialog:"Close dialog",title:"Add Studio tools",description:"Studio BFF runs these tools for {{agentName}} in the current session. No Runtime installation is required.",close:"Close Add Studio tools",searchAria:"Search Studio tools",searchPlaceholder:"Search by name or tool ID",availableAria:"Available Studio tools",loading:"Loading Studio tools…",noMatch:"No matching Studio tools",remove:"Remove",add:"Add"},iVe={artifactLibrary:WUe,resourceMetadata:YUe,artifactEdit:qUe,codeBrowser:jUe,search:XUe,developerResources:KUe,library:ZUe,manageAgents:JUe,agentTopology:eVe,sessionEnvironment:tVe,agentKitCli:rVe,studioTools:nVe},ydr=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:rVe,agentTopology:eVe,artifactEdit:qUe,artifactLibrary:WUe,codeBrowser:jUe,default:iVe,developerResources:KUe,library:ZUe,manageAgents:JUe,resourceMetadata:YUe,search:XUe,sessionEnvironment:tVe,studioTools:nVe},Symbol.toStringTag,{value:"Module"})),aVe={requestFailed:"请求失败 ({{status}})",unknownError:"未知错误",contentTypeMissing:"Content-Type 缺失",response:"响应:{{response}}",fallbackWithDetail:"{{fallback}}:{{detail}}",fallbackWithHttpStatus:"{{fallback}}(HTTP {{status}})",nonJsonResponse:"{{fallback}}:服务端返回非 JSON 响应({{contentType}})"},oVe={unconfigured:"管理员未配置 AgentKit Dev Sandbox,请配置后再使用",invalidSession:"AgentKit CLI 返回了无效的 Session。",loadCapabilitiesFailed:"无法读取 AgentKit CLI 配置。",invalidCapabilities:"AgentKit CLI 返回了无效的配置状态。",listSessionsFailed:"无法读取 AgentKit CLI Session。",invalidSessionList:"AgentKit CLI 返回了无效的 Session 列表。",createSessionFailed:"无法创建 AgentKit CLI Session。",openSessionFailed:"无法打开 AgentKit CLI Session。",openTerminalFailed:"无法打开 AgentKit CLI 终端。",invalidTerminalUrl:"AgentKit CLI 返回了无效的终端地址。"},sVe={cnBeijing:"华北 2(北京)",cnShanghai:"华东 2(上海)"},lVe={runtimeUnsupported:"该 Runtime 暂不支持连接,请确认服务已正常运行。"},cVe={autoConfigureFailed:"飞书机器人自动配置失败"},uVe={actionFailed:"{{action}}失败",detail:"详细信息:{{detail}}",request:"请求:{{request}}"},dVe={persistentMemoryHint:"提示:会话已不存在。使用 in-memory 或 SQLite 短期记忆时,多实例、进程重启或滚动发布都可能导致会话丢失;建议改用基于数据库的持久化短期记忆存储。",unsupportedRouteHint:"提示:该 Runtime 未提供会话能力运行接口,可能是 Runtime 版本与当前 Studio 不兼容。",toolArgumentHint:"提示:模型生成的工具参数格式不完整,请重新发送一次。",resourceCollectionExpiredHint:"提示:本次资源清单已失效,请重新发送任务;系统会重新收集资源后再创建 Agent。",networkConfigurationHint:"提示:请稍后重试,查看 Runtime、模型或网关日志。",modelQuotaHint:"提示:模型当前触发了 TPM/RPM 配额限制,请稍后重试或提高模型配额。",rawResponseLabel:"原始响应:",copySecretFailed:"复制敏感值失败"},hVe={httpStatus:"HTTP 状态码:{{status}}",errorCode:"错误码:{{code}}",cloudResponseBody:`云端响应正文: {{body}}`,loadFailedWithDetail:"读取实例日志失败:{{detail}}",invalidFormat:"读取实例日志失败:服务返回格式无效"},fVe={untitledSession:"未命名会话",webUnavailable:"网络搜索接口未就绪(后端未启用 /web/search)。",webFailed:"网络搜索失败:{{message}}",webNotMounted:"当前 Agent 未挂载 web_search 工具。",knowledgeNotMounted:"该 Agent 未挂载知识库。",memoryNotMounted:"该 Agent 未挂载长期记忆。",knowledge:"知识库",longTermMemory:"长期记忆"},pVe={listSpacesFailed:"读取 Skill 空间失败",createSpaceFailed:"创建 Skill 空间失败",updateSpaceFailed:"更新 Skill 空间失败",deleteSpaceFailed:"删除 Skill 空间失败",uploadFailed:"上传 Skill 失败",validateFailed:"校验 Skill 失败",deleteFailed:"删除 Skill 失败",listFilesFailed:"读取 Skill 文件失败",downloadFailed:"下载 Skill 失败",sharedSpaceFailed:"共享空间加载失败",reservedSpaceName:"此名称由系统空间保留,请使用其他名称",reviewSpaceFailed:"待审核空间暂不可用",submitReviewFailed:"申请公开失败",listReviewsFailed:"加载审核申请失败",reviewFilesFailed:"加载提交文件失败",decideReviewFailed:"审批失败,请重试",listVersionsFailed:"无法加载技能版本",uploadVersionFailed:"上传技能新版本失败"},gVe={truncatedData:"{{data}}…(已截断,共 {{count}} 个字符)",incompleteEvent:"SSE 流在事件完整返回前已结束。原始数据:{{data}}",invalidEventJson:"无法解析 SSE 事件中的 JSON。原始数据:{{data}}"},mVe={loadConfigNetworkFailed:"无法加载登录配置,请检查网络后重试。",configServiceFailed:"登录配置服务异常(HTTP {{status}}),请稍后重试。",invalidConfigResponse:"登录配置服务返回了无法解析的响应,请稍后重试。",serviceNetworkFailed:"无法连接身份服务,请检查网络后重试。",invalidServiceResponse:"身份服务返回了无法解析的响应,请稍后重试。",serviceFailed:"身份服务异常(HTTP {{status}}),请稍后重试。"},vVe={invalidToken:"GitHub Token 无效或没有仓库写入权限",notFound:"仓库、分支或文件不存在,或 Token 无权访问",rejectedCommit:"GitHub 拒绝了提交,请检查分支和文件状态",requestFailed:"GitHub 请求失败(HTTP {{status}})",networkFailed:"连接 GitHub 失败,请检查网络后重试",invalidRepositoryFormat:"GitHub Repo 格式应为 owner/repository",insecureRepositoryUrl:"仅支持安全的 github.com 仓库地址",unsafeProjectPath:"Agent 项目目录必须是仓库内的安全相对路径",tokenRequired:"GitHub Token 不能为空",invalidBaseBranch:"目标分支格式不正确",invalidPublishBranch:"发布分支格式不正确",noFiles:"没有需要提交的文件",missingBaseSha:"目标分支缺少有效 Git SHA",fileAlreadyExists:"目标仓库中已存在 {{path}},未覆盖现有文件",pathNotUpdatable:"目标路径 {{path}} 不是可更新的文件",invalidPullRequest:"GitHub 未返回有效的 Pull Request"},yVe={loadCapabilitiesFailed:"加载视频模型能力失败",uploadAssetFailed:"上传{{fileName}}失败",enhancePromptFailed:"提示词优化失败",createTaskFailed:"创建视频生成任务失败",getTaskFailed:"查询视频生成任务失败",downloadFailed:"下载生成视频失败"},bVe={listFailed:"加载网站集成失败",createFailed:"创建网站集成失败",deleteFailed:"删除网站集成失败"},xVe={loadFailed:"读取知识库失败",htmlHidden:"[HTML 内容已隐藏]",redacted:"[已脱敏]",depthTruncated:"[内容过深,已截断]",circularReference:"[循环引用]",diagnosticsUnavailable:"[诊断信息无法显示]",statusCode:"状态码:{{status}}",errorCode:"错误码:{{code}}",requestId:"请求 ID:{{requestId}}",diagnostics:"诊断:{{diagnostics}}",detail:"详情:{{detail}}",signInRequired:"请先登录后再访问知识库",forbidden:"你没有权限操作这个知识库",notFound:"知识库或知识内容不存在",conflict:"知识库当前状态不允许执行此操作",requestFailed:"知识库请求失败 ({{status}})"},wVe={invalidName:"名称须为 1~128 个字符,不能包含控制字符、不可见格式字符或 < >。",renameProjectFailed:"修改项目名称失败",renameVersionFailed:"修改版本名称失败",invalidNameUpdateResponse:"名称更新响应与请求不一致,请刷新后重试。",invalidSourceSnapshot:"源码快照的响应格式无效。",invalidProjectList:"项目列表的响应格式无效。",invalidProjectVersion:"项目版本的响应格式无效。",loadProjectsFailed:"无法读取已保存项目",loadVersionsFailed:"无法读取项目版本",deleteVersionFailed:"删除项目版本失败",invalidDeleteVersionResponse:"删除项目版本的响应格式无效。",loadProjectSourceFailed:"无法读取项目源码",loadSnapshotFailed:"无法读取源码快照",restoreSnapshotFailed:"无法恢复当前源码快照",downloadSourceFailed:"下载源码失败",downloadNotZip:"源码下载响应不是 ZIP 文件。",downloadSizeMismatch:"源码压缩包大小与发布记录不一致,请重试。"},AVe={invalidFormat:"{{label}}格式错误。",validationSeparator:";",invalidAnalysisResult:"迁移分析结果格式错误。",invalidFrameworkCandidate:"框架候选格式错误。",invalidAnalysisEvidence:"分析证据格式错误。",invalidEntryCandidate:"入口候选格式错误。",invalidQuestion:"待确认问题格式错误。",invalidPendingInput:"分析问题无法读取",invalidTask:"迁移会话格式错误。",invalidAnalysisReference:"分析结果引用格式错误。",invalidSourcePersistence:"迁移源码保存状态格式错误。",invalidActivity:"迁移执行动态格式错误。",invalidActivityItem:"迁移执行动态项格式错误。",invalidActivityTool:"迁移执行工具项格式错误。",invalidActivityPlan:"迁移执行计划格式错误。",invalidActivityPlanItem:"迁移执行计划项格式错误。",invalidArtifact:"迁移产物格式错误。",invalidEnvironmentDefaults:"环境变量默认值格式错误。",invalidArtifactFile:"迁移产物文件格式错误。",invalidVerificationCheck:"迁移校验项格式错误。",requestValidationFailed:"请求参数校验失败:{{detail}}",gatewayError:"{{fallback}}(HTTP {{status}},Content-Type: {{contentType}})。请检查代理或网关配置。",nonJsonResponse:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}})。请检查代理或网关配置。",loadCapabilitiesFailed:"读取迁移能力失败",invalidCapabilities:"迁移能力格式错误。",invalidModelCapabilities:"迁移模型能力格式错误。",loadTasksFailed:"读取迁移会话失败",invalidTaskList:"迁移会话列表格式错误。",createTaskFailed:"创建迁移会话失败",uploadProjectFailed:"上传迁移项目失败",loadActivityFailed:"读取迁移执行动态失败",loadEventsFailed:"订阅迁移进度流失败",invalidEventsResponse:"迁移进度流返回了非法数据帧。",reconnecting:"连接已断开,正在重新连接迁移进度流…",startFailed:"启动迁移失败",submitAnswersFailed:"提交分析补充信息失败",submitInputFailed:"提交分析回答失败",stopFailed:"终止迁移失败",deleteTaskFailed:"删除迁移会话失败",loadArtifactFailed:"读取迁移产物失败",loadArtifactFileFailed:"读取迁移产物文件失败",downloadArtifactFailed:"下载迁移产物失败",evaluation:{datasetSaveFailed:"保存评测用例失败",datasetLoadFailed:"读取评测用例失败",statusLoadFailed:"读取评测状态失败",resumeFailed:"继续评测失败",retryFailed:"重新评测失败",reportLoadFailed:"读取评测报告失败",reportDownloadFailed:"下载评测报告失败"},labels:{analysisResult:"迁移分析结果",recommendation:"迁移建议",boundary:"迁移边界",frameworkCandidate:"框架候选",analysisEvidence:"分析证据",recommendedFramework:"推荐框架",entryCandidate:"入口候选",entryFramework:"入口框架",includeScope:"迁移包含范围",excludeScope:"迁移排除范围",assumptions:"分析假设",question:"待确认问题",analysisWarnings:"迁移警告",task:"迁移会话",artifactStatus:"迁移产物状态",analysisReference:"分析结果引用",confirmation:"迁移确认",confirmedFramework:"确认框架",error:"迁移错误",sourcePersistence:"迁移源码保存状态",activity:"迁移执行动态",activityItem:"迁移执行动态项",activityTool:"迁移执行工具项",activityPlanItem:"迁移执行计划项",artifact:"迁移产物",cli:"CLI 信息",migration:"迁移信息",startup:"启动信息",environment:"环境变量信息",verification:"校验信息",report:"迁移报告",archive:"产物归档",environmentDefaults:"环境变量默认值",requiredEnvironment:"必需环境变量",optionalEnvironment:"可选环境变量",artifactFile:"迁移产物文件",verificationCheck:"迁移校验项",artifactWarnings:"迁移产物警告",errorResponse:"错误响应",errorDetail:"错误详情",capabilities:"迁移能力",framework:"迁移框架",modelCapabilities:"迁移模型能力",taskList:"迁移会话列表",evaluationAsset:"评测资产",evaluation:"评测状态",evaluationCapabilities:"评测能力",evaluationDimension:"评测维度",evaluationCase:"评测用例",evaluationCriteria:"评测标准",evaluationMessage:"评测对话",evaluationDataset:"评测数据集",evaluationDimensionResult:"评测维度结果",evaluationEvidence:"评测证据",evaluationReport:"评测报告",evaluationSummary:"评测汇总",evaluationCaseResult:"评测用例结果",evaluationOutput:"评测输出",evaluationLimitations:"评测限制",pendingInput:"分析提问",pendingQuestion:"分析问题项",pendingOption:"分析问题选项"}},SVe={status:{ready:"就绪",wakeable:"已休眠",creating:"创建中",starting:"启动中",pending:"等待中",running:"运行中",failed:"异常",stopped:"已停止",expired:"已过期",deleting:"删除中",deleted:"已删除",unknown:"未知状态"},developmentTimeout:"等待开发环境响应超时。任务可能仍在运行,请稍后重新进入当前会话查看状态。",developmentDisconnected:"与开发环境的连接已中断。任务可能仍在运行,请稍后重新进入当前会话查看状态。",developmentFailed:"开发任务未能继续,开发环境已保留。请在当前会话重试。",invalidStudioResponse:"{{fallback}} Studio 服务响应异常,请刷新后重试。",invalidSession:"AgentKit 沙箱返回了无效的 Session 信息。",invalidSnapshot:"AgentKit 沙箱返回了无效的 Snapshot 信息。",invalidSettings:"Sandbox 返回了无效设置。",invalidThreadSnapshot:"Sandbox 返回了无效 Thread 快照。",emptyConversationResponse:"沙箱对话服务未返回内容。",invalidConversationResponse:"沙箱对话服务返回了无法解析的响应。",conversationFailed:"沙箱对话失败,请稍后重试。",emptyReply:"沙箱未返回有效回复,请重试。",missingSession:"缺少要操作的 AgentKit Session。",listCodexFailed:"无法读取 Codex 智能体,请稍后重试。",invalidSessionList:"AgentKit 沙箱返回了无效的 Session 列表。",invalidSnapshotList:"AgentKit 沙箱返回了无效的 Snapshot 列表。",startFailed:"无法启动 AgentKit 沙箱,请稍后重试。",listAgentFailed:"无法读取 {{kind}} 智能体,请稍后重试。",invalidKindSessionList:"AgentKit 返回了无效的 {{kind}} Session 列表。",invalidKindSnapshotList:"AgentKit 返回了无效的 {{kind}} Snapshot 列表。",createAgentFailed:"无法创建 {{kind}} 智能体,请稍后重试。",missingSessionToOpen:"缺少要打开的 AgentKit Session。",openAgentFailed:"无法打开 {{kind}} 智能体。",invalidAgentHomeUrl:"{{kind}} 智能体返回了无效的主页面地址。",missingSessionForTerminal:"缺少要打开 Terminal 的 AgentKit Session。",openTerminalFailed:"无法打开 {{kind}} Terminal。",deleteAgentFailed:"无法删除 {{kind}} 智能体。",missingSnapshot:"未找到要唤醒的智能体。",resumeSnapshotFailed:"无法唤醒智能体,请稍后重试。",deleteSnapshotFailed:"无法删除智能体,请稍后重试。",missingSessionToConnect:"缺少要连接的 AgentKit Session。",connectCodexFailed:"无法连接 Codex 智能体,请稍后重试。",sessionNotReady:"AgentKit Session 尚未就绪,当前状态:{{status}}。",invalidMessage:"内置智能体会话缺少有效的消息内容。",interruptFailed:"无法停止当前任务。",getStatusFailed:"无法读取 Codex 状态。",getEndpointFailed:"无法读取 Sandbox Endpoint。",invalidEndpoint:"Sandbox 返回了无效 Endpoint。",createHandoffPairingFailed:"无法生成 Codex 云端接力配对码。",invalidHandoffPairing:"Studio 返回了无效的 Codex 云端接力配对码。",getHandoffStatusFailed:"无法读取端云接力状态。",invalidHandoffStatus:"Studio 返回了无效的端云接力状态。",listModelsFailed:"无法读取 Codex 模型列表。",invalidModelList:"Sandbox 返回了无效模型列表。",setModelFailed:"无法切换 Codex 模型。",invalidModel:"Sandbox 返回了无效模型。",listSkillsFailed:"无法读取 Codex Skills。",invalidSkillList:"Sandbox 返回了无效 Skill 列表。",listThreadsFailed:"无法读取 Codex Thread 列表。",invalidThreadList:"Sandbox 返回了无效 Thread 列表。",createThreadFailed:"无法创建新的 Codex Thread。",missingThread:"缺少要读取的 Codex Thread。",readThreadFailed:"无法读取 Codex 历史消息。",resumeThreadFailed:"无法恢复 Codex Thread。",forkThreadFailed:"无法分叉 Codex Thread。",archiveThreadFailed:"无法归档 Codex Thread。",invalidArchiveResult:"Sandbox 返回了无效归档结果。",deleteThreadFailed:"无法删除 Codex Thread。",invalidDeleteResult:"Sandbox 返回了无效删除结果。",compactThreadFailed:"无法压缩 Codex Thread。",getSettingsFailed:"无法读取 Codex 权限与工作空间。",updatePermissionsFailed:"无法更新 Codex 权限。",updateWorkspaceFailed:"无法更新 Codex 工作空间。",invalidWorkingDirectory:"Sandbox 返回了无效工作目录。",listDirectoriesFailed:"无法读取 Sandbox 目录。",invalidDirectoryList:"Sandbox 返回了无效目录列表。",resolveApprovalFailed:"无法提交 Codex 审批决定。",uploadFileFailed:"无法上传文件到 Sandbox。",invalidUploadResult:"Sandbox 返回了无效上传结果。",disconnectCodexFailed:"无法断开 Codex 智能体连接。",deleteCodexFailed:"无法删除 Codex 智能体。",openSandboxTerminalFailed:"无法打开 Sandbox Terminal。",openSandboxBrowserFailed:"无法打开 Sandbox Browser。",toolLabel:"Sandbox 工具",invalidToolUrl:"{{label}} 返回了无效地址。",unsafeToolUrl:"{{label}} 返回了不安全的地址。"},TVe={invalidSandboxVersion:"沙箱版本响应格式无效",loadSandboxVersionsFailed:"查询沙箱版本失败",updateSandboxFailed:"更新 Sandbox 失败",invalidSandboxUpdate:"沙箱更新响应格式无效",errorWithDetailAndRawResponse:`{{context}} {{detail}} @@ -91,7 +91,7 @@ Original error: {{message}}`,unavailable:"Connection unavailable",requestFailed: Studio:{{studioUrl}} 配对码:{{pairingCode}}`,installPrompt:`请安装 AgentKit Studio Plugin。请直接执行以下安装命令,不要让我手动打开终端。 安装命令:{{command}}`,title:"接力到云端继续执行",description:"按顺序复制两段提示词,Codex 会通过插件将您的本地任务接力到云端",closeAria:"关闭本地迁移引导",installTitle:"安装插件",installDescription:"首次使用时,请选择一种安装方式。",copied:"已复制",copyInstallPrompt:"复制安装提示词",copyInstallCommand:"复制安装命令",installMethodAria:"插件安装方式",conversationInstall:"与 Codex 对话安装",terminalInstall:"从终端安装",taskTitle:"任务接力",taskDescription:"插件安装完成后复制,Codex 会迁移当前项目并继续执行任务。",copyHandoffPrompt:"复制接力提示词",generatingPairing:"正在生成新的配对码",pairingExpired:"配对码已过期",pairingRemaining:"配对码有效期剩余 {{countdown}}",refreshing:"刷新中",refreshPairing:"刷新配对码",pairingLoading:"正在生成配对码",pairingUnavailable:"配对码尚未生成。",statusAria:"端云接力状态",statusTitle:"接力状态",requestReceivedNamed:"已收到“{{name}}”的端云接力请求",requestReceivedCurrent:"已收到当前项目的端云接力请求",requestHelp:"复制接力提示词后,Codex 的请求会显示在这里。",entering:"正在进入",enterCodex:"进入 Codex",clipboardUnsupported:"当前浏览器不支持写入剪贴板。",steps:{request:"等待端侧请求",session:"创建云端 Session",restore:"恢复项目",continue:"发送续跑任务"},status:{issued:"等待请求",creating:"正在创建 Session",sessionCreated:"正在迁移项目",continuing:"正在启动云端任务",running:"云端执行中",completed:"接力完成",failed:"接力失败"}},ZWe={model:{description:"显示或切换当前对话模型",keywords:"模型 switch"},models:{description:"列出 app-server 可用模型",keywords:"模型列表 list"},skill:{description:"浏览并调用当前工作区可用的 Skill",keywords:"技能 workflow"},skills:{description:"浏览并调用当前工作区可用的 Skills",keywords:"技能列表 workflow list"},new:{description:"开始一个新对话",keywords:"新建 对话"},resume:{description:"打开历史会话或恢复指定 Thread",keywords:"历史 恢复 session"},fork:{description:"从当前上下文分叉一个新对话",keywords:"分叉 branch"},compact:{description:"压缩当前对话上下文",keywords:"压缩 上下文"},archive:{description:"归档当前对话并新建对话",keywords:"归档 关闭"},status:{description:"显示当前连接、Thread、模型与 Token 状态",keywords:"状态 连接 token"},clear:{description:"清空当前视图并开始新对话",keywords:"清空 重置"},help:{description:"显示 Sandbox 支持的快捷命令",keywords:"帮助 命令"},currentModel:"当前模型",availableModel:"可用模型",workspace:"工作空间",notSet:"未设置",modelLabel:"模型",statusLabel:"状态",running:"运行中",idle:"空闲",totalTokens:"累计 Token",contextWindow:"上下文窗口",imageFallback:"图片",unknown:"未知快捷命令:{{command}}。输入 /help 查看可用命令。",automaticSkills:"智能开发模式会自动使用开发能力,无需手动选择 Skill。",activity:{new:"已新建 Codex 对话",resumed:"已恢复 Codex 对话",deleted:"已删除 Codex 历史会话",modelChanged:"已切换 Codex 模型",availableModels:"Codex 可用模型",noModels:"当前没有可用模型",forked:"已分叉 Codex 对话",compacting:"已开始压缩当前 Codex 对话",archived:"已归档 Codex 对话",status:"Codex 当前状态",help:"Sandbox 支持的 Codex 快捷命令"}},JWe={label:"智能构建任务",queued:"构建任务已排队",running:"构建任务正在后台运行",recovering:"正在恢复构建任务",waiting_user:"构建任务需要继续处理",stopping:"正在停止构建任务",succeeded:"构建任务已完成",cancelled:"构建任务已停止",failed:"构建任务未完成",open:"返回任务",hide:"隐藏任务通知",reconnecting:"正在重新连接任务服务,已有任务继续保留。"},Ldr=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:jWe,agentWorkspace:XWe,approval:HWe,commands:ZWe,common:zWe,composer:WWe,default:{common:zWe,tool:UWe,threads:VWe,permissions:GWe,workspace:QWe,approval:HWe,composer:WWe,launch:YWe,session:qWe,agentDetails:jWe,agentWorkspace:XWe,handoff:KWe,commands:ZWe,taskNotice:JWe},handoff:KWe,launch:YWe,permissions:GWe,session:qWe,taskNotice:JWe,threads:VWe,tool:UWe,workspace:QWe},Symbol.toStringTag,{value:"Module"})),eYe={retry:"重试",signInToContinue:"登录以继续使用",signInWith:"使用 {{provider}} 登录",enterUsername:"输入一个用户名即可开始",usernamePlaceholder:"用户名(字母 + 数字,最多 16 位)",enter:"进入",usernameInvalid:"只能包含大小写字母和数字,最多 16 位。",identityProvider:{volcengine:"火山引擎 Identity",byteplus:"BytePlus Identity"},powered:{volcengine:"火山引擎 AgentKit 提供企业级 Agent 解决方案",byteplus:"BytePlus AgentKit 提供企业级 Agent 解决方案"},legalPrefix:"继续即表示你已阅读并同意 AgentKit",terms:"产品和服务条款",copyright:"© {{year}} VeADK。保留所有权利。"},tYe={title:"登录状态已过期",description:"当前编辑内容会保留。重新登录后,刚才的操作将自动继续。",waiting:"等待登录完成…",signInAgain:"重新登录"},rYe={breadcrumbs:"面包屑",selectAgent:"选择 Agent",switchAgent:"切换智能体"},nYe={cancel:"取消",close:"关闭确认框"},Mdr=Object.freeze(Object.defineProperty({__proto__:null,authExpired:tYe,confirm:nYe,default:{login:eYe,authExpired:tYe,navbar:rYe,confirm:nYe},login:eYe,navbar:rYe},Symbol.toStringTag,{value:"Module"})),iYe={defaultUser:"用户",shortcuts:"快捷入口",tryCli:"体验 AgentKit CLI",developerResources:"开发者资源",systemInfo:"系统信息",language:"语言",issueFeedback:"问题反馈",logout:"退出登录",roles:{admin:"管理员",developer:"开发者",user:"普通用户",super_admin:"超级管理员"}},aYe={home:"返回首页",expand:"展开侧边栏",collapse:"收起侧边栏",label:"主导航",newChat:"新会话",agents:"智能体",workspaces:"工作区",library:"资源库",cronjobs:"定时任务",automations:"自动化",users:"用户管理",administration:"管控",reviewCenter:"审核中心"},oYe={title:"历史会话",newConversation:"新会话",create:"新建会话",loading:"正在加载历史会话…",empty:"暂无会话",current:"当前",manage:"管理历史会话:{{title}}",more:"更多",delete:"删除",loadingMore:"加载中…",loadMore:"加载更多",evaluatingTitle:"正在自动评测",evaluating:"评测中",generating:"正在生成"},Idr=Object.freeze(Object.defineProperty({__proto__:null,account:iYe,default:{account:iYe,navigation:aYe,history:oYe},history:oYe,navigation:aYe},Symbol.toStringTag,{value:"Module"})),sYe={placeholder:"请选择",collapseOptions:"收起模型选项",expandOptions:"展开模型选项",noOptions:"暂无可用选项",noMatches:"没有匹配项,可直接使用当前模型 ID"},lYe={unsupportedActivity:"不支持的 Skill 对话活动",ariaLabel:"Skill 生成对话"},cYe={code:"错误码:{{code}}",type:"错误类型:{{type}}",representation:"异常表示:{{value}}",rawResponse:`服务端原始响应: -{{value}}`,original:"原始错误:{{message}}",details:"详细信息"},uYe={ariaLabel:"Skill 文件树",viewSource:"查看源码",viewPreview:"查看预览",download:"下载",binaryFile:"二进制文件",bytes:"{{value}} 字节",binaryDescription:"当前接口仅返回文件元数据,可单独下载原文件。",metadata:"Skill 元数据",noFiles:"暂无文件"},dYe={close:"关闭",name:"名称",region:"地域",optionalDescription:"描述(可选)",cancel:"取消",create:"创建",creating:"创建中…",save:"保存",saving:"保存中…",upload:"上传",uploading:"上传中…",createSpaceTitle:"新建 Skill 空间",editSpaceTitle:"编辑 Skill 空间",uploadTitle:"上传到 {{name}}",createSpaceFailed:"创建 Skill 空间失败",updateSpaceFailed:"更新 Skill 空间失败",archiveValidationFailed:"Skill ZIP 格式校验失败",uploadFailed:"上传 Skill 失败",dropzone:"拖拽 Skill ZIP 到这里",chooseLocalFile:"或点击选择本地文件",archiveHelp:"ZIP 根目录需要包含 SKILL.md,也可以只包含一层包装目录。选择后仅检查格式,不会自动上传。",validating:"正在检查文件格式…",validationPassed:"格式检查通过:{{name}},共 {{count}} 个文件"},hYe={styles:{concise:"简洁实用",strict:"严谨稳健",tutorial:"教程友好",automation:"自动化优先",custom:"自定义",customFallback:"自定义风格"},stages:{preparing:"正在准备 Dev Sandbox",ready:"Skill 已生成并通过格式校验",failed:"生成失败",cancelled:"已停止",validating:"正在校验 Skill 格式",packaging:"正在整理文件",generating:"正在生成 Skill",repairingAgain:"正在再次修复",autoRepairing:"正在自动修复({{attempt}}/{{max}})"},validation:{fallback:"Skill 格式校验未通过",repairInstruction:"只修复下面列出的 Skill 格式错误,不要改变原有用途和内容范围。",recheckInstruction:"修复后重新检查目录结构、SKILL.md frontmatter 和所有文本文件。",nameTooLong:"Skill 名称不能超过 64 个字符",invalidName:"Skill 名称只能包含小写字母、数字和连字符",modelTooLong:"模型 ID 不能超过 128 个字符",invalidModel:"模型 ID 只能包含字母、数字、点、下划线、连字符、斜杠和冒号"},errors:{loadCapability:"读取 Dev Sandbox 配置失败",autoRepair:"自动修复格式错误失败",pollCandidate:"读取候选方案状态失败,正在重试",createCandidate:"创建候选方案失败",refine:"继续调整失败",repairAgain:"再次修复格式错误失败",selectSpace:"请选择上传的 Skill Space",unsupportedRegion:"当前 Skill 地域不受支持",upload:"上传 Skill 失败",download:"下载失败"},sessionMax:"Session 最长保留 1 小时",remaining:"剩余 {{minutes}}:{{seconds}}",unnamedSpace:"未命名 Skill Space",leaveConfirmation:"离开后将停止并释放正在运行的 Dev Sandbox,确定离开吗?",createTitle:"创建技能",optimizeTitle:"优化 {{name}}",skillFallback:"技能",back:"返回技能空间",home:"主页技能生成",basicInfo:"基本信息",goal:"目标",createIntentPlaceholder:"描述希望这个 Skill 完成什么任务",optimizeIntentPlaceholder:"描述希望如何优化当前 Skill",skillName:"Skill 名称",autoNamePlaceholder:"留空时自动生成",nameHelp:"仅支持小写字母、数字和连字符;留空时自动生成。",createPlans:"生成方案",optimizePlans:"优化方案",createPlansDescription:"按不同方案并行生成多个技能,您可以选择最佳结果",optimizePlansDescription:"按不同方案并行优化当前技能,您可以选择最佳结果",plan:"方案 {{count}}",remove:"移除",model:"模型",modelPlaceholder:"选择或输入模型 ID",style:"风格",customStyle:"自定义风格",customStylePlaceholder:"描述表达方式、严谨程度或输出偏好",addConfiguration:"添加配置",notConfigured:"管理员未配置",generate:"生成",candidates:"候选方案",progress:"进度",retryCandidate:"重试此方案",formatValidationFailed:"格式校验未通过",repairAgain:"再次修复",files:"文件",downloadZip:"下载 ZIP",loadingFiles:"正在读取文件…",filesPending:"生成过程中会在这里显示完整文件树",uploadToSpace:"上传到 Skill Space",loadingSpaces:"正在加载 Skill Space",selectSpace:"选择 Skill Space",continuePlaceholder:"继续调整这个候选方案",continue:"继续调整",uploading:"上传中…",overwrite:"覆盖原 Skill",uploadToSelectedSpace:"上传到 Skill Space",uploadToCurrentSpace:"上传到当前空间",allCandidatesFailed:"所有方案均创建失败,可分别重试。"},fYe={invalidFormat:"{{label}}格式错误。",recoveryStatus:"Skill 恢复点状态",errorResponse:"错误响应",errorDetails:"错误详情",missingContentType:"Content-Type 缺失",gatewayError:"{{fallback}}(HTTP {{status}},Content-Type: {{contentType}})。请检查代理或网关配置。",nonJson:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}},Content-Type: {{contentType}}),请检查代理或网关配置。",activity:"Skill 会话活动",invalidActivity:"Skill 会话活动格式错误。",invalidToolActivity:"Skill 工具活动格式错误。",invalidTextActivity:"Skill 文本活动格式错误。",publication:"Skill 发布结果",task:"Skill 会话",file:"Skill 文件",unknownTaskState:"Skill 会话状态无法识别。",capability:"Skill 工作台能力",loadCapability:"读取 Skill 工作台能力失败",prepareTask:"准备 Skill 会话失败",taskReference:"Skill 会话引用",startOptimization:"开始优化 Skill 失败",startTask:"开始 Skill 会话失败",taskSummary:"Skill 会话摘要",taskList:"Skill 会话列表",loadTaskList:"读取 Skill 会话列表失败",invalidTaskList:"Skill 会话列表格式错误。",loadTask:"读取 Skill 会话失败",artifact:"Skill 产物",artifactFile:"Skill 产物文件",loadArtifact:"读取 Skill 产物失败",refine:"继续调整 Skill 失败",stop:"停止当前 Skill 任务失败",publish:"发布 Skill 失败",nonNdjson:"发布 Skill 失败:服务端返回了非 NDJSON 响应。",missingStream:"发布 Skill 失败:服务端没有返回进度流。",publishProgress:"发布进度",invalidPublishProgress:"发布进度格式错误。",publishError:"发布错误",unknownPublishEvent:"未知的发布进度事件。",publishResult:"发布结果",streamEnded:"发布进度流提前结束,无法确认发布结果。请刷新技能中心确认状态。",deleteTask:"删除 Skill 会话失败",download:"下载 Skill 失败"},Pdr=Object.freeze(Object.defineProperty({__proto__:null,api:fYe,configSelect:sYe,conversation:lYe,default:{configSelect:sYe,conversation:lYe,errorDetails:cYe,fileTree:uYe,management:dYe,generation:hYe,api:fYe},errorDetails:cYe,fileTree:uYe,generation:hYe,management:dYe},Symbol.toStringTag,{value:"Module"})),pYe={back:"返回上一页",reload:"重新加载",notConfigured:"未配置",name:"名称",description:"描述",delete:"删除",save:"保存",saving:"保存中",add:"添加",manage:"管理",environment:"环境",noDescription:"暂无描述",refresh:"刷新",close:"关闭",retry:"重试",loading:"加载中…",previousPage:"上一页",nextPage:"下一页",edit:"编辑",all:"全部",search:"搜索",cancel:"取消",view:"查看",viewDetails:"查看详情",deleting:"删除中…",create:"创建",creating:"创建中",adding:"添加中",generating:"生成中",uploading:"上传中",preview:"预览",loadFailed:"加载失败",select:"选择",collapse:"收起",expand:"展开",none:"无"},gYe={ariaLabel:"AgentKit 快速入口",closeAriaLabel:"关闭 AgentKit 欢迎卡片",title:"欢迎使用 AgentKit",description:"通过 AgentKit 平台快速构建与托管您的企业级智能体",docsAriaLabel:"打开 AgentKit 文档,在新窗口打开",docs:"文档",consoleAriaLabel:"打开 AgentKit 控制台,在新窗口打开",console:"控制台"},mYe={checkUpdates:"检查更新",checkingVersions:"正在检查版本…",versionCheckError:"查询沙箱版本失败,请检查凭据、区域及接口权限后重试",sandboxUpdateError:"Sandbox 更新失败,请刷新检查实际状态后重试",modelEnvRepairUnavailable:"无法补齐模型环境变量,请检查 CODEX_API_KEY 和 CODEX_BASE_URL",updateSandbox:"更新{{variant}}{{name}}",updatingSandbox:"更新中",title:"系统信息",description:"查看当前 Studio 版本及关联的基础资源",general:"通用",currentVersion:"当前版本",storage:"存储",loadingStorage:"正在加载存储信息",tosAddress:"TOS 地址",openTosConsole:"在云控制台中打开 TOS 存储桶",environmentBuild:"环境构建",loadingEnvironmentResources:"正在加载环境构建资源",environmentResourcesError:"环境构建资源加载失败,请检查云凭据后重试。",codePipelineWorkspace:"CodePipeline 工作空间",codePipelinePipeline:"CodePipeline 流水线",openCodePipelineWorkspace:"在云控制台中打开 CodePipeline Workspace",createdOnFirstBuild:"首次构建时自动创建",containerRegistryRepository:"Container Registry 仓库",openContainerRegistryRepository:"在云控制台中打开 Container Registry 仓库",sandboxInfo:"沙箱信息",loadingSandboxInfo:"正在加载沙箱信息",sandboxInfoError:"沙箱信息加载失败,请重试。",snapshot:"快照版",snapshotWithSpace:"快照版 ",openToolConsole:"在云控制台中打开{{name}}",updateModelEnv:"更新{{variant}}{{name}}模型环境变量",modelEnvUpdated:"已更新",modelEnvAlreadyCurrent:"无需更新",userPool:"用户池",loadingUserPool:"正在加载用户池",userPoolError:"用户池加载失败,请重试。",modelEnvUpdateError:"模型环境变量更新失败,请重试。",openUserPoolConsole:"在云控制台中打开用户池{{name}}",unnamedUserPool:"未命名用户池",id:"ID",domain:"域名",region:"区域",noLocalUserPool:"本地模式未配置用户池",noUserPool:"当前 Studio 未配置用户池"},vYe={workspace:"Agent 工作区",library:"Agent 库",evaluation:"评测",agentList:"Agent 列表",agentDetails:"Agent 详情",newAgent:"新建 Agent",loading:"加载中…",loadingCloudAgents:"正在加载云端 Agent…",noAgentSelected:"请选择一个 Agent",local:"本地",remote:"云端",localAgent:"本地 Agent",remoteAgent:"云端 Agent",agentCount:"{{count}} 个 Agent",agentCountLabel:"Agent 数量",details:"详情",chat:"对话",update:"更新",backToAgentList:"返回 Agent 列表",loadingAgent:"正在加载 Agent",loadingAgentDescription:"正在读取 Agent 配置和 Runtime 信息。",loadingAgentInfo:"正在加载 Agent 信息…",detailLoadFailed:"无法加载 Agent 详情",detailLoadFailedDescription:"请检查 Runtime 状态后重试。",partialInfoUnavailable:"部分信息暂时不可用",upgradeRuntimeForDetails:"请升级 Runtime 以查看完整 Agent 信息。",basicInfo:"基本信息",usageOverview:"使用概览",sections:{basic:"基本信息",profileConfig:"Profile 配置",sessionConfig:"会话配置",usage:"使用概览",diagnostics:"诊断",evaluations:"评测",optimizations:"优化建议",integrations:"集成",versions:"版本",channels:"消息渠道"},evaluationGroup:"评测组",optimizations:"优化建议",optimizationsDescription:"根据评测结果查看可执行的优化建议。",integrations:"集成",githubVersions:"GitHub 版本",githubVersionsDescription:"查看持续交付产生的版本并创建回退 PR。",currentVersionOnly:"当前未启用 GitHub 持续交付,仅展示当前生产版本。",loadingVersions:"正在加载版本…",noVersion:"暂无版本记录",prLink:"Pull Request",viewPr:"查看 PR",author:"提交人",publishStatus:"发布状态",viewRelease:"查看发布记录",rollbackToVersion:"回退到此版本",rollingBack:"正在创建回退…",rollbackEvent:"回退事件",sourceMergedRuntimeStill:"最新源码已合并,但 Runtime 仍处于",currentProductionVersionHint:";当前生产版本保持不变。",usageSummary:"使用统计",totalCalls:"总调用次数",userCount:"用户数",userDetails:"用户明细",usageUserList:"Agent 使用用户列表",user:"用户",callCount:"调用次数",lastUsed:"最近使用",unknownUser:"未知用户",loadingUsage:"正在加载使用数据…",refreshing:"刷新中…",noUsage:"暂无使用记录",usageUnavailable:"当前 Agent 暂无可用的使用统计。",usagePagination:"使用记录分页",pageOf:"第 {{page}} / {{total}} 页",notProvided:"暂未提供",integrationMethods:"集成方式",integrationDescription:"通过 Runtime API 或 A2A 协议集成当前 Agent。",integrationProtocol:"集成协议",runtimeStatus:"Runtime 状态",executionFlow:"执行流程",probingIntegration:"正在检测集成能力",probingIntegrationDescription:"正在读取可用端点和鉴权配置。",configurationStatus:"配置状态",discoveryEndpoint:"发现端点",invocationEndpoint:"调用端点",invocationUrl:"调用地址",authentication:"鉴权方式",networkAccess:"网络访问",notAvailable:"暂无",noAuthentication:"无需鉴权",noApiKeyRequired:"无需 API Key",usesOauthJwt:"使用 OAuth / JWT",showApiKey:"显示 API Key",hideApiKey:"隐藏 API Key",pythonExample:"Python 示例",deploymentConfig:"部署配置",deploymentConfigDescription:"确认实例和运行配置后更新 Runtime。",deploymentRegion:"部署区域",mpaControlPlane:"MPA 控制面",loadingMpaAgentView:"正在读取 MPA Runtime 绑定…",mpaRuntimeBound:"该 MPA Agent 已绑定唯一 Runtime,可继续管理。",mpaRuntimeMissing:"当前 Agent 没有可见的 MPA Runtime 绑定。",mpaRuntimeBindingAmbiguous:"多个 MPA Runtime 匹配当前 Agent,请先修复绑定后再修改。",mpaRuntimeOrphan:"Runtime 存在,但其中没有当前 MPA Profile。",mpaRuntimeLegacyAuthUnsupported:"该 Runtime 使用旧版 MPA 镜像,仍要求 X-Jwt-Token。请先更新到当前 AgentKit 兼容镜像,再管理 Profile 或 Session 配置。",profileConfig:"Profile 配置",profileConfigTitle:"Profile 配置",profileConfigDescription:"查看并应用 Agent 级 MPA Profile。Profile 是 Runtime 的长期默认配置,新会话默认继承它。",profileStatus:"Profile 状态",profileApplied:"已应用",profileNotApplied:"未应用",profileNotAppliedDescription:"当前 Runtime 可运行,但尚未保存为 Studio 可管理的 Profile。应用后会生成 Profile revision。",applyProfile:"应用 Profile",reapplyProfile:"重新应用 Profile",editProfile:"编辑 Profile",profileApplying:"应用中…",profileAppliedNotice:"Profile 已应用,当前 revision 为 {{revision}}。",profileApplyIncomplete:"Profile 应用未完成,请查看当前操作状态后重试。",profileApplyFailed:"Profile 应用失败。",profilePrompt:"系统提示词",profileResources:"资源配置",profileResourceSummary:"{{tools}} 个工具 · {{skills}} 个 Skill · {{mcp}} 个 MCP 服务",sessionConfigTitle:"会话配置",sessionConfigDescription:"查看和调整当前 MPA Session 的执行配置。变更只对下一轮对话生效。",loadingSessionConfig:"正在加载会话配置…",sessionConfigNoAgent:"请选择一个 MPA Agent 后再管理会话配置。",sessionConfigNonMpa:"会话配置仅适用于 MPA Agent。",sessionConfigNoSession:"请先打开这个 MPA Agent 的对话,再修改会话配置。",sessionConfigDifferentRuntime:"请先切回这个 MPA Agent 的当前对话,再修改会话配置。",sessionConfigSaved:"会话配置已更新,下一轮对话将使用新 revision。",sessionConfigStale:"该 Session 已被其他位置修改,已展示最新配置,请确认后再保存。",sessionConfigRevision:"配置 revision",sessionProfileRevision:"Session Profile revision",latestProfileRevision:"最新 Profile revision",sessionProfileUpgradeAvailable:"检测到新的 Profile revision:v{{current}} → v{{target}}。",upgradeSessionProfile:"升级 Session Profile",sessionProfileUpgrading:"升级中…",sessionProfileUpgraded:"Session Profile 已升级,下一轮对话将使用新 revision。",sessionProfileUpgradeFailed:"Session Profile 升级失败。",sessionModelOverride:"模型覆盖",modelId:"模型 ID",inheritProfileDefault:"继承 Profile 默认值",sessionMcpServers:"MCP 服务",mcpServerCount:"已选择 {{count}} 个",clearSessionMcp:"清空 MCP 服务",mpaDiagnosticsTitle:"Runtime 诊断",mpaDiagnosticsDescription:"查看最近的 Runtime Console 运行记录,以及 Agent、Profile、Turn、task 和 worker 关联。",loadingMpaDiagnostics:"正在加载 Runtime 诊断…",noMpaDiagnostics:"当前 Session 暂无 Runtime 诊断运行记录。",latestRun:"最近运行",traceCorrelation:"Trace 关联",traceCorrelationDescription:"Runtime Console 为本次 invocation 返回的稳定标识。",traceSteps:"Trace 步骤",traceStepsDescription:"当前 invocation 最近的有界 Runtime Console 步骤。",mpaInstanceId:"MPA 实例",turnId:"Turn ID",taskId:"Task ID",workerKind:"Worker 类型",workerSession:"Worker Session",workerTurn:"Worker Turn",workerProfile:"Worker Profile",workerProfileVersion:"Worker Profile 版本",step:"步骤",stepCount:"步骤数",duration:"耗时",noTraceSteps:"本次 invocation 暂无 trace 步骤。",executionConfigMode:{replace:"Session 覆盖",clear:"本 Session 已清空",inherit:"使用 Profile 默认值"},concurrency:"并发数",selectedOptimizations:"已选优化项",selectedOptimizationsDescription:"这些优化会应用到本次更新。",optimizationProfile:"优化方案",updatePending:"等待更新",updatingDeployment:"正在更新部署",restoringUpdateConfig:"正在恢复更新配置…",updateConfigUnavailable:"无法读取更新配置",legacyConfigMissing:"旧版本 Runtime 缺少可恢复的配置,请重新创建。",deploymentFailed:"部署失败",continueEditing:"继续编辑",loadingOptimizations:"正在加载优化建议…",noOptimizations:"暂无优化建议",fixPriority:"优先级",suggestedModule:"建议模块",suggestionAndReason:"建议与原因",priority:{high:"高",medium:"中",low:"低"},modules:{agentStructure:"Agent 结构",prompt:"提示词",tool:"工具",knowledge:"知识库",memory:"记忆",workflow:"工作流",other:"其他"},evaluationGroupList:"评测组列表",newEvaluationGroup:"新建评测组",newEvaluationGroupName:"新评测组 {{count}}",searchEvaluationGroups:"搜索评测组",noMatchingEvaluationGroups:"没有匹配的评测组",noEvaluationGroupSelected:"请选择一个评测组",groupStats:"{{agents}} 个 Agent · {{runs}} 次运行",evaluationGroupDetails:"评测组详情",evaluationGroupStats:"{{agents}} 个 Agent · {{caseSet}} · {{runs}} 次运行",startEvaluation:"开始评测",evaluationConfig:"评测配置",historyResults:"历史结果",participatingAgents:"参与 Agent",selectedCount:"已选择 {{count}} 个",evaluationResources:"评测资源",evaluationSet:"评测集",evaluator:"评估器",caseCount:"{{count}} 条案例",evaluationMetrics:"评测指标",selectedMetricCount:"已选择 {{count}} 项",historyDescription:"查看每次评测的分数和运行状态。",noHistory:"暂无评测历史",noHistoryDescription:"运行一次评测后,结果会显示在这里。",evaluationRun:"第 {{index}} 次评测",evaluationRunMeta:"{{time}} · {{agents}} 个 Agent",overallScore:"综合分",completed:"已完成",evaluationDefaults:{coreRegression:"核心能力回归",safetyCheck:"安全与幻觉检查",coreSet:"核心回归集",safetySet:"安全边界集",toolSet:"工具调用集",qualityEvaluator:"综合质量评估器",factualEvaluator:"事实一致性评估器",toolEvaluator:"工具调用评估器",responseQuality:"回答质量",factualAccuracy:"事实准确性",toolUse:"工具调用",responseEfficiency:"响应效率",todayTime:"今天 10:32",yesterdayTime:"昨天 16:08",julyTime:"7 月 25 日 14:20",justNow:"刚刚"},defaultCases:{agentName:"示例 Agent",goodSetName:"示例正向案例集",badSetName:"示例负向案例集",weeklyFeedback:{input:"总结本周客户反馈,并按优先级归类。",output:"覆盖主要问题,给出清晰的优先级与下一步动作。",tag:"总结",reason:"任务完整覆盖了用户目标,输出结构清晰,并给出了可执行的下一步动作。"},research:{input:"查询最新公开资料并附上来源。",output:"调用搜索工具,结论与引用一一对应。",tag:"工具调用"},uncertainConclusion:{input:"在信息不足时直接给出确定结论。",output:"应明确说明未知,并主动询问缺失信息。",tag:"幻觉",reason:"信息不足时仍给出了确定结论,缺少必要的澄清步骤与不确定性说明。"},repeatedTool:{input:"连续重复调用相同工具获取同一结果。",output:"复用已有结果,避免无意义的重复调用。",tag:"效率"}},goodCases:"正向案例",badCases:"负向案例",goodCase:"正向案例",badCase:"负向案例",reference:"参考答案",caseResultFilter:"案例结果筛选",feedbackSourceFilter:"反馈来源筛选",searchCases:"搜索案例",searchCasesPlaceholder:"搜索输入、输出或标签",selectCases:"选择案例",selectAll:"全选",selectAllVisible:"选择当前可见案例",selectedCaseCount:"已选择 {{count}} 条",deleteSelected:"删除所选",deleteSelectedTitle:"删除所选 Agent",deleteSelectionDescription:"确定删除所选的 {{count}} 个项目吗?此操作无法撤销。",deleteCasesConfirm:"删除所选案例",deleteOneCaseConfirm:"删除这个案例",deleteFeedbackCase:"删除反馈案例",noFeedbackCases:"暂无反馈案例",noMatchingCases:"没有匹配的案例",loadingEvaluationSet:"正在加载评测集…",userInput:"用户输入",agentOutput:"Agent 输出",score:"得分",scoreReason:"评分原因",noUserInput:"暂无用户输入",noVisibleResponse:"暂无可见回复",note:"备注:",manualFeedback:"人工反馈",automaticFeedback:"自动反馈",scoreValue:"{{score}} 分",unknownTime:"时间未知",deleteAgentTitle:"删除 Agent",deleteAgentDescription:"确定删除 Agent“{{name}}”吗?",deleteDraftDescription:"确定删除草稿“{{name}}”吗?",deleteAgent:"删除 Agent",closeDeleteConfirmation:"关闭删除确认",mpaDeletePreviewSummary:"Studio 会先删除可见的空闲 MPA Runtime 会话,再删除 AgentKit Runtime。运行中的任务需要先结束或停止后才能删除。",mpaDeletePreviewSessions:"会话",mpaDeletePreviewActiveSessions:"运行中",mpaDeletePreviewIdleSessions:"空闲",mpaDeleteBlocked:"当前无法删除",mpaDeleteBlockerActiveOperation:"仍有 MPA 创建或更新操作在执行。",mpaDeleteBlockerActiveSessions:"Runtime 中仍有运行中的会话。",mpaDeleteBlockerBindingAmbiguous:"当前 Agent 匹配到多个 MPA Runtime。",mpaDeleteBlockerRuntimeMissing:"当前 MPA Agent 没有可见的 Runtime 绑定。",mpaDeleteBlockerOrphanRuntime:"Runtime 可见,但其中缺少当前 MPA Profile。",mpaDeleteStage:{runtime_sessions:"删除 {{count}} 个可见空闲 Runtime 会话",runtime_diagnostics:"清理这些会话关联的诊断数据和挂载元信息",agentkit_runtime:"删除 AgentKit Runtime"},draftDeletionWarning:"草稿将从当前浏览器中删除。",runtimeDeletionWarning:"Runtime 和相关云端资源将被删除。",noneSelected:"尚未选择",none:"无",notPublished:"未发布",notRecorded:"未记录",noTime:"暂无时间",noPr:"暂无 PR",comingSoon:"评测能力即将开放",preparing:"准备中",cancelled:"已取消",failed:"失败",totalCount:"共 {{count}} 条",deploymentProgress:"部署进度",returnToEdit:"返回编辑",retryOperation:"重试操作",buildLog:"构建日志",githubMountLog:"GitHub 挂载日志",githubDeliveryMountLog:"GitHub 持续交付挂载日志",waitingBuildLog:"正在等待构建日志…",waitingGithubMountLog:"正在等待 GitHub 挂载日志…",copy:"复制",copied:"已复制",copyLabel:"复制{{label}}",copiedLabel:"已复制{{label}}",logLines:"{{count}} 行",logStatus:{synced:"已同步",failed:"读取失败",syncing:"同步中",earlyOmitted:"已省略早期日志",recentOnly:"仅显示最近的构建日志",partiallyOmitted:"已省略部分日志"},deployStatus:{running:"正在部署",unconfirmed:"部署状态待确认",success:"部署完成",error:"部署失败",cancelled:"部署已取消"},deploymentSteps:{prepare:{label:"准备部署",description:"校验配置并创建部署任务"},build:{label:"构建镜像",description:"生成运行环境与智能体代码"},deploy:{label:"部署服务",description:"创建并启动 AgentKit Runtime"},publish:{label:"发布服务",description:"等待服务就绪并生成访问地址"},complete:{label:"部署完成",description:"智能体已可以正常使用"},evaluation:{label:"创建评测集",description:"自动创建 Good Case 和 Bad Case 评测集"},profileApplying:{label:"应用 MPA 配置",description:"将 Studio Agent 配置写入 MPA Runtime"},smokeRunning:{label:"验证 MPA Runtime",description:"在标记可运行前执行 Runtime 就绪验证"},runnable:{label:"MPA Runtime 可运行",description:"Runtime 已接受配置并通过执行就绪验证"},github:{label:"挂载 GitHub 持续交付",description:"初始化目标分支与 GitHub Actions workflow"},update:{label:"更新实例配置",description:"将 Runtime 实例数调整为 {{min}}~{{max}}"}},githubStatus:{published:"已发布",publishing:"发布中",failed:"发布失败",pending:"等待发布",unknown:"未知"},errors:{agentInfoMissing:"Agent 信息不可用",checkUpdateCapability:"无法检查更新能力",checkingUpdateConfig:"正在检查更新配置",cloudOnlyUpdate:"仅云端 Agent 支持更新",deleteDeployedUnsupported:"当前不支持删除已部署 Agent",deleteDraftUnsupported:"当前不支持删除草稿",loadMpaDeletePreview:"无法加载 MPA 删除预览",loadAgentInfo:"无法加载 Agent 信息",loadApiKey:"无法读取 API Key",loadGithubVersions:"无法加载 GitHub 版本",loadEvaluations:"无法加载评测案例",loadMpaAgentView:"无法加载 MPA Agent 状态",loadMpaDiagnostics:"无法加载 Runtime 诊断",loadOptimizations:"无法加载优化建议",loadRuntimeDetails:"无法加载 Runtime 详情",loadSessionConfig:"无法加载会话配置",loadUsage:"无法加载使用数据",noCreatePermission:"当前账号没有创建 Agent 的权限",noManagePermission:"当前账号没有管理此 Agent 的权限",originalConfigUnavailable:"原始配置不可用",probeIntegration:"无法检测集成能力",rollbackVersion:"无法创建版本回退",runtimeRegionMissing:"Runtime 区域信息缺失",updateCapabilityMismatch:"Runtime 更新能力与当前配置不匹配",updateCapabilityPending:"Runtime 更新能力仍在确认中",updateConfigRestoring:"正在恢复更新配置",updateUnsupported:"当前 Runtime 不支持更新",usageMismatch:"返回的使用数据与当前 Agent 不匹配"}},yYe={title:"环境",loadFailed:"环境加载失败,请检查存储配置后重试。",storageUnavailable:"管理员未配置持久化存储,环境管理暂不可用。",create:"新建环境",configure:"配置环境",details:"环境详情",editorDescription:"配置运行环境,或接入代码仓库和已有镜像",backToList:"返回环境列表",save:"保存环境",createAndBuild:"创建并构建",saveAndBuild:"保存并构建",name:"环境名称",namePlaceholder:"Python 数据处理",descriptionPlaceholder:"说明这个环境适合处理的任务",creationMethod:"创建方式",baseConfiguration:"基础配置",baseEnvironment:"基础环境",operatingSystem:"操作系统",pythonVersion:"Python 版本",fixedByBase:"由 {{base}} 固定为 {{value}}",selectUbuntuVersion:"选择基础镜像的 Ubuntu 版本",selectPythonVersion:"选择需要安装的 Python 版本",skills:"技能",addSkill:"添加环境技能",veadkDescription:"Agent 开发与运行框架",customDockerfile:"自定义 Dockerfile",presetEnvironment:"预制环境",presetHint:"选择“无”可自行填写 Dockerfile 第一行的基础镜像。",dockerfileSize:"{{size}} / {{max}} 字节",upload:"上传",reset:"重置",dockerfileBaseImage:"Dockerfile 基础镜像",dockerfileContent:"Dockerfile 内容",region:"区域",search:"搜索环境",manualImport:"手动导入",noMatches:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称",startBuild:"开始构建",build:"构建",unnamed:"未命名环境",listSeparator:"、",clipboardReadError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。",creation:{custom:{label:"自定义配置",description:"通过表单选择基础环境、Python、工具和技能"},dockerfile:{label:"自定义 Dockerfile",description:"上传或直接编辑 Dockerfile"},git:{label:"从代码仓库构建",description:"探查公开仓库并通过 CodePipeline 构建"},image:{label:"使用已有镜像",description:"绑定由外部流水线交付的 CR 镜像"}},baseDescriptions:{"aio-sandbox":"内置 Sandbox Shell 能力 · Ubuntu 22.04","codex-sandbox":"内置 Codex CLI、浏览器与代码执行环境",ubuntu:"标准 Linux 基础镜像"},dockerfileValidation:{baseImageRequired:"请填写基础镜像。",duplicateFrom:"基础镜像已固定在第一行,请删除 Dockerfile 正文中的 FROM 指令。",tooLarge:"Dockerfile 不能超过 128 KiB。",empty:"Dockerfile 内容不能为空。",missingFrom:"Dockerfile 缺少 FROM 指令。"},presets:{none:"自行填写 Dockerfile 基础镜像",aio:"内置 Sandbox Shell 与常用运行时",codex:"内置 Codex CLI、浏览器与代码执行环境"},categories:{tools:"工具",productivity:"效率",browser:"浏览器自动化",system:"系统与媒体"},options:{"lark-cli":"飞书开放平台命令行工具",pandoc:"文档格式转换工具",opencli:"将网站与桌面应用转换为命令行工具",uv:"快速 Python 包与项目管理器",ripgrep:"高性能文本检索工具",jq:"JSON 查询与转换工具","github-cli":"在终端中管理 GitHub 工作流",playwright:"浏览器自动化与端到端测试",chromium:"无头浏览器运行时",git:"代码版本管理",curl:"网络请求与文件下载",ffmpeg:"音视频转码与处理",imagemagick:"图片转换与批处理"},duration:{seconds:"{{count}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",hoursMinutes:"{{hours}} 小时 {{minutes}} 分"},buildStatus:{preparing:"准备中",queued:"排队中",building:"构建中",scanning:"扫描中",available:"可用",failed:"构建失败",notBuilt:"未构建"},manifest:{title:"环境 Manifest",closeLabel:"关闭环境 Manifest",loading:"正在加载 Manifest",editorLabel:"环境 Manifest YAML",copyFailed:"复制失败,请重试",copied:"已复制",copy:"复制 Manifest",view:"查看环境 Manifest",viewShort:"查看 Manifest",unavailable:"尚无可用 Manifest"},buildDetails:{title:"构建详情",closeLabel:"关闭构建详情",currentStep:"当前步骤",waiting:"等待构建信息",elapsed:"已用时",sourceCommit:"源码提交",openCodePipeline:"在 CodePipeline 中查看",starting:"正在启动",rebuild:"重新构建"},git:{sectionLabel:"公开代码仓库",address:"Git 地址",ref:"Branch、Tag 或 Commit",defaultBranch:"默认分支",inspecting:"正在拉取仓库并查找 Dockerfile",foundDockerfiles:"已在提交 {{commit}} 中找到 {{count}} 个 Dockerfile。",savedDockerfileLoaded:"已载入保存的 Dockerfile,可重新探查仓库更新。",noDockerfile:"仓库中未找到 Dockerfile,请检查分支或仓库内容。",inspectAgain:"重新探查",selectDockerfile:"选择 Dockerfile"},repository:{outputSection:"构建输出",type:"镜像仓库类型",managed:"Studio 默认镜像仓库",existing:"已有镜像仓库",managedHint:"构建时自动创建或复用当前区域的 Studio 镜像仓库。"},existingImage:{sectionLabel:"已有镜像",reference:"Tag 或 Digest",placeholder:"latest 或 sha256:...",hint:"填写镜像 Tag,或以 sha256: 开头的完整 Digest。"},share:{action:"分享",title:"分享环境",closeLabel:"关闭分享环境",generating:"正在生成并复制分享码",copied:"分享码已复制",failed:"分享失败",code:"分享码",fullCode:"完整环境分享码",copiedHint:"分享码已自动复制,也可在这里查看或手动复制。",copyFailedHint:"自动复制失败,可手动复制上方分享码,或重试。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅发送给可信对象。",copyAgain:"再次复制"},import:{title:"导入环境",closeLabel:"关闭导入环境",description:"先检测分享码中的环境,再确认添加到当前账号。",code:"环境分享码",tooMany:"最多可一次导入 {{max}} 个环境,当前检测到 {{count}} 个分享码。",multipleHint:"多个分享码可使用英文逗号、中文逗号或换行分隔,重复项会自动忽略。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅导入可信来源的分享码。",inspectingCodes:"正在检测环境分享码",found:"检测到 {{count}} 个环境:{{names}}。",itemError:"第 {{index}} 个分享码:{{error}}",invalidCode:"分享码无效。",noResult:"服务未返回该分享码的导入结果。",partial:"已导入 {{created}} 个环境,{{remaining}} 个未完成,可重试有效失败项。",inspecting:"正在检测",importing:"正在导入",retryImport:"重试导入",confirm:"确认导入",inspectCodes:"检测分享码"},status:{boundImage:"环境“{{name}}”已绑定已有镜像",queued:"环境“{{name}}”已进入构建队列",savedBuildFailed:"环境已保存,但构建未启动:{{error}}",importedFailed:"已导入 {{created}} 个环境,{{failed}} 个失败",importedDuplicate:"已导入 {{created}} 个环境,{{duplicate}} 个分享码已存在",imported:"已导入 {{count}} 个环境",deleted:"已删除环境“{{name}}”"},deleteTitle:"删除环境",deleteDescription:"确定删除环境“{{name}}”吗?删除后无法恢复。",errors:{repositoryRequired:"请输入公开代码仓库地址。",repositoryHttps:"请输入公开仓库的 HTTPS 地址。",repositoryInvalid:"请输入有效的公开仓库 HTTPS 地址。",imageReferenceWhitespace:"Tag 或 Digest 不能包含空格。",imageDigestInvalid:"Digest 必须是完整的 sha256 值。",imageTagOnly:"这里只填写 Tag,不要重复填写镜像仓库路径。"}},bYe={searchPlaceholder:"搜索资源名称",emptyMessage:"暂无可用选项",searchAriaLabel:"搜索{{label}}",loadingMore:"正在加载更多资源…"},xYe={retryDeployment:"重试部署",retrying:"正在重试…",collapse:"收起错误信息",expand:"展开完整错误信息",copy:"复制完整错误信息"},wYe={steps:"构建步骤",log:"构建日志",syncing:"同步中",loadFailed:"读取失败",synced:"已同步",recentOnly:" · 仅显示最近日志",copiedLog:"已复制构建日志",copyLog:"复制构建日志",copied:"已复制",copy:"复制",logContent:"构建日志内容",waiting:"正在等待 CodePipeline 输出日志…",empty:"暂无构建日志"},AYe={defaultLabel:"Studio 默认环境",defaultDescription:"使用 Studio 预置的标准运行环境",status:{notBuilt:"未构建",preparing:"准备中",queued:"排队中",building:"构建中",scanning:"扫描中",available:"可用",failed:"失败"},label:"运行环境",placeholder:"请选择运行环境",search:"搜索运行环境",loading:"正在加载运行环境…",loadFailed:"加载运行环境失败",noMatches:"未找到匹配的运行环境",unavailable:"当前没有可用的运行环境",selectionUnavailable:"所选运行环境当前不可用,请重新选择。",selectionHint:"选择构建完成的运行环境后,部署将使用其镜像和工具配置。",versionChanged:"所选环境版本已更新,请确认后继续。",versionMissing:"所选环境版本已不存在,请重新选择。",operatingSystem:"操作系统",language:"语言",image:"镜像",imageVersion:"镜像版本",skills:"技能",tools:"工具",noSkills:"未配置 Skill",noExtraTools:"未配置额外工具",defaultGuidance:"默认环境由 Studio 管理,无需额外配置。",persistenceFallback:"持久化环境服务暂不可用,当前使用默认环境。",emptyFallback:"当前没有可选择的自定义环境。"},SYe={repository:"GitHub 仓库",githubUrl:"GitHub 地址",token:"访问令牌",sessionToken:"{{provider}} 临时令牌",runtime:"Runtime",commit:"提交",workflow:"工作流",syncFailed:"同步 GitHub 代码失败",status:{mounted:"已挂载",bound:"已绑定",synced:"已同步",created:"已创建"},volcengine:"火山引擎",mountDelivery:"挂载持续交付",selectedForDeployment:"已选择,部署时挂载",mountOnDeploy:"部署时挂载持续交付",syncCode:"同步代码",deliveryMode:"GitHub 交付模式",sourceSync:"GitHub 代码同步",delivery:"GitHub 交付",loading:"读取中",running:"执行中",runtimeDeliveryHint:"写入 AgentKit Runtime GitHub Actions workflow,后续 GitHub 提交会更新绑定 Runtime。",initialDeliveryHint:"首次部署成功后初始化目标分支,后续 GitHub 提交会更新绑定 Runtime。",sourceSyncHint:"Studio 会直接 push 到目标分支;该分支由 Studio 管理,远端冲突时同步会失败。Runtime 仍由部署按钮发布。",tokenPlaceholder:"repo 或 contents write 权限",getToken:"获取 Token",hideToken:"隐藏 Token",showToken:"显示 Token",tokenHelp:"Token 仅用于本次操作,成功后不会保留在表单中。",targetBranch:"目标分支",actionsSecretPlaceholder:"用于写入 GitHub Actions Secret",sessionTokenPlaceholder:"临时凭证可选",syncing:"同步中…",pendingHint:"已选择挂载持续交付。点击部署后,Studio 会等待 Runtime 创建完成并初始化 GitHub 目标分支,初始化成功后才完成部署流程。",result:{deliveryMounted:"已挂载持续交付",deliverySelected:"已选择挂载持续交付",githubBound:"已绑定 GitHub",codeSynced:"代码已同步",deliveryHint:"目标分支提交会触发 Runtime 持续交付。",boundHint:"更新并发布时会先同步当前源码到这个分支。"},branch:"分支",viewPr:"查看 PR",createFailed:"创建失败",phase:"阶段",log:"日志"},TYe={name:"飞书",enabling:"正在启用并更新配置…",description:"接收消息并通过飞书机器人回复",configuration:"飞书配置",configurationMode:"飞书配置方式",automatic:"自动配置",manual:"手动配置",cancelling:"取消中…",scanToCreate:"扫码创建",scanDescription:"授权后自动回填凭据",generateQrCode:"生成二维码",qrCodeAlt:"飞书机器人配置二维码",scanToConfirm:"飞书扫码确认",expiresIn:"{{time}} 后失效",created:"机器人已创建",credentialsFilled:"应用凭据已自动回填",qrCodeExpired:"二维码已失效",automaticFailed:"自动配置失败",regenerateQrCode:"请重新生成二维码。",configuredPlaceholder:"已配置,留空沿用",appSecretPlaceholder:"请输入 App Secret",hideSecret:"隐藏 App Secret",showSecret:"显示 App Secret"},CYe={mode:{auto:"自动创建",autoDescription:"部署时自动创建所需资源",recommended:"推荐",create:"指定名称",createDescription:"使用指定名称创建或复用资源",existing:"选择已有",existingDescription:"从当前账号的已有资源中选择"},selectExisting:"请选择已有资源",searchResource:"搜索资源名称",noMatch:"未找到匹配资源",noAvailable:"暂无可用资源",searching:"正在搜索云资源…",loading:"正在加载云资源…",noMatchSentence:"未找到匹配资源。",noAvailableSentence:"暂无可用资源。",loadedSummary:"实际服务区域:{{region}} · 已加载 {{loaded}}{{total}}",registryInstance:"Registry 实例",registryAriaLabel:"镜像仓库 Registry 实例",namespace:"命名空间",namespaceAriaLabel:"镜像仓库 Namespace",repository:"镜像仓库",existingRepository:"已有镜像仓库",selectRegistryFirst:"请先选择 Registry 实例。",selectNamespaceFirst:"请先选择 Namespace。",configurationMode:"配置方式",configurationModeAriaLabel:"{{resource}}配置方式",selectConfigurationMode:"请选择配置方式",automaticNames:"自动创建名称",validation:{tos:"请填写或选择 TOS 存储桶。",cr:"请完整填写或选择 CR 实例、命名空间和镜像仓库。",codePipeline:"请完整填写或选择 CodePipeline Workspace 和 Pipeline。",existingCodePipeline:"请选择已有的 CodePipeline Workspace 和兼容 Pipeline。"},autoBucketWithRegion:"agentkit-platform-{账号 ID}-{{region}}",autoBucket:"agentkit-platform-{账号 ID}",tosBucket:"TOS 存储桶",bucketName:"存储桶名称",bucketNamePlaceholder:"输入存储桶名称",existingBucket:"已有存储桶",existingTosBucket:"已有 TOS 存储桶",bucket:"存储桶",accountIdResolved:"账号 ID 在部署时按当前云账号解析。",containerRegistry:"容器镜像仓库(CR)",instanceName:"实例名称",crInstance:"CR 实例",existingCrInstance:"已有 CR 实例",existingCrNamespace:"已有 CR 命名空间",existingCrRepository:"已有 CR 镜像仓库",autoRegistry:"agentkit-platform-{账号 ID}",autoRepositoryName:"{{name}}-{4 位随机字符}",registryNameNote:"账号 ID 在部署时解析,镜像仓库的随机字符在部署时生成。",workspace:"工作空间",pipeline:"流水线",workspaceName:"Workspace 名称",pipelineName:"Pipeline 名称",existingWorkspace:"已有 CodePipeline Workspace",compatiblePipeline:"兼容 Pipeline",existingPipeline:"已有 AgentKit CodePipeline",pipelineNameNote:"Pipeline 与 Runtime 名称一致。"},kYe={commit:"提交",steps:{permissions:"预检 OTA 所需权限",resolving:"读取目标版本信息",downloading:"下载并校验完整更新包",preparing:"准备 VeFaaS Function 代码",provisioning:"检查并补齐 Studio 云资源",scheduler:"更新定时任务调度服务",submitting:"提交 Function 更新",publishing:"发布新 Revision 并重启服务"},stages:{permissions:"预检 OTA 权限",resolving:"读取版本信息",downloading:"下载更新包",preparing:"准备 Function 代码",provisioning:"补齐 Studio 云资源",scheduler:"更新定时任务调度服务",submitting:"提交 Function 更新",publishing:"发布 Revision",checking:"检查更新",unknown:"未知阶段"},duration:{seconds:"{{count}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},logPermissionPrefix:"无法读取 VeFaaS 发布日志。Function 角色缺少 ",logPermissionSuffix:" 权限,更新会继续。",openIamConsole:"前往 IAM 控制台配置权限",deploymentProgress:"部署进度",live:"实时",completed:"已完成",stopped:"已停止",copied:"已复制",copyFailed:"复制失败",copyLog:"复制日志",waitingForLogs:"等待 VeFaaS 返回更新日志…",noLogs:"本次更新未返回发布日志",messages:{updated:"Studio 已更新,新 Revision 已接管服务",failed:"Studio 更新失败",timeout:"等待 VeFaaS 发布超时,请稍后重新检查版本",submitted:"更新已提交,正在等待 VeFaaS 发布新版本",connectionSwitched:"连接已切换,正在确认新版本状态"},checkingPermissions:"正在检查 OTA 权限",authorizationRequired:"需要 IAM 授权",updating:"正在更新 Studio",updated:"Studio 已更新",updateToVersion:"更新 Studio 至 {{version}}",checkPermissions:"检查更新权限",authorizationNeeded:"需要授权",updatingShort:"正在更新",refreshForNewVersion:"刷新使用新版",updateFailed:"更新失败",updateNow:"立即更新",newVersionAvailable:"有新版更新",dialog:{failed:"Studio 更新失败",checkingPermissions:"正在检查更新权限",authorizationRequired:"需要 IAM 授权",updating:"正在更新 Studio",completed:"Studio 更新完成",newVersion:"发现新版本"},permissionCheck:"正在核对 OTA 与定时任务所需的全部 IAM 权限…",permissionCheckHint:"权限全部满足后才会开始下载、更新或发布云资源。",missingPermissionCount:"当前 Function 角色缺少 {{count}} 项 OTA 更新权限,尚未执行任何云资源变更。",functionRole:"Function 角色",currentRole:"当前运行角色",policyToUpdate:"将更新策略",authorizationSteps:{open:"打开授权页面,确认已预填的策略名称和完整策略内容。",debug:"点击页面中的“发起调试”,完成策略更新。",return:"返回此窗口,点击“我已授权,重新检查”。"},missingPermissions:"缺少的权限",openPrefilledAuthorization:"打开已预填的 IAM 授权页面",openIamManually:"前往 IAM 控制台手动配置",noSafePolicy:"当前角色没有唯一可安全更新的自定义策略,请由管理员将上述权限加入该角色。",failedStage:"失败阶段",errorId:"错误 ID",notGenerated:"未生成",openFunctionLogs:"前往 VeFaaS 控制台查看 Function 日志",targetVersion:"目标版本",updateStatus:"更新状态",elapsed:"已用时",progressAriaLabel:"Studio 更新进度",processingUpdate:"正在处理更新",processing:"正在处理",backgroundHint:"发布阶段会短暂中断连接;关闭此窗口不会停止更新,可随时点击右上角按钮重新查看。",confirmDescription:"更新会重启 Studio 服务,预计约 3–5 分钟完成更新与发布。期间正在进行的对话、流式响应或部署任务可能中断,登录态不会受到影响。",selectVersion:"选择版本",currentVersion:"当前版本",changelog:"更新内容",noChangelog:"暂无更新说明",runInBackground:"后台运行",authorizedRecheck:"我已授权,重新检查",tryAgain:"重新尝试"},OYe={deploy:"部署",update:"更新",planHash:"方案哈希",backToConfiguration:"返回配置",releaseRegion:"发布区域",deployRegion:"部署区域",regionPreserved:"更新时沿用现有 Runtime 的部署区域,无法修改。",unnamedAgent:"未命名 Agent",deployTitle:"部署 {{name}}",additionalAgentCount:" 等 {{count}} 个智能体",releaseOverview:"发布概览",agentOverview:"Agent 概览",agentCount:"Agent 数量",model:"模型",systemPrompt:"系统提示词",optimizations:"优化选项",notEnabled:"未启用",effectiveCapabilities:"生效能力",automaticProtection:"自动保护",artifactActions:"发布产物操作",exportYaml:"导出 YAML",viewSource:"查看源代码",downloadSource:"下载源代码",expandFlow:"放大查看执行流程",expand:"放大查看",deploymentConfiguration:"部署配置",runtimeName:"Runtime 名称",runtimeNamePreserved:"更新时保持现有 Runtime 名称不变。",runtimeNameHint:"默认根据 Root Agent 名称生成,并添加随机后缀避免重名;支持 4-64 位字母、数字、连字符和下划线",accessAuthentication:"访问鉴权",authenticationPreserved:"更新时保持现有 Runtime 的鉴权方式不变。",authenticationMethod:"鉴权方式",authenticationAriaLabel:"部署鉴权方式",authenticationPlaceholder:"请选择鉴权方式",messageChannels:"消息渠道",instanceSettings:"实例设置",minInstances:"最小实例数",maxInstances:"最大实例数",sidecarSingleInstance:"Harness Sidecar 首期仅支持单实例,Runtime 固定为 1~1",inMemorySingleInstance:"为避免多实例间会话丢失,推荐将 Runtime 固定为 1~1",network:"网络",networkPreserved:"现有 Runtime 的区域与网络模式保持不变。",networkMode:"网络模式",networkModes:{public:"公网",both:"公网 + VPC"},subnetId:"子网 ID",subnetHint:"可选,多个用逗号分隔",sharedInternetAccess:"VPC 内共享公网出口",evaluationSets:"评测集",createEvaluationSets:"自动创建评测集",createEvaluationSetsHint:"部署成功后,自动创建 Good Case 和 Bad Case 评测集。",resourceConfiguration:"资源配置",environmentVariables:"环境变量",environmentVariablesHint:"组件配置会自动同步到这里,部署前可核对最终值。",itemCount:"{{count}} 项",addVariable:"添加变量",componentGenerated:"组件自动生成",injectedByApiKey:"由所选 API Key 注入",envNameAriaLabel:"{{key}} 环境变量名",envDescriptionAriaLabel:"{{key}}说明:{{description}}",openOpenViking:"打开 OpenViking {{label}}",openOpenVikingAriaLabel:"{{key}}:打开 OpenViking {{label}}",requiredEmpty:"必填,尚未填写",optionalEmpty:"可选,尚未填写",envValueAriaLabel:"{{key}} 环境变量值",automatic:"自动",synced:"同步",customModelCredentials:"自定义模型凭据",releaseOnlySecret:"必填,仅用于本次发布",thisRelease:"本次发布",customVariables:"自定义变量",value:"值",deleteVariable:"删除变量",deploymentProgress:"部署进度",retryUpdate:"重试更新",retryDeploy:"重试部署",updateSucceeded:"更新成功",deploySucceeded:"部署成功",region:"区域",agentName:"Agent 名称",apiEndpoint:"API 端点",connecting:"连接中…",chatNow:"立即对话",console:"控制台",actionInProgress:"{{action}}中…",checkingName:"正在检查名称…",retryAction:"重试{{action}}",flowPreview:"执行流程预览",executionFlow:"执行流程",flowPreviewHint:"只读预览,可缩放与拖动画布",closeFlowPreview:"关闭执行流程预览",agentAdded:'Agent "{{name}}" 已添加到左上角下拉列表!',files:{preview:"文件预览",new:"新建文件",empty:"暂无文件",noneSelected:"未选择文件",selectToView:"选择左侧文件以查看内容",loadingEditor:"加载编辑器…",rename:"重命名",renamePrompt:"重命名文件"},apiKey:{selectFirst:"请先选择 API Key",revealing:"正在显示 API Key",hide:"隐藏 API Key",retryReveal:"重试显示 API Key",reveal:"显示 API Key"},task:{preparing:"准备部署",waitingBuildLog:"正在等待构建日志…",waitingGithubLog:"正在等待 GitHub 挂载日志…",syncingGithub:"正在同步当前源码到 GitHub",syncGithubCode:"同步 GitHub 代码",githubSynced:"GitHub 代码已同步",githubSubmitted:"GitHub 代码已提交",githubUpdatingRuntime:"代码已提交到 GitHub,GitHub Actions 正在更新同一个 Runtime",initializingGithub:"开始初始化 GitHub main 分支与 Actions workflow",initializingGithubBranch:"正在初始化 GitHub 持续交付目标分支",mountGithubDelivery:"挂载 GitHub 持续交付",githubBranchInitialized:"GitHub 持续交付已初始化目标分支",githubDeliveryMounted:"GitHub 持续交付已挂载",githubMountFailed:"挂载 GitHub 持续交付失败",githubMountFailedDetail:"GitHub 持续交付挂载失败:{{message}}",githubMountFailedHint:"挂载 GitHub 持续交付失败,详见 GitHub 日志。",applyingMpaProfile:"正在将 Agent 配置应用到 MPA Runtime",mpaProfileApplied:"MPA Runtime 配置已应用",runningMpaSmoke:"正在验证 MPA Runtime 执行链路",mpaReady:"MPA Runtime 已可运行",deploymentComplete:"部署完成",deployedNotConnected:"部署完成,暂未连接",cancelled:"已取消",cancelledHint:"部署已取消,相关 Runtime 资源已请求销毁。",deploymentStatusUnconfirmed:"部署状态待确认",deploymentFailed:"部署失败",buildFailedHint:"构建镜像失败,详见构建日志。"},confirm:{updateTitle:"确认更新",deployTitle:"确认部署",closeLabel:"关闭部署确认",updateDescription:"将更新并发布到当前云端 Runtime,过程可能需要几分钟。确定继续吗?",deployDescription:"将创建新的云端 Runtime,部署过程可能需要几分钟。确定继续吗?",update:"确定更新",deploy:"确定部署"},userPool:{label:"用户池",unnamed:"未命名用户池",current:"当前用户池",ariaLabel:"部署用户池",loading:"正在加载用户池…",placeholder:"请选择用户池",loadingIdentity:"正在加载 Identity 用户池…",empty:"当前账号下暂无 Identity 用户池。",currentHint:"当前 Studio 的登录 JWT 将透传访问此 Runtime。",mismatchHint:"所选用户池不是当前 Studio 使用的用户池,部署后无法从 Studio 调用此 Runtime。",markedHint:"当前 Studio 使用的用户池已在列表中标注。"},authentication:{apiKeyDescription:"默认方式,使用 Runtime API Key 访问",userPool:"用户池",userPoolDescription:"使用 Identity 用户池签发的 JWT"},steps:{buildImage:"构建镜像",deploy:"部署",publish:"发布",syncCode:"同步代码",uploadPackage:"上传代码包",packageImage:"镜像打包",createRuntime:"创建 Runtime",publishService:"发布服务",updateInstances:"更新实例配置",createEvaluationSets:"创建评测集",applyMpaProfile:"应用 MPA 配置",verifyMpaRuntime:"验证 MPA Runtime",mpaReady:"MPA Runtime 可运行"},errors:{instanceRangeInteger:"最小实例数必须为大于等于 0 的整数,最大实例数必须为大于 0 的整数。",instanceRangeOrder:"最小实例数不能大于最大实例数。",selectApiKey:"请先在模型配置中选择 API Key。",loadApiKey:"加载 API Key 失败,请重试。",invalidProject:"项目数据无效",updateFeishu:"更新飞书配置失败:{{message}}",userPoolRequired:"请选择用于 Runtime 鉴权的用户池。",vpcRequired:"使用 VPC 网络时,请填写 VPC ID。",modelSecretRequired:"请填写 {{label}},用于访问对应的自定义模型地址。",managedApiKeyRequired:"{{requirement}},请先返回模型配置选择 API Key。",feishuEnvRequired:"启用飞书后,请填写{{field}}。",runtimeNameExists:"Runtime 名称已存在,请修改后重试。",deployedButGithubMountFailed:"部署成功,但挂载 GitHub 持续交付失败:{{message}}",deployedButGithubBindFailed:"部署成功,但绑定 GitHub 失败:{{message}}",mpaRuntimeIdMissing:"部署成功,但返回缺少 Runtime ID,无法应用 MPA 配置。",mpaOperationIncomplete:"MPA Runtime 初始化未完成,请重试此部署任务。",deploymentStatusUnconfirmed:"连接已中断,当前无法确认部署最终状态。任务可能仍在云端运行,请到 AgentKit 或 Code Pipeline 查看同一任务,避免重复部署。",failedAtStage:"{{action}}失败({{stage}}阶段):{{message}}",noAgentAtEndpoint:"连接成功,但该地址未发现任何 Agent(/list-apps 为空)。",addAgent:"添加 Agent 失败:{{message}}",modelApiKeyRequired:"请填写此模型地址对应的 API Key。"}},EYe={title:"工作区",storageUnavailable:"管理员未配置持久化存储,工作区管理暂不可用。",detail:"工作区详情",create:"新建工作区",editorDescription:"将常用环境组合在一起;同一个环境可以加入多个工作区。",backToList:"返回工作区列表",environmentCount_one:"{{count}} 个环境",environmentCount_other:"{{count}} 个环境",createdAt:"创建时间",updatedAt:"最近更新",basicInfo:"基本信息",namePlaceholder:"例如:内容生产",descriptionPlaceholder:"说明这个工作区的用途",selectedEnvironmentCount:"已选择 {{count}} 个,可在其他工作区中继续复用",searchAvailableEnvironments:"搜索可用环境",searchEnvironments:"搜索环境",noAvailableEnvironments:"还没有可添加的环境",createEnvironmentFirst:"请先在“环境”页面创建并构建环境。",noMatchingEnvironments:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称。",environmentStatus:{available:"可用",building:"构建中",notBuilt:"未构建"},added:"已添加",saved:"已保存工作区“{{name}}”",resourceType:"工作区资源类型",searchWorkspaces:"搜索工作区",loadFailed:"无法加载工作区",noMatchingWorkspaces:"没有匹配的工作区",tryAnotherNameOrEnvironment:"请尝试搜索其他名称或环境",noEnvironmentAdded:"未添加环境",environmentMissing:"环境缺失",availableFraction:"{{available}}/{{total}} 可用",available:"可用",availableCount:"{{count}} 个可用",updated:"更新",addEnvironment:"添加环境",deleteTitle:"删除工作区",deleteDescription:"确定删除工作区“{{name}}”吗?环境本身不会被删除。",deleted:"已删除工作区“{{name}}”",clipboardPermissionError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。",codeProjects:"代码项目"},_Ye={back:"返回",detailNavigation:"详情导航",noData:"暂无数据",actions:"操作",moreActions:"更多操作 {{label}}",actionsFor:"{{label}} 操作",loading:"资源加载中,请稍候"},RYe={addSkill:"添加 Skill",remove:"移除 {{name}}",confirmRemoveRuntime:"从新版本中移除运行中的 Skill「{{name}}」?",selectedCount:"已加入技能 · {{count}}",close:"关闭{{label}}",sources:{runtime:"运行中来源 · 原样保留,可移除或用同名 Skill 替换",local:"本地",skillspace:"AgentKit Skills 中心",skillhub:"火山 Find Skill 技能广场"},tabs:{local:"本地文件",localShort:"本地文件",skillspace:"AgentKit Skills 中心",skillspaceShort:"AgentKit",skillhub:"火山 Find Skill 技能广场",skillhubShort:"Find Skill"}},DYe={model:"模型",turnControls:"流程控制",pause:"暂停",resume:"恢复",interrupt:"中断",cancel:"取消",pauseTurn:"在安全点暂停完整流程",resumeTurn:"恢复完整流程",interruptTurn:"中断当前流程并保留会话上下文",cancelTurn:"取消当前流程且不可恢复",turnState:{running:"运行中",pausing:"正在到达安全点",paused:"已暂停",resuming:"正在恢复",interrupting:"正在中断",cancelling:"正在取消",interrupted:"已中断",completed:"已完成",failed:"失败",cancelled:"已取消",orphaned:"状态待确认",newTurnRequired:"需要从检查点继续"},tasks:{ppt:"PPT",image:"图片生成",video:"视频生成"},prompts:{ppt:{quarterlyReview:"复盘【季度】经营表现,提炼指标差距、原因与行动建议",projectUpdate:"汇报【项目名称】进展:里程碑、风险、预算和资源诉求",solutionProposal:"为【客户行业】输出解决方案:痛点、架构、实施路径与收益",industryAnalysis:"分析【行业主题】趋势,给出竞争格局、机会与战略建议"},image:{launchVisual:"为【品牌或产品】设计【高级科技】风格的发布会主视觉",ecommercePoster:"生成【产品名称】电商海报,突出【核心卖点】与品牌色",conceptRendering:"呈现【产品或空间】在【使用场景】中的写实概念效果图",socialGraphic:"围绕【传播主题】制作简洁专业的企业社媒配图"},video:{brandFilm:"制作【品牌名称】30 秒宣传片,突出【品牌价值】",productLaunch:"为【产品名称】制作 45 秒发布视频:痛点、功能、场景与行动号召",trainingVideo:"制作【培训主题】企业培训视频,讲清【关键操作或规范】",eventTeaser:"生成【活动名称】20 秒预热视频,包含亮点、时间地点和报名信息"}},firstFrame:"首帧",videoToEdit:"待编辑视频",baseVideo:"基础视频",optimizeSkillPlaceholder:"描述你想优化的技能…",createSkillPlaceholder:"描述你想生成的技能…",createVideoPlaceholder:"描述你想创作的视频…",messageAgentPlaceholder:"向 {{name}} 发消息…",selectAgentFirst:"请先选择智能体",selectSkillFirst:"请先选择需要优化的 Skill",availableSkills:"可用技能",availableSubagents:"可用子 Agent",invokeSkill:"调用技能",useSubagent:"使用子 Agent",loadingCapabilities:"正在读取 Agent 能力…",noMatchingSkills:"当前 Agent 没有匹配技能",noMatchingSubagents:"当前 Agent 没有匹配子 Agent",skillFallbackDescription:"加载并执行该技能",agentFallbackDescription:"将本轮交给该 Agent",skill:"技能",uploadImage:"上传图片",uploadDocument:"上传文档或 PDF",uploadVideo:"上传视频",taskMode:"任务模式",selectTaskMode:"选择任务模式",loadingGenerationModel:"正在加载生成模型",modelUnavailable:"模型不可用",cancelTask:"取消{{task}}任务",stopGenerating:"停止生成",viewVideoProgress:"查看视频生成进度",send:"发送",selectTaskType:"选择任务类型",enterprisePrompts:"{{task}}企业提示词",sessionId:"会话 ID",sessionIdLabel:"会话 ID:",initializing:"初始化中",copied:"已复制",copySessionId:"复制会话 ID",sessionIdCopied:"已复制会话 ID",disclaimer:"回答仅供参考",viewLogs:"查看日志"},LYe={selectAgent:"选择 Agent",noLocalAgents:"暂无本地 Agent。",searchRuntime:"搜索 Runtime 名称",mineOnly:"只看我创建的",noRuntimes:"暂无 Runtime。",unsupported:"不支持",createdByMe:"我创建的",connecting:"连接中…",connected:"已连接",connect:"连接",viewInfoFor:"查看 {{name}} 信息",viewInfo:"查看信息",agentAndRuntimeInfo:"Agent 与 Runtime 信息",detailType:"详情类型",agentInfo:"Agent 信息",runtimeInfo:"Runtime 信息",loadingAgentInfo:"读取 Agent 信息…",cannotLoadAgentInfo:"暂时无法读取 Agent 信息",unnamedAgent:"未命名 Agent",subagents:"子 Agent",tools:"工具",skills:"技能",previewUnsupported:"暂不支持预览",mountedComponents:"挂载组件",noMoreAgentInfo:"暂无更多 Agent 配置信息。",local:"本地",model:"模型",status:"状态",memoryMb:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",resources:"资源",version:"版本",loadingDetails:"读取详情…",environmentVariables:"环境变量",errors:{notFound:"该 Runtime 已不存在或列表信息已过期,请刷新列表后重试。",accessDenied:"当前账号无权访问该 Runtime,请检查所属 Project 和访问权限。",previewUnsupported:"该 Agent Server 版本暂不支持信息预览。",unavailable:"该 Runtime 暂时无法访问,请确认其状态为“就绪”后重试。",timeout:"加载超时,请重试"},componentKinds:{knowledgebase:"知识库",memory:"记忆",prompt_manager:"提示词管理",example_store:"样例库",run_processor:"运行处理器",tracer:"链路追踪",toolset:"工具集",plugin:"插件",other:"其他"},runtimeStatus:{ready:"就绪",unreleased:"未发布",running:"运行中",active:"运行中",creating:"创建中",pending:"等待中",deploying:"部署中",updating:"更新中",failed:"失败",error:"异常",stopping:"停止中",stopped:"已停止",deleting:"删除中",deleted:"已删除"}},MYe={agent:"智能体",agentTypes:{general:"通用智能体",mpa:"MPA 智能体",codex:"Codex","deepseek-harness":"DeepSeek",openclaw:"OpenClaw",hermes:"Hermes"},creator:"创建人",namedAgent:"{{name}} 智能体",storageLocation:"存储位置",currentBrowser:"当前浏览器",region:"地域",viewDeploymentProgress:"查看 {{name}} 部署进度",viewRuntimeDetails:"查看 {{name}} Runtime 详情",viewDetails:"查看 {{name}} 详情",time:"时间",remainingTime:"剩余时间",expiringSoon:"即将清空",sandboxRemaining:"{{hours}} 小时 {{minutes}} 分钟",wakeable:"已休眠",neverExpires:"永不过期",editDraftNamed:"编辑草稿 {{name}}",viewProgress:"查看进度",deleteDraftNamed:"删除草稿 {{name}}",recheckCompatibility:"重新检测 {{name}} 的对话兼容性",connectedNamed:"{{name}} 已连接",wakeAndChat:"唤醒 {{name}} 并开始对话",chatWith:"与 {{name}} 对话",waking:"唤醒中",deploying:"部署中",draft:"草稿",checking:"检测中",chatUnsupported:"不支持对话",checkFailed:"检测失败",creatorFilter:"创建人筛选",agentType:"智能体类型",searchAgents:"搜索智能体",handoff:"接力",agentList:"{{type}}列表",noMatchingAgents:"没有匹配的智能体",adjustSearch:"请尝试调整搜索或筛选条件",noAgentType:"暂无 {{type}}",noGeneralAgents:"暂无通用智能体",createGeneralAgentDescription:"创建一个通用智能体,开始构建和对话",createAgentType:"创建{{type}}",createAgent:"创建智能体",loadingMore:"正在加载更多智能体",scrollForMore:"继续下滑加载更多",allLoaded:"已加载全部智能体",deleteDraftTitle:"删除草稿?",deleteDraftDescription:"删除后将无法恢复“{{name}}”。",deleteDraft:"删除草稿",loadGeneralAgents:"加载通用智能体",loadAgentType:"加载 {{type}}",compatibility:{checking:"正在请求 Runtime /list-apps,以确认该智能体是否支持 Studio 对话。",empty:"Runtime /list-apps 未返回可用的 Agent,暂时无法连接对话。",supported:"Runtime 支持 Studio 对话。",unknownError:"Runtime /list-apps 请求失败,未返回可识别的错误信息。"},sandboxStatus:{ready:"就绪",wakeable:"已休眠",creating:"创建中",starting:"启动中",initializing:"启动中",pending:"等待中",running:"运行中",failed:"异常",error:"异常",stopped:"已停止",expired:"已过期",deleting:"删除中",deleted:"已删除",unknown:"未知状态"},wakingHint:"正在唤醒智能体,可能需要一些时间。",mpaCreate:{name:"名称",namePlaceholder:"例如 test-agent",nameHelp:"作为 Runtime 名称,支持 4–64 位字母、数字、下划线或连字符。",stepsLabel:"创建步骤",steps:{basics:"基本信息",postgres:"PostgreSQL",openviking:"OpenViking",autoPostgres:"数据库"},next:"下一步",previousStep:"上一步",pgDescription:"选择已有的 PostgreSQL 实例。创建流程会在该实例中准备智能体的独立业务库。",pgSplitDescription:"使用已配置的业务 PG Workspace。多个智能体共用此 Workspace,每个智能体拥有独立业务库。共享资源记录单独存放在 mpa_admin_workspace / mpa_admin_db,由管理员配置。",pgConsole:"前往火山引擎 AIDAP 创建或查看 PG Workspace",pgHost:"PG 主机地址",pgPort:"PG 端口",pgInvalid:"请填写有效的 PG 主机地址和端口。",pgCredentials:"PG 连接账号和密码由部署服务配置;主机和端口须与服务端配置一致。",openvikingDescription:"可选。三项全部填写才启用 OpenViking;全部留空则不向新智能体注入 OpenViking 配置。",openvikingConsole:"前往火山引擎查看 OpenViking 资源",openvikingUrl:"OpenViking 服务地址",openvikingResourceId:"OpenViking 资源 ID",openvikingApiKey:"OpenViking API Key",openvikingInvalid:"请同时填写有效的 HTTPS 服务地址、资源 ID 和 API Key,或全部留空。",openvikingCredentials:"API Key 仅用于本次创建,不保存到浏览器草稿;刷新页面后需重新填写。",tosTitle:"会话输出存储",tosDescription:"可选。填写完整的 TOS 凭证和存储桶,为新智能体的每个会话挂载独立输出目录。三项均留空时使用服务端预设;服务端未配置时,不启用 TOS 挂载。",tosAccessKey:"TOS Access Key",tosSecretKey:"TOS Secret Key",tosBucket:"TOS 存储桶",tosInvalid:"TOS Access Key、Secret Key 和存储桶必须同时填写。",tosCredentials:"凭证仅用于本次创建,不会保存在浏览器恢复数据或创建任务记录中。",runtimeImage:"MPA 镜像",workerImage:"Worker 镜像",imageDefault:"留空使用配置文件中的默认镜像",imageInvalid:"请输入有效的镜像地址,不要包含网址、空格或登录凭据。",title:"创建 MPA 智能体",agentId:"智能体 ID",description:"描述",region:"部署地域",plan:"创建计划",sharedResources:"准备或复用账号共享 VPC、子网和 APIG 消息网关",agentResources:"准备独立业务库、技能空间和执行环境,部署智能体",readiness:"检查网关和智能体就绪状态,成功后加入列表",checking:"正在检查创建配置…",configured:"创建配置已就绪。提交后会检查云资源并开始准备。",notConfigured:"尚未配置创建所需的资源参数,请联系管理员配置后重试。",loadFailed:"检查创建配置失败,请重试。",reload:"重新检查",submit:"开始创建",retry:"重试创建",newAgent:"新建另一个智能体",newAgentDescription:"新建另一个智能体将开启可编辑的新请求,替换当前恢复草稿,但不会取消旧任务。旧任务仍在运行时,请等待其结束后再提交。",close:"关闭",cancel:"取消创建",confirmCancel:"确认取消",cancelDescription:"取消后会停止后续步骤。已创建的数据库、技能空间、网关和其他已登记资源会保留,可使用同一智能体 ID 重试。",background:"关闭窗口后创建会继续。再次打开可查看进度。",pollFailed:"暂时无法获取进度,正在重新连接。请勿重复创建其他智能体。",creationFailed:"当前步骤未完成,请检查对应资源、服务端配置及权限后,用同一智能体 ID 重试。",cancelFailed:"取消请求失败,请重新查询进度后重试。",cancelled:"创建已取消,已登记资源保留供重试。",timeout:"创建超时,已登记资源保留。请检查对应资源后重试。",interrupted:"创建任务中断。请用同一智能体 ID 重试以恢复已登记资源。",skillSpace:"技能空间",states:{running:"正在创建",cancelling:"正在取消",succeeded:"创建成功",failed:"创建失败",cancelled:"已取消"},stages:{queued:"等待开始",checking:"检查账号与配置",network:"准备 VPC 和子网",gateway:"准备 APIG 和 IM Gateway",database:"准备业务数据库",skills:"准备技能空间",worker:"准备执行环境",deploying:"准备数据库、技能空间和 Runtime",verifying:"等待智能体就绪",admin_workspace:"准备管理 PG Workspace",business_workspace:"准备业务 PG Workspace",admin_database:"初始化共享管理库"},back:"继续创建",pgAutoDescription:"使用 VeADK 部署账号自动创建或复用两个 PG Workspace:mpa_admin_workspace / mpa_admin_db 存放共享资源记录,业务 Workspace 供多个智能体共用,每个智能体拥有独立业务库。无需填写 PG 连接信息,提交创建后开始准备。",pgModeChanged:"此创建任务使用旧的 PG 配置,不能直接切换为自动模式重试。请联系管理员确认已有资源和任务后重新创建。",pgMigrationRequired:"检测到旧共享注册库。请先将共享资源记录迁移到 mpa_admin_workspace / mpa_admin_db,并完成现有 Runtime 的注册库地址切换;完成后点击“重新检查”。"}},IYe={library:"技能库",skill:"技能",skills:"技能",skillSpace:"技能空间",sandboxNotConfigured:"管理员未配置 Dev Sandbox",adminNotConfigured:"管理员未配置",totalItems:"共 {{count}} 项",cannotLoadSpaces:"无法加载技能空间",someSpacesFailed:"部分技能空间加载失败",degradedRelationWarning:"部分关联异常,已恢复可读取技能",downloadZip:"下载 ZIP",optimize:"优化",closeSkillDetails:"关闭技能详情",skillId:"技能 ID",allFiles:"完整文件",loadingSkillContent:"正在读取技能内容…",noSkillContent:"该技能暂无 SKILL.md 内容",addSkill:"添加技能",localUpload:"本地上传",localUploadDescription:"选择 ZIP 文件,校验通过后上传到技能空间",autoCreate:"自动创建",autoCreateDescription:"选择模型和风格,通过对话生成技能",createSkill:"创建技能",optimizeNamed:"优化 {{name}}",deleteSkillConfirm:"确定删除整个 Skill“{{name}}”吗?此操作会影响所有引用它的空间。",deleteSpaceConfirm:"确定删除 Skill 空间“{{name}}”吗?请先确认空间中的技能已删除。",manageSpaceDescription:"管理空间中的技能并创建新的版本",backToSpaces:"返回技能空间列表",overview:"概览",skillCount:"技能数量",skillCountValue_one:"{{count}} 技能",skillCountValue_other:"{{count}} 技能",updatedAt:"更新时间",skillsInSpace:"{{name}}中的技能",searchSkills:"搜索技能",cannotLoadSkills:"无法加载技能",noMatchingSkills:"没有匹配的技能",noSkills:"暂无技能",tryAnotherName:"请尝试搜索其他名称",emptySkillsDescription:"本地上传 Skill,或自动创建",actions:"操作",spaceDetails:"技能空间详情",editSpace:"编辑空间",deleteSpace:"删除空间",searchSpaces:"搜索技能空间",spaceList:"技能空间列表",noMatchingSpaces:"没有匹配的技能空间",createSpace:"新建技能空间",newSpace:"新建空间",loadingMoreSpaces:"正在加载更多技能空间",scrollForMore:"继续下滑加载更多",allSpacesLoaded:"已加载全部技能空间",errors:{loadSpaces:"读取技能空间失败,请稍后重试",loadSkills:"读取技能失败,请稍后重试",loadSkillDetails:"读取技能详情失败,请稍后重试",deleteSkill:"删除 Skill 失败",deleteSpace:"删除 Skill 空间失败",downloadSkill:"下载 Skill 失败"},status:{active:"可用",available:"可用",creating:"创建中",disabled:"已停用",enabled:"已启用",failed:"异常",inactive:"未启用",pending:"等待中",published:"已发布",ready:"就绪",released:"已发布",running:"运行中",success:"正常",unavailable:"不可用",unreleased:"未发布",updating:"更新中",unknown:"未知"},sharedSpace:"企业共享空间",sharedDescription:"面向企业全员开放的技能,由管理员统一发布和维护",sharedVisibility:"全员可见",sharedPreparing:"正在准备共享空间",sharedLoadFailed:"共享空间加载失败",sharedEmpty:"暂无共享技能,管理员发布后会显示在这里",requestPublication:"申请公开",reviewSubmitting:"提交中…",reviewSubmitted:"已申请",reviewFailed:"申请公开失败",reviewStatusFailed:"审核状态加载失败",reviewRetry:"重新申请",reviewPending:"待审核",reviewApproving:"发布中",reviewApproved:"已公开",reviewReturned:"已退回",reviewHistory:"审核记录",skillDetailSections:"技能详情内容",versions:{title:"版本管理",refresh:"刷新",uploading:"上传中…",upload:"上传新版本",close:"关闭",hint:"新版本不会替换已公开版本,审核通过后才会公开;ZIP 中的技能名称需与原技能一致",loading:"正在加载版本…",loadFailed:"无法加载版本",filesFailed:"无法加载版本文件",uploadFailed:"上传新版本失败",submitFailed:"提交申请失败",retry:"重试",empty:"暂无版本",current:"当前版本",notSubmitted:"未申请公开",submitting:"提交中…",submit:"申请公开",processing:"版本状态:{{status}}",filesLoading:"正在加载文件…",filesEmpty:"暂无文件",history:"历史审核记录",shared:"已公开"},author:"作者",authorName:"作者:{{name}}"},PYe={library:"知识库",createBase:"新建知识库",editBase:"编辑知识库",invalidName:"名称必须以字母开头,且只能包含字母、数字和下划线。",nameHelp:"以字母开头,仅支持字母、数字和下划线,最多 48 个字符。",optionalDescription:"描述(可选)",descriptionOnly:"AgentKit 当前仅支持更新知识库描述。",previewWeb:"预览网页内容",addData:"添加数据",openOriginalWeb:"打开原网页",backToEdit:"返回修改",confirmAdd:"确认添加",source:"知识来源",image:"图片",documentFile:"文档文件",webPage:"在线网页",webUrl:"网页 URL",generatingWebPreview:"正在抓取网页并生成 Markdown 预览",selectFile:"选择知识文件",selectOrDropFile:"选择文件或拖拽到这里",selectedFile:"{{size}} · 点击可重新选择",imageFileHelp:"支持 PNG、JPG 和 JPEG,单个文件不超过 200 MB",documentFileHelp:"支持 PDF、PPTX、DOCX、XLSX 和 TXT,单个文件不超过 200 MB",uploadingFile:"正在上传文件并添加到知识库",optionalName:"名称(可选)",optionalType:"类型(可选)",generatePreview:"生成预览",uploadFile:"上传文件",editMetadata:"编辑知识 Metadata",knowledge:"知识",field:"字段",value:"值",backToList:"返回知识库列表",metadataJson:"元数据(JSON)",provider:"服务提供方",knowledgeId:"知识库 ID",project:"项目",creator:"创建者",data:"数据",deleteInvalidAssociation:"删除失效关联",noData:"这个知识库还没有数据",addFirstData:"添加第一项数据",format:"格式",size:"大小",searchData:"搜索数据",searchLibraryData:"搜索知识库数据",associationInvalid:"关联已失效",providerMissing:"底层 Provider 知识库已不存在",noMatchingData:"没有匹配的数据",loadingMoreData:"正在加载更多数据",retryLoading:"重试加载",details:"知识库详情",searchBases:"搜索知识库",someBasesFailed:"部分知识库暂时无法加载,已展示其余可用内容。",noMatchingBases:"没有匹配的知识库",noManagePermission:"您没有管理此知识库的权限",loadingMoreBases:"正在加载更多知识库",deleteBaseTitle:"删除知识库?",deleteBaseDescription:"将删除 {{name}} 的 AgentKit 关联;如果它由 Studio 创建,也会同时删除 Provider 资源。此操作无法撤销。",deleteDocumentTitle:"删除知识?",deleteDocumentDescription:"将从 Provider 知识库中删除 {{name}},此操作无法撤销。",preview:{processingTitle:"数据正在处理中",processingDetail:"知识库完成解析后即可预览,请稍后重新加载。",failedTitle:"数据解析失败",failedDetail:"请检查源文件或网页地址后重新添加,也可以重新加载最新状态。",noParsedTitle:"暂时没有可预览的解析内容",noParsedDetail:"此类文件会在知识库完成解析后显示文本、表格或页面图片。",noMediaTitle:"暂时没有可预览的媒体内容",noMediaDetail:"知识库尚未返回可访问的媒体预览,请稍后重新加载。",noDataTitle:"暂无可预览的数据内容",noDataDetail:"知识库尚未返回解析结果,请稍后重新加载。",attachmentError:"附件无法预览,请稍后重试。",imageAlt:"知识数据图片",audioUnsupported:"当前浏览器不支持音频预览。",videoUnsupported:"当前浏览器不支持视频预览。",namedPdf:"{{name}} PDF 预览",pdf:"PDF 预览",openPdf:"无法显示时,在新窗口打开 PDF",fileUnsupported:"当前格式暂不支持直接在线预览,已优先显示解析后的内容。",openOriginalFile:"打开原文件",loading:"正在加载数据预览",openOriginalHint:"您可以打开原网页查看来源内容。",chunk:"片段 {{index}}",loadingMore:"正在加载更多",loadMore:"加载更多"},errors:{fileTooLarge:"单个文件不能超过 200 MB",invalidImageType:"请选择 PNG、JPG 或 JPEG 图片",invalidDocumentType:"请选择 PDF、PPTX、DOCX、XLSX 或 TXT 文件",createBase:"创建知识库失败",updateBase:"更新知识库失败",metadataObject:"Metadata 必须是 JSON 对象",metadataFormat:"Metadata 格式错误",noWebPreview:"网页没有可预览的 Markdown 内容",addWeb:"添加网页失败",previewWeb:"生成网页预览失败",uploadFile:"上传文件失败",updateDocument:"更新知识失败",loadPreview:"加载数据预览失败",loadMoreBases:"加载更多知识库失败",loadBases:"加载知识库失败",loadMoreData:"加载更多数据失败",loadData:"加载数据失败",deleteBase:"删除知识库失败",deleteDocument:"删除知识失败"}},NYe={title:"飞书渠道",refresh:"刷新",loading:"正在加载渠道配置…",unsupported:"此 Runtime 不支持渠道管理,请升级 MPA 镜像。",unauthorized:"渠道管理需要 Studio 管理员身份及有效的 Runtime 凭据。",configurationError:"渠道管理配置不完整,请检查 Runtime 元数据及加密密钥。",requestFailed:"渠道请求失败,请检查 Runtime 连接后重试。",bound:"已绑定:{{name}}",unbound:"尚未绑定飞书机器人。",guidance:"私聊使用独立会话。在已授权群内 @ 当前机器人即可对话。",keyRequired:"绑定前请在 Runtime 配置持久的 CHANNEL_STATE_ENCRYPTION_KEY。",gateway:"消息网关",route:"入站路由",delivery:"回复投递",configured:"已配置",missing:"未配置",delivery_not_observed:"尚未观测",delivery_delivered:"已投递",delivery_retrying:"重试中",missingConfig:"缺少 Runtime 配置:{{fields}}",bind:"扫码绑定",newQr:"重新生成二维码",unbind:"解除绑定",confirmUnbind:"确认解绑此机器人?解绑后将停止接收新消息。",qrAlt:"机器人绑定二维码",openQr:"打开授权页面",uncertain:"注册过程已中断。重新开始前,请检查机器人绑定与 Gateway 状态。",bindingFailed:"绑定失败,请检查 Gateway 配置后重试。",chatId:"允许的群 ID",scope:"群会话策略",saveGroup:"保存群权限",noGroups:"尚未授权任何群。私聊无需群权限。",edit:"编辑",remove:"移除",removeGroup:"移除 {{name}}",scope_group_sender:"按发言人隔离",scope_group:"全群共享",scope_group_topic_sender:"按话题和发言人隔离",scope_group_topic:"按话题共享",status_PENDING:"等待扫码",status_SCANNED:"已扫码,等待授权",status_AUTHORIZED:"已授权,准备注册",status_REGISTERING:"正在注册机器人",status_BOUND:"机器人已绑定",status_FAILED:"绑定失败",status_EXPIRED:"二维码已过期",workspaceTitle:"消息渠道",workspaceDescription:"连接消息平台,让用户直接与此智能体对话,并管理访问权限。",provider_feishu:"飞书",provider_wecom:"企业微信",provider_dingtalk:"钉钉",comingSoon:"暂未开放",unavailableDescription:"{{name}}的绑定与消息配置暂未开放。",runtimeRequired:"请先将此智能体部署到 Runtime,再配置消息渠道。",bindingTitle:"机器人绑定",connected:"已绑定",notBound:"未绑定",gatewayDescription:"用于接收渠道消息的网关配置。",routeDescription:"将渠道消息转发给当前智能体的路由配置。",deliveryDescription:"实际观测到的回复投递状态,完成配置不代表已成功投递。",groupsTitle:"群聊权限",groupsDescription:"添加允许访问的群,并设置群内对话的共享范围。",providerBindingTitle:"绑定{{name}}",providerUnbound:"绑定{{name}}机器人,让用户通过消息与此智能体对话。",qrGuidance:"使用{{name}}扫码授权,Runtime 将保存机器人凭据并配置消息网关。",wecomGuidance:"使用企业微信扫码授权,或手动填写 Bot ID 和 Secret 绑定已有机器人。",wecomBotId:"Bot ID",wecomSecret:"Secret",bindCredentials:"绑定机器人",wecomScan:"扫码绑定",wecomAuthorizing:"等待企业微信授权…",cancelAuthorization:"取消授权",wecomPopupBlocked:"授权窗口被浏览器拦截,请允许弹窗后重试。",wecomAuthCancelled:"已取消企业微信授权,可以重新扫码。",wecomAuthTimeout:"企业微信授权已超时,请重新扫码。",wecomInvalidResult:"授权结果缺少 Bot ID 或 Secret,请重新授权或手动填写。",wecomAuthFailed:"企业微信授权失败,请重试或手动填写凭据。",dingtalkClientId:"Client ID",dingtalkClientSecret:"Client Secret",manualUpgrade:"当前镜像尚不支持{{name}}手动配置,请升级后使用;仍可使用极速配置。",pairingTitle:"消息渠道扫码配对",feishuPairingDescription:"如果已有连接机器人,飞书扫码并绑定成功后原有机器人会被替换,可选绑定存量机器人或新建机器人。",generatingQr:"正在生成配对二维码…",dingtalkGuidance:"使用钉钉扫码授权,或手动填写 Client ID 和 Client Secret 绑定已有机器人。",wecomPairingDescription:"将在企业微信授权窗口中重新扫码配对。新机器人绑定成功后会替换当前连接;取消授权或绑定失败不会解绑原机器人。",configurationMethod:"配置方式",quickSetup:"极速配置",manualSetup:"手动配置",feishuAppId:"App ID",feishuAppSecret:"App Secret",manualGuidance:"填写已有{{name}}机器人的应用凭据,连接到当前智能体。",manualReplacement:"绑定成功后将替换当前机器人;取消或绑定失败不会解除现有绑定。"},Ndr=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:gYe,agentSelector:LYe,agentWorkspace:vYe,channels:NYe,cloudEnvironment:AYe,common:pYe,composer:DYe,default:{common:pYe,agentKitPromo:gYe,systemInfo:mYe,agentWorkspace:vYe,environmentCenter:yYe,deploymentSelect:bYe,deploymentError:xYe,studioBuildProgress:wYe,cloudEnvironment:AYe,githubCicd:SYe,feishuDeployment:TYe,deploymentResources:CYe,studioUpdate:kYe,projectPreview:OYe,workspace:EYe,resourceCollection:_Ye,skillSourcePicker:RYe,composer:DYe,agentSelector:LYe,myAgents:MYe,skillCenter:IYe,knowledge:PYe,channels:NYe},deploymentError:xYe,deploymentResources:CYe,deploymentSelect:bYe,environmentCenter:yYe,feishuDeployment:TYe,githubCicd:SYe,knowledge:PYe,myAgents:MYe,projectPreview:OYe,resourceCollection:_Ye,skillCenter:IYe,skillSourcePicker:RYe,studioBuildProgress:wYe,studioUpdate:kYe,systemInfo:mYe,workspace:EYe},Symbol.toStringTag,{value:"Module"})),BYe="用户管理",$Ye="{{count}} 位成员",FYe="用户",zYe="角色",UYe="账号状态",VYe="最近登录",GYe="操作",QYe="更改角色",HYe="关闭",WYe="保存角色",YYe="正在保存…",qYe="取消",jYe="返回",XYe="用户池",KYe="火山引擎 Identity",ZYe="搜索姓名、邮箱或用户 ID",JYe="搜索",eqe="筛选角色",tqe="全部角色",rqe="刷新",nqe="正在读取用户…",iqe="更新于 {{time}}",aqe="已将 {{name}} 设置为{{role}}",oqe="重试",sqe="你",lqe="初始超级管理员",cqe="初始超级管理员受保护,不能在此降级",uqe="保存后,对方刷新 Studio 即可使用新的权限",dqe="角色需要重新确认",hqe="没有匹配的用户",fqe="尝试其他关键词或角色",pqe="用户登录或加入当前用户池后会显示在这里",gqe="共 {{count}} 位用户",mqe="上一页",vqe="下一页",yqe="尚未登录",bqe="未提供",xqe={super_admin:"超级管理员",admin:"管理员",developer:"开发者",user:"普通用户"},wqe={super_admin:"管理所有资源,并管理用户和分配角色",admin:"管理 Studio 资源",developer:"开发智能体并管理自己的资源",user:"使用智能体和个人功能"},Aqe={EXTERNAL_PROVIDER:"正常",CONFIRMED:"正常",NORMAL:"正常",ENABLED:"正常",ACTIVE:"正常",UNCONFIRMED:"待验证",DISABLED:"已停用",FORBIDDEN:"已禁用",LOCKED:"已锁定",SUSPENDED:"已暂停",FORCE_CHANGE_PASSWORD:"需要修改密码"},Sqe={request_failed:"请求未完成,请刷新列表确认当前状态后重试",invalid_response:"用户服务返回异常,请刷新后重试",identity_unavailable:"暂时无法访问 Identity,请稍后重试或检查服务权限",identity_resource_missing:"用户或用户池已不存在,请刷新列表",super_administrator_required:"只有超级管理员可以管理用户",sign_in_required:"请登录后重试",user_not_in_pool:"当前账号不属于此用户池",user_disabled:"当前账号已停用",protected_administrator:"不能降低初始超级管理员的权限",cannot_demote_self:"不能降低自己的超级管理员权限",role_change_conflict:"角色已发生变化,请关闭弹窗并刷新列表后重试",cross_origin_request:"请在当前 Studio 页面内修改角色"},Bdr=Object.freeze(Object.defineProperty({__proto__:null,actions:GYe,allRoles:tqe,back:jYe,cancel:qYe,changeRole:QYe,close:HYe,default:{title:BYe,memberCount:$Ye,user:FYe,role:zYe,status:UYe,lastLogin:VYe,actions:GYe,changeRole:QYe,close:HYe,save:WYe,saving:YYe,cancel:qYe,back:jYe,pool:XYe,volcengineIdentity:KYe,searchPlaceholder:ZYe,search:JYe,filterRole:eqe,allRoles:tqe,refresh:rqe,loading:nqe,updatedAt:iqe,saved:aqe,retry:oqe,you:sqe,initialAdministrator:lqe,protectedExplanation:cqe,effectiveAfterRefresh:uqe,roleConflict:dqe,noUsers:hqe,tryAnotherSearch:fqe,poolEmpty:pqe,resultCount:gqe,previous:mqe,next:vqe,neverLoggedIn:yqe,unknown:bqe,roles:xqe,descriptions:wqe,states:Aqe,errors:Sqe},descriptions:wqe,effectiveAfterRefresh:uqe,errors:Sqe,filterRole:eqe,initialAdministrator:lqe,lastLogin:VYe,loading:nqe,memberCount:$Ye,neverLoggedIn:yqe,next:vqe,noUsers:hqe,pool:XYe,poolEmpty:pqe,previous:mqe,protectedExplanation:cqe,refresh:rqe,resultCount:gqe,retry:oqe,role:zYe,roleConflict:dqe,roles:xqe,save:WYe,saved:aqe,saving:YYe,search:JYe,searchPlaceholder:ZYe,states:Aqe,status:UYe,title:BYe,tryAnotherSearch:fqe,unknown:bqe,updatedAt:iqe,user:FYe,volcengineIdentity:KYe,you:sqe},Symbol.toStringTag,{value:"Module"})),Tqe="网站集成",Cqe="将 AgentKit Runtime 以悬浮聊天窗口嵌入网站",kqe="返回自动化列表",Oqe="添加网站",Eqe="正在加载 Runtime",_qe="选择 Runtime",Rqe="网站域名",Dqe="例如 xxxx.com 或 localhost:5173",Lqe="正在生成",Mqe="生成 Token",Iqe="已添加网站",Pqe="{{count}} 个",Nqe="{{count}} 个",Bqe="正在加载网站集成",$qe="还没有网站集成",Fqe="选择 Runtime 并输入网站域名即可生成 Token",zqe="引入方法",Uqe="将下面代码放到网页的 body 结束标签前",Vqe="已复制",Gqe="复制代码",Qqe="添加网站后会在这里生成引入代码。",Hqe="确定删除 {{domain}} 的网站集成吗?",Wqe={load:"加载网站集成失败",create:"创建网站集成失败",delete:"删除网站集成失败",noConversationalAgent:"该 Runtime 暂未发现可对话的 Agent"},Yqe={requestFailed:"请求失败 ({{status}})",greeting:"您好,有什么可以帮您?",sessionFailed:"无法建立对话会话",unauthorized:"当前网站未获得对话授权",conversationFailed:"对话请求失败,请稍后重试",open:"打开智能体对话",close:"关闭智能体对话",panelLabel:"智能体对话面板",assistant:"智能体助手",online:"在线对话"},$dr=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:Oqe,addedWebsites:Iqe,backToAutomations:kqe,confirmDelete:Hqe,copied:Vqe,copyCode:Gqe,default:{title:Tqe,description:Cqe,backToAutomations:kqe,addWebsite:Oqe,loadingRuntime:Eqe,selectRuntime:_qe,websiteDomain:Rqe,domainPlaceholder:Dqe,generating:Lqe,generateToken:Mqe,addedWebsites:Iqe,websiteCount_one:Pqe,websiteCount_other:Nqe,loadingIntegrations:Bqe,delete:"删除",emptyTitle:$qe,emptyDescription:Fqe,embedMethod:zqe,embedInstructions:Uqe,copied:Vqe,copyCode:Gqe,embedHint:Qqe,confirmDelete:Hqe,errors:Wqe,widget:Yqe},description:Cqe,domainPlaceholder:Dqe,embedHint:Qqe,embedInstructions:Uqe,embedMethod:zqe,emptyDescription:Fqe,emptyTitle:$qe,errors:Wqe,generateToken:Mqe,generating:Lqe,loadingIntegrations:Bqe,loadingRuntime:Eqe,selectRuntime:_qe,title:Tqe,websiteCount_one:Pqe,websiteCount_other:Nqe,websiteDomain:Rqe,widget:Yqe},Symbol.toStringTag,{value:"Module"})),qqe={types:{all:"全部类型",document:"文档",image:"图片",video:"视频"},previewArtifact:"预览 {{name}}",moreActions:"更多操作 {{name}}",actionMenu:"{{name}} 操作",download:"下载",downloading:"下载中",edit:"编辑信息",delete:"删除产物",previewFailed:"无法预览“{{name}}”:{{message}}",downloadStarted:"已开始下载 {{name}}",downloadFailed:"无法下载“{{name}}”:{{message}}",updated:"已更新 {{name}}",deleted:"已删除 {{name}}",deleteFailed:"无法删除“{{name}}”:{{message}}",typeFilter:"产物类型",searchAria:"搜索产物",searchPlaceholder:"搜索产物或会话",retry:"重试",close:"关闭",listAria:"产物列表",loadFailed:"产物加载失败",loadDetailFallback:"请检查存储配置后重试。",reload:"重新加载",noMatch:"没有找到匹配的产物",noArtifacts:"您还没有任何产物",searchHint:"请尝试搜索其他名称或切换类型",emptyHint:"聊天中生成的产物会自动显示在这里",columns:{name:"名称",source:"来源",updatedAt:"修改时间",actions:"操作"},loadingMore:"正在加载更多产物",unknownTime:"时间未知",preview:{close:"关闭预览",meta:"{{type}} / 版本 {{version}}",loading:"正在加载预览",alt:"{{name}} 预览",loadFailed:"预览加载失败,请稍后重试或下载查看",unsupported:"当前格式暂不支持在线预览,请下载查看",sourceAria:"产物来源",agent:"智能体",session:"会话",tool:"生成工具",createdAt:"生成时间",fileSize:"文件大小",tags:"标签",viewSession:"查看会话"},deleteDialog:{title:"删除产物?",description:"“{{name}}”将从产物库永久删除,聊天记录不会受到影响。",deleting:"删除中",confirm:"删除",close:"关闭删除确认框"},api:{withStatus:"{{message}}({{status}})",listFailed:"读取产物库失败",syncFailed:"同步聊天产物失败",updateFailed:"更新产物失败",deleteFailed:"删除产物失败",downloadFailed:"下载产物失败"}},jqe={unknownSource:"未知来源",unknownCreator:"未知创建者"},Xqe={nameRequired:"请输入产物名称",tooManyTags:"标签最多 {{max}} 个",tagTooLong:"单个标签不能超过 {{max}} 个字符",title:"编辑产物信息",subtitle:"内容文件不会被修改",close:"关闭编辑框",name:"名称",description:"描述",descriptionPlaceholder:"补充用途、版本或使用说明",tags:"标签",tagsPlaceholder:"使用逗号分隔,最多 {{max}} 个",cancel:"取消",saving:"保存中",save:"保存"},Kqe={change:{added:"新增",modified:"修改",deleted:"删除"},noChanges:"两个版本的源码没有差异",chooseFile:"从左侧选择文件以查看代码",compareTitle:"版本对比",workspaceTitle:"源码工作区",projectFallback:"Agent 项目",switchTheme:"切换源码主题",switchThemeTitle:"切换为{{theme}}主题",themes:{dark:"深色",light:"浅色"},closeWorkspace:"关闭源码工作区",close:"关闭",changedFiles:"变更文件",projectFiles:"项目文件",changes:"变更",files:"文件",openFiles:"打开的文件",noFileSelected:"未选择文件",comparisonDirection:"对比方向",before:"优化前",after:"优化后",loadingEditor:"正在加载编辑器…",changedFileCount_one:"{{count}} 个文件有变更",changedFileCount_other:"{{count}} 个文件有变更",fileCount_one:"{{count}} 个文件",fileCount_other:"{{count}} 个文件",lineCount_one:"{{count}} 行 · UTF-8",lineCount_other:"{{count}} 行 · UTF-8",viewSource:"查看源码",viewSourceAria:"查看和编辑项目源码"},Zqe={nav:"搜索",selectAgent:"请选择 Agent",checkingCapabilities:"正在检测 Agent 能力",notMounted:"当前 Agent 未挂载{{label}}",sources:{session:"会话",web:"网络",knowledge:"知识库",memory:"长期记忆"},webDescription:"通过 web_search 工具检索",backendLocal:"本地",failed:"搜索失败:{{message}}",placeholder:{selectAgent:"请先选择 Agent",web:"在网络中检索",knowledge:"在 {{name}} 中检索",knowledgeFallback:"当前 Agent 的知识库",memory:"在 {{name}} 中检索",memoryFallback:"当前用户的长期记忆",session:"在当前 Agent 的会话中检索"},sourceTypeAria:"搜索类型:{{label}}",notSelected:"未选择",sourceType:"搜索类型",selectSource:"选择搜索类型",noAgentHint:"选择一个 Agent 后,即可检索会话、网络及其挂载的数据源。",loadingCapabilities:"正在读取当前 Agent 的检索能力…",sourceUnavailable:"当前 Agent 未挂载该数据源",instructions:{web:"输入关键词后回车或点击按钮,通过 web_search 工具检索。",knowledge:"输入问题,检索当前 Agent 挂载的知识库。",memory:"输入线索,检索当前用户跨会话保存的长期记忆。",session:"输入关键词后回车或点击按钮,搜索当前 Agent 的会话。"},noResults:"未找到匹配“{{query}}”的结果。",knowledgeFragment:"知识片段 {{index}}",memoryFragment:"记忆片段 {{index}}"},Jqe={title:"开发者资源",sections:{documentation:{title:"相关链接",description:"查看开发文档与 AgentKit 常用入口"},bestPractices:{title:"最佳实践",description:"参考开发、调试与部署经验"},showcases:{title:"案例展示",description:"探索 AgentKit 应用案例"}},links:{veadkDocs:"VeADK 文档",cliDocs:"AgentKit CLI 文档",platformDocs:"AgentKit 平台文档",console:"AgentKit 控制台"},articles:{veadkDevelopment:{title:"使用 VeADK 开发并部署智能体",description:"使用 VeADK 构建 Agent,并部署至 AgentKit 智能体运行时。"},cliDevelopment:{title:"使用 AgentKit CLI 开发并部署智能体",description:"通过 AgentKit CLI 创建项目、调试 Agent,并完成部署。"},coverAlt:"{{title}}文章封面"},showcases:{researchAssistant:{title:"多智能体研究助手",description:"由多个专业 Agent 协同完成资料检索、分析和结论整理。"},multimodalAnalysis:{title:"多模态内容分析",description:"在统一会话中理解图片、文档和视频内容。"},customerService:{title:"智能客服工作台",description:"结合知识检索与工具调用处理复杂的客户服务任务。"},webSearch:{title:"联网搜索 Agent",description:"检索实时网页内容,并将信息整理为可追溯的回答。"},a2uiApp:{title:"A2UI 交互应用",description:"让 Agent 根据任务过程生成可交互的前端界面。"},previewAlt:"{{title}}界面预览"}},eje={title:"资源库",untitledSession:"未命名会话",categoryAria:"资源库分类",regionAria:"区域",tabs:{skills:"技能库",knowledge:"知识库",artifacts:"产物"}},tje={title:"管理 Agent",subtitle:"列出你有权管理的 AgentKit Runtime",mainAgentOnly:"仅显示主 Agent(控制面信息)。",deleteConfirm:'确定删除 Agent "{{name}}"?该 Runtime 将被永久删除。',regionFilterTitle:"按区域筛选",regionFilterAria:"区域筛选",regionAria:"区域",refresh:"刷新",loading:"加载中…",empty:"暂无你部署的 Agent。",connected:"已连接",connect:"连接到此 Agent",deleteRuntime:"删除该 Runtime",loadingDetail:"读取详情…",agentStructure:"Agent 结构",secretHidden:"敏感值不展示,可通过授权请求直接复制",revealSecret:"{{key}} 的敏感值",copySecret:"复制 {{key}} 的值",copy:"复制",copied:"已复制",copyFailed:"复制失败",notConfigured:"未配置",fields:{model:"模型",description:"描述",status:"状态信息",project:"项目",version:"版本",resources:"资源",memory:"记忆",tool:"工具",knowledge:"知识",mcpToolset:"MCP 工具集",updatedAt:"更新时间"},resource:{memory:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",concurrency:"并发 {{value}}"},environmentVariables:"环境变量",unnamed:"(未命名)"},rje={mainAgent:"主 Agent",subAgent:"子 Agent {{index}}",itemCount_one:"{{count}} 项",itemCount_other:"{{count}} 项",info:"Agent 信息",infoAndTopology:"Agent 信息与设置",loadingInfo:"正在读取 Agent 信息…",unnamedAgent:"未命名 Agent",agentsMd:"AGENTS.md",tools:"工具",toolList:"工具列表",studioTool:"Studio Tool",removeTool:"移除工具 {{name}}",remove:"移除",notConfigured:"未配置",addStudioTool:"添加 Studio 工具",addStudioToolHere:"在此对话中添加 Studio 工具",skills:"技能",skillList:"技能列表",addSkill:"添加技能空间技能",addSkillHere:"向此会话添加技能空间技能",skillMountNextTurn:"挂载的版本将在下一 Turn 开始时冻结。",previewUnsupported:"暂不支持预览",sessionEnvironment:"会话环境",environment:"环境",agentCanvas:"Agent 画布",topology:"结构拓扑",nodeKinds:{agent:"Agent",sandbox:"沙箱","worker-session":"Worker 会话","skill-space":"技能空间",skill:"技能","studio-tool":"Studio 工具",mcp:"MCP",environment:"环境",knowledge:"知识库","sub-agent":"子 Agent"},nodeStatuses:{configured:"已配置",mounted:"已挂载",running:"运行中",paused:"已暂停"},viewCanvasFullscreen:"全屏查看 Agent 画布",viewFullscreen:"全屏查看",executionCanvas:"Agent 执行画布",fullscreenExecutionCanvas:"全屏 Agent 执行画布",closeFullscreenCanvas:"关闭全屏画布",close:"关闭",capabilitiesSubtitle:"能力与协作拓扑",closeInfo:"关闭 Agent 信息",infoUnavailable:"暂时无法读取 Agent 信息。",refresh:"刷新信息",loadingSkills:"正在加载绑定技能…",sessionSkills:"本会话临时技能",noBoundSpace:"当前智能体未绑定技能空间。",noBoundSkills:"绑定的技能空间暂无技能。",loadFailed:"加载失败,请刷新重试。",accessDenied:"无权读取此信息。",documentUnsupported:"当前 Runtime 不支持 Studio 读取 AGENTS.md,请升级 Runtime 镜像。",skillsUnsupported:"当前 Runtime 未提供技能空间绑定信息。",skillsDegraded:"技能信息不完整,请刷新重试。",documentEditHint:"编辑最新版本。保存会发布新版本到此技能空间,可能影响使用它的其他智能体。运行中的会话可能需要等待缓存刷新或新建会话后生效。请保留 frontmatter 中的 name。",documentLoading:"正在加载 SKILL.md…",documentWritable:"可编辑",documentReadOnly:"只读:此空间或当前权限不允许编辑",documentLoadFailed:"无法加载 SKILL.md,请刷新重试。",documentSaveFailed:"未确认保存成功,已保留编辑内容。重试前请重新打开,检查当前版本。",documentConflict:"技能已有新版本。请复制当前修改,再重新打开编辑器,避免覆盖。",discardDocument:"放弃未保存的修改?",keepEditing:"继续编辑",discardChanges:"放弃修改",saveDocument:"保存为新版本"},nje={mountFailed:"挂载环境失败",closeDialog:"关闭环境弹窗",addTitle:"添加环境",description:"选择当前会话允许 Agent 使用的 Sandbox 环境",closeAdd:"关闭添加环境",searchAria:"搜索环境",searchPlaceholder:"搜索环境名称或能力",availableAria:"可用环境与工作区",loading:"正在读取可用环境…",noMatch:"没有匹配的环境或工作区",workspaces:"工作区",reuseAll:"复用工作区中的全部可用环境",availableEnvironmentCount_one:"{{count}} 个可用环境",availableEnvironmentCount_other:"{{count}} 个可用环境",selectWorkspace:"选择工作区 {{name}}",environments:"环境",includedByWorkspaces:"已由工作区 {{names}} 包含",nameSeparator:"、",selectEnvironment:"选择环境 {{name}}",selectedWorkspaceCount_one:"{{count}} 个工作区",selectedWorkspaceCount_other:"{{count}} 个工作区",coveredEnvironmentCount_one:"{{count}} 个环境",coveredEnvironmentCount_other:"{{count}} 个环境",selectionSummary:"已选择 {{workspaces}},覆盖 {{environments}}",cancel:"取消",mounting:"正在挂载…",confirm:"确认添加",mountedAria:"已挂载环境",environmentCount_one:"{{count}} 个环境",environmentCount_other:"{{count}} 个环境",removeWorkspace:"移除工作区 {{name}}",remove:"移除",removeEnvironment:"移除环境 {{name}}",add:"添加环境",addMore:"添加更多环境",addForSession:"为当前 Session 添加环境",loadingAvailable:"正在加载可用环境…",empty:"暂无可用的 AIO Sandbox 环境。"},ije={loading:{searching:"正在查找已有环境",creating:"环境初始化中",connecting:"正在连接已有环境"},initializationFailed:"AgentKit CLI 环境初始化失败,当前状态:{{status}}。",sessionExpired:"AgentKit CLI Session 不存在或已过期,请重试。",initializationTimeout:"AgentKit CLI 环境初始化超时,请稍后重试。",nonPersistent:"非持久化环境",recyclingHoursMinutes:"{{hours}} 小时 {{minutes}} 分钟后环境回收",recyclingMinutes:"{{minutes}} 分钟后环境回收",connectionError:`无法连接 Studio 服务,未收到服务端响应。 +{{value}}`,original:"原始错误:{{message}}",details:"详细信息"},uYe={ariaLabel:"Skill 文件树",viewSource:"查看源码",viewPreview:"查看预览",download:"下载",binaryFile:"二进制文件",bytes:"{{value}} 字节",binaryDescription:"当前接口仅返回文件元数据,可单独下载原文件。",metadata:"Skill 元数据",noFiles:"暂无文件"},dYe={close:"关闭",name:"名称",region:"地域",optionalDescription:"描述(可选)",cancel:"取消",create:"创建",creating:"创建中…",save:"保存",saving:"保存中…",upload:"上传",uploading:"上传中…",createSpaceTitle:"新建 Skill 空间",editSpaceTitle:"编辑 Skill 空间",uploadTitle:"上传到 {{name}}",createSpaceFailed:"创建 Skill 空间失败",updateSpaceFailed:"更新 Skill 空间失败",archiveValidationFailed:"Skill ZIP 格式校验失败",uploadFailed:"上传 Skill 失败",dropzone:"拖拽 Skill ZIP 到这里",chooseLocalFile:"或点击选择本地文件",archiveHelp:"ZIP 根目录需要包含 SKILL.md,也可以只包含一层包装目录。选择后仅检查格式,不会自动上传。",validating:"正在检查文件格式…",validationPassed:"格式检查通过:{{name}},共 {{count}} 个文件"},hYe={styles:{concise:"简洁实用",strict:"严谨稳健",tutorial:"教程友好",automation:"自动化优先",custom:"自定义",customFallback:"自定义风格"},stages:{preparing:"正在准备 Dev Sandbox",ready:"Skill 已生成并通过格式校验",failed:"生成失败",cancelled:"已停止",validating:"正在校验 Skill 格式",packaging:"正在整理文件",generating:"正在生成 Skill",repairingAgain:"正在再次修复",autoRepairing:"正在自动修复({{attempt}}/{{max}})"},validation:{fallback:"Skill 格式校验未通过",repairInstruction:"只修复下面列出的 Skill 格式错误,不要改变原有用途和内容范围。",recheckInstruction:"修复后重新检查目录结构、SKILL.md frontmatter 和所有文本文件。",nameTooLong:"Skill 名称不能超过 64 个字符",invalidName:"Skill 名称只能包含小写字母、数字和连字符",modelTooLong:"模型 ID 不能超过 128 个字符",invalidModel:"模型 ID 只能包含字母、数字、点、下划线、连字符、斜杠和冒号"},errors:{loadCapability:"读取 Dev Sandbox 配置失败",autoRepair:"自动修复格式错误失败",pollCandidate:"读取候选方案状态失败,正在重试",createCandidate:"创建候选方案失败",refine:"继续调整失败",repairAgain:"再次修复格式错误失败",selectSpace:"请选择上传的 Skill Space",unsupportedRegion:"当前 Skill 地域不受支持",upload:"上传 Skill 失败",download:"下载失败"},sessionMax:"Session 最长保留 1 小时",remaining:"剩余 {{minutes}}:{{seconds}}",unnamedSpace:"未命名 Skill Space",leaveConfirmation:"离开后将停止并释放正在运行的 Dev Sandbox,确定离开吗?",createTitle:"创建技能",optimizeTitle:"优化 {{name}}",skillFallback:"技能",back:"返回技能空间",home:"主页技能生成",basicInfo:"基本信息",goal:"目标",createIntentPlaceholder:"描述希望这个 Skill 完成什么任务",optimizeIntentPlaceholder:"描述希望如何优化当前 Skill",skillName:"Skill 名称",autoNamePlaceholder:"留空时自动生成",nameHelp:"仅支持小写字母、数字和连字符;留空时自动生成。",createPlans:"生成方案",optimizePlans:"优化方案",createPlansDescription:"按不同方案并行生成多个技能,您可以选择最佳结果",optimizePlansDescription:"按不同方案并行优化当前技能,您可以选择最佳结果",plan:"方案 {{count}}",remove:"移除",model:"模型",modelPlaceholder:"选择或输入模型 ID",style:"风格",customStyle:"自定义风格",customStylePlaceholder:"描述表达方式、严谨程度或输出偏好",addConfiguration:"添加配置",notConfigured:"管理员未配置",generate:"生成",candidates:"候选方案",progress:"进度",retryCandidate:"重试此方案",formatValidationFailed:"格式校验未通过",repairAgain:"再次修复",files:"文件",downloadZip:"下载 ZIP",loadingFiles:"正在读取文件…",filesPending:"生成过程中会在这里显示完整文件树",uploadToSpace:"上传到 Skill Space",loadingSpaces:"正在加载 Skill Space",selectSpace:"选择 Skill Space",continuePlaceholder:"继续调整这个候选方案",continue:"继续调整",uploading:"上传中…",overwrite:"覆盖原 Skill",uploadToSelectedSpace:"上传到 Skill Space",uploadToCurrentSpace:"上传到当前空间",allCandidatesFailed:"所有方案均创建失败,可分别重试。"},fYe={invalidFormat:"{{label}}格式错误。",recoveryStatus:"Skill 恢复点状态",errorResponse:"错误响应",errorDetails:"错误详情",missingContentType:"Content-Type 缺失",gatewayError:"{{fallback}}(HTTP {{status}},Content-Type: {{contentType}})。请检查代理或网关配置。",nonJson:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}},Content-Type: {{contentType}}),请检查代理或网关配置。",activity:"Skill 会话活动",invalidActivity:"Skill 会话活动格式错误。",invalidToolActivity:"Skill 工具活动格式错误。",invalidTextActivity:"Skill 文本活动格式错误。",publication:"Skill 发布结果",task:"Skill 会话",file:"Skill 文件",unknownTaskState:"Skill 会话状态无法识别。",capability:"Skill 工作台能力",loadCapability:"读取 Skill 工作台能力失败",prepareTask:"准备 Skill 会话失败",taskReference:"Skill 会话引用",startOptimization:"开始优化 Skill 失败",startTask:"开始 Skill 会话失败",taskSummary:"Skill 会话摘要",taskList:"Skill 会话列表",loadTaskList:"读取 Skill 会话列表失败",invalidTaskList:"Skill 会话列表格式错误。",loadTask:"读取 Skill 会话失败",artifact:"Skill 产物",artifactFile:"Skill 产物文件",loadArtifact:"读取 Skill 产物失败",refine:"继续调整 Skill 失败",stop:"停止当前 Skill 任务失败",publish:"发布 Skill 失败",nonNdjson:"发布 Skill 失败:服务端返回了非 NDJSON 响应。",missingStream:"发布 Skill 失败:服务端没有返回进度流。",publishProgress:"发布进度",invalidPublishProgress:"发布进度格式错误。",publishError:"发布错误",unknownPublishEvent:"未知的发布进度事件。",publishResult:"发布结果",streamEnded:"发布进度流提前结束,无法确认发布结果。请刷新技能中心确认状态。",deleteTask:"删除 Skill 会话失败",download:"下载 Skill 失败"},Pdr=Object.freeze(Object.defineProperty({__proto__:null,api:fYe,configSelect:sYe,conversation:lYe,default:{configSelect:sYe,conversation:lYe,errorDetails:cYe,fileTree:uYe,management:dYe,generation:hYe,api:fYe},errorDetails:cYe,fileTree:uYe,generation:hYe,management:dYe},Symbol.toStringTag,{value:"Module"})),pYe={back:"返回上一页",reload:"重新加载",notConfigured:"未配置",name:"名称",description:"描述",delete:"删除",save:"保存",saving:"保存中",add:"添加",manage:"管理",environment:"环境",noDescription:"暂无描述",refresh:"刷新",close:"关闭",retry:"重试",loading:"加载中…",previousPage:"上一页",nextPage:"下一页",edit:"编辑",all:"全部",search:"搜索",cancel:"取消",view:"查看",viewDetails:"查看详情",deleting:"删除中…",create:"创建",creating:"创建中",adding:"添加中",generating:"生成中",uploading:"上传中",preview:"预览",loadFailed:"加载失败",select:"选择",collapse:"收起",expand:"展开",none:"无"},gYe={ariaLabel:"AgentKit 快速入口",closeAriaLabel:"关闭 AgentKit 欢迎卡片",title:"欢迎使用 AgentKit",description:"通过 AgentKit 平台快速构建与托管您的企业级智能体",docsAriaLabel:"打开 AgentKit 文档,在新窗口打开",docs:"文档",consoleAriaLabel:"打开 AgentKit 控制台,在新窗口打开",console:"控制台"},mYe={checkUpdates:"检查更新",checkingVersions:"正在检查版本…",versionCheckError:"查询沙箱版本失败,请检查凭据、区域及接口权限后重试",sandboxUpdateError:"Sandbox 更新失败,请刷新检查实际状态后重试",modelEnvRepairUnavailable:"无法补齐模型环境变量,请检查 CODEX_API_KEY 和 CODEX_BASE_URL",updateSandbox:"更新{{variant}}{{name}}",updatingSandbox:"更新中",title:"系统信息",description:"查看当前 Studio 版本及关联的基础资源",general:"通用",currentVersion:"当前版本",storage:"存储",loadingStorage:"正在加载存储信息",tosAddress:"TOS 地址",openTosConsole:"在云控制台中打开 TOS 存储桶",environmentBuild:"环境构建",loadingEnvironmentResources:"正在加载环境构建资源",environmentResourcesError:"环境构建资源加载失败,请检查云凭据后重试。",codePipelineWorkspace:"CodePipeline 工作空间",codePipelinePipeline:"CodePipeline 流水线",openCodePipelineWorkspace:"在云控制台中打开 CodePipeline Workspace",createdOnFirstBuild:"首次构建时自动创建",containerRegistryRepository:"Container Registry 仓库",openContainerRegistryRepository:"在云控制台中打开 Container Registry 仓库",sandboxInfo:"沙箱信息",loadingSandboxInfo:"正在加载沙箱信息",sandboxInfoError:"沙箱信息加载失败,请重试。",snapshot:"快照版",snapshotWithSpace:"快照版 ",openToolConsole:"在云控制台中打开{{name}}",updateModelEnv:"更新{{variant}}{{name}}模型环境变量",modelEnvUpdated:"已更新",modelEnvAlreadyCurrent:"无需更新",userPool:"用户池",loadingUserPool:"正在加载用户池",userPoolError:"用户池加载失败,请重试。",modelEnvUpdateError:"模型环境变量更新失败,请重试。",openUserPoolConsole:"在云控制台中打开用户池{{name}}",unnamedUserPool:"未命名用户池",id:"ID",domain:"域名",region:"区域",noLocalUserPool:"本地模式未配置用户池",noUserPool:"当前 Studio 未配置用户池"},vYe={workspace:"Agent 工作区",library:"Agent 库",evaluation:"评测",agentList:"Agent 列表",agentDetails:"Agent 详情",newAgent:"新建 Agent",loading:"加载中…",loadingCloudAgents:"正在加载云端 Agent…",noAgentSelected:"请选择一个 Agent",local:"本地",remote:"云端",localAgent:"本地 Agent",remoteAgent:"云端 Agent",agentCount:"{{count}} 个 Agent",agentCountLabel:"Agent 数量",details:"详情",chat:"对话",update:"更新",backToAgentList:"返回 Agent 列表",loadingAgent:"正在加载 Agent",loadingAgentDescription:"正在读取 Agent 配置和 Runtime 信息。",loadingAgentInfo:"正在加载 Agent 信息…",detailLoadFailed:"无法加载 Agent 详情",detailLoadFailedDescription:"请检查 Runtime 状态后重试。",partialInfoUnavailable:"部分信息暂时不可用",upgradeRuntimeForDetails:"请升级 Runtime 以查看完整 Agent 信息。",basicInfo:"基本信息",usageOverview:"使用概览",sections:{basic:"基本信息",profileConfig:"Profile 配置",sessionConfig:"会话配置",usage:"使用概览",diagnostics:"诊断",evaluations:"评测",optimizations:"优化建议",integrations:"集成",versions:"版本",channels:"消息渠道"},evaluationGroup:"评测组",optimizations:"优化建议",optimizationsDescription:"根据评测结果查看可执行的优化建议。",integrations:"集成",githubVersions:"GitHub 版本",githubVersionsDescription:"查看持续交付产生的版本并创建回退 PR。",currentVersionOnly:"当前未启用 GitHub 持续交付,仅展示当前生产版本。",loadingVersions:"正在加载版本…",noVersion:"暂无版本记录",prLink:"Pull Request",viewPr:"查看 PR",author:"提交人",publishStatus:"发布状态",viewRelease:"查看发布记录",rollbackToVersion:"回退到此版本",rollingBack:"正在创建回退…",rollbackEvent:"回退事件",sourceMergedRuntimeStill:"最新源码已合并,但 Runtime 仍处于",currentProductionVersionHint:";当前生产版本保持不变。",usageSummary:"使用统计",totalCalls:"总调用次数",userCount:"用户数",userDetails:"用户明细",usageUserList:"Agent 使用用户列表",user:"用户",callCount:"调用次数",lastUsed:"最近使用",unknownUser:"未知用户",loadingUsage:"正在加载使用数据…",refreshing:"刷新中…",noUsage:"暂无使用记录",usageUnavailable:"当前 Agent 暂无可用的使用统计。",usagePagination:"使用记录分页",pageOf:"第 {{page}} / {{total}} 页",notProvided:"暂未提供",integrationMethods:"集成方式",integrationDescription:"通过 Runtime API 或 A2A 协议集成当前 Agent。",integrationProtocol:"集成协议",runtimeStatus:"Runtime 状态",executionFlow:"执行流程",probingIntegration:"正在检测集成能力",probingIntegrationDescription:"正在读取可用端点和鉴权配置。",configurationStatus:"配置状态",discoveryEndpoint:"发现端点",invocationEndpoint:"调用端点",invocationUrl:"调用地址",authentication:"鉴权方式",networkAccess:"网络访问",notAvailable:"暂无",noAuthentication:"无需鉴权",noApiKeyRequired:"无需 API Key",usesOauthJwt:"使用 OAuth / JWT",showApiKey:"显示 API Key",hideApiKey:"隐藏 API Key",pythonExample:"Python 示例",deploymentConfig:"部署配置",deploymentConfigDescription:"确认实例和运行配置后更新 Runtime。",deploymentRegion:"部署区域",mpaControlPlane:"MPA 控制面",loadingMpaAgentView:"正在读取 MPA Runtime 绑定…",mpaRuntimeBound:"该 MPA Agent 已绑定唯一 Runtime,可继续管理。",mpaRuntimeMissing:"当前 Agent 没有可见的 MPA Runtime 绑定。",mpaRuntimeBindingAmbiguous:"多个 MPA Runtime 匹配当前 Agent,请先修复绑定后再修改。",mpaRuntimeOrphan:"Runtime 存在,但其中没有当前 MPA Profile。",mpaRuntimeLegacyAuthUnsupported:"该 Runtime 使用旧版 MPA 镜像,仍要求 X-Jwt-Token。请先更新到当前 AgentKit 兼容镜像,再管理 Profile 或 Session 配置。",profileConfig:"Profile 配置",profileConfigTitle:"Profile 配置",profileConfigDescription:"查看并应用 Agent 级 MPA Profile。Profile 是 Runtime 的长期默认配置,新会话默认继承它。",profileStatus:"Profile 状态",profileApplied:"已应用",profileNotApplied:"未应用",profileNotAppliedDescription:"当前 Runtime 可运行,但尚未保存为 Studio 可管理的 Profile。应用后会生成 Profile revision。",applyProfile:"应用 Profile",reapplyProfile:"重新应用 Profile",editProfile:"编辑 Profile",profileApplying:"应用中…",profileAppliedNotice:"Profile 已应用,当前 revision 为 {{revision}}。",profileApplyIncomplete:"Profile 应用未完成,请查看当前操作状态后重试。",profileApplyFailed:"Profile 应用失败。",profilePrompt:"系统提示词",profileResources:"资源配置",profileResourceSummary:"{{tools}} 个工具 · {{skills}} 个 Skill · {{mcp}} 个 MCP 服务",sessionConfigTitle:"会话配置",sessionConfigDescription:"查看和调整当前 MPA Session 的执行配置。变更只对下一轮对话生效。",loadingSessionConfig:"正在加载会话配置…",sessionConfigNoAgent:"请选择一个 MPA Agent 后再管理会话配置。",sessionConfigNonMpa:"会话配置仅适用于 MPA Agent。",sessionConfigNoSession:"请先打开这个 MPA Agent 的对话,再修改会话配置。",sessionConfigDifferentRuntime:"请先切回这个 MPA Agent 的当前对话,再修改会话配置。",sessionConfigSaved:"会话配置已更新,下一轮对话将使用新 revision。",sessionConfigStale:"该 Session 已被其他位置修改,已展示最新配置,请确认后再保存。",sessionConfigRevision:"配置 revision",sessionProfileRevision:"Session Profile revision",latestProfileRevision:"最新 Profile revision",sessionProfileUpgradeAvailable:"检测到新的 Profile revision:v{{current}} → v{{target}}。",upgradeSessionProfile:"升级 Session Profile",sessionProfileUpgrading:"升级中…",sessionProfileUpgraded:"Session Profile 已升级,下一轮对话将使用新 revision。",sessionProfileUpgradeFailed:"Session Profile 升级失败。",sessionModelOverride:"模型覆盖",modelId:"模型 ID",inheritProfileDefault:"继承 Profile 默认值",sessionMcpServers:"MCP 服务",mcpServerCount:"已选择 {{count}} 个",clearSessionMcp:"清空 MCP 服务",mpaDiagnosticsTitle:"Runtime 诊断",mpaDiagnosticsDescription:"查看最近的 Runtime Console 运行记录,以及 Agent、Profile、Turn、task 和 worker 关联。",loadingMpaDiagnostics:"正在加载 Runtime 诊断…",noMpaDiagnostics:"当前 Session 暂无 Runtime 诊断运行记录。",latestRun:"最近运行",traceCorrelation:"Trace 关联",traceCorrelationDescription:"Runtime Console 为本次 invocation 返回的稳定标识。",traceSteps:"Trace 步骤",traceStepsDescription:"当前 invocation 最近的有界 Runtime Console 步骤。",mpaInstanceId:"MPA 实例",turnId:"Turn ID",taskId:"Task ID",workerKind:"Worker 类型",workerSession:"Worker Session",workerTurn:"Worker Turn",workerProfile:"Worker Profile",workerProfileVersion:"Worker Profile 版本",step:"步骤",stepCount:"步骤数",duration:"耗时",noTraceSteps:"本次 invocation 暂无 trace 步骤。",executionConfigMode:{replace:"Session 覆盖",clear:"本 Session 已清空",inherit:"使用 Profile 默认值"},concurrency:"并发数",selectedOptimizations:"已选优化项",selectedOptimizationsDescription:"这些优化会应用到本次更新。",optimizationProfile:"优化方案",updatePending:"等待更新",updatingDeployment:"正在更新部署",restoringUpdateConfig:"正在恢复更新配置…",updateConfigUnavailable:"无法读取更新配置",legacyConfigMissing:"旧版本 Runtime 缺少可恢复的配置,请重新创建。",deploymentFailed:"部署失败",continueEditing:"继续编辑",loadingOptimizations:"正在加载优化建议…",noOptimizations:"暂无优化建议",fixPriority:"优先级",suggestedModule:"建议模块",suggestionAndReason:"建议与原因",priority:{high:"高",medium:"中",low:"低"},modules:{agentStructure:"Agent 结构",prompt:"提示词",tool:"工具",knowledge:"知识库",memory:"记忆",workflow:"工作流",other:"其他"},evaluationGroupList:"评测组列表",newEvaluationGroup:"新建评测组",newEvaluationGroupName:"新评测组 {{count}}",searchEvaluationGroups:"搜索评测组",noMatchingEvaluationGroups:"没有匹配的评测组",noEvaluationGroupSelected:"请选择一个评测组",groupStats:"{{agents}} 个 Agent · {{runs}} 次运行",evaluationGroupDetails:"评测组详情",evaluationGroupStats:"{{agents}} 个 Agent · {{caseSet}} · {{runs}} 次运行",startEvaluation:"开始评测",evaluationConfig:"评测配置",historyResults:"历史结果",participatingAgents:"参与 Agent",selectedCount:"已选择 {{count}} 个",evaluationResources:"评测资源",evaluationSet:"评测集",evaluator:"评估器",caseCount:"{{count}} 条案例",evaluationMetrics:"评测指标",selectedMetricCount:"已选择 {{count}} 项",historyDescription:"查看每次评测的分数和运行状态。",noHistory:"暂无评测历史",noHistoryDescription:"运行一次评测后,结果会显示在这里。",evaluationRun:"第 {{index}} 次评测",evaluationRunMeta:"{{time}} · {{agents}} 个 Agent",overallScore:"综合分",completed:"已完成",evaluationDefaults:{coreRegression:"核心能力回归",safetyCheck:"安全与幻觉检查",coreSet:"核心回归集",safetySet:"安全边界集",toolSet:"工具调用集",qualityEvaluator:"综合质量评估器",factualEvaluator:"事实一致性评估器",toolEvaluator:"工具调用评估器",responseQuality:"回答质量",factualAccuracy:"事实准确性",toolUse:"工具调用",responseEfficiency:"响应效率",todayTime:"今天 10:32",yesterdayTime:"昨天 16:08",julyTime:"7 月 25 日 14:20",justNow:"刚刚"},defaultCases:{agentName:"示例 Agent",goodSetName:"示例正向案例集",badSetName:"示例负向案例集",weeklyFeedback:{input:"总结本周客户反馈,并按优先级归类。",output:"覆盖主要问题,给出清晰的优先级与下一步动作。",tag:"总结",reason:"任务完整覆盖了用户目标,输出结构清晰,并给出了可执行的下一步动作。"},research:{input:"查询最新公开资料并附上来源。",output:"调用搜索工具,结论与引用一一对应。",tag:"工具调用"},uncertainConclusion:{input:"在信息不足时直接给出确定结论。",output:"应明确说明未知,并主动询问缺失信息。",tag:"幻觉",reason:"信息不足时仍给出了确定结论,缺少必要的澄清步骤与不确定性说明。"},repeatedTool:{input:"连续重复调用相同工具获取同一结果。",output:"复用已有结果,避免无意义的重复调用。",tag:"效率"}},goodCases:"正向案例",badCases:"负向案例",goodCase:"正向案例",badCase:"负向案例",reference:"参考答案",caseResultFilter:"案例结果筛选",feedbackSourceFilter:"反馈来源筛选",searchCases:"搜索案例",searchCasesPlaceholder:"搜索输入、输出或标签",selectCases:"选择案例",selectAll:"全选",selectAllVisible:"选择当前可见案例",selectedCaseCount:"已选择 {{count}} 条",deleteSelected:"删除所选",deleteSelectedTitle:"删除所选 Agent",deleteSelectionDescription:"确定删除所选的 {{count}} 个项目吗?此操作无法撤销。",deleteCasesConfirm:"删除所选案例",deleteOneCaseConfirm:"删除这个案例",deleteFeedbackCase:"删除反馈案例",noFeedbackCases:"暂无反馈案例",noMatchingCases:"没有匹配的案例",loadingEvaluationSet:"正在加载评测集…",userInput:"用户输入",agentOutput:"Agent 输出",score:"得分",scoreReason:"评分原因",noUserInput:"暂无用户输入",noVisibleResponse:"暂无可见回复",note:"备注:",manualFeedback:"人工反馈",automaticFeedback:"自动反馈",scoreValue:"{{score}} 分",unknownTime:"时间未知",deleteAgentTitle:"删除 Agent",deleteAgentDescription:"确定删除 Agent“{{name}}”吗?",deleteDraftDescription:"确定删除草稿“{{name}}”吗?",deleteAgent:"删除 Agent",closeDeleteConfirmation:"关闭删除确认",mpaDeletePreviewSummary:"Studio 会先删除可见的空闲 MPA Runtime 会话,再删除 AgentKit Runtime。运行中的任务需要先结束或停止后才能删除。",mpaDeletePreviewSessions:"会话",mpaDeletePreviewActiveSessions:"运行中",mpaDeletePreviewIdleSessions:"空闲",mpaDeleteBlocked:"当前无法删除",mpaDeleteBlockerActiveOperation:"仍有 MPA 创建或更新操作在执行。",mpaDeleteBlockerActiveSessions:"Runtime 中仍有运行中的会话。",mpaDeleteBlockerBindingAmbiguous:"当前 Agent 匹配到多个 MPA Runtime。",mpaDeleteBlockerRuntimeMissing:"当前 MPA Agent 没有可见的 Runtime 绑定。",mpaDeleteBlockerOrphanRuntime:"Runtime 可见,但其中缺少当前 MPA Profile。",mpaDeleteStage:{runtime_sessions:"删除 {{count}} 个可见空闲 Runtime 会话",runtime_diagnostics:"清理这些会话关联的诊断数据和挂载元信息",agentkit_runtime:"删除 AgentKit Runtime"},draftDeletionWarning:"草稿将从当前浏览器中删除。",runtimeDeletionWarning:"Runtime 和相关云端资源将被删除。",noneSelected:"尚未选择",none:"无",notPublished:"未发布",notRecorded:"未记录",noTime:"暂无时间",noPr:"暂无 PR",comingSoon:"评测能力即将开放",preparing:"准备中",cancelled:"已取消",failed:"失败",totalCount:"共 {{count}} 条",deploymentProgress:"部署进度",returnToEdit:"返回编辑",retryOperation:"重试操作",buildLog:"构建日志",githubMountLog:"GitHub 挂载日志",githubDeliveryMountLog:"GitHub 持续交付挂载日志",waitingBuildLog:"正在等待构建日志…",waitingGithubMountLog:"正在等待 GitHub 挂载日志…",copy:"复制",copied:"已复制",copyLabel:"复制{{label}}",copiedLabel:"已复制{{label}}",logLines:"{{count}} 行",logStatus:{synced:"已同步",failed:"读取失败",syncing:"同步中",earlyOmitted:"已省略早期日志",recentOnly:"仅显示最近的构建日志",partiallyOmitted:"已省略部分日志"},deployStatus:{running:"正在部署",unconfirmed:"部署状态待确认",success:"部署完成",error:"部署失败",cancelled:"部署已取消"},deploymentSteps:{prepare:{label:"准备部署",description:"校验配置并创建部署任务"},build:{label:"构建镜像",description:"生成运行环境与智能体代码"},deploy:{label:"部署服务",description:"创建并启动 AgentKit Runtime"},publish:{label:"发布服务",description:"等待服务就绪并生成访问地址"},complete:{label:"部署完成",description:"智能体已可以正常使用"},evaluation:{label:"创建评测集",description:"自动创建 Good Case 和 Bad Case 评测集"},profileApplying:{label:"应用 MPA 配置",description:"将 Studio Agent 配置写入 MPA Runtime"},smokeRunning:{label:"验证 MPA Runtime",description:"在标记可运行前执行 Runtime 就绪验证"},runnable:{label:"MPA Runtime 可运行",description:"Runtime 已接受配置并通过执行就绪验证"},github:{label:"挂载 GitHub 持续交付",description:"初始化目标分支与 GitHub Actions workflow"},update:{label:"更新实例配置",description:"将 Runtime 实例数调整为 {{min}}~{{max}}"}},githubStatus:{published:"已发布",publishing:"发布中",failed:"发布失败",pending:"等待发布",unknown:"未知"},errors:{agentInfoMissing:"Agent 信息不可用",checkUpdateCapability:"无法检查更新能力",checkingUpdateConfig:"正在检查更新配置",cloudOnlyUpdate:"仅云端 Agent 支持更新",deleteDeployedUnsupported:"当前不支持删除已部署 Agent",deleteDraftUnsupported:"当前不支持删除草稿",loadMpaDeletePreview:"无法加载 MPA 删除预览",loadAgentInfo:"无法加载 Agent 信息",loadApiKey:"无法读取 API Key",loadGithubVersions:"无法加载 GitHub 版本",loadEvaluations:"无法加载评测案例",loadMpaAgentView:"无法加载 MPA Agent 状态",loadMpaDiagnostics:"无法加载 Runtime 诊断",loadOptimizations:"无法加载优化建议",loadRuntimeDetails:"无法加载 Runtime 详情",loadSessionConfig:"无法加载会话配置",loadUsage:"无法加载使用数据",noCreatePermission:"当前账号没有创建 Agent 的权限",noManagePermission:"当前账号没有管理此 Agent 的权限",originalConfigUnavailable:"原始配置不可用",probeIntegration:"无法检测集成能力",rollbackVersion:"无法创建版本回退",runtimeRegionMissing:"Runtime 区域信息缺失",updateCapabilityMismatch:"Runtime 更新能力与当前配置不匹配",updateCapabilityPending:"Runtime 更新能力仍在确认中",updateConfigRestoring:"正在恢复更新配置",updateUnsupported:"当前 Runtime 不支持更新",usageMismatch:"返回的使用数据与当前 Agent 不匹配"}},yYe={title:"环境",loadFailed:"环境加载失败,请检查存储配置后重试。",storageUnavailable:"管理员未配置持久化存储,环境管理暂不可用。",create:"新建环境",configure:"配置环境",details:"环境详情",editorDescription:"配置运行环境,或接入代码仓库和已有镜像",backToList:"返回环境列表",save:"保存环境",createAndBuild:"创建并构建",saveAndBuild:"保存并构建",name:"环境名称",namePlaceholder:"Python 数据处理",descriptionPlaceholder:"说明这个环境适合处理的任务",creationMethod:"创建方式",baseConfiguration:"基础配置",baseEnvironment:"基础环境",operatingSystem:"操作系统",pythonVersion:"Python 版本",fixedByBase:"由 {{base}} 固定为 {{value}}",selectUbuntuVersion:"选择基础镜像的 Ubuntu 版本",selectPythonVersion:"选择需要安装的 Python 版本",skills:"技能",addSkill:"添加环境技能",veadkDescription:"Agent 开发与运行框架",customDockerfile:"自定义 Dockerfile",presetEnvironment:"预制环境",presetHint:"选择“无”可自行填写 Dockerfile 第一行的基础镜像。",dockerfileSize:"{{size}} / {{max}} 字节",upload:"上传",reset:"重置",dockerfileBaseImage:"Dockerfile 基础镜像",dockerfileContent:"Dockerfile 内容",region:"区域",search:"搜索环境",manualImport:"手动导入",noMatches:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称",startBuild:"开始构建",build:"构建",unnamed:"未命名环境",listSeparator:"、",clipboardReadError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。",creation:{custom:{label:"自定义配置",description:"通过表单选择基础环境、Python、工具和技能"},dockerfile:{label:"自定义 Dockerfile",description:"上传或直接编辑 Dockerfile"},git:{label:"从代码仓库构建",description:"探查公开仓库并通过 CodePipeline 构建"},image:{label:"使用已有镜像",description:"绑定由外部流水线交付的 CR 镜像"}},baseDescriptions:{"aio-sandbox":"内置 Sandbox Shell 能力 · Ubuntu 22.04","codex-sandbox":"内置 Codex CLI、浏览器与代码执行环境",ubuntu:"标准 Linux 基础镜像"},dockerfileValidation:{baseImageRequired:"请填写基础镜像。",duplicateFrom:"基础镜像已固定在第一行,请删除 Dockerfile 正文中的 FROM 指令。",tooLarge:"Dockerfile 不能超过 128 KiB。",empty:"Dockerfile 内容不能为空。",missingFrom:"Dockerfile 缺少 FROM 指令。"},presets:{none:"自行填写 Dockerfile 基础镜像",aio:"内置 Sandbox Shell 与常用运行时",codex:"内置 Codex CLI、浏览器与代码执行环境"},categories:{tools:"工具",productivity:"效率",browser:"浏览器自动化",system:"系统与媒体"},options:{"lark-cli":"飞书开放平台命令行工具",pandoc:"文档格式转换工具",opencli:"将网站与桌面应用转换为命令行工具",uv:"快速 Python 包与项目管理器",ripgrep:"高性能文本检索工具",jq:"JSON 查询与转换工具","github-cli":"在终端中管理 GitHub 工作流",playwright:"浏览器自动化与端到端测试",chromium:"无头浏览器运行时",git:"代码版本管理",curl:"网络请求与文件下载",ffmpeg:"音视频转码与处理",imagemagick:"图片转换与批处理"},duration:{seconds:"{{count}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",hoursMinutes:"{{hours}} 小时 {{minutes}} 分"},buildStatus:{preparing:"准备中",queued:"排队中",building:"构建中",scanning:"扫描中",available:"可用",failed:"构建失败",notBuilt:"未构建"},manifest:{title:"环境 Manifest",closeLabel:"关闭环境 Manifest",loading:"正在加载 Manifest",editorLabel:"环境 Manifest YAML",copyFailed:"复制失败,请重试",copied:"已复制",copy:"复制 Manifest",view:"查看环境 Manifest",viewShort:"查看 Manifest",unavailable:"尚无可用 Manifest"},buildDetails:{title:"构建详情",closeLabel:"关闭构建详情",currentStep:"当前步骤",waiting:"等待构建信息",elapsed:"已用时",sourceCommit:"源码提交",openCodePipeline:"在 CodePipeline 中查看",starting:"正在启动",rebuild:"重新构建"},git:{sectionLabel:"公开代码仓库",address:"Git 地址",ref:"Branch、Tag 或 Commit",defaultBranch:"默认分支",inspecting:"正在拉取仓库并查找 Dockerfile",foundDockerfiles:"已在提交 {{commit}} 中找到 {{count}} 个 Dockerfile。",savedDockerfileLoaded:"已载入保存的 Dockerfile,可重新探查仓库更新。",noDockerfile:"仓库中未找到 Dockerfile,请检查分支或仓库内容。",inspectAgain:"重新探查",selectDockerfile:"选择 Dockerfile"},repository:{outputSection:"构建输出",type:"镜像仓库类型",managed:"Studio 默认镜像仓库",existing:"已有镜像仓库",managedHint:"构建时自动创建或复用当前区域的 Studio 镜像仓库。"},existingImage:{sectionLabel:"已有镜像",reference:"Tag 或 Digest",placeholder:"latest 或 sha256:...",hint:"填写镜像 Tag,或以 sha256: 开头的完整 Digest。"},share:{action:"分享",title:"分享环境",closeLabel:"关闭分享环境",generating:"正在生成并复制分享码",copied:"分享码已复制",failed:"分享失败",code:"分享码",fullCode:"完整环境分享码",copiedHint:"分享码已自动复制,也可在这里查看或手动复制。",copyFailedHint:"自动复制失败,可手动复制上方分享码,或重试。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅发送给可信对象。",copyAgain:"再次复制"},import:{title:"导入环境",closeLabel:"关闭导入环境",description:"先检测分享码中的环境,再确认添加到当前账号。",code:"环境分享码",tooMany:"最多可一次导入 {{max}} 个环境,当前检测到 {{count}} 个分享码。",multipleHint:"多个分享码可使用英文逗号、中文逗号或换行分隔,重复项会自动忽略。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅导入可信来源的分享码。",inspectingCodes:"正在检测环境分享码",found:"检测到 {{count}} 个环境:{{names}}。",itemError:"第 {{index}} 个分享码:{{error}}",invalidCode:"分享码无效。",noResult:"服务未返回该分享码的导入结果。",partial:"已导入 {{created}} 个环境,{{remaining}} 个未完成,可重试有效失败项。",inspecting:"正在检测",importing:"正在导入",retryImport:"重试导入",confirm:"确认导入",inspectCodes:"检测分享码"},status:{boundImage:"环境“{{name}}”已绑定已有镜像",queued:"环境“{{name}}”已进入构建队列",savedBuildFailed:"环境已保存,但构建未启动:{{error}}",importedFailed:"已导入 {{created}} 个环境,{{failed}} 个失败",importedDuplicate:"已导入 {{created}} 个环境,{{duplicate}} 个分享码已存在",imported:"已导入 {{count}} 个环境",deleted:"已删除环境“{{name}}”"},deleteTitle:"删除环境",deleteDescription:"确定删除环境“{{name}}”吗?删除后无法恢复。",errors:{repositoryRequired:"请输入公开代码仓库地址。",repositoryHttps:"请输入公开仓库的 HTTPS 地址。",repositoryInvalid:"请输入有效的公开仓库 HTTPS 地址。",imageReferenceWhitespace:"Tag 或 Digest 不能包含空格。",imageDigestInvalid:"Digest 必须是完整的 sha256 值。",imageTagOnly:"这里只填写 Tag,不要重复填写镜像仓库路径。"}},bYe={searchPlaceholder:"搜索资源名称",emptyMessage:"暂无可用选项",searchAriaLabel:"搜索{{label}}",loadingMore:"正在加载更多资源…"},xYe={retryDeployment:"重试部署",retrying:"正在重试…",collapse:"收起错误信息",expand:"展开完整错误信息",copy:"复制完整错误信息"},wYe={steps:"构建步骤",log:"构建日志",syncing:"同步中",loadFailed:"读取失败",synced:"已同步",recentOnly:" · 仅显示最近日志",copiedLog:"已复制构建日志",copyLog:"复制构建日志",copied:"已复制",copy:"复制",logContent:"构建日志内容",waiting:"正在等待 CodePipeline 输出日志…",empty:"暂无构建日志"},AYe={defaultLabel:"Studio 默认环境",defaultDescription:"使用 Studio 预置的标准运行环境",status:{notBuilt:"未构建",preparing:"准备中",queued:"排队中",building:"构建中",scanning:"扫描中",available:"可用",failed:"失败"},label:"运行环境",placeholder:"请选择运行环境",search:"搜索运行环境",loading:"正在加载运行环境…",loadFailed:"加载运行环境失败",noMatches:"未找到匹配的运行环境",unavailable:"当前没有可用的运行环境",selectionUnavailable:"所选运行环境当前不可用,请重新选择。",selectionHint:"选择构建完成的运行环境后,部署将使用其镜像和工具配置。",versionChanged:"所选环境版本已更新,请确认后继续。",versionMissing:"所选环境版本已不存在,请重新选择。",operatingSystem:"操作系统",language:"语言",image:"镜像",imageVersion:"镜像版本",skills:"技能",tools:"工具",noSkills:"未配置 Skill",noExtraTools:"未配置额外工具",defaultGuidance:"默认环境由 Studio 管理,无需额外配置。",persistenceFallback:"持久化环境服务暂不可用,当前使用默认环境。",emptyFallback:"当前没有可选择的自定义环境。"},SYe={repository:"GitHub 仓库",githubUrl:"GitHub 地址",token:"访问令牌",sessionToken:"{{provider}} 临时令牌",runtime:"Runtime",commit:"提交",workflow:"工作流",syncFailed:"同步 GitHub 代码失败",status:{mounted:"已挂载",bound:"已绑定",synced:"已同步",created:"已创建"},volcengine:"火山引擎",mountDelivery:"挂载持续交付",selectedForDeployment:"已选择,部署时挂载",mountOnDeploy:"部署时挂载持续交付",syncCode:"同步代码",deliveryMode:"GitHub 交付模式",sourceSync:"GitHub 代码同步",delivery:"GitHub 交付",loading:"读取中",running:"执行中",runtimeDeliveryHint:"写入 AgentKit Runtime GitHub Actions workflow,后续 GitHub 提交会更新绑定 Runtime。",initialDeliveryHint:"首次部署成功后初始化目标分支,后续 GitHub 提交会更新绑定 Runtime。",sourceSyncHint:"Studio 会直接 push 到目标分支;该分支由 Studio 管理,远端冲突时同步会失败。Runtime 仍由部署按钮发布。",tokenPlaceholder:"repo 或 contents write 权限",getToken:"获取 Token",hideToken:"隐藏 Token",showToken:"显示 Token",tokenHelp:"Token 仅用于本次操作,成功后不会保留在表单中。",targetBranch:"目标分支",actionsSecretPlaceholder:"用于写入 GitHub Actions Secret",sessionTokenPlaceholder:"临时凭证可选",syncing:"同步中…",pendingHint:"已选择挂载持续交付。点击部署后,Studio 会等待 Runtime 创建完成并初始化 GitHub 目标分支,初始化成功后才完成部署流程。",result:{deliveryMounted:"已挂载持续交付",deliverySelected:"已选择挂载持续交付",githubBound:"已绑定 GitHub",codeSynced:"代码已同步",deliveryHint:"目标分支提交会触发 Runtime 持续交付。",boundHint:"更新并发布时会先同步当前源码到这个分支。"},branch:"分支",viewPr:"查看 PR",createFailed:"创建失败",phase:"阶段",log:"日志"},TYe={name:"飞书",enabling:"正在启用并更新配置…",description:"接收消息并通过飞书机器人回复",configuration:"飞书配置",configurationMode:"飞书配置方式",automatic:"自动配置",manual:"手动配置",cancelling:"取消中…",scanToCreate:"扫码创建",scanDescription:"授权后自动回填凭据",generateQrCode:"生成二维码",qrCodeAlt:"飞书机器人配置二维码",scanToConfirm:"飞书扫码确认",expiresIn:"{{time}} 后失效",created:"机器人已创建",credentialsFilled:"应用凭据已自动回填",qrCodeExpired:"二维码已失效",automaticFailed:"自动配置失败",regenerateQrCode:"请重新生成二维码。",configuredPlaceholder:"已配置,留空沿用",appSecretPlaceholder:"请输入 App Secret",hideSecret:"隐藏 App Secret",showSecret:"显示 App Secret"},CYe={mode:{auto:"自动创建",autoDescription:"部署时自动创建所需资源",recommended:"推荐",create:"指定名称",createDescription:"使用指定名称创建或复用资源",existing:"选择已有",existingDescription:"从当前账号的已有资源中选择"},selectExisting:"请选择已有资源",searchResource:"搜索资源名称",noMatch:"未找到匹配资源",noAvailable:"暂无可用资源",searching:"正在搜索云资源…",loading:"正在加载云资源…",noMatchSentence:"未找到匹配资源。",noAvailableSentence:"暂无可用资源。",loadedSummary:"实际服务区域:{{region}} · 已加载 {{loaded}}{{total}}",registryInstance:"Registry 实例",registryAriaLabel:"镜像仓库 Registry 实例",namespace:"命名空间",namespaceAriaLabel:"镜像仓库 Namespace",repository:"镜像仓库",existingRepository:"已有镜像仓库",selectRegistryFirst:"请先选择 Registry 实例。",selectNamespaceFirst:"请先选择 Namespace。",configurationMode:"配置方式",configurationModeAriaLabel:"{{resource}}配置方式",selectConfigurationMode:"请选择配置方式",automaticNames:"自动创建名称",validation:{tos:"请填写或选择 TOS 存储桶。",cr:"请完整填写或选择 CR 实例、命名空间和镜像仓库。",codePipeline:"请完整填写或选择 CodePipeline Workspace 和 Pipeline。",existingCodePipeline:"请选择已有的 CodePipeline Workspace 和兼容 Pipeline。"},autoBucketWithRegion:"agentkit-platform-{账号 ID}-{{region}}",autoBucket:"agentkit-platform-{账号 ID}",tosBucket:"TOS 存储桶",bucketName:"存储桶名称",bucketNamePlaceholder:"输入存储桶名称",existingBucket:"已有存储桶",existingTosBucket:"已有 TOS 存储桶",bucket:"存储桶",accountIdResolved:"账号 ID 在部署时按当前云账号解析。",containerRegistry:"容器镜像仓库(CR)",instanceName:"实例名称",crInstance:"CR 实例",existingCrInstance:"已有 CR 实例",existingCrNamespace:"已有 CR 命名空间",existingCrRepository:"已有 CR 镜像仓库",autoRegistry:"agentkit-platform-{账号 ID}",autoRepositoryName:"{{name}}-{4 位随机字符}",registryNameNote:"账号 ID 在部署时解析,镜像仓库的随机字符在部署时生成。",workspace:"工作空间",pipeline:"流水线",workspaceName:"Workspace 名称",pipelineName:"Pipeline 名称",existingWorkspace:"已有 CodePipeline Workspace",compatiblePipeline:"兼容 Pipeline",existingPipeline:"已有 AgentKit CodePipeline",pipelineNameNote:"Pipeline 与 Runtime 名称一致。"},kYe={commit:"提交",steps:{permissions:"预检 OTA 所需权限",resolving:"读取目标版本信息",downloading:"下载并校验完整更新包",preparing:"准备 VeFaaS Function 代码",provisioning:"检查并补齐 Studio 云资源",scheduler:"更新定时任务调度服务",submitting:"提交 Function 更新",publishing:"发布新 Revision 并重启服务"},stages:{permissions:"预检 OTA 权限",resolving:"读取版本信息",downloading:"下载更新包",preparing:"准备 Function 代码",provisioning:"补齐 Studio 云资源",scheduler:"更新定时任务调度服务",submitting:"提交 Function 更新",publishing:"发布 Revision",checking:"检查更新",unknown:"未知阶段"},duration:{seconds:"{{count}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},logPermissionPrefix:"无法读取 VeFaaS 发布日志。Function 角色缺少 ",logPermissionSuffix:" 权限,更新会继续。",openIamConsole:"前往 IAM 控制台配置权限",deploymentProgress:"部署进度",live:"实时",completed:"已完成",stopped:"已停止",copied:"已复制",copyFailed:"复制失败",copyLog:"复制日志",waitingForLogs:"等待 VeFaaS 返回更新日志…",noLogs:"本次更新未返回发布日志",messages:{updated:"Studio 已更新,新 Revision 已接管服务",failed:"Studio 更新失败",timeout:"等待 VeFaaS 发布超时,请稍后重新检查版本",submitted:"更新已提交,正在等待 VeFaaS 发布新版本",connectionSwitched:"连接已切换,正在确认新版本状态"},checkingPermissions:"正在检查 OTA 权限",authorizationRequired:"需要 IAM 授权",updating:"正在更新 Studio",updated:"Studio 已更新",updateToVersion:"更新 Studio 至 {{version}}",checkPermissions:"检查更新权限",authorizationNeeded:"需要授权",updatingShort:"正在更新",refreshForNewVersion:"刷新使用新版",updateFailed:"更新失败",updateNow:"立即更新",newVersionAvailable:"有新版更新",dialog:{failed:"Studio 更新失败",checkingPermissions:"正在检查更新权限",authorizationRequired:"需要 IAM 授权",updating:"正在更新 Studio",completed:"Studio 更新完成",newVersion:"发现新版本"},permissionCheck:"正在核对 OTA 与定时任务所需的全部 IAM 权限…",permissionCheckHint:"权限全部满足后才会开始下载、更新或发布云资源。",missingPermissionCount:"当前 Function 角色缺少 {{count}} 项 OTA 更新权限,尚未执行任何云资源变更。",functionRole:"Function 角色",currentRole:"当前运行角色",policyToUpdate:"将更新策略",authorizationSteps:{open:"打开授权页面,确认已预填的策略名称和完整策略内容。",debug:"点击页面中的“发起调试”,完成策略更新。",return:"返回此窗口,点击“我已授权,重新检查”。"},missingPermissions:"缺少的权限",openPrefilledAuthorization:"打开已预填的 IAM 授权页面",openIamManually:"前往 IAM 控制台手动配置",noSafePolicy:"当前角色没有唯一可安全更新的自定义策略,请由管理员将上述权限加入该角色。",failedStage:"失败阶段",errorId:"错误 ID",notGenerated:"未生成",openFunctionLogs:"前往 VeFaaS 控制台查看 Function 日志",targetVersion:"目标版本",updateStatus:"更新状态",elapsed:"已用时",progressAriaLabel:"Studio 更新进度",processingUpdate:"正在处理更新",processing:"正在处理",backgroundHint:"发布阶段会短暂中断连接;关闭此窗口不会停止更新,可随时点击右上角按钮重新查看。",confirmDescription:"更新会重启 Studio 服务,预计约 3–5 分钟完成更新与发布。期间正在进行的对话、流式响应或部署任务可能中断,登录态不会受到影响。",selectVersion:"选择版本",currentVersion:"当前版本",changelog:"更新内容",noChangelog:"暂无更新说明",runInBackground:"后台运行",authorizedRecheck:"我已授权,重新检查",tryAgain:"重新尝试"},OYe={deploy:"部署",update:"更新",planHash:"方案哈希",backToConfiguration:"返回配置",releaseRegion:"发布区域",deployRegion:"部署区域",regionPreserved:"更新时沿用现有 Runtime 的部署区域,无法修改。",unnamedAgent:"未命名 Agent",deployTitle:"部署 {{name}}",additionalAgentCount:" 等 {{count}} 个智能体",releaseOverview:"发布概览",agentOverview:"Agent 概览",agentCount:"Agent 数量",model:"模型",systemPrompt:"系统提示词",optimizations:"优化选项",notEnabled:"未启用",effectiveCapabilities:"生效能力",automaticProtection:"自动保护",artifactActions:"发布产物操作",exportYaml:"导出 YAML",viewSource:"查看源代码",downloadSource:"下载源代码",expandFlow:"放大查看执行流程",expand:"放大查看",deploymentConfiguration:"部署配置",runtimeName:"Runtime 名称",runtimeNamePreserved:"更新时保持现有 Runtime 名称不变。",runtimeNameHint:"默认根据 Root Agent 名称生成,并添加随机后缀避免重名;支持 4-64 位字母、数字、连字符和下划线",accessAuthentication:"访问鉴权",authenticationPreserved:"更新时保持现有 Runtime 的鉴权方式不变。",authenticationMethod:"鉴权方式",authenticationAriaLabel:"部署鉴权方式",authenticationPlaceholder:"请选择鉴权方式",messageChannels:"消息渠道",instanceSettings:"实例设置",minInstances:"最小实例数",maxInstances:"最大实例数",sidecarSingleInstance:"Harness Sidecar 首期仅支持单实例,Runtime 固定为 1~1",inMemorySingleInstance:"为避免多实例间会话丢失,推荐将 Runtime 固定为 1~1",network:"网络",networkPreserved:"现有 Runtime 的区域与网络模式保持不变。",networkMode:"网络模式",networkModes:{public:"公网",both:"公网 + VPC"},subnetId:"子网 ID",subnetHint:"可选,多个用逗号分隔",sharedInternetAccess:"VPC 内共享公网出口",evaluationSets:"评测集",createEvaluationSets:"自动创建评测集",createEvaluationSetsHint:"部署成功后,自动创建 Good Case 和 Bad Case 评测集。",resourceConfiguration:"资源配置",environmentVariables:"环境变量",environmentVariablesHint:"组件配置会自动同步到这里,部署前可核对最终值。",itemCount:"{{count}} 项",addVariable:"添加变量",componentGenerated:"组件自动生成",injectedByApiKey:"由所选 API Key 注入",envNameAriaLabel:"{{key}} 环境变量名",envDescriptionAriaLabel:"{{key}}说明:{{description}}",openOpenViking:"打开 OpenViking {{label}}",openOpenVikingAriaLabel:"{{key}}:打开 OpenViking {{label}}",requiredEmpty:"必填,尚未填写",optionalEmpty:"可选,尚未填写",envValueAriaLabel:"{{key}} 环境变量值",automatic:"自动",synced:"同步",customModelCredentials:"自定义模型凭据",releaseOnlySecret:"必填,仅用于本次发布",thisRelease:"本次发布",customVariables:"自定义变量",value:"值",deleteVariable:"删除变量",deploymentProgress:"部署进度",retryUpdate:"重试更新",retryDeploy:"重试部署",updateSucceeded:"更新成功",deploySucceeded:"部署成功",region:"区域",agentName:"Agent 名称",apiEndpoint:"API 端点",connecting:"连接中…",chatNow:"立即对话",console:"控制台",actionInProgress:"{{action}}中…",checkingName:"正在检查名称…",retryAction:"重试{{action}}",flowPreview:"执行流程预览",executionFlow:"执行流程",flowPreviewHint:"只读预览,可缩放与拖动画布",closeFlowPreview:"关闭执行流程预览",agentAdded:'Agent "{{name}}" 已添加到左上角下拉列表!',files:{preview:"文件预览",new:"新建文件",empty:"暂无文件",noneSelected:"未选择文件",selectToView:"选择左侧文件以查看内容",loadingEditor:"加载编辑器…",rename:"重命名",renamePrompt:"重命名文件"},apiKey:{selectFirst:"请先选择 API Key",revealing:"正在显示 API Key",hide:"隐藏 API Key",retryReveal:"重试显示 API Key",reveal:"显示 API Key"},task:{preparing:"准备部署",waitingBuildLog:"正在等待构建日志…",waitingGithubLog:"正在等待 GitHub 挂载日志…",syncingGithub:"正在同步当前源码到 GitHub",syncGithubCode:"同步 GitHub 代码",githubSynced:"GitHub 代码已同步",githubSubmitted:"GitHub 代码已提交",githubUpdatingRuntime:"代码已提交到 GitHub,GitHub Actions 正在更新同一个 Runtime",initializingGithub:"开始初始化 GitHub main 分支与 Actions workflow",initializingGithubBranch:"正在初始化 GitHub 持续交付目标分支",mountGithubDelivery:"挂载 GitHub 持续交付",githubBranchInitialized:"GitHub 持续交付已初始化目标分支",githubDeliveryMounted:"GitHub 持续交付已挂载",githubMountFailed:"挂载 GitHub 持续交付失败",githubMountFailedDetail:"GitHub 持续交付挂载失败:{{message}}",githubMountFailedHint:"挂载 GitHub 持续交付失败,详见 GitHub 日志。",applyingMpaProfile:"正在将 Agent 配置应用到 MPA Runtime",mpaProfileApplied:"MPA Runtime 配置已应用",runningMpaSmoke:"正在验证 MPA Runtime 执行链路",mpaReady:"MPA Runtime 已可运行",deploymentComplete:"部署完成",deployedNotConnected:"部署完成,暂未连接",cancelled:"已取消",cancelledHint:"部署已取消,相关 Runtime 资源已请求销毁。",deploymentStatusUnconfirmed:"部署状态待确认",deploymentFailed:"部署失败",buildFailedHint:"构建镜像失败,详见构建日志。"},confirm:{updateTitle:"确认更新",deployTitle:"确认部署",closeLabel:"关闭部署确认",updateDescription:"将更新并发布到当前云端 Runtime,过程可能需要几分钟。确定继续吗?",deployDescription:"将创建新的云端 Runtime,部署过程可能需要几分钟。确定继续吗?",update:"确定更新",deploy:"确定部署"},userPool:{label:"用户池",unnamed:"未命名用户池",current:"当前用户池",ariaLabel:"部署用户池",loading:"正在加载用户池…",placeholder:"请选择用户池",loadingIdentity:"正在加载 Identity 用户池…",empty:"当前账号下暂无 Identity 用户池。",currentHint:"当前 Studio 的登录 JWT 将透传访问此 Runtime。",mismatchHint:"所选用户池不是当前 Studio 使用的用户池,部署后无法从 Studio 调用此 Runtime。",markedHint:"当前 Studio 使用的用户池已在列表中标注。"},authentication:{apiKeyDescription:"默认方式,使用 Runtime API Key 访问",userPool:"用户池",userPoolDescription:"使用 Identity 用户池签发的 JWT"},steps:{buildImage:"构建镜像",deploy:"部署",publish:"发布",syncCode:"同步代码",uploadPackage:"上传代码包",packageImage:"镜像打包",createRuntime:"创建 Runtime",publishService:"发布服务",updateInstances:"更新实例配置",createEvaluationSets:"创建评测集",applyMpaProfile:"应用 MPA 配置",verifyMpaRuntime:"验证 MPA Runtime",mpaReady:"MPA Runtime 可运行"},errors:{instanceRangeInteger:"最小实例数必须为大于等于 0 的整数,最大实例数必须为大于 0 的整数。",instanceRangeOrder:"最小实例数不能大于最大实例数。",selectApiKey:"请先在模型配置中选择 API Key。",loadApiKey:"加载 API Key 失败,请重试。",invalidProject:"项目数据无效",updateFeishu:"更新飞书配置失败:{{message}}",userPoolRequired:"请选择用于 Runtime 鉴权的用户池。",vpcRequired:"使用 VPC 网络时,请填写 VPC ID。",modelSecretRequired:"请填写 {{label}},用于访问对应的自定义模型地址。",managedApiKeyRequired:"{{requirement}},请先返回模型配置选择 API Key。",feishuEnvRequired:"启用飞书后,请填写{{field}}。",runtimeNameExists:"Runtime 名称已存在,请修改后重试。",deployedButGithubMountFailed:"部署成功,但挂载 GitHub 持续交付失败:{{message}}",deployedButGithubBindFailed:"部署成功,但绑定 GitHub 失败:{{message}}",mpaRuntimeIdMissing:"部署成功,但返回缺少 Runtime ID,无法应用 MPA 配置。",mpaOperationIncomplete:"MPA Runtime 初始化未完成,请重试此部署任务。",deploymentStatusUnconfirmed:"连接已中断,当前无法确认部署最终状态。任务可能仍在云端运行,请到 AgentKit 或 Code Pipeline 查看同一任务,避免重复部署。",failedAtStage:"{{action}}失败({{stage}}阶段):{{message}}",noAgentAtEndpoint:"连接成功,但该地址未发现任何 Agent(/list-apps 为空)。",addAgent:"添加 Agent 失败:{{message}}",modelApiKeyRequired:"请填写此模型地址对应的 API Key。"}},EYe={title:"工作区",storageUnavailable:"管理员未配置持久化存储,工作区管理暂不可用。",detail:"工作区详情",create:"新建工作区",editorDescription:"将常用环境组合在一起;同一个环境可以加入多个工作区。",backToList:"返回工作区列表",environmentCount_one:"{{count}} 个环境",environmentCount_other:"{{count}} 个环境",createdAt:"创建时间",updatedAt:"最近更新",basicInfo:"基本信息",namePlaceholder:"例如:内容生产",descriptionPlaceholder:"说明这个工作区的用途",selectedEnvironmentCount:"已选择 {{count}} 个,可在其他工作区中继续复用",searchAvailableEnvironments:"搜索可用环境",searchEnvironments:"搜索环境",noAvailableEnvironments:"还没有可添加的环境",createEnvironmentFirst:"请先在“环境”页面创建并构建环境。",noMatchingEnvironments:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称。",environmentStatus:{available:"可用",building:"构建中",notBuilt:"未构建"},added:"已添加",saved:"已保存工作区“{{name}}”",resourceType:"工作区资源类型",searchWorkspaces:"搜索工作区",loadFailed:"无法加载工作区",noMatchingWorkspaces:"没有匹配的工作区",tryAnotherNameOrEnvironment:"请尝试搜索其他名称或环境",noEnvironmentAdded:"未添加环境",environmentMissing:"环境缺失",availableFraction:"{{available}}/{{total}} 可用",available:"可用",availableCount:"{{count}} 个可用",updated:"更新",addEnvironment:"添加环境",deleteTitle:"删除工作区",deleteDescription:"确定删除工作区“{{name}}”吗?环境本身不会被删除。",deleted:"已删除工作区“{{name}}”",clipboardPermissionError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。",codeProjects:"代码项目"},_Ye={back:"返回",detailNavigation:"详情导航",noData:"暂无数据",actions:"操作",moreActions:"更多操作 {{label}}",actionsFor:"{{label}} 操作",loading:"资源加载中,请稍候"},RYe={addSkill:"添加 Skill",remove:"移除 {{name}}",confirmRemoveRuntime:"从新版本中移除运行中的 Skill「{{name}}」?",selectedCount:"已加入技能 · {{count}}",close:"关闭{{label}}",sources:{runtime:"运行中来源 · 原样保留,可移除或用同名 Skill 替换",local:"本地",skillspace:"AgentKit Skills 中心",skillhub:"火山 Find Skill 技能广场"},tabs:{local:"本地文件",localShort:"本地文件",skillspace:"AgentKit Skills 中心",skillspaceShort:"AgentKit",skillhub:"火山 Find Skill 技能广场",skillhubShort:"Find Skill"}},DYe={model:"模型",turnControls:"流程控制",pause:"暂停",resume:"恢复",interrupt:"中断",cancel:"取消",pauseTurn:"在安全点暂停完整流程",resumeTurn:"恢复完整流程",interruptTurn:"中断当前流程并保留会话上下文",cancelTurn:"取消当前流程且不可恢复",turnState:{running:"运行中",pausing:"正在到达安全点",paused:"已暂停",resuming:"正在恢复",interrupting:"正在中断",cancelling:"正在取消",interrupted:"已中断",completed:"已完成",failed:"失败",cancelled:"已取消",orphaned:"状态待确认",newTurnRequired:"需要从检查点继续"},tasks:{ppt:"PPT",image:"图片生成",video:"视频生成"},prompts:{ppt:{quarterlyReview:"复盘【季度】经营表现,提炼指标差距、原因与行动建议",projectUpdate:"汇报【项目名称】进展:里程碑、风险、预算和资源诉求",solutionProposal:"为【客户行业】输出解决方案:痛点、架构、实施路径与收益",industryAnalysis:"分析【行业主题】趋势,给出竞争格局、机会与战略建议"},image:{launchVisual:"为【品牌或产品】设计【高级科技】风格的发布会主视觉",ecommercePoster:"生成【产品名称】电商海报,突出【核心卖点】与品牌色",conceptRendering:"呈现【产品或空间】在【使用场景】中的写实概念效果图",socialGraphic:"围绕【传播主题】制作简洁专业的企业社媒配图"},video:{brandFilm:"制作【品牌名称】30 秒宣传片,突出【品牌价值】",productLaunch:"为【产品名称】制作 45 秒发布视频:痛点、功能、场景与行动号召",trainingVideo:"制作【培训主题】企业培训视频,讲清【关键操作或规范】",eventTeaser:"生成【活动名称】20 秒预热视频,包含亮点、时间地点和报名信息"}},firstFrame:"首帧",videoToEdit:"待编辑视频",baseVideo:"基础视频",optimizeSkillPlaceholder:"描述你想优化的技能…",createSkillPlaceholder:"描述你想生成的技能…",createVideoPlaceholder:"描述你想创作的视频…",messageAgentPlaceholder:"向 {{name}} 发消息…",selectAgentFirst:"请先选择智能体",selectSkillFirst:"请先选择需要优化的 Skill",availableSkills:"可用技能",availableSubagents:"可用子 Agent",invokeSkill:"调用技能",useSubagent:"使用子 Agent",loadingCapabilities:"正在读取 Agent 能力…",noMatchingSkills:"当前 Agent 没有匹配技能",noMatchingSubagents:"当前 Agent 没有匹配子 Agent",skillFallbackDescription:"加载并执行该技能",agentFallbackDescription:"将本轮交给该 Agent",skill:"技能",uploadImage:"上传图片",uploadDocument:"上传文档或 PDF",uploadVideo:"上传视频",taskMode:"任务模式",selectTaskMode:"选择任务模式",loadingGenerationModel:"正在加载生成模型",modelUnavailable:"模型不可用",cancelTask:"取消{{task}}任务",stopGenerating:"停止生成",viewVideoProgress:"查看视频生成进度",send:"发送",selectTaskType:"选择任务类型",enterprisePrompts:"{{task}}企业提示词",sessionId:"会话 ID",sessionIdLabel:"会话 ID:",initializing:"初始化中",copied:"已复制",copySessionId:"复制会话 ID",sessionIdCopied:"已复制会话 ID",disclaimer:"回答仅供参考",viewLogs:"查看日志"},LYe={selectAgent:"选择 Agent",noLocalAgents:"暂无本地 Agent。",searchRuntime:"搜索 Runtime 名称",mineOnly:"只看我创建的",noRuntimes:"暂无 Runtime。",unsupported:"不支持",createdByMe:"我创建的",connecting:"连接中…",connected:"已连接",connect:"连接",viewInfoFor:"查看 {{name}} 信息",viewInfo:"查看信息",agentAndRuntimeInfo:"Agent 与 Runtime 信息",detailType:"详情类型",agentInfo:"Agent 信息",runtimeInfo:"Runtime 信息",loadingAgentInfo:"读取 Agent 信息…",cannotLoadAgentInfo:"暂时无法读取 Agent 信息",unnamedAgent:"未命名 Agent",subagents:"子 Agent",tools:"工具",skills:"技能",previewUnsupported:"暂不支持预览",mountedComponents:"挂载组件",noMoreAgentInfo:"暂无更多 Agent 配置信息。",local:"本地",model:"模型",status:"状态",memoryMb:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",resources:"资源",version:"版本",loadingDetails:"读取详情…",environmentVariables:"环境变量",errors:{notFound:"该 Runtime 已不存在或列表信息已过期,请刷新列表后重试。",accessDenied:"当前账号无权访问该 Runtime,请检查所属 Project 和访问权限。",previewUnsupported:"该 Agent Server 版本暂不支持信息预览。",unavailable:"该 Runtime 暂时无法访问,请确认其状态为“就绪”后重试。",timeout:"加载超时,请重试"},componentKinds:{knowledgebase:"知识库",memory:"记忆",prompt_manager:"提示词管理",example_store:"样例库",run_processor:"运行处理器",tracer:"链路追踪",toolset:"工具集",plugin:"插件",other:"其他"},runtimeStatus:{ready:"就绪",unreleased:"未发布",running:"运行中",active:"运行中",creating:"创建中",pending:"等待中",deploying:"部署中",updating:"更新中",failed:"失败",error:"异常",stopping:"停止中",stopped:"已停止",deleting:"删除中",deleted:"已删除"}},MYe={agent:"智能体",agentTypes:{general:"通用智能体",mpa:"MPA 智能体",codex:"Codex","deepseek-harness":"DeepSeek",openclaw:"OpenClaw",hermes:"Hermes"},creator:"创建人",namedAgent:"{{name}} 智能体",storageLocation:"存储位置",currentBrowser:"当前浏览器",region:"地域",viewDeploymentProgress:"查看 {{name}} 部署进度",viewRuntimeDetails:"查看 {{name}} Runtime 详情",viewDetails:"查看 {{name}} 详情",time:"时间",remainingTime:"剩余时间",expiringSoon:"即将清空",sandboxRemaining:"{{hours}} 小时 {{minutes}} 分钟",wakeable:"已休眠",neverExpires:"永不过期",editDraftNamed:"编辑草稿 {{name}}",viewProgress:"查看进度",deleteDraftNamed:"删除草稿 {{name}}",recheckCompatibility:"重新检测 {{name}} 的对话兼容性",connectedNamed:"{{name}} 已连接",wakeAndChat:"唤醒 {{name}} 并开始对话",chatWith:"与 {{name}} 对话",waking:"唤醒中",deploying:"部署中",draft:"草稿",checking:"检测中",chatUnsupported:"不支持对话",checkFailed:"检测失败",creatorFilter:"创建人筛选",agentType:"智能体类型",searchAgents:"搜索智能体",handoff:"接力",agentList:"{{type}}列表",noMatchingAgents:"没有匹配的智能体",adjustSearch:"请尝试调整搜索或筛选条件",noAgentType:"暂无 {{type}}",noGeneralAgents:"暂无通用智能体",createGeneralAgentDescription:"创建一个通用智能体,开始构建和对话",createAgentType:"创建{{type}}",createAgent:"创建智能体",loadingMore:"正在加载更多智能体",scrollForMore:"继续下滑加载更多",allLoaded:"已加载全部智能体",deleteDraftTitle:"删除草稿?",deleteDraftDescription:"删除后将无法恢复“{{name}}”。",deleteDraft:"删除草稿",loadGeneralAgents:"加载通用智能体",loadAgentType:"加载 {{type}}",compatibility:{checking:"正在请求 Runtime /list-apps,以确认该智能体是否支持 Studio 对话。",empty:"Runtime /list-apps 未返回可用的 Agent,暂时无法连接对话。",supported:"Runtime 支持 Studio 对话。",unknownError:"Runtime /list-apps 请求失败,未返回可识别的错误信息。"},sandboxStatus:{ready:"就绪",wakeable:"已休眠",creating:"创建中",starting:"启动中",initializing:"启动中",pending:"等待中",running:"运行中",failed:"异常",error:"异常",stopped:"已停止",expired:"已过期",deleting:"删除中",deleted:"已删除",unknown:"未知状态"},wakingHint:"正在唤醒智能体,可能需要一些时间。",mpaCreate:{name:"名称",namePlaceholder:"例如 test-agent",nameHelp:"作为 Runtime 名称,支持 4–64 位字母、数字、下划线或连字符。",stepsLabel:"创建步骤",steps:{basics:"基本信息",postgres:"PostgreSQL",openviking:"OpenViking",autoPostgres:"数据库"},next:"下一步",previousStep:"上一步",pgDescription:"选择已有的 PostgreSQL 实例。创建流程会在该实例中准备智能体的独立业务库。",pgSplitDescription:"使用已配置的业务 PG Workspace。多个智能体共用此 Workspace,每个智能体拥有独立业务库。共享资源记录单独存放在 mpa_admin_workspace / mpa_admin_db,由管理员配置。",pgConsole:"前往火山引擎 AIDAP 创建或查看 PG Workspace",pgHost:"PG 主机地址",pgPort:"PG 端口",pgInvalid:"请填写有效的 PG 主机地址和端口。",pgCredentials:"PG 连接账号和密码由部署服务配置;主机和端口须与服务端配置一致。",openvikingDescription:"可选。三项全部填写才启用 OpenViking;全部留空则不向新智能体注入 OpenViking 配置。",openvikingConsole:"前往火山引擎查看 OpenViking 资源",openvikingUrl:"OpenViking 服务地址",openvikingResourceId:"OpenViking 资源 ID",openvikingApiKey:"OpenViking API Key",openvikingInvalid:"请同时填写有效的 HTTPS 服务地址、资源 ID 和 API Key,或全部留空。",openvikingCredentials:"API Key 仅用于本次创建,不保存到浏览器草稿;刷新页面后需重新填写。",tosTitle:"会话输出存储",tosDescription:"可选。填写完整的 TOS 凭证和存储桶,为新智能体的每个会话挂载独立输出目录。三项均留空时使用服务端预设;服务端未配置时,不启用 TOS 挂载。",tosAccessKey:"TOS Access Key",tosSecretKey:"TOS Secret Key",tosBucket:"TOS 存储桶",tosInvalid:"TOS Access Key、Secret Key 和存储桶必须同时填写。",tosCredentials:"凭证仅用于本次创建,不会保存在浏览器恢复数据或创建任务记录中。",runtimeImage:"MPA 镜像",workerImage:"Worker 镜像",imageDefault:"留空使用配置文件中的默认镜像",imageInvalid:"请输入有效的镜像地址,不要包含网址、空格或登录凭据。",title:"创建 MPA 智能体",agentId:"智能体 ID",description:"描述",region:"部署地域",plan:"创建计划",sharedResources:"准备或复用账号共享 VPC、子网和 APIG 消息网关",agentResources:"准备独立业务库、技能空间和执行环境,部署智能体",readiness:"检查网关和智能体就绪状态,成功后加入列表",checking:"正在检查创建配置…",configured:"创建配置已就绪。提交后会检查云资源并开始准备。",notConfigured:"尚未配置创建所需的资源参数,请联系管理员配置后重试。",loadFailed:"检查创建配置失败,请重试。",reload:"重新检查",submit:"开始创建",retry:"重试创建",newAgent:"新建另一个智能体",newAgentDescription:"新建另一个智能体将开启可编辑的新请求,替换当前恢复草稿,但不会取消旧任务。旧任务仍在运行时,请等待其结束后再提交。",close:"关闭",cancel:"取消创建",confirmCancel:"确认取消",cancelDescription:"取消后会停止后续步骤。已创建的数据库、技能空间、网关和其他已登记资源会保留,可使用同一智能体 ID 重试。",background:"关闭窗口后创建会继续。再次打开可查看进度。",pollFailed:"暂时无法获取进度,正在重新连接。请勿重复创建其他智能体。",iamPermissionDenied:"部署服务没有准备运行角色所需的 IAM 权限,请联系管理员授权后重试。",iamTrustConflict:"运行角色的信任关系不符合要求,请管理员检查对 VeFaaS 和 APIG 的授权后重试。",iamPolicyConflict:"运行角色所需的同名权限策略内容冲突,请管理员检查后重试。",iamOwnershipConflict:"运行角色与当前部署账号不匹配,请管理员检查后重试。",iamVerificationFailed:"尚未确认运行角色的权限已就绪,请检查 IAM 服务及策略可用性后重试。",iamConfigurationConflict:"自动准备运行角色仅支持默认 MPA 角色,请检查服务端创建配置。",creationFailed:"当前步骤未完成,请检查对应资源、服务端配置及权限后,用同一智能体 ID 重试。",cancelFailed:"取消请求失败,请重新查询进度后重试。",cancelled:"创建已取消,已登记资源保留供重试。",timeout:"创建超时,已登记资源保留。请检查对应资源后重试。",interrupted:"创建任务中断。请用同一智能体 ID 重试以恢复已登记资源。",skillSpace:"技能空间",states:{running:"正在创建",cancelling:"正在取消",succeeded:"创建成功",failed:"创建失败",cancelled:"已取消"},stages:{queued:"等待开始",iam_role:"准备运行角色",checking:"检查账号与配置",network:"准备 VPC 和子网",gateway:"准备 APIG 和 IM Gateway",database:"准备业务数据库",skills:"准备技能空间",worker:"准备执行环境",deploying:"准备数据库、技能空间和 Runtime",verifying:"等待智能体就绪",admin_workspace:"准备管理 PG Workspace",business_workspace:"准备业务 PG Workspace",admin_database:"初始化共享管理库"},back:"继续创建",pgAutoDescription:"使用 VeADK 部署账号自动创建或复用两个 PG Workspace:mpa_admin_workspace / mpa_admin_db 存放共享资源记录,业务 Workspace 供多个智能体共用,每个智能体拥有独立业务库。无需填写 PG 连接信息,提交创建后开始准备。",pgModeChanged:"此创建任务使用旧的 PG 配置,不能直接切换为自动模式重试。请联系管理员确认已有资源和任务后重新创建。",pgMigrationRequired:"检测到旧共享注册库。请先将共享资源记录迁移到 mpa_admin_workspace / mpa_admin_db,并完成现有 Runtime 的注册库地址切换;完成后点击“重新检查”。"}},IYe={library:"技能库",skill:"技能",skills:"技能",skillSpace:"技能空间",sandboxNotConfigured:"管理员未配置 Dev Sandbox",adminNotConfigured:"管理员未配置",totalItems:"共 {{count}} 项",cannotLoadSpaces:"无法加载技能空间",someSpacesFailed:"部分技能空间加载失败",degradedRelationWarning:"部分关联异常,已恢复可读取技能",downloadZip:"下载 ZIP",optimize:"优化",closeSkillDetails:"关闭技能详情",skillId:"技能 ID",allFiles:"完整文件",loadingSkillContent:"正在读取技能内容…",noSkillContent:"该技能暂无 SKILL.md 内容",addSkill:"添加技能",localUpload:"本地上传",localUploadDescription:"选择 ZIP 文件,校验通过后上传到技能空间",autoCreate:"自动创建",autoCreateDescription:"选择模型和风格,通过对话生成技能",createSkill:"创建技能",optimizeNamed:"优化 {{name}}",deleteSkillConfirm:"确定删除整个 Skill“{{name}}”吗?此操作会影响所有引用它的空间。",deleteSpaceConfirm:"确定删除 Skill 空间“{{name}}”吗?请先确认空间中的技能已删除。",manageSpaceDescription:"管理空间中的技能并创建新的版本",backToSpaces:"返回技能空间列表",overview:"概览",skillCount:"技能数量",skillCountValue_one:"{{count}} 技能",skillCountValue_other:"{{count}} 技能",updatedAt:"更新时间",skillsInSpace:"{{name}}中的技能",searchSkills:"搜索技能",cannotLoadSkills:"无法加载技能",noMatchingSkills:"没有匹配的技能",noSkills:"暂无技能",tryAnotherName:"请尝试搜索其他名称",emptySkillsDescription:"本地上传 Skill,或自动创建",actions:"操作",spaceDetails:"技能空间详情",editSpace:"编辑空间",deleteSpace:"删除空间",searchSpaces:"搜索技能空间",spaceList:"技能空间列表",noMatchingSpaces:"没有匹配的技能空间",createSpace:"新建技能空间",newSpace:"新建空间",loadingMoreSpaces:"正在加载更多技能空间",scrollForMore:"继续下滑加载更多",allSpacesLoaded:"已加载全部技能空间",errors:{loadSpaces:"读取技能空间失败,请稍后重试",loadSkills:"读取技能失败,请稍后重试",loadSkillDetails:"读取技能详情失败,请稍后重试",deleteSkill:"删除 Skill 失败",deleteSpace:"删除 Skill 空间失败",downloadSkill:"下载 Skill 失败"},status:{active:"可用",available:"可用",creating:"创建中",disabled:"已停用",enabled:"已启用",failed:"异常",inactive:"未启用",pending:"等待中",published:"已发布",ready:"就绪",released:"已发布",running:"运行中",success:"正常",unavailable:"不可用",unreleased:"未发布",updating:"更新中",unknown:"未知"},sharedSpace:"企业共享空间",sharedDescription:"面向企业全员开放的技能,由管理员统一发布和维护",sharedVisibility:"全员可见",sharedPreparing:"正在准备共享空间",sharedLoadFailed:"共享空间加载失败",sharedEmpty:"暂无共享技能,管理员发布后会显示在这里",requestPublication:"申请公开",reviewSubmitting:"提交中…",reviewSubmitted:"已申请",reviewFailed:"申请公开失败",reviewStatusFailed:"审核状态加载失败",reviewRetry:"重新申请",reviewPending:"待审核",reviewApproving:"发布中",reviewApproved:"已公开",reviewReturned:"已退回",reviewHistory:"审核记录",skillDetailSections:"技能详情内容",versions:{title:"版本管理",refresh:"刷新",uploading:"上传中…",upload:"上传新版本",close:"关闭",hint:"新版本不会替换已公开版本,审核通过后才会公开;ZIP 中的技能名称需与原技能一致",loading:"正在加载版本…",loadFailed:"无法加载版本",filesFailed:"无法加载版本文件",uploadFailed:"上传新版本失败",submitFailed:"提交申请失败",retry:"重试",empty:"暂无版本",current:"当前版本",notSubmitted:"未申请公开",submitting:"提交中…",submit:"申请公开",processing:"版本状态:{{status}}",filesLoading:"正在加载文件…",filesEmpty:"暂无文件",history:"历史审核记录",shared:"已公开"},author:"作者",authorName:"作者:{{name}}"},PYe={library:"知识库",createBase:"新建知识库",editBase:"编辑知识库",invalidName:"名称必须以字母开头,且只能包含字母、数字和下划线。",nameHelp:"以字母开头,仅支持字母、数字和下划线,最多 48 个字符。",optionalDescription:"描述(可选)",descriptionOnly:"AgentKit 当前仅支持更新知识库描述。",previewWeb:"预览网页内容",addData:"添加数据",openOriginalWeb:"打开原网页",backToEdit:"返回修改",confirmAdd:"确认添加",source:"知识来源",image:"图片",documentFile:"文档文件",webPage:"在线网页",webUrl:"网页 URL",generatingWebPreview:"正在抓取网页并生成 Markdown 预览",selectFile:"选择知识文件",selectOrDropFile:"选择文件或拖拽到这里",selectedFile:"{{size}} · 点击可重新选择",imageFileHelp:"支持 PNG、JPG 和 JPEG,单个文件不超过 200 MB",documentFileHelp:"支持 PDF、PPTX、DOCX、XLSX 和 TXT,单个文件不超过 200 MB",uploadingFile:"正在上传文件并添加到知识库",optionalName:"名称(可选)",optionalType:"类型(可选)",generatePreview:"生成预览",uploadFile:"上传文件",editMetadata:"编辑知识 Metadata",knowledge:"知识",field:"字段",value:"值",backToList:"返回知识库列表",metadataJson:"元数据(JSON)",provider:"服务提供方",knowledgeId:"知识库 ID",project:"项目",creator:"创建者",data:"数据",deleteInvalidAssociation:"删除失效关联",noData:"这个知识库还没有数据",addFirstData:"添加第一项数据",format:"格式",size:"大小",searchData:"搜索数据",searchLibraryData:"搜索知识库数据",associationInvalid:"关联已失效",providerMissing:"底层 Provider 知识库已不存在",noMatchingData:"没有匹配的数据",loadingMoreData:"正在加载更多数据",retryLoading:"重试加载",details:"知识库详情",searchBases:"搜索知识库",someBasesFailed:"部分知识库暂时无法加载,已展示其余可用内容。",noMatchingBases:"没有匹配的知识库",noManagePermission:"您没有管理此知识库的权限",loadingMoreBases:"正在加载更多知识库",deleteBaseTitle:"删除知识库?",deleteBaseDescription:"将删除 {{name}} 的 AgentKit 关联;如果它由 Studio 创建,也会同时删除 Provider 资源。此操作无法撤销。",deleteDocumentTitle:"删除知识?",deleteDocumentDescription:"将从 Provider 知识库中删除 {{name}},此操作无法撤销。",preview:{processingTitle:"数据正在处理中",processingDetail:"知识库完成解析后即可预览,请稍后重新加载。",failedTitle:"数据解析失败",failedDetail:"请检查源文件或网页地址后重新添加,也可以重新加载最新状态。",noParsedTitle:"暂时没有可预览的解析内容",noParsedDetail:"此类文件会在知识库完成解析后显示文本、表格或页面图片。",noMediaTitle:"暂时没有可预览的媒体内容",noMediaDetail:"知识库尚未返回可访问的媒体预览,请稍后重新加载。",noDataTitle:"暂无可预览的数据内容",noDataDetail:"知识库尚未返回解析结果,请稍后重新加载。",attachmentError:"附件无法预览,请稍后重试。",imageAlt:"知识数据图片",audioUnsupported:"当前浏览器不支持音频预览。",videoUnsupported:"当前浏览器不支持视频预览。",namedPdf:"{{name}} PDF 预览",pdf:"PDF 预览",openPdf:"无法显示时,在新窗口打开 PDF",fileUnsupported:"当前格式暂不支持直接在线预览,已优先显示解析后的内容。",openOriginalFile:"打开原文件",loading:"正在加载数据预览",openOriginalHint:"您可以打开原网页查看来源内容。",chunk:"片段 {{index}}",loadingMore:"正在加载更多",loadMore:"加载更多"},errors:{fileTooLarge:"单个文件不能超过 200 MB",invalidImageType:"请选择 PNG、JPG 或 JPEG 图片",invalidDocumentType:"请选择 PDF、PPTX、DOCX、XLSX 或 TXT 文件",createBase:"创建知识库失败",updateBase:"更新知识库失败",metadataObject:"Metadata 必须是 JSON 对象",metadataFormat:"Metadata 格式错误",noWebPreview:"网页没有可预览的 Markdown 内容",addWeb:"添加网页失败",previewWeb:"生成网页预览失败",uploadFile:"上传文件失败",updateDocument:"更新知识失败",loadPreview:"加载数据预览失败",loadMoreBases:"加载更多知识库失败",loadBases:"加载知识库失败",loadMoreData:"加载更多数据失败",loadData:"加载数据失败",deleteBase:"删除知识库失败",deleteDocument:"删除知识失败"}},NYe={title:"飞书渠道",refresh:"刷新",loading:"正在加载渠道配置…",unsupported:"此 Runtime 不支持渠道管理,请升级 MPA 镜像。",unauthorized:"渠道管理需要 Studio 管理员身份及有效的 Runtime 凭据。",configurationError:"渠道管理配置不完整,请检查 Runtime 元数据及加密密钥。",requestFailed:"渠道请求失败,请检查 Runtime 连接后重试。",bound:"已绑定:{{name}}",unbound:"尚未绑定飞书机器人。",guidance:"私聊使用独立会话。在已授权群内 @ 当前机器人即可对话。",keyRequired:"绑定前请在 Runtime 配置持久的 CHANNEL_STATE_ENCRYPTION_KEY。",gateway:"消息网关",route:"入站路由",delivery:"回复投递",configured:"已配置",missing:"未配置",delivery_not_observed:"尚未观测",delivery_delivered:"已投递",delivery_retrying:"重试中",missingConfig:"缺少 Runtime 配置:{{fields}}",bind:"扫码绑定",newQr:"重新生成二维码",unbind:"解除绑定",confirmUnbind:"确认解绑此机器人?解绑后将停止接收新消息。",qrAlt:"机器人绑定二维码",openQr:"打开授权页面",uncertain:"注册过程已中断。重新开始前,请检查机器人绑定与 Gateway 状态。",bindingFailed:"绑定失败,请检查 Gateway 配置后重试。",chatId:"允许的群 ID",scope:"群会话策略",saveGroup:"保存群权限",noGroups:"尚未授权任何群。私聊无需群权限。",edit:"编辑",remove:"移除",removeGroup:"移除 {{name}}",scope_group_sender:"按发言人隔离",scope_group:"全群共享",scope_group_topic_sender:"按话题和发言人隔离",scope_group_topic:"按话题共享",status_PENDING:"等待扫码",status_SCANNED:"已扫码,等待授权",status_AUTHORIZED:"已授权,准备注册",status_REGISTERING:"正在注册机器人",status_BOUND:"机器人已绑定",status_FAILED:"绑定失败",status_EXPIRED:"二维码已过期",workspaceTitle:"消息渠道",workspaceDescription:"连接消息平台,让用户直接与此智能体对话,并管理访问权限。",provider_feishu:"飞书",provider_wecom:"企业微信",provider_dingtalk:"钉钉",comingSoon:"暂未开放",unavailableDescription:"{{name}}的绑定与消息配置暂未开放。",runtimeRequired:"请先将此智能体部署到 Runtime,再配置消息渠道。",bindingTitle:"机器人绑定",connected:"已绑定",notBound:"未绑定",gatewayDescription:"用于接收渠道消息的网关配置。",routeDescription:"将渠道消息转发给当前智能体的路由配置。",deliveryDescription:"实际观测到的回复投递状态,完成配置不代表已成功投递。",groupsTitle:"群聊权限",groupsDescription:"添加允许访问的群,并设置群内对话的共享范围。",providerBindingTitle:"绑定{{name}}",providerUnbound:"绑定{{name}}机器人,让用户通过消息与此智能体对话。",qrGuidance:"使用{{name}}扫码授权,Runtime 将保存机器人凭据并配置消息网关。",wecomGuidance:"使用企业微信扫码授权,或手动填写 Bot ID 和 Secret 绑定已有机器人。",wecomBotId:"Bot ID",wecomSecret:"Secret",bindCredentials:"绑定机器人",wecomScan:"扫码绑定",wecomAuthorizing:"等待企业微信授权…",cancelAuthorization:"取消授权",wecomPopupBlocked:"授权窗口被浏览器拦截,请允许弹窗后重试。",wecomAuthCancelled:"已取消企业微信授权,可以重新扫码。",wecomAuthTimeout:"企业微信授权已超时,请重新扫码。",wecomInvalidResult:"授权结果缺少 Bot ID 或 Secret,请重新授权或手动填写。",wecomAuthFailed:"企业微信授权失败,请重试或手动填写凭据。",dingtalkClientId:"Client ID",dingtalkClientSecret:"Client Secret",manualUpgrade:"当前镜像尚不支持{{name}}手动配置,请升级后使用;仍可使用极速配置。",pairingTitle:"消息渠道扫码配对",feishuPairingDescription:"如果已有连接机器人,飞书扫码并绑定成功后原有机器人会被替换,可选绑定存量机器人或新建机器人。",generatingQr:"正在生成配对二维码…",dingtalkGuidance:"使用钉钉扫码授权,或手动填写 Client ID 和 Client Secret 绑定已有机器人。",wecomPairingDescription:"将在企业微信授权窗口中重新扫码配对。新机器人绑定成功后会替换当前连接;取消授权或绑定失败不会解绑原机器人。",configurationMethod:"配置方式",quickSetup:"极速配置",manualSetup:"手动配置",feishuAppId:"App ID",feishuAppSecret:"App Secret",manualGuidance:"填写已有{{name}}机器人的应用凭据,连接到当前智能体。",manualReplacement:"绑定成功后将替换当前机器人;取消或绑定失败不会解除现有绑定。"},Ndr=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:gYe,agentSelector:LYe,agentWorkspace:vYe,channels:NYe,cloudEnvironment:AYe,common:pYe,composer:DYe,default:{common:pYe,agentKitPromo:gYe,systemInfo:mYe,agentWorkspace:vYe,environmentCenter:yYe,deploymentSelect:bYe,deploymentError:xYe,studioBuildProgress:wYe,cloudEnvironment:AYe,githubCicd:SYe,feishuDeployment:TYe,deploymentResources:CYe,studioUpdate:kYe,projectPreview:OYe,workspace:EYe,resourceCollection:_Ye,skillSourcePicker:RYe,composer:DYe,agentSelector:LYe,myAgents:MYe,skillCenter:IYe,knowledge:PYe,channels:NYe},deploymentError:xYe,deploymentResources:CYe,deploymentSelect:bYe,environmentCenter:yYe,feishuDeployment:TYe,githubCicd:SYe,knowledge:PYe,myAgents:MYe,projectPreview:OYe,resourceCollection:_Ye,skillCenter:IYe,skillSourcePicker:RYe,studioBuildProgress:wYe,studioUpdate:kYe,systemInfo:mYe,workspace:EYe},Symbol.toStringTag,{value:"Module"})),BYe="用户管理",$Ye="{{count}} 位成员",FYe="用户",zYe="角色",UYe="账号状态",VYe="最近登录",GYe="操作",QYe="更改角色",HYe="关闭",WYe="保存角色",YYe="正在保存…",qYe="取消",jYe="返回",XYe="用户池",KYe="火山引擎 Identity",ZYe="搜索姓名、邮箱或用户 ID",JYe="搜索",eqe="筛选角色",tqe="全部角色",rqe="刷新",nqe="正在读取用户…",iqe="更新于 {{time}}",aqe="已将 {{name}} 设置为{{role}}",oqe="重试",sqe="你",lqe="初始超级管理员",cqe="初始超级管理员受保护,不能在此降级",uqe="保存后,对方刷新 Studio 即可使用新的权限",dqe="角色需要重新确认",hqe="没有匹配的用户",fqe="尝试其他关键词或角色",pqe="用户登录或加入当前用户池后会显示在这里",gqe="共 {{count}} 位用户",mqe="上一页",vqe="下一页",yqe="尚未登录",bqe="未提供",xqe={super_admin:"超级管理员",admin:"管理员",developer:"开发者",user:"普通用户"},wqe={super_admin:"管理所有资源,并管理用户和分配角色",admin:"管理 Studio 资源",developer:"开发智能体并管理自己的资源",user:"使用智能体和个人功能"},Aqe={EXTERNAL_PROVIDER:"正常",CONFIRMED:"正常",NORMAL:"正常",ENABLED:"正常",ACTIVE:"正常",UNCONFIRMED:"待验证",DISABLED:"已停用",FORBIDDEN:"已禁用",LOCKED:"已锁定",SUSPENDED:"已暂停",FORCE_CHANGE_PASSWORD:"需要修改密码"},Sqe={request_failed:"请求未完成,请刷新列表确认当前状态后重试",invalid_response:"用户服务返回异常,请刷新后重试",identity_unavailable:"暂时无法访问 Identity,请稍后重试或检查服务权限",identity_resource_missing:"用户或用户池已不存在,请刷新列表",super_administrator_required:"只有超级管理员可以管理用户",sign_in_required:"请登录后重试",user_not_in_pool:"当前账号不属于此用户池",user_disabled:"当前账号已停用",protected_administrator:"不能降低初始超级管理员的权限",cannot_demote_self:"不能降低自己的超级管理员权限",role_change_conflict:"角色已发生变化,请关闭弹窗并刷新列表后重试",cross_origin_request:"请在当前 Studio 页面内修改角色"},Bdr=Object.freeze(Object.defineProperty({__proto__:null,actions:GYe,allRoles:tqe,back:jYe,cancel:qYe,changeRole:QYe,close:HYe,default:{title:BYe,memberCount:$Ye,user:FYe,role:zYe,status:UYe,lastLogin:VYe,actions:GYe,changeRole:QYe,close:HYe,save:WYe,saving:YYe,cancel:qYe,back:jYe,pool:XYe,volcengineIdentity:KYe,searchPlaceholder:ZYe,search:JYe,filterRole:eqe,allRoles:tqe,refresh:rqe,loading:nqe,updatedAt:iqe,saved:aqe,retry:oqe,you:sqe,initialAdministrator:lqe,protectedExplanation:cqe,effectiveAfterRefresh:uqe,roleConflict:dqe,noUsers:hqe,tryAnotherSearch:fqe,poolEmpty:pqe,resultCount:gqe,previous:mqe,next:vqe,neverLoggedIn:yqe,unknown:bqe,roles:xqe,descriptions:wqe,states:Aqe,errors:Sqe},descriptions:wqe,effectiveAfterRefresh:uqe,errors:Sqe,filterRole:eqe,initialAdministrator:lqe,lastLogin:VYe,loading:nqe,memberCount:$Ye,neverLoggedIn:yqe,next:vqe,noUsers:hqe,pool:XYe,poolEmpty:pqe,previous:mqe,protectedExplanation:cqe,refresh:rqe,resultCount:gqe,retry:oqe,role:zYe,roleConflict:dqe,roles:xqe,save:WYe,saved:aqe,saving:YYe,search:JYe,searchPlaceholder:ZYe,states:Aqe,status:UYe,title:BYe,tryAnotherSearch:fqe,unknown:bqe,updatedAt:iqe,user:FYe,volcengineIdentity:KYe,you:sqe},Symbol.toStringTag,{value:"Module"})),Tqe="网站集成",Cqe="将 AgentKit Runtime 以悬浮聊天窗口嵌入网站",kqe="返回自动化列表",Oqe="添加网站",Eqe="正在加载 Runtime",_qe="选择 Runtime",Rqe="网站域名",Dqe="例如 xxxx.com 或 localhost:5173",Lqe="正在生成",Mqe="生成 Token",Iqe="已添加网站",Pqe="{{count}} 个",Nqe="{{count}} 个",Bqe="正在加载网站集成",$qe="还没有网站集成",Fqe="选择 Runtime 并输入网站域名即可生成 Token",zqe="引入方法",Uqe="将下面代码放到网页的 body 结束标签前",Vqe="已复制",Gqe="复制代码",Qqe="添加网站后会在这里生成引入代码。",Hqe="确定删除 {{domain}} 的网站集成吗?",Wqe={load:"加载网站集成失败",create:"创建网站集成失败",delete:"删除网站集成失败",noConversationalAgent:"该 Runtime 暂未发现可对话的 Agent"},Yqe={requestFailed:"请求失败 ({{status}})",greeting:"您好,有什么可以帮您?",sessionFailed:"无法建立对话会话",unauthorized:"当前网站未获得对话授权",conversationFailed:"对话请求失败,请稍后重试",open:"打开智能体对话",close:"关闭智能体对话",panelLabel:"智能体对话面板",assistant:"智能体助手",online:"在线对话"},$dr=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:Oqe,addedWebsites:Iqe,backToAutomations:kqe,confirmDelete:Hqe,copied:Vqe,copyCode:Gqe,default:{title:Tqe,description:Cqe,backToAutomations:kqe,addWebsite:Oqe,loadingRuntime:Eqe,selectRuntime:_qe,websiteDomain:Rqe,domainPlaceholder:Dqe,generating:Lqe,generateToken:Mqe,addedWebsites:Iqe,websiteCount_one:Pqe,websiteCount_other:Nqe,loadingIntegrations:Bqe,delete:"删除",emptyTitle:$qe,emptyDescription:Fqe,embedMethod:zqe,embedInstructions:Uqe,copied:Vqe,copyCode:Gqe,embedHint:Qqe,confirmDelete:Hqe,errors:Wqe,widget:Yqe},description:Cqe,domainPlaceholder:Dqe,embedHint:Qqe,embedInstructions:Uqe,embedMethod:zqe,emptyDescription:Fqe,emptyTitle:$qe,errors:Wqe,generateToken:Mqe,generating:Lqe,loadingIntegrations:Bqe,loadingRuntime:Eqe,selectRuntime:_qe,title:Tqe,websiteCount_one:Pqe,websiteCount_other:Nqe,websiteDomain:Rqe,widget:Yqe},Symbol.toStringTag,{value:"Module"})),qqe={types:{all:"全部类型",document:"文档",image:"图片",video:"视频"},previewArtifact:"预览 {{name}}",moreActions:"更多操作 {{name}}",actionMenu:"{{name}} 操作",download:"下载",downloading:"下载中",edit:"编辑信息",delete:"删除产物",previewFailed:"无法预览“{{name}}”:{{message}}",downloadStarted:"已开始下载 {{name}}",downloadFailed:"无法下载“{{name}}”:{{message}}",updated:"已更新 {{name}}",deleted:"已删除 {{name}}",deleteFailed:"无法删除“{{name}}”:{{message}}",typeFilter:"产物类型",searchAria:"搜索产物",searchPlaceholder:"搜索产物或会话",retry:"重试",close:"关闭",listAria:"产物列表",loadFailed:"产物加载失败",loadDetailFallback:"请检查存储配置后重试。",reload:"重新加载",noMatch:"没有找到匹配的产物",noArtifacts:"您还没有任何产物",searchHint:"请尝试搜索其他名称或切换类型",emptyHint:"聊天中生成的产物会自动显示在这里",columns:{name:"名称",source:"来源",updatedAt:"修改时间",actions:"操作"},loadingMore:"正在加载更多产物",unknownTime:"时间未知",preview:{close:"关闭预览",meta:"{{type}} / 版本 {{version}}",loading:"正在加载预览",alt:"{{name}} 预览",loadFailed:"预览加载失败,请稍后重试或下载查看",unsupported:"当前格式暂不支持在线预览,请下载查看",sourceAria:"产物来源",agent:"智能体",session:"会话",tool:"生成工具",createdAt:"生成时间",fileSize:"文件大小",tags:"标签",viewSession:"查看会话"},deleteDialog:{title:"删除产物?",description:"“{{name}}”将从产物库永久删除,聊天记录不会受到影响。",deleting:"删除中",confirm:"删除",close:"关闭删除确认框"},api:{withStatus:"{{message}}({{status}})",listFailed:"读取产物库失败",syncFailed:"同步聊天产物失败",updateFailed:"更新产物失败",deleteFailed:"删除产物失败",downloadFailed:"下载产物失败"}},jqe={unknownSource:"未知来源",unknownCreator:"未知创建者"},Xqe={nameRequired:"请输入产物名称",tooManyTags:"标签最多 {{max}} 个",tagTooLong:"单个标签不能超过 {{max}} 个字符",title:"编辑产物信息",subtitle:"内容文件不会被修改",close:"关闭编辑框",name:"名称",description:"描述",descriptionPlaceholder:"补充用途、版本或使用说明",tags:"标签",tagsPlaceholder:"使用逗号分隔,最多 {{max}} 个",cancel:"取消",saving:"保存中",save:"保存"},Kqe={change:{added:"新增",modified:"修改",deleted:"删除"},noChanges:"两个版本的源码没有差异",chooseFile:"从左侧选择文件以查看代码",compareTitle:"版本对比",workspaceTitle:"源码工作区",projectFallback:"Agent 项目",switchTheme:"切换源码主题",switchThemeTitle:"切换为{{theme}}主题",themes:{dark:"深色",light:"浅色"},closeWorkspace:"关闭源码工作区",close:"关闭",changedFiles:"变更文件",projectFiles:"项目文件",changes:"变更",files:"文件",openFiles:"打开的文件",noFileSelected:"未选择文件",comparisonDirection:"对比方向",before:"优化前",after:"优化后",loadingEditor:"正在加载编辑器…",changedFileCount_one:"{{count}} 个文件有变更",changedFileCount_other:"{{count}} 个文件有变更",fileCount_one:"{{count}} 个文件",fileCount_other:"{{count}} 个文件",lineCount_one:"{{count}} 行 · UTF-8",lineCount_other:"{{count}} 行 · UTF-8",viewSource:"查看源码",viewSourceAria:"查看和编辑项目源码"},Zqe={nav:"搜索",selectAgent:"请选择 Agent",checkingCapabilities:"正在检测 Agent 能力",notMounted:"当前 Agent 未挂载{{label}}",sources:{session:"会话",web:"网络",knowledge:"知识库",memory:"长期记忆"},webDescription:"通过 web_search 工具检索",backendLocal:"本地",failed:"搜索失败:{{message}}",placeholder:{selectAgent:"请先选择 Agent",web:"在网络中检索",knowledge:"在 {{name}} 中检索",knowledgeFallback:"当前 Agent 的知识库",memory:"在 {{name}} 中检索",memoryFallback:"当前用户的长期记忆",session:"在当前 Agent 的会话中检索"},sourceTypeAria:"搜索类型:{{label}}",notSelected:"未选择",sourceType:"搜索类型",selectSource:"选择搜索类型",noAgentHint:"选择一个 Agent 后,即可检索会话、网络及其挂载的数据源。",loadingCapabilities:"正在读取当前 Agent 的检索能力…",sourceUnavailable:"当前 Agent 未挂载该数据源",instructions:{web:"输入关键词后回车或点击按钮,通过 web_search 工具检索。",knowledge:"输入问题,检索当前 Agent 挂载的知识库。",memory:"输入线索,检索当前用户跨会话保存的长期记忆。",session:"输入关键词后回车或点击按钮,搜索当前 Agent 的会话。"},noResults:"未找到匹配“{{query}}”的结果。",knowledgeFragment:"知识片段 {{index}}",memoryFragment:"记忆片段 {{index}}"},Jqe={title:"开发者资源",sections:{documentation:{title:"相关链接",description:"查看开发文档与 AgentKit 常用入口"},bestPractices:{title:"最佳实践",description:"参考开发、调试与部署经验"},showcases:{title:"案例展示",description:"探索 AgentKit 应用案例"}},links:{veadkDocs:"VeADK 文档",cliDocs:"AgentKit CLI 文档",platformDocs:"AgentKit 平台文档",console:"AgentKit 控制台"},articles:{veadkDevelopment:{title:"使用 VeADK 开发并部署智能体",description:"使用 VeADK 构建 Agent,并部署至 AgentKit 智能体运行时。"},cliDevelopment:{title:"使用 AgentKit CLI 开发并部署智能体",description:"通过 AgentKit CLI 创建项目、调试 Agent,并完成部署。"},coverAlt:"{{title}}文章封面"},showcases:{researchAssistant:{title:"多智能体研究助手",description:"由多个专业 Agent 协同完成资料检索、分析和结论整理。"},multimodalAnalysis:{title:"多模态内容分析",description:"在统一会话中理解图片、文档和视频内容。"},customerService:{title:"智能客服工作台",description:"结合知识检索与工具调用处理复杂的客户服务任务。"},webSearch:{title:"联网搜索 Agent",description:"检索实时网页内容,并将信息整理为可追溯的回答。"},a2uiApp:{title:"A2UI 交互应用",description:"让 Agent 根据任务过程生成可交互的前端界面。"},previewAlt:"{{title}}界面预览"}},eje={title:"资源库",untitledSession:"未命名会话",categoryAria:"资源库分类",regionAria:"区域",tabs:{skills:"技能库",knowledge:"知识库",artifacts:"产物"}},tje={title:"管理 Agent",subtitle:"列出你有权管理的 AgentKit Runtime",mainAgentOnly:"仅显示主 Agent(控制面信息)。",deleteConfirm:'确定删除 Agent "{{name}}"?该 Runtime 将被永久删除。',regionFilterTitle:"按区域筛选",regionFilterAria:"区域筛选",regionAria:"区域",refresh:"刷新",loading:"加载中…",empty:"暂无你部署的 Agent。",connected:"已连接",connect:"连接到此 Agent",deleteRuntime:"删除该 Runtime",loadingDetail:"读取详情…",agentStructure:"Agent 结构",secretHidden:"敏感值不展示,可通过授权请求直接复制",revealSecret:"{{key}} 的敏感值",copySecret:"复制 {{key}} 的值",copy:"复制",copied:"已复制",copyFailed:"复制失败",notConfigured:"未配置",fields:{model:"模型",description:"描述",status:"状态信息",project:"项目",version:"版本",resources:"资源",memory:"记忆",tool:"工具",knowledge:"知识",mcpToolset:"MCP 工具集",updatedAt:"更新时间"},resource:{memory:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",concurrency:"并发 {{value}}"},environmentVariables:"环境变量",unnamed:"(未命名)"},rje={mainAgent:"主 Agent",subAgent:"子 Agent {{index}}",itemCount_one:"{{count}} 项",itemCount_other:"{{count}} 项",info:"Agent 信息",infoAndTopology:"Agent 信息与设置",loadingInfo:"正在读取 Agent 信息…",unnamedAgent:"未命名 Agent",agentsMd:"AGENTS.md",tools:"工具",toolList:"工具列表",studioTool:"Studio Tool",removeTool:"移除工具 {{name}}",remove:"移除",notConfigured:"未配置",addStudioTool:"添加 Studio 工具",addStudioToolHere:"在此对话中添加 Studio 工具",skills:"技能",skillList:"技能列表",addSkill:"添加技能空间技能",addSkillHere:"向此会话添加技能空间技能",skillMountNextTurn:"挂载的版本将在下一 Turn 开始时冻结。",previewUnsupported:"暂不支持预览",sessionEnvironment:"会话环境",environment:"环境",agentCanvas:"Agent 画布",topology:"结构拓扑",nodeKinds:{agent:"Agent",sandbox:"沙箱","worker-session":"Worker 会话","skill-space":"技能空间",skill:"技能","studio-tool":"Studio 工具",mcp:"MCP",environment:"环境",knowledge:"知识库","sub-agent":"子 Agent"},nodeStatuses:{configured:"已配置",mounted:"已挂载",running:"运行中",paused:"已暂停"},viewCanvasFullscreen:"全屏查看 Agent 画布",viewFullscreen:"全屏查看",executionCanvas:"Agent 执行画布",fullscreenExecutionCanvas:"全屏 Agent 执行画布",closeFullscreenCanvas:"关闭全屏画布",close:"关闭",capabilitiesSubtitle:"能力与协作拓扑",closeInfo:"关闭 Agent 信息",infoUnavailable:"暂时无法读取 Agent 信息。",refresh:"刷新信息",loadingSkills:"正在加载绑定技能…",sessionSkills:"本会话临时技能",noBoundSpace:"当前智能体未绑定技能空间。",noBoundSkills:"绑定的技能空间暂无技能。",loadFailed:"加载失败,请刷新重试。",accessDenied:"无权读取此信息。",documentUnsupported:"当前 Runtime 不支持 Studio 读取 AGENTS.md,请升级 Runtime 镜像。",skillsUnsupported:"当前 Runtime 未提供技能空间绑定信息。",skillsDegraded:"技能信息不完整,请刷新重试。",documentEditHint:"编辑最新版本。保存会发布新版本到此技能空间,可能影响使用它的其他智能体。运行中的会话可能需要等待缓存刷新或新建会话后生效。请保留 frontmatter 中的 name。",documentLoading:"正在加载 SKILL.md…",documentWritable:"可编辑",documentReadOnly:"只读:此空间或当前权限不允许编辑",documentLoadFailed:"无法加载 SKILL.md,请刷新重试。",documentSaveFailed:"未确认保存成功,已保留编辑内容。重试前请重新打开,检查当前版本。",documentConflict:"技能已有新版本。请复制当前修改,再重新打开编辑器,避免覆盖。",discardDocument:"放弃未保存的修改?",keepEditing:"继续编辑",discardChanges:"放弃修改",saveDocument:"保存为新版本"},nje={mountFailed:"挂载环境失败",closeDialog:"关闭环境弹窗",addTitle:"添加环境",description:"选择当前会话允许 Agent 使用的 Sandbox 环境",closeAdd:"关闭添加环境",searchAria:"搜索环境",searchPlaceholder:"搜索环境名称或能力",availableAria:"可用环境与工作区",loading:"正在读取可用环境…",noMatch:"没有匹配的环境或工作区",workspaces:"工作区",reuseAll:"复用工作区中的全部可用环境",availableEnvironmentCount_one:"{{count}} 个可用环境",availableEnvironmentCount_other:"{{count}} 个可用环境",selectWorkspace:"选择工作区 {{name}}",environments:"环境",includedByWorkspaces:"已由工作区 {{names}} 包含",nameSeparator:"、",selectEnvironment:"选择环境 {{name}}",selectedWorkspaceCount_one:"{{count}} 个工作区",selectedWorkspaceCount_other:"{{count}} 个工作区",coveredEnvironmentCount_one:"{{count}} 个环境",coveredEnvironmentCount_other:"{{count}} 个环境",selectionSummary:"已选择 {{workspaces}},覆盖 {{environments}}",cancel:"取消",mounting:"正在挂载…",confirm:"确认添加",mountedAria:"已挂载环境",environmentCount_one:"{{count}} 个环境",environmentCount_other:"{{count}} 个环境",removeWorkspace:"移除工作区 {{name}}",remove:"移除",removeEnvironment:"移除环境 {{name}}",add:"添加环境",addMore:"添加更多环境",addForSession:"为当前 Session 添加环境",loadingAvailable:"正在加载可用环境…",empty:"暂无可用的 AIO Sandbox 环境。"},ije={loading:{searching:"正在查找已有环境",creating:"环境初始化中",connecting:"正在连接已有环境"},initializationFailed:"AgentKit CLI 环境初始化失败,当前状态:{{status}}。",sessionExpired:"AgentKit CLI Session 不存在或已过期,请重试。",initializationTimeout:"AgentKit CLI 环境初始化超时,请稍后重试。",nonPersistent:"非持久化环境",recyclingHoursMinutes:"{{hours}} 小时 {{minutes}} 分钟后环境回收",recyclingMinutes:"{{minutes}} 分钟后环境回收",connectionError:`无法连接 Studio 服务,未收到服务端响应。 原始错误:{{message}}`,unavailable:"连接不可用",requestFailed:"AgentKit CLI 请求失败",retry:"重试",terminalTitle:"AgentKit CLI 终端"},aje={labels:{coding:"智能编程",get_city_weather:"城市天气查询",get_location_weather:"位置天气查询",web_fetch:"网页内容获取",studio_write_artifact:"保存会话产物"},closeDialog:"关闭弹窗",title:"添加 Studio 工具",description:"由 Studio BFF 为 {{agentName}} 的当前会话执行,Runtime 无需预装",close:"关闭添加 Studio 工具",searchAria:"搜索 Studio 工具",searchPlaceholder:"搜索名称或工具标识",availableAria:"可用 Studio 工具",loading:"正在读取 Studio 工具…",noMatch:"没有匹配的 Studio 工具",remove:"移除",add:"添加"},oje={artifactLibrary:qqe,resourceMetadata:jqe,artifactEdit:Xqe,codeBrowser:Kqe,search:Zqe,developerResources:Jqe,library:eje,manageAgents:tje,agentTopology:rje,sessionEnvironment:nje,agentKitCli:ije,studioTools:aje},Fdr=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:ije,agentTopology:rje,artifactEdit:Xqe,artifactLibrary:qqe,codeBrowser:Kqe,default:oje,developerResources:Jqe,library:eje,manageAgents:tje,resourceMetadata:jqe,search:Zqe,sessionEnvironment:nje,studioTools:aje},Symbol.toStringTag,{value:"Module"})),sje=["zh-CN","en-US"],nle="en-US",zdr="agentkit.studio.locale",Udr={"zh-CN":{dir:"ltr",nativeName:"简体中文"},"en-US":{dir:"ltr",nativeName:"English"}};function ile(t){if(!t)return null;const e=t.trim().replace(/_/g,"-").toLowerCase(),r=sje.find(n=>n.toLowerCase()===e);return r||(e==="zh"||e.startsWith("zh-")?"zh-CN":e==="en"||e.startsWith("en-")?"en-US":null)}function Vdr(){if(typeof window>"u")return null;try{return ile(window.localStorage.getItem(zdr))}catch{return null}}function Gdr(){if(typeof window>"u")return[];const t=window.navigator;return t?t.languages.length>0?t.languages:t.language?[t.language]:[]:[]}function Qdr(){const t=Vdr();if(t)return t;for(const e of Gdr()){const r=ile(e);if(r)return r}return nle}function lje(t){typeof document>"u"||(document.documentElement.lang=t,document.documentElement.dir=Udr[t].dir)}const vn=t=>typeof t=="string",R6=()=>{let t,e;const r=new Promise((n,i)=>{t=n,e=i});return r.resolve=t,r.reject=e,r},ale=t=>t==null?"":String(t),Hdr=(t,e,r)=>{t.forEach(n=>{e[n]&&(r[n]=e[n])})},Wdr=/###/g,cje=t=>t&&t.includes("###")?t.replace(Wdr,"."):t,uje=t=>!t||vn(t),D6=(t,e,r)=>{const n=vn(e)?e.split("."):e;let i=0;for(;i{const{obj:n,k:i}=D6(t,e,Object);if(n!==void 0||e.length===1){n[i]=r;return}let a=e[e.length-1],o=e.slice(0,e.length-1),s=D6(t,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=D6(t,o,Object),s!=null&&s.obj&&typeof s.obj[`${s.k}.${a}`]<"u"&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=r},Ydr=(t,e,r,n)=>{const{obj:i,k:a}=D6(t,e,Object);i[a]=i[a]||[],i[a].push(r)},tG=(t,e)=>{const{obj:r,k:n}=D6(t,e);if(r&&Object.prototype.hasOwnProperty.call(r,n))return r[n]},qdr=(t,e,r)=>{const n=tG(t,r);return n!==void 0?n:tG(e,r)},hje=(t,e,r)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(Object.prototype.hasOwnProperty.call(t,n)?vn(t[n])||t[n]instanceof String||vn(e[n])||e[n]instanceof String?r&&(t[n]=e[n]):hje(t[n],e[n],r):t[n]=e[n]);return t},qv=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),jdr={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},Xdr=t=>vn(t)?t.replace(/[&<>"'\/]/g,e=>jdr[e]):t;class Kdr{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const r=this.regExpMap.get(e);if(r!==void 0)return r;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}const Zdr=[" ",",","?","!",";"],Jdr=new Kdr(20),ehr=(t,e,r)=>{e=e||"",r=r||"";const n=Zdr.filter(o=>!e.includes(o)&&!r.includes(o));if(n.length===0)return!0;const i=Jdr.getRegExp(`(${n.map(o=>o==="?"?"\\?":o).join("|")})`);let a=!i.test(t);if(!a){const o=t.indexOf(r);o>0&&!i.test(t.substring(0,o))&&(a=!0)}return a},ole=(t,e,r=".")=>{if(!t)return;if(t[e])return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;const n=e.split(r);let i=t;for(let a=0;at==null?void 0:t.replace(/_/g,"-"),thr={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){var r,n;(n=(r=console==null?void 0:console[t])==null?void 0:r.apply)==null||n.call(r,console,e)}};class rG{constructor(e,r={}){this.init(e,r)}init(e,r={}){this.prefix=r.prefix||"i18next:",this.logger=e||thr,this.options=r,this.debug=r.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,r,n,i){return i&&!this.debug?null:(e=e.map(a=>vn(a)?a.replace(/[\r\n\x00-\x1F\x7F]/g," "):a),vn(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[r](e))}create(e){return new rG(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new rG(this.logger,e)}}var mm=new rG;class nG{constructor(){this.observers={}}on(e,r){return e.split(" ").forEach(n=>{this.observers[n]||(this.observers[n]=new Map);const i=this.observers[n].get(r)||0;this.observers[n].set(r,i+1)}),this}off(e,r){if(this.observers[e]){if(!r){delete this.observers[e];return}this.observers[e].delete(r)}}once(e,r){const n=(...i)=>{r(...i),this.off(e,n)};return this.on(e,n),this}emit(e,...r){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([i,a])=>{for(let o=0;o{for(let o=0;o-1&&this.options.ns.splice(r,1)}getResource(e,r,n,i={}){var u,d;const a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,o=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;e.includes(".")?s=e.split("."):(s=[e,r],n&&(Array.isArray(n)?s.push(...n):vn(n)&&a?s.push(...n.split(a)):s.push(n)));const l=tG(this.data,s);return!l&&!r&&!n&&e.includes(".")&&(e=s[0],r=s[1],n=s.slice(2).join(".")),l||!o||!vn(n)?l:ole((d=(u=this.data)==null?void 0:u[e])==null?void 0:d[r],n,a)}addResource(e,r,n,i,a={silent:!1}){const o=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let s=[e,r];n&&(s=s.concat(o?n.split(o):n)),e.includes(".")&&(s=e.split("."),i=r,r=s[1]),this.addNamespaces(r),dje(this.data,s,i),a.silent||this.emit("added",e,r,n,i)}addResources(e,r,n,i={silent:!1}){for(const a in n)(vn(n[a])||Array.isArray(n[a]))&&this.addResource(e,r,a,n[a],{silent:!0});i.silent||this.emit("added",e,r,n)}addResourceBundle(e,r,n,i,a,o={silent:!1,skipCopy:!1}){let s=[e,r];e.includes(".")&&(s=e.split("."),i=n,n=r,r=s[1]),this.addNamespaces(r);let l=tG(this.data,s)||{};o.skipCopy||(n=JSON.parse(JSON.stringify(n))),i?hje(l,n,a):l={...l,...n},dje(this.data,s,l),o.silent||this.emit("added",e,r,n)}removeResourceBundle(e,r){this.hasResourceBundle(e,r)&&delete this.data[e][r],this.removeNamespaces(r),this.emit("removed",e,r)}hasResourceBundle(e,r){return this.getResource(e,r)!==void 0}getResourceBundle(e,r){return r||(r=this.options.defaultNS),this.getResource(e,r)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const r=this.getDataByLanguage(e);return!!(r&&Object.keys(r)||[]).find(i=>r[i]&&Object.keys(r[i]).length>0)}toJSON(){return this.data}}var pje={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,r,n,i){return t.forEach(a=>{var o;e=((o=this.processors[a])==null?void 0:o.process(e,r,n,i))??e}),e}};const gje=Symbol("i18next/PATH_KEY");function rhr(){const t=[],e=Object.create(null);let r;return e.get=(n,i)=>{var a;return(a=r==null?void 0:r.revoke)==null||a.call(r),i===gje?t:(t.push(i),r=Proxy.revocable(n,e),r.proxy)},Proxy.revocable(Object.create(null),e).proxy}function bA(t,e){const{[gje]:r}=t(rhr()),n=(e==null?void 0:e.keySeparator)??".",i=(e==null?void 0:e.nsSeparator)??":",a=(e==null?void 0:e.enableSelector)==="strict";if(r.length>1&&i){const o=e==null?void 0:e.ns,s=a?Array.isArray(o)?o:o?[o]:null:Array.isArray(o)?o:null;if(s&&(a?s:s.length>1?s.slice(1):[]).includes(r[0]))return`${r[0]}${i}${r.slice(1).join(n)}`}return r.join(n)}const sle=t=>!vn(t)&&typeof t!="boolean"&&typeof t!="number";class iG extends nG{constructor(e,r={}){super(),Hdr(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=mm.create("translator"),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,r={interpolation:{}}){const n={...r};if(e==null)return!1;const i=this.resolve(e,n);if((i==null?void 0:i.res)===void 0)return!1;const a=sle(i.res);return!(n.returnObjects===!1&&a)}extractFromKey(e,r){let n=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const i=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let a=r.ns||this.options.defaultNS||[];const o=n&&e.includes(n),s=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!ehr(e,n,i);if(o&&!s){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:vn(a)?[a]:a};const u=e.split(n);(n!==i||n===i&&this.options.ns.includes(u[0]))&&(a=u.shift()),e=u.join(i)}return{key:e,namespaces:vn(a)?[a]:a}}translate(e,r,n){let i=typeof r=="object"?{...r}:r;if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i=="object"&&(i={...i}),i||(i={}),e==null)return"";typeof e=="function"&&(e=bA(e,{...this.options,...i})),Array.isArray(e)||(e=[String(e)]),e=e.map(L=>typeof L=="function"?bA(L,{...this.options,...i}):String(L));const a=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:s,namespaces:l}=this.extractFromKey(e[e.length-1],i),u=l[l.length-1];let d=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;d===void 0&&(d=":");const h=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((h==null?void 0:h.toLowerCase())==="cimode")return f?a?{res:`${u}${d}${s}`,usedKey:s,exactUsedKey:s,usedLng:h,usedNS:u,usedParams:this.getUsedParamsDetails(i)}:`${u}${d}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:h,usedNS:u,usedParams:this.getUsedParamsDetails(i)}:s;const p=this.resolve(e,i);let g=p==null?void 0:p.res;const m=(p==null?void 0:p.usedKey)||s,v=(p==null?void 0:p.exactUsedKey)||s,y=["[object Number]","[object Function]","[object RegExp]"],b=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,w=i.count!==void 0&&!vn(i.count),A=iG.hasDefaultValue(i),S=w?this.pluralResolver.getSuffix(h,i.count,i):"",T=i.ordinal&&w?this.pluralResolver.getSuffix(h,i.count,{ordinal:!1}):"",C=w&&!i.ordinal&&i.count===0,O=C&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${S}`]||i[`defaultValue${T}`]||i.defaultValue;let E=g;x&&!g&&A&&(E=O);const _=sle(E),P=Object.prototype.toString.apply(E);if(x&&E&&_&&!y.includes(P)&&!(vn(b)&&Array.isArray(E))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const L=this.options.returnedObjectHandler?this.options.returnedObjectHandler(m,E,{...i,ns:l}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=L,p.usedParams=this.getUsedParamsDetails(i),p):L}if(o){const L=Array.isArray(E),R=L?[]:{},D=L?v:m;for(const M in E)if(Object.prototype.hasOwnProperty.call(E,M)){const I=`${D}${o}${M}`;A&&!g?R[M]=this.translate(I,{...i,defaultValue:sle(O)?O[M]:void 0,joinArrays:!1,ns:l}):R[M]=this.translate(I,{...i,joinArrays:!1,ns:l}),R[M]===I&&(R[M]=E[M])}g=R}}else if(x&&vn(b)&&Array.isArray(g))g=g.join(b),g&&(g=this.extendTranslation(g,e,i,n));else{let L=!1,R=!1;!this.isValidLookup(g)&&A&&(L=!0,g=O),this.isValidLookup(g)||(R=!0,g=s);const M=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&R?void 0:g,I=A&&O!==g&&this.options.updateMissing;if(R||L||I){if(this.logger.log(I?"updateKey":"missingKey",h,u,w&&!I?`${s}${this.pluralResolver.getSuffix(h,i.count,i)}`:s,I?O:g),o){const V=this.resolve(s,{...i,keySeparator:!1});V&&V.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let N=[];const F=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&F&&F[0])for(let V=0;V{var H;const G=A&&U!==g?U:M;this.options.missingKeyHandler?this.options.missingKeyHandler(V,u,z,G,I,i):(H=this.backendConnector)!=null&&H.saveMissing&&this.backendConnector.saveMissing(V,u,z,G,I,i),this.emit("missingKey",V,u,z,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&w?N.forEach(V=>{const z=this.pluralResolver.getSuffixes(V,i);C&&i[`defaultValue${this.options.pluralSeparator}zero`]&&!z.includes(`${this.options.pluralSeparator}zero`)&&z.push(`${this.options.pluralSeparator}zero`),z.forEach(U=>{B([V],s+U,i[`defaultValue${U}`]||O)})}):B(N,s,O))}g=this.extendTranslation(g,e,i,p,n),R&&g===s&&this.options.appendNamespaceToMissingKey&&(g=`${u}${d}${s}`),(R||L)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${d}${s}`:s,L?g:void 0,i))}return a?(p.res=g,p.usedParams=this.getUsedParamsDetails(i),p):g}extendTranslation(e,r,n,i,a){var l,u;if((l=this.i18nFormat)!=null&&l.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const d=vn(e)&&(((u=n==null?void 0:n.interpolation)==null?void 0:u.skipOnVariables)!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(d){const p=e.match(this.interpolator.nestingRegexp);h=p&&p.length}let f=n.replace&&!vn(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(f={...this.options.interpolation.defaultVariables,...f}),e=this.interpolator.interpolate(e,f,n.lng||this.language||i.usedLng,n),d){const p=e.match(this.interpolator.nestingRegexp),g=p&&p.length;h(a==null?void 0:a[0])===p[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${p[0]} in key: ${r[0]}`),null):this.translate(...p,r),n)),n.interpolation&&this.interpolator.reset()}const o=n.postProcess||this.options.postProcess,s=vn(o)?[o]:o;return e!=null&&(s!=null&&s.length)&&n.applyPostProcessor!==!1&&(e=pje.handle(s,e,r,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,r={}){let n,i,a,o,s;return vn(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(l=>typeof l=="function"?bA(l,{...this.options,...r}):l)),e.forEach(l=>{if(this.isValidLookup(n))return;const u=this.extractFromKey(l,r),d=u.key;i=d;let h=u.namespaces;this.options.fallbackNS&&(h=h.concat(this.options.fallbackNS));const f=r.count!==void 0&&!vn(r.count),p=f&&!r.ordinal&&r.count===0,g=r.context!==void 0&&(vn(r.context)||typeof r.context=="number")&&r.context!=="",m=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);h.forEach(v=>{var y,b;this.isValidLookup(n)||(s=v,!this.checkedLoadedFor[`${m[0]}-${v}`]&&((y=this.utils)!=null&&y.hasLoadedNamespace)&&!((b=this.utils)!=null&&b.hasLoadedNamespace(s))&&(this.checkedLoadedFor[`${m[0]}-${v}`]=!0,this.logger.warn(`key "${i}" for languages "${m.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),m.forEach(x=>{var S;if(this.isValidLookup(n))return;o=x;const w=[d];if((S=this.i18nFormat)!=null&&S.addLookupKeys)this.i18nFormat.addLookupKeys(w,d,x,v,r);else{let T;f&&(T=this.pluralResolver.getSuffix(x,r.count,r));const C=`${this.options.pluralSeparator}zero`,O=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(r.ordinal&&T.startsWith(O)&&w.push(d+T.replace(O,this.options.pluralSeparator)),w.push(d+T),p&&w.push(d+C)),g){const E=`${d}${this.options.contextSeparator||"_"}${r.context}`;w.push(E),f&&(r.ordinal&&T.startsWith(O)&&w.push(E+T.replace(O,this.options.pluralSeparator)),w.push(E+T),p&&w.push(E+C))}}let A;for(;A=w.pop();)this.isValidLookup(n)||(a=A,n=this.getResource(x,v,A,r))}))})}),{res:n,usedKey:i,exactUsedKey:a,usedLng:o,usedNS:s}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,r,n,i={}){var a;return(a=this.i18nFormat)!=null&&a.getResource?this.i18nFormat.getResource(e,r,n,i):this.resourceStore.getResource(e,r,n,i)}getUsedParamsDetails(e={}){const r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!vn(e.replace);let i=n?e.replace:e;if(n&&typeof e.count<"u"&&(i={...i,count:e.count}),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!n){i={...i};for(const a of r)delete i[a]}return i}static hasDefaultValue(e){const r="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&n.startsWith(r)&&e[n]!==void 0)return!0;return!1}}class mje{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=mm.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(e){if(e=L6(e),!e||!e.includes("-"))return null;const r=e.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(e){if(e=L6(e),!e||!e.includes("-"))return e;const r=e.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(e){if(vn(e)&&e.includes("-")){let r;try{r=Intl.getCanonicalLocales(e)[0]}catch{}return r&&this.options.lowerCaseLng&&(r=r.toLowerCase()),r||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let r;return e.forEach(n=>{if(r)return;const i=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(i))&&(r=i)}),!r&&this.options.supportedLngs&&e.forEach(n=>{if(r)return;const i=this.getScriptPartFromCode(n);if(this.isSupportedCode(i))return r=i;const a=this.getLanguagePartFromCode(n);if(this.isSupportedCode(a))return r=a;r=this.options.supportedLngs.find(o=>o===a?!0:!o.includes("-")&&!a.includes("-")?!1:!!(o.includes("-")&&!a.includes("-")&&o.slice(0,o.indexOf("-"))===a||o.startsWith(a)&&a.length>1))}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(e,r){if(!e)return[];if(typeof e=="function"&&(e=e(r)),vn(e)&&(e=[e]),Array.isArray(e))return e;if(!r)return e.default||[];let n=e[r];return n||(n=e[this.getScriptPartFromCode(r)]),n||(n=e[this.formatLanguageCode(r)]),n||(n=e[this.getLanguagePartFromCode(r)]),n||(n=e.default),n||[]}toResolveHierarchy(e,r){const n=this.options.fallbackLng,i=Array.isArray(n)?n.join("|"):n;i!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=i);const a=r===void 0||r===!1||vn(r),o=r===void 0&&typeof this.options.fallbackLng=="function",s=vn(e)&&a&&!o;let l=null;if(s){let f;r===void 0?f="undefined":r===!1?f="boolean:false":f=`string:${r}`,l=`${e.length}:${e}|${f}`}if(l!==null){const f=this.resolveHierarchyCache[l];if(f!==void 0)return f.slice()}const u=this.getFallbackCodes((r===!1?[]:r)||this.options.fallbackLng||[],e),d=[],h=f=>{f&&(this.isSupportedCode(f)?d.push(f):this.logger.warn(`rejecting language code not found in supportedLngs: ${f}`))};return vn(e)&&(e.includes("-")||e.includes("_"))?(this.options.load!=="languageOnly"&&h(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&h(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&h(this.getLanguagePartFromCode(e))):vn(e)&&h(this.formatLanguageCode(e)),u.forEach(f=>{d.includes(f)||h(this.formatLanguageCode(f))}),l!==null?(this.resolveHierarchyCache[l]=d,d.slice()):d}}const vje={zero:0,one:1,two:2,few:3,many:4,other:5},yje={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class nhr{constructor(e,r={}){this.languageUtils=e,this.options=r,this.logger=mm.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,r={}){const n=L6(e==="dev"?"en":e),i=r.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:n,type:i});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];let o;try{o=new Intl.PluralRules(n,{type:i})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),yje;if(!e.match(/-|_/))return yje;const l=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(l,r)}return this.pluralRulesCache[a]=o,o}needsPlural(e,r={}){let n=this.getRule(e,r);return n||(n=this.getRule("dev",r)),(n==null?void 0:n.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,r,n={}){return this.getSuffixes(e,n).map(i=>`${r}${i}`)}getSuffixes(e,r={}){let n=this.getRule(e,r);return n||(n=this.getRule("dev",r)),n?n.resolvedOptions().pluralCategories.sort((i,a)=>vje[i]-vje[a]).map(i=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(e,r,n={}){const i=this.getRule(e,n);return i?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i.select(r)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",r,n))}}const bje=(t,e,r,n=".",i=!0)=>{let a=qdr(t,e,r);return!a&&i&&vn(r)&&(a=ole(t,r,n),a===void 0&&(a=ole(e,r,n))),a},xje=t=>t.replace(/\$/g,"$$$$");class wje{constructor(e={}){var r;this.logger=mm.create("interpolator"),this.options=e,this.format=((r=e==null?void 0:e.interpolation)==null?void 0:r.format)||(n=>n),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:r,escapeValue:n,useRawValueToEscape:i,prefix:a,prefixEscaped:o,suffix:s,suffixEscaped:l,formatSeparator:u,unescapeSuffix:d,unescapePrefix:h,nestingPrefix:f,nestingPrefixEscaped:p,nestingSuffix:g,nestingSuffixEscaped:m,nestingOptionsSeparator:v,maxReplaces:y,alwaysFormat:b}=e.interpolation;this.escape=r!==void 0?r:Xdr,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=a?qv(a):o||"{{",this.suffix=s?qv(s):l||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":h?qv(h):"-",this.unescapeSuffix=this.unescapePrefix?"":d?qv(d):"",this.nestingPrefix=f?qv(f):p||qv("$t("),this.nestingSuffix=g?qv(g):m||qv(")"),this.nestingOptionsSeparator=v||",",this.maxReplaces=y||1e3,this.alwaysFormat=b!==void 0?b:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(r,n)=>(r==null?void 0:r.source)===n?(r.lastIndex=0,r):new RegExp(n,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,r,n,i){var p;let a,o,s;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=g=>{if(!g.includes(this.formatSeparator)){const b=bje(r,l,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(b,void 0,n,{...i,...r,interpolationkey:g}):b}const m=g.split(this.formatSeparator),v=m.shift().trim(),y=m.join(this.formatSeparator).trim();return this.format(bje(r,l,v,this.options.keySeparator,this.options.ignoreJSONStructure),y,n,{...i,...r,interpolationkey:v})};this.resetRegExp(),!this.escapeValue&&typeof e=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const d=(i==null?void 0:i.missingInterpolationHandler)||this.options.missingInterpolationHandler,h=((p=i==null?void 0:i.interpolation)==null?void 0:p.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>g},{regex:this.regexp,safeValue:g=>this.escapeValue?this.escape(g):g}].forEach(g=>{for(s=0;a=g.regex.exec(e);){const m=a[1].trim();if(o=u(m),o===void 0)if(typeof d=="function"){const y=d(e,a,i);o=vn(y)?y:""}else if(i&&Object.prototype.hasOwnProperty.call(i,m))o="";else if(h){o=a[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${e}`),o="";else!vn(o)&&!this.useRawValueToEscape&&(o=ale(o));const v=g.safeValue(o);if(e=e.replace(a[0],xje(v)),h?(g.regex.lastIndex+=v.length,g.regex.lastIndex-=a[0].length):g.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),e}nest(e,r,n={}){let i,a,o;const s=(l,u)=>{const d=this.nestingOptionsSeparator;if(!l.includes(d))return l;const h=l.split(new RegExp(`${qv(d)}[ ]*{`));let f=`{${h[1]}`;l=h[0],f=this.interpolate(f,o);const p=f.match(/'/g),g=f.match(/"/g);(((p==null?void 0:p.length)??0)%2===0&&!g||((g==null?void 0:g.length)??0)%2!==0)&&(f=f.replace(/'/g,'"'));try{o=JSON.parse(f),u&&(o={...u,...o})}catch(m){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,m),`${l}${d}${f}`}return o.defaultValue&&o.defaultValue.includes(this.prefix)&&delete o.defaultValue,l};for(;i=this.nestingRegexp.exec(e);){let l=[];o={...n},o=o.replace&&!vn(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;const u=/{.*}/s.test(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(u!==-1&&(l=i[1].slice(u).split(this.formatSeparator).map(d=>d.trim()).filter(Boolean),i[1]=i[1].slice(0,u)),a=r(s.call(this,i[1].trim(),o),o),a&&i[0]===e&&!vn(a))return a;vn(a)||(a=ale(a)),a||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),a=""),l.length&&(a=l.reduce((d,h)=>this.format(d,h,n.lng,{...n,interpolationkey:i[1].trim()}),a.trim())),e=e.replace(i[0],xje(ale(a))),this.regexp.lastIndex=0}return e}}const ihr=t=>{let e=t.toLowerCase().trim();const r={};if(t.includes("(")){const n=t.split("(");e=n[0].toLowerCase().trim();const i=n[1].slice(0,-1);e==="currency"&&!i.includes(":")?r.currency||(r.currency=i.trim()):e==="relativetime"&&!i.includes(":")?r.range||(r.range=i.trim()):i.split(";").forEach(o=>{if(o){const[s,...l]=o.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,""),d=s.trim();r[d]||(r[d]=u),u==="false"&&(r[d]=!1),u==="true"&&(r[d]=!0),isNaN(u)||(r[d]=parseInt(u,10))}})}return{formatName:e,formatOptions:r}},Aje=t=>{const e={};return(r,n,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});const o=n+JSON.stringify(a);let s=e[o];return s||(s=t(L6(n),i),e[o]=s),s(r)}},ahr=t=>(e,r,n)=>t(L6(r),n)(e);class ohr{constructor(e={}){this.logger=mm.create("formatter"),this.options=e,this.init(e)}init(e,r={interpolation:{}}){this.formatSeparator=r.interpolation.formatSeparator||",";const n=r.cacheInBuiltFormats?Aje:ahr;this.formats={number:n((i,a)=>{const o=new Intl.NumberFormat(i,{...a});return s=>o.format(s)}),currency:n((i,a)=>{const o=new Intl.NumberFormat(i,{...a,style:"currency"});return s=>o.format(s)}),datetime:n((i,a)=>{const o=new Intl.DateTimeFormat(i,{...a});return s=>o.format(s)}),relativetime:n((i,a)=>{const o=new Intl.RelativeTimeFormat(i,{...a});return s=>o.format(s,a.range||"day")}),list:n((i,a)=>{const o=new Intl.ListFormat(i,{...a});return s=>o.format(s)})}}add(e,r){this.formats[e.toLowerCase().trim()]=r}addCached(e,r){this.formats[e.toLowerCase().trim()]=Aje(r)}format(e,r,n,i={}){if(!r||e==null)return e;const a=r.split(this.formatSeparator),o=[];for(let l=0;l-1&&!u.includes(")")&&l+1{var f;const{formatName:d,formatOptions:h}=ihr(u);if(this.formats[d]){let p=l;try{const g=((f=i==null?void 0:i.formatParams)==null?void 0:f[i.interpolationkey])||{},m=g.locale||g.lng||i.locale||i.lng||n;p=this.formats[d](l,m,{...h,...i,...g})}catch(g){this.logger.warn(g)}return p}else this.logger.warn(`there was no format function for ${d}`);return l},e)}}const shr=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class lhr extends nG{constructor(e,r,n,i={}){var a,o;super(),this.backend=e,this.store=r,this.services=n,this.languageUtils=n.languageUtils,this.options=i,this.logger=mm.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],(o=(a=this.backend)==null?void 0:a.init)==null||o.call(a,n,i.backend,i)}queueLoad(e,r,n,i){const a={},o={},s={},l={};return e.forEach(u=>{let d=!0;r.forEach(h=>{const f=`${u}|${h}`;!n.reload&&this.store.hasResourceBundle(u,h)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?o[f]===void 0&&(o[f]=!0):(this.state[f]=1,d=!1,o[f]===void 0&&(o[f]=!0),a[f]===void 0&&(a[f]=!0),l[h]===void 0&&(l[h]=!0)))}),d||(s[u]=!0)}),(Object.keys(a).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(a),pending:Object.keys(o),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}loaded(e,r,n){const i=e.split("|"),a=i[0],o=i[1];r&&this.emit("failedLoading",a,o,r),!r&&n&&this.store.addResourceBundle(a,o,n,void 0,void 0,{skipCopy:!0}),this.state[e]=r?-1:2,r&&n&&(this.state[e]=0);const s={};this.queue.forEach(l=>{Ydr(l.loaded,[a],o),shr(l,e),r&&l.errors.push(r),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{s[u]||(s[u]={});const d=l.loaded[u];d.length&&d.forEach(h=>{s[u][h]===void 0&&(s[u][h]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(l=>!l.done)}read(e,r,n,i=0,a=this.retryTimeout,o){if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:r,fcName:n,tried:i,wait:a,callback:o});return}this.readingCalls++;const s=(u,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const h=this.waitingReads.shift();this.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}if(u&&d&&i{this.read(e,r,n,i+1,a*2,o)},a);return}o(u,d)},l=this.backend[n].bind(this.backend);if(l.length===2){try{const u=l(e,r);u&&typeof u.then=="function"?u.then(d=>s(null,d)).catch(s):s(null,u)}catch(u){s(u)}return}return l(e,r,s)}prepareLoading(e,r,n={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();vn(e)&&(e=this.languageUtils.toResolveHierarchy(e)),vn(r)&&(r=[r]);const a=this.queueLoad(e,r,n,i);if(!a.toLoad.length)return a.pending.length||i(),null;a.toLoad.forEach(o=>{this.loadOne(o)})}load(e,r,n){this.prepareLoading(e,r,{},n)}reload(e,r,n){this.prepareLoading(e,r,{reload:!0},n)}loadOne(e,r=""){const n=e.split("|"),i=n[0],a=n[1];this.read(i,a,"read",void 0,void 0,(o,s)=>{o&&this.logger.warn(`${r}loading namespace ${a} for language ${i} failed`,o),!o&&s&&this.logger.log(`${r}loaded namespace ${a} for language ${i}`,s),this.loaded(e,o,s)})}saveMissing(e,r,n,i,a,o={},s=()=>{}){var l,u,d,h,f;if((u=(l=this.services)==null?void 0:l.utils)!=null&&u.hasLoadedNamespace&&!((h=(d=this.services)==null?void 0:d.utils)!=null&&h.hasLoadedNamespace(r))){this.logger.warn(`did not save key "${n}" as the namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if((f=this.backend)!=null&&f.create){const p={...o,isUpdate:a},g=this.backend.create.bind(this.backend);if(g.length<6)try{let m;g.length===5?m=g(e,r,n,i,p):m=g(e,r,n,i),m&&typeof m.then=="function"?m.then(v=>s(null,v)).catch(s):s(null,m)}catch(m){s(m)}else g(e,r,n,i,s,p)}!e||!e[0]||this.store.addResource(e[0],r,n,i)}}}const lle=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),vn(t[1])&&(e.defaultValue=t[1]),vn(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const r=t[3]||t[2];Object.keys(r).forEach(n=>{e[n]=r[n]})}return e},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Sje=t=>(vn(t.ns)&&(t.ns=[t.ns]),vn(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),vn(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&!t.supportedLngs.includes("cimode")&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t),aG=()=>{},chr=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(r=>{typeof t[r]=="function"&&(t[r]=t[r].bind(t))})};class M6 extends nG{constructor(e={},r){if(super(),this.options=Sje(e),this.services={},this.logger=mm,this.modules={external:[]},chr(this),r&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,r),this;setTimeout(()=>{this.init(e,r)},0)}}init(e={},r){this.isInitializing=!0,typeof e=="function"&&(r=e,e={}),e.defaultNS==null&&e.ns&&(vn(e.ns)?e.defaultNS=e.ns:e.ns.includes("translation")||(e.defaultNS=e.ns[0]));const n=lle();this.options={...n,...this.options,...Sje(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler);const i=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?mm.init(i(this.modules.logger),this.options):mm.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=ohr;const d=new mje(this.options);this.store=new fje(this.options.resources,this.options);const h=this.services;h.logger=mm,h.resourceStore=this.store,h.languageUtils=d,h.pluralResolver=new nhr(d,{prepend:this.options.pluralSeparator}),u&&(h.formatter=i(u),h.formatter.init&&h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new wje(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new lhr(i(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",(f,...p)=>{this.emit(f,...p)}),this.modules.languageDetector&&(h.languageDetector=i(this.modules.languageDetector),h.languageDetector.init&&h.languageDetector.init(h,this.options.detection,this.options)),this.modules.i18nFormat&&(h.i18nFormat=i(this.modules.i18nFormat),h.i18nFormat.init&&h.i18nFormat.init(this)),this.translator=new iG(this.services,this.options),this.translator.on("*",(f,...p)=>{this.emit(f,...p)}),this.modules.external.forEach(f=>{f.init&&f.init(this)})}if(this.format=this.options.interpolation.format,r||(r=aG),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=(...d)=>this.store[u](...d)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...d)=>(this.store[u](...d),this)});const s=R6(),l=()=>{const u=(d,h)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),s.resolve(h),r(d,h)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),s}loadResources(e,r=aG){var a,o;let n=r;const i=vn(e)?e:this.language;if(typeof e=="function"&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if((i==null?void 0:i.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const s=[],l=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(h=>{h!=="cimode"&&(s.includes(h)||s.push(h))})};i?l(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>l(d)),(o=(a=this.options.preload)==null?void 0:a.forEach)==null||o.call(a,u=>l(u)),this.services.backendConnector.load(s,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(u)})}else n(null)}reloadResources(e,r,n){const i=R6();return typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r=void 0),e||(e=this.languages),r||(r=this.options.ns),n||(n=aG),this.services.backendConnector.reload(e,r,a=>{i.resolve(),n(a)}),i}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&pje.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!["cimode","dev"].includes(e)){for(let r=0;r{this.language=s,this.languages=this.services.languageUtils.toResolveHierarchy(s),this.resolvedLanguage=void 0,this.setResolvedLanguage(s)},a=(s,l)=>{l?this.isLanguageChangingTo===e&&(i(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,n.resolve((...u)=>this.t(...u)),r&&r(s,(...u)=>this.t(...u))},o=s=>{var d,h;!e&&!s&&this.services.languageDetector&&(s=[]);const l=vn(s)?s:s&&s[0],u=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(vn(s)?[s]:s);u&&(this.language||i(u),this.translator.language||this.translator.changeLanguage(u),(h=(d=this.services.languageDetector)==null?void 0:d.cacheUserLanguage)==null||h.call(d,u)),this.loadResources(u,f=>{a(f,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e),n}getFixedT(e,r,n,i){const a=i==null?void 0:i.scopeNs,o=(s,l,...u)=>{let d;typeof l!="object"?d=this.options.overloadTranslationOptionHandler([s,l].concat(u)):d={...l},d.lng=d.lng||o.lng,d.lngs=d.lngs||o.lngs;const h=d.ns!==void 0&&d.ns!==null;d.ns=d.ns||o.ns,d.keyPrefix!==""&&(d.keyPrefix=d.keyPrefix||n||o.keyPrefix);const f={...this.options,...d};Array.isArray(a)&&!h&&(f.ns=a),typeof d.keyPrefix=="function"&&(d.keyPrefix=bA(d.keyPrefix,f));const p=this.options.keySeparator||".";let g;return d.keyPrefix&&Array.isArray(s)?g=s.map(m=>(typeof m=="function"&&(m=bA(m,f)),`${d.keyPrefix}${p}${m}`)):(typeof s=="function"&&(s=bA(s,f)),g=d.keyPrefix?`${d.keyPrefix}${p}${s}`:s),this.t(g,d)};return vn(e)?o.lng=e:o.lngs=e,o.ns=r,o.keyPrefix=n,o}t(...e){var r;return(r=this.translator)==null?void 0:r.translate(...e)}exists(...e){var r;return(r=this.translator)==null?void 0:r.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,r={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=r.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const o=(s,l)=>{const u=this.services.backendConnector.state[`${s}|${l}`];return u===-1||u===0||u===2};if(r.precheck){const s=r.precheck(this,o);if(s!==void 0)return s}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(n,e)&&(!i||o(a,e)))}loadNamespaces(e,r){const n=R6();return this.options.ns?(vn(e)&&(e=[e]),e.forEach(i=>{this.options.ns.includes(i)||this.options.ns.push(i)}),this.loadResources(i=>{n.resolve(),r&&r(i)}),n):(r&&r(),Promise.resolve())}loadLanguages(e,r){const n=R6();vn(e)&&(e=[e]);const i=this.options.preload||[],a=e.filter(o=>!i.includes(o)&&this.services.languageUtils.isSupportedCode(o));return a.length?(this.options.preload=i.concat(a),this.loadResources(o=>{n.resolve(),r&&r(o)}),n):(r&&r(),Promise.resolve())}dir(e){var i,a;if(e||(e=this.resolvedLanguage||(((i=this.languages)==null?void 0:i.length)>0?this.languages[0]:this.language)),!e)return"rtl";try{const o=new Intl.Locale(e);if(o&&o.getTextInfo){const s=o.getTextInfo();if(s&&s.direction)return s.direction}}catch{}const r=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=((a=this.services)==null?void 0:a.languageUtils)||new mje(lle());return e.toLowerCase().indexOf("-latn")>1?"ltr":r.includes(n.getLanguagePartFromCode(e))||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},r){const n=new M6(e,r);return n.createInstance=M6.createInstance,n}cloneInstance(e={},r=aG){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},a=new M6(i);if((e.debug!==void 0||e.prefix!==void 0)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(s=>{a[s]=this[s]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},n){const s=Object.keys(this.store.data).reduce((l,u)=>(l[u]={...this.store.data[u]},l[u]=Object.keys(l[u]).reduce((d,h)=>(d[h]={...l[u][h]},d),l[u]),l),{});a.store=new fje(s,i),a.services.resourceStore=a.store}if(e.interpolation){const l={...lle().interpolation,...this.options.interpolation,...e.interpolation},u={...i,interpolation:l};a.services.interpolator=new wje(u)}return a.translator=new iG(a.services,i),a.translator.on("*",(s,...l)=>{a.emit(s,...l)}),a.init(i,r),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Su=M6.createInstance();Su.createInstance,Su.dir,Su.init,Su.loadResources,Su.reloadResources,Su.use,Su.changeLanguage,Su.getFixedT,Su.t,Su.exists,Su.setDefaultNamespace,Su.hasLoadedNamespace,Su.loadNamespaces,Su.loadLanguages;const uhr={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,"!doctype":!0,"!DOCTYPE":!0},dhr=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?("[^"]*"|'[^']*')/g;function Tje(t){const e={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},r=t.match(/<\/?([^\s]+?)[/\s>]/);if(r&&(e.name=r[1],(uhr[r[1]]||t.charAt(t.length-2)==="/")&&(e.voidElement=!0),e.name.startsWith("!--"))){const a=t.indexOf("-->");return{type:"comment",comment:a!==-1?t.slice(4,a):""}}const n=new RegExp(dhr);let i=null;for(;i=n.exec(t),i!==null;)if(i[0].trim())if(i[1]){const a=i[1].trim();let o=[a,null];const s=a.indexOf("=");s>-1&&(o=[a.slice(0,s),a.slice(s+1)]),e.attrs[o[0]]=o[1],n.lastIndex--}else i[2]&&(e.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return e}const oG=/|<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,hhr=/<\/?([^\s]+?)[/\s>]/,fhr=/^\s*$/,phr=/^(script|style)$/i,I6="\0",ghr=Object.create(null);function Cje(t){t.forEach(function(e){if(e.type==="text"){e.content=e.content.split(I6).join("<");return}if(e.type==="comment"){e.comment=e.comment.split(I6).join("<");return}for(const r in e.attrs){const n=e.attrs[r];typeof n=="string"&&n.indexOf(I6)>-1&&(e.attrs[r]=n.split(I6).join("<"))}e.children.length&&Cje(e.children)})}function mhr(t,e){const r=e&&e.components||ghr,n=e&&e.allowedTags;let i=!1;if(n){const g=typeof n=="function"?n:function(b){return n.indexOf(b)>-1};let m="",v=0;oG.lastIndex=0;let y;for(;y=oG.exec(t);){const b=y[0];m+=t.slice(v,y.index);const x=b.match(hhr);b.startsWith("",t}}function yhr(t){return t.reduce(function(e,r){return e+kje("",r)},"")}var bhr={parse:mhr,stringify:yhr};const sG=(t,e,r,n)=>{var a,o,s,l;const i=[r,{code:e,...n||{}}];if((o=(a=t==null?void 0:t.services)==null?void 0:a.logger)!=null&&o.forward)return t.services.logger.forward(i,"warn","react-i18next::",!0);Rd(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),(l=(s=t==null?void 0:t.services)==null?void 0:s.logger)!=null&&l.warn?t.services.logger.warn(...i):console!=null&&console.warn&&console.warn(...i)},Oje={},wE=(t,e,r,n)=>{Rd(r)&&Oje[r]||(Rd(r)&&(Oje[r]=new Date),sG(t,e,r,n))},Eje=(t,e)=>()=>{if(t.isInitialized)e();else{const r=()=>{setTimeout(()=>{t.off("initialized",r)},0),e()};t.on("initialized",r)}},cle=(t,e,r)=>{t.loadNamespaces(e,Eje(t,r))},_je=(t,e,r,n)=>{if(Rd(r)&&(r=[r]),t.options.preload&&t.options.preload.indexOf(e)>-1)return cle(t,r,n);r.forEach(i=>{t.options.ns.indexOf(i)<0&&t.options.ns.push(i)}),t.loadLanguages(e,Eje(t,n))},xhr=(t,e,r={})=>!e.languages||!e.languages.length?(wE(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(t,{lng:r.lng,precheck:(n,i)=>{if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&n.services.backendConnector.backend&&n.isLanguageChangingTo&&!i(n.isLanguageChangingTo,t))return!1}}),Rd=t=>typeof t=="string",jv=t=>typeof t=="object"&&t!==null,whr=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Ahr={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},Shr=t=>Ahr[t],Rje=t=>t.replace(whr,Shr);let ule={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Rje,transDefaultProps:void 0};const Thr=(t={})=>{ule={...ule,...t}},dle=()=>ule;let Dje;const Chr=t=>{Dje=t},hle=()=>Dje,lG=(t,e)=>{var n;if(!t)return!1;const r=((n=t.props)==null?void 0:n.children)??t.children;return e?r.length>0:!!r},P6=t=>{var r,n;if(!t)return[];const e=((r=t.props)==null?void 0:r.children)??t.children;return(n=t.props)!=null&&n.i18nIsDynamicList?nx(e):e},khr=t=>Array.isArray(t)&&t.every(Y.isValidElement),nx=t=>Array.isArray(t)?t:[t],Ohr=(t,e)=>{const r={...e};return r.props={...e.props,...t.props},r},Ehr=t=>{const e={};if(!t)return e;const r=n=>{nx(n).forEach(a=>{Rd(a)||(lG(a)?r(P6(a)):jv(a)&&!Y.isValidElement(a)&&Object.assign(e,a))})};return r(t),e},fle=(t,e,r,n)=>{if(!t)return"";let i="";const a=nx(t),o=e!=null&&e.transSupportBasicHtmlNodes?e.transKeepBasicHtmlNodesFor??[]:[];return a.forEach((s,l)=>{if(Rd(s)){i+=`${s}`;return}if(Y.isValidElement(s)){const{props:u,type:d}=s,h=Object.keys(u).length,f=o.indexOf(d)>-1,p=u.children;if(!p&&f&&!h){i+=`<${d}/>`;return}if(!p&&(!f||h)||u.i18nIsDynamicList){i+=`<${l}>`;return}if(f&&h<=1){const m=Rd(p)?p:fle(p,e,r,n);i+=`<${d}>${m}`;return}const g=fle(p,e,r,n);i+=`<${l}>${g}`;return}if(s===null){sG(r,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:n});return}if(jv(s)){const{format:u,...d}=s,h=Object.keys(d);if(h.length===1){const f=u?`${h[0]}, ${u}`:h[0];i+=`{{${f}}}`;return}sG(r,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:n,child:s});return}sG(r,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:n,child:s})}),i},_hr=(t,e,r,n,i,a,o)=>{if(r==="")return[];const s=i.transKeepBasicHtmlNodesFor||[],l=r&&new RegExp(s.map(x=>`<${x}`).join("|")).test(r);if(!t&&!e&&!l&&!o)return[r];const u=e??{},d=x=>{nx(x).forEach(A=>{Rd(A)||(lG(A)?d(P6(A)):jv(A)&&!Y.isValidElement(A)&&Object.assign(u,A))})};d(t);const h=Object.keys(u),f=x=>/^\d+$/.test(x)||s.indexOf(x)>-1||h.indexOf(x)>-1,p=bhr.parse(`<0>${r}`,{allowedTags:f}),g={...u,...a},m=(x,w,A)=>{var C;const S=P6(x),T=y(S,w.children,A);return khr(S)&&T.length===0||(C=x.props)!=null&&C.i18nIsDynamicList?S:T},v=(x,w,A,S,T)=>{x.dummy?(x.children=w,A.push(Y.cloneElement(x,{key:S},T?void 0:w))):A.push(...Y.Children.map([x],C=>{var E;if(C.type===Y.Fragment||((E=C.props)==null?void 0:E.i18nIsDynamicList)!==void 0){const _={key:S};return C&&C.props&&Object.keys(C.props).forEach(P=>{P==="children"||P==="i18nIsDynamicList"||(_[P]=C.props[P])}),Y.createElement(C.type,_,T?null:w)}const O={key:S};return C&&C.props&&Object.keys(C.props).forEach(_=>{_==="ref"||_==="children"||(O[_]=C.props[_])}),Y.cloneElement(C,O,T?null:w)}))},y=(x,w,A)=>{const S=nx(x),T=nx(w),C={};return T.reduce((O,E,_)=>{var L,R;const P=((R=(L=E.children)==null?void 0:L[0])==null?void 0:R.content)&&n.services.interpolator.interpolate(E.children[0].content,g,n.language);if(E.type==="tag"){let D=S[parseInt(E.name,10)];!D&&e&&(D=e[E.name]),A.length===1&&!D&&(D=A[0][E.name]),D||(D={});const M={...E.attrs};o&&Object.keys(M).forEach(z=>{const U=M[z];Rd(U)&&(M[z]=Rje(U))});const I=Object.keys(M).length!==0?Ohr({props:M},D):D,N=Y.isValidElement(I),F=N&&lG(E,!0)&&!E.voidElement,B=l&&jv(I)&&I.dummy&&!N,V=jv(e)&&Object.hasOwnProperty.call(e,E.name);if(Rd(I)){const z=n.services.interpolator.interpolate(I,g,n.language);O.push(z)}else if(lG(I)||F){const z=m(I,E,A);v(I,z,O,_)}else if(B){const z=y(S,E.children,A);v(I,z,O,_)}else if(Number.isNaN(parseFloat(E.name)))if(V){const z=m(I,E,A);v(I,z,O,_,E.voidElement)}else if(i.transSupportBasicHtmlNodes&&s.indexOf(E.name)>-1)if(E.voidElement)O.push(Y.createElement(E.name,{key:`${E.name}-${_}`}));else{const z=C[E.name]||0;C[E.name]=z+1;let U,G=0;for(let q=0;q`);else{const z=y(S,E.children,A);O.push(`<${E.name}>${z}`)}else if(jv(I)&&!N){const z=E.children[0]?P:null;z&&O.push(z)}else v(I,P,O,_,E.children.length!==1||!P)}else if(E.type==="text"){const D=i.transWrapTextNodes,M=typeof i.unescape=="function"?i.unescape:dle().unescape,I=o?M(n.services.interpolator.interpolate(E.content,g,n.language)):n.services.interpolator.interpolate(E.content,g,n.language);D?O.push(Y.createElement(D,{key:`${E.name}-${_}`},I)):O.push(I)}return O},[])},b=y([{dummy:!0,children:t||[]}],p,nx(t||[]));return P6(b[0])},Lje=(t,e,r)=>{const n=t.key||e,i=Y.cloneElement(t,{key:n});if(!i.props||!i.props.children||r.indexOf(`${e}/>`)<0&&r.indexOf(`${e} />`)<0)return i;function a(){return Y.createElement(Y.Fragment,null,i)}return Y.createElement(a,{key:n})},Rhr=(t,e)=>t.map((r,n)=>Lje(r,n,e)),Dhr=(t,e)=>{const r={};return Object.keys(t).forEach(n=>{Object.assign(r,{[n]:Lje(t[n],n,e)})}),r},Lhr=(t,e,r,n)=>t?Array.isArray(t)?Rhr(t,e):jv(t)?Dhr(t,e):(wE(r,"TRANS_INVALID_COMPONENTS",' "components" prop expects an object or array',{i18nKey:n}),null):null,Mhr=t=>!jv(t)||Array.isArray(t)?!1:Object.keys(t).reduce((e,r)=>e&&Number.isNaN(Number.parseFloat(r)),!0);function Ihr({children:t,count:e,parent:r,i18nKey:n,context:i,tOptions:a={},values:o,defaults:s,components:l,ns:u,i18n:d,t:h,shouldUnescape:f,...p}){var B,V,z,U,G,H;const g=d||hle();if(!g)return wE(g,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.",{i18nKey:n}),t;const m=h||g.t.bind(g)||(j=>j),v={...dle(),...(B=g.options)==null?void 0:B.react};let y=u||m.ns||((V=g.options)==null?void 0:V.defaultNS);y=Rd(y)?[y]:y||["translation"];const{transDefaultProps:b}=v,x=b!=null&&b.tOptions?{...b.tOptions,...a}:a,w=f??(b==null?void 0:b.shouldUnescape),A=b!=null&&b.values?{...b.values,...o}:o,S=b!=null&&b.components?{...b.components,...l}:l,T=fle(t,v,g,n),C=s||(x==null?void 0:x.defaultValue)||T||v.transEmptyNodeValue||(typeof n=="function"?bA(n):n),{hashTransKey:O}=v,E=n||(O?O(T||C):T||C);(U=(z=g.options)==null?void 0:z.interpolation)!=null&&U.defaultVariables?o=A&&Object.keys(A).length>0?{...A,...g.options.interpolation.defaultVariables}:{...g.options.interpolation.defaultVariables}:o=A;const _=Ehr(t);_&&typeof _.count=="number"&&e===void 0&&(e=_.count);const P=o||e!==void 0&&!((H=(G=g.options)==null?void 0:G.interpolation)!=null&&H.alwaysFormat)||!t?x.interpolation:{interpolation:{...x.interpolation,prefix:"#$?",suffix:"?$#"}},L={...x,context:i||x.context,count:e,...o,...P,defaultValue:C,ns:y};let R=E?m(E,L):C;R===E&&C&&(R=C);const D=Lhr(S,R,g,n);let M=D||t,I=null;Mhr(D)&&(I=D,M=t);const N=_hr(M,I,R,g,v,L,w),F=r??v.defaultTransParent;return F?Y.createElement(F,p,N):N}const Phr={type:"3rdParty",init(t){Thr(t.options.react),Chr(t)}},Mje=Y.createContext();class Nhr{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function cG({children:t,count:e,parent:r,i18nKey:n,context:i,tOptions:a={},values:o,defaults:s,components:l,ns:u,i18n:d,t:h,shouldUnescape:f,...p}){var b;const{i18n:g,defaultNS:m}=Y.useContext(Mje)||{},v=d||g||hle(),y=h||(v==null?void 0:v.t.bind(v));return Ihr({children:t,count:e,parent:r,i18nKey:n,context:i,tOptions:a,values:o,defaults:s,components:l,ns:u||(y==null?void 0:y.ns)||m||((b=v==null?void 0:v.options)==null?void 0:b.defaultNS),i18n:v,t:h,shouldUnescape:f,...p})}var Ije={exports:{}},Pje={};/** * @license React * use-sync-external-store-shim.production.js From f7576c4080da6230e263eac20ab5d32644405ed5 Mon Sep 17 00:00:00 2001 From: "zhangmengqiu.zmq" Date: Sat, 10 Oct 2026 00:52:03 +0800 Subject: [PATCH 2/5] fix(studio): complete upstream MPA details integration --- frontend/README.md | 4 + frontend/package.json | 2 +- frontend/src/ui/AgentWorkspace.tsx | 29 +- frontend/tests/agentWorkspace.test.mjs | 11 +- frontend/tests/mpaBasicDetails.test.tsx | 60 +++ frontend/tests/runtimeAgentIdentity.test.mjs | 2 +- .../2026-10-10-complete-fork-increments.md | 66 +++ .../2026-10-10-complete-fork-increments.zh.md | 66 +++ .../2026-10-09-basic-only.md | 33 ++ .../2026-10-09-basic-only.zh.md | 33 ++ specs/studio-mpa-control-plane/README.md | 4 + specs/studio-mpa-control-plane/README.zh.md | 4 + .../{index-8JtvDNuA.js => index-jtZg_8XU.js} | 436 +++++++++--------- ...Dvmt5gm9.js => CodeDiffEditor-D2VDIxmZ.js} | 2 +- ...5MIo.js => FileExplorerEditor-Cx6O_APa.js} | 2 +- ...5P.js => MarkdownPromptEditor-Di8dSDc3.js} | 2 +- ....js => QuickAgentCreateDialog-BoukSlN9.js} | 2 +- .../{arc-B85TaV_o.js => arc-Dh1q-Cov.js} | 2 +- ...hannel-B1gj3-V8.js => channel-n7jAGeRv.js} | 2 +- ...ex.es-DpcOlkkW.js => index.es-B2y5CdTP.js} | 2 +- ...n-DVclzE4e.js => jspdf.es.min-DBgeOZkt.js} | 6 +- ...{linear-WTltCzEJ.js => linear-CmKnLfjh.js} | 2 +- ...R1.js => abnfDiagram-N423BO3Z-VjeGAIpP.js} | 2 +- ... architectureDiagram-T3A2C74G-CJxmnYsE.js} | 2 +- ...D.js => blockDiagram-VBNYF7ZC-C52T76KA.js} | 2 +- ...8vq6.js => c4Diagram-5PPSVZJV-hZ7YUgte.js} | 2 +- ...BNT0kar4.js => chunk-2GRJ4B5K-CZ3iGqBw.js} | 2 +- ...BK3jpFNd.js => chunk-2Q5K7J3B-CfoLV4Wi.js} | 2 +- ...Ln4IekMd.js => chunk-5RXB4S5H-DuY5TvDd.js} | 2 +- ...BKHSrXIw.js => chunk-5VM5RSS4-50_HOHQj.js} | 2 +- ...N9gzANAs.js => chunk-6Q2QTUOP-ClReq2Qj.js} | 2 +- ...IG64zwph.js => chunk-GF5L2VYU-D2O4F1UQ.js} | 2 +- ...DVlhplzu.js => chunk-JWPE2WC7-CuSd-btN.js} | 2 +- ...C0rklDe7.js => chunk-KBJHAD2P-BHhhNQ3Y.js} | 2 +- ...C3ekePUg.js => chunk-RYQCIY6F-Xs0pM-1G.js} | 2 +- ...BdI3VXTi.js => chunk-XXDRQBXY-BGNj7SfA.js} | 2 +- .../mermaid/classDiagram-JCYQIIEL-DbiEGGzY.js | 1 + .../mermaid/classDiagram-JCYQIIEL-DcvvubKo.js | 1 - .../classDiagram-v2-OCEON4UE-DbiEGGzY.js | 1 + .../classDiagram-v2-OCEON4UE-DcvvubKo.js | 1 - ...W.js => cose-bilkent-JH36ORCC-Drvrc5vX.js} | 2 +- ...P1Kvyc.js => cynefin-OW5HDTMX-cToHetdH.js} | 2 +- ...js => cynefinDiagram-MW4NZA55-BoSvLTRo.js} | 2 +- ...PibdEig-.js => dagre-VZM6K2ZE-DhyY5n-H.js} | 2 +- ...djCR_8.js => diagram-7IWD3JNH-BOsmJiOn.js} | 2 +- ...MxecTz.js => diagram-B4RE2ZJO-BfTx9QJi.js} | 2 +- ...5KJAJ0.js => diagram-LBJQPF4R-Ducr0gHH.js} | 2 +- ...L6LnT_.js => diagram-Q27KOJAE-XsikG6c2.js} | 2 +- ...jZ4Axz.js => diagram-UB23O5K3-Drp248Pc.js} | 2 +- ...lm.js => ebnfDiagram-BXEA7PRR-DWq2vZJk.js} | 2 +- ...t1Ec.js => erDiagram-JOGREHBK-DFz9aMkY.js} | 2 +- ...xh.js => flowDiagram-UKHOOZJN-DP4Qo4Vz.js} | 2 +- ...U.js => ganttDiagram-PKOTCBZU-F09GqxyE.js} | 2 +- ...s => gitGraphDiagram-DS77QQ5N-CUBmjt-p.js} | 2 +- ...yX.js => infoDiagram-6WML65LV-qWBimhS4.js} | 2 +- ...s => ishikawaDiagram-WSZJBQD7-CrZ4cgvz.js} | 2 +- ...js => journeyDiagram-NVQOT4AX-MW2hy2ZU.js} | 2 +- ...=> kanban-definition-27J2QSJJ-CyCq3slw.js} | 2 +- ...e-DAx4nvmm.js => mermaid.core-Vsbm7qIM.js} | 8 +- ...> mindmap-definition-FAOFIHXS-CfaFJV2O.js} | 2 +- ...juU.js => pegDiagram-VL7TDLO6-hA9oZ-ba.js} | 2 +- ...rtm.js => pieDiagram-7S7Q4E2Y-wYtjUBCA.js} | 2 +- ...s => quadrantDiagram-CIZ2JOQS--OyFExdO.js} | 2 +- ...s => railroadDiagram-AXF67PYL-C_-pSdka.js} | 2 +- ...> requirementDiagram-LRYGKXZP-BC5x5XNG.js} | 2 +- ....js => sankeyDiagram-W5VNT64P-Cc3BdkXH.js} | 2 +- ...s => sequenceDiagram-SI44F4Z6-DMLFvnQy.js} | 2 +- ...kQ.js => sizeCapture-X5ZJPWSS-BG8F8bAr.js} | 2 +- ...C.js => stateDiagram-OKZ733FA-Du5x3Nhv.js} | 2 +- .../stateDiagram-v2-UEYNNEHI-DfMjOWWe.js | 1 + .../stateDiagram-v2-UEYNNEHI-QJ3-Svac.js | 1 - ...1dR6.js => swimlanes-SLNWSIFB-DLoWQxfk.js} | 4 +- .../swimlanesDiagram-ULZ7WXOC-COw-LLw5.js | 8 - .../swimlanesDiagram-ULZ7WXOC-D3cnA72s.js | 8 + ... timeline-definition-Z64GVDOM-MB1o13Ec.js} | 2 +- ...QK.js => vennDiagram-T6HMQDX7-BzhIpzpK.js} | 2 +- ...js => wardleyDiagram-T6FBY63Y-CJYIwFNe.js} | 2 +- ...js => xychartDiagram-ELKLHX3M-CvqRo8G_.js} | 2 +- veadk/webui/index.html | 2 +- 79 files changed, 584 insertions(+), 316 deletions(-) create mode 100644 frontend/tests/mpaBasicDetails.test.tsx create mode 100644 prd-spec/bugfixes/mpa-upstream-incremental-alignment/2026-10-10-complete-fork-increments.md create mode 100644 prd-spec/bugfixes/mpa-upstream-incremental-alignment/2026-10-10-complete-fork-increments.zh.md create mode 100644 prd-spec/features/studio-mpa-basic-only/2026-10-09-basic-only.md create mode 100644 prd-spec/features/studio-mpa-basic-only/2026-10-09-basic-only.zh.md rename veadk/webui/assets/app/{index-8JtvDNuA.js => index-jtZg_8XU.js} (81%) rename veadk/webui/assets/chunks/{CodeDiffEditor-Dvmt5gm9.js => CodeDiffEditor-D2VDIxmZ.js} (99%) rename veadk/webui/assets/chunks/{FileExplorerEditor-KCeE5MIo.js => FileExplorerEditor-Cx6O_APa.js} (96%) rename veadk/webui/assets/chunks/{MarkdownPromptEditor-C8Q2sj5P.js => MarkdownPromptEditor-Di8dSDc3.js} (99%) rename veadk/webui/assets/chunks/{QuickAgentCreateDialog-_TpoDPFW.js => QuickAgentCreateDialog-BoukSlN9.js} (97%) rename veadk/webui/assets/chunks/{arc-B85TaV_o.js => arc-Dh1q-Cov.js} (98%) rename veadk/webui/assets/chunks/{channel-B1gj3-V8.js => channel-n7jAGeRv.js} (53%) rename veadk/webui/assets/chunks/{index.es-DpcOlkkW.js => index.es-B2y5CdTP.js} (99%) rename veadk/webui/assets/chunks/{jspdf.es.min-DVclzE4e.js => jspdf.es.min-DBgeOZkt.js} (99%) rename veadk/webui/assets/chunks/{linear-WTltCzEJ.js => linear-CmKnLfjh.js} (98%) rename veadk/webui/assets/visualizations/mermaid/{abnfDiagram-N423BO3Z-CQmvc3R1.js => abnfDiagram-N423BO3Z-VjeGAIpP.js} (86%) rename veadk/webui/assets/visualizations/mermaid/{architectureDiagram-T3A2C74G-ysR-aM43.js => architectureDiagram-T3A2C74G-CJxmnYsE.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{blockDiagram-VBNYF7ZC-D4I7ydgD.js => blockDiagram-VBNYF7ZC-C52T76KA.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{c4Diagram-5PPSVZJV-CYvD8vq6.js => c4Diagram-5PPSVZJV-hZ7YUgte.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{chunk-2GRJ4B5K-BNT0kar4.js => chunk-2GRJ4B5K-CZ3iGqBw.js} (93%) rename veadk/webui/assets/visualizations/mermaid/{chunk-2Q5K7J3B-BK3jpFNd.js => chunk-2Q5K7J3B-CfoLV4Wi.js} (66%) rename veadk/webui/assets/visualizations/mermaid/{chunk-5RXB4S5H-Ln4IekMd.js => chunk-5RXB4S5H-DuY5TvDd.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{chunk-5VM5RSS4-BKHSrXIw.js => chunk-5VM5RSS4-50_HOHQj.js} (83%) rename veadk/webui/assets/visualizations/mermaid/{chunk-6Q2QTUOP-N9gzANAs.js => chunk-6Q2QTUOP-ClReq2Qj.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{chunk-GF5L2VYU-IG64zwph.js => chunk-GF5L2VYU-D2O4F1UQ.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{chunk-JWPE2WC7-DVlhplzu.js => chunk-JWPE2WC7-CuSd-btN.js} (78%) rename veadk/webui/assets/visualizations/mermaid/{chunk-KBJHAD2P-C0rklDe7.js => chunk-KBJHAD2P-BHhhNQ3Y.js} (87%) rename veadk/webui/assets/visualizations/mermaid/{chunk-RYQCIY6F-C3ekePUg.js => chunk-RYQCIY6F-Xs0pM-1G.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{chunk-XXDRQBXY-BdI3VXTi.js => chunk-XXDRQBXY-BGNj7SfA.js} (53%) create mode 100644 veadk/webui/assets/visualizations/mermaid/classDiagram-JCYQIIEL-DbiEGGzY.js delete mode 100644 veadk/webui/assets/visualizations/mermaid/classDiagram-JCYQIIEL-DcvvubKo.js create mode 100644 veadk/webui/assets/visualizations/mermaid/classDiagram-v2-OCEON4UE-DbiEGGzY.js delete mode 100644 veadk/webui/assets/visualizations/mermaid/classDiagram-v2-OCEON4UE-DcvvubKo.js rename veadk/webui/assets/visualizations/mermaid/{cose-bilkent-JH36ORCC-0QYD6FmW.js => cose-bilkent-JH36ORCC-Drvrc5vX.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{cynefin-OW5HDTMX-BHP1Kvyc.js => cynefin-OW5HDTMX-cToHetdH.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{cynefinDiagram-MW4NZA55-DfWTsCcM.js => cynefinDiagram-MW4NZA55-BoSvLTRo.js} (98%) rename veadk/webui/assets/visualizations/mermaid/{dagre-VZM6K2ZE-PibdEig-.js => dagre-VZM6K2ZE-DhyY5n-H.js} (97%) rename veadk/webui/assets/visualizations/mermaid/{diagram-7IWD3JNH-cddjCR_8.js => diagram-7IWD3JNH-BOsmJiOn.js} (96%) rename veadk/webui/assets/visualizations/mermaid/{diagram-B4RE2ZJO-CyMxecTz.js => diagram-B4RE2ZJO-BfTx9QJi.js} (97%) rename veadk/webui/assets/visualizations/mermaid/{diagram-LBJQPF4R-BE5KJAJ0.js => diagram-LBJQPF4R-Ducr0gHH.js} (94%) rename veadk/webui/assets/visualizations/mermaid/{diagram-Q27KOJAE-DiL6LnT_.js => diagram-Q27KOJAE-XsikG6c2.js} (98%) rename veadk/webui/assets/visualizations/mermaid/{diagram-UB23O5K3-AYjZ4Axz.js => diagram-UB23O5K3-Drp248Pc.js} (95%) rename veadk/webui/assets/visualizations/mermaid/{ebnfDiagram-BXEA7PRR-CX7MIWlm.js => ebnfDiagram-BXEA7PRR-DWq2vZJk.js} (87%) rename veadk/webui/assets/visualizations/mermaid/{erDiagram-JOGREHBK-54K1t1Ec.js => erDiagram-JOGREHBK-DFz9aMkY.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{flowDiagram-UKHOOZJN-DjW8-Nxh.js => flowDiagram-UKHOOZJN-DP4Qo4Vz.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{ganttDiagram-PKOTCBZU-DYJw_19U.js => ganttDiagram-PKOTCBZU-F09GqxyE.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{gitGraphDiagram-DS77QQ5N-CIVsYAyY.js => gitGraphDiagram-DS77QQ5N-CUBmjt-p.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{infoDiagram-6WML65LV-D6hoQeyX.js => infoDiagram-6WML65LV-qWBimhS4.js} (69%) rename veadk/webui/assets/visualizations/mermaid/{ishikawaDiagram-WSZJBQD7-Di5hDQFl.js => ishikawaDiagram-WSZJBQD7-CrZ4cgvz.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{journeyDiagram-NVQOT4AX-7MLSoqp5.js => journeyDiagram-NVQOT4AX-MW2hy2ZU.js} (98%) rename veadk/webui/assets/visualizations/mermaid/{kanban-definition-27J2QSJJ-L7GQgpCH.js => kanban-definition-27J2QSJJ-CyCq3slw.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{mermaid.core-DAx4nvmm.js => mermaid.core-Vsbm7qIM.js} (98%) rename veadk/webui/assets/visualizations/mermaid/{mindmap-definition-FAOFIHXS-CYwjbq4J.js => mindmap-definition-FAOFIHXS-CfaFJV2O.js} (98%) rename veadk/webui/assets/visualizations/mermaid/{pegDiagram-VL7TDLO6-DY_WljuU.js => pegDiagram-VL7TDLO6-hA9oZ-ba.js} (87%) rename veadk/webui/assets/visualizations/mermaid/{pieDiagram-7S7Q4E2Y-VRiU9rtm.js => pieDiagram-7S7Q4E2Y-wYtjUBCA.js} (96%) rename veadk/webui/assets/visualizations/mermaid/{quadrantDiagram-CIZ2JOQS-JooZIzGd.js => quadrantDiagram-CIZ2JOQS--OyFExdO.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{railroadDiagram-AXF67PYL-B0NVnjyw.js => railroadDiagram-AXF67PYL-C_-pSdka.js} (84%) rename veadk/webui/assets/visualizations/mermaid/{requirementDiagram-LRYGKXZP-CAxqjuVx.js => requirementDiagram-LRYGKXZP-BC5x5XNG.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{sankeyDiagram-W5VNT64P-BTjDTukV.js => sankeyDiagram-W5VNT64P-Cc3BdkXH.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{sequenceDiagram-SI44F4Z6-CRNvuVv8.js => sequenceDiagram-SI44F4Z6-DMLFvnQy.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{sizeCapture-X5ZJPWSS-CNj0yAkQ.js => sizeCapture-X5ZJPWSS-BG8F8bAr.js} (87%) rename veadk/webui/assets/visualizations/mermaid/{stateDiagram-OKZ733FA-BvoTa-1C.js => stateDiagram-OKZ733FA-Du5x3Nhv.js} (96%) create mode 100644 veadk/webui/assets/visualizations/mermaid/stateDiagram-v2-UEYNNEHI-DfMjOWWe.js delete mode 100644 veadk/webui/assets/visualizations/mermaid/stateDiagram-v2-UEYNNEHI-QJ3-Svac.js rename veadk/webui/assets/visualizations/mermaid/{swimlanes-SLNWSIFB-2I6D1dR6.js => swimlanes-SLNWSIFB-DLoWQxfk.js} (99%) delete mode 100644 veadk/webui/assets/visualizations/mermaid/swimlanesDiagram-ULZ7WXOC-COw-LLw5.js create mode 100644 veadk/webui/assets/visualizations/mermaid/swimlanesDiagram-ULZ7WXOC-D3cnA72s.js rename veadk/webui/assets/visualizations/mermaid/{timeline-definition-Z64GVDOM-mpZy5ZHk.js => timeline-definition-Z64GVDOM-MB1o13Ec.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{vennDiagram-T6HMQDX7-23c87AQK.js => vennDiagram-T6HMQDX7-BzhIpzpK.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{wardleyDiagram-T6FBY63Y-jNpCtSMU.js => wardleyDiagram-T6FBY63Y-CJYIwFNe.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{xychartDiagram-ELKLHX3M-B9DRjIoI.js => xychartDiagram-ELKLHX3M-CvqRo8G_.js} (99%) diff --git a/frontend/README.md b/frontend/README.md index 2196362ee..67d811ad3 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -1824,3 +1824,7 @@ MPA creation defaults to A2A discovery (`ENABLE_A2A=true`, `DISABLE_JWT_AUTH=fal MPA name validation highlights invalid input and its message in the theme danger color, offers a valid-name placeholder, and visibly disables Next until corrected. Shared Button disabled states are dimmed consistently; loading retains its own appearance. MPA 名称校验使用主题错误色显示非法输入及错误提示,并提供合法名称示例;名称修正前“下一步”明显置灰。共享 Button 的禁用态统一降低透明度,加载态保留原有外观。 + +MPA Agent details currently expose only Basic information. Other tabs and the Profile configuration action are hidden; this page does not query Profile status or submit Profile operations. General Agent pages and chat session protocols are unchanged. + +MPA 智能体详情当前仅显示基本信息。其他页面及 Profile 配置操作隐藏;本页不查询 Profile 状态或提交 Profile 操作。普通智能体页面与聊天会话协议保持不变。 diff --git a/frontend/package.json b/frontend/package.json index 42c468208..bfd7e83bf 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -8,7 +8,7 @@ "dev": "vite", "build": "node scripts/build.mjs", "test": "node --test tests/*.test.mjs && npm run test:mpa-agent-info", - "test:mpa-agent-info": "vitest run tests/mpaAgentInfoRail.test.tsx tests/skillDocumentEditor.test.tsx tests/mpaCreation.test.tsx", + "test:mpa-agent-info": "vitest run tests/mpaAgentInfoRail.test.tsx tests/skillDocumentEditor.test.tsx tests/mpaCreation.test.tsx tests/mpaBasicDetails.test.tsx", "check:i18n": "node scripts/check-i18n.mjs", "test:sandbox-download-coverage": "vitest run --coverage -c vitest.sandbox-download.config.ts", "test:mpa-cron-coverage": "vitest run --coverage -c vitest.mpa-cron.config.ts", diff --git a/frontend/src/ui/AgentWorkspace.tsx b/frontend/src/ui/AgentWorkspace.tsx index 5a2c8be13..4402860ef 100644 --- a/frontend/src/ui/AgentWorkspace.tsx +++ b/frontend/src/ui/AgentWorkspace.tsx @@ -1899,7 +1899,7 @@ export function AgentWorkspace({ }: AgentWorkspaceProps) { const { t, i18n } = useTranslation("ui"); const [view, setView] = useState("library"); - const [section, setSection] = useState("basic"); + const [requestedSection, setSection] = useState("basic"); const [activeAgentId, setActiveAgentId] = useState(""); const [activeDraftId, setActiveDraftId] = useState(""); const [runtimeDetail, setRuntimeDetail] = useState(null); @@ -2107,6 +2107,8 @@ export function AgentWorkspace({ selectedAgentInfo?.appName || selectedAgent?.runtimeApp || selectedAgent?.app || ""; const selectedAgentCategory: AgentCategory = selectedAgent?.agentCategory ?? "general"; + // MPA details expose only Basic, including restored/external focus. + const section = selectedAgentCategory === "mpa" ? "basic" : requestedSection; const runtimeDetailForSelectedAgent = runtimeDetail?.runtimeId === selectedAgent?.runtimeId ? runtimeDetail : null; @@ -2118,10 +2120,11 @@ export function AgentWorkspace({ selectedAgent?.runtimeId ?? ""; const visibleAgentSectionIds = AGENT_SECTIONS.filter((item) => { - if (item === "profileConfig") return selectedAgentCategory === "mpa"; + if (selectedAgentCategory === "mpa") return item === "basic"; + if (item === "profileConfig") return false; if (item === "usage") return canViewUsage && selectedAgent?.runtimeId; - if (item === "sessionConfig") return selectedAgentCategory === "mpa"; - if (item === "diagnostics") return selectedAgentCategory === "mpa" && selectedAgent?.runtimeId; + if (item === "sessionConfig") return false; + if (item === "diagnostics") return false; return true; }); const visibleAgentSections = visibleAgentSectionIds.map((id) => ({ @@ -2599,7 +2602,10 @@ export function AgentWorkspace({ const region = selectedAgent?.region ?? "cn-beijing"; const requestKey = mpaAgentViewRequestKey; setMpaAgentViewError(""); - if (selectedAgentCategory !== "mpa" || !runtimeId) { + if ( + selectedAgentCategory !== "mpa" || !runtimeId || + (section !== "profileConfig" && section !== "sessionConfig") + ) { setMpaAgentView(null); setMpaAgentViewLoading(false); return; @@ -2638,6 +2644,7 @@ export function AgentWorkspace({ }, [ detailReloadToken, mpaAgentViewRequestKey, + section, selectedMpaInstanceId, selectedAgent?.region, selectedAgent?.runtimeId, @@ -5258,7 +5265,7 @@ export function AgentWorkspace({ {t("agentWorkspace.chat")} )} - { - if (selectedAgentCategory === "mpa") { - setSection("profileConfig"); - return; - } if (selectedDraft) { onEditDraft?.(selectedDraft); return; @@ -5291,8 +5294,6 @@ export function AgentWorkspace({ /> {t("agentWorkspace.preparing")} - ) : selectedAgentCategory === "mpa" ? ( - t("agentWorkspace.profileConfig") ) : selectedDraft || selectedAgentUpdateDraft ? ( t("agentWorkspace.continueEditing") ) : ( @@ -5308,7 +5309,7 @@ export function AgentWorkspace({ {updateBlockedReason} )} - + } )} diff --git a/frontend/tests/agentWorkspace.test.mjs b/frontend/tests/agentWorkspace.test.mjs index ed326125b..f6a545b73 100644 --- a/frontend/tests/agentWorkspace.test.mjs +++ b/frontend/tests/agentWorkspace.test.mjs @@ -334,7 +334,7 @@ test("runtime-backed Agent details load and paginate usage without stale respons assert.match(clientSource, /adkT\("client\.checkStudioGateway"\)/); assert.match(workspaceSource, /if \(item === "usage"\) return canViewUsage && selectedAgent\?\.runtimeId/); - assert.match(workspaceSource, /if \(item === "sessionConfig"\) return selectedAgentCategory === "mpa"/); + assert.match(workspaceSource, /if \(item === "sessionConfig"\) return false/); assert.match(workspaceSource, /canViewUsage\?: boolean/); assert.match(workspaceSource, /section === "usage" && !canViewUsage[\s\S]*?setSection\("basic"\)/); assert.match(workspaceSource, /section !== "usage" \|\| !runtimeId/); @@ -402,12 +402,12 @@ test("MPA Agent detail consumes the dedicated MpaAgentView model", () => { ); }); -test("MPA Agent details expose Profile configuration as the Studio control entry", () => { +test("MPA Agent details retain hidden Profile implementation without a navigation entry", () => { assert.match(workspaceSource, /mpaProfileFromAgentDraft/); assert.match(workspaceSource, /startMpaAgentOperation/); assert.match(workspaceSource, /type MpaProfilePayload/); assert.match(workspaceSource, /function MpaProfileConfigPanel/); - assert.match(workspaceSource, /if \(item === "profileConfig"\) return selectedAgentCategory === "mpa"/); + assert.match(workspaceSource, /if \(item === "profileConfig"\) return false/); assert.match(workspaceSource, /const shouldLoadUpdateCapability = selectedAgentCategory !== "mpa"/); assert.match( workspaceSource, @@ -454,9 +454,6 @@ test("MPA Agent details expose Profile configuration as the Studio control entry assert.match(workspaceSource, /setSessionConfigReloadToken\(\(value\) => value \+ 1\)/); assert.match(workspaceSource, /section === "profileConfig" && \(/); assert.match(workspaceSource, / void applyMpaProfileFromStudio\(\)\}/); - assert.match(workspaceSource, /disabled=\{selectedAgentCategory === "mpa" \? false : Boolean\(updateBlockedReason\)\}/); - assert.match(workspaceSource, /if \(selectedAgentCategory === "mpa"\) \{[\s\S]*?setSection\("profileConfig"\)/); - assert.match(workspaceSource, /selectedAgentCategory === "mpa" \?\s*\(\s*t\("agentWorkspace\.profileConfig"\)\s*\)/); assert.match(workspaceStyles, /\.aw-profile-config \.aw-session-config-card/); assert.match(workspaceStyles, /\.aw-profile-config-list/); assert.equal(enUiCatalog.agentWorkspace.sections.profileConfig, "Profile configuration"); @@ -485,7 +482,7 @@ test("MPA diagnostics tab uses Runtime Console correlation instead of generic tr /\/api\/v1\/runtime-console\/admin\/runs\/\$\{encodeURIComponent\(params\.invocationId\)\}\/trace\?\$\{query\.toString\(\)\}/, ); assert.match(workspaceSource, /type AgentSection = "basic" \| "profileConfig" \| "sessionConfig" \| "usage" \| "diagnostics"/); - assert.match(workspaceSource, /if \(item === "diagnostics"\) return selectedAgentCategory === "mpa" && selectedAgent\?\.runtimeId/); + assert.match(workspaceSource, /if \(item === "diagnostics"\) return false/); assert.match(workspaceSource, /function MpaDiagnosticsPanel/); assert.match(workspaceSource, /getMpaRuntimeConsoleRuns\(\{/); assert.match(workspaceSource, /getMpaRuntimeConsoleTrace\(\{/); diff --git a/frontend/tests/mpaBasicDetails.test.tsx b/frontend/tests/mpaBasicDetails.test.tsx new file mode 100644 index 000000000..e74d34712 --- /dev/null +++ b/frontend/tests/mpaBasicDetails.test.tsx @@ -0,0 +1,60 @@ +// @vitest-environment jsdom +import React, { act } from "react"; +import { createRoot, type Root } from "react-dom/client"; +import { afterEach, beforeEach, expect, it, vi } from "vitest"; +import { AgentWorkspace, type AgentWorkspaceProps } from "../src/ui/AgentWorkspace"; +import * as api from "../src/adk/client"; + +vi.mock("../src/adk/client"); +vi.mock("../src/create/AgentBuildCanvas", () => ({ AgentBuildCanvas: () =>

execution-flow
})); +vi.mock("../src/ui/Markdown", () => ({ Markdown: () => null })); +const { t, i18n } = vi.hoisted(() => ({ t: (key: string) => key, i18n: { language: "en-US", resolvedLanguage: "en-US" } })); +vi.mock("react-i18next", async (importOriginal) => ({ ...(await importOriginal()), useTranslation: () => ({ t, i18n }) })); +let host: HTMLDivElement, root: Root; +const agent = { id: "mpa-one", app: "default", label: "MPA one", remote: true, agentCategory: "mpa" as const, runtimeId: "r-one", mpaInstanceId: "mi-one" }; +const info = { name: "MPA one", description: "Basic description", tools: [], subAgents: [], model: "test" }; +const base: AgentWorkspaceProps = { + agents: [agent], selectedAgentId: agent.id, focusedAgentId: agent.id, + agentInfo: info, agentInfoAgentId: agent.id, loadingAgentInfo: false, + canCreate: false, canUpdate: true, canViewUsage: true, detailOnly: true, + onSelectAgent: vi.fn(), onCreateAgent: vi.fn(), onUpdateAgent: vi.fn(), +}; +beforeEach(() => { + vi.stubGlobal("React", React); + vi.stubGlobal("IS_REACT_ACT_ENVIRONMENT", true); + vi.clearAllMocks(); + vi.mocked(api.getRuntimeAgentInfo).mockResolvedValue(info); + vi.mocked(api.getRuntimeDetail).mockResolvedValue({ runtimeId: "r-one", status: "Ready", networkTypes: ["public"], envs: [] } as never); + vi.mocked(api.getRuntimeUpdateCapability).mockResolvedValue({ canUpdate: false } as never); + // Any accidental Profile read must be observable, without introducing retries. + vi.mocked(api.getMpaAgentView).mockRejectedValue(new Error("Profile API must not be called")); + host = document.createElement("div"); document.body.append(host); root = createRoot(host); +}); +afterEach(async () => { await act(async () => root.unmount()); host.remove(); vi.unstubAllGlobals(); }); +async function render(props: Partial = {}) { + await act(async () => root.render()); +} +const hidden = ["profileConfig", "sessionConfig", "usage", "diagnostics", "evaluations", "optimizations", "integrations", "versions"] as const; +it.each(["basic", ...hidden] as const)("keeps MPA %s focus on basic without Profile requests", async (focusedAgentSection) => { + await render({ focusedAgentSection }); + expect(host.textContent).toContain("agentWorkspace.sections.basic"); + expect(host.textContent).toContain("execution-flow"); + for (const section of hidden) expect(host.textContent).not.toContain(`agentWorkspace.sections.${section}`); + expect(host.textContent).not.toContain("agentWorkspace.profileConfig"); + expect(host.textContent).not.toContain("agentWorkspace.mpaControlPlane"); + expect(api.getMpaAgentView).not.toHaveBeenCalled(); + expect(api.getMpaProfileStatus).not.toHaveBeenCalled(); + expect(api.startMpaAgentOperation).not.toHaveBeenCalled(); + expect(api.getMpaSessionExecutionConfig).not.toHaveBeenCalled(); +}); +it("preserves general navigation and suppresses stale sections when switching to MPA", async () => { + const general = { ...agent, id: "general", agentCategory: "general" as const }; + await render({ agents: [general], selectedAgentId: general.id, focusedAgentId: general.id, agentInfoAgentId: general.id }); + expect(host.textContent).toContain("agentWorkspace.sections.integrations"); + expect(host.textContent).toContain("agentWorkspace.sections.versions"); + await render({ focusedAgentSection: "sessionConfig" }); + expect(host.textContent).toContain("execution-flow"); + expect(host.textContent).not.toContain("agentWorkspace.sections.integrations"); + expect(api.getMpaAgentView).not.toHaveBeenCalled(); + expect(api.getMpaProfileStatus).not.toHaveBeenCalled(); +}); diff --git a/frontend/tests/runtimeAgentIdentity.test.mjs b/frontend/tests/runtimeAgentIdentity.test.mjs index d37b55eab..f05489cb9 100644 --- a/frontend/tests/runtimeAgentIdentity.test.mjs +++ b/frontend/tests/runtimeAgentIdentity.test.mjs @@ -611,7 +611,7 @@ test("Runtime update entry passes only cloud capability to the update handler", assert.ok(clickStart >= 0 && clickEnd > clickStart); const clickHandler = workspaceSource.slice(clickStart, clickEnd); - assert.match(clickHandler, /selectedAgentCategory === "mpa"[\s\S]*?setSection\("profileConfig"\)/); + assert.doesNotMatch(clickHandler, /setSection\("profileConfig"\)/); assert.match(clickHandler, /onUpdateAgent\(selectedUpdateCapability\)/); assert.doesNotMatch(clickHandler, /onUpdateAgent\(draft,/); assert.doesNotMatch(clickHandler, /selectedAgentUpdateDraft[\s\S]*?onEditDraft/); diff --git a/prd-spec/bugfixes/mpa-upstream-incremental-alignment/2026-10-10-complete-fork-increments.md b/prd-spec/bugfixes/mpa-upstream-incremental-alignment/2026-10-10-complete-fork-increments.md new file mode 100644 index 000000000..70ff0e993 --- /dev/null +++ b/prd-spec/bugfixes/mpa-upstream-incremental-alignment/2026-10-10-complete-fork-increments.md @@ -0,0 +1,66 @@ +# Complete fork MPA increments on official main + +- Change ID: `mpa-upstream-incremental-alignment`; date: 2026-10-10; status: implemented. +- [Chinese](2026-10-10-complete-fork-increments.zh.md). +- Contract: [Studio MPA control plane](../../../specs/studio-mpa-control-plane/README.md). + +## Background and evidence +The prior official contribution branch `feat/mpa-studio-upstream-alignment-20261009` ends at `033b2711`; official PR #1156 landed as `171d8d86`. Fork main `035387d1` has a different history. Official PR #1160 starts directly from `171d8d86` and already includes fork PR #23, but omits PR #22's Basic-only MPA details. Copying the entire fork tree would remove newer official Codex and other changes. + +The incremental audit uses the fork alignment merge `ef0ad519` through `035387d1`, compared with official base and contribution HEAD `80fd1e19`. This establishes feature coverage, rather than treating every historical commit as an unapplied change. + +| Fork change | Contribution treatment | +| --- | --- | +| PR #21: entered Runtime name, description, three-step creation, image defaults, name validation, TOS guidance | Already in official PR #1156; retain unchanged. | +| PR #22: Basic-only MPA details, synchronous focus normalization, no hidden Profile requests | Port production code, regression tests, documentation, and rebuild release assets. | +| PR #23: STS account resolution, IAM preparation and Python 3.10 timeout, network discovery/description/subnet order, standard APIG, independent worker creation/defaults/naming, skill-space description, deployment diagnostics | Already in #1160; retain unchanged and run affected regressions. | +| Lockfile restoration | Effective lockfile content already present on official main; retain. | +| Official secret-scan exclusions and cancellation PID race fix | Retain official implementation; fork lacks these contribution fixes. | +| Official BytePlus sidecar behavior and SDK features | Retain; differences from fork are not new fork increments. | + +## Goals, scenarios and requirements +FR-1 / AC-1: all effective fork increments since the previous contribution remain available in the official contribution; no blanket fork/main merge or reversed official changes. +FR-2 / AC-2: selecting an MPA, restoring any hidden section, or switching from a General agent renders Basic only before effects run, with no Agent View/Profile/session configuration requests or Profile operations. General navigation and update behavior remain. +FR-3 / AC-3: package tests, bilingual contracts and historical designs accompany source changes; generated web assets match the combined official source. +FR-4 / AC-4: preserve official secret scanning and cancellation fixes, and run the current repository gates with honest results. +Non-goals: backend API redesign, chat changes, cloud resource creation, deployment, merging the official PR, rewriting fork main, or closing another PR. + +## Design and affected files +Port the reviewed PR #22 patch to `frontend/src/ui/AgentWorkspace.tsx`; derive the effective section synchronously from category and requested section. Keep hidden control-plane implementations and their cleanup, gated by their owning sections. No new dependencies, data migration, authentication or concurrency contract changes. Update `frontend/tests/mpaBasicDetails.test.tsx`, source-contract tests and the package test command; append the Basic-only contract to both component spec languages and README while retaining official documentation. Import the historical Basic-only PRD pair; its dated cloud evidence is historical, not evidence of this integration. Rebuild `veadk/webui` from the combined tree. + +## Tasks and verification +T-1 (FR-1): audit all paths changed by `ef0ad519..035387d1`, excluding generated hashes and formatting-only historical document differences; account for each remaining difference. +T-2 (FR-2): run the imported component regression before porting production code, then port the patch and source-contract expectations. +T-3 (FR-3): frontend tests, build, i18n, asset references, component coverage and loopback browser checks using the actual component with mocked network boundaries. +T-4 (FR-4): targeted managed-creation/CLI tests, default two-worker Python regression, fetch/rebase official base, all-files pre-commit, and diff/document review before authorized commit/push. +Browser cases: MPA and General navigation, hidden focus, switching, normal/loading/empty/error Runtime information, read-only and narrow viewport, keyboard focus. New input/IME, mutation cancellation and retry are not applicable because this patch introduces no inputs or mutations; existing creation/sidecar regressions remain required. Live cloud writes are not run. + +## Risks and review +Risk: replacing whole files from fork could overwrite official enhancements. Resolution: only port the audited PR #22 behavior and use content comparisons for retained creation paths. Asset churn is required hashed build output, not additional hand-written functionality. +Direct design review performed because `review-spec` is unavailable: boundaries, effect ordering, cleanup, compatibility, security, tests and bilingual equivalence have no blockers. Referenced frontend design skills are absent locally; existing SPEC/Foundation rules and direct review apply. No visual redesign or new components are proposed. +Approval: the user's explicit 2026-10-10 request to compare the previous contribution and include all new main functionality approves this bounded integration; prior authorization to prepare/push the official PR remains applicable. + +## Delivery record +Checks below cover the integration diff above `80fd1e19`, with matching evidence in the Chinese counterpart. No current cloud verification is claimed. + +Verification record on 2026-10-10, integration diff over `80fd1e19`: +- **pass**: path audit: 83 non-generated paths in `ef0ad519..035387d1`; all effective new source/tests/contracts/designs match fork main. Exceptions: README preserves official documentation and adds bilingual guidance; `test_tasks.py` preserves the official PID race fix; four historical PRDs differ only in trailing whitespace. Official secret-scan exclusions, BytePlus behavior and Codex SDK files are retained. +- **pass**: regression first: `npm --prefix frontend exec -- vitest run --root frontend tests/mpaBasicDetails.test.tsx` failed all 10 cases before production port; after port, all 10 pass. +- **pass**: `npm --prefix frontend test`: 1,377 Node and 65 Vitest tests. +- **pass**: `npm --prefix frontend run build` (TypeScript plus app/widget builds); `npm --prefix frontend run check:i18n`; `npm --prefix frontend run test:webui-assets` (113 files, 350 references). +- **pass**: `npm --prefix frontend run test:harness-sidecar-coverage`: statements 98.55%, branches 94.44%, functions/lines 100%, above the existing thresholds. +- **pass**: `npm --prefix frontend exec -- vitest run --root frontend tests/mpaBasicDetails.test.tsx --coverage --coverage.include=src/ui/AgentWorkspace.tsx --coverage.reporter=json`: changed executable statement-start lines 7/7 covered (100%); not whole-component coverage. +- **pass**: loopback in-app browser, actual `AgentWorkspace` with mocked fetch: MPA Basic-only including restored Profile/session focus, chat callback, General navigation/Integration, switching back, Runtime normal/loading/failure, empty envs and read-only, keyboard Tab focus, 390px viewport (body width 390px), no hidden control-plane requests. Integration discovery failure was simulated, not a live provider result. Temporary fixture, tab, viewport override and server removed. +- **pass**: `uv run --extra dev pytest tests/integrations/mpa_managed tests/cli/test_frontend_deploy_iam.py -q`: 678 passed. An initial invocation referenced a nonexistent extra test path and ran no tests; corrected above. +- **not_applicable**: focused Ruff/Pyright for new Python code (no Python files changed in this integration); all-files pre-commit still required. Real cloud creation/deployment and new IME/mutation flows were not run as explained above. +- **fail** (unchanged baseline): `uv run --extra dev --extra codex --extra extensions --extra sandbox pytest -n 2 -m "not codex_smoke and not piagent_smoke"`: 6,869 passed, 53 skipped, 4 xfailed, 1 failed in 480.71s. Two workers were used per the repository default. Optional dependencies were prepared through declared extras in the repository-local environment; no dependency file changed. The only failure is `tests/frontend/server/runtime_artifacts/test_writer.py::test_success_uses_trusted_scope_and_hashes_utf8_bytes`: local Python 3.10/macOS `mimetypes.guess_type("reports/summary.md")` returns no type, producing `application/octet-stream` instead of `text/markdown`. The test and complete `frontend/server/runtime_artifacts/` implementation are identical to official main. This unrelated baseline remains a limitation, not a passing test. +- **pass**: refreshed `origin/main` and `upstream/main` remain `035387d1` and `171d8d86`; `git -c rebase.autoStash=true rebase upstream/main` reported up to date and restored all integration changes. +- **pass**: bilingual links/requirement IDs/quoted identifiers and scoped diff whitespace review. Direct final review found no lost increments, new dependencies, backend/chat changes, or overwritten official fixes. +- **pass**: after synchronization, `uv run --no-sync --extra dev pre-commit run --all-files`, `uv run --no-sync --extra dev pytest tests/integrations/mpa_managed tests/cli/test_frontend_deploy_iam.py -q` (678 passed), and `npm --prefix frontend test` (1,377 Node / 65 Vitest) passed again. `--no-sync` preserves the prepared repository-local optional extras. Commit/push metadata belongs to Git and the official PR. + +| Requirement | Task | Acceptance | Evidence | +| --- | --- | --- | --- | +| FR-1 | T-1 | AC-1: all effective increments retained | 83-path audit and documented official exceptions: pass. | +| FR-2 | T-2 | AC-2: Basic-only MPA, unchanged General | 10 regression cases plus loopback browser: pass. | +| FR-3 | T-3 | AC-3: tests, documents and matching assets | Frontend/build/i18n/assets/coverage and bilingual review: pass. | +| FR-4 | T-4 | AC-4: preserve official fixes and execute gates honestly | Rebase, pre-commit, targeted tests: pass; full regression: one unchanged MIME baseline failure recorded. | diff --git a/prd-spec/bugfixes/mpa-upstream-incremental-alignment/2026-10-10-complete-fork-increments.zh.md b/prd-spec/bugfixes/mpa-upstream-incremental-alignment/2026-10-10-complete-fork-increments.zh.md new file mode 100644 index 000000000..19273bd9c --- /dev/null +++ b/prd-spec/bugfixes/mpa-upstream-incremental-alignment/2026-10-10-complete-fork-increments.zh.md @@ -0,0 +1,66 @@ +# 在官方 main 补齐 fork 的 MPA 增量 + +- 变更 ID:`mpa-upstream-incremental-alignment`;日期:2026-10-10;状态:implemented。 +- [English](2026-10-10-complete-fork-increments.md)。 +- 契约:[Studio MPA 控制面](../../../specs/studio-mpa-control-plane/README.zh.md)。 + +## 背景与证据 +上次官方贡献分支 `feat/mpa-studio-upstream-alignment-20261009` 的末端是 `033b2711`;官方 PR #1156 以 `171d8d86` 合入。fork main `035387d1` 的历史不同。官方 PR #1160 直接基于 `171d8d86`,已包含 fork PR #23,但漏了 PR #22 的 MPA 详情仅基本信息。整体复制 fork 文件树会删掉官方较新的 Codex 等改动。 + +增量核对范围为 fork 对齐合并 `ef0ad519` 至 `035387d1`,与官方基线及贡献 HEAD `80fd1e19` 对比,以功能覆盖为准,不把每个历史提交都当作未应用的改动。 + +| fork 改动 | 本次处理 | +| --- | --- | +| PR #21:手填 Runtime 名称、描述、三步创建、镜像默认值、名称校验、TOS 提示 | 已在官方 PR #1156 中,保持。 | +| PR #22:MPA 详情仅基本信息、同步归一化焦点、停止隐藏 Profile 请求 | 迁入生产代码、回归测试、文档并重建发布资源。 | +| PR #23:STS 账号解析、IAM 准备及 Python 3.10 超时、网络发现/描述/子网顺序、标准 APIG、独立 Worker 创建/默认值/名称、技能空间描述、部署诊断 | 已在 #1160 中,保持并运行相关回归。 | +| lockfile 修复 | 有效内容已在官方 main 中,保持。 | +| 官方密钥扫描排除与取消时 PID 竞争修复 | 保留官方实现;fork 缺少这些贡献时修复。 | +| 官方 BytePlus sidecar 行为和 SDK 功能 | 保留;与 fork 的差异不属于 fork 新增功能。 | + +## 目标、场景与需求 +FR-1 / AC-1:上次贡献以来 fork 的全部有效增量在官方贡献中保留;不整体合并 fork/main,不反向撤销官方功能。 +FR-2 / AC-2:选择 MPA、恢复任意隐藏页面或从普通智能体切换时,在副作用前仅渲染基本信息;不请求 Agent View/Profile/会话配置,不执行 Profile 操作。普通智能体的导航和更新行为保持。 +FR-3 / AC-3:源码附带包测试、双语契约及历史设计;生成资源与合并后的官方源码一致。 +FR-4 / AC-4:保留官方密钥扫描和取消修复,运行当前仓库检查并如实记录。 +非目标:重设计后端 API、聊天改动、创建云资源、部署、合并官方 PR、改写 fork main、关闭其他 PR。 + +## 设计与影响文件 +将已审查的 PR #22 迁入 `frontend/src/ui/AgentWorkspace.tsx`,按类别和请求页面同步计算有效页面。保留隐藏控制面实现及清理逻辑,仅由所属页面触发。无新增依赖、数据迁移、鉴权或并发契约变化。更新 `frontend/tests/mpaBasicDetails.test.tsx`、源码契约测试及包测试命令;在双语组件规范和 README 追加仅基本信息约束,保留官方文档。迁入历史 PRD 双语文件,其有日期的云端证据仅为历史记录,不代表此次整合验证。从合并后的源码重建 `veadk/webui`。 + +## 任务与验证 +T-1(FR-1):逐个核对 `ef0ad519..035387d1` 的路径,排除生成哈希及历史文档纯格式差异,对剩余差异逐项说明。 +T-2(FR-2):迁入组件回归,在修改生产代码前验证失败,再迁入实现和源码契约断言。 +T-3(FR-3):前端测试、构建、i18n、资源引用、组件覆盖率及真实组件配合模拟网络的本地浏览器检查。 +T-4(FR-4):定向创建/CLI 测试、默认双 worker Python 回归、获取并 rebase 官方基线、全文件 pre-commit 及差异/文档审查后,按授权提交推送。 +浏览器场景:MPA 和普通导航、隐藏焦点、切换、Runtime 正常/加载/空/失败、只读、窄窗口、键盘焦点。新增输入/IME、写入取消及重试不适用,因为本次不增加输入或写入;既有创建/sidecar 回归仍须运行。不执行真实云端写入。 + +## 风险与审查 +风险:从 fork 整体替换文件可能覆盖官方增强。处理:仅迁入核对过的 PR #22 行为,用内容比较确认保留的创建路径。资源差异来自必须提交的哈希构建产物,不是新增手写功能。 +因 `review-spec` 不可用已直接审查:边界、副作用顺序、清理、兼容、安全、测试和双语一致性无阻塞。引用的前端设计 skill 本地缺失,采用既有 SPEC/Foundation 规范及直接审查。本次不重设计外观或新增组件。 +批准:用户于 2026-10-10 明确要求对比上次贡献并带上 main 全部新增功能,批准本次有限整合;此前准备并推送官方 PR 的授权继续有效。 + +## 交付记录 +以下检查针对 `80fd1e19` 之上的整合差异,英文版同步记录证据。不宣称本次云端验证。 + +2026-10-10 验证记录,针对 `80fd1e19` 之上的整合差异: +- **pass**:逐路径核对 `ef0ad519..035387d1` 的 83 个非生成文件,全部有效新增源码/测试/契约/设计与 fork main 一致。例外:README 保留官方文档并追加双语说明;`test_tasks.py` 保留官方 PID 竞争修复;四份历史 PRD 仅末尾空白不同。保留官方密钥扫描排除、BytePlus 行为和 Codex SDK 文件。 +- **pass**:先运行回归:`npm --prefix frontend exec -- vitest run --root frontend tests/mpaBasicDetails.test.tsx` 在迁入生产实现前 10 个用例全部失败;迁入后 10 个全部通过。 +- **pass**:`npm --prefix frontend test`:1,377 个 Node 和 65 个 Vitest 测试。 +- **pass**:`npm --prefix frontend run build`(TypeScript 及 app/widget 构建);`npm --prefix frontend run check:i18n`;`npm --prefix frontend run test:webui-assets`(113 文件、350 引用)。 +- **pass**:`npm --prefix frontend run test:harness-sidecar-coverage`:语句 98.55%、分支 94.44%、函数/行 100%,达到既有阈值。 +- **pass**:`npm --prefix frontend exec -- vitest run --root frontend tests/mpaBasicDetails.test.tsx --coverage --coverage.include=src/ui/AgentWorkspace.tsx --coverage.reporter=json`:变更可执行语句起始行覆盖 7/7(100%),不是整个组件覆盖率。 +- **pass**:本地内置浏览器使用真实 `AgentWorkspace` 与模拟 fetch:MPA 仅基本信息及恢复 Profile/会话焦点、聊天回调、普通导航/集成页、切回 MPA、Runtime 正常/加载/失败、空环境变量及只读、Tab 键盘焦点、390px 窗口(body 宽 390px),无隐藏控制面请求。集成发现失败为模拟结果,不代表实际云端。临时夹具、标签页、窗口覆盖及服务已清理。 +- **pass**:`uv run --extra dev pytest tests/integrations/mpa_managed tests/cli/test_frontend_deploy_iam.py -q`:678 passed。首次附加了不存在的测试路径而未执行测试,已按上述命令修正。 +- **not_applicable**:新增 Python 代码的定向 Ruff/Pyright(此次整合没有修改 Python);仍须执行全文件 pre-commit。未运行真实云端创建/部署及新增 IME/写入流程,原因见上文。 +- **fail**(未修改的基线):`uv run --extra dev --extra codex --extra extensions --extra sandbox pytest -n 2 -m "not codex_smoke and not piagent_smoke"`:6,869 passed、53 skipped、4 xfailed、1 failed,耗时 480.71s。按仓库默认使用两个 worker,通过项目声明的 extras 在仓库本地环境准备可选依赖,无依赖文件变更。唯一失败为 `tests/frontend/server/runtime_artifacts/test_writer.py::test_success_uses_trusted_scope_and_hashes_utf8_bytes`:本地 Python 3.10/macOS 的 `mimetypes.guess_type("reports/summary.md")` 未返回类型,得到 `application/octet-stream`,而测试期待 `text/markdown`。该测试及整个 `frontend/server/runtime_artifacts/` 实现与官方 main 相同。此无关基线问题仍是验证限制,不算通过。 +- **pass**:重新获取 `origin/main` 和 `upstream/main`,仍为 `035387d1` 和 `171d8d86`;`git -c rebase.autoStash=true rebase upstream/main` 显示已最新,并恢复全部整合改动。 +- **pass**:双语链接/需求 ID/引用标识和 scoped diff 空白检查。直接最终审查没有发现漏掉增量、新增依赖、后端/聊天变更或覆盖官方修复。 +- **pass**:同步后再次通过 `uv run --no-sync --extra dev pre-commit run --all-files`、`uv run --no-sync --extra dev pytest tests/integrations/mpa_managed tests/cli/test_frontend_deploy_iam.py -q`(678 passed)、`npm --prefix frontend test`(1,377 Node / 65 Vitest)。`--no-sync` 保留仓库本地已准备的可选依赖。提交/推送元数据以 Git 和官方 PR 为准。 + +| 需求 | 任务 | 验收 | 证据 | +| --- | --- | --- | --- | +| FR-1 | T-1 | AC-1:全部有效增量保留 | 83 路径核对及记录的官方例外:pass。 | +| FR-2 | T-2 | AC-2:MPA 仅基本信息,普通行为不变 | 10 回归用例及本地浏览器:pass。 | +| FR-3 | T-3 | AC-3:测试、文档及匹配资源 | 前端/构建/i18n/资源/覆盖率及双语审查:pass。 | +| FR-4 | T-4 | AC-4:保留官方修复并如实执行检查 | rebase、pre-commit、定向测试:pass;全量回归记录一个未修改的 MIME 基线失败。 | diff --git a/prd-spec/features/studio-mpa-basic-only/2026-10-09-basic-only.md b/prd-spec/features/studio-mpa-basic-only/2026-10-09-basic-only.md new file mode 100644 index 000000000..d4398b063 --- /dev/null +++ b/prd-spec/features/studio-mpa-basic-only/2026-10-09-basic-only.md @@ -0,0 +1,33 @@ +# MPA details: basic information only + +- Date: 2026-10-09; status: implemented, locally verified, and deployed. +- Approval: the user explicitly requested hiding all other tabs and stopping Profile requests on the MPA details page. +- [Chinese](2026-10-09-basic-only.zh.md); contract: [Studio MPA control plane](../../../specs/studio-mpa-control-plane/README.md). + +## Scope and evidence +`AgentWorkspace.tsx` loads `getMpaAgentView` on MPA selection, indirectly invoking Runtime `/profile-status`. Hiding navigation alone does not stop this request. The basic-page footer also links to Profile configuration. + +## Requirements and design +- FR-1: MPA details expose only Basic information, using the existing layout and styles. General agents retain their sections. +- FR-2: Every requested MPA section, including restored/external focus, resolves synchronously to `basic`, before effects run. +- FR-3: Basic information must not fetch MPA Agent View, Profile status, or issue Profile mutations. Gate the existing control-plane loader to its owning Profile/session sections and hide the footer Profile entry. +- FR-4: Preserve Runtime details, execution flow, chat/delete actions and their authorization. Backend APIs, native chat session creation and Profile storage are outside this change. + +## Review and verification plan +Direct review: the change is presentation/request scheduling only; no data migration or authentication changes. Existing hidden implementations remain available for a later explicit re-enable. `ui-ux-pro-max` is unavailable locally; existing component standards and direct review apply. Validate bilingual equivalence and existing styling. + +Regression: render the real workspace with mocked network boundaries; cover all hidden focus sections, MPA switching, general navigation, visible basic content, and zero Profile/control-plane calls. Run frontend tests/build/assets and pre-commit, check changed executable-line coverage above 95%, and verify a browser fixture when available. No cloud deployment is implied by local checks. + +## Delivery +Implemented FR-1 through FR-4 in `frontend/src/ui/AgentWorkspace.tsx`; updated existing source contracts, added `frontend/tests/mpaBasicDetails.test.tsx`, and rebuilt `veadk/webui`. No backend or API contract changes. + +Verification on the diff against `42b50624` (2026-10-09): +- **pass**: `npm --prefix frontend test`: 1,377 Node tests and 64 Vitest tests, including 10 new component cases. +- **pass**: `vitest run --root frontend tests/mpaBasicDetails.test.tsx --coverage --coverage.include=src/ui/AgentWorkspace.tsx --coverage.reporter=json`: changed executable statement-start lines 7/7 (100%). This is changed-line coverage, not whole-component coverage. +- **pass**: `npm --prefix frontend run build`; `npm --prefix frontend run test:webui-assets`: 113 packaged files and 350 references verified. +- **pass**: real Chrome with a temporary loopback fixture using the actual component and mocked fetch: MPA basic-only, General navigation and Integration interaction, General-to-MPA transition, zero Profile requests, narrow viewport layout. Temporary fixture removed before commit. +- **pass**: `uv run --extra dev pre-commit run --all-files`; `git diff --check`; latest `origin/main` fetched and already included. +- **not_applicable**: new input/IME, mutation cancellation/retry flows, and backend tests; these paths were not changed. Hidden section focus is covered by component tests. +- **pass**: user-authorized cloud update of source `4a532405`, stable revision 38 to 39; deployment status `deploy_success`, existing environment hash unchanged, homepage HTTP 200 referencing the new script, and deployed JS/CSS/logo SHA256 values matching the local build. Reloading the existing cloud MPA detail page in Chrome showed only Basic, loaded Runtime information, and no JWT/control-plane error. No cloud mutation or chat E2E was run; native chat session creation retains its existing Profile behavior. + +Direct final review: category gating leaves General navigation and update behavior unchanged, synchronous section resolution prevents stale focus from starting hidden-page requests, and existing effects retain cleanup. English/Chinese requirements and component documentation were reconciled. diff --git a/prd-spec/features/studio-mpa-basic-only/2026-10-09-basic-only.zh.md b/prd-spec/features/studio-mpa-basic-only/2026-10-09-basic-only.zh.md new file mode 100644 index 000000000..c23798b15 --- /dev/null +++ b/prd-spec/features/studio-mpa-basic-only/2026-10-09-basic-only.zh.md @@ -0,0 +1,33 @@ +# MPA 详情仅保留基本信息 + +- 日期:2026-10-09;状态:已实现、通过本地验证并已部署。 +- 批准依据:用户明确要求隐藏 MPA 详情页其他 Tab,并停止该页面的 Profile 请求。 +- [English](2026-10-09-basic-only.md);契约:[Studio MPA 控制面](../../../specs/studio-mpa-control-plane/README.zh.md)。 + +## 范围与证据 +`AgentWorkspace.tsx` 在选择 MPA 时调用 `getMpaAgentView`,间接请求 Runtime `/profile-status`。仅隐藏导航不能阻止请求。基本信息页底部也有 Profile 配置入口。 + +## 需求与设计 +- FR-1:MPA 详情只显示基本信息,沿用既有布局和样式。普通 Agent 保留原有页面。 +- FR-2:MPA 的任意目标页面(包括恢复或外部焦点)在副作用运行前同步解析为 `basic`。 +- FR-3:基本信息不读取 MPA Agent View、Profile 状态或发起 Profile 修改。控制面加载限定在所属的 Profile/会话页面,并隐藏底部 Profile 入口。 +- FR-4:保留 Runtime 信息、执行流程、聊天/删除操作及其授权。后端 API、原生聊天会话创建和 Profile 存储不在本次范围。 + +## 审查与验证计划 +直接审查:只改变展示和请求调度,不迁移数据或改变鉴权。隐藏的既有实现保留,后续需明确重新启用。本地没有 `ui-ux-pro-max`,采用现有组件规范及直接审查。核对双语一致性和既有样式。 + +回归:渲染真实工作台并模拟网络边界,覆盖全部隐藏页面焦点、MPA 切换、普通 Agent 导航、基本信息展示以及 Profile/控制面零请求。执行前端测试、构建、资源检查和 pre-commit,检查新增可执行行覆盖率超过 95%,在可用时验证浏览器夹具。本地检查不代表已部署云端。 + +## 交付 +在 `frontend/src/ui/AgentWorkspace.tsx` 实现 FR-1 至 FR-4,更新既有源码契约测试,新增 `frontend/tests/mpaBasicDetails.test.tsx`,重新构建 `veadk/webui`。未改变后端或 API 契约。 + +针对 `42b50624` 之上的差异验证(2026-10-09): +- **pass**:`npm --prefix frontend test`:1,377 个 Node 测试和 64 个 Vitest 测试通过,包含 10 个新增组件用例。 +- **pass**:`vitest run --root frontend tests/mpaBasicDetails.test.tsx --coverage --coverage.include=src/ui/AgentWorkspace.tsx --coverage.reporter=json`:变更的可执行语句起始行覆盖 7/7(100%)。这是增量行覆盖率,不是整个组件覆盖率。 +- **pass**:`npm --prefix frontend run build`;`npm --prefix frontend run test:webui-assets`:验证 113 个打包文件及 350 个引用。 +- **pass**:真实 Chrome 加载临时本地夹具,使用真实组件与模拟 fetch:MPA 仅基本信息、普通 Agent 导航及集成页面交互、普通 Agent 切回 MPA、Profile 零请求、窄窗口布局。提交前移除临时夹具。 +- **pass**:`uv run --extra dev pre-commit run --all-files`;`git diff --check`;已获取最新 `origin/main`,当前分支已包含该基线。 +- **not_applicable**:新增输入/IME、写入取消/重试流程及后端测试;本次未修改这些路径。隐藏页面焦点由组件测试覆盖。 +- **pass**:经用户授权,将源码 `4a532405` 更新到云端,稳定版本由 38 升至 39;部署状态 `deploy_success`,既有环境配置哈希不变,首页 HTTP 200 并引用新脚本,线上 JS/CSS/logo 的 SHA256 与本地构建一致。在 Chrome 刷新既有云端 MPA 详情页后,仅显示基本信息,Runtime 信息加载成功,不再显示 JWT/控制面错误。未执行云端写入或聊天 E2E;原生聊天会话创建保留原有 Profile 行为。 + +最终直接审查:类别限制保留普通 Agent 的导航与更新行为,同步解析页面避免旧焦点启动隐藏页面请求,既有副作用保留清理逻辑。已核对中英文需求与组件文档一致性。 diff --git a/specs/studio-mpa-control-plane/README.md b/specs/studio-mpa-control-plane/README.md index faf2f19cc..e684dd31c 100644 --- a/specs/studio-mpa-control-plane/README.md +++ b/specs/studio-mpa-control-plane/README.md @@ -129,3 +129,7 @@ S5-11 live verification: `VEADK_MPA_P0_LIVE=1 VEADK_MPA_P0_ASYNC_STAGE_TIMEOUT_S CON-11a regression verification: the focused conversation/reconciliation suite returned 43 passed; full frontend tests returned 1236 passed; TypeScript, i18n, production build, and scoped diff checks passed. A strict real-Studio probe observed five ordered `.turn--assistant` nodes after completion plus a 30-second delay and the same five nodes after full-page reload. Existing optional local endpoint 404/503 responses were recorded separately and did not affect transcript persistence. CON-11b regression verification: full frontend tests returned 1237 passed; TypeScript, i18n, production build, and scoped diff checks passed. A fresh real-Studio `whoami` run observed the parent `sandbox_task` and child command transition from running to completed without reload, no remaining spinner or running activity, and the final answer `root`; full-page reload preserved both terminal activities and the answer. Scope correction: website/Feishu and other deferred findings in the entry audit above are future references, not current development requirements. + +## MPA details availability (2026-10-09) + +MPA Agent details currently expose only Basic information. Other detail tabs and the footer Profile entry are hidden; restored/external focus resolves to Basic before section effects run. This page does not fetch Agent View or Profile status and cannot submit Profile operations. Runtime details, execution flow, chat/delete actions and their authorization remain. General Agent navigation, backend control-plane APIs, and native chat session Profile handling retain their existing contracts. diff --git a/specs/studio-mpa-control-plane/README.zh.md b/specs/studio-mpa-control-plane/README.zh.md index d1c608241..3e0ab4a93 100644 --- a/specs/studio-mpa-control-plane/README.zh.md +++ b/specs/studio-mpa-control-plane/README.zh.md @@ -1,5 +1,9 @@ # Studio MPA 控制面 +## MPA 详情开放范围(2026-10-09) + +MPA 智能体详情目前只开放基本信息。其他详情 Tab 及底部 Profile 入口隐藏;恢复或外部焦点在页面副作用执行前解析为基本信息。此页面不读取 Agent View、Profile 状态,也不能提交 Profile 操作。保留 Runtime 信息、执行流程、聊天/删除及其授权。普通 Agent 导航、后端控制面 API 和原生聊天会话的 Profile 处理维持原契约。 + - Component ID:`studio-mpa-control-plane` - 状态:剩余 P0 修订为 `draft`;基线第一期、第二期部分能力以及 P0 Studio 切片至 S5-12 浏览器验证已实现 - 修订日期:2026-09-20 diff --git a/veadk/webui/assets/app/index-8JtvDNuA.js b/veadk/webui/assets/app/index-jtZg_8XU.js similarity index 81% rename from veadk/webui/assets/app/index-8JtvDNuA.js rename to veadk/webui/assets/app/index-jtZg_8XU.js index 4c7813b10..90480834d 100644 --- a/veadk/webui/assets/app/index-8JtvDNuA.js +++ b/veadk/webui/assets/app/index-jtZg_8XU.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/visualizations/mermaid/mermaid.core-DAx4nvmm.js","assets/chunks/purify.es-BnINGy_Y.js","assets/chunks/MarkdownPromptEditor-C8Q2sj5P.js","assets/styles/MarkdownPromptEditor-ZH9qtki0.css","assets/chunks/QuickAgentCreateDialog-_TpoDPFW.js","assets/styles/QuickAgentCreateDialog-DGsLIlOX.css"])))=>i.map(i=>d[i]); -var Lze=Object.defineProperty;var RG=e=>{throw TypeError(e)};var $ze=(e,t,n)=>t in e?Lze(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Zt=(e,t,n)=>$ze(e,typeof t!="symbol"?t+"":t,n),IG=(e,t,n)=>t.has(e)||RG("Cannot "+n);var El=(e,t,n)=>(IG(e,t,"read from private field"),n?n.call(e):t.get(e)),PG=(e,t,n)=>t.has(e)?RG("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),w5=(e,t,n,i)=>(IG(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n);function Fze(e,t){for(var n=0;ni[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();var ug=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function C1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Tue={exports:{}},GP={};/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/visualizations/mermaid/mermaid.core-Vsbm7qIM.js","assets/chunks/purify.es-BnINGy_Y.js","assets/chunks/MarkdownPromptEditor-Di8dSDc3.js","assets/styles/MarkdownPromptEditor-ZH9qtki0.css","assets/chunks/QuickAgentCreateDialog-BoukSlN9.js","assets/styles/QuickAgentCreateDialog-DGsLIlOX.css"])))=>i.map(i=>d[i]); +var Lze=Object.defineProperty;var RG=e=>{throw TypeError(e)};var $ze=(e,t,n)=>t in e?Lze(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Zt=(e,t,n)=>$ze(e,typeof t!="symbol"?t+"":t,n),IG=(e,t,n)=>t.has(e)||RG("Cannot "+n);var kl=(e,t,n)=>(IG(e,t,"read from private field"),n?n.call(e):t.get(e)),PG=(e,t,n)=>t.has(e)?RG("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),w5=(e,t,n,i)=>(IG(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n);function Fze(e,t){for(var n=0;ni[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();var cg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function T1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Tue={exports:{}},XP={};/** * @license React * react-jsx-runtime.production.js * @@ -7,7 +7,7 @@ var Lze=Object.defineProperty;var RG=e=>{throw TypeError(e)};var $ze=(e,t,n)=>t * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Bze=Symbol.for("react.transitional.element"),Uze=Symbol.for("react.fragment");function _ue(e,t,n){var i=null;if(n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),"key"in t){n={};for(var r in t)r!=="key"&&(n[r]=t[r])}else n=t;return t=n.ref,{$$typeof:Bze,type:e,key:i,ref:t!==void 0?t:null,props:n}}GP.Fragment=Uze;GP.jsx=_ue;GP.jsxs=_ue;Tue.exports=GP;var a=Tue.exports;const jue={requestFailed:"Request failed ({{status}})",unknownError:"Unknown error",contentTypeMissing:"Content-Type missing",response:"Response: {{response}}",fallbackWithDetail:"{{fallback}}: {{detail}}",fallbackWithHttpStatus:"{{fallback}} (HTTP {{status}})",nonJsonResponse:"{{fallback}}: the server returned a non-JSON response ({{contentType}})"},Nue={unconfigured:"AgentKit Dev Sandbox has not been configured by an administrator.",invalidSession:"AgentKit CLI returned an invalid session.",loadCapabilitiesFailed:"Unable to load the AgentKit CLI configuration.",invalidCapabilities:"AgentKit CLI returned an invalid configuration status.",listSessionsFailed:"Unable to load AgentKit CLI sessions.",invalidSessionList:"AgentKit CLI returned an invalid session list.",createSessionFailed:"Unable to create an AgentKit CLI session.",openSessionFailed:"Unable to open the AgentKit CLI session.",openTerminalFailed:"Unable to open the AgentKit CLI terminal.",invalidTerminalUrl:"AgentKit CLI returned an invalid terminal URL."},Rue={cnBeijing:"China North 2 (Beijing)",cnShanghai:"China East 2 (Shanghai)"},Iue={runtimeUnsupported:"This Runtime does not currently support connections. Confirm that the service is running normally."},Pue={autoConfigureFailed:"Failed to configure the Feishu bot automatically"},Due={actionFailed:"Failed to {{action}}",detail:"Details: {{detail}}",request:"Request: {{request}}"},Mue={persistentMemoryHint:"Tip: The session no longer exists. With in-memory or SQLite short-term memory, sessions may be lost during multi-instance routing, process restarts, or rolling deployments. Use database-backed persistent short-term memory instead.",unsupportedRouteHint:"Tip: This Runtime does not provide the session run API and may be incompatible with the current Studio version.",toolArgumentHint:"Tip: The model generated incomplete tool arguments. Send the request again.",resourceCollectionExpiredHint:"Tip: This resource collection has expired. Send the task again so the system can collect the resources before creating the Agent.",networkConfigurationHint:"Tip: Try again later, and review the Runtime, model, or gateway logs.",modelQuotaHint:"Tip: The model has reached its TPM/RPM quota. Try again later or increase the model quota.",rawResponseLabel:"Raw response: ",copySecretFailed:"Failed to copy the secret value"},Lue={httpStatus:"HTTP status: {{status}}",errorCode:"Error code: {{code}}",cloudResponseBody:`Cloud response body: + */var Bze=Symbol.for("react.transitional.element"),Uze=Symbol.for("react.fragment");function _ue(e,t,n){var i=null;if(n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),"key"in t){n={};for(var r in t)r!=="key"&&(n[r]=t[r])}else n=t;return t=n.ref,{$$typeof:Bze,type:e,key:i,ref:t!==void 0?t:null,props:n}}XP.Fragment=Uze;XP.jsx=_ue;XP.jsxs=_ue;Tue.exports=XP;var a=Tue.exports;const jue={requestFailed:"Request failed ({{status}})",unknownError:"Unknown error",contentTypeMissing:"Content-Type missing",response:"Response: {{response}}",fallbackWithDetail:"{{fallback}}: {{detail}}",fallbackWithHttpStatus:"{{fallback}} (HTTP {{status}})",nonJsonResponse:"{{fallback}}: the server returned a non-JSON response ({{contentType}})"},Nue={unconfigured:"AgentKit Dev Sandbox has not been configured by an administrator.",invalidSession:"AgentKit CLI returned an invalid session.",loadCapabilitiesFailed:"Unable to load the AgentKit CLI configuration.",invalidCapabilities:"AgentKit CLI returned an invalid configuration status.",listSessionsFailed:"Unable to load AgentKit CLI sessions.",invalidSessionList:"AgentKit CLI returned an invalid session list.",createSessionFailed:"Unable to create an AgentKit CLI session.",openSessionFailed:"Unable to open the AgentKit CLI session.",openTerminalFailed:"Unable to open the AgentKit CLI terminal.",invalidTerminalUrl:"AgentKit CLI returned an invalid terminal URL."},Rue={cnBeijing:"China North 2 (Beijing)",cnShanghai:"China East 2 (Shanghai)"},Iue={runtimeUnsupported:"This Runtime does not currently support connections. Confirm that the service is running normally."},Pue={autoConfigureFailed:"Failed to configure the Feishu bot automatically"},Due={actionFailed:"Failed to {{action}}",detail:"Details: {{detail}}",request:"Request: {{request}}"},Mue={persistentMemoryHint:"Tip: The session no longer exists. With in-memory or SQLite short-term memory, sessions may be lost during multi-instance routing, process restarts, or rolling deployments. Use database-backed persistent short-term memory instead.",unsupportedRouteHint:"Tip: This Runtime does not provide the session run API and may be incompatible with the current Studio version.",toolArgumentHint:"Tip: The model generated incomplete tool arguments. Send the request again.",resourceCollectionExpiredHint:"Tip: This resource collection has expired. Send the task again so the system can collect the resources before creating the Agent.",networkConfigurationHint:"Tip: Try again later, and review the Runtime, model, or gateway logs.",modelQuotaHint:"Tip: The model has reached its TPM/RPM quota. Try again later or increase the model quota.",rawResponseLabel:"Raw response: ",copySecretFailed:"Failed to copy the secret value"},Lue={httpStatus:"HTTP status: {{status}}",errorCode:"Error code: {{code}}",cloudResponseBody:`Cloud response body: {{body}}`,loadFailedWithDetail:"Failed to load instance logs: {{detail}}",invalidFormat:"Failed to load instance logs: the service returned an invalid format"},$ue={untitledSession:"Untitled session",webUnavailable:"Web search is unavailable because /web/search is not enabled on the server.",webFailed:"Web search failed: {{message}}",webNotMounted:"This Agent does not have the web_search tool mounted.",knowledgeNotMounted:"This Agent does not have a knowledge base mounted.",memoryNotMounted:"This Agent does not have long-term memory mounted.",knowledge:"Knowledge base",longTermMemory:"Long-term memory"},Fue={listSpacesFailed:"Failed to load Skill spaces",createSpaceFailed:"Failed to create the Skill space",updateSpaceFailed:"Failed to update the Skill space",deleteSpaceFailed:"Failed to delete the Skill space",uploadFailed:"Failed to upload the Skill",validateFailed:"Failed to validate the Skill",deleteFailed:"Failed to delete the Skill",listFilesFailed:"Failed to load Skill files",downloadFailed:"Failed to download the Skill",sharedSpaceFailed:"Shared space unavailable",reservedSpaceName:"This name is reserved for a system space; choose another name",reviewSpaceFailed:"The review space is unavailable",submitReviewFailed:"Could not submit the publication request",listReviewsFailed:"Could not load review requests",reviewFilesFailed:"Could not load submitted files",decideReviewFailed:"Review failed, please try again",listVersionsFailed:"Unable to load skill versions",uploadVersionFailed:"Unable to upload the new skill version"},Bue={truncatedData:"{{data}}… (truncated, {{count}} characters total)",incompleteEvent:"The stream ended with an incomplete SSE event. Raw data: {{data}}",invalidEventJson:"Failed to parse the SSE event JSON. Raw data: {{data}}"},Uue={loadConfigNetworkFailed:"Unable to load the sign-in configuration. Check your network and try again.",configServiceFailed:"The sign-in configuration service failed (HTTP {{status}}). Try again later.",invalidConfigResponse:"The sign-in configuration service returned an unreadable response. Try again later.",serviceNetworkFailed:"Unable to connect to the identity service. Check your network and try again.",invalidServiceResponse:"The identity service returned an unreadable response. Try again later.",serviceFailed:"The identity service failed (HTTP {{status}}). Try again later."},Que={invalidToken:"The GitHub token is invalid or does not have repository write access",notFound:"The repository, branch, or file does not exist, or the token cannot access it",rejectedCommit:"GitHub rejected the commit. Check the branch and file state",requestFailed:"GitHub request failed (HTTP {{status}})",networkFailed:"Unable to connect to GitHub. Check your network and try again",invalidRepositoryFormat:"The GitHub repository must use the owner/repository format",insecureRepositoryUrl:"Only secure github.com repository URLs are supported",unsafeProjectPath:"The Agent project directory must be a safe relative path within the repository",tokenRequired:"A GitHub token is required",invalidBaseBranch:"The target branch format is invalid",invalidPublishBranch:"The publish branch format is invalid",noFiles:"There are no files to commit",missingBaseSha:"The target branch does not have a valid Git SHA",fileAlreadyExists:"{{path}} already exists in the target repository; the existing file was not overwritten",pathNotUpdatable:"The target path {{path}} is not an updatable file",invalidPullRequest:"GitHub did not return a valid pull request"},zue={loadCapabilitiesFailed:"Failed to load video model capabilities",uploadAssetFailed:"Failed to upload {{fileName}}",enhancePromptFailed:"Failed to enhance the prompt",createTaskFailed:"Failed to create the video generation task",getTaskFailed:"Failed to load the video generation task",downloadFailed:"Failed to download the generated video"},Vue={listFailed:"Failed to load website integrations",createFailed:"Failed to create the website integration",deleteFailed:"Failed to delete the website integration"},Hue={loadFailed:"Failed to load the knowledge base",htmlHidden:"[HTML content hidden]",redacted:"[redacted]",depthTruncated:"[content nested too deeply; truncated]",circularReference:"[circular reference]",diagnosticsUnavailable:"[diagnostic information unavailable]",statusCode:"Status: {{status}}",errorCode:"Error code: {{code}}",requestId:"Request ID: {{requestId}}",diagnostics:"Diagnostics: {{diagnostics}}",detail:"Details: {{detail}}",signInRequired:"Sign in before accessing knowledge bases",forbidden:"You do not have permission to operate on this knowledge base",notFound:"The knowledge base or knowledge content does not exist",conflict:"The knowledge base cannot perform this operation in its current state",requestFailed:"Knowledge base request failed ({{status}})"},que={invalidName:"Names must contain 1–128 characters, without control or invisible formatting characters, or < >.",renameProjectFailed:"Unable to update the project name",renameVersionFailed:"Unable to update the version name",invalidNameUpdateResponse:"The name update response does not match the request. Refresh and try again.",invalidSourceSnapshot:"The source snapshot response has an invalid format.",invalidProjectList:"The project list response has an invalid format.",invalidProjectVersion:"The project version response has an invalid format.",loadProjectsFailed:"Unable to load saved projects",loadVersionsFailed:"Unable to load project versions",deleteVersionFailed:"Failed to delete the project version",invalidDeleteVersionResponse:"The project version deletion response has an invalid format.",loadProjectSourceFailed:"Unable to load project source",loadSnapshotFailed:"Unable to load the source snapshot",restoreSnapshotFailed:"Unable to restore the current source snapshot",downloadSourceFailed:"Failed to download the source",downloadNotZip:"The source download response is not a ZIP file.",downloadSizeMismatch:"The source archive size does not match the published record. Try again."},Wue={invalidFormat:"{{label}} has an invalid format.",validationSeparator:"; ",invalidAnalysisResult:"The migration analysis result has an invalid format.",invalidFrameworkCandidate:"A framework candidate has an invalid format.",invalidAnalysisEvidence:"The analysis evidence has an invalid format.",invalidEntryCandidate:"An entry candidate has an invalid format.",invalidQuestion:"A follow-up question has an invalid format.",invalidPendingInput:"Analysis questions are not readable",invalidTask:"The migration session has an invalid format.",invalidAnalysisReference:"The analysis result reference has an invalid format.",invalidSourcePersistence:"The migration source persistence status has an invalid format.",invalidActivity:"The migration activity has an invalid format.",invalidActivityItem:"A migration activity item has an invalid format.",invalidActivityTool:"A migration activity tool item has an invalid format.",invalidActivityPlan:"The migration execution plan has an invalid format.",invalidActivityPlanItem:"A migration execution plan item has an invalid format.",invalidArtifact:"The migration artifact has an invalid format.",invalidEnvironmentDefaults:"The environment variable defaults have an invalid format.",invalidArtifactFile:"A migration artifact file has an invalid format.",invalidVerificationCheck:"A migration verification check has an invalid format.",requestValidationFailed:"Request validation failed: {{detail}}",gatewayError:"{{fallback}} (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",nonJsonResponse:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}). Check the proxy or gateway configuration.",loadCapabilitiesFailed:"Failed to load migration capabilities",invalidCapabilities:"The migration capabilities have an invalid format.",invalidModelCapabilities:"The migration model capabilities have an invalid format.",loadTasksFailed:"Failed to load migration sessions",invalidTaskList:"The migration session list has an invalid format.",createTaskFailed:"Failed to create the migration session",uploadProjectFailed:"Failed to upload the migration project",loadActivityFailed:"Failed to load migration activity",loadEventsFailed:"Failed to follow the migration progress stream",invalidEventsResponse:"The migration progress stream returned an invalid frame.",reconnecting:"Connection lost. Reconnecting to the migration progress stream…",startFailed:"Failed to start the migration",submitAnswersFailed:"Failed to submit additional analysis information",submitInputFailed:"Could not submit the analysis answer",stopFailed:"Failed to stop the migration",deleteTaskFailed:"Failed to delete the migration session",loadArtifactFailed:"Failed to load the migration artifact",loadArtifactFileFailed:"Failed to load the migration artifact file",downloadArtifactFailed:"Failed to download the migration artifact",evaluation:{datasetSaveFailed:"Failed to save evaluation cases",datasetLoadFailed:"Failed to load evaluation cases",statusLoadFailed:"Failed to load evaluation status",resumeFailed:"Failed to continue evaluation",retryFailed:"Failed to retry evaluation",reportLoadFailed:"Failed to load the evaluation report",reportDownloadFailed:"Failed to download the evaluation report"},labels:{analysisResult:"Migration analysis result",recommendation:"Migration recommendation",boundary:"Migration boundary",frameworkCandidate:"Framework candidate",analysisEvidence:"Analysis evidence",recommendedFramework:"Recommended framework",entryCandidate:"Entry candidate",entryFramework:"Entry framework",includeScope:"Migration include scope",excludeScope:"Migration exclude scope",assumptions:"Analysis assumptions",question:"Follow-up question",analysisWarnings:"Migration warnings",task:"Migration session",artifactStatus:"Migration artifact status",analysisReference:"Analysis result reference",confirmation:"Migration confirmation",confirmedFramework:"Confirmed framework",error:"Migration error",sourcePersistence:"Migration source persistence status",activity:"Migration activity",activityItem:"Migration activity item",activityTool:"Migration activity tool item",activityPlanItem:"Migration activity plan item",artifact:"Migration artifact",cli:"CLI information",migration:"Migration information",startup:"Startup information",environment:"Environment variable information",verification:"Verification information",report:"Migration report",archive:"Artifact archive",environmentDefaults:"Environment variable defaults",requiredEnvironment:"Required environment variables",optionalEnvironment:"Optional environment variables",artifactFile:"Migration artifact file",verificationCheck:"Migration verification check",artifactWarnings:"Migration artifact warnings",errorResponse:"Error response",errorDetail:"Error details",capabilities:"Migration capabilities",framework:"Migration framework",modelCapabilities:"Migration model capabilities",taskList:"Migration session list",evaluationAsset:"Evaluation asset",evaluation:"Evaluation status",evaluationCapabilities:"Evaluation capabilities",evaluationDimension:"Evaluation dimension",evaluationCase:"Evaluation case",evaluationCriteria:"Evaluation criteria",evaluationMessage:"Evaluation conversation",evaluationDataset:"Evaluation dataset",evaluationDimensionResult:"Evaluation dimension result",evaluationEvidence:"Evaluation evidence",evaluationReport:"Evaluation report",evaluationSummary:"Evaluation summary",evaluationCaseResult:"Evaluation case result",evaluationOutput:"Evaluation output",evaluationLimitations:"Evaluation limitations",pendingInput:"Analysis question",pendingQuestion:"Analysis question item",pendingOption:"Analysis question option"}},Kue={status:{ready:"Ready",wakeable:"Asleep",creating:"Creating",starting:"Starting",pending:"Pending",running:"Running",failed:"Error",stopped:"Stopped",expired:"Expired",deleting:"Deleting",deleted:"Deleted",unknown:"Unknown status"},developmentTimeout:"The development environment timed out. The task may still be running; reopen this session later to check its status.",developmentDisconnected:"The connection to the development environment was interrupted. The task may still be running; reopen this session later to check its status.",developmentFailed:"The development task could not continue. The environment was preserved; try again in this session.",invalidStudioResponse:"{{fallback}} Studio returned an invalid response. Refresh and try again.",invalidSession:"AgentKit Sandbox returned invalid session information.",invalidSnapshot:"AgentKit Sandbox returned invalid snapshot information.",invalidSettings:"Sandbox returned invalid settings.",invalidThreadSnapshot:"Sandbox returned an invalid thread snapshot.",emptyConversationResponse:"The Sandbox conversation service returned no content.",invalidConversationResponse:"The Sandbox conversation service returned an unreadable response.",conversationFailed:"The Sandbox conversation failed. Try again later.",emptyReply:"Sandbox did not return a valid reply. Try again.",missingSession:"The AgentKit session is missing.",listCodexFailed:"Unable to load Codex agents. Try again later.",invalidSessionList:"AgentKit Sandbox returned an invalid session list.",invalidSnapshotList:"AgentKit Sandbox returned an invalid snapshot list.",startFailed:"Unable to start AgentKit Sandbox. Try again later.",listAgentFailed:"Unable to load {{kind}} agents. Try again later.",invalidKindSessionList:"AgentKit returned an invalid {{kind}} session list.",invalidKindSnapshotList:"AgentKit returned an invalid {{kind}} snapshot list.",createAgentFailed:"Unable to create a {{kind}} agent. Try again later.",missingSessionToOpen:"The AgentKit session to open is missing.",openAgentFailed:"Unable to open the {{kind}} agent.",invalidAgentHomeUrl:"The {{kind}} agent returned an invalid home URL.",missingSessionForTerminal:"The AgentKit session for the terminal is missing.",openTerminalFailed:"Unable to open the {{kind}} terminal.",deleteAgentFailed:"Unable to delete the {{kind}} agent.",missingSnapshot:"The agent to wake was not found.",resumeSnapshotFailed:"Unable to wake the agent. Try again later.",deleteSnapshotFailed:"Unable to delete the agent. Try again later.",missingSessionToConnect:"The AgentKit session to connect is missing.",connectCodexFailed:"Unable to connect to the Codex agent. Try again later.",sessionNotReady:"The AgentKit session is not ready. Current status: {{status}}.",invalidMessage:"The built-in agent session does not contain a valid message.",interruptFailed:"Unable to stop the current task.",getStatusFailed:"Unable to load Codex status.",getEndpointFailed:"Unable to load the Sandbox endpoint.",invalidEndpoint:"Sandbox returned an invalid endpoint.",createHandoffPairingFailed:"Unable to create a Codex cloud handoff pairing code.",invalidHandoffPairing:"Studio returned an invalid Codex cloud handoff pairing code.",getHandoffStatusFailed:"Unable to load the cloud handoff status.",invalidHandoffStatus:"Studio returned an invalid cloud handoff status.",listModelsFailed:"Unable to load Codex models.",invalidModelList:"Sandbox returned an invalid model list.",setModelFailed:"Unable to switch the Codex model.",invalidModel:"Sandbox returned an invalid model.",listSkillsFailed:"Unable to load Codex Skills.",invalidSkillList:"Sandbox returned an invalid Skill list.",listThreadsFailed:"Unable to load Codex threads.",invalidThreadList:"Sandbox returned an invalid thread list.",createThreadFailed:"Unable to create a new Codex thread.",missingThread:"The Codex thread to read is missing.",readThreadFailed:"Unable to load Codex history.",resumeThreadFailed:"Unable to resume the Codex thread.",forkThreadFailed:"Unable to fork the Codex thread.",archiveThreadFailed:"Unable to archive the Codex thread.",invalidArchiveResult:"Sandbox returned an invalid archive result.",deleteThreadFailed:"Unable to delete the Codex thread.",invalidDeleteResult:"Sandbox returned an invalid deletion result.",compactThreadFailed:"Unable to compact the Codex thread.",getSettingsFailed:"Unable to load Codex permissions and workspace settings.",updatePermissionsFailed:"Unable to update Codex permissions.",updateWorkspaceFailed:"Unable to update the Codex workspace.",invalidWorkingDirectory:"Sandbox returned an invalid working directory.",listDirectoriesFailed:"Unable to load Sandbox directories.",invalidDirectoryList:"Sandbox returned an invalid directory list.",resolveApprovalFailed:"Unable to submit the Codex approval decision.",uploadFileFailed:"Unable to upload the file to Sandbox.",invalidUploadResult:"Sandbox returned an invalid upload result.",disconnectCodexFailed:"Unable to disconnect the Codex agent.",deleteCodexFailed:"Unable to delete the Codex agent.",openSandboxTerminalFailed:"Unable to open the Sandbox terminal.",openSandboxBrowserFailed:"Unable to open the Sandbox browser.",toolLabel:"Sandbox tool",invalidToolUrl:"{{label}} returned an invalid URL.",unsafeToolUrl:"{{label}} returned an unsafe URL."},Gue={invalidSandboxVersion:"Invalid sandbox version response",loadSandboxVersionsFailed:"Failed to check sandbox versions",updateSandboxFailed:"Failed to update sandbox",invalidSandboxUpdate:"Invalid sandbox update response",errorWithDetailAndRawResponse:`{{context}} {{detail}} Response details: @@ -53,7 +53,7 @@ Studio:{{studioUrl}} 配对码:{{pairingCode}}`,installPrompt:`请安装 AgentKit Studio Plugin。请直接执行以下安装命令,不要让我手动打开终端。 安装命令:{{command}}`,title:"接力到云端继续执行",description:"按顺序复制两段提示词,Codex 会通过插件将您的本地任务接力到云端",closeAria:"关闭本地迁移引导",installTitle:"安装插件",installDescription:"首次使用时,请选择一种安装方式。",copied:"已复制",copyInstallPrompt:"复制安装提示词",copyInstallCommand:"复制安装命令",installMethodAria:"插件安装方式",conversationInstall:"与 Codex 对话安装",terminalInstall:"从终端安装",taskTitle:"任务接力",taskDescription:"插件安装完成后复制,Codex 会迁移当前项目并继续执行任务。",copyHandoffPrompt:"复制接力提示词",generatingPairing:"正在生成新的配对码",pairingExpired:"配对码已过期",pairingRemaining:"配对码有效期剩余 {{countdown}}",refreshing:"刷新中",refreshPairing:"刷新配对码",pairingLoading:"正在生成配对码",pairingUnavailable:"配对码尚未生成。",statusAria:"端云接力状态",statusTitle:"接力状态",requestReceivedNamed:"已收到“{{name}}”的端云接力请求",requestReceivedCurrent:"已收到当前项目的端云接力请求",requestHelp:"复制接力提示词后,Codex 的请求会显示在这里。",entering:"正在进入",enterCodex:"进入 Codex",clipboardUnsupported:"当前浏览器不支持写入剪贴板。",steps:{request:"等待端侧请求",session:"创建云端 Session",restore:"恢复项目",continue:"发送续跑任务"},status:{issued:"等待请求",creating:"正在创建 Session",sessionCreated:"正在迁移项目",continuing:"正在启动云端任务",running:"云端执行中",completed:"接力完成",failed:"接力失败"}},Rwe={model:{description:"显示或切换当前对话模型",keywords:"模型 switch"},models:{description:"列出 app-server 可用模型",keywords:"模型列表 list"},skill:{description:"浏览并调用当前工作区可用的 Skill",keywords:"技能 workflow"},skills:{description:"浏览并调用当前工作区可用的 Skills",keywords:"技能列表 workflow list"},new:{description:"开始一个新对话",keywords:"新建 对话"},resume:{description:"打开历史会话或恢复指定 Thread",keywords:"历史 恢复 session"},fork:{description:"从当前上下文分叉一个新对话",keywords:"分叉 branch"},compact:{description:"压缩当前对话上下文",keywords:"压缩 上下文"},archive:{description:"归档当前对话并新建对话",keywords:"归档 关闭"},status:{description:"显示当前连接、Thread、模型与 Token 状态",keywords:"状态 连接 token"},clear:{description:"清空当前视图并开始新对话",keywords:"清空 重置"},help:{description:"显示 Sandbox 支持的快捷命令",keywords:"帮助 命令"},currentModel:"当前模型",availableModel:"可用模型",workspace:"工作空间",notSet:"未设置",modelLabel:"模型",statusLabel:"状态",running:"运行中",idle:"空闲",totalTokens:"累计 Token",contextWindow:"上下文窗口",imageFallback:"图片",unknown:"未知快捷命令:{{command}}。输入 /help 查看可用命令。",automaticSkills:"智能开发模式会自动使用开发能力,无需手动选择 Skill。",activity:{new:"已新建 Codex 对话",resumed:"已恢复 Codex 对话",deleted:"已删除 Codex 历史会话",modelChanged:"已切换 Codex 模型",availableModels:"Codex 可用模型",noModels:"当前没有可用模型",forked:"已分叉 Codex 对话",compacting:"已开始压缩当前 Codex 对话",archived:"已归档 Codex 对话",status:"Codex 当前状态",help:"Sandbox 支持的 Codex 快捷命令"}},Iwe={label:"智能构建任务",queued:"构建任务已排队",running:"构建任务正在后台运行",recovering:"正在恢复构建任务",waiting_user:"构建任务需要继续处理",stopping:"正在停止构建任务",succeeded:"构建任务已完成",cancelled:"构建任务已停止",failed:"构建任务未完成",open:"返回任务",hide:"隐藏任务通知",reconnecting:"正在重新连接任务服务,已有任务继续保留。"},Pwe={common:xwe,tool:wwe,threads:Owe,permissions:kwe,workspace:Swe,approval:Ewe,composer:Cwe,launch:Awe,session:Twe,agentDetails:_we,agentWorkspace:jwe,handoff:Nwe,commands:Rwe,taskNotice:Iwe},UVe=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:_we,agentWorkspace:jwe,approval:Ewe,commands:Rwe,common:xwe,composer:Cwe,default:Pwe,handoff:Nwe,launch:Awe,permissions:kwe,session:Twe,taskNotice:Iwe,threads:Owe,tool:wwe,workspace:Swe},Symbol.toStringTag,{value:"Module"})),Dwe={retry:"重试",signInToContinue:"登录以继续使用",signInWith:"使用 {{provider}} 登录",enterUsername:"输入一个用户名即可开始",usernamePlaceholder:"用户名(字母 + 数字,最多 16 位)",enter:"进入",usernameInvalid:"只能包含大小写字母和数字,最多 16 位。",identityProvider:{volcengine:"火山引擎 Identity",byteplus:"BytePlus Identity"},powered:{volcengine:"火山引擎 AgentKit 提供企业级 Agent 解决方案",byteplus:"BytePlus AgentKit 提供企业级 Agent 解决方案"},legalPrefix:"继续即表示你已阅读并同意 AgentKit",terms:"产品和服务条款",copyright:"© {{year}} VeADK。保留所有权利。"},Mwe={title:"登录状态已过期",description:"当前编辑内容会保留。重新登录后,刚才的操作将自动继续。",waiting:"等待登录完成…",signInAgain:"重新登录"},Lwe={breadcrumbs:"面包屑",selectAgent:"选择 Agent",switchAgent:"切换智能体"},$we={cancel:"取消",close:"关闭确认框"},QVe={login:Dwe,authExpired:Mwe,navbar:Lwe,confirm:$we},zVe=Object.freeze(Object.defineProperty({__proto__:null,authExpired:Mwe,confirm:$we,default:QVe,login:Dwe,navbar:Lwe},Symbol.toStringTag,{value:"Module"})),Fwe={defaultUser:"用户",shortcuts:"快捷入口",tryCli:"体验 AgentKit CLI",developerResources:"开发者资源",systemInfo:"系统信息",language:"语言",issueFeedback:"问题反馈",logout:"退出登录",roles:{admin:"管理员",developer:"开发者",user:"普通用户",super_admin:"超级管理员"}},Bwe={home:"返回首页",expand:"展开侧边栏",collapse:"收起侧边栏",label:"主导航",newChat:"新会话",agents:"智能体",workspaces:"工作区",library:"资源库",cronjobs:"定时任务",automations:"自动化",users:"用户管理",administration:"管控",reviewCenter:"审核中心"},Uwe={title:"历史会话",newConversation:"新会话",create:"新建会话",loading:"正在加载历史会话…",empty:"暂无会话",current:"当前",manage:"管理历史会话:{{title}}",more:"更多",delete:"删除",loadingMore:"加载中…",loadMore:"加载更多",evaluatingTitle:"正在自动评测",evaluating:"评测中",generating:"正在生成"},VVe={account:Fwe,navigation:Bwe,history:Uwe},HVe=Object.freeze(Object.defineProperty({__proto__:null,account:Fwe,default:VVe,history:Uwe,navigation:Bwe},Symbol.toStringTag,{value:"Module"})),Qwe={placeholder:"请选择",collapseOptions:"收起模型选项",expandOptions:"展开模型选项",noOptions:"暂无可用选项",noMatches:"没有匹配项,可直接使用当前模型 ID"},zwe={unsupportedActivity:"不支持的 Skill 对话活动",ariaLabel:"Skill 生成对话"},Vwe={code:"错误码:{{code}}",type:"错误类型:{{type}}",representation:"异常表示:{{value}}",rawResponse:`服务端原始响应: {{value}}`,original:"原始错误:{{message}}",details:"详细信息"},Hwe={ariaLabel:"Skill 文件树",viewSource:"查看源码",viewPreview:"查看预览",download:"下载",binaryFile:"二进制文件",bytes:"{{value}} 字节",binaryDescription:"当前接口仅返回文件元数据,可单独下载原文件。",metadata:"Skill 元数据",noFiles:"暂无文件"},qwe={close:"关闭",name:"名称",region:"地域",optionalDescription:"描述(可选)",cancel:"取消",create:"创建",creating:"创建中…",save:"保存",saving:"保存中…",upload:"上传",uploading:"上传中…",createSpaceTitle:"新建 Skill 空间",editSpaceTitle:"编辑 Skill 空间",uploadTitle:"上传到 {{name}}",createSpaceFailed:"创建 Skill 空间失败",updateSpaceFailed:"更新 Skill 空间失败",archiveValidationFailed:"Skill ZIP 格式校验失败",uploadFailed:"上传 Skill 失败",dropzone:"拖拽 Skill ZIP 到这里",chooseLocalFile:"或点击选择本地文件",archiveHelp:"ZIP 根目录需要包含 SKILL.md,也可以只包含一层包装目录。选择后仅检查格式,不会自动上传。",validating:"正在检查文件格式…",validationPassed:"格式检查通过:{{name}},共 {{count}} 个文件"},Wwe={styles:{concise:"简洁实用",strict:"严谨稳健",tutorial:"教程友好",automation:"自动化优先",custom:"自定义",customFallback:"自定义风格"},stages:{preparing:"正在准备 Dev Sandbox",ready:"Skill 已生成并通过格式校验",failed:"生成失败",cancelled:"已停止",validating:"正在校验 Skill 格式",packaging:"正在整理文件",generating:"正在生成 Skill",repairingAgain:"正在再次修复",autoRepairing:"正在自动修复({{attempt}}/{{max}})"},validation:{fallback:"Skill 格式校验未通过",repairInstruction:"只修复下面列出的 Skill 格式错误,不要改变原有用途和内容范围。",recheckInstruction:"修复后重新检查目录结构、SKILL.md frontmatter 和所有文本文件。",nameTooLong:"Skill 名称不能超过 64 个字符",invalidName:"Skill 名称只能包含小写字母、数字和连字符",modelTooLong:"模型 ID 不能超过 128 个字符",invalidModel:"模型 ID 只能包含字母、数字、点、下划线、连字符、斜杠和冒号"},errors:{loadCapability:"读取 Dev Sandbox 配置失败",autoRepair:"自动修复格式错误失败",pollCandidate:"读取候选方案状态失败,正在重试",createCandidate:"创建候选方案失败",refine:"继续调整失败",repairAgain:"再次修复格式错误失败",selectSpace:"请选择上传的 Skill Space",unsupportedRegion:"当前 Skill 地域不受支持",upload:"上传 Skill 失败",download:"下载失败"},sessionMax:"Session 最长保留 1 小时",remaining:"剩余 {{minutes}}:{{seconds}}",unnamedSpace:"未命名 Skill Space",leaveConfirmation:"离开后将停止并释放正在运行的 Dev Sandbox,确定离开吗?",createTitle:"创建技能",optimizeTitle:"优化 {{name}}",skillFallback:"技能",back:"返回技能空间",home:"主页技能生成",basicInfo:"基本信息",goal:"目标",createIntentPlaceholder:"描述希望这个 Skill 完成什么任务",optimizeIntentPlaceholder:"描述希望如何优化当前 Skill",skillName:"Skill 名称",autoNamePlaceholder:"留空时自动生成",nameHelp:"仅支持小写字母、数字和连字符;留空时自动生成。",createPlans:"生成方案",optimizePlans:"优化方案",createPlansDescription:"按不同方案并行生成多个技能,您可以选择最佳结果",optimizePlansDescription:"按不同方案并行优化当前技能,您可以选择最佳结果",plan:"方案 {{count}}",remove:"移除",model:"模型",modelPlaceholder:"选择或输入模型 ID",style:"风格",customStyle:"自定义风格",customStylePlaceholder:"描述表达方式、严谨程度或输出偏好",addConfiguration:"添加配置",notConfigured:"管理员未配置",generate:"生成",candidates:"候选方案",progress:"进度",retryCandidate:"重试此方案",formatValidationFailed:"格式校验未通过",repairAgain:"再次修复",files:"文件",downloadZip:"下载 ZIP",loadingFiles:"正在读取文件…",filesPending:"生成过程中会在这里显示完整文件树",uploadToSpace:"上传到 Skill Space",loadingSpaces:"正在加载 Skill Space",selectSpace:"选择 Skill Space",continuePlaceholder:"继续调整这个候选方案",continue:"继续调整",uploading:"上传中…",overwrite:"覆盖原 Skill",uploadToSelectedSpace:"上传到 Skill Space",uploadToCurrentSpace:"上传到当前空间",allCandidatesFailed:"所有方案均创建失败,可分别重试。"},Kwe={invalidFormat:"{{label}}格式错误。",recoveryStatus:"Skill 恢复点状态",errorResponse:"错误响应",errorDetails:"错误详情",missingContentType:"Content-Type 缺失",gatewayError:"{{fallback}}(HTTP {{status}},Content-Type: {{contentType}})。请检查代理或网关配置。",nonJson:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}},Content-Type: {{contentType}}),请检查代理或网关配置。",activity:"Skill 会话活动",invalidActivity:"Skill 会话活动格式错误。",invalidToolActivity:"Skill 工具活动格式错误。",invalidTextActivity:"Skill 文本活动格式错误。",publication:"Skill 发布结果",task:"Skill 会话",file:"Skill 文件",unknownTaskState:"Skill 会话状态无法识别。",capability:"Skill 工作台能力",loadCapability:"读取 Skill 工作台能力失败",prepareTask:"准备 Skill 会话失败",taskReference:"Skill 会话引用",startOptimization:"开始优化 Skill 失败",startTask:"开始 Skill 会话失败",taskSummary:"Skill 会话摘要",taskList:"Skill 会话列表",loadTaskList:"读取 Skill 会话列表失败",invalidTaskList:"Skill 会话列表格式错误。",loadTask:"读取 Skill 会话失败",artifact:"Skill 产物",artifactFile:"Skill 产物文件",loadArtifact:"读取 Skill 产物失败",refine:"继续调整 Skill 失败",stop:"停止当前 Skill 任务失败",publish:"发布 Skill 失败",nonNdjson:"发布 Skill 失败:服务端返回了非 NDJSON 响应。",missingStream:"发布 Skill 失败:服务端没有返回进度流。",publishProgress:"发布进度",invalidPublishProgress:"发布进度格式错误。",publishError:"发布错误",unknownPublishEvent:"未知的发布进度事件。",publishResult:"发布结果",streamEnded:"发布进度流提前结束,无法确认发布结果。请刷新技能中心确认状态。",deleteTask:"删除 Skill 会话失败",download:"下载 Skill 失败"},Gwe={configSelect:Qwe,conversation:zwe,errorDetails:Vwe,fileTree:Hwe,management:qwe,generation:Wwe,api:Kwe},qVe=Object.freeze(Object.defineProperty({__proto__:null,api:Kwe,configSelect:Qwe,conversation:zwe,default:Gwe,errorDetails:Vwe,fileTree:Hwe,generation:Wwe,management:qwe},Symbol.toStringTag,{value:"Module"})),Xwe={back:"返回上一页",reload:"重新加载",notConfigured:"未配置",name:"名称",description:"描述",delete:"删除",save:"保存",saving:"保存中",add:"添加",manage:"管理",environment:"环境",noDescription:"暂无描述",refresh:"刷新",close:"关闭",retry:"重试",loading:"加载中…",previousPage:"上一页",nextPage:"下一页",edit:"编辑",all:"全部",search:"搜索",cancel:"取消",view:"查看",viewDetails:"查看详情",deleting:"删除中…",create:"创建",creating:"创建中",adding:"添加中",generating:"生成中",uploading:"上传中",preview:"预览",loadFailed:"加载失败",select:"选择",collapse:"收起",expand:"展开",none:"无"},Ywe={ariaLabel:"AgentKit 快速入口",closeAriaLabel:"关闭 AgentKit 欢迎卡片",title:"欢迎使用 AgentKit",description:"通过 AgentKit 平台快速构建与托管您的企业级智能体",docsAriaLabel:"打开 AgentKit 文档,在新窗口打开",docs:"文档",consoleAriaLabel:"打开 AgentKit 控制台,在新窗口打开",console:"控制台"},Zwe={checkUpdates:"检查更新",checkingVersions:"正在检查版本…",versionCheckError:"查询沙箱版本失败,请检查凭据、区域及接口权限后重试",sandboxUpdateError:"Sandbox 更新失败,请刷新检查实际状态后重试",modelEnvRepairUnavailable:"无法补齐模型环境变量,请检查 CODEX_API_KEY 和 CODEX_BASE_URL",updateSandbox:"更新{{variant}}{{name}}",updatingSandbox:"更新中",title:"系统信息",description:"查看当前 Studio 版本及关联的基础资源",general:"通用",currentVersion:"当前版本",storage:"存储",loadingStorage:"正在加载存储信息",tosAddress:"TOS 地址",openTosConsole:"在云控制台中打开 TOS 存储桶",environmentBuild:"环境构建",loadingEnvironmentResources:"正在加载环境构建资源",environmentResourcesError:"环境构建资源加载失败,请检查云凭据后重试。",codePipelineWorkspace:"CodePipeline 工作空间",codePipelinePipeline:"CodePipeline 流水线",openCodePipelineWorkspace:"在云控制台中打开 CodePipeline Workspace",createdOnFirstBuild:"首次构建时自动创建",containerRegistryRepository:"Container Registry 仓库",openContainerRegistryRepository:"在云控制台中打开 Container Registry 仓库",sandboxInfo:"沙箱信息",loadingSandboxInfo:"正在加载沙箱信息",sandboxInfoError:"沙箱信息加载失败,请重试。",snapshot:"快照版",snapshotWithSpace:"快照版 ",openToolConsole:"在云控制台中打开{{name}}",updateModelEnv:"更新{{variant}}{{name}}模型环境变量",modelEnvUpdated:"已更新",modelEnvAlreadyCurrent:"无需更新",userPool:"用户池",loadingUserPool:"正在加载用户池",userPoolError:"用户池加载失败,请重试。",modelEnvUpdateError:"模型环境变量更新失败,请重试。",openUserPoolConsole:"在云控制台中打开用户池{{name}}",unnamedUserPool:"未命名用户池",id:"ID",domain:"域名",region:"区域",noLocalUserPool:"本地模式未配置用户池",noUserPool:"当前 Studio 未配置用户池"},Jwe={workspace:"Agent 工作区",library:"Agent 库",evaluation:"评测",agentList:"Agent 列表",agentDetails:"Agent 详情",newAgent:"新建 Agent",loading:"加载中…",loadingCloudAgents:"正在加载云端 Agent…",noAgentSelected:"请选择一个 Agent",local:"本地",remote:"云端",localAgent:"本地 Agent",remoteAgent:"云端 Agent",agentCount:"{{count}} 个 Agent",agentCountLabel:"Agent 数量",details:"详情",chat:"对话",update:"更新",backToAgentList:"返回 Agent 列表",loadingAgent:"正在加载 Agent",loadingAgentDescription:"正在读取 Agent 配置和 Runtime 信息。",loadingAgentInfo:"正在加载 Agent 信息…",detailLoadFailed:"无法加载 Agent 详情",detailLoadFailedDescription:"请检查 Runtime 状态后重试。",partialInfoUnavailable:"部分信息暂时不可用",upgradeRuntimeForDetails:"请升级 Runtime 以查看完整 Agent 信息。",basicInfo:"基本信息",usageOverview:"使用概览",sections:{basic:"基本信息",profileConfig:"Profile 配置",sessionConfig:"会话配置",usage:"使用概览",diagnostics:"诊断",evaluations:"评测",optimizations:"优化建议",integrations:"集成",versions:"版本",channels:"消息渠道"},evaluationGroup:"评测组",optimizations:"优化建议",optimizationsDescription:"根据评测结果查看可执行的优化建议。",integrations:"集成",githubVersions:"GitHub 版本",githubVersionsDescription:"查看持续交付产生的版本并创建回退 PR。",currentVersionOnly:"当前未启用 GitHub 持续交付,仅展示当前生产版本。",loadingVersions:"正在加载版本…",noVersion:"暂无版本记录",prLink:"Pull Request",viewPr:"查看 PR",author:"提交人",publishStatus:"发布状态",viewRelease:"查看发布记录",rollbackToVersion:"回退到此版本",rollingBack:"正在创建回退…",rollbackEvent:"回退事件",sourceMergedRuntimeStill:"最新源码已合并,但 Runtime 仍处于",currentProductionVersionHint:";当前生产版本保持不变。",usageSummary:"使用统计",totalCalls:"总调用次数",userCount:"用户数",userDetails:"用户明细",usageUserList:"Agent 使用用户列表",user:"用户",callCount:"调用次数",lastUsed:"最近使用",unknownUser:"未知用户",loadingUsage:"正在加载使用数据…",refreshing:"刷新中…",noUsage:"暂无使用记录",usageUnavailable:"当前 Agent 暂无可用的使用统计。",usagePagination:"使用记录分页",pageOf:"第 {{page}} / {{total}} 页",notProvided:"暂未提供",integrationMethods:"集成方式",integrationDescription:"通过 Runtime API 或 A2A 协议集成当前 Agent。",integrationProtocol:"集成协议",runtimeStatus:"Runtime 状态",executionFlow:"执行流程",probingIntegration:"正在检测集成能力",probingIntegrationDescription:"正在读取可用端点和鉴权配置。",configurationStatus:"配置状态",discoveryEndpoint:"发现端点",invocationEndpoint:"调用端点",invocationUrl:"调用地址",authentication:"鉴权方式",networkAccess:"网络访问",notAvailable:"暂无",noAuthentication:"无需鉴权",noApiKeyRequired:"无需 API Key",usesOauthJwt:"使用 OAuth / JWT",showApiKey:"显示 API Key",hideApiKey:"隐藏 API Key",pythonExample:"Python 示例",deploymentConfig:"部署配置",deploymentConfigDescription:"确认实例和运行配置后更新 Runtime。",deploymentRegion:"部署区域",mpaControlPlane:"MPA 控制面",loadingMpaAgentView:"正在读取 MPA Runtime 绑定…",mpaRuntimeBound:"该 MPA Agent 已绑定唯一 Runtime,可继续管理。",mpaRuntimeMissing:"当前 Agent 没有可见的 MPA Runtime 绑定。",mpaRuntimeBindingAmbiguous:"多个 MPA Runtime 匹配当前 Agent,请先修复绑定后再修改。",mpaRuntimeOrphan:"Runtime 存在,但其中没有当前 MPA Profile。",mpaRuntimeLegacyAuthUnsupported:"该 Runtime 使用旧版 MPA 镜像,仍要求 X-Jwt-Token。请先更新到当前 AgentKit 兼容镜像,再管理 Profile 或 Session 配置。",profileConfig:"Profile 配置",profileConfigTitle:"Profile 配置",profileConfigDescription:"查看并应用 Agent 级 MPA Profile。Profile 是 Runtime 的长期默认配置,新会话默认继承它。",profileStatus:"Profile 状态",profileApplied:"已应用",profileNotApplied:"未应用",profileNotAppliedDescription:"当前 Runtime 可运行,但尚未保存为 Studio 可管理的 Profile。应用后会生成 Profile revision。",applyProfile:"应用 Profile",reapplyProfile:"重新应用 Profile",editProfile:"编辑 Profile",profileApplying:"应用中…",profileAppliedNotice:"Profile 已应用,当前 revision 为 {{revision}}。",profileApplyIncomplete:"Profile 应用未完成,请查看当前操作状态后重试。",profileApplyFailed:"Profile 应用失败。",profilePrompt:"系统提示词",profileResources:"资源配置",profileResourceSummary:"{{tools}} 个工具 · {{skills}} 个 Skill · {{mcp}} 个 MCP 服务",sessionConfigTitle:"会话配置",sessionConfigDescription:"查看和调整当前 MPA Session 的执行配置。变更只对下一轮对话生效。",loadingSessionConfig:"正在加载会话配置…",sessionConfigNoAgent:"请选择一个 MPA Agent 后再管理会话配置。",sessionConfigNonMpa:"会话配置仅适用于 MPA Agent。",sessionConfigNoSession:"请先打开这个 MPA Agent 的对话,再修改会话配置。",sessionConfigDifferentRuntime:"请先切回这个 MPA Agent 的当前对话,再修改会话配置。",sessionConfigSaved:"会话配置已更新,下一轮对话将使用新 revision。",sessionConfigStale:"该 Session 已被其他位置修改,已展示最新配置,请确认后再保存。",sessionConfigRevision:"配置 revision",sessionProfileRevision:"Session Profile revision",latestProfileRevision:"最新 Profile revision",sessionProfileUpgradeAvailable:"检测到新的 Profile revision:v{{current}} → v{{target}}。",upgradeSessionProfile:"升级 Session Profile",sessionProfileUpgrading:"升级中…",sessionProfileUpgraded:"Session Profile 已升级,下一轮对话将使用新 revision。",sessionProfileUpgradeFailed:"Session Profile 升级失败。",sessionModelOverride:"模型覆盖",modelId:"模型 ID",inheritProfileDefault:"继承 Profile 默认值",sessionMcpServers:"MCP 服务",mcpServerCount:"已选择 {{count}} 个",clearSessionMcp:"清空 MCP 服务",mpaDiagnosticsTitle:"Runtime 诊断",mpaDiagnosticsDescription:"查看最近的 Runtime Console 运行记录,以及 Agent、Profile、Turn、task 和 worker 关联。",loadingMpaDiagnostics:"正在加载 Runtime 诊断…",noMpaDiagnostics:"当前 Session 暂无 Runtime 诊断运行记录。",latestRun:"最近运行",traceCorrelation:"Trace 关联",traceCorrelationDescription:"Runtime Console 为本次 invocation 返回的稳定标识。",traceSteps:"Trace 步骤",traceStepsDescription:"当前 invocation 最近的有界 Runtime Console 步骤。",mpaInstanceId:"MPA 实例",turnId:"Turn ID",taskId:"Task ID",workerKind:"Worker 类型",workerSession:"Worker Session",workerTurn:"Worker Turn",workerProfile:"Worker Profile",workerProfileVersion:"Worker Profile 版本",step:"步骤",stepCount:"步骤数",duration:"耗时",noTraceSteps:"本次 invocation 暂无 trace 步骤。",executionConfigMode:{replace:"Session 覆盖",clear:"本 Session 已清空",inherit:"使用 Profile 默认值"},concurrency:"并发数",selectedOptimizations:"已选优化项",selectedOptimizationsDescription:"这些优化会应用到本次更新。",optimizationProfile:"优化方案",updatePending:"等待更新",updatingDeployment:"正在更新部署",restoringUpdateConfig:"正在恢复更新配置…",updateConfigUnavailable:"无法读取更新配置",legacyConfigMissing:"旧版本 Runtime 缺少可恢复的配置,请重新创建。",deploymentFailed:"部署失败",continueEditing:"继续编辑",loadingOptimizations:"正在加载优化建议…",noOptimizations:"暂无优化建议",fixPriority:"优先级",suggestedModule:"建议模块",suggestionAndReason:"建议与原因",priority:{high:"高",medium:"中",low:"低"},modules:{agentStructure:"Agent 结构",prompt:"提示词",tool:"工具",knowledge:"知识库",memory:"记忆",workflow:"工作流",other:"其他"},evaluationGroupList:"评测组列表",newEvaluationGroup:"新建评测组",newEvaluationGroupName:"新评测组 {{count}}",searchEvaluationGroups:"搜索评测组",noMatchingEvaluationGroups:"没有匹配的评测组",noEvaluationGroupSelected:"请选择一个评测组",groupStats:"{{agents}} 个 Agent · {{runs}} 次运行",evaluationGroupDetails:"评测组详情",evaluationGroupStats:"{{agents}} 个 Agent · {{caseSet}} · {{runs}} 次运行",startEvaluation:"开始评测",evaluationConfig:"评测配置",historyResults:"历史结果",participatingAgents:"参与 Agent",selectedCount:"已选择 {{count}} 个",evaluationResources:"评测资源",evaluationSet:"评测集",evaluator:"评估器",caseCount:"{{count}} 条案例",evaluationMetrics:"评测指标",selectedMetricCount:"已选择 {{count}} 项",historyDescription:"查看每次评测的分数和运行状态。",noHistory:"暂无评测历史",noHistoryDescription:"运行一次评测后,结果会显示在这里。",evaluationRun:"第 {{index}} 次评测",evaluationRunMeta:"{{time}} · {{agents}} 个 Agent",overallScore:"综合分",completed:"已完成",evaluationDefaults:{coreRegression:"核心能力回归",safetyCheck:"安全与幻觉检查",coreSet:"核心回归集",safetySet:"安全边界集",toolSet:"工具调用集",qualityEvaluator:"综合质量评估器",factualEvaluator:"事实一致性评估器",toolEvaluator:"工具调用评估器",responseQuality:"回答质量",factualAccuracy:"事实准确性",toolUse:"工具调用",responseEfficiency:"响应效率",todayTime:"今天 10:32",yesterdayTime:"昨天 16:08",julyTime:"7 月 25 日 14:20",justNow:"刚刚"},defaultCases:{agentName:"示例 Agent",goodSetName:"示例正向案例集",badSetName:"示例负向案例集",weeklyFeedback:{input:"总结本周客户反馈,并按优先级归类。",output:"覆盖主要问题,给出清晰的优先级与下一步动作。",tag:"总结",reason:"任务完整覆盖了用户目标,输出结构清晰,并给出了可执行的下一步动作。"},research:{input:"查询最新公开资料并附上来源。",output:"调用搜索工具,结论与引用一一对应。",tag:"工具调用"},uncertainConclusion:{input:"在信息不足时直接给出确定结论。",output:"应明确说明未知,并主动询问缺失信息。",tag:"幻觉",reason:"信息不足时仍给出了确定结论,缺少必要的澄清步骤与不确定性说明。"},repeatedTool:{input:"连续重复调用相同工具获取同一结果。",output:"复用已有结果,避免无意义的重复调用。",tag:"效率"}},goodCases:"正向案例",badCases:"负向案例",goodCase:"正向案例",badCase:"负向案例",reference:"参考答案",caseResultFilter:"案例结果筛选",feedbackSourceFilter:"反馈来源筛选",searchCases:"搜索案例",searchCasesPlaceholder:"搜索输入、输出或标签",selectCases:"选择案例",selectAll:"全选",selectAllVisible:"选择当前可见案例",selectedCaseCount:"已选择 {{count}} 条",deleteSelected:"删除所选",deleteSelectedTitle:"删除所选 Agent",deleteSelectionDescription:"确定删除所选的 {{count}} 个项目吗?此操作无法撤销。",deleteCasesConfirm:"删除所选案例",deleteOneCaseConfirm:"删除这个案例",deleteFeedbackCase:"删除反馈案例",noFeedbackCases:"暂无反馈案例",noMatchingCases:"没有匹配的案例",loadingEvaluationSet:"正在加载评测集…",userInput:"用户输入",agentOutput:"Agent 输出",score:"得分",scoreReason:"评分原因",noUserInput:"暂无用户输入",noVisibleResponse:"暂无可见回复",note:"备注:",manualFeedback:"人工反馈",automaticFeedback:"自动反馈",scoreValue:"{{score}} 分",unknownTime:"时间未知",deleteAgentTitle:"删除 Agent",deleteAgentDescription:"确定删除 Agent“{{name}}”吗?",deleteDraftDescription:"确定删除草稿“{{name}}”吗?",deleteAgent:"删除 Agent",closeDeleteConfirmation:"关闭删除确认",mpaDeletePreviewSummary:"Studio 会先删除可见的空闲 MPA Runtime 会话,再删除 AgentKit Runtime。运行中的任务需要先结束或停止后才能删除。",mpaDeletePreviewSessions:"会话",mpaDeletePreviewActiveSessions:"运行中",mpaDeletePreviewIdleSessions:"空闲",mpaDeleteBlocked:"当前无法删除",mpaDeleteBlockerActiveOperation:"仍有 MPA 创建或更新操作在执行。",mpaDeleteBlockerActiveSessions:"Runtime 中仍有运行中的会话。",mpaDeleteBlockerBindingAmbiguous:"当前 Agent 匹配到多个 MPA Runtime。",mpaDeleteBlockerRuntimeMissing:"当前 MPA Agent 没有可见的 Runtime 绑定。",mpaDeleteBlockerOrphanRuntime:"Runtime 可见,但其中缺少当前 MPA Profile。",mpaDeleteStage:{runtime_sessions:"删除 {{count}} 个可见空闲 Runtime 会话",runtime_diagnostics:"清理这些会话关联的诊断数据和挂载元信息",agentkit_runtime:"删除 AgentKit Runtime"},draftDeletionWarning:"草稿将从当前浏览器中删除。",runtimeDeletionWarning:"Runtime 和相关云端资源将被删除。",noneSelected:"尚未选择",none:"无",notPublished:"未发布",notRecorded:"未记录",noTime:"暂无时间",noPr:"暂无 PR",comingSoon:"评测能力即将开放",preparing:"准备中",cancelled:"已取消",failed:"失败",totalCount:"共 {{count}} 条",deploymentProgress:"部署进度",returnToEdit:"返回编辑",retryOperation:"重试操作",buildLog:"构建日志",githubMountLog:"GitHub 挂载日志",githubDeliveryMountLog:"GitHub 持续交付挂载日志",waitingBuildLog:"正在等待构建日志…",waitingGithubMountLog:"正在等待 GitHub 挂载日志…",copy:"复制",copied:"已复制",copyLabel:"复制{{label}}",copiedLabel:"已复制{{label}}",logLines:"{{count}} 行",logStatus:{synced:"已同步",failed:"读取失败",syncing:"同步中",earlyOmitted:"已省略早期日志",recentOnly:"仅显示最近的构建日志",partiallyOmitted:"已省略部分日志"},deployStatus:{running:"正在部署",unconfirmed:"部署状态待确认",success:"部署完成",error:"部署失败",cancelled:"部署已取消"},deploymentSteps:{prepare:{label:"准备部署",description:"校验配置并创建部署任务"},build:{label:"构建镜像",description:"生成运行环境与智能体代码"},deploy:{label:"部署服务",description:"创建并启动 AgentKit Runtime"},publish:{label:"发布服务",description:"等待服务就绪并生成访问地址"},complete:{label:"部署完成",description:"智能体已可以正常使用"},evaluation:{label:"创建评测集",description:"自动创建 Good Case 和 Bad Case 评测集"},profileApplying:{label:"应用 MPA 配置",description:"将 Studio Agent 配置写入 MPA Runtime"},smokeRunning:{label:"验证 MPA Runtime",description:"在标记可运行前执行 Runtime 就绪验证"},runnable:{label:"MPA Runtime 可运行",description:"Runtime 已接受配置并通过执行就绪验证"},github:{label:"挂载 GitHub 持续交付",description:"初始化目标分支与 GitHub Actions workflow"},update:{label:"更新实例配置",description:"将 Runtime 实例数调整为 {{min}}~{{max}}"}},githubStatus:{published:"已发布",publishing:"发布中",failed:"发布失败",pending:"等待发布",unknown:"未知"},errors:{agentInfoMissing:"Agent 信息不可用",checkUpdateCapability:"无法检查更新能力",checkingUpdateConfig:"正在检查更新配置",cloudOnlyUpdate:"仅云端 Agent 支持更新",deleteDeployedUnsupported:"当前不支持删除已部署 Agent",deleteDraftUnsupported:"当前不支持删除草稿",loadMpaDeletePreview:"无法加载 MPA 删除预览",loadAgentInfo:"无法加载 Agent 信息",loadApiKey:"无法读取 API Key",loadGithubVersions:"无法加载 GitHub 版本",loadEvaluations:"无法加载评测案例",loadMpaAgentView:"无法加载 MPA Agent 状态",loadMpaDiagnostics:"无法加载 Runtime 诊断",loadOptimizations:"无法加载优化建议",loadRuntimeDetails:"无法加载 Runtime 详情",loadSessionConfig:"无法加载会话配置",loadUsage:"无法加载使用数据",noCreatePermission:"当前账号没有创建 Agent 的权限",noManagePermission:"当前账号没有管理此 Agent 的权限",originalConfigUnavailable:"原始配置不可用",probeIntegration:"无法检测集成能力",rollbackVersion:"无法创建版本回退",runtimeRegionMissing:"Runtime 区域信息缺失",updateCapabilityMismatch:"Runtime 更新能力与当前配置不匹配",updateCapabilityPending:"Runtime 更新能力仍在确认中",updateConfigRestoring:"正在恢复更新配置",updateUnsupported:"当前 Runtime 不支持更新",usageMismatch:"返回的使用数据与当前 Agent 不匹配"}},e1e={title:"环境",loadFailed:"环境加载失败,请检查存储配置后重试。",storageUnavailable:"管理员未配置持久化存储,环境管理暂不可用。",create:"新建环境",configure:"配置环境",details:"环境详情",editorDescription:"配置运行环境,或接入代码仓库和已有镜像",backToList:"返回环境列表",save:"保存环境",createAndBuild:"创建并构建",saveAndBuild:"保存并构建",name:"环境名称",namePlaceholder:"Python 数据处理",descriptionPlaceholder:"说明这个环境适合处理的任务",creationMethod:"创建方式",baseConfiguration:"基础配置",baseEnvironment:"基础环境",operatingSystem:"操作系统",pythonVersion:"Python 版本",fixedByBase:"由 {{base}} 固定为 {{value}}",selectUbuntuVersion:"选择基础镜像的 Ubuntu 版本",selectPythonVersion:"选择需要安装的 Python 版本",skills:"技能",addSkill:"添加环境技能",veadkDescription:"Agent 开发与运行框架",customDockerfile:"自定义 Dockerfile",presetEnvironment:"预制环境",presetHint:"选择“无”可自行填写 Dockerfile 第一行的基础镜像。",dockerfileSize:"{{size}} / {{max}} 字节",upload:"上传",reset:"重置",dockerfileBaseImage:"Dockerfile 基础镜像",dockerfileContent:"Dockerfile 内容",region:"区域",search:"搜索环境",manualImport:"手动导入",noMatches:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称",startBuild:"开始构建",build:"构建",unnamed:"未命名环境",listSeparator:"、",clipboardReadError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。",creation:{custom:{label:"自定义配置",description:"通过表单选择基础环境、Python、工具和技能"},dockerfile:{label:"自定义 Dockerfile",description:"上传或直接编辑 Dockerfile"},git:{label:"从代码仓库构建",description:"探查公开仓库并通过 CodePipeline 构建"},image:{label:"使用已有镜像",description:"绑定由外部流水线交付的 CR 镜像"}},baseDescriptions:{"aio-sandbox":"内置 Sandbox Shell 能力 · Ubuntu 22.04","codex-sandbox":"内置 Codex CLI、浏览器与代码执行环境",ubuntu:"标准 Linux 基础镜像"},dockerfileValidation:{baseImageRequired:"请填写基础镜像。",duplicateFrom:"基础镜像已固定在第一行,请删除 Dockerfile 正文中的 FROM 指令。",tooLarge:"Dockerfile 不能超过 128 KiB。",empty:"Dockerfile 内容不能为空。",missingFrom:"Dockerfile 缺少 FROM 指令。"},presets:{none:"自行填写 Dockerfile 基础镜像",aio:"内置 Sandbox Shell 与常用运行时",codex:"内置 Codex CLI、浏览器与代码执行环境"},categories:{tools:"工具",productivity:"效率",browser:"浏览器自动化",system:"系统与媒体"},options:{"lark-cli":"飞书开放平台命令行工具",pandoc:"文档格式转换工具",opencli:"将网站与桌面应用转换为命令行工具",uv:"快速 Python 包与项目管理器",ripgrep:"高性能文本检索工具",jq:"JSON 查询与转换工具","github-cli":"在终端中管理 GitHub 工作流",playwright:"浏览器自动化与端到端测试",chromium:"无头浏览器运行时",git:"代码版本管理",curl:"网络请求与文件下载",ffmpeg:"音视频转码与处理",imagemagick:"图片转换与批处理"},duration:{seconds:"{{count}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",hoursMinutes:"{{hours}} 小时 {{minutes}} 分"},buildStatus:{preparing:"准备中",queued:"排队中",building:"构建中",scanning:"扫描中",available:"可用",failed:"构建失败",notBuilt:"未构建"},manifest:{title:"环境 Manifest",closeLabel:"关闭环境 Manifest",loading:"正在加载 Manifest",editorLabel:"环境 Manifest YAML",copyFailed:"复制失败,请重试",copied:"已复制",copy:"复制 Manifest",view:"查看环境 Manifest",viewShort:"查看 Manifest",unavailable:"尚无可用 Manifest"},buildDetails:{title:"构建详情",closeLabel:"关闭构建详情",currentStep:"当前步骤",waiting:"等待构建信息",elapsed:"已用时",sourceCommit:"源码提交",openCodePipeline:"在 CodePipeline 中查看",starting:"正在启动",rebuild:"重新构建"},git:{sectionLabel:"公开代码仓库",address:"Git 地址",ref:"Branch、Tag 或 Commit",defaultBranch:"默认分支",inspecting:"正在拉取仓库并查找 Dockerfile",foundDockerfiles:"已在提交 {{commit}} 中找到 {{count}} 个 Dockerfile。",savedDockerfileLoaded:"已载入保存的 Dockerfile,可重新探查仓库更新。",noDockerfile:"仓库中未找到 Dockerfile,请检查分支或仓库内容。",inspectAgain:"重新探查",selectDockerfile:"选择 Dockerfile"},repository:{outputSection:"构建输出",type:"镜像仓库类型",managed:"Studio 默认镜像仓库",existing:"已有镜像仓库",managedHint:"构建时自动创建或复用当前区域的 Studio 镜像仓库。"},existingImage:{sectionLabel:"已有镜像",reference:"Tag 或 Digest",placeholder:"latest 或 sha256:...",hint:"填写镜像 Tag,或以 sha256: 开头的完整 Digest。"},share:{action:"分享",title:"分享环境",closeLabel:"关闭分享环境",generating:"正在生成并复制分享码",copied:"分享码已复制",failed:"分享失败",code:"分享码",fullCode:"完整环境分享码",copiedHint:"分享码已自动复制,也可在这里查看或手动复制。",copyFailedHint:"自动复制失败,可手动复制上方分享码,或重试。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅发送给可信对象。",copyAgain:"再次复制"},import:{title:"导入环境",closeLabel:"关闭导入环境",description:"先检测分享码中的环境,再确认添加到当前账号。",code:"环境分享码",tooMany:"最多可一次导入 {{max}} 个环境,当前检测到 {{count}} 个分享码。",multipleHint:"多个分享码可使用英文逗号、中文逗号或换行分隔,重复项会自动忽略。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅导入可信来源的分享码。",inspectingCodes:"正在检测环境分享码",found:"检测到 {{count}} 个环境:{{names}}。",itemError:"第 {{index}} 个分享码:{{error}}",invalidCode:"分享码无效。",noResult:"服务未返回该分享码的导入结果。",partial:"已导入 {{created}} 个环境,{{remaining}} 个未完成,可重试有效失败项。",inspecting:"正在检测",importing:"正在导入",retryImport:"重试导入",confirm:"确认导入",inspectCodes:"检测分享码"},status:{boundImage:"环境“{{name}}”已绑定已有镜像",queued:"环境“{{name}}”已进入构建队列",savedBuildFailed:"环境已保存,但构建未启动:{{error}}",importedFailed:"已导入 {{created}} 个环境,{{failed}} 个失败",importedDuplicate:"已导入 {{created}} 个环境,{{duplicate}} 个分享码已存在",imported:"已导入 {{count}} 个环境",deleted:"已删除环境“{{name}}”"},deleteTitle:"删除环境",deleteDescription:"确定删除环境“{{name}}”吗?删除后无法恢复。",errors:{repositoryRequired:"请输入公开代码仓库地址。",repositoryHttps:"请输入公开仓库的 HTTPS 地址。",repositoryInvalid:"请输入有效的公开仓库 HTTPS 地址。",imageReferenceWhitespace:"Tag 或 Digest 不能包含空格。",imageDigestInvalid:"Digest 必须是完整的 sha256 值。",imageTagOnly:"这里只填写 Tag,不要重复填写镜像仓库路径。"}},t1e={searchPlaceholder:"搜索资源名称",emptyMessage:"暂无可用选项",searchAriaLabel:"搜索{{label}}",loadingMore:"正在加载更多资源…"},n1e={retryDeployment:"重试部署",retrying:"正在重试…",collapse:"收起错误信息",expand:"展开完整错误信息",copy:"复制完整错误信息"},i1e={steps:"构建步骤",log:"构建日志",syncing:"同步中",loadFailed:"读取失败",synced:"已同步",recentOnly:" · 仅显示最近日志",copiedLog:"已复制构建日志",copyLog:"复制构建日志",copied:"已复制",copy:"复制",logContent:"构建日志内容",waiting:"正在等待 CodePipeline 输出日志…",empty:"暂无构建日志"},r1e={defaultLabel:"Studio 默认环境",defaultDescription:"使用 Studio 预置的标准运行环境",status:{notBuilt:"未构建",preparing:"准备中",queued:"排队中",building:"构建中",scanning:"扫描中",available:"可用",failed:"失败"},label:"运行环境",placeholder:"请选择运行环境",search:"搜索运行环境",loading:"正在加载运行环境…",loadFailed:"加载运行环境失败",noMatches:"未找到匹配的运行环境",unavailable:"当前没有可用的运行环境",selectionUnavailable:"所选运行环境当前不可用,请重新选择。",selectionHint:"选择构建完成的运行环境后,部署将使用其镜像和工具配置。",versionChanged:"所选环境版本已更新,请确认后继续。",versionMissing:"所选环境版本已不存在,请重新选择。",operatingSystem:"操作系统",language:"语言",image:"镜像",imageVersion:"镜像版本",skills:"技能",tools:"工具",noSkills:"未配置 Skill",noExtraTools:"未配置额外工具",defaultGuidance:"默认环境由 Studio 管理,无需额外配置。",persistenceFallback:"持久化环境服务暂不可用,当前使用默认环境。",emptyFallback:"当前没有可选择的自定义环境。"},s1e={repository:"GitHub 仓库",githubUrl:"GitHub 地址",token:"访问令牌",sessionToken:"{{provider}} 临时令牌",runtime:"Runtime",commit:"提交",workflow:"工作流",syncFailed:"同步 GitHub 代码失败",status:{mounted:"已挂载",bound:"已绑定",synced:"已同步",created:"已创建"},volcengine:"火山引擎",mountDelivery:"挂载持续交付",selectedForDeployment:"已选择,部署时挂载",mountOnDeploy:"部署时挂载持续交付",syncCode:"同步代码",deliveryMode:"GitHub 交付模式",sourceSync:"GitHub 代码同步",delivery:"GitHub 交付",loading:"读取中",running:"执行中",runtimeDeliveryHint:"写入 AgentKit Runtime GitHub Actions workflow,后续 GitHub 提交会更新绑定 Runtime。",initialDeliveryHint:"首次部署成功后初始化目标分支,后续 GitHub 提交会更新绑定 Runtime。",sourceSyncHint:"Studio 会直接 push 到目标分支;该分支由 Studio 管理,远端冲突时同步会失败。Runtime 仍由部署按钮发布。",tokenPlaceholder:"repo 或 contents write 权限",getToken:"获取 Token",hideToken:"隐藏 Token",showToken:"显示 Token",tokenHelp:"Token 仅用于本次操作,成功后不会保留在表单中。",targetBranch:"目标分支",actionsSecretPlaceholder:"用于写入 GitHub Actions Secret",sessionTokenPlaceholder:"临时凭证可选",syncing:"同步中…",pendingHint:"已选择挂载持续交付。点击部署后,Studio 会等待 Runtime 创建完成并初始化 GitHub 目标分支,初始化成功后才完成部署流程。",result:{deliveryMounted:"已挂载持续交付",deliverySelected:"已选择挂载持续交付",githubBound:"已绑定 GitHub",codeSynced:"代码已同步",deliveryHint:"目标分支提交会触发 Runtime 持续交付。",boundHint:"更新并发布时会先同步当前源码到这个分支。"},branch:"分支",viewPr:"查看 PR",createFailed:"创建失败",phase:"阶段",log:"日志"},a1e={name:"飞书",enabling:"正在启用并更新配置…",description:"接收消息并通过飞书机器人回复",configuration:"飞书配置",configurationMode:"飞书配置方式",automatic:"自动配置",manual:"手动配置",cancelling:"取消中…",scanToCreate:"扫码创建",scanDescription:"授权后自动回填凭据",generateQrCode:"生成二维码",qrCodeAlt:"飞书机器人配置二维码",scanToConfirm:"飞书扫码确认",expiresIn:"{{time}} 后失效",created:"机器人已创建",credentialsFilled:"应用凭据已自动回填",qrCodeExpired:"二维码已失效",automaticFailed:"自动配置失败",regenerateQrCode:"请重新生成二维码。",configuredPlaceholder:"已配置,留空沿用",appSecretPlaceholder:"请输入 App Secret",hideSecret:"隐藏 App Secret",showSecret:"显示 App Secret"},o1e={mode:{auto:"自动创建",autoDescription:"部署时自动创建所需资源",recommended:"推荐",create:"指定名称",createDescription:"使用指定名称创建或复用资源",existing:"选择已有",existingDescription:"从当前账号的已有资源中选择"},selectExisting:"请选择已有资源",searchResource:"搜索资源名称",noMatch:"未找到匹配资源",noAvailable:"暂无可用资源",searching:"正在搜索云资源…",loading:"正在加载云资源…",noMatchSentence:"未找到匹配资源。",noAvailableSentence:"暂无可用资源。",loadedSummary:"实际服务区域:{{region}} · 已加载 {{loaded}}{{total}}",registryInstance:"Registry 实例",registryAriaLabel:"镜像仓库 Registry 实例",namespace:"命名空间",namespaceAriaLabel:"镜像仓库 Namespace",repository:"镜像仓库",existingRepository:"已有镜像仓库",selectRegistryFirst:"请先选择 Registry 实例。",selectNamespaceFirst:"请先选择 Namespace。",configurationMode:"配置方式",configurationModeAriaLabel:"{{resource}}配置方式",selectConfigurationMode:"请选择配置方式",automaticNames:"自动创建名称",validation:{tos:"请填写或选择 TOS 存储桶。",cr:"请完整填写或选择 CR 实例、命名空间和镜像仓库。",codePipeline:"请完整填写或选择 CodePipeline Workspace 和 Pipeline。",existingCodePipeline:"请选择已有的 CodePipeline Workspace 和兼容 Pipeline。"},autoBucketWithRegion:"agentkit-platform-{账号 ID}-{{region}}",autoBucket:"agentkit-platform-{账号 ID}",tosBucket:"TOS 存储桶",bucketName:"存储桶名称",bucketNamePlaceholder:"输入存储桶名称",existingBucket:"已有存储桶",existingTosBucket:"已有 TOS 存储桶",bucket:"存储桶",accountIdResolved:"账号 ID 在部署时按当前云账号解析。",containerRegistry:"容器镜像仓库(CR)",instanceName:"实例名称",crInstance:"CR 实例",existingCrInstance:"已有 CR 实例",existingCrNamespace:"已有 CR 命名空间",existingCrRepository:"已有 CR 镜像仓库",autoRegistry:"agentkit-platform-{账号 ID}",autoRepositoryName:"{{name}}-{4 位随机字符}",registryNameNote:"账号 ID 在部署时解析,镜像仓库的随机字符在部署时生成。",workspace:"工作空间",pipeline:"流水线",workspaceName:"Workspace 名称",pipelineName:"Pipeline 名称",existingWorkspace:"已有 CodePipeline Workspace",compatiblePipeline:"兼容 Pipeline",existingPipeline:"已有 AgentKit CodePipeline",pipelineNameNote:"Pipeline 与 Runtime 名称一致。"},l1e={commit:"提交",steps:{permissions:"预检 OTA 所需权限",resolving:"读取目标版本信息",downloading:"下载并校验完整更新包",preparing:"准备 VeFaaS Function 代码",provisioning:"检查并补齐 Studio 云资源",scheduler:"更新定时任务调度服务",submitting:"提交 Function 更新",publishing:"发布新 Revision 并重启服务"},stages:{permissions:"预检 OTA 权限",resolving:"读取版本信息",downloading:"下载更新包",preparing:"准备 Function 代码",provisioning:"补齐 Studio 云资源",scheduler:"更新定时任务调度服务",submitting:"提交 Function 更新",publishing:"发布 Revision",checking:"检查更新",unknown:"未知阶段"},duration:{seconds:"{{count}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},logPermissionPrefix:"无法读取 VeFaaS 发布日志。Function 角色缺少 ",logPermissionSuffix:" 权限,更新会继续。",openIamConsole:"前往 IAM 控制台配置权限",deploymentProgress:"部署进度",live:"实时",completed:"已完成",stopped:"已停止",copied:"已复制",copyFailed:"复制失败",copyLog:"复制日志",waitingForLogs:"等待 VeFaaS 返回更新日志…",noLogs:"本次更新未返回发布日志",messages:{updated:"Studio 已更新,新 Revision 已接管服务",failed:"Studio 更新失败",timeout:"等待 VeFaaS 发布超时,请稍后重新检查版本",submitted:"更新已提交,正在等待 VeFaaS 发布新版本",connectionSwitched:"连接已切换,正在确认新版本状态"},checkingPermissions:"正在检查 OTA 权限",authorizationRequired:"需要 IAM 授权",updating:"正在更新 Studio",updated:"Studio 已更新",updateToVersion:"更新 Studio 至 {{version}}",checkPermissions:"检查更新权限",authorizationNeeded:"需要授权",updatingShort:"正在更新",refreshForNewVersion:"刷新使用新版",updateFailed:"更新失败",updateNow:"立即更新",newVersionAvailable:"有新版更新",dialog:{failed:"Studio 更新失败",checkingPermissions:"正在检查更新权限",authorizationRequired:"需要 IAM 授权",updating:"正在更新 Studio",completed:"Studio 更新完成",newVersion:"发现新版本"},permissionCheck:"正在核对 OTA 与定时任务所需的全部 IAM 权限…",permissionCheckHint:"权限全部满足后才会开始下载、更新或发布云资源。",missingPermissionCount:"当前 Function 角色缺少 {{count}} 项 OTA 更新权限,尚未执行任何云资源变更。",functionRole:"Function 角色",currentRole:"当前运行角色",policyToUpdate:"将更新策略",authorizationSteps:{open:"打开授权页面,确认已预填的策略名称和完整策略内容。",debug:"点击页面中的“发起调试”,完成策略更新。",return:"返回此窗口,点击“我已授权,重新检查”。"},missingPermissions:"缺少的权限",openPrefilledAuthorization:"打开已预填的 IAM 授权页面",openIamManually:"前往 IAM 控制台手动配置",noSafePolicy:"当前角色没有唯一可安全更新的自定义策略,请由管理员将上述权限加入该角色。",failedStage:"失败阶段",errorId:"错误 ID",notGenerated:"未生成",openFunctionLogs:"前往 VeFaaS 控制台查看 Function 日志",targetVersion:"目标版本",updateStatus:"更新状态",elapsed:"已用时",progressAriaLabel:"Studio 更新进度",processingUpdate:"正在处理更新",processing:"正在处理",backgroundHint:"发布阶段会短暂中断连接;关闭此窗口不会停止更新,可随时点击右上角按钮重新查看。",confirmDescription:"更新会重启 Studio 服务,预计约 3–5 分钟完成更新与发布。期间正在进行的对话、流式响应或部署任务可能中断,登录态不会受到影响。",selectVersion:"选择版本",currentVersion:"当前版本",changelog:"更新内容",noChangelog:"暂无更新说明",runInBackground:"后台运行",authorizedRecheck:"我已授权,重新检查",tryAgain:"重新尝试"},c1e={deploy:"部署",update:"更新",planHash:"方案哈希",backToConfiguration:"返回配置",releaseRegion:"发布区域",deployRegion:"部署区域",regionPreserved:"更新时沿用现有 Runtime 的部署区域,无法修改。",unnamedAgent:"未命名 Agent",deployTitle:"部署 {{name}}",additionalAgentCount:" 等 {{count}} 个智能体",releaseOverview:"发布概览",agentOverview:"Agent 概览",agentCount:"Agent 数量",model:"模型",systemPrompt:"系统提示词",optimizations:"优化选项",notEnabled:"未启用",effectiveCapabilities:"生效能力",automaticProtection:"自动保护",artifactActions:"发布产物操作",exportYaml:"导出 YAML",viewSource:"查看源代码",downloadSource:"下载源代码",expandFlow:"放大查看执行流程",expand:"放大查看",deploymentConfiguration:"部署配置",runtimeName:"Runtime 名称",runtimeNamePreserved:"更新时保持现有 Runtime 名称不变。",runtimeNameHint:"默认根据 Root Agent 名称生成,并添加随机后缀避免重名;支持 4-64 位字母、数字、连字符和下划线",accessAuthentication:"访问鉴权",authenticationPreserved:"更新时保持现有 Runtime 的鉴权方式不变。",authenticationMethod:"鉴权方式",authenticationAriaLabel:"部署鉴权方式",authenticationPlaceholder:"请选择鉴权方式",messageChannels:"消息渠道",instanceSettings:"实例设置",minInstances:"最小实例数",maxInstances:"最大实例数",sidecarSingleInstance:"Harness Sidecar 首期仅支持单实例,Runtime 固定为 1~1",inMemorySingleInstance:"为避免多实例间会话丢失,推荐将 Runtime 固定为 1~1",network:"网络",networkPreserved:"现有 Runtime 的区域与网络模式保持不变。",networkMode:"网络模式",networkModes:{public:"公网",both:"公网 + VPC"},subnetId:"子网 ID",subnetHint:"可选,多个用逗号分隔",sharedInternetAccess:"VPC 内共享公网出口",evaluationSets:"评测集",createEvaluationSets:"自动创建评测集",createEvaluationSetsHint:"部署成功后,自动创建 Good Case 和 Bad Case 评测集。",resourceConfiguration:"资源配置",environmentVariables:"环境变量",environmentVariablesHint:"组件配置会自动同步到这里,部署前可核对最终值。",itemCount:"{{count}} 项",addVariable:"添加变量",componentGenerated:"组件自动生成",injectedByApiKey:"由所选 API Key 注入",envNameAriaLabel:"{{key}} 环境变量名",envDescriptionAriaLabel:"{{key}}说明:{{description}}",openOpenViking:"打开 OpenViking {{label}}",openOpenVikingAriaLabel:"{{key}}:打开 OpenViking {{label}}",requiredEmpty:"必填,尚未填写",optionalEmpty:"可选,尚未填写",envValueAriaLabel:"{{key}} 环境变量值",automatic:"自动",synced:"同步",customModelCredentials:"自定义模型凭据",releaseOnlySecret:"必填,仅用于本次发布",thisRelease:"本次发布",customVariables:"自定义变量",value:"值",deleteVariable:"删除变量",deploymentProgress:"部署进度",retryUpdate:"重试更新",retryDeploy:"重试部署",updateSucceeded:"更新成功",deploySucceeded:"部署成功",region:"区域",agentName:"Agent 名称",apiEndpoint:"API 端点",connecting:"连接中…",chatNow:"立即对话",console:"控制台",actionInProgress:"{{action}}中…",checkingName:"正在检查名称…",retryAction:"重试{{action}}",flowPreview:"执行流程预览",executionFlow:"执行流程",flowPreviewHint:"只读预览,可缩放与拖动画布",closeFlowPreview:"关闭执行流程预览",agentAdded:'Agent "{{name}}" 已添加到左上角下拉列表!',files:{preview:"文件预览",new:"新建文件",empty:"暂无文件",noneSelected:"未选择文件",selectToView:"选择左侧文件以查看内容",loadingEditor:"加载编辑器…",rename:"重命名",renamePrompt:"重命名文件"},apiKey:{selectFirst:"请先选择 API Key",revealing:"正在显示 API Key",hide:"隐藏 API Key",retryReveal:"重试显示 API Key",reveal:"显示 API Key"},task:{preparing:"准备部署",waitingBuildLog:"正在等待构建日志…",waitingGithubLog:"正在等待 GitHub 挂载日志…",syncingGithub:"正在同步当前源码到 GitHub",syncGithubCode:"同步 GitHub 代码",githubSynced:"GitHub 代码已同步",githubSubmitted:"GitHub 代码已提交",githubUpdatingRuntime:"代码已提交到 GitHub,GitHub Actions 正在更新同一个 Runtime",initializingGithub:"开始初始化 GitHub main 分支与 Actions workflow",initializingGithubBranch:"正在初始化 GitHub 持续交付目标分支",mountGithubDelivery:"挂载 GitHub 持续交付",githubBranchInitialized:"GitHub 持续交付已初始化目标分支",githubDeliveryMounted:"GitHub 持续交付已挂载",githubMountFailed:"挂载 GitHub 持续交付失败",githubMountFailedDetail:"GitHub 持续交付挂载失败:{{message}}",githubMountFailedHint:"挂载 GitHub 持续交付失败,详见 GitHub 日志。",applyingMpaProfile:"正在将 Agent 配置应用到 MPA Runtime",mpaProfileApplied:"MPA Runtime 配置已应用",runningMpaSmoke:"正在验证 MPA Runtime 执行链路",mpaReady:"MPA Runtime 已可运行",deploymentComplete:"部署完成",deployedNotConnected:"部署完成,暂未连接",cancelled:"已取消",cancelledHint:"部署已取消,相关 Runtime 资源已请求销毁。",deploymentStatusUnconfirmed:"部署状态待确认",deploymentFailed:"部署失败",buildFailedHint:"构建镜像失败,详见构建日志。"},confirm:{updateTitle:"确认更新",deployTitle:"确认部署",closeLabel:"关闭部署确认",updateDescription:"将更新并发布到当前云端 Runtime,过程可能需要几分钟。确定继续吗?",deployDescription:"将创建新的云端 Runtime,部署过程可能需要几分钟。确定继续吗?",update:"确定更新",deploy:"确定部署"},userPool:{label:"用户池",unnamed:"未命名用户池",current:"当前用户池",ariaLabel:"部署用户池",loading:"正在加载用户池…",placeholder:"请选择用户池",loadingIdentity:"正在加载 Identity 用户池…",empty:"当前账号下暂无 Identity 用户池。",currentHint:"当前 Studio 的登录 JWT 将透传访问此 Runtime。",mismatchHint:"所选用户池不是当前 Studio 使用的用户池,部署后无法从 Studio 调用此 Runtime。",markedHint:"当前 Studio 使用的用户池已在列表中标注。"},authentication:{apiKeyDescription:"默认方式,使用 Runtime API Key 访问",userPool:"用户池",userPoolDescription:"使用 Identity 用户池签发的 JWT"},steps:{buildImage:"构建镜像",deploy:"部署",publish:"发布",syncCode:"同步代码",uploadPackage:"上传代码包",packageImage:"镜像打包",createRuntime:"创建 Runtime",publishService:"发布服务",updateInstances:"更新实例配置",createEvaluationSets:"创建评测集",applyMpaProfile:"应用 MPA 配置",verifyMpaRuntime:"验证 MPA Runtime",mpaReady:"MPA Runtime 可运行"},errors:{instanceRangeInteger:"最小实例数必须为大于等于 0 的整数,最大实例数必须为大于 0 的整数。",instanceRangeOrder:"最小实例数不能大于最大实例数。",selectApiKey:"请先在模型配置中选择 API Key。",loadApiKey:"加载 API Key 失败,请重试。",invalidProject:"项目数据无效",updateFeishu:"更新飞书配置失败:{{message}}",userPoolRequired:"请选择用于 Runtime 鉴权的用户池。",vpcRequired:"使用 VPC 网络时,请填写 VPC ID。",modelSecretRequired:"请填写 {{label}},用于访问对应的自定义模型地址。",managedApiKeyRequired:"{{requirement}},请先返回模型配置选择 API Key。",feishuEnvRequired:"启用飞书后,请填写{{field}}。",runtimeNameExists:"Runtime 名称已存在,请修改后重试。",deployedButGithubMountFailed:"部署成功,但挂载 GitHub 持续交付失败:{{message}}",deployedButGithubBindFailed:"部署成功,但绑定 GitHub 失败:{{message}}",mpaRuntimeIdMissing:"部署成功,但返回缺少 Runtime ID,无法应用 MPA 配置。",mpaOperationIncomplete:"MPA Runtime 初始化未完成,请重试此部署任务。",deploymentStatusUnconfirmed:"连接已中断,当前无法确认部署最终状态。任务可能仍在云端运行,请到 AgentKit 或 Code Pipeline 查看同一任务,避免重复部署。",failedAtStage:"{{action}}失败({{stage}}阶段):{{message}}",noAgentAtEndpoint:"连接成功,但该地址未发现任何 Agent(/list-apps 为空)。",addAgent:"添加 Agent 失败:{{message}}",modelApiKeyRequired:"请填写此模型地址对应的 API Key。"}},u1e={title:"工作区",storageUnavailable:"管理员未配置持久化存储,工作区管理暂不可用。",detail:"工作区详情",create:"新建工作区",editorDescription:"将常用环境组合在一起;同一个环境可以加入多个工作区。",backToList:"返回工作区列表",environmentCount_one:"{{count}} 个环境",environmentCount_other:"{{count}} 个环境",createdAt:"创建时间",updatedAt:"最近更新",basicInfo:"基本信息",namePlaceholder:"例如:内容生产",descriptionPlaceholder:"说明这个工作区的用途",selectedEnvironmentCount:"已选择 {{count}} 个,可在其他工作区中继续复用",searchAvailableEnvironments:"搜索可用环境",searchEnvironments:"搜索环境",noAvailableEnvironments:"还没有可添加的环境",createEnvironmentFirst:"请先在“环境”页面创建并构建环境。",noMatchingEnvironments:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称。",environmentStatus:{available:"可用",building:"构建中",notBuilt:"未构建"},added:"已添加",saved:"已保存工作区“{{name}}”",resourceType:"工作区资源类型",searchWorkspaces:"搜索工作区",loadFailed:"无法加载工作区",noMatchingWorkspaces:"没有匹配的工作区",tryAnotherNameOrEnvironment:"请尝试搜索其他名称或环境",noEnvironmentAdded:"未添加环境",environmentMissing:"环境缺失",availableFraction:"{{available}}/{{total}} 可用",available:"可用",availableCount:"{{count}} 个可用",updated:"更新",addEnvironment:"添加环境",deleteTitle:"删除工作区",deleteDescription:"确定删除工作区“{{name}}”吗?环境本身不会被删除。",deleted:"已删除工作区“{{name}}”",clipboardPermissionError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。",codeProjects:"代码项目"},d1e={back:"返回",detailNavigation:"详情导航",noData:"暂无数据",actions:"操作",moreActions:"更多操作 {{label}}",actionsFor:"{{label}} 操作",loading:"资源加载中,请稍候"},f1e={addSkill:"添加 Skill",remove:"移除 {{name}}",confirmRemoveRuntime:"从新版本中移除运行中的 Skill「{{name}}」?",selectedCount:"已加入技能 · {{count}}",close:"关闭{{label}}",sources:{runtime:"运行中来源 · 原样保留,可移除或用同名 Skill 替换",local:"本地",skillspace:"AgentKit Skills 中心",skillhub:"火山 Find Skill 技能广场"},tabs:{local:"本地文件",localShort:"本地文件",skillspace:"AgentKit Skills 中心",skillspaceShort:"AgentKit",skillhub:"火山 Find Skill 技能广场",skillhubShort:"Find Skill"}},h1e={model:"模型",turnControls:"流程控制",pause:"暂停",resume:"恢复",interrupt:"中断",cancel:"取消",pauseTurn:"在安全点暂停完整流程",resumeTurn:"恢复完整流程",interruptTurn:"中断当前流程并保留会话上下文",cancelTurn:"取消当前流程且不可恢复",turnState:{running:"运行中",pausing:"正在到达安全点",paused:"已暂停",resuming:"正在恢复",interrupting:"正在中断",cancelling:"正在取消",interrupted:"已中断",completed:"已完成",failed:"失败",cancelled:"已取消",orphaned:"状态待确认",newTurnRequired:"需要从检查点继续"},tasks:{ppt:"PPT",image:"图片生成",video:"视频生成"},prompts:{ppt:{quarterlyReview:"复盘【季度】经营表现,提炼指标差距、原因与行动建议",projectUpdate:"汇报【项目名称】进展:里程碑、风险、预算和资源诉求",solutionProposal:"为【客户行业】输出解决方案:痛点、架构、实施路径与收益",industryAnalysis:"分析【行业主题】趋势,给出竞争格局、机会与战略建议"},image:{launchVisual:"为【品牌或产品】设计【高级科技】风格的发布会主视觉",ecommercePoster:"生成【产品名称】电商海报,突出【核心卖点】与品牌色",conceptRendering:"呈现【产品或空间】在【使用场景】中的写实概念效果图",socialGraphic:"围绕【传播主题】制作简洁专业的企业社媒配图"},video:{brandFilm:"制作【品牌名称】30 秒宣传片,突出【品牌价值】",productLaunch:"为【产品名称】制作 45 秒发布视频:痛点、功能、场景与行动号召",trainingVideo:"制作【培训主题】企业培训视频,讲清【关键操作或规范】",eventTeaser:"生成【活动名称】20 秒预热视频,包含亮点、时间地点和报名信息"}},firstFrame:"首帧",videoToEdit:"待编辑视频",baseVideo:"基础视频",optimizeSkillPlaceholder:"描述你想优化的技能…",createSkillPlaceholder:"描述你想生成的技能…",createVideoPlaceholder:"描述你想创作的视频…",messageAgentPlaceholder:"向 {{name}} 发消息…",selectAgentFirst:"请先选择智能体",selectSkillFirst:"请先选择需要优化的 Skill",availableSkills:"可用技能",availableSubagents:"可用子 Agent",invokeSkill:"调用技能",useSubagent:"使用子 Agent",loadingCapabilities:"正在读取 Agent 能力…",noMatchingSkills:"当前 Agent 没有匹配技能",noMatchingSubagents:"当前 Agent 没有匹配子 Agent",skillFallbackDescription:"加载并执行该技能",agentFallbackDescription:"将本轮交给该 Agent",skill:"技能",uploadImage:"上传图片",uploadDocument:"上传文档或 PDF",uploadVideo:"上传视频",taskMode:"任务模式",selectTaskMode:"选择任务模式",loadingGenerationModel:"正在加载生成模型",modelUnavailable:"模型不可用",cancelTask:"取消{{task}}任务",stopGenerating:"停止生成",viewVideoProgress:"查看视频生成进度",send:"发送",selectTaskType:"选择任务类型",enterprisePrompts:"{{task}}企业提示词",sessionId:"会话 ID",sessionIdLabel:"会话 ID:",initializing:"初始化中",copied:"已复制",copySessionId:"复制会话 ID",sessionIdCopied:"已复制会话 ID",disclaimer:"回答仅供参考",viewLogs:"查看日志"},p1e={selectAgent:"选择 Agent",noLocalAgents:"暂无本地 Agent。",searchRuntime:"搜索 Runtime 名称",mineOnly:"只看我创建的",noRuntimes:"暂无 Runtime。",unsupported:"不支持",createdByMe:"我创建的",connecting:"连接中…",connected:"已连接",connect:"连接",viewInfoFor:"查看 {{name}} 信息",viewInfo:"查看信息",agentAndRuntimeInfo:"Agent 与 Runtime 信息",detailType:"详情类型",agentInfo:"Agent 信息",runtimeInfo:"Runtime 信息",loadingAgentInfo:"读取 Agent 信息…",cannotLoadAgentInfo:"暂时无法读取 Agent 信息",unnamedAgent:"未命名 Agent",subagents:"子 Agent",tools:"工具",skills:"技能",previewUnsupported:"暂不支持预览",mountedComponents:"挂载组件",noMoreAgentInfo:"暂无更多 Agent 配置信息。",local:"本地",model:"模型",status:"状态",memoryMb:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",resources:"资源",version:"版本",loadingDetails:"读取详情…",environmentVariables:"环境变量",errors:{notFound:"该 Runtime 已不存在或列表信息已过期,请刷新列表后重试。",accessDenied:"当前账号无权访问该 Runtime,请检查所属 Project 和访问权限。",previewUnsupported:"该 Agent Server 版本暂不支持信息预览。",unavailable:"该 Runtime 暂时无法访问,请确认其状态为“就绪”后重试。",timeout:"加载超时,请重试"},componentKinds:{knowledgebase:"知识库",memory:"记忆",prompt_manager:"提示词管理",example_store:"样例库",run_processor:"运行处理器",tracer:"链路追踪",toolset:"工具集",plugin:"插件",other:"其他"},runtimeStatus:{ready:"就绪",unreleased:"未发布",running:"运行中",active:"运行中",creating:"创建中",pending:"等待中",deploying:"部署中",updating:"更新中",failed:"失败",error:"异常",stopping:"停止中",stopped:"已停止",deleting:"删除中",deleted:"已删除"}},m1e={agent:"智能体",agentTypes:{general:"通用智能体",mpa:"MPA 智能体",codex:"Codex","deepseek-harness":"DeepSeek",openclaw:"OpenClaw",hermes:"Hermes"},creator:"创建人",namedAgent:"{{name}} 智能体",storageLocation:"存储位置",currentBrowser:"当前浏览器",region:"地域",viewDeploymentProgress:"查看 {{name}} 部署进度",viewRuntimeDetails:"查看 {{name}} Runtime 详情",viewDetails:"查看 {{name}} 详情",time:"时间",remainingTime:"剩余时间",expiringSoon:"即将清空",sandboxRemaining:"{{hours}} 小时 {{minutes}} 分钟",wakeable:"已休眠",neverExpires:"永不过期",editDraftNamed:"编辑草稿 {{name}}",viewProgress:"查看进度",deleteDraftNamed:"删除草稿 {{name}}",recheckCompatibility:"重新检测 {{name}} 的对话兼容性",connectedNamed:"{{name}} 已连接",wakeAndChat:"唤醒 {{name}} 并开始对话",chatWith:"与 {{name}} 对话",waking:"唤醒中",deploying:"部署中",draft:"草稿",checking:"检测中",chatUnsupported:"不支持对话",checkFailed:"检测失败",creatorFilter:"创建人筛选",agentType:"智能体类型",searchAgents:"搜索智能体",handoff:"接力",agentList:"{{type}}列表",noMatchingAgents:"没有匹配的智能体",adjustSearch:"请尝试调整搜索或筛选条件",noAgentType:"暂无 {{type}}",noGeneralAgents:"暂无通用智能体",createGeneralAgentDescription:"创建一个通用智能体,开始构建和对话",createAgentType:"创建{{type}}",createAgent:"创建智能体",loadingMore:"正在加载更多智能体",scrollForMore:"继续下滑加载更多",allLoaded:"已加载全部智能体",deleteDraftTitle:"删除草稿?",deleteDraftDescription:"删除后将无法恢复“{{name}}”。",deleteDraft:"删除草稿",loadGeneralAgents:"加载通用智能体",loadAgentType:"加载 {{type}}",compatibility:{checking:"正在请求 Runtime /list-apps,以确认该智能体是否支持 Studio 对话。",empty:"Runtime /list-apps 未返回可用的 Agent,暂时无法连接对话。",supported:"Runtime 支持 Studio 对话。",unknownError:"Runtime /list-apps 请求失败,未返回可识别的错误信息。"},sandboxStatus:{ready:"就绪",wakeable:"已休眠",creating:"创建中",starting:"启动中",initializing:"启动中",pending:"等待中",running:"运行中",failed:"异常",error:"异常",stopped:"已停止",expired:"已过期",deleting:"删除中",deleted:"已删除",unknown:"未知状态"},wakingHint:"正在唤醒智能体,可能需要一些时间。",mpaCreate:{name:"名称",namePlaceholder:"例如 test-agent",nameHelp:"作为 Runtime 名称,支持 4–64 位字母、数字、下划线或连字符。",stepsLabel:"创建步骤",steps:{basics:"基本信息",postgres:"PostgreSQL",openviking:"OpenViking",autoPostgres:"数据库"},next:"下一步",previousStep:"上一步",pgDescription:"选择已有的 PostgreSQL 实例。创建流程会在该实例中准备智能体的独立业务库。",pgSplitDescription:"使用已配置的业务 PG Workspace。多个智能体共用此 Workspace,每个智能体拥有独立业务库。共享资源记录单独存放在 mpa_admin_workspace / mpa_admin_db,由管理员配置。",pgConsole:"前往火山引擎 AIDAP 创建或查看 PG Workspace",pgHost:"PG 主机地址",pgPort:"PG 端口",pgInvalid:"请填写有效的 PG 主机地址和端口。",pgCredentials:"PG 连接账号和密码由部署服务配置;主机和端口须与服务端配置一致。",openvikingDescription:"可选。三项全部填写才启用 OpenViking;全部留空则不向新智能体注入 OpenViking 配置。",openvikingConsole:"前往火山引擎查看 OpenViking 资源",openvikingUrl:"OpenViking 服务地址",openvikingResourceId:"OpenViking 资源 ID",openvikingApiKey:"OpenViking API Key",openvikingInvalid:"请同时填写有效的 HTTPS 服务地址、资源 ID 和 API Key,或全部留空。",openvikingCredentials:"API Key 仅用于本次创建,不保存到浏览器草稿;刷新页面后需重新填写。",tosTitle:"会话输出存储",tosDescription:"可选。填写完整的 TOS 凭证和存储桶,为新智能体的每个会话挂载独立输出目录。三项均留空时使用服务端预设;服务端未配置时,不启用 TOS 挂载。",tosAccessKey:"TOS Access Key",tosSecretKey:"TOS Secret Key",tosBucket:"TOS 存储桶",tosInvalid:"TOS Access Key、Secret Key 和存储桶必须同时填写。",tosCredentials:"凭证仅用于本次创建,不会保存在浏览器恢复数据或创建任务记录中。",runtimeImage:"MPA 镜像",workerImage:"Worker 镜像",imageDefault:"留空使用配置文件中的默认镜像",imageInvalid:"请输入有效的镜像地址,不要包含网址、空格或登录凭据。",title:"创建 MPA 智能体",agentId:"智能体 ID",description:"描述",region:"部署地域",plan:"创建计划",sharedResources:"准备或复用账号共享 VPC、子网和 APIG 消息网关",agentResources:"准备独立业务库、技能空间和执行环境,部署智能体",readiness:"检查网关和智能体就绪状态,成功后加入列表",checking:"正在检查创建配置…",configured:"创建配置已就绪。提交后会检查云资源并开始准备。",notConfigured:"尚未配置创建所需的资源参数,请联系管理员配置后重试。",loadFailed:"检查创建配置失败,请重试。",reload:"重新检查",submit:"开始创建",retry:"重试创建",newAgent:"新建另一个智能体",newAgentDescription:"新建另一个智能体将开启可编辑的新请求,替换当前恢复草稿,但不会取消旧任务。旧任务仍在运行时,请等待其结束后再提交。",close:"关闭",cancel:"取消创建",confirmCancel:"确认取消",cancelDescription:"取消后会停止后续步骤。已创建的数据库、技能空间、网关和其他已登记资源会保留,可使用同一智能体 ID 重试。",background:"关闭窗口后创建会继续。再次打开可查看进度。",pollFailed:"暂时无法获取进度,正在重新连接。请勿重复创建其他智能体。",iamPermissionDenied:"部署服务没有准备运行角色所需的 IAM 权限,请联系管理员授权后重试。",iamTrustConflict:"运行角色的信任关系不符合要求,请管理员检查对 VeFaaS 和 APIG 的授权后重试。",iamPolicyConflict:"运行角色所需的同名权限策略内容冲突,请管理员检查后重试。",iamOwnershipConflict:"运行角色与当前部署账号不匹配,请管理员检查后重试。",iamVerificationFailed:"尚未确认运行角色的权限已就绪,请检查 IAM 服务及策略可用性后重试。",iamConfigurationConflict:"自动准备运行角色仅支持默认 MPA 角色,请检查服务端创建配置。",creationFailed:"当前步骤未完成,请检查对应资源、服务端配置及权限后,用同一智能体 ID 重试。",cancelFailed:"取消请求失败,请重新查询进度后重试。",cancelled:"创建已取消,已登记资源保留供重试。",timeout:"创建超时,已登记资源保留。请检查对应资源后重试。",interrupted:"创建任务中断。请用同一智能体 ID 重试以恢复已登记资源。",skillSpace:"技能空间",states:{running:"正在创建",cancelling:"正在取消",succeeded:"创建成功",failed:"创建失败",cancelled:"已取消"},stages:{queued:"等待开始",iam_role:"准备运行角色",checking:"检查账号与配置",network:"准备 VPC 和子网",gateway:"准备 APIG 和 IM Gateway",database:"准备业务数据库",skills:"准备技能空间",worker:"准备执行环境",deploying:"准备数据库、技能空间和 Runtime",verifying:"等待智能体就绪",admin_workspace:"准备管理 PG Workspace",business_workspace:"准备业务 PG Workspace",admin_database:"初始化共享管理库"},back:"继续创建",pgAutoDescription:"使用 VeADK 部署账号自动创建或复用两个 PG Workspace:mpa_admin_workspace / mpa_admin_db 存放共享资源记录,业务 Workspace 供多个智能体共用,每个智能体拥有独立业务库。无需填写 PG 连接信息,提交创建后开始准备。",pgModeChanged:"此创建任务使用旧的 PG 配置,不能直接切换为自动模式重试。请联系管理员确认已有资源和任务后重新创建。",pgMigrationRequired:"检测到旧共享注册库。请先将共享资源记录迁移到 mpa_admin_workspace / mpa_admin_db,并完成现有 Runtime 的注册库地址切换;完成后点击“重新检查”。"}},g1e={library:"技能库",skill:"技能",skills:"技能",skillSpace:"技能空间",sandboxNotConfigured:"管理员未配置 Dev Sandbox",adminNotConfigured:"管理员未配置",totalItems:"共 {{count}} 项",cannotLoadSpaces:"无法加载技能空间",someSpacesFailed:"部分技能空间加载失败",degradedRelationWarning:"部分关联异常,已恢复可读取技能",downloadZip:"下载 ZIP",optimize:"优化",closeSkillDetails:"关闭技能详情",skillId:"技能 ID",allFiles:"完整文件",loadingSkillContent:"正在读取技能内容…",noSkillContent:"该技能暂无 SKILL.md 内容",addSkill:"添加技能",localUpload:"本地上传",localUploadDescription:"选择 ZIP 文件,校验通过后上传到技能空间",autoCreate:"自动创建",autoCreateDescription:"选择模型和风格,通过对话生成技能",createSkill:"创建技能",optimizeNamed:"优化 {{name}}",deleteSkillConfirm:"确定删除整个 Skill“{{name}}”吗?此操作会影响所有引用它的空间。",deleteSpaceConfirm:"确定删除 Skill 空间“{{name}}”吗?请先确认空间中的技能已删除。",manageSpaceDescription:"管理空间中的技能并创建新的版本",backToSpaces:"返回技能空间列表",overview:"概览",skillCount:"技能数量",skillCountValue_one:"{{count}} 技能",skillCountValue_other:"{{count}} 技能",updatedAt:"更新时间",skillsInSpace:"{{name}}中的技能",searchSkills:"搜索技能",cannotLoadSkills:"无法加载技能",noMatchingSkills:"没有匹配的技能",noSkills:"暂无技能",tryAnotherName:"请尝试搜索其他名称",emptySkillsDescription:"本地上传 Skill,或自动创建",actions:"操作",spaceDetails:"技能空间详情",editSpace:"编辑空间",deleteSpace:"删除空间",searchSpaces:"搜索技能空间",spaceList:"技能空间列表",noMatchingSpaces:"没有匹配的技能空间",createSpace:"新建技能空间",newSpace:"新建空间",loadingMoreSpaces:"正在加载更多技能空间",scrollForMore:"继续下滑加载更多",allSpacesLoaded:"已加载全部技能空间",errors:{loadSpaces:"读取技能空间失败,请稍后重试",loadSkills:"读取技能失败,请稍后重试",loadSkillDetails:"读取技能详情失败,请稍后重试",deleteSkill:"删除 Skill 失败",deleteSpace:"删除 Skill 空间失败",downloadSkill:"下载 Skill 失败"},status:{active:"可用",available:"可用",creating:"创建中",disabled:"已停用",enabled:"已启用",failed:"异常",inactive:"未启用",pending:"等待中",published:"已发布",ready:"就绪",released:"已发布",running:"运行中",success:"正常",unavailable:"不可用",unreleased:"未发布",updating:"更新中",unknown:"未知"},sharedSpace:"企业共享空间",sharedDescription:"面向企业全员开放的技能,由管理员统一发布和维护",sharedVisibility:"全员可见",sharedPreparing:"正在准备共享空间",sharedLoadFailed:"共享空间加载失败",sharedEmpty:"暂无共享技能,管理员发布后会显示在这里",requestPublication:"申请公开",reviewSubmitting:"提交中…",reviewSubmitted:"已申请",reviewFailed:"申请公开失败",reviewStatusFailed:"审核状态加载失败",reviewRetry:"重新申请",reviewPending:"待审核",reviewApproving:"发布中",reviewApproved:"已公开",reviewReturned:"已退回",reviewHistory:"审核记录",skillDetailSections:"技能详情内容",versions:{title:"版本管理",refresh:"刷新",uploading:"上传中…",upload:"上传新版本",close:"关闭",hint:"新版本不会替换已公开版本,审核通过后才会公开;ZIP 中的技能名称需与原技能一致",loading:"正在加载版本…",loadFailed:"无法加载版本",filesFailed:"无法加载版本文件",uploadFailed:"上传新版本失败",submitFailed:"提交申请失败",retry:"重试",empty:"暂无版本",current:"当前版本",notSubmitted:"未申请公开",submitting:"提交中…",submit:"申请公开",processing:"版本状态:{{status}}",filesLoading:"正在加载文件…",filesEmpty:"暂无文件",history:"历史审核记录",shared:"已公开"},author:"作者",authorName:"作者:{{name}}"},b1e={library:"知识库",createBase:"新建知识库",editBase:"编辑知识库",invalidName:"名称必须以字母开头,且只能包含字母、数字和下划线。",nameHelp:"以字母开头,仅支持字母、数字和下划线,最多 48 个字符。",optionalDescription:"描述(可选)",descriptionOnly:"AgentKit 当前仅支持更新知识库描述。",previewWeb:"预览网页内容",addData:"添加数据",openOriginalWeb:"打开原网页",backToEdit:"返回修改",confirmAdd:"确认添加",source:"知识来源",image:"图片",documentFile:"文档文件",webPage:"在线网页",webUrl:"网页 URL",generatingWebPreview:"正在抓取网页并生成 Markdown 预览",selectFile:"选择知识文件",selectOrDropFile:"选择文件或拖拽到这里",selectedFile:"{{size}} · 点击可重新选择",imageFileHelp:"支持 PNG、JPG 和 JPEG,单个文件不超过 200 MB",documentFileHelp:"支持 PDF、PPTX、DOCX、XLSX 和 TXT,单个文件不超过 200 MB",uploadingFile:"正在上传文件并添加到知识库",optionalName:"名称(可选)",optionalType:"类型(可选)",generatePreview:"生成预览",uploadFile:"上传文件",editMetadata:"编辑知识 Metadata",knowledge:"知识",field:"字段",value:"值",backToList:"返回知识库列表",metadataJson:"元数据(JSON)",provider:"服务提供方",knowledgeId:"知识库 ID",project:"项目",creator:"创建者",data:"数据",deleteInvalidAssociation:"删除失效关联",noData:"这个知识库还没有数据",addFirstData:"添加第一项数据",format:"格式",size:"大小",searchData:"搜索数据",searchLibraryData:"搜索知识库数据",associationInvalid:"关联已失效",providerMissing:"底层 Provider 知识库已不存在",noMatchingData:"没有匹配的数据",loadingMoreData:"正在加载更多数据",retryLoading:"重试加载",details:"知识库详情",searchBases:"搜索知识库",someBasesFailed:"部分知识库暂时无法加载,已展示其余可用内容。",noMatchingBases:"没有匹配的知识库",noManagePermission:"您没有管理此知识库的权限",loadingMoreBases:"正在加载更多知识库",deleteBaseTitle:"删除知识库?",deleteBaseDescription:"将删除 {{name}} 的 AgentKit 关联;如果它由 Studio 创建,也会同时删除 Provider 资源。此操作无法撤销。",deleteDocumentTitle:"删除知识?",deleteDocumentDescription:"将从 Provider 知识库中删除 {{name}},此操作无法撤销。",preview:{processingTitle:"数据正在处理中",processingDetail:"知识库完成解析后即可预览,请稍后重新加载。",failedTitle:"数据解析失败",failedDetail:"请检查源文件或网页地址后重新添加,也可以重新加载最新状态。",noParsedTitle:"暂时没有可预览的解析内容",noParsedDetail:"此类文件会在知识库完成解析后显示文本、表格或页面图片。",noMediaTitle:"暂时没有可预览的媒体内容",noMediaDetail:"知识库尚未返回可访问的媒体预览,请稍后重新加载。",noDataTitle:"暂无可预览的数据内容",noDataDetail:"知识库尚未返回解析结果,请稍后重新加载。",attachmentError:"附件无法预览,请稍后重试。",imageAlt:"知识数据图片",audioUnsupported:"当前浏览器不支持音频预览。",videoUnsupported:"当前浏览器不支持视频预览。",namedPdf:"{{name}} PDF 预览",pdf:"PDF 预览",openPdf:"无法显示时,在新窗口打开 PDF",fileUnsupported:"当前格式暂不支持直接在线预览,已优先显示解析后的内容。",openOriginalFile:"打开原文件",loading:"正在加载数据预览",openOriginalHint:"您可以打开原网页查看来源内容。",chunk:"片段 {{index}}",loadingMore:"正在加载更多",loadMore:"加载更多"},errors:{fileTooLarge:"单个文件不能超过 200 MB",invalidImageType:"请选择 PNG、JPG 或 JPEG 图片",invalidDocumentType:"请选择 PDF、PPTX、DOCX、XLSX 或 TXT 文件",createBase:"创建知识库失败",updateBase:"更新知识库失败",metadataObject:"Metadata 必须是 JSON 对象",metadataFormat:"Metadata 格式错误",noWebPreview:"网页没有可预览的 Markdown 内容",addWeb:"添加网页失败",previewWeb:"生成网页预览失败",uploadFile:"上传文件失败",updateDocument:"更新知识失败",loadPreview:"加载数据预览失败",loadMoreBases:"加载更多知识库失败",loadBases:"加载知识库失败",loadMoreData:"加载更多数据失败",loadData:"加载数据失败",deleteBase:"删除知识库失败",deleteDocument:"删除知识失败"}},y1e={title:"飞书渠道",refresh:"刷新",loading:"正在加载渠道配置…",unsupported:"此 Runtime 不支持渠道管理,请升级 MPA 镜像。",unauthorized:"渠道管理需要 Studio 管理员身份及有效的 Runtime 凭据。",configurationError:"渠道管理配置不完整,请检查 Runtime 元数据及加密密钥。",requestFailed:"渠道请求失败,请检查 Runtime 连接后重试。",bound:"已绑定:{{name}}",unbound:"尚未绑定飞书机器人。",guidance:"私聊使用独立会话。在已授权群内 @ 当前机器人即可对话。",keyRequired:"绑定前请在 Runtime 配置持久的 CHANNEL_STATE_ENCRYPTION_KEY。",gateway:"消息网关",route:"入站路由",delivery:"回复投递",configured:"已配置",missing:"未配置",delivery_not_observed:"尚未观测",delivery_delivered:"已投递",delivery_retrying:"重试中",missingConfig:"缺少 Runtime 配置:{{fields}}",bind:"扫码绑定",newQr:"重新生成二维码",unbind:"解除绑定",confirmUnbind:"确认解绑此机器人?解绑后将停止接收新消息。",qrAlt:"机器人绑定二维码",openQr:"打开授权页面",uncertain:"注册过程已中断。重新开始前,请检查机器人绑定与 Gateway 状态。",bindingFailed:"绑定失败,请检查 Gateway 配置后重试。",chatId:"允许的群 ID",scope:"群会话策略",saveGroup:"保存群权限",noGroups:"尚未授权任何群。私聊无需群权限。",edit:"编辑",remove:"移除",removeGroup:"移除 {{name}}",scope_group_sender:"按发言人隔离",scope_group:"全群共享",scope_group_topic_sender:"按话题和发言人隔离",scope_group_topic:"按话题共享",status_PENDING:"等待扫码",status_SCANNED:"已扫码,等待授权",status_AUTHORIZED:"已授权,准备注册",status_REGISTERING:"正在注册机器人",status_BOUND:"机器人已绑定",status_FAILED:"绑定失败",status_EXPIRED:"二维码已过期",workspaceTitle:"消息渠道",workspaceDescription:"连接消息平台,让用户直接与此智能体对话,并管理访问权限。",provider_feishu:"飞书",provider_wecom:"企业微信",provider_dingtalk:"钉钉",comingSoon:"暂未开放",unavailableDescription:"{{name}}的绑定与消息配置暂未开放。",runtimeRequired:"请先将此智能体部署到 Runtime,再配置消息渠道。",bindingTitle:"机器人绑定",connected:"已绑定",notBound:"未绑定",gatewayDescription:"用于接收渠道消息的网关配置。",routeDescription:"将渠道消息转发给当前智能体的路由配置。",deliveryDescription:"实际观测到的回复投递状态,完成配置不代表已成功投递。",groupsTitle:"群聊权限",groupsDescription:"添加允许访问的群,并设置群内对话的共享范围。",providerBindingTitle:"绑定{{name}}",providerUnbound:"绑定{{name}}机器人,让用户通过消息与此智能体对话。",qrGuidance:"使用{{name}}扫码授权,Runtime 将保存机器人凭据并配置消息网关。",wecomGuidance:"使用企业微信扫码授权,或手动填写 Bot ID 和 Secret 绑定已有机器人。",wecomBotId:"Bot ID",wecomSecret:"Secret",bindCredentials:"绑定机器人",wecomScan:"扫码绑定",wecomAuthorizing:"等待企业微信授权…",cancelAuthorization:"取消授权",wecomPopupBlocked:"授权窗口被浏览器拦截,请允许弹窗后重试。",wecomAuthCancelled:"已取消企业微信授权,可以重新扫码。",wecomAuthTimeout:"企业微信授权已超时,请重新扫码。",wecomInvalidResult:"授权结果缺少 Bot ID 或 Secret,请重新授权或手动填写。",wecomAuthFailed:"企业微信授权失败,请重试或手动填写凭据。",dingtalkClientId:"Client ID",dingtalkClientSecret:"Client Secret",manualUpgrade:"当前镜像尚不支持{{name}}手动配置,请升级后使用;仍可使用极速配置。",pairingTitle:"消息渠道扫码配对",feishuPairingDescription:"如果已有连接机器人,飞书扫码并绑定成功后原有机器人会被替换,可选绑定存量机器人或新建机器人。",generatingQr:"正在生成配对二维码…",dingtalkGuidance:"使用钉钉扫码授权,或手动填写 Client ID 和 Client Secret 绑定已有机器人。",wecomPairingDescription:"将在企业微信授权窗口中重新扫码配对。新机器人绑定成功后会替换当前连接;取消授权或绑定失败不会解绑原机器人。",configurationMethod:"配置方式",quickSetup:"极速配置",manualSetup:"手动配置",feishuAppId:"App ID",feishuAppSecret:"App Secret",manualGuidance:"填写已有{{name}}机器人的应用凭据,连接到当前智能体。",manualReplacement:"绑定成功后将替换当前机器人;取消或绑定失败不会解除现有绑定。"},WVe={common:Xwe,agentKitPromo:Ywe,systemInfo:Zwe,agentWorkspace:Jwe,environmentCenter:e1e,deploymentSelect:t1e,deploymentError:n1e,studioBuildProgress:i1e,cloudEnvironment:r1e,githubCicd:s1e,feishuDeployment:a1e,deploymentResources:o1e,studioUpdate:l1e,projectPreview:c1e,workspace:u1e,resourceCollection:d1e,skillSourcePicker:f1e,composer:h1e,agentSelector:p1e,myAgents:m1e,skillCenter:g1e,knowledge:b1e,channels:y1e},KVe=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:Ywe,agentSelector:p1e,agentWorkspace:Jwe,channels:y1e,cloudEnvironment:r1e,common:Xwe,composer:h1e,default:WVe,deploymentError:n1e,deploymentResources:o1e,deploymentSelect:t1e,environmentCenter:e1e,feishuDeployment:a1e,githubCicd:s1e,knowledge:b1e,myAgents:m1e,projectPreview:c1e,resourceCollection:d1e,skillCenter:g1e,skillSourcePicker:f1e,studioBuildProgress:i1e,studioUpdate:l1e,systemInfo:Zwe,workspace:u1e},Symbol.toStringTag,{value:"Module"})),v1e="用户管理",x1e="{{count}} 位成员",w1e="用户",O1e="角色",k1e="账号状态",S1e="最近登录",E1e="操作",C1e="更改角色",A1e="关闭",T1e="保存角色",_1e="正在保存…",j1e="取消",N1e="返回",R1e="用户池",I1e="火山引擎 Identity",P1e="搜索姓名、邮箱或用户 ID",D1e="搜索",M1e="筛选角色",L1e="全部角色",$1e="刷新",F1e="正在读取用户…",B1e="更新于 {{time}}",U1e="已将 {{name}} 设置为{{role}}",Q1e="重试",z1e="你",V1e="初始超级管理员",H1e="初始超级管理员受保护,不能在此降级",q1e="保存后,对方刷新 Studio 即可使用新的权限",W1e="角色需要重新确认",K1e="没有匹配的用户",G1e="尝试其他关键词或角色",X1e="用户登录或加入当前用户池后会显示在这里",Y1e="共 {{count}} 位用户",Z1e="上一页",J1e="下一页",eOe="尚未登录",tOe="未提供",nOe={super_admin:"超级管理员",admin:"管理员",developer:"开发者",user:"普通用户"},iOe={super_admin:"管理所有资源,并管理用户和分配角色",admin:"管理 Studio 资源",developer:"开发智能体并管理自己的资源",user:"使用智能体和个人功能"},rOe={EXTERNAL_PROVIDER:"正常",CONFIRMED:"正常",NORMAL:"正常",ENABLED:"正常",ACTIVE:"正常",UNCONFIRMED:"待验证",DISABLED:"已停用",FORBIDDEN:"已禁用",LOCKED:"已锁定",SUSPENDED:"已暂停",FORCE_CHANGE_PASSWORD:"需要修改密码"},sOe={request_failed:"请求未完成,请刷新列表确认当前状态后重试",invalid_response:"用户服务返回异常,请刷新后重试",identity_unavailable:"暂时无法访问 Identity,请稍后重试或检查服务权限",identity_resource_missing:"用户或用户池已不存在,请刷新列表",super_administrator_required:"只有超级管理员可以管理用户",sign_in_required:"请登录后重试",user_not_in_pool:"当前账号不属于此用户池",user_disabled:"当前账号已停用",protected_administrator:"不能降低初始超级管理员的权限",cannot_demote_self:"不能降低自己的超级管理员权限",role_change_conflict:"角色已发生变化,请关闭弹窗并刷新列表后重试",cross_origin_request:"请在当前 Studio 页面内修改角色"},GVe={title:v1e,memberCount:x1e,user:w1e,role:O1e,status:k1e,lastLogin:S1e,actions:E1e,changeRole:C1e,close:A1e,save:T1e,saving:_1e,cancel:j1e,back:N1e,pool:R1e,volcengineIdentity:I1e,searchPlaceholder:P1e,search:D1e,filterRole:M1e,allRoles:L1e,refresh:$1e,loading:F1e,updatedAt:B1e,saved:U1e,retry:Q1e,you:z1e,initialAdministrator:V1e,protectedExplanation:H1e,effectiveAfterRefresh:q1e,roleConflict:W1e,noUsers:K1e,tryAnotherSearch:G1e,poolEmpty:X1e,resultCount:Y1e,previous:Z1e,next:J1e,neverLoggedIn:eOe,unknown:tOe,roles:nOe,descriptions:iOe,states:rOe,errors:sOe},XVe=Object.freeze(Object.defineProperty({__proto__:null,actions:E1e,allRoles:L1e,back:N1e,cancel:j1e,changeRole:C1e,close:A1e,default:GVe,descriptions:iOe,effectiveAfterRefresh:q1e,errors:sOe,filterRole:M1e,initialAdministrator:V1e,lastLogin:S1e,loading:F1e,memberCount:x1e,neverLoggedIn:eOe,next:J1e,noUsers:K1e,pool:R1e,poolEmpty:X1e,previous:Z1e,protectedExplanation:H1e,refresh:$1e,resultCount:Y1e,retry:Q1e,role:O1e,roleConflict:W1e,roles:nOe,save:T1e,saved:U1e,saving:_1e,search:D1e,searchPlaceholder:P1e,states:rOe,status:k1e,title:v1e,tryAnotherSearch:G1e,unknown:tOe,updatedAt:B1e,user:w1e,volcengineIdentity:I1e,you:z1e},Symbol.toStringTag,{value:"Module"})),aOe="网站集成",oOe="将 AgentKit Runtime 以悬浮聊天窗口嵌入网站",lOe="返回自动化列表",cOe="添加网站",uOe="正在加载 Runtime",dOe="选择 Runtime",fOe="网站域名",hOe="例如 xxxx.com 或 localhost:5173",pOe="正在生成",mOe="生成 Token",gOe="已添加网站",bOe="{{count}} 个",yOe="{{count}} 个",vOe="正在加载网站集成",xOe="还没有网站集成",wOe="选择 Runtime 并输入网站域名即可生成 Token",OOe="引入方法",kOe="将下面代码放到网页的 body 结束标签前",SOe="已复制",EOe="复制代码",COe="添加网站后会在这里生成引入代码。",AOe="确定删除 {{domain}} 的网站集成吗?",TOe={load:"加载网站集成失败",create:"创建网站集成失败",delete:"删除网站集成失败",noConversationalAgent:"该 Runtime 暂未发现可对话的 Agent"},_Oe={requestFailed:"请求失败 ({{status}})",greeting:"您好,有什么可以帮您?",sessionFailed:"无法建立对话会话",unauthorized:"当前网站未获得对话授权",conversationFailed:"对话请求失败,请稍后重试",open:"打开智能体对话",close:"关闭智能体对话",panelLabel:"智能体对话面板",assistant:"智能体助手",online:"在线对话"},YVe={title:aOe,description:oOe,backToAutomations:lOe,addWebsite:cOe,loadingRuntime:uOe,selectRuntime:dOe,websiteDomain:fOe,domainPlaceholder:hOe,generating:pOe,generateToken:mOe,addedWebsites:gOe,websiteCount_one:bOe,websiteCount_other:yOe,loadingIntegrations:vOe,delete:"删除",emptyTitle:xOe,emptyDescription:wOe,embedMethod:OOe,embedInstructions:kOe,copied:SOe,copyCode:EOe,embedHint:COe,confirmDelete:AOe,errors:TOe,widget:_Oe},ZVe=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:cOe,addedWebsites:gOe,backToAutomations:lOe,confirmDelete:AOe,copied:SOe,copyCode:EOe,default:YVe,description:oOe,domainPlaceholder:hOe,embedHint:COe,embedInstructions:kOe,embedMethod:OOe,emptyDescription:wOe,emptyTitle:xOe,errors:TOe,generateToken:mOe,generating:pOe,loadingIntegrations:vOe,loadingRuntime:uOe,selectRuntime:dOe,title:aOe,websiteCount_one:bOe,websiteCount_other:yOe,websiteDomain:fOe,widget:_Oe},Symbol.toStringTag,{value:"Module"})),jOe={types:{all:"全部类型",document:"文档",image:"图片",video:"视频"},previewArtifact:"预览 {{name}}",moreActions:"更多操作 {{name}}",actionMenu:"{{name}} 操作",download:"下载",downloading:"下载中",edit:"编辑信息",delete:"删除产物",previewFailed:"无法预览“{{name}}”:{{message}}",downloadStarted:"已开始下载 {{name}}",downloadFailed:"无法下载“{{name}}”:{{message}}",updated:"已更新 {{name}}",deleted:"已删除 {{name}}",deleteFailed:"无法删除“{{name}}”:{{message}}",typeFilter:"产物类型",searchAria:"搜索产物",searchPlaceholder:"搜索产物或会话",retry:"重试",close:"关闭",listAria:"产物列表",loadFailed:"产物加载失败",loadDetailFallback:"请检查存储配置后重试。",reload:"重新加载",noMatch:"没有找到匹配的产物",noArtifacts:"您还没有任何产物",searchHint:"请尝试搜索其他名称或切换类型",emptyHint:"聊天中生成的产物会自动显示在这里",columns:{name:"名称",source:"来源",updatedAt:"修改时间",actions:"操作"},loadingMore:"正在加载更多产物",unknownTime:"时间未知",preview:{close:"关闭预览",meta:"{{type}} / 版本 {{version}}",loading:"正在加载预览",alt:"{{name}} 预览",loadFailed:"预览加载失败,请稍后重试或下载查看",unsupported:"当前格式暂不支持在线预览,请下载查看",sourceAria:"产物来源",agent:"智能体",session:"会话",tool:"生成工具",createdAt:"生成时间",fileSize:"文件大小",tags:"标签",viewSession:"查看会话"},deleteDialog:{title:"删除产物?",description:"“{{name}}”将从产物库永久删除,聊天记录不会受到影响。",deleting:"删除中",confirm:"删除",close:"关闭删除确认框"},api:{withStatus:"{{message}}({{status}})",listFailed:"读取产物库失败",syncFailed:"同步聊天产物失败",updateFailed:"更新产物失败",deleteFailed:"删除产物失败",downloadFailed:"下载产物失败"}},NOe={unknownSource:"未知来源",unknownCreator:"未知创建者"},ROe={nameRequired:"请输入产物名称",tooManyTags:"标签最多 {{max}} 个",tagTooLong:"单个标签不能超过 {{max}} 个字符",title:"编辑产物信息",subtitle:"内容文件不会被修改",close:"关闭编辑框",name:"名称",description:"描述",descriptionPlaceholder:"补充用途、版本或使用说明",tags:"标签",tagsPlaceholder:"使用逗号分隔,最多 {{max}} 个",cancel:"取消",saving:"保存中",save:"保存"},IOe={change:{added:"新增",modified:"修改",deleted:"删除"},noChanges:"两个版本的源码没有差异",chooseFile:"从左侧选择文件以查看代码",compareTitle:"版本对比",workspaceTitle:"源码工作区",projectFallback:"Agent 项目",switchTheme:"切换源码主题",switchThemeTitle:"切换为{{theme}}主题",themes:{dark:"深色",light:"浅色"},closeWorkspace:"关闭源码工作区",close:"关闭",changedFiles:"变更文件",projectFiles:"项目文件",changes:"变更",files:"文件",openFiles:"打开的文件",noFileSelected:"未选择文件",comparisonDirection:"对比方向",before:"优化前",after:"优化后",loadingEditor:"正在加载编辑器…",changedFileCount_one:"{{count}} 个文件有变更",changedFileCount_other:"{{count}} 个文件有变更",fileCount_one:"{{count}} 个文件",fileCount_other:"{{count}} 个文件",lineCount_one:"{{count}} 行 · UTF-8",lineCount_other:"{{count}} 行 · UTF-8",viewSource:"查看源码",viewSourceAria:"查看和编辑项目源码"},POe={nav:"搜索",selectAgent:"请选择 Agent",checkingCapabilities:"正在检测 Agent 能力",notMounted:"当前 Agent 未挂载{{label}}",sources:{session:"会话",web:"网络",knowledge:"知识库",memory:"长期记忆"},webDescription:"通过 web_search 工具检索",backendLocal:"本地",failed:"搜索失败:{{message}}",placeholder:{selectAgent:"请先选择 Agent",web:"在网络中检索",knowledge:"在 {{name}} 中检索",knowledgeFallback:"当前 Agent 的知识库",memory:"在 {{name}} 中检索",memoryFallback:"当前用户的长期记忆",session:"在当前 Agent 的会话中检索"},sourceTypeAria:"搜索类型:{{label}}",notSelected:"未选择",sourceType:"搜索类型",selectSource:"选择搜索类型",noAgentHint:"选择一个 Agent 后,即可检索会话、网络及其挂载的数据源。",loadingCapabilities:"正在读取当前 Agent 的检索能力…",sourceUnavailable:"当前 Agent 未挂载该数据源",instructions:{web:"输入关键词后回车或点击按钮,通过 web_search 工具检索。",knowledge:"输入问题,检索当前 Agent 挂载的知识库。",memory:"输入线索,检索当前用户跨会话保存的长期记忆。",session:"输入关键词后回车或点击按钮,搜索当前 Agent 的会话。"},noResults:"未找到匹配“{{query}}”的结果。",knowledgeFragment:"知识片段 {{index}}",memoryFragment:"记忆片段 {{index}}"},DOe={title:"开发者资源",sections:{documentation:{title:"相关链接",description:"查看开发文档与 AgentKit 常用入口"},bestPractices:{title:"最佳实践",description:"参考开发、调试与部署经验"},showcases:{title:"案例展示",description:"探索 AgentKit 应用案例"}},links:{veadkDocs:"VeADK 文档",cliDocs:"AgentKit CLI 文档",platformDocs:"AgentKit 平台文档",console:"AgentKit 控制台"},articles:{veadkDevelopment:{title:"使用 VeADK 开发并部署智能体",description:"使用 VeADK 构建 Agent,并部署至 AgentKit 智能体运行时。"},cliDevelopment:{title:"使用 AgentKit CLI 开发并部署智能体",description:"通过 AgentKit CLI 创建项目、调试 Agent,并完成部署。"},coverAlt:"{{title}}文章封面"},showcases:{researchAssistant:{title:"多智能体研究助手",description:"由多个专业 Agent 协同完成资料检索、分析和结论整理。"},multimodalAnalysis:{title:"多模态内容分析",description:"在统一会话中理解图片、文档和视频内容。"},customerService:{title:"智能客服工作台",description:"结合知识检索与工具调用处理复杂的客户服务任务。"},webSearch:{title:"联网搜索 Agent",description:"检索实时网页内容,并将信息整理为可追溯的回答。"},a2uiApp:{title:"A2UI 交互应用",description:"让 Agent 根据任务过程生成可交互的前端界面。"},previewAlt:"{{title}}界面预览"}},MOe={title:"资源库",untitledSession:"未命名会话",categoryAria:"资源库分类",regionAria:"区域",tabs:{skills:"技能库",knowledge:"知识库",artifacts:"产物"}},LOe={title:"管理 Agent",subtitle:"列出你有权管理的 AgentKit Runtime",mainAgentOnly:"仅显示主 Agent(控制面信息)。",deleteConfirm:'确定删除 Agent "{{name}}"?该 Runtime 将被永久删除。',regionFilterTitle:"按区域筛选",regionFilterAria:"区域筛选",regionAria:"区域",refresh:"刷新",loading:"加载中…",empty:"暂无你部署的 Agent。",connected:"已连接",connect:"连接到此 Agent",deleteRuntime:"删除该 Runtime",loadingDetail:"读取详情…",agentStructure:"Agent 结构",secretHidden:"敏感值不展示,可通过授权请求直接复制",revealSecret:"{{key}} 的敏感值",copySecret:"复制 {{key}} 的值",copy:"复制",copied:"已复制",copyFailed:"复制失败",notConfigured:"未配置",fields:{model:"模型",description:"描述",status:"状态信息",project:"项目",version:"版本",resources:"资源",memory:"记忆",tool:"工具",knowledge:"知识",mcpToolset:"MCP 工具集",updatedAt:"更新时间"},resource:{memory:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",concurrency:"并发 {{value}}"},environmentVariables:"环境变量",unnamed:"(未命名)"},$Oe={mainAgent:"主 Agent",subAgent:"子 Agent {{index}}",itemCount_one:"{{count}} 项",itemCount_other:"{{count}} 项",info:"Agent 信息",infoAndTopology:"Agent 信息与设置",loadingInfo:"正在读取 Agent 信息…",unnamedAgent:"未命名 Agent",agentsMd:"AGENTS.md",tools:"工具",toolList:"工具列表",studioTool:"Studio Tool",removeTool:"移除工具 {{name}}",remove:"移除",notConfigured:"未配置",addStudioTool:"添加 Studio 工具",addStudioToolHere:"在此对话中添加 Studio 工具",skills:"技能",skillList:"技能列表",addSkill:"添加技能空间技能",addSkillHere:"向此会话添加技能空间技能",skillMountNextTurn:"挂载的版本将在下一 Turn 开始时冻结。",previewUnsupported:"暂不支持预览",sessionEnvironment:"会话环境",environment:"环境",agentCanvas:"Agent 画布",topology:"结构拓扑",nodeKinds:{agent:"Agent",sandbox:"沙箱","worker-session":"Worker 会话","skill-space":"技能空间",skill:"技能","studio-tool":"Studio 工具",mcp:"MCP",environment:"环境",knowledge:"知识库","sub-agent":"子 Agent"},nodeStatuses:{configured:"已配置",mounted:"已挂载",running:"运行中",paused:"已暂停"},viewCanvasFullscreen:"全屏查看 Agent 画布",viewFullscreen:"全屏查看",executionCanvas:"Agent 执行画布",fullscreenExecutionCanvas:"全屏 Agent 执行画布",closeFullscreenCanvas:"关闭全屏画布",close:"关闭",capabilitiesSubtitle:"能力与协作拓扑",closeInfo:"关闭 Agent 信息",infoUnavailable:"暂时无法读取 Agent 信息。",refresh:"刷新信息",loadingSkills:"正在加载绑定技能…",sessionSkills:"本会话临时技能",noBoundSpace:"当前智能体未绑定技能空间。",noBoundSkills:"绑定的技能空间暂无技能。",loadFailed:"加载失败,请刷新重试。",accessDenied:"无权读取此信息。",documentUnsupported:"当前 Runtime 不支持 Studio 读取 AGENTS.md,请升级 Runtime 镜像。",skillsUnsupported:"当前 Runtime 未提供技能空间绑定信息。",skillsDegraded:"技能信息不完整,请刷新重试。",documentEditHint:"编辑最新版本。保存会发布新版本到此技能空间,可能影响使用它的其他智能体。运行中的会话可能需要等待缓存刷新或新建会话后生效。请保留 frontmatter 中的 name。",documentLoading:"正在加载 SKILL.md…",documentWritable:"可编辑",documentReadOnly:"只读:此空间或当前权限不允许编辑",documentLoadFailed:"无法加载 SKILL.md,请刷新重试。",documentSaveFailed:"未确认保存成功,已保留编辑内容。重试前请重新打开,检查当前版本。",documentConflict:"技能已有新版本。请复制当前修改,再重新打开编辑器,避免覆盖。",discardDocument:"放弃未保存的修改?",keepEditing:"继续编辑",discardChanges:"放弃修改",saveDocument:"保存为新版本"},FOe={mountFailed:"挂载环境失败",closeDialog:"关闭环境弹窗",addTitle:"添加环境",description:"选择当前会话允许 Agent 使用的 Sandbox 环境",closeAdd:"关闭添加环境",searchAria:"搜索环境",searchPlaceholder:"搜索环境名称或能力",availableAria:"可用环境与工作区",loading:"正在读取可用环境…",noMatch:"没有匹配的环境或工作区",workspaces:"工作区",reuseAll:"复用工作区中的全部可用环境",availableEnvironmentCount_one:"{{count}} 个可用环境",availableEnvironmentCount_other:"{{count}} 个可用环境",selectWorkspace:"选择工作区 {{name}}",environments:"环境",includedByWorkspaces:"已由工作区 {{names}} 包含",nameSeparator:"、",selectEnvironment:"选择环境 {{name}}",selectedWorkspaceCount_one:"{{count}} 个工作区",selectedWorkspaceCount_other:"{{count}} 个工作区",coveredEnvironmentCount_one:"{{count}} 个环境",coveredEnvironmentCount_other:"{{count}} 个环境",selectionSummary:"已选择 {{workspaces}},覆盖 {{environments}}",cancel:"取消",mounting:"正在挂载…",confirm:"确认添加",mountedAria:"已挂载环境",environmentCount_one:"{{count}} 个环境",environmentCount_other:"{{count}} 个环境",removeWorkspace:"移除工作区 {{name}}",remove:"移除",removeEnvironment:"移除环境 {{name}}",add:"添加环境",addMore:"添加更多环境",addForSession:"为当前 Session 添加环境",loadingAvailable:"正在加载可用环境…",empty:"暂无可用的 AIO Sandbox 环境。"},BOe={loading:{searching:"正在查找已有环境",creating:"环境初始化中",connecting:"正在连接已有环境"},initializationFailed:"AgentKit CLI 环境初始化失败,当前状态:{{status}}。",sessionExpired:"AgentKit CLI Session 不存在或已过期,请重试。",initializationTimeout:"AgentKit CLI 环境初始化超时,请稍后重试。",nonPersistent:"非持久化环境",recyclingHoursMinutes:"{{hours}} 小时 {{minutes}} 分钟后环境回收",recyclingMinutes:"{{minutes}} 分钟后环境回收",connectionError:`无法连接 Studio 服务,未收到服务端响应。 -原始错误:{{message}}`,unavailable:"连接不可用",requestFailed:"AgentKit CLI 请求失败",retry:"重试",terminalTitle:"AgentKit CLI 终端"},UOe={labels:{coding:"智能编程",get_city_weather:"城市天气查询",get_location_weather:"位置天气查询",web_fetch:"网页内容获取",studio_write_artifact:"保存会话产物"},closeDialog:"关闭弹窗",title:"添加 Studio 工具",description:"由 Studio BFF 为 {{agentName}} 的当前会话执行,Runtime 无需预装",close:"关闭添加 Studio 工具",searchAria:"搜索 Studio 工具",searchPlaceholder:"搜索名称或工具标识",availableAria:"可用 Studio 工具",loading:"正在读取 Studio 工具…",noMatch:"没有匹配的 Studio 工具",remove:"移除",add:"添加"},QOe={artifactLibrary:jOe,resourceMetadata:NOe,artifactEdit:ROe,codeBrowser:IOe,search:POe,developerResources:DOe,library:MOe,manageAgents:LOe,agentTopology:$Oe,sessionEnvironment:FOe,agentKitCli:BOe,studioTools:UOe},JVe=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:BOe,agentTopology:$Oe,artifactEdit:ROe,artifactLibrary:jOe,codeBrowser:IOe,default:QOe,developerResources:DOe,library:MOe,manageAgents:LOe,resourceMetadata:NOe,search:POe,sessionEnvironment:FOe,studioTools:UOe},Symbol.toStringTag,{value:"Module"})),jU=["zh-CN","en-US"],hA="en-US",zOe="agentkit.studio.locale",eHe={"zh-CN":{dir:"ltr",nativeName:"简体中文"},"en-US":{dir:"ltr",nativeName:"English"}};function pA(e){if(!e)return null;const t=e.trim().replace(/_/g,"-").toLowerCase(),n=jU.find(i=>i.toLowerCase()===t);return n||(t==="zh"||t.startsWith("zh-")?"zh-CN":t==="en"||t.startsWith("en-")?"en-US":null)}function Eo(e,t){const n=(e==null?void 0:e.trim())??"";if(!n)return"";const i=new RegExp("\\p{Script=Han}","u").test(n);return t.toLowerCase().startsWith("zh")===i?n:""}function tHe(){if(typeof window>"u")return null;try{return pA(window.localStorage.getItem(zOe))}catch{return null}}function nHe(){if(typeof window>"u")return[];const e=window.navigator;return e?e.languages.length>0?e.languages:e.language?[e.language]:[]:[]}function iHe(){const e=tHe();if(e)return e;for(const t of nHe()){const n=pA(t);if(n)return n}return hA}function rHe(e){if(!(typeof window>"u"))try{window.localStorage.setItem(zOe,e)}catch{}}function VOe(e){typeof document>"u"||(document.documentElement.lang=e,document.documentElement.dir=eHe[e].dir)}const Zn=e=>typeof e=="string",qO=()=>{let e,t;const n=new Promise((i,r)=>{e=i,t=r});return n.resolve=e,n.reject=t,n},O5=e=>e==null?"":String(e),sHe=(e,t,n)=>{e.forEach(i=>{t[i]&&(n[i]=t[i])})},aHe=/###/g,DG=e=>e&&e.includes("###")?e.replace(aHe,"."):e,MG=e=>!e||Zn(e),CS=(e,t,n)=>{const i=Zn(t)?t.split("."):t;let r=0;for(;r{const{obj:i,k:r}=CS(e,t,Object);if(i!==void 0||t.length===1){i[r]=n;return}let s=t[t.length-1],o=t.slice(0,t.length-1),l=CS(e,o,Object);for(;l.obj===void 0&&o.length;)s=`${o[o.length-1]}.${s}`,o=o.slice(0,o.length-1),l=CS(e,o,Object),l!=null&&l.obj&&typeof l.obj[`${l.k}.${s}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${s}`]=n},oHe=(e,t,n,i)=>{const{obj:r,k:s}=CS(e,t,Object);r[s]=r[s]||[],r[s].push(n)},oR=(e,t)=>{const{obj:n,k:i}=CS(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,i))return n[i]},lHe=(e,t,n)=>{const i=oR(e,n);return i!==void 0?i:oR(t,n)},HOe=(e,t,n)=>{for(const i in t)i!=="__proto__"&&i!=="constructor"&&(Object.prototype.hasOwnProperty.call(e,i)?Zn(e[i])||e[i]instanceof String||Zn(t[i])||t[i]instanceof String?n&&(e[i]=t[i]):HOe(e[i],t[i],n):e[i]=t[i]);return e},Kh=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),cHe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},uHe=e=>Zn(e)?e.replace(/[&<>"'\/]/g,t=>cHe[t]):e;class dHe{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const i=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,i),this.regExpQueue.push(t),i}}const fHe=[" ",",","?","!",";"],hHe=new dHe(20),pHe=(e,t,n)=>{t=t||"",n=n||"";const i=fHe.filter(o=>!t.includes(o)&&!n.includes(o));if(i.length===0)return!0;const r=hHe.getRegExp(`(${i.map(o=>o==="?"?"\\?":o).join("|")})`);let s=!r.test(e);if(!s){const o=e.indexOf(n);o>0&&!r.test(e.substring(0,o))&&(s=!0)}return s},dF=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const i=t.split(n);let r=e;for(let s=0;se==null?void 0:e.replace(/_/g,"-"),mHe={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var n,i;(i=(n=console==null?void 0:console[e])==null?void 0:n.apply)==null||i.call(n,console,t)}};class lR{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||mHe,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,i,r){return r&&!this.debug?null:(t=t.map(s=>Zn(s)?s.replace(/[\r\n\x00-\x1F\x7F]/g," "):s),Zn(t[0])&&(t[0]=`${i}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new lR(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new lR(this.logger,t)}}var nh=new lR;let XP=class{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const r=this.observers[i].get(n)||0;this.observers[i].set(n,r+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}once(t,n){const i=(...r)=>{n(...r),this.off(t,i)};return this.on(t,i),this}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([r,s])=>{for(let o=0;o{for(let o=0;o-1&&this.options.ns.splice(n,1)}getResource(t,n,i,r={}){var u,d;const s=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,o=r.ignoreJSONStructure!==void 0?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;t.includes(".")?l=t.split("."):(l=[t,n],i&&(Array.isArray(i)?l.push(...i):Zn(i)&&s?l.push(...i.split(s)):l.push(i)));const c=oR(this.data,l);return!c&&!n&&!i&&t.includes(".")&&(t=l[0],n=l[1],i=l.slice(2).join(".")),c||!o||!Zn(i)?c:dF((d=(u=this.data)==null?void 0:u[t])==null?void 0:d[n],i,s)}addResource(t,n,i,r,s={silent:!1}){const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let l=[t,n];i&&(l=l.concat(o?i.split(o):i)),t.includes(".")&&(l=t.split("."),r=n,n=l[1]),this.addNamespaces(n),LG(this.data,l,r),s.silent||this.emit("added",t,n,i,r)}addResources(t,n,i,r={silent:!1}){for(const s in i)(Zn(i[s])||Array.isArray(i[s]))&&this.addResource(t,n,s,i[s],{silent:!0});r.silent||this.emit("added",t,n,i)}addResourceBundle(t,n,i,r,s,o={silent:!1,skipCopy:!1}){let l=[t,n];t.includes(".")&&(l=t.split("."),r=i,i=n,n=l[1]),this.addNamespaces(n);let c=oR(this.data,l)||{};o.skipCopy||(i=JSON.parse(JSON.stringify(i))),r?HOe(c,i,s):c={...c,...i},LG(this.data,l,c),o.silent||this.emit("added",t,n,i)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(r=>n[r]&&Object.keys(n[r]).length>0)}toJSON(){return this.data}}var qOe={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,i,r){return e.forEach(s=>{var o;t=((o=this.processors[s])==null?void 0:o.process(t,n,i,r))??t}),t}};const WOe=Symbol("i18next/PATH_KEY");function gHe(){const e=[],t=Object.create(null);let n;return t.get=(i,r)=>{var s;return(s=n==null?void 0:n.revoke)==null||s.call(n),r===WOe?e:(e.push(r),n=Proxy.revocable(i,t),n.proxy)},Proxy.revocable(Object.create(null),t).proxy}function $y(e,t){const{[WOe]:n}=e(gHe()),i=(t==null?void 0:t.keySeparator)??".",r=(t==null?void 0:t.nsSeparator)??":",s=(t==null?void 0:t.enableSelector)==="strict";if(n.length>1&&r){const o=t==null?void 0:t.ns,l=s?Array.isArray(o)?o:o?[o]:null:Array.isArray(o)?o:null;if(l&&(s?l:l.length>1?l.slice(1):[]).includes(n[0]))return`${n[0]}${r}${n.slice(1).join(i)}`}return n.join(i)}const k5=e=>!Zn(e)&&typeof e!="boolean"&&typeof e!="number";class cR extends XP{constructor(t,n={}){super(),sHe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=nh.create("translator"),this.checkedLoadedFor={}}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const i={...n};if(t==null)return!1;const r=this.resolve(t,i);if((r==null?void 0:r.res)===void 0)return!1;const s=k5(r.res);return!(i.returnObjects===!1&&s)}extractFromKey(t,n){let i=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const r=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let s=n.ns||this.options.defaultNS||[];const o=i&&t.includes(i),l=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!pHe(t,i,r);if(o&&!l){const c=t.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:t,namespaces:Zn(s)?[s]:s};const u=t.split(i);(i!==r||i===r&&this.options.ns.includes(u[0]))&&(s=u.shift()),t=u.join(r)}return{key:t,namespaces:Zn(s)?[s]:s}}translate(t,n,i){let r=typeof n=="object"?{...n}:n;if(typeof r!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),typeof r=="object"&&(r={...r}),r||(r={}),t==null)return"";typeof t=="function"&&(t=$y(t,{...this.options,...r})),Array.isArray(t)||(t=[String(t)]),t=t.map(N=>typeof N=="function"?$y(N,{...this.options,...r}):String(N));const s=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,o=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,{key:l,namespaces:c}=this.extractFromKey(t[t.length-1],r),u=c[c.length-1];let d=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;d===void 0&&(d=":");const f=r.lng||this.language,h=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((f==null?void 0:f.toLowerCase())==="cimode")return h?s?{res:`${u}${d}${l}`,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(r)}:`${u}${d}${l}`:s?{res:l,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(r)}:l;const m=this.resolve(t,r);let g=m==null?void 0:m.res;const b=(m==null?void 0:m.usedKey)||l,v=(m==null?void 0:m.exactUsedKey)||l,y=["[object Number]","[object Function]","[object RegExp]"],w=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,O=r.count!==void 0&&!Zn(r.count),k=cR.hasDefaultValue(r),S=O?this.pluralResolver.getSuffix(f,r.count,r):"",C=r.ordinal&&O?this.pluralResolver.getSuffix(f,r.count,{ordinal:!1}):"",E=O&&!r.ordinal&&r.count===0,j=E&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${S}`]||r[`defaultValue${C}`]||r.defaultValue;let T=g;x&&!g&&k&&(T=j);const R=k5(T),A=Object.prototype.toString.apply(T);if(x&&T&&R&&!y.includes(A)&&!(Zn(w)&&Array.isArray(T))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const N=this.options.returnedObjectHandler?this.options.returnedObjectHandler(b,T,{...r,ns:c}):`key '${l} (${this.language})' returned an object instead of string.`;return s?(m.res=N,m.usedParams=this.getUsedParamsDetails(r),m):N}if(o){const N=Array.isArray(T),P=N?[]:{},I=N?v:b;for(const D in T)if(Object.prototype.hasOwnProperty.call(T,D)){const _=`${I}${o}${D}`;k&&!g?P[D]=this.translate(_,{...r,defaultValue:k5(j)?j[D]:void 0,joinArrays:!1,ns:c}):P[D]=this.translate(_,{...r,joinArrays:!1,ns:c}),P[D]===_&&(P[D]=T[D])}g=P}}else if(x&&Zn(w)&&Array.isArray(g))g=g.join(w),g&&(g=this.extendTranslation(g,t,r,i));else{let N=!1,P=!1;!this.isValidLookup(g)&&k&&(N=!0,g=j),this.isValidLookup(g)||(P=!0,g=l);const D=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&P?void 0:g,_=k&&j!==g&&this.options.updateMissing;if(P||N||_){if(this.logger.log(_?"updateKey":"missingKey",f,u,O&&!_?`${l}${this.pluralResolver.getSuffix(f,r.count,r)}`:l,_?j:g),o){const z=this.resolve(l,{...r,keySeparator:!1});z&&z.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let L=[];const F=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&F&&F[0])for(let z=0;z{var V;const J=k&&U!==g?U:D;this.options.missingKeyHandler?this.options.missingKeyHandler(z,u,q,J,_,r):(V=this.backendConnector)!=null&&V.saveMissing&&this.backendConnector.saveMissing(z,u,q,J,_,r),this.emit("missingKey",z,u,q,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&O?L.forEach(z=>{const q=this.pluralResolver.getSuffixes(z,r);E&&r[`defaultValue${this.options.pluralSeparator}zero`]&&!q.includes(`${this.options.pluralSeparator}zero`)&&q.push(`${this.options.pluralSeparator}zero`),q.forEach(U=>{M([z],l+U,r[`defaultValue${U}`]||j)})}):M(L,l,j))}g=this.extendTranslation(g,t,r,m,i),P&&g===l&&this.options.appendNamespaceToMissingKey&&(g=`${u}${d}${l}`),(P||N)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${d}${l}`:l,N?g:void 0,r))}return s?(m.res=g,m.usedParams=this.getUsedParamsDetails(r),m):g}extendTranslation(t,n,i,r,s){var c,u;if((c=this.i18nFormat)!=null&&c.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const d=Zn(t)&&(((u=i==null?void 0:i.interpolation)==null?void 0:u.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(d){const m=t.match(this.interpolator.nestingRegexp);f=m&&m.length}let h=i.replace&&!Zn(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(h={...this.options.interpolation.defaultVariables,...h}),t=this.interpolator.interpolate(t,h,i.lng||this.language||r.usedLng,i),d){const m=t.match(this.interpolator.nestingRegexp),g=m&&m.length;f(s==null?void 0:s[0])===m[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${m[0]} in key: ${n[0]}`),null):this.translate(...m,n),i)),i.interpolation&&this.interpolator.reset()}const o=i.postProcess||this.options.postProcess,l=Zn(o)?[o]:o;return t!=null&&(l!=null&&l.length)&&i.applyPostProcessor!==!1&&(t=qOe.handle(l,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),t}resolve(t,n={}){let i,r,s,o,l;return Zn(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(c=>typeof c=="function"?$y(c,{...this.options,...n}):c)),t.forEach(c=>{if(this.isValidLookup(i))return;const u=this.extractFromKey(c,n),d=u.key;r=d;let f=u.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const h=n.count!==void 0&&!Zn(n.count),m=h&&!n.ordinal&&n.count===0,g=n.context!==void 0&&(Zn(n.context)||typeof n.context=="number")&&n.context!=="",b=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(v=>{var y,w;this.isValidLookup(i)||(l=v,!this.checkedLoadedFor[`${b[0]}-${v}`]&&((y=this.utils)!=null&&y.hasLoadedNamespace)&&!((w=this.utils)!=null&&w.hasLoadedNamespace(l))&&(this.checkedLoadedFor[`${b[0]}-${v}`]=!0,this.logger.warn(`key "${r}" for languages "${b.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),b.forEach(x=>{var S;if(this.isValidLookup(i))return;o=x;const O=[d];if((S=this.i18nFormat)!=null&&S.addLookupKeys)this.i18nFormat.addLookupKeys(O,d,x,v,n);else{let C;h&&(C=this.pluralResolver.getSuffix(x,n.count,n));const E=`${this.options.pluralSeparator}zero`,j=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(n.ordinal&&C.startsWith(j)&&O.push(d+C.replace(j,this.options.pluralSeparator)),O.push(d+C),m&&O.push(d+E)),g){const T=`${d}${this.options.contextSeparator||"_"}${n.context}`;O.push(T),h&&(n.ordinal&&C.startsWith(j)&&O.push(T+C.replace(j,this.options.pluralSeparator)),O.push(T+C),m&&O.push(T+E))}}let k;for(;k=O.pop();)this.isValidLookup(i)||(s=k,i=this.getResource(x,v,k,n))}))})}),{res:i,usedKey:r,exactUsedKey:s,usedLng:o,usedNS:l}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,i,r={}){var s;return(s=this.i18nFormat)!=null&&s.getResource?this.i18nFormat.getResource(t,n,i,r):this.resourceStore.getResource(t,n,i,r)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=t.replace&&!Zn(t.replace);let r=i?t.replace:t;if(i&&typeof t.count<"u"&&(r={...r,count:t.count}),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!i){r={...r};for(const s of n)delete r[s]}return r}static hasDefaultValue(t){const n="defaultValue";for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&i.startsWith(n)&&t[i]!==void 0)return!0;return!1}}class FG{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=nh.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(t){if(t=NE(t),!t||!t.includes("-"))return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=NE(t),!t||!t.includes("-"))return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(Zn(t)&&t.includes("-")){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(t)}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(i=>{if(n)return;const r=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(r))&&(n=r)}),!n&&this.options.supportedLngs&&t.forEach(i=>{if(n)return;const r=this.getScriptPartFromCode(i);if(this.isSupportedCode(r))return n=r;const s=this.getLanguagePartFromCode(i);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(o=>o===s?!0:!o.includes("-")&&!s.includes("-")?!1:!!(o.includes("-")&&!s.includes("-")&&o.slice(0,o.indexOf("-"))===s||o.startsWith(s)&&s.length>1))}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),Zn(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let i=t[n];return i||(i=t[this.getScriptPartFromCode(n)]),i||(i=t[this.formatLanguageCode(n)]),i||(i=t[this.getLanguagePartFromCode(n)]),i||(i=t.default),i||[]}toResolveHierarchy(t,n){const i=this.options.fallbackLng,r=Array.isArray(i)?i.join("|"):i;r!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=r);const s=n===void 0||n===!1||Zn(n),o=n===void 0&&typeof this.options.fallbackLng=="function",l=Zn(t)&&s&&!o;let c=null;if(l){let h;n===void 0?h="undefined":n===!1?h="boolean:false":h=`string:${n}`,c=`${t.length}:${t}|${h}`}if(c!==null){const h=this.resolveHierarchyCache[c];if(h!==void 0)return h.slice()}const u=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),d=[],f=h=>{h&&(this.isSupportedCode(h)?d.push(h):this.logger.warn(`rejecting language code not found in supportedLngs: ${h}`))};return Zn(t)&&(t.includes("-")||t.includes("_"))?(this.options.load!=="languageOnly"&&f(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&f(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&f(this.getLanguagePartFromCode(t))):Zn(t)&&f(this.formatLanguageCode(t)),u.forEach(h=>{d.includes(h)||f(this.formatLanguageCode(h))}),c!==null?(this.resolveHierarchyCache[c]=d,d.slice()):d}}const BG={zero:0,one:1,two:2,few:3,many:4,other:5},UG={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class bHe{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=nh.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const i=NE(t==="dev"?"en":t),r=n.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:i,type:r});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let o;try{o=new Intl.PluralRules(i,{type:r})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),UG;if(!t.match(/-|_/))return UG;const c=this.languageUtils.getLanguagePartFromCode(t);o=this.getRule(c,n)}return this.pluralRulesCache[s]=o,o}needsPlural(t,n={}){let i=this.getRule(t,n);return i||(i=this.getRule("dev",n)),(i==null?void 0:i.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,n,i={}){return this.getSuffixes(t,i).map(r=>`${n}${r}`)}getSuffixes(t,n={}){let i=this.getRule(t,n);return i||(i=this.getRule("dev",n)),i?i.resolvedOptions().pluralCategories.sort((r,s)=>BG[r]-BG[s]).map(r=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r}`):[]}getSuffix(t,n,i={}){const r=this.getRule(t,i);return r?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${r.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,i))}}const QG=(e,t,n,i=".",r=!0)=>{let s=lHe(e,t,n);return!s&&r&&Zn(n)&&(s=dF(e,n,i),s===void 0&&(s=dF(t,n,i))),s},zG=e=>e.replace(/\$/g,"$$$$");class VG{constructor(t={}){var n;this.logger=nh.create("interpolator"),this.options=t,this.format=((n=t==null?void 0:t.interpolation)==null?void 0:n.format)||(i=>i),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:i,useRawValueToEscape:r,prefix:s,prefixEscaped:o,suffix:l,suffixEscaped:c,formatSeparator:u,unescapeSuffix:d,unescapePrefix:f,nestingPrefix:h,nestingPrefixEscaped:m,nestingSuffix:g,nestingSuffixEscaped:b,nestingOptionsSeparator:v,maxReplaces:y,alwaysFormat:w}=t.interpolation;this.escape=n!==void 0?n:uHe,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=r!==void 0?r:!1,this.prefix=s?Kh(s):o||"{{",this.suffix=l?Kh(l):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":f?Kh(f):"-",this.unescapeSuffix=this.unescapePrefix?"":d?Kh(d):"",this.nestingPrefix=h?Kh(h):m||Kh("$t("),this.nestingSuffix=g?Kh(g):b||Kh(")"),this.nestingOptionsSeparator=v||",",this.maxReplaces=y||1e3,this.alwaysFormat=w!==void 0?w:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,i)=>(n==null?void 0:n.source)===i?(n.lastIndex=0,n):new RegExp(i,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,n,i,r){var m;let s,o,l;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=g=>{if(!g.includes(this.formatSeparator)){const w=QG(n,c,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(w,void 0,i,{...r,...n,interpolationkey:g}):w}const b=g.split(this.formatSeparator),v=b.shift().trim(),y=b.join(this.formatSeparator).trim();return this.format(QG(n,c,v,this.options.keySeparator,this.options.ignoreJSONStructure),y,i,{...r,...n,interpolationkey:v})};this.resetRegExp(),!this.escapeValue&&typeof t=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(t)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const d=(r==null?void 0:r.missingInterpolationHandler)||this.options.missingInterpolationHandler,f=((m=r==null?void 0:r.interpolation)==null?void 0:m.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>g},{regex:this.regexp,safeValue:g=>this.escapeValue?this.escape(g):g}].forEach(g=>{for(l=0;s=g.regex.exec(t);){const b=s[1].trim();if(o=u(b),o===void 0)if(typeof d=="function"){const y=d(t,s,r);o=Zn(y)?y:""}else if(r&&Object.prototype.hasOwnProperty.call(r,b))o="";else if(f){o=s[0];continue}else this.logger.warn(`missed to pass in variable ${b} for interpolating ${t}`),o="";else!Zn(o)&&!this.useRawValueToEscape&&(o=O5(o));const v=g.safeValue(o);if(t=t.replace(s[0],zG(v)),f?(g.regex.lastIndex+=v.length,g.regex.lastIndex-=s[0].length):g.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),t}nest(t,n,i={}){let r,s,o;const l=(c,u)=>{const d=this.nestingOptionsSeparator;if(!c.includes(d))return c;const f=c.split(new RegExp(`${Kh(d)}[ ]*{`));let h=`{${f[1]}`;c=f[0],h=this.interpolate(h,o);const m=h.match(/'/g),g=h.match(/"/g);(((m==null?void 0:m.length)??0)%2===0&&!g||((g==null?void 0:g.length)??0)%2!==0)&&(h=h.replace(/'/g,'"'));try{o=JSON.parse(h),u&&(o={...u,...o})}catch(b){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,b),`${c}${d}${h}`}return o.defaultValue&&o.defaultValue.includes(this.prefix)&&delete o.defaultValue,c};for(;r=this.nestingRegexp.exec(t);){let c=[];o={...i},o=o.replace&&!Zn(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;const u=/{.*}/s.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(u!==-1&&(c=r[1].slice(u).split(this.formatSeparator).map(d=>d.trim()).filter(Boolean),r[1]=r[1].slice(0,u)),s=n(l.call(this,r[1].trim(),o),o),s&&r[0]===t&&!Zn(s))return s;Zn(s)||(s=O5(s)),s||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${t}`),s=""),c.length&&(s=c.reduce((d,f)=>this.format(d,f,i.lng,{...i,interpolationkey:r[1].trim()}),s.trim())),t=t.replace(r[0],zG(O5(s))),this.regexp.lastIndex=0}return t}}const yHe=e=>{let t=e.toLowerCase().trim();const n={};if(e.includes("(")){const i=e.split("(");t=i[0].toLowerCase().trim();const r=i[1].slice(0,-1);t==="currency"&&!r.includes(":")?n.currency||(n.currency=r.trim()):t==="relativetime"&&!r.includes(":")?n.range||(n.range=r.trim()):r.split(";").forEach(o=>{if(o){const[l,...c]=o.split(":"),u=c.join(":").trim().replace(/^'+|'+$/g,""),d=l.trim();n[d]||(n[d]=u),u==="false"&&(n[d]=!1),u==="true"&&(n[d]=!0),isNaN(u)||(n[d]=parseInt(u,10))}})}return{formatName:t,formatOptions:n}},HG=e=>{const t={};return(n,i,r)=>{let s=r;r&&r.interpolationkey&&r.formatParams&&r.formatParams[r.interpolationkey]&&r[r.interpolationkey]&&(s={...s,[r.interpolationkey]:void 0});const o=i+JSON.stringify(s);let l=t[o];return l||(l=e(NE(i),r),t[o]=l),l(n)}},vHe=e=>(t,n,i)=>e(NE(n),i)(t);class xHe{constructor(t={}){this.logger=nh.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const i=n.cacheInBuiltFormats?HG:vHe;this.formats={number:i((r,s)=>{const o=new Intl.NumberFormat(r,{...s});return l=>o.format(l)}),currency:i((r,s)=>{const o=new Intl.NumberFormat(r,{...s,style:"currency"});return l=>o.format(l)}),datetime:i((r,s)=>{const o=new Intl.DateTimeFormat(r,{...s});return l=>o.format(l)}),relativetime:i((r,s)=>{const o=new Intl.RelativeTimeFormat(r,{...s});return l=>o.format(l,s.range||"day")}),list:i((r,s)=>{const o=new Intl.ListFormat(r,{...s});return l=>o.format(l)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=HG(n)}format(t,n,i,r={}){if(!n||t==null)return t;const s=n.split(this.formatSeparator),o=[];for(let c=0;c-1&&!u.includes(")")&&c+1{var h;const{formatName:d,formatOptions:f}=yHe(u);if(this.formats[d]){let m=c;try{const g=((h=r==null?void 0:r.formatParams)==null?void 0:h[r.interpolationkey])||{},b=g.locale||g.lng||r.locale||r.lng||i;m=this.formats[d](c,b,{...f,...r,...g})}catch(g){this.logger.warn(g)}return m}else this.logger.warn(`there was no format function for ${d}`);return c},t)}}const wHe=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class OHe extends XP{constructor(t,n,i,r={}){var s,o;super(),this.backend=t,this.store=n,this.services=i,this.languageUtils=i.languageUtils,this.options=r,this.logger=nh.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],(o=(s=this.backend)==null?void 0:s.init)==null||o.call(s,i,r.backend,r)}queueLoad(t,n,i,r){const s={},o={},l={},c={};return t.forEach(u=>{let d=!0;n.forEach(f=>{const h=`${u}|${f}`;!i.reload&&this.store.hasResourceBundle(u,f)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?o[h]===void 0&&(o[h]=!0):(this.state[h]=1,d=!1,o[h]===void 0&&(o[h]=!0),s[h]===void 0&&(s[h]=!0),c[f]===void 0&&(c[f]=!0)))}),d||(l[u]=!0)}),(Object.keys(s).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(s),pending:Object.keys(o),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(c)}}loaded(t,n,i){const r=t.split("|"),s=r[0],o=r[1];n&&this.emit("failedLoading",s,o,n),!n&&i&&this.store.addResourceBundle(s,o,i,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&i&&(this.state[t]=0);const l={};this.queue.forEach(c=>{oHe(c.loaded,[s],o),wHe(c,t),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(u=>{l[u]||(l[u]={});const d=c.loaded[u];d.length&&d.forEach(f=>{l[u][f]===void 0&&(l[u][f]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(c=>!c.done)}read(t,n,i,r=0,s=this.retryTimeout,o){if(!t.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:i,tried:r,wait:s,callback:o});return}this.readingCalls++;const l=(u,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(u&&d&&r{this.read(t,n,i,r+1,s*2,o)},s);return}o(u,d)},c=this.backend[i].bind(this.backend);if(c.length===2){try{const u=c(t,n);u&&typeof u.then=="function"?u.then(d=>l(null,d)).catch(l):l(null,u)}catch(u){l(u)}return}return c(t,n,l)}prepareLoading(t,n,i={},r){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();Zn(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Zn(n)&&(n=[n]);const s=this.queueLoad(t,n,i,r);if(!s.toLoad.length)return s.pending.length||r(),null;s.toLoad.forEach(o=>{this.loadOne(o)})}load(t,n,i){this.prepareLoading(t,n,{},i)}reload(t,n,i){this.prepareLoading(t,n,{reload:!0},i)}loadOne(t,n=""){const i=t.split("|"),r=i[0],s=i[1];this.read(r,s,"read",void 0,void 0,(o,l)=>{o&&this.logger.warn(`${n}loading namespace ${s} for language ${r} failed`,o),!o&&l&&this.logger.log(`${n}loaded namespace ${s} for language ${r}`,l),this.loaded(t,o,l)})}saveMissing(t,n,i,r,s,o={},l=()=>{}){var c,u,d,f,h;if((u=(c=this.services)==null?void 0:c.utils)!=null&&u.hasLoadedNamespace&&!((f=(d=this.services)==null?void 0:d.utils)!=null&&f.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${i}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(i==null||i==="")){if((h=this.backend)!=null&&h.create){const m={...o,isUpdate:s},g=this.backend.create.bind(this.backend);if(g.length<6)try{let b;g.length===5?b=g(t,n,i,r,m):b=g(t,n,i,r),b&&typeof b.then=="function"?b.then(v=>l(null,v)).catch(l):l(null,b)}catch(b){l(b)}else g(t,n,i,r,l,m)}!t||!t[0]||this.store.addResource(t[0],n,i,r)}}}const S5=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),Zn(e[1])&&(t.defaultValue=e[1]),Zn(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(i=>{t[i]=n[i]})}return t},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),qG=e=>(Zn(e.ns)&&(e.ns=[e.ns]),Zn(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Zn(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),C2=()=>{},kHe=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class AS extends XP{constructor(t={},n){if(super(),this.options=qG(t),this.services={},this.logger=nh,this.modules={external:[]},kHe(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(Zn(t.ns)?t.defaultNS=t.ns:t.ns.includes("translation")||(t.defaultNS=t.ns[0]));const i=S5();this.options={...i,...this.options,...qG(t)},this.options.interpolation={...i.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=i.overloadTranslationOptionHandler);const r=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?nh.init(r(this.modules.logger),this.options):nh.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=xHe;const d=new FG(this.options);this.store=new $G(this.options.resources,this.options);const f=this.services;f.logger=nh,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new bHe(d,{prepend:this.options.pluralSeparator}),u&&(f.formatter=r(u),f.formatter.init&&f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new VG(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new OHe(r(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(h,...m)=>{this.emit(h,...m)}),this.modules.languageDetector&&(f.languageDetector=r(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=r(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new cR(this.services,this.options),this.translator.on("*",(h,...m)=>{this.emit(h,...m)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,n||(n=C2),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=(...d)=>this.store[u](...d)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...d)=>(this.store[u](...d),this)});const l=qO(),c=()=>{const u=(d,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(f),n(d,f)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),l}loadResources(t,n=C2){var s,o;let i=n;const r=Zn(t)?t:this.language;if(typeof t=="function"&&(i=t),!this.options.resources||this.options.partialBundledLanguages){if((r==null?void 0:r.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const l=[],c=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(f=>{f!=="cimode"&&(l.includes(f)||l.push(f))})};r?c(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>c(d)),(o=(s=this.options.preload)==null?void 0:s.forEach)==null||o.call(s,u=>c(u)),this.services.backendConnector.load(l,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(u)})}else i(null)}reloadResources(t,n,i){const r=qO();return typeof t=="function"&&(i=t,t=void 0),typeof n=="function"&&(i=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),i||(i=C2),this.services.backendConnector.reload(t,n,s=>{r.resolve(),i(s)}),r}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&qOe.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!["cimode","dev"].includes(t)){for(let n=0;n{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},s=(l,c)=>{c?this.isLanguageChangingTo===t&&(r(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,i.resolve((...u)=>this.t(...u)),n&&n(l,(...u)=>this.t(...u))},o=l=>{var d,f;!t&&!l&&this.services.languageDetector&&(l=[]);const c=Zn(l)?l:l&&l[0],u=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(Zn(l)?[l]:l);u&&(this.language||r(u),this.translator.language||this.translator.changeLanguage(u),(f=(d=this.services.languageDetector)==null?void 0:d.cacheUserLanguage)==null||f.call(d,u)),this.loadResources(u,h=>{s(h,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(t),i}getFixedT(t,n,i,r){const s=r==null?void 0:r.scopeNs,o=(l,c,...u)=>{let d;typeof c!="object"?d=this.options.overloadTranslationOptionHandler([l,c].concat(u)):d={...c},d.lng=d.lng||o.lng,d.lngs=d.lngs||o.lngs;const f=d.ns!==void 0&&d.ns!==null;d.ns=d.ns||o.ns,d.keyPrefix!==""&&(d.keyPrefix=d.keyPrefix||i||o.keyPrefix);const h={...this.options,...d};Array.isArray(s)&&!f&&(h.ns=s),typeof d.keyPrefix=="function"&&(d.keyPrefix=$y(d.keyPrefix,h));const m=this.options.keySeparator||".";let g;return d.keyPrefix&&Array.isArray(l)?g=l.map(b=>(typeof b=="function"&&(b=$y(b,h)),`${d.keyPrefix}${m}${b}`)):(typeof l=="function"&&(l=$y(l,h)),g=d.keyPrefix?`${d.keyPrefix}${m}${l}`:l),this.t(g,d)};return Zn(t)?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=i,o}t(...t){var n;return(n=this.translator)==null?void 0:n.translate(...t)}exists(...t){var n;return(n=this.translator)==null?void 0:n.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const i=n.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const o=(l,c)=>{const u=this.services.backendConnector.state[`${l}|${c}`];return u===-1||u===0||u===2};if(n.precheck){const l=n.precheck(this,o);if(l!==void 0)return l}return!!(this.hasResourceBundle(i,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(i,t)&&(!r||o(s,t)))}loadNamespaces(t,n){const i=qO();return this.options.ns?(Zn(t)&&(t=[t]),t.forEach(r=>{this.options.ns.includes(r)||this.options.ns.push(r)}),this.loadResources(r=>{i.resolve(),n&&n(r)}),i):(n&&n(),Promise.resolve())}loadLanguages(t,n){const i=qO();Zn(t)&&(t=[t]);const r=this.options.preload||[],s=t.filter(o=>!r.includes(o)&&this.services.languageUtils.isSupportedCode(o));return s.length?(this.options.preload=r.concat(s),this.loadResources(o=>{i.resolve(),n&&n(o)}),i):(n&&n(),Promise.resolve())}dir(t){var r,s;if(t||(t=this.resolvedLanguage||(((r=this.languages)==null?void 0:r.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{const o=new Intl.Locale(t);if(o&&o.getTextInfo){const l=o.getTextInfo();if(l&&l.direction)return l.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],i=((s=this.services)==null?void 0:s.languageUtils)||new FG(S5());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.includes(i.getLanguagePartFromCode(t))||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){const i=new AS(t,n);return i.createInstance=AS.createInstance,i}cloneInstance(t={},n=C2){const i=t.forkResourceStore;i&&delete t.forkResourceStore;const r={...this.options,...t,isClone:!0},s=new AS(r);if((t.debug!==void 0||t.prefix!==void 0)&&(s.logger=s.logger.clone(t)),["store","services","language"].forEach(l=>{s[l]=this[l]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},i){const l=Object.keys(this.store.data).reduce((c,u)=>(c[u]={...this.store.data[u]},c[u]=Object.keys(c[u]).reduce((d,f)=>(d[f]={...c[u][f]},d),c[u]),c),{});s.store=new $G(l,r),s.services.resourceStore=s.store}if(t.interpolation){const c={...S5().interpolation,...this.options.interpolation,...t.interpolation},u={...r,interpolation:c};s.services.interpolator=new VG(u)}return s.translator=new cR(s.services,r),s.translator.on("*",(l,...c)=>{s.emit(l,...c)}),s.init(r,n),s.translator.options=r,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const uc=AS.createInstance();uc.createInstance;uc.dir;uc.init;uc.loadResources;uc.reloadResources;uc.use;uc.changeLanguage;uc.getFixedT;uc.t;uc.exists;uc.setDefaultNamespace;uc.hasLoadedNamespace;uc.loadNamespaces;uc.loadLanguages;var KOe={exports:{}},ki={};/** +原始错误:{{message}}`,unavailable:"连接不可用",requestFailed:"AgentKit CLI 请求失败",retry:"重试",terminalTitle:"AgentKit CLI 终端"},UOe={labels:{coding:"智能编程",get_city_weather:"城市天气查询",get_location_weather:"位置天气查询",web_fetch:"网页内容获取",studio_write_artifact:"保存会话产物"},closeDialog:"关闭弹窗",title:"添加 Studio 工具",description:"由 Studio BFF 为 {{agentName}} 的当前会话执行,Runtime 无需预装",close:"关闭添加 Studio 工具",searchAria:"搜索 Studio 工具",searchPlaceholder:"搜索名称或工具标识",availableAria:"可用 Studio 工具",loading:"正在读取 Studio 工具…",noMatch:"没有匹配的 Studio 工具",remove:"移除",add:"添加"},QOe={artifactLibrary:jOe,resourceMetadata:NOe,artifactEdit:ROe,codeBrowser:IOe,search:POe,developerResources:DOe,library:MOe,manageAgents:LOe,agentTopology:$Oe,sessionEnvironment:FOe,agentKitCli:BOe,studioTools:UOe},JVe=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:BOe,agentTopology:$Oe,artifactEdit:ROe,artifactLibrary:jOe,codeBrowser:IOe,default:QOe,developerResources:DOe,library:MOe,manageAgents:LOe,resourceMetadata:NOe,search:POe,sessionEnvironment:FOe,studioTools:UOe},Symbol.toStringTag,{value:"Module"})),jU=["zh-CN","en-US"],yA="en-US",zOe="agentkit.studio.locale",eHe={"zh-CN":{dir:"ltr",nativeName:"简体中文"},"en-US":{dir:"ltr",nativeName:"English"}};function vA(e){if(!e)return null;const t=e.trim().replace(/_/g,"-").toLowerCase(),n=jU.find(i=>i.toLowerCase()===t);return n||(t==="zh"||t.startsWith("zh-")?"zh-CN":t==="en"||t.startsWith("en-")?"en-US":null)}function So(e,t){const n=(e==null?void 0:e.trim())??"";if(!n)return"";const i=new RegExp("\\p{Script=Han}","u").test(n);return t.toLowerCase().startsWith("zh")===i?n:""}function tHe(){if(typeof window>"u")return null;try{return vA(window.localStorage.getItem(zOe))}catch{return null}}function nHe(){if(typeof window>"u")return[];const e=window.navigator;return e?e.languages.length>0?e.languages:e.language?[e.language]:[]:[]}function iHe(){const e=tHe();if(e)return e;for(const t of nHe()){const n=vA(t);if(n)return n}return yA}function rHe(e){if(!(typeof window>"u"))try{window.localStorage.setItem(zOe,e)}catch{}}function VOe(e){typeof document>"u"||(document.documentElement.lang=e,document.documentElement.dir=eHe[e].dir)}const Zn=e=>typeof e=="string",YO=()=>{let e,t;const n=new Promise((i,r)=>{e=i,t=r});return n.resolve=e,n.reject=t,n},O5=e=>e==null?"":String(e),sHe=(e,t,n)=>{e.forEach(i=>{t[i]&&(n[i]=t[i])})},aHe=/###/g,DG=e=>e&&e.includes("###")?e.replace(aHe,"."):e,MG=e=>!e||Zn(e),NS=(e,t,n)=>{const i=Zn(t)?t.split("."):t;let r=0;for(;r{const{obj:i,k:r}=NS(e,t,Object);if(i!==void 0||t.length===1){i[r]=n;return}let s=t[t.length-1],o=t.slice(0,t.length-1),l=NS(e,o,Object);for(;l.obj===void 0&&o.length;)s=`${o[o.length-1]}.${s}`,o=o.slice(0,o.length-1),l=NS(e,o,Object),l!=null&&l.obj&&typeof l.obj[`${l.k}.${s}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${s}`]=n},oHe=(e,t,n,i)=>{const{obj:r,k:s}=NS(e,t,Object);r[s]=r[s]||[],r[s].push(n)},lR=(e,t)=>{const{obj:n,k:i}=NS(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,i))return n[i]},lHe=(e,t,n)=>{const i=lR(e,n);return i!==void 0?i:lR(t,n)},HOe=(e,t,n)=>{for(const i in t)i!=="__proto__"&&i!=="constructor"&&(Object.prototype.hasOwnProperty.call(e,i)?Zn(e[i])||e[i]instanceof String||Zn(t[i])||t[i]instanceof String?n&&(e[i]=t[i]):HOe(e[i],t[i],n):e[i]=t[i]);return e},qh=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),cHe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},uHe=e=>Zn(e)?e.replace(/[&<>"'\/]/g,t=>cHe[t]):e;class dHe{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const i=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,i),this.regExpQueue.push(t),i}}const fHe=[" ",",","?","!",";"],hHe=new dHe(20),pHe=(e,t,n)=>{t=t||"",n=n||"";const i=fHe.filter(o=>!t.includes(o)&&!n.includes(o));if(i.length===0)return!0;const r=hHe.getRegExp(`(${i.map(o=>o==="?"?"\\?":o).join("|")})`);let s=!r.test(e);if(!s){const o=e.indexOf(n);o>0&&!r.test(e.substring(0,o))&&(s=!0)}return s},dF=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const i=t.split(n);let r=e;for(let s=0;se==null?void 0:e.replace(/_/g,"-"),mHe={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var n,i;(i=(n=console==null?void 0:console[e])==null?void 0:n.apply)==null||i.call(n,console,t)}};class cR{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||mHe,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,i,r){return r&&!this.debug?null:(t=t.map(s=>Zn(s)?s.replace(/[\r\n\x00-\x1F\x7F]/g," "):s),Zn(t[0])&&(t[0]=`${i}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new cR(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new cR(this.logger,t)}}var ih=new cR;let YP=class{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const r=this.observers[i].get(n)||0;this.observers[i].set(n,r+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}once(t,n){const i=(...r)=>{n(...r),this.off(t,i)};return this.on(t,i),this}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([r,s])=>{for(let o=0;o{for(let o=0;o-1&&this.options.ns.splice(n,1)}getResource(t,n,i,r={}){var u,d;const s=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,o=r.ignoreJSONStructure!==void 0?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;t.includes(".")?l=t.split("."):(l=[t,n],i&&(Array.isArray(i)?l.push(...i):Zn(i)&&s?l.push(...i.split(s)):l.push(i)));const c=lR(this.data,l);return!c&&!n&&!i&&t.includes(".")&&(t=l[0],n=l[1],i=l.slice(2).join(".")),c||!o||!Zn(i)?c:dF((d=(u=this.data)==null?void 0:u[t])==null?void 0:d[n],i,s)}addResource(t,n,i,r,s={silent:!1}){const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let l=[t,n];i&&(l=l.concat(o?i.split(o):i)),t.includes(".")&&(l=t.split("."),r=n,n=l[1]),this.addNamespaces(n),LG(this.data,l,r),s.silent||this.emit("added",t,n,i,r)}addResources(t,n,i,r={silent:!1}){for(const s in i)(Zn(i[s])||Array.isArray(i[s]))&&this.addResource(t,n,s,i[s],{silent:!0});r.silent||this.emit("added",t,n,i)}addResourceBundle(t,n,i,r,s,o={silent:!1,skipCopy:!1}){let l=[t,n];t.includes(".")&&(l=t.split("."),r=i,i=n,n=l[1]),this.addNamespaces(n);let c=lR(this.data,l)||{};o.skipCopy||(i=JSON.parse(JSON.stringify(i))),r?HOe(c,i,s):c={...c,...i},LG(this.data,l,c),o.silent||this.emit("added",t,n,i)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(r=>n[r]&&Object.keys(n[r]).length>0)}toJSON(){return this.data}}var qOe={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,i,r){return e.forEach(s=>{var o;t=((o=this.processors[s])==null?void 0:o.process(t,n,i,r))??t}),t}};const WOe=Symbol("i18next/PATH_KEY");function gHe(){const e=[],t=Object.create(null);let n;return t.get=(i,r)=>{var s;return(s=n==null?void 0:n.revoke)==null||s.call(n),r===WOe?e:(e.push(r),n=Proxy.revocable(i,t),n.proxy)},Proxy.revocable(Object.create(null),t).proxy}function Uy(e,t){const{[WOe]:n}=e(gHe()),i=(t==null?void 0:t.keySeparator)??".",r=(t==null?void 0:t.nsSeparator)??":",s=(t==null?void 0:t.enableSelector)==="strict";if(n.length>1&&r){const o=t==null?void 0:t.ns,l=s?Array.isArray(o)?o:o?[o]:null:Array.isArray(o)?o:null;if(l&&(s?l:l.length>1?l.slice(1):[]).includes(n[0]))return`${n[0]}${r}${n.slice(1).join(i)}`}return n.join(i)}const k5=e=>!Zn(e)&&typeof e!="boolean"&&typeof e!="number";class uR extends YP{constructor(t,n={}){super(),sHe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=ih.create("translator"),this.checkedLoadedFor={}}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const i={...n};if(t==null)return!1;const r=this.resolve(t,i);if((r==null?void 0:r.res)===void 0)return!1;const s=k5(r.res);return!(i.returnObjects===!1&&s)}extractFromKey(t,n){let i=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const r=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let s=n.ns||this.options.defaultNS||[];const o=i&&t.includes(i),l=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!pHe(t,i,r);if(o&&!l){const c=t.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:t,namespaces:Zn(s)?[s]:s};const u=t.split(i);(i!==r||i===r&&this.options.ns.includes(u[0]))&&(s=u.shift()),t=u.join(r)}return{key:t,namespaces:Zn(s)?[s]:s}}translate(t,n,i){let r=typeof n=="object"?{...n}:n;if(typeof r!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),typeof r=="object"&&(r={...r}),r||(r={}),t==null)return"";typeof t=="function"&&(t=Uy(t,{...this.options,...r})),Array.isArray(t)||(t=[String(t)]),t=t.map(N=>typeof N=="function"?Uy(N,{...this.options,...r}):String(N));const s=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,o=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,{key:l,namespaces:c}=this.extractFromKey(t[t.length-1],r),u=c[c.length-1];let d=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;d===void 0&&(d=":");const f=r.lng||this.language,h=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((f==null?void 0:f.toLowerCase())==="cimode")return h?s?{res:`${u}${d}${l}`,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(r)}:`${u}${d}${l}`:s?{res:l,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(r)}:l;const m=this.resolve(t,r);let g=m==null?void 0:m.res;const b=(m==null?void 0:m.usedKey)||l,v=(m==null?void 0:m.exactUsedKey)||l,y=["[object Number]","[object Function]","[object RegExp]"],w=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,O=r.count!==void 0&&!Zn(r.count),k=uR.hasDefaultValue(r),S=O?this.pluralResolver.getSuffix(f,r.count,r):"",C=r.ordinal&&O?this.pluralResolver.getSuffix(f,r.count,{ordinal:!1}):"",E=O&&!r.ordinal&&r.count===0,j=E&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${S}`]||r[`defaultValue${C}`]||r.defaultValue;let T=g;x&&!g&&k&&(T=j);const R=k5(T),A=Object.prototype.toString.apply(T);if(x&&T&&R&&!y.includes(A)&&!(Zn(w)&&Array.isArray(T))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const N=this.options.returnedObjectHandler?this.options.returnedObjectHandler(b,T,{...r,ns:c}):`key '${l} (${this.language})' returned an object instead of string.`;return s?(m.res=N,m.usedParams=this.getUsedParamsDetails(r),m):N}if(o){const N=Array.isArray(T),P=N?[]:{},I=N?v:b;for(const D in T)if(Object.prototype.hasOwnProperty.call(T,D)){const _=`${I}${o}${D}`;k&&!g?P[D]=this.translate(_,{...r,defaultValue:k5(j)?j[D]:void 0,joinArrays:!1,ns:c}):P[D]=this.translate(_,{...r,joinArrays:!1,ns:c}),P[D]===_&&(P[D]=T[D])}g=P}}else if(x&&Zn(w)&&Array.isArray(g))g=g.join(w),g&&(g=this.extendTranslation(g,t,r,i));else{let N=!1,P=!1;!this.isValidLookup(g)&&k&&(N=!0,g=j),this.isValidLookup(g)||(P=!0,g=l);const D=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&P?void 0:g,_=k&&j!==g&&this.options.updateMissing;if(P||N||_){if(this.logger.log(_?"updateKey":"missingKey",f,u,O&&!_?`${l}${this.pluralResolver.getSuffix(f,r.count,r)}`:l,_?j:g),o){const V=this.resolve(l,{...r,keySeparator:!1});V&&V.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let L=[];const F=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&F&&F[0])for(let V=0;V{var z;const J=k&&U!==g?U:D;this.options.missingKeyHandler?this.options.missingKeyHandler(V,u,q,J,_,r):(z=this.backendConnector)!=null&&z.saveMissing&&this.backendConnector.saveMissing(V,u,q,J,_,r),this.emit("missingKey",V,u,q,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&O?L.forEach(V=>{const q=this.pluralResolver.getSuffixes(V,r);E&&r[`defaultValue${this.options.pluralSeparator}zero`]&&!q.includes(`${this.options.pluralSeparator}zero`)&&q.push(`${this.options.pluralSeparator}zero`),q.forEach(U=>{M([V],l+U,r[`defaultValue${U}`]||j)})}):M(L,l,j))}g=this.extendTranslation(g,t,r,m,i),P&&g===l&&this.options.appendNamespaceToMissingKey&&(g=`${u}${d}${l}`),(P||N)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${d}${l}`:l,N?g:void 0,r))}return s?(m.res=g,m.usedParams=this.getUsedParamsDetails(r),m):g}extendTranslation(t,n,i,r,s){var c,u;if((c=this.i18nFormat)!=null&&c.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const d=Zn(t)&&(((u=i==null?void 0:i.interpolation)==null?void 0:u.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(d){const m=t.match(this.interpolator.nestingRegexp);f=m&&m.length}let h=i.replace&&!Zn(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(h={...this.options.interpolation.defaultVariables,...h}),t=this.interpolator.interpolate(t,h,i.lng||this.language||r.usedLng,i),d){const m=t.match(this.interpolator.nestingRegexp),g=m&&m.length;f(s==null?void 0:s[0])===m[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${m[0]} in key: ${n[0]}`),null):this.translate(...m,n),i)),i.interpolation&&this.interpolator.reset()}const o=i.postProcess||this.options.postProcess,l=Zn(o)?[o]:o;return t!=null&&(l!=null&&l.length)&&i.applyPostProcessor!==!1&&(t=qOe.handle(l,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),t}resolve(t,n={}){let i,r,s,o,l;return Zn(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(c=>typeof c=="function"?Uy(c,{...this.options,...n}):c)),t.forEach(c=>{if(this.isValidLookup(i))return;const u=this.extractFromKey(c,n),d=u.key;r=d;let f=u.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const h=n.count!==void 0&&!Zn(n.count),m=h&&!n.ordinal&&n.count===0,g=n.context!==void 0&&(Zn(n.context)||typeof n.context=="number")&&n.context!=="",b=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(v=>{var y,w;this.isValidLookup(i)||(l=v,!this.checkedLoadedFor[`${b[0]}-${v}`]&&((y=this.utils)!=null&&y.hasLoadedNamespace)&&!((w=this.utils)!=null&&w.hasLoadedNamespace(l))&&(this.checkedLoadedFor[`${b[0]}-${v}`]=!0,this.logger.warn(`key "${r}" for languages "${b.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),b.forEach(x=>{var S;if(this.isValidLookup(i))return;o=x;const O=[d];if((S=this.i18nFormat)!=null&&S.addLookupKeys)this.i18nFormat.addLookupKeys(O,d,x,v,n);else{let C;h&&(C=this.pluralResolver.getSuffix(x,n.count,n));const E=`${this.options.pluralSeparator}zero`,j=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(n.ordinal&&C.startsWith(j)&&O.push(d+C.replace(j,this.options.pluralSeparator)),O.push(d+C),m&&O.push(d+E)),g){const T=`${d}${this.options.contextSeparator||"_"}${n.context}`;O.push(T),h&&(n.ordinal&&C.startsWith(j)&&O.push(T+C.replace(j,this.options.pluralSeparator)),O.push(T+C),m&&O.push(T+E))}}let k;for(;k=O.pop();)this.isValidLookup(i)||(s=k,i=this.getResource(x,v,k,n))}))})}),{res:i,usedKey:r,exactUsedKey:s,usedLng:o,usedNS:l}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,i,r={}){var s;return(s=this.i18nFormat)!=null&&s.getResource?this.i18nFormat.getResource(t,n,i,r):this.resourceStore.getResource(t,n,i,r)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=t.replace&&!Zn(t.replace);let r=i?t.replace:t;if(i&&typeof t.count<"u"&&(r={...r,count:t.count}),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!i){r={...r};for(const s of n)delete r[s]}return r}static hasDefaultValue(t){const n="defaultValue";for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&i.startsWith(n)&&t[i]!==void 0)return!0;return!1}}class FG{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ih.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(t){if(t=ME(t),!t||!t.includes("-"))return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=ME(t),!t||!t.includes("-"))return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(Zn(t)&&t.includes("-")){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(t)}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(i=>{if(n)return;const r=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(r))&&(n=r)}),!n&&this.options.supportedLngs&&t.forEach(i=>{if(n)return;const r=this.getScriptPartFromCode(i);if(this.isSupportedCode(r))return n=r;const s=this.getLanguagePartFromCode(i);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(o=>o===s?!0:!o.includes("-")&&!s.includes("-")?!1:!!(o.includes("-")&&!s.includes("-")&&o.slice(0,o.indexOf("-"))===s||o.startsWith(s)&&s.length>1))}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),Zn(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let i=t[n];return i||(i=t[this.getScriptPartFromCode(n)]),i||(i=t[this.formatLanguageCode(n)]),i||(i=t[this.getLanguagePartFromCode(n)]),i||(i=t.default),i||[]}toResolveHierarchy(t,n){const i=this.options.fallbackLng,r=Array.isArray(i)?i.join("|"):i;r!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=r);const s=n===void 0||n===!1||Zn(n),o=n===void 0&&typeof this.options.fallbackLng=="function",l=Zn(t)&&s&&!o;let c=null;if(l){let h;n===void 0?h="undefined":n===!1?h="boolean:false":h=`string:${n}`,c=`${t.length}:${t}|${h}`}if(c!==null){const h=this.resolveHierarchyCache[c];if(h!==void 0)return h.slice()}const u=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),d=[],f=h=>{h&&(this.isSupportedCode(h)?d.push(h):this.logger.warn(`rejecting language code not found in supportedLngs: ${h}`))};return Zn(t)&&(t.includes("-")||t.includes("_"))?(this.options.load!=="languageOnly"&&f(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&f(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&f(this.getLanguagePartFromCode(t))):Zn(t)&&f(this.formatLanguageCode(t)),u.forEach(h=>{d.includes(h)||f(this.formatLanguageCode(h))}),c!==null?(this.resolveHierarchyCache[c]=d,d.slice()):d}}const BG={zero:0,one:1,two:2,few:3,many:4,other:5},UG={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class bHe{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=ih.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const i=ME(t==="dev"?"en":t),r=n.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:i,type:r});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let o;try{o=new Intl.PluralRules(i,{type:r})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),UG;if(!t.match(/-|_/))return UG;const c=this.languageUtils.getLanguagePartFromCode(t);o=this.getRule(c,n)}return this.pluralRulesCache[s]=o,o}needsPlural(t,n={}){let i=this.getRule(t,n);return i||(i=this.getRule("dev",n)),(i==null?void 0:i.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,n,i={}){return this.getSuffixes(t,i).map(r=>`${n}${r}`)}getSuffixes(t,n={}){let i=this.getRule(t,n);return i||(i=this.getRule("dev",n)),i?i.resolvedOptions().pluralCategories.sort((r,s)=>BG[r]-BG[s]).map(r=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r}`):[]}getSuffix(t,n,i={}){const r=this.getRule(t,i);return r?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${r.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,i))}}const QG=(e,t,n,i=".",r=!0)=>{let s=lHe(e,t,n);return!s&&r&&Zn(n)&&(s=dF(e,n,i),s===void 0&&(s=dF(t,n,i))),s},zG=e=>e.replace(/\$/g,"$$$$");class VG{constructor(t={}){var n;this.logger=ih.create("interpolator"),this.options=t,this.format=((n=t==null?void 0:t.interpolation)==null?void 0:n.format)||(i=>i),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:i,useRawValueToEscape:r,prefix:s,prefixEscaped:o,suffix:l,suffixEscaped:c,formatSeparator:u,unescapeSuffix:d,unescapePrefix:f,nestingPrefix:h,nestingPrefixEscaped:m,nestingSuffix:g,nestingSuffixEscaped:b,nestingOptionsSeparator:v,maxReplaces:y,alwaysFormat:w}=t.interpolation;this.escape=n!==void 0?n:uHe,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=r!==void 0?r:!1,this.prefix=s?qh(s):o||"{{",this.suffix=l?qh(l):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":f?qh(f):"-",this.unescapeSuffix=this.unescapePrefix?"":d?qh(d):"",this.nestingPrefix=h?qh(h):m||qh("$t("),this.nestingSuffix=g?qh(g):b||qh(")"),this.nestingOptionsSeparator=v||",",this.maxReplaces=y||1e3,this.alwaysFormat=w!==void 0?w:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,i)=>(n==null?void 0:n.source)===i?(n.lastIndex=0,n):new RegExp(i,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,n,i,r){var m;let s,o,l;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=g=>{if(!g.includes(this.formatSeparator)){const w=QG(n,c,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(w,void 0,i,{...r,...n,interpolationkey:g}):w}const b=g.split(this.formatSeparator),v=b.shift().trim(),y=b.join(this.formatSeparator).trim();return this.format(QG(n,c,v,this.options.keySeparator,this.options.ignoreJSONStructure),y,i,{...r,...n,interpolationkey:v})};this.resetRegExp(),!this.escapeValue&&typeof t=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(t)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const d=(r==null?void 0:r.missingInterpolationHandler)||this.options.missingInterpolationHandler,f=((m=r==null?void 0:r.interpolation)==null?void 0:m.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>g},{regex:this.regexp,safeValue:g=>this.escapeValue?this.escape(g):g}].forEach(g=>{for(l=0;s=g.regex.exec(t);){const b=s[1].trim();if(o=u(b),o===void 0)if(typeof d=="function"){const y=d(t,s,r);o=Zn(y)?y:""}else if(r&&Object.prototype.hasOwnProperty.call(r,b))o="";else if(f){o=s[0];continue}else this.logger.warn(`missed to pass in variable ${b} for interpolating ${t}`),o="";else!Zn(o)&&!this.useRawValueToEscape&&(o=O5(o));const v=g.safeValue(o);if(t=t.replace(s[0],zG(v)),f?(g.regex.lastIndex+=v.length,g.regex.lastIndex-=s[0].length):g.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),t}nest(t,n,i={}){let r,s,o;const l=(c,u)=>{const d=this.nestingOptionsSeparator;if(!c.includes(d))return c;const f=c.split(new RegExp(`${qh(d)}[ ]*{`));let h=`{${f[1]}`;c=f[0],h=this.interpolate(h,o);const m=h.match(/'/g),g=h.match(/"/g);(((m==null?void 0:m.length)??0)%2===0&&!g||((g==null?void 0:g.length)??0)%2!==0)&&(h=h.replace(/'/g,'"'));try{o=JSON.parse(h),u&&(o={...u,...o})}catch(b){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,b),`${c}${d}${h}`}return o.defaultValue&&o.defaultValue.includes(this.prefix)&&delete o.defaultValue,c};for(;r=this.nestingRegexp.exec(t);){let c=[];o={...i},o=o.replace&&!Zn(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;const u=/{.*}/s.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(u!==-1&&(c=r[1].slice(u).split(this.formatSeparator).map(d=>d.trim()).filter(Boolean),r[1]=r[1].slice(0,u)),s=n(l.call(this,r[1].trim(),o),o),s&&r[0]===t&&!Zn(s))return s;Zn(s)||(s=O5(s)),s||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${t}`),s=""),c.length&&(s=c.reduce((d,f)=>this.format(d,f,i.lng,{...i,interpolationkey:r[1].trim()}),s.trim())),t=t.replace(r[0],zG(O5(s))),this.regexp.lastIndex=0}return t}}const yHe=e=>{let t=e.toLowerCase().trim();const n={};if(e.includes("(")){const i=e.split("(");t=i[0].toLowerCase().trim();const r=i[1].slice(0,-1);t==="currency"&&!r.includes(":")?n.currency||(n.currency=r.trim()):t==="relativetime"&&!r.includes(":")?n.range||(n.range=r.trim()):r.split(";").forEach(o=>{if(o){const[l,...c]=o.split(":"),u=c.join(":").trim().replace(/^'+|'+$/g,""),d=l.trim();n[d]||(n[d]=u),u==="false"&&(n[d]=!1),u==="true"&&(n[d]=!0),isNaN(u)||(n[d]=parseInt(u,10))}})}return{formatName:t,formatOptions:n}},HG=e=>{const t={};return(n,i,r)=>{let s=r;r&&r.interpolationkey&&r.formatParams&&r.formatParams[r.interpolationkey]&&r[r.interpolationkey]&&(s={...s,[r.interpolationkey]:void 0});const o=i+JSON.stringify(s);let l=t[o];return l||(l=e(ME(i),r),t[o]=l),l(n)}},vHe=e=>(t,n,i)=>e(ME(n),i)(t);class xHe{constructor(t={}){this.logger=ih.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const i=n.cacheInBuiltFormats?HG:vHe;this.formats={number:i((r,s)=>{const o=new Intl.NumberFormat(r,{...s});return l=>o.format(l)}),currency:i((r,s)=>{const o=new Intl.NumberFormat(r,{...s,style:"currency"});return l=>o.format(l)}),datetime:i((r,s)=>{const o=new Intl.DateTimeFormat(r,{...s});return l=>o.format(l)}),relativetime:i((r,s)=>{const o=new Intl.RelativeTimeFormat(r,{...s});return l=>o.format(l,s.range||"day")}),list:i((r,s)=>{const o=new Intl.ListFormat(r,{...s});return l=>o.format(l)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=HG(n)}format(t,n,i,r={}){if(!n||t==null)return t;const s=n.split(this.formatSeparator),o=[];for(let c=0;c-1&&!u.includes(")")&&c+1{var h;const{formatName:d,formatOptions:f}=yHe(u);if(this.formats[d]){let m=c;try{const g=((h=r==null?void 0:r.formatParams)==null?void 0:h[r.interpolationkey])||{},b=g.locale||g.lng||r.locale||r.lng||i;m=this.formats[d](c,b,{...f,...r,...g})}catch(g){this.logger.warn(g)}return m}else this.logger.warn(`there was no format function for ${d}`);return c},t)}}const wHe=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class OHe extends YP{constructor(t,n,i,r={}){var s,o;super(),this.backend=t,this.store=n,this.services=i,this.languageUtils=i.languageUtils,this.options=r,this.logger=ih.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],(o=(s=this.backend)==null?void 0:s.init)==null||o.call(s,i,r.backend,r)}queueLoad(t,n,i,r){const s={},o={},l={},c={};return t.forEach(u=>{let d=!0;n.forEach(f=>{const h=`${u}|${f}`;!i.reload&&this.store.hasResourceBundle(u,f)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?o[h]===void 0&&(o[h]=!0):(this.state[h]=1,d=!1,o[h]===void 0&&(o[h]=!0),s[h]===void 0&&(s[h]=!0),c[f]===void 0&&(c[f]=!0)))}),d||(l[u]=!0)}),(Object.keys(s).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(s),pending:Object.keys(o),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(c)}}loaded(t,n,i){const r=t.split("|"),s=r[0],o=r[1];n&&this.emit("failedLoading",s,o,n),!n&&i&&this.store.addResourceBundle(s,o,i,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&i&&(this.state[t]=0);const l={};this.queue.forEach(c=>{oHe(c.loaded,[s],o),wHe(c,t),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(u=>{l[u]||(l[u]={});const d=c.loaded[u];d.length&&d.forEach(f=>{l[u][f]===void 0&&(l[u][f]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(c=>!c.done)}read(t,n,i,r=0,s=this.retryTimeout,o){if(!t.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:i,tried:r,wait:s,callback:o});return}this.readingCalls++;const l=(u,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(u&&d&&r{this.read(t,n,i,r+1,s*2,o)},s);return}o(u,d)},c=this.backend[i].bind(this.backend);if(c.length===2){try{const u=c(t,n);u&&typeof u.then=="function"?u.then(d=>l(null,d)).catch(l):l(null,u)}catch(u){l(u)}return}return c(t,n,l)}prepareLoading(t,n,i={},r){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();Zn(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Zn(n)&&(n=[n]);const s=this.queueLoad(t,n,i,r);if(!s.toLoad.length)return s.pending.length||r(),null;s.toLoad.forEach(o=>{this.loadOne(o)})}load(t,n,i){this.prepareLoading(t,n,{},i)}reload(t,n,i){this.prepareLoading(t,n,{reload:!0},i)}loadOne(t,n=""){const i=t.split("|"),r=i[0],s=i[1];this.read(r,s,"read",void 0,void 0,(o,l)=>{o&&this.logger.warn(`${n}loading namespace ${s} for language ${r} failed`,o),!o&&l&&this.logger.log(`${n}loaded namespace ${s} for language ${r}`,l),this.loaded(t,o,l)})}saveMissing(t,n,i,r,s,o={},l=()=>{}){var c,u,d,f,h;if((u=(c=this.services)==null?void 0:c.utils)!=null&&u.hasLoadedNamespace&&!((f=(d=this.services)==null?void 0:d.utils)!=null&&f.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${i}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(i==null||i==="")){if((h=this.backend)!=null&&h.create){const m={...o,isUpdate:s},g=this.backend.create.bind(this.backend);if(g.length<6)try{let b;g.length===5?b=g(t,n,i,r,m):b=g(t,n,i,r),b&&typeof b.then=="function"?b.then(v=>l(null,v)).catch(l):l(null,b)}catch(b){l(b)}else g(t,n,i,r,l,m)}!t||!t[0]||this.store.addResource(t[0],n,i,r)}}}const S5=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),Zn(e[1])&&(t.defaultValue=e[1]),Zn(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(i=>{t[i]=n[i]})}return t},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),qG=e=>(Zn(e.ns)&&(e.ns=[e.ns]),Zn(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Zn(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),A2=()=>{},kHe=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class RS extends YP{constructor(t={},n){if(super(),this.options=qG(t),this.services={},this.logger=ih,this.modules={external:[]},kHe(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(Zn(t.ns)?t.defaultNS=t.ns:t.ns.includes("translation")||(t.defaultNS=t.ns[0]));const i=S5();this.options={...i,...this.options,...qG(t)},this.options.interpolation={...i.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=i.overloadTranslationOptionHandler);const r=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?ih.init(r(this.modules.logger),this.options):ih.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=xHe;const d=new FG(this.options);this.store=new $G(this.options.resources,this.options);const f=this.services;f.logger=ih,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new bHe(d,{prepend:this.options.pluralSeparator}),u&&(f.formatter=r(u),f.formatter.init&&f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new VG(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new OHe(r(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(h,...m)=>{this.emit(h,...m)}),this.modules.languageDetector&&(f.languageDetector=r(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=r(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new uR(this.services,this.options),this.translator.on("*",(h,...m)=>{this.emit(h,...m)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,n||(n=A2),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=(...d)=>this.store[u](...d)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...d)=>(this.store[u](...d),this)});const l=YO(),c=()=>{const u=(d,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(f),n(d,f)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),l}loadResources(t,n=A2){var s,o;let i=n;const r=Zn(t)?t:this.language;if(typeof t=="function"&&(i=t),!this.options.resources||this.options.partialBundledLanguages){if((r==null?void 0:r.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const l=[],c=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(f=>{f!=="cimode"&&(l.includes(f)||l.push(f))})};r?c(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>c(d)),(o=(s=this.options.preload)==null?void 0:s.forEach)==null||o.call(s,u=>c(u)),this.services.backendConnector.load(l,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(u)})}else i(null)}reloadResources(t,n,i){const r=YO();return typeof t=="function"&&(i=t,t=void 0),typeof n=="function"&&(i=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),i||(i=A2),this.services.backendConnector.reload(t,n,s=>{r.resolve(),i(s)}),r}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&qOe.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!["cimode","dev"].includes(t)){for(let n=0;n{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},s=(l,c)=>{c?this.isLanguageChangingTo===t&&(r(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,i.resolve((...u)=>this.t(...u)),n&&n(l,(...u)=>this.t(...u))},o=l=>{var d,f;!t&&!l&&this.services.languageDetector&&(l=[]);const c=Zn(l)?l:l&&l[0],u=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(Zn(l)?[l]:l);u&&(this.language||r(u),this.translator.language||this.translator.changeLanguage(u),(f=(d=this.services.languageDetector)==null?void 0:d.cacheUserLanguage)==null||f.call(d,u)),this.loadResources(u,h=>{s(h,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(t),i}getFixedT(t,n,i,r){const s=r==null?void 0:r.scopeNs,o=(l,c,...u)=>{let d;typeof c!="object"?d=this.options.overloadTranslationOptionHandler([l,c].concat(u)):d={...c},d.lng=d.lng||o.lng,d.lngs=d.lngs||o.lngs;const f=d.ns!==void 0&&d.ns!==null;d.ns=d.ns||o.ns,d.keyPrefix!==""&&(d.keyPrefix=d.keyPrefix||i||o.keyPrefix);const h={...this.options,...d};Array.isArray(s)&&!f&&(h.ns=s),typeof d.keyPrefix=="function"&&(d.keyPrefix=Uy(d.keyPrefix,h));const m=this.options.keySeparator||".";let g;return d.keyPrefix&&Array.isArray(l)?g=l.map(b=>(typeof b=="function"&&(b=Uy(b,h)),`${d.keyPrefix}${m}${b}`)):(typeof l=="function"&&(l=Uy(l,h)),g=d.keyPrefix?`${d.keyPrefix}${m}${l}`:l),this.t(g,d)};return Zn(t)?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=i,o}t(...t){var n;return(n=this.translator)==null?void 0:n.translate(...t)}exists(...t){var n;return(n=this.translator)==null?void 0:n.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const i=n.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const o=(l,c)=>{const u=this.services.backendConnector.state[`${l}|${c}`];return u===-1||u===0||u===2};if(n.precheck){const l=n.precheck(this,o);if(l!==void 0)return l}return!!(this.hasResourceBundle(i,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(i,t)&&(!r||o(s,t)))}loadNamespaces(t,n){const i=YO();return this.options.ns?(Zn(t)&&(t=[t]),t.forEach(r=>{this.options.ns.includes(r)||this.options.ns.push(r)}),this.loadResources(r=>{i.resolve(),n&&n(r)}),i):(n&&n(),Promise.resolve())}loadLanguages(t,n){const i=YO();Zn(t)&&(t=[t]);const r=this.options.preload||[],s=t.filter(o=>!r.includes(o)&&this.services.languageUtils.isSupportedCode(o));return s.length?(this.options.preload=r.concat(s),this.loadResources(o=>{i.resolve(),n&&n(o)}),i):(n&&n(),Promise.resolve())}dir(t){var r,s;if(t||(t=this.resolvedLanguage||(((r=this.languages)==null?void 0:r.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{const o=new Intl.Locale(t);if(o&&o.getTextInfo){const l=o.getTextInfo();if(l&&l.direction)return l.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],i=((s=this.services)==null?void 0:s.languageUtils)||new FG(S5());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.includes(i.getLanguagePartFromCode(t))||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){const i=new RS(t,n);return i.createInstance=RS.createInstance,i}cloneInstance(t={},n=A2){const i=t.forkResourceStore;i&&delete t.forkResourceStore;const r={...this.options,...t,isClone:!0},s=new RS(r);if((t.debug!==void 0||t.prefix!==void 0)&&(s.logger=s.logger.clone(t)),["store","services","language"].forEach(l=>{s[l]=this[l]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},i){const l=Object.keys(this.store.data).reduce((c,u)=>(c[u]={...this.store.data[u]},c[u]=Object.keys(c[u]).reduce((d,f)=>(d[f]={...c[u][f]},d),c[u]),c),{});s.store=new $G(l,r),s.services.resourceStore=s.store}if(t.interpolation){const c={...S5().interpolation,...this.options.interpolation,...t.interpolation},u={...r,interpolation:c};s.services.interpolator=new VG(u)}return s.translator=new uR(s.services,r),s.translator.on("*",(l,...c)=>{s.emit(l,...c)}),s.init(r,n),s.translator.options=r,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const lc=RS.createInstance();lc.createInstance;lc.dir;lc.init;lc.loadResources;lc.reloadResources;lc.use;lc.changeLanguage;lc.getFixedT;lc.t;lc.exists;lc.setDefaultNamespace;lc.hasLoadedNamespace;lc.loadNamespaces;lc.loadLanguages;var KOe={exports:{}},Oi={};/** * @license React * react.production.js * @@ -61,7 +61,7 @@ Studio:{{studioUrl}} * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var NU=Symbol.for("react.transitional.element"),SHe=Symbol.for("react.portal"),EHe=Symbol.for("react.fragment"),CHe=Symbol.for("react.strict_mode"),AHe=Symbol.for("react.profiler"),THe=Symbol.for("react.consumer"),_He=Symbol.for("react.context"),jHe=Symbol.for("react.forward_ref"),NHe=Symbol.for("react.suspense"),RHe=Symbol.for("react.memo"),GOe=Symbol.for("react.lazy"),IHe=Symbol.for("react.activity"),WG=Symbol.iterator;function PHe(e){return e===null||typeof e!="object"?null:(e=WG&&e[WG]||e["@@iterator"],typeof e=="function"?e:null)}var XOe={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},YOe=Object.assign,ZOe={};function A1(e,t,n){this.props=e,this.context=t,this.refs=ZOe,this.updater=n||XOe}A1.prototype.isReactComponent={};A1.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};A1.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function JOe(){}JOe.prototype=A1.prototype;function RU(e,t,n){this.props=e,this.context=t,this.refs=ZOe,this.updater=n||XOe}var IU=RU.prototype=new JOe;IU.constructor=RU;YOe(IU,A1.prototype);IU.isPureReactComponent=!0;var KG=Array.isArray;function fF(){}var Rs={H:null,A:null,T:null,S:null},eke=Object.prototype.hasOwnProperty;function PU(e,t,n){var i=n.ref;return{$$typeof:NU,type:e,key:t,ref:i!==void 0?i:null,props:n}}function DHe(e,t){return PU(e.type,t,e.props)}function DU(e){return typeof e=="object"&&e!==null&&e.$$typeof===NU}function MHe(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var GG=/\/+/g;function E5(e,t){return typeof e=="object"&&e!==null&&e.key!=null?MHe(""+e.key):t.toString(36)}function LHe(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(fF,fF):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function Zv(e,t,n,i,r){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(s){case"bigint":case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case NU:case SHe:o=!0;break;case GOe:return o=e._init,Zv(o(e._payload),t,n,i,r)}}if(o)return r=r(e),o=i===""?"."+E5(e,0):i,KG(r)?(n="",o!=null&&(n=o.replace(GG,"$&/")+"/"),Zv(r,t,n,"",function(u){return u})):r!=null&&(DU(r)&&(r=DHe(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(GG,"$&/")+"/")+o)),t.push(r)),1;o=0;var l=i===""?".":i+":";if(KG(e))for(var c=0;c<]+?)[\s/>]|([^\s=]+)=\s?("[^"]*"|'[^']*')/g;function YG(e){const t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(BHe[n[1]]||e.charAt(e.length-2)==="/")&&(t.voidElement=!0),t.name.startsWith("!--"))){const s=e.indexOf("-->");return{type:"comment",comment:s!==-1?e.slice(4,s):""}}const i=new RegExp(UHe);let r=null;for(;r=i.exec(e),r!==null;)if(r[0].trim())if(r[1]){const s=r[1].trim();let o=[s,null];const l=s.indexOf("=");l>-1&&(o=[s.slice(0,l),s.slice(l+1)]),t.attrs[o[0]]=o[1],i.lastIndex--}else r[2]&&(t.attrs[r[2]]=r[3].trim().substring(1,r[3].length-1));return t}const T2=/|<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,QHe=/<\/?([^\s]+?)[/\s>]/,zHe=/^\s*$/,VHe=/^(script|style)$/i,Wk="\0",HHe=Object.create(null);function tke(e){e.forEach(function(t){if(t.type==="text"){t.content=t.content.split(Wk).join("<");return}if(t.type==="comment"){t.comment=t.comment.split(Wk).join("<");return}for(const n in t.attrs){const i=t.attrs[n];typeof i=="string"&&i.indexOf(Wk)>-1&&(t.attrs[n]=i.split(Wk).join("<"))}t.children.length&&tke(t.children)})}function qHe(e,t){const n=t&&t.components||HHe,i=t&&t.allowedTags;let r=!1;if(i){const g=typeof i=="function"?i:function(w){return i.indexOf(w)>-1};let b="",v=0;T2.lastIndex=0;let y;for(;y=T2.exec(e);){const w=y[0];b+=e.slice(v,y.index);const x=w.match(QHe);w.startsWith("",e}}function KHe(e){return e.reduce(function(t,n){return t+nke("",n)},"")}var GHe={parse:qHe,stringify:KHe};const Fj=(e,t,n,i)=>{var s,o,l,c;const r=[n,{code:t,...i||{}}];if((o=(s=e==null?void 0:e.services)==null?void 0:s.logger)!=null&&o.forward)return e.services.logger.forward(r,"warn","react-i18next::",!0);Fc(r[0])&&(r[0]=`react-i18next:: ${r[0]}`),(c=(l=e==null?void 0:e.services)==null?void 0:l.logger)!=null&&c.warn?e.services.logger.warn(...r):console!=null&&console.warn&&console.warn(...r)},ZG={},Hx=(e,t,n,i)=>{Fc(n)&&ZG[n]||(Fc(n)&&(ZG[n]=new Date),Fj(e,t,n,i))},ike=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},hF=(e,t,n)=>{e.loadNamespaces(t,ike(e,n))},JG=(e,t,n,i)=>{if(Fc(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return hF(e,n,i);n.forEach(r=>{e.options.ns.indexOf(r)<0&&e.options.ns.push(r)}),e.loadLanguages(t,ike(e,i))},XHe=(e,t,n={})=>!t.languages||!t.languages.length?(Hx(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(i,r)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!r(i.isLanguageChangingTo,e))return!1}}),Fc=e=>typeof e=="string",kp=e=>typeof e=="object"&&e!==null,YHe=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,ZHe={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},JHe=e=>ZHe[e],rke=e=>e.replace(YHe,JHe);let pF={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:rke,transDefaultProps:void 0};const eqe=(e={})=>{pF={...pF,...e}},MU=()=>pF;let ske;const tqe=e=>{ske=e},LU=()=>ske,Bj=(e,t)=>{var i;if(!e)return!1;const n=((i=e.props)==null?void 0:i.children)??e.children;return t?n.length>0:!!n},Kk=e=>{var n,i;if(!e)return[];const t=((n=e.props)==null?void 0:n.children)??e.children;return(i=e.props)!=null&&i.i18nIsDynamicList?tg(t):t},nqe=e=>Array.isArray(e)&&e.every(p.isValidElement),tg=e=>Array.isArray(e)?e:[e],iqe=(e,t)=>{const n={...t};return n.props={...t.props,...e.props},n},rqe=e=>{const t={};if(!e)return t;const n=i=>{tg(i).forEach(s=>{Fc(s)||(Bj(s)?n(Kk(s)):kp(s)&&!p.isValidElement(s)&&Object.assign(t,s))})};return n(e),t},mF=(e,t,n,i)=>{if(!e)return"";let r="";const s=tg(e),o=t!=null&&t.transSupportBasicHtmlNodes?t.transKeepBasicHtmlNodesFor??[]:[];return s.forEach((l,c)=>{if(Fc(l)){r+=`${l}`;return}if(p.isValidElement(l)){const{props:u,type:d}=l,f=Object.keys(u).length,h=o.indexOf(d)>-1,m=u.children;if(!m&&h&&!f){r+=`<${d}/>`;return}if(!m&&(!h||f)||u.i18nIsDynamicList){r+=`<${c}>`;return}if(h&&f<=1){const b=Fc(m)?m:mF(m,t,n,i);r+=`<${d}>${b}`;return}const g=mF(m,t,n,i);r+=`<${c}>${g}`;return}if(l===null){Fj(n,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:i});return}if(kp(l)){const{format:u,...d}=l,f=Object.keys(d);if(f.length===1){const h=u?`${f[0]}, ${u}`:f[0];r+=`{{${h}}}`;return}Fj(n,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:i,child:l});return}Fj(n,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:i,child:l})}),r},sqe=(e,t,n,i,r,s,o)=>{if(n==="")return[];const l=r.transKeepBasicHtmlNodesFor||[],c=n&&new RegExp(l.map(x=>`<${x}`).join("|")).test(n);if(!e&&!t&&!c&&!o)return[n];const u=t??{},d=x=>{tg(x).forEach(k=>{Fc(k)||(Bj(k)?d(Kk(k)):kp(k)&&!p.isValidElement(k)&&Object.assign(u,k))})};d(e);const f=Object.keys(u),h=x=>/^\d+$/.test(x)||l.indexOf(x)>-1||f.indexOf(x)>-1,m=GHe.parse(`<0>${n}`,{allowedTags:h}),g={...u,...s},b=(x,O,k)=>{var E;const S=Kk(x),C=y(S,O.children,k);return nqe(S)&&C.length===0||(E=x.props)!=null&&E.i18nIsDynamicList?S:C},v=(x,O,k,S,C)=>{x.dummy?(x.children=O,k.push(p.cloneElement(x,{key:S},C?void 0:O))):k.push(...p.Children.map([x],E=>{var T;if(E.type===p.Fragment||((T=E.props)==null?void 0:T.i18nIsDynamicList)!==void 0){const R={key:S};return E&&E.props&&Object.keys(E.props).forEach(A=>{A==="children"||A==="i18nIsDynamicList"||(R[A]=E.props[A])}),p.createElement(E.type,R,C?null:O)}const j={key:S};return E&&E.props&&Object.keys(E.props).forEach(R=>{R==="ref"||R==="children"||(j[R]=E.props[R])}),p.cloneElement(E,j,C?null:O)}))},y=(x,O,k)=>{const S=tg(x),C=tg(O),E={};return C.reduce((j,T,R)=>{var N,P;const A=((P=(N=T.children)==null?void 0:N[0])==null?void 0:P.content)&&i.services.interpolator.interpolate(T.children[0].content,g,i.language);if(T.type==="tag"){let I=S[parseInt(T.name,10)];!I&&t&&(I=t[T.name]),k.length===1&&!I&&(I=k[0][T.name]),I||(I={});const D={...T.attrs};o&&Object.keys(D).forEach(q=>{const U=D[q];Fc(U)&&(D[q]=rke(U))});const _=Object.keys(D).length!==0?iqe({props:D},I):I,L=p.isValidElement(_),F=L&&Bj(T,!0)&&!T.voidElement,M=c&&kp(_)&&_.dummy&&!L,z=kp(t)&&Object.hasOwnProperty.call(t,T.name);if(Fc(_)){const q=i.services.interpolator.interpolate(_,g,i.language);j.push(q)}else if(Bj(_)||F){const q=b(_,T,k);v(_,q,j,R)}else if(M){const q=y(S,T.children,k);v(_,q,j,R)}else if(Number.isNaN(parseFloat(T.name)))if(z){const q=b(_,T,k);v(_,q,j,R,T.voidElement)}else if(r.transSupportBasicHtmlNodes&&l.indexOf(T.name)>-1)if(T.voidElement)j.push(p.createElement(T.name,{key:`${T.name}-${R}`}));else{const q=E[T.name]||0;E[T.name]=q+1;let U,J=0;for(let ne=0;ne`);else{const q=y(S,T.children,k);j.push(`<${T.name}>${q}`)}else if(kp(_)&&!L){const q=T.children[0]?A:null;q&&j.push(q)}else v(_,A,j,R,T.children.length!==1||!A)}else if(T.type==="text"){const I=r.transWrapTextNodes,D=typeof r.unescape=="function"?r.unescape:MU().unescape,_=o?D(i.services.interpolator.interpolate(T.content,g,i.language)):i.services.interpolator.interpolate(T.content,g,i.language);I?j.push(p.createElement(I,{key:`${T.name}-${R}`},_)):j.push(_)}return j},[])},w=y([{dummy:!0,children:e||[]}],m,tg(e||[]));return Kk(w[0])},ake=(e,t,n)=>{const i=e.key||t,r=p.cloneElement(e,{key:i});if(!r.props||!r.props.children||n.indexOf(`${t}/>`)<0&&n.indexOf(`${t} />`)<0)return r;function s(){return p.createElement(p.Fragment,null,r)}return p.createElement(s,{key:i})},aqe=(e,t)=>e.map((n,i)=>ake(n,i,t)),oqe=(e,t)=>{const n={};return Object.keys(e).forEach(i=>{Object.assign(n,{[i]:ake(e[i],i,t)})}),n},lqe=(e,t,n,i)=>e?Array.isArray(e)?aqe(e,t):kp(e)?oqe(e,t):(Hx(n,"TRANS_INVALID_COMPONENTS",' "components" prop expects an object or array',{i18nKey:i}),null):null,cqe=e=>!kp(e)||Array.isArray(e)?!1:Object.keys(e).reduce((t,n)=>t&&Number.isNaN(Number.parseFloat(n)),!0);function uqe({children:e,count:t,parent:n,i18nKey:i,context:r,tOptions:s={},values:o,defaults:l,components:c,ns:u,i18n:d,t:f,shouldUnescape:h,...m}){var M,z,q,U,J,V;const g=d||LU();if(!g)return Hx(g,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.",{i18nKey:i}),e;const b=f||g.t.bind(g)||(Z=>Z),v={...MU(),...(M=g.options)==null?void 0:M.react};let y=u||b.ns||((z=g.options)==null?void 0:z.defaultNS);y=Fc(y)?[y]:y||["translation"];const{transDefaultProps:w}=v,x=w!=null&&w.tOptions?{...w.tOptions,...s}:s,O=h??(w==null?void 0:w.shouldUnescape),k=w!=null&&w.values?{...w.values,...o}:o,S=w!=null&&w.components?{...w.components,...c}:c,C=mF(e,v,g,i),E=l||(x==null?void 0:x.defaultValue)||C||v.transEmptyNodeValue||(typeof i=="function"?$y(i):i),{hashTransKey:j}=v,T=i||(j?j(C||E):C||E);(U=(q=g.options)==null?void 0:q.interpolation)!=null&&U.defaultVariables?o=k&&Object.keys(k).length>0?{...k,...g.options.interpolation.defaultVariables}:{...g.options.interpolation.defaultVariables}:o=k;const R=rqe(e);R&&typeof R.count=="number"&&t===void 0&&(t=R.count);const A=o||t!==void 0&&!((V=(J=g.options)==null?void 0:J.interpolation)!=null&&V.alwaysFormat)||!e?x.interpolation:{interpolation:{...x.interpolation,prefix:"#$?",suffix:"?$#"}},N={...x,context:r||x.context,count:t,...o,...A,defaultValue:E,ns:y};let P=T?b(T,N):E;P===T&&E&&(P=E);const I=lqe(S,P,g,i);let D=I||e,_=null;cqe(I)&&(_=I,D=e);const L=sqe(D,_,P,g,v,N,O),F=n??v.defaultTransParent;return F?p.createElement(F,m,L):L}const dqe={type:"3rdParty",init(e){eqe(e.options.react),tqe(e)}},oke=p.createContext();class fqe{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function _w({children:e,count:t,parent:n,i18nKey:i,context:r,tOptions:s={},values:o,defaults:l,components:c,ns:u,i18n:d,t:f,shouldUnescape:h,...m}){var w;const{i18n:g,defaultNS:b}=p.useContext(oke)||{},v=d||g||LU(),y=f||(v==null?void 0:v.t.bind(v));return uqe({children:e,count:t,parent:n,i18nKey:i,context:r,tOptions:s,values:o,defaults:l,components:c,ns:u||(y==null?void 0:y.ns)||b||((w=v==null?void 0:v.options)==null?void 0:w.defaultNS),i18n:v,t:f,shouldUnescape:h,...m})}var lke={exports:{}},cke={};/** + */var NU=Symbol.for("react.transitional.element"),SHe=Symbol.for("react.portal"),EHe=Symbol.for("react.fragment"),CHe=Symbol.for("react.strict_mode"),AHe=Symbol.for("react.profiler"),THe=Symbol.for("react.consumer"),_He=Symbol.for("react.context"),jHe=Symbol.for("react.forward_ref"),NHe=Symbol.for("react.suspense"),RHe=Symbol.for("react.memo"),GOe=Symbol.for("react.lazy"),IHe=Symbol.for("react.activity"),WG=Symbol.iterator;function PHe(e){return e===null||typeof e!="object"?null:(e=WG&&e[WG]||e["@@iterator"],typeof e=="function"?e:null)}var XOe={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},YOe=Object.assign,ZOe={};function _1(e,t,n){this.props=e,this.context=t,this.refs=ZOe,this.updater=n||XOe}_1.prototype.isReactComponent={};_1.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};_1.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function JOe(){}JOe.prototype=_1.prototype;function RU(e,t,n){this.props=e,this.context=t,this.refs=ZOe,this.updater=n||XOe}var IU=RU.prototype=new JOe;IU.constructor=RU;YOe(IU,_1.prototype);IU.isPureReactComponent=!0;var KG=Array.isArray;function fF(){}var Rs={H:null,A:null,T:null,S:null},eke=Object.prototype.hasOwnProperty;function PU(e,t,n){var i=n.ref;return{$$typeof:NU,type:e,key:t,ref:i!==void 0?i:null,props:n}}function DHe(e,t){return PU(e.type,t,e.props)}function DU(e){return typeof e=="object"&&e!==null&&e.$$typeof===NU}function MHe(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var GG=/\/+/g;function E5(e,t){return typeof e=="object"&&e!==null&&e.key!=null?MHe(""+e.key):t.toString(36)}function LHe(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(fF,fF):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function ex(e,t,n,i,r){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(s){case"bigint":case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case NU:case SHe:o=!0;break;case GOe:return o=e._init,ex(o(e._payload),t,n,i,r)}}if(o)return r=r(e),o=i===""?"."+E5(e,0):i,KG(r)?(n="",o!=null&&(n=o.replace(GG,"$&/")+"/"),ex(r,t,n,"",function(u){return u})):r!=null&&(DU(r)&&(r=DHe(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(GG,"$&/")+"/")+o)),t.push(r)),1;o=0;var l=i===""?".":i+":";if(KG(e))for(var c=0;c<]+?)[\s/>]|([^\s=]+)=\s?("[^"]*"|'[^']*')/g;function YG(e){const t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(BHe[n[1]]||e.charAt(e.length-2)==="/")&&(t.voidElement=!0),t.name.startsWith("!--"))){const s=e.indexOf("-->");return{type:"comment",comment:s!==-1?e.slice(4,s):""}}const i=new RegExp(UHe);let r=null;for(;r=i.exec(e),r!==null;)if(r[0].trim())if(r[1]){const s=r[1].trim();let o=[s,null];const l=s.indexOf("=");l>-1&&(o=[s.slice(0,l),s.slice(l+1)]),t.attrs[o[0]]=o[1],i.lastIndex--}else r[2]&&(t.attrs[r[2]]=r[3].trim().substring(1,r[3].length-1));return t}const _2=/|<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,QHe=/<\/?([^\s]+?)[/\s>]/,zHe=/^\s*$/,VHe=/^(script|style)$/i,Zk="\0",HHe=Object.create(null);function tke(e){e.forEach(function(t){if(t.type==="text"){t.content=t.content.split(Zk).join("<");return}if(t.type==="comment"){t.comment=t.comment.split(Zk).join("<");return}for(const n in t.attrs){const i=t.attrs[n];typeof i=="string"&&i.indexOf(Zk)>-1&&(t.attrs[n]=i.split(Zk).join("<"))}t.children.length&&tke(t.children)})}function qHe(e,t){const n=t&&t.components||HHe,i=t&&t.allowedTags;let r=!1;if(i){const g=typeof i=="function"?i:function(w){return i.indexOf(w)>-1};let b="",v=0;_2.lastIndex=0;let y;for(;y=_2.exec(e);){const w=y[0];b+=e.slice(v,y.index);const x=w.match(QHe);w.startsWith("",e}}function KHe(e){return e.reduce(function(t,n){return t+nke("",n)},"")}var GHe={parse:qHe,stringify:KHe};const Bj=(e,t,n,i)=>{var s,o,l,c;const r=[n,{code:t,...i||{}}];if((o=(s=e==null?void 0:e.services)==null?void 0:s.logger)!=null&&o.forward)return e.services.logger.forward(r,"warn","react-i18next::",!0);Fc(r[0])&&(r[0]=`react-i18next:: ${r[0]}`),(c=(l=e==null?void 0:e.services)==null?void 0:l.logger)!=null&&c.warn?e.services.logger.warn(...r):console!=null&&console.warn&&console.warn(...r)},ZG={},Wx=(e,t,n,i)=>{Fc(n)&&ZG[n]||(Fc(n)&&(ZG[n]=new Date),Bj(e,t,n,i))},ike=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},hF=(e,t,n)=>{e.loadNamespaces(t,ike(e,n))},JG=(e,t,n,i)=>{if(Fc(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return hF(e,n,i);n.forEach(r=>{e.options.ns.indexOf(r)<0&&e.options.ns.push(r)}),e.loadLanguages(t,ike(e,i))},XHe=(e,t,n={})=>!t.languages||!t.languages.length?(Wx(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(i,r)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!r(i.isLanguageChangingTo,e))return!1}}),Fc=e=>typeof e=="string",wp=e=>typeof e=="object"&&e!==null,YHe=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,ZHe={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},JHe=e=>ZHe[e],rke=e=>e.replace(YHe,JHe);let pF={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:rke,transDefaultProps:void 0};const eqe=(e={})=>{pF={...pF,...e}},MU=()=>pF;let ske;const tqe=e=>{ske=e},LU=()=>ske,Uj=(e,t)=>{var i;if(!e)return!1;const n=((i=e.props)==null?void 0:i.children)??e.children;return t?n.length>0:!!n},Jk=e=>{var n,i;if(!e)return[];const t=((n=e.props)==null?void 0:n.children)??e.children;return(i=e.props)!=null&&i.i18nIsDynamicList?eg(t):t},nqe=e=>Array.isArray(e)&&e.every(p.isValidElement),eg=e=>Array.isArray(e)?e:[e],iqe=(e,t)=>{const n={...t};return n.props={...t.props,...e.props},n},rqe=e=>{const t={};if(!e)return t;const n=i=>{eg(i).forEach(s=>{Fc(s)||(Uj(s)?n(Jk(s)):wp(s)&&!p.isValidElement(s)&&Object.assign(t,s))})};return n(e),t},mF=(e,t,n,i)=>{if(!e)return"";let r="";const s=eg(e),o=t!=null&&t.transSupportBasicHtmlNodes?t.transKeepBasicHtmlNodesFor??[]:[];return s.forEach((l,c)=>{if(Fc(l)){r+=`${l}`;return}if(p.isValidElement(l)){const{props:u,type:d}=l,f=Object.keys(u).length,h=o.indexOf(d)>-1,m=u.children;if(!m&&h&&!f){r+=`<${d}/>`;return}if(!m&&(!h||f)||u.i18nIsDynamicList){r+=`<${c}>`;return}if(h&&f<=1){const b=Fc(m)?m:mF(m,t,n,i);r+=`<${d}>${b}`;return}const g=mF(m,t,n,i);r+=`<${c}>${g}`;return}if(l===null){Bj(n,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:i});return}if(wp(l)){const{format:u,...d}=l,f=Object.keys(d);if(f.length===1){const h=u?`${f[0]}, ${u}`:f[0];r+=`{{${h}}}`;return}Bj(n,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:i,child:l});return}Bj(n,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:i,child:l})}),r},sqe=(e,t,n,i,r,s,o)=>{if(n==="")return[];const l=r.transKeepBasicHtmlNodesFor||[],c=n&&new RegExp(l.map(x=>`<${x}`).join("|")).test(n);if(!e&&!t&&!c&&!o)return[n];const u=t??{},d=x=>{eg(x).forEach(k=>{Fc(k)||(Uj(k)?d(Jk(k)):wp(k)&&!p.isValidElement(k)&&Object.assign(u,k))})};d(e);const f=Object.keys(u),h=x=>/^\d+$/.test(x)||l.indexOf(x)>-1||f.indexOf(x)>-1,m=GHe.parse(`<0>${n}`,{allowedTags:h}),g={...u,...s},b=(x,O,k)=>{var E;const S=Jk(x),C=y(S,O.children,k);return nqe(S)&&C.length===0||(E=x.props)!=null&&E.i18nIsDynamicList?S:C},v=(x,O,k,S,C)=>{x.dummy?(x.children=O,k.push(p.cloneElement(x,{key:S},C?void 0:O))):k.push(...p.Children.map([x],E=>{var T;if(E.type===p.Fragment||((T=E.props)==null?void 0:T.i18nIsDynamicList)!==void 0){const R={key:S};return E&&E.props&&Object.keys(E.props).forEach(A=>{A==="children"||A==="i18nIsDynamicList"||(R[A]=E.props[A])}),p.createElement(E.type,R,C?null:O)}const j={key:S};return E&&E.props&&Object.keys(E.props).forEach(R=>{R==="ref"||R==="children"||(j[R]=E.props[R])}),p.cloneElement(E,j,C?null:O)}))},y=(x,O,k)=>{const S=eg(x),C=eg(O),E={};return C.reduce((j,T,R)=>{var N,P;const A=((P=(N=T.children)==null?void 0:N[0])==null?void 0:P.content)&&i.services.interpolator.interpolate(T.children[0].content,g,i.language);if(T.type==="tag"){let I=S[parseInt(T.name,10)];!I&&t&&(I=t[T.name]),k.length===1&&!I&&(I=k[0][T.name]),I||(I={});const D={...T.attrs};o&&Object.keys(D).forEach(q=>{const U=D[q];Fc(U)&&(D[q]=rke(U))});const _=Object.keys(D).length!==0?iqe({props:D},I):I,L=p.isValidElement(_),F=L&&Uj(T,!0)&&!T.voidElement,M=c&&wp(_)&&_.dummy&&!L,V=wp(t)&&Object.hasOwnProperty.call(t,T.name);if(Fc(_)){const q=i.services.interpolator.interpolate(_,g,i.language);j.push(q)}else if(Uj(_)||F){const q=b(_,T,k);v(_,q,j,R)}else if(M){const q=y(S,T.children,k);v(_,q,j,R)}else if(Number.isNaN(parseFloat(T.name)))if(V){const q=b(_,T,k);v(_,q,j,R,T.voidElement)}else if(r.transSupportBasicHtmlNodes&&l.indexOf(T.name)>-1)if(T.voidElement)j.push(p.createElement(T.name,{key:`${T.name}-${R}`}));else{const q=E[T.name]||0;E[T.name]=q+1;let U,J=0;for(let ne=0;ne`);else{const q=y(S,T.children,k);j.push(`<${T.name}>${q}`)}else if(wp(_)&&!L){const q=T.children[0]?A:null;q&&j.push(q)}else v(_,A,j,R,T.children.length!==1||!A)}else if(T.type==="text"){const I=r.transWrapTextNodes,D=typeof r.unescape=="function"?r.unescape:MU().unescape,_=o?D(i.services.interpolator.interpolate(T.content,g,i.language)):i.services.interpolator.interpolate(T.content,g,i.language);I?j.push(p.createElement(I,{key:`${T.name}-${R}`},_)):j.push(_)}return j},[])},w=y([{dummy:!0,children:e||[]}],m,eg(e||[]));return Jk(w[0])},ake=(e,t,n)=>{const i=e.key||t,r=p.cloneElement(e,{key:i});if(!r.props||!r.props.children||n.indexOf(`${t}/>`)<0&&n.indexOf(`${t} />`)<0)return r;function s(){return p.createElement(p.Fragment,null,r)}return p.createElement(s,{key:i})},aqe=(e,t)=>e.map((n,i)=>ake(n,i,t)),oqe=(e,t)=>{const n={};return Object.keys(e).forEach(i=>{Object.assign(n,{[i]:ake(e[i],i,t)})}),n},lqe=(e,t,n,i)=>e?Array.isArray(e)?aqe(e,t):wp(e)?oqe(e,t):(Wx(n,"TRANS_INVALID_COMPONENTS",' "components" prop expects an object or array',{i18nKey:i}),null):null,cqe=e=>!wp(e)||Array.isArray(e)?!1:Object.keys(e).reduce((t,n)=>t&&Number.isNaN(Number.parseFloat(n)),!0);function uqe({children:e,count:t,parent:n,i18nKey:i,context:r,tOptions:s={},values:o,defaults:l,components:c,ns:u,i18n:d,t:f,shouldUnescape:h,...m}){var M,V,q,U,J,z;const g=d||LU();if(!g)return Wx(g,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.",{i18nKey:i}),e;const b=f||g.t.bind(g)||(Z=>Z),v={...MU(),...(M=g.options)==null?void 0:M.react};let y=u||b.ns||((V=g.options)==null?void 0:V.defaultNS);y=Fc(y)?[y]:y||["translation"];const{transDefaultProps:w}=v,x=w!=null&&w.tOptions?{...w.tOptions,...s}:s,O=h??(w==null?void 0:w.shouldUnescape),k=w!=null&&w.values?{...w.values,...o}:o,S=w!=null&&w.components?{...w.components,...c}:c,C=mF(e,v,g,i),E=l||(x==null?void 0:x.defaultValue)||C||v.transEmptyNodeValue||(typeof i=="function"?Uy(i):i),{hashTransKey:j}=v,T=i||(j?j(C||E):C||E);(U=(q=g.options)==null?void 0:q.interpolation)!=null&&U.defaultVariables?o=k&&Object.keys(k).length>0?{...k,...g.options.interpolation.defaultVariables}:{...g.options.interpolation.defaultVariables}:o=k;const R=rqe(e);R&&typeof R.count=="number"&&t===void 0&&(t=R.count);const A=o||t!==void 0&&!((z=(J=g.options)==null?void 0:J.interpolation)!=null&&z.alwaysFormat)||!e?x.interpolation:{interpolation:{...x.interpolation,prefix:"#$?",suffix:"?$#"}},N={...x,context:r||x.context,count:t,...o,...A,defaultValue:E,ns:y};let P=T?b(T,N):E;P===T&&E&&(P=E);const I=lqe(S,P,g,i);let D=I||e,_=null;cqe(I)&&(_=I,D=e);const L=sqe(D,_,P,g,v,N,O),F=n??v.defaultTransParent;return F?p.createElement(F,m,L):L}const dqe={type:"3rdParty",init(e){eqe(e.options.react),tqe(e)}},oke=p.createContext();class fqe{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function Nw({children:e,count:t,parent:n,i18nKey:i,context:r,tOptions:s={},values:o,defaults:l,components:c,ns:u,i18n:d,t:f,shouldUnescape:h,...m}){var w;const{i18n:g,defaultNS:b}=p.useContext(oke)||{},v=d||g||LU(),y=f||(v==null?void 0:v.t.bind(v));return uqe({children:e,count:t,parent:n,i18nKey:i,context:r,tOptions:s,values:o,defaults:l,components:c,ns:u||(y==null?void 0:y.ns)||b||((w=v==null?void 0:v.options)==null?void 0:w.defaultNS),i18n:v,t:f,shouldUnescape:h,...m})}var lke={exports:{}},cke={};/** * @license React * use-sync-external-store-shim.production.js * @@ -69,7 +69,7 @@ Studio:{{studioUrl}} * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var jw=p;function hqe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var pqe=typeof Object.is=="function"?Object.is:hqe,mqe=jw.useState,gqe=jw.useEffect,bqe=jw.useLayoutEffect,yqe=jw.useDebugValue;function vqe(e,t){var n=t(),i=mqe({inst:{value:n,getSnapshot:t}}),r=i[0].inst,s=i[1];return bqe(function(){r.value=n,r.getSnapshot=t,C5(r)&&s({inst:r})},[e,n,t]),gqe(function(){return C5(r)&&s({inst:r}),e(function(){C5(r)&&s({inst:r})})},[e]),yqe(n),n}function C5(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!pqe(e,n)}catch{return!0}}function xqe(e,t){return t()}var wqe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?xqe:vqe;cke.useSyncExternalStore=jw.useSyncExternalStore!==void 0?jw.useSyncExternalStore:wqe;lke.exports=cke;var YP=lke.exports;const Oqe=(e,t)=>{if(Fc(t))return t;if(kp(t)&&Fc(t.defaultValue))return t.defaultValue;if(typeof e=="function")return"";if(Array.isArray(e)){const n=e[e.length-1];return typeof n=="function"?"":n}return e},kqe={t:Oqe,ready:!1},Sqe=()=>()=>{},Te=(e,t={})=>{var j,T,R;const{i18n:n}=t,{i18n:i,defaultNS:r}=p.useContext(oke)||{},s=n||i||LU();s&&!s.reportNamespaces&&(s.reportNamespaces=new fqe),s||Hx(s,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.");const o=p.useMemo(()=>{var A;return{...MU(),...(A=s==null?void 0:s.options)==null?void 0:A.react,...t}},[s,t]),{useSuspense:l,keyPrefix:c}=o,u=e||r||((j=s==null?void 0:s.options)==null?void 0:j.defaultNS),d=Fc(u)?[u]:u||["translation"],f=p.useMemo(()=>d,d);(R=(T=s==null?void 0:s.reportNamespaces)==null?void 0:T.addUsedNamespaces)==null||R.call(T,f);const h=p.useRef(0),m=p.useCallback(A=>{if(!s)return Sqe;const{bindI18n:N,bindI18nStore:P}=o,I=()=>{h.current+=1,A()};return N&&s.on(N,I),P&&s.store.on(P,I),()=>{N&&N.split(" ").forEach(D=>s.off(D,I)),P&&P.split(" ").forEach(D=>s.store.off(D,I))}},[s,o]),g=p.useRef(),b=p.useCallback(()=>{if(!s)return kqe;const A=!!(s.isInitialized||s.initializedStoreOnce)&&f.every(L=>XHe(L,s,o)),N=t.lng||s.language,P=h.current,I=g.current;if(I&&I.ready===A&&I.lng===N&&I.keyPrefix===c&&I.revision===P)return I;const _={t:s.getFixedT(N,o.nsMode==="fallback"?f:f[0],c,{scopeNs:f}),ready:A,lng:N,keyPrefix:c,revision:P};return g.current=_,_},[s,f,c,o,t.lng]),[v,y]=p.useState(0),{t:w,ready:x}=YP.useSyncExternalStore(m,b,b);p.useEffect(()=>{if(s&&!x&&!l){const A=()=>y(N=>N+1);t.lng?JG(s,t.lng,f,A):hF(s,f,A)}},[s,t.lng,f,x,l,v]);const O=s||{},k=p.useRef(null),S=p.useRef(),C=A=>{const N=Object.getOwnPropertyDescriptors(A);N.__original&&delete N.__original;const P=Object.create(Object.getPrototypeOf(A),N);if(!Object.prototype.hasOwnProperty.call(P,"__original"))try{Object.defineProperty(P,"__original",{value:A,writable:!1,enumerable:!1,configurable:!1})}catch{}return P},E=p.useMemo(()=>{const A=O,N=A==null?void 0:A.language;let P=A;A&&(k.current&&k.current.__original===A?S.current!==N?(P=C(A),k.current=P,S.current=N):P=k.current:(P=C(A),k.current=P,S.current=N));const I=!x&&!l?(..._)=>(Hx(s,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),w(..._)):w,D=[I,P,x];return D.t=I,D.i18n=P,D.ready=x,D},[w,O,x,O.resolvedLanguage,O.language,O.languages]);if(s&&l&&!x){let A=!1;try{A=!1}catch{}throw A&&Hx(s,"SUSPENDED_WHILE_LOADING","useTranslation: suspended while translations are loading (useSuspense is true by default). Add a boundary above this component, or set react.useSuspense: false in the i18next init options. https://react.i18next.com/latest/usetranslation-hook"),new Promise(N=>{const P=()=>N();t.lng?JG(s,t.lng,f,P):hF(s,f,P)})}return E},uke=iHe(),yn=uc.createInstance();yn.use(dqe).init({resources:{"en-US":{adk:ede,app:ife,conversation:Pfe},"zh-CN":{adk:_U,app:c0e,conversation:B0e}},lng:uke,fallbackLng:hA,supportedLngs:[...jU],defaultNS:"common",interpolation:{escapeValue:!1},initAsync:!1});VOe(uke);yn.on("languageChanged",e=>{const t=pA(e)??hA;VOe(t)});const Eqe=Object.assign({"./resources/en-US/adk.json":Qze,"./resources/en-US/agentReviews.json":Vze,"./resources/en-US/app.json":Hze,"./resources/en-US/automations.json":qze,"./resources/en-US/common.json":Kze,"./resources/en-US/conversation.json":Gze,"./resources/en-US/create.json":Xze,"./resources/en-US/cronjobs.json":Zze,"./resources/en-US/deepseek.json":eVe,"./resources/en-US/feedback.json":nVe,"./resources/en-US/migrations.json":rVe,"./resources/en-US/newChat.json":sVe,"./resources/en-US/reviews.json":oVe,"./resources/en-US/sandbox.json":lVe,"./resources/en-US/shell.json":uVe,"./resources/en-US/sidebar.json":fVe,"./resources/en-US/skills.json":hVe,"./resources/en-US/ui.json":mVe,"./resources/en-US/users.json":bVe,"./resources/en-US/websiteIntegration.json":vVe,"./resources/en-US/workspaceTools.json":xVe,"./resources/zh-CN/adk.json":wVe,"./resources/zh-CN/agentReviews.json":kVe,"./resources/zh-CN/app.json":SVe,"./resources/zh-CN/automations.json":EVe,"./resources/zh-CN/common.json":AVe,"./resources/zh-CN/conversation.json":TVe,"./resources/zh-CN/create.json":_Ve,"./resources/zh-CN/cronjobs.json":NVe,"./resources/zh-CN/deepseek.json":IVe,"./resources/zh-CN/feedback.json":DVe,"./resources/zh-CN/migrations.json":LVe,"./resources/zh-CN/newChat.json":$Ve,"./resources/zh-CN/reviews.json":BVe,"./resources/zh-CN/sandbox.json":UVe,"./resources/zh-CN/shell.json":zVe,"./resources/zh-CN/sidebar.json":HVe,"./resources/zh-CN/skills.json":qVe,"./resources/zh-CN/ui.json":KVe,"./resources/zh-CN/users.json":XVe,"./resources/zh-CN/websiteIntegration.json":ZVe,"./resources/zh-CN/workspaceTools.json":JVe});function Cqe(){const e={};for(const[t,n]of Object.entries(Eqe)){const i=t.match(/\/resources\/([^/]+)\/([^/]+)\.json$/);if(!i)continue;const[,r,s]=i;e[r]??(e[r]={}),e[r][s]=n.default}return e}for(const[e,t]of Object.entries(Cqe()))for(const[n,i]of Object.entries(t??{}))yn.addResourceBundle(e,n,i,!0,!0);async function Aqe(e){rHe(e),await yn.changeLanguage(e)}var dke={exports:{}},ZP={},fke={exports:{}},hke={};/** + */var Rw=p;function hqe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var pqe=typeof Object.is=="function"?Object.is:hqe,mqe=Rw.useState,gqe=Rw.useEffect,bqe=Rw.useLayoutEffect,yqe=Rw.useDebugValue;function vqe(e,t){var n=t(),i=mqe({inst:{value:n,getSnapshot:t}}),r=i[0].inst,s=i[1];return bqe(function(){r.value=n,r.getSnapshot=t,C5(r)&&s({inst:r})},[e,n,t]),gqe(function(){return C5(r)&&s({inst:r}),e(function(){C5(r)&&s({inst:r})})},[e]),yqe(n),n}function C5(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!pqe(e,n)}catch{return!0}}function xqe(e,t){return t()}var wqe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?xqe:vqe;cke.useSyncExternalStore=Rw.useSyncExternalStore!==void 0?Rw.useSyncExternalStore:wqe;lke.exports=cke;var ZP=lke.exports;const Oqe=(e,t)=>{if(Fc(t))return t;if(wp(t)&&Fc(t.defaultValue))return t.defaultValue;if(typeof e=="function")return"";if(Array.isArray(e)){const n=e[e.length-1];return typeof n=="function"?"":n}return e},kqe={t:Oqe,ready:!1},Sqe=()=>()=>{},Te=(e,t={})=>{var j,T,R;const{i18n:n}=t,{i18n:i,defaultNS:r}=p.useContext(oke)||{},s=n||i||LU();s&&!s.reportNamespaces&&(s.reportNamespaces=new fqe),s||Wx(s,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.");const o=p.useMemo(()=>{var A;return{...MU(),...(A=s==null?void 0:s.options)==null?void 0:A.react,...t}},[s,t]),{useSuspense:l,keyPrefix:c}=o,u=e||r||((j=s==null?void 0:s.options)==null?void 0:j.defaultNS),d=Fc(u)?[u]:u||["translation"],f=p.useMemo(()=>d,d);(R=(T=s==null?void 0:s.reportNamespaces)==null?void 0:T.addUsedNamespaces)==null||R.call(T,f);const h=p.useRef(0),m=p.useCallback(A=>{if(!s)return Sqe;const{bindI18n:N,bindI18nStore:P}=o,I=()=>{h.current+=1,A()};return N&&s.on(N,I),P&&s.store.on(P,I),()=>{N&&N.split(" ").forEach(D=>s.off(D,I)),P&&P.split(" ").forEach(D=>s.store.off(D,I))}},[s,o]),g=p.useRef(),b=p.useCallback(()=>{if(!s)return kqe;const A=!!(s.isInitialized||s.initializedStoreOnce)&&f.every(L=>XHe(L,s,o)),N=t.lng||s.language,P=h.current,I=g.current;if(I&&I.ready===A&&I.lng===N&&I.keyPrefix===c&&I.revision===P)return I;const _={t:s.getFixedT(N,o.nsMode==="fallback"?f:f[0],c,{scopeNs:f}),ready:A,lng:N,keyPrefix:c,revision:P};return g.current=_,_},[s,f,c,o,t.lng]),[v,y]=p.useState(0),{t:w,ready:x}=ZP.useSyncExternalStore(m,b,b);p.useEffect(()=>{if(s&&!x&&!l){const A=()=>y(N=>N+1);t.lng?JG(s,t.lng,f,A):hF(s,f,A)}},[s,t.lng,f,x,l,v]);const O=s||{},k=p.useRef(null),S=p.useRef(),C=A=>{const N=Object.getOwnPropertyDescriptors(A);N.__original&&delete N.__original;const P=Object.create(Object.getPrototypeOf(A),N);if(!Object.prototype.hasOwnProperty.call(P,"__original"))try{Object.defineProperty(P,"__original",{value:A,writable:!1,enumerable:!1,configurable:!1})}catch{}return P},E=p.useMemo(()=>{const A=O,N=A==null?void 0:A.language;let P=A;A&&(k.current&&k.current.__original===A?S.current!==N?(P=C(A),k.current=P,S.current=N):P=k.current:(P=C(A),k.current=P,S.current=N));const I=!x&&!l?(..._)=>(Wx(s,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),w(..._)):w,D=[I,P,x];return D.t=I,D.i18n=P,D.ready=x,D},[w,O,x,O.resolvedLanguage,O.language,O.languages]);if(s&&l&&!x){let A=!1;try{A=!1}catch{}throw A&&Wx(s,"SUSPENDED_WHILE_LOADING","useTranslation: suspended while translations are loading (useSuspense is true by default). Add a boundary above this component, or set react.useSuspense: false in the i18next init options. https://react.i18next.com/latest/usetranslation-hook"),new Promise(N=>{const P=()=>N();t.lng?JG(s,t.lng,f,P):hF(s,f,P)})}return E},uke=iHe(),bn=lc.createInstance();bn.use(dqe).init({resources:{"en-US":{adk:ede,app:ife,conversation:Pfe},"zh-CN":{adk:_U,app:c0e,conversation:B0e}},lng:uke,fallbackLng:yA,supportedLngs:[...jU],defaultNS:"common",interpolation:{escapeValue:!1},initAsync:!1});VOe(uke);bn.on("languageChanged",e=>{const t=vA(e)??yA;VOe(t)});const Eqe=Object.assign({"./resources/en-US/adk.json":Qze,"./resources/en-US/agentReviews.json":Vze,"./resources/en-US/app.json":Hze,"./resources/en-US/automations.json":qze,"./resources/en-US/common.json":Kze,"./resources/en-US/conversation.json":Gze,"./resources/en-US/create.json":Xze,"./resources/en-US/cronjobs.json":Zze,"./resources/en-US/deepseek.json":eVe,"./resources/en-US/feedback.json":nVe,"./resources/en-US/migrations.json":rVe,"./resources/en-US/newChat.json":sVe,"./resources/en-US/reviews.json":oVe,"./resources/en-US/sandbox.json":lVe,"./resources/en-US/shell.json":uVe,"./resources/en-US/sidebar.json":fVe,"./resources/en-US/skills.json":hVe,"./resources/en-US/ui.json":mVe,"./resources/en-US/users.json":bVe,"./resources/en-US/websiteIntegration.json":vVe,"./resources/en-US/workspaceTools.json":xVe,"./resources/zh-CN/adk.json":wVe,"./resources/zh-CN/agentReviews.json":kVe,"./resources/zh-CN/app.json":SVe,"./resources/zh-CN/automations.json":EVe,"./resources/zh-CN/common.json":AVe,"./resources/zh-CN/conversation.json":TVe,"./resources/zh-CN/create.json":_Ve,"./resources/zh-CN/cronjobs.json":NVe,"./resources/zh-CN/deepseek.json":IVe,"./resources/zh-CN/feedback.json":DVe,"./resources/zh-CN/migrations.json":LVe,"./resources/zh-CN/newChat.json":$Ve,"./resources/zh-CN/reviews.json":BVe,"./resources/zh-CN/sandbox.json":UVe,"./resources/zh-CN/shell.json":zVe,"./resources/zh-CN/sidebar.json":HVe,"./resources/zh-CN/skills.json":qVe,"./resources/zh-CN/ui.json":KVe,"./resources/zh-CN/users.json":XVe,"./resources/zh-CN/websiteIntegration.json":ZVe,"./resources/zh-CN/workspaceTools.json":JVe});function Cqe(){const e={};for(const[t,n]of Object.entries(Eqe)){const i=t.match(/\/resources\/([^/]+)\/([^/]+)\.json$/);if(!i)continue;const[,r,s]=i;e[r]??(e[r]={}),e[r][s]=n.default}return e}for(const[e,t]of Object.entries(Cqe()))for(const[n,i]of Object.entries(t??{}))bn.addResourceBundle(e,n,i,!0,!0);async function Aqe(e){rHe(e),await bn.changeLanguage(e)}var dke={exports:{}},JP={},fke={exports:{}},hke={};/** * @license React * scheduler.production.js * @@ -77,7 +77,7 @@ Studio:{{studioUrl}} * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(e){function t(D,_){var L=D.length;D.push(_);e:for(;0>>1,M=D[F];if(0>>1;Fr(U,L))Jr(V,U)?(D[F]=V,D[J]=L,F=J):(D[F]=U,D[q]=L,F=q);else if(Jr(V,L))D[F]=V,D[J]=L,F=J;else break e}}return _}function r(D,_){var L=D.sortIndex-_.sortIndex;return L!==0?L:D.id-_.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,f=null,h=3,m=!1,g=!1,b=!1,v=!1,y=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function O(D){for(var _=n(u);_!==null;){if(_.callback===null)i(u);else if(_.startTime<=D)i(u),_.sortIndex=_.expirationTime,t(c,_);else break;_=n(u)}}function k(D){if(b=!1,O(D),!g)if(n(c)!==null)g=!0,S||(S=!0,A());else{var _=n(u);_!==null&&I(k,_.startTime-D)}}var S=!1,C=-1,E=5,j=-1;function T(){return v?!0:!(e.unstable_now()-jD&&T());){var F=f.callback;if(typeof F=="function"){f.callback=null,h=f.priorityLevel;var M=F(f.expirationTime<=D);if(D=e.unstable_now(),typeof M=="function"){f.callback=M,O(D),_=!0;break t}f===n(c)&&i(c),O(D)}else i(c);f=n(c)}if(f!==null)_=!0;else{var z=n(u);z!==null&&I(k,z.startTime-D),_=!1}}break e}finally{f=null,h=L,m=!1}_=void 0}}finally{_?A():S=!1}}}var A;if(typeof x=="function")A=function(){x(R)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,P=N.port2;N.port1.onmessage=R,A=function(){P.postMessage(null)}}else A=function(){y(R,0)};function I(D,_){C=y(function(){D(e.unstable_now())},_)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(D){D.callback=null},e.unstable_forceFrameRate=function(D){0>D||125F?(D.sortIndex=L,t(u,D),n(c)===null&&D===n(u)&&(b?(w(C),C=-1):b=!0,I(k,L-F))):(D.sortIndex=M,t(c,D),g||m||(g=!0,S||(S=!0,A()))),D},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(D){var _=h;return function(){var L=h;h=_;try{return D.apply(this,arguments)}finally{h=L}}}})(hke);fke.exports=hke;var Tqe=fke.exports,pke={exports:{}},dc={};/** + */(function(e){function t(D,_){var L=D.length;D.push(_);e:for(;0>>1,M=D[F];if(0>>1;Fr(U,L))Jr(z,U)?(D[F]=z,D[J]=L,F=J):(D[F]=U,D[q]=L,F=q);else if(Jr(z,L))D[F]=z,D[J]=L,F=J;else break e}}return _}function r(D,_){var L=D.sortIndex-_.sortIndex;return L!==0?L:D.id-_.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,f=null,h=3,m=!1,g=!1,b=!1,v=!1,y=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function O(D){for(var _=n(u);_!==null;){if(_.callback===null)i(u);else if(_.startTime<=D)i(u),_.sortIndex=_.expirationTime,t(c,_);else break;_=n(u)}}function k(D){if(b=!1,O(D),!g)if(n(c)!==null)g=!0,S||(S=!0,A());else{var _=n(u);_!==null&&I(k,_.startTime-D)}}var S=!1,C=-1,E=5,j=-1;function T(){return v?!0:!(e.unstable_now()-jD&&T());){var F=f.callback;if(typeof F=="function"){f.callback=null,h=f.priorityLevel;var M=F(f.expirationTime<=D);if(D=e.unstable_now(),typeof M=="function"){f.callback=M,O(D),_=!0;break t}f===n(c)&&i(c),O(D)}else i(c);f=n(c)}if(f!==null)_=!0;else{var V=n(u);V!==null&&I(k,V.startTime-D),_=!1}}break e}finally{f=null,h=L,m=!1}_=void 0}}finally{_?A():S=!1}}}var A;if(typeof x=="function")A=function(){x(R)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,P=N.port2;N.port1.onmessage=R,A=function(){P.postMessage(null)}}else A=function(){y(R,0)};function I(D,_){C=y(function(){D(e.unstable_now())},_)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(D){D.callback=null},e.unstable_forceFrameRate=function(D){0>D||125F?(D.sortIndex=L,t(u,D),n(c)===null&&D===n(u)&&(b?(w(C),C=-1):b=!0,I(k,L-F))):(D.sortIndex=M,t(c,D),g||m||(g=!0,S||(S=!0,A()))),D},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(D){var _=h;return function(){var L=h;h=_;try{return D.apply(this,arguments)}finally{h=L}}}})(hke);fke.exports=hke;var Tqe=fke.exports,pke={exports:{}},cc={};/** * @license React * react-dom.production.js * @@ -85,7 +85,7 @@ Studio:{{studioUrl}} * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var _qe=p;function mke(e){var t="https://react.dev/errors/"+e;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(gke)}catch(e){console.error(e)}}gke(),pke.exports=dc;var vi=pke.exports;/** + */var _qe=p;function mke(e){var t="https://react.dev/errors/"+e;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(gke)}catch(e){console.error(e)}}gke(),pke.exports=cc;var yi=pke.exports;/** * @license React * react-dom-client.production.js * @@ -93,15 +93,15 @@ Studio:{{studioUrl}} * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var fo=Tqe,bke=p,Rqe=vi;function Ot(e){var t="https://react.dev/errors/"+e;if(1bx||(e.current=wF[bx],wF[bx]=null,bx--)}function ws(e,t){bx++,wF[bx]=e.current,e.current=t}var fh=Ch(null),RE=Ch(null),Eg=Ch(null),uR=Ch(null);function dR(e,t){switch(ws(Eg,t),ws(RE,e),ws(fh,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?oY(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=oY(t),e=zEe(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Po(fh),ws(fh,e)}function Nw(){Po(fh),Po(RE),Po(Eg)}function OF(e){e.memoizedState!==null&&ws(uR,e);var t=fh.current,n=zEe(t,e.type);t!==n&&(ws(RE,e),ws(fh,n))}function fR(e){RE.current===e&&(Po(fh),Po(RE)),uR.current===e&&(Po(uR),zE._currentValue=Fy)}var A5,nX;function ny(e){if(A5===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);A5=t&&t[1]||"",nX=-1vx||(e.current=wF[vx],wF[vx]=null,vx--)}function vs(e,t){vx++,wF[vx]=e.current,e.current=t}var hh=Ah(null),LE=Ah(null),Sg=Ah(null),dR=Ah(null);function fR(e,t){switch(vs(Sg,t),vs(LE,e),vs(hh,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?oY(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=oY(t),e=zEe(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Io(hh),vs(hh,e)}function Iw(){Io(hh),Io(LE),Io(Sg)}function OF(e){e.memoizedState!==null&&vs(dR,e);var t=hh.current,n=zEe(t,e.type);t!==n&&(vs(LE,e),vs(hh,n))}function hR(e){LE.current===e&&(Io(hh),Io(LE)),dR.current===e&&(Io(dR),KE._currentValue=Qy)}var A5,nX;function sy(e){if(A5===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);A5=t&&t[1]||"",nX=-1)":-1r||c[i]!==u[r]){var d=` -`+c[i].replace(" at new "," at ");return e.displayName&&d.includes("")&&(d=d.replace("",e.displayName)),d}while(1<=i&&0<=r);break}}}finally{T5=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?ny(n):""}function Lqe(e,t){switch(e.tag){case 26:case 27:case 5:return ny(e.type);case 16:return ny("Lazy");case 13:return e.child!==t&&t!==null?ny("Suspense Fallback"):ny("Suspense");case 19:return ny("SuspenseList");case 0:case 15:return _5(e.type,!1);case 11:return _5(e.type.render,!1);case 1:return _5(e.type,!0);case 31:return ny("Activity");default:return""}}function iX(e){try{var t="",n=null;do t+=Lqe(e,n),n=e,e=e.return;while(e);return t}catch(i){return` +`+c[i].replace(" at new "," at ");return e.displayName&&d.includes("")&&(d=d.replace("",e.displayName)),d}while(1<=i&&0<=r);break}}}finally{T5=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?sy(n):""}function Lqe(e,t){switch(e.tag){case 26:case 27:case 5:return sy(e.type);case 16:return sy("Lazy");case 13:return e.child!==t&&t!==null?sy("Suspense Fallback"):sy("Suspense");case 19:return sy("SuspenseList");case 0:case 15:return _5(e.type,!1);case 11:return _5(e.type.render,!1);case 1:return _5(e.type,!0);case 31:return sy("Activity");default:return""}}function iX(e){try{var t="",n=null;do t+=Lqe(e,n),n=e,e=e.return;while(e);return t}catch(i){return` Error generating stack: `+i.message+` -`+i.stack}}var kF=Object.prototype.hasOwnProperty,BU=fo.unstable_scheduleCallback,j5=fo.unstable_cancelCallback,$qe=fo.unstable_shouldYield,Fqe=fo.unstable_requestPaint,ku=fo.unstable_now,Bqe=fo.unstable_getCurrentPriorityLevel,Ske=fo.unstable_ImmediatePriority,Eke=fo.unstable_UserBlockingPriority,hR=fo.unstable_NormalPriority,Uqe=fo.unstable_LowPriority,Cke=fo.unstable_IdlePriority,Qqe=fo.log,zqe=fo.unstable_setDisableYieldValue,gA=null,Su=null;function dg(e){if(typeof Qqe=="function"&&zqe(e),Su&&typeof Su.setStrictMode=="function")try{Su.setStrictMode(gA,e)}catch{}}var Eu=Math.clz32?Math.clz32:qqe,Vqe=Math.log,Hqe=Math.LN2;function qqe(e){return e>>>=0,e===0?32:31-(Vqe(e)/Hqe|0)|0}var j2=256,N2=262144,R2=4194304;function iy(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function eD(e,t,n){var i=e.pendingLanes;if(i===0)return 0;var r=0,s=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var l=i&134217727;return l!==0?(i=l&~s,i!==0?r=iy(i):(o&=l,o!==0?r=iy(o):n||(n=l&~e,n!==0&&(r=iy(n))))):(l=i&~s,l!==0?r=iy(l):o!==0?r=iy(o):n||(n=i&~e,n!==0&&(r=iy(n)))),r===0?0:t!==0&&t!==r&&!(t&s)&&(s=r&-r,n=t&-t,s>=n||s===32&&(n&4194048)!==0)?t:r}function bA(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Wqe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ake(){var e=R2;return R2<<=1,!(R2&62914560)&&(R2=4194304),e}function N5(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function yA(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Kqe(e,t,n,i,r,s){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var l=e.entanglements,c=e.expirationTimes,u=e.hiddenUpdates;for(n=o&~n;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var eWe=/[\n"\\]/g;function sd(e){return e.replace(eWe,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function CF(e,t,n,i,r,s,o,l){e.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.type=o:e.removeAttribute("type"),t!=null?o==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+ed(t)):e.value!==""+ed(t)&&(e.value=""+ed(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?AF(e,o,ed(t)):n!=null?AF(e,o,ed(n)):i!=null&&e.removeAttribute("value"),r==null&&s!=null&&(e.defaultChecked=!!s),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+ed(l):e.removeAttribute("name")}function Mke(e,t,n,i,r,s,o,l){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.type=s),t!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||t!=null)){EF(e);return}n=n!=null?""+ed(n):"",t=t!=null?""+ed(t):n,l||t===e.value||(e.value=t),e.defaultValue=t}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=l?e.checked:!!i,e.defaultChecked=!!i,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.name=o),EF(e)}function AF(e,t,n){t==="number"&&pR(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Wx(e,t,n,i){if(e=e.options,t){t={};for(var r=0;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_F=!1;if(Vp)try{var KO={};Object.defineProperty(KO,"passive",{get:function(){_F=!0}}),window.addEventListener("test",KO,KO),window.removeEventListener("test",KO,KO)}catch{_F=!1}var fg=null,qU=null,zj=null;function Uke(){if(zj)return zj;var e,t=qU,n=t.length,i,r="value"in fg?fg.value:fg.textContent,s=r.length;for(e=0;e=_S),pX=" ",mX=!1;function zke(e,t){switch(e){case"keyup":return TWe.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vke(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var xx=!1;function jWe(e,t){switch(e){case"compositionend":return Vke(t);case"keypress":return t.which!==32?null:(mX=!0,pX);case"textInput":return e=t.data,e===pX&&mX?null:e;default:return null}}function NWe(e,t){if(xx)return e==="compositionend"||!KU&&zke(e,t)?(e=Uke(),zj=qU=fg=null,xx=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=xX(n)}}function Kke(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Kke(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Gke(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=pR(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=pR(e.document)}return t}function GU(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var FWe=Vp&&"documentMode"in document&&11>=document.documentMode,wx=null,jF=null,NS=null,NF=!1;function OX(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;NF||wx==null||wx!==pR(i)||(i=wx,"selectionStart"in i&&GU(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),NS&&DE(NS,i)||(NS=i,i=RR(jF,"onSelect"),0>=o,r-=o,ih=1<<32-Eu(t)+r|n<E?(j=C,C=null):j=C.sibling;var T=h(y,C,x[E],O);if(T===null){C===null&&(C=j);break}e&&C&&T.alternate===null&&t(y,C),w=s(T,w,E),S===null?k=T:S.sibling=T,S=T,C=j}if(E===x.length)return n(y,C),ar&&pp(y,E),k;if(C===null){for(;EE?(j=C,C=null):j=C.sibling;var R=h(y,C,T.value,O);if(R===null){C===null&&(C=j);break}e&&C&&R.alternate===null&&t(y,C),w=s(R,w,E),S===null?k=R:S.sibling=R,S=R,C=j}if(T.done)return n(y,C),ar&&pp(y,E),k;if(C===null){for(;!T.done;E++,T=x.next())T=f(y,T.value,O),T!==null&&(w=s(T,w,E),S===null?k=T:S.sibling=T,S=T);return ar&&pp(y,E),k}for(C=i(C);!T.done;E++,T=x.next())T=m(C,y,E,T.value,O),T!==null&&(e&&T.alternate!==null&&C.delete(T.key===null?E:T.key),w=s(T,w,E),S===null?k=T:S.sibling=T,S=T);return e&&C.forEach(function(A){return t(y,A)}),ar&&pp(y,E),k}function v(y,w,x,O){if(typeof x=="object"&&x!==null&&x.type===gx&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case _2:e:{for(var k=x.key;w!==null;){if(w.key===k){if(k=x.type,k===gx){if(w.tag===7){n(y,w.sibling),O=r(w,x.props.children),O.return=y,y=O;break e}}else if(w.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Wm&&ry(k)===w.type){n(y,w.sibling),O=r(w,x.props),XO(O,x),O.return=y,y=O;break e}n(y,w);break}else t(y,w);w=w.sibling}x.type===gx?(O=By(x.props.children,y.mode,O,x.key),O.return=y,y=O):(O=Hj(x.type,x.key,x.props,null,y.mode,O),XO(O,x),O.return=y,y=O)}return o(y);case Gk:e:{for(k=x.key;w!==null;){if(w.key===k)if(w.tag===4&&w.stateNode.containerInfo===x.containerInfo&&w.stateNode.implementation===x.implementation){n(y,w.sibling),O=r(w,x.children||[]),O.return=y,y=O;break e}else{n(y,w);break}else t(y,w);w=w.sibling}O=B5(x,y.mode,O),O.return=y,y=O}return o(y);case Wm:return x=ry(x),v(y,w,x,O)}if(Xk(x))return g(y,w,x,O);if(WO(x)){if(k=WO(x),typeof k!="function")throw Error(Ot(150));return x=k.call(x),b(y,w,x,O)}if(typeof x.then=="function")return v(y,w,M2(x),O);if(x.$$typeof===Sp)return v(y,w,D2(y,x),O);L2(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint"?(x=""+x,w!==null&&w.tag===6?(n(y,w.sibling),O=r(w,x),O.return=y,y=O):(n(y,w),O=F5(x,y.mode,O),O.return=y,y=O),o(y)):n(y,w)}return function(y,w,x,O){try{$E=0;var k=v(y,w,x,O);return Xx=null,k}catch(C){if(C===N1||C===aD)throw C;var S=bu(29,C,null,y.mode);return S.lanes=O,S.return=y,S}finally{}}}var i0=uSe(!0),dSe=uSe(!1),Km=!1;function rQ(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $F(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ag(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Tg(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,Tr&2){var r=i.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),i.pending=t,t=gR(e),nSe(e,null,n),t}return sD(e,i,t,n),gR(e)}function IS(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,_ke(e,n)}}function Q5(e,t){var n=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?r=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?r=s=t:s=s.next=t}else r=s=t;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:s,shared:i.shared,callbacks:i.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var FF=!1;function PS(){if(FF){var e=Gx;if(e!==null)throw e}}function DS(e,t,n,i){FF=!1;var r=e.updateQueue;Km=!1;var s=r.firstBaseUpdate,o=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?s=u:o.next=u,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(s!==null){var f=r.baseState;o=0,d=u=c=null,l=s;do{var h=l.lane&-536870913,m=h!==l.lane;if(m?(nr&h)===h:(i&h)===h){h!==0&&h===Pw&&(FF=!0),d!==null&&(d=d.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var g=e,b=l;h=t;var v=n;switch(b.tag){case 1:if(g=b.payload,typeof g=="function"){f=g.call(v,f,h);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=b.payload,h=typeof g=="function"?g.call(v,f,h):g,h==null)break e;f=Ps({},f,h);break e;case 2:Km=!0}}h=l.callback,h!==null&&(e.flags|=64,m&&(e.flags|=8192),m=r.callbacks,m===null?r.callbacks=[h]:m.push(h))}else m={lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=m,c=f):d=d.next=m,o|=h;if(l=l.next,l===null){if(l=r.shared.pending,l===null)break;m=l,l=m.next,m.next=null,r.lastBaseUpdate=m,r.shared.pending=null}}while(!0);d===null&&(c=f),r.baseState=c,r.firstBaseUpdate=u,r.lastBaseUpdate=d,s===null&&(r.shared.lanes=0),Wg|=o,e.lanes=o,e.memoizedState=f}}function fSe(e,t){if(typeof e!="function")throw Error(Ot(191,e));e.call(t)}function hSe(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;es?s:8;var o=si.T,l={};si.T=l,bQ(e,!1,t,n);try{var c=r(),u=si.S;if(u!==null&&u(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=KWe(c,i);MS(e,t,d,Cu(e))}else MS(e,t,i,Cu(e))}catch(f){MS(e,t,{then:function(){},status:"rejected",reason:f},Cu())}finally{_r.p=s,o!==null&&l.types!==null&&(o.types=l.types),si.T=o}}function eKe(){}function VF(e,t,n,i){if(e.tag!==5)throw Error(Ot(476));var r=$Se(e).queue;LSe(e,r,t,Fy,n===null?eKe:function(){return FSe(e),n(i)})}function $Se(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Fy,baseState:Fy,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qp,lastRenderedState:Fy},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qp,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function FSe(e){var t=$Se(e);t.next===null&&(t=e.alternate.memoizedState),MS(e,t.next.queue,{},Cu())}function gQ(){return rl(zE)}function BSe(){return _a().memoizedState}function USe(){return _a().memoizedState}function tKe(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Cu();e=Ag(n);var i=Tg(t,e,n);i!==null&&(Bc(i,t,n),IS(i,t,n)),t={cache:tQ()},e.payload=t;return}t=t.return}}function nKe(e,t,n){var i=Cu();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},uD(e)?zSe(t,n):(n=YU(e,t,n,i),n!==null&&(Bc(n,e,i),VSe(n,t,i)))}function QSe(e,t,n){var i=Cu();MS(e,t,n,i)}function MS(e,t,n,i){var r={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(uD(e))zSe(t,r);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,l=s(o,n);if(r.hasEagerState=!0,r.eagerState=l,Ru(l,o))return sD(e,t,r,0),us===null&&rD(),!1}catch{}finally{}if(n=YU(e,t,r,i),n!==null)return Bc(n,e,i),VSe(n,t,i),!0}return!1}function bQ(e,t,n,i){if(i={lane:2,revertLane:CQ(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},uD(e)){if(t)throw Error(Ot(479))}else t=YU(e,n,i,2),t!==null&&Bc(t,e,2)}function uD(e){var t=e.alternate;return e===Ai||t!==null&&t===Ai}function zSe(e,t){Yx=OR=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function VSe(e,t,n){if(n&4194048){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,_ke(e,n)}}var BE={readContext:rl,use:lD,useCallback:ca,useContext:ca,useEffect:ca,useImperativeHandle:ca,useLayoutEffect:ca,useInsertionEffect:ca,useMemo:ca,useReducer:ca,useRef:ca,useState:ca,useDebugValue:ca,useDeferredValue:ca,useTransition:ca,useSyncExternalStore:ca,useId:ca,useHostTransitionStatus:ca,useFormState:ca,useActionState:ca,useOptimistic:ca,useMemoCache:ca,useCacheRefresh:ca};BE.useEffectEvent=ca;var HSe={readContext:rl,use:lD,useCallback:function(e,t){return Xl().memoizedState=[e,t===void 0?null:t],e},useContext:rl,useEffect:LX,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Kj(4194308,4,RSe.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Kj(4194308,4,e,t)},useInsertionEffect:function(e,t){Kj(4,2,e,t)},useMemo:function(e,t){var n=Xl();t=t===void 0?null:t;var i=e();if(r0){dg(!0);try{e()}finally{dg(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=Xl();if(n!==void 0){var r=n(t);if(r0){dg(!0);try{n(t)}finally{dg(!1)}}}else r=t;return i.memoizedState=i.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},i.queue=e,e=e.dispatch=nKe.bind(null,Ai,e),[i.memoizedState,e]},useRef:function(e){var t=Xl();return e={current:e},t.memoizedState=e},useState:function(e){e=QF(e);var t=e.queue,n=QSe.bind(null,Ai,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:pQ,useDeferredValue:function(e,t){var n=Xl();return mQ(n,e,t)},useTransition:function(){var e=QF(!1);return e=LSe.bind(null,Ai,e.queue,!0,!1),Xl().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=Ai,r=Xl();if(ar){if(n===void 0)throw Error(Ot(407));n=n()}else{if(n=t(),us===null)throw Error(Ot(349));nr&127||ySe(i,t,n)}r.memoizedState=n;var s={value:n,getSnapshot:t};return r.queue=s,LX(xSe.bind(null,i,s,e),[e]),i.flags|=2048,Mw(9,{destroy:void 0},vSe.bind(null,i,s,n,t),null),n},useId:function(){var e=Xl(),t=us.identifierPrefix;if(ar){var n=rh,i=ih;n=(i&~(1<<32-Eu(i)-1)).toString(32)+n,t="_"+t+"R_"+n,n=kR++,0<\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof i.is=="string"?o.createElement("select",{is:i.is}):o.createElement("select"),i.multiple?s.multiple=!0:i.size&&(s.size=i.size);break;default:s=typeof i.is=="string"?o.createElement(r,{is:i.is}):o.createElement(r)}}s[tl]=t,s[Qc]=i;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)s.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break e;for(;o.sibling===null;){if(o.return===null||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=s;e:switch(sl(s,r,i),r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Xh(t)}}return Es(t),X5(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Xh(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(Ot(166));if(e=Eg.current,Ev(t)){if(e=t.stateNode,n=t.memoizedProps,i=null,r=nl,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}e[tl]=t,e=!!(e.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||QEe(e.nodeValue,n)),e||Hg(t,!0)}else e=IR(e).createTextNode(i),e[tl]=t,t.stateNode=e}return Es(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(i=Ev(t),n!==null){if(e===null){if(!i)throw Error(Ot(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Ot(557));e[tl]=t}else t0(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Es(t),e=!1}else n=U5(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(gu(t),t):(gu(t),null);if(t.flags&128)throw Error(Ot(558))}return Es(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Ev(t),i!==null&&i.dehydrated!==null){if(e===null){if(!r)throw Error(Ot(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(Ot(317));r[tl]=t}else t0(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Es(t),r=!1}else r=U5(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(gu(t),t):(gu(t),null)}return gu(t),t.flags&128?(t.lanes=n,t):(n=i!==null,e=e!==null&&e.memoizedState!==null,n&&(i=t.child,r=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(r=i.alternate.memoizedState.cachePool.pool),s=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(s=i.memoizedState.cachePool.pool),s!==r&&(i.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),$2(t,t.updateQueue),Es(t),null);case 4:return Nw(),e===null&&AQ(t.stateNode.containerInfo),Es(t),null;case 10:return Np(t.type),Es(t),null;case 19:if(Po(Ca),i=t.memoizedState,i===null)return Es(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)YO(i,!1);else{if(fa!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=wR(e),s!==null){for(t.flags|=128,YO(i,!1),e=s.updateQueue,t.updateQueue=e,$2(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)iSe(n,e),n=n.sibling;return ws(Ca,Ca.current&1|2),ar&&pp(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&ku()>AR&&(t.flags|=128,r=!0,YO(i,!1),t.lanes=4194304)}else{if(!r)if(e=wR(s),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,$2(t,e),YO(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!ar)return Es(t),null}else 2*ku()-i.renderingStartTime>AR&&n!==536870912&&(t.flags|=128,r=!0,YO(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(e=i.last,e!==null?e.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=ku(),e.sibling=null,n=Ca.current,ws(Ca,r?n&1|2:n&1),ar&&pp(t,i.treeForkCount),e):(Es(t),null);case 22:case 23:return gu(t),sQ(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?n&536870912&&!(t.flags&128)&&(Es(t),t.subtreeFlags&6&&(t.flags|=8192)):Es(t),n=t.updateQueue,n!==null&&$2(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==n&&(t.flags|=2048),e!==null&&Po(Uy),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Np(Ka),Es(t),null;case 25:return null;case 30:return null}throw Error(Ot(156,t.tag))}function oKe(e,t){switch(eQ(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Np(Ka),Nw(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return fR(t),null;case 31:if(t.memoizedState!==null){if(gu(t),t.alternate===null)throw Error(Ot(340));t0()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(gu(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Ot(340));t0()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Po(Ca),null;case 4:return Nw(),null;case 10:return Np(t.type),null;case 22:case 23:return gu(t),sQ(),e!==null&&Po(Uy),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Np(Ka),null;case 25:return null;default:return null}}function iEe(e,t){switch(eQ(t),t.tag){case 3:Np(Ka),Nw();break;case 26:case 27:case 5:fR(t);break;case 4:Nw();break;case 31:t.memoizedState!==null&&gu(t);break;case 13:gu(t);break;case 19:Po(Ca);break;case 10:Np(t.type);break;case 22:case 23:gu(t),sQ(),e!==null&&Po(Uy);break;case 24:Np(Ka)}}function kA(e,t){try{var n=t.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var r=i.next;n=r;do{if((n.tag&e)===e){i=void 0;var s=n.create,o=n.inst;i=s(),o.destroy=i}n=n.next}while(n!==r)}}catch(l){zr(t,t.return,l)}}function qg(e,t,n){try{var i=t.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var s=r.next;i=s;do{if((i.tag&e)===e){var o=i.inst,l=o.destroy;if(l!==void 0){o.destroy=void 0,r=t;var c=n,u=l;try{u()}catch(d){zr(r,c,d)}}}i=i.next}while(i!==s)}}catch(d){zr(t,t.return,d)}}function rEe(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{hSe(t,n)}catch(i){zr(e,e.return,i)}}}function sEe(e,t,n){n.props=s0(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(i){zr(e,t,i)}}function LS(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof n=="function"?e.refCleanup=n(i):n.current=i}}catch(r){zr(e,t,r)}}function sh(e,t){var n=e.ref,i=e.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(r){zr(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){zr(e,t,r)}else n.current=null}function aEe(e){var t=e.type,n=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(r){zr(e,e.return,r)}}function Y5(e,t,n){try{var i=e.stateNode;_Ke(i,e.type,n,t),i[Qc]=t}catch(r){zr(e,e.return,r)}}function oEe(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&kb(e.type)||e.tag===4}function Z5(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||oEe(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&kb(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function GF(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ep));else if(i!==4&&(i===27&&kb(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(GF(e,t,n),e=e.sibling;e!==null;)GF(e,t,n),e=e.sibling}function CR(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(i===27&&kb(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(CR(e,t,n),e=e.sibling;e!==null;)CR(e,t,n),e=e.sibling}function lEe(e){var t=e.stateNode,n=e.memoizedProps;try{for(var i=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);sl(t,i,n),t[tl]=e,t[Qc]=n}catch(s){zr(e,e.return,s)}}var vp=!1,Wa=!1,J5=!1,XX=typeof WeakSet=="function"?WeakSet:Set,Co=null;function lKe(e,t){if(e=e.containerInfo,n8=LR,e=Gke(e),GU(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var m;f!==n||r!==0&&f.nodeType!==3||(l=o+r),f!==s||i!==0&&f.nodeType!==3||(c=o+i),f.nodeType===3&&(o+=f.nodeValue.length),(m=f.firstChild)!==null;)h=f,f=m;for(;;){if(f===e)break t;if(h===n&&++u===r&&(l=o),h===s&&++d===i&&(c=o),(m=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=m}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(i8={focusedElem:e,selectionRange:n},LR=!1,Co=t;Co!==null;)if(t=Co,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Co=e;else for(;Co!==null;){switch(t=Co,s=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n title"))),sl(s,i,n),s[tl]=e,To(s),i=s;break e;case"link":var o=gY("link","href",r).get(i+(n.href||""));if(o){for(var l=0;lv&&(o=v,v=b,b=o);var y=wX(l,b),w=wX(l,v);if(y&&w&&(m.rangeCount!==1||m.anchorNode!==y.node||m.anchorOffset!==y.offset||m.focusNode!==w.node||m.focusOffset!==w.offset)){var x=f.createRange();x.setStart(y.node,y.offset),m.removeAllRanges(),b>v?(m.addRange(x),m.extend(w.node,w.offset)):(x.setEnd(w.node,w.offset),m.addRange(x))}}}}for(f=[],m=l;m=m.parentNode;)m.nodeType===1&&f.push({element:m,left:m.scrollLeft,top:m.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;ln?32:n,si.T=null,n=ZF,ZF=null;var s=jg,o=Rp;if(co=0,$w=jg=null,Rp=0,Tr&6)throw Error(Ot(331));var l=Tr;if(Tr|=4,vEe(s.current),gEe(s,s.current,o,n),Tr=l,SA(0,!1),Su&&typeof Su.onPostCommitFiberRoot=="function")try{Su.onPostCommitFiberRoot(gA,s)}catch{}return!0}finally{_r.p=r,si.T=i,PEe(e,t)}}function eY(e,t,n){t=ad(n,t),t=qF(e.stateNode,t,2),e=Tg(e,t,2),e!==null&&(yA(e,2),Ah(e))}function zr(e,t,n){if(e.tag===3)eY(e,e,n);else for(;t!==null;){if(t.tag===3){eY(t,e,n);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(_g===null||!_g.has(i))){e=ad(n,e),n=XSe(2),i=Tg(t,n,2),i!==null&&(YSe(n,i,t,e),yA(i,2),Ah(i));break}}t=t.return}}function t3(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new dKe;var r=new Set;i.set(t,r)}else r=i.get(t),r===void 0&&(r=new Set,i.set(t,r));r.has(n)||(kQ=!0,r.add(n),e=gKe.bind(null,e,t,n),t.then(e,e))}function gKe(e,t,n){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,us===e&&(nr&n)===n&&(fa===4||fa===3&&(nr&62914560)===nr&&300>ku()-dD?!(Tr&2)&&Fw(e,0):SQ|=n,Lw===nr&&(Lw=0)),Ah(e)}function MEe(e,t){t===0&&(t=Ake()),e=P0(e,t),e!==null&&(yA(e,t),Ah(e))}function bKe(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),MEe(e,n)}function yKe(e,t){var n=0;switch(e.tag){case 31:case 13:var i=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(Ot(314))}i!==null&&i.delete(t),MEe(e,n)}function vKe(e,t){return BU(e,t)}var jR=null,ex=null,e8=!1,NR=!1,n3=!1,mg=0;function Ah(e){e!==ex&&e.next===null&&(ex===null?jR=ex=e:ex=ex.next=e),NR=!0,e8||(e8=!0,wKe())}function SA(e,t){if(!n3&&NR){n3=!0;do for(var n=!1,i=jR;i!==null;){if(e!==0){var r=i.pendingLanes;if(r===0)var s=0;else{var o=i.suspendedLanes,l=i.pingedLanes;s=(1<<31-Eu(42|e)+1)-1,s&=r&~(o&~l),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,tY(i,s))}else s=nr,s=eD(i,i===us?s:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),!(s&3)||bA(i,s)||(n=!0,tY(i,s));i=i.next}while(n);n3=!1}}function xKe(){LEe()}function LEe(){NR=e8=!1;var e=0;mg!==0&&NKe()&&(e=mg);for(var t=ku(),n=null,i=jR;i!==null;){var r=i.next,s=$Ee(i,t);s===0?(i.next=null,n===null?jR=r:n.next=r,r===null&&(ex=n)):(n=i,(e!==0||s&3)&&(NR=!0)),i=r}co!==0&&co!==5||SA(e),mg!==0&&(mg=0)}function $Ee(e,t){for(var n=e.suspendedLanes,i=e.pingedLanes,r=e.expirationTimes,s=e.pendingLanes&-62914561;0l)break;var d=c.transferSize,f=c.initiatorType;d&&aY(f)&&(c=c.responseEnd,o+=d*(c"u"?null:document;function WEe(e,t,n){var i=I1;if(i&&typeof t=="string"&&t){var r=sd(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),hY.has(r)||(hY.add(r),e={rel:e,crossOrigin:n,href:t},i.querySelector(r)===null&&(t=i.createElement("link"),sl(t,"link",e),To(t),i.head.appendChild(t)))}}function BKe(e){dm.D(e),WEe("dns-prefetch",e,null)}function UKe(e,t){dm.C(e,t),WEe("preconnect",e,t)}function QKe(e,t,n){dm.L(e,t,n);var i=I1;if(i&&e&&t){var r='link[rel="preload"][as="'+sd(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+sd(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+sd(n.imageSizes)+'"]')):r+='[href="'+sd(e)+'"]';var s=r;switch(t){case"style":s=Bw(e);break;case"script":s=P1(e)}Ed.has(s)||(e=Ps({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Ed.set(s,e),i.querySelector(r)!==null||t==="style"&&i.querySelector(EA(s))||t==="script"&&i.querySelector(CA(s))||(t=i.createElement("link"),sl(t,"link",e),To(t),i.head.appendChild(t)))}}function zKe(e,t){dm.m(e,t);var n=I1;if(n&&e){var i=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+sd(i)+'"][href="'+sd(e)+'"]',s=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=P1(e)}if(!Ed.has(s)&&(e=Ps({rel:"modulepreload",href:e},t),Ed.set(s,e),n.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(CA(s)))return}i=n.createElement("link"),sl(i,"link",e),To(i),n.head.appendChild(i)}}}function VKe(e,t,n){dm.S(e,t,n);var i=I1;if(i&&e){var r=qx(i).hoistableStyles,s=Bw(e);t=t||"default";var o=r.get(s);if(!o){var l={loading:0,preload:null};if(o=i.querySelector(EA(s)))l.loading=5;else{e=Ps({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Ed.get(s))&&TQ(e,n);var c=o=i.createElement("link");To(c),sl(c,"link",e),c._p=new Promise(function(u,d){c.onload=u,c.onerror=d}),c.addEventListener("load",function(){l.loading|=1}),c.addEventListener("error",function(){l.loading|=2}),l.loading|=4,Zj(o,t,i)}o={type:"stylesheet",instance:o,count:1,state:l},r.set(s,o)}}}function HKe(e,t){dm.X(e,t);var n=I1;if(n&&e){var i=qx(n).hoistableScripts,r=P1(e),s=i.get(r);s||(s=n.querySelector(CA(r)),s||(e=Ps({src:e,async:!0},t),(t=Ed.get(r))&&_Q(e,t),s=n.createElement("script"),To(s),sl(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function qKe(e,t){dm.M(e,t);var n=I1;if(n&&e){var i=qx(n).hoistableScripts,r=P1(e),s=i.get(r);s||(s=n.querySelector(CA(r)),s||(e=Ps({src:e,async:!0,type:"module"},t),(t=Ed.get(r))&&_Q(e,t),s=n.createElement("script"),To(s),sl(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function pY(e,t,n,i){var r=(r=Eg.current)?PR(r):null;if(!r)throw Error(Ot(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Bw(n.href),n=qx(r).hoistableStyles,i=n.get(t),i||(i={type:"style",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Bw(n.href);var s=qx(r).hoistableStyles,o=s.get(e);if(o||(r=r.ownerDocument||r,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(e,o),(s=r.querySelector(EA(e)))&&!s._p&&(o.instance=s,o.state.loading=5),Ed.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Ed.set(e,n),s||WKe(r,e,n,o.state))),t&&i===null)throw Error(Ot(528,""));return o}if(t&&i!==null)throw Error(Ot(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=P1(n),n=qx(r).hoistableScripts,i=n.get(t),i||(i={type:"script",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(Ot(444,e))}}function Bw(e){return'href="'+sd(e)+'"'}function EA(e){return'link[rel="stylesheet"]['+e+"]"}function KEe(e){return Ps({},e,{"data-precedence":e.precedence,precedence:null})}function WKe(e,t,n,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),sl(t,"link",n),To(t),e.head.appendChild(t))}function P1(e){return'[src="'+sd(e)+'"]'}function CA(e){return"script[async]"+e}function mY(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+sd(n.href)+'"]');if(i)return t.instance=i,To(i),i;var r=Ps({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),To(i),sl(i,"style",r),Zj(i,n.precedence,e),t.instance=i;case"stylesheet":r=Bw(n.href);var s=e.querySelector(EA(r));if(s)return t.state.loading|=4,t.instance=s,To(s),s;i=KEe(n),(r=Ed.get(r))&&TQ(i,r),s=(e.ownerDocument||e).createElement("link"),To(s);var o=s;return o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),sl(s,"link",i),t.state.loading|=4,Zj(s,n.precedence,e),t.instance=s;case"script":return s=P1(n.src),(r=e.querySelector(CA(s)))?(t.instance=r,To(r),r):(i=n,(r=Ed.get(s))&&(i=Ps({},n),_Q(i,r)),e=e.ownerDocument||e,r=e.createElement("script"),To(r),sl(r,"link",i),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(Ot(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(i=t.instance,t.state.loading|=4,Zj(i,n.precedence,e));return t.instance}function Zj(e,t,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,s=r,o=0;o title"):null)}function KKe(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function GEe(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function GKe(e,t,n,i){if(n.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&!(n.state.loading&4)){if(n.instance===null){var r=Bw(i.href),s=t.querySelector(EA(r));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=DR.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=s,To(s);return}s=t.ownerDocument||t,i=KEe(i),(r=Ed.get(r))&&TQ(i,r),s=s.createElement("link"),To(s);var o=s;o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),sl(s,"link",i),n.instance=s}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=DR.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var l3=0;function XKe(e,t){return e.stylesheets&&e.count===0&&eN(e,e.stylesheets),0l3?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(r)}}:null}function DR(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)eN(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var MR=null;function eN(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,MR=new Map,t.forEach(YKe,e),MR=null,DR.call(e))}function YKe(e,t){if(!(t.state.loading&4)){var n=MR.get(e);if(n)var i=n.get(null);else{n=new Map,MR.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(iCe)}catch(e){console.error(e)}}iCe(),dke.exports=ZP;var sGe=dke.exports;const aGe=C1(sGe),PQ=p.createContext({});function gD(e){const t=p.useRef(null);return t.current===null&&(t.current=e()),t.current}const bD=p.createContext(null),qE=p.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class oGe extends p.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function lGe({children:e,isPresent:t}){const n=p.useId(),i=p.useRef(null),r=p.useRef({width:0,height:0,top:0,left:0}),{nonce:s}=p.useContext(qE);return p.useInsertionEffect(()=>{const{width:o,height:l,top:c,left:u}=r.current;if(t||!i.current||!o||!l)return;i.current.dataset.motionPopId=n;const d=document.createElement("style");return s&&(d.nonce=s),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(` +`+i.stack}}var kF=Object.prototype.hasOwnProperty,BU=fo.unstable_scheduleCallback,j5=fo.unstable_cancelCallback,$qe=fo.unstable_shouldYield,Fqe=fo.unstable_requestPaint,Su=fo.unstable_now,Bqe=fo.unstable_getCurrentPriorityLevel,Ske=fo.unstable_ImmediatePriority,Eke=fo.unstable_UserBlockingPriority,pR=fo.unstable_NormalPriority,Uqe=fo.unstable_LowPriority,Cke=fo.unstable_IdlePriority,Qqe=fo.log,zqe=fo.unstable_setDisableYieldValue,wA=null,Eu=null;function ug(e){if(typeof Qqe=="function"&&zqe(e),Eu&&typeof Eu.setStrictMode=="function")try{Eu.setStrictMode(wA,e)}catch{}}var Cu=Math.clz32?Math.clz32:qqe,Vqe=Math.log,Hqe=Math.LN2;function qqe(e){return e>>>=0,e===0?32:31-(Vqe(e)/Hqe|0)|0}var N2=256,R2=262144,I2=4194304;function ay(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function tD(e,t,n){var i=e.pendingLanes;if(i===0)return 0;var r=0,s=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var l=i&134217727;return l!==0?(i=l&~s,i!==0?r=ay(i):(o&=l,o!==0?r=ay(o):n||(n=l&~e,n!==0&&(r=ay(n))))):(l=i&~s,l!==0?r=ay(l):o!==0?r=ay(o):n||(n=i&~e,n!==0&&(r=ay(n)))),r===0?0:t!==0&&t!==r&&!(t&s)&&(s=r&-r,n=t&-t,s>=n||s===32&&(n&4194048)!==0)?t:r}function OA(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Wqe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ake(){var e=I2;return I2<<=1,!(I2&62914560)&&(I2=4194304),e}function N5(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function kA(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Kqe(e,t,n,i,r,s){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var l=e.entanglements,c=e.expirationTimes,u=e.hiddenUpdates;for(n=o&~n;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var eWe=/[\n"\\]/g;function rd(e){return e.replace(eWe,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function CF(e,t,n,i,r,s,o,l){e.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.type=o:e.removeAttribute("type"),t!=null?o==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ju(t)):e.value!==""+Ju(t)&&(e.value=""+Ju(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?AF(e,o,Ju(t)):n!=null?AF(e,o,Ju(n)):i!=null&&e.removeAttribute("value"),r==null&&s!=null&&(e.defaultChecked=!!s),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+Ju(l):e.removeAttribute("name")}function Mke(e,t,n,i,r,s,o,l){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.type=s),t!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||t!=null)){EF(e);return}n=n!=null?""+Ju(n):"",t=t!=null?""+Ju(t):n,l||t===e.value||(e.value=t),e.defaultValue=t}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=l?e.checked:!!i,e.defaultChecked=!!i,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.name=o),EF(e)}function AF(e,t,n){t==="number"&&mR(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Gx(e,t,n,i){if(e=e.options,t){t={};for(var r=0;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_F=!1;if(Qp)try{var JO={};Object.defineProperty(JO,"passive",{get:function(){_F=!0}}),window.addEventListener("test",JO,JO),window.removeEventListener("test",JO,JO)}catch{_F=!1}var dg=null,qU=null,Vj=null;function Uke(){if(Vj)return Vj;var e,t=qU,n=t.length,i,r="value"in dg?dg.value:dg.textContent,s=r.length;for(e=0;e=PS),pX=" ",mX=!1;function zke(e,t){switch(e){case"keyup":return TWe.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vke(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ox=!1;function jWe(e,t){switch(e){case"compositionend":return Vke(t);case"keypress":return t.which!==32?null:(mX=!0,pX);case"textInput":return e=t.data,e===pX&&mX?null:e;default:return null}}function NWe(e,t){if(Ox)return e==="compositionend"||!KU&&zke(e,t)?(e=Uke(),Vj=qU=dg=null,Ox=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=xX(n)}}function Kke(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Kke(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Gke(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=mR(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=mR(e.document)}return t}function GU(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var FWe=Qp&&"documentMode"in document&&11>=document.documentMode,kx=null,jF=null,MS=null,NF=!1;function OX(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;NF||kx==null||kx!==mR(i)||(i=kx,"selectionStart"in i&&GU(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),MS&&BE(MS,i)||(MS=i,i=IR(jF,"onSelect"),0>=o,r-=o,rh=1<<32-Cu(t)+r|n<E?(j=C,C=null):j=C.sibling;var T=h(y,C,x[E],O);if(T===null){C===null&&(C=j);break}e&&C&&T.alternate===null&&t(y,C),w=s(T,w,E),S===null?k=T:S.sibling=T,S=T,C=j}if(E===x.length)return n(y,C),or&&fp(y,E),k;if(C===null){for(;EE?(j=C,C=null):j=C.sibling;var R=h(y,C,T.value,O);if(R===null){C===null&&(C=j);break}e&&C&&R.alternate===null&&t(y,C),w=s(R,w,E),S===null?k=R:S.sibling=R,S=R,C=j}if(T.done)return n(y,C),or&&fp(y,E),k;if(C===null){for(;!T.done;E++,T=x.next())T=f(y,T.value,O),T!==null&&(w=s(T,w,E),S===null?k=T:S.sibling=T,S=T);return or&&fp(y,E),k}for(C=i(C);!T.done;E++,T=x.next())T=m(C,y,E,T.value,O),T!==null&&(e&&T.alternate!==null&&C.delete(T.key===null?E:T.key),w=s(T,w,E),S===null?k=T:S.sibling=T,S=T);return e&&C.forEach(function(A){return t(y,A)}),or&&fp(y,E),k}function v(y,w,x,O){if(typeof x=="object"&&x!==null&&x.type===yx&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case j2:e:{for(var k=x.key;w!==null;){if(w.key===k){if(k=x.type,k===yx){if(w.tag===7){n(y,w.sibling),O=r(w,x.props.children),O.return=y,y=O;break e}}else if(w.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===qm&&oy(k)===w.type){n(y,w.sibling),O=r(w,x.props),tk(O,x),O.return=y,y=O;break e}n(y,w);break}else t(y,w);w=w.sibling}x.type===yx?(O=zy(x.props.children,y.mode,O,x.key),O.return=y,y=O):(O=qj(x.type,x.key,x.props,null,y.mode,O),tk(O,x),O.return=y,y=O)}return o(y);case eS:e:{for(k=x.key;w!==null;){if(w.key===k)if(w.tag===4&&w.stateNode.containerInfo===x.containerInfo&&w.stateNode.implementation===x.implementation){n(y,w.sibling),O=r(w,x.children||[]),O.return=y,y=O;break e}else{n(y,w);break}else t(y,w);w=w.sibling}O=B5(x,y.mode,O),O.return=y,y=O}return o(y);case qm:return x=oy(x),v(y,w,x,O)}if(tS(x))return g(y,w,x,O);if(ZO(x)){if(k=ZO(x),typeof k!="function")throw Error(kt(150));return x=k.call(x),b(y,w,x,O)}if(typeof x.then=="function")return v(y,w,L2(x),O);if(x.$$typeof===Op)return v(y,w,M2(y,x),O);$2(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint"?(x=""+x,w!==null&&w.tag===6?(n(y,w.sibling),O=r(w,x),O.return=y,y=O):(n(y,w),O=F5(x,y.mode,O),O.return=y,y=O),o(y)):n(y,w)}return function(y,w,x,O){try{zE=0;var k=v(y,w,x,O);return Zx=null,k}catch(C){if(C===I1||C===oD)throw C;var S=yu(29,C,null,y.mode);return S.lanes=O,S.return=y,S}finally{}}}var a0=uSe(!0),dSe=uSe(!1),Wm=!1;function rQ(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $F(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Cg(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ag(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,Ar&2){var r=i.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),i.pending=t,t=bR(e),nSe(e,null,n),t}return aD(e,i,t,n),bR(e)}function $S(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,_ke(e,n)}}function Q5(e,t){var n=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?r=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?r=s=t:s=s.next=t}else r=s=t;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:s,shared:i.shared,callbacks:i.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var FF=!1;function FS(){if(FF){var e=Yx;if(e!==null)throw e}}function BS(e,t,n,i){FF=!1;var r=e.updateQueue;Wm=!1;var s=r.firstBaseUpdate,o=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?s=u:o.next=u,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(s!==null){var f=r.baseState;o=0,d=u=c=null,l=s;do{var h=l.lane&-536870913,m=h!==l.lane;if(m?(nr&h)===h:(i&h)===h){h!==0&&h===Mw&&(FF=!0),d!==null&&(d=d.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var g=e,b=l;h=t;var v=n;switch(b.tag){case 1:if(g=b.payload,typeof g=="function"){f=g.call(v,f,h);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=b.payload,h=typeof g=="function"?g.call(v,f,h):g,h==null)break e;f=Ps({},f,h);break e;case 2:Wm=!0}}h=l.callback,h!==null&&(e.flags|=64,m&&(e.flags|=8192),m=r.callbacks,m===null?r.callbacks=[h]:m.push(h))}else m={lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=m,c=f):d=d.next=m,o|=h;if(l=l.next,l===null){if(l=r.shared.pending,l===null)break;m=l,l=m.next,m.next=null,r.lastBaseUpdate=m,r.shared.pending=null}}while(!0);d===null&&(c=f),r.baseState=c,r.firstBaseUpdate=u,r.lastBaseUpdate=d,s===null&&(r.shared.lanes=0),qg|=o,e.lanes=o,e.memoizedState=f}}function fSe(e,t){if(typeof e!="function")throw Error(kt(191,e));e.call(t)}function hSe(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;es?s:8;var o=si.T,l={};si.T=l,bQ(e,!1,t,n);try{var c=r(),u=si.S;if(u!==null&&u(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=KWe(c,i);US(e,t,d,Au(e))}else US(e,t,i,Au(e))}catch(f){US(e,t,{then:function(){},status:"rejected",reason:f},Au())}finally{Tr.p=s,o!==null&&l.types!==null&&(o.types=l.types),si.T=o}}function eKe(){}function VF(e,t,n,i){if(e.tag!==5)throw Error(kt(476));var r=$Se(e).queue;LSe(e,r,t,Qy,n===null?eKe:function(){return FSe(e),n(i)})}function $Se(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Qy,baseState:Qy,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vp,lastRenderedState:Qy},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vp,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function FSe(e){var t=$Se(e);t.next===null&&(t=e.alternate.memoizedState),US(e,t.next.queue,{},Au())}function gQ(){return rl(KE)}function BSe(){return Aa().memoizedState}function USe(){return Aa().memoizedState}function tKe(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Au();e=Cg(n);var i=Ag(t,e,n);i!==null&&(Bc(i,t,n),$S(i,t,n)),t={cache:tQ()},e.payload=t;return}t=t.return}}function nKe(e,t,n){var i=Au();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},dD(e)?zSe(t,n):(n=YU(e,t,n,i),n!==null&&(Bc(n,e,i),VSe(n,t,i)))}function QSe(e,t,n){var i=Au();US(e,t,n,i)}function US(e,t,n,i){var r={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(dD(e))zSe(t,r);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,l=s(o,n);if(r.hasEagerState=!0,r.eagerState=l,Iu(l,o))return aD(e,t,r,0),ls===null&&sD(),!1}catch{}finally{}if(n=YU(e,t,r,i),n!==null)return Bc(n,e,i),VSe(n,t,i),!0}return!1}function bQ(e,t,n,i){if(i={lane:2,revertLane:CQ(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},dD(e)){if(t)throw Error(kt(479))}else t=YU(e,n,i,2),t!==null&&Bc(t,e,2)}function dD(e){var t=e.alternate;return e===Ci||t!==null&&t===Ci}function zSe(e,t){Jx=kR=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function VSe(e,t,n){if(n&4194048){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,_ke(e,n)}}var HE={readContext:rl,use:cD,useCallback:la,useContext:la,useEffect:la,useImperativeHandle:la,useLayoutEffect:la,useInsertionEffect:la,useMemo:la,useReducer:la,useRef:la,useState:la,useDebugValue:la,useDeferredValue:la,useTransition:la,useSyncExternalStore:la,useId:la,useHostTransitionStatus:la,useFormState:la,useActionState:la,useOptimistic:la,useMemoCache:la,useCacheRefresh:la};HE.useEffectEvent=la;var HSe={readContext:rl,use:cD,useCallback:function(e,t){return Kl().memoizedState=[e,t===void 0?null:t],e},useContext:rl,useEffect:LX,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Gj(4194308,4,RSe.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Gj(4194308,4,e,t)},useInsertionEffect:function(e,t){Gj(4,2,e,t)},useMemo:function(e,t){var n=Kl();t=t===void 0?null:t;var i=e();if(o0){ug(!0);try{e()}finally{ug(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=Kl();if(n!==void 0){var r=n(t);if(o0){ug(!0);try{n(t)}finally{ug(!1)}}}else r=t;return i.memoizedState=i.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},i.queue=e,e=e.dispatch=nKe.bind(null,Ci,e),[i.memoizedState,e]},useRef:function(e){var t=Kl();return e={current:e},t.memoizedState=e},useState:function(e){e=QF(e);var t=e.queue,n=QSe.bind(null,Ci,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:pQ,useDeferredValue:function(e,t){var n=Kl();return mQ(n,e,t)},useTransition:function(){var e=QF(!1);return e=LSe.bind(null,Ci,e.queue,!0,!1),Kl().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=Ci,r=Kl();if(or){if(n===void 0)throw Error(kt(407));n=n()}else{if(n=t(),ls===null)throw Error(kt(349));nr&127||ySe(i,t,n)}r.memoizedState=n;var s={value:n,getSnapshot:t};return r.queue=s,LX(xSe.bind(null,i,s,e),[e]),i.flags|=2048,$w(9,{destroy:void 0},vSe.bind(null,i,s,n,t),null),n},useId:function(){var e=Kl(),t=ls.identifierPrefix;if(or){var n=sh,i=rh;n=(i&~(1<<32-Cu(i)-1)).toString(32)+n,t="_"+t+"R_"+n,n=SR++,0<\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof i.is=="string"?o.createElement("select",{is:i.is}):o.createElement("select"),i.multiple?s.multiple=!0:i.size&&(s.size=i.size);break;default:s=typeof i.is=="string"?o.createElement(r,{is:i.is}):o.createElement(r)}}s[tl]=t,s[Qc]=i;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)s.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break e;for(;o.sibling===null;){if(o.return===null||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=s;e:switch(sl(s,r,i),r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Kh(t)}}return Es(t),X5(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Kh(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(kt(166));if(e=Sg.current,Av(t)){if(e=t.stateNode,n=t.memoizedProps,i=null,r=nl,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}e[tl]=t,e=!!(e.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||QEe(e.nodeValue,n)),e||Vg(t,!0)}else e=PR(e).createTextNode(i),e[tl]=t,t.stateNode=e}return Es(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(i=Av(t),n!==null){if(e===null){if(!i)throw Error(kt(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(kt(557));e[tl]=t}else r0(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Es(t),e=!1}else n=U5(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(bu(t),t):(bu(t),null);if(t.flags&128)throw Error(kt(558))}return Es(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Av(t),i!==null&&i.dehydrated!==null){if(e===null){if(!r)throw Error(kt(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(kt(317));r[tl]=t}else r0(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Es(t),r=!1}else r=U5(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(bu(t),t):(bu(t),null)}return bu(t),t.flags&128?(t.lanes=n,t):(n=i!==null,e=e!==null&&e.memoizedState!==null,n&&(i=t.child,r=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(r=i.alternate.memoizedState.cachePool.pool),s=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(s=i.memoizedState.cachePool.pool),s!==r&&(i.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),F2(t,t.updateQueue),Es(t),null);case 4:return Iw(),e===null&&AQ(t.stateNode.containerInfo),Es(t),null;case 10:return _p(t.type),Es(t),null;case 19:if(Io(Sa),i=t.memoizedState,i===null)return Es(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)nk(i,!1);else{if(da!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=OR(e),s!==null){for(t.flags|=128,nk(i,!1),e=s.updateQueue,t.updateQueue=e,F2(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)iSe(n,e),n=n.sibling;return vs(Sa,Sa.current&1|2),or&&fp(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&Su()>TR&&(t.flags|=128,r=!0,nk(i,!1),t.lanes=4194304)}else{if(!r)if(e=OR(s),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,F2(t,e),nk(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!or)return Es(t),null}else 2*Su()-i.renderingStartTime>TR&&n!==536870912&&(t.flags|=128,r=!0,nk(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(e=i.last,e!==null?e.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Su(),e.sibling=null,n=Sa.current,vs(Sa,r?n&1|2:n&1),or&&fp(t,i.treeForkCount),e):(Es(t),null);case 22:case 23:return bu(t),sQ(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?n&536870912&&!(t.flags&128)&&(Es(t),t.subtreeFlags&6&&(t.flags|=8192)):Es(t),n=t.updateQueue,n!==null&&F2(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==n&&(t.flags|=2048),e!==null&&Io(Vy),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),_p(Ka),Es(t),null;case 25:return null;case 30:return null}throw Error(kt(156,t.tag))}function oKe(e,t){switch(eQ(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return _p(Ka),Iw(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return hR(t),null;case 31:if(t.memoizedState!==null){if(bu(t),t.alternate===null)throw Error(kt(340));r0()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(bu(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(kt(340));r0()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Io(Sa),null;case 4:return Iw(),null;case 10:return _p(t.type),null;case 22:case 23:return bu(t),sQ(),e!==null&&Io(Vy),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return _p(Ka),null;case 25:return null;default:return null}}function iEe(e,t){switch(eQ(t),t.tag){case 3:_p(Ka),Iw();break;case 26:case 27:case 5:hR(t);break;case 4:Iw();break;case 31:t.memoizedState!==null&&bu(t);break;case 13:bu(t);break;case 19:Io(Sa);break;case 10:_p(t.type);break;case 22:case 23:bu(t),sQ(),e!==null&&Io(Vy);break;case 24:_p(Ka)}}function TA(e,t){try{var n=t.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var r=i.next;n=r;do{if((n.tag&e)===e){i=void 0;var s=n.create,o=n.inst;i=s(),o.destroy=i}n=n.next}while(n!==r)}}catch(l){Qr(t,t.return,l)}}function Hg(e,t,n){try{var i=t.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var s=r.next;i=s;do{if((i.tag&e)===e){var o=i.inst,l=o.destroy;if(l!==void 0){o.destroy=void 0,r=t;var c=n,u=l;try{u()}catch(d){Qr(r,c,d)}}}i=i.next}while(i!==s)}}catch(d){Qr(t,t.return,d)}}function rEe(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{hSe(t,n)}catch(i){Qr(e,e.return,i)}}}function sEe(e,t,n){n.props=l0(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(i){Qr(e,t,i)}}function QS(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof n=="function"?e.refCleanup=n(i):n.current=i}}catch(r){Qr(e,t,r)}}function ah(e,t){var n=e.ref,i=e.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(r){Qr(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){Qr(e,t,r)}else n.current=null}function aEe(e){var t=e.type,n=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(r){Qr(e,e.return,r)}}function Y5(e,t,n){try{var i=e.stateNode;_Ke(i,e.type,n,t),i[Qc]=t}catch(r){Qr(e,e.return,r)}}function oEe(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ob(e.type)||e.tag===4}function Z5(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||oEe(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ob(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function GF(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=kp));else if(i!==4&&(i===27&&Ob(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(GF(e,t,n),e=e.sibling;e!==null;)GF(e,t,n),e=e.sibling}function AR(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(i===27&&Ob(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(AR(e,t,n),e=e.sibling;e!==null;)AR(e,t,n),e=e.sibling}function lEe(e){var t=e.stateNode,n=e.memoizedProps;try{for(var i=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);sl(t,i,n),t[tl]=e,t[Qc]=n}catch(s){Qr(e,e.return,s)}}var bp=!1,Wa=!1,J5=!1,XX=typeof WeakSet=="function"?WeakSet:Set,Eo=null;function lKe(e,t){if(e=e.containerInfo,n8=$R,e=Gke(e),GU(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var m;f!==n||r!==0&&f.nodeType!==3||(l=o+r),f!==s||i!==0&&f.nodeType!==3||(c=o+i),f.nodeType===3&&(o+=f.nodeValue.length),(m=f.firstChild)!==null;)h=f,f=m;for(;;){if(f===e)break t;if(h===n&&++u===r&&(l=o),h===s&&++d===i&&(c=o),(m=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=m}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(i8={focusedElem:e,selectionRange:n},$R=!1,Eo=t;Eo!==null;)if(t=Eo,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Eo=e;else for(;Eo!==null;){switch(t=Eo,s=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n title"))),sl(s,i,n),s[tl]=e,Ao(s),i=s;break e;case"link":var o=gY("link","href",r).get(i+(n.href||""));if(o){for(var l=0;lv&&(o=v,v=b,b=o);var y=wX(l,b),w=wX(l,v);if(y&&w&&(m.rangeCount!==1||m.anchorNode!==y.node||m.anchorOffset!==y.offset||m.focusNode!==w.node||m.focusOffset!==w.offset)){var x=f.createRange();x.setStart(y.node,y.offset),m.removeAllRanges(),b>v?(m.addRange(x),m.extend(w.node,w.offset)):(x.setEnd(w.node,w.offset),m.addRange(x))}}}}for(f=[],m=l;m=m.parentNode;)m.nodeType===1&&f.push({element:m,left:m.scrollLeft,top:m.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;ln?32:n,si.T=null,n=ZF,ZF=null;var s=_g,o=jp;if(co=0,Bw=_g=null,jp=0,Ar&6)throw Error(kt(331));var l=Ar;if(Ar|=4,vEe(s.current),gEe(s,s.current,o,n),Ar=l,_A(0,!1),Eu&&typeof Eu.onPostCommitFiberRoot=="function")try{Eu.onPostCommitFiberRoot(wA,s)}catch{}return!0}finally{Tr.p=r,si.T=i,PEe(e,t)}}function eY(e,t,n){t=sd(n,t),t=qF(e.stateNode,t,2),e=Ag(e,t,2),e!==null&&(kA(e,2),Th(e))}function Qr(e,t,n){if(e.tag===3)eY(e,e,n);else for(;t!==null;){if(t.tag===3){eY(t,e,n);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Tg===null||!Tg.has(i))){e=sd(n,e),n=XSe(2),i=Ag(t,n,2),i!==null&&(YSe(n,i,t,e),kA(i,2),Th(i));break}}t=t.return}}function t3(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new dKe;var r=new Set;i.set(t,r)}else r=i.get(t),r===void 0&&(r=new Set,i.set(t,r));r.has(n)||(kQ=!0,r.add(n),e=gKe.bind(null,e,t,n),t.then(e,e))}function gKe(e,t,n){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ls===e&&(nr&n)===n&&(da===4||da===3&&(nr&62914560)===nr&&300>Su()-fD?!(Ar&2)&&Uw(e,0):SQ|=n,Fw===nr&&(Fw=0)),Th(e)}function MEe(e,t){t===0&&(t=Ake()),e=L0(e,t),e!==null&&(kA(e,t),Th(e))}function bKe(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),MEe(e,n)}function yKe(e,t){var n=0;switch(e.tag){case 31:case 13:var i=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(kt(314))}i!==null&&i.delete(t),MEe(e,n)}function vKe(e,t){return BU(e,t)}var NR=null,nx=null,e8=!1,RR=!1,n3=!1,pg=0;function Th(e){e!==nx&&e.next===null&&(nx===null?NR=nx=e:nx=nx.next=e),RR=!0,e8||(e8=!0,wKe())}function _A(e,t){if(!n3&&RR){n3=!0;do for(var n=!1,i=NR;i!==null;){if(e!==0){var r=i.pendingLanes;if(r===0)var s=0;else{var o=i.suspendedLanes,l=i.pingedLanes;s=(1<<31-Cu(42|e)+1)-1,s&=r&~(o&~l),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,tY(i,s))}else s=nr,s=tD(i,i===ls?s:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),!(s&3)||OA(i,s)||(n=!0,tY(i,s));i=i.next}while(n);n3=!1}}function xKe(){LEe()}function LEe(){RR=e8=!1;var e=0;pg!==0&&NKe()&&(e=pg);for(var t=Su(),n=null,i=NR;i!==null;){var r=i.next,s=$Ee(i,t);s===0?(i.next=null,n===null?NR=r:n.next=r,r===null&&(nx=n)):(n=i,(e!==0||s&3)&&(RR=!0)),i=r}co!==0&&co!==5||_A(e),pg!==0&&(pg=0)}function $Ee(e,t){for(var n=e.suspendedLanes,i=e.pingedLanes,r=e.expirationTimes,s=e.pendingLanes&-62914561;0l)break;var d=c.transferSize,f=c.initiatorType;d&&aY(f)&&(c=c.responseEnd,o+=d*(c"u"?null:document;function WEe(e,t,n){var i=D1;if(i&&typeof t=="string"&&t){var r=rd(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),hY.has(r)||(hY.add(r),e={rel:e,crossOrigin:n,href:t},i.querySelector(r)===null&&(t=i.createElement("link"),sl(t,"link",e),Ao(t),i.head.appendChild(t)))}}function BKe(e){cm.D(e),WEe("dns-prefetch",e,null)}function UKe(e,t){cm.C(e,t),WEe("preconnect",e,t)}function QKe(e,t,n){cm.L(e,t,n);var i=D1;if(i&&e&&t){var r='link[rel="preload"][as="'+rd(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+rd(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+rd(n.imageSizes)+'"]')):r+='[href="'+rd(e)+'"]';var s=r;switch(t){case"style":s=Qw(e);break;case"script":s=M1(e)}Sd.has(s)||(e=Ps({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Sd.set(s,e),i.querySelector(r)!==null||t==="style"&&i.querySelector(jA(s))||t==="script"&&i.querySelector(NA(s))||(t=i.createElement("link"),sl(t,"link",e),Ao(t),i.head.appendChild(t)))}}function zKe(e,t){cm.m(e,t);var n=D1;if(n&&e){var i=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+rd(i)+'"][href="'+rd(e)+'"]',s=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=M1(e)}if(!Sd.has(s)&&(e=Ps({rel:"modulepreload",href:e},t),Sd.set(s,e),n.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(NA(s)))return}i=n.createElement("link"),sl(i,"link",e),Ao(i),n.head.appendChild(i)}}}function VKe(e,t,n){cm.S(e,t,n);var i=D1;if(i&&e){var r=Kx(i).hoistableStyles,s=Qw(e);t=t||"default";var o=r.get(s);if(!o){var l={loading:0,preload:null};if(o=i.querySelector(jA(s)))l.loading=5;else{e=Ps({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Sd.get(s))&&TQ(e,n);var c=o=i.createElement("link");Ao(c),sl(c,"link",e),c._p=new Promise(function(u,d){c.onload=u,c.onerror=d}),c.addEventListener("load",function(){l.loading|=1}),c.addEventListener("error",function(){l.loading|=2}),l.loading|=4,Jj(o,t,i)}o={type:"stylesheet",instance:o,count:1,state:l},r.set(s,o)}}}function HKe(e,t){cm.X(e,t);var n=D1;if(n&&e){var i=Kx(n).hoistableScripts,r=M1(e),s=i.get(r);s||(s=n.querySelector(NA(r)),s||(e=Ps({src:e,async:!0},t),(t=Sd.get(r))&&_Q(e,t),s=n.createElement("script"),Ao(s),sl(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function qKe(e,t){cm.M(e,t);var n=D1;if(n&&e){var i=Kx(n).hoistableScripts,r=M1(e),s=i.get(r);s||(s=n.querySelector(NA(r)),s||(e=Ps({src:e,async:!0,type:"module"},t),(t=Sd.get(r))&&_Q(e,t),s=n.createElement("script"),Ao(s),sl(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function pY(e,t,n,i){var r=(r=Sg.current)?DR(r):null;if(!r)throw Error(kt(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Qw(n.href),n=Kx(r).hoistableStyles,i=n.get(t),i||(i={type:"style",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Qw(n.href);var s=Kx(r).hoistableStyles,o=s.get(e);if(o||(r=r.ownerDocument||r,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(e,o),(s=r.querySelector(jA(e)))&&!s._p&&(o.instance=s,o.state.loading=5),Sd.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Sd.set(e,n),s||WKe(r,e,n,o.state))),t&&i===null)throw Error(kt(528,""));return o}if(t&&i!==null)throw Error(kt(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=M1(n),n=Kx(r).hoistableScripts,i=n.get(t),i||(i={type:"script",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(kt(444,e))}}function Qw(e){return'href="'+rd(e)+'"'}function jA(e){return'link[rel="stylesheet"]['+e+"]"}function KEe(e){return Ps({},e,{"data-precedence":e.precedence,precedence:null})}function WKe(e,t,n,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),sl(t,"link",n),Ao(t),e.head.appendChild(t))}function M1(e){return'[src="'+rd(e)+'"]'}function NA(e){return"script[async]"+e}function mY(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+rd(n.href)+'"]');if(i)return t.instance=i,Ao(i),i;var r=Ps({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),Ao(i),sl(i,"style",r),Jj(i,n.precedence,e),t.instance=i;case"stylesheet":r=Qw(n.href);var s=e.querySelector(jA(r));if(s)return t.state.loading|=4,t.instance=s,Ao(s),s;i=KEe(n),(r=Sd.get(r))&&TQ(i,r),s=(e.ownerDocument||e).createElement("link"),Ao(s);var o=s;return o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),sl(s,"link",i),t.state.loading|=4,Jj(s,n.precedence,e),t.instance=s;case"script":return s=M1(n.src),(r=e.querySelector(NA(s)))?(t.instance=r,Ao(r),r):(i=n,(r=Sd.get(s))&&(i=Ps({},n),_Q(i,r)),e=e.ownerDocument||e,r=e.createElement("script"),Ao(r),sl(r,"link",i),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(kt(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(i=t.instance,t.state.loading|=4,Jj(i,n.precedence,e));return t.instance}function Jj(e,t,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,s=r,o=0;o title"):null)}function KKe(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function GEe(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function GKe(e,t,n,i){if(n.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&!(n.state.loading&4)){if(n.instance===null){var r=Qw(i.href),s=t.querySelector(jA(r));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=MR.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=s,Ao(s);return}s=t.ownerDocument||t,i=KEe(i),(r=Sd.get(r))&&TQ(i,r),s=s.createElement("link"),Ao(s);var o=s;o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),sl(s,"link",i),n.instance=s}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=MR.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var l3=0;function XKe(e,t){return e.stylesheets&&e.count===0&&tN(e,e.stylesheets),0l3?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(r)}}:null}function MR(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)tN(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var LR=null;function tN(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,LR=new Map,t.forEach(YKe,e),LR=null,MR.call(e))}function YKe(e,t){if(!(t.state.loading&4)){var n=LR.get(e);if(n)var i=n.get(null);else{n=new Map,LR.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(iCe)}catch(e){console.error(e)}}iCe(),dke.exports=JP;var sGe=dke.exports;const aGe=T1(sGe),PQ=p.createContext({});function bD(e){const t=p.useRef(null);return t.current===null&&(t.current=e()),t.current}const yD=p.createContext(null),YE=p.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class oGe extends p.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function lGe({children:e,isPresent:t}){const n=p.useId(),i=p.useRef(null),r=p.useRef({width:0,height:0,top:0,left:0}),{nonce:s}=p.useContext(YE);return p.useInsertionEffect(()=>{const{width:o,height:l,top:c,left:u}=r.current;if(t||!i.current||!o||!l)return;i.current.dataset.motionPopId=n;const d=document.createElement("style");return s&&(d.nonce=s),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(` [data-motion-pop-id="${n}"] { position: absolute !important; width: ${o}px !important; @@ -109,11 +109,11 @@ Error generating stack: `+i.message+` top: ${c}px !important; left: ${u}px !important; } - `),()=>{document.head.removeChild(d)}},[t]),a.jsx(oGe,{isPresent:t,childRef:i,sizeRef:r,children:p.cloneElement(e,{ref:i})})}const cGe=({children:e,initial:t,isPresent:n,onExitComplete:i,custom:r,presenceAffectsLayout:s,mode:o})=>{const l=gD(uGe),c=p.useId(),u=p.useCallback(f=>{l.set(f,!0);for(const h of l.values())if(!h)return;i&&i()},[l,i]),d=p.useMemo(()=>({id:c,initial:t,isPresent:n,custom:r,onExitComplete:u,register:f=>(l.set(f,!1),()=>l.delete(f))}),s?[Math.random(),u]:[n,u]);return p.useMemo(()=>{l.forEach((f,h)=>l.set(h,!1))},[n]),p.useEffect(()=>{!n&&!l.size&&i&&i()},[n]),o==="popLayout"&&(e=a.jsx(lGe,{isPresent:n,children:e})),a.jsx(bD.Provider,{value:d,children:e})};function uGe(){return new Map}function rCe(e=!0){const t=p.useContext(bD);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:r}=t,s=p.useId();p.useEffect(()=>{e&&r(s)},[e]);const o=p.useCallback(()=>e&&i&&i(s),[s,i,e]);return!n&&i?[!1,o]:[!0]}const V2=e=>e.key||"";function SY(e){const t=[];return p.Children.forEach(e,n=>{p.isValidElement(n)&&t.push(n)}),t}const DQ=typeof window<"u",sCe=DQ?p.useLayoutEffect:p.useEffect,hf=({children:e,custom:t,initial:n=!0,onExitComplete:i,presenceAffectsLayout:r=!0,mode:s="sync",propagate:o=!1})=>{const[l,c]=rCe(o),u=p.useMemo(()=>SY(e),[e]),d=o&&!l?[]:u.map(V2),f=p.useRef(!0),h=p.useRef(u),m=gD(()=>new Map),[g,b]=p.useState(u),[v,y]=p.useState(u);sCe(()=>{f.current=!1,h.current=u;for(let O=0;O{const k=V2(O),S=o&&!l?!1:u===v||d.includes(k),C=()=>{if(m.has(k))m.set(k,!0);else return;let E=!0;m.forEach(j=>{j||(E=!1)}),E&&(x==null||x(),y(h.current),o&&(c==null||c()),i&&i())};return a.jsx(cGe,{isPresent:S,initial:!f.current||n?void 0:!1,custom:S?void 0:t,presenceAffectsLayout:r,mode:s,onExitComplete:S?void 0:C,children:O},k)})})},Au=e=>e;let aCe=Au;const dGe={useManualTiming:!1};function fGe(e){let t=new Set,n=new Set,i=!1,r=!1;const s=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function l(u){s.has(u)&&(c.schedule(u),e()),u(o)}const c={schedule:(u,d=!1,f=!1)=>{const m=f&&i?t:n;return d&&s.add(u),m.has(u)||m.add(u),u},cancel:u=>{n.delete(u),s.delete(u)},process:u=>{if(o=u,i){r=!0;return}i=!0,[t,n]=[n,t],t.forEach(l),t.clear(),i=!1,r&&(r=!1,c.process(u))}};return c}const H2=["read","resolveKeyframes","update","preRender","render","postRender"],hGe=40;function oCe(e,t){let n=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=H2.reduce((y,w)=>(y[w]=fGe(s),y),{}),{read:l,resolveKeyframes:c,update:u,preRender:d,render:f,postRender:h}=o,m=()=>{const y=performance.now();n=!1,r.delta=i?1e3/60:Math.max(Math.min(y-r.timestamp,hGe),1),r.timestamp=y,r.isProcessing=!0,l.process(r),c.process(r),u.process(r),d.process(r),f.process(r),h.process(r),r.isProcessing=!1,n&&t&&(i=!1,e(m))},g=()=>{n=!0,i=!0,r.isProcessing||e(m)};return{schedule:H2.reduce((y,w)=>{const x=o[w];return y[w]=(O,k=!1,S=!1)=>(n||g(),x.schedule(O,k,S)),y},{}),cancel:y=>{for(let w=0;wEY[e].some(n=>!!t[n])};function pGe(e){for(const t in e)Qw[t]={...Qw[t],...e[t]}}const mGe=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function FR(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||mGe.has(e)}let cCe=e=>!FR(e);function uCe(e){e&&(cCe=t=>t.startsWith("on")?!FR(t):e(t))}try{uCe(require("@emotion/is-prop-valid").default)}catch{}function gGe(e,t,n){const i={};for(const r in e)r==="values"&&typeof e.values=="object"||(cCe(r)||n===!0&&FR(r)||!t&&!FR(r)||e.draggable&&r.startsWith("onDrag"))&&(i[r]=e[r]);return i}function bGe({children:e,isValidProp:t,...n}){t&&uCe(t),n={...p.useContext(qE),...n},n.isStatic=gD(()=>n.isStatic);const i=p.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return a.jsx(qE.Provider,{value:i,children:e})}function yGe(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...i)=>e(...i);return new Proxy(n,{get:(i,r)=>r==="create"?e:(t.has(r)||t.set(r,e(r)),t.get(r))})}const yD=p.createContext({});function WE(e){return typeof e=="string"||Array.isArray(e)}function vD(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const MQ=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],LQ=["initial",...MQ];function xD(e){return vD(e.animate)||LQ.some(t=>WE(e[t]))}function dCe(e){return!!(xD(e)||e.variants)}function vGe(e,t){if(xD(e)){const{initial:n,animate:i}=e;return{initial:n===!1||WE(n)?n:void 0,animate:WE(i)?i:void 0}}return e.inherit!==!1?t:{}}function xGe(e){const{initial:t,animate:n}=vGe(e,p.useContext(yD));return p.useMemo(()=>({initial:t,animate:n}),[CY(t),CY(n)])}function CY(e){return Array.isArray(e)?e.join(" "):e}const wGe=Symbol.for("motionComponentSymbol");function Tx(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function OGe(e,t,n){return p.useCallback(i=>{i&&e.onMount&&e.onMount(i),t&&(i?t.mount(i):t.unmount()),n&&(typeof n=="function"?n(i):Tx(n)&&(n.current=i))},[t])}const $Q=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),kGe="framerAppearId",fCe="data-"+$Q(kGe),{schedule:FQ}=oCe(queueMicrotask,!1),hCe=p.createContext({});function SGe(e,t,n,i,r){var s,o;const{visualElement:l}=p.useContext(yD),c=p.useContext(lCe),u=p.useContext(bD),d=p.useContext(qE).reducedMotion,f=p.useRef(null);i=i||c.renderer,!f.current&&i&&(f.current=i(e,{visualState:t,parent:l,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d}));const h=f.current,m=p.useContext(hCe);h&&!h.projection&&r&&(h.type==="html"||h.type==="svg")&&EGe(f.current,n,r,m);const g=p.useRef(!1);p.useInsertionEffect(()=>{h&&g.current&&h.update(n,u)});const b=n[fCe],v=p.useRef(!!b&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,b))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,b)));return sCe(()=>{h&&(g.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),FQ.render(h.render),v.current&&h.animationState&&h.animationState.animateChanges())}),p.useEffect(()=>{h&&(!v.current&&h.animationState&&h.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)===null||y===void 0||y.call(window,b)}),v.current=!1))}),h}function EGe(e,t,n,i){const{layoutId:r,layout:s,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:pCe(e.parent)),e.projection.setOptions({layoutId:r,layout:s,alwaysMeasureLayout:!!o||l&&Tx(l),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:i,layoutScroll:c,layoutRoot:u})}function pCe(e){if(e)return e.options.allowProjection!==!1?e.projection:pCe(e.parent)}function CGe({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:i,Component:r}){var s,o;e&&pGe(e);function l(u,d){let f;const h={...p.useContext(qE),...u,layoutId:AGe(u)},{isStatic:m}=h,g=xGe(u),b=i(u,m);if(!m&&DQ){TGe();const v=_Ge(h);f=v.MeasureLayout,g.visualElement=SGe(r,b,h,t,v.ProjectionNode)}return a.jsxs(yD.Provider,{value:g,children:[f&&g.visualElement?a.jsx(f,{visualElement:g.visualElement,...h}):null,n(r,u,OGe(b,g.visualElement,d),b,m,g.visualElement)]})}l.displayName=`motion.${typeof r=="string"?r:`create(${(o=(s=r.displayName)!==null&&s!==void 0?s:r.name)!==null&&o!==void 0?o:""})`}`;const c=p.forwardRef(l);return c[wGe]=r,c}function AGe({layoutId:e}){const t=p.useContext(PQ).id;return t&&e!==void 0?t+"-"+e:e}function TGe(e,t){p.useContext(lCe).strict}function _Ge(e){const{drag:t,layout:n}=Qw;if(!t&&!n)return{};const i={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}const jGe=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function BQ(e){return typeof e!="string"||e.includes("-")?!1:!!(jGe.indexOf(e)>-1||/[A-Z]/u.test(e))}function AY(e){const t=[{},{}];return e==null||e.values.forEach((n,i)=>{t[0][i]=n.get(),t[1][i]=n.getVelocity()}),t}function UQ(e,t,n,i){if(typeof t=="function"){const[r,s]=AY(i);t=t(n!==void 0?n:e.custom,r,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[r,s]=AY(i);t=t(n!==void 0?n:e.custom,r,s)}return t}const d8=e=>Array.isArray(e),NGe=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),RGe=e=>d8(e)?e[e.length-1]||0:e,_l=e=>!!(e&&e.getVelocity);function nN(e){const t=_l(e)?e.get():e;return NGe(t)?t.toValue():t}function IGe({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},i,r,s){const o={latestValues:PGe(i,r,s,e),renderState:t()};return n&&(o.onMount=l=>n({props:i,current:l,...o}),o.onUpdate=l=>n(l)),o}const mCe=e=>(t,n)=>{const i=p.useContext(yD),r=p.useContext(bD),s=()=>IGe(e,t,i,r);return n?s():gD(s)};function PGe(e,t,n,i){const r={},s=i(e,{});for(const h in s)r[h]=nN(s[h]);let{initial:o,animate:l}=e;const c=xD(e),u=dCe(e);t&&u&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const f=d?l:o;if(f&&typeof f!="boolean"&&!vD(f)){const h=Array.isArray(f)?f:[f];for(let m=0;mt=>typeof t=="string"&&t.startsWith(e),bCe=gCe("--"),DGe=gCe("var(--"),QQ=e=>DGe(e)?MGe.test(e.split("/*")[0].trim()):!1,MGe=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,yCe=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Gp=(e,t,n)=>n>t?t:ntypeof e=="number",parse:parseFloat,transform:e=>e},KE={...M1,transform:e=>Gp(0,1,e)},q2={...M1,default:1},AA=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),zm=AA("deg"),hh=AA("%"),Kn=AA("px"),LGe=AA("vh"),$Ge=AA("vw"),TY={...hh,parse:e=>hh.parse(e)/100,transform:e=>hh.transform(e*100)},FGe={borderWidth:Kn,borderTopWidth:Kn,borderRightWidth:Kn,borderBottomWidth:Kn,borderLeftWidth:Kn,borderRadius:Kn,radius:Kn,borderTopLeftRadius:Kn,borderTopRightRadius:Kn,borderBottomRightRadius:Kn,borderBottomLeftRadius:Kn,width:Kn,maxWidth:Kn,height:Kn,maxHeight:Kn,top:Kn,right:Kn,bottom:Kn,left:Kn,padding:Kn,paddingTop:Kn,paddingRight:Kn,paddingBottom:Kn,paddingLeft:Kn,margin:Kn,marginTop:Kn,marginRight:Kn,marginBottom:Kn,marginLeft:Kn,backgroundPositionX:Kn,backgroundPositionY:Kn},BGe={rotate:zm,rotateX:zm,rotateY:zm,rotateZ:zm,scale:q2,scaleX:q2,scaleY:q2,scaleZ:q2,skew:zm,skewX:zm,skewY:zm,distance:Kn,translateX:Kn,translateY:Kn,translateZ:Kn,x:Kn,y:Kn,z:Kn,perspective:Kn,transformPerspective:Kn,opacity:KE,originX:TY,originY:TY,originZ:Kn},_Y={...M1,transform:Math.round},zQ={...FGe,...BGe,zIndex:_Y,size:Kn,fillOpacity:KE,strokeOpacity:KE,numOctaves:_Y},UGe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},QGe=D1.length;function zGe(e,t,n){let i="",r=!0;for(let s=0;s({style:{},transform:{},transformOrigin:{},vars:{}}),vCe=()=>({...qQ(),attrs:{}}),WQ=e=>typeof e=="string"&&e.toLowerCase()==="svg";function xCe(e,{style:t,vars:n},i,r){Object.assign(e.style,t,r&&r.getProjectionStyles(i));for(const s in n)e.style.setProperty(s,n[s])}const wCe=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function OCe(e,t,n,i){xCe(e,t,void 0,i);for(const r in t.attrs)e.setAttribute(wCe.has(r)?r:$Q(r),t.attrs[r])}const BR={};function KGe(e){Object.assign(BR,e)}function kCe(e,{layout:t,layoutId:n}){return M0.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!BR[e]||e==="opacity")}function KQ(e,t,n){var i;const{style:r}=e,s={};for(const o in r)(_l(r[o])||t.style&&_l(t.style[o])||kCe(o,e)||((i=n==null?void 0:n.getValue(o))===null||i===void 0?void 0:i.liveStyle)!==void 0)&&(s[o]=r[o]);return s}function SCe(e,t,n){const i=KQ(e,t,n);for(const r in e)if(_l(e[r])||_l(t[r])){const s=D1.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;i[s]=e[r]}return i}function GGe(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const NY=["x","y","width","height","cx","cy","r"],XGe={useVisualState:mCe({scrapeMotionValuesFromProps:SCe,createRenderState:vCe,onUpdate:({props:e,prevProps:t,current:n,renderState:i,latestValues:r})=>{if(!n)return;let s=!!e.drag;if(!s){for(const l in r)if(M0.has(l)){s=!0;break}}if(!s)return;let o=!t;if(t)for(let l=0;l{GGe(n,i),Is.render(()=>{HQ(i,r,WQ(n.tagName),e.transformTemplate),OCe(n,i)})})}})},YGe={useVisualState:mCe({scrapeMotionValuesFromProps:KQ,createRenderState:qQ})};function ECe(e,t,n){for(const i in t)!_l(t[i])&&!kCe(i,n)&&(e[i]=t[i])}function ZGe({transformTemplate:e},t){return p.useMemo(()=>{const n=qQ();return VQ(n,t,e),Object.assign({},n.vars,n.style)},[t])}function JGe(e,t){const n=e.style||{},i={};return ECe(i,n,e),Object.assign(i,ZGe(e,t)),i}function eXe(e,t){const n={},i=JGe(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=i,n}function tXe(e,t,n,i){const r=p.useMemo(()=>{const s=vCe();return HQ(s,t,WQ(i),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};ECe(s,e.style,e),r.style={...s,...r.style}}return r}function nXe(e=!1){return(n,i,r,{latestValues:s},o)=>{const c=(BQ(n)?tXe:eXe)(i,s,o,n),u=gGe(i,typeof n=="string",e),d=n!==p.Fragment?{...u,...c,ref:r}:{},{children:f}=i,h=p.useMemo(()=>_l(f)?f.get():f,[f]);return p.createElement(n,{...d,children:h})}}function iXe(e,t){return function(i,{forwardMotionProps:r}={forwardMotionProps:!1}){const o={...BQ(i)?XGe:YGe,preloadedFeatures:e,useRender:nXe(r),createVisualElement:t,Component:i};return CGe(o)}}function CCe(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;i(iN===void 0&&ph.set(Go.isProcessing||dGe.useManualTiming?Go.timestamp:performance.now()),iN),set:e=>{iN=e,queueMicrotask(rXe)}};function XQ(e,t){e.indexOf(t)===-1&&e.push(t)}function YQ(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class ZQ{constructor(){this.subscriptions=[]}add(t){return XQ(this.subscriptions,t),()=>YQ(this.subscriptions,t)}notify(t,n,i){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](t,n,i);else for(let s=0;s!isNaN(parseFloat(e));class aXe{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(i,r=!0)=>{const s=ph.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),r&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=ph.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=sXe(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new ZQ);const i=this.events[t].add(n);return t==="change"?()=>{i(),Is.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,i){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-i}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=ph.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>RY)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,RY);return TCe(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function GE(e,t){return new aXe(e,t)}function oXe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,GE(n))}function lXe(e,t){const n=wD(e,t);let{transitionEnd:i={},transition:r={},...s}=n||{};s={...s,...i};for(const o in s){const l=RGe(s[o]);oXe(e,o,l)}}function cXe(e){return!!(_l(e)&&e.add)}function f8(e,t){const n=e.getValue("willChange");if(cXe(n))return n.add(t)}function _Ce(e){return e.props[fCe]}function JQ(e){let t;return()=>(t===void 0&&(t=e()),t)}const uXe=JQ(()=>window.ScrollTimeline!==void 0);class dXe{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let i=0;i{if(uXe()&&r.attachTimeline)return r.attachTimeline(t);if(typeof n=="function")return n(r)});return()=>{i.forEach((r,s)=>{r&&r(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;nn[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class fXe extends dXe{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}const Ip=e=>e*1e3,Pp=e=>e/1e3;function ez(e){return typeof e=="function"}function IY(e,t){e.timeline=t,e.onfinish=null}const tz=e=>Array.isArray(e)&&typeof e[0]=="number",hXe={linearEasing:void 0};function pXe(e,t){const n=JQ(e);return()=>{var i;return(i=hXe[t])!==null&&i!==void 0?i:n()}}const UR=pXe(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),zw=(e,t,n)=>{const i=t-e;return i===0?1:(n-e)/i},jCe=(e,t,n=10)=>{let i="";const r=Math.max(Math.round(t/n),2);for(let s=0;s`cubic-bezier(${e}, ${t}, ${n}, ${i})`,h8={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:eS([0,.65,.55,1]),circOut:eS([.55,0,1,.45]),backIn:eS([.31,.01,.66,-.59]),backOut:eS([.33,1.53,.69,.99])};function RCe(e,t){if(e)return typeof e=="function"&&UR()?jCe(e,t):tz(e)?eS(e):Array.isArray(e)?e.map(n=>RCe(n,t)||h8.easeOut):h8[e]}const ICe=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,mXe=1e-7,gXe=12;function bXe(e,t,n,i,r){let s,o,l=0;do o=t+(n-t)/2,s=ICe(o,i,r)-e,s>0?n=o:t=o;while(Math.abs(s)>mXe&&++lbXe(s,0,1,e,n);return s=>s===0||s===1?s:ICe(r(s),t,i)}const PCe=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,DCe=e=>t=>1-e(1-t),MCe=TA(.33,1.53,.69,.99),nz=DCe(MCe),LCe=PCe(nz),$Ce=e=>(e*=2)<1?.5*nz(e):.5*(2-Math.pow(2,-10*(e-1))),iz=e=>1-Math.sin(Math.acos(e)),FCe=DCe(iz),BCe=PCe(iz),UCe=e=>/^0[^.\s]+$/u.test(e);function yXe(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||UCe(e):!0}const QS=e=>Math.round(e*1e5)/1e5,rz=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function vXe(e){return e==null}const xXe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,sz=(e,t)=>n=>!!(typeof n=="string"&&xXe.test(n)&&n.startsWith(e)||t&&!vXe(n)&&Object.prototype.hasOwnProperty.call(n,t)),QCe=(e,t,n)=>i=>{if(typeof i!="string")return i;const[r,s,o,l]=i.match(rz);return{[e]:parseFloat(r),[t]:parseFloat(s),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},wXe=e=>Gp(0,255,e),u3={...M1,transform:e=>Math.round(wXe(e))},Sy={test:sz("rgb","red"),parse:QCe("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+u3.transform(e)+", "+u3.transform(t)+", "+u3.transform(n)+", "+QS(KE.transform(i))+")"};function OXe(e){let t="",n="",i="",r="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),i=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),i=e.substring(3,4),r=e.substring(4,5),t+=t,n+=n,i+=i,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}}const p8={test:sz("#"),parse:OXe,transform:Sy.transform},_x={test:sz("hsl","hue"),parse:QCe("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+hh.transform(QS(t))+", "+hh.transform(QS(n))+", "+QS(KE.transform(i))+")"},Cl={test:e=>Sy.test(e)||p8.test(e)||_x.test(e),parse:e=>Sy.test(e)?Sy.parse(e):_x.test(e)?_x.parse(e):p8.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Sy.transform(e):_x.transform(e)},kXe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function SXe(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(rz))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(kXe))===null||n===void 0?void 0:n.length)||0)>0}const zCe="number",VCe="color",EXe="var",CXe="var(",PY="${}",AXe=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function XE(e){const t=e.toString(),n=[],i={color:[],number:[],var:[]},r=[];let s=0;const l=t.replace(AXe,c=>(Cl.test(c)?(i.color.push(s),r.push(VCe),n.push(Cl.parse(c))):c.startsWith(CXe)?(i.var.push(s),r.push(EXe),n.push(c)):(i.number.push(s),r.push(zCe),n.push(parseFloat(c))),++s,PY)).split(PY);return{values:n,split:l,indexes:i,types:r}}function HCe(e){return XE(e).values}function qCe(e){const{split:t,types:n}=XE(e),i=t.length;return r=>{let s="";for(let o=0;otypeof e=="number"?0:e;function _Xe(e){const t=HCe(e);return qCe(e)(t.map(TXe))}const Gg={test:SXe,parse:HCe,createTransformer:qCe,getAnimatableNone:_Xe},jXe=new Set(["brightness","contrast","saturate","opacity"]);function NXe(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=n.match(rz)||[];if(!i)return e;const r=n.replace(i,"");let s=jXe.has(t)?1:0;return i!==n&&(s*=100),t+"("+s+r+")"}const RXe=/\b([a-z-]*)\(.*?\)/gu,m8={...Gg,getAnimatableNone:e=>{const t=e.match(RXe);return t?t.map(NXe).join(" "):e}},IXe={...zQ,color:Cl,backgroundColor:Cl,outlineColor:Cl,fill:Cl,stroke:Cl,borderColor:Cl,borderTopColor:Cl,borderRightColor:Cl,borderBottomColor:Cl,borderLeftColor:Cl,filter:m8,WebkitFilter:m8},az=e=>IXe[e];function WCe(e,t){let n=az(e);return n!==m8&&(n=Gg),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const PXe=new Set(["auto","none","0"]);function DXe(e,t,n){let i=0,r;for(;ie===M1||e===Kn,MY=(e,t)=>parseFloat(e.split(", ")[t]),LY=(e,t)=>(n,{transform:i})=>{if(i==="none"||!i)return 0;const r=i.match(/^matrix3d\((.+)\)$/u);if(r)return MY(r[1],t);{const s=i.match(/^matrix\((.+)\)$/u);return s?MY(s[1],e):0}},MXe=new Set(["x","y","z"]),LXe=D1.filter(e=>!MXe.has(e));function $Xe(e){const t=[];return LXe.forEach(n=>{const i=e.getValue(n);i!==void 0&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t}const Vw={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:LY(4,13),y:LY(5,14)};Vw.translateX=Vw.x;Vw.translateY=Vw.y;const Vy=new Set;let g8=!1,b8=!1;function KCe(){if(b8){const e=Array.from(Vy).filter(i=>i.needsMeasurement),t=new Set(e.map(i=>i.element)),n=new Map;t.forEach(i=>{const r=$Xe(i);r.length&&(n.set(i,r),i.render())}),e.forEach(i=>i.measureInitialState()),t.forEach(i=>{i.render();const r=n.get(i);r&&r.forEach(([s,o])=>{var l;(l=i.getValue(s))===null||l===void 0||l.set(o)})}),e.forEach(i=>i.measureEndState()),e.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}b8=!1,g8=!1,Vy.forEach(e=>e.complete()),Vy.clear()}function GCe(){Vy.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(b8=!0)})}function FXe(){GCe(),KCe()}class oz{constructor(t,n,i,r,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=i,this.motionValue=r,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Vy.add(this),g8||(g8=!0,Is.read(GCe),Is.resolveKeyframes(KCe))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:i,motionValue:r}=this;for(let s=0;s/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),BXe=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function UXe(e){const t=BXe.exec(e);if(!t)return[,];const[,n,i,r]=t;return[`--${n??i}`,r]}function YCe(e,t,n=1){const[i,r]=UXe(e);if(!i)return;const s=window.getComputedStyle(t).getPropertyValue(i);if(s){const o=s.trim();return XCe(o)?parseFloat(o):o}return QQ(r)?YCe(r,t,n+1):r}const ZCe=e=>t=>t.test(e),QXe={test:e=>e==="auto",parse:e=>e},JCe=[M1,Kn,hh,zm,$Ge,LGe,QXe],$Y=e=>JCe.find(ZCe(e));class eAe extends oz{constructor(t,n,i,r,s){super(t,n,i,r,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:i}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c{n.getValue(c).set(u)}),this.resolveNoneKeyframes()}}const FY=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Gg.test(e)||e==="0")&&!e.startsWith("url("));function zXe(e){const t=e[0];if(e.length===1)return!0;for(let n=0;ne!==null;function OD(e,{repeat:t,repeatType:n="loop"},i){const r=e.filter(HXe),s=t&&n!=="loop"&&t%2===1?0:r.length-1;return!s||i===void 0?r[s]:i}const qXe=40;class tAe{constructor({autoplay:t=!0,delay:n=0,type:i="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:o="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=ph.now(),this.options={autoplay:t,delay:n,type:i,repeat:r,repeatDelay:s,repeatType:o,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>qXe?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&FXe(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=ph.now(),this.hasAttemptedResolve=!0;const{name:i,type:r,velocity:s,delay:o,onComplete:l,onUpdate:c,isGenerator:u}=this.options;if(!u&&!VXe(t,i,r,s))if(o)this.options.duration=0;else{c&&c(OD(t,this.options,n)),l&&l(),this.resolveFinishedPromise();return}const d=this.initPlayback(t,n);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...d},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const y8=2e4;function nAe(e){let t=0;const n=50;let i=e.next(t);for(;!i.done&&t=y8?1/0:t}const ta=(e,t,n)=>e+(t-e)*n;function d3(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function WXe({hue:e,saturation:t,lightness:n,alpha:i}){e/=360,t/=100,n/=100;let r=0,s=0,o=0;if(!t)r=s=o=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;r=d3(c,l,e+1/3),s=d3(c,l,e),o=d3(c,l,e-1/3)}return{red:Math.round(r*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:i}}function QR(e,t){return n=>n>0?t:e}const f3=(e,t,n)=>{const i=e*e,r=n*(t*t-i)+i;return r<0?0:Math.sqrt(r)},KXe=[p8,Sy,_x],GXe=e=>KXe.find(t=>t.test(e));function BY(e){const t=GXe(e);if(!t)return!1;let n=t.parse(e);return t===_x&&(n=WXe(n)),n}const UY=(e,t)=>{const n=BY(e),i=BY(t);if(!n||!i)return QR(e,t);const r={...n};return s=>(r.red=f3(n.red,i.red,s),r.green=f3(n.green,i.green,s),r.blue=f3(n.blue,i.blue,s),r.alpha=ta(n.alpha,i.alpha,s),Sy.transform(r))},XXe=(e,t)=>n=>t(e(n)),_A=(...e)=>e.reduce(XXe),v8=new Set(["none","hidden"]);function YXe(e,t){return v8.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function ZXe(e,t){return n=>ta(e,t,n)}function lz(e){return typeof e=="number"?ZXe:typeof e=="string"?QQ(e)?QR:Cl.test(e)?UY:tYe:Array.isArray(e)?iAe:typeof e=="object"?Cl.test(e)?UY:JXe:QR}function iAe(e,t){const n=[...e],i=n.length,r=e.map((s,o)=>lz(s)(s,t[o]));return s=>{for(let o=0;o{for(const s in i)n[s]=i[s](r);return n}}function eYe(e,t){var n;const i=[],r={color:0,var:0,number:0};for(let s=0;s{const n=Gg.createTransformer(t),i=XE(e),r=XE(t);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?v8.has(e)&&!r.values.length||v8.has(t)&&!i.values.length?YXe(e,t):_A(iAe(eYe(i,r),r.values),n):QR(e,t)};function rAe(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ta(e,t,n):lz(e)(e,t)}const nYe=5;function sAe(e,t,n){const i=Math.max(t-nYe,0);return TCe(n-e(i),t-i)}const ua={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},h3=.001;function iYe({duration:e=ua.duration,bounce:t=ua.bounce,velocity:n=ua.velocity,mass:i=ua.mass}){let r,s,o=1-t;o=Gp(ua.minDamping,ua.maxDamping,o),e=Gp(ua.minDuration,ua.maxDuration,Pp(e)),o<1?(r=u=>{const d=u*o,f=d*e,h=d-n,m=x8(u,o),g=Math.exp(-f);return h3-h/m*g},s=u=>{const f=u*o*e,h=f*n+n,m=Math.pow(o,2)*Math.pow(u,2)*e,g=Math.exp(-f),b=x8(Math.pow(u,2),o);return(-r(u)+h3>0?-1:1)*((h-m)*g)/b}):(r=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-h3+d*f},s=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const l=5/e,c=sYe(r,s,l);if(e=Ip(e),isNaN(c))return{stiffness:ua.stiffness,damping:ua.damping,duration:e};{const u=Math.pow(c,2)*i;return{stiffness:u,damping:o*2*Math.sqrt(i*u),duration:e}}}const rYe=12;function sYe(e,t,n){let i=n;for(let r=1;re[n]!==void 0)}function lYe(e){let t={velocity:ua.velocity,stiffness:ua.stiffness,damping:ua.damping,mass:ua.mass,isResolvedFromDuration:!1,...e};if(!QY(e,oYe)&&QY(e,aYe))if(e.visualDuration){const n=e.visualDuration,i=2*Math.PI/(n*1.2),r=i*i,s=2*Gp(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:ua.mass,stiffness:r,damping:s}}else{const n=iYe(e);t={...t,...n,mass:ua.mass},t.isResolvedFromDuration=!0}return t}function aAe(e=ua.visualDuration,t=ua.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:i,restDelta:r}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:s},{stiffness:c,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:m}=lYe({...n,velocity:-Pp(n.velocity||0)}),g=h||0,b=u/(2*Math.sqrt(c*d)),v=o-s,y=Pp(Math.sqrt(c/d)),w=Math.abs(v)<5;i||(i=w?ua.restSpeed.granular:ua.restSpeed.default),r||(r=w?ua.restDelta.granular:ua.restDelta.default);let x;if(b<1){const k=x8(y,b);x=S=>{const C=Math.exp(-b*y*S);return o-C*((g+b*y*v)/k*Math.sin(k*S)+v*Math.cos(k*S))}}else if(b===1)x=k=>o-Math.exp(-y*k)*(v+(g+y*v)*k);else{const k=y*Math.sqrt(b*b-1);x=S=>{const C=Math.exp(-b*y*S),E=Math.min(k*S,300);return o-C*((g+b*y*v)*Math.sinh(E)+k*v*Math.cosh(E))/k}}const O={calculatedDuration:m&&f||null,next:k=>{const S=x(k);if(m)l.done=k>=f;else{let C=0;b<1&&(C=k===0?Ip(g):sAe(x,k,S));const E=Math.abs(C)<=i,j=Math.abs(o-S)<=r;l.done=E&&j}return l.value=l.done?o:S,l},toString:()=>{const k=Math.min(nAe(O),y8),S=jCe(C=>O.next(k*C).value,k,30);return k+"ms "+S}};return O}function zY({keyframes:e,velocity:t=0,power:n=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:s=500,modifyTarget:o,min:l,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},m=E=>l!==void 0&&Ec,g=E=>l===void 0?c:c===void 0||Math.abs(l-E)-b*Math.exp(-E/i),x=E=>y+w(E),O=E=>{const j=w(E),T=x(E);h.done=Math.abs(j)<=u,h.value=h.done?y:T};let k,S;const C=E=>{m(h.value)&&(k=E,S=aAe({keyframes:[h.value,g(h.value)],velocity:sAe(x,E,h.value),damping:r,stiffness:s,restDelta:u,restSpeed:d}))};return C(0),{calculatedDuration:null,next:E=>{let j=!1;return!S&&k===void 0&&(j=!0,O(E),C(E)),k!==void 0&&E>=k?S.next(E-k):(!j&&O(E),h)}}}const cYe=TA(.42,0,1,1),uYe=TA(0,0,.58,1),oAe=TA(.42,0,.58,1),dYe=e=>Array.isArray(e)&&typeof e[0]!="number",fYe={linear:Au,easeIn:cYe,easeInOut:oAe,easeOut:uYe,circIn:iz,circInOut:BCe,circOut:FCe,backIn:nz,backInOut:LCe,backOut:MCe,anticipate:$Ce},VY=e=>{if(tz(e)){aCe(e.length===4);const[t,n,i,r]=e;return TA(t,n,i,r)}else if(typeof e=="string")return fYe[e];return e};function hYe(e,t,n){const i=[],r=n||rAe,s=e.length-1;for(let o=0;ot[0];if(s===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=hYe(t,i,r),c=l.length,u=d=>{if(o&&d1)for(;fu(Gp(e[0],e[s-1],d)):u}function mYe(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const r=zw(0,t,i);e.push(ta(n,1,r))}}function gYe(e){const t=[0];return mYe(t,e.length-1),t}function bYe(e,t){return e.map(n=>n*t)}function yYe(e,t){return e.map(()=>t||oAe).splice(0,e.length-1)}function zR({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const r=dYe(i)?i.map(VY):VY(i),s={done:!1,value:t[0]},o=bYe(n&&n.length===t.length?n:gYe(t),e),l=pYe(o,t,{ease:Array.isArray(r)?r:yYe(t,r)});return{calculatedDuration:e,next:c=>(s.value=l(c),s.done=c>=e,s)}}const vYe=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Is.update(t,!0),stop:()=>Kg(t),now:()=>Go.isProcessing?Go.timestamp:ph.now()}},xYe={decay:zY,inertia:zY,tween:zR,keyframes:zR,spring:aAe},wYe=e=>e/100;class cz extends tAe{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:c}=this.options;c&&c()};const{name:n,motionValue:i,element:r,keyframes:s}=this.options,o=(r==null?void 0:r.KeyframeResolver)||oz,l=(c,u)=>this.onKeyframesResolved(c,u);this.resolver=new o(s,l,n,i,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:s,velocity:o=0}=this.options,l=ez(n)?n:xYe[n]||zR;let c,u;l!==zR&&typeof t[0]!="number"&&(c=_A(wYe,rAe(t[0],t[1])),t=[0,100]);const d=l({...this.options,keyframes:t});s==="mirror"&&(u=l({...this.options,keyframes:[...t].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=nAe(d));const{calculatedDuration:f}=d,h=f+r,m=h*(i+1)-r;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:c,calculatedDuration:f,resolvedDuration:h,totalDuration:m}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:i}=this;if(!i){const{keyframes:E}=this.options;return{done:!0,value:E[E.length-1]}}const{finalKeyframe:r,generator:s,mirroredGenerator:o,mapPercentToKeyframes:l,keyframes:c,calculatedDuration:u,totalDuration:d,resolvedDuration:f}=i;if(this.startTime===null)return s.next(0);const{delay:h,repeat:m,repeatType:g,repeatDelay:b,onUpdate:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const y=this.currentTime-h*(this.speed>=0?1:-1),w=this.speed>=0?y<0:y>d;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let x=this.currentTime,O=s;if(m){const E=Math.min(this.currentTime,d)/f;let j=Math.floor(E),T=E%1;!T&&E>=1&&(T=1),T===1&&j--,j=Math.min(j,m+1),!!(j%2)&&(g==="reverse"?(T=1-T,b&&(T-=b/f)):g==="mirror"&&(O=o)),x=Gp(0,1,T)*f}const k=w?{done:!1,value:c[0]}:O.next(x);l&&(k.value=l(k.value));let{done:S}=k;!w&&u!==null&&(S=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&S);return C&&r!==void 0&&(k.value=OD(c,this.options,r)),v&&v(k.value),C&&this.finish(),k}get duration(){const{resolved:t}=this;return t?Pp(t.calculatedDuration):0}get time(){return Pp(this.currentTime)}set time(t){t=Ip(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Pp(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=vYe,onPlay:n,startTime:i}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),n&&n();const r=this.driver.now();this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=r):this.startTime=i??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const OYe=new Set(["opacity","clipPath","filter","transform"]);function kYe(e,t,n,{delay:i=0,duration:r=300,repeat:s=0,repeatType:o="loop",ease:l="easeInOut",times:c}={}){const u={[t]:n};c&&(u.offset=c);const d=RCe(l,r);return Array.isArray(d)&&(u.easing=d),e.animate(u,{delay:i,duration:r,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}const SYe=JQ(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),VR=10,EYe=2e4;function CYe(e){return ez(e.type)||e.type==="spring"||!NCe(e.ease)}function AYe(e,t){const n=new cz({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let i={done:!1,value:e[0]};const r=[];let s=0;for(;!i.done&&sthis.onKeyframesResolved(o,l),n,i,r),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:i=300,times:r,ease:s,type:o,motionValue:l,name:c,startTime:u}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof s=="string"&&UR()&&TYe(s)&&(s=lAe[s]),CYe(this.options)){const{onComplete:f,onUpdate:h,motionValue:m,element:g,...b}=this.options,v=AYe(t,b);t=v.keyframes,t.length===1&&(t[1]=t[0]),i=v.duration,r=v.times,s=v.ease,o="keyframes"}const d=kYe(l.owner.current,c,t,{...this.options,duration:i,times:r,ease:s});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(IY(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;l.set(OD(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:i,times:r,type:o,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return Pp(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Pp(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:i}=n;i.currentTime=Ip(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:i}=n;i.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return Au;const{animation:i}=n;IY(i,t)}return Au}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:i,duration:r,type:s,ease:o,times:l}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:d,onComplete:f,element:h,...m}=this.options,g=new cz({...m,keyframes:i,duration:r,type:s,ease:o,times:l,isGenerator:!0}),b=Ip(this.time);u.setWithVelocity(g.sample(b-VR).value,g.sample(b).value,VR)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:i,repeatDelay:r,repeatType:s,damping:o,type:l}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=n.owner.getProps();return SYe()&&i&&OYe.has(i)&&!c&&!u&&!r&&s!=="mirror"&&o!==0&&l!=="inertia"}}const _Ye={type:"spring",stiffness:500,damping:25,restSpeed:10},jYe=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),NYe={type:"keyframes",duration:.8},RYe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},IYe=(e,{keyframes:t})=>t.length>2?NYe:M0.has(e)?e.startsWith("scale")?jYe(t[1]):_Ye:RYe;function PYe({when:e,delay:t,delayChildren:n,staggerChildren:i,staggerDirection:r,repeat:s,repeatType:o,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const uz=(e,t,n,i={},r,s)=>o=>{const l=GQ(i,e)||{},c=l.delay||i.delay||0;let{elapsed:u=0}=i;u=u-Ip(c);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:h=>{t.set(h),l.onUpdate&&l.onUpdate(h)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:s?void 0:r};PYe(l)||(d={...d,...IYe(e,d)}),d.duration&&(d.duration=Ip(d.duration)),d.repeatDelay&&(d.repeatDelay=Ip(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(f=!0)),f&&!s&&t.get()!==void 0){const h=OD(d.keyframes,l);if(h!==void 0)return Is.update(()=>{d.onUpdate(h),d.onComplete()}),new fXe([])}return!s&&HY.supports(d)?new HY(d):new cz(d)};function DYe({protectedKeys:e,needsAnimating:t},n){const i=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,i}function cAe(e,t,{delay:n=0,transitionOverride:i,type:r}={}){var s;let{transition:o=e.getDefaultTransition(),transitionEnd:l,...c}=t;i&&(o=i);const u=[],d=r&&e.animationState&&e.animationState.getState()[r];for(const f in c){const h=e.getValue(f,(s=e.latestValues[f])!==null&&s!==void 0?s:null),m=c[f];if(m===void 0||d&&DYe(d,f))continue;const g={delay:n,...GQ(o||{},f)};let b=!1;if(window.MotionHandoffAnimation){const y=_Ce(e);if(y){const w=window.MotionHandoffAnimation(y,f,Is);w!==null&&(g.startTime=w,b=!0)}}f8(e,f),h.start(uz(f,h,m,e.shouldReduceMotion&&ACe.has(f)?{type:!1}:g,e,b));const v=h.animation;v&&u.push(v)}return l&&Promise.all(u).then(()=>{Is.update(()=>{l&&lXe(e,l)})}),u}function w8(e,t,n={}){var i;const r=wD(e,t,n.type==="exit"?(i=e.presenceContext)===null||i===void 0?void 0:i.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const o=r?()=>Promise.all(cAe(e,r,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=s;return MYe(e,t,d+u,f,h,n)}:()=>Promise.resolve(),{when:c}=s;if(c){const[u,d]=c==="beforeChildren"?[o,l]:[l,o];return u().then(()=>d())}else return Promise.all([o(),l(n.delay)])}function MYe(e,t,n=0,i=0,r=1,s){const o=[],l=(e.variantChildren.size-1)*i,c=r===1?(u=0)=>u*i:(u=0)=>l-u*i;return Array.from(e.variantChildren).sort(LYe).forEach((u,d)=>{u.notify("AnimationStart",t),o.push(w8(u,t,{...s,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(o)}function LYe(e,t){return e.sortNodePosition(t)}function $Ye(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const r=t.map(s=>w8(e,s,n));i=Promise.all(r)}else if(typeof t=="string")i=w8(e,t,n);else{const r=typeof t=="function"?wD(e,t,n.custom):t;i=Promise.all(cAe(e,r,n))}return i.then(()=>{e.notify("AnimationComplete",t)})}const FYe=LQ.length;function uAe(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?uAe(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;nPromise.all(t.map(({animation:n,options:i})=>$Ye(e,n,i)))}function zYe(e){let t=QYe(e),n=qY(),i=!0;const r=c=>(u,d)=>{var f;const h=wD(e,d,c==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:m,transitionEnd:g,...b}=h;u={...u,...b,...g}}return u};function s(c){t=c(e)}function o(c){const{props:u}=e,d=uAe(e.parent)||{},f=[],h=new Set;let m={},g=1/0;for(let v=0;vg&&O,j=!1;const T=Array.isArray(x)?x:[x];let R=T.reduce(r(y),{});k===!1&&(R={});const{prevResolvedValues:A={}}=w,N={...A,...R},P=_=>{E=!0,h.has(_)&&(j=!0,h.delete(_)),w.needsAnimating[_]=!0;const L=e.getValue(_);L&&(L.liveStyle=!1)};for(const _ in N){const L=R[_],F=A[_];if(m.hasOwnProperty(_))continue;let M=!1;d8(L)&&d8(F)?M=!CCe(L,F):M=L!==F,M?L!=null?P(_):h.add(_):L!==void 0&&h.has(_)?P(_):w.protectedKeys[_]=!0}w.prevProp=x,w.prevResolvedValues=R,w.isActive&&(m={...m,...R}),i&&e.blockInitialAnimation&&(E=!1),E&&(!(S&&C)||j)&&f.push(...T.map(_=>({animation:_,options:{type:y}})))}if(h.size){const v={};h.forEach(y=>{const w=e.getBaseTarget(y),x=e.getValue(y);x&&(x.liveStyle=!0),v[y]=w??null}),f.push({animation:v})}let b=!!f.length;return i&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(b=!1),i=!1,b?t(f):Promise.resolve()}function l(c,u){var d;if(n[c].isActive===u)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(h=>{var m;return(m=h.animationState)===null||m===void 0?void 0:m.setActive(c,u)}),n[c].isActive=u;const f=o(c);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:o,setActive:l,setAnimateFunction:s,getState:()=>n,reset:()=>{n=qY(),i=!0}}}function VYe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!CCe(t,e):!1}function zb(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function qY(){return{animate:zb(!0),whileInView:zb(),whileHover:zb(),whileTap:zb(),whileDrag:zb(),whileFocus:zb(),exit:zb()}}class Sb{constructor(t){this.isMounted=!1,this.node=t}update(){}}class HYe extends Sb{constructor(t){super(t),t.animationState||(t.animationState=zYe(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();vD(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let qYe=0;class WYe extends Sb{constructor(){super(...arguments),this.id=qYe++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;const r=this.node.animationState.setActive("exit",!t);n&&!t&&r.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const KYe={animation:{Feature:HYe},exit:{Feature:WYe}},Zd={x:!1,y:!1};function dAe(){return Zd.x||Zd.y}function GYe(e){return e==="x"||e==="y"?Zd[e]?null:(Zd[e]=!0,()=>{Zd[e]=!1}):Zd.x||Zd.y?null:(Zd.x=Zd.y=!0,()=>{Zd.x=Zd.y=!1})}const dz=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function YE(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}function jA(e){return{point:{x:e.pageX,y:e.pageY}}}const XYe=e=>t=>dz(t)&&e(t,jA(t));function zS(e,t,n,i){return YE(e,t,XYe(n),i)}const WY=(e,t)=>Math.abs(e-t);function YYe(e,t){const n=WY(e.x,t.x),i=WY(e.y,t.y);return Math.sqrt(n**2+i**2)}class fAe{constructor(t,n,{transformPagePoint:i,contextWindow:r,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=m3(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,m=YYe(f.offset,{x:0,y:0})>=3;if(!h&&!m)return;const{point:g}=f,{timestamp:b}=Go;this.history.push({...g,timestamp:b});const{onStart:v,onMove:y}=this.handlers;h||(v&&v(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=p3(h,this.transformPagePoint),Is.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{this.end();const{onEnd:m,onSessionEnd:g,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=m3(f.type==="pointercancel"?this.lastMoveEventInfo:p3(h,this.transformPagePoint),this.history);this.startEvent&&m&&m(f,v),g&&g(f,v)},!dz(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=i,this.contextWindow=r||window;const o=jA(t),l=p3(o,this.transformPagePoint),{point:c}=l,{timestamp:u}=Go;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,m3(l,this.history)),this.removeListeners=_A(zS(this.contextWindow,"pointermove",this.handlePointerMove),zS(this.contextWindow,"pointerup",this.handlePointerUp),zS(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Kg(this.updatePoint)}}function p3(e,t){return t?{point:t(e.point)}:e}function KY(e,t){return{x:e.x-t.x,y:e.y-t.y}}function m3({point:e},t){return{point:e,delta:KY(e,hAe(t)),offset:KY(e,ZYe(t)),velocity:JYe(t,.1)}}function ZYe(e){return e[0]}function hAe(e){return e[e.length-1]}function JYe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const r=hAe(e);for(;n>=0&&(i=e[n],!(r.timestamp-i.timestamp>Ip(t)));)n--;if(!i)return{x:0,y:0};const s=Pp(r.timestamp-i.timestamp);if(s===0)return{x:0,y:0};const o={x:(r.x-i.x)/s,y:(r.y-i.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const pAe=1e-4,eZe=1-pAe,tZe=1+pAe,mAe=.01,nZe=0-mAe,iZe=0+mAe;function Pu(e){return e.max-e.min}function rZe(e,t,n){return Math.abs(e-t)<=n}function GY(e,t,n,i=.5){e.origin=i,e.originPoint=ta(t.min,t.max,e.origin),e.scale=Pu(n)/Pu(t),e.translate=ta(n.min,n.max,e.origin)-e.originPoint,(e.scale>=eZe&&e.scale<=tZe||isNaN(e.scale))&&(e.scale=1),(e.translate>=nZe&&e.translate<=iZe||isNaN(e.translate))&&(e.translate=0)}function VS(e,t,n,i){GY(e.x,t.x,n.x,i?i.originX:void 0),GY(e.y,t.y,n.y,i?i.originY:void 0)}function XY(e,t,n){e.min=n.min+t.min,e.max=e.min+Pu(t)}function sZe(e,t,n){XY(e.x,t.x,n.x),XY(e.y,t.y,n.y)}function YY(e,t,n){e.min=t.min-n.min,e.max=e.min+Pu(t)}function HS(e,t,n){YY(e.x,t.x,n.x),YY(e.y,t.y,n.y)}function aZe(e,{min:t,max:n},i){return t!==void 0&&en&&(e=i?ta(n,e,i.max):Math.min(e,n)),e}function ZY(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function oZe(e,{top:t,left:n,bottom:i,right:r}){return{x:ZY(e.x,n,r),y:ZY(e.y,t,i)}}function JY(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.mini?n=zw(t.min,t.max-i,e.min):i>r&&(n=zw(e.min,e.max-r,t.min)),Gp(0,1,n)}function uZe(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const O8=.35;function dZe(e=O8){return e===!1?e=0:e===!0&&(e=O8),{x:eZ(e,"left","right"),y:eZ(e,"top","bottom")}}function eZ(e,t,n){return{min:tZ(e,t),max:tZ(e,n)}}function tZ(e,t){return typeof e=="number"?e:e[t]||0}const nZ=()=>({translate:0,scale:1,origin:0,originPoint:0}),jx=()=>({x:nZ(),y:nZ()}),iZ=()=>({min:0,max:0}),xa=()=>({x:iZ(),y:iZ()});function Zu(e){return[e("x"),e("y")]}function gAe({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function fZe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function hZe(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function g3(e){return e===void 0||e===1}function k8({scale:e,scaleX:t,scaleY:n}){return!g3(e)||!g3(t)||!g3(n)}function ay(e){return k8(e)||bAe(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function bAe(e){return rZ(e.x)||rZ(e.y)}function rZ(e){return e&&e!=="0%"}function HR(e,t,n){const i=e-n,r=t*i;return n+r}function sZ(e,t,n,i,r){return r!==void 0&&(e=HR(e,r,i)),HR(e,n,i)+t}function S8(e,t=0,n=1,i,r){e.min=sZ(e.min,t,n,i,r),e.max=sZ(e.max,t,n,i,r)}function yAe(e,{x:t,y:n}){S8(e.x,t.translate,t.scale,t.originPoint),S8(e.y,n.translate,n.scale,n.originPoint)}const aZ=.999999999999,oZ=1.0000000000001;function pZe(e,t,n,i=!1){const r=n.length;if(!r)return;t.x=t.y=1;let s,o;for(let l=0;laZ&&(t.x=1),t.yaZ&&(t.y=1)}function Nx(e,t){e.min=e.min+t,e.max=e.max+t}function lZ(e,t,n,i,r=.5){const s=ta(e.min,e.max,r);S8(e,t,n,s,i)}function Rx(e,t){lZ(e.x,t.x,t.scaleX,t.scale,t.originX),lZ(e.y,t.y,t.scaleY,t.scale,t.originY)}function vAe(e,t){return gAe(hZe(e.getBoundingClientRect(),t))}function mZe(e,t,n){const i=vAe(e,n),{scroll:r}=t;return r&&(Nx(i.x,r.offset.x),Nx(i.y,r.offset.y)),i}const xAe=({current:e})=>e?e.ownerDocument.defaultView:null,gZe=new WeakMap;class bZe{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=xa(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(jA(d).point)},s=(d,f)=>{const{drag:h,dragPropagation:m,onDragStart:g}=this.getProps();if(h&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=GYe(h),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Zu(v=>{let y=this.getAxisMotionValue(v).get()||0;if(hh.test(y)){const{projection:w}=this.visualElement;if(w&&w.layout){const x=w.layout.layoutBox[v];x&&(y=Pu(x)*(parseFloat(y)/100))}}this.originPoint[v]=y}),g&&Is.postRender(()=>g(d,f)),f8(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},o=(d,f)=>{const{dragPropagation:h,dragDirectionLock:m,onDirectionLock:g,onDrag:b}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:v}=f;if(m&&this.currentDirection===null){this.currentDirection=yZe(v),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,v),this.updateAxis("y",f.point,v),this.visualElement.render(),b&&b(d,f)},l=(d,f)=>this.stop(d,f),c=()=>Zu(d=>{var f;return this.getAnimationState(d)==="paused"&&((f=this.getAxisMotionValue(d).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new fAe(t,{onSessionStart:r,onStart:s,onMove:o,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:xAe(this.visualElement)})}stop(t,n){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:r}=n;this.startAnimation(r);const{onDragEnd:s}=this.getProps();s&&Is.postRender(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,i){const{drag:r}=this.getProps();if(!i||!W2(t,r,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(o=aZe(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:i}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,s=this.constraints;n&&Tx(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&r?this.constraints=oZe(r.layoutBox,n):this.constraints=!1,this.elastic=dZe(i),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Zu(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=uZe(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Tx(t))return!1;const i=t.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const s=mZe(i,r.root,this.visualElement.getTransformPagePoint());let o=lZe(r.layout.layoutBox,s);if(n){const l=n(fZe(o));this.hasMutatedConstraints=!!l,l&&(o=gAe(l))}return o}startAnimation(t){const{drag:n,dragMomentum:i,dragElastic:r,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Zu(d=>{if(!W2(d,n,this.currentDirection))return;let f=c&&c[d]||{};o&&(f={min:0,max:0});const h=r?200:1e6,m=r?40:1e7,g={type:"inertia",velocity:i?t[d]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(d,g)});return Promise.all(u).then(l)}startAxisValueAnimation(t,n){const i=this.getAxisMotionValue(t);return f8(this.visualElement,t),i.start(uz(t,i,0,n,this.visualElement,!1))}stopAnimation(){Zu(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Zu(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps(),r=i[n];return r||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){Zu(n=>{const{drag:i}=this.getProps();if(!W2(n,i,this.currentDirection))return;const{projection:r}=this.visualElement,s=this.getAxisMotionValue(n);if(r&&r.layout){const{min:o,max:l}=r.layout.layoutBox[n];s.set(t[n]-ta(o,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!Tx(n)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Zu(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();r[o]=cZe({min:c,max:c},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),Zu(o=>{if(!W2(o,t,null))return;const l=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];l.set(ta(c,u,r[o]))})}addListeners(){if(!this.visualElement.current)return;gZe.set(this.visualElement,this);const t=this.visualElement.current,n=zS(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),i=()=>{const{dragConstraints:c}=this.getProps();Tx(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,s=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),Is.read(i);const o=YE(window,"resize",()=>this.scalePositionWithinConstraints()),l=r.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Zu(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=c[d].translate,f.set(f.get()+c[d].translate))}),this.visualElement.render())});return()=>{o(),n(),s(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:s=!1,dragElastic:o=O8,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:r,dragConstraints:s,dragElastic:o,dragMomentum:l}}}function W2(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function yZe(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class vZe extends Sb{constructor(t){super(t),this.removeGroupControls=Au,this.removeListeners=Au,this.controls=new bZe(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Au}unmount(){this.removeGroupControls(),this.removeListeners()}}const cZ=e=>(t,n)=>{e&&Is.postRender(()=>e(t,n))};class xZe extends Sb{constructor(){super(...arguments),this.removePointerDownListener=Au}onPointerDown(t){this.session=new fAe(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:xAe(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:cZ(t),onStart:cZ(n),onMove:i,onEnd:(s,o)=>{delete this.session,r&&Is.postRender(()=>r(s,o))}}}mount(){this.removePointerDownListener=zS(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const rN={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function uZ(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const ek={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Kn.test(e))e=parseFloat(e);else return e;const n=uZ(e,t.target.x),i=uZ(e,t.target.y);return`${n}% ${i}%`}},wZe={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,r=Gg.parse(e);if(r.length>5)return i;const s=Gg.createTransformer(e),o=typeof r[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;r[0+o]/=l,r[1+o]/=c;const u=ta(l,c,.5);return typeof r[2+o]=="number"&&(r[2+o]/=u),typeof r[3+o]=="number"&&(r[3+o]/=u),s(r)}};class OZe extends p.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i,layoutId:r}=this.props,{projection:s}=t;KGe(kZe),s&&(n.group&&n.group.add(s),i&&i.register&&r&&i.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),rN.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:i,drag:r,isPresent:s}=this.props,o=i.projection;return o&&(o.isPresent=s,r||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||Is.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),FQ.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:r}=t;r&&(r.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(r),i&&i.deregister&&i.deregister(r))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function wAe(e){const[t,n]=rCe(),i=p.useContext(PQ);return a.jsx(OZe,{...e,layoutGroup:i,switchLayoutGroup:p.useContext(hCe),isPresent:t,safeToRemove:n})}const kZe={borderRadius:{...ek,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ek,borderTopRightRadius:ek,borderBottomLeftRadius:ek,borderBottomRightRadius:ek,boxShadow:wZe};function SZe(e,t,n){const i=_l(e)?e:GE(e);return i.start(uz("",i,t,n)),i.animation}function EZe(e){return e instanceof SVGElement&&e.tagName!=="svg"}const CZe=(e,t)=>e.depth-t.depth;class AZe{constructor(){this.children=[],this.isDirty=!1}add(t){XQ(this.children,t),this.isDirty=!0}remove(t){YQ(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(CZe),this.isDirty=!1,this.children.forEach(t)}}function TZe(e,t){const n=ph.now(),i=({timestamp:r})=>{const s=r-n;s>=t&&(Kg(i),e(s-t))};return Is.read(i,!0),()=>Kg(i)}const OAe=["TopLeft","TopRight","BottomLeft","BottomRight"],_Ze=OAe.length,dZ=e=>typeof e=="string"?parseFloat(e):e,fZ=e=>typeof e=="number"||Kn.test(e);function jZe(e,t,n,i,r,s){r?(e.opacity=ta(0,n.opacity!==void 0?n.opacity:1,NZe(i)),e.opacityExit=ta(t.opacity!==void 0?t.opacity:1,0,RZe(i))):s&&(e.opacity=ta(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,i));for(let o=0;o<_Ze;o++){const l=`border${OAe[o]}Radius`;let c=hZ(t,l),u=hZ(n,l);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||fZ(c)===fZ(u)?(e[l]=Math.max(ta(dZ(c),dZ(u),i),0),(hh.test(u)||hh.test(c))&&(e[l]+="%")):e[l]=u}(t.rotate||n.rotate)&&(e.rotate=ta(t.rotate||0,n.rotate||0,i))}function hZ(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const NZe=kAe(0,.5,FCe),RZe=kAe(.5,.95,Au);function kAe(e,t,n){return i=>it?1:n(zw(e,t,i))}function pZ(e,t){e.min=t.min,e.max=t.max}function Yu(e,t){pZ(e.x,t.x),pZ(e.y,t.y)}function mZ(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function gZ(e,t,n,i,r){return e-=t,e=HR(e,1/n,i),r!==void 0&&(e=HR(e,1/r,i)),e}function IZe(e,t=0,n=1,i=.5,r,s=e,o=e){if(hh.test(t)&&(t=parseFloat(t),t=ta(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=ta(s.min,s.max,i);e===s&&(l-=t),e.min=gZ(e.min,t,n,l,r),e.max=gZ(e.max,t,n,l,r)}function bZ(e,t,[n,i,r],s,o){IZe(e,t[n],t[i],t[r],t.scale,s,o)}const PZe=["x","scaleX","originX"],DZe=["y","scaleY","originY"];function yZ(e,t,n,i){bZ(e.x,t,PZe,n?n.x:void 0,i?i.x:void 0),bZ(e.y,t,DZe,n?n.y:void 0,i?i.y:void 0)}function vZ(e){return e.translate===0&&e.scale===1}function SAe(e){return vZ(e.x)&&vZ(e.y)}function xZ(e,t){return e.min===t.min&&e.max===t.max}function MZe(e,t){return xZ(e.x,t.x)&&xZ(e.y,t.y)}function wZ(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function EAe(e,t){return wZ(e.x,t.x)&&wZ(e.y,t.y)}function OZ(e){return Pu(e.x)/Pu(e.y)}function kZ(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class LZe{constructor(){this.members=[]}add(t){XQ(this.members,t),t.scheduleRender()}remove(t){if(YQ(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(r=>t===r);if(n===0)return!1;let i;for(let r=n;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1){i=s;break}}return i?(this.promote(i),!0):!1}promote(t,n){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,n&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:r}=t.options;r===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:i}=t;n.onExitComplete&&n.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function $Ze(e,t,n){let i="";const r=e.x.translate/t.x,s=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((r||s||o)&&(i=`translate3d(${r}px, ${s}px, ${o}px) `),(t.x!==1||t.y!==1)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:h,skewX:m,skewY:g}=n;u&&(i=`perspective(${u}px) ${i}`),d&&(i+=`rotate(${d}deg) `),f&&(i+=`rotateX(${f}deg) `),h&&(i+=`rotateY(${h}deg) `),m&&(i+=`skewX(${m}deg) `),g&&(i+=`skewY(${g}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(i+=`scale(${l}, ${c})`),i||"none"}const oy={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},tS=typeof window<"u"&&window.MotionDebug!==void 0,b3=["","X","Y","Z"],FZe={visibility:"hidden"},SZ=1e3;let BZe=0;function y3(e,t,n,i){const{latestValues:r}=t;r[e]&&(n[e]=r[e],t.setStaticValue(e,0),i&&(i[e]=0))}function CAe(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=_Ce(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:r,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Is,!(r||s))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&CAe(i)}function AAe({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(o={},l=t==null?void 0:t()){this.id=BZe++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,tS&&(oy.totalNodes=oy.resolvedTargetDeltas=oy.recalculatedProjection=0),this.nodes.forEach(zZe),this.nodes.forEach(KZe),this.nodes.forEach(GZe),this.nodes.forEach(VZe),tS&&window.MotionDebug.record(oy)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;cthis.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=TZe(h,250),rN.hasAnimatedSinceResize&&(rN.hasAnimatedSinceResize=!1,this.nodes.forEach(CZ))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&d&&(c||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeTargetChanged:m,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||d.getDefaultTransition()||eJe,{onLayoutAnimationStart:v,onLayoutAnimationComplete:y}=d.getProps(),w=!this.targetLayout||!EAe(this.targetLayout,g)||m,x=!h&&m;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||h&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,x);const O={...GQ(b,"layout"),onPlay:v,onComplete:y};(d.shouldReduceMotion||this.options.layoutRoot)&&(O.delay=0,O.type=!1),this.startAnimation(O)}else h||CZ(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Kg(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(XZe),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&CAe(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c{const k=O/1e3;AZ(f.x,o.x,k),AZ(f.y,o.y,k),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(HS(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),ZZe(this.relativeTarget,this.relativeTargetOrigin,h,k),x&&MZe(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=xa()),Yu(x,this.relativeTarget)),b&&(this.animationValues=d,jZe(d,u,this.latestValues,k,w,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=k},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Kg(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Is.update(()=>{rN.hasAnimatedSinceResize=!0,this.currentAnimation=SZe(0,SZ,{...o,onUpdate:l=>{this.mixTargetDelta(l),o.onUpdate&&o.onUpdate(l)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(SZ),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=o;if(!(!l||!c||!u)){if(this!==o&&this.layout&&u&&TAe(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||xa();const f=Pu(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+f;const h=Pu(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+h}Yu(l,c),Rx(l,d),VS(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new LZe),this.sharedNodes.get(o).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:l}=this.options;return l?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:l}=this.options;return l?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&y3("z",o,u,this.animationValues);for(let d=0;d{var l;return(l=o.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach(EZ),this.root.sharedNodes.clear()}}}function UZe(e){e.updateLayout()}function QZe(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:r}=e.layout,{animationType:s}=e.options,o=n.source!==e.layout.source;s==="size"?Zu(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=Pu(h);h.min=i[f].min,h.max=h.min+m}):TAe(s,n.layoutBox,i)&&Zu(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=Pu(i[f]);h.max=h.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+m)});const l=jx();VS(l,i,n.layoutBox);const c=jx();o?VS(c,e.applyTransform(r,!0),n.measuredBox):VS(c,i,n.layoutBox);const u=!SAe(l);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:m}=f;if(h&&m){const g=xa();HS(g,n.layoutBox,h.layoutBox);const b=xa();HS(b,i,m.layoutBox),EAe(g,b)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=b,e.relativeTargetOrigin=g,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:i,snapshot:n,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:i}=e.options;i&&i()}e.options.transition=void 0}function zZe(e){tS&&oy.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function VZe(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function HZe(e){e.clearSnapshot()}function EZ(e){e.clearMeasurements()}function qZe(e){e.isLayoutDirty=!1}function WZe(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function CZ(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function KZe(e){e.resolveTargetDelta()}function GZe(e){e.calcProjection()}function XZe(e){e.resetSkewAndRotation()}function YZe(e){e.removeLeadSnapshot()}function AZ(e,t,n){e.translate=ta(t.translate,0,n),e.scale=ta(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function TZ(e,t,n,i){e.min=ta(t.min,n.min,i),e.max=ta(t.max,n.max,i)}function ZZe(e,t,n,i){TZ(e.x,t.x,n.x,i),TZ(e.y,t.y,n.y,i)}function JZe(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const eJe={duration:.45,ease:[.4,0,.1,1]},_Z=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),jZ=_Z("applewebkit/")&&!_Z("chrome/")?Math.round:Au;function NZ(e){e.min=jZ(e.min),e.max=jZ(e.max)}function tJe(e){NZ(e.x),NZ(e.y)}function TAe(e,t,n){return e==="position"||e==="preserve-aspect"&&!rZe(OZ(t),OZ(n),.2)}function nJe(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const iJe=AAe({attachResizeListener:(e,t)=>YE(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),v3={current:void 0},_Ae=AAe({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!v3.current){const e=new iJe({});e.mount(window),e.setOptions({layoutScroll:!0}),v3.current=e}return v3.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),rJe={pan:{Feature:xZe},drag:{Feature:vZe,ProjectionNode:_Ae,MeasureLayout:wAe}};function sJe(e,t,n){var i;if(e instanceof Element)return[e];if(typeof e=="string"){let r=document;const s=(i=void 0)!==null&&i!==void 0?i:r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}function jAe(e,t){const n=sJe(e),i=new AbortController,r={passive:!0,...t,signal:i.signal};return[n,r,()=>i.abort()]}function RZ(e){return t=>{t.pointerType==="touch"||dAe()||e(t)}}function aJe(e,t,n={}){const[i,r,s]=jAe(e,n),o=RZ(l=>{const{target:c}=l,u=t(l);if(typeof u!="function"||!c)return;const d=RZ(f=>{u(f),c.removeEventListener("pointerleave",d)});c.addEventListener("pointerleave",d,r)});return i.forEach(l=>{l.addEventListener("pointerenter",o,r)}),s}function IZ(e,t,n){const{props:i}=e;e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,s=i[r];s&&Is.postRender(()=>s(t,jA(t)))}class oJe extends Sb{mount(){const{current:t}=this.node;t&&(this.unmount=aJe(t,n=>(IZ(this.node,n,"Start"),i=>IZ(this.node,i,"End"))))}unmount(){}}class lJe extends Sb{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=_A(YE(this.node.current,"focus",()=>this.onFocus()),YE(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const NAe=(e,t)=>t?e===t?!0:NAe(e,t.parentElement):!1,cJe=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function uJe(e){return cJe.has(e.tagName)||e.tabIndex!==-1}const nS=new WeakSet;function PZ(e){return t=>{t.key==="Enter"&&e(t)}}function x3(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const dJe=(e,t)=>{const n=e.currentTarget;if(!n)return;const i=PZ(()=>{if(nS.has(n))return;x3(n,"down");const r=PZ(()=>{x3(n,"up")}),s=()=>x3(n,"cancel");n.addEventListener("keyup",r,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",i,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),t)};function DZ(e){return dz(e)&&!dAe()}function fJe(e,t,n={}){const[i,r,s]=jAe(e,n),o=l=>{const c=l.currentTarget;if(!DZ(l)||nS.has(c))return;nS.add(c);const u=t(l),d=(m,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!DZ(m)||!nS.has(c))&&(nS.delete(c),typeof u=="function"&&u(m,{success:g}))},f=m=>{d(m,n.useGlobalTarget||NAe(c,m.target))},h=m=>{d(m,!1)};window.addEventListener("pointerup",f,r),window.addEventListener("pointercancel",h,r)};return i.forEach(l=>{!uJe(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0),(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,r),l.addEventListener("focus",u=>dJe(u,r),r)}),s}function MZ(e,t,n){const{props:i}=e;e.animationState&&i.whileTap&&e.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),s=i[r];s&&Is.postRender(()=>s(t,jA(t)))}class hJe extends Sb{mount(){const{current:t}=this.node;t&&(this.unmount=fJe(t,n=>(MZ(this.node,n,"Start"),(i,{success:r})=>MZ(this.node,i,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const E8=new WeakMap,w3=new WeakMap,pJe=e=>{const t=E8.get(e.target);t&&t(e)},mJe=e=>{e.forEach(pJe)};function gJe({root:e,...t}){const n=e||document;w3.has(n)||w3.set(n,{});const i=w3.get(n),r=JSON.stringify(t);return i[r]||(i[r]=new IntersectionObserver(mJe,{root:e,...t})),i[r]}function bJe(e,t,n){const i=gJe(t);return E8.set(e,n),i.observe(e),()=>{E8.delete(e),i.unobserve(e)}}const yJe={some:0,all:1};class vJe extends Sb{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:i,amount:r="some",once:s}=t,o={root:n?n.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:yJe[r]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,s&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),h=u?d:f;h&&h(c)};return bJe(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(xJe(t,n))&&this.startObserver()}unmount(){}}function xJe({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const wJe={inView:{Feature:vJe},tap:{Feature:hJe},focus:{Feature:lJe},hover:{Feature:oJe}},OJe={layout:{ProjectionNode:_Ae,MeasureLayout:wAe}},qR={current:null},fz={current:!1};function RAe(){if(fz.current=!0,!!DQ)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>qR.current=e.matches;e.addListener(t),t()}else qR.current=!1}const kJe=[...JCe,Cl,Gg],SJe=e=>kJe.find(ZCe(e)),LZ=new WeakMap;function EJe(e,t,n){for(const i in t){const r=t[i],s=n[i];if(_l(r))e.addValue(i,r);else if(_l(s))e.addValue(i,GE(r,{owner:e}));else if(s!==r)if(e.hasValue(i)){const o=e.getValue(i);o.liveStyle===!0?o.jump(r):o.hasAnimated||o.set(r)}else{const o=e.getStaticValue(i);e.addValue(i,GE(o!==void 0?o:r,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const $Z=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class CJe{scrapeMotionValuesFromProps(t,n,i){return{}}constructor({parent:t,props:n,presenceContext:i,reducedMotionConfig:r,blockInitialAnimation:s,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=oz,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const m=ph.now();this.renderScheduledAtthis.bindToMotionValue(i,n)),fz.current||RAe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:qR.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){LZ.delete(this.current),this.projection&&this.projection.unmount(),Kg(this.notifyUpdate),Kg(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const i=M0.has(t),r=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&Is.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{r(),s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Qw){const n=Qw[t];if(!n)continue;const{isEnabled:i,Feature:r}=n;if(!this.features[t]&&r&&i(this.props)&&(this.features[t]=new r(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):xa()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let i=0;i<$Z.length;i++){const r=$Z[i];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const s="on"+r,o=t[s];o&&(this.propEventSubscriptions[r]=this.on(r,o))}this.prevMotionValues=EJe(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const i=this.values.get(t);n!==i&&(i&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return i===void 0&&n!==void 0&&(i=GE(n===null?void 0:n,{owner:this}),this.addValue(t,i)),i}readValue(t,n){var i;let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(i=this.getBaseTargetFromProps(this.props,t))!==null&&i!==void 0?i:this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(XCe(r)||UCe(r))?r=parseFloat(r):!SJe(r)&&Gg.test(n)&&(r=WCe(t,n)),this.setBaseTarget(t,_l(r)?r.get():r)),_l(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:i}=this.props;let r;if(typeof i=="string"||typeof i=="object"){const o=UQ(this.props,i,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(r=o[t])}if(i&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!_l(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new ZQ),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class IAe extends CJe{constructor(){super(...arguments),this.KeyframeResolver=eAe}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:i}){delete n[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;_l(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function AJe(e){return window.getComputedStyle(e)}class TJe extends IAe{constructor(){super(...arguments),this.type="html",this.renderInstance=xCe}readValueFromInstance(t,n){if(M0.has(n)){const i=az(n);return i&&i.default||0}else{const i=AJe(t),r=(bCe(n)?i.getPropertyValue(n):i[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(t,{transformPagePoint:n}){return vAe(t,n)}build(t,n,i){VQ(t,n,i.transformTemplate)}scrapeMotionValuesFromProps(t,n,i){return KQ(t,n,i)}}class _Je extends IAe{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=xa}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(M0.has(n)){const i=az(n);return i&&i.default||0}return n=wCe.has(n)?n:$Q(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,i){return SCe(t,n,i)}build(t,n,i){HQ(t,n,this.isSVGTag,i.transformTemplate)}renderInstance(t,n,i,r){OCe(t,n,i,r)}mount(t){this.isSVGTag=WQ(t.tagName),super.mount(t)}}const jJe=(e,t)=>BQ(e)?new _Je(t):new TJe(t,{allowProjection:e!==p.Fragment}),NJe=iXe({...KYe,...wJe,...rJe,...OJe},jJe),Ar=yGe(NJe);function kD(){!fz.current&&RAe();const[e]=p.useState(qR.current);return e}function oo(){return oo=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||/ServerSideRendering/.test(navigator&&navigator.userAgent)?p.useEffect:p.useLayoutEffect;function tx(e,t,n){var i=p.useRef(t);i.current=t,p.useEffect(function(){function r(s){i.current(s)}return e&&window.addEventListener(e,r,n),function(){e&&window.removeEventListener(e,r)}},[e])}var RJe=["container"];function IJe(e){var t=e.container,n=t===void 0?document.body:t,i=SD(e,RJe);return vi.createPortal(ji.createElement("div",oo({},i)),n)}function PJe(e){return ji.createElement("svg",oo({width:"44",height:"44",viewBox:"0 0 768 768"},e),ji.createElement("path",{d:"M607.5 205.5l-178.5 178.5 178.5 178.5-45 45-178.5-178.5-178.5 178.5-45-45 178.5-178.5-178.5-178.5 45-45 178.5 178.5 178.5-178.5z"}))}function DJe(e){return ji.createElement("svg",oo({width:"44",height:"44",viewBox:"0 0 768 768"},e),ji.createElement("path",{d:"M640.5 352.5v63h-390l178.5 180-45 45-256.5-256.5 256.5-256.5 45 45-178.5 180h390z"}))}function MJe(e){return ji.createElement("svg",oo({width:"44",height:"44",viewBox:"0 0 768 768"},e),ji.createElement("path",{d:"M384 127.5l256.5 256.5-256.5 256.5-45-45 178.5-180h-390v-63h390l-178.5-180z"}))}function LJe(){return p.useEffect(function(){var e=document.body.style,t=e.overflow;return e.overflow="hidden",function(){e.overflow=t}},[]),null}function BZ(e){var t=e.touches[0],n=t.clientX,i=t.clientY;if(e.touches.length>=2){var r=e.touches[1],s=r.clientX,o=r.clientY;return[(n+s)/2,(i+o)/2,Math.sqrt(Math.pow(s-n,2)+Math.pow(o-i,2))]}return[n,i,0]}var Gm=function(e,t,n,i){var r,s=n*t,o=(s-i)/2,l=e;return s<=i?(r=1,l=0):e>0&&o-e<=0?(r=2,l=o):e<0&&o+e<=0&&(r=3,l=-o),[r,l]};function O3(e,t,n,i,r,s,o,l,c,u){o===void 0&&(o=innerWidth/2),l===void 0&&(l=innerHeight/2),c===void 0&&(c=0),u===void 0&&(u=0);var d=Gm(e,s,n,innerWidth)[0],f=Gm(t,s,i,innerHeight),h=innerWidth/2,m=innerHeight/2;return{x:o-s/r*(o-(h+e))-h+(i/n>=3&&n*s===innerWidth?0:d?c/2:c),y:l-s/r*(l-(m+t))-m+(f[0]?u/2:u),lastCX:o,lastCY:l}}function T8(e,t,n){var i=e%180!=0;return i?[n,t,i]:[t,n,i]}function k3(e,t,n){var i=T8(n,innerWidth,innerHeight),r=i[0],s=i[1],o=0,l=r,c=s,u=e/t*s,d=t/e*r;return e=s?l=u:e>=r&&tr/s?c=d:t/e>=3&&!i[2]?o=((c=d)-s)/2:l=u,{width:l,height:c,x:0,y:o,pause:!0}}function G2(e,t){var n=t.leading,i=n!==void 0&&n,r=t.maxWait,s=t.wait,o=s===void 0?r||0:s,l=p.useRef(e);l.current=e;var c=p.useRef(0),u=p.useRef(),d=function(){return u.current&&clearTimeout(u.current)},f=p.useCallback(function(){var h=[].slice.call(arguments),m=Date.now();function g(){c.current=m,d(),l.current.apply(null,h)}var b=c.current,v=m-b;if(b===0&&(i&&g(),c.current=m),r!==void 0){if(v>r)return void g()}else v=1&&s&&s())};d()}function d(){c=requestAnimationFrame(u)}}var FJe={T:0,L:0,W:0,H:0,FIT:void 0},DAe=function(){var e=p.useRef(!1);return p.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e},BJe=["className"];function UJe(e){var t=e.className,n=t===void 0?"":t,i=SD(e,BJe);return ji.createElement("div",oo({className:"PhotoView__Spinner "+n},i),ji.createElement("svg",{viewBox:"0 0 32 32",width:"36",height:"36",fill:"white"},ji.createElement("path",{opacity:".25",d:"M16 0 A16 16 0 0 0 16 32 A16 16 0 0 0 16 0 M16 4 A12 12 0 0 1 16 28 A12 12 0 0 1 16 4"}),ji.createElement("path",{d:"M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"})))}var QJe=["src","loaded","broken","className","onPhotoLoad","loadingElement","brokenElement"];function zJe(e){var t=e.src,n=e.loaded,i=e.broken,r=e.className,s=e.onPhotoLoad,o=e.loadingElement,l=e.brokenElement,c=SD(e,QJe),u=DAe();return t&&!i?ji.createElement(ji.Fragment,null,ji.createElement("img",oo({className:"PhotoView__Photo"+(r?" "+r:""),src:t,onLoad:function(d){var f=d.target;u.current&&s({loaded:!0,naturalWidth:f.naturalWidth,naturalHeight:f.naturalHeight})},onError:function(){u.current&&s({broken:!0})},draggable:!1,alt:""},c)),!n&&(o?ji.createElement("span",{className:"PhotoView__icon"},o):ji.createElement(UJe,{className:"PhotoView__icon"}))):l?ji.createElement("span",{className:"PhotoView__icon"},typeof l=="function"?l({src:t}):l):null}var VJe={naturalWidth:void 0,naturalHeight:void 0,width:void 0,height:void 0,loaded:void 0,broken:!1,x:0,y:0,touched:!1,maskTouched:!1,rotate:0,scale:1,CX:0,CY:0,lastX:0,lastY:0,lastCX:0,lastCY:0,lastScale:1,touchTime:0,touchLength:0,pause:!0,stopRaf:!0,reach:void 0};function HJe(e){var t=e.item,n=t.src,i=t.render,r=t.width,s=r===void 0?0:r,o=t.height,l=o===void 0?0:o,c=t.originRef,u=e.visible,d=e.speed,f=e.easing,h=e.wrapClassName,m=e.className,g=e.style,b=e.loadingElement,v=e.brokenElement,y=e.onPhotoTap,w=e.onMaskTap,x=e.onReachMove,O=e.onReachUp,k=e.onPhotoResize,S=e.isActive,C=e.expose,E=WR(VJe),j=E[0],T=E[1],R=p.useRef(0),A=DAe(),N=j.naturalWidth,P=N===void 0?s:N,I=j.naturalHeight,D=I===void 0?l:I,_=j.width,L=_===void 0?s:_,F=j.height,M=F===void 0?l:F,z=j.loaded,q=z===void 0?!n:z,U=j.broken,J=j.x,V=j.y,Z=j.touched,ne=j.stopRaf,W=j.maskTouched,G=j.rotate,H=j.scale,se=j.CX,Y=j.CY,X=j.lastX,ie=j.lastY,ee=j.lastCX,be=j.lastCY,ue=j.lastScale,pe=j.touchTime,ke=j.touchLength,je=j.pause,Pe=j.reach,Ee=Hy({onScale:function(Ne){return Qe(K2(Ne))},onRotate:function(Ne){G!==Ne&&(C({rotate:Ne}),T(oo({rotate:Ne},k3(P,D,Ne))))}});function Qe(Ne,wt,jt){H!==Ne&&(C({scale:Ne}),T(oo({scale:Ne},O3(J,V,L,M,H,Ne,wt,jt),Ne<=1&&{x:0,y:0})))}var _e=G2(function(Ne,wt,jt){if(jt===void 0&&(jt=0),(Z||W)&&S){var Yt=T8(G,L,M),wn=Yt[0],We=Yt[1];if(jt===0&&R.current===0){var kt=Math.abs(Ne-se)<=20,He=Math.abs(wt-Y)<=20;if(kt&&He)return void T({lastCX:Ne,lastCY:wt});R.current=kt?wt>Y?3:2:1}var nt,et=Ne-ee,ft=wt-be;if(jt===0){var St=Gm(et+X,H,wn,innerWidth)[0],Ct=Gm(ft+ie,H,We,innerHeight);nt=function(Gt,Ge,xt,yt){return Ge&&Gt===1||yt==="x"?"x":xt&&Gt>1||yt==="y"?"y":void 0}(R.current,St,Ct[0],Pe),nt!==void 0&&x(nt,Ne,wt,H)}if(nt==="x"||W)return void T({reach:"x"});var It=K2(H+(jt-ke)/100/2*H,P/L,.2);C({scale:It}),T(oo({touchLength:jt,reach:nt,scale:It},O3(J,V,L,M,H,It,Ne,wt,et,ft)))}},{maxWait:8});function ae(Ne){return!ne&&!Z&&(A.current&&T(oo({},Ne,{pause:u})),A.current)}var le,ge,Oe,Se,qe,Xe,ye,we,Ae=(qe=function(Ne){return ae({x:Ne})},Xe=function(Ne){return ae({y:Ne})},ye=function(Ne){return A.current&&(C({scale:Ne}),T({scale:Ne})),!Z&&A.current},we=Hy({X:function(Ne){return qe(Ne)},Y:function(Ne){return Xe(Ne)},S:function(Ne){return ye(Ne)}}),function(Ne,wt,jt,Yt,wn,We,kt,He,nt,et,ft){var St=T8(et,wn,We),Ct=St[0],It=St[1],Gt=Gm(Ne,He,Ct,innerWidth),Ge=Gt[0],xt=Gt[1],yt=Gm(wt,He,It,innerHeight),nn=yt[0],Qt=yt[1],cn=Date.now()-ft;if(cn>=200||He!==kt||Math.abs(nt-kt)>1){var Me=O3(Ne,wt,wn,We,kt,He),on=Me.x,kn=Me.y,Sn=Ge?xt:on!==Ne?on:null,zi=nn?Qt:kn!==wt?kn:null;return Sn!==null&&gy(Ne,Sn,we.X),zi!==null&&gy(wt,zi,we.Y),void(He!==kt&&gy(kt,He,we.S))}var un=(Ne-jt)/cn,or=(wt-Yt)/cn,Pn=Math.sqrt(Math.pow(un,2)+Math.pow(or,2)),ei=!1,Fn=!1;(function(Si,Qn){var Rn,ui=Si,rt=0,zt=0,Ue=function(_n){Rn||(Rn=_n);var Nr=_n-Rn,qs=Math.sign(Si),Ws=-.001*qs,Lr=Math.sign(-ui)*Math.pow(ui,2)*2e-4,ti=ui*Nr+(Ws+Lr)*Math.pow(Nr,2)/2;rt+=ti,Rn=_n,qs*(ui+=(Ws+Lr)*Nr)<=0?Ht():Qn(rt)?bt():Ht()};function bt(){zt=requestAnimationFrame(Ue)}function Ht(){cancelAnimationFrame(zt)}bt()})(Pn,function(Si){var Qn=Ne+Si*(un/Pn),Rn=wt+Si*(or/Pn),ui=Gm(Qn,kt,Ct,innerWidth),rt=ui[0],zt=ui[1],Ue=Gm(Rn,kt,It,innerHeight),bt=Ue[0],Ht=Ue[1];if(rt&&!ei&&(ei=!0,Ge?gy(Qn,zt,we.X):UZ(zt,Qn+(Qn-zt),we.X)),bt&&!Fn&&(Fn=!0,nn?gy(Rn,Ht,we.Y):UZ(Ht,Rn+(Rn-Ht),we.Y)),ei&&Fn)return!1;var _n=ei||we.X(zt),Nr=Fn||we.Y(Ht);return _n&&Nr})}),Ve=(le=y,ge=function(Ne,wt){Pe||Qe(H!==1?1:Math.max(2,P/L),Ne,wt)},Oe=p.useRef(0),Se=G2(function(){Oe.current=0,le.apply(void 0,[].slice.call(arguments))},{wait:300}),function(){var Ne=[].slice.call(arguments);Oe.current+=1,Se.apply(void 0,Ne),Oe.current>=2&&(Se.cancel(),Oe.current=0,ge.apply(void 0,Ne))});function Be(Ne,wt){if(R.current=0,(Z||W)&&S){T({touched:!1,maskTouched:!1,pause:!1,stopRaf:!1,reach:void 0});var jt=K2(H,P/L);if(Ae(J,V,X,ie,L,M,H,jt,ue,G,pe),O(Ne,wt),se===Ne&&Y===wt){if(Z)return void Ve(Ne,wt);W&&w(Ne,wt)}}}function _t(Ne,wt,jt){jt===void 0&&(jt=0),T({touched:!0,CX:Ne,CY:wt,lastCX:Ne,lastCY:wt,lastX:J,lastY:V,lastScale:H,touchLength:jt,touchTime:Date.now()})}function Pt(Ne){T({maskTouched:!0,CX:Ne.clientX,CY:Ne.clientY,lastX:J,lastY:V})}tx(ip?void 0:"mousemove",function(Ne){Ne.preventDefault(),_e(Ne.clientX,Ne.clientY)}),tx(ip?void 0:"mouseup",function(Ne){Be(Ne.clientX,Ne.clientY)}),tx(ip?"touchmove":void 0,function(Ne){Ne.preventDefault();var wt=BZ(Ne);_e.apply(void 0,wt)},{passive:!1}),tx(ip?"touchend":void 0,function(Ne){var wt=Ne.changedTouches[0];Be(wt.clientX,wt.clientY)},{passive:!1}),tx("resize",G2(function(){q&&!Z&&(T(k3(P,D,G)),k())},{maxWait:8})),A8(function(){S&&C(oo({scale:H,rotate:G},Ee))},[S]);var Kt=function(Ne,wt,jt,Yt,wn,We,kt,He,nt,et){var ft=function(on,kn,Sn,zi,un){var or=p.useRef(!1),Pn=WR({lead:!0,scale:Sn}),ei=Pn[0],Fn=ei.lead,Si=ei.scale,Qn=Pn[1],Rn=G2(function(ui){try{return un(!0),Qn({lead:!1,scale:ui}),Promise.resolve()}catch(rt){return Promise.reject(rt)}},{wait:zi});return A8(function(){or.current?(un(!1),Qn({lead:!0}),Rn(Sn)):or.current=!0},[Sn]),Fn?[on*Si,kn*Si,Sn/Si]:[on*Sn,kn*Sn,1]}(We,kt,He,nt,et),St=ft[0],Ct=ft[1],It=ft[2],Gt=function(on,kn,Sn,zi,un){var or=p.useState(FJe),Pn=or[0],ei=or[1],Fn=p.useState(0),Si=Fn[0],Qn=Fn[1],Rn=p.useRef(),ui=Hy({OK:function(){return on&&Qn(4)}});function rt(zt){un(!1),Qn(zt)}return p.useEffect(function(){if(Rn.current||(Rn.current=Date.now()),Sn){if(function(zt,Ue){var bt=zt&&zt.current;if(bt&&bt.nodeType===1){var Ht=bt.getBoundingClientRect();Ue({T:Ht.top,L:Ht.left,W:Ht.width,H:Ht.height,FIT:bt.tagName==="IMG"?getComputedStyle(bt).objectFit:void 0})}}(kn,ei),on)return Date.now()-Rn.current<250?(Qn(1),requestAnimationFrame(function(){Qn(2),requestAnimationFrame(function(){return rt(3)})}),void setTimeout(ui.OK,zi)):void Qn(4);rt(5)}},[on,Sn]),[Si,Pn]}(Ne,wt,jt,nt,et),Ge=Gt[0],xt=Gt[1],yt=xt.W,nn=xt.FIT,Qt=innerWidth/2,cn=innerHeight/2,Me=Ge<3||Ge>4;return[Me?yt?xt.L:Qt:Yt+(Qt-We*He/2),Me?yt?xt.T:cn:wn+(cn-kt*He/2),St,Me&&nn?St*(xt.H/yt):Ct,Ge===0?It:Me?yt/(We*He)||.01:It,Me?nn?1:0:1,Ge,nn]}(u,c,q,J,V,L,M,H,d,function(Ne){return T({pause:Ne})}),Et=Kt[4],vt=Kt[6],tt="transform "+d+"ms "+f,mt={className:m,onMouseDown:ip?void 0:function(Ne){Ne.stopPropagation(),Ne.button===0&&_t(Ne.clientX,Ne.clientY,0)},onTouchStart:ip?function(Ne){Ne.stopPropagation(),_t.apply(void 0,BZ(Ne))}:void 0,onWheel:function(Ne){if(!Pe){var wt=K2(H-Ne.deltaY/100/2,P/L);T({stopRaf:!0}),Qe(wt,Ne.clientX,Ne.clientY)}},style:{width:Kt[2]+"px",height:Kt[3]+"px",opacity:Kt[5],objectFit:vt===4?void 0:Kt[7],transform:G?"rotate("+G+"deg)":void 0,transition:vt>2?tt+", opacity "+d+"ms ease, height "+(vt<4?d/2:vt>4?d:0)+"ms "+f:void 0}};return ji.createElement("div",{className:"PhotoView__PhotoWrap"+(h?" "+h:""),style:g,onMouseDown:!ip&&S?Pt:void 0,onTouchStart:ip&&S?function(Ne){return Pt(Ne.touches[0])}:void 0},ji.createElement("div",{className:"PhotoView__PhotoBox",style:{transform:"matrix("+Et+", 0, 0, "+Et+", "+Kt[0]+", "+Kt[1]+")",transition:Z||je?void 0:tt,willChange:S?"transform":void 0}},n?ji.createElement(zJe,oo({src:n,loaded:q,broken:U},mt,{onPhotoLoad:function(Ne){T(oo({},Ne,Ne.loaded&&k3(Ne.naturalWidth||0,Ne.naturalHeight||0,G)))},loadingElement:b,brokenElement:v})):i&&i({attrs:mt,scale:Et,rotate:G})))}var QZ={x:0,touched:!1,pause:!1,lastCX:void 0,lastCY:void 0,bg:void 0,lastBg:void 0,overlay:!0,minimal:!0,scale:1,rotate:0};function qJe(e){var t=e.loop,n=t===void 0?3:t,i=e.speed,r=e.easing,s=e.photoClosable,o=e.maskClosable,l=o===void 0||o,c=e.maskOpacity,u=c===void 0?1:c,d=e.pullClosable,f=d===void 0||d,h=e.bannerVisible,m=h===void 0||h,g=e.overlayRender,b=e.toolbarRender,v=e.className,y=e.maskClassName,w=e.photoClassName,x=e.photoWrapClassName,O=e.loadingElement,k=e.brokenElement,S=e.images,C=e.index,E=C===void 0?0:C,j=e.onIndexChange,T=e.visible,R=e.onClose,A=e.afterClose,N=e.portalContainer,P=WR(QZ),I=P[0],D=P[1],_=p.useState(0),L=_[0],F=_[1],M=I.x,z=I.touched,q=I.pause,U=I.lastCX,J=I.lastCY,V=I.bg,Z=V===void 0?u:V,ne=I.lastBg,W=I.overlay,G=I.minimal,H=I.scale,se=I.rotate,Y=I.onScale,X=I.onRotate,ie=e.hasOwnProperty("index"),ee=ie?E:L,be=ie?j:F,ue=p.useRef(ee),pe=S.length,ke=S[ee],je=typeof n=="boolean"?n:pe>n,Pe=function(Et,vt){var tt=p.useReducer(function(jt){return!jt},!1)[1],mt=p.useRef(0),Ne=function(jt){var Yt=p.useRef(jt);function wn(We){Yt.current=We}return p.useMemo(function(){(function(We){Et?(We(Et),mt.current=1):mt.current=2})(wn)},[jt]),[Yt.current,wn]}(Et),wt=Ne[1];return[Ne[0],mt.current,function(){tt(),mt.current===2&&(wt(!1),vt&&vt()),mt.current=0}]}(T,A),Ee=Pe[0],Qe=Pe[1],_e=Pe[2];A8(function(){if(Ee)return D({pause:!0,x:ee*-(innerWidth+Av)}),void(ue.current=ee);D(QZ)},[Ee]);var ae=Hy({close:function(Et){X&&X(0),D({overlay:!0,lastBg:Z}),R(Et)},changeIndex:function(Et,vt){vt===void 0&&(vt=!1);var tt=je?ue.current+(Et-ee):Et,mt=pe-1,Ne=C8(tt,0,mt),wt=je?tt:Ne,jt=innerWidth+Av;D({touched:!1,lastCX:void 0,lastCY:void 0,x:-jt*wt,pause:vt}),ue.current=wt,be&&be(je?Et<0?mt:Et>mt?0:Et:Ne)}}),le=ae.close,ge=ae.changeIndex;function Oe(Et){return Et?le():D({overlay:!W})}function Se(){D({x:-(innerWidth+Av)*ee,lastCX:void 0,lastCY:void 0,pause:!0}),ue.current=ee}function qe(Et,vt,tt,mt){Et==="x"?function(Ne){if(U!==void 0){var wt=Ne-U,jt=wt;!je&&(ee===0&&wt>0||ee===pe-1&&wt<0)&&(jt=wt/2),D({touched:!0,lastCX:U,x:-(innerWidth+Av)*ue.current+jt,pause:!1})}else D({touched:!0,lastCX:Ne,x:M,pause:!1})}(vt):Et==="y"&&function(Ne,wt){if(J!==void 0){var jt=u===null?null:C8(u,.01,u-Math.abs(Ne-J)/100/4);D({touched:!0,lastCY:J,bg:wt===1?jt:u,minimal:wt===1})}else D({touched:!0,lastCY:Ne,bg:Z,minimal:!0})}(tt,mt)}function Xe(Et,vt){var tt=Et-(U??Et),mt=vt-(J??vt),Ne=!1;if(tt<-40)ge(ee+1);else if(tt>40)ge(ee-1);else{var wt=-(innerWidth+Av)*ue.current;Math.abs(mt)>100&&G&&f&&(Ne=!0,le()),D({touched:!1,x:wt,lastCX:void 0,lastCY:void 0,bg:u,overlay:!!Ne||W})}}tx("keydown",function(Et){if(T)switch(Et.key){case"ArrowLeft":ge(ee-1,!0);break;case"ArrowRight":ge(ee+1,!0);break;case"Escape":le()}});var ye=function(Et,vt,tt){return p.useMemo(function(){var mt=Et.length;return tt?Et.concat(Et).concat(Et).slice(mt+vt-1,mt+vt+2):Et.slice(Math.max(vt-1,0),Math.min(vt+2,mt+1))},[Et,vt,tt])}(S,ee,je);if(!Ee)return null;var we=W&&!Qe,Ae=T?Z:ne,Ve=Y&&X&&{images:S,index:ee,visible:T,onClose:le,onIndexChange:ge,overlayVisible:we,overlay:ke&&ke.overlay,scale:H,rotate:se,onScale:Y,onRotate:X},Be=i?i(Qe):400,_t=r?r(Qe):FZ,Pt=i?i(3):600,Kt=r?r(3):FZ;return ji.createElement(IJe,{className:"PhotoView-Portal"+(we?"":" PhotoView-Slider__clean")+(T?"":" PhotoView-Slider__willClose")+(v?" "+v:""),role:"dialog",onClick:function(Et){return Et.stopPropagation()},container:N},T&&ji.createElement(LJe,null),ji.createElement("div",{className:"PhotoView-Slider__Backdrop"+(y?" "+y:"")+(Qe===1?" PhotoView-Slider__fadeIn":Qe===2?" PhotoView-Slider__fadeOut":""),style:{background:Ae?"rgba(0, 0, 0, "+Ae+")":void 0,transitionTimingFunction:_t,transitionDuration:(z?0:Be)+"ms",animationDuration:Be+"ms"},onAnimationEnd:_e}),m&&ji.createElement("div",{className:"PhotoView-Slider__BannerWrap"},ji.createElement("div",{className:"PhotoView-Slider__Counter"},ee+1," / ",pe),ji.createElement("div",{className:"PhotoView-Slider__BannerRight"},b&&Ve&&b(Ve),ji.createElement(PJe,{className:"PhotoView-Slider__toolbarIcon",onClick:le}))),ye.map(function(Et,vt){var tt=je||ee!==0?ue.current-1+vt:ee+vt;return ji.createElement(HJe,{key:je?Et.key+"/"+Et.src+"/"+tt:Et.key,item:Et,speed:Be,easing:_t,visible:T,onReachMove:qe,onReachUp:Xe,onPhotoTap:function(){return Oe(s)},onMaskTap:function(){return Oe(l)},wrapClassName:x,className:w,style:{left:(innerWidth+Av)*tt+"px",transform:"translate3d("+M+"px, 0px, 0)",transition:z||q?void 0:"transform "+Pt+"ms "+Kt},loadingElement:O,brokenElement:k,onPhotoResize:Se,isActive:ue.current===tt,expose:D})}),!ip&&m&&ji.createElement(ji.Fragment,null,(je||ee!==0)&&ji.createElement("div",{className:"PhotoView-Slider__ArrowLeft",onClick:function(){return ge(ee-1,!0)}},ji.createElement(DJe,null)),(je||ee+1-1){var y=u.slice();return y.splice(v,1,b),void l({images:y})}l(function(w){return{images:w.images.concat(b)}})},remove:function(b){l(function(v){var y=v.images.filter(function(w){return w.key!==b});return{images:y,index:Math.min(y.length-1,f)}})},show:function(b){var v=u.findIndex(function(y){return y.key===b});l({visible:!0,index:v}),i&&i(!0,v,o)}}),m=Hy({close:function(){l({visible:!1}),i&&i(!1,f,o)},changeIndex:function(b){l({index:b}),n&&n(b,o)}}),g=p.useMemo(function(){return oo({},o,h)},[o,h]);return ji.createElement(PAe.Provider,{value:g},t,ji.createElement(qJe,oo({images:u,visible:d,index:f,onIndexChange:m.changeIndex,onClose:m.close},r)))}var MAe=function(e){var t,n,i=e.src,r=e.render,s=e.overlay,o=e.width,l=e.height,c=e.triggers,u=c===void 0?["onClick"]:c,d=e.children,f=p.useContext(PAe),h=(t=function(){return f.nextId()},(n=p.useRef({sign:!1,fn:void 0}).current).sign||(n.sign=!0,n.fn=t()),n.fn),m=p.useRef(null);p.useImperativeHandle(d==null?void 0:d.ref,function(){return m.current}),p.useEffect(function(){return function(){f.remove(h)}},[]);var g=Hy({render:function(v){return r&&r(v)},show:function(v,y){f.show(h),function(w,x){if(d){var O=d.props[w];O&&O(x)}}(v,y)}}),b=p.useMemo(function(){var v={};return u.forEach(function(y){v[y]=g.show.bind(null,y)}),v},[]);return p.useEffect(function(){f.update({key:h,src:i,originRef:m,render:g.render,overlay:s,width:o,height:l})},[i]),d?p.Children.only(p.cloneElement(d,oo({},b,{ref:m}))):null};function a0(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),a.jsx("path",{d:"m7.5 9 2.7 2.5L7.5 14M12.7 14h3.8"}),a.jsx("path",{d:"M3.8 7.5h16.4",opacity:".55"})]})}function LAe(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),a.jsx("path",{d:"M3.8 8h16.4"}),a.jsx("circle",{cx:"6.5",cy:"6.3",r:".65",fill:"currentColor",stroke:"none"}),a.jsx("circle",{cx:"8.8",cy:"6.3",r:".65",fill:"currentColor",stroke:"none"}),a.jsx("path",{d:"m9 15 2.2-4 1.6 2.4 1.1-1.2L16 15H9Z"})]})}function hz(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M12 3.4 19 6v5.3c0 4.3-2.7 7.6-7 9.3-4.3-1.7-7-5-7-9.3V6l7-2.6Z"}),a.jsx("path",{d:"m8.8 12 2 2 4.4-4.4"})]})}function sN(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M3.5 7.7h6.1l1.7 2h9.2v7.5a2.3 2.3 0 0 1-2.3 2.3H5.8a2.3 2.3 0 0 1-2.3-2.3V7.7Z"}),a.jsx("path",{d:"M3.8 7.7V6.8a2.3 2.3 0 0 1 2.3-2.3h3l1.8 2h6.9a2.3 2.3 0 0 1 2.3 2.3v.9"}),a.jsx("path",{d:"M12 13v3M10.5 14.5h3"})]})}function XJe(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 5v14M5 12h14"})})}function zZ(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m6.5 11.5 5.5-5.5 5.5 5.5M12 6v12"})})}function VZ(e){return a.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",...e,children:a.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1.75",fill:"currentColor"})})}function YJe(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),a.jsx("circle",{cx:"8.5",cy:"9",r:"1.4"}),a.jsx("path",{d:"m5.5 17 4.2-4.2 2.6 2.4 2.1-2.1 4.1 3.9"})]})}function ZJe(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3.5h7l5 5v12H6z"}),a.jsx("path",{d:"M13 3.5v5h5M9 13h6M9 16h5"})]})}function JJe(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"5",width:"13.5",height:"14",rx:"2.5"}),a.jsx("path",{d:"m17 10 3.5-2v8L17 14zM7 8.5h4.5"})]})}function eet(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m12 3 1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5zM18.5 15.5l.7 2.1 2.1.7-2.1.7-.7 2.1-.7-2.1-2.1-.7 2.1-.7z"})})}function $Ae(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function _8(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m9 6 6 6-6 6"})})}function tet(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M4.8 8.2A8 8 0 1 1 4 12M4.8 8.2V4.5M4.8 8.2h3.7"}),a.jsx("path",{d:"M12 8v4.5l3 1.8"})]})}function Rc(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M20 12a8 8 0 1 1-2.35-5.65"})})}function net(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"8",y:"8",width:"11",height:"11",rx:"2"}),a.jsx("path",{d:"M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2"})]})}function FAe(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m5 12.5 4.2 4.2L19 7"})})}function Q(e,t={}){return yn.t(e,{...t,ns:"adk"})}function ul(e){const t=new Headers(e);return t.has("Accept-Language")||t.set("Accept-Language",yn.resolvedLanguage||yn.language),t}function j8(){return yn.resolvedLanguage||yn.language}function iet(e){if(e.timezone!=null){if(typeof e.timezone!="string")return!1;try{new Intl.DateTimeFormat("en-US",{timeZone:e.timezone})}catch{return!1}}return e.runAt!=null&&(typeof e.runAt!="string"||!Number.isFinite(Date.parse(e.runAt)))?!1:[e.weekdays,e.monthDays].every(t=>t==null||Array.isArray(t)&&t.every(Number.isInteger))}async function ret(e,t,n,i,r){const s=await e(`/web/mpa-cron/${encodeURIComponent(t.runtimeId)}?region=${encodeURIComponent(t.region)}&offset=${n}&query=${encodeURIComponent(i)}`,{signal:r},{});if(!s.ok)throw new Error(`MPA_HTTP_${s.status}`);let o;try{o=await s.json()}catch{throw new Error("MPA_INVALID_RESPONSE")}if(!o||!Array.isArray(o.items)||!Number.isInteger(o.total)||o.total<0||typeof o.hasMore!="boolean"||o.hasMore&&(!Number.isInteger(o.nextOffset)||o.nextOffset<=n)||o.overview!=null&&(!Number.isFinite(o.overview.executionCount)||!Number.isFinite(o.overview.successRate))||!o.items.every(l=>l&&typeof l.id=="string"&&typeof l.name=="string"&&typeof l.enabled=="boolean"&&(l.prompt==null||typeof l.prompt=="string")&&l.schedule&&typeof l.schedule.type=="string"&&iet(l.schedule)&&[l.agentId,l.lastRunAt,l.runningAt,l.createdAt].every(c=>c==null||typeof c=="string")&&(l.nextRunAt==null||typeof l.nextRunAt=="string")&&(l.lastRunStatus==null||typeof l.lastRunStatus=="string")))throw new Error("MPA_INVALID_RESPONSE");return o}async function set(e,t,n,i,r,s){const o=await e(`/web/mpa-cron/${encodeURIComponent(t.runtimeId)}${i}?region=${encodeURIComponent(t.region)}`,{method:n,signal:s,...r===void 0?{}:{headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}},{});if(!o.ok)throw new Error(`MPA_HTTP_${o.status}`);let l;try{l=await o.json()}catch{throw new Error("MPA_INVALID_RESPONSE")}if(!l||typeof l!="object"||Array.isArray(l))throw new Error("MPA_INVALID_RESPONSE");return l}async function aet(e,t,n,i,r){const s=await e(`/web/mpa-cron/${encodeURIComponent(t.runtimeId)}/${encodeURIComponent(n)}/runs?region=${encodeURIComponent(t.region)}&offset=${i}`,{signal:r},{});if(!s.ok)throw new Error(`MPA_HTTP_${s.status}`);let o;try{o=await s.json()}catch{throw new Error("MPA_INVALID_RESPONSE")}if(!o||!Array.isArray(o.items)||!Number.isInteger(o.total)||o.total<0||typeof o.hasMore!="boolean"||o.hasMore&&(!Number.isInteger(o.nextOffset)||o.nextOffset<=i)||!o.items.every(l=>l&&typeof l.id=="string"&&typeof l.status=="string"&&typeof l.scheduledAt=="string"&&[l.startedAt,l.errorMessage,l.sessionId].every(c=>c==null||typeof c=="string")&&(l.durationMs==null||Number.isFinite(l.durationMs)&&l.durationMs>=0)))throw new Error("MPA_INVALID_RESPONSE");return o}const HZ="veadk_auth_qs",oet=new Set(["view","source","sessionId","artifactSha256","validationReportSha256","projectId","versionId"]);let tk=null;function cet(){if(tk!==null)return tk;const e=new URLSearchParams(window.location.search),t=new URLSearchParams,n=new URLSearchParams,i=e.get("view")==="runtime-deploy"&&e.get("source")==="intelligent-development";e.forEach((s,o)=>{(i&&oet.has(o)?n:t).append(o,s)});const r=t.toString();if(r?(sessionStorage.setItem(HZ,r),tk=r):tk=sessionStorage.getItem(HZ)??"",r){const s=n.toString();window.history.replaceState(null,"",window.location.pathname+(s?`?${s}`:"")+window.location.hash)}return tk}function ja(e){const t=cet();if(!t)return e;const n=new URL(e,window.location.origin);return new URLSearchParams(t).forEach((i,r)=>{n.searchParams.has(r)||n.searchParams.set(r,i)}),/^https?:\/\//i.test(e)?n.toString():n.pathname+n.search+n.hash}const ho=3e4,mr=12e4,pz=1e4;function po(e,t=ho){if(t<=0)return e??void 0;const n=AbortSignal.timeout(t);return e?AbortSignal.any([e,n]):n}const KR="veadk_local_user",GR="veadk_local_user_tab",uet="X-VeADK-OAuth-Refresh-Retry",det=[50,250],fet=/^[A-Za-z0-9]{1,16}$/;function BAe(){try{const e=sessionStorage.getItem(GR);if(e)return e;const t=localStorage.getItem(KR);return t&&sessionStorage.setItem(GR,t),t}catch{try{return localStorage.getItem(KR)}catch{return null}}}function qZ(e){try{sessionStorage.setItem(GR,e)}catch{}try{localStorage.setItem(KR,e)}catch{}}function het(){try{sessionStorage.removeItem(GR)}catch{}try{localStorage.removeItem(KR)}catch{}}function fc(e){const t=new Headers(e),n=BAe();return n&&t.set("X-VeADK-Local-User",n),t}async function UAe(){let e;try{e=await fetch("/web/auth-config",{headers:ul({Accept:"application/json"}),signal:po(void 0,pz)})}catch(t){throw console.warn("[identity] /web/auth-config is unreachable:",t),new Error(Q("identity.loadConfigNetworkFailed"))}if(!e.ok)throw new Error(Q("identity.configServiceFailed",{status:e.status}));try{const t=await e.json();if(!Array.isArray(t.providers))throw new TypeError("providers is not an array");return t.providers}catch(t){throw console.warn("[identity] /web/auth-config returned an invalid response:",t),new Error(Q("identity.invalidConfigResponse"))}}function pet(e){const t=window.location.pathname+window.location.search+window.location.hash,n=e.includes("?")?"&":"?";window.location.assign(`${e}${n}redirect=${encodeURIComponent(t)}`)}function met(){const e=window.location.pathname+window.location.search+window.location.hash,t=window.open("about:blank","_blank","popup,width=520,height=720");if(!t)return null;try{t.opener=null,t.location.replace(`/oauth2/login?redirect=${encodeURIComponent(e)}`)}catch{return t.close(),null}return t}async function get(){const[e,t]=await Promise.all([N8(),UAe()]);return e.status==="unauthenticated"&&t.length>0}function bet(){window.location.assign("/oauth2/logout")}async function yet(){for(let e=0;;e+=1){let t;try{t=await fetch("/oauth2/userinfo",{headers:ul({Accept:"application/json"}),signal:po(void 0,pz)})}catch(i){throw console.warn("[identity] /oauth2/userinfo is unreachable:",i),new Error(Q("identity.serviceNetworkFailed"))}const n=det[e];if(t.status!==401||t.headers.get(uet)!=="1"||n===void 0)return t;await new Promise(i=>window.setTimeout(i,n))}}async function N8(){const e=await yet();if(e.ok){let n;try{n=await e.json()}catch(r){throw console.warn("[identity] /oauth2/userinfo returned a non-JSON response:",r),new Error(Q("identity.invalidServiceResponse"))}return{status:"authenticated",userId:String(n.sub??n.user_id??n.email??""),info:n}}if(e.status===401)return{status:"unauthenticated",userId:"",local:!1};if(e.status!==404)throw new Error(Q("identity.serviceFailed",{status:e.status}));const t=BAe();return t?{status:"authenticated",userId:t,info:{name:t},local:!0}:{status:"unauthenticated",userId:"",local:!0}}function vet(e){if(!e)return"";for(const t of[e.name,e.preferred_username,e.username,e.email])if(typeof t=="string"&&t.trim())return t.trim();return""}function xet(e){const t=e==null?void 0:e.picture;return typeof t=="string"?t.trim():""}const R8="veadk:authentication-required";let qS=null,iS=null;function wet(e){if(!e.redirected||!e.url)return!1;try{const t=new URL(e.url);return t.pathname.includes("/authorize")||t.pathname.includes("/oauth2/login")||t.hostname.includes(".userpool.auth.")}catch{return!1}}function Oet(e){qS||(qS=new Promise(n=>{iS=n}),window.dispatchEvent(new Event(R8)));const t=qS;return e?e.aborted?Promise.reject(e.reason??new Error("Request aborted")):new Promise((n,i)=>{const r=()=>i(e.reason??new Error("Request aborted"));e.addEventListener("abort",r,{once:!0}),t.then(()=>{e.removeEventListener("abort",r),n()},s=>{e.removeEventListener("abort",r),i(s)})}):t}function ket(){return qS!==null}function Eet(){iS==null||iS(),iS=null,qS=null}async function ED(e,t){var i;const n=await e.text().catch(()=>"");try{return JSON.parse(n)}catch{const r=((i=e.headers.get("content-type"))==null?void 0:i.split(";",1)[0])||Q("common.contentTypeMissing"),s=n.trim().slice(0,2e3),o=s?` -${Q("common.response",{response:s})}`:"";throw new Error(Q("jsonResponse.nonJson",{fallback:t,status:e.status,contentType:r,detail:o}))}}const Cet=/\brun_sse\s*failed\s*:\s*404\b/i,Aet=/session not found/i,Tet=/(?:^|[::\s])not found\s*$/i,_et=/Expecting (?:'[^']+'|\w+)(?: delimiter)?: line \d+ column \d+ \(char \d+\)/i,jet=/Unknown or expired collection_id\s+'[^']+'\.\s*Call collect_resources first\./i,Net=/(?:RateLimitError|\bTPM\b|\bRPM\b|tokens? per minute|requests? per minute)[\s\S]*(?:\b429\b|limit|quota)|\b429\b[\s\S]*(?:model|RateLimitError|\bTPM\b|\bRPM\b)/i;function Tv(e,t){return e.includes(t)?e:`${e} + `),()=>{document.head.removeChild(d)}},[t]),a.jsx(oGe,{isPresent:t,childRef:i,sizeRef:r,children:p.cloneElement(e,{ref:i})})}const cGe=({children:e,initial:t,isPresent:n,onExitComplete:i,custom:r,presenceAffectsLayout:s,mode:o})=>{const l=bD(uGe),c=p.useId(),u=p.useCallback(f=>{l.set(f,!0);for(const h of l.values())if(!h)return;i&&i()},[l,i]),d=p.useMemo(()=>({id:c,initial:t,isPresent:n,custom:r,onExitComplete:u,register:f=>(l.set(f,!1),()=>l.delete(f))}),s?[Math.random(),u]:[n,u]);return p.useMemo(()=>{l.forEach((f,h)=>l.set(h,!1))},[n]),p.useEffect(()=>{!n&&!l.size&&i&&i()},[n]),o==="popLayout"&&(e=a.jsx(lGe,{isPresent:n,children:e})),a.jsx(yD.Provider,{value:d,children:e})};function uGe(){return new Map}function rCe(e=!0){const t=p.useContext(yD);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:r}=t,s=p.useId();p.useEffect(()=>{e&&r(s)},[e]);const o=p.useCallback(()=>e&&i&&i(s),[s,i,e]);return!n&&i?[!1,o]:[!0]}const H2=e=>e.key||"";function SY(e){const t=[];return p.Children.forEach(e,n=>{p.isValidElement(n)&&t.push(n)}),t}const DQ=typeof window<"u",sCe=DQ?p.useLayoutEffect:p.useEffect,ff=({children:e,custom:t,initial:n=!0,onExitComplete:i,presenceAffectsLayout:r=!0,mode:s="sync",propagate:o=!1})=>{const[l,c]=rCe(o),u=p.useMemo(()=>SY(e),[e]),d=o&&!l?[]:u.map(H2),f=p.useRef(!0),h=p.useRef(u),m=bD(()=>new Map),[g,b]=p.useState(u),[v,y]=p.useState(u);sCe(()=>{f.current=!1,h.current=u;for(let O=0;O{const k=H2(O),S=o&&!l?!1:u===v||d.includes(k),C=()=>{if(m.has(k))m.set(k,!0);else return;let E=!0;m.forEach(j=>{j||(E=!1)}),E&&(x==null||x(),y(h.current),o&&(c==null||c()),i&&i())};return a.jsx(cGe,{isPresent:S,initial:!f.current||n?void 0:!1,custom:S?void 0:t,presenceAffectsLayout:r,mode:s,onExitComplete:S?void 0:C,children:O},k)})})},Tu=e=>e;let aCe=Tu;const dGe={useManualTiming:!1};function fGe(e){let t=new Set,n=new Set,i=!1,r=!1;const s=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function l(u){s.has(u)&&(c.schedule(u),e()),u(o)}const c={schedule:(u,d=!1,f=!1)=>{const m=f&&i?t:n;return d&&s.add(u),m.has(u)||m.add(u),u},cancel:u=>{n.delete(u),s.delete(u)},process:u=>{if(o=u,i){r=!0;return}i=!0,[t,n]=[n,t],t.forEach(l),t.clear(),i=!1,r&&(r=!1,c.process(u))}};return c}const q2=["read","resolveKeyframes","update","preRender","render","postRender"],hGe=40;function oCe(e,t){let n=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=q2.reduce((y,w)=>(y[w]=fGe(s),y),{}),{read:l,resolveKeyframes:c,update:u,preRender:d,render:f,postRender:h}=o,m=()=>{const y=performance.now();n=!1,r.delta=i?1e3/60:Math.max(Math.min(y-r.timestamp,hGe),1),r.timestamp=y,r.isProcessing=!0,l.process(r),c.process(r),u.process(r),d.process(r),f.process(r),h.process(r),r.isProcessing=!1,n&&t&&(i=!1,e(m))},g=()=>{n=!0,i=!0,r.isProcessing||e(m)};return{schedule:q2.reduce((y,w)=>{const x=o[w];return y[w]=(O,k=!1,S=!1)=>(n||g(),x.schedule(O,k,S)),y},{}),cancel:y=>{for(let w=0;wEY[e].some(n=>!!t[n])};function pGe(e){for(const t in e)Vw[t]={...Vw[t],...e[t]}}const mGe=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function BR(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||mGe.has(e)}let cCe=e=>!BR(e);function uCe(e){e&&(cCe=t=>t.startsWith("on")?!BR(t):e(t))}try{uCe(require("@emotion/is-prop-valid").default)}catch{}function gGe(e,t,n){const i={};for(const r in e)r==="values"&&typeof e.values=="object"||(cCe(r)||n===!0&&BR(r)||!t&&!BR(r)||e.draggable&&r.startsWith("onDrag"))&&(i[r]=e[r]);return i}function bGe({children:e,isValidProp:t,...n}){t&&uCe(t),n={...p.useContext(YE),...n},n.isStatic=bD(()=>n.isStatic);const i=p.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return a.jsx(YE.Provider,{value:i,children:e})}function yGe(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...i)=>e(...i);return new Proxy(n,{get:(i,r)=>r==="create"?e:(t.has(r)||t.set(r,e(r)),t.get(r))})}const vD=p.createContext({});function ZE(e){return typeof e=="string"||Array.isArray(e)}function xD(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const MQ=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],LQ=["initial",...MQ];function wD(e){return xD(e.animate)||LQ.some(t=>ZE(e[t]))}function dCe(e){return!!(wD(e)||e.variants)}function vGe(e,t){if(wD(e)){const{initial:n,animate:i}=e;return{initial:n===!1||ZE(n)?n:void 0,animate:ZE(i)?i:void 0}}return e.inherit!==!1?t:{}}function xGe(e){const{initial:t,animate:n}=vGe(e,p.useContext(vD));return p.useMemo(()=>({initial:t,animate:n}),[CY(t),CY(n)])}function CY(e){return Array.isArray(e)?e.join(" "):e}const wGe=Symbol.for("motionComponentSymbol");function jx(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function OGe(e,t,n){return p.useCallback(i=>{i&&e.onMount&&e.onMount(i),t&&(i?t.mount(i):t.unmount()),n&&(typeof n=="function"?n(i):jx(n)&&(n.current=i))},[t])}const $Q=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),kGe="framerAppearId",fCe="data-"+$Q(kGe),{schedule:FQ}=oCe(queueMicrotask,!1),hCe=p.createContext({});function SGe(e,t,n,i,r){var s,o;const{visualElement:l}=p.useContext(vD),c=p.useContext(lCe),u=p.useContext(yD),d=p.useContext(YE).reducedMotion,f=p.useRef(null);i=i||c.renderer,!f.current&&i&&(f.current=i(e,{visualState:t,parent:l,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d}));const h=f.current,m=p.useContext(hCe);h&&!h.projection&&r&&(h.type==="html"||h.type==="svg")&&EGe(f.current,n,r,m);const g=p.useRef(!1);p.useInsertionEffect(()=>{h&&g.current&&h.update(n,u)});const b=n[fCe],v=p.useRef(!!b&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,b))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,b)));return sCe(()=>{h&&(g.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),FQ.render(h.render),v.current&&h.animationState&&h.animationState.animateChanges())}),p.useEffect(()=>{h&&(!v.current&&h.animationState&&h.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)===null||y===void 0||y.call(window,b)}),v.current=!1))}),h}function EGe(e,t,n,i){const{layoutId:r,layout:s,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:pCe(e.parent)),e.projection.setOptions({layoutId:r,layout:s,alwaysMeasureLayout:!!o||l&&jx(l),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:i,layoutScroll:c,layoutRoot:u})}function pCe(e){if(e)return e.options.allowProjection!==!1?e.projection:pCe(e.parent)}function CGe({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:i,Component:r}){var s,o;e&&pGe(e);function l(u,d){let f;const h={...p.useContext(YE),...u,layoutId:AGe(u)},{isStatic:m}=h,g=xGe(u),b=i(u,m);if(!m&&DQ){TGe();const v=_Ge(h);f=v.MeasureLayout,g.visualElement=SGe(r,b,h,t,v.ProjectionNode)}return a.jsxs(vD.Provider,{value:g,children:[f&&g.visualElement?a.jsx(f,{visualElement:g.visualElement,...h}):null,n(r,u,OGe(b,g.visualElement,d),b,m,g.visualElement)]})}l.displayName=`motion.${typeof r=="string"?r:`create(${(o=(s=r.displayName)!==null&&s!==void 0?s:r.name)!==null&&o!==void 0?o:""})`}`;const c=p.forwardRef(l);return c[wGe]=r,c}function AGe({layoutId:e}){const t=p.useContext(PQ).id;return t&&e!==void 0?t+"-"+e:e}function TGe(e,t){p.useContext(lCe).strict}function _Ge(e){const{drag:t,layout:n}=Vw;if(!t&&!n)return{};const i={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}const jGe=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function BQ(e){return typeof e!="string"||e.includes("-")?!1:!!(jGe.indexOf(e)>-1||/[A-Z]/u.test(e))}function AY(e){const t=[{},{}];return e==null||e.values.forEach((n,i)=>{t[0][i]=n.get(),t[1][i]=n.getVelocity()}),t}function UQ(e,t,n,i){if(typeof t=="function"){const[r,s]=AY(i);t=t(n!==void 0?n:e.custom,r,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[r,s]=AY(i);t=t(n!==void 0?n:e.custom,r,s)}return t}const d8=e=>Array.isArray(e),NGe=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),RGe=e=>d8(e)?e[e.length-1]||0:e,Al=e=>!!(e&&e.getVelocity);function iN(e){const t=Al(e)?e.get():e;return NGe(t)?t.toValue():t}function IGe({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},i,r,s){const o={latestValues:PGe(i,r,s,e),renderState:t()};return n&&(o.onMount=l=>n({props:i,current:l,...o}),o.onUpdate=l=>n(l)),o}const mCe=e=>(t,n)=>{const i=p.useContext(vD),r=p.useContext(yD),s=()=>IGe(e,t,i,r);return n?s():bD(s)};function PGe(e,t,n,i){const r={},s=i(e,{});for(const h in s)r[h]=iN(s[h]);let{initial:o,animate:l}=e;const c=wD(e),u=dCe(e);t&&u&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const f=d?l:o;if(f&&typeof f!="boolean"&&!xD(f)){const h=Array.isArray(f)?f:[f];for(let m=0;mt=>typeof t=="string"&&t.startsWith(e),bCe=gCe("--"),DGe=gCe("var(--"),QQ=e=>DGe(e)?MGe.test(e.split("/*")[0].trim()):!1,MGe=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,yCe=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Wp=(e,t,n)=>n>t?t:ntypeof e=="number",parse:parseFloat,transform:e=>e},JE={...$1,transform:e=>Wp(0,1,e)},W2={...$1,default:1},RA=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Qm=RA("deg"),ph=RA("%"),Gn=RA("px"),LGe=RA("vh"),$Ge=RA("vw"),TY={...ph,parse:e=>ph.parse(e)/100,transform:e=>ph.transform(e*100)},FGe={borderWidth:Gn,borderTopWidth:Gn,borderRightWidth:Gn,borderBottomWidth:Gn,borderLeftWidth:Gn,borderRadius:Gn,radius:Gn,borderTopLeftRadius:Gn,borderTopRightRadius:Gn,borderBottomRightRadius:Gn,borderBottomLeftRadius:Gn,width:Gn,maxWidth:Gn,height:Gn,maxHeight:Gn,top:Gn,right:Gn,bottom:Gn,left:Gn,padding:Gn,paddingTop:Gn,paddingRight:Gn,paddingBottom:Gn,paddingLeft:Gn,margin:Gn,marginTop:Gn,marginRight:Gn,marginBottom:Gn,marginLeft:Gn,backgroundPositionX:Gn,backgroundPositionY:Gn},BGe={rotate:Qm,rotateX:Qm,rotateY:Qm,rotateZ:Qm,scale:W2,scaleX:W2,scaleY:W2,scaleZ:W2,skew:Qm,skewX:Qm,skewY:Qm,distance:Gn,translateX:Gn,translateY:Gn,translateZ:Gn,x:Gn,y:Gn,z:Gn,perspective:Gn,transformPerspective:Gn,opacity:JE,originX:TY,originY:TY,originZ:Gn},_Y={...$1,transform:Math.round},zQ={...FGe,...BGe,zIndex:_Y,size:Gn,fillOpacity:JE,strokeOpacity:JE,numOctaves:_Y},UGe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},QGe=L1.length;function zGe(e,t,n){let i="",r=!0;for(let s=0;s({style:{},transform:{},transformOrigin:{},vars:{}}),vCe=()=>({...qQ(),attrs:{}}),WQ=e=>typeof e=="string"&&e.toLowerCase()==="svg";function xCe(e,{style:t,vars:n},i,r){Object.assign(e.style,t,r&&r.getProjectionStyles(i));for(const s in n)e.style.setProperty(s,n[s])}const wCe=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function OCe(e,t,n,i){xCe(e,t,void 0,i);for(const r in t.attrs)e.setAttribute(wCe.has(r)?r:$Q(r),t.attrs[r])}const UR={};function KGe(e){Object.assign(UR,e)}function kCe(e,{layout:t,layoutId:n}){return F0.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!UR[e]||e==="opacity")}function KQ(e,t,n){var i;const{style:r}=e,s={};for(const o in r)(Al(r[o])||t.style&&Al(t.style[o])||kCe(o,e)||((i=n==null?void 0:n.getValue(o))===null||i===void 0?void 0:i.liveStyle)!==void 0)&&(s[o]=r[o]);return s}function SCe(e,t,n){const i=KQ(e,t,n);for(const r in e)if(Al(e[r])||Al(t[r])){const s=L1.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;i[s]=e[r]}return i}function GGe(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const NY=["x","y","width","height","cx","cy","r"],XGe={useVisualState:mCe({scrapeMotionValuesFromProps:SCe,createRenderState:vCe,onUpdate:({props:e,prevProps:t,current:n,renderState:i,latestValues:r})=>{if(!n)return;let s=!!e.drag;if(!s){for(const l in r)if(F0.has(l)){s=!0;break}}if(!s)return;let o=!t;if(t)for(let l=0;l{GGe(n,i),Is.render(()=>{HQ(i,r,WQ(n.tagName),e.transformTemplate),OCe(n,i)})})}})},YGe={useVisualState:mCe({scrapeMotionValuesFromProps:KQ,createRenderState:qQ})};function ECe(e,t,n){for(const i in t)!Al(t[i])&&!kCe(i,n)&&(e[i]=t[i])}function ZGe({transformTemplate:e},t){return p.useMemo(()=>{const n=qQ();return VQ(n,t,e),Object.assign({},n.vars,n.style)},[t])}function JGe(e,t){const n=e.style||{},i={};return ECe(i,n,e),Object.assign(i,ZGe(e,t)),i}function eXe(e,t){const n={},i=JGe(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=i,n}function tXe(e,t,n,i){const r=p.useMemo(()=>{const s=vCe();return HQ(s,t,WQ(i),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};ECe(s,e.style,e),r.style={...s,...r.style}}return r}function nXe(e=!1){return(n,i,r,{latestValues:s},o)=>{const c=(BQ(n)?tXe:eXe)(i,s,o,n),u=gGe(i,typeof n=="string",e),d=n!==p.Fragment?{...u,...c,ref:r}:{},{children:f}=i,h=p.useMemo(()=>Al(f)?f.get():f,[f]);return p.createElement(n,{...d,children:h})}}function iXe(e,t){return function(i,{forwardMotionProps:r}={forwardMotionProps:!1}){const o={...BQ(i)?XGe:YGe,preloadedFeatures:e,useRender:nXe(r),createVisualElement:t,Component:i};return CGe(o)}}function CCe(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;i(rN===void 0&&mh.set(Go.isProcessing||dGe.useManualTiming?Go.timestamp:performance.now()),rN),set:e=>{rN=e,queueMicrotask(rXe)}};function XQ(e,t){e.indexOf(t)===-1&&e.push(t)}function YQ(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class ZQ{constructor(){this.subscriptions=[]}add(t){return XQ(this.subscriptions,t),()=>YQ(this.subscriptions,t)}notify(t,n,i){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](t,n,i);else for(let s=0;s!isNaN(parseFloat(e));class aXe{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(i,r=!0)=>{const s=mh.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),r&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=mh.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=sXe(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new ZQ);const i=this.events[t].add(n);return t==="change"?()=>{i(),Is.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,i){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-i}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=mh.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>RY)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,RY);return TCe(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function eC(e,t){return new aXe(e,t)}function oXe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,eC(n))}function lXe(e,t){const n=OD(e,t);let{transitionEnd:i={},transition:r={},...s}=n||{};s={...s,...i};for(const o in s){const l=RGe(s[o]);oXe(e,o,l)}}function cXe(e){return!!(Al(e)&&e.add)}function f8(e,t){const n=e.getValue("willChange");if(cXe(n))return n.add(t)}function _Ce(e){return e.props[fCe]}function JQ(e){let t;return()=>(t===void 0&&(t=e()),t)}const uXe=JQ(()=>window.ScrollTimeline!==void 0);class dXe{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let i=0;i{if(uXe()&&r.attachTimeline)return r.attachTimeline(t);if(typeof n=="function")return n(r)});return()=>{i.forEach((r,s)=>{r&&r(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;nn[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class fXe extends dXe{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}const Np=e=>e*1e3,Rp=e=>e/1e3;function ez(e){return typeof e=="function"}function IY(e,t){e.timeline=t,e.onfinish=null}const tz=e=>Array.isArray(e)&&typeof e[0]=="number",hXe={linearEasing:void 0};function pXe(e,t){const n=JQ(e);return()=>{var i;return(i=hXe[t])!==null&&i!==void 0?i:n()}}const QR=pXe(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Hw=(e,t,n)=>{const i=t-e;return i===0?1:(n-e)/i},jCe=(e,t,n=10)=>{let i="";const r=Math.max(Math.round(t/n),2);for(let s=0;s`cubic-bezier(${e}, ${t}, ${n}, ${i})`,h8={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:sS([0,.65,.55,1]),circOut:sS([.55,0,1,.45]),backIn:sS([.31,.01,.66,-.59]),backOut:sS([.33,1.53,.69,.99])};function RCe(e,t){if(e)return typeof e=="function"&&QR()?jCe(e,t):tz(e)?sS(e):Array.isArray(e)?e.map(n=>RCe(n,t)||h8.easeOut):h8[e]}const ICe=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,mXe=1e-7,gXe=12;function bXe(e,t,n,i,r){let s,o,l=0;do o=t+(n-t)/2,s=ICe(o,i,r)-e,s>0?n=o:t=o;while(Math.abs(s)>mXe&&++lbXe(s,0,1,e,n);return s=>s===0||s===1?s:ICe(r(s),t,i)}const PCe=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,DCe=e=>t=>1-e(1-t),MCe=IA(.33,1.53,.69,.99),nz=DCe(MCe),LCe=PCe(nz),$Ce=e=>(e*=2)<1?.5*nz(e):.5*(2-Math.pow(2,-10*(e-1))),iz=e=>1-Math.sin(Math.acos(e)),FCe=DCe(iz),BCe=PCe(iz),UCe=e=>/^0[^.\s]+$/u.test(e);function yXe(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||UCe(e):!0}const WS=e=>Math.round(e*1e5)/1e5,rz=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function vXe(e){return e==null}const xXe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,sz=(e,t)=>n=>!!(typeof n=="string"&&xXe.test(n)&&n.startsWith(e)||t&&!vXe(n)&&Object.prototype.hasOwnProperty.call(n,t)),QCe=(e,t,n)=>i=>{if(typeof i!="string")return i;const[r,s,o,l]=i.match(rz);return{[e]:parseFloat(r),[t]:parseFloat(s),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},wXe=e=>Wp(0,255,e),u3={...$1,transform:e=>Math.round(wXe(e))},Ay={test:sz("rgb","red"),parse:QCe("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+u3.transform(e)+", "+u3.transform(t)+", "+u3.transform(n)+", "+WS(JE.transform(i))+")"};function OXe(e){let t="",n="",i="",r="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),i=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),i=e.substring(3,4),r=e.substring(4,5),t+=t,n+=n,i+=i,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}}const p8={test:sz("#"),parse:OXe,transform:Ay.transform},Nx={test:sz("hsl","hue"),parse:QCe("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+ph.transform(WS(t))+", "+ph.transform(WS(n))+", "+WS(JE.transform(i))+")"},Sl={test:e=>Ay.test(e)||p8.test(e)||Nx.test(e),parse:e=>Ay.test(e)?Ay.parse(e):Nx.test(e)?Nx.parse(e):p8.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ay.transform(e):Nx.transform(e)},kXe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function SXe(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(rz))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(kXe))===null||n===void 0?void 0:n.length)||0)>0}const zCe="number",VCe="color",EXe="var",CXe="var(",PY="${}",AXe=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function tC(e){const t=e.toString(),n=[],i={color:[],number:[],var:[]},r=[];let s=0;const l=t.replace(AXe,c=>(Sl.test(c)?(i.color.push(s),r.push(VCe),n.push(Sl.parse(c))):c.startsWith(CXe)?(i.var.push(s),r.push(EXe),n.push(c)):(i.number.push(s),r.push(zCe),n.push(parseFloat(c))),++s,PY)).split(PY);return{values:n,split:l,indexes:i,types:r}}function HCe(e){return tC(e).values}function qCe(e){const{split:t,types:n}=tC(e),i=t.length;return r=>{let s="";for(let o=0;otypeof e=="number"?0:e;function _Xe(e){const t=HCe(e);return qCe(e)(t.map(TXe))}const Kg={test:SXe,parse:HCe,createTransformer:qCe,getAnimatableNone:_Xe},jXe=new Set(["brightness","contrast","saturate","opacity"]);function NXe(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=n.match(rz)||[];if(!i)return e;const r=n.replace(i,"");let s=jXe.has(t)?1:0;return i!==n&&(s*=100),t+"("+s+r+")"}const RXe=/\b([a-z-]*)\(.*?\)/gu,m8={...Kg,getAnimatableNone:e=>{const t=e.match(RXe);return t?t.map(NXe).join(" "):e}},IXe={...zQ,color:Sl,backgroundColor:Sl,outlineColor:Sl,fill:Sl,stroke:Sl,borderColor:Sl,borderTopColor:Sl,borderRightColor:Sl,borderBottomColor:Sl,borderLeftColor:Sl,filter:m8,WebkitFilter:m8},az=e=>IXe[e];function WCe(e,t){let n=az(e);return n!==m8&&(n=Kg),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const PXe=new Set(["auto","none","0"]);function DXe(e,t,n){let i=0,r;for(;ie===$1||e===Gn,MY=(e,t)=>parseFloat(e.split(", ")[t]),LY=(e,t)=>(n,{transform:i})=>{if(i==="none"||!i)return 0;const r=i.match(/^matrix3d\((.+)\)$/u);if(r)return MY(r[1],t);{const s=i.match(/^matrix\((.+)\)$/u);return s?MY(s[1],e):0}},MXe=new Set(["x","y","z"]),LXe=L1.filter(e=>!MXe.has(e));function $Xe(e){const t=[];return LXe.forEach(n=>{const i=e.getValue(n);i!==void 0&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t}const qw={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:LY(4,13),y:LY(5,14)};qw.translateX=qw.x;qw.translateY=qw.y;const Wy=new Set;let g8=!1,b8=!1;function KCe(){if(b8){const e=Array.from(Wy).filter(i=>i.needsMeasurement),t=new Set(e.map(i=>i.element)),n=new Map;t.forEach(i=>{const r=$Xe(i);r.length&&(n.set(i,r),i.render())}),e.forEach(i=>i.measureInitialState()),t.forEach(i=>{i.render();const r=n.get(i);r&&r.forEach(([s,o])=>{var l;(l=i.getValue(s))===null||l===void 0||l.set(o)})}),e.forEach(i=>i.measureEndState()),e.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}b8=!1,g8=!1,Wy.forEach(e=>e.complete()),Wy.clear()}function GCe(){Wy.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(b8=!0)})}function FXe(){GCe(),KCe()}class oz{constructor(t,n,i,r,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=i,this.motionValue=r,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Wy.add(this),g8||(g8=!0,Is.read(GCe),Is.resolveKeyframes(KCe))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:i,motionValue:r}=this;for(let s=0;s/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),BXe=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function UXe(e){const t=BXe.exec(e);if(!t)return[,];const[,n,i,r]=t;return[`--${n??i}`,r]}function YCe(e,t,n=1){const[i,r]=UXe(e);if(!i)return;const s=window.getComputedStyle(t).getPropertyValue(i);if(s){const o=s.trim();return XCe(o)?parseFloat(o):o}return QQ(r)?YCe(r,t,n+1):r}const ZCe=e=>t=>t.test(e),QXe={test:e=>e==="auto",parse:e=>e},JCe=[$1,Gn,ph,Qm,$Ge,LGe,QXe],$Y=e=>JCe.find(ZCe(e));class eAe extends oz{constructor(t,n,i,r,s){super(t,n,i,r,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:i}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c{n.getValue(c).set(u)}),this.resolveNoneKeyframes()}}const FY=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Kg.test(e)||e==="0")&&!e.startsWith("url("));function zXe(e){const t=e[0];if(e.length===1)return!0;for(let n=0;ne!==null;function kD(e,{repeat:t,repeatType:n="loop"},i){const r=e.filter(HXe),s=t&&n!=="loop"&&t%2===1?0:r.length-1;return!s||i===void 0?r[s]:i}const qXe=40;class tAe{constructor({autoplay:t=!0,delay:n=0,type:i="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:o="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=mh.now(),this.options={autoplay:t,delay:n,type:i,repeat:r,repeatDelay:s,repeatType:o,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>qXe?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&FXe(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=mh.now(),this.hasAttemptedResolve=!0;const{name:i,type:r,velocity:s,delay:o,onComplete:l,onUpdate:c,isGenerator:u}=this.options;if(!u&&!VXe(t,i,r,s))if(o)this.options.duration=0;else{c&&c(kD(t,this.options,n)),l&&l(),this.resolveFinishedPromise();return}const d=this.initPlayback(t,n);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...d},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const y8=2e4;function nAe(e){let t=0;const n=50;let i=e.next(t);for(;!i.done&&t=y8?1/0:t}const ea=(e,t,n)=>e+(t-e)*n;function d3(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function WXe({hue:e,saturation:t,lightness:n,alpha:i}){e/=360,t/=100,n/=100;let r=0,s=0,o=0;if(!t)r=s=o=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;r=d3(c,l,e+1/3),s=d3(c,l,e),o=d3(c,l,e-1/3)}return{red:Math.round(r*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:i}}function zR(e,t){return n=>n>0?t:e}const f3=(e,t,n)=>{const i=e*e,r=n*(t*t-i)+i;return r<0?0:Math.sqrt(r)},KXe=[p8,Ay,Nx],GXe=e=>KXe.find(t=>t.test(e));function BY(e){const t=GXe(e);if(!t)return!1;let n=t.parse(e);return t===Nx&&(n=WXe(n)),n}const UY=(e,t)=>{const n=BY(e),i=BY(t);if(!n||!i)return zR(e,t);const r={...n};return s=>(r.red=f3(n.red,i.red,s),r.green=f3(n.green,i.green,s),r.blue=f3(n.blue,i.blue,s),r.alpha=ea(n.alpha,i.alpha,s),Ay.transform(r))},XXe=(e,t)=>n=>t(e(n)),PA=(...e)=>e.reduce(XXe),v8=new Set(["none","hidden"]);function YXe(e,t){return v8.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function ZXe(e,t){return n=>ea(e,t,n)}function lz(e){return typeof e=="number"?ZXe:typeof e=="string"?QQ(e)?zR:Sl.test(e)?UY:tYe:Array.isArray(e)?iAe:typeof e=="object"?Sl.test(e)?UY:JXe:zR}function iAe(e,t){const n=[...e],i=n.length,r=e.map((s,o)=>lz(s)(s,t[o]));return s=>{for(let o=0;o{for(const s in i)n[s]=i[s](r);return n}}function eYe(e,t){var n;const i=[],r={color:0,var:0,number:0};for(let s=0;s{const n=Kg.createTransformer(t),i=tC(e),r=tC(t);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?v8.has(e)&&!r.values.length||v8.has(t)&&!i.values.length?YXe(e,t):PA(iAe(eYe(i,r),r.values),n):zR(e,t)};function rAe(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ea(e,t,n):lz(e)(e,t)}const nYe=5;function sAe(e,t,n){const i=Math.max(t-nYe,0);return TCe(n-e(i),t-i)}const ca={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},h3=.001;function iYe({duration:e=ca.duration,bounce:t=ca.bounce,velocity:n=ca.velocity,mass:i=ca.mass}){let r,s,o=1-t;o=Wp(ca.minDamping,ca.maxDamping,o),e=Wp(ca.minDuration,ca.maxDuration,Rp(e)),o<1?(r=u=>{const d=u*o,f=d*e,h=d-n,m=x8(u,o),g=Math.exp(-f);return h3-h/m*g},s=u=>{const f=u*o*e,h=f*n+n,m=Math.pow(o,2)*Math.pow(u,2)*e,g=Math.exp(-f),b=x8(Math.pow(u,2),o);return(-r(u)+h3>0?-1:1)*((h-m)*g)/b}):(r=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-h3+d*f},s=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const l=5/e,c=sYe(r,s,l);if(e=Np(e),isNaN(c))return{stiffness:ca.stiffness,damping:ca.damping,duration:e};{const u=Math.pow(c,2)*i;return{stiffness:u,damping:o*2*Math.sqrt(i*u),duration:e}}}const rYe=12;function sYe(e,t,n){let i=n;for(let r=1;re[n]!==void 0)}function lYe(e){let t={velocity:ca.velocity,stiffness:ca.stiffness,damping:ca.damping,mass:ca.mass,isResolvedFromDuration:!1,...e};if(!QY(e,oYe)&&QY(e,aYe))if(e.visualDuration){const n=e.visualDuration,i=2*Math.PI/(n*1.2),r=i*i,s=2*Wp(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:ca.mass,stiffness:r,damping:s}}else{const n=iYe(e);t={...t,...n,mass:ca.mass},t.isResolvedFromDuration=!0}return t}function aAe(e=ca.visualDuration,t=ca.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:i,restDelta:r}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:s},{stiffness:c,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:m}=lYe({...n,velocity:-Rp(n.velocity||0)}),g=h||0,b=u/(2*Math.sqrt(c*d)),v=o-s,y=Rp(Math.sqrt(c/d)),w=Math.abs(v)<5;i||(i=w?ca.restSpeed.granular:ca.restSpeed.default),r||(r=w?ca.restDelta.granular:ca.restDelta.default);let x;if(b<1){const k=x8(y,b);x=S=>{const C=Math.exp(-b*y*S);return o-C*((g+b*y*v)/k*Math.sin(k*S)+v*Math.cos(k*S))}}else if(b===1)x=k=>o-Math.exp(-y*k)*(v+(g+y*v)*k);else{const k=y*Math.sqrt(b*b-1);x=S=>{const C=Math.exp(-b*y*S),E=Math.min(k*S,300);return o-C*((g+b*y*v)*Math.sinh(E)+k*v*Math.cosh(E))/k}}const O={calculatedDuration:m&&f||null,next:k=>{const S=x(k);if(m)l.done=k>=f;else{let C=0;b<1&&(C=k===0?Np(g):sAe(x,k,S));const E=Math.abs(C)<=i,j=Math.abs(o-S)<=r;l.done=E&&j}return l.value=l.done?o:S,l},toString:()=>{const k=Math.min(nAe(O),y8),S=jCe(C=>O.next(k*C).value,k,30);return k+"ms "+S}};return O}function zY({keyframes:e,velocity:t=0,power:n=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:s=500,modifyTarget:o,min:l,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},m=E=>l!==void 0&&Ec,g=E=>l===void 0?c:c===void 0||Math.abs(l-E)-b*Math.exp(-E/i),x=E=>y+w(E),O=E=>{const j=w(E),T=x(E);h.done=Math.abs(j)<=u,h.value=h.done?y:T};let k,S;const C=E=>{m(h.value)&&(k=E,S=aAe({keyframes:[h.value,g(h.value)],velocity:sAe(x,E,h.value),damping:r,stiffness:s,restDelta:u,restSpeed:d}))};return C(0),{calculatedDuration:null,next:E=>{let j=!1;return!S&&k===void 0&&(j=!0,O(E),C(E)),k!==void 0&&E>=k?S.next(E-k):(!j&&O(E),h)}}}const cYe=IA(.42,0,1,1),uYe=IA(0,0,.58,1),oAe=IA(.42,0,.58,1),dYe=e=>Array.isArray(e)&&typeof e[0]!="number",fYe={linear:Tu,easeIn:cYe,easeInOut:oAe,easeOut:uYe,circIn:iz,circInOut:BCe,circOut:FCe,backIn:nz,backInOut:LCe,backOut:MCe,anticipate:$Ce},VY=e=>{if(tz(e)){aCe(e.length===4);const[t,n,i,r]=e;return IA(t,n,i,r)}else if(typeof e=="string")return fYe[e];return e};function hYe(e,t,n){const i=[],r=n||rAe,s=e.length-1;for(let o=0;ot[0];if(s===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=hYe(t,i,r),c=l.length,u=d=>{if(o&&d1)for(;fu(Wp(e[0],e[s-1],d)):u}function mYe(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const r=Hw(0,t,i);e.push(ea(n,1,r))}}function gYe(e){const t=[0];return mYe(t,e.length-1),t}function bYe(e,t){return e.map(n=>n*t)}function yYe(e,t){return e.map(()=>t||oAe).splice(0,e.length-1)}function VR({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const r=dYe(i)?i.map(VY):VY(i),s={done:!1,value:t[0]},o=bYe(n&&n.length===t.length?n:gYe(t),e),l=pYe(o,t,{ease:Array.isArray(r)?r:yYe(t,r)});return{calculatedDuration:e,next:c=>(s.value=l(c),s.done=c>=e,s)}}const vYe=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Is.update(t,!0),stop:()=>Wg(t),now:()=>Go.isProcessing?Go.timestamp:mh.now()}},xYe={decay:zY,inertia:zY,tween:VR,keyframes:VR,spring:aAe},wYe=e=>e/100;class cz extends tAe{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:c}=this.options;c&&c()};const{name:n,motionValue:i,element:r,keyframes:s}=this.options,o=(r==null?void 0:r.KeyframeResolver)||oz,l=(c,u)=>this.onKeyframesResolved(c,u);this.resolver=new o(s,l,n,i,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:s,velocity:o=0}=this.options,l=ez(n)?n:xYe[n]||VR;let c,u;l!==VR&&typeof t[0]!="number"&&(c=PA(wYe,rAe(t[0],t[1])),t=[0,100]);const d=l({...this.options,keyframes:t});s==="mirror"&&(u=l({...this.options,keyframes:[...t].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=nAe(d));const{calculatedDuration:f}=d,h=f+r,m=h*(i+1)-r;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:c,calculatedDuration:f,resolvedDuration:h,totalDuration:m}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:i}=this;if(!i){const{keyframes:E}=this.options;return{done:!0,value:E[E.length-1]}}const{finalKeyframe:r,generator:s,mirroredGenerator:o,mapPercentToKeyframes:l,keyframes:c,calculatedDuration:u,totalDuration:d,resolvedDuration:f}=i;if(this.startTime===null)return s.next(0);const{delay:h,repeat:m,repeatType:g,repeatDelay:b,onUpdate:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const y=this.currentTime-h*(this.speed>=0?1:-1),w=this.speed>=0?y<0:y>d;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let x=this.currentTime,O=s;if(m){const E=Math.min(this.currentTime,d)/f;let j=Math.floor(E),T=E%1;!T&&E>=1&&(T=1),T===1&&j--,j=Math.min(j,m+1),!!(j%2)&&(g==="reverse"?(T=1-T,b&&(T-=b/f)):g==="mirror"&&(O=o)),x=Wp(0,1,T)*f}const k=w?{done:!1,value:c[0]}:O.next(x);l&&(k.value=l(k.value));let{done:S}=k;!w&&u!==null&&(S=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&S);return C&&r!==void 0&&(k.value=kD(c,this.options,r)),v&&v(k.value),C&&this.finish(),k}get duration(){const{resolved:t}=this;return t?Rp(t.calculatedDuration):0}get time(){return Rp(this.currentTime)}set time(t){t=Np(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Rp(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=vYe,onPlay:n,startTime:i}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),n&&n();const r=this.driver.now();this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=r):this.startTime=i??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const OYe=new Set(["opacity","clipPath","filter","transform"]);function kYe(e,t,n,{delay:i=0,duration:r=300,repeat:s=0,repeatType:o="loop",ease:l="easeInOut",times:c}={}){const u={[t]:n};c&&(u.offset=c);const d=RCe(l,r);return Array.isArray(d)&&(u.easing=d),e.animate(u,{delay:i,duration:r,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}const SYe=JQ(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),HR=10,EYe=2e4;function CYe(e){return ez(e.type)||e.type==="spring"||!NCe(e.ease)}function AYe(e,t){const n=new cz({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let i={done:!1,value:e[0]};const r=[];let s=0;for(;!i.done&&sthis.onKeyframesResolved(o,l),n,i,r),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:i=300,times:r,ease:s,type:o,motionValue:l,name:c,startTime:u}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof s=="string"&&QR()&&TYe(s)&&(s=lAe[s]),CYe(this.options)){const{onComplete:f,onUpdate:h,motionValue:m,element:g,...b}=this.options,v=AYe(t,b);t=v.keyframes,t.length===1&&(t[1]=t[0]),i=v.duration,r=v.times,s=v.ease,o="keyframes"}const d=kYe(l.owner.current,c,t,{...this.options,duration:i,times:r,ease:s});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(IY(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;l.set(kD(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:i,times:r,type:o,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return Rp(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Rp(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:i}=n;i.currentTime=Np(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:i}=n;i.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return Tu;const{animation:i}=n;IY(i,t)}return Tu}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:i,duration:r,type:s,ease:o,times:l}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:d,onComplete:f,element:h,...m}=this.options,g=new cz({...m,keyframes:i,duration:r,type:s,ease:o,times:l,isGenerator:!0}),b=Np(this.time);u.setWithVelocity(g.sample(b-HR).value,g.sample(b).value,HR)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:i,repeatDelay:r,repeatType:s,damping:o,type:l}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=n.owner.getProps();return SYe()&&i&&OYe.has(i)&&!c&&!u&&!r&&s!=="mirror"&&o!==0&&l!=="inertia"}}const _Ye={type:"spring",stiffness:500,damping:25,restSpeed:10},jYe=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),NYe={type:"keyframes",duration:.8},RYe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},IYe=(e,{keyframes:t})=>t.length>2?NYe:F0.has(e)?e.startsWith("scale")?jYe(t[1]):_Ye:RYe;function PYe({when:e,delay:t,delayChildren:n,staggerChildren:i,staggerDirection:r,repeat:s,repeatType:o,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const uz=(e,t,n,i={},r,s)=>o=>{const l=GQ(i,e)||{},c=l.delay||i.delay||0;let{elapsed:u=0}=i;u=u-Np(c);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:h=>{t.set(h),l.onUpdate&&l.onUpdate(h)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:s?void 0:r};PYe(l)||(d={...d,...IYe(e,d)}),d.duration&&(d.duration=Np(d.duration)),d.repeatDelay&&(d.repeatDelay=Np(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(f=!0)),f&&!s&&t.get()!==void 0){const h=kD(d.keyframes,l);if(h!==void 0)return Is.update(()=>{d.onUpdate(h),d.onComplete()}),new fXe([])}return!s&&HY.supports(d)?new HY(d):new cz(d)};function DYe({protectedKeys:e,needsAnimating:t},n){const i=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,i}function cAe(e,t,{delay:n=0,transitionOverride:i,type:r}={}){var s;let{transition:o=e.getDefaultTransition(),transitionEnd:l,...c}=t;i&&(o=i);const u=[],d=r&&e.animationState&&e.animationState.getState()[r];for(const f in c){const h=e.getValue(f,(s=e.latestValues[f])!==null&&s!==void 0?s:null),m=c[f];if(m===void 0||d&&DYe(d,f))continue;const g={delay:n,...GQ(o||{},f)};let b=!1;if(window.MotionHandoffAnimation){const y=_Ce(e);if(y){const w=window.MotionHandoffAnimation(y,f,Is);w!==null&&(g.startTime=w,b=!0)}}f8(e,f),h.start(uz(f,h,m,e.shouldReduceMotion&&ACe.has(f)?{type:!1}:g,e,b));const v=h.animation;v&&u.push(v)}return l&&Promise.all(u).then(()=>{Is.update(()=>{l&&lXe(e,l)})}),u}function w8(e,t,n={}){var i;const r=OD(e,t,n.type==="exit"?(i=e.presenceContext)===null||i===void 0?void 0:i.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const o=r?()=>Promise.all(cAe(e,r,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=s;return MYe(e,t,d+u,f,h,n)}:()=>Promise.resolve(),{when:c}=s;if(c){const[u,d]=c==="beforeChildren"?[o,l]:[l,o];return u().then(()=>d())}else return Promise.all([o(),l(n.delay)])}function MYe(e,t,n=0,i=0,r=1,s){const o=[],l=(e.variantChildren.size-1)*i,c=r===1?(u=0)=>u*i:(u=0)=>l-u*i;return Array.from(e.variantChildren).sort(LYe).forEach((u,d)=>{u.notify("AnimationStart",t),o.push(w8(u,t,{...s,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(o)}function LYe(e,t){return e.sortNodePosition(t)}function $Ye(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const r=t.map(s=>w8(e,s,n));i=Promise.all(r)}else if(typeof t=="string")i=w8(e,t,n);else{const r=typeof t=="function"?OD(e,t,n.custom):t;i=Promise.all(cAe(e,r,n))}return i.then(()=>{e.notify("AnimationComplete",t)})}const FYe=LQ.length;function uAe(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?uAe(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;nPromise.all(t.map(({animation:n,options:i})=>$Ye(e,n,i)))}function zYe(e){let t=QYe(e),n=qY(),i=!0;const r=c=>(u,d)=>{var f;const h=OD(e,d,c==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:m,transitionEnd:g,...b}=h;u={...u,...b,...g}}return u};function s(c){t=c(e)}function o(c){const{props:u}=e,d=uAe(e.parent)||{},f=[],h=new Set;let m={},g=1/0;for(let v=0;vg&&O,j=!1;const T=Array.isArray(x)?x:[x];let R=T.reduce(r(y),{});k===!1&&(R={});const{prevResolvedValues:A={}}=w,N={...A,...R},P=_=>{E=!0,h.has(_)&&(j=!0,h.delete(_)),w.needsAnimating[_]=!0;const L=e.getValue(_);L&&(L.liveStyle=!1)};for(const _ in N){const L=R[_],F=A[_];if(m.hasOwnProperty(_))continue;let M=!1;d8(L)&&d8(F)?M=!CCe(L,F):M=L!==F,M?L!=null?P(_):h.add(_):L!==void 0&&h.has(_)?P(_):w.protectedKeys[_]=!0}w.prevProp=x,w.prevResolvedValues=R,w.isActive&&(m={...m,...R}),i&&e.blockInitialAnimation&&(E=!1),E&&(!(S&&C)||j)&&f.push(...T.map(_=>({animation:_,options:{type:y}})))}if(h.size){const v={};h.forEach(y=>{const w=e.getBaseTarget(y),x=e.getValue(y);x&&(x.liveStyle=!0),v[y]=w??null}),f.push({animation:v})}let b=!!f.length;return i&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(b=!1),i=!1,b?t(f):Promise.resolve()}function l(c,u){var d;if(n[c].isActive===u)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(h=>{var m;return(m=h.animationState)===null||m===void 0?void 0:m.setActive(c,u)}),n[c].isActive=u;const f=o(c);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:o,setActive:l,setAnimateFunction:s,getState:()=>n,reset:()=>{n=qY(),i=!0}}}function VYe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!CCe(t,e):!1}function qb(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function qY(){return{animate:qb(!0),whileInView:qb(),whileHover:qb(),whileTap:qb(),whileDrag:qb(),whileFocus:qb(),exit:qb()}}class kb{constructor(t){this.isMounted=!1,this.node=t}update(){}}class HYe extends kb{constructor(t){super(t),t.animationState||(t.animationState=zYe(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();xD(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let qYe=0;class WYe extends kb{constructor(){super(...arguments),this.id=qYe++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;const r=this.node.animationState.setActive("exit",!t);n&&!t&&r.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const KYe={animation:{Feature:HYe},exit:{Feature:WYe}},Yd={x:!1,y:!1};function dAe(){return Yd.x||Yd.y}function GYe(e){return e==="x"||e==="y"?Yd[e]?null:(Yd[e]=!0,()=>{Yd[e]=!1}):Yd.x||Yd.y?null:(Yd.x=Yd.y=!0,()=>{Yd.x=Yd.y=!1})}const dz=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function nC(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}function DA(e){return{point:{x:e.pageX,y:e.pageY}}}const XYe=e=>t=>dz(t)&&e(t,DA(t));function KS(e,t,n,i){return nC(e,t,XYe(n),i)}const WY=(e,t)=>Math.abs(e-t);function YYe(e,t){const n=WY(e.x,t.x),i=WY(e.y,t.y);return Math.sqrt(n**2+i**2)}class fAe{constructor(t,n,{transformPagePoint:i,contextWindow:r,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=m3(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,m=YYe(f.offset,{x:0,y:0})>=3;if(!h&&!m)return;const{point:g}=f,{timestamp:b}=Go;this.history.push({...g,timestamp:b});const{onStart:v,onMove:y}=this.handlers;h||(v&&v(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=p3(h,this.transformPagePoint),Is.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{this.end();const{onEnd:m,onSessionEnd:g,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=m3(f.type==="pointercancel"?this.lastMoveEventInfo:p3(h,this.transformPagePoint),this.history);this.startEvent&&m&&m(f,v),g&&g(f,v)},!dz(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=i,this.contextWindow=r||window;const o=DA(t),l=p3(o,this.transformPagePoint),{point:c}=l,{timestamp:u}=Go;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,m3(l,this.history)),this.removeListeners=PA(KS(this.contextWindow,"pointermove",this.handlePointerMove),KS(this.contextWindow,"pointerup",this.handlePointerUp),KS(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Wg(this.updatePoint)}}function p3(e,t){return t?{point:t(e.point)}:e}function KY(e,t){return{x:e.x-t.x,y:e.y-t.y}}function m3({point:e},t){return{point:e,delta:KY(e,hAe(t)),offset:KY(e,ZYe(t)),velocity:JYe(t,.1)}}function ZYe(e){return e[0]}function hAe(e){return e[e.length-1]}function JYe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const r=hAe(e);for(;n>=0&&(i=e[n],!(r.timestamp-i.timestamp>Np(t)));)n--;if(!i)return{x:0,y:0};const s=Rp(r.timestamp-i.timestamp);if(s===0)return{x:0,y:0};const o={x:(r.x-i.x)/s,y:(r.y-i.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const pAe=1e-4,eZe=1-pAe,tZe=1+pAe,mAe=.01,nZe=0-mAe,iZe=0+mAe;function Du(e){return e.max-e.min}function rZe(e,t,n){return Math.abs(e-t)<=n}function GY(e,t,n,i=.5){e.origin=i,e.originPoint=ea(t.min,t.max,e.origin),e.scale=Du(n)/Du(t),e.translate=ea(n.min,n.max,e.origin)-e.originPoint,(e.scale>=eZe&&e.scale<=tZe||isNaN(e.scale))&&(e.scale=1),(e.translate>=nZe&&e.translate<=iZe||isNaN(e.translate))&&(e.translate=0)}function GS(e,t,n,i){GY(e.x,t.x,n.x,i?i.originX:void 0),GY(e.y,t.y,n.y,i?i.originY:void 0)}function XY(e,t,n){e.min=n.min+t.min,e.max=e.min+Du(t)}function sZe(e,t,n){XY(e.x,t.x,n.x),XY(e.y,t.y,n.y)}function YY(e,t,n){e.min=t.min-n.min,e.max=e.min+Du(t)}function XS(e,t,n){YY(e.x,t.x,n.x),YY(e.y,t.y,n.y)}function aZe(e,{min:t,max:n},i){return t!==void 0&&en&&(e=i?ea(n,e,i.max):Math.min(e,n)),e}function ZY(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function oZe(e,{top:t,left:n,bottom:i,right:r}){return{x:ZY(e.x,n,r),y:ZY(e.y,t,i)}}function JY(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.mini?n=Hw(t.min,t.max-i,e.min):i>r&&(n=Hw(e.min,e.max-r,t.min)),Wp(0,1,n)}function uZe(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const O8=.35;function dZe(e=O8){return e===!1?e=0:e===!0&&(e=O8),{x:eZ(e,"left","right"),y:eZ(e,"top","bottom")}}function eZ(e,t,n){return{min:tZ(e,t),max:tZ(e,n)}}function tZ(e,t){return typeof e=="number"?e:e[t]||0}const nZ=()=>({translate:0,scale:1,origin:0,originPoint:0}),Rx=()=>({x:nZ(),y:nZ()}),iZ=()=>({min:0,max:0}),ya=()=>({x:iZ(),y:iZ()});function Yu(e){return[e("x"),e("y")]}function gAe({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function fZe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function hZe(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function g3(e){return e===void 0||e===1}function k8({scale:e,scaleX:t,scaleY:n}){return!g3(e)||!g3(t)||!g3(n)}function cy(e){return k8(e)||bAe(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function bAe(e){return rZ(e.x)||rZ(e.y)}function rZ(e){return e&&e!=="0%"}function qR(e,t,n){const i=e-n,r=t*i;return n+r}function sZ(e,t,n,i,r){return r!==void 0&&(e=qR(e,r,i)),qR(e,n,i)+t}function S8(e,t=0,n=1,i,r){e.min=sZ(e.min,t,n,i,r),e.max=sZ(e.max,t,n,i,r)}function yAe(e,{x:t,y:n}){S8(e.x,t.translate,t.scale,t.originPoint),S8(e.y,n.translate,n.scale,n.originPoint)}const aZ=.999999999999,oZ=1.0000000000001;function pZe(e,t,n,i=!1){const r=n.length;if(!r)return;t.x=t.y=1;let s,o;for(let l=0;laZ&&(t.x=1),t.yaZ&&(t.y=1)}function Ix(e,t){e.min=e.min+t,e.max=e.max+t}function lZ(e,t,n,i,r=.5){const s=ea(e.min,e.max,r);S8(e,t,n,s,i)}function Px(e,t){lZ(e.x,t.x,t.scaleX,t.scale,t.originX),lZ(e.y,t.y,t.scaleY,t.scale,t.originY)}function vAe(e,t){return gAe(hZe(e.getBoundingClientRect(),t))}function mZe(e,t,n){const i=vAe(e,n),{scroll:r}=t;return r&&(Ix(i.x,r.offset.x),Ix(i.y,r.offset.y)),i}const xAe=({current:e})=>e?e.ownerDocument.defaultView:null,gZe=new WeakMap;class bZe{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ya(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(DA(d).point)},s=(d,f)=>{const{drag:h,dragPropagation:m,onDragStart:g}=this.getProps();if(h&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=GYe(h),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Yu(v=>{let y=this.getAxisMotionValue(v).get()||0;if(ph.test(y)){const{projection:w}=this.visualElement;if(w&&w.layout){const x=w.layout.layoutBox[v];x&&(y=Du(x)*(parseFloat(y)/100))}}this.originPoint[v]=y}),g&&Is.postRender(()=>g(d,f)),f8(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},o=(d,f)=>{const{dragPropagation:h,dragDirectionLock:m,onDirectionLock:g,onDrag:b}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:v}=f;if(m&&this.currentDirection===null){this.currentDirection=yZe(v),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,v),this.updateAxis("y",f.point,v),this.visualElement.render(),b&&b(d,f)},l=(d,f)=>this.stop(d,f),c=()=>Yu(d=>{var f;return this.getAnimationState(d)==="paused"&&((f=this.getAxisMotionValue(d).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new fAe(t,{onSessionStart:r,onStart:s,onMove:o,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:xAe(this.visualElement)})}stop(t,n){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:r}=n;this.startAnimation(r);const{onDragEnd:s}=this.getProps();s&&Is.postRender(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,i){const{drag:r}=this.getProps();if(!i||!K2(t,r,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(o=aZe(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:i}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,s=this.constraints;n&&jx(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&r?this.constraints=oZe(r.layoutBox,n):this.constraints=!1,this.elastic=dZe(i),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Yu(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=uZe(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!jx(t))return!1;const i=t.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const s=mZe(i,r.root,this.visualElement.getTransformPagePoint());let o=lZe(r.layout.layoutBox,s);if(n){const l=n(fZe(o));this.hasMutatedConstraints=!!l,l&&(o=gAe(l))}return o}startAnimation(t){const{drag:n,dragMomentum:i,dragElastic:r,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Yu(d=>{if(!K2(d,n,this.currentDirection))return;let f=c&&c[d]||{};o&&(f={min:0,max:0});const h=r?200:1e6,m=r?40:1e7,g={type:"inertia",velocity:i?t[d]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(d,g)});return Promise.all(u).then(l)}startAxisValueAnimation(t,n){const i=this.getAxisMotionValue(t);return f8(this.visualElement,t),i.start(uz(t,i,0,n,this.visualElement,!1))}stopAnimation(){Yu(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Yu(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps(),r=i[n];return r||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){Yu(n=>{const{drag:i}=this.getProps();if(!K2(n,i,this.currentDirection))return;const{projection:r}=this.visualElement,s=this.getAxisMotionValue(n);if(r&&r.layout){const{min:o,max:l}=r.layout.layoutBox[n];s.set(t[n]-ea(o,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!jx(n)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Yu(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();r[o]=cZe({min:c,max:c},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),Yu(o=>{if(!K2(o,t,null))return;const l=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];l.set(ea(c,u,r[o]))})}addListeners(){if(!this.visualElement.current)return;gZe.set(this.visualElement,this);const t=this.visualElement.current,n=KS(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),i=()=>{const{dragConstraints:c}=this.getProps();jx(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,s=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),Is.read(i);const o=nC(window,"resize",()=>this.scalePositionWithinConstraints()),l=r.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Yu(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=c[d].translate,f.set(f.get()+c[d].translate))}),this.visualElement.render())});return()=>{o(),n(),s(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:s=!1,dragElastic:o=O8,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:r,dragConstraints:s,dragElastic:o,dragMomentum:l}}}function K2(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function yZe(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class vZe extends kb{constructor(t){super(t),this.removeGroupControls=Tu,this.removeListeners=Tu,this.controls=new bZe(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Tu}unmount(){this.removeGroupControls(),this.removeListeners()}}const cZ=e=>(t,n)=>{e&&Is.postRender(()=>e(t,n))};class xZe extends kb{constructor(){super(...arguments),this.removePointerDownListener=Tu}onPointerDown(t){this.session=new fAe(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:xAe(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:cZ(t),onStart:cZ(n),onMove:i,onEnd:(s,o)=>{delete this.session,r&&Is.postRender(()=>r(s,o))}}}mount(){this.removePointerDownListener=KS(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const sN={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function uZ(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const sk={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Gn.test(e))e=parseFloat(e);else return e;const n=uZ(e,t.target.x),i=uZ(e,t.target.y);return`${n}% ${i}%`}},wZe={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,r=Kg.parse(e);if(r.length>5)return i;const s=Kg.createTransformer(e),o=typeof r[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;r[0+o]/=l,r[1+o]/=c;const u=ea(l,c,.5);return typeof r[2+o]=="number"&&(r[2+o]/=u),typeof r[3+o]=="number"&&(r[3+o]/=u),s(r)}};class OZe extends p.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i,layoutId:r}=this.props,{projection:s}=t;KGe(kZe),s&&(n.group&&n.group.add(s),i&&i.register&&r&&i.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),sN.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:i,drag:r,isPresent:s}=this.props,o=i.projection;return o&&(o.isPresent=s,r||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||Is.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),FQ.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:r}=t;r&&(r.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(r),i&&i.deregister&&i.deregister(r))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function wAe(e){const[t,n]=rCe(),i=p.useContext(PQ);return a.jsx(OZe,{...e,layoutGroup:i,switchLayoutGroup:p.useContext(hCe),isPresent:t,safeToRemove:n})}const kZe={borderRadius:{...sk,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:sk,borderTopRightRadius:sk,borderBottomLeftRadius:sk,borderBottomRightRadius:sk,boxShadow:wZe};function SZe(e,t,n){const i=Al(e)?e:eC(e);return i.start(uz("",i,t,n)),i.animation}function EZe(e){return e instanceof SVGElement&&e.tagName!=="svg"}const CZe=(e,t)=>e.depth-t.depth;class AZe{constructor(){this.children=[],this.isDirty=!1}add(t){XQ(this.children,t),this.isDirty=!0}remove(t){YQ(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(CZe),this.isDirty=!1,this.children.forEach(t)}}function TZe(e,t){const n=mh.now(),i=({timestamp:r})=>{const s=r-n;s>=t&&(Wg(i),e(s-t))};return Is.read(i,!0),()=>Wg(i)}const OAe=["TopLeft","TopRight","BottomLeft","BottomRight"],_Ze=OAe.length,dZ=e=>typeof e=="string"?parseFloat(e):e,fZ=e=>typeof e=="number"||Gn.test(e);function jZe(e,t,n,i,r,s){r?(e.opacity=ea(0,n.opacity!==void 0?n.opacity:1,NZe(i)),e.opacityExit=ea(t.opacity!==void 0?t.opacity:1,0,RZe(i))):s&&(e.opacity=ea(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,i));for(let o=0;o<_Ze;o++){const l=`border${OAe[o]}Radius`;let c=hZ(t,l),u=hZ(n,l);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||fZ(c)===fZ(u)?(e[l]=Math.max(ea(dZ(c),dZ(u),i),0),(ph.test(u)||ph.test(c))&&(e[l]+="%")):e[l]=u}(t.rotate||n.rotate)&&(e.rotate=ea(t.rotate||0,n.rotate||0,i))}function hZ(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const NZe=kAe(0,.5,FCe),RZe=kAe(.5,.95,Tu);function kAe(e,t,n){return i=>it?1:n(Hw(e,t,i))}function pZ(e,t){e.min=t.min,e.max=t.max}function Xu(e,t){pZ(e.x,t.x),pZ(e.y,t.y)}function mZ(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function gZ(e,t,n,i,r){return e-=t,e=qR(e,1/n,i),r!==void 0&&(e=qR(e,1/r,i)),e}function IZe(e,t=0,n=1,i=.5,r,s=e,o=e){if(ph.test(t)&&(t=parseFloat(t),t=ea(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=ea(s.min,s.max,i);e===s&&(l-=t),e.min=gZ(e.min,t,n,l,r),e.max=gZ(e.max,t,n,l,r)}function bZ(e,t,[n,i,r],s,o){IZe(e,t[n],t[i],t[r],t.scale,s,o)}const PZe=["x","scaleX","originX"],DZe=["y","scaleY","originY"];function yZ(e,t,n,i){bZ(e.x,t,PZe,n?n.x:void 0,i?i.x:void 0),bZ(e.y,t,DZe,n?n.y:void 0,i?i.y:void 0)}function vZ(e){return e.translate===0&&e.scale===1}function SAe(e){return vZ(e.x)&&vZ(e.y)}function xZ(e,t){return e.min===t.min&&e.max===t.max}function MZe(e,t){return xZ(e.x,t.x)&&xZ(e.y,t.y)}function wZ(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function EAe(e,t){return wZ(e.x,t.x)&&wZ(e.y,t.y)}function OZ(e){return Du(e.x)/Du(e.y)}function kZ(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class LZe{constructor(){this.members=[]}add(t){XQ(this.members,t),t.scheduleRender()}remove(t){if(YQ(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(r=>t===r);if(n===0)return!1;let i;for(let r=n;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1){i=s;break}}return i?(this.promote(i),!0):!1}promote(t,n){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,n&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:r}=t.options;r===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:i}=t;n.onExitComplete&&n.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function $Ze(e,t,n){let i="";const r=e.x.translate/t.x,s=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((r||s||o)&&(i=`translate3d(${r}px, ${s}px, ${o}px) `),(t.x!==1||t.y!==1)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:h,skewX:m,skewY:g}=n;u&&(i=`perspective(${u}px) ${i}`),d&&(i+=`rotate(${d}deg) `),f&&(i+=`rotateX(${f}deg) `),h&&(i+=`rotateY(${h}deg) `),m&&(i+=`skewX(${m}deg) `),g&&(i+=`skewY(${g}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(i+=`scale(${l}, ${c})`),i||"none"}const uy={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},aS=typeof window<"u"&&window.MotionDebug!==void 0,b3=["","X","Y","Z"],FZe={visibility:"hidden"},SZ=1e3;let BZe=0;function y3(e,t,n,i){const{latestValues:r}=t;r[e]&&(n[e]=r[e],t.setStaticValue(e,0),i&&(i[e]=0))}function CAe(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=_Ce(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:r,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Is,!(r||s))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&CAe(i)}function AAe({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(o={},l=t==null?void 0:t()){this.id=BZe++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,aS&&(uy.totalNodes=uy.resolvedTargetDeltas=uy.recalculatedProjection=0),this.nodes.forEach(zZe),this.nodes.forEach(KZe),this.nodes.forEach(GZe),this.nodes.forEach(VZe),aS&&window.MotionDebug.record(uy)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;cthis.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=TZe(h,250),sN.hasAnimatedSinceResize&&(sN.hasAnimatedSinceResize=!1,this.nodes.forEach(CZ))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&d&&(c||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeTargetChanged:m,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||d.getDefaultTransition()||eJe,{onLayoutAnimationStart:v,onLayoutAnimationComplete:y}=d.getProps(),w=!this.targetLayout||!EAe(this.targetLayout,g)||m,x=!h&&m;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||h&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,x);const O={...GQ(b,"layout"),onPlay:v,onComplete:y};(d.shouldReduceMotion||this.options.layoutRoot)&&(O.delay=0,O.type=!1),this.startAnimation(O)}else h||CZ(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Wg(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(XZe),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&CAe(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c{const k=O/1e3;AZ(f.x,o.x,k),AZ(f.y,o.y,k),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(XS(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),ZZe(this.relativeTarget,this.relativeTargetOrigin,h,k),x&&MZe(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=ya()),Xu(x,this.relativeTarget)),b&&(this.animationValues=d,jZe(d,u,this.latestValues,k,w,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=k},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Wg(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Is.update(()=>{sN.hasAnimatedSinceResize=!0,this.currentAnimation=SZe(0,SZ,{...o,onUpdate:l=>{this.mixTargetDelta(l),o.onUpdate&&o.onUpdate(l)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(SZ),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=o;if(!(!l||!c||!u)){if(this!==o&&this.layout&&u&&TAe(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||ya();const f=Du(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+f;const h=Du(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+h}Xu(l,c),Px(l,d),GS(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new LZe),this.sharedNodes.get(o).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:l}=this.options;return l?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:l}=this.options;return l?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&y3("z",o,u,this.animationValues);for(let d=0;d{var l;return(l=o.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach(EZ),this.root.sharedNodes.clear()}}}function UZe(e){e.updateLayout()}function QZe(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:r}=e.layout,{animationType:s}=e.options,o=n.source!==e.layout.source;s==="size"?Yu(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=Du(h);h.min=i[f].min,h.max=h.min+m}):TAe(s,n.layoutBox,i)&&Yu(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=Du(i[f]);h.max=h.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+m)});const l=Rx();GS(l,i,n.layoutBox);const c=Rx();o?GS(c,e.applyTransform(r,!0),n.measuredBox):GS(c,i,n.layoutBox);const u=!SAe(l);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:m}=f;if(h&&m){const g=ya();XS(g,n.layoutBox,h.layoutBox);const b=ya();XS(b,i,m.layoutBox),EAe(g,b)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=b,e.relativeTargetOrigin=g,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:i,snapshot:n,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:i}=e.options;i&&i()}e.options.transition=void 0}function zZe(e){aS&&uy.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function VZe(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function HZe(e){e.clearSnapshot()}function EZ(e){e.clearMeasurements()}function qZe(e){e.isLayoutDirty=!1}function WZe(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function CZ(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function KZe(e){e.resolveTargetDelta()}function GZe(e){e.calcProjection()}function XZe(e){e.resetSkewAndRotation()}function YZe(e){e.removeLeadSnapshot()}function AZ(e,t,n){e.translate=ea(t.translate,0,n),e.scale=ea(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function TZ(e,t,n,i){e.min=ea(t.min,n.min,i),e.max=ea(t.max,n.max,i)}function ZZe(e,t,n,i){TZ(e.x,t.x,n.x,i),TZ(e.y,t.y,n.y,i)}function JZe(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const eJe={duration:.45,ease:[.4,0,.1,1]},_Z=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),jZ=_Z("applewebkit/")&&!_Z("chrome/")?Math.round:Tu;function NZ(e){e.min=jZ(e.min),e.max=jZ(e.max)}function tJe(e){NZ(e.x),NZ(e.y)}function TAe(e,t,n){return e==="position"||e==="preserve-aspect"&&!rZe(OZ(t),OZ(n),.2)}function nJe(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const iJe=AAe({attachResizeListener:(e,t)=>nC(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),v3={current:void 0},_Ae=AAe({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!v3.current){const e=new iJe({});e.mount(window),e.setOptions({layoutScroll:!0}),v3.current=e}return v3.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),rJe={pan:{Feature:xZe},drag:{Feature:vZe,ProjectionNode:_Ae,MeasureLayout:wAe}};function sJe(e,t,n){var i;if(e instanceof Element)return[e];if(typeof e=="string"){let r=document;const s=(i=void 0)!==null&&i!==void 0?i:r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}function jAe(e,t){const n=sJe(e),i=new AbortController,r={passive:!0,...t,signal:i.signal};return[n,r,()=>i.abort()]}function RZ(e){return t=>{t.pointerType==="touch"||dAe()||e(t)}}function aJe(e,t,n={}){const[i,r,s]=jAe(e,n),o=RZ(l=>{const{target:c}=l,u=t(l);if(typeof u!="function"||!c)return;const d=RZ(f=>{u(f),c.removeEventListener("pointerleave",d)});c.addEventListener("pointerleave",d,r)});return i.forEach(l=>{l.addEventListener("pointerenter",o,r)}),s}function IZ(e,t,n){const{props:i}=e;e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,s=i[r];s&&Is.postRender(()=>s(t,DA(t)))}class oJe extends kb{mount(){const{current:t}=this.node;t&&(this.unmount=aJe(t,n=>(IZ(this.node,n,"Start"),i=>IZ(this.node,i,"End"))))}unmount(){}}class lJe extends kb{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=PA(nC(this.node.current,"focus",()=>this.onFocus()),nC(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const NAe=(e,t)=>t?e===t?!0:NAe(e,t.parentElement):!1,cJe=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function uJe(e){return cJe.has(e.tagName)||e.tabIndex!==-1}const oS=new WeakSet;function PZ(e){return t=>{t.key==="Enter"&&e(t)}}function x3(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const dJe=(e,t)=>{const n=e.currentTarget;if(!n)return;const i=PZ(()=>{if(oS.has(n))return;x3(n,"down");const r=PZ(()=>{x3(n,"up")}),s=()=>x3(n,"cancel");n.addEventListener("keyup",r,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",i,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),t)};function DZ(e){return dz(e)&&!dAe()}function fJe(e,t,n={}){const[i,r,s]=jAe(e,n),o=l=>{const c=l.currentTarget;if(!DZ(l)||oS.has(c))return;oS.add(c);const u=t(l),d=(m,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!DZ(m)||!oS.has(c))&&(oS.delete(c),typeof u=="function"&&u(m,{success:g}))},f=m=>{d(m,n.useGlobalTarget||NAe(c,m.target))},h=m=>{d(m,!1)};window.addEventListener("pointerup",f,r),window.addEventListener("pointercancel",h,r)};return i.forEach(l=>{!uJe(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0),(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,r),l.addEventListener("focus",u=>dJe(u,r),r)}),s}function MZ(e,t,n){const{props:i}=e;e.animationState&&i.whileTap&&e.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),s=i[r];s&&Is.postRender(()=>s(t,DA(t)))}class hJe extends kb{mount(){const{current:t}=this.node;t&&(this.unmount=fJe(t,n=>(MZ(this.node,n,"Start"),(i,{success:r})=>MZ(this.node,i,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const E8=new WeakMap,w3=new WeakMap,pJe=e=>{const t=E8.get(e.target);t&&t(e)},mJe=e=>{e.forEach(pJe)};function gJe({root:e,...t}){const n=e||document;w3.has(n)||w3.set(n,{});const i=w3.get(n),r=JSON.stringify(t);return i[r]||(i[r]=new IntersectionObserver(mJe,{root:e,...t})),i[r]}function bJe(e,t,n){const i=gJe(t);return E8.set(e,n),i.observe(e),()=>{E8.delete(e),i.unobserve(e)}}const yJe={some:0,all:1};class vJe extends kb{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:i,amount:r="some",once:s}=t,o={root:n?n.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:yJe[r]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,s&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),h=u?d:f;h&&h(c)};return bJe(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(xJe(t,n))&&this.startObserver()}unmount(){}}function xJe({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const wJe={inView:{Feature:vJe},tap:{Feature:hJe},focus:{Feature:lJe},hover:{Feature:oJe}},OJe={layout:{ProjectionNode:_Ae,MeasureLayout:wAe}},WR={current:null},fz={current:!1};function RAe(){if(fz.current=!0,!!DQ)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>WR.current=e.matches;e.addListener(t),t()}else WR.current=!1}const kJe=[...JCe,Sl,Kg],SJe=e=>kJe.find(ZCe(e)),LZ=new WeakMap;function EJe(e,t,n){for(const i in t){const r=t[i],s=n[i];if(Al(r))e.addValue(i,r);else if(Al(s))e.addValue(i,eC(r,{owner:e}));else if(s!==r)if(e.hasValue(i)){const o=e.getValue(i);o.liveStyle===!0?o.jump(r):o.hasAnimated||o.set(r)}else{const o=e.getStaticValue(i);e.addValue(i,eC(o!==void 0?o:r,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const $Z=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class CJe{scrapeMotionValuesFromProps(t,n,i){return{}}constructor({parent:t,props:n,presenceContext:i,reducedMotionConfig:r,blockInitialAnimation:s,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=oz,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const m=mh.now();this.renderScheduledAtthis.bindToMotionValue(i,n)),fz.current||RAe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:WR.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){LZ.delete(this.current),this.projection&&this.projection.unmount(),Wg(this.notifyUpdate),Wg(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const i=F0.has(t),r=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&Is.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{r(),s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Vw){const n=Vw[t];if(!n)continue;const{isEnabled:i,Feature:r}=n;if(!this.features[t]&&r&&i(this.props)&&(this.features[t]=new r(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ya()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let i=0;i<$Z.length;i++){const r=$Z[i];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const s="on"+r,o=t[s];o&&(this.propEventSubscriptions[r]=this.on(r,o))}this.prevMotionValues=EJe(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const i=this.values.get(t);n!==i&&(i&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return i===void 0&&n!==void 0&&(i=eC(n===null?void 0:n,{owner:this}),this.addValue(t,i)),i}readValue(t,n){var i;let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(i=this.getBaseTargetFromProps(this.props,t))!==null&&i!==void 0?i:this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(XCe(r)||UCe(r))?r=parseFloat(r):!SJe(r)&&Kg.test(n)&&(r=WCe(t,n)),this.setBaseTarget(t,Al(r)?r.get():r)),Al(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:i}=this.props;let r;if(typeof i=="string"||typeof i=="object"){const o=UQ(this.props,i,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(r=o[t])}if(i&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Al(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new ZQ),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class IAe extends CJe{constructor(){super(...arguments),this.KeyframeResolver=eAe}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:i}){delete n[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Al(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function AJe(e){return window.getComputedStyle(e)}class TJe extends IAe{constructor(){super(...arguments),this.type="html",this.renderInstance=xCe}readValueFromInstance(t,n){if(F0.has(n)){const i=az(n);return i&&i.default||0}else{const i=AJe(t),r=(bCe(n)?i.getPropertyValue(n):i[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(t,{transformPagePoint:n}){return vAe(t,n)}build(t,n,i){VQ(t,n,i.transformTemplate)}scrapeMotionValuesFromProps(t,n,i){return KQ(t,n,i)}}class _Je extends IAe{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ya}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(F0.has(n)){const i=az(n);return i&&i.default||0}return n=wCe.has(n)?n:$Q(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,i){return SCe(t,n,i)}build(t,n,i){HQ(t,n,this.isSVGTag,i.transformTemplate)}renderInstance(t,n,i,r){OCe(t,n,i,r)}mount(t){this.isSVGTag=WQ(t.tagName),super.mount(t)}}const jJe=(e,t)=>BQ(e)?new _Je(t):new TJe(t,{allowProjection:e!==p.Fragment}),NJe=iXe({...KYe,...wJe,...rJe,...OJe},jJe),Cr=yGe(NJe);function SD(){!fz.current&&RAe();const[e]=p.useState(WR.current);return e}function oo(){return oo=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||/ServerSideRendering/.test(navigator&&navigator.userAgent)?p.useEffect:p.useLayoutEffect;function ix(e,t,n){var i=p.useRef(t);i.current=t,p.useEffect(function(){function r(s){i.current(s)}return e&&window.addEventListener(e,r,n),function(){e&&window.removeEventListener(e,r)}},[e])}var RJe=["container"];function IJe(e){var t=e.container,n=t===void 0?document.body:t,i=ED(e,RJe);return yi.createPortal(ji.createElement("div",oo({},i)),n)}function PJe(e){return ji.createElement("svg",oo({width:"44",height:"44",viewBox:"0 0 768 768"},e),ji.createElement("path",{d:"M607.5 205.5l-178.5 178.5 178.5 178.5-45 45-178.5-178.5-178.5 178.5-45-45 178.5-178.5-178.5-178.5 45-45 178.5 178.5 178.5-178.5z"}))}function DJe(e){return ji.createElement("svg",oo({width:"44",height:"44",viewBox:"0 0 768 768"},e),ji.createElement("path",{d:"M640.5 352.5v63h-390l178.5 180-45 45-256.5-256.5 256.5-256.5 45 45-178.5 180h390z"}))}function MJe(e){return ji.createElement("svg",oo({width:"44",height:"44",viewBox:"0 0 768 768"},e),ji.createElement("path",{d:"M384 127.5l256.5 256.5-256.5 256.5-45-45 178.5-180h-390v-63h390l-178.5-180z"}))}function LJe(){return p.useEffect(function(){var e=document.body.style,t=e.overflow;return e.overflow="hidden",function(){e.overflow=t}},[]),null}function BZ(e){var t=e.touches[0],n=t.clientX,i=t.clientY;if(e.touches.length>=2){var r=e.touches[1],s=r.clientX,o=r.clientY;return[(n+s)/2,(i+o)/2,Math.sqrt(Math.pow(s-n,2)+Math.pow(o-i,2))]}return[n,i,0]}var Km=function(e,t,n,i){var r,s=n*t,o=(s-i)/2,l=e;return s<=i?(r=1,l=0):e>0&&o-e<=0?(r=2,l=o):e<0&&o+e<=0&&(r=3,l=-o),[r,l]};function O3(e,t,n,i,r,s,o,l,c,u){o===void 0&&(o=innerWidth/2),l===void 0&&(l=innerHeight/2),c===void 0&&(c=0),u===void 0&&(u=0);var d=Km(e,s,n,innerWidth)[0],f=Km(t,s,i,innerHeight),h=innerWidth/2,m=innerHeight/2;return{x:o-s/r*(o-(h+e))-h+(i/n>=3&&n*s===innerWidth?0:d?c/2:c),y:l-s/r*(l-(m+t))-m+(f[0]?u/2:u),lastCX:o,lastCY:l}}function T8(e,t,n){var i=e%180!=0;return i?[n,t,i]:[t,n,i]}function k3(e,t,n){var i=T8(n,innerWidth,innerHeight),r=i[0],s=i[1],o=0,l=r,c=s,u=e/t*s,d=t/e*r;return e=s?l=u:e>=r&&tr/s?c=d:t/e>=3&&!i[2]?o=((c=d)-s)/2:l=u,{width:l,height:c,x:0,y:o,pause:!0}}function X2(e,t){var n=t.leading,i=n!==void 0&&n,r=t.maxWait,s=t.wait,o=s===void 0?r||0:s,l=p.useRef(e);l.current=e;var c=p.useRef(0),u=p.useRef(),d=function(){return u.current&&clearTimeout(u.current)},f=p.useCallback(function(){var h=[].slice.call(arguments),m=Date.now();function g(){c.current=m,d(),l.current.apply(null,h)}var b=c.current,v=m-b;if(b===0&&(i&&g(),c.current=m),r!==void 0){if(v>r)return void g()}else v=1&&s&&s())};d()}function d(){c=requestAnimationFrame(u)}}var FJe={T:0,L:0,W:0,H:0,FIT:void 0},DAe=function(){var e=p.useRef(!1);return p.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e},BJe=["className"];function UJe(e){var t=e.className,n=t===void 0?"":t,i=ED(e,BJe);return ji.createElement("div",oo({className:"PhotoView__Spinner "+n},i),ji.createElement("svg",{viewBox:"0 0 32 32",width:"36",height:"36",fill:"white"},ji.createElement("path",{opacity:".25",d:"M16 0 A16 16 0 0 0 16 32 A16 16 0 0 0 16 0 M16 4 A12 12 0 0 1 16 28 A12 12 0 0 1 16 4"}),ji.createElement("path",{d:"M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"})))}var QJe=["src","loaded","broken","className","onPhotoLoad","loadingElement","brokenElement"];function zJe(e){var t=e.src,n=e.loaded,i=e.broken,r=e.className,s=e.onPhotoLoad,o=e.loadingElement,l=e.brokenElement,c=ED(e,QJe),u=DAe();return t&&!i?ji.createElement(ji.Fragment,null,ji.createElement("img",oo({className:"PhotoView__Photo"+(r?" "+r:""),src:t,onLoad:function(d){var f=d.target;u.current&&s({loaded:!0,naturalWidth:f.naturalWidth,naturalHeight:f.naturalHeight})},onError:function(){u.current&&s({broken:!0})},draggable:!1,alt:""},c)),!n&&(o?ji.createElement("span",{className:"PhotoView__icon"},o):ji.createElement(UJe,{className:"PhotoView__icon"}))):l?ji.createElement("span",{className:"PhotoView__icon"},typeof l=="function"?l({src:t}):l):null}var VJe={naturalWidth:void 0,naturalHeight:void 0,width:void 0,height:void 0,loaded:void 0,broken:!1,x:0,y:0,touched:!1,maskTouched:!1,rotate:0,scale:1,CX:0,CY:0,lastX:0,lastY:0,lastCX:0,lastCY:0,lastScale:1,touchTime:0,touchLength:0,pause:!0,stopRaf:!0,reach:void 0};function HJe(e){var t=e.item,n=t.src,i=t.render,r=t.width,s=r===void 0?0:r,o=t.height,l=o===void 0?0:o,c=t.originRef,u=e.visible,d=e.speed,f=e.easing,h=e.wrapClassName,m=e.className,g=e.style,b=e.loadingElement,v=e.brokenElement,y=e.onPhotoTap,w=e.onMaskTap,x=e.onReachMove,O=e.onReachUp,k=e.onPhotoResize,S=e.isActive,C=e.expose,E=KR(VJe),j=E[0],T=E[1],R=p.useRef(0),A=DAe(),N=j.naturalWidth,P=N===void 0?s:N,I=j.naturalHeight,D=I===void 0?l:I,_=j.width,L=_===void 0?s:_,F=j.height,M=F===void 0?l:F,V=j.loaded,q=V===void 0?!n:V,U=j.broken,J=j.x,z=j.y,Z=j.touched,ne=j.stopRaf,W=j.maskTouched,G=j.rotate,H=j.scale,se=j.CX,Y=j.CY,X=j.lastX,ie=j.lastY,ee=j.lastCX,be=j.lastCY,ue=j.lastScale,pe=j.touchTime,ke=j.touchLength,je=j.pause,Pe=j.reach,Ee=Ky({onScale:function(Ne){return ze(G2(Ne))},onRotate:function(Ne){G!==Ne&&(C({rotate:Ne}),T(oo({rotate:Ne},k3(P,D,Ne))))}});function ze(Ne,Ot,Nt){H!==Ne&&(C({scale:Ne}),T(oo({scale:Ne},O3(J,z,L,M,H,Ne,Ot,Nt),Ne<=1&&{x:0,y:0})))}var _e=X2(function(Ne,Ot,Nt){if(Nt===void 0&&(Nt=0),(Z||W)&&S){var Yt=T8(G,L,M),xn=Yt[0],Ke=Yt[1];if(Nt===0&&R.current===0){var St=Math.abs(Ne-se)<=20,qe=Math.abs(Ot-Y)<=20;if(St&&qe)return void T({lastCX:Ne,lastCY:Ot});R.current=St?Ot>Y?3:2:1}var nt,et=Ne-ee,ft=Ot-be;if(Nt===0){var Et=Km(et+X,H,xn,innerWidth)[0],At=Km(ft+ie,H,Ke,innerHeight);nt=function(Gt,Xe,wt,vt){return Xe&&Gt===1||vt==="x"?"x":wt&&Gt>1||vt==="y"?"y":void 0}(R.current,Et,At[0],Pe),nt!==void 0&&x(nt,Ne,Ot,H)}if(nt==="x"||W)return void T({reach:"x"});var It=G2(H+(Nt-ke)/100/2*H,P/L,.2);C({scale:It}),T(oo({touchLength:Nt,reach:nt,scale:It},O3(J,z,L,M,H,It,Ne,Ot,et,ft)))}},{maxWait:8});function ae(Ne){return!ne&&!Z&&(A.current&&T(oo({},Ne,{pause:u})),A.current)}var le,ge,Oe,Se,We,Ye,ye,we,Ae=(We=function(Ne){return ae({x:Ne})},Ye=function(Ne){return ae({y:Ne})},ye=function(Ne){return A.current&&(C({scale:Ne}),T({scale:Ne})),!Z&&A.current},we=Ky({X:function(Ne){return We(Ne)},Y:function(Ne){return Ye(Ne)},S:function(Ne){return ye(Ne)}}),function(Ne,Ot,Nt,Yt,xn,Ke,St,qe,nt,et,ft){var Et=T8(et,xn,Ke),At=Et[0],It=Et[1],Gt=Km(Ne,qe,At,innerWidth),Xe=Gt[0],wt=Gt[1],vt=Km(Ot,qe,It,innerHeight),tn=vt[0],Qt=vt[1],cn=Date.now()-ft;if(cn>=200||qe!==St||Math.abs(nt-St)>1){var Me=O3(Ne,Ot,xn,Ke,St,qe),on=Me.x,On=Me.y,Sn=Xe?wt:on!==Ne?on:null,Qi=tn?Qt:On!==Ot?On:null;return Sn!==null&&vy(Ne,Sn,we.X),Qi!==null&&vy(Ot,Qi,we.Y),void(qe!==St&&vy(St,qe,we.S))}var un=(Ne-Nt)/cn,lr=(Ot-Yt)/cn,Mn=Math.sqrt(Math.pow(un,2)+Math.pow(lr,2)),ei=!1,Bn=!1;(function(ki,zn){var Rn,di=ki,rt=0,zt=0,Qe=function(_n){Rn||(Rn=_n);var jr=_n-Rn,Hs=Math.sign(ki),qs=-.001*Hs,Dr=Math.sign(-di)*Math.pow(di,2)*2e-4,ti=di*jr+(qs+Dr)*Math.pow(jr,2)/2;rt+=ti,Rn=_n,Hs*(di+=(qs+Dr)*jr)<=0?Ht():zn(rt)?bt():Ht()};function bt(){zt=requestAnimationFrame(Qe)}function Ht(){cancelAnimationFrame(zt)}bt()})(Mn,function(ki){var zn=Ne+ki*(un/Mn),Rn=Ot+ki*(lr/Mn),di=Km(zn,St,At,innerWidth),rt=di[0],zt=di[1],Qe=Km(Rn,St,It,innerHeight),bt=Qe[0],Ht=Qe[1];if(rt&&!ei&&(ei=!0,Xe?vy(zn,zt,we.X):UZ(zt,zn+(zn-zt),we.X)),bt&&!Bn&&(Bn=!0,tn?vy(Rn,Ht,we.Y):UZ(Ht,Rn+(Rn-Ht),we.Y)),ei&&Bn)return!1;var _n=ei||we.X(zt),jr=Bn||we.Y(Ht);return _n&&jr})}),He=(le=y,ge=function(Ne,Ot){Pe||ze(H!==1?1:Math.max(2,P/L),Ne,Ot)},Oe=p.useRef(0),Se=X2(function(){Oe.current=0,le.apply(void 0,[].slice.call(arguments))},{wait:300}),function(){var Ne=[].slice.call(arguments);Oe.current+=1,Se.apply(void 0,Ne),Oe.current>=2&&(Se.cancel(),Oe.current=0,ge.apply(void 0,Ne))});function Ue(Ne,Ot){if(R.current=0,(Z||W)&&S){T({touched:!1,maskTouched:!1,pause:!1,stopRaf:!1,reach:void 0});var Nt=G2(H,P/L);if(Ae(J,z,X,ie,L,M,H,Nt,ue,G,pe),O(Ne,Ot),se===Ne&&Y===Ot){if(Z)return void He(Ne,Ot);W&&w(Ne,Ot)}}}function jt(Ne,Ot,Nt){Nt===void 0&&(Nt=0),T({touched:!0,CX:Ne,CY:Ot,lastCX:Ne,lastCY:Ot,lastX:J,lastY:z,lastScale:H,touchLength:Nt,touchTime:Date.now()})}function Pt(Ne){T({maskTouched:!0,CX:Ne.clientX,CY:Ne.clientY,lastX:J,lastY:z})}ix(tp?void 0:"mousemove",function(Ne){Ne.preventDefault(),_e(Ne.clientX,Ne.clientY)}),ix(tp?void 0:"mouseup",function(Ne){Ue(Ne.clientX,Ne.clientY)}),ix(tp?"touchmove":void 0,function(Ne){Ne.preventDefault();var Ot=BZ(Ne);_e.apply(void 0,Ot)},{passive:!1}),ix(tp?"touchend":void 0,function(Ne){var Ot=Ne.changedTouches[0];Ue(Ot.clientX,Ot.clientY)},{passive:!1}),ix("resize",X2(function(){q&&!Z&&(T(k3(P,D,G)),k())},{maxWait:8})),A8(function(){S&&C(oo({scale:H,rotate:G},Ee))},[S]);var Kt=function(Ne,Ot,Nt,Yt,xn,Ke,St,qe,nt,et){var ft=function(on,On,Sn,Qi,un){var lr=p.useRef(!1),Mn=KR({lead:!0,scale:Sn}),ei=Mn[0],Bn=ei.lead,ki=ei.scale,zn=Mn[1],Rn=X2(function(di){try{return un(!0),zn({lead:!1,scale:di}),Promise.resolve()}catch(rt){return Promise.reject(rt)}},{wait:Qi});return A8(function(){lr.current?(un(!1),zn({lead:!0}),Rn(Sn)):lr.current=!0},[Sn]),Bn?[on*ki,On*ki,Sn/ki]:[on*Sn,On*Sn,1]}(Ke,St,qe,nt,et),Et=ft[0],At=ft[1],It=ft[2],Gt=function(on,On,Sn,Qi,un){var lr=p.useState(FJe),Mn=lr[0],ei=lr[1],Bn=p.useState(0),ki=Bn[0],zn=Bn[1],Rn=p.useRef(),di=Ky({OK:function(){return on&&zn(4)}});function rt(zt){un(!1),zn(zt)}return p.useEffect(function(){if(Rn.current||(Rn.current=Date.now()),Sn){if(function(zt,Qe){var bt=zt&&zt.current;if(bt&&bt.nodeType===1){var Ht=bt.getBoundingClientRect();Qe({T:Ht.top,L:Ht.left,W:Ht.width,H:Ht.height,FIT:bt.tagName==="IMG"?getComputedStyle(bt).objectFit:void 0})}}(On,ei),on)return Date.now()-Rn.current<250?(zn(1),requestAnimationFrame(function(){zn(2),requestAnimationFrame(function(){return rt(3)})}),void setTimeout(di.OK,Qi)):void zn(4);rt(5)}},[on,Sn]),[ki,Mn]}(Ne,Ot,Nt,nt,et),Xe=Gt[0],wt=Gt[1],vt=wt.W,tn=wt.FIT,Qt=innerWidth/2,cn=innerHeight/2,Me=Xe<3||Xe>4;return[Me?vt?wt.L:Qt:Yt+(Qt-Ke*qe/2),Me?vt?wt.T:cn:xn+(cn-St*qe/2),Et,Me&&tn?Et*(wt.H/vt):At,Xe===0?It:Me?vt/(Ke*qe)||.01:It,Me?tn?1:0:1,Xe,tn]}(u,c,q,J,z,L,M,H,d,function(Ne){return T({pause:Ne})}),Ct=Kt[4],xt=Kt[6],tt="transform "+d+"ms "+f,mt={className:m,onMouseDown:tp?void 0:function(Ne){Ne.stopPropagation(),Ne.button===0&&jt(Ne.clientX,Ne.clientY,0)},onTouchStart:tp?function(Ne){Ne.stopPropagation(),jt.apply(void 0,BZ(Ne))}:void 0,onWheel:function(Ne){if(!Pe){var Ot=G2(H-Ne.deltaY/100/2,P/L);T({stopRaf:!0}),ze(Ot,Ne.clientX,Ne.clientY)}},style:{width:Kt[2]+"px",height:Kt[3]+"px",opacity:Kt[5],objectFit:xt===4?void 0:Kt[7],transform:G?"rotate("+G+"deg)":void 0,transition:xt>2?tt+", opacity "+d+"ms ease, height "+(xt<4?d/2:xt>4?d:0)+"ms "+f:void 0}};return ji.createElement("div",{className:"PhotoView__PhotoWrap"+(h?" "+h:""),style:g,onMouseDown:!tp&&S?Pt:void 0,onTouchStart:tp&&S?function(Ne){return Pt(Ne.touches[0])}:void 0},ji.createElement("div",{className:"PhotoView__PhotoBox",style:{transform:"matrix("+Ct+", 0, 0, "+Ct+", "+Kt[0]+", "+Kt[1]+")",transition:Z||je?void 0:tt,willChange:S?"transform":void 0}},n?ji.createElement(zJe,oo({src:n,loaded:q,broken:U},mt,{onPhotoLoad:function(Ne){T(oo({},Ne,Ne.loaded&&k3(Ne.naturalWidth||0,Ne.naturalHeight||0,G)))},loadingElement:b,brokenElement:v})):i&&i({attrs:mt,scale:Ct,rotate:G})))}var QZ={x:0,touched:!1,pause:!1,lastCX:void 0,lastCY:void 0,bg:void 0,lastBg:void 0,overlay:!0,minimal:!0,scale:1,rotate:0};function qJe(e){var t=e.loop,n=t===void 0?3:t,i=e.speed,r=e.easing,s=e.photoClosable,o=e.maskClosable,l=o===void 0||o,c=e.maskOpacity,u=c===void 0?1:c,d=e.pullClosable,f=d===void 0||d,h=e.bannerVisible,m=h===void 0||h,g=e.overlayRender,b=e.toolbarRender,v=e.className,y=e.maskClassName,w=e.photoClassName,x=e.photoWrapClassName,O=e.loadingElement,k=e.brokenElement,S=e.images,C=e.index,E=C===void 0?0:C,j=e.onIndexChange,T=e.visible,R=e.onClose,A=e.afterClose,N=e.portalContainer,P=KR(QZ),I=P[0],D=P[1],_=p.useState(0),L=_[0],F=_[1],M=I.x,V=I.touched,q=I.pause,U=I.lastCX,J=I.lastCY,z=I.bg,Z=z===void 0?u:z,ne=I.lastBg,W=I.overlay,G=I.minimal,H=I.scale,se=I.rotate,Y=I.onScale,X=I.onRotate,ie=e.hasOwnProperty("index"),ee=ie?E:L,be=ie?j:F,ue=p.useRef(ee),pe=S.length,ke=S[ee],je=typeof n=="boolean"?n:pe>n,Pe=function(Ct,xt){var tt=p.useReducer(function(Nt){return!Nt},!1)[1],mt=p.useRef(0),Ne=function(Nt){var Yt=p.useRef(Nt);function xn(Ke){Yt.current=Ke}return p.useMemo(function(){(function(Ke){Ct?(Ke(Ct),mt.current=1):mt.current=2})(xn)},[Nt]),[Yt.current,xn]}(Ct),Ot=Ne[1];return[Ne[0],mt.current,function(){tt(),mt.current===2&&(Ot(!1),xt&&xt()),mt.current=0}]}(T,A),Ee=Pe[0],ze=Pe[1],_e=Pe[2];A8(function(){if(Ee)return D({pause:!0,x:ee*-(innerWidth+_v)}),void(ue.current=ee);D(QZ)},[Ee]);var ae=Ky({close:function(Ct){X&&X(0),D({overlay:!0,lastBg:Z}),R(Ct)},changeIndex:function(Ct,xt){xt===void 0&&(xt=!1);var tt=je?ue.current+(Ct-ee):Ct,mt=pe-1,Ne=C8(tt,0,mt),Ot=je?tt:Ne,Nt=innerWidth+_v;D({touched:!1,lastCX:void 0,lastCY:void 0,x:-Nt*Ot,pause:xt}),ue.current=Ot,be&&be(je?Ct<0?mt:Ct>mt?0:Ct:Ne)}}),le=ae.close,ge=ae.changeIndex;function Oe(Ct){return Ct?le():D({overlay:!W})}function Se(){D({x:-(innerWidth+_v)*ee,lastCX:void 0,lastCY:void 0,pause:!0}),ue.current=ee}function We(Ct,xt,tt,mt){Ct==="x"?function(Ne){if(U!==void 0){var Ot=Ne-U,Nt=Ot;!je&&(ee===0&&Ot>0||ee===pe-1&&Ot<0)&&(Nt=Ot/2),D({touched:!0,lastCX:U,x:-(innerWidth+_v)*ue.current+Nt,pause:!1})}else D({touched:!0,lastCX:Ne,x:M,pause:!1})}(xt):Ct==="y"&&function(Ne,Ot){if(J!==void 0){var Nt=u===null?null:C8(u,.01,u-Math.abs(Ne-J)/100/4);D({touched:!0,lastCY:J,bg:Ot===1?Nt:u,minimal:Ot===1})}else D({touched:!0,lastCY:Ne,bg:Z,minimal:!0})}(tt,mt)}function Ye(Ct,xt){var tt=Ct-(U??Ct),mt=xt-(J??xt),Ne=!1;if(tt<-40)ge(ee+1);else if(tt>40)ge(ee-1);else{var Ot=-(innerWidth+_v)*ue.current;Math.abs(mt)>100&&G&&f&&(Ne=!0,le()),D({touched:!1,x:Ot,lastCX:void 0,lastCY:void 0,bg:u,overlay:!!Ne||W})}}ix("keydown",function(Ct){if(T)switch(Ct.key){case"ArrowLeft":ge(ee-1,!0);break;case"ArrowRight":ge(ee+1,!0);break;case"Escape":le()}});var ye=function(Ct,xt,tt){return p.useMemo(function(){var mt=Ct.length;return tt?Ct.concat(Ct).concat(Ct).slice(mt+xt-1,mt+xt+2):Ct.slice(Math.max(xt-1,0),Math.min(xt+2,mt+1))},[Ct,xt,tt])}(S,ee,je);if(!Ee)return null;var we=W&&!ze,Ae=T?Z:ne,He=Y&&X&&{images:S,index:ee,visible:T,onClose:le,onIndexChange:ge,overlayVisible:we,overlay:ke&&ke.overlay,scale:H,rotate:se,onScale:Y,onRotate:X},Ue=i?i(ze):400,jt=r?r(ze):FZ,Pt=i?i(3):600,Kt=r?r(3):FZ;return ji.createElement(IJe,{className:"PhotoView-Portal"+(we?"":" PhotoView-Slider__clean")+(T?"":" PhotoView-Slider__willClose")+(v?" "+v:""),role:"dialog",onClick:function(Ct){return Ct.stopPropagation()},container:N},T&&ji.createElement(LJe,null),ji.createElement("div",{className:"PhotoView-Slider__Backdrop"+(y?" "+y:"")+(ze===1?" PhotoView-Slider__fadeIn":ze===2?" PhotoView-Slider__fadeOut":""),style:{background:Ae?"rgba(0, 0, 0, "+Ae+")":void 0,transitionTimingFunction:jt,transitionDuration:(V?0:Ue)+"ms",animationDuration:Ue+"ms"},onAnimationEnd:_e}),m&&ji.createElement("div",{className:"PhotoView-Slider__BannerWrap"},ji.createElement("div",{className:"PhotoView-Slider__Counter"},ee+1," / ",pe),ji.createElement("div",{className:"PhotoView-Slider__BannerRight"},b&&He&&b(He),ji.createElement(PJe,{className:"PhotoView-Slider__toolbarIcon",onClick:le}))),ye.map(function(Ct,xt){var tt=je||ee!==0?ue.current-1+xt:ee+xt;return ji.createElement(HJe,{key:je?Ct.key+"/"+Ct.src+"/"+tt:Ct.key,item:Ct,speed:Ue,easing:jt,visible:T,onReachMove:We,onReachUp:Ye,onPhotoTap:function(){return Oe(s)},onMaskTap:function(){return Oe(l)},wrapClassName:x,className:w,style:{left:(innerWidth+_v)*tt+"px",transform:"translate3d("+M+"px, 0px, 0)",transition:V||q?void 0:"transform "+Pt+"ms "+Kt},loadingElement:O,brokenElement:k,onPhotoResize:Se,isActive:ue.current===tt,expose:D})}),!tp&&m&&ji.createElement(ji.Fragment,null,(je||ee!==0)&&ji.createElement("div",{className:"PhotoView-Slider__ArrowLeft",onClick:function(){return ge(ee-1,!0)}},ji.createElement(DJe,null)),(je||ee+1-1){var y=u.slice();return y.splice(v,1,b),void l({images:y})}l(function(w){return{images:w.images.concat(b)}})},remove:function(b){l(function(v){var y=v.images.filter(function(w){return w.key!==b});return{images:y,index:Math.min(y.length-1,f)}})},show:function(b){var v=u.findIndex(function(y){return y.key===b});l({visible:!0,index:v}),i&&i(!0,v,o)}}),m=Ky({close:function(){l({visible:!1}),i&&i(!1,f,o)},changeIndex:function(b){l({index:b}),n&&n(b,o)}}),g=p.useMemo(function(){return oo({},o,h)},[o,h]);return ji.createElement(PAe.Provider,{value:g},t,ji.createElement(qJe,oo({images:u,visible:d,index:f,onIndexChange:m.changeIndex,onClose:m.close},r)))}var MAe=function(e){var t,n,i=e.src,r=e.render,s=e.overlay,o=e.width,l=e.height,c=e.triggers,u=c===void 0?["onClick"]:c,d=e.children,f=p.useContext(PAe),h=(t=function(){return f.nextId()},(n=p.useRef({sign:!1,fn:void 0}).current).sign||(n.sign=!0,n.fn=t()),n.fn),m=p.useRef(null);p.useImperativeHandle(d==null?void 0:d.ref,function(){return m.current}),p.useEffect(function(){return function(){f.remove(h)}},[]);var g=Ky({render:function(v){return r&&r(v)},show:function(v,y){f.show(h),function(w,x){if(d){var O=d.props[w];O&&O(x)}}(v,y)}}),b=p.useMemo(function(){var v={};return u.forEach(function(y){v[y]=g.show.bind(null,y)}),v},[]);return p.useEffect(function(){f.update({key:h,src:i,originRef:m,render:g.render,overlay:s,width:o,height:l})},[i]),d?p.Children.only(p.cloneElement(d,oo({},b,{ref:m}))):null};function c0(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),a.jsx("path",{d:"m7.5 9 2.7 2.5L7.5 14M12.7 14h3.8"}),a.jsx("path",{d:"M3.8 7.5h16.4",opacity:".55"})]})}function LAe(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),a.jsx("path",{d:"M3.8 8h16.4"}),a.jsx("circle",{cx:"6.5",cy:"6.3",r:".65",fill:"currentColor",stroke:"none"}),a.jsx("circle",{cx:"8.8",cy:"6.3",r:".65",fill:"currentColor",stroke:"none"}),a.jsx("path",{d:"m9 15 2.2-4 1.6 2.4 1.1-1.2L16 15H9Z"})]})}function hz(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M12 3.4 19 6v5.3c0 4.3-2.7 7.6-7 9.3-4.3-1.7-7-5-7-9.3V6l7-2.6Z"}),a.jsx("path",{d:"m8.8 12 2 2 4.4-4.4"})]})}function aN(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M3.5 7.7h6.1l1.7 2h9.2v7.5a2.3 2.3 0 0 1-2.3 2.3H5.8a2.3 2.3 0 0 1-2.3-2.3V7.7Z"}),a.jsx("path",{d:"M3.8 7.7V6.8a2.3 2.3 0 0 1 2.3-2.3h3l1.8 2h6.9a2.3 2.3 0 0 1 2.3 2.3v.9"}),a.jsx("path",{d:"M12 13v3M10.5 14.5h3"})]})}function XJe(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 5v14M5 12h14"})})}function zZ(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m6.5 11.5 5.5-5.5 5.5 5.5M12 6v12"})})}function VZ(e){return a.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",...e,children:a.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1.75",fill:"currentColor"})})}function YJe(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),a.jsx("circle",{cx:"8.5",cy:"9",r:"1.4"}),a.jsx("path",{d:"m5.5 17 4.2-4.2 2.6 2.4 2.1-2.1 4.1 3.9"})]})}function ZJe(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3.5h7l5 5v12H6z"}),a.jsx("path",{d:"M13 3.5v5h5M9 13h6M9 16h5"})]})}function JJe(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"5",width:"13.5",height:"14",rx:"2.5"}),a.jsx("path",{d:"m17 10 3.5-2v8L17 14zM7 8.5h4.5"})]})}function eet(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m12 3 1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5zM18.5 15.5l.7 2.1 2.1.7-2.1.7-.7 2.1-.7-2.1-2.1-.7 2.1-.7z"})})}function $Ae(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function _8(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m9 6 6 6-6 6"})})}function tet(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M4.8 8.2A8 8 0 1 1 4 12M4.8 8.2V4.5M4.8 8.2h3.7"}),a.jsx("path",{d:"M12 8v4.5l3 1.8"})]})}function Rc(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M20 12a8 8 0 1 1-2.35-5.65"})})}function net(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"8",y:"8",width:"11",height:"11",rx:"2"}),a.jsx("path",{d:"M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2"})]})}function FAe(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m5 12.5 4.2 4.2L19 7"})})}function Q(e,t={}){return bn.t(e,{...t,ns:"adk"})}function ul(e){const t=new Headers(e);return t.has("Accept-Language")||t.set("Accept-Language",bn.resolvedLanguage||bn.language),t}function j8(){return bn.resolvedLanguage||bn.language}function iet(e){if(e.timezone!=null){if(typeof e.timezone!="string")return!1;try{new Intl.DateTimeFormat("en-US",{timeZone:e.timezone})}catch{return!1}}return e.runAt!=null&&(typeof e.runAt!="string"||!Number.isFinite(Date.parse(e.runAt)))?!1:[e.weekdays,e.monthDays].every(t=>t==null||Array.isArray(t)&&t.every(Number.isInteger))}async function ret(e,t,n,i,r){const s=await e(`/web/mpa-cron/${encodeURIComponent(t.runtimeId)}?region=${encodeURIComponent(t.region)}&offset=${n}&query=${encodeURIComponent(i)}`,{signal:r},{});if(!s.ok)throw new Error(`MPA_HTTP_${s.status}`);let o;try{o=await s.json()}catch{throw new Error("MPA_INVALID_RESPONSE")}if(!o||!Array.isArray(o.items)||!Number.isInteger(o.total)||o.total<0||typeof o.hasMore!="boolean"||o.hasMore&&(!Number.isInteger(o.nextOffset)||o.nextOffset<=n)||o.overview!=null&&(!Number.isFinite(o.overview.executionCount)||!Number.isFinite(o.overview.successRate))||!o.items.every(l=>l&&typeof l.id=="string"&&typeof l.name=="string"&&typeof l.enabled=="boolean"&&(l.prompt==null||typeof l.prompt=="string")&&l.schedule&&typeof l.schedule.type=="string"&&iet(l.schedule)&&[l.agentId,l.lastRunAt,l.runningAt,l.createdAt].every(c=>c==null||typeof c=="string")&&(l.nextRunAt==null||typeof l.nextRunAt=="string")&&(l.lastRunStatus==null||typeof l.lastRunStatus=="string")))throw new Error("MPA_INVALID_RESPONSE");return o}async function set(e,t,n,i,r,s){const o=await e(`/web/mpa-cron/${encodeURIComponent(t.runtimeId)}${i}?region=${encodeURIComponent(t.region)}`,{method:n,signal:s,...r===void 0?{}:{headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}},{});if(!o.ok)throw new Error(`MPA_HTTP_${o.status}`);let l;try{l=await o.json()}catch{throw new Error("MPA_INVALID_RESPONSE")}if(!l||typeof l!="object"||Array.isArray(l))throw new Error("MPA_INVALID_RESPONSE");return l}async function aet(e,t,n,i,r){const s=await e(`/web/mpa-cron/${encodeURIComponent(t.runtimeId)}/${encodeURIComponent(n)}/runs?region=${encodeURIComponent(t.region)}&offset=${i}`,{signal:r},{});if(!s.ok)throw new Error(`MPA_HTTP_${s.status}`);let o;try{o=await s.json()}catch{throw new Error("MPA_INVALID_RESPONSE")}if(!o||!Array.isArray(o.items)||!Number.isInteger(o.total)||o.total<0||typeof o.hasMore!="boolean"||o.hasMore&&(!Number.isInteger(o.nextOffset)||o.nextOffset<=i)||!o.items.every(l=>l&&typeof l.id=="string"&&typeof l.status=="string"&&typeof l.scheduledAt=="string"&&[l.startedAt,l.errorMessage,l.sessionId].every(c=>c==null||typeof c=="string")&&(l.durationMs==null||Number.isFinite(l.durationMs)&&l.durationMs>=0)))throw new Error("MPA_INVALID_RESPONSE");return o}const HZ="veadk_auth_qs",oet=new Set(["view","source","sessionId","artifactSha256","validationReportSha256","projectId","versionId"]);let ak=null;function cet(){if(ak!==null)return ak;const e=new URLSearchParams(window.location.search),t=new URLSearchParams,n=new URLSearchParams,i=e.get("view")==="runtime-deploy"&&e.get("source")==="intelligent-development";e.forEach((s,o)=>{(i&&oet.has(o)?n:t).append(o,s)});const r=t.toString();if(r?(sessionStorage.setItem(HZ,r),ak=r):ak=sessionStorage.getItem(HZ)??"",r){const s=n.toString();window.history.replaceState(null,"",window.location.pathname+(s?`?${s}`:"")+window.location.hash)}return ak}function Ta(e){const t=cet();if(!t)return e;const n=new URL(e,window.location.origin);return new URLSearchParams(t).forEach((i,r)=>{n.searchParams.has(r)||n.searchParams.set(r,i)}),/^https?:\/\//i.test(e)?n.toString():n.pathname+n.search+n.hash}const ho=3e4,hr=12e4,pz=1e4;function po(e,t=ho){if(t<=0)return e??void 0;const n=AbortSignal.timeout(t);return e?AbortSignal.any([e,n]):n}const GR="veadk_local_user",XR="veadk_local_user_tab",uet="X-VeADK-OAuth-Refresh-Retry",det=[50,250],fet=/^[A-Za-z0-9]{1,16}$/;function BAe(){try{const e=sessionStorage.getItem(XR);if(e)return e;const t=localStorage.getItem(GR);return t&&sessionStorage.setItem(XR,t),t}catch{try{return localStorage.getItem(GR)}catch{return null}}}function qZ(e){try{sessionStorage.setItem(XR,e)}catch{}try{localStorage.setItem(GR,e)}catch{}}function het(){try{sessionStorage.removeItem(XR)}catch{}try{localStorage.removeItem(GR)}catch{}}function uc(e){const t=new Headers(e),n=BAe();return n&&t.set("X-VeADK-Local-User",n),t}async function UAe(){let e;try{e=await fetch("/web/auth-config",{headers:ul({Accept:"application/json"}),signal:po(void 0,pz)})}catch(t){throw console.warn("[identity] /web/auth-config is unreachable:",t),new Error(Q("identity.loadConfigNetworkFailed"))}if(!e.ok)throw new Error(Q("identity.configServiceFailed",{status:e.status}));try{const t=await e.json();if(!Array.isArray(t.providers))throw new TypeError("providers is not an array");return t.providers}catch(t){throw console.warn("[identity] /web/auth-config returned an invalid response:",t),new Error(Q("identity.invalidConfigResponse"))}}function pet(e){const t=window.location.pathname+window.location.search+window.location.hash,n=e.includes("?")?"&":"?";window.location.assign(`${e}${n}redirect=${encodeURIComponent(t)}`)}function met(){const e=window.location.pathname+window.location.search+window.location.hash,t=window.open("about:blank","_blank","popup,width=520,height=720");if(!t)return null;try{t.opener=null,t.location.replace(`/oauth2/login?redirect=${encodeURIComponent(e)}`)}catch{return t.close(),null}return t}async function get(){const[e,t]=await Promise.all([N8(),UAe()]);return e.status==="unauthenticated"&&t.length>0}function bet(){window.location.assign("/oauth2/logout")}async function yet(){for(let e=0;;e+=1){let t;try{t=await fetch("/oauth2/userinfo",{headers:ul({Accept:"application/json"}),signal:po(void 0,pz)})}catch(i){throw console.warn("[identity] /oauth2/userinfo is unreachable:",i),new Error(Q("identity.serviceNetworkFailed"))}const n=det[e];if(t.status!==401||t.headers.get(uet)!=="1"||n===void 0)return t;await new Promise(i=>window.setTimeout(i,n))}}async function N8(){const e=await yet();if(e.ok){let n;try{n=await e.json()}catch(r){throw console.warn("[identity] /oauth2/userinfo returned a non-JSON response:",r),new Error(Q("identity.invalidServiceResponse"))}return{status:"authenticated",userId:String(n.sub??n.user_id??n.email??""),info:n}}if(e.status===401)return{status:"unauthenticated",userId:"",local:!1};if(e.status!==404)throw new Error(Q("identity.serviceFailed",{status:e.status}));const t=BAe();return t?{status:"authenticated",userId:t,info:{name:t},local:!0}:{status:"unauthenticated",userId:"",local:!0}}function vet(e){if(!e)return"";for(const t of[e.name,e.preferred_username,e.username,e.email])if(typeof t=="string"&&t.trim())return t.trim();return""}function xet(e){const t=e==null?void 0:e.picture;return typeof t=="string"?t.trim():""}const R8="veadk:authentication-required";let YS=null,lS=null;function wet(e){if(!e.redirected||!e.url)return!1;try{const t=new URL(e.url);return t.pathname.includes("/authorize")||t.pathname.includes("/oauth2/login")||t.hostname.includes(".userpool.auth.")}catch{return!1}}function Oet(e){YS||(YS=new Promise(n=>{lS=n}),window.dispatchEvent(new Event(R8)));const t=YS;return e?e.aborted?Promise.reject(e.reason??new Error("Request aborted")):new Promise((n,i)=>{const r=()=>i(e.reason??new Error("Request aborted"));e.addEventListener("abort",r,{once:!0}),t.then(()=>{e.removeEventListener("abort",r),n()},s=>{e.removeEventListener("abort",r),i(s)})}):t}function ket(){return YS!==null}function Eet(){lS==null||lS(),lS=null,YS=null}async function CD(e,t){var i;const n=await e.text().catch(()=>"");try{return JSON.parse(n)}catch{const r=((i=e.headers.get("content-type"))==null?void 0:i.split(";",1)[0])||Q("common.contentTypeMissing"),s=n.trim().slice(0,2e3),o=s?` +${Q("common.response",{response:s})}`:"";throw new Error(Q("jsonResponse.nonJson",{fallback:t,status:e.status,contentType:r,detail:o}))}}const Cet=/\brun_sse\s*failed\s*:\s*404\b/i,Aet=/session not found/i,Tet=/(?:^|[::\s])not found\s*$/i,_et=/Expecting (?:'[^']+'|\w+)(?: delimiter)?: line \d+ column \d+ \(char \d+\)/i,jet=/Unknown or expired collection_id\s+'[^']+'\.\s*Call collect_resources first\./i,Net=/(?:RateLimitError|\bTPM\b|\bRPM\b|tokens? per minute|requests? per minute)[\s\S]*(?:\b429\b|limit|quota)|\b429\b[\s\S]*(?:model|RateLimitError|\bTPM\b|\bRPM\b)/i;function jv(e,t){return e.includes(t)?e:`${e} -${t}`}function Jo(e){const t=String(e),n=Q("runSse.rawResponseLabel");let i=t.includes(n)?t:`${n}${t}`;if(_et.test(t))i=Tv(i,Q("runSse.toolArgumentHint"));else{if(jet.test(t))return Tv(i,Q("runSse.resourceCollectionExpiredHint"));if(Net.test(t))return Tv(i,Q("runSse.modelQuotaHint"));Cet.test(t)&&(Aet.test(t)?i=Tv(i,Q("runSse.persistentMemoryHint")):Tet.test(t)&&(i=Tv(i,Q("runSse.unsupportedRouteHint"))))}return Tv(i,Q("runSse.networkConfigurationHint"))}const ZE="__sseEvent";async function*NA(e){if(!e.body)throw new Error("Response has no body");const t=e.body.getReader(),n=new TextDecoder;let i="";const r=o=>o.length>500?Q("sse.truncatedData",{data:o.slice(0,500),count:o.length}):o,s=(o,l=!1)=>{var f;const c=o.split(/\r?\n/),u=(f=c.find(h=>h.startsWith("event:")))==null?void 0:f.slice(6).trim(),d=c.filter(h=>h.startsWith("data:")).map(h=>h.slice(5).trimStart()).join(` -`);if(!(!d||d==="[DONE]"||d==="ping"))try{const h=JSON.parse(d);return u&&h&&typeof h=="object"&&Object.defineProperty(h,ZE,{value:u,enumerable:!1,configurable:!0}),h}catch{const h=r(d);throw l?new Error(Q("sse.incompleteEvent",{data:h})):new Error(Q("sse.invalidEventJson",{data:h}))}};try{for(;;){const{done:o,value:l}=await t.read();if(o)break;i+=n.decode(l,{stream:!0});let c=i.match(/\r?\n\r?\n/);for(;(c==null?void 0:c.index)!==void 0;){const u=i.slice(0,c.index);i=i.slice(c.index+c[0].length);const d=s(u);d!==void 0&&(yield d),c=i.match(/\r?\n\r?\n/)}}if(i+=n.decode(),i.trim()){const o=s(i,!0);o!==void 0&&(yield o)}}finally{try{await t.cancel()}catch{}finally{t.releaseLock()}}}const Ret="X-Studio-FaaS-Instance",Iet="X-Studio-FaaS-Request-Id";function XR(e,t,n){var s,o;const i=((s=e.headers.get(Ret))==null?void 0:s.trim())??"";if(!t||!n||!i)return null;const r=((o=e.headers.get(Iet))==null?void 0:o.trim())??"";return{runtimeId:t,region:n,instanceName:i,...r?{requestId:r}:{}}}function WZ(e,t,n,i){const r=e==="byteplus"?"https://console.byteplus.com":"https://console.volcengine.com",s=new URLSearchParams({projectName:"default",runtimeId:n,instanceName:i});return`${r}/agentkit/region:agentkit+${encodeURIComponent(t)}/runtime?${s}`}function Pet(e){return/\b(?:ERROR|FATAL|CRITICAL)\b/i.test(e)?"error":/\bWARN(?:ING)?\b/i.test(e)?"warning":/\bDEBUG\b/i.test(e)?"debug":/\bINFO\b/i.test(e)?"info":"default"}function Det(e){if(!e||typeof e!="object")return!1;const t=e;return t.type==="done"?!0:t.type==="context"?typeof t.instanceName=="string"&&typeof t.consoleUrl=="string":t.type==="logs"?typeof t.text=="string"&&typeof t.updatedAt=="number":t.type==="error"?typeof t.message=="string"&&(t.detail===void 0||typeof t.detail=="string")&&(t.statusCode===void 0||typeof t.statusCode=="string")&&(t.errorCode===void 0||typeof t.errorCode=="string")&&(t.requestId===void 0||typeof t.requestId=="string")&&(t.responseBody===void 0||typeof t.responseBody=="string"):!1}function QAe(e){var i;const t=[e.message],n=[e.statusCode?Q("runtimeLogs.httpStatus",{status:e.statusCode}):"",e.errorCode?Q("runtimeLogs.errorCode",{code:e.errorCode}):"",e.requestId?`Request ID:${e.requestId}`:""].filter(Boolean);return n.length>0&&t.push(n.join(` +${t}`}function Jo(e){const t=String(e),n=Q("runSse.rawResponseLabel");let i=t.includes(n)?t:`${n}${t}`;if(_et.test(t))i=jv(i,Q("runSse.toolArgumentHint"));else{if(jet.test(t))return jv(i,Q("runSse.resourceCollectionExpiredHint"));if(Net.test(t))return jv(i,Q("runSse.modelQuotaHint"));Cet.test(t)&&(Aet.test(t)?i=jv(i,Q("runSse.persistentMemoryHint")):Tet.test(t)&&(i=jv(i,Q("runSse.unsupportedRouteHint"))))}return jv(i,Q("runSse.networkConfigurationHint"))}const iC="__sseEvent";async function*MA(e){if(!e.body)throw new Error("Response has no body");const t=e.body.getReader(),n=new TextDecoder;let i="";const r=o=>o.length>500?Q("sse.truncatedData",{data:o.slice(0,500),count:o.length}):o,s=(o,l=!1)=>{var f;const c=o.split(/\r?\n/),u=(f=c.find(h=>h.startsWith("event:")))==null?void 0:f.slice(6).trim(),d=c.filter(h=>h.startsWith("data:")).map(h=>h.slice(5).trimStart()).join(` +`);if(!(!d||d==="[DONE]"||d==="ping"))try{const h=JSON.parse(d);return u&&h&&typeof h=="object"&&Object.defineProperty(h,iC,{value:u,enumerable:!1,configurable:!0}),h}catch{const h=r(d);throw l?new Error(Q("sse.incompleteEvent",{data:h})):new Error(Q("sse.invalidEventJson",{data:h}))}};try{for(;;){const{done:o,value:l}=await t.read();if(o)break;i+=n.decode(l,{stream:!0});let c=i.match(/\r?\n\r?\n/);for(;(c==null?void 0:c.index)!==void 0;){const u=i.slice(0,c.index);i=i.slice(c.index+c[0].length);const d=s(u);d!==void 0&&(yield d),c=i.match(/\r?\n\r?\n/)}}if(i+=n.decode(),i.trim()){const o=s(i,!0);o!==void 0&&(yield o)}}finally{try{await t.cancel()}catch{}finally{t.releaseLock()}}}const Ret="X-Studio-FaaS-Instance",Iet="X-Studio-FaaS-Request-Id";function YR(e,t,n){var s,o;const i=((s=e.headers.get(Ret))==null?void 0:s.trim())??"";if(!t||!n||!i)return null;const r=((o=e.headers.get(Iet))==null?void 0:o.trim())??"";return{runtimeId:t,region:n,instanceName:i,...r?{requestId:r}:{}}}function WZ(e,t,n,i){const r=e==="byteplus"?"https://console.byteplus.com":"https://console.volcengine.com",s=new URLSearchParams({projectName:"default",runtimeId:n,instanceName:i});return`${r}/agentkit/region:agentkit+${encodeURIComponent(t)}/runtime?${s}`}function Pet(e){return/\b(?:ERROR|FATAL|CRITICAL)\b/i.test(e)?"error":/\bWARN(?:ING)?\b/i.test(e)?"warning":/\bDEBUG\b/i.test(e)?"debug":/\bINFO\b/i.test(e)?"info":"default"}function Det(e){if(!e||typeof e!="object")return!1;const t=e;return t.type==="done"?!0:t.type==="context"?typeof t.instanceName=="string"&&typeof t.consoleUrl=="string":t.type==="logs"?typeof t.text=="string"&&typeof t.updatedAt=="number":t.type==="error"?typeof t.message=="string"&&(t.detail===void 0||typeof t.detail=="string")&&(t.statusCode===void 0||typeof t.statusCode=="string")&&(t.errorCode===void 0||typeof t.errorCode=="string")&&(t.requestId===void 0||typeof t.requestId=="string")&&(t.responseBody===void 0||typeof t.responseBody=="string"):!1}function QAe(e){var i;const t=[e.message],n=[e.statusCode?Q("runtimeLogs.httpStatus",{status:e.statusCode}):"",e.errorCode?Q("runtimeLogs.errorCode",{code:e.errorCode}):"",e.requestId?`Request ID:${e.requestId}`:""].filter(Boolean);return n.length>0&&t.push(n.join(` `)),e.detail&&e.detail!==e.message&&t.push(e.detail),e.responseBody&&!((i=e.detail)!=null&&i.includes(e.responseBody))&&t.push(Q("runtimeLogs.cloudResponseBody",{body:e.responseBody})),t.join(` `)}async function Met(e){const t=`HTTP ${e.status}${e.statusText?` ${e.statusText}`:""}`,n=await e.text();if(!n)return t;try{const i=JSON.parse(n);if(typeof i.detail=="string"&&i.detail)return`${t} @@ -122,14 +122,14 @@ ${i.detail}`;if(i.detail&&typeof i.detail=="object"){const r=i.detail;if(typeof ${JSON.stringify(i,null,2)}`}catch{return`${t} -${n}`}}async function*Let({runtimeId:e,region:t,instanceName:n,sessionId:i,follow:r=!0,signal:s}){const o=new URLSearchParams({region:t,follow:String(r)});n&&o.set("instance_name",n),i&&o.set("session_id",i);const l=await fetch(ja(`/web/runtime-logs/${encodeURIComponent(e)}/stream?${o.toString()}`),{headers:ul(fc({Accept:"text/event-stream"})),cache:"no-store",signal:s});if(!l.ok)throw new Error(Q("runtimeLogs.loadFailedWithDetail",{detail:await Met(l)}));for await(const c of NA(l)){if(!Det(c))throw new Error(Q("runtimeLogs.invalidFormat"));yield c}}const $et=255,Fet=/[\p{L}\p{M}\p{N}\p{P}\p{Zs}]/u;function Bet(e){const t=e.normalize("NFKC").replace(/\s+/gu," ").trim(),n=new TextEncoder;let i=0,r="";for(const s of t){if(!Fet.test(s))continue;const o=n.encode(s).byteLength;if(i+o>$et)break;r+=s,i+=o}return r.replace(/ +/g," ").trimEnd()}const Uet=/RunPipeline result could not be reconciled|Polling build status failed/i;class aN extends Error{constructor({taskId:n,cause:i}={}){super("The deployment request may still be running, but its status could not be confirmed.");Zt(this,"taskId");this.name="DeploymentStatusUnconfirmedError",this.taskId=n}}function zAe(e){if(e instanceof aN)return!0;const t=e instanceof Error?e.message:String(e??"");return Uet.test(t)}function VAe(e){return!!(e&&typeof e=="object"&&"name"in e&&e.name==="AbortError")}async function Qet({load:e,signal:t,timeoutMs:n=30*6e4,intervalMs:i=2e3,shouldRetry:r=()=>!0}){if(t!=null&&t.aborted)throw t.reason??new DOMException("Aborted","AbortError");const s=Date.now()+Math.max(0,n);for(;!(t!=null&&t.aborted)&&Date.now()<=s;){try{const o=await e(t);if(o.done)return o}catch(o){if(t!=null&&t.aborted||VAe(o)||!r(o))throw o}if(t!=null&&t.aborted)throw t.reason??new DOMException("Aborted","AbortError");i<=0||await new Promise((o,l)=>{const c=()=>{globalThis.clearTimeout(u),t==null||t.removeEventListener("abort",c),l((t==null?void 0:t.reason)??new DOMException("Aborted","AbortError"))},u=globalThis.setTimeout(()=>{t==null||t.removeEventListener("abort",c),o()},i);t==null||t.addEventListener("abort",c,{once:!0})})}return null}const I8="ap-southeast-1",mz="cn-beijing",zet="https://ark.ap-southeast.bytepluses.com/api/v3",Vet="https://ark.cn-beijing.volces.com/api/v3/",Het="https://console.byteplus.com/ark/region:ark+ap-southeast-1/openManagement",qet="https://console.volcengine.com/ark/region:ark+cn-beijing/openManagement",Wet="dola-seed-2-1-turbo-260628",Ket="doubao-seed-2-1-pro-260628",Get="skylark-embedding-vision-250615",Xet="doubao-embedding-vision-250615",Yet="seed-2-0-lite-260228",Zet="doubao-seed-2-0-lite-260428",Jet="dola-seedream-5-0-pro-260628",ett="doubao-seedream-5-0-260128",ttt="seededit-3-0-i2i-250628",ntt="doubao-seededit-3-0-i2i-250628",itt="dreamina-seedance-2-0-260128",rtt="doubao-seedance-2-0-260128";function Tu(e){return e==="byteplus"?[{value:I8,label:I8}]:[{value:"cn-beijing",label:Q("cloudRegion.cnBeijing")},{value:"cn-shanghai",label:Q("cloudRegion.cnShanghai")}]}function Zi(e){var t;return((t=Tu(e)[0])==null?void 0:t.value)||mz}const stt=new Set(["cn-beijing","cn-shanghai","ap-southeast-1"]);function CD(e){return typeof e=="string"&&stt.has(e)}function xh(e,t){var i;return((i=(t?Tu(t):[...Tu("volcengine"),...Tu("byteplus")]).find(r=>r.value===e))==null?void 0:i.label)||e||"-"}function Xp(e){return e==="byteplus"?Wet:Ket}function Do(e){return e==="byteplus"?zet:Vet}function att(e){return e==="byteplus"?Het:qet}function ott(e){return e==="byteplus"?Get:Xet}function ltt(e){return e==="byteplus"?Yet:Zet}function ctt(e){return e==="byteplus"?Jet:ett}function utt(e){return e==="byteplus"?ttt:ntt}function dtt(e){return e==="byteplus"?itt:rtt}const gz="veadk.messageFeedback.v1";function bz(e,t,n,i){return[e,t,n,i].join(":")}function yz(){if(typeof window>"u")return{};try{const e=JSON.parse(localStorage.getItem(gz)??"{}");return e&&typeof e=="object"?e:{}}catch{return{}}}function ftt(e,t,n){if(typeof window>"u")return;const i=yz();i[e]={...i[e]??{},[`veadk_feedback:${t}`]:n},localStorage.setItem(gz,JSON.stringify(i))}function HAe(e){if(typeof window>"u")return;const t=bz(e.runtimeId,e.appName,e.userId,e.sessionId),n=yz(),i=n[t];if(i){for(const r of e.eventIds)delete i[`veadk_feedback:${r}`];Object.keys(i).length===0?delete n[t]:n[t]=i,localStorage.setItem(gz,JSON.stringify(n))}}const oN="",vz=new Map;function qAe(e,t){vz.set(e,t)}function WAe(){vz.clear()}function Ia(e){const t=vz.get(e);return t?{app:t.app,ep:{base:t.base,apiKey:t.apiKey,runtimeId:t.runtimeId,mpaInstanceId:t.mpaInstanceId,region:t.region,agentCategory:t.agentCategory}}:{app:e,ep:{}}}function L1(e,t){return e!=="a2a-default"&&!!(t.runtimeId&&(t.agentCategory==="mpa"||t.mpaInstanceId))}async function gt(e,t={},n={},i=ho){const r=po(t.signal,i),s=!!n.runtimeId&&String(t.method??"GET").toUpperCase()==="DELETE",o={...t,...s?{method:"POST"}:{},headers:ul(fc(t.headers))},l=()=>{const d={...o,signal:r};if(n.runtimeId){const f=new URLSearchParams;n.region&&f.set("_runtime_region",n.region),n.retryProbe&&f.set("probe_retry","connect"),s&&f.set("_method","DELETE");const h=f.toString()?`${e.includes("?")?"&":"?"}${f.toString()}`:"";return fetch(ja(`${oN}/web/runtime-proxy/${n.runtimeId}${e}${h}`),d)}if(n.base){const f=new Headers(d.headers);return f.set("X-AgentKit-Base",n.base),n.apiKey&&f.set("X-AgentKit-Key",n.apiKey),fetch(ja(`${oN}/agentkit-proxy${e}`),{...d,headers:f})}return fetch(ja(`${oN}${e}`),d)},c=async d=>{if(d.headers.get("X-Studio-Error-Source")==="upstream")return!1;if(wet(d))return!0;if(d.status!==401)return!1;try{return await get()}catch{return!1}};let u=await l();for(;await c(u);)await Oet(r),u=await l();return u}function vn(e,t={},n=ho){return gt(e,t,{},n)}function KAe(e){return typeof e=="string"?e:Array.isArray(e)?e.map(t=>{var n;if(t&&typeof t=="object"&&"msg"in t){const i=Array.isArray(t.loc)?(n=t.loc)==null?void 0:n.join("."):"",r=String(t.msg??"");return i?`${i}: ${r}`:r}return String(t)}).filter(Boolean).join(` +${n}`}}async function*Let({runtimeId:e,region:t,instanceName:n,sessionId:i,follow:r=!0,signal:s}){const o=new URLSearchParams({region:t,follow:String(r)});n&&o.set("instance_name",n),i&&o.set("session_id",i);const l=await fetch(Ta(`/web/runtime-logs/${encodeURIComponent(e)}/stream?${o.toString()}`),{headers:ul(uc({Accept:"text/event-stream"})),cache:"no-store",signal:s});if(!l.ok)throw new Error(Q("runtimeLogs.loadFailedWithDetail",{detail:await Met(l)}));for await(const c of MA(l)){if(!Det(c))throw new Error(Q("runtimeLogs.invalidFormat"));yield c}}const $et=255,Fet=/[\p{L}\p{M}\p{N}\p{P}\p{Zs}]/u;function Bet(e){const t=e.normalize("NFKC").replace(/\s+/gu," ").trim(),n=new TextEncoder;let i=0,r="";for(const s of t){if(!Fet.test(s))continue;const o=n.encode(s).byteLength;if(i+o>$et)break;r+=s,i+=o}return r.replace(/ +/g," ").trimEnd()}const Uet=/RunPipeline result could not be reconciled|Polling build status failed/i;class oN extends Error{constructor({taskId:n,cause:i}={}){super("The deployment request may still be running, but its status could not be confirmed.");Zt(this,"taskId");this.name="DeploymentStatusUnconfirmedError",this.taskId=n}}function zAe(e){if(e instanceof oN)return!0;const t=e instanceof Error?e.message:String(e??"");return Uet.test(t)}function VAe(e){return!!(e&&typeof e=="object"&&"name"in e&&e.name==="AbortError")}async function Qet({load:e,signal:t,timeoutMs:n=30*6e4,intervalMs:i=2e3,shouldRetry:r=()=>!0}){if(t!=null&&t.aborted)throw t.reason??new DOMException("Aborted","AbortError");const s=Date.now()+Math.max(0,n);for(;!(t!=null&&t.aborted)&&Date.now()<=s;){try{const o=await e(t);if(o.done)return o}catch(o){if(t!=null&&t.aborted||VAe(o)||!r(o))throw o}if(t!=null&&t.aborted)throw t.reason??new DOMException("Aborted","AbortError");i<=0||await new Promise((o,l)=>{const c=()=>{globalThis.clearTimeout(u),t==null||t.removeEventListener("abort",c),l((t==null?void 0:t.reason)??new DOMException("Aborted","AbortError"))},u=globalThis.setTimeout(()=>{t==null||t.removeEventListener("abort",c),o()},i);t==null||t.addEventListener("abort",c,{once:!0})})}return null}const I8="ap-southeast-1",mz="cn-beijing",zet="https://ark.ap-southeast.bytepluses.com/api/v3",Vet="https://ark.cn-beijing.volces.com/api/v3/",Het="https://console.byteplus.com/ark/region:ark+ap-southeast-1/openManagement",qet="https://console.volcengine.com/ark/region:ark+cn-beijing/openManagement",Wet="dola-seed-2-1-turbo-260628",Ket="doubao-seed-2-1-pro-260628",Get="skylark-embedding-vision-250615",Xet="doubao-embedding-vision-250615",Yet="seed-2-0-lite-260228",Zet="doubao-seed-2-0-lite-260428",Jet="dola-seedream-5-0-pro-260628",ett="doubao-seedream-5-0-260128",ttt="seededit-3-0-i2i-250628",ntt="doubao-seededit-3-0-i2i-250628",itt="dreamina-seedance-2-0-260128",rtt="doubao-seedance-2-0-260128";function _u(e){return e==="byteplus"?[{value:I8,label:I8}]:[{value:"cn-beijing",label:Q("cloudRegion.cnBeijing")},{value:"cn-shanghai",label:Q("cloudRegion.cnShanghai")}]}function Zi(e){var t;return((t=_u(e)[0])==null?void 0:t.value)||mz}const stt=new Set(["cn-beijing","cn-shanghai","ap-southeast-1"]);function AD(e){return typeof e=="string"&&stt.has(e)}function wh(e,t){var i;return((i=(t?_u(t):[..._u("volcengine"),..._u("byteplus")]).find(r=>r.value===e))==null?void 0:i.label)||e||"-"}function Kp(e){return e==="byteplus"?Wet:Ket}function Po(e){return e==="byteplus"?zet:Vet}function att(e){return e==="byteplus"?Het:qet}function ott(e){return e==="byteplus"?Get:Xet}function ltt(e){return e==="byteplus"?Yet:Zet}function ctt(e){return e==="byteplus"?Jet:ett}function utt(e){return e==="byteplus"?ttt:ntt}function dtt(e){return e==="byteplus"?itt:rtt}const gz="veadk.messageFeedback.v1";function bz(e,t,n,i){return[e,t,n,i].join(":")}function yz(){if(typeof window>"u")return{};try{const e=JSON.parse(localStorage.getItem(gz)??"{}");return e&&typeof e=="object"?e:{}}catch{return{}}}function ftt(e,t,n){if(typeof window>"u")return;const i=yz();i[e]={...i[e]??{},[`veadk_feedback:${t}`]:n},localStorage.setItem(gz,JSON.stringify(i))}function HAe(e){if(typeof window>"u")return;const t=bz(e.runtimeId,e.appName,e.userId,e.sessionId),n=yz(),i=n[t];if(i){for(const r of e.eventIds)delete i[`veadk_feedback:${r}`];Object.keys(i).length===0?delete n[t]:n[t]=i,localStorage.setItem(gz,JSON.stringify(n))}}const lN="",vz=new Map;function qAe(e,t){vz.set(e,t)}function WAe(){vz.clear()}function Na(e){const t=vz.get(e);return t?{app:t.app,ep:{base:t.base,apiKey:t.apiKey,runtimeId:t.runtimeId,mpaInstanceId:t.mpaInstanceId,region:t.region,agentCategory:t.agentCategory}}:{app:e,ep:{}}}function F1(e,t){return e!=="a2a-default"&&!!(t.runtimeId&&(t.agentCategory==="mpa"||t.mpaInstanceId))}async function gt(e,t={},n={},i=ho){const r=po(t.signal,i),s=!!n.runtimeId&&String(t.method??"GET").toUpperCase()==="DELETE",o={...t,...s?{method:"POST"}:{},headers:ul(uc(t.headers))},l=()=>{const d={...o,signal:r};if(n.runtimeId){const f=new URLSearchParams;n.region&&f.set("_runtime_region",n.region),n.retryProbe&&f.set("probe_retry","connect"),s&&f.set("_method","DELETE");const h=f.toString()?`${e.includes("?")?"&":"?"}${f.toString()}`:"";return fetch(Ta(`${lN}/web/runtime-proxy/${n.runtimeId}${e}${h}`),d)}if(n.base){const f=new Headers(d.headers);return f.set("X-AgentKit-Base",n.base),n.apiKey&&f.set("X-AgentKit-Key",n.apiKey),fetch(Ta(`${lN}/agentkit-proxy${e}`),{...d,headers:f})}return fetch(Ta(`${lN}${e}`),d)},c=async d=>{if(d.headers.get("X-Studio-Error-Source")==="upstream")return!1;if(wet(d))return!0;if(d.status!==401)return!1;try{return await get()}catch{return!1}};let u=await l();for(;await c(u);)await Oet(r),u=await l();return u}function yn(e,t={},n=ho){return gt(e,t,{},n)}function KAe(e){return typeof e=="string"?e:Array.isArray(e)?e.map(t=>{var n;if(t&&typeof t=="object"&&"msg"in t){const i=Array.isArray(t.loc)?(n=t.loc)==null?void 0:n.join("."):"",r=String(t.msg??"");return i?`${i}: ${r}`:r}return String(t)}).filter(Boolean).join(` `):e&&typeof e=="object"?JSON.stringify(e):""}async function htt(e){const t=await e.clone().text().catch(()=>"");if(!t)return"";try{const n=JSON.parse(t),i=n.detail??n.error;if(typeof i=="string")return i;if(i&&typeof i=="object"&&"code"in i)return String(i.code??"")}catch{return""}return""}async function Ft(e,t){const n=e.headers.get("X-Studio-Error-Source"),i=n==="upstream"?e.headers.get("X-Studio-Upstream-Status")??e.status:e.status,r=Q("common.fallbackWithHttpStatus",{fallback:t,status:i}),s=await e.text().catch(()=>"");if(n==="upstream")return Q("client.errorWithCloudResponse",{context:r,action:e.headers.get("X-Studio-Upstream-Action")??"",response:s||Q("client.emptyCloudResponse")});if(!s)return r;try{const o=JSON.parse(s),l=KAe(o.detail??o.error);return n==="transport"||n==="studio"?l?`${r} -${l}`:r:l?Q("client.errorWithDetailAndRawResponse",{context:r,detail:l,response:s}):Q("client.errorWithRawResponse",{context:r,response:s})}catch{return Q("client.errorWithRawResponse",{context:r,response:s})}}async function ptt(e){const t=await Ft(e,Q("client.mpaRuntimeSessionsLoadFailed"));return e.status===401&&/X-Jwt-Token/i.test(t)?Q("client.mpaRuntimeLegacyAuthUnsupported",{detail:t}):t}async function xz(e,t=!1){const n=await gt(`/web/model-api-keys${t?"?refresh=true":""}`,{signal:e,cache:"no-store"});if(!n.ok)throw new Error(await Ft(n,Q("client.loadArkApiKeysFailed")));return await n.json()}async function GAe(e,t){const n=await gt(`/web/model-api-keys/${encodeURIComponent(e)}/value`,{method:"POST",signal:t,cache:"no-store"});if(!n.ok)throw new Error(await Ft(n,Q("client.loadArkApiKeysFailed")));return await n.json()}async function $1(e){const t=new URLSearchParams;e!=null&&e.apiKeyId&&t.set("apiKeyId",e.apiKeyId),e!=null&&e.refresh&&t.set("refresh","true"),e!=null&&e.scope&&t.set("scope",e.scope);const n=t.toString(),i=await gt(`/web/model-options${n?`?${n}`:""}`,{signal:e==null?void 0:e.signal,cache:"no-store"});if(!i.ok)throw new Error(await Ft(i,Q("client.loadModelsFailed")));return await i.json()}async function XAe(){const e=await gt("/list-apps");if(!e.ok)throw new Error(`list-apps failed: ${e.status}`);return e.json()}class F1 extends Error{constructor(){super(Q("client.runtimeAccessDenied")),this.name="RuntimeAccessDeniedError"}}class Sa extends Error{constructor(t,n=!1,i=!1){super(t),this.unsupported=n,this.retryable=i,this.name="RuntimeProbeError"}}const YAe=()=>Q("client.privateRuntimeUnavailable"),ZAe=()=>Q("client.runtimeTemporarilyUnavailable"),KZ=["cn-beijing","cn-shanghai"],mtt=3e4,B1=5*60*1e3,JAe=60*1e3;let JE="volcengine";const Jx=new Map,ly=new Map,cy=new Map,rf=new Map,os=new Map;function wz(e,t,n){return`${t}:${e}:${n??""}`}function eTe(e){e!==JE&&os.clear(),JE=e}function RA(e){const t=(e||"").trim();if(JE==="byteplus")return[t&&!t.startsWith("cn-")?t:I8];const n=t&&!t.startsWith("ap-")?t:mz;return KZ.includes(n)?[n,...KZ.filter(i=>i!==n)]:[n]}function AD(e){const t=(e||"").trim();return t?[t]:RA()}function L0(...e){return e.map(t=>String(t??"")).join("")}function Eb(e,t,n){const i=e.get(t);return i!=null&&i.value&&Date.now()-i.updatedAt<=n?i.value:null}function Oz(e,t,n){return e.set(t,{value:n,updatedAt:Date.now()}),n}function X2(e,t){return t?t.aborted?Promise.reject(new DOMException("The operation was aborted.","AbortError")):new Promise((n,i)=>{const r=()=>{i(new DOMException("The operation was aborted.","AbortError"))};t.addEventListener("abort",r,{once:!0}),e.then(s=>{t.removeEventListener("abort",r),n(s)},s=>{t.removeEventListener("abort",r),i(s)})}):e}async function tTe(e){try{const t=await e.clone().json();return typeof t.detail=="string"?t.detail:""}catch{return""}}async function IA(e,t,n,i,r=ho){const s=await gt("/list-apps",{signal:i},n??{base:e,apiKey:t},r),o=n!=null&&n.runtimeId?await tTe(s):"";if(n!=null&&n.runtimeId&&o==="runtime_access_denied")throw new F1;if(n!=null&&n.runtimeId&&o==="runtime_private_endpoint_unreachable")throw new Sa(YAe());if(n!=null&&n.runtimeId&&["runtime_proxy_connect_error","runtime_proxy_timeout","runtime_json_connect_error","runtime_json_timeout"].includes(o))throw new Sa(ZAe(),!1,!0);if(n!=null&&n.runtimeId&&s.status===404)throw new Sa(Q("client.runtimeConnectionUnsupported"),!0,!0);if(n!=null&&n.runtimeId&&(s.status===401||s.status===403))throw new Sa(Q("client.runtimeConnectionDenied"));if(!s.ok)throw new Error(await Ft(s,Q("client.listAgentsFailed")));let l;try{l=await s.json()}catch{throw new Sa(Q("client.invalidListAppsJson"))}if(!Array.isArray(l)||l.some(u=>typeof u!="string"||!u.trim()))throw new Sa(Q("client.invalidListAppsFormat"));const c=l.map(u=>u.trim());return n!=null&&n.runtimeId&&Jx.set(wz(n.runtimeId,n.region??"",n.runtimeVersion),{apps:c,expiresAt:Date.now()+mtt}),c}async function nTe(e,t){const{app:n,ep:i}=Ia(e);if(L1(n,i)){const o=await gtt(i),l=await gt(`/api/v1/agents/${encodeURIComponent(o)}/profile-status`,{cache:"no-store"},i),c=!l.ok&&await htt(l)==="profile_not_found";if(!l.ok&&!c){const m=Q("client.createSessionFailedWithStatus",{status:l.status}),g=await Ft(l,Q("client.createSessionFailed"));throw new Error(g===m?m:Q("common.fallbackWithDetail",{fallback:m,detail:g}))}const u=c?{}:await l.json(),d=Number(u.profileRevision??0),f=await gt("/api/v1/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mpaInstanceId:o,profileRevision:d})},i);if(!f.ok){const m=Q("client.createSessionFailedWithStatus",{status:f.status}),g=await Ft(f,Q("client.createSessionFailed"));throw new Error(g===m?m:Q("common.fallbackWithDetail",{fallback:m,detail:g}))}const h=await f.json();return String(h.sessionId??h.id??"")}const r=await gt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"},i);if(!r.ok){const o=Q("client.createSessionFailedWithStatus",{status:r.status}),l=await Ft(r,Q("client.createSessionFailed"));throw new Error(l===o?o:Q("common.fallbackWithDetail",{fallback:o,detail:l}))}return(await r.json()).id}async function gtt(e){var i,r,s,o;const t=(i=e.mpaInstanceId)==null?void 0:i.trim();if(t)return t;const n=((r=e.runtimeId)==null?void 0:r.trim())??"";if(!n)return"";try{const l=await PD(n,e.region??"cn-beijing"),c=(s=l.mpaInstanceId)==null?void 0:s.trim();if(c)return c;const u=(o=l.envs.find(d=>d.key==="MPA_AGENT_ID"))==null?void 0:o.value.trim();if(u)return u}catch{}return n}async function kz(e,t){const{app:n,ep:i}=Ia(e);if(L1(n,i)){const s=await gt("/api/v1/sessions",{cache:"no-store"},i);if(!s.ok)throw new Error(await ptt(s));const o=await s.json();return Array.isArray(o)?o:o.sessions??[]}const r=await gt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{},i);if(!r.ok)throw new Error(await Ft(r,Q("client.listSessionsFailed")));return r.json()}async function eC(e,t,n){const{app:i,ep:r}=Ia(e);if(L1(i,r)){const l=await gt(`/api/v1/sessions/${encodeURIComponent(n)}`,{cache:"no-store"},r);if(!l.ok){const f=await Ft(l,Q("client.getSessionFailed"));throw new Error(Q("client.getSessionFailedWithDetail",{status:l.status,detail:f}))}const c=await l.json(),u=await gt(`/api/v1/sessions/${encodeURIComponent(n)}/events`,{cache:"no-store"},r);if(!u.ok){const f=await Ft(u,Q("client.getSessionFailed"));throw new Error(Q("client.getSessionFailedWithDetail",{status:u.status,detail:f}))}const d=await u.json();return c.events=Array.isArray(d.events)?d.events:[],c}const s=await gt(`/apps/${i}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}`,{},r);if(!s.ok){const l=await Ft(s,Q("client.getSessionFailed"));throw new Error(Q("client.getSessionFailedWithDetail",{status:s.status,detail:l}))}const o=await s.json();if(r.runtimeId){const l=bz(r.runtimeId,i,t,n);o.state={...yz()[l]??{},...o.state??{}}}return o}async function iTe(e){const{app:t,ep:n}=Ia(e.appName);if(!n.runtimeId)throw new Error(Q("client.feedbackRuntimeOnly"));if(!n.region)throw new Error(Q("client.feedbackRegionMissing"));const i=await gt("/web/evaluation/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:n.runtimeId,region:n.region,appName:t,userId:e.userId,sessionId:e.sessionId,eventId:e.eventId,rating:e.rating,comment:e.comment??""})},{},mr);if(!i.ok)throw new Error(await Ft(i,Q("client.submitFeedbackFailed")));const r=await i.json(),s=bz(n.runtimeId,t,e.userId,e.sessionId);return ftt(s,e.eventId,r),r}async function TD(e,t={}){const n=L0(e.runtimeId,e.region||"cn-beijing",e.appName,e.pageSize??100),i=Eb(rf,n,JAe);if(!t.force&&i)return i;const r=rf.get(n);if(!t.force&&(r!=null&&r.promise))return r.promise;let s=null;const o=(async()=>{for(const l of AD(e.region)){const c=new URLSearchParams({runtimeId:e.runtimeId,region:l,appName:e.appName,page_size:String(e.pageSize??100)}),u=await gt(`/web/evaluation/feedback-cases?${c.toString()}`);if(u.ok)return Oz(rf,n,await u.json());s=new Error(await Ft(u,Q("client.loadEvaluationSetsFailed")))}throw s??new Error(Q("client.loadEvaluationSetsFailed"))})();rf.set(n,{...r,promise:o,updatedAt:(r==null?void 0:r.updatedAt)??0});try{return await o}finally{const l=rf.get(n);(l==null?void 0:l.promise)===o&&rf.set(n,{value:l.value,updatedAt:l.updatedAt})}}async function P8(e){let t=null;for(const n of AD(e.region)){const i=new URLSearchParams({runtimeId:e.runtimeId,region:n,appName:e.appName,userId:e.userId}),r=await gt(`/web/evaluation/statuses?${i.toString()}`);if(r.ok)return r.json();t=new Error(await Ft(r,Q("client.loadAutoEvaluationStatusFailed")))}throw t??new Error(Q("client.loadAutoEvaluationStatusFailed"))}async function rTe(e){let t=null;for(const n of AD(e.region)){const i=new URLSearchParams({runtimeId:e.runtimeId,region:n,appName:e.appName}),r=await gt(`/web/evaluation/optimizations?${i.toString()}`);if(r.ok)return r.json();t=new Error(await Ft(r,Q("client.loadOptimizationsFailed")))}throw t??new Error(Q("client.loadOptimizationsFailed"))}function sTe(e){return Eb(rf,L0(e.runtimeId,e.region||"cn-beijing",e.appName,e.pageSize??100),JAe)}function btt(e){TD(e).catch(()=>{})}function aTe(e){TD(e,{force:!0}).catch(()=>{})}function oTe(e,t){return["good","bad"].map(n=>{const i=e.find(r=>r.kind===n);return{kind:n,evaluationSetId:(i==null?void 0:i.evaluationSetId)??null,evaluationSetName:(i==null?void 0:i.evaluationSetName)??null,workspaceId:(i==null?void 0:i.workspaceId)??null,itemCount:t.filter(r=>r.kind===n).length}})}function lN(e){const t=e.comment??"",n=e.rating==="bad"&&!!t.trim();for(const[i,r]of rf.entries()){const s=r.value;if(!s||s.runtimeId!==e.runtimeId||s.agentName!==e.appName)continue;const o=s.items.filter(c=>c.sessionId!==e.sessionId||c.messageId!==e.messageId),l=e.rating?[{id:`local:${e.runtimeId}:${e.sessionId}:${e.messageId}`,itemKey:`local:${e.messageId}`,kind:e.rating,input:e.input,output:e.output,referenceOutput:e.referenceOutput??e.output,comment:t,agentName:e.appName,sessionId:e.sessionId,messageId:e.messageId,runtimeId:e.runtimeId,invocationId:e.invocationId??"",userId:e.userId,createdAt:e.createdAt??new Date().toISOString(),evaluationSetId:"",evaluationSetName:"",workspaceId:"",source:"user",score:n?0:null,reason:n?t:""},...o]:o;rf.set(i,{value:{...s,sets:oTe(s.sets,l),items:l},updatedAt:Date.now(),promise:r.promise})}}async function lTe(e){let t=null;for(const n of AD(e.region)){const i=await gt("/web/evaluation/feedback-cases/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e.runtimeId,region:n,appName:e.appName,itemIds:e.itemIds})},{},mr);if(i.ok){const r=await i.json(),s=new Set(e.itemIds);for(const[o,l]of rf.entries()){const c=l.value;if(!c||c.runtimeId!==e.runtimeId||c.agentName!==e.appName)continue;const u=c.items.filter(d=>!s.has(d.id));rf.set(o,{value:{...c,sets:oTe(c.sets,u),items:u},updatedAt:Date.now()})}return r}t=new Error(await Ft(i,Q("client.deleteEvaluationCaseFailed")))}throw t??new Error(Q("client.deleteEvaluationCaseFailed"))}async function D8(e,t,n){const{app:i,ep:r}=Ia(e);if(L1(i,r)){const o=await gt(`/api/v1/sessions/${encodeURIComponent(n)}`,{method:"DELETE"},r);if(!o.ok&&o.status!==404)throw new Error(`delete session failed: ${o.status}`);return}const s=await gt(`/apps/${i}/users/${encodeURIComponent(t)}/sessions/${n}`,{method:"DELETE"},r);if(!s.ok&&s.status!==404)throw new Error(`delete session failed: ${s.status}`)}function ytt(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"="),i=window.atob(n),r=new Uint8Array(i.length);for(let s=0;sURL.revokeObjectURL(l),0)}async function uTe(e,t,n,i,r){const{app:s,ep:o}=Ia(e),l=r==null?"":`?version=${encodeURIComponent(r)}`,c=`/apps/${encodeURIComponent(s)}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}/artifacts/${encodeURIComponent(i)}${l}`,u=await gt(c,{},o,mr);if(!u.ok)throw new Error(await Ft(u,Q("client.downloadFileFailed")));const d=await u.json(),f=d.inlineData??d.inline_data;if(!(f!=null&&f.data))throw new Error(Q("client.fileUnavailable"));const h=ytt(f.data),m=h.buffer.slice(h.byteOffset,h.byteOffset+h.byteLength);return{blob:new Blob([m],{type:f.mimeType??f.mime_type??"application/octet-stream"}),downloadName:f.displayName??f.display_name??i}}async function Ez(e,t,n,i,r){const{blob:s}=await uTe(e,t,n,i,r);return URL.createObjectURL(s)}async function vtt(e){const t=await gt("/web/media/capabilities");if(!t.ok)throw new Error(await Ft(t,"media capabilities failed"));return t.json()}async function dTe(e,t,n,i){const{app:r}=Ia(e),s=new FormData;s.set("app_name",r),s.set("user_id",t),s.set("session_id",n),s.set("file",i);const o=await gt("/web/media",{method:"POST",body:s},{},mr);if(!o.ok)throw new Error(await Ft(o,Q("client.uploadFileFailed")));return{...await o.json(),status:"ready"}}async function M8(e,t,n){const{app:i}=Ia(e),r=`/web/media/${encodeURIComponent(i)}/${encodeURIComponent(t)}/${encodeURIComponent(n)}/delete`,s=await gt(r,{method:"POST"});if(!s.ok&&s.status!==404)throw new Error(await Ft(s,"media cleanup failed"))}function fTe(e){try{const t=new URL(e);if(t.protocol!=="veadk-media:"||t.hostname!=="apps")return;const n=t.pathname.split("/").filter(Boolean).map(decodeURIComponent);return n.length!==7||n[1]!=="users"||n[3]!=="sessions"||n[5]!=="media"?void 0:`/web/media/${n.map(encodeURIComponent).filter((i,r)=>![1,3,5].includes(r)).join("/")}`}catch{return}}async function cN(e,t){const n=fTe(t);if(!n)throw new Error("Invalid VeADK media URI");const i=await gt(`${n}/delete`,{method:"POST"});if(!i.ok&&i.status!==404)throw new Error(await Ft(i,"media cleanup failed"))}function hTe(e,t){if(t.startsWith("data:")||t.startsWith("blob:")||/^https?:/.test(t))return t;const n=fTe(t);if(!n)return t;const i=`${n}/content`;return ja(`${oN}${i}`)}async function YR(e,t,n){const{app:i,ep:r}=Ia(e);let s;if(r.runtimeId){const c=new URLSearchParams({runtimeId:r.runtimeId,sessionId:t,region:r.region??"cn-beijing"});if(n&&c.set("endTimeMs",String(Math.round(n))),s=await gt(`/web/runtime-trace?${c.toString()}`),s.status===404)throw new Error(Q("client.traceDisabled"))}else s=await gt(`/dev/apps/${encodeURIComponent(i)}/debug/trace/session/${encodeURIComponent(t)}`,{},r);if(!s.ok)throw new Error(await Ft(s,Q("client.loadTraceFailed")));const o=s.headers.get("content-type")??"";if(!o.includes("application/json")){const c=o.split(";",1)[0]||Q("client.contentTypeMissing");throw new Error(Q("client.traceNonJson",{contentType:c}))}const l=await s.json();if(!Array.isArray(l))throw new Error(Q("client.invalidTraceFormat"));return l}async function L8(e){const t=await gt("/web/issue-feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await Ft(t,Q("client.submitIssueFeedbackFailed")));if((await t.json()).submitted!==!0)throw new Error(Q("client.issueFeedbackNotConfirmed"));return{submitted:!0}}async function GZ(e,t,n=!0,i){const r=await gt(`/web/agent-info/${e}`,{signal:i},t);if(!r.ok)throw new Error(`agent-info failed: ${r.status}`);const s=await r.json();if(n&&!s.draft)try{const o=await gt(`/web/agent-draft/${e}`,{},t);if(o.ok){const l=await o.json();s.draft=l.draft}}catch{}return{appName:e,agentCategory:s.agentCategory,mpa:s.mpa,name:s.name??e,description:s.description??"",type:s.type,model:s.model??"",selectableModels:s.selectableModels??[],turnLifecycleControl:s.turnLifecycleControl,resourceTopology:s.resourceTopology,tools:s.tools??[],skillsPreviewSupported:Array.isArray(s.skills),skills:s.skills??[],subAgents:s.subAgents??[],components:s.components??[],searchSources:s.searchSources??[],graph:s.graph,draft:s.draft}}function xtt(e){return/agent-info failed:\s*404\b/i.test(String(e))}async function pTe(e,t,n=!0,i){try{return await GZ(e,t,n,i)}catch(r){if(e==="a2a-default"||!xtt(r))throw r;return GZ("a2a-default",t,n,i)}}class _D extends Error{constructor(t){super("Turn state changed before the control request completed"),this.authoritativeState=t,this.name="TurnControlConflictError"}}async function mTe(e,t){const{ep:n}=Ia(e),i=await gt(`/api/v1/a2a/tasks/by-session/${encodeURIComponent(t)}/control`,{cache:"no-store"},n);if(!i.ok)throw new Error(await Ft(i,"turn control failed"));return i.json()}async function gTe(e,t,n,i){var o;const{ep:r}=Ia(e),s=await gt(`/api/v1/a2a/tasks/by-session/${encodeURIComponent(t)}/control/${n}`,{method:"POST",headers:{"Content-Type":"application/json","Idempotency-Key":crypto.randomUUID()},body:JSON.stringify({expectedGeneration:i})},r);if(s.status===409){const l=await s.json().catch(()=>null);if((o=l==null?void 0:l.detail)!=null&&o.taskId)throw new _D(l.detail)}if(!s.ok)throw new Error(await Ft(s,"turn control failed"));return s.json()}async function wtt(e,t,n,i,r){var c;const{ep:s}=Ia(e),o=await gt(`/api/v1/a2a/tasks/${encodeURIComponent(n)}/continue`,{method:"POST",headers:{"Content-Type":"application/json","Idempotency-Key":r},body:JSON.stringify({expectedGeneration:i})},s);if(o.status===409){const u=await o.json().catch(()=>null);if((c=u==null?void 0:u.detail)!=null&&c.taskId)throw new _D(u.detail)}if(!o.ok)throw new Error(await Ft(o,"turn continue failed"));const l=await o.json();if(l.sessionId!==t)throw new Error("turn continue returned a different session");return l}async function*bTe({appName:e,sessionId:t,taskId:n,expectedGeneration:i,idempotencyKey:r,lastEventId:s,signal:o,onRuntimeContext:l}){const{ep:c}=Ia(e),u=(s==null?void 0:s.trim())??"",d=Tz(o);let f;try{const g=await gt(`/api/v1/a2a/tasks/${encodeURIComponent(n)}/continue`,{method:"POST",headers:{"Content-Type":"application/json","Idempotency-Key":r},body:JSON.stringify({expectedGeneration:i}),signal:d.signal},c,0),b=XR(g,c.runtimeId??"",c.region??"");if(b&&(l==null||l(b)),!g.ok){d.cleanup();const y=await Ft(g,"turn continue failed");throw new Error(Jo(Q("client.runSseFailedWithDetail",{status:g.status,detail:y})))}const v=await g.json();if(v.sessionId!==t)throw d.cleanup(),new Error(Jo("turn continue returned a different session"));f=await gt(`/api/v1/sessions/${encodeURIComponent(t)}/sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invocationId:v.invocationId,...u?{lastEventId:u}:{}}),signal:d.signal},c,0)}catch(g){throw d.cleanup(),d.timedOut()?new Error(Xg()):o!=null&&o.aborted||(g==null?void 0:g.name)==="AbortError"?g:new Error(Jo(g))}const h=XR(f,c.runtimeId??"",c.region??"");if(h&&(l==null||l(h)),!f.ok){d.cleanup();const g=await Ft(f,Q("client.runSessionFailed"));throw new Error(Jo(Q("client.runSseFailedWithDetail",{status:f.status,detail:g})))}let m=!1;try{for await(const g of NA(f)){if(g&&typeof g=="object"&&g[ZE]==="done"){d.clearDeadline();break}m=!0,d.clearDeadline();const b={...g};delete b[ZE],typeof b.error=="string"&&(b.error=Jo(b.error)),typeof b.errorMessage=="string"&&(b.errorMessage=Jo(b.errorMessage)),typeof b.error_message=="string"&&(b.error_message=Jo(b.error_message)),yield b}}catch(g){throw d.timedOut()?new Error(Xg()):o!=null&&o.aborted||(g==null?void 0:g.name)==="AbortError"?g:new Error(Jo(g))}finally{d.cleanup()}if(!m)throw new Error(Az())}async function $8(e,t){const{app:n,ep:i}=Ia(e);return pTe(n,i,!1,t)}async function Ott(e,t,n){let i=null;for(const r of RA(t)){const s={runtimeId:e,region:r};try{const o=wz(e,r),l=Jx.get(o);l&&l.expiresAt<=Date.now()&&Jx.delete(o);const c=Jx.get(o),u=n||(c==null?void 0:c.apps[0])||(await IA("","",s))[0];if(!u)throw new Error(Q("client.noPreviewableAgent"));return pTe(u,s)}catch(o){if(o instanceof F1||o instanceof Sa&&!o.unsupported)throw o;i=o instanceof Error?o:new Error(String(o))}}throw i??new Error(Q("client.noPreviewableAgent"))}async function Cz(e,t,n={},i={}){const r=typeof n=="string"?n:void 0,s=typeof n=="string"?i:n,o=L0(e,t||"cn-beijing",r??""),l=Eb(ly,o,B1);if(!s.force&&l)return l;const c=ly.get(o);if(!s.force&&(c!=null&&c.promise))return c.promise;const u=Ott(e,t,r).then(d=>Oz(ly,o,d));ly.set(o,{...c,promise:u,updatedAt:(c==null?void 0:c.updatedAt)??0});try{return await u}finally{const d=ly.get(o);(d==null?void 0:d.promise)===u&&ly.set(o,{value:d.value,updatedAt:d.updatedAt})}}function yTe(e,t,n=""){return Eb(ly,L0(e,t||"cn-beijing",n),B1)}function vTe(e,t,n=""){Cz(e,t,n).catch(()=>{})}function ZR(e){const{app:t,ep:n}=Ia(e);return L1(t,n)}function rp(e){const{app:t,ep:n}=Ia(e);return t==="a2a-default"&&!!(n.runtimeId&&(n.agentCategory==="mpa"||n.mpaInstanceId))}async function xTe(e,t,n,i){const{app:r,ep:s}=Ia(e),o=new URLSearchParams({source:t,app_name:r,q:n,user_id:i}),l=await gt(`/web/search?${o.toString()}`,{},s);if(!l.ok)throw new Error(await Ft(l,Q("client.agentSearchFailed")));return l.json()}async function wTe(e,t){const{app:n}=Ia(e),i=await gt(`/web/search?source=web&app_name=${encodeURIComponent(n)}&q=${encodeURIComponent(t)}`);if(!i.ok)throw new Error(`web search failed: ${i.status}`);return i.json()}function Az(){return Jo(Q("client.emptySseBody"))}function rS(){return Jo(Q("client.noDisplayableSseReply"))}const ktt=6e4;function Xg(){return Q("client.firstSseEventTimeout")}function Tz(e){if(e!=null&&e.aborted)return{signal:e,clearDeadline:()=>{},cleanup:()=>{},timedOut:()=>!1};const t=new AbortController;let n=!1,i=!1;const r=()=>{i||(i=!0,clearTimeout(o))},s=()=>{t.signal.aborted||t.abort((e==null?void 0:e.reason)??new DOMException("Aborted","AbortError"))},o=setTimeout(()=>{i||t.signal.aborted||(n=!0,i=!0,t.abort(new Error(Xg())))},ktt);return e==null||e.addEventListener("abort",s,{once:!0}),{signal:t.signal,clearDeadline:r,cleanup:()=>{r(),e==null||e.removeEventListener("abort",s)},timedOut:()=>n}}async function*F8({appName:e,userId:t,sessionId:n,text:i,modelId:r,idempotencyKey:s,executionConfigVersion:o,lastEventId:l,attachments:c=[],invocation:u,platformTools:d,environmentMounts:f,environmentMount:h,functionResponses:m=[],signal:g,onRuntimeContext:b}){const{app:v,ep:y}=Ia(e),w=c.flatMap(I=>I.status&&I.status!=="ready"?[]:I.uri?[{fileData:{mimeType:I.mimeType,fileUri:I.uri,displayName:I.name},partMetadata:{veadkMedia:{id:I.id,uri:I.uri,name:I.name,mimeType:I.mimeType,sizeBytes:I.sizeBytes}}}]:I.data?[{inlineData:{mimeType:I.mimeType,data:I.data,displayName:I.name}}]:[]),x=u&&(u.skills.length>0||u.targetAgent)?u:void 0,O=[...w,...m.map(I=>({functionResponse:{id:I.id,name:I.name,response:I.response}})),...i.trim()?[{text:i}]:[]];if(x&&O.length>0){const I=O[0],D=I.partMetadata;O[0]={...I,partMetadata:{...D,veadkInvocation:x}}}const k=(s==null?void 0:s.trim())??"",S=(l==null?void 0:l.trim())??"",C=typeof o=="number",E=C||k?{veadkExecution:{...C?{executionConfigVersion:o}:{},...k?{idempotencyKey:k}:{}}}:void 0,j=x||E?{...x?{veadkInvocation:x}:{},...E??{}}:void 0,T=L1(v,y);if(T&&y.runtimeId){const I=y.region?`?region=${encodeURIComponent(y.region)}`:"";try{const D=await vn(`/web/mpa/identity-prewarm/${encodeURIComponent(y.runtimeId)}${I}`,{method:"POST",headers:{"X-Requested-With":"XMLHttpRequest"},signal:g},1e4);D.ok||console.warn("[mpa] identity prewarm unavailable",D.status)}catch(D){if(g!=null&&g.aborted)throw D;console.warn("[mpa] identity prewarm unavailable")}}let R;const A=Tz(g);try{if(T){const I=await gt(`/api/v1/sessions/${encodeURIComponent(n)}/run`,{method:"POST",headers:{"Content-Type":"application/json",...k?{"Idempotency-Key":k}:{}},body:JSON.stringify({content:i,...C?{executionConfigVersion:o}:{}}),signal:A.signal},y,0),D=XR(I,y.runtimeId??"",y.region??"");if(D&&(b==null||b(D)),!I.ok){A.cleanup();const L=await Ft(I,Q("client.runSessionFailed"));throw new Error(Jo(Q("client.runSseFailedWithDetail",{status:I.status,detail:L})))}const _=await I.json();R=await gt(`/api/v1/sessions/${encodeURIComponent(n)}/sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invocationId:_.invocationId,...S?{lastEventId:S}:{}}),signal:A.signal},y,0)}else R=await gt("/run_sse",{method:"POST",headers:{"Content-Type":"application/json",...k?{"Idempotency-Key":k}:{}},body:JSON.stringify({app_name:v,user_id:t,session_id:n,new_message:{role:"user",parts:O},streaming:!0,...S?{lastEventId:S}:{},...C?{executionConfigVersion:o}:{},...r!=null&&r.trim()?{model_id:r.trim()}:{},...d!==void 0?{platform_tools:[...d]}:{},...f!==void 0?{environment_mounts:[...f]}:h?{environment_mount:h}:{},custom_metadata:j}),signal:A.signal},y,0)}catch(I){throw A.cleanup(),A.timedOut()?new Error(Xg()):g!=null&&g.aborted||(I==null?void 0:I.name)==="AbortError"?I:new Error(Jo(I))}const N=XR(R,y.runtimeId??"",y.region??"");if(N&&(b==null||b(N)),!R.ok){A.cleanup();const I=await Ft(R,Q("client.runSessionFailed"));throw new Error(Jo(Q("client.runSseFailedWithDetail",{status:R.status,detail:I})))}let P=!1;try{for await(const I of NA(R)){if(I&&typeof I=="object"&&I[ZE]==="done"){A.clearDeadline();break}P=!0,A.clearDeadline();const D={...I};delete D[ZE],typeof D.error=="string"&&(D.error=Jo(D.error)),typeof D.errorMessage=="string"&&(D.errorMessage=Jo(D.errorMessage)),typeof D.error_message=="string"&&(D.error_message=Jo(D.error_message)),yield D}}catch(I){throw A.timedOut()?new Error(Xg()):g!=null&&g.aborted||(I==null?void 0:I.name)==="AbortError"?I:new Error(Jo(I))}finally{A.cleanup()}if(!P)throw new Error(Az())}class ew extends Error{constructor(n,{status:i,code:r,currentState:s}){super(n);Zt(this,"status");Zt(this,"code");Zt(this,"currentState");this.name="MpaExecutionConfigRequestError",this.status=i,this.code=r,this.currentState=s}}async function _z(e){const t=Q("client.mpaExecutionConfigFailed"),n=await e.text().catch(()=>"");if(!n)return new ew(Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),{status:e.status,code:""});try{const i=JSON.parse(n),r=i.error&&typeof i.error=="object"?i.error:i.detail&&typeof i.detail=="object"?i.detail:null,s=KAe(i.detail??i.error),o=s?Q("client.errorWithDetailAndRawResponse",{context:Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),detail:s,response:n}):Q("client.errorWithRawResponse",{context:Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),response:n});return new ew(o,{status:e.status,code:String((r==null?void 0:r.code)??""),currentState:(r==null?void 0:r.currentState)??i.currentState})}catch{return new ew(Q("client.errorWithRawResponse",{context:Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),response:n}),{status:e.status,code:""})}}function PA(e){var r,s,o;const t=(e.selectedSkills??[]).map(l=>({source:l.source,folder:l.folder,name:l.name,skillSpaceId:l.skillSpaceId,skillSpaceName:l.skillSpaceName,skillSpaceRegion:l.skillSpaceRegion,skillId:l.skillId,version:l.version})),n=(e.skills??[]).map(l=>({name:l})),i=(e.mcpTools??[]).map(l=>({name:l.name,transport:l.transport,url:l.url}));return{name:((r=e.name)==null?void 0:r.trim())||"mpa-agent",description:e.description??"",system:((s=e.instruction)==null?void 0:s.trim())||"You are a helpful assistant.",model:{id:e.modelName||e.model||"",source:e.modelSource??"ark",provider:e.modelProvider??"",apiBase:e.modelApiBase??""},tools:[...(e.builtinTools??[]).map(l=>({id:l,source:"builtin"})),...(e.tools??[]).map(l=>({name:l,source:"legacy"})),...(e.customTools??[]).map(l=>({name:l.name,description:l.description,source:"custom"}))],skills:[...t,...n],mcpServers:i,...(o=e.subAgents)!=null&&o.length?{multiagent:{type:e.agentType??"llm",subAgents:e.subAgents.map(PA)}}:{},metadata:{"veadk:agent-type":"mpa","veadk:source":"studio-agent-draft",agentType:e.agentType??"llm"}}}async function jz(e){const t={operationKind:e.operationKind,runtimeId:e.runtimeId,region:e.region,mpaInstanceId:e.mpaInstanceId,sourceProfileId:e.sourceProfileId,targetKey:e.targetKey,runtimeRevision:e.runtimeRevision,profile:PA(e.draft)},n=e.operationKind==="update"?`/web/mpa/agents/${encodeURIComponent(e.mpaInstanceId)}`:"/web/mpa/agents",i=await gt(n,{method:e.operationKind==="update"?"PATCH":"POST",headers:{"Content-Type":"application/json","Idempotency-Key":e.idempotencyKey},body:JSON.stringify(t)});if(!i.ok)throw new Error(await Ft(i,Q("client.mpaOperationFailed")));return await i.json()}async function JR(e){var r,s,o,l;const t=e.runtimeId.trim(),n=((r=e.mpaInstanceId)==null?void 0:r.trim())||t,i=(s=e.sourceDraftId)!=null&&s.trim()?`studio-draft:${e.sourceDraftId.trim()}`:`studio-agent:${e.agentName}:${e.taskId}`;return jz({operationKind:e.operationKind,runtimeId:t,region:e.region,mpaInstanceId:n,sourceProfileId:i,draft:e.draft,targetKey:e.operationKind==="update"?n:`runtime:${e.region}:${((o=e.runtimeName)==null?void 0:o.trim())||n}`,runtimeRevision:((l=e.runtimeRevision)==null?void 0:l.trim())||void 0,idempotencyKey:`${e.taskId}:mpa-profile`})}async function OTe(){const e=await gt("/web/mpa/agent-operations?status=active",{cache:"no-store"});if(!e.ok)throw new Error(await Ft(e,Q("client.mpaOperationLoadFailed")));return(await e.json()).operations??[]}async function kTe(e,t){const n=await gt(`/web/mpa/agent-operations/${encodeURIComponent(e)}`,{cache:"no-store",signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.mpaOperationLoadFailed")));return await n.json()}async function STe(e){const t=new URLSearchParams({runtimeId:e.runtimeId,region:e.region}),n=await gt(`/web/mpa/agents/${encodeURIComponent(e.mpaInstanceId)}/profile-status?${t.toString()}`,{cache:"no-store",signal:e.signal});if(!n.ok)throw new Error(await Ft(n,Q("client.mpaOperationLoadFailed")));const i=await n.json();return{operationId:String(i.operationId??""),status:String(i.status??""),profileRevision:Number(i.profileRevision??0),runtimeRevision:String(i.runtimeRevision??""),etag:String(i.etag??n.headers.get("ETag")??"")}}async function ETe(e){const t=new URLSearchParams({region:e.region??"all"});e.runtimeId&&t.set("runtimeId",e.runtimeId);const n=await gt(`/web/mpa/agents/${encodeURIComponent(e.mpaInstanceId)}/view?${t.toString()}`,{cache:"no-store",signal:e.signal});if(!n.ok)throw new Error(await Ft(n,Q("client.mpaOperationLoadFailed")));return await n.json()}async function CTe(e){const t=new URLSearchParams({runtimeId:e.runtimeId,region:e.region}),n=await gt(`/web/mpa/agents/${encodeURIComponent(e.mpaInstanceId)}/delete-preview?${t.toString()}`,{cache:"no-store",signal:e.signal});if(!n.ok)throw new Error(await Ft(n,Q("client.mpaDeletePreviewFailed")));return await n.json()}async function ATe(e){const t={runtimeId:e.runtimeId,region:e.region},n=await gt(`/api/v1/runtime-console/admin/sessions/${encodeURIComponent(e.sessionId)}/runs`,{cache:"no-store",signal:e.signal},t);if(!n.ok)throw new Error(await Ft(n,Q("client.loadMpaDiagnosticsFailed")));return await n.json()}async function TTe(e){const t={runtimeId:e.runtimeId,region:e.region},n=new URLSearchParams({sessionId:e.sessionId}),i=await gt(`/api/v1/runtime-console/admin/runs/${encodeURIComponent(e.invocationId)}/trace?${n.toString()}`,{cache:"no-store",signal:e.signal},t);if(!i.ok)throw new Error(await Ft(i,Q("client.loadMpaDiagnosticsFailed")));return await i.json()}async function Nz(e,t){const n=await gt(`/web/mpa/agent-operations/${encodeURIComponent(e)}/retry`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operationKind:t.operationKind,runtimeId:t.runtimeId,region:t.region,mpaInstanceId:t.mpaInstanceId,sourceProfileId:t.sourceProfileId,targetKey:t.targetKey,runtimeRevision:t.runtimeRevision,profile:PA(t.draft)})});if(!n.ok)throw new Error(await Ft(n,Q("client.mpaOperationFailed")));return await n.json()}async function Rz(e){const t=new URLSearchParams({runtimeId:e.runtimeId,region:e.region}),n=await gt(`/web/mpa/sessions/${encodeURIComponent(e.sessionId)}/execution-config?${t.toString()}`,{cache:"no-store",signal:e.signal});if(!n.ok)throw await _z(n);return await n.json()}async function B8(e){const t=await gt(`/web/mpa/sessions/${encodeURIComponent(e.sessionId)}/execution-config`,{method:"PATCH",headers:{"Content-Type":"application/json","If-Match":e.etag},body:JSON.stringify({runtimeId:e.runtimeId,region:e.region,changes:e.changes})});if(!t.ok)throw await _z(t);return await t.json()}async function _Te(e){const t=await gt(`/web/mpa/sessions/${encodeURIComponent(e.sessionId)}/profile-upgrade`,{method:"POST",headers:{"Content-Type":"application/json","If-Match":e.etag,"Idempotency-Key":e.idempotencyKey},body:JSON.stringify({runtimeId:e.runtimeId,region:e.region,targetProfileRevision:e.targetProfileRevision})});if(!t.ok)throw await _z(t);return await t.json()}async function jD(e,t){const n=new URLSearchParams({name:e,region:t}),i=await gt(`/web/runtime-name-availability?${n.toString()}`,{cache:"no-store"});if(!i.ok)throw new Error(await Ft(i,Q("client.checkRuntimeNameFailed")));const r=await i.json();if(typeof r.available!="boolean")throw new Error(Q("client.invalidRuntimeNameCheck"));return{available:r.available}}async function jTe(e,t){const n=new URLSearchParams({kind:e.kind,region:e.region});e.registry&&n.set("registry",e.registry),e.namespace&&n.set("namespace",e.namespace),e.workspaceId&&n.set("workspaceId",e.workspaceId),e.search&&n.set("search",e.search),e.pageNumber&&n.set("pageNumber",String(e.pageNumber)),e.pageSize&&n.set("pageSize",String(e.pageSize));const i=await gt(`/web/deployment-resources?${n.toString()}`,{signal:t});if(!i.ok)throw new Error(await Ft(i,Q("client.loadCloudResourcesFailed")));const r=await i.json();if(typeof r.serviceRegion!="string"||!Array.isArray(r.items)||typeof r.pageNumber!="number"||typeof r.pageSize!="number"||typeof r.totalCount!="number"||typeof r.hasMore!="boolean")throw new Error(Q("client.invalidCloudResources"));const s=r.items.map(o=>{if(!o||typeof o!="object"||typeof o.id!="string"||typeof o.name!="string"||typeof o.region!="string"||typeof o.status!="string")throw new Error(Q("client.invalidCloudResources"));return o});return{serviceRegion:r.serviceRegion,items:s,pageNumber:r.pageNumber,pageSize:r.pageSize,totalCount:r.totalCount,hasMore:r.hasMore}}function NTe(e,t){const n=e;if(!n||typeof n!="object"||!Array.isArray(n.mounts))throw new Error(Q("client.invalidEnvironmentMount"));if(n.mounts.length!==t.length)throw new Error(Q("client.environmentMountMismatch"));return n.mounts.map((i,r)=>{const s=t[r];if(!i||typeof i!="object"||typeof i.environment_id!="string"||typeof i.environment_version_id!="string"||typeof i.mount_instance_id!="string"||typeof i.sandbox_session_id!="string"||!i.environment_id||!i.environment_version_id||!i.mount_instance_id||!i.sandbox_session_id)throw new Error(Q("client.invalidEnvironmentMount"));if(i.environment_id!==s.environment_id||i.environment_version_id!==s.environment_version_id||s.mount_instance_id!==void 0&&i.mount_instance_id!==s.mount_instance_id)throw new Error(Q("client.environmentMountMismatch"));return i})}async function RTe({runtimeId:e,appName:t,userId:n,sessionId:i,environmentMounts:r}){const{app:s}=Ia(t);let o;try{o=await gt("/web/v3/session-environment-mounts/prepare",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtime_id:e,app_name:s,user_id:n,session_id:i,environment_mounts:[...r]})})}catch(l){throw l instanceof TypeError?new Error(Q("client.environmentMountNetworkFailed")):l}if(!o.ok)throw new Error(await Ft(o,Q("client.environmentMountFailed")));return NTe(await o.json(),r)}function Iz(e){const t=new Set,n=[];for(const i of e.split(/[,,\n\r]+/)){const r=i.trim();!r||t.has(r)||(t.add(r),n.push(r))}return n}async function ITe(e,t=typeof navigator>"u"?void 0:navigator.clipboard){if(!(t!=null&&t.writeText))throw new Error(Q("client.clipboardUnsupported"));try{await t.writeText(e)}catch{throw new Error(Q("client.clipboardWriteFailed"))}}const XZ={codex:0,codex_snapshot:1,deepseek_harness:2,deepseek_harness_snapshot:3,openclaw:4,openclaw_snapshot:5,hermes:6,hermes_snapshot:7,dev:8};async function PTe(e){var r;const t=await gt("/web/system-info",{signal:e});if(!t.ok)throw new Error(await Ft(t,Q("client.loadSystemInfoFailed")));const n=await t.json();if(typeof((r=n.storage)==null?void 0:r.tosAddress)!="string"||!Array.isArray(n.sandboxTools))throw new Error(Q("client.invalidSystemInfo"));const i=n.sandboxTools.map(s=>{if(!s||typeof s!="object"||typeof s.kind!="string"||typeof s.label!="string"||typeof s.toolId!="string"||typeof s.snapshot!="boolean"||typeof s.needsModelEnvUpdate!="boolean"||typeof s.canUpdateModelEnv!="boolean"||typeof s.modelEnvError!="string"||typeof s.modelEnvErrorCode!="string")throw new Error(Q("client.invalidSystemInfo"));return s}).sort((s,o)=>(XZ[s.kind]??Number.MAX_SAFE_INTEGER)-(XZ[o.kind]??Number.MAX_SAFE_INTEGER));return{storage:{tosAddress:n.storage.tosAddress},sandboxTools:i}}const DTe=new Set(["preparing","queued","building","scanning","available","failed"]);function Pz(e){if(e===null)return null;if(!e||typeof e!="object")throw new Error(Q("client.invalidEnvironmentBuild"));const t=e;if(typeof t.versionId!="string"||!DTe.has(t.status)||typeof t.image!="string"||typeof t.error!="string"||typeof t.createdAt!="string"||typeof t.updatedAt!="string"||t.resources!==null&&typeof t.resources!="object")throw new Error(Q("client.invalidEnvironmentBuild"));const n=Array.isArray(t.steps)?t.steps.map(i=>{if(!i||typeof i!="object"||typeof i.key!="string"||typeof i.label!="string"||!["pending","running","succeeded","failed"].includes(i.status)||i.startedAt!==null&&typeof i.startedAt!="string"||i.finishedAt!==null&&typeof i.finishedAt!="string")throw new Error(Q("client.invalidEnvironmentBuildStep"));return i}):[];return{...t,toolId:typeof t.toolId=="string"?t.toolId:"",toolStatus:["creating","ready","failed"].includes(t.toolStatus)?t.toolStatus:"",runId:typeof t.runId=="string"?t.runId:"",currentStep:typeof t.currentStep=="string"?t.currentStep:"",sourceCommitSha:typeof t.sourceCommitSha=="string"?t.sourceCommitSha:"",steps:n,progressError:typeof t.progressError=="string"?t.progressError:"",logTail:typeof t.logTail=="string"?t.logTail:"",logTruncated:t.logTruncated===!0,logUpdatedAt:typeof t.logUpdatedAt=="string"?t.logUpdatedAt:null,logError:typeof t.logError=="string"?t.logError:""}}function MTe(e){if(!e||typeof e!="object")throw new Error(Q("client.invalidEnvironmentManifest"));const t=e;if(!["agentkit.studio/v3","agentkit.studio/v1alpha1"].includes(t.apiVersion)||t.kind!=="Environment"||!t.metadata||typeof t.metadata.id!="string"||typeof t.metadata.name!="string"||typeof t.metadata.version!="string"||typeof t.metadata.description!="string"||!t.spec||typeof t.spec.image!="string"||!["ubuntu","aio-sandbox","codex-sandbox"].includes(t.spec.baseEnvironment)||typeof t.spec.baseImage!="string"||!["ubuntu-22.04","ubuntu-24.04"].includes(t.spec.operatingSystem)||!["python-3.10","python-3.12"].includes(t.spec.language)||t.spec.executionRuntime!=="veadk"||!Array.isArray(t.spec.packages)||!t.spec.packages.every(n=>typeof n=="string")||!Array.isArray(t.spec.capabilities)||!t.spec.capabilities.every(n=>typeof n=="string")||!Array.isArray(t.spec.skills)||!t.status||!DTe.has(t.status.phase)||typeof t.status.createdAt!="string"||typeof t.status.updatedAt!="string")throw new Error(Q("client.invalidEnvironmentManifest"));return t}function LTe(e){if(e==null)return;if(!e||typeof e!="object")throw new Error(Q("client.invalidImageRepository"));const t=e;if(typeof t.region!="string"||typeof t.registry!="string"||typeof t.namespace!="string"||typeof t.repository!="string")throw new Error(Q("client.invalidImageRepository"));return t}function Stt(e){if(e==null)return;if(!e||typeof e!="object")throw new Error(Q("client.invalidCodeRepository"));const t=e;if(typeof t.repositoryUrl!="string"||t.ref!==void 0&&typeof t.ref!="string"||typeof t.dockerfilePath!="string")throw new Error(Q("client.invalidCodeRepository"));return t}function Ett(e){const t=LTe(e);if(!t)return;const n=e;if(typeof n.reference!="string")throw new Error(Q("client.invalidImageSource"));return{...t,reference:n.reference}}function Dz(e){if(!e||typeof e!="object")throw new Error(Q("client.invalidEnvironment"));const t=e;if(typeof t.id!="string"||typeof t.name!="string"||typeof t.description!="string"||t.baseEnvironment!==void 0&&t.baseEnvironment!=="ubuntu"&&t.baseEnvironment!=="aio-sandbox"&&t.baseEnvironment!=="codex-sandbox"||t.operatingSystem!=="ubuntu-22.04"&&t.operatingSystem!=="ubuntu-24.04"||t.language!=="python-3.10"&&t.language!=="python-3.12"||!Array.isArray(t.optionIds)||!t.optionIds.every(n=>typeof n=="string")||t.selectedSkills!==void 0&&!Array.isArray(t.selectedSkills)||typeof t.dockerfile!="string"||typeof t.createdAt!="string"||typeof t.updatedAt!="string")throw new Error(Q("client.invalidEnvironment"));return{...t,baseEnvironment:t.baseEnvironment==="aio-sandbox"?"aio-sandbox":t.baseEnvironment==="codex-sandbox"?"codex-sandbox":"ubuntu",selectedSkills:t.selectedSkills??[],gitSource:Stt(t.gitSource),containerRepository:LTe(t.containerRepository),imageSource:Ett(t.imageSource),latestVersion:Pz(t.latestVersion)}}function $Te(e){if(!e||typeof e!="object")throw new Error(Q("client.invalidWorkspace"));const t=e;if(typeof t.id!="string"||typeof t.name!="string"||typeof t.description!="string"||!Array.isArray(t.environmentIds)||!t.environmentIds.every(n=>typeof n=="string")||typeof t.createdAt!="string"||typeof t.updatedAt!="string")throw new Error(Q("client.invalidWorkspace"));return t}async function Mz(e){const t=await gt("/web/workspaces",{signal:e});if(!t.ok)throw new Error(await Ft(t,Q("client.loadWorkspacesFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(Q("client.invalidWorkspaceList"));return n.items.map($Te)}async function FTe(e,t,n,i){const r=await gt(e,{method:t,headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:i});if(!r.ok)throw new Error(await Ft(r,Q("client.saveWorkspaceFailed")));return $Te(await r.json())}function BTe(e,t){return FTe("/web/workspaces","POST",e,t)}function UTe(e,t,n){return FTe(`/web/workspaces/${encodeURIComponent(e)}`,"PATCH",t,n)}async function QTe(e,t){const n=await gt(`/web/workspaces/${encodeURIComponent(e)}`,{method:"DELETE",signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.deleteWorkspaceFailed")))}async function DA(e){const t=await gt("/web/v3/environments",{signal:e});if(!t.ok)throw new Error(await Ft(t,Q("client.loadEnvironmentsFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(Q("client.invalidEnvironmentList"));return n.items.map(Dz)}async function zTe(e,t){const n=await gt("/web/v3/environment-repositories/inspect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.probeRepositoryFailed")));const i=await n.json();if(typeof i.repositoryUrl!="string"||typeof i.ref!="string"||typeof i.commitSha!="string"||!Array.isArray(i.dockerfiles)||!i.dockerfiles.every(r=>typeof r=="string"))throw new Error(Q("client.invalidRepositoryProbe"));return i}async function VTe(e,t){const n=await gt(`/web/v3/environments/${encodeURIComponent(e)}/share-code`,{method:"POST",signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.exportEnvironmentCodeFailed")));const i=await n.json();if(typeof i.shareCode!="string"||typeof i.name!="string")throw new Error(Q("client.invalidEnvironmentCode"));return i}async function HTe(e,t){const n=await gt("/web/v3/environment-share-codes/inspect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({shareCodes:e}),signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.inspectEnvironmentCodeFailed")));const i=await n.json();if(!Array.isArray(i.items))throw new Error(Q("client.invalidEnvironmentCodeInspection"));return i.items.map(r=>{if(!r||typeof r!="object")throw new Error(Q("client.invalidEnvironmentCodeInspection"));const s=r,o=s.status==="valid"||s.valid===!0?"valid":s.status==="invalid"||s.valid===!1?"invalid":null;if(!Number.isInteger(s.index)||o===null||s.name!==void 0&&typeof s.name!="string"||s.error!==void 0&&typeof s.error!="string")throw new Error(Q("client.invalidEnvironmentCodeInspection"));return{index:s.index,status:o,name:s.name??"",error:s.error??""}})}async function qTe(e,t){const n=await gt("/web/v3/environment-share-codes/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({shareCodes:e}),signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.importEnvironmentCodeFailed")));const i=await n.json();if(!Array.isArray(i.items))throw new Error(Q("client.invalidEnvironmentCodeImport"));return i.items.map(r=>{if(!r||typeof r!="object")throw new Error(Q("client.invalidEnvironmentCodeImport"));const s=r;if(!Number.isInteger(s.index)||!(s.status==="created"||s.status==="duplicate"||s.status==="failed")||s.name!==void 0&&typeof s.name!="string"||s.error!==void 0&&typeof s.error!="string")throw new Error(Q("client.invalidEnvironmentCodeImport"));return{index:s.index,status:s.status,name:s.name??"",environment:s.environment===void 0||s.environment===null?void 0:Dz(s.environment),error:s.error??""}})}async function WTe(e,t,n,i){let r;try{r=await gt(e,{method:t,headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:i})}catch(s){throw s instanceof DOMException&&s.name==="AbortError"?s:s instanceof TypeError?new Error(Q("client.studioUnavailable")):s}if(!r.ok)throw new Error(await Ft(r,Q("client.saveEnvironmentFailed")));return Dz(await r.json())}function KTe(e,t){return WTe("/web/v3/environments","POST",e,t)}function GTe(e,t,n){return WTe(`/web/v3/environments/${encodeURIComponent(e)}`,"PATCH",t,n)}async function XTe(e,t){const n=await gt(`/web/v3/environments/${encodeURIComponent(e)}`,{method:"DELETE",signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.deleteEnvironmentFailed")))}async function U8(e,t){const n=await gt(`/web/v3/environments/${encodeURIComponent(e)}/build`,{method:"POST",signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.startEnvironmentBuildFailed")));const i=Pz(await n.json());if(!i)throw new Error(Q("client.invalidEnvironmentBuild"));return i}async function YTe(e,t,n={}){const i=n.includeLogs?"?includeLogs=true":"",r=await gt(`/web/v3/environments/${encodeURIComponent(e)}/builds/${encodeURIComponent(t)}${i}`,{signal:n.signal});if(!r.ok)throw new Error(await Ft(r,Q("client.loadEnvironmentBuildFailed")));const s=Pz(await r.json());if(!s)throw new Error(Q("client.invalidEnvironmentBuild"));return s}async function ZTe(e,t,n){const i=await gt(`/web/v3/environments/${encodeURIComponent(e)}/builds/${encodeURIComponent(t)}/manifest`,{signal:n});if(!i.ok)throw new Error(await Ft(i,Q("client.loadEnvironmentManifestFailed")));return MTe(await i.json())}function YZ(e){if(!e||typeof e!="object")throw new Error(Q("client.invalidEnvironmentResource"));const t=e;if(t.source!=="provided"&&t.source!=="managed"||typeof t.consoleUrl!="string")throw new Error(Q("client.invalidEnvironmentResource"));return t}async function JTe(e){const t=await gt("/web/v3/environment-resources",{signal:e});if(!t.ok)throw new Error(await Ft(t,Q("client.loadEnvironmentResourcesFailed")));const n=await t.json();if(n.provider!=="volcengine"&&n.provider!=="byteplus"||typeof n.region!="string")throw new Error(Q("client.invalidEnvironmentResource"));return{provider:n.provider,region:n.region,codePipeline:YZ(n.codePipeline),containerRegistry:YZ(n.containerRegistry)}}async function Ctt(e,t){const n=await gt(`/web/system-info/sandbox-tools/${encodeURIComponent(e)}/model-env`,{method:"POST",signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.updateCodexSandboxFailed")));const i=await n.json();if(i.kind!=="codex"&&i.kind!=="codex_snapshot"||typeof i.toolId!="string"||typeof i.updated!="boolean")throw new Error(Q("client.invalidCodexSandboxUpdate"));return i}async function ND(e){const t=await gt("/web/identity/user-pools",{signal:e});if(!t.ok)throw new Error(await Ft(t,Q("client.loadUserPoolsFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(Q("client.invalidUserPoolList"));return n.items.map(i=>{if(!i||typeof i!="object"||typeof i.uid!="string"||typeof i.name!="string"||typeof i.domain!="string"||typeof i.region!="string"||typeof i.isCurrent!="boolean")throw new Error(Q("client.invalidUserPoolList"));return i})}class ZZ extends Error{constructor(t,n){super(n),this.status=t,this.name="DeploymentRecoveryHttpError"}}const WS=new Map;function Att(e){if(typeof e=="string")return e?{message:e}:null;if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e,n=typeof t.message=="string"?t.message:typeof t.error=="string"?t.error:"";return n?{message:n,phase:typeof t.phase=="string"?t.phase:void 0,runtimeId:typeof t.runtimeId=="string"?t.runtimeId:void 0,logPath:typeof t.logPath=="string"?t.logPath:void 0}:null}class KS extends Error{constructor(t){super(t.message),this.detail=t,this.name="GithubCicdPipelineError"}}async function fm(e){const t=await e.text().catch(()=>"");if(t)try{const n=JSON.parse(t),i=Att(n.detail??n.error);if(i)return new KS(i)}catch{return new KS({message:t})}return new KS({message:Q("client.syncGithubFailed",{status:e.status})})}async function e2e(e){const t=await gt("/web/github-delivery/source-sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:e.project,githubUrl:e.githubUrl,githubToken:e.githubToken,baseBranch:e.baseBranch,region:e.region,cloudProvider:e.cloudProvider})},{},0);if(!t.ok)throw await fm(t);return t.json()}async function t2e(e){const t=await gt("/web/github-delivery/cicd-pipeline",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({githubUrl:e.githubUrl,githubToken:e.githubToken,baseBranch:e.baseBranch,runtimeName:e.runtimeName,runtimeId:e.runtimeId,region:e.region,agentCategory:e.agentCategory,mpaCompatibilityManifest:e.mpaCompatibilityManifest,cloudProvider:e.cloudProvider,projectPath:e.projectPath??".",volcengineAccessKey:e.volcengineAccessKey,volcengineSecretKey:e.volcengineSecretKey,volcengineSessionToken:e.volcengineSessionToken??""})},{},0);if(!t.ok)throw await fm(t);return t.json()}async function n2e(e){const t=await gt("/web/github-delivery/init-main",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:e.project,githubUrl:e.githubUrl,githubToken:e.githubToken,baseBranch:e.baseBranch,runtimeName:e.runtimeName,runtimeId:e.runtimeId,region:e.region,agentCategory:e.agentCategory,mpaCompatibilityManifest:e.mpaCompatibilityManifest,cloudProvider:e.cloudProvider,projectPath:e.projectPath??".",volcengineAccessKey:e.volcengineAccessKey,volcengineSecretKey:e.volcengineSecretKey,volcengineSessionToken:e.volcengineSessionToken??""})},{},0);if(!t.ok)throw await fm(t);return t.json()}async function Ttt(e){const t=await gt("/web/github-delivery/source-sync/cicd",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pipelineId:e.pipelineId,runtimeName:e.runtimeName,runtimeId:e.runtimeId,region:e.region,agentCategory:e.agentCategory,mpaCompatibilityManifest:e.mpaCompatibilityManifest,cloudProvider:e.cloudProvider,projectPath:e.projectPath??".",volcengineAccessKey:e.volcengineAccessKey,volcengineSecretKey:e.volcengineSecretKey,volcengineSessionToken:e.volcengineSessionToken??""})},{},0);if(!t.ok)throw await fm(t);return t.json()}async function i2e(e){const t=await gt(`/web/github-cicd/runtime-binding?runtimeId=${encodeURIComponent(e)}`);if(!t.ok)throw await fm(t);const n=await t.json();return n.pipelineId?n:null}async function uN(e){const t=await gt(`/web/github-delivery/versions?runtimeId=${encodeURIComponent(e)}`);if(!t.ok)throw await fm(t);return t.json()}async function r2e(e){const t=await gt("/web/github-delivery/rollback-pr",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await fm(t);return t.json()}async function Lz(e){const t=await gt("/web/github-cicd/runtime-binding",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await fm(t);return t.json()}async function s2e(e){const t=await gt("/web/github-cicd/runtime-sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e.runtimeId,project:e.project,agentCategory:e.agentCategory,mpaCompatibilityManifest:e.mpaCompatibilityManifest})},{},0);if(!t.ok)throw await fm(t);return t.json()}async function $0(e,t,n,i){var h,m,g,b,v,y;const r=i==null?void 0:i.taskId,s=r?new AbortController:void 0;r&&s&&WS.set(r,s);const o=()=>{r&&WS.get(r)===s&&WS.delete(r)},l=async w=>{if(VAe(w))throw w;if(!r||!(i!=null&&i.runtimeId)||typeof i.baseRuntimeVersion!="number")throw new aN({taskId:r,cause:w});const x=await Qet({signal:s==null?void 0:s.signal,shouldRetry:O=>!(O instanceof ZZ)||O.status===404||O.status===408||O.status===429||O.status>=500,load:async O=>{const k=await gt("/web/deploy-agentkit/status",{method:"POST",headers:{"Content-Type":"application/json"},signal:O,body:JSON.stringify({taskId:r,runtimeId:i.runtimeId,runtimeName:i.runtimeName,appName:i.appName??e,region:n.region,projectName:n.projectName,baseRuntimeVersion:i.baseRuntimeVersion})},{},3e4);if(!k.ok)throw new ZZ(k.status,await Ft(k,Q("client.deploymentFailed")));return k.json()}});if(!x)throw new aN({taskId:r,cause:w});return x};let c=null,u=null;try{const w=!!(i!=null&&i.migrationTaskId);(h=i==null?void 0:i.onStage)==null||h.call(i,{level:"info",phase:"upload",message:Q(w?"client.validatingMigrationArtifact":"client.uploadingCodePackage"),pct:0}),c=await gt("/web/deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},signal:s==null?void 0:s.signal,body:JSON.stringify({name:e,files:w?[]:t,config:n,taskId:r,migrationTaskId:i==null?void 0:i.migrationTaskId,runtimeId:i==null?void 0:i.runtimeId,runtimeName:i==null?void 0:i.runtimeName,appName:i==null?void 0:i.appName,agentCategory:i==null?void 0:i.agentCategory,mpaCompatibilityManifest:i==null?void 0:i.mpaCompatibilityManifest,editMode:i==null?void 0:i.editMode,draft:i==null?void 0:i.draft,updateEtag:i==null?void 0:i.updateEtag,baseRuntimeVersion:i==null?void 0:i.baseRuntimeVersion,removeRuntimeEnvKeys:i==null?void 0:i.removeRuntimeEnvKeys,mcpSecretValues:i==null?void 0:i.mcpSecretValues,mcpCredentialReuses:i==null?void 0:i.mcpCredentialReuses,sessionStorage:i==null?void 0:i.sessionStorage,minInstance:i==null?void 0:i.minInstance,maxInstance:i==null?void 0:i.maxInstance,createEvaluationSets:i==null?void 0:i.createEvaluationSets,description:Bet((i==null?void 0:i.description)??""),authentication:i==null?void 0:i.authentication,im:i==null?void 0:i.im,envs:i==null?void 0:i.envs,resources:i==null?void 0:i.resources,source:(i==null?void 0:i.source)??(i!=null&&i.migrationTaskId?{kind:"migration",migrationId:i.migrationTaskId}:{kind:"inlineFiles"}),harnessSidecar:i==null?void 0:i.harnessSidecar,environment:i==null?void 0:i.environment})},{},0),(m=i==null?void 0:i.onStage)==null||m.call(i,{level:"success",phase:"upload",message:Q(w?"client.migrationArtifactValidated":"client.codePackageUploaded"),pct:100})}catch(w){try{u=await l(w)}finally{o()}}if(c&&!c.ok){const w=await Ft(c,Q("client.deploymentFailed"));throw o(),new Error(w)}if(c)try{for await(const w of NA(c)){const x=w;if(x&&x.done){u=x;break}x&&x.message&&((g=i==null?void 0:i.onStage)==null||g.call(i,x))}}catch(w){try{u=await l(w)}finally{o()}}if(u)o();else try{u=await l()}finally{o()}if(!u.success){const w=new Error(u.error||Q("client.deploymentFailed"));throw zAe(w)?new aN({taskId:r,cause:w}):w}if(!u.agentName)throw new Error(Q("client.deploymentMissingAgentName"));if(!u.runtimeId&&!u.url)throw new Error(Q("client.deploymentMissingConnection"));const d=(b=u.runtimeName)!=null&&b.trim()?u.agentName:e,f=((v=u.runtimeName)==null?void 0:v.trim())||u.agentName;return{apikey:u.apikey??"",url:u.url??"",agentName:d,runtimeName:f,runtimeId:u.runtimeId,mpaInstanceId:((y=u.mpaInstanceId)==null?void 0:y.trim())||void 0,consoleUrl:u.consoleUrl,region:u.region,version:u.version,warnings:u.warnings,feishuChannel:u.feishuChannel}}async function a2e(e){var n;const t=await gt("/web/cancel-deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e})});if(!t.ok){const i=await t.text().catch(()=>"");throw new Error(i||Q("client.cancelDeploymentFailed",{status:t.status}))}(n=WS.get(e))==null||n.abort(),WS.delete(e)}async function _tt(e=mz){const t=await gt(`/web/my-runtimes?region=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(Q("client.loadFailed",{status:t.status}));return(await t.json()).runtimes??[]}const tC={title:"AgentKit Studio",logoUrl:""},Q8={enabled:!1},S3={studio:!1,version:"",provider:"volcengine",branding:tC,features:{newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,agentUsage:!1,addAgentkit:!0,generatedAgentTestRun:!0},defaultView:"chat",agentsSource:"local",telemetry:Q8};function jtt(e){if(!e||typeof e!="object")return Q8;const t=e;if(t.enabled!==!0||!t.studio||typeof t.studio!="object")return Q8;const n=t.studio;return{enabled:!0,studio:{deployId:typeof n.deployId=="string"?n.deployId:"",userPoolId:typeof n.userPoolId=="string"?n.userPoolId:"",applicationId:typeof n.applicationId=="string"?n.applicationId:"",functionId:typeof n.functionId=="string"?n.functionId:"",region:typeof n.region=="string"?n.region:"",project:typeof n.project=="string"?n.project:"",version:typeof n.version=="string"?n.version:"",accountId:typeof n.accountId=="string"?n.accountId:"",accountIdResolutionError:typeof n.accountIdResolutionError=="string"?n.accountIdResolutionError:""}}}async function o2e(){var e,t;try{const n=await gt("/web/ui-config");if(!n.ok)return S3;const i=await n.json(),r=typeof((e=i.branding)==null?void 0:e.logoUrl)=="string"?i.branding.logoUrl:tC.logoUrl,s=i.provider==="byteplus"?"byteplus":"volcengine";return eTe(s),{studio:i.studio??!1,version:typeof i.version=="string"?i.version:"",provider:s,branding:{title:typeof((t=i.branding)==null?void 0:t.title)=="string"?i.branding.title:tC.title,logoUrl:r?ja(r):""},features:{...S3.features,...i.features??{}},defaultView:i.defaultView??"chat",agentsSource:i.agentsSource==="cloud"?"cloud":"local",telemetry:jtt(i.telemetry)}}catch{return S3}}const l2e={role:"user",telemetry:{userId:"",accountId:""},capabilities:{createAgents:!1,createPersonalAgents:!1,manageAgents:!1,runtimeScope:"mine",manageUsers:!1}};async function c2e(){var n,i,r,s,o,l;const e=await gt("/web/access");if(!e.ok)throw new Error(Q("client.loadPermissionsFailed",{status:e.status}));const t=await e.json();if(!["super_admin","admin","developer","user"].includes(t.role)||typeof((n=t.telemetry)==null?void 0:n.userId)!="string"||t.telemetry.accountId!==void 0&&typeof t.telemetry.accountId!="string"||typeof((i=t.capabilities)==null?void 0:i.createAgents)!="boolean"||typeof((r=t.capabilities)==null?void 0:r.createPersonalAgents)!="boolean"||typeof((s=t.capabilities)==null?void 0:s.manageAgents)!="boolean"||((o=t.capabilities)==null?void 0:o.manageUsers)!==void 0&&typeof t.capabilities.manageUsers!="boolean"||!["all","mine"].includes((l=t.capabilities)==null?void 0:l.runtimeScope))throw new Error(Q("client.invalidPermissionResponse"));return t}async function u2e(e,t){const n=new URLSearchParams;e&&n.set("targetVersion",e),t&&n.set("startedAt",String(t));const i=n.size?`?${n.toString()}`:"",r=await gt(`/web/studio-update${i}`);if(!r.ok)throw new Error(Q("client.checkStudioUpdateFailed",{status:r.status}));return await r.json()}async function d2e(){const e=await gt("/web/studio-update/permissions");if(!e.ok){let t="";try{const n=await e.json();t=typeof n.detail=="string"?n.detail:""}catch{t=""}throw new Error(t||Q("client.studioUpdatePreflightFailed",{status:e.status}))}return await e.json()}async function f2e(e){const t=await gt("/web/studio-update",{method:"POST",headers:{"Content-Type":"application/json","X-VeADK-Studio-Update":"1"},body:JSON.stringify({version:e})},{},mr);if(!t.ok){let n="";try{const i=await t.json();n=typeof i.detail=="string"?i.detail:""}catch{n=""}throw new Error(n||Q("client.submitStudioUpdateFailed",{status:t.status}))}return await t.json()}async function h2e({runtimeId:e,region:t,appName:n,page:i=1,pageSize:r=20,signal:s}){const o=new URLSearchParams({runtimeId:e,region:t,appName:n,page:String(i),pageSize:String(r)}),l=await gt(`/web/agent-usage?${o.toString()}`,{signal:s});if(!l.ok)throw new Error(await Ft(l,Q("client.loadAgentUsageFailed")));const c=l.headers.get("content-type")||Q("client.notProvided"),u=c.toLowerCase();if(!u.includes("application/json")&&!u.includes("+json"))throw new Error(Q("client.agentUsageNonJson",{status:l.status,contentType:c})+Q("client.checkStudioGateway"));try{return await l.json()}catch{throw new Error(Q("client.agentUsageInvalidJson",{status:l.status,contentType:c})+Q("client.retryCheckGateway"))}}function hm(e=""){return`/web/cronjobs${e?`/${encodeURIComponent(e)}`:""}`}async function z8(e){const t=await gt(hm(),{signal:e});if(!t.ok)throw new Error(await Ft(t,Q("client.loadCronJobsFailed")));const n=await t.json();return Array.isArray(n)?n:n.items??[]}async function Ntt(e,t){const n=await gt(hm(e),{signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.loadCronJobFailed")));return await n.json()}async function p2e(e){const t=await gt(hm(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await Ft(t,Q("client.createCronJobFailed")));return await t.json()}async function m2e(e,t){const n=await gt(`${hm(e)}/update`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw new Error(await Ft(n,Q("client.updateCronJobFailed")));return await n.json()}async function g2e(e,t){const n=t?"enable":"disable",i=await gt(`${hm(e)}/${n}`,{method:"POST"});if(!i.ok)throw new Error(await Ft(i,Q(t?"client.enableCronJobFailed":"client.pauseCronJobFailed")));return await i.json()}async function b2e(e){const t=await gt(`${hm(e)}/run`,{method:"POST"});if(!t.ok)throw new Error(await Ft(t,Q("client.runCronJobFailed")));return await t.json()}async function V8(e,t){const n=await gt(`${hm(e)}/runs`,{signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.loadCronHistoryFailed")));const i=await n.json();return Array.isArray(i)?i:i.items??[]}async function y2e(e,t){const n=await gt(`${hm(e)}/runs/${encodeURIComponent(t)}/cancel`,{method:"POST"});if(!n.ok)throw new Error(await Ft(n,Q("client.stopCronRunFailed")));return await n.json()}async function v2e(e){const t=await gt(hm(e),{method:"DELETE"});if(!t.ok)throw new Error(await Ft(t,Q("client.deleteCronJobFailed")))}class RD extends Error{constructor(t,n){super(t),this.status=n,this.name="RuntimeListError"}}async function F0(e={}){const t=new URLSearchParams({scope:e.scope??"all",page_size:String(e.pageSize??30),region:e.region??"all"});e.agentCategory&&t.set("agentCategory",e.agentCategory),e.nextToken&&t.set("next_token",e.nextToken);const n=await gt(`/web/runtimes?${t.toString()}`,{signal:e.signal});if(!n.ok){const r=await Ft(n,Q("client.loadRuntimeFailed"));throw new RD(r,n.status)}const i=await n.json();return{runtimes:i.runtimes??[],nextToken:i.nextToken??""}}async function Hw(e,t,n={}){if(n.preferCached){const i=wz(e,t,n.currentVersion),r=Jx.get(i);if(r&&r.expiresAt>Date.now())return[...r.apps];r&&Jx.delete(i)}try{const i={runtimeId:e,region:t,runtimeVersion:n.currentVersion};return n.retryProbe&&(i.retryProbe=!0),await IA("","",i,n.signal,n.timeoutMs)}catch(i){if(i instanceof F1||i instanceof Sa||i instanceof Error)throw i;return null}}async function x2e(e,t){const n=new URLSearchParams({region:t}),i=await gt(`/web/runtime-tool-channel/${encodeURIComponent(e)}/capabilities?${n.toString()}`);if(!i.ok)throw new Sa(await Ft(i,Q("client.loadLocalToolsFailed")),!1,!0);return await i.json()}async function w2e(e,t){const n=new URLSearchParams({region:t}),i=await gt(`/web/runtime-route-channel/${encodeURIComponent(e)}/connect?${n.toString()}`,{method:"POST"});if(!i.ok)throw new Sa(await Ft(i,Q("client.connectDynamicRouteFailed")),!1,!0);return await i.json()}async function O2e(e,t,n={}){const i={runtimeId:e,region:t};n.retryProbe&&(i.retryProbe=!0);const r=await gt("/.well-known/agent-card.json",{},i),s=await tTe(r);if(s==="runtime_access_denied")throw new F1;if(s==="runtime_private_endpoint_unreachable")throw new Sa(YAe());if(["runtime_proxy_connect_error","runtime_proxy_timeout"].includes(s))throw new Sa(ZAe());if(r.status===404)return null;if(r.status===401||r.status===403)throw new Sa(Q("client.a2aProbeDenied"));if(!r.ok)throw new Error(await Ft(r,Q("client.loadA2aCardFailed")));const o=await r.json().catch(()=>null),l=typeof(o==null?void 0:o.url)=="string"?o.url.trim():"";return l?{name:typeof(o==null?void 0:o.name)=="string"?o.name:"",description:typeof(o==null?void 0:o.description)=="string"?o.description:"",endpoint:l}:null}async function k2e(e,t){const n=new URLSearchParams({runtimeId:e,region:t}),i=await gt(`/web/runtime-api-key/reveal?${n.toString()}`,{method:"POST",cache:"no-store"});if(!i.ok)throw new Error(await Ft(i,Q("client.loadRuntimeApiKeyFailed")));const r=await i.json();if(typeof r.apiKey!="string"||!r.apiKey)throw new Error(Q("client.runtimeApiKeyMissing"));return r.apiKey}async function S2e(e,t,n={}){const i=await gt("/web/delete-runtime",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e,region:t,agentCategory:n.agentCategory,mpaInstanceId:n.mpaInstanceId})});if(!i.ok){const r=await i.text().catch(()=>"");throw new Error(r||Q("client.deleteFailed",{status:i.status}))}}async function E2e({runtimeId:e,region:t,appName:n,etag:i,signal:r}){const s=await gt("/web/runtime-mcp-credentials",{method:"POST",cache:"no-store",signal:r,headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e,region:t,appName:n,etag:i})});if(!s.ok)throw new Error(await Ft(s,Q("client.loadMcpCredentialsFailed")));const o=await s.json().catch(()=>null);if(!Array.isArray(o==null?void 0:o.credentials))throw new Error(Q("client.invalidMcpCredentials"));return o.credentials.map(l=>{if(!l||typeof l!="object")throw new Error(Q("client.invalidMcpCredentials"));const c=l,u={agentName:c.agentName,name:c.name,url:c.url,authTokenEnv:c.authTokenEnv,value:c.value};if(Object.values(u).some(d=>typeof d!="string"))throw new Error(Q("client.invalidMcpCredentials"));return u})}function dN({runtimeId:e,region:t,appName:n,currentVersion:i}){return L0(JE,t,e,i??"",(n==null?void 0:n.trim())??"")}async function Rtt({runtimeId:e,region:t,appName:n,currentVersion:i,force:r=!1}){const s=new URLSearchParams({runtimeId:e,region:t});n&&s.set("appName",n),i!=null&&s.set("currentVersion",String(i)),r&&s.set("refresh","true");const o=await gt(`/web/runtime-update-capability?${s.toString()}`);if(!o.ok)throw new Error(await Itt(o));return await o.json()}function ID({runtimeId:e,region:t,appName:n,currentVersion:i,signal:r,force:s=!1}){var u,d;const o={runtimeId:e,region:t,appName:n,currentVersion:i},l=dN(o);if(s&&os.delete(l),!s){const f=Eb(os,l,B1);if(f)return X2(Promise.resolve(f),r);const h=(u=os.get(l))==null?void 0:u.promise;if(h)return X2(h,r);if(n){const m=dN({...o,appName:""}),g=(d=os.get(m))==null?void 0:d.promise;if(g){let b;return b=g.then(v=>{var w,x,O,k,S;if(v.recoveryStatus==="preparing")return((w=os.get(l))==null?void 0:w.promise)===b&&os.delete(l),v;const y=((O=(x=v.agent)==null?void 0:x.appName)==null?void 0:O.trim())??"";return y&&y!==n.trim()?(((k=os.get(l))==null?void 0:k.promise)===b&&os.delete(l),ID(o)):(((S=os.get(l))==null?void 0:S.promise)===b&&os.set(l,{value:v,updatedAt:Date.now()}),v)},v=>{var y;throw((y=os.get(l))==null?void 0:y.promise)===b&&os.delete(l),v}),os.set(l,{promise:b,updatedAt:0}),X2(b,r)}}}let c;return c=Rtt({...o,force:s}).then(f=>{var h,m,g,b,v;if(f.recoveryStatus==="preparing")return((h=os.get(l))==null?void 0:h.promise)===c&&os.delete(l),f;if(((m=os.get(l))==null?void 0:m.promise)===c){os.set(l,{value:f,updatedAt:Date.now()});const y=new Set(["",((b=(g=f.agent)==null?void 0:g.appName)==null?void 0:b.trim())??""]);for(const w of y){const x=dN({...o,appName:w});x!==l&&!((v=os.get(x))!=null&&v.promise)&&os.set(x,{value:f,updatedAt:Date.now()})}}return f},f=>{var h;throw((h=os.get(l))==null?void 0:h.promise)===c&&os.delete(l),f}),os.set(l,{promise:c,updatedAt:0}),X2(c,r)}function H8({runtimeId:e,region:t,appName:n,currentVersion:i}){return Eb(os,dN({runtimeId:e,region:t,appName:n,currentVersion:i}),B1)}function q8(e){return ID(e).then(()=>{},()=>{})}function W8(e,t){if(!e){os.clear();return}for(const n of os.keys()){const[i,r,s]=n.split("");i===JE&&s===e&&(!t||r===t)&&os.delete(n)}}async function Itt(e){const t=await e.json().catch(()=>null),n=typeof(t==null?void 0:t.detail)=="string"?t.detail:"";return e.status===403?Q("client.runtimeManageForbidden"):e.status===404?Q(n==="runtime_not_found"?"client.runtimeNotFound":"client.runtimeUnavailable"):Q("client.checkRuntimeUpdateFailed",{status:e.status})}async function Ptt(e,t){let n=null;for(const i of RA(t)){const r=await gt(`/web/runtime-detail?runtimeId=${encodeURIComponent(e)}®ion=${encodeURIComponent(i)}`);if(r.ok)return r.json();n=new Error(await Ft(r,Q("client.loadRuntimeDetailFailed")))}throw n??new Error(Q("client.loadRuntimeDetailFailed"))}async function PD(e,t="cn-beijing",n={}){const i=L0(e,t||"cn-beijing"),r=Eb(cy,i,B1);if(!n.force&&r)return r;const s=cy.get(i);if(!n.force&&(s!=null&&s.promise))return s.promise;const o=Ptt(e,t).then(l=>Oz(cy,i,l));cy.set(i,{...s,promise:o,updatedAt:(s==null?void 0:s.updatedAt)??0});try{return await o}finally{const l=cy.get(i);(l==null?void 0:l.promise)===o&&cy.set(i,{value:l.value,updatedAt:l.updatedAt})}}async function Dtt(e,t,n){const i=new URLSearchParams({runtimeId:e,region:t,key:n}),r=await gt(`/web/runtime-env/copy?${i.toString()}`,{method:"POST"});if(!r.ok)throw new Error(await Ft(r,Q("client.copySecretFailed")));const s=await r.json();if(typeof s.value!="string"||!s.value)throw new Error(Q("client.copySecretFailed"));await navigator.clipboard.writeText(s.value)}function C2e(e,t="cn-beijing"){return Eb(cy,L0(e,t||"cn-beijing"),B1)}function A2e(e,t="cn-beijing"){PD(e,t).catch(()=>{})}async function GS(e){const t=await gt("/web/generated-agent-projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await Ft(t,Q("client.generateProjectFailed")));return t.json()}const Mtt=19e4,Ltt=12e4;async function T2e(e){const t=await gt("/web/generated-agent-drafts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requirement:e})},{},Mtt);if(!t.ok)throw new Error(await Ft(t,Q("client.generateAgentConfigFailed")));return ED(t,Q("client.generateAgentConfigFailed"))}async function _2e(e,t){const n=await gt("/web/generated-agent-test-runs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e,runtimeId:t==null?void 0:t.runtimeId,runtimeRegion:t==null?void 0:t.region,mcpCredentialReuses:t==null?void 0:t.mcpCredentialReuses})},{},Ltt);if(!n.ok)throw new Error(await Ft(n,Q("client.createDebugRunFailed")));return ED(n,Q("client.createDebugRunFailed"))}async function j2e(e,t){const n=await gt(`/web/generated-agent-test-runs/${e}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:t})});if(!n.ok)throw new Error(await Ft(n,Q("client.createDebugSessionFailed")));return(await ED(n,Q("client.createDebugSessionFailed"))).id}async function N2e(e,t){const n=await gt(`/web/generated-agent-test-runs/${encodeURIComponent(e)}/trace/session/${encodeURIComponent(t)}`);if(!n.ok)throw new Error(await Ft(n,Q("client.loadDebugTraceFailed")));const i=await ED(n,Q("client.loadDebugTraceFailed"));if(!Array.isArray(i))throw new Error(Q("client.invalidDebugTrace"));return i}async function*R2e({runId:e,userId:t,sessionId:n,text:i,signal:r}){const s=i.trim()?[{text:i}]:[],o=Tz(r);let l;try{l=await gt(`/web/generated-agent-test-runs/${e}/run_sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({user_id:t,session_id:n,new_message:{role:"user",parts:s},streaming:!0}),signal:o.signal},{},0)}catch(c){throw o.cleanup(),o.timedOut()?new Error(Xg()):c}if(!l.ok)throw o.cleanup(),new Error(await Ft(l,Q("client.debugRunFailed")));try{for await(const c of NA(l))o.clearDeadline(),yield c}catch(c){throw o.timedOut()?new Error(Xg()):c}finally{o.cleanup()}}async function nx(e){const t=await gt(`/web/generated-agent-test-runs/${e}`,{method:"DELETE"});if(!t.ok&&t.status!==404)throw new Error(await Ft(t,Q("client.cleanupDebugRunFailed")))}function I2e(e){if(!e||typeof e!="object")throw new Error(Q("client.invalidSandboxVersion"));const t=e;if(typeof t.toolId!="string"||typeof t.error!="string")throw new Error(Q("client.invalidSandboxVersion"));if(!t.error&&(t.provider!=="volcengine"&&t.provider!=="byteplus"||typeof t.region!="string"||typeof t.status!="string"||typeof t.currentImage!="string"||typeof t.latestImage!="string"||typeof t.needsImageUpdate!="boolean"||typeof t.canUpdate!="boolean"||typeof t.needsModelEnvUpdate!="boolean"||typeof t.canUpdateModelEnv!="boolean"||typeof t.modelEnvError!="string"))throw new Error(Q("client.invalidSandboxVersion"));return t}async function P2e(e){const t=await gt("/web/system-info/sandbox-tools/updates",{signal:e});if(!t.ok)throw new Error(await Ft(t,Q("client.loadSandboxVersionsFailed")));const n=await t.json();if(!Array.isArray(n.tools))throw new Error(Q("client.invalidSandboxVersion"));return n.tools.map(I2e)}async function D2e(e){const t=await gt(`/web/system-info/sandbox-tools/${encodeURIComponent(e)}/update`,{method:"POST"},{},33e4);if(!t.ok)throw new Error(await Ft(t,Q("client.updateSandboxFailed")));const n=await t.json();if(typeof n.updated!="boolean")throw new Error(Q("client.invalidSandboxUpdate"));return{updated:n.updated,state:I2e(n.state)}}class eI extends Error{constructor(t){super(`Channel request failed (${t})`),this.status=t}}async function Yd(e,t,n={}){const i=await gt(`/api/v1/channels${t}`,{...n,headers:{"Content-Type":"application/json",...n.headers}},e);if(!i.ok)throw new eI(i.status);return i.json()}function K8(e,t,n,i){return ret(gt,e,t,n,i)}function M2e(e,t,n,i,r){return set(gt,e,t,n,i,r)}function L2e(e,t,n,i){return aet(gt,e,t,n,i)}const $tt=Object.freeze(Object.defineProperty({__proto__:null,ChannelApiError:eI,DEFAULT_SITE_BRANDING:tC,DEFAULT_STUDIO_ACCESS:l2e,GithubCicdPipelineError:KS,MpaExecutionConfigRequestError:ew,RuntimeAccessDeniedError:F1,RuntimeListError:RD,RuntimeProbeError:Sa,TurnControlConflictError:_D,applyMpaProfileAfterDeployment:JR,attachGithubDeliveryCicdToSourceSync:Ttt,bindGithubCicdRuntime:Lz,buildEnvironment:U8,cancelAgentkitDeployment:a2e,cancelCronJobRun:y2e,channelRequest:Yd,checkRuntimeNameAvailability:jD,clearMessageFeedbackCache:HAe,clearRemoteApps:WAe,componentSearch:xTe,continueTurn:wtt,continueTurnSSE:bTe,controlTurn:gTe,copyRuntimeEnvironmentSecret:Dtt,createCronJob:p2e,createEnvironment:KTe,createGeneratedAgentTestRun:_2e,createGeneratedAgentTestSession:j2e,createGithubCicdPipeline:e2e,createGithubDeliveryCicdPipeline:t2e,createGithubDeliveryRollbackPr:r2e,createSession:nTe,createWorkspace:BTe,deleteAgentFeedbackCases:lTe,deleteCronJob:v2e,deleteEnvironment:XTe,deleteGeneratedAgentTestRun:nx,deleteMedia:cN,deleteRuntime:S2e,deleteSession:D8,deleteSessionMedia:M8,deleteWorkspace:QTe,deployAgentkitProject:$0,downloadArtifact:Sz,ensureRuntimeRouteChannel:w2e,exportEnvironmentShareCode:VTe,fetchRemoteApps:IA,fetchSessionFile:cTe,generateAgentDraftFromRequirement:T2e,generateAgentProject:GS,getAgentFeedbackCases:TD,getAgentInfo:$8,getAgentOptimizations:rTe,getAgentUsage:h2e,getAutomaticEvaluationStatuses:P8,getCachedAgentFeedbackCases:sTe,getCachedRuntimeAgentInfo:yTe,getCachedRuntimeDetail:C2e,getCachedRuntimeUpdateCapability:H8,getCronJob:Ntt,getEnvironmentBuild:YTe,getEnvironmentManifest:ZTe,getEnvironmentResources:JTe,getGeneratedAgentTestTrace:N2e,getGithubCicdRuntimeBinding:i2e,getGithubDeliveryVersions:uN,getMediaCapabilities:vtt,getMpaAgentDeletePreview:CTe,getMpaAgentOperation:kTe,getMpaAgentView:ETe,getMpaProfileStatus:STe,getMpaRuntimeConsoleRuns:ATe,getMpaRuntimeConsoleTrace:TTe,getMpaSessionExecutionConfig:Rz,getMyRuntimes:_tt,getRuntimeAgentInfo:Cz,getRuntimeDetail:PD,getRuntimeMcpCredentials:E2e,getRuntimeStudioToolCapabilities:x2e,getRuntimeUpdateCapability:ID,getRuntimes:F0,getSandboxImageUpdates:P2e,getSession:eC,getSessionTrace:YR,getStudioAccess:c2e,getStudioUpdatePermissions:d2e,getStudioUpdateStatus:u2e,getSystemInfo:PTe,getTurnControl:mTe,getUiConfig:o2e,httpErrorMessage:Ft,importEnvironmentShareCodes:qTe,initializeGithubDeliveryMain:n2e,inspectEnvironmentRepository:zTe,inspectEnvironmentShareCodes:HTe,invalidateRuntimeUpdateCapabilityCache:W8,isMpaA2aRuntimeApp:rp,isMpaRuntimeApp:ZR,listActiveMpaAgentOperations:OTe,listApps:XAe,listCronJobRuns:V8,listCronJobs:z8,listDeploymentResources:jTe,listEnvironments:DA,listIdentityUserPools:ND,listModelApiKeys:xz,listModelOptions:$1,listMpaCronTasks:K8,listMpaRuns:L2e,listSessions:kz,listWorkspaces:Mz,mediaContentUrl:hTe,mpaProfileFromAgentDraft:PA,parseEnvironmentManifest:MTe,parseEnvironmentShareCodes:Iz,parsePreparedSessionEnvironmentMounts:NTe,patchMpaSessionExecutionConfig:B8,prefetchAgentFeedbackCases:btt,prefetchRuntimeAgentInfo:vTe,prefetchRuntimeDetail:A2e,prefetchRuntimeUpdateCapability:q8,prepareSessionEnvironmentMounts:RTe,previewArtifact:Ez,probeRuntimeA2a:O2e,probeRuntimeApps:Hw,refreshAgentFeedbackCases:aTe,registerRemoteApp:qAe,requestMpaTask:M2e,retryMpaAgentOperation:Nz,revealModelApiKey:GAe,revealRuntimeApiKey:k2e,runCronJobNow:b2e,runGeneratedAgentTestSSE:R2e,runSSE:F8,runSseEmptyResponseError:Az,runSseFirstEventTimeoutError:Xg,runSseIncompleteResponseError:rS,runtimeRegionCandidates:RA,setClientCloudProvider:eTe,setCronJobEnabled:g2e,startMpaAgentOperation:jz,startStudioUpdate:f2e,studioFetch:vn,submitIssueFeedback:L8,submitMessageFeedback:iTe,syncGithubCicdRuntime:s2e,updateCodexSandboxToolModelEnv:Ctt,updateCronJob:m2e,updateEnvironment:GTe,updateSandboxTool:D2e,updateWorkspace:UTe,upgradeMpaSessionProfile:_Te,uploadMedia:dTe,upsertCachedAgentFeedbackCase:lN,webSearch:wTe,writeEnvironmentShareCode:ITe},Symbol.toStringTag,{value:"Module"})),Ftt="/web/sandbox/sessions",JZ="/web/sandbox/codex-project-handoff",eJ=3e4,E3=33e4,Btt=6e4,Utt=6e5,nk=15e3,dp=6e4,Qtt=33e4,tJ=3e4,ztt=60*60,G8=40;function DD(e){const t=e.trim().toLowerCase();return["ready","running","wakeable"].includes(t)?"ready":t}function $z(e){switch(e.trim().toLowerCase()){case"ready":return Q("sandbox.status.ready");case"wakeable":return Q("sandbox.status.wakeable");case"creating":return Q("sandbox.status.creating");case"starting":case"initializing":return Q("sandbox.status.starting");case"pending":return Q("sandbox.status.pending");case"running":return Q("sandbox.status.running");case"failed":case"error":return Q("sandbox.status.failed");case"stopped":return Q("sandbox.status.stopped");case"expired":return Q("sandbox.status.expired");case"deleting":return Q("sandbox.status.deleting");case"deleted":return Q("sandbox.status.deleted");default:return Q("sandbox.status.unknown")}}function gs(e){const t=ul(e);return t.has("Accept")||t.set("Accept","application/json"),t}class Fz extends Error{constructor(n,i={}){var r;super(n);Zt(this,"code");Zt(this,"retryable");Zt(this,"publicMessage");Zt(this,"httpStatus");this.name="SandboxServiceError",this.code=i.code??"",this.retryable=i.retryable===!0,this.publicMessage=((r=i.publicMessage)==null?void 0:r.trim())||n,this.httpStatus=i.httpStatus}}function Vtt(e){return e instanceof Fz?e.publicMessage:e instanceof Error&&e.name==="TimeoutError"?Q("sandbox.developmentTimeout"):e instanceof TypeError?Q("sandbox.developmentDisconnected"):Q("sandbox.developmentFailed")}async function Us(e,t){const n=await e.text().catch(()=>"");let i={};try{i=JSON.parse(n)}catch{const d=Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status});return new Error(n?Q("common.fallbackWithDetail",{fallback:d,detail:n}):d)}const r=i.detail,s=r&&typeof r=="object"?r:i,o=r&&typeof r=="object"&&"message"in r?r.message:r??i.error??i.message,l=typeof o=="string"?o:o==null?"":JSON.stringify(o),c=Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),u=l?Q("common.fallbackWithDetail",{fallback:c,detail:l}):c;return new Fz(u,{code:typeof s.code=="string"?s.code:"",retryable:s.retryable===!0,publicMessage:l||c,httpStatus:e.status})}async function nJ(e,t){const n=await e.text().catch(()=>"");try{return JSON.parse(n)}catch{throw new Error(Q("sandbox.invalidStudioResponse",{fallback:t}))}}function Vb(e,t="codex",n=e.toolName==="intelligent-development"){if(!e.sessionId||!e.status)throw new Error(Q("sandbox.invalidSession"));return{resourceType:"session",id:e.sessionId,toolName:t,userSessionId:e.userSessionId??"",displayName:e.displayName??"",status:e.status,createdAt:e.createdAt??"",expireAt:e.expireAt??"",persistent:e.persistent!==!1,toolType:e.toolType??"",intelligentDevelopment:n,createdBy:e.createdBy??"",region:e.region??"",isMine:e.isMine===!0,threadId:e.threadId??"",cwd:e.cwd??"",workspaceLocked:e.workspaceLocked===!0,busy:e.busy===!0,...typeof e.model=="string"?{model:e.model}:{},permissions:MD(e.permissions),...e.conversation===void 0?{}:{restoredConversation:uy(e.conversation)}}}function iJ(e,t="codex"){if(!e.snapshotId||!e.status)throw new Error(Q("sandbox.invalidSnapshot"));return{resourceType:"snapshot",id:e.snapshotId,snapshotId:e.snapshotId,sourceSessionId:e.sessionId??"",toolName:t,userSessionId:e.userSessionId??"",displayName:e.displayName??"",status:e.status,snapshotStatus:e.snapshotStatus??"Unknown",reason:e.reason??"",createdAt:e.createdAt??"",createdBy:e.createdBy??"",region:e.region??"",isMine:e.isMine===!0}}function rJ(e,t){if((t==null?void 0:t.autoResumeSnapshots)===void 0)return e;const n=new URLSearchParams({autoResumeSnapshots:String(t.autoResumeSnapshots)});return`${e}?${n.toString()}`}const ik={approvalPolicy:"on-request",approvalsReviewer:"user",sandboxMode:"workspace-write",networkAccess:!1};function MD(e){if(!e||typeof e!="object")return{...ik};const t=e,n=t.approvalPolicy,i=t.approvalsReviewer,r=t.sandboxMode;return{approvalPolicy:n==="untrusted"||n==="on-request"||n==="never"?n:ik.approvalPolicy,approvalsReviewer:i==="user"||i==="auto_review"?i:ik.approvalsReviewer,sandboxMode:r==="read-only"||r==="workspace-write"||r==="danger-full-access"?r:ik.sandboxMode,networkAccess:typeof t.networkAccess=="boolean"?t.networkAccess:ik.networkAccess}}function sJ(e){if(!e||typeof e!="object")throw new Error(Q("sandbox.invalidSettings"));const t=e;return{threadId:typeof t.threadId=="string"?t.threadId:"",cwd:typeof t.cwd=="string"?t.cwd:"",...typeof t.model=="string"?{model:t.model}:{},workspaceLocked:t.workspaceLocked===!0,busy:t.busy===!0,permissions:MD(t.permissions)}}function Oa(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Htt(e){const t=Oa(e);if(!(!t||typeof t.id!="string"||!t.id))return{id:t.id,displayName:typeof t.displayName=="string"?t.displayName:t.id,description:typeof t.description=="string"?t.description:"",isDefault:t.isDefault===!0}}function qtt(e){const t=Oa(e);if(!(!t||typeof t.id!="string"||!t.id||typeof t.name!="string"||!t.name))return{id:t.id,name:t.name,description:typeof t.description=="string"?t.description:""}}function $2e(e){const t=Oa(e);if(!(!t||typeof t.id!="string"||!t.id))return{id:t.id,...typeof t.name=="string"&&t.name?{name:t.name}:{},preview:typeof t.preview=="string"?t.preview:"",cwd:typeof t.cwd=="string"?t.cwd:"",modelProvider:typeof t.modelProvider=="string"?t.modelProvider:"",createdAt:typeof t.createdAt=="number"&&Number.isFinite(t.createdAt)?t.createdAt:0,updatedAt:typeof t.updatedAt=="number"&&Number.isFinite(t.updatedAt)?t.updatedAt:0,status:typeof t.status=="string"?t.status:"unknown"}}function uy(e){const t=Oa(e),n=$2e(t==null?void 0:t.thread);if(!t||!n||typeof t.threadId!="string"||!Array.isArray(t.messages))throw new Error(Q("sandbox.invalidThreadSnapshot"));const i=t.messages.flatMap(r=>{const s=Oa(r);if(!s||typeof s.id!="string"||s.role!=="user"&&s.role!=="assistant"||typeof s.content!="string"||typeof s.timestamp!="number")return[];const o=Array.isArray(s.skillNames)?s.skillNames.filter(c=>typeof c=="string"&&!!c):[],l=Array.isArray(s.images)?s.images.flatMap(c=>{const u=Oa(c);return!u||typeof u.mimeType!="string"||!u.mimeType.startsWith("image/")||typeof u.data!="string"||!u.data?[]:[{mimeType:u.mimeType,data:u.data,...typeof u.name=="string"&&u.name?{name:u.name}:{},...typeof u.alt=="string"&&u.alt?{alt:u.alt}:{}}]}):[];return[{id:s.id,role:s.role,content:s.content,timestamp:s.timestamp,...o.length?{skillNames:o}:{},...l.length?{images:l}:{}}]});return{thread:n,threadId:t.threadId,messages:i,...typeof t.model=="string"?{model:t.model}:{},...typeof t.cwd=="string"?{cwd:t.cwd}:{},workspaceLocked:t.workspaceLocked===!0,permissions:MD(t.permissions)}}function X8(e){if(!e||typeof e!="object")return;const t=e;if(![t.totalTokens,t.inputTokens,t.cachedInputTokens,t.outputTokens,t.reasoningOutputTokens].some(i=>typeof i!="number"||!Number.isFinite(i)||i<0))return{totalTokens:Math.trunc(t.totalTokens),inputTokens:Math.trunc(t.inputTokens),cachedInputTokens:Math.trunc(t.cachedInputTokens),outputTokens:Math.trunc(t.outputTokens),reasoningOutputTokens:Math.trunc(t.reasoningOutputTokens)}}function Wtt(e){const t=X8(e.usage);if(!t||typeof e.turnId!="string")return;const n=X8(e.threadTotal),i=e.modelContextWindow;return{turnId:e.turnId,usage:t,...n?{threadTotal:n}:{},...typeof i=="number"&&Number.isFinite(i)&&i>=0?{modelContextWindow:Math.trunc(i)}:{}}}function Ktt(e){return typeof e.id!="string"||e.kind!=="command"&&e.kind!=="file"||typeof e.method!="string"?null:{id:e.id,kind:e.kind,method:e.method,...typeof e.reason=="string"?{reason:e.reason}:{},...typeof e.command=="string"?{command:e.command}:{},...typeof e.cwd=="string"?{cwd:e.cwd}:{},...typeof e.grantRoot=="string"?{grantRoot:e.grantRoot}:{},...e.changes!==void 0?{changes:e.changes}:{},...typeof e.threadId=="string"?{threadId:e.threadId}:{},...typeof e.turnId=="string"?{turnId:e.turnId}:{},...typeof e.itemId=="string"?{itemId:e.itemId}:{}}}function F2e(e={}){let t="";const n=[],i=new Map,r=new Map;let s,o;function l(){var h;const f=s?[...n,s]:n;(h=e.onBlocks)==null||h.call(e,[...f])}function c(f){t+=f;const h=n[n.length-1],m=n.length-1,g=[...i.values()].includes(m);(h==null?void 0:h.kind)==="text"&&!g?n[m]={...h,text:h.text+f}:n.push({kind:"text",text:f}),l()}function u(f){if(typeof f.id!="string"||f.kind!=="thinking"&&f.kind!=="commentary"&&f.kind!=="tool"||f.status!=="running"&&f.status!=="done"&&f.status!=="error")return;const h=f.status!=="running";let m;if(f.kind==="thinking")m={kind:"thinking",text:typeof f.text=="string"?f.text:"",done:h};else if(f.kind==="commentary"){if(typeof f.text!="string"||!f.text)return;m={kind:"text",text:f.text}}else{if(typeof f.name!="string"||!f.name)return;m={kind:"tool",name:f.name,args:f.args,response:f.response,status:f.status==="error"?"failed":h?"completed":"running",done:h}}m={...m,id:f.id,...typeof f.itemType=="string"?{itemType:f.itemType}:{},...typeof f.phase=="string"?{phase:f.phase}:{},...typeof f.durationMs=="number"?{durationMs:f.durationMs}:{}};const g=i.get(f.id);g===void 0?(i.set(f.id,n.length),n.push(m)):n[g]=m,l()}function d(f){var b,v,y,w;let h="message";const m=[];for(const x of f.split(/\r?\n/))x.startsWith("event:")&&(h=x.slice(6).trim()),x.startsWith("data:")&&m.push(x.slice(5).trimStart());if(m.length===0)return;let g;try{g=JSON.parse(m.join(` -`))}catch{throw new Error(Q("sandbox.invalidConversationResponse"))}if(h==="error"){const x=typeof g.message=="string"&&g.message?g.message:Q("sandbox.conversationFailed");throw new Fz(x,{code:typeof g.code=="string"?g.code:"",retryable:g.retryable===!0,publicMessage:x})}if(h==="progress"&&typeof g.text=="string"&&(s=g.text?{kind:"progress",text:g.text}:void 0,l()),["activity","delta","tool_output","tool_progress","plan","diff"].includes(h)&&(s=void 0),h==="activity"&&u(g),(h==="tool_output"||h==="tool_progress")&&typeof g.id=="string"){const x=i.get(g.id),O=x===void 0?void 0:n[x];if((O==null?void 0:O.kind)==="tool"&&x!==void 0&&typeof g.text=="string"){const k=Oa(O.response)||{};n[x]=h==="tool_progress"?{...O,progressText:g.text}:{...O,response:{...k,output:(g.snapshot?"":String(k.output||""))+g.text}},l()}}if((h==="plan"||h==="diff")&&typeof g.id=="string"){const x=typeof g.text=="string"?g.text:"",O=Array.isArray(g.items)?g.items:Array.isArray(g.plan)?g.plan:[],k=h==="diff"?{kind:"diff",id:g.id,text:x,done:g.status==="done"}:{kind:"plan",id:g.id,title:Q("developmentRuns.plan"),summary:x,done:g.status==="done",items:O.flatMap(C=>{const E=Oa(C);if(!E||typeof(E.text??E.step)!="string")return[];const j=E.status==="inProgress"?"in_progress":E.status;return[{text:String(E.text??E.step),status:j==="completed"||j==="failed"||j==="in_progress"?j:"pending"}]})},S=i.get(g.id);S===void 0?(i.set(g.id,n.length),n.push(k)):n[S]=k,l()}if(h==="development.source_ready"||h==="development.succeeded"){const x=Oa(g.payload),O=Oa(x==null?void 0:x.delivery),k=h==="development.succeeded";if(O&&typeof O.sessionId=="string"&&typeof O.artifactSha256=="string"&&typeof O.validationReportSha256=="string"&&typeof O.agentName=="string"&&typeof O.entryPoint=="string"&&typeof O.fileCount=="number"&&typeof O.artifactSize=="number"&&typeof O.validatedAt=="string"&&O.deployable===!0&&O.verified===k&&typeof O.validationSummary=="string"&&Array.isArray(O.gateSummary)&&O.gateSummary.every(S=>typeof S=="string")){const S={kind:"delivery",value:{sessionId:O.sessionId,...typeof O.projectId=="string"&&typeof O.versionId=="string"?{projectId:O.projectId,versionId:O.versionId,...O.parentVersionId===null||typeof O.parentVersionId=="string"?{parentVersionId:O.parentVersionId}:{}}:{},artifactSha256:O.artifactSha256,validationReportSha256:O.validationReportSha256,agentName:O.agentName,entryPoint:O.entryPoint,fileCount:O.fileCount,artifactSize:O.artifactSize,validatedAt:O.validatedAt,gateSummary:O.gateSummary,deployable:O.deployable,verified:O.verified,validationSummary:O.validationSummary}},C=n.findIndex(E=>E.kind==="delivery"&&E.value.sessionId===O.sessionId&&E.value.artifactSha256===O.artifactSha256&&E.value.validationReportSha256===O.validationReportSha256);C===-1?n.push(S):n[C]=S,l()}}if(h==="approval"){const x=Ktt(g);x&&((b=e.onApproval)==null||b.call(e,x))}if(h==="usage"){const x=Wtt(g);x&&(o=x,(v=e.onUsage)==null||v.call(e,x))}if(h==="approval_resolved"&&typeof g.approvalId=="string"&&((y=e.onApprovalResolved)==null||y.call(e,g.approvalId)),h==="delta"&&typeof g.text=="string")if(typeof g.id=="string"&&g.id){const x=r.get(g.id),O=x===void 0?void 0:n[x],k=((w=Oa(g))==null?void 0:w.snapshot)===!0;(O==null?void 0:O.kind)==="text"?n[x]={...O,phase:typeof g.phase=="string"&&g.phase?g.phase:O.phase,text:k?O.text.startsWith(g.text)?O.text:g.text:O.text+g.text}:(r.set(g.id,n.length),n.push({kind:"text",text:g.text,id:g.id,itemType:typeof g.itemType=="string"?g.itemType:void 0,phase:typeof g.phase=="string"?g.phase:void 0})),t=n.filter(S=>S.kind==="text").map(S=>S.text).join(""),l()}else c(g.text);if(h==="done"&&!t&&typeof g.text=="string"&&c(g.text),h==="done"){for(let x=0;x({text:t,blocks:n.map(f=>({...f})),...o?{usage:o}:{}})}}async function Gtt(e,t={}){if(!e.body)throw new Error(Q("sandbox.emptyConversationResponse"));const n=e.body.getReader(),i=new TextDecoder;let r="";const s=F2e(t);for(;;){const{done:l,value:c}=await n.read();r+=i.decode(c,{stream:!l});const u=r.split(/\r?\n\r?\n/);if(r=u.pop()??"",u.forEach(s.consumeFrame),l)break}r.trim()&&s.consumeFrame(r),s.consumeFrame(`event: done -data: {}`);const o=s.result();if(o.blocks.length===0)throw new Error(Q("sandbox.emptyReply"));return o}async function eu(e,t,n,{method:i="GET",body:r,options:s={},fallback:o}){if(!t)throw new Error(Q("sandbox.missingSession"));const l=await vn(`${e}/${encodeURIComponent(t)}/${n}`,{method:i,headers:gs(r===void 0?void 0:{"Content-Type":"application/json"}),...r===void 0?{}:{body:JSON.stringify(r)},signal:s.signal},dp);if(!l.ok)throw await Us(l,o);return l.json()}function B2e(e,t={}){return{async listSessions(n={}){const i=await vn(rJ(e,n),{method:"GET",headers:gs(),signal:n.signal},eJ);if(!i.ok)throw await Us(i,Q("sandbox.listCodexFailed"));const r=await i.json();if(!Array.isArray(r.sessions))throw new Error(Q("sandbox.invalidSessionList"));if(r.snapshots!==void 0&&!Array.isArray(r.snapshots))throw new Error(Q("sandbox.invalidSnapshotList"));return[...r.sessions.map(s=>Vb(s,"codex",t.intelligentDevelopment)),...(r.snapshots??[]).map(s=>iJ(s))]},async startSession(n={}){var s,o;const i=((s=n.displayName)==null?void 0:s.trim())??"",r=await vn(e,{method:"POST",headers:gs({"Content-Type":"application/json"}),body:JSON.stringify({displayName:t.textOnly&&n.projectId?Array.from(i).slice(0,G8).join(""):i,...(o=n.modelId)!=null&&o.trim()?{modelId:n.modelId.trim()}:{},...t.textOnly&&n.projectId?{projectId:n.projectId,...n.baseVersionId?{baseVersionId:n.baseVersionId}:{}}:{},...t.textOnly?{}:{persistent:n.persistent??!0},...n.diskGb!==void 0?{diskGb:n.diskGb}:{}}),signal:n.signal},E3);if(!r.ok)throw await Us(r,Q("sandbox.startFailed"));return Vb(await r.json(),"codex",t.intelligentDevelopment)},async listAgentSessions(n,i={}){const r=await vn(rJ(`/web/${n}/sessions`,i),{method:"GET",headers:gs(),signal:i.signal},eJ);if(!r.ok)throw await Us(r,Q("sandbox.listAgentFailed",{kind:n}));const s=await r.json();if(!Array.isArray(s.sessions))throw new Error(Q("sandbox.invalidKindSessionList",{kind:n}));if(s.snapshots!==void 0&&!Array.isArray(s.snapshots))throw new Error(Q("sandbox.invalidKindSnapshotList",{kind:n}));return[...s.sessions.map(o=>Vb(o,n)),...(s.snapshots??[]).map(o=>iJ(o,n))]},async startAgentSession(n,i={}){var s;const r=await vn(`/web/${n}/sessions`,{method:"POST",headers:gs({"Content-Type":"application/json"}),body:JSON.stringify({displayName:((s=i.displayName)==null?void 0:s.trim())??"",persistent:i.persistent??!0,...i.diskGb!==void 0?{diskGb:i.diskGb}:{}}),signal:i.signal},E3);if(!r.ok)throw await Us(r,Q("sandbox.createAgentFailed",{kind:n}));return Vb(await r.json(),n)},async openAgentSession(n,i,r={}){if(!i)throw new Error(Q("sandbox.missingSessionToOpen"));const s=await vn(`/web/${n}/sessions/${encodeURIComponent(i)}/open`,{method:"POST",headers:gs(),signal:r.signal},dp);if(!s.ok)throw await Us(s,Q("sandbox.openAgentFailed",{kind:n}));const o=await s.json();if(typeof o.webuiUrl!="string"||!o.webuiUrl.startsWith("/"))throw new Error(Q("sandbox.invalidAgentHomeUrl",{kind:n}));return{session:Vb(o,n),kind:n,webuiUrl:ja(o.webuiUrl)}},async launchAgentTerminal(n,i,r={}){if(!i)throw new Error(Q("sandbox.missingSessionForTerminal"));const s=await vn(`/web/${n}/sessions/${encodeURIComponent(i)}/terminal`,{method:"POST",headers:gs(),signal:r.signal},dp);if(!s.ok)throw await Us(s,Q("sandbox.openTerminalFailed",{kind:n}));const o=await s.json();return{url:U2e(o.url,`${n} Terminal`),...typeof o.shellSessionId=="string"?{shellSessionId:o.shellSessionId}:{}}},async deleteAgentSession(n,i,r={}){if(!i)return;const s=await vn(`/web/${n}/sessions/${encodeURIComponent(i)}`,{method:"DELETE",headers:gs(),signal:r.signal},nk);if(!s.ok&&s.status!==404)throw await Us(s,Q("sandbox.deleteAgentFailed",{kind:n}))},async resumeSnapshot(n,i,r={}){if(!i)throw new Error(Q("sandbox.missingSnapshot"));const s=n==="codex"?"/web/sandbox":`/web/${n}`,o=await vn(`${s}/snapshots/${encodeURIComponent(i)}/resume`,{method:"POST",headers:gs(),signal:r.signal},E3);if(!o.ok)throw await Us(o,Q("sandbox.resumeSnapshotFailed"));return Vb(await o.json(),n)},async deleteSnapshot(n,i,r={}){if(!i)return;const s=n==="codex"?"/web/sandbox":`/web/${n}`,o=await vn(`${s}/snapshots/${encodeURIComponent(i)}`,{method:"DELETE",headers:gs(),signal:r.signal},nk);if(!o.ok&&o.status!==404)throw await Us(o,Q("sandbox.deleteSnapshotFailed"))},async connectSession(n,i={}){if(!n)throw new Error(Q("sandbox.missingSessionToConnect"));const r=await vn(`${e}/${encodeURIComponent(n)}/connect`,{method:"POST",headers:gs({"Content-Type":"application/json"}),signal:i.signal},Btt);if(!r.ok)throw await Us(r,Q("sandbox.connectCodexFailed"));const s=Vb(await r.json(),"codex",t.intelligentDevelopment);if(s.status.toLowerCase()!=="ready")throw new Error(Q("sandbox.sessionNotReady",{status:s.status}));return s},async sendMessage(n,i={}){var s;if(!n.sessionId||!n.text.trim())throw new Error(Q("sandbox.invalidMessage"));const r=await vn(`${e}/${encodeURIComponent(n.sessionId)}/messages`,{method:"POST",headers:gs({Accept:"text/event-stream","Content-Type":"application/json"}),body:JSON.stringify({message:n.text,...!t.textOnly&&((s=n.skillIds)!=null&&s.length)?{skillIds:n.skillIds}:{}}),signal:i.signal},t.messageTimeoutMs??Utt);if(!r.ok)throw await Us(r,Q("sandbox.conversationFailed"));return Gtt(r,i)},async interruptSession(n,i={}){if(!n)return;const r=await vn(`${e}/${encodeURIComponent(n)}/interrupt`,{method:"POST",headers:gs(),signal:i.signal},t.interruptTimeoutMs??nk);if(!r.ok&&![404,409].includes(r.status))throw await Us(r,Q("sandbox.interruptFailed"))},async getStatus(n,i={}){const r=await eu(e,n,"status",{options:i,fallback:Q("sandbox.getStatusFailed")}),s=sJ(r),o=Oa(r),l=X8(o==null?void 0:o.threadTotal),c=o==null?void 0:o.modelContextWindow;return{...s,...l?{threadTotal:l}:{},...typeof c=="number"&&Number.isFinite(c)&&c>=0?{modelContextWindow:Math.trunc(c)}:{}}},async getEndpoint(n,i={}){const r=Oa(await eu(e,n,"endpoint",{options:i,fallback:Q("sandbox.getEndpointFailed")}));if(typeof(r==null?void 0:r.endpoint)!="string"||!r.endpoint.trim())throw new Error(Q("sandbox.invalidEndpoint"));return{endpoint:r.endpoint,sessionId:typeof r.sessionId=="string"?r.sessionId:n,...typeof r.expireAt=="string"?{expireAt:r.expireAt}:{}}},async createCodexProjectHandoffPairing(n={}){const i=await vn(`${JZ}/pairings`,{method:"POST",headers:gs({Accept:"application/json","Content-Type":"application/json"}),body:JSON.stringify({ttlSeconds:ztt}),signal:n.signal},tJ);if(!i.ok)throw await Us(i,Q("sandbox.createHandoffPairingFailed"));const r=Oa(await nJ(i,Q("sandbox.createHandoffPairingFailed")));if(typeof(r==null?void 0:r.pairingCode)!="string"||!r.pairingCode.trim()||typeof r.expireAt!="string"||!r.expireAt.trim())throw new Error(Q("sandbox.invalidHandoffPairing"));const s=typeof r.studioUrl=="string"&&r.studioUrl.trim()?r.studioUrl.trim():window.location.origin;return{pairingCode:r.pairingCode,expireAt:r.expireAt,studioUrl:s}},async getCodexProjectHandoffStatus(n,i={}){const r=await vn(`${JZ}/pairings/${encodeURIComponent(n)}`,{headers:gs({Accept:"application/json"}),signal:i.signal},tJ);if(!r.ok)throw await Us(r,Q("sandbox.getHandoffStatusFailed"));const s=Oa(await nJ(r,Q("sandbox.getHandoffStatusFailed"))),o=new Set(["issued","creating","session-created","continuing","running","completed","failed"]);if(typeof(s==null?void 0:s.state)!="string"||!o.has(s.state)||typeof s.expireAt!="string"||!s.expireAt.trim())throw new Error(Q("sandbox.invalidHandoffStatus"));return{state:s.state,expireAt:s.expireAt,...typeof s.projectName=="string"?{projectName:s.projectName}:{},...typeof s.agentName=="string"?{agentName:s.agentName}:{},...typeof s.sessionId=="string"?{sessionId:s.sessionId}:{},...typeof s.error=="string"?{error:s.error}:{},...s.failedStage==="creating-session"||s.failedStage==="uploading-project"||s.failedStage==="restoring-project"||s.failedStage==="continuing-task"?{failedStage:s.failedStage}:{}}},async listModels(n,i={}){const r=Oa(await eu(e,n,"models",{options:i,fallback:Q("sandbox.listModelsFailed")}));if(!Array.isArray(r==null?void 0:r.models))throw new Error(Q("sandbox.invalidModelList"));return r.models.flatMap(s=>{const o=Htt(s);return o?[o]:[]})},async setModel(n,i,r={}){const s=Oa(await eu(e,n,"model",{method:"PUT",body:{model:i},options:r,fallback:Q("sandbox.setModelFailed")}));if(typeof(s==null?void 0:s.model)!="string"||!s.model)throw new Error(Q("sandbox.invalidModel"));return s.model},async listSkills(n,i=!1,r={}){const o=Oa(await eu(e,n,`skills${i?"?force_reload=true":""}`,{options:r,fallback:Q("sandbox.listSkillsFailed")}));if(!Array.isArray(o==null?void 0:o.skills))throw new Error(Q("sandbox.invalidSkillList"));return o.skills.flatMap(l=>{const c=qtt(l);return c?[c]:[]})},async listThreads(n,i={},r={}){const s=new URLSearchParams;i.cursor&&s.set("cursor",i.cursor),i.search&&s.set("search",i.search),i.archived&&s.set("archived","true");const o=s.size?`?${s}`:"",l=Oa(await eu(e,n,`threads${o}`,{options:r,fallback:Q("sandbox.listThreadsFailed")}));if(!Array.isArray(l==null?void 0:l.threads))throw new Error(Q("sandbox.invalidThreadList"));return{threads:l.threads.flatMap(c=>{const u=$2e(c);return u?[u]:[]}),...typeof l.nextCursor=="string"?{nextCursor:l.nextCursor}:{}}},async newThread(n,i={}){return uy(await eu(e,n,"threads/new",{method:"POST",options:i,fallback:Q("sandbox.createThreadFailed")}))},async readThread(n,i,r={}){if(!i)throw new Error(Q("sandbox.missingThread"));return uy(await eu(e,n,`threads/${encodeURIComponent(i)}`,{options:r,fallback:Q("sandbox.readThreadFailed")}))},async resumeThread(n,i,r={}){return uy(await eu(e,n,"threads/resume",{method:"POST",body:{threadId:i},options:r,fallback:Q("sandbox.resumeThreadFailed")}))},async forkThread(n,i={}){return uy(await eu(e,n,"threads/fork",{method:"POST",options:i,fallback:Q("sandbox.forkThreadFailed")}))},async archiveThread(n,i,r={}){const s=Oa(await eu(e,n,"threads/archive",{method:"POST",body:{threadId:i},options:r,fallback:Q("sandbox.archiveThreadFailed")}));if((s==null?void 0:s.archived)!==!0)throw new Error(Q("sandbox.invalidArchiveResult"));return{archived:!0,...s.thread?{snapshot:uy(s)}:{}}},async deleteThread(n,i,r={}){const s=Oa(await eu(e,n,"threads/delete",{method:"POST",body:{threadId:i},options:r,fallback:Q("sandbox.deleteThreadFailed")}));if((s==null?void 0:s.deleted)!==!0)throw new Error(Q("sandbox.invalidDeleteResult"));return{deleted:!0,...s.thread?{snapshot:uy(s)}:{}}},async compactThread(n,i={}){await eu(e,n,"threads/compact",{method:"POST",options:i,fallback:Q("sandbox.compactThreadFailed")})},async getSettings(n,i={}){const r=await vn(`${e}/${encodeURIComponent(n)}/settings`,{method:"GET",headers:gs(),signal:i.signal},dp);if(!r.ok)throw await Us(r,Q("sandbox.getSettingsFailed"));return sJ(await r.json())},async updatePermissions(n,i,r={}){const s=await vn(`${e}/${encodeURIComponent(n)}/permissions`,{method:"PUT",headers:gs({"Content-Type":"application/json"}),body:JSON.stringify(i),signal:r.signal},dp);if(!s.ok)throw await Us(s,Q("sandbox.updatePermissionsFailed"));const o=await s.json();return MD(o.permissions)},async updateWorkspace(n,i,r={}){const s=await vn(`${e}/${encodeURIComponent(n)}/workspace`,{method:"PUT",headers:gs({"Content-Type":"application/json"}),body:JSON.stringify({cwd:i}),signal:r.signal},dp);if(!s.ok)throw await Us(s,Q("sandbox.updateWorkspaceFailed"));const o=await s.json();if(typeof o.cwd!="string"||!o.cwd)throw new Error(Q("sandbox.invalidWorkingDirectory"));return o.cwd},async listDirectories(n,i,r={}){const s=new URLSearchParams({path:i}),o=await vn(`${e}/${encodeURIComponent(n)}/directories?${s}`,{method:"GET",headers:gs(),signal:r.signal},dp);if(!o.ok)throw await Us(o,Q("sandbox.listDirectoriesFailed"));const l=await o.json();if(typeof l.path!="string"||!Array.isArray(l.directories)||l.directories.some(c=>!c||typeof c.name!="string"||typeof c.path!="string"))throw new Error(Q("sandbox.invalidDirectoryList"));return{path:l.path,...typeof l.parent=="string"?{parent:l.parent}:{},directories:l.directories}},async resolveApproval(n,i,r,s={}){const o=await vn(`${e}/${encodeURIComponent(n)}/approvals/${encodeURIComponent(i)}`,{method:"POST",headers:gs({"Content-Type":"application/json"}),body:JSON.stringify({decision:r}),signal:s.signal},dp);if(!o.ok)throw await Us(o,Q("sandbox.resolveApprovalFailed"))},async launchTerminal(n,i={}){return aJ(e,n,"terminal",i)},async launchBrowser(n,i={}){return aJ(e,n,"browser",i)},async uploadFile(n,i,r={}){const s=new FormData;s.set("file",i,i.name);const o=await vn(`${e}/${encodeURIComponent(n)}/files`,{method:"POST",headers:gs(),body:s,signal:r.signal},Qtt);if(!o.ok)throw await Us(o,Q("sandbox.uploadFileFailed"));const l=await o.json();if(typeof l.id!="string"||typeof l.path!="string"||typeof l.name!="string"||typeof l.mimeType!="string"||typeof l.sizeBytes!="number")throw new Error(Q("sandbox.invalidUploadResult"));return l},async closeSession(n,i={}){if(!n)return;const r=await vn(`${e}/${encodeURIComponent(n)}/disconnect`,{method:"POST",headers:gs(),signal:i.signal},nk);if(!r.ok&&r.status!==404)throw await Us(r,Q("sandbox.disconnectCodexFailed"))},async deleteSession(n,i={}){if(!n)return;const r=await vn(`${e}/${encodeURIComponent(n)}`,{method:"DELETE",headers:gs(),signal:i.signal},nk);if(!r.ok&&r.status!==404)throw await Us(r,Q("sandbox.deleteCodexFailed"))}}}const Ur=B2e(Ftt),_v=B2e("/web/intelligent-development/sessions",{textOnly:!0,messageTimeoutMs:36e5,interruptTimeoutMs:45e3,intelligentDevelopment:!0});async function aJ(e,t,n,i){const r=await vn(`${e}/${encodeURIComponent(t)}/${n}`,{method:"POST",headers:gs(),signal:i.signal},dp);if(!r.ok)throw await Us(r,Q(n==="terminal"?"sandbox.openSandboxTerminalFailed":"sandbox.openSandboxBrowserFailed"));const s=await r.json();return{url:U2e(s.url,Q("sandbox.toolLabel")),...typeof s.shellSessionId=="string"?{shellSessionId:s.shellSessionId}:{}}}function U2e(e,t){if(typeof e!="string")throw new Error(Q("sandbox.invalidToolUrl",{label:t}));if(e.startsWith("/"))return ja(e);let n;try{n=new URL(e)}catch{throw new Error(Q("sandbox.invalidToolUrl",{label:t}))}const i=n.protocol==="http:"&&window.location.protocol==="http:";if(n.protocol!=="https:"&&!i)throw new Error(Q("sandbox.unsafeToolUrl",{label:t}));return n.toString()}const hu=e=>["succeeded","cancelled","failed"].includes(e.state),Q2e="/web/intelligent-development";class qw extends Error{constructor(t,n){super(t),this.status=n}}async function Hb(e,t="GET",n,i){const r=await vn(`${Q2e}${e}`,{method:t,signal:i,headers:gs(n===void 0?void 0:{"Content-Type":"application/json"}),...n===void 0?{}:{body:JSON.stringify(n)}},3e4);if(!r.ok){const s=await r.json().catch(()=>null),o=s==null?void 0:s.detail;throw new qw(typeof o=="string"?o:(o==null?void 0:o.message)||Q("developmentRuns.requestFailed"),r.status)}return r.json()}function jv(e){const t=e;if(!t||typeof t.runId!="string"||typeof t.sessionId!="string"||!["queued","running","recovering","waiting_user","stopping","succeeded","cancelled","failed"].includes(t.state))throw new Error(Q("developmentRuns.invalidResponse"));return t}const ef={async active(e){const t=await Hb("/runs","GET",void 0,e);if(!Array.isArray(t.runs))throw new Error(Q("developmentRuns.invalidResponse"));return t.runs.map(jv)},async get(e,t){return jv(await Hb(`/runs/${encodeURIComponent(e)}`,"GET",void 0,t))},async list(e,t){const n=await Hb(`/sessions/${encodeURIComponent(e)}/runs`,"GET",void 0,t);if(!Array.isArray(n.runs))throw new Error(Q("developmentRuns.invalidResponse"));return n.runs.map(jv)},async create(e,t,n){return jv(await Hb(`/sessions/${encodeURIComponent(e)}/runs`,"POST",{message:t,requestId:n}))},async steer(e,t,n){await Hb(`/runs/${encodeURIComponent(e)}/inputs`,"POST",{message:t,clientId:n})},async stop(e){return jv(await Hb(`/runs/${encodeURIComponent(e)}/stop`,"POST"))},async resume(e){return jv(await Hb(`/runs/${encodeURIComponent(e)}/resume`,"POST"))}};class Xtt{constructor(t){Zt(this,"cursor",0);Zt(this,"turns",[]);Zt(this,"activeInput");Zt(this,"itemTurns",new Map);Zt(this,"nativeInputs",new Map);Zt(this,"metrics",new Map);Zt(this,"inputOrder",[]);Zt(this,"projections",new Map);Zt(this,"itemInputs",new Map);this.run=t,this.activeInput=t.requestId}projection(t){let n=this.projections.get(t);if(!n){const i={role:"assistant",blocks:[],meta:{localId:`${t}:assistant`}},r=this.turns.findIndex(s=>{var o;return((o=s.meta)==null?void 0:o.localId)===`${t}:user`});this.turns.splice(r<0?this.turns.length:r+1,0,i),n=F2e({onBlocks:s=>{i.blocks=s.map(o=>({...o,turnId:this.itemTurns.get(o.id||"")}))},onUsage:s=>{i.meta={...i.meta,sandboxUsage:s.usage}}}),this.projections.set(t,n)}return n}apply(t){if(t.payload.runId!==this.run.runId)throw new Error(Q("developmentRuns.invalidResponse"));if(t.seq<=this.cursor)return;if(t.seq!==this.cursor+1)throw new Error(Q("developmentRuns.eventGap"));for(const i of this.turns)i.blocks.some(r=>r.kind==="turn-summary")&&(i.blocks=i.blocks.filter(r=>r.kind!=="turn-summary"));const n=t.payload;if(t.type==="run.input"&&typeof n.clientId=="string"&&typeof n.message=="string")this.turns.push({role:"user",blocks:[{kind:"text",text:n.message}],meta:{localId:`${n.clientId}:user`},activity:{id:`${n.clientId}:delivery`,title:Q(`developmentRuns.input.${String(n.status)}`)}}),this.inputOrder.push(n.clientId),this.projection(n.clientId),n.status==="delivered"&&this.inputOrder.indexOf(n.clientId)>=this.inputOrder.indexOf(this.activeInput)&&(this.activeInput=n.clientId);else if(t.type==="run.input_status"&&typeof n.clientId=="string"){const i=this.turns.find(r=>{var s;return((s=r.meta)==null?void 0:s.localId)===`${n.clientId}:user`});i&&(i.activity={id:`${n.clientId}:delivery`,title:Q(`developmentRuns.input.${String(n.status)}`)}),n.status==="delivered"&&this.inputOrder.indexOf(n.clientId)>=this.inputOrder.indexOf(this.activeInput)&&(this.activeInput=n.clientId)}else if(t.type==="run.turn"&&typeof n.turnId=="string"){const r={...this.metrics.get(n.turnId),turnId:n.turnId,status:String(n.status||"inProgress"),toolCalls:0,toolDurationComplete:!1};for(const s of["startedAt","completedAt","durationMs"])typeof n[s]=="number"&&Number.isFinite(n[s])&&n[s]>=0&&(r[s]=n[s]);if(typeof n.model=="string"&&(r.model=n.model),n.usage&&typeof n.usage=="object"&&!Array.isArray(n.usage)){const s={};for(const o of["totalTokens","inputTokens","outputTokens","cachedInputTokens","cacheWriteInputTokens","reasoningOutputTokens"]){const l=n.usage[o];typeof l=="number"&&Number.isSafeInteger(l)&&l>=0&&(s[o]=l)}r.usage=s}n.usageIncomplete===!0&&(r.usageIncomplete=!0),this.metrics.set(n.turnId,r),this.nativeInputs.set(n.turnId,this.activeInput),this.projection(this.activeInput)}else if(t.type==="run.status"){if(this.run={...this.run,...n},hu(this.run))for(const[i,r]of this.metrics)r.status==="inProgress"&&this.metrics.set(i,{...r,status:"unavailable",usageIncomplete:!0});if(hu(this.run)||this.run.state==="waiting_user")for(const i of this.projections.values())i.consumeFrame(`event: done +${l}`:r:l?Q("client.errorWithDetailAndRawResponse",{context:r,detail:l,response:s}):Q("client.errorWithRawResponse",{context:r,response:s})}catch{return Q("client.errorWithRawResponse",{context:r,response:s})}}async function ptt(e){const t=await Ft(e,Q("client.mpaRuntimeSessionsLoadFailed"));return e.status===401&&/X-Jwt-Token/i.test(t)?Q("client.mpaRuntimeLegacyAuthUnsupported",{detail:t}):t}async function xz(e,t=!1){const n=await gt(`/web/model-api-keys${t?"?refresh=true":""}`,{signal:e,cache:"no-store"});if(!n.ok)throw new Error(await Ft(n,Q("client.loadArkApiKeysFailed")));return await n.json()}async function GAe(e,t){const n=await gt(`/web/model-api-keys/${encodeURIComponent(e)}/value`,{method:"POST",signal:t,cache:"no-store"});if(!n.ok)throw new Error(await Ft(n,Q("client.loadArkApiKeysFailed")));return await n.json()}async function B1(e){const t=new URLSearchParams;e!=null&&e.apiKeyId&&t.set("apiKeyId",e.apiKeyId),e!=null&&e.refresh&&t.set("refresh","true"),e!=null&&e.scope&&t.set("scope",e.scope);const n=t.toString(),i=await gt(`/web/model-options${n?`?${n}`:""}`,{signal:e==null?void 0:e.signal,cache:"no-store"});if(!i.ok)throw new Error(await Ft(i,Q("client.loadModelsFailed")));return await i.json()}async function XAe(){const e=await gt("/list-apps");if(!e.ok)throw new Error(`list-apps failed: ${e.status}`);return e.json()}class U1 extends Error{constructor(){super(Q("client.runtimeAccessDenied")),this.name="RuntimeAccessDeniedError"}}class Oa extends Error{constructor(t,n=!1,i=!1){super(t),this.unsupported=n,this.retryable=i,this.name="RuntimeProbeError"}}const YAe=()=>Q("client.privateRuntimeUnavailable"),ZAe=()=>Q("client.runtimeTemporarilyUnavailable"),KZ=["cn-beijing","cn-shanghai"],mtt=3e4,Q1=5*60*1e3,JAe=60*1e3;let rC="volcengine";const tw=new Map,dy=new Map,fy=new Map,nf=new Map,ss=new Map;function wz(e,t,n){return`${t}:${e}:${n??""}`}function eTe(e){e!==rC&&ss.clear(),rC=e}function LA(e){const t=(e||"").trim();if(rC==="byteplus")return[t&&!t.startsWith("cn-")?t:I8];const n=t&&!t.startsWith("ap-")?t:mz;return KZ.includes(n)?[n,...KZ.filter(i=>i!==n)]:[n]}function TD(e){const t=(e||"").trim();return t?[t]:LA()}function B0(...e){return e.map(t=>String(t??"")).join("")}function Sb(e,t,n){const i=e.get(t);return i!=null&&i.value&&Date.now()-i.updatedAt<=n?i.value:null}function Oz(e,t,n){return e.set(t,{value:n,updatedAt:Date.now()}),n}function Y2(e,t){return t?t.aborted?Promise.reject(new DOMException("The operation was aborted.","AbortError")):new Promise((n,i)=>{const r=()=>{i(new DOMException("The operation was aborted.","AbortError"))};t.addEventListener("abort",r,{once:!0}),e.then(s=>{t.removeEventListener("abort",r),n(s)},s=>{t.removeEventListener("abort",r),i(s)})}):e}async function tTe(e){try{const t=await e.clone().json();return typeof t.detail=="string"?t.detail:""}catch{return""}}async function $A(e,t,n,i,r=ho){const s=await gt("/list-apps",{signal:i},n??{base:e,apiKey:t},r),o=n!=null&&n.runtimeId?await tTe(s):"";if(n!=null&&n.runtimeId&&o==="runtime_access_denied")throw new U1;if(n!=null&&n.runtimeId&&o==="runtime_private_endpoint_unreachable")throw new Oa(YAe());if(n!=null&&n.runtimeId&&["runtime_proxy_connect_error","runtime_proxy_timeout","runtime_json_connect_error","runtime_json_timeout"].includes(o))throw new Oa(ZAe(),!1,!0);if(n!=null&&n.runtimeId&&s.status===404)throw new Oa(Q("client.runtimeConnectionUnsupported"),!0,!0);if(n!=null&&n.runtimeId&&(s.status===401||s.status===403))throw new Oa(Q("client.runtimeConnectionDenied"));if(!s.ok)throw new Error(await Ft(s,Q("client.listAgentsFailed")));let l;try{l=await s.json()}catch{throw new Oa(Q("client.invalidListAppsJson"))}if(!Array.isArray(l)||l.some(u=>typeof u!="string"||!u.trim()))throw new Oa(Q("client.invalidListAppsFormat"));const c=l.map(u=>u.trim());return n!=null&&n.runtimeId&&tw.set(wz(n.runtimeId,n.region??"",n.runtimeVersion),{apps:c,expiresAt:Date.now()+mtt}),c}async function nTe(e,t){const{app:n,ep:i}=Na(e);if(F1(n,i)){const o=await gtt(i),l=await gt(`/api/v1/agents/${encodeURIComponent(o)}/profile-status`,{cache:"no-store"},i),c=!l.ok&&await htt(l)==="profile_not_found";if(!l.ok&&!c){const m=Q("client.createSessionFailedWithStatus",{status:l.status}),g=await Ft(l,Q("client.createSessionFailed"));throw new Error(g===m?m:Q("common.fallbackWithDetail",{fallback:m,detail:g}))}const u=c?{}:await l.json(),d=Number(u.profileRevision??0),f=await gt("/api/v1/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mpaInstanceId:o,profileRevision:d})},i);if(!f.ok){const m=Q("client.createSessionFailedWithStatus",{status:f.status}),g=await Ft(f,Q("client.createSessionFailed"));throw new Error(g===m?m:Q("common.fallbackWithDetail",{fallback:m,detail:g}))}const h=await f.json();return String(h.sessionId??h.id??"")}const r=await gt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"},i);if(!r.ok){const o=Q("client.createSessionFailedWithStatus",{status:r.status}),l=await Ft(r,Q("client.createSessionFailed"));throw new Error(l===o?o:Q("common.fallbackWithDetail",{fallback:o,detail:l}))}return(await r.json()).id}async function gtt(e){var i,r,s,o;const t=(i=e.mpaInstanceId)==null?void 0:i.trim();if(t)return t;const n=((r=e.runtimeId)==null?void 0:r.trim())??"";if(!n)return"";try{const l=await DD(n,e.region??"cn-beijing"),c=(s=l.mpaInstanceId)==null?void 0:s.trim();if(c)return c;const u=(o=l.envs.find(d=>d.key==="MPA_AGENT_ID"))==null?void 0:o.value.trim();if(u)return u}catch{}return n}async function kz(e,t){const{app:n,ep:i}=Na(e);if(F1(n,i)){const s=await gt("/api/v1/sessions",{cache:"no-store"},i);if(!s.ok)throw new Error(await ptt(s));const o=await s.json();return Array.isArray(o)?o:o.sessions??[]}const r=await gt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{},i);if(!r.ok)throw new Error(await Ft(r,Q("client.listSessionsFailed")));return r.json()}async function sC(e,t,n){const{app:i,ep:r}=Na(e);if(F1(i,r)){const l=await gt(`/api/v1/sessions/${encodeURIComponent(n)}`,{cache:"no-store"},r);if(!l.ok){const f=await Ft(l,Q("client.getSessionFailed"));throw new Error(Q("client.getSessionFailedWithDetail",{status:l.status,detail:f}))}const c=await l.json(),u=await gt(`/api/v1/sessions/${encodeURIComponent(n)}/events`,{cache:"no-store"},r);if(!u.ok){const f=await Ft(u,Q("client.getSessionFailed"));throw new Error(Q("client.getSessionFailedWithDetail",{status:u.status,detail:f}))}const d=await u.json();return c.events=Array.isArray(d.events)?d.events:[],c}const s=await gt(`/apps/${i}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}`,{},r);if(!s.ok){const l=await Ft(s,Q("client.getSessionFailed"));throw new Error(Q("client.getSessionFailedWithDetail",{status:s.status,detail:l}))}const o=await s.json();if(r.runtimeId){const l=bz(r.runtimeId,i,t,n);o.state={...yz()[l]??{},...o.state??{}}}return o}async function iTe(e){const{app:t,ep:n}=Na(e.appName);if(!n.runtimeId)throw new Error(Q("client.feedbackRuntimeOnly"));if(!n.region)throw new Error(Q("client.feedbackRegionMissing"));const i=await gt("/web/evaluation/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:n.runtimeId,region:n.region,appName:t,userId:e.userId,sessionId:e.sessionId,eventId:e.eventId,rating:e.rating,comment:e.comment??""})},{},hr);if(!i.ok)throw new Error(await Ft(i,Q("client.submitFeedbackFailed")));const r=await i.json(),s=bz(n.runtimeId,t,e.userId,e.sessionId);return ftt(s,e.eventId,r),r}async function _D(e,t={}){const n=B0(e.runtimeId,e.region||"cn-beijing",e.appName,e.pageSize??100),i=Sb(nf,n,JAe);if(!t.force&&i)return i;const r=nf.get(n);if(!t.force&&(r!=null&&r.promise))return r.promise;let s=null;const o=(async()=>{for(const l of TD(e.region)){const c=new URLSearchParams({runtimeId:e.runtimeId,region:l,appName:e.appName,page_size:String(e.pageSize??100)}),u=await gt(`/web/evaluation/feedback-cases?${c.toString()}`);if(u.ok)return Oz(nf,n,await u.json());s=new Error(await Ft(u,Q("client.loadEvaluationSetsFailed")))}throw s??new Error(Q("client.loadEvaluationSetsFailed"))})();nf.set(n,{...r,promise:o,updatedAt:(r==null?void 0:r.updatedAt)??0});try{return await o}finally{const l=nf.get(n);(l==null?void 0:l.promise)===o&&nf.set(n,{value:l.value,updatedAt:l.updatedAt})}}async function P8(e){let t=null;for(const n of TD(e.region)){const i=new URLSearchParams({runtimeId:e.runtimeId,region:n,appName:e.appName,userId:e.userId}),r=await gt(`/web/evaluation/statuses?${i.toString()}`);if(r.ok)return r.json();t=new Error(await Ft(r,Q("client.loadAutoEvaluationStatusFailed")))}throw t??new Error(Q("client.loadAutoEvaluationStatusFailed"))}async function rTe(e){let t=null;for(const n of TD(e.region)){const i=new URLSearchParams({runtimeId:e.runtimeId,region:n,appName:e.appName}),r=await gt(`/web/evaluation/optimizations?${i.toString()}`);if(r.ok)return r.json();t=new Error(await Ft(r,Q("client.loadOptimizationsFailed")))}throw t??new Error(Q("client.loadOptimizationsFailed"))}function sTe(e){return Sb(nf,B0(e.runtimeId,e.region||"cn-beijing",e.appName,e.pageSize??100),JAe)}function btt(e){_D(e).catch(()=>{})}function aTe(e){_D(e,{force:!0}).catch(()=>{})}function oTe(e,t){return["good","bad"].map(n=>{const i=e.find(r=>r.kind===n);return{kind:n,evaluationSetId:(i==null?void 0:i.evaluationSetId)??null,evaluationSetName:(i==null?void 0:i.evaluationSetName)??null,workspaceId:(i==null?void 0:i.workspaceId)??null,itemCount:t.filter(r=>r.kind===n).length}})}function cN(e){const t=e.comment??"",n=e.rating==="bad"&&!!t.trim();for(const[i,r]of nf.entries()){const s=r.value;if(!s||s.runtimeId!==e.runtimeId||s.agentName!==e.appName)continue;const o=s.items.filter(c=>c.sessionId!==e.sessionId||c.messageId!==e.messageId),l=e.rating?[{id:`local:${e.runtimeId}:${e.sessionId}:${e.messageId}`,itemKey:`local:${e.messageId}`,kind:e.rating,input:e.input,output:e.output,referenceOutput:e.referenceOutput??e.output,comment:t,agentName:e.appName,sessionId:e.sessionId,messageId:e.messageId,runtimeId:e.runtimeId,invocationId:e.invocationId??"",userId:e.userId,createdAt:e.createdAt??new Date().toISOString(),evaluationSetId:"",evaluationSetName:"",workspaceId:"",source:"user",score:n?0:null,reason:n?t:""},...o]:o;nf.set(i,{value:{...s,sets:oTe(s.sets,l),items:l},updatedAt:Date.now(),promise:r.promise})}}async function lTe(e){let t=null;for(const n of TD(e.region)){const i=await gt("/web/evaluation/feedback-cases/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e.runtimeId,region:n,appName:e.appName,itemIds:e.itemIds})},{},hr);if(i.ok){const r=await i.json(),s=new Set(e.itemIds);for(const[o,l]of nf.entries()){const c=l.value;if(!c||c.runtimeId!==e.runtimeId||c.agentName!==e.appName)continue;const u=c.items.filter(d=>!s.has(d.id));nf.set(o,{value:{...c,sets:oTe(c.sets,u),items:u},updatedAt:Date.now()})}return r}t=new Error(await Ft(i,Q("client.deleteEvaluationCaseFailed")))}throw t??new Error(Q("client.deleteEvaluationCaseFailed"))}async function D8(e,t,n){const{app:i,ep:r}=Na(e);if(F1(i,r)){const o=await gt(`/api/v1/sessions/${encodeURIComponent(n)}`,{method:"DELETE"},r);if(!o.ok&&o.status!==404)throw new Error(`delete session failed: ${o.status}`);return}const s=await gt(`/apps/${i}/users/${encodeURIComponent(t)}/sessions/${n}`,{method:"DELETE"},r);if(!s.ok&&s.status!==404)throw new Error(`delete session failed: ${s.status}`)}function ytt(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"="),i=window.atob(n),r=new Uint8Array(i.length);for(let s=0;sURL.revokeObjectURL(l),0)}async function uTe(e,t,n,i,r){const{app:s,ep:o}=Na(e),l=r==null?"":`?version=${encodeURIComponent(r)}`,c=`/apps/${encodeURIComponent(s)}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}/artifacts/${encodeURIComponent(i)}${l}`,u=await gt(c,{},o,hr);if(!u.ok)throw new Error(await Ft(u,Q("client.downloadFileFailed")));const d=await u.json(),f=d.inlineData??d.inline_data;if(!(f!=null&&f.data))throw new Error(Q("client.fileUnavailable"));const h=ytt(f.data),m=h.buffer.slice(h.byteOffset,h.byteOffset+h.byteLength);return{blob:new Blob([m],{type:f.mimeType??f.mime_type??"application/octet-stream"}),downloadName:f.displayName??f.display_name??i}}async function Ez(e,t,n,i,r){const{blob:s}=await uTe(e,t,n,i,r);return URL.createObjectURL(s)}async function vtt(e){const t=await gt("/web/media/capabilities");if(!t.ok)throw new Error(await Ft(t,"media capabilities failed"));return t.json()}async function dTe(e,t,n,i){const{app:r}=Na(e),s=new FormData;s.set("app_name",r),s.set("user_id",t),s.set("session_id",n),s.set("file",i);const o=await gt("/web/media",{method:"POST",body:s},{},hr);if(!o.ok)throw new Error(await Ft(o,Q("client.uploadFileFailed")));return{...await o.json(),status:"ready"}}async function M8(e,t,n){const{app:i}=Na(e),r=`/web/media/${encodeURIComponent(i)}/${encodeURIComponent(t)}/${encodeURIComponent(n)}/delete`,s=await gt(r,{method:"POST"});if(!s.ok&&s.status!==404)throw new Error(await Ft(s,"media cleanup failed"))}function fTe(e){try{const t=new URL(e);if(t.protocol!=="veadk-media:"||t.hostname!=="apps")return;const n=t.pathname.split("/").filter(Boolean).map(decodeURIComponent);return n.length!==7||n[1]!=="users"||n[3]!=="sessions"||n[5]!=="media"?void 0:`/web/media/${n.map(encodeURIComponent).filter((i,r)=>![1,3,5].includes(r)).join("/")}`}catch{return}}async function uN(e,t){const n=fTe(t);if(!n)throw new Error("Invalid VeADK media URI");const i=await gt(`${n}/delete`,{method:"POST"});if(!i.ok&&i.status!==404)throw new Error(await Ft(i,"media cleanup failed"))}function hTe(e,t){if(t.startsWith("data:")||t.startsWith("blob:")||/^https?:/.test(t))return t;const n=fTe(t);if(!n)return t;const i=`${n}/content`;return Ta(`${lN}${i}`)}async function ZR(e,t,n){const{app:i,ep:r}=Na(e);let s;if(r.runtimeId){const c=new URLSearchParams({runtimeId:r.runtimeId,sessionId:t,region:r.region??"cn-beijing"});if(n&&c.set("endTimeMs",String(Math.round(n))),s=await gt(`/web/runtime-trace?${c.toString()}`),s.status===404)throw new Error(Q("client.traceDisabled"))}else s=await gt(`/dev/apps/${encodeURIComponent(i)}/debug/trace/session/${encodeURIComponent(t)}`,{},r);if(!s.ok)throw new Error(await Ft(s,Q("client.loadTraceFailed")));const o=s.headers.get("content-type")??"";if(!o.includes("application/json")){const c=o.split(";",1)[0]||Q("client.contentTypeMissing");throw new Error(Q("client.traceNonJson",{contentType:c}))}const l=await s.json();if(!Array.isArray(l))throw new Error(Q("client.invalidTraceFormat"));return l}async function L8(e){const t=await gt("/web/issue-feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await Ft(t,Q("client.submitIssueFeedbackFailed")));if((await t.json()).submitted!==!0)throw new Error(Q("client.issueFeedbackNotConfirmed"));return{submitted:!0}}async function GZ(e,t,n=!0,i){const r=await gt(`/web/agent-info/${e}`,{signal:i},t);if(!r.ok)throw new Error(`agent-info failed: ${r.status}`);const s=await r.json();if(n&&!s.draft)try{const o=await gt(`/web/agent-draft/${e}`,{},t);if(o.ok){const l=await o.json();s.draft=l.draft}}catch{}return{appName:e,agentCategory:s.agentCategory,mpa:s.mpa,name:s.name??e,description:s.description??"",type:s.type,model:s.model??"",selectableModels:s.selectableModels??[],turnLifecycleControl:s.turnLifecycleControl,resourceTopology:s.resourceTopology,tools:s.tools??[],skillsPreviewSupported:Array.isArray(s.skills),skills:s.skills??[],subAgents:s.subAgents??[],components:s.components??[],searchSources:s.searchSources??[],graph:s.graph,draft:s.draft}}function xtt(e){return/agent-info failed:\s*404\b/i.test(String(e))}async function pTe(e,t,n=!0,i){try{return await GZ(e,t,n,i)}catch(r){if(e==="a2a-default"||!xtt(r))throw r;return GZ("a2a-default",t,n,i)}}class jD extends Error{constructor(t){super("Turn state changed before the control request completed"),this.authoritativeState=t,this.name="TurnControlConflictError"}}async function mTe(e,t){const{ep:n}=Na(e),i=await gt(`/api/v1/a2a/tasks/by-session/${encodeURIComponent(t)}/control`,{cache:"no-store"},n);if(!i.ok)throw new Error(await Ft(i,"turn control failed"));return i.json()}async function gTe(e,t,n,i){var o;const{ep:r}=Na(e),s=await gt(`/api/v1/a2a/tasks/by-session/${encodeURIComponent(t)}/control/${n}`,{method:"POST",headers:{"Content-Type":"application/json","Idempotency-Key":crypto.randomUUID()},body:JSON.stringify({expectedGeneration:i})},r);if(s.status===409){const l=await s.json().catch(()=>null);if((o=l==null?void 0:l.detail)!=null&&o.taskId)throw new jD(l.detail)}if(!s.ok)throw new Error(await Ft(s,"turn control failed"));return s.json()}async function wtt(e,t,n,i,r){var c;const{ep:s}=Na(e),o=await gt(`/api/v1/a2a/tasks/${encodeURIComponent(n)}/continue`,{method:"POST",headers:{"Content-Type":"application/json","Idempotency-Key":r},body:JSON.stringify({expectedGeneration:i})},s);if(o.status===409){const u=await o.json().catch(()=>null);if((c=u==null?void 0:u.detail)!=null&&c.taskId)throw new jD(u.detail)}if(!o.ok)throw new Error(await Ft(o,"turn continue failed"));const l=await o.json();if(l.sessionId!==t)throw new Error("turn continue returned a different session");return l}async function*bTe({appName:e,sessionId:t,taskId:n,expectedGeneration:i,idempotencyKey:r,lastEventId:s,signal:o,onRuntimeContext:l}){const{ep:c}=Na(e),u=(s==null?void 0:s.trim())??"",d=Tz(o);let f;try{const g=await gt(`/api/v1/a2a/tasks/${encodeURIComponent(n)}/continue`,{method:"POST",headers:{"Content-Type":"application/json","Idempotency-Key":r},body:JSON.stringify({expectedGeneration:i}),signal:d.signal},c,0),b=YR(g,c.runtimeId??"",c.region??"");if(b&&(l==null||l(b)),!g.ok){d.cleanup();const y=await Ft(g,"turn continue failed");throw new Error(Jo(Q("client.runSseFailedWithDetail",{status:g.status,detail:y})))}const v=await g.json();if(v.sessionId!==t)throw d.cleanup(),new Error(Jo("turn continue returned a different session"));f=await gt(`/api/v1/sessions/${encodeURIComponent(t)}/sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invocationId:v.invocationId,...u?{lastEventId:u}:{}}),signal:d.signal},c,0)}catch(g){throw d.cleanup(),d.timedOut()?new Error(Gg()):o!=null&&o.aborted||(g==null?void 0:g.name)==="AbortError"?g:new Error(Jo(g))}const h=YR(f,c.runtimeId??"",c.region??"");if(h&&(l==null||l(h)),!f.ok){d.cleanup();const g=await Ft(f,Q("client.runSessionFailed"));throw new Error(Jo(Q("client.runSseFailedWithDetail",{status:f.status,detail:g})))}let m=!1;try{for await(const g of MA(f)){if(g&&typeof g=="object"&&g[iC]==="done"){d.clearDeadline();break}m=!0,d.clearDeadline();const b={...g};delete b[iC],typeof b.error=="string"&&(b.error=Jo(b.error)),typeof b.errorMessage=="string"&&(b.errorMessage=Jo(b.errorMessage)),typeof b.error_message=="string"&&(b.error_message=Jo(b.error_message)),yield b}}catch(g){throw d.timedOut()?new Error(Gg()):o!=null&&o.aborted||(g==null?void 0:g.name)==="AbortError"?g:new Error(Jo(g))}finally{d.cleanup()}if(!m)throw new Error(Az())}async function $8(e,t){const{app:n,ep:i}=Na(e);return pTe(n,i,!1,t)}async function Ott(e,t,n){let i=null;for(const r of LA(t)){const s={runtimeId:e,region:r};try{const o=wz(e,r),l=tw.get(o);l&&l.expiresAt<=Date.now()&&tw.delete(o);const c=tw.get(o),u=n||(c==null?void 0:c.apps[0])||(await $A("","",s))[0];if(!u)throw new Error(Q("client.noPreviewableAgent"));return pTe(u,s)}catch(o){if(o instanceof U1||o instanceof Oa&&!o.unsupported)throw o;i=o instanceof Error?o:new Error(String(o))}}throw i??new Error(Q("client.noPreviewableAgent"))}async function Cz(e,t,n={},i={}){const r=typeof n=="string"?n:void 0,s=typeof n=="string"?i:n,o=B0(e,t||"cn-beijing",r??""),l=Sb(dy,o,Q1);if(!s.force&&l)return l;const c=dy.get(o);if(!s.force&&(c!=null&&c.promise))return c.promise;const u=Ott(e,t,r).then(d=>Oz(dy,o,d));dy.set(o,{...c,promise:u,updatedAt:(c==null?void 0:c.updatedAt)??0});try{return await u}finally{const d=dy.get(o);(d==null?void 0:d.promise)===u&&dy.set(o,{value:d.value,updatedAt:d.updatedAt})}}function yTe(e,t,n=""){return Sb(dy,B0(e,t||"cn-beijing",n),Q1)}function vTe(e,t,n=""){Cz(e,t,n).catch(()=>{})}function JR(e){const{app:t,ep:n}=Na(e);return F1(t,n)}function np(e){const{app:t,ep:n}=Na(e);return t==="a2a-default"&&!!(n.runtimeId&&(n.agentCategory==="mpa"||n.mpaInstanceId))}async function xTe(e,t,n,i){const{app:r,ep:s}=Na(e),o=new URLSearchParams({source:t,app_name:r,q:n,user_id:i}),l=await gt(`/web/search?${o.toString()}`,{},s);if(!l.ok)throw new Error(await Ft(l,Q("client.agentSearchFailed")));return l.json()}async function wTe(e,t){const{app:n}=Na(e),i=await gt(`/web/search?source=web&app_name=${encodeURIComponent(n)}&q=${encodeURIComponent(t)}`);if(!i.ok)throw new Error(`web search failed: ${i.status}`);return i.json()}function Az(){return Jo(Q("client.emptySseBody"))}function cS(){return Jo(Q("client.noDisplayableSseReply"))}const ktt=6e4;function Gg(){return Q("client.firstSseEventTimeout")}function Tz(e){if(e!=null&&e.aborted)return{signal:e,clearDeadline:()=>{},cleanup:()=>{},timedOut:()=>!1};const t=new AbortController;let n=!1,i=!1;const r=()=>{i||(i=!0,clearTimeout(o))},s=()=>{t.signal.aborted||t.abort((e==null?void 0:e.reason)??new DOMException("Aborted","AbortError"))},o=setTimeout(()=>{i||t.signal.aborted||(n=!0,i=!0,t.abort(new Error(Gg())))},ktt);return e==null||e.addEventListener("abort",s,{once:!0}),{signal:t.signal,clearDeadline:r,cleanup:()=>{r(),e==null||e.removeEventListener("abort",s)},timedOut:()=>n}}async function*F8({appName:e,userId:t,sessionId:n,text:i,modelId:r,idempotencyKey:s,executionConfigVersion:o,lastEventId:l,attachments:c=[],invocation:u,platformTools:d,environmentMounts:f,environmentMount:h,functionResponses:m=[],signal:g,onRuntimeContext:b}){const{app:v,ep:y}=Na(e),w=c.flatMap(I=>I.status&&I.status!=="ready"?[]:I.uri?[{fileData:{mimeType:I.mimeType,fileUri:I.uri,displayName:I.name},partMetadata:{veadkMedia:{id:I.id,uri:I.uri,name:I.name,mimeType:I.mimeType,sizeBytes:I.sizeBytes}}}]:I.data?[{inlineData:{mimeType:I.mimeType,data:I.data,displayName:I.name}}]:[]),x=u&&(u.skills.length>0||u.targetAgent)?u:void 0,O=[...w,...m.map(I=>({functionResponse:{id:I.id,name:I.name,response:I.response}})),...i.trim()?[{text:i}]:[]];if(x&&O.length>0){const I=O[0],D=I.partMetadata;O[0]={...I,partMetadata:{...D,veadkInvocation:x}}}const k=(s==null?void 0:s.trim())??"",S=(l==null?void 0:l.trim())??"",C=typeof o=="number",E=C||k?{veadkExecution:{...C?{executionConfigVersion:o}:{},...k?{idempotencyKey:k}:{}}}:void 0,j=x||E?{...x?{veadkInvocation:x}:{},...E??{}}:void 0,T=F1(v,y);if(T&&y.runtimeId){const I=y.region?`?region=${encodeURIComponent(y.region)}`:"";try{const D=await yn(`/web/mpa/identity-prewarm/${encodeURIComponent(y.runtimeId)}${I}`,{method:"POST",headers:{"X-Requested-With":"XMLHttpRequest"},signal:g},1e4);D.ok||console.warn("[mpa] identity prewarm unavailable",D.status)}catch(D){if(g!=null&&g.aborted)throw D;console.warn("[mpa] identity prewarm unavailable")}}let R;const A=Tz(g);try{if(T){const I=await gt(`/api/v1/sessions/${encodeURIComponent(n)}/run`,{method:"POST",headers:{"Content-Type":"application/json",...k?{"Idempotency-Key":k}:{}},body:JSON.stringify({content:i,...C?{executionConfigVersion:o}:{}}),signal:A.signal},y,0),D=YR(I,y.runtimeId??"",y.region??"");if(D&&(b==null||b(D)),!I.ok){A.cleanup();const L=await Ft(I,Q("client.runSessionFailed"));throw new Error(Jo(Q("client.runSseFailedWithDetail",{status:I.status,detail:L})))}const _=await I.json();R=await gt(`/api/v1/sessions/${encodeURIComponent(n)}/sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invocationId:_.invocationId,...S?{lastEventId:S}:{}}),signal:A.signal},y,0)}else R=await gt("/run_sse",{method:"POST",headers:{"Content-Type":"application/json",...k?{"Idempotency-Key":k}:{}},body:JSON.stringify({app_name:v,user_id:t,session_id:n,new_message:{role:"user",parts:O},streaming:!0,...S?{lastEventId:S}:{},...C?{executionConfigVersion:o}:{},...r!=null&&r.trim()?{model_id:r.trim()}:{},...d!==void 0?{platform_tools:[...d]}:{},...f!==void 0?{environment_mounts:[...f]}:h?{environment_mount:h}:{},custom_metadata:j}),signal:A.signal},y,0)}catch(I){throw A.cleanup(),A.timedOut()?new Error(Gg()):g!=null&&g.aborted||(I==null?void 0:I.name)==="AbortError"?I:new Error(Jo(I))}const N=YR(R,y.runtimeId??"",y.region??"");if(N&&(b==null||b(N)),!R.ok){A.cleanup();const I=await Ft(R,Q("client.runSessionFailed"));throw new Error(Jo(Q("client.runSseFailedWithDetail",{status:R.status,detail:I})))}let P=!1;try{for await(const I of MA(R)){if(I&&typeof I=="object"&&I[iC]==="done"){A.clearDeadline();break}P=!0,A.clearDeadline();const D={...I};delete D[iC],typeof D.error=="string"&&(D.error=Jo(D.error)),typeof D.errorMessage=="string"&&(D.errorMessage=Jo(D.errorMessage)),typeof D.error_message=="string"&&(D.error_message=Jo(D.error_message)),yield D}}catch(I){throw A.timedOut()?new Error(Gg()):g!=null&&g.aborted||(I==null?void 0:I.name)==="AbortError"?I:new Error(Jo(I))}finally{A.cleanup()}if(!P)throw new Error(Az())}class nw extends Error{constructor(n,{status:i,code:r,currentState:s}){super(n);Zt(this,"status");Zt(this,"code");Zt(this,"currentState");this.name="MpaExecutionConfigRequestError",this.status=i,this.code=r,this.currentState=s}}async function _z(e){const t=Q("client.mpaExecutionConfigFailed"),n=await e.text().catch(()=>"");if(!n)return new nw(Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),{status:e.status,code:""});try{const i=JSON.parse(n),r=i.error&&typeof i.error=="object"?i.error:i.detail&&typeof i.detail=="object"?i.detail:null,s=KAe(i.detail??i.error),o=s?Q("client.errorWithDetailAndRawResponse",{context:Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),detail:s,response:n}):Q("client.errorWithRawResponse",{context:Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),response:n});return new nw(o,{status:e.status,code:String((r==null?void 0:r.code)??""),currentState:(r==null?void 0:r.currentState)??i.currentState})}catch{return new nw(Q("client.errorWithRawResponse",{context:Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),response:n}),{status:e.status,code:""})}}function FA(e){var r,s,o;const t=(e.selectedSkills??[]).map(l=>({source:l.source,folder:l.folder,name:l.name,skillSpaceId:l.skillSpaceId,skillSpaceName:l.skillSpaceName,skillSpaceRegion:l.skillSpaceRegion,skillId:l.skillId,version:l.version})),n=(e.skills??[]).map(l=>({name:l})),i=(e.mcpTools??[]).map(l=>({name:l.name,transport:l.transport,url:l.url}));return{name:((r=e.name)==null?void 0:r.trim())||"mpa-agent",description:e.description??"",system:((s=e.instruction)==null?void 0:s.trim())||"You are a helpful assistant.",model:{id:e.modelName||e.model||"",source:e.modelSource??"ark",provider:e.modelProvider??"",apiBase:e.modelApiBase??""},tools:[...(e.builtinTools??[]).map(l=>({id:l,source:"builtin"})),...(e.tools??[]).map(l=>({name:l,source:"legacy"})),...(e.customTools??[]).map(l=>({name:l.name,description:l.description,source:"custom"}))],skills:[...t,...n],mcpServers:i,...(o=e.subAgents)!=null&&o.length?{multiagent:{type:e.agentType??"llm",subAgents:e.subAgents.map(FA)}}:{},metadata:{"veadk:agent-type":"mpa","veadk:source":"studio-agent-draft",agentType:e.agentType??"llm"}}}async function jz(e){const t={operationKind:e.operationKind,runtimeId:e.runtimeId,region:e.region,mpaInstanceId:e.mpaInstanceId,sourceProfileId:e.sourceProfileId,targetKey:e.targetKey,runtimeRevision:e.runtimeRevision,profile:FA(e.draft)},n=e.operationKind==="update"?`/web/mpa/agents/${encodeURIComponent(e.mpaInstanceId)}`:"/web/mpa/agents",i=await gt(n,{method:e.operationKind==="update"?"PATCH":"POST",headers:{"Content-Type":"application/json","Idempotency-Key":e.idempotencyKey},body:JSON.stringify(t)});if(!i.ok)throw new Error(await Ft(i,Q("client.mpaOperationFailed")));return await i.json()}async function eI(e){var r,s,o,l;const t=e.runtimeId.trim(),n=((r=e.mpaInstanceId)==null?void 0:r.trim())||t,i=(s=e.sourceDraftId)!=null&&s.trim()?`studio-draft:${e.sourceDraftId.trim()}`:`studio-agent:${e.agentName}:${e.taskId}`;return jz({operationKind:e.operationKind,runtimeId:t,region:e.region,mpaInstanceId:n,sourceProfileId:i,draft:e.draft,targetKey:e.operationKind==="update"?n:`runtime:${e.region}:${((o=e.runtimeName)==null?void 0:o.trim())||n}`,runtimeRevision:((l=e.runtimeRevision)==null?void 0:l.trim())||void 0,idempotencyKey:`${e.taskId}:mpa-profile`})}async function OTe(){const e=await gt("/web/mpa/agent-operations?status=active",{cache:"no-store"});if(!e.ok)throw new Error(await Ft(e,Q("client.mpaOperationLoadFailed")));return(await e.json()).operations??[]}async function kTe(e,t){const n=await gt(`/web/mpa/agent-operations/${encodeURIComponent(e)}`,{cache:"no-store",signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.mpaOperationLoadFailed")));return await n.json()}async function STe(e){const t=new URLSearchParams({runtimeId:e.runtimeId,region:e.region}),n=await gt(`/web/mpa/agents/${encodeURIComponent(e.mpaInstanceId)}/profile-status?${t.toString()}`,{cache:"no-store",signal:e.signal});if(!n.ok)throw new Error(await Ft(n,Q("client.mpaOperationLoadFailed")));const i=await n.json();return{operationId:String(i.operationId??""),status:String(i.status??""),profileRevision:Number(i.profileRevision??0),runtimeRevision:String(i.runtimeRevision??""),etag:String(i.etag??n.headers.get("ETag")??"")}}async function ETe(e){const t=new URLSearchParams({region:e.region??"all"});e.runtimeId&&t.set("runtimeId",e.runtimeId);const n=await gt(`/web/mpa/agents/${encodeURIComponent(e.mpaInstanceId)}/view?${t.toString()}`,{cache:"no-store",signal:e.signal});if(!n.ok)throw new Error(await Ft(n,Q("client.mpaOperationLoadFailed")));return await n.json()}async function CTe(e){const t=new URLSearchParams({runtimeId:e.runtimeId,region:e.region}),n=await gt(`/web/mpa/agents/${encodeURIComponent(e.mpaInstanceId)}/delete-preview?${t.toString()}`,{cache:"no-store",signal:e.signal});if(!n.ok)throw new Error(await Ft(n,Q("client.mpaDeletePreviewFailed")));return await n.json()}async function ATe(e){const t={runtimeId:e.runtimeId,region:e.region},n=await gt(`/api/v1/runtime-console/admin/sessions/${encodeURIComponent(e.sessionId)}/runs`,{cache:"no-store",signal:e.signal},t);if(!n.ok)throw new Error(await Ft(n,Q("client.loadMpaDiagnosticsFailed")));return await n.json()}async function TTe(e){const t={runtimeId:e.runtimeId,region:e.region},n=new URLSearchParams({sessionId:e.sessionId}),i=await gt(`/api/v1/runtime-console/admin/runs/${encodeURIComponent(e.invocationId)}/trace?${n.toString()}`,{cache:"no-store",signal:e.signal},t);if(!i.ok)throw new Error(await Ft(i,Q("client.loadMpaDiagnosticsFailed")));return await i.json()}async function Nz(e,t){const n=await gt(`/web/mpa/agent-operations/${encodeURIComponent(e)}/retry`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operationKind:t.operationKind,runtimeId:t.runtimeId,region:t.region,mpaInstanceId:t.mpaInstanceId,sourceProfileId:t.sourceProfileId,targetKey:t.targetKey,runtimeRevision:t.runtimeRevision,profile:FA(t.draft)})});if(!n.ok)throw new Error(await Ft(n,Q("client.mpaOperationFailed")));return await n.json()}async function Rz(e){const t=new URLSearchParams({runtimeId:e.runtimeId,region:e.region}),n=await gt(`/web/mpa/sessions/${encodeURIComponent(e.sessionId)}/execution-config?${t.toString()}`,{cache:"no-store",signal:e.signal});if(!n.ok)throw await _z(n);return await n.json()}async function B8(e){const t=await gt(`/web/mpa/sessions/${encodeURIComponent(e.sessionId)}/execution-config`,{method:"PATCH",headers:{"Content-Type":"application/json","If-Match":e.etag},body:JSON.stringify({runtimeId:e.runtimeId,region:e.region,changes:e.changes})});if(!t.ok)throw await _z(t);return await t.json()}async function _Te(e){const t=await gt(`/web/mpa/sessions/${encodeURIComponent(e.sessionId)}/profile-upgrade`,{method:"POST",headers:{"Content-Type":"application/json","If-Match":e.etag,"Idempotency-Key":e.idempotencyKey},body:JSON.stringify({runtimeId:e.runtimeId,region:e.region,targetProfileRevision:e.targetProfileRevision})});if(!t.ok)throw await _z(t);return await t.json()}async function ND(e,t){const n=new URLSearchParams({name:e,region:t}),i=await gt(`/web/runtime-name-availability?${n.toString()}`,{cache:"no-store"});if(!i.ok)throw new Error(await Ft(i,Q("client.checkRuntimeNameFailed")));const r=await i.json();if(typeof r.available!="boolean")throw new Error(Q("client.invalidRuntimeNameCheck"));return{available:r.available}}async function jTe(e,t){const n=new URLSearchParams({kind:e.kind,region:e.region});e.registry&&n.set("registry",e.registry),e.namespace&&n.set("namespace",e.namespace),e.workspaceId&&n.set("workspaceId",e.workspaceId),e.search&&n.set("search",e.search),e.pageNumber&&n.set("pageNumber",String(e.pageNumber)),e.pageSize&&n.set("pageSize",String(e.pageSize));const i=await gt(`/web/deployment-resources?${n.toString()}`,{signal:t});if(!i.ok)throw new Error(await Ft(i,Q("client.loadCloudResourcesFailed")));const r=await i.json();if(typeof r.serviceRegion!="string"||!Array.isArray(r.items)||typeof r.pageNumber!="number"||typeof r.pageSize!="number"||typeof r.totalCount!="number"||typeof r.hasMore!="boolean")throw new Error(Q("client.invalidCloudResources"));const s=r.items.map(o=>{if(!o||typeof o!="object"||typeof o.id!="string"||typeof o.name!="string"||typeof o.region!="string"||typeof o.status!="string")throw new Error(Q("client.invalidCloudResources"));return o});return{serviceRegion:r.serviceRegion,items:s,pageNumber:r.pageNumber,pageSize:r.pageSize,totalCount:r.totalCount,hasMore:r.hasMore}}function NTe(e,t){const n=e;if(!n||typeof n!="object"||!Array.isArray(n.mounts))throw new Error(Q("client.invalidEnvironmentMount"));if(n.mounts.length!==t.length)throw new Error(Q("client.environmentMountMismatch"));return n.mounts.map((i,r)=>{const s=t[r];if(!i||typeof i!="object"||typeof i.environment_id!="string"||typeof i.environment_version_id!="string"||typeof i.mount_instance_id!="string"||typeof i.sandbox_session_id!="string"||!i.environment_id||!i.environment_version_id||!i.mount_instance_id||!i.sandbox_session_id)throw new Error(Q("client.invalidEnvironmentMount"));if(i.environment_id!==s.environment_id||i.environment_version_id!==s.environment_version_id||s.mount_instance_id!==void 0&&i.mount_instance_id!==s.mount_instance_id)throw new Error(Q("client.environmentMountMismatch"));return i})}async function RTe({runtimeId:e,appName:t,userId:n,sessionId:i,environmentMounts:r}){const{app:s}=Na(t);let o;try{o=await gt("/web/v3/session-environment-mounts/prepare",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtime_id:e,app_name:s,user_id:n,session_id:i,environment_mounts:[...r]})})}catch(l){throw l instanceof TypeError?new Error(Q("client.environmentMountNetworkFailed")):l}if(!o.ok)throw new Error(await Ft(o,Q("client.environmentMountFailed")));return NTe(await o.json(),r)}function Iz(e){const t=new Set,n=[];for(const i of e.split(/[,,\n\r]+/)){const r=i.trim();!r||t.has(r)||(t.add(r),n.push(r))}return n}async function ITe(e,t=typeof navigator>"u"?void 0:navigator.clipboard){if(!(t!=null&&t.writeText))throw new Error(Q("client.clipboardUnsupported"));try{await t.writeText(e)}catch{throw new Error(Q("client.clipboardWriteFailed"))}}const XZ={codex:0,codex_snapshot:1,deepseek_harness:2,deepseek_harness_snapshot:3,openclaw:4,openclaw_snapshot:5,hermes:6,hermes_snapshot:7,dev:8};async function PTe(e){var r;const t=await gt("/web/system-info",{signal:e});if(!t.ok)throw new Error(await Ft(t,Q("client.loadSystemInfoFailed")));const n=await t.json();if(typeof((r=n.storage)==null?void 0:r.tosAddress)!="string"||!Array.isArray(n.sandboxTools))throw new Error(Q("client.invalidSystemInfo"));const i=n.sandboxTools.map(s=>{if(!s||typeof s!="object"||typeof s.kind!="string"||typeof s.label!="string"||typeof s.toolId!="string"||typeof s.snapshot!="boolean"||typeof s.needsModelEnvUpdate!="boolean"||typeof s.canUpdateModelEnv!="boolean"||typeof s.modelEnvError!="string"||typeof s.modelEnvErrorCode!="string")throw new Error(Q("client.invalidSystemInfo"));return s}).sort((s,o)=>(XZ[s.kind]??Number.MAX_SAFE_INTEGER)-(XZ[o.kind]??Number.MAX_SAFE_INTEGER));return{storage:{tosAddress:n.storage.tosAddress},sandboxTools:i}}const DTe=new Set(["preparing","queued","building","scanning","available","failed"]);function Pz(e){if(e===null)return null;if(!e||typeof e!="object")throw new Error(Q("client.invalidEnvironmentBuild"));const t=e;if(typeof t.versionId!="string"||!DTe.has(t.status)||typeof t.image!="string"||typeof t.error!="string"||typeof t.createdAt!="string"||typeof t.updatedAt!="string"||t.resources!==null&&typeof t.resources!="object")throw new Error(Q("client.invalidEnvironmentBuild"));const n=Array.isArray(t.steps)?t.steps.map(i=>{if(!i||typeof i!="object"||typeof i.key!="string"||typeof i.label!="string"||!["pending","running","succeeded","failed"].includes(i.status)||i.startedAt!==null&&typeof i.startedAt!="string"||i.finishedAt!==null&&typeof i.finishedAt!="string")throw new Error(Q("client.invalidEnvironmentBuildStep"));return i}):[];return{...t,toolId:typeof t.toolId=="string"?t.toolId:"",toolStatus:["creating","ready","failed"].includes(t.toolStatus)?t.toolStatus:"",runId:typeof t.runId=="string"?t.runId:"",currentStep:typeof t.currentStep=="string"?t.currentStep:"",sourceCommitSha:typeof t.sourceCommitSha=="string"?t.sourceCommitSha:"",steps:n,progressError:typeof t.progressError=="string"?t.progressError:"",logTail:typeof t.logTail=="string"?t.logTail:"",logTruncated:t.logTruncated===!0,logUpdatedAt:typeof t.logUpdatedAt=="string"?t.logUpdatedAt:null,logError:typeof t.logError=="string"?t.logError:""}}function MTe(e){if(!e||typeof e!="object")throw new Error(Q("client.invalidEnvironmentManifest"));const t=e;if(!["agentkit.studio/v3","agentkit.studio/v1alpha1"].includes(t.apiVersion)||t.kind!=="Environment"||!t.metadata||typeof t.metadata.id!="string"||typeof t.metadata.name!="string"||typeof t.metadata.version!="string"||typeof t.metadata.description!="string"||!t.spec||typeof t.spec.image!="string"||!["ubuntu","aio-sandbox","codex-sandbox"].includes(t.spec.baseEnvironment)||typeof t.spec.baseImage!="string"||!["ubuntu-22.04","ubuntu-24.04"].includes(t.spec.operatingSystem)||!["python-3.10","python-3.12"].includes(t.spec.language)||t.spec.executionRuntime!=="veadk"||!Array.isArray(t.spec.packages)||!t.spec.packages.every(n=>typeof n=="string")||!Array.isArray(t.spec.capabilities)||!t.spec.capabilities.every(n=>typeof n=="string")||!Array.isArray(t.spec.skills)||!t.status||!DTe.has(t.status.phase)||typeof t.status.createdAt!="string"||typeof t.status.updatedAt!="string")throw new Error(Q("client.invalidEnvironmentManifest"));return t}function LTe(e){if(e==null)return;if(!e||typeof e!="object")throw new Error(Q("client.invalidImageRepository"));const t=e;if(typeof t.region!="string"||typeof t.registry!="string"||typeof t.namespace!="string"||typeof t.repository!="string")throw new Error(Q("client.invalidImageRepository"));return t}function Stt(e){if(e==null)return;if(!e||typeof e!="object")throw new Error(Q("client.invalidCodeRepository"));const t=e;if(typeof t.repositoryUrl!="string"||t.ref!==void 0&&typeof t.ref!="string"||typeof t.dockerfilePath!="string")throw new Error(Q("client.invalidCodeRepository"));return t}function Ett(e){const t=LTe(e);if(!t)return;const n=e;if(typeof n.reference!="string")throw new Error(Q("client.invalidImageSource"));return{...t,reference:n.reference}}function Dz(e){if(!e||typeof e!="object")throw new Error(Q("client.invalidEnvironment"));const t=e;if(typeof t.id!="string"||typeof t.name!="string"||typeof t.description!="string"||t.baseEnvironment!==void 0&&t.baseEnvironment!=="ubuntu"&&t.baseEnvironment!=="aio-sandbox"&&t.baseEnvironment!=="codex-sandbox"||t.operatingSystem!=="ubuntu-22.04"&&t.operatingSystem!=="ubuntu-24.04"||t.language!=="python-3.10"&&t.language!=="python-3.12"||!Array.isArray(t.optionIds)||!t.optionIds.every(n=>typeof n=="string")||t.selectedSkills!==void 0&&!Array.isArray(t.selectedSkills)||typeof t.dockerfile!="string"||typeof t.createdAt!="string"||typeof t.updatedAt!="string")throw new Error(Q("client.invalidEnvironment"));return{...t,baseEnvironment:t.baseEnvironment==="aio-sandbox"?"aio-sandbox":t.baseEnvironment==="codex-sandbox"?"codex-sandbox":"ubuntu",selectedSkills:t.selectedSkills??[],gitSource:Stt(t.gitSource),containerRepository:LTe(t.containerRepository),imageSource:Ett(t.imageSource),latestVersion:Pz(t.latestVersion)}}function $Te(e){if(!e||typeof e!="object")throw new Error(Q("client.invalidWorkspace"));const t=e;if(typeof t.id!="string"||typeof t.name!="string"||typeof t.description!="string"||!Array.isArray(t.environmentIds)||!t.environmentIds.every(n=>typeof n=="string")||typeof t.createdAt!="string"||typeof t.updatedAt!="string")throw new Error(Q("client.invalidWorkspace"));return t}async function Mz(e){const t=await gt("/web/workspaces",{signal:e});if(!t.ok)throw new Error(await Ft(t,Q("client.loadWorkspacesFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(Q("client.invalidWorkspaceList"));return n.items.map($Te)}async function FTe(e,t,n,i){const r=await gt(e,{method:t,headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:i});if(!r.ok)throw new Error(await Ft(r,Q("client.saveWorkspaceFailed")));return $Te(await r.json())}function BTe(e,t){return FTe("/web/workspaces","POST",e,t)}function UTe(e,t,n){return FTe(`/web/workspaces/${encodeURIComponent(e)}`,"PATCH",t,n)}async function QTe(e,t){const n=await gt(`/web/workspaces/${encodeURIComponent(e)}`,{method:"DELETE",signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.deleteWorkspaceFailed")))}async function BA(e){const t=await gt("/web/v3/environments",{signal:e});if(!t.ok)throw new Error(await Ft(t,Q("client.loadEnvironmentsFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(Q("client.invalidEnvironmentList"));return n.items.map(Dz)}async function zTe(e,t){const n=await gt("/web/v3/environment-repositories/inspect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.probeRepositoryFailed")));const i=await n.json();if(typeof i.repositoryUrl!="string"||typeof i.ref!="string"||typeof i.commitSha!="string"||!Array.isArray(i.dockerfiles)||!i.dockerfiles.every(r=>typeof r=="string"))throw new Error(Q("client.invalidRepositoryProbe"));return i}async function VTe(e,t){const n=await gt(`/web/v3/environments/${encodeURIComponent(e)}/share-code`,{method:"POST",signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.exportEnvironmentCodeFailed")));const i=await n.json();if(typeof i.shareCode!="string"||typeof i.name!="string")throw new Error(Q("client.invalidEnvironmentCode"));return i}async function HTe(e,t){const n=await gt("/web/v3/environment-share-codes/inspect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({shareCodes:e}),signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.inspectEnvironmentCodeFailed")));const i=await n.json();if(!Array.isArray(i.items))throw new Error(Q("client.invalidEnvironmentCodeInspection"));return i.items.map(r=>{if(!r||typeof r!="object")throw new Error(Q("client.invalidEnvironmentCodeInspection"));const s=r,o=s.status==="valid"||s.valid===!0?"valid":s.status==="invalid"||s.valid===!1?"invalid":null;if(!Number.isInteger(s.index)||o===null||s.name!==void 0&&typeof s.name!="string"||s.error!==void 0&&typeof s.error!="string")throw new Error(Q("client.invalidEnvironmentCodeInspection"));return{index:s.index,status:o,name:s.name??"",error:s.error??""}})}async function qTe(e,t){const n=await gt("/web/v3/environment-share-codes/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({shareCodes:e}),signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.importEnvironmentCodeFailed")));const i=await n.json();if(!Array.isArray(i.items))throw new Error(Q("client.invalidEnvironmentCodeImport"));return i.items.map(r=>{if(!r||typeof r!="object")throw new Error(Q("client.invalidEnvironmentCodeImport"));const s=r;if(!Number.isInteger(s.index)||!(s.status==="created"||s.status==="duplicate"||s.status==="failed")||s.name!==void 0&&typeof s.name!="string"||s.error!==void 0&&typeof s.error!="string")throw new Error(Q("client.invalidEnvironmentCodeImport"));return{index:s.index,status:s.status,name:s.name??"",environment:s.environment===void 0||s.environment===null?void 0:Dz(s.environment),error:s.error??""}})}async function WTe(e,t,n,i){let r;try{r=await gt(e,{method:t,headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:i})}catch(s){throw s instanceof DOMException&&s.name==="AbortError"?s:s instanceof TypeError?new Error(Q("client.studioUnavailable")):s}if(!r.ok)throw new Error(await Ft(r,Q("client.saveEnvironmentFailed")));return Dz(await r.json())}function KTe(e,t){return WTe("/web/v3/environments","POST",e,t)}function GTe(e,t,n){return WTe(`/web/v3/environments/${encodeURIComponent(e)}`,"PATCH",t,n)}async function XTe(e,t){const n=await gt(`/web/v3/environments/${encodeURIComponent(e)}`,{method:"DELETE",signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.deleteEnvironmentFailed")))}async function U8(e,t){const n=await gt(`/web/v3/environments/${encodeURIComponent(e)}/build`,{method:"POST",signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.startEnvironmentBuildFailed")));const i=Pz(await n.json());if(!i)throw new Error(Q("client.invalidEnvironmentBuild"));return i}async function YTe(e,t,n={}){const i=n.includeLogs?"?includeLogs=true":"",r=await gt(`/web/v3/environments/${encodeURIComponent(e)}/builds/${encodeURIComponent(t)}${i}`,{signal:n.signal});if(!r.ok)throw new Error(await Ft(r,Q("client.loadEnvironmentBuildFailed")));const s=Pz(await r.json());if(!s)throw new Error(Q("client.invalidEnvironmentBuild"));return s}async function ZTe(e,t,n){const i=await gt(`/web/v3/environments/${encodeURIComponent(e)}/builds/${encodeURIComponent(t)}/manifest`,{signal:n});if(!i.ok)throw new Error(await Ft(i,Q("client.loadEnvironmentManifestFailed")));return MTe(await i.json())}function YZ(e){if(!e||typeof e!="object")throw new Error(Q("client.invalidEnvironmentResource"));const t=e;if(t.source!=="provided"&&t.source!=="managed"||typeof t.consoleUrl!="string")throw new Error(Q("client.invalidEnvironmentResource"));return t}async function JTe(e){const t=await gt("/web/v3/environment-resources",{signal:e});if(!t.ok)throw new Error(await Ft(t,Q("client.loadEnvironmentResourcesFailed")));const n=await t.json();if(n.provider!=="volcengine"&&n.provider!=="byteplus"||typeof n.region!="string")throw new Error(Q("client.invalidEnvironmentResource"));return{provider:n.provider,region:n.region,codePipeline:YZ(n.codePipeline),containerRegistry:YZ(n.containerRegistry)}}async function Ctt(e,t){const n=await gt(`/web/system-info/sandbox-tools/${encodeURIComponent(e)}/model-env`,{method:"POST",signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.updateCodexSandboxFailed")));const i=await n.json();if(i.kind!=="codex"&&i.kind!=="codex_snapshot"||typeof i.toolId!="string"||typeof i.updated!="boolean")throw new Error(Q("client.invalidCodexSandboxUpdate"));return i}async function RD(e){const t=await gt("/web/identity/user-pools",{signal:e});if(!t.ok)throw new Error(await Ft(t,Q("client.loadUserPoolsFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(Q("client.invalidUserPoolList"));return n.items.map(i=>{if(!i||typeof i!="object"||typeof i.uid!="string"||typeof i.name!="string"||typeof i.domain!="string"||typeof i.region!="string"||typeof i.isCurrent!="boolean")throw new Error(Q("client.invalidUserPoolList"));return i})}class ZZ extends Error{constructor(t,n){super(n),this.status=t,this.name="DeploymentRecoveryHttpError"}}const ZS=new Map;function Att(e){if(typeof e=="string")return e?{message:e}:null;if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e,n=typeof t.message=="string"?t.message:typeof t.error=="string"?t.error:"";return n?{message:n,phase:typeof t.phase=="string"?t.phase:void 0,runtimeId:typeof t.runtimeId=="string"?t.runtimeId:void 0,logPath:typeof t.logPath=="string"?t.logPath:void 0}:null}class JS extends Error{constructor(t){super(t.message),this.detail=t,this.name="GithubCicdPipelineError"}}async function um(e){const t=await e.text().catch(()=>"");if(t)try{const n=JSON.parse(t),i=Att(n.detail??n.error);if(i)return new JS(i)}catch{return new JS({message:t})}return new JS({message:Q("client.syncGithubFailed",{status:e.status})})}async function e2e(e){const t=await gt("/web/github-delivery/source-sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:e.project,githubUrl:e.githubUrl,githubToken:e.githubToken,baseBranch:e.baseBranch,region:e.region,cloudProvider:e.cloudProvider})},{},0);if(!t.ok)throw await um(t);return t.json()}async function t2e(e){const t=await gt("/web/github-delivery/cicd-pipeline",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({githubUrl:e.githubUrl,githubToken:e.githubToken,baseBranch:e.baseBranch,runtimeName:e.runtimeName,runtimeId:e.runtimeId,region:e.region,agentCategory:e.agentCategory,mpaCompatibilityManifest:e.mpaCompatibilityManifest,cloudProvider:e.cloudProvider,projectPath:e.projectPath??".",volcengineAccessKey:e.volcengineAccessKey,volcengineSecretKey:e.volcengineSecretKey,volcengineSessionToken:e.volcengineSessionToken??""})},{},0);if(!t.ok)throw await um(t);return t.json()}async function n2e(e){const t=await gt("/web/github-delivery/init-main",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:e.project,githubUrl:e.githubUrl,githubToken:e.githubToken,baseBranch:e.baseBranch,runtimeName:e.runtimeName,runtimeId:e.runtimeId,region:e.region,agentCategory:e.agentCategory,mpaCompatibilityManifest:e.mpaCompatibilityManifest,cloudProvider:e.cloudProvider,projectPath:e.projectPath??".",volcengineAccessKey:e.volcengineAccessKey,volcengineSecretKey:e.volcengineSecretKey,volcengineSessionToken:e.volcengineSessionToken??""})},{},0);if(!t.ok)throw await um(t);return t.json()}async function Ttt(e){const t=await gt("/web/github-delivery/source-sync/cicd",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pipelineId:e.pipelineId,runtimeName:e.runtimeName,runtimeId:e.runtimeId,region:e.region,agentCategory:e.agentCategory,mpaCompatibilityManifest:e.mpaCompatibilityManifest,cloudProvider:e.cloudProvider,projectPath:e.projectPath??".",volcengineAccessKey:e.volcengineAccessKey,volcengineSecretKey:e.volcengineSecretKey,volcengineSessionToken:e.volcengineSessionToken??""})},{},0);if(!t.ok)throw await um(t);return t.json()}async function i2e(e){const t=await gt(`/web/github-cicd/runtime-binding?runtimeId=${encodeURIComponent(e)}`);if(!t.ok)throw await um(t);const n=await t.json();return n.pipelineId?n:null}async function dN(e){const t=await gt(`/web/github-delivery/versions?runtimeId=${encodeURIComponent(e)}`);if(!t.ok)throw await um(t);return t.json()}async function r2e(e){const t=await gt("/web/github-delivery/rollback-pr",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await um(t);return t.json()}async function Lz(e){const t=await gt("/web/github-cicd/runtime-binding",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await um(t);return t.json()}async function s2e(e){const t=await gt("/web/github-cicd/runtime-sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e.runtimeId,project:e.project,agentCategory:e.agentCategory,mpaCompatibilityManifest:e.mpaCompatibilityManifest})},{},0);if(!t.ok)throw await um(t);return t.json()}async function U0(e,t,n,i){var h,m,g,b,v,y;const r=i==null?void 0:i.taskId,s=r?new AbortController:void 0;r&&s&&ZS.set(r,s);const o=()=>{r&&ZS.get(r)===s&&ZS.delete(r)},l=async w=>{if(VAe(w))throw w;if(!r||!(i!=null&&i.runtimeId)||typeof i.baseRuntimeVersion!="number")throw new oN({taskId:r,cause:w});const x=await Qet({signal:s==null?void 0:s.signal,shouldRetry:O=>!(O instanceof ZZ)||O.status===404||O.status===408||O.status===429||O.status>=500,load:async O=>{const k=await gt("/web/deploy-agentkit/status",{method:"POST",headers:{"Content-Type":"application/json"},signal:O,body:JSON.stringify({taskId:r,runtimeId:i.runtimeId,runtimeName:i.runtimeName,appName:i.appName??e,region:n.region,projectName:n.projectName,baseRuntimeVersion:i.baseRuntimeVersion})},{},3e4);if(!k.ok)throw new ZZ(k.status,await Ft(k,Q("client.deploymentFailed")));return k.json()}});if(!x)throw new oN({taskId:r,cause:w});return x};let c=null,u=null;try{const w=!!(i!=null&&i.migrationTaskId);(h=i==null?void 0:i.onStage)==null||h.call(i,{level:"info",phase:"upload",message:Q(w?"client.validatingMigrationArtifact":"client.uploadingCodePackage"),pct:0}),c=await gt("/web/deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},signal:s==null?void 0:s.signal,body:JSON.stringify({name:e,files:w?[]:t,config:n,taskId:r,migrationTaskId:i==null?void 0:i.migrationTaskId,runtimeId:i==null?void 0:i.runtimeId,runtimeName:i==null?void 0:i.runtimeName,appName:i==null?void 0:i.appName,agentCategory:i==null?void 0:i.agentCategory,mpaCompatibilityManifest:i==null?void 0:i.mpaCompatibilityManifest,editMode:i==null?void 0:i.editMode,draft:i==null?void 0:i.draft,updateEtag:i==null?void 0:i.updateEtag,baseRuntimeVersion:i==null?void 0:i.baseRuntimeVersion,removeRuntimeEnvKeys:i==null?void 0:i.removeRuntimeEnvKeys,mcpSecretValues:i==null?void 0:i.mcpSecretValues,mcpCredentialReuses:i==null?void 0:i.mcpCredentialReuses,sessionStorage:i==null?void 0:i.sessionStorage,minInstance:i==null?void 0:i.minInstance,maxInstance:i==null?void 0:i.maxInstance,createEvaluationSets:i==null?void 0:i.createEvaluationSets,description:Bet((i==null?void 0:i.description)??""),authentication:i==null?void 0:i.authentication,im:i==null?void 0:i.im,envs:i==null?void 0:i.envs,resources:i==null?void 0:i.resources,source:(i==null?void 0:i.source)??(i!=null&&i.migrationTaskId?{kind:"migration",migrationId:i.migrationTaskId}:{kind:"inlineFiles"}),harnessSidecar:i==null?void 0:i.harnessSidecar,environment:i==null?void 0:i.environment})},{},0),(m=i==null?void 0:i.onStage)==null||m.call(i,{level:"success",phase:"upload",message:Q(w?"client.migrationArtifactValidated":"client.codePackageUploaded"),pct:100})}catch(w){try{u=await l(w)}finally{o()}}if(c&&!c.ok){const w=await Ft(c,Q("client.deploymentFailed"));throw o(),new Error(w)}if(c)try{for await(const w of MA(c)){const x=w;if(x&&x.done){u=x;break}x&&x.message&&((g=i==null?void 0:i.onStage)==null||g.call(i,x))}}catch(w){try{u=await l(w)}finally{o()}}if(u)o();else try{u=await l()}finally{o()}if(!u.success){const w=new Error(u.error||Q("client.deploymentFailed"));throw zAe(w)?new oN({taskId:r,cause:w}):w}if(!u.agentName)throw new Error(Q("client.deploymentMissingAgentName"));if(!u.runtimeId&&!u.url)throw new Error(Q("client.deploymentMissingConnection"));const d=(b=u.runtimeName)!=null&&b.trim()?u.agentName:e,f=((v=u.runtimeName)==null?void 0:v.trim())||u.agentName;return{apikey:u.apikey??"",url:u.url??"",agentName:d,runtimeName:f,runtimeId:u.runtimeId,mpaInstanceId:((y=u.mpaInstanceId)==null?void 0:y.trim())||void 0,consoleUrl:u.consoleUrl,region:u.region,version:u.version,warnings:u.warnings,feishuChannel:u.feishuChannel}}async function a2e(e){var n;const t=await gt("/web/cancel-deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e})});if(!t.ok){const i=await t.text().catch(()=>"");throw new Error(i||Q("client.cancelDeploymentFailed",{status:t.status}))}(n=ZS.get(e))==null||n.abort(),ZS.delete(e)}async function _tt(e=mz){const t=await gt(`/web/my-runtimes?region=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(Q("client.loadFailed",{status:t.status}));return(await t.json()).runtimes??[]}const aC={title:"AgentKit Studio",logoUrl:""},Q8={enabled:!1},S3={studio:!1,version:"",provider:"volcengine",branding:aC,features:{newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,agentUsage:!1,addAgentkit:!0,generatedAgentTestRun:!0},defaultView:"chat",agentsSource:"local",telemetry:Q8};function jtt(e){if(!e||typeof e!="object")return Q8;const t=e;if(t.enabled!==!0||!t.studio||typeof t.studio!="object")return Q8;const n=t.studio;return{enabled:!0,studio:{deployId:typeof n.deployId=="string"?n.deployId:"",userPoolId:typeof n.userPoolId=="string"?n.userPoolId:"",applicationId:typeof n.applicationId=="string"?n.applicationId:"",functionId:typeof n.functionId=="string"?n.functionId:"",region:typeof n.region=="string"?n.region:"",project:typeof n.project=="string"?n.project:"",version:typeof n.version=="string"?n.version:"",accountId:typeof n.accountId=="string"?n.accountId:"",accountIdResolutionError:typeof n.accountIdResolutionError=="string"?n.accountIdResolutionError:""}}}async function o2e(){var e,t;try{const n=await gt("/web/ui-config");if(!n.ok)return S3;const i=await n.json(),r=typeof((e=i.branding)==null?void 0:e.logoUrl)=="string"?i.branding.logoUrl:aC.logoUrl,s=i.provider==="byteplus"?"byteplus":"volcengine";return eTe(s),{studio:i.studio??!1,version:typeof i.version=="string"?i.version:"",provider:s,branding:{title:typeof((t=i.branding)==null?void 0:t.title)=="string"?i.branding.title:aC.title,logoUrl:r?Ta(r):""},features:{...S3.features,...i.features??{}},defaultView:i.defaultView??"chat",agentsSource:i.agentsSource==="cloud"?"cloud":"local",telemetry:jtt(i.telemetry)}}catch{return S3}}const l2e={role:"user",telemetry:{userId:"",accountId:""},capabilities:{createAgents:!1,createPersonalAgents:!1,manageAgents:!1,runtimeScope:"mine",manageUsers:!1}};async function c2e(){var n,i,r,s,o,l;const e=await gt("/web/access");if(!e.ok)throw new Error(Q("client.loadPermissionsFailed",{status:e.status}));const t=await e.json();if(!["super_admin","admin","developer","user"].includes(t.role)||typeof((n=t.telemetry)==null?void 0:n.userId)!="string"||t.telemetry.accountId!==void 0&&typeof t.telemetry.accountId!="string"||typeof((i=t.capabilities)==null?void 0:i.createAgents)!="boolean"||typeof((r=t.capabilities)==null?void 0:r.createPersonalAgents)!="boolean"||typeof((s=t.capabilities)==null?void 0:s.manageAgents)!="boolean"||((o=t.capabilities)==null?void 0:o.manageUsers)!==void 0&&typeof t.capabilities.manageUsers!="boolean"||!["all","mine"].includes((l=t.capabilities)==null?void 0:l.runtimeScope))throw new Error(Q("client.invalidPermissionResponse"));return t}async function u2e(e,t){const n=new URLSearchParams;e&&n.set("targetVersion",e),t&&n.set("startedAt",String(t));const i=n.size?`?${n.toString()}`:"",r=await gt(`/web/studio-update${i}`);if(!r.ok)throw new Error(Q("client.checkStudioUpdateFailed",{status:r.status}));return await r.json()}async function d2e(){const e=await gt("/web/studio-update/permissions");if(!e.ok){let t="";try{const n=await e.json();t=typeof n.detail=="string"?n.detail:""}catch{t=""}throw new Error(t||Q("client.studioUpdatePreflightFailed",{status:e.status}))}return await e.json()}async function f2e(e){const t=await gt("/web/studio-update",{method:"POST",headers:{"Content-Type":"application/json","X-VeADK-Studio-Update":"1"},body:JSON.stringify({version:e})},{},hr);if(!t.ok){let n="";try{const i=await t.json();n=typeof i.detail=="string"?i.detail:""}catch{n=""}throw new Error(n||Q("client.submitStudioUpdateFailed",{status:t.status}))}return await t.json()}async function h2e({runtimeId:e,region:t,appName:n,page:i=1,pageSize:r=20,signal:s}){const o=new URLSearchParams({runtimeId:e,region:t,appName:n,page:String(i),pageSize:String(r)}),l=await gt(`/web/agent-usage?${o.toString()}`,{signal:s});if(!l.ok)throw new Error(await Ft(l,Q("client.loadAgentUsageFailed")));const c=l.headers.get("content-type")||Q("client.notProvided"),u=c.toLowerCase();if(!u.includes("application/json")&&!u.includes("+json"))throw new Error(Q("client.agentUsageNonJson",{status:l.status,contentType:c})+Q("client.checkStudioGateway"));try{return await l.json()}catch{throw new Error(Q("client.agentUsageInvalidJson",{status:l.status,contentType:c})+Q("client.retryCheckGateway"))}}function dm(e=""){return`/web/cronjobs${e?`/${encodeURIComponent(e)}`:""}`}async function z8(e){const t=await gt(dm(),{signal:e});if(!t.ok)throw new Error(await Ft(t,Q("client.loadCronJobsFailed")));const n=await t.json();return Array.isArray(n)?n:n.items??[]}async function Ntt(e,t){const n=await gt(dm(e),{signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.loadCronJobFailed")));return await n.json()}async function p2e(e){const t=await gt(dm(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await Ft(t,Q("client.createCronJobFailed")));return await t.json()}async function m2e(e,t){const n=await gt(`${dm(e)}/update`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw new Error(await Ft(n,Q("client.updateCronJobFailed")));return await n.json()}async function g2e(e,t){const n=t?"enable":"disable",i=await gt(`${dm(e)}/${n}`,{method:"POST"});if(!i.ok)throw new Error(await Ft(i,Q(t?"client.enableCronJobFailed":"client.pauseCronJobFailed")));return await i.json()}async function b2e(e){const t=await gt(`${dm(e)}/run`,{method:"POST"});if(!t.ok)throw new Error(await Ft(t,Q("client.runCronJobFailed")));return await t.json()}async function V8(e,t){const n=await gt(`${dm(e)}/runs`,{signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.loadCronHistoryFailed")));const i=await n.json();return Array.isArray(i)?i:i.items??[]}async function y2e(e,t){const n=await gt(`${dm(e)}/runs/${encodeURIComponent(t)}/cancel`,{method:"POST"});if(!n.ok)throw new Error(await Ft(n,Q("client.stopCronRunFailed")));return await n.json()}async function v2e(e){const t=await gt(dm(e),{method:"DELETE"});if(!t.ok)throw new Error(await Ft(t,Q("client.deleteCronJobFailed")))}class ID extends Error{constructor(t,n){super(t),this.status=n,this.name="RuntimeListError"}}async function Q0(e={}){const t=new URLSearchParams({scope:e.scope??"all",page_size:String(e.pageSize??30),region:e.region??"all"});e.agentCategory&&t.set("agentCategory",e.agentCategory),e.nextToken&&t.set("next_token",e.nextToken);const n=await gt(`/web/runtimes?${t.toString()}`,{signal:e.signal});if(!n.ok){const r=await Ft(n,Q("client.loadRuntimeFailed"));throw new ID(r,n.status)}const i=await n.json();return{runtimes:i.runtimes??[],nextToken:i.nextToken??""}}async function Ww(e,t,n={}){if(n.preferCached){const i=wz(e,t,n.currentVersion),r=tw.get(i);if(r&&r.expiresAt>Date.now())return[...r.apps];r&&tw.delete(i)}try{const i={runtimeId:e,region:t,runtimeVersion:n.currentVersion};return n.retryProbe&&(i.retryProbe=!0),await $A("","",i,n.signal,n.timeoutMs)}catch(i){if(i instanceof U1||i instanceof Oa||i instanceof Error)throw i;return null}}async function x2e(e,t){const n=new URLSearchParams({region:t}),i=await gt(`/web/runtime-tool-channel/${encodeURIComponent(e)}/capabilities?${n.toString()}`);if(!i.ok)throw new Oa(await Ft(i,Q("client.loadLocalToolsFailed")),!1,!0);return await i.json()}async function w2e(e,t){const n=new URLSearchParams({region:t}),i=await gt(`/web/runtime-route-channel/${encodeURIComponent(e)}/connect?${n.toString()}`,{method:"POST"});if(!i.ok)throw new Oa(await Ft(i,Q("client.connectDynamicRouteFailed")),!1,!0);return await i.json()}async function O2e(e,t,n={}){const i={runtimeId:e,region:t};n.retryProbe&&(i.retryProbe=!0);const r=await gt("/.well-known/agent-card.json",{},i),s=await tTe(r);if(s==="runtime_access_denied")throw new U1;if(s==="runtime_private_endpoint_unreachable")throw new Oa(YAe());if(["runtime_proxy_connect_error","runtime_proxy_timeout"].includes(s))throw new Oa(ZAe());if(r.status===404)return null;if(r.status===401||r.status===403)throw new Oa(Q("client.a2aProbeDenied"));if(!r.ok)throw new Error(await Ft(r,Q("client.loadA2aCardFailed")));const o=await r.json().catch(()=>null),l=typeof(o==null?void 0:o.url)=="string"?o.url.trim():"";return l?{name:typeof(o==null?void 0:o.name)=="string"?o.name:"",description:typeof(o==null?void 0:o.description)=="string"?o.description:"",endpoint:l}:null}async function k2e(e,t){const n=new URLSearchParams({runtimeId:e,region:t}),i=await gt(`/web/runtime-api-key/reveal?${n.toString()}`,{method:"POST",cache:"no-store"});if(!i.ok)throw new Error(await Ft(i,Q("client.loadRuntimeApiKeyFailed")));const r=await i.json();if(typeof r.apiKey!="string"||!r.apiKey)throw new Error(Q("client.runtimeApiKeyMissing"));return r.apiKey}async function S2e(e,t,n={}){const i=await gt("/web/delete-runtime",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e,region:t,agentCategory:n.agentCategory,mpaInstanceId:n.mpaInstanceId})});if(!i.ok){const r=await i.text().catch(()=>"");throw new Error(r||Q("client.deleteFailed",{status:i.status}))}}async function E2e({runtimeId:e,region:t,appName:n,etag:i,signal:r}){const s=await gt("/web/runtime-mcp-credentials",{method:"POST",cache:"no-store",signal:r,headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e,region:t,appName:n,etag:i})});if(!s.ok)throw new Error(await Ft(s,Q("client.loadMcpCredentialsFailed")));const o=await s.json().catch(()=>null);if(!Array.isArray(o==null?void 0:o.credentials))throw new Error(Q("client.invalidMcpCredentials"));return o.credentials.map(l=>{if(!l||typeof l!="object")throw new Error(Q("client.invalidMcpCredentials"));const c=l,u={agentName:c.agentName,name:c.name,url:c.url,authTokenEnv:c.authTokenEnv,value:c.value};if(Object.values(u).some(d=>typeof d!="string"))throw new Error(Q("client.invalidMcpCredentials"));return u})}function fN({runtimeId:e,region:t,appName:n,currentVersion:i}){return B0(rC,t,e,i??"",(n==null?void 0:n.trim())??"")}async function Rtt({runtimeId:e,region:t,appName:n,currentVersion:i,force:r=!1}){const s=new URLSearchParams({runtimeId:e,region:t});n&&s.set("appName",n),i!=null&&s.set("currentVersion",String(i)),r&&s.set("refresh","true");const o=await gt(`/web/runtime-update-capability?${s.toString()}`);if(!o.ok)throw new Error(await Itt(o));return await o.json()}function PD({runtimeId:e,region:t,appName:n,currentVersion:i,signal:r,force:s=!1}){var u,d;const o={runtimeId:e,region:t,appName:n,currentVersion:i},l=fN(o);if(s&&ss.delete(l),!s){const f=Sb(ss,l,Q1);if(f)return Y2(Promise.resolve(f),r);const h=(u=ss.get(l))==null?void 0:u.promise;if(h)return Y2(h,r);if(n){const m=fN({...o,appName:""}),g=(d=ss.get(m))==null?void 0:d.promise;if(g){let b;return b=g.then(v=>{var w,x,O,k,S;if(v.recoveryStatus==="preparing")return((w=ss.get(l))==null?void 0:w.promise)===b&&ss.delete(l),v;const y=((O=(x=v.agent)==null?void 0:x.appName)==null?void 0:O.trim())??"";return y&&y!==n.trim()?(((k=ss.get(l))==null?void 0:k.promise)===b&&ss.delete(l),PD(o)):(((S=ss.get(l))==null?void 0:S.promise)===b&&ss.set(l,{value:v,updatedAt:Date.now()}),v)},v=>{var y;throw((y=ss.get(l))==null?void 0:y.promise)===b&&ss.delete(l),v}),ss.set(l,{promise:b,updatedAt:0}),Y2(b,r)}}}let c;return c=Rtt({...o,force:s}).then(f=>{var h,m,g,b,v;if(f.recoveryStatus==="preparing")return((h=ss.get(l))==null?void 0:h.promise)===c&&ss.delete(l),f;if(((m=ss.get(l))==null?void 0:m.promise)===c){ss.set(l,{value:f,updatedAt:Date.now()});const y=new Set(["",((b=(g=f.agent)==null?void 0:g.appName)==null?void 0:b.trim())??""]);for(const w of y){const x=fN({...o,appName:w});x!==l&&!((v=ss.get(x))!=null&&v.promise)&&ss.set(x,{value:f,updatedAt:Date.now()})}}return f},f=>{var h;throw((h=ss.get(l))==null?void 0:h.promise)===c&&ss.delete(l),f}),ss.set(l,{promise:c,updatedAt:0}),Y2(c,r)}function H8({runtimeId:e,region:t,appName:n,currentVersion:i}){return Sb(ss,fN({runtimeId:e,region:t,appName:n,currentVersion:i}),Q1)}function q8(e){return PD(e).then(()=>{},()=>{})}function W8(e,t){if(!e){ss.clear();return}for(const n of ss.keys()){const[i,r,s]=n.split("");i===rC&&s===e&&(!t||r===t)&&ss.delete(n)}}async function Itt(e){const t=await e.json().catch(()=>null),n=typeof(t==null?void 0:t.detail)=="string"?t.detail:"";return e.status===403?Q("client.runtimeManageForbidden"):e.status===404?Q(n==="runtime_not_found"?"client.runtimeNotFound":"client.runtimeUnavailable"):Q("client.checkRuntimeUpdateFailed",{status:e.status})}async function Ptt(e,t){let n=null;for(const i of LA(t)){const r=await gt(`/web/runtime-detail?runtimeId=${encodeURIComponent(e)}®ion=${encodeURIComponent(i)}`);if(r.ok)return r.json();n=new Error(await Ft(r,Q("client.loadRuntimeDetailFailed")))}throw n??new Error(Q("client.loadRuntimeDetailFailed"))}async function DD(e,t="cn-beijing",n={}){const i=B0(e,t||"cn-beijing"),r=Sb(fy,i,Q1);if(!n.force&&r)return r;const s=fy.get(i);if(!n.force&&(s!=null&&s.promise))return s.promise;const o=Ptt(e,t).then(l=>Oz(fy,i,l));fy.set(i,{...s,promise:o,updatedAt:(s==null?void 0:s.updatedAt)??0});try{return await o}finally{const l=fy.get(i);(l==null?void 0:l.promise)===o&&fy.set(i,{value:l.value,updatedAt:l.updatedAt})}}async function Dtt(e,t,n){const i=new URLSearchParams({runtimeId:e,region:t,key:n}),r=await gt(`/web/runtime-env/copy?${i.toString()}`,{method:"POST"});if(!r.ok)throw new Error(await Ft(r,Q("client.copySecretFailed")));const s=await r.json();if(typeof s.value!="string"||!s.value)throw new Error(Q("client.copySecretFailed"));await navigator.clipboard.writeText(s.value)}function C2e(e,t="cn-beijing"){return Sb(fy,B0(e,t||"cn-beijing"),Q1)}function A2e(e,t="cn-beijing"){DD(e,t).catch(()=>{})}async function eE(e){const t=await gt("/web/generated-agent-projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await Ft(t,Q("client.generateProjectFailed")));return t.json()}const Mtt=19e4,Ltt=12e4;async function T2e(e){const t=await gt("/web/generated-agent-drafts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requirement:e})},{},Mtt);if(!t.ok)throw new Error(await Ft(t,Q("client.generateAgentConfigFailed")));return CD(t,Q("client.generateAgentConfigFailed"))}async function _2e(e,t){const n=await gt("/web/generated-agent-test-runs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e,runtimeId:t==null?void 0:t.runtimeId,runtimeRegion:t==null?void 0:t.region,mcpCredentialReuses:t==null?void 0:t.mcpCredentialReuses})},{},Ltt);if(!n.ok)throw new Error(await Ft(n,Q("client.createDebugRunFailed")));return CD(n,Q("client.createDebugRunFailed"))}async function j2e(e,t){const n=await gt(`/web/generated-agent-test-runs/${e}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:t})});if(!n.ok)throw new Error(await Ft(n,Q("client.createDebugSessionFailed")));return(await CD(n,Q("client.createDebugSessionFailed"))).id}async function N2e(e,t){const n=await gt(`/web/generated-agent-test-runs/${encodeURIComponent(e)}/trace/session/${encodeURIComponent(t)}`);if(!n.ok)throw new Error(await Ft(n,Q("client.loadDebugTraceFailed")));const i=await CD(n,Q("client.loadDebugTraceFailed"));if(!Array.isArray(i))throw new Error(Q("client.invalidDebugTrace"));return i}async function*R2e({runId:e,userId:t,sessionId:n,text:i,signal:r}){const s=i.trim()?[{text:i}]:[],o=Tz(r);let l;try{l=await gt(`/web/generated-agent-test-runs/${e}/run_sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({user_id:t,session_id:n,new_message:{role:"user",parts:s},streaming:!0}),signal:o.signal},{},0)}catch(c){throw o.cleanup(),o.timedOut()?new Error(Gg()):c}if(!l.ok)throw o.cleanup(),new Error(await Ft(l,Q("client.debugRunFailed")));try{for await(const c of MA(l))o.clearDeadline(),yield c}catch(c){throw o.timedOut()?new Error(Gg()):c}finally{o.cleanup()}}async function rx(e){const t=await gt(`/web/generated-agent-test-runs/${e}`,{method:"DELETE"});if(!t.ok&&t.status!==404)throw new Error(await Ft(t,Q("client.cleanupDebugRunFailed")))}function I2e(e){if(!e||typeof e!="object")throw new Error(Q("client.invalidSandboxVersion"));const t=e;if(typeof t.toolId!="string"||typeof t.error!="string")throw new Error(Q("client.invalidSandboxVersion"));if(!t.error&&(t.provider!=="volcengine"&&t.provider!=="byteplus"||typeof t.region!="string"||typeof t.status!="string"||typeof t.currentImage!="string"||typeof t.latestImage!="string"||typeof t.needsImageUpdate!="boolean"||typeof t.canUpdate!="boolean"||typeof t.needsModelEnvUpdate!="boolean"||typeof t.canUpdateModelEnv!="boolean"||typeof t.modelEnvError!="string"))throw new Error(Q("client.invalidSandboxVersion"));return t}async function P2e(e){const t=await gt("/web/system-info/sandbox-tools/updates",{signal:e});if(!t.ok)throw new Error(await Ft(t,Q("client.loadSandboxVersionsFailed")));const n=await t.json();if(!Array.isArray(n.tools))throw new Error(Q("client.invalidSandboxVersion"));return n.tools.map(I2e)}async function D2e(e){const t=await gt(`/web/system-info/sandbox-tools/${encodeURIComponent(e)}/update`,{method:"POST"},{},33e4);if(!t.ok)throw new Error(await Ft(t,Q("client.updateSandboxFailed")));const n=await t.json();if(typeof n.updated!="boolean")throw new Error(Q("client.invalidSandboxUpdate"));return{updated:n.updated,state:I2e(n.state)}}class tI extends Error{constructor(t){super(`Channel request failed (${t})`),this.status=t}}async function Xd(e,t,n={}){const i=await gt(`/api/v1/channels${t}`,{...n,headers:{"Content-Type":"application/json",...n.headers}},e);if(!i.ok)throw new tI(i.status);return i.json()}function K8(e,t,n,i){return ret(gt,e,t,n,i)}function M2e(e,t,n,i,r){return set(gt,e,t,n,i,r)}function L2e(e,t,n,i){return aet(gt,e,t,n,i)}const $tt=Object.freeze(Object.defineProperty({__proto__:null,ChannelApiError:tI,DEFAULT_SITE_BRANDING:aC,DEFAULT_STUDIO_ACCESS:l2e,GithubCicdPipelineError:JS,MpaExecutionConfigRequestError:nw,RuntimeAccessDeniedError:U1,RuntimeListError:ID,RuntimeProbeError:Oa,TurnControlConflictError:jD,applyMpaProfileAfterDeployment:eI,attachGithubDeliveryCicdToSourceSync:Ttt,bindGithubCicdRuntime:Lz,buildEnvironment:U8,cancelAgentkitDeployment:a2e,cancelCronJobRun:y2e,channelRequest:Xd,checkRuntimeNameAvailability:ND,clearMessageFeedbackCache:HAe,clearRemoteApps:WAe,componentSearch:xTe,continueTurn:wtt,continueTurnSSE:bTe,controlTurn:gTe,copyRuntimeEnvironmentSecret:Dtt,createCronJob:p2e,createEnvironment:KTe,createGeneratedAgentTestRun:_2e,createGeneratedAgentTestSession:j2e,createGithubCicdPipeline:e2e,createGithubDeliveryCicdPipeline:t2e,createGithubDeliveryRollbackPr:r2e,createSession:nTe,createWorkspace:BTe,deleteAgentFeedbackCases:lTe,deleteCronJob:v2e,deleteEnvironment:XTe,deleteGeneratedAgentTestRun:rx,deleteMedia:uN,deleteRuntime:S2e,deleteSession:D8,deleteSessionMedia:M8,deleteWorkspace:QTe,deployAgentkitProject:U0,downloadArtifact:Sz,ensureRuntimeRouteChannel:w2e,exportEnvironmentShareCode:VTe,fetchRemoteApps:$A,fetchSessionFile:cTe,generateAgentDraftFromRequirement:T2e,generateAgentProject:eE,getAgentFeedbackCases:_D,getAgentInfo:$8,getAgentOptimizations:rTe,getAgentUsage:h2e,getAutomaticEvaluationStatuses:P8,getCachedAgentFeedbackCases:sTe,getCachedRuntimeAgentInfo:yTe,getCachedRuntimeDetail:C2e,getCachedRuntimeUpdateCapability:H8,getCronJob:Ntt,getEnvironmentBuild:YTe,getEnvironmentManifest:ZTe,getEnvironmentResources:JTe,getGeneratedAgentTestTrace:N2e,getGithubCicdRuntimeBinding:i2e,getGithubDeliveryVersions:dN,getMediaCapabilities:vtt,getMpaAgentDeletePreview:CTe,getMpaAgentOperation:kTe,getMpaAgentView:ETe,getMpaProfileStatus:STe,getMpaRuntimeConsoleRuns:ATe,getMpaRuntimeConsoleTrace:TTe,getMpaSessionExecutionConfig:Rz,getMyRuntimes:_tt,getRuntimeAgentInfo:Cz,getRuntimeDetail:DD,getRuntimeMcpCredentials:E2e,getRuntimeStudioToolCapabilities:x2e,getRuntimeUpdateCapability:PD,getRuntimes:Q0,getSandboxImageUpdates:P2e,getSession:sC,getSessionTrace:ZR,getStudioAccess:c2e,getStudioUpdatePermissions:d2e,getStudioUpdateStatus:u2e,getSystemInfo:PTe,getTurnControl:mTe,getUiConfig:o2e,httpErrorMessage:Ft,importEnvironmentShareCodes:qTe,initializeGithubDeliveryMain:n2e,inspectEnvironmentRepository:zTe,inspectEnvironmentShareCodes:HTe,invalidateRuntimeUpdateCapabilityCache:W8,isMpaA2aRuntimeApp:np,isMpaRuntimeApp:JR,listActiveMpaAgentOperations:OTe,listApps:XAe,listCronJobRuns:V8,listCronJobs:z8,listDeploymentResources:jTe,listEnvironments:BA,listIdentityUserPools:RD,listModelApiKeys:xz,listModelOptions:B1,listMpaCronTasks:K8,listMpaRuns:L2e,listSessions:kz,listWorkspaces:Mz,mediaContentUrl:hTe,mpaProfileFromAgentDraft:FA,parseEnvironmentManifest:MTe,parseEnvironmentShareCodes:Iz,parsePreparedSessionEnvironmentMounts:NTe,patchMpaSessionExecutionConfig:B8,prefetchAgentFeedbackCases:btt,prefetchRuntimeAgentInfo:vTe,prefetchRuntimeDetail:A2e,prefetchRuntimeUpdateCapability:q8,prepareSessionEnvironmentMounts:RTe,previewArtifact:Ez,probeRuntimeA2a:O2e,probeRuntimeApps:Ww,refreshAgentFeedbackCases:aTe,registerRemoteApp:qAe,requestMpaTask:M2e,retryMpaAgentOperation:Nz,revealModelApiKey:GAe,revealRuntimeApiKey:k2e,runCronJobNow:b2e,runGeneratedAgentTestSSE:R2e,runSSE:F8,runSseEmptyResponseError:Az,runSseFirstEventTimeoutError:Gg,runSseIncompleteResponseError:cS,runtimeRegionCandidates:LA,setClientCloudProvider:eTe,setCronJobEnabled:g2e,startMpaAgentOperation:jz,startStudioUpdate:f2e,studioFetch:yn,submitIssueFeedback:L8,submitMessageFeedback:iTe,syncGithubCicdRuntime:s2e,updateCodexSandboxToolModelEnv:Ctt,updateCronJob:m2e,updateEnvironment:GTe,updateSandboxTool:D2e,updateWorkspace:UTe,upgradeMpaSessionProfile:_Te,uploadMedia:dTe,upsertCachedAgentFeedbackCase:cN,webSearch:wTe,writeEnvironmentShareCode:ITe},Symbol.toStringTag,{value:"Module"})),Ftt="/web/sandbox/sessions",JZ="/web/sandbox/codex-project-handoff",eJ=3e4,E3=33e4,Btt=6e4,Utt=6e5,ok=15e3,cp=6e4,Qtt=33e4,tJ=3e4,ztt=60*60,G8=40;function MD(e){const t=e.trim().toLowerCase();return["ready","running","wakeable"].includes(t)?"ready":t}function $z(e){switch(e.trim().toLowerCase()){case"ready":return Q("sandbox.status.ready");case"wakeable":return Q("sandbox.status.wakeable");case"creating":return Q("sandbox.status.creating");case"starting":case"initializing":return Q("sandbox.status.starting");case"pending":return Q("sandbox.status.pending");case"running":return Q("sandbox.status.running");case"failed":case"error":return Q("sandbox.status.failed");case"stopped":return Q("sandbox.status.stopped");case"expired":return Q("sandbox.status.expired");case"deleting":return Q("sandbox.status.deleting");case"deleted":return Q("sandbox.status.deleted");default:return Q("sandbox.status.unknown")}}function ps(e){const t=ul(e);return t.has("Accept")||t.set("Accept","application/json"),t}class Fz extends Error{constructor(n,i={}){var r;super(n);Zt(this,"code");Zt(this,"retryable");Zt(this,"publicMessage");Zt(this,"httpStatus");this.name="SandboxServiceError",this.code=i.code??"",this.retryable=i.retryable===!0,this.publicMessage=((r=i.publicMessage)==null?void 0:r.trim())||n,this.httpStatus=i.httpStatus}}function Vtt(e){return e instanceof Fz?e.publicMessage:e instanceof Error&&e.name==="TimeoutError"?Q("sandbox.developmentTimeout"):e instanceof TypeError?Q("sandbox.developmentDisconnected"):Q("sandbox.developmentFailed")}async function Bs(e,t){const n=await e.text().catch(()=>"");let i={};try{i=JSON.parse(n)}catch{const d=Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status});return new Error(n?Q("common.fallbackWithDetail",{fallback:d,detail:n}):d)}const r=i.detail,s=r&&typeof r=="object"?r:i,o=r&&typeof r=="object"&&"message"in r?r.message:r??i.error??i.message,l=typeof o=="string"?o:o==null?"":JSON.stringify(o),c=Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),u=l?Q("common.fallbackWithDetail",{fallback:c,detail:l}):c;return new Fz(u,{code:typeof s.code=="string"?s.code:"",retryable:s.retryable===!0,publicMessage:l||c,httpStatus:e.status})}async function nJ(e,t){const n=await e.text().catch(()=>"");try{return JSON.parse(n)}catch{throw new Error(Q("sandbox.invalidStudioResponse",{fallback:t}))}}function Wb(e,t="codex",n=e.toolName==="intelligent-development"){if(!e.sessionId||!e.status)throw new Error(Q("sandbox.invalidSession"));return{resourceType:"session",id:e.sessionId,toolName:t,userSessionId:e.userSessionId??"",displayName:e.displayName??"",status:e.status,createdAt:e.createdAt??"",expireAt:e.expireAt??"",persistent:e.persistent!==!1,toolType:e.toolType??"",intelligentDevelopment:n,createdBy:e.createdBy??"",region:e.region??"",isMine:e.isMine===!0,threadId:e.threadId??"",cwd:e.cwd??"",workspaceLocked:e.workspaceLocked===!0,busy:e.busy===!0,...typeof e.model=="string"?{model:e.model}:{},permissions:LD(e.permissions),...e.conversation===void 0?{}:{restoredConversation:hy(e.conversation)}}}function iJ(e,t="codex"){if(!e.snapshotId||!e.status)throw new Error(Q("sandbox.invalidSnapshot"));return{resourceType:"snapshot",id:e.snapshotId,snapshotId:e.snapshotId,sourceSessionId:e.sessionId??"",toolName:t,userSessionId:e.userSessionId??"",displayName:e.displayName??"",status:e.status,snapshotStatus:e.snapshotStatus??"Unknown",reason:e.reason??"",createdAt:e.createdAt??"",createdBy:e.createdBy??"",region:e.region??"",isMine:e.isMine===!0}}function rJ(e,t){if((t==null?void 0:t.autoResumeSnapshots)===void 0)return e;const n=new URLSearchParams({autoResumeSnapshots:String(t.autoResumeSnapshots)});return`${e}?${n.toString()}`}const lk={approvalPolicy:"on-request",approvalsReviewer:"user",sandboxMode:"workspace-write",networkAccess:!1};function LD(e){if(!e||typeof e!="object")return{...lk};const t=e,n=t.approvalPolicy,i=t.approvalsReviewer,r=t.sandboxMode;return{approvalPolicy:n==="untrusted"||n==="on-request"||n==="never"?n:lk.approvalPolicy,approvalsReviewer:i==="user"||i==="auto_review"?i:lk.approvalsReviewer,sandboxMode:r==="read-only"||r==="workspace-write"||r==="danger-full-access"?r:lk.sandboxMode,networkAccess:typeof t.networkAccess=="boolean"?t.networkAccess:lk.networkAccess}}function sJ(e){if(!e||typeof e!="object")throw new Error(Q("sandbox.invalidSettings"));const t=e;return{threadId:typeof t.threadId=="string"?t.threadId:"",cwd:typeof t.cwd=="string"?t.cwd:"",...typeof t.model=="string"?{model:t.model}:{},workspaceLocked:t.workspaceLocked===!0,busy:t.busy===!0,permissions:LD(t.permissions)}}function xa(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Htt(e){const t=xa(e);if(!(!t||typeof t.id!="string"||!t.id))return{id:t.id,displayName:typeof t.displayName=="string"?t.displayName:t.id,description:typeof t.description=="string"?t.description:"",isDefault:t.isDefault===!0}}function qtt(e){const t=xa(e);if(!(!t||typeof t.id!="string"||!t.id||typeof t.name!="string"||!t.name))return{id:t.id,name:t.name,description:typeof t.description=="string"?t.description:""}}function $2e(e){const t=xa(e);if(!(!t||typeof t.id!="string"||!t.id))return{id:t.id,...typeof t.name=="string"&&t.name?{name:t.name}:{},preview:typeof t.preview=="string"?t.preview:"",cwd:typeof t.cwd=="string"?t.cwd:"",modelProvider:typeof t.modelProvider=="string"?t.modelProvider:"",createdAt:typeof t.createdAt=="number"&&Number.isFinite(t.createdAt)?t.createdAt:0,updatedAt:typeof t.updatedAt=="number"&&Number.isFinite(t.updatedAt)?t.updatedAt:0,status:typeof t.status=="string"?t.status:"unknown"}}function hy(e){const t=xa(e),n=$2e(t==null?void 0:t.thread);if(!t||!n||typeof t.threadId!="string"||!Array.isArray(t.messages))throw new Error(Q("sandbox.invalidThreadSnapshot"));const i=t.messages.flatMap(r=>{const s=xa(r);if(!s||typeof s.id!="string"||s.role!=="user"&&s.role!=="assistant"||typeof s.content!="string"||typeof s.timestamp!="number")return[];const o=Array.isArray(s.skillNames)?s.skillNames.filter(c=>typeof c=="string"&&!!c):[],l=Array.isArray(s.images)?s.images.flatMap(c=>{const u=xa(c);return!u||typeof u.mimeType!="string"||!u.mimeType.startsWith("image/")||typeof u.data!="string"||!u.data?[]:[{mimeType:u.mimeType,data:u.data,...typeof u.name=="string"&&u.name?{name:u.name}:{},...typeof u.alt=="string"&&u.alt?{alt:u.alt}:{}}]}):[];return[{id:s.id,role:s.role,content:s.content,timestamp:s.timestamp,...o.length?{skillNames:o}:{},...l.length?{images:l}:{}}]});return{thread:n,threadId:t.threadId,messages:i,...typeof t.model=="string"?{model:t.model}:{},...typeof t.cwd=="string"?{cwd:t.cwd}:{},workspaceLocked:t.workspaceLocked===!0,permissions:LD(t.permissions)}}function X8(e){if(!e||typeof e!="object")return;const t=e;if(![t.totalTokens,t.inputTokens,t.cachedInputTokens,t.outputTokens,t.reasoningOutputTokens].some(i=>typeof i!="number"||!Number.isFinite(i)||i<0))return{totalTokens:Math.trunc(t.totalTokens),inputTokens:Math.trunc(t.inputTokens),cachedInputTokens:Math.trunc(t.cachedInputTokens),outputTokens:Math.trunc(t.outputTokens),reasoningOutputTokens:Math.trunc(t.reasoningOutputTokens)}}function Wtt(e){const t=X8(e.usage);if(!t||typeof e.turnId!="string")return;const n=X8(e.threadTotal),i=e.modelContextWindow;return{turnId:e.turnId,usage:t,...n?{threadTotal:n}:{},...typeof i=="number"&&Number.isFinite(i)&&i>=0?{modelContextWindow:Math.trunc(i)}:{}}}function Ktt(e){return typeof e.id!="string"||e.kind!=="command"&&e.kind!=="file"||typeof e.method!="string"?null:{id:e.id,kind:e.kind,method:e.method,...typeof e.reason=="string"?{reason:e.reason}:{},...typeof e.command=="string"?{command:e.command}:{},...typeof e.cwd=="string"?{cwd:e.cwd}:{},...typeof e.grantRoot=="string"?{grantRoot:e.grantRoot}:{},...e.changes!==void 0?{changes:e.changes}:{},...typeof e.threadId=="string"?{threadId:e.threadId}:{},...typeof e.turnId=="string"?{turnId:e.turnId}:{},...typeof e.itemId=="string"?{itemId:e.itemId}:{}}}function F2e(e={}){let t="";const n=[],i=new Map,r=new Map;let s,o;function l(){var h;const f=s?[...n,s]:n;(h=e.onBlocks)==null||h.call(e,[...f])}function c(f){t+=f;const h=n[n.length-1],m=n.length-1,g=[...i.values()].includes(m);(h==null?void 0:h.kind)==="text"&&!g?n[m]={...h,text:h.text+f}:n.push({kind:"text",text:f}),l()}function u(f){if(typeof f.id!="string"||f.kind!=="thinking"&&f.kind!=="commentary"&&f.kind!=="tool"||f.status!=="running"&&f.status!=="done"&&f.status!=="error")return;const h=f.status!=="running";let m;if(f.kind==="thinking")m={kind:"thinking",text:typeof f.text=="string"?f.text:"",done:h};else if(f.kind==="commentary"){if(typeof f.text!="string"||!f.text)return;m={kind:"text",text:f.text}}else{if(typeof f.name!="string"||!f.name)return;m={kind:"tool",name:f.name,args:f.args,response:f.response,status:f.status==="error"?"failed":h?"completed":"running",done:h}}m={...m,id:f.id,...typeof f.itemType=="string"?{itemType:f.itemType}:{},...typeof f.phase=="string"?{phase:f.phase}:{},...typeof f.durationMs=="number"?{durationMs:f.durationMs}:{}};const g=i.get(f.id);g===void 0?(i.set(f.id,n.length),n.push(m)):n[g]=m,l()}function d(f){var b,v,y,w;let h="message";const m=[];for(const x of f.split(/\r?\n/))x.startsWith("event:")&&(h=x.slice(6).trim()),x.startsWith("data:")&&m.push(x.slice(5).trimStart());if(m.length===0)return;let g;try{g=JSON.parse(m.join(` +`))}catch{throw new Error(Q("sandbox.invalidConversationResponse"))}if(h==="error"){const x=typeof g.message=="string"&&g.message?g.message:Q("sandbox.conversationFailed");throw new Fz(x,{code:typeof g.code=="string"?g.code:"",retryable:g.retryable===!0,publicMessage:x})}if(h==="progress"&&typeof g.text=="string"&&(s=g.text?{kind:"progress",text:g.text}:void 0,l()),["activity","delta","tool_output","tool_progress","plan","diff"].includes(h)&&(s=void 0),h==="activity"&&u(g),(h==="tool_output"||h==="tool_progress")&&typeof g.id=="string"){const x=i.get(g.id),O=x===void 0?void 0:n[x];if((O==null?void 0:O.kind)==="tool"&&x!==void 0&&typeof g.text=="string"){const k=xa(O.response)||{};n[x]=h==="tool_progress"?{...O,progressText:g.text}:{...O,response:{...k,output:(g.snapshot?"":String(k.output||""))+g.text}},l()}}if((h==="plan"||h==="diff")&&typeof g.id=="string"){const x=typeof g.text=="string"?g.text:"",O=Array.isArray(g.items)?g.items:Array.isArray(g.plan)?g.plan:[],k=h==="diff"?{kind:"diff",id:g.id,text:x,done:g.status==="done"}:{kind:"plan",id:g.id,title:Q("developmentRuns.plan"),summary:x,done:g.status==="done",items:O.flatMap(C=>{const E=xa(C);if(!E||typeof(E.text??E.step)!="string")return[];const j=E.status==="inProgress"?"in_progress":E.status;return[{text:String(E.text??E.step),status:j==="completed"||j==="failed"||j==="in_progress"?j:"pending"}]})},S=i.get(g.id);S===void 0?(i.set(g.id,n.length),n.push(k)):n[S]=k,l()}if(h==="development.source_ready"||h==="development.succeeded"){const x=xa(g.payload),O=xa(x==null?void 0:x.delivery),k=h==="development.succeeded";if(O&&typeof O.sessionId=="string"&&typeof O.artifactSha256=="string"&&typeof O.validationReportSha256=="string"&&typeof O.agentName=="string"&&typeof O.entryPoint=="string"&&typeof O.fileCount=="number"&&typeof O.artifactSize=="number"&&typeof O.validatedAt=="string"&&O.deployable===!0&&O.verified===k&&typeof O.validationSummary=="string"&&Array.isArray(O.gateSummary)&&O.gateSummary.every(S=>typeof S=="string")){const S={kind:"delivery",value:{sessionId:O.sessionId,...typeof O.projectId=="string"&&typeof O.versionId=="string"?{projectId:O.projectId,versionId:O.versionId,...O.parentVersionId===null||typeof O.parentVersionId=="string"?{parentVersionId:O.parentVersionId}:{}}:{},artifactSha256:O.artifactSha256,validationReportSha256:O.validationReportSha256,agentName:O.agentName,entryPoint:O.entryPoint,fileCount:O.fileCount,artifactSize:O.artifactSize,validatedAt:O.validatedAt,gateSummary:O.gateSummary,deployable:O.deployable,verified:O.verified,validationSummary:O.validationSummary}},C=n.findIndex(E=>E.kind==="delivery"&&E.value.sessionId===O.sessionId&&E.value.artifactSha256===O.artifactSha256&&E.value.validationReportSha256===O.validationReportSha256);C===-1?n.push(S):n[C]=S,l()}}if(h==="approval"){const x=Ktt(g);x&&((b=e.onApproval)==null||b.call(e,x))}if(h==="usage"){const x=Wtt(g);x&&(o=x,(v=e.onUsage)==null||v.call(e,x))}if(h==="approval_resolved"&&typeof g.approvalId=="string"&&((y=e.onApprovalResolved)==null||y.call(e,g.approvalId)),h==="delta"&&typeof g.text=="string")if(typeof g.id=="string"&&g.id){const x=r.get(g.id),O=x===void 0?void 0:n[x],k=((w=xa(g))==null?void 0:w.snapshot)===!0;(O==null?void 0:O.kind)==="text"?n[x]={...O,phase:typeof g.phase=="string"&&g.phase?g.phase:O.phase,text:k?O.text.startsWith(g.text)?O.text:g.text:O.text+g.text}:(r.set(g.id,n.length),n.push({kind:"text",text:g.text,id:g.id,itemType:typeof g.itemType=="string"?g.itemType:void 0,phase:typeof g.phase=="string"?g.phase:void 0})),t=n.filter(S=>S.kind==="text").map(S=>S.text).join(""),l()}else c(g.text);if(h==="done"&&!t&&typeof g.text=="string"&&c(g.text),h==="done"){for(let x=0;x({text:t,blocks:n.map(f=>({...f})),...o?{usage:o}:{}})}}async function Gtt(e,t={}){if(!e.body)throw new Error(Q("sandbox.emptyConversationResponse"));const n=e.body.getReader(),i=new TextDecoder;let r="";const s=F2e(t);for(;;){const{done:l,value:c}=await n.read();r+=i.decode(c,{stream:!l});const u=r.split(/\r?\n\r?\n/);if(r=u.pop()??"",u.forEach(s.consumeFrame),l)break}r.trim()&&s.consumeFrame(r),s.consumeFrame(`event: done +data: {}`);const o=s.result();if(o.blocks.length===0)throw new Error(Q("sandbox.emptyReply"));return o}async function tu(e,t,n,{method:i="GET",body:r,options:s={},fallback:o}){if(!t)throw new Error(Q("sandbox.missingSession"));const l=await yn(`${e}/${encodeURIComponent(t)}/${n}`,{method:i,headers:ps(r===void 0?void 0:{"Content-Type":"application/json"}),...r===void 0?{}:{body:JSON.stringify(r)},signal:s.signal},cp);if(!l.ok)throw await Bs(l,o);return l.json()}function B2e(e,t={}){return{async listSessions(n={}){const i=await yn(rJ(e,n),{method:"GET",headers:ps(),signal:n.signal},eJ);if(!i.ok)throw await Bs(i,Q("sandbox.listCodexFailed"));const r=await i.json();if(!Array.isArray(r.sessions))throw new Error(Q("sandbox.invalidSessionList"));if(r.snapshots!==void 0&&!Array.isArray(r.snapshots))throw new Error(Q("sandbox.invalidSnapshotList"));return[...r.sessions.map(s=>Wb(s,"codex",t.intelligentDevelopment)),...(r.snapshots??[]).map(s=>iJ(s))]},async startSession(n={}){var s,o;const i=((s=n.displayName)==null?void 0:s.trim())??"",r=await yn(e,{method:"POST",headers:ps({"Content-Type":"application/json"}),body:JSON.stringify({displayName:t.textOnly&&n.projectId?Array.from(i).slice(0,G8).join(""):i,...(o=n.modelId)!=null&&o.trim()?{modelId:n.modelId.trim()}:{},...t.textOnly&&n.projectId?{projectId:n.projectId,...n.baseVersionId?{baseVersionId:n.baseVersionId}:{}}:{},...t.textOnly?{}:{persistent:n.persistent??!0},...n.diskGb!==void 0?{diskGb:n.diskGb}:{}}),signal:n.signal},E3);if(!r.ok)throw await Bs(r,Q("sandbox.startFailed"));return Wb(await r.json(),"codex",t.intelligentDevelopment)},async listAgentSessions(n,i={}){const r=await yn(rJ(`/web/${n}/sessions`,i),{method:"GET",headers:ps(),signal:i.signal},eJ);if(!r.ok)throw await Bs(r,Q("sandbox.listAgentFailed",{kind:n}));const s=await r.json();if(!Array.isArray(s.sessions))throw new Error(Q("sandbox.invalidKindSessionList",{kind:n}));if(s.snapshots!==void 0&&!Array.isArray(s.snapshots))throw new Error(Q("sandbox.invalidKindSnapshotList",{kind:n}));return[...s.sessions.map(o=>Wb(o,n)),...(s.snapshots??[]).map(o=>iJ(o,n))]},async startAgentSession(n,i={}){var s;const r=await yn(`/web/${n}/sessions`,{method:"POST",headers:ps({"Content-Type":"application/json"}),body:JSON.stringify({displayName:((s=i.displayName)==null?void 0:s.trim())??"",persistent:i.persistent??!0,...i.diskGb!==void 0?{diskGb:i.diskGb}:{}}),signal:i.signal},E3);if(!r.ok)throw await Bs(r,Q("sandbox.createAgentFailed",{kind:n}));return Wb(await r.json(),n)},async openAgentSession(n,i,r={}){if(!i)throw new Error(Q("sandbox.missingSessionToOpen"));const s=await yn(`/web/${n}/sessions/${encodeURIComponent(i)}/open`,{method:"POST",headers:ps(),signal:r.signal},cp);if(!s.ok)throw await Bs(s,Q("sandbox.openAgentFailed",{kind:n}));const o=await s.json();if(typeof o.webuiUrl!="string"||!o.webuiUrl.startsWith("/"))throw new Error(Q("sandbox.invalidAgentHomeUrl",{kind:n}));return{session:Wb(o,n),kind:n,webuiUrl:Ta(o.webuiUrl)}},async launchAgentTerminal(n,i,r={}){if(!i)throw new Error(Q("sandbox.missingSessionForTerminal"));const s=await yn(`/web/${n}/sessions/${encodeURIComponent(i)}/terminal`,{method:"POST",headers:ps(),signal:r.signal},cp);if(!s.ok)throw await Bs(s,Q("sandbox.openTerminalFailed",{kind:n}));const o=await s.json();return{url:U2e(o.url,`${n} Terminal`),...typeof o.shellSessionId=="string"?{shellSessionId:o.shellSessionId}:{}}},async deleteAgentSession(n,i,r={}){if(!i)return;const s=await yn(`/web/${n}/sessions/${encodeURIComponent(i)}`,{method:"DELETE",headers:ps(),signal:r.signal},ok);if(!s.ok&&s.status!==404)throw await Bs(s,Q("sandbox.deleteAgentFailed",{kind:n}))},async resumeSnapshot(n,i,r={}){if(!i)throw new Error(Q("sandbox.missingSnapshot"));const s=n==="codex"?"/web/sandbox":`/web/${n}`,o=await yn(`${s}/snapshots/${encodeURIComponent(i)}/resume`,{method:"POST",headers:ps(),signal:r.signal},E3);if(!o.ok)throw await Bs(o,Q("sandbox.resumeSnapshotFailed"));return Wb(await o.json(),n)},async deleteSnapshot(n,i,r={}){if(!i)return;const s=n==="codex"?"/web/sandbox":`/web/${n}`,o=await yn(`${s}/snapshots/${encodeURIComponent(i)}`,{method:"DELETE",headers:ps(),signal:r.signal},ok);if(!o.ok&&o.status!==404)throw await Bs(o,Q("sandbox.deleteSnapshotFailed"))},async connectSession(n,i={}){if(!n)throw new Error(Q("sandbox.missingSessionToConnect"));const r=await yn(`${e}/${encodeURIComponent(n)}/connect`,{method:"POST",headers:ps({"Content-Type":"application/json"}),signal:i.signal},Btt);if(!r.ok)throw await Bs(r,Q("sandbox.connectCodexFailed"));const s=Wb(await r.json(),"codex",t.intelligentDevelopment);if(s.status.toLowerCase()!=="ready")throw new Error(Q("sandbox.sessionNotReady",{status:s.status}));return s},async sendMessage(n,i={}){var s;if(!n.sessionId||!n.text.trim())throw new Error(Q("sandbox.invalidMessage"));const r=await yn(`${e}/${encodeURIComponent(n.sessionId)}/messages`,{method:"POST",headers:ps({Accept:"text/event-stream","Content-Type":"application/json"}),body:JSON.stringify({message:n.text,...!t.textOnly&&((s=n.skillIds)!=null&&s.length)?{skillIds:n.skillIds}:{}}),signal:i.signal},t.messageTimeoutMs??Utt);if(!r.ok)throw await Bs(r,Q("sandbox.conversationFailed"));return Gtt(r,i)},async interruptSession(n,i={}){if(!n)return;const r=await yn(`${e}/${encodeURIComponent(n)}/interrupt`,{method:"POST",headers:ps(),signal:i.signal},t.interruptTimeoutMs??ok);if(!r.ok&&![404,409].includes(r.status))throw await Bs(r,Q("sandbox.interruptFailed"))},async getStatus(n,i={}){const r=await tu(e,n,"status",{options:i,fallback:Q("sandbox.getStatusFailed")}),s=sJ(r),o=xa(r),l=X8(o==null?void 0:o.threadTotal),c=o==null?void 0:o.modelContextWindow;return{...s,...l?{threadTotal:l}:{},...typeof c=="number"&&Number.isFinite(c)&&c>=0?{modelContextWindow:Math.trunc(c)}:{}}},async getEndpoint(n,i={}){const r=xa(await tu(e,n,"endpoint",{options:i,fallback:Q("sandbox.getEndpointFailed")}));if(typeof(r==null?void 0:r.endpoint)!="string"||!r.endpoint.trim())throw new Error(Q("sandbox.invalidEndpoint"));return{endpoint:r.endpoint,sessionId:typeof r.sessionId=="string"?r.sessionId:n,...typeof r.expireAt=="string"?{expireAt:r.expireAt}:{}}},async createCodexProjectHandoffPairing(n={}){const i=await yn(`${JZ}/pairings`,{method:"POST",headers:ps({Accept:"application/json","Content-Type":"application/json"}),body:JSON.stringify({ttlSeconds:ztt}),signal:n.signal},tJ);if(!i.ok)throw await Bs(i,Q("sandbox.createHandoffPairingFailed"));const r=xa(await nJ(i,Q("sandbox.createHandoffPairingFailed")));if(typeof(r==null?void 0:r.pairingCode)!="string"||!r.pairingCode.trim()||typeof r.expireAt!="string"||!r.expireAt.trim())throw new Error(Q("sandbox.invalidHandoffPairing"));const s=typeof r.studioUrl=="string"&&r.studioUrl.trim()?r.studioUrl.trim():window.location.origin;return{pairingCode:r.pairingCode,expireAt:r.expireAt,studioUrl:s}},async getCodexProjectHandoffStatus(n,i={}){const r=await yn(`${JZ}/pairings/${encodeURIComponent(n)}`,{headers:ps({Accept:"application/json"}),signal:i.signal},tJ);if(!r.ok)throw await Bs(r,Q("sandbox.getHandoffStatusFailed"));const s=xa(await nJ(r,Q("sandbox.getHandoffStatusFailed"))),o=new Set(["issued","creating","session-created","continuing","running","completed","failed"]);if(typeof(s==null?void 0:s.state)!="string"||!o.has(s.state)||typeof s.expireAt!="string"||!s.expireAt.trim())throw new Error(Q("sandbox.invalidHandoffStatus"));return{state:s.state,expireAt:s.expireAt,...typeof s.projectName=="string"?{projectName:s.projectName}:{},...typeof s.agentName=="string"?{agentName:s.agentName}:{},...typeof s.sessionId=="string"?{sessionId:s.sessionId}:{},...typeof s.error=="string"?{error:s.error}:{},...s.failedStage==="creating-session"||s.failedStage==="uploading-project"||s.failedStage==="restoring-project"||s.failedStage==="continuing-task"?{failedStage:s.failedStage}:{}}},async listModels(n,i={}){const r=xa(await tu(e,n,"models",{options:i,fallback:Q("sandbox.listModelsFailed")}));if(!Array.isArray(r==null?void 0:r.models))throw new Error(Q("sandbox.invalidModelList"));return r.models.flatMap(s=>{const o=Htt(s);return o?[o]:[]})},async setModel(n,i,r={}){const s=xa(await tu(e,n,"model",{method:"PUT",body:{model:i},options:r,fallback:Q("sandbox.setModelFailed")}));if(typeof(s==null?void 0:s.model)!="string"||!s.model)throw new Error(Q("sandbox.invalidModel"));return s.model},async listSkills(n,i=!1,r={}){const o=xa(await tu(e,n,`skills${i?"?force_reload=true":""}`,{options:r,fallback:Q("sandbox.listSkillsFailed")}));if(!Array.isArray(o==null?void 0:o.skills))throw new Error(Q("sandbox.invalidSkillList"));return o.skills.flatMap(l=>{const c=qtt(l);return c?[c]:[]})},async listThreads(n,i={},r={}){const s=new URLSearchParams;i.cursor&&s.set("cursor",i.cursor),i.search&&s.set("search",i.search),i.archived&&s.set("archived","true");const o=s.size?`?${s}`:"",l=xa(await tu(e,n,`threads${o}`,{options:r,fallback:Q("sandbox.listThreadsFailed")}));if(!Array.isArray(l==null?void 0:l.threads))throw new Error(Q("sandbox.invalidThreadList"));return{threads:l.threads.flatMap(c=>{const u=$2e(c);return u?[u]:[]}),...typeof l.nextCursor=="string"?{nextCursor:l.nextCursor}:{}}},async newThread(n,i={}){return hy(await tu(e,n,"threads/new",{method:"POST",options:i,fallback:Q("sandbox.createThreadFailed")}))},async readThread(n,i,r={}){if(!i)throw new Error(Q("sandbox.missingThread"));return hy(await tu(e,n,`threads/${encodeURIComponent(i)}`,{options:r,fallback:Q("sandbox.readThreadFailed")}))},async resumeThread(n,i,r={}){return hy(await tu(e,n,"threads/resume",{method:"POST",body:{threadId:i},options:r,fallback:Q("sandbox.resumeThreadFailed")}))},async forkThread(n,i={}){return hy(await tu(e,n,"threads/fork",{method:"POST",options:i,fallback:Q("sandbox.forkThreadFailed")}))},async archiveThread(n,i,r={}){const s=xa(await tu(e,n,"threads/archive",{method:"POST",body:{threadId:i},options:r,fallback:Q("sandbox.archiveThreadFailed")}));if((s==null?void 0:s.archived)!==!0)throw new Error(Q("sandbox.invalidArchiveResult"));return{archived:!0,...s.thread?{snapshot:hy(s)}:{}}},async deleteThread(n,i,r={}){const s=xa(await tu(e,n,"threads/delete",{method:"POST",body:{threadId:i},options:r,fallback:Q("sandbox.deleteThreadFailed")}));if((s==null?void 0:s.deleted)!==!0)throw new Error(Q("sandbox.invalidDeleteResult"));return{deleted:!0,...s.thread?{snapshot:hy(s)}:{}}},async compactThread(n,i={}){await tu(e,n,"threads/compact",{method:"POST",options:i,fallback:Q("sandbox.compactThreadFailed")})},async getSettings(n,i={}){const r=await yn(`${e}/${encodeURIComponent(n)}/settings`,{method:"GET",headers:ps(),signal:i.signal},cp);if(!r.ok)throw await Bs(r,Q("sandbox.getSettingsFailed"));return sJ(await r.json())},async updatePermissions(n,i,r={}){const s=await yn(`${e}/${encodeURIComponent(n)}/permissions`,{method:"PUT",headers:ps({"Content-Type":"application/json"}),body:JSON.stringify(i),signal:r.signal},cp);if(!s.ok)throw await Bs(s,Q("sandbox.updatePermissionsFailed"));const o=await s.json();return LD(o.permissions)},async updateWorkspace(n,i,r={}){const s=await yn(`${e}/${encodeURIComponent(n)}/workspace`,{method:"PUT",headers:ps({"Content-Type":"application/json"}),body:JSON.stringify({cwd:i}),signal:r.signal},cp);if(!s.ok)throw await Bs(s,Q("sandbox.updateWorkspaceFailed"));const o=await s.json();if(typeof o.cwd!="string"||!o.cwd)throw new Error(Q("sandbox.invalidWorkingDirectory"));return o.cwd},async listDirectories(n,i,r={}){const s=new URLSearchParams({path:i}),o=await yn(`${e}/${encodeURIComponent(n)}/directories?${s}`,{method:"GET",headers:ps(),signal:r.signal},cp);if(!o.ok)throw await Bs(o,Q("sandbox.listDirectoriesFailed"));const l=await o.json();if(typeof l.path!="string"||!Array.isArray(l.directories)||l.directories.some(c=>!c||typeof c.name!="string"||typeof c.path!="string"))throw new Error(Q("sandbox.invalidDirectoryList"));return{path:l.path,...typeof l.parent=="string"?{parent:l.parent}:{},directories:l.directories}},async resolveApproval(n,i,r,s={}){const o=await yn(`${e}/${encodeURIComponent(n)}/approvals/${encodeURIComponent(i)}`,{method:"POST",headers:ps({"Content-Type":"application/json"}),body:JSON.stringify({decision:r}),signal:s.signal},cp);if(!o.ok)throw await Bs(o,Q("sandbox.resolveApprovalFailed"))},async launchTerminal(n,i={}){return aJ(e,n,"terminal",i)},async launchBrowser(n,i={}){return aJ(e,n,"browser",i)},async uploadFile(n,i,r={}){const s=new FormData;s.set("file",i,i.name);const o=await yn(`${e}/${encodeURIComponent(n)}/files`,{method:"POST",headers:ps(),body:s,signal:r.signal},Qtt);if(!o.ok)throw await Bs(o,Q("sandbox.uploadFileFailed"));const l=await o.json();if(typeof l.id!="string"||typeof l.path!="string"||typeof l.name!="string"||typeof l.mimeType!="string"||typeof l.sizeBytes!="number")throw new Error(Q("sandbox.invalidUploadResult"));return l},async closeSession(n,i={}){if(!n)return;const r=await yn(`${e}/${encodeURIComponent(n)}/disconnect`,{method:"POST",headers:ps(),signal:i.signal},ok);if(!r.ok&&r.status!==404)throw await Bs(r,Q("sandbox.disconnectCodexFailed"))},async deleteSession(n,i={}){if(!n)return;const r=await yn(`${e}/${encodeURIComponent(n)}`,{method:"DELETE",headers:ps(),signal:i.signal},ok);if(!r.ok&&r.status!==404)throw await Bs(r,Q("sandbox.deleteCodexFailed"))}}}const Br=B2e(Ftt),Nv=B2e("/web/intelligent-development/sessions",{textOnly:!0,messageTimeoutMs:36e5,interruptTimeoutMs:45e3,intelligentDevelopment:!0});async function aJ(e,t,n,i){const r=await yn(`${e}/${encodeURIComponent(t)}/${n}`,{method:"POST",headers:ps(),signal:i.signal},cp);if(!r.ok)throw await Bs(r,Q(n==="terminal"?"sandbox.openSandboxTerminalFailed":"sandbox.openSandboxBrowserFailed"));const s=await r.json();return{url:U2e(s.url,Q("sandbox.toolLabel")),...typeof s.shellSessionId=="string"?{shellSessionId:s.shellSessionId}:{}}}function U2e(e,t){if(typeof e!="string")throw new Error(Q("sandbox.invalidToolUrl",{label:t}));if(e.startsWith("/"))return Ta(e);let n;try{n=new URL(e)}catch{throw new Error(Q("sandbox.invalidToolUrl",{label:t}))}const i=n.protocol==="http:"&&window.location.protocol==="http:";if(n.protocol!=="https:"&&!i)throw new Error(Q("sandbox.unsafeToolUrl",{label:t}));return n.toString()}const pu=e=>["succeeded","cancelled","failed"].includes(e.state),Q2e="/web/intelligent-development";class Kw extends Error{constructor(t,n){super(t),this.status=n}}async function Kb(e,t="GET",n,i){const r=await yn(`${Q2e}${e}`,{method:t,signal:i,headers:ps(n===void 0?void 0:{"Content-Type":"application/json"}),...n===void 0?{}:{body:JSON.stringify(n)}},3e4);if(!r.ok){const s=await r.json().catch(()=>null),o=s==null?void 0:s.detail;throw new Kw(typeof o=="string"?o:(o==null?void 0:o.message)||Q("developmentRuns.requestFailed"),r.status)}return r.json()}function Rv(e){const t=e;if(!t||typeof t.runId!="string"||typeof t.sessionId!="string"||!["queued","running","recovering","waiting_user","stopping","succeeded","cancelled","failed"].includes(t.state))throw new Error(Q("developmentRuns.invalidResponse"));return t}const Jd={async active(e){const t=await Kb("/runs","GET",void 0,e);if(!Array.isArray(t.runs))throw new Error(Q("developmentRuns.invalidResponse"));return t.runs.map(Rv)},async get(e,t){return Rv(await Kb(`/runs/${encodeURIComponent(e)}`,"GET",void 0,t))},async list(e,t){const n=await Kb(`/sessions/${encodeURIComponent(e)}/runs`,"GET",void 0,t);if(!Array.isArray(n.runs))throw new Error(Q("developmentRuns.invalidResponse"));return n.runs.map(Rv)},async create(e,t,n){return Rv(await Kb(`/sessions/${encodeURIComponent(e)}/runs`,"POST",{message:t,requestId:n}))},async steer(e,t,n){await Kb(`/runs/${encodeURIComponent(e)}/inputs`,"POST",{message:t,clientId:n})},async stop(e){return Rv(await Kb(`/runs/${encodeURIComponent(e)}/stop`,"POST"))},async resume(e){return Rv(await Kb(`/runs/${encodeURIComponent(e)}/resume`,"POST"))}};class Xtt{constructor(t){Zt(this,"cursor",0);Zt(this,"turns",[]);Zt(this,"activeInput");Zt(this,"itemTurns",new Map);Zt(this,"nativeInputs",new Map);Zt(this,"metrics",new Map);Zt(this,"inputOrder",[]);Zt(this,"projections",new Map);Zt(this,"itemInputs",new Map);this.run=t,this.activeInput=t.requestId}projection(t){let n=this.projections.get(t);if(!n){const i={role:"assistant",blocks:[],meta:{localId:`${t}:assistant`}},r=this.turns.findIndex(s=>{var o;return((o=s.meta)==null?void 0:o.localId)===`${t}:user`});this.turns.splice(r<0?this.turns.length:r+1,0,i),n=F2e({onBlocks:s=>{i.blocks=s.map(o=>({...o,turnId:this.itemTurns.get(o.id||"")}))},onUsage:s=>{i.meta={...i.meta,sandboxUsage:s.usage}}}),this.projections.set(t,n)}return n}apply(t){if(t.payload.runId!==this.run.runId)throw new Error(Q("developmentRuns.invalidResponse"));if(t.seq<=this.cursor)return;if(t.seq!==this.cursor+1)throw new Error(Q("developmentRuns.eventGap"));for(const i of this.turns)i.blocks.some(r=>r.kind==="turn-summary")&&(i.blocks=i.blocks.filter(r=>r.kind!=="turn-summary"));const n=t.payload;if(t.type==="run.input"&&typeof n.clientId=="string"&&typeof n.message=="string")this.turns.push({role:"user",blocks:[{kind:"text",text:n.message}],meta:{localId:`${n.clientId}:user`},activity:{id:`${n.clientId}:delivery`,title:Q(`developmentRuns.input.${String(n.status)}`)}}),this.inputOrder.push(n.clientId),this.projection(n.clientId),n.status==="delivered"&&this.inputOrder.indexOf(n.clientId)>=this.inputOrder.indexOf(this.activeInput)&&(this.activeInput=n.clientId);else if(t.type==="run.input_status"&&typeof n.clientId=="string"){const i=this.turns.find(r=>{var s;return((s=r.meta)==null?void 0:s.localId)===`${n.clientId}:user`});i&&(i.activity={id:`${n.clientId}:delivery`,title:Q(`developmentRuns.input.${String(n.status)}`)}),n.status==="delivered"&&this.inputOrder.indexOf(n.clientId)>=this.inputOrder.indexOf(this.activeInput)&&(this.activeInput=n.clientId)}else if(t.type==="run.turn"&&typeof n.turnId=="string"){const r={...this.metrics.get(n.turnId),turnId:n.turnId,status:String(n.status||"inProgress"),toolCalls:0,toolDurationComplete:!1};for(const s of["startedAt","completedAt","durationMs"])typeof n[s]=="number"&&Number.isFinite(n[s])&&n[s]>=0&&(r[s]=n[s]);if(typeof n.model=="string"&&(r.model=n.model),n.usage&&typeof n.usage=="object"&&!Array.isArray(n.usage)){const s={};for(const o of["totalTokens","inputTokens","outputTokens","cachedInputTokens","cacheWriteInputTokens","reasoningOutputTokens"]){const l=n.usage[o];typeof l=="number"&&Number.isSafeInteger(l)&&l>=0&&(s[o]=l)}r.usage=s}n.usageIncomplete===!0&&(r.usageIncomplete=!0),this.metrics.set(n.turnId,r),this.nativeInputs.set(n.turnId,this.activeInput),this.projection(this.activeInput)}else if(t.type==="run.status"){if(this.run={...this.run,...n},pu(this.run))for(const[i,r]of this.metrics)r.status==="inProgress"&&this.metrics.set(i,{...r,status:"unavailable",usageIncomplete:!0});if(pu(this.run)||this.run.state==="waiting_user")for(const i of this.projections.values())i.consumeFrame(`event: done data: {}`)}else if(!t.type.startsWith("run.")){const i=typeof n.id=="string"&&n.id?n.id:["plan","diff"].includes(t.type)?t.type:"",r=i?`${String(n.turnId||"")}:${i}`:"",s=r&&this.itemInputs.get(r)||this.activeInput;r&&(this.itemInputs.set(r,s),typeof n.turnId=="string"&&this.itemTurns.set(r,n.turnId)),typeof n.turnId=="string"&&this.nativeInputs.set(n.turnId,this.activeInput);const o=t.type==="activity"&&n.kind==="commentary";this.projection(s).consumeFrame(`event: ${o?"delta":t.type} -data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type==="run.input"||t.type==="run.input_status")&&n.status==="delivered"&&typeof n.turnId=="string"&&typeof n.clientId=="string"&&this.nativeInputs.set(n.turnId,n.clientId),this.decorate(),this.cursor=t.seq}decorate(){const t=!hu(this.run)&&this.run.state!=="waiting_user",n=[...this.turns].reverse().find(i=>i.role==="assistant");for(const i of this.turns)i.role==="assistant"&&(i.meta={...i.meta,streaming:t&&i===n});for(const i of this.metrics.values()){if(!["completed","failed","interrupted","cancelled","unavailable"].includes(i.status))continue;const r=new Map;for(const u of this.turns)for(const d of u.blocks)d.kind==="tool"&&d.turnId===i.turnId&&d.id&&r.set(d.id,d);const s=[...r.values()].filter(u=>typeof u.durationMs=="number"&&Number.isFinite(u.durationMs)&&u.durationMs>=0),o={...i,toolCalls:r.size,toolDurationComplete:s.length===r.size,toolDurationMs:s.length||!r.size?s.reduce((u,d)=>u+d.durationMs,0):void 0},l=this.nativeInputs.get(i.turnId),c=this.turns.find(u=>{var d;return((d=u.meta)==null?void 0:d.localId)===`${l}:assistant`});if(c){const u=c.blocks.reduce((d,f,h)=>f.turnId===i.turnId?h:d,-1);c.blocks.splice(u<0?c.blocks.length:u+1,0,{kind:"turn-summary",id:`${i.turnId}:summary`,turnId:i.turnId,value:o})}}}}function Ytt(e,t){return new Promise((n,i)=>{if(t.aborted){i(new DOMException("Aborted","AbortError"));return}const r=()=>{clearTimeout(s),i(new DOMException("Aborted","AbortError"))},s=setTimeout(()=>{t.removeEventListener("abort",r),n()},e);t.addEventListener("abort",r,{once:!0})})}async function Ztt(e,t,n){var c;const i=await vn(`${Q2e}/runs/${encodeURIComponent(e.run.runId)}/events?after=${e.cursor}`,{signal:t,headers:gs({Accept:"text/event-stream"})},0);if(!i.ok)throw new qw(Q("developmentRuns.requestFailed"),i.status);if(!i.body)throw new Error(Q("developmentRuns.invalidResponse"));const r=i.body.getReader(),s=new TextDecoder;let o="",l=!1;try{for(;;){const{value:u,done:d}=await r.read();o+=s.decode(u,{stream:!d});const f=o.split(/\r?\n\r?\n/);o=f.pop()||"";for(const h of f){const m=h.split(/\r?\n/),g=(c=m.find(y=>y.startsWith("event:")))==null?void 0:c.slice(6).trim();if(g==="done"){l=!0;continue}const b=m.filter(y=>y.startsWith("data:")).map(y=>y.slice(5).trimStart()).join(` -`);if(!g||!b)continue;const v=JSON.parse(b);if(!Number.isSafeInteger(v.seq))throw new Error(Q("developmentRuns.invalidResponse"));e.apply({seq:v.seq,type:g,payload:v})}if(n(),d)break}if(!l)throw new Error(Q("developmentRuns.reconnecting"))}finally{await r.cancel().catch(()=>{}),r.releaseLock()}}async function Jtt(e,t,n,i,r){const s=new Map;let o=0;const l=new Map;let c;r==null||r(h=>{t.aborted||h.sessionId!==e||(l.set(h.runId,h),c==null||c())});const u=h=>new Promise(m=>{const g=()=>{clearTimeout(b),t.removeEventListener("abort",g),c=void 0,m()},b=setTimeout(g,h);c=g,t.addEventListener("abort",g,{once:!0}),(t.aborted||l.size)&&g()}),d=new Map,f=()=>{var m;if(t.aborted)return;const h=[...s.values()];n(h.flatMap(g=>{let b=d.get(g);return(!b||b.cursor!==g.cursor)&&(b={cursor:g.cursor,turns:g.turns.map(v=>({...v}))},d.set(g,b)),b.turns}),((m=h[h.length-1])==null?void 0:m.run)||null)};for(;!t.aborted;)try{const h=l.size?[]:await ef.list(e,t),m=[...new Map([...h,...l.values()].map(g=>[g.runId,g])).values()];l.clear();for(const g of m){let b=s.get(g.runId);if(b||(b=new Xtt(g),s.set(g.runId,b)),b.cursor>=g.lastSeq&&(b.run=g),b.cursor{o=0,i(""),f()})}catch(v){if(!(v instanceof qw&&v.status===404&&hu(g)))throw v}}o=0,i(""),f(),await u(1500)}catch(h){if(t.aborted)return;if(h instanceof qw&&[401,403,404].includes(h.status))throw h;i(Q("developmentRuns.reconnecting")),await Ytt(Math.min(1e3*2**o++,15e3),t)}}function ent({sessionId:e,ownerId:t,onTurns:n,onBusy:i}){const[r,s]=p.useState(null),[o,l]=p.useState(""),[c,u]=p.useState(""),[d,f]=p.useState(!1),[h,m]=p.useState(!1),g=p.useRef({onTurns:n,onBusy:i});g.current={onTurns:n,onBusy:i};const b=p.useRef(0),v=p.useRef([]),y=p.useRef([]),w=p.useRef(null),x=()=>{const A=new Set(v.current.map(N=>{var P;return(P=N.meta)==null?void 0:P.localId}));y.current=y.current.filter(N=>{var P;return!A.has((P=N.meta)==null?void 0:P.localId)}),g.current.onTurns([...v.current,...y.current])},O=p.useRef(!1),k=p.useRef(!1),S=p.useRef(null),C=p.useRef({sessionId:e,ownerId:t});C.current={sessionId:e,ownerId:t},p.useEffect(()=>{b.current+=1,s(null),u(""),l(""),v.current=[],w.current=null;const A=S.current;if(((A==null?void 0:A.session)!==e||A.owner!==t)&&(y.current=[],m(!1),k.current=!1,S.current=null,O.current=!1,f(!1)),e&&x(),!e||!t)return;const N=new AbortController,P=()=>!N.signal.aborted&&C.current.sessionId===e&&C.current.ownerId===t;return Jtt(e,N.signal,(I,D)=>{P()&&(v.current=I,x(),s(D),g.current.onBusy(O.current||!!(D&&!hu(D))),D&&hu(D)&&(m(!1),k.current=!1))},I=>{P()&&l(I)},I=>{P()&&(w.current=I)}).catch(I=>{P()&&u(I instanceof Error?I.message:String(I))}),()=>N.abort()},[e,t]);function E(A,N=e){const P=C.current.ownerId;let I=S.current;return(!I||I.session!==N||I.owner!==P||I.text!==A)&&(I={session:N,owner:P,text:A,id:crypto.randomUUID()},S.current=I),y.current.some(D=>{var _;return((_=D.meta)==null?void 0:_.localId)===`${I.id}:user`})||y.current.push({role:"user",blocks:[{kind:"text",text:A}],meta:{localId:`${I.id}:user`}},{role:"assistant",blocks:[{kind:"progress",text:Q(r&&!hu(r)?"developmentRuns.processing":"developmentRuns.preparing")}],meta:{localId:`${I.id}:assistant`}}),[...y.current]}async function j(A,N=e){var L;if(!A.trim()||O.current||k.current)return!1;O.current=!0,f(!0),u("");const P=C.current.ownerId,I=()=>C.current.ownerId===P&&C.current.sessionId===N;E(A,N),x(),g.current.onBusy(!0);const D=S.current,_=(D==null?void 0:D.session)===N&&D.owner===P&&D.text===A?D:{session:N,owner:P,text:A,id:crypto.randomUUID(),runId:void 0,stopRequested:!1};S.current=_;try{const F=await ef.list(N),M=F[F.length-1];if(!I())return!1;!_.runId&&M&&!hu(M)&&M.requestId!==_.id&&(_.runId=M.runId);let z;return _.runId?(await ef.steer(_.runId,A,_.id),z=await ef.get(_.runId)):z=await ef.create(N,A,_.id),(_.stopRequested||I()&&k.current)&&(z=await ef.stop(z.runId)),I()&&(s(z),(L=w.current)==null||L.call(w,z),g.current.onBusy(!hu(z)),S.current=null),!0}catch(F){return I()&&(g.current.onBusy(!!(r&&!hu(r))),u(F instanceof Error?F.message:String(F)),_.stopRequested&&(k.current=!1,m(!1))),!1}finally{I()&&(O.current=!1,f(!1))}}async function T(){k.current=!0,m(!0),u(""),S.current&&(S.current.stopRequested=!0);const A=b.current;try{const P=(await ef.list(e)).find(I=>!hu(I));if(P){const I=await ef.stop(P.runId);A===b.current&&s(I)}else!O.current&&A===b.current&&(k.current=!1,m(!1))}catch(N){A===b.current&&(u(N instanceof Error?N.message:String(N)),m(!1),k.current=!1)}}async function R(){if(!r)return;const A=b.current;try{const N=await ef.resume(r.runId);A===b.current&&(s(N),u(""))}catch(N){A===b.current&&u(N instanceof Error?N.message:String(N))}}return{run:r,connection:o,error:c,submitting:d,stopPending:h,prepare:E,submit:j,stop:T,resume:R}}function oJ(e){return e?["stopping","waiting_user","failed","cancelled"].includes(e.state)?e.statusMessage:e.phase==="reporting"?Q("developmentRuns.reporting"):e.state==="recovering"?e.statusMessage:["outcome_read","delivery"].includes(e.phase)?Q("developmentRuns.packaging"):e.phase==="version"?Q("developmentRuns.savingVersion"):e.phase==="cycle_complete"?Q("developmentRuns.finishing"):e.statusMessage:""}function z2e(e){if(e==null||!Number.isFinite(e)||e<0)return Q("developmentRuns.notReported");const t=Math.round(e);if(t===0)return`<${Q("developmentRuns.durationUnits.milliseconds",{value:"1"})}`;if(t<1e3)return Q("developmentRuns.durationUnits.milliseconds",{value:t.toLocaleString(j8())});const n=Math.round(t/100);return[["hours",Math.floor(n/36e3)],["minutes",Math.floor(n%36e3/600)],["seconds",n%600/10]].filter(([,r])=>r>0).map(([r,s])=>Q(`developmentRuns.durationUnits.${r}`,{value:s.toLocaleString(j8(),{maximumFractionDigits:1})})).join(" ")}const C3=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},lJ=e=>typeof e=="string"?e.replace(/\s+/g," ").trim().slice(0,160):"";function V2e(e){var n;const t=C3(e.args);if(e.itemType==="dynamicToolCall"&&e.name==="submit_build_result")return Q("developmentRuns.submitResult");if(e.itemType==="commandExecution"){const i=Array.isArray(t.commandActions)?t.commandActions.map(C3):[],r=new Set(i.map(c=>c.type));if(i.length&&r.size===1){if(r.has("read"))return Q("developmentRuns.read",{target:"Read project files"});if(r.has("listFiles"))return Q("developmentRuns.listFiles",{target:"List directory"});if(r.has("search"))return Q("developmentRuns.search",{target:"Search project files"})}const s=typeof t.command=="string"?t.command:"",l=(n=[[/\b(?:pytest|vitest|jest)\b|\b(?:npm|pnpm|yarn) (?:run )?test\b/,"Run tests"],[/\b(?:npm|pnpm|yarn) (?:ci|install|add)\b|\b(?:pip|pip3|uv pip) install\b|\buv sync\b/,"Install dependencies"],[/\b(?:ruff|eslint|prettier|pyright|tsc)\b/,"Check code quality"],[/\b(?:npm|pnpm|yarn) (?:run )?build\b|\bpython[^;]* -m build\b/,"Build project"],[/\bgit (?:status|diff|log|show)\b/,"Inspect Git changes"],[/\bgit (?:add|commit)\b/,"Save Git changes"],[/\b(?:curl|wget)\b/,"Send HTTP request"],[/\bcompileall\b/,"Check Python syntax"]].find(([c])=>c.test(s)))==null?void 0:n[1];return l?Q("developmentRuns.command",{target:l}):e.name}if(e.itemType==="fileChange"){const i=Array.isArray(t.changes)?t.changes.map(r=>lJ(C3(r).path)).filter(Boolean):[];return Q("developmentRuns.editFiles",{target:i.join(", ")})}return e.itemType==="webSearch"?Q("developmentRuns.webSearch",{target:lJ(t.query)}):e.name}const tnt=e=>["tool","thinking","plan","diff"].includes(e.kind);function nnt(e){const t=[];return e.forEach((n,i)=>{if(n.kind==="progress")return;const r=tnt(n),s=t[t.length-1];r&&(s!=null&&s.process)?s.blocks.push(n):t.push({id:n.id||`${n.kind}:${i}`,process:r,blocks:[n]})}),t}const cJ="M 15 15 C 15 5, 25 5, 30 15 C 35 25, 45 25, 45 15 C 45 5, 35 5, 30 15 C 25 25, 15 25, 15 15";function o0({variant:e="infinity",size:t=e==="ring"?20:32,label:n="加载中",decorative:i=!1,className:r="",style:s}){const o=kD(),l=typeof t=="number"?t/2:`calc(${t} / 2)`,c=typeof t=="number"?t*3/40:`calc(${t} * 3 / 40)`;return a.jsxs("span",{className:`studio-loading studio-loading--${e} ${r}`.trim(),style:s,role:i?void 0:"status","aria-live":i?void 0:"polite","aria-hidden":i||void 0,children:[e==="infinity"?a.jsxs("svg",{className:"studio-loading__infinity",width:typeof t=="number"?t:void 0,height:typeof l=="number"?l:void 0,style:typeof t=="string"?{width:t,height:l}:void 0,viewBox:"0 0 60 30",fill:"none","aria-hidden":"true",children:[a.jsx("path",{className:"studio-loading__track",d:cJ,strokeWidth:"4",strokeLinecap:"round"}),a.jsx(Ar.path,{className:"studio-loading__path",d:cJ,strokeWidth:"4",strokeLinecap:"round",strokeDasharray:o?void 0:"100",initial:{strokeDashoffset:100},animate:{strokeDashoffset:o?0:[100,-100]},transition:{duration:o?0:2,repeat:o?0:1/0,ease:"linear"}})]}):a.jsx(Ar.div,{className:"studio-loading__ring",style:{width:t,height:t,borderWidth:c},"aria-hidden":"true",animate:{rotate:o?0:360},transition:{duration:o?0:1,repeat:o?0:1/0,ease:"linear"}}),!i&&a.jsx("span",{className:"studio-loading__label",children:n})]})}function Ki({className:e="",type:t="button",variant:n="primary",size:i="default",startIcon:r,endIcon:s,iconOnly:o=!1,hoverEffect:l="background",loading:c=!1,disabled:u,children:d,...f}){return a.jsxs("button",{...f,type:t,disabled:u||c,"aria-busy":c||f["aria-busy"],"data-hover-effect":o?l:void 0,className:`studio-button studio-button--${n} studio-button--size-${i}${o?" studio-button--icon-only":""}${c?" studio-button--loading":""} ${e}`.trim(),children:[r&&a.jsx("span",{className:"studio-button__icon","aria-hidden":"true",children:r}),!o&&a.jsx("span",{className:"studio-button__label",children:d}),!o&&s&&a.jsx("span",{className:"studio-button__icon studio-button__end-icon","aria-hidden":"true",children:s}),c&&a.jsx("span",{className:"studio-button__loading","aria-hidden":"true",children:a.jsx(o0,{variant:"ring",size:"var(--studio-button-icon-size)",decorative:!0})})]})}function int({variant:e,...t}){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:e==="warning"?a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"m10.3 4.5-7.6 13a2 2 0 0 0 1.7 3h15.2a2 2 0 0 0 1.7-3l-7.6-13a2 2 0 0 0-3.4 0Z"}),a.jsx("path",{d:"M12 9v4m0 3.5h.01"})]}):a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"12",cy:"12",r:"8.5"}),e==="success"?a.jsx("path",{d:"m8 12 2.7 2.7L16 9.4"}):e==="error"?a.jsx("path",{d:"m9.2 9.2 5.6 5.6m0-5.6-5.6 5.6"}):a.jsx("path",{d:"M12 11v5m0-8h.01"})]})})}function rnt(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m7 7 10 10M17 7 7 17"})})}function snt({variant:e="info",title:t,description:n,action:i,onDismiss:r,closeLabel:s="关闭通知",className:o="",role:l="status",...c}){return a.jsxs("div",{...c,role:l,className:`studio-toast ${o}`.trim(),"data-variant":e,children:[a.jsx(int,{variant:e,className:"studio-toast__status"}),a.jsxs("div",{className:"studio-toast__content",children:[t!=null&&a.jsx("div",{className:"studio-toast__title",children:t}),n!=null&&a.jsx("div",{className:"studio-toast__description",children:n}),i!=null&&a.jsx("div",{className:"studio-toast__action",children:i})]}),r&&a.jsx(Ki,{variant:"ghost",iconOnly:!0,startIcon:a.jsx(rnt,{}),"aria-label":s,onClick:r,className:"studio-toast__close"})]})}function Bz(){}const ant=Object.freeze([]),rc=Object.freeze({});function LD(e){p.useEffect(e,ant)}const uJ={};function Cd(e,t){const n=p.useRef(uJ);return n.current===uJ&&(n.current=e(t)),n}const ont=()=>{},Jn=typeof document<"u"?p.useLayoutEffect:ont;function lnt(e,t){return function(i,...r){const s=new URL(e);return s.searchParams.set("code",i.toString()),r.forEach(o=>s.searchParams.append("args[]",o)),`${t} error #${i}; visit ${s} for the full message.`}}const Vc=lnt("https://base-ui.com/production-error","Base UI"),H2e=p.createContext(void 0);function Uz(){const e=p.useContext(H2e);if(!e)throw new Error(Vc(73));return e}var q2e={exports:{}},W2e={};/** +data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type==="run.input"||t.type==="run.input_status")&&n.status==="delivered"&&typeof n.turnId=="string"&&typeof n.clientId=="string"&&this.nativeInputs.set(n.turnId,n.clientId),this.decorate(),this.cursor=t.seq}decorate(){const t=!pu(this.run)&&this.run.state!=="waiting_user",n=[...this.turns].reverse().find(i=>i.role==="assistant");for(const i of this.turns)i.role==="assistant"&&(i.meta={...i.meta,streaming:t&&i===n});for(const i of this.metrics.values()){if(!["completed","failed","interrupted","cancelled","unavailable"].includes(i.status))continue;const r=new Map;for(const u of this.turns)for(const d of u.blocks)d.kind==="tool"&&d.turnId===i.turnId&&d.id&&r.set(d.id,d);const s=[...r.values()].filter(u=>typeof u.durationMs=="number"&&Number.isFinite(u.durationMs)&&u.durationMs>=0),o={...i,toolCalls:r.size,toolDurationComplete:s.length===r.size,toolDurationMs:s.length||!r.size?s.reduce((u,d)=>u+d.durationMs,0):void 0},l=this.nativeInputs.get(i.turnId),c=this.turns.find(u=>{var d;return((d=u.meta)==null?void 0:d.localId)===`${l}:assistant`});if(c){const u=c.blocks.reduce((d,f,h)=>f.turnId===i.turnId?h:d,-1);c.blocks.splice(u<0?c.blocks.length:u+1,0,{kind:"turn-summary",id:`${i.turnId}:summary`,turnId:i.turnId,value:o})}}}}function Ytt(e,t){return new Promise((n,i)=>{if(t.aborted){i(new DOMException("Aborted","AbortError"));return}const r=()=>{clearTimeout(s),i(new DOMException("Aborted","AbortError"))},s=setTimeout(()=>{t.removeEventListener("abort",r),n()},e);t.addEventListener("abort",r,{once:!0})})}async function Ztt(e,t,n){var c;const i=await yn(`${Q2e}/runs/${encodeURIComponent(e.run.runId)}/events?after=${e.cursor}`,{signal:t,headers:ps({Accept:"text/event-stream"})},0);if(!i.ok)throw new Kw(Q("developmentRuns.requestFailed"),i.status);if(!i.body)throw new Error(Q("developmentRuns.invalidResponse"));const r=i.body.getReader(),s=new TextDecoder;let o="",l=!1;try{for(;;){const{value:u,done:d}=await r.read();o+=s.decode(u,{stream:!d});const f=o.split(/\r?\n\r?\n/);o=f.pop()||"";for(const h of f){const m=h.split(/\r?\n/),g=(c=m.find(y=>y.startsWith("event:")))==null?void 0:c.slice(6).trim();if(g==="done"){l=!0;continue}const b=m.filter(y=>y.startsWith("data:")).map(y=>y.slice(5).trimStart()).join(` +`);if(!g||!b)continue;const v=JSON.parse(b);if(!Number.isSafeInteger(v.seq))throw new Error(Q("developmentRuns.invalidResponse"));e.apply({seq:v.seq,type:g,payload:v})}if(n(),d)break}if(!l)throw new Error(Q("developmentRuns.reconnecting"))}finally{await r.cancel().catch(()=>{}),r.releaseLock()}}async function Jtt(e,t,n,i,r){const s=new Map;let o=0;const l=new Map;let c;r==null||r(h=>{t.aborted||h.sessionId!==e||(l.set(h.runId,h),c==null||c())});const u=h=>new Promise(m=>{const g=()=>{clearTimeout(b),t.removeEventListener("abort",g),c=void 0,m()},b=setTimeout(g,h);c=g,t.addEventListener("abort",g,{once:!0}),(t.aborted||l.size)&&g()}),d=new Map,f=()=>{var m;if(t.aborted)return;const h=[...s.values()];n(h.flatMap(g=>{let b=d.get(g);return(!b||b.cursor!==g.cursor)&&(b={cursor:g.cursor,turns:g.turns.map(v=>({...v}))},d.set(g,b)),b.turns}),((m=h[h.length-1])==null?void 0:m.run)||null)};for(;!t.aborted;)try{const h=l.size?[]:await Jd.list(e,t),m=[...new Map([...h,...l.values()].map(g=>[g.runId,g])).values()];l.clear();for(const g of m){let b=s.get(g.runId);if(b||(b=new Xtt(g),s.set(g.runId,b)),b.cursor>=g.lastSeq&&(b.run=g),b.cursor{o=0,i(""),f()})}catch(v){if(!(v instanceof Kw&&v.status===404&&pu(g)))throw v}}o=0,i(""),f(),await u(1500)}catch(h){if(t.aborted)return;if(h instanceof Kw&&[401,403,404].includes(h.status))throw h;i(Q("developmentRuns.reconnecting")),await Ytt(Math.min(1e3*2**o++,15e3),t)}}function ent({sessionId:e,ownerId:t,onTurns:n,onBusy:i}){const[r,s]=p.useState(null),[o,l]=p.useState(""),[c,u]=p.useState(""),[d,f]=p.useState(!1),[h,m]=p.useState(!1),g=p.useRef({onTurns:n,onBusy:i});g.current={onTurns:n,onBusy:i};const b=p.useRef(0),v=p.useRef([]),y=p.useRef([]),w=p.useRef(null),x=()=>{const A=new Set(v.current.map(N=>{var P;return(P=N.meta)==null?void 0:P.localId}));y.current=y.current.filter(N=>{var P;return!A.has((P=N.meta)==null?void 0:P.localId)}),g.current.onTurns([...v.current,...y.current])},O=p.useRef(!1),k=p.useRef(!1),S=p.useRef(null),C=p.useRef({sessionId:e,ownerId:t});C.current={sessionId:e,ownerId:t},p.useEffect(()=>{b.current+=1,s(null),u(""),l(""),v.current=[],w.current=null;const A=S.current;if(((A==null?void 0:A.session)!==e||A.owner!==t)&&(y.current=[],m(!1),k.current=!1,S.current=null,O.current=!1,f(!1)),e&&x(),!e||!t)return;const N=new AbortController,P=()=>!N.signal.aborted&&C.current.sessionId===e&&C.current.ownerId===t;return Jtt(e,N.signal,(I,D)=>{P()&&(v.current=I,x(),s(D),g.current.onBusy(O.current||!!(D&&!pu(D))),D&&pu(D)&&(m(!1),k.current=!1))},I=>{P()&&l(I)},I=>{P()&&(w.current=I)}).catch(I=>{P()&&u(I instanceof Error?I.message:String(I))}),()=>N.abort()},[e,t]);function E(A,N=e){const P=C.current.ownerId;let I=S.current;return(!I||I.session!==N||I.owner!==P||I.text!==A)&&(I={session:N,owner:P,text:A,id:crypto.randomUUID()},S.current=I),y.current.some(D=>{var _;return((_=D.meta)==null?void 0:_.localId)===`${I.id}:user`})||y.current.push({role:"user",blocks:[{kind:"text",text:A}],meta:{localId:`${I.id}:user`}},{role:"assistant",blocks:[{kind:"progress",text:Q(r&&!pu(r)?"developmentRuns.processing":"developmentRuns.preparing")}],meta:{localId:`${I.id}:assistant`}}),[...y.current]}async function j(A,N=e){var L;if(!A.trim()||O.current||k.current)return!1;O.current=!0,f(!0),u("");const P=C.current.ownerId,I=()=>C.current.ownerId===P&&C.current.sessionId===N;E(A,N),x(),g.current.onBusy(!0);const D=S.current,_=(D==null?void 0:D.session)===N&&D.owner===P&&D.text===A?D:{session:N,owner:P,text:A,id:crypto.randomUUID(),runId:void 0,stopRequested:!1};S.current=_;try{const F=await Jd.list(N),M=F[F.length-1];if(!I())return!1;!_.runId&&M&&!pu(M)&&M.requestId!==_.id&&(_.runId=M.runId);let V;return _.runId?(await Jd.steer(_.runId,A,_.id),V=await Jd.get(_.runId)):V=await Jd.create(N,A,_.id),(_.stopRequested||I()&&k.current)&&(V=await Jd.stop(V.runId)),I()&&(s(V),(L=w.current)==null||L.call(w,V),g.current.onBusy(!pu(V)),S.current=null),!0}catch(F){return I()&&(g.current.onBusy(!!(r&&!pu(r))),u(F instanceof Error?F.message:String(F)),_.stopRequested&&(k.current=!1,m(!1))),!1}finally{I()&&(O.current=!1,f(!1))}}async function T(){k.current=!0,m(!0),u(""),S.current&&(S.current.stopRequested=!0);const A=b.current;try{const P=(await Jd.list(e)).find(I=>!pu(I));if(P){const I=await Jd.stop(P.runId);A===b.current&&s(I)}else!O.current&&A===b.current&&(k.current=!1,m(!1))}catch(N){A===b.current&&(u(N instanceof Error?N.message:String(N)),m(!1),k.current=!1)}}async function R(){if(!r)return;const A=b.current;try{const N=await Jd.resume(r.runId);A===b.current&&(s(N),u(""))}catch(N){A===b.current&&u(N instanceof Error?N.message:String(N))}}return{run:r,connection:o,error:c,submitting:d,stopPending:h,prepare:E,submit:j,stop:T,resume:R}}function oJ(e){return e?["stopping","waiting_user","failed","cancelled"].includes(e.state)?e.statusMessage:e.phase==="reporting"?Q("developmentRuns.reporting"):e.state==="recovering"?e.statusMessage:["outcome_read","delivery"].includes(e.phase)?Q("developmentRuns.packaging"):e.phase==="version"?Q("developmentRuns.savingVersion"):e.phase==="cycle_complete"?Q("developmentRuns.finishing"):e.statusMessage:""}function z2e(e){if(e==null||!Number.isFinite(e)||e<0)return Q("developmentRuns.notReported");const t=Math.round(e);if(t===0)return`<${Q("developmentRuns.durationUnits.milliseconds",{value:"1"})}`;if(t<1e3)return Q("developmentRuns.durationUnits.milliseconds",{value:t.toLocaleString(j8())});const n=Math.round(t/100);return[["hours",Math.floor(n/36e3)],["minutes",Math.floor(n%36e3/600)],["seconds",n%600/10]].filter(([,r])=>r>0).map(([r,s])=>Q(`developmentRuns.durationUnits.${r}`,{value:s.toLocaleString(j8(),{maximumFractionDigits:1})})).join(" ")}const C3=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},lJ=e=>typeof e=="string"?e.replace(/\s+/g," ").trim().slice(0,160):"";function V2e(e){var n;const t=C3(e.args);if(e.itemType==="dynamicToolCall"&&e.name==="submit_build_result")return Q("developmentRuns.submitResult");if(e.itemType==="commandExecution"){const i=Array.isArray(t.commandActions)?t.commandActions.map(C3):[],r=new Set(i.map(c=>c.type));if(i.length&&r.size===1){if(r.has("read"))return Q("developmentRuns.read",{target:"Read project files"});if(r.has("listFiles"))return Q("developmentRuns.listFiles",{target:"List directory"});if(r.has("search"))return Q("developmentRuns.search",{target:"Search project files"})}const s=typeof t.command=="string"?t.command:"",l=(n=[[/\b(?:pytest|vitest|jest)\b|\b(?:npm|pnpm|yarn) (?:run )?test\b/,"Run tests"],[/\b(?:npm|pnpm|yarn) (?:ci|install|add)\b|\b(?:pip|pip3|uv pip) install\b|\buv sync\b/,"Install dependencies"],[/\b(?:ruff|eslint|prettier|pyright|tsc)\b/,"Check code quality"],[/\b(?:npm|pnpm|yarn) (?:run )?build\b|\bpython[^;]* -m build\b/,"Build project"],[/\bgit (?:status|diff|log|show)\b/,"Inspect Git changes"],[/\bgit (?:add|commit)\b/,"Save Git changes"],[/\b(?:curl|wget)\b/,"Send HTTP request"],[/\bcompileall\b/,"Check Python syntax"]].find(([c])=>c.test(s)))==null?void 0:n[1];return l?Q("developmentRuns.command",{target:l}):e.name}if(e.itemType==="fileChange"){const i=Array.isArray(t.changes)?t.changes.map(r=>lJ(C3(r).path)).filter(Boolean):[];return Q("developmentRuns.editFiles",{target:i.join(", ")})}return e.itemType==="webSearch"?Q("developmentRuns.webSearch",{target:lJ(t.query)}):e.name}const tnt=e=>["tool","thinking","plan","diff"].includes(e.kind);function nnt(e){const t=[];return e.forEach((n,i)=>{if(n.kind==="progress")return;const r=tnt(n),s=t[t.length-1];r&&(s!=null&&s.process)?s.blocks.push(n):t.push({id:n.id||`${n.kind}:${i}`,process:r,blocks:[n]})}),t}const cJ="M 15 15 C 15 5, 25 5, 30 15 C 35 25, 45 25, 45 15 C 45 5, 35 5, 30 15 C 25 25, 15 25, 15 15";function u0({variant:e="infinity",size:t=e==="ring"?20:32,label:n="加载中",decorative:i=!1,className:r="",style:s}){const o=SD(),l=typeof t=="number"?t/2:`calc(${t} / 2)`,c=typeof t=="number"?t*3/40:`calc(${t} * 3 / 40)`;return a.jsxs("span",{className:`studio-loading studio-loading--${e} ${r}`.trim(),style:s,role:i?void 0:"status","aria-live":i?void 0:"polite","aria-hidden":i||void 0,children:[e==="infinity"?a.jsxs("svg",{className:"studio-loading__infinity",width:typeof t=="number"?t:void 0,height:typeof l=="number"?l:void 0,style:typeof t=="string"?{width:t,height:l}:void 0,viewBox:"0 0 60 30",fill:"none","aria-hidden":"true",children:[a.jsx("path",{className:"studio-loading__track",d:cJ,strokeWidth:"4",strokeLinecap:"round"}),a.jsx(Cr.path,{className:"studio-loading__path",d:cJ,strokeWidth:"4",strokeLinecap:"round",strokeDasharray:o?void 0:"100",initial:{strokeDashoffset:100},animate:{strokeDashoffset:o?0:[100,-100]},transition:{duration:o?0:2,repeat:o?0:1/0,ease:"linear"}})]}):a.jsx(Cr.div,{className:"studio-loading__ring",style:{width:t,height:t,borderWidth:c},"aria-hidden":"true",animate:{rotate:o?0:360},transition:{duration:o?0:1,repeat:o?0:1/0,ease:"linear"}}),!i&&a.jsx("span",{className:"studio-loading__label",children:n})]})}function Wi({className:e="",type:t="button",variant:n="primary",size:i="default",startIcon:r,endIcon:s,iconOnly:o=!1,hoverEffect:l="background",loading:c=!1,disabled:u,children:d,...f}){return a.jsxs("button",{...f,type:t,disabled:u||c,"aria-busy":c||f["aria-busy"],"data-hover-effect":o?l:void 0,className:`studio-button studio-button--${n} studio-button--size-${i}${o?" studio-button--icon-only":""}${c?" studio-button--loading":""} ${e}`.trim(),children:[r&&a.jsx("span",{className:"studio-button__icon","aria-hidden":"true",children:r}),!o&&a.jsx("span",{className:"studio-button__label",children:d}),!o&&s&&a.jsx("span",{className:"studio-button__icon studio-button__end-icon","aria-hidden":"true",children:s}),c&&a.jsx("span",{className:"studio-button__loading","aria-hidden":"true",children:a.jsx(u0,{variant:"ring",size:"var(--studio-button-icon-size)",decorative:!0})})]})}function int({variant:e,...t}){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:e==="warning"?a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"m10.3 4.5-7.6 13a2 2 0 0 0 1.7 3h15.2a2 2 0 0 0 1.7-3l-7.6-13a2 2 0 0 0-3.4 0Z"}),a.jsx("path",{d:"M12 9v4m0 3.5h.01"})]}):a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"12",cy:"12",r:"8.5"}),e==="success"?a.jsx("path",{d:"m8 12 2.7 2.7L16 9.4"}):e==="error"?a.jsx("path",{d:"m9.2 9.2 5.6 5.6m0-5.6-5.6 5.6"}):a.jsx("path",{d:"M12 11v5m0-8h.01"})]})})}function rnt(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m7 7 10 10M17 7 7 17"})})}function snt({variant:e="info",title:t,description:n,action:i,onDismiss:r,closeLabel:s="关闭通知",className:o="",role:l="status",...c}){return a.jsxs("div",{...c,role:l,className:`studio-toast ${o}`.trim(),"data-variant":e,children:[a.jsx(int,{variant:e,className:"studio-toast__status"}),a.jsxs("div",{className:"studio-toast__content",children:[t!=null&&a.jsx("div",{className:"studio-toast__title",children:t}),n!=null&&a.jsx("div",{className:"studio-toast__description",children:n}),i!=null&&a.jsx("div",{className:"studio-toast__action",children:i})]}),r&&a.jsx(Wi,{variant:"ghost",iconOnly:!0,startIcon:a.jsx(rnt,{}),"aria-label":s,onClick:r,className:"studio-toast__close"})]})}function Bz(){}const ant=Object.freeze([]),nc=Object.freeze({});function $D(e){p.useEffect(e,ant)}const uJ={};function Ed(e,t){const n=p.useRef(uJ);return n.current===uJ&&(n.current=e(t)),n}const ont=()=>{},Jn=typeof document<"u"?p.useLayoutEffect:ont;function lnt(e,t){return function(i,...r){const s=new URL(e);return s.searchParams.set("code",i.toString()),r.forEach(o=>s.searchParams.append("args[]",o)),`${t} error #${i}; visit ${s} for the full message.`}}const Vc=lnt("https://base-ui.com/production-error","Base UI"),H2e=p.createContext(void 0);function Uz(){const e=p.useContext(H2e);if(!e)throw new Error(Vc(73));return e}var q2e={exports:{}},W2e={};/** * @license React * use-sync-external-store-shim/with-selector.production.js * @@ -137,8 +137,8 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var $D=p,cnt=YP;function unt(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var dnt=typeof Object.is=="function"?Object.is:unt,fnt=cnt.useSyncExternalStore,hnt=$D.useRef,pnt=$D.useEffect,mnt=$D.useMemo,gnt=$D.useDebugValue;W2e.useSyncExternalStoreWithSelector=function(e,t,n,i,r){var s=hnt(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=mnt(function(){function c(m){if(!u){if(u=!0,d=m,m=i(m),r!==void 0&&o.hasValue){var g=o.value;if(r(g,m))return f=g}return f=m}if(g=f,dnt(d,m))return g;var b=i(m);return r!==void 0&&r(g,b)?(d=m,g):(d=m,f=b)}var u=!1,d,f,h=n===void 0?null:n;return[function(){return c(t())},h===null?void 0:function(){return c(h())}]},[t,n,i,r]);var l=fnt(e,s[0],s[1]);return pnt(function(){o.hasValue=!0,o.value=l},[l]),gnt(l),l};q2e.exports=W2e;var K2e=q2e.exports;const bnt=C1(K2e),ynt=parseInt(p.version,10);function Qz(e){return ynt>=e}const vnt=Qz(19),xnt=vnt?Ont:knt;function G2e(e,t,n,i,r){return xnt(e,t,n,i,r)}function wnt(e,t,n,i,r){const s=p.useCallback(()=>t(e.getSnapshot(),n,i,r),[e,t,n,i,r]);return YP.useSyncExternalStore(e.subscribe,s,s)}function Ont(e,t,n,i,r){return wnt(e,t,n,i,r)}function knt(e,t,n,i,r){return K2e.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,i,r))}class Snt{constructor(t){Zt(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));Zt(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const i of this.listeners){if(n!==this.updateTick)return;i(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,i,r){return G2e(this,t,n,i,r)}}const zz={...j0},A3=zz.useInsertionEffect,Ent=A3&&A3!==zz.useLayoutEffect?A3:e=>e();function li(e){const t=Cd(Cnt).current;return t.next=e,Ent(t.effect),t.trampoline}function Cnt(){const e={next:void 0,callback:Ant,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function Ant(){}class FD extends Snt{constructor(t,n={},i){super(t),this.context=n,this.selectors=i}useSyncedValue(t,n){p.useDebugValue(t);const i=this;Jn(()=>{i.state[t]!==n&&i.set(t,n)},[i,t,n])}useSyncedValueWithCleanup(t,n){const i=this;Jn(()=>(i.state[t]!==n&&i.set(t,n),()=>{i.set(t,void 0)}),[i,t,n])}useSyncedValues(t){const n=this,i=Object.values(t);Jn(()=>{n.update(t)},[n,...i])}useControlledProp(t,n){p.useDebugValue(t);const i=this,r=n!==void 0;Jn(()=>{r&&!Object.is(i.state[t],n)&&i.setState({...i.state,[t]:n})},[i,t,n,r])}select(t,n,i,r){const s=this.selectors[t];return s(this.state,n,i,r)}useState(t,n,i,r){return p.useDebugValue(t),G2e(this,this.selectors[t],n,i,r)}useContextCallback(t,n){p.useDebugValue(t);const i=li(n??Bz);this.context[t]=i}useStateSetter(t){const n=p.useRef(void 0);return n.current===void 0&&(n.current=i=>{this.set(t,i)}),n.current}observe(t,n){let i;typeof t=="function"?i=t:i=this.selectors[t];let r=i(this.state);return n(r,r,this),this.subscribe(s=>{const o=i(s);if(!Object.is(r,o)){const l=r;r=o,n(o,l,this)}})}}function BD(){return typeof window<"u"}function ll(e){return Vz(e)?(e.nodeName||"").toLowerCase():"#document"}function na(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function pm(e){var t;return(t=(Vz(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Vz(e){return BD()?e instanceof Node||e instanceof na(e).Node:!1}function Cr(e){return BD()?e instanceof Element||e instanceof na(e).Element:!1}function ea(e){return BD()?e instanceof HTMLElement||e instanceof na(e).HTMLElement:!1}function Ww(e){return!BD()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof na(e).ShadowRoot}function MA(e){const{overflow:t,overflowX:n,overflowY:i,display:r}=Du(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&r!=="inline"&&r!=="contents"}function Tnt(e){return/^(table|td|th)$/.test(ll(e))}function UD(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const _nt=/transform|translate|scale|rotate|perspective|filter/,jnt=/paint|layout|strict|content/,qb=e=>!!e&&e!=="none";let T3;function Hz(e){const t=Cr(e)?Du(e):e;return qb(t.transform)||qb(t.translate)||qb(t.scale)||qb(t.rotate)||qb(t.perspective)||!qz()&&(qb(t.backdropFilter)||qb(t.filter))||_nt.test(t.willChange||"")||jnt.test(t.contain||"")}function Nnt(e){let t=Yg(e);for(;ea(t)&&!Pg(t);){if(Hz(t))return t;if(UD(t))return null;t=Yg(t)}return null}function qz(){return T3==null&&(T3=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),T3}function Pg(e){return/^(html|body|#document)$/.test(ll(e))}function Du(e){return na(e).getComputedStyle(e)}function QD(e){return Cr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Yg(e){if(ll(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ww(e)&&e.host||pm(e);return Ww(t)?t.host:t}function X2e(e){const t=Yg(e);return Pg(t)?(e.ownerDocument||e).body:ea(t)&&MA(t)?t:X2e(t)}function nC(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=X2e(e),s=r===((i=e.ownerDocument)==null?void 0:i.body),o=na(r);if(s){const l=Y8(o);return t.concat(o,o.visualViewport||[],MA(r)?r:[],l&&n?nC(l):[])}else return t.concat(r,nC(r,[],n))}function Y8(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function mh(...e){return()=>{for(let t=0;t{e.removeEventListener(t,n,i)}}const Y2=null;let Rnt=class{constructor(){Zt(this,"callbacks",[]);Zt(this,"callbacksCount",0);Zt(this,"nextId",1);Zt(this,"startId",1);Zt(this,"isScheduled",!1);Zt(this,"tick",t=>{var r;this.isScheduled=!1;const n=this.callbacks,i=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,i>0)for(let s=0;s=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}},Z2=new Rnt;class _c{constructor(){Zt(this,"currentId",Y2);Zt(this,"cancel",()=>{this.currentId!==Y2&&(Z2.cancel(this.currentId),this.currentId=Y2)});Zt(this,"disposeEffect",()=>this.cancel)}static create(){return new _c}static request(t){return Z2.request(t)}static cancel(t){return Z2.cancel(t)}request(t){this.cancel(),this.currentId=Z2.request(()=>{this.currentId=Y2,t()})}}function Wz(){const e=Cd(_c.create).current;return LD(e.disposeEffect),e}const rk=0;class Mu{constructor(){Zt(this,"currentId",rk);Zt(this,"clear",()=>{this.currentId!==rk&&(clearTimeout(this.currentId),this.currentId=rk)});Zt(this,"disposeEffect",()=>this.clear)}static create(){return new Mu}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=rk,n()},t)}isStarted(){return this.currentId!==rk}}function l0(){const e=Cd(Mu.create).current;return LD(e.disposeEffect),e}let dJ=0;function Int(e){return dJ+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${dJ}`}function _3(e,t){if(typeof e=="string")return{description:e};if(typeof e=="function"){const n=e(t);return typeof n=="string"?{description:n}:n}return e}function Pnt(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:Dnt,platform:Mnt,maxTouchPoints:Lnt}=Pnt(),zD=Dnt.toLowerCase(),iC=Mnt.toLowerCase(),VD=/^i(os$|p)/.test(iC)||iC==="macintel"&&Lnt>1,fJ="android",Z8=iC===fJ||zD.includes(fJ),$nt=!VD&&iC.startsWith("mac");iC.startsWith("win");const Fnt=$nt||VD;var Cue;const U1=typeof CSS<"u"&&!!((Cue=CSS.supports)!=null&&Cue.call(CSS,"-webkit-backdrop-filter:none"));!U1&&zD.includes("firefox");!U1&&zD.includes("chrom");const Bnt=Fnt,Y2e=/jsdom|happydom/.test(zD),J8="data-base-ui-focusable",Z2e="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Ac(e){var n;let t=e.activeElement;for(;((n=t==null?void 0:t.shadowRoot)==null?void 0:n.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function ii(e,t){var i;if(!e||!t)return!1;const n=(i=t.getRootNode)==null?void 0:i.call(t);if(e.contains(t))return!0;if(n&&Ww(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function uo(e){return"composedPath"in e?e.composedPath()[0]:e.target}function J2e(e,t){if(!Cr(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,i]of t.entries())if(ii(i,n))return!i.hasAttribute("data-trigger-disabled");return!1}function j3(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Unt(e){return e.matches("html,body")}function Kz(e){return ea(e)&&e.matches(Z2e)}function Qnt(e){return(e==null?void 0:e.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Z2e}`))!=null}function hJ(e){return e?e.getAttribute("role")==="combobox"&&Kz(e):!1}function eB(e){if(!e||Y2e)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function pJ(e){return e?e.hasAttribute(J8)?e:e.querySelector(`[${J8}]`)||e:null}function Zg(e,t,n=!0){return e.filter(r=>r.parentId===t).flatMap(r=>{var s;return[...!n||(s=r.context)!=null&&s.open?[r]:[],...Zg(e,r.id,n)]})}function mJ(e,t){var r;let n=[],i=(r=e.find(s=>s.id===t))==null?void 0:r.parentId;for(;i;){const s=e.find(o=>o.id===i);i=s==null?void 0:s.parentId,s&&(n=n.concat(s))}return n}function znt(e){e.preventDefault(),e.stopPropagation()}function Vnt(e){return"nativeEvent"in e}function Hnt(e){return e.pointerType===""&&e.isTrusted?!0:Z8&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function e_e(e){return Y2e?!1:!Z8&&e.width===0&&e.height===0||Z8&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function tw(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function qnt(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const Wnt=["top","right","bottom","left"],Jg=Math.min,Dp=Math.max,tI=Math.round,J2=Math.floor,Mp=e=>({x:e,y:e}),Knt={left:"right",right:"left",bottom:"top",top:"bottom"};function Gz(e,t,n){return Dp(e,Jg(t,n))}function wh(e,t){return typeof e=="function"?e(t):e}function xd(e){return e.split("-")[0]}function mm(e){return e.split("-")[1]}function Xz(e){return e==="x"?"y":"x"}function HD(e){return e==="y"?"height":"width"}function fd(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function qD(e){return Xz(fd(e))}function Gnt(e,t,n){n===void 0&&(n=!1);const i=mm(e),r=qD(e),s=HD(r);let o=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=nI(o)),[o,nI(o)]}function Xnt(e){const t=nI(e);return[tB(e),t,tB(t)]}function tB(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const gJ=["left","right"],bJ=["right","left"],Ynt=["top","bottom"],Znt=["bottom","top"];function Jnt(e,t,n){switch(e){case"top":case"bottom":return n?t?bJ:gJ:t?gJ:bJ;case"left":case"right":return t?Ynt:Znt;default:return[]}}function eit(e,t,n,i){const r=mm(e);let s=Jnt(xd(e),n==="start",i);return r&&(s=s.map(o=>o+"-"+r),t&&(s=s.concat(s.map(tB)))),s}function nI(e){const t=xd(e);return Knt[t]+e.slice(t.length)}function tit(e){var t,n,i,r;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(i=e.bottom)!=null?i:0,left:(r=e.left)!=null?r:0}}function Yz(e){return typeof e!="number"?tit(e):{top:e,right:e,bottom:e,left:e}}function iI(e){const{x:t,y:n,width:i,height:r}=e;return{width:i,height:r,top:n,left:t,right:t+i,bottom:n+r,x:t,y:n}}function nit(e){return e.visibility==="hidden"||e.visibility==="collapse"}function t_e(e,t=e?Du(e):null){return!e||!e.isConnected||!t||nit(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const iit='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function rit(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return Ww(n)?n.host:null}function nB(e){for(const t of Array.from(e.children))if(ll(t)==="summary")return t;return null}function sit(e,t){const n=nB(t);return!!n&&(e===n||ii(n,e))}function n_e(e){const t=e?ll(e):"";return e!=null&&e.matches(iit)&&(t!=="summary"||e.parentElement!=null&&ll(e.parentElement)==="details"&&nB(e.parentElement)===e)&&(t!=="details"||nB(e)==null)&&(t!=="input"||e.type!=="hidden")}function i_e(e){if(!n_e(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=rit(t)){const n=t!==e,i=ll(t)==="slot";if(t.hasAttribute("inert")||n&&ll(t)==="details"&&!t.open&&!sit(e,t)||t.hasAttribute("hidden")||!i&&!ait(t,n))return!1}return!0}function ait(e,t){const n=Du(e);return t?n.display!=="none":t_e(e,n)}function r_e(e){const t=e.tabIndex;if(t<0){const n=ll(e);if(n==="details"||n==="audio"||n==="video"||ea(e)&&e.isContentEditable)return 0}return t}function N3(e){if(ll(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function oit(e,t){const n=N3(e);if(!n)return!0;const i=t.find(r=>{const s=N3(r);return(s==null?void 0:s.name)===n.name&&s.form===n.form&&s.checked});return i?i===n:t.find(r=>{const s=N3(r);return(s==null?void 0:s.name)===n.name&&s.form===n.form})===n}function s_e(e){if(ea(e)&&ll(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return ea(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function a_e(e,t){s_e(e).forEach(n=>{n_e(n)&&t.push(n),a_e(n,t)})}function o_e(e,t,n){s_e(e).forEach(i=>{ea(i)&&i.matches(t)&&n.push(i),o_e(i,t,n)})}function Zz(e){return i_e(e)&&r_e(e)>=0}function l_e(e){const t=[];return a_e(e,t),t.filter(i_e)}function LA(e){const t=l_e(e);return t.filter(n=>r_e(n)>=0&&oit(n,t))}function c_e(e,t){const n=LA(e),i=n.length;if(i===0)return;const r=Ac(Sr(e)),s=n.indexOf(r),o=s===-1?t===1?0:i-1:s+t;return n[o]}function Jz(e){return c_e(Sr(e).body,1)||e}function u_e(e){return c_e(Sr(e).body,-1)||e}function d_e(e,t){if(!e)return null;const n=LA(Sr(e).body),i=n.length;if(i===0)return null;const r=n.indexOf(e);if(r===-1)return null;const s=(r+t+i)%i;return n[s]}function lit(e){return d_e(e,1)}function cit(e){return d_e(e,-1)}function nw(e,t){const n=t||e.currentTarget,i=e.relatedTarget;return!i||!ii(n,i)}function uit(e){LA(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function yJ(e){const t=[];o_e(e,"[data-tabindex]",t),t.forEach(n=>{const i=n.dataset.tabindex;delete n.dataset.tabindex,i?n.setAttribute("tabindex",i):n.removeAttribute("tabindex")})}function R3(e){const t=new Map;let n=0,i=0;return e.forEach((r,s)=>{const o=r.transitionStatus==="ending";t.set(r.id,{value:r,domIndex:s,visibleIndex:o?-1:n,offsetY:i}),i+=r.height||0,o||(n+=1)}),t}function I3(e,t){let n=0;return e.map(i=>{if(i.transitionStatus==="ending")return i;const r=n>=t;return n+=1,i.limited===r?i:{...i,limited:r}})}const Ff={toasts:e=>e.toasts,isEmpty:e=>e.toasts.length===0,toast:(e,t)=>{var n;return(n=e.toastMetadata.get(t))==null?void 0:n.value},toastIndex:(e,t)=>{var n;return((n=e.toastMetadata.get(t))==null?void 0:n.domIndex)??-1},toastOffsetY:(e,t)=>{var n;return((n=e.toastMetadata.get(t))==null?void 0:n.offsetY)??0},toastVisibleIndex:(e,t)=>{var n;return((n=e.toastMetadata.get(t))==null?void 0:n.visibleIndex)??-1},focused:e=>e.focused,expanded:e=>e.hovering||e.focused,expandedOrOutOfFocus:e=>e.hovering||e.focused||!e.isWindowFocused,prevFocusElement:e=>e.prevFocusElement};class dit extends FD{constructor(n){super({...n,toastMetadata:R3(n.toasts)},{},Ff);Zt(this,"timers",new Map);Zt(this,"areTimersPaused",!1);Zt(this,"setViewport",n=>{this.set("viewport",n)});Zt(this,"disposeEffect",()=>()=>{this.timers.forEach(n=>{var i;(i=n.timeout)==null||i.clear()}),this.timers.clear()});Zt(this,"addToast",n=>{const{timeout:i,limit:r}=this.state,s=n.id||Int("toast");if(n.id){const u=Ff.toast(this.state,n.id);if(u)if(u.transitionStatus==="ending")this.removeToast(n.id,!0);else{const{id:d,transitionStatus:f,...h}=n;return this.updateToastInternal(n.id,h,!0,!0),n.id}}const o={...n,id:s,updateKey:0,transitionStatus:"starting"},l=[o,...this.state.toasts];this.setToasts(I3(l,r));const c=o.timeout??i;return o.type!=="loading"&&c>0&&this.scheduleTimer(s,c,()=>this.closeToast(s)),Ff.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),s});Zt(this,"updateToast",(n,i)=>{this.updateToastInternal(n,i,!1,!0)});Zt(this,"updateToastInternal",(n,i,r=!1,s=!1)=>{const{timeout:o,toasts:l}=this.state,c=Ff.toast(this.state,n);if(!c||c.transitionStatus==="ending")return;const u={...c,...i,...s&&{updateKey:c.updateKey+1}};this.setToasts(l.map(y=>y.id===n?u:y));const d=u.timeout??o,f=c.timeout??o,h=Object.hasOwn(i,"timeout"),m=u.transitionStatus!=="ending"&&u.type!=="loading"&&d>0,g=this.timers.has(n),b=f!==d,v=c.type==="loading";if(!m&&g){this.clearTimer(n);return}m&&(!g||b||h||v||r)&&(this.clearTimer(n),this.scheduleTimer(n,d,()=>this.closeToast(n)),Ff.expandedOrOutOfFocus(this.state)&&this.pauseTimers())});Zt(this,"closeToast",n=>{const i=n===void 0,{limit:r,toasts:s}=this.state;let o;if(i)o=s,this.clearTimers();else{const u=Ff.toast(this.state,n);if(!u)return;o=[u],this.clearTimer(n)}const l=s.map(u=>i||u.id===n?{...u,transitionStatus:"ending",height:0}:u),c=I3(l,r);this.setToasts(c,!c.some(u=>u.transitionStatus!=="ending")),o.forEach(u=>{var d;u.transitionStatus!=="ending"&&((d=u.onClose)==null||d.call(u))}),this.handleFocusManagement(n)});Zt(this,"promiseToast",(n,i)=>{const r=_3(i.loading),s=this.addToast({...r,type:"loading"}),o=n.then(l=>{const c=_3(i.success,l);return this.updateToast(s,{...c,type:"success",timeout:c.timeout}),l}).catch(l=>{const c=_3(i.error,l);return this.updateToast(s,{...c,type:"error",timeout:c.timeout}),Promise.reject(l)});return{}.hasOwnProperty.call(i,"setPromise")&&i.setPromise(o),o});Zt(this,"handleDocumentPointerDown",n=>{if(n.pointerType!=="touch")return;const i=uo(n);ii(this.state.viewport,i)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))})}syncProviderProps(n,i){const r=this.state.limit!==i;if(this.state.timeout===n&&!r)return;const s={timeout:n,limit:i};if(r){const o=I3(this.state.toasts,i);s.toasts=o,s.toastMetadata=R3(o)}this.update(s)}removeToast(n,i=!1){var l;const r=Ff.toastIndex(this.state,n);if(r===-1)return;const s=this.state.toasts[r];i||(l=s==null?void 0:s.onRemove)==null||l.call(s);const o=[...this.state.toasts];o.splice(r,1),this.setToasts(o)}pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(n=>{n.timeout&&(n.timeout.clear(),n.remaining=Math.max(n.remaining-(Date.now()-n.start),0))}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((n,i)=>{n.remaining=n.remaining>0?n.remaining:n.delay,n.timeout??(n.timeout=Mu.create()),n.timeout.start(n.remaining,()=>{this.handleTimerFired(i),n.callback()}),n.start=Date.now()}))}restoreFocusToPrevElement(){var n;(n=this.state.prevFocusElement)==null||n.focus({preventScroll:!0})}scheduleTimer(n,i,r){const s=Date.now(),l=!Ff.expandedOrOutOfFocus(this.state)?Mu.create():void 0;l==null||l.start(i,()=>{this.handleTimerFired(n),r()}),this.timers.set(n,{timeout:l,start:s,delay:i,remaining:i,callback:r})}clearTimers(){this.timers.forEach(n=>{var i;(i=n.timeout)==null||i.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer(n){var r;const i=this.timers.get(n);(r=i==null?void 0:i.timeout)==null||r.clear(),this.timers.delete(n),this.resetPausedStateIfNoTimersRemain()}handleTimerFired(n){this.timers.delete(n),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){this.timers.size===0&&(this.areTimersPaused=!1)}setToasts(n,i=n.length===0){const r={toasts:n,toastMetadata:R3(n)};i&&(r.hovering=!1,r.focused=!1),this.update(r)}handleFocusManagement(n){var c,u;const i=Ac(Sr(this.state.viewport));if(!this.state.viewport||!ii(this.state.viewport,i)||!eB(i))return;if(n===void 0){this.restoreFocusToPrevElement();return}const r=Ff.toasts(this.state),s=Ff.toastIndex(this.state,n),o=(d,f)=>{for(let h=d;h>=0&&hnew dit({timeout:i,limit:r,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return LD(o.disposeEffect),p.useEffect(function(){return s?s[" subscribe"](({action:u,options:d})=>{const f=d.id;u==="promise"&&d.promise?o.promiseToast(d.promise,d):u==="update"&&f?o.updateToast(f,d):u==="close"?o.closeToast(f):o.addToast(d)}):void 0},[o,s]),a.jsxs(H2e.Provider,{value:o,children:[a.jsx(hit,{store:o,timeout:i,limit:r}),n]})};function hit(e){const{store:t,timeout:n,limit:i}=e;return Jn(()=>{t.syncProviderProps(n,i)},[t,n,i]),null}const pit={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},f_e={...pit,position:"fixed",top:0,left:0},c0=p.forwardRef(function(t,n){const[i,r]=p.useState();Jn(()=>{Bnt&&U1&&r("button")},[]);const s={tabIndex:0,role:i};return a.jsx("span",{...t,ref:n,style:f_e,"aria-hidden":i?void 0:!0,...s,"data-base-ui-focus-guard":""})});function Kw(e,t,n,i){const r=Cd(h_e).current;return git(r,e,t,n,i)&&p_e(r,[e,t,n,i]),r.callback}function mit(e){const t=Cd(h_e).current;return bit(t,e)&&p_e(t,e),t.callback}function h_e(){return{callback:null,cleanup:null,refs:[]}}function git(e,t,n,i,r){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==i||e.refs[3]!==r}function bit(e,t){return e.refs.length!==t.length||e.refs.some((n,i)=>n!==t[i])}function p_e(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const i=Array(t.length).fill(null);for(let r=0;r{for(let r=0;r=65&&r<=90&&(typeof t=="function"||typeof t>"u")}function nV(e){return typeof e=="function"}function b_e(e,t){return nV(e)?e(t):e??eV}function kit(e,t){return t?e?(...n)=>{const i=n[0];if(x_e(i)){const s=i;sI(s);const o=t(...n);return s.baseUIHandlerPrevented||e==null||e(...n),o}const r=t(...n);return e==null||e(...n),r}:y_e(t):e}function y_e(e){return e&&((...t)=>{const n=t[0];return x_e(n)&&sI(n),e(...t)})}function sI(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function v_e(e,t){return t?e?t+" "+e:t:e}function x_e(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Pa(e,t,n={}){const i=t.render,r=Sit(t,n);if(n.enabled===!1)return null;const s=n.state??rc;return Ait(e,i,r,s)}function Sit(e,t={}){const{className:n,style:i,render:r}=e,{state:s=rc,ref:o,props:l,stateAttributesMapping:c,enabled:u=!0}=t,d=u?vit(n,s):void 0,f=u?m_e(i,s):void 0,h=u?yit(s,c):rc,m=u&&l?Eit(l):void 0,g=u?iB(h,m)??{}:rc;return typeof document<"u"&&(u?Array.isArray(o)?g.ref=mit([g.ref,vJ(r),...o]):g.ref=Kw(g.ref,vJ(r),o):Kw(null,null)),u?(d!==void 0&&(g.className=v_e(g.className,d)),f!==void 0&&(g.style=iB(g.style,f)),g):rc}function Eit(e){return Array.isArray(e)?xit(e):tV(void 0,e)}const Cit=Symbol.for("react.lazy");function Ait(e,t,n,i){if(t){if(typeof t=="function")return t(n,i);const r=tV(n,t.props);r.ref=n.ref;let s=t;return(s==null?void 0:s.$$typeof)===Cit&&(s=p.Children.toArray(t)[0]),p.cloneElement(s,r)}if(e&&typeof e=="string")return Tit(e,n);throw new Error(Vc(8))}function Tit(e,t){return e==="button"?p.createElement("button",{type:"button",...t,key:t.key}):e==="img"?p.createElement("img",{alt:"",...t,key:t.key}):p.createElement(e,t)}const _it=p.forwardRef(function(t,n){var F;const{render:i,className:r,style:s,children:o,...l}=t,c=Uz(),u=l0(),d=p.useRef(!1),f=p.useRef(!1),h=p.useRef(!1),m=c.useState("isEmpty"),g=c.useState("toasts"),b=c.useState("focused"),v=c.useState("expanded"),y=c.useState("prevFocusElement"),w=(F=g[0])==null?void 0:F.height,x=g.some(M=>M.transitionStatus==="ending"),O=g.filter(M=>M.priority==="high");p.useEffect(()=>{const M=c.state.viewport;if(!M||m)return;const z=na(M),q=Sr(M);function U(Z){Z.key==="F6"&&uo(Z)!==M&&(Z.preventDefault(),c.set("prevFocusElement",Ac(q)),M==null||M.focus({preventScroll:!0}),c.pauseTimers(),c.set("focused",!0))}function J(Z){uo(Z)===z&&(c.set("isWindowFocused",!1),c.pauseTimers())}function V(Z){if(Z.relatedTarget)return;const ne=uo(Z),W=Ac(Sr(M));(ne===z||!ii(M,ne)||!eB(W))&&c.resumeTimers(),u.start(0,()=>c.set("isWindowFocused",!0))}return mh(Ni(z,"keydown",U),Ni(z,"blur",J,!0),Ni(z,"focus",V,!0),Ni(q,"pointerdown",c.handleDocumentPointerDown,!0))},[c,u,m]);function k(M){var q,U;d.current=!0;const z=M.relatedTarget===c.state.viewport?g.find(J=>J.transitionStatus!=="ending"&&!J.limited):void 0;z?(U=(q=z.ref)==null?void 0:q.current)==null||U.focus():c.restoreFocusToPrevElement()}function S(M){M.key==="Tab"&&M.shiftKey&&uo(M.nativeEvent)===c.state.viewport&&(M.preventDefault(),c.restoreFocusToPrevElement())}function C(){c.state.toasts.some(z=>z.transitionStatus==="ending")||h.current||!f.current||(c.state.isWindowFocused&&c.resumeTimers(),c.set("hovering",!1),f.current=!1)}p.useEffect(C,[x,c]);function E(){c.pauseTimers(),c.set("hovering",!0),f.current=!1}function j(){c.state.isWindowFocused&&c.resumeTimers()}function T(){f.current=!0,C()}function R(M){M.pointerType==="touch"&&(h.current=!0)}function A(M){M.pointerType==="touch"&&(h.current=!1,C())}function N(){if(d.current){d.current=!1;return}b||eB(Ac(Sr(c.state.viewport)))&&(c.set("focused",!0),c.pauseTimers())}function P(M){!b||ii(c.state.viewport,M.relatedTarget)||(c.set("focused",!1),j())}const I={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:E,onMouseMove:E,onMouseLeave:T,onFocus:N,onBlur:P,onKeyDown:S,onClick:N,onPointerDown:R,onPointerUp:A,onPointerCancel:A,style:{"--toast-frontmost-height":w?`${w}px`:void 0}},D={expanded:v},_=!m&&y&&a.jsx(c0,{onFocus:k}),L=Pa("div",t,{ref:[n,c.setViewport],state:D,props:[I,l,{children:a.jsxs(p.Fragment,{children:[_,o,_]})}]});return a.jsxs(p.Fragment,{children:[_,L,!b&&O.length>0&&a.jsx("div",{style:f_e,children:O.map(M=>a.jsxs("div",{role:"alert","aria-atomic":!0,children:[a.jsx("div",{children:M.title}),a.jsx("div",{children:M.description})]},M.id))})]})});function iV(e){return Qz(19)?e:e?"true":void 0}const w_e=p.createContext(void 0);function jit(){const e=p.useContext(w_e);if(!e)throw new Error(Vc(66));return e}let aI=function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e}({});const Nit={"data-starting-style":""},Rit={"data-ending-style":""},WD={transitionStatus(e){return e==="starting"?Nit:e==="ending"?Rit:null}};function sp(e){return e==null?e:"current"in e?e.current:e}function rV(e,t=!1){const n=Wz();return li((i,r=null)=>{n.cancel();const s=sp(e);if(s==null)return;const o=s,l=()=>{vi.flushSync(i)};if(typeof o.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function c(){Promise.all(o.getAnimations().map(u=>u.finished)).then(()=>{r!=null&&r.aborted||l()},()=>{if(r!=null&&r.aborted)return;if(o.getAnimations().some(d=>d.pending||d.playState!=="finished")){c();return}l()})}if(t){const u="data-starting-style";if(!o.hasAttribute(u)){n.request(c);return}const d=new MutationObserver(()=>{o.hasAttribute(u)||(d.disconnect(),c())});d.observe(o,{attributes:!0,attributeFilter:[u]}),r==null||r.addEventListener("abort",()=>d.disconnect(),{once:!0});return}n.request(c)})}function $A(e){const{enabled:t=!0,open:n,ref:i,onComplete:r}=e,s=li(r),o=rV(i,n);p.useEffect(()=>{if(!t)return;const l=new AbortController;return o(s,l.signal),()=>{l.abort()}},[t,n,s,o])}const Iit=500,Pit={style:{transition:"none"}},sV="data-base-ui-click-trigger",Dit="data-base-ui-swipe-ignore",Mit="data-swipe-ignore",Lit=`[${Dit}]`,$it=`[${Mit}]`,Fit={fallbackAxisSide:"end"},Bit={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function P3(e,t,n){switch(e){case"up":return-n;case"down":return n;case"left":return-t;case"right":return t;default:return 0}}function Uit(e){const n=na(e).getComputedStyle(e).transform;let i=0,r=0,s=1;if(n&&n!=="none"){const o=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(o){const l=o[1].split(", ").map(parseFloat);l.length===6?(i=l[4],r=l[5],s=Math.sqrt(l[0]*l[0]+l[1]*l[1])):l.length===16&&(i=l[12],r=l[13],s=l[0])}}return{x:i,y:r,scale:s}}const Qit={...WD,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},xJ=40,zit=10,wJ=.5,Vit=1,Hit=`${Lit},${$it}`,qit=p.forwardRef(function(t,n){var Qe;const{toast:i,render:r,className:s,swipeDirection:o=["down","right"],style:l,...c}=t,u=((Qe=i.positionerProps)==null?void 0:Qe.anchor)!==void 0;let d=[];u||(d=Array.isArray(o)?o:[o]);const f=d.length>0,h=Uz(),[m,g]=p.useState(void 0),[b,v]=p.useState(!1),[y,w]=p.useState(!1),[x,O]=p.useState({x:0,y:0}),[k,S]=p.useState({x:0,y:0,scale:1}),[C,E]=p.useState(),[j,T]=p.useState(),[R,A]=p.useState(null),N=p.useRef(null),P=p.useRef(void 0),I=p.useRef({x:0,y:0}),D=p.useRef({x:0,y:0,scale:1}),_=p.useRef(void 0),L=p.useRef(0),F=p.useRef(!1),M=p.useRef({x:0,y:0}),z=p.useRef(!1),q=p.useRef({x:0,y:0}),U=p.useRef(null),J=p.useRef(null),V=h.useState("toastIndex",i.id),Z=h.useState("toastVisibleIndex",i.id),ne=h.useState("toastOffsetY",i.id),W=h.useState("focused"),G=h.useState("expanded");$A({open:i.transitionStatus!=="ending",ref:N,onComplete(){i.transitionStatus==="ending"&&h.removeToast(i.id)}});const H=li((_e=!1)=>{const ae=N.current;if(!ae)return;const le=ae.style.height;ae.style.height="auto";const ge=ae.offsetHeight;ae.style.height=le;function Oe(){h.updateToastInternal(i.id,{ref:N,height:ge,transitionStatus:void 0})}_e?vi.flushSync(Oe):Oe()});Jn(()=>{const _e=P.current;i.transitionStatus!=="starting"&&_e===i.id||(_e!==void 0&&(g(void 0),S({x:0,y:0,scale:1}),se({x:0,y:0})),P.current=i.id,H())},[H,i.id,i.transitionStatus]);function se(_e){q.current=_e,O(_e)}Jn(()=>()=>{var _e;(_e=J.current)==null||_e.abort()},[]);function Y(_e,ae){const le=Se=>Se>0?Se**wJ:-(Math.abs(Se)**wJ),ge=_e>0&&!d.includes("right")||_e<0&&!d.includes("left"),Oe=ae>0&&!d.includes("down")||ae<0&&!d.includes("up");return{x:ge?le(_e):_e,y:Oe?le(ae):ae}}const X=li(_e=>{var qe;if(_e.pointerId!==U.current)return;U.current=null,(qe=J.current)==null||qe.abort(),J.current=null,v(!1),w(!1),A(null);const ae=D.current;if(_e.type==="pointercancel"||F.current){se({x:ae.x,y:ae.y}),g(void 0);return}const le=q.current,ge=le.x-ae.x,Oe=le.y-ae.y;let Se;for(const Xe of d)if(P3(Xe,ge,Oe)>xJ){Se=Xe;break}Se?(g(Se),h.closeToast(i.id)):(se({x:ae.x,y:ae.y}),g(void 0))});function ie(_e){var Xe,ye;if(_e.button!==0)return;_e.pointerType==="touch"&&h.pauseTimers();const ae=uo(_e.nativeEvent);if(ae==null?void 0:ae.closest(`button,a,input,textarea,[role="button"],${Hit}`))return;F.current=!1,_.current=void 0,L.current=0,U.current=_e.pointerId,I.current={x:_e.clientX,y:_e.clientY},M.current=I.current;const ge=_e.currentTarget,Oe=Uit(ge);D.current=Oe,S(Oe),se({x:Oe.x,y:Oe.y}),h.set("hovering",!0),v(!0),w(!1),A(null),z.current=!0,(Xe=J.current)==null||Xe.abort();const Se=new AbortController;J.current=Se;const qe=Sr(ge);qe.addEventListener("pointerup",X,{signal:Se.signal}),qe.addEventListener("pointercancel",X,{signal:Se.signal}),(ye=ge.setPointerCapture)==null||ye.call(ge,_e.pointerId)}function ee(_e){if(_e.pointerId!==U.current)return;_e.preventDefault(),z.current&&(I.current={x:_e.clientX,y:_e.clientY},z.current=!1);const{clientY:ae,clientX:le,movementX:ge,movementY:Oe}=_e;(Oe<0&&ae>M.current.y||Oe>0&&aeM.current.x||ge>0&&le=Vit){w(!0);const vt=d.includes("left")||d.includes("right"),tt=d.includes("up")||d.includes("down");if(vt&&tt){const mt=Math.abs(Se),Ne=Math.abs(qe);we=mt>Ne?"horizontal":"vertical",A(we)}}let Ae;if(!_.current)we==="vertical"?qe>0?Ae="down":qe<0&&(Ae="up"):we==="horizontal"?Se>0?Ae="right":Se<0&&(Ae="left"):Math.abs(Se)>=Math.abs(qe)?Ae=Se>0?"right":"left":Ae=qe>0?"down":"up",Ae&&d.includes(Ae)&&(_.current=Ae,L.current=P3(Ae,Se,qe),g(Ae));else{const Et=_.current,vt=P3(Et,ye,Xe);vt>xJ?(F.current=!1,g(Et)):!(d.includes("left")&&d.includes("right"))&&!(d.includes("up")&&d.includes("down"))&&L.current-vt>=zit&&(F.current=!0)}const Ve=Y(Se,qe);let Be=D.current.x,_t=D.current.y;const Pt=d.includes("left")||d.includes("right"),Kt=d.includes("up")||d.includes("down");we!=="vertical"&&Pt&&(Be+=Ve.x),we!=="horizontal"&&Kt&&(_t+=Ve.y),se({x:Be,y:_t})}function be(_e){if(_e.key==="Escape"){if(!N.current||!ii(N.current,Ac(Sr(N.current))))return;h.closeToast(i.id)}}p.useEffect(()=>{const _e=N.current;if(!f||!_e)return;function ae(le){U.current===null||!ii(_e,uo(le))||le.preventDefault()}return Ni(_e,"touchmove",ae,{passive:!1})},[f]);function ue(){const _e=x.x-k.x,ae=x.y-k.y;return{transition:b?"none":void 0,transform:b?`translateX(${x.x}px) translateY(${x.y}px) scale(${k.scale})`:void 0,"--toast-swipe-movement-x":`${_e}px`,"--toast-swipe-movement-y":`${ae}px`}}const pe=i.priority==="high",ke={role:pe?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":C,"aria-describedby":j,"aria-hidden":pe&&!W?!0:void 0,onPointerDown:f?ie:void 0,onPointerMove:f?ee:void 0,onPointerUp:f?X:void 0,onPointerCancel:f?X:void 0,onKeyDown:be,inert:iV(i.limited),style:{...ue(),"--toast-index":i.transitionStatus==="ending"?V:Z,"--toast-offset-y":`${ne}px`,"--toast-height":i.height?`${i.height}px`:void 0}},je=p.useMemo(()=>({toast:i,setTitleId:E,setDescriptionId:T,recalculateHeight:H,visibleIndex:Z,expanded:G}),[i,E,T,H,Z,G]),Pe={transitionStatus:i.transitionStatus,expanded:G,limited:i.limited||!1,type:i.type,swiping:b,swipeDirection:m},Ee=Pa("div",t,{ref:[n,N],state:Pe,stateAttributesMapping:Qit,props:[ke,c]});return a.jsx(w_e.Provider,{value:je,children:Ee})});let OJ=0;function Wit(e,t="mui"){const[n,i]=p.useState(e),r=e||n;return p.useEffect(()=>{n==null&&(OJ+=1,i(`${t}-${OJ}`))},[n,t]),r}const kJ=zz.useId;function FA(e,t){if(kJ!==void 0){const n=kJ();return e??(t?`${t}-${n}`:n)}return Wit(e,t)}function O_e(e){return e==null||typeof e=="boolean"||e===""?!1:Array.isArray(e)?e.some(O_e):!0}function Kit(e){return p.isValidElement(e)&&O_e(e.props.children)}function k_e(e,t,n){const{toast:i,setTitleId:r,setDescriptionId:s}=jit(),o=n==="title"?r:s,l=t??(n==="title"?i.title:i.description);return{id:FA(e),children:l,type:i.type,setId:o}}function S_e(e,t,n){const i=Kit(e);return Jn(()=>{if(i)return n(t),()=>{n(r=>r===t?void 0:r)}},[i,t,n]),i?e:null}const Git=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:o,children:l,...c}=t,{id:u,children:d,type:f,setId:h}=k_e(o,l,"description"),g=Pa("p",t,{ref:n,state:{type:f},props:{...c,id:u,children:d}});return S_e(g,u,h)}),Xit=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:o,children:l,...c}=t,{id:u,children:d,type:f,setId:h}=k_e(o,l,"title"),g=Pa("h2",t,{ref:n,state:{type:f},props:{...c,id:u,children:d}});return S_e(g,u,h)}),Yit=p.createContext(void 0);function Zit(e=!1){const t=p.useContext(Yit);if(t===void 0&&!e)throw new Error(Vc(16));return t}function Jit(e){const{focusableWhenDisabled:t,disabled:n,composite:i=!1,tabIndex:r=0,isNativeButton:s}=e,o=i&&t!==!1,l=i&&t===!1;return{props:p.useMemo(()=>{const u={onKeyDown(d){n&&t&&d.key!=="Tab"&&d.preventDefault()}};return i||(u.tabIndex=r,!s&&n&&(u.tabIndex=t?r:-1)),(s&&(t||o)||!s&&n)&&(u["aria-disabled"]=n),s&&(!t||l)&&(u.disabled=n),u},[i,n,t,o,l,s,r])}}function D3(e,t,{detail:n=0}={}){e.dispatchEvent(new(na(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function KD(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:i=0,native:r=!0,composite:s}=e,o=p.useRef(null),l=Zit(!0),c=s??l!==void 0,{props:u}=Jit({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:i,isNativeButton:r}),d=p.useCallback(()=>{const m=o.current;M3(m)&&c&&t&&u.disabled===void 0&&m.disabled&&(m.disabled=!1)},[t,u.disabled,c]);Jn(d,[d]);const f=p.useCallback((m={})=>{const{onClick:g,onMouseDown:b,onKeyUp:v,onKeyDown:y,onPointerDown:w,...x}=m;return tV({onClick(O){if(t){O.preventDefault();return}g==null||g(O)},onMouseDown(O){t||b==null||b(O)},onKeyDown(O){if(t||(sI(O),y==null||y(O),O.baseUIHandlerPrevented))return;const k=O.target===O.currentTarget,S=O.currentTarget,C=M3(S),E=!r&&ert(S),j=k&&(r?C:!E),T=O.key==="Enter",R=O.key===" ",A=S.getAttribute("role"),N=(A==null?void 0:A.startsWith("menuitem"))||A==="option"||A==="gridcell";if(k&&c&&R){if(O.defaultPrevented&&N)return;O.preventDefault(),(!r||C)&&(O.preventBaseUIHandler(),D3(S,O));return}if(!j||r||!R&&!T){k&&E&&R&&O.preventDefault();return}O.defaultPrevented||(O.preventDefault(),T&&(O.preventBaseUIHandler(),D3(S,O)))},onKeyUp(O){if(!t){if(sI(O),v==null||v(O),O.target===O.currentTarget&&r&&c&&M3(O.currentTarget)&&O.key===" "){O.preventDefault();return}O.baseUIHandlerPrevented||O.target===O.currentTarget&&!r&&!c&&!O.defaultPrevented&&O.key===" "&&(O.preventBaseUIHandler(),D3(O.currentTarget,O))}},onPointerDown(O){if(t){O.preventDefault();return}w==null||w(O)}},r?{type:"button"}:{role:"button"},u,x)},[t,u,c,r]),h=li(m=>{o.current=m,d()});return{getButtonProps:f,buttonRef:h}}function M3(e){return ea(e)&&e.tagName==="BUTTON"}function ert(e){return ea(e)&&e.tagName==="A"&&!!e.href}const E_e="none",Gw="trigger-press",pu="trigger-hover",C_e="outside-press",A_e="close-press",rC="focus-out",T_e="escape-key",__e="imperative-action";function ha(e,t,n,i){let r=!1,s=!1;const o=rc;return{reason:e,event:t??new Event("base-ui"),cancel(){r=!0},allowPropagation(){s=!0},get isCanceled(){return r},get isPropagationAllowed(){return s},trigger:n,...o}}function oI(e){return`data-base-ui-${e}`}const j_e=p.createContext(null),N_e=()=>p.useContext(j_e),trt=oI("portal");function R_e(e={}){const{ref:t,container:n,componentProps:i=rc,elementProps:r}=e,s=FA(),o=N_e(),l=o==null?void 0:o.portalNode,[c,u]=p.useState(null),[d,f]=p.useState(null),h=li(v=>{v!==null&&f(v)}),m=p.useRef(null);Jn(()=>{if(n===null){m.current&&(m.current=null,f(null),u(null));return}const v=(n&&(Vz(n)?n:n.current))??l??document.body;if(v==null){m.current&&(m.current=null,f(null),u(null));return}m.current!==v&&(m.current=v,f(null),u(v))},[n,l]);const g=Pa("div",i,{ref:[t,h],props:[{id:s,[trt]:""},r]}),b=c&&g?vi.createPortal(g,c):null;return{node:d,nodeId:p.isValidElement(g)?g.props.id:void 0,subtree:b}}const I_e=p.forwardRef(function(t,n){const{render:i,className:r,style:s,children:o,container:l,...c}=t,{node:u,nodeId:d,subtree:f}=R_e({container:l,ref:n,componentProps:t,elementProps:c}),h=p.useRef(null),m=p.useRef(null),g=p.useRef(null),b=p.useRef(null),[v,y]=p.useState(null),w=p.useRef(!1),x=v==null?void 0:v.modal,O=v==null?void 0:v.open,k=!!v&&!v.modal&&v.open&&!!u;p.useEffect(()=>{if(!u||x)return;function C(E){u&&E.relatedTarget&&nw(E)&&(E.type==="focusin"?w.current&&(yJ(u),w.current=!1):(uit(u),w.current=!0))}return mh(Ni(u,"focusin",C,!0),Ni(u,"focusout",C,!0))},[u,x]),Jn(()=>{!u||O!==!0||!w.current||(yJ(u),w.current=!1)},[O,u]);const S=p.useMemo(()=>({beforeOutsideRef:h,afterOutsideRef:m,beforeInsideRef:g,afterInsideRef:b,portalNode:u,setFocusManagerState:y}),[u]);return a.jsxs(p.Fragment,{children:[f,a.jsxs(j_e.Provider,{value:S,children:[k&&u&&a.jsx(c0,{"data-type":"outside",ref:h,onFocus:C=>{var E;if(nw(C,u))(E=g.current)==null||E.focus();else{const j=v?v.domReference:null,T=u_e(j);T==null||T.focus()}}}),k&&u&&a.jsx("span",{"aria-owns":d,style:Bit}),u&&vi.createPortal(o,u),k&&u&&a.jsx(c0,{"data-type":"outside",ref:m,onFocus:C=>{var E;if(nw(C,u))(E=b.current)==null||E.focus();else{const j=v?v.domReference:null,T=Jz(j);T==null||T.focus(),v!=null&&v.closeOnFocusOut&&(v==null||v.onOpenChange(!1,ha(rC,C.nativeEvent)))}}})]})]})}),nrt=p.forwardRef(function(t,n){const{children:i,container:r,className:s,render:o,style:l,...c}=t,{node:u,subtree:d}=R_e({container:r,ref:n,componentProps:t,elementProps:c});return!d&&!u?null:a.jsxs(p.Fragment,{children:[d,u&&vi.createPortal(i,u)]})}),irt=p.forwardRef(function(t,n){return a.jsx(nrt,{ref:n,...t})});function ec(e){const t=Cd(rrt,e).current;return t.next=e,Jn(t.effect),t}function rrt(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function srt(e,t){return t!=null&&!tw(t)?0:typeof e=="function"?e():e}function rB(e,t,n){const i=srt(e,n);return typeof i=="number"?i:i==null?void 0:i[t]}function SJ(e){return typeof e=="function"?e():e}function P_e(e,t){return t||e==="click"||e==="mousedown"}function art(e){return(e==null?void 0:e.includes("mouse"))&&e!=="mousedown"}let e_=0;function L3(e,t={}){const{preventScroll:n=!1,sync:i=!1,shouldFocus:r}=t;cancelAnimationFrame(e_);function s(){r&&!r()||e==null||e.focus({preventScroll:n})}if(i)return s(),Bz;const o=requestAnimationFrame(s);return e_=o,()=>{e_===o&&(cancelAnimationFrame(o),e_=0)}}const $3={inert:new WeakMap,"aria-hidden":new WeakMap},EJ="data-base-ui-inert",sB={inert:new WeakSet,"aria-hidden":new WeakSet};let sk=new WeakMap,F3=0;function ort(e){return sB[e]}function D_e(e){return e?Ww(e)?e.host:D_e(e.parentNode):null}const CJ=(e,t)=>t.map(n=>{if(e.contains(n))return n;const i=D_e(n);return e.contains(i)?i:null}).filter(n=>n!=null),AJ=e=>{const t=new Set;return e.forEach(n=>{let i=n;for(;i&&!t.has(i);)t.add(i),i=i.parentNode}),t},TJ=(e,t,n)=>{const i=[],r=s=>{!s||n.has(s)||Array.from(s.children).forEach(o=>{ll(o)!=="script"&&(t.has(o)?r(o):i.push(o))})};return r(e),i};function lrt(e,t,n,i,{mark:r=!0}){let s=null;i?s="inert":n&&(s="aria-hidden");let o=null,l=null;const c=CJ(t,e),u=r?TJ(t,AJ(c),new Set(c)):[],d=[],f=[];if(s){const h=$3[s],m=ort(s);l=m,o=h;const g=CJ(t,Array.from(t.querySelectorAll("[aria-live]"))),b=c.concat(g);TJ(t,AJ(b),new Set(b)).forEach(y=>{const w=y.getAttribute(s),x=w!==null&&w!=="false",O=(h.get(y)||0)+1;h.set(y,O),d.push(y),O===1&&x&&m.add(y),x||y.setAttribute(s,s==="inert"?"":"true")})}return r&&u.forEach(h=>{const m=(sk.get(h)||0)+1;sk.set(h,m),f.push(h),m===1&&h.setAttribute(EJ,"")}),F3+=1,()=>{o&&d.forEach(h=>{const g=(o.get(h)||0)-1;o.set(h,g),g||(!(l!=null&&l.has(h))&&s&&h.removeAttribute(s),l==null||l.delete(h))}),r&&f.forEach(h=>{const m=(sk.get(h)||0)-1;sk.set(h,m),m||h.removeAttribute(EJ)}),F3-=1,F3||($3.inert=new WeakMap,$3["aria-hidden"]=new WeakMap,sB.inert=new WeakSet,sB["aria-hidden"]=new WeakSet,sk=new WeakMap)}}function _J(e,t={}){const{ariaHidden:n=!1,inert:i=!1,mark:r=!0}=t,s=Sr(e[0]).body;return lrt(e,s,n,i,{mark:r})}function M_e(){const e=new Map;return{emit(t,n){var i;(i=e.get(t))==null||i.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var i;(i=e.get(t))==null||i.delete(n)}}}class crt{constructor(){Zt(this,"nodesRef",{current:[]});Zt(this,"events",M_e())}addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(i=>i===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const L_e=p.createContext(null),$_e=p.createContext(null),GD=()=>{var e;return((e=p.useContext(L_e))==null?void 0:e.id)||null},Q1=e=>{const t=p.useContext($_e);return e??t};function urt(e){const t=FA(),n=Q1(e),i=GD();return Jn(()=>{if(!t)return;const r={id:t,parentId:i};return n==null||n.addNode(r),()=>{n==null||n.removeNode(r)}},[n,t,i]),t}function drt(e){const{children:t,id:n}=e,i=GD();return a.jsx(L_e.Provider,{value:p.useMemo(()=>({id:n,parentId:i}),[n,i]),children:t})}function frt(e){const{children:t,externalTree:n}=e,i=Cd(()=>n??new crt).current;return a.jsx($_e.Provider,{value:i,children:t})}function hrt(e,t){const n=na(uo(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const jJ=20;let gg=[];function aV(){gg=gg.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function NJ(e){aV(),e&&ll(e)!=="body"&&(gg.push(new WeakRef(e)),gg.length>jJ&&(gg=gg.slice(-jJ)))}function RJ(){var e;return aV(),(e=gg[gg.length-1])==null?void 0:e.deref()}function prt(e){return e?Zz(e)?e:LA(e)[0]||e:null}function IJ(e){var r;if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!((r=e.getAttribute("role"))!=null&&r.includes("dialog")))return;const n=l_e(e).filter(s=>{const o=s.getAttribute("data-tabindex")||"";return Zz(s)||s.hasAttribute("data-tabindex")&&!o.startsWith("-")}),i=e.getAttribute("tabindex");n.length===0?i!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(i!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function F_e(e){const{context:t,children:n,disabled:i=!1,initialFocus:r=!0,returnFocus:s=!0,restoreFocus:o=!1,modal:l=!0,closeOnFocusOut:c=!0,openInteractionType:u="",nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:h,externalTree:m,getInsideElements:g}=e,b="rootStore"in t?t.rootStore:t,v=b.useState("open"),y=b.useState("domReferenceElement"),w=b.useState("floatingElement"),{events:x,dataRef:O}=b.context,k=li(()=>{var Y;return(Y=O.current.floatingContext)==null?void 0:Y.nodeId}),S=r===!1,C=hJ(y)&&S,E=ec(r),j=ec(s),T=ec(u),R=ec(v),A=Q1(m),N=N_e(),P=p.useRef(!1),I=p.useRef(!1),D=p.useRef(!1),_=p.useRef(null),L=p.useRef(""),F=p.useRef(""),M=p.useRef(null),z=p.useRef(null),q=Kw(M,h,N==null?void 0:N.beforeInsideRef),U=Kw(z,N==null?void 0:N.afterInsideRef),J=l0(),V=l0(),Z=Wz(),ne=N!=null,W=pJ(w),G=li((Y=W)=>Y?LA(Y):[]),H=li(()=>(g==null?void 0:g().filter(Y=>Y!=null))??[]);p.useEffect(()=>{if(i||!l)return;function Y(ie){ie.key==="Tab"&&ii(W,Ac(Sr(W)))&&G().length===0&&!C&&znt(ie)}const X=Sr(W);return Ni(X,"keydown",Y)},[i,W,l,C,G]),p.useEffect(()=>{if(i||!v)return;const Y=Sr(W);function X(){D.current=!1}function ie(be){const ue=uo(be),pe=H(),ke=ii(w,ue)||ii(y,ue)||ii(N==null?void 0:N.portalNode,ue)||pe.some(je=>je===ue||ii(je,ue));D.current=!ke,F.current=be.pointerType||"keyboard",ue!=null&&ue.closest(`[${sV}]`)&&(I.current=!0,V.start(0,()=>{I.current=!1}))}function ee(){F.current="keyboard"}return mh(Ni(Y,"pointerdown",ie,!0),Ni(Y,"pointerup",X,!0),Ni(Y,"pointercancel",X,!0),Ni(Y,"keydown",ee,!0),X)},[i,w,y,W,v,N,V,H]),p.useEffect(()=>{if(i||!c)return;const Y=Sr(W);function X(){I.current=!0,V.start(0,()=>{I.current=!1})}function ie(pe){const ke=uo(pe);Zz(ke)&&(_.current=ke)}function ee(pe){const ke=pe.relatedTarget,je=pe.currentTarget,Pe=uo(pe);l&&ke==null&&Pe!=null&&ii(w,Pe)&&NJ(Pe),queueMicrotask(()=>{const Ee=k(),Qe=b.context.triggerElements,_e=H(),ae=(ke==null?void 0:ke.hasAttribute(oI("focus-guard")))&&[M.current,z.current,N==null?void 0:N.beforeInsideRef.current,N==null?void 0:N.afterInsideRef.current,N==null?void 0:N.beforeOutsideRef.current,N==null?void 0:N.afterOutsideRef.current,sp(f),sp(d)].includes(ke),le=!(ii(y,ke)||ii(w,ke)||ii(ke,w)||ii(N==null?void 0:N.portalNode,ke)||_e.some(ge=>ge===ke||ii(ge,ke))||Qe.hasMatchingElement(ge=>ii(ge,ke))||ae||A&&(Zg(A.nodesRef.current,Ee).find(ge=>{var Oe,Se;return ii((Oe=ge.context)==null?void 0:Oe.elements.floating,ke)||ii((Se=ge.context)==null?void 0:Se.elements.domReference,ke)})||mJ(A.nodesRef.current,Ee).find(ge=>{var Oe,Se,qe;return[(Oe=ge.context)==null?void 0:Oe.elements.floating,pJ((Se=ge.context)==null?void 0:Se.elements.floating)].includes(ke)||((qe=ge.context)==null?void 0:qe.elements.domReference)===ke})));if(je===y&&W&&IJ(W),o&&je!==y&&!t_e(Pe)&&Ac(Y)===Y.body){if(ea(W)&&(W.focus(),o==="popup")){Z.request(()=>{W.focus()});return}const ge=G(),Oe=_.current,Se=(Oe&&ge.includes(Oe)?Oe:null)||ge[ge.length-1]||W;ea(Se)&&Se.focus()}if(O.current.insideReactTree){O.current.insideReactTree=!1;return}(C||!l)&&ke&&le&&!I.current&&(C||ke!==RJ())&&(P.current=!0,b.setOpen(!1,ha(rC,pe)))})}function be(){D.current||(O.current.insideReactTree=!0,J.start(0,()=>{O.current.insideReactTree=!1}))}const ue=ea(y)?y:null;if(!(!w&&!ue))return mh(ue&&Ni(ue,"focusout",ee),ue&&Ni(ue,"pointerdown",X),w&&Ni(w,"focusin",ie),w&&Ni(w,"focusout",ee),w&&N&&Ni(w,"focusout",be,!0))},[i,y,w,W,l,A,N,b,c,o,G,C,k,O,J,V,Z,d,f,H]),p.useEffect(()=>{var je,Pe,Ee;if(i||!w||!v)return;const Y=Array.from(((je=N==null?void 0:N.portalNode)==null?void 0:je.querySelectorAll(`[${oI("portal")}]`))||[]),ie=(Ee=(Pe=(A?mJ(A.nodesRef.current,k()):[]).find(Qe=>{var _e;return hJ(((_e=Qe.context)==null?void 0:_e.elements.domReference)||null)}))==null?void 0:Pe.context)==null?void 0:Ee.elements.domReference,be=[...[w,...Y,M.current,z.current,N==null?void 0:N.beforeOutsideRef.current,N==null?void 0:N.afterOutsideRef.current,...H()],ie,sp(f),sp(d),C?y:null].filter(Qe=>Qe!=null),ue=_J(be,{ariaHidden:l||C,mark:!1}),pe=[w,...Y].filter(Qe=>Qe!=null),ke=_J(pe);return()=>{ke(),ue()}},[v,i,y,w,l,N,C,A,k,d,f,H]),Jn(()=>{if(!v||i||!ea(W))return;L.current="",F.current="";const Y=Sr(W),X=Ac(Y);queueMicrotask(()=>{const ie=E.current,ee=typeof ie=="function"?ie(T.current||""):ie;if(ee===void 0||ee===!1||ii(W,X))return;let ue=null;const pe=()=>(ue==null&&(ue=G(W)),ue[0]||W);let ke;ee===!0||ee===null?ke=pe():ke=sp(ee),ke=ke||pe();const je=ii(W,Ac(Y));L3(ke,{preventScroll:ke===W,shouldFocus(){if(!R.current)return!1;if(je)return!0;const Pe=Ac(Y);return!(Pe!==ke&&ii(W,Pe))}})})},[i,v,W,G,E,T,R]),Jn(()=>{if(i||!W)return;const Y=Sr(W),X=Ac(Y),ie=T.current==null;NJ(X);function ee(ue){if(ue.open||(L.current=hrt(ue.nativeEvent,F.current)),ue.reason===pu&&ue.nativeEvent.type==="mouseleave"&&(P.current=!0),ue.reason===C_e)if(ue.nested)P.current=!1;else if(Hnt(ue.nativeEvent)||e_e(ue.nativeEvent))P.current=!1;else{let pe=!1;Sr(W).createElement("div").focus({get preventScroll(){return pe=!0,!1}}),pe?P.current=!1:P.current=!0}}x.on("openchange",ee);function be(ue){const pe=j.current;let ke=typeof pe=="function"?pe(ue):pe;if(ke===void 0||ke===!1)return null;ke===null&&(ke=!0);const je=y!=null&&y.isConnected?y:null,Pe=X!=null&&X.isConnected&&ll(X)!=="body"?X:null;let Ee=ie?Pe||je:je||Pe;return Ee||(Ee=RJ()||null),typeof ke=="boolean"?Ee:sp(ke)||Ee||null}return()=>{x.off("openchange",ee);const ue=Ac(Y),pe=H(),ke=ii(w,ue)||pe.some(Qe=>Qe===ue||ii(Qe,ue))||A&&Zg(A.nodesRef.current,k(),!1).some(Qe=>{var _e;return ii((_e=Qe.context)==null?void 0:_e.elements.floating,ue)}),je=j.current,Pe=L.current,Ee=be(Pe);queueMicrotask(()=>{const Qe=prt(Ee),_e=typeof je!="boolean";if(je&&!P.current&&ea(Qe)&&(!(!_e&&Qe!==ue&&ue!==Y.body)||ke)){const ae={preventScroll:!0};Pe==="keyboard"&&(ae.focusVisible=!0),Qe.focus(ae)}P.current=!1})}},[i,w,W,j,T,x,A,y,k,H]),Jn(()=>{if(!U1||v||!w)return;const Y=Ac(Sr(w));!ea(Y)||!Kz(Y)||ii(w,Y)&&Y.blur()},[v,w]),Jn(()=>{if(!(i||!N))return N.setFocusManagerState({modal:l,closeOnFocusOut:c,open:v,onOpenChange:b.setOpen,domReference:y}),()=>{N.setFocusManagerState(null)}},[i,N,l,v,b,c,y]),Jn(()=>{if(!(i||!W))return IJ(W),()=>{queueMicrotask(aV)}},[i,W]);const se=!i&&(l?!C:!0)&&(ne||l);return a.jsxs(p.Fragment,{children:[se&&a.jsx(c0,{"data-type":"inside",ref:q,onFocus:Y=>{var X;if(l){const ie=G();L3(ie[ie.length-1])}else if(N!=null&&N.portalNode)if(P.current=!1,nw(Y,N.portalNode)){const ie=Jz(y);ie==null||ie.focus()}else(X=sp(f??N.beforeOutsideRef))==null||X.focus()}}),n,se&&a.jsx(c0,{"data-type":"inside",ref:U,onFocus:Y=>{var X;if(l)L3(G()[0]);else if(N!=null&&N.portalNode)if(c&&(P.current=!0),nw(Y,N.portalNode)){const ie=u_e(y);ie==null||ie.focus()}else(X=sp(d??N.afterOutsideRef))==null||X.focus()}})]})}function B_e(e,t={}){const{enabled:n=!0,event:i="click",toggle:r=!0,ignoreMouse:s=!1,stickIfOpen:o=!0,touchOpenDelay:l=0,reason:c=Gw}=t,u="rootStore"in e?e.rootStore:e,d=u.context.dataRef,f=p.useRef(void 0),h=Wz(),m=l0(),g=p.useMemo(()=>{function b(y,w,x,O){const k=ha(c,w,x);y&&O==="touch"&&l>0?m.start(l,()=>{u.setOpen(!0,k)}):u.setOpen(y,k)}function v(y,w,x){const O=d.current.openEvent,k=u.select("domReferenceElement")!==w;return y&&k||!y||!r?!0:O&&o?!x(O.type):!1}return{onPointerDown(y){f.current=tw(y.pointerType,!0)&&e_e(y.nativeEvent)?"virtual":y.pointerType},onMouseDown(y){const w=f.current,x=y.nativeEvent,O=u.select("open");if(y.button!==0||i==="click"||tw(w,!0)&&s)return;const k=v(O,y.currentTarget,E=>E==="click"||E==="mousedown"),S=uo(x);if(Kz(S)){b(k,x,S,w);return}const C=y.currentTarget;h.request(()=>{b(k,x,C,w)})},onClick(y){if(i==="mousedown-only")return;const w=f.current;if(i==="mousedown"&&w){f.current=void 0;return}if(tw(w,!0)&&s)return;const x=u.select("open"),O=v(x,y.currentTarget,k=>k==="click"||k==="mousedown"||k==="keydown"||k==="keyup");b(O,y.nativeEvent,y.currentTarget,w)},onKeyDown(){f.current=void 0}}},[d,i,s,c,u,o,r,h,m,l]);return p.useMemo(()=>n?{reference:g}:rc,[n,g])}function mrt(){return!1}function grt(e){return{escapeKey:typeof e=="boolean"?e:(e==null?void 0:e.escapeKey)??!1,outsidePress:typeof e=="boolean"?e:(e==null?void 0:e.outsidePress)??!0}}function U_e(e,t={}){const{enabled:n=!0,escapeKey:i=!0,outsidePress:r=!0,outsidePressEvent:s="sloppy",referencePress:o=mrt,bubbles:l,externalTree:c}=t,u="rootStore"in e?e.rootStore:e,d=u.useState("open"),f=u.useState("floatingElement"),{dataRef:h}=u.context,m=Q1(c),g=li(typeof r=="function"?r:()=>!1),b=typeof r=="function"?g:r,v=b!==!1,y=li(()=>s),{escapeKey:w,outsidePress:x}=grt(l),O=p.useRef(!1),k=p.useRef(!1),S=p.useRef(!1),C=p.useRef(!1),E=p.useRef(""),j=p.useRef(null),T=l0(),R=l0(),A=li(()=>{R.clear(),h.current.insideReactTree=!1}),N=li(q=>{var V;const U=(V=h.current.floatingContext)==null?void 0:V.nodeId;return(m?Zg(m.nodesRef.current,U):[]).some(Z=>{var ne;return((ne=Z.context)==null?void 0:ne.open)&&!Z.context.dataRef.current[q]})}),P=li(q=>j3(q,u.select("floatingElement"))||j3(q,u.select("domReferenceElement"))),I=li(q=>{o()&&u.setOpen(!1,ha(Gw,q.nativeEvent))}),D=li(q=>{if(!d||!n||!i||q.key!=="Escape"||C.current||!w&&N("__escapeKeyBubbles"))return;const U=Vnt(q)?q.nativeEvent:q,J=ha(T_e,U);u.setOpen(!1,J),J.isCanceled||q.preventDefault(),!w&&!J.isPropagationAllowed&&q.stopPropagation()}),_=li(()=>{h.current.insideReactTree=!0,R.start(0,A)}),L=li(q=>{if(!d||!n||q.button!==0)return;const U=uo(q.nativeEvent);ii(u.select("floatingElement"),U)&&(O.current||(O.current=!0,k.current=!1))}),F=li(q=>{!d||!n||(q.defaultPrevented||q.nativeEvent.defaultPrevented)&&O.current&&(k.current=!0)});p.useEffect(()=>{if(!d||!n)return A;h.current.__escapeKeyBubbles=w,h.current.__outsidePressBubbles=x;const q=new Mu,U=new Mu;function J(){q.clear(),C.current=!0}function V(){q.start(U1?5:0,()=>{C.current=!1})}function Z(){S.current=!0,U.start(0,()=>{S.current=!1})}function ne(){O.current=!1,k.current=!1}function W(){const _e=E.current,ae=_e==="pen"||!_e?"mouse":_e,le=y(),ge=typeof le=="function"?le():le;return typeof ge=="string"?ge:ge[ae]}function G(_e){const ae=W();return ae==="intentional"&&_e.type!=="click"||ae==="sloppy"&&_e.type==="click"}function H(_e){var ge;const ae=(ge=h.current.floatingContext)==null?void 0:ge.nodeId,le=m&&Zg(m.nodesRef.current,ae).some(Oe=>{var Se;return j3(_e,(Se=Oe.context)==null?void 0:Se.elements.floating)});return P(_e)||le}function se(_e){if(G(_e)){_e.type!=="click"&&!P(_e)&&(U.clear(),S.current=!1),A();return}if(h.current.insideReactTree){A();return}const ae=uo(_e),le=`[${oI("inert")}]`,ge=Cr(ae)?ae.getRootNode():null,Oe=Array.from((Ww(ge)?ge:Sr(u.select("floatingElement"))).querySelectorAll(le)),Se=u.context.triggerElements;if(ae&&(Se.hasElement(ae)||Se.hasMatchingElement(Xe=>ii(Xe,ae))))return;let qe=Cr(ae)?ae:null;for(;qe&&!Pg(qe);){const Xe=Yg(qe);if(Pg(Xe)||!Cr(Xe))break;qe=Xe}if(!(Oe.length&&Cr(ae)&&!Unt(ae)&&!ii(ae,u.select("floatingElement"))&&Oe.every(Xe=>!ii(qe,Xe)))){if(ea(ae)&&!("touches"in _e)){const Xe=Pg(ae),ye=Du(ae),we=/auto|scroll/,Ae=Xe||we.test(ye.overflowX),Ve=Xe||we.test(ye.overflowY),Be=Ae&&ae.clientWidth>0&&ae.scrollWidth>ae.clientWidth,_t=Ve&&ae.clientHeight>0&&ae.scrollHeight>ae.clientHeight,Pt=ye.direction==="rtl",Kt=_t&&(Pt?_e.offsetX<=ae.offsetWidth-ae.clientWidth:_e.offsetX>ae.clientWidth),Et=Be&&_e.offsetY>ae.clientHeight;if(Kt||Et)return}if(!H(_e)){if(W()==="intentional"&&S.current){U.clear(),S.current=!1;return}typeof b=="function"&&!b(_e)||N("__outsidePressBubbles")||(u.setOpen(!1,ha(C_e,_e)),A())}}}function Y(_e){W()!=="sloppy"||_e.pointerType==="touch"||!u.select("open")||!n||P(_e)||se(_e)}function X(_e){if(W()!=="sloppy"||!u.select("open")||!n||P(_e))return;const ae=_e.touches[0];ae&&(j.current={startTime:Date.now(),startX:ae.clientX,startY:ae.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},T.start(1e3,()=>{j.current&&(j.current.dismissOnTouchEnd=!1,j.current.dismissOnMouseDown=!1)}))}function ie(_e,ae){const le=uo(_e);if(!le)return;const ge=Ni(le,_e.type,()=>{ae(_e),ge()})}function ee(_e){E.current="touch",ie(_e,X)}function be(_e){T.clear(),_e.type==="pointerdown"&&(E.current=_e.pointerType),!(_e.type==="mousedown"&&j.current&&!j.current.dismissOnMouseDown)&&ie(_e,ae=>{ae.type==="pointerdown"?Y(ae):se(ae)})}function ue(_e){if(!O.current)return;const ae=k.current;if(ne(),W()==="intentional"){if(_e.type==="pointercancel"){ae&&Z();return}if(!H(_e)){if(ae){Z();return}typeof b=="function"&&!b(_e)||(U.clear(),S.current=!0,A())}}}function pe(_e){if(W()!=="sloppy"||!j.current||P(_e))return;const ae=_e.touches[0];if(!ae)return;const le=Math.abs(ae.clientX-j.current.startX),ge=Math.abs(ae.clientY-j.current.startY),Oe=Math.sqrt(le*le+ge*ge);Oe>5&&(j.current.dismissOnTouchEnd=!0),Oe>10&&(se(_e),T.clear(),j.current=null)}function ke(_e){ie(_e,pe)}function je(_e){W()!=="sloppy"||!j.current||P(_e)||(j.current.dismissOnTouchEnd&&se(_e),T.clear(),j.current=null)}function Pe(_e){ie(_e,je)}const Ee=Sr(f),Qe=mh(i&&mh(Ni(Ee,"keydown",D),Ni(Ee,"compositionstart",J),Ni(Ee,"compositionend",V)),v&&mh(Ni(Ee,"click",be,!0),Ni(Ee,"pointerdown",be,!0),Ni(Ee,"pointerup",ue,!0),Ni(Ee,"pointercancel",ue,!0),Ni(Ee,"mousedown",be,!0),Ni(Ee,"mouseup",ue,!0),Ni(Ee,"touchstart",ee,!0),Ni(Ee,"touchmove",ke,!0),Ni(Ee,"touchend",Pe,!0)));return()=>{Qe(),q.clear(),U.clear(),ne(),S.current=!1,A()}},[h,f,i,v,b,d,n,w,x,D,A,y,N,P,m,u,T]);const M=p.useMemo(()=>({onKeyDown:D,onPointerDown:I,onClick:I}),[D,I]),z=p.useMemo(()=>({onKeyDown:D,onPointerDown:F,onMouseDown:F,onClickCapture:_,onMouseDownCapture(q){_(),L(q)},onPointerDownCapture(q){_(),L(q)},onMouseUpCapture:_,onTouchEndCapture:_,onTouchMoveCapture:_}),[D,_,L,F]);return p.useMemo(()=>n?{reference:M,floating:z,trigger:M}:{},[n,M,z])}function PJ(e,t,n){let{reference:i,floating:r}=e;const s=fd(t),o=qD(t),l=HD(o),c=xd(t),u=s==="y",d=i.x+i.width/2-r.width/2,f=i.y+i.height/2-r.height/2,h=i[l]/2-r[l]/2;let m;switch(c){case"top":m={x:d,y:i.y-r.height};break;case"bottom":m={x:d,y:i.y+i.height};break;case"right":m={x:i.x+i.width,y:f};break;case"left":m={x:i.x-r.width,y:f};break;default:m={x:i.x,y:i.y}}const g=mm(t);return g&&(m[o]+=h*(g==="end"?1:-1)*(n&&u?-1:1)),m}async function brt(e,t){var n;t===void 0&&(t={});const{x:i,y:r,platform:s,rects:o,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=wh(t,e),g=Yz(m),v=l[h?f==="floating"?"reference":"floating":f],y=iI(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),w=f==="floating"?{x:i,y:r,width:o.floating.width,height:o.floating.height}:o.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),O=await(s.isElement==null?void 0:s.isElement(x))&&await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1},k=iI(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:x,strategy:c}):w);return{top:(y.top-k.top+g.top)/O.y,bottom:(k.bottom-y.bottom+g.bottom)/O.y,left:(y.left-k.left+g.left)/O.x,right:(k.right-y.right+g.right)/O.x}}const yrt=50,vrt=async(e,t,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:s=[],platform:o}=n,l=o.detectOverflow?o:{...o,detectOverflow:brt},c=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:f}=PJ(u,i,c),h=i,m=0;const g={};for(let b=0;b({name:"arrow",options:e,async fn(t){const{x:n,y:i,placement:r,rects:s,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=wh(e,t)||{};if(u==null)return{};const f=Yz(d),h={x:n,y:i},m=qD(r),g=HD(m),b=await o.getDimensions(u),v=m==="y",y=v?"top":"left",w=v?"bottom":"right",x=v?"clientHeight":"clientWidth",O=s.reference[g]+s.reference[m]-h[m]-s.floating[g],k=h[m]-s.reference[m],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let C=S?S[x]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=l.floating[x]||s.floating[g]);const E=O/2-k/2,j=C/2-b[g]/2-1,T=Jg(f[y],j),R=Jg(f[w],j),A=C-b[g]-R,N=C/2-b[g]/2+E,P=Gz(T,N,A),I=!c.arrow&&mm(r)!=null&&N!==P&&s.reference[g]/2-(NP<=0)){var R,A;const P=(((R=s.flip)==null?void 0:R.index)||0)+1,I=C[P];if(I&&(!(f==="alignment"?w!==fd(I):!1)||T.every(L=>fd(L.placement)===w?L.overflows[0]>0:!0)))return{data:{index:P,overflows:T},reset:{placement:I}};let D=(A=T.filter(_=>_.overflows[0]<=0).sort((_,L)=>_.overflows[1]-L.overflows[1])[0])==null?void 0:A.placement;if(!D)switch(m){case"bestFit":{var N;const _=(N=T.filter(L=>{if(S){const F=fd(L.placement);return F===w||F==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(F=>F>0).reduce((F,M)=>F+M,0)]).sort((L,F)=>L[1]-F[1])[0])==null?void 0:N[0];_&&(D=_);break}case"initialPlacement":D=l;break}if(r!==D)return{reset:{placement:D}}}return{}}}};function DJ(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function MJ(e){return Wnt.some(t=>e[t]>=0)}const Ort=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:i}=t,{strategy:r="referenceHidden",...s}=wh(e,t);switch(r){case"referenceHidden":{const o=await i.detectOverflow(t,{...s,elementContext:"reference"}),l=DJ(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:MJ(l)}}}case"escaped":{const o=await i.detectOverflow(t,{...s,altBoundary:!0}),l=DJ(o,n.floating);return{data:{escapedOffsets:l,escaped:MJ(l)}}}default:return{}}}}},Q_e=new Set(["left","top"]);async function krt(e,t){const{placement:n,platform:i,elements:r}=e,s=await(i.isRTL==null?void 0:i.isRTL(r.floating)),o=xd(n),l=mm(n),c=fd(n)==="y",u=Q_e.has(o)?-1:1,d=s&&c?-1:1,f=wh(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof g=="number"&&(m=l==="end"?g*-1:g),c?{x:m*d,y:h*u}:{x:h*u,y:m*d}}const Srt=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,i;const{x:r,y:s,placement:o,middlewareData:l}=t,c=await krt(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(i=l.arrow)!=null&&i.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:{...c,placement:o}}}}},Ert=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:i,placement:r,platform:s}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:c={fn:w=>{let{x,y:O}=w;return{x,y:O}}},...u}=wh(e,t),d={x:n,y:i},f=await s.detectOverflow(t,u),h=fd(r),m=Xz(h);let g=d[m],b=d[h];const v=(w,x)=>Gz(x+f[w==="y"?"top":"left"],x,x-f[w==="y"?"bottom":"right"]);o&&(g=v(m,g)),l&&(b=v(h,b));const y=c.fn({...t,[m]:g,[h]:b});return{...y,data:{x:y.x-n,y:y.y-i,enabled:{[m]:o,[h]:l}}}}}},Crt=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,i;const{x:r,y:s,placement:o,rects:l,middlewareData:c}=t,{offset:u=0,mainAxis:d=!0,crossAxis:f=!0}=wh(e,t),h={x:r,y:s},m=fd(o),g=Xz(m);let b=h[g],v=h[m];const y=wh(u,t),w=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:(n=y.mainAxis)!=null?n:0,crossAxis:(i=y.crossAxis)!=null?i:0};if(d){const k=g==="y"?"height":"width",S=l.reference[g]-l.floating[k]+w.mainAxis,C=l.reference[g]+l.reference[k]-w.mainAxis;bC&&(b=C)}if(f){var x,O;const k=g==="y"?"width":"height",S=Q_e.has(xd(o)),C=l.reference[m]-l.floating[k]+(S&&((x=c.offset)==null?void 0:x[m])||0)+(S?0:w.crossAxis),E=l.reference[m]+l.reference[k]+(S?0:((O=c.offset)==null?void 0:O[m])||0)-(S?w.crossAxis:0);vE&&(v=E)}return{[g]:b,[m]:v}}}},Art=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:i,platform:r,elements:s}=t,{apply:o=()=>{},...l}=wh(e,t),c=await r.detectOverflow(t,l),u=xd(n),d=mm(n),f=fd(n)==="y",{width:h,height:m}=i.floating;let g,b;u==="top"||u==="bottom"?(g=u,b=d===(await(r.isRTL==null?void 0:r.isRTL(s.floating))?"start":"end")?"left":"right"):(b=u,g=d==="end"?"top":"bottom");const v=m-c.top-c.bottom,y=h-c.left-c.right,w=Jg(m-c[g],v),x=Jg(h-c[b],y),O=t.middlewareData.shift,k=!O;let S=w,C=x;O!=null&&O.enabled.x&&(C=y),O!=null&&O.enabled.y&&(S=v),k&&!d&&(f?C=h-2*Dp(c.left,c.right):S=m-2*Dp(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});const E=await r.getDimensions(s.floating);return h!==E.width||m!==E.height?{reset:{rects:!0}}:{}}}};function z_e(e){const t=Du(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const r=ea(e),s=r?e.offsetWidth:n,o=r?e.offsetHeight:i,l=tI(n)!==s||tI(i)!==o;return l&&(n=s,i=o),{width:n,height:i,$:l}}function oV(e){return Cr(e)?e:e.contextElement}function iw(e){const t=oV(e);if(!ea(t))return Mp(1);const n=t.getBoundingClientRect(),{width:i,height:r,$:s}=z_e(t);let o=(s?tI(n.width):n.width)/i,l=(s?tI(n.height):n.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const Trt=Mp(0);function V_e(e){const t=na(e);return!qz()||!t.visualViewport?Trt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _rt(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===na(e)}function u0(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=oV(e);let o=Mp(1);t&&(i?Cr(i)&&(o=iw(i)):o=iw(e));const l=_rt(s,n,i)?V_e(s):Mp(0);let c=(r.left+l.x)/o.x,u=(r.top+l.y)/o.y,d=r.width/o.x,f=r.height/o.y;if(s&&i){const h=na(s),m=Cr(i)?na(i):i;let g=h,b=Y8(g);for(;b&&m!==g;){const v=iw(b),y=b.getBoundingClientRect(),w=Du(b),x=y.left+(b.clientLeft+parseFloat(w.paddingLeft))*v.x,O=y.top+(b.clientTop+parseFloat(w.paddingTop))*v.y;c*=v.x,u*=v.y,d*=v.x,f*=v.y,c+=x,u+=O,g=na(b),b=Y8(g)}}return iI({width:d,height:f,x:c,y:u})}function XD(e,t){const n=QD(e).scrollLeft;return t?t.left+n:u0(pm(e)).left+n}function H_e(e,t){const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-XD(e,n),r=n.top+t.scrollTop;return{x:i,y:r}}function jrt(e){let{elements:t,rect:n,offsetParent:i,strategy:r}=e;const s=r==="fixed",o=pm(i),l=t?UD(t.floating):!1;if(i===o||l&&s)return n;let c={scrollLeft:0,scrollTop:0},u=Mp(1);const d=Mp(0),f=ea(i);if((f||!s)&&((ll(i)!=="body"||MA(o))&&(c=QD(i)),f)){const m=u0(i);u=iw(i),d.x=m.x+i.clientLeft,d.y=m.y+i.clientTop}const h=o&&!f&&!s?H_e(o,c):Mp(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+h.x,y:n.y*u.y-c.scrollTop*u.y+d.y+h.y}}function Nrt(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Rrt(e){const t=QD(e),n=e.ownerDocument.body,i=Dp(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=Dp(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-t.scrollLeft+XD(e);const o=-t.scrollTop;return Du(n).direction==="rtl"&&(s+=Dp(e.clientWidth,n.clientWidth)-i),{width:i,height:r,x:s,y:o}}const Irt=25;function Prt(e,t,n){n===void 0&&(n="viewport");const i=n==="layoutViewport",r=na(e),s=pm(e),o=r.visualViewport;let l=s.clientWidth,c=s.clientHeight,u=0,d=0;if(o){const h=!qz()||t==="fixed";i?h||(u=-o.offsetLeft,d=-o.offsetTop):(l=o.width,c=o.height,h&&(u=o.offsetLeft,d=o.offsetTop))}if(XD(s)<=0){const h=s.ownerDocument,m=h.body,g=getComputedStyle(m),b=h.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,v=Math.abs(s.clientWidth-m.clientWidth-b),y=getComputedStyle(s).scrollbarGutter==="stable both-edges"?v/2:v;y<=Irt&&(l-=y)}return{width:l,height:c,x:u,y:d}}function Drt(e,t){const n=u0(e,!0,t==="fixed"),i=n.top+e.clientTop,r=n.left+e.clientLeft,s=iw(e),o=e.clientWidth*s.x,l=e.clientHeight*s.y,c=r*s.x,u=i*s.y;return{width:o,height:l,x:c,y:u}}function LJ(e,t,n){let i;if(t==="viewport"||t==="layoutViewport")i=Prt(e,n,t);else if(t==="document")i=Rrt(pm(e));else if(Cr(t))i=Drt(t,n);else{const r=V_e(e);i={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return iI(i)}function Mrt(e,t){const n=t.get(e);if(n)return n;let i=nC(e,[],!1).filter(l=>Cr(l)&&ll(l)!=="body"),r=null;const s=Du(e).position==="fixed";let o=s?Yg(e):e;for(;Cr(o)&&!Pg(o);){const l=Du(o),c=Hz(o),u=r?r.position:s?"fixed":"";!c&&(u==="fixed"||u==="absolute"&&l.position==="static")?i=i.filter(f=>f!==o):r=l,o=Yg(o)}return t.set(e,i),i}function Lrt(e){let{element:t,boundary:n,rootBoundary:i,strategy:r}=e;const o=[...n==="clippingAncestors"?UD(t)?[]:Mrt(t,this._c):[].concat(n),i],l=LJ(t,o[0],r);let c=l.top,u=l.right,d=l.bottom,f=l.left;for(let h=1;h{l(!1,1e-7)},1e3)}C=!1}try{i=new IntersectionObserver(E,{...S,root:s.ownerDocument})}catch{i=new IntersectionObserver(E,S)}i.observe(e)}const c=na(e),u=()=>l(n);return c.addEventListener("resize",u),l(!0),()=>{c.removeEventListener("resize",u),o()}}function aB(e,t,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=i,u=oV(e),d=r||s?[...u?nC(u):[],...t?nC(t):[]]:[];d.forEach(y=>{r&&y.addEventListener("scroll",n),s&&y.addEventListener("resize",n)});const f=u&&l?zrt(u,n,s):null;let h=-1,m=null;o&&(m=new ResizeObserver(y=>{let[w]=y;w&&w.target===u&&m&&t&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),n()}),u&&!c&&m.observe(u),t&&m.observe(t));let g,b=c?u0(e):null;c&&v();function v(){const y=u0(e);b&&!W_e(b,y)&&n(),b=y,g=requestAnimationFrame(v)}return n(),()=>{var y;d.forEach(w=>{r&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),f==null||f(),(y=m)==null||y.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const Vrt=Srt,Hrt=Ert,qrt=wrt,Wrt=Art,Krt=Ort,FJ=xrt,Grt=Crt,Xrt=(e,t,n)=>{const i=new Map,r=n??{},s={...Qrt,...r.platform,_c:i};return vrt(e,t,{...r,platform:s})};var Yrt=typeof document<"u",Zrt=function(){},hN=Yrt?p.useLayoutEffect:Zrt;function lI(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,i,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(i=n;i--!==0;)if(!lI(e[i],t[i]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!{}.hasOwnProperty.call(t,r[i]))return!1;for(i=n;i--!==0;){const s=r[i];if(!(s==="_owner"&&e.$$typeof)&&!lI(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function K_e(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function BJ(e,t){const n=K_e(e);return Math.round(t*n)/n}function U3(e){const t=p.useRef(e);return hN(()=>{t.current=e}),t}function G_e(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:i=[],platform:r,elements:{reference:s,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=p.useState(i);lI(h,i)||m(i);const[g,b]=p.useState(null),[v,y]=p.useState(null),w=p.useCallback(L=>{L!==S.current&&(S.current=L,b(L))},[]),x=p.useCallback(L=>{L!==C.current&&(C.current=L,y(L))},[]),O=s||g,k=o||v,S=p.useRef(null),C=p.useRef(null),E=p.useRef(d),j=c!=null,T=U3(c),R=U3(r),A=U3(u),N=p.useCallback(()=>{if(!S.current||!C.current)return;const L={placement:t,strategy:n,middleware:h};R.current&&(L.platform=R.current),Xrt(S.current,C.current,L).then(F=>{const M={...F,isPositioned:A.current!==!1};P.current&&!lI(E.current,M)&&(E.current=M,vi.flushSync(()=>{f(M)}))})},[h,t,n,R,A]);hN(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(L=>({...L,isPositioned:!1})))},[u]);const P=p.useRef(!1);hN(()=>(P.current=!0,()=>{P.current=!1}),[]),hN(()=>{if(O&&(S.current=O),k&&(C.current=k),O&&k){if(T.current)return T.current(O,k,N);N()}},[O,k,N,T,j]);const I=p.useMemo(()=>({reference:S,floating:C,setReference:w,setFloating:x}),[w,x]),D=p.useMemo(()=>({reference:O,floating:k}),[O,k]),_=p.useMemo(()=>{const L={position:n,left:0,top:0};if(!D.floating)return L;const F=BJ(D.floating,d.x),M=BJ(D.floating,d.y);return l?{...L,transform:"translate("+F+"px, "+M+"px)",...K_e(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:M}},[n,l,D.floating,d.x,d.y]);return p.useMemo(()=>({...d,update:N,refs:I,elements:D,floatingStyles:_}),[d,N,I,D,_])}const Jrt=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:i,padding:r}=typeof e=="function"?e(n):e;return i&&t(i)?i.current!=null?FJ({element:i.current,padding:r}).fn(n):{}:i?FJ({element:i,padding:r}).fn(n):{}}}},X_e=(e,t)=>{const n=Vrt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Y_e=(e,t)=>{const n=Hrt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Z_e=(e,t)=>({fn:Grt(e).fn,options:[e,t]}),J_e=(e,t)=>{const n=qrt(e);return{name:n.name,fn:n.fn,options:[e,t]}},eje=(e,t)=>{const n=Wrt(e);return{name:n.name,fn:n.fn,options:[e,t]}},est=(e,t)=>{const n=Krt(e);return{name:n.name,fn:n.fn,options:[e,t]}},tst=(e,t)=>{const n=Jrt(e);return{name:n.name,fn:n.fn,options:[e,t]}},nst={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId};class lV extends FD{constructor(n){const{syncOnly:i,nested:r,onOpenChange:s,triggerElements:o,...l}=n;super({...l,positionReference:l.referenceElement,domReferenceElement:l.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:M_e(),nested:r,triggerElements:o},nst);Zt(this,"syncOpenEvent",(n,i)=>{(!n||!this.state.open||i!=null&&qnt(i))&&(this.context.dataRef.current.openEvent=n?i:void 0)});Zt(this,"dispatchOpenChange",(n,i)=>{this.syncOpenEvent(n,i.event);const r={open:n,reason:i.reason,nativeEvent:i.event,nested:this.context.nested,triggerElement:i.trigger};this.context.events.emit("openchange",r)});Zt(this,"setOpen",(n,i)=>{var r,s,o,l;if(this.syncOnly){(s=(r=this.context).onOpenChange)==null||s.call(r,n,i);return}this.dispatchOpenChange(n,i),(l=(o=this.context).onOpenChange)==null||l.call(o,n,i)});this.syncOnly=i}}function ist(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:i,floatingId:r,nested:s,onOpenChange:o}=e,l=t.useState("open"),c=t.useState("activeTriggerElement"),u=t.useState(n?"popupElement":"positionerElement"),d=t.context.triggerElements,f=o,h=p.useRef(null);i===void 0&&h.current===null&&(h.current=new lV({open:l,transitionStatus:void 0,referenceElement:c,floatingElement:u,triggerElements:d,onOpenChange:f,floatingId:r,syncOnly:!0,nested:s}));const m=i??h.current;return t.useSyncedValue("floatingId",r),Jn(()=>{const g={open:l,floatingId:r,referenceElement:c,floatingElement:u};Cr(c)&&(g.domReferenceElement=c),m.state.positionReference===m.state.referenceElement&&(g.positionReference=c),m.update(g)},[l,r,c,u,m]),m.context.onOpenChange=f,m.context.nested=s,m}function tje(e,t=!1,n=!1){const[i,r]=p.useState(e&&t?"idle":void 0),[s,o]=p.useState(e);return e&&!s&&(o(!0),r("starting")),!e&&s&&i!=="ending"&&!n&&r("ending"),!e&&!s&&i==="ending"&&r(void 0),Jn(()=>{if(!e&&s&&i!=="ending"&&n){const l=_c.request(()=>{r("ending")});return()=>{_c.cancel(l)}}},[e,s,i,n]),Jn(()=>{if(!e||t)return;const l=_c.request(()=>{r(void 0)});return()=>{_c.cancel(l)}},[t,e]),Jn(()=>{if(!e||!t)return;e&&s&&i!=="idle"&&r("starting");const l=_c.request(()=>{r("idle")});return()=>{_c.cancel(l)}},[t,e,s,i]),{mounted:s,setMounted:o,transitionStatus:i}}const nje={tabIndex:-1,[J8]:""};function ije(e){return t=>t==="touch"?e.current:!0}function rje(e,t=!1){const n=FA(),i=GD()!=null,r=Cd(()=>e(n,i)).current;return ist({popupStore:r,treatPopupAsFloatingElement:t,floatingRootContext:r.state.floatingRootContext,floatingId:n,nested:i,onOpenChange:r.setOpen}),r}function sje({handle:e,store:t}){return Jn(()=>e.attachStore(t),[e,t]),null}function rst(e,t){const n=p.useRef(null),i=p.useRef(null);return p.useCallback(r=>{if(e===void 0)return;let s=!1;if(n.current!==null){const o=n.current,l=i.current,c=t.context.triggerElements.getById(o);l&&c===l&&(t.context.triggerElements.delete(o),s=!0),n.current=null,i.current=null}if(r!==null&&(n.current=e,i.current=r,t.context.triggerElements.add(e,r),s=!0),s){const o=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==o&&t.set("triggerCount",o)}},[t,e])}function aje(e,t,n,i=!1){t?e.preventUnmountingOnClose=!1:i&&(e.preventUnmountingOnClose=!0);const r=(n==null?void 0:n.id)??null;(r||t)&&(e.activeTriggerId=r,e.activeTriggerElement=n??null)}function sst(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function oje(e,t,n,i){const r=n.useState("isMountedByTrigger",e),s=rst(e,n),o=li(c=>{const u=n.select("open"),d=n.select("activeTriggerId");if(d===e){n.update({activeTriggerElement:c,...u?i:null});return}d==null&&u&&n.update({activeTriggerId:e,activeTriggerElement:c,...i})}),l=p.useCallback(c=>{s(c),c&&o(c)},[s,o]);return Jn(()=>{r&&n.update({activeTriggerElement:t.current,...i})},[r,n,t,...Object.values(i)]),{registerTrigger:l,isMountedByThisTrigger:r}}function lje(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,i=p.useRef(null),r=e.useState("open"),s=e.useState("triggerCount"),o=e.useState("activeTriggerId"),l=e.useState("activeTriggerElement");Jn(()=>{if(!r){i.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}const c=e.context.triggerElements.size,u={};e.state.triggerCount!==c&&(u.triggerCount=c);const d=e.select("activeTriggerId");let f=null;if(d){const h=e.context.triggerElements.getById(d);if(h)i.current=d,h!==e.state.activeTriggerElement&&(u.activeTriggerElement=h);else{for(const[m,g]of e.context.triggerElements.entries())if(g===e.state.activeTriggerElement){u.activeTriggerId=m,u.activeTriggerElement=g,i.current=m;break}u.activeTriggerId===void 0&&(i.current===d?f=d:i.current=null)}}else i.current=null;if(!f&&!d&&c===1){const h=e.context.triggerElements.entries().next();if(!h.done){const[m,g]=h.value;u.activeTriggerId=m,u.activeTriggerElement=g,i.current=m}}(u.triggerCount!==void 0||u.activeTriggerId!==void 0||u.activeTriggerElement!==void 0)&&e.update(u),f&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===f&&!e.context.triggerElements.getById(f)){const h=ha(E_e);e.setOpen(!1,h),h.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[r,e,s,o,l,n])}function cje(e,t,n){const{mounted:i,setMounted:r,transitionStatus:s}=tje(e),o=t.useState("preventUnmountingOnClose"),l=e?!1:o;t.useSyncedValues({mounted:i,transitionStatus:s,preventUnmountingOnClose:l});const c=li(()=>{var u,d;r(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n==null||n(),(d=(u=t.context).onOpenChangeComplete)==null||d.call(u,!1)});return $A({enabled:i&&!e&&!l,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:s}}function uje(e,t){e.useSyncedValues(t),Jn(()=>()=>{e.update({activeTriggerProps:rc,inactiveTriggerProps:rc,popupProps:rc})},[e])}function dje(e,t){Jn(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),Jn(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class cV{constructor(){this.idMap=new Map}add(t,n){this.idMap.set(t,n)}delete(t){this.idMap.delete(t)}hasElement(t){for(const n of this.idMap.values())if(n===t)return!0;return!1}hasMatchingElement(t){for(const n of this.idMap.values())if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function ast(){return new lV({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new cV,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function fje(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:ast(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:rc,inactiveTriggerProps:rc,popupProps:rc}}function hje(e,t,n=!1){return new lV({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}const XS=e=>e.triggerIdProp??e.activeTriggerId,uV=e=>e.openProp??e.open,UJ=e=>{var n;return(((n=e.popupElement)==null?void 0:n.id)??e.floatingId)||void 0};function pje(e,t){return t!==void 0&&uV(e)&&XS(e)===t}function ost(e,t){return pje(e,t)?!0:t!==void 0&&uV(e)&&XS(e)==null&&e.triggerCount===1}const mje={open:uV,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:XS,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:UJ,isTriggerActive:(e,t)=>t!==void 0&&XS(e)===t,isOpenedByTrigger:(e,t)=>pje(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&XS(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>ost(e,t)?UJ(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function gje(e){const t=p.useCallback(i=>e===void 0?Bz:e.subscribeStore(i),[e]),n=p.useCallback(()=>e===void 0?void 0:e.store,[e]);return YP.useSyncExternalStore(t,n,()=>e==null?void 0:e.serverStore)}function lst(e){return cst(e,e.rootContext)}function cst(e,t){const{nodeId:n,externalTree:i}=e,r=t.useState("referenceElement"),s=t.useState("floatingElement"),o=t.useState("domReferenceElement"),l=t.useState("open"),c=t.useState("floatingId"),[u,d]=p.useState(null),[f,h]=p.useState(void 0),[m,g]=p.useState(void 0),b=p.useRef(null),v=Q1(i),y=p.useMemo(()=>({reference:r,floating:s,domReference:o}),[r,s,o]),w=G_e({...e,elements:{...y,...u&&{reference:u}}}),x=Cr(f)?f:null,O=m===void 0?t.state.floatingElement:m;t.useSyncedValue("referenceElement",f??null),t.useSyncedValue("domReferenceElement",f===void 0?o:x),t.useSyncedValue("floatingElement",O);const k=p.useCallback(R=>{const A=Cr(R)?{getBoundingClientRect:()=>R.getBoundingClientRect(),getClientRects:()=>R.getClientRects(),contextElement:R}:R;d(A),w.refs.setReference(A)},[w.refs]),S=p.useCallback(R=>{(Cr(R)||R===null)&&(b.current=R,h(R)),(Cr(w.refs.reference.current)||w.refs.reference.current===null||R!==null&&!Cr(R))&&w.refs.setReference(R)},[w.refs,h]),C=p.useCallback(R=>{g(R),w.refs.setFloating(R)},[w.refs]),E=p.useMemo(()=>({...w.refs,setReference:S,setFloating:C,setPositionReference:k,domReference:b}),[w.refs,S,C,k]),j=p.useMemo(()=>({...w.elements,domReference:o}),[w.elements,o]),T=p.useMemo(()=>({...w,dataRef:t.context.dataRef,open:l,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:E,elements:j,nodeId:n,rootStore:t}),[w,E,j,n,t,l,c]);return Jn(()=>{o&&(b.current=o)},[o]),Jn(()=>{t.context.dataRef.current.floatingContext=T;const R=v==null?void 0:v.nodesRef.current.find(A=>A.id===n);R&&(R.context=T)}),p.useMemo(()=>({...w,context:T,refs:E,elements:j,rootStore:t}),[w,E,j,T,t])}class dV{constructor(){Zt(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});Zt(this,"disposeEffect",()=>this.dispose);this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new Mu,this.restTimeout=new Mu,this.handleCloseOptions=void 0}static create(){return new dV}}const cI=new WeakMap;function uI(e){var n,i,r;if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&cI.get(t)===e&&((n=e.pointerEventsScopeElement)==null||n.style.removeProperty("pointer-events"),(i=e.pointerEventsReferenceElement)==null||i.style.removeProperty("pointer-events"),(r=e.pointerEventsFloatingElement)==null||r.style.removeProperty("pointer-events"),cI.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function bje(e,t){const{scopeElement:n,referenceElement:i,floatingElement:r}=t,s=cI.get(n);s&&s!==e&&uI(s),uI(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=i,e.pointerEventsFloatingElement=r,cI.set(n,e),n.style.pointerEvents="none",i.style.pointerEvents="auto",r.style.pointerEvents="auto"}function yje(e){const t=e.context.dataRef.current,n=Cd(()=>t.hoverInteractionState??dV.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=n),LD(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function ust(e,t={}){const{enabled:n=!0,closeDelay:i=0,nodeId:r}=t,s="rootStore"in e?e.rootStore:e,o=s.useState("open"),l=s.useState("floatingElement"),c=s.useState("domReferenceElement"),{dataRef:u}=s.context,d=Q1(),f=GD(),h=yje(s),m=l0(),g=li(()=>{var y;return P_e((y=u.current.openEvent)==null?void 0:y.type,h.interactedInside)}),b=li(()=>{var y;return art((y=u.current.openEvent)==null?void 0:y.type)}),v=li(()=>{uI(h)});Jn(()=>{o||(h.pointerType=void 0,h.restTimeoutPending=!1,h.interactedInside=!1,v())},[o,h,v]),p.useEffect(()=>v,[v]),Jn(()=>{var y,w,x,O,k;if(n&&o&&(y=h.handleCloseOptions)!=null&&y.blockPointerEvents&&b()&&Cr(c)&&l){const S=c,C=l,E=Sr(l),j=(x=(w=d==null?void 0:d.nodesRef.current.find(N=>N.id===f))==null?void 0:w.context)==null?void 0:x.elements.floating;j&&(j.style.pointerEvents="");const T=h.pointerEventsScopeElement!==C?h.pointerEventsScopeElement:null,R=j!==C?j:null,A=((k=(O=h.handleCloseOptions)==null?void 0:O.getScope)==null?void 0:k.call(O))??T??R??S.closest("[data-rootownerid]")??E.body;return bje(h,{scopeElement:A,referenceElement:S,floatingElement:C}),()=>{v()}}},[n,o,c,l,h,b,d,f,v]),p.useEffect(()=>{if(!n)return;function y(){return!!(d&&f&&Zg(d.nodesRef.current,f).length>0)}function w(E){const j=rB(i,"close",h.pointerType),T=()=>{s.setOpen(!1,ha(pu,E)),d==null||d.events.emit("floating.closed",E)};j?h.openChangeTimeout.start(j,T):(h.openChangeTimeout.clear(),T())}function x(E){const j=uo(E);if(!Qnt(j)){h.interactedInside=!1;return}h.interactedInside=(j==null?void 0:j.closest("[aria-haspopup]"))!=null}function O(){h.openChangeTimeout.clear(),m.clear(),d==null||d.events.off("floating.closed",S),v()}function k(E){var A;if(y()&&d){d.events.on("floating.closed",S);return}if(J2e(E.relatedTarget,s.context.triggerElements))return;const j=((A=u.current.floatingContext)==null?void 0:A.nodeId)??r,T=E.relatedTarget;if(!(d&&j&&Cr(T)&&Zg(d.nodesRef.current,j,!1).some(N=>{var P;return ii((P=N.context)==null?void 0:P.elements.floating,T)}))){if(h.handler){h.handler(E);return}v(),b()&&!g()&&w(E)}}function S(E){!d||!f||y()||m.start(0,()=>{d.events.off("floating.closed",S),s.setOpen(!1,ha(pu,E)),d.events.emit("floating.closed",E)})}const C=l;return mh(C&&Ni(C,"mouseenter",O),C&&Ni(C,"mouseleave",k),C&&Ni(C,"pointerdown",x,!0),()=>{d==null||d.events.off("floating.closed",S)})},[n,l,s,u,i,r,b,g,v,h,d,f,m])}const dst={current:null};function fst(e,t={}){var D;const{enabled:n=!0,delay:i=0,handleClose:r=null,mouseOnly:s=!1,restMs:o=0,move:l=!0,triggerElementRef:c=dst,externalTree:u,isActiveTrigger:d=!0,getHandleCloseContext:f,isClosing:h,shouldOpen:m,guardStaleOpen:g=!1}=t,b="rootStore"in e?e.rootStore:e,{dataRef:v,events:y}=b.context,w=Q1(u),x=yje(b),O=p.useRef(!1),k=ec(r),S=ec(i),C=ec(o),E=ec(n),j=ec(m),T=ec(h),R=li(()=>{var _;return P_e((_=v.current.openEvent)==null?void 0:_.type,x.interactedInside)}),A=li(()=>{var _;return((_=j.current)==null?void 0:_.call(j))!==!1}),N=li((_,L,F)=>{const M=b.context.triggerElements;if(M.hasElement(L))return!_||!ii(_,L);if(!Cr(F))return!1;const z=F;return M.hasMatchingElement(q=>ii(q,z))&&(!_||!ii(_,z))}),P=li(()=>{if(!x.handler)return;Sr(b.select("domReferenceElement")).removeEventListener("mousemove",x.handler),x.handler=void 0}),I=li(()=>{uI(x)});return d&&(x.handleCloseOptions=(D=k.current)==null?void 0:D.__options),p.useEffect(()=>P,[P]),p.useEffect(()=>{if(!n)return;function _(L){L.open?O.current=!1:(O.current=L.reason===pu,P(),x.openChangeTimeout.clear(),x.restTimeout.clear(),x.blockMouseMove=!0,x.restTimeoutPending=!1)}return y.on("openchange",_),()=>{y.off("openchange",_)}},[n,y,x,P]),p.useEffect(()=>{if(!n)return;function _(U,J=!0){const V=rB(S.current,"close",x.pointerType);V?x.openChangeTimeout.start(V,()=>{b.setOpen(!1,ha(pu,U)),w==null||w.events.emit("floating.closed",U)}):J&&(x.openChangeTimeout.clear(),b.setOpen(!1,ha(pu,U)),w==null||w.events.emit("floating.closed",U))}const L=c.current??(d?b.select("domReferenceElement"):null);if(!Cr(L))return;function F(U){var pe;if(x.openChangeTimeout.clear(),x.blockMouseMove=!1,s&&!tw(x.pointerType))return;const J=SJ(C.current),V=rB(S.current,"open",x.pointerType),Z=uo(U),ne=U.currentTarget??null,W=b.select("domReferenceElement");let G=ne;if(Cr(Z)&&!b.context.triggerElements.hasElement(Z)){for(const ke of b.context.triggerElements.elements())if(ii(ke,Z)){G=ke;break}}Cr(ne)&&Cr(W)&&!b.context.triggerElements.hasElement(ne)&&ii(ne,W)&&(G=W);const H=G==null?!1:N(W,G,Z),se=b.select("open"),Y=((pe=T.current)==null?void 0:pe.call(T))??b.select("transitionStatus")==="ending",X=!se&&Y&&O.current,ie=!H&&Cr(G)&&Cr(W)&&ii(W,G)&&X,ee=J>0&&!V,be=H&&(se||X)||ie,ue=!se||H;if(be){A()&&b.setOpen(!0,ha(pu,U,G));return}ee||(V?x.openChangeTimeout.start(V,()=>{ue&&A()&&b.setOpen(!0,ha(pu,U,G))}):ue&&A()&&b.setOpen(!0,ha(pu,U,G)))}function M(U){if(R()){I();return}P();const J=b.select("domReferenceElement"),V=Sr(J);x.restTimeout.clear(),x.restTimeoutPending=!1;const Z=v.current.floatingContext??(f==null?void 0:f());if(J2e(U.relatedTarget,b.context.triggerElements))return;if(k.current&&Z){b.select("open")||x.openChangeTimeout.clear();const W=c.current;x.handler=k.current({...Z,tree:w,x:U.clientX,y:U.clientY,onClose(){I(),P(),E.current&&!R()&&W===b.select("domReferenceElement")&&_(U,!0)}}),V.addEventListener("mousemove",x.handler),x.handler(U);return}(x.pointerType==="touch"?!ii(b.select("floatingElement"),U.relatedTarget):!0)&&_(U)}function z(U){ii(L,U.relatedTarget)||(x.openChangeTimeout.clear(),x.restTimeout.clear(),x.restTimeoutPending=!1)}const q=g?Ni(L,"mouseout",z):void 0;return l?mh(Ni(L,"mousemove",F,{once:!0}),Ni(L,"mouseenter",F),Ni(L,"mouseleave",M),q):mh(Ni(L,"mouseenter",F),Ni(L,"mouseleave",M),q)},[P,I,v,S,b,n,k,x,d,N,R,s,l,C,c,w,E,f,T,A,g]),p.useMemo(()=>{if(!n)return;function _(L){x.pointerType=L.pointerType}return{onPointerDown:_,onPointerEnter:_,onMouseMove(L){var Z,ne,W;const{nativeEvent:F}=L,M=L.currentTarget,z=b.select("domReferenceElement"),q=b.select("open"),U=N(z,M,L.target);if(s&&!tw(x.pointerType))return;if(q&&U&&((Z=x.handleCloseOptions)!=null&&Z.blockPointerEvents)){const G=b.select("floatingElement");if(G){const H=((W=(ne=x.handleCloseOptions)==null?void 0:ne.getScope)==null?void 0:W.call(ne))??M.ownerDocument.body;bje(x,{scopeElement:H,referenceElement:M,floatingElement:G})}}const J=SJ(C.current);if(q&&!U||J===0||!U&&x.restTimeoutPending&&L.movementX**2+L.movementY**2<2)return;x.restTimeout.clear();function V(){if(x.restTimeoutPending=!1,R())return;const G=b.select("open");!x.blockMouseMove&&(!G||U)&&A()&&b.setOpen(!0,ha(pu,F,M))}x.pointerType==="touch"?vi.flushSync(()=>{V()}):U&&q?V():(x.restTimeoutPending=!0,x.restTimeout.start(J,V))}}},[n,x,R,N,s,b,C,A])}const QJ=.1,hst=QJ*QJ,Wr=.5;function t_(e,t,n,i,r,s){return i>=t!=s>=t&&e<=(r-n)*(t-i)/(s-i)+n}function n_(e,t,n,i,r,s,o,l,c,u){let d=!1;return t_(e,t,n,i,r,s)&&(d=!d),t_(e,t,r,s,o,l)&&(d=!d),t_(e,t,o,l,c,u)&&(d=!d),t_(e,t,c,u,n,i)&&(d=!d),d}function pst(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function i_(e,t,n,i,r,s){const o=Math.min(n,r),l=Math.max(n,r),c=Math.min(i,s),u=Math.max(i,s);return e>=o&&e<=l&&t>=c&&t<=u}function mst(e={}){const{blockPointerEvents:t=!1}=e,n=new Mu,i=({x:r,y:s,placement:o,elements:l,onClose:c,nodeId:u,tree:d})=>{const f=o==null?void 0:o.split("-")[0];let h=!1,m=null,g=null,b=typeof performance<"u"?performance.now():0;function v(w,x){const O=performance.now(),k=O-b;if(m===null||g===null||k===0)return m=w,g=x,b=O,!1;const S=w-m,C=x-g,E=S*S+C*C,j=k*k*hst;return m=w,g=x,b=O,E0)}function N(){A()||y()}if(A())return;const P=O.getBoundingClientRect(),I=k.getBoundingClientRect(),D=r>I.right-I.width/2,_=s>I.bottom-I.height/2,L=I.width>P.width,F=I.height>P.height,M=(L?P:I).left,z=(L?P:I).right,q=(F?P:I).top,U=(F?P:I).bottom;if(f==="top"&&s>=P.bottom-1||f==="bottom"&&s<=P.top+1||f==="left"&&r>=P.right-1||f==="right"&&r<=P.left+1){N();return}let J=!1;switch(f){case"top":J=i_(S,C,M,P.top+1,z,I.bottom-1);break;case"bottom":J=i_(S,C,M,I.top+1,z,P.bottom-1);break;case"left":J=i_(S,C,I.right-1,U,P.left+1,q);break;case"right":J=i_(S,C,P.right-1,U,I.left+1,q);break}if(J)return;if(h&&!pst(S,C,P)){N();return}if(!j&&v(S,C)){N();return}let V=!1;switch(f){case"top":{const Z=L?Wr/2:Wr*4,ne=L||D?r+Z:r-Z,W=L?r-Z:D?r+Z:r-Z,G=s+Wr+1,H=D||L?I.bottom-Wr:I.top,se=D?L?I.bottom-Wr:I.top:I.bottom-Wr;V=n_(S,C,ne,G,W,G,I.left,H,I.right,se);break}case"bottom":{const Z=L?Wr/2:Wr*4,ne=L||D?r+Z:r-Z,W=L?r-Z:D?r+Z:r-Z,G=s-Wr,H=D||L?I.top+Wr:I.bottom,se=D?L?I.top+Wr:I.bottom:I.top+Wr;V=n_(S,C,ne,G,W,G,I.left,H,I.right,se);break}case"left":{const Z=F?Wr/2:Wr*4,ne=F||_?s+Z:s-Z,W=F?s-Z:_?s+Z:s-Z,G=r+Wr+1,H=_||F?I.right-Wr:I.left,se=_?F?I.right-Wr:I.left:I.right-Wr;V=n_(S,C,H,I.top,se,I.bottom,G,ne,G,W);break}case"right":{const Z=F?Wr/2:Wr*4,ne=F||_?s+Z:s-Z,W=F?s-Z:_?s+Z:s-Z,G=r-Wr,H=_||F?I.left+Wr:I.right,se=_?F?I.left+Wr:I.right:I.left+Wr;V=n_(S,C,G,ne,G,W,H,I.top,se,I.bottom);break}}V?h||n.start(40,N):N()}};return i.__options={...e,blockPointerEvents:t},i}const gst=p.createContext(void 0);function bst(){const e=p.useContext(gst);return(e==null?void 0:e.direction)??"ltr"}const yst=e=>({name:"arrow",options:e,async fn(t){var F,M;const{x:n,y:i,placement:r,rects:s,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:d=0,offsetParent:f="real"}=wh(e,t)||{};if(u==null)return{};const h=Yz(d),m={x:n,y:i},g=qD(r),b=HD(g),v=await o.getDimensions(u),y=g==="y",w=y?"top":"left",x=y?"bottom":"right",O=y?"clientHeight":"clientWidth",k=s.reference[b]+s.reference[g]-m[g]-s.floating[b],S=m[g]-s.reference[g],C=f==="real"?await((F=o.getOffsetParent)==null?void 0:F.call(o,u)):l.floating;let E=l.floating[O]||s.floating[b];(!E||!await((M=o.isElement)==null?void 0:M.call(o,C)))&&(E=l.floating[O]||s.floating[b]);const j=k/2-S/2,T=E/2-v[b]/2-1,R=Math.min(h[w],T),A=Math.min(h[x],T),N=R,P=E-v[b]-A,I=E/2-v[b]/2+j,D=Gz(N,I,P),_=!c.arrow&&mm(r)!=null&&I!==D&&s.reference[b]/2-(I({...yst(e),options:[e,t]}),xst={name:"hide",async fn(e){const{width:t,height:n,x:i,y:r}=e.rects.reference,s=t===0&&n===0&&i===0&&r===0,o=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||s}}}},wst={sideX:"left",sideY:"top"},zJ="--available-width",VJ="--available-height";function vje(e,t,n){const i=e==="inline-start"||e==="inline-end";return{top:"top",right:i?n?"inline-start":"inline-end":"right",bottom:"bottom",left:i?n?"inline-end":"inline-start":"left"}[t]}function HJ(e,t,n){const{rects:i,placement:r}=e;return{side:vje(t,xd(r),n),align:mm(r)||"center",anchor:{width:i.reference.width,height:i.reference.height},positioner:{width:i.floating.width,height:i.floating.height}}}function Ost(e){return kst(e,lst)}function kst(e,t){var tt,mt;const{anchor:n,positionMethod:i="absolute",side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:l=0,collisionBoundary:c,collisionPadding:u=5,sticky:d=!1,arrowPadding:f=5,disableAnchorTracking:h=!1,inline:m,keepMounted:g=!1,floatingRootContext:b,mounted:v,collisionAvoidance:y,shift:w,nodeId:x,adaptiveOrigin:O,lazyFlip:k=!1,externalTree:S}=e,[C,E]=p.useState(null);!v&&C!==null&&E(null);const j=y.side||"flip",T=y.align||"flip",R=y.fallbackAxisSide||"end",A=(w==null?void 0:w.crossAxis)??!1,N=w==null?void 0:w.rootBoundary,P=typeof n=="function"?n:void 0,I=li(P),D=P?I:n,_=ec(n),L=ec(v),M=bst()==="rtl",z=C||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":M?"left":"right","inline-start":M?"right":"left"}[r],q=o==="center"?z:`${z}-${o}`;let U=u;typeof U=="number"?U={top:U,right:U,bottom:U,left:U}:U&&(U={top:U.top||0,right:U.right||0,bottom:U.bottom||0,left:U.left||0});const J=1,V=r==="bottom"?J:0,Z=r==="top"?J:0,ne=r==="right"?J:0,W=r==="left"?J:0,G={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:U},H=p.useRef(null),se=ec(s),Y=ec(l),X=typeof s!="function"?s:0,ie=typeof l!="function"?l:0,ee=[];m&&ee.push(m),ee.push(X_e(Ne=>{const wt=HJ(Ne,r,M),jt=typeof se.current=="function"?se.current(wt):se.current,Yt=typeof Y.current=="function"?Y.current(wt):Y.current;return{mainAxis:jt,crossAxis:Yt,alignmentAxis:Yt}},[X,ie,M,r]));const be=T==="none"&&j!=="shift",ue=!be&&(d||A||j==="shift"),pe=j==="none"?null:J_e({...G,padding:{top:U.top+J+V,right:U.right+J+W,bottom:U.bottom+J+Z,left:U.left+J+ne},mainAxis:!A&&j==="flip",crossAxis:T==="flip"?"alignment":!1,fallbackAxisSideDirection:R}),ke=be?null:Y_e({...G,rootBoundary:N,mainAxis:T!=="none",crossAxis:ue,limiter:d||A?void 0:Z_e(Ne=>{if(!H.current)return{};const{width:wt,height:jt}=H.current.getBoundingClientRect(),Yt=fd(xd(Ne.placement)),wn=Yt==="y"?wt:jt,We=Yt==="y"?U.left+U.right:U.top+U.bottom;return{offset:wn/2+We/2}})},[G,d,A,N,U,T]);j==="shift"||T==="shift"||o==="center"?ee.push(ke,pe):ee.push(pe,ke),ee.push(eje({...G,apply({elements:{floating:Ne},availableWidth:wt,availableHeight:jt,rects:Yt}){if(!L.current)return;const wn=Ne.style;wn.setProperty(zJ,`${wt}px`),wn.setProperty(VJ,`${jt}px`);const We=na(Ne).devicePixelRatio||1,{x:kt,y:He,width:nt,height:et}=Yt.reference,ft=(Math.round((kt+nt)*We)-Math.round(kt*We))/We,St=(Math.round((He+et)*We)-Math.round(He*We))/We;wn.setProperty("--anchor-width",`${ft}px`),wn.setProperty("--anchor-height",`${St}px`)}}),vst(Ne=>({element:H.current||Sr(Ne.elements.floating).createElement("div"),padding:f,offsetParent:"floating"}),[f]),{name:"transformOrigin",fn(Ne){var Me,on,kn;const{elements:wt,middlewareData:jt,placement:Yt,rects:wn,y:We}=Ne,kt=xd(Yt),He=fd(kt),nt=H.current,et=((Me=jt.arrow)==null?void 0:Me.x)||0,ft=((on=jt.arrow)==null?void 0:on.y)||0,St=(nt==null?void 0:nt.clientWidth)||0,Ct=(nt==null?void 0:nt.clientHeight)||0,It=et+St/2,Gt=ft+Ct/2,Ge=Math.abs(((kn=jt.shift)==null?void 0:kn.y)||0),xt=wn.reference.height/2,yt=typeof s=="function"?s(HJ(Ne,r,M)):s,nn=Ge>yt,Qt={top:`${It}px calc(100% + ${yt}px)`,bottom:`${It}px ${-yt}px`,left:`calc(100% + ${yt}px) ${Gt}px`,right:`${-yt}px ${Gt}px`}[kt],cn=`${It}px ${wn.reference.y+xt-We}px`;return wt.floating.style.setProperty("--transform-origin",ue&&He==="y"&&nn?cn:Qt),{}}},xst,O),Jn(()=>{!v&&b&&b.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[v,b]);const je=p.useMemo(()=>({elementResize:!h&&typeof ResizeObserver<"u",layoutShift:!h&&typeof IntersectionObserver<"u"}),[h]),{refs:Pe,elements:Ee,x:Qe,y:_e,middlewareData:ae,update:le,placement:ge,context:Oe,isPositioned:Se,floatingStyles:qe}=t({rootContext:b,open:g?v:void 0,placement:q,middleware:ee,strategy:i,whileElementsMounted:g?void 0:(...Ne)=>aB(...Ne,je),nodeId:x,externalTree:S}),{sideX:Xe,sideY:ye}=ae.adaptiveOrigin||wst,we=Se?i:"fixed",Ae=p.useMemo(()=>{let Ne;return Se?O?Ne={position:we,[Xe]:Qe,[ye]:_e}:Ne={...qe,position:we}:Ne={position:we,top:0,left:0},Ne[zJ]="100vw",Ne[VJ]="100vh",Se||(Ne.opacity=0),Ne},[O,we,Xe,Qe,ye,_e,qe,Se]),Ve=p.useRef(null);Jn(()=>{if(!v)return;const Ne=_.current,wt=typeof Ne=="function"?Ne():Ne,Yt=(qJ(wt)?wt.current:wt)||null||null;Yt!==Ve.current&&(Pe.setPositionReference(Yt),Ve.current=Yt)},[v,Pe,D,_]),p.useEffect(()=>{if(!v)return;const Ne=_.current;typeof Ne!="function"&&qJ(Ne)&&Ne.current!==Ve.current&&(Pe.setPositionReference(Ne.current),Ve.current=Ne.current)},[v,Pe,D,_]),p.useEffect(()=>{if(g&&v&&Ee.reference&&Ee.floating)return aB(Ee.reference,Ee.floating,le,je)},[g,v,Ee,le,je]);const Be=xd(ge),_t=vje(r,Be,M),Pt=mm(ge)||"center",Kt=!!((tt=ae.hide)!=null&&tt.referenceHidden);Jn(()=>{k&&v&&Se&&Be!==z&&E(Be)},[k,v,Se,Be,z]);const Et=p.useMemo(()=>{var Ne,wt;return{position:"absolute",top:(Ne=ae.arrow)==null?void 0:Ne.y,left:(wt=ae.arrow)==null?void 0:wt.x}},[ae.arrow]),vt=((mt=ae.arrow)==null?void 0:mt.centerOffset)!==0;return p.useMemo(()=>({positionerStyles:Ae,arrowStyles:Et,arrowRef:H,arrowUncentered:vt,side:_t,align:Pt,physicalSide:Be,anchorHidden:Kt,refs:Pe,context:Oe,isPositioned:Se,update:le}),[Ae,Et,H,vt,_t,Pt,Be,Kt,Pe,Oe,Se,le])}function qJ(e){return e!=null&&"current"in e}(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=aI.startingStyle]="startingStyle",e[e.endingStyle=aI.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({});const Sst={"data-popup-open":""},Est={"data-popup-open":"","data-pressed":""},Cst={"data-open":""},Ast={"data-closed":""},Tst={"data-anchor-hidden":""},xje={open(e){return e?Sst:null}},_st={open(e){return e?Est:null}},fV={open(e){return e?Cst:Ast},anchorHidden(e){return e?Tst:null}},wje={...fV,...WD};function Oje(e){return e==="starting"?Pit:rc}function jst(e,t,{styles:n,transitionStatus:i,props:r,refs:s,hidden:o,inert:l=!1}){const c={...n};return l&&(c.pointerEvents="none"),Pa("div",e,{state:t,ref:s,props:[{role:"presentation",hidden:o,style:c},Oje(i),r],stateAttributesMapping:fV})}function kje(){const e=Uz(),t=e.useState("toasts");return p.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function vf({orientation:e="vertical",maxHeight:t,hideScrollbar:n=!1,fadeEdges:i=!1,contentClassName:r="",className:s="",style:o,children:l,hasMore:c=!1,onLoadMore:u,threshold:d=24,onScroll:f,ref:h,...m}){const[g,b]=p.useState(!1),[v,y]=p.useState(!1),[w,x]=p.useState({top:!1,bottom:!1}),O=p.useRef(null),k=p.useRef(null),S=i&&e!=="horizontal",C=!!u&&e!=="horizontal";p.useImperativeHandle(h,()=>O.current,[]),p.useEffect(()=>()=>{var T;(T=k.current)==null||T.abort()},[]);const E=p.useCallback(()=>{const T=O.current;if(!S||!T)return;const R=T.scrollHeight-T.clientHeight,A=R>1&&T.scrollTop>1,N=R>1&&R-T.scrollTop>1;x(P=>P.top===A&&P.bottom===N?P:{top:A,bottom:N})},[S]);p.useEffect(()=>{const T=O.current;if(!S||!T)return;const R=new ResizeObserver(E);R.observe(T);for(const A of T.children)R.observe(A);return E(),()=>R.disconnect()},[S,C,E]);async function j(){if(!u||!c||k.current)return;const T=new AbortController;k.current=T,b(!0),y(!1);try{await u(T.signal)}catch{T.signal.aborted||y(!0)}finally{T.signal.aborted||b(!1),k.current===T&&(k.current=null)}}return a.jsxs("div",{...m,ref:O,className:`studio-scroll-area ${s}`.trim(),"data-orientation":e,"data-hide-scrollbar":n||void 0,"data-fade-edges":S&&(w.top||w.bottom)||void 0,"data-fade-top":S&&w.top||void 0,"data-fade-bottom":S&&w.bottom||void 0,style:{maxHeight:t,...o},onScroll:T=>{f==null||f(T),E();const R=T.currentTarget;!T.defaultPrevented&&e!=="horizontal"&&!v&&R.scrollTop>0&&R.scrollHeight-R.clientHeight-R.scrollTop<=Math.max(0,d)&&j()},children:[a.jsx("div",{className:`studio-scroll-area__content ${r}`.trim(),"aria-busy":u?g:void 0,children:l}),u&&e!=="horizontal"&&a.jsx(a.Fragment,{children:a.jsxs("div",{className:"studio-scroll-area__footer",children:[g?a.jsx(o0,{size:24}):a.jsx("span",{role:"status","aria-live":"polite",children:v?"加载失败":c?"向下滚动加载更多":"已加载全部"}),!g&&c&&a.jsx("button",{type:"button",onClick:()=>void j(),children:v?"重试":"加载更多"})]})})]})}function Nst(){const{add:e,close:t}=kje();return{add:p.useCallback(({id:i,title:r,description:s,variant:o="info",duration:l,action:c,closeLabel:u,onClose:d})=>e({id:i,title:r,description:s,timeout:l,priority:"low",onClose:d,data:{variant:o,action:c,closeLabel:u}}),[e]),dismiss:t}}function Rst({position:e,label:t}){const{toasts:n,close:i}=kje();return a.jsx(irt,{children:a.jsx(_it,{className:"studio-toast-viewport","data-position":e,"data-empty":n.length===0||void 0,"aria-label":t,render:a.jsx(vf,{contentClassName:"studio-toast-viewport__stack"}),children:n.map(r=>{var s,o,l;return a.jsx(qit,{toast:r,className:"studio-toast-root",swipeDirection:[],children:a.jsx(snt,{role:"presentation",variant:(s=r.data)==null?void 0:s.variant,title:r.title!=null?a.jsx(Xit,{render:a.jsx("div",{}),children:r.title}):void 0,description:r.description!=null?a.jsx(Git,{render:a.jsx("div",{}),children:r.description}):void 0,action:(o=r.data)==null?void 0:o.action,closeLabel:(l=r.data)==null?void 0:l.closeLabel,onDismiss:()=>i(r.id)})},r.id)})})})}function Ist({children:e,duration:t=4e3,position:n="top-center",label:i="通知"}){return a.jsxs(fit,{timeout:t,limit:3,children:[e,a.jsx(Rst,{position:n,label:i})]})}function Pst({ownerId:e,sessionId:t,onOpen:n,hideNotices:i,refreshKey:r,onUpdate:s}){const{t:o}=Te("sandbox"),l=Nst(),c=p.useRef(new Map),u=p.useRef(new Map),d=p.useRef(null),f=p.useRef({sessionId:t,onOpen:n,toast:l,t:o,hideNotices:i,onUpdate:s});return f.current={sessionId:t,onOpen:n,toast:l,t:o,hideNotices:i,onUpdate:s},p.useEffect(()=>{if(i){f.current.toast.dismiss(),u.current.clear();return}for(const h of c.current.values())h.sessionId===t&&(f.current.toast.dismiss(h.runId),u.current.delete(h.runId))},[t,i]),p.useEffect(()=>{var h;(h=d.current)==null||h.call(d)},[r]),p.useEffect(()=>{if(!e)return;const h=new AbortController,m=c.current,g=u.current,b=new Set;let v,y=!1,w=[],x="";const O=(C,E=x)=>{var j,T;x=E,h.signal.aborted||(T=(j=f.current).onUpdate)==null||T.call(j,{ownerId:e,runs:w,loading:C,error:E})},k=C=>{const{toast:E,t:j,sessionId:T,onOpen:R}=f.current;if(!h.signal.aborted){if(f.current.hideNotices||C.sessionId===T){E.dismiss(C.runId),g.delete(C.runId);return}b.has(C.runId)||g.get(C.runId)===C.state||(g.set(C.runId,C.state),E.add({id:C.runId,duration:0,title:j(`taskNotice.${C.state}`),description:C.message.slice(0,80),variant:C.state==="succeeded"?"success":C.state==="failed"?"error":"info",closeLabel:j("taskNotice.hide"),onClose:()=>b.add(C.runId),action:a.jsx(Ki,{variant:"secondary",onClick:()=>{R(C.sessionId,h.signal).catch(A=>{h.signal.aborted||E.add({id:"task-open-error",variant:"error",description:A instanceof Error?A.message:String(A)})})},children:j("taskNotice.open")})}))}},S=async(C=!1)=>{if(!(y||h.signal.aborted)){clearTimeout(v),y=!0,C&&O(!0);try{const E=await ef.active(h.signal);if(h.signal.aborted)return;w=E,O(!1,"");const j=new Set(E.map(T=>T.runId));for(const T of m.values())if(!j.has(T.runId)&&!hu(T)){let R;try{R=await ef.get(T.runId,h.signal)}catch(A){if(A instanceof qw&&A.status===404){m.delete(T.runId),g.delete(T.runId),f.current.toast.dismiss(T.runId);continue}throw A}if(h.signal.aborted)return;m.set(R.runId,R),k(R)}for(const T of E)m.set(T.runId,T),k(T);f.current.toast.dismiss("task-connection")}catch(E){if(h.signal.aborted)return;E instanceof qw&&[401,403].includes(E.status)&&(w=[],m.clear(),g.clear(),f.current.toast.dismiss()),O(!1,E instanceof Error?E.message:f.current.t("taskNotice.reconnecting")),!h.signal.aborted&&m.size&&!f.current.hideNotices&&f.current.toast.add({id:"task-connection",duration:0,description:f.current.t("taskNotice.reconnecting")})}finally{y=!1,h.signal.aborted||(v=setTimeout(S,3e3))}}};return d.current=()=>{S(!0)},O(!0),S(),()=>{h.abort(),clearTimeout(v),d.current=null,f.current.toast.dismiss()}},[e]),null}function Dst(e){const{t}=Te("sandbox");return a.jsx(Ist,{position:"bottom-right",label:t("taskNotice.label"),children:a.jsx(Pst,{...e},e.ownerId)})}const sC=["super_admin","admin","developer","user"];class aC extends Error{constructor(t,n){super(t),this.code=t,this.status=n}}async function Sje(e){let t;try{t=await e.json()}catch{throw new aC("invalid_response",e.status)}if(!e.ok){const n=t&&typeof t=="object"&&"code"in t&&typeof t.code=="string"?t.code:"request_failed";throw new aC(n,e.status)}return t}function Eje(e){return!e||typeof e!="object"?!1:"id"in e&&typeof e.id=="string"&&"name"in e&&typeof e.name=="string"&&"email"in e&&typeof e.email=="string"&&"role"in e&&sC.some(t=>t===e.role)&&"status"in e&&typeof e.status=="string"&&"lastLogin"in e&&typeof e.lastLogin=="string"&&"protected"in e&&typeof e.protected=="boolean"&&"currentUser"in e&&typeof e.currentUser=="boolean"&&"roleConflict"in e&&typeof e.roleConflict=="boolean"}async function Mst(e){const t=new URLSearchParams({page:String(e.page),pageSize:"20",query:e.query});e.role&&t.set("role",e.role);const n=await Sje(await vn(`/web/users?${t}`,{signal:e.signal,cache:"no-store"}));if(!n||typeof n!="object"||!("items"in n)||!Array.isArray(n.items)||!n.items.every(Eje)||!("total"in n)||typeof n.total!="number"||!("poolTotal"in n)||typeof n.poolTotal!="number"||!("page"in n)||typeof n.page!="number"||!("pageSize"in n)||typeof n.pageSize!="number"||!("userPoolId"in n)||typeof n.userPoolId!="string"||!("clientId"in n)||typeof n.clientId!="string"||!("provider"in n)||!["volcengine","byteplus"].includes(String(n.provider)))throw new aC("invalid_response",502);return n}async function Lst(e,t,n){const i=await Sje(await vn(`/web/users/${encodeURIComponent(e.id)}/role`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({role:t,expectedRole:e.role}),signal:n}));if(!i||typeof i!="object"||!("user"in i)||!Eje(i.user))throw new aC("invalid_response",502);return i.user}function $st(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m7 9.5 5 5 5-5"})})}function Fst(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m6.5 12.5 3.5 3.5 7.5-8"})})}function xf({ariaLabel:e,value:t,valueLabel:n,placeholder:i,options:r,disabled:s=!1,searchValue:o,searchPlaceholder:l,loading:c=!1,hasMore:u=!1,emptyMessage:d,onSearchChange:f,onLoadMore:h,onChange:m}){const{t:g}=Te("ui"),b=l??g("deploymentSelect.searchPlaceholder"),v=d??g("deploymentSelect.emptyMessage"),y=p.useId(),w=p.useRef(null),x=p.useRef(null),O=p.useRef(null),k=p.useRef(null),S=p.useRef([]),[C,E]=p.useState(!1),[j,T]=p.useState(0),R=r.find(L=>L.value===t),A=(R==null?void 0:R.label)??(t?n:void 0),N=o!==void 0&&!!f,P=()=>{E(!1),N&&o&&(f==null||f(""))};p.useEffect(()=>{if(!C)return;const L=F=>{F.target instanceof Node&&w.current&&!w.current.contains(F.target)&&P()};return window.addEventListener("pointerdown",L),()=>window.removeEventListener("pointerdown",L)},[C,f,o,N]),p.useEffect(()=>{var L,F;if(C){if(N){(L=O.current)==null||L.focus();return}(F=S.current[j])==null||F.focus()}},[C,N]),p.useEffect(()=>{var L;!C||N&&document.activeElement===O.current||(L=S.current[j])==null||L.focus()},[j,C,N]),p.useEffect(()=>{T(L=>Math.min(L,Math.max(0,r.length-1)))},[r.length]),p.useEffect(()=>{if(!C||!u||c||!h)return;const L=window.requestAnimationFrame(()=>{const F=k.current;F&&F.scrollHeight<=F.clientHeight+1&&h()});return()=>window.cancelAnimationFrame(L)},[u,c,h,C,r.length]);const I=(L=1)=>{const F=r.findIndex(z=>z.value===t),M=F>=0?F:L===1?0:Math.max(0,r.length-1);T(M),E(!0)},D=L=>{r.length!==0&&T((L+r.length)%r.length)},_=L=>{var F;m(L.value),P(),(F=x.current)==null||F.focus()};return a.jsxs("div",{className:"pp-deployment-select",ref:w,onKeyDown:L=>{var M,z;const F=L.target===O.current;if(L.key==="Escape"&&C){L.preventDefault(),P(),(M=x.current)==null||M.focus();return}if(L.key==="Tab"){P();return}if(F){L.key==="ArrowDown"&&r.length>0&&(L.preventDefault(),T(0),(z=S.current[0])==null||z.focus());return}L.key==="ArrowDown"?(L.preventDefault(),C?D(j+1):I(1)):L.key==="ArrowUp"?(L.preventDefault(),C?D(j-1):I(-1)):C&&L.key==="Home"?(L.preventDefault(),T(0)):C&&L.key==="End"&&(L.preventDefault(),T(Math.max(0,r.length-1)))},children:[a.jsxs("button",{ref:x,type:"button",className:"pp-deployment-select-trigger","aria-label":e,"aria-haspopup":"listbox","aria-expanded":C,"aria-controls":C?y:void 0,disabled:s,onClick:()=>{C?P():I()},children:[a.jsx("span",{className:A?void 0:"is-placeholder",children:A??i}),a.jsx($st,{className:`pp-deployment-select-chevron${C?" is-open":""}`})]}),C&&a.jsxs("div",{className:"pp-deployment-select-menu",children:[N&&a.jsx("div",{className:"pp-deployment-select-search",children:a.jsx("input",{ref:O,type:"search",value:o,"aria-label":g("deploymentSelect.searchAriaLabel",{label:e}),placeholder:b,autoComplete:"off",onChange:L=>f==null?void 0:f(L.currentTarget.value)})}),a.jsx("div",{id:y,ref:k,className:"pp-deployment-select-options",role:"listbox","aria-label":e,"aria-busy":c||void 0,onScroll:L=>{if(!u||c||!h)return;const F=L.currentTarget;F.scrollHeight-F.scrollTop-F.clientHeight<=24&&h()},children:r.map((L,F)=>{const M=L.value===t;return a.jsxs("button",{ref:z=>{S.current[F]=z},type:"button",role:"option","aria-selected":M,tabIndex:F===j?0:-1,className:`pp-deployment-select-option${M?" is-selected":""}`,title:L.metadata?[L.label,L.description,L.metadata].filter(Boolean).join(` -`):L.description,onFocus:()=>T(F),onClick:()=>_(L),children:[a.jsxs("span",{className:"pp-deployment-select-copy",children:[a.jsxs("span",{className:"pp-deployment-select-name",children:[L.label,L.badge&&a.jsx("span",{className:"pp-deployment-select-badge",children:L.badge})]}),L.description&&a.jsx("small",{className:L.metadata?"pp-deployment-select-description":void 0,children:L.description}),L.metadata&&a.jsx("small",{className:"pp-deployment-select-metadata",children:L.metadata})]}),M&&a.jsx(Fst,{})]},L.value)})}),c&&a.jsx("div",{className:"pp-deployment-select-state","aria-live":"polite",children:g("deploymentSelect.loadingMore")}),!c&&r.length===0&&a.jsx("div",{className:"pp-deployment-select-state",children:v})]})]})}function YD({label:e,onClick:t}){return a.jsx("button",{type:"button",className:"page-back-button","aria-label":e,title:e,onClick:t,children:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m14.5 6-6 6 6 6"})})})}function hn({as:e="span",className:t="",duration:n=4,spread:i=20,children:r,style:s,...o}){const l=Math.min(Math.max(i,5),45);return a.jsx(e,{className:`text-shimmer${t?` ${t}`:""}`,style:{...s,backgroundImage:`linear-gradient(to right, hsl(var(--muted-foreground)) ${50-l}%, hsl(var(--foreground)) 50%, hsl(var(--muted-foreground)) ${50+l}%)`,animationDuration:`${n}s`},...o,children:r})}function Bst(){return a.jsx("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M16 7a6.5 6.5 0 1 0 .2 5M16 3.5V7h-3.5"})})}function Cje(e){return e instanceof aC?e.code:"request_failed"}function Ust({user:e,onClose:t,onSaved:n}){const{t:i,i18n:r}=Te("users"),s=p.useRef(null),o=p.useRef(null),l=p.useId(),c=p.useId(),[u,d]=p.useState(e.role),[f,h]=p.useState(!1),[m,g]=p.useState("");p.useEffect(()=>{const v=s.current,y=document.activeElement;return v==null||v.showModal(),()=>{var w;(w=o.current)==null||w.abort(),v==null||v.close(),y instanceof HTMLElement&&y.isConnected&&y.focus()}},[]);const b=async()=>{if(f||u===e.role&&!e.roleConflict)return;const v=new AbortController;o.current=v,h(!0),g("");try{const y=await Lst(e,u,v.signal);v.signal.aborted||n(y)}catch(y){v.signal.aborted||g(i(`errors.${Cje(y)}`,{defaultValue:i("errors.request_failed")}))}finally{v.signal.aborted||h(!1)}};return a.jsxs("dialog",{ref:s,className:"user-role-dialog","aria-labelledby":l,"aria-describedby":c,"aria-busy":f,onCancel:v=>{v.preventDefault(),f||t()},children:[a.jsxs("header",{children:[a.jsx("h2",{id:l,children:i("changeRole")}),a.jsx("button",{type:"button",className:"users-close",onClick:t,disabled:f,"aria-label":i("close"),children:a.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:a.jsx("path",{d:"m5 5 10 10M15 5 5 15"})})})]}),a.jsxs("div",{className:"user-role-dialog-body",children:[a.jsxs("div",{className:"users-account",children:[a.jsx("strong",{children:e.name}),a.jsx("span",{children:e.email||e.id})]}),a.jsx("label",{className:"users-field-label",children:i("role")}),a.jsx(xf,{ariaLabel:i("role"),placeholder:i("role"),value:u,disabled:f,options:sC.map(v=>({value:v,label:i(`roles.${v}`),description:i(`descriptions.${v}`)})),onChange:v=>{const y=sC.find(w=>w===v);y&&d(y)}},r.resolvedLanguage),a.jsx("p",{id:c,className:"users-help",children:i("effectiveAfterRefresh")}),m?a.jsx("p",{className:"users-error",role:"alert",children:m}):null]}),a.jsxs("footer",{children:[a.jsx("button",{className:"users-button",type:"button",disabled:f,onClick:t,children:i("cancel")}),a.jsx("button",{className:"users-button is-primary",type:"button",disabled:f||u===e.role&&!e.roleConflict,onClick:()=>void b(),children:i(f?"saving":"save")})]})]})}function Qst({onBack:e}){const{t,i18n:n}=Te("users"),[i,r]=p.useState(null),[s,o]=p.useState(!0),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(""),[m,g]=p.useState(""),[b,v]=p.useState(1),[y,w]=p.useState(0),[x,O]=p.useState(null),[k,S]=p.useState(null),[C,E]=p.useState(null);p.useEffect(()=>{const A=new AbortController;return o(!0),c(""),Mst({page:b,query:f,role:m,signal:A.signal}).then(N=>{if(!A.signal.aborted){if(N.total>0&&N.items.length===0&&b>1){v(1);return}r(N),E(new Date)}}).catch(N=>{A.signal.aborted||c(Cje(N))}).finally(()=>{A.signal.aborted||o(!1)}),()=>A.abort()},[b,f,m,y]);const j=A=>{A.preventDefault(),h(u.trim()),v(1),w(N=>N+1)},T=A=>{if(!A)return t("neverLoggedIn");const N=Number(A),P=new Date(Number.isFinite(N)&&N>0?N<1e12?N*1e3:N:A);return Number.isNaN(P.getTime())?t("unknown"):P.toLocaleString(n.resolvedLanguage,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1})},R=Math.max(1,Math.ceil(((i==null?void 0:i.total)??0)/20));return a.jsxs("section",{className:"users-page","aria-labelledby":"users-title",children:[a.jsxs("header",{className:"users-page-header",children:[a.jsx(YD,{label:t("back"),onClick:e}),a.jsx("h1",{id:"users-title",children:t("title")}),i?a.jsx("span",{className:"users-count",children:t("memberCount",{count:i.poolTotal})}):null]}),a.jsxs("div",{className:"users-content",children:[i?a.jsxs("div",{className:"users-pool",children:[a.jsx("span",{children:i.provider==="byteplus"?"BytePlus Identity":t("volcengineIdentity")}),a.jsxs("span",{className:"users-pool-id",title:i.userPoolId,children:[t("pool")," ",i.userPoolId]})]}):null,a.jsxs("div",{className:"users-toolbar",children:[a.jsxs("form",{className:"users-search",onSubmit:j,children:[a.jsx("input",{value:u,onChange:A=>d(A.target.value),onKeyDown:A=>{A.key==="Enter"&&(A.nativeEvent.isComposing||A.keyCode===229)&&A.preventDefault()},"aria-label":t("searchPlaceholder"),placeholder:t("searchPlaceholder"),maxLength:200}),a.jsx("button",{type:"submit",className:"users-button",disabled:s,children:t("search")})]}),a.jsx("div",{className:"users-role-filter",children:a.jsx(xf,{ariaLabel:t("filterRole"),placeholder:t("allRoles"),value:m,options:[{value:"",label:t("allRoles")},...sC.map(A=>({value:A,label:t(`roles.${A}`)}))],onChange:A=>{const N=sC.find(P=>P===A);g(N??""),v(1)}})}),a.jsxs("button",{type:"button",className:"users-button users-refresh",disabled:s,onClick:()=>{S(null),w(A=>A+1)},children:[a.jsx(Bst,{}),a.jsx("span",{children:t("refresh")})]})]}),a.jsx("div",{className:"users-feedback","aria-live":"polite",children:s?a.jsx(hn,{children:t("loading")}):k?a.jsx("span",{children:t("saved",{name:k.name,role:t(`roles.${k.role}`)})}):C?a.jsx("span",{children:t("updatedAt",{time:C.toLocaleTimeString(n.resolvedLanguage,{hour:"2-digit",minute:"2-digit",hour12:!1})})}):null}),l?a.jsxs("div",{className:"users-error users-error-banner",role:"alert",children:[a.jsx("span",{children:t(`errors.${l}`,{defaultValue:t("errors.request_failed")})}),a.jsx("button",{type:"button",className:"users-button",onClick:()=>w(A=>A+1),children:t("retry")})]}):null,a.jsxs("div",{className:"users-table-wrap","aria-busy":s,children:[a.jsxs("table",{className:"users-table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:t("user")}),a.jsx("th",{scope:"col",children:t("role")}),a.jsx("th",{scope:"col",children:t("status")}),a.jsx("th",{scope:"col",children:t("lastLogin")}),a.jsx("th",{scope:"col",children:a.jsx("span",{className:"sr-only",children:t("actions")})})]})}),a.jsx("tbody",{children:i==null?void 0:i.items.map(A=>{var N;return a.jsxs("tr",{children:[a.jsx("td",{"data-label":t("user"),children:a.jsxs("div",{className:"users-person",children:[a.jsx("span",{className:"users-avatar","aria-hidden":"true",children:(N=Array.from(A.name)[0])==null?void 0:N.toUpperCase()}),a.jsxs("div",{className:"users-account",children:[a.jsxs("strong",{children:[A.name,A.currentUser?a.jsx("span",{className:"users-self",children:t("you")}):null]}),a.jsx("span",{title:A.email||A.id,children:A.email||A.id})]})]})}),a.jsxs("td",{"data-label":t("role"),children:[a.jsx("span",{className:`users-role-badge${A.role==="super_admin"?" is-super":""}`,children:t(`roles.${A.role}`)}),A.roleConflict?a.jsx("span",{className:"users-inline-warning",children:t("roleConflict")}):null]}),a.jsx("td",{"data-label":t("status"),children:a.jsx("span",{className:"users-status",children:t(`states.${A.status}`,{defaultValue:t("unknown")})})}),a.jsx("td",{"data-label":t("lastLogin"),className:"users-last-login",children:T(A.lastLogin)}),a.jsx("td",{className:"users-actions",children:A.protected?a.jsx("span",{className:"users-protected",title:t("protectedExplanation"),children:t("initialAdministrator")}):a.jsx("button",{type:"button",className:"users-button is-text",disabled:s||!!l||A.currentUser,onClick:()=>{S(null),O(A)},children:t("changeRole")})})]},A.id)})})]}),!s&&!l&&(i==null?void 0:i.items.length)===0?a.jsxs("div",{className:"users-empty",children:[a.jsx("strong",{children:t("noUsers")}),a.jsx("span",{children:t(f||m?"tryAnotherSearch":"poolEmpty")})]}):null,s&&!i?a.jsx("div",{className:"users-empty",children:a.jsx(hn,{children:t("loading")})}):null]}),i?a.jsxs("footer",{className:"users-pagination",children:[a.jsx("span",{children:t("resultCount",{count:i.total})}),a.jsxs("div",{children:[a.jsx("button",{type:"button",className:"users-button",disabled:b<=1||s,onClick:()=>v(A=>A-1),children:t("previous")}),a.jsxs("span",{children:[b," / ",R]}),a.jsx("button",{type:"button",className:"users-button",disabled:b>=R||s,onClick:()=>v(A=>A+1),children:t("next")})]})]}):null]}),x?a.jsx(Ust,{user:x,onClose:()=>O(null),onSaved:A=>{O(null),S(A),w(N=>N+1)}}):null]})}const Aje=p.createContext(null);function zst(e){if(!e||/[?#]/.test(e))return null;try{const t=decodeURIComponent(e);return!/^\/data\/(output|workspace)\/.+/.test(t)||t.endsWith("/")||/[\\\u0000-\u001f\u007f]/.test(t)||t.split("/").some(n=>n==="."||n==="..")?null:t}catch{return null}}function Vst({appName:e,sessionId:t,path:n,children:i}){const{t:r}=Te("conversation"),s=p.useRef(null),[o,l]=p.useState(!1),[c,u]=p.useState(!1);p.useEffect(()=>(l(!1),u(!1),()=>{var f;(f=s.current)==null||f.abort(),s.current=null}),[e,t,n]);async function d(){if(s.current)return;const f=new AbortController;s.current=f,l(!0),u(!1);try{const h=await cTe(e,t,n,f.signal);if(f.signal.aborted)return;const m=URL.createObjectURL(h),g=document.createElement("a");try{g.href=m,g.download=n.slice(n.lastIndexOf("/")+1),document.body.appendChild(g),g.click()}finally{g.remove(),window.setTimeout(()=>URL.revokeObjectURL(m),0)}}catch{f.signal.aborted||u(!0)}finally{s.current===f&&(s.current=null,l(!1))}}return a.jsxs(a.Fragment,{children:[a.jsxs("a",{className:"sandbox-file-download",href:encodeURI(n),"aria-disabled":o,"aria-busy":o,onClick:f=>{f.preventDefault(),d()},children:[a.jsx("span",{"aria-hidden":"true",children:"↓"}),a.jsxs("span",{children:[r(o?"markdown.downloading":"markdown.downloadFile")," · ",i]})]}),c&&a.jsxs("span",{role:"alert",children:[" ",r("markdown.downloadFailed")]})]})}const Hst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M5.293 12.707a1 1 0 0 1 0-1.414l5-5a1 1 0 1 1 1.414 1.414L8.414 11H18a1 1 0 1 1 0 2H8.414l3.293 3.293a1 1 0 0 1-1.414 1.414l-5-5Z",clipRule:"evenodd"})}),qst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M18.707 12.707a1 1 0 0 0 0-1.414l-5-5a1 1 0 1 0-1.414 1.414L15.586 11H6a1 1 0 1 0 0 2h9.586l-3.293 3.293a1 1 0 0 0 1.414 1.414l5-5Z",clipRule:"evenodd"})}),Wst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M4.47192 2.5C5.02421 2.5 5.47192 2.94772 5.47192 3.5V5.07196C7.17065 3.47759 9.45675 2.5 11.9719 2.5C17.2186 2.5 21.4719 6.75329 21.4719 12C21.4719 17.2467 17.2186 21.5 11.9719 21.5C7.10262 21.5 3.0902 17.8375 2.53692 13.1164C2.47264 12.5679 2.8652 12.0711 3.41373 12.0068C3.96226 11.9425 4.45904 12.3351 4.52333 12.8836C4.95991 16.6089 8.12901 19.5 11.9719 19.5C16.1141 19.5 19.4719 16.1421 19.4719 12C19.4719 7.85786 16.1141 4.5 11.9719 4.5C9.75153 4.5 7.75552 5.46469 6.38146 7H9.00003C9.55232 7 10 7.44772 10 8C10 8.55228 9.55232 9 9.00003 9H4.47192C3.93256 9 3.49293 8.57299 3.47265 8.03859C3.47175 8.01771 3.47151 7.99677 3.47192 7.9758V3.5C3.47192 2.94772 3.91964 2.5 4.47192 2.5Z",fill:"currentColor"})}),ZD=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M2.55823 12C2.55823 6.75329 6.81152 2.5 12.0582 2.5C14.5734 2.5 16.8595 3.47759 18.5582 5.07197V3.5C18.5582 2.94772 19.0059 2.5 19.5582 2.5C20.1105 2.5 20.5582 2.94772 20.5582 3.5V7.97591C20.5586 7.99622 20.5584 8.01651 20.5576 8.03674C20.5382 8.572 20.0982 9 19.5582 9H15.0582C14.5059 9 14.0582 8.55228 14.0582 8C14.0582 7.44772 14.5059 7 15.0582 7H17.6487C16.2746 5.46469 14.2786 4.5 12.0582 4.5C7.91609 4.5 4.55823 7.85786 4.55823 12C4.55823 16.1421 7.91609 19.5 12.0582 19.5C15.9011 19.5 19.0702 16.6089 19.5068 12.8836C19.5711 12.3351 20.0679 11.9425 20.6164 12.0068C21.165 12.0711 21.5575 12.5679 21.4932 13.1164C20.94 17.8375 16.9275 21.5 12.0582 21.5C6.81152 21.5 2.55823 17.2467 2.55823 12Z",fill:"currentColor"})}),r_=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M16.243 6.757a1 1 0 0 1 1 1v7.072a1 1 0 0 1-2 0v-4.657L8.464 16.95a1 1 0 0 1-1.414-1.414l6.778-6.779H9.172a1 1 0 0 1 0-2h7.07Z",clipRule:"evenodd"})}),Kst=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.jsx("path",{d:"M10.663 6.3872C10.8152 6.29068 11 6.40984 11 6.59007V8C11 8.55229 11.4477 9 12 9C12.5523 9 13 8.55229 13 8V6.59007C13 6.40984 13.1848 6.29068 13.337 6.3872C14.036 6.83047 14.5 7.61105 14.5 8.5C14.5 9.53284 13.8737 10.4194 12.9801 10.8006C12.9932 10.865 13 10.9317 13 11V13C13 13.5523 12.5523 14 12 14C11.4477 14 11 13.5523 11 13V11C11 10.9317 11.0068 10.865 11.0199 10.8006C10.1263 10.4194 9.5 9.53284 9.5 8.5C9.5 7.61105 9.96397 6.83047 10.663 6.3872Z",fill:"currentColor"}),a.jsx("path",{d:"M17.9754 4.01031C17.8588 4.00078 17.6965 4.00001 17.4 4.00001H9.8C8.94342 4.00001 8.36113 4.00078 7.91104 4.03756C7.47262 4.07338 7.24842 4.1383 7.09202 4.21799C6.7157 4.40974 6.40973 4.7157 6.21799 5.09202C6.1383 5.24842 6.07337 5.47263 6.03755 5.91104C6.00078 6.36113 6 6.94343 6 7.80001V16.1707C6.31278 16.0602 6.64937 16 7 16H18L18 4.60001C18 4.30348 17.9992 4.14122 17.9897 4.02464C17.9893 4.02 17.9889 4.0156 17.9886 4.01145C17.9844 4.01107 17.98 4.01069 17.9754 4.01031ZM17.657 18H7C6.44772 18 6 18.4477 6 19C6 19.5523 6.44772 20 7 20H17.657C17.5343 19.3301 17.5343 18.6699 17.657 18ZM4 19L4 7.75871C3.99999 6.95374 3.99998 6.28937 4.04419 5.74818C4.09012 5.18608 4.18868 4.66938 4.43597 4.18404C4.81947 3.43139 5.43139 2.81947 6.18404 2.43598C6.66937 2.18869 7.18608 2.09012 7.74818 2.0442C8.28937 1.99998 8.95373 1.99999 9.7587 2L17.4319 2C17.6843 1.99997 17.9301 1.99994 18.1382 2.01695C18.3668 2.03563 18.6366 2.07969 18.908 2.21799C19.2843 2.40974 19.5903 2.7157 19.782 3.09203C19.9203 3.36345 19.9644 3.63318 19.9831 3.86178C20.0001 4.06994 20 4.31574 20 4.56812L20 17C20 17.1325 19.9736 17.2638 19.9225 17.386C19.4458 18.5253 19.4458 19.4747 19.9225 20.614C20.0517 20.9227 20.0179 21.2755 19.8325 21.5541C19.6471 21.8326 19.3346 22 19 22H7C5.34315 22 4 20.6569 4 19Z",fill:"currentColor"})]}),oC=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M18.063 5.674a1 1 0 0 1 .263 1.39l-7.5 11a1 1 0 0 1-1.533.143l-4.5-4.5a1 1 0 1 1 1.414-1.414l3.647 3.647 6.82-10.003a1 1 0 0 1 1.39-.263Z",clipRule:"evenodd"})}),Tje=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM16.0755 7.93219C16.5272 8.25003 16.6356 8.87383 16.3178 9.32549L11.5678 16.0755C11.3931 16.3237 11.1152 16.4792 10.8123 16.4981C10.5093 16.517 10.2142 16.3973 10.0101 16.1727L7.51006 13.4227C7.13855 13.014 7.16867 12.3816 7.57733 12.0101C7.98598 11.6386 8.61843 11.6687 8.98994 12.0773L10.6504 13.9039L14.6822 8.17451C15 7.72284 15.6238 7.61436 16.0755 7.93219Z",fill:"currentColor"})}),Gst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 16 9",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.292893 0.292893C0.683418 -0.0976311 1.31658 -0.0976311 1.70711 0.292893L8 6.58579L14.2929 0.292894C14.6834 -0.0976305 15.3166 -0.0976304 15.7071 0.292894C16.0976 0.683418 16.0976 1.31658 15.7071 1.70711L8.70711 8.70711C8.31658 9.09763 7.68342 9.09763 7.29289 8.70711L0.292893 1.70711C-0.0976311 1.31658 -0.0976311 0.683417 0.292893 0.292893Z"})}),Xst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M15.707 4.293a1 1 0 0 1 0 1.414L9.414 12l6.293 6.293a1 1 0 0 1-1.414 1.414l-7-7a1 1 0 0 1 0-1.414l7-7a1 1 0 0 1 1.414 0Z",clipRule:"evenodd"})}),Yst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M8.293 4.293a1 1 0 0 1 1.414 0l7 7a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414-1.414L14.586 12 8.293 5.707a1 1 0 0 1 0-1.414Z",clipRule:"evenodd"})}),hV=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM12 6C12.5523 6 13 6.44772 13 7V12C13 12.2652 12.8946 12.5196 12.7071 12.7071L10.2071 15.2071C9.81658 15.5976 9.18342 15.5976 8.79289 15.2071C8.40237 14.8166 8.40237 14.1834 8.79289 13.7929L11 11.5858V7C11 6.44772 11.4477 6 12 6Z",fill:"currentColor"})}),Zst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M12.659 9.753a1 1 0 0 1-1.318 0l-4-3.5A1 1 0 1 1 8.66 4.747L12 7.671l3.341-2.924a1 1 0 1 1 1.318 1.506l-4 3.5Zm-4.002 9.501a1 1 0 1 1-1.314-1.508l4-3.485a1 1 0 0 1 1.314 0l4 3.485a1 1 0 1 1-1.314 1.508L12 16.34l-3.343 2.913Z"})}),_je=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M12.7587 2H16.2413C17.0463 1.99999 17.7106 1.99998 18.2518 2.04419C18.8139 2.09012 19.3306 2.18868 19.816 2.43597C20.5686 2.81947 21.1805 3.43139 21.564 4.18404C21.8113 4.66937 21.9099 5.18608 21.9558 5.74817C22 6.28936 22 6.95372 22 7.75868V11.2413C22 12.0463 22 12.7106 21.9558 13.2518C21.9099 13.8139 21.8113 14.3306 21.564 14.816C21.1805 15.5686 20.5686 16.1805 19.816 16.564C19.3306 16.8113 18.8139 16.9099 18.2518 16.9558C17.8906 16.9853 17.4745 16.9951 16.9984 16.9984C16.9951 17.4745 16.9853 17.8906 16.9558 18.2518C16.9099 18.8139 16.8113 19.3306 16.564 19.816C16.1805 20.5686 15.5686 21.1805 14.816 21.564C14.3306 21.8113 13.8139 21.9099 13.2518 21.9558C12.7106 22 12.0463 22 11.2413 22H7.75868C6.95372 22 6.28936 22 5.74818 21.9558C5.18608 21.9099 4.66937 21.8113 4.18404 21.564C3.43139 21.1805 2.81947 20.5686 2.43597 19.816C2.18868 19.3306 2.09012 18.8139 2.04419 18.2518C1.99998 17.7106 1.99999 17.0463 2 16.2413V12.7587C1.99999 11.9537 1.99998 11.2894 2.04419 10.7482C2.09012 10.1861 2.18868 9.66937 2.43597 9.18404C2.81947 8.43139 3.43139 7.81947 4.18404 7.43598C4.66937 7.18868 5.18608 7.09012 5.74817 7.04419C6.10939 7.01468 6.52548 7.00487 7.00162 7.00162C7.00487 6.52548 7.01468 6.10939 7.04419 5.74817C7.09012 5.18608 7.18868 4.66937 7.43598 4.18404C7.81947 3.43139 8.43139 2.81947 9.18404 2.43597C9.66937 2.18868 10.1861 2.09012 10.7482 2.04419C11.2894 1.99998 11.9537 1.99999 12.7587 2ZM9.00176 7L11.2413 7C12.0463 6.99999 12.7106 6.99998 13.2518 7.04419C13.8139 7.09012 14.3306 7.18868 14.816 7.43598C15.5686 7.81947 16.1805 8.43139 16.564 9.18404C16.8113 9.66937 16.9099 10.1861 16.9558 10.7482C17 11.2894 17 11.9537 17 12.7587V14.9982C17.4455 14.9951 17.7954 14.9864 18.089 14.9624C18.5274 14.9266 18.7516 14.8617 18.908 14.782C19.2843 14.5903 19.5903 14.2843 19.782 13.908C19.8617 13.7516 19.9266 13.5274 19.9624 13.089C19.9992 12.6389 20 12.0566 20 11.2V7.8C20 6.94342 19.9992 6.36113 19.9624 5.91104C19.9266 5.47262 19.8617 5.24842 19.782 5.09202C19.5903 4.7157 19.2843 4.40973 18.908 4.21799C18.7516 4.1383 18.5274 4.07337 18.089 4.03755C17.6389 4.00078 17.0566 4 16.2 4H12.8C11.9434 4 11.3611 4.00078 10.911 4.03755C10.4726 4.07337 10.2484 4.1383 10.092 4.21799C9.7157 4.40973 9.40973 4.7157 9.21799 5.09202C9.1383 5.24842 9.07337 5.47262 9.03755 5.91104C9.01357 6.20463 9.00489 6.55447 9.00176 7ZM5.91104 9.03755C5.47262 9.07337 5.24842 9.1383 5.09202 9.21799C4.7157 9.40973 4.40973 9.7157 4.21799 10.092C4.1383 10.2484 4.07337 10.4726 4.03755 10.911C4.00078 11.3611 4 11.9434 4 12.8V16.2C4 17.0566 4.00078 17.6389 4.03755 18.089C4.07337 18.5274 4.1383 18.7516 4.21799 18.908C4.40973 19.2843 4.7157 19.5903 5.09202 19.782C5.24842 19.8617 5.47262 19.9266 5.91104 19.9624C6.36113 19.9992 6.94342 20 7.8 20H11.2C12.0566 20 12.6389 19.9992 13.089 19.9624C13.5274 19.9266 13.7516 19.8617 13.908 19.782C14.2843 19.5903 14.5903 19.2843 14.782 18.908C14.8617 18.7516 14.9266 18.5274 14.9624 18.089C14.9992 17.6389 15 17.0566 15 16.2V12.8C15 11.9434 14.9992 11.3611 14.9624 10.911C14.9266 10.4726 14.8617 10.2484 14.782 10.092C14.5903 9.7157 14.2843 9.40973 13.908 9.21799C13.7516 9.1383 13.5274 9.07337 13.089 9.03755C12.6389 9.00078 12.0566 9 11.2 9H7.8C6.94342 9 6.36113 9.00078 5.91104 9.03755Z",fill:"currentColor"})}),Jst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M10.556 4a1 1 0 0 0-.97.751l-.292 1.14h5.421l-.293-1.14A1 1 0 0 0 13.453 4h-2.897Zm6.224 1.892-.421-1.639A3 3 0 0 0 13.453 2h-2.897A3 3 0 0 0 7.65 4.253l-.421 1.639H4a1 1 0 1 0 0 2h.1l1.215 11.425A3 3 0 0 0 8.3 22h7.4a3 3 0 0 0 2.984-2.683l1.214-11.425H20a1 1 0 1 0 0-2h-3.22Zm1.108 2H6.112l1.192 11.214A1 1 0 0 0 8.3 20h7.4a1 1 0 0 0 .995-.894l1.192-11.214ZM10 10a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0v-5a1 1 0 0 1 1-1Zm4 0a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0v-5a1 1 0 0 1 1-1Z",clipRule:"evenodd"})}),eat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M3 12a2 2 0 1 1 4 0 2 2 0 0 1-4 0Zm7 0a2 2 0 1 1 4 0 2 2 0 0 1-4 0Zm7 0a2 2 0 1 1 4 0 2 2 0 0 1-4 0Z"})}),tat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 10 16",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.34151 0.747423C4.71854 0.417526 5.28149 0.417526 5.65852 0.747423L9.65852 4.24742C10.0742 4.61111 10.1163 5.24287 9.75259 5.6585C9.38891 6.07414 8.75715 6.11626 8.34151 5.75258L5.00001 2.82877L1.65852 5.75258C1.24288 6.11626 0.61112 6.07414 0.247438 5.6585C-0.116244 5.24287 -0.0741267 4.61111 0.34151 4.24742L4.34151 0.747423ZM0.246065 10.3578C0.608879 9.94139 1.24055 9.89795 1.65695 10.2608L5.00001 13.1737L8.34308 10.2608C8.75948 9.89795 9.39115 9.94139 9.75396 10.3578C10.1168 10.7742 10.0733 11.4058 9.65695 11.7687L5.65695 15.2539C5.28043 15.582 4.7196 15.582 4.34308 15.2539L0.343082 11.7687C-0.0733128 11.4058 -0.116749 10.7742 0.246065 10.3578Z"})}),nat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M16.793 2.793a3.121 3.121 0 1 1 4.414 4.414l-8.5 8.5A1 1 0 0 1 12 16H9a1 1 0 0 1-1-1v-3a1 1 0 0 1 .293-.707l8.5-8.5Zm3 1.414a1.121 1.121 0 0 0-1.586 0L10 12.414V14h1.586l8.207-8.207a1.121 1.121 0 0 0 0-1.586ZM6 5a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-4a1 1 0 1 1 2 0v4a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h4a1 1 0 1 1 0 2H6Z",clipRule:"evenodd"})}),iat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M12 7a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 1 1-2 0V8h-3a1 1 0 0 1-1-1Zm-5 5a1 1 0 0 1 1 1v3h3a1 1 0 1 1 0 2H7a1 1 0 0 1-1-1v-4a1 1 0 0 1 1-1Z",clipRule:"evenodd"})}),rat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8-10C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2Zm4.465 6.763a1 1 0 0 0-1.228-1.228l-5.5 1.5a1 1 0 0 0-.702.702l-1.5 5.5a1 1 0 0 0 1.228 1.228l5.5-1.5a1 1 0 0 0 .702-.702l1.5-5.5Zm-6.54 5.312.89-3.26 3.26-.89-.89 3.26-3.26.89Z",clipRule:"evenodd"})}),sat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M14.4472 7.10558C14.9412 7.35257 15.1414 7.95324 14.8944 8.44722L10.8944 16.4472C10.6474 16.9412 10.0468 17.1414 9.55279 16.8944C9.05881 16.6474 8.85858 16.0468 9.10557 15.5528L13.1056 7.55279C13.3526 7.05881 13.9532 6.85859 14.4472 7.10558ZM6.6 7.20001C7.04183 7.53138 7.13137 8.15818 6.8 8.60001L4.25 12L6.8 15.4C7.13137 15.8418 7.04183 16.4686 6.6 16.8C6.15817 17.1314 5.53137 17.0418 5.2 16.6L2.2 12.6C1.93333 12.2444 1.93333 11.7556 2.2 11.4L5.2 7.40001C5.53137 6.95818 6.15817 6.86863 6.6 7.20001ZM17.4 7.20001C17.8418 6.86863 18.4686 6.95818 18.8 7.40001L21.8 11.4C22.0667 11.7556 22.0667 12.2444 21.8 12.6L18.8 16.6C18.4686 17.0418 17.8418 17.1314 17.4 16.8C16.9582 16.4686 16.8686 15.8418 17.2 15.4L19.75 12L17.2 8.60001C16.8686 8.15818 16.9582 7.53138 17.4 7.20001Z",fill:"currentColor"})}),jje=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.jsx("path",{d:"M13 12a1 1 0 1 0-2 0v4a1 1 0 1 0 2 0v-4Zm-1-2.5A1.25 1.25 0 1 0 12 7a1.25 1.25 0 0 0 0 2.5Z"}),a.jsx("path",{fillRule:"evenodd",d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Z",clipRule:"evenodd"})]}),aat=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.jsx("path",{d:"M7.79289 9.04289C8.18342 8.65237 8.81658 8.65237 9.20711 9.04289L11.4571 11.2929C11.8476 11.6834 11.8476 12.3166 11.4571 12.7071L9.20711 14.9571C8.81658 15.3476 8.18342 15.3476 7.79289 14.9571C7.40237 14.5666 7.40237 13.9334 7.79289 13.5429L9.33579 12L7.79289 10.4571C7.40237 10.0666 7.40237 9.43342 7.79289 9.04289ZM12.25 14.25C12.25 13.6977 12.6977 13.25 13.25 13.25H15.5C16.0523 13.25 16.5 13.6977 16.5 14.25C16.5 14.8023 16.0523 15.25 15.5 15.25H13.25C12.6977 15.25 12.25 14.8023 12.25 14.25Z",fill:"currentColor"}),a.jsx("path",{d:"M2 8C2 5.79086 3.79086 4 6 4C6.55228 4 7 4.44772 7 5C7 5.55228 6.55228 6 6 6C4.89543 6 4 6.89543 4 8V16C4 17.1046 4.89543 18 6 18C6.55228 18 7 18.4477 7 19C7 19.5523 6.55228 20 6 20C3.79086 20 2 18.2091 2 16V8ZM17 5C17 4.44772 17.4477 4 18 4C20.2091 4 22 5.79086 22 8V16C22 18.2091 20.2091 20 18 20C17.4477 20 17 19.5523 17 19C17 18.4477 17.4477 18 18 18C19.1046 18 20 17.1046 20 16V8C20 6.89543 19.1046 6 18 6C17.4477 6 17 5.55228 17 5Z",fill:"currentColor"})]}),oat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M6 12C6 11.4477 6.44772 11 7 11H17C17.5523 11 18 11.4477 18 12C18 12.5523 17.5523 13 17 13H7C6.44772 13 6 12.5523 6 12Z",fill:"currentColor"})}),lat=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.jsx("path",{d:"M12.75 9.50001C12.75 9.08579 13.0858 8.75001 13.5 8.75001H14.5C14.9142 8.75001 15.25 9.08579 15.25 9.50001V14.5C15.25 14.9142 14.9142 15.25 14.5 15.25H13.5C13.0858 15.25 12.75 14.9142 12.75 14.5V9.50001Z",fill:"currentColor"}),a.jsx("path",{d:"M9.50001 8.75001C9.08579 8.75001 8.75001 9.08579 8.75001 9.50001V14.5C8.75001 14.9142 9.08579 15.25 9.50001 15.25H10.5C10.9142 15.25 11.25 14.9142 11.25 14.5V9.50001C11.25 9.08579 10.9142 8.75001 10.5 8.75001H9.50001Z",fill:"currentColor"}),a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.97144 12C1.97144 6.46138 6.46138 1.97144 12 1.97144C17.5386 1.97144 22.0286 6.46138 22.0286 12C22.0286 17.5386 17.5386 22.0286 12 22.0286C6.46138 22.0286 1.97144 17.5386 1.97144 12ZM12 4.02858C7.59751 4.02858 4.02858 7.59751 4.02858 12C4.02858 16.4025 7.59751 19.9714 12 19.9714C16.4025 19.9714 19.9714 16.4025 19.9714 12C19.9714 7.59751 16.4025 4.02858 12 4.02858Z",fill:"currentColor"})]}),WJ=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.jsx("path",{d:"M9.5 9.33165V14.6683C9.5 15.4595 10.3752 15.9373 11.0408 15.5095L15.1915 12.8412C15.8038 12.4475 15.8038 11.5524 15.1915 11.1588L11.0408 8.49047C10.3752 8.06265 9.5 8.54049 9.5 9.33165Z",fill:"currentColor"}),a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12Z",fill:"currentColor"})]}),cat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M8 16.7229V7.27711C8 6.29075 9.08894 5.69298 9.9211 6.22254L17.3428 10.9454C18.1147 11.4366 18.1147 12.5634 17.3428 13.0546L9.92109 17.7775C9.08894 18.3071 8 17.7093 8 16.7229Z",fill:"currentColor"})}),Nje=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M12 5a1 1 0 0 1 1 1v5h5a1 1 0 1 1 0 2h-5v5a1 1 0 1 1-2 0v-5H6a1 1 0 1 1 0-2h5V6a1 1 0 0 1 1-1Z",clipRule:"evenodd"})}),Rje=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M12 3C12.5523 3 13 3.44772 13 4L13 11H20C20.5523 11 21 11.4477 21 12C21 12.5523 20.5523 13 20 13L13 13L13 20C13 20.5523 12.5523 21 12 21C11.4477 21 11 20.5523 11 20L11 13L4 13C3.44772 13 3 12.5523 3 12C3 11.4477 3.44772 11 4 11L11 11L11 4C11 3.44772 11.4477 3 12 3Z",fill:"currentColor"})}),uat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M12 6C12.5523 6 13 6.44772 13 7V11H17C17.5523 11 18 11.4477 18 12C18 12.5523 17.5523 13 17 13H13V17C13 17.5523 12.5523 18 12 18C11.4477 18 11 17.5523 11 17V13H7C6.44772 13 6 12.5523 6 12C6 11.4477 6.44772 11 7 11H11V7C11 6.44772 11.4477 6 12 6Z",fill:"currentColor"})}),dat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.875 4.5C7.35418 4.5 4.5 7.35418 4.5 10.875C4.5 14.3958 7.35418 17.25 10.875 17.25C14.3958 17.25 17.25 14.3958 17.25 10.875C17.25 7.35418 14.3958 4.5 10.875 4.5ZM2.5 10.875C2.5 6.24962 6.24962 2.5 10.875 2.5C15.5004 2.5 19.25 6.24962 19.25 10.875C19.25 12.8273 18.582 14.6236 17.462 16.0478L21.2071 19.7929C21.5976 20.1834 21.5976 20.8166 21.2071 21.2071C20.8166 21.5976 20.1834 21.5976 19.7929 21.2071L16.0478 17.462C14.6236 18.582 12.8273 19.25 10.875 19.25C6.24962 19.25 2.5 15.5004 2.5 10.875Z",fill:"currentColor"})}),fat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M11.2929 3.29289C11.6834 2.90237 12.3166 2.90237 12.7071 3.29289L16.7071 7.29289C17.0976 7.68342 17.0976 8.31658 16.7071 8.70711C16.3166 9.09763 15.6834 9.09763 15.2929 8.70711L13 6.41421V15C13 15.5523 12.5523 16 12 16C11.4477 16 11 15.5523 11 15V6.41421L8.70711 8.70711C8.31658 9.09763 7.68342 9.09763 7.29289 8.70711C6.90237 8.31658 6.90237 7.68342 7.29289 7.29289L11.2929 3.29289ZM4 14C4.55229 14 5 14.4477 5 15V15.2C5 16.0566 5.00078 16.6389 5.03755 17.089C5.07337 17.5274 5.1383 17.7516 5.21799 17.908C5.40973 18.2843 5.7157 18.5903 6.09202 18.782C6.24842 18.8617 6.47262 18.9266 6.91104 18.9624C7.36113 18.9992 7.94342 19 8.8 19H15.2C16.0566 19 16.6389 18.9992 17.089 18.9624C17.5274 18.9266 17.7516 18.8617 17.908 18.782C18.2843 18.5903 18.5903 18.2843 18.782 17.908C18.8617 17.7516 18.9266 17.5274 18.9624 17.089C18.9992 16.6389 19 16.0566 19 15.2V15C19 14.4477 19.4477 14 20 14C20.5523 14 21 14.4477 21 15V15.2413C21 16.0463 21 16.7106 20.9558 17.2518C20.9099 17.8139 20.8113 18.3306 20.564 18.816C20.1805 19.5686 19.5686 20.1805 18.816 20.564C18.3306 20.8113 17.8139 20.9099 17.2518 20.9558C16.7106 21 16.0463 21 15.2413 21H8.75868C7.95372 21 7.28936 21 6.74817 20.9558C6.18608 20.9099 5.66937 20.8113 5.18404 20.564C4.43139 20.1805 3.81947 19.5686 3.43597 18.816C3.18868 18.3306 3.09012 17.8139 3.04419 17.2518C2.99998 16.7106 2.99999 16.0463 3 15.2413L3 15C3 14.4477 3.44772 14 4 14Z",fill:"currentColor"})}),hat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M6 8C6 6.89543 6.89543 6 8 6H16C17.1046 6 18 6.89543 18 8V16C18 17.1046 17.1046 18 16 18H8C6.89543 18 6 17.1046 6 16V8Z",fill:"currentColor"})}),pat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M14.5 4a5.5 5.5 0 0 0-5.078 7.616 1 1 0 0 1-.216 1.092l-4.749 4.75a1.475 1.475 0 0 0 2.086 2.085l4.749-4.749a1 1 0 0 1 1.092-.216A5.5 5.5 0 0 0 20 9.414l-1.293 1.293a3.828 3.828 0 1 1-5.414-5.414L14.585 4H14.5ZM7 9.5a7.5 7.5 0 0 1 9.969-7.084 1 1 0 0 1 .378 1.651l-2.64 2.64a1.829 1.829 0 0 0 2.586 2.586l2.64-2.64a1 1 0 0 1 1.651.378 7.5 7.5 0 0 1-9.328 9.627l-4.299 4.3a3.475 3.475 0 0 1-4.914-4.915l4.299-4.299A7.497 7.497 0 0 1 7 9.5Z"})}),pN=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M8.99805 16.796C8.99805 15.4164 7.87961 14.2979 6.5 14.2979C5.12039 14.2979 4.00195 15.4164 4.00195 16.796C4.00196 18.1756 5.1204 19.294 6.5 19.294C7.8796 19.294 8.99804 18.1756 8.99805 16.796ZM19.748 15.0479C19.748 14.7729 19.525 14.5499 19.25 14.5499H15.75C15.475 14.5499 15.252 14.7729 15.252 15.0479V18.5479C15.252 18.823 15.475 19.046 15.75 19.046H19.25C19.525 19.046 19.748 18.823 19.748 18.5479V15.0479ZM10.0469 3.45125C11.077 2.15921 13.0849 2.20276 14.0498 3.58113L16.4189 6.96492L16.5205 7.12215C17.5046 8.76341 16.3301 10.9023 14.3691 10.9024H9.63086C7.60676 10.9023 6.42029 8.62316 7.58105 6.96492L9.9502 3.58113L10.0469 3.45125ZM12.4082 4.73055C12.2223 4.46497 11.842 4.44826 11.6318 4.68074L11.5918 4.73055L9.22266 8.11433C8.99176 8.44435 9.22808 8.89744 9.63086 8.89754H14.3691C14.7468 8.89745 14.9774 8.49957 14.8145 8.17781L14.7773 8.11433L12.4082 4.73055ZM11.002 16.796C11.0019 19.2824 8.98638 21.2979 6.5 21.2979C4.01362 21.2979 1.99806 19.2824 1.99805 16.796C1.99805 14.3096 4.01361 12.294 6.5 12.294C8.98639 12.294 11.002 14.3096 11.002 16.796ZM21.752 18.5479C21.752 19.9297 20.6318 21.0499 19.25 21.0499H15.75C14.3682 21.0499 13.248 19.9297 13.248 18.5479V15.0479C13.2481 13.6662 14.3682 12.546 15.75 12.546H19.25C20.6318 12.546 21.7519 13.6662 21.752 15.0479V18.5479Z",fill:"currentColor"})}),mat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5555 4C10.099 4 9.70052 4.30906 9.58693 4.75114L9.29382 5.8919H14.715L14.4219 4.75114C14.3083 4.30906 13.9098 4 13.4533 4H10.5555ZM16.7799 5.8919L16.3589 4.25342C16.0182 2.92719 14.8226 2 13.4533 2H10.5555C9.18616 2 7.99062 2.92719 7.64985 4.25342L7.22886 5.8919H4C3.44772 5.8919 3 6.33961 3 6.8919C3 7.44418 3.44772 7.8919 4 7.8919H4.10069L5.31544 19.3172C5.47763 20.8427 6.76455 22 8.29863 22H15.7014C17.2354 22 18.5224 20.8427 18.6846 19.3172L19.8993 7.8919H20C20.5523 7.8919 21 7.44418 21 6.8919C21 6.33961 20.5523 5.8919 20 5.8919H16.7799ZM17.888 7.8919H6.11196L7.30423 19.1057C7.3583 19.6142 7.78727 20 8.29863 20H15.7014C16.2127 20 16.6417 19.6142 16.6958 19.1057L17.888 7.8919ZM10 10C10.5523 10 11 10.4477 11 11V16C11 16.5523 10.5523 17 10 17C9.44772 17 9 16.5523 9 16V11C9 10.4477 9.44772 10 10 10ZM14 10C14.5523 10 15 10.4477 15 11V16C15 16.5523 14.5523 17 14 17C13.4477 17 13 16.5523 13 16V11C13 10.4477 13.4477 10 14 10Z"})}),gat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M7.5 5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5ZM3 7.5a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0ZM17 6a2 2 0 1 0 0 4 2 2 0 0 0 0-4Zm-4 2a4 4 0 1 1 8 0 4 4 0 0 1-8 0Zm-8.96 8.247C3.137 17.048 2.5 18.271 2.5 20a1 1 0 1 1-2 0c0-2.271.862-4.049 2.21-5.248C4.042 13.57 5.788 13 7.5 13s3.459.57 4.79 1.752c1.348 1.2 2.21 2.977 2.21 5.248a1 1 0 1 1-2 0c0-1.729-.638-2.952-1.54-3.753C10.042 15.43 8.788 15 7.5 15s-2.541.43-3.46 1.247Zm15.757-.607c-1.009-.638-2.338-.807-3.526-.472a1 1 0 0 1-.542-1.925c1.695-.478 3.616-.255 5.136.706 1.558.984 2.635 2.707 2.635 5.051a1 1 0 1 1-2 0c0-1.665-.732-2.746-1.703-3.36Z",clipRule:"evenodd"})}),Ije=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.jsx("path",{d:"M10.42 2.006a4 4 0 0 1 3.159 0c.674.29 1.188.822 1.667 1.456.474.627 1 1.473 1.653 2.523l3.542 5.696c.72 1.16 1.3 2.09 1.682 2.854.384.766.654 1.517.59 2.292a4 4 0 0 1-1.604 2.886c-.625.463-1.405.63-2.258.709-.85.078-1.945.078-3.311.078H8.46c-1.366 0-2.46 0-3.31-.078-.854-.078-1.634-.246-2.26-.71a4 4 0 0 1-1.603-2.885c-.064-.775.206-1.526.59-2.292.383-.764.961-1.694 1.682-2.854l3.542-5.696c.653-1.05 1.18-1.896 1.653-2.523.48-.634.993-1.166 1.667-1.456Zm2.37 1.838a2 2 0 0 0-1.58 0c-.192.083-.448.28-.86.825-.413.544-.891 1.312-1.577 2.415l-3.488 5.61c-.755 1.214-1.283 2.066-1.62 2.737-.34.678-.402 1.02-.385 1.232a2 2 0 0 0 .802 1.443c.171.127.494.255 1.25.324.748.069 1.75.07 3.18.07h6.976c1.43 0 2.432-.001 3.18-.07.756-.069 1.079-.197 1.25-.324a2 2 0 0 0 .802-1.443c.017-.212-.045-.554-.385-1.232-.337-.671-.865-1.523-1.62-2.737l-3.488-5.61c-.686-1.103-1.164-1.87-1.576-2.415-.413-.546-.67-.742-.861-.825"}),a.jsx("path",{d:"M12 7.5a1 1 0 0 1 1 1v3a1 1 0 1 1-2 0v-3a1 1 0 0 1 1-1M10.851 15a1.15 1.15 0 1 1 2.3 0 1.15 1.15 0 0 1-2.3 0"})]}),pV=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M5.636 5.636a1 1 0 0 1 1.414 0l4.95 4.95 4.95-4.95a1 1 0 0 1 1.414 1.414L13.414 12l4.95 4.95a1 1 0 0 1-1.414 1.414L12 13.414l-4.95 4.95a1 1 0 0 1-1.414-1.414l4.95-4.95-4.95-4.95a1 1 0 0 1 0-1.414Z",clipRule:"evenodd"})});/** + */var FD=p,cnt=ZP;function unt(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var dnt=typeof Object.is=="function"?Object.is:unt,fnt=cnt.useSyncExternalStore,hnt=FD.useRef,pnt=FD.useEffect,mnt=FD.useMemo,gnt=FD.useDebugValue;W2e.useSyncExternalStoreWithSelector=function(e,t,n,i,r){var s=hnt(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=mnt(function(){function c(m){if(!u){if(u=!0,d=m,m=i(m),r!==void 0&&o.hasValue){var g=o.value;if(r(g,m))return f=g}return f=m}if(g=f,dnt(d,m))return g;var b=i(m);return r!==void 0&&r(g,b)?(d=m,g):(d=m,f=b)}var u=!1,d,f,h=n===void 0?null:n;return[function(){return c(t())},h===null?void 0:function(){return c(h())}]},[t,n,i,r]);var l=fnt(e,s[0],s[1]);return pnt(function(){o.hasValue=!0,o.value=l},[l]),gnt(l),l};q2e.exports=W2e;var K2e=q2e.exports;const bnt=T1(K2e),ynt=parseInt(p.version,10);function Qz(e){return ynt>=e}const vnt=Qz(19),xnt=vnt?Ont:knt;function G2e(e,t,n,i,r){return xnt(e,t,n,i,r)}function wnt(e,t,n,i,r){const s=p.useCallback(()=>t(e.getSnapshot(),n,i,r),[e,t,n,i,r]);return ZP.useSyncExternalStore(e.subscribe,s,s)}function Ont(e,t,n,i,r){return wnt(e,t,n,i,r)}function knt(e,t,n,i,r){return K2e.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,i,r))}class Snt{constructor(t){Zt(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));Zt(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const i of this.listeners){if(n!==this.updateTick)return;i(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,i,r){return G2e(this,t,n,i,r)}}const zz={...I0},A3=zz.useInsertionEffect,Ent=A3&&A3!==zz.useLayoutEffect?A3:e=>e();function ci(e){const t=Ed(Cnt).current;return t.next=e,Ent(t.effect),t.trampoline}function Cnt(){const e={next:void 0,callback:Ant,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function Ant(){}class BD extends Snt{constructor(t,n={},i){super(t),this.context=n,this.selectors=i}useSyncedValue(t,n){p.useDebugValue(t);const i=this;Jn(()=>{i.state[t]!==n&&i.set(t,n)},[i,t,n])}useSyncedValueWithCleanup(t,n){const i=this;Jn(()=>(i.state[t]!==n&&i.set(t,n),()=>{i.set(t,void 0)}),[i,t,n])}useSyncedValues(t){const n=this,i=Object.values(t);Jn(()=>{n.update(t)},[n,...i])}useControlledProp(t,n){p.useDebugValue(t);const i=this,r=n!==void 0;Jn(()=>{r&&!Object.is(i.state[t],n)&&i.setState({...i.state,[t]:n})},[i,t,n,r])}select(t,n,i,r){const s=this.selectors[t];return s(this.state,n,i,r)}useState(t,n,i,r){return p.useDebugValue(t),G2e(this,this.selectors[t],n,i,r)}useContextCallback(t,n){p.useDebugValue(t);const i=ci(n??Bz);this.context[t]=i}useStateSetter(t){const n=p.useRef(void 0);return n.current===void 0&&(n.current=i=>{this.set(t,i)}),n.current}observe(t,n){let i;typeof t=="function"?i=t:i=this.selectors[t];let r=i(this.state);return n(r,r,this),this.subscribe(s=>{const o=i(s);if(!Object.is(r,o)){const l=r;r=o,n(o,l,this)}})}}function UD(){return typeof window<"u"}function ll(e){return Vz(e)?(e.nodeName||"").toLowerCase():"#document"}function ta(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function fm(e){var t;return(t=(Vz(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Vz(e){return UD()?e instanceof Node||e instanceof ta(e).Node:!1}function Er(e){return UD()?e instanceof Element||e instanceof ta(e).Element:!1}function Js(e){return UD()?e instanceof HTMLElement||e instanceof ta(e).HTMLElement:!1}function Gw(e){return!UD()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ta(e).ShadowRoot}function UA(e){const{overflow:t,overflowX:n,overflowY:i,display:r}=Mu(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&r!=="inline"&&r!=="contents"}function Tnt(e){return/^(table|td|th)$/.test(ll(e))}function QD(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const _nt=/transform|translate|scale|rotate|perspective|filter/,jnt=/paint|layout|strict|content/,Gb=e=>!!e&&e!=="none";let T3;function Hz(e){const t=Er(e)?Mu(e):e;return Gb(t.transform)||Gb(t.translate)||Gb(t.scale)||Gb(t.rotate)||Gb(t.perspective)||!qz()&&(Gb(t.backdropFilter)||Gb(t.filter))||_nt.test(t.willChange||"")||jnt.test(t.contain||"")}function Nnt(e){let t=Xg(e);for(;Js(t)&&!Ig(t);){if(Hz(t))return t;if(QD(t))return null;t=Xg(t)}return null}function qz(){return T3==null&&(T3=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),T3}function Ig(e){return/^(html|body|#document)$/.test(ll(e))}function Mu(e){return ta(e).getComputedStyle(e)}function zD(e){return Er(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Xg(e){if(ll(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Gw(e)&&e.host||fm(e);return Gw(t)?t.host:t}function X2e(e){const t=Xg(e);return Ig(t)?(e.ownerDocument||e).body:Js(t)&&UA(t)?t:X2e(t)}function oC(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=X2e(e),s=r===((i=e.ownerDocument)==null?void 0:i.body),o=ta(r);if(s){const l=Y8(o);return t.concat(o,o.visualViewport||[],UA(r)?r:[],l&&n?oC(l):[])}else return t.concat(r,oC(r,[],n))}function Y8(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gh(...e){return()=>{for(let t=0;t{e.removeEventListener(t,n,i)}}const Z2=null;let Rnt=class{constructor(){Zt(this,"callbacks",[]);Zt(this,"callbacksCount",0);Zt(this,"nextId",1);Zt(this,"startId",1);Zt(this,"isScheduled",!1);Zt(this,"tick",t=>{var r;this.isScheduled=!1;const n=this.callbacks,i=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,i>0)for(let s=0;s=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}},J2=new Rnt;class _c{constructor(){Zt(this,"currentId",Z2);Zt(this,"cancel",()=>{this.currentId!==Z2&&(J2.cancel(this.currentId),this.currentId=Z2)});Zt(this,"disposeEffect",()=>this.cancel)}static create(){return new _c}static request(t){return J2.request(t)}static cancel(t){return J2.cancel(t)}request(t){this.cancel(),this.currentId=J2.request(()=>{this.currentId=Z2,t()})}}function Wz(){const e=Ed(_c.create).current;return $D(e.disposeEffect),e}const ck=0;class Lu{constructor(){Zt(this,"currentId",ck);Zt(this,"clear",()=>{this.currentId!==ck&&(clearTimeout(this.currentId),this.currentId=ck)});Zt(this,"disposeEffect",()=>this.clear)}static create(){return new Lu}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=ck,n()},t)}isStarted(){return this.currentId!==ck}}function d0(){const e=Ed(Lu.create).current;return $D(e.disposeEffect),e}let dJ=0;function Int(e){return dJ+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${dJ}`}function _3(e,t){if(typeof e=="string")return{description:e};if(typeof e=="function"){const n=e(t);return typeof n=="string"?{description:n}:n}return e}function Pnt(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:Dnt,platform:Mnt,maxTouchPoints:Lnt}=Pnt(),VD=Dnt.toLowerCase(),lC=Mnt.toLowerCase(),HD=/^i(os$|p)/.test(lC)||lC==="macintel"&&Lnt>1,fJ="android",Z8=lC===fJ||VD.includes(fJ),$nt=!HD&&lC.startsWith("mac");lC.startsWith("win");const Fnt=$nt||HD;var Cue;const z1=typeof CSS<"u"&&!!((Cue=CSS.supports)!=null&&Cue.call(CSS,"-webkit-backdrop-filter:none"));!z1&&VD.includes("firefox");!z1&&VD.includes("chrom");const Bnt=Fnt,Y2e=/jsdom|happydom/.test(VD),J8="data-base-ui-focusable",Z2e="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Ac(e){var n;let t=e.activeElement;for(;((n=t==null?void 0:t.shadowRoot)==null?void 0:n.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function ii(e,t){var i;if(!e||!t)return!1;const n=(i=t.getRootNode)==null?void 0:i.call(t);if(e.contains(t))return!0;if(n&&Gw(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function uo(e){return"composedPath"in e?e.composedPath()[0]:e.target}function J2e(e,t){if(!Er(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,i]of t.entries())if(ii(i,n))return!i.hasAttribute("data-trigger-disabled");return!1}function j3(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Unt(e){return e.matches("html,body")}function Kz(e){return Js(e)&&e.matches(Z2e)}function Qnt(e){return(e==null?void 0:e.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Z2e}`))!=null}function hJ(e){return e?e.getAttribute("role")==="combobox"&&Kz(e):!1}function eB(e){if(!e||Y2e)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function pJ(e){return e?e.hasAttribute(J8)?e:e.querySelector(`[${J8}]`)||e:null}function Yg(e,t,n=!0){return e.filter(r=>r.parentId===t).flatMap(r=>{var s;return[...!n||(s=r.context)!=null&&s.open?[r]:[],...Yg(e,r.id,n)]})}function mJ(e,t){var r;let n=[],i=(r=e.find(s=>s.id===t))==null?void 0:r.parentId;for(;i;){const s=e.find(o=>o.id===i);i=s==null?void 0:s.parentId,s&&(n=n.concat(s))}return n}function znt(e){e.preventDefault(),e.stopPropagation()}function Vnt(e){return"nativeEvent"in e}function Hnt(e){return e.pointerType===""&&e.isTrusted?!0:Z8&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function e_e(e){return Y2e?!1:!Z8&&e.width===0&&e.height===0||Z8&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function iw(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function qnt(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const Wnt=["top","right","bottom","left"],Zg=Math.min,Ip=Math.max,nI=Math.round,e_=Math.floor,Pp=e=>({x:e,y:e}),Knt={left:"right",right:"left",bottom:"top",top:"bottom"};function Gz(e,t,n){return Ip(e,Zg(t,n))}function Oh(e,t){return typeof e=="function"?e(t):e}function vd(e){return e.split("-")[0]}function hm(e){return e.split("-")[1]}function Xz(e){return e==="x"?"y":"x"}function qD(e){return e==="y"?"height":"width"}function dd(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function WD(e){return Xz(dd(e))}function Gnt(e,t,n){n===void 0&&(n=!1);const i=hm(e),r=WD(e),s=qD(r);let o=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=iI(o)),[o,iI(o)]}function Xnt(e){const t=iI(e);return[tB(e),t,tB(t)]}function tB(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const gJ=["left","right"],bJ=["right","left"],Ynt=["top","bottom"],Znt=["bottom","top"];function Jnt(e,t,n){switch(e){case"top":case"bottom":return n?t?bJ:gJ:t?gJ:bJ;case"left":case"right":return t?Ynt:Znt;default:return[]}}function eit(e,t,n,i){const r=hm(e);let s=Jnt(vd(e),n==="start",i);return r&&(s=s.map(o=>o+"-"+r),t&&(s=s.concat(s.map(tB)))),s}function iI(e){const t=vd(e);return Knt[t]+e.slice(t.length)}function tit(e){var t,n,i,r;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(i=e.bottom)!=null?i:0,left:(r=e.left)!=null?r:0}}function Yz(e){return typeof e!="number"?tit(e):{top:e,right:e,bottom:e,left:e}}function rI(e){const{x:t,y:n,width:i,height:r}=e;return{width:i,height:r,top:n,left:t,right:t+i,bottom:n+r,x:t,y:n}}function nit(e){return e.visibility==="hidden"||e.visibility==="collapse"}function t_e(e,t=e?Mu(e):null){return!e||!e.isConnected||!t||nit(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const iit='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function rit(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return Gw(n)?n.host:null}function nB(e){for(const t of Array.from(e.children))if(ll(t)==="summary")return t;return null}function sit(e,t){const n=nB(t);return!!n&&(e===n||ii(n,e))}function n_e(e){const t=e?ll(e):"";return e!=null&&e.matches(iit)&&(t!=="summary"||e.parentElement!=null&&ll(e.parentElement)==="details"&&nB(e.parentElement)===e)&&(t!=="details"||nB(e)==null)&&(t!=="input"||e.type!=="hidden")}function i_e(e){if(!n_e(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=rit(t)){const n=t!==e,i=ll(t)==="slot";if(t.hasAttribute("inert")||n&&ll(t)==="details"&&!t.open&&!sit(e,t)||t.hasAttribute("hidden")||!i&&!ait(t,n))return!1}return!0}function ait(e,t){const n=Mu(e);return t?n.display!=="none":t_e(e,n)}function r_e(e){const t=e.tabIndex;if(t<0){const n=ll(e);if(n==="details"||n==="audio"||n==="video"||Js(e)&&e.isContentEditable)return 0}return t}function N3(e){if(ll(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function oit(e,t){const n=N3(e);if(!n)return!0;const i=t.find(r=>{const s=N3(r);return(s==null?void 0:s.name)===n.name&&s.form===n.form&&s.checked});return i?i===n:t.find(r=>{const s=N3(r);return(s==null?void 0:s.name)===n.name&&s.form===n.form})===n}function s_e(e){if(Js(e)&&ll(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Js(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function a_e(e,t){s_e(e).forEach(n=>{n_e(n)&&t.push(n),a_e(n,t)})}function o_e(e,t,n){s_e(e).forEach(i=>{Js(i)&&i.matches(t)&&n.push(i),o_e(i,t,n)})}function Zz(e){return i_e(e)&&r_e(e)>=0}function l_e(e){const t=[];return a_e(e,t),t.filter(i_e)}function QA(e){const t=l_e(e);return t.filter(n=>r_e(n)>=0&&oit(n,t))}function c_e(e,t){const n=QA(e),i=n.length;if(i===0)return;const r=Ac(kr(e)),s=n.indexOf(r),o=s===-1?t===1?0:i-1:s+t;return n[o]}function Jz(e){return c_e(kr(e).body,1)||e}function u_e(e){return c_e(kr(e).body,-1)||e}function d_e(e,t){if(!e)return null;const n=QA(kr(e).body),i=n.length;if(i===0)return null;const r=n.indexOf(e);if(r===-1)return null;const s=(r+t+i)%i;return n[s]}function lit(e){return d_e(e,1)}function cit(e){return d_e(e,-1)}function rw(e,t){const n=t||e.currentTarget,i=e.relatedTarget;return!i||!ii(n,i)}function uit(e){QA(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function yJ(e){const t=[];o_e(e,"[data-tabindex]",t),t.forEach(n=>{const i=n.dataset.tabindex;delete n.dataset.tabindex,i?n.setAttribute("tabindex",i):n.removeAttribute("tabindex")})}function R3(e){const t=new Map;let n=0,i=0;return e.forEach((r,s)=>{const o=r.transitionStatus==="ending";t.set(r.id,{value:r,domIndex:s,visibleIndex:o?-1:n,offsetY:i}),i+=r.height||0,o||(n+=1)}),t}function I3(e,t){let n=0;return e.map(i=>{if(i.transitionStatus==="ending")return i;const r=n>=t;return n+=1,i.limited===r?i:{...i,limited:r}})}const Bf={toasts:e=>e.toasts,isEmpty:e=>e.toasts.length===0,toast:(e,t)=>{var n;return(n=e.toastMetadata.get(t))==null?void 0:n.value},toastIndex:(e,t)=>{var n;return((n=e.toastMetadata.get(t))==null?void 0:n.domIndex)??-1},toastOffsetY:(e,t)=>{var n;return((n=e.toastMetadata.get(t))==null?void 0:n.offsetY)??0},toastVisibleIndex:(e,t)=>{var n;return((n=e.toastMetadata.get(t))==null?void 0:n.visibleIndex)??-1},focused:e=>e.focused,expanded:e=>e.hovering||e.focused,expandedOrOutOfFocus:e=>e.hovering||e.focused||!e.isWindowFocused,prevFocusElement:e=>e.prevFocusElement};class dit extends BD{constructor(n){super({...n,toastMetadata:R3(n.toasts)},{},Bf);Zt(this,"timers",new Map);Zt(this,"areTimersPaused",!1);Zt(this,"setViewport",n=>{this.set("viewport",n)});Zt(this,"disposeEffect",()=>()=>{this.timers.forEach(n=>{var i;(i=n.timeout)==null||i.clear()}),this.timers.clear()});Zt(this,"addToast",n=>{const{timeout:i,limit:r}=this.state,s=n.id||Int("toast");if(n.id){const u=Bf.toast(this.state,n.id);if(u)if(u.transitionStatus==="ending")this.removeToast(n.id,!0);else{const{id:d,transitionStatus:f,...h}=n;return this.updateToastInternal(n.id,h,!0,!0),n.id}}const o={...n,id:s,updateKey:0,transitionStatus:"starting"},l=[o,...this.state.toasts];this.setToasts(I3(l,r));const c=o.timeout??i;return o.type!=="loading"&&c>0&&this.scheduleTimer(s,c,()=>this.closeToast(s)),Bf.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),s});Zt(this,"updateToast",(n,i)=>{this.updateToastInternal(n,i,!1,!0)});Zt(this,"updateToastInternal",(n,i,r=!1,s=!1)=>{const{timeout:o,toasts:l}=this.state,c=Bf.toast(this.state,n);if(!c||c.transitionStatus==="ending")return;const u={...c,...i,...s&&{updateKey:c.updateKey+1}};this.setToasts(l.map(y=>y.id===n?u:y));const d=u.timeout??o,f=c.timeout??o,h=Object.hasOwn(i,"timeout"),m=u.transitionStatus!=="ending"&&u.type!=="loading"&&d>0,g=this.timers.has(n),b=f!==d,v=c.type==="loading";if(!m&&g){this.clearTimer(n);return}m&&(!g||b||h||v||r)&&(this.clearTimer(n),this.scheduleTimer(n,d,()=>this.closeToast(n)),Bf.expandedOrOutOfFocus(this.state)&&this.pauseTimers())});Zt(this,"closeToast",n=>{const i=n===void 0,{limit:r,toasts:s}=this.state;let o;if(i)o=s,this.clearTimers();else{const u=Bf.toast(this.state,n);if(!u)return;o=[u],this.clearTimer(n)}const l=s.map(u=>i||u.id===n?{...u,transitionStatus:"ending",height:0}:u),c=I3(l,r);this.setToasts(c,!c.some(u=>u.transitionStatus!=="ending")),o.forEach(u=>{var d;u.transitionStatus!=="ending"&&((d=u.onClose)==null||d.call(u))}),this.handleFocusManagement(n)});Zt(this,"promiseToast",(n,i)=>{const r=_3(i.loading),s=this.addToast({...r,type:"loading"}),o=n.then(l=>{const c=_3(i.success,l);return this.updateToast(s,{...c,type:"success",timeout:c.timeout}),l}).catch(l=>{const c=_3(i.error,l);return this.updateToast(s,{...c,type:"error",timeout:c.timeout}),Promise.reject(l)});return{}.hasOwnProperty.call(i,"setPromise")&&i.setPromise(o),o});Zt(this,"handleDocumentPointerDown",n=>{if(n.pointerType!=="touch")return;const i=uo(n);ii(this.state.viewport,i)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))})}syncProviderProps(n,i){const r=this.state.limit!==i;if(this.state.timeout===n&&!r)return;const s={timeout:n,limit:i};if(r){const o=I3(this.state.toasts,i);s.toasts=o,s.toastMetadata=R3(o)}this.update(s)}removeToast(n,i=!1){var l;const r=Bf.toastIndex(this.state,n);if(r===-1)return;const s=this.state.toasts[r];i||(l=s==null?void 0:s.onRemove)==null||l.call(s);const o=[...this.state.toasts];o.splice(r,1),this.setToasts(o)}pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(n=>{n.timeout&&(n.timeout.clear(),n.remaining=Math.max(n.remaining-(Date.now()-n.start),0))}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((n,i)=>{n.remaining=n.remaining>0?n.remaining:n.delay,n.timeout??(n.timeout=Lu.create()),n.timeout.start(n.remaining,()=>{this.handleTimerFired(i),n.callback()}),n.start=Date.now()}))}restoreFocusToPrevElement(){var n;(n=this.state.prevFocusElement)==null||n.focus({preventScroll:!0})}scheduleTimer(n,i,r){const s=Date.now(),l=!Bf.expandedOrOutOfFocus(this.state)?Lu.create():void 0;l==null||l.start(i,()=>{this.handleTimerFired(n),r()}),this.timers.set(n,{timeout:l,start:s,delay:i,remaining:i,callback:r})}clearTimers(){this.timers.forEach(n=>{var i;(i=n.timeout)==null||i.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer(n){var r;const i=this.timers.get(n);(r=i==null?void 0:i.timeout)==null||r.clear(),this.timers.delete(n),this.resetPausedStateIfNoTimersRemain()}handleTimerFired(n){this.timers.delete(n),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){this.timers.size===0&&(this.areTimersPaused=!1)}setToasts(n,i=n.length===0){const r={toasts:n,toastMetadata:R3(n)};i&&(r.hovering=!1,r.focused=!1),this.update(r)}handleFocusManagement(n){var c,u;const i=Ac(kr(this.state.viewport));if(!this.state.viewport||!ii(this.state.viewport,i)||!eB(i))return;if(n===void 0){this.restoreFocusToPrevElement();return}const r=Bf.toasts(this.state),s=Bf.toastIndex(this.state,n),o=(d,f)=>{for(let h=d;h>=0&&hnew dit({timeout:i,limit:r,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return $D(o.disposeEffect),p.useEffect(function(){return s?s[" subscribe"](({action:u,options:d})=>{const f=d.id;u==="promise"&&d.promise?o.promiseToast(d.promise,d):u==="update"&&f?o.updateToast(f,d):u==="close"?o.closeToast(f):o.addToast(d)}):void 0},[o,s]),a.jsxs(H2e.Provider,{value:o,children:[a.jsx(hit,{store:o,timeout:i,limit:r}),n]})};function hit(e){const{store:t,timeout:n,limit:i}=e;return Jn(()=>{t.syncProviderProps(n,i)},[t,n,i]),null}const pit={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},f_e={...pit,position:"fixed",top:0,left:0},f0=p.forwardRef(function(t,n){const[i,r]=p.useState();Jn(()=>{Bnt&&z1&&r("button")},[]);const s={tabIndex:0,role:i};return a.jsx("span",{...t,ref:n,style:f_e,"aria-hidden":i?void 0:!0,...s,"data-base-ui-focus-guard":""})});function Xw(e,t,n,i){const r=Ed(h_e).current;return git(r,e,t,n,i)&&p_e(r,[e,t,n,i]),r.callback}function mit(e){const t=Ed(h_e).current;return bit(t,e)&&p_e(t,e),t.callback}function h_e(){return{callback:null,cleanup:null,refs:[]}}function git(e,t,n,i,r){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==i||e.refs[3]!==r}function bit(e,t){return e.refs.length!==t.length||e.refs.some((n,i)=>n!==t[i])}function p_e(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const i=Array(t.length).fill(null);for(let r=0;r{for(let r=0;r=65&&r<=90&&(typeof t=="function"||typeof t>"u")}function nV(e){return typeof e=="function"}function b_e(e,t){return nV(e)?e(t):e??eV}function kit(e,t){return t?e?(...n)=>{const i=n[0];if(x_e(i)){const s=i;aI(s);const o=t(...n);return s.baseUIHandlerPrevented||e==null||e(...n),o}const r=t(...n);return e==null||e(...n),r}:y_e(t):e}function y_e(e){return e&&((...t)=>{const n=t[0];return x_e(n)&&aI(n),e(...t)})}function aI(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function v_e(e,t){return t?e?t+" "+e:t:e}function x_e(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Ra(e,t,n={}){const i=t.render,r=Sit(t,n);if(n.enabled===!1)return null;const s=n.state??nc;return Ait(e,i,r,s)}function Sit(e,t={}){const{className:n,style:i,render:r}=e,{state:s=nc,ref:o,props:l,stateAttributesMapping:c,enabled:u=!0}=t,d=u?vit(n,s):void 0,f=u?m_e(i,s):void 0,h=u?yit(s,c):nc,m=u&&l?Eit(l):void 0,g=u?iB(h,m)??{}:nc;return typeof document<"u"&&(u?Array.isArray(o)?g.ref=mit([g.ref,vJ(r),...o]):g.ref=Xw(g.ref,vJ(r),o):Xw(null,null)),u?(d!==void 0&&(g.className=v_e(g.className,d)),f!==void 0&&(g.style=iB(g.style,f)),g):nc}function Eit(e){return Array.isArray(e)?xit(e):tV(void 0,e)}const Cit=Symbol.for("react.lazy");function Ait(e,t,n,i){if(t){if(typeof t=="function")return t(n,i);const r=tV(n,t.props);r.ref=n.ref;let s=t;return(s==null?void 0:s.$$typeof)===Cit&&(s=p.Children.toArray(t)[0]),p.cloneElement(s,r)}if(e&&typeof e=="string")return Tit(e,n);throw new Error(Vc(8))}function Tit(e,t){return e==="button"?p.createElement("button",{type:"button",...t,key:t.key}):e==="img"?p.createElement("img",{alt:"",...t,key:t.key}):p.createElement(e,t)}const _it=p.forwardRef(function(t,n){var F;const{render:i,className:r,style:s,children:o,...l}=t,c=Uz(),u=d0(),d=p.useRef(!1),f=p.useRef(!1),h=p.useRef(!1),m=c.useState("isEmpty"),g=c.useState("toasts"),b=c.useState("focused"),v=c.useState("expanded"),y=c.useState("prevFocusElement"),w=(F=g[0])==null?void 0:F.height,x=g.some(M=>M.transitionStatus==="ending"),O=g.filter(M=>M.priority==="high");p.useEffect(()=>{const M=c.state.viewport;if(!M||m)return;const V=ta(M),q=kr(M);function U(Z){Z.key==="F6"&&uo(Z)!==M&&(Z.preventDefault(),c.set("prevFocusElement",Ac(q)),M==null||M.focus({preventScroll:!0}),c.pauseTimers(),c.set("focused",!0))}function J(Z){uo(Z)===V&&(c.set("isWindowFocused",!1),c.pauseTimers())}function z(Z){if(Z.relatedTarget)return;const ne=uo(Z),W=Ac(kr(M));(ne===V||!ii(M,ne)||!eB(W))&&c.resumeTimers(),u.start(0,()=>c.set("isWindowFocused",!0))}return gh(Ni(V,"keydown",U),Ni(V,"blur",J,!0),Ni(V,"focus",z,!0),Ni(q,"pointerdown",c.handleDocumentPointerDown,!0))},[c,u,m]);function k(M){var q,U;d.current=!0;const V=M.relatedTarget===c.state.viewport?g.find(J=>J.transitionStatus!=="ending"&&!J.limited):void 0;V?(U=(q=V.ref)==null?void 0:q.current)==null||U.focus():c.restoreFocusToPrevElement()}function S(M){M.key==="Tab"&&M.shiftKey&&uo(M.nativeEvent)===c.state.viewport&&(M.preventDefault(),c.restoreFocusToPrevElement())}function C(){c.state.toasts.some(V=>V.transitionStatus==="ending")||h.current||!f.current||(c.state.isWindowFocused&&c.resumeTimers(),c.set("hovering",!1),f.current=!1)}p.useEffect(C,[x,c]);function E(){c.pauseTimers(),c.set("hovering",!0),f.current=!1}function j(){c.state.isWindowFocused&&c.resumeTimers()}function T(){f.current=!0,C()}function R(M){M.pointerType==="touch"&&(h.current=!0)}function A(M){M.pointerType==="touch"&&(h.current=!1,C())}function N(){if(d.current){d.current=!1;return}b||eB(Ac(kr(c.state.viewport)))&&(c.set("focused",!0),c.pauseTimers())}function P(M){!b||ii(c.state.viewport,M.relatedTarget)||(c.set("focused",!1),j())}const I={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:E,onMouseMove:E,onMouseLeave:T,onFocus:N,onBlur:P,onKeyDown:S,onClick:N,onPointerDown:R,onPointerUp:A,onPointerCancel:A,style:{"--toast-frontmost-height":w?`${w}px`:void 0}},D={expanded:v},_=!m&&y&&a.jsx(f0,{onFocus:k}),L=Ra("div",t,{ref:[n,c.setViewport],state:D,props:[I,l,{children:a.jsxs(p.Fragment,{children:[_,o,_]})}]});return a.jsxs(p.Fragment,{children:[_,L,!b&&O.length>0&&a.jsx("div",{style:f_e,children:O.map(M=>a.jsxs("div",{role:"alert","aria-atomic":!0,children:[a.jsx("div",{children:M.title}),a.jsx("div",{children:M.description})]},M.id))})]})});function iV(e){return Qz(19)?e:e?"true":void 0}const w_e=p.createContext(void 0);function jit(){const e=p.useContext(w_e);if(!e)throw new Error(Vc(66));return e}let oI=function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e}({});const Nit={"data-starting-style":""},Rit={"data-ending-style":""},KD={transitionStatus(e){return e==="starting"?Nit:e==="ending"?Rit:null}};function ip(e){return e==null?e:"current"in e?e.current:e}function rV(e,t=!1){const n=Wz();return ci((i,r=null)=>{n.cancel();const s=ip(e);if(s==null)return;const o=s,l=()=>{yi.flushSync(i)};if(typeof o.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function c(){Promise.all(o.getAnimations().map(u=>u.finished)).then(()=>{r!=null&&r.aborted||l()},()=>{if(r!=null&&r.aborted)return;if(o.getAnimations().some(d=>d.pending||d.playState!=="finished")){c();return}l()})}if(t){const u="data-starting-style";if(!o.hasAttribute(u)){n.request(c);return}const d=new MutationObserver(()=>{o.hasAttribute(u)||(d.disconnect(),c())});d.observe(o,{attributes:!0,attributeFilter:[u]}),r==null||r.addEventListener("abort",()=>d.disconnect(),{once:!0});return}n.request(c)})}function zA(e){const{enabled:t=!0,open:n,ref:i,onComplete:r}=e,s=ci(r),o=rV(i,n);p.useEffect(()=>{if(!t)return;const l=new AbortController;return o(s,l.signal),()=>{l.abort()}},[t,n,s,o])}const Iit=500,Pit={style:{transition:"none"}},sV="data-base-ui-click-trigger",Dit="data-base-ui-swipe-ignore",Mit="data-swipe-ignore",Lit=`[${Dit}]`,$it=`[${Mit}]`,Fit={fallbackAxisSide:"end"},Bit={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function P3(e,t,n){switch(e){case"up":return-n;case"down":return n;case"left":return-t;case"right":return t;default:return 0}}function Uit(e){const n=ta(e).getComputedStyle(e).transform;let i=0,r=0,s=1;if(n&&n!=="none"){const o=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(o){const l=o[1].split(", ").map(parseFloat);l.length===6?(i=l[4],r=l[5],s=Math.sqrt(l[0]*l[0]+l[1]*l[1])):l.length===16&&(i=l[12],r=l[13],s=l[0])}}return{x:i,y:r,scale:s}}const Qit={...KD,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},xJ=40,zit=10,wJ=.5,Vit=1,Hit=`${Lit},${$it}`,qit=p.forwardRef(function(t,n){var ze;const{toast:i,render:r,className:s,swipeDirection:o=["down","right"],style:l,...c}=t,u=((ze=i.positionerProps)==null?void 0:ze.anchor)!==void 0;let d=[];u||(d=Array.isArray(o)?o:[o]);const f=d.length>0,h=Uz(),[m,g]=p.useState(void 0),[b,v]=p.useState(!1),[y,w]=p.useState(!1),[x,O]=p.useState({x:0,y:0}),[k,S]=p.useState({x:0,y:0,scale:1}),[C,E]=p.useState(),[j,T]=p.useState(),[R,A]=p.useState(null),N=p.useRef(null),P=p.useRef(void 0),I=p.useRef({x:0,y:0}),D=p.useRef({x:0,y:0,scale:1}),_=p.useRef(void 0),L=p.useRef(0),F=p.useRef(!1),M=p.useRef({x:0,y:0}),V=p.useRef(!1),q=p.useRef({x:0,y:0}),U=p.useRef(null),J=p.useRef(null),z=h.useState("toastIndex",i.id),Z=h.useState("toastVisibleIndex",i.id),ne=h.useState("toastOffsetY",i.id),W=h.useState("focused"),G=h.useState("expanded");zA({open:i.transitionStatus!=="ending",ref:N,onComplete(){i.transitionStatus==="ending"&&h.removeToast(i.id)}});const H=ci((_e=!1)=>{const ae=N.current;if(!ae)return;const le=ae.style.height;ae.style.height="auto";const ge=ae.offsetHeight;ae.style.height=le;function Oe(){h.updateToastInternal(i.id,{ref:N,height:ge,transitionStatus:void 0})}_e?yi.flushSync(Oe):Oe()});Jn(()=>{const _e=P.current;i.transitionStatus!=="starting"&&_e===i.id||(_e!==void 0&&(g(void 0),S({x:0,y:0,scale:1}),se({x:0,y:0})),P.current=i.id,H())},[H,i.id,i.transitionStatus]);function se(_e){q.current=_e,O(_e)}Jn(()=>()=>{var _e;(_e=J.current)==null||_e.abort()},[]);function Y(_e,ae){const le=Se=>Se>0?Se**wJ:-(Math.abs(Se)**wJ),ge=_e>0&&!d.includes("right")||_e<0&&!d.includes("left"),Oe=ae>0&&!d.includes("down")||ae<0&&!d.includes("up");return{x:ge?le(_e):_e,y:Oe?le(ae):ae}}const X=ci(_e=>{var We;if(_e.pointerId!==U.current)return;U.current=null,(We=J.current)==null||We.abort(),J.current=null,v(!1),w(!1),A(null);const ae=D.current;if(_e.type==="pointercancel"||F.current){se({x:ae.x,y:ae.y}),g(void 0);return}const le=q.current,ge=le.x-ae.x,Oe=le.y-ae.y;let Se;for(const Ye of d)if(P3(Ye,ge,Oe)>xJ){Se=Ye;break}Se?(g(Se),h.closeToast(i.id)):(se({x:ae.x,y:ae.y}),g(void 0))});function ie(_e){var Ye,ye;if(_e.button!==0)return;_e.pointerType==="touch"&&h.pauseTimers();const ae=uo(_e.nativeEvent);if(ae==null?void 0:ae.closest(`button,a,input,textarea,[role="button"],${Hit}`))return;F.current=!1,_.current=void 0,L.current=0,U.current=_e.pointerId,I.current={x:_e.clientX,y:_e.clientY},M.current=I.current;const ge=_e.currentTarget,Oe=Uit(ge);D.current=Oe,S(Oe),se({x:Oe.x,y:Oe.y}),h.set("hovering",!0),v(!0),w(!1),A(null),V.current=!0,(Ye=J.current)==null||Ye.abort();const Se=new AbortController;J.current=Se;const We=kr(ge);We.addEventListener("pointerup",X,{signal:Se.signal}),We.addEventListener("pointercancel",X,{signal:Se.signal}),(ye=ge.setPointerCapture)==null||ye.call(ge,_e.pointerId)}function ee(_e){if(_e.pointerId!==U.current)return;_e.preventDefault(),V.current&&(I.current={x:_e.clientX,y:_e.clientY},V.current=!1);const{clientY:ae,clientX:le,movementX:ge,movementY:Oe}=_e;(Oe<0&&ae>M.current.y||Oe>0&&aeM.current.x||ge>0&&le=Vit){w(!0);const xt=d.includes("left")||d.includes("right"),tt=d.includes("up")||d.includes("down");if(xt&&tt){const mt=Math.abs(Se),Ne=Math.abs(We);we=mt>Ne?"horizontal":"vertical",A(we)}}let Ae;if(!_.current)we==="vertical"?We>0?Ae="down":We<0&&(Ae="up"):we==="horizontal"?Se>0?Ae="right":Se<0&&(Ae="left"):Math.abs(Se)>=Math.abs(We)?Ae=Se>0?"right":"left":Ae=We>0?"down":"up",Ae&&d.includes(Ae)&&(_.current=Ae,L.current=P3(Ae,Se,We),g(Ae));else{const Ct=_.current,xt=P3(Ct,ye,Ye);xt>xJ?(F.current=!1,g(Ct)):!(d.includes("left")&&d.includes("right"))&&!(d.includes("up")&&d.includes("down"))&&L.current-xt>=zit&&(F.current=!0)}const He=Y(Se,We);let Ue=D.current.x,jt=D.current.y;const Pt=d.includes("left")||d.includes("right"),Kt=d.includes("up")||d.includes("down");we!=="vertical"&&Pt&&(Ue+=He.x),we!=="horizontal"&&Kt&&(jt+=He.y),se({x:Ue,y:jt})}function be(_e){if(_e.key==="Escape"){if(!N.current||!ii(N.current,Ac(kr(N.current))))return;h.closeToast(i.id)}}p.useEffect(()=>{const _e=N.current;if(!f||!_e)return;function ae(le){U.current===null||!ii(_e,uo(le))||le.preventDefault()}return Ni(_e,"touchmove",ae,{passive:!1})},[f]);function ue(){const _e=x.x-k.x,ae=x.y-k.y;return{transition:b?"none":void 0,transform:b?`translateX(${x.x}px) translateY(${x.y}px) scale(${k.scale})`:void 0,"--toast-swipe-movement-x":`${_e}px`,"--toast-swipe-movement-y":`${ae}px`}}const pe=i.priority==="high",ke={role:pe?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":C,"aria-describedby":j,"aria-hidden":pe&&!W?!0:void 0,onPointerDown:f?ie:void 0,onPointerMove:f?ee:void 0,onPointerUp:f?X:void 0,onPointerCancel:f?X:void 0,onKeyDown:be,inert:iV(i.limited),style:{...ue(),"--toast-index":i.transitionStatus==="ending"?z:Z,"--toast-offset-y":`${ne}px`,"--toast-height":i.height?`${i.height}px`:void 0}},je=p.useMemo(()=>({toast:i,setTitleId:E,setDescriptionId:T,recalculateHeight:H,visibleIndex:Z,expanded:G}),[i,E,T,H,Z,G]),Pe={transitionStatus:i.transitionStatus,expanded:G,limited:i.limited||!1,type:i.type,swiping:b,swipeDirection:m},Ee=Ra("div",t,{ref:[n,N],state:Pe,stateAttributesMapping:Qit,props:[ke,c]});return a.jsx(w_e.Provider,{value:je,children:Ee})});let OJ=0;function Wit(e,t="mui"){const[n,i]=p.useState(e),r=e||n;return p.useEffect(()=>{n==null&&(OJ+=1,i(`${t}-${OJ}`))},[n,t]),r}const kJ=zz.useId;function VA(e,t){if(kJ!==void 0){const n=kJ();return e??(t?`${t}-${n}`:n)}return Wit(e,t)}function O_e(e){return e==null||typeof e=="boolean"||e===""?!1:Array.isArray(e)?e.some(O_e):!0}function Kit(e){return p.isValidElement(e)&&O_e(e.props.children)}function k_e(e,t,n){const{toast:i,setTitleId:r,setDescriptionId:s}=jit(),o=n==="title"?r:s,l=t??(n==="title"?i.title:i.description);return{id:VA(e),children:l,type:i.type,setId:o}}function S_e(e,t,n){const i=Kit(e);return Jn(()=>{if(i)return n(t),()=>{n(r=>r===t?void 0:r)}},[i,t,n]),i?e:null}const Git=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:o,children:l,...c}=t,{id:u,children:d,type:f,setId:h}=k_e(o,l,"description"),g=Ra("p",t,{ref:n,state:{type:f},props:{...c,id:u,children:d}});return S_e(g,u,h)}),Xit=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:o,children:l,...c}=t,{id:u,children:d,type:f,setId:h}=k_e(o,l,"title"),g=Ra("h2",t,{ref:n,state:{type:f},props:{...c,id:u,children:d}});return S_e(g,u,h)}),Yit=p.createContext(void 0);function Zit(e=!1){const t=p.useContext(Yit);if(t===void 0&&!e)throw new Error(Vc(16));return t}function Jit(e){const{focusableWhenDisabled:t,disabled:n,composite:i=!1,tabIndex:r=0,isNativeButton:s}=e,o=i&&t!==!1,l=i&&t===!1;return{props:p.useMemo(()=>{const u={onKeyDown(d){n&&t&&d.key!=="Tab"&&d.preventDefault()}};return i||(u.tabIndex=r,!s&&n&&(u.tabIndex=t?r:-1)),(s&&(t||o)||!s&&n)&&(u["aria-disabled"]=n),s&&(!t||l)&&(u.disabled=n),u},[i,n,t,o,l,s,r])}}function D3(e,t,{detail:n=0}={}){e.dispatchEvent(new(ta(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function GD(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:i=0,native:r=!0,composite:s}=e,o=p.useRef(null),l=Zit(!0),c=s??l!==void 0,{props:u}=Jit({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:i,isNativeButton:r}),d=p.useCallback(()=>{const m=o.current;M3(m)&&c&&t&&u.disabled===void 0&&m.disabled&&(m.disabled=!1)},[t,u.disabled,c]);Jn(d,[d]);const f=p.useCallback((m={})=>{const{onClick:g,onMouseDown:b,onKeyUp:v,onKeyDown:y,onPointerDown:w,...x}=m;return tV({onClick(O){if(t){O.preventDefault();return}g==null||g(O)},onMouseDown(O){t||b==null||b(O)},onKeyDown(O){if(t||(aI(O),y==null||y(O),O.baseUIHandlerPrevented))return;const k=O.target===O.currentTarget,S=O.currentTarget,C=M3(S),E=!r&&ert(S),j=k&&(r?C:!E),T=O.key==="Enter",R=O.key===" ",A=S.getAttribute("role"),N=(A==null?void 0:A.startsWith("menuitem"))||A==="option"||A==="gridcell";if(k&&c&&R){if(O.defaultPrevented&&N)return;O.preventDefault(),(!r||C)&&(O.preventBaseUIHandler(),D3(S,O));return}if(!j||r||!R&&!T){k&&E&&R&&O.preventDefault();return}O.defaultPrevented||(O.preventDefault(),T&&(O.preventBaseUIHandler(),D3(S,O)))},onKeyUp(O){if(!t){if(aI(O),v==null||v(O),O.target===O.currentTarget&&r&&c&&M3(O.currentTarget)&&O.key===" "){O.preventDefault();return}O.baseUIHandlerPrevented||O.target===O.currentTarget&&!r&&!c&&!O.defaultPrevented&&O.key===" "&&(O.preventBaseUIHandler(),D3(O.currentTarget,O))}},onPointerDown(O){if(t){O.preventDefault();return}w==null||w(O)}},r?{type:"button"}:{role:"button"},u,x)},[t,u,c,r]),h=ci(m=>{o.current=m,d()});return{getButtonProps:f,buttonRef:h}}function M3(e){return Js(e)&&e.tagName==="BUTTON"}function ert(e){return Js(e)&&e.tagName==="A"&&!!e.href}const E_e="none",Yw="trigger-press",mu="trigger-hover",C_e="outside-press",A_e="close-press",cC="focus-out",T_e="escape-key",__e="imperative-action";function fa(e,t,n,i){let r=!1,s=!1;const o=nc;return{reason:e,event:t??new Event("base-ui"),cancel(){r=!0},allowPropagation(){s=!0},get isCanceled(){return r},get isPropagationAllowed(){return s},trigger:n,...o}}function lI(e){return`data-base-ui-${e}`}const j_e=p.createContext(null),N_e=()=>p.useContext(j_e),trt=lI("portal");function R_e(e={}){const{ref:t,container:n,componentProps:i=nc,elementProps:r}=e,s=VA(),o=N_e(),l=o==null?void 0:o.portalNode,[c,u]=p.useState(null),[d,f]=p.useState(null),h=ci(v=>{v!==null&&f(v)}),m=p.useRef(null);Jn(()=>{if(n===null){m.current&&(m.current=null,f(null),u(null));return}const v=(n&&(Vz(n)?n:n.current))??l??document.body;if(v==null){m.current&&(m.current=null,f(null),u(null));return}m.current!==v&&(m.current=v,f(null),u(v))},[n,l]);const g=Ra("div",i,{ref:[t,h],props:[{id:s,[trt]:""},r]}),b=c&&g?yi.createPortal(g,c):null;return{node:d,nodeId:p.isValidElement(g)?g.props.id:void 0,subtree:b}}const I_e=p.forwardRef(function(t,n){const{render:i,className:r,style:s,children:o,container:l,...c}=t,{node:u,nodeId:d,subtree:f}=R_e({container:l,ref:n,componentProps:t,elementProps:c}),h=p.useRef(null),m=p.useRef(null),g=p.useRef(null),b=p.useRef(null),[v,y]=p.useState(null),w=p.useRef(!1),x=v==null?void 0:v.modal,O=v==null?void 0:v.open,k=!!v&&!v.modal&&v.open&&!!u;p.useEffect(()=>{if(!u||x)return;function C(E){u&&E.relatedTarget&&rw(E)&&(E.type==="focusin"?w.current&&(yJ(u),w.current=!1):(uit(u),w.current=!0))}return gh(Ni(u,"focusin",C,!0),Ni(u,"focusout",C,!0))},[u,x]),Jn(()=>{!u||O!==!0||!w.current||(yJ(u),w.current=!1)},[O,u]);const S=p.useMemo(()=>({beforeOutsideRef:h,afterOutsideRef:m,beforeInsideRef:g,afterInsideRef:b,portalNode:u,setFocusManagerState:y}),[u]);return a.jsxs(p.Fragment,{children:[f,a.jsxs(j_e.Provider,{value:S,children:[k&&u&&a.jsx(f0,{"data-type":"outside",ref:h,onFocus:C=>{var E;if(rw(C,u))(E=g.current)==null||E.focus();else{const j=v?v.domReference:null,T=u_e(j);T==null||T.focus()}}}),k&&u&&a.jsx("span",{"aria-owns":d,style:Bit}),u&&yi.createPortal(o,u),k&&u&&a.jsx(f0,{"data-type":"outside",ref:m,onFocus:C=>{var E;if(rw(C,u))(E=b.current)==null||E.focus();else{const j=v?v.domReference:null,T=Jz(j);T==null||T.focus(),v!=null&&v.closeOnFocusOut&&(v==null||v.onOpenChange(!1,fa(cC,C.nativeEvent)))}}})]})]})}),nrt=p.forwardRef(function(t,n){const{children:i,container:r,className:s,render:o,style:l,...c}=t,{node:u,subtree:d}=R_e({container:r,ref:n,componentProps:t,elementProps:c});return!d&&!u?null:a.jsxs(p.Fragment,{children:[d,u&&yi.createPortal(i,u)]})}),irt=p.forwardRef(function(t,n){return a.jsx(nrt,{ref:n,...t})});function Zl(e){const t=Ed(rrt,e).current;return t.next=e,Jn(t.effect),t}function rrt(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function srt(e,t){return t!=null&&!iw(t)?0:typeof e=="function"?e():e}function rB(e,t,n){const i=srt(e,n);return typeof i=="number"?i:i==null?void 0:i[t]}function SJ(e){return typeof e=="function"?e():e}function P_e(e,t){return t||e==="click"||e==="mousedown"}function art(e){return(e==null?void 0:e.includes("mouse"))&&e!=="mousedown"}let t_=0;function L3(e,t={}){const{preventScroll:n=!1,sync:i=!1,shouldFocus:r}=t;cancelAnimationFrame(t_);function s(){r&&!r()||e==null||e.focus({preventScroll:n})}if(i)return s(),Bz;const o=requestAnimationFrame(s);return t_=o,()=>{t_===o&&(cancelAnimationFrame(o),t_=0)}}const $3={inert:new WeakMap,"aria-hidden":new WeakMap},EJ="data-base-ui-inert",sB={inert:new WeakSet,"aria-hidden":new WeakSet};let uk=new WeakMap,F3=0;function ort(e){return sB[e]}function D_e(e){return e?Gw(e)?e.host:D_e(e.parentNode):null}const CJ=(e,t)=>t.map(n=>{if(e.contains(n))return n;const i=D_e(n);return e.contains(i)?i:null}).filter(n=>n!=null),AJ=e=>{const t=new Set;return e.forEach(n=>{let i=n;for(;i&&!t.has(i);)t.add(i),i=i.parentNode}),t},TJ=(e,t,n)=>{const i=[],r=s=>{!s||n.has(s)||Array.from(s.children).forEach(o=>{ll(o)!=="script"&&(t.has(o)?r(o):i.push(o))})};return r(e),i};function lrt(e,t,n,i,{mark:r=!0}){let s=null;i?s="inert":n&&(s="aria-hidden");let o=null,l=null;const c=CJ(t,e),u=r?TJ(t,AJ(c),new Set(c)):[],d=[],f=[];if(s){const h=$3[s],m=ort(s);l=m,o=h;const g=CJ(t,Array.from(t.querySelectorAll("[aria-live]"))),b=c.concat(g);TJ(t,AJ(b),new Set(b)).forEach(y=>{const w=y.getAttribute(s),x=w!==null&&w!=="false",O=(h.get(y)||0)+1;h.set(y,O),d.push(y),O===1&&x&&m.add(y),x||y.setAttribute(s,s==="inert"?"":"true")})}return r&&u.forEach(h=>{const m=(uk.get(h)||0)+1;uk.set(h,m),f.push(h),m===1&&h.setAttribute(EJ,"")}),F3+=1,()=>{o&&d.forEach(h=>{const g=(o.get(h)||0)-1;o.set(h,g),g||(!(l!=null&&l.has(h))&&s&&h.removeAttribute(s),l==null||l.delete(h))}),r&&f.forEach(h=>{const m=(uk.get(h)||0)-1;uk.set(h,m),m||h.removeAttribute(EJ)}),F3-=1,F3||($3.inert=new WeakMap,$3["aria-hidden"]=new WeakMap,sB.inert=new WeakSet,sB["aria-hidden"]=new WeakSet,uk=new WeakMap)}}function _J(e,t={}){const{ariaHidden:n=!1,inert:i=!1,mark:r=!0}=t,s=kr(e[0]).body;return lrt(e,s,n,i,{mark:r})}function M_e(){const e=new Map;return{emit(t,n){var i;(i=e.get(t))==null||i.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var i;(i=e.get(t))==null||i.delete(n)}}}class crt{constructor(){Zt(this,"nodesRef",{current:[]});Zt(this,"events",M_e())}addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(i=>i===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const L_e=p.createContext(null),$_e=p.createContext(null),XD=()=>{var e;return((e=p.useContext(L_e))==null?void 0:e.id)||null},V1=e=>{const t=p.useContext($_e);return e??t};function urt(e){const t=VA(),n=V1(e),i=XD();return Jn(()=>{if(!t)return;const r={id:t,parentId:i};return n==null||n.addNode(r),()=>{n==null||n.removeNode(r)}},[n,t,i]),t}function drt(e){const{children:t,id:n}=e,i=XD();return a.jsx(L_e.Provider,{value:p.useMemo(()=>({id:n,parentId:i}),[n,i]),children:t})}function frt(e){const{children:t,externalTree:n}=e,i=Ed(()=>n??new crt).current;return a.jsx($_e.Provider,{value:i,children:t})}function hrt(e,t){const n=ta(uo(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const jJ=20;let mg=[];function aV(){mg=mg.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function NJ(e){aV(),e&&ll(e)!=="body"&&(mg.push(new WeakRef(e)),mg.length>jJ&&(mg=mg.slice(-jJ)))}function RJ(){var e;return aV(),(e=mg[mg.length-1])==null?void 0:e.deref()}function prt(e){return e?Zz(e)?e:QA(e)[0]||e:null}function IJ(e){var r;if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!((r=e.getAttribute("role"))!=null&&r.includes("dialog")))return;const n=l_e(e).filter(s=>{const o=s.getAttribute("data-tabindex")||"";return Zz(s)||s.hasAttribute("data-tabindex")&&!o.startsWith("-")}),i=e.getAttribute("tabindex");n.length===0?i!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(i!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function F_e(e){const{context:t,children:n,disabled:i=!1,initialFocus:r=!0,returnFocus:s=!0,restoreFocus:o=!1,modal:l=!0,closeOnFocusOut:c=!0,openInteractionType:u="",nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:h,externalTree:m,getInsideElements:g}=e,b="rootStore"in t?t.rootStore:t,v=b.useState("open"),y=b.useState("domReferenceElement"),w=b.useState("floatingElement"),{events:x,dataRef:O}=b.context,k=ci(()=>{var Y;return(Y=O.current.floatingContext)==null?void 0:Y.nodeId}),S=r===!1,C=hJ(y)&&S,E=Zl(r),j=Zl(s),T=Zl(u),R=Zl(v),A=V1(m),N=N_e(),P=p.useRef(!1),I=p.useRef(!1),D=p.useRef(!1),_=p.useRef(null),L=p.useRef(""),F=p.useRef(""),M=p.useRef(null),V=p.useRef(null),q=Xw(M,h,N==null?void 0:N.beforeInsideRef),U=Xw(V,N==null?void 0:N.afterInsideRef),J=d0(),z=d0(),Z=Wz(),ne=N!=null,W=pJ(w),G=ci((Y=W)=>Y?QA(Y):[]),H=ci(()=>(g==null?void 0:g().filter(Y=>Y!=null))??[]);p.useEffect(()=>{if(i||!l)return;function Y(ie){ie.key==="Tab"&&ii(W,Ac(kr(W)))&&G().length===0&&!C&&znt(ie)}const X=kr(W);return Ni(X,"keydown",Y)},[i,W,l,C,G]),p.useEffect(()=>{if(i||!v)return;const Y=kr(W);function X(){D.current=!1}function ie(be){const ue=uo(be),pe=H(),ke=ii(w,ue)||ii(y,ue)||ii(N==null?void 0:N.portalNode,ue)||pe.some(je=>je===ue||ii(je,ue));D.current=!ke,F.current=be.pointerType||"keyboard",ue!=null&&ue.closest(`[${sV}]`)&&(I.current=!0,z.start(0,()=>{I.current=!1}))}function ee(){F.current="keyboard"}return gh(Ni(Y,"pointerdown",ie,!0),Ni(Y,"pointerup",X,!0),Ni(Y,"pointercancel",X,!0),Ni(Y,"keydown",ee,!0),X)},[i,w,y,W,v,N,z,H]),p.useEffect(()=>{if(i||!c)return;const Y=kr(W);function X(){I.current=!0,z.start(0,()=>{I.current=!1})}function ie(pe){const ke=uo(pe);Zz(ke)&&(_.current=ke)}function ee(pe){const ke=pe.relatedTarget,je=pe.currentTarget,Pe=uo(pe);l&&ke==null&&Pe!=null&&ii(w,Pe)&&NJ(Pe),queueMicrotask(()=>{const Ee=k(),ze=b.context.triggerElements,_e=H(),ae=(ke==null?void 0:ke.hasAttribute(lI("focus-guard")))&&[M.current,V.current,N==null?void 0:N.beforeInsideRef.current,N==null?void 0:N.afterInsideRef.current,N==null?void 0:N.beforeOutsideRef.current,N==null?void 0:N.afterOutsideRef.current,ip(f),ip(d)].includes(ke),le=!(ii(y,ke)||ii(w,ke)||ii(ke,w)||ii(N==null?void 0:N.portalNode,ke)||_e.some(ge=>ge===ke||ii(ge,ke))||ze.hasMatchingElement(ge=>ii(ge,ke))||ae||A&&(Yg(A.nodesRef.current,Ee).find(ge=>{var Oe,Se;return ii((Oe=ge.context)==null?void 0:Oe.elements.floating,ke)||ii((Se=ge.context)==null?void 0:Se.elements.domReference,ke)})||mJ(A.nodesRef.current,Ee).find(ge=>{var Oe,Se,We;return[(Oe=ge.context)==null?void 0:Oe.elements.floating,pJ((Se=ge.context)==null?void 0:Se.elements.floating)].includes(ke)||((We=ge.context)==null?void 0:We.elements.domReference)===ke})));if(je===y&&W&&IJ(W),o&&je!==y&&!t_e(Pe)&&Ac(Y)===Y.body){if(Js(W)&&(W.focus(),o==="popup")){Z.request(()=>{W.focus()});return}const ge=G(),Oe=_.current,Se=(Oe&&ge.includes(Oe)?Oe:null)||ge[ge.length-1]||W;Js(Se)&&Se.focus()}if(O.current.insideReactTree){O.current.insideReactTree=!1;return}(C||!l)&&ke&&le&&!I.current&&(C||ke!==RJ())&&(P.current=!0,b.setOpen(!1,fa(cC,pe)))})}function be(){D.current||(O.current.insideReactTree=!0,J.start(0,()=>{O.current.insideReactTree=!1}))}const ue=Js(y)?y:null;if(!(!w&&!ue))return gh(ue&&Ni(ue,"focusout",ee),ue&&Ni(ue,"pointerdown",X),w&&Ni(w,"focusin",ie),w&&Ni(w,"focusout",ee),w&&N&&Ni(w,"focusout",be,!0))},[i,y,w,W,l,A,N,b,c,o,G,C,k,O,J,z,Z,d,f,H]),p.useEffect(()=>{var je,Pe,Ee;if(i||!w||!v)return;const Y=Array.from(((je=N==null?void 0:N.portalNode)==null?void 0:je.querySelectorAll(`[${lI("portal")}]`))||[]),ie=(Ee=(Pe=(A?mJ(A.nodesRef.current,k()):[]).find(ze=>{var _e;return hJ(((_e=ze.context)==null?void 0:_e.elements.domReference)||null)}))==null?void 0:Pe.context)==null?void 0:Ee.elements.domReference,be=[...[w,...Y,M.current,V.current,N==null?void 0:N.beforeOutsideRef.current,N==null?void 0:N.afterOutsideRef.current,...H()],ie,ip(f),ip(d),C?y:null].filter(ze=>ze!=null),ue=_J(be,{ariaHidden:l||C,mark:!1}),pe=[w,...Y].filter(ze=>ze!=null),ke=_J(pe);return()=>{ke(),ue()}},[v,i,y,w,l,N,C,A,k,d,f,H]),Jn(()=>{if(!v||i||!Js(W))return;L.current="",F.current="";const Y=kr(W),X=Ac(Y);queueMicrotask(()=>{const ie=E.current,ee=typeof ie=="function"?ie(T.current||""):ie;if(ee===void 0||ee===!1||ii(W,X))return;let ue=null;const pe=()=>(ue==null&&(ue=G(W)),ue[0]||W);let ke;ee===!0||ee===null?ke=pe():ke=ip(ee),ke=ke||pe();const je=ii(W,Ac(Y));L3(ke,{preventScroll:ke===W,shouldFocus(){if(!R.current)return!1;if(je)return!0;const Pe=Ac(Y);return!(Pe!==ke&&ii(W,Pe))}})})},[i,v,W,G,E,T,R]),Jn(()=>{if(i||!W)return;const Y=kr(W),X=Ac(Y),ie=T.current==null;NJ(X);function ee(ue){if(ue.open||(L.current=hrt(ue.nativeEvent,F.current)),ue.reason===mu&&ue.nativeEvent.type==="mouseleave"&&(P.current=!0),ue.reason===C_e)if(ue.nested)P.current=!1;else if(Hnt(ue.nativeEvent)||e_e(ue.nativeEvent))P.current=!1;else{let pe=!1;kr(W).createElement("div").focus({get preventScroll(){return pe=!0,!1}}),pe?P.current=!1:P.current=!0}}x.on("openchange",ee);function be(ue){const pe=j.current;let ke=typeof pe=="function"?pe(ue):pe;if(ke===void 0||ke===!1)return null;ke===null&&(ke=!0);const je=y!=null&&y.isConnected?y:null,Pe=X!=null&&X.isConnected&&ll(X)!=="body"?X:null;let Ee=ie?Pe||je:je||Pe;return Ee||(Ee=RJ()||null),typeof ke=="boolean"?Ee:ip(ke)||Ee||null}return()=>{x.off("openchange",ee);const ue=Ac(Y),pe=H(),ke=ii(w,ue)||pe.some(ze=>ze===ue||ii(ze,ue))||A&&Yg(A.nodesRef.current,k(),!1).some(ze=>{var _e;return ii((_e=ze.context)==null?void 0:_e.elements.floating,ue)}),je=j.current,Pe=L.current,Ee=be(Pe);queueMicrotask(()=>{const ze=prt(Ee),_e=typeof je!="boolean";if(je&&!P.current&&Js(ze)&&(!(!_e&&ze!==ue&&ue!==Y.body)||ke)){const ae={preventScroll:!0};Pe==="keyboard"&&(ae.focusVisible=!0),ze.focus(ae)}P.current=!1})}},[i,w,W,j,T,x,A,y,k,H]),Jn(()=>{if(!z1||v||!w)return;const Y=Ac(kr(w));!Js(Y)||!Kz(Y)||ii(w,Y)&&Y.blur()},[v,w]),Jn(()=>{if(!(i||!N))return N.setFocusManagerState({modal:l,closeOnFocusOut:c,open:v,onOpenChange:b.setOpen,domReference:y}),()=>{N.setFocusManagerState(null)}},[i,N,l,v,b,c,y]),Jn(()=>{if(!(i||!W))return IJ(W),()=>{queueMicrotask(aV)}},[i,W]);const se=!i&&(l?!C:!0)&&(ne||l);return a.jsxs(p.Fragment,{children:[se&&a.jsx(f0,{"data-type":"inside",ref:q,onFocus:Y=>{var X;if(l){const ie=G();L3(ie[ie.length-1])}else if(N!=null&&N.portalNode)if(P.current=!1,rw(Y,N.portalNode)){const ie=Jz(y);ie==null||ie.focus()}else(X=ip(f??N.beforeOutsideRef))==null||X.focus()}}),n,se&&a.jsx(f0,{"data-type":"inside",ref:U,onFocus:Y=>{var X;if(l)L3(G()[0]);else if(N!=null&&N.portalNode)if(c&&(P.current=!0),rw(Y,N.portalNode)){const ie=u_e(y);ie==null||ie.focus()}else(X=ip(d??N.afterOutsideRef))==null||X.focus()}})]})}function B_e(e,t={}){const{enabled:n=!0,event:i="click",toggle:r=!0,ignoreMouse:s=!1,stickIfOpen:o=!0,touchOpenDelay:l=0,reason:c=Yw}=t,u="rootStore"in e?e.rootStore:e,d=u.context.dataRef,f=p.useRef(void 0),h=Wz(),m=d0(),g=p.useMemo(()=>{function b(y,w,x,O){const k=fa(c,w,x);y&&O==="touch"&&l>0?m.start(l,()=>{u.setOpen(!0,k)}):u.setOpen(y,k)}function v(y,w,x){const O=d.current.openEvent,k=u.select("domReferenceElement")!==w;return y&&k||!y||!r?!0:O&&o?!x(O.type):!1}return{onPointerDown(y){f.current=iw(y.pointerType,!0)&&e_e(y.nativeEvent)?"virtual":y.pointerType},onMouseDown(y){const w=f.current,x=y.nativeEvent,O=u.select("open");if(y.button!==0||i==="click"||iw(w,!0)&&s)return;const k=v(O,y.currentTarget,E=>E==="click"||E==="mousedown"),S=uo(x);if(Kz(S)){b(k,x,S,w);return}const C=y.currentTarget;h.request(()=>{b(k,x,C,w)})},onClick(y){if(i==="mousedown-only")return;const w=f.current;if(i==="mousedown"&&w){f.current=void 0;return}if(iw(w,!0)&&s)return;const x=u.select("open"),O=v(x,y.currentTarget,k=>k==="click"||k==="mousedown"||k==="keydown"||k==="keyup");b(O,y.nativeEvent,y.currentTarget,w)},onKeyDown(){f.current=void 0}}},[d,i,s,c,u,o,r,h,m,l]);return p.useMemo(()=>n?{reference:g}:nc,[n,g])}function mrt(){return!1}function grt(e){return{escapeKey:typeof e=="boolean"?e:(e==null?void 0:e.escapeKey)??!1,outsidePress:typeof e=="boolean"?e:(e==null?void 0:e.outsidePress)??!0}}function U_e(e,t={}){const{enabled:n=!0,escapeKey:i=!0,outsidePress:r=!0,outsidePressEvent:s="sloppy",referencePress:o=mrt,bubbles:l,externalTree:c}=t,u="rootStore"in e?e.rootStore:e,d=u.useState("open"),f=u.useState("floatingElement"),{dataRef:h}=u.context,m=V1(c),g=ci(typeof r=="function"?r:()=>!1),b=typeof r=="function"?g:r,v=b!==!1,y=ci(()=>s),{escapeKey:w,outsidePress:x}=grt(l),O=p.useRef(!1),k=p.useRef(!1),S=p.useRef(!1),C=p.useRef(!1),E=p.useRef(""),j=p.useRef(null),T=d0(),R=d0(),A=ci(()=>{R.clear(),h.current.insideReactTree=!1}),N=ci(q=>{var z;const U=(z=h.current.floatingContext)==null?void 0:z.nodeId;return(m?Yg(m.nodesRef.current,U):[]).some(Z=>{var ne;return((ne=Z.context)==null?void 0:ne.open)&&!Z.context.dataRef.current[q]})}),P=ci(q=>j3(q,u.select("floatingElement"))||j3(q,u.select("domReferenceElement"))),I=ci(q=>{o()&&u.setOpen(!1,fa(Yw,q.nativeEvent))}),D=ci(q=>{if(!d||!n||!i||q.key!=="Escape"||C.current||!w&&N("__escapeKeyBubbles"))return;const U=Vnt(q)?q.nativeEvent:q,J=fa(T_e,U);u.setOpen(!1,J),J.isCanceled||q.preventDefault(),!w&&!J.isPropagationAllowed&&q.stopPropagation()}),_=ci(()=>{h.current.insideReactTree=!0,R.start(0,A)}),L=ci(q=>{if(!d||!n||q.button!==0)return;const U=uo(q.nativeEvent);ii(u.select("floatingElement"),U)&&(O.current||(O.current=!0,k.current=!1))}),F=ci(q=>{!d||!n||(q.defaultPrevented||q.nativeEvent.defaultPrevented)&&O.current&&(k.current=!0)});p.useEffect(()=>{if(!d||!n)return A;h.current.__escapeKeyBubbles=w,h.current.__outsidePressBubbles=x;const q=new Lu,U=new Lu;function J(){q.clear(),C.current=!0}function z(){q.start(z1?5:0,()=>{C.current=!1})}function Z(){S.current=!0,U.start(0,()=>{S.current=!1})}function ne(){O.current=!1,k.current=!1}function W(){const _e=E.current,ae=_e==="pen"||!_e?"mouse":_e,le=y(),ge=typeof le=="function"?le():le;return typeof ge=="string"?ge:ge[ae]}function G(_e){const ae=W();return ae==="intentional"&&_e.type!=="click"||ae==="sloppy"&&_e.type==="click"}function H(_e){var ge;const ae=(ge=h.current.floatingContext)==null?void 0:ge.nodeId,le=m&&Yg(m.nodesRef.current,ae).some(Oe=>{var Se;return j3(_e,(Se=Oe.context)==null?void 0:Se.elements.floating)});return P(_e)||le}function se(_e){if(G(_e)){_e.type!=="click"&&!P(_e)&&(U.clear(),S.current=!1),A();return}if(h.current.insideReactTree){A();return}const ae=uo(_e),le=`[${lI("inert")}]`,ge=Er(ae)?ae.getRootNode():null,Oe=Array.from((Gw(ge)?ge:kr(u.select("floatingElement"))).querySelectorAll(le)),Se=u.context.triggerElements;if(ae&&(Se.hasElement(ae)||Se.hasMatchingElement(Ye=>ii(Ye,ae))))return;let We=Er(ae)?ae:null;for(;We&&!Ig(We);){const Ye=Xg(We);if(Ig(Ye)||!Er(Ye))break;We=Ye}if(!(Oe.length&&Er(ae)&&!Unt(ae)&&!ii(ae,u.select("floatingElement"))&&Oe.every(Ye=>!ii(We,Ye)))){if(Js(ae)&&!("touches"in _e)){const Ye=Ig(ae),ye=Mu(ae),we=/auto|scroll/,Ae=Ye||we.test(ye.overflowX),He=Ye||we.test(ye.overflowY),Ue=Ae&&ae.clientWidth>0&&ae.scrollWidth>ae.clientWidth,jt=He&&ae.clientHeight>0&&ae.scrollHeight>ae.clientHeight,Pt=ye.direction==="rtl",Kt=jt&&(Pt?_e.offsetX<=ae.offsetWidth-ae.clientWidth:_e.offsetX>ae.clientWidth),Ct=Ue&&_e.offsetY>ae.clientHeight;if(Kt||Ct)return}if(!H(_e)){if(W()==="intentional"&&S.current){U.clear(),S.current=!1;return}typeof b=="function"&&!b(_e)||N("__outsidePressBubbles")||(u.setOpen(!1,fa(C_e,_e)),A())}}}function Y(_e){W()!=="sloppy"||_e.pointerType==="touch"||!u.select("open")||!n||P(_e)||se(_e)}function X(_e){if(W()!=="sloppy"||!u.select("open")||!n||P(_e))return;const ae=_e.touches[0];ae&&(j.current={startTime:Date.now(),startX:ae.clientX,startY:ae.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},T.start(1e3,()=>{j.current&&(j.current.dismissOnTouchEnd=!1,j.current.dismissOnMouseDown=!1)}))}function ie(_e,ae){const le=uo(_e);if(!le)return;const ge=Ni(le,_e.type,()=>{ae(_e),ge()})}function ee(_e){E.current="touch",ie(_e,X)}function be(_e){T.clear(),_e.type==="pointerdown"&&(E.current=_e.pointerType),!(_e.type==="mousedown"&&j.current&&!j.current.dismissOnMouseDown)&&ie(_e,ae=>{ae.type==="pointerdown"?Y(ae):se(ae)})}function ue(_e){if(!O.current)return;const ae=k.current;if(ne(),W()==="intentional"){if(_e.type==="pointercancel"){ae&&Z();return}if(!H(_e)){if(ae){Z();return}typeof b=="function"&&!b(_e)||(U.clear(),S.current=!0,A())}}}function pe(_e){if(W()!=="sloppy"||!j.current||P(_e))return;const ae=_e.touches[0];if(!ae)return;const le=Math.abs(ae.clientX-j.current.startX),ge=Math.abs(ae.clientY-j.current.startY),Oe=Math.sqrt(le*le+ge*ge);Oe>5&&(j.current.dismissOnTouchEnd=!0),Oe>10&&(se(_e),T.clear(),j.current=null)}function ke(_e){ie(_e,pe)}function je(_e){W()!=="sloppy"||!j.current||P(_e)||(j.current.dismissOnTouchEnd&&se(_e),T.clear(),j.current=null)}function Pe(_e){ie(_e,je)}const Ee=kr(f),ze=gh(i&&gh(Ni(Ee,"keydown",D),Ni(Ee,"compositionstart",J),Ni(Ee,"compositionend",z)),v&&gh(Ni(Ee,"click",be,!0),Ni(Ee,"pointerdown",be,!0),Ni(Ee,"pointerup",ue,!0),Ni(Ee,"pointercancel",ue,!0),Ni(Ee,"mousedown",be,!0),Ni(Ee,"mouseup",ue,!0),Ni(Ee,"touchstart",ee,!0),Ni(Ee,"touchmove",ke,!0),Ni(Ee,"touchend",Pe,!0)));return()=>{ze(),q.clear(),U.clear(),ne(),S.current=!1,A()}},[h,f,i,v,b,d,n,w,x,D,A,y,N,P,m,u,T]);const M=p.useMemo(()=>({onKeyDown:D,onPointerDown:I,onClick:I}),[D,I]),V=p.useMemo(()=>({onKeyDown:D,onPointerDown:F,onMouseDown:F,onClickCapture:_,onMouseDownCapture(q){_(),L(q)},onPointerDownCapture(q){_(),L(q)},onMouseUpCapture:_,onTouchEndCapture:_,onTouchMoveCapture:_}),[D,_,L,F]);return p.useMemo(()=>n?{reference:M,floating:V,trigger:M}:{},[n,M,V])}function PJ(e,t,n){let{reference:i,floating:r}=e;const s=dd(t),o=WD(t),l=qD(o),c=vd(t),u=s==="y",d=i.x+i.width/2-r.width/2,f=i.y+i.height/2-r.height/2,h=i[l]/2-r[l]/2;let m;switch(c){case"top":m={x:d,y:i.y-r.height};break;case"bottom":m={x:d,y:i.y+i.height};break;case"right":m={x:i.x+i.width,y:f};break;case"left":m={x:i.x-r.width,y:f};break;default:m={x:i.x,y:i.y}}const g=hm(t);return g&&(m[o]+=h*(g==="end"?1:-1)*(n&&u?-1:1)),m}async function brt(e,t){var n;t===void 0&&(t={});const{x:i,y:r,platform:s,rects:o,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=Oh(t,e),g=Yz(m),v=l[h?f==="floating"?"reference":"floating":f],y=rI(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),w=f==="floating"?{x:i,y:r,width:o.floating.width,height:o.floating.height}:o.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),O=await(s.isElement==null?void 0:s.isElement(x))&&await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1},k=rI(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:x,strategy:c}):w);return{top:(y.top-k.top+g.top)/O.y,bottom:(k.bottom-y.bottom+g.bottom)/O.y,left:(y.left-k.left+g.left)/O.x,right:(k.right-y.right+g.right)/O.x}}const yrt=50,vrt=async(e,t,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:s=[],platform:o}=n,l=o.detectOverflow?o:{...o,detectOverflow:brt},c=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:f}=PJ(u,i,c),h=i,m=0;const g={};for(let b=0;b({name:"arrow",options:e,async fn(t){const{x:n,y:i,placement:r,rects:s,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=Oh(e,t)||{};if(u==null)return{};const f=Yz(d),h={x:n,y:i},m=WD(r),g=qD(m),b=await o.getDimensions(u),v=m==="y",y=v?"top":"left",w=v?"bottom":"right",x=v?"clientHeight":"clientWidth",O=s.reference[g]+s.reference[m]-h[m]-s.floating[g],k=h[m]-s.reference[m],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let C=S?S[x]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=l.floating[x]||s.floating[g]);const E=O/2-k/2,j=C/2-b[g]/2-1,T=Zg(f[y],j),R=Zg(f[w],j),A=C-b[g]-R,N=C/2-b[g]/2+E,P=Gz(T,N,A),I=!c.arrow&&hm(r)!=null&&N!==P&&s.reference[g]/2-(NP<=0)){var R,A;const P=(((R=s.flip)==null?void 0:R.index)||0)+1,I=C[P];if(I&&(!(f==="alignment"?w!==dd(I):!1)||T.every(L=>dd(L.placement)===w?L.overflows[0]>0:!0)))return{data:{index:P,overflows:T},reset:{placement:I}};let D=(A=T.filter(_=>_.overflows[0]<=0).sort((_,L)=>_.overflows[1]-L.overflows[1])[0])==null?void 0:A.placement;if(!D)switch(m){case"bestFit":{var N;const _=(N=T.filter(L=>{if(S){const F=dd(L.placement);return F===w||F==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(F=>F>0).reduce((F,M)=>F+M,0)]).sort((L,F)=>L[1]-F[1])[0])==null?void 0:N[0];_&&(D=_);break}case"initialPlacement":D=l;break}if(r!==D)return{reset:{placement:D}}}return{}}}};function DJ(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function MJ(e){return Wnt.some(t=>e[t]>=0)}const Ort=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:i}=t,{strategy:r="referenceHidden",...s}=Oh(e,t);switch(r){case"referenceHidden":{const o=await i.detectOverflow(t,{...s,elementContext:"reference"}),l=DJ(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:MJ(l)}}}case"escaped":{const o=await i.detectOverflow(t,{...s,altBoundary:!0}),l=DJ(o,n.floating);return{data:{escapedOffsets:l,escaped:MJ(l)}}}default:return{}}}}},Q_e=new Set(["left","top"]);async function krt(e,t){const{placement:n,platform:i,elements:r}=e,s=await(i.isRTL==null?void 0:i.isRTL(r.floating)),o=vd(n),l=hm(n),c=dd(n)==="y",u=Q_e.has(o)?-1:1,d=s&&c?-1:1,f=Oh(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof g=="number"&&(m=l==="end"?g*-1:g),c?{x:m*d,y:h*u}:{x:h*u,y:m*d}}const Srt=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,i;const{x:r,y:s,placement:o,middlewareData:l}=t,c=await krt(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(i=l.arrow)!=null&&i.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:{...c,placement:o}}}}},Ert=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:i,placement:r,platform:s}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:c={fn:w=>{let{x,y:O}=w;return{x,y:O}}},...u}=Oh(e,t),d={x:n,y:i},f=await s.detectOverflow(t,u),h=dd(r),m=Xz(h);let g=d[m],b=d[h];const v=(w,x)=>Gz(x+f[w==="y"?"top":"left"],x,x-f[w==="y"?"bottom":"right"]);o&&(g=v(m,g)),l&&(b=v(h,b));const y=c.fn({...t,[m]:g,[h]:b});return{...y,data:{x:y.x-n,y:y.y-i,enabled:{[m]:o,[h]:l}}}}}},Crt=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,i;const{x:r,y:s,placement:o,rects:l,middlewareData:c}=t,{offset:u=0,mainAxis:d=!0,crossAxis:f=!0}=Oh(e,t),h={x:r,y:s},m=dd(o),g=Xz(m);let b=h[g],v=h[m];const y=Oh(u,t),w=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:(n=y.mainAxis)!=null?n:0,crossAxis:(i=y.crossAxis)!=null?i:0};if(d){const k=g==="y"?"height":"width",S=l.reference[g]-l.floating[k]+w.mainAxis,C=l.reference[g]+l.reference[k]-w.mainAxis;bC&&(b=C)}if(f){var x,O;const k=g==="y"?"width":"height",S=Q_e.has(vd(o)),C=l.reference[m]-l.floating[k]+(S&&((x=c.offset)==null?void 0:x[m])||0)+(S?0:w.crossAxis),E=l.reference[m]+l.reference[k]+(S?0:((O=c.offset)==null?void 0:O[m])||0)-(S?w.crossAxis:0);vE&&(v=E)}return{[g]:b,[m]:v}}}},Art=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:i,platform:r,elements:s}=t,{apply:o=()=>{},...l}=Oh(e,t),c=await r.detectOverflow(t,l),u=vd(n),d=hm(n),f=dd(n)==="y",{width:h,height:m}=i.floating;let g,b;u==="top"||u==="bottom"?(g=u,b=d===(await(r.isRTL==null?void 0:r.isRTL(s.floating))?"start":"end")?"left":"right"):(b=u,g=d==="end"?"top":"bottom");const v=m-c.top-c.bottom,y=h-c.left-c.right,w=Zg(m-c[g],v),x=Zg(h-c[b],y),O=t.middlewareData.shift,k=!O;let S=w,C=x;O!=null&&O.enabled.x&&(C=y),O!=null&&O.enabled.y&&(S=v),k&&!d&&(f?C=h-2*Ip(c.left,c.right):S=m-2*Ip(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});const E=await r.getDimensions(s.floating);return h!==E.width||m!==E.height?{reset:{rects:!0}}:{}}}};function z_e(e){const t=Mu(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const r=Js(e),s=r?e.offsetWidth:n,o=r?e.offsetHeight:i,l=nI(n)!==s||nI(i)!==o;return l&&(n=s,i=o),{width:n,height:i,$:l}}function oV(e){return Er(e)?e:e.contextElement}function sw(e){const t=oV(e);if(!Js(t))return Pp(1);const n=t.getBoundingClientRect(),{width:i,height:r,$:s}=z_e(t);let o=(s?nI(n.width):n.width)/i,l=(s?nI(n.height):n.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const Trt=Pp(0);function V_e(e){const t=ta(e);return!qz()||!t.visualViewport?Trt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _rt(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ta(e)}function h0(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=oV(e);let o=Pp(1);t&&(i?Er(i)&&(o=sw(i)):o=sw(e));const l=_rt(s,n,i)?V_e(s):Pp(0);let c=(r.left+l.x)/o.x,u=(r.top+l.y)/o.y,d=r.width/o.x,f=r.height/o.y;if(s&&i){const h=ta(s),m=Er(i)?ta(i):i;let g=h,b=Y8(g);for(;b&&m!==g;){const v=sw(b),y=b.getBoundingClientRect(),w=Mu(b),x=y.left+(b.clientLeft+parseFloat(w.paddingLeft))*v.x,O=y.top+(b.clientTop+parseFloat(w.paddingTop))*v.y;c*=v.x,u*=v.y,d*=v.x,f*=v.y,c+=x,u+=O,g=ta(b),b=Y8(g)}}return rI({width:d,height:f,x:c,y:u})}function YD(e,t){const n=zD(e).scrollLeft;return t?t.left+n:h0(fm(e)).left+n}function H_e(e,t){const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-YD(e,n),r=n.top+t.scrollTop;return{x:i,y:r}}function jrt(e){let{elements:t,rect:n,offsetParent:i,strategy:r}=e;const s=r==="fixed",o=fm(i),l=t?QD(t.floating):!1;if(i===o||l&&s)return n;let c={scrollLeft:0,scrollTop:0},u=Pp(1);const d=Pp(0),f=Js(i);if((f||!s)&&((ll(i)!=="body"||UA(o))&&(c=zD(i)),f)){const m=h0(i);u=sw(i),d.x=m.x+i.clientLeft,d.y=m.y+i.clientTop}const h=o&&!f&&!s?H_e(o,c):Pp(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+h.x,y:n.y*u.y-c.scrollTop*u.y+d.y+h.y}}function Nrt(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Rrt(e){const t=zD(e),n=e.ownerDocument.body,i=Ip(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=Ip(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-t.scrollLeft+YD(e);const o=-t.scrollTop;return Mu(n).direction==="rtl"&&(s+=Ip(e.clientWidth,n.clientWidth)-i),{width:i,height:r,x:s,y:o}}const Irt=25;function Prt(e,t,n){n===void 0&&(n="viewport");const i=n==="layoutViewport",r=ta(e),s=fm(e),o=r.visualViewport;let l=s.clientWidth,c=s.clientHeight,u=0,d=0;if(o){const h=!qz()||t==="fixed";i?h||(u=-o.offsetLeft,d=-o.offsetTop):(l=o.width,c=o.height,h&&(u=o.offsetLeft,d=o.offsetTop))}if(YD(s)<=0){const h=s.ownerDocument,m=h.body,g=getComputedStyle(m),b=h.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,v=Math.abs(s.clientWidth-m.clientWidth-b),y=getComputedStyle(s).scrollbarGutter==="stable both-edges"?v/2:v;y<=Irt&&(l-=y)}return{width:l,height:c,x:u,y:d}}function Drt(e,t){const n=h0(e,!0,t==="fixed"),i=n.top+e.clientTop,r=n.left+e.clientLeft,s=sw(e),o=e.clientWidth*s.x,l=e.clientHeight*s.y,c=r*s.x,u=i*s.y;return{width:o,height:l,x:c,y:u}}function LJ(e,t,n){let i;if(t==="viewport"||t==="layoutViewport")i=Prt(e,n,t);else if(t==="document")i=Rrt(fm(e));else if(Er(t))i=Drt(t,n);else{const r=V_e(e);i={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return rI(i)}function Mrt(e,t){const n=t.get(e);if(n)return n;let i=oC(e,[],!1).filter(l=>Er(l)&&ll(l)!=="body"),r=null;const s=Mu(e).position==="fixed";let o=s?Xg(e):e;for(;Er(o)&&!Ig(o);){const l=Mu(o),c=Hz(o),u=r?r.position:s?"fixed":"";!c&&(u==="fixed"||u==="absolute"&&l.position==="static")?i=i.filter(f=>f!==o):r=l,o=Xg(o)}return t.set(e,i),i}function Lrt(e){let{element:t,boundary:n,rootBoundary:i,strategy:r}=e;const o=[...n==="clippingAncestors"?QD(t)?[]:Mrt(t,this._c):[].concat(n),i],l=LJ(t,o[0],r);let c=l.top,u=l.right,d=l.bottom,f=l.left;for(let h=1;h{l(!1,1e-7)},1e3)}C=!1}try{i=new IntersectionObserver(E,{...S,root:s.ownerDocument})}catch{i=new IntersectionObserver(E,S)}i.observe(e)}const c=ta(e),u=()=>l(n);return c.addEventListener("resize",u),l(!0),()=>{c.removeEventListener("resize",u),o()}}function aB(e,t,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=i,u=oV(e),d=r||s?[...u?oC(u):[],...t?oC(t):[]]:[];d.forEach(y=>{r&&y.addEventListener("scroll",n),s&&y.addEventListener("resize",n)});const f=u&&l?zrt(u,n,s):null;let h=-1,m=null;o&&(m=new ResizeObserver(y=>{let[w]=y;w&&w.target===u&&m&&t&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),n()}),u&&!c&&m.observe(u),t&&m.observe(t));let g,b=c?h0(e):null;c&&v();function v(){const y=h0(e);b&&!W_e(b,y)&&n(),b=y,g=requestAnimationFrame(v)}return n(),()=>{var y;d.forEach(w=>{r&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),f==null||f(),(y=m)==null||y.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const Vrt=Srt,Hrt=Ert,qrt=wrt,Wrt=Art,Krt=Ort,FJ=xrt,Grt=Crt,Xrt=(e,t,n)=>{const i=new Map,r=n??{},s={...Qrt,...r.platform,_c:i};return vrt(e,t,{...r,platform:s})};var Yrt=typeof document<"u",Zrt=function(){},pN=Yrt?p.useLayoutEffect:Zrt;function cI(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,i,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(i=n;i--!==0;)if(!cI(e[i],t[i]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!{}.hasOwnProperty.call(t,r[i]))return!1;for(i=n;i--!==0;){const s=r[i];if(!(s==="_owner"&&e.$$typeof)&&!cI(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function K_e(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function BJ(e,t){const n=K_e(e);return Math.round(t*n)/n}function U3(e){const t=p.useRef(e);return pN(()=>{t.current=e}),t}function G_e(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:i=[],platform:r,elements:{reference:s,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=p.useState(i);cI(h,i)||m(i);const[g,b]=p.useState(null),[v,y]=p.useState(null),w=p.useCallback(L=>{L!==S.current&&(S.current=L,b(L))},[]),x=p.useCallback(L=>{L!==C.current&&(C.current=L,y(L))},[]),O=s||g,k=o||v,S=p.useRef(null),C=p.useRef(null),E=p.useRef(d),j=c!=null,T=U3(c),R=U3(r),A=U3(u),N=p.useCallback(()=>{if(!S.current||!C.current)return;const L={placement:t,strategy:n,middleware:h};R.current&&(L.platform=R.current),Xrt(S.current,C.current,L).then(F=>{const M={...F,isPositioned:A.current!==!1};P.current&&!cI(E.current,M)&&(E.current=M,yi.flushSync(()=>{f(M)}))})},[h,t,n,R,A]);pN(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(L=>({...L,isPositioned:!1})))},[u]);const P=p.useRef(!1);pN(()=>(P.current=!0,()=>{P.current=!1}),[]),pN(()=>{if(O&&(S.current=O),k&&(C.current=k),O&&k){if(T.current)return T.current(O,k,N);N()}},[O,k,N,T,j]);const I=p.useMemo(()=>({reference:S,floating:C,setReference:w,setFloating:x}),[w,x]),D=p.useMemo(()=>({reference:O,floating:k}),[O,k]),_=p.useMemo(()=>{const L={position:n,left:0,top:0};if(!D.floating)return L;const F=BJ(D.floating,d.x),M=BJ(D.floating,d.y);return l?{...L,transform:"translate("+F+"px, "+M+"px)",...K_e(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:M}},[n,l,D.floating,d.x,d.y]);return p.useMemo(()=>({...d,update:N,refs:I,elements:D,floatingStyles:_}),[d,N,I,D,_])}const Jrt=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:i,padding:r}=typeof e=="function"?e(n):e;return i&&t(i)?i.current!=null?FJ({element:i.current,padding:r}).fn(n):{}:i?FJ({element:i,padding:r}).fn(n):{}}}},X_e=(e,t)=>{const n=Vrt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Y_e=(e,t)=>{const n=Hrt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Z_e=(e,t)=>({fn:Grt(e).fn,options:[e,t]}),J_e=(e,t)=>{const n=qrt(e);return{name:n.name,fn:n.fn,options:[e,t]}},eje=(e,t)=>{const n=Wrt(e);return{name:n.name,fn:n.fn,options:[e,t]}},est=(e,t)=>{const n=Krt(e);return{name:n.name,fn:n.fn,options:[e,t]}},tst=(e,t)=>{const n=Jrt(e);return{name:n.name,fn:n.fn,options:[e,t]}},nst={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId};class lV extends BD{constructor(n){const{syncOnly:i,nested:r,onOpenChange:s,triggerElements:o,...l}=n;super({...l,positionReference:l.referenceElement,domReferenceElement:l.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:M_e(),nested:r,triggerElements:o},nst);Zt(this,"syncOpenEvent",(n,i)=>{(!n||!this.state.open||i!=null&&qnt(i))&&(this.context.dataRef.current.openEvent=n?i:void 0)});Zt(this,"dispatchOpenChange",(n,i)=>{this.syncOpenEvent(n,i.event);const r={open:n,reason:i.reason,nativeEvent:i.event,nested:this.context.nested,triggerElement:i.trigger};this.context.events.emit("openchange",r)});Zt(this,"setOpen",(n,i)=>{var r,s,o,l;if(this.syncOnly){(s=(r=this.context).onOpenChange)==null||s.call(r,n,i);return}this.dispatchOpenChange(n,i),(l=(o=this.context).onOpenChange)==null||l.call(o,n,i)});this.syncOnly=i}}function ist(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:i,floatingId:r,nested:s,onOpenChange:o}=e,l=t.useState("open"),c=t.useState("activeTriggerElement"),u=t.useState(n?"popupElement":"positionerElement"),d=t.context.triggerElements,f=o,h=p.useRef(null);i===void 0&&h.current===null&&(h.current=new lV({open:l,transitionStatus:void 0,referenceElement:c,floatingElement:u,triggerElements:d,onOpenChange:f,floatingId:r,syncOnly:!0,nested:s}));const m=i??h.current;return t.useSyncedValue("floatingId",r),Jn(()=>{const g={open:l,floatingId:r,referenceElement:c,floatingElement:u};Er(c)&&(g.domReferenceElement=c),m.state.positionReference===m.state.referenceElement&&(g.positionReference=c),m.update(g)},[l,r,c,u,m]),m.context.onOpenChange=f,m.context.nested=s,m}function tje(e,t=!1,n=!1){const[i,r]=p.useState(e&&t?"idle":void 0),[s,o]=p.useState(e);return e&&!s&&(o(!0),r("starting")),!e&&s&&i!=="ending"&&!n&&r("ending"),!e&&!s&&i==="ending"&&r(void 0),Jn(()=>{if(!e&&s&&i!=="ending"&&n){const l=_c.request(()=>{r("ending")});return()=>{_c.cancel(l)}}},[e,s,i,n]),Jn(()=>{if(!e||t)return;const l=_c.request(()=>{r(void 0)});return()=>{_c.cancel(l)}},[t,e]),Jn(()=>{if(!e||!t)return;e&&s&&i!=="idle"&&r("starting");const l=_c.request(()=>{r("idle")});return()=>{_c.cancel(l)}},[t,e,s,i]),{mounted:s,setMounted:o,transitionStatus:i}}const nje={tabIndex:-1,[J8]:""};function ije(e){return t=>t==="touch"?e.current:!0}function rje(e,t=!1){const n=VA(),i=XD()!=null,r=Ed(()=>e(n,i)).current;return ist({popupStore:r,treatPopupAsFloatingElement:t,floatingRootContext:r.state.floatingRootContext,floatingId:n,nested:i,onOpenChange:r.setOpen}),r}function sje({handle:e,store:t}){return Jn(()=>e.attachStore(t),[e,t]),null}function rst(e,t){const n=p.useRef(null),i=p.useRef(null);return p.useCallback(r=>{if(e===void 0)return;let s=!1;if(n.current!==null){const o=n.current,l=i.current,c=t.context.triggerElements.getById(o);l&&c===l&&(t.context.triggerElements.delete(o),s=!0),n.current=null,i.current=null}if(r!==null&&(n.current=e,i.current=r,t.context.triggerElements.add(e,r),s=!0),s){const o=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==o&&t.set("triggerCount",o)}},[t,e])}function aje(e,t,n,i=!1){t?e.preventUnmountingOnClose=!1:i&&(e.preventUnmountingOnClose=!0);const r=(n==null?void 0:n.id)??null;(r||t)&&(e.activeTriggerId=r,e.activeTriggerElement=n??null)}function sst(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function oje(e,t,n,i){const r=n.useState("isMountedByTrigger",e),s=rst(e,n),o=ci(c=>{const u=n.select("open"),d=n.select("activeTriggerId");if(d===e){n.update({activeTriggerElement:c,...u?i:null});return}d==null&&u&&n.update({activeTriggerId:e,activeTriggerElement:c,...i})}),l=p.useCallback(c=>{s(c),c&&o(c)},[s,o]);return Jn(()=>{r&&n.update({activeTriggerElement:t.current,...i})},[r,n,t,...Object.values(i)]),{registerTrigger:l,isMountedByThisTrigger:r}}function lje(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,i=p.useRef(null),r=e.useState("open"),s=e.useState("triggerCount"),o=e.useState("activeTriggerId"),l=e.useState("activeTriggerElement");Jn(()=>{if(!r){i.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}const c=e.context.triggerElements.size,u={};e.state.triggerCount!==c&&(u.triggerCount=c);const d=e.select("activeTriggerId");let f=null;if(d){const h=e.context.triggerElements.getById(d);if(h)i.current=d,h!==e.state.activeTriggerElement&&(u.activeTriggerElement=h);else{for(const[m,g]of e.context.triggerElements.entries())if(g===e.state.activeTriggerElement){u.activeTriggerId=m,u.activeTriggerElement=g,i.current=m;break}u.activeTriggerId===void 0&&(i.current===d?f=d:i.current=null)}}else i.current=null;if(!f&&!d&&c===1){const h=e.context.triggerElements.entries().next();if(!h.done){const[m,g]=h.value;u.activeTriggerId=m,u.activeTriggerElement=g,i.current=m}}(u.triggerCount!==void 0||u.activeTriggerId!==void 0||u.activeTriggerElement!==void 0)&&e.update(u),f&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===f&&!e.context.triggerElements.getById(f)){const h=fa(E_e);e.setOpen(!1,h),h.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[r,e,s,o,l,n])}function cje(e,t,n){const{mounted:i,setMounted:r,transitionStatus:s}=tje(e),o=t.useState("preventUnmountingOnClose"),l=e?!1:o;t.useSyncedValues({mounted:i,transitionStatus:s,preventUnmountingOnClose:l});const c=ci(()=>{var u,d;r(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n==null||n(),(d=(u=t.context).onOpenChangeComplete)==null||d.call(u,!1)});return zA({enabled:i&&!e&&!l,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:s}}function uje(e,t){e.useSyncedValues(t),Jn(()=>()=>{e.update({activeTriggerProps:nc,inactiveTriggerProps:nc,popupProps:nc})},[e])}function dje(e,t){Jn(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),Jn(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class cV{constructor(){this.idMap=new Map}add(t,n){this.idMap.set(t,n)}delete(t){this.idMap.delete(t)}hasElement(t){for(const n of this.idMap.values())if(n===t)return!0;return!1}hasMatchingElement(t){for(const n of this.idMap.values())if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function ast(){return new lV({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new cV,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function fje(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:ast(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:nc,inactiveTriggerProps:nc,popupProps:nc}}function hje(e,t,n=!1){return new lV({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}const tE=e=>e.triggerIdProp??e.activeTriggerId,uV=e=>e.openProp??e.open,UJ=e=>{var n;return(((n=e.popupElement)==null?void 0:n.id)??e.floatingId)||void 0};function pje(e,t){return t!==void 0&&uV(e)&&tE(e)===t}function ost(e,t){return pje(e,t)?!0:t!==void 0&&uV(e)&&tE(e)==null&&e.triggerCount===1}const mje={open:uV,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:tE,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:UJ,isTriggerActive:(e,t)=>t!==void 0&&tE(e)===t,isOpenedByTrigger:(e,t)=>pje(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&tE(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>ost(e,t)?UJ(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function gje(e){const t=p.useCallback(i=>e===void 0?Bz:e.subscribeStore(i),[e]),n=p.useCallback(()=>e===void 0?void 0:e.store,[e]);return ZP.useSyncExternalStore(t,n,()=>e==null?void 0:e.serverStore)}function lst(e){return cst(e,e.rootContext)}function cst(e,t){const{nodeId:n,externalTree:i}=e,r=t.useState("referenceElement"),s=t.useState("floatingElement"),o=t.useState("domReferenceElement"),l=t.useState("open"),c=t.useState("floatingId"),[u,d]=p.useState(null),[f,h]=p.useState(void 0),[m,g]=p.useState(void 0),b=p.useRef(null),v=V1(i),y=p.useMemo(()=>({reference:r,floating:s,domReference:o}),[r,s,o]),w=G_e({...e,elements:{...y,...u&&{reference:u}}}),x=Er(f)?f:null,O=m===void 0?t.state.floatingElement:m;t.useSyncedValue("referenceElement",f??null),t.useSyncedValue("domReferenceElement",f===void 0?o:x),t.useSyncedValue("floatingElement",O);const k=p.useCallback(R=>{const A=Er(R)?{getBoundingClientRect:()=>R.getBoundingClientRect(),getClientRects:()=>R.getClientRects(),contextElement:R}:R;d(A),w.refs.setReference(A)},[w.refs]),S=p.useCallback(R=>{(Er(R)||R===null)&&(b.current=R,h(R)),(Er(w.refs.reference.current)||w.refs.reference.current===null||R!==null&&!Er(R))&&w.refs.setReference(R)},[w.refs,h]),C=p.useCallback(R=>{g(R),w.refs.setFloating(R)},[w.refs]),E=p.useMemo(()=>({...w.refs,setReference:S,setFloating:C,setPositionReference:k,domReference:b}),[w.refs,S,C,k]),j=p.useMemo(()=>({...w.elements,domReference:o}),[w.elements,o]),T=p.useMemo(()=>({...w,dataRef:t.context.dataRef,open:l,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:E,elements:j,nodeId:n,rootStore:t}),[w,E,j,n,t,l,c]);return Jn(()=>{o&&(b.current=o)},[o]),Jn(()=>{t.context.dataRef.current.floatingContext=T;const R=v==null?void 0:v.nodesRef.current.find(A=>A.id===n);R&&(R.context=T)}),p.useMemo(()=>({...w,context:T,refs:E,elements:j,rootStore:t}),[w,E,j,T,t])}class dV{constructor(){Zt(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});Zt(this,"disposeEffect",()=>this.dispose);this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new Lu,this.restTimeout=new Lu,this.handleCloseOptions=void 0}static create(){return new dV}}const uI=new WeakMap;function dI(e){var n,i,r;if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&uI.get(t)===e&&((n=e.pointerEventsScopeElement)==null||n.style.removeProperty("pointer-events"),(i=e.pointerEventsReferenceElement)==null||i.style.removeProperty("pointer-events"),(r=e.pointerEventsFloatingElement)==null||r.style.removeProperty("pointer-events"),uI.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function bje(e,t){const{scopeElement:n,referenceElement:i,floatingElement:r}=t,s=uI.get(n);s&&s!==e&&dI(s),dI(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=i,e.pointerEventsFloatingElement=r,uI.set(n,e),n.style.pointerEvents="none",i.style.pointerEvents="auto",r.style.pointerEvents="auto"}function yje(e){const t=e.context.dataRef.current,n=Ed(()=>t.hoverInteractionState??dV.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=n),$D(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function ust(e,t={}){const{enabled:n=!0,closeDelay:i=0,nodeId:r}=t,s="rootStore"in e?e.rootStore:e,o=s.useState("open"),l=s.useState("floatingElement"),c=s.useState("domReferenceElement"),{dataRef:u}=s.context,d=V1(),f=XD(),h=yje(s),m=d0(),g=ci(()=>{var y;return P_e((y=u.current.openEvent)==null?void 0:y.type,h.interactedInside)}),b=ci(()=>{var y;return art((y=u.current.openEvent)==null?void 0:y.type)}),v=ci(()=>{dI(h)});Jn(()=>{o||(h.pointerType=void 0,h.restTimeoutPending=!1,h.interactedInside=!1,v())},[o,h,v]),p.useEffect(()=>v,[v]),Jn(()=>{var y,w,x,O,k;if(n&&o&&(y=h.handleCloseOptions)!=null&&y.blockPointerEvents&&b()&&Er(c)&&l){const S=c,C=l,E=kr(l),j=(x=(w=d==null?void 0:d.nodesRef.current.find(N=>N.id===f))==null?void 0:w.context)==null?void 0:x.elements.floating;j&&(j.style.pointerEvents="");const T=h.pointerEventsScopeElement!==C?h.pointerEventsScopeElement:null,R=j!==C?j:null,A=((k=(O=h.handleCloseOptions)==null?void 0:O.getScope)==null?void 0:k.call(O))??T??R??S.closest("[data-rootownerid]")??E.body;return bje(h,{scopeElement:A,referenceElement:S,floatingElement:C}),()=>{v()}}},[n,o,c,l,h,b,d,f,v]),p.useEffect(()=>{if(!n)return;function y(){return!!(d&&f&&Yg(d.nodesRef.current,f).length>0)}function w(E){const j=rB(i,"close",h.pointerType),T=()=>{s.setOpen(!1,fa(mu,E)),d==null||d.events.emit("floating.closed",E)};j?h.openChangeTimeout.start(j,T):(h.openChangeTimeout.clear(),T())}function x(E){const j=uo(E);if(!Qnt(j)){h.interactedInside=!1;return}h.interactedInside=(j==null?void 0:j.closest("[aria-haspopup]"))!=null}function O(){h.openChangeTimeout.clear(),m.clear(),d==null||d.events.off("floating.closed",S),v()}function k(E){var A;if(y()&&d){d.events.on("floating.closed",S);return}if(J2e(E.relatedTarget,s.context.triggerElements))return;const j=((A=u.current.floatingContext)==null?void 0:A.nodeId)??r,T=E.relatedTarget;if(!(d&&j&&Er(T)&&Yg(d.nodesRef.current,j,!1).some(N=>{var P;return ii((P=N.context)==null?void 0:P.elements.floating,T)}))){if(h.handler){h.handler(E);return}v(),b()&&!g()&&w(E)}}function S(E){!d||!f||y()||m.start(0,()=>{d.events.off("floating.closed",S),s.setOpen(!1,fa(mu,E)),d.events.emit("floating.closed",E)})}const C=l;return gh(C&&Ni(C,"mouseenter",O),C&&Ni(C,"mouseleave",k),C&&Ni(C,"pointerdown",x,!0),()=>{d==null||d.events.off("floating.closed",S)})},[n,l,s,u,i,r,b,g,v,h,d,f,m])}const dst={current:null};function fst(e,t={}){var D;const{enabled:n=!0,delay:i=0,handleClose:r=null,mouseOnly:s=!1,restMs:o=0,move:l=!0,triggerElementRef:c=dst,externalTree:u,isActiveTrigger:d=!0,getHandleCloseContext:f,isClosing:h,shouldOpen:m,guardStaleOpen:g=!1}=t,b="rootStore"in e?e.rootStore:e,{dataRef:v,events:y}=b.context,w=V1(u),x=yje(b),O=p.useRef(!1),k=Zl(r),S=Zl(i),C=Zl(o),E=Zl(n),j=Zl(m),T=Zl(h),R=ci(()=>{var _;return P_e((_=v.current.openEvent)==null?void 0:_.type,x.interactedInside)}),A=ci(()=>{var _;return((_=j.current)==null?void 0:_.call(j))!==!1}),N=ci((_,L,F)=>{const M=b.context.triggerElements;if(M.hasElement(L))return!_||!ii(_,L);if(!Er(F))return!1;const V=F;return M.hasMatchingElement(q=>ii(q,V))&&(!_||!ii(_,V))}),P=ci(()=>{if(!x.handler)return;kr(b.select("domReferenceElement")).removeEventListener("mousemove",x.handler),x.handler=void 0}),I=ci(()=>{dI(x)});return d&&(x.handleCloseOptions=(D=k.current)==null?void 0:D.__options),p.useEffect(()=>P,[P]),p.useEffect(()=>{if(!n)return;function _(L){L.open?O.current=!1:(O.current=L.reason===mu,P(),x.openChangeTimeout.clear(),x.restTimeout.clear(),x.blockMouseMove=!0,x.restTimeoutPending=!1)}return y.on("openchange",_),()=>{y.off("openchange",_)}},[n,y,x,P]),p.useEffect(()=>{if(!n)return;function _(U,J=!0){const z=rB(S.current,"close",x.pointerType);z?x.openChangeTimeout.start(z,()=>{b.setOpen(!1,fa(mu,U)),w==null||w.events.emit("floating.closed",U)}):J&&(x.openChangeTimeout.clear(),b.setOpen(!1,fa(mu,U)),w==null||w.events.emit("floating.closed",U))}const L=c.current??(d?b.select("domReferenceElement"):null);if(!Er(L))return;function F(U){var pe;if(x.openChangeTimeout.clear(),x.blockMouseMove=!1,s&&!iw(x.pointerType))return;const J=SJ(C.current),z=rB(S.current,"open",x.pointerType),Z=uo(U),ne=U.currentTarget??null,W=b.select("domReferenceElement");let G=ne;if(Er(Z)&&!b.context.triggerElements.hasElement(Z)){for(const ke of b.context.triggerElements.elements())if(ii(ke,Z)){G=ke;break}}Er(ne)&&Er(W)&&!b.context.triggerElements.hasElement(ne)&&ii(ne,W)&&(G=W);const H=G==null?!1:N(W,G,Z),se=b.select("open"),Y=((pe=T.current)==null?void 0:pe.call(T))??b.select("transitionStatus")==="ending",X=!se&&Y&&O.current,ie=!H&&Er(G)&&Er(W)&&ii(W,G)&&X,ee=J>0&&!z,be=H&&(se||X)||ie,ue=!se||H;if(be){A()&&b.setOpen(!0,fa(mu,U,G));return}ee||(z?x.openChangeTimeout.start(z,()=>{ue&&A()&&b.setOpen(!0,fa(mu,U,G))}):ue&&A()&&b.setOpen(!0,fa(mu,U,G)))}function M(U){if(R()){I();return}P();const J=b.select("domReferenceElement"),z=kr(J);x.restTimeout.clear(),x.restTimeoutPending=!1;const Z=v.current.floatingContext??(f==null?void 0:f());if(J2e(U.relatedTarget,b.context.triggerElements))return;if(k.current&&Z){b.select("open")||x.openChangeTimeout.clear();const W=c.current;x.handler=k.current({...Z,tree:w,x:U.clientX,y:U.clientY,onClose(){I(),P(),E.current&&!R()&&W===b.select("domReferenceElement")&&_(U,!0)}}),z.addEventListener("mousemove",x.handler),x.handler(U);return}(x.pointerType==="touch"?!ii(b.select("floatingElement"),U.relatedTarget):!0)&&_(U)}function V(U){ii(L,U.relatedTarget)||(x.openChangeTimeout.clear(),x.restTimeout.clear(),x.restTimeoutPending=!1)}const q=g?Ni(L,"mouseout",V):void 0;return l?gh(Ni(L,"mousemove",F,{once:!0}),Ni(L,"mouseenter",F),Ni(L,"mouseleave",M),q):gh(Ni(L,"mouseenter",F),Ni(L,"mouseleave",M),q)},[P,I,v,S,b,n,k,x,d,N,R,s,l,C,c,w,E,f,T,A,g]),p.useMemo(()=>{if(!n)return;function _(L){x.pointerType=L.pointerType}return{onPointerDown:_,onPointerEnter:_,onMouseMove(L){var Z,ne,W;const{nativeEvent:F}=L,M=L.currentTarget,V=b.select("domReferenceElement"),q=b.select("open"),U=N(V,M,L.target);if(s&&!iw(x.pointerType))return;if(q&&U&&((Z=x.handleCloseOptions)!=null&&Z.blockPointerEvents)){const G=b.select("floatingElement");if(G){const H=((W=(ne=x.handleCloseOptions)==null?void 0:ne.getScope)==null?void 0:W.call(ne))??M.ownerDocument.body;bje(x,{scopeElement:H,referenceElement:M,floatingElement:G})}}const J=SJ(C.current);if(q&&!U||J===0||!U&&x.restTimeoutPending&&L.movementX**2+L.movementY**2<2)return;x.restTimeout.clear();function z(){if(x.restTimeoutPending=!1,R())return;const G=b.select("open");!x.blockMouseMove&&(!G||U)&&A()&&b.setOpen(!0,fa(mu,F,M))}x.pointerType==="touch"?yi.flushSync(()=>{z()}):U&&q?z():(x.restTimeoutPending=!0,x.restTimeout.start(J,z))}}},[n,x,R,N,s,b,C,A])}const QJ=.1,hst=QJ*QJ,Hr=.5;function n_(e,t,n,i,r,s){return i>=t!=s>=t&&e<=(r-n)*(t-i)/(s-i)+n}function i_(e,t,n,i,r,s,o,l,c,u){let d=!1;return n_(e,t,n,i,r,s)&&(d=!d),n_(e,t,r,s,o,l)&&(d=!d),n_(e,t,o,l,c,u)&&(d=!d),n_(e,t,c,u,n,i)&&(d=!d),d}function pst(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function r_(e,t,n,i,r,s){const o=Math.min(n,r),l=Math.max(n,r),c=Math.min(i,s),u=Math.max(i,s);return e>=o&&e<=l&&t>=c&&t<=u}function mst(e={}){const{blockPointerEvents:t=!1}=e,n=new Lu,i=({x:r,y:s,placement:o,elements:l,onClose:c,nodeId:u,tree:d})=>{const f=o==null?void 0:o.split("-")[0];let h=!1,m=null,g=null,b=typeof performance<"u"?performance.now():0;function v(w,x){const O=performance.now(),k=O-b;if(m===null||g===null||k===0)return m=w,g=x,b=O,!1;const S=w-m,C=x-g,E=S*S+C*C,j=k*k*hst;return m=w,g=x,b=O,E0)}function N(){A()||y()}if(A())return;const P=O.getBoundingClientRect(),I=k.getBoundingClientRect(),D=r>I.right-I.width/2,_=s>I.bottom-I.height/2,L=I.width>P.width,F=I.height>P.height,M=(L?P:I).left,V=(L?P:I).right,q=(F?P:I).top,U=(F?P:I).bottom;if(f==="top"&&s>=P.bottom-1||f==="bottom"&&s<=P.top+1||f==="left"&&r>=P.right-1||f==="right"&&r<=P.left+1){N();return}let J=!1;switch(f){case"top":J=r_(S,C,M,P.top+1,V,I.bottom-1);break;case"bottom":J=r_(S,C,M,I.top+1,V,P.bottom-1);break;case"left":J=r_(S,C,I.right-1,U,P.left+1,q);break;case"right":J=r_(S,C,P.right-1,U,I.left+1,q);break}if(J)return;if(h&&!pst(S,C,P)){N();return}if(!j&&v(S,C)){N();return}let z=!1;switch(f){case"top":{const Z=L?Hr/2:Hr*4,ne=L||D?r+Z:r-Z,W=L?r-Z:D?r+Z:r-Z,G=s+Hr+1,H=D||L?I.bottom-Hr:I.top,se=D?L?I.bottom-Hr:I.top:I.bottom-Hr;z=i_(S,C,ne,G,W,G,I.left,H,I.right,se);break}case"bottom":{const Z=L?Hr/2:Hr*4,ne=L||D?r+Z:r-Z,W=L?r-Z:D?r+Z:r-Z,G=s-Hr,H=D||L?I.top+Hr:I.bottom,se=D?L?I.top+Hr:I.bottom:I.top+Hr;z=i_(S,C,ne,G,W,G,I.left,H,I.right,se);break}case"left":{const Z=F?Hr/2:Hr*4,ne=F||_?s+Z:s-Z,W=F?s-Z:_?s+Z:s-Z,G=r+Hr+1,H=_||F?I.right-Hr:I.left,se=_?F?I.right-Hr:I.left:I.right-Hr;z=i_(S,C,H,I.top,se,I.bottom,G,ne,G,W);break}case"right":{const Z=F?Hr/2:Hr*4,ne=F||_?s+Z:s-Z,W=F?s-Z:_?s+Z:s-Z,G=r-Hr,H=_||F?I.left+Hr:I.right,se=_?F?I.left+Hr:I.right:I.left+Hr;z=i_(S,C,G,ne,G,W,H,I.top,se,I.bottom);break}}z?h||n.start(40,N):N()}};return i.__options={...e,blockPointerEvents:t},i}const gst=p.createContext(void 0);function bst(){const e=p.useContext(gst);return(e==null?void 0:e.direction)??"ltr"}const yst=e=>({name:"arrow",options:e,async fn(t){var F,M;const{x:n,y:i,placement:r,rects:s,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:d=0,offsetParent:f="real"}=Oh(e,t)||{};if(u==null)return{};const h=Yz(d),m={x:n,y:i},g=WD(r),b=qD(g),v=await o.getDimensions(u),y=g==="y",w=y?"top":"left",x=y?"bottom":"right",O=y?"clientHeight":"clientWidth",k=s.reference[b]+s.reference[g]-m[g]-s.floating[b],S=m[g]-s.reference[g],C=f==="real"?await((F=o.getOffsetParent)==null?void 0:F.call(o,u)):l.floating;let E=l.floating[O]||s.floating[b];(!E||!await((M=o.isElement)==null?void 0:M.call(o,C)))&&(E=l.floating[O]||s.floating[b]);const j=k/2-S/2,T=E/2-v[b]/2-1,R=Math.min(h[w],T),A=Math.min(h[x],T),N=R,P=E-v[b]-A,I=E/2-v[b]/2+j,D=Gz(N,I,P),_=!c.arrow&&hm(r)!=null&&I!==D&&s.reference[b]/2-(I({...yst(e),options:[e,t]}),xst={name:"hide",async fn(e){const{width:t,height:n,x:i,y:r}=e.rects.reference,s=t===0&&n===0&&i===0&&r===0,o=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||s}}}},wst={sideX:"left",sideY:"top"},zJ="--available-width",VJ="--available-height";function vje(e,t,n){const i=e==="inline-start"||e==="inline-end";return{top:"top",right:i?n?"inline-start":"inline-end":"right",bottom:"bottom",left:i?n?"inline-end":"inline-start":"left"}[t]}function HJ(e,t,n){const{rects:i,placement:r}=e;return{side:vje(t,vd(r),n),align:hm(r)||"center",anchor:{width:i.reference.width,height:i.reference.height},positioner:{width:i.floating.width,height:i.floating.height}}}function Ost(e){return kst(e,lst)}function kst(e,t){var tt,mt;const{anchor:n,positionMethod:i="absolute",side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:l=0,collisionBoundary:c,collisionPadding:u=5,sticky:d=!1,arrowPadding:f=5,disableAnchorTracking:h=!1,inline:m,keepMounted:g=!1,floatingRootContext:b,mounted:v,collisionAvoidance:y,shift:w,nodeId:x,adaptiveOrigin:O,lazyFlip:k=!1,externalTree:S}=e,[C,E]=p.useState(null);!v&&C!==null&&E(null);const j=y.side||"flip",T=y.align||"flip",R=y.fallbackAxisSide||"end",A=(w==null?void 0:w.crossAxis)??!1,N=w==null?void 0:w.rootBoundary,P=typeof n=="function"?n:void 0,I=ci(P),D=P?I:n,_=Zl(n),L=Zl(v),M=bst()==="rtl",V=C||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":M?"left":"right","inline-start":M?"right":"left"}[r],q=o==="center"?V:`${V}-${o}`;let U=u;typeof U=="number"?U={top:U,right:U,bottom:U,left:U}:U&&(U={top:U.top||0,right:U.right||0,bottom:U.bottom||0,left:U.left||0});const J=1,z=r==="bottom"?J:0,Z=r==="top"?J:0,ne=r==="right"?J:0,W=r==="left"?J:0,G={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:U},H=p.useRef(null),se=Zl(s),Y=Zl(l),X=typeof s!="function"?s:0,ie=typeof l!="function"?l:0,ee=[];m&&ee.push(m),ee.push(X_e(Ne=>{const Ot=HJ(Ne,r,M),Nt=typeof se.current=="function"?se.current(Ot):se.current,Yt=typeof Y.current=="function"?Y.current(Ot):Y.current;return{mainAxis:Nt,crossAxis:Yt,alignmentAxis:Yt}},[X,ie,M,r]));const be=T==="none"&&j!=="shift",ue=!be&&(d||A||j==="shift"),pe=j==="none"?null:J_e({...G,padding:{top:U.top+J+z,right:U.right+J+W,bottom:U.bottom+J+Z,left:U.left+J+ne},mainAxis:!A&&j==="flip",crossAxis:T==="flip"?"alignment":!1,fallbackAxisSideDirection:R}),ke=be?null:Y_e({...G,rootBoundary:N,mainAxis:T!=="none",crossAxis:ue,limiter:d||A?void 0:Z_e(Ne=>{if(!H.current)return{};const{width:Ot,height:Nt}=H.current.getBoundingClientRect(),Yt=dd(vd(Ne.placement)),xn=Yt==="y"?Ot:Nt,Ke=Yt==="y"?U.left+U.right:U.top+U.bottom;return{offset:xn/2+Ke/2}})},[G,d,A,N,U,T]);j==="shift"||T==="shift"||o==="center"?ee.push(ke,pe):ee.push(pe,ke),ee.push(eje({...G,apply({elements:{floating:Ne},availableWidth:Ot,availableHeight:Nt,rects:Yt}){if(!L.current)return;const xn=Ne.style;xn.setProperty(zJ,`${Ot}px`),xn.setProperty(VJ,`${Nt}px`);const Ke=ta(Ne).devicePixelRatio||1,{x:St,y:qe,width:nt,height:et}=Yt.reference,ft=(Math.round((St+nt)*Ke)-Math.round(St*Ke))/Ke,Et=(Math.round((qe+et)*Ke)-Math.round(qe*Ke))/Ke;xn.setProperty("--anchor-width",`${ft}px`),xn.setProperty("--anchor-height",`${Et}px`)}}),vst(Ne=>({element:H.current||kr(Ne.elements.floating).createElement("div"),padding:f,offsetParent:"floating"}),[f]),{name:"transformOrigin",fn(Ne){var Me,on,On;const{elements:Ot,middlewareData:Nt,placement:Yt,rects:xn,y:Ke}=Ne,St=vd(Yt),qe=dd(St),nt=H.current,et=((Me=Nt.arrow)==null?void 0:Me.x)||0,ft=((on=Nt.arrow)==null?void 0:on.y)||0,Et=(nt==null?void 0:nt.clientWidth)||0,At=(nt==null?void 0:nt.clientHeight)||0,It=et+Et/2,Gt=ft+At/2,Xe=Math.abs(((On=Nt.shift)==null?void 0:On.y)||0),wt=xn.reference.height/2,vt=typeof s=="function"?s(HJ(Ne,r,M)):s,tn=Xe>vt,Qt={top:`${It}px calc(100% + ${vt}px)`,bottom:`${It}px ${-vt}px`,left:`calc(100% + ${vt}px) ${Gt}px`,right:`${-vt}px ${Gt}px`}[St],cn=`${It}px ${xn.reference.y+wt-Ke}px`;return Ot.floating.style.setProperty("--transform-origin",ue&&qe==="y"&&tn?cn:Qt),{}}},xst,O),Jn(()=>{!v&&b&&b.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[v,b]);const je=p.useMemo(()=>({elementResize:!h&&typeof ResizeObserver<"u",layoutShift:!h&&typeof IntersectionObserver<"u"}),[h]),{refs:Pe,elements:Ee,x:ze,y:_e,middlewareData:ae,update:le,placement:ge,context:Oe,isPositioned:Se,floatingStyles:We}=t({rootContext:b,open:g?v:void 0,placement:q,middleware:ee,strategy:i,whileElementsMounted:g?void 0:(...Ne)=>aB(...Ne,je),nodeId:x,externalTree:S}),{sideX:Ye,sideY:ye}=ae.adaptiveOrigin||wst,we=Se?i:"fixed",Ae=p.useMemo(()=>{let Ne;return Se?O?Ne={position:we,[Ye]:ze,[ye]:_e}:Ne={...We,position:we}:Ne={position:we,top:0,left:0},Ne[zJ]="100vw",Ne[VJ]="100vh",Se||(Ne.opacity=0),Ne},[O,we,Ye,ze,ye,_e,We,Se]),He=p.useRef(null);Jn(()=>{if(!v)return;const Ne=_.current,Ot=typeof Ne=="function"?Ne():Ne,Yt=(qJ(Ot)?Ot.current:Ot)||null||null;Yt!==He.current&&(Pe.setPositionReference(Yt),He.current=Yt)},[v,Pe,D,_]),p.useEffect(()=>{if(!v)return;const Ne=_.current;typeof Ne!="function"&&qJ(Ne)&&Ne.current!==He.current&&(Pe.setPositionReference(Ne.current),He.current=Ne.current)},[v,Pe,D,_]),p.useEffect(()=>{if(g&&v&&Ee.reference&&Ee.floating)return aB(Ee.reference,Ee.floating,le,je)},[g,v,Ee,le,je]);const Ue=vd(ge),jt=vje(r,Ue,M),Pt=hm(ge)||"center",Kt=!!((tt=ae.hide)!=null&&tt.referenceHidden);Jn(()=>{k&&v&&Se&&Ue!==V&&E(Ue)},[k,v,Se,Ue,V]);const Ct=p.useMemo(()=>{var Ne,Ot;return{position:"absolute",top:(Ne=ae.arrow)==null?void 0:Ne.y,left:(Ot=ae.arrow)==null?void 0:Ot.x}},[ae.arrow]),xt=((mt=ae.arrow)==null?void 0:mt.centerOffset)!==0;return p.useMemo(()=>({positionerStyles:Ae,arrowStyles:Ct,arrowRef:H,arrowUncentered:xt,side:jt,align:Pt,physicalSide:Ue,anchorHidden:Kt,refs:Pe,context:Oe,isPositioned:Se,update:le}),[Ae,Ct,H,xt,jt,Pt,Ue,Kt,Pe,Oe,Se,le])}function qJ(e){return e!=null&&"current"in e}(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=oI.startingStyle]="startingStyle",e[e.endingStyle=oI.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({});const Sst={"data-popup-open":""},Est={"data-popup-open":"","data-pressed":""},Cst={"data-open":""},Ast={"data-closed":""},Tst={"data-anchor-hidden":""},xje={open(e){return e?Sst:null}},_st={open(e){return e?Est:null}},fV={open(e){return e?Cst:Ast},anchorHidden(e){return e?Tst:null}},wje={...fV,...KD};function Oje(e){return e==="starting"?Pit:nc}function jst(e,t,{styles:n,transitionStatus:i,props:r,refs:s,hidden:o,inert:l=!1}){const c={...n};return l&&(c.pointerEvents="none"),Ra("div",e,{state:t,ref:s,props:[{role:"presentation",hidden:o,style:c},Oje(i),r],stateAttributesMapping:fV})}function kje(){const e=Uz(),t=e.useState("toasts");return p.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function yf({orientation:e="vertical",maxHeight:t,hideScrollbar:n=!1,fadeEdges:i=!1,contentClassName:r="",className:s="",style:o,children:l,hasMore:c=!1,onLoadMore:u,threshold:d=24,onScroll:f,ref:h,...m}){const[g,b]=p.useState(!1),[v,y]=p.useState(!1),[w,x]=p.useState({top:!1,bottom:!1}),O=p.useRef(null),k=p.useRef(null),S=i&&e!=="horizontal",C=!!u&&e!=="horizontal";p.useImperativeHandle(h,()=>O.current,[]),p.useEffect(()=>()=>{var T;(T=k.current)==null||T.abort()},[]);const E=p.useCallback(()=>{const T=O.current;if(!S||!T)return;const R=T.scrollHeight-T.clientHeight,A=R>1&&T.scrollTop>1,N=R>1&&R-T.scrollTop>1;x(P=>P.top===A&&P.bottom===N?P:{top:A,bottom:N})},[S]);p.useEffect(()=>{const T=O.current;if(!S||!T)return;const R=new ResizeObserver(E);R.observe(T);for(const A of T.children)R.observe(A);return E(),()=>R.disconnect()},[S,C,E]);async function j(){if(!u||!c||k.current)return;const T=new AbortController;k.current=T,b(!0),y(!1);try{await u(T.signal)}catch{T.signal.aborted||y(!0)}finally{T.signal.aborted||b(!1),k.current===T&&(k.current=null)}}return a.jsxs("div",{...m,ref:O,className:`studio-scroll-area ${s}`.trim(),"data-orientation":e,"data-hide-scrollbar":n||void 0,"data-fade-edges":S&&(w.top||w.bottom)||void 0,"data-fade-top":S&&w.top||void 0,"data-fade-bottom":S&&w.bottom||void 0,style:{maxHeight:t,...o},onScroll:T=>{f==null||f(T),E();const R=T.currentTarget;!T.defaultPrevented&&e!=="horizontal"&&!v&&R.scrollTop>0&&R.scrollHeight-R.clientHeight-R.scrollTop<=Math.max(0,d)&&j()},children:[a.jsx("div",{className:`studio-scroll-area__content ${r}`.trim(),"aria-busy":u?g:void 0,children:l}),u&&e!=="horizontal"&&a.jsx(a.Fragment,{children:a.jsxs("div",{className:"studio-scroll-area__footer",children:[g?a.jsx(u0,{size:24}):a.jsx("span",{role:"status","aria-live":"polite",children:v?"加载失败":c?"向下滚动加载更多":"已加载全部"}),!g&&c&&a.jsx("button",{type:"button",onClick:()=>void j(),children:v?"重试":"加载更多"})]})})]})}function Nst(){const{add:e,close:t}=kje();return{add:p.useCallback(({id:i,title:r,description:s,variant:o="info",duration:l,action:c,closeLabel:u,onClose:d})=>e({id:i,title:r,description:s,timeout:l,priority:"low",onClose:d,data:{variant:o,action:c,closeLabel:u}}),[e]),dismiss:t}}function Rst({position:e,label:t}){const{toasts:n,close:i}=kje();return a.jsx(irt,{children:a.jsx(_it,{className:"studio-toast-viewport","data-position":e,"data-empty":n.length===0||void 0,"aria-label":t,render:a.jsx(yf,{contentClassName:"studio-toast-viewport__stack"}),children:n.map(r=>{var s,o,l;return a.jsx(qit,{toast:r,className:"studio-toast-root",swipeDirection:[],children:a.jsx(snt,{role:"presentation",variant:(s=r.data)==null?void 0:s.variant,title:r.title!=null?a.jsx(Xit,{render:a.jsx("div",{}),children:r.title}):void 0,description:r.description!=null?a.jsx(Git,{render:a.jsx("div",{}),children:r.description}):void 0,action:(o=r.data)==null?void 0:o.action,closeLabel:(l=r.data)==null?void 0:l.closeLabel,onDismiss:()=>i(r.id)})},r.id)})})})}function Ist({children:e,duration:t=4e3,position:n="top-center",label:i="通知"}){return a.jsxs(fit,{timeout:t,limit:3,children:[e,a.jsx(Rst,{position:n,label:i})]})}function Pst({ownerId:e,sessionId:t,onOpen:n,hideNotices:i,refreshKey:r,onUpdate:s}){const{t:o}=Te("sandbox"),l=Nst(),c=p.useRef(new Map),u=p.useRef(new Map),d=p.useRef(null),f=p.useRef({sessionId:t,onOpen:n,toast:l,t:o,hideNotices:i,onUpdate:s});return f.current={sessionId:t,onOpen:n,toast:l,t:o,hideNotices:i,onUpdate:s},p.useEffect(()=>{if(i){f.current.toast.dismiss(),u.current.clear();return}for(const h of c.current.values())h.sessionId===t&&(f.current.toast.dismiss(h.runId),u.current.delete(h.runId))},[t,i]),p.useEffect(()=>{var h;(h=d.current)==null||h.call(d)},[r]),p.useEffect(()=>{if(!e)return;const h=new AbortController,m=c.current,g=u.current,b=new Set;let v,y=!1,w=[],x="";const O=(C,E=x)=>{var j,T;x=E,h.signal.aborted||(T=(j=f.current).onUpdate)==null||T.call(j,{ownerId:e,runs:w,loading:C,error:E})},k=C=>{const{toast:E,t:j,sessionId:T,onOpen:R}=f.current;if(!h.signal.aborted){if(f.current.hideNotices||C.sessionId===T){E.dismiss(C.runId),g.delete(C.runId);return}b.has(C.runId)||g.get(C.runId)===C.state||(g.set(C.runId,C.state),E.add({id:C.runId,duration:0,title:j(`taskNotice.${C.state}`),description:C.message.slice(0,80),variant:C.state==="succeeded"?"success":C.state==="failed"?"error":"info",closeLabel:j("taskNotice.hide"),onClose:()=>b.add(C.runId),action:a.jsx(Wi,{variant:"secondary",onClick:()=>{R(C.sessionId,h.signal).catch(A=>{h.signal.aborted||E.add({id:"task-open-error",variant:"error",description:A instanceof Error?A.message:String(A)})})},children:j("taskNotice.open")})}))}},S=async(C=!1)=>{if(!(y||h.signal.aborted)){clearTimeout(v),y=!0,C&&O(!0);try{const E=await Jd.active(h.signal);if(h.signal.aborted)return;w=E,O(!1,"");const j=new Set(E.map(T=>T.runId));for(const T of m.values())if(!j.has(T.runId)&&!pu(T)){let R;try{R=await Jd.get(T.runId,h.signal)}catch(A){if(A instanceof Kw&&A.status===404){m.delete(T.runId),g.delete(T.runId),f.current.toast.dismiss(T.runId);continue}throw A}if(h.signal.aborted)return;m.set(R.runId,R),k(R)}for(const T of E)m.set(T.runId,T),k(T);f.current.toast.dismiss("task-connection")}catch(E){if(h.signal.aborted)return;E instanceof Kw&&[401,403].includes(E.status)&&(w=[],m.clear(),g.clear(),f.current.toast.dismiss()),O(!1,E instanceof Error?E.message:f.current.t("taskNotice.reconnecting")),!h.signal.aborted&&m.size&&!f.current.hideNotices&&f.current.toast.add({id:"task-connection",duration:0,description:f.current.t("taskNotice.reconnecting")})}finally{y=!1,h.signal.aborted||(v=setTimeout(S,3e3))}}};return d.current=()=>{S(!0)},O(!0),S(),()=>{h.abort(),clearTimeout(v),d.current=null,f.current.toast.dismiss()}},[e]),null}function Dst(e){const{t}=Te("sandbox");return a.jsx(Ist,{position:"bottom-right",label:t("taskNotice.label"),children:a.jsx(Pst,{...e},e.ownerId)})}const uC=["super_admin","admin","developer","user"];class dC extends Error{constructor(t,n){super(t),this.code=t,this.status=n}}async function Sje(e){let t;try{t=await e.json()}catch{throw new dC("invalid_response",e.status)}if(!e.ok){const n=t&&typeof t=="object"&&"code"in t&&typeof t.code=="string"?t.code:"request_failed";throw new dC(n,e.status)}return t}function Eje(e){return!e||typeof e!="object"?!1:"id"in e&&typeof e.id=="string"&&"name"in e&&typeof e.name=="string"&&"email"in e&&typeof e.email=="string"&&"role"in e&&uC.some(t=>t===e.role)&&"status"in e&&typeof e.status=="string"&&"lastLogin"in e&&typeof e.lastLogin=="string"&&"protected"in e&&typeof e.protected=="boolean"&&"currentUser"in e&&typeof e.currentUser=="boolean"&&"roleConflict"in e&&typeof e.roleConflict=="boolean"}async function Mst(e){const t=new URLSearchParams({page:String(e.page),pageSize:"20",query:e.query});e.role&&t.set("role",e.role);const n=await Sje(await yn(`/web/users?${t}`,{signal:e.signal,cache:"no-store"}));if(!n||typeof n!="object"||!("items"in n)||!Array.isArray(n.items)||!n.items.every(Eje)||!("total"in n)||typeof n.total!="number"||!("poolTotal"in n)||typeof n.poolTotal!="number"||!("page"in n)||typeof n.page!="number"||!("pageSize"in n)||typeof n.pageSize!="number"||!("userPoolId"in n)||typeof n.userPoolId!="string"||!("clientId"in n)||typeof n.clientId!="string"||!("provider"in n)||!["volcengine","byteplus"].includes(String(n.provider)))throw new dC("invalid_response",502);return n}async function Lst(e,t,n){const i=await Sje(await yn(`/web/users/${encodeURIComponent(e.id)}/role`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({role:t,expectedRole:e.role}),signal:n}));if(!i||typeof i!="object"||!("user"in i)||!Eje(i.user))throw new dC("invalid_response",502);return i.user}function $st(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m7 9.5 5 5 5-5"})})}function Fst(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m6.5 12.5 3.5 3.5 7.5-8"})})}function vf({ariaLabel:e,value:t,valueLabel:n,placeholder:i,options:r,disabled:s=!1,searchValue:o,searchPlaceholder:l,loading:c=!1,hasMore:u=!1,emptyMessage:d,onSearchChange:f,onLoadMore:h,onChange:m}){const{t:g}=Te("ui"),b=l??g("deploymentSelect.searchPlaceholder"),v=d??g("deploymentSelect.emptyMessage"),y=p.useId(),w=p.useRef(null),x=p.useRef(null),O=p.useRef(null),k=p.useRef(null),S=p.useRef([]),[C,E]=p.useState(!1),[j,T]=p.useState(0),R=r.find(L=>L.value===t),A=(R==null?void 0:R.label)??(t?n:void 0),N=o!==void 0&&!!f,P=()=>{E(!1),N&&o&&(f==null||f(""))};p.useEffect(()=>{if(!C)return;const L=F=>{F.target instanceof Node&&w.current&&!w.current.contains(F.target)&&P()};return window.addEventListener("pointerdown",L),()=>window.removeEventListener("pointerdown",L)},[C,f,o,N]),p.useEffect(()=>{var L,F;if(C){if(N){(L=O.current)==null||L.focus();return}(F=S.current[j])==null||F.focus()}},[C,N]),p.useEffect(()=>{var L;!C||N&&document.activeElement===O.current||(L=S.current[j])==null||L.focus()},[j,C,N]),p.useEffect(()=>{T(L=>Math.min(L,Math.max(0,r.length-1)))},[r.length]),p.useEffect(()=>{if(!C||!u||c||!h)return;const L=window.requestAnimationFrame(()=>{const F=k.current;F&&F.scrollHeight<=F.clientHeight+1&&h()});return()=>window.cancelAnimationFrame(L)},[u,c,h,C,r.length]);const I=(L=1)=>{const F=r.findIndex(V=>V.value===t),M=F>=0?F:L===1?0:Math.max(0,r.length-1);T(M),E(!0)},D=L=>{r.length!==0&&T((L+r.length)%r.length)},_=L=>{var F;m(L.value),P(),(F=x.current)==null||F.focus()};return a.jsxs("div",{className:"pp-deployment-select",ref:w,onKeyDown:L=>{var M,V;const F=L.target===O.current;if(L.key==="Escape"&&C){L.preventDefault(),P(),(M=x.current)==null||M.focus();return}if(L.key==="Tab"){P();return}if(F){L.key==="ArrowDown"&&r.length>0&&(L.preventDefault(),T(0),(V=S.current[0])==null||V.focus());return}L.key==="ArrowDown"?(L.preventDefault(),C?D(j+1):I(1)):L.key==="ArrowUp"?(L.preventDefault(),C?D(j-1):I(-1)):C&&L.key==="Home"?(L.preventDefault(),T(0)):C&&L.key==="End"&&(L.preventDefault(),T(Math.max(0,r.length-1)))},children:[a.jsxs("button",{ref:x,type:"button",className:"pp-deployment-select-trigger","aria-label":e,"aria-haspopup":"listbox","aria-expanded":C,"aria-controls":C?y:void 0,disabled:s,onClick:()=>{C?P():I()},children:[a.jsx("span",{className:A?void 0:"is-placeholder",children:A??i}),a.jsx($st,{className:`pp-deployment-select-chevron${C?" is-open":""}`})]}),C&&a.jsxs("div",{className:"pp-deployment-select-menu",children:[N&&a.jsx("div",{className:"pp-deployment-select-search",children:a.jsx("input",{ref:O,type:"search",value:o,"aria-label":g("deploymentSelect.searchAriaLabel",{label:e}),placeholder:b,autoComplete:"off",onChange:L=>f==null?void 0:f(L.currentTarget.value)})}),a.jsx("div",{id:y,ref:k,className:"pp-deployment-select-options",role:"listbox","aria-label":e,"aria-busy":c||void 0,onScroll:L=>{if(!u||c||!h)return;const F=L.currentTarget;F.scrollHeight-F.scrollTop-F.clientHeight<=24&&h()},children:r.map((L,F)=>{const M=L.value===t;return a.jsxs("button",{ref:V=>{S.current[F]=V},type:"button",role:"option","aria-selected":M,tabIndex:F===j?0:-1,className:`pp-deployment-select-option${M?" is-selected":""}`,title:L.metadata?[L.label,L.description,L.metadata].filter(Boolean).join(` +`):L.description,onFocus:()=>T(F),onClick:()=>_(L),children:[a.jsxs("span",{className:"pp-deployment-select-copy",children:[a.jsxs("span",{className:"pp-deployment-select-name",children:[L.label,L.badge&&a.jsx("span",{className:"pp-deployment-select-badge",children:L.badge})]}),L.description&&a.jsx("small",{className:L.metadata?"pp-deployment-select-description":void 0,children:L.description}),L.metadata&&a.jsx("small",{className:"pp-deployment-select-metadata",children:L.metadata})]}),M&&a.jsx(Fst,{})]},L.value)})}),c&&a.jsx("div",{className:"pp-deployment-select-state","aria-live":"polite",children:g("deploymentSelect.loadingMore")}),!c&&r.length===0&&a.jsx("div",{className:"pp-deployment-select-state",children:v})]})]})}function ZD({label:e,onClick:t}){return a.jsx("button",{type:"button",className:"page-back-button","aria-label":e,title:e,onClick:t,children:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m14.5 6-6 6 6 6"})})})}function fn({as:e="span",className:t="",duration:n=4,spread:i=20,children:r,style:s,...o}){const l=Math.min(Math.max(i,5),45);return a.jsx(e,{className:`text-shimmer${t?` ${t}`:""}`,style:{...s,backgroundImage:`linear-gradient(to right, hsl(var(--muted-foreground)) ${50-l}%, hsl(var(--foreground)) 50%, hsl(var(--muted-foreground)) ${50+l}%)`,animationDuration:`${n}s`},...o,children:r})}function Bst(){return a.jsx("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M16 7a6.5 6.5 0 1 0 .2 5M16 3.5V7h-3.5"})})}function Cje(e){return e instanceof dC?e.code:"request_failed"}function Ust({user:e,onClose:t,onSaved:n}){const{t:i,i18n:r}=Te("users"),s=p.useRef(null),o=p.useRef(null),l=p.useId(),c=p.useId(),[u,d]=p.useState(e.role),[f,h]=p.useState(!1),[m,g]=p.useState("");p.useEffect(()=>{const v=s.current,y=document.activeElement;return v==null||v.showModal(),()=>{var w;(w=o.current)==null||w.abort(),v==null||v.close(),y instanceof HTMLElement&&y.isConnected&&y.focus()}},[]);const b=async()=>{if(f||u===e.role&&!e.roleConflict)return;const v=new AbortController;o.current=v,h(!0),g("");try{const y=await Lst(e,u,v.signal);v.signal.aborted||n(y)}catch(y){v.signal.aborted||g(i(`errors.${Cje(y)}`,{defaultValue:i("errors.request_failed")}))}finally{v.signal.aborted||h(!1)}};return a.jsxs("dialog",{ref:s,className:"user-role-dialog","aria-labelledby":l,"aria-describedby":c,"aria-busy":f,onCancel:v=>{v.preventDefault(),f||t()},children:[a.jsxs("header",{children:[a.jsx("h2",{id:l,children:i("changeRole")}),a.jsx("button",{type:"button",className:"users-close",onClick:t,disabled:f,"aria-label":i("close"),children:a.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:a.jsx("path",{d:"m5 5 10 10M15 5 5 15"})})})]}),a.jsxs("div",{className:"user-role-dialog-body",children:[a.jsxs("div",{className:"users-account",children:[a.jsx("strong",{children:e.name}),a.jsx("span",{children:e.email||e.id})]}),a.jsx("label",{className:"users-field-label",children:i("role")}),a.jsx(vf,{ariaLabel:i("role"),placeholder:i("role"),value:u,disabled:f,options:uC.map(v=>({value:v,label:i(`roles.${v}`),description:i(`descriptions.${v}`)})),onChange:v=>{const y=uC.find(w=>w===v);y&&d(y)}},r.resolvedLanguage),a.jsx("p",{id:c,className:"users-help",children:i("effectiveAfterRefresh")}),m?a.jsx("p",{className:"users-error",role:"alert",children:m}):null]}),a.jsxs("footer",{children:[a.jsx("button",{className:"users-button",type:"button",disabled:f,onClick:t,children:i("cancel")}),a.jsx("button",{className:"users-button is-primary",type:"button",disabled:f||u===e.role&&!e.roleConflict,onClick:()=>void b(),children:i(f?"saving":"save")})]})]})}function Qst({onBack:e}){const{t,i18n:n}=Te("users"),[i,r]=p.useState(null),[s,o]=p.useState(!0),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(""),[m,g]=p.useState(""),[b,v]=p.useState(1),[y,w]=p.useState(0),[x,O]=p.useState(null),[k,S]=p.useState(null),[C,E]=p.useState(null);p.useEffect(()=>{const A=new AbortController;return o(!0),c(""),Mst({page:b,query:f,role:m,signal:A.signal}).then(N=>{if(!A.signal.aborted){if(N.total>0&&N.items.length===0&&b>1){v(1);return}r(N),E(new Date)}}).catch(N=>{A.signal.aborted||c(Cje(N))}).finally(()=>{A.signal.aborted||o(!1)}),()=>A.abort()},[b,f,m,y]);const j=A=>{A.preventDefault(),h(u.trim()),v(1),w(N=>N+1)},T=A=>{if(!A)return t("neverLoggedIn");const N=Number(A),P=new Date(Number.isFinite(N)&&N>0?N<1e12?N*1e3:N:A);return Number.isNaN(P.getTime())?t("unknown"):P.toLocaleString(n.resolvedLanguage,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1})},R=Math.max(1,Math.ceil(((i==null?void 0:i.total)??0)/20));return a.jsxs("section",{className:"users-page","aria-labelledby":"users-title",children:[a.jsxs("header",{className:"users-page-header",children:[a.jsx(ZD,{label:t("back"),onClick:e}),a.jsx("h1",{id:"users-title",children:t("title")}),i?a.jsx("span",{className:"users-count",children:t("memberCount",{count:i.poolTotal})}):null]}),a.jsxs("div",{className:"users-content",children:[i?a.jsxs("div",{className:"users-pool",children:[a.jsx("span",{children:i.provider==="byteplus"?"BytePlus Identity":t("volcengineIdentity")}),a.jsxs("span",{className:"users-pool-id",title:i.userPoolId,children:[t("pool")," ",i.userPoolId]})]}):null,a.jsxs("div",{className:"users-toolbar",children:[a.jsxs("form",{className:"users-search",onSubmit:j,children:[a.jsx("input",{value:u,onChange:A=>d(A.target.value),onKeyDown:A=>{A.key==="Enter"&&(A.nativeEvent.isComposing||A.keyCode===229)&&A.preventDefault()},"aria-label":t("searchPlaceholder"),placeholder:t("searchPlaceholder"),maxLength:200}),a.jsx("button",{type:"submit",className:"users-button",disabled:s,children:t("search")})]}),a.jsx("div",{className:"users-role-filter",children:a.jsx(vf,{ariaLabel:t("filterRole"),placeholder:t("allRoles"),value:m,options:[{value:"",label:t("allRoles")},...uC.map(A=>({value:A,label:t(`roles.${A}`)}))],onChange:A=>{const N=uC.find(P=>P===A);g(N??""),v(1)}})}),a.jsxs("button",{type:"button",className:"users-button users-refresh",disabled:s,onClick:()=>{S(null),w(A=>A+1)},children:[a.jsx(Bst,{}),a.jsx("span",{children:t("refresh")})]})]}),a.jsx("div",{className:"users-feedback","aria-live":"polite",children:s?a.jsx(fn,{children:t("loading")}):k?a.jsx("span",{children:t("saved",{name:k.name,role:t(`roles.${k.role}`)})}):C?a.jsx("span",{children:t("updatedAt",{time:C.toLocaleTimeString(n.resolvedLanguage,{hour:"2-digit",minute:"2-digit",hour12:!1})})}):null}),l?a.jsxs("div",{className:"users-error users-error-banner",role:"alert",children:[a.jsx("span",{children:t(`errors.${l}`,{defaultValue:t("errors.request_failed")})}),a.jsx("button",{type:"button",className:"users-button",onClick:()=>w(A=>A+1),children:t("retry")})]}):null,a.jsxs("div",{className:"users-table-wrap","aria-busy":s,children:[a.jsxs("table",{className:"users-table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:t("user")}),a.jsx("th",{scope:"col",children:t("role")}),a.jsx("th",{scope:"col",children:t("status")}),a.jsx("th",{scope:"col",children:t("lastLogin")}),a.jsx("th",{scope:"col",children:a.jsx("span",{className:"sr-only",children:t("actions")})})]})}),a.jsx("tbody",{children:i==null?void 0:i.items.map(A=>{var N;return a.jsxs("tr",{children:[a.jsx("td",{"data-label":t("user"),children:a.jsxs("div",{className:"users-person",children:[a.jsx("span",{className:"users-avatar","aria-hidden":"true",children:(N=Array.from(A.name)[0])==null?void 0:N.toUpperCase()}),a.jsxs("div",{className:"users-account",children:[a.jsxs("strong",{children:[A.name,A.currentUser?a.jsx("span",{className:"users-self",children:t("you")}):null]}),a.jsx("span",{title:A.email||A.id,children:A.email||A.id})]})]})}),a.jsxs("td",{"data-label":t("role"),children:[a.jsx("span",{className:`users-role-badge${A.role==="super_admin"?" is-super":""}`,children:t(`roles.${A.role}`)}),A.roleConflict?a.jsx("span",{className:"users-inline-warning",children:t("roleConflict")}):null]}),a.jsx("td",{"data-label":t("status"),children:a.jsx("span",{className:"users-status",children:t(`states.${A.status}`,{defaultValue:t("unknown")})})}),a.jsx("td",{"data-label":t("lastLogin"),className:"users-last-login",children:T(A.lastLogin)}),a.jsx("td",{className:"users-actions",children:A.protected?a.jsx("span",{className:"users-protected",title:t("protectedExplanation"),children:t("initialAdministrator")}):a.jsx("button",{type:"button",className:"users-button is-text",disabled:s||!!l||A.currentUser,onClick:()=>{S(null),O(A)},children:t("changeRole")})})]},A.id)})})]}),!s&&!l&&(i==null?void 0:i.items.length)===0?a.jsxs("div",{className:"users-empty",children:[a.jsx("strong",{children:t("noUsers")}),a.jsx("span",{children:t(f||m?"tryAnotherSearch":"poolEmpty")})]}):null,s&&!i?a.jsx("div",{className:"users-empty",children:a.jsx(fn,{children:t("loading")})}):null]}),i?a.jsxs("footer",{className:"users-pagination",children:[a.jsx("span",{children:t("resultCount",{count:i.total})}),a.jsxs("div",{children:[a.jsx("button",{type:"button",className:"users-button",disabled:b<=1||s,onClick:()=>v(A=>A-1),children:t("previous")}),a.jsxs("span",{children:[b," / ",R]}),a.jsx("button",{type:"button",className:"users-button",disabled:b>=R||s,onClick:()=>v(A=>A+1),children:t("next")})]})]}):null]}),x?a.jsx(Ust,{user:x,onClose:()=>O(null),onSaved:A=>{O(null),S(A),w(N=>N+1)}}):null]})}const Aje=p.createContext(null);function zst(e){if(!e||/[?#]/.test(e))return null;try{const t=decodeURIComponent(e);return!/^\/data\/(output|workspace)\/.+/.test(t)||t.endsWith("/")||/[\\\u0000-\u001f\u007f]/.test(t)||t.split("/").some(n=>n==="."||n==="..")?null:t}catch{return null}}function Vst({appName:e,sessionId:t,path:n,children:i}){const{t:r}=Te("conversation"),s=p.useRef(null),[o,l]=p.useState(!1),[c,u]=p.useState(!1);p.useEffect(()=>(l(!1),u(!1),()=>{var f;(f=s.current)==null||f.abort(),s.current=null}),[e,t,n]);async function d(){if(s.current)return;const f=new AbortController;s.current=f,l(!0),u(!1);try{const h=await cTe(e,t,n,f.signal);if(f.signal.aborted)return;const m=URL.createObjectURL(h),g=document.createElement("a");try{g.href=m,g.download=n.slice(n.lastIndexOf("/")+1),document.body.appendChild(g),g.click()}finally{g.remove(),window.setTimeout(()=>URL.revokeObjectURL(m),0)}}catch{f.signal.aborted||u(!0)}finally{s.current===f&&(s.current=null,l(!1))}}return a.jsxs(a.Fragment,{children:[a.jsxs("a",{className:"sandbox-file-download",href:encodeURI(n),"aria-disabled":o,"aria-busy":o,onClick:f=>{f.preventDefault(),d()},children:[a.jsx("span",{"aria-hidden":"true",children:"↓"}),a.jsxs("span",{children:[r(o?"markdown.downloading":"markdown.downloadFile")," · ",i]})]}),c&&a.jsxs("span",{role:"alert",children:[" ",r("markdown.downloadFailed")]})]})}const Hst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M5.293 12.707a1 1 0 0 1 0-1.414l5-5a1 1 0 1 1 1.414 1.414L8.414 11H18a1 1 0 1 1 0 2H8.414l3.293 3.293a1 1 0 0 1-1.414 1.414l-5-5Z",clipRule:"evenodd"})}),qst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M18.707 12.707a1 1 0 0 0 0-1.414l-5-5a1 1 0 1 0-1.414 1.414L15.586 11H6a1 1 0 1 0 0 2h9.586l-3.293 3.293a1 1 0 0 0 1.414 1.414l5-5Z",clipRule:"evenodd"})}),Wst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M4.47192 2.5C5.02421 2.5 5.47192 2.94772 5.47192 3.5V5.07196C7.17065 3.47759 9.45675 2.5 11.9719 2.5C17.2186 2.5 21.4719 6.75329 21.4719 12C21.4719 17.2467 17.2186 21.5 11.9719 21.5C7.10262 21.5 3.0902 17.8375 2.53692 13.1164C2.47264 12.5679 2.8652 12.0711 3.41373 12.0068C3.96226 11.9425 4.45904 12.3351 4.52333 12.8836C4.95991 16.6089 8.12901 19.5 11.9719 19.5C16.1141 19.5 19.4719 16.1421 19.4719 12C19.4719 7.85786 16.1141 4.5 11.9719 4.5C9.75153 4.5 7.75552 5.46469 6.38146 7H9.00003C9.55232 7 10 7.44772 10 8C10 8.55228 9.55232 9 9.00003 9H4.47192C3.93256 9 3.49293 8.57299 3.47265 8.03859C3.47175 8.01771 3.47151 7.99677 3.47192 7.9758V3.5C3.47192 2.94772 3.91964 2.5 4.47192 2.5Z",fill:"currentColor"})}),JD=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M2.55823 12C2.55823 6.75329 6.81152 2.5 12.0582 2.5C14.5734 2.5 16.8595 3.47759 18.5582 5.07197V3.5C18.5582 2.94772 19.0059 2.5 19.5582 2.5C20.1105 2.5 20.5582 2.94772 20.5582 3.5V7.97591C20.5586 7.99622 20.5584 8.01651 20.5576 8.03674C20.5382 8.572 20.0982 9 19.5582 9H15.0582C14.5059 9 14.0582 8.55228 14.0582 8C14.0582 7.44772 14.5059 7 15.0582 7H17.6487C16.2746 5.46469 14.2786 4.5 12.0582 4.5C7.91609 4.5 4.55823 7.85786 4.55823 12C4.55823 16.1421 7.91609 19.5 12.0582 19.5C15.9011 19.5 19.0702 16.6089 19.5068 12.8836C19.5711 12.3351 20.0679 11.9425 20.6164 12.0068C21.165 12.0711 21.5575 12.5679 21.4932 13.1164C20.94 17.8375 16.9275 21.5 12.0582 21.5C6.81152 21.5 2.55823 17.2467 2.55823 12Z",fill:"currentColor"})}),s_=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M16.243 6.757a1 1 0 0 1 1 1v7.072a1 1 0 0 1-2 0v-4.657L8.464 16.95a1 1 0 0 1-1.414-1.414l6.778-6.779H9.172a1 1 0 0 1 0-2h7.07Z",clipRule:"evenodd"})}),Kst=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.jsx("path",{d:"M10.663 6.3872C10.8152 6.29068 11 6.40984 11 6.59007V8C11 8.55229 11.4477 9 12 9C12.5523 9 13 8.55229 13 8V6.59007C13 6.40984 13.1848 6.29068 13.337 6.3872C14.036 6.83047 14.5 7.61105 14.5 8.5C14.5 9.53284 13.8737 10.4194 12.9801 10.8006C12.9932 10.865 13 10.9317 13 11V13C13 13.5523 12.5523 14 12 14C11.4477 14 11 13.5523 11 13V11C11 10.9317 11.0068 10.865 11.0199 10.8006C10.1263 10.4194 9.5 9.53284 9.5 8.5C9.5 7.61105 9.96397 6.83047 10.663 6.3872Z",fill:"currentColor"}),a.jsx("path",{d:"M17.9754 4.01031C17.8588 4.00078 17.6965 4.00001 17.4 4.00001H9.8C8.94342 4.00001 8.36113 4.00078 7.91104 4.03756C7.47262 4.07338 7.24842 4.1383 7.09202 4.21799C6.7157 4.40974 6.40973 4.7157 6.21799 5.09202C6.1383 5.24842 6.07337 5.47263 6.03755 5.91104C6.00078 6.36113 6 6.94343 6 7.80001V16.1707C6.31278 16.0602 6.64937 16 7 16H18L18 4.60001C18 4.30348 17.9992 4.14122 17.9897 4.02464C17.9893 4.02 17.9889 4.0156 17.9886 4.01145C17.9844 4.01107 17.98 4.01069 17.9754 4.01031ZM17.657 18H7C6.44772 18 6 18.4477 6 19C6 19.5523 6.44772 20 7 20H17.657C17.5343 19.3301 17.5343 18.6699 17.657 18ZM4 19L4 7.75871C3.99999 6.95374 3.99998 6.28937 4.04419 5.74818C4.09012 5.18608 4.18868 4.66938 4.43597 4.18404C4.81947 3.43139 5.43139 2.81947 6.18404 2.43598C6.66937 2.18869 7.18608 2.09012 7.74818 2.0442C8.28937 1.99998 8.95373 1.99999 9.7587 2L17.4319 2C17.6843 1.99997 17.9301 1.99994 18.1382 2.01695C18.3668 2.03563 18.6366 2.07969 18.908 2.21799C19.2843 2.40974 19.5903 2.7157 19.782 3.09203C19.9203 3.36345 19.9644 3.63318 19.9831 3.86178C20.0001 4.06994 20 4.31574 20 4.56812L20 17C20 17.1325 19.9736 17.2638 19.9225 17.386C19.4458 18.5253 19.4458 19.4747 19.9225 20.614C20.0517 20.9227 20.0179 21.2755 19.8325 21.5541C19.6471 21.8326 19.3346 22 19 22H7C5.34315 22 4 20.6569 4 19Z",fill:"currentColor"})]}),fC=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M18.063 5.674a1 1 0 0 1 .263 1.39l-7.5 11a1 1 0 0 1-1.533.143l-4.5-4.5a1 1 0 1 1 1.414-1.414l3.647 3.647 6.82-10.003a1 1 0 0 1 1.39-.263Z",clipRule:"evenodd"})}),Tje=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM16.0755 7.93219C16.5272 8.25003 16.6356 8.87383 16.3178 9.32549L11.5678 16.0755C11.3931 16.3237 11.1152 16.4792 10.8123 16.4981C10.5093 16.517 10.2142 16.3973 10.0101 16.1727L7.51006 13.4227C7.13855 13.014 7.16867 12.3816 7.57733 12.0101C7.98598 11.6386 8.61843 11.6687 8.98994 12.0773L10.6504 13.9039L14.6822 8.17451C15 7.72284 15.6238 7.61436 16.0755 7.93219Z",fill:"currentColor"})}),Gst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 16 9",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.292893 0.292893C0.683418 -0.0976311 1.31658 -0.0976311 1.70711 0.292893L8 6.58579L14.2929 0.292894C14.6834 -0.0976305 15.3166 -0.0976304 15.7071 0.292894C16.0976 0.683418 16.0976 1.31658 15.7071 1.70711L8.70711 8.70711C8.31658 9.09763 7.68342 9.09763 7.29289 8.70711L0.292893 1.70711C-0.0976311 1.31658 -0.0976311 0.683417 0.292893 0.292893Z"})}),Xst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M15.707 4.293a1 1 0 0 1 0 1.414L9.414 12l6.293 6.293a1 1 0 0 1-1.414 1.414l-7-7a1 1 0 0 1 0-1.414l7-7a1 1 0 0 1 1.414 0Z",clipRule:"evenodd"})}),Yst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M8.293 4.293a1 1 0 0 1 1.414 0l7 7a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414-1.414L14.586 12 8.293 5.707a1 1 0 0 1 0-1.414Z",clipRule:"evenodd"})}),hV=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM12 6C12.5523 6 13 6.44772 13 7V12C13 12.2652 12.8946 12.5196 12.7071 12.7071L10.2071 15.2071C9.81658 15.5976 9.18342 15.5976 8.79289 15.2071C8.40237 14.8166 8.40237 14.1834 8.79289 13.7929L11 11.5858V7C11 6.44772 11.4477 6 12 6Z",fill:"currentColor"})}),Zst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M12.659 9.753a1 1 0 0 1-1.318 0l-4-3.5A1 1 0 1 1 8.66 4.747L12 7.671l3.341-2.924a1 1 0 1 1 1.318 1.506l-4 3.5Zm-4.002 9.501a1 1 0 1 1-1.314-1.508l4-3.485a1 1 0 0 1 1.314 0l4 3.485a1 1 0 1 1-1.314 1.508L12 16.34l-3.343 2.913Z"})}),_je=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M12.7587 2H16.2413C17.0463 1.99999 17.7106 1.99998 18.2518 2.04419C18.8139 2.09012 19.3306 2.18868 19.816 2.43597C20.5686 2.81947 21.1805 3.43139 21.564 4.18404C21.8113 4.66937 21.9099 5.18608 21.9558 5.74817C22 6.28936 22 6.95372 22 7.75868V11.2413C22 12.0463 22 12.7106 21.9558 13.2518C21.9099 13.8139 21.8113 14.3306 21.564 14.816C21.1805 15.5686 20.5686 16.1805 19.816 16.564C19.3306 16.8113 18.8139 16.9099 18.2518 16.9558C17.8906 16.9853 17.4745 16.9951 16.9984 16.9984C16.9951 17.4745 16.9853 17.8906 16.9558 18.2518C16.9099 18.8139 16.8113 19.3306 16.564 19.816C16.1805 20.5686 15.5686 21.1805 14.816 21.564C14.3306 21.8113 13.8139 21.9099 13.2518 21.9558C12.7106 22 12.0463 22 11.2413 22H7.75868C6.95372 22 6.28936 22 5.74818 21.9558C5.18608 21.9099 4.66937 21.8113 4.18404 21.564C3.43139 21.1805 2.81947 20.5686 2.43597 19.816C2.18868 19.3306 2.09012 18.8139 2.04419 18.2518C1.99998 17.7106 1.99999 17.0463 2 16.2413V12.7587C1.99999 11.9537 1.99998 11.2894 2.04419 10.7482C2.09012 10.1861 2.18868 9.66937 2.43597 9.18404C2.81947 8.43139 3.43139 7.81947 4.18404 7.43598C4.66937 7.18868 5.18608 7.09012 5.74817 7.04419C6.10939 7.01468 6.52548 7.00487 7.00162 7.00162C7.00487 6.52548 7.01468 6.10939 7.04419 5.74817C7.09012 5.18608 7.18868 4.66937 7.43598 4.18404C7.81947 3.43139 8.43139 2.81947 9.18404 2.43597C9.66937 2.18868 10.1861 2.09012 10.7482 2.04419C11.2894 1.99998 11.9537 1.99999 12.7587 2ZM9.00176 7L11.2413 7C12.0463 6.99999 12.7106 6.99998 13.2518 7.04419C13.8139 7.09012 14.3306 7.18868 14.816 7.43598C15.5686 7.81947 16.1805 8.43139 16.564 9.18404C16.8113 9.66937 16.9099 10.1861 16.9558 10.7482C17 11.2894 17 11.9537 17 12.7587V14.9982C17.4455 14.9951 17.7954 14.9864 18.089 14.9624C18.5274 14.9266 18.7516 14.8617 18.908 14.782C19.2843 14.5903 19.5903 14.2843 19.782 13.908C19.8617 13.7516 19.9266 13.5274 19.9624 13.089C19.9992 12.6389 20 12.0566 20 11.2V7.8C20 6.94342 19.9992 6.36113 19.9624 5.91104C19.9266 5.47262 19.8617 5.24842 19.782 5.09202C19.5903 4.7157 19.2843 4.40973 18.908 4.21799C18.7516 4.1383 18.5274 4.07337 18.089 4.03755C17.6389 4.00078 17.0566 4 16.2 4H12.8C11.9434 4 11.3611 4.00078 10.911 4.03755C10.4726 4.07337 10.2484 4.1383 10.092 4.21799C9.7157 4.40973 9.40973 4.7157 9.21799 5.09202C9.1383 5.24842 9.07337 5.47262 9.03755 5.91104C9.01357 6.20463 9.00489 6.55447 9.00176 7ZM5.91104 9.03755C5.47262 9.07337 5.24842 9.1383 5.09202 9.21799C4.7157 9.40973 4.40973 9.7157 4.21799 10.092C4.1383 10.2484 4.07337 10.4726 4.03755 10.911C4.00078 11.3611 4 11.9434 4 12.8V16.2C4 17.0566 4.00078 17.6389 4.03755 18.089C4.07337 18.5274 4.1383 18.7516 4.21799 18.908C4.40973 19.2843 4.7157 19.5903 5.09202 19.782C5.24842 19.8617 5.47262 19.9266 5.91104 19.9624C6.36113 19.9992 6.94342 20 7.8 20H11.2C12.0566 20 12.6389 19.9992 13.089 19.9624C13.5274 19.9266 13.7516 19.8617 13.908 19.782C14.2843 19.5903 14.5903 19.2843 14.782 18.908C14.8617 18.7516 14.9266 18.5274 14.9624 18.089C14.9992 17.6389 15 17.0566 15 16.2V12.8C15 11.9434 14.9992 11.3611 14.9624 10.911C14.9266 10.4726 14.8617 10.2484 14.782 10.092C14.5903 9.7157 14.2843 9.40973 13.908 9.21799C13.7516 9.1383 13.5274 9.07337 13.089 9.03755C12.6389 9.00078 12.0566 9 11.2 9H7.8C6.94342 9 6.36113 9.00078 5.91104 9.03755Z",fill:"currentColor"})}),Jst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M10.556 4a1 1 0 0 0-.97.751l-.292 1.14h5.421l-.293-1.14A1 1 0 0 0 13.453 4h-2.897Zm6.224 1.892-.421-1.639A3 3 0 0 0 13.453 2h-2.897A3 3 0 0 0 7.65 4.253l-.421 1.639H4a1 1 0 1 0 0 2h.1l1.215 11.425A3 3 0 0 0 8.3 22h7.4a3 3 0 0 0 2.984-2.683l1.214-11.425H20a1 1 0 1 0 0-2h-3.22Zm1.108 2H6.112l1.192 11.214A1 1 0 0 0 8.3 20h7.4a1 1 0 0 0 .995-.894l1.192-11.214ZM10 10a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0v-5a1 1 0 0 1 1-1Zm4 0a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0v-5a1 1 0 0 1 1-1Z",clipRule:"evenodd"})}),eat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M3 12a2 2 0 1 1 4 0 2 2 0 0 1-4 0Zm7 0a2 2 0 1 1 4 0 2 2 0 0 1-4 0Zm7 0a2 2 0 1 1 4 0 2 2 0 0 1-4 0Z"})}),tat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 10 16",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.34151 0.747423C4.71854 0.417526 5.28149 0.417526 5.65852 0.747423L9.65852 4.24742C10.0742 4.61111 10.1163 5.24287 9.75259 5.6585C9.38891 6.07414 8.75715 6.11626 8.34151 5.75258L5.00001 2.82877L1.65852 5.75258C1.24288 6.11626 0.61112 6.07414 0.247438 5.6585C-0.116244 5.24287 -0.0741267 4.61111 0.34151 4.24742L4.34151 0.747423ZM0.246065 10.3578C0.608879 9.94139 1.24055 9.89795 1.65695 10.2608L5.00001 13.1737L8.34308 10.2608C8.75948 9.89795 9.39115 9.94139 9.75396 10.3578C10.1168 10.7742 10.0733 11.4058 9.65695 11.7687L5.65695 15.2539C5.28043 15.582 4.7196 15.582 4.34308 15.2539L0.343082 11.7687C-0.0733128 11.4058 -0.116749 10.7742 0.246065 10.3578Z"})}),nat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M16.793 2.793a3.121 3.121 0 1 1 4.414 4.414l-8.5 8.5A1 1 0 0 1 12 16H9a1 1 0 0 1-1-1v-3a1 1 0 0 1 .293-.707l8.5-8.5Zm3 1.414a1.121 1.121 0 0 0-1.586 0L10 12.414V14h1.586l8.207-8.207a1.121 1.121 0 0 0 0-1.586ZM6 5a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-4a1 1 0 1 1 2 0v4a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h4a1 1 0 1 1 0 2H6Z",clipRule:"evenodd"})}),iat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M12 7a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 1 1-2 0V8h-3a1 1 0 0 1-1-1Zm-5 5a1 1 0 0 1 1 1v3h3a1 1 0 1 1 0 2H7a1 1 0 0 1-1-1v-4a1 1 0 0 1 1-1Z",clipRule:"evenodd"})}),rat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8-10C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2Zm4.465 6.763a1 1 0 0 0-1.228-1.228l-5.5 1.5a1 1 0 0 0-.702.702l-1.5 5.5a1 1 0 0 0 1.228 1.228l5.5-1.5a1 1 0 0 0 .702-.702l1.5-5.5Zm-6.54 5.312.89-3.26 3.26-.89-.89 3.26-3.26.89Z",clipRule:"evenodd"})}),sat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M14.4472 7.10558C14.9412 7.35257 15.1414 7.95324 14.8944 8.44722L10.8944 16.4472C10.6474 16.9412 10.0468 17.1414 9.55279 16.8944C9.05881 16.6474 8.85858 16.0468 9.10557 15.5528L13.1056 7.55279C13.3526 7.05881 13.9532 6.85859 14.4472 7.10558ZM6.6 7.20001C7.04183 7.53138 7.13137 8.15818 6.8 8.60001L4.25 12L6.8 15.4C7.13137 15.8418 7.04183 16.4686 6.6 16.8C6.15817 17.1314 5.53137 17.0418 5.2 16.6L2.2 12.6C1.93333 12.2444 1.93333 11.7556 2.2 11.4L5.2 7.40001C5.53137 6.95818 6.15817 6.86863 6.6 7.20001ZM17.4 7.20001C17.8418 6.86863 18.4686 6.95818 18.8 7.40001L21.8 11.4C22.0667 11.7556 22.0667 12.2444 21.8 12.6L18.8 16.6C18.4686 17.0418 17.8418 17.1314 17.4 16.8C16.9582 16.4686 16.8686 15.8418 17.2 15.4L19.75 12L17.2 8.60001C16.8686 8.15818 16.9582 7.53138 17.4 7.20001Z",fill:"currentColor"})}),jje=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.jsx("path",{d:"M13 12a1 1 0 1 0-2 0v4a1 1 0 1 0 2 0v-4Zm-1-2.5A1.25 1.25 0 1 0 12 7a1.25 1.25 0 0 0 0 2.5Z"}),a.jsx("path",{fillRule:"evenodd",d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Z",clipRule:"evenodd"})]}),aat=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.jsx("path",{d:"M7.79289 9.04289C8.18342 8.65237 8.81658 8.65237 9.20711 9.04289L11.4571 11.2929C11.8476 11.6834 11.8476 12.3166 11.4571 12.7071L9.20711 14.9571C8.81658 15.3476 8.18342 15.3476 7.79289 14.9571C7.40237 14.5666 7.40237 13.9334 7.79289 13.5429L9.33579 12L7.79289 10.4571C7.40237 10.0666 7.40237 9.43342 7.79289 9.04289ZM12.25 14.25C12.25 13.6977 12.6977 13.25 13.25 13.25H15.5C16.0523 13.25 16.5 13.6977 16.5 14.25C16.5 14.8023 16.0523 15.25 15.5 15.25H13.25C12.6977 15.25 12.25 14.8023 12.25 14.25Z",fill:"currentColor"}),a.jsx("path",{d:"M2 8C2 5.79086 3.79086 4 6 4C6.55228 4 7 4.44772 7 5C7 5.55228 6.55228 6 6 6C4.89543 6 4 6.89543 4 8V16C4 17.1046 4.89543 18 6 18C6.55228 18 7 18.4477 7 19C7 19.5523 6.55228 20 6 20C3.79086 20 2 18.2091 2 16V8ZM17 5C17 4.44772 17.4477 4 18 4C20.2091 4 22 5.79086 22 8V16C22 18.2091 20.2091 20 18 20C17.4477 20 17 19.5523 17 19C17 18.4477 17.4477 18 18 18C19.1046 18 20 17.1046 20 16V8C20 6.89543 19.1046 6 18 6C17.4477 6 17 5.55228 17 5Z",fill:"currentColor"})]}),oat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M6 12C6 11.4477 6.44772 11 7 11H17C17.5523 11 18 11.4477 18 12C18 12.5523 17.5523 13 17 13H7C6.44772 13 6 12.5523 6 12Z",fill:"currentColor"})}),lat=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.jsx("path",{d:"M12.75 9.50001C12.75 9.08579 13.0858 8.75001 13.5 8.75001H14.5C14.9142 8.75001 15.25 9.08579 15.25 9.50001V14.5C15.25 14.9142 14.9142 15.25 14.5 15.25H13.5C13.0858 15.25 12.75 14.9142 12.75 14.5V9.50001Z",fill:"currentColor"}),a.jsx("path",{d:"M9.50001 8.75001C9.08579 8.75001 8.75001 9.08579 8.75001 9.50001V14.5C8.75001 14.9142 9.08579 15.25 9.50001 15.25H10.5C10.9142 15.25 11.25 14.9142 11.25 14.5V9.50001C11.25 9.08579 10.9142 8.75001 10.5 8.75001H9.50001Z",fill:"currentColor"}),a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.97144 12C1.97144 6.46138 6.46138 1.97144 12 1.97144C17.5386 1.97144 22.0286 6.46138 22.0286 12C22.0286 17.5386 17.5386 22.0286 12 22.0286C6.46138 22.0286 1.97144 17.5386 1.97144 12ZM12 4.02858C7.59751 4.02858 4.02858 7.59751 4.02858 12C4.02858 16.4025 7.59751 19.9714 12 19.9714C16.4025 19.9714 19.9714 16.4025 19.9714 12C19.9714 7.59751 16.4025 4.02858 12 4.02858Z",fill:"currentColor"})]}),WJ=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.jsx("path",{d:"M9.5 9.33165V14.6683C9.5 15.4595 10.3752 15.9373 11.0408 15.5095L15.1915 12.8412C15.8038 12.4475 15.8038 11.5524 15.1915 11.1588L11.0408 8.49047C10.3752 8.06265 9.5 8.54049 9.5 9.33165Z",fill:"currentColor"}),a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12Z",fill:"currentColor"})]}),cat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M8 16.7229V7.27711C8 6.29075 9.08894 5.69298 9.9211 6.22254L17.3428 10.9454C18.1147 11.4366 18.1147 12.5634 17.3428 13.0546L9.92109 17.7775C9.08894 18.3071 8 17.7093 8 16.7229Z",fill:"currentColor"})}),Nje=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M12 5a1 1 0 0 1 1 1v5h5a1 1 0 1 1 0 2h-5v5a1 1 0 1 1-2 0v-5H6a1 1 0 1 1 0-2h5V6a1 1 0 0 1 1-1Z",clipRule:"evenodd"})}),Rje=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M12 3C12.5523 3 13 3.44772 13 4L13 11H20C20.5523 11 21 11.4477 21 12C21 12.5523 20.5523 13 20 13L13 13L13 20C13 20.5523 12.5523 21 12 21C11.4477 21 11 20.5523 11 20L11 13L4 13C3.44772 13 3 12.5523 3 12C3 11.4477 3.44772 11 4 11L11 11L11 4C11 3.44772 11.4477 3 12 3Z",fill:"currentColor"})}),uat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M12 6C12.5523 6 13 6.44772 13 7V11H17C17.5523 11 18 11.4477 18 12C18 12.5523 17.5523 13 17 13H13V17C13 17.5523 12.5523 18 12 18C11.4477 18 11 17.5523 11 17V13H7C6.44772 13 6 12.5523 6 12C6 11.4477 6.44772 11 7 11H11V7C11 6.44772 11.4477 6 12 6Z",fill:"currentColor"})}),dat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.875 4.5C7.35418 4.5 4.5 7.35418 4.5 10.875C4.5 14.3958 7.35418 17.25 10.875 17.25C14.3958 17.25 17.25 14.3958 17.25 10.875C17.25 7.35418 14.3958 4.5 10.875 4.5ZM2.5 10.875C2.5 6.24962 6.24962 2.5 10.875 2.5C15.5004 2.5 19.25 6.24962 19.25 10.875C19.25 12.8273 18.582 14.6236 17.462 16.0478L21.2071 19.7929C21.5976 20.1834 21.5976 20.8166 21.2071 21.2071C20.8166 21.5976 20.1834 21.5976 19.7929 21.2071L16.0478 17.462C14.6236 18.582 12.8273 19.25 10.875 19.25C6.24962 19.25 2.5 15.5004 2.5 10.875Z",fill:"currentColor"})}),fat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M11.2929 3.29289C11.6834 2.90237 12.3166 2.90237 12.7071 3.29289L16.7071 7.29289C17.0976 7.68342 17.0976 8.31658 16.7071 8.70711C16.3166 9.09763 15.6834 9.09763 15.2929 8.70711L13 6.41421V15C13 15.5523 12.5523 16 12 16C11.4477 16 11 15.5523 11 15V6.41421L8.70711 8.70711C8.31658 9.09763 7.68342 9.09763 7.29289 8.70711C6.90237 8.31658 6.90237 7.68342 7.29289 7.29289L11.2929 3.29289ZM4 14C4.55229 14 5 14.4477 5 15V15.2C5 16.0566 5.00078 16.6389 5.03755 17.089C5.07337 17.5274 5.1383 17.7516 5.21799 17.908C5.40973 18.2843 5.7157 18.5903 6.09202 18.782C6.24842 18.8617 6.47262 18.9266 6.91104 18.9624C7.36113 18.9992 7.94342 19 8.8 19H15.2C16.0566 19 16.6389 18.9992 17.089 18.9624C17.5274 18.9266 17.7516 18.8617 17.908 18.782C18.2843 18.5903 18.5903 18.2843 18.782 17.908C18.8617 17.7516 18.9266 17.5274 18.9624 17.089C18.9992 16.6389 19 16.0566 19 15.2V15C19 14.4477 19.4477 14 20 14C20.5523 14 21 14.4477 21 15V15.2413C21 16.0463 21 16.7106 20.9558 17.2518C20.9099 17.8139 20.8113 18.3306 20.564 18.816C20.1805 19.5686 19.5686 20.1805 18.816 20.564C18.3306 20.8113 17.8139 20.9099 17.2518 20.9558C16.7106 21 16.0463 21 15.2413 21H8.75868C7.95372 21 7.28936 21 6.74817 20.9558C6.18608 20.9099 5.66937 20.8113 5.18404 20.564C4.43139 20.1805 3.81947 19.5686 3.43597 18.816C3.18868 18.3306 3.09012 17.8139 3.04419 17.2518C2.99998 16.7106 2.99999 16.0463 3 15.2413L3 15C3 14.4477 3.44772 14 4 14Z",fill:"currentColor"})}),hat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M6 8C6 6.89543 6.89543 6 8 6H16C17.1046 6 18 6.89543 18 8V16C18 17.1046 17.1046 18 16 18H8C6.89543 18 6 17.1046 6 16V8Z",fill:"currentColor"})}),pat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M14.5 4a5.5 5.5 0 0 0-5.078 7.616 1 1 0 0 1-.216 1.092l-4.749 4.75a1.475 1.475 0 0 0 2.086 2.085l4.749-4.749a1 1 0 0 1 1.092-.216A5.5 5.5 0 0 0 20 9.414l-1.293 1.293a3.828 3.828 0 1 1-5.414-5.414L14.585 4H14.5ZM7 9.5a7.5 7.5 0 0 1 9.969-7.084 1 1 0 0 1 .378 1.651l-2.64 2.64a1.829 1.829 0 0 0 2.586 2.586l2.64-2.64a1 1 0 0 1 1.651.378 7.5 7.5 0 0 1-9.328 9.627l-4.299 4.3a3.475 3.475 0 0 1-4.914-4.915l4.299-4.299A7.497 7.497 0 0 1 7 9.5Z"})}),mN=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M8.99805 16.796C8.99805 15.4164 7.87961 14.2979 6.5 14.2979C5.12039 14.2979 4.00195 15.4164 4.00195 16.796C4.00196 18.1756 5.1204 19.294 6.5 19.294C7.8796 19.294 8.99804 18.1756 8.99805 16.796ZM19.748 15.0479C19.748 14.7729 19.525 14.5499 19.25 14.5499H15.75C15.475 14.5499 15.252 14.7729 15.252 15.0479V18.5479C15.252 18.823 15.475 19.046 15.75 19.046H19.25C19.525 19.046 19.748 18.823 19.748 18.5479V15.0479ZM10.0469 3.45125C11.077 2.15921 13.0849 2.20276 14.0498 3.58113L16.4189 6.96492L16.5205 7.12215C17.5046 8.76341 16.3301 10.9023 14.3691 10.9024H9.63086C7.60676 10.9023 6.42029 8.62316 7.58105 6.96492L9.9502 3.58113L10.0469 3.45125ZM12.4082 4.73055C12.2223 4.46497 11.842 4.44826 11.6318 4.68074L11.5918 4.73055L9.22266 8.11433C8.99176 8.44435 9.22808 8.89744 9.63086 8.89754H14.3691C14.7468 8.89745 14.9774 8.49957 14.8145 8.17781L14.7773 8.11433L12.4082 4.73055ZM11.002 16.796C11.0019 19.2824 8.98638 21.2979 6.5 21.2979C4.01362 21.2979 1.99806 19.2824 1.99805 16.796C1.99805 14.3096 4.01361 12.294 6.5 12.294C8.98639 12.294 11.002 14.3096 11.002 16.796ZM21.752 18.5479C21.752 19.9297 20.6318 21.0499 19.25 21.0499H15.75C14.3682 21.0499 13.248 19.9297 13.248 18.5479V15.0479C13.2481 13.6662 14.3682 12.546 15.75 12.546H19.25C20.6318 12.546 21.7519 13.6662 21.752 15.0479V18.5479Z",fill:"currentColor"})}),mat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5555 4C10.099 4 9.70052 4.30906 9.58693 4.75114L9.29382 5.8919H14.715L14.4219 4.75114C14.3083 4.30906 13.9098 4 13.4533 4H10.5555ZM16.7799 5.8919L16.3589 4.25342C16.0182 2.92719 14.8226 2 13.4533 2H10.5555C9.18616 2 7.99062 2.92719 7.64985 4.25342L7.22886 5.8919H4C3.44772 5.8919 3 6.33961 3 6.8919C3 7.44418 3.44772 7.8919 4 7.8919H4.10069L5.31544 19.3172C5.47763 20.8427 6.76455 22 8.29863 22H15.7014C17.2354 22 18.5224 20.8427 18.6846 19.3172L19.8993 7.8919H20C20.5523 7.8919 21 7.44418 21 6.8919C21 6.33961 20.5523 5.8919 20 5.8919H16.7799ZM17.888 7.8919H6.11196L7.30423 19.1057C7.3583 19.6142 7.78727 20 8.29863 20H15.7014C16.2127 20 16.6417 19.6142 16.6958 19.1057L17.888 7.8919ZM10 10C10.5523 10 11 10.4477 11 11V16C11 16.5523 10.5523 17 10 17C9.44772 17 9 16.5523 9 16V11C9 10.4477 9.44772 10 10 10ZM14 10C14.5523 10 15 10.4477 15 11V16C15 16.5523 14.5523 17 14 17C13.4477 17 13 16.5523 13 16V11C13 10.4477 13.4477 10 14 10Z"})}),gat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M7.5 5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5ZM3 7.5a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0ZM17 6a2 2 0 1 0 0 4 2 2 0 0 0 0-4Zm-4 2a4 4 0 1 1 8 0 4 4 0 0 1-8 0Zm-8.96 8.247C3.137 17.048 2.5 18.271 2.5 20a1 1 0 1 1-2 0c0-2.271.862-4.049 2.21-5.248C4.042 13.57 5.788 13 7.5 13s3.459.57 4.79 1.752c1.348 1.2 2.21 2.977 2.21 5.248a1 1 0 1 1-2 0c0-1.729-.638-2.952-1.54-3.753C10.042 15.43 8.788 15 7.5 15s-2.541.43-3.46 1.247Zm15.757-.607c-1.009-.638-2.338-.807-3.526-.472a1 1 0 0 1-.542-1.925c1.695-.478 3.616-.255 5.136.706 1.558.984 2.635 2.707 2.635 5.051a1 1 0 1 1-2 0c0-1.665-.732-2.746-1.703-3.36Z",clipRule:"evenodd"})}),Ije=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.jsx("path",{d:"M10.42 2.006a4 4 0 0 1 3.159 0c.674.29 1.188.822 1.667 1.456.474.627 1 1.473 1.653 2.523l3.542 5.696c.72 1.16 1.3 2.09 1.682 2.854.384.766.654 1.517.59 2.292a4 4 0 0 1-1.604 2.886c-.625.463-1.405.63-2.258.709-.85.078-1.945.078-3.311.078H8.46c-1.366 0-2.46 0-3.31-.078-.854-.078-1.634-.246-2.26-.71a4 4 0 0 1-1.603-2.885c-.064-.775.206-1.526.59-2.292.383-.764.961-1.694 1.682-2.854l3.542-5.696c.653-1.05 1.18-1.896 1.653-2.523.48-.634.993-1.166 1.667-1.456Zm2.37 1.838a2 2 0 0 0-1.58 0c-.192.083-.448.28-.86.825-.413.544-.891 1.312-1.577 2.415l-3.488 5.61c-.755 1.214-1.283 2.066-1.62 2.737-.34.678-.402 1.02-.385 1.232a2 2 0 0 0 .802 1.443c.171.127.494.255 1.25.324.748.069 1.75.07 3.18.07h6.976c1.43 0 2.432-.001 3.18-.07.756-.069 1.079-.197 1.25-.324a2 2 0 0 0 .802-1.443c.017-.212-.045-.554-.385-1.232-.337-.671-.865-1.523-1.62-2.737l-3.488-5.61c-.686-1.103-1.164-1.87-1.576-2.415-.413-.546-.67-.742-.861-.825"}),a.jsx("path",{d:"M12 7.5a1 1 0 0 1 1 1v3a1 1 0 1 1-2 0v-3a1 1 0 0 1 1-1M10.851 15a1.15 1.15 0 1 1 2.3 0 1.15 1.15 0 0 1-2.3 0"})]}),pV=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M5.636 5.636a1 1 0 0 1 1.414 0l4.95 4.95 4.95-4.95a1 1 0 0 1 1.414 1.414L13.414 12l4.95 4.95a1 1 0 0 1-1.414 1.414L12 13.414l-4.95 4.95a1 1 0 0 1-1.414-1.414l4.95-4.95-4.95-4.95a1 1 0 0 1 0-1.414Z",clipRule:"evenodd"})});/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -173,7 +173,7 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const YS=An("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** + */const nE=An("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -203,7 +203,7 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Cf=An("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + */const Ef=An("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -218,12 +218,12 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const BA=An("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + */const HA=An("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const mN=An("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** + */const gN=An("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -248,7 +248,7 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const JD=An("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** + */const eM=An("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -263,12 +263,12 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const gN=An("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** + */const bN=An("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const eM=An("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** + */const tM=An("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -278,7 +278,7 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const d0=An("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** + */const p0=An("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -343,7 +343,7 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const tM=An("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** + */const nM=An("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -353,7 +353,7 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const gm=An("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** + */const pm=An("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -368,7 +368,7 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Bi=An("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** + */const Fi=An("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -383,7 +383,7 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ZS=An("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/** + */const iE=An("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -418,7 +418,7 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const sc=An("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + */const ic=An("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -438,7 +438,7 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const dI=An("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + */const fI=An("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -453,7 +453,7 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const lC=An("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** + */const hC=An("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -463,7 +463,7 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const eb=An("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** + */const Jg=An("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -478,12 +478,12 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Mo=An("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),XJ=Object.freeze({totalTokenCount:0,promptTokenCount:0,candidatesTokenCount:0,thoughtsTokenCount:0,cachedContentTokenCount:0}),JS=Object.freeze({modelName:"",current:XJ,cumulative:XJ}),Jat={totalTokenCount:"total_token_count",promptTokenCount:"prompt_token_count",candidatesTokenCount:"candidates_token_count",thoughtsTokenCount:"thoughts_token_count",cachedContentTokenCount:"cached_content_token_count"},eot=24,tot=64,not=16;function s_(e){var l,c;const t=e.trim();if(!t)return 0;const n=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/gu,i=((l=t.match(n))==null?void 0:l.length)??0,r=t.replace(n," "),s=(r.match(/[A-Za-z0-9_]+/g)??[]).reduce((u,d)=>u+Math.max(1,Math.ceil(d.length/4)),0),o=((c=r.match(/[^\sA-Za-z0-9_]/g))==null?void 0:c.length)??0;return i+s+o}function iot(e){var l,c,u;const t=((l=e.instruction)==null?void 0:l.trim())??"",n=((c=e.tools)==null?void 0:c.filter(d=>d.trim()))??[],i=((u=e.skills)==null?void 0:u.filter(d=>d.name.trim()))??[],r=s_(t),s=n.reduce((d,f)=>d+tot+s_(f),0),o=i.reduce((d,f)=>d+not+s_(f.name)+s_(f.description??""),0);return eot+r+s+o}function rot({usage:e,contextWindow:t,estimatedSystemTokens:n}){const i=Math.max(1,Math.round(t)),r=Math.max(0,e.current.promptTokenCount),s=Math.max(r,e.current.totalTokenCount),o=Math.min(i,r>0?Math.min(r,Math.max(0,n??0)):Math.max(0,n??0)),l=Math.max(0,r-o),c=r>0?Math.max(0,s-r):Math.max(0,s),u=r>0?s:o+c;return{systemTokens:o,inputTokens:l,outputTokens:c,remainingTokens:Math.max(0,i-u),usedTokens:u,contextWindow:i}}function sot(e){const t=[{kind:"system",tokens:e.systemTokens},{kind:"input",tokens:e.inputTokens},{kind:"output",tokens:e.outputTokens},{kind:"remaining",tokens:e.remainingTokens}],n=e.contextWindow/100;let i=0;const r=t.map(s=>{const o=i;return i+=s.tokens,{...s,start:o,end:i}});return Array.from({length:100},(s,o)=>{const l=o*n,c=l+n,u=r.flatMap(d=>{const f=Math.max(0,Math.min(c,d.end)-Math.max(l,d.start));return f>0?[{kind:d.kind,share:f/n}]:[]});return{index:o,slices:u}})}function ak(e,t){const n=e,i=n[t]??n[Jat[t]];return typeof i=="number"&&Number.isFinite(i)&&i>0?Math.round(i):0}function aot(e){const t=ak(e,"promptTokenCount"),n=ak(e,"candidatesTokenCount"),i=ak(e,"thoughtsTokenCount");return{totalTokenCount:ak(e,"totalTokenCount")||t+n+i,promptTokenCount:t,candidatesTokenCount:n,thoughtsTokenCount:i,cachedContentTokenCount:ak(e,"cachedContentTokenCount")}}function oot(e,t){return{totalTokenCount:e.totalTokenCount+t.totalTokenCount,promptTokenCount:e.promptTokenCount+t.promptTokenCount,candidatesTokenCount:e.candidatesTokenCount+t.candidatesTokenCount,thoughtsTokenCount:e.thoughtsTokenCount+t.thoughtsTokenCount,cachedContentTokenCount:e.cachedContentTokenCount+t.cachedContentTokenCount}}function yV(e,t){if(!t)return e;const n=typeof t.modelVersion=="string"?t.modelVersion.trim():"",i=typeof t.model_version=="string"?t.model_version.trim():"",r=n||i||e.modelName,s=t.usageMetadata??t.usage_metadata;if(!s)return r===e.modelName?e:{...e,modelName:r};const o=aot(s);return o.totalTokenCount===0?r===e.modelName?e:{...e,modelName:r}:{modelName:r,current:o,cumulative:oot(e.cumulative,o)}}function YJ(e){return e.reduce((t,n)=>yV(t,n),JS)}function ZJ(e){return e.blocks.flatMap(t=>t.kind==="tool"?[{name:t.name,args:t.args,response:t.response,done:t.done}]:[])}function lot(e){const t=e.attributes;return String(t["invocation.id"]??t["gen_ai.invocation.id"]??t["gcp.vertex.agent.invocation_id"]??"")}function cot(e,t){if(!t)return e;const n=new Set(e.filter(r=>lot(r)===t).map(r=>r.trace_id)),i=e.filter(r=>n.has(r.trace_id));return i.length>0?i:e}function f0(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function bg(e){return typeof e=="string"?e:""}function zje(e,t){return e==="pending"||e==="running"||e==="completed"||e==="failed"?e:t}function uot(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return{}}const n=f0(t)??{};return f0(n.result)??n}function dot(e){var n;const t=(n=f0(e))==null?void 0:n.branches;return Array.isArray(t)?t.map(i=>{var r;return bg((r=f0(i))==null?void 0:r.label)}):[]}function Vje(e,t,n){const i=dot(e),r=uot(t),s=Array.isArray(r.branches)?r.branches:[],o=n==="running"?"running":"pending";return{branches:[0,1].map(c=>{const u=f0(s[c])??{};return{label:bg(u.label)||i[c]||`方向 ${c+1}`,content:bg(u.content),status:zje(u.status,o),error:bg(u.error)}})}}function fot(e){const t=f0(e),n=f0(t==null?void 0:t.veadkStudioToolProgress);return!n||n.toolName!=="branch_compare"||typeof n.branchIndex!="number"||n.branchIndex<0||n.branchIndex>1?null:{toolName:"branch_compare",requestId:bg(n.requestId),branchIndex:n.branchIndex,label:bg(n.label),delta:bg(n.delta),status:zje(n.status,"running"),error:bg(n.error)||void 0}}function hot(e,t,n){return{branches:Vje(e,t,"running").branches.map((s,o)=>o===n.branchIndex?{...s,label:n.label||s.label,content:s.content+n.delta,status:n.status,error:n.error??s.error}:s)}}function Ko(e,t){return yn.t(`blocks.codexProgress.${e}`,{ns:"conversation",...t})}const Hje=28e4;function JJ(e){try{return JSON.stringify(e).length}catch{return Hje}}function pot(e){const t=e.slice(-200);let n=t.reduce((i,r)=>i+JJ(r),0);for(;t.length>1&&n>Hje;)n-=JJ(t.shift());return t}function xu(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Ji(e){return typeof e=="string"?e:""}function vV(e,t=""){const n=Ji(e).toLowerCase();return t.endsWith(".failed")||["failed","error","declined","cancelled"].includes(n)?"failed":t.endsWith(".completed")||["completed","done","success"].includes(n)?"completed":"running"}function qje(e){if(e.response!==void 0)return e.response;if(e.result!==void 0)return e.result;const t=e.aggregatedOutput??e.aggregated_output??e.output,n=e.exitCode??e.exit_code;if(!(t===void 0&&n===void 0))return{...t!==void 0?{output:t}:{},...n!==void 0?{exitCode:n}:{}}}function Wje(e){if(e.args!==void 0)return e.args;if(e.arguments!==void 0)return e.arguments;if(e.input!==void 0)return e.input;const t=Ji(e.command),n=Ji(e.cwd);if(t||n)return{...t?{command:t}:{},...n?{cwd:n}:{}};if(e.changes!==void 0)return{changes:e.changes};if(e.approval!==void 0)return e.approval}function dy(e,t,n,i,r){return{kind:"tool",name:e,callId:t,args:i,response:r,done:n!=="running",status:n,...n==="failed"?{defaultOpen:!0}:{}}}function Kje(e){const t=Ji(e.id||e.itemId||e.item_id),n=Ji(e.kind);if(!t||!n)return null;const i=vV(e.status),r=Ji(e.text||e.detail||e.delta),s=!Ji(e.text||e.detail)&&typeof e.delta=="string";if(n==="thinking"||n==="reasoning")return r?{id:t,block:{kind:"thinking",text:r,done:i!=="running",thoughtKind:n==="reasoning"?"reasoning":"thought"},appendText:s}:null;if(n==="commentary")return r?{id:t,block:{kind:"text",text:r},appendText:s}:null;if(["message","text","assistant_final","final"].includes(n))return r?{id:t,block:{kind:"text",text:r},appendText:s,finalAnswer:!0}:null;if(n==="plan"){const o=Array.isArray(e.plan)?e.plan:[];return{id:t,block:{kind:"plan",title:Ji(e.title)||Ko("planTitle"),summary:r||void 0,items:o.flatMap(l=>{const c=xu(l),u=Ji(c==null?void 0:c.text);if(!u)return[];const d=Ji(c==null?void 0:c.status);return[{text:u,status:["pending","in_progress","completed","failed"].includes(d)?d:"pending"}]}),done:i!=="running"}}}if(["tool","command","command_execution","commandExecution","file_change","fileChange","mcp_tool_call","mcpToolCall","collab_tool_call","web_search","approval","status"].includes(n)){const o=Ko(n==="file_change"||n==="fileChange"?"fallback.fileChange":n==="approval"?"fallback.approval":n==="status"?"fallback.status":"fallback.command"),l=Wje(e),c=qje(e)??(n==="status"&&r||void 0);return{id:t,block:dy(Ji(e.name||e.title)||o,t,i,l,c)}}return null}function Gje(e){const t=Ji(e.type),n=xu(e.item),i=Ji(n==null?void 0:n.type),r=Ji((n==null?void 0:n.id)||e.id)||(t==="turn.failed"?"turn":"");if(!r)return null;const s=vV(n==null?void 0:n.status,t);if(i==="reasoning"||i==="agent_message"){const o=Ji(n==null?void 0:n.text);return o?{id:r,block:i==="reasoning"?{kind:"thinking",text:o,done:s!=="running",thoughtKind:"reasoning"}:{kind:"text",text:o},...i==="agent_message"&&(n==null?void 0:n.phase)!=="commentary"?{finalAnswer:!0}:{}}:null}if(i==="todo_list"){const l=(Array.isArray(n==null?void 0:n.items)?n.items:[]).flatMap(c=>{const u=xu(c),d=Ji(u==null?void 0:u.text);if(!d)return[];const f=Ji(u==null?void 0:u.status).toLowerCase(),h=(u==null?void 0:u.completed)===!0||["completed","done"].includes(f)?"completed":["failed","error"].includes(f)?"failed":["in_progress","running"].includes(f)?"in_progress":"pending";return[{text:d,status:h}]});return l.length?{id:r,block:{kind:"plan",title:Ko("planTitle"),summary:Ko("planSummary",{completed:l.filter(c=>c.status==="completed").length,total:l.length}),items:l,done:s!=="running"}}:null}if(i==="command_execution"){const o=Ko(`command.${s}`);return{id:r,block:dy(o,r,s,Wje(n??{}),qje(n??{}))}}if(i==="file_change"){const o=Array.isArray(n==null?void 0:n.changes)?n.changes:[],l=o.length?Ko("projectFiles",{count:o.length}):Ko("projectFile"),c=Ko(`fileChange.${s}`,{subject:l});return{id:r,block:dy(c,r,s,o.length?{changes:o}:void 0)}}if(i==="mcp_tool_call"){const o=[Ji(n==null?void 0:n.server),Ji(n==null?void 0:n.tool)].filter(Boolean).join("/")||Ko("externalTool"),l=Ko(`mcp.${s}`,{tool:o}),c=xu(n==null?void 0:n.error),u=(n==null?void 0:n.result)!==void 0?n.result:Ji(c==null?void 0:c.message)||void 0;return{id:r,block:dy(l,r,s,n==null?void 0:n.arguments,u)}}if(i==="collab_tool_call"){const o=Ji(n==null?void 0:n.tool),l=["spawn_agent","send_input","wait","close_agent"].includes(o)?o:"default",c=Ko(`collaboration.${l}.${s}`),u=Object.fromEntries(["tool","receiver_thread_ids","prompt"].filter(d=>(n==null?void 0:n[d])!==void 0).map(d=>[d,n==null?void 0:n[d]]));return{id:r,block:dy(c,r,s,Object.keys(u).length?u:void 0,n==null?void 0:n.agents_states)}}if(i==="web_search"){const o=Ko(`webSearch.${s}`),l=Object.fromEntries(["query","action"].filter(c=>(n==null?void 0:n[c])!==void 0).map(c=>[c,n==null?void 0:n[c]]));return{id:r,block:dy(o,r,s,Object.keys(l).length?l:void 0)}}if(i==="error"||t==="error"||t==="turn.failed"){const o=xu(e.error),l=Ji((n==null?void 0:n.message)||e.message||(o==null?void 0:o.message))||Ko("errorDetail");return{id:r,block:dy(Ko("errorTitle"),r,"failed",void 0,l)}}return null}function mot(e){const t=xu(e),n=xu(t==null?void 0:t.veadkStudioToolProgress);if(!n||n.kind!=="codex")return null;const i=Ji(n.toolName),r=Ji(n.requestId);if(!i||!r)return null;const s=xu(n.event??n.activity);if(!s)return null;const o=xu(s.item)||Ji(s.type)?Gje(s):Kje(s);if(!o)return null;const l=Ji(n.title||n.label),c=Ji(s.agentSessionId??s.agent_session_id),u=Ji(s.sandboxSessionId??s.sandbox_session_id),d=Ji(s.threadId??s.thread_id),f=vV(s.status,Ji(s.type)),m=Ji(s.kind)==="status"&&f!=="running"?f:void 0;return{toolName:i,requestId:r,...l?{title:l}:{},...c?{agentSessionId:c}:{},...u?{sandboxSessionId:u}:{},...d?{threadId:d}:{},...m?{terminalStatus:m}:{},event:o}}function got(e,t){const n=xu(t),i=xu((n==null?void 0:n.codexActivity)??(n==null?void 0:n.codex_activity));if(!i)return e;const r=Ji(i.title)||(e==null?void 0:e.title)||"Codex Sandbox",s=Ji(i.agentSessionId??i.agent_session_id)||(e==null?void 0:e.agentSessionId),o=Ji(i.sandboxSessionId??i.sandbox_session_id)||(e==null?void 0:e.sandboxSessionId),l=Ji(i.threadId??i.thread_id)||(e==null?void 0:e.threadId);let c={title:r,...s?{agentSessionId:s}:{},...o?{sandboxSessionId:o}:{},...l?{threadId:l}:{},items:(e==null?void 0:e.items.slice())??[]};const u=Array.isArray(i.events)?i.events:[];for(const d of u){const f=xu(d);if(!f)continue;const h=xu(f.item)||Ji(f.type)?Gje(f):Kje(f);h&&(h.finalAnswer||(c=lB(c,{title:r,...s?{agentSessionId:s}:{},...o?{sandboxSessionId:o}:{},...l?{threadId:l}:{},event:h})))}return c}function lB(e,t){const n=(e==null?void 0:e.items.slice())??[],i=n.findIndex(r=>r.id===t.event.id);if(i>=0){const r=n[i].block,s=t.event.block;t.event.appendText&&r.kind==="text"&&s.kind==="text"?n[i]={id:t.event.id,block:{...s,text:r.text+s.text}}:t.event.appendText&&r.kind==="thinking"&&s.kind==="thinking"?n[i]={id:t.event.id,block:{...s,text:r.text+s.text}}:n[i]={id:t.event.id,block:s}}else n.push({id:t.event.id,block:t.event.block});return{title:t.title||(e==null?void 0:e.title)||"Codex Sandbox",...t.agentSessionId||e!=null&&e.agentSessionId?{agentSessionId:t.agentSessionId||(e==null?void 0:e.agentSessionId)}:{},...t.sandboxSessionId||e!=null&&e.sandboxSessionId?{sandboxSessionId:t.sandboxSessionId||(e==null?void 0:e.sandboxSessionId)}:{},...t.threadId||e!=null&&e.threadId?{threadId:t.threadId||(e==null?void 0:e.threadId)}:{},items:pot(n)}}const cB="send_a2ui_json_to_client",uB="validated_a2ui_json",bN="adk_request_credential",Q3="transfer_to_agent";function bot(e){var i,r,s,o;const t=e,n=((i=t==null?void 0:t.exchangedAuthCredential)==null?void 0:i.oauth2)??((r=t==null?void 0:t.exchanged_auth_credential)==null?void 0:r.oauth2)??((s=t==null?void 0:t.rawAuthCredential)==null?void 0:s.oauth2)??((o=t==null?void 0:t.raw_auth_credential)==null?void 0:o.oauth2);return(n==null?void 0:n.authUri)??(n==null?void 0:n.auth_uri)}function dB(){return{blocks:[],liveStart:0,pendingCodexProgress:[]}}const yot=2048;function eee(e,t){if(t.event.finalAnswer)return"applied";let n=-1;for(let i=e.length-1;i>=0;i-=1){const r=e[i];if(!(r.kind!=="tool"||r.name!==t.toolName)){if(r.callId===t.requestId)return r.done?"completed":(r.codexActivity=lB(r.codexActivity,t),r.status=t.terminalStatus??"running",t.terminalStatus&&(r.done=!0),"applied");if(!r.done){if(n>=0)return"unmatched";n=i}}}if(n>=0){const i=e[n];return i.kind!=="tool"?"unmatched":(i.codexActivity=lB(i.codexActivity,t),i.status=t.terminalStatus??"running",t.terminalStatus&&(i.done=!0),"applied")}return"unmatched"}function vot(e){if(!e||typeof e!="object"||Array.isArray(e))return"completed";const t=e,n=typeof t.status=="string"?t.status.toLowerCase():"";return t.ok===!1||["error","failed","denied","declined","cancelled","timeout"].includes(n)?"failed":"completed"}function tee(e){if(!e||typeof e!="object"||Array.isArray(e))return"";const t=e;return t.ok!==!0||typeof t.message!="string"?"":t.message.trim()}const cC=e=>e.functionCall??e.function_call,tb=e=>e.functionResponse??e.function_response;function z1(e){const t=e.customMetadata??e.custom_metadata;return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}function xot(e,t){const n=e[t];return n&&typeof n=="object"&&!Array.isArray(n)?n:{}}function ag(e,t){const n=e[t];return typeof n=="string"?n:""}function Xje(e){return xot(z1(e),"mpa")}function xV(e){const t=z1(e),n=Xje(e);return ag(t,"eventType")||ag(t,"event_type")||ag(n,"eventType")||ag(n,"event_type")||ag(n,"kind")}function rw(e){const t=z1(e),n=Xje(e);return ag(t,"source")==="sandbox"||ag(n,"source")==="sandbox"}function Yje(e){const t=xV(e);return t==="usage.updated"||t==="usage"}function fI(e){var t;return(((t=e.content)==null?void 0:t.parts)??[]).some(n=>{const i=tb(n),r=i==null?void 0:i.response;return(i==null?void 0:i.name)==="sandbox_task"&&r&&typeof r=="object"&&!Array.isArray(r)&&r.finalAlreadyEmitted===!0})}function nee(e){for(const t of e)t.kind!=="tool"||t.name!=="sandbox_task"||t.done||(t.done=!0,t.status="completed")}function wot(e,t){if(e===t)return!0;const n=new Set(["exec_command","commandExecution","command_execution","Run command"]);return n.has(e)&&n.has(t)}function iee(e,t=!1){const n=e&&typeof e=="object"?String(e.status??"").toLowerCase():"",i=["failed","error","cancelled","denied","timeout"].includes(n)||(e==null?void 0:e.ok)===!1,r=["running","started","working"].includes(n);return{done:i||!(t||r),status:i?"failed":t||r?"running":"completed"}}function Oot(e){return e.flatMap(t=>{var n;return t.kind!=="tool"||t.name!=="delegate_to_codex_sandbox"||!((n=t.codexActivity)!=null&&n.items.length)?[t]:[{kind:"activity-source",label:t.codexActivity.title||"Codex Sandbox"},...t.codexActivity.items.map(({block:i})=>i.kind==="tool"?{...i,source:"codex-sandbox"}:i)]})}function kot(e){if(!e||typeof e!="object")return"";const t=e,n=t.agentName??t.agent_name;return typeof n=="string"?n:""}function Sot(e){return e.replace(/-/g,"+").replace(/_/g,"/")}function UA(e){const t=[];for(const[n,i]of e.entries()){const r=i.partMetadata??i.part_metadata,s=r==null?void 0:r.veadkTransport;if((s==null?void 0:s.hidden)===!0)continue;const o=r==null?void 0:r.veadkMedia;if(typeof(o==null?void 0:o.uri)=="string"){t.push({id:String(o.id??o.uri),mimeType:typeof o.mimeType=="string"?o.mimeType:void 0,uri:o.uri,name:typeof o.name=="string"?o.name:void 0,sizeBytes:typeof o.sizeBytes=="number"?o.sizeBytes:void 0});continue}const l=i.inlineData??i.inline_data;if(l&&l.data){t.push({id:`inline-${n}-${l.displayName??l.display_name??"media"}`,mimeType:l.mimeType??l.mime_type,data:Sot(l.data),name:l.displayName??l.display_name});continue}const c=i.fileData??i.file_data,u=(c==null?void 0:c.fileUri)??(c==null?void 0:c.file_uri);c&&u&&t.push({id:u,mimeType:c.mimeType??c.mime_type,uri:u,name:c.displayName??c.display_name})}return t}function qy(e){const t=e.partMetadata??e.part_metadata,n=t==null?void 0:t.veadkTransport;return(n==null?void 0:n.hideText)===!0?void 0:e.text}const Eot=new Set(["llm","sequential","parallel","loop","a2a"]);function Cot(e){var t;for(const n of e){const i=(t=n.partMetadata??n.part_metadata)==null?void 0:t.veadkInvocation;if(!i||typeof i!="object")continue;const r=i,s=Array.isArray(r.skills)?r.skills.flatMap(c=>{if(!c||typeof c!="object")return[];const u=c;return typeof u.name=="string"?[{name:u.name,description:typeof u.description=="string"?u.description:""}]:[]}):[];let o;const l=r.targetAgent;if(l&&typeof l=="object"){const c=l,u=c.type;typeof c.name=="string"&&typeof u=="string"&&Eot.has(u)&&Array.isArray(c.path)&&(o={name:c.name,description:typeof c.description=="string"?c.description:"",type:u,path:c.path.filter(d=>typeof d=="string")})}if(s.length>0||o)return{skills:s,targetAgent:o}}}function Aot(e,t){if(!t.length)return;const n=e[e.length-1];(n==null?void 0:n.kind)==="attachment"?n.files.push(...t):e.push({kind:"attachment",files:t})}function Tot(e,t){if(!t.length)return;const n=e[e.length-1];if((n==null?void 0:n.kind)==="artifact"){for(const i of t)n.files.some(r=>r.filename===i.filename&&r.version===i.version)||n.files.push(i);return}e.push({kind:"artifact",files:t})}function z3(e,t,n,i){const r=e[e.length-1];r&&r.kind===t&&(r.kind!=="thinking"||r.thoughtKind===i)?r.text+=n:e.push(t==="thinking"?{kind:t,text:n,done:!1,thoughtKind:i}:{kind:t,text:n})}function V3(e){const t=e.customMetadata??e.custom_metadata;if(t&&typeof t=="object"){const n=t.thoughtKind;if(n==="reasoning"||n==="thought")return n}return"reasoning"}function ok(e){for(const t of e)t.kind==="thinking"&&(t.done=!0)}function Zje(e,t,n={}){var h,m,g,b,v,y;const i=e.blocks.map(w=>({...w}));let r=e.liveStart,s=e.pendingCodexProgress.slice();if(Yje(t)&&!n.mpaA2a)return{blocks:i,liveStart:r,pendingCodexProgress:s};if(fI(t))return nee(i),ok(i),{blocks:i,liveStart:r,pendingCodexProgress:s};const o=((h=t.content)==null?void 0:h.parts)??[],l=o.flatMap(w=>{const x=fot(w.partMetadata??w.part_metadata);return x?[x]:[]}),c=o.flatMap(w=>{const x=mot(w.partMetadata??w.part_metadata);return x?[x]:[]});if(l.length>0||c.length>0){for(const w of l)for(let x=i.length-1;x>=0;x-=1){const O=i[x];if(!(O.kind!=="tool"||O.done||O.name!==w.toolName||w.requestId&&O.callId&&O.callId!==w.requestId)){O.response=hot(O.args,O.response,w),O.status="running";break}}for(const w of c)eee(i,w)==="unmatched"&&(s=[...s,w].slice(-64));return{blocks:i,liveStart:r,pendingCodexProgress:s}}const u=o.some(w=>cC(w)||tb(w));if(t.partial&&!u){for(const w of o){const x=qy(w),O=n.mpaA2a&&w.thought?ag(z1(t),"reasoningSegmentId"):"";if(O&&typeof x=="string"&&x){const k=i.find(S=>S.kind==="thinking"&&S.reasoningSegmentId===O);(k==null?void 0:k.kind)==="thinking"?k.text+=x:i.push({kind:"thinking",text:x,done:!1,thoughtKind:V3(t),reasoningSegmentId:O});continue}typeof x=="string"&&x&&z3(i,w.thought?"thinking":"text",x,w.thought?V3(t):void 0)}return{blocks:i,liveStart:r,pendingCodexProgress:s}}const d=n.mpaA2a&&!o.some(w=>w.thought&&qy(w))?i.slice(r).filter(w=>w.kind==="thinking"):[];i.length=r,i.push(...d);for(const w of o){const x=cC(w),O=tb(w),k=UA([w]),S=qy(w);if(typeof S=="string"&&S)z3(i,w.thought?"thinking":"text",S,w.thought?V3(t):void 0);else if(k.length)ok(i),Aot(i,k);else if(x)if(ok(i),x.name===Q3){const C=kot(x.args)||((m=t.actions)==null?void 0:m.transferToAgent)||((g=t.actions)==null?void 0:g.transfer_to_agent)||yn.t("app:common.unknownAgent");i.push({kind:"agent-transfer",agentName:C,done:!1})}else{if(x.name==="sandbox_task"&&rw(t))continue;if(x.name===bN){const C=x.args??{},E=C.authConfig??C.auth_config??C,T=String(C.functionCallId??C.function_call_id??"").replace(/^_adk_toolset_auth_/,"")||void 0;i.push({kind:"auth",callId:x.id??"",label:T,authUri:bot(E),authConfig:E,done:!1})}else{const C=x.id?[...i].reverse().find(j=>j.kind==="tool"&&j.callId===x.id):void 0;if((C==null?void 0:C.kind)==="tool"){C.name=x.name??C.name,C.args=x.args??C.args,C.response===void 0&&(C.done=!1,C.status="running");continue}const E={kind:"tool",name:x.name??"",callId:x.id,args:x.args,done:!1};if(i.push(E),E.callId){const j=[];for(const T of s)T.toolName===E.name&&T.requestId===E.callId?eee(i,T):j.push(T);s=j}}}else if(O){if(ok(i),O.name===Q3)for(let E=i.length-1;E>=0;E--){const j=i[E];if(j.kind==="agent-transfer"&&!j.done){j.done=!0;break}}if(O.name===bN)for(let E=i.length-1;E>=0;E--){const j=i[E];if(j.kind==="auth"&&!j.done){j.done=!0;break}}let C=!1;for(let E=i.length-1;E>=0;E--){const j=i[E],T=j.kind==="tool"&&j.name==="delegate_to_codex_sandbox";if(j.kind==="tool"&&(!j.done||T||O.id&&j.callId===O.id)&&(O.id&&j.callId&&j.callId===O.id||(!O.id||!j.callId)&&wot(j.name,O.name??""))){const R=T?tee(j.response):"",A=iee(O.response,t.partial===!0);if(j.done=A.done,j.response=O.response,j.status=A.status,T){j.codexActivity=got(j.codexActivity,O.response),j.status=A.status==="running"?"running":vot(O.response);const N=tee(O.response);N&&N!==R&&z3(i,"text",N)}C=!0;break}}if(!C&&O.name!==Q3&&O.name!==bN&&O.name!==cB){const E=iee(O.response,t.partial===!0);i.push({kind:"tool",name:O.name??"",callId:O.id,response:O.response,done:E.done,status:E.status})}if(O.name===cB){const E=((b=O.response)==null?void 0:b[uB])??[];if(E.length){const j=i[i.length-1];j&&j.kind==="a2ui"?j.messages.push(...E):i.push({kind:"a2ui",messages:E})}}}}const f=((v=t.actions)==null?void 0:v.artifactDelta)??((y=t.actions)==null?void 0:y.artifact_delta);return f&&Tot(i,Object.entries(f).map(([w,x])=>({filename:w,version:x}))),rw(t)&&xV(t)==="invocation.completed"&&nee(i),ok(i),r=i.length,{blocks:i,liveStart:r,pendingCodexProgress:s}}function _ot(e,t){var u,d,f,h,m,g;if(e.partial===!0)return!1;if(fI(e))return!0;const n=((u=e.content)==null?void 0:u.parts)??[],i=n.some(b=>{const v=qy(b);return!b.thought&&typeof v=="string"&&v.trim().length>0||UA([b]).length>0}),r=n.some(b=>{var y;const v=tb(b);return(v==null?void 0:v.name)===cB&&Array.isArray((y=v.response)==null?void 0:y[uB])&&v.response[uB].length>0}),s=((d=e.actions)==null?void 0:d.artifactDelta)??((f=e.actions)==null?void 0:f.artifact_delta),o=!!(s&&Object.keys(s).length>0),l=!!(((h=e.actions)==null?void 0:h.endOfAgent)??((m=e.actions)==null?void 0:m.end_of_agent)??((g=e.actions)==null?void 0:g.escalate)),c=t.some(b=>b.kind==="text"||b.kind==="attachment"||b.kind==="artifact"||b.kind==="a2ui"||b.kind==="delivery");return i||r||o||l&&c}function Jje(e){var n;const t=(n=e.customMetadata??e.custom_metadata)==null?void 0:n.a2aStatus;return typeof t=="string"?t:void 0}function ree(e){var n,i,r;if(Jje(e))return!0;const t=((n=e.actions)==null?void 0:n.artifactDelta)??((i=e.actions)==null?void 0:i.artifact_delta);return t&&Object.keys(t).length>0?!0:(((r=e.content)==null?void 0:r.parts)??[]).some(s=>!!(qy(s)||UA([s]).length>0||cC(s)||tb(s)))}function jot(e,t){var o;const n=z1(t),i=((o=t.content)==null?void 0:o.parts)??[];if(t.partial!==!1||n.projectionSource!=="a2a-artifact"||rw(t)||!i.length||t.actions||!i.every(l=>l.thought&&typeof l.text=="string"&&!cC(l)&&!tb(l)&&UA([l]).length===0))return e;const r=e.blocks[e.blocks.length-1],s=i.map(l=>l.text).join("").trim();return(r==null?void 0:r.kind)!=="thinking"||!r.text.trim()||!s.startsWith(r.text.trim())?e:{...e,liveStart:e.blocks.length-1}}function Not(e,t,n,i){const r=e[t];if(!r||r.role!=="assistant"||i.turnIsStreaming||n(r))return!1;if(!i.mpaA2a)return!0;let s=t;for(;s>0&&e[s-1].role!=="user";)s-=1;let o=t+1;for(;oc.blocks.length>0)}function Rot(e){var t,n;return e.author!=="user"&&((t=e.content)==null?void 0:t.role)!=="user"?!1:!(((n=e.content)==null?void 0:n.parts)??[]).some(i=>cC(i)||tb(i))}function yN(e="adk-stream",t,n={}){var h,m,g,b;let i=0;const r=new Map,s=new Set,o=[];let l,c,u={...(h=t==null?void 0:t.meta)==null?void 0:h.mpaUsage};const d=v=>{if(!n.mpaA2a||!(v.usageMetadata??v.usage_metadata))return!1;const y=yV(JS,v).current.totalTokenCount;if(!y)return!1;const w=z1(v),x=JSON.stringify([w.source??"outer",w.requestId??"",v.invocationId??v.invocation_id??"",v.id||JSON.stringify(v.usageMetadata??v.usage_metadata)]);return Object.prototype.hasOwnProperty.call(u,x)?!1:(u={...u,[x]:y},!0)},f=(v,y)=>`${y}\0${v}`;if((t==null?void 0:t.role)==="assistant"){const v=((m=t.meta)==null?void 0:m.author)??"",y=((g=t.meta)==null?void 0:g.invocationId)??"",w=((b=t.meta)==null?void 0:b.localId)??`${e}-${i++}`,x=dB();x.blocks=t.blocks,x.liveStart=t.blocks.length,l=f(v,y),r.set(l,{acc:x,localId:w,meta:{...t.meta,localId:w,streaming:!0,eventId:void 0}})}return{project(v){var R,A,N;if(Rot(v))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};const y=d(v);if(n.mpaA2a&&!ree(v)&&!((A=(R=v.content)==null?void 0:R.parts)!=null&&A.length))return y&&c?(c={...c,meta:{...c.meta,mpaUsage:u}},{turn:c,completed:!1}):{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(Yje(v)&&!n.mpaA2a)return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(v.id&&s.has(v.id))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};v.id&&(s.add(v.id),o.push(v.id),o.length>yot&&s.delete(o.shift()));const w=v.author&&v.author!=="user"?v.author:"",x=v.invocationId??v.invocation_id??"";let O=rw(v)?"":w,k=f(O,x),S=r.get(k);if(!S&&rw(v)&&x){const P=[...r.entries()].find(([I])=>I.startsWith(`${x}\0`));P&&(k=P[0],S=P[1],O=S.meta.author??"")}if(!S&&l){const P=r.get(l);P&&(!P.meta.author||P.meta.author===O)&&(r.delete(l),l=void 0,S=P)}if(!S&&fI(v))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(!S&&!ree(v))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(!S){const P=`${e}-${i++}`;S={acc:dB(),localId:P,meta:{author:O||void 0,invocationId:x||void 0}}}S.acc=Zje(n.mpaA2a?jot(S.acc,v):S.acc,v,n);const C=v.usageMetadata??v.usage_metadata,E=_ot(v,S.acc.blocks);S.meta={...S.meta,author:O||S.meta.author,localId:S.localId,streaming:!E,a2aStatus:Jje(v),tokens:(C==null?void 0:C.totalTokenCount)||S.meta.tokens,...n.mpaA2a?{mpaUsage:u,mpaFinalAnswer:rw(v)&&xV(v)==="invocation.completed"?(((N=v.content)==null?void 0:N.parts)??[]).filter(P=>!P.thought).map(P=>qy(P)??"").join("").trim()||void 0:S.meta.mpaFinalAnswer}:{},ts:v.timestamp||S.meta.ts,invocationId:x||S.meta.invocationId,eventId:E&&v.id?v.id:S.meta.eventId};const j={role:"assistant",blocks:S.acc.blocks,meta:S.meta},T=E&&fI(v);return E&&!T?(r.delete(k),l=void 0):r.set(k,S),n.mpaA2a&&(c=j),{turn:j,completed:E}},finish(){const v=[...r.values()].map(y=>({role:"assistant",blocks:y.acc.blocks.map(w=>w.kind==="thinking"?{...w,done:!0}:w),meta:{...y.meta,streaming:!1,...n.mpaA2a?{mpaUsage:u}:{}}}));return r.clear(),v}}}function Ey(e,t){var s;const n=(s=t.meta)==null?void 0:s.localId;if(!n)return[...e,t];const i=e.findIndex(o=>{var l;return((l=o.meta)==null?void 0:l.localId)===n});if(i<0)return[...e,t];const r=e.slice();return r[i]=t,r}function see(e,t={},n={}){var l;let i=[],r=0;const s=()=>yN(`adk-history-${r++}`,void 0,n);let o=s();for(const c of e)if(c.author==="user"){const d=((l=c.content)==null?void 0:l.parts)??[];if(d.some(b=>{var v;return((v=tb(b))==null?void 0:v.name)===bN})){for(let b=i.length-1;b>=0;b--)if(i[b].role==="assistant"){for(let v=i[b].blocks.length-1;v>=0;v--){const y=i[b].blocks[v];if(y.kind==="auth"){y.done=!0;break}}break}}const f=d.map(qy).filter(b=>!!b).join(""),h=UA(d),m=Cot(d);if(!f&&!h.length&&!m)continue;for(const b of o.finish())i=Ey(i,b);const g=[];m&&g.push({kind:"invocation",value:m}),h.length&&g.push({kind:"attachment",files:h}),f&&g.push({kind:"text",text:f}),i.push({role:"user",blocks:g,meta:{ts:c.timestamp}}),o=s()}else{const d=o.project(c);d.ignored||(i=Ey(i,d.turn))}for(const c of o.finish())i=Ey(i,c);for(const c of i){const u=c.meta,d=u==null?void 0:u.eventId;if(!d)continue;const f=t[`veadk_feedback:${d}`];if(!f||typeof f!="object")continue;const h=f;h.rating!=="good"&&h.rating!=="bad"||(u.feedback=f)}return i}function nM(e,t=yn.t("app:titles.newConversation")){var n,i;for(const r of e??[])if(r.author==="user"||((n=r.content)==null?void 0:n.role)==="user"){const s=(((i=r.content)==null?void 0:i.parts)??[]).map(o=>o.text).find(Boolean);if(s)return s}return t}function Iot(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return e[t]}function Pot(e,t,n){var s;if(!n||!t.some(o=>{var l;return o.role==="assistant"&&((l=o.meta)==null?void 0:l.eventId)===n}))return e;const r=Iot(e);return((s=r==null?void 0:r.meta)==null?void 0:s.eventId)!==n?e:t}function eNe(e,t,n){if(e.name===t||e.id===t)return(n==null?void 0:n.type)==="parallel"?n:void 0;for(const i of e.children){const r=eNe(i,t,e);if(r)return r}}function Dot(e,t){var o,l;if(e.role!=="assistant"||!t)return;const n=(o=e.meta)==null?void 0:o.author;if(!n)return;const i=eNe(t,n);if(!i)return;const r=i.id||i.path.join("/")||i.name;return{key:`${((l=e.meta)==null?void 0:l.invocationId)??""}::${r}`,parent:i.name}}function Mot(e,t){const n=[];return e.forEach((i,r)=>{const s=Dot(i,t),o=n[n.length-1];if(s&&(o==null?void 0:o.groupKey)===s.key){o.turnIndexes.push(r);return}n.push({key:s?`parallel-${s.key}-${r}`:`turn-${r}`,turnIndexes:[r],parallelParent:s==null?void 0:s.parent,groupKey:s==null?void 0:s.key})}),n.map(({groupKey:i,...r})=>r)}function Lot(e,t,n){var r,s,o,l,c;if(!t)return e;const i=[];for(let u=0;u{var k;return(k=O.meta)!=null&&k.mpaFinalAnswer?[O.meta.mpaFinalAnswer.trim()]:[]})),m=f.map(O=>{var S;const k=O.blocks.filter(C=>C.kind==="text").map(C=>C.text).join("").trim();return!((S=O.meta)!=null&&S.mpaFinalAnswer)&&k&&h.has(k)?{...O,blocks:O.blocks.filter(C=>C.kind!=="text")}:O}),g=[...m].reverse().find(O=>O.blocks.some(k=>k.kind==="text"&&k.text.trim()))??f[f.length-1],b={},v=new Map,y=f.some(O=>{var k;return(k=O.meta)==null?void 0:k.mpaUsage});for(const O of f){for(const[S,C]of Object.entries(((r=O.meta)==null?void 0:r.mpaUsage)??{}))b[S]=Math.max(b[S]??0,C);const k=(s=O.meta)==null?void 0:s.tokens;if(typeof k=="number"&&Number.isFinite(k)&&k>=0){const S=((o=O.meta)==null?void 0:o.invocationId)||"unidentified";v.set(S,Math.max(v.get(S)??0,k))}}const w=y?Object.values(b):[...v.values()],x=f.flatMap(O=>{var k;return(k=O.meta)!=null&&k.ts?[O.meta.ts]:[]});i.push({role:"assistant",blocks:m.flatMap(O=>O.blocks),meta:{...g.meta,localId:(l=d.meta)==null?void 0:l.localId,author:void 0,streaming:u===e.length&&n||f.some(O=>{var k;return((k=O.meta)==null?void 0:k.streaming)===!0}),a2aStatus:(c=f[f.length-1].meta)==null?void 0:c.a2aStatus,ts:x.length?Math.max(...x):void 0,tokens:w.length?w.reduce((O,k)=>O+k,0):void 0,...y?{mpaUsage:b}:{}}})}return i}function $ot(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"9",cy:"8",r:"3.25"}),a.jsx("path",{d:"M2.75 20v-1.5a6.25 6.25 0 0 1 12.5 0V20M16 5.25a3.25 3.25 0 0 1 0 6.5M18 14a5.5 5.5 0 0 1 3.25 5V20"})]})}function tNe(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t{const t=p.Children.toArray(e),n=[];let i="";const r=()=>{i!==""&&(n.push(i),i="")};for(const s of t)if(!(s==null||typeof s=="boolean")){if(typeof s=="string"||typeof s=="number"){i+=String(s);continue}r(),n.push(s)}return r(),n},wV=e=>{const t=Fot(e),n=p.Children.count(t);return p.Children.map(t,i=>{if(typeof i=="string"&&i.trim())return n<=1?i:a.jsx("span",{children:i});if(p.isValidElement(i)){const r=i,{children:s,...o}=r.props;return s!=null?p.cloneElement(r,o,wV(s)):r}return i})},Bot="_Badge_1viyg_1",Uot={Badge:Bot},Ya=({children:e,className:t,variant:n="soft",color:i="secondary",size:r="sm",pill:s,...o})=>a.jsx("div",{className:Qi(Uot.Badge,t),"data-color":i,"data-size":r,"data-pill":s?"":void 0,"data-variant":n,...o,children:wV(e)});var Qot=typeof ug=="object"&&ug&&ug.Object===Object&&ug,zot=typeof self=="object"&&self&&self.Object===Object&&self;Qot||zot||Function("return this")();var Vot=typeof window<"u"?p.useLayoutEffect:p.useEffect;function Hot(){const e=p.useRef(!1);return p.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),p.useCallback(()=>e.current,[])}var aee={width:void 0,height:void 0};function nNe(e){const{ref:t,box:n="content-box"}=e,[{width:i,height:r},s]=p.useState(aee),o=Hot(),l=p.useRef({...aee}),c=p.useRef(void 0);return c.current=e.onResize,p.useEffect(()=>{if(!t.current||typeof window>"u"||!("ResizeObserver"in window))return;const u=new ResizeObserver(([d])=>{const f=n==="border-box"?"borderBoxSize":n==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",h=oee(d,f,"inlineSize"),m=oee(d,f,"blockSize");if(l.current.width!==h||l.current.height!==m){const b={width:h,height:m};l.current.width=h,l.current.height=m,c.current?c.current(b):o()&&s(b)}});return u.observe(t.current,{box:n}),()=>{u.disconnect()}},[n,t,o]),{width:i,height:r}}function oee(e,t,n){return e[t]?Array.isArray(e[t])?e[t][0][n]:e[t][n]:t==="contentBoxSize"?e.contentRect[n==="inlineSize"?"width":"height"]:void 0}function OV(e,t){const n=p.useRef(e);Vot(()=>{n.current=e},[e]),p.useEffect(()=>{if(!t&&t!==0)return;const i=setTimeout(()=>{n.current()},t);return()=>{clearTimeout(i)}},[t])}const qot={DEV:!1,MODE:"production"},sw=typeof import.meta<"u"?qot:void 0,Wot=!!(sw!=null&&sw.DEV),Kot=typeof navigator<"u"&&/(jsdom|happy-dom)/i.test(navigator.userAgent)||typeof globalThis.happyDOM=="object",iNe=(sw==null?void 0:sw.MODE)==="test"||Kot,Got=typeof window<"u",rNe=typeof document<"u",Xot=Got&&rNe,kV=e=>{const t=e.currentTarget;if(!(t instanceof HTMLElement))return;const n=t.offsetWidth;let i=.985;n<=80?i=.96:n<=150?i=.97:n<=220?i=.98:n>600&&(i=.995),t.style.setProperty("--scale",i.toString())},hI=(e,t)=>{const n=()=>{const o=setTimeout(e);return()=>{clearTimeout(o)}};if(!Xot||typeof window.requestAnimationFrame!="function"||rNe&&document.visibilityState==="hidden")return n();let r=2,s=window.requestAnimationFrame(function o(){r-=1,r===0?e():s=window.requestAnimationFrame(o)});return()=>{typeof window.cancelAnimationFrame=="function"&&window.cancelAnimationFrame(s)}},B0=e=>Object.keys(e).reduce((n,i)=>{const r=e[i];if(r||r===0){const s=i.startsWith("--")?"":"--",o=typeof r=="number"?`${r}px`:r;n[`${s}${i}`]=o}return n},{}),H3=e=>typeof e=="number"?`${e}deg`:e,q3=e=>String(e),a_=e=>`${e}ms`,W3=({x:e,y:t,scale:n,rotate:i,skewX:r,skewY:s}={})=>{const o=[e==null?null:`translateX(${e}px)`,t==null?null:`translateY(${t}px)`,n==null?null:`scale(${n})`,i==null?null:`rotate(${H3(i)})`,r==null?null:`skewX(${H3(r)})`,s==null?null:`skewY(${H3(s)})`].filter(Boolean);return o.length?o.join(" "):"none"},K3=({blur:e}={})=>{const t=[e==null?null:`blur(${e}px)`].filter(Boolean);return t.length?t.join(" "):"none"},Lp=e=>{e.preventDefault()},sNe=e=>e.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex^="-"]), [contenteditable]'),Yot="_LoadingIndicator_7yl6f_1",Zot={LoadingIndicator:Yot},QA=({className:e,size:t,strokeWidth:n,style:i,...r})=>a.jsx("div",{...r,className:Qi(Zot.LoadingIndicator,e),style:i||B0({"indicator-size":t,"indicator-stroke":n})});var Jot=Object.defineProperty,SV=(e,t)=>Jot(e,"name",{value:t,configurable:!0});function fB(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}SV(fB,"setRef");function aNe(...e){return t=>{let n=!1;const i=e.map(r=>{const s=fB(r,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let r=0;relt(e,"name",{value:t,configurable:!0});function Yp(e){const t=p.forwardRef((n,i)=>{let{children:r,...s}=n,o=null,l=!1;const c=[];hB(r)&&typeof o_=="function"&&(r=o_(r._payload)),p.Children.forEach(r,h=>{var m;if(fNe(h)){l=!0;const g=h;let b="child"in g.props?g.props.child:g.props.children;hB(b)&&typeof o_=="function"&&(b=o_(b._payload)),o=tlt(g,b),c.push((m=o==null?void 0:o.props)==null?void 0:m.children)}else c.push(h)}),o?o=p.cloneElement(o,void 0,c):!l&&p.Children.count(r)===1&&p.isValidElement(r)&&(o=r);const u=o?dNe(o):void 0,d=jr(i,u);if(!o){if(r||r===0)throw new Error(l?rlt(e):ilt(e));return r}const f=uNe(s,o.props??{});return o.type!==p.Fragment&&(f.ref=i?d:u),p.cloneElement(o,f)});return t.displayName=`${e}.Slot`,t}Af(Yp,"createSlot");var oNe=Yp("Slot"),lNe=Symbol.for("radix.slottable");function cNe(e){const t=Af(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=lNe,t}Af(cNe,"createSlottable");var tlt=Af((e,t)=>{if("child"in e.props){const n=e.props.child;return p.isValidElement(n)?p.cloneElement(n,void 0,e.props.children(n.props.children)):null}return p.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function uNe(e,t){const n={...t};for(const i in t){const r=e[i],s=t[i];/^on[A-Z]/.test(i)?r&&s?n[i]=(...l)=>{const c=s(...l);return r(...l),c}:r&&(n[i]=r):i==="style"?n[i]={...r,...s}:i==="className"&&(n[i]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}Af(uNe,"mergeProps");function dNe(e){var i,r;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Af(dNe,"getElementRef");function fNe(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===lNe}Af(fNe,"isSlottable");var nlt=Symbol.for("react.lazy");function hB(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===nlt&&"_payload"in e&&hNe(e._payload)}Af(hB,"isLazyComponent");function hNe(e){return typeof e=="object"&&e!==null&&"then"in e}Af(hNe,"isPromiseLike");var ilt=Af(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),rlt=Af(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),o_=j0[" use ".trim().toString()],slt=Object.defineProperty,alt=(e,t)=>slt(e,"name",{value:t,configurable:!0}),olt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Zr=olt.reduce((e,t)=>{const n=Yp(`Primitive.${t}`),i=p.forwardRef((r,s)=>{const{asChild:o,...l}=r,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:s})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function EV(e,t){e&&vi.flushSync(()=>e.dispatchEvent(t))}alt(EV,"dispatchDiscreteCustomEvent");var llt=Object.defineProperty,clt=(e,t)=>llt(e,"name",{value:t,configurable:!0}),ult=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),dlt=p.forwardRef(clt(function(t,n){return a.jsx(Zr.span,{...t,ref:n,style:{...ult,...t.style}})},"VisuallyHidden")),flt=dlt,hlt=Object.defineProperty,ld=(e,t)=>hlt(e,"name",{value:t,configurable:!0});function plt(e,t){const n=p.createContext(t);n.displayName=e+"Context";const i=ld(s=>{const{children:o,...l}=s,c=p.useMemo(()=>l,Object.values(l));return a.jsx(n.Provider,{value:c,children:o})},"Provider");i.displayName=e+"Provider";function r(s,o={}){const{optional:l=!1}=o,c=p.useContext(n);if(c)return c;if(t!==void 0)return t;if(!l)throw new Error(`\`${s}\` must be used within \`${e}\``)}return ld(r,"useContext"),[i,r]}ld(plt,"createContext");function Hc(e,t=[]){let n=[];function i(s,o){const l=p.createContext(o);l.displayName=s+"Context";const c=n.length;n=[...n,o];const u=ld(f=>{var y;const{scope:h,children:m,...g}=f,b=((y=h==null?void 0:h[e])==null?void 0:y[c])||l,v=p.useMemo(()=>g,Object.values(g));return a.jsx(b.Provider,{value:v,children:m})},"Provider");u.displayName=s+"Provider";function d(f,h,m={}){var y;const{optional:g=!1}=m,b=((y=h==null?void 0:h[e])==null?void 0:y[c])||l,v=p.useContext(b);if(v)return v;if(o!==void 0)return o;if(!g)throw new Error(`\`${f}\` must be used within \`${s}\``)}return ld(d,"useContext"),[u,d]}ld(i,"createContext");const r=ld(()=>{const s=n.map(o=>p.createContext(o));return ld(function(l){const c=(l==null?void 0:l[e])||s;return p.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])},"useScope")},"createScope");return r.scopeName=e,[i,pNe(r,...t)]}ld(Hc,"createContextScope");function pNe(...e){const t=e[0];if(e.length===1)return t;const n=ld(()=>{const i=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return ld(function(s){const o=i.reduce((l,{useScope:c,scopeName:u})=>{const f=c(s)[`__scope${u}`];return{...l,...f}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}ld(pNe,"composeContextScopes");var mlt=Object.defineProperty,_o=(e,t)=>mlt(e,"name",{value:t,configurable:!0});function CV(e){const t=e+"CollectionProvider",[n,i]=Hc(t),[r,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=_o(b=>{const{scope:v,children:y}=b,w=p.useRef(null),x=p.useRef(new Map).current;return a.jsx(r,{scope:v,itemMap:x,collectionRef:w,children:y})},"CollectionProvider");o.displayName=t;const l=e+"CollectionSlot",c=Yp(l),u=p.forwardRef((b,v)=>{const{scope:y,children:w}=b,x=s(l,y),O=jr(v,x.collectionRef);return a.jsx(c,{ref:O,children:w})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",h=Yp(d),m=p.forwardRef((b,v)=>{const{scope:y,children:w,...x}=b,O=p.useRef(null),k=jr(v,O),S=s(d,y);return p.useEffect(()=>(S.itemMap.set(O,{ref:O,...x}),()=>void S.itemMap.delete(O))),a.jsx(h,{[f]:"",ref:k,children:w})});m.displayName=d;function g(b){const v=s(e+"CollectionConsumer",b);return p.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const x=Array.from(w.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((S,C)=>x.indexOf(S.ref.current)-x.indexOf(C.ref.current))},[v.collectionRef,v.itemMap])}return _o(g,"useCollection"),[{Provider:o,Slot:u,ItemSlot:m},g,i]}_o(CV,"createCollection");var lee=new WeakMap,Va,fu,G3=(fu=class extends Map{constructor(n){super(n);PG(this,Va);w5(this,Va,[...super.keys()]),lee.set(this,!0)}set(n,i){return lee.get(this)&&(this.has(n)?El(this,Va)[El(this,Va).indexOf(n)]=n:El(this,Va).push(n)),super.set(n,i),this}insert(n,i,r){const s=this.has(i),o=El(this,Va).length,l=AV(n);let c=l>=0?l:o+l;const u=c<0||c>=o?-1:c;if(u===this.size||s&&u===this.size-1||u===-1)return this.set(i,r),this;const d=this.size+(s?0:1);l<0&&c++;const f=[...El(this,Va)];let h,m=!1;for(let g=c;g=this.size&&(s=this.size-1),this.at(s)}keyFrom(n,i){const r=this.indexOf(n);if(r===-1)return;let s=r+i;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(n,i){let r=0;for(const s of this){if(Reflect.apply(n,i,[s,r,this]))return s;r++}}findIndex(n,i){let r=0;for(const s of this){if(Reflect.apply(n,i,[s,r,this]))return r;r++}return-1}filter(n,i){const r=[];let s=0;for(const o of this)Reflect.apply(n,i,[o,s,this])&&r.push(o),s++;return new fu(r)}map(n,i){const r=[];let s=0;for(const o of this)r.push([o[0],Reflect.apply(n,i,[o,s,this])]),s++;return new fu(r)}reduce(...n){const[i,r]=n;let s=0,o=r??this.at(0);for(const l of this)s===0&&n.length===1?o=l:o=Reflect.apply(i,this,[o,l,s,this]),s++;return o}reduceRight(...n){const[i,r]=n;let s=r??this.at(-1);for(let o=this.size-1;o>=0;o--){const l=this.at(o);o===this.size-1&&n.length===1?s=l:s=Reflect.apply(i,this,[s,l,o,this])}return s}toSorted(n){const i=[...this.entries()].sort(n);return new fu(i)}toReversed(){const n=new fu;for(let i=this.size-1;i>=0;i--){const r=this.keyAt(i),s=this.get(r);n.set(r,s)}return n}toSpliced(...n){const i=[...this.entries()];return i.splice(...n),new fu(i)}slice(n,i){const r=new fu;let s=this.size-1;if(n===void 0)return r;n<0&&(n=n+this.size),i!==void 0&&i>0&&(s=i-1);for(let o=n;o<=s;o++){const l=this.keyAt(o),c=this.get(l);r.set(l,c)}return r}every(n,i){let r=0;for(const s of this){if(!Reflect.apply(n,i,[s,r,this]))return!1;r++}return!0}some(n,i){let r=0;for(const s of this){if(Reflect.apply(n,i,[s,r,this]))return!0;r++}return!1}},Va=new WeakMap,_o(fu,"OrderedDict"),fu);function vN(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=mNe(e,t);return n===-1?void 0:e[n]}_o(vN,"at");function mNe(e,t){const n=e.length,i=AV(t),r=i>=0?i:n+i;return r<0||r>=n?-1:r}_o(mNe,"toSafeIndex");function AV(e){return e!==e||e===0?0:Math.trunc(e)}_o(AV,"toSafeInteger");function glt(e){const t=e+"CollectionProvider",[n,i]=Hc(t),[r,s]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new G3,setItemMap:_o(()=>{},"setItemMap")}),o=_o(({state:x,...O})=>x?a.jsx(c,{...O,state:x}):a.jsx(l,{...O}),"CollectionProvider");o.displayName=t;const l=_o(x=>{const O=v();return a.jsx(c,{...x,state:O})},"CollectionInit");l.displayName=t+"Init";const c=_o(x=>{const{scope:O,children:k,state:S}=x,C=p.useRef(null),[E,j]=p.useState(null),T=jr(C,j),[R,A]=S;return p.useEffect(()=>{if(!E)return;const N=yNe(()=>{});return N.observe(E,{childList:!0,subtree:!0}),()=>{N.disconnect()}},[E]),a.jsx(r,{scope:O,itemMap:R,setItemMap:A,collectionRef:T,collectionRefObject:C,collectionElement:E,children:k})},"CollectionProviderImpl");c.displayName=t+"Impl";const u=e+"CollectionSlot",d=Yp(u),f=p.forwardRef((x,O)=>{const{scope:k,children:S}=x,C=s(u,k),E=jr(O,C.collectionRef);return a.jsx(d,{ref:E,children:S})});f.displayName=u;const h=e+"CollectionItemSlot",m="data-radix-collection-item",g=Yp(h),b=p.forwardRef((x,O)=>{const{scope:k,children:S,...C}=x,E=p.useRef(null),[j,T]=p.useState(null),R=jr(O,E,T),A=s(h,k),{setItemMap:N}=A,P=p.useRef(C);gNe(P.current,C)||(P.current=C);const I=P.current;return p.useEffect(()=>{const D=I;return N(_=>j?_.has(j)?_.set(j,{...D,element:j}).toSorted(pB):(_.set(j,{...D,element:j}),_.toSorted(pB)):_),()=>{N(_=>!j||!_.has(j)?_:(_.delete(j),new G3(_)))}},[j,I,N]),a.jsx(g,{[m]:"",ref:R,children:S})});b.displayName=h;function v(){return p.useState(new G3)}_o(v,"useInitCollection");function y(x){const{itemMap:O}=s(e+"CollectionConsumer",x);return O}return _o(y,"useCollection"),[{Provider:o,Slot:f,ItemSlot:b},{createCollectionScope:i,useCollection:y,useInitCollection:v}]}_o(glt,"createCollection");function gNe(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}_o(gNe,"shallowEqual");function bNe(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}_o(bNe,"isElementPreceding");function pB(e,t){return!e[1].element||!t[1].element?0:bNe(e[1].element,t[1].element)?-1:1}_o(pB,"sortByDocumentPosition");function yNe(e){return new MutationObserver(n=>{for(const i of n)if(i.type==="childList"){e();return}})}_o(yNe,"getChildListObserver");var blt=Object.defineProperty,V1=(e,t)=>blt(e,"name",{value:t,configurable:!0}),vNe=!!(typeof window<"u"&&window.document&&window.document.createElement);function Un(e,t,{checkForDefaultPrevented:n=!0}={}){return V1(function(r){if(e==null||e(r),n===!1||!r||!r.defaultPrevented)return t==null?void 0:t(r)},"handleEvent")}V1(Un,"composeEventHandlers");function ylt(e){var t;if(!vNe)throw new Error("Cannot access window outside of the DOM");return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)??window}V1(ylt,"getOwnerWindow");function mB(e){if(!vNe)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}V1(mB,"getOwnerDocument");function xNe(e,t=!1){const{activeElement:n}=mB(e);if(!(n!=null&&n.nodeName))return null;if(wNe(n)&&n.contentDocument)return xNe(n.contentDocument.body,t);if(t){const i=n.getAttribute("aria-activedescendant");if(i){const r=mB(n).getElementById(i);if(r)return r}}return n}V1(xNe,"getActiveElement");function wNe(e){return e.tagName==="IFRAME"}V1(wNe,"isFrame");var wd=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},vlt=Object.defineProperty,xlt=(e,t)=>vlt(e,"name",{value:t,configurable:!0}),cee=j0[" useEffectEvent ".trim().toString()],uee=j0[" useInsertionEffect ".trim().toString()];function ONe(e){if(typeof cee=="function")return cee(e);const t=p.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof uee=="function"?uee(()=>{t.current=e}):wd(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var i;return(i=t.current)==null?void 0:i.call(t,...n)},[])}xlt(ONe,"useEffectEvent");var wlt=Object.defineProperty,zA=(e,t)=>wlt(e,"name",{value:t,configurable:!0}),Olt=j0[" useInsertionEffect ".trim().toString()]||wd;function Nd({prop:e,defaultProp:t,onChange:n=zA(()=>{},"onChange"),caller:i}){const[r,s,o]=kNe({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:r,u=p.useCallback(d=>{var f;if(l){const h=SNe(d)?d(e):d;h!==e&&((f=o.current)==null||f.call(o,h))}else s(d)},[l,e,s,o]);return[c,u]}zA(Nd,"useControllableState");function kNe({defaultProp:e,onChange:t}){const[n,i]=p.useState(e),r=p.useRef(n),s=p.useRef(t);return Olt(()=>{s.current=t},[t]),p.useEffect(()=>{var o;r.current!==n&&((o=s.current)==null||o.call(s,n),r.current=n)},[n,r]),[n,i,s]}zA(kNe,"useUncontrolledState");function SNe(e){return typeof e=="function"}zA(SNe,"isFunction");var dee=Symbol("RADIX:SYNC_STATE");function klt(e,t,n,i){const{prop:r,defaultProp:s,onChange:o,caller:l}=t,c=r!==void 0,u=ONe(o),d=[{...n,state:s}];i&&d.push(i);const[f,h]=p.useReducer((v,y)=>{if(y.type===dee)return{...v,state:y.state};const w=e(v,y);return c&&!Object.is(w.state,v.state)&&u(w.state),w},...d),m=f.state,g=p.useRef(m);p.useEffect(()=>{g.current!==m&&(g.current=m,c||u(m))},[m,g,c]);const b=p.useMemo(()=>r!==void 0?{...f,state:r}:f,[f,r]);return p.useEffect(()=>{c&&!Object.is(r,f.state)&&h({type:dee,state:r})},[r,f.state,c]),[b,h]}zA(klt,"useControllableStateReducer");var Slt=Object.defineProperty,Zp=(e,t)=>Slt(e,"name",{value:t,configurable:!0});function ENe(e,t){return p.useReducer((n,i)=>t[n][i]??n,e)}Zp(ENe,"useStateMachine");var Th=Zp(e=>{const{present:t,children:n}=e,i=CNe(t),r=typeof n=="function"?n({present:i.isPresent}):p.Children.only(n),s=ANe(i.ref,TNe(r));return typeof n=="function"||i.isPresent?p.cloneElement(r,{ref:s}):null},"Presence");function CNe(e){const[t,n]=p.useState(),i=p.useRef(null),r=p.useRef(e),s=p.useRef("none"),o=p.useRef(void 0),l=e?"mounted":"unmounted",[c,u]=ENe(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{c==="mounted"?(s.current=o.current??ix(i.current),o.current=void 0):s.current="none"},[c]),wd(()=>{const d=i.current,f=r.current;if(f!==e){const m=s.current,g=ix(d);e?(o.current=g,u("MOUNT")):g==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(f&&m!==g?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,u]),wd(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,h=Zp(g=>{const v=ix(i.current).includes(CSS.escape(g.animationName));if(g.target===t&&v&&(u("ANIMATION_END"),!r.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},"handleAnimationEnd"),m=Zp(g=>{g.target===t&&(s.current=ix(i.current))},"handleAnimationStart");return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:p.useCallback(d=>{if(d){const f=getComputedStyle(d);i.current=f,o.current=ix(f)}else i.current=null;n(d)},[])}}Zp(CNe,"usePresence");function gB(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Zp(gB,"setRef");function ANe(...e){const t=p.useRef(e);return t.current=e,p.useCallback(n=>{const i=t.current;let r=!1;const s=i.map(o=>{const l=gB(o,n);return!r&&typeof l=="function"&&(r=!0),l});if(r)return()=>{for(let o=0;oElt(e,"name",{value:t,configurable:!0}),Alt=j0[" useId ".trim().toString()]||(()=>{}),Tlt=0;function nb(e){const[t,n]=p.useState(Alt());return wd(()=>{e||n(i=>i??String(Tlt++))},[e]),e||(t?`radix-${t}`:"")}Clt(nb,"useId");var _lt=Object.defineProperty,jlt=(e,t)=>_lt(e,"name",{value:t,configurable:!0}),Nlt=p.createContext(void 0);function VA(e){const t=p.useContext(Nlt);return e||t||"ltr"}jlt(VA,"useDirection");var Rlt=Object.defineProperty,Ilt=(e,t)=>Rlt(e,"name",{value:t,configurable:!0});function wf(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var i;return(i=t.current)==null?void 0:i.call(t,...n)},[])}Ilt(wf,"useCallbackRef");var Plt=Object.defineProperty,Ao=(e,t)=>Plt(e,"name",{value:t,configurable:!0}),bB="dismissableLayer.update",Dlt="dismissableLayer.pointerDownOutside",Mlt="dismissableLayer.focusOutside",fee,_Ne=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),TV=p.forwardRef(Ao(function(t,n){const{disableOutsidePointerEvents:i=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:c,onDismiss:u,...d}=t,f=p.useContext(_Ne),[h,m]=p.useState(null),g=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=p.useState({}),v=jr(n,m),y=Array.from(f.layers),[w]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),x=w?y.indexOf(w):-1,O=h?y.indexOf(h):-1,k=f.layersWithOutsidePointerEventsDisabled.size>0,S=O>=x,C=p.useRef(!1),E=jNe(A=>{o==null||o(A),c==null||c(A),A.defaultPrevented||u==null||u()},{ownerDocument:g,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:f.dismissableSurfaces,shouldHandlePointerDownOutside:p.useCallback(A=>{if(!(A instanceof Node))return!1;const N=[...f.branches].some(P=>P.contains(A));return S&&!N},[f.branches,S])}),j=NNe(A=>{if(r&&C.current)return;const N=A.target;[...f.branches].some(I=>I.contains(N))||(l==null||l(A),c==null||c(A),A.defaultPrevented||u==null||u())},g),T=h?O===y.length-1:!1,R=wf(A=>{A.key==="Escape"&&(s==null||s(A),!A.defaultPrevented&&u&&(A.preventDefault(),u()))});return p.useEffect(()=>{if(T)return g.addEventListener("keydown",R,{capture:!0}),()=>g.removeEventListener("keydown",R,{capture:!0})},[g,T,R]),p.useEffect(()=>{if(h)return i&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(fee=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),yB(),()=>{i&&(f.layersWithOutsidePointerEventsDisabled.delete(h),f.layersWithOutsidePointerEventsDisabled.size===0&&(g.body.style.pointerEvents=fee))}},[h,g,i,f]),p.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),yB())},[h,f]),p.useEffect(()=>{const A=Ao(()=>b({}),"handleUpdate");return document.addEventListener(bB,A),()=>document.removeEventListener(bB,A)},[]),a.jsx(Zr.div,{...d,ref:v,style:{pointerEvents:k?S?"auto":"none":void 0,...t.style},onFocusCapture:Un(t.onFocusCapture,j.onFocusCapture),onBlurCapture:Un(t.onBlurCapture,j.onBlurCapture),onPointerDownCapture:Un(t.onPointerDownCapture,E.onPointerDownCapture)})},"DismissableLayer"));function Llt(){const e=p.useContext(_Ne),[t,n]=p.useState(null);return p.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Ao(Llt,"useDismissableLayerSurface");var $lt=Ao(()=>!0,"IS_TRUE");function jNe(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:r,dismissableSurfaces:s,shouldHandlePointerDownOutside:o=$lt}=t,l=wf(e),c=p.useRef(!1),u=p.useRef(!1),d=p.useRef(new Map),f=p.useRef(()=>{});return p.useEffect(()=>{function h(){u.current=!1,r.current=!1,d.current.clear()}Ao(h,"resetOutsideInteraction");function m(){return Array.from(d.current.values()).some(Boolean)}Ao(m,"isOutsideInteractionIntercepted");function g(x){if(!u.current)return;const O=x.target;O instanceof Node&&[...s].some(S=>S.contains(O))||d.current.set(x.type,!0),x.type==="click"&&window.setTimeout(()=>{u.current&&f.current()},0)}Ao(g,"handleInteractionCapture");function b(x){u.current&&d.current.set(x.type,!1)}Ao(b,"handleInteractionBubble");const v=Ao(x=>{if(x.target&&!c.current){let O=function(){n.removeEventListener("click",f.current);const S=m();h(),S||_V(Dlt,l,k,{discrete:!0})};if(Ao(O,"handleAndDispatchPointerDownOutsideEvent"),!o(x.target)){n.removeEventListener("click",f.current),h(),c.current=!1;return}const k={originalEvent:x};u.current=!0,r.current=i&&x.button===0,d.current.clear(),!i||x.button!==0?O():(n.removeEventListener("click",f.current),f.current=O,n.addEventListener("click",f.current,{once:!0}))}else n.removeEventListener("click",f.current),h();c.current=!1},"handlePointerDown"),y=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const x of y)n.addEventListener(x,g,!0),n.addEventListener(x,b);const w=window.setTimeout(()=>{n.addEventListener("pointerdown",v)},0);return()=>{window.clearTimeout(w),n.removeEventListener("pointerdown",v),n.removeEventListener("click",f.current);for(const x of y)n.removeEventListener(x,g,!0),n.removeEventListener(x,b)}},[n,l,i,r,s,o]),{onPointerDownCapture:Ao(()=>c.current=!0,"onPointerDownCapture")}}Ao(jNe,"usePointerDownOutside");function NNe(e,t=globalThis==null?void 0:globalThis.document){const n=wf(e),i=p.useRef(!1);return p.useEffect(()=>{const r=Ao(s=>{s.target&&!i.current&&_V(Mlt,n,{originalEvent:s},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:Ao(()=>i.current=!0,"onFocusCapture"),onBlurCapture:Ao(()=>i.current=!1,"onBlurCapture")}}Ao(NNe,"useFocusOutside");function yB(){const e=new CustomEvent(bB);document.dispatchEvent(e)}Ao(yB,"dispatchUpdate");function _V(e,t,n,{discrete:i}){const r=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),i?EV(r,s):r.dispatchEvent(s)}Ao(_V,"handleAndDispatchCustomEvent");var Flt=Object.defineProperty,ac=(e,t)=>Flt(e,"name",{value:t,configurable:!0}),X3="focusScope.autoFocusOnMount",Y3="focusScope.autoFocusOnUnmount",hee={bubbles:!1,cancelable:!0},RNe=p.forwardRef(ac(function(t,n){const{loop:i=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...l}=t,[c,u]=p.useState(null),d=wf(s),f=wf(o),h=p.useRef(null),m=jr(n,u),g=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let v=function(O){if(g.paused||!c)return;const k=O.target;c.contains(k)?h.current=k:fp(h.current,{select:!0})},y=function(O){if(g.paused||!c)return;const k=O.relatedTarget;k!==null&&(c.contains(k)||fp(h.current,{select:!0}))},w=function(O){if(document.activeElement===document.body)for(const S of O)S.removedNodes.length>0&&fp(c)};ac(v,"handleFocusIn"),ac(y,"handleFocusOut"),ac(w,"handleMutations"),document.addEventListener("focusin",v),document.addEventListener("focusout",y);const x=new MutationObserver(w);return c&&x.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",y),x.disconnect()}}},[r,c,g.paused]),p.useEffect(()=>{if(c){pee.add(g);const v=document.activeElement;if(!c.contains(v)){const w=new CustomEvent(X3,hee);c.addEventListener(X3,d),c.dispatchEvent(w),w.defaultPrevented||(INe($Ne(jV(c)),{select:!0}),document.activeElement===v&&fp(c))}return()=>{c.removeEventListener(X3,d),setTimeout(()=>{const w=new CustomEvent(Y3,hee);c.addEventListener(Y3,f),c.dispatchEvent(w),w.defaultPrevented||fp(v??document.body,{select:!0}),c.removeEventListener(Y3,f),pee.remove(g)},0)}}},[c,d,f,g]);const b=p.useCallback(v=>{if(!i&&!r||g.paused)return;const y=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,w=document.activeElement;if(y&&w){const x=v.currentTarget,[O,k]=PNe(x);O&&k?!v.shiftKey&&w===k?(v.preventDefault(),i&&fp(O,{select:!0})):v.shiftKey&&w===O&&(v.preventDefault(),i&&fp(k,{select:!0})):w===x&&v.preventDefault()}},[i,r,g.paused]);return a.jsx(Zr.div,{tabIndex:-1,...l,ref:m,onKeyDown:b})},"FocusScope"));function INe(e,{select:t=!1}={}){const n=document.activeElement;for(const i of e)if(fp(i,{select:t}),document.activeElement!==n)return}ac(INe,"focusFirst");function PNe(e){const t=jV(e),n=vB(t,e),i=vB(t.reverse(),e);return[n,i]}ac(PNe,"getTabbableEdges");function jV(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:ac(i=>{const r=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||r?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}ac(jV,"getTabbableCandidates");function vB(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const i of e)if(!(n?!i.checkVisibility({checkVisibilityCSS:!0}):DNe(i,{upTo:t})))return i}ac(vB,"findVisible");function DNe(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}ac(DNe,"isHidden");function MNe(e){return e instanceof HTMLInputElement&&"select"in e}ac(MNe,"isSelectableInput");function fp(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&MNe(e)&&t&&e.select()}}ac(fp,"focus");var pee=LNe();function LNe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=xB(e,t),e.unshift(t)},remove(t){var n;e=xB(e,t),(n=e[0])==null||n.resume()}}}ac(LNe,"createFocusScopesStack");function xB(e,t){const n=[...e],i=n.indexOf(t);return i!==-1&&n.splice(i,1),n}ac(xB,"arrayRemove");function $Ne(e){return e.filter(t=>t.tagName!=="A")}ac($Ne,"removeLinks");var Blt=Object.defineProperty,Ult=(e,t)=>Blt(e,"name",{value:t,configurable:!0}),NV=p.forwardRef(Ult(function(t,n){var c;const{container:i,...r}=t,[s,o]=p.useState(!1);wd(()=>o(!0),[]);const l=i||s&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return l?vi.createPortal(a.jsx(Zr.div,{...r,ref:n}),l):null},"Portal")),Qlt=Object.defineProperty,RV=(e,t)=>Qlt(e,"name",{value:t,configurable:!0}),l_=0,Bf=null;function zlt(e){return iM(),e.children}RV(zlt,"FocusGuards");function iM(){p.useEffect(()=>{Bf||(Bf={start:wB(),end:wB()});const{start:e,end:t}=Bf;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),l_++,()=>{l_===1&&(Bf==null||Bf.start.remove(),Bf==null||Bf.end.remove(),Bf=null),l_=Math.max(0,l_-1)}},[])}RV(iM,"useFocusGuards");function wB(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}RV(wB,"createFocusGuard");var Yf=function(){return Yf=Object.assign||function(t){for(var n,i=1,r=arguments.length;i"u")return act;var t=oct(e),n=document.documentElement.clientWidth,i=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,i-n+t[2]-t[0])}},cct=QNe(),aw="data-scroll-locked",uct=function(e,t,n,i){var r=e.left,s=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),` + */const Do=An("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),XJ=Object.freeze({totalTokenCount:0,promptTokenCount:0,candidatesTokenCount:0,thoughtsTokenCount:0,cachedContentTokenCount:0}),rE=Object.freeze({modelName:"",current:XJ,cumulative:XJ}),Jat={totalTokenCount:"total_token_count",promptTokenCount:"prompt_token_count",candidatesTokenCount:"candidates_token_count",thoughtsTokenCount:"thoughts_token_count",cachedContentTokenCount:"cached_content_token_count"},eot=24,tot=64,not=16;function a_(e){var l,c;const t=e.trim();if(!t)return 0;const n=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/gu,i=((l=t.match(n))==null?void 0:l.length)??0,r=t.replace(n," "),s=(r.match(/[A-Za-z0-9_]+/g)??[]).reduce((u,d)=>u+Math.max(1,Math.ceil(d.length/4)),0),o=((c=r.match(/[^\sA-Za-z0-9_]/g))==null?void 0:c.length)??0;return i+s+o}function iot(e){var l,c,u;const t=((l=e.instruction)==null?void 0:l.trim())??"",n=((c=e.tools)==null?void 0:c.filter(d=>d.trim()))??[],i=((u=e.skills)==null?void 0:u.filter(d=>d.name.trim()))??[],r=a_(t),s=n.reduce((d,f)=>d+tot+a_(f),0),o=i.reduce((d,f)=>d+not+a_(f.name)+a_(f.description??""),0);return eot+r+s+o}function rot({usage:e,contextWindow:t,estimatedSystemTokens:n}){const i=Math.max(1,Math.round(t)),r=Math.max(0,e.current.promptTokenCount),s=Math.max(r,e.current.totalTokenCount),o=Math.min(i,r>0?Math.min(r,Math.max(0,n??0)):Math.max(0,n??0)),l=Math.max(0,r-o),c=r>0?Math.max(0,s-r):Math.max(0,s),u=r>0?s:o+c;return{systemTokens:o,inputTokens:l,outputTokens:c,remainingTokens:Math.max(0,i-u),usedTokens:u,contextWindow:i}}function sot(e){const t=[{kind:"system",tokens:e.systemTokens},{kind:"input",tokens:e.inputTokens},{kind:"output",tokens:e.outputTokens},{kind:"remaining",tokens:e.remainingTokens}],n=e.contextWindow/100;let i=0;const r=t.map(s=>{const o=i;return i+=s.tokens,{...s,start:o,end:i}});return Array.from({length:100},(s,o)=>{const l=o*n,c=l+n,u=r.flatMap(d=>{const f=Math.max(0,Math.min(c,d.end)-Math.max(l,d.start));return f>0?[{kind:d.kind,share:f/n}]:[]});return{index:o,slices:u}})}function dk(e,t){const n=e,i=n[t]??n[Jat[t]];return typeof i=="number"&&Number.isFinite(i)&&i>0?Math.round(i):0}function aot(e){const t=dk(e,"promptTokenCount"),n=dk(e,"candidatesTokenCount"),i=dk(e,"thoughtsTokenCount");return{totalTokenCount:dk(e,"totalTokenCount")||t+n+i,promptTokenCount:t,candidatesTokenCount:n,thoughtsTokenCount:i,cachedContentTokenCount:dk(e,"cachedContentTokenCount")}}function oot(e,t){return{totalTokenCount:e.totalTokenCount+t.totalTokenCount,promptTokenCount:e.promptTokenCount+t.promptTokenCount,candidatesTokenCount:e.candidatesTokenCount+t.candidatesTokenCount,thoughtsTokenCount:e.thoughtsTokenCount+t.thoughtsTokenCount,cachedContentTokenCount:e.cachedContentTokenCount+t.cachedContentTokenCount}}function yV(e,t){if(!t)return e;const n=typeof t.modelVersion=="string"?t.modelVersion.trim():"",i=typeof t.model_version=="string"?t.model_version.trim():"",r=n||i||e.modelName,s=t.usageMetadata??t.usage_metadata;if(!s)return r===e.modelName?e:{...e,modelName:r};const o=aot(s);return o.totalTokenCount===0?r===e.modelName?e:{...e,modelName:r}:{modelName:r,current:o,cumulative:oot(e.cumulative,o)}}function YJ(e){return e.reduce((t,n)=>yV(t,n),rE)}function ZJ(e){return e.blocks.flatMap(t=>t.kind==="tool"?[{name:t.name,args:t.args,response:t.response,done:t.done}]:[])}function lot(e){const t=e.attributes;return String(t["invocation.id"]??t["gen_ai.invocation.id"]??t["gcp.vertex.agent.invocation_id"]??"")}function cot(e,t){if(!t)return e;const n=new Set(e.filter(r=>lot(r)===t).map(r=>r.trace_id)),i=e.filter(r=>n.has(r.trace_id));return i.length>0?i:e}function m0(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function gg(e){return typeof e=="string"?e:""}function zje(e,t){return e==="pending"||e==="running"||e==="completed"||e==="failed"?e:t}function uot(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return{}}const n=m0(t)??{};return m0(n.result)??n}function dot(e){var n;const t=(n=m0(e))==null?void 0:n.branches;return Array.isArray(t)?t.map(i=>{var r;return gg((r=m0(i))==null?void 0:r.label)}):[]}function Vje(e,t,n){const i=dot(e),r=uot(t),s=Array.isArray(r.branches)?r.branches:[],o=n==="running"?"running":"pending";return{branches:[0,1].map(c=>{const u=m0(s[c])??{};return{label:gg(u.label)||i[c]||`方向 ${c+1}`,content:gg(u.content),status:zje(u.status,o),error:gg(u.error)}})}}function fot(e){const t=m0(e),n=m0(t==null?void 0:t.veadkStudioToolProgress);return!n||n.toolName!=="branch_compare"||typeof n.branchIndex!="number"||n.branchIndex<0||n.branchIndex>1?null:{toolName:"branch_compare",requestId:gg(n.requestId),branchIndex:n.branchIndex,label:gg(n.label),delta:gg(n.delta),status:zje(n.status,"running"),error:gg(n.error)||void 0}}function hot(e,t,n){return{branches:Vje(e,t,"running").branches.map((s,o)=>o===n.branchIndex?{...s,label:n.label||s.label,content:s.content+n.delta,status:n.status,error:n.error??s.error}:s)}}function Ko(e,t){return bn.t(`blocks.codexProgress.${e}`,{ns:"conversation",...t})}const Hje=28e4;function JJ(e){try{return JSON.stringify(e).length}catch{return Hje}}function pot(e){const t=e.slice(-200);let n=t.reduce((i,r)=>i+JJ(r),0);for(;t.length>1&&n>Hje;)n-=JJ(t.shift());return t}function wu(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Ji(e){return typeof e=="string"?e:""}function vV(e,t=""){const n=Ji(e).toLowerCase();return t.endsWith(".failed")||["failed","error","declined","cancelled"].includes(n)?"failed":t.endsWith(".completed")||["completed","done","success"].includes(n)?"completed":"running"}function qje(e){if(e.response!==void 0)return e.response;if(e.result!==void 0)return e.result;const t=e.aggregatedOutput??e.aggregated_output??e.output,n=e.exitCode??e.exit_code;if(!(t===void 0&&n===void 0))return{...t!==void 0?{output:t}:{},...n!==void 0?{exitCode:n}:{}}}function Wje(e){if(e.args!==void 0)return e.args;if(e.arguments!==void 0)return e.arguments;if(e.input!==void 0)return e.input;const t=Ji(e.command),n=Ji(e.cwd);if(t||n)return{...t?{command:t}:{},...n?{cwd:n}:{}};if(e.changes!==void 0)return{changes:e.changes};if(e.approval!==void 0)return e.approval}function py(e,t,n,i,r){return{kind:"tool",name:e,callId:t,args:i,response:r,done:n!=="running",status:n,...n==="failed"?{defaultOpen:!0}:{}}}function Kje(e){const t=Ji(e.id||e.itemId||e.item_id),n=Ji(e.kind);if(!t||!n)return null;const i=vV(e.status),r=Ji(e.text||e.detail||e.delta),s=!Ji(e.text||e.detail)&&typeof e.delta=="string";if(n==="thinking"||n==="reasoning")return r?{id:t,block:{kind:"thinking",text:r,done:i!=="running",thoughtKind:n==="reasoning"?"reasoning":"thought"},appendText:s}:null;if(n==="commentary")return r?{id:t,block:{kind:"text",text:r},appendText:s}:null;if(["message","text","assistant_final","final"].includes(n))return r?{id:t,block:{kind:"text",text:r},appendText:s,finalAnswer:!0}:null;if(n==="plan"){const o=Array.isArray(e.plan)?e.plan:[];return{id:t,block:{kind:"plan",title:Ji(e.title)||Ko("planTitle"),summary:r||void 0,items:o.flatMap(l=>{const c=wu(l),u=Ji(c==null?void 0:c.text);if(!u)return[];const d=Ji(c==null?void 0:c.status);return[{text:u,status:["pending","in_progress","completed","failed"].includes(d)?d:"pending"}]}),done:i!=="running"}}}if(["tool","command","command_execution","commandExecution","file_change","fileChange","mcp_tool_call","mcpToolCall","collab_tool_call","web_search","approval","status"].includes(n)){const o=Ko(n==="file_change"||n==="fileChange"?"fallback.fileChange":n==="approval"?"fallback.approval":n==="status"?"fallback.status":"fallback.command"),l=Wje(e),c=qje(e)??(n==="status"&&r||void 0);return{id:t,block:py(Ji(e.name||e.title)||o,t,i,l,c)}}return null}function Gje(e){const t=Ji(e.type),n=wu(e.item),i=Ji(n==null?void 0:n.type),r=Ji((n==null?void 0:n.id)||e.id)||(t==="turn.failed"?"turn":"");if(!r)return null;const s=vV(n==null?void 0:n.status,t);if(i==="reasoning"||i==="agent_message"){const o=Ji(n==null?void 0:n.text);return o?{id:r,block:i==="reasoning"?{kind:"thinking",text:o,done:s!=="running",thoughtKind:"reasoning"}:{kind:"text",text:o},...i==="agent_message"&&(n==null?void 0:n.phase)!=="commentary"?{finalAnswer:!0}:{}}:null}if(i==="todo_list"){const l=(Array.isArray(n==null?void 0:n.items)?n.items:[]).flatMap(c=>{const u=wu(c),d=Ji(u==null?void 0:u.text);if(!d)return[];const f=Ji(u==null?void 0:u.status).toLowerCase(),h=(u==null?void 0:u.completed)===!0||["completed","done"].includes(f)?"completed":["failed","error"].includes(f)?"failed":["in_progress","running"].includes(f)?"in_progress":"pending";return[{text:d,status:h}]});return l.length?{id:r,block:{kind:"plan",title:Ko("planTitle"),summary:Ko("planSummary",{completed:l.filter(c=>c.status==="completed").length,total:l.length}),items:l,done:s!=="running"}}:null}if(i==="command_execution"){const o=Ko(`command.${s}`);return{id:r,block:py(o,r,s,Wje(n??{}),qje(n??{}))}}if(i==="file_change"){const o=Array.isArray(n==null?void 0:n.changes)?n.changes:[],l=o.length?Ko("projectFiles",{count:o.length}):Ko("projectFile"),c=Ko(`fileChange.${s}`,{subject:l});return{id:r,block:py(c,r,s,o.length?{changes:o}:void 0)}}if(i==="mcp_tool_call"){const o=[Ji(n==null?void 0:n.server),Ji(n==null?void 0:n.tool)].filter(Boolean).join("/")||Ko("externalTool"),l=Ko(`mcp.${s}`,{tool:o}),c=wu(n==null?void 0:n.error),u=(n==null?void 0:n.result)!==void 0?n.result:Ji(c==null?void 0:c.message)||void 0;return{id:r,block:py(l,r,s,n==null?void 0:n.arguments,u)}}if(i==="collab_tool_call"){const o=Ji(n==null?void 0:n.tool),l=["spawn_agent","send_input","wait","close_agent"].includes(o)?o:"default",c=Ko(`collaboration.${l}.${s}`),u=Object.fromEntries(["tool","receiver_thread_ids","prompt"].filter(d=>(n==null?void 0:n[d])!==void 0).map(d=>[d,n==null?void 0:n[d]]));return{id:r,block:py(c,r,s,Object.keys(u).length?u:void 0,n==null?void 0:n.agents_states)}}if(i==="web_search"){const o=Ko(`webSearch.${s}`),l=Object.fromEntries(["query","action"].filter(c=>(n==null?void 0:n[c])!==void 0).map(c=>[c,n==null?void 0:n[c]]));return{id:r,block:py(o,r,s,Object.keys(l).length?l:void 0)}}if(i==="error"||t==="error"||t==="turn.failed"){const o=wu(e.error),l=Ji((n==null?void 0:n.message)||e.message||(o==null?void 0:o.message))||Ko("errorDetail");return{id:r,block:py(Ko("errorTitle"),r,"failed",void 0,l)}}return null}function mot(e){const t=wu(e),n=wu(t==null?void 0:t.veadkStudioToolProgress);if(!n||n.kind!=="codex")return null;const i=Ji(n.toolName),r=Ji(n.requestId);if(!i||!r)return null;const s=wu(n.event??n.activity);if(!s)return null;const o=wu(s.item)||Ji(s.type)?Gje(s):Kje(s);if(!o)return null;const l=Ji(n.title||n.label),c=Ji(s.agentSessionId??s.agent_session_id),u=Ji(s.sandboxSessionId??s.sandbox_session_id),d=Ji(s.threadId??s.thread_id),f=vV(s.status,Ji(s.type)),m=Ji(s.kind)==="status"&&f!=="running"?f:void 0;return{toolName:i,requestId:r,...l?{title:l}:{},...c?{agentSessionId:c}:{},...u?{sandboxSessionId:u}:{},...d?{threadId:d}:{},...m?{terminalStatus:m}:{},event:o}}function got(e,t){const n=wu(t),i=wu((n==null?void 0:n.codexActivity)??(n==null?void 0:n.codex_activity));if(!i)return e;const r=Ji(i.title)||(e==null?void 0:e.title)||"Codex Sandbox",s=Ji(i.agentSessionId??i.agent_session_id)||(e==null?void 0:e.agentSessionId),o=Ji(i.sandboxSessionId??i.sandbox_session_id)||(e==null?void 0:e.sandboxSessionId),l=Ji(i.threadId??i.thread_id)||(e==null?void 0:e.threadId);let c={title:r,...s?{agentSessionId:s}:{},...o?{sandboxSessionId:o}:{},...l?{threadId:l}:{},items:(e==null?void 0:e.items.slice())??[]};const u=Array.isArray(i.events)?i.events:[];for(const d of u){const f=wu(d);if(!f)continue;const h=wu(f.item)||Ji(f.type)?Gje(f):Kje(f);h&&(h.finalAnswer||(c=lB(c,{title:r,...s?{agentSessionId:s}:{},...o?{sandboxSessionId:o}:{},...l?{threadId:l}:{},event:h})))}return c}function lB(e,t){const n=(e==null?void 0:e.items.slice())??[],i=n.findIndex(r=>r.id===t.event.id);if(i>=0){const r=n[i].block,s=t.event.block;t.event.appendText&&r.kind==="text"&&s.kind==="text"?n[i]={id:t.event.id,block:{...s,text:r.text+s.text}}:t.event.appendText&&r.kind==="thinking"&&s.kind==="thinking"?n[i]={id:t.event.id,block:{...s,text:r.text+s.text}}:n[i]={id:t.event.id,block:s}}else n.push({id:t.event.id,block:t.event.block});return{title:t.title||(e==null?void 0:e.title)||"Codex Sandbox",...t.agentSessionId||e!=null&&e.agentSessionId?{agentSessionId:t.agentSessionId||(e==null?void 0:e.agentSessionId)}:{},...t.sandboxSessionId||e!=null&&e.sandboxSessionId?{sandboxSessionId:t.sandboxSessionId||(e==null?void 0:e.sandboxSessionId)}:{},...t.threadId||e!=null&&e.threadId?{threadId:t.threadId||(e==null?void 0:e.threadId)}:{},items:pot(n)}}const cB="send_a2ui_json_to_client",uB="validated_a2ui_json",yN="adk_request_credential",Q3="transfer_to_agent";function bot(e){var i,r,s,o;const t=e,n=((i=t==null?void 0:t.exchangedAuthCredential)==null?void 0:i.oauth2)??((r=t==null?void 0:t.exchanged_auth_credential)==null?void 0:r.oauth2)??((s=t==null?void 0:t.rawAuthCredential)==null?void 0:s.oauth2)??((o=t==null?void 0:t.raw_auth_credential)==null?void 0:o.oauth2);return(n==null?void 0:n.authUri)??(n==null?void 0:n.auth_uri)}function dB(){return{blocks:[],liveStart:0,pendingCodexProgress:[]}}const yot=2048;function eee(e,t){if(t.event.finalAnswer)return"applied";let n=-1;for(let i=e.length-1;i>=0;i-=1){const r=e[i];if(!(r.kind!=="tool"||r.name!==t.toolName)){if(r.callId===t.requestId)return r.done?"completed":(r.codexActivity=lB(r.codexActivity,t),r.status=t.terminalStatus??"running",t.terminalStatus&&(r.done=!0),"applied");if(!r.done){if(n>=0)return"unmatched";n=i}}}if(n>=0){const i=e[n];return i.kind!=="tool"?"unmatched":(i.codexActivity=lB(i.codexActivity,t),i.status=t.terminalStatus??"running",t.terminalStatus&&(i.done=!0),"applied")}return"unmatched"}function vot(e){if(!e||typeof e!="object"||Array.isArray(e))return"completed";const t=e,n=typeof t.status=="string"?t.status.toLowerCase():"";return t.ok===!1||["error","failed","denied","declined","cancelled","timeout"].includes(n)?"failed":"completed"}function tee(e){if(!e||typeof e!="object"||Array.isArray(e))return"";const t=e;return t.ok!==!0||typeof t.message!="string"?"":t.message.trim()}const pC=e=>e.functionCall??e.function_call,eb=e=>e.functionResponse??e.function_response;function H1(e){const t=e.customMetadata??e.custom_metadata;return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}function xot(e,t){const n=e[t];return n&&typeof n=="object"&&!Array.isArray(n)?n:{}}function sg(e,t){const n=e[t];return typeof n=="string"?n:""}function Xje(e){return xot(H1(e),"mpa")}function xV(e){const t=H1(e),n=Xje(e);return sg(t,"eventType")||sg(t,"event_type")||sg(n,"eventType")||sg(n,"event_type")||sg(n,"kind")}function aw(e){const t=H1(e),n=Xje(e);return sg(t,"source")==="sandbox"||sg(n,"source")==="sandbox"}function Yje(e){const t=xV(e);return t==="usage.updated"||t==="usage"}function hI(e){var t;return(((t=e.content)==null?void 0:t.parts)??[]).some(n=>{const i=eb(n),r=i==null?void 0:i.response;return(i==null?void 0:i.name)==="sandbox_task"&&r&&typeof r=="object"&&!Array.isArray(r)&&r.finalAlreadyEmitted===!0})}function nee(e){for(const t of e)t.kind!=="tool"||t.name!=="sandbox_task"||t.done||(t.done=!0,t.status="completed")}function wot(e,t){if(e===t)return!0;const n=new Set(["exec_command","commandExecution","command_execution","Run command"]);return n.has(e)&&n.has(t)}function iee(e,t=!1){const n=e&&typeof e=="object"?String(e.status??"").toLowerCase():"",i=["failed","error","cancelled","denied","timeout"].includes(n)||(e==null?void 0:e.ok)===!1,r=["running","started","working"].includes(n);return{done:i||!(t||r),status:i?"failed":t||r?"running":"completed"}}function Oot(e){return e.flatMap(t=>{var n;return t.kind!=="tool"||t.name!=="delegate_to_codex_sandbox"||!((n=t.codexActivity)!=null&&n.items.length)?[t]:[{kind:"activity-source",label:t.codexActivity.title||"Codex Sandbox"},...t.codexActivity.items.map(({block:i})=>i.kind==="tool"?{...i,source:"codex-sandbox"}:i)]})}function kot(e){if(!e||typeof e!="object")return"";const t=e,n=t.agentName??t.agent_name;return typeof n=="string"?n:""}function Sot(e){return e.replace(/-/g,"+").replace(/_/g,"/")}function qA(e){const t=[];for(const[n,i]of e.entries()){const r=i.partMetadata??i.part_metadata,s=r==null?void 0:r.veadkTransport;if((s==null?void 0:s.hidden)===!0)continue;const o=r==null?void 0:r.veadkMedia;if(typeof(o==null?void 0:o.uri)=="string"){t.push({id:String(o.id??o.uri),mimeType:typeof o.mimeType=="string"?o.mimeType:void 0,uri:o.uri,name:typeof o.name=="string"?o.name:void 0,sizeBytes:typeof o.sizeBytes=="number"?o.sizeBytes:void 0});continue}const l=i.inlineData??i.inline_data;if(l&&l.data){t.push({id:`inline-${n}-${l.displayName??l.display_name??"media"}`,mimeType:l.mimeType??l.mime_type,data:Sot(l.data),name:l.displayName??l.display_name});continue}const c=i.fileData??i.file_data,u=(c==null?void 0:c.fileUri)??(c==null?void 0:c.file_uri);c&&u&&t.push({id:u,mimeType:c.mimeType??c.mime_type,uri:u,name:c.displayName??c.display_name})}return t}function Gy(e){const t=e.partMetadata??e.part_metadata,n=t==null?void 0:t.veadkTransport;return(n==null?void 0:n.hideText)===!0?void 0:e.text}const Eot=new Set(["llm","sequential","parallel","loop","a2a"]);function Cot(e){var t;for(const n of e){const i=(t=n.partMetadata??n.part_metadata)==null?void 0:t.veadkInvocation;if(!i||typeof i!="object")continue;const r=i,s=Array.isArray(r.skills)?r.skills.flatMap(c=>{if(!c||typeof c!="object")return[];const u=c;return typeof u.name=="string"?[{name:u.name,description:typeof u.description=="string"?u.description:""}]:[]}):[];let o;const l=r.targetAgent;if(l&&typeof l=="object"){const c=l,u=c.type;typeof c.name=="string"&&typeof u=="string"&&Eot.has(u)&&Array.isArray(c.path)&&(o={name:c.name,description:typeof c.description=="string"?c.description:"",type:u,path:c.path.filter(d=>typeof d=="string")})}if(s.length>0||o)return{skills:s,targetAgent:o}}}function Aot(e,t){if(!t.length)return;const n=e[e.length-1];(n==null?void 0:n.kind)==="attachment"?n.files.push(...t):e.push({kind:"attachment",files:t})}function Tot(e,t){if(!t.length)return;const n=e[e.length-1];if((n==null?void 0:n.kind)==="artifact"){for(const i of t)n.files.some(r=>r.filename===i.filename&&r.version===i.version)||n.files.push(i);return}e.push({kind:"artifact",files:t})}function z3(e,t,n,i){const r=e[e.length-1];r&&r.kind===t&&(r.kind!=="thinking"||r.thoughtKind===i)?r.text+=n:e.push(t==="thinking"?{kind:t,text:n,done:!1,thoughtKind:i}:{kind:t,text:n})}function V3(e){const t=e.customMetadata??e.custom_metadata;if(t&&typeof t=="object"){const n=t.thoughtKind;if(n==="reasoning"||n==="thought")return n}return"reasoning"}function fk(e){for(const t of e)t.kind==="thinking"&&(t.done=!0)}function Zje(e,t,n={}){var h,m,g,b,v,y;const i=e.blocks.map(w=>({...w}));let r=e.liveStart,s=e.pendingCodexProgress.slice();if(Yje(t)&&!n.mpaA2a)return{blocks:i,liveStart:r,pendingCodexProgress:s};if(hI(t))return nee(i),fk(i),{blocks:i,liveStart:r,pendingCodexProgress:s};const o=((h=t.content)==null?void 0:h.parts)??[],l=o.flatMap(w=>{const x=fot(w.partMetadata??w.part_metadata);return x?[x]:[]}),c=o.flatMap(w=>{const x=mot(w.partMetadata??w.part_metadata);return x?[x]:[]});if(l.length>0||c.length>0){for(const w of l)for(let x=i.length-1;x>=0;x-=1){const O=i[x];if(!(O.kind!=="tool"||O.done||O.name!==w.toolName||w.requestId&&O.callId&&O.callId!==w.requestId)){O.response=hot(O.args,O.response,w),O.status="running";break}}for(const w of c)eee(i,w)==="unmatched"&&(s=[...s,w].slice(-64));return{blocks:i,liveStart:r,pendingCodexProgress:s}}const u=o.some(w=>pC(w)||eb(w));if(t.partial&&!u){for(const w of o){const x=Gy(w),O=n.mpaA2a&&w.thought?sg(H1(t),"reasoningSegmentId"):"";if(O&&typeof x=="string"&&x){const k=i.find(S=>S.kind==="thinking"&&S.reasoningSegmentId===O);(k==null?void 0:k.kind)==="thinking"?k.text+=x:i.push({kind:"thinking",text:x,done:!1,thoughtKind:V3(t),reasoningSegmentId:O});continue}typeof x=="string"&&x&&z3(i,w.thought?"thinking":"text",x,w.thought?V3(t):void 0)}return{blocks:i,liveStart:r,pendingCodexProgress:s}}const d=n.mpaA2a&&!o.some(w=>w.thought&&Gy(w))?i.slice(r).filter(w=>w.kind==="thinking"):[];i.length=r,i.push(...d);for(const w of o){const x=pC(w),O=eb(w),k=qA([w]),S=Gy(w);if(typeof S=="string"&&S)z3(i,w.thought?"thinking":"text",S,w.thought?V3(t):void 0);else if(k.length)fk(i),Aot(i,k);else if(x)if(fk(i),x.name===Q3){const C=kot(x.args)||((m=t.actions)==null?void 0:m.transferToAgent)||((g=t.actions)==null?void 0:g.transfer_to_agent)||bn.t("app:common.unknownAgent");i.push({kind:"agent-transfer",agentName:C,done:!1})}else{if(x.name==="sandbox_task"&&aw(t))continue;if(x.name===yN){const C=x.args??{},E=C.authConfig??C.auth_config??C,T=String(C.functionCallId??C.function_call_id??"").replace(/^_adk_toolset_auth_/,"")||void 0;i.push({kind:"auth",callId:x.id??"",label:T,authUri:bot(E),authConfig:E,done:!1})}else{const C=x.id?[...i].reverse().find(j=>j.kind==="tool"&&j.callId===x.id):void 0;if((C==null?void 0:C.kind)==="tool"){C.name=x.name??C.name,C.args=x.args??C.args,C.response===void 0&&(C.done=!1,C.status="running");continue}const E={kind:"tool",name:x.name??"",callId:x.id,args:x.args,done:!1};if(i.push(E),E.callId){const j=[];for(const T of s)T.toolName===E.name&&T.requestId===E.callId?eee(i,T):j.push(T);s=j}}}else if(O){if(fk(i),O.name===Q3)for(let E=i.length-1;E>=0;E--){const j=i[E];if(j.kind==="agent-transfer"&&!j.done){j.done=!0;break}}if(O.name===yN)for(let E=i.length-1;E>=0;E--){const j=i[E];if(j.kind==="auth"&&!j.done){j.done=!0;break}}let C=!1;for(let E=i.length-1;E>=0;E--){const j=i[E],T=j.kind==="tool"&&j.name==="delegate_to_codex_sandbox";if(j.kind==="tool"&&(!j.done||T||O.id&&j.callId===O.id)&&(O.id&&j.callId&&j.callId===O.id||(!O.id||!j.callId)&&wot(j.name,O.name??""))){const R=T?tee(j.response):"",A=iee(O.response,t.partial===!0);if(j.done=A.done,j.response=O.response,j.status=A.status,T){j.codexActivity=got(j.codexActivity,O.response),j.status=A.status==="running"?"running":vot(O.response);const N=tee(O.response);N&&N!==R&&z3(i,"text",N)}C=!0;break}}if(!C&&O.name!==Q3&&O.name!==yN&&O.name!==cB){const E=iee(O.response,t.partial===!0);i.push({kind:"tool",name:O.name??"",callId:O.id,response:O.response,done:E.done,status:E.status})}if(O.name===cB){const E=((b=O.response)==null?void 0:b[uB])??[];if(E.length){const j=i[i.length-1];j&&j.kind==="a2ui"?j.messages.push(...E):i.push({kind:"a2ui",messages:E})}}}}const f=((v=t.actions)==null?void 0:v.artifactDelta)??((y=t.actions)==null?void 0:y.artifact_delta);return f&&Tot(i,Object.entries(f).map(([w,x])=>({filename:w,version:x}))),aw(t)&&xV(t)==="invocation.completed"&&nee(i),fk(i),r=i.length,{blocks:i,liveStart:r,pendingCodexProgress:s}}function _ot(e,t){var u,d,f,h,m,g;if(e.partial===!0)return!1;if(hI(e))return!0;const n=((u=e.content)==null?void 0:u.parts)??[],i=n.some(b=>{const v=Gy(b);return!b.thought&&typeof v=="string"&&v.trim().length>0||qA([b]).length>0}),r=n.some(b=>{var y;const v=eb(b);return(v==null?void 0:v.name)===cB&&Array.isArray((y=v.response)==null?void 0:y[uB])&&v.response[uB].length>0}),s=((d=e.actions)==null?void 0:d.artifactDelta)??((f=e.actions)==null?void 0:f.artifact_delta),o=!!(s&&Object.keys(s).length>0),l=!!(((h=e.actions)==null?void 0:h.endOfAgent)??((m=e.actions)==null?void 0:m.end_of_agent)??((g=e.actions)==null?void 0:g.escalate)),c=t.some(b=>b.kind==="text"||b.kind==="attachment"||b.kind==="artifact"||b.kind==="a2ui"||b.kind==="delivery");return i||r||o||l&&c}function Jje(e){var n;const t=(n=e.customMetadata??e.custom_metadata)==null?void 0:n.a2aStatus;return typeof t=="string"?t:void 0}function ree(e){var n,i,r;if(Jje(e))return!0;const t=((n=e.actions)==null?void 0:n.artifactDelta)??((i=e.actions)==null?void 0:i.artifact_delta);return t&&Object.keys(t).length>0?!0:(((r=e.content)==null?void 0:r.parts)??[]).some(s=>!!(Gy(s)||qA([s]).length>0||pC(s)||eb(s)))}function jot(e,t){var o;const n=H1(t),i=((o=t.content)==null?void 0:o.parts)??[];if(t.partial!==!1||n.projectionSource!=="a2a-artifact"||aw(t)||!i.length||t.actions||!i.every(l=>l.thought&&typeof l.text=="string"&&!pC(l)&&!eb(l)&&qA([l]).length===0))return e;const r=e.blocks[e.blocks.length-1],s=i.map(l=>l.text).join("").trim();return(r==null?void 0:r.kind)!=="thinking"||!r.text.trim()||!s.startsWith(r.text.trim())?e:{...e,liveStart:e.blocks.length-1}}function Not(e,t,n,i){const r=e[t];if(!r||r.role!=="assistant"||i.turnIsStreaming||n(r))return!1;if(!i.mpaA2a)return!0;let s=t;for(;s>0&&e[s-1].role!=="user";)s-=1;let o=t+1;for(;oc.blocks.length>0)}function Rot(e){var t,n;return e.author!=="user"&&((t=e.content)==null?void 0:t.role)!=="user"?!1:!(((n=e.content)==null?void 0:n.parts)??[]).some(i=>pC(i)||eb(i))}function vN(e="adk-stream",t,n={}){var h,m,g,b;let i=0;const r=new Map,s=new Set,o=[];let l,c,u={...(h=t==null?void 0:t.meta)==null?void 0:h.mpaUsage};const d=v=>{if(!n.mpaA2a||!(v.usageMetadata??v.usage_metadata))return!1;const y=yV(rE,v).current.totalTokenCount;if(!y)return!1;const w=H1(v),x=JSON.stringify([w.source??"outer",w.requestId??"",v.invocationId??v.invocation_id??"",v.id||JSON.stringify(v.usageMetadata??v.usage_metadata)]);return Object.prototype.hasOwnProperty.call(u,x)?!1:(u={...u,[x]:y},!0)},f=(v,y)=>`${y}\0${v}`;if((t==null?void 0:t.role)==="assistant"){const v=((m=t.meta)==null?void 0:m.author)??"",y=((g=t.meta)==null?void 0:g.invocationId)??"",w=((b=t.meta)==null?void 0:b.localId)??`${e}-${i++}`,x=dB();x.blocks=t.blocks,x.liveStart=t.blocks.length,l=f(v,y),r.set(l,{acc:x,localId:w,meta:{...t.meta,localId:w,streaming:!0,eventId:void 0}})}return{project(v){var R,A,N;if(Rot(v))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};const y=d(v);if(n.mpaA2a&&!ree(v)&&!((A=(R=v.content)==null?void 0:R.parts)!=null&&A.length))return y&&c?(c={...c,meta:{...c.meta,mpaUsage:u}},{turn:c,completed:!1}):{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(Yje(v)&&!n.mpaA2a)return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(v.id&&s.has(v.id))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};v.id&&(s.add(v.id),o.push(v.id),o.length>yot&&s.delete(o.shift()));const w=v.author&&v.author!=="user"?v.author:"",x=v.invocationId??v.invocation_id??"";let O=aw(v)?"":w,k=f(O,x),S=r.get(k);if(!S&&aw(v)&&x){const P=[...r.entries()].find(([I])=>I.startsWith(`${x}\0`));P&&(k=P[0],S=P[1],O=S.meta.author??"")}if(!S&&l){const P=r.get(l);P&&(!P.meta.author||P.meta.author===O)&&(r.delete(l),l=void 0,S=P)}if(!S&&hI(v))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(!S&&!ree(v))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(!S){const P=`${e}-${i++}`;S={acc:dB(),localId:P,meta:{author:O||void 0,invocationId:x||void 0}}}S.acc=Zje(n.mpaA2a?jot(S.acc,v):S.acc,v,n);const C=v.usageMetadata??v.usage_metadata,E=_ot(v,S.acc.blocks);S.meta={...S.meta,author:O||S.meta.author,localId:S.localId,streaming:!E,a2aStatus:Jje(v),tokens:(C==null?void 0:C.totalTokenCount)||S.meta.tokens,...n.mpaA2a?{mpaUsage:u,mpaFinalAnswer:aw(v)&&xV(v)==="invocation.completed"?(((N=v.content)==null?void 0:N.parts)??[]).filter(P=>!P.thought).map(P=>Gy(P)??"").join("").trim()||void 0:S.meta.mpaFinalAnswer}:{},ts:v.timestamp||S.meta.ts,invocationId:x||S.meta.invocationId,eventId:E&&v.id?v.id:S.meta.eventId};const j={role:"assistant",blocks:S.acc.blocks,meta:S.meta},T=E&&hI(v);return E&&!T?(r.delete(k),l=void 0):r.set(k,S),n.mpaA2a&&(c=j),{turn:j,completed:E}},finish(){const v=[...r.values()].map(y=>({role:"assistant",blocks:y.acc.blocks.map(w=>w.kind==="thinking"?{...w,done:!0}:w),meta:{...y.meta,streaming:!1,...n.mpaA2a?{mpaUsage:u}:{}}}));return r.clear(),v}}}function Ty(e,t){var s;const n=(s=t.meta)==null?void 0:s.localId;if(!n)return[...e,t];const i=e.findIndex(o=>{var l;return((l=o.meta)==null?void 0:l.localId)===n});if(i<0)return[...e,t];const r=e.slice();return r[i]=t,r}function see(e,t={},n={}){var l;let i=[],r=0;const s=()=>vN(`adk-history-${r++}`,void 0,n);let o=s();for(const c of e)if(c.author==="user"){const d=((l=c.content)==null?void 0:l.parts)??[];if(d.some(b=>{var v;return((v=eb(b))==null?void 0:v.name)===yN})){for(let b=i.length-1;b>=0;b--)if(i[b].role==="assistant"){for(let v=i[b].blocks.length-1;v>=0;v--){const y=i[b].blocks[v];if(y.kind==="auth"){y.done=!0;break}}break}}const f=d.map(Gy).filter(b=>!!b).join(""),h=qA(d),m=Cot(d);if(!f&&!h.length&&!m)continue;for(const b of o.finish())i=Ty(i,b);const g=[];m&&g.push({kind:"invocation",value:m}),h.length&&g.push({kind:"attachment",files:h}),f&&g.push({kind:"text",text:f}),i.push({role:"user",blocks:g,meta:{ts:c.timestamp}}),o=s()}else{const d=o.project(c);d.ignored||(i=Ty(i,d.turn))}for(const c of o.finish())i=Ty(i,c);for(const c of i){const u=c.meta,d=u==null?void 0:u.eventId;if(!d)continue;const f=t[`veadk_feedback:${d}`];if(!f||typeof f!="object")continue;const h=f;h.rating!=="good"&&h.rating!=="bad"||(u.feedback=f)}return i}function iM(e,t=bn.t("app:titles.newConversation")){var n,i;for(const r of e??[])if(r.author==="user"||((n=r.content)==null?void 0:n.role)==="user"){const s=(((i=r.content)==null?void 0:i.parts)??[]).map(o=>o.text).find(Boolean);if(s)return s}return t}function Iot(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return e[t]}function Pot(e,t,n){var s;if(!n||!t.some(o=>{var l;return o.role==="assistant"&&((l=o.meta)==null?void 0:l.eventId)===n}))return e;const r=Iot(e);return((s=r==null?void 0:r.meta)==null?void 0:s.eventId)!==n?e:t}function eNe(e,t,n){if(e.name===t||e.id===t)return(n==null?void 0:n.type)==="parallel"?n:void 0;for(const i of e.children){const r=eNe(i,t,e);if(r)return r}}function Dot(e,t){var o,l;if(e.role!=="assistant"||!t)return;const n=(o=e.meta)==null?void 0:o.author;if(!n)return;const i=eNe(t,n);if(!i)return;const r=i.id||i.path.join("/")||i.name;return{key:`${((l=e.meta)==null?void 0:l.invocationId)??""}::${r}`,parent:i.name}}function Mot(e,t){const n=[];return e.forEach((i,r)=>{const s=Dot(i,t),o=n[n.length-1];if(s&&(o==null?void 0:o.groupKey)===s.key){o.turnIndexes.push(r);return}n.push({key:s?`parallel-${s.key}-${r}`:`turn-${r}`,turnIndexes:[r],parallelParent:s==null?void 0:s.parent,groupKey:s==null?void 0:s.key})}),n.map(({groupKey:i,...r})=>r)}function Lot(e,t,n){var r,s,o,l,c;if(!t)return e;const i=[];for(let u=0;u{var k;return(k=O.meta)!=null&&k.mpaFinalAnswer?[O.meta.mpaFinalAnswer.trim()]:[]})),m=f.map(O=>{var S;const k=O.blocks.filter(C=>C.kind==="text").map(C=>C.text).join("").trim();return!((S=O.meta)!=null&&S.mpaFinalAnswer)&&k&&h.has(k)?{...O,blocks:O.blocks.filter(C=>C.kind!=="text")}:O}),g=[...m].reverse().find(O=>O.blocks.some(k=>k.kind==="text"&&k.text.trim()))??f[f.length-1],b={},v=new Map,y=f.some(O=>{var k;return(k=O.meta)==null?void 0:k.mpaUsage});for(const O of f){for(const[S,C]of Object.entries(((r=O.meta)==null?void 0:r.mpaUsage)??{}))b[S]=Math.max(b[S]??0,C);const k=(s=O.meta)==null?void 0:s.tokens;if(typeof k=="number"&&Number.isFinite(k)&&k>=0){const S=((o=O.meta)==null?void 0:o.invocationId)||"unidentified";v.set(S,Math.max(v.get(S)??0,k))}}const w=y?Object.values(b):[...v.values()],x=f.flatMap(O=>{var k;return(k=O.meta)!=null&&k.ts?[O.meta.ts]:[]});i.push({role:"assistant",blocks:m.flatMap(O=>O.blocks),meta:{...g.meta,localId:(l=d.meta)==null?void 0:l.localId,author:void 0,streaming:u===e.length&&n||f.some(O=>{var k;return((k=O.meta)==null?void 0:k.streaming)===!0}),a2aStatus:(c=f[f.length-1].meta)==null?void 0:c.a2aStatus,ts:x.length?Math.max(...x):void 0,tokens:w.length?w.reduce((O,k)=>O+k,0):void 0,...y?{mpaUsage:b}:{}}})}return i}function $ot(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"9",cy:"8",r:"3.25"}),a.jsx("path",{d:"M2.75 20v-1.5a6.25 6.25 0 0 1 12.5 0V20M16 5.25a3.25 3.25 0 0 1 0 6.5M18 14a5.5 5.5 0 0 1 3.25 5V20"})]})}function tNe(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t{const t=p.Children.toArray(e),n=[];let i="";const r=()=>{i!==""&&(n.push(i),i="")};for(const s of t)if(!(s==null||typeof s=="boolean")){if(typeof s=="string"||typeof s=="number"){i+=String(s);continue}r(),n.push(s)}return r(),n},wV=e=>{const t=Fot(e),n=p.Children.count(t);return p.Children.map(t,i=>{if(typeof i=="string"&&i.trim())return n<=1?i:a.jsx("span",{children:i});if(p.isValidElement(i)){const r=i,{children:s,...o}=r.props;return s!=null?p.cloneElement(r,o,wV(s)):r}return i})},Bot="_Badge_1viyg_1",Uot={Badge:Bot},Ya=({children:e,className:t,variant:n="soft",color:i="secondary",size:r="sm",pill:s,...o})=>a.jsx("div",{className:Ui(Uot.Badge,t),"data-color":i,"data-size":r,"data-pill":s?"":void 0,"data-variant":n,...o,children:wV(e)});var Qot=typeof cg=="object"&&cg&&cg.Object===Object&&cg,zot=typeof self=="object"&&self&&self.Object===Object&&self;Qot||zot||Function("return this")();var Vot=typeof window<"u"?p.useLayoutEffect:p.useEffect;function Hot(){const e=p.useRef(!1);return p.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),p.useCallback(()=>e.current,[])}var aee={width:void 0,height:void 0};function nNe(e){const{ref:t,box:n="content-box"}=e,[{width:i,height:r},s]=p.useState(aee),o=Hot(),l=p.useRef({...aee}),c=p.useRef(void 0);return c.current=e.onResize,p.useEffect(()=>{if(!t.current||typeof window>"u"||!("ResizeObserver"in window))return;const u=new ResizeObserver(([d])=>{const f=n==="border-box"?"borderBoxSize":n==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",h=oee(d,f,"inlineSize"),m=oee(d,f,"blockSize");if(l.current.width!==h||l.current.height!==m){const b={width:h,height:m};l.current.width=h,l.current.height=m,c.current?c.current(b):o()&&s(b)}});return u.observe(t.current,{box:n}),()=>{u.disconnect()}},[n,t,o]),{width:i,height:r}}function oee(e,t,n){return e[t]?Array.isArray(e[t])?e[t][0][n]:e[t][n]:t==="contentBoxSize"?e.contentRect[n==="inlineSize"?"width":"height"]:void 0}function OV(e,t){const n=p.useRef(e);Vot(()=>{n.current=e},[e]),p.useEffect(()=>{if(!t&&t!==0)return;const i=setTimeout(()=>{n.current()},t);return()=>{clearTimeout(i)}},[t])}const qot={DEV:!1,MODE:"production"},ow=typeof import.meta<"u"?qot:void 0,Wot=!!(ow!=null&&ow.DEV),Kot=typeof navigator<"u"&&/(jsdom|happy-dom)/i.test(navigator.userAgent)||typeof globalThis.happyDOM=="object",iNe=(ow==null?void 0:ow.MODE)==="test"||Kot,Got=typeof window<"u",rNe=typeof document<"u",Xot=Got&&rNe,kV=e=>{const t=e.currentTarget;if(!(t instanceof HTMLElement))return;const n=t.offsetWidth;let i=.985;n<=80?i=.96:n<=150?i=.97:n<=220?i=.98:n>600&&(i=.995),t.style.setProperty("--scale",i.toString())},pI=(e,t)=>{const n=()=>{const o=setTimeout(e);return()=>{clearTimeout(o)}};if(!Xot||typeof window.requestAnimationFrame!="function"||rNe&&document.visibilityState==="hidden")return n();let r=2,s=window.requestAnimationFrame(function o(){r-=1,r===0?e():s=window.requestAnimationFrame(o)});return()=>{typeof window.cancelAnimationFrame=="function"&&window.cancelAnimationFrame(s)}},z0=e=>Object.keys(e).reduce((n,i)=>{const r=e[i];if(r||r===0){const s=i.startsWith("--")?"":"--",o=typeof r=="number"?`${r}px`:r;n[`${s}${i}`]=o}return n},{}),H3=e=>typeof e=="number"?`${e}deg`:e,q3=e=>String(e),o_=e=>`${e}ms`,W3=({x:e,y:t,scale:n,rotate:i,skewX:r,skewY:s}={})=>{const o=[e==null?null:`translateX(${e}px)`,t==null?null:`translateY(${t}px)`,n==null?null:`scale(${n})`,i==null?null:`rotate(${H3(i)})`,r==null?null:`skewX(${H3(r)})`,s==null?null:`skewY(${H3(s)})`].filter(Boolean);return o.length?o.join(" "):"none"},K3=({blur:e}={})=>{const t=[e==null?null:`blur(${e}px)`].filter(Boolean);return t.length?t.join(" "):"none"},Dp=e=>{e.preventDefault()},sNe=e=>e.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex^="-"]), [contenteditable]'),Yot="_LoadingIndicator_7yl6f_1",Zot={LoadingIndicator:Yot},WA=({className:e,size:t,strokeWidth:n,style:i,...r})=>a.jsx("div",{...r,className:Ui(Zot.LoadingIndicator,e),style:i||z0({"indicator-size":t,"indicator-stroke":n})});var Jot=Object.defineProperty,SV=(e,t)=>Jot(e,"name",{value:t,configurable:!0});function fB(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}SV(fB,"setRef");function aNe(...e){return t=>{let n=!1;const i=e.map(r=>{const s=fB(r,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let r=0;relt(e,"name",{value:t,configurable:!0});function Gp(e){const t=p.forwardRef((n,i)=>{let{children:r,...s}=n,o=null,l=!1;const c=[];hB(r)&&typeof l_=="function"&&(r=l_(r._payload)),p.Children.forEach(r,h=>{var m;if(fNe(h)){l=!0;const g=h;let b="child"in g.props?g.props.child:g.props.children;hB(b)&&typeof l_=="function"&&(b=l_(b._payload)),o=tlt(g,b),c.push((m=o==null?void 0:o.props)==null?void 0:m.children)}else c.push(h)}),o?o=p.cloneElement(o,void 0,c):!l&&p.Children.count(r)===1&&p.isValidElement(r)&&(o=r);const u=o?dNe(o):void 0,d=_r(i,u);if(!o){if(r||r===0)throw new Error(l?rlt(e):ilt(e));return r}const f=uNe(s,o.props??{});return o.type!==p.Fragment&&(f.ref=i?d:u),p.cloneElement(o,f)});return t.displayName=`${e}.Slot`,t}Cf(Gp,"createSlot");var oNe=Gp("Slot"),lNe=Symbol.for("radix.slottable");function cNe(e){const t=Cf(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=lNe,t}Cf(cNe,"createSlottable");var tlt=Cf((e,t)=>{if("child"in e.props){const n=e.props.child;return p.isValidElement(n)?p.cloneElement(n,void 0,e.props.children(n.props.children)):null}return p.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function uNe(e,t){const n={...t};for(const i in t){const r=e[i],s=t[i];/^on[A-Z]/.test(i)?r&&s?n[i]=(...l)=>{const c=s(...l);return r(...l),c}:r&&(n[i]=r):i==="style"?n[i]={...r,...s}:i==="className"&&(n[i]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}Cf(uNe,"mergeProps");function dNe(e){var i,r;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Cf(dNe,"getElementRef");function fNe(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===lNe}Cf(fNe,"isSlottable");var nlt=Symbol.for("react.lazy");function hB(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===nlt&&"_payload"in e&&hNe(e._payload)}Cf(hB,"isLazyComponent");function hNe(e){return typeof e=="object"&&e!==null&&"then"in e}Cf(hNe,"isPromiseLike");var ilt=Cf(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),rlt=Cf(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),l_=I0[" use ".trim().toString()],slt=Object.defineProperty,alt=(e,t)=>slt(e,"name",{value:t,configurable:!0}),olt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Xr=olt.reduce((e,t)=>{const n=Gp(`Primitive.${t}`),i=p.forwardRef((r,s)=>{const{asChild:o,...l}=r,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:s})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function EV(e,t){e&&yi.flushSync(()=>e.dispatchEvent(t))}alt(EV,"dispatchDiscreteCustomEvent");var llt=Object.defineProperty,clt=(e,t)=>llt(e,"name",{value:t,configurable:!0}),ult=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),dlt=p.forwardRef(clt(function(t,n){return a.jsx(Xr.span,{...t,ref:n,style:{...ult,...t.style}})},"VisuallyHidden")),flt=dlt,hlt=Object.defineProperty,od=(e,t)=>hlt(e,"name",{value:t,configurable:!0});function plt(e,t){const n=p.createContext(t);n.displayName=e+"Context";const i=od(s=>{const{children:o,...l}=s,c=p.useMemo(()=>l,Object.values(l));return a.jsx(n.Provider,{value:c,children:o})},"Provider");i.displayName=e+"Provider";function r(s,o={}){const{optional:l=!1}=o,c=p.useContext(n);if(c)return c;if(t!==void 0)return t;if(!l)throw new Error(`\`${s}\` must be used within \`${e}\``)}return od(r,"useContext"),[i,r]}od(plt,"createContext");function Hc(e,t=[]){let n=[];function i(s,o){const l=p.createContext(o);l.displayName=s+"Context";const c=n.length;n=[...n,o];const u=od(f=>{var y;const{scope:h,children:m,...g}=f,b=((y=h==null?void 0:h[e])==null?void 0:y[c])||l,v=p.useMemo(()=>g,Object.values(g));return a.jsx(b.Provider,{value:v,children:m})},"Provider");u.displayName=s+"Provider";function d(f,h,m={}){var y;const{optional:g=!1}=m,b=((y=h==null?void 0:h[e])==null?void 0:y[c])||l,v=p.useContext(b);if(v)return v;if(o!==void 0)return o;if(!g)throw new Error(`\`${f}\` must be used within \`${s}\``)}return od(d,"useContext"),[u,d]}od(i,"createContext");const r=od(()=>{const s=n.map(o=>p.createContext(o));return od(function(l){const c=(l==null?void 0:l[e])||s;return p.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])},"useScope")},"createScope");return r.scopeName=e,[i,pNe(r,...t)]}od(Hc,"createContextScope");function pNe(...e){const t=e[0];if(e.length===1)return t;const n=od(()=>{const i=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return od(function(s){const o=i.reduce((l,{useScope:c,scopeName:u})=>{const f=c(s)[`__scope${u}`];return{...l,...f}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}od(pNe,"composeContextScopes");var mlt=Object.defineProperty,To=(e,t)=>mlt(e,"name",{value:t,configurable:!0});function CV(e){const t=e+"CollectionProvider",[n,i]=Hc(t),[r,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=To(b=>{const{scope:v,children:y}=b,w=p.useRef(null),x=p.useRef(new Map).current;return a.jsx(r,{scope:v,itemMap:x,collectionRef:w,children:y})},"CollectionProvider");o.displayName=t;const l=e+"CollectionSlot",c=Gp(l),u=p.forwardRef((b,v)=>{const{scope:y,children:w}=b,x=s(l,y),O=_r(v,x.collectionRef);return a.jsx(c,{ref:O,children:w})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",h=Gp(d),m=p.forwardRef((b,v)=>{const{scope:y,children:w,...x}=b,O=p.useRef(null),k=_r(v,O),S=s(d,y);return p.useEffect(()=>(S.itemMap.set(O,{ref:O,...x}),()=>void S.itemMap.delete(O))),a.jsx(h,{[f]:"",ref:k,children:w})});m.displayName=d;function g(b){const v=s(e+"CollectionConsumer",b);return p.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const x=Array.from(w.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((S,C)=>x.indexOf(S.ref.current)-x.indexOf(C.ref.current))},[v.collectionRef,v.itemMap])}return To(g,"useCollection"),[{Provider:o,Slot:u,ItemSlot:m},g,i]}To(CV,"createCollection");var lee=new WeakMap,Va,hu,G3=(hu=class extends Map{constructor(n){super(n);PG(this,Va);w5(this,Va,[...super.keys()]),lee.set(this,!0)}set(n,i){return lee.get(this)&&(this.has(n)?kl(this,Va)[kl(this,Va).indexOf(n)]=n:kl(this,Va).push(n)),super.set(n,i),this}insert(n,i,r){const s=this.has(i),o=kl(this,Va).length,l=AV(n);let c=l>=0?l:o+l;const u=c<0||c>=o?-1:c;if(u===this.size||s&&u===this.size-1||u===-1)return this.set(i,r),this;const d=this.size+(s?0:1);l<0&&c++;const f=[...kl(this,Va)];let h,m=!1;for(let g=c;g=this.size&&(s=this.size-1),this.at(s)}keyFrom(n,i){const r=this.indexOf(n);if(r===-1)return;let s=r+i;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(n,i){let r=0;for(const s of this){if(Reflect.apply(n,i,[s,r,this]))return s;r++}}findIndex(n,i){let r=0;for(const s of this){if(Reflect.apply(n,i,[s,r,this]))return r;r++}return-1}filter(n,i){const r=[];let s=0;for(const o of this)Reflect.apply(n,i,[o,s,this])&&r.push(o),s++;return new hu(r)}map(n,i){const r=[];let s=0;for(const o of this)r.push([o[0],Reflect.apply(n,i,[o,s,this])]),s++;return new hu(r)}reduce(...n){const[i,r]=n;let s=0,o=r??this.at(0);for(const l of this)s===0&&n.length===1?o=l:o=Reflect.apply(i,this,[o,l,s,this]),s++;return o}reduceRight(...n){const[i,r]=n;let s=r??this.at(-1);for(let o=this.size-1;o>=0;o--){const l=this.at(o);o===this.size-1&&n.length===1?s=l:s=Reflect.apply(i,this,[s,l,o,this])}return s}toSorted(n){const i=[...this.entries()].sort(n);return new hu(i)}toReversed(){const n=new hu;for(let i=this.size-1;i>=0;i--){const r=this.keyAt(i),s=this.get(r);n.set(r,s)}return n}toSpliced(...n){const i=[...this.entries()];return i.splice(...n),new hu(i)}slice(n,i){const r=new hu;let s=this.size-1;if(n===void 0)return r;n<0&&(n=n+this.size),i!==void 0&&i>0&&(s=i-1);for(let o=n;o<=s;o++){const l=this.keyAt(o),c=this.get(l);r.set(l,c)}return r}every(n,i){let r=0;for(const s of this){if(!Reflect.apply(n,i,[s,r,this]))return!1;r++}return!0}some(n,i){let r=0;for(const s of this){if(Reflect.apply(n,i,[s,r,this]))return!0;r++}return!1}},Va=new WeakMap,To(hu,"OrderedDict"),hu);function xN(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=mNe(e,t);return n===-1?void 0:e[n]}To(xN,"at");function mNe(e,t){const n=e.length,i=AV(t),r=i>=0?i:n+i;return r<0||r>=n?-1:r}To(mNe,"toSafeIndex");function AV(e){return e!==e||e===0?0:Math.trunc(e)}To(AV,"toSafeInteger");function glt(e){const t=e+"CollectionProvider",[n,i]=Hc(t),[r,s]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new G3,setItemMap:To(()=>{},"setItemMap")}),o=To(({state:x,...O})=>x?a.jsx(c,{...O,state:x}):a.jsx(l,{...O}),"CollectionProvider");o.displayName=t;const l=To(x=>{const O=v();return a.jsx(c,{...x,state:O})},"CollectionInit");l.displayName=t+"Init";const c=To(x=>{const{scope:O,children:k,state:S}=x,C=p.useRef(null),[E,j]=p.useState(null),T=_r(C,j),[R,A]=S;return p.useEffect(()=>{if(!E)return;const N=yNe(()=>{});return N.observe(E,{childList:!0,subtree:!0}),()=>{N.disconnect()}},[E]),a.jsx(r,{scope:O,itemMap:R,setItemMap:A,collectionRef:T,collectionRefObject:C,collectionElement:E,children:k})},"CollectionProviderImpl");c.displayName=t+"Impl";const u=e+"CollectionSlot",d=Gp(u),f=p.forwardRef((x,O)=>{const{scope:k,children:S}=x,C=s(u,k),E=_r(O,C.collectionRef);return a.jsx(d,{ref:E,children:S})});f.displayName=u;const h=e+"CollectionItemSlot",m="data-radix-collection-item",g=Gp(h),b=p.forwardRef((x,O)=>{const{scope:k,children:S,...C}=x,E=p.useRef(null),[j,T]=p.useState(null),R=_r(O,E,T),A=s(h,k),{setItemMap:N}=A,P=p.useRef(C);gNe(P.current,C)||(P.current=C);const I=P.current;return p.useEffect(()=>{const D=I;return N(_=>j?_.has(j)?_.set(j,{...D,element:j}).toSorted(pB):(_.set(j,{...D,element:j}),_.toSorted(pB)):_),()=>{N(_=>!j||!_.has(j)?_:(_.delete(j),new G3(_)))}},[j,I,N]),a.jsx(g,{[m]:"",ref:R,children:S})});b.displayName=h;function v(){return p.useState(new G3)}To(v,"useInitCollection");function y(x){const{itemMap:O}=s(e+"CollectionConsumer",x);return O}return To(y,"useCollection"),[{Provider:o,Slot:f,ItemSlot:b},{createCollectionScope:i,useCollection:y,useInitCollection:v}]}To(glt,"createCollection");function gNe(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}To(gNe,"shallowEqual");function bNe(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}To(bNe,"isElementPreceding");function pB(e,t){return!e[1].element||!t[1].element?0:bNe(e[1].element,t[1].element)?-1:1}To(pB,"sortByDocumentPosition");function yNe(e){return new MutationObserver(n=>{for(const i of n)if(i.type==="childList"){e();return}})}To(yNe,"getChildListObserver");var blt=Object.defineProperty,q1=(e,t)=>blt(e,"name",{value:t,configurable:!0}),vNe=!!(typeof window<"u"&&window.document&&window.document.createElement);function Qn(e,t,{checkForDefaultPrevented:n=!0}={}){return q1(function(r){if(e==null||e(r),n===!1||!r||!r.defaultPrevented)return t==null?void 0:t(r)},"handleEvent")}q1(Qn,"composeEventHandlers");function ylt(e){var t;if(!vNe)throw new Error("Cannot access window outside of the DOM");return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)??window}q1(ylt,"getOwnerWindow");function mB(e){if(!vNe)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}q1(mB,"getOwnerDocument");function xNe(e,t=!1){const{activeElement:n}=mB(e);if(!(n!=null&&n.nodeName))return null;if(wNe(n)&&n.contentDocument)return xNe(n.contentDocument.body,t);if(t){const i=n.getAttribute("aria-activedescendant");if(i){const r=mB(n).getElementById(i);if(r)return r}}return n}q1(xNe,"getActiveElement");function wNe(e){return e.tagName==="IFRAME"}q1(wNe,"isFrame");var xd=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},vlt=Object.defineProperty,xlt=(e,t)=>vlt(e,"name",{value:t,configurable:!0}),cee=I0[" useEffectEvent ".trim().toString()],uee=I0[" useInsertionEffect ".trim().toString()];function ONe(e){if(typeof cee=="function")return cee(e);const t=p.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof uee=="function"?uee(()=>{t.current=e}):xd(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var i;return(i=t.current)==null?void 0:i.call(t,...n)},[])}xlt(ONe,"useEffectEvent");var wlt=Object.defineProperty,KA=(e,t)=>wlt(e,"name",{value:t,configurable:!0}),Olt=I0[" useInsertionEffect ".trim().toString()]||xd;function jd({prop:e,defaultProp:t,onChange:n=KA(()=>{},"onChange"),caller:i}){const[r,s,o]=kNe({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:r,u=p.useCallback(d=>{var f;if(l){const h=SNe(d)?d(e):d;h!==e&&((f=o.current)==null||f.call(o,h))}else s(d)},[l,e,s,o]);return[c,u]}KA(jd,"useControllableState");function kNe({defaultProp:e,onChange:t}){const[n,i]=p.useState(e),r=p.useRef(n),s=p.useRef(t);return Olt(()=>{s.current=t},[t]),p.useEffect(()=>{var o;r.current!==n&&((o=s.current)==null||o.call(s,n),r.current=n)},[n,r]),[n,i,s]}KA(kNe,"useUncontrolledState");function SNe(e){return typeof e=="function"}KA(SNe,"isFunction");var dee=Symbol("RADIX:SYNC_STATE");function klt(e,t,n,i){const{prop:r,defaultProp:s,onChange:o,caller:l}=t,c=r!==void 0,u=ONe(o),d=[{...n,state:s}];i&&d.push(i);const[f,h]=p.useReducer((v,y)=>{if(y.type===dee)return{...v,state:y.state};const w=e(v,y);return c&&!Object.is(w.state,v.state)&&u(w.state),w},...d),m=f.state,g=p.useRef(m);p.useEffect(()=>{g.current!==m&&(g.current=m,c||u(m))},[m,g,c]);const b=p.useMemo(()=>r!==void 0?{...f,state:r}:f,[f,r]);return p.useEffect(()=>{c&&!Object.is(r,f.state)&&h({type:dee,state:r})},[r,f.state,c]),[b,h]}KA(klt,"useControllableStateReducer");var Slt=Object.defineProperty,Xp=(e,t)=>Slt(e,"name",{value:t,configurable:!0});function ENe(e,t){return p.useReducer((n,i)=>t[n][i]??n,e)}Xp(ENe,"useStateMachine");var _h=Xp(e=>{const{present:t,children:n}=e,i=CNe(t),r=typeof n=="function"?n({present:i.isPresent}):p.Children.only(n),s=ANe(i.ref,TNe(r));return typeof n=="function"||i.isPresent?p.cloneElement(r,{ref:s}):null},"Presence");function CNe(e){const[t,n]=p.useState(),i=p.useRef(null),r=p.useRef(e),s=p.useRef("none"),o=p.useRef(void 0),l=e?"mounted":"unmounted",[c,u]=ENe(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{c==="mounted"?(s.current=o.current??sx(i.current),o.current=void 0):s.current="none"},[c]),xd(()=>{const d=i.current,f=r.current;if(f!==e){const m=s.current,g=sx(d);e?(o.current=g,u("MOUNT")):g==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(f&&m!==g?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,u]),xd(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,h=Xp(g=>{const v=sx(i.current).includes(CSS.escape(g.animationName));if(g.target===t&&v&&(u("ANIMATION_END"),!r.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},"handleAnimationEnd"),m=Xp(g=>{g.target===t&&(s.current=sx(i.current))},"handleAnimationStart");return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:p.useCallback(d=>{if(d){const f=getComputedStyle(d);i.current=f,o.current=sx(f)}else i.current=null;n(d)},[])}}Xp(CNe,"usePresence");function gB(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Xp(gB,"setRef");function ANe(...e){const t=p.useRef(e);return t.current=e,p.useCallback(n=>{const i=t.current;let r=!1;const s=i.map(o=>{const l=gB(o,n);return!r&&typeof l=="function"&&(r=!0),l});if(r)return()=>{for(let o=0;oElt(e,"name",{value:t,configurable:!0}),Alt=I0[" useId ".trim().toString()]||(()=>{}),Tlt=0;function tb(e){const[t,n]=p.useState(Alt());return xd(()=>{e||n(i=>i??String(Tlt++))},[e]),e||(t?`radix-${t}`:"")}Clt(tb,"useId");var _lt=Object.defineProperty,jlt=(e,t)=>_lt(e,"name",{value:t,configurable:!0}),Nlt=p.createContext(void 0);function GA(e){const t=p.useContext(Nlt);return e||t||"ltr"}jlt(GA,"useDirection");var Rlt=Object.defineProperty,Ilt=(e,t)=>Rlt(e,"name",{value:t,configurable:!0});function xf(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var i;return(i=t.current)==null?void 0:i.call(t,...n)},[])}Ilt(xf,"useCallbackRef");var Plt=Object.defineProperty,Co=(e,t)=>Plt(e,"name",{value:t,configurable:!0}),bB="dismissableLayer.update",Dlt="dismissableLayer.pointerDownOutside",Mlt="dismissableLayer.focusOutside",fee,_Ne=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),TV=p.forwardRef(Co(function(t,n){const{disableOutsidePointerEvents:i=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:c,onDismiss:u,...d}=t,f=p.useContext(_Ne),[h,m]=p.useState(null),g=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=p.useState({}),v=_r(n,m),y=Array.from(f.layers),[w]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),x=w?y.indexOf(w):-1,O=h?y.indexOf(h):-1,k=f.layersWithOutsidePointerEventsDisabled.size>0,S=O>=x,C=p.useRef(!1),E=jNe(A=>{o==null||o(A),c==null||c(A),A.defaultPrevented||u==null||u()},{ownerDocument:g,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:f.dismissableSurfaces,shouldHandlePointerDownOutside:p.useCallback(A=>{if(!(A instanceof Node))return!1;const N=[...f.branches].some(P=>P.contains(A));return S&&!N},[f.branches,S])}),j=NNe(A=>{if(r&&C.current)return;const N=A.target;[...f.branches].some(I=>I.contains(N))||(l==null||l(A),c==null||c(A),A.defaultPrevented||u==null||u())},g),T=h?O===y.length-1:!1,R=xf(A=>{A.key==="Escape"&&(s==null||s(A),!A.defaultPrevented&&u&&(A.preventDefault(),u()))});return p.useEffect(()=>{if(T)return g.addEventListener("keydown",R,{capture:!0}),()=>g.removeEventListener("keydown",R,{capture:!0})},[g,T,R]),p.useEffect(()=>{if(h)return i&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(fee=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),yB(),()=>{i&&(f.layersWithOutsidePointerEventsDisabled.delete(h),f.layersWithOutsidePointerEventsDisabled.size===0&&(g.body.style.pointerEvents=fee))}},[h,g,i,f]),p.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),yB())},[h,f]),p.useEffect(()=>{const A=Co(()=>b({}),"handleUpdate");return document.addEventListener(bB,A),()=>document.removeEventListener(bB,A)},[]),a.jsx(Xr.div,{...d,ref:v,style:{pointerEvents:k?S?"auto":"none":void 0,...t.style},onFocusCapture:Qn(t.onFocusCapture,j.onFocusCapture),onBlurCapture:Qn(t.onBlurCapture,j.onBlurCapture),onPointerDownCapture:Qn(t.onPointerDownCapture,E.onPointerDownCapture)})},"DismissableLayer"));function Llt(){const e=p.useContext(_Ne),[t,n]=p.useState(null);return p.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Co(Llt,"useDismissableLayerSurface");var $lt=Co(()=>!0,"IS_TRUE");function jNe(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:r,dismissableSurfaces:s,shouldHandlePointerDownOutside:o=$lt}=t,l=xf(e),c=p.useRef(!1),u=p.useRef(!1),d=p.useRef(new Map),f=p.useRef(()=>{});return p.useEffect(()=>{function h(){u.current=!1,r.current=!1,d.current.clear()}Co(h,"resetOutsideInteraction");function m(){return Array.from(d.current.values()).some(Boolean)}Co(m,"isOutsideInteractionIntercepted");function g(x){if(!u.current)return;const O=x.target;O instanceof Node&&[...s].some(S=>S.contains(O))||d.current.set(x.type,!0),x.type==="click"&&window.setTimeout(()=>{u.current&&f.current()},0)}Co(g,"handleInteractionCapture");function b(x){u.current&&d.current.set(x.type,!1)}Co(b,"handleInteractionBubble");const v=Co(x=>{if(x.target&&!c.current){let O=function(){n.removeEventListener("click",f.current);const S=m();h(),S||_V(Dlt,l,k,{discrete:!0})};if(Co(O,"handleAndDispatchPointerDownOutsideEvent"),!o(x.target)){n.removeEventListener("click",f.current),h(),c.current=!1;return}const k={originalEvent:x};u.current=!0,r.current=i&&x.button===0,d.current.clear(),!i||x.button!==0?O():(n.removeEventListener("click",f.current),f.current=O,n.addEventListener("click",f.current,{once:!0}))}else n.removeEventListener("click",f.current),h();c.current=!1},"handlePointerDown"),y=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const x of y)n.addEventListener(x,g,!0),n.addEventListener(x,b);const w=window.setTimeout(()=>{n.addEventListener("pointerdown",v)},0);return()=>{window.clearTimeout(w),n.removeEventListener("pointerdown",v),n.removeEventListener("click",f.current);for(const x of y)n.removeEventListener(x,g,!0),n.removeEventListener(x,b)}},[n,l,i,r,s,o]),{onPointerDownCapture:Co(()=>c.current=!0,"onPointerDownCapture")}}Co(jNe,"usePointerDownOutside");function NNe(e,t=globalThis==null?void 0:globalThis.document){const n=xf(e),i=p.useRef(!1);return p.useEffect(()=>{const r=Co(s=>{s.target&&!i.current&&_V(Mlt,n,{originalEvent:s},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:Co(()=>i.current=!0,"onFocusCapture"),onBlurCapture:Co(()=>i.current=!1,"onBlurCapture")}}Co(NNe,"useFocusOutside");function yB(){const e=new CustomEvent(bB);document.dispatchEvent(e)}Co(yB,"dispatchUpdate");function _V(e,t,n,{discrete:i}){const r=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),i?EV(r,s):r.dispatchEvent(s)}Co(_V,"handleAndDispatchCustomEvent");var Flt=Object.defineProperty,rc=(e,t)=>Flt(e,"name",{value:t,configurable:!0}),X3="focusScope.autoFocusOnMount",Y3="focusScope.autoFocusOnUnmount",hee={bubbles:!1,cancelable:!0},RNe=p.forwardRef(rc(function(t,n){const{loop:i=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...l}=t,[c,u]=p.useState(null),d=xf(s),f=xf(o),h=p.useRef(null),m=_r(n,u),g=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let v=function(O){if(g.paused||!c)return;const k=O.target;c.contains(k)?h.current=k:up(h.current,{select:!0})},y=function(O){if(g.paused||!c)return;const k=O.relatedTarget;k!==null&&(c.contains(k)||up(h.current,{select:!0}))},w=function(O){if(document.activeElement===document.body)for(const S of O)S.removedNodes.length>0&&up(c)};rc(v,"handleFocusIn"),rc(y,"handleFocusOut"),rc(w,"handleMutations"),document.addEventListener("focusin",v),document.addEventListener("focusout",y);const x=new MutationObserver(w);return c&&x.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",y),x.disconnect()}}},[r,c,g.paused]),p.useEffect(()=>{if(c){pee.add(g);const v=document.activeElement;if(!c.contains(v)){const w=new CustomEvent(X3,hee);c.addEventListener(X3,d),c.dispatchEvent(w),w.defaultPrevented||(INe($Ne(jV(c)),{select:!0}),document.activeElement===v&&up(c))}return()=>{c.removeEventListener(X3,d),setTimeout(()=>{const w=new CustomEvent(Y3,hee);c.addEventListener(Y3,f),c.dispatchEvent(w),w.defaultPrevented||up(v??document.body,{select:!0}),c.removeEventListener(Y3,f),pee.remove(g)},0)}}},[c,d,f,g]);const b=p.useCallback(v=>{if(!i&&!r||g.paused)return;const y=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,w=document.activeElement;if(y&&w){const x=v.currentTarget,[O,k]=PNe(x);O&&k?!v.shiftKey&&w===k?(v.preventDefault(),i&&up(O,{select:!0})):v.shiftKey&&w===O&&(v.preventDefault(),i&&up(k,{select:!0})):w===x&&v.preventDefault()}},[i,r,g.paused]);return a.jsx(Xr.div,{tabIndex:-1,...l,ref:m,onKeyDown:b})},"FocusScope"));function INe(e,{select:t=!1}={}){const n=document.activeElement;for(const i of e)if(up(i,{select:t}),document.activeElement!==n)return}rc(INe,"focusFirst");function PNe(e){const t=jV(e),n=vB(t,e),i=vB(t.reverse(),e);return[n,i]}rc(PNe,"getTabbableEdges");function jV(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:rc(i=>{const r=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||r?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}rc(jV,"getTabbableCandidates");function vB(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const i of e)if(!(n?!i.checkVisibility({checkVisibilityCSS:!0}):DNe(i,{upTo:t})))return i}rc(vB,"findVisible");function DNe(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}rc(DNe,"isHidden");function MNe(e){return e instanceof HTMLInputElement&&"select"in e}rc(MNe,"isSelectableInput");function up(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&MNe(e)&&t&&e.select()}}rc(up,"focus");var pee=LNe();function LNe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=xB(e,t),e.unshift(t)},remove(t){var n;e=xB(e,t),(n=e[0])==null||n.resume()}}}rc(LNe,"createFocusScopesStack");function xB(e,t){const n=[...e],i=n.indexOf(t);return i!==-1&&n.splice(i,1),n}rc(xB,"arrayRemove");function $Ne(e){return e.filter(t=>t.tagName!=="A")}rc($Ne,"removeLinks");var Blt=Object.defineProperty,Ult=(e,t)=>Blt(e,"name",{value:t,configurable:!0}),NV=p.forwardRef(Ult(function(t,n){var c;const{container:i,...r}=t,[s,o]=p.useState(!1);xd(()=>o(!0),[]);const l=i||s&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return l?yi.createPortal(a.jsx(Xr.div,{...r,ref:n}),l):null},"Portal")),Qlt=Object.defineProperty,RV=(e,t)=>Qlt(e,"name",{value:t,configurable:!0}),c_=0,Uf=null;function zlt(e){return rM(),e.children}RV(zlt,"FocusGuards");function rM(){p.useEffect(()=>{Uf||(Uf={start:wB(),end:wB()});const{start:e,end:t}=Uf;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),c_++,()=>{c_===1&&(Uf==null||Uf.start.remove(),Uf==null||Uf.end.remove(),Uf=null),c_=Math.max(0,c_-1)}},[])}RV(rM,"useFocusGuards");function wB(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}RV(wB,"createFocusGuard");var Zf=function(){return Zf=Object.assign||function(t){for(var n,i=1,r=arguments.length;i"u")return act;var t=oct(e),n=document.documentElement.clientWidth,i=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,i-n+t[2]-t[0])}},cct=QNe(),lw="data-scroll-locked",uct=function(e,t,n,i){var r=e.left,s=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),` .`.concat(Hlt,` { overflow: hidden `).concat(i,`; padding-right: `).concat(l,"px ").concat(i,`; } - body[`).concat(aw,`] { + body[`).concat(lw,`] { overflow: hidden `).concat(i,`; overscroll-behavior: contain; `).concat([t&&"position: relative ".concat(i,";"),n==="margin"&&` @@ -496,53 +496,53 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(i,";")].filter(Boolean).join(""),` } - .`).concat(xN,` { + .`).concat(wN,` { right: `).concat(l,"px ").concat(i,`; } - .`).concat(wN,` { + .`).concat(ON,` { margin-right: `).concat(l,"px ").concat(i,`; } - .`).concat(xN," .").concat(xN,` { + .`).concat(wN," .").concat(wN,` { right: 0 `).concat(i,`; } - .`).concat(wN," .").concat(wN,` { + .`).concat(ON," .").concat(ON,` { margin-right: 0 `).concat(i,`; } - body[`).concat(aw,`] { + body[`).concat(lw,`] { `).concat(qlt,": ").concat(l,`px; } -`)},gee=function(){var e=parseInt(document.body.getAttribute(aw)||"0",10);return isFinite(e)?e:0},dct=function(){p.useEffect(function(){return document.body.setAttribute(aw,(gee()+1).toString()),function(){var e=gee()-1;e<=0?document.body.removeAttribute(aw):document.body.setAttribute(aw,e.toString())}},[])},fct=function(e){var t=e.noRelative,n=e.noImportant,i=e.gapMode,r=i===void 0?"margin":i;dct();var s=p.useMemo(function(){return lct(r)},[r]);return p.createElement(cct,{styles:uct(s,!t,r,n?"":"!important")})},OB=!1;if(typeof window<"u")try{var c_=Object.defineProperty({},"passive",{get:function(){return OB=!0,!0}});window.addEventListener("test",c_,c_),window.removeEventListener("test",c_,c_)}catch{OB=!1}var Nv=OB?{passive:!1}:!1,hct=function(e){return e.tagName==="TEXTAREA"},zNe=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!hct(e)&&n[t]==="visible")},pct=function(e){return zNe(e,"overflowY")},mct=function(e){return zNe(e,"overflowX")},bee=function(e,t){var n=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var r=VNe(e,i);if(r){var s=HNe(e,i),o=s[1],l=s[2];if(o>l)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},gct=function(e){var t=e.scrollTop,n=e.scrollHeight,i=e.clientHeight;return[t,n,i]},bct=function(e){var t=e.scrollLeft,n=e.scrollWidth,i=e.clientWidth;return[t,n,i]},VNe=function(e,t){return e==="v"?pct(t):mct(t)},HNe=function(e,t){return e==="v"?gct(t):bct(t)},yct=function(e,t){return e==="h"&&t==="rtl"?-1:1},vct=function(e,t,n,i,r){var s=yct(e,window.getComputedStyle(t).direction),o=s*i,l=n.target,c=t.contains(l),u=!1,d=o>0,f=0,h=0;do{if(!l)break;var m=HNe(e,l),g=m[0],b=m[1],v=m[2],y=b-v-s*g;(g||y)&&VNe(e,l)&&(f+=y,h+=g);var w=l.parentNode;l=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&Math.abs(f)<1||!d&&Math.abs(h)<1)&&(u=!0),u},u_=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},yee=function(e){return[e.deltaX,e.deltaY]},vee=function(e){return e&&"current"in e?e.current:e},xct=function(e,t){return e[0]===t[0]&&e[1]===t[1]},wct=function(e){return` +`)},gee=function(){var e=parseInt(document.body.getAttribute(lw)||"0",10);return isFinite(e)?e:0},dct=function(){p.useEffect(function(){return document.body.setAttribute(lw,(gee()+1).toString()),function(){var e=gee()-1;e<=0?document.body.removeAttribute(lw):document.body.setAttribute(lw,e.toString())}},[])},fct=function(e){var t=e.noRelative,n=e.noImportant,i=e.gapMode,r=i===void 0?"margin":i;dct();var s=p.useMemo(function(){return lct(r)},[r]);return p.createElement(cct,{styles:uct(s,!t,r,n?"":"!important")})},OB=!1;if(typeof window<"u")try{var u_=Object.defineProperty({},"passive",{get:function(){return OB=!0,!0}});window.addEventListener("test",u_,u_),window.removeEventListener("test",u_,u_)}catch{OB=!1}var Iv=OB?{passive:!1}:!1,hct=function(e){return e.tagName==="TEXTAREA"},zNe=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!hct(e)&&n[t]==="visible")},pct=function(e){return zNe(e,"overflowY")},mct=function(e){return zNe(e,"overflowX")},bee=function(e,t){var n=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var r=VNe(e,i);if(r){var s=HNe(e,i),o=s[1],l=s[2];if(o>l)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},gct=function(e){var t=e.scrollTop,n=e.scrollHeight,i=e.clientHeight;return[t,n,i]},bct=function(e){var t=e.scrollLeft,n=e.scrollWidth,i=e.clientWidth;return[t,n,i]},VNe=function(e,t){return e==="v"?pct(t):mct(t)},HNe=function(e,t){return e==="v"?gct(t):bct(t)},yct=function(e,t){return e==="h"&&t==="rtl"?-1:1},vct=function(e,t,n,i,r){var s=yct(e,window.getComputedStyle(t).direction),o=s*i,l=n.target,c=t.contains(l),u=!1,d=o>0,f=0,h=0;do{if(!l)break;var m=HNe(e,l),g=m[0],b=m[1],v=m[2],y=b-v-s*g;(g||y)&&VNe(e,l)&&(f+=y,h+=g);var w=l.parentNode;l=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&Math.abs(f)<1||!d&&Math.abs(h)<1)&&(u=!0),u},d_=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},yee=function(e){return[e.deltaX,e.deltaY]},vee=function(e){return e&&"current"in e?e.current:e},xct=function(e,t){return e[0]===t[0]&&e[1]===t[1]},wct=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},Oct=0,Rv=[];function kct(e){var t=p.useRef([]),n=p.useRef([0,0]),i=p.useRef(),r=p.useState(Oct++)[0],s=p.useState(QNe)[0],o=p.useRef(e);p.useEffect(function(){o.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var b=Vlt([e.lockRef.current],(e.shards||[]).map(vee),!0).filter(Boolean);return b.forEach(function(v){return v.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),b.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var l=p.useCallback(function(b,v){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!o.current.allowPinchZoom;var y=u_(b),w=n.current,x="deltaX"in b?b.deltaX:w[0]-y[0],O="deltaY"in b?b.deltaY:w[1]-y[1],k,S=b.target,C=Math.abs(x)>Math.abs(O)?"h":"v";if("touches"in b&&C==="h"&&S.type==="range")return!1;var E=window.getSelection(),j=E&&E.anchorNode,T=j?j===S||j.contains(S):!1;if(T)return!1;var R=bee(C,S);if(!R)return!0;if(R?k=C:(k=C==="v"?"h":"v",R=bee(C,S)),!R)return!1;if(!i.current&&"changedTouches"in b&&(x||O)&&(i.current=k),!k)return!0;var A=i.current||k;return vct(A,v,b,A==="h"?x:O)},[]),c=p.useCallback(function(b){var v=b;if(!(!Rv.length||Rv[Rv.length-1]!==s)){var y="deltaY"in v?yee(v):u_(v),w=t.current.filter(function(k){return k.name===v.type&&(k.target===v.target||v.target===k.shadowParent)&&xct(k.delta,y)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var x=(o.current.shards||[]).map(vee).filter(Boolean).filter(function(k){return k.contains(v.target)}),O=x.length>0?l(v,x[0]):!o.current.noIsolation;O&&v.cancelable&&v.preventDefault()}}},[]),u=p.useCallback(function(b,v,y,w){var x={name:b,delta:v,target:y,should:w,shadowParent:Sct(y)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(O){return O!==x})},1)},[]),d=p.useCallback(function(b){n.current=u_(b),i.current=void 0},[]),f=p.useCallback(function(b){u(b.type,yee(b),b.target,l(b,e.lockRef.current))},[]),h=p.useCallback(function(b){u(b.type,u_(b),b.target,l(b,e.lockRef.current))},[]);p.useEffect(function(){return Rv.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Nv),document.addEventListener("touchmove",c,Nv),document.addEventListener("touchstart",d,Nv),function(){Rv=Rv.filter(function(b){return b!==s}),document.removeEventListener("wheel",c,Nv),document.removeEventListener("touchmove",c,Nv),document.removeEventListener("touchstart",d,Nv)}},[]);var m=e.removeScrollBar,g=e.inert;return p.createElement(p.Fragment,null,g?p.createElement(s,{styles:wct(r)}):null,m?p.createElement(fct,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Sct(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ect=Jlt(UNe,kct);var IV=p.forwardRef(function(e,t){return p.createElement(rM,Yf({},e,{ref:t,sideCar:Ect}))});IV.classNames=rM.classNames;var Cct=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Iv=new WeakMap,d_=new WeakMap,f_={},t4=0,qNe=function(e){return e&&(e.host||qNe(e.parentNode))},Act=function(e,t){return t.map(function(n){if(e.contains(n))return n;var i=qNe(n);return i&&e.contains(i)?i:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Tct=function(e,t,n,i){var r=Act(t,Array.isArray(e)?e:[e]);f_[n]||(f_[n]=new WeakMap);var s=f_[n],o=[],l=new Set,c=new Set(r),u=function(f){!f||l.has(f)||(l.add(f),u(f.parentNode))};r.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(h){if(l.has(h))d(h);else try{var m=h.getAttribute(i),g=m!==null&&m!=="false",b=(Iv.get(h)||0)+1,v=(s.get(h)||0)+1;Iv.set(h,b),s.set(h,v),o.push(h),b===1&&g&&d_.set(h,!0),v===1&&h.setAttribute(n,"true"),g||h.setAttribute(i,"true")}catch(y){console.error("aria-hidden: cannot operate on ",h,y)}})};return d(t),l.clear(),t4++,function(){o.forEach(function(f){var h=Iv.get(f)-1,m=s.get(f)-1;Iv.set(f,h),s.set(f,m),h||(d_.has(f)||f.removeAttribute(i),d_.delete(f)),m||f.removeAttribute(n)}),t4--,t4||(Iv=new WeakMap,Iv=new WeakMap,d_=new WeakMap,f_={})}},WNe=function(e,t,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),r=Cct(e);return r?(i.push.apply(i,Array.from(r.querySelectorAll("[aria-live], script"))),Tct(i,r,n,"aria-hidden")):function(){return null}},_ct=Object.defineProperty,jct=(e,t)=>_ct(e,"name",{value:t,configurable:!0});function HA(e){const[t,n]=p.useState(void 0);return wd(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const i=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const s=r[0];let o,l;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,l=u.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}else n(void 0)},[e]),t}jct(HA,"useSize");var Nct=Object.defineProperty,Jp=(e,t)=>Nct(e,"name",{value:t,configurable:!0}),PV="Checkbox",[Rct,ghn]=Hc(PV),[Ict,DV]=Rct(PV);function KNe(e){const{__scopeCheckbox:t,checked:n,children:i,defaultChecked:r,disabled:s,form:o,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=e,[h,m]=Nd({prop:n,defaultProp:r??!1,onChange:c,caller:PV}),[g,b]=p.useState(null),[v,y]=p.useState(null),w=p.useRef(!1),[x,O]=p.useReducer(C=>C+1,0),k=g?!!o||!!g.closest("form"):!0,S={checked:h,disabled:s,setChecked:m,control:g,setControl:b,name:l,form:o,value:d,hasConsumerStoppedPropagationRef:w,userInteractionCount:x,onUserInteraction:O,required:u,defaultChecked:$p(r)?!1:r,isFormControl:k,bubbleInput:v,setBubbleInput:y};return a.jsx(Ict,{scope:t,...S,children:GNe(f)?f(S):i})}Jp(KNe,"CheckboxProvider");var Pct="CheckboxTrigger",Dct=p.forwardRef(Jp(function({__scopeCheckbox:t,onKeyDown:n,onClick:i,...r},s){const{control:o,value:l,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,onUserInteraction:g,isFormControl:b,bubbleInput:v}=DV(Pct,t),y=jr(s,f),w=p.useRef(u);return p.useEffect(()=>{const x=o==null?void 0:o.form;if(x){const O=Jp(()=>h(w.current),"reset");return x.addEventListener("reset",O),()=>x.removeEventListener("reset",O)}},[o,h]),a.jsx(Zr.button,{type:"button",role:"checkbox","aria-checked":$p(u)?"mixed":u,"aria-required":d,"data-state":MV(u),"data-disabled":c?"":void 0,disabled:c,value:l,...r,ref:y,onKeyDown:Un(n,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:Un(i,x=>{g(),h(O=>$p(O)?!0:!O),v&&b&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})})},"CheckboxTrigger")),Mct=p.forwardRef(Jp(function(t,n){const{__scopeCheckbox:i,name:r,checked:s,defaultChecked:o,required:l,disabled:c,value:u,onCheckedChange:d,form:f,...h}=t;return a.jsx(KNe,{__scopeCheckbox:i,checked:s,defaultChecked:o,disabled:c,required:l,onCheckedChange:d,name:r,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>a.jsxs(a.Fragment,{children:[a.jsx(Dct,{...h,ref:n,__scopeCheckbox:i}),m&&a.jsx(Bct,{__scopeCheckbox:i})]})})},"Checkbox")),Lct="CheckboxIndicator",$ct=p.forwardRef(Jp(function(t,n){const{__scopeCheckbox:i,forceMount:r,...s}=t,o=DV(Lct,i);return a.jsx(Th,{present:r||$p(o.checked)||o.checked===!0,children:a.jsx(Zr.span,{"data-state":MV(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:n,style:{pointerEvents:"none",...t.style}})})},"CheckboxIndicator")),Fct="CheckboxBubbleInput",Bct=p.forwardRef(Jp(function({__scopeCheckbox:t,onClick:n,...i},r){const{control:s,hasConsumerStoppedPropagationRef:o,userInteractionCount:l,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:m,form:g,bubbleInput:b,setBubbleInput:v}=DV(Fct,t),y=jr(r,v),w=HA(s),x=p.useRef(!1),O=p.useRef(c),k=p.useRef(l);p.useEffect(()=>{const C=b;if(!C)return;const E=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(E,"checked").set,R=l!==k.current;k.current=l;const A=O.current!==c;O.current=c;const N=!(R&&o.current);if(A&&T){x.current=!R;const P=new Event("click",{bubbles:N});C.indeterminate=$p(c),T.call(C,$p(c)?!1:c),C.dispatchEvent(P),x.current=!1}},[b,c,o,l]);const S=p.useRef($p(c)?!1:c);return a.jsx(Zr.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??S.current,required:d,disabled:f,name:h,value:m,form:g,...i,tabIndex:-1,ref:y,onClick:Un(n,C=>{x.current&&C.stopPropagation()}),style:{...i.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function GNe(e){return typeof e=="function"}Jp(GNe,"isFunction");function $p(e){return e==="indeterminate"}Jp($p,"isIndeterminate");function MV(e){return $p(e)?"indeterminate":e?"checked":"unchecked"}Jp(MV,"getState");var Uct=Object.defineProperty,Dg=(e,t)=>Uct(e,"name",{value:t,configurable:!0}),XNe="Popper",[YNe,H1]=Hc(XNe),[Qct,ZNe]=YNe(XNe),zct=Dg(e=>{const{__scopePopper:t,children:n}=e,[i,r]=p.useState(null),[s,o]=p.useState(void 0);return a.jsx(Qct,{scope:t,anchor:i,onAnchorChange:r,placementState:s,setPlacementState:o,children:n})},"Popper"),Vct="PopperAnchor",Hct=p.forwardRef(Dg(function(t,n){const{__scopePopper:i,virtualRef:r,...s}=t,o=ZNe(Vct,i),l=p.useRef(null),c=o.onAnchorChange,u=p.useCallback(b=>{l.current=b,b&&c(b)},[c]),d=jr(n,u),f=p.useRef(null);p.useEffect(()=>{if(!r)return;const b=f.current;f.current=r.current,b!==f.current&&c(f.current)});const h=o.placementState&&sM(o.placementState),m=h==null?void 0:h[0],g=h==null?void 0:h[1];return r?null:a.jsx(Zr.div,{"data-radix-popper-side":m,"data-radix-popper-align":g,...s,ref:d})},"PopperAnchor")),JNe="PopperContent",[qct,bhn]=YNe(JNe),Wct=p.forwardRef(Dg(function(t,n){var G,H,se,Y,X,ie,ee;const{__scopePopper:i,side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:b,...v}=t,y=ZNe(JNe,i),[w,x]=p.useState(null),O=jr(n,x),[k,S]=p.useState(null),C=HA(k),E=(C==null?void 0:C.width)??0,j=(C==null?void 0:C.height)??0,T=r+(o!=="center"?"-"+o:""),R=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},A=Array.isArray(d)?d:[d],N=A.length>0,P={padding:R,boundary:A.filter(eRe),altBoundary:N},{refs:I,floatingStyles:D,placement:_,isPositioned:L,middlewareData:F}=G_e({strategy:"fixed",placement:T,whileElementsMounted:Dg((...be)=>aB(...be,{animationFrame:g==="always"}),"whileElementsMounted"),elements:{reference:y.anchor},middleware:[X_e({mainAxis:s+j,alignmentAxis:l}),u&&Y_e({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?Z_e():void 0,...P}),u&&J_e({...P}),eje({...P,apply:Dg(({elements:be,rects:ue,availableWidth:pe,availableHeight:ke})=>{const{width:je,height:Pe}=ue.reference,Ee=be.floating.style;Ee.setProperty("--radix-popper-available-width",`${pe}px`),Ee.setProperty("--radix-popper-available-height",`${ke}px`),Ee.setProperty("--radix-popper-anchor-width",`${je}px`),Ee.setProperty("--radix-popper-anchor-height",`${Pe}px`)},"apply")}),k&&tst({element:k,padding:c}),Kct({arrowWidth:E,arrowHeight:j}),m&&est({strategy:"referenceHidden",...P,boundary:N?P.boundary:void 0})]}),M=y.setPlacementState;wd(()=>(M(_),()=>{M(void 0)}),[_,M]);const[z,q]=sM(_),U=wf(b);wd(()=>{L&&(U==null||U())},[L,U]);const J=(G=F.arrow)==null?void 0:G.x,V=(H=F.arrow)==null?void 0:H.y,Z=((se=F.arrow)==null?void 0:se.centerOffset)!==0,[ne,W]=p.useState();return wd(()=>{w&&W(window.getComputedStyle(w).zIndex)},[w]),a.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:L?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ne,"--radix-popper-transform-origin":[(Y=F.transformOrigin)==null?void 0:Y.x,(X=F.transformOrigin)==null?void 0:X.y].join(" "),...((ie=F.hide)==null?void 0:ie.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:a.jsx(qct,{scope:i,placedSide:z,placedAlign:q,onArrowChange:S,arrowX:J,arrowY:V,shouldHideArrow:Z,children:a.jsx(Zr.div,{"data-side":z,"data-align":q,...v,ref:O,style:{...v.style,animation:L?(ee=v.style)==null?void 0:ee.animation:"none"}})})})},"PopperContent"));function eRe(e){return e!==null}Dg(eRe,"isNotNull");var Kct=Dg(e=>({name:"transformOrigin",options:e,fn(t){var v,y,w;const{placement:n,rects:i,middlewareData:r}=t,o=((v=r.arrow)==null?void 0:v.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[u,d]=sM(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(((y=r.arrow)==null?void 0:y.x)??0)+l/2,m=(((w=r.arrow)==null?void 0:w.y)??0)+c/2;let g="",b="";return u==="bottom"?(g=o?f:`${h}px`,b=`${-c}px`):u==="top"?(g=o?f:`${h}px`,b=`${i.floating.height+c}px`):u==="right"?(g=`${-c}px`,b=o?f:`${m}px`):u==="left"&&(g=`${i.floating.width+c}px`,b=o?f:`${m}px`),{data:{x:g,y:b}}}}),"transformOrigin");function sM(e){const[t,n="center"]=e.split("-");return[t,n]}Dg(sM,"getSideAndAlignFromPlacement");var aM=zct,LV=Hct,$V=Wct,Gct=Object.defineProperty,FV=(e,t)=>Gct(e,"name",{value:t,configurable:!0}),n4=!1;function tRe(){const[e,t]=p.useState(n4);return p.useEffect(()=>{n4||(n4=!0,t(!0))},[]),e}FV(tRe,"useIsHydrated");var nRe=j0[" useSyncExternalStore ".trim().toString()];function iRe(){return()=>{}}FV(iRe,"subscribe");function rRe(){return nRe(iRe,()=>!0,()=>!1)}FV(rRe,"useIsHydratedModern");var Xct=typeof nRe=="function"?rRe:tRe,Yct=Object.defineProperty,U0=(e,t)=>Yct(e,"name",{value:t,configurable:!0}),i4="rovingFocusGroup.onEntryFocus",Zct={bubbles:!1,cancelable:!0},oM="RovingFocusGroup",[kB,sRe,Jct]=CV(oM),[eut,q1]=Hc(oM,[Jct]),[tut,nut]=eut(oM),iut=p.forwardRef(U0(function(t,n){return a.jsx(kB.Provider,{scope:t.__scopeRovingFocusGroup,children:a.jsx(kB.Slot,{scope:t.__scopeRovingFocusGroup,children:a.jsx(rut,{...t,ref:n})})})},"RovingFocusGroup")),rut=p.forwardRef(U0(function(t,n){const{__scopeRovingFocusGroup:i,orientation:r,loop:s=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...h}=t,m=p.useRef(null),g=jr(n,m),b=VA(o),[v,y]=Nd({prop:l,defaultProp:c??null,onChange:u,caller:oM}),[w,x]=p.useState(!1),O=wf(d),k=sRe(i),S=p.useRef(!1),[C,E]=p.useState(0);return p.useEffect(()=>{const j=m.current;if(j)return j.addEventListener(i4,O),()=>j.removeEventListener(i4,O)},[O]),a.jsx(tut,{scope:i,orientation:r,dir:b,loop:s,currentTabStopId:v,onItemFocus:p.useCallback(j=>y(j),[y]),onItemShiftTab:p.useCallback(()=>x(!0),[]),onFocusableItemAdd:p.useCallback(()=>E(j=>j+1),[]),onFocusableItemRemove:p.useCallback(()=>E(j=>j-1),[]),children:a.jsx(Zr.div,{tabIndex:w||C===0?-1:0,"data-orientation":r,...h,ref:g,style:{outline:"none",...t.style},onMouseDown:Un(t.onMouseDown,()=>{S.current=!0}),onFocus:Un(t.onFocus,j=>{const T=!S.current;if(j.target===j.currentTarget&&T&&!w){const R=new CustomEvent(i4,Zct);if(j.currentTarget.dispatchEvent(R),!R.defaultPrevented){const A=k().filter(_=>_.focusable),N=A.find(_=>_.active),P=A.find(_=>_.id===v),D=[N,P,...A].filter(Boolean).map(_=>_.ref.current);BV(D,f)}}S.current=!1}),onBlur:Un(t.onBlur,()=>x(!1))})})},"RovingFocusGroupImpl")),sut="RovingFocusGroupItem",aut=p.forwardRef(U0(function(t,n){const{__scopeRovingFocusGroup:i,focusable:r=!0,active:s=!1,tabStopId:o,children:l,...c}=t,u=nb(),d=o||u,f=nut(sut,i),h=f.currentTabStopId===d,m=sRe(i),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:v}=f,y=Xct();return wd(()=>{if(!(!y||!r))return g(),()=>b()},[y,r,g,b]),p.useEffect(()=>{if(!(y||!r))return g(),()=>b()},[y,r,g,b]),a.jsx(kB.ItemSlot,{scope:i,id:d,focusable:r,active:s,children:a.jsx(Zr.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...c,ref:n,onMouseDown:Un(t.onMouseDown,w=>{r?f.onItemFocus(d):w.preventDefault()}),onFocus:Un(t.onFocus,()=>f.onItemFocus(d)),onKeyDown:Un(t.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){f.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const x=oRe(w,f.orientation,f.dir);if(x!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let k=m().filter(S=>S.focusable).map(S=>S.ref.current);if(x==="last")k.reverse();else if(x==="prev"||x==="next"){x==="prev"&&k.reverse();const S=k.indexOf(w.currentTarget);k=f.loop?lRe(k,S+1):k.slice(S+1)}setTimeout(()=>BV(k))}}),children:typeof l=="function"?l({isCurrentTabStop:h,hasTabStop:v!=null}):l})})},"RovingFocusGroupItem")),out={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function aRe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}U0(aRe,"getDirectionAwareKey");function oRe(e,t,n){const i=aRe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return out[i]}U0(oRe,"getFocusIntent");function BV(e,t=!1){const n=document.activeElement;for(const i of e)if(i===n||(i.focus({preventScroll:t}),document.activeElement!==n))return}U0(BV,"focusFirst");function lRe(e,t){return e.map((n,i)=>e[(t+i)%e.length])}U0(lRe,"wrapArray");var UV=iut,QV=aut,lut=Object.defineProperty,hr=(e,t)=>lut(e,"name",{value:t,configurable:!0}),SB=["Enter"," "],cut=["ArrowDown","PageUp","Home"],cRe=["ArrowUp","PageDown","End"],uut=[...cut,...cRe],dut={ltr:[...SB,"ArrowRight"],rtl:[...SB,"ArrowLeft"]},fut={ltr:["ArrowLeft"],rtl:["ArrowRight"]},lM="Menu",[uC,hut,put]=CV(lM),[Q0,uRe]=Hc(lM,[put,H1,q1]),cM=H1(),dRe=q1(),[fRe,Cb]=Q0(lM),[mut,qA]=Q0(lM),gut=hr(e=>{const{__scopeMenu:t,open:n=!1,children:i,dir:r,onOpenChange:s,modal:o=!0}=e,l=cM(t),[c,u]=p.useState(null),d=p.useRef(!1),f=wf(s),h=VA(r);return p.useEffect(()=>{const m=hr(()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},"handleKeyDown"),g=hr(()=>d.current=!1,"handlePointer");return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),p.useEffect(()=>{if(!n)return;const m=hr(()=>f(!1),"handleBlur");return window.addEventListener("blur",m),()=>window.removeEventListener("blur",m)},[n,f]),a.jsx(aM,{...l,children:a.jsx(fRe,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:u,children:a.jsx(mut,{scope:t,onClose:p.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:o,children:i})})})},"Menu"),hRe=p.forwardRef(hr(function(t,n){const{__scopeMenu:i,...r}=t,s=cM(i);return a.jsx(LV,{...s,...r,ref:n})},"MenuAnchor")),pRe="MenuPortal",[but,mRe]=Q0(pRe,{forceMount:void 0}),yut=hr(e=>{const{__scopeMenu:t,forceMount:n,children:i,container:r}=e,s=Cb(pRe,t);return a.jsx(but,{scope:t,forceMount:n,children:a.jsx(Th,{present:n||s.open,children:a.jsx(NV,{asChild:!0,container:r,children:i})})})},"MenuPortal"),pf="MenuContent",[vut,zV]=Q0(pf),xut=p.forwardRef(hr(function(t,n){const i=mRe(pf,t.__scopeMenu),{forceMount:r=i.forceMount,...s}=t,o=Cb(pf,t.__scopeMenu),l=qA(pf,t.__scopeMenu);return a.jsx(uC.Provider,{scope:t.__scopeMenu,children:a.jsx(Th,{present:r||o.open,children:a.jsx(uC.Slot,{scope:t.__scopeMenu,children:l.modal?a.jsx(wut,{...s,ref:n}):a.jsx(Out,{...s,ref:n})})})})},"MenuContent")),wut=p.forwardRef(hr(function(t,n){const i=Cb(pf,t.__scopeMenu),r=p.useRef(null),s=jr(n,r);return p.useEffect(()=>{const o=r.current;if(o)return WNe(o)},[]),a.jsx(VV,{...t,ref:s,trapFocus:i.open,disableOutsidePointerEvents:i.open,disableOutsideScroll:!0,onFocusOutside:Un(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentModal")),Out=p.forwardRef(hr(function(t,n){const i=Cb(pf,t.__scopeMenu);return a.jsx(VV,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentNonModal")),kut=Yp("MenuContent.ScrollLock"),VV=p.forwardRef(hr(function(t,n){const{__scopeMenu:i,loop:r=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,disableOutsideScroll:b,...v}=t,y=Cb(pf,i),w=qA(pf,i),x=cM(i),O=dRe(i),k=hut(i),[S,C]=p.useState(null),E=p.useRef(null),j=jr(n,E,y.onContentChange),T=p.useRef(0),R=p.useRef(""),A=p.useRef(0),N=p.useRef(null),P=p.useRef("right"),I=p.useRef(0),D=b?IV:p.Fragment,_=b?{as:kut,allowPinchZoom:!0}:void 0,L=hr(M=>{var W,G;const z=R.current+M,q=k().filter(H=>!H.disabled),U=document.activeElement,J=(W=q.find(H=>H.ref.current===U))==null?void 0:W.textValue,V=q.map(H=>H.textValue),Z=kRe(V,z,J),ne=(G=q.find(H=>H.textValue===Z))==null?void 0:G.ref.current;hr(function H(se){R.current=se,window.clearTimeout(T.current),se!==""&&(T.current=window.setTimeout(()=>H(""),1e3))},"updateSearch")(z),ne&&setTimeout(()=>ne.focus())},"handleTypeaheadSearch");p.useEffect(()=>()=>window.clearTimeout(T.current),[]),iM();const F=p.useCallback(M=>{var q,U;return P.current===((q=N.current)==null?void 0:q.side)&&ERe(M,(U=N.current)==null?void 0:U.area)},[]);return a.jsx(vut,{scope:i,searchRef:R,onItemEnter:p.useCallback(M=>{F(M)&&M.preventDefault()},[F]),onItemLeave:p.useCallback(M=>{var z;F(M)||((z=E.current)==null||z.focus(),C(null))},[F]),onTriggerLeave:p.useCallback(M=>{F(M)&&M.preventDefault()},[F]),pointerGraceTimerRef:A,onPointerGraceIntentChange:p.useCallback(M=>{N.current=M},[]),children:a.jsx(D,{..._,children:a.jsx(RNe,{asChild:!0,trapped:s,onMountAutoFocus:Un(o,M=>{var z;M.preventDefault(),(z=E.current)==null||z.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:a.jsx(TV,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,children:a.jsx(UV,{asChild:!0,...O,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:Un(u,M=>{w.isUsingKeyboardRef.current||M.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx($V,{role:"menu","aria-orientation":"vertical","data-state":qV(y.open),"data-radix-menu-content":"",dir:w.dir,...x,...v,ref:j,style:{outline:"none",...v.style},onKeyDown:Un(v.onKeyDown,M=>{const q=M.target.closest("[data-radix-menu-content]")===M.currentTarget,U=M.ctrlKey||M.altKey||M.metaKey,J=M.key.length===1;q&&(M.key==="Tab"&&M.preventDefault(),!U&&J&&L(M.key));const V=E.current;if(M.target!==V||!uut.includes(M.key))return;M.preventDefault();const ne=k().filter(W=>!W.disabled).map(W=>W.ref.current);cRe.includes(M.key)&&ne.reverse(),wRe(ne)}),onBlur:Un(t.onBlur,M=>{M.currentTarget.contains(M.target)||(window.clearTimeout(T.current),R.current="")}),onPointerMove:Un(t.onPointerMove,Xw(M=>{const z=M.target,q=I.current!==M.clientX;if(M.currentTarget.contains(z)&&q){const U=M.clientX>I.current?"right":"left";P.current=U,I.current=M.clientX}}))})})})})})})},"MenuContentImpl")),Sut=p.forwardRef(hr(function(t,n){const{__scopeMenu:i,...r}=t;return a.jsx(Zr.div,{role:"group",...r,ref:n})},"MenuGroup")),EB="MenuItem",xee="menu.itemSelect",HV=p.forwardRef(hr(function(t,n){const{disabled:i=!1,onSelect:r,...s}=t,o=p.useRef(null),l=qA(EB,t.__scopeMenu),c=zV(EB,t.__scopeMenu),u=jr(n,o),d=p.useRef(!1),f=hr(()=>{const h=o.current;if(!i&&h){const m=new CustomEvent(xee,{bubbles:!0,cancelable:!0});h.addEventListener(xee,g=>r==null?void 0:r(g),{once:!0}),EV(h,m),m.defaultPrevented?d.current=!1:l.onClose()}},"handleSelect");return a.jsx(gRe,{...s,ref:u,disabled:i,onClick:Un(t.onClick,f),onPointerDown:h=>{var m;(m=t.onPointerDown)==null||m.call(t,h),d.current=!0},onPointerUp:Un(t.onPointerUp,h=>{var m;d.current||(m=h.currentTarget)==null||m.click()}),onKeyDown:Un(t.onKeyDown,h=>{i||h.target!==h.currentTarget||c.searchRef.current!==""&&h.key===" "||SB.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})},"MenuItem")),gRe=p.forwardRef(hr(function(t,n){const{__scopeMenu:i,disabled:r=!1,textValue:s,...o}=t,l=zV(EB,i),c=dRe(i),u=p.useRef(null),d=jr(n,u),[f,h]=p.useState(!1),[m,g]=p.useState("");return p.useEffect(()=>{const b=u.current;b&&g((b.textContent??"").trim())},[o.children]),a.jsx(uC.ItemSlot,{scope:i,disabled:r,textValue:s??m,children:a.jsx(QV,{asChild:!0,...c,focusable:!r,children:a.jsx(Zr.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:d,onPointerMove:Un(t.onPointerMove,Xw(b=>{r?l.onItemLeave(b):(l.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Un(t.onPointerLeave,Xw(b=>l.onItemLeave(b))),onFocus:Un(t.onFocus,()=>h(!0)),onBlur:Un(t.onBlur,()=>h(!1))})})})},"MenuItemImpl")),Eut=p.forwardRef(hr(function(t,n){const{checked:i=!1,onCheckedChange:r,...s}=t;return a.jsx(yRe,{scope:t.__scopeMenu,checked:i,children:a.jsx(HV,{role:"menuitemcheckbox","aria-checked":dC(i)?"mixed":i,...s,ref:n,"data-state":uM(i),onSelect:Un(s.onSelect,()=>r==null?void 0:r(dC(i)?!0:!i),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),Cut="MenuRadioGroup",[Aut,Tut]=Q0(Cut,{value:void 0,onValueChange:hr(()=>{},"onValueChange")}),_ut=p.forwardRef(hr(function(t,n){const{value:i,onValueChange:r,...s}=t,o=wf(r);return a.jsx(Aut,{scope:t.__scopeMenu,value:i,onValueChange:o,children:a.jsx(Sut,{...s,ref:n})})},"MenuRadioGroup")),jut="MenuRadioItem",Nut=p.forwardRef(hr(function(t,n){const{value:i,...r}=t,s=Tut(jut,t.__scopeMenu),o=i===s.value;return a.jsx(yRe,{scope:t.__scopeMenu,checked:o,children:a.jsx(HV,{role:"menuitemradio","aria-checked":o,...r,ref:n,"data-state":uM(o),onSelect:Un(r.onSelect,()=>{var l;return(l=s.onValueChange)==null?void 0:l.call(s,i)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),bRe="MenuItemIndicator",[yRe,Rut]=Q0(bRe,{checked:!1}),Iut=p.forwardRef(hr(function(t,n){const{__scopeMenu:i,forceMount:r,...s}=t,o=Rut(bRe,i);return a.jsx(Th,{present:r||dC(o.checked)||o.checked===!0,children:a.jsx(Zr.span,{...s,ref:n,"data-state":uM(o.checked)})})},"MenuItemIndicator")),Put=p.forwardRef(hr(function(t,n){const{__scopeMenu:i,...r}=t;return a.jsx(Zr.div,{role:"separator","aria-orientation":"horizontal",...r,ref:n})},"MenuSeparator")),vRe="MenuSub",[Dut,xRe]=Q0(vRe),Mut=hr(e=>{const{__scopeMenu:t,children:n,open:i=!1,onOpenChange:r}=e,s=Cb(vRe,t),o=cM(t),[l,c]=p.useState(null),[u,d]=p.useState(null),f=wf(r);return p.useEffect(()=>(s.open===!1&&f(!1),()=>f(!1)),[s.open,f]),a.jsx(aM,{...o,children:a.jsx(fRe,{scope:t,open:i,onOpenChange:f,content:u,onContentChange:d,children:a.jsx(Dut,{scope:t,contentId:nb(),triggerId:nb(),trigger:l,onTriggerChange:c,children:n})})})},"MenuSub"),h_="MenuSubTrigger",Lut=p.forwardRef(hr(function(t,n){const i=Cb(h_,t.__scopeMenu),r=qA(h_,t.__scopeMenu),s=xRe(h_,t.__scopeMenu),o=zV(h_,t.__scopeMenu),l=p.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=o,d={__scopeMenu:t.__scopeMenu},f=p.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);p.useEffect(()=>f,[f]),p.useEffect(()=>{const m=c.current;return()=>{window.clearTimeout(m),u(null)}},[c,u]);const h=jr(n,s.onTriggerChange);return a.jsx(hRe,{asChild:!0,...d,children:a.jsx(gRe,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?s.contentId:void 0,"data-state":qV(i.open),...t,ref:h,onClick:m=>{var g;(g=t.onClick)==null||g.call(t,m),!(t.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),i.open||i.onOpenChange(!0))},onPointerMove:Un(t.onPointerMove,Xw(m=>{o.onItemEnter(m),!m.defaultPrevented&&!t.disabled&&!i.open&&!l.current&&(o.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{i.onOpenChange(!0),f()},100))})),onPointerLeave:Un(t.onPointerLeave,Xw(m=>{var b,v;f();const g=(b=i.content)==null?void 0:b.getBoundingClientRect();if(g){const y=(v=i.content)==null?void 0:v.dataset.side,w=y==="right",x=w?-5:5,O=g[w?"left":"right"],k=g[w?"right":"left"];o.onPointerGraceIntentChange({area:[{x:m.clientX+x,y:m.clientY},{x:O,y:g.top},{x:k,y:g.top},{x:k,y:g.bottom},{x:O,y:g.bottom}],side:y}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(m),m.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Un(t.onKeyDown,m=>{var b;t.disabled||m.target!==m.currentTarget||o.searchRef.current!==""&&m.key===" "||dut[r.dir].includes(m.key)&&(i.onOpenChange(!0),(b=i.content)==null||b.focus(),m.preventDefault())})})})},"MenuSubTrigger")),$ut="MenuSubContent",Fut=p.forwardRef(hr(function(t,n){const i=mRe(pf,t.__scopeMenu),{forceMount:r=i.forceMount,align:s="start",...o}=t,l=Cb(pf,t.__scopeMenu),c=qA(pf,t.__scopeMenu),u=xRe($ut,t.__scopeMenu),d=p.useRef(null),f=jr(n,d);return a.jsx(uC.Provider,{scope:t.__scopeMenu,children:a.jsx(Th,{present:r||l.open,children:a.jsx(uC.Slot,{scope:t.__scopeMenu,children:a.jsx(VV,{id:u.contentId,"aria-labelledby":u.triggerId,...o,ref:f,align:s,side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{var m;c.isUsingKeyboardRef.current&&((m=d.current)==null||m.focus()),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:Un(t.onFocusOutside,h=>{h.target!==u.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:Un(t.onEscapeKeyDown,h=>{c.onClose(),h.preventDefault()}),onKeyDown:Un(t.onKeyDown,h=>{var b;const m=h.currentTarget.contains(h.target),g=fut[c.dir].includes(h.key);m&&g&&(l.onOpenChange(!1),(b=u.trigger)==null||b.focus(),h.preventDefault())})})})})})},"MenuSubContent"));function qV(e){return e?"open":"closed"}hr(qV,"getOpenState");function dC(e){return e==="indeterminate"}hr(dC,"isIndeterminate");function uM(e){return dC(e)?"indeterminate":e?"checked":"unchecked"}hr(uM,"getCheckedState");function wRe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}hr(wRe,"focusFirst");function ORe(e,t){return e.map((n,i)=>e[(t+i)%e.length])}hr(ORe,"wrapArray");function kRe(e,t,n){const r=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let o=ORe(e,Math.max(s,0));r.length===1&&(o=o.filter(u=>u!==n));const c=o.find(u=>u.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}hr(kRe,"getNextMatch");function SRe(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,o=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}hr(SRe,"isPointInPolygon");function ERe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return SRe(n,t)}hr(ERe,"isPointerInGraceArea");function Xw(e){return t=>t.pointerType==="mouse"?e(t):void 0}hr(Xw,"whenMouse");var But=gut,Uut=hRe,Qut=yut,zut=xut,Vut=HV,Hut=Eut,qut=_ut,Wut=Nut,Kut=Iut,Gut=Put,Xut=Mut,Yut=Lut,Zut=Fut,Jut=Object.defineProperty,$u=(e,t)=>Jut(e,"name",{value:t,configurable:!0}),WV="DropdownMenu",[edt,yhn]=Hc(WV,[uRe]),Fu=uRe(),[tdt,CRe]=edt(WV),ndt=$u(e=>{const{__scopeDropdownMenu:t,children:n,dir:i,open:r,defaultOpen:s,onOpenChange:o,modal:l=!0}=e,c=Fu(t),u=p.useRef(null),[d,f]=Nd({prop:r,defaultProp:s??!1,onChange:o,caller:WV});return a.jsx(tdt,{scope:t,triggerId:nb(),triggerRef:u,contentId:nb(),open:d,onOpenChange:f,onOpenToggle:p.useCallback(()=>f(h=>!h),[f]),modal:l,children:a.jsx(But,{...c,open:d,onOpenChange:f,dir:i,modal:l,children:n})})},"DropdownMenu"),idt="DropdownMenuTrigger",rdt=p.forwardRef($u(function(t,n){const{__scopeDropdownMenu:i,disabled:r=!1,...s}=t,o=CRe(idt,i),l=Fu(i),c=jr(n,o.triggerRef);return a.jsx(Uut,{asChild:!0,...l,children:a.jsx(Zr.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:c,onPointerDown:Un(t.onPointerDown,u=>{!r&&u.button===0&&u.ctrlKey===!1&&(o.onOpenToggle(),o.open||u.preventDefault())}),onKeyDown:Un(t.onKeyDown,u=>{r||(["Enter"," "].includes(u.key)&&o.onOpenToggle(),u.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})},"DropdownMenuTrigger")),sdt=$u(e=>{const{__scopeDropdownMenu:t,...n}=e,i=Fu(t);return a.jsx(Qut,{...i,...n})},"DropdownMenuPortal"),adt="DropdownMenuContent",odt=p.forwardRef($u(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=CRe(adt,i),o=Fu(i),l=p.useRef(!1);return a.jsx(zut,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...r,ref:n,onCloseAutoFocus:Un(t.onCloseAutoFocus,c=>{var u;l.current||(u=s.triggerRef.current)==null||u.focus(),l.current=!1,c.preventDefault()}),onInteractOutside:Un(t.onInteractOutside,c=>{const u=c.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;(!s.modal||f)&&(l.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),ldt=p.forwardRef($u(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Fu(i);return a.jsx(Vut,{...s,...r,ref:n})},"DropdownMenuItem")),cdt=p.forwardRef($u(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Fu(i);return a.jsx(Hut,{...s,...r,ref:n})},"DropdownMenuCheckboxItem")),udt=p.forwardRef($u(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Fu(i);return a.jsx(qut,{...s,...r,ref:n})},"DropdownMenuRadioGroup")),ddt=p.forwardRef($u(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Fu(i);return a.jsx(Wut,{...s,...r,ref:n})},"DropdownMenuRadioItem")),fdt=p.forwardRef($u(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Fu(i);return a.jsx(Kut,{...s,...r,ref:n})},"DropdownMenuItemIndicator")),hdt=p.forwardRef($u(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Fu(i);return a.jsx(Gut,{...s,...r,ref:n})},"DropdownMenuSeparator")),pdt=$u(e=>{const{__scopeDropdownMenu:t,children:n,open:i,onOpenChange:r,defaultOpen:s}=e,o=Fu(t),[l,c]=Nd({prop:i,defaultProp:s??!1,onChange:r,caller:"DropdownMenuSub"});return a.jsx(Xut,{...o,open:l,onOpenChange:c,children:n})},"DropdownMenuSub"),mdt=p.forwardRef($u(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Fu(i);return a.jsx(Yut,{...s,...r,ref:n})},"DropdownMenuSubTrigger")),gdt=p.forwardRef($u(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Fu(i);return a.jsx(Zut,{...s,...r,ref:n,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuSubContent")),bdt=ndt,ydt=rdt,ARe=sdt,vdt=odt,TRe=ldt,xdt=cdt,wdt=udt,Odt=ddt,_Re=fdt,kdt=hdt,Sdt=pdt,Edt=mdt,Cdt=gdt,Adt=Object.defineProperty,Ab=(e,t)=>Adt(e,"name",{value:t,configurable:!0}),KV="Popover",[jRe,vhn]=Hc(KV,[H1]),GV=H1(),[Tdt,W1]=jRe(KV),_dt=Ab(e=>{const{__scopePopover:t,children:n,open:i,defaultOpen:r,onOpenChange:s,modal:o=!1}=e,l=GV(t),c=p.useRef(null),[u,d]=p.useState(!1),[f,h]=Nd({prop:i,defaultProp:r??!1,onChange:s,caller:KV});return a.jsx(aM,{...l,children:a.jsx(Tdt,{scope:t,contentId:nb(),triggerRef:c,open:f,onOpenChange:h,onOpenToggle:p.useCallback(()=>h(m=>!m),[h]),hasCustomAnchor:u,onCustomAnchorAdd:p.useCallback(()=>d(!0),[]),onCustomAnchorRemove:p.useCallback(()=>d(!1),[]),modal:o,children:n})})},"Popover"),jdt="PopoverTrigger",Ndt=p.forwardRef(Ab(function(t,n){const{__scopePopover:i,...r}=t,s=W1(jdt,i),o=GV(i),l=jr(n,s.triggerRef),c=a.jsx(Zr.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":XV(s.open),...r,ref:l,onClick:Un(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:a.jsx(LV,{asChild:!0,...o,children:c})},"PopoverTrigger")),NRe="PopoverPortal",[Rdt,Idt]=jRe(NRe,{forceMount:void 0}),Pdt=Ab(e=>{const{__scopePopover:t,forceMount:n,children:i,container:r}=e,s=W1(NRe,t);return a.jsx(Rdt,{scope:t,forceMount:n,children:a.jsx(Th,{present:n||s.open,children:a.jsx(NV,{asChild:!0,container:r,children:i})})})},"PopoverPortal"),fC="PopoverContent",Ddt=p.forwardRef(Ab(function(t,n){const i=Idt(fC,t.__scopePopover),{forceMount:r=i.forceMount,...s}=t,o=W1(fC,t.__scopePopover);return a.jsx(Th,{present:r||o.open,children:o.modal?a.jsx(Ldt,{...s,ref:n}):a.jsx($dt,{...s,ref:n})})},"PopoverContent")),Mdt=Yp("PopoverContent.RemoveScroll"),Ldt=p.forwardRef(Ab(function(t,n){const i=W1(fC,t.__scopePopover),r=p.useRef(null),s=jr(n,r),o=p.useRef(!1);return p.useEffect(()=>{const l=r.current;if(l)return WNe(l)},[]),a.jsx(IV,{as:Mdt,allowPinchZoom:!0,children:a.jsx(RRe,{...t,ref:s,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Un(t.onCloseAutoFocus,l=>{var c;l.preventDefault(),o.current||(c=i.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Un(t.onPointerDownOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;o.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:Un(t.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),$dt=p.forwardRef(Ab(function(t,n){const i=W1(fC,t.__scopePopover),r=p.useRef(!1),s=p.useRef(!1);return a.jsx(RRe,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,c;(l=t.onCloseAutoFocus)==null||l.call(t,o),o.defaultPrevented||(r.current||(c=i.triggerRef.current)==null||c.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{var u,d;(u=t.onInteractOutside)==null||u.call(t,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=o.target;((d=i.triggerRef.current)==null?void 0:d.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})},"PopoverContentNonModal")),RRe=p.forwardRef(Ab(function(t,n){const{__scopePopover:i,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,...h}=t,m=W1(fC,i),g=GV(i);return iM(),a.jsx(RNe,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:a.jsx(TV,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:f,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),deferPointerDownOutside:!0,children:a.jsx($V,{"data-state":XV(m.open),role:"dialog",id:m.contentId,...g,...h,ref:n,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl"));function XV(e){return e?"open":"closed"}Ab(XV,"getState");var IRe=_dt,PRe=Ndt,DRe=Pdt,MRe=Ddt,Fdt=Object.defineProperty,Nl=(e,t)=>Fdt(e,"name",{value:t,configurable:!0}),LRe="Radio",[Bdt,$Re]=Hc(LRe),[Udt,dM]=Bdt(LRe);function FRe(e){const{__scopeRadio:t,checked:n=!1,children:i,disabled:r,form:s,name:o,onCheck:l,required:c,value:u="on",internal_do_not_use_render:d}=e,[f,h]=p.useState(null),[m,g]=p.useState(null),b=p.useRef(!1),[v,y]=p.useReducer(O=>O+1,0),w=f?!!s||!!f.closest("form"):!0,x={checked:n,disabled:r,required:c,name:o,form:s,value:u,control:f,setControl:h,hasConsumerStoppedPropagationRef:b,userInteractionCount:v,onUserInteraction:y,isFormControl:w,bubbleInput:m,setBubbleInput:g,onCheck:Nl(()=>l==null?void 0:l(),"onCheck")};return a.jsx(Udt,{scope:t,...x,children:BRe(d)?d(x):i})}Nl(FRe,"RadioProvider");var Qdt="RadioTrigger",zdt=p.forwardRef(Nl(function({__scopeRadio:t,onClick:n,...i},r){const{checked:s,disabled:o,value:l,setControl:c,onCheck:u,hasConsumerStoppedPropagationRef:d,onUserInteraction:f,isFormControl:h,bubbleInput:m}=dM(Qdt,t),g=jr(r,c);return a.jsx(Zr.button,{type:"button",role:"radio","aria-checked":s,"data-state":YV(s),"data-disabled":o?"":void 0,disabled:o,value:l,...i,ref:g,onClick:Un(n,b=>{s||(f(),u()),m&&h&&(d.current=b.isPropagationStopped(),d.current||b.stopPropagation())})})},"RadioTrigger")),Vdt="RadioIndicator",Hdt=p.forwardRef(Nl(function(t,n){const{__scopeRadio:i,forceMount:r,...s}=t,o=dM(Vdt,i);return a.jsx(Th,{present:r||o.checked,children:a.jsx(Zr.span,{"data-state":YV(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:n})})},"RadioIndicator")),qdt="RadioBubbleInput",Wdt=p.forwardRef(Nl(function({__scopeRadio:t,onClick:n,...i},r){const{control:s,checked:o,required:l,disabled:c,name:u,value:d,form:f,bubbleInput:h,setBubbleInput:m,hasConsumerStoppedPropagationRef:g,userInteractionCount:b}=dM(qdt,t),v=jr(r,m),y=HA(s),w=p.useRef(!1),x=p.useRef(o),O=p.useRef(b);p.useEffect(()=>{const S=h;if(!S)return;const C=window.HTMLInputElement.prototype,j=Object.getOwnPropertyDescriptor(C,"checked").set,T=b!==O.current;O.current=b;const R=x.current!==o;x.current=o;const A=!(T&&g.current);if(R&&j){w.current=!T;const N=new Event("click",{bubbles:A});j.call(S,o),S.dispatchEvent(N),w.current=!1}},[h,o,g,b]);const k=p.useRef(o);return a.jsx(Zr.input,{type:"radio","aria-hidden":!0,defaultChecked:k.current,required:l,disabled:c,name:u,value:d,form:f,...i,tabIndex:-1,ref:v,onClick:Un(n,S=>{w.current&&S.stopPropagation()}),style:{...i.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"RadioBubbleInput"));function BRe(e){return typeof e=="function"}Nl(BRe,"isFunction");function YV(e){return e?"checked":"unchecked"}Nl(YV,"getState");var Kdt=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ZV="RadioGroup",[Gdt,xhn]=Hc(ZV,[q1,$Re]),URe=q1(),fM=$Re(),[Xdt,Ydt]=Gdt(ZV),Zdt=p.forwardRef(Nl(function(t,n){const{__scopeRadioGroup:i,name:r,form:s,defaultValue:o,value:l,required:c=!1,disabled:u=!1,orientation:d,dir:f,loop:h=!0,onValueChange:m,...g}=t,b=URe(i),v=VA(f),[y,w]=Nd({prop:l,defaultProp:o??null,onChange:m,caller:ZV}),[x,O]=p.useState(null),k=jr(n,O),S=p.useRef(y);return p.useEffect(()=>{const C=s?x==null?void 0:x.ownerDocument.getElementById(s):x==null?void 0:x.closest("form");if(C instanceof HTMLFormElement){const E=Nl(()=>w(S.current),"reset");return C.addEventListener("reset",E),()=>C.removeEventListener("reset",E)}},[x,s,w]),a.jsx(Xdt,{scope:i,name:r,form:s,required:c,disabled:u,value:y,onValueChange:w,children:a.jsx(UV,{asChild:!0,...b,orientation:d,dir:v,loop:h,children:a.jsx(Zr.div,{role:"radiogroup","aria-required":c,"aria-orientation":d,"data-disabled":u?"":void 0,dir:v,...g,ref:k})})})},"RadioGroup")),Jdt="RadioGroupItemProvider",eft="RadioGroupItemTrigger";function QRe(e){const{__scopeRadioGroup:t,value:n,disabled:i,children:r,internal_do_not_use_render:s}=e,o=Ydt(Jdt,t),l=fM(t),c=o.disabled||i;return a.jsx(FRe,{...l,checked:o.value===n,disabled:c,required:o.required,name:o.name,form:o.form,value:n,onCheck:()=>o.onValueChange(n),internal_do_not_use_render:s,children:r})}Nl(QRe,"RadioGroupItemProvider");var tft=p.forwardRef(Nl(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=URe(i),o=fM(i),{checked:l,disabled:c}=dM(eft,o.__scopeRadio),u=p.useRef(null),d=jr(n,u),f=p.useRef(!1);return p.useEffect(()=>{const h=Nl(g=>{Kdt.includes(g.key)&&(f.current=!0)},"handleKeyDown"),m=Nl(()=>f.current=!1,"handleKeyUp");return document.addEventListener("keydown",h),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",m)}},[]),a.jsx(QV,{asChild:!0,...s,focusable:!c,active:l,children:a.jsx(zdt,{...o,...r,ref:d,onKeyDown:Un(r.onKeyDown,h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:Un(r.onFocus,()=>{var h;f.current&&((h=u.current)==null||h.click())})})})},"RadioGroupItemTrigger")),nft=p.forwardRef(Nl(function(t,n){const{__scopeRadioGroup:i,value:r,disabled:s,...o}=t;return a.jsx(QRe,{__scopeRadioGroup:i,value:r,disabled:s,internal_do_not_use_render:({isFormControl:l})=>a.jsxs(a.Fragment,{children:[a.jsx(tft,{...o,ref:n,__scopeRadioGroup:i}),l&&a.jsx(ift,{__scopeRadioGroup:i})]})})},"RadioGroupItem")),ift=p.forwardRef(Nl(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=fM(i);return a.jsx(Wdt,{...s,...r,ref:n})},"RadioGroupItemBubbleInput")),rft=p.forwardRef(Nl(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=fM(i);return a.jsx(Hdt,{...s,...r,ref:n})},"RadioGroupIndicator")),sft=Object.defineProperty,ib=(e,t)=>sft(e,"name",{value:t,configurable:!0}),JV="Switch",[aft,whn]=Hc(JV),[oft,eH]=aft(JV);function zRe(e){const{__scopeSwitch:t,checked:n,children:i,defaultChecked:r,disabled:s,form:o,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=e,[h,m]=Nd({prop:n,defaultProp:r??!1,onChange:c,caller:JV}),[g,b]=p.useState(null),[v,y]=p.useState(null),w=p.useRef(!1),[x,O]=p.useReducer(C=>C+1,0),k=g?!!o||!!g.closest("form"):!0,S={checked:h,setChecked:m,disabled:s,control:g,setControl:b,name:l,form:o,value:d,hasConsumerStoppedPropagationRef:w,userInteractionCount:x,onUserInteraction:O,required:u,defaultChecked:r,isFormControl:k,bubbleInput:v,setBubbleInput:y};return a.jsx(oft,{scope:t,...S,children:VRe(f)?f(S):i})}ib(zRe,"SwitchProvider");var lft="SwitchTrigger",cft=p.forwardRef(ib(function({__scopeSwitch:t,onClick:n,...i},r){const{control:s,form:o,value:l,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,onUserInteraction:g,isFormControl:b,bubbleInput:v}=eH(lft,t),y=jr(r,f),w=p.useRef(u);return p.useEffect(()=>{const x=o?s==null?void 0:s.ownerDocument.getElementById(o):s==null?void 0:s.form;if(x instanceof HTMLFormElement){const O=ib(()=>h(w.current),"reset");return x.addEventListener("reset",O),()=>x.removeEventListener("reset",O)}},[s,o,h]),a.jsx(Zr.button,{type:"button",role:"switch","aria-checked":u,"aria-required":d,"data-state":tH(u),"data-disabled":c?"":void 0,disabled:c,value:l,...i,ref:y,onClick:Un(n,x=>{g(),h(O=>!O),v&&b&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})})},"SwitchTrigger")),uft=p.forwardRef(ib(function(t,n){const{__scopeSwitch:i,name:r,checked:s,defaultChecked:o,required:l,disabled:c,value:u,onCheckedChange:d,form:f,...h}=t;return a.jsx(zRe,{__scopeSwitch:i,checked:s,defaultChecked:o,disabled:c,required:l,onCheckedChange:d,name:r,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>a.jsxs(a.Fragment,{children:[a.jsx(cft,{...h,ref:n,__scopeSwitch:i}),m&&a.jsx(pft,{__scopeSwitch:i})]})})},"Switch")),dft="SwitchThumb",fft=p.forwardRef(ib(function(t,n){const{__scopeSwitch:i,...r}=t,s=eH(dft,i);return a.jsx(Zr.span,{"data-state":tH(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:n})},"SwitchThumb")),hft="SwitchBubbleInput",pft=p.forwardRef(ib(function({__scopeSwitch:t,onClick:n,...i},r){const{control:s,hasConsumerStoppedPropagationRef:o,userInteractionCount:l,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:m,form:g,bubbleInput:b,setBubbleInput:v}=eH(hft,t),y=jr(r,v),w=HA(s),x=p.useRef(!1),O=p.useRef(c),k=p.useRef(l);p.useEffect(()=>{const C=b;if(!C)return;const E=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(E,"checked").set,R=l!==k.current;k.current=l;const A=O.current!==c;O.current=c;const N=!(R&&o.current);if(A&&T){x.current=!R;const P=new Event("click",{bubbles:N});T.call(C,c),C.dispatchEvent(P),x.current=!1}},[b,c,o,l]);const S=p.useRef(c);return a.jsx(Zr.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??S.current,required:d,disabled:f,name:h,value:m,form:g,...i,tabIndex:-1,ref:y,onClick:Un(n,C=>{x.current&&C.stopPropagation()}),style:{...i.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function VRe(e){return typeof e=="function"}ib(VRe,"isFunction");function tH(e){return e?"checked":"unchecked"}ib(tH,"getState");var mft=Object.defineProperty,gft=(e,t)=>mft(e,"name",{value:t,configurable:!0}),bft="Toggle",yft=p.forwardRef(gft(function(t,n){const{pressed:i,defaultPressed:r,onPressedChange:s,...o}=t,[l,c]=Nd({prop:i,onChange:s,defaultProp:r??!1,caller:bft});return a.jsx(Zr.button,{type:"button","aria-pressed":l,"data-state":l?"on":"off","data-disabled":t.disabled?"":void 0,...o,ref:n,onClick:Un(t.onClick,()=>{t.disabled||c(!l)})})},"Toggle")),vft=Object.defineProperty,rb=(e,t)=>vft(e,"name",{value:t,configurable:!0}),K1="ToggleGroup",[HRe,Ohn]=Hc(K1,[q1]),qRe=q1(),xft=p.forwardRef(rb(function(t,n){const{type:i,...r}=t;if(i==="single"){const s=r;return a.jsx(wft,{role:"radiogroup",...s,ref:n})}if(i==="multiple"){const s=r;return a.jsx(Oft,{role:"toolbar",...s,ref:n})}throw new Error(`Missing prop \`type\` expected on \`${K1}\``)},"ToggleGroup")),[WRe,KRe]=HRe(K1),wft=p.forwardRef(rb(function(t,n){const{value:i,defaultValue:r,onValueChange:s=rb(()=>{},"onValueChange"),...o}=t,[l,c]=Nd({prop:i,defaultProp:r??"",onChange:s,caller:K1});return a.jsx(WRe,{scope:t.__scopeToggleGroup,type:"single",value:p.useMemo(()=>l?[l]:[],[l]),onItemActivate:c,onItemDeactivate:p.useCallback(()=>c(""),[c]),children:a.jsx(GRe,{...o,ref:n})})},"ToggleGroupImplSingle")),Oft=p.forwardRef(rb(function(t,n){const{value:i,defaultValue:r,onValueChange:s=rb(()=>{},"onValueChange"),...o}=t,[l,c]=Nd({prop:i,defaultProp:r??[],onChange:s,caller:K1}),u=p.useCallback(f=>c((h=[])=>[...h,f]),[c]),d=p.useCallback(f=>c((h=[])=>h.filter(m=>m!==f)),[c]);return a.jsx(WRe,{scope:t.__scopeToggleGroup,type:"multiple",value:l,onItemActivate:u,onItemDeactivate:d,children:a.jsx(GRe,{...o,ref:n})})},"ToggleGroupImplMultiple")),[kft,Sft]=HRe(K1),GRe=p.forwardRef(rb(function(t,n){const{__scopeToggleGroup:i,disabled:r=!1,rovingFocus:s=!0,orientation:o,dir:l,loop:c=!0,...u}=t,d=qRe(i),f=VA(l),h={dir:f,...u};return a.jsx(kft,{scope:i,rovingFocus:s,disabled:r,children:s?a.jsx(UV,{asChild:!0,...d,orientation:o,dir:f,loop:c,children:a.jsx(Zr.div,{...h,ref:n})}):a.jsx(Zr.div,{...h,ref:n})})},"ToggleGroupImpl")),CB="ToggleGroupItem",Eft=p.forwardRef(rb(function(t,n){const i=KRe(CB,t.__scopeToggleGroup),r=Sft(CB,t.__scopeToggleGroup),s=qRe(t.__scopeToggleGroup),o=i.value.includes(t.value),l=r.disabled||t.disabled,c={...t,pressed:o,disabled:l},u=p.useRef(null);return r.rovingFocus?a.jsx(QV,{asChild:!0,...s,focusable:!l,active:o,ref:u,children:a.jsx(wee,{...c,ref:n})}):a.jsx(wee,{...c,ref:n})},"ToggleGroupItem")),wee=p.forwardRef(rb(function(t,n){const{__scopeToggleGroup:i,value:r,...s}=t,o=KRe(CB,i),l={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},c=o.type==="single"?l:void 0;return a.jsx(yft,{...c,...s,ref:n,onPressedChange:u=>{u?o.onItemActivate(r):o.onItemDeactivate(r)}})},"ToggleGroupItemImpl")),Cft=Object.defineProperty,Ro=(e,t)=>Cft(e,"name",{value:t,configurable:!0}),[nH,khn]=Hc("Tooltip",[H1]),iH=H1(),Aft="TooltipProvider",Tft=700,AB="tooltip.open",[_ft,rH]=nH(Aft),jft=Ro(e=>{const{__scopeTooltip:t,delayDuration:n=Tft,skipDelayDuration:i=300,disableHoverableContent:r=!1,children:s}=e,o=p.useRef(!0),l=p.useRef(!1),c=p.useRef(0);return p.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),a.jsx(_ft,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:p.useCallback(()=>{i<=0||(window.clearTimeout(c.current),o.current=!1)},[i]),onClose:p.useCallback(()=>{i<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,i))},[i]),isPointerInTransitRef:l,onPointerInTransitChange:p.useCallback(u=>{l.current=u},[]),disableHoverableContent:r,children:s})},"TooltipProvider"),TB="Tooltip",[Nft,WA]=nH(TB),Rft=Ro(e=>{const{__scopeTooltip:t,children:n,open:i,defaultOpen:r,onOpenChange:s,disableHoverableContent:o,delayDuration:l}=e,c=rH(TB,e.__scopeTooltip),u=iH(t),[d,f]=p.useState(null),[h,m]=p.useState(void 0),g=nb(),b=p.useRef(0),v=o??c.disableHoverableContent,y=l??c.delayDuration,w=p.useRef(!1),[x,O]=Nd({prop:i,defaultProp:r??!1,onChange:Ro(T=>{T?(c.onOpen(),document.dispatchEvent(new CustomEvent(AB))):c.onClose(),s==null||s(T)},"onChange"),caller:TB}),k=p.useMemo(()=>x?w.current?"delayed-open":"instant-open":"closed",[x]),S=p.useCallback(()=>{window.clearTimeout(b.current),b.current=0,w.current=!1,O(!0)},[O]),C=p.useCallback(()=>{window.clearTimeout(b.current),b.current=0,O(!1)},[O]),E=p.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{w.current=!0,O(!0),b.current=0},y)},[y,O]);p.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]);const j=h??g;return a.jsx(aM,{...u,children:a.jsx(Nft,{scope:t,contentId:j,setContentId:m,open:x,stateAttribute:k,trigger:d,onTriggerChange:f,onTriggerEnter:p.useCallback(()=>{c.isOpenDelayedRef.current?E():S()},[c.isOpenDelayedRef,E,S]),onTriggerLeave:p.useCallback(()=>{v?C():(window.clearTimeout(b.current),b.current=0)},[C,v]),onOpen:S,onClose:C,disableHoverableContent:v,children:n})})},"Tooltip"),Oee="TooltipTrigger",Ift=p.forwardRef(Ro(function(t,n){const{__scopeTooltip:i,...r}=t,s=WA(Oee,i),o=rH(Oee,i),l=iH(i),c=p.useRef(null),u=jr(n,c,s.onTriggerChange),d=p.useRef(!1),f=p.useRef(!1),h=p.useCallback(()=>d.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),a.jsx(LV,{asChild:!0,...l,children:a.jsx(Zr.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:u,onPointerMove:Un(t.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:Un(t.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:Un(t.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:Un(t.onFocus,()=>{d.current||s.onOpen()}),onBlur:Un(t.onBlur,s.onClose),onClick:Un(t.onClick,s.onClose)})})},"TooltipTrigger")),XRe="TooltipPortal",[Pft,Dft]=nH(XRe,{forceMount:void 0}),Mft=Ro(e=>{const{__scopeTooltip:t,forceMount:n,children:i,container:r}=e,s=WA(XRe,t);return a.jsx(Pft,{scope:t,forceMount:n,children:a.jsx(Th,{present:n||s.open,children:a.jsx(NV,{asChild:!0,container:r,children:i})})})},"TooltipPortal"),hC="TooltipContent",Lft=p.forwardRef(Ro(function(t,n){const i=Dft(hC,t.__scopeTooltip),{forceMount:r=i.forceMount,side:s="top",...o}=t,l=WA(hC,t.__scopeTooltip);return a.jsx(Th,{present:r||l.open,children:l.disableHoverableContent?a.jsx(YRe,{side:s,...o,ref:n}):a.jsx($ft,{side:s,...o,ref:n})})},"TooltipContent")),$ft=p.forwardRef(Ro(function(t,n){const i=WA(hC,t.__scopeTooltip),r=rH(hC,t.__scopeTooltip),s=p.useRef(null),o=jr(n,s),[l,c]=p.useState(null),{trigger:u,onClose:d}=i,f=s.current,{onPointerInTransitChange:h}=r,m=p.useCallback(()=>{c(null),h(!1)},[h]),g=p.useCallback((b,v)=>{const y=b.currentTarget,w={x:b.clientX,y:b.clientY},x=ZRe(w,y.getBoundingClientRect()),O=JRe(w,x),k=eIe(v.getBoundingClientRect()),S=nIe([...O,...k]);c(S),h(!0)},[h]);return p.useEffect(()=>()=>m(),[m]),p.useEffect(()=>{if(u&&f){const b=Ro(y=>g(y,f),"handleTriggerLeave"),v=Ro(y=>g(y,u),"handleContentLeave");return u.addEventListener("pointerleave",b),f.addEventListener("pointerleave",v),()=>{u.removeEventListener("pointerleave",b),f.removeEventListener("pointerleave",v)}}},[u,f,g,m]),p.useEffect(()=>{if(l){const b=Ro(v=>{const y=v.target,w={x:v.clientX,y:v.clientY},x=(u==null?void 0:u.contains(y))||(f==null?void 0:f.contains(y)),O=!tIe(w,l);x?m():O&&(m(),d())},"handleTrackPointerGrace");return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[u,f,l,d,m]),a.jsx(YRe,{...t,ref:o})},"TooltipContentHoverable")),Fft=cNe("TooltipContent"),YRe=p.forwardRef(Ro(function(t,n){const{__scopeTooltip:i,children:r,"aria-label":s,id:o,onEscapeKeyDown:l,onPointerDownOutside:c,...u}=t,d=WA(hC,i),f=iH(i),{onClose:h}=d;p.useEffect(()=>(document.addEventListener(AB,h),()=>document.removeEventListener(AB,h)),[h]),p.useEffect(()=>{if(d.trigger){const g=Ro(b=>{b.target instanceof Node&&b.target.contains(d.trigger)&&h()},"handleScroll");return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[d.trigger,h]);const{setContentId:m}=d;return wd(()=>(m(o),()=>{m(void 0)}),[o,m]),a.jsx(TV,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:g=>g.preventDefault(),onDismiss:h,children:a.jsxs($V,{"data-state":d.stateAttribute,role:s?void 0:"tooltip",id:s?void 0:d.contentId,...f,...u,ref:n,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[a.jsx(Fft,{children:r}),s?a.jsx(flt,{id:d.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl"));function ZRe(e,t){const n=Math.abs(t.top-e.y),i=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,i,r,s)){case s:return"left";case r:return"right";case n:return"top";case i:return"bottom";default:throw new Error("unreachable")}}Ro(ZRe,"getExitSideFromRect");function JRe(e,t,n=5){const i=[];switch(t){case"top":i.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":i.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":i.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":i.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return i}Ro(JRe,"getPaddedExitPoints");function eIe(e){const{top:t,right:n,bottom:i,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:i},{x:r,y:i}]}Ro(eIe,"getPointsFromRect");function tIe(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,o=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}Ro(tIe,"isPointInPolygon");function nIe(e){const t=e.slice();return t.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),iIe(t)}Ro(nIe,"getHull");function iIe(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i=2;){const s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let i=e.length-1;i>=0;i--){const r=e[i];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}Ro(iIe,"getHullPresorted");var Bft=jft,Uft=Rft,rIe=Ift,Qft=Mft,zft=Lft;function sb(e){const t=p.useRef(e);return t.current=e,t}let Yw=[],p_=!1;const kee=e=>{var t,n;if(e.key==="Escape"){const[i]=Yw;i&&(e.preventDefault(),(n=(t=i.callback).current)==null||n.call(t))}},sIe=()=>{Yw.length>0&&!p_?(document.body.addEventListener("keydown",kee),p_=!0):Yw.length===0&&p_&&(document.body.removeEventListener("keydown",kee),p_=!1)},Vft=e=>{Yw.unshift(e),sIe()},Hft=({id:e})=>{Yw=Yw.filter(t=>t.id!==e),sIe()},KA=(e,t)=>{const n=p.useId(),i=sb(t);p.useEffect(()=>{if(!e)return;const r={id:n,callback:i};return Vft(r),()=>Hft(r)},[n,e,i])},qft=p.createContext(null);function aIe(){const e=p.useContext(qft);return(e==null?void 0:e.linkComponent)??"a"}function GA(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}const Wft=()=>iNe,See=(e,t=!1,n="TransitionGroup")=>{const i=[];return p.Children.forEach(e,r=>{if(r&&typeof r=="object"&&"key"in r&&r.key)i.push(r);else if(t)throw new Error(`Child elements of <${n} /> must include a \`key\``)}),i},Pv=()=>{},Dv=e=>{const t=p.useRef(e);return t.current=e,p.useCallback(n=>t.current(n),[])};function Kft(e,t,n,i){const r=e.reduce((c,u)=>({...c,[u.key]:1}),{}),s=t.reduce((c,u)=>({...c,[u.component.key]:1}),{}),o=e.filter(c=>!s[c.key]).map(n),l=t.map(c=>({...c,component:e.find(({key:u})=>u===c.component.key)||c.component,shouldRender:!!r[c.component.key]}));return i==="append"?l.concat(o):o.concat(l)}function Gft(e,t,n){if((iNe||Wot)&&t&&n>1)throw new Error(`Cannot use forwardRef with multiple children in <${e} />`)}const Xft="_TransitionGroupChild_1hv1z_1",Yft={TransitionGroupChild:Xft},oIe={enter:!1,enterActive:!1,exit:!1,exitActive:!1,interrupted:!1},Zft=e=>({...oIe,enter:!e}),Jft=(e,t)=>{switch(t.type){case"enter-before":return{enter:!0,enterActive:!1,exit:!1,exitActive:!1,interrupted:e.interrupted||e.exit};case"enter-active":return{enter:!0,enterActive:!0,exit:!1,exitActive:!1,interrupted:!1};case"exit-before":return{enter:!1,enterActive:!1,exit:!0,exitActive:!1,interrupted:e.interrupted||e.enter};case"exit-active":return{enter:!1,enterActive:!1,exit:!0,exitActive:!0,interrupted:!1};case"done":default:return oIe}},eht=({ref:e,as:t,children:n,className:i,transitionId:r,style:s,preventMountTransition:o,shouldRender:l,enterDuration:c,exitDuration:u,removeChild:d,onEnter:f,onEnterActive:h,onEnterComplete:m,onExit:g,onExitActive:b,onExitComplete:v})=>{const[y,w]=p.useReducer(Jft,Zft(o||!1)),x=p.useRef(!1),O=p.useRef(null),k=p.useRef(c);k.current=c;const S=p.useRef(u);S.current=u;const C=p.useRef(null),E=p.useCallback(j=>{const T=O.current;if(!(!T||j===C.current))switch(C.current=j,j){case"enter":f(T);break;case"enter-active":h(T);break;case"enter-complete":m(T);break;case"exit":g(T);break;case"exit-active":b(T);break;case"exit-complete":v(T);break}},[f,h,m,g,b,v]);return ji.useLayoutEffect(()=>{if(!l){let R;w({type:"exit-before"}),E("exit");const A=hI(()=>{w({type:"exit-active"}),E("exit-active"),R=window.setTimeout(()=>{E("exit-complete"),d()},S.current)});return()=>{A(),R!==void 0&&clearTimeout(R)}}if(o&&!x.current){x.current=!0;return}let j;w({type:"enter-before"}),E("enter");const T=hI(()=>{w({type:"enter-active"}),E("enter-active"),j=window.setTimeout(()=>{w({type:"done"}),E("enter-complete")},k.current)});return()=>{T(),j!==void 0&&clearTimeout(j)}},[l,o,d,E]),p.useEffect(()=>()=>{x.current=!1},[]),a.jsx(t,{ref:GA([O,e]),className:Qi(i,Yft.TransitionGroupChild),"data-transition-id":r,style:s,"data-entering":y.enter?"":void 0,"data-entering-active":y.enterActive?"":void 0,"data-exiting":y.exit?"":void 0,"data-exiting-active":y.exitActive?"":void 0,"data-interrupted":y.interrupted?"":void 0,children:n})},tht=e=>{const{enterMountDelay:t,preventMountTransition:n}=e,i=!n&&t!=null?t:null,[r,s]=p.useState(i==null);return OV(()=>s(!0),r?null:i),r?a.jsx(eht,{...e}):null},G1=e=>{const{ref:t,as:n="span",children:i,className:r,transitionId:s,style:o,enterDuration:l=0,exitDuration:c=0,preventInitialTransition:u=!0,enterMountDelay:d,insertMethod:f="append",disableAnimations:h=Wft()}=e,m=Dv(e.onEnter??Pv),g=Dv(e.onEnterActive??Pv),b=Dv(e.onEnterComplete??Pv),v=Dv(e.onExit??Pv),y=Dv(e.onExitActive??Pv),w=Dv(e.onExitComplete??Pv);p.Children.forEach(i,S=>{if(S&&!S.key)throw new Error("Child elements of must include a `key`")});const x=p.useCallback(S=>({component:S,shouldRender:!0,removeChild:()=>{k(C=>C.filter(E=>S.key!==E.component.key))},onEnter:m,onEnterActive:g,onEnterComplete:b,onExit:v,onExitActive:y,onExitComplete:w}),[m,g,b,v,y,w]),[O,k]=p.useState(()=>See(i).map(S=>({...x(S),preventMountTransition:u})));return p.useLayoutEffect(()=>{k(S=>{const C=See(i);return Kft(C,S,x,f)})},[i,f,x]),Gft("TransitionGroup",t,p.Children.count(i)),h?a.jsx(a.Fragment,{children:p.Children.map(i,S=>a.jsx(n,{ref:t,className:r,style:o,"data-transition-id":s,children:S}))}):a.jsx(a.Fragment,{children:O.map(({component:S,...C})=>a.jsx(tht,{...C,as:n,className:r,transitionId:s,enterDuration:l,exitDuration:c,enterMountDelay:d,style:o,ref:t,children:S},S.key))})},nht="_Button_1864l_1",iht="_ButtonInner_1864l_4",rht="_ButtonLoader_1864l_749",r4={Button:nht,ButtonInner:iht,ButtonLoader:rht},Tt=e=>{const{type:t="button",color:n="primary",variant:i="solid",pill:r=!0,uniform:s=!1,size:o="md",iconSize:l,gutterSize:c,loading:u,selected:d,block:f,opticallyAlign:h,children:m,className:g,onClick:b,disabled:v,disabledTone:y,inert:w=u,...x}=e,O=v||w,k=p.useCallback(S=>{v||b==null||b(S)},[b,v]);return a.jsxs("button",{type:t,className:Qi(r4.Button,g),"data-color":n,"data-variant":i,"data-pill":r?"":void 0,"data-uniform":s?"":void 0,"data-size":o,"data-gutter-size":c,"data-icon-size":l,"data-loading":u?"":void 0,"data-selected":d?"":void 0,"data-block":f?"":void 0,"data-optically-align":h,onPointerEnter:kV,disabled:O,"aria-disabled":O,tabIndex:O?-1:void 0,"data-disabled":v?"":void 0,"data-disabled-tone":v?y:void 0,onClick:k,...x,children:[a.jsx(G1,{className:r4.ButtonLoader,enterDuration:250,exitDuration:150,children:u&&a.jsx(QA,{},"loader")}),a.jsx("span",{className:r4.ButtonInner,children:wV(m)})]})},sht=()=>{var e;return typeof ClipboardItem<"u"&&!!((e=navigator.clipboard)!=null&&e.write)};function aht(e){const{"text/plain":t,...n}=e;return new ClipboardItem({...n,...t?{"text/plain":new Blob([t],{type:"text/plain"})}:null})}async function oht(e,t=document.body){if(typeof e=="string")return Eee(e,t);try{return sht()?(await navigator.clipboard.write([aht(e)]),!0):e["text/plain"]?Eee(e["text/plain"],t):!1}catch{return!1}}async function Eee(e,t=document.body){if(navigator.clipboard)try{return await navigator.clipboard.writeText(e),!0}catch{}const n=document.createElement("textarea");n.value=e,n.style.position="fixed",n.style.top="0",n.style.left="0",n.style.opacity="0",t.appendChild(n),n.focus(),n.select();let i=!1;try{i=document.execCommand("copy")}catch{}return t.removeChild(n),i}const lht="_TransitionItem_1o7b1_1",cht={TransitionItem:lht},uht=e=>{const{as:t="span",className:n,children:i,preventInitialTransition:r,insertMethod:s,transitionClassName:o,transitionPosition:l="absolute"}=e,{enterTotalDuration:c,exitTotalDuration:u,variables:d}=mht(e);return a.jsx(t,{className:Qi("block",l==="absolute"&&"relative",n),"data-transition-position":l,style:d,children:a.jsx(G1,{as:t,className:Qi(cht.TransitionItem,o),enterDuration:c,exitDuration:u,insertMethod:s,preventInitialTransition:r,children:i})})},dht=400,fht=500,hht=200,pht=300;function mht({initial:e,enter:t,exit:n,forceCompositeLayer:i}){const r=W3(e),s=W3(t),o=W3(n),l=[r,o,s].some(b=>b!=="none"),c=(t==null?void 0:t.duration)??(l?fht:dht),u=(t==null?void 0:t.timingFunction)??(l?"var(--cubic-enter)":"ease"),d=(n==null?void 0:n.duration)??(l?pht:hht),f=(n==null?void 0:n.timingFunction)??(l?"var(--cubic-exit)":"ease"),h=B0({"tg-will-change":i?"transform, opacity":"auto","tg-enter-opacity":q3((t==null?void 0:t.opacity)??1),"tg-enter-transform":s,"tg-enter-filter":K3(t),"tg-enter-duration":a_(c),"tg-enter-delay":a_((t==null?void 0:t.delay)??0),"tg-enter-timing-function":u,"tg-exit-opacity":q3((n==null?void 0:n.opacity)??0),"tg-exit-transform":o,"tg-exit-filter":K3(n),"tg-exit-duration":a_(d),"tg-exit-delay":a_((n==null?void 0:n.delay)??0),"tg-exit-timing-function":f,"tg-initial-opacity":q3((e==null?void 0:e.opacity)??(n==null?void 0:n.opacity)??0),"tg-initial-transform":r==="none"?o:r,"tg-initial-filter":K3(e??n??{})}),m=((t==null?void 0:t.delay)??0)+c,g=((n==null?void 0:n.delay)??0)+d;return{enterTotalDuration:m,exitTotalDuration:g,variables:h}}const sH=({children:e,copyValue:t,onClick:n,...i})=>{const[r,s]=p.useState(!1),o=p.useRef(null),l=c=>{r||(s(!0),n==null||n(c),oht(typeof t=="function"?t():t),o.current=window.setTimeout(()=>{s(!1)},1300))};return p.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),a.jsxs(Tt,{...i,onClick:l,children:[a.jsx(uht,{className:"w-[var(--button-icon-size)] h-[var(--button-icon-size)]",initial:{scale:.6},enter:{scale:1,delay:150,duration:300},exit:{scale:.6,duration:150},forceCompositeLayer:!0,children:r?a.jsx(oC,{},"copied-icon"):a.jsx(_je,{},"copy-icon")}),typeof e=="function"?e({copied:r}):e]})},ght="_Menu_1t4b0_1",bht="_MenuList_1t4b0_3",yht="_MenuItemContent_1t4b0_53",vht="_MenuItem_1t4b0_53",xht="_ItemActions_1t4b0_98",wht="_PressableInner_1t4b0_117",Oht="_Separator_1t4b0_135",kht="_SubMenuItem_1t4b0_139",Sht="_SubTriggerIcon_1t4b0_141",Eht="_RadioItem_1t4b0_151",Cht="_RadioIndicatorActive_1t4b0_158",Aht="_RadioIndicator_1t4b0_158",Tht="_CheckboxItem_1t4b0_249",_ht="_CheckboxIndicator_1t4b0_256",jht="_CheckboxCircle_1t4b0_269",js={Menu:ght,MenuList:bht,MenuItemContent:yht,MenuItem:vht,ItemActions:xht,PressableInner:wht,Separator:Oht,SubMenuItem:kht,SubTriggerIcon:Sht,RadioItem:Eht,RadioIndicatorActive:Cht,RadioIndicator:Aht,CheckboxItem:Tht,CheckboxIndicator:_ht,CheckboxCircle:jht},lIe=p.createContext(null),XA=()=>{const e=p.useContext(lIe);if(!e)throw new Error("Menu components must be wrapped in
");return e},er=({children:e,forceOpen:t,onOpen:n,onClose:i,modal:r=!1})=>{const[s,o]=p.useState(!1),l=t??s,c=sb(n),u=sb(i),d=p.useCallback(h=>{var m,g;o(h),h?(m=c.current)==null||m.call(c):(g=u.current)==null||g.call(u)},[c,u]);KA(s,()=>{d(!1)});const f=p.useMemo(()=>({open:l,setOpen:d}),[l,d]);return a.jsx(lIe.Provider,{value:f,children:a.jsx(bdt,{open:l,onOpenChange:d,modal:r,children:e})})},Nht=({className:e,children:t,disabled:n,onSelect:i,onClick:r})=>{const{open:s}=XA(),o=l=>{s||l.preventDefault()};return i?a.jsx(TRe,{className:Qi(js.MenuItem,e),onSelect:i,onClick:r,disabled:n,onPointerMove:o,onPointerLeave:o,children:a.jsx("div",{className:js.PressableInner,children:t})}):a.jsx("div",{className:Qi(js.MenuItemContent,e),children:t})},Rht=({className:e,children:t})=>a.jsx("div",{className:Qi(js.ItemActions,e),children:t}),Iht=({children:e,onClick:t})=>{const{setOpen:n}=XA();return a.jsx(Tt,{className:"rounded-sm",color:"secondary",size:"xs",uniform:!0,iconSize:"sm",variant:"ghost",onClick:i=>{i.stopPropagation(),n(!1),t(i)},children:e})},Pht=e=>{const{className:t,children:n,href:i,to:r,disabled:s,as:o,...l}=e,{open:c}=XA(),u=i||r,d=u?/^https?:\/\//.test(u):!0,f=aIe(),h=o||(d?"a":f),m=b=>{c||b.preventDefault()},g=d?{target:"_blank",rel:"noopener noreferrer",href:i??r}:{href:i,to:r};return a.jsx(TRe,{asChild:!0,className:Qi(js.MenuItem,t),disabled:s,onPointerMove:d?void 0:m,onPointerLeave:d?void 0:m,children:a.jsx(h,{...g,...l,children:a.jsx("span",{className:js.PressableInner,children:n})})})},Dht=({className:e})=>a.jsx(kdt,{className:Qi(js.Separator,e),role:"separator"}),Mht=({children:e,side:t,sideOffset:n=5,align:i,alignOffset:r,width:s,minWidth:o,maxHeight:l})=>{const{open:c}=XA();return a.jsx(ARe,{forceMount:!0,children:a.jsx(G1,{className:js.Menu,enterDuration:350,exitDuration:200,disableAnimations:!0,children:c&&a.jsx(vdt,{forceMount:!0,className:js.MenuList,side:t,sideOffset:n,align:i,alignOffset:r??(i==="center"?0:-5),avoidCollisions:!0,collisionPadding:{bottom:30,top:30,left:12,right:12},onEscapeKeyDown:Lp,style:B0({"menu-width":s,"menu-min-width":o,"menu-max-height":l}),children:e},"dropdown")})})},Lht=({children:e,disabled:t})=>a.jsx(ydt,{asChild:!0,disabled:t,children:e}),cIe=p.createContext(null),uIe=()=>{const e=p.useContext(cIe);if(!e)throw new Error("Submenu components must be wrapped in ");return e},$ht=({children:e,forceOpen:t,onOpen:n,onClose:i})=>{const[r,s]=p.useState(!1),o=p.useRef(null),l=t??r,c=sb(n),u=sb(i),d=p.useCallback(h=>{var m,g;s(h),h?(m=c.current)==null||m.call(c):(g=u.current)==null||g.call(u)},[c,u]);KA(r,()=>{var h;d(!1),(h=o.current)==null||h.focus()});const f=p.useMemo(()=>({open:l,setOpen:d,triggerRef:o}),[l,d]);return a.jsx(cIe.Provider,{value:f,children:a.jsx(Sdt,{open:l,onOpenChange:d,children:e})})},Fht=({className:e,children:t,disabled:n})=>{const{open:i}=XA(),{triggerRef:r}=uIe(),s=o=>{i||o.preventDefault()};return a.jsx(Edt,{ref:r,className:Qi(js.MenuItem,js.SubMenuItem,e),disabled:n,onPointerMove:s,onPointerLeave:s,children:a.jsxs("div",{className:js.PressableInner,children:[t,a.jsx(Yst,{width:"16",height:"16",className:js.SubTriggerIcon})]})})},Bht=({children:e,sideOffset:t=4,alignOffset:n=-6,width:i="auto",minWidth:r="auto",maxHeight:s})=>{const{open:o}=uIe();return a.jsx(ARe,{forceMount:!0,children:a.jsx(G1,{className:js.Menu,enterDuration:350,exitDuration:200,disableAnimations:!0,children:o&&a.jsx(Cdt,{className:js.MenuList,sideOffset:t,alignOffset:n,avoidCollisions:!0,collisionPadding:{bottom:30,top:30,left:12,right:12},onEscapeKeyDown:Lp,style:B0({"menu-width":i,"menu-min-width":r,"menu-max-height":s}),children:e},"submenu")})})},Uht=({children:e,value:t,onChange:n,indicatorPosition:i="end",...r})=>a.jsx(wdt,{...r,value:t,onValueChange:s=>n(s),"data-indicator-position":i,children:e}),Qht=({className:e,children:t,...n})=>a.jsx(Odt,{className:Qi(js.MenuItem,js.RadioItem,e),...n,children:a.jsxs("div",{className:js.PressableInner,children:[a.jsx("div",{className:js.RadioIndicator,children:a.jsx(_Re,{className:js.RadioIndicatorActive})}),t]})}),zht=({className:e,children:t,indicatorPosition:n="end",indicatorVariant:i="solid",...r})=>a.jsx(xdt,{className:Qi(js.MenuItem,js.CheckboxItem,e),...r,"data-indicator-position":n,"data-indicator-variant":i,children:a.jsxs("div",{className:js.PressableInner,children:[a.jsx("div",{className:js.CheckboxIndicator,children:a.jsx(_Re,{children:i==="ghost"?a.jsx(oC,{className:"size-4"}):a.jsx("div",{className:js.CheckboxCircle,children:a.jsx(oC,{className:"size-4"})})})}),t]})});er.Content=Mht;er.Item=Nht;er.ItemActions=Rht;er.ItemAction=Iht;er.Link=Pht;er.Separator=Dht;er.Trigger=Lht;er.Sub=$ht;er.SubTrigger=Fht;er.SubContent=Bht;er.CheckboxItem=zht;er.RadioGroup=Uht;er.RadioItem=Qht;const Vht="_Tooltip_16g2y_1",Hht="_TriggerDecorator_16g2y_73",dIe={Tooltip:Vht,TriggerDecorator:Hht},Ea=e=>{const{ref:t,children:n,content:i,forceOpen:r=i===null?!1:void 0,maxWidth:s=300,openDelay:o=150,interactive:l=!1,compact:c=!1,preventUnintentionalClickToClose:u,align:d,alignOffset:f=0,side:h,sideOffset:m=5,gutterSize:g="md",contentClassName:b,onPointerDown:v,onClick:y,...w}=e,[x,O]=p.useState(!1),[k,S]=p.useState(!1);OV(()=>S(!1),k?400:null);const C=r??x,E=T=>{typeof r!="boolean"&&(O(T),u&&S(T))},j=T=>{u&&k&&(T.preventDefault(),T.stopPropagation())};return a.jsxs(fIe,{open:C,delayDuration:o,onOpenChange:E,disableHoverableContent:!l,children:[a.jsx(rIe,{asChild:!0,children:a.jsx(oNe,{...w,ref:t,onPointerDown:T=>{j(T),v==null||v(T)},onClick:T=>{j(T),y==null||y(T)},children:n})}),a.jsx(hIe,{maxWidth:s,compact:c,align:d,alignOffset:f,side:h,sideOffset:m,gutterSize:g,className:b,children:i})]})},fIe=({children:e,open:t,onOpenChange:n,...i})=>(KA(t,()=>{n(!1)}),a.jsx(Bft,{children:a.jsx(Uft,{open:t,onOpenChange:n,...i,children:e})})),hIe=({children:e,maxWidth:t=300,compact:n=!1,clickable:i=void 0,alignOffset:r=0,sideOffset:s=5,gutterSize:o="md",className:l,style:c,...u})=>a.jsx(Qft,{children:a.jsx(zft,{...u,className:Qi(dIe.Tooltip,l),"data-compact":n,"data-clickable":i,"data-gutter-size":o,alignOffset:r,sideOffset:s,collisionPadding:15,hideWhenDetached:!0,style:{...c,maxWidth:t},onEscapeKeyDown:Lp,children:e})}),qht=({children:e,asChild:t=!0,...n})=>a.jsx(rIe,{asChild:t,...n,children:e}),Wht=e=>{const{children:t,className:n,focusable:i=!0,ref:r,...s}=e,o=typeof t=="string";return a.jsx(oNe,{ref:r,...s,className:Qi(dIe.TriggerDecorator,n),tabIndex:i?0:void 0,children:o?a.jsx("span",{children:t}):t})};Ea.Root=fIe;Ea.Content=hIe;Ea.Trigger=qht;Ea.TriggerDecorator=Wht;const Kht=50,Cee=48;function Ght(e){return(e.events??[]).flatMap(t=>{var r,s;const i=(((r=t.content)==null?void 0:r.parts)??[]).map(o=>typeof o.text=="string"?o.text:"").filter(Boolean).join("");return i?[{text:i,role:t.author??((s=t.content)==null?void 0:s.role)??"",ts:t.timestamp}]:[]})}function Xht(e){var t,n;for(const i of e.events??[])if(i.author==="user"||((t=i.content)==null?void 0:t.role)==="user"){const r=(((n=i.content)==null?void 0:n.parts)??[]).map(s=>s.text).find(Boolean);if(r)return r}return Q("search.untitledSession")}function Yht(e,t,n){const i=Math.max(0,t-Cee),r=Math.min(e.length,t+n+Cee);return(i>0?"…":"")+e.slice(i,r).trim()+(r{var c;if((c=l.events)!=null&&c.length)return l;try{return await eC(t,e,l.id)}catch{return l}})),o=[];for(const l of s)for(const{text:c,role:u,ts:d}of Ght(l)){const f=c.toLowerCase().indexOf(i);if(f!==-1){o.push({type:"session",appId:t,sessionId:l.id,title:Xht(l),snippet:Yht(c,f,i.length),role:u,ts:d??l.lastUpdateTime});break}}return o.sort((l,c)=>(c.ts??0)-(l.ts??0)),o.slice(0,Kht)}async function Jht(e,t){if(!e||!t.trim())return{results:[]};let n;try{n=await wTe(e,t.trim())}catch(o){const l=String(o);return{results:[],note:l.includes("404")?Q("search.webUnavailable"):Q("search.webFailed",{message:l})}}const{mounted:i,results:r,error:s}=n;return i?s?{results:[],note:s}:{results:r.map((o,l)=>({type:"web",index:l,title:o.title,url:o.url,siteName:o.siteName,summary:o.summary}))}:{results:[],note:Q("search.webNotMounted")}}async function ept(e,t,n,i){if(!t||!i.trim())return{results:[]};const r=await xTe(t,e,i.trim(),n);if(!r.mounted)return{results:[],note:Q(e==="knowledge"?"search.knowledgeNotMounted":"search.memoryNotMounted")};if(r.error)return{results:[],note:r.error};const s=r.sourceName??Q(e==="knowledge"?"search.knowledge":"search.longTermMemory");return{results:r.results.map((o,l)=>e==="knowledge"?{type:"knowledge",index:l,content:o.content,sourceName:s,sourceType:r.sourceType}:{type:"memory",index:l,content:o.content,sourceName:s,sourceType:r.sourceType,author:o.author,ts:o.timestamp})}}async function tpt(e,t,n){return e==="session"?{results:await Zht(n.userId,n.appId,t)}:e==="web"?Jht(n.appId,t):ept(e,n.appId,n.userId,t)}function pIe({mirrored:e=!1}){return a.jsxs("g",{opacity:"0.5",transform:e?"translate(20 0) scale(-1 1)":void 0,children:[a.jsx("path",{className:"sidebar-panel-glyph__divider",d:"M5.938 6.833c.11 0 .249.102.249.292v6.042c0 .19-.14.291-.249.291s-.248-.101-.248-.291V7.125c0-.19.139-.292.248-.292Z",strokeWidth:"1.167"}),a.jsx("path",{className:"sidebar-panel-glyph__frame",d:"M14.5 3.75h-9a3 3 0 0 0-3 3v6.857a3 3 0 0 0 3 3h9a3 3 0 0 0 3-3V6.75a3 3 0 0 0-3-3Z",strokeWidth:"1.667",strokeLinecap:"round",strokeLinejoin:"round"})]})}function npt(e){return a.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",...e,children:a.jsx(pIe,{})})}function ipt(e){return a.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",...e,children:a.jsx(pIe,{mirrored:!0})})}function rpt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 8.333c.368 0 .667.299.667.667v2h2a.667.667 0 0 1 0 1.333h-2v2a.667.667 0 0 1-1.334 0v-2h-2a.667.667 0 0 1 0-1.333h2V9c0-.368.299-.667.667-.667ZM7.667 1c3.49 0 6.383 2.554 6.913 5.896a.667.667 0 0 1-1.317.208 5.667 5.667 0 1 0-9.708 4.424.67.67 0 0 1 .07.12.667.667 0 0 1-.13.834l-.95.853 4.788-.002a.667.667 0 0 1 0 1.334l-5.657.002c-.917 0-1.35-1.131-.67-1.744l1.163-1.045A6.97 6.97 0 0 1 .667 8c0-3.866 3.134-7 7-7Z",fill:"currentColor"})})}function spt(e){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.333",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"7.333",cy:"7.333",r:"5.333"}),a.jsx("path",{d:"m11.133 11.133 2.867 2.867"})]})}function apt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M8 0.667c4.05 0 7.334 3.283 7.334 7.333 0 4.05-3.284 7.334-7.334 7.334S0.667 12.05 0.667 8 3.95 0.667 8 0.667Zm0 1.333a6 6 0 1 0 0 12A6 6 0 0 0 8 2ZM6.167 6c.368 0 .667.299.667.667v2a.667.667 0 0 1-1.334 0v-2c0-.368.299-.667.667-.667Zm3.666 0c.368 0 .667.299.667.667v2a.667.667 0 0 1-1.333 0v-2c0-.368.298-.667.666-.667Z",fill:"currentColor"})})}function mIe(e){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M7.58 2.6a.667.667 0 0 0-.667-.667h-.666a.667.667 0 0 0-.667.667v10.667c0 .368.299.666.667.666h.666a.667.667 0 0 0 .667-.666V2.6Zm1.333 10.667A2 2 0 0 1 6.913 15.267h-.666a2 2 0 0 1-2-2V2.6a2 2 0 0 1 2-2h.666a2 2 0 0 1 2 2v10.667Z",fill:"currentColor"}),a.jsx("path",{d:"M11.88 5.045a.667.667 0 0 0-.801-.514l-.653.136a.667.667 0 0 0-.504.786l1.85 8.092c.081.358.44.589.8.514l.653-.137a.667.667 0 0 0 .504-.786L11.88 5.045Zm3.155 7.82a2 2 0 0 1-1.512 2.358l-.653.136a2 2 0 0 1-2.403-1.541L8.617 5.726a2 2 0 0 1 1.513-2.358l.652-.136a2 2 0 0 1 2.404 1.541l1.849 8.092Z",fill:"currentColor"}),a.jsx("path",{d:"M4.247 2.6a.667.667 0 0 0-.667-.667h-.667a.667.667 0 0 0-.666.667v10.667c0 .368.298.666.666.666h.667a.667.667 0 0 0 .667-.666V2.6ZM5.58 13.267a2 2 0 0 1-2 2h-.667a2 2 0 0 1-2-2V2.6a2 2 0 0 1 2-2h.667a2 2 0 0 1 2 2v10.667Z",fill:"currentColor"})]})}function gIe(e){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M3.25 2.25h6l3.5 3.5v8H3.25v-11Z"}),a.jsx("path",{d:"M9.25 2.25v3.5h3.5M5.5 8.25h5M5.5 10.75h4"})]})}function opt({className:e="icon"}){return a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[a.jsx("path",{d:"M16.4 10.7a5.7 5.7 0 1 1-1.67-4.03"}),a.jsx("path",{d:"M15.25 15.25 19.6 19.6"})]})}function lpt({open:e}){return a.jsx("svg",{className:`search-source-chevron ${e?"open":""}`,viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:a.jsx("path",{d:"m3.25 4.75 2.75 2.5 2.75-2.5"})})}function cpt({active:e=!1,onClick:t}){const{t:n}=Te("workspaceTools");return a.jsxs("button",{className:`new-chat${e?" is-active":""}`,onClick:t,"aria-label":n("search.nav"),"aria-current":e?"page":void 0,title:n("search.nav"),children:[a.jsx(spt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:n("search.nav")})]})}function upt(e,t,n,i){const r=!!e,s=new Set((t==null?void 0:t.searchSources)??[]),o=l=>r?n?i("search.checkingCapabilities"):i("search.notMounted",{label:l}):i("search.selectAgent");return[{id:"session",label:i("search.sources.session"),ready:r,unavailableLabel:i("search.selectAgent")},{id:"web",label:i("search.sources.web"),ready:r&&s.has("web"),description:i("search.webDescription"),unavailableLabel:o(" web_search")},{id:"knowledge",label:i("search.sources.knowledge"),ready:r&&s.has("knowledge"),unavailableLabel:o(i("search.sources.knowledge"))},{id:"memory",label:i("search.sources.memory"),ready:r&&s.has("memory"),unavailableLabel:o(i("search.sources.memory"))}]}function pI(e,t){return{context_search:"Context Search",local:t("search.backendLocal"),mem0:"Mem0",milvus:"Milvus",opensearch:"OpenSearch",openviking:"OpenViking",redis:"Redis",tos_vector:"TOS Vector",viking:"VikingDB"}[e.toLowerCase()]??e}function Aee(e,t){return e?new Date(e*1e3).toLocaleString(t,{timeZone:"Asia/Shanghai",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):""}function dpt({userId:e,appId:t,agentInfo:n,capabilitiesLoading:i,agentLabel:r,onOpenSession:s}){var L,F;const{t:o,i18n:l}=Te("workspaceTools"),c=l.resolvedLanguage||l.language,[u,d]=p.useState("session"),[f,h]=p.useState(""),[m,g]=p.useState([]),[b,v]=p.useState(),[y,w]=p.useState(!1),[x,O]=p.useState(!1),[k,S]=p.useState(!1),C=p.useRef(0),E=p.useRef(null),j=upt(t,n,i,o),T=j.find(M=>M.id===u),R=u==="knowledge"?(L=n==null?void 0:n.components)==null?void 0:L.find(M=>M.source==="knowledgebase"||M.kind==="knowledgebase"):u==="memory"?(F=n==null?void 0:n.components)==null?void 0:F.find(M=>M.source==="long_term_memory"||M.kind==="memory"):void 0;p.useEffect(()=>{C.current+=1,d("session"),g([]),v(void 0),O(!1),w(!1),S(!1)},[t]),p.useEffect(()=>{if(!k)return;function M(z){var q;(q=E.current)!=null&&q.contains(z.target)||S(!1)}return document.addEventListener("pointerdown",M),()=>document.removeEventListener("pointerdown",M)},[k]);async function A(M,z){var V;const q=M.trim();if(!q||!((V=j.find(Z=>Z.id===z))!=null&&V.ready))return;const U=++C.current;w(!0),O(!0);let J;try{J=await tpt(z,q,{userId:e,appId:t})}catch(Z){const ne=Z instanceof Error?Z.message:String(Z);J={results:[],note:o("search.failed",{message:ne})}}U===C.current&&(g(J.results),v(J.note),w(!1))}function N(M){C.current+=1,h(M),g([]),v(void 0),O(!1),w(!1)}function P(M){C.current+=1,d(M),S(!1),g([]),v(void 0),O(!1),w(!1)}const I=!!(T!=null&&T.ready),D=t?u==="web"?o("search.placeholder.web"):u==="knowledge"?o("search.placeholder.knowledge",{name:(R==null?void 0:R.name)??o("search.placeholder.knowledgeFallback")}):u==="memory"?o("search.placeholder.memory",{name:(R==null?void 0:R.name)??o("search.placeholder.memoryFallback")}):o("search.placeholder.session"):o("search.placeholder.selectAgent"),_=R!=null&&R.backend?pI(R.backend,o):"";return a.jsxs("div",{className:"search",children:[a.jsxs("div",{className:"search-box",children:[a.jsxs("div",{className:"search-source-picker-wrap",ref:E,children:[a.jsxs("button",{className:"search-source-picker",type:"button","aria-label":o("search.sourceTypeAria",{label:(T==null?void 0:T.label)??o("search.notSelected")}),"aria-haspopup":"listbox","aria-expanded":k,onClick:()=>S(M=>!M),children:[a.jsx("span",{children:(T==null?void 0:T.label)??o("search.sourceType")}),_&&a.jsx("small",{children:_}),a.jsx(lpt,{open:k})]}),k&&a.jsx("div",{className:"search-source-menu",role:"listbox","aria-label":o("search.selectSource"),children:j.map(M=>{var U,J;const z=M.id==="knowledge"?(U=n==null?void 0:n.components)==null?void 0:U.find(V=>V.source==="knowledgebase"||V.kind==="knowledgebase"):M.id==="memory"?(J=n==null?void 0:n.components)==null?void 0:J.find(V=>V.source==="long_term_memory"||V.kind==="memory"):void 0,q=z?[z.name,z.backend?pI(z.backend,o):""].filter(Boolean).join(" · "):M.ready?M.description:M.unavailableLabel;return a.jsxs("button",{type:"button",role:"option","aria-selected":u===M.id,disabled:!M.ready,onClick:()=>P(M.id),children:[a.jsx("span",{children:M.label}),q&&a.jsx("small",{children:q})]},M.id)})})]}),a.jsx("span",{className:"search-box-divider","aria-hidden":!0}),a.jsx("input",{className:"search-input",value:f,onChange:M=>N(M.target.value),onKeyDown:M=>{M.key==="Enter"&&(M.preventDefault(),A(f,u))},placeholder:D,disabled:!I,autoFocus:!0}),a.jsx("button",{className:"search-go",onClick:()=>void A(f,u),disabled:!f.trim()||y,"aria-label":o("search.nav"),children:y?a.jsx(Bi,{className:"icon spin"}):a.jsx(opt,{className:"icon"})})]}),a.jsx("div",{className:"search-results",children:I?x?y?null:b?a.jsx("div",{className:"search-empty",children:b}):m.length===0&&x?a.jsx("div",{className:"search-empty",children:o("search.noResults",{query:f.trim()})}):m.map((M,z)=>a.jsx(fpt,{result:M,agentLabel:r,onOpen:s,locale:c},z)):a.jsx("div",{className:"search-empty",children:o(u==="web"?"search.instructions.web":u==="knowledge"?"search.instructions.knowledge":u==="memory"?"search.instructions.memory":"search.instructions.session")}):a.jsx("div",{className:"search-empty",children:t?i?o("search.loadingCapabilities"):(T==null?void 0:T.unavailableLabel)??o("search.sourceUnavailable"):o("search.noAgentHint")})})]})}function fpt({result:e,agentLabel:t,onOpen:n,locale:i}){const{t:r}=Te("workspaceTools");switch(e.type){case"session":return a.jsxs("button",{className:"search-result",onClick:()=>n(e.appId,e.sessionId),children:[a.jsx(Bje,{className:"search-result-icon"}),a.jsxs("div",{className:"search-result-body",children:[a.jsxs("div",{className:"search-result-head",children:[a.jsx("span",{className:"search-result-title",children:e.title}),a.jsxs("span",{className:"search-result-meta",children:[t(e.appId),e.ts?` · ${Aee(e.ts,i)}`:""]})]}),a.jsx("div",{className:"search-result-snippet",children:e.snippet})]})]});case"web":return a.jsxs("a",{className:"search-result",href:e.url||void 0,target:"_blank",rel:"noreferrer noopener",children:[a.jsx(tM,{className:"search-result-icon"}),a.jsxs("div",{className:"search-result-body",children:[a.jsxs("div",{className:"search-result-head",children:[a.jsx("span",{className:"search-result-title",children:e.title||e.url}),a.jsxs("span",{className:"search-result-meta",children:[e.siteName,e.url&&a.jsx(d0,{className:"search-result-ext"})]})]}),e.summary&&a.jsx("div",{className:"search-result-snippet",children:e.summary})]})]});case"knowledge":return a.jsxs("div",{className:"search-result search-result-static",children:[a.jsx(Tee,{source:"knowledge"}),a.jsxs("div",{className:"search-result-body",children:[a.jsxs("div",{className:"search-result-head",children:[a.jsx("span",{className:"search-result-title",children:r("search.knowledgeFragment",{index:e.index+1})}),a.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${pI(e.sourceType,r)}`:""]})]}),a.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});case"memory":return a.jsxs("div",{className:"search-result search-result-static",children:[a.jsx(Tee,{source:"memory"}),a.jsxs("div",{className:"search-result-body",children:[a.jsxs("div",{className:"search-result-head",children:[a.jsx("span",{className:"search-result-title",children:r("search.memoryFragment",{index:e.index+1})}),a.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${pI(e.sourceType,r)}`:"",e.ts?` · ${Aee(e.ts,i)}`:""]})]}),a.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});default:return null}}function Tee({source:e,className:t="search-result-icon"}){return e==="knowledge"?a.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[a.jsx("path",{d:"M5 5.5h10.5A3.5 3.5 0 0 1 19 9v9.5H8.5A3.5 3.5 0 0 1 5 15V5.5Z"}),a.jsx("path",{d:"M8.25 9h7.5M8.25 12.25h6"})]}):a.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[a.jsx("path",{d:"M12 4.5a7.5 7.5 0 1 0 7.5 7.5"}),a.jsx("path",{d:"M12 8a4 4 0 1 0 4 4M12 11.3a.7.7 0 1 0 0 1.4.7.7 0 0 0 0-1.4Z"})]})}function hpt({filled:e=!1,...t}){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:e?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[a.jsx("rect",{x:"3.5",y:"9.3",width:"4.5",height:"10.2",rx:"1.5"}),a.jsx("path",{d:"M8 10.2 11.3 4.8c.5-.8 1.7-.45 1.7.5v3.8h4.2a2.1 2.1 0 0 1 2.04 2.6l-1.4 5.75A2.1 2.1 0 0 1 15.8 19H8"})]})}function ppt({filled:e=!1,...t}){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:e?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"4.5",height:"10.2",rx:"1.5"}),a.jsx("path",{d:"M8 13.8 11.3 19.2c.5.8 1.7.45 1.7-.5v-3.8h4.2a2.1 2.1 0 0 0 2.04-2.6l-1.4-5.75A2.1 2.1 0 0 0 15.8 5H8"})]})}function bIe(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5.25 4.25h9.5a2.5 2.5 0 0 1 2.5 2.5v3.5"}),a.jsx("path",{d:"M13.25 17.75h-8a2.5 2.5 0 0 1-2.5-2.5v-8a3 3 0 0 1 3-3"}),a.jsx("path",{d:"M7 8.25h5.5M7 11.75h3.25"}),a.jsx("path",{d:"m13.35 16.65.42-2.16 4.76-4.76a1.35 1.35 0 0 1 1.91 1.91l-4.76 4.76-2.33.25Z"}),a.jsx("path",{d:"m17.65 10.6 1.9 1.9"})]})}const hM="/assets/media/logo-DCsNZy-k.svg",aH="data:image/svg+xml,%3csvg%20width='28'%20height='23'%20viewBox='0%200%2028%2023'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M17.1957%209.44218C17.0253%209.58161%2016.7774%209.47317%2016.7774%209.24079V8.01696V0.611967C16.7774%200.395085%2016.514%200.271152%2016.3591%200.410576L6.04172%209.16334C5.87132%209.30276%205.62345%209.19432%205.62345%208.96194V2.98218C5.62345%202.81178%205.48403%202.67235%205.31362%202.67235H0.309832C0.139424%202.67235%200%202.81178%200%202.98218V21.7115C0%2021.9284%200.263357%2022.0524%200.418273%2021.9129L10.7202%2013.1602C10.8906%2013.0207%2011.1385%2013.1292%2011.1385%2013.3616V22.0059C11.1385%2022.2228%2011.4018%2022.3467%2011.5567%2022.2073L21.8586%2013.4545C22.0291%2013.3151%2022.2769%2013.4235%2022.2769%2013.6559V19.6357C22.2769%2019.8061%2022.4163%2019.9455%2022.5868%2019.9455H27.5905C27.7609%2019.9455%2027.9004%2019.8061%2027.9004%2019.6357V0.890816C27.9004%200.673934%2027.637%200.550001%2027.4821%200.689425L17.1957%209.44218Z'%20fill='%230066FC'/%3e%3c/svg%3e";function mpt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M8.5 4.5H6a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-13a2 2 0 0 0-2-2h-2.5"}),a.jsx("rect",{x:"8.5",y:"2.5",width:"7",height:"4",rx:"1.5"}),a.jsx("path",{d:"m8 13 2.5 2.5L16 10"})]})}const _ee="(max-width: 860px)";function jee({title:e}){const t=p.useRef(null),n=p.useRef(null),[i,r]=p.useState(0);p.useLayoutEffect(()=>{const l=t.current,c=n.current;if(!l||!c)return;const u=()=>{const f=Math.max(0,Math.ceil(c.scrollWidth-l.clientWidth));r(h=>h===f?h:f)};u();const d=new ResizeObserver(u);return d.observe(l),d.observe(c),()=>d.disconnect()},[e]);const s=Math.min(12,Math.max(4.8,3.6+i/36)),o={"--history-title-translate":`-${i}px`,"--history-title-duration":`${s.toFixed(2)}s`};return a.jsx("span",{ref:t,className:`history-title${i>0?" is-overflowing":""}`,style:o,children:a.jsx("span",{ref:n,className:"history-title-text",children:e})})}function gpt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"7",cy:"7",r:"2.25"}),a.jsx("circle",{cx:"17",cy:"7",r:"2.25"}),a.jsx("circle",{cx:"7",cy:"17",r:"2.25"}),a.jsx("circle",{cx:"17",cy:"17",r:"2.25"})]})}function bpt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"12",cy:"12",r:"8.25"}),a.jsx("path",{d:"M3.75 12h16.5M12 3.75c2.1 2.2 3.2 4.95 3.2 8.25S14.1 18.05 12 20.25M12 3.75C9.9 5.95 8.8 8.7 8.8 12s1.1 6.05 3.2 8.25"})]})}function ypt(e){let t=2166136261;for(const i of e)t^=i.charCodeAt(0),t=Math.imul(t,16777619);const n=t>>>0;return{"--avatar-hue-a":194+n%22,"--avatar-hue-b":214+(n>>>6)%25,"--avatar-hue-c":176+(n>>>12)%25,"--avatar-x":`${22+(n>>>18)%55}%`,"--avatar-y":`${18+(n>>>24)%58}%`}}const vpt={super_admin:"account.roles.super_admin",admin:"account.roles.admin",developer:"account.roles.developer",user:"account.roles.user"};function xpt({activePage:e,access:t,userInfo:n,onAgentKitCli:i,onDeveloperResources:r,onSystemInfo:s,onIssueFeedback:o,onLogout:l}){const{t:c,i18n:u}=Te(["sidebar","common"]),[d,f]=p.useState("");if(!n)return null;const h=vet(n)||c("sidebar:account.defaultUser"),m=typeof n.email=="string"?n.email.trim():"",g=ypt(h),b=xet(n),v=b===d?"":b,y=pA(u.resolvedLanguage??u.language)??hA;return a.jsx("div",{className:"sidebar-user",children:a.jsxs("div",{className:"sidebar-user-row",children:[a.jsxs(er,{modal:!0,children:[a.jsx(er.Trigger,{children:a.jsxs("button",{type:"button",className:"sidebar-user-btn",title:h,children:[a.jsx("span",{className:`account-avatar${v?" has-image":""}`,style:g,"aria-hidden":"true",children:v?a.jsx("img",{className:"account-avatar-image",src:v,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>f(v)}):null}),a.jsx("span",{className:"sidebar-user-identity",children:a.jsx("span",{className:"sidebar-user-name",children:h})})]})}),a.jsxs(er.Content,{side:"top",align:"start",sideOffset:4,minWidth:216,children:[a.jsxs("div",{className:"account-menu-head",children:[a.jsx("span",{className:`account-avatar account-avatar--lg${v?" has-image":""}`,style:g,"aria-hidden":"true",children:v?a.jsx("img",{className:"account-avatar-image",src:v,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>f(v)}):null}),a.jsxs("div",{className:"account-id",children:[a.jsxs("div",{className:"account-name-row",children:[a.jsx("div",{className:"account-name",children:h}),a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",pill:!0,children:c(`sidebar:${vpt[t.role]}`)})]}),m&&m!==h&&a.jsx("div",{className:"account-sub",children:m})]})]}),a.jsxs(er.Item,{className:"account-menu-action",onSelect:s,children:[a.jsx(gm,{className:"icon","aria-hidden":"true"}),c("sidebar:account.systemInfo")]}),a.jsxs(er.Sub,{children:[a.jsx(er.SubTrigger,{className:"account-menu-action",children:a.jsxs("span",{className:"account-menu-action__label",children:[a.jsx(bpt,{className:"icon"}),c("sidebar:account.language")]})}),a.jsx(er.SubContent,{sideOffset:6,minWidth:136,children:a.jsx(er.RadioGroup,{value:y,onChange:w=>{Aqe(w)},indicatorPosition:"end",children:jU.map(w=>a.jsx(er.RadioItem,{value:w,children:c(`common:languageNames.${w}`)},w))})})]}),a.jsxs(er.Item,{className:"account-menu-action",onSelect:o,children:[a.jsx(bIe,{className:"icon"}),c("sidebar:account.issueFeedback")]}),a.jsxs(er.Item,{className:"account-menu-action",onSelect:l,children:[a.jsx(Qat,{className:"icon","aria-hidden":"true"}),c("sidebar:account.logout")]})]})]}),a.jsxs("div",{className:"sidebar-user-shortcuts","aria-label":c("sidebar:account.shortcuts"),children:[a.jsx(Ea,{compact:!0,content:c("sidebar:account.tryCli"),children:a.jsx("button",{type:"button",className:"sidebar-user-shortcut",onClick:i,"aria-label":c("sidebar:account.tryCli"),children:a.jsx(aat,{className:"icon"})})}),a.jsx(Ea,{compact:!0,content:c("sidebar:account.developerResources"),children:a.jsx("button",{type:"button",className:`sidebar-user-shortcut${e==="developer-resources"?" is-active":""}`,onClick:r,"aria-label":c("sidebar:account.developerResources"),"aria-current":e==="developer-resources"?"page":void 0,children:a.jsx(Kst,{className:"icon"})})})]})]})})}function wpt({branding:e,cloudProvider:t,sessions:n,currentSessionId:i,activePage:r,features:s,access:o,streamingSids:l,evaluatingSids:c,sandboxHistory:u,onNewChat:d,onSearch:f,onQuickCreate:h,onLibrary:m,onReviewCenter:g,onAddAgent:b,onMyAgents:v,onWorkspace:y,onApplications:w,onCronJobs:x,onAgentKitCli:O,onDeveloperResources:k,onSystemInfo:S,onUserManagement:C,onIssueFeedback:E,onPickSession:j,onDeleteSession:T,userInfo:R,onLogout:A}){const{t:N}=Te("sidebar"),P=V=>(s==null?void 0:s[V])!==!1,I=o.role==="admin"||o.role==="super_admin",D=o.capabilities.manageUsers&&!!C,[_,L]=p.useState(null),F=p.useRef(typeof window<"u"&&window.matchMedia(_ee).matches),[M,z]=p.useState(F.current),q=n.map(V=>({id:V.id,title:V.title||nM(V.events,N("history.newConversation")),createdAt:(V.lastUpdateTime??0)*1e3})).sort((V,Z)=>Z.createdAt-V.createdAt),U=()=>{F.current=!1,z(V=>!V),L(null)};p.useEffect(()=>{const V=window.matchMedia(_ee),Z=ne=>{ne.matches?z(W=>W||(F.current=!0,!0)):F.current&&(F.current=!1,z(!1))};return V.addEventListener("change",Z),()=>V.removeEventListener("change",Z)},[]);const J=t==="byteplus"?aH:hM;return a.jsxs("aside",{className:`sidebar ${M?"is-collapsed":""}`,children:[a.jsxs("div",{className:"sidebar-top",children:[a.jsxs("div",{className:"sidebar-brand-row",children:[a.jsxs("button",{type:"button",className:"brand",onClick:d,"aria-label":N("navigation.home"),title:N("navigation.home"),children:[a.jsx("img",{className:"brand-logo",src:e.logoUrl||J,width:20,height:20,alt:"","aria-hidden":!0}),a.jsx("span",{className:"brand-title",children:e.title})]}),a.jsx("button",{type:"button",className:"sidebar-collapse-toggle",onClick:U,"aria-label":N(M?"navigation.expand":"navigation.collapse"),title:N(M?"navigation.expand":"navigation.collapse"),children:M?a.jsx(ipt,{className:"icon"}):a.jsx(npt,{className:"icon"})})]}),a.jsxs("nav",{className:"sidebar-nav","aria-label":N("navigation.label"),children:[P("newChat")&&a.jsxs("button",{className:`new-chat new-chat--conversation${r==="new-chat"?" is-active":""}`,onClick:d,"aria-label":N("navigation.newChat"),"aria-current":r==="new-chat"?"page":void 0,title:N("navigation.newChat"),children:[a.jsx(rpt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.newChat")})]}),P("search")&&a.jsx(cpt,{active:r==="search",onClick:f}),a.jsxs("button",{className:`new-chat new-chat--agents${r==="agents"?" is-active":""}`,onClick:v,"aria-label":N("navigation.agents"),"aria-current":r==="agents"?"page":void 0,title:N("navigation.agents"),children:[a.jsx(apt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.agents")})]}),a.jsxs("button",{className:`new-chat new-chat--workspaces${r==="workspaces"?" is-active":""}`,onClick:y,"aria-label":N("navigation.workspaces"),"aria-current":r==="workspaces"?"page":void 0,title:N("navigation.workspaces"),children:[a.jsx(Oat,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.workspaces")})]}),a.jsxs("button",{className:`new-chat new-chat--library${r==="library"?" is-active":""}`,onClick:m,"aria-label":N("navigation.library"),"aria-current":r==="library"?"page":void 0,title:N("navigation.library"),children:[a.jsx(mIe,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.library")})]}),a.jsxs("button",{className:`new-chat new-chat--cronjobs${r==="cronjobs"?" is-active":""}`,onClick:x,"aria-label":N("navigation.cronjobs"),"aria-current":r==="cronjobs"?"page":void 0,title:N("navigation.cronjobs"),children:[a.jsx(hV,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.cronjobs")})]}),a.jsxs("button",{className:`new-chat new-chat--applications${r==="applications"?" is-active":""}`,onClick:w,"aria-label":N("navigation.automations"),"aria-current":r==="applications"?"page":void 0,title:N("navigation.automations"),children:[a.jsx(gpt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.automations")})]})]}),I||D?a.jsxs("nav",{className:"sidebar-nav sidebar-nav--administration","aria-label":N("navigation.administration"),children:[a.jsx("div",{className:"sidebar-nav-group-title","aria-hidden":"true",children:N("navigation.administration")}),I?a.jsxs("button",{type:"button",className:`new-chat new-chat--review-center${r==="review-center"?" is-active":""}`,onClick:g,"aria-label":N("navigation.reviewCenter"),"aria-current":r==="review-center"?"page":void 0,title:N("navigation.reviewCenter"),children:[a.jsx(mpt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.reviewCenter")})]}):null,D?a.jsxs("button",{type:"button",className:`new-chat${r==="users"?" is-active":""}`,onClick:C,"aria-label":N("navigation.users"),"aria-current":r==="users"?"page":void 0,title:N("navigation.users"),children:[a.jsx($ot,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.users")})]}):null]}):null]}),P("history")&&a.jsxs("div",{className:"sidebar-history",children:[a.jsxs("div",{className:"history-head",children:[a.jsx("span",{children:N("history.title")}),P("newChat")&&a.jsx("button",{type:"button",className:"history-new-chat",onClick:(u==null?void 0:u.onNew)??d,disabled:u==null?void 0:u.newDisabled,"aria-label":N("history.create"),title:N("history.create"),children:a.jsx(sc,{className:"icon"})})]}),a.jsx("div",{className:"history-list",children:u?a.jsxs(a.Fragment,{children:[u.loading&&u.threads.length===0?a.jsx("div",{className:"history-empty",role:"status",children:N("history.loading")}):null,u.error?a.jsx("div",{className:"history-error",role:"alert",children:u.error}):null,!u.loading&&!u.error&&u.threads.length===0?a.jsx("div",{className:"history-empty",children:N("history.empty")}):null,u.threads.map(V=>{const Z=V.id===u.currentThreadId,ne=V.name||V.preview||`Thread ${V.id.slice(0,8)}`,W=V.id===u.busyThreadId;return a.jsxs("div",{className:`history-item ${Z?"active":""}`,children:[a.jsxs("button",{type:"button",className:"history-item-btn",onClick:()=>u.onSelect(V.id),"aria-current":Z?"page":void 0,title:ne,disabled:W,children:[a.jsx(jee,{title:ne}),Z?a.jsx("span",{className:"history-current-badge",children:N("history.current")}):null]}),a.jsx("button",{type:"button",className:"history-more","aria-label":N("history.manage",{title:ne}),title:N("history.more"),disabled:W,onClick:()=>L(G=>G===V.id?null:V.id),children:a.jsx(KJ,{className:"icon"})}),_===V.id?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"menu-scrim",onClick:()=>L(null)}),a.jsx("div",{className:"history-menu",children:a.jsxs("button",{type:"button",className:"menu-item menu-item--danger",onClick:()=>{L(null),u.onDelete(V)},children:[a.jsx(eb,{className:"icon"})," ",N("history.delete")]})})]}):null]},V.id)}),u.hasMore?a.jsx("button",{type:"button",className:"history-load-more",disabled:u.loading,onClick:u.onLoadMore,children:u.loading?N("history.loadingMore"):N("history.loadMore")}):null]}):a.jsxs(a.Fragment,{children:[q.length===0?a.jsx("div",{className:"history-empty",children:N("history.empty")}):null,q.map(V=>{const Z=V.id===i,ne=(l==null?void 0:l.has(V.id))===!0,W=!ne&&(c==null?void 0:c.has(V.id))===!0;return a.jsxs("div",{className:`history-item ${Z?"active":""}`,children:[a.jsxs("button",{className:"history-item-btn",onClick:()=>j(V.id),"aria-current":Z?"page":void 0,title:V.title,children:[a.jsx(jee,{title:V.title}),W&&a.jsxs("span",{className:"history-evaluating-status",title:N("history.evaluatingTitle"),children:[a.jsx("span",{className:"history-evaluating","aria-hidden":"true"}),N("history.evaluating")]})]}),a.jsxs("div",{className:"history-action-slot",children:[ne?a.jsx(QA,{className:"history-streaming-indicator",size:12,role:"status","aria-label":N("history.generating")}):null,a.jsx("button",{type:"button",className:"history-more","aria-label":N("history.manage",{title:V.title}),title:N("history.more"),onClick:()=>L(G=>G===V.id?null:V.id),children:a.jsx(KJ,{className:"icon"})})]}),_===V.id&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"menu-scrim",onClick:()=>L(null)}),a.jsx("div",{className:"history-menu",children:a.jsxs("button",{type:"button",className:"menu-item menu-item--danger",onClick:()=>{L(null),T(V.id)},children:[a.jsx(eb,{className:"icon"})," ",N("history.delete")]})})]})]},V.id)})]})})]}),a.jsx("div",{className:"sidebar-footer",children:a.jsx(xpt,{activePage:r,access:o,userInfo:R,onAgentKitCli:O,onDeveloperResources:k,onSystemInfo:S,onIssueFeedback:E,onLogout:A})})]})}const Opt={name:"studio_share_space"},kpt={name:"studio_review_space"},yIe={share:Opt,review:kpt},Spt=yIe.share.name,vIe=yIe.review.name,Ept=[Spt,vIe];function xIe(e){return Ept.includes(e.trim().toLowerCase())}function Cpt(e){return e.name===vIe}const Apt="/web/skill-management";class Zw extends Error{constructor(t,n,i="SKILL_MANAGEMENT_ERROR",r="",s,o=""){super(t),this.status=n,this.code=i,this.statusText=r,this.originalError=s,this.rawResponse=o,this.name="SkillManagementApiError"}}async function hc(e,t={},n=ho){return fetch(ja(`${Apt}${e}`),{...t,headers:ul(fc(t.headers)),signal:po(t.signal,n)})}async function YA(e,t){let n=t,i="SKILL_MANAGEMENT_ERROR",r;const s=await e.text().catch(()=>"");try{const o=JSON.parse(s);typeof o.detail=="string"?n=o.detail:o.detail&&(n=o.detail.message||t,i=o.detail.code||i,r=o.detail.originalError)}catch{s.trim()&&(n=Q("common.fallbackWithDetail",{fallback:t,detail:s.trim()}))}return new Zw(n,e.status,i,e.statusText,r,s)}async function pc(e,t){if(!e.ok)throw await YA(e,t);return e.json()}async function Tpt(e){const t=new URLSearchParams({region:e.region,page:String(e.page),page_size:String(e.pageSize)});return e.project&&t.set("project",e.project),pc(await hc(`/spaces?${t}`,{signal:e.signal}),Q("skills.listSpacesFailed"))}async function _pt(e){if(xIe(e.name))throw new Zw(Q("skills.reservedSpaceName"),409,"SKILL_SPACE_RESERVED_IDENTITY");return pc(await hc("/spaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Q("skills.createSpaceFailed"))}async function jpt(e){const t=new URLSearchParams({region:e.region});return pc(await hc(`/shared-space/ensure?${t}`,{method:"POST",signal:e.signal}),Q("skills.sharedSpaceFailed"))}async function Npt(e){return pc(await hc(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/review`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({region:e.region,version:e.version})},mr),Q("skills.submitReviewFailed"))}async function Rpt(e){const t=new URLSearchParams({region:e.region});return pc(await hc(`/reviews?${t}`,{signal:e.signal}),Q("skills.listReviewsFailed"))}async function Ipt(e){const t=new URLSearchParams({region:e.region});return pc(await hc(`/reviews/${encodeURIComponent(e.id)}/files?${t}`,{signal:e.signal},mr),Q("skills.reviewFilesFailed"))}async function Ppt(e){return pc(await hc(`/reviews/${encodeURIComponent(e.id)}/decision`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({region:e.region,decision:e.decision,reason:e.reason||"",comment:e.comment||""})},mr),Q("skills.decideReviewFailed"))}async function Dpt(e){const t=new URLSearchParams({region:e.region});return pc(await hc(`/spaces/${encodeURIComponent(e.spaceId)}/reviews?${t}`,{signal:e.signal}),Q("skills.listReviewsFailed"))}async function Mpt(e){if(xIe(e.name))throw new Zw(Q("skills.reservedSpaceName"),409,"SKILL_SPACE_RESERVED_IDENTITY");return pc(await hc(`/spaces/${encodeURIComponent(e.spaceId)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e.name,description:e.description,region:e.region})}),Q("skills.updateSpaceFailed"))}async function Lpt(e){const t=new URLSearchParams({region:e.region});await pc(await hc(`/spaces/${encodeURIComponent(e.spaceId)}?${t}`,{method:"DELETE"}),Q("skills.deleteSpaceFailed"))}async function $pt(e){const t=new URLSearchParams({region:e.region});return e.project&&t.set("project",e.project),pc(await hc(`/spaces/${encodeURIComponent(e.spaceId)}/skills?${t}`,{method:"POST",headers:{"Content-Type":"application/zip"},body:e.file},mr),Q("skills.uploadFailed"))}async function Fpt(e){return pc(await hc("/validate",{method:"POST",headers:{"Content-Type":"application/zip"},body:e},mr),Q("skills.validateFailed"))}async function Bpt(e){const t=new URLSearchParams({region:e.region});await pc(await hc(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}?${t}`,{method:"DELETE"}),Q("skills.deleteFailed"))}async function wIe(e){const t=new URLSearchParams({region:e.region});e.version&&t.set("version",e.version),e.skillSpaceName&&t.set("skill_space_name",e.skillSpaceName),e.skillName&&t.set("skill_name",e.skillName);const n=await pc(await hc(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/files?${t}`),Q("skills.listFilesFailed"));return Array.isArray(n.files)?n.files:[]}async function Upt(e){var l;const t=new URLSearchParams({region:e.region});e.version&&t.set("version",e.version),e.skillSpaceName&&t.set("skill_space_name",e.skillSpaceName),e.skillName&&t.set("skill_name",e.skillName);const n=await hc(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/archive?${t}`,{},mr);n.ok||await pc(n,Q("skills.downloadFailed"));const r=((l=(n.headers.get("content-disposition")||"").match(/filename="([^"]+)"/))==null?void 0:l[1])||`${e.fallbackName}.zip`,s=URL.createObjectURL(await n.blob()),o=document.createElement("a");o.href=s,o.download=r,o.click(),URL.revokeObjectURL(s)}yn.hasResourceBundle("en-US","create")||yn.addResourceBundle("en-US","create",ehe,!0,!0);yn.hasResourceBundle("zh-CN","create")||yn.addResourceBundle("zh-CN","create",ave,!0,!0);function Xt(e,t={}){return yn.t(e,{...t,ns:"create"})}function Pc(e){var t;return((t=e==null?void 0:e.displayName)==null?void 0:t.trim())||(e==null?void 0:e.name)||""}async function pM(e,t){const n=await fetch(ja(e),{headers:ul(fc({accept:"application/json"})),signal:po(t,ho)});if(!n.ok)throw await YA(n,Xt("helpers.skills.agentKitRequestFailed"));return n.json()}async function OIe(){return((await pM("/web/skill-spaces")).items||[]).filter(t=>!Cpt(t))}async function kIe(e,t){const n=t?`?region=${encodeURIComponent(t)}`:"";return(await pM(`/web/skill-spaces/${encodeURIComponent(e)}/skills${n}`)).items||[]}async function SIe(e,t){const n=new URLSearchParams({region:t.region,page:String(t.page),page_size:String(t.pageSize)});return t.project&&n.set("project",t.project),pM(`/web/skill-spaces/${encodeURIComponent(e)}/skills?${n.toString()}`,t.signal)}async function Qpt(e,t,n,i,r,s,o){const l=[];n&&l.push(`version=${encodeURIComponent(n)}`),i&&l.push(`region=${encodeURIComponent(i)}`),r&&l.push(`project=${encodeURIComponent(r)}`),s&&l.push(`skill_name=${encodeURIComponent(s)}`),o&&l.push(`skill_space_name=${encodeURIComponent(o)}`);const c=l.length>0?`?${l.join("&")}`:"";return pM(`/web/skill-spaces/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}${c}`)}function zpt(e,t){const n=Cy(t);return{source:"skillspace",id:`ss:${e.id}/${n}/${t.version}`,name:t.skillName,description:t.skillDescription,folder:t.skillName,skillSpaceId:e.id,skillSpaceName:e.name,skillSpaceRegion:e.region,skillId:n,version:t.version}}function Cy(e){return e.skillId||e.skillName}function Vpt(e,t,n="volcengine"){return n==="byteplus"?"":`https://console.volcengine.com/agentkit/${(t||"cn-beijing")==="cn-beijing"?"cn":"cn-shanghai"}/skillspace/detail/${encodeURIComponent(e)}`}const Hpt="data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20overflow='visible'%20style='display:%20block;'%20width='7.93649'%20height='8'%20viewBox='0%200%207.93649%208'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20id='Resizer'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.21499%200L0%207.27273L0.721499%208L7.93649%200.727273L7.21499%200ZM6.86867%203.99988L3.98268%206.90897L4.70418%207.63625L7.59017%204.72715L6.86867%203.99988Z'%20fill='%23737A87'/%3e%3c/svg%3e";function EIe({className:e="",counter:t,maxHeight:n,...i}){return a.jsxs("div",{className:`studio-textarea ${e}`.trim(),"data-counter":t!=null||void 0,style:{maxHeight:n},children:[a.jsx("textarea",{...i,className:"studio-textarea__input"}),t!=null&&a.jsx("span",{className:"studio-textarea__counter",children:t}),a.jsx("img",{className:"studio-textarea__resizer",src:Hpt,alt:"","aria-hidden":"true"})]})}async function CIe(e,t,n){const i=new URLSearchParams({region:e.region}),r=await fetch(ja(`/web/skill-management/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/document?${i}`),{...t,headers:ul(fc(t.headers)),signal:po(e.signal,n)});if(!r.ok)throw await YA(r,"SKILL_DOCUMENT_REQUEST_FAILED");return r.json()}function qpt(e){return CIe(e,{},ho)}function Wpt(e){return CIe(e,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:e.content,baseVersion:e.baseVersion})},mr)}function Kpt({target:e,onClose:t,onSaved:n}){const{t:i}=Te("workspaceTools"),[r,s]=p.useState(null),[o,l]=p.useState(""),[c,u]=p.useState(!0),[d,f]=p.useState(!1),[h,m]=p.useState(""),[g,b]=p.useState(0),[v,y]=p.useState(!1),w=p.useId(),x=p.useRef(null),O=p.useRef(!1),k=p.useRef(!0),S=p.useRef({dirty:!1,onClose:t});S.current={dirty:r!==null&&o!==r.content,onClose:t};const C=p.useRef(null);function E(){O.current||(S.current.dirty?y(!0):S.current.onClose())}p.useEffect(()=>{var N,P;k.current=!0;const T=window.document.activeElement instanceof HTMLElement?window.document.activeElement:null,R=window.document.body.style.overflow;window.document.body.style.overflow="hidden",(P=(N=x.current)==null?void 0:N.querySelector("button"))==null||P.focus();function A(I){var _,L;if(I.isComposing||(I.key==="Escape"&&(I.preventDefault(),E()),I.key!=="Tab"))return;const D=Array.from(((_=x.current)==null?void 0:_.querySelectorAll('button:not([disabled]),textarea:not([disabled]),[tabindex="0"]'))??[]);D.length&&(I.shiftKey&&window.document.activeElement===D[0]?(I.preventDefault(),(L=D[D.length-1])==null||L.focus()):!I.shiftKey&&window.document.activeElement===D[D.length-1]&&(I.preventDefault(),D[0].focus()))}return window.addEventListener("keydown",A),()=>{var I;k.current=!1,(I=C.current)==null||I.abort(),window.removeEventListener("keydown",A),window.document.body.style.overflow=R,T!=null&&T.isConnected&&T.focus()}},[]),p.useEffect(()=>{const T=new AbortController;return u(!0),m(""),qpt({...e,signal:T.signal}).then(R=>{T.signal.aborted||(s(R),l(R.content))}).catch(()=>{T.signal.aborted||m("documentLoadFailed")}).finally(()=>{T.signal.aborted||u(!1)}),()=>T.abort()},[e,g]);async function j(){if(O.current||!(r!=null&&r.canUpdate)||o===r.content||!o.trim())return;O.current=!0,f(!0),m("");const T=new AbortController;C.current=T;try{await Wpt({...e,content:o,baseVersion:r.baseVersion,signal:T.signal}),k.current&&(n(),t())}catch(R){k.current&&m(R instanceof Zw&&R.status===409?"documentConflict":R instanceof Zw&&R.status===403?"accessDenied":"documentSaveFailed")}finally{O.current=!1,k.current&&f(!1)}}return vi.createPortal(a.jsx("div",{className:"mpa-skill-editor-backdrop",children:a.jsxs("section",{className:"mpa-skill-editor",role:"dialog","aria-modal":"true","aria-labelledby":w,ref:x,children:[a.jsxs("header",{children:[a.jsxs("h2",{id:w,children:[e.name," · SKILL.md"]}),a.jsx(Ki,{variant:"ghost",disabled:d,onClick:E,children:i("agentTopology.close")})]}),a.jsx("p",{className:"mpa-skill-editor-hint",children:i("agentTopology.documentEditHint")}),c?a.jsx("p",{role:"status",children:i("agentTopology.documentLoading")}):r?a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[r.baseVersion," ·"," ",i(r.canUpdate?"agentTopology.documentWritable":"agentTopology.documentReadOnly")]}),a.jsx(EIe,{"aria-label":"SKILL.md",value:o,readOnly:!r.canUpdate,disabled:d,maxLength:262144,spellCheck:!1,onChange:T=>l(T.currentTarget.value)})]}):null,h&&a.jsx("p",{role:"alert",children:i(`agentTopology.${h}`)}),v&&a.jsxs("div",{role:"alert",children:[a.jsx("p",{children:i("agentTopology.discardDocument")}),a.jsx(Ki,{variant:"outline",onClick:()=>y(!1),children:i("agentTopology.keepEditing")}),a.jsx(Ki,{variant:"secondary",onClick:t,children:i("agentTopology.discardChanges")})]}),a.jsxs("footer",{children:[!r&&!c&&a.jsx(Ki,{variant:"outline",onClick:()=>b(T=>T+1),children:i("agentTopology.refresh")}),(r==null?void 0:r.canUpdate)&&a.jsx(Ki,{loading:d,disabled:c||o===r.content||!o.trim(),onClick:()=>void j(),children:i("agentTopology.saveDocument")})]})]})}),window.document.body)}function pC(e){return e.trimEnd().replace(/[。.]+$/,"")}function AIe({selected:e,onChange:t,cloudProvider:n="volcengine"}){const{t:i}=Te("create"),[r,s]=p.useState([]),[o,l]=p.useState([]),[c,u]=p.useState(""),[d,f]=p.useState(!0),[h,m]=p.useState(!1),[g,b]=p.useState(null);p.useEffect(()=>{let O=!1;return(async()=>{f(!0),b(null);try{const k=await OIe();O||(s(k),k.length>0&&u(k[0].id))}catch(k){O||b(k instanceof Error?k.message:i("skills.space.loadError"))}finally{O||f(!1)}})(),()=>{O=!0}},[i]),p.useEffect(()=>{if(!c){l([]);return}const O=r.find(S=>S.id===c);let k=!1;return(async()=>{m(!0),b(null);try{const S=await kIe(c,O==null?void 0:O.region);k||l(S)}catch(S){k||b(S instanceof Error?S.message:i("skills.space.loadError"))}finally{k||m(!1)}})(),()=>{k=!0}},[c,r,i]);const v=r.find(O=>O.id===c),y=v?Vpt(v.id,v.region,n):"",w=(O,k)=>e.some(S=>S.source==="skillspace"&&S.skillId===O&&(S.version||"")===k),x=O=>{if(!v)return;const k=Cy(O);if(w(k,O.version))t(e.filter(S=>!(S.source==="skillspace"&&S.skillId===k&&(S.version||"")===O.version)));else{const S=zpt(v,O);t([...e,{source:"skillspace",folder:S.folder||O.skillName,name:S.name,description:S.description,skillSpaceId:S.skillSpaceId,skillSpaceName:S.skillSpaceName,skillSpaceRegion:S.skillSpaceRegion,skillId:S.skillId,version:S.version}])}};return a.jsx("div",{className:"cw-skillspace",children:d?a.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[a.jsx(Bi,{className:"cw-i cw-spin"})," ",i("skills.space.loadingSpaces")]}):g?a.jsxs("div",{className:"cw-banner",children:[a.jsx(gm,{className:"cw-i"}),a.jsx("span",{children:g})]}):r.length===0?a.jsx("p",{className:"cw-empty-line",children:i("skills.space.noSpaces")}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"cw-skillspace-header",children:[a.jsx("select",{className:"cw-input cw-skillspace-select",value:c,onChange:O=>u(O.target.value),"aria-label":i("skills.space.selectSpace"),children:r.map(O=>a.jsxs("option",{value:O.id,children:[Pc(O)||O.id,O.description?` — ${pC(O.description)}`:""]},O.id))}),v&&a.jsxs(a.Fragment,{children:[v.region&&a.jsx("span",{className:"cw-skillspace-region-label",title:v.region,children:xh(v.region,n)}),y&&a.jsx("a",{href:y,target:"_blank",rel:"noopener noreferrer",className:"cw-button cw-button-secondary cw-skillspace-console-link",title:i("skills.space.openConsole"),"aria-label":i("skills.space.openConsole"),children:a.jsx(d0,{className:"cw-i cw-i-sm"})})]})]}),h?a.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[a.jsx(Bi,{className:"cw-i cw-spin"})," ",i("skills.space.loadingSkills")]}):o.length===0?a.jsx("p",{className:"cw-empty-line",children:i("skills.space.noSkills")}):a.jsx("div",{className:"cw-skill-results",children:o.map(O=>{const k=Cy(O),S=w(k,O.version);return a.jsxs("button",{type:"button",className:`cw-skill-result ${S?"is-on":""}`,onClick:()=>x(O),"aria-pressed":S,children:[a.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:S?a.jsx(Cf,{className:"cw-i cw-i-sm"}):a.jsx(sc,{className:"cw-i cw-i-sm"})}),a.jsxs("span",{className:"cw-skill-result-meta",children:[a.jsxs("span",{className:"cw-skill-result-name",children:[O.skillName,O.version&&a.jsxs("span",{className:"cw-skill-result-version",children:[" ","v",O.version]})]}),O.skillDescription&&a.jsx("span",{className:"cw-skill-result-desc",children:pC(O.skillDescription)}),a.jsxs("span",{className:"cw-skill-result-repo",children:[a.jsx(Tat,{className:"cw-i cw-i-sm"})," ",Pc(v)||c]})]})]},`${k}/${O.version}`)})})]})})}function ZA(e,t){return e.map(n=>({...n,get label(){return Xt(`${t}.${n.id}.label`)},get desc(){return Xt(`${t}.${n.id}.description`)}}))}function hd(e,t){const n={...e};for(const[i,r]of Object.entries(t))Object.defineProperty(n,i,{configurable:!0,enumerable:!0,get:()=>Xt(r)});return n}const TIe="https://ark.cn-beijing.volces.com/api/v3/";hd({key:"MODEL_AGENT_NAME",required:!1,placeholder:"doubao-seed-1-6-250615"},{comment:"traditional.catalog.env.modelAgentName.comment"});const ON=[hd({key:"MODEL_EMBEDDING_NAME",required:!1,placeholder:"doubao-embedding-vision-250615"},{comment:"traditional.catalog.env.embeddingModelName.comment"}),{key:"MODEL_EMBEDDING_DIM",required:!1,placeholder:"2048"},{key:"MODEL_EMBEDDING_API_BASE",required:!1,placeholder:TIe}],mI=[],gI={get label(){return Xt("traditional.catalog.links.console")},url:"https://console.volcengine.com/vikingdb/openviking"},Gpt={get label(){return Xt("traditional.catalog.links.documentation")},url:"https://github.com/volcengine/OpenViking/blob/main/docs/zh/api/05-sessions.md"},_Ie="https://api.vikingdb.cn-beijing.volces.com/openviking",Xpt=`{ +`)},Oct=0,Pv=[];function kct(e){var t=p.useRef([]),n=p.useRef([0,0]),i=p.useRef(),r=p.useState(Oct++)[0],s=p.useState(QNe)[0],o=p.useRef(e);p.useEffect(function(){o.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var b=Vlt([e.lockRef.current],(e.shards||[]).map(vee),!0).filter(Boolean);return b.forEach(function(v){return v.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),b.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var l=p.useCallback(function(b,v){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!o.current.allowPinchZoom;var y=d_(b),w=n.current,x="deltaX"in b?b.deltaX:w[0]-y[0],O="deltaY"in b?b.deltaY:w[1]-y[1],k,S=b.target,C=Math.abs(x)>Math.abs(O)?"h":"v";if("touches"in b&&C==="h"&&S.type==="range")return!1;var E=window.getSelection(),j=E&&E.anchorNode,T=j?j===S||j.contains(S):!1;if(T)return!1;var R=bee(C,S);if(!R)return!0;if(R?k=C:(k=C==="v"?"h":"v",R=bee(C,S)),!R)return!1;if(!i.current&&"changedTouches"in b&&(x||O)&&(i.current=k),!k)return!0;var A=i.current||k;return vct(A,v,b,A==="h"?x:O)},[]),c=p.useCallback(function(b){var v=b;if(!(!Pv.length||Pv[Pv.length-1]!==s)){var y="deltaY"in v?yee(v):d_(v),w=t.current.filter(function(k){return k.name===v.type&&(k.target===v.target||v.target===k.shadowParent)&&xct(k.delta,y)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var x=(o.current.shards||[]).map(vee).filter(Boolean).filter(function(k){return k.contains(v.target)}),O=x.length>0?l(v,x[0]):!o.current.noIsolation;O&&v.cancelable&&v.preventDefault()}}},[]),u=p.useCallback(function(b,v,y,w){var x={name:b,delta:v,target:y,should:w,shadowParent:Sct(y)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(O){return O!==x})},1)},[]),d=p.useCallback(function(b){n.current=d_(b),i.current=void 0},[]),f=p.useCallback(function(b){u(b.type,yee(b),b.target,l(b,e.lockRef.current))},[]),h=p.useCallback(function(b){u(b.type,d_(b),b.target,l(b,e.lockRef.current))},[]);p.useEffect(function(){return Pv.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Iv),document.addEventListener("touchmove",c,Iv),document.addEventListener("touchstart",d,Iv),function(){Pv=Pv.filter(function(b){return b!==s}),document.removeEventListener("wheel",c,Iv),document.removeEventListener("touchmove",c,Iv),document.removeEventListener("touchstart",d,Iv)}},[]);var m=e.removeScrollBar,g=e.inert;return p.createElement(p.Fragment,null,g?p.createElement(s,{styles:wct(r)}):null,m?p.createElement(fct,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Sct(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ect=Jlt(UNe,kct);var IV=p.forwardRef(function(e,t){return p.createElement(sM,Zf({},e,{ref:t,sideCar:Ect}))});IV.classNames=sM.classNames;var Cct=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Dv=new WeakMap,f_=new WeakMap,h_={},t4=0,qNe=function(e){return e&&(e.host||qNe(e.parentNode))},Act=function(e,t){return t.map(function(n){if(e.contains(n))return n;var i=qNe(n);return i&&e.contains(i)?i:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Tct=function(e,t,n,i){var r=Act(t,Array.isArray(e)?e:[e]);h_[n]||(h_[n]=new WeakMap);var s=h_[n],o=[],l=new Set,c=new Set(r),u=function(f){!f||l.has(f)||(l.add(f),u(f.parentNode))};r.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(h){if(l.has(h))d(h);else try{var m=h.getAttribute(i),g=m!==null&&m!=="false",b=(Dv.get(h)||0)+1,v=(s.get(h)||0)+1;Dv.set(h,b),s.set(h,v),o.push(h),b===1&&g&&f_.set(h,!0),v===1&&h.setAttribute(n,"true"),g||h.setAttribute(i,"true")}catch(y){console.error("aria-hidden: cannot operate on ",h,y)}})};return d(t),l.clear(),t4++,function(){o.forEach(function(f){var h=Dv.get(f)-1,m=s.get(f)-1;Dv.set(f,h),s.set(f,m),h||(f_.has(f)||f.removeAttribute(i),f_.delete(f)),m||f.removeAttribute(n)}),t4--,t4||(Dv=new WeakMap,Dv=new WeakMap,f_=new WeakMap,h_={})}},WNe=function(e,t,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),r=Cct(e);return r?(i.push.apply(i,Array.from(r.querySelectorAll("[aria-live], script"))),Tct(i,r,n,"aria-hidden")):function(){return null}},_ct=Object.defineProperty,jct=(e,t)=>_ct(e,"name",{value:t,configurable:!0});function XA(e){const[t,n]=p.useState(void 0);return xd(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const i=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const s=r[0];let o,l;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,l=u.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}else n(void 0)},[e]),t}jct(XA,"useSize");var Nct=Object.defineProperty,Yp=(e,t)=>Nct(e,"name",{value:t,configurable:!0}),PV="Checkbox",[Rct,ghn]=Hc(PV),[Ict,DV]=Rct(PV);function KNe(e){const{__scopeCheckbox:t,checked:n,children:i,defaultChecked:r,disabled:s,form:o,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=e,[h,m]=jd({prop:n,defaultProp:r??!1,onChange:c,caller:PV}),[g,b]=p.useState(null),[v,y]=p.useState(null),w=p.useRef(!1),[x,O]=p.useReducer(C=>C+1,0),k=g?!!o||!!g.closest("form"):!0,S={checked:h,disabled:s,setChecked:m,control:g,setControl:b,name:l,form:o,value:d,hasConsumerStoppedPropagationRef:w,userInteractionCount:x,onUserInteraction:O,required:u,defaultChecked:Mp(r)?!1:r,isFormControl:k,bubbleInput:v,setBubbleInput:y};return a.jsx(Ict,{scope:t,...S,children:GNe(f)?f(S):i})}Yp(KNe,"CheckboxProvider");var Pct="CheckboxTrigger",Dct=p.forwardRef(Yp(function({__scopeCheckbox:t,onKeyDown:n,onClick:i,...r},s){const{control:o,value:l,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,onUserInteraction:g,isFormControl:b,bubbleInput:v}=DV(Pct,t),y=_r(s,f),w=p.useRef(u);return p.useEffect(()=>{const x=o==null?void 0:o.form;if(x){const O=Yp(()=>h(w.current),"reset");return x.addEventListener("reset",O),()=>x.removeEventListener("reset",O)}},[o,h]),a.jsx(Xr.button,{type:"button",role:"checkbox","aria-checked":Mp(u)?"mixed":u,"aria-required":d,"data-state":MV(u),"data-disabled":c?"":void 0,disabled:c,value:l,...r,ref:y,onKeyDown:Qn(n,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:Qn(i,x=>{g(),h(O=>Mp(O)?!0:!O),v&&b&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})})},"CheckboxTrigger")),Mct=p.forwardRef(Yp(function(t,n){const{__scopeCheckbox:i,name:r,checked:s,defaultChecked:o,required:l,disabled:c,value:u,onCheckedChange:d,form:f,...h}=t;return a.jsx(KNe,{__scopeCheckbox:i,checked:s,defaultChecked:o,disabled:c,required:l,onCheckedChange:d,name:r,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>a.jsxs(a.Fragment,{children:[a.jsx(Dct,{...h,ref:n,__scopeCheckbox:i}),m&&a.jsx(Bct,{__scopeCheckbox:i})]})})},"Checkbox")),Lct="CheckboxIndicator",$ct=p.forwardRef(Yp(function(t,n){const{__scopeCheckbox:i,forceMount:r,...s}=t,o=DV(Lct,i);return a.jsx(_h,{present:r||Mp(o.checked)||o.checked===!0,children:a.jsx(Xr.span,{"data-state":MV(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:n,style:{pointerEvents:"none",...t.style}})})},"CheckboxIndicator")),Fct="CheckboxBubbleInput",Bct=p.forwardRef(Yp(function({__scopeCheckbox:t,onClick:n,...i},r){const{control:s,hasConsumerStoppedPropagationRef:o,userInteractionCount:l,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:m,form:g,bubbleInput:b,setBubbleInput:v}=DV(Fct,t),y=_r(r,v),w=XA(s),x=p.useRef(!1),O=p.useRef(c),k=p.useRef(l);p.useEffect(()=>{const C=b;if(!C)return;const E=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(E,"checked").set,R=l!==k.current;k.current=l;const A=O.current!==c;O.current=c;const N=!(R&&o.current);if(A&&T){x.current=!R;const P=new Event("click",{bubbles:N});C.indeterminate=Mp(c),T.call(C,Mp(c)?!1:c),C.dispatchEvent(P),x.current=!1}},[b,c,o,l]);const S=p.useRef(Mp(c)?!1:c);return a.jsx(Xr.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??S.current,required:d,disabled:f,name:h,value:m,form:g,...i,tabIndex:-1,ref:y,onClick:Qn(n,C=>{x.current&&C.stopPropagation()}),style:{...i.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function GNe(e){return typeof e=="function"}Yp(GNe,"isFunction");function Mp(e){return e==="indeterminate"}Yp(Mp,"isIndeterminate");function MV(e){return Mp(e)?"indeterminate":e?"checked":"unchecked"}Yp(MV,"getState");var Uct=Object.defineProperty,Pg=(e,t)=>Uct(e,"name",{value:t,configurable:!0}),XNe="Popper",[YNe,W1]=Hc(XNe),[Qct,ZNe]=YNe(XNe),zct=Pg(e=>{const{__scopePopper:t,children:n}=e,[i,r]=p.useState(null),[s,o]=p.useState(void 0);return a.jsx(Qct,{scope:t,anchor:i,onAnchorChange:r,placementState:s,setPlacementState:o,children:n})},"Popper"),Vct="PopperAnchor",Hct=p.forwardRef(Pg(function(t,n){const{__scopePopper:i,virtualRef:r,...s}=t,o=ZNe(Vct,i),l=p.useRef(null),c=o.onAnchorChange,u=p.useCallback(b=>{l.current=b,b&&c(b)},[c]),d=_r(n,u),f=p.useRef(null);p.useEffect(()=>{if(!r)return;const b=f.current;f.current=r.current,b!==f.current&&c(f.current)});const h=o.placementState&&aM(o.placementState),m=h==null?void 0:h[0],g=h==null?void 0:h[1];return r?null:a.jsx(Xr.div,{"data-radix-popper-side":m,"data-radix-popper-align":g,...s,ref:d})},"PopperAnchor")),JNe="PopperContent",[qct,bhn]=YNe(JNe),Wct=p.forwardRef(Pg(function(t,n){var G,H,se,Y,X,ie,ee;const{__scopePopper:i,side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:b,...v}=t,y=ZNe(JNe,i),[w,x]=p.useState(null),O=_r(n,x),[k,S]=p.useState(null),C=XA(k),E=(C==null?void 0:C.width)??0,j=(C==null?void 0:C.height)??0,T=r+(o!=="center"?"-"+o:""),R=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},A=Array.isArray(d)?d:[d],N=A.length>0,P={padding:R,boundary:A.filter(eRe),altBoundary:N},{refs:I,floatingStyles:D,placement:_,isPositioned:L,middlewareData:F}=G_e({strategy:"fixed",placement:T,whileElementsMounted:Pg((...be)=>aB(...be,{animationFrame:g==="always"}),"whileElementsMounted"),elements:{reference:y.anchor},middleware:[X_e({mainAxis:s+j,alignmentAxis:l}),u&&Y_e({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?Z_e():void 0,...P}),u&&J_e({...P}),eje({...P,apply:Pg(({elements:be,rects:ue,availableWidth:pe,availableHeight:ke})=>{const{width:je,height:Pe}=ue.reference,Ee=be.floating.style;Ee.setProperty("--radix-popper-available-width",`${pe}px`),Ee.setProperty("--radix-popper-available-height",`${ke}px`),Ee.setProperty("--radix-popper-anchor-width",`${je}px`),Ee.setProperty("--radix-popper-anchor-height",`${Pe}px`)},"apply")}),k&&tst({element:k,padding:c}),Kct({arrowWidth:E,arrowHeight:j}),m&&est({strategy:"referenceHidden",...P,boundary:N?P.boundary:void 0})]}),M=y.setPlacementState;xd(()=>(M(_),()=>{M(void 0)}),[_,M]);const[V,q]=aM(_),U=xf(b);xd(()=>{L&&(U==null||U())},[L,U]);const J=(G=F.arrow)==null?void 0:G.x,z=(H=F.arrow)==null?void 0:H.y,Z=((se=F.arrow)==null?void 0:se.centerOffset)!==0,[ne,W]=p.useState();return xd(()=>{w&&W(window.getComputedStyle(w).zIndex)},[w]),a.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:L?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ne,"--radix-popper-transform-origin":[(Y=F.transformOrigin)==null?void 0:Y.x,(X=F.transformOrigin)==null?void 0:X.y].join(" "),...((ie=F.hide)==null?void 0:ie.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:a.jsx(qct,{scope:i,placedSide:V,placedAlign:q,onArrowChange:S,arrowX:J,arrowY:z,shouldHideArrow:Z,children:a.jsx(Xr.div,{"data-side":V,"data-align":q,...v,ref:O,style:{...v.style,animation:L?(ee=v.style)==null?void 0:ee.animation:"none"}})})})},"PopperContent"));function eRe(e){return e!==null}Pg(eRe,"isNotNull");var Kct=Pg(e=>({name:"transformOrigin",options:e,fn(t){var v,y,w;const{placement:n,rects:i,middlewareData:r}=t,o=((v=r.arrow)==null?void 0:v.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[u,d]=aM(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(((y=r.arrow)==null?void 0:y.x)??0)+l/2,m=(((w=r.arrow)==null?void 0:w.y)??0)+c/2;let g="",b="";return u==="bottom"?(g=o?f:`${h}px`,b=`${-c}px`):u==="top"?(g=o?f:`${h}px`,b=`${i.floating.height+c}px`):u==="right"?(g=`${-c}px`,b=o?f:`${m}px`):u==="left"&&(g=`${i.floating.width+c}px`,b=o?f:`${m}px`),{data:{x:g,y:b}}}}),"transformOrigin");function aM(e){const[t,n="center"]=e.split("-");return[t,n]}Pg(aM,"getSideAndAlignFromPlacement");var oM=zct,LV=Hct,$V=Wct,Gct=Object.defineProperty,FV=(e,t)=>Gct(e,"name",{value:t,configurable:!0}),n4=!1;function tRe(){const[e,t]=p.useState(n4);return p.useEffect(()=>{n4||(n4=!0,t(!0))},[]),e}FV(tRe,"useIsHydrated");var nRe=I0[" useSyncExternalStore ".trim().toString()];function iRe(){return()=>{}}FV(iRe,"subscribe");function rRe(){return nRe(iRe,()=>!0,()=>!1)}FV(rRe,"useIsHydratedModern");var Xct=typeof nRe=="function"?rRe:tRe,Yct=Object.defineProperty,V0=(e,t)=>Yct(e,"name",{value:t,configurable:!0}),i4="rovingFocusGroup.onEntryFocus",Zct={bubbles:!1,cancelable:!0},lM="RovingFocusGroup",[kB,sRe,Jct]=CV(lM),[eut,K1]=Hc(lM,[Jct]),[tut,nut]=eut(lM),iut=p.forwardRef(V0(function(t,n){return a.jsx(kB.Provider,{scope:t.__scopeRovingFocusGroup,children:a.jsx(kB.Slot,{scope:t.__scopeRovingFocusGroup,children:a.jsx(rut,{...t,ref:n})})})},"RovingFocusGroup")),rut=p.forwardRef(V0(function(t,n){const{__scopeRovingFocusGroup:i,orientation:r,loop:s=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...h}=t,m=p.useRef(null),g=_r(n,m),b=GA(o),[v,y]=jd({prop:l,defaultProp:c??null,onChange:u,caller:lM}),[w,x]=p.useState(!1),O=xf(d),k=sRe(i),S=p.useRef(!1),[C,E]=p.useState(0);return p.useEffect(()=>{const j=m.current;if(j)return j.addEventListener(i4,O),()=>j.removeEventListener(i4,O)},[O]),a.jsx(tut,{scope:i,orientation:r,dir:b,loop:s,currentTabStopId:v,onItemFocus:p.useCallback(j=>y(j),[y]),onItemShiftTab:p.useCallback(()=>x(!0),[]),onFocusableItemAdd:p.useCallback(()=>E(j=>j+1),[]),onFocusableItemRemove:p.useCallback(()=>E(j=>j-1),[]),children:a.jsx(Xr.div,{tabIndex:w||C===0?-1:0,"data-orientation":r,...h,ref:g,style:{outline:"none",...t.style},onMouseDown:Qn(t.onMouseDown,()=>{S.current=!0}),onFocus:Qn(t.onFocus,j=>{const T=!S.current;if(j.target===j.currentTarget&&T&&!w){const R=new CustomEvent(i4,Zct);if(j.currentTarget.dispatchEvent(R),!R.defaultPrevented){const A=k().filter(_=>_.focusable),N=A.find(_=>_.active),P=A.find(_=>_.id===v),D=[N,P,...A].filter(Boolean).map(_=>_.ref.current);BV(D,f)}}S.current=!1}),onBlur:Qn(t.onBlur,()=>x(!1))})})},"RovingFocusGroupImpl")),sut="RovingFocusGroupItem",aut=p.forwardRef(V0(function(t,n){const{__scopeRovingFocusGroup:i,focusable:r=!0,active:s=!1,tabStopId:o,children:l,...c}=t,u=tb(),d=o||u,f=nut(sut,i),h=f.currentTabStopId===d,m=sRe(i),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:v}=f,y=Xct();return xd(()=>{if(!(!y||!r))return g(),()=>b()},[y,r,g,b]),p.useEffect(()=>{if(!(y||!r))return g(),()=>b()},[y,r,g,b]),a.jsx(kB.ItemSlot,{scope:i,id:d,focusable:r,active:s,children:a.jsx(Xr.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...c,ref:n,onMouseDown:Qn(t.onMouseDown,w=>{r?f.onItemFocus(d):w.preventDefault()}),onFocus:Qn(t.onFocus,()=>f.onItemFocus(d)),onKeyDown:Qn(t.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){f.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const x=oRe(w,f.orientation,f.dir);if(x!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let k=m().filter(S=>S.focusable).map(S=>S.ref.current);if(x==="last")k.reverse();else if(x==="prev"||x==="next"){x==="prev"&&k.reverse();const S=k.indexOf(w.currentTarget);k=f.loop?lRe(k,S+1):k.slice(S+1)}setTimeout(()=>BV(k))}}),children:typeof l=="function"?l({isCurrentTabStop:h,hasTabStop:v!=null}):l})})},"RovingFocusGroupItem")),out={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function aRe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}V0(aRe,"getDirectionAwareKey");function oRe(e,t,n){const i=aRe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return out[i]}V0(oRe,"getFocusIntent");function BV(e,t=!1){const n=document.activeElement;for(const i of e)if(i===n||(i.focus({preventScroll:t}),document.activeElement!==n))return}V0(BV,"focusFirst");function lRe(e,t){return e.map((n,i)=>e[(t+i)%e.length])}V0(lRe,"wrapArray");var UV=iut,QV=aut,lut=Object.defineProperty,fr=(e,t)=>lut(e,"name",{value:t,configurable:!0}),SB=["Enter"," "],cut=["ArrowDown","PageUp","Home"],cRe=["ArrowUp","PageDown","End"],uut=[...cut,...cRe],dut={ltr:[...SB,"ArrowRight"],rtl:[...SB,"ArrowLeft"]},fut={ltr:["ArrowLeft"],rtl:["ArrowRight"]},cM="Menu",[mC,hut,put]=CV(cM),[H0,uRe]=Hc(cM,[put,W1,K1]),uM=W1(),dRe=K1(),[fRe,Eb]=H0(cM),[mut,YA]=H0(cM),gut=fr(e=>{const{__scopeMenu:t,open:n=!1,children:i,dir:r,onOpenChange:s,modal:o=!0}=e,l=uM(t),[c,u]=p.useState(null),d=p.useRef(!1),f=xf(s),h=GA(r);return p.useEffect(()=>{const m=fr(()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},"handleKeyDown"),g=fr(()=>d.current=!1,"handlePointer");return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),p.useEffect(()=>{if(!n)return;const m=fr(()=>f(!1),"handleBlur");return window.addEventListener("blur",m),()=>window.removeEventListener("blur",m)},[n,f]),a.jsx(oM,{...l,children:a.jsx(fRe,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:u,children:a.jsx(mut,{scope:t,onClose:p.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:o,children:i})})})},"Menu"),hRe=p.forwardRef(fr(function(t,n){const{__scopeMenu:i,...r}=t,s=uM(i);return a.jsx(LV,{...s,...r,ref:n})},"MenuAnchor")),pRe="MenuPortal",[but,mRe]=H0(pRe,{forceMount:void 0}),yut=fr(e=>{const{__scopeMenu:t,forceMount:n,children:i,container:r}=e,s=Eb(pRe,t);return a.jsx(but,{scope:t,forceMount:n,children:a.jsx(_h,{present:n||s.open,children:a.jsx(NV,{asChild:!0,container:r,children:i})})})},"MenuPortal"),hf="MenuContent",[vut,zV]=H0(hf),xut=p.forwardRef(fr(function(t,n){const i=mRe(hf,t.__scopeMenu),{forceMount:r=i.forceMount,...s}=t,o=Eb(hf,t.__scopeMenu),l=YA(hf,t.__scopeMenu);return a.jsx(mC.Provider,{scope:t.__scopeMenu,children:a.jsx(_h,{present:r||o.open,children:a.jsx(mC.Slot,{scope:t.__scopeMenu,children:l.modal?a.jsx(wut,{...s,ref:n}):a.jsx(Out,{...s,ref:n})})})})},"MenuContent")),wut=p.forwardRef(fr(function(t,n){const i=Eb(hf,t.__scopeMenu),r=p.useRef(null),s=_r(n,r);return p.useEffect(()=>{const o=r.current;if(o)return WNe(o)},[]),a.jsx(VV,{...t,ref:s,trapFocus:i.open,disableOutsidePointerEvents:i.open,disableOutsideScroll:!0,onFocusOutside:Qn(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentModal")),Out=p.forwardRef(fr(function(t,n){const i=Eb(hf,t.__scopeMenu);return a.jsx(VV,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentNonModal")),kut=Gp("MenuContent.ScrollLock"),VV=p.forwardRef(fr(function(t,n){const{__scopeMenu:i,loop:r=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,disableOutsideScroll:b,...v}=t,y=Eb(hf,i),w=YA(hf,i),x=uM(i),O=dRe(i),k=hut(i),[S,C]=p.useState(null),E=p.useRef(null),j=_r(n,E,y.onContentChange),T=p.useRef(0),R=p.useRef(""),A=p.useRef(0),N=p.useRef(null),P=p.useRef("right"),I=p.useRef(0),D=b?IV:p.Fragment,_=b?{as:kut,allowPinchZoom:!0}:void 0,L=fr(M=>{var W,G;const V=R.current+M,q=k().filter(H=>!H.disabled),U=document.activeElement,J=(W=q.find(H=>H.ref.current===U))==null?void 0:W.textValue,z=q.map(H=>H.textValue),Z=kRe(z,V,J),ne=(G=q.find(H=>H.textValue===Z))==null?void 0:G.ref.current;fr(function H(se){R.current=se,window.clearTimeout(T.current),se!==""&&(T.current=window.setTimeout(()=>H(""),1e3))},"updateSearch")(V),ne&&setTimeout(()=>ne.focus())},"handleTypeaheadSearch");p.useEffect(()=>()=>window.clearTimeout(T.current),[]),rM();const F=p.useCallback(M=>{var q,U;return P.current===((q=N.current)==null?void 0:q.side)&&ERe(M,(U=N.current)==null?void 0:U.area)},[]);return a.jsx(vut,{scope:i,searchRef:R,onItemEnter:p.useCallback(M=>{F(M)&&M.preventDefault()},[F]),onItemLeave:p.useCallback(M=>{var V;F(M)||((V=E.current)==null||V.focus(),C(null))},[F]),onTriggerLeave:p.useCallback(M=>{F(M)&&M.preventDefault()},[F]),pointerGraceTimerRef:A,onPointerGraceIntentChange:p.useCallback(M=>{N.current=M},[]),children:a.jsx(D,{..._,children:a.jsx(RNe,{asChild:!0,trapped:s,onMountAutoFocus:Qn(o,M=>{var V;M.preventDefault(),(V=E.current)==null||V.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:a.jsx(TV,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,children:a.jsx(UV,{asChild:!0,...O,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:Qn(u,M=>{w.isUsingKeyboardRef.current||M.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx($V,{role:"menu","aria-orientation":"vertical","data-state":qV(y.open),"data-radix-menu-content":"",dir:w.dir,...x,...v,ref:j,style:{outline:"none",...v.style},onKeyDown:Qn(v.onKeyDown,M=>{const q=M.target.closest("[data-radix-menu-content]")===M.currentTarget,U=M.ctrlKey||M.altKey||M.metaKey,J=M.key.length===1;q&&(M.key==="Tab"&&M.preventDefault(),!U&&J&&L(M.key));const z=E.current;if(M.target!==z||!uut.includes(M.key))return;M.preventDefault();const ne=k().filter(W=>!W.disabled).map(W=>W.ref.current);cRe.includes(M.key)&&ne.reverse(),wRe(ne)}),onBlur:Qn(t.onBlur,M=>{M.currentTarget.contains(M.target)||(window.clearTimeout(T.current),R.current="")}),onPointerMove:Qn(t.onPointerMove,Zw(M=>{const V=M.target,q=I.current!==M.clientX;if(M.currentTarget.contains(V)&&q){const U=M.clientX>I.current?"right":"left";P.current=U,I.current=M.clientX}}))})})})})})})},"MenuContentImpl")),Sut=p.forwardRef(fr(function(t,n){const{__scopeMenu:i,...r}=t;return a.jsx(Xr.div,{role:"group",...r,ref:n})},"MenuGroup")),EB="MenuItem",xee="menu.itemSelect",HV=p.forwardRef(fr(function(t,n){const{disabled:i=!1,onSelect:r,...s}=t,o=p.useRef(null),l=YA(EB,t.__scopeMenu),c=zV(EB,t.__scopeMenu),u=_r(n,o),d=p.useRef(!1),f=fr(()=>{const h=o.current;if(!i&&h){const m=new CustomEvent(xee,{bubbles:!0,cancelable:!0});h.addEventListener(xee,g=>r==null?void 0:r(g),{once:!0}),EV(h,m),m.defaultPrevented?d.current=!1:l.onClose()}},"handleSelect");return a.jsx(gRe,{...s,ref:u,disabled:i,onClick:Qn(t.onClick,f),onPointerDown:h=>{var m;(m=t.onPointerDown)==null||m.call(t,h),d.current=!0},onPointerUp:Qn(t.onPointerUp,h=>{var m;d.current||(m=h.currentTarget)==null||m.click()}),onKeyDown:Qn(t.onKeyDown,h=>{i||h.target!==h.currentTarget||c.searchRef.current!==""&&h.key===" "||SB.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})},"MenuItem")),gRe=p.forwardRef(fr(function(t,n){const{__scopeMenu:i,disabled:r=!1,textValue:s,...o}=t,l=zV(EB,i),c=dRe(i),u=p.useRef(null),d=_r(n,u),[f,h]=p.useState(!1),[m,g]=p.useState("");return p.useEffect(()=>{const b=u.current;b&&g((b.textContent??"").trim())},[o.children]),a.jsx(mC.ItemSlot,{scope:i,disabled:r,textValue:s??m,children:a.jsx(QV,{asChild:!0,...c,focusable:!r,children:a.jsx(Xr.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:d,onPointerMove:Qn(t.onPointerMove,Zw(b=>{r?l.onItemLeave(b):(l.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Qn(t.onPointerLeave,Zw(b=>l.onItemLeave(b))),onFocus:Qn(t.onFocus,()=>h(!0)),onBlur:Qn(t.onBlur,()=>h(!1))})})})},"MenuItemImpl")),Eut=p.forwardRef(fr(function(t,n){const{checked:i=!1,onCheckedChange:r,...s}=t;return a.jsx(yRe,{scope:t.__scopeMenu,checked:i,children:a.jsx(HV,{role:"menuitemcheckbox","aria-checked":gC(i)?"mixed":i,...s,ref:n,"data-state":dM(i),onSelect:Qn(s.onSelect,()=>r==null?void 0:r(gC(i)?!0:!i),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),Cut="MenuRadioGroup",[Aut,Tut]=H0(Cut,{value:void 0,onValueChange:fr(()=>{},"onValueChange")}),_ut=p.forwardRef(fr(function(t,n){const{value:i,onValueChange:r,...s}=t,o=xf(r);return a.jsx(Aut,{scope:t.__scopeMenu,value:i,onValueChange:o,children:a.jsx(Sut,{...s,ref:n})})},"MenuRadioGroup")),jut="MenuRadioItem",Nut=p.forwardRef(fr(function(t,n){const{value:i,...r}=t,s=Tut(jut,t.__scopeMenu),o=i===s.value;return a.jsx(yRe,{scope:t.__scopeMenu,checked:o,children:a.jsx(HV,{role:"menuitemradio","aria-checked":o,...r,ref:n,"data-state":dM(o),onSelect:Qn(r.onSelect,()=>{var l;return(l=s.onValueChange)==null?void 0:l.call(s,i)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),bRe="MenuItemIndicator",[yRe,Rut]=H0(bRe,{checked:!1}),Iut=p.forwardRef(fr(function(t,n){const{__scopeMenu:i,forceMount:r,...s}=t,o=Rut(bRe,i);return a.jsx(_h,{present:r||gC(o.checked)||o.checked===!0,children:a.jsx(Xr.span,{...s,ref:n,"data-state":dM(o.checked)})})},"MenuItemIndicator")),Put=p.forwardRef(fr(function(t,n){const{__scopeMenu:i,...r}=t;return a.jsx(Xr.div,{role:"separator","aria-orientation":"horizontal",...r,ref:n})},"MenuSeparator")),vRe="MenuSub",[Dut,xRe]=H0(vRe),Mut=fr(e=>{const{__scopeMenu:t,children:n,open:i=!1,onOpenChange:r}=e,s=Eb(vRe,t),o=uM(t),[l,c]=p.useState(null),[u,d]=p.useState(null),f=xf(r);return p.useEffect(()=>(s.open===!1&&f(!1),()=>f(!1)),[s.open,f]),a.jsx(oM,{...o,children:a.jsx(fRe,{scope:t,open:i,onOpenChange:f,content:u,onContentChange:d,children:a.jsx(Dut,{scope:t,contentId:tb(),triggerId:tb(),trigger:l,onTriggerChange:c,children:n})})})},"MenuSub"),p_="MenuSubTrigger",Lut=p.forwardRef(fr(function(t,n){const i=Eb(p_,t.__scopeMenu),r=YA(p_,t.__scopeMenu),s=xRe(p_,t.__scopeMenu),o=zV(p_,t.__scopeMenu),l=p.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=o,d={__scopeMenu:t.__scopeMenu},f=p.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);p.useEffect(()=>f,[f]),p.useEffect(()=>{const m=c.current;return()=>{window.clearTimeout(m),u(null)}},[c,u]);const h=_r(n,s.onTriggerChange);return a.jsx(hRe,{asChild:!0,...d,children:a.jsx(gRe,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?s.contentId:void 0,"data-state":qV(i.open),...t,ref:h,onClick:m=>{var g;(g=t.onClick)==null||g.call(t,m),!(t.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),i.open||i.onOpenChange(!0))},onPointerMove:Qn(t.onPointerMove,Zw(m=>{o.onItemEnter(m),!m.defaultPrevented&&!t.disabled&&!i.open&&!l.current&&(o.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{i.onOpenChange(!0),f()},100))})),onPointerLeave:Qn(t.onPointerLeave,Zw(m=>{var b,v;f();const g=(b=i.content)==null?void 0:b.getBoundingClientRect();if(g){const y=(v=i.content)==null?void 0:v.dataset.side,w=y==="right",x=w?-5:5,O=g[w?"left":"right"],k=g[w?"right":"left"];o.onPointerGraceIntentChange({area:[{x:m.clientX+x,y:m.clientY},{x:O,y:g.top},{x:k,y:g.top},{x:k,y:g.bottom},{x:O,y:g.bottom}],side:y}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(m),m.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Qn(t.onKeyDown,m=>{var b;t.disabled||m.target!==m.currentTarget||o.searchRef.current!==""&&m.key===" "||dut[r.dir].includes(m.key)&&(i.onOpenChange(!0),(b=i.content)==null||b.focus(),m.preventDefault())})})})},"MenuSubTrigger")),$ut="MenuSubContent",Fut=p.forwardRef(fr(function(t,n){const i=mRe(hf,t.__scopeMenu),{forceMount:r=i.forceMount,align:s="start",...o}=t,l=Eb(hf,t.__scopeMenu),c=YA(hf,t.__scopeMenu),u=xRe($ut,t.__scopeMenu),d=p.useRef(null),f=_r(n,d);return a.jsx(mC.Provider,{scope:t.__scopeMenu,children:a.jsx(_h,{present:r||l.open,children:a.jsx(mC.Slot,{scope:t.__scopeMenu,children:a.jsx(VV,{id:u.contentId,"aria-labelledby":u.triggerId,...o,ref:f,align:s,side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{var m;c.isUsingKeyboardRef.current&&((m=d.current)==null||m.focus()),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:Qn(t.onFocusOutside,h=>{h.target!==u.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:Qn(t.onEscapeKeyDown,h=>{c.onClose(),h.preventDefault()}),onKeyDown:Qn(t.onKeyDown,h=>{var b;const m=h.currentTarget.contains(h.target),g=fut[c.dir].includes(h.key);m&&g&&(l.onOpenChange(!1),(b=u.trigger)==null||b.focus(),h.preventDefault())})})})})})},"MenuSubContent"));function qV(e){return e?"open":"closed"}fr(qV,"getOpenState");function gC(e){return e==="indeterminate"}fr(gC,"isIndeterminate");function dM(e){return gC(e)?"indeterminate":e?"checked":"unchecked"}fr(dM,"getCheckedState");function wRe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}fr(wRe,"focusFirst");function ORe(e,t){return e.map((n,i)=>e[(t+i)%e.length])}fr(ORe,"wrapArray");function kRe(e,t,n){const r=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let o=ORe(e,Math.max(s,0));r.length===1&&(o=o.filter(u=>u!==n));const c=o.find(u=>u.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}fr(kRe,"getNextMatch");function SRe(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,o=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}fr(SRe,"isPointInPolygon");function ERe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return SRe(n,t)}fr(ERe,"isPointerInGraceArea");function Zw(e){return t=>t.pointerType==="mouse"?e(t):void 0}fr(Zw,"whenMouse");var But=gut,Uut=hRe,Qut=yut,zut=xut,Vut=HV,Hut=Eut,qut=_ut,Wut=Nut,Kut=Iut,Gut=Put,Xut=Mut,Yut=Lut,Zut=Fut,Jut=Object.defineProperty,Fu=(e,t)=>Jut(e,"name",{value:t,configurable:!0}),WV="DropdownMenu",[edt,yhn]=Hc(WV,[uRe]),Bu=uRe(),[tdt,CRe]=edt(WV),ndt=Fu(e=>{const{__scopeDropdownMenu:t,children:n,dir:i,open:r,defaultOpen:s,onOpenChange:o,modal:l=!0}=e,c=Bu(t),u=p.useRef(null),[d,f]=jd({prop:r,defaultProp:s??!1,onChange:o,caller:WV});return a.jsx(tdt,{scope:t,triggerId:tb(),triggerRef:u,contentId:tb(),open:d,onOpenChange:f,onOpenToggle:p.useCallback(()=>f(h=>!h),[f]),modal:l,children:a.jsx(But,{...c,open:d,onOpenChange:f,dir:i,modal:l,children:n})})},"DropdownMenu"),idt="DropdownMenuTrigger",rdt=p.forwardRef(Fu(function(t,n){const{__scopeDropdownMenu:i,disabled:r=!1,...s}=t,o=CRe(idt,i),l=Bu(i),c=_r(n,o.triggerRef);return a.jsx(Uut,{asChild:!0,...l,children:a.jsx(Xr.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:c,onPointerDown:Qn(t.onPointerDown,u=>{!r&&u.button===0&&u.ctrlKey===!1&&(o.onOpenToggle(),o.open||u.preventDefault())}),onKeyDown:Qn(t.onKeyDown,u=>{r||(["Enter"," "].includes(u.key)&&o.onOpenToggle(),u.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})},"DropdownMenuTrigger")),sdt=Fu(e=>{const{__scopeDropdownMenu:t,...n}=e,i=Bu(t);return a.jsx(Qut,{...i,...n})},"DropdownMenuPortal"),adt="DropdownMenuContent",odt=p.forwardRef(Fu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=CRe(adt,i),o=Bu(i),l=p.useRef(!1);return a.jsx(zut,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...r,ref:n,onCloseAutoFocus:Qn(t.onCloseAutoFocus,c=>{var u;l.current||(u=s.triggerRef.current)==null||u.focus(),l.current=!1,c.preventDefault()}),onInteractOutside:Qn(t.onInteractOutside,c=>{const u=c.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;(!s.modal||f)&&(l.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),ldt=p.forwardRef(Fu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Bu(i);return a.jsx(Vut,{...s,...r,ref:n})},"DropdownMenuItem")),cdt=p.forwardRef(Fu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Bu(i);return a.jsx(Hut,{...s,...r,ref:n})},"DropdownMenuCheckboxItem")),udt=p.forwardRef(Fu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Bu(i);return a.jsx(qut,{...s,...r,ref:n})},"DropdownMenuRadioGroup")),ddt=p.forwardRef(Fu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Bu(i);return a.jsx(Wut,{...s,...r,ref:n})},"DropdownMenuRadioItem")),fdt=p.forwardRef(Fu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Bu(i);return a.jsx(Kut,{...s,...r,ref:n})},"DropdownMenuItemIndicator")),hdt=p.forwardRef(Fu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Bu(i);return a.jsx(Gut,{...s,...r,ref:n})},"DropdownMenuSeparator")),pdt=Fu(e=>{const{__scopeDropdownMenu:t,children:n,open:i,onOpenChange:r,defaultOpen:s}=e,o=Bu(t),[l,c]=jd({prop:i,defaultProp:s??!1,onChange:r,caller:"DropdownMenuSub"});return a.jsx(Xut,{...o,open:l,onOpenChange:c,children:n})},"DropdownMenuSub"),mdt=p.forwardRef(Fu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Bu(i);return a.jsx(Yut,{...s,...r,ref:n})},"DropdownMenuSubTrigger")),gdt=p.forwardRef(Fu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Bu(i);return a.jsx(Zut,{...s,...r,ref:n,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuSubContent")),bdt=ndt,ydt=rdt,ARe=sdt,vdt=odt,TRe=ldt,xdt=cdt,wdt=udt,Odt=ddt,_Re=fdt,kdt=hdt,Sdt=pdt,Edt=mdt,Cdt=gdt,Adt=Object.defineProperty,Cb=(e,t)=>Adt(e,"name",{value:t,configurable:!0}),KV="Popover",[jRe,vhn]=Hc(KV,[W1]),GV=W1(),[Tdt,G1]=jRe(KV),_dt=Cb(e=>{const{__scopePopover:t,children:n,open:i,defaultOpen:r,onOpenChange:s,modal:o=!1}=e,l=GV(t),c=p.useRef(null),[u,d]=p.useState(!1),[f,h]=jd({prop:i,defaultProp:r??!1,onChange:s,caller:KV});return a.jsx(oM,{...l,children:a.jsx(Tdt,{scope:t,contentId:tb(),triggerRef:c,open:f,onOpenChange:h,onOpenToggle:p.useCallback(()=>h(m=>!m),[h]),hasCustomAnchor:u,onCustomAnchorAdd:p.useCallback(()=>d(!0),[]),onCustomAnchorRemove:p.useCallback(()=>d(!1),[]),modal:o,children:n})})},"Popover"),jdt="PopoverTrigger",Ndt=p.forwardRef(Cb(function(t,n){const{__scopePopover:i,...r}=t,s=G1(jdt,i),o=GV(i),l=_r(n,s.triggerRef),c=a.jsx(Xr.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":XV(s.open),...r,ref:l,onClick:Qn(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:a.jsx(LV,{asChild:!0,...o,children:c})},"PopoverTrigger")),NRe="PopoverPortal",[Rdt,Idt]=jRe(NRe,{forceMount:void 0}),Pdt=Cb(e=>{const{__scopePopover:t,forceMount:n,children:i,container:r}=e,s=G1(NRe,t);return a.jsx(Rdt,{scope:t,forceMount:n,children:a.jsx(_h,{present:n||s.open,children:a.jsx(NV,{asChild:!0,container:r,children:i})})})},"PopoverPortal"),bC="PopoverContent",Ddt=p.forwardRef(Cb(function(t,n){const i=Idt(bC,t.__scopePopover),{forceMount:r=i.forceMount,...s}=t,o=G1(bC,t.__scopePopover);return a.jsx(_h,{present:r||o.open,children:o.modal?a.jsx(Ldt,{...s,ref:n}):a.jsx($dt,{...s,ref:n})})},"PopoverContent")),Mdt=Gp("PopoverContent.RemoveScroll"),Ldt=p.forwardRef(Cb(function(t,n){const i=G1(bC,t.__scopePopover),r=p.useRef(null),s=_r(n,r),o=p.useRef(!1);return p.useEffect(()=>{const l=r.current;if(l)return WNe(l)},[]),a.jsx(IV,{as:Mdt,allowPinchZoom:!0,children:a.jsx(RRe,{...t,ref:s,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Qn(t.onCloseAutoFocus,l=>{var c;l.preventDefault(),o.current||(c=i.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Qn(t.onPointerDownOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;o.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:Qn(t.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),$dt=p.forwardRef(Cb(function(t,n){const i=G1(bC,t.__scopePopover),r=p.useRef(!1),s=p.useRef(!1);return a.jsx(RRe,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,c;(l=t.onCloseAutoFocus)==null||l.call(t,o),o.defaultPrevented||(r.current||(c=i.triggerRef.current)==null||c.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{var u,d;(u=t.onInteractOutside)==null||u.call(t,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=o.target;((d=i.triggerRef.current)==null?void 0:d.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})},"PopoverContentNonModal")),RRe=p.forwardRef(Cb(function(t,n){const{__scopePopover:i,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,...h}=t,m=G1(bC,i),g=GV(i);return rM(),a.jsx(RNe,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:a.jsx(TV,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:f,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),deferPointerDownOutside:!0,children:a.jsx($V,{"data-state":XV(m.open),role:"dialog",id:m.contentId,...g,...h,ref:n,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl"));function XV(e){return e?"open":"closed"}Cb(XV,"getState");var IRe=_dt,PRe=Ndt,DRe=Pdt,MRe=Ddt,Fdt=Object.defineProperty,_l=(e,t)=>Fdt(e,"name",{value:t,configurable:!0}),LRe="Radio",[Bdt,$Re]=Hc(LRe),[Udt,fM]=Bdt(LRe);function FRe(e){const{__scopeRadio:t,checked:n=!1,children:i,disabled:r,form:s,name:o,onCheck:l,required:c,value:u="on",internal_do_not_use_render:d}=e,[f,h]=p.useState(null),[m,g]=p.useState(null),b=p.useRef(!1),[v,y]=p.useReducer(O=>O+1,0),w=f?!!s||!!f.closest("form"):!0,x={checked:n,disabled:r,required:c,name:o,form:s,value:u,control:f,setControl:h,hasConsumerStoppedPropagationRef:b,userInteractionCount:v,onUserInteraction:y,isFormControl:w,bubbleInput:m,setBubbleInput:g,onCheck:_l(()=>l==null?void 0:l(),"onCheck")};return a.jsx(Udt,{scope:t,...x,children:BRe(d)?d(x):i})}_l(FRe,"RadioProvider");var Qdt="RadioTrigger",zdt=p.forwardRef(_l(function({__scopeRadio:t,onClick:n,...i},r){const{checked:s,disabled:o,value:l,setControl:c,onCheck:u,hasConsumerStoppedPropagationRef:d,onUserInteraction:f,isFormControl:h,bubbleInput:m}=fM(Qdt,t),g=_r(r,c);return a.jsx(Xr.button,{type:"button",role:"radio","aria-checked":s,"data-state":YV(s),"data-disabled":o?"":void 0,disabled:o,value:l,...i,ref:g,onClick:Qn(n,b=>{s||(f(),u()),m&&h&&(d.current=b.isPropagationStopped(),d.current||b.stopPropagation())})})},"RadioTrigger")),Vdt="RadioIndicator",Hdt=p.forwardRef(_l(function(t,n){const{__scopeRadio:i,forceMount:r,...s}=t,o=fM(Vdt,i);return a.jsx(_h,{present:r||o.checked,children:a.jsx(Xr.span,{"data-state":YV(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:n})})},"RadioIndicator")),qdt="RadioBubbleInput",Wdt=p.forwardRef(_l(function({__scopeRadio:t,onClick:n,...i},r){const{control:s,checked:o,required:l,disabled:c,name:u,value:d,form:f,bubbleInput:h,setBubbleInput:m,hasConsumerStoppedPropagationRef:g,userInteractionCount:b}=fM(qdt,t),v=_r(r,m),y=XA(s),w=p.useRef(!1),x=p.useRef(o),O=p.useRef(b);p.useEffect(()=>{const S=h;if(!S)return;const C=window.HTMLInputElement.prototype,j=Object.getOwnPropertyDescriptor(C,"checked").set,T=b!==O.current;O.current=b;const R=x.current!==o;x.current=o;const A=!(T&&g.current);if(R&&j){w.current=!T;const N=new Event("click",{bubbles:A});j.call(S,o),S.dispatchEvent(N),w.current=!1}},[h,o,g,b]);const k=p.useRef(o);return a.jsx(Xr.input,{type:"radio","aria-hidden":!0,defaultChecked:k.current,required:l,disabled:c,name:u,value:d,form:f,...i,tabIndex:-1,ref:v,onClick:Qn(n,S=>{w.current&&S.stopPropagation()}),style:{...i.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"RadioBubbleInput"));function BRe(e){return typeof e=="function"}_l(BRe,"isFunction");function YV(e){return e?"checked":"unchecked"}_l(YV,"getState");var Kdt=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ZV="RadioGroup",[Gdt,xhn]=Hc(ZV,[K1,$Re]),URe=K1(),hM=$Re(),[Xdt,Ydt]=Gdt(ZV),Zdt=p.forwardRef(_l(function(t,n){const{__scopeRadioGroup:i,name:r,form:s,defaultValue:o,value:l,required:c=!1,disabled:u=!1,orientation:d,dir:f,loop:h=!0,onValueChange:m,...g}=t,b=URe(i),v=GA(f),[y,w]=jd({prop:l,defaultProp:o??null,onChange:m,caller:ZV}),[x,O]=p.useState(null),k=_r(n,O),S=p.useRef(y);return p.useEffect(()=>{const C=s?x==null?void 0:x.ownerDocument.getElementById(s):x==null?void 0:x.closest("form");if(C instanceof HTMLFormElement){const E=_l(()=>w(S.current),"reset");return C.addEventListener("reset",E),()=>C.removeEventListener("reset",E)}},[x,s,w]),a.jsx(Xdt,{scope:i,name:r,form:s,required:c,disabled:u,value:y,onValueChange:w,children:a.jsx(UV,{asChild:!0,...b,orientation:d,dir:v,loop:h,children:a.jsx(Xr.div,{role:"radiogroup","aria-required":c,"aria-orientation":d,"data-disabled":u?"":void 0,dir:v,...g,ref:k})})})},"RadioGroup")),Jdt="RadioGroupItemProvider",eft="RadioGroupItemTrigger";function QRe(e){const{__scopeRadioGroup:t,value:n,disabled:i,children:r,internal_do_not_use_render:s}=e,o=Ydt(Jdt,t),l=hM(t),c=o.disabled||i;return a.jsx(FRe,{...l,checked:o.value===n,disabled:c,required:o.required,name:o.name,form:o.form,value:n,onCheck:()=>o.onValueChange(n),internal_do_not_use_render:s,children:r})}_l(QRe,"RadioGroupItemProvider");var tft=p.forwardRef(_l(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=URe(i),o=hM(i),{checked:l,disabled:c}=fM(eft,o.__scopeRadio),u=p.useRef(null),d=_r(n,u),f=p.useRef(!1);return p.useEffect(()=>{const h=_l(g=>{Kdt.includes(g.key)&&(f.current=!0)},"handleKeyDown"),m=_l(()=>f.current=!1,"handleKeyUp");return document.addEventListener("keydown",h),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",m)}},[]),a.jsx(QV,{asChild:!0,...s,focusable:!c,active:l,children:a.jsx(zdt,{...o,...r,ref:d,onKeyDown:Qn(r.onKeyDown,h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:Qn(r.onFocus,()=>{var h;f.current&&((h=u.current)==null||h.click())})})})},"RadioGroupItemTrigger")),nft=p.forwardRef(_l(function(t,n){const{__scopeRadioGroup:i,value:r,disabled:s,...o}=t;return a.jsx(QRe,{__scopeRadioGroup:i,value:r,disabled:s,internal_do_not_use_render:({isFormControl:l})=>a.jsxs(a.Fragment,{children:[a.jsx(tft,{...o,ref:n,__scopeRadioGroup:i}),l&&a.jsx(ift,{__scopeRadioGroup:i})]})})},"RadioGroupItem")),ift=p.forwardRef(_l(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=hM(i);return a.jsx(Wdt,{...s,...r,ref:n})},"RadioGroupItemBubbleInput")),rft=p.forwardRef(_l(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=hM(i);return a.jsx(Hdt,{...s,...r,ref:n})},"RadioGroupIndicator")),sft=Object.defineProperty,nb=(e,t)=>sft(e,"name",{value:t,configurable:!0}),JV="Switch",[aft,whn]=Hc(JV),[oft,eH]=aft(JV);function zRe(e){const{__scopeSwitch:t,checked:n,children:i,defaultChecked:r,disabled:s,form:o,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=e,[h,m]=jd({prop:n,defaultProp:r??!1,onChange:c,caller:JV}),[g,b]=p.useState(null),[v,y]=p.useState(null),w=p.useRef(!1),[x,O]=p.useReducer(C=>C+1,0),k=g?!!o||!!g.closest("form"):!0,S={checked:h,setChecked:m,disabled:s,control:g,setControl:b,name:l,form:o,value:d,hasConsumerStoppedPropagationRef:w,userInteractionCount:x,onUserInteraction:O,required:u,defaultChecked:r,isFormControl:k,bubbleInput:v,setBubbleInput:y};return a.jsx(oft,{scope:t,...S,children:VRe(f)?f(S):i})}nb(zRe,"SwitchProvider");var lft="SwitchTrigger",cft=p.forwardRef(nb(function({__scopeSwitch:t,onClick:n,...i},r){const{control:s,form:o,value:l,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,onUserInteraction:g,isFormControl:b,bubbleInput:v}=eH(lft,t),y=_r(r,f),w=p.useRef(u);return p.useEffect(()=>{const x=o?s==null?void 0:s.ownerDocument.getElementById(o):s==null?void 0:s.form;if(x instanceof HTMLFormElement){const O=nb(()=>h(w.current),"reset");return x.addEventListener("reset",O),()=>x.removeEventListener("reset",O)}},[s,o,h]),a.jsx(Xr.button,{type:"button",role:"switch","aria-checked":u,"aria-required":d,"data-state":tH(u),"data-disabled":c?"":void 0,disabled:c,value:l,...i,ref:y,onClick:Qn(n,x=>{g(),h(O=>!O),v&&b&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})})},"SwitchTrigger")),uft=p.forwardRef(nb(function(t,n){const{__scopeSwitch:i,name:r,checked:s,defaultChecked:o,required:l,disabled:c,value:u,onCheckedChange:d,form:f,...h}=t;return a.jsx(zRe,{__scopeSwitch:i,checked:s,defaultChecked:o,disabled:c,required:l,onCheckedChange:d,name:r,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>a.jsxs(a.Fragment,{children:[a.jsx(cft,{...h,ref:n,__scopeSwitch:i}),m&&a.jsx(pft,{__scopeSwitch:i})]})})},"Switch")),dft="SwitchThumb",fft=p.forwardRef(nb(function(t,n){const{__scopeSwitch:i,...r}=t,s=eH(dft,i);return a.jsx(Xr.span,{"data-state":tH(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:n})},"SwitchThumb")),hft="SwitchBubbleInput",pft=p.forwardRef(nb(function({__scopeSwitch:t,onClick:n,...i},r){const{control:s,hasConsumerStoppedPropagationRef:o,userInteractionCount:l,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:m,form:g,bubbleInput:b,setBubbleInput:v}=eH(hft,t),y=_r(r,v),w=XA(s),x=p.useRef(!1),O=p.useRef(c),k=p.useRef(l);p.useEffect(()=>{const C=b;if(!C)return;const E=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(E,"checked").set,R=l!==k.current;k.current=l;const A=O.current!==c;O.current=c;const N=!(R&&o.current);if(A&&T){x.current=!R;const P=new Event("click",{bubbles:N});T.call(C,c),C.dispatchEvent(P),x.current=!1}},[b,c,o,l]);const S=p.useRef(c);return a.jsx(Xr.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??S.current,required:d,disabled:f,name:h,value:m,form:g,...i,tabIndex:-1,ref:y,onClick:Qn(n,C=>{x.current&&C.stopPropagation()}),style:{...i.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function VRe(e){return typeof e=="function"}nb(VRe,"isFunction");function tH(e){return e?"checked":"unchecked"}nb(tH,"getState");var mft=Object.defineProperty,gft=(e,t)=>mft(e,"name",{value:t,configurable:!0}),bft="Toggle",yft=p.forwardRef(gft(function(t,n){const{pressed:i,defaultPressed:r,onPressedChange:s,...o}=t,[l,c]=jd({prop:i,onChange:s,defaultProp:r??!1,caller:bft});return a.jsx(Xr.button,{type:"button","aria-pressed":l,"data-state":l?"on":"off","data-disabled":t.disabled?"":void 0,...o,ref:n,onClick:Qn(t.onClick,()=>{t.disabled||c(!l)})})},"Toggle")),vft=Object.defineProperty,ib=(e,t)=>vft(e,"name",{value:t,configurable:!0}),X1="ToggleGroup",[HRe,Ohn]=Hc(X1,[K1]),qRe=K1(),xft=p.forwardRef(ib(function(t,n){const{type:i,...r}=t;if(i==="single"){const s=r;return a.jsx(wft,{role:"radiogroup",...s,ref:n})}if(i==="multiple"){const s=r;return a.jsx(Oft,{role:"toolbar",...s,ref:n})}throw new Error(`Missing prop \`type\` expected on \`${X1}\``)},"ToggleGroup")),[WRe,KRe]=HRe(X1),wft=p.forwardRef(ib(function(t,n){const{value:i,defaultValue:r,onValueChange:s=ib(()=>{},"onValueChange"),...o}=t,[l,c]=jd({prop:i,defaultProp:r??"",onChange:s,caller:X1});return a.jsx(WRe,{scope:t.__scopeToggleGroup,type:"single",value:p.useMemo(()=>l?[l]:[],[l]),onItemActivate:c,onItemDeactivate:p.useCallback(()=>c(""),[c]),children:a.jsx(GRe,{...o,ref:n})})},"ToggleGroupImplSingle")),Oft=p.forwardRef(ib(function(t,n){const{value:i,defaultValue:r,onValueChange:s=ib(()=>{},"onValueChange"),...o}=t,[l,c]=jd({prop:i,defaultProp:r??[],onChange:s,caller:X1}),u=p.useCallback(f=>c((h=[])=>[...h,f]),[c]),d=p.useCallback(f=>c((h=[])=>h.filter(m=>m!==f)),[c]);return a.jsx(WRe,{scope:t.__scopeToggleGroup,type:"multiple",value:l,onItemActivate:u,onItemDeactivate:d,children:a.jsx(GRe,{...o,ref:n})})},"ToggleGroupImplMultiple")),[kft,Sft]=HRe(X1),GRe=p.forwardRef(ib(function(t,n){const{__scopeToggleGroup:i,disabled:r=!1,rovingFocus:s=!0,orientation:o,dir:l,loop:c=!0,...u}=t,d=qRe(i),f=GA(l),h={dir:f,...u};return a.jsx(kft,{scope:i,rovingFocus:s,disabled:r,children:s?a.jsx(UV,{asChild:!0,...d,orientation:o,dir:f,loop:c,children:a.jsx(Xr.div,{...h,ref:n})}):a.jsx(Xr.div,{...h,ref:n})})},"ToggleGroupImpl")),CB="ToggleGroupItem",Eft=p.forwardRef(ib(function(t,n){const i=KRe(CB,t.__scopeToggleGroup),r=Sft(CB,t.__scopeToggleGroup),s=qRe(t.__scopeToggleGroup),o=i.value.includes(t.value),l=r.disabled||t.disabled,c={...t,pressed:o,disabled:l},u=p.useRef(null);return r.rovingFocus?a.jsx(QV,{asChild:!0,...s,focusable:!l,active:o,ref:u,children:a.jsx(wee,{...c,ref:n})}):a.jsx(wee,{...c,ref:n})},"ToggleGroupItem")),wee=p.forwardRef(ib(function(t,n){const{__scopeToggleGroup:i,value:r,...s}=t,o=KRe(CB,i),l={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},c=o.type==="single"?l:void 0;return a.jsx(yft,{...c,...s,ref:n,onPressedChange:u=>{u?o.onItemActivate(r):o.onItemDeactivate(r)}})},"ToggleGroupItemImpl")),Cft=Object.defineProperty,No=(e,t)=>Cft(e,"name",{value:t,configurable:!0}),[nH,khn]=Hc("Tooltip",[W1]),iH=W1(),Aft="TooltipProvider",Tft=700,AB="tooltip.open",[_ft,rH]=nH(Aft),jft=No(e=>{const{__scopeTooltip:t,delayDuration:n=Tft,skipDelayDuration:i=300,disableHoverableContent:r=!1,children:s}=e,o=p.useRef(!0),l=p.useRef(!1),c=p.useRef(0);return p.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),a.jsx(_ft,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:p.useCallback(()=>{i<=0||(window.clearTimeout(c.current),o.current=!1)},[i]),onClose:p.useCallback(()=>{i<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,i))},[i]),isPointerInTransitRef:l,onPointerInTransitChange:p.useCallback(u=>{l.current=u},[]),disableHoverableContent:r,children:s})},"TooltipProvider"),TB="Tooltip",[Nft,ZA]=nH(TB),Rft=No(e=>{const{__scopeTooltip:t,children:n,open:i,defaultOpen:r,onOpenChange:s,disableHoverableContent:o,delayDuration:l}=e,c=rH(TB,e.__scopeTooltip),u=iH(t),[d,f]=p.useState(null),[h,m]=p.useState(void 0),g=tb(),b=p.useRef(0),v=o??c.disableHoverableContent,y=l??c.delayDuration,w=p.useRef(!1),[x,O]=jd({prop:i,defaultProp:r??!1,onChange:No(T=>{T?(c.onOpen(),document.dispatchEvent(new CustomEvent(AB))):c.onClose(),s==null||s(T)},"onChange"),caller:TB}),k=p.useMemo(()=>x?w.current?"delayed-open":"instant-open":"closed",[x]),S=p.useCallback(()=>{window.clearTimeout(b.current),b.current=0,w.current=!1,O(!0)},[O]),C=p.useCallback(()=>{window.clearTimeout(b.current),b.current=0,O(!1)},[O]),E=p.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{w.current=!0,O(!0),b.current=0},y)},[y,O]);p.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]);const j=h??g;return a.jsx(oM,{...u,children:a.jsx(Nft,{scope:t,contentId:j,setContentId:m,open:x,stateAttribute:k,trigger:d,onTriggerChange:f,onTriggerEnter:p.useCallback(()=>{c.isOpenDelayedRef.current?E():S()},[c.isOpenDelayedRef,E,S]),onTriggerLeave:p.useCallback(()=>{v?C():(window.clearTimeout(b.current),b.current=0)},[C,v]),onOpen:S,onClose:C,disableHoverableContent:v,children:n})})},"Tooltip"),Oee="TooltipTrigger",Ift=p.forwardRef(No(function(t,n){const{__scopeTooltip:i,...r}=t,s=ZA(Oee,i),o=rH(Oee,i),l=iH(i),c=p.useRef(null),u=_r(n,c,s.onTriggerChange),d=p.useRef(!1),f=p.useRef(!1),h=p.useCallback(()=>d.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),a.jsx(LV,{asChild:!0,...l,children:a.jsx(Xr.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:u,onPointerMove:Qn(t.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:Qn(t.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:Qn(t.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:Qn(t.onFocus,()=>{d.current||s.onOpen()}),onBlur:Qn(t.onBlur,s.onClose),onClick:Qn(t.onClick,s.onClose)})})},"TooltipTrigger")),XRe="TooltipPortal",[Pft,Dft]=nH(XRe,{forceMount:void 0}),Mft=No(e=>{const{__scopeTooltip:t,forceMount:n,children:i,container:r}=e,s=ZA(XRe,t);return a.jsx(Pft,{scope:t,forceMount:n,children:a.jsx(_h,{present:n||s.open,children:a.jsx(NV,{asChild:!0,container:r,children:i})})})},"TooltipPortal"),yC="TooltipContent",Lft=p.forwardRef(No(function(t,n){const i=Dft(yC,t.__scopeTooltip),{forceMount:r=i.forceMount,side:s="top",...o}=t,l=ZA(yC,t.__scopeTooltip);return a.jsx(_h,{present:r||l.open,children:l.disableHoverableContent?a.jsx(YRe,{side:s,...o,ref:n}):a.jsx($ft,{side:s,...o,ref:n})})},"TooltipContent")),$ft=p.forwardRef(No(function(t,n){const i=ZA(yC,t.__scopeTooltip),r=rH(yC,t.__scopeTooltip),s=p.useRef(null),o=_r(n,s),[l,c]=p.useState(null),{trigger:u,onClose:d}=i,f=s.current,{onPointerInTransitChange:h}=r,m=p.useCallback(()=>{c(null),h(!1)},[h]),g=p.useCallback((b,v)=>{const y=b.currentTarget,w={x:b.clientX,y:b.clientY},x=ZRe(w,y.getBoundingClientRect()),O=JRe(w,x),k=eIe(v.getBoundingClientRect()),S=nIe([...O,...k]);c(S),h(!0)},[h]);return p.useEffect(()=>()=>m(),[m]),p.useEffect(()=>{if(u&&f){const b=No(y=>g(y,f),"handleTriggerLeave"),v=No(y=>g(y,u),"handleContentLeave");return u.addEventListener("pointerleave",b),f.addEventListener("pointerleave",v),()=>{u.removeEventListener("pointerleave",b),f.removeEventListener("pointerleave",v)}}},[u,f,g,m]),p.useEffect(()=>{if(l){const b=No(v=>{const y=v.target,w={x:v.clientX,y:v.clientY},x=(u==null?void 0:u.contains(y))||(f==null?void 0:f.contains(y)),O=!tIe(w,l);x?m():O&&(m(),d())},"handleTrackPointerGrace");return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[u,f,l,d,m]),a.jsx(YRe,{...t,ref:o})},"TooltipContentHoverable")),Fft=cNe("TooltipContent"),YRe=p.forwardRef(No(function(t,n){const{__scopeTooltip:i,children:r,"aria-label":s,id:o,onEscapeKeyDown:l,onPointerDownOutside:c,...u}=t,d=ZA(yC,i),f=iH(i),{onClose:h}=d;p.useEffect(()=>(document.addEventListener(AB,h),()=>document.removeEventListener(AB,h)),[h]),p.useEffect(()=>{if(d.trigger){const g=No(b=>{b.target instanceof Node&&b.target.contains(d.trigger)&&h()},"handleScroll");return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[d.trigger,h]);const{setContentId:m}=d;return xd(()=>(m(o),()=>{m(void 0)}),[o,m]),a.jsx(TV,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:g=>g.preventDefault(),onDismiss:h,children:a.jsxs($V,{"data-state":d.stateAttribute,role:s?void 0:"tooltip",id:s?void 0:d.contentId,...f,...u,ref:n,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[a.jsx(Fft,{children:r}),s?a.jsx(flt,{id:d.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl"));function ZRe(e,t){const n=Math.abs(t.top-e.y),i=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,i,r,s)){case s:return"left";case r:return"right";case n:return"top";case i:return"bottom";default:throw new Error("unreachable")}}No(ZRe,"getExitSideFromRect");function JRe(e,t,n=5){const i=[];switch(t){case"top":i.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":i.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":i.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":i.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return i}No(JRe,"getPaddedExitPoints");function eIe(e){const{top:t,right:n,bottom:i,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:i},{x:r,y:i}]}No(eIe,"getPointsFromRect");function tIe(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,o=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}No(tIe,"isPointInPolygon");function nIe(e){const t=e.slice();return t.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),iIe(t)}No(nIe,"getHull");function iIe(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i=2;){const s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let i=e.length-1;i>=0;i--){const r=e[i];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}No(iIe,"getHullPresorted");var Bft=jft,Uft=Rft,rIe=Ift,Qft=Mft,zft=Lft;function rb(e){const t=p.useRef(e);return t.current=e,t}let Jw=[],m_=!1;const kee=e=>{var t,n;if(e.key==="Escape"){const[i]=Jw;i&&(e.preventDefault(),(n=(t=i.callback).current)==null||n.call(t))}},sIe=()=>{Jw.length>0&&!m_?(document.body.addEventListener("keydown",kee),m_=!0):Jw.length===0&&m_&&(document.body.removeEventListener("keydown",kee),m_=!1)},Vft=e=>{Jw.unshift(e),sIe()},Hft=({id:e})=>{Jw=Jw.filter(t=>t.id!==e),sIe()},JA=(e,t)=>{const n=p.useId(),i=rb(t);p.useEffect(()=>{if(!e)return;const r={id:n,callback:i};return Vft(r),()=>Hft(r)},[n,e,i])},qft=p.createContext(null);function aIe(){const e=p.useContext(qft);return(e==null?void 0:e.linkComponent)??"a"}function eT(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}const Wft=()=>iNe,See=(e,t=!1,n="TransitionGroup")=>{const i=[];return p.Children.forEach(e,r=>{if(r&&typeof r=="object"&&"key"in r&&r.key)i.push(r);else if(t)throw new Error(`Child elements of <${n} /> must include a \`key\``)}),i},Mv=()=>{},Lv=e=>{const t=p.useRef(e);return t.current=e,p.useCallback(n=>t.current(n),[])};function Kft(e,t,n,i){const r=e.reduce((c,u)=>({...c,[u.key]:1}),{}),s=t.reduce((c,u)=>({...c,[u.component.key]:1}),{}),o=e.filter(c=>!s[c.key]).map(n),l=t.map(c=>({...c,component:e.find(({key:u})=>u===c.component.key)||c.component,shouldRender:!!r[c.component.key]}));return i==="append"?l.concat(o):o.concat(l)}function Gft(e,t,n){if((iNe||Wot)&&t&&n>1)throw new Error(`Cannot use forwardRef with multiple children in <${e} />`)}const Xft="_TransitionGroupChild_1hv1z_1",Yft={TransitionGroupChild:Xft},oIe={enter:!1,enterActive:!1,exit:!1,exitActive:!1,interrupted:!1},Zft=e=>({...oIe,enter:!e}),Jft=(e,t)=>{switch(t.type){case"enter-before":return{enter:!0,enterActive:!1,exit:!1,exitActive:!1,interrupted:e.interrupted||e.exit};case"enter-active":return{enter:!0,enterActive:!0,exit:!1,exitActive:!1,interrupted:!1};case"exit-before":return{enter:!1,enterActive:!1,exit:!0,exitActive:!1,interrupted:e.interrupted||e.enter};case"exit-active":return{enter:!1,enterActive:!1,exit:!0,exitActive:!0,interrupted:!1};case"done":default:return oIe}},eht=({ref:e,as:t,children:n,className:i,transitionId:r,style:s,preventMountTransition:o,shouldRender:l,enterDuration:c,exitDuration:u,removeChild:d,onEnter:f,onEnterActive:h,onEnterComplete:m,onExit:g,onExitActive:b,onExitComplete:v})=>{const[y,w]=p.useReducer(Jft,Zft(o||!1)),x=p.useRef(!1),O=p.useRef(null),k=p.useRef(c);k.current=c;const S=p.useRef(u);S.current=u;const C=p.useRef(null),E=p.useCallback(j=>{const T=O.current;if(!(!T||j===C.current))switch(C.current=j,j){case"enter":f(T);break;case"enter-active":h(T);break;case"enter-complete":m(T);break;case"exit":g(T);break;case"exit-active":b(T);break;case"exit-complete":v(T);break}},[f,h,m,g,b,v]);return ji.useLayoutEffect(()=>{if(!l){let R;w({type:"exit-before"}),E("exit");const A=pI(()=>{w({type:"exit-active"}),E("exit-active"),R=window.setTimeout(()=>{E("exit-complete"),d()},S.current)});return()=>{A(),R!==void 0&&clearTimeout(R)}}if(o&&!x.current){x.current=!0;return}let j;w({type:"enter-before"}),E("enter");const T=pI(()=>{w({type:"enter-active"}),E("enter-active"),j=window.setTimeout(()=>{w({type:"done"}),E("enter-complete")},k.current)});return()=>{T(),j!==void 0&&clearTimeout(j)}},[l,o,d,E]),p.useEffect(()=>()=>{x.current=!1},[]),a.jsx(t,{ref:eT([O,e]),className:Ui(i,Yft.TransitionGroupChild),"data-transition-id":r,style:s,"data-entering":y.enter?"":void 0,"data-entering-active":y.enterActive?"":void 0,"data-exiting":y.exit?"":void 0,"data-exiting-active":y.exitActive?"":void 0,"data-interrupted":y.interrupted?"":void 0,children:n})},tht=e=>{const{enterMountDelay:t,preventMountTransition:n}=e,i=!n&&t!=null?t:null,[r,s]=p.useState(i==null);return OV(()=>s(!0),r?null:i),r?a.jsx(eht,{...e}):null},Y1=e=>{const{ref:t,as:n="span",children:i,className:r,transitionId:s,style:o,enterDuration:l=0,exitDuration:c=0,preventInitialTransition:u=!0,enterMountDelay:d,insertMethod:f="append",disableAnimations:h=Wft()}=e,m=Lv(e.onEnter??Mv),g=Lv(e.onEnterActive??Mv),b=Lv(e.onEnterComplete??Mv),v=Lv(e.onExit??Mv),y=Lv(e.onExitActive??Mv),w=Lv(e.onExitComplete??Mv);p.Children.forEach(i,S=>{if(S&&!S.key)throw new Error("Child elements of must include a `key`")});const x=p.useCallback(S=>({component:S,shouldRender:!0,removeChild:()=>{k(C=>C.filter(E=>S.key!==E.component.key))},onEnter:m,onEnterActive:g,onEnterComplete:b,onExit:v,onExitActive:y,onExitComplete:w}),[m,g,b,v,y,w]),[O,k]=p.useState(()=>See(i).map(S=>({...x(S),preventMountTransition:u})));return p.useLayoutEffect(()=>{k(S=>{const C=See(i);return Kft(C,S,x,f)})},[i,f,x]),Gft("TransitionGroup",t,p.Children.count(i)),h?a.jsx(a.Fragment,{children:p.Children.map(i,S=>a.jsx(n,{ref:t,className:r,style:o,"data-transition-id":s,children:S}))}):a.jsx(a.Fragment,{children:O.map(({component:S,...C})=>a.jsx(tht,{...C,as:n,className:r,transitionId:s,enterDuration:l,exitDuration:c,enterMountDelay:d,style:o,ref:t,children:S},S.key))})},nht="_Button_1864l_1",iht="_ButtonInner_1864l_4",rht="_ButtonLoader_1864l_749",r4={Button:nht,ButtonInner:iht,ButtonLoader:rht},_t=e=>{const{type:t="button",color:n="primary",variant:i="solid",pill:r=!0,uniform:s=!1,size:o="md",iconSize:l,gutterSize:c,loading:u,selected:d,block:f,opticallyAlign:h,children:m,className:g,onClick:b,disabled:v,disabledTone:y,inert:w=u,...x}=e,O=v||w,k=p.useCallback(S=>{v||b==null||b(S)},[b,v]);return a.jsxs("button",{type:t,className:Ui(r4.Button,g),"data-color":n,"data-variant":i,"data-pill":r?"":void 0,"data-uniform":s?"":void 0,"data-size":o,"data-gutter-size":c,"data-icon-size":l,"data-loading":u?"":void 0,"data-selected":d?"":void 0,"data-block":f?"":void 0,"data-optically-align":h,onPointerEnter:kV,disabled:O,"aria-disabled":O,tabIndex:O?-1:void 0,"data-disabled":v?"":void 0,"data-disabled-tone":v?y:void 0,onClick:k,...x,children:[a.jsx(Y1,{className:r4.ButtonLoader,enterDuration:250,exitDuration:150,children:u&&a.jsx(WA,{},"loader")}),a.jsx("span",{className:r4.ButtonInner,children:wV(m)})]})},sht=()=>{var e;return typeof ClipboardItem<"u"&&!!((e=navigator.clipboard)!=null&&e.write)};function aht(e){const{"text/plain":t,...n}=e;return new ClipboardItem({...n,...t?{"text/plain":new Blob([t],{type:"text/plain"})}:null})}async function oht(e,t=document.body){if(typeof e=="string")return Eee(e,t);try{return sht()?(await navigator.clipboard.write([aht(e)]),!0):e["text/plain"]?Eee(e["text/plain"],t):!1}catch{return!1}}async function Eee(e,t=document.body){if(navigator.clipboard)try{return await navigator.clipboard.writeText(e),!0}catch{}const n=document.createElement("textarea");n.value=e,n.style.position="fixed",n.style.top="0",n.style.left="0",n.style.opacity="0",t.appendChild(n),n.focus(),n.select();let i=!1;try{i=document.execCommand("copy")}catch{}return t.removeChild(n),i}const lht="_TransitionItem_1o7b1_1",cht={TransitionItem:lht},uht=e=>{const{as:t="span",className:n,children:i,preventInitialTransition:r,insertMethod:s,transitionClassName:o,transitionPosition:l="absolute"}=e,{enterTotalDuration:c,exitTotalDuration:u,variables:d}=mht(e);return a.jsx(t,{className:Ui("block",l==="absolute"&&"relative",n),"data-transition-position":l,style:d,children:a.jsx(Y1,{as:t,className:Ui(cht.TransitionItem,o),enterDuration:c,exitDuration:u,insertMethod:s,preventInitialTransition:r,children:i})})},dht=400,fht=500,hht=200,pht=300;function mht({initial:e,enter:t,exit:n,forceCompositeLayer:i}){const r=W3(e),s=W3(t),o=W3(n),l=[r,o,s].some(b=>b!=="none"),c=(t==null?void 0:t.duration)??(l?fht:dht),u=(t==null?void 0:t.timingFunction)??(l?"var(--cubic-enter)":"ease"),d=(n==null?void 0:n.duration)??(l?pht:hht),f=(n==null?void 0:n.timingFunction)??(l?"var(--cubic-exit)":"ease"),h=z0({"tg-will-change":i?"transform, opacity":"auto","tg-enter-opacity":q3((t==null?void 0:t.opacity)??1),"tg-enter-transform":s,"tg-enter-filter":K3(t),"tg-enter-duration":o_(c),"tg-enter-delay":o_((t==null?void 0:t.delay)??0),"tg-enter-timing-function":u,"tg-exit-opacity":q3((n==null?void 0:n.opacity)??0),"tg-exit-transform":o,"tg-exit-filter":K3(n),"tg-exit-duration":o_(d),"tg-exit-delay":o_((n==null?void 0:n.delay)??0),"tg-exit-timing-function":f,"tg-initial-opacity":q3((e==null?void 0:e.opacity)??(n==null?void 0:n.opacity)??0),"tg-initial-transform":r==="none"?o:r,"tg-initial-filter":K3(e??n??{})}),m=((t==null?void 0:t.delay)??0)+c,g=((n==null?void 0:n.delay)??0)+d;return{enterTotalDuration:m,exitTotalDuration:g,variables:h}}const sH=({children:e,copyValue:t,onClick:n,...i})=>{const[r,s]=p.useState(!1),o=p.useRef(null),l=c=>{r||(s(!0),n==null||n(c),oht(typeof t=="function"?t():t),o.current=window.setTimeout(()=>{s(!1)},1300))};return p.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),a.jsxs(_t,{...i,onClick:l,children:[a.jsx(uht,{className:"w-[var(--button-icon-size)] h-[var(--button-icon-size)]",initial:{scale:.6},enter:{scale:1,delay:150,duration:300},exit:{scale:.6,duration:150},forceCompositeLayer:!0,children:r?a.jsx(fC,{},"copied-icon"):a.jsx(_je,{},"copy-icon")}),typeof e=="function"?e({copied:r}):e]})},ght="_Menu_1t4b0_1",bht="_MenuList_1t4b0_3",yht="_MenuItemContent_1t4b0_53",vht="_MenuItem_1t4b0_53",xht="_ItemActions_1t4b0_98",wht="_PressableInner_1t4b0_117",Oht="_Separator_1t4b0_135",kht="_SubMenuItem_1t4b0_139",Sht="_SubTriggerIcon_1t4b0_141",Eht="_RadioItem_1t4b0_151",Cht="_RadioIndicatorActive_1t4b0_158",Aht="_RadioIndicator_1t4b0_158",Tht="_CheckboxItem_1t4b0_249",_ht="_CheckboxIndicator_1t4b0_256",jht="_CheckboxCircle_1t4b0_269",js={Menu:ght,MenuList:bht,MenuItemContent:yht,MenuItem:vht,ItemActions:xht,PressableInner:wht,Separator:Oht,SubMenuItem:kht,SubTriggerIcon:Sht,RadioItem:Eht,RadioIndicatorActive:Cht,RadioIndicator:Aht,CheckboxItem:Tht,CheckboxIndicator:_ht,CheckboxCircle:jht},lIe=p.createContext(null),tT=()=>{const e=p.useContext(lIe);if(!e)throw new Error("Menu components must be wrapped in ");return e},er=({children:e,forceOpen:t,onOpen:n,onClose:i,modal:r=!1})=>{const[s,o]=p.useState(!1),l=t??s,c=rb(n),u=rb(i),d=p.useCallback(h=>{var m,g;o(h),h?(m=c.current)==null||m.call(c):(g=u.current)==null||g.call(u)},[c,u]);JA(s,()=>{d(!1)});const f=p.useMemo(()=>({open:l,setOpen:d}),[l,d]);return a.jsx(lIe.Provider,{value:f,children:a.jsx(bdt,{open:l,onOpenChange:d,modal:r,children:e})})},Nht=({className:e,children:t,disabled:n,onSelect:i,onClick:r})=>{const{open:s}=tT(),o=l=>{s||l.preventDefault()};return i?a.jsx(TRe,{className:Ui(js.MenuItem,e),onSelect:i,onClick:r,disabled:n,onPointerMove:o,onPointerLeave:o,children:a.jsx("div",{className:js.PressableInner,children:t})}):a.jsx("div",{className:Ui(js.MenuItemContent,e),children:t})},Rht=({className:e,children:t})=>a.jsx("div",{className:Ui(js.ItemActions,e),children:t}),Iht=({children:e,onClick:t})=>{const{setOpen:n}=tT();return a.jsx(_t,{className:"rounded-sm",color:"secondary",size:"xs",uniform:!0,iconSize:"sm",variant:"ghost",onClick:i=>{i.stopPropagation(),n(!1),t(i)},children:e})},Pht=e=>{const{className:t,children:n,href:i,to:r,disabled:s,as:o,...l}=e,{open:c}=tT(),u=i||r,d=u?/^https?:\/\//.test(u):!0,f=aIe(),h=o||(d?"a":f),m=b=>{c||b.preventDefault()},g=d?{target:"_blank",rel:"noopener noreferrer",href:i??r}:{href:i,to:r};return a.jsx(TRe,{asChild:!0,className:Ui(js.MenuItem,t),disabled:s,onPointerMove:d?void 0:m,onPointerLeave:d?void 0:m,children:a.jsx(h,{...g,...l,children:a.jsx("span",{className:js.PressableInner,children:n})})})},Dht=({className:e})=>a.jsx(kdt,{className:Ui(js.Separator,e),role:"separator"}),Mht=({children:e,side:t,sideOffset:n=5,align:i,alignOffset:r,width:s,minWidth:o,maxHeight:l})=>{const{open:c}=tT();return a.jsx(ARe,{forceMount:!0,children:a.jsx(Y1,{className:js.Menu,enterDuration:350,exitDuration:200,disableAnimations:!0,children:c&&a.jsx(vdt,{forceMount:!0,className:js.MenuList,side:t,sideOffset:n,align:i,alignOffset:r??(i==="center"?0:-5),avoidCollisions:!0,collisionPadding:{bottom:30,top:30,left:12,right:12},onEscapeKeyDown:Dp,style:z0({"menu-width":s,"menu-min-width":o,"menu-max-height":l}),children:e},"dropdown")})})},Lht=({children:e,disabled:t})=>a.jsx(ydt,{asChild:!0,disabled:t,children:e}),cIe=p.createContext(null),uIe=()=>{const e=p.useContext(cIe);if(!e)throw new Error("Submenu components must be wrapped in ");return e},$ht=({children:e,forceOpen:t,onOpen:n,onClose:i})=>{const[r,s]=p.useState(!1),o=p.useRef(null),l=t??r,c=rb(n),u=rb(i),d=p.useCallback(h=>{var m,g;s(h),h?(m=c.current)==null||m.call(c):(g=u.current)==null||g.call(u)},[c,u]);JA(r,()=>{var h;d(!1),(h=o.current)==null||h.focus()});const f=p.useMemo(()=>({open:l,setOpen:d,triggerRef:o}),[l,d]);return a.jsx(cIe.Provider,{value:f,children:a.jsx(Sdt,{open:l,onOpenChange:d,children:e})})},Fht=({className:e,children:t,disabled:n})=>{const{open:i}=tT(),{triggerRef:r}=uIe(),s=o=>{i||o.preventDefault()};return a.jsx(Edt,{ref:r,className:Ui(js.MenuItem,js.SubMenuItem,e),disabled:n,onPointerMove:s,onPointerLeave:s,children:a.jsxs("div",{className:js.PressableInner,children:[t,a.jsx(Yst,{width:"16",height:"16",className:js.SubTriggerIcon})]})})},Bht=({children:e,sideOffset:t=4,alignOffset:n=-6,width:i="auto",minWidth:r="auto",maxHeight:s})=>{const{open:o}=uIe();return a.jsx(ARe,{forceMount:!0,children:a.jsx(Y1,{className:js.Menu,enterDuration:350,exitDuration:200,disableAnimations:!0,children:o&&a.jsx(Cdt,{className:js.MenuList,sideOffset:t,alignOffset:n,avoidCollisions:!0,collisionPadding:{bottom:30,top:30,left:12,right:12},onEscapeKeyDown:Dp,style:z0({"menu-width":i,"menu-min-width":r,"menu-max-height":s}),children:e},"submenu")})})},Uht=({children:e,value:t,onChange:n,indicatorPosition:i="end",...r})=>a.jsx(wdt,{...r,value:t,onValueChange:s=>n(s),"data-indicator-position":i,children:e}),Qht=({className:e,children:t,...n})=>a.jsx(Odt,{className:Ui(js.MenuItem,js.RadioItem,e),...n,children:a.jsxs("div",{className:js.PressableInner,children:[a.jsx("div",{className:js.RadioIndicator,children:a.jsx(_Re,{className:js.RadioIndicatorActive})}),t]})}),zht=({className:e,children:t,indicatorPosition:n="end",indicatorVariant:i="solid",...r})=>a.jsx(xdt,{className:Ui(js.MenuItem,js.CheckboxItem,e),...r,"data-indicator-position":n,"data-indicator-variant":i,children:a.jsxs("div",{className:js.PressableInner,children:[a.jsx("div",{className:js.CheckboxIndicator,children:a.jsx(_Re,{children:i==="ghost"?a.jsx(fC,{className:"size-4"}):a.jsx("div",{className:js.CheckboxCircle,children:a.jsx(fC,{className:"size-4"})})})}),t]})});er.Content=Mht;er.Item=Nht;er.ItemActions=Rht;er.ItemAction=Iht;er.Link=Pht;er.Separator=Dht;er.Trigger=Lht;er.Sub=$ht;er.SubTrigger=Fht;er.SubContent=Bht;er.CheckboxItem=zht;er.RadioGroup=Uht;er.RadioItem=Qht;const Vht="_Tooltip_16g2y_1",Hht="_TriggerDecorator_16g2y_73",dIe={Tooltip:Vht,TriggerDecorator:Hht},ka=e=>{const{ref:t,children:n,content:i,forceOpen:r=i===null?!1:void 0,maxWidth:s=300,openDelay:o=150,interactive:l=!1,compact:c=!1,preventUnintentionalClickToClose:u,align:d,alignOffset:f=0,side:h,sideOffset:m=5,gutterSize:g="md",contentClassName:b,onPointerDown:v,onClick:y,...w}=e,[x,O]=p.useState(!1),[k,S]=p.useState(!1);OV(()=>S(!1),k?400:null);const C=r??x,E=T=>{typeof r!="boolean"&&(O(T),u&&S(T))},j=T=>{u&&k&&(T.preventDefault(),T.stopPropagation())};return a.jsxs(fIe,{open:C,delayDuration:o,onOpenChange:E,disableHoverableContent:!l,children:[a.jsx(rIe,{asChild:!0,children:a.jsx(oNe,{...w,ref:t,onPointerDown:T=>{j(T),v==null||v(T)},onClick:T=>{j(T),y==null||y(T)},children:n})}),a.jsx(hIe,{maxWidth:s,compact:c,align:d,alignOffset:f,side:h,sideOffset:m,gutterSize:g,className:b,children:i})]})},fIe=({children:e,open:t,onOpenChange:n,...i})=>(JA(t,()=>{n(!1)}),a.jsx(Bft,{children:a.jsx(Uft,{open:t,onOpenChange:n,...i,children:e})})),hIe=({children:e,maxWidth:t=300,compact:n=!1,clickable:i=void 0,alignOffset:r=0,sideOffset:s=5,gutterSize:o="md",className:l,style:c,...u})=>a.jsx(Qft,{children:a.jsx(zft,{...u,className:Ui(dIe.Tooltip,l),"data-compact":n,"data-clickable":i,"data-gutter-size":o,alignOffset:r,sideOffset:s,collisionPadding:15,hideWhenDetached:!0,style:{...c,maxWidth:t},onEscapeKeyDown:Dp,children:e})}),qht=({children:e,asChild:t=!0,...n})=>a.jsx(rIe,{asChild:t,...n,children:e}),Wht=e=>{const{children:t,className:n,focusable:i=!0,ref:r,...s}=e,o=typeof t=="string";return a.jsx(oNe,{ref:r,...s,className:Ui(dIe.TriggerDecorator,n),tabIndex:i?0:void 0,children:o?a.jsx("span",{children:t}):t})};ka.Root=fIe;ka.Content=hIe;ka.Trigger=qht;ka.TriggerDecorator=Wht;const Kht=50,Cee=48;function Ght(e){return(e.events??[]).flatMap(t=>{var r,s;const i=(((r=t.content)==null?void 0:r.parts)??[]).map(o=>typeof o.text=="string"?o.text:"").filter(Boolean).join("");return i?[{text:i,role:t.author??((s=t.content)==null?void 0:s.role)??"",ts:t.timestamp}]:[]})}function Xht(e){var t,n;for(const i of e.events??[])if(i.author==="user"||((t=i.content)==null?void 0:t.role)==="user"){const r=(((n=i.content)==null?void 0:n.parts)??[]).map(s=>s.text).find(Boolean);if(r)return r}return Q("search.untitledSession")}function Yht(e,t,n){const i=Math.max(0,t-Cee),r=Math.min(e.length,t+n+Cee);return(i>0?"…":"")+e.slice(i,r).trim()+(r{var c;if((c=l.events)!=null&&c.length)return l;try{return await sC(t,e,l.id)}catch{return l}})),o=[];for(const l of s)for(const{text:c,role:u,ts:d}of Ght(l)){const f=c.toLowerCase().indexOf(i);if(f!==-1){o.push({type:"session",appId:t,sessionId:l.id,title:Xht(l),snippet:Yht(c,f,i.length),role:u,ts:d??l.lastUpdateTime});break}}return o.sort((l,c)=>(c.ts??0)-(l.ts??0)),o.slice(0,Kht)}async function Jht(e,t){if(!e||!t.trim())return{results:[]};let n;try{n=await wTe(e,t.trim())}catch(o){const l=String(o);return{results:[],note:l.includes("404")?Q("search.webUnavailable"):Q("search.webFailed",{message:l})}}const{mounted:i,results:r,error:s}=n;return i?s?{results:[],note:s}:{results:r.map((o,l)=>({type:"web",index:l,title:o.title,url:o.url,siteName:o.siteName,summary:o.summary}))}:{results:[],note:Q("search.webNotMounted")}}async function ept(e,t,n,i){if(!t||!i.trim())return{results:[]};const r=await xTe(t,e,i.trim(),n);if(!r.mounted)return{results:[],note:Q(e==="knowledge"?"search.knowledgeNotMounted":"search.memoryNotMounted")};if(r.error)return{results:[],note:r.error};const s=r.sourceName??Q(e==="knowledge"?"search.knowledge":"search.longTermMemory");return{results:r.results.map((o,l)=>e==="knowledge"?{type:"knowledge",index:l,content:o.content,sourceName:s,sourceType:r.sourceType}:{type:"memory",index:l,content:o.content,sourceName:s,sourceType:r.sourceType,author:o.author,ts:o.timestamp})}}async function tpt(e,t,n){return e==="session"?{results:await Zht(n.userId,n.appId,t)}:e==="web"?Jht(n.appId,t):ept(e,n.appId,n.userId,t)}function pIe({mirrored:e=!1}){return a.jsxs("g",{opacity:"0.5",transform:e?"translate(20 0) scale(-1 1)":void 0,children:[a.jsx("path",{className:"sidebar-panel-glyph__divider",d:"M5.938 6.833c.11 0 .249.102.249.292v6.042c0 .19-.14.291-.249.291s-.248-.101-.248-.291V7.125c0-.19.139-.292.248-.292Z",strokeWidth:"1.167"}),a.jsx("path",{className:"sidebar-panel-glyph__frame",d:"M14.5 3.75h-9a3 3 0 0 0-3 3v6.857a3 3 0 0 0 3 3h9a3 3 0 0 0 3-3V6.75a3 3 0 0 0-3-3Z",strokeWidth:"1.667",strokeLinecap:"round",strokeLinejoin:"round"})]})}function npt(e){return a.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",...e,children:a.jsx(pIe,{})})}function ipt(e){return a.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",...e,children:a.jsx(pIe,{mirrored:!0})})}function rpt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 8.333c.368 0 .667.299.667.667v2h2a.667.667 0 0 1 0 1.333h-2v2a.667.667 0 0 1-1.334 0v-2h-2a.667.667 0 0 1 0-1.333h2V9c0-.368.299-.667.667-.667ZM7.667 1c3.49 0 6.383 2.554 6.913 5.896a.667.667 0 0 1-1.317.208 5.667 5.667 0 1 0-9.708 4.424.67.67 0 0 1 .07.12.667.667 0 0 1-.13.834l-.95.853 4.788-.002a.667.667 0 0 1 0 1.334l-5.657.002c-.917 0-1.35-1.131-.67-1.744l1.163-1.045A6.97 6.97 0 0 1 .667 8c0-3.866 3.134-7 7-7Z",fill:"currentColor"})})}function spt(e){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.333",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"7.333",cy:"7.333",r:"5.333"}),a.jsx("path",{d:"m11.133 11.133 2.867 2.867"})]})}function apt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M8 0.667c4.05 0 7.334 3.283 7.334 7.333 0 4.05-3.284 7.334-7.334 7.334S0.667 12.05 0.667 8 3.95 0.667 8 0.667Zm0 1.333a6 6 0 1 0 0 12A6 6 0 0 0 8 2ZM6.167 6c.368 0 .667.299.667.667v2a.667.667 0 0 1-1.334 0v-2c0-.368.299-.667.667-.667Zm3.666 0c.368 0 .667.299.667.667v2a.667.667 0 0 1-1.333 0v-2c0-.368.298-.667.666-.667Z",fill:"currentColor"})})}function mIe(e){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M7.58 2.6a.667.667 0 0 0-.667-.667h-.666a.667.667 0 0 0-.667.667v10.667c0 .368.299.666.667.666h.666a.667.667 0 0 0 .667-.666V2.6Zm1.333 10.667A2 2 0 0 1 6.913 15.267h-.666a2 2 0 0 1-2-2V2.6a2 2 0 0 1 2-2h.666a2 2 0 0 1 2 2v10.667Z",fill:"currentColor"}),a.jsx("path",{d:"M11.88 5.045a.667.667 0 0 0-.801-.514l-.653.136a.667.667 0 0 0-.504.786l1.85 8.092c.081.358.44.589.8.514l.653-.137a.667.667 0 0 0 .504-.786L11.88 5.045Zm3.155 7.82a2 2 0 0 1-1.512 2.358l-.653.136a2 2 0 0 1-2.403-1.541L8.617 5.726a2 2 0 0 1 1.513-2.358l.652-.136a2 2 0 0 1 2.404 1.541l1.849 8.092Z",fill:"currentColor"}),a.jsx("path",{d:"M4.247 2.6a.667.667 0 0 0-.667-.667h-.667a.667.667 0 0 0-.666.667v10.667c0 .368.298.666.666.666h.667a.667.667 0 0 0 .667-.666V2.6ZM5.58 13.267a2 2 0 0 1-2 2h-.667a2 2 0 0 1-2-2V2.6a2 2 0 0 1 2-2h.667a2 2 0 0 1 2 2v10.667Z",fill:"currentColor"})]})}function gIe(e){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M3.25 2.25h6l3.5 3.5v8H3.25v-11Z"}),a.jsx("path",{d:"M9.25 2.25v3.5h3.5M5.5 8.25h5M5.5 10.75h4"})]})}function opt({className:e="icon"}){return a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[a.jsx("path",{d:"M16.4 10.7a5.7 5.7 0 1 1-1.67-4.03"}),a.jsx("path",{d:"M15.25 15.25 19.6 19.6"})]})}function lpt({open:e}){return a.jsx("svg",{className:`search-source-chevron ${e?"open":""}`,viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:a.jsx("path",{d:"m3.25 4.75 2.75 2.5 2.75-2.5"})})}function cpt({active:e=!1,onClick:t}){const{t:n}=Te("workspaceTools");return a.jsxs("button",{className:`new-chat${e?" is-active":""}`,onClick:t,"aria-label":n("search.nav"),"aria-current":e?"page":void 0,title:n("search.nav"),children:[a.jsx(spt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:n("search.nav")})]})}function upt(e,t,n,i){const r=!!e,s=new Set((t==null?void 0:t.searchSources)??[]),o=l=>r?n?i("search.checkingCapabilities"):i("search.notMounted",{label:l}):i("search.selectAgent");return[{id:"session",label:i("search.sources.session"),ready:r,unavailableLabel:i("search.selectAgent")},{id:"web",label:i("search.sources.web"),ready:r&&s.has("web"),description:i("search.webDescription"),unavailableLabel:o(" web_search")},{id:"knowledge",label:i("search.sources.knowledge"),ready:r&&s.has("knowledge"),unavailableLabel:o(i("search.sources.knowledge"))},{id:"memory",label:i("search.sources.memory"),ready:r&&s.has("memory"),unavailableLabel:o(i("search.sources.memory"))}]}function mI(e,t){return{context_search:"Context Search",local:t("search.backendLocal"),mem0:"Mem0",milvus:"Milvus",opensearch:"OpenSearch",openviking:"OpenViking",redis:"Redis",tos_vector:"TOS Vector",viking:"VikingDB"}[e.toLowerCase()]??e}function Aee(e,t){return e?new Date(e*1e3).toLocaleString(t,{timeZone:"Asia/Shanghai",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):""}function dpt({userId:e,appId:t,agentInfo:n,capabilitiesLoading:i,agentLabel:r,onOpenSession:s}){var L,F;const{t:o,i18n:l}=Te("workspaceTools"),c=l.resolvedLanguage||l.language,[u,d]=p.useState("session"),[f,h]=p.useState(""),[m,g]=p.useState([]),[b,v]=p.useState(),[y,w]=p.useState(!1),[x,O]=p.useState(!1),[k,S]=p.useState(!1),C=p.useRef(0),E=p.useRef(null),j=upt(t,n,i,o),T=j.find(M=>M.id===u),R=u==="knowledge"?(L=n==null?void 0:n.components)==null?void 0:L.find(M=>M.source==="knowledgebase"||M.kind==="knowledgebase"):u==="memory"?(F=n==null?void 0:n.components)==null?void 0:F.find(M=>M.source==="long_term_memory"||M.kind==="memory"):void 0;p.useEffect(()=>{C.current+=1,d("session"),g([]),v(void 0),O(!1),w(!1),S(!1)},[t]),p.useEffect(()=>{if(!k)return;function M(V){var q;(q=E.current)!=null&&q.contains(V.target)||S(!1)}return document.addEventListener("pointerdown",M),()=>document.removeEventListener("pointerdown",M)},[k]);async function A(M,V){var z;const q=M.trim();if(!q||!((z=j.find(Z=>Z.id===V))!=null&&z.ready))return;const U=++C.current;w(!0),O(!0);let J;try{J=await tpt(V,q,{userId:e,appId:t})}catch(Z){const ne=Z instanceof Error?Z.message:String(Z);J={results:[],note:o("search.failed",{message:ne})}}U===C.current&&(g(J.results),v(J.note),w(!1))}function N(M){C.current+=1,h(M),g([]),v(void 0),O(!1),w(!1)}function P(M){C.current+=1,d(M),S(!1),g([]),v(void 0),O(!1),w(!1)}const I=!!(T!=null&&T.ready),D=t?u==="web"?o("search.placeholder.web"):u==="knowledge"?o("search.placeholder.knowledge",{name:(R==null?void 0:R.name)??o("search.placeholder.knowledgeFallback")}):u==="memory"?o("search.placeholder.memory",{name:(R==null?void 0:R.name)??o("search.placeholder.memoryFallback")}):o("search.placeholder.session"):o("search.placeholder.selectAgent"),_=R!=null&&R.backend?mI(R.backend,o):"";return a.jsxs("div",{className:"search",children:[a.jsxs("div",{className:"search-box",children:[a.jsxs("div",{className:"search-source-picker-wrap",ref:E,children:[a.jsxs("button",{className:"search-source-picker",type:"button","aria-label":o("search.sourceTypeAria",{label:(T==null?void 0:T.label)??o("search.notSelected")}),"aria-haspopup":"listbox","aria-expanded":k,onClick:()=>S(M=>!M),children:[a.jsx("span",{children:(T==null?void 0:T.label)??o("search.sourceType")}),_&&a.jsx("small",{children:_}),a.jsx(lpt,{open:k})]}),k&&a.jsx("div",{className:"search-source-menu",role:"listbox","aria-label":o("search.selectSource"),children:j.map(M=>{var U,J;const V=M.id==="knowledge"?(U=n==null?void 0:n.components)==null?void 0:U.find(z=>z.source==="knowledgebase"||z.kind==="knowledgebase"):M.id==="memory"?(J=n==null?void 0:n.components)==null?void 0:J.find(z=>z.source==="long_term_memory"||z.kind==="memory"):void 0,q=V?[V.name,V.backend?mI(V.backend,o):""].filter(Boolean).join(" · "):M.ready?M.description:M.unavailableLabel;return a.jsxs("button",{type:"button",role:"option","aria-selected":u===M.id,disabled:!M.ready,onClick:()=>P(M.id),children:[a.jsx("span",{children:M.label}),q&&a.jsx("small",{children:q})]},M.id)})})]}),a.jsx("span",{className:"search-box-divider","aria-hidden":!0}),a.jsx("input",{className:"search-input",value:f,onChange:M=>N(M.target.value),onKeyDown:M=>{M.key==="Enter"&&(M.preventDefault(),A(f,u))},placeholder:D,disabled:!I,autoFocus:!0}),a.jsx("button",{className:"search-go",onClick:()=>void A(f,u),disabled:!f.trim()||y,"aria-label":o("search.nav"),children:y?a.jsx(Fi,{className:"icon spin"}):a.jsx(opt,{className:"icon"})})]}),a.jsx("div",{className:"search-results",children:I?x?y?null:b?a.jsx("div",{className:"search-empty",children:b}):m.length===0&&x?a.jsx("div",{className:"search-empty",children:o("search.noResults",{query:f.trim()})}):m.map((M,V)=>a.jsx(fpt,{result:M,agentLabel:r,onOpen:s,locale:c},V)):a.jsx("div",{className:"search-empty",children:o(u==="web"?"search.instructions.web":u==="knowledge"?"search.instructions.knowledge":u==="memory"?"search.instructions.memory":"search.instructions.session")}):a.jsx("div",{className:"search-empty",children:t?i?o("search.loadingCapabilities"):(T==null?void 0:T.unavailableLabel)??o("search.sourceUnavailable"):o("search.noAgentHint")})})]})}function fpt({result:e,agentLabel:t,onOpen:n,locale:i}){const{t:r}=Te("workspaceTools");switch(e.type){case"session":return a.jsxs("button",{className:"search-result",onClick:()=>n(e.appId,e.sessionId),children:[a.jsx(Bje,{className:"search-result-icon"}),a.jsxs("div",{className:"search-result-body",children:[a.jsxs("div",{className:"search-result-head",children:[a.jsx("span",{className:"search-result-title",children:e.title}),a.jsxs("span",{className:"search-result-meta",children:[t(e.appId),e.ts?` · ${Aee(e.ts,i)}`:""]})]}),a.jsx("div",{className:"search-result-snippet",children:e.snippet})]})]});case"web":return a.jsxs("a",{className:"search-result",href:e.url||void 0,target:"_blank",rel:"noreferrer noopener",children:[a.jsx(nM,{className:"search-result-icon"}),a.jsxs("div",{className:"search-result-body",children:[a.jsxs("div",{className:"search-result-head",children:[a.jsx("span",{className:"search-result-title",children:e.title||e.url}),a.jsxs("span",{className:"search-result-meta",children:[e.siteName,e.url&&a.jsx(p0,{className:"search-result-ext"})]})]}),e.summary&&a.jsx("div",{className:"search-result-snippet",children:e.summary})]})]});case"knowledge":return a.jsxs("div",{className:"search-result search-result-static",children:[a.jsx(Tee,{source:"knowledge"}),a.jsxs("div",{className:"search-result-body",children:[a.jsxs("div",{className:"search-result-head",children:[a.jsx("span",{className:"search-result-title",children:r("search.knowledgeFragment",{index:e.index+1})}),a.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${mI(e.sourceType,r)}`:""]})]}),a.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});case"memory":return a.jsxs("div",{className:"search-result search-result-static",children:[a.jsx(Tee,{source:"memory"}),a.jsxs("div",{className:"search-result-body",children:[a.jsxs("div",{className:"search-result-head",children:[a.jsx("span",{className:"search-result-title",children:r("search.memoryFragment",{index:e.index+1})}),a.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${mI(e.sourceType,r)}`:"",e.ts?` · ${Aee(e.ts,i)}`:""]})]}),a.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});default:return null}}function Tee({source:e,className:t="search-result-icon"}){return e==="knowledge"?a.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[a.jsx("path",{d:"M5 5.5h10.5A3.5 3.5 0 0 1 19 9v9.5H8.5A3.5 3.5 0 0 1 5 15V5.5Z"}),a.jsx("path",{d:"M8.25 9h7.5M8.25 12.25h6"})]}):a.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[a.jsx("path",{d:"M12 4.5a7.5 7.5 0 1 0 7.5 7.5"}),a.jsx("path",{d:"M12 8a4 4 0 1 0 4 4M12 11.3a.7.7 0 1 0 0 1.4.7.7 0 0 0 0-1.4Z"})]})}function hpt({filled:e=!1,...t}){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:e?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[a.jsx("rect",{x:"3.5",y:"9.3",width:"4.5",height:"10.2",rx:"1.5"}),a.jsx("path",{d:"M8 10.2 11.3 4.8c.5-.8 1.7-.45 1.7.5v3.8h4.2a2.1 2.1 0 0 1 2.04 2.6l-1.4 5.75A2.1 2.1 0 0 1 15.8 19H8"})]})}function ppt({filled:e=!1,...t}){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:e?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"4.5",height:"10.2",rx:"1.5"}),a.jsx("path",{d:"M8 13.8 11.3 19.2c.5.8 1.7.45 1.7-.5v-3.8h4.2a2.1 2.1 0 0 0 2.04-2.6l-1.4-5.75A2.1 2.1 0 0 0 15.8 5H8"})]})}function bIe(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5.25 4.25h9.5a2.5 2.5 0 0 1 2.5 2.5v3.5"}),a.jsx("path",{d:"M13.25 17.75h-8a2.5 2.5 0 0 1-2.5-2.5v-8a3 3 0 0 1 3-3"}),a.jsx("path",{d:"M7 8.25h5.5M7 11.75h3.25"}),a.jsx("path",{d:"m13.35 16.65.42-2.16 4.76-4.76a1.35 1.35 0 0 1 1.91 1.91l-4.76 4.76-2.33.25Z"}),a.jsx("path",{d:"m17.65 10.6 1.9 1.9"})]})}const pM="/assets/media/logo-DCsNZy-k.svg",aH="data:image/svg+xml,%3csvg%20width='28'%20height='23'%20viewBox='0%200%2028%2023'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M17.1957%209.44218C17.0253%209.58161%2016.7774%209.47317%2016.7774%209.24079V8.01696V0.611967C16.7774%200.395085%2016.514%200.271152%2016.3591%200.410576L6.04172%209.16334C5.87132%209.30276%205.62345%209.19432%205.62345%208.96194V2.98218C5.62345%202.81178%205.48403%202.67235%205.31362%202.67235H0.309832C0.139424%202.67235%200%202.81178%200%202.98218V21.7115C0%2021.9284%200.263357%2022.0524%200.418273%2021.9129L10.7202%2013.1602C10.8906%2013.0207%2011.1385%2013.1292%2011.1385%2013.3616V22.0059C11.1385%2022.2228%2011.4018%2022.3467%2011.5567%2022.2073L21.8586%2013.4545C22.0291%2013.3151%2022.2769%2013.4235%2022.2769%2013.6559V19.6357C22.2769%2019.8061%2022.4163%2019.9455%2022.5868%2019.9455H27.5905C27.7609%2019.9455%2027.9004%2019.8061%2027.9004%2019.6357V0.890816C27.9004%200.673934%2027.637%200.550001%2027.4821%200.689425L17.1957%209.44218Z'%20fill='%230066FC'/%3e%3c/svg%3e";function mpt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M8.5 4.5H6a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-13a2 2 0 0 0-2-2h-2.5"}),a.jsx("rect",{x:"8.5",y:"2.5",width:"7",height:"4",rx:"1.5"}),a.jsx("path",{d:"m8 13 2.5 2.5L16 10"})]})}const _ee="(max-width: 860px)";function jee({title:e}){const t=p.useRef(null),n=p.useRef(null),[i,r]=p.useState(0);p.useLayoutEffect(()=>{const l=t.current,c=n.current;if(!l||!c)return;const u=()=>{const f=Math.max(0,Math.ceil(c.scrollWidth-l.clientWidth));r(h=>h===f?h:f)};u();const d=new ResizeObserver(u);return d.observe(l),d.observe(c),()=>d.disconnect()},[e]);const s=Math.min(12,Math.max(4.8,3.6+i/36)),o={"--history-title-translate":`-${i}px`,"--history-title-duration":`${s.toFixed(2)}s`};return a.jsx("span",{ref:t,className:`history-title${i>0?" is-overflowing":""}`,style:o,children:a.jsx("span",{ref:n,className:"history-title-text",children:e})})}function gpt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"7",cy:"7",r:"2.25"}),a.jsx("circle",{cx:"17",cy:"7",r:"2.25"}),a.jsx("circle",{cx:"7",cy:"17",r:"2.25"}),a.jsx("circle",{cx:"17",cy:"17",r:"2.25"})]})}function bpt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"12",cy:"12",r:"8.25"}),a.jsx("path",{d:"M3.75 12h16.5M12 3.75c2.1 2.2 3.2 4.95 3.2 8.25S14.1 18.05 12 20.25M12 3.75C9.9 5.95 8.8 8.7 8.8 12s1.1 6.05 3.2 8.25"})]})}function ypt(e){let t=2166136261;for(const i of e)t^=i.charCodeAt(0),t=Math.imul(t,16777619);const n=t>>>0;return{"--avatar-hue-a":194+n%22,"--avatar-hue-b":214+(n>>>6)%25,"--avatar-hue-c":176+(n>>>12)%25,"--avatar-x":`${22+(n>>>18)%55}%`,"--avatar-y":`${18+(n>>>24)%58}%`}}const vpt={super_admin:"account.roles.super_admin",admin:"account.roles.admin",developer:"account.roles.developer",user:"account.roles.user"};function xpt({activePage:e,access:t,userInfo:n,onAgentKitCli:i,onDeveloperResources:r,onSystemInfo:s,onIssueFeedback:o,onLogout:l}){const{t:c,i18n:u}=Te(["sidebar","common"]),[d,f]=p.useState("");if(!n)return null;const h=vet(n)||c("sidebar:account.defaultUser"),m=typeof n.email=="string"?n.email.trim():"",g=ypt(h),b=xet(n),v=b===d?"":b,y=vA(u.resolvedLanguage??u.language)??yA;return a.jsx("div",{className:"sidebar-user",children:a.jsxs("div",{className:"sidebar-user-row",children:[a.jsxs(er,{modal:!0,children:[a.jsx(er.Trigger,{children:a.jsxs("button",{type:"button",className:"sidebar-user-btn",title:h,children:[a.jsx("span",{className:`account-avatar${v?" has-image":""}`,style:g,"aria-hidden":"true",children:v?a.jsx("img",{className:"account-avatar-image",src:v,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>f(v)}):null}),a.jsx("span",{className:"sidebar-user-identity",children:a.jsx("span",{className:"sidebar-user-name",children:h})})]})}),a.jsxs(er.Content,{side:"top",align:"start",sideOffset:4,minWidth:216,children:[a.jsxs("div",{className:"account-menu-head",children:[a.jsx("span",{className:`account-avatar account-avatar--lg${v?" has-image":""}`,style:g,"aria-hidden":"true",children:v?a.jsx("img",{className:"account-avatar-image",src:v,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>f(v)}):null}),a.jsxs("div",{className:"account-id",children:[a.jsxs("div",{className:"account-name-row",children:[a.jsx("div",{className:"account-name",children:h}),a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",pill:!0,children:c(`sidebar:${vpt[t.role]}`)})]}),m&&m!==h&&a.jsx("div",{className:"account-sub",children:m})]})]}),a.jsxs(er.Item,{className:"account-menu-action",onSelect:s,children:[a.jsx(pm,{className:"icon","aria-hidden":"true"}),c("sidebar:account.systemInfo")]}),a.jsxs(er.Sub,{children:[a.jsx(er.SubTrigger,{className:"account-menu-action",children:a.jsxs("span",{className:"account-menu-action__label",children:[a.jsx(bpt,{className:"icon"}),c("sidebar:account.language")]})}),a.jsx(er.SubContent,{sideOffset:6,minWidth:136,children:a.jsx(er.RadioGroup,{value:y,onChange:w=>{Aqe(w)},indicatorPosition:"end",children:jU.map(w=>a.jsx(er.RadioItem,{value:w,children:c(`common:languageNames.${w}`)},w))})})]}),a.jsxs(er.Item,{className:"account-menu-action",onSelect:o,children:[a.jsx(bIe,{className:"icon"}),c("sidebar:account.issueFeedback")]}),a.jsxs(er.Item,{className:"account-menu-action",onSelect:l,children:[a.jsx(Qat,{className:"icon","aria-hidden":"true"}),c("sidebar:account.logout")]})]})]}),a.jsxs("div",{className:"sidebar-user-shortcuts","aria-label":c("sidebar:account.shortcuts"),children:[a.jsx(ka,{compact:!0,content:c("sidebar:account.tryCli"),children:a.jsx("button",{type:"button",className:"sidebar-user-shortcut",onClick:i,"aria-label":c("sidebar:account.tryCli"),children:a.jsx(aat,{className:"icon"})})}),a.jsx(ka,{compact:!0,content:c("sidebar:account.developerResources"),children:a.jsx("button",{type:"button",className:`sidebar-user-shortcut${e==="developer-resources"?" is-active":""}`,onClick:r,"aria-label":c("sidebar:account.developerResources"),"aria-current":e==="developer-resources"?"page":void 0,children:a.jsx(Kst,{className:"icon"})})})]})]})})}function wpt({branding:e,cloudProvider:t,sessions:n,currentSessionId:i,activePage:r,features:s,access:o,streamingSids:l,evaluatingSids:c,sandboxHistory:u,onNewChat:d,onSearch:f,onQuickCreate:h,onLibrary:m,onReviewCenter:g,onAddAgent:b,onMyAgents:v,onWorkspace:y,onApplications:w,onCronJobs:x,onAgentKitCli:O,onDeveloperResources:k,onSystemInfo:S,onUserManagement:C,onIssueFeedback:E,onPickSession:j,onDeleteSession:T,userInfo:R,onLogout:A}){const{t:N}=Te("sidebar"),P=z=>(s==null?void 0:s[z])!==!1,I=o.role==="admin"||o.role==="super_admin",D=o.capabilities.manageUsers&&!!C,[_,L]=p.useState(null),F=p.useRef(typeof window<"u"&&window.matchMedia(_ee).matches),[M,V]=p.useState(F.current),q=n.map(z=>({id:z.id,title:z.title||iM(z.events,N("history.newConversation")),createdAt:(z.lastUpdateTime??0)*1e3})).sort((z,Z)=>Z.createdAt-z.createdAt),U=()=>{F.current=!1,V(z=>!z),L(null)};p.useEffect(()=>{const z=window.matchMedia(_ee),Z=ne=>{ne.matches?V(W=>W||(F.current=!0,!0)):F.current&&(F.current=!1,V(!1))};return z.addEventListener("change",Z),()=>z.removeEventListener("change",Z)},[]);const J=t==="byteplus"?aH:pM;return a.jsxs("aside",{className:`sidebar ${M?"is-collapsed":""}`,children:[a.jsxs("div",{className:"sidebar-top",children:[a.jsxs("div",{className:"sidebar-brand-row",children:[a.jsxs("button",{type:"button",className:"brand",onClick:d,"aria-label":N("navigation.home"),title:N("navigation.home"),children:[a.jsx("img",{className:"brand-logo",src:e.logoUrl||J,width:20,height:20,alt:"","aria-hidden":!0}),a.jsx("span",{className:"brand-title",children:e.title})]}),a.jsx("button",{type:"button",className:"sidebar-collapse-toggle",onClick:U,"aria-label":N(M?"navigation.expand":"navigation.collapse"),title:N(M?"navigation.expand":"navigation.collapse"),children:M?a.jsx(ipt,{className:"icon"}):a.jsx(npt,{className:"icon"})})]}),a.jsxs("nav",{className:"sidebar-nav","aria-label":N("navigation.label"),children:[P("newChat")&&a.jsxs("button",{className:`new-chat new-chat--conversation${r==="new-chat"?" is-active":""}`,onClick:d,"aria-label":N("navigation.newChat"),"aria-current":r==="new-chat"?"page":void 0,title:N("navigation.newChat"),children:[a.jsx(rpt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.newChat")})]}),P("search")&&a.jsx(cpt,{active:r==="search",onClick:f}),a.jsxs("button",{className:`new-chat new-chat--agents${r==="agents"?" is-active":""}`,onClick:v,"aria-label":N("navigation.agents"),"aria-current":r==="agents"?"page":void 0,title:N("navigation.agents"),children:[a.jsx(apt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.agents")})]}),a.jsxs("button",{className:`new-chat new-chat--workspaces${r==="workspaces"?" is-active":""}`,onClick:y,"aria-label":N("navigation.workspaces"),"aria-current":r==="workspaces"?"page":void 0,title:N("navigation.workspaces"),children:[a.jsx(Oat,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.workspaces")})]}),a.jsxs("button",{className:`new-chat new-chat--library${r==="library"?" is-active":""}`,onClick:m,"aria-label":N("navigation.library"),"aria-current":r==="library"?"page":void 0,title:N("navigation.library"),children:[a.jsx(mIe,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.library")})]}),a.jsxs("button",{className:`new-chat new-chat--cronjobs${r==="cronjobs"?" is-active":""}`,onClick:x,"aria-label":N("navigation.cronjobs"),"aria-current":r==="cronjobs"?"page":void 0,title:N("navigation.cronjobs"),children:[a.jsx(hV,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.cronjobs")})]}),a.jsxs("button",{className:`new-chat new-chat--applications${r==="applications"?" is-active":""}`,onClick:w,"aria-label":N("navigation.automations"),"aria-current":r==="applications"?"page":void 0,title:N("navigation.automations"),children:[a.jsx(gpt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.automations")})]})]}),I||D?a.jsxs("nav",{className:"sidebar-nav sidebar-nav--administration","aria-label":N("navigation.administration"),children:[a.jsx("div",{className:"sidebar-nav-group-title","aria-hidden":"true",children:N("navigation.administration")}),I?a.jsxs("button",{type:"button",className:`new-chat new-chat--review-center${r==="review-center"?" is-active":""}`,onClick:g,"aria-label":N("navigation.reviewCenter"),"aria-current":r==="review-center"?"page":void 0,title:N("navigation.reviewCenter"),children:[a.jsx(mpt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.reviewCenter")})]}):null,D?a.jsxs("button",{type:"button",className:`new-chat${r==="users"?" is-active":""}`,onClick:C,"aria-label":N("navigation.users"),"aria-current":r==="users"?"page":void 0,title:N("navigation.users"),children:[a.jsx($ot,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.users")})]}):null]}):null]}),P("history")&&a.jsxs("div",{className:"sidebar-history",children:[a.jsxs("div",{className:"history-head",children:[a.jsx("span",{children:N("history.title")}),P("newChat")&&a.jsx("button",{type:"button",className:"history-new-chat",onClick:(u==null?void 0:u.onNew)??d,disabled:u==null?void 0:u.newDisabled,"aria-label":N("history.create"),title:N("history.create"),children:a.jsx(ic,{className:"icon"})})]}),a.jsx("div",{className:"history-list",children:u?a.jsxs(a.Fragment,{children:[u.loading&&u.threads.length===0?a.jsx("div",{className:"history-empty",role:"status",children:N("history.loading")}):null,u.error?a.jsx("div",{className:"history-error",role:"alert",children:u.error}):null,!u.loading&&!u.error&&u.threads.length===0?a.jsx("div",{className:"history-empty",children:N("history.empty")}):null,u.threads.map(z=>{const Z=z.id===u.currentThreadId,ne=z.name||z.preview||`Thread ${z.id.slice(0,8)}`,W=z.id===u.busyThreadId;return a.jsxs("div",{className:`history-item ${Z?"active":""}`,children:[a.jsxs("button",{type:"button",className:"history-item-btn",onClick:()=>u.onSelect(z.id),"aria-current":Z?"page":void 0,title:ne,disabled:W,children:[a.jsx(jee,{title:ne}),Z?a.jsx("span",{className:"history-current-badge",children:N("history.current")}):null]}),a.jsx("button",{type:"button",className:"history-more","aria-label":N("history.manage",{title:ne}),title:N("history.more"),disabled:W,onClick:()=>L(G=>G===z.id?null:z.id),children:a.jsx(KJ,{className:"icon"})}),_===z.id?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"menu-scrim",onClick:()=>L(null)}),a.jsx("div",{className:"history-menu",children:a.jsxs("button",{type:"button",className:"menu-item menu-item--danger",onClick:()=>{L(null),u.onDelete(z)},children:[a.jsx(Jg,{className:"icon"})," ",N("history.delete")]})})]}):null]},z.id)}),u.hasMore?a.jsx("button",{type:"button",className:"history-load-more",disabled:u.loading,onClick:u.onLoadMore,children:u.loading?N("history.loadingMore"):N("history.loadMore")}):null]}):a.jsxs(a.Fragment,{children:[q.length===0?a.jsx("div",{className:"history-empty",children:N("history.empty")}):null,q.map(z=>{const Z=z.id===i,ne=(l==null?void 0:l.has(z.id))===!0,W=!ne&&(c==null?void 0:c.has(z.id))===!0;return a.jsxs("div",{className:`history-item ${Z?"active":""}`,children:[a.jsxs("button",{className:"history-item-btn",onClick:()=>j(z.id),"aria-current":Z?"page":void 0,title:z.title,children:[a.jsx(jee,{title:z.title}),W&&a.jsxs("span",{className:"history-evaluating-status",title:N("history.evaluatingTitle"),children:[a.jsx("span",{className:"history-evaluating","aria-hidden":"true"}),N("history.evaluating")]})]}),a.jsxs("div",{className:"history-action-slot",children:[ne?a.jsx(WA,{className:"history-streaming-indicator",size:12,role:"status","aria-label":N("history.generating")}):null,a.jsx("button",{type:"button",className:"history-more","aria-label":N("history.manage",{title:z.title}),title:N("history.more"),onClick:()=>L(G=>G===z.id?null:z.id),children:a.jsx(KJ,{className:"icon"})})]}),_===z.id&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"menu-scrim",onClick:()=>L(null)}),a.jsx("div",{className:"history-menu",children:a.jsxs("button",{type:"button",className:"menu-item menu-item--danger",onClick:()=>{L(null),T(z.id)},children:[a.jsx(Jg,{className:"icon"})," ",N("history.delete")]})})]})]},z.id)})]})})]}),a.jsx("div",{className:"sidebar-footer",children:a.jsx(xpt,{activePage:r,access:o,userInfo:R,onAgentKitCli:O,onDeveloperResources:k,onSystemInfo:S,onIssueFeedback:E,onLogout:A})})]})}const Opt={name:"studio_share_space"},kpt={name:"studio_review_space"},yIe={share:Opt,review:kpt},Spt=yIe.share.name,vIe=yIe.review.name,Ept=[Spt,vIe];function xIe(e){return Ept.includes(e.trim().toLowerCase())}function Cpt(e){return e.name===vIe}const Apt="/web/skill-management";class e1 extends Error{constructor(t,n,i="SKILL_MANAGEMENT_ERROR",r="",s,o=""){super(t),this.status=n,this.code=i,this.statusText=r,this.originalError=s,this.rawResponse=o,this.name="SkillManagementApiError"}}async function dc(e,t={},n=ho){return fetch(Ta(`${Apt}${e}`),{...t,headers:ul(uc(t.headers)),signal:po(t.signal,n)})}async function nT(e,t){let n=t,i="SKILL_MANAGEMENT_ERROR",r;const s=await e.text().catch(()=>"");try{const o=JSON.parse(s);typeof o.detail=="string"?n=o.detail:o.detail&&(n=o.detail.message||t,i=o.detail.code||i,r=o.detail.originalError)}catch{s.trim()&&(n=Q("common.fallbackWithDetail",{fallback:t,detail:s.trim()}))}return new e1(n,e.status,i,e.statusText,r,s)}async function fc(e,t){if(!e.ok)throw await nT(e,t);return e.json()}async function Tpt(e){const t=new URLSearchParams({region:e.region,page:String(e.page),page_size:String(e.pageSize)});return e.project&&t.set("project",e.project),fc(await dc(`/spaces?${t}`,{signal:e.signal}),Q("skills.listSpacesFailed"))}async function _pt(e){if(xIe(e.name))throw new e1(Q("skills.reservedSpaceName"),409,"SKILL_SPACE_RESERVED_IDENTITY");return fc(await dc("/spaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Q("skills.createSpaceFailed"))}async function jpt(e){const t=new URLSearchParams({region:e.region});return fc(await dc(`/shared-space/ensure?${t}`,{method:"POST",signal:e.signal}),Q("skills.sharedSpaceFailed"))}async function Npt(e){return fc(await dc(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/review`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({region:e.region,version:e.version})},hr),Q("skills.submitReviewFailed"))}async function Rpt(e){const t=new URLSearchParams({region:e.region});return fc(await dc(`/reviews?${t}`,{signal:e.signal}),Q("skills.listReviewsFailed"))}async function Ipt(e){const t=new URLSearchParams({region:e.region});return fc(await dc(`/reviews/${encodeURIComponent(e.id)}/files?${t}`,{signal:e.signal},hr),Q("skills.reviewFilesFailed"))}async function Ppt(e){return fc(await dc(`/reviews/${encodeURIComponent(e.id)}/decision`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({region:e.region,decision:e.decision,reason:e.reason||"",comment:e.comment||""})},hr),Q("skills.decideReviewFailed"))}async function Dpt(e){const t=new URLSearchParams({region:e.region});return fc(await dc(`/spaces/${encodeURIComponent(e.spaceId)}/reviews?${t}`,{signal:e.signal}),Q("skills.listReviewsFailed"))}async function Mpt(e){if(xIe(e.name))throw new e1(Q("skills.reservedSpaceName"),409,"SKILL_SPACE_RESERVED_IDENTITY");return fc(await dc(`/spaces/${encodeURIComponent(e.spaceId)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e.name,description:e.description,region:e.region})}),Q("skills.updateSpaceFailed"))}async function Lpt(e){const t=new URLSearchParams({region:e.region});await fc(await dc(`/spaces/${encodeURIComponent(e.spaceId)}?${t}`,{method:"DELETE"}),Q("skills.deleteSpaceFailed"))}async function $pt(e){const t=new URLSearchParams({region:e.region});return e.project&&t.set("project",e.project),fc(await dc(`/spaces/${encodeURIComponent(e.spaceId)}/skills?${t}`,{method:"POST",headers:{"Content-Type":"application/zip"},body:e.file},hr),Q("skills.uploadFailed"))}async function Fpt(e){return fc(await dc("/validate",{method:"POST",headers:{"Content-Type":"application/zip"},body:e},hr),Q("skills.validateFailed"))}async function Bpt(e){const t=new URLSearchParams({region:e.region});await fc(await dc(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}?${t}`,{method:"DELETE"}),Q("skills.deleteFailed"))}async function wIe(e){const t=new URLSearchParams({region:e.region});e.version&&t.set("version",e.version),e.skillSpaceName&&t.set("skill_space_name",e.skillSpaceName),e.skillName&&t.set("skill_name",e.skillName);const n=await fc(await dc(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/files?${t}`),Q("skills.listFilesFailed"));return Array.isArray(n.files)?n.files:[]}async function Upt(e){var l;const t=new URLSearchParams({region:e.region});e.version&&t.set("version",e.version),e.skillSpaceName&&t.set("skill_space_name",e.skillSpaceName),e.skillName&&t.set("skill_name",e.skillName);const n=await dc(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/archive?${t}`,{},hr);n.ok||await fc(n,Q("skills.downloadFailed"));const r=((l=(n.headers.get("content-disposition")||"").match(/filename="([^"]+)"/))==null?void 0:l[1])||`${e.fallbackName}.zip`,s=URL.createObjectURL(await n.blob()),o=document.createElement("a");o.href=s,o.download=r,o.click(),URL.revokeObjectURL(s)}bn.hasResourceBundle("en-US","create")||bn.addResourceBundle("en-US","create",ehe,!0,!0);bn.hasResourceBundle("zh-CN","create")||bn.addResourceBundle("zh-CN","create",ave,!0,!0);function Xt(e,t={}){return bn.t(e,{...t,ns:"create"})}function Pc(e){var t;return((t=e==null?void 0:e.displayName)==null?void 0:t.trim())||(e==null?void 0:e.name)||""}async function mM(e,t){const n=await fetch(Ta(e),{headers:ul(uc({accept:"application/json"})),signal:po(t,ho)});if(!n.ok)throw await nT(n,Xt("helpers.skills.agentKitRequestFailed"));return n.json()}async function OIe(){return((await mM("/web/skill-spaces")).items||[]).filter(t=>!Cpt(t))}async function kIe(e,t){const n=t?`?region=${encodeURIComponent(t)}`:"";return(await mM(`/web/skill-spaces/${encodeURIComponent(e)}/skills${n}`)).items||[]}async function SIe(e,t){const n=new URLSearchParams({region:t.region,page:String(t.page),page_size:String(t.pageSize)});return t.project&&n.set("project",t.project),mM(`/web/skill-spaces/${encodeURIComponent(e)}/skills?${n.toString()}`,t.signal)}async function Qpt(e,t,n,i,r,s,o){const l=[];n&&l.push(`version=${encodeURIComponent(n)}`),i&&l.push(`region=${encodeURIComponent(i)}`),r&&l.push(`project=${encodeURIComponent(r)}`),s&&l.push(`skill_name=${encodeURIComponent(s)}`),o&&l.push(`skill_space_name=${encodeURIComponent(o)}`);const c=l.length>0?`?${l.join("&")}`:"";return mM(`/web/skill-spaces/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}${c}`)}function zpt(e,t){const n=_y(t);return{source:"skillspace",id:`ss:${e.id}/${n}/${t.version}`,name:t.skillName,description:t.skillDescription,folder:t.skillName,skillSpaceId:e.id,skillSpaceName:e.name,skillSpaceRegion:e.region,skillId:n,version:t.version}}function _y(e){return e.skillId||e.skillName}function Vpt(e,t,n="volcengine"){return n==="byteplus"?"":`https://console.volcengine.com/agentkit/${(t||"cn-beijing")==="cn-beijing"?"cn":"cn-shanghai"}/skillspace/detail/${encodeURIComponent(e)}`}const Hpt="data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20overflow='visible'%20style='display:%20block;'%20width='7.93649'%20height='8'%20viewBox='0%200%207.93649%208'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20id='Resizer'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.21499%200L0%207.27273L0.721499%208L7.93649%200.727273L7.21499%200ZM6.86867%203.99988L3.98268%206.90897L4.70418%207.63625L7.59017%204.72715L6.86867%203.99988Z'%20fill='%23737A87'/%3e%3c/svg%3e";function EIe({className:e="",counter:t,maxHeight:n,...i}){return a.jsxs("div",{className:`studio-textarea ${e}`.trim(),"data-counter":t!=null||void 0,style:{maxHeight:n},children:[a.jsx("textarea",{...i,className:"studio-textarea__input"}),t!=null&&a.jsx("span",{className:"studio-textarea__counter",children:t}),a.jsx("img",{className:"studio-textarea__resizer",src:Hpt,alt:"","aria-hidden":"true"})]})}async function CIe(e,t,n){const i=new URLSearchParams({region:e.region}),r=await fetch(Ta(`/web/skill-management/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/document?${i}`),{...t,headers:ul(uc(t.headers)),signal:po(e.signal,n)});if(!r.ok)throw await nT(r,"SKILL_DOCUMENT_REQUEST_FAILED");return r.json()}function qpt(e){return CIe(e,{},ho)}function Wpt(e){return CIe(e,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:e.content,baseVersion:e.baseVersion})},hr)}function Kpt({target:e,onClose:t,onSaved:n}){const{t:i}=Te("workspaceTools"),[r,s]=p.useState(null),[o,l]=p.useState(""),[c,u]=p.useState(!0),[d,f]=p.useState(!1),[h,m]=p.useState(""),[g,b]=p.useState(0),[v,y]=p.useState(!1),w=p.useId(),x=p.useRef(null),O=p.useRef(!1),k=p.useRef(!0),S=p.useRef({dirty:!1,onClose:t});S.current={dirty:r!==null&&o!==r.content,onClose:t};const C=p.useRef(null);function E(){O.current||(S.current.dirty?y(!0):S.current.onClose())}p.useEffect(()=>{var N,P;k.current=!0;const T=window.document.activeElement instanceof HTMLElement?window.document.activeElement:null,R=window.document.body.style.overflow;window.document.body.style.overflow="hidden",(P=(N=x.current)==null?void 0:N.querySelector("button"))==null||P.focus();function A(I){var _,L;if(I.isComposing||(I.key==="Escape"&&(I.preventDefault(),E()),I.key!=="Tab"))return;const D=Array.from(((_=x.current)==null?void 0:_.querySelectorAll('button:not([disabled]),textarea:not([disabled]),[tabindex="0"]'))??[]);D.length&&(I.shiftKey&&window.document.activeElement===D[0]?(I.preventDefault(),(L=D[D.length-1])==null||L.focus()):!I.shiftKey&&window.document.activeElement===D[D.length-1]&&(I.preventDefault(),D[0].focus()))}return window.addEventListener("keydown",A),()=>{var I;k.current=!1,(I=C.current)==null||I.abort(),window.removeEventListener("keydown",A),window.document.body.style.overflow=R,T!=null&&T.isConnected&&T.focus()}},[]),p.useEffect(()=>{const T=new AbortController;return u(!0),m(""),qpt({...e,signal:T.signal}).then(R=>{T.signal.aborted||(s(R),l(R.content))}).catch(()=>{T.signal.aborted||m("documentLoadFailed")}).finally(()=>{T.signal.aborted||u(!1)}),()=>T.abort()},[e,g]);async function j(){if(O.current||!(r!=null&&r.canUpdate)||o===r.content||!o.trim())return;O.current=!0,f(!0),m("");const T=new AbortController;C.current=T;try{await Wpt({...e,content:o,baseVersion:r.baseVersion,signal:T.signal}),k.current&&(n(),t())}catch(R){k.current&&m(R instanceof e1&&R.status===409?"documentConflict":R instanceof e1&&R.status===403?"accessDenied":"documentSaveFailed")}finally{O.current=!1,k.current&&f(!1)}}return yi.createPortal(a.jsx("div",{className:"mpa-skill-editor-backdrop",children:a.jsxs("section",{className:"mpa-skill-editor",role:"dialog","aria-modal":"true","aria-labelledby":w,ref:x,children:[a.jsxs("header",{children:[a.jsxs("h2",{id:w,children:[e.name," · SKILL.md"]}),a.jsx(Wi,{variant:"ghost",disabled:d,onClick:E,children:i("agentTopology.close")})]}),a.jsx("p",{className:"mpa-skill-editor-hint",children:i("agentTopology.documentEditHint")}),c?a.jsx("p",{role:"status",children:i("agentTopology.documentLoading")}):r?a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[r.baseVersion," ·"," ",i(r.canUpdate?"agentTopology.documentWritable":"agentTopology.documentReadOnly")]}),a.jsx(EIe,{"aria-label":"SKILL.md",value:o,readOnly:!r.canUpdate,disabled:d,maxLength:262144,spellCheck:!1,onChange:T=>l(T.currentTarget.value)})]}):null,h&&a.jsx("p",{role:"alert",children:i(`agentTopology.${h}`)}),v&&a.jsxs("div",{role:"alert",children:[a.jsx("p",{children:i("agentTopology.discardDocument")}),a.jsx(Wi,{variant:"outline",onClick:()=>y(!1),children:i("agentTopology.keepEditing")}),a.jsx(Wi,{variant:"secondary",onClick:t,children:i("agentTopology.discardChanges")})]}),a.jsxs("footer",{children:[!r&&!c&&a.jsx(Wi,{variant:"outline",onClick:()=>b(T=>T+1),children:i("agentTopology.refresh")}),(r==null?void 0:r.canUpdate)&&a.jsx(Wi,{loading:d,disabled:c||o===r.content||!o.trim(),onClick:()=>void j(),children:i("agentTopology.saveDocument")})]})]})}),window.document.body)}function vC(e){return e.trimEnd().replace(/[。.]+$/,"")}function AIe({selected:e,onChange:t,cloudProvider:n="volcengine"}){const{t:i}=Te("create"),[r,s]=p.useState([]),[o,l]=p.useState([]),[c,u]=p.useState(""),[d,f]=p.useState(!0),[h,m]=p.useState(!1),[g,b]=p.useState(null);p.useEffect(()=>{let O=!1;return(async()=>{f(!0),b(null);try{const k=await OIe();O||(s(k),k.length>0&&u(k[0].id))}catch(k){O||b(k instanceof Error?k.message:i("skills.space.loadError"))}finally{O||f(!1)}})(),()=>{O=!0}},[i]),p.useEffect(()=>{if(!c){l([]);return}const O=r.find(S=>S.id===c);let k=!1;return(async()=>{m(!0),b(null);try{const S=await kIe(c,O==null?void 0:O.region);k||l(S)}catch(S){k||b(S instanceof Error?S.message:i("skills.space.loadError"))}finally{k||m(!1)}})(),()=>{k=!0}},[c,r,i]);const v=r.find(O=>O.id===c),y=v?Vpt(v.id,v.region,n):"",w=(O,k)=>e.some(S=>S.source==="skillspace"&&S.skillId===O&&(S.version||"")===k),x=O=>{if(!v)return;const k=_y(O);if(w(k,O.version))t(e.filter(S=>!(S.source==="skillspace"&&S.skillId===k&&(S.version||"")===O.version)));else{const S=zpt(v,O);t([...e,{source:"skillspace",folder:S.folder||O.skillName,name:S.name,description:S.description,skillSpaceId:S.skillSpaceId,skillSpaceName:S.skillSpaceName,skillSpaceRegion:S.skillSpaceRegion,skillId:S.skillId,version:S.version}])}};return a.jsx("div",{className:"cw-skillspace",children:d?a.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[a.jsx(Fi,{className:"cw-i cw-spin"})," ",i("skills.space.loadingSpaces")]}):g?a.jsxs("div",{className:"cw-banner",children:[a.jsx(pm,{className:"cw-i"}),a.jsx("span",{children:g})]}):r.length===0?a.jsx("p",{className:"cw-empty-line",children:i("skills.space.noSpaces")}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"cw-skillspace-header",children:[a.jsx("select",{className:"cw-input cw-skillspace-select",value:c,onChange:O=>u(O.target.value),"aria-label":i("skills.space.selectSpace"),children:r.map(O=>a.jsxs("option",{value:O.id,children:[Pc(O)||O.id,O.description?` — ${vC(O.description)}`:""]},O.id))}),v&&a.jsxs(a.Fragment,{children:[v.region&&a.jsx("span",{className:"cw-skillspace-region-label",title:v.region,children:wh(v.region,n)}),y&&a.jsx("a",{href:y,target:"_blank",rel:"noopener noreferrer",className:"cw-button cw-button-secondary cw-skillspace-console-link",title:i("skills.space.openConsole"),"aria-label":i("skills.space.openConsole"),children:a.jsx(p0,{className:"cw-i cw-i-sm"})})]})]}),h?a.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[a.jsx(Fi,{className:"cw-i cw-spin"})," ",i("skills.space.loadingSkills")]}):o.length===0?a.jsx("p",{className:"cw-empty-line",children:i("skills.space.noSkills")}):a.jsx("div",{className:"cw-skill-results",children:o.map(O=>{const k=_y(O),S=w(k,O.version);return a.jsxs("button",{type:"button",className:`cw-skill-result ${S?"is-on":""}`,onClick:()=>x(O),"aria-pressed":S,children:[a.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:S?a.jsx(Ef,{className:"cw-i cw-i-sm"}):a.jsx(ic,{className:"cw-i cw-i-sm"})}),a.jsxs("span",{className:"cw-skill-result-meta",children:[a.jsxs("span",{className:"cw-skill-result-name",children:[O.skillName,O.version&&a.jsxs("span",{className:"cw-skill-result-version",children:[" ","v",O.version]})]}),O.skillDescription&&a.jsx("span",{className:"cw-skill-result-desc",children:vC(O.skillDescription)}),a.jsxs("span",{className:"cw-skill-result-repo",children:[a.jsx(Tat,{className:"cw-i cw-i-sm"})," ",Pc(v)||c]})]})]},`${k}/${O.version}`)})})]})})}function iT(e,t){return e.map(n=>({...n,get label(){return Xt(`${t}.${n.id}.label`)},get desc(){return Xt(`${t}.${n.id}.description`)}}))}function fd(e,t){const n={...e};for(const[i,r]of Object.entries(t))Object.defineProperty(n,i,{configurable:!0,enumerable:!0,get:()=>Xt(r)});return n}const TIe="https://ark.cn-beijing.volces.com/api/v3/";fd({key:"MODEL_AGENT_NAME",required:!1,placeholder:"doubao-seed-1-6-250615"},{comment:"traditional.catalog.env.modelAgentName.comment"});const kN=[fd({key:"MODEL_EMBEDDING_NAME",required:!1,placeholder:"doubao-embedding-vision-250615"},{comment:"traditional.catalog.env.embeddingModelName.comment"}),{key:"MODEL_EMBEDDING_DIM",required:!1,placeholder:"2048"},{key:"MODEL_EMBEDDING_API_BASE",required:!1,placeholder:TIe}],gI=[],bI={get label(){return Xt("traditional.catalog.links.console")},url:"https://console.volcengine.com/vikingdb/openviking"},Gpt={get label(){return Xt("traditional.catalog.links.documentation")},url:"https://github.com/volcengine/OpenViking/blob/main/docs/zh/api/05-sessions.md"},_Ie="https://api.vikingdb.cn-beijing.volces.com/openviking",Xpt=`{ "self": {"enabled": true}, "peer": {"enabled": true}, "working_memory": {"enabled": true}, "memory_types": null -}`,Ypt=[{key:"DATABASE_VIKING_PROJECT",required:!1,placeholder:"default"},{key:"DATABASE_VIKING_REGION",required:!1},{key:"DATABASE_VIKING_COLLECTION_KIND",required:!1},{key:"DATABASE_VIKING_RESOURCE_ID",required:!1}],Zpt=[hd({key:"DATABASE_VIKINGMEM_PROJECT",required:!1,placeholder:"default",hidden:!0},{comment:"traditional.catalog.env.vikingMemoryProject.comment"}),hd({key:"DATABASE_VIKING_REGION",required:!1,hidden:!0},{comment:"traditional.catalog.env.vikingMemoryRegion.comment"}),hd({key:"DATABASE_VIKINGMEM_MEMORY_TYPE",required:!1,placeholder:"sys_event_v1,sys_profile_v1",hidden:!0},{comment:"traditional.catalog.env.vikingMemoryType.comment"})],sS=[hd({key:"FEISHU_APP_ID",required:!0,placeholder:"cli_xxx"},{comment:"traditional.catalog.env.feishuAppId.comment"}),hd({key:"FEISHU_APP_SECRET",required:!0,secret:!0},{placeholder:"traditional.catalog.env.feishuAppSecret.placeholder",comment:"traditional.catalog.env.feishuAppSecret.comment"})],ow={topK:"3",region:"cn-beijing",endpoint:"https://open.volcengineapi.com/"};function mM(e){if(e==="byteplus"){const t="ap-southeast-1";return{topK:ow.topK,region:t,endpoint:`https://agentkit.${t}.byteplusapi.com/`}}return ow}const jIe=[hd({key:"REGISTRY_SPACE_ID",required:!0},{placeholder:"traditional.catalog.env.registrySpaceId.placeholder",comment:"traditional.catalog.env.registrySpaceId.comment"}),hd({key:"REGISTRY_TOP_K",required:!1,placeholder:ow.topK},{comment:"traditional.catalog.env.registryTopK.comment"}),hd({key:"REGISTRY_REGION",required:!1,placeholder:ow.region},{comment:"traditional.catalog.env.registryRegion.comment"}),hd({key:"REGISTRY_ENDPOINT",required:!1,placeholder:ow.endpoint},{comment:"traditional.catalog.env.registryEndpoint.comment"})],JA=ZA([{id:"web_search",importLine:"from veadk.tools.builtin_tools.web_search import web_search",toolNames:["web_search"],env:mI},{id:"parallel_web_search",importLine:"from veadk.tools.builtin_tools.parallel_web_search import parallel_web_search",toolNames:["parallel_web_search"],env:mI},{id:"link_reader",importLine:"from veadk.tools.builtin_tools.link_reader import link_reader",toolNames:["link_reader"],env:[]},{id:"web_scraper",importLine:"from veadk.tools.builtin_tools.web_scraper import web_scraper",toolNames:["web_scraper"],env:[{key:"TOOL_WEB_SCRAPER_ENDPOINT",required:!0},{key:"TOOL_WEB_SCRAPER_API_KEY",required:!0}]},{id:"image_generate",importLine:"from veadk.tools.builtin_tools.image_generate import image_generate",toolNames:["image_generate"],env:[{key:"MODEL_IMAGE_NAME",required:!1,placeholder:"doubao-seedream-5-0-260128"}]},{id:"image_edit",importLine:"from veadk.tools.builtin_tools.image_edit import image_edit",toolNames:["image_edit"],env:[{key:"MODEL_EDIT_NAME",required:!1,placeholder:"doubao-seededit-3-0-i2i-250628"}]},{id:"video_generate",importLine:"from veadk.tools.builtin_tools.video_generate import video_generate, video_task_query",toolNames:["video_generate","video_task_query"],env:[{key:"MODEL_VIDEO_NAME",required:!1,placeholder:"doubao-seedance-2-0-260128"}]},{id:"text_to_speech",importLine:"from veadk.tools.builtin_tools.tts import text_to_speech",toolNames:["text_to_speech"],env:[{key:"TOOL_VESPEECH_APP_ID",required:!0},{key:"TOOL_VESPEECH_SPEAKER",required:!1,placeholder:"zh_female_vv_uranus_bigtts"}]},{id:"run_code",importLine:"from veadk.tools.builtin_tools.run_code import run_code",toolNames:["run_code"],env:[{key:"AGENTKIT_TOOL_ID",required:!0,placeholder:"t-xxxx",get comment(){return Xt("traditional.catalog.env.agentKitToolId.comment")}},{key:"AGENTKIT_TOOL_REGION",required:!1,placeholder:"cn-beijing",get comment(){return Xt("traditional.catalog.env.agentKitToolRegion.comment")}}]},{id:"vesearch",importLine:"from veadk.tools.builtin_tools.vesearch import vesearch",toolNames:["vesearch"],env:[{key:"TOOL_VESEARCH_ENDPOINT",required:!0,comment:"VeSearch bot_id"}]}],"traditional.catalog"),Jpt=new Set(["web_scraper","text_to_speech","vesearch"]),emt=new Set(["web_search","parallel_web_search"]),tmt=JA.filter(e=>!Jpt.has(e.id));function NIe(e="volcengine"){const t=e==="byteplus"?emt:new Set;return tmt.filter(n=>!t.has(n.id))}const lw=ZA([{id:"local",env:[]},{id:"sqlite",extraArgs:'local_database_path="./short_term_memory.db"',env:[]},{id:"mysql",env:[{key:"DATABASE_MYSQL_HOST",required:!0},{key:"DATABASE_MYSQL_USER",required:!0},{key:"DATABASE_MYSQL_PASSWORD",required:!0},{key:"DATABASE_MYSQL_DATABASE",required:!0}]},{id:"postgresql",env:[{key:"DATABASE_POSTGRESQL_HOST",required:!0},{key:"DATABASE_POSTGRESQL_PORT",required:!1,placeholder:"5432"},{key:"DATABASE_POSTGRESQL_USER",required:!0},{key:"DATABASE_POSTGRESQL_PASSWORD",required:!0},{key:"DATABASE_POSTGRESQL_DATABASE",required:!0}]}],"traditional.backends.shortTerm"),_B=ZA([{id:"local",env:ON,pipExtra:"extensions",needsEmbedding:!0},{id:"opensearch",env:[{key:"DATABASE_OPENSEARCH_HOST",required:!0},{key:"DATABASE_OPENSEARCH_PORT",required:!1,placeholder:"9200"},{key:"DATABASE_OPENSEARCH_USERNAME",required:!0},{key:"DATABASE_OPENSEARCH_PASSWORD",required:!0},...ON],pipExtra:"extensions",needsEmbedding:!0},{id:"redis",env:[{key:"DATABASE_REDIS_HOST",required:!0},{key:"DATABASE_REDIS_PORT",required:!1,placeholder:"6379"},{key:"DATABASE_REDIS_PASSWORD",required:!1},...ON],pipExtra:"extensions",needsEmbedding:!0},{id:"viking",env:Zpt},{id:"openviking",env:[{key:"DATABASE_OPENVIKING_URL",required:!0,placeholder:_Ie,get comment(){return Xt("traditional.catalog.env.openVikingUrl.comment")},link:gI},{key:"DATABASE_OPENVIKING_API_KEY",required:!0,comment:"OpenViking API Key",link:gI},{key:"DATABASE_OPENVIKING_USER_ID",required:!1,placeholder:"default",get comment(){return Xt("traditional.catalog.env.openVikingMemoryUserId.comment")},get help(){return Xt("traditional.catalog.env.openVikingMemoryUserId.help")}},{key:"DATABASE_OPENVIKING_MEMORY_POLICY",required:!1,placeholder:Xpt,get comment(){return Xt("traditional.catalog.env.openVikingMemoryPolicy.comment")},multiline:!0,format:"json",get help(){return Xt("traditional.catalog.env.openVikingMemoryPolicy.help")},link:Gpt}]},{id:"mem0",env:[{key:"DATABASE_MEM0_API_KEY",required:!0},{key:"DATABASE_MEM0_BASE_URL",required:!1}],pipExtra:"database"}],"traditional.backends.longTerm"),Mg="viking",jB=ZA([{id:"viking",env:Ypt},{id:"opensearch",env:[{key:"DATABASE_OPENSEARCH_HOST",required:!0},{key:"DATABASE_OPENSEARCH_PORT",required:!1,placeholder:"9200"},{key:"DATABASE_OPENSEARCH_USERNAME",required:!0},{key:"DATABASE_OPENSEARCH_PASSWORD",required:!0},...ON],pipExtra:"extensions",needsEmbedding:!0},{id:"context_search",env:[...mI,{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ID",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ENDPOINT",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_APIKEY",required:!0}]},{id:"openviking",env:[{key:"DATABASE_OPENVIKING_URL",required:!0,placeholder:_Ie,get comment(){return Xt("traditional.catalog.env.openVikingUrl.comment")},link:gI},{key:"DATABASE_OPENVIKING_API_KEY",required:!0,comment:"OpenViking API Key",link:gI},{key:"DATABASE_OPENVIKING_USER_ID",required:!1,placeholder:"default",get comment(){return Xt("traditional.catalog.env.openVikingKnowledgeUserId.comment")},get help(){return Xt("traditional.catalog.env.openVikingKnowledgeUserId.help")}},{key:"DATABASE_OPENVIKING_TARGET_URI",required:!1,placeholder:"viking://user/default/resources//",get comment(){return Xt("traditional.catalog.env.openVikingTargetUri.comment")},get help(){return Xt("traditional.catalog.env.openVikingTargetUri.help")}}]}],"traditional.backends.knowledge"),nmt=ZA([{id:"apmplus",enableFlag:"ENABLE_APMPLUS",env:[{key:"OBSERVABILITY_OPENTELEMETRY_APMPLUS_SERVICE_NAME",required:!1}]},{id:"cozeloop",enableFlag:"ENABLE_COZELOOP",env:[{key:"OBSERVABILITY_OPENTELEMETRY_COZELOOP_API_KEY",required:!0},{key:"OBSERVABILITY_OPENTELEMETRY_COZELOOP_SERVICE_NAME",required:!1,comment:"CozeLoop space_id"}]},{id:"tls",enableFlag:"ENABLE_TLS",env:[...mI,hd({key:"OBSERVABILITY_OPENTELEMETRY_TLS_SERVICE_NAME",required:!1},{comment:"traditional.catalog.env.tlsServiceName.comment"})]}],"traditional.exporters");function Od(e="volcengine"){return{name:"",description:Xt("defaults.description"),instruction:Xt("defaults.instruction"),dynamicAgentDelegation:!1,agentType:"llm",cloudProvider:e,maxIterations:3,a2aUrl:"",tools:[],skills:[],memory:{shortTerm:!1,longTerm:!1},knowledgebase:!1,tracing:!1,subAgents:[],builtinTools:[],customTools:[],mcpTools:[],a2aRegistry:{enabled:!1,registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},modelName:Xp(e),modelFallbacks:[],modelSource:"ark",modelProvider:"",modelApiBase:"",shortTermBackend:"local",longTermBackend:"local",longTermMemoryIndex:"",autoSaveSession:!1,knowledgebaseBackend:Mg,knowledgebaseIndex:"",tracingExporters:[],selectedSkills:[],cloudEnvironment:{environmentId:"",environmentVersionId:""},deployment:{feishuEnabled:!1,modelApiKeyId:"",modelApiKeyName:""}}}function lk(e){return{id:e,get displayName(){return Xt(`traditional.optimization.options.${e}.label`)},get description(){return Xt(`traditional.optimization.options.${e}.description`)}}}const oH=[lk("context_engine"),lk("compressor"),lk("verifier"),lk("long_run_control"),lk("mcp_resilience")],imt=[{id:"quality",get displayName(){return Xt("traditional.optimization.groups.quality")},componentIds:["context_engine","verifier"]},{id:"cost",get displayName(){return Xt("traditional.optimization.groups.cost")},componentIds:["compressor"]},{id:"stability",get displayName(){return Xt("traditional.optimization.groups.stability")},componentIds:["long_run_control","mcp_resilience"]}],X1=oH.map(e=>e.id);function rmt(e){return e==="byteplus"?Xt("traditional.optimization.bytePlusUnavailable"):null}const RIe=["context_engine","compressor","verifier","long_run_control"],smt=new Set(["1","true","yes","on"]),lH=[{id:"default",get displayName(){return Xt("traditional.optimization.profiles.default.label")},get description(){return Xt("traditional.optimization.profiles.default.description")},defaultComponents:[],autoAddedComponents:[]},{id:"ops",get displayName(){return Xt("traditional.optimization.profiles.ops.label")},get description(){return Xt("traditional.optimization.profiles.ops.description")},defaultComponents:["context_engine","verifier","long_run_control","mcp_resilience"],autoAddedComponents:["sql_readonly"]}];function kN(e){var t;return((t=oH.find(n=>n.id===e))==null?void 0:t.displayName)??e}function amt(e){var t;return((t=lH.find(n=>n.id===e))==null?void 0:t.displayName)??e}function cH(e){const t=lH.find(n=>n.id===e);return t?[...t.defaultComponents]:[]}function Ay(e,t="default"){const n=new Set(e);return{enabled:n.size>0,profile:t,componentOverrides:Object.fromEntries(X1.map(r=>[r,n.has(r)]))}}function uH(e){if(!e)return;const t=e.profile==="ops"?"ops":"default",n=t==="ops"?cH(t):X1.filter(i=>{var r;return((r=e.componentOverrides)==null?void 0:r[i])===!0});return{...Ay(n,t),...e.catalogVersion?{catalogVersion:e.catalogVersion}:{},...e.planHash?{planHash:e.planHash}:{}}}function s4(e){return smt.has((e==null?void 0:e.trim().toLowerCase())??"")}function omt(e){if(!e)return null;try{const t=JSON.parse(e);return t&&typeof t=="object"&&!Array.isArray(t)?t:null}catch{return null}}function lmt(e){var o;const t=new Map((e==null?void 0:e.map(({key:l,value:c})=>[l,c]))??[]),n=t.get("HARNESS_SIDECAR_ENABLED");if(n===void 0)return null;const i=((o=t.get("HARNESS_PROFILE"))==null?void 0:o.trim())==="ops"?"ops":"default";if(!s4(n))return Ay([],i);const r=omt(t.get("HARNESS_SIDECAR_COMPONENT_OVERRIDES"));if(r){const l={...Ay(X1.filter(c=>r[c]===!0),i),enabled:!0};return i==="ops"?uH(l)??l:l}if(i==="ops")return Ay(cH(i),i);const s=[...s4(t.get("HARNESS_MODEL_PROXY_ENABLED"))?RIe:[],...s4(t.get("HARNESS_MCP_GATEWAY_ENABLED"))?["mcp_resilience"]:[]];return{...Ay(s,i),enabled:!0}}function cmt(e,t){return{...e,modelName:t.modelName||e.modelName,description:t.description,instruction:t.instruction}}function umt(e){var t;return((t=e.harnessSidecar)==null?void 0:t.profile)??"default"}function bI(e){var n;const t=(n=e.harnessSidecar)==null?void 0:n.componentOverrides;return t?X1.filter(i=>t[i]):[]}function dmt(e){const t=new Set(bI(e));return RIe.filter(n=>t.has(n))}function fmt(e,t){const n=i=>({...i,mcpTools:(i.mcpTools??[]).map(r=>{var o,l;const s=!!(r.authTokenEnv&&(t.has(r.authTokenEnv)||r.authToken));return{...r,credentialConfigured:s,...s?{credentialSourceUrl:((o=r.url)==null?void 0:o.trim())??"",credentialSourceAuthTokenEnv:((l=r.authTokenEnv)==null?void 0:l.trim())??""}:{}}}),subAgents:i.subAgents.map(n),...i.workflow?{workflow:{...i.workflow,nodes:i.workflow.nodes.map(r=>({...r,agent:n(r.agent)}))}}:{}});return n(e)}function Y1(e){const t=(e==null?void 0:e.trim())??"",n=t.indexOf("/");return n<=0||n===t.length-1?{modelName:t,modelProvider:""}:{modelName:t.slice(n+1),modelProvider:t.slice(0,n)}}function dH(e){return Y1(e).modelName}function IIe(e,t,n,i=!1){var c,u,d,f;const r=Y1((t==null?void 0:t.model)||(n==null?void 0:n.model)),s=(t==null?void 0:t.children)??[],o=t==null?void 0:t.type,l=e.agentType==="a2a"&&((c=e.a2aRegistry)!=null&&c.enabled)&&o==="llm"?"a2a":o??e.agentType;return{...e,name:((u=t==null?void 0:t.name)==null?void 0:u.trim())||((d=n==null?void 0:n.name)==null?void 0:d.trim())||e.name,description:(t==null?void 0:t.description)??e.description,instruction:i?e.instruction:(t==null?void 0:t.instruction)??e.instruction,agentType:l,modelName:r.modelName||e.modelName,modelProvider:r.modelProvider||e.modelProvider,skills:((f=t==null?void 0:t.skills)==null?void 0:f.map(h=>h.name))??e.skills,subAgents:e.subAgents.map((h,m)=>IIe(h,s[m],void 0,i))}}function hmt(e,t){const n=new Map(t.map(({key:o,value:l})=>[o,l]));if(!["REGISTRY_SPACE_ID","REGISTRY_TOP_K","REGISTRY_REGION","REGISTRY_ENDPOINT"].some(o=>n.has(o)))return e;const r=(o,l)=>n.has(o)?n.get(o)??"":l??"",s=o=>{var l;return{...o,...(l=o.a2aRegistry)!=null&&l.enabled?{a2aRegistry:{...o.a2aRegistry,registrySpaceId:r("REGISTRY_SPACE_ID",o.a2aRegistry.registrySpaceId),registryTopK:r("REGISTRY_TOP_K",o.a2aRegistry.registryTopK),registryRegion:r("REGISTRY_REGION",o.a2aRegistry.registryRegion),registryEndpoint:r("REGISTRY_ENDPOINT",o.a2aRegistry.registryEndpoint)}}:{},subAgents:o.subAgents.map(s)}};return s(e)}function NB(e,t){var c,u,d;const n=e.cloudProvider??t,i=Od(n),r=e.deployment,s=r==null?void 0:r.network,o=e.cloudEnvironment,l=e.a2aRegistry;return{...i,...e,name:e.name??i.name,description:e.description??i.description,instruction:e.instruction??i.instruction,agentType:e.agentType??i.agentType,cloudProvider:n,maxIterations:e.maxIterations??i.maxIterations,a2aUrl:e.a2aUrl??i.a2aUrl,model:e.model??void 0,modelSource:e.modelSource==="ark"||e.modelSource==="custom"?e.modelSource:void 0,modelName:e.modelName??i.modelName,modelProvider:e.modelProvider??i.modelProvider,modelApiBase:e.modelApiBase??i.modelApiBase,memory:{shortTerm:((c=e.memory)==null?void 0:c.shortTerm)??i.memory.shortTerm,longTerm:((u=e.memory)==null?void 0:u.longTerm)??i.memory.longTerm},tools:[...e.tools??[]],skills:[...e.skills??[]],knowledgebase:e.knowledgebase??i.knowledgebase,tracing:e.tracing??i.tracing,harnessSidecar:uH(e.harnessSidecar),subAgents:(e.subAgents??[]).map(f=>NB(f,n)),builtinTools:[...e.builtinTools??[]],customTools:[...e.customTools??[]],mcpTools:[...e.mcpTools??[]],a2aRegistry:{...i.a2aRegistry,...l??{},enabled:(l==null?void 0:l.enabled)??!1,registrySpaceId:(l==null?void 0:l.registrySpaceId)??"",registryTopK:(l==null?void 0:l.registryTopK)??"",registryRegion:(l==null?void 0:l.registryRegion)??"",registryEndpoint:(l==null?void 0:l.registryEndpoint)??""},shortTermBackend:e.shortTermBackend??i.shortTermBackend,longTermBackend:e.longTermBackend??i.longTermBackend,longTermMemoryIndex:e.longTermMemoryIndex??i.longTermMemoryIndex,autoSaveSession:e.autoSaveSession??i.autoSaveSession,knowledgebaseBackend:e.knowledgebaseBackend??i.knowledgebaseBackend,knowledgebaseIndex:e.knowledgebaseIndex??i.knowledgebaseIndex,tracingExporters:[...e.tracingExporters??[]],selectedSkills:[...e.selectedSkills??[]],cloudEnvironment:{...i.cloudEnvironment,...o??{},cliTools:[...(o==null?void 0:o.cliTools)??[]],dockerfile:typeof(o==null?void 0:o.dockerfile)=="string"?o.dockerfile:void 0},deployment:{...i.deployment,...r??{},feishuEnabled:(r==null?void 0:r.feishuEnabled)??!1,runtimeName:(r==null?void 0:r.runtimeName)??void 0,runtimeNameCustomized:(r==null?void 0:r.runtimeNameCustomized)??((d=i.deployment)==null?void 0:d.runtimeNameCustomized),network:s?{...s,vpcId:s.vpcId??"",subnetIds:s.subnetIds??"",enableSharedInternetAccess:s.enableSharedInternetAccess??!1}:void 0,modelApiKeyId:(r==null?void 0:r.modelApiKeyId)??"",modelApiKeyName:(r==null?void 0:r.modelApiKeyName)??"",envValues:(r==null?void 0:r.envValues)??void 0},...e.workflow?{workflow:{...e.workflow,nodes:e.workflow.nodes.map(f=>({...f,agent:NB(f.agent,n)}))}}:{}}}const pmt=["动态子智能体协作规则:","Dynamic sub-agent collaboration rules:"],mmt=["collect_resources","create_agents","handoff_to"];function gmt(e){return e.replace(/\\([\\`*_[\]{}()<>#+\-.!|])/g,"$1")}function bmt(e){const t=pmt.flatMap(i=>{const r=[];let s=0;for(;si-r),n=t.find((i,r)=>{const s=t[r+1]??e.length,o=gmt(e.slice(i,s));return mmt.every(l=>o.includes(l))});return n===void 0?e:e.slice(0,n).trimEnd()}function ymt(e){const t=n=>({...n,instruction:n.dynamicAgentDelegation===!0?bmt(n.instruction):n.instruction,subAgents:n.subAgents.map(t),...n.workflow?{workflow:{...n.workflow,nodes:n.workflow.nodes.map(i=>({...i,agent:t(i.agent)}))}}:{}});return t(e)}function PIe(e,t){var l,c;const n=Od(t),i=[...e.tools??[]],r=JA.filter(u=>u.toolNames.some(d=>i.includes(d))),s=new Set(r.flatMap(u=>u.toolNames)),o=Y1(e.model);return{...n,modelSource:void 0,name:((l=e.name)==null?void 0:l.trim())??"",description:e.description??"",instruction:e.instruction||n.instruction,agentType:e.type??"llm",modelName:o.modelName,modelProvider:o.modelProvider,tools:i.filter(u=>!s.has(u)),builtinTools:r.map(u=>u.id),skills:((c=e.skills)==null?void 0:c.map(u=>u.name))??[],subAgents:(e.children??[]).map(u=>PIe(u,t))}}function fH(e,t,n=[]){var l,c,u,d;const i=((l=e.draft)==null?void 0:l.cloudProvider)??t,r=Y1(e.model),s=e.draft?NB(e.draft,i):e.graph?PIe(e.graph,i):{...Od(i),modelSource:void 0,name:((c=e.name)==null?void 0:c.trim())||e.appName.trim(),description:e.description??"",instruction:e.instruction||Od(i).instruction,agentType:e.type??"llm",modelName:r.modelName,modelProvider:r.modelProvider,tools:[...e.tools??[]],skills:((u=e.skills)==null?void 0:u.map(f=>f.name))??[]},o=e.draft&&s.dynamicAgentDelegation===!0?ymt(s):s;return fmt(IIe(o,e.graph,{name:((d=e.name)==null?void 0:d.trim())||e.appName.trim(),model:e.model},!!e.draft),new Set(n))}function vmt(e,t){const n=i=>{var s;const r=((s=i.modelName)==null?void 0:s.trim())??"";return{...i,modelSource:i.agentType==="llm"||!i.agentType?t.has(r)?"ark":"custom":i.modelSource,subAgents:i.subAgents.map(n),...i.workflow?{workflow:{...i.workflow,nodes:i.workflow.nodes.map(o=>({...o,agent:n(o.agent)}))}}:{}}};return n(e)}const yI=[{id:"ubuntu-22.04",label:"Ubuntu 22.04",image:"ubuntu:22.04"},{id:"ubuntu-24.04",label:"Ubuntu 24.04",image:"ubuntu:24.04"}],DIe=[{id:"aio-sandbox",label:"AIO Sandbox",description:"内置 Sandbox Shell 能力 · Ubuntu 22.04"},{id:"codex-sandbox",label:"Codex Sandbox",description:"内置 Codex CLI、浏览器与代码执行环境"},{id:"ubuntu",label:"Ubuntu",description:"标准 Linux 基础镜像"}],hH="agentkit-cli-2107625663-cn-beijing.cr.volces.com/agentkit/agent-native-requirements-aio:0.2.1-20260831",MIe={volcengine:"enterprise-public-cn-beijing.cr.volces.com/vefaas-public/codexenv:1.1.0",byteplus:"enterprise-public-ap-southeast-1.cr.volces.com/vefaas-public/codexenv:1.1.0"},LIe=[{id:"python-3.10",label:"Python 3.10"},{id:"python-3.12",label:"Python 3.12"}],xmt={"python-3.10":"3.10.18","python-3.12":"3.12.11"},pH=[{id:"tools",label:"工具",description:"常用 CLI 与内容处理工具",options:[{id:"lark-cli",label:"lark-cli",description:"飞书开放平台命令行工具",installer:"pip",packageName:"lark-cli"},{id:"pandoc",label:"pandoc",description:"文档格式转换工具",installer:"apt",packageName:"pandoc"},{id:"opencli",label:"opencli",description:"将网站与桌面应用转换为命令行工具",installer:"npm",packageName:"@jackwener/opencli@1.8.7"}]},{id:"productivity",label:"效率",description:"加速依赖安装、检索和协作",options:[{id:"uv",label:"uv",description:"快速 Python 包与项目管理器",installer:"pip",packageName:"uv"},{id:"ripgrep",label:"ripgrep",description:"高性能文本检索工具",installer:"apt",packageName:"ripgrep"},{id:"jq",label:"jq",description:"JSON 查询与转换工具",installer:"apt",packageName:"jq"},{id:"github-cli",label:"GitHub CLI",description:"在终端中管理 GitHub 工作流",installer:"apt",packageName:"gh"}]},{id:"browser",label:"浏览器自动化",description:"网页操作、测试与内容采集",options:[{id:"playwright",label:"Playwright",description:"浏览器自动化与端到端测试",installer:"pip",packageName:"playwright"},{id:"chromium",label:"Chromium",description:"无头浏览器运行时",installer:"apt",packageName:"chromium"}]},{id:"system",label:"系统与媒体",description:"基础开发、网络和媒体处理能力",options:[{id:"git",label:"Git",description:"代码版本管理",installer:"apt",packageName:"git"},{id:"curl",label:"curl",description:"网络请求与文件下载",installer:"apt",packageName:"curl"},{id:"ffmpeg",label:"FFmpeg",description:"音视频转码与处理",installer:"apt",packageName:"ffmpeg"},{id:"imagemagick",label:"ImageMagick",description:"图片转换与批处理",installer:"apt",packageName:"imagemagick"}]}],wmt=pH.flatMap(e=>e.options),Omt=["build-essential","curl","libbz2-dev","libffi-dev","libgdbm-dev","liblzma-dev","libncursesw5-dev","libreadline-dev","libsqlite3-dev","libssl-dev","tk-dev","uuid-dev","zlib1g-dev"],kmt=["xvfb","fonts-noto-color-emoji","fonts-unifont","libfontconfig1","libfreetype6","xfonts-cyrillic","xfonts-scalable","fonts-liberation","fonts-ipafont-gothic","fonts-wqy-zenhei","fonts-tlwg-loma-otf","fonts-freefont-ttf"],Smt={"ubuntu-22.04":["libasound2","libatk-bridge2.0-0","libatk1.0-0","libatspi2.0-0","libcairo2","libcups2","libdbus-1-3","libdrm2","libgbm1","libglib2.0-0","libnspr4","libnss3","libpango-1.0-0","libwayland-client0","libx11-6","libxcb1","libxcomposite1","libxdamage1","libxext6","libxfixes3","libxkbcommon0","libxrandr2"],"ubuntu-24.04":["libasound2t64","libatk-bridge2.0-0t64","libatk1.0-0t64","libatspi2.0-0t64","libcairo2","libcups2t64","libdbus-1-3","libdrm2","libgbm1","libglib2.0-0t64","libnspr4","libnss3","libpango-1.0-0","libx11-6","libxcb1","libxcomposite1","libxdamage1","libxext6","libxfixes3","libxkbcommon0","libxrandr2"]};function ck(e,t){for(const n of t)e.includes(n)||e.push(n)}function Emt(e,t,n,i,r){const s=["ca-certificates"];r||ck(s,i?[`python${n}`,`python${n}-venv`]:Omt);for(const o of t)o.id==="playwright"||o.id==="chromium"||(o.installer==="apt"&&ck(s,[o.packageName]),o.id==="opencli"&&ck(s,["curl","xz-utils"]));return e.optionIds.some(o=>o==="playwright"||o==="chromium")&&(ck(s,kmt),ck(s,Smt[e.operatingSystem])),s}const a4={name:"",description:"",baseEnvironment:"aio-sandbox",operatingSystem:"ubuntu-22.04",language:"python-3.12",optionIds:[],selectedSkills:[]};function Fp(e){var t;return((t=LIe.find(n=>n.id===e))==null?void 0:t.label)??e}function RB(e){var t;return((t=yI.find(n=>n.id===e))==null?void 0:t.label)??e}function IB(e){var t;return((t=DIe.find(n=>n.id===e))==null?void 0:t.label)??e}function Cmt(e){var n;const t=((n=e.match(/^\s*FROM\s+(.+)$/im))==null?void 0:n[1])??"";return{baseEnvironment:/\/codexenv:/i.test(t)?"codex-sandbox":/aio\.sandbox/i.test(e)?"aio-sandbox":"ubuntu",operatingSystem:/ubuntu:24\.04/i.test(t)?"ubuntu-24.04":"ubuntu-22.04"}}function mH(e,t="volcengine"){const n=wmt.filter(b=>e.optionIds.includes(b.id)),i=e.baseEnvironment==="aio-sandbox",r=e.baseEnvironment==="codex-sandbox",s=i||r,o=s?"python-3.12":e.language,l=o.replace("python-",""),c=xmt[o],u=yI.find(b=>b.id===e.operatingSystem)??yI[0],d=e.operatingSystem==="ubuntu-22.04"&&l==="3.10"||e.operatingSystem==="ubuntu-24.04"&&l==="3.12",f=Emt(e,n,l,d,s),h=i?[`ARG AIO_BASE_IMAGE=${hH}`,"ARG AIO_BASE_PLATFORM=linux/amd64","",`# Base environment: AIO Sandbox (${u.label})`,"FROM --platform=${AIO_BASE_PLATFORM} ${AIO_BASE_IMAGE}"]:r?[`ARG CODEX_BASE_IMAGE=${MIe[t]}`,"ARG CODEX_BASE_PLATFORM=linux/amd64","","# Base environment: Codex Sandbox","FROM --platform=${CODEX_BASE_PLATFORM} ${CODEX_BASE_IMAGE}"]:[`# Operating system: ${u.label}`,`FROM ${u.image}`];h.push("","ARG DEBIAN_FRONTEND=noninteractive","ARG APT_MIRROR_URL=http://archive.ubuntu.com/ubuntu","ARG PIP_INDEX_URL=https://pypi.org/simple","ARG PYTHON_SOURCE_BASE_URL=https://www.python.org/ftp/python","ARG PLAYWRIGHT_DOWNLOAD_HOST=https://cdn.playwright.dev","ARG PIP_DEFAULT_TIMEOUT=300","ARG PIP_RETRIES=10","","# Install all system dependencies in one transaction from the provider-local mirror.","RUN set -eux; \\",' mirror="${APT_MIRROR_URL%/}"; \\'," for source_file in /etc/apt/sources.list /etc/apt/sources.list.d/*.sources; do \\",' [ -f "$source_file" ] || continue; \\',' sed -i -E "s#https?://(archive|security).ubuntu.com/ubuntu/?#${mirror}#g" "$source_file"; \\'," done; \\",` printf 'Acquire::Retries "5";\\nAcquire::ForceIPv4 "true";\\nAcquire::http::Timeout "60";\\nAcquire::https::Timeout "60";\\n' > /etc/apt/apt.conf.d/80-veadk-network; \\`," apt-get update; \\"," apt-get install -y --no-install-recommends \\",...f.map(b=>" "+b+" \\")," ; rm -rf /var/lib/apt/lists/*","","ENV PYTHONDONTWRITEBYTECODE=1 \\"," PYTHONUNBUFFERED=1 \\"," PIP_NO_CACHE_DIR=1","",`# Python ${l}`),i?h.push("# Keep Studio dependencies isolated from AIO's system interpreter.","RUN /opt/python3.12/bin/python -m venv /opt/veadk-environment/.venv","","ENV VIRTUAL_ENV=/opt/veadk-environment/.venv \\"," BASH_VENV_PATH=/opt/veadk-environment/.venv \\",' PATH="/opt/veadk-environment/.venv/bin:$PATH"'):r?h.push("# Keep Studio dependencies isolated from the Codex runtime.","RUN python3 -m venv /opt/veadk-environment/.venv","","ENV VIRTUAL_ENV=/opt/veadk-environment/.venv \\",' PATH="/opt/veadk-environment/.venv/bin:$PATH"'):d?h.push(`RUN python${l} -m venv /opt/venv`):h.push(`RUN curl --retry 5 --retry-all-errors --connect-timeout 30 -fsSL "\${PYTHON_SOURCE_BASE_URL}/${c}/Python-${c}.tgz" -o /tmp/python.tgz \\`," && mkdir -p /tmp/python-source \\"," && tar -xzf /tmp/python.tgz --strip-components=1 -C /tmp/python-source \\"," && cd /tmp/python-source \\"," && ./configure --prefix=/opt/python --with-ensurepip=install \\",' && make -j"$(nproc)" \\'," && make install \\",` && /opt/python/bin/python${l} -m venv /opt/venv \\`," && rm -rf /tmp/python-source /tmp/python.tgz"),s||h.push("",'ENV PATH="/opt/venv/bin:$PATH"');const m=new Set(e.optionIds);(m.has("playwright")||m.has("chromium"))&&h.push("","ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright \\"," PLAYWRIGHT_DOWNLOAD_CONNECTION_TIMEOUT=300000"),h.push("","WORKDIR /workspace","","# VeADK","RUN python -m pip install --upgrade veadk-python");let g=!1;for(const b of n)h.push("",`# ${b.label}`),b.id==="opencli"?h.push('RUN node_arch="$(dpkg --print-architecture)" \\',' && case "$node_arch" in amd64) node_arch=x64 ;; arm64) node_arch=arm64 ;; *) echo "Unsupported architecture: $node_arch" >&2; exit 1 ;; esac \\',' && curl --retry 5 --connect-timeout 30 -fsSL "https://nodejs.org/dist/v22.18.0/node-v22.18.0-linux-${node_arch}.tar.xz" -o /tmp/node.tar.xz \\'," && tar -xJf /tmp/node.tar.xz -C /usr/local --strip-components=1 \\",` && npm install --global ${b.packageName} \\`," && npm cache clean --force \\"," && rm -f /tmp/node.tar.xz"):b.id==="playwright"||b.id==="chromium"?g||(h.push("RUN python -m pip install --upgrade playwright"),h.push("RUN python -m playwright install chromium"),g=!0):b.installer!=="apt"&&h.push(`RUN python -m pip install --upgrade ${b.packageName}`);return i?h.push("","# Keep AIO's inherited /opt/gem/run.sh startup chain and shell API.","EXPOSE 8080"):r||h.push("",'CMD ["/bin/bash"]'),h.join(` -`)}function Amt(){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m7 7 10 10M17 7 7 17",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function Tmt(){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[a.jsx("circle",{cx:"10.8",cy:"10.8",r:"5.8",stroke:"currentColor",strokeWidth:"1.7"}),a.jsx("path",{d:"m15.2 15.2 4 4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function PB(){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[a.jsx("path",{d:"M5 7.25A2.25 2.25 0 0 1 7.25 5h9.5A2.25 2.25 0 0 1 19 7.25v9.5A2.25 2.25 0 0 1 16.75 19h-9.5A2.25 2.25 0 0 1 5 16.75v-9.5Z",stroke:"currentColor",strokeWidth:"1.6"}),a.jsx("path",{d:"M8.5 9.25 11 12l-2.5 2.75M12.75 14.75h2.75",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]})}function $Ie(){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[a.jsx("path",{d:"M4.75 7.25A2.25 2.25 0 0 1 7 5h3l1.5 2h5.5a2.25 2.25 0 0 1 2.25 2.25v7.5A2.25 2.25 0 0 1 17 19H7a2.25 2.25 0 0 1-2.25-2.25v-9.5Z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),a.jsx("path",{d:"M8 11.25h8M8 14.75h5.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}function _mt(){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M12 6.5v11M6.5 12h11",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function Nee(){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m7 7 10 10M17 7 7 17",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function Ree(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m3.5 8.25 2.75 2.75 6.25-6.25",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}function Cc(e){return`${e.environment_id}\0${e.environment_version_id}`}function eE(e){return e.latestVersion?{environment_id:e.id,environment_version_id:e.latestVersion.versionId}:null}function SN(e,t){return e.environmentIds.flatMap(n=>{const i=t.get(n),r=i?eE(i):null;return r?[r]:[]})}function jmt({environments:e,workspaces:t,value:n,selectedWorkspaceIds:i,loading:r,error:s,onConfirm:o,onClose:l}){const{t:c}=Te("workspaceTools"),[u,d]=p.useState(""),[f,h]=p.useState(!1),[m,g]=p.useState(""),b=p.useId(),v=p.useMemo(()=>new Map(e.map(A=>[A.id,A])),[e]),[y,w]=p.useState(()=>new Set(i)),[x,O]=p.useState(()=>{const A=new Set(t.filter(N=>i.includes(N.id)).flatMap(N=>N.environmentIds));return new Set(n.filter(N=>!A.has(N.environment_id)).map(Cc))}),k=p.useMemo(()=>new Set(t.filter(A=>y.has(A.id)).flatMap(A=>A.environmentIds)),[y,t]),S=p.useMemo(()=>{const A=new Set(x);for(const N of t)if(y.has(N.id))for(const P of SN(N,v))A.add(Cc(P));return A},[x,y,v,t]),C=p.useMemo(()=>{const A=u.trim().toLocaleLowerCase();return A?e.filter(N=>`${N.name} ${N.description} ${Fp(N.language)}`.toLocaleLowerCase().includes(A)):e},[e,u]),E=p.useMemo(()=>{const A=u.trim().toLocaleLowerCase();return A?t.filter(N=>{const P=N.environmentIds.map(I=>{var D;return((D=v.get(I))==null?void 0:D.name)??""}).join(" ");return`${N.name} ${N.description} ${P}`.toLocaleLowerCase().includes(A)}):t},[v,u,t]);p.useEffect(()=>{const A=document.body.style.overflow,N=P=>{P.key==="Escape"&&!f&&l()};return document.body.style.overflow="hidden",document.addEventListener("keydown",N),()=>{document.body.style.overflow=A,document.removeEventListener("keydown",N)}},[l,f]);const j=A=>{const N=eE(A);if(!N)return;const P=Cc(N);k.has(A.id)||O(I=>{const D=new Set(I);return D.has(P)?D.delete(P):D.add(P),D})},T=A=>{const N=SN(A,v);N.length!==0&&(w(P=>{const I=new Set(P);return I.has(A.id)?I.delete(A.id):I.add(A.id),I}),O(P=>{const I=new Set(P);for(const D of N)I.delete(Cc(D));return I}))},R=async()=>{const A=new Map(n.map(P=>[Cc(P),P])),N=e.flatMap(P=>{const I=eE(P);if(!I||!S.has(Cc(I)))return[];const D=A.get(Cc(I));return[{...I,mount_instance_id:(D==null?void 0:D.mount_instance_id)||crypto.randomUUID()}]});h(!0),g("");try{await o(N,[...y]),l()}catch(P){g(P instanceof Error?P.message:c("sessionEnvironment.mountFailed"))}finally{h(!1)}};return vi.createPortal(a.jsxs("div",{className:"studio-tool-dialog-layer",children:[a.jsx("button",{type:"button",className:"studio-tool-dialog-scrim","aria-label":c("sessionEnvironment.closeDialog"),disabled:f,onClick:l}),a.jsxs("section",{className:"studio-tool-dialog session-environment-dialog",role:"dialog","aria-modal":"true","aria-labelledby":b,children:[a.jsxs("header",{className:"studio-tool-dialog-head",children:[a.jsx("span",{className:"studio-tool-dialog-mark",children:a.jsx(PB,{})}),a.jsxs("div",{children:[a.jsx("h2",{id:b,children:c("sessionEnvironment.addTitle")}),a.jsx("p",{children:c("sessionEnvironment.description")})]}),a.jsx("button",{type:"button",className:"studio-tool-dialog-close","aria-label":c("sessionEnvironment.closeAdd"),disabled:f,onClick:l,children:a.jsx(Amt,{})})]}),a.jsxs("div",{className:"studio-tool-dialog-body",children:[a.jsxs("label",{className:"studio-tool-search",children:[a.jsx(Tmt,{}),a.jsx("input",{value:u,"aria-label":c("sessionEnvironment.searchAria"),placeholder:c("sessionEnvironment.searchPlaceholder"),autoFocus:!0,onChange:A=>d(A.target.value)})]}),a.jsx("div",{className:"studio-tool-picker session-environment-picker",role:"group","aria-label":c("sessionEnvironment.availableAria"),children:r?a.jsx("div",{className:"studio-tool-empty",children:c("sessionEnvironment.loading")}):s?a.jsx("div",{className:"studio-tool-empty",children:s}):C.length===0&&E.length===0?a.jsx("div",{className:"studio-tool-empty",children:c("sessionEnvironment.noMatch")}):a.jsxs(a.Fragment,{children:[E.length>0&&a.jsxs("section",{className:"session-environment-picker__group","aria-labelledby":`${b}-workspaces`,children:[a.jsx("h3",{id:`${b}-workspaces`,children:c("sessionEnvironment.workspaces")}),E.map(A=>{const N=SN(A,v),P=y.has(A.id),I=N.length===0;return a.jsxs("label",{className:`studio-tool-option session-environment-option is-workspace${P?" is-selected":""}${I?" is-disabled":""}`,children:[a.jsx("span",{className:"studio-tool-option-icon",children:a.jsx($Ie,{})}),a.jsxs("span",{className:"studio-tool-option-copy",children:[a.jsx("strong",{children:A.name}),a.jsx("span",{children:A.description||c("sessionEnvironment.reuseAll")}),a.jsx("small",{children:c("sessionEnvironment.availableEnvironmentCount",{count:N.length})})]}),a.jsx("input",{type:"checkbox",checked:P,disabled:I,"aria-label":c("sessionEnvironment.selectWorkspace",{name:A.name}),onChange:()=>T(A)}),a.jsx("span",{className:"session-environment-check","aria-hidden":"true",children:a.jsx(Ree,{})})]},A.id)})]}),C.length>0&&a.jsxs("section",{className:"session-environment-picker__group","aria-labelledby":`${b}-environments`,children:[a.jsx("h3",{id:`${b}-environments`,children:c("sessionEnvironment.environments")}),C.map(A=>{const N=eE(A);if(!N)return null;const P=t.filter(_=>y.has(_.id)&&_.environmentIds.includes(A.id)),I=P.length>0,D=S.has(Cc(N));return a.jsxs("label",{className:`studio-tool-option session-environment-option${D?" is-selected":""}${I?" is-covered":""}`,children:[a.jsx("span",{className:"studio-tool-option-icon",children:a.jsx(PB,{})}),a.jsxs("span",{className:"studio-tool-option-copy",children:[a.jsx("strong",{children:A.name}),a.jsx("span",{children:I?c("sessionEnvironment.includedByWorkspaces",{names:P.map(_=>_.name).join(c("sessionEnvironment.nameSeparator"))}):A.description||Fp(A.language)}),a.jsxs("small",{children:[Fp(A.language)," · ",N.environment_version_id]})]}),a.jsx("input",{type:"checkbox",checked:D,disabled:I,"aria-label":c("sessionEnvironment.selectEnvironment",{name:A.name}),onChange:()=>j(A)}),a.jsx("span",{className:"session-environment-check","aria-hidden":"true",children:a.jsx(Ree,{})})]},Cc(N))})]})]})})]}),a.jsxs("footer",{className:"session-environment-dialog__footer",children:[a.jsx("span",{className:m?"is-error":"",role:m?"alert":void 0,children:m||c("sessionEnvironment.selectionSummary",{workspaces:c("sessionEnvironment.selectedWorkspaceCount",{count:y.size}),environments:c("sessionEnvironment.coveredEnvironmentCount",{count:S.size})})}),a.jsxs("div",{children:[a.jsx("button",{type:"button",disabled:f,onClick:l,children:c("sessionEnvironment.cancel")}),a.jsx("button",{type:"button",className:"is-primary",disabled:r||f||!!s,onClick:()=>void R(),children:c(f?"sessionEnvironment.mounting":"sessionEnvironment.confirm")})]})]})]})]}),document.body)}function Nmt({environments:e,workspaces:t,value:n,selectedWorkspaceIds:i,loading:r,disabled:s=!1,error:o="",onChange:l,onRefresh:c}){const{t:u}=Te("workspaceTools"),[d,f]=p.useState(!1),[h,m]=p.useState(!1),[g,b]=p.useState(""),v=p.useRef(null),y=p.useMemo(()=>new Map(e.flatMap(E=>{const j=eE(E);return j?[[Cc(j),E]]:[]})),[e]),w=p.useMemo(()=>new Map(e.map(E=>[E.id,E])),[e]),x=t.filter(E=>i.includes(E.id)),O=new Set(x.flatMap(E=>E.environmentIds)),k=n.filter(E=>!O.has(E.environment_id)),S=()=>{f(!1),requestAnimationFrame(()=>{var E;return(E=v.current)==null?void 0:E.focus()})},C=async(E,j)=>{if(l){m(!0),b("");try{await l(E,j)}catch(T){b(T instanceof Error?T.message:u("sessionEnvironment.mountFailed"))}finally{m(!1)}}};return a.jsxs("div",{className:"session-environment-select",children:[n.length>0&&a.jsxs("div",{className:"session-environment-list",role:"list","aria-label":u("sessionEnvironment.mountedAria"),children:[x.map(E=>{const j=new Set(SN(E,w).map(T=>T.environment_id));return a.jsxs("div",{className:"session-environment-item is-workspace",role:"listitem",children:[a.jsx("span",{className:"session-environment-item__icon",children:a.jsx($Ie,{})}),a.jsxs("span",{className:"session-environment-item__copy",children:[a.jsx("strong",{children:E.name}),a.jsx("small",{children:u("sessionEnvironment.environmentCount",{count:j.size})})]}),l&&a.jsx("button",{type:"button",className:"topo-remove-capability","aria-label":u("sessionEnvironment.removeWorkspace",{name:E.name}),title:u("sessionEnvironment.remove"),disabled:s||h,onClick:()=>{const T=i.filter(A=>A!==E.id),R=new Set(t.filter(A=>T.includes(A.id)).flatMap(A=>A.environmentIds));C(n.filter(A=>!j.has(A.environment_id)||R.has(A.environment_id)),T)},children:a.jsx(Nee,{})})]},`workspace:${E.id}`)}),k.map(E=>{const j=y.get(Cc(E));return a.jsxs("div",{className:"session-environment-item",role:"listitem",children:[a.jsx("span",{className:"session-environment-item__icon",children:a.jsx(PB,{})}),a.jsxs("span",{className:"session-environment-item__copy",children:[a.jsx("strong",{children:(j==null?void 0:j.name)??E.environment_id}),a.jsx("small",{children:j?Fp(j.language):E.environment_version_id})]}),l&&a.jsx("button",{type:"button",className:"topo-remove-capability","aria-label":u("sessionEnvironment.removeEnvironment",{name:(j==null?void 0:j.name)??E.environment_id}),title:u("sessionEnvironment.remove"),disabled:s||h,onClick:()=>void C(n.filter(T=>Cc(T)!==Cc(E)),[...i]),children:a.jsx(Nee,{})})]},Cc(E))})]}),l&&a.jsxs("button",{ref:v,type:"button",className:"topo-capability-add-slot","aria-label":u("sessionEnvironment.add"),disabled:s||r||h,onClick:()=>{b(""),f(!0),c==null||c()},children:[a.jsx(_mt,{}),a.jsx("span",{children:n.length>0?u("sessionEnvironment.addMore"):u("sessionEnvironment.addForSession")})]}),g&&a.jsx("p",{className:"is-error",role:"alert",children:g}),(r||o||e.length===0)&&a.jsx("p",{className:o?"is-error":void 0,role:o?"alert":void 0,children:r?u("sessionEnvironment.loadingAvailable"):o||u("sessionEnvironment.empty")}),d&&a.jsx(jmt,{environments:e,workspaces:t,value:n,selectedWorkspaceIds:i,loading:r,error:o,onConfirm:(E,j)=>l==null?void 0:l(E,j),onClose:S})]})}function Rmt(e){return[...new Map(e.filter(t=>t.name.trim()).map(t=>[t.name.trim(),{...t,name:t.name.trim()}])).values()]}function o4({title:e,count:t}){const{t:n}=Te("workspaceTools");return a.jsxs("div",{className:"topo-module-title",children:[a.jsx("span",{className:"topo-module-label",title:e,children:e}),t!==void 0&&a.jsx("span",{className:"topo-section-count","aria-label":n("agentTopology.itemCount",{count:t}),children:t})]})}function Imt({info:e,loading:t,boundSkills:n,onRefresh:i,onOpenSkill:r,variant:s="rail",selectedSessionSkills:o=[],onSessionSkillsChange:l,environments:c=[],workspaces:u=[],selectedEnvironments:d=[],selectedEnvironmentWorkspaceIds:f=[],environmentsLoading:h=!1,environmentsDisabled:m=!1,environmentsError:g="",onEnvironmentsChange:b,onEnvironmentsRefresh:v}){var R,A,N,P,I;const{t:y}=Te("workspaceTools"),[w,x]=p.useState(null);if(t&&!e)return a.jsx("aside",{className:`topo is-loading${s==="drawer"?" is-drawer":""}`,"aria-label":y("agentTopology.info"),"aria-live":"polite",children:a.jsx(hn,{as:"span",className:"topo-loading-label",duration:2.2,children:y("agentTopology.loadingInfo")})});if(!e)return null;const O=dH(e.model),k=e.agentCategory==="mpa",S=((R=e.mpa)==null?void 0:R.agentsMdStatus)??"unsupported",C=k?((A=e.mpa)==null?void 0:A.agentsMd)??"":((N=e.graph)==null?void 0:N.instruction)??((P=e.draft)==null?void 0:P.instruction)??"",E=k?(n==null?void 0:n.skills)??[]:Rmt([...e.skills,...o.map(D=>({name:D.name,description:D.description??""}))]),j=n==null?void 0:n.error,T=j==="forbidden"?"accessDenied":j==="unsupported"?"skillsUnsupported":j==="degraded"?"skillsDegraded":"loadFailed";return a.jsx(a.Fragment,{children:a.jsxs("aside",{className:`topo${s==="drawer"?" is-drawer":""}`,"aria-label":y("agentTopology.infoAndTopology"),children:[a.jsxs("section",{className:"topo-agent-card","aria-label":y("agentTopology.info"),children:[a.jsxs("div",{className:"topo-agent-heading",children:[a.jsx("h2",{title:e.name,children:e.name||y("agentTopology.unnamedAgent")}),O&&a.jsx("span",{title:O,children:O})]}),e.description&&a.jsx("p",{className:"topo-description",title:e.description,children:e.description}),i&&a.jsx("button",{type:"button",className:"topo-refresh",onClick:i,disabled:t||(n==null?void 0:n.loading),children:y("agentTopology.refresh")})]}),a.jsxs("div",{className:"topo-module-stack",children:[a.jsxs("section",{className:"topo-module-card topo-agents-md-card","aria-label":y("agentTopology.agentsMd"),children:[a.jsx(o4,{title:y("agentTopology.agentsMd")}),a.jsx("div",{className:"topo-module-scroll topo-agents-md-scroll",role:"region","aria-label":y("agentTopology.agentsMd"),tabIndex:0,children:k&&S!=="ready"?a.jsx("div",{className:"topo-data-error",role:"status",children:y(`agentTopology.${S==="forbidden"?"accessDenied":S==="unsupported"?"documentUnsupported":"loadFailed"}`)}):C.trim()?a.jsx("pre",{className:"topo-agents-md-content",children:C}):a.jsx("div",{className:"topo-empty",children:y("agentTopology.notConfigured")})})]}),a.jsxs("section",{className:"topo-module-card topo-skills-card","aria-label":y("agentTopology.skills"),children:[a.jsx(o4,{title:y("agentTopology.skills"),count:k?n!=null&&n.complete?E.length:void 0:e.skillsPreviewSupported?E.length:void 0}),a.jsxs("div",{className:"topo-module-scroll topo-skills-scroll",role:"region","aria-label":y("agentTopology.skillList"),tabIndex:0,children:[k&&(n!=null&&n.loading)&&!E.length?a.jsx(hn,{as:"span",children:y("agentTopology.loadingSkills")}):!k&&!e.skillsPreviewSupported?a.jsx("div",{className:"topo-empty",children:y("agentTopology.previewUnsupported")}):E.length>0?a.jsx("div",{className:"topo-skill-list",children:E.map((D,_)=>{var L;return a.jsxs("div",{className:"topo-skill",title:D.description||D.name,children:[a.jsx("div",{className:"topo-skill-title",children:k&&r&&((L=n==null?void 0:n.skills[_])!=null&&L.skillId)&&!n.skills[_].lookupByName?a.jsx("button",{type:"button",className:"topo-skill-name topo-skill-open",onClick:()=>r(_),children:D.name}):a.jsx("span",{className:"topo-skill-name",children:D.name})}),D.description&&a.jsx("span",{className:"topo-skill-description",children:D.description})]},`${D.name}:${D.description}:${_}`)})}):j?null:a.jsx("div",{className:"topo-empty",children:y(k?(I=e.mpa)!=null&&I.skillSpaces.length?"agentTopology.noBoundSkills":"agentTopology.noBoundSpace":"agentTopology.notConfigured")}),j&&a.jsx("div",{className:"topo-data-error",role:"status",children:y(`agentTopology.${T}`)}),k&&(n==null?void 0:n.loading)&&E.length>0&&a.jsx("span",{role:"status",children:y("agentTopology.loadingSkills")})]}),!k&&l&&a.jsx("div",{className:"topo-capability-add-dock",children:a.jsxs("button",{type:"button",className:"topo-capability-add-slot","aria-label":y("agentTopology.addSkill"),disabled:m,onClick:()=>x("skill"),children:[a.jsx("span",{"aria-hidden":"true",children:"+"}),a.jsx("span",{children:y("agentTopology.addSkillHere")})]})})]}),(b||d.length>0)&&a.jsxs("section",{className:"topo-module-card topo-environment-card","aria-label":y("agentTopology.sessionEnvironment"),children:[a.jsx(o4,{title:y("agentTopology.environment"),count:d.length}),a.jsx(Nmt,{environments:c,workspaces:u,value:d,selectedWorkspaceIds:f,loading:h,disabled:m,error:g,onChange:b,onRefresh:v})]})]}),w==="skill"&&l&&vi.createPortal(a.jsxs("div",{className:"studio-tool-dialog-layer",children:[a.jsx("button",{type:"button",className:"studio-tool-dialog-scrim","aria-label":y("agentTopology.close"),onClick:()=>x(null)}),a.jsxs("section",{className:"studio-tool-dialog",role:"dialog","aria-modal":"true",children:[a.jsxs("header",{className:"studio-tool-dialog-head is-iconless",children:[a.jsxs("div",{children:[a.jsx("h2",{children:y("agentTopology.addSkill")}),a.jsx("p",{children:y("agentTopology.skillMountNextTurn")})]}),a.jsx("button",{type:"button",className:"studio-tool-dialog-close","aria-label":y("agentTopology.close"),onClick:()=>x(null),children:a.jsx(Mo,{"aria-hidden":"true"})})]}),a.jsx("div",{className:"studio-tool-dialog-body",children:a.jsx(AIe,{selected:[...o],onChange:l})})]})]}),document.body)]})})}function Pmt(e){var i;if(((i=e.info)==null?void 0:i.agentCategory)!=="mpa")return null;const t=e.info.mpa,n=JSON.stringify([t==null?void 0:t.skillSpacesStatus,t==null?void 0:t.skillSpaces]);return a.jsx(Dmt,{...e,info:e.info},n)}function Dmt(e){const[t,n]=p.useState(null),[i,r]=p.useState(0),[s,o]=p.useState({skills:[],loading:!0,complete:!1}),l=e.info.mpa;return p.useEffect(()=>{const c=new AbortController;if((l==null?void 0:l.skillSpacesStatus)!=="ready")return o({skills:[],loading:!1,complete:!1,error:(l==null?void 0:l.skillSpacesStatus)??"unsupported"}),()=>c.abort();o(d=>({...d,loading:!0,error:void 0}));const u=new Map;return(async()=>{let d=!1;for(const f of l.skillSpaces){let h=0;for(let m=1;;m++){if(m>100)throw new Error("Skill pagination limit reached");const g=await SIe(f.id,{region:f.region,page:m,pageSize:100,signal:c.signal});if(c.signal.aborted)return;if(!Array.isArray(g.items)||!Number.isInteger(g.totalCount)||g.totalCount<0)throw new Error("Invalid SkillSpace page");const b=u.size;for(const v of g.items){if(typeof v.skillName!="string"||!v.skillName.trim())throw new Error("Invalid skill name");u.set(`${f.region}:${f.id}:${v.skillId||v.skillName}`,{spaceId:f.id,region:f.region,skillId:v.skillId,version:v.version,lookupByName:v.lookupByName,name:v.skillName,description:v.skillDescription||""})}if(h+=g.items.length,d||(d=g.degraded===!0),o({skills:[...u.values()],loading:!0,complete:!1}),h>=g.totalCount)break;if(!g.items.length||u.size===b)throw new Error("Skill pagination made no progress")}}c.signal.aborted||o({skills:[...u.values()],loading:!1,complete:!d,error:d?"degraded":void 0})})().catch(d=>{if(c.signal.aborted)return;const f=d instanceof Zw&&[401,403].includes(d.status);o(h=>({skills:f?[]:u.size?[...u.values()]:h.skills,loading:!1,complete:!1,error:f?"forbidden":"error"}))}),()=>c.abort()},[l,i]),a.jsxs(a.Fragment,{children:[a.jsx(Imt,{...e,boundSkills:s,onOpenSkill:c=>n(s.skills[c]),onRefresh:()=>{e.onRefresh?e.onRefresh():r(c=>c+1)}}),t&&a.jsx(Kpt,{target:t,onClose:()=>n(null),onSaved:()=>r(c=>c+1)})]})}const eT={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};function Iee(e){return a.jsxs("svg",{...eT,...e,children:[a.jsx("rect",{x:"3.75",y:"5.25",width:"16.5",height:"13.5",rx:"2"}),a.jsx("path",{d:"m10.25 9 4.8 3-4.8 3V9Z"})]})}function Mmt(e){return a.jsxs("svg",{...eT,...e,children:[a.jsx("path",{d:"M12 3.75v10.5M8.4 10.8 12 14.4l3.6-3.6"}),a.jsx("path",{d:"M5 17.25v2h14v-2"})]})}function Lmt(e){return a.jsxs("svg",{...eT,...e,children:[a.jsx("path",{d:"M8.75 8.75 6.9 10.6a3.4 3.4 0 0 0 4.8 4.8l1.85-1.85"}),a.jsx("path",{d:"m15.25 15.25 1.85-1.85a3.4 3.4 0 0 0-4.8-4.8l-1.85 1.85"}),a.jsx("path",{d:"m9.4 14.6 5.2-5.2"})]})}function vI(e){return a.jsxs("svg",{...eT,...e,children:[a.jsx("path",{d:"M5 19h3.2L18.6 8.6a1.7 1.7 0 0 0 0-2.4l-.8-.8a1.7 1.7 0 0 0-2.4 0L5 15.8V19Z"}),a.jsx("path",{d:"m13.9 6.9 3.2 3.2M5 15.8 8.2 19"})]})}function FIe(e){return a.jsx("svg",{...eT,...e,children:a.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}const $mt=180,Pee=500,l4=10,Dee=32;function Fmt(e){return Array.from(new Set(e.split(/[,,]/).map(t=>t.trim()).filter(Boolean)))}function Bmt({artifact:e,busy:t,error:n,onClose:i,onSave:r}){const{t:s}=Te("workspaceTools"),[o,l]=p.useState(e.name),[c,u]=p.useState(e.description??""),[d,f]=p.useState((e.tags??[]).join(",")),[h,m]=p.useState(""),g=p.useId(),b=p.useId(),v=p.useRef(null),y=p.useRef(null),w=p.useRef(t),x=p.useRef(i);p.useEffect(()=>{w.current=t,x.current=i},[t,i]),p.useEffect(()=>{var j,T;const S=document.body.style.overflow,C=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(j=y.current)==null||j.focus(),(T=y.current)==null||T.select();const E=R=>{if(R.key==="Escape"&&!w.current){R.preventDefault(),x.current();return}if(R.key!=="Tab")return;const A=v.current;if(!A)return;const N=Array.from(A.querySelectorAll('button:not([disabled]), input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')).filter(D=>D.getClientRects().length>0);if(N.length===0){R.preventDefault();return}const P=N[0],I=N[N.length-1];R.shiftKey&&document.activeElement===P?(R.preventDefault(),I.focus()):!R.shiftKey&&document.activeElement===I&&(R.preventDefault(),P.focus())};return window.addEventListener("keydown",E),()=>{window.removeEventListener("keydown",E),document.body.style.overflow=S,C!=null&&C.isConnected&&C.focus()}},[]);const O=S=>{var j;S.preventDefault();const C=o.trim(),E=Fmt(d);if(!C){m(s("artifactEdit.nameRequired")),(j=y.current)==null||j.focus();return}if(E.length>l4){m(s("artifactEdit.tooManyTags",{max:l4}));return}if(E.some(T=>T.length>Dee)){m(s("artifactEdit.tagTooLong",{max:Dee}));return}m(""),r({name:C,description:c.trim(),tags:E})},k=h||n;return vi.createPortal(a.jsx("div",{className:"artifact-edit-backdrop",onMouseDown:S=>{S.target===S.currentTarget&&!t&&i()},children:a.jsxs("section",{ref:v,className:"artifact-edit-dialog",role:"dialog","aria-modal":"true","aria-labelledby":g,"aria-describedby":b,"aria-busy":t||void 0,children:[a.jsxs("header",{className:"artifact-edit-dialog__header",children:[a.jsxs("div",{children:[a.jsx("h2",{id:g,children:s("artifactEdit.title")}),a.jsx("p",{id:b,children:s("artifactEdit.subtitle")})]}),a.jsx("button",{type:"button",onClick:i,disabled:t,"aria-label":s("artifactEdit.close"),children:a.jsx(FIe,{})})]}),a.jsxs("form",{onSubmit:O,children:[a.jsxs("div",{className:"artifact-edit-dialog__body",children:[a.jsxs("label",{className:"artifact-edit-field",children:[a.jsx("span",{children:s("artifactEdit.name")}),a.jsx("input",{ref:y,value:o,maxLength:$mt,disabled:t,"aria-invalid":!!k||void 0,onChange:S=>{l(S.target.value),m("")}})]}),a.jsxs("label",{className:"artifact-edit-field",children:[a.jsx("span",{children:s("artifactEdit.description")}),a.jsx("textarea",{value:c,maxLength:Pee,disabled:t,rows:4,placeholder:s("artifactEdit.descriptionPlaceholder"),onChange:S=>u(S.target.value)}),a.jsxs("small",{children:[c.length,"/",Pee]})]}),a.jsxs("label",{className:"artifact-edit-field",children:[a.jsx("span",{children:s("artifactEdit.tags")}),a.jsx("input",{value:d,disabled:t,placeholder:s("artifactEdit.tagsPlaceholder",{max:l4}),onChange:S=>{f(S.target.value),m("")}})]}),k?a.jsx("div",{className:"artifact-edit-error",role:"alert",children:k}):null]}),a.jsxs("footer",{className:"artifact-edit-dialog__actions",children:[a.jsx("button",{type:"button",onClick:i,disabled:t,children:s("artifactEdit.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:t,children:s(t?"artifactEdit.saving":"artifactEdit.save")})]})]})]})}),document.body)}function BIe({label:e,menuLabel:t,items:n,placement:i="bottom-end"}){return a.jsxs(er,{children:[a.jsx(er.Trigger,{children:a.jsx(Tt,{type:"button",color:"secondary",variant:"ghost",size:"md",iconSize:"sm",uniform:!0,"aria-label":e,title:e,disabled:n.length===0,children:a.jsx(eat,{"aria-hidden":"true"})})}),a.jsxs(er.Content,{side:i==="top-end"?"top":"bottom",align:"end",minWidth:148,children:[a.jsx("span",{className:"sr-only",children:t}),n.map(r=>a.jsx(er.Item,{disabled:r.disabled,onSelect:r.onSelect,children:a.jsx("span",{title:r.title,children:r.label})},r.label))]})]})}const Umt="_Alert_1tr02_1",Qmt="_Content_1tr02_145",zmt="_Indicator_1tr02_156",Vmt="_Message_1tr02_159",Hmt="_Title_1tr02_162",qmt="_Description_1tr02_168",Wmt="_Actions_1tr02_173",Wb={Alert:Umt,Content:Qmt,Indicator:zmt,Message:Vmt,Title:Hmt,Description:qmt,Actions:Wmt},Lg=({color:e="primary",variant:t="outline",title:n,description:i,actions:r,actionsPlacement:s,indicator:o,className:l,actionsClassName:c,ref:u,...d})=>{const f=p.useRef(null),h=p.useRef(null),[m,g]=p.useState("end"),{width:b}=nNe({ref:f});return p.useEffect(()=>{var y;const v=((y=h.current)==null?void 0:y.clientWidth)??0;if(v&&b){const w=v>b/3?"bottom":"end";g(w)}},[b]),a.jsxs("div",{ref:GA([u,f]),className:Qi(Wb.Alert,l),"data-variant":t,"data-color":e,role:e==="danger"?"alert":void 0,"data-actions-placement":s??m,...d,children:[o===!1?null:a.jsx("div",{className:Wb.Indicator,children:o??a.jsx(Kmt,{color:e})}),a.jsxs("div",{className:Wb.Content,children:[a.jsxs("div",{className:Wb.Message,children:[n&&a.jsx("div",{className:Wb.Title,children:n}),i&&a.jsx("div",{className:Wb.Description,children:i})]}),r&&a.jsx("div",{className:Qi(Wb.Actions,c),ref:h,children:r})]})]})},Kmt=({color:e})=>{switch(e){case"warning":case"caution":case"danger":return a.jsx(Ije,{});case"success":return a.jsx(Tje,{});default:return a.jsx(jje,{})}};function Ad({title:e,description:t,error:n,confirmLabel:i,cancelLabel:r,closeLabel:s,variant:o="warning",busy:l=!1,confirmDisabled:c=!1,onCancel:u,onConfirm:d}){const{t:f}=Te("shell"),h=r??f("confirm.cancel"),m=s??f("confirm.close"),g=p.useId(),b=p.useId(),v=p.useRef(null),y=p.useRef(l),w=p.useRef(u);return p.useEffect(()=>{y.current=l,w.current=u},[l,u]),p.useEffect(()=>{var S;const x=document.body.style.overflow,O=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(S=v.current)==null||S.focus();const k=C=>{C.key==="Escape"&&!y.current&&w.current()};return window.addEventListener("keydown",k),()=>{document.body.style.overflow=x,window.removeEventListener("keydown",k),O!=null&&O.isConnected&&O.focus()}},[]),vi.createPortal(a.jsx("div",{className:"studio-confirm-backdrop",onMouseDown:x=>{x.target===x.currentTarget&&!l&&u()},children:a.jsxs("section",{className:`studio-confirm-dialog studio-confirm-dialog--${o}`,role:"alertdialog","aria-modal":"true","aria-labelledby":g,"aria-describedby":b,"aria-busy":l||void 0,children:[a.jsxs("header",{className:"studio-confirm-head",children:[a.jsxs("div",{className:"studio-confirm-title-wrap",children:[a.jsx("span",{className:"studio-confirm-title-icon","aria-hidden":"true",children:a.jsx(Ije,{})}),a.jsx("h2",{id:g,children:e})]}),a.jsx(Tt,{type:"button",className:"studio-confirm-close",color:"secondary",variant:"ghost",size:"lg",uniform:!0,pill:!1,onClick:u,disabled:l,"aria-label":m,children:a.jsx(pV,{})})]}),a.jsxs("div",{className:"studio-confirm-body",children:[a.jsx("div",{id:b,children:t}),n?a.jsx(Lg,{className:"studio-confirm-error",color:"danger",variant:"soft",description:n}):null]}),a.jsxs("footer",{className:"studio-confirm-actions",children:[a.jsx(Tt,{ref:v,type:"button",color:"secondary",variant:"ghost",size:"lg",pill:!1,onClick:u,disabled:l,children:h}),a.jsx(Tt,{type:"button",className:"studio-confirm-primary",color:o==="danger"?"danger":"primary",size:"lg",pill:!1,loading:l,onClick:d,disabled:l||c,children:i})]})]})}),document.body)}const Gmt="_Container_1a6nz_1",Xmt="_Input_1a6nz_229",Mee={Container:Gmt,Input:Xmt},_s=e=>{const t=p.useRef(null),i=`search-ui-input-${p.useId()}`,{id:r,name:s,type:o="text",variant:l="outline",size:c="md",gutterSize:u,className:d,autoComplete:f,disabled:h=!1,readOnly:m=!1,invalid:g=!1,allowAutofillExtensions:b=o==="password"||!!s||!!f&&f!=="off",onFocus:v,onBlur:y,onAnimationStart:w,onAutofill:x,autoSelect:O,startAdornment:k,endAdornment:S,pill:C,opticallyAlign:E,ref:j,...T}=e,R=I=>{const D=t.current;if(!I.target||!(I.target instanceof Element)||!D||D.contains(I.target)||I.target.closest("button, [type='button'], [role='button'], [role='menuitem']"))return;I.preventDefault(),document.activeElement!==D&&D.focus();const{left:_,top:L}=D.getBoundingClientRect(),{clientX:F,clientY:M}=I,z=M{var I;O&&((I=t.current)==null||I.select())},[O]);const P=I=>{w==null||w(I),I.animationName==="native-autofill-in"&&(x==null||x())};return a.jsxs("div",{className:Qi(Mee.Container,d),"data-variant":l,"data-size":c,"data-gutter-size":u,"data-focused":A,"data-disabled":h?"":void 0,"data-readonly":m?"":void 0,"data-invalid":g?"":void 0,"data-pill":C?"":void 0,"data-optically-align":E,"data-has-start-adornment":k?"":void 0,"data-has-end-adornment":S?"":void 0,onMouseDown:R,children:[k,a.jsx("input",{...T,ref:GA([j,t]),id:r||(b?void 0:i),className:Mee.Input,type:o,name:s,autoComplete:f,readOnly:m,disabled:h,onFocus:I=>{N(!0),v==null||v(I)},onBlur:I=>{N(!1),y==null||y(I)},onAnimationStart:P,"data-lpignore":b?void 0:!0,"data-1p-ignore":b?void 0:!0}),S]})},Ymt="_SelectControl_1tyi7_1",Zmt="_Clear_1tyi7_436",Jmt="_DropdownIcon_1tyi7_437",egt="_TriggerText_1tyi7_468",tgt="_IndicatorWrapper_1tyi7_476",ngt="_StartIcon_1tyi7_482",igt="_DropdownIconChevron_1tyi7_534",rgt="_LoadingIndicator_1tyi7_537",mp={SelectControl:Ymt,Clear:Zmt,DropdownIcon:Jmt,TriggerText:egt,IndicatorWrapper:tgt,StartIcon:ngt,DropdownIconChevron:igt,LoadingIndicator:rgt},sgt=({ref:e,onPointerDown:t,onKeyDown:n,onPointerEnter:i,onInteract:r,invalid:s,disabled:o,children:l,className:c,variant:u="outline",size:d="md",block:f,opticallyAlign:h,pill:m=!0,loading:g,onClearClick:b,selected:v=!1,StartIcon:y,dropdownIconType:w="dropdown",...x})=>{const O=p.useRef(null),S=!!b&&v&&!g&&!o,C=w&&w!=="none"&&!g,E=S||g||C,j=!g&&!o,T=A=>{var N;switch(A.key){case"ArrowDown":case"ArrowUp":case" ":A.stopPropagation(),A.preventDefault(),r?r():(N=O.current)==null||N.dispatchEvent(new PointerEvent("pointerdown",{bubbles:!0,cancelable:!0,pointerType:"mouse"}));break;case"Enter":break;default:n==null||n(A)}},R=A=>{var N;A.button!==2&&(A.stopPropagation(),r?(A.preventDefault(),r()):(t==null||t(A),(N=x.onClick)==null||N.call(x,A)))};return a.jsxs("span",{ref:GA([O,e]),className:Qi(mp.SelectControl,c),role:"button",tabIndex:o?-1:0,onPointerEnter:A=>{kV(A),i==null||i(A)},onPointerDown:j?R:void 0,onKeyDown:j?T:void 0,"data-variant":u,"data-block":f?"":void 0,"data-pill":m?"":void 0,"data-size":d,"data-optically-align":h,"aria-busy":g?"true":void 0,"data-selected":v,"data-loading":g?"":void 0,"data-invalid":s?"":void 0,"data-disabled":o?"":void 0,"aria-disabled":o,...x,onClick:void 0,children:[y&&a.jsx(y,{className:mp.StartIcon}),a.jsx("span",{className:mp.TriggerText,children:l}),E&&a.jsxs("div",{className:mp.IndicatorWrapper,children:[S&&a.jsx(Tt,{"aria-label":"Clear current value",className:mp.Clear,onPointerDown:A=>{A.stopPropagation()},onClick:A=>{A.stopPropagation(),A.preventDefault(),b()},color:"secondary",variant:C?"ghost":"solid",size:"3xs",uniform:!0,pill:m,"data-only-child":C?void 0:"",children:a.jsx(pV,{})}),g&&a.jsx(QA,{className:mp.LoadingIndicator}),C&&a.jsx(agt,{iconType:w})]})]})},agt=({iconType:e})=>e==="chevronDown"?a.jsx(Gst,{className:Qi(mp.DropdownIcon,mp.DropdownIconChevron)}):a.jsx(tat,{className:mp.DropdownIcon}),ogt="_Menu_n4tw6_3",lgt="_MenuList_n4tw6_5",cgt="_MenuInner_n4tw6_50",ugt="_OptionsList_n4tw6_64",dgt="_Option_n4tw6_64",fgt="_PressableInner_n4tw6_111",hgt="_OptionInner_n4tw6_113",pgt="_OptionCheck_n4tw6_118",mgt="_OptionIndicatorSlot_n4tw6_123",ggt="_OptionGroupHeading_n4tw6_128",bgt="_OptionHardLimitHeading_n4tw6_140",ygt="_OptionsLimit_n4tw6_147",vgt="_Action_n4tw6_152",xgt="_ActionInner_n4tw6_218",wgt="_ActionsContainer_n4tw6_224",Ogt="_Search_n4tw6_244",kgt="_SearchEmpty_n4tw6_247",xs={Menu:ogt,MenuList:lgt,MenuInner:cgt,OptionsList:ugt,Option:dgt,PressableInner:fgt,OptionInner:hgt,OptionCheck:pgt,OptionIndicatorSlot:mgt,OptionGroupHeading:ggt,OptionHardLimitHeading:bgt,OptionsLimit:ygt,Action:vgt,ActionInner:xgt,ActionsContainer:wgt,Search:Ogt,SearchEmpty:kgt},UIe=p.createContext(null),Tb=()=>{const e=p.use(UIe);if(!e)throw new Error("Select components must be wrapped in ");return e},Sgt=({label:e})=>a.jsx(a.Fragment,{children:e}),Egt=({label:e})=>a.jsx(a.Fragment,{children:e}),Cgt=({values:e,selectedAll:t})=>{const n=t?"All selected":e.length===0?"Select...":e.length===1?e[0].label:`${e.length} selected`;return a.jsx(a.Fragment,{children:n})},ha=e=>{const{id:t,required:n,value:i,name:r,multiple:s,variant:o="outline",size:l="md",dropdownIconType:c="dropdown",loading:u=!1,clearable:d=!1,disabled:f=!1,placeholder:h="Select...",loadingPlaceholder:m="Loading...",pill:g=!0,listWidth:b,options:v,actions:y=[],side:w="bottom",avoidCollisions:x=!0,onChange:O,optionClassName:k,OptionView:S=Sgt,TriggerStartIcon:C,triggerClassName:E,opticallyAlign:j,TriggerView:T,searchPlaceholder:R="",searchPredicate:A=$gt,searchEmptyMessage:N="No results found.",listMaxWidth:P="auto"}=e,I=e.block??o!=="ghost",D=e.align??(I?"center":"start"),_=e.alignOffset??(D==="center"?0:-5),L=e.listMinWidth??(I?"auto":300),F=rb((H,se)=>{if(s){if(!H.value){O([]);return}if(se){const Y=i.filter(ie=>ie!==H.value),X=DB(v,Y);O(X)}else{const Y=DB(v,i);O(Y.concat(H))}}else O(H)}),M=p.useRef(A);M.current=A;const V=p.useMemo(()=>y,[y.length]),q=p.useRef(y);q.current=y;const U=p.useCallback(H=>{var se;(se=q.current.find(Y=>Y.id===H))==null||se.onSelect(H)},[]),J=p.useMemo(()=>gH(v)?v.reduce((H,se)=>H+se.options.length,0):v.length,[v]),Z=`select-trigger-${p.useId()}`,ne=J>15,W=p.useMemo(()=>s?{multiple:!0,value:i,TriggerView:T??Cgt}:{multiple:!1,value:i,TriggerView:T??Egt},[s,i,T]),G=p.useMemo(()=>({...W,triggerId:Z,id:t,name:r,required:n,options:v,placeholder:h,loadingPlaceholder:m,loading:u,clearable:d,variant:o,pill:g,size:l,dropdownIconType:c,block:I,align:D,alignOffset:_,side:w,avoidCollisions:x,listWidth:b,listMinWidth:L,listMaxWidth:P,searchPlaceholder:R,searchEmptyMessage:N,TriggerStartIcon:C,triggerClassName:E,opticallyAlign:j,optionClassName:k,OptionView:S,actions:V,onActionSelect:U,onSelectRef:F,searchPredicateRef:M,searchable:ne,disabled:f}),[W,Z,t,n,r,v,h,m,u,d,o,g,l,c,I,D,_,w,x,b,L,P,R,N,C,E,j,k,S,V,U,F,ne,f]);return a.jsx(UIe.Provider,{value:G,children:a.jsx(Tgt,{})})},Agt=e=>{const{triggerId:t,id:n,required:i,value:r,multiple:s,options:o,loading:l,disabled:c,clearable:u,name:d,variant:f,pill:h,size:m,dropdownIconType:g,placeholder:b,loadingPlaceholder:v,block:y,opticallyAlign:w,triggerClassName:x,TriggerStartIcon:O,TriggerView:k,onSelectRef:S}=Ab(),{onOpenChange:C,...E}=e,j=s?r[0]:r,T=l?v:b,R=p.useMemo(()=>Bgt(o,j)||{value:"",label:T},[j,o,T]),A=s?r.length>0:!!r,N=l||!A,P=p.useMemo(()=>WIe(),[]),I=p.useMemo(()=>{if(!s)return{values:[],selectedAll:!1};const L=DB(o,r),F=o.flatMap(M=>"options"in M?M.options:M);return{values:L.length?L:[{value:"",label:T}],selectedAll:F.length<=r.length}},[s,o,r,T]),D=L=>{const F=L.key;if(!s&&KIe(F)){const M=P(F);L.stopPropagation();const V=GIe(o,M,j);V&&S.current(V)}},_=()=>{S.current({value:"",label:""}),C==null||C(!1)};return a.jsxs(sgt,{id:t,className:x,selected:!N,variant:f,pill:h,block:y,size:m,disabled:c,loading:l,StartIcon:O,opticallyAlign:w,dropdownIconType:g,onClearClick:u?_:void 0,onInteract:C,onKeyDown:D,...E,children:[s?a.jsx(k,{...I}):a.jsx(k,{...R}),(d||n)&&a.jsx("input",{id:n,name:d,value:j,tabIndex:-1,onFocus:()=>{var L;(L=document.getElementById(t))==null||L.focus()},onChange:()=>{},required:i,className:"sr-only w-full h-0 left-0 bottom-0 pointer-events-none","aria-hidden":"true"})]})},Tgt=()=>{const{triggerId:e,loading:t,side:n,align:i,alignOffset:r,avoidCollisions:s,listWidth:o,listMinWidth:l,listMaxWidth:c}=Ab(),[u,d]=p.useState(!1),f=p.useRef(null),h=m=>{const g=m===void 0?!u:m;d(g),g||setTimeout(()=>{var v;if(!f.current)return;const b=document.activeElement;b&&!f.current.contains(b)||(v=document.getElementById(e))==null||v.focus()})};return JA(u,()=>{h(!1)}),a.jsxs(IRe,{open:u,onOpenChange:m=>{t&&m||h(m)},modal:!1,children:[a.jsx(PRe,{asChild:!0,children:a.jsx(Agt,{onOpenChange:h})}),a.jsx(DRe,{forceMount:!0,children:a.jsx(Y1,{className:ys.Menu,enterDuration:350,exitDuration:200,disableAnimations:!0,children:u&&a.jsx(MRe,{ref:f,forceMount:!0,className:ys.MenuList,side:n,sideOffset:5,align:i,alignOffset:r,avoidCollisions:s,collisionPadding:{bottom:30,top:30},onOpenAutoFocus:Dp,onCloseAutoFocus:Dp,onEscapeKeyDown:Dp,style:z0({"select-list-width":o,"select-list-min-width":l,"select-list-max-width":c}),children:a.jsx(_gt,{onOpenChange:h})},"dropdown")})})]})},QIe=p.createContext(null),eO=()=>{const e=p.use(QIe);if(!e)throw new Error("CustomSelectMenu components must be wrapped in ");return e},_gt=({onOpenChange:e})=>{const{multiple:t,value:n,options:i,searchable:r,searchPredicateRef:s}=Ab(),o=p.useRef(()=>e(!1)),l=p.useRef(null),c=p.useRef(null),u=p.useRef(null),[d,f]=p.useState(""),[h,m]=p.useState(()=>{var j;return((t?n[0]:n)||((j=g_(i))==null?void 0:j.value))??""}),g=p.useMemo(()=>WIe(),[]),v=`select-list-${p.useId()}`,y=p.useRef(t?"":n),w=p.useMemo(()=>d.trim().toLocaleLowerCase(),[d]),x=p.useMemo(()=>Fgt(i,w,s.current),[i,w,s]),O=p.useMemo(()=>g_(x),[x]),k=p.useRef(!1),S=E=>{const j=E.key,T=t?n[0]:n,R=h||(O==null?void 0:O.value)||T,A=document.activeElement===u.current,N=l.current;if(!N)return;const P=()=>{const _=new PointerEvent("pointerup",{bubbles:!0,cancelable:!0,pointerType:"mouse"}),L=dp(h,N);L==null||L.dispatchEvent(_)},I=(_,L)=>{m(_),L.scrollIntoView({block:"nearest"})},D=()=>{const _=t?n[0]:n;if(_){const F=dp(_,N);if(F){I(_,F);return}}const L=g_(i);if(L){const F=dp(L.value,N);F&&I(L.value,F)}};switch(j){case"ArrowDown":{if(E.preventDefault(),!h||!dp(h,N)){D();return}const _=Ugt(h,N),L=_==null?void 0:_.getAttribute("data-option-id");_&&L&&I(L,_);return}case"ArrowUp":{if(E.preventDefault(),!h||!dp(h,N)){D();return}const _=Qgt(R,N),L=_==null?void 0:_.getAttribute("data-option-id");_&&L&&I(L,_);return}case"Enter":E.preventDefault(),P();return;case" ":if(w&&A)return;E.preventDefault(),P();return}if(KIe(j)){if(A)return;const _=g(j);E.stopPropagation();const L=GIe(i,_,h);if(L){const F=dp(L.value,N);F&&(m(L.value),F.scrollIntoView({block:"nearest"}))}}},C=p.useMemo(()=>({valueRef:y,listId:v,highlightedValue:h,setHighlightedValue:m,requestCloseRef:o,searchTerm:d,setSearchTerm:f,searchInputRef:u,listRef:c}),[v,h,m,d,f]);return p.useEffect(()=>{pI(()=>{if(!l.current)return;const j=dp(h,l.current);j==null||j.scrollIntoView({block:"center"})});const E=u.current||l.current;return E==null||E.focus({preventScroll:!0}),()=>{k.current=!1}},[]),p.useLayoutEffect(()=>{if(!k.current){k.current=!0;return}if(!c.current)return;c.current.scrollTop=0;const E=g_(x);E&&m(E.value)},[x]),a.jsx(QIe,{value:C,children:a.jsxs("div",{id:v,className:ys.MenuInner,onKeyDown:S,ref:l,tabIndex:0,children:[r&&a.jsx(jgt,{value:d,onChange:f}),a.jsx(Ngt,{filteredOptions:x}),a.jsx(Mgt,{})]})})},jgt=({value:e,onChange:t})=>{const{searchPlaceholder:n}=Ab(),{listId:i,searchInputRef:r}=eO(),s=o=>{t(o.target.value)};return a.jsx("div",{className:ys.Search,children:a.jsx(_s,{startAdornment:a.jsx(dat,{width:16,height:16,className:"fill-secondary"}),ref:r,value:e,placeholder:n,onChange:s,autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-controls":i,"aria-expanded":!0})})},aT=e=>"options"in e,gH=e=>e[0]&&aT(e[0]),dw=300,Ngt=({filteredOptions:e})=>{const{searchEmptyMessage:t}=Ab(),{listRef:n}=eO();if(!e.length)return typeof t=="string"?a.jsx("p",{className:ys.SearchEmpty,"data-text-only":!0,children:t}):a.jsx("div",{className:ys.SearchEmpty,children:t});const i=gH(e),r=!i&&e.length>dw,s=i?e.map(o=>a.jsx(Igt,{...o},o.label)):e.slice(0,dw).map(o=>a.jsx(VIe,{...o},o.value));return a.jsxs("div",{className:ys.OptionsList,ref:n,children:[s,r&&a.jsx(zIe,{numHidden:e.length-dw})]})},Rgt={limit:100,label:"Show all"},Igt=({label:e,options:t,optionsLimit:n=Rgt})=>{const i=p.useId(),{searchTerm:r,setHighlightedValue:s}=eO(),[o,l]=p.useState(!1),c=n.limit{l(!0),s(t[n.limit].value)};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:ys.OptionGroupHeading,children:[a.jsx("div",{className:ys.OptionIndicatorSlot}),e]}),d.map(h=>a.jsx(VIe,{...h},h.value)),c&&a.jsx(Pgt,{value:`group-limit-${i}`,label:n.label,onPointerUp:f}),u&&a.jsx(zIe,{numHidden:t.length-dw})]})},zIe=({numHidden:e})=>a.jsxs("div",{className:ys.OptionHardLimitHeading,children:[a.jsx("div",{className:ys.OptionIndicatorSlot}),`…and ${e.toLocaleString()} more options. Use search to refine results further.`]}),Pgt=({value:e,label:t,onPointerUp:n})=>{const{highlightedValue:i,setHighlightedValue:r}=eO(),s=e===i,o=()=>{s||r(e)},l=()=>{r(c=>c!==e?c:"")};return a.jsx("div",{className:Ui(ys.Option,ys.OptionsLimit),"data-option-id":e,"data-highlight":s?"":void 0,role:"option","aria-selected":s,onPointerUp:n,onPointerMove:o,onPointerLeave:l,children:a.jsxs("div",{className:Ui(ys.PressableInner,ys.OptionInner),children:[a.jsx("div",{className:ys.OptionIndicatorSlot}),t]})})},Dgt="data-option-id",VIe=e=>{const{optionClassName:t,OptionView:n,value:i,multiple:r,onSelectRef:s}=Ab(),{valueRef:o,requestCloseRef:l,highlightedValue:c,setHighlightedValue:u}=eO(),{value:d,disabled:f,tooltip:h}=e,m=o.current,g=r?i.includes(d):d===m,b=d===c,v=()=>{var x;r?s.current(e,g):(s.current(e),(x=l.current)==null||x.call(l))},y=()=>{b||u(d)},w=()=>{u(x=>x!==d?x:"")};return a.jsx("div",{className:Ui(ys.Option,t),"data-highlight":b?"":void 0,role:"option","aria-selected":b,"data-selected":g?"":void 0,[Dgt]:d,onPointerUp:f?void 0:v,onPointerMove:f?void 0:y,onPointerLeave:f?void 0:w,"aria-disabled":f,"data-disabled":f?"":void 0,children:a.jsxs("div",{className:ys.PressableInner,children:[a.jsxs("div",{className:ys.OptionInner,children:[a.jsx("div",{className:ys.OptionIndicatorSlot,children:g&&a.jsx(fC,{className:ys.OptionCheck})}),a.jsx(n,{...e}),h&&a.jsx(ka,{content:h.content,maxWidth:h.maxWidth,side:"right",children:a.jsx(jje,{})})]}),e.description&&a.jsxs("div",{className:ys.OptionInner,children:[a.jsx("div",{className:ys.OptionIndicatorSlot}),e.description]})]})})},Mgt=()=>{const{actions:e}=Ab();return e.length===0?null:a.jsx("div",{className:ys.ActionsContainer,children:e.map(t=>a.jsx(Lgt,{...t},t.id))})},Lgt=({id:e,label:t,Icon:n,className:i})=>{const{onActionSelect:r}=Ab(),{requestCloseRef:s}=eO(),o=c=>{switch(c.key){case"Tab":break;case"Enter":case" ":c.stopPropagation(),l();break;default:c.stopPropagation()}},l=()=>{var c;r(e),(c=s.current)==null||c.call(s)};return a.jsx("div",{className:ys.Action,onPointerUp:l,onKeyDown:o,tabIndex:0,children:a.jsxs("div",{className:Ui(ys.ActionInner,i),children:[n&&a.jsx(n,{role:"presentation"}),t]})})},$gt=(e,t)=>e.label.toLowerCase().includes(t),Fgt=(e,t,n)=>{const i=t.trim().toLocaleLowerCase();if(!i)return e;const r=s=>n(s,i);return gH(e)?e.reduce((s,o)=>{const l=o.options.filter(r);return l.length&&s.push({...o,options:l}),s},[]):e.reduce((s,o)=>(r(o)&&s.push(o),s),[])},g_=e=>{if(!e.length)return;let t;for(const n of e)if(aT(n)){const i=n.options.find(r=>!r.disabled);if(i){t=i;break}}else if(!n.disabled){t=n;break}return t},Bgt=(e,t)=>{let n;for(const i of e)if(aT(i)){const r=i.options.find(s=>s.value===t);if(r){n=r;break}}else if(i.value===t){n=i;break}return n},DB=(e,t)=>{let n=[];const i=new Set(t);for(const r of e)if(aT(r)){const s=r.options.filter(o=>i.has(o.value));n=n.concat(s)}else i.has(r.value)&&n.push(r);return n},HIe=40,dp=(e,t)=>t.querySelector(`[data-option-id="${e}"]`),qIe=e=>e.matches("[data-option-id]:not([data-disabled])"),Ugt=(e,t)=>{const n=dp(e,t);let i=n==null?void 0:n.nextElementSibling,r=0;for(;i&&r{const n=dp(e,t);let i=n==null?void 0:n.previousElementSibling,r=0;for(;i&&r{let e="",t;return n=>(n=n.toLowerCase(),e+=n,t&&clearTimeout(t),t=setTimeout(()=>{e=""},500),n.repeat(e.length)===e?n:e)},KIe=e=>/^[a-zA-Z0-9]$/.test(e),GIe=(e,t,n)=>{if(!e.length)return;let i,r,s=!n;const o=({disabled:l,label:c,value:u})=>u===n?(s=!0,!1):!l&&c.toLowerCase().startsWith(t);for(const l of e)if(aT(l)){for(const c of l.options)if(o(c))if(s){r=c;break}else i=i||c}else if(o(l))if(s){r=l;break}else i=i||l;return r||i};function Ja(...e){return e.filter(Boolean).join(" ")}const Lee=[["14 90% 62%","28 96% 80%","3 44% 24%"],["198 72% 56%","217 88% 79%","189 42% 24%"],["263 66% 63%","291 72% 81%","242 39% 25%"],["146 49% 52%","169 66% 78%","158 38% 23%"],["334 72% 63%","15 87% 80%","350 41% 25%"]];function zgt(e){let t=2166136261;for(const o of e)t^=o.charCodeAt(0),t=Math.imul(t,16777619);const n=t>>>0,[i,r,s]=Lee[n%Lee.length];return{"--resource-identity-accent":i,"--resource-identity-glow":r,"--resource-identity-shadow":s,"--resource-identity-x":`${20+(n>>>7)%61}%`,"--resource-identity-y":`${18+(n>>>15)%57}%`}}function t1({seed:e,className:t}){return a.jsx("span",{className:Ja("resource-card__identity-mark",t),style:zgt(e),"aria-hidden":"true"})}function Vgt(e){return a.jsx("svg",{viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",...e,children:a.jsxs("g",{transform:"translate(0.875 0.875)",children:[a.jsx("path",{d:"M5.869 10.719a4.849 4.849 0 1 0 0-9.698 4.849 4.849 0 0 0 0 9.698Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),a.jsx("path",{d:"m11.229 11.229-1.021-1.021",stroke:"currentColor",strokeWidth:"0.984375",strokeLinecap:"round",strokeLinejoin:"round"})]})})}function kh({className:e,...t}){return a.jsx("section",{className:Ja("resource-page",e),...t})}function q0({title:e,description:t,className:n}){return a.jsxs("header",{className:Ja("resource-page__header",n),children:[a.jsx("h1",{children:e}),t?a.jsx("p",{children:t}):null]})}function Hgt({className:e,...t}){return a.jsx("div",{className:Ja("resource-detail",e),...t})}function qgt({className:e,...t}){return a.jsx("header",{className:Ja("resource-detail__header",e),...t})}function Wgt({title:e,description:t,identitySeed:n,meta:i,backLabel:r,onBack:s}){const{t:o}=Te("ui"),l=r??o("resourceCollection.back");return a.jsxs("div",{className:"resource-detail__heading",children:[s?a.jsx("button",{type:"button",className:"resource-detail__back",onClick:s,"aria-label":l,title:l,children:a.jsx(Eat,{"aria-hidden":"true"})}):null,a.jsxs("div",{className:"resource-detail__heading-copy",children:[a.jsxs("div",{className:"resource-detail__title-row",children:[a.jsx("span",{className:"resource-detail__identity",children:a.jsx(t1,{seed:n})}),a.jsx("h1",{children:e}),i?a.jsx("div",{className:"resource-detail__meta",children:i}):null]}),t?a.jsx("p",{children:t}):null]})]})}function Kgt({className:e,...t}){return a.jsx("div",{className:Ja("resource-detail__actions",e),...t})}function Ggt({className:e,...t}){return a.jsx("div",{className:Ja("resource-detail__body",e),...t})}function oT({title:e,description:t,identitySeed:n,meta:i,backLabel:r,onBack:s,actions:o,className:l,actionsClassName:c,bodyClassName:u,sections:d,activeSectionKey:f,navigationLabel:h,onSectionChange:m,children:g}){var x;const{t:b}=Te("ui"),v=!!(d!=null&&d.length),y=(x=d==null?void 0:d.find(O=>O.key===f))==null?void 0:x.content,w=h??b("resourceCollection.detailNavigation");return a.jsxs(Hgt,{className:l,children:[a.jsxs(qgt,{children:[a.jsx(Wgt,{title:e,description:t,identitySeed:n,meta:i,backLabel:r,onBack:s}),o?a.jsx(Kgt,{className:c,children:o}):null]}),a.jsx(Ggt,{className:Ja(v&&"is-split",u),children:v?a.jsxs(a.Fragment,{children:[a.jsx("nav",{className:"resource-detail__navigation","aria-label":w,children:d==null?void 0:d.map(O=>a.jsx(_t,{type:"button",color:"secondary",variant:O.key===f?"soft":"ghost",size:"lg",pill:!1,block:!0,"aria-current":O.key===f?"page":void 0,disabled:O.disabled,onClick:()=>m==null?void 0:m(O.key),children:a.jsx("span",{className:"resource-detail__navigation-label",children:O.label})},O.key))}),a.jsx("div",{className:"resource-detail__content",children:y})]}):g})]})}function bH({className:e,...t}){return a.jsx("dl",{className:Ja("resource-detail__summary",e),...t})}function XIe({title:e,description:t,actions:n,className:i}){return a.jsxs("header",{className:Ja("resource-detail__section-header",i),children:[a.jsxs("div",{children:[a.jsx("h2",{children:e}),t?a.jsx("p",{children:t}):null]}),n]})}function yH({rows:e,rowKey:t,rowLabel:n,columns:i,searchValue:r,onSearchChange:s,searchPlaceholder:o,searchLabel:l,toolbarActions:c,primaryAction:u,rowActions:d,scrollRef:f,onScroll:h,busy:m,footer:g,emptyLabel:b}){const{t:v}=Te("ui"),y=!!d,w=b??v("resourceCollection.noData");return a.jsxs("div",{className:"resource-data-table",children:[a.jsxs("div",{className:"resource-data-table__toolbar",children:[a.jsx("div",{className:"resource-data-table__search",children:a.jsx(_s,{type:"search",value:r,onChange:x=>s(x.target.value),placeholder:o,"aria-label":l})}),c,u?a.jsx(_t,{type:"button",color:"primary",disabled:u.disabled,title:u.title,onClick:u.onClick,children:u.label}):null]}),a.jsxs("div",{ref:f,className:"resource-data-table__frame","aria-busy":m||void 0,onScroll:h,children:[a.jsxs("table",{className:"resource-data-table__table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[i.map(x=>a.jsx("th",{scope:"col",className:x.className,children:x.header},x.key)),y?a.jsx("th",{scope:"col",className:"resource-data-table__actions-heading",children:a.jsx("span",{className:"sr-only",children:v("resourceCollection.actions")})}):null]})}),a.jsx("tbody",{children:e.length===0?a.jsx("tr",{children:a.jsx("td",{className:"resource-data-table__empty",colSpan:i.length+(y?1:0),children:w})}):e.map(x=>{const O=t(x),k=(n==null?void 0:n(x))??O;return a.jsxs("tr",{children:[i.map(S=>a.jsx("td",{className:S.className,children:S.render(x)},S.key)),d?a.jsx("td",{className:"resource-data-table__actions",children:a.jsx(BIe,{label:v("resourceCollection.moreActions",{label:k}),menuLabel:v("resourceCollection.actionsFor",{label:k}),items:d(x)})}):null]},O)})})]}),g]})]})}function sb({className:e,...t}){return a.jsx("div",{className:Ja("resource-toolbar",e),...t})}function ab({items:e,value:t,onChange:n,ariaLabel:i,idPrefix:r,className:s}){const o=c=>{c.disabled||n(c.id)},l=(c,u)=>{var g;if(!["ArrowLeft","ArrowRight","Home","End"].includes(c.key))return;c.preventDefault();const d=e.filter(b=>!b.disabled),f=d.findIndex(b=>b.id===u.id),h=c.key==="Home"?0:c.key==="End"?d.length-1:(f+(c.key==="ArrowRight"?1:-1)+d.length)%d.length,m=d[h];m&&(n(m.id),(g=document.getElementById(`${r}-${m.id}-tab`))==null||g.focus())};return a.jsx("nav",{className:Ja("resource-tabs",s),"aria-label":i,role:"tablist",children:e.map(c=>a.jsx("button",{type:"button",id:`${r}-${c.id}-tab`,className:t===c.id?"is-active":void 0,role:"tab","aria-selected":t===c.id,"aria-controls":c.panelId,tabIndex:t===c.id?0:-1,disabled:c.disabled,onClick:()=>o(c),onKeyDown:u=>l(u,c),children:c.label},c.id))})}function Zp({className:e,...t}){return a.jsxs("label",{className:Ja("resource-search",e),children:[a.jsx(Vgt,{}),a.jsx("input",{type:"search",...t})]})}const Xgt=150,Ygt=200;function $ee(e){e.dispatchEvent(new PointerEvent("pointerdown",{bubbles:!0,cancelable:!0,pointerType:"mouse",button:0}))}function ob({id:e,ariaLabel:t,value:n,options:i,onChange:r,className:s,disabled:o=!1}){const l=p.useRef(null),c=p.useRef(null),u=p.useRef(null),d=p.useRef(!1),f=p.useCallback(()=>{c.current!==null&&(window.clearTimeout(c.current),c.current=null)},[]),h=p.useCallback(()=>{u.current!==null&&(window.clearTimeout(u.current),u.current=null)},[]),m=p.useCallback(()=>{var y;return((y=l.current)==null?void 0:y.querySelector(".resource-filter-select__trigger"))??null},[]),g=p.useCallback(()=>{h();const y=m();d.current&&(y==null?void 0:y.getAttribute("data-state"))==="open"&&$ee(y),d.current=!1},[h,m]),b=p.useCallback(()=>{d.current&&(h(),u.current=window.setTimeout(g,Ygt))},[h,g]),v=p.useCallback(y=>{var O;if(o||!window.matchMedia("(hover: hover) and (pointer: fine)").matches)return;h();const w=m();if(!w||w.getAttribute("data-state")==="open")return;const x=document.activeElement;x instanceof HTMLElement&&x!==w&&!((O=l.current)!=null&&O.contains(x))&&x.matches("input, textarea, [contenteditable='true']")||(f(),c.current=window.setTimeout(()=>{const k=m();!k||k.getAttribute("data-state")==="open"||(d.current=!0,$ee(k))},Xgt))},[h,f,o,m]);return p.useEffect(()=>{const y=w=>{var C;if(!d.current)return;const x=m();if(!x||x.getAttribute("data-state")!=="open"){d.current=!1,h();return}const O=w.target;if(!(O instanceof Node))return;const k=x.getAttribute("aria-controls"),S=k?document.getElementById(k):null;if((C=l.current)!=null&&C.contains(O)||S!=null&&S.contains(O)){h();return}b()};return document.addEventListener("pointermove",y,{passive:!0}),()=>{document.removeEventListener("pointermove",y),f(),h()}},[h,f,m,b]),a.jsxs("div",{ref:l,className:Ja("resource-filter-select",s),onMouseEnter:v,onMouseLeave:()=>{f(),b()},children:[a.jsx("label",{className:"sr-only",htmlFor:e,children:t}),a.jsx(ha,{id:e,value:n,options:i,size:"md",variant:"ghost",pill:!1,block:!1,align:"end",listMinWidth:160,disabled:o,triggerClassName:"resource-filter-select__trigger",onChange:y=>r(y.value)})]})}const Jp=p.forwardRef(function({className:t,...n},i){return a.jsx("section",{ref:i,className:Ja("resource-results",t),...n})});function cl(){const{t:e}=Te("ui");return a.jsxs("div",{className:"resource-loading-state",role:"status","aria-live":"polite","aria-busy":"true",children:[a.jsx(WA,{size:16}),a.jsx(fn,{as:"span",duration:2.4,children:e("resourceCollection.loading")})]})}function W0({className:e,...t}){return a.jsx("div",{className:Ja("resource-grid",e),...t})}function vH({className:e,footer:t,actions:n,activateLabel:i,onActivate:r,children:s,...o}){return a.jsxs("article",{className:Ja("resource-card",r&&"is-interactive",e),...o,children:[r&&i?a.jsx("button",{type:"button",className:"resource-card__target","aria-label":i,title:i,onClick:r}):null,a.jsx("div",{className:"resource-card__content",children:s}),t||n?a.jsxs("footer",{className:"resource-card__footer",children:[t,n?a.jsx("div",{className:"resource-card__actions",children:n}):null]}):null]})}function CN({className:e,iconOnly:t=!1,tone:n="secondary",...i}){return a.jsx("button",{type:"button",className:Ja("resource-card__action",`is-${n}`,t&&"is-icon-only",e),...i})}function MB({label:e,icon:t="arrow",tone:n="primary",className:i,children:r,title:s,...o}){const l=t==="play"?a.jsx(cat,{}):t==="plus"?a.jsx(Rje,{}):a.jsx(qst,{});return a.jsx(CN,{className:i,iconOnly:!0,tone:n,"aria-label":e,title:s??e,...o,children:r??l})}function xH({leading:e,title:t,titleText:n,subtitle:i,status:r}){return a.jsxs("div",{className:"resource-card__header",children:[a.jsxs("div",{className:"resource-card__identity",children:[e,a.jsxs("div",{className:"resource-card__title-copy",children:[a.jsx("h3",{title:n,children:t}),i]})]}),r]})}function wH({children:e,title:t}){return a.jsx("p",{className:"resource-card__description",title:t,children:e})}function YIe({items:e,className:t}){return a.jsx("dl",{className:Ja("resource-card__metadata",t),children:e.map((n,i)=>a.jsxs("div",{className:n.className,children:[a.jsx("dt",{className:n.hideLabel?"sr-only":void 0,children:n.label}),a.jsx("dd",{title:n.title,children:n.value})]},`${String(n.label)}:${i}`))})}function lb({className:e,icon:t,children:n,...i}){return a.jsxs("button",{type:"button",className:Ja("resource-create-card",e),...i,children:[a.jsx("span",{className:"resource-create-card__icon","aria-hidden":"true",children:t}),a.jsx("span",{children:n})]})}const Zgt=new Set(["avif","bmp","gif","heic","jpeg","jpg","png","svg","tif","tiff","webp"]),Jgt=new Set(["avi","m4v","mkv","mov","mp4","mpeg","mpg","webm"]),ebt=new Set(["csv","htm","html","json","md","pdf","svg","txt","xml","yaml","yml"]);function ZIe(e){const t=e.lastIndexOf(".");return t<0?"":e.slice(t+1).toLocaleLowerCase()}function wI(e,t){if(!Number.isFinite(e))return t;const n=e;return n>1e10?n:n*1e3}function tbt(e){var t,n;return((t=e.actions)==null?void 0:t.artifactDelta)??((n=e.actions)==null?void 0:n.artifact_delta)}function nbt(e){return`${e.replace(/\.pptx$/i,"")}.preview.webp`}function ibt(e){var t;return(((t=e.content)==null?void 0:t.parts)??[]).map(n=>n.functionResponse??n.function_response).filter(n=>!!n)}function rbt(e){if(!e)return{};const t=e.result;return t&&typeof t=="object"&&!Array.isArray(t)?t:e}function Fee(e,t,n){var i;if(/\.[A-Za-z0-9]{2,8}$/.test(e))return e;try{const r=new URL(t).pathname.split("/").filter(Boolean),o=((i=(r[r.length-1]??"").match(/\.[A-Za-z0-9]{2,8}$/))==null?void 0:i[0])??"";if(o)return`${e}${o}`}catch{}return`${e}.${n==="image"?"png":"mp4"}`}function sbt(e,t){const n=rbt(t),i=e==="image_generate"||e.endsWith("_image_generate"),r=["video_generate","video_task_query"].some(u=>e===u||e.endsWith(`_${u}`));if(!i&&!r)return[];const s=i?"image":"video",o=[],l=n.success_list;if(Array.isArray(l)){for(const u of l)if(!(!u||typeof u!="object"||Array.isArray(u)))for(const[d,f]of Object.entries(u))typeof f=="string"&&f.startsWith("https://")&&o.push({name:Fee(d,f,s),url:f,type:s})}const c=n.video_url;if(r&&typeof c=="string"&&c.startsWith("https://")){const u=typeof n.task_id=="string"?n.task_id:void 0;o.push({name:Fee(u||"generated-video",c,s),url:c,type:s,taskId:u})}return o}function Bee(e,t){return new Date(wI(e,t)||Date.now()).toISOString()}function abt(e,t){var r;const n=[],i=new Set;for(const s of e)for(const o of s.sessions){const l=wI(o.lastUpdateTime,Date.now()),c=iM(o.events,t);for(const u of o.events??[])for(const d of ibt(u)){const f=(d==null?void 0:d.name)??"";for(const h of sbt(f,d==null?void 0:d.response)){const m=`${o.id}:${u.id??""}:${f}:${h.url}`;i.has(m)||(i.add(m),n.push({sourceUrl:h.url,name:h.name,mimeType:h.type==="image"?"image/png":"video/mp4",appName:s.appName,agentId:s.agentId,agentName:((r=s.agentName)==null?void 0:r.trim())||s.appName,sessionId:o.id,sessionTitle:c,sessionUpdatedAt:Bee(o.lastUpdateTime,l),createdAt:Bee(u.timestamp,l),origin:{runtimeId:s.runtimeId,region:s.region,eventId:u.id,invocationId:u.invocationId??u.invocation_id,toolName:f,taskId:h.taskId}}))}}}return n}function JIe(e){const t=ZIe(e);return Zgt.has(t)?"image":Jgt.has(t)?"video":"document"}function obt(e){const t=JIe(e);return t==="image"?"image":t==="video"?"video":ebt.has(ZIe(e))?"frame":"unavailable"}function lbt(e,t,n="en-US"){var r;const i=[];for(const s of e)for(const o of s.sessions){const l=wI(o.lastUpdateTime,0),c=new Map;for(const u of o.events??[]){const d=tbt(u);if(!d)continue;const f=wI(u.timestamp,l);for(const[h,m]of Object.entries(d)){if(!h||!Number.isFinite(m))continue;const g=c.get(h);(!g||m>=g.version)&&c.set(h,{filename:h,version:m,createdAt:f})}}for(const u of c.values()){if(/\.preview\.webp$/i.test(u.filename))continue;const d=c.get(nbt(u.filename)),f=d??u,h=d?"image":obt(u.filename);i.push({id:`${s.appName}:${o.id}:${u.filename}:${u.version}`,appName:s.appName,agentId:s.agentId,sessionId:o.id,sessionTitle:iM(o.events,t),agentName:((r=s.agentName)==null?void 0:r.trim())||s.appName,sessionUpdatedAt:l,name:u.filename,version:u.version,type:JIe(u.filename),createdAt:u.createdAt||l,origin:{runtimeId:s.runtimeId,region:s.region},preview:{filename:f.filename,version:f.version,mode:h}})}}return i.sort((s,o)=>o.createdAt-s.createdAt||s.name.localeCompare(o.name,n))}function ePe(e,t,n){if(!e)return n;const i=new Date(e);if(Number.isNaN(i.getTime()))return n;const r=new Date;return i.getFullYear()===r.getFullYear()&&i.getMonth()===r.getMonth()&&i.getDate()===r.getDate()?new Intl.DateTimeFormat(t,{hour:"2-digit",minute:"2-digit",hour12:!1}).format(i):new Intl.DateTimeFormat(t,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}).format(i)}function tPe(e){return!e||e<=0?"":e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(e<10*1024*1024?1:0)} MB`:`${(e/(1024*1024*1024)).toFixed(1)} GB`}const c4=40;function cbt(e){return[{value:"all",label:e("artifactLibrary.types.all")},{value:"document",label:e("artifactLibrary.types.document")},{value:"image",label:e("artifactLibrary.types.image")},{value:"video",label:e("artifactLibrary.types.video")}]}function ubt(e,t){return e(`artifactLibrary.types.${t}`)}function b_(e){return e instanceof Error?e.message:String(e)}function nPe({artifact:e,large:t=!1}){return a.jsx("div",{className:`library-artifact-preview library-artifact-preview--${e.type}${t?" is-large":""}`,children:e.thumbnailUrl?a.jsxs(a.Fragment,{children:[a.jsx("img",{className:"library-artifact-preview-media",src:e.thumbnailUrl,alt:"",loading:"lazy"}),e.type==="video"?a.jsx("span",{className:"artifact-video-play is-overlay","aria-hidden":"true",children:a.jsx(Iee,{})}):null]}):e.type==="document"?a.jsxs("div",{className:"artifact-document-sheet","aria-hidden":"true",children:[a.jsx("span",{className:"is-title"}),a.jsx("span",{}),a.jsx("span",{}),a.jsx("span",{className:"is-short"})]}):e.type==="image"?a.jsxs("div",{className:"artifact-image-scene","aria-hidden":"true",children:[a.jsx("span",{className:"artifact-image-sun"}),a.jsx("span",{className:"artifact-image-plane artifact-image-plane--back"}),a.jsx("span",{className:"artifact-image-plane artifact-image-plane--front"})]}):a.jsxs("div",{className:"artifact-video-frame","aria-hidden":"true",children:[a.jsx("span",{className:"artifact-video-orbit"}),a.jsx("span",{className:"artifact-video-node artifact-video-node--one"}),a.jsx("span",{className:"artifact-video-node artifact-video-node--two"}),a.jsx("span",{className:"artifact-video-play",children:a.jsx(Iee,{})})]})})}function dbt({artifact:e,pendingAction:t,disabled:n,onPreview:i,onDownload:r,onEdit:s,onDelete:o,onOpenSource:l,t:c,locale:u}){const d=t===`download:${e.id}`;return a.jsxs("tr",{className:"library-artifact-row",children:[a.jsx("td",{className:"library-artifact-file",children:a.jsxs("button",{type:"button",className:"library-artifact-preview-trigger","aria-label":c("artifactLibrary.previewArtifact",{name:e.name}),disabled:n||!!t,onClick:()=>i(e),children:[a.jsx("div",{className:"library-artifact-thumbnail",children:a.jsx(nPe,{artifact:e})}),a.jsxs("div",{className:"library-artifact-row-title",children:[a.jsx("span",{className:"library-artifact-row-name",title:e.name,children:e.name}),a.jsx("span",{className:"library-artifact-row-size",children:tPe(e.sizeBytes)||"—"})]})]})}),a.jsx("td",{className:"library-artifact-source-cell",children:l?a.jsxs("button",{type:"button",className:"library-artifact-source-link",title:`${e.agentName} / ${e.sessionTitle}`,onClick:()=>l(e),children:[a.jsx("span",{children:e.agentName}),a.jsx("span",{"aria-hidden":"true",children:"/"}),a.jsx("span",{children:e.sessionTitle})]}):a.jsxs("span",{title:`${e.agentName} / ${e.sessionTitle}`,children:[e.agentName," / ",e.sessionTitle]})}),a.jsx("td",{className:"library-artifact-time",children:ePe(e.updatedAt??e.createdAt,u,c("artifactLibrary.unknownTime"))}),a.jsx("td",{className:"library-artifact-actions-cell",children:a.jsx("div",{className:"library-artifact-actions",children:a.jsx(BIe,{label:c("artifactLibrary.moreActions",{name:e.name}),menuLabel:c("artifactLibrary.actionMenu",{name:e.name}),placement:"bottom-end",items:[{label:c(d?"artifactLibrary.downloading":"artifactLibrary.download"),onSelect:()=>r(e),disabled:n||!!t},...s?[{label:c("artifactLibrary.edit"),onSelect:()=>s(e),disabled:n||!!t||e.canManage===!1}]:[],...o?[{label:c("artifactLibrary.delete"),onSelect:()=>o(e),disabled:n||!!t||e.canManage===!1,danger:!0}]:[]]})})})]})}function fbt({sources:e=[],items:t,userId:n="",active:i=!0,activationRevision:r=0,loading:s=!1,error:o="",onRetry:l,onEdit:c,onDelete:u,onDownload:d,onOpenSource:f,region:h,toolbarLeading:m,toolbarFilters:g}){var Ye,ye;const{t:b,i18n:v}=Te("workspaceTools"),y=v.resolvedLanguage||v.language,[w,x]=p.useState("all"),[O,k]=p.useState(""),[S,C]=p.useState(null),[E,j]=p.useState(""),[T,R]=p.useState(""),[A,N]=p.useState(""),[P,I]=p.useState(""),[D,_]=p.useState({}),[L,F]=p.useState(()=>new Set),[M,V]=p.useState(null),[q,U]=p.useState(!1),[J,z]=p.useState(""),[Z,ne]=p.useState(null),[W,G]=p.useState(!1),[H,se]=p.useState(c4),Y=p.useRef(null),X=p.useRef(null),ie=p.useRef(0),ee=p.useRef(null),be=p.useRef(null),ue=p.useRef(!1),pe=p.useCallback(()=>{ie.current+=1,C(null),j(""),R("")},[]),ke=p.useMemo(()=>t?[...t]:lbt(e,b("library.untitledSession"),y),[t,y,e,b]),je=p.useMemo(()=>ke.filter(we=>!L.has(we.id)).map(we=>D[we.id]??we),[ke,D,L]);p.useEffect(()=>()=>{ie.current+=1},[]),p.useEffect(()=>()=>{E&&URL.revokeObjectURL(E)},[E]),p.useEffect(()=>{var Ue;if(!S)return;const we=document.activeElement,Ae=document.body.style.overflow;document.body.style.overflow="hidden",(Ue=Y.current)==null||Ue.focus();const He=jt=>{if(jt.key==="Escape"){jt.preventDefault(),pe();return}if(jt.key!=="Tab")return;const Pt=X.current;if(!Pt)return;const Kt=Array.from(Pt.querySelectorAll('button:not([disabled]), video[controls], iframe, [tabindex]:not([tabindex="-1"])')).filter(tt=>tt.getClientRects().length>0);if(Kt.length===0){jt.preventDefault();return}const Ct=Kt[0],xt=Kt[Kt.length-1];jt.shiftKey&&document.activeElement===Ct?(jt.preventDefault(),xt.focus()):!jt.shiftKey&&document.activeElement===xt&&(jt.preventDefault(),Ct.focus())};return document.addEventListener("keydown",He),()=>{document.removeEventListener("keydown",He),document.body.style.overflow=Ae,we!=null&&we.isConnected&&we.focus()}},[pe,S]);const Pe=async we=>{const Ae=ie.current+1;if(ie.current=Ae,N(""),j(""),C(we),we.preview.mode!=="unavailable"){if(we.contentUrl){j(we.contentUrl);return}R(`preview:${we.id}`);try{const He=await Ez(we.appName,n,we.sessionId,we.preview.filename,we.preview.version);if(ie.current!==Ae){URL.revokeObjectURL(He);return}j(He)}catch(He){ie.current===Ae&&N(b("artifactLibrary.previewFailed",{name:we.name,message:b_(He)}))}finally{ie.current===Ae&&R("")}}},Ee=async we=>{N(""),R(`download:${we.id}`);try{d?await d(we):await Sz(we.appName,n,we.sessionId,we.name,we.version),I(b("artifactLibrary.downloadStarted",{name:we.name}))}catch(Ae){N(b("artifactLibrary.downloadFailed",{name:we.name,message:b_(Ae)}))}finally{R("")}},ze=async we=>{if(!(!M||!c)){U(!0),z("");try{const He=await c(M,we)??{...M,...we,updatedAt:Date.now()};_(Ue=>({...Ue,[M.id]:He})),I(b("artifactLibrary.updated",{name:He.name})),V(null)}catch(Ae){z(b_(Ae))}finally{U(!1)}}},_e=async()=>{if(!(!Z||!u)){G(!0),N("");try{await u(Z),F(we=>new Set([...we,Z.id])),I(b("artifactLibrary.deleted",{name:Z.name})),(S==null?void 0:S.id)===Z.id&&pe(),ne(null)}catch(we){N(b("artifactLibrary.deleteFailed",{name:Z.name,message:b_(we)})),ne(null)}finally{G(!1)}}},ae=p.useMemo(()=>{const we=O.trim().toLocaleLowerCase();return je.filter(Ae=>{var He;return(He=Ae.origin)!=null&&He.region&&Ae.origin.region!==h||w!=="all"&&Ae.type!==w?!1:we?[Ae.name,Ae.sessionTitle,Ae.agentName].some(Ue=>Ue.toLocaleLowerCase().includes(we)):!0})},[w,je,O,h]),le=p.useMemo(()=>ae.slice(0,H),[ae,H]),ge=H{ue.current||(ue.current=!0,se(we=>we+c4))},[]);p.useEffect(()=>{se(c4)},[r,w,O,ae.length]),p.useEffect(()=>{ue.current=!1},[H]),p.useEffect(()=>{const we=be.current,Ae=ee.current;if(!i||!we||!Ae||!ge)return;const He=new IntersectionObserver(([Ue])=>{Ue.isIntersecting&&Oe()},{root:Ae,rootMargin:"240px 0px",threshold:.01});return He.observe(we),()=>He.disconnect()},[i,ge,Oe,H]);const Se=()=>{const we=ee.current;!i||!we||!ge||we.scrollHeight-we.scrollTop-we.clientHeight<=240&&Oe()},We=!!O.trim()||w!=="all"||je.some(we=>{var Ae;return((Ae=we.origin)==null?void 0:Ae.region)&&we.origin.region!==h});return a.jsxs("div",{className:"artifact-library-page resource-collection",children:[a.jsxs(sb,{className:"artifact-library-toolbar library-resource-toolbar",children:[m,a.jsxs("div",{className:"resource-toolbar__actions",children:[a.jsx(ob,{id:"artifact-type-filter",ariaLabel:b("artifactLibrary.typeFilter"),value:w,options:cbt(b),onChange:x}),g,a.jsx(Zp,{"aria-label":b("artifactLibrary.searchAria"),value:O,onChange:we=>k(we.target.value),placeholder:b("artifactLibrary.searchPlaceholder")})]})]}),o&&je.length>0?a.jsxs("div",{className:"artifact-library-banner",role:"alert",children:[a.jsx("span",{children:o}),l?a.jsx("button",{type:"button",onClick:l,children:b("artifactLibrary.retry")}):null]}):null,A?a.jsxs("div",{className:"artifact-library-banner",role:"alert",children:[a.jsx("span",{children:A}),a.jsx("button",{type:"button",onClick:()=>N(""),children:b("artifactLibrary.close")})]}):null,a.jsx(Jp,{ref:ee,className:"artifact-library-results","aria-label":b("artifactLibrary.listAria"),onScroll:Se,children:a.jsxs("div",{className:"artifact-library-panel",children:[s&&je.length===0?a.jsx(cl,{}):o&&je.length===0?a.jsxs("div",{className:"artifact-library-empty is-error",role:"alert",children:[a.jsx("p",{children:b("artifactLibrary.loadFailed")}),a.jsx("span",{children:o}),l?a.jsx("button",{type:"button",onClick:l,children:b("artifactLibrary.reload")}):null]}):ae.length===0?a.jsxs("div",{className:"artifact-library-empty",children:[a.jsx("p",{children:b(We?"artifactLibrary.noMatch":"artifactLibrary.noArtifacts")}),a.jsx("span",{children:b(We?"artifactLibrary.searchHint":"artifactLibrary.emptyHint")})]}):a.jsx("div",{className:"artifact-library-list",children:a.jsxs("table",{className:"artifact-library-table",children:[a.jsxs("colgroup",{children:[a.jsx("col",{className:"artifact-library-table__file-column"}),a.jsx("col",{className:"artifact-library-table__source-column"}),a.jsx("col",{className:"artifact-library-table__time-column"}),a.jsx("col",{className:"artifact-library-table__actions-column"})]}),a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:b("artifactLibrary.columns.name")}),a.jsx("th",{scope:"col",children:b("artifactLibrary.columns.source")}),a.jsx("th",{scope:"col",children:b("artifactLibrary.columns.updatedAt")}),a.jsx("th",{scope:"col",className:"artifact-library-table__actions-heading",children:b("artifactLibrary.columns.actions")})]})}),a.jsx("tbody",{children:le.map(we=>a.jsx(dbt,{artifact:we,pendingAction:T,disabled:!n&&!t,onPreview:Ae=>void Pe(Ae),onDownload:Ae=>void Ee(Ae),onEdit:c?Ae=>{z(""),V(Ae)}:void 0,onDelete:u?ne:void 0,onOpenSource:f,t:b,locale:y},we.id))})]})}),ge?a.jsx("div",{ref:be,className:"artifact-library-load-more",role:"status","aria-live":"polite",children:a.jsx(fn,{as:"span",duration:2.4,children:b("artifactLibrary.loadingMore")})}):null]})}),a.jsx("p",{className:"artifact-library-status","aria-live":"polite",children:P}),S?a.jsxs("div",{className:"artifact-library-preview-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"artifact-library-preview-title",children:[a.jsx("button",{type:"button",className:"artifact-library-preview-backdrop","aria-label":b("artifactLibrary.preview.close"),onClick:pe}),a.jsxs("div",{ref:X,className:"artifact-library-preview-panel",children:[a.jsxs("header",{children:[a.jsxs("div",{children:[a.jsx("h2",{id:"artifact-library-preview-title",children:S.name}),a.jsx("p",{children:b("artifactLibrary.preview.meta",{type:ubt(b,S.type),version:S.version})})]}),a.jsx("button",{ref:Y,type:"button","aria-label":b("artifactLibrary.preview.close"),onClick:pe,children:a.jsx(FIe,{})})]}),a.jsxs("div",{className:"artifact-library-preview-content",children:[a.jsx("div",{className:"artifact-library-preview-canvas",children:T===`preview:${S.id}`?a.jsx(fn,{as:"span",duration:2.4,children:b("artifactLibrary.preview.loading")}):E&&S.preview.mode==="image"?a.jsx("img",{src:E,alt:b("artifactLibrary.preview.alt",{name:S.name})}):E&&S.preview.mode==="video"?a.jsx("video",{src:E,controls:!0,"aria-label":b("artifactLibrary.preview.alt",{name:S.name})}):E&&S.preview.mode==="frame"?a.jsx("iframe",{src:E,title:b("artifactLibrary.preview.alt",{name:S.name})}):a.jsxs("div",{className:"artifact-library-preview-unavailable",children:[a.jsx(nPe,{artifact:S,large:!0}),a.jsx("p",{children:b(A?"artifactLibrary.preview.loadFailed":"artifactLibrary.preview.unsupported")})]})}),a.jsxs("aside",{className:"artifact-library-preview-details","aria-label":b("artifactLibrary.preview.sourceAria"),children:[S.description?a.jsx("p",{className:"artifact-library-preview-description",children:S.description}):null,a.jsxs("dl",{children:[a.jsxs("div",{children:[a.jsx("dt",{children:b("artifactLibrary.preview.agent")}),a.jsx("dd",{title:S.agentName,children:S.agentName})]}),a.jsxs("div",{children:[a.jsx("dt",{children:b("artifactLibrary.preview.session")}),a.jsx("dd",{title:S.sessionTitle,children:S.sessionTitle})]}),(Ye=S.origin)!=null&&Ye.toolName?a.jsxs("div",{children:[a.jsx("dt",{children:b("artifactLibrary.preview.tool")}),a.jsx("dd",{children:S.origin.toolName})]}):null,a.jsxs("div",{children:[a.jsx("dt",{children:b("artifactLibrary.preview.createdAt")}),a.jsx("dd",{children:ePe(S.createdAt,y,b("artifactLibrary.unknownTime"))})]}),S.sizeBytes?a.jsxs("div",{children:[a.jsx("dt",{children:b("artifactLibrary.preview.fileSize")}),a.jsx("dd",{children:tPe(S.sizeBytes)})]}):null]}),(ye=S.tags)!=null&&ye.length?a.jsx("div",{className:"artifact-library-preview-tags","aria-label":b("artifactLibrary.preview.tags"),children:S.tags.map(we=>a.jsx("span",{children:we},we))}):null]})]}),a.jsxs("footer",{children:[a.jsxs("div",{className:"artifact-library-preview-footer-start",children:[f?a.jsxs("button",{type:"button",className:"is-secondary",onClick:()=>{const we=S;pe(),f(we)},children:[a.jsx(Lmt,{}),b("artifactLibrary.preview.viewSession")]}):null,c?a.jsxs("button",{type:"button",className:"is-secondary",disabled:S.canManage===!1,onClick:()=>{const we=S;pe(),z(""),V(we)},children:[a.jsx(xI,{}),b("artifactLibrary.edit")]}):null]}),a.jsxs("button",{type:"button",disabled:T.startsWith("download:")||!n&&!t,onClick:()=>void Ee(S),children:[a.jsx(Mmt,{}),b("artifactLibrary.download")]})]})]})]}):null,M?a.jsx(Bmt,{artifact:M,busy:q,error:J,onClose:()=>{q||V(null)},onSave:we=>void ze(we)}):null,Z?a.jsx(Cd,{title:b("artifactLibrary.deleteDialog.title"),description:b("artifactLibrary.deleteDialog.description",{name:Z.name}),confirmLabel:b(W?"artifactLibrary.deleteDialog.deleting":"artifactLibrary.deleteDialog.confirm"),closeLabel:b("artifactLibrary.deleteDialog.close"),variant:"danger",busy:W,onCancel:()=>{W||ne(null)},onConfirm:()=>void _e()}):null]})}bn.hasResourceBundle("en-US","workspaceTools")||bn.addResourceBundle("en-US","workspaceTools",Mbe,!0,!0);bn.hasResourceBundle("zh-CN","workspaceTools")||bn.addResourceBundle("zh-CN","workspaceTools",QOe,!0,!0);function Tb(e,t={}){return bn.t(e,{...t,ns:"workspaceTools"})}function hbt(e,t){if(e&&typeof e=="object"&&"detail"in e){const n=e.detail;if(typeof n=="string"&&n.trim())return n}return t}async function lT(e,t){if(e.ok)return e;let n;try{n=await e.json()}catch{n=void 0}throw new Error(hbt(n,Tb("artifactLibrary.api.withStatus",{message:t,status:e.status})))}function u4(e){if(typeof e=="number")return e;if(typeof e!="string")return 0;const t=Date.parse(e);return Number.isFinite(t)?t:0}function iPe(e){const t=e;return{...t,createdAt:u4(t.createdAt),updatedAt:u4(t.updatedAt),sessionUpdatedAt:u4(t.sessionUpdatedAt)}}async function rPe(e){const t=await e.json();return Array.isArray(t.items)?t.items.map(iPe):[]}async function pbt(){const e=await lT(await yn("/web/artifacts"),Tb("artifactLibrary.api.listFailed"));return rPe(e)}async function mbt(e){if(e.length===0)return pbt();const t=await lT(await yn("/web/artifacts/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({candidates:e})},24e4),Tb("artifactLibrary.api.syncFailed"));return rPe(t)}async function gbt(e,t){const n=await lT(await yn(`/web/artifacts/${encodeURIComponent(e.id)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),Tb("artifactLibrary.api.updateFailed"));return iPe(await n.json())}async function bbt(e){await lT(await yn(`/web/artifacts/${encodeURIComponent(e.id)}`,{method:"DELETE"}),Tb("artifactLibrary.api.deleteFailed"))}async function ybt(e){const n=await(await lT(await yn(`/web/artifacts/${encodeURIComponent(e.id)}/content?download=true`,{},24e4),Tb("artifactLibrary.api.downloadFailed"))).blob(),i=URL.createObjectURL(n),r=document.createElement("a");r.href=i,r.download=e.name,document.body.appendChild(r),r.click(),r.remove(),window.setTimeout(()=>URL.revokeObjectURL(i),0)}const sPe="KNOWLEDGE_PROVIDER_ASSOCIATION_INVALID";class bM extends Error{constructor(n,i,r={}){super(n);Zt(this,"status");Zt(this,"errorCode");Zt(this,"requestId");Zt(this,"diagnostics");Zt(this,"detail");Zt(this,"payload");Zt(this,"rawBody");this.name="KnowledgeRequestError",this.status=i;const s=typeof r=="string"?{errorCode:r}:r;this.errorCode=s.errorCode||"",this.requestId=s.requestId||"",this.diagnostics=s.diagnostics,this.detail=s.detail,this.payload=s.payload,this.rawBody=s.rawBody||""}}class aPe extends Error{constructor(n){super(n.map(({region:i,error:r})=>`${i}: ${r.message||Q("knowledge.loadFailed")}`).join(` +`));Zt(this,"failures");this.name="KnowledgeRegionAggregateError",this.failures=n}}const vbt=new Set(["ak","apikey","sk","accesskey","accesskeyid","authorization","authkey","clientsecret","cookie","credential","credentials","password","passwd","privatekey","secret","secretaccesskey","secretkey","securitytoken","sessiontoken","setcookie","token"]),xbt=6,Uee=50,oPe=4e3;function wbt(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}function Obt(e){const t=wbt(e);return vbt.has(t)||t.endsWith("password")||t.endsWith("secret")||t.endsWith("token")||t.endsWith("credential")}function kbt(e){return/<\s*(?:!doctype|html|head|body|script|style)\b/i.test(e)}function dS(e){if(kbt(e))return Q("knowledge.htmlHidden");const t=Q("knowledge.redacted");return e.replace(/\bBearer\s+[^\s,;]+/gi,`Bearer ${t}`).replace(/\b(?:set-)?cookie\s*:\s*[^\r\n]*/gi,`cookie: ${t}`).replace(/\bAKLT[A-Za-z0-9_-]{6,}\b/g,t).replace(/((?:access[_-]?key(?:[_-]?id)?|secret(?:[_-]?(?:access)?[_-]?key)?|session[_-]?token|security[_-]?token|client[_-]?secret|api[_-]?key|authorization|cookie|[a-z0-9_-]*(?:password|secret|token)|credential|ak|sk)\s*[:=]\s*)(?:"[^"]*"|'[^']*'|[^\s,;&]+)/gi,`$1${t}`).replace(/([?&](?:access[_-]?key|api[_-]?key|client[_-]?secret|security[_-]?token|session[_-]?token|secret|token|password|authorization|cookie|credential)=)[^&#\s]+/gi,`$1${t}`)}function LB(e,t=0,n=new WeakSet){if(e===null||typeof e=="number"||typeof e=="boolean")return e;if(typeof e=="string")return dS(e).slice(0,oPe);if(typeof e!="object")return;if(t>=xbt)return Q("knowledge.depthTruncated");if(n.has(e))return Q("knowledge.circularReference");if(n.add(e),Array.isArray(e))return e.slice(0,Uee).map(r=>LB(r,t+1,n));const i={};return Object.entries(e).slice(0,Uee).forEach(([r,s])=>{i[r]=Obt(r)?Q("knowledge.redacted"):LB(s,t+1,n)}),i}function Qee(e){if(e===void 0)return"";const t=LB(e);if(typeof t=="string")return t;if(t===void 0)return"";try{return JSON.stringify(t).slice(0,oPe)}catch{return Q("knowledge.diagnosticsUnavailable")}}function El(e,t){if(e instanceof aPe)return e.failures.map(({region:o,error:l})=>`${o} +${El(l,t)}`).join(` + +`);if(!(e instanceof bM))return(e instanceof Error?dS(e.message):"")||t;const n=dS(e.message)||t,i=[Number.isFinite(e.status)?Q("knowledge.statusCode",{status:e.status}):"",e.errorCode?Q("knowledge.errorCode",{code:dS(e.errorCode)}):"",e.requestId?Q("knowledge.requestId",{requestId:dS(e.requestId)}):""].filter(Boolean).join(" · "),r=Qee(e.diagnostics),s=Qee(e.detail);return[n,i,r?Q("knowledge.diagnostics",{diagnostics:r}):"",s&&s!==n?Q("knowledge.detail",{detail:s}):""].filter(Boolean).join(` +`)}function AN(...e){for(const t of e)if(typeof t=="string"&&t.trim())return t.trim();return""}function Sbt(e){return Array.isArray(e)?e.map(t=>{const n=Ad(t),i=AN(n.msg,n.message);if(!i)return"";const r=Array.isArray(n.loc)?n.loc.filter(s=>typeof s=="string"||typeof s=="number").map(String).join("."):"";return r?`${r}: ${i}`:i}).filter(Boolean).join("; "):""}function Ebt(e,t=!0){const n=Ad(e),i=Object.prototype.hasOwnProperty.call(n,"detail")?n.detail:typeof e=="string"?e:void 0,r=Ad(i);return{message:typeof i=="string"?t?i.trim():"":AN(r.message,n.message,Sbt(i)),errorCode:AN(r.errorCode,n.errorCode),requestId:AN(r.requestId,r.request_id,r.RequestId,n.requestId,n.request_id),diagnostics:r.diagnostics??n.diagnostics,detail:i,payload:e}}function Ad(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}}function ar(e){return typeof e=="string"?e:""}function xC(e,t){return typeof e=="number"&&Number.isFinite(e)?e:t}function OH(e){const t=Ad(e);return{id:ar(t.id),name:ar(t.name),description:ar(t.description),providerType:ar(t.providerType),providerKnowledgeId:ar(t.providerKnowledgeId),projectName:ar(t.projectName),region:ar(t.region),status:ar(t.status),createdAt:ar(t.createdAt),updatedAt:ar(t.updatedAt),ownerId:ar(t.ownerId),ownerLabel:ar(t.ownerLabel),canManage:t.canManage===!0}}function cT(e){const t=Ad(e);return{id:ar(t.id),name:ar(t.name),type:ar(t.type),sizeBytes:xC(t.sizeBytes,0),status:ar(t.status),url:ar(t.url),tosPath:ar(t.tosPath),metadata:Ad(t.metadata),createdAt:ar(t.createdAt),updatedAt:ar(t.updatedAt),sourceMarkdown:ar(t.sourceMarkdown)}}function Cbt(e){const t=Ad(e),n=t.attachment,i=Ad(n);return{id:ar(t.id),title:ar(t.title),content:ar(t.content),attachmentUrl:ar(t.attachmentUrl)||ar(i.url)||ar(i.previewUrl),attachmentType:ar(t.attachmentType)||ar(i.type)||ar(i.mimeType),attachment:n,tableFields:t.tableFields}}async function Af(e,t={},n=ho){var f;const i=ul(uc(t.headers));i.set("accept","application/json"),t.body&&!(t.body instanceof FormData)&&i.set("content-type","application/json");const r=await fetch(e,{...t,headers:i,signal:po(t.signal,n)});if(r.ok)return r.status===204?void 0:r.json();const s=await r.text();let o=s,l=!1;if(s)try{o=JSON.parse(s),l=!0}catch{}const c=((f=r.headers.get("content-type"))==null?void 0:f.toLowerCase())||"",u=Ebt(o,l||c.startsWith("text/plain")),d=r.status===401?Q("knowledge.signInRequired"):r.status===403?Q("knowledge.forbidden"):r.status===404?Q("knowledge.notFound"):r.status===409?Q("knowledge.conflict"):Q("knowledge.requestFailed",{status:r.status});throw new bM(u.message||d,r.status,{errorCode:u.errorCode,requestId:u.requestId,diagnostics:u.diagnostics,detail:u.detail,payload:u.payload,rawBody:s})}function K0(e){const t=new URLSearchParams;e.trim()&&t.set("region",e.trim());const n=t.toString();return n?`?${n}`:""}async function Abt(e){var r;const t=new URLSearchParams({region:e.region,pageSize:String(e.pageSize??30)});(r=e.projectName)!=null&&r.trim()&&t.set("projectName",e.projectName.trim()),e.nextToken&&t.set("nextToken",e.nextToken);const n=await Af(`/web/knowledge-bases?${t.toString()}`,{signal:e.signal}),i=Ad(n);return{items:Array.isArray(i.items)?i.items.map(OH):[],nextToken:ar(i.nextToken)}}function Tbt(e){return`${e.region}\0${e.id}`}async function _bt(e){var l;const t=[...new Set(e.regions.map(c=>c.trim()).filter(Boolean))],n=e.nextTokens?t.filter(c=>{var u;return!!((u=e.nextTokens)!=null&&u[c])}):t;if(n.length===0)return{items:[],nextTokens:{},failures:[]};const i=await Promise.allSettled(n.map(async c=>{var u;return{region:c,page:await Abt({region:c,projectName:e.projectName,nextToken:(u=e.nextTokens)==null?void 0:u[c],pageSize:e.pageSize,signal:e.signal})}}));if((l=e.signal)!=null&&l.aborted)throw new DOMException("Aborted","AbortError");const r=[],s={},o=new Map;if(i.forEach((c,u)=>{var f;const d=n[u];if(c.status==="rejected"){const h=(f=e.nextTokens)==null?void 0:f[d];h&&(s[d]=h),r.push({region:d,error:c.reason instanceof Error?c.reason:new Error(Q("knowledge.loadFailed"))});return}c.value.page.nextToken&&(s[d]=c.value.page.nextToken),c.value.page.items.forEach(h=>{const m=h.region?h:{...h,region:d};o.set(Tbt(m),m)})}),r.length===n.length)throw new aPe(r);return{items:[...o.values()],nextTokens:s,failures:r}}function jbt(e){return Af("/web/knowledge-bases",{method:"POST",body:JSON.stringify(e)},hr).then(OH)}function Nbt(e,t,n){return Af(`/web/knowledge-bases/${encodeURIComponent(e)}${K0(t)}`,{method:"PATCH",body:JSON.stringify(n)}).then(OH)}function Rbt(e,t){return Af(`/web/knowledge-bases/${encodeURIComponent(e)}${K0(t)}`,{method:"DELETE"},hr)}async function Ibt(e,t){var s;const n=new URLSearchParams({region:t.region,offset:String(t.offset??0),limit:String(t.limit??30)});(s=t.documentType)!=null&&s.trim()&&n.set("documentType",t.documentType.trim());const i=await Af(`/web/knowledge-bases/${encodeURIComponent(e)}/documents?${n.toString()}`,{signal:t.signal}),r=Ad(i);return{items:Array.isArray(r.items)?r.items.map(cT):[],offset:xC(r.offset,0),limit:xC(r.limit,t.limit??30),hasMore:r.hasMore===!0}}async function Pbt(e,t,n){const i=new URLSearchParams({region:n.region,offset:String(n.offset??0),limit:String(n.limit??20)}),r=await Af(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/${encodeURIComponent(t)}/preview?${i.toString()}`,{signal:n.signal}),s=Ad(r);return{document:cT(s.document),chunks:Array.isArray(s.chunks)?s.chunks.map(Cbt):[],sourceMarkdown:ar(s.sourceMarkdown),offset:xC(s.offset,0),limit:xC(s.limit,n.limit??20),hasMore:s.hasMore===!0}}function Dbt(e,t,n){return Af(`/web/knowledge-bases/${encodeURIComponent(e)}/documents${K0(t)}`,{method:"POST",body:JSON.stringify(n)},hr).then(cT)}async function Mbt(e,t,n){const i=await Af(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/web-preview${K0(t)}`,{method:"POST",body:JSON.stringify({sourceType:"url",url:n.url})},hr),r=Ad(i);return{name:ar(r.name),url:ar(r.url),sourceMarkdown:ar(r.sourceMarkdown)}}function Lbt(e,t,n){var r,s;const i=new FormData;return i.set("file",n.file),(r=n.name)!=null&&r.trim()&&i.set("name",n.name.trim()),(s=n.documentType)!=null&&s.trim()&&i.set("documentType",n.documentType.trim()),n.metadata&&i.set("metadata",JSON.stringify(n.metadata)),Af(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/upload${K0(t)}`,{method:"POST",body:i},hr).then(cT)}function $bt(e,t,n,i){return Af(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/${encodeURIComponent(t)}${K0(n)}`,{method:"PATCH",body:JSON.stringify(i)}).then(cT)}function Fbt(e,t,n){return Af(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/${encodeURIComponent(t)}${K0(n)}`,{method:"DELETE"},hr)}function G0({className:e="",title:t,status:n,description:i,metadata:r,detailAction:s,action:o,auxiliaryAction:l}){return a.jsxs(vH,{className:`library-resource-card ${e}`.trim(),activateLabel:`${s.label} ${t}`,onActivate:s.disabled?void 0:s.onClick,footer:a.jsx(YIe,{items:r.map(c=>({label:c.label,value:c.value,title:c.title,hideLabel:!0}))}),actions:a.jsxs(a.Fragment,{children:[l?a.jsx(MB,{className:"library-resource-card__auxiliary-action",label:`${l.label} ${t}`,tone:"secondary",disabled:l.disabled,title:l.title??l.label,onClick:l.onClick,children:l.icon}):null,o?a.jsx(MB,{label:`${o.label} ${t}`,icon:o.icon,disabled:o.disabled,title:o.title,onClick:o.onClick}):null]}),children:[a.jsx(xH,{leading:a.jsx(t1,{seed:t}),title:t,titleText:t,status:n}),a.jsx(wH,{title:i,children:i})]})}function Shn(){}function zee(e){const t=[],n=String(e||"");let i=n.indexOf(","),r=0,s=!1;for(;!s;){i===-1&&(i=n.length,s=!0);const o=n.slice(r,i).trim();(o||!s)&&t.push(o),r=i+1,i=n.indexOf(",",r)}return t}function lPe(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Bbt=/[$_\p{ID_Start}]/u,Ubt=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,Qbt=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,zbt=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Vbt=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,cPe={};function Ehn(e){return e?Bbt.test(String.fromCodePoint(e)):!1}function Chn(e,t){const i=(t||cPe).jsx?Qbt:Ubt;return e?i.test(String.fromCodePoint(e)):!1}function Vee(e,t){return(cPe.jsx?Vbt:zbt).test(e)}const Hbt=/[ \t\n\f\r]/g;function qbt(e){return typeof e=="object"?e.type==="text"?Hee(e.value):!1:Hee(e)}function Hee(e){return e.replace(Hbt,"")===""}let uT=class{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}};uT.prototype.normal={};uT.prototype.property={};uT.prototype.space=void 0;function uPe(e,t){const n={},i={};for(const r of e)Object.assign(n,r.property),Object.assign(i,r.normal);return new uT(n,i,t)}function wC(e){return e.toLowerCase()}class qc{constructor(t,n){this.attribute=n,this.property=t}}qc.prototype.attribute="";qc.prototype.booleanish=!1;qc.prototype.boolean=!1;qc.prototype.commaOrSpaceSeparated=!1;qc.prototype.commaSeparated=!1;qc.prototype.defined=!1;qc.prototype.mustUseProperty=!1;qc.prototype.number=!1;qc.prototype.overloadedBoolean=!1;qc.prototype.property="";qc.prototype.spaceSeparated=!1;qc.prototype.space=void 0;let Wbt=0;const _i=X0(),Ha=X0(),$B=X0(),Ut=X0(),ms=X0(),fw=X0(),lu=X0();function X0(){return 2**++Wbt}const FB=Object.freeze(Object.defineProperty({__proto__:null,boolean:_i,booleanish:Ha,commaOrSpaceSeparated:lu,commaSeparated:fw,number:Ut,overloadedBoolean:$B,spaceSeparated:ms},Symbol.toStringTag,{value:"Module"})),d4=Object.keys(FB);class kH extends qc{constructor(t,n,i,r){let s=-1;if(super(t,n),qee(this,"space",r),typeof i=="number")for(;++s4&&n.slice(0,4)==="data"&&Zbt.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(Wee,eyt);i="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!Wee.test(s)){let o=s.replace(Ybt,Jbt);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}r=kH}return new r(i,t)}function Jbt(e){return"-"+e.toLowerCase()}function eyt(e){return e.charAt(1).toUpperCase()}const dT=uPe([dPe,Kbt,pPe,mPe,gPe],"html"),_b=uPe([dPe,Gbt,pPe,mPe,gPe],"svg");function Kee(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function bPe(e){return e.join(" ").trim()}var SH={},Gee=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,tyt=/\n/g,nyt=/^\s*/,iyt=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,ryt=/^:\s*/,syt=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,ayt=/^[;\s]*/,oyt=/^\s+|\s+$/g,lyt=` +`,Xee="/",Yee="*",xy="",cyt="comment",uyt="declaration";function dyt(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,i=1;function r(g){var b=g.match(tyt);b&&(n+=b.length);var v=g.lastIndexOf(lyt);i=~v?g.length-v:i+g.length}function s(){var g={line:n,column:i};return function(b){return b.position=new o(g),u(),b}}function o(g){this.start=g,this.end={line:n,column:i},this.source=t.source}o.prototype.content=e;function l(g){var b=new Error(t.source+":"+n+":"+i+": "+g);if(b.reason=g,b.filename=t.source,b.line=n,b.column=i,b.source=e,!t.silent)throw b}function c(g){var b=g.exec(e);if(b){var v=b[0];return r(v),e=e.slice(v.length),b}}function u(){c(nyt)}function d(g){var b;for(g=g||[];b=f();)b!==!1&&g.push(b);return g}function f(){var g=s();if(!(Xee!=e.charAt(0)||Yee!=e.charAt(1))){for(var b=2;xy!=e.charAt(b)&&(Yee!=e.charAt(b)||Xee!=e.charAt(b+1));)++b;if(b+=2,xy===e.charAt(b-1))return l("End of comment missing");var v=e.slice(2,b-2);return i+=2,r(v),e=e.slice(b),i+=2,g({type:cyt,comment:v})}}function h(){var g=s(),b=c(iyt);if(b){if(f(),!c(ryt))return l("property missing ':'");var v=c(syt),y=g({type:uyt,property:Zee(b[0].replace(Gee,xy)),value:v?Zee(v[0].replace(Gee,xy)):xy});return c(ayt),y}}function m(){var g=[];d(g);for(var b;b=h();)b!==!1&&(g.push(b),d(g));return g}return u(),m()}function Zee(e){return e?e.replace(oyt,xy):xy}var fyt=dyt,hyt=cg&&cg.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(SH,"__esModule",{value:!0});SH.default=myt;const pyt=hyt(fyt);function myt(e,t){let n=null;if(!e||typeof e!="string")return n;const i=(0,pyt.default)(e),r=typeof t=="function";return i.forEach(s=>{if(s.type!=="declaration")return;const{property:o,value:l}=s;r?t(o,l,s):l&&(n=n||{},n[o]=l)}),n}var vM={};Object.defineProperty(vM,"__esModule",{value:!0});vM.camelCase=void 0;var gyt=/^--[a-zA-Z0-9_-]+$/,byt=/-([a-z])/g,yyt=/^[^-]+$/,vyt=/^-(webkit|moz|ms|o|khtml)-/,xyt=/^-(ms)-/,wyt=function(e){return!e||yyt.test(e)||gyt.test(e)},Oyt=function(e,t){return t.toUpperCase()},Jee=function(e,t){return"".concat(t,"-")},kyt=function(e,t){return t===void 0&&(t={}),wyt(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(xyt,Jee):e=e.replace(vyt,Jee),e.replace(byt,Oyt))};vM.camelCase=kyt;var Syt=cg&&cg.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Eyt=Syt(SH),Cyt=vM;function BB(e,t){var n={};return!e||typeof e!="string"||(0,Eyt.default)(e,function(i,r){i&&r&&(n[(0,Cyt.camelCase)(i,t)]=r)}),n}BB.default=BB;var Ayt=BB;const Tyt=T1(Ayt),xM=yPe("end"),jh=yPe("start");function yPe(e){return t;function t(n){const i=n&&n.position&&n.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function _yt(e){const t=jh(e),n=xM(e);if(t&&n)return{start:t,end:n}}function aE(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ete(e.position):"start"in e||"end"in e?ete(e):"line"in e||"column"in e?UB(e):""}function UB(e){return tte(e&&e.line)+":"+tte(e&&e.column)}function ete(e){return UB(e&&e.start)+"-"+UB(e&&e.end)}function tte(e){return e&&typeof e=="number"?e:1}class Nl extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let r="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?r=t:!s.cause&&t&&(o=!0,r=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof i=="string"){const c=i.indexOf(":");c===-1?s.ruleId=i:(s.source=i.slice(0,c),s.ruleId=i.slice(c+1))}if(!s.place&&s.ancestors&&s.ancestors){const c=s.ancestors[s.ancestors.length-1];c&&(s.place=c.position)}const l=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=l?l.line:void 0,this.name=aE(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Nl.prototype.file="";Nl.prototype.name="";Nl.prototype.reason="";Nl.prototype.message="";Nl.prototype.stack="";Nl.prototype.column=void 0;Nl.prototype.line=void 0;Nl.prototype.ancestors=void 0;Nl.prototype.cause=void 0;Nl.prototype.fatal=void 0;Nl.prototype.place=void 0;Nl.prototype.ruleId=void 0;Nl.prototype.source=void 0;const EH={}.hasOwnProperty,jyt=new Map,Nyt=/[A-Z]/g,Ryt=new Set(["table","tbody","thead","tfoot","tr"]),Iyt=new Set(["td","th"]),vPe="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Pyt(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let i;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=Qyt(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=Uyt(n,t.jsx,t.jsxs)}const r={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?_b:dT,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=xPe(r,e,void 0);return s&&typeof s!="string"?s:r.create(e,r.Fragment,{children:s||void 0},void 0)}function xPe(e,t,n){if(t.type==="element")return Dyt(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Myt(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return $yt(e,t,n);if(t.type==="mdxjsEsm")return Lyt(e,t);if(t.type==="root")return Fyt(e,t,n);if(t.type==="text")return Byt(e,t)}function Dyt(e,t,n){const i=e.schema;let r=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(r=_b,e.schema=r),e.ancestors.push(t);const s=OPe(e,t.tagName,!1),o=zyt(e,t);let l=AH(e,t);return Ryt.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!qbt(c):!0})),wPe(e,o,s,t),CH(o,l),e.ancestors.pop(),e.schema=i,e.create(t,s,o,n)}function Myt(e,t){if(t.data&&t.data.estree&&e.evaluater){const i=t.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}OC(e,t.position)}function Lyt(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);OC(e,t.position)}function $yt(e,t,n){const i=e.schema;let r=i;t.name==="svg"&&i.space==="html"&&(r=_b,e.schema=r),e.ancestors.push(t);const s=t.name===null?e.Fragment:OPe(e,t.name,!0),o=Vyt(e,t),l=AH(e,t);return wPe(e,o,s,t),CH(o,l),e.ancestors.pop(),e.schema=i,e.create(t,s,o,n)}function Fyt(e,t,n){const i={};return CH(i,AH(e,t)),e.create(t,e.Fragment,i,n)}function Byt(e,t){return t.value}function wPe(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function CH(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Uyt(e,t,n){return i;function i(r,s,o,l){const u=Array.isArray(o.children)?n:t;return l?u(s,o,l):u(s,o)}}function Qyt(e,t){return n;function n(i,r,s,o){const l=Array.isArray(s.children),c=jh(i);return t(r,s,o,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function zyt(e,t){const n={};let i,r;for(r in t.properties)if(r!=="children"&&EH.call(t.properties,r)){const s=Hyt(e,r,t.properties[r]);if(s){const[o,l]=s;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&Iyt.has(t.tagName)?i=l:n[o]=l}}if(i){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function Vyt(e,t){const n={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const s=i.data.estree.body[0];s.type;const o=s.expression;o.type;const l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else OC(e,t.position);else{const r=i.name;let s;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const l=i.value.data.estree.body[0];l.type,s=e.evaluater.evaluateExpression(l.expression)}else OC(e,t.position);else s=i.value===null?!0:i.value;n[r]=s}return n}function AH(e,t){const n=[];let i=-1;const r=e.passKeys?new Map:jyt;for(;++ir?0:r+t:t=t>r?r:t,n=n>0?n:0,i.length<1e4)o=Array.from(i),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);s0?(ju(e,e.length,0,t),e):t}const rte={}.hasOwnProperty;function SPe(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function pf(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Jl=jb(/[A-Za-z]/),Tl=jb(/[\dA-Za-z]/),e0t=jb(/[#-'*+\--9=?A-Z^-~]/);function OI(e){return e!==null&&(e<32||e===127)}const QB=jb(/\d/),t0t=jb(/[\dA-Fa-f]/),n0t=jb(/[!-/:-@[-`{-~]/);function Kn(e){return e!==null&&e<-2}function cs(e){return e!==null&&(e<0||e===32)}function Gi(e){return e===-2||e===-1||e===32}const wM=jb(new RegExp("\\p{P}|\\p{S}","u")),g0=jb(/\s/);function jb(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function nO(e){const t=[];let n=-1,i=0,r=0;for(;++n55295&&s<57344){const l=e.charCodeAt(n+1);s<56320&&l>56319&&l<57344?(o=String.fromCharCode(s,l),r=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(i,n),encodeURIComponent(o)),i=n+r+1,o=""),r&&(n+=r,r=0)}return t.join("")+e.slice(i)}function dr(e,t,n,i){const r=i?i-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(c){return Gi(c)?(e.enter(n),l(c)):t(c)}function l(c){return Gi(c)&&s++o))return;const C=t.events.length;let E=C,j,T;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){if(j){T=t.events[E][1].end;break}j=!0}for(y(i),S=C;Sx;){const k=n[O];t.containerState=k[1],k[0].exit.call(t,e)}n.length=x}function w(){r.write([null]),s=void 0,r=void 0,t.containerState._closeFlow=void 0}}function o0t(e,t,n){return dr(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function n1(e){if(e===null||cs(e)||g0(e))return 1;if(wM(e))return 2}function OM(e,t,n){const i=[];let r=-1;for(;++r1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[i][1].end},h={...e[n][1].start};ate(f,-c),ate(h,c),o={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[i][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},s={type:c>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},r={type:c>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[i][1].end={...o.start},e[n][1].start={...l.end},u=[],e[i][1].end.offset-e[i][1].start.offset&&(u=nd(u,[["enter",e[i][1],t],["exit",e[i][1],t]])),u=nd(u,[["enter",r,t],["enter",o,t],["exit",o,t],["enter",s,t]]),u=nd(u,OM(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),u=nd(u,[["exit",s,t],["enter",l,t],["exit",l,t],["exit",r,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=nd(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,ju(e,i-1,n-i+3,u),n=i+u.length-d-2;break}}for(n=-1;++n0&&Gi(S)?dr(e,w,"linePrefix",s+1)(S):w(S)}function w(S){return S===null||Kn(S)?e.check(ote,b,O)(S):(e.enter("codeFlowValue"),x(S))}function x(S){return S===null||Kn(S)?(e.exit("codeFlowValue"),w(S)):(e.consume(S),x)}function O(S){return e.exit("codeFenced"),t(S)}function k(S,C,E){let j=0;return T;function T(I){return S.enter("lineEnding"),S.consume(I),S.exit("lineEnding"),R}function R(I){return S.enter("codeFencedFence"),Gi(I)?dr(S,A,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):A(I)}function A(I){return I===l?(S.enter("codeFencedFenceSequence"),N(I)):E(I)}function N(I){return I===l?(j++,S.consume(I),N):j>=o?(S.exit("codeFencedFenceSequence"),Gi(I)?dr(S,P,"whitespace")(I):P(I)):E(I)}function P(I){return I===null||Kn(I)?(S.exit("codeFencedFence"),C(I)):E(I)}}}function v0t(e,t,n){const i=this;return r;function r(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return i.parser.lazy[i.now().line]?n(o):t(o)}}const h4={name:"codeIndented",tokenize:w0t},x0t={partial:!0,tokenize:O0t};function w0t(e,t,n){const i=this;return r;function r(u){return e.enter("codeIndented"),dr(e,s,"linePrefix",5)(u)}function s(u){const d=i.events[i.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?o(u):n(u)}function o(u){return u===null?c(u):Kn(u)?e.attempt(x0t,o,c)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||Kn(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),l)}function c(u){return e.exit("codeIndented"),t(u)}}function O0t(e,t,n){const i=this;return r;function r(o){return i.parser.lazy[i.now().line]?n(o):Kn(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r):dr(e,s,"linePrefix",5)(o)}function s(o){const l=i.events[i.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):Kn(o)?r(o):n(o)}}const k0t={name:"codeText",previous:E0t,resolve:S0t,tokenize:C0t};function S0t(e){let t=e.length-4,n=3,i,r;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const r=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return i&&mk(this.left,i),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),mk(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),mk(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(o):e.interrupt(i.parser.constructs.flow,n,t)(o)}}function jPe(e,t,n,i,r,s,o,l,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return f;function f(y){return y===60?(e.enter(i),e.enter(r),e.enter(s),e.consume(y),e.exit(s),h):y===null||y===32||y===41||OI(y)?n(y):(e.enter(i),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),b(y))}function h(y){return y===62?(e.enter(s),e.consume(y),e.exit(s),e.exit(r),e.exit(i),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===62?(e.exit("chunkString"),e.exit(l),h(y)):y===null||y===60||Kn(y)?n(y):(e.consume(y),y===92?g:m)}function g(y){return y===60||y===62||y===92?(e.consume(y),m):m(y)}function b(y){return!d&&(y===null||y===41||cs(y))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(i),t(y)):d999||m===null||m===91||m===93&&!c||m===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(m):m===93?(e.exit(s),e.enter(r),e.consume(m),e.exit(r),e.exit(i),t):Kn(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(m))}function f(m){return m===null||m===91||m===93||Kn(m)||l++>999?(e.exit("chunkString"),d(m)):(e.consume(m),c||(c=!Gi(m)),m===92?h:f)}function h(m){return m===91||m===92||m===93?(e.consume(m),l++,f):f(m)}}function RPe(e,t,n,i,r,s){let o;return l;function l(h){return h===34||h===39||h===40?(e.enter(i),e.enter(r),e.consume(h),e.exit(r),o=h===40?41:h,c):n(h)}function c(h){return h===o?(e.enter(r),e.consume(h),e.exit(r),e.exit(i),t):(e.enter(s),u(h))}function u(h){return h===o?(e.exit(s),c(o)):h===null?n(h):Kn(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),dr(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===o||h===null||Kn(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?f:d)}function f(h){return h===o||h===92?(e.consume(h),d):d(h)}}function oE(e,t){let n;return i;function i(r){return Kn(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),n=!0,i):Gi(r)?dr(e,i,n?"linePrefix":"lineSuffix")(r):t(r)}}const P0t={name:"definition",tokenize:M0t},D0t={partial:!0,tokenize:L0t};function M0t(e,t,n){const i=this;let r;return s;function s(m){return e.enter("definition"),o(m)}function o(m){return NPe.call(i,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function l(m){return r=pf(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),c):n(m)}function c(m){return cs(m)?oE(e,u)(m):u(m)}function u(m){return jPe(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function d(m){return e.attempt(D0t,f,f)(m)}function f(m){return Gi(m)?dr(e,h,"whitespace")(m):h(m)}function h(m){return m===null||Kn(m)?(e.exit("definition"),i.parser.defined.push(r),t(m)):n(m)}}function L0t(e,t,n){return i;function i(l){return cs(l)?oE(e,r)(l):n(l)}function r(l){return RPe(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return Gi(l)?dr(e,o,"whitespace")(l):o(l)}function o(l){return l===null||Kn(l)?t(l):n(l)}}const $0t={name:"hardBreakEscape",tokenize:F0t};function F0t(e,t,n){return i;function i(s){return e.enter("hardBreakEscape"),e.consume(s),r}function r(s){return Kn(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const B0t={name:"headingAtx",resolve:U0t,tokenize:Q0t};function U0t(e,t){let n=e.length-2,i=3,r,s;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(r={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},s={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},ju(e,i,n-i+1,[["enter",r,t],["enter",s,t],["exit",s,t],["exit",r,t]])),e}function Q0t(e,t,n){let i=0;return r;function r(d){return e.enter("atxHeading"),s(d)}function s(d){return e.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&i++<6?(e.consume(d),o):d===null||cs(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||Kn(d)?(e.exit("atxHeading"),t(d)):Gi(d)?dr(e,l,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function c(d){return d===35?(e.consume(d),c):(e.exit("atxHeadingSequence"),l(d))}function u(d){return d===null||d===35||cs(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),u)}}const z0t=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],cte=["pre","script","style","textarea"],V0t={concrete:!0,name:"htmlFlow",resolveTo:W0t,tokenize:K0t},H0t={partial:!0,tokenize:X0t},q0t={partial:!0,tokenize:G0t};function W0t(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function K0t(e,t,n){const i=this;let r,s,o,l,c;return u;function u(U){return d(U)}function d(U){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(U),f}function f(U){return U===33?(e.consume(U),h):U===47?(e.consume(U),s=!0,b):U===63?(e.consume(U),r=3,i.interrupt?t:M):Jl(U)?(e.consume(U),o=String.fromCharCode(U),v):n(U)}function h(U){return U===45?(e.consume(U),r=2,m):U===91?(e.consume(U),r=5,l=0,g):Jl(U)?(e.consume(U),r=4,i.interrupt?t:M):n(U)}function m(U){return U===45?(e.consume(U),i.interrupt?t:M):n(U)}function g(U){const J="CDATA[";return U===J.charCodeAt(l++)?(e.consume(U),l===J.length?i.interrupt?t:A:g):n(U)}function b(U){return Jl(U)?(e.consume(U),o=String.fromCharCode(U),v):n(U)}function v(U){if(U===null||U===47||U===62||cs(U)){const J=U===47,z=o.toLowerCase();return!J&&!s&&cte.includes(z)?(r=1,i.interrupt?t(U):A(U)):z0t.includes(o.toLowerCase())?(r=6,J?(e.consume(U),y):i.interrupt?t(U):A(U)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(U):s?w(U):x(U))}return U===45||Tl(U)?(e.consume(U),o+=String.fromCharCode(U),v):n(U)}function y(U){return U===62?(e.consume(U),i.interrupt?t:A):n(U)}function w(U){return Gi(U)?(e.consume(U),w):T(U)}function x(U){return U===47?(e.consume(U),T):U===58||U===95||Jl(U)?(e.consume(U),O):Gi(U)?(e.consume(U),x):T(U)}function O(U){return U===45||U===46||U===58||U===95||Tl(U)?(e.consume(U),O):k(U)}function k(U){return U===61?(e.consume(U),S):Gi(U)?(e.consume(U),k):x(U)}function S(U){return U===null||U===60||U===61||U===62||U===96?n(U):U===34||U===39?(e.consume(U),c=U,C):Gi(U)?(e.consume(U),S):E(U)}function C(U){return U===c?(e.consume(U),c=null,j):U===null||Kn(U)?n(U):(e.consume(U),C)}function E(U){return U===null||U===34||U===39||U===47||U===60||U===61||U===62||U===96||cs(U)?k(U):(e.consume(U),E)}function j(U){return U===47||U===62||Gi(U)?x(U):n(U)}function T(U){return U===62?(e.consume(U),R):n(U)}function R(U){return U===null||Kn(U)?A(U):Gi(U)?(e.consume(U),R):n(U)}function A(U){return U===45&&r===2?(e.consume(U),D):U===60&&r===1?(e.consume(U),_):U===62&&r===4?(e.consume(U),V):U===63&&r===3?(e.consume(U),M):U===93&&r===5?(e.consume(U),F):Kn(U)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(H0t,q,N)(U)):U===null||Kn(U)?(e.exit("htmlFlowData"),N(U)):(e.consume(U),A)}function N(U){return e.check(q0t,P,q)(U)}function P(U){return e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),I}function I(U){return U===null||Kn(U)?N(U):(e.enter("htmlFlowData"),A(U))}function D(U){return U===45?(e.consume(U),M):A(U)}function _(U){return U===47?(e.consume(U),o="",L):A(U)}function L(U){if(U===62){const J=o.toLowerCase();return cte.includes(J)?(e.consume(U),V):A(U)}return Jl(U)&&o.length<8?(e.consume(U),o+=String.fromCharCode(U),L):A(U)}function F(U){return U===93?(e.consume(U),M):A(U)}function M(U){return U===62?(e.consume(U),V):U===45&&r===2?(e.consume(U),M):A(U)}function V(U){return U===null||Kn(U)?(e.exit("htmlFlowData"),q(U)):(e.consume(U),V)}function q(U){return e.exit("htmlFlow"),t(U)}}function G0t(e,t,n){const i=this;return r;function r(o){return Kn(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return i.parser.lazy[i.now().line]?n(o):t(o)}}function X0t(e,t,n){return i;function i(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(fT,t,n)}}const Y0t={name:"htmlText",tokenize:Z0t};function Z0t(e,t,n){const i=this;let r,s,o;return l;function l(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),c}function c(M){return M===33?(e.consume(M),u):M===47?(e.consume(M),k):M===63?(e.consume(M),x):Jl(M)?(e.consume(M),E):n(M)}function u(M){return M===45?(e.consume(M),d):M===91?(e.consume(M),s=0,g):Jl(M)?(e.consume(M),w):n(M)}function d(M){return M===45?(e.consume(M),m):n(M)}function f(M){return M===null?n(M):M===45?(e.consume(M),h):Kn(M)?(o=f,_(M)):(e.consume(M),f)}function h(M){return M===45?(e.consume(M),m):f(M)}function m(M){return M===62?D(M):M===45?h(M):f(M)}function g(M){const V="CDATA[";return M===V.charCodeAt(s++)?(e.consume(M),s===V.length?b:g):n(M)}function b(M){return M===null?n(M):M===93?(e.consume(M),v):Kn(M)?(o=b,_(M)):(e.consume(M),b)}function v(M){return M===93?(e.consume(M),y):b(M)}function y(M){return M===62?D(M):M===93?(e.consume(M),y):b(M)}function w(M){return M===null||M===62?D(M):Kn(M)?(o=w,_(M)):(e.consume(M),w)}function x(M){return M===null?n(M):M===63?(e.consume(M),O):Kn(M)?(o=x,_(M)):(e.consume(M),x)}function O(M){return M===62?D(M):x(M)}function k(M){return Jl(M)?(e.consume(M),S):n(M)}function S(M){return M===45||Tl(M)?(e.consume(M),S):C(M)}function C(M){return Kn(M)?(o=C,_(M)):Gi(M)?(e.consume(M),C):D(M)}function E(M){return M===45||Tl(M)?(e.consume(M),E):M===47||M===62||cs(M)?j(M):n(M)}function j(M){return M===47?(e.consume(M),D):M===58||M===95||Jl(M)?(e.consume(M),T):Kn(M)?(o=j,_(M)):Gi(M)?(e.consume(M),j):D(M)}function T(M){return M===45||M===46||M===58||M===95||Tl(M)?(e.consume(M),T):R(M)}function R(M){return M===61?(e.consume(M),A):Kn(M)?(o=R,_(M)):Gi(M)?(e.consume(M),R):j(M)}function A(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),r=M,N):Kn(M)?(o=A,_(M)):Gi(M)?(e.consume(M),A):(e.consume(M),P)}function N(M){return M===r?(e.consume(M),r=void 0,I):M===null?n(M):Kn(M)?(o=N,_(M)):(e.consume(M),N)}function P(M){return M===null||M===34||M===39||M===60||M===61||M===96?n(M):M===47||M===62||cs(M)?j(M):(e.consume(M),P)}function I(M){return M===47||M===62||cs(M)?j(M):n(M)}function D(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):n(M)}function _(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),L}function L(M){return Gi(M)?dr(e,F,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):F(M)}function F(M){return e.enter("htmlTextData"),o(M)}}const jH={name:"labelEnd",resolveAll:nvt,resolveTo:ivt,tokenize:rvt},J0t={tokenize:svt},evt={tokenize:avt},tvt={tokenize:ovt};function nvt(e){let t=-1;const n=[];for(;++t=3&&(u===null||Kn(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===r?(e.consume(u),i++,c):(e.exit("thematicBreakSequence"),Gi(u)?dr(e,l,"whitespace")(u):l(u))}}const Oc={continuation:{tokenize:bvt},exit:vvt,name:"list",tokenize:gvt},pvt={partial:!0,tokenize:xvt},mvt={partial:!0,tokenize:yvt};function gvt(e,t,n){const i=this,r=i.events[i.events.length-1];let s=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,o=0;return l;function l(m){const g=i.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!i.containerState.marker||m===i.containerState.marker:QB(m)){if(i.containerState.type||(i.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(TN,n,u)(m):u(m);if(!i.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(m)}return n(m)}function c(m){return QB(m)&&++o<10?(e.consume(m),c):(!i.interrupt||o<2)&&(i.containerState.marker?m===i.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):n(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||m,e.check(fT,i.interrupt?n:d,e.attempt(pvt,h,f))}function d(m){return i.containerState.initialBlankLine=!0,s++,h(m)}function f(m){return Gi(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),h):n(m)}function h(m){return i.containerState.size=s+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function bvt(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(fT,r,s);function r(l){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,dr(e,t,"listItemIndent",i.containerState.size+1)(l)}function s(l){return i.containerState.furtherBlankLines||!Gi(l)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,o(l)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(mvt,t,o)(l))}function o(l){return i.containerState._closeFlow=!0,i.interrupt=void 0,dr(e,e.attempt(Oc,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function yvt(e,t,n){const i=this;return dr(e,r,"listItemIndent",i.containerState.size+1);function r(s){const o=i.events[i.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===i.containerState.size?t(s):n(s)}}function vvt(e){e.exit(this.containerState.type)}function xvt(e,t,n){const i=this;return dr(e,r,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(s){const o=i.events[i.events.length-1];return!Gi(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const ute={name:"setextUnderline",resolveTo:wvt,tokenize:Ovt};function wvt(e,t){let n=e.length,i,r,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(r=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",s?(e.splice(r,0,["enter",o,t]),e.splice(s+1,0,["exit",e[i][1],t]),e[i][1].end={...e[s][1].end}):e[i][1]=o,e.push(["exit",o,t]),e}function Ovt(e,t,n){const i=this;let r;return s;function s(u){let d=i.events.length,f;for(;d--;)if(i.events[d][1].type!=="lineEnding"&&i.events[d][1].type!=="linePrefix"&&i.events[d][1].type!=="content"){f=i.events[d][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||f)?(e.enter("setextHeadingLine"),r=u,o(u)):n(u)}function o(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===r?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),Gi(u)?dr(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Kn(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const kvt={tokenize:Svt};function Svt(e){const t=this,n=e.attempt(fT,i,e.attempt(this.parser.constructs.flowInitial,r,dr(e,e.attempt(this.parser.constructs.flow,r,e.attempt(_0t,r)),"linePrefix")));return n;function i(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Evt={resolveAll:PPe()},Cvt=IPe("string"),Avt=IPe("text");function IPe(e){return{resolveAll:PPe(e==="text"?Tvt:void 0),tokenize:t};function t(n){const i=this,r=this.parser.constructs[e],s=n.attempt(r,o,l);return o;function o(d){return u(d)?s(d):l(d)}function l(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),c}function c(d){return u(d)?(n.exit("data"),s(d)):(n.consume(d),c)}function u(d){if(d===null)return!0;const f=r[d];let h=-1;if(f)for(;++h-1){const l=o[0];typeof l=="string"?o[0]=l.slice(i):o.shift()}s>0&&o.push(e[r].slice(0,s))}return o}function Uvt(e,t){let n=-1;const i=[];let r;for(;++n0){const Xe=Oe.tokenStack[Oe.tokenStack.length-1];(Xe[1]||fte).call(Oe,void 0,Xe[0])}for(ge.position={start:Lm(le.length>0?le[0][1].start:{line:1,column:1,offset:0}),end:Lm(le.length>0?le[le.length-2][1].end:{line:1,column:1,offset:0})},qe=-1;++qe0){const Ye=Oe.tokenStack[Oe.tokenStack.length-1];(Ye[1]||fte).call(Oe,void 0,Ye[0])}for(ge.position={start:Mm(le.length>0?le[0][1].start:{line:1,column:1,offset:0}),end:Mm(le.length>0?le[le.length-2][1].end:{line:1,column:1,offset:0})},We=-1;++We0&&(i.className=["language-"+r[0]]);let s={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function txt(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nxt(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ixt(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),r=eO(i.toLowerCase()),s=e.footnoteOrder.indexOf(i);let o,l=e.footnoteCounts.get(i);l===void 0?(l=0,e.footnoteOrder.push(i),o=e.footnoteOrder.length):o=s+1,l+=1,e.footnoteCounts.set(i,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+r,id:n+"fnref-"+r+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function rxt(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function sxt(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function LPe(e,t){const n=t.referenceType;let i="]";if(n==="collapsed"?i+="[]":n==="full"&&(i+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+i}];const r=e.all(t),s=r[0];s&&s.type==="text"?s.value="["+s.value:r.unshift({type:"text",value:"["});const o=r[r.length-1];return o&&o.type==="text"?o.value+=i:r.push({type:"text",value:i}),r}function axt(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return LPe(e,t);const r={src:eO(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,s),e.applyData(t,s)}function oxt(e,t){const n={src:eO(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,i),e.applyData(t,i)}function lxt(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const i={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,i),e.applyData(t,i)}function cxt(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return LPe(e,t);const r={href:eO(i.url||"")};i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function uxt(e,t){const n={href:eO(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function dxt(e,t,n){const i=e.all(t),r=n?fxt(n):$Pe(t),s={},o=[];if(typeof t.checked=="boolean"){const d=i[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},i.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let l=-1;for(;++l0&&(i.className=["language-"+r[0]]);let s={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function txt(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nxt(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ixt(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),r=nO(i.toLowerCase()),s=e.footnoteOrder.indexOf(i);let o,l=e.footnoteCounts.get(i);l===void 0?(l=0,e.footnoteOrder.push(i),o=e.footnoteOrder.length):o=s+1,l+=1,e.footnoteCounts.set(i,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+r,id:n+"fnref-"+r+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function rxt(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function sxt(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function LPe(e,t){const n=t.referenceType;let i="]";if(n==="collapsed"?i+="[]":n==="full"&&(i+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+i}];const r=e.all(t),s=r[0];s&&s.type==="text"?s.value="["+s.value:r.unshift({type:"text",value:"["});const o=r[r.length-1];return o&&o.type==="text"?o.value+=i:r.push({type:"text",value:i}),r}function axt(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return LPe(e,t);const r={src:nO(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,s),e.applyData(t,s)}function oxt(e,t){const n={src:nO(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,i),e.applyData(t,i)}function lxt(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const i={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,i),e.applyData(t,i)}function cxt(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return LPe(e,t);const r={href:nO(i.url||"")};i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function uxt(e,t){const n={href:nO(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function dxt(e,t,n){const i=e.all(t),r=n?fxt(n):$Pe(t),s={},o=[];if(typeof t.checked=="boolean"){const d=i[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},i.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let l=-1;for(;++l1}function hxt(e,t){const n={},i=e.all(t);let r=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++r0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=_h(t.children[1]),c=vM(t.children[t.children.length-1]);l&&c&&(o.position={start:l,end:c}),r.push(o)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function yxt(e,t,n){const i=n?n.children:void 0,s=(i?i.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,l=o?o.length:t.children.length;let c=-1;const u=[];for(;++c0,!0),i[0]),r=i.index+i[0].length,i=n.exec(t);return s.push(mte(t.slice(r),r>0,!1)),s.join("")}function mte(e,t,n){let i=0,r=e.length;if(t){let s=e.codePointAt(i);for(;s===hte||s===pte;)i++,s=e.codePointAt(i)}if(n){let s=e.codePointAt(r-1);for(;s===hte||s===pte;)r--,s=e.codePointAt(r-1)}return r>i?e.slice(i,r):""}function wxt(e,t){const n={type:"text",value:xxt(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Oxt(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const kxt={blockquote:Zvt,break:Jvt,code:ext,delete:txt,emphasis:nxt,footnoteReference:ixt,heading:rxt,html:sxt,imageReference:axt,image:oxt,inlineCode:lxt,linkReference:cxt,link:uxt,listItem:dxt,list:hxt,paragraph:pxt,root:mxt,strong:gxt,table:bxt,tableCell:vxt,tableRow:yxt,text:wxt,thematicBreak:Oxt,toml:b_,yaml:b_,definition:b_,footnoteDefinition:b_};function b_(){}const FPe=-1,OM=0,iE=1,OI=2,NH=3,RH=4,IH=5,PH=6,BPe=7,UPe=8,Sxt=typeof self=="object"?self:globalThis,gte=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Sxt[e](t)},Ext=(e,t)=>{const n=(r,s)=>(e.set(s,r),r),i=r=>{if(e.has(r))return e.get(r);const[s,o]=t[r];switch(s){case OM:case FPe:return n(o,r);case iE:{const l=n([],r);for(const c of o)l.push(i(c));return l}case OI:{const l=n({},r);for(const[c,u]of o)l[i(c)]=i(u);return l}case NH:return n(new Date(o),r);case RH:{const{source:l,flags:c}=o;return n(new RegExp(l,c),r)}case IH:{const l=n(new Map,r);for(const[c,u]of o)l.set(i(c),i(u));return l}case PH:{const l=n(new Set,r);for(const c of o)l.add(i(c));return l}case BPe:{const{name:l,message:c}=o;return n(gte(l,c),r)}case UPe:return n(BigInt(o),r);case"BigInt":return n(Object(BigInt(o)),r);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return n(new DataView(l),o)}}return n(gte(s,o),r)};return i},bte=e=>Ext(new Map,e)(0),Mv="",{toString:Cxt}={},{keys:Axt}=Object,dk=e=>{const t=typeof e;if(t!=="object"||!e)return[OM,t];const n=Cxt.call(e).slice(8,-1);switch(n){case"Array":return[iE,Mv];case"Object":return[OI,Mv];case"Date":return[NH,Mv];case"RegExp":return[RH,Mv];case"Map":return[IH,Mv];case"Set":return[PH,Mv];case"DataView":return[iE,n]}return n.includes("Array")?[iE,n]:n.includes("Error")?[BPe,n]:[OI,n]},y_=([e,t])=>e===OM&&(t==="function"||t==="symbol"),Txt=(e,t,n,i)=>{const r=(o,l)=>{const c=i.push(o)-1;return n.set(l,c),c},s=o=>{if(n.has(o))return n.get(o);let[l,c]=dk(o);switch(l){case OM:{let d=o;switch(c){case"bigint":l=UPe,d=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return r([FPe],o)}return r([l,d],o)}case iE:{if(c){let h=o;return c==="DataView"?h=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(h=new Uint8Array(o)),r([c,[...h]],o)}const d=[],f=r([l,d],o);for(const h of o)d.push(s(h));return f}case OI:{if(c)switch(c){case"BigInt":return r([c,o.toString()],o);case"Boolean":case"Number":case"String":return r([c,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const d=[],f=r([l,d],o);for(const h of Axt(o))(e||!y_(dk(o[h])))&&d.push([s(h),s(o[h])]);return f}case NH:return r([l,o.toISOString()],o);case RH:{const{source:d,flags:f}=o;return r([l,{source:d,flags:f}],o)}case IH:{const d=[],f=r([l,d],o);for(const[h,m]of o)(e||!(y_(dk(h))||y_(dk(m))))&&d.push([s(h),s(m)]);return f}case PH:{const d=[],f=r([l,d],o);for(const h of o)(e||!y_(dk(h)))&&d.push(s(h));return f}}const{message:u}=o;return r([l,{name:c,message:u}],o)};return s},yte=(e,{json:t,lossy:n}={})=>{const i=[];return Txt(!(t||n),!!t,new Map,i)(e),i},t1=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?bte(yte(e,t)):structuredClone(e):(e,t)=>bte(yte(e,t));function _xt(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function jxt(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Nxt(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||_xt,i=e.options.footnoteBackLabel||jxt,r=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c0&&g.push({type:"text",value:" "});let w=typeof n=="string"?n:n(c,m);typeof w=="string"&&(w={type:"text",value:w}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(c,m),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const v=d[d.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const w=v.children[v.children.length-1];w&&w.type==="text"?w.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...g)}else d.push(...g);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,y),l.push(y)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...t1(o),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:` +`});const u={type:"element",tagName:"li",properties:s,children:o};return e.patch(t,u),e.applyData(t,u)}function fxt(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let i=-1;for(;!t&&++i1}function hxt(e,t){const n={},i=e.all(t);let r=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++r0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=jh(t.children[1]),c=xM(t.children[t.children.length-1]);l&&c&&(o.position={start:l,end:c}),r.push(o)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function yxt(e,t,n){const i=n?n.children:void 0,s=(i?i.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,l=o?o.length:t.children.length;let c=-1;const u=[];for(;++c0,!0),i[0]),r=i.index+i[0].length,i=n.exec(t);return s.push(mte(t.slice(r),r>0,!1)),s.join("")}function mte(e,t,n){let i=0,r=e.length;if(t){let s=e.codePointAt(i);for(;s===hte||s===pte;)i++,s=e.codePointAt(i)}if(n){let s=e.codePointAt(r-1);for(;s===hte||s===pte;)r--,s=e.codePointAt(r-1)}return r>i?e.slice(i,r):""}function wxt(e,t){const n={type:"text",value:xxt(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Oxt(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const kxt={blockquote:Zvt,break:Jvt,code:ext,delete:txt,emphasis:nxt,footnoteReference:ixt,heading:rxt,html:sxt,imageReference:axt,image:oxt,inlineCode:lxt,linkReference:cxt,link:uxt,listItem:dxt,list:hxt,paragraph:pxt,root:mxt,strong:gxt,table:bxt,tableCell:vxt,tableRow:yxt,text:wxt,thematicBreak:Oxt,toml:y_,yaml:y_,definition:y_,footnoteDefinition:y_};function y_(){}const FPe=-1,kM=0,lE=1,kI=2,NH=3,RH=4,IH=5,PH=6,BPe=7,UPe=8,Sxt=typeof self=="object"?self:globalThis,gte=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Sxt[e](t)},Ext=(e,t)=>{const n=(r,s)=>(e.set(s,r),r),i=r=>{if(e.has(r))return e.get(r);const[s,o]=t[r];switch(s){case kM:case FPe:return n(o,r);case lE:{const l=n([],r);for(const c of o)l.push(i(c));return l}case kI:{const l=n({},r);for(const[c,u]of o)l[i(c)]=i(u);return l}case NH:return n(new Date(o),r);case RH:{const{source:l,flags:c}=o;return n(new RegExp(l,c),r)}case IH:{const l=n(new Map,r);for(const[c,u]of o)l.set(i(c),i(u));return l}case PH:{const l=n(new Set,r);for(const c of o)l.add(i(c));return l}case BPe:{const{name:l,message:c}=o;return n(gte(l,c),r)}case UPe:return n(BigInt(o),r);case"BigInt":return n(Object(BigInt(o)),r);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return n(new DataView(l),o)}}return n(gte(s,o),r)};return i},bte=e=>Ext(new Map,e)(0),$v="",{toString:Cxt}={},{keys:Axt}=Object,gk=e=>{const t=typeof e;if(t!=="object"||!e)return[kM,t];const n=Cxt.call(e).slice(8,-1);switch(n){case"Array":return[lE,$v];case"Object":return[kI,$v];case"Date":return[NH,$v];case"RegExp":return[RH,$v];case"Map":return[IH,$v];case"Set":return[PH,$v];case"DataView":return[lE,n]}return n.includes("Array")?[lE,n]:n.includes("Error")?[BPe,n]:[kI,n]},v_=([e,t])=>e===kM&&(t==="function"||t==="symbol"),Txt=(e,t,n,i)=>{const r=(o,l)=>{const c=i.push(o)-1;return n.set(l,c),c},s=o=>{if(n.has(o))return n.get(o);let[l,c]=gk(o);switch(l){case kM:{let d=o;switch(c){case"bigint":l=UPe,d=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return r([FPe],o)}return r([l,d],o)}case lE:{if(c){let h=o;return c==="DataView"?h=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(h=new Uint8Array(o)),r([c,[...h]],o)}const d=[],f=r([l,d],o);for(const h of o)d.push(s(h));return f}case kI:{if(c)switch(c){case"BigInt":return r([c,o.toString()],o);case"Boolean":case"Number":case"String":return r([c,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const d=[],f=r([l,d],o);for(const h of Axt(o))(e||!v_(gk(o[h])))&&d.push([s(h),s(o[h])]);return f}case NH:return r([l,o.toISOString()],o);case RH:{const{source:d,flags:f}=o;return r([l,{source:d,flags:f}],o)}case IH:{const d=[],f=r([l,d],o);for(const[h,m]of o)(e||!(v_(gk(h))||v_(gk(m))))&&d.push([s(h),s(m)]);return f}case PH:{const d=[],f=r([l,d],o);for(const h of o)(e||!v_(gk(h)))&&d.push(s(h));return f}}const{message:u}=o;return r([l,{name:c,message:u}],o)};return s},yte=(e,{json:t,lossy:n}={})=>{const i=[];return Txt(!(t||n),!!t,new Map,i)(e),i},i1=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?bte(yte(e,t)):structuredClone(e):(e,t)=>bte(yte(e,t));function _xt(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function jxt(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Nxt(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||_xt,i=e.options.footnoteBackLabel||jxt,r=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c0&&g.push({type:"text",value:" "});let w=typeof n=="string"?n:n(c,m);typeof w=="string"&&(w={type:"text",value:w}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(c,m),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const v=d[d.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const w=v.children[v.children.length-1];w&&w.type==="text"?w.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...g)}else d.push(...g);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,y),l.push(y)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...i1(o),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:` -`}]}}const lT=function(e){if(e==null)return Dxt;if(typeof e=="function")return kM(e);if(typeof e=="object")return Array.isArray(e)?Rxt(e):Ixt(e);if(typeof e=="string")return Pxt(e);throw new Error("Expected function, string, or object as test")};function Rxt(e){const t=[];let n=-1;for(;++n":""))+")"})}return h;function h(){let m=QPe,g,b,v;if((!t||s(c,u,d[d.length-1]||void 0))&&(m=Fxt(n(c,d)),m[0]===VB))return m;if("children"in c&&c.children){const y=c;if(y.children&&m[0]!==$xt)for(b=(i?y.children.length:-1)+o,v=d.concat(y);b>-1&&b":""))+")"})}return h;function h(){let m=QPe,g,b,v;if((!t||s(c,u,d[d.length-1]||void 0))&&(m=Fxt(n(c,d)),m[0]===VB))return m;if("children"in c&&c.children){const y=c;if(y.children&&m[0]!==$xt)for(b=(i?y.children.length:-1)+o,v=d.concat(y);b>-1&&b0&&n.push({type:"text",value:` `}),n}function vte(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function xte(e,t){const n=Uxt(e,t),i=n.one(e,void 0),r=Nxt(n),s=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return r&&s.children.push({type:"text",value:` -`},r),s}function qxt(e,t){return e&&"run"in e?async function(n,i){const r=xte(n,{file:i,...t});await e.run(r,i)}:function(n,i){return xte(n,{file:i,...e||t})}}function wte(e){if(e)throw e}var TN=Object.prototype.hasOwnProperty,VPe=Object.prototype.toString,Ote=Object.defineProperty,kte=Object.getOwnPropertyDescriptor,Ste=function(t){return typeof Array.isArray=="function"?Array.isArray(t):VPe.call(t)==="[object Array]"},Ete=function(t){if(!t||VPe.call(t)!=="[object Object]")return!1;var n=TN.call(t,"constructor"),i=t.constructor&&t.constructor.prototype&&TN.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!i)return!1;var r;for(r in t);return typeof r>"u"||TN.call(t,r)},Cte=function(t,n){Ote&&n.name==="__proto__"?Ote(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Ate=function(t,n){if(n==="__proto__")if(TN.call(t,n)){if(kte)return kte(t,n).value}else return;return t[n]},Wxt=function e(){var t,n,i,r,s,o,l=arguments[0],c=1,u=arguments.length,d=!1;for(typeof l=="boolean"&&(d=l,l=arguments[1]||{},c=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});co.length;let c;l&&o.push(r);try{c=e.apply(this,o)}catch(u){const d=u;if(l&&n)throw d;return r(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(s,r):c instanceof Error?r(c):s(c))}function r(o,...l){n||(n=!0,t(o,...l))}function s(o){r(null,o)}}const Wf={basename:Xxt,dirname:Yxt,extname:Zxt,join:Jxt,sep:"/"};function Xxt(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');uT(e);let n=0,i=-1,r=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;r--;)if(e.codePointAt(r)===47){if(s){n=r+1;break}}else i<0&&(s=!0,i=r+1);return i<0?"":e.slice(n,i)}if(t===e)return"";let o=-1,l=t.length-1;for(;r--;)if(e.codePointAt(r)===47){if(s){n=r+1;break}}else o<0&&(s=!0,o=r+1),l>-1&&(e.codePointAt(r)===t.codePointAt(l--)?l<0&&(i=r):(l=-1,i=o));return n===i?i=o:i<0&&(i=e.length),e.slice(n,i)}function Yxt(e){if(uT(e),e.length===0)return".";let t=-1,n=e.length,i;for(;--n;)if(e.codePointAt(n)===47){if(i){t=n;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Zxt(e){uT(e);let t=e.length,n=-1,i=0,r=-1,s=0,o;for(;t--;){const l=e.codePointAt(t);if(l===47){if(o){i=t+1;break}continue}n<0&&(o=!0,n=t+1),l===46?r<0?r=t:s!==1&&(s=1):r>-1&&(s=-1)}return r<0||n<0||s===0||s===1&&r===n-1&&r===i+1?"":e.slice(r,n)}function Jxt(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function twt(e,t){let n="",i=0,r=-1,s=0,o=-1,l,c;for(;++o<=e.length;){if(o2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",i=0):(n=n.slice(0,c),i=n.length-1-n.lastIndexOf("/")),r=o,s=0;continue}}else if(n.length>0){n="",i=0,r=o,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(r+1,o):n=e.slice(r+1,o),i=o-r-1;r=o,s=0}else l===46&&s>-1?s++:s=-1}return n}function uT(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const nwt={cwd:iwt};function iwt(){return"/"}function WB(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function rwt(e){if(typeof e=="string")e=new URL(e);else if(!WB(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return swt(e)}function swt(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let n=-1;for(;++n0){let[m,...g]=d;const b=i[h][1];qB(b)&&qB(m)&&(m=m4(!0,b,m)),i[h]=[u,m,...g]}}}}const cwt=new DH().freeze();function v4(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function x4(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function w4(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function _te(e){if(!qB(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function jte(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function v_(e){return uwt(e)?e:new HPe(e)}function uwt(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function dwt(e){return typeof e=="string"||fwt(e)}function fwt(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const hwt="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Nte=[],Rte={allowDangerousHtml:!0},pwt=/^(https?|ircs?|mailto|xmpp)$/i,mwt=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function qPe(e){const t=gwt(e),n=bwt(e);return ywt(t.runSync(t.parse(n),n),e)}function gwt(e){const t=e.rehypePlugins||Nte,n=e.remarkPlugins||Nte,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Rte}:Rte;return cwt().use(Yvt).use(n).use(qxt,i).use(t)}function bwt(e){const t=e.children||"",n=new HPe;return typeof t=="string"&&(n.value=t),n}function ywt(e,t){const n=t.allowedElements,i=t.allowElement,r=t.components,s=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||vwt;for(const d of mwt)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+hwt+d.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),cT(e,u),Pyt(e,{Fragment:a.Fragment,components:r,ignoreInvalidStyle:!0,jsx:a.jsx,jsxs:a.jsxs,passKeys:!0,passNode:!0});function u(d,f,h){if(d.type==="raw"&&h&&typeof f=="number")return o?h.children.splice(f,1):h.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let m;for(m in f4)if(Object.hasOwn(f4,m)&&Object.hasOwn(d.properties,m)){const g=d.properties[m],b=f4[m];(b===null||b.includes(d.tagName))&&(d.properties[m]=c(String(g||""),m,d))}}if(d.type==="element"){let m=n?!n.includes(d.tagName):s?s.includes(d.tagName):!1;if(!m&&i&&typeof f=="number"&&(m=!i(d,f,h)),m&&h&&typeof f=="number")return l&&d.children?h.children.splice(f,1,...d.children):h.children.splice(f,1),f}}}function vwt(e){const t=e.indexOf(":"),n=e.indexOf("?"),i=e.indexOf("#"),r=e.indexOf("/");return t===-1||r!==-1&&t>r||n!==-1&&t>n||i!==-1&&t>i||pwt.test(e.slice(0,t))?e:""}function Ite(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,r=n.indexOf(t);for(;r!==-1;)i++,r=n.indexOf(t,r+t.length);return i}function xwt(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function wwt(e,t,n){const r=lT((n||{}).ignore||[]),s=Owt(t);let o=-1;for(;++o0?{type:"text",value:S}:void 0),S===!1?h.lastIndex=O+1:(g!==O&&w.push({type:"text",value:u.value.slice(g,O)}),Array.isArray(S)?w.push(...S):S&&w.push(S),g=O+x[0].length,y=!0),!h.global)break;x=h.exec(u.value)}return y?(g?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],i=n.indexOf(")");const r=Ite(e,"(");let s=Ite(e,")");for(;i!==-1&&r>s;)e+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),s++;return[e,n]}function WPe(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||h0(n)||xM(n))&&(!t||n!==47)}KPe.peek=Hwt;function Lwt(){this.buffer()}function $wt(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Fwt(){this.buffer()}function Bwt(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Uwt(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=mf(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Qwt(e){this.exit(e)}function zwt(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=mf(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Vwt(e){this.exit(e)}function Hwt(){return"["}function KPe(e,t,n,i){const r=n.createTracker(i);let s=r.move("[^");const o=n.enter("footnoteReference"),l=n.enter("reference");return s+=r.move(n.safe(n.associationId(e),{after:"]",before:s})),l(),o(),s+=r.move("]"),s}function qwt(){return{enter:{gfmFootnoteCallString:Lwt,gfmFootnoteCall:$wt,gfmFootnoteDefinitionLabelString:Fwt,gfmFootnoteDefinition:Bwt},exit:{gfmFootnoteCallString:Uwt,gfmFootnoteCall:Qwt,gfmFootnoteDefinitionLabelString:zwt,gfmFootnoteDefinition:Vwt}}}function Wwt(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:KPe},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,r,s,o){const l=s.createTracker(o);let c=l.move("[^");const u=s.enter("footnoteDefinition"),d=s.enter("label");return c+=l.move(s.safe(s.associationId(i),{before:c,after:"]"})),d(),c+=l.move("]:"),i.children&&i.children.length>0&&(l.shift(4),c+=l.move((t?` +`},r),s}function qxt(e,t){return e&&"run"in e?async function(n,i){const r=xte(n,{file:i,...t});await e.run(r,i)}:function(n,i){return xte(n,{file:i,...e||t})}}function wte(e){if(e)throw e}var _N=Object.prototype.hasOwnProperty,VPe=Object.prototype.toString,Ote=Object.defineProperty,kte=Object.getOwnPropertyDescriptor,Ste=function(t){return typeof Array.isArray=="function"?Array.isArray(t):VPe.call(t)==="[object Array]"},Ete=function(t){if(!t||VPe.call(t)!=="[object Object]")return!1;var n=_N.call(t,"constructor"),i=t.constructor&&t.constructor.prototype&&_N.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!i)return!1;var r;for(r in t);return typeof r>"u"||_N.call(t,r)},Cte=function(t,n){Ote&&n.name==="__proto__"?Ote(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Ate=function(t,n){if(n==="__proto__")if(_N.call(t,n)){if(kte)return kte(t,n).value}else return;return t[n]},Wxt=function e(){var t,n,i,r,s,o,l=arguments[0],c=1,u=arguments.length,d=!1;for(typeof l=="boolean"&&(d=l,l=arguments[1]||{},c=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});co.length;let c;l&&o.push(r);try{c=e.apply(this,o)}catch(u){const d=u;if(l&&n)throw d;return r(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(s,r):c instanceof Error?r(c):s(c))}function r(o,...l){n||(n=!0,t(o,...l))}function s(o){r(null,o)}}const Kf={basename:Xxt,dirname:Yxt,extname:Zxt,join:Jxt,sep:"/"};function Xxt(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');mT(e);let n=0,i=-1,r=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;r--;)if(e.codePointAt(r)===47){if(s){n=r+1;break}}else i<0&&(s=!0,i=r+1);return i<0?"":e.slice(n,i)}if(t===e)return"";let o=-1,l=t.length-1;for(;r--;)if(e.codePointAt(r)===47){if(s){n=r+1;break}}else o<0&&(s=!0,o=r+1),l>-1&&(e.codePointAt(r)===t.codePointAt(l--)?l<0&&(i=r):(l=-1,i=o));return n===i?i=o:i<0&&(i=e.length),e.slice(n,i)}function Yxt(e){if(mT(e),e.length===0)return".";let t=-1,n=e.length,i;for(;--n;)if(e.codePointAt(n)===47){if(i){t=n;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Zxt(e){mT(e);let t=e.length,n=-1,i=0,r=-1,s=0,o;for(;t--;){const l=e.codePointAt(t);if(l===47){if(o){i=t+1;break}continue}n<0&&(o=!0,n=t+1),l===46?r<0?r=t:s!==1&&(s=1):r>-1&&(s=-1)}return r<0||n<0||s===0||s===1&&r===n-1&&r===i+1?"":e.slice(r,n)}function Jxt(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function twt(e,t){let n="",i=0,r=-1,s=0,o=-1,l,c;for(;++o<=e.length;){if(o2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",i=0):(n=n.slice(0,c),i=n.length-1-n.lastIndexOf("/")),r=o,s=0;continue}}else if(n.length>0){n="",i=0,r=o,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(r+1,o):n=e.slice(r+1,o),i=o-r-1;r=o,s=0}else l===46&&s>-1?s++:s=-1}return n}function mT(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const nwt={cwd:iwt};function iwt(){return"/"}function WB(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function rwt(e){if(typeof e=="string")e=new URL(e);else if(!WB(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return swt(e)}function swt(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let n=-1;for(;++n0){let[m,...g]=d;const b=i[h][1];qB(b)&&qB(m)&&(m=m4(!0,b,m)),i[h]=[u,m,...g]}}}}const cwt=new DH().freeze();function v4(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function x4(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function w4(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function _te(e){if(!qB(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function jte(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function x_(e){return uwt(e)?e:new HPe(e)}function uwt(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function dwt(e){return typeof e=="string"||fwt(e)}function fwt(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const hwt="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Nte=[],Rte={allowDangerousHtml:!0},pwt=/^(https?|ircs?|mailto|xmpp)$/i,mwt=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function qPe(e){const t=gwt(e),n=bwt(e);return ywt(t.runSync(t.parse(n),n),e)}function gwt(e){const t=e.rehypePlugins||Nte,n=e.remarkPlugins||Nte,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Rte}:Rte;return cwt().use(Yvt).use(n).use(qxt,i).use(t)}function bwt(e){const t=e.children||"",n=new HPe;return typeof t=="string"&&(n.value=t),n}function ywt(e,t){const n=t.allowedElements,i=t.allowElement,r=t.components,s=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||vwt;for(const d of mwt)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+hwt+d.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),pT(e,u),Pyt(e,{Fragment:a.Fragment,components:r,ignoreInvalidStyle:!0,jsx:a.jsx,jsxs:a.jsxs,passKeys:!0,passNode:!0});function u(d,f,h){if(d.type==="raw"&&h&&typeof f=="number")return o?h.children.splice(f,1):h.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let m;for(m in f4)if(Object.hasOwn(f4,m)&&Object.hasOwn(d.properties,m)){const g=d.properties[m],b=f4[m];(b===null||b.includes(d.tagName))&&(d.properties[m]=c(String(g||""),m,d))}}if(d.type==="element"){let m=n?!n.includes(d.tagName):s?s.includes(d.tagName):!1;if(!m&&i&&typeof f=="number"&&(m=!i(d,f,h)),m&&h&&typeof f=="number")return l&&d.children?h.children.splice(f,1,...d.children):h.children.splice(f,1),f}}}function vwt(e){const t=e.indexOf(":"),n=e.indexOf("?"),i=e.indexOf("#"),r=e.indexOf("/");return t===-1||r!==-1&&t>r||n!==-1&&t>n||i!==-1&&t>i||pwt.test(e.slice(0,t))?e:""}function Ite(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,r=n.indexOf(t);for(;r!==-1;)i++,r=n.indexOf(t,r+t.length);return i}function xwt(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function wwt(e,t,n){const r=hT((n||{}).ignore||[]),s=Owt(t);let o=-1;for(;++o0?{type:"text",value:S}:void 0),S===!1?h.lastIndex=O+1:(g!==O&&w.push({type:"text",value:u.value.slice(g,O)}),Array.isArray(S)?w.push(...S):S&&w.push(S),g=O+x[0].length,y=!0),!h.global)break;x=h.exec(u.value)}return y?(g?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],i=n.indexOf(")");const r=Ite(e,"(");let s=Ite(e,")");for(;i!==-1&&r>s;)e+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),s++;return[e,n]}function WPe(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||g0(n)||wM(n))&&(!t||n!==47)}KPe.peek=Hwt;function Lwt(){this.buffer()}function $wt(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Fwt(){this.buffer()}function Bwt(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Uwt(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=pf(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Qwt(e){this.exit(e)}function zwt(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=pf(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Vwt(e){this.exit(e)}function Hwt(){return"["}function KPe(e,t,n,i){const r=n.createTracker(i);let s=r.move("[^");const o=n.enter("footnoteReference"),l=n.enter("reference");return s+=r.move(n.safe(n.associationId(e),{after:"]",before:s})),l(),o(),s+=r.move("]"),s}function qwt(){return{enter:{gfmFootnoteCallString:Lwt,gfmFootnoteCall:$wt,gfmFootnoteDefinitionLabelString:Fwt,gfmFootnoteDefinition:Bwt},exit:{gfmFootnoteCallString:Uwt,gfmFootnoteCall:Qwt,gfmFootnoteDefinitionLabelString:zwt,gfmFootnoteDefinition:Vwt}}}function Wwt(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:KPe},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,r,s,o){const l=s.createTracker(o);let c=l.move("[^");const u=s.enter("footnoteDefinition"),d=s.enter("label");return c+=l.move(s.safe(s.associationId(i),{before:c,after:"]"})),d(),c+=l.move("]:"),i.children&&i.children.length>0&&(l.shift(4),c+=l.move((t?` `:" ")+s.indentLines(s.containerFlow(i,l.current()),t?GPe:Kwt))),u(),c}}function Kwt(e,t,n){return t===0?e:GPe(e,t,n)}function GPe(e,t,n){return(n?"":" ")+e}const Gwt=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];XPe.peek=e1t;function Xwt(){return{canContainEols:["delete"],enter:{strikethrough:Zwt},exit:{strikethrough:Jwt}}}function Ywt(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Gwt}],handlers:{delete:XPe}}}function Zwt(e){this.enter({type:"delete",children:[]},e)}function Jwt(e){this.exit(e)}function XPe(e,t,n,i){const r=n.createTracker(i),s=n.enter("strikethrough");let o=r.move("~~");return o+=n.containerPhrasing(e,{...r.current(),before:o,after:"~"}),o+=r.move("~~"),s(),o}function e1t(){return"~"}function t1t(e){return e.length}function n1t(e,t){const n=t||{},i=(n.align||[]).concat(),r=n.stringLength||t1t,s=[],o=[],l=[],c=[];let u=0,d=-1;for(;++du&&(u=e[d].length);++yc[y])&&(c[y]=x)}b.push(w)}o[d]=b,l[d]=v}let f=-1;if(typeof i=="object"&&"length"in i)for(;++fc[f]&&(c[f]=w),m[f]=w),h[f]=x}o.splice(1,0,h),l.splice(1,0,m),d=-1;const g=[];for(;++d "),s.shift(2);const o=n.indentLines(n.containerFlow(e,s.current()),s1t);return r(),o}function s1t(e,t,n){return">"+(n?"":" ")+e}function a1t(e,t){return Mte(e,t.inConstruct,!0)&&!Mte(e,t.notInConstruct,!1)}function Mte(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let i=-1;for(;++i",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":` -`,...c.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=c.move(" "+r),u+=c.move(n.safe(e.title,{before:u,after:r,...c.current()})),u+=c.move(r),l()),o(),u}function h1t(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function yC(e){return"&#x"+e.toString(16).toUpperCase()+";"}function kI(e,t,n){const i=e1(e),r=e1(t);return i===void 0?r===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}ZPe.peek=p1t;function ZPe(e,t,n,i){const r=h1t(n),s=n.enter("emphasis"),o=n.createTracker(i),l=o.move(r);let c=o.move(n.containerPhrasing(e,{after:r,before:l,...o.current()}));const u=c.charCodeAt(0),d=kI(i.before.charCodeAt(i.before.length-1),u,r);d.inside&&(c=yC(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=kI(i.after.charCodeAt(0),f,r);h.inside&&(c=c.slice(0,-1)+yC(f));const m=o.move(r);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+m}function p1t(e,t,n){return n.options.emphasis||"*"}function m1t(e,t){let n=!1;return cT(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,VB}),!!((!e.depth||e.depth<3)&&TH(e)&&(t.options.setext||n))}function g1t(e,t,n,i){const r=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(i);if(m1t(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...s.current(),before:` +`,...c.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=c.move(" "+r),u+=c.move(n.safe(e.title,{before:u,after:r,...c.current()})),u+=c.move(r),l()),o(),u}function h1t(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function kC(e){return"&#x"+e.toString(16).toUpperCase()+";"}function SI(e,t,n){const i=n1(e),r=n1(t);return i===void 0?r===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}ZPe.peek=p1t;function ZPe(e,t,n,i){const r=h1t(n),s=n.enter("emphasis"),o=n.createTracker(i),l=o.move(r);let c=o.move(n.containerPhrasing(e,{after:r,before:l,...o.current()}));const u=c.charCodeAt(0),d=SI(i.before.charCodeAt(i.before.length-1),u,r);d.inside&&(c=kC(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=SI(i.after.charCodeAt(0),f,r);h.inside&&(c=c.slice(0,-1)+kC(f));const m=o.move(r);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+m}function p1t(e,t,n){return n.options.emphasis||"*"}function m1t(e,t){let n=!1;return pT(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,VB}),!!((!e.depth||e.depth<3)&&TH(e)&&(t.options.setext||n))}function g1t(e,t,n,i){const r=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(i);if(m1t(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...s.current(),before:` `,after:` `});return f(),d(),h+` `+(r===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(` `))+1))}const o="#".repeat(r),l=n.enter("headingAtx"),c=n.enter("phrasing");s.move(o+" ");let u=n.containerPhrasing(e,{before:"# ",after:` -`,...s.current()});return/^[\t ]/.test(u)&&(u=yC(u.charCodeAt(0))+u.slice(1)),u=u?o+" "+u:o,n.options.closeAtx&&(u+=" "+o),c(),l(),u}JPe.peek=b1t;function JPe(e){return e.value||""}function b1t(){return"<"}eDe.peek=y1t;function eDe(e,t,n,i){const r=MH(n),s=r==='"'?"Quote":"Apostrophe",o=n.enter("image");let l=n.enter("label");const c=n.createTracker(i);let u=c.move("![");return u+=c.move(n.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=c.move(" "+r),u+=c.move(n.safe(e.title,{before:u,after:r,...c.current()})),u+=c.move(r),l()),u+=c.move(")"),o(),u}function y1t(){return"!"}tDe.peek=v1t;function tDe(e,t,n,i){const r=e.referenceType,s=n.enter("imageReference");let o=n.enter("label");const l=n.createTracker(i);let c=l.move("![");const u=n.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=d,s(),r==="full"||!u||u!==f?c+=l.move(f+"]"):r==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function v1t(){return"!"}nDe.peek=x1t;function nDe(e,t,n){let i=e.value||"",r="`",s=-1;for(;new RegExp("(^|[^`])"+r+"([^`]|$)").test(i);)r+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++s\u007F]/.test(e.url))}rDe.peek=w1t;function rDe(e,t,n,i){const r=MH(n),s=r==='"'?"Quote":"Apostrophe",o=n.createTracker(i);let l,c;if(iDe(e,n)){const d=n.stack;n.stack=[],l=n.enter("autolink");let f=o.move("<");return f+=o.move(n.containerPhrasing(e,{before:f,after:">",...o.current()})),f+=o.move(">"),l(),n.stack=d,f}l=n.enter("link"),c=n.enter("label");let u=o.move("[");return u+=o.move(n.containerPhrasing(e,{before:u,after:"](",...o.current()})),u+=o.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),u+=o.move("<"),u+=o.move(n.safe(e.url,{before:u,after:">",...o.current()})),u+=o.move(">")):(c=n.enter("destinationRaw"),u+=o.move(n.safe(e.url,{before:u,after:e.title?" ":")",...o.current()}))),c(),e.title&&(c=n.enter(`title${s}`),u+=o.move(" "+r),u+=o.move(n.safe(e.title,{before:u,after:r,...o.current()})),u+=o.move(r),c()),u+=o.move(")"),l(),u}function w1t(e,t,n){return iDe(e,n)?"<":"["}sDe.peek=O1t;function sDe(e,t,n,i){const r=e.referenceType,s=n.enter("linkReference");let o=n.enter("label");const l=n.createTracker(i);let c=l.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=d,s(),r==="full"||!u||u!==f?c+=l.move(f+"]"):r==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function O1t(){return"["}function LH(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function k1t(e){const t=LH(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function S1t(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function aDe(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function E1t(e,t,n,i){const r=n.enter("list"),s=n.bulletCurrent;let o=e.ordered?S1t(n):LH(n);const l=e.ordered?o==="."?")":".":k1t(n);let c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),aDe(n)===o&&d){let f=-1;for(;++f-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let o=s.length+1;(r==="tab"||r==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const l=n.createTracker(i);l.move(s+" ".repeat(o-s.length)),l.shift(o);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,l.current()),d);return c(),u;function d(f,h,m){return h?(m?"":" ".repeat(o))+f:(m?s:s+" ".repeat(o-s.length))+f}}function T1t(e,t,n,i){const r=n.enter("paragraph"),s=n.enter("phrasing"),o=n.containerPhrasing(e,i);return s(),r(),o}const _1t=lT(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function j1t(e,t,n,i){return(e.children.some(function(o){return _1t(o)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function N1t(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}oDe.peek=R1t;function oDe(e,t,n,i){const r=N1t(n),s=n.enter("strong"),o=n.createTracker(i),l=o.move(r+r);let c=o.move(n.containerPhrasing(e,{after:r,before:l,...o.current()}));const u=c.charCodeAt(0),d=kI(i.before.charCodeAt(i.before.length-1),u,r);d.inside&&(c=yC(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=kI(i.after.charCodeAt(0),f,r);h.inside&&(c=c.slice(0,-1)+yC(f));const m=o.move(r+r);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+m}function R1t(e,t,n){return n.options.strong||"*"}function I1t(e,t,n,i){return n.safe(e.value,i)}function P1t(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function D1t(e,t,n){const i=(aDe(n)+(n.options.ruleSpaces?" ":"")).repeat(P1t(n));return n.options.ruleSpaces?i.slice(0,-1):i}const lDe={blockquote:r1t,break:Lte,code:u1t,definition:f1t,emphasis:ZPe,hardBreak:Lte,heading:g1t,html:JPe,image:eDe,imageReference:tDe,inlineCode:nDe,link:rDe,linkReference:sDe,list:E1t,listItem:A1t,paragraph:T1t,root:j1t,strong:oDe,text:I1t,thematicBreak:D1t};function M1t(){return{enter:{table:L1t,tableData:$te,tableHeader:$te,tableRow:F1t},exit:{codeText:B1t,table:$1t,tableData:E4,tableHeader:E4,tableRow:E4}}}function L1t(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function $1t(e){this.exit(e),this.data.inTable=void 0}function F1t(e){this.enter({type:"tableRow",children:[]},e)}function E4(e){this.exit(e)}function $te(e){this.enter({type:"tableCell",children:[]},e)}function B1t(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,U1t));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function U1t(e,t){return t==="|"?t:e}function Q1t(e){const t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,r=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` +`,...s.current()});return/^[\t ]/.test(u)&&(u=kC(u.charCodeAt(0))+u.slice(1)),u=u?o+" "+u:o,n.options.closeAtx&&(u+=" "+o),c(),l(),u}JPe.peek=b1t;function JPe(e){return e.value||""}function b1t(){return"<"}eDe.peek=y1t;function eDe(e,t,n,i){const r=MH(n),s=r==='"'?"Quote":"Apostrophe",o=n.enter("image");let l=n.enter("label");const c=n.createTracker(i);let u=c.move("![");return u+=c.move(n.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=c.move(" "+r),u+=c.move(n.safe(e.title,{before:u,after:r,...c.current()})),u+=c.move(r),l()),u+=c.move(")"),o(),u}function y1t(){return"!"}tDe.peek=v1t;function tDe(e,t,n,i){const r=e.referenceType,s=n.enter("imageReference");let o=n.enter("label");const l=n.createTracker(i);let c=l.move("![");const u=n.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=d,s(),r==="full"||!u||u!==f?c+=l.move(f+"]"):r==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function v1t(){return"!"}nDe.peek=x1t;function nDe(e,t,n){let i=e.value||"",r="`",s=-1;for(;new RegExp("(^|[^`])"+r+"([^`]|$)").test(i);)r+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++s\u007F]/.test(e.url))}rDe.peek=w1t;function rDe(e,t,n,i){const r=MH(n),s=r==='"'?"Quote":"Apostrophe",o=n.createTracker(i);let l,c;if(iDe(e,n)){const d=n.stack;n.stack=[],l=n.enter("autolink");let f=o.move("<");return f+=o.move(n.containerPhrasing(e,{before:f,after:">",...o.current()})),f+=o.move(">"),l(),n.stack=d,f}l=n.enter("link"),c=n.enter("label");let u=o.move("[");return u+=o.move(n.containerPhrasing(e,{before:u,after:"](",...o.current()})),u+=o.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),u+=o.move("<"),u+=o.move(n.safe(e.url,{before:u,after:">",...o.current()})),u+=o.move(">")):(c=n.enter("destinationRaw"),u+=o.move(n.safe(e.url,{before:u,after:e.title?" ":")",...o.current()}))),c(),e.title&&(c=n.enter(`title${s}`),u+=o.move(" "+r),u+=o.move(n.safe(e.title,{before:u,after:r,...o.current()})),u+=o.move(r),c()),u+=o.move(")"),l(),u}function w1t(e,t,n){return iDe(e,n)?"<":"["}sDe.peek=O1t;function sDe(e,t,n,i){const r=e.referenceType,s=n.enter("linkReference");let o=n.enter("label");const l=n.createTracker(i);let c=l.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=d,s(),r==="full"||!u||u!==f?c+=l.move(f+"]"):r==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function O1t(){return"["}function LH(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function k1t(e){const t=LH(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function S1t(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function aDe(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function E1t(e,t,n,i){const r=n.enter("list"),s=n.bulletCurrent;let o=e.ordered?S1t(n):LH(n);const l=e.ordered?o==="."?")":".":k1t(n);let c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),aDe(n)===o&&d){let f=-1;for(;++f-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let o=s.length+1;(r==="tab"||r==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const l=n.createTracker(i);l.move(s+" ".repeat(o-s.length)),l.shift(o);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,l.current()),d);return c(),u;function d(f,h,m){return h?(m?"":" ".repeat(o))+f:(m?s:s+" ".repeat(o-s.length))+f}}function T1t(e,t,n,i){const r=n.enter("paragraph"),s=n.enter("phrasing"),o=n.containerPhrasing(e,i);return s(),r(),o}const _1t=hT(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function j1t(e,t,n,i){return(e.children.some(function(o){return _1t(o)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function N1t(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}oDe.peek=R1t;function oDe(e,t,n,i){const r=N1t(n),s=n.enter("strong"),o=n.createTracker(i),l=o.move(r+r);let c=o.move(n.containerPhrasing(e,{after:r,before:l,...o.current()}));const u=c.charCodeAt(0),d=SI(i.before.charCodeAt(i.before.length-1),u,r);d.inside&&(c=kC(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=SI(i.after.charCodeAt(0),f,r);h.inside&&(c=c.slice(0,-1)+kC(f));const m=o.move(r+r);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+m}function R1t(e,t,n){return n.options.strong||"*"}function I1t(e,t,n,i){return n.safe(e.value,i)}function P1t(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function D1t(e,t,n){const i=(aDe(n)+(n.options.ruleSpaces?" ":"")).repeat(P1t(n));return n.options.ruleSpaces?i.slice(0,-1):i}const lDe={blockquote:r1t,break:Lte,code:u1t,definition:f1t,emphasis:ZPe,hardBreak:Lte,heading:g1t,html:JPe,image:eDe,imageReference:tDe,inlineCode:nDe,link:rDe,linkReference:sDe,list:E1t,listItem:A1t,paragraph:T1t,root:j1t,strong:oDe,text:I1t,thematicBreak:D1t};function M1t(){return{enter:{table:L1t,tableData:$te,tableHeader:$te,tableRow:F1t},exit:{codeText:B1t,table:$1t,tableData:E4,tableHeader:E4,tableRow:E4}}}function L1t(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function $1t(e){this.exit(e),this.data.inTable=void 0}function F1t(e){this.enter({type:"tableRow",children:[]},e)}function E4(e){this.exit(e)}function $te(e){this.enter({type:"tableCell",children:[]},e)}function B1t(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,U1t));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function U1t(e,t){return t==="|"?t:e}function Q1t(e){const t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,r=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:o,tableCell:c,tableRow:l}};function o(m,g,b,v){return u(d(m,b,v),m.align)}function l(m,g,b,v){const y=f(m,b,v),w=u([y]);return w.slice(0,w.indexOf(` -`))}function c(m,g,b,v){const y=b.enter("tableCell"),w=b.enter("phrasing"),x=b.containerPhrasing(m,{...v,before:s,after:s});return w(),y(),x}function u(m,g){return n1t(m,{align:g,alignDelimiters:i,padding:n,stringLength:r})}function d(m,g,b){const v=m.children;let y=-1;const w=[],x=g.enter("table");for(;++y0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const aOt={tokenize:pOt,partial:!0};function oOt(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:dOt,continuation:{tokenize:fOt},exit:hOt}},text:{91:{name:"gfmFootnoteCall",tokenize:uOt},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:lOt,resolveTo:cOt}}}}function lOt(e,t,n){const i=this;let r=i.events.length;const s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o;for(;r--;){const c=i.events[r][1];if(c.type==="labelImage"){o=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return l;function l(c){if(!o||!o._balanced)return n(c);const u=mf(i.sliceSerialize({start:o.end,end:i.now()}));return u.codePointAt(0)!==94||!s.includes(u.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function cOt(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},r={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};r.end.column++,r.end.offset++,r.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},r.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},l=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",r,t],["exit",r,t],["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...l),e}function uOt(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s=0,o;return l;function l(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),c}function c(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(f){if(s>999||f===93&&!o||f===null||f===91||ds(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return r.includes(mf(i.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return ds(f)||(o=!0),s++,e.consume(f),f===92?d:u}function d(f){return f===91||f===92||f===93?(e.consume(f),s++,u):u(f)}}function dOt(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s,o=0,l;return c;function c(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(g)}function d(g){if(o>999||g===93&&!l||g===null||g===91||ds(g))return n(g);if(g===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return s=mf(i.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return ds(g)||(l=!0),o++,e.consume(g),g===92?f:d}function f(g){return g===91||g===92||g===93?(e.consume(g),o++,d):d(g)}function h(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),r.includes(s)||r.push(s),fr(e,m,"gfmFootnoteDefinitionWhitespace")):n(g)}function m(g){return t(g)}}function fOt(e,t,n){return e.check(oT,t,e.attempt(aOt,t,n))}function hOt(e){e.exit("gfmFootnoteDefinition")}function pOt(e,t,n){const i=this;return fr(e,r,"gfmFootnoteDefinitionIndent",5);function r(s){const o=i.events[i.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(s):n(s)}}function mOt(e){let n=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:s,resolveAll:r};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function r(o,l){let c=-1;for(;++c1?c(g):(o.consume(g),f++,m);if(f<2&&!n)return c(g);const v=o.exit("strikethroughSequenceTemporary"),y=e1(g);return v._open=!y||y===2&&!!b,v._close=!b||b===2&&!!y,l(g)}}}class gOt{constructor(){this.map=[]}add(t,n,i){bOt(this,t,n,i)}consume(t){if(this.map.sort(function(s,o){return s[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const i=[];for(;n>0;)n-=1,i.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];i.push(t.slice()),t.length=0;let r=i.pop();for(;r;){for(const s of r)t.push(s);r=i.pop()}this.map.length=0}}function bOt(e,t,n,i){let r=0;if(!(n===0&&i.length===0)){for(;r-1;){const P=i.events[R][1].type;if(P==="lineEnding"||P==="linePrefix")R--;else break}const A=R>-1?i.events[R][1].type:null,N=A==="tableHead"||A==="tableRow"?S:c;return N===S&&i.parser.lazy[i.now().line]?n(T):N(T)}function c(T){return e.enter("tableHead"),e.enter("tableRow"),u(T)}function u(T){return T===124||(o=!0,s+=1),d(T)}function d(T){return T===null?n(T):qn(T)?s>1?(s=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),m):n(T):Xi(T)?fr(e,d,"whitespace")(T):(s+=1,o&&(o=!1,r+=1),T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),o=!0,d):(e.enter("data"),f(T)))}function f(T){return T===null||T===124||ds(T)?(e.exit("data"),d(T)):(e.consume(T),T===92?h:f)}function h(T){return T===92||T===124?(e.consume(T),f):f(T)}function m(T){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(T):(e.enter("tableDelimiterRow"),o=!1,Xi(T)?fr(e,g,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):g(T))}function g(T){return T===45||T===58?v(T):T===124?(o=!0,e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),b):k(T)}function b(T){return Xi(T)?fr(e,v,"whitespace")(T):v(T)}function v(T){return T===58?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),y):T===45?(s+=1,y(T)):T===null||qn(T)?O(T):k(T)}function y(T){return T===45?(e.enter("tableDelimiterFiller"),w(T)):k(T)}function w(T){return T===45?(e.consume(T),w):T===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(T))}function x(T){return Xi(T)?fr(e,O,"whitespace")(T):O(T)}function O(T){return T===124?g(T):T===null||qn(T)?!o||r!==s?k(T):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(T)):k(T)}function k(T){return n(T)}function S(T){return e.enter("tableRow"),C(T)}function C(T){return T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),C):T===null||qn(T)?(e.exit("tableRow"),t(T)):Xi(T)?fr(e,C,"whitespace")(T):(e.enter("data"),E(T))}function E(T){return T===null||T===124||ds(T)?(e.exit("data"),C(T)):(e.consume(T),T===92?j:E)}function j(T){return T===92||T===124?(e.consume(T),E):E(T)}}function wOt(e,t){let n=-1,i=!0,r=0,s=[0,0,0,0],o=[0,0,0,0],l=!1,c=0,u,d,f;const h=new gOt;for(;++nn[2]+1){const g=n[2]+1,b=n[3]-n[2]-1;e.add(g,b,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return r!==void 0&&(s.end=Object.assign({},rx(t.events,r)),e.add(r,0,[["exit",s,t]]),s=void 0),s}function Bte(e,t,n,i,r){const s=[],o=rx(t.events,n);r&&(r.end=Object.assign({},o),s.push(["exit",r,t])),i.end=Object.assign({},o),s.push(["exit",i,t]),e.add(n+1,0,s)}function rx(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const OOt={name:"tasklistCheck",tokenize:SOt};function kOt(){return{text:{91:OOt}}}function SOt(e,t,n){const i=this;return r;function r(c){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),s)}function s(c){return ds(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),o):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),o):n(c)}function o(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(c)}function l(c){return qn(c)?t(c):Xi(c)?e.check({tokenize:EOt},t,n)(c):n(c)}}function EOt(e,t,n){return fr(e,i,"whitespace");function i(r){return r===null?n(r):t(r)}}function COt(e){return SPe([Y1t(),oOt(),mOt(e),vOt(),kOt()])}const AOt={};function bDe(e){const t=this,n=e||AOt,i=t.data(),r=i.micromarkExtensions||(i.micromarkExtensions=[]),s=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),o=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);r.push(COt(n)),s.push(W1t()),o.push(K1t(n))}const Ute=function(e,t,n){const i=lT(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++tu&&(u=d):d&&(u!==void 0&&u>-1&&c.push(` +`))}function c(m,g,b,v){const y=b.enter("tableCell"),w=b.enter("phrasing"),x=b.containerPhrasing(m,{...v,before:s,after:s});return w(),y(),x}function u(m,g){return n1t(m,{align:g,alignDelimiters:i,padding:n,stringLength:r})}function d(m,g,b){const v=m.children;let y=-1;const w=[],x=g.enter("table");for(;++y0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const aOt={tokenize:pOt,partial:!0};function oOt(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:dOt,continuation:{tokenize:fOt},exit:hOt}},text:{91:{name:"gfmFootnoteCall",tokenize:uOt},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:lOt,resolveTo:cOt}}}}function lOt(e,t,n){const i=this;let r=i.events.length;const s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o;for(;r--;){const c=i.events[r][1];if(c.type==="labelImage"){o=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return l;function l(c){if(!o||!o._balanced)return n(c);const u=pf(i.sliceSerialize({start:o.end,end:i.now()}));return u.codePointAt(0)!==94||!s.includes(u.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function cOt(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},r={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};r.end.column++,r.end.offset++,r.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},r.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},l=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",r,t],["exit",r,t],["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...l),e}function uOt(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s=0,o;return l;function l(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),c}function c(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(f){if(s>999||f===93&&!o||f===null||f===91||cs(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return r.includes(pf(i.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return cs(f)||(o=!0),s++,e.consume(f),f===92?d:u}function d(f){return f===91||f===92||f===93?(e.consume(f),s++,u):u(f)}}function dOt(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s,o=0,l;return c;function c(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(g)}function d(g){if(o>999||g===93&&!l||g===null||g===91||cs(g))return n(g);if(g===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return s=pf(i.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return cs(g)||(l=!0),o++,e.consume(g),g===92?f:d}function f(g){return g===91||g===92||g===93?(e.consume(g),o++,d):d(g)}function h(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),r.includes(s)||r.push(s),dr(e,m,"gfmFootnoteDefinitionWhitespace")):n(g)}function m(g){return t(g)}}function fOt(e,t,n){return e.check(fT,t,e.attempt(aOt,t,n))}function hOt(e){e.exit("gfmFootnoteDefinition")}function pOt(e,t,n){const i=this;return dr(e,r,"gfmFootnoteDefinitionIndent",5);function r(s){const o=i.events[i.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(s):n(s)}}function mOt(e){let n=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:s,resolveAll:r};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function r(o,l){let c=-1;for(;++c1?c(g):(o.consume(g),f++,m);if(f<2&&!n)return c(g);const v=o.exit("strikethroughSequenceTemporary"),y=n1(g);return v._open=!y||y===2&&!!b,v._close=!b||b===2&&!!y,l(g)}}}class gOt{constructor(){this.map=[]}add(t,n,i){bOt(this,t,n,i)}consume(t){if(this.map.sort(function(s,o){return s[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const i=[];for(;n>0;)n-=1,i.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];i.push(t.slice()),t.length=0;let r=i.pop();for(;r;){for(const s of r)t.push(s);r=i.pop()}this.map.length=0}}function bOt(e,t,n,i){let r=0;if(!(n===0&&i.length===0)){for(;r-1;){const P=i.events[R][1].type;if(P==="lineEnding"||P==="linePrefix")R--;else break}const A=R>-1?i.events[R][1].type:null,N=A==="tableHead"||A==="tableRow"?S:c;return N===S&&i.parser.lazy[i.now().line]?n(T):N(T)}function c(T){return e.enter("tableHead"),e.enter("tableRow"),u(T)}function u(T){return T===124||(o=!0,s+=1),d(T)}function d(T){return T===null?n(T):Kn(T)?s>1?(s=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),m):n(T):Gi(T)?dr(e,d,"whitespace")(T):(s+=1,o&&(o=!1,r+=1),T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),o=!0,d):(e.enter("data"),f(T)))}function f(T){return T===null||T===124||cs(T)?(e.exit("data"),d(T)):(e.consume(T),T===92?h:f)}function h(T){return T===92||T===124?(e.consume(T),f):f(T)}function m(T){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(T):(e.enter("tableDelimiterRow"),o=!1,Gi(T)?dr(e,g,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):g(T))}function g(T){return T===45||T===58?v(T):T===124?(o=!0,e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),b):k(T)}function b(T){return Gi(T)?dr(e,v,"whitespace")(T):v(T)}function v(T){return T===58?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),y):T===45?(s+=1,y(T)):T===null||Kn(T)?O(T):k(T)}function y(T){return T===45?(e.enter("tableDelimiterFiller"),w(T)):k(T)}function w(T){return T===45?(e.consume(T),w):T===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(T))}function x(T){return Gi(T)?dr(e,O,"whitespace")(T):O(T)}function O(T){return T===124?g(T):T===null||Kn(T)?!o||r!==s?k(T):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(T)):k(T)}function k(T){return n(T)}function S(T){return e.enter("tableRow"),C(T)}function C(T){return T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),C):T===null||Kn(T)?(e.exit("tableRow"),t(T)):Gi(T)?dr(e,C,"whitespace")(T):(e.enter("data"),E(T))}function E(T){return T===null||T===124||cs(T)?(e.exit("data"),C(T)):(e.consume(T),T===92?j:E)}function j(T){return T===92||T===124?(e.consume(T),E):E(T)}}function wOt(e,t){let n=-1,i=!0,r=0,s=[0,0,0,0],o=[0,0,0,0],l=!1,c=0,u,d,f;const h=new gOt;for(;++nn[2]+1){const g=n[2]+1,b=n[3]-n[2]-1;e.add(g,b,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return r!==void 0&&(s.end=Object.assign({},ax(t.events,r)),e.add(r,0,[["exit",s,t]]),s=void 0),s}function Bte(e,t,n,i,r){const s=[],o=ax(t.events,n);r&&(r.end=Object.assign({},o),s.push(["exit",r,t])),i.end=Object.assign({},o),s.push(["exit",i,t]),e.add(n+1,0,s)}function ax(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const OOt={name:"tasklistCheck",tokenize:SOt};function kOt(){return{text:{91:OOt}}}function SOt(e,t,n){const i=this;return r;function r(c){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),s)}function s(c){return cs(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),o):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),o):n(c)}function o(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(c)}function l(c){return Kn(c)?t(c):Gi(c)?e.check({tokenize:EOt},t,n)(c):n(c)}}function EOt(e,t,n){return dr(e,i,"whitespace");function i(r){return r===null?n(r):t(r)}}function COt(e){return SPe([Y1t(),oOt(),mOt(e),vOt(),kOt()])}const AOt={};function bDe(e){const t=this,n=e||AOt,i=t.data(),r=i.micromarkExtensions||(i.micromarkExtensions=[]),s=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),o=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);r.push(COt(n)),s.push(W1t()),o.push(K1t(n))}const Ute=function(e,t,n){const i=hT(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++tu&&(u=d):d&&(u!==void 0&&u>-1&&c.push(` `.repeat(u)||" "),u=-1,c.push(d))}return c.join("")}function vDe(e,t,n){return e.type==="element"?DOt(e,t,n):e.type==="text"?n.whitespace==="normal"?xDe(e,n):MOt(e):[]}function DOt(e,t,n){const i=wDe(e,n),r=e.children||[];let s=-1,o=[];if(IOt(e))return o;let l,c;for(GB(e)||Hte(e)&&Ute(t,e,Hte)?c=` -`:ROt(e)?(l=2,c=2):yDe(e)&&(l=1,c=1);++s]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},m=t.optional(r)+e.IDENT_RE+"\\s*\\(",g=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],b=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],O={type:b,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},k={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},S=[k,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],C={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:O,contains:S.concat([{begin:/\(/,end:/\)/,keywords:O,contains:S.concat(["self"]),relevance:0}]),relevance:0},E={className:"function",begin:"("+o+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:O,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:O,relevance:0},{begin:m,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:O,illegal:"",keywords:O,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:O},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function QOt(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=UOt(e),i=n.keywords;return i.type=[...i.type,...t.type],i.literal=[...i.literal,...t.literal],i.built_in=[...i.built_in,...t.built_in],i._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function SM(e){const t=e.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});const r={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},s=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,r]};r.contains.push(l);const c={match:/\\"/},u={className:"string",begin:/'/,end:/'/},d={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},h=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],m=e.SHEBANG({binary:`(${h.join("|")})`,relevance:10}),g={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},b=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],v=["true","false"],y={match:/(\/[a-z._-]+)+/},w=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],x=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],O=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],k=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:b,literal:v,built_in:[...w,...x,"set","shopt",...O,...k]},contains:[m,e.SHEBANG(),g,f,s,o,y,l,c,u,d,n]}}function zOt(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",o="("+i+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},m=t.optional(r)+e.IDENT_RE+"\\s*\\(",v={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},y=[f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],w={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:v,contains:y.concat([{begin:/\(/,end:/\)/,keywords:v,contains:y.concat(["self"]),relevance:0}]),relevance:0},x={begin:"("+o+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:v,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:v,relevance:0},{begin:m,returnBegin:!0,contains:[e.inherit(h,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C",aliases:["h"],keywords:v,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:f,strings:u,keywords:v}}}function VOt(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",o="(?!struct)("+i+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},m=t.optional(r)+e.IDENT_RE+"\\s*\\(",g=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],b=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],O={type:b,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},k={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},S=[k,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],C={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:O,contains:S.concat([{begin:/\(/,end:/\)/,keywords:O,contains:S.concat(["self"]),relevance:0}]),relevance:0},E={className:"function",begin:"("+o+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:O,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:O,relevance:0},{begin:m,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:O,illegal:"",keywords:O,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:O},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function HOt(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],i=["default","false","null","true"],r=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],s=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],o={keyword:r.concat(s),built_in:t,literal:i},l=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),c={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},u={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},d={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},f=e.inherit(d,{illegal:/\n/}),h={className:"subst",begin:/\{/,end:/\}/,keywords:o},m=e.inherit(h,{illegal:/\n/}),g={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,m]},b={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},v=e.inherit(b,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},m]});h.contains=[b,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.C_BLOCK_COMMENT_MODE],m.contains=[v,g,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const y={variants:[u,b,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},w={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},x=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",O={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:o,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},y,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,w,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,w,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+x+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:o,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,w],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,relevance:0,contains:[y,c,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},O]}}const qOt=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),WOt=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],KOt=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],GOt=[...WOt,...KOt],XOt=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),YOt=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),ZOt=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),JOt=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function kDe(e){const t=e.regex,n=qOt(e),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",s=/@-?\w[\w]*(-\w+)*/,o="[a-zA-Z-][a-zA-Z0-9_-]*",l=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,i,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+o,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+YOt.join("|")+")"},{begin:":(:)?("+ZOt.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+JOt.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:r,attribute:XOt.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+GOt.join("|")+")\\b"}]}}function SDe(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function EDe(e){const s={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:s,illegal:"CDe(e,t,n-1))}function ADe(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+CDe("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),c={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},u={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},d={className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:c,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+i+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:c,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,qte,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},qte,u]}}const Wte="[A-Za-z$_][0-9A-Za-z$_]*",tkt=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],nkt=["true","false","null","undefined","NaN","Infinity"],TDe=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],_De=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],jDe=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],ikt=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],rkt=[].concat(jDe,TDe,_De);function UH(e){const t=e.regex,n=(L,{after:F})=>{const M="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,F)=>{const M=L[0].length+L.index,z=L.input[M];if(z==="<"||z===","){F.ignoreMatch();return}z===">"&&(n(L,{after:M})||F.ignoreMatch());let q;const U=L.input.substring(M);if(q=U.match(/^\s*=/)){F.ignoreMatch();return}if((q=U.match(/^\s+extends\s+/))&&q.index===0){F.ignoreMatch();return}}},l={$pattern:Wte,keyword:tkt,literal:nkt,built_in:rkt,"variable.language":ikt},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},m={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},w={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const O=[].concat(w,h.contains),k=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(O)}]),S={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k},C={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},E={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...TDe,..._De]}},j={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[S],illegal:/%/},R={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function A(L){return t.concat("(?!",L.join("|"),")")}const N={match:t.concat(/\b/,A([...jDe,"super","import"].map(L=>`${L}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},P={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},I={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},S]},D="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",_={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(D)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[S]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:E},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),j,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,w,{match:/\$\d+/},f,E,{scope:"attr",match:i+t.lookahead(":"),relevance:0},_,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[w,e.REGEXP_MODE,{className:"function",begin:D,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[S,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},P,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[S]},N,R,C,I,{match:/\$[(.]/}]}}function QH(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],r={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[t,n,e.QUOTE_STRING_MODE,r,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var ax="[0-9](_*[0-9])*",k_=`\\.(${ax})`,S_="[0-9a-fA-F](_*[0-9a-fA-F])*",skt={className:"number",variants:[{begin:`(\\b(${ax})((${k_})|\\.)?|(${k_}))[eE][+-]?(${ax})[fFdD]?\\b`},{begin:`\\b(${ax})((${k_})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${k_})[fFdD]?\\b`},{begin:`\\b(${ax})[fFdD]\\b`},{begin:`\\b0[xX]((${S_})\\.?|(${S_})?\\.(${S_}))[pP][+-]?(${ax})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${S_})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function akt(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},i={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},r={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},s={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[s,r]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,s,r]}]};r.contains.push(o);const l={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},c={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(o,{className:"string"}),"self"]}]},u=skt,d=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),f={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},h=f;return h.variants[1].contains=[f],f.variants[1].contains=[h],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,d,n,i,l,c,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[f,e.C_LINE_COMMENT_MODE,d],relevance:0},e.C_LINE_COMMENT_MODE,d,l,c,o,e.C_NUMBER_MODE]},d]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},l,c]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` +`:ROt(e)?(l=2,c=2):yDe(e)&&(l=1,c=1);++s]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},m=t.optional(r)+e.IDENT_RE+"\\s*\\(",g=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],b=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],O={type:b,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},k={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},S=[k,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],C={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:O,contains:S.concat([{begin:/\(/,end:/\)/,keywords:O,contains:S.concat(["self"]),relevance:0}]),relevance:0},E={className:"function",begin:"("+o+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:O,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:O,relevance:0},{begin:m,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:O,illegal:"",keywords:O,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:O},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function QOt(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=UOt(e),i=n.keywords;return i.type=[...i.type,...t.type],i.literal=[...i.literal,...t.literal],i.built_in=[...i.built_in,...t.built_in],i._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function EM(e){const t=e.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});const r={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},s=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,r]};r.contains.push(l);const c={match:/\\"/},u={className:"string",begin:/'/,end:/'/},d={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},h=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],m=e.SHEBANG({binary:`(${h.join("|")})`,relevance:10}),g={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},b=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],v=["true","false"],y={match:/(\/[a-z._-]+)+/},w=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],x=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],O=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],k=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:b,literal:v,built_in:[...w,...x,"set","shopt",...O,...k]},contains:[m,e.SHEBANG(),g,f,s,o,y,l,c,u,d,n]}}function zOt(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",o="("+i+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},m=t.optional(r)+e.IDENT_RE+"\\s*\\(",v={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},y=[f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],w={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:v,contains:y.concat([{begin:/\(/,end:/\)/,keywords:v,contains:y.concat(["self"]),relevance:0}]),relevance:0},x={begin:"("+o+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:v,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:v,relevance:0},{begin:m,returnBegin:!0,contains:[e.inherit(h,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C",aliases:["h"],keywords:v,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:f,strings:u,keywords:v}}}function VOt(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",o="(?!struct)("+i+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},m=t.optional(r)+e.IDENT_RE+"\\s*\\(",g=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],b=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],O={type:b,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},k={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},S=[k,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],C={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:O,contains:S.concat([{begin:/\(/,end:/\)/,keywords:O,contains:S.concat(["self"]),relevance:0}]),relevance:0},E={className:"function",begin:"("+o+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:O,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:O,relevance:0},{begin:m,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:O,illegal:"",keywords:O,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:O},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function HOt(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],i=["default","false","null","true"],r=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],s=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],o={keyword:r.concat(s),built_in:t,literal:i},l=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),c={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},u={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},d={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},f=e.inherit(d,{illegal:/\n/}),h={className:"subst",begin:/\{/,end:/\}/,keywords:o},m=e.inherit(h,{illegal:/\n/}),g={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,m]},b={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},v=e.inherit(b,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},m]});h.contains=[b,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.C_BLOCK_COMMENT_MODE],m.contains=[v,g,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const y={variants:[u,b,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},w={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},x=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",O={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:o,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},y,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,w,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,w,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+x+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:o,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,w],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,relevance:0,contains:[y,c,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},O]}}const qOt=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),WOt=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],KOt=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],GOt=[...WOt,...KOt],XOt=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),YOt=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),ZOt=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),JOt=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function kDe(e){const t=e.regex,n=qOt(e),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",s=/@-?\w[\w]*(-\w+)*/,o="[a-zA-Z-][a-zA-Z0-9_-]*",l=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,i,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+o,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+YOt.join("|")+")"},{begin:":(:)?("+ZOt.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+JOt.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:r,attribute:XOt.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+GOt.join("|")+")\\b"}]}}function SDe(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function EDe(e){const s={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:s,illegal:"CDe(e,t,n-1))}function ADe(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+CDe("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),c={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},u={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},d={className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:c,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+i+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:c,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,qte,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},qte,u]}}const Wte="[A-Za-z$_][0-9A-Za-z$_]*",tkt=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],nkt=["true","false","null","undefined","NaN","Infinity"],TDe=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],_De=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],jDe=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],ikt=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],rkt=[].concat(jDe,TDe,_De);function UH(e){const t=e.regex,n=(L,{after:F})=>{const M="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,F)=>{const M=L[0].length+L.index,V=L.input[M];if(V==="<"||V===","){F.ignoreMatch();return}V===">"&&(n(L,{after:M})||F.ignoreMatch());let q;const U=L.input.substring(M);if(q=U.match(/^\s*=/)){F.ignoreMatch();return}if((q=U.match(/^\s+extends\s+/))&&q.index===0){F.ignoreMatch();return}}},l={$pattern:Wte,keyword:tkt,literal:nkt,built_in:rkt,"variable.language":ikt},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},m={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},w={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const O=[].concat(w,h.contains),k=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(O)}]),S={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k},C={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},E={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...TDe,..._De]}},j={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[S],illegal:/%/},R={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function A(L){return t.concat("(?!",L.join("|"),")")}const N={match:t.concat(/\b/,A([...jDe,"super","import"].map(L=>`${L}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},P={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},I={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},S]},D="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",_={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(D)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[S]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:E},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),j,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,w,{match:/\$\d+/},f,E,{scope:"attr",match:i+t.lookahead(":"),relevance:0},_,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[w,e.REGEXP_MODE,{className:"function",begin:D,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[S,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},P,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[S]},N,R,C,I,{match:/\$[(.]/}]}}function QH(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],r={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[t,n,e.QUOTE_STRING_MODE,r,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var lx="[0-9](_*[0-9])*",S_=`\\.(${lx})`,E_="[0-9a-fA-F](_*[0-9a-fA-F])*",skt={className:"number",variants:[{begin:`(\\b(${lx})((${S_})|\\.)?|(${S_}))[eE][+-]?(${lx})[fFdD]?\\b`},{begin:`\\b(${lx})((${S_})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${S_})[fFdD]?\\b`},{begin:`\\b(${lx})[fFdD]\\b`},{begin:`\\b0[xX]((${E_})\\.?|(${E_})?\\.(${E_}))[pP][+-]?(${lx})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${E_})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function akt(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},i={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},r={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},s={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[s,r]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,s,r]}]};r.contains.push(o);const l={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},c={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(o,{className:"string"}),"self"]}]},u=skt,d=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),f={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},h=f;return h.variants[1].contains=[f],f.variants[1].contains=[h],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,d,n,i,l,c,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[f,e.C_LINE_COMMENT_MODE,d],relevance:0},e.C_LINE_COMMENT_MODE,d,l,c,o,e.C_NUMBER_MODE]},d]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},l,c]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` `},u]}}const okt=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),lkt=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],ckt=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],ukt=[...lkt,...ckt],dkt=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),NDe=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),RDe=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),fkt=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),hkt=NDe.concat(RDe).sort().reverse();function pkt(e){const t=okt(e),n=hkt,i="and or not only",r="[\\w-]+",s="("+r+"|@\\{"+r+"\\})",o=[],l=[],c=function(x){return{className:"string",begin:"~?"+x+".*?"+x}},u=function(x,O,k){return{className:x,begin:O,relevance:k}},d={$pattern:/[a-z-]+/,keyword:i,attribute:dkt.join(" ")},f={begin:"\\(",end:"\\)",contains:l,keywords:d,relevance:0};l.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,c("'"),c('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,f,u("variable","@@?"+r,10),u("variable","@\\{"+r+"\\}"),u("built_in","~?`[^`]*?`"),{className:"attribute",begin:r+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const h=l.concat({begin:/\{/,end:/\}/,contains:o}),m={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},g={begin:s+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+fkt.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:l}}]},b={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:d,returnEnd:!0,contains:l,relevance:0}},v={className:"variable",variants:[{begin:"@"+r+"\\s*:",relevance:15},{begin:"@"+r}],starts:{end:"[;}]",returnEnd:!0,contains:h}},y={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:s,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,m,u("keyword","all\\b"),u("variable","@\\{"+r+"\\}"),{begin:"\\b("+ukt.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,u("selector-tag",s,0),u("selector-id","#"+s),u("selector-class","\\."+s,0),u("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+NDe.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+RDe.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},w={begin:r+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[y]};return o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,b,v,w,g,y,m,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:o}}function mkt(e){const t="\\[=*\\[",n="\\]=*\\]",i={begin:t,end:n,contains:["self"]},r=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[i],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:r.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:r}].concat(r)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[i],relevance:5}])}}function zH(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},r={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},s={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},d={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},f=e.inherit(u,{contains:[]}),h=e.inherit(d,{contains:[]});u.contains.push(h),d.contains.push(f);let m=[n,c];return[u,d,f,h].forEach(y=>{y.contains=y.contains.concat(m)}),m=m.concat(u,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:m},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:m}]}]},n,s,u,d,{className:"quote",begin:"^>\\s+",contains:m,end:"$"},r,i,c,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function gkt(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,l={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},c={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:l,illegal:"/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+c.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:c,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function bkt(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],i=/[dualxmsipngr]{0,12}/,r={$pattern:/[\w.]+/,keyword:n.join(" ")},s={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:r},o={begin:/->\{/,end:/\}/},l={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},c={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[l]},u={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},d=[e.BACKSLASH_ESCAPE,s,c],f=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],h=(b,v,y="\\1")=>{const w=y==="\\1"?y:t.concat(y,v);return t.concat(t.concat("(?:",b,")"),v,/(?:\\.|[^\\\/])*?/,w,/(?:\\.|[^\\\/])*?/,y,i)},m=(b,v,y)=>t.concat(t.concat("(?:",b,")"),v,/(?:\\.|[^\\\/])*?/,y,i),g=[c,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:"string",contains:d,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},u,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:h("s|tr|y",t.either(...f,{capture:!0}))},{begin:h("s|tr|y","\\(","\\)")},{begin:h("s|tr|y","\\[","\\]")},{begin:h("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:m("(?:m|qr)?",/\//,/\//)},{begin:m("m|qr",t.either(...f,{capture:!0}),/\1/)},{begin:m("m|qr",/\(/,/\)/)},{begin:m("m|qr",/\[/,/\]/)},{begin:m("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l,u]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return s.contains=g,o.contains=g,{name:"Perl",aliases:["pl","pm"],keywords:r,contains:g}}function ykt(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,i=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),r=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),s=t.concat(/[A-Z]+/,n),o={scope:"variable",match:"\\$+"+i},l={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},c={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},u=e.inherit(e.APOS_STRING_MODE,{illegal:null}),d=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(c)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(c),"on:begin":(P,I)=>{I.data._beginMatch=P[1]||P[2]},"on:end":(P,I)=>{I.data._beginMatch!==P[1]&&I.ignoreMatch()}},h=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),m=`[ -]`,g={scope:"string",variants:[d,u,f,h]},b={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},v=["false","null","true"],y=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],w=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],O={keyword:y,literal:(P=>{const I=[];return P.forEach(D=>{I.push(D),D.toLowerCase()===D?I.push(D.toUpperCase()):I.push(D.toLowerCase())}),I})(v),built_in:w},k=P=>P.map(I=>I.replace(/\|\d+$/,"")),S={variants:[{match:[/new/,t.concat(m,"+"),t.concat("(?!",k(w).join("\\b|"),"\\b)"),r],scope:{1:"keyword",4:"title.class"}}]},C=t.concat(i,"\\b(?!\\()"),E={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),C],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,t.concat(/::/,t.lookahead(/(?!class\b)/)),C],scope:{1:"title.class",3:"variable.constant"}},{match:[r,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[r,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},j={scope:"attr",match:t.concat(i,t.lookahead(":"),t.lookahead(/(?!::)/))},T={relevance:0,begin:/\(/,end:/\)/,keywords:O,contains:[j,o,E,e.C_BLOCK_COMMENT_MODE,g,b,S]},R={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",k(y).join("\\b|"),"|",k(w).join("\\b|"),"\\b)"),i,t.concat(m,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[T]};T.contains.push(R);const A=[j,E,e.C_BLOCK_COMMENT_MODE,g,b,S],N={begin:t.concat(/#\[\s*\\?/,t.either(r,s)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:v,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:v,keyword:["new","array"]},contains:["self",...A]},...A,{scope:"meta",variants:[{match:r},{match:s}]}]};return{case_insensitive:!1,keywords:O,contains:[N,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},l,{scope:"variable.language",match:/\$this\b/},o,R,E,{match:[/const/,/\s/,i],scope:{1:"keyword",3:"variable.constant"}},S,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:O,contains:["self",N,o,E,e.C_BLOCK_COMMENT_MODE,g,b]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},g,b]}}function vkt(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function IDe(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function HH(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},c={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},d={begin:/\{\{/,relevance:0},f={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,d,u]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},h="[0-9](_?[0-9])*",m=`(\\b(${h}))?\\.(${h})|\\b(${h})\\.`,g=`\\b|${i.join("|")}`,b={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${m}))[eE][+-]?(${h})[jJ]?(?=${g})`},{begin:`(${m})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${g})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${g})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${g})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${g})`},{begin:`\\b(${h})[jJ](?=${g})`}]},v={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",c,b,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,b,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,b,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,v,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[y]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[b,y,f]}]}}function xkt(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function wkt(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,i=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),r=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,s=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[r,i]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,i]},{scope:{1:"punctuation",2:"number"},match:[s,i]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,i]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:r},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:s},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function Okt(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",i=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),r=t.concat(i,/(::\w+)*/),o={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},l={className:"doctag",begin:"@[A-Za-z]+"},c={begin:"#<",end:">"},u=[e.COMMENT("#","$",{contains:[l]}),e.COMMENT("^=begin","^=end",{contains:[l],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],d={className:"subst",begin:/#\{/,end:/\}/,keywords:o},f={className:"string",contains:[e.BACKSLASH_ESCAPE,d],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,d]})]}]},h="[1-9](_?[0-9])*|0",m="[0-9](_?[0-9])*",g={className:"number",relevance:0,variants:[{begin:`\\b(${h})(\\.(${m}))?([eE][+-]?(${m})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},b={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},S=[f,{variants:[{match:[/class\s+/,r,/\s+<\s+/,r]},{match:[/\b(class|module)\s+/,r]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,r],scope:{2:"title.class"},keywords:o},{relevance:0,match:[r,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:i,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[b]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[f,{begin:n}],relevance:0},g,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,d],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(c,u),relevance:0}].concat(c,u);d.contains=S,b.contains=S;const T=[{begin:/^\s*=>/,starts:{end:"$",contains:S}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:o,contains:S}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(T).concat(u).concat(S)}}function PDe(e){const t=e.regex,n=/(r#)?/,i=t.concat(n,e.UNDERSCORE_IDENT_RE),r=t.concat(n,e.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,r,t.lookahead(/\s*\(/))},o="([ui](8|16|32|64|128|size)|f(32|64))?",l=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],c=["true","false","Some","None","Ok","Err"],u=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],d=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:d,keyword:l,literal:c,built_in:u},illegal:""},s]}}const kkt=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Skt=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Ekt=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Ckt=[...Skt,...Ekt],Akt=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Tkt=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),_kt=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),jkt=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function DDe(e){const t=kkt(e),n=_kt,i=Tkt,r="@[a-z-]+",s="and or not only",l={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+Ckt.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+i.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},l,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+jkt.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,l,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:r,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:Akt.join(" ")},contains:[{begin:r,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},l,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function Nkt(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function MDe(e){const t=e.regex,n=e.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},r={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["true","false","unknown"],o=["double precision","large object","with timezone","without timezone"],l=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],c=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],d=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],f=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],h=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],m=d,g=[...u,...c].filter(k=>!d.includes(k)),b={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},v={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:t.concat(/\b/,t.either(...m),/\s*\(/),relevance:0,keywords:{built_in:m}};function w(k){return t.concat(/\b/,t.either(...k.map(S=>S.replace(/\s+/,"\\s+"))),/\b/)}const x={scope:"keyword",match:w(h),relevance:0};function O(k,{exceptions:S,when:C}={}){const E=C;return S=S||[],k.map(j=>j.match(/\|\d+$/)||S.includes(j)?j:E(j)?`${j}|0`:j)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:O(g,{when:k=>k.length<3}),literal:s,type:l,built_in:f},contains:[{scope:"type",match:w(o)},x,y,b,i,r,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,v]}}function LDe(e){return e?typeof e=="string"?e:e.source:null}function fk(e){return Kr("(?=",e,")")}function Kr(...e){return e.map(n=>LDe(n)).join("")}function Rkt(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Yl(...e){return"("+(Rkt(e).capture?"":"?:")+e.map(i=>LDe(i)).join("|")+")"}const qH=e=>Kr(/\b/,e,/\w$/.test(e)?/\b/:/\B/),Ikt=["Protocol","Type"].map(qH),Kte=["init","self"].map(qH),Pkt=["Any","Self"],C4=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Gte=["false","nil","true"],Dkt=["assignment","associativity","higherThan","left","lowerThan","none","right"],Mkt=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Xte=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],$De=Yl(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),FDe=Yl($De,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),A4=Kr($De,FDe,"*"),BDe=Yl(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),SI=Yl(BDe,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Hf=Kr(BDe,SI,"*"),E_=Kr(/[A-Z]/,SI,"*"),Lkt=["attached","autoclosure",Kr(/convention\(/,Yl("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Kr(/objc\(/,Hf,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],$kt=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function Fkt(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),i=[e.C_LINE_COMMENT_MODE,n],r={match:[/\./,Yl(...Ikt,...Kte)],className:{2:"keyword"}},s={match:Kr(/\./,Yl(...C4)),relevance:0},o=C4.filter(be=>typeof be=="string").concat(["_|0"]),l=C4.filter(be=>typeof be!="string").concat(Pkt).map(qH),c={variants:[{className:"keyword",match:Yl(...l,...Kte)}]},u={$pattern:Yl(/\b\w+/,/#\w+/),keyword:o.concat(Mkt),literal:Gte},d=[r,s,c],f={match:Kr(/\./,Yl(...Xte)),relevance:0},h={className:"built_in",match:Kr(/\b/,Yl(...Xte),/(?=\()/)},m=[f,h],g={match:/->/,relevance:0},b={className:"operator",relevance:0,variants:[{match:A4},{match:`\\.(\\.|${FDe})+`}]},v=[g,b],y="([0-9]_*)+",w="([0-9a-fA-F]_*)+",x={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${w})(\\.(${w}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},O=(be="")=>({className:"subst",variants:[{match:Kr(/\\/,be,/[0\\tnr"']/)},{match:Kr(/\\/,be,/u\{[0-9a-fA-F]{1,8}\}/)}]}),k=(be="")=>({className:"subst",match:Kr(/\\/,be,/[\t ]*(?:[\r\n]|\r\n)/)}),S=(be="")=>({className:"subst",label:"interpol",begin:Kr(/\\/,be,/\(/),end:/\)/}),C=(be="")=>({begin:Kr(be,/"""/),end:Kr(/"""/,be),contains:[O(be),k(be),S(be)]}),E=(be="")=>({begin:Kr(be,/"/),end:Kr(/"/,be),contains:[O(be),S(be)]}),j={className:"string",variants:[C(),C("#"),C("##"),C("###"),E(),E("#"),E("##"),E("###")]},T=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],R={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:T},A=be=>{const ue=Kr(be,/\//),pe=Kr(/\//,be);return{begin:ue,end:pe,contains:[...T,{scope:"comment",begin:`#(?!.*${pe})`,end:/$/}]}},N={scope:"regexp",variants:[A("###"),A("##"),A("#"),R]},P={match:Kr(/`/,Hf,/`/)},I={className:"variable",match:/\$\d+/},D={className:"variable",match:`\\$${SI}+`},_=[P,I,D],L={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:$kt,contains:[...v,x,j]}]}},F={scope:"keyword",match:Kr(/@/,Yl(...Lkt),fk(Yl(/\(/,/\s+/)))},M={scope:"meta",match:Kr(/@/,Hf)},z=[L,F,M],q={match:fk(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Kr(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,SI,"+")},{className:"type",match:E_,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Kr(/\s+&\s+/,fk(E_)),relevance:0}]},U={begin://,keywords:u,contains:[...i,...d,...z,g,q]};q.contains.push(U);const J={match:Kr(Hf,/\s*:/),keywords:"_|0",relevance:0},V={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",J,...i,N,...d,...m,...v,x,j,..._,...z,q]},Z={begin://,keywords:"repeat each",contains:[...i,q]},ne={begin:Yl(fk(Kr(Hf,/\s*:/)),fk(Kr(Hf,/\s+/,Hf,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Hf}]},W={begin:/\(/,end:/\)/,keywords:u,contains:[ne,...i,...d,...v,x,j,...z,q,V],endsParent:!0,illegal:/["']/},G={match:[/(func|macro)/,/\s+/,Yl(P.match,Hf,A4)],className:{1:"keyword",3:"title.function"},contains:[Z,W,t],illegal:[/\[/,/%/]},H={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[Z,W,t],illegal:/\[|%/},se={match:[/operator/,/\s+/,A4],className:{1:"keyword",3:"title"}},Y={begin:[/precedencegroup/,/\s+/,E_],className:{1:"keyword",3:"title"},contains:[q],keywords:[...Dkt,...Gte],end:/}/},X={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},ie={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},ee={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Hf,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[Z,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:E_},...d],relevance:0}]};for(const be of j.variants){const ue=be.contains.find(ke=>ke.label==="interpol");ue.keywords=u;const pe=[...d,...m,...v,x,j,..._];ue.contains=[...pe,{begin:/\(/,end:/\)/,contains:["self",...pe]}]}return{name:"Swift",keywords:u,contains:[...i,G,H,X,ie,ee,se,Y,{beginKeywords:"import",end:/$/,contains:[...i],relevance:0},N,...d,...m,...v,x,j,..._,...z,q,V]}}const EI="[A-Za-z$_][0-9A-Za-z$_]*",UDe=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],QDe=["true","false","null","undefined","NaN","Infinity"],zDe=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],VDe=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],HDe=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],qDe=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],WDe=[].concat(HDe,zDe,VDe);function Bkt(e){const t=e.regex,n=(L,{after:F})=>{const M="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,F)=>{const M=L[0].length+L.index,z=L.input[M];if(z==="<"||z===","){F.ignoreMatch();return}z===">"&&(n(L,{after:M})||F.ignoreMatch());let q;const U=L.input.substring(M);if(q=U.match(/^\s*=/)){F.ignoreMatch();return}if((q=U.match(/^\s+extends\s+/))&&q.index===0){F.ignoreMatch();return}}},l={$pattern:EI,keyword:UDe,literal:QDe,built_in:WDe,"variable.language":qDe},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},m={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},w={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const O=[].concat(w,h.contains),k=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(O)}]),S={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k},C={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},E={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...zDe,...VDe]}},j={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[S],illegal:/%/},R={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function A(L){return t.concat("(?!",L.join("|"),")")}const N={match:t.concat(/\b/,A([...HDe,"super","import"].map(L=>`${L}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},P={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},I={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},S]},D="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",_={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(D)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[S]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:E},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),j,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,w,{match:/\$\d+/},f,E,{scope:"attr",match:i+t.lookahead(":"),relevance:0},_,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[w,e.REGEXP_MODE,{className:"function",begin:D,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[S,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},P,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[S]},N,R,C,I,{match:/\$[(.]/}]}}function WH(e){const t=e.regex,n=Bkt(e),i=EI,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[n.exports.CLASS_REFERENCE]},l={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:EI,keyword:UDe.concat(c),literal:QDe,built_in:WDe.concat(r),"variable.language":qDe},d={className:"meta",begin:"@"+i},f=(b,v,y)=>{const w=b.contains.findIndex(x=>x.label===v);if(w===-1)throw new Error("can not find mode to replace");b.contains.splice(w,1,y)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const h=n.contains.find(b=>b.scope==="attr"),m=Object.assign({},h,{match:t.concat(i,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,h,m]),n.contains=n.contains.concat([d,s,o,m]),f(n,"shebang",e.SHEBANG()),f(n,"use_strict",l);const g=n.contains.find(b=>b.label==="func.def");return g.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function Ukt(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},i={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},r=/\d{1,2}\/\d{1,2}\/\d{4}/,s=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,l=/\d{1,2}(:\d{1,2}){1,2}/,c={className:"literal",variants:[{begin:t.concat(/# */,t.either(s,r),/ *#/)},{begin:t.concat(/# */,l,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(s,r),/ +/,t.either(o,l),/ *#/)}]},u={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},d={className:"label",begin:/^\w+:/},f=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),h=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,i,c,u,d,f,h,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[h]}]}}function Qkt(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),i=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],r={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},s={className:"variable",begin:/\$[\w_]+/},o={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},l={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},c={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},u={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:i},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},s,o,r,e.QUOTE_STRING_MODE,c,u,l]}}function KDe(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(s,{begin:/\(/,end:/\)/}),l=e.inherit(e.APOS_STRING_MODE,{className:"string"}),c=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[s,c,l,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[s,o,c,l]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:u}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function KH(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,r]},l=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),h={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},m={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},g={begin:/\{/,end:/\}/,contains:[m],illegal:"\\n",relevance:0},b={begin:"\\[",end:"\\]",contains:[m],illegal:"\\n",relevance:0},v=[i,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},h,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},g,b,s,o],y=[...v];return y.pop(),y.push(l),m.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}const zkt={arduino:QOt,bash:SM,c:zOt,cpp:VOt,csharp:HOt,css:kDe,diff:SDe,go:EDe,graphql:ekt,ini:BH,java:ADe,javascript:UH,json:QH,kotlin:akt,less:pkt,lua:mkt,makefile:zH,markdown:VH,objectivec:gkt,perl:bkt,php:ykt,"php-template":vkt,plaintext:IDe,python:HH,"python-repl":xkt,r:wkt,ruby:Okt,rust:PDe,scss:DDe,shell:Nkt,sql:MDe,swift:Fkt,typescript:WH,vbnet:Ukt,wasm:Qkt,xml:KDe,yaml:KH};function GDe(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t],i=typeof n;(i==="object"||i==="function")&&!Object.isFrozen(n)&&GDe(n)}),e}let Yte=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function XDe(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function yg(e,...t){const n=Object.create(null);for(const i in e)n[i]=e[i];return t.forEach(function(i){for(const r in i)n[r]=i[r]}),n}const Vkt="",Zte=e=>!!e.scope,Hkt=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((i,r)=>`${i}${"_".repeat(r+1)}`)].join(" ")}return`${t}${e}`};class qkt{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=XDe(t)}openNode(t){if(!Zte(t))return;const n=Hkt(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){Zte(t)&&(this.buffer+=Vkt)}value(){return this.buffer}span(t){this.buffer+=``}}const Jte=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class GH{constructor(){this.rootNode=Jte(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const n=Jte({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(i=>this._walk(t,i)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{GH._collapse(n)}))}}class Wkt extends GH{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const i=t.root;n&&(i.scope=`language:${n}`),this.add(i)}toHTML(){return new qkt(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function vC(e){return e?typeof e=="string"?e:e.source:null}function YDe(e){return G0("(?=",e,")")}function Kkt(e){return G0("(?:",e,")*")}function Gkt(e){return G0("(?:",e,")?")}function G0(...e){return e.map(n=>vC(n)).join("")}function Xkt(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function XH(...e){return"("+(Xkt(e).capture?"":"?:")+e.map(i=>vC(i)).join("|")+")"}function ZDe(e){return new RegExp(e.toString()+"|").exec("").length-1}function Ykt(e,t){const n=e&&e.exec(t);return n&&n.index===0}const Zkt=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function YH(e,{joinWith:t}){let n=0;return e.map(i=>{n+=1;const r=n;let s=vC(i),o="";for(;s.length>0;){const l=Zkt.exec(s);if(!l){o+=s;break}o+=s.substring(0,l.index),s=s.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?o+="\\"+String(Number(l[1])+r):(o+=l[0],l[0]==="("&&n++)}return o}).map(i=>`(${i})`).join(t)}const Jkt=/\b\B/,JDe="[a-zA-Z]\\w*",ZH="[a-zA-Z_]\\w*",eMe="\\b\\d+(\\.\\d+)?",tMe="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",nMe="\\b(0b[01]+)",eSt="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",tSt=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=G0(t,/.*\b/,e.binary,/\b.*/)),yg({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},e)},xC={begin:"\\\\[\\s\\S]",relevance:0},nSt={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[xC]},iSt={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[xC]},rSt={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},EM=function(e,t,n={}){const i=yg({scope:"comment",begin:e,end:t,contains:[]},n);i.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const r=XH("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return i.contains.push({begin:G0(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},sSt=EM("//","$"),aSt=EM("/\\*","\\*/"),oSt=EM("#","$"),lSt={scope:"number",begin:eMe,relevance:0},cSt={scope:"number",begin:tMe,relevance:0},uSt={scope:"number",begin:nMe,relevance:0},dSt={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[xC,{begin:/\[/,end:/\]/,relevance:0,contains:[xC]}]},fSt={scope:"title",begin:JDe,relevance:0},hSt={scope:"title",begin:ZH,relevance:0},pSt={begin:"\\.\\s*"+ZH,relevance:0},mSt=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})};var C_=Object.freeze({__proto__:null,APOS_STRING_MODE:nSt,BACKSLASH_ESCAPE:xC,BINARY_NUMBER_MODE:uSt,BINARY_NUMBER_RE:nMe,COMMENT:EM,C_BLOCK_COMMENT_MODE:aSt,C_LINE_COMMENT_MODE:sSt,C_NUMBER_MODE:cSt,C_NUMBER_RE:tMe,END_SAME_AS_BEGIN:mSt,HASH_COMMENT_MODE:oSt,IDENT_RE:JDe,MATCH_NOTHING_RE:Jkt,METHOD_GUARD:pSt,NUMBER_MODE:lSt,NUMBER_RE:eMe,PHRASAL_WORDS_MODE:rSt,QUOTE_STRING_MODE:iSt,REGEXP_MODE:dSt,RE_STARTERS_RE:eSt,SHEBANG:tSt,TITLE_MODE:fSt,UNDERSCORE_IDENT_RE:ZH,UNDERSCORE_TITLE_MODE:hSt});function gSt(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function bSt(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function ySt(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=gSt,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function vSt(e,t){Array.isArray(e.illegal)&&(e.illegal=XH(...e.illegal))}function xSt(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function wSt(e,t){e.relevance===void 0&&(e.relevance=1)}const OSt=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(i=>{delete e[i]}),e.keywords=n.keywords,e.begin=G0(n.beforeMatch,YDe(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},kSt=["of","and","for","in","not","or","if","then","parent","list","value"],SSt="keyword";function iMe(e,t,n=SSt){const i=Object.create(null);return typeof e=="string"?r(n,e.split(" ")):Array.isArray(e)?r(n,e):Object.keys(e).forEach(function(s){Object.assign(i,iMe(e[s],t,s))}),i;function r(s,o){t&&(o=o.map(l=>l.toLowerCase())),o.forEach(function(l){const c=l.split("|");i[c[0]]=[s,ESt(c[0],c[1])]})}}function ESt(e,t){return t?Number(t):CSt(e)?0:1}function CSt(e){return kSt.includes(e.toLowerCase())}const ene={},Wy=e=>{console.error(e)},tne=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Lv=(e,t)=>{ene[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),ene[`${e}/${t}`]=!0)},CI=new Error;function rMe(e,t,{key:n}){let i=0;const r=e[n],s={},o={};for(let l=1;l<=t.length;l++)o[l+i]=r[l],s[l+i]=!0,i+=ZDe(t[l-1]);e[n]=o,e[n]._emit=s,e[n]._multi=!0}function ASt(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Wy("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),CI;if(typeof e.beginScope!="object"||e.beginScope===null)throw Wy("beginScope must be object"),CI;rMe(e,e.begin,{key:"beginScope"}),e.begin=YH(e.begin,{joinWith:""})}}function TSt(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Wy("skip, excludeEnd, returnEnd not compatible with endScope: {}"),CI;if(typeof e.endScope!="object"||e.endScope===null)throw Wy("endScope must be object"),CI;rMe(e,e.end,{key:"endScope"}),e.end=YH(e.end,{joinWith:""})}}function _St(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function jSt(e){_St(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),ASt(e),TSt(e)}function NSt(e){function t(o,l){return new RegExp(vC(o),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,l]),this.matchAt+=ZDe(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(YH(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;const c=this.matcherRe.exec(l);if(!c)return null;const u=c.findIndex((f,h)=>h>0&&f!==void 0),d=this.matchIndexes[u];return c.splice(0,u),Object.assign(c,d)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];const c=new n;return this.rules.slice(l).forEach(([u,d])=>c.addRule(u,d)),c.compile(),this.multiRegexes[l]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,c){this.rules.push([l,c]),c.type==="begin"&&this.count++}exec(l){const c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let u=c.exec(l);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,u=d.exec(l)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function r(o){const l=new i;return o.contains.forEach(c=>l.addRule(c.begin,{rule:c,type:"begin"})),o.terminatorEnd&&l.addRule(o.terminatorEnd,{type:"end"}),o.illegal&&l.addRule(o.illegal,{type:"illegal"}),l}function s(o,l){const c=o;if(o.isCompiled)return c;[bSt,xSt,jSt,OSt].forEach(d=>d(o,l)),e.compilerExtensions.forEach(d=>d(o,l)),o.__beforeBegin=null,[ySt,vSt,wSt].forEach(d=>d(o,l)),o.isCompiled=!0;let u=null;return typeof o.keywords=="object"&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),u=o.keywords.$pattern,delete o.keywords.$pattern),u=u||/\w+/,o.keywords&&(o.keywords=iMe(o.keywords,e.case_insensitive)),c.keywordPatternRe=t(u,!0),l&&(o.begin||(o.begin=/\B|\b/),c.beginRe=t(c.begin),!o.end&&!o.endsWithParent&&(o.end=/\B|\b/),o.end&&(c.endRe=t(c.end)),c.terminatorEnd=vC(c.end)||"",o.endsWithParent&&l.terminatorEnd&&(c.terminatorEnd+=(o.end?"|":"")+l.terminatorEnd)),o.illegal&&(c.illegalRe=t(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map(function(d){return RSt(d==="self"?o:d)})),o.contains.forEach(function(d){s(d,c)}),o.starts&&s(o.starts,l),c.matcher=r(c),c}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=yg(e.classNameAliases||{}),s(e)}function sMe(e){return e?e.endsWithParent||sMe(e.starts):!1}function RSt(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return yg(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:sMe(e)?yg(e,{starts:e.starts?yg(e.starts):null}):Object.isFrozen(e)?yg(e):e}var ISt="11.11.1";class PSt extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const T4=XDe,nne=yg,ine=Symbol("nomatch"),DSt=7,aMe=function(e){const t=Object.create(null),n=Object.create(null),i=[];let r=!0;const s="Could not find the language '{}', did you forget to load/include a language module?",o={disableAutodetect:!0,name:"Plain text",contains:[]};let l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Wkt};function c(D){return l.noHighlightRe.test(D)}function u(D){let _=D.className+" ";_+=D.parentNode?D.parentNode.className:"";const L=l.languageDetectRe.exec(_);if(L){const F=E(L[1]);return F||(tne(s.replace("{}",L[1])),tne("Falling back to no-highlight mode for this block.",D)),F?L[1]:"no-highlight"}return _.split(/\s+/).find(F=>c(F)||E(F))}function d(D,_,L){let F="",M="";typeof _=="object"?(F=D,L=_.ignoreIllegals,M=_.language):(Lv("10.7.0","highlight(lang, code, ...args) has been deprecated."),Lv("10.7.0",`Please use highlight(code, options) instead. -https://github.com/highlightjs/highlight.js/issues/2277`),M=D,F=_),L===void 0&&(L=!0);const z={code:F,language:M};P("before:highlight",z);const q=z.result?z.result:f(z.language,z.code,L);return q.code=z.code,P("after:highlight",q),q}function f(D,_,L,F){const M=Object.create(null);function z(le,ge){return le.keywords[ge]}function q(){if(!pe.keywords){je.addText(Pe);return}let le=0;pe.keywordPatternRe.lastIndex=0;let ge=pe.keywordPatternRe.exec(Pe),Oe="";for(;ge;){Oe+=Pe.substring(le,ge.index);const Se=ee.case_insensitive?ge[0].toLowerCase():ge[0],qe=z(pe,Se);if(qe){const[Xe,ye]=qe;if(je.addText(Oe),Oe="",M[Se]=(M[Se]||0)+1,M[Se]<=DSt&&(Ee+=ye),Xe.startsWith("_"))Oe+=ge[0];else{const we=ee.classNameAliases[Xe]||Xe;V(ge[0],we)}}else Oe+=ge[0];le=pe.keywordPatternRe.lastIndex,ge=pe.keywordPatternRe.exec(Pe)}Oe+=Pe.substring(le),je.addText(Oe)}function U(){if(Pe==="")return;let le=null;if(typeof pe.subLanguage=="string"){if(!t[pe.subLanguage]){je.addText(Pe);return}le=f(pe.subLanguage,Pe,!0,ke[pe.subLanguage]),ke[pe.subLanguage]=le._top}else le=m(Pe,pe.subLanguage.length?pe.subLanguage:null);pe.relevance>0&&(Ee+=le.relevance),je.__addSublanguage(le._emitter,le.language)}function J(){pe.subLanguage!=null?U():q(),Pe=""}function V(le,ge){le!==""&&(je.startScope(ge),je.addText(le),je.endScope())}function Z(le,ge){let Oe=1;const Se=ge.length-1;for(;Oe<=Se;){if(!le._emit[Oe]){Oe++;continue}const qe=ee.classNameAliases[le[Oe]]||le[Oe],Xe=ge[Oe];qe?V(Xe,qe):(Pe=Xe,q(),Pe=""),Oe++}}function ne(le,ge){return le.scope&&typeof le.scope=="string"&&je.openNode(ee.classNameAliases[le.scope]||le.scope),le.beginScope&&(le.beginScope._wrap?(V(Pe,ee.classNameAliases[le.beginScope._wrap]||le.beginScope._wrap),Pe=""):le.beginScope._multi&&(Z(le.beginScope,ge),Pe="")),pe=Object.create(le,{parent:{value:pe}}),pe}function W(le,ge,Oe){let Se=Ykt(le.endRe,Oe);if(Se){if(le["on:end"]){const qe=new Yte(le);le["on:end"](ge,qe),qe.isMatchIgnored&&(Se=!1)}if(Se){for(;le.endsParent&&le.parent;)le=le.parent;return le}}if(le.endsWithParent)return W(le.parent,ge,Oe)}function G(le){return pe.matcher.regexIndex===0?(Pe+=le[0],1):(ae=!0,0)}function H(le){const ge=le[0],Oe=le.rule,Se=new Yte(Oe),qe=[Oe.__beforeBegin,Oe["on:begin"]];for(const Xe of qe)if(Xe&&(Xe(le,Se),Se.isMatchIgnored))return G(ge);return Oe.skip?Pe+=ge:(Oe.excludeBegin&&(Pe+=ge),J(),!Oe.returnBegin&&!Oe.excludeBegin&&(Pe=ge)),ne(Oe,le),Oe.returnBegin?0:ge.length}function se(le){const ge=le[0],Oe=_.substring(le.index),Se=W(pe,le,Oe);if(!Se)return ine;const qe=pe;pe.endScope&&pe.endScope._wrap?(J(),V(ge,pe.endScope._wrap)):pe.endScope&&pe.endScope._multi?(J(),Z(pe.endScope,le)):qe.skip?Pe+=ge:(qe.returnEnd||qe.excludeEnd||(Pe+=ge),J(),qe.excludeEnd&&(Pe=ge));do pe.scope&&je.closeNode(),!pe.skip&&!pe.subLanguage&&(Ee+=pe.relevance),pe=pe.parent;while(pe!==Se.parent);return Se.starts&&ne(Se.starts,le),qe.returnEnd?0:ge.length}function Y(){const le=[];for(let ge=pe;ge!==ee;ge=ge.parent)ge.scope&&le.unshift(ge.scope);le.forEach(ge=>je.openNode(ge))}let X={};function ie(le,ge){const Oe=ge&&ge[0];if(Pe+=le,Oe==null)return J(),0;if(X.type==="begin"&&ge.type==="end"&&X.index===ge.index&&Oe===""){if(Pe+=_.slice(ge.index,ge.index+1),!r){const Se=new Error(`0 width match regex (${D})`);throw Se.languageName=D,Se.badRule=X.rule,Se}return 1}if(X=ge,ge.type==="begin")return H(ge);if(ge.type==="illegal"&&!L){const Se=new Error('Illegal lexeme "'+Oe+'" for mode "'+(pe.scope||"")+'"');throw Se.mode=pe,Se}else if(ge.type==="end"){const Se=se(ge);if(Se!==ine)return Se}if(ge.type==="illegal"&&Oe==="")return Pe+=` -`,1;if(_e>1e5&&_e>ge.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Pe+=Oe,Oe.length}const ee=E(D);if(!ee)throw Wy(s.replace("{}",D)),new Error('Unknown language: "'+D+'"');const be=NSt(ee);let ue="",pe=F||be;const ke={},je=new l.__emitter(l);Y();let Pe="",Ee=0,Qe=0,_e=0,ae=!1;try{if(ee.__emitTokens)ee.__emitTokens(_,je);else{for(pe.matcher.considerAll();;){_e++,ae?ae=!1:pe.matcher.considerAll(),pe.matcher.lastIndex=Qe;const le=pe.matcher.exec(_);if(!le)break;const ge=_.substring(Qe,le.index),Oe=ie(ge,le);Qe=le.index+Oe}ie(_.substring(Qe))}return je.finalize(),ue=je.toHTML(),{language:D,value:ue,relevance:Ee,illegal:!1,_emitter:je,_top:pe}}catch(le){if(le.message&&le.message.includes("Illegal"))return{language:D,value:T4(_),illegal:!0,relevance:0,_illegalBy:{message:le.message,index:Qe,context:_.slice(Qe-100,Qe+100),mode:le.mode,resultSoFar:ue},_emitter:je};if(r)return{language:D,value:T4(_),illegal:!1,relevance:0,errorRaised:le,_emitter:je,_top:pe};throw le}}function h(D){const _={value:T4(D),illegal:!1,relevance:0,_top:o,_emitter:new l.__emitter(l)};return _._emitter.addText(D),_}function m(D,_){_=_||l.languages||Object.keys(t);const L=h(D),F=_.filter(E).filter(T).map(J=>f(J,D,!1));F.unshift(L);const M=F.sort((J,V)=>{if(J.relevance!==V.relevance)return V.relevance-J.relevance;if(J.language&&V.language){if(E(J.language).supersetOf===V.language)return 1;if(E(V.language).supersetOf===J.language)return-1}return 0}),[z,q]=M,U=z;return U.secondBest=q,U}function g(D,_,L){const F=_&&n[_]||L;D.classList.add("hljs"),D.classList.add(`language-${F}`)}function b(D){let _=null;const L=u(D);if(c(L))return;if(P("before:highlightElement",{el:D,language:L}),D.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",D);return}if(D.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(D)),l.throwUnescapedHTML))throw new PSt("One of your code blocks includes unescaped HTML.",D.innerHTML);_=D;const F=_.textContent,M=L?d(F,{language:L,ignoreIllegals:!0}):m(F);D.innerHTML=M.value,D.dataset.highlighted="yes",g(D,L,M.language),D.result={language:M.language,re:M.relevance,relevance:M.relevance},M.secondBest&&(D.secondBest={language:M.secondBest.language,relevance:M.secondBest.relevance}),P("after:highlightElement",{el:D,result:M,text:F})}function v(D){l=nne(l,D)}const y=()=>{O(),Lv("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function w(){O(),Lv("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let x=!1;function O(){function D(){O()}if(document.readyState==="loading"){x||window.addEventListener("DOMContentLoaded",D,!1),x=!0;return}document.querySelectorAll(l.cssSelector).forEach(b)}function k(D,_){let L=null;try{L=_(e)}catch(F){if(Wy("Language definition for '{}' could not be registered.".replace("{}",D)),r)Wy(F);else throw F;L=o}L.name||(L.name=D),t[D]=L,L.rawDefinition=_.bind(null,e),L.aliases&&j(L.aliases,{languageName:D})}function S(D){delete t[D];for(const _ of Object.keys(n))n[_]===D&&delete n[_]}function C(){return Object.keys(t)}function E(D){return D=(D||"").toLowerCase(),t[D]||t[n[D]]}function j(D,{languageName:_}){typeof D=="string"&&(D=[D]),D.forEach(L=>{n[L.toLowerCase()]=_})}function T(D){const _=E(D);return _&&!_.disableAutodetect}function R(D){D["before:highlightBlock"]&&!D["before:highlightElement"]&&(D["before:highlightElement"]=_=>{D["before:highlightBlock"](Object.assign({block:_.el},_))}),D["after:highlightBlock"]&&!D["after:highlightElement"]&&(D["after:highlightElement"]=_=>{D["after:highlightBlock"](Object.assign({block:_.el},_))})}function A(D){R(D),i.push(D)}function N(D){const _=i.indexOf(D);_!==-1&&i.splice(_,1)}function P(D,_){const L=D;i.forEach(function(F){F[L]&&F[L](_)})}function I(D){return Lv("10.7.0","highlightBlock will be removed entirely in v12.0"),Lv("10.7.0","Please use highlightElement now."),b(D)}Object.assign(e,{highlight:d,highlightAuto:m,highlightAll:O,highlightElement:b,highlightBlock:I,configure:v,initHighlighting:y,initHighlightingOnLoad:w,registerLanguage:k,unregisterLanguage:S,listLanguages:C,getLanguage:E,registerAliases:j,autoDetection:T,inherit:nne,addPlugin:A,removePlugin:N}),e.debugMode=function(){r=!1},e.safeMode=function(){r=!0},e.versionString=ISt,e.regex={concat:G0,lookahead:YDe,either:XH,optional:Gkt,anyNumberOfTimes:Kkt};for(const D in C_)typeof C_[D]=="object"&&GDe(C_[D]);return Object.assign(e,C_),e},n1=aMe({});n1.newInstance=()=>aMe({});var MSt=n1;n1.HighlightJS=n1;n1.default=n1;const al=C1(MSt),rne={},LSt="hljs-";function $St(e){const t=al.newInstance();return e&&s(e),{highlight:n,highlightAuto:i,listLanguages:r,register:s,registerAlias:o,registered:l};function n(c,u,d){const f=d||rne,h=typeof f.prefix=="string"?f.prefix:LSt;if(!t.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");t.configure({__emitter:FSt,classPrefix:h});const m=t.highlight(u,{ignoreIllegals:!0,language:c});if(m.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:m.errorRaised});const g=m._emitter.root,b=g.data;return b.language=m.language,b.relevance=m.relevance,g}function i(c,u){const f=(u||rne).subset||r();let h=-1,m=0,g;for(;++hm&&(m=v.data.relevance,g=v)}return g||{type:"root",children:[],data:{language:void 0,relevance:m}}}function r(){return t.listLanguages()}function s(c,u){if(typeof c=="string")t.registerLanguage(c,u);else{let d;for(d in c)Object.hasOwn(c,d)&&t.registerLanguage(d,c[d])}}function o(c,u){if(typeof c=="string")t.registerAliases(typeof u=="string"?u:[...u],{languageName:c});else{let d;for(d in c)if(Object.hasOwn(c,d)){const f=c[d];t.registerAliases(typeof f=="string"?f:[...f],{languageName:d})}}}function l(c){return!!t.getLanguage(c)}}class FSt{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],i=n.children[n.children.length-1];i&&i.type==="text"?i.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const i=this.stack[this.stack.length-1],r=t.root.children;n?i.children.push({type:"element",tagName:"span",properties:{className:[n]},children:r}):i.children.push(...r)}openNode(t){const n=this,i=t.split(".").map(function(o,l){return l?o+"_".repeat(l):n.options.classPrefix+o}),r=this.stack[this.stack.length-1],s={type:"element",tagName:"span",properties:{className:i},children:[]};r.children.push(s),this.stack.push(s)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const BSt={};function sne(e){const t=e||BSt,n=t.aliases,i=t.detect||!1,r=t.languages||zkt,s=t.plainText,o=t.prefix,l=t.subset;let c="hljs";const u=$St(r);if(n&&u.registerAlias(n),o){const d=o.indexOf("-");c=d===-1?o:o.slice(0,d)}return function(d,f){cT(d,"element",function(h,m,g){if(h.tagName!=="code"||!g||g.type!=="element"||g.tagName!=="pre")return;const b=USt(h);if(b===!1||!b&&!i||b&&s&&s.includes(b))return;Array.isArray(h.properties.className)||(h.properties.className=[]),h.properties.className.includes(c)||h.properties.className.unshift(c);const v=POt(h,{whitespace:"pre"});let y;try{y=b?u.highlight(b,v,{prefix:o}):u.highlightAuto(v,{prefix:o,subset:l})}catch(w){const x=w;if(b&&/Unknown language/.test(x.message)){f.message("Cannot highlight as `"+b+"`, it’s not registered",{ancestors:[g,h],cause:x,place:h.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw x}!b&&y.data&&y.data.language&&h.properties.className.push("language-"+y.data.language),y.children.length>0&&(h.children=y.children)})}}function USt(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let i;for(;++n-1&&s<=t.length){let o=0;for(;;){let l=n[o];if(l===void 0){const c=lne(t,n[o-1]);l=c===-1?t.length+1:c+1,n[o]=l}if(l>s)return{line:o+1,column:s-(o>0?n[o-1]:0)+1,offset:s};o++}}}function r(s){if(s&&typeof s.line=="number"&&typeof s.column=="number"&&!Number.isNaN(s.line)&&!Number.isNaN(s.column)){for(;n.length1?n[s.line-2]:0)+s.column-1;if(o=55296&&e<=57343}function hEt(e){return e>=56320&&e<=57343}function pEt(e,t){return(e-55296)*1024+9216+t}function fMe(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function hMe(e){return e>=64976&&e<=65007||fEt.has(e)}var dt;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(dt||(dt={}));const mEt=65536;class gEt{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=mEt,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:i,col:r,offset:s}=this,o=r+n,l=s+n;return{code:t,startLine:i,endLine:i,startCol:o,endCol:o,startOffset:l,endOffset:l}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(hEt(n))return this.pos++,this._addGap(),pEt(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,xe.EOF;return this._err(dt.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let i=0;i=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,xe.EOF;const i=this.html.charCodeAt(n);return i===xe.CARRIAGE_RETURN?xe.LINE_FEED:i}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,xe.EOF;let t=this.html.charCodeAt(this.pos);return t===xe.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,xe.LINE_FEED):t===xe.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,dMe(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===xe.LINE_FEED||t===xe.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){fMe(t)?this._err(dt.controlCharacterInInputStream):hMe(t)&&this._err(dt.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const bEt=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),yEt=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function vEt(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=yEt.get(e))!==null&&t!==void 0?t:e}var jo;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(jo||(jo={}));const xEt=32;var vg;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(vg||(vg={}));function YB(e){return e>=jo.ZERO&&e<=jo.NINE}function wEt(e){return e>=jo.UPPER_A&&e<=jo.UPPER_F||e>=jo.LOWER_A&&e<=jo.LOWER_F}function OEt(e){return e>=jo.UPPER_A&&e<=jo.UPPER_Z||e>=jo.LOWER_A&&e<=jo.LOWER_Z||YB(e)}function kEt(e){return e===jo.EQUALS||OEt(e)}var ko;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(ko||(ko={}));var xp;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(xp||(xp={}));class SEt{constructor(t,n,i){this.decodeTree=t,this.emitCodePoint=n,this.errors=i,this.state=ko.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=xp.Strict}startEntity(t){this.decodeMode=t,this.state=ko.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case ko.EntityStart:return t.charCodeAt(n)===jo.NUM?(this.state=ko.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=ko.NamedEntity,this.stateNamedEntity(t,n));case ko.NumericStart:return this.stateNumericStart(t,n);case ko.NumericDecimal:return this.stateNumericDecimal(t,n);case ko.NumericHex:return this.stateNumericHex(t,n);case ko.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|xEt)===jo.LOWER_X?(this.state=ko.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=ko.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,i,r){if(n!==i){const s=i-n;this.result=this.result*Math.pow(r,s)+Number.parseInt(t.substr(n,s),r),this.consumed+=s}}stateNumericHex(t,n){const i=n;for(;n>14;for(;n>14,s!==0){if(o===jo.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==xp.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:i}=this,r=(i[n]&vg.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,r,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,i){const{decodeTree:r}=this;return this.emitCodePoint(n===1?r[t]&~vg.VALUE_LENGTH:r[t+1],i),n===3&&this.emitCodePoint(r[t+2],i),i}end(){var t;switch(this.state){case ko.NamedEntity:return this.result!==0&&(this.decodeMode!==xp.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case ko.NumericDecimal:return this.emitNumericEntity(0,2);case ko.NumericHex:return this.emitNumericEntity(0,3);case ko.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ko.EntityStart:return 0}}}function EEt(e,t,n,i){const r=(t&vg.BRANCH_LENGTH)>>7,s=t&vg.JUMP_TABLE;if(r===0)return s!==0&&i===s?n:-1;if(s){const c=i-s;return c<0||c>=r?-1:e[n+c]-1}let o=n,l=o+r-1;for(;o<=l;){const c=o+l>>>1,u=e[c];if(ui)l=c-1;else return e[c+r]}return-1}var Rt;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(Rt||(Rt={}));var Ky;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(Ky||(Ky={}));var rd;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(rd||(rd={}));var Je;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(Je||(Je={}));var B;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(B||(B={}));const CEt=new Map([[Je.A,B.A],[Je.ADDRESS,B.ADDRESS],[Je.ANNOTATION_XML,B.ANNOTATION_XML],[Je.APPLET,B.APPLET],[Je.AREA,B.AREA],[Je.ARTICLE,B.ARTICLE],[Je.ASIDE,B.ASIDE],[Je.B,B.B],[Je.BASE,B.BASE],[Je.BASEFONT,B.BASEFONT],[Je.BGSOUND,B.BGSOUND],[Je.BIG,B.BIG],[Je.BLOCKQUOTE,B.BLOCKQUOTE],[Je.BODY,B.BODY],[Je.BR,B.BR],[Je.BUTTON,B.BUTTON],[Je.CAPTION,B.CAPTION],[Je.CENTER,B.CENTER],[Je.CODE,B.CODE],[Je.COL,B.COL],[Je.COLGROUP,B.COLGROUP],[Je.DD,B.DD],[Je.DESC,B.DESC],[Je.DETAILS,B.DETAILS],[Je.DIALOG,B.DIALOG],[Je.DIR,B.DIR],[Je.DIV,B.DIV],[Je.DL,B.DL],[Je.DT,B.DT],[Je.EM,B.EM],[Je.EMBED,B.EMBED],[Je.FIELDSET,B.FIELDSET],[Je.FIGCAPTION,B.FIGCAPTION],[Je.FIGURE,B.FIGURE],[Je.FONT,B.FONT],[Je.FOOTER,B.FOOTER],[Je.FOREIGN_OBJECT,B.FOREIGN_OBJECT],[Je.FORM,B.FORM],[Je.FRAME,B.FRAME],[Je.FRAMESET,B.FRAMESET],[Je.H1,B.H1],[Je.H2,B.H2],[Je.H3,B.H3],[Je.H4,B.H4],[Je.H5,B.H5],[Je.H6,B.H6],[Je.HEAD,B.HEAD],[Je.HEADER,B.HEADER],[Je.HGROUP,B.HGROUP],[Je.HR,B.HR],[Je.HTML,B.HTML],[Je.I,B.I],[Je.IMG,B.IMG],[Je.IMAGE,B.IMAGE],[Je.INPUT,B.INPUT],[Je.IFRAME,B.IFRAME],[Je.KEYGEN,B.KEYGEN],[Je.LABEL,B.LABEL],[Je.LI,B.LI],[Je.LINK,B.LINK],[Je.LISTING,B.LISTING],[Je.MAIN,B.MAIN],[Je.MALIGNMARK,B.MALIGNMARK],[Je.MARQUEE,B.MARQUEE],[Je.MATH,B.MATH],[Je.MENU,B.MENU],[Je.META,B.META],[Je.MGLYPH,B.MGLYPH],[Je.MI,B.MI],[Je.MO,B.MO],[Je.MN,B.MN],[Je.MS,B.MS],[Je.MTEXT,B.MTEXT],[Je.NAV,B.NAV],[Je.NOBR,B.NOBR],[Je.NOFRAMES,B.NOFRAMES],[Je.NOEMBED,B.NOEMBED],[Je.NOSCRIPT,B.NOSCRIPT],[Je.OBJECT,B.OBJECT],[Je.OL,B.OL],[Je.OPTGROUP,B.OPTGROUP],[Je.OPTION,B.OPTION],[Je.P,B.P],[Je.PARAM,B.PARAM],[Je.PLAINTEXT,B.PLAINTEXT],[Je.PRE,B.PRE],[Je.RB,B.RB],[Je.RP,B.RP],[Je.RT,B.RT],[Je.RTC,B.RTC],[Je.RUBY,B.RUBY],[Je.S,B.S],[Je.SCRIPT,B.SCRIPT],[Je.SEARCH,B.SEARCH],[Je.SECTION,B.SECTION],[Je.SELECT,B.SELECT],[Je.SOURCE,B.SOURCE],[Je.SMALL,B.SMALL],[Je.SPAN,B.SPAN],[Je.STRIKE,B.STRIKE],[Je.STRONG,B.STRONG],[Je.STYLE,B.STYLE],[Je.SUB,B.SUB],[Je.SUMMARY,B.SUMMARY],[Je.SUP,B.SUP],[Je.TABLE,B.TABLE],[Je.TBODY,B.TBODY],[Je.TEMPLATE,B.TEMPLATE],[Je.TEXTAREA,B.TEXTAREA],[Je.TFOOT,B.TFOOT],[Je.TD,B.TD],[Je.TH,B.TH],[Je.THEAD,B.THEAD],[Je.TITLE,B.TITLE],[Je.TR,B.TR],[Je.TRACK,B.TRACK],[Je.TT,B.TT],[Je.U,B.U],[Je.UL,B.UL],[Je.SVG,B.SVG],[Je.VAR,B.VAR],[Je.WBR,B.WBR],[Je.XMP,B.XMP]]);function nO(e){var t;return(t=CEt.get(e))!==null&&t!==void 0?t:B.UNKNOWN}const Mt=B,AEt={[Rt.HTML]:new Set([Mt.ADDRESS,Mt.APPLET,Mt.AREA,Mt.ARTICLE,Mt.ASIDE,Mt.BASE,Mt.BASEFONT,Mt.BGSOUND,Mt.BLOCKQUOTE,Mt.BODY,Mt.BR,Mt.BUTTON,Mt.CAPTION,Mt.CENTER,Mt.COL,Mt.COLGROUP,Mt.DD,Mt.DETAILS,Mt.DIR,Mt.DIV,Mt.DL,Mt.DT,Mt.EMBED,Mt.FIELDSET,Mt.FIGCAPTION,Mt.FIGURE,Mt.FOOTER,Mt.FORM,Mt.FRAME,Mt.FRAMESET,Mt.H1,Mt.H2,Mt.H3,Mt.H4,Mt.H5,Mt.H6,Mt.HEAD,Mt.HEADER,Mt.HGROUP,Mt.HR,Mt.HTML,Mt.IFRAME,Mt.IMG,Mt.INPUT,Mt.LI,Mt.LINK,Mt.LISTING,Mt.MAIN,Mt.MARQUEE,Mt.MENU,Mt.META,Mt.NAV,Mt.NOEMBED,Mt.NOFRAMES,Mt.NOSCRIPT,Mt.OBJECT,Mt.OL,Mt.P,Mt.PARAM,Mt.PLAINTEXT,Mt.PRE,Mt.SCRIPT,Mt.SECTION,Mt.SELECT,Mt.SOURCE,Mt.STYLE,Mt.SUMMARY,Mt.TABLE,Mt.TBODY,Mt.TD,Mt.TEMPLATE,Mt.TEXTAREA,Mt.TFOOT,Mt.TH,Mt.THEAD,Mt.TITLE,Mt.TR,Mt.TRACK,Mt.UL,Mt.WBR,Mt.XMP]),[Rt.MATHML]:new Set([Mt.MI,Mt.MO,Mt.MN,Mt.MS,Mt.MTEXT,Mt.ANNOTATION_XML]),[Rt.SVG]:new Set([Mt.TITLE,Mt.FOREIGN_OBJECT,Mt.DESC]),[Rt.XLINK]:new Set,[Rt.XML]:new Set,[Rt.XMLNS]:new Set},ZB=new Set([Mt.H1,Mt.H2,Mt.H3,Mt.H4,Mt.H5,Mt.H6]);Je.STYLE,Je.SCRIPT,Je.XMP,Je.IFRAME,Je.NOEMBED,Je.NOFRAMES,Je.PLAINTEXT;var Ce;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(Ce||(Ce={}));const Aa={DATA:Ce.DATA,RCDATA:Ce.RCDATA,RAWTEXT:Ce.RAWTEXT,SCRIPT_DATA:Ce.SCRIPT_DATA,PLAINTEXT:Ce.PLAINTEXT,CDATA_SECTION:Ce.CDATA_SECTION};function TEt(e){return e>=xe.DIGIT_0&&e<=xe.DIGIT_9}function oS(e){return e>=xe.LATIN_CAPITAL_A&&e<=xe.LATIN_CAPITAL_Z}function _Et(e){return e>=xe.LATIN_SMALL_A&&e<=xe.LATIN_SMALL_Z}function Vm(e){return _Et(e)||oS(e)}function une(e){return Vm(e)||TEt(e)}function A_(e){return e+32}function mMe(e){return e===xe.SPACE||e===xe.LINE_FEED||e===xe.TABULATION||e===xe.FORM_FEED}function dne(e){return mMe(e)||e===xe.SOLIDUS||e===xe.GREATER_THAN_SIGN}function jEt(e){return e===xe.NULL?dt.nullCharacterReference:e>1114111?dt.characterReferenceOutsideUnicodeRange:dMe(e)?dt.surrogateCharacterReference:hMe(e)?dt.noncharacterCharacterReference:fMe(e)||e===xe.CARRIAGE_RETURN?dt.controlCharacterReference:null}class NEt{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=Ce.DATA,this.returnState=Ce.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new gEt(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new SEt(bEt,(i,r)=>{this.preprocessor.pos=this.entityStartPos+r-1,this._flushCodePointConsumedAsCharacterReference(i)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(dt.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:i=>{this._err(dt.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+i)},validateNumericCharacterReference:i=>{const r=jEt(i);r&&this._err(r,1)}}:void 0)}_err(t,n=0){var i,r;(r=(i=this.handler).onParseError)===null||r===void 0||r.call(i,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==null||t())}write(t,n,i){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||i==null||i()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n0&&this._err(dt.endTagWithAttributes),t.selfClosing&&this._err(dt.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case Fi.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Fi.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Fi.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:Fi.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=mMe(t)?Fi.WHITESPACE_CHARACTER:t===xe.NULL?Fi.NULL_CHARACTER:Fi.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(Fi.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=Ce.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?xp.Attribute:xp.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===Ce.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===Ce.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===Ce.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case Ce.DATA:{this._stateData(t);break}case Ce.RCDATA:{this._stateRcdata(t);break}case Ce.RAWTEXT:{this._stateRawtext(t);break}case Ce.SCRIPT_DATA:{this._stateScriptData(t);break}case Ce.PLAINTEXT:{this._statePlaintext(t);break}case Ce.TAG_OPEN:{this._stateTagOpen(t);break}case Ce.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case Ce.TAG_NAME:{this._stateTagName(t);break}case Ce.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case Ce.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case Ce.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case Ce.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case Ce.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case Ce.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case Ce.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case Ce.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case Ce.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case Ce.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case Ce.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case Ce.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case Ce.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case Ce.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case Ce.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case Ce.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case Ce.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case Ce.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case Ce.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case Ce.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case Ce.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case Ce.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case Ce.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case Ce.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case Ce.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case Ce.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case Ce.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case Ce.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case Ce.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case Ce.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case Ce.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case Ce.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case Ce.BOGUS_COMMENT:{this._stateBogusComment(t);break}case Ce.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case Ce.COMMENT_START:{this._stateCommentStart(t);break}case Ce.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case Ce.COMMENT:{this._stateComment(t);break}case Ce.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case Ce.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case Ce.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case Ce.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case Ce.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case Ce.COMMENT_END:{this._stateCommentEnd(t);break}case Ce.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case Ce.DOCTYPE:{this._stateDoctype(t);break}case Ce.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case Ce.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case Ce.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case Ce.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case Ce.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case Ce.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case Ce.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case Ce.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case Ce.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case Ce.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case Ce.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case Ce.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case Ce.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case Ce.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case Ce.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case Ce.CDATA_SECTION:{this._stateCdataSection(t);break}case Ce.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case Ce.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case Ce.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case Ce.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case xe.LESS_THAN_SIGN:{this.state=Ce.TAG_OPEN;break}case xe.AMPERSAND:{this._startCharacterReference();break}case xe.NULL:{this._err(dt.unexpectedNullCharacter),this._emitCodePoint(t);break}case xe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case xe.AMPERSAND:{this._startCharacterReference();break}case xe.LESS_THAN_SIGN:{this.state=Ce.RCDATA_LESS_THAN_SIGN;break}case xe.NULL:{this._err(dt.unexpectedNullCharacter),this._emitChars(Bs);break}case xe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case xe.LESS_THAN_SIGN:{this.state=Ce.RAWTEXT_LESS_THAN_SIGN;break}case xe.NULL:{this._err(dt.unexpectedNullCharacter),this._emitChars(Bs);break}case xe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case xe.LESS_THAN_SIGN:{this.state=Ce.SCRIPT_DATA_LESS_THAN_SIGN;break}case xe.NULL:{this._err(dt.unexpectedNullCharacter),this._emitChars(Bs);break}case xe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case xe.NULL:{this._err(dt.unexpectedNullCharacter),this._emitChars(Bs);break}case xe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(Vm(t))this._createStartTagToken(),this.state=Ce.TAG_NAME,this._stateTagName(t);else switch(t){case xe.EXCLAMATION_MARK:{this.state=Ce.MARKUP_DECLARATION_OPEN;break}case xe.SOLIDUS:{this.state=Ce.END_TAG_OPEN;break}case xe.QUESTION_MARK:{this._err(dt.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=Ce.BOGUS_COMMENT,this._stateBogusComment(t);break}case xe.EOF:{this._err(dt.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(dt.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=Ce.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(Vm(t))this._createEndTagToken(),this.state=Ce.TAG_NAME,this._stateTagName(t);else switch(t){case xe.GREATER_THAN_SIGN:{this._err(dt.missingEndTagName),this.state=Ce.DATA;break}case xe.EOF:{this._err(dt.eofBeforeTagName),this._emitChars("");break}case xe.NULL:{this._err(dt.unexpectedNullCharacter),this.state=Ce.SCRIPT_DATA_ESCAPED,this._emitChars(Bs);break}case xe.EOF:{this._err(dt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Ce.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===xe.SOLIDUS?this.state=Ce.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Vm(t)?(this._emitChars("<"),this.state=Ce.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=Ce.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){Vm(t)?(this.state=Ce.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("");break}case xe.NULL:{this._err(dt.unexpectedNullCharacter),this.state=Ce.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Bs);break}case xe.EOF:{this._err(dt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Ce.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===xe.SOLIDUS?(this.state=Ce.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=Ce.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(wc.SCRIPT,!1)&&dne(this.preprocessor.peek(wc.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const i=this._indexOf(t);this.items[i]=n,i===this.stackTop&&(this.current=n)}insertAfter(t,n,i){const r=this._indexOf(t)+1;this.items.splice(r,0,n),this.tagIDs.splice(r,0,i),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==Rt.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop=0;i--)if(t.has(this.tagIDs[i])&&this.treeAdapter.getNamespaceURI(this.items[i])===n)return i;return-1}clearBackTo(t,n){const i=this._indexOfTagNames(t,n);this.shortenToLength(i+1)}clearBackToTableContext(){this.clearBackTo(MEt,Rt.HTML)}clearBackToTableBodyContext(){this.clearBackTo(DEt,Rt.HTML)}clearBackToTableRowContext(){this.clearBackTo(PEt,Rt.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===B.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===B.HTML}hasInDynamicScope(t,n){for(let i=this.stackTop;i>=0;i--){const r=this.tagIDs[i];switch(this.treeAdapter.getNamespaceURI(this.items[i])){case Rt.HTML:{if(r===t)return!0;if(n.has(r))return!1;break}case Rt.SVG:{if(pne.has(r))return!1;break}case Rt.MATHML:{if(hne.has(r))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,AI)}hasInListItemScope(t){return this.hasInDynamicScope(t,REt)}hasInButtonScope(t){return this.hasInDynamicScope(t,IEt)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case Rt.HTML:{if(ZB.has(n))return!0;if(AI.has(n))return!1;break}case Rt.SVG:{if(pne.has(n))return!1;break}case Rt.MATHML:{if(hne.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Rt.HTML)switch(this.tagIDs[n]){case t:return!0;case B.TABLE:case B.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===Rt.HTML)switch(this.tagIDs[t]){case B.TBODY:case B.THEAD:case B.TFOOT:return!0;case B.TABLE:case B.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Rt.HTML)switch(this.tagIDs[n]){case t:return!0;case B.OPTION:case B.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&gMe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&fne.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&fne.has(this.currentTagId);)this.pop()}}const _4=3;var Kf;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Kf||(Kf={}));const mne={type:Kf.Marker};class FEt{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const i=[],r=n.length,s=this.treeAdapter.getTagName(t),o=this.treeAdapter.getNamespaceURI(t);for(let l=0;l[o.name,o.value]));let s=0;for(let o=0;or.get(c.name)===c.value)&&(s+=1,s>=_4&&this.entries.splice(l.idx,1))}}insertMarker(){this.entries.unshift(mne)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Kf.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const i=this.entries.indexOf(this.bookmark);this.entries.splice(i,0,{type:Kf.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(mne);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(i=>i.type===Kf.Marker||this.treeAdapter.getTagName(i.element)===t);return n&&n.type===Kf.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Kf.Element&&n.element===t)}}const Hm={createDocument(){return{nodeName:"#document",mode:rd.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const i=e.childNodes.indexOf(n);e.childNodes.splice(i,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,i){const r=e.childNodes.find(s=>s.nodeName==="#documentType");if(r)r.name=t,r.publicId=n,r.systemId=i;else{const s={nodeName:"#documentType",name:t,publicId:n,systemId:i,parentNode:null};Hm.appendChild(e,s)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(Hm.isTextNode(n)){n.value+=t;return}}Hm.appendChild(e,Hm.createTextNode(t))},insertTextBefore(e,t,n){const i=e.childNodes[e.childNodes.indexOf(n)-1];i&&Hm.isTextNode(i)?i.value+=t:Hm.insertBefore(e,Hm.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(i=>i.name));for(let i=0;ie.startsWith(n))}function HEt(e){return e.name===bMe&&e.publicId===null&&(e.systemId===null||e.systemId===BEt)}function qEt(e){if(e.name!==bMe)return rd.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===UEt)return rd.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),zEt.has(n))return rd.QUIRKS;let i=t===null?QEt:yMe;if(gne(n,i))return rd.QUIRKS;if(i=t===null?vMe:VEt,gne(n,i))return rd.LIMITED_QUIRKS}return rd.NO_QUIRKS}const bne={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},WEt="definitionurl",KEt="definitionURL",GEt=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),XEt=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Rt.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Rt.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Rt.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Rt.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Rt.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Rt.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Rt.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Rt.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Rt.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Rt.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Rt.XMLNS}]]),YEt=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),ZEt=new Set([B.B,B.BIG,B.BLOCKQUOTE,B.BODY,B.BR,B.CENTER,B.CODE,B.DD,B.DIV,B.DL,B.DT,B.EM,B.EMBED,B.H1,B.H2,B.H3,B.H4,B.H5,B.H6,B.HEAD,B.HR,B.I,B.IMG,B.LI,B.LISTING,B.MENU,B.META,B.NOBR,B.OL,B.P,B.PRE,B.RUBY,B.S,B.SMALL,B.SPAN,B.STRONG,B.STRIKE,B.SUB,B.SUP,B.TABLE,B.TT,B.U,B.UL,B.VAR]);function JEt(e){const t=e.tagID;return t===B.FONT&&e.attrs.some(({name:i})=>i===Ky.COLOR||i===Ky.SIZE||i===Ky.FACE)||ZEt.has(t)}function xMe(e){for(let t=0;t0&&this._setContextModes(t,n)}onItemPop(t,n){var i,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(r=(i=this.treeAdapter).onItemPop)===null||r===void 0||r.call(i,t,this.openElements.current),n){let s,o;this.openElements.stackTop===0&&this.fragmentContext?(s=this.fragmentContext,o=this.fragmentContextID):{current:s,currentTagId:o}=this.openElements,this._setContextModes(s,o)}}_setContextModes(t,n){const i=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===Rt.HTML;this.currentNotInHTML=!i,this.tokenizer.inForeignNode=!i&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,Rt.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=Ie.TEXT}switchToPlaintextParsing(){this.insertionMode=Ie.TEXT,this.originalInsertionMode=Ie.IN_BODY,this.tokenizer.state=Aa.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===Je.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Rt.HTML))switch(this.fragmentContextID){case B.TITLE:case B.TEXTAREA:{this.tokenizer.state=Aa.RCDATA;break}case B.STYLE:case B.XMP:case B.IFRAME:case B.NOEMBED:case B.NOFRAMES:case B.NOSCRIPT:{this.tokenizer.state=Aa.RAWTEXT;break}case B.SCRIPT:{this.tokenizer.state=Aa.SCRIPT_DATA;break}case B.PLAINTEXT:{this.tokenizer.state=Aa.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",i=t.publicId||"",r=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,i,r),t.location){const o=this.treeAdapter.getChildNodes(this.document).find(l=>this.treeAdapter.isDocumentTypeNode(l));o&&this.treeAdapter.setNodeSourceCodeLocation(o,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const i=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,i)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const i=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(i??this.document,t)}}_appendElement(t,n){const i=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(i,t.location)}_insertElement(t,n){const i=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(i,t.location),this.openElements.push(i,t.tagID)}_insertFakeElement(t,n){const i=this.treeAdapter.createElement(t,Rt.HTML,[]);this._attachElementToTree(i,null),this.openElements.push(i,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,Rt.HTML,t.attrs),i=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,i),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(Je.HTML,Rt.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,B.HTML)}_appendCommentNode(t,n){const i=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,i),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,t.location)}_insertCharacters(t){let n,i;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:i}=this._findFosterParentingLocation(),i?this.treeAdapter.insertTextBefore(n,t.chars,i):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const r=this.treeAdapter.getChildNodes(n),s=i?r.lastIndexOf(i):r.length,o=r[s-1];if(this.treeAdapter.getNodeSourceCodeLocation(o)){const{endLine:c,endCol:u,endOffset:d}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(o,{endLine:c,endCol:u,endOffset:d})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(o,t.location)}_adoptNodes(t,n){for(let i=this.treeAdapter.getFirstChild(t);i;i=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(i),this.treeAdapter.appendChild(n,i)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const i=n.location,r=this.treeAdapter.getTagName(t),s=n.type===Fi.END_TAG&&r===n.tagName?{endTag:{...i},endLine:i.endLine,endCol:i.endCol,endOffset:i.endOffset}:{endLine:i.startLine,endCol:i.startCol,endOffset:i.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,s)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,i;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,i=this.fragmentContextID):{current:n,currentTagId:i}=this.openElements,t.tagID===B.SVG&&this.treeAdapter.getTagName(n)===Je.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===Rt.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===B.MGLYPH||t.tagID===B.MALIGNMARK)&&i!==void 0&&!this._isIntegrationPoint(i,n,Rt.HTML)}_processToken(t){switch(t.type){case Fi.CHARACTER:{this.onCharacter(t);break}case Fi.NULL_CHARACTER:{this.onNullCharacter(t);break}case Fi.COMMENT:{this.onComment(t);break}case Fi.DOCTYPE:{this.onDoctype(t);break}case Fi.START_TAG:{this._processStartTag(t);break}case Fi.END_TAG:{this.onEndTag(t);break}case Fi.EOF:{this.onEof(t);break}case Fi.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,i){const r=this.treeAdapter.getNamespaceURI(n),s=this.treeAdapter.getAttrList(n);return iCt(t,r,s,i)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(r=>r.type===Kf.Marker||this.openElements.contains(r.element)),i=n===-1?t-1:n-1;for(let r=i;r>=0;r--){const s=this.activeFormattingElements.entries[r];this._insertElement(s.token,this.treeAdapter.getNamespaceURI(s.element)),s.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=Ie.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(B.P),this.openElements.popUntilTagNamePopped(B.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case B.TR:{this.insertionMode=Ie.IN_ROW;return}case B.TBODY:case B.THEAD:case B.TFOOT:{this.insertionMode=Ie.IN_TABLE_BODY;return}case B.CAPTION:{this.insertionMode=Ie.IN_CAPTION;return}case B.COLGROUP:{this.insertionMode=Ie.IN_COLUMN_GROUP;return}case B.TABLE:{this.insertionMode=Ie.IN_TABLE;return}case B.BODY:{this.insertionMode=Ie.IN_BODY;return}case B.FRAMESET:{this.insertionMode=Ie.IN_FRAMESET;return}case B.SELECT:{this._resetInsertionModeForSelect(t);return}case B.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case B.HTML:{this.insertionMode=this.headElement?Ie.AFTER_HEAD:Ie.BEFORE_HEAD;return}case B.TD:case B.TH:{if(t>0){this.insertionMode=Ie.IN_CELL;return}break}case B.HEAD:{if(t>0){this.insertionMode=Ie.IN_HEAD;return}break}}this.insertionMode=Ie.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const i=this.openElements.tagIDs[n];if(i===B.TEMPLATE)break;if(i===B.TABLE){this.insertionMode=Ie.IN_SELECT_IN_TABLE;return}}this.insertionMode=Ie.IN_SELECT}_isElementCausesFosterParenting(t){return OMe.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case B.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===Rt.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case B.TABLE:{const i=this.treeAdapter.getParentNode(n);return i?{parent:i,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const i=this.treeAdapter.getNamespaceURI(t);return AEt[i].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){LAt(this,t);return}switch(this.insertionMode){case Ie.INITIAL:{hk(this,t);break}case Ie.BEFORE_HTML:{rE(this,t);break}case Ie.BEFORE_HEAD:{sE(this,t);break}case Ie.IN_HEAD:{aE(this,t);break}case Ie.IN_HEAD_NO_SCRIPT:{oE(this,t);break}case Ie.AFTER_HEAD:{lE(this,t);break}case Ie.IN_BODY:case Ie.IN_CAPTION:case Ie.IN_CELL:case Ie.IN_TEMPLATE:{SMe(this,t);break}case Ie.TEXT:case Ie.IN_SELECT:case Ie.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case Ie.IN_TABLE:case Ie.IN_TABLE_BODY:case Ie.IN_ROW:{j4(this,t);break}case Ie.IN_TABLE_TEXT:{jMe(this,t);break}case Ie.IN_COLUMN_GROUP:{TI(this,t);break}case Ie.AFTER_BODY:{_I(this,t);break}case Ie.AFTER_AFTER_BODY:{jN(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){MAt(this,t);return}switch(this.insertionMode){case Ie.INITIAL:{hk(this,t);break}case Ie.BEFORE_HTML:{rE(this,t);break}case Ie.BEFORE_HEAD:{sE(this,t);break}case Ie.IN_HEAD:{aE(this,t);break}case Ie.IN_HEAD_NO_SCRIPT:{oE(this,t);break}case Ie.AFTER_HEAD:{lE(this,t);break}case Ie.TEXT:{this._insertCharacters(t);break}case Ie.IN_TABLE:case Ie.IN_TABLE_BODY:case Ie.IN_ROW:{j4(this,t);break}case Ie.IN_COLUMN_GROUP:{TI(this,t);break}case Ie.AFTER_BODY:{_I(this,t);break}case Ie.AFTER_AFTER_BODY:{jN(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){JB(this,t);return}switch(this.insertionMode){case Ie.INITIAL:case Ie.BEFORE_HTML:case Ie.BEFORE_HEAD:case Ie.IN_HEAD:case Ie.IN_HEAD_NO_SCRIPT:case Ie.AFTER_HEAD:case Ie.IN_BODY:case Ie.IN_TABLE:case Ie.IN_CAPTION:case Ie.IN_COLUMN_GROUP:case Ie.IN_TABLE_BODY:case Ie.IN_ROW:case Ie.IN_CELL:case Ie.IN_SELECT:case Ie.IN_SELECT_IN_TABLE:case Ie.IN_TEMPLATE:case Ie.IN_FRAMESET:case Ie.AFTER_FRAMESET:{JB(this,t);break}case Ie.IN_TABLE_TEXT:{pk(this,t);break}case Ie.AFTER_BODY:{pCt(this,t);break}case Ie.AFTER_AFTER_BODY:case Ie.AFTER_AFTER_FRAMESET:{mCt(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case Ie.INITIAL:{gCt(this,t);break}case Ie.BEFORE_HEAD:case Ie.IN_HEAD:case Ie.IN_HEAD_NO_SCRIPT:case Ie.AFTER_HEAD:{this._err(t,dt.misplacedDoctype);break}case Ie.IN_TABLE_TEXT:{pk(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,dt.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?$At(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case Ie.INITIAL:{hk(this,t);break}case Ie.BEFORE_HTML:{bCt(this,t);break}case Ie.BEFORE_HEAD:{vCt(this,t);break}case Ie.IN_HEAD:{_f(this,t);break}case Ie.IN_HEAD_NO_SCRIPT:{OCt(this,t);break}case Ie.AFTER_HEAD:{SCt(this,t);break}case Ie.IN_BODY:{Pl(this,t);break}case Ie.IN_TABLE:{i1(this,t);break}case Ie.IN_TABLE_TEXT:{pk(this,t);break}case Ie.IN_CAPTION:{xAt(this,t);break}case Ie.IN_COLUMN_GROUP:{rq(this,t);break}case Ie.IN_TABLE_BODY:{TM(this,t);break}case Ie.IN_ROW:{_M(this,t);break}case Ie.IN_CELL:{kAt(this,t);break}case Ie.IN_SELECT:{IMe(this,t);break}case Ie.IN_SELECT_IN_TABLE:{EAt(this,t);break}case Ie.IN_TEMPLATE:{AAt(this,t);break}case Ie.AFTER_BODY:{_At(this,t);break}case Ie.IN_FRAMESET:{jAt(this,t);break}case Ie.AFTER_FRAMESET:{RAt(this,t);break}case Ie.AFTER_AFTER_BODY:{PAt(this,t);break}case Ie.AFTER_AFTER_FRAMESET:{DAt(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?FAt(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case Ie.INITIAL:{hk(this,t);break}case Ie.BEFORE_HTML:{yCt(this,t);break}case Ie.BEFORE_HEAD:{xCt(this,t);break}case Ie.IN_HEAD:{wCt(this,t);break}case Ie.IN_HEAD_NO_SCRIPT:{kCt(this,t);break}case Ie.AFTER_HEAD:{ECt(this,t);break}case Ie.IN_BODY:{AM(this,t);break}case Ie.TEXT:{uAt(this,t);break}case Ie.IN_TABLE:{wC(this,t);break}case Ie.IN_TABLE_TEXT:{pk(this,t);break}case Ie.IN_CAPTION:{wAt(this,t);break}case Ie.IN_COLUMN_GROUP:{OAt(this,t);break}case Ie.IN_TABLE_BODY:{e9(this,t);break}case Ie.IN_ROW:{RMe(this,t);break}case Ie.IN_CELL:{SAt(this,t);break}case Ie.IN_SELECT:{PMe(this,t);break}case Ie.IN_SELECT_IN_TABLE:{CAt(this,t);break}case Ie.IN_TEMPLATE:{TAt(this,t);break}case Ie.AFTER_BODY:{MMe(this,t);break}case Ie.IN_FRAMESET:{NAt(this,t);break}case Ie.AFTER_FRAMESET:{IAt(this,t);break}case Ie.AFTER_AFTER_BODY:{jN(this,t);break}}}onEof(t){switch(this.insertionMode){case Ie.INITIAL:{hk(this,t);break}case Ie.BEFORE_HTML:{rE(this,t);break}case Ie.BEFORE_HEAD:{sE(this,t);break}case Ie.IN_HEAD:{aE(this,t);break}case Ie.IN_HEAD_NO_SCRIPT:{oE(this,t);break}case Ie.AFTER_HEAD:{lE(this,t);break}case Ie.IN_BODY:case Ie.IN_TABLE:case Ie.IN_CAPTION:case Ie.IN_COLUMN_GROUP:case Ie.IN_TABLE_BODY:case Ie.IN_ROW:case Ie.IN_CELL:case Ie.IN_SELECT:case Ie.IN_SELECT_IN_TABLE:{TMe(this,t);break}case Ie.TEXT:{dAt(this,t);break}case Ie.IN_TABLE_TEXT:{pk(this,t);break}case Ie.IN_TEMPLATE:{DMe(this,t);break}case Ie.AFTER_BODY:case Ie.IN_FRAMESET:case Ie.AFTER_FRAMESET:case Ie.AFTER_AFTER_BODY:case Ie.AFTER_AFTER_FRAMESET:{iq(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===xe.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case Ie.IN_HEAD:case Ie.IN_HEAD_NO_SCRIPT:case Ie.AFTER_HEAD:case Ie.TEXT:case Ie.IN_COLUMN_GROUP:case Ie.IN_SELECT:case Ie.IN_SELECT_IN_TABLE:case Ie.IN_FRAMESET:case Ie.AFTER_FRAMESET:{this._insertCharacters(t);break}case Ie.IN_BODY:case Ie.IN_CAPTION:case Ie.IN_CELL:case Ie.IN_TEMPLATE:case Ie.AFTER_BODY:case Ie.AFTER_AFTER_BODY:case Ie.AFTER_AFTER_FRAMESET:{kMe(this,t);break}case Ie.IN_TABLE:case Ie.IN_TABLE_BODY:case Ie.IN_ROW:{j4(this,t);break}case Ie.IN_TABLE_TEXT:{_Me(this,t);break}}}};function lCt(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):AMe(e,t),n}function cCt(e,t){let n=null,i=e.openElements.stackTop;for(;i>=0;i--){const r=e.openElements.items[i];if(r===t.element)break;e._isSpecialElement(r,e.openElements.tagIDs[i])&&(n=r)}return n||(e.openElements.shortenToLength(Math.max(i,0)),e.activeFormattingElements.removeEntry(t)),n}function uCt(e,t,n){let i=t,r=e.openElements.getCommonAncestor(t);for(let s=0,o=r;o!==n;s++,o=r){r=e.openElements.getCommonAncestor(o);const l=e.activeFormattingElements.getElementEntry(o),c=l&&s>=aCt;!l||c?(c&&e.activeFormattingElements.removeEntry(l),e.openElements.remove(o)):(o=dCt(e,l),i===t&&(e.activeFormattingElements.bookmark=l),e.treeAdapter.detachNode(i),e.treeAdapter.appendChild(o,i),i=o)}return i}function dCt(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),i=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,i),t.element=i,i}function fCt(e,t,n){const i=e.treeAdapter.getTagName(t),r=nO(i);if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{const s=e.treeAdapter.getNamespaceURI(t);r===B.TEMPLATE&&s===Rt.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function hCt(e,t,n){const i=e.treeAdapter.getNamespaceURI(n.element),{token:r}=n,s=e.treeAdapter.createElement(r.tagName,i,r.attrs);e._adoptNodes(t,s),e.treeAdapter.appendChild(t,s),e.activeFormattingElements.insertElementAfterBookmark(s,r),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,s,r.tagID)}function nq(e,t){for(let n=0;n=n;i--)e._setEndLocation(e.openElements.items[i],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const i=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(i);if(r&&!r.endTag&&(e._setEndLocation(i,t),e.openElements.stackTop>=1)){const s=e.openElements.items[1],o=e.treeAdapter.getNodeSourceCodeLocation(s);o&&!o.endTag&&e._setEndLocation(s,t)}}}}function gCt(e,t){e._setDocumentType(t);const n=t.forceQuirks?rd.QUIRKS:qEt(t);HEt(t)||e._err(t,dt.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=Ie.BEFORE_HTML}function hk(e,t){e._err(t,dt.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,rd.QUIRKS),e.insertionMode=Ie.BEFORE_HTML,e._processToken(t)}function bCt(e,t){t.tagID===B.HTML?(e._insertElement(t,Rt.HTML),e.insertionMode=Ie.BEFORE_HEAD):rE(e,t)}function yCt(e,t){const n=t.tagID;(n===B.HTML||n===B.HEAD||n===B.BODY||n===B.BR)&&rE(e,t)}function rE(e,t){e._insertFakeRootElement(),e.insertionMode=Ie.BEFORE_HEAD,e._processToken(t)}function vCt(e,t){switch(t.tagID){case B.HTML:{Pl(e,t);break}case B.HEAD:{e._insertElement(t,Rt.HTML),e.headElement=e.openElements.current,e.insertionMode=Ie.IN_HEAD;break}default:sE(e,t)}}function xCt(e,t){const n=t.tagID;n===B.HEAD||n===B.BODY||n===B.HTML||n===B.BR?sE(e,t):e._err(t,dt.endTagWithoutMatchingOpenElement)}function sE(e,t){e._insertFakeElement(Je.HEAD,B.HEAD),e.headElement=e.openElements.current,e.insertionMode=Ie.IN_HEAD,e._processToken(t)}function _f(e,t){switch(t.tagID){case B.HTML:{Pl(e,t);break}case B.BASE:case B.BASEFONT:case B.BGSOUND:case B.LINK:case B.META:{e._appendElement(t,Rt.HTML),t.ackSelfClosing=!0;break}case B.TITLE:{e._switchToTextParsing(t,Aa.RCDATA);break}case B.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Aa.RAWTEXT):(e._insertElement(t,Rt.HTML),e.insertionMode=Ie.IN_HEAD_NO_SCRIPT);break}case B.NOFRAMES:case B.STYLE:{e._switchToTextParsing(t,Aa.RAWTEXT);break}case B.SCRIPT:{e._switchToTextParsing(t,Aa.SCRIPT_DATA);break}case B.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=Ie.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(Ie.IN_TEMPLATE);break}case B.HEAD:{e._err(t,dt.misplacedStartTagForHeadElement);break}default:aE(e,t)}}function wCt(e,t){switch(t.tagID){case B.HEAD:{e.openElements.pop(),e.insertionMode=Ie.AFTER_HEAD;break}case B.BODY:case B.BR:case B.HTML:{aE(e,t);break}case B.TEMPLATE:{X0(e,t);break}default:e._err(t,dt.endTagWithoutMatchingOpenElement)}}function X0(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==B.TEMPLATE&&e._err(t,dt.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(B.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,dt.endTagWithoutMatchingOpenElement)}function aE(e,t){e.openElements.pop(),e.insertionMode=Ie.AFTER_HEAD,e._processToken(t)}function OCt(e,t){switch(t.tagID){case B.HTML:{Pl(e,t);break}case B.BASEFONT:case B.BGSOUND:case B.HEAD:case B.LINK:case B.META:case B.NOFRAMES:case B.STYLE:{_f(e,t);break}case B.NOSCRIPT:{e._err(t,dt.nestedNoscriptInHead);break}default:oE(e,t)}}function kCt(e,t){switch(t.tagID){case B.NOSCRIPT:{e.openElements.pop(),e.insertionMode=Ie.IN_HEAD;break}case B.BR:{oE(e,t);break}default:e._err(t,dt.endTagWithoutMatchingOpenElement)}}function oE(e,t){const n=t.type===Fi.EOF?dt.openElementsLeftAfterEof:dt.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=Ie.IN_HEAD,e._processToken(t)}function SCt(e,t){switch(t.tagID){case B.HTML:{Pl(e,t);break}case B.BODY:{e._insertElement(t,Rt.HTML),e.framesetOk=!1,e.insertionMode=Ie.IN_BODY;break}case B.FRAMESET:{e._insertElement(t,Rt.HTML),e.insertionMode=Ie.IN_FRAMESET;break}case B.BASE:case B.BASEFONT:case B.BGSOUND:case B.LINK:case B.META:case B.NOFRAMES:case B.SCRIPT:case B.STYLE:case B.TEMPLATE:case B.TITLE:{e._err(t,dt.abandonedHeadElementChild),e.openElements.push(e.headElement,B.HEAD),_f(e,t),e.openElements.remove(e.headElement);break}case B.HEAD:{e._err(t,dt.misplacedStartTagForHeadElement);break}default:lE(e,t)}}function ECt(e,t){switch(t.tagID){case B.BODY:case B.HTML:case B.BR:{lE(e,t);break}case B.TEMPLATE:{X0(e,t);break}default:e._err(t,dt.endTagWithoutMatchingOpenElement)}}function lE(e,t){e._insertFakeElement(Je.BODY,B.BODY),e.insertionMode=Ie.IN_BODY,CM(e,t)}function CM(e,t){switch(t.type){case Fi.CHARACTER:{SMe(e,t);break}case Fi.WHITESPACE_CHARACTER:{kMe(e,t);break}case Fi.COMMENT:{JB(e,t);break}case Fi.START_TAG:{Pl(e,t);break}case Fi.END_TAG:{AM(e,t);break}case Fi.EOF:{TMe(e,t);break}}}function kMe(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function SMe(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function CCt(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function ACt(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function TCt(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,Rt.HTML),e.insertionMode=Ie.IN_FRAMESET)}function _Ct(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,Rt.HTML)}function jCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&ZB.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,Rt.HTML)}function NCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,Rt.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function RCt(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,Rt.HTML),n||(e.formElement=e.openElements.current))}function ICt(e,t){e.framesetOk=!1;const n=t.tagID;for(let i=e.openElements.stackTop;i>=0;i--){const r=e.openElements.tagIDs[i];if(n===B.LI&&r===B.LI||(n===B.DD||n===B.DT)&&(r===B.DD||r===B.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==B.ADDRESS&&r!==B.DIV&&r!==B.P&&e._isSpecialElement(e.openElements.items[i],r))break}e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,Rt.HTML)}function PCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,Rt.HTML),e.tokenizer.state=Aa.PLAINTEXT}function DCt(e,t){e.openElements.hasInScope(B.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(B.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,Rt.HTML),e.framesetOk=!1}function MCt(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(Je.A);n&&(nq(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,Rt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function LCt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Rt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function $Ct(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(B.NOBR)&&(nq(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,Rt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function FCt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Rt.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function BCt(e,t){e.treeAdapter.getDocumentMode(e.document)!==rd.QUIRKS&&e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,Rt.HTML),e.framesetOk=!1,e.insertionMode=Ie.IN_TABLE}function EMe(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Rt.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function CMe(e){const t=pMe(e,Ky.TYPE);return t!=null&&t.toLowerCase()===rCt}function UCt(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Rt.HTML),CMe(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function QCt(e,t){e._appendElement(t,Rt.HTML),t.ackSelfClosing=!0}function zCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._appendElement(t,Rt.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function VCt(e,t){t.tagName=Je.IMG,t.tagID=B.IMG,EMe(e,t)}function HCt(e,t){e._insertElement(t,Rt.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Aa.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=Ie.TEXT}function qCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Aa.RAWTEXT)}function WCt(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Aa.RAWTEXT)}function xne(e,t){e._switchToTextParsing(t,Aa.RAWTEXT)}function KCt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Rt.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===Ie.IN_TABLE||e.insertionMode===Ie.IN_CAPTION||e.insertionMode===Ie.IN_TABLE_BODY||e.insertionMode===Ie.IN_ROW||e.insertionMode===Ie.IN_CELL?Ie.IN_SELECT_IN_TABLE:Ie.IN_SELECT}function GCt(e,t){e.openElements.currentTagId===B.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,Rt.HTML)}function XCt(e,t){e.openElements.hasInScope(B.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,Rt.HTML)}function YCt(e,t){e.openElements.hasInScope(B.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(B.RTC),e._insertElement(t,Rt.HTML)}function ZCt(e,t){e._reconstructActiveFormattingElements(),xMe(t),tq(t),t.selfClosing?e._appendElement(t,Rt.MATHML):e._insertElement(t,Rt.MATHML),t.ackSelfClosing=!0}function JCt(e,t){e._reconstructActiveFormattingElements(),wMe(t),tq(t),t.selfClosing?e._appendElement(t,Rt.SVG):e._insertElement(t,Rt.SVG),t.ackSelfClosing=!0}function wne(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Rt.HTML)}function Pl(e,t){switch(t.tagID){case B.I:case B.S:case B.B:case B.U:case B.EM:case B.TT:case B.BIG:case B.CODE:case B.FONT:case B.SMALL:case B.STRIKE:case B.STRONG:{LCt(e,t);break}case B.A:{MCt(e,t);break}case B.H1:case B.H2:case B.H3:case B.H4:case B.H5:case B.H6:{jCt(e,t);break}case B.P:case B.DL:case B.OL:case B.UL:case B.DIV:case B.DIR:case B.NAV:case B.MAIN:case B.MENU:case B.ASIDE:case B.CENTER:case B.FIGURE:case B.FOOTER:case B.HEADER:case B.HGROUP:case B.DIALOG:case B.DETAILS:case B.ADDRESS:case B.ARTICLE:case B.SEARCH:case B.SECTION:case B.SUMMARY:case B.FIELDSET:case B.BLOCKQUOTE:case B.FIGCAPTION:{_Ct(e,t);break}case B.LI:case B.DD:case B.DT:{ICt(e,t);break}case B.BR:case B.IMG:case B.WBR:case B.AREA:case B.EMBED:case B.KEYGEN:{EMe(e,t);break}case B.HR:{zCt(e,t);break}case B.RB:case B.RTC:{XCt(e,t);break}case B.RT:case B.RP:{YCt(e,t);break}case B.PRE:case B.LISTING:{NCt(e,t);break}case B.XMP:{qCt(e,t);break}case B.SVG:{JCt(e,t);break}case B.HTML:{CCt(e,t);break}case B.BASE:case B.LINK:case B.META:case B.STYLE:case B.TITLE:case B.SCRIPT:case B.BGSOUND:case B.BASEFONT:case B.TEMPLATE:{_f(e,t);break}case B.BODY:{ACt(e,t);break}case B.FORM:{RCt(e,t);break}case B.NOBR:{$Ct(e,t);break}case B.MATH:{ZCt(e,t);break}case B.TABLE:{BCt(e,t);break}case B.INPUT:{UCt(e,t);break}case B.PARAM:case B.TRACK:case B.SOURCE:{QCt(e,t);break}case B.IMAGE:{VCt(e,t);break}case B.BUTTON:{DCt(e,t);break}case B.APPLET:case B.OBJECT:case B.MARQUEE:{FCt(e,t);break}case B.IFRAME:{WCt(e,t);break}case B.SELECT:{KCt(e,t);break}case B.OPTION:case B.OPTGROUP:{GCt(e,t);break}case B.NOEMBED:case B.NOFRAMES:{xne(e,t);break}case B.FRAMESET:{TCt(e,t);break}case B.TEXTAREA:{HCt(e,t);break}case B.NOSCRIPT:{e.options.scriptingEnabled?xne(e,t):wne(e,t);break}case B.PLAINTEXT:{PCt(e,t);break}case B.COL:case B.TH:case B.TD:case B.TR:case B.HEAD:case B.FRAME:case B.TBODY:case B.TFOOT:case B.THEAD:case B.CAPTION:case B.COLGROUP:break;default:wne(e,t)}}function eAt(e,t){if(e.openElements.hasInScope(B.BODY)&&(e.insertionMode=Ie.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function tAt(e,t){e.openElements.hasInScope(B.BODY)&&(e.insertionMode=Ie.AFTER_BODY,MMe(e,t))}function nAt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function iAt(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(B.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(B.FORM):n&&e.openElements.remove(n))}function rAt(e){e.openElements.hasInButtonScope(B.P)||e._insertFakeElement(Je.P,B.P),e._closePElement()}function sAt(e){e.openElements.hasInListItemScope(B.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(B.LI),e.openElements.popUntilTagNamePopped(B.LI))}function aAt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function oAt(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function lAt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function cAt(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(Je.BR,B.BR),e.openElements.pop(),e.framesetOk=!1}function AMe(e,t){const n=t.tagName,i=t.tagID;for(let r=e.openElements.stackTop;r>0;r--){const s=e.openElements.items[r],o=e.openElements.tagIDs[r];if(i===o&&(i!==B.UNKNOWN||e.treeAdapter.getTagName(s)===n)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.stackTop>=r&&e.openElements.shortenToLength(r);break}if(e._isSpecialElement(s,o))break}}function AM(e,t){switch(t.tagID){case B.A:case B.B:case B.I:case B.S:case B.U:case B.EM:case B.TT:case B.BIG:case B.CODE:case B.FONT:case B.NOBR:case B.SMALL:case B.STRIKE:case B.STRONG:{nq(e,t);break}case B.P:{rAt(e);break}case B.DL:case B.UL:case B.OL:case B.DIR:case B.DIV:case B.NAV:case B.PRE:case B.MAIN:case B.MENU:case B.ASIDE:case B.BUTTON:case B.CENTER:case B.FIGURE:case B.FOOTER:case B.HEADER:case B.HGROUP:case B.DIALOG:case B.ADDRESS:case B.ARTICLE:case B.DETAILS:case B.SEARCH:case B.SECTION:case B.SUMMARY:case B.LISTING:case B.FIELDSET:case B.BLOCKQUOTE:case B.FIGCAPTION:{nAt(e,t);break}case B.LI:{sAt(e);break}case B.DD:case B.DT:{aAt(e,t);break}case B.H1:case B.H2:case B.H3:case B.H4:case B.H5:case B.H6:{oAt(e);break}case B.BR:{cAt(e);break}case B.BODY:{eAt(e,t);break}case B.HTML:{tAt(e,t);break}case B.FORM:{iAt(e);break}case B.APPLET:case B.OBJECT:case B.MARQUEE:{lAt(e,t);break}case B.TEMPLATE:{X0(e,t);break}default:AMe(e,t)}}function TMe(e,t){e.tmplInsertionModeStack.length>0?DMe(e,t):iq(e,t)}function uAt(e,t){var n;t.tagID===B.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function dAt(e,t){e._err(t,dt.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function j4(e,t){if(e.openElements.currentTagId!==void 0&&OMe.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=Ie.IN_TABLE_TEXT,t.type){case Fi.CHARACTER:{jMe(e,t);break}case Fi.WHITESPACE_CHARACTER:{_Me(e,t);break}}else dT(e,t)}function fAt(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,Rt.HTML),e.insertionMode=Ie.IN_CAPTION}function hAt(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Rt.HTML),e.insertionMode=Ie.IN_COLUMN_GROUP}function pAt(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Je.COLGROUP,B.COLGROUP),e.insertionMode=Ie.IN_COLUMN_GROUP,rq(e,t)}function mAt(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Rt.HTML),e.insertionMode=Ie.IN_TABLE_BODY}function gAt(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Je.TBODY,B.TBODY),e.insertionMode=Ie.IN_TABLE_BODY,TM(e,t)}function bAt(e,t){e.openElements.hasInTableScope(B.TABLE)&&(e.openElements.popUntilTagNamePopped(B.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function yAt(e,t){CMe(t)?e._appendElement(t,Rt.HTML):dT(e,t),t.ackSelfClosing=!0}function vAt(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,Rt.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function i1(e,t){switch(t.tagID){case B.TD:case B.TH:case B.TR:{gAt(e,t);break}case B.STYLE:case B.SCRIPT:case B.TEMPLATE:{_f(e,t);break}case B.COL:{pAt(e,t);break}case B.FORM:{vAt(e,t);break}case B.TABLE:{bAt(e,t);break}case B.TBODY:case B.TFOOT:case B.THEAD:{mAt(e,t);break}case B.INPUT:{yAt(e,t);break}case B.CAPTION:{fAt(e,t);break}case B.COLGROUP:{hAt(e,t);break}default:dT(e,t)}}function wC(e,t){switch(t.tagID){case B.TABLE:{e.openElements.hasInTableScope(B.TABLE)&&(e.openElements.popUntilTagNamePopped(B.TABLE),e._resetInsertionMode());break}case B.TEMPLATE:{X0(e,t);break}case B.BODY:case B.CAPTION:case B.COL:case B.COLGROUP:case B.HTML:case B.TBODY:case B.TD:case B.TFOOT:case B.TH:case B.THEAD:case B.TR:break;default:dT(e,t)}}function dT(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,CM(e,t),e.fosterParentingEnabled=n}function _Me(e,t){e.pendingCharacterTokens.push(t)}function jMe(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function pk(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n0&&e.openElements.currentTagId===B.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===B.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===B.OPTGROUP&&e.openElements.pop();break}case B.OPTION:{e.openElements.currentTagId===B.OPTION&&e.openElements.pop();break}case B.SELECT:{e.openElements.hasInSelectScope(B.SELECT)&&(e.openElements.popUntilTagNamePopped(B.SELECT),e._resetInsertionMode());break}case B.TEMPLATE:{X0(e,t);break}}}function EAt(e,t){const n=t.tagID;n===B.CAPTION||n===B.TABLE||n===B.TBODY||n===B.TFOOT||n===B.THEAD||n===B.TR||n===B.TD||n===B.TH?(e.openElements.popUntilTagNamePopped(B.SELECT),e._resetInsertionMode(),e._processStartTag(t)):IMe(e,t)}function CAt(e,t){const n=t.tagID;n===B.CAPTION||n===B.TABLE||n===B.TBODY||n===B.TFOOT||n===B.THEAD||n===B.TR||n===B.TD||n===B.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(B.SELECT),e._resetInsertionMode(),e.onEndTag(t)):PMe(e,t)}function AAt(e,t){switch(t.tagID){case B.BASE:case B.BASEFONT:case B.BGSOUND:case B.LINK:case B.META:case B.NOFRAMES:case B.SCRIPT:case B.STYLE:case B.TEMPLATE:case B.TITLE:{_f(e,t);break}case B.CAPTION:case B.COLGROUP:case B.TBODY:case B.TFOOT:case B.THEAD:{e.tmplInsertionModeStack[0]=Ie.IN_TABLE,e.insertionMode=Ie.IN_TABLE,i1(e,t);break}case B.COL:{e.tmplInsertionModeStack[0]=Ie.IN_COLUMN_GROUP,e.insertionMode=Ie.IN_COLUMN_GROUP,rq(e,t);break}case B.TR:{e.tmplInsertionModeStack[0]=Ie.IN_TABLE_BODY,e.insertionMode=Ie.IN_TABLE_BODY,TM(e,t);break}case B.TD:case B.TH:{e.tmplInsertionModeStack[0]=Ie.IN_ROW,e.insertionMode=Ie.IN_ROW,_M(e,t);break}default:e.tmplInsertionModeStack[0]=Ie.IN_BODY,e.insertionMode=Ie.IN_BODY,Pl(e,t)}}function TAt(e,t){t.tagID===B.TEMPLATE&&X0(e,t)}function DMe(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(B.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):iq(e,t)}function _At(e,t){t.tagID===B.HTML?Pl(e,t):_I(e,t)}function MMe(e,t){var n;if(t.tagID===B.HTML){if(e.fragmentContext||(e.insertionMode=Ie.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===B.HTML){e._setEndLocation(e.openElements.items[0],t);const i=e.openElements.items[1];i&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(i))===null||n===void 0)&&n.endTag)&&e._setEndLocation(i,t)}}else _I(e,t)}function _I(e,t){e.insertionMode=Ie.IN_BODY,CM(e,t)}function jAt(e,t){switch(t.tagID){case B.HTML:{Pl(e,t);break}case B.FRAMESET:{e._insertElement(t,Rt.HTML);break}case B.FRAME:{e._appendElement(t,Rt.HTML),t.ackSelfClosing=!0;break}case B.NOFRAMES:{_f(e,t);break}}}function NAt(e,t){t.tagID===B.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==B.FRAMESET&&(e.insertionMode=Ie.AFTER_FRAMESET))}function RAt(e,t){switch(t.tagID){case B.HTML:{Pl(e,t);break}case B.NOFRAMES:{_f(e,t);break}}}function IAt(e,t){t.tagID===B.HTML&&(e.insertionMode=Ie.AFTER_AFTER_FRAMESET)}function PAt(e,t){t.tagID===B.HTML?Pl(e,t):jN(e,t)}function jN(e,t){e.insertionMode=Ie.IN_BODY,CM(e,t)}function DAt(e,t){switch(t.tagID){case B.HTML:{Pl(e,t);break}case B.NOFRAMES:{_f(e,t);break}}}function MAt(e,t){t.chars=Bs,e._insertCharacters(t)}function LAt(e,t){e._insertCharacters(t),e.framesetOk=!1}function LMe(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==Rt.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function $At(e,t){if(JEt(t))LMe(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),i=e.treeAdapter.getNamespaceURI(n);i===Rt.MATHML?xMe(t):i===Rt.SVG&&(eCt(t),wMe(t)),tq(t),t.selfClosing?e._appendElement(t,i):e._insertElement(t,i),t.ackSelfClosing=!0}}function FAt(e,t){if(t.tagID===B.P||t.tagID===B.BR){LMe(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const i=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(i)===Rt.HTML){e._endTagOutsideForeignContent(t);break}const r=e.treeAdapter.getTagName(i);if(r.toLowerCase()===t.tagName){t.tagName=r,e.openElements.shortenToLength(n);break}}}Je.AREA,Je.BASE,Je.BASEFONT,Je.BGSOUND,Je.BR,Je.COL,Je.EMBED,Je.FRAME,Je.HR,Je.IMG,Je.INPUT,Je.KEYGEN,Je.LINK,Je.META,Je.PARAM,Je.SOURCE,Je.TRACK,Je.WBR;const BAt=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,UAt=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),One={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function $Me(e,t){const n=YAt(e),i=YPe("type",{handlers:{root:QAt,element:zAt,text:VAt,comment:BMe,doctype:HAt,raw:WAt},unknown:KAt}),r={parser:n?new vne(One):vne.getFragmentParser(void 0,One),handle(l){i(l,r)},stitches:!1,options:t||{}};i(e,r),iO(r,_h());const s=n?r.parser.document:r.parser.getFragment(),o=ZSt(s,{file:r.options.file});return r.stitches&&cT(o,"comment",function(l,c,u){const d=l;if(d.value.stitch&&u&&c!==void 0){const f=u.children;return f[c]=d.value.stitch,c}}),o.type==="root"&&o.children.length===1&&o.children[0].type===e.type?o.children[0]:o}function FMe(e,t){let n=-1;if(e)for(;++n4&&(t.parser.tokenizer.state=0);const n={type:Fi.CHARACTER,chars:e.value,location:fT(e)};iO(t,_h(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function HAt(e,t){const n={type:Fi.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:fT(e)};iO(t,_h(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function qAt(e,t){t.stitches=!0;const n=ZAt(e);if("children"in e&&"children"in n){const i=$Me({type:"root",children:e.children},t.options);n.children=i.children}BMe({type:"comment",value:{stitch:n}},t)}function BMe(e,t){const n=e.value,i={type:Fi.COMMENT,data:n,location:fT(e)};iO(t,_h(e)),t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken)}function WAt(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,UMe(t,_h(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(BAt,"<$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function KAt(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))qAt(n,t);else{let i="";throw UAt.has(n.type)&&(i=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+i)}}function iO(e,t){UMe(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=Aa.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function UMe(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function GAt(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Aa.PLAINTEXT)return;iO(t,_h(e));const i=t.parser.openElements.current;let r="namespaceURI"in i?i.namespaceURI:Ty.html;r===Ty.html&&n==="svg"&&(r=Ty.svg);const s=iEt({...e,children:[]},{space:r===Ty.svg?"svg":"html"}),o={type:Fi.START_TAG,tagName:n,tagID:nO(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in s?s.attrs:[],location:fT(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function XAt(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&dEt.includes(n)||t.parser.tokenizer.state===Aa.PLAINTEXT)return;iO(t,vM(e));const i={type:Fi.END_TAG,tagName:n,tagID:nO(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:fT(e)};t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Aa.RCDATA||t.parser.tokenizer.state===Aa.RAWTEXT||t.parser.tokenizer.state===Aa.SCRIPT_DATA)&&(t.parser.tokenizer.state=Aa.DATA)}function YAt(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function fT(e){const t=_h(e)||{line:void 0,column:void 0,offset:void 0},n=vM(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function ZAt(e){return"children"in e?t1({...e,children:[]}):t1(e)}function JAt(e){return function(t,n){return $Me(t,{...e,file:n})}}const eTt="modulepreload",tTt=function(e){return"/"+e},kne={},Js=function(t,n,i){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));r=Promise.allSettled(n.map(c=>{if(c=tTt(c),c in kne)return;kne[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":eTt,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((h,m)=>{f.addEventListener("load",h),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return r.then(o=>{for(const l of o||[])l.status==="rejected"&&s(l.reason);return t().catch(s)})};var nTt=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,iTt=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,rTt=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,N4={Space_Separator:nTt,ID_Start:iTt,ID_Continue:rTt},wa={isSpaceSeparator(e){return typeof e=="string"&&N4.Space_Separator.test(e)},isIdStartChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="$"||e==="_"||N4.ID_Start.test(e))},isIdContinueChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||e==="$"||e==="_"||e==="‌"||e==="‍"||N4.ID_Continue.test(e))},isDigit(e){return typeof e=="string"&&/[0-9]/.test(e)},isHexDigit(e){return typeof e=="string"&&/[0-9A-Fa-f]/.test(e)}};let t9,nc,wp,jI,ub,gf,So,sq,cE;var sTt=function(t,n){t9=String(t),nc="start",wp=[],jI=0,ub=1,gf=0,So=void 0,sq=void 0,cE=void 0;do So=aTt(),cTt[nc]();while(So.type!=="eof");return typeof n=="function"?n9({"":cE},"",n):cE};function n9(e,t,n){const i=e[t];if(i!=null&&typeof i=="object")if(Array.isArray(i))for(let r=0;r0;){const n=Bp();if(!wa.isHexDigit(n))throw As(At());e+=At()}return String.fromCodePoint(parseInt(e,16))}const cTt={start(){if(So.type==="eof")throw Xb();R4()},beforePropertyName(){switch(So.type){case"identifier":case"string":sq=So.value,nc="afterPropertyName";return;case"punctuator":T_();return;case"eof":throw Xb()}},afterPropertyName(){if(So.type==="eof")throw Xb();nc="beforePropertyValue"},beforePropertyValue(){if(So.type==="eof")throw Xb();R4()},beforeArrayValue(){if(So.type==="eof")throw Xb();if(So.type==="punctuator"&&So.value==="]"){T_();return}R4()},afterPropertyValue(){if(So.type==="eof")throw Xb();switch(So.value){case",":nc="beforePropertyName";return;case"}":T_()}},afterArrayValue(){if(So.type==="eof")throw Xb();switch(So.value){case",":nc="beforeArrayValue";return;case"]":T_()}},end(){}};function R4(){let e;switch(So.type){case"punctuator":switch(So.value){case"{":e={};break;case"[":e=[];break}break;case"null":case"boolean":case"numeric":case"string":e=So.value;break}if(cE===void 0)cE=e;else{const t=wp[wp.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,sq,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(e!==null&&typeof e=="object")wp.push(e),Array.isArray(e)?nc="beforeArrayValue":nc="beforePropertyName";else{const t=wp[wp.length-1];t==null?nc="end":Array.isArray(t)?nc="afterArrayValue":nc="afterPropertyValue"}}function T_(){wp.pop();const e=wp[wp.length-1];e==null?nc="end":Array.isArray(e)?nc="afterArrayValue":nc="afterPropertyValue"}function As(e){return NI(e===void 0?`JSON5: invalid end of input at ${ub}:${gf}`:`JSON5: invalid character '${zMe(e)}' at ${ub}:${gf}`)}function Xb(){return NI(`JSON5: invalid end of input at ${ub}:${gf}`)}function Sne(){return gf-=5,NI(`JSON5: invalid identifier character at ${ub}:${gf}`)}function uTt(e){console.warn(`JSON5: '${zMe(e)}' in strings is not valid ECMAScript; consider escaping`)}function zMe(e){const t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(t[e])return t[e];if(e<" "){const n=e.charCodeAt(0).toString(16);return"\\x"+("00"+n).substring(n.length)}return e}function NI(e){const t=new SyntaxError(e);return t.lineNumber=ub,t.columnNumber=gf,t}var dTt=function(t,n,i){const r=[];let s="",o,l,c="",u;if(n!=null&&typeof n=="object"&&!Array.isArray(n)&&(i=n.space,u=n.quote,n=n.replacer),typeof n=="function")l=n;else if(Array.isArray(n)){o=[];for(const b of n){let v;typeof b=="string"?v=b:(typeof b=="number"||b instanceof String||b instanceof Number)&&(v=String(b)),v!==void 0&&o.indexOf(v)<0&&o.push(v)}}return i instanceof Number?i=Number(i):i instanceof String&&(i=String(i)),typeof i=="number"?i>0&&(i=Math.min(10,Math.floor(i)),c=" ".substr(0,i)):typeof i=="string"&&(c=i.substr(0,10)),d("",{"":t});function d(b,v){let y=v[b];switch(y!=null&&(typeof y.toJSON5=="function"?y=y.toJSON5(b):typeof y.toJSON=="function"&&(y=y.toJSON(b))),l&&(y=l.call(v,b,y)),y instanceof Number?y=Number(y):y instanceof String?y=String(y):y instanceof Boolean&&(y=y.valueOf()),y){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof y=="string")return f(y);if(typeof y=="number")return String(y);if(typeof y=="object")return Array.isArray(y)?g(y):h(y)}function f(b){const v={"'":.1,'"':.2},y={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let w="";for(let O=0;Ov[O]=0)throw TypeError("Converting circular structure to JSON5");r.push(b);let v=s;s=s+c;let y=o||Object.keys(b),w=[];for(const O of y){const k=d(O,b);if(k!==void 0){let S=m(O)+":";c!==""&&(S+=" "),S+=k,w.push(S)}}let x;if(w.length===0)x="{}";else{let O;if(c==="")O=w.join(","),x="{"+O+"}";else{let k=`, +]`,g={scope:"string",variants:[d,u,f,h]},b={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},v=["false","null","true"],y=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],w=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],O={keyword:y,literal:(P=>{const I=[];return P.forEach(D=>{I.push(D),D.toLowerCase()===D?I.push(D.toUpperCase()):I.push(D.toLowerCase())}),I})(v),built_in:w},k=P=>P.map(I=>I.replace(/\|\d+$/,"")),S={variants:[{match:[/new/,t.concat(m,"+"),t.concat("(?!",k(w).join("\\b|"),"\\b)"),r],scope:{1:"keyword",4:"title.class"}}]},C=t.concat(i,"\\b(?!\\()"),E={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),C],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,t.concat(/::/,t.lookahead(/(?!class\b)/)),C],scope:{1:"title.class",3:"variable.constant"}},{match:[r,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[r,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},j={scope:"attr",match:t.concat(i,t.lookahead(":"),t.lookahead(/(?!::)/))},T={relevance:0,begin:/\(/,end:/\)/,keywords:O,contains:[j,o,E,e.C_BLOCK_COMMENT_MODE,g,b,S]},R={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",k(y).join("\\b|"),"|",k(w).join("\\b|"),"\\b)"),i,t.concat(m,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[T]};T.contains.push(R);const A=[j,E,e.C_BLOCK_COMMENT_MODE,g,b,S],N={begin:t.concat(/#\[\s*\\?/,t.either(r,s)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:v,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:v,keyword:["new","array"]},contains:["self",...A]},...A,{scope:"meta",variants:[{match:r},{match:s}]}]};return{case_insensitive:!1,keywords:O,contains:[N,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},l,{scope:"variable.language",match:/\$this\b/},o,R,E,{match:[/const/,/\s/,i],scope:{1:"keyword",3:"variable.constant"}},S,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:O,contains:["self",N,o,E,e.C_BLOCK_COMMENT_MODE,g,b]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},g,b]}}function vkt(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function IDe(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function HH(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},c={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},d={begin:/\{\{/,relevance:0},f={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,d,u]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},h="[0-9](_?[0-9])*",m=`(\\b(${h}))?\\.(${h})|\\b(${h})\\.`,g=`\\b|${i.join("|")}`,b={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${m}))[eE][+-]?(${h})[jJ]?(?=${g})`},{begin:`(${m})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${g})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${g})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${g})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${g})`},{begin:`\\b(${h})[jJ](?=${g})`}]},v={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",c,b,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,b,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,b,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,v,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[y]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[b,y,f]}]}}function xkt(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function wkt(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,i=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),r=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,s=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[r,i]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,i]},{scope:{1:"punctuation",2:"number"},match:[s,i]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,i]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:r},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:s},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function Okt(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",i=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),r=t.concat(i,/(::\w+)*/),o={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},l={className:"doctag",begin:"@[A-Za-z]+"},c={begin:"#<",end:">"},u=[e.COMMENT("#","$",{contains:[l]}),e.COMMENT("^=begin","^=end",{contains:[l],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],d={className:"subst",begin:/#\{/,end:/\}/,keywords:o},f={className:"string",contains:[e.BACKSLASH_ESCAPE,d],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,d]})]}]},h="[1-9](_?[0-9])*|0",m="[0-9](_?[0-9])*",g={className:"number",relevance:0,variants:[{begin:`\\b(${h})(\\.(${m}))?([eE][+-]?(${m})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},b={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},S=[f,{variants:[{match:[/class\s+/,r,/\s+<\s+/,r]},{match:[/\b(class|module)\s+/,r]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,r],scope:{2:"title.class"},keywords:o},{relevance:0,match:[r,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:i,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[b]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[f,{begin:n}],relevance:0},g,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,d],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(c,u),relevance:0}].concat(c,u);d.contains=S,b.contains=S;const T=[{begin:/^\s*=>/,starts:{end:"$",contains:S}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:o,contains:S}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(T).concat(u).concat(S)}}function PDe(e){const t=e.regex,n=/(r#)?/,i=t.concat(n,e.UNDERSCORE_IDENT_RE),r=t.concat(n,e.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,r,t.lookahead(/\s*\(/))},o="([ui](8|16|32|64|128|size)|f(32|64))?",l=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],c=["true","false","Some","None","Ok","Err"],u=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],d=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:d,keyword:l,literal:c,built_in:u},illegal:""},s]}}const kkt=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Skt=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Ekt=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Ckt=[...Skt,...Ekt],Akt=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Tkt=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),_kt=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),jkt=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function DDe(e){const t=kkt(e),n=_kt,i=Tkt,r="@[a-z-]+",s="and or not only",l={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+Ckt.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+i.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},l,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+jkt.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,l,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:r,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:Akt.join(" ")},contains:[{begin:r,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},l,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function Nkt(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function MDe(e){const t=e.regex,n=e.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},r={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["true","false","unknown"],o=["double precision","large object","with timezone","without timezone"],l=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],c=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],d=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],f=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],h=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],m=d,g=[...u,...c].filter(k=>!d.includes(k)),b={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},v={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:t.concat(/\b/,t.either(...m),/\s*\(/),relevance:0,keywords:{built_in:m}};function w(k){return t.concat(/\b/,t.either(...k.map(S=>S.replace(/\s+/,"\\s+"))),/\b/)}const x={scope:"keyword",match:w(h),relevance:0};function O(k,{exceptions:S,when:C}={}){const E=C;return S=S||[],k.map(j=>j.match(/\|\d+$/)||S.includes(j)?j:E(j)?`${j}|0`:j)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:O(g,{when:k=>k.length<3}),literal:s,type:l,built_in:f},contains:[{scope:"type",match:w(o)},x,y,b,i,r,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,v]}}function LDe(e){return e?typeof e=="string"?e:e.source:null}function bk(e){return qr("(?=",e,")")}function qr(...e){return e.map(n=>LDe(n)).join("")}function Rkt(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Gl(...e){return"("+(Rkt(e).capture?"":"?:")+e.map(i=>LDe(i)).join("|")+")"}const qH=e=>qr(/\b/,e,/\w$/.test(e)?/\b/:/\B/),Ikt=["Protocol","Type"].map(qH),Kte=["init","self"].map(qH),Pkt=["Any","Self"],C4=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Gte=["false","nil","true"],Dkt=["assignment","associativity","higherThan","left","lowerThan","none","right"],Mkt=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Xte=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],$De=Gl(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),FDe=Gl($De,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),A4=qr($De,FDe,"*"),BDe=Gl(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),EI=Gl(BDe,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),qf=qr(BDe,EI,"*"),C_=qr(/[A-Z]/,EI,"*"),Lkt=["attached","autoclosure",qr(/convention\(/,Gl("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",qr(/objc\(/,qf,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],$kt=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function Fkt(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),i=[e.C_LINE_COMMENT_MODE,n],r={match:[/\./,Gl(...Ikt,...Kte)],className:{2:"keyword"}},s={match:qr(/\./,Gl(...C4)),relevance:0},o=C4.filter(be=>typeof be=="string").concat(["_|0"]),l=C4.filter(be=>typeof be!="string").concat(Pkt).map(qH),c={variants:[{className:"keyword",match:Gl(...l,...Kte)}]},u={$pattern:Gl(/\b\w+/,/#\w+/),keyword:o.concat(Mkt),literal:Gte},d=[r,s,c],f={match:qr(/\./,Gl(...Xte)),relevance:0},h={className:"built_in",match:qr(/\b/,Gl(...Xte),/(?=\()/)},m=[f,h],g={match:/->/,relevance:0},b={className:"operator",relevance:0,variants:[{match:A4},{match:`\\.(\\.|${FDe})+`}]},v=[g,b],y="([0-9]_*)+",w="([0-9a-fA-F]_*)+",x={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${w})(\\.(${w}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},O=(be="")=>({className:"subst",variants:[{match:qr(/\\/,be,/[0\\tnr"']/)},{match:qr(/\\/,be,/u\{[0-9a-fA-F]{1,8}\}/)}]}),k=(be="")=>({className:"subst",match:qr(/\\/,be,/[\t ]*(?:[\r\n]|\r\n)/)}),S=(be="")=>({className:"subst",label:"interpol",begin:qr(/\\/,be,/\(/),end:/\)/}),C=(be="")=>({begin:qr(be,/"""/),end:qr(/"""/,be),contains:[O(be),k(be),S(be)]}),E=(be="")=>({begin:qr(be,/"/),end:qr(/"/,be),contains:[O(be),S(be)]}),j={className:"string",variants:[C(),C("#"),C("##"),C("###"),E(),E("#"),E("##"),E("###")]},T=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],R={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:T},A=be=>{const ue=qr(be,/\//),pe=qr(/\//,be);return{begin:ue,end:pe,contains:[...T,{scope:"comment",begin:`#(?!.*${pe})`,end:/$/}]}},N={scope:"regexp",variants:[A("###"),A("##"),A("#"),R]},P={match:qr(/`/,qf,/`/)},I={className:"variable",match:/\$\d+/},D={className:"variable",match:`\\$${EI}+`},_=[P,I,D],L={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:$kt,contains:[...v,x,j]}]}},F={scope:"keyword",match:qr(/@/,Gl(...Lkt),bk(Gl(/\(/,/\s+/)))},M={scope:"meta",match:qr(/@/,qf)},V=[L,F,M],q={match:bk(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:qr(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,EI,"+")},{className:"type",match:C_,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:qr(/\s+&\s+/,bk(C_)),relevance:0}]},U={begin://,keywords:u,contains:[...i,...d,...V,g,q]};q.contains.push(U);const J={match:qr(qf,/\s*:/),keywords:"_|0",relevance:0},z={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",J,...i,N,...d,...m,...v,x,j,..._,...V,q]},Z={begin://,keywords:"repeat each",contains:[...i,q]},ne={begin:Gl(bk(qr(qf,/\s*:/)),bk(qr(qf,/\s+/,qf,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:qf}]},W={begin:/\(/,end:/\)/,keywords:u,contains:[ne,...i,...d,...v,x,j,...V,q,z],endsParent:!0,illegal:/["']/},G={match:[/(func|macro)/,/\s+/,Gl(P.match,qf,A4)],className:{1:"keyword",3:"title.function"},contains:[Z,W,t],illegal:[/\[/,/%/]},H={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[Z,W,t],illegal:/\[|%/},se={match:[/operator/,/\s+/,A4],className:{1:"keyword",3:"title"}},Y={begin:[/precedencegroup/,/\s+/,C_],className:{1:"keyword",3:"title"},contains:[q],keywords:[...Dkt,...Gte],end:/}/},X={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},ie={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},ee={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,qf,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[Z,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:C_},...d],relevance:0}]};for(const be of j.variants){const ue=be.contains.find(ke=>ke.label==="interpol");ue.keywords=u;const pe=[...d,...m,...v,x,j,..._];ue.contains=[...pe,{begin:/\(/,end:/\)/,contains:["self",...pe]}]}return{name:"Swift",keywords:u,contains:[...i,G,H,X,ie,ee,se,Y,{beginKeywords:"import",end:/$/,contains:[...i],relevance:0},N,...d,...m,...v,x,j,..._,...V,q,z]}}const CI="[A-Za-z$_][0-9A-Za-z$_]*",UDe=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],QDe=["true","false","null","undefined","NaN","Infinity"],zDe=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],VDe=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],HDe=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],qDe=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],WDe=[].concat(HDe,zDe,VDe);function Bkt(e){const t=e.regex,n=(L,{after:F})=>{const M="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,F)=>{const M=L[0].length+L.index,V=L.input[M];if(V==="<"||V===","){F.ignoreMatch();return}V===">"&&(n(L,{after:M})||F.ignoreMatch());let q;const U=L.input.substring(M);if(q=U.match(/^\s*=/)){F.ignoreMatch();return}if((q=U.match(/^\s+extends\s+/))&&q.index===0){F.ignoreMatch();return}}},l={$pattern:CI,keyword:UDe,literal:QDe,built_in:WDe,"variable.language":qDe},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},m={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},w={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const O=[].concat(w,h.contains),k=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(O)}]),S={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k},C={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},E={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...zDe,...VDe]}},j={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[S],illegal:/%/},R={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function A(L){return t.concat("(?!",L.join("|"),")")}const N={match:t.concat(/\b/,A([...HDe,"super","import"].map(L=>`${L}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},P={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},I={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},S]},D="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",_={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(D)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[S]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:E},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),j,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,w,{match:/\$\d+/},f,E,{scope:"attr",match:i+t.lookahead(":"),relevance:0},_,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[w,e.REGEXP_MODE,{className:"function",begin:D,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[S,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},P,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[S]},N,R,C,I,{match:/\$[(.]/}]}}function WH(e){const t=e.regex,n=Bkt(e),i=CI,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[n.exports.CLASS_REFERENCE]},l={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:CI,keyword:UDe.concat(c),literal:QDe,built_in:WDe.concat(r),"variable.language":qDe},d={className:"meta",begin:"@"+i},f=(b,v,y)=>{const w=b.contains.findIndex(x=>x.label===v);if(w===-1)throw new Error("can not find mode to replace");b.contains.splice(w,1,y)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const h=n.contains.find(b=>b.scope==="attr"),m=Object.assign({},h,{match:t.concat(i,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,h,m]),n.contains=n.contains.concat([d,s,o,m]),f(n,"shebang",e.SHEBANG()),f(n,"use_strict",l);const g=n.contains.find(b=>b.label==="func.def");return g.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function Ukt(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},i={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},r=/\d{1,2}\/\d{1,2}\/\d{4}/,s=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,l=/\d{1,2}(:\d{1,2}){1,2}/,c={className:"literal",variants:[{begin:t.concat(/# */,t.either(s,r),/ *#/)},{begin:t.concat(/# */,l,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(s,r),/ +/,t.either(o,l),/ *#/)}]},u={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},d={className:"label",begin:/^\w+:/},f=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),h=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,i,c,u,d,f,h,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[h]}]}}function Qkt(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),i=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],r={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},s={className:"variable",begin:/\$[\w_]+/},o={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},l={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},c={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},u={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:i},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},s,o,r,e.QUOTE_STRING_MODE,c,u,l]}}function KDe(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(s,{begin:/\(/,end:/\)/}),l=e.inherit(e.APOS_STRING_MODE,{className:"string"}),c=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[s,c,l,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[s,o,c,l]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:u}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function KH(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,r]},l=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),h={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},m={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},g={begin:/\{/,end:/\}/,contains:[m],illegal:"\\n",relevance:0},b={begin:"\\[",end:"\\]",contains:[m],illegal:"\\n",relevance:0},v=[i,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},h,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},g,b,s,o],y=[...v];return y.pop(),y.push(l),m.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}const zkt={arduino:QOt,bash:EM,c:zOt,cpp:VOt,csharp:HOt,css:kDe,diff:SDe,go:EDe,graphql:ekt,ini:BH,java:ADe,javascript:UH,json:QH,kotlin:akt,less:pkt,lua:mkt,makefile:zH,markdown:VH,objectivec:gkt,perl:bkt,php:ykt,"php-template":vkt,plaintext:IDe,python:HH,"python-repl":xkt,r:wkt,ruby:Okt,rust:PDe,scss:DDe,shell:Nkt,sql:MDe,swift:Fkt,typescript:WH,vbnet:Ukt,wasm:Qkt,xml:KDe,yaml:KH};function GDe(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t],i=typeof n;(i==="object"||i==="function")&&!Object.isFrozen(n)&&GDe(n)}),e}let Yte=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function XDe(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function bg(e,...t){const n=Object.create(null);for(const i in e)n[i]=e[i];return t.forEach(function(i){for(const r in i)n[r]=i[r]}),n}const Vkt="",Zte=e=>!!e.scope,Hkt=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((i,r)=>`${i}${"_".repeat(r+1)}`)].join(" ")}return`${t}${e}`};class qkt{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=XDe(t)}openNode(t){if(!Zte(t))return;const n=Hkt(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){Zte(t)&&(this.buffer+=Vkt)}value(){return this.buffer}span(t){this.buffer+=``}}const Jte=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class GH{constructor(){this.rootNode=Jte(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const n=Jte({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(i=>this._walk(t,i)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{GH._collapse(n)}))}}class Wkt extends GH{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const i=t.root;n&&(i.scope=`language:${n}`),this.add(i)}toHTML(){return new qkt(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function SC(e){return e?typeof e=="string"?e:e.source:null}function YDe(e){return Z0("(?=",e,")")}function Kkt(e){return Z0("(?:",e,")*")}function Gkt(e){return Z0("(?:",e,")?")}function Z0(...e){return e.map(n=>SC(n)).join("")}function Xkt(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function XH(...e){return"("+(Xkt(e).capture?"":"?:")+e.map(i=>SC(i)).join("|")+")"}function ZDe(e){return new RegExp(e.toString()+"|").exec("").length-1}function Ykt(e,t){const n=e&&e.exec(t);return n&&n.index===0}const Zkt=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function YH(e,{joinWith:t}){let n=0;return e.map(i=>{n+=1;const r=n;let s=SC(i),o="";for(;s.length>0;){const l=Zkt.exec(s);if(!l){o+=s;break}o+=s.substring(0,l.index),s=s.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?o+="\\"+String(Number(l[1])+r):(o+=l[0],l[0]==="("&&n++)}return o}).map(i=>`(${i})`).join(t)}const Jkt=/\b\B/,JDe="[a-zA-Z]\\w*",ZH="[a-zA-Z_]\\w*",eMe="\\b\\d+(\\.\\d+)?",tMe="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",nMe="\\b(0b[01]+)",eSt="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",tSt=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=Z0(t,/.*\b/,e.binary,/\b.*/)),bg({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},e)},EC={begin:"\\\\[\\s\\S]",relevance:0},nSt={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[EC]},iSt={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[EC]},rSt={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},CM=function(e,t,n={}){const i=bg({scope:"comment",begin:e,end:t,contains:[]},n);i.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const r=XH("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return i.contains.push({begin:Z0(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},sSt=CM("//","$"),aSt=CM("/\\*","\\*/"),oSt=CM("#","$"),lSt={scope:"number",begin:eMe,relevance:0},cSt={scope:"number",begin:tMe,relevance:0},uSt={scope:"number",begin:nMe,relevance:0},dSt={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[EC,{begin:/\[/,end:/\]/,relevance:0,contains:[EC]}]},fSt={scope:"title",begin:JDe,relevance:0},hSt={scope:"title",begin:ZH,relevance:0},pSt={begin:"\\.\\s*"+ZH,relevance:0},mSt=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})};var A_=Object.freeze({__proto__:null,APOS_STRING_MODE:nSt,BACKSLASH_ESCAPE:EC,BINARY_NUMBER_MODE:uSt,BINARY_NUMBER_RE:nMe,COMMENT:CM,C_BLOCK_COMMENT_MODE:aSt,C_LINE_COMMENT_MODE:sSt,C_NUMBER_MODE:cSt,C_NUMBER_RE:tMe,END_SAME_AS_BEGIN:mSt,HASH_COMMENT_MODE:oSt,IDENT_RE:JDe,MATCH_NOTHING_RE:Jkt,METHOD_GUARD:pSt,NUMBER_MODE:lSt,NUMBER_RE:eMe,PHRASAL_WORDS_MODE:rSt,QUOTE_STRING_MODE:iSt,REGEXP_MODE:dSt,RE_STARTERS_RE:eSt,SHEBANG:tSt,TITLE_MODE:fSt,UNDERSCORE_IDENT_RE:ZH,UNDERSCORE_TITLE_MODE:hSt});function gSt(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function bSt(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function ySt(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=gSt,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function vSt(e,t){Array.isArray(e.illegal)&&(e.illegal=XH(...e.illegal))}function xSt(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function wSt(e,t){e.relevance===void 0&&(e.relevance=1)}const OSt=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(i=>{delete e[i]}),e.keywords=n.keywords,e.begin=Z0(n.beforeMatch,YDe(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},kSt=["of","and","for","in","not","or","if","then","parent","list","value"],SSt="keyword";function iMe(e,t,n=SSt){const i=Object.create(null);return typeof e=="string"?r(n,e.split(" ")):Array.isArray(e)?r(n,e):Object.keys(e).forEach(function(s){Object.assign(i,iMe(e[s],t,s))}),i;function r(s,o){t&&(o=o.map(l=>l.toLowerCase())),o.forEach(function(l){const c=l.split("|");i[c[0]]=[s,ESt(c[0],c[1])]})}}function ESt(e,t){return t?Number(t):CSt(e)?0:1}function CSt(e){return kSt.includes(e.toLowerCase())}const ene={},Xy=e=>{console.error(e)},tne=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Fv=(e,t)=>{ene[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),ene[`${e}/${t}`]=!0)},AI=new Error;function rMe(e,t,{key:n}){let i=0;const r=e[n],s={},o={};for(let l=1;l<=t.length;l++)o[l+i]=r[l],s[l+i]=!0,i+=ZDe(t[l-1]);e[n]=o,e[n]._emit=s,e[n]._multi=!0}function ASt(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Xy("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),AI;if(typeof e.beginScope!="object"||e.beginScope===null)throw Xy("beginScope must be object"),AI;rMe(e,e.begin,{key:"beginScope"}),e.begin=YH(e.begin,{joinWith:""})}}function TSt(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Xy("skip, excludeEnd, returnEnd not compatible with endScope: {}"),AI;if(typeof e.endScope!="object"||e.endScope===null)throw Xy("endScope must be object"),AI;rMe(e,e.end,{key:"endScope"}),e.end=YH(e.end,{joinWith:""})}}function _St(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function jSt(e){_St(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),ASt(e),TSt(e)}function NSt(e){function t(o,l){return new RegExp(SC(o),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,l]),this.matchAt+=ZDe(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(YH(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;const c=this.matcherRe.exec(l);if(!c)return null;const u=c.findIndex((f,h)=>h>0&&f!==void 0),d=this.matchIndexes[u];return c.splice(0,u),Object.assign(c,d)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];const c=new n;return this.rules.slice(l).forEach(([u,d])=>c.addRule(u,d)),c.compile(),this.multiRegexes[l]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,c){this.rules.push([l,c]),c.type==="begin"&&this.count++}exec(l){const c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let u=c.exec(l);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,u=d.exec(l)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function r(o){const l=new i;return o.contains.forEach(c=>l.addRule(c.begin,{rule:c,type:"begin"})),o.terminatorEnd&&l.addRule(o.terminatorEnd,{type:"end"}),o.illegal&&l.addRule(o.illegal,{type:"illegal"}),l}function s(o,l){const c=o;if(o.isCompiled)return c;[bSt,xSt,jSt,OSt].forEach(d=>d(o,l)),e.compilerExtensions.forEach(d=>d(o,l)),o.__beforeBegin=null,[ySt,vSt,wSt].forEach(d=>d(o,l)),o.isCompiled=!0;let u=null;return typeof o.keywords=="object"&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),u=o.keywords.$pattern,delete o.keywords.$pattern),u=u||/\w+/,o.keywords&&(o.keywords=iMe(o.keywords,e.case_insensitive)),c.keywordPatternRe=t(u,!0),l&&(o.begin||(o.begin=/\B|\b/),c.beginRe=t(c.begin),!o.end&&!o.endsWithParent&&(o.end=/\B|\b/),o.end&&(c.endRe=t(c.end)),c.terminatorEnd=SC(c.end)||"",o.endsWithParent&&l.terminatorEnd&&(c.terminatorEnd+=(o.end?"|":"")+l.terminatorEnd)),o.illegal&&(c.illegalRe=t(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map(function(d){return RSt(d==="self"?o:d)})),o.contains.forEach(function(d){s(d,c)}),o.starts&&s(o.starts,l),c.matcher=r(c),c}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=bg(e.classNameAliases||{}),s(e)}function sMe(e){return e?e.endsWithParent||sMe(e.starts):!1}function RSt(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return bg(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:sMe(e)?bg(e,{starts:e.starts?bg(e.starts):null}):Object.isFrozen(e)?bg(e):e}var ISt="11.11.1";class PSt extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const T4=XDe,nne=bg,ine=Symbol("nomatch"),DSt=7,aMe=function(e){const t=Object.create(null),n=Object.create(null),i=[];let r=!0;const s="Could not find the language '{}', did you forget to load/include a language module?",o={disableAutodetect:!0,name:"Plain text",contains:[]};let l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Wkt};function c(D){return l.noHighlightRe.test(D)}function u(D){let _=D.className+" ";_+=D.parentNode?D.parentNode.className:"";const L=l.languageDetectRe.exec(_);if(L){const F=E(L[1]);return F||(tne(s.replace("{}",L[1])),tne("Falling back to no-highlight mode for this block.",D)),F?L[1]:"no-highlight"}return _.split(/\s+/).find(F=>c(F)||E(F))}function d(D,_,L){let F="",M="";typeof _=="object"?(F=D,L=_.ignoreIllegals,M=_.language):(Fv("10.7.0","highlight(lang, code, ...args) has been deprecated."),Fv("10.7.0",`Please use highlight(code, options) instead. +https://github.com/highlightjs/highlight.js/issues/2277`),M=D,F=_),L===void 0&&(L=!0);const V={code:F,language:M};P("before:highlight",V);const q=V.result?V.result:f(V.language,V.code,L);return q.code=V.code,P("after:highlight",q),q}function f(D,_,L,F){const M=Object.create(null);function V(le,ge){return le.keywords[ge]}function q(){if(!pe.keywords){je.addText(Pe);return}let le=0;pe.keywordPatternRe.lastIndex=0;let ge=pe.keywordPatternRe.exec(Pe),Oe="";for(;ge;){Oe+=Pe.substring(le,ge.index);const Se=ee.case_insensitive?ge[0].toLowerCase():ge[0],We=V(pe,Se);if(We){const[Ye,ye]=We;if(je.addText(Oe),Oe="",M[Se]=(M[Se]||0)+1,M[Se]<=DSt&&(Ee+=ye),Ye.startsWith("_"))Oe+=ge[0];else{const we=ee.classNameAliases[Ye]||Ye;z(ge[0],we)}}else Oe+=ge[0];le=pe.keywordPatternRe.lastIndex,ge=pe.keywordPatternRe.exec(Pe)}Oe+=Pe.substring(le),je.addText(Oe)}function U(){if(Pe==="")return;let le=null;if(typeof pe.subLanguage=="string"){if(!t[pe.subLanguage]){je.addText(Pe);return}le=f(pe.subLanguage,Pe,!0,ke[pe.subLanguage]),ke[pe.subLanguage]=le._top}else le=m(Pe,pe.subLanguage.length?pe.subLanguage:null);pe.relevance>0&&(Ee+=le.relevance),je.__addSublanguage(le._emitter,le.language)}function J(){pe.subLanguage!=null?U():q(),Pe=""}function z(le,ge){le!==""&&(je.startScope(ge),je.addText(le),je.endScope())}function Z(le,ge){let Oe=1;const Se=ge.length-1;for(;Oe<=Se;){if(!le._emit[Oe]){Oe++;continue}const We=ee.classNameAliases[le[Oe]]||le[Oe],Ye=ge[Oe];We?z(Ye,We):(Pe=Ye,q(),Pe=""),Oe++}}function ne(le,ge){return le.scope&&typeof le.scope=="string"&&je.openNode(ee.classNameAliases[le.scope]||le.scope),le.beginScope&&(le.beginScope._wrap?(z(Pe,ee.classNameAliases[le.beginScope._wrap]||le.beginScope._wrap),Pe=""):le.beginScope._multi&&(Z(le.beginScope,ge),Pe="")),pe=Object.create(le,{parent:{value:pe}}),pe}function W(le,ge,Oe){let Se=Ykt(le.endRe,Oe);if(Se){if(le["on:end"]){const We=new Yte(le);le["on:end"](ge,We),We.isMatchIgnored&&(Se=!1)}if(Se){for(;le.endsParent&&le.parent;)le=le.parent;return le}}if(le.endsWithParent)return W(le.parent,ge,Oe)}function G(le){return pe.matcher.regexIndex===0?(Pe+=le[0],1):(ae=!0,0)}function H(le){const ge=le[0],Oe=le.rule,Se=new Yte(Oe),We=[Oe.__beforeBegin,Oe["on:begin"]];for(const Ye of We)if(Ye&&(Ye(le,Se),Se.isMatchIgnored))return G(ge);return Oe.skip?Pe+=ge:(Oe.excludeBegin&&(Pe+=ge),J(),!Oe.returnBegin&&!Oe.excludeBegin&&(Pe=ge)),ne(Oe,le),Oe.returnBegin?0:ge.length}function se(le){const ge=le[0],Oe=_.substring(le.index),Se=W(pe,le,Oe);if(!Se)return ine;const We=pe;pe.endScope&&pe.endScope._wrap?(J(),z(ge,pe.endScope._wrap)):pe.endScope&&pe.endScope._multi?(J(),Z(pe.endScope,le)):We.skip?Pe+=ge:(We.returnEnd||We.excludeEnd||(Pe+=ge),J(),We.excludeEnd&&(Pe=ge));do pe.scope&&je.closeNode(),!pe.skip&&!pe.subLanguage&&(Ee+=pe.relevance),pe=pe.parent;while(pe!==Se.parent);return Se.starts&&ne(Se.starts,le),We.returnEnd?0:ge.length}function Y(){const le=[];for(let ge=pe;ge!==ee;ge=ge.parent)ge.scope&&le.unshift(ge.scope);le.forEach(ge=>je.openNode(ge))}let X={};function ie(le,ge){const Oe=ge&&ge[0];if(Pe+=le,Oe==null)return J(),0;if(X.type==="begin"&&ge.type==="end"&&X.index===ge.index&&Oe===""){if(Pe+=_.slice(ge.index,ge.index+1),!r){const Se=new Error(`0 width match regex (${D})`);throw Se.languageName=D,Se.badRule=X.rule,Se}return 1}if(X=ge,ge.type==="begin")return H(ge);if(ge.type==="illegal"&&!L){const Se=new Error('Illegal lexeme "'+Oe+'" for mode "'+(pe.scope||"")+'"');throw Se.mode=pe,Se}else if(ge.type==="end"){const Se=se(ge);if(Se!==ine)return Se}if(ge.type==="illegal"&&Oe==="")return Pe+=` +`,1;if(_e>1e5&&_e>ge.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Pe+=Oe,Oe.length}const ee=E(D);if(!ee)throw Xy(s.replace("{}",D)),new Error('Unknown language: "'+D+'"');const be=NSt(ee);let ue="",pe=F||be;const ke={},je=new l.__emitter(l);Y();let Pe="",Ee=0,ze=0,_e=0,ae=!1;try{if(ee.__emitTokens)ee.__emitTokens(_,je);else{for(pe.matcher.considerAll();;){_e++,ae?ae=!1:pe.matcher.considerAll(),pe.matcher.lastIndex=ze;const le=pe.matcher.exec(_);if(!le)break;const ge=_.substring(ze,le.index),Oe=ie(ge,le);ze=le.index+Oe}ie(_.substring(ze))}return je.finalize(),ue=je.toHTML(),{language:D,value:ue,relevance:Ee,illegal:!1,_emitter:je,_top:pe}}catch(le){if(le.message&&le.message.includes("Illegal"))return{language:D,value:T4(_),illegal:!0,relevance:0,_illegalBy:{message:le.message,index:ze,context:_.slice(ze-100,ze+100),mode:le.mode,resultSoFar:ue},_emitter:je};if(r)return{language:D,value:T4(_),illegal:!1,relevance:0,errorRaised:le,_emitter:je,_top:pe};throw le}}function h(D){const _={value:T4(D),illegal:!1,relevance:0,_top:o,_emitter:new l.__emitter(l)};return _._emitter.addText(D),_}function m(D,_){_=_||l.languages||Object.keys(t);const L=h(D),F=_.filter(E).filter(T).map(J=>f(J,D,!1));F.unshift(L);const M=F.sort((J,z)=>{if(J.relevance!==z.relevance)return z.relevance-J.relevance;if(J.language&&z.language){if(E(J.language).supersetOf===z.language)return 1;if(E(z.language).supersetOf===J.language)return-1}return 0}),[V,q]=M,U=V;return U.secondBest=q,U}function g(D,_,L){const F=_&&n[_]||L;D.classList.add("hljs"),D.classList.add(`language-${F}`)}function b(D){let _=null;const L=u(D);if(c(L))return;if(P("before:highlightElement",{el:D,language:L}),D.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",D);return}if(D.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(D)),l.throwUnescapedHTML))throw new PSt("One of your code blocks includes unescaped HTML.",D.innerHTML);_=D;const F=_.textContent,M=L?d(F,{language:L,ignoreIllegals:!0}):m(F);D.innerHTML=M.value,D.dataset.highlighted="yes",g(D,L,M.language),D.result={language:M.language,re:M.relevance,relevance:M.relevance},M.secondBest&&(D.secondBest={language:M.secondBest.language,relevance:M.secondBest.relevance}),P("after:highlightElement",{el:D,result:M,text:F})}function v(D){l=nne(l,D)}const y=()=>{O(),Fv("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function w(){O(),Fv("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let x=!1;function O(){function D(){O()}if(document.readyState==="loading"){x||window.addEventListener("DOMContentLoaded",D,!1),x=!0;return}document.querySelectorAll(l.cssSelector).forEach(b)}function k(D,_){let L=null;try{L=_(e)}catch(F){if(Xy("Language definition for '{}' could not be registered.".replace("{}",D)),r)Xy(F);else throw F;L=o}L.name||(L.name=D),t[D]=L,L.rawDefinition=_.bind(null,e),L.aliases&&j(L.aliases,{languageName:D})}function S(D){delete t[D];for(const _ of Object.keys(n))n[_]===D&&delete n[_]}function C(){return Object.keys(t)}function E(D){return D=(D||"").toLowerCase(),t[D]||t[n[D]]}function j(D,{languageName:_}){typeof D=="string"&&(D=[D]),D.forEach(L=>{n[L.toLowerCase()]=_})}function T(D){const _=E(D);return _&&!_.disableAutodetect}function R(D){D["before:highlightBlock"]&&!D["before:highlightElement"]&&(D["before:highlightElement"]=_=>{D["before:highlightBlock"](Object.assign({block:_.el},_))}),D["after:highlightBlock"]&&!D["after:highlightElement"]&&(D["after:highlightElement"]=_=>{D["after:highlightBlock"](Object.assign({block:_.el},_))})}function A(D){R(D),i.push(D)}function N(D){const _=i.indexOf(D);_!==-1&&i.splice(_,1)}function P(D,_){const L=D;i.forEach(function(F){F[L]&&F[L](_)})}function I(D){return Fv("10.7.0","highlightBlock will be removed entirely in v12.0"),Fv("10.7.0","Please use highlightElement now."),b(D)}Object.assign(e,{highlight:d,highlightAuto:m,highlightAll:O,highlightElement:b,highlightBlock:I,configure:v,initHighlighting:y,initHighlightingOnLoad:w,registerLanguage:k,unregisterLanguage:S,listLanguages:C,getLanguage:E,registerAliases:j,autoDetection:T,inherit:nne,addPlugin:A,removePlugin:N}),e.debugMode=function(){r=!1},e.safeMode=function(){r=!0},e.versionString=ISt,e.regex={concat:Z0,lookahead:YDe,either:XH,optional:Gkt,anyNumberOfTimes:Kkt};for(const D in A_)typeof A_[D]=="object"&&GDe(A_[D]);return Object.assign(e,A_),e},r1=aMe({});r1.newInstance=()=>aMe({});var MSt=r1;r1.HighlightJS=r1;r1.default=r1;const al=T1(MSt),rne={},LSt="hljs-";function $St(e){const t=al.newInstance();return e&&s(e),{highlight:n,highlightAuto:i,listLanguages:r,register:s,registerAlias:o,registered:l};function n(c,u,d){const f=d||rne,h=typeof f.prefix=="string"?f.prefix:LSt;if(!t.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");t.configure({__emitter:FSt,classPrefix:h});const m=t.highlight(u,{ignoreIllegals:!0,language:c});if(m.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:m.errorRaised});const g=m._emitter.root,b=g.data;return b.language=m.language,b.relevance=m.relevance,g}function i(c,u){const f=(u||rne).subset||r();let h=-1,m=0,g;for(;++hm&&(m=v.data.relevance,g=v)}return g||{type:"root",children:[],data:{language:void 0,relevance:m}}}function r(){return t.listLanguages()}function s(c,u){if(typeof c=="string")t.registerLanguage(c,u);else{let d;for(d in c)Object.hasOwn(c,d)&&t.registerLanguage(d,c[d])}}function o(c,u){if(typeof c=="string")t.registerAliases(typeof u=="string"?u:[...u],{languageName:c});else{let d;for(d in c)if(Object.hasOwn(c,d)){const f=c[d];t.registerAliases(typeof f=="string"?f:[...f],{languageName:d})}}}function l(c){return!!t.getLanguage(c)}}class FSt{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],i=n.children[n.children.length-1];i&&i.type==="text"?i.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const i=this.stack[this.stack.length-1],r=t.root.children;n?i.children.push({type:"element",tagName:"span",properties:{className:[n]},children:r}):i.children.push(...r)}openNode(t){const n=this,i=t.split(".").map(function(o,l){return l?o+"_".repeat(l):n.options.classPrefix+o}),r=this.stack[this.stack.length-1],s={type:"element",tagName:"span",properties:{className:i},children:[]};r.children.push(s),this.stack.push(s)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const BSt={};function sne(e){const t=e||BSt,n=t.aliases,i=t.detect||!1,r=t.languages||zkt,s=t.plainText,o=t.prefix,l=t.subset;let c="hljs";const u=$St(r);if(n&&u.registerAlias(n),o){const d=o.indexOf("-");c=d===-1?o:o.slice(0,d)}return function(d,f){pT(d,"element",function(h,m,g){if(h.tagName!=="code"||!g||g.type!=="element"||g.tagName!=="pre")return;const b=USt(h);if(b===!1||!b&&!i||b&&s&&s.includes(b))return;Array.isArray(h.properties.className)||(h.properties.className=[]),h.properties.className.includes(c)||h.properties.className.unshift(c);const v=POt(h,{whitespace:"pre"});let y;try{y=b?u.highlight(b,v,{prefix:o}):u.highlightAuto(v,{prefix:o,subset:l})}catch(w){const x=w;if(b&&/Unknown language/.test(x.message)){f.message("Cannot highlight as `"+b+"`, it’s not registered",{ancestors:[g,h],cause:x,place:h.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw x}!b&&y.data&&y.data.language&&h.properties.className.push("language-"+y.data.language),y.children.length>0&&(h.children=y.children)})}}function USt(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let i;for(;++n-1&&s<=t.length){let o=0;for(;;){let l=n[o];if(l===void 0){const c=lne(t,n[o-1]);l=c===-1?t.length+1:c+1,n[o]=l}if(l>s)return{line:o+1,column:s-(o>0?n[o-1]:0)+1,offset:s};o++}}}function r(s){if(s&&typeof s.line=="number"&&typeof s.column=="number"&&!Number.isNaN(s.line)&&!Number.isNaN(s.column)){for(;n.length1?n[s.line-2]:0)+s.column-1;if(o=55296&&e<=57343}function hEt(e){return e>=56320&&e<=57343}function pEt(e,t){return(e-55296)*1024+9216+t}function fMe(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function hMe(e){return e>=64976&&e<=65007||fEt.has(e)}var dt;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(dt||(dt={}));const mEt=65536;class gEt{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=mEt,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:i,col:r,offset:s}=this,o=r+n,l=s+n;return{code:t,startLine:i,endLine:i,startCol:o,endCol:o,startOffset:l,endOffset:l}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(hEt(n))return this.pos++,this._addGap(),pEt(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,xe.EOF;return this._err(dt.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let i=0;i=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,xe.EOF;const i=this.html.charCodeAt(n);return i===xe.CARRIAGE_RETURN?xe.LINE_FEED:i}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,xe.EOF;let t=this.html.charCodeAt(this.pos);return t===xe.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,xe.LINE_FEED):t===xe.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,dMe(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===xe.LINE_FEED||t===xe.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){fMe(t)?this._err(dt.controlCharacterInInputStream):hMe(t)&&this._err(dt.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const bEt=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),yEt=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function vEt(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=yEt.get(e))!==null&&t!==void 0?t:e}var _o;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(_o||(_o={}));const xEt=32;var yg;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(yg||(yg={}));function YB(e){return e>=_o.ZERO&&e<=_o.NINE}function wEt(e){return e>=_o.UPPER_A&&e<=_o.UPPER_F||e>=_o.LOWER_A&&e<=_o.LOWER_F}function OEt(e){return e>=_o.UPPER_A&&e<=_o.UPPER_Z||e>=_o.LOWER_A&&e<=_o.LOWER_Z||YB(e)}function kEt(e){return e===_o.EQUALS||OEt(e)}var Oo;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Oo||(Oo={}));var yp;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(yp||(yp={}));class SEt{constructor(t,n,i){this.decodeTree=t,this.emitCodePoint=n,this.errors=i,this.state=Oo.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=yp.Strict}startEntity(t){this.decodeMode=t,this.state=Oo.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Oo.EntityStart:return t.charCodeAt(n)===_o.NUM?(this.state=Oo.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Oo.NamedEntity,this.stateNamedEntity(t,n));case Oo.NumericStart:return this.stateNumericStart(t,n);case Oo.NumericDecimal:return this.stateNumericDecimal(t,n);case Oo.NumericHex:return this.stateNumericHex(t,n);case Oo.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|xEt)===_o.LOWER_X?(this.state=Oo.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Oo.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,i,r){if(n!==i){const s=i-n;this.result=this.result*Math.pow(r,s)+Number.parseInt(t.substr(n,s),r),this.consumed+=s}}stateNumericHex(t,n){const i=n;for(;n>14;for(;n>14,s!==0){if(o===_o.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==yp.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:i}=this,r=(i[n]&yg.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,r,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,i){const{decodeTree:r}=this;return this.emitCodePoint(n===1?r[t]&~yg.VALUE_LENGTH:r[t+1],i),n===3&&this.emitCodePoint(r[t+2],i),i}end(){var t;switch(this.state){case Oo.NamedEntity:return this.result!==0&&(this.decodeMode!==yp.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Oo.NumericDecimal:return this.emitNumericEntity(0,2);case Oo.NumericHex:return this.emitNumericEntity(0,3);case Oo.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Oo.EntityStart:return 0}}}function EEt(e,t,n,i){const r=(t&yg.BRANCH_LENGTH)>>7,s=t&yg.JUMP_TABLE;if(r===0)return s!==0&&i===s?n:-1;if(s){const c=i-s;return c<0||c>=r?-1:e[n+c]-1}let o=n,l=o+r-1;for(;o<=l;){const c=o+l>>>1,u=e[c];if(ui)l=c-1;else return e[c+r]}return-1}var Rt;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(Rt||(Rt={}));var Yy;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(Yy||(Yy={}));var id;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(id||(id={}));var Je;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(Je||(Je={}));var B;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(B||(B={}));const CEt=new Map([[Je.A,B.A],[Je.ADDRESS,B.ADDRESS],[Je.ANNOTATION_XML,B.ANNOTATION_XML],[Je.APPLET,B.APPLET],[Je.AREA,B.AREA],[Je.ARTICLE,B.ARTICLE],[Je.ASIDE,B.ASIDE],[Je.B,B.B],[Je.BASE,B.BASE],[Je.BASEFONT,B.BASEFONT],[Je.BGSOUND,B.BGSOUND],[Je.BIG,B.BIG],[Je.BLOCKQUOTE,B.BLOCKQUOTE],[Je.BODY,B.BODY],[Je.BR,B.BR],[Je.BUTTON,B.BUTTON],[Je.CAPTION,B.CAPTION],[Je.CENTER,B.CENTER],[Je.CODE,B.CODE],[Je.COL,B.COL],[Je.COLGROUP,B.COLGROUP],[Je.DD,B.DD],[Je.DESC,B.DESC],[Je.DETAILS,B.DETAILS],[Je.DIALOG,B.DIALOG],[Je.DIR,B.DIR],[Je.DIV,B.DIV],[Je.DL,B.DL],[Je.DT,B.DT],[Je.EM,B.EM],[Je.EMBED,B.EMBED],[Je.FIELDSET,B.FIELDSET],[Je.FIGCAPTION,B.FIGCAPTION],[Je.FIGURE,B.FIGURE],[Je.FONT,B.FONT],[Je.FOOTER,B.FOOTER],[Je.FOREIGN_OBJECT,B.FOREIGN_OBJECT],[Je.FORM,B.FORM],[Je.FRAME,B.FRAME],[Je.FRAMESET,B.FRAMESET],[Je.H1,B.H1],[Je.H2,B.H2],[Je.H3,B.H3],[Je.H4,B.H4],[Je.H5,B.H5],[Je.H6,B.H6],[Je.HEAD,B.HEAD],[Je.HEADER,B.HEADER],[Je.HGROUP,B.HGROUP],[Je.HR,B.HR],[Je.HTML,B.HTML],[Je.I,B.I],[Je.IMG,B.IMG],[Je.IMAGE,B.IMAGE],[Je.INPUT,B.INPUT],[Je.IFRAME,B.IFRAME],[Je.KEYGEN,B.KEYGEN],[Je.LABEL,B.LABEL],[Je.LI,B.LI],[Je.LINK,B.LINK],[Je.LISTING,B.LISTING],[Je.MAIN,B.MAIN],[Je.MALIGNMARK,B.MALIGNMARK],[Je.MARQUEE,B.MARQUEE],[Je.MATH,B.MATH],[Je.MENU,B.MENU],[Je.META,B.META],[Je.MGLYPH,B.MGLYPH],[Je.MI,B.MI],[Je.MO,B.MO],[Je.MN,B.MN],[Je.MS,B.MS],[Je.MTEXT,B.MTEXT],[Je.NAV,B.NAV],[Je.NOBR,B.NOBR],[Je.NOFRAMES,B.NOFRAMES],[Je.NOEMBED,B.NOEMBED],[Je.NOSCRIPT,B.NOSCRIPT],[Je.OBJECT,B.OBJECT],[Je.OL,B.OL],[Je.OPTGROUP,B.OPTGROUP],[Je.OPTION,B.OPTION],[Je.P,B.P],[Je.PARAM,B.PARAM],[Je.PLAINTEXT,B.PLAINTEXT],[Je.PRE,B.PRE],[Je.RB,B.RB],[Je.RP,B.RP],[Je.RT,B.RT],[Je.RTC,B.RTC],[Je.RUBY,B.RUBY],[Je.S,B.S],[Je.SCRIPT,B.SCRIPT],[Je.SEARCH,B.SEARCH],[Je.SECTION,B.SECTION],[Je.SELECT,B.SELECT],[Je.SOURCE,B.SOURCE],[Je.SMALL,B.SMALL],[Je.SPAN,B.SPAN],[Je.STRIKE,B.STRIKE],[Je.STRONG,B.STRONG],[Je.STYLE,B.STYLE],[Je.SUB,B.SUB],[Je.SUMMARY,B.SUMMARY],[Je.SUP,B.SUP],[Je.TABLE,B.TABLE],[Je.TBODY,B.TBODY],[Je.TEMPLATE,B.TEMPLATE],[Je.TEXTAREA,B.TEXTAREA],[Je.TFOOT,B.TFOOT],[Je.TD,B.TD],[Je.TH,B.TH],[Je.THEAD,B.THEAD],[Je.TITLE,B.TITLE],[Je.TR,B.TR],[Je.TRACK,B.TRACK],[Je.TT,B.TT],[Je.U,B.U],[Je.UL,B.UL],[Je.SVG,B.SVG],[Je.VAR,B.VAR],[Je.WBR,B.WBR],[Je.XMP,B.XMP]]);function rO(e){var t;return(t=CEt.get(e))!==null&&t!==void 0?t:B.UNKNOWN}const Mt=B,AEt={[Rt.HTML]:new Set([Mt.ADDRESS,Mt.APPLET,Mt.AREA,Mt.ARTICLE,Mt.ASIDE,Mt.BASE,Mt.BASEFONT,Mt.BGSOUND,Mt.BLOCKQUOTE,Mt.BODY,Mt.BR,Mt.BUTTON,Mt.CAPTION,Mt.CENTER,Mt.COL,Mt.COLGROUP,Mt.DD,Mt.DETAILS,Mt.DIR,Mt.DIV,Mt.DL,Mt.DT,Mt.EMBED,Mt.FIELDSET,Mt.FIGCAPTION,Mt.FIGURE,Mt.FOOTER,Mt.FORM,Mt.FRAME,Mt.FRAMESET,Mt.H1,Mt.H2,Mt.H3,Mt.H4,Mt.H5,Mt.H6,Mt.HEAD,Mt.HEADER,Mt.HGROUP,Mt.HR,Mt.HTML,Mt.IFRAME,Mt.IMG,Mt.INPUT,Mt.LI,Mt.LINK,Mt.LISTING,Mt.MAIN,Mt.MARQUEE,Mt.MENU,Mt.META,Mt.NAV,Mt.NOEMBED,Mt.NOFRAMES,Mt.NOSCRIPT,Mt.OBJECT,Mt.OL,Mt.P,Mt.PARAM,Mt.PLAINTEXT,Mt.PRE,Mt.SCRIPT,Mt.SECTION,Mt.SELECT,Mt.SOURCE,Mt.STYLE,Mt.SUMMARY,Mt.TABLE,Mt.TBODY,Mt.TD,Mt.TEMPLATE,Mt.TEXTAREA,Mt.TFOOT,Mt.TH,Mt.THEAD,Mt.TITLE,Mt.TR,Mt.TRACK,Mt.UL,Mt.WBR,Mt.XMP]),[Rt.MATHML]:new Set([Mt.MI,Mt.MO,Mt.MN,Mt.MS,Mt.MTEXT,Mt.ANNOTATION_XML]),[Rt.SVG]:new Set([Mt.TITLE,Mt.FOREIGN_OBJECT,Mt.DESC]),[Rt.XLINK]:new Set,[Rt.XML]:new Set,[Rt.XMLNS]:new Set},ZB=new Set([Mt.H1,Mt.H2,Mt.H3,Mt.H4,Mt.H5,Mt.H6]);Je.STYLE,Je.SCRIPT,Je.XMP,Je.IFRAME,Je.NOEMBED,Je.NOFRAMES,Je.PLAINTEXT;var Ce;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(Ce||(Ce={}));const Ea={DATA:Ce.DATA,RCDATA:Ce.RCDATA,RAWTEXT:Ce.RAWTEXT,SCRIPT_DATA:Ce.SCRIPT_DATA,PLAINTEXT:Ce.PLAINTEXT,CDATA_SECTION:Ce.CDATA_SECTION};function TEt(e){return e>=xe.DIGIT_0&&e<=xe.DIGIT_9}function fS(e){return e>=xe.LATIN_CAPITAL_A&&e<=xe.LATIN_CAPITAL_Z}function _Et(e){return e>=xe.LATIN_SMALL_A&&e<=xe.LATIN_SMALL_Z}function zm(e){return _Et(e)||fS(e)}function une(e){return zm(e)||TEt(e)}function T_(e){return e+32}function mMe(e){return e===xe.SPACE||e===xe.LINE_FEED||e===xe.TABULATION||e===xe.FORM_FEED}function dne(e){return mMe(e)||e===xe.SOLIDUS||e===xe.GREATER_THAN_SIGN}function jEt(e){return e===xe.NULL?dt.nullCharacterReference:e>1114111?dt.characterReferenceOutsideUnicodeRange:dMe(e)?dt.surrogateCharacterReference:hMe(e)?dt.noncharacterCharacterReference:fMe(e)||e===xe.CARRIAGE_RETURN?dt.controlCharacterReference:null}class NEt{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=Ce.DATA,this.returnState=Ce.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new gEt(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new SEt(bEt,(i,r)=>{this.preprocessor.pos=this.entityStartPos+r-1,this._flushCodePointConsumedAsCharacterReference(i)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(dt.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:i=>{this._err(dt.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+i)},validateNumericCharacterReference:i=>{const r=jEt(i);r&&this._err(r,1)}}:void 0)}_err(t,n=0){var i,r;(r=(i=this.handler).onParseError)===null||r===void 0||r.call(i,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==null||t())}write(t,n,i){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||i==null||i()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n0&&this._err(dt.endTagWithAttributes),t.selfClosing&&this._err(dt.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case $i.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case $i.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case $i.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:$i.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=mMe(t)?$i.WHITESPACE_CHARACTER:t===xe.NULL?$i.NULL_CHARACTER:$i.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken($i.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=Ce.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?yp.Attribute:yp.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===Ce.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===Ce.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===Ce.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case Ce.DATA:{this._stateData(t);break}case Ce.RCDATA:{this._stateRcdata(t);break}case Ce.RAWTEXT:{this._stateRawtext(t);break}case Ce.SCRIPT_DATA:{this._stateScriptData(t);break}case Ce.PLAINTEXT:{this._statePlaintext(t);break}case Ce.TAG_OPEN:{this._stateTagOpen(t);break}case Ce.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case Ce.TAG_NAME:{this._stateTagName(t);break}case Ce.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case Ce.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case Ce.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case Ce.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case Ce.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case Ce.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case Ce.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case Ce.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case Ce.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case Ce.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case Ce.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case Ce.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case Ce.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case Ce.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case Ce.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case Ce.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case Ce.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case Ce.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case Ce.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case Ce.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case Ce.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case Ce.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case Ce.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case Ce.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case Ce.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case Ce.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case Ce.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case Ce.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case Ce.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case Ce.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case Ce.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case Ce.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case Ce.BOGUS_COMMENT:{this._stateBogusComment(t);break}case Ce.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case Ce.COMMENT_START:{this._stateCommentStart(t);break}case Ce.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case Ce.COMMENT:{this._stateComment(t);break}case Ce.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case Ce.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case Ce.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case Ce.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case Ce.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case Ce.COMMENT_END:{this._stateCommentEnd(t);break}case Ce.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case Ce.DOCTYPE:{this._stateDoctype(t);break}case Ce.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case Ce.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case Ce.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case Ce.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case Ce.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case Ce.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case Ce.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case Ce.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case Ce.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case Ce.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case Ce.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case Ce.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case Ce.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case Ce.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case Ce.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case Ce.CDATA_SECTION:{this._stateCdataSection(t);break}case Ce.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case Ce.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case Ce.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case Ce.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case xe.LESS_THAN_SIGN:{this.state=Ce.TAG_OPEN;break}case xe.AMPERSAND:{this._startCharacterReference();break}case xe.NULL:{this._err(dt.unexpectedNullCharacter),this._emitCodePoint(t);break}case xe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case xe.AMPERSAND:{this._startCharacterReference();break}case xe.LESS_THAN_SIGN:{this.state=Ce.RCDATA_LESS_THAN_SIGN;break}case xe.NULL:{this._err(dt.unexpectedNullCharacter),this._emitChars(Fs);break}case xe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case xe.LESS_THAN_SIGN:{this.state=Ce.RAWTEXT_LESS_THAN_SIGN;break}case xe.NULL:{this._err(dt.unexpectedNullCharacter),this._emitChars(Fs);break}case xe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case xe.LESS_THAN_SIGN:{this.state=Ce.SCRIPT_DATA_LESS_THAN_SIGN;break}case xe.NULL:{this._err(dt.unexpectedNullCharacter),this._emitChars(Fs);break}case xe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case xe.NULL:{this._err(dt.unexpectedNullCharacter),this._emitChars(Fs);break}case xe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(zm(t))this._createStartTagToken(),this.state=Ce.TAG_NAME,this._stateTagName(t);else switch(t){case xe.EXCLAMATION_MARK:{this.state=Ce.MARKUP_DECLARATION_OPEN;break}case xe.SOLIDUS:{this.state=Ce.END_TAG_OPEN;break}case xe.QUESTION_MARK:{this._err(dt.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=Ce.BOGUS_COMMENT,this._stateBogusComment(t);break}case xe.EOF:{this._err(dt.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(dt.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=Ce.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(zm(t))this._createEndTagToken(),this.state=Ce.TAG_NAME,this._stateTagName(t);else switch(t){case xe.GREATER_THAN_SIGN:{this._err(dt.missingEndTagName),this.state=Ce.DATA;break}case xe.EOF:{this._err(dt.eofBeforeTagName),this._emitChars("");break}case xe.NULL:{this._err(dt.unexpectedNullCharacter),this.state=Ce.SCRIPT_DATA_ESCAPED,this._emitChars(Fs);break}case xe.EOF:{this._err(dt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Ce.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===xe.SOLIDUS?this.state=Ce.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:zm(t)?(this._emitChars("<"),this.state=Ce.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=Ce.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){zm(t)?(this.state=Ce.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("");break}case xe.NULL:{this._err(dt.unexpectedNullCharacter),this.state=Ce.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Fs);break}case xe.EOF:{this._err(dt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Ce.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===xe.SOLIDUS?(this.state=Ce.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=Ce.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(wc.SCRIPT,!1)&&dne(this.preprocessor.peek(wc.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const i=this._indexOf(t);this.items[i]=n,i===this.stackTop&&(this.current=n)}insertAfter(t,n,i){const r=this._indexOf(t)+1;this.items.splice(r,0,n),this.tagIDs.splice(r,0,i),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==Rt.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop=0;i--)if(t.has(this.tagIDs[i])&&this.treeAdapter.getNamespaceURI(this.items[i])===n)return i;return-1}clearBackTo(t,n){const i=this._indexOfTagNames(t,n);this.shortenToLength(i+1)}clearBackToTableContext(){this.clearBackTo(MEt,Rt.HTML)}clearBackToTableBodyContext(){this.clearBackTo(DEt,Rt.HTML)}clearBackToTableRowContext(){this.clearBackTo(PEt,Rt.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===B.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===B.HTML}hasInDynamicScope(t,n){for(let i=this.stackTop;i>=0;i--){const r=this.tagIDs[i];switch(this.treeAdapter.getNamespaceURI(this.items[i])){case Rt.HTML:{if(r===t)return!0;if(n.has(r))return!1;break}case Rt.SVG:{if(pne.has(r))return!1;break}case Rt.MATHML:{if(hne.has(r))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,TI)}hasInListItemScope(t){return this.hasInDynamicScope(t,REt)}hasInButtonScope(t){return this.hasInDynamicScope(t,IEt)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case Rt.HTML:{if(ZB.has(n))return!0;if(TI.has(n))return!1;break}case Rt.SVG:{if(pne.has(n))return!1;break}case Rt.MATHML:{if(hne.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Rt.HTML)switch(this.tagIDs[n]){case t:return!0;case B.TABLE:case B.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===Rt.HTML)switch(this.tagIDs[t]){case B.TBODY:case B.THEAD:case B.TFOOT:return!0;case B.TABLE:case B.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Rt.HTML)switch(this.tagIDs[n]){case t:return!0;case B.OPTION:case B.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&gMe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&fne.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&fne.has(this.currentTagId);)this.pop()}}const _4=3;var Gf;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Gf||(Gf={}));const mne={type:Gf.Marker};class FEt{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const i=[],r=n.length,s=this.treeAdapter.getTagName(t),o=this.treeAdapter.getNamespaceURI(t);for(let l=0;l[o.name,o.value]));let s=0;for(let o=0;or.get(c.name)===c.value)&&(s+=1,s>=_4&&this.entries.splice(l.idx,1))}}insertMarker(){this.entries.unshift(mne)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Gf.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const i=this.entries.indexOf(this.bookmark);this.entries.splice(i,0,{type:Gf.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(mne);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(i=>i.type===Gf.Marker||this.treeAdapter.getTagName(i.element)===t);return n&&n.type===Gf.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Gf.Element&&n.element===t)}}const Vm={createDocument(){return{nodeName:"#document",mode:id.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const i=e.childNodes.indexOf(n);e.childNodes.splice(i,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,i){const r=e.childNodes.find(s=>s.nodeName==="#documentType");if(r)r.name=t,r.publicId=n,r.systemId=i;else{const s={nodeName:"#documentType",name:t,publicId:n,systemId:i,parentNode:null};Vm.appendChild(e,s)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(Vm.isTextNode(n)){n.value+=t;return}}Vm.appendChild(e,Vm.createTextNode(t))},insertTextBefore(e,t,n){const i=e.childNodes[e.childNodes.indexOf(n)-1];i&&Vm.isTextNode(i)?i.value+=t:Vm.insertBefore(e,Vm.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(i=>i.name));for(let i=0;ie.startsWith(n))}function HEt(e){return e.name===bMe&&e.publicId===null&&(e.systemId===null||e.systemId===BEt)}function qEt(e){if(e.name!==bMe)return id.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===UEt)return id.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),zEt.has(n))return id.QUIRKS;let i=t===null?QEt:yMe;if(gne(n,i))return id.QUIRKS;if(i=t===null?vMe:VEt,gne(n,i))return id.LIMITED_QUIRKS}return id.NO_QUIRKS}const bne={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},WEt="definitionurl",KEt="definitionURL",GEt=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),XEt=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Rt.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Rt.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Rt.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Rt.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Rt.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Rt.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Rt.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Rt.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Rt.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Rt.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Rt.XMLNS}]]),YEt=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),ZEt=new Set([B.B,B.BIG,B.BLOCKQUOTE,B.BODY,B.BR,B.CENTER,B.CODE,B.DD,B.DIV,B.DL,B.DT,B.EM,B.EMBED,B.H1,B.H2,B.H3,B.H4,B.H5,B.H6,B.HEAD,B.HR,B.I,B.IMG,B.LI,B.LISTING,B.MENU,B.META,B.NOBR,B.OL,B.P,B.PRE,B.RUBY,B.S,B.SMALL,B.SPAN,B.STRONG,B.STRIKE,B.SUB,B.SUP,B.TABLE,B.TT,B.U,B.UL,B.VAR]);function JEt(e){const t=e.tagID;return t===B.FONT&&e.attrs.some(({name:i})=>i===Yy.COLOR||i===Yy.SIZE||i===Yy.FACE)||ZEt.has(t)}function xMe(e){for(let t=0;t0&&this._setContextModes(t,n)}onItemPop(t,n){var i,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(r=(i=this.treeAdapter).onItemPop)===null||r===void 0||r.call(i,t,this.openElements.current),n){let s,o;this.openElements.stackTop===0&&this.fragmentContext?(s=this.fragmentContext,o=this.fragmentContextID):{current:s,currentTagId:o}=this.openElements,this._setContextModes(s,o)}}_setContextModes(t,n){const i=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===Rt.HTML;this.currentNotInHTML=!i,this.tokenizer.inForeignNode=!i&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,Rt.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=Ie.TEXT}switchToPlaintextParsing(){this.insertionMode=Ie.TEXT,this.originalInsertionMode=Ie.IN_BODY,this.tokenizer.state=Ea.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===Je.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Rt.HTML))switch(this.fragmentContextID){case B.TITLE:case B.TEXTAREA:{this.tokenizer.state=Ea.RCDATA;break}case B.STYLE:case B.XMP:case B.IFRAME:case B.NOEMBED:case B.NOFRAMES:case B.NOSCRIPT:{this.tokenizer.state=Ea.RAWTEXT;break}case B.SCRIPT:{this.tokenizer.state=Ea.SCRIPT_DATA;break}case B.PLAINTEXT:{this.tokenizer.state=Ea.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",i=t.publicId||"",r=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,i,r),t.location){const o=this.treeAdapter.getChildNodes(this.document).find(l=>this.treeAdapter.isDocumentTypeNode(l));o&&this.treeAdapter.setNodeSourceCodeLocation(o,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const i=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,i)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const i=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(i??this.document,t)}}_appendElement(t,n){const i=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(i,t.location)}_insertElement(t,n){const i=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(i,t.location),this.openElements.push(i,t.tagID)}_insertFakeElement(t,n){const i=this.treeAdapter.createElement(t,Rt.HTML,[]);this._attachElementToTree(i,null),this.openElements.push(i,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,Rt.HTML,t.attrs),i=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,i),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(Je.HTML,Rt.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,B.HTML)}_appendCommentNode(t,n){const i=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,i),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,t.location)}_insertCharacters(t){let n,i;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:i}=this._findFosterParentingLocation(),i?this.treeAdapter.insertTextBefore(n,t.chars,i):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const r=this.treeAdapter.getChildNodes(n),s=i?r.lastIndexOf(i):r.length,o=r[s-1];if(this.treeAdapter.getNodeSourceCodeLocation(o)){const{endLine:c,endCol:u,endOffset:d}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(o,{endLine:c,endCol:u,endOffset:d})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(o,t.location)}_adoptNodes(t,n){for(let i=this.treeAdapter.getFirstChild(t);i;i=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(i),this.treeAdapter.appendChild(n,i)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const i=n.location,r=this.treeAdapter.getTagName(t),s=n.type===$i.END_TAG&&r===n.tagName?{endTag:{...i},endLine:i.endLine,endCol:i.endCol,endOffset:i.endOffset}:{endLine:i.startLine,endCol:i.startCol,endOffset:i.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,s)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,i;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,i=this.fragmentContextID):{current:n,currentTagId:i}=this.openElements,t.tagID===B.SVG&&this.treeAdapter.getTagName(n)===Je.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===Rt.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===B.MGLYPH||t.tagID===B.MALIGNMARK)&&i!==void 0&&!this._isIntegrationPoint(i,n,Rt.HTML)}_processToken(t){switch(t.type){case $i.CHARACTER:{this.onCharacter(t);break}case $i.NULL_CHARACTER:{this.onNullCharacter(t);break}case $i.COMMENT:{this.onComment(t);break}case $i.DOCTYPE:{this.onDoctype(t);break}case $i.START_TAG:{this._processStartTag(t);break}case $i.END_TAG:{this.onEndTag(t);break}case $i.EOF:{this.onEof(t);break}case $i.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,i){const r=this.treeAdapter.getNamespaceURI(n),s=this.treeAdapter.getAttrList(n);return iCt(t,r,s,i)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(r=>r.type===Gf.Marker||this.openElements.contains(r.element)),i=n===-1?t-1:n-1;for(let r=i;r>=0;r--){const s=this.activeFormattingElements.entries[r];this._insertElement(s.token,this.treeAdapter.getNamespaceURI(s.element)),s.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=Ie.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(B.P),this.openElements.popUntilTagNamePopped(B.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case B.TR:{this.insertionMode=Ie.IN_ROW;return}case B.TBODY:case B.THEAD:case B.TFOOT:{this.insertionMode=Ie.IN_TABLE_BODY;return}case B.CAPTION:{this.insertionMode=Ie.IN_CAPTION;return}case B.COLGROUP:{this.insertionMode=Ie.IN_COLUMN_GROUP;return}case B.TABLE:{this.insertionMode=Ie.IN_TABLE;return}case B.BODY:{this.insertionMode=Ie.IN_BODY;return}case B.FRAMESET:{this.insertionMode=Ie.IN_FRAMESET;return}case B.SELECT:{this._resetInsertionModeForSelect(t);return}case B.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case B.HTML:{this.insertionMode=this.headElement?Ie.AFTER_HEAD:Ie.BEFORE_HEAD;return}case B.TD:case B.TH:{if(t>0){this.insertionMode=Ie.IN_CELL;return}break}case B.HEAD:{if(t>0){this.insertionMode=Ie.IN_HEAD;return}break}}this.insertionMode=Ie.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const i=this.openElements.tagIDs[n];if(i===B.TEMPLATE)break;if(i===B.TABLE){this.insertionMode=Ie.IN_SELECT_IN_TABLE;return}}this.insertionMode=Ie.IN_SELECT}_isElementCausesFosterParenting(t){return OMe.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case B.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===Rt.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case B.TABLE:{const i=this.treeAdapter.getParentNode(n);return i?{parent:i,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const i=this.treeAdapter.getNamespaceURI(t);return AEt[i].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){LAt(this,t);return}switch(this.insertionMode){case Ie.INITIAL:{yk(this,t);break}case Ie.BEFORE_HTML:{cE(this,t);break}case Ie.BEFORE_HEAD:{uE(this,t);break}case Ie.IN_HEAD:{dE(this,t);break}case Ie.IN_HEAD_NO_SCRIPT:{fE(this,t);break}case Ie.AFTER_HEAD:{hE(this,t);break}case Ie.IN_BODY:case Ie.IN_CAPTION:case Ie.IN_CELL:case Ie.IN_TEMPLATE:{SMe(this,t);break}case Ie.TEXT:case Ie.IN_SELECT:case Ie.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case Ie.IN_TABLE:case Ie.IN_TABLE_BODY:case Ie.IN_ROW:{j4(this,t);break}case Ie.IN_TABLE_TEXT:{jMe(this,t);break}case Ie.IN_COLUMN_GROUP:{_I(this,t);break}case Ie.AFTER_BODY:{jI(this,t);break}case Ie.AFTER_AFTER_BODY:{NN(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){MAt(this,t);return}switch(this.insertionMode){case Ie.INITIAL:{yk(this,t);break}case Ie.BEFORE_HTML:{cE(this,t);break}case Ie.BEFORE_HEAD:{uE(this,t);break}case Ie.IN_HEAD:{dE(this,t);break}case Ie.IN_HEAD_NO_SCRIPT:{fE(this,t);break}case Ie.AFTER_HEAD:{hE(this,t);break}case Ie.TEXT:{this._insertCharacters(t);break}case Ie.IN_TABLE:case Ie.IN_TABLE_BODY:case Ie.IN_ROW:{j4(this,t);break}case Ie.IN_COLUMN_GROUP:{_I(this,t);break}case Ie.AFTER_BODY:{jI(this,t);break}case Ie.AFTER_AFTER_BODY:{NN(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){JB(this,t);return}switch(this.insertionMode){case Ie.INITIAL:case Ie.BEFORE_HTML:case Ie.BEFORE_HEAD:case Ie.IN_HEAD:case Ie.IN_HEAD_NO_SCRIPT:case Ie.AFTER_HEAD:case Ie.IN_BODY:case Ie.IN_TABLE:case Ie.IN_CAPTION:case Ie.IN_COLUMN_GROUP:case Ie.IN_TABLE_BODY:case Ie.IN_ROW:case Ie.IN_CELL:case Ie.IN_SELECT:case Ie.IN_SELECT_IN_TABLE:case Ie.IN_TEMPLATE:case Ie.IN_FRAMESET:case Ie.AFTER_FRAMESET:{JB(this,t);break}case Ie.IN_TABLE_TEXT:{vk(this,t);break}case Ie.AFTER_BODY:{pCt(this,t);break}case Ie.AFTER_AFTER_BODY:case Ie.AFTER_AFTER_FRAMESET:{mCt(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case Ie.INITIAL:{gCt(this,t);break}case Ie.BEFORE_HEAD:case Ie.IN_HEAD:case Ie.IN_HEAD_NO_SCRIPT:case Ie.AFTER_HEAD:{this._err(t,dt.misplacedDoctype);break}case Ie.IN_TABLE_TEXT:{vk(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,dt.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?$At(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case Ie.INITIAL:{yk(this,t);break}case Ie.BEFORE_HTML:{bCt(this,t);break}case Ie.BEFORE_HEAD:{vCt(this,t);break}case Ie.IN_HEAD:{Tf(this,t);break}case Ie.IN_HEAD_NO_SCRIPT:{OCt(this,t);break}case Ie.AFTER_HEAD:{SCt(this,t);break}case Ie.IN_BODY:{Rl(this,t);break}case Ie.IN_TABLE:{s1(this,t);break}case Ie.IN_TABLE_TEXT:{vk(this,t);break}case Ie.IN_CAPTION:{xAt(this,t);break}case Ie.IN_COLUMN_GROUP:{rq(this,t);break}case Ie.IN_TABLE_BODY:{_M(this,t);break}case Ie.IN_ROW:{jM(this,t);break}case Ie.IN_CELL:{kAt(this,t);break}case Ie.IN_SELECT:{IMe(this,t);break}case Ie.IN_SELECT_IN_TABLE:{EAt(this,t);break}case Ie.IN_TEMPLATE:{AAt(this,t);break}case Ie.AFTER_BODY:{_At(this,t);break}case Ie.IN_FRAMESET:{jAt(this,t);break}case Ie.AFTER_FRAMESET:{RAt(this,t);break}case Ie.AFTER_AFTER_BODY:{PAt(this,t);break}case Ie.AFTER_AFTER_FRAMESET:{DAt(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?FAt(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case Ie.INITIAL:{yk(this,t);break}case Ie.BEFORE_HTML:{yCt(this,t);break}case Ie.BEFORE_HEAD:{xCt(this,t);break}case Ie.IN_HEAD:{wCt(this,t);break}case Ie.IN_HEAD_NO_SCRIPT:{kCt(this,t);break}case Ie.AFTER_HEAD:{ECt(this,t);break}case Ie.IN_BODY:{TM(this,t);break}case Ie.TEXT:{uAt(this,t);break}case Ie.IN_TABLE:{CC(this,t);break}case Ie.IN_TABLE_TEXT:{vk(this,t);break}case Ie.IN_CAPTION:{wAt(this,t);break}case Ie.IN_COLUMN_GROUP:{OAt(this,t);break}case Ie.IN_TABLE_BODY:{e9(this,t);break}case Ie.IN_ROW:{RMe(this,t);break}case Ie.IN_CELL:{SAt(this,t);break}case Ie.IN_SELECT:{PMe(this,t);break}case Ie.IN_SELECT_IN_TABLE:{CAt(this,t);break}case Ie.IN_TEMPLATE:{TAt(this,t);break}case Ie.AFTER_BODY:{MMe(this,t);break}case Ie.IN_FRAMESET:{NAt(this,t);break}case Ie.AFTER_FRAMESET:{IAt(this,t);break}case Ie.AFTER_AFTER_BODY:{NN(this,t);break}}}onEof(t){switch(this.insertionMode){case Ie.INITIAL:{yk(this,t);break}case Ie.BEFORE_HTML:{cE(this,t);break}case Ie.BEFORE_HEAD:{uE(this,t);break}case Ie.IN_HEAD:{dE(this,t);break}case Ie.IN_HEAD_NO_SCRIPT:{fE(this,t);break}case Ie.AFTER_HEAD:{hE(this,t);break}case Ie.IN_BODY:case Ie.IN_TABLE:case Ie.IN_CAPTION:case Ie.IN_COLUMN_GROUP:case Ie.IN_TABLE_BODY:case Ie.IN_ROW:case Ie.IN_CELL:case Ie.IN_SELECT:case Ie.IN_SELECT_IN_TABLE:{TMe(this,t);break}case Ie.TEXT:{dAt(this,t);break}case Ie.IN_TABLE_TEXT:{vk(this,t);break}case Ie.IN_TEMPLATE:{DMe(this,t);break}case Ie.AFTER_BODY:case Ie.IN_FRAMESET:case Ie.AFTER_FRAMESET:case Ie.AFTER_AFTER_BODY:case Ie.AFTER_AFTER_FRAMESET:{iq(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===xe.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case Ie.IN_HEAD:case Ie.IN_HEAD_NO_SCRIPT:case Ie.AFTER_HEAD:case Ie.TEXT:case Ie.IN_COLUMN_GROUP:case Ie.IN_SELECT:case Ie.IN_SELECT_IN_TABLE:case Ie.IN_FRAMESET:case Ie.AFTER_FRAMESET:{this._insertCharacters(t);break}case Ie.IN_BODY:case Ie.IN_CAPTION:case Ie.IN_CELL:case Ie.IN_TEMPLATE:case Ie.AFTER_BODY:case Ie.AFTER_AFTER_BODY:case Ie.AFTER_AFTER_FRAMESET:{kMe(this,t);break}case Ie.IN_TABLE:case Ie.IN_TABLE_BODY:case Ie.IN_ROW:{j4(this,t);break}case Ie.IN_TABLE_TEXT:{_Me(this,t);break}}}};function lCt(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):AMe(e,t),n}function cCt(e,t){let n=null,i=e.openElements.stackTop;for(;i>=0;i--){const r=e.openElements.items[i];if(r===t.element)break;e._isSpecialElement(r,e.openElements.tagIDs[i])&&(n=r)}return n||(e.openElements.shortenToLength(Math.max(i,0)),e.activeFormattingElements.removeEntry(t)),n}function uCt(e,t,n){let i=t,r=e.openElements.getCommonAncestor(t);for(let s=0,o=r;o!==n;s++,o=r){r=e.openElements.getCommonAncestor(o);const l=e.activeFormattingElements.getElementEntry(o),c=l&&s>=aCt;!l||c?(c&&e.activeFormattingElements.removeEntry(l),e.openElements.remove(o)):(o=dCt(e,l),i===t&&(e.activeFormattingElements.bookmark=l),e.treeAdapter.detachNode(i),e.treeAdapter.appendChild(o,i),i=o)}return i}function dCt(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),i=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,i),t.element=i,i}function fCt(e,t,n){const i=e.treeAdapter.getTagName(t),r=rO(i);if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{const s=e.treeAdapter.getNamespaceURI(t);r===B.TEMPLATE&&s===Rt.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function hCt(e,t,n){const i=e.treeAdapter.getNamespaceURI(n.element),{token:r}=n,s=e.treeAdapter.createElement(r.tagName,i,r.attrs);e._adoptNodes(t,s),e.treeAdapter.appendChild(t,s),e.activeFormattingElements.insertElementAfterBookmark(s,r),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,s,r.tagID)}function nq(e,t){for(let n=0;n=n;i--)e._setEndLocation(e.openElements.items[i],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const i=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(i);if(r&&!r.endTag&&(e._setEndLocation(i,t),e.openElements.stackTop>=1)){const s=e.openElements.items[1],o=e.treeAdapter.getNodeSourceCodeLocation(s);o&&!o.endTag&&e._setEndLocation(s,t)}}}}function gCt(e,t){e._setDocumentType(t);const n=t.forceQuirks?id.QUIRKS:qEt(t);HEt(t)||e._err(t,dt.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=Ie.BEFORE_HTML}function yk(e,t){e._err(t,dt.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,id.QUIRKS),e.insertionMode=Ie.BEFORE_HTML,e._processToken(t)}function bCt(e,t){t.tagID===B.HTML?(e._insertElement(t,Rt.HTML),e.insertionMode=Ie.BEFORE_HEAD):cE(e,t)}function yCt(e,t){const n=t.tagID;(n===B.HTML||n===B.HEAD||n===B.BODY||n===B.BR)&&cE(e,t)}function cE(e,t){e._insertFakeRootElement(),e.insertionMode=Ie.BEFORE_HEAD,e._processToken(t)}function vCt(e,t){switch(t.tagID){case B.HTML:{Rl(e,t);break}case B.HEAD:{e._insertElement(t,Rt.HTML),e.headElement=e.openElements.current,e.insertionMode=Ie.IN_HEAD;break}default:uE(e,t)}}function xCt(e,t){const n=t.tagID;n===B.HEAD||n===B.BODY||n===B.HTML||n===B.BR?uE(e,t):e._err(t,dt.endTagWithoutMatchingOpenElement)}function uE(e,t){e._insertFakeElement(Je.HEAD,B.HEAD),e.headElement=e.openElements.current,e.insertionMode=Ie.IN_HEAD,e._processToken(t)}function Tf(e,t){switch(t.tagID){case B.HTML:{Rl(e,t);break}case B.BASE:case B.BASEFONT:case B.BGSOUND:case B.LINK:case B.META:{e._appendElement(t,Rt.HTML),t.ackSelfClosing=!0;break}case B.TITLE:{e._switchToTextParsing(t,Ea.RCDATA);break}case B.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Ea.RAWTEXT):(e._insertElement(t,Rt.HTML),e.insertionMode=Ie.IN_HEAD_NO_SCRIPT);break}case B.NOFRAMES:case B.STYLE:{e._switchToTextParsing(t,Ea.RAWTEXT);break}case B.SCRIPT:{e._switchToTextParsing(t,Ea.SCRIPT_DATA);break}case B.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=Ie.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(Ie.IN_TEMPLATE);break}case B.HEAD:{e._err(t,dt.misplacedStartTagForHeadElement);break}default:dE(e,t)}}function wCt(e,t){switch(t.tagID){case B.HEAD:{e.openElements.pop(),e.insertionMode=Ie.AFTER_HEAD;break}case B.BODY:case B.BR:case B.HTML:{dE(e,t);break}case B.TEMPLATE:{J0(e,t);break}default:e._err(t,dt.endTagWithoutMatchingOpenElement)}}function J0(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==B.TEMPLATE&&e._err(t,dt.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(B.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,dt.endTagWithoutMatchingOpenElement)}function dE(e,t){e.openElements.pop(),e.insertionMode=Ie.AFTER_HEAD,e._processToken(t)}function OCt(e,t){switch(t.tagID){case B.HTML:{Rl(e,t);break}case B.BASEFONT:case B.BGSOUND:case B.HEAD:case B.LINK:case B.META:case B.NOFRAMES:case B.STYLE:{Tf(e,t);break}case B.NOSCRIPT:{e._err(t,dt.nestedNoscriptInHead);break}default:fE(e,t)}}function kCt(e,t){switch(t.tagID){case B.NOSCRIPT:{e.openElements.pop(),e.insertionMode=Ie.IN_HEAD;break}case B.BR:{fE(e,t);break}default:e._err(t,dt.endTagWithoutMatchingOpenElement)}}function fE(e,t){const n=t.type===$i.EOF?dt.openElementsLeftAfterEof:dt.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=Ie.IN_HEAD,e._processToken(t)}function SCt(e,t){switch(t.tagID){case B.HTML:{Rl(e,t);break}case B.BODY:{e._insertElement(t,Rt.HTML),e.framesetOk=!1,e.insertionMode=Ie.IN_BODY;break}case B.FRAMESET:{e._insertElement(t,Rt.HTML),e.insertionMode=Ie.IN_FRAMESET;break}case B.BASE:case B.BASEFONT:case B.BGSOUND:case B.LINK:case B.META:case B.NOFRAMES:case B.SCRIPT:case B.STYLE:case B.TEMPLATE:case B.TITLE:{e._err(t,dt.abandonedHeadElementChild),e.openElements.push(e.headElement,B.HEAD),Tf(e,t),e.openElements.remove(e.headElement);break}case B.HEAD:{e._err(t,dt.misplacedStartTagForHeadElement);break}default:hE(e,t)}}function ECt(e,t){switch(t.tagID){case B.BODY:case B.HTML:case B.BR:{hE(e,t);break}case B.TEMPLATE:{J0(e,t);break}default:e._err(t,dt.endTagWithoutMatchingOpenElement)}}function hE(e,t){e._insertFakeElement(Je.BODY,B.BODY),e.insertionMode=Ie.IN_BODY,AM(e,t)}function AM(e,t){switch(t.type){case $i.CHARACTER:{SMe(e,t);break}case $i.WHITESPACE_CHARACTER:{kMe(e,t);break}case $i.COMMENT:{JB(e,t);break}case $i.START_TAG:{Rl(e,t);break}case $i.END_TAG:{TM(e,t);break}case $i.EOF:{TMe(e,t);break}}}function kMe(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function SMe(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function CCt(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function ACt(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function TCt(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,Rt.HTML),e.insertionMode=Ie.IN_FRAMESET)}function _Ct(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,Rt.HTML)}function jCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&ZB.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,Rt.HTML)}function NCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,Rt.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function RCt(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,Rt.HTML),n||(e.formElement=e.openElements.current))}function ICt(e,t){e.framesetOk=!1;const n=t.tagID;for(let i=e.openElements.stackTop;i>=0;i--){const r=e.openElements.tagIDs[i];if(n===B.LI&&r===B.LI||(n===B.DD||n===B.DT)&&(r===B.DD||r===B.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==B.ADDRESS&&r!==B.DIV&&r!==B.P&&e._isSpecialElement(e.openElements.items[i],r))break}e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,Rt.HTML)}function PCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,Rt.HTML),e.tokenizer.state=Ea.PLAINTEXT}function DCt(e,t){e.openElements.hasInScope(B.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(B.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,Rt.HTML),e.framesetOk=!1}function MCt(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(Je.A);n&&(nq(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,Rt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function LCt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Rt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function $Ct(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(B.NOBR)&&(nq(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,Rt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function FCt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Rt.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function BCt(e,t){e.treeAdapter.getDocumentMode(e.document)!==id.QUIRKS&&e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,Rt.HTML),e.framesetOk=!1,e.insertionMode=Ie.IN_TABLE}function EMe(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Rt.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function CMe(e){const t=pMe(e,Yy.TYPE);return t!=null&&t.toLowerCase()===rCt}function UCt(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Rt.HTML),CMe(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function QCt(e,t){e._appendElement(t,Rt.HTML),t.ackSelfClosing=!0}function zCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._appendElement(t,Rt.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function VCt(e,t){t.tagName=Je.IMG,t.tagID=B.IMG,EMe(e,t)}function HCt(e,t){e._insertElement(t,Rt.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Ea.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=Ie.TEXT}function qCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Ea.RAWTEXT)}function WCt(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Ea.RAWTEXT)}function xne(e,t){e._switchToTextParsing(t,Ea.RAWTEXT)}function KCt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Rt.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===Ie.IN_TABLE||e.insertionMode===Ie.IN_CAPTION||e.insertionMode===Ie.IN_TABLE_BODY||e.insertionMode===Ie.IN_ROW||e.insertionMode===Ie.IN_CELL?Ie.IN_SELECT_IN_TABLE:Ie.IN_SELECT}function GCt(e,t){e.openElements.currentTagId===B.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,Rt.HTML)}function XCt(e,t){e.openElements.hasInScope(B.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,Rt.HTML)}function YCt(e,t){e.openElements.hasInScope(B.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(B.RTC),e._insertElement(t,Rt.HTML)}function ZCt(e,t){e._reconstructActiveFormattingElements(),xMe(t),tq(t),t.selfClosing?e._appendElement(t,Rt.MATHML):e._insertElement(t,Rt.MATHML),t.ackSelfClosing=!0}function JCt(e,t){e._reconstructActiveFormattingElements(),wMe(t),tq(t),t.selfClosing?e._appendElement(t,Rt.SVG):e._insertElement(t,Rt.SVG),t.ackSelfClosing=!0}function wne(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Rt.HTML)}function Rl(e,t){switch(t.tagID){case B.I:case B.S:case B.B:case B.U:case B.EM:case B.TT:case B.BIG:case B.CODE:case B.FONT:case B.SMALL:case B.STRIKE:case B.STRONG:{LCt(e,t);break}case B.A:{MCt(e,t);break}case B.H1:case B.H2:case B.H3:case B.H4:case B.H5:case B.H6:{jCt(e,t);break}case B.P:case B.DL:case B.OL:case B.UL:case B.DIV:case B.DIR:case B.NAV:case B.MAIN:case B.MENU:case B.ASIDE:case B.CENTER:case B.FIGURE:case B.FOOTER:case B.HEADER:case B.HGROUP:case B.DIALOG:case B.DETAILS:case B.ADDRESS:case B.ARTICLE:case B.SEARCH:case B.SECTION:case B.SUMMARY:case B.FIELDSET:case B.BLOCKQUOTE:case B.FIGCAPTION:{_Ct(e,t);break}case B.LI:case B.DD:case B.DT:{ICt(e,t);break}case B.BR:case B.IMG:case B.WBR:case B.AREA:case B.EMBED:case B.KEYGEN:{EMe(e,t);break}case B.HR:{zCt(e,t);break}case B.RB:case B.RTC:{XCt(e,t);break}case B.RT:case B.RP:{YCt(e,t);break}case B.PRE:case B.LISTING:{NCt(e,t);break}case B.XMP:{qCt(e,t);break}case B.SVG:{JCt(e,t);break}case B.HTML:{CCt(e,t);break}case B.BASE:case B.LINK:case B.META:case B.STYLE:case B.TITLE:case B.SCRIPT:case B.BGSOUND:case B.BASEFONT:case B.TEMPLATE:{Tf(e,t);break}case B.BODY:{ACt(e,t);break}case B.FORM:{RCt(e,t);break}case B.NOBR:{$Ct(e,t);break}case B.MATH:{ZCt(e,t);break}case B.TABLE:{BCt(e,t);break}case B.INPUT:{UCt(e,t);break}case B.PARAM:case B.TRACK:case B.SOURCE:{QCt(e,t);break}case B.IMAGE:{VCt(e,t);break}case B.BUTTON:{DCt(e,t);break}case B.APPLET:case B.OBJECT:case B.MARQUEE:{FCt(e,t);break}case B.IFRAME:{WCt(e,t);break}case B.SELECT:{KCt(e,t);break}case B.OPTION:case B.OPTGROUP:{GCt(e,t);break}case B.NOEMBED:case B.NOFRAMES:{xne(e,t);break}case B.FRAMESET:{TCt(e,t);break}case B.TEXTAREA:{HCt(e,t);break}case B.NOSCRIPT:{e.options.scriptingEnabled?xne(e,t):wne(e,t);break}case B.PLAINTEXT:{PCt(e,t);break}case B.COL:case B.TH:case B.TD:case B.TR:case B.HEAD:case B.FRAME:case B.TBODY:case B.TFOOT:case B.THEAD:case B.CAPTION:case B.COLGROUP:break;default:wne(e,t)}}function eAt(e,t){if(e.openElements.hasInScope(B.BODY)&&(e.insertionMode=Ie.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function tAt(e,t){e.openElements.hasInScope(B.BODY)&&(e.insertionMode=Ie.AFTER_BODY,MMe(e,t))}function nAt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function iAt(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(B.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(B.FORM):n&&e.openElements.remove(n))}function rAt(e){e.openElements.hasInButtonScope(B.P)||e._insertFakeElement(Je.P,B.P),e._closePElement()}function sAt(e){e.openElements.hasInListItemScope(B.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(B.LI),e.openElements.popUntilTagNamePopped(B.LI))}function aAt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function oAt(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function lAt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function cAt(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(Je.BR,B.BR),e.openElements.pop(),e.framesetOk=!1}function AMe(e,t){const n=t.tagName,i=t.tagID;for(let r=e.openElements.stackTop;r>0;r--){const s=e.openElements.items[r],o=e.openElements.tagIDs[r];if(i===o&&(i!==B.UNKNOWN||e.treeAdapter.getTagName(s)===n)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.stackTop>=r&&e.openElements.shortenToLength(r);break}if(e._isSpecialElement(s,o))break}}function TM(e,t){switch(t.tagID){case B.A:case B.B:case B.I:case B.S:case B.U:case B.EM:case B.TT:case B.BIG:case B.CODE:case B.FONT:case B.NOBR:case B.SMALL:case B.STRIKE:case B.STRONG:{nq(e,t);break}case B.P:{rAt(e);break}case B.DL:case B.UL:case B.OL:case B.DIR:case B.DIV:case B.NAV:case B.PRE:case B.MAIN:case B.MENU:case B.ASIDE:case B.BUTTON:case B.CENTER:case B.FIGURE:case B.FOOTER:case B.HEADER:case B.HGROUP:case B.DIALOG:case B.ADDRESS:case B.ARTICLE:case B.DETAILS:case B.SEARCH:case B.SECTION:case B.SUMMARY:case B.LISTING:case B.FIELDSET:case B.BLOCKQUOTE:case B.FIGCAPTION:{nAt(e,t);break}case B.LI:{sAt(e);break}case B.DD:case B.DT:{aAt(e,t);break}case B.H1:case B.H2:case B.H3:case B.H4:case B.H5:case B.H6:{oAt(e);break}case B.BR:{cAt(e);break}case B.BODY:{eAt(e,t);break}case B.HTML:{tAt(e,t);break}case B.FORM:{iAt(e);break}case B.APPLET:case B.OBJECT:case B.MARQUEE:{lAt(e,t);break}case B.TEMPLATE:{J0(e,t);break}default:AMe(e,t)}}function TMe(e,t){e.tmplInsertionModeStack.length>0?DMe(e,t):iq(e,t)}function uAt(e,t){var n;t.tagID===B.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function dAt(e,t){e._err(t,dt.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function j4(e,t){if(e.openElements.currentTagId!==void 0&&OMe.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=Ie.IN_TABLE_TEXT,t.type){case $i.CHARACTER:{jMe(e,t);break}case $i.WHITESPACE_CHARACTER:{_Me(e,t);break}}else gT(e,t)}function fAt(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,Rt.HTML),e.insertionMode=Ie.IN_CAPTION}function hAt(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Rt.HTML),e.insertionMode=Ie.IN_COLUMN_GROUP}function pAt(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Je.COLGROUP,B.COLGROUP),e.insertionMode=Ie.IN_COLUMN_GROUP,rq(e,t)}function mAt(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Rt.HTML),e.insertionMode=Ie.IN_TABLE_BODY}function gAt(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Je.TBODY,B.TBODY),e.insertionMode=Ie.IN_TABLE_BODY,_M(e,t)}function bAt(e,t){e.openElements.hasInTableScope(B.TABLE)&&(e.openElements.popUntilTagNamePopped(B.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function yAt(e,t){CMe(t)?e._appendElement(t,Rt.HTML):gT(e,t),t.ackSelfClosing=!0}function vAt(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,Rt.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function s1(e,t){switch(t.tagID){case B.TD:case B.TH:case B.TR:{gAt(e,t);break}case B.STYLE:case B.SCRIPT:case B.TEMPLATE:{Tf(e,t);break}case B.COL:{pAt(e,t);break}case B.FORM:{vAt(e,t);break}case B.TABLE:{bAt(e,t);break}case B.TBODY:case B.TFOOT:case B.THEAD:{mAt(e,t);break}case B.INPUT:{yAt(e,t);break}case B.CAPTION:{fAt(e,t);break}case B.COLGROUP:{hAt(e,t);break}default:gT(e,t)}}function CC(e,t){switch(t.tagID){case B.TABLE:{e.openElements.hasInTableScope(B.TABLE)&&(e.openElements.popUntilTagNamePopped(B.TABLE),e._resetInsertionMode());break}case B.TEMPLATE:{J0(e,t);break}case B.BODY:case B.CAPTION:case B.COL:case B.COLGROUP:case B.HTML:case B.TBODY:case B.TD:case B.TFOOT:case B.TH:case B.THEAD:case B.TR:break;default:gT(e,t)}}function gT(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,AM(e,t),e.fosterParentingEnabled=n}function _Me(e,t){e.pendingCharacterTokens.push(t)}function jMe(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function vk(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n0&&e.openElements.currentTagId===B.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===B.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===B.OPTGROUP&&e.openElements.pop();break}case B.OPTION:{e.openElements.currentTagId===B.OPTION&&e.openElements.pop();break}case B.SELECT:{e.openElements.hasInSelectScope(B.SELECT)&&(e.openElements.popUntilTagNamePopped(B.SELECT),e._resetInsertionMode());break}case B.TEMPLATE:{J0(e,t);break}}}function EAt(e,t){const n=t.tagID;n===B.CAPTION||n===B.TABLE||n===B.TBODY||n===B.TFOOT||n===B.THEAD||n===B.TR||n===B.TD||n===B.TH?(e.openElements.popUntilTagNamePopped(B.SELECT),e._resetInsertionMode(),e._processStartTag(t)):IMe(e,t)}function CAt(e,t){const n=t.tagID;n===B.CAPTION||n===B.TABLE||n===B.TBODY||n===B.TFOOT||n===B.THEAD||n===B.TR||n===B.TD||n===B.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(B.SELECT),e._resetInsertionMode(),e.onEndTag(t)):PMe(e,t)}function AAt(e,t){switch(t.tagID){case B.BASE:case B.BASEFONT:case B.BGSOUND:case B.LINK:case B.META:case B.NOFRAMES:case B.SCRIPT:case B.STYLE:case B.TEMPLATE:case B.TITLE:{Tf(e,t);break}case B.CAPTION:case B.COLGROUP:case B.TBODY:case B.TFOOT:case B.THEAD:{e.tmplInsertionModeStack[0]=Ie.IN_TABLE,e.insertionMode=Ie.IN_TABLE,s1(e,t);break}case B.COL:{e.tmplInsertionModeStack[0]=Ie.IN_COLUMN_GROUP,e.insertionMode=Ie.IN_COLUMN_GROUP,rq(e,t);break}case B.TR:{e.tmplInsertionModeStack[0]=Ie.IN_TABLE_BODY,e.insertionMode=Ie.IN_TABLE_BODY,_M(e,t);break}case B.TD:case B.TH:{e.tmplInsertionModeStack[0]=Ie.IN_ROW,e.insertionMode=Ie.IN_ROW,jM(e,t);break}default:e.tmplInsertionModeStack[0]=Ie.IN_BODY,e.insertionMode=Ie.IN_BODY,Rl(e,t)}}function TAt(e,t){t.tagID===B.TEMPLATE&&J0(e,t)}function DMe(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(B.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):iq(e,t)}function _At(e,t){t.tagID===B.HTML?Rl(e,t):jI(e,t)}function MMe(e,t){var n;if(t.tagID===B.HTML){if(e.fragmentContext||(e.insertionMode=Ie.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===B.HTML){e._setEndLocation(e.openElements.items[0],t);const i=e.openElements.items[1];i&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(i))===null||n===void 0)&&n.endTag)&&e._setEndLocation(i,t)}}else jI(e,t)}function jI(e,t){e.insertionMode=Ie.IN_BODY,AM(e,t)}function jAt(e,t){switch(t.tagID){case B.HTML:{Rl(e,t);break}case B.FRAMESET:{e._insertElement(t,Rt.HTML);break}case B.FRAME:{e._appendElement(t,Rt.HTML),t.ackSelfClosing=!0;break}case B.NOFRAMES:{Tf(e,t);break}}}function NAt(e,t){t.tagID===B.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==B.FRAMESET&&(e.insertionMode=Ie.AFTER_FRAMESET))}function RAt(e,t){switch(t.tagID){case B.HTML:{Rl(e,t);break}case B.NOFRAMES:{Tf(e,t);break}}}function IAt(e,t){t.tagID===B.HTML&&(e.insertionMode=Ie.AFTER_AFTER_FRAMESET)}function PAt(e,t){t.tagID===B.HTML?Rl(e,t):NN(e,t)}function NN(e,t){e.insertionMode=Ie.IN_BODY,AM(e,t)}function DAt(e,t){switch(t.tagID){case B.HTML:{Rl(e,t);break}case B.NOFRAMES:{Tf(e,t);break}}}function MAt(e,t){t.chars=Fs,e._insertCharacters(t)}function LAt(e,t){e._insertCharacters(t),e.framesetOk=!1}function LMe(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==Rt.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function $At(e,t){if(JEt(t))LMe(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),i=e.treeAdapter.getNamespaceURI(n);i===Rt.MATHML?xMe(t):i===Rt.SVG&&(eCt(t),wMe(t)),tq(t),t.selfClosing?e._appendElement(t,i):e._insertElement(t,i),t.ackSelfClosing=!0}}function FAt(e,t){if(t.tagID===B.P||t.tagID===B.BR){LMe(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const i=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(i)===Rt.HTML){e._endTagOutsideForeignContent(t);break}const r=e.treeAdapter.getTagName(i);if(r.toLowerCase()===t.tagName){t.tagName=r,e.openElements.shortenToLength(n);break}}}Je.AREA,Je.BASE,Je.BASEFONT,Je.BGSOUND,Je.BR,Je.COL,Je.EMBED,Je.FRAME,Je.HR,Je.IMG,Je.INPUT,Je.KEYGEN,Je.LINK,Je.META,Je.PARAM,Je.SOURCE,Je.TRACK,Je.WBR;const BAt=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,UAt=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),One={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function $Me(e,t){const n=YAt(e),i=YPe("type",{handlers:{root:QAt,element:zAt,text:VAt,comment:BMe,doctype:HAt,raw:WAt},unknown:KAt}),r={parser:n?new vne(One):vne.getFragmentParser(void 0,One),handle(l){i(l,r)},stitches:!1,options:t||{}};i(e,r),sO(r,jh());const s=n?r.parser.document:r.parser.getFragment(),o=ZSt(s,{file:r.options.file});return r.stitches&&pT(o,"comment",function(l,c,u){const d=l;if(d.value.stitch&&u&&c!==void 0){const f=u.children;return f[c]=d.value.stitch,c}}),o.type==="root"&&o.children.length===1&&o.children[0].type===e.type?o.children[0]:o}function FMe(e,t){let n=-1;if(e)for(;++n4&&(t.parser.tokenizer.state=0);const n={type:$i.CHARACTER,chars:e.value,location:bT(e)};sO(t,jh(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function HAt(e,t){const n={type:$i.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:bT(e)};sO(t,jh(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function qAt(e,t){t.stitches=!0;const n=ZAt(e);if("children"in e&&"children"in n){const i=$Me({type:"root",children:e.children},t.options);n.children=i.children}BMe({type:"comment",value:{stitch:n}},t)}function BMe(e,t){const n=e.value,i={type:$i.COMMENT,data:n,location:bT(e)};sO(t,jh(e)),t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken)}function WAt(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,UMe(t,jh(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(BAt,"<$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function KAt(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))qAt(n,t);else{let i="";throw UAt.has(n.type)&&(i=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+i)}}function sO(e,t){UMe(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=Ea.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function UMe(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function GAt(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Ea.PLAINTEXT)return;sO(t,jh(e));const i=t.parser.openElements.current;let r="namespaceURI"in i?i.namespaceURI:Ny.html;r===Ny.html&&n==="svg"&&(r=Ny.svg);const s=iEt({...e,children:[]},{space:r===Ny.svg?"svg":"html"}),o={type:$i.START_TAG,tagName:n,tagID:rO(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in s?s.attrs:[],location:bT(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function XAt(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&dEt.includes(n)||t.parser.tokenizer.state===Ea.PLAINTEXT)return;sO(t,xM(e));const i={type:$i.END_TAG,tagName:n,tagID:rO(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:bT(e)};t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Ea.RCDATA||t.parser.tokenizer.state===Ea.RAWTEXT||t.parser.tokenizer.state===Ea.SCRIPT_DATA)&&(t.parser.tokenizer.state=Ea.DATA)}function YAt(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function bT(e){const t=jh(e)||{line:void 0,column:void 0,offset:void 0},n=xM(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function ZAt(e){return"children"in e?i1({...e,children:[]}):i1(e)}function JAt(e){return function(t,n){return $Me(t,{...e,file:n})}}const eTt="modulepreload",tTt=function(e){return"/"+e},kne={},Zs=function(t,n,i){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));r=Promise.allSettled(n.map(c=>{if(c=tTt(c),c in kne)return;kne[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":eTt,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((h,m)=>{f.addEventListener("load",h),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return r.then(o=>{for(const l of o||[])l.status==="rejected"&&s(l.reason);return t().catch(s)})};var nTt=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,iTt=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,rTt=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,N4={Space_Separator:nTt,ID_Start:iTt,ID_Continue:rTt},va={isSpaceSeparator(e){return typeof e=="string"&&N4.Space_Separator.test(e)},isIdStartChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="$"||e==="_"||N4.ID_Start.test(e))},isIdContinueChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||e==="$"||e==="_"||e==="‌"||e==="‍"||N4.ID_Continue.test(e))},isDigit(e){return typeof e=="string"&&/[0-9]/.test(e)},isHexDigit(e){return typeof e=="string"&&/[0-9A-Fa-f]/.test(e)}};let t9,ec,vp,NI,cb,mf,ko,sq,pE;var sTt=function(t,n){t9=String(t),ec="start",vp=[],NI=0,cb=1,mf=0,ko=void 0,sq=void 0,pE=void 0;do ko=aTt(),cTt[ec]();while(ko.type!=="eof");return typeof n=="function"?n9({"":pE},"",n):pE};function n9(e,t,n){const i=e[t];if(i!=null&&typeof i=="object")if(Array.isArray(i))for(let r=0;r0;){const n=$p();if(!va.isHexDigit(n))throw As(Tt());e+=Tt()}return String.fromCodePoint(parseInt(e,16))}const cTt={start(){if(ko.type==="eof")throw Jb();R4()},beforePropertyName(){switch(ko.type){case"identifier":case"string":sq=ko.value,ec="afterPropertyName";return;case"punctuator":__();return;case"eof":throw Jb()}},afterPropertyName(){if(ko.type==="eof")throw Jb();ec="beforePropertyValue"},beforePropertyValue(){if(ko.type==="eof")throw Jb();R4()},beforeArrayValue(){if(ko.type==="eof")throw Jb();if(ko.type==="punctuator"&&ko.value==="]"){__();return}R4()},afterPropertyValue(){if(ko.type==="eof")throw Jb();switch(ko.value){case",":ec="beforePropertyName";return;case"}":__()}},afterArrayValue(){if(ko.type==="eof")throw Jb();switch(ko.value){case",":ec="beforeArrayValue";return;case"]":__()}},end(){}};function R4(){let e;switch(ko.type){case"punctuator":switch(ko.value){case"{":e={};break;case"[":e=[];break}break;case"null":case"boolean":case"numeric":case"string":e=ko.value;break}if(pE===void 0)pE=e;else{const t=vp[vp.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,sq,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(e!==null&&typeof e=="object")vp.push(e),Array.isArray(e)?ec="beforeArrayValue":ec="beforePropertyName";else{const t=vp[vp.length-1];t==null?ec="end":Array.isArray(t)?ec="afterArrayValue":ec="afterPropertyValue"}}function __(){vp.pop();const e=vp[vp.length-1];e==null?ec="end":Array.isArray(e)?ec="afterArrayValue":ec="afterPropertyValue"}function As(e){return RI(e===void 0?`JSON5: invalid end of input at ${cb}:${mf}`:`JSON5: invalid character '${zMe(e)}' at ${cb}:${mf}`)}function Jb(){return RI(`JSON5: invalid end of input at ${cb}:${mf}`)}function Sne(){return mf-=5,RI(`JSON5: invalid identifier character at ${cb}:${mf}`)}function uTt(e){console.warn(`JSON5: '${zMe(e)}' in strings is not valid ECMAScript; consider escaping`)}function zMe(e){const t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(t[e])return t[e];if(e<" "){const n=e.charCodeAt(0).toString(16);return"\\x"+("00"+n).substring(n.length)}return e}function RI(e){const t=new SyntaxError(e);return t.lineNumber=cb,t.columnNumber=mf,t}var dTt=function(t,n,i){const r=[];let s="",o,l,c="",u;if(n!=null&&typeof n=="object"&&!Array.isArray(n)&&(i=n.space,u=n.quote,n=n.replacer),typeof n=="function")l=n;else if(Array.isArray(n)){o=[];for(const b of n){let v;typeof b=="string"?v=b:(typeof b=="number"||b instanceof String||b instanceof Number)&&(v=String(b)),v!==void 0&&o.indexOf(v)<0&&o.push(v)}}return i instanceof Number?i=Number(i):i instanceof String&&(i=String(i)),typeof i=="number"?i>0&&(i=Math.min(10,Math.floor(i)),c=" ".substr(0,i)):typeof i=="string"&&(c=i.substr(0,10)),d("",{"":t});function d(b,v){let y=v[b];switch(y!=null&&(typeof y.toJSON5=="function"?y=y.toJSON5(b):typeof y.toJSON=="function"&&(y=y.toJSON(b))),l&&(y=l.call(v,b,y)),y instanceof Number?y=Number(y):y instanceof String?y=String(y):y instanceof Boolean&&(y=y.valueOf()),y){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof y=="string")return f(y);if(typeof y=="number")return String(y);if(typeof y=="object")return Array.isArray(y)?g(y):h(y)}function f(b){const v={"'":.1,'"':.2},y={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let w="";for(let O=0;Ov[O]=0)throw TypeError("Converting circular structure to JSON5");r.push(b);let v=s;s=s+c;let y=o||Object.keys(b),w=[];for(const O of y){const k=d(O,b);if(k!==void 0){let S=m(O)+":";c!==""&&(S+=" "),S+=k,w.push(S)}}let x;if(w.length===0)x="{}";else{let O;if(c==="")O=w.join(","),x="{"+O+"}";else{let k=`, `+s;O=w.join(k),x=`{ `+s+O+`, -`+v+"}"}}return r.pop(),s=v,x}function m(b){if(b.length===0)return f(b);const v=String.fromCodePoint(b.codePointAt(0));if(!wa.isIdStartChar(v))return f(b);for(let y=v.length;y=0)throw TypeError("Converting circular structure to JSON5");r.push(b);let v=s;s=s+c;let y=[];for(let x=0;x=0)throw TypeError("Converting circular structure to JSON5");r.push(b);let v=s;s=s+c;let y=[];for(let x=0;x30)throw new Error("ECharts option nesting is too deep");if(typeof e=="number"&&!Number.isFinite(e))throw new Error("ECharts option contains a non-finite number");if(typeof e=="string"&&mTt.test(e.trim()))throw new Error("ECharts option contains an external resource");if(Array.isArray(e)){for(const n of e)RI(n,t+1);return}if(cS(e))for(const[n,i]of Object.entries(e)){if(pTt.has(n))throw new Error("ECharts option contains an unsafe key");RI(i,t+1)}}function gTt(e){var i;const t=e.trim(),n=t.match(/^(?:(?:const|let|var)\s+)?option\s*=\s*([\s\S]*?)\s*;?$/);return((i=n==null?void 0:n[1])==null?void 0:i.trim())||t}function bTt(e,t){let n=1,i="",r=!1,s=!1,o=!1;for(let l=t+1;li+2)throw new Error("Invalid ECharts gradient argument count");const r=n.slice(0,i).map(yTt),s=n[i],o=n[i+1]??!1;if(!Array.isArray(s)||typeof o!="boolean")throw new Error("Invalid ECharts gradient data");return e==="linear"?{type:e,x:r[0],y:r[1],x2:r[2],y2:r[3],colorStops:s,global:o}:{type:e,x:r[0],y:r[1],r:r[2],colorStops:s,global:o}}function xTt(e,t){const n=/^(?:new\s+)?echarts\.graphic\.(LinearGradient|RadialGradient)\s*\(/;let i="",r=!1,s=!1,o=!1;for(let l=t;lhTt)throw new Error("ECharts option is too large");const n=wTt(gTt(e));let i;try{i=VMe.parse(n)}catch(o){throw/\bfunction\s*\(|=>/.test(n)?new Error("ECharts function callbacks are not supported"):o}if(!cS(i))throw new Error("ECharts option must be a data object");RI(i);const r={...i};r.aria={...cS(r.aria)?r.aria:{},enabled:!0};const s=r.tooltip;return cS(s)?r.tooltip={...s,renderMode:"richText"}:Array.isArray(s)&&(r.tooltip=s.map(o=>cS(o)?{...o,renderMode:"richText"}:o)),t&&(r.animation=!1),r}let I4;function OTt(){return I4??(I4=Js(()=>import("../visualizations/echarts/index-CGT341lL.js"),[]).catch(e=>{throw I4=void 0,e})),I4}function kTt({source:e}){const{t}=Te("conversation"),n=p.useRef(null),[i,r]=p.useState(!1),[s,o]=p.useState("");return p.useEffect(()=>{let l=!1,c,u,d;r(!1);try{d=HMe(e,window.matchMedia("(prefers-reduced-motion: reduce)").matches),o("")}catch{o("invalid");return}return OTt().then(f=>{const h=n.current;l||!h||(c=f.init(h,void 0,{renderer:"svg"}),c.setOption(d,{notMerge:!0}),typeof ResizeObserver<"u"&&(u=new ResizeObserver(()=>c==null?void 0:c.resize()),u.observe(h)),r(!0))}).catch(()=>{c==null||c.dispose(),c=void 0,l||o("render")}),()=>{l=!0,u==null||u.disconnect(),c==null||c.dispose()}},[e]),a.jsxs("div",{className:`echarts-diagram${s?" echarts-diagram--error":""}`,role:"img","aria-label":t("visualization.echartsAria"),"aria-busy":!i&&!s,children:[a.jsx("div",{ref:n,className:"echarts-diagram__canvas",hidden:!!s}),!i&&!s?a.jsx("div",{className:"echarts-diagram__state","aria-live":"polite",children:a.jsx(hn,{duration:2.2,spread:15,children:t("visualization.rendering")})}):null,s?a.jsx("p",{className:"echarts-diagram__error",role:"alert",children:t(s==="invalid"?"visualization.invalidEcharts":"visualization.renderFailed")}):null]})}const STt=p.memo(kTt);let Ene,Cne=Promise.resolve(),ETt=0;function CTt(){return Ene??(Ene=Js(async()=>{const{default:e}=await import("../visualizations/mermaid/mermaid.core-DAx4nvmm.js").then(t=>t.ay);return{default:e}},__vite__mapDeps([0,1])).then(({default:e})=>(e.initialize({startOnLoad:!1,securityLevel:"strict",suppressErrorRendering:!0,theme:"neutral"}),e))),Ene}function ATt(e){const t=Cne.then(async()=>{const n=await CTt(),i=`mermaid-diagram-${ETt+=1}`;return n.render(i,e)});return Cne=t.then(()=>{},()=>{}),t}function TTt({source:e}){const{t}=Te("conversation"),n=p.useRef(null),[i,r]=p.useState(null),[s,o]=p.useState(!1);return p.useEffect(()=>{let l=!1;return r(null),o(!1),ATt(e).then(c=>{l||r(c)}).catch(()=>{l||o(!0)}),()=>{l=!0}},[e]),p.useEffect(()=>{!(i!=null&&i.bindFunctions)||!n.current||i.bindFunctions(n.current)},[i]),s?a.jsx("div",{className:"mermaid-diagram mermaid-diagram--error",children:a.jsx("p",{className:"mermaid-diagram__error",role:"alert",children:t("visualization.mermaidFailed")})}):i?a.jsx("div",{ref:n,className:"mermaid-diagram",role:"img","aria-label":t("visualization.mermaidAria"),dangerouslySetInnerHTML:{__html:i.svg}}):a.jsx("div",{className:"mermaid-diagram mermaid-diagram--loading","aria-live":"polite",children:a.jsx(hn,{duration:2.2,spread:15,children:t("visualization.rendering")})})}const _Tt=p.memo(TTt),jTt="_SegmentedControl_1sl7d_1",NTt="_SegmentedControlOption_1sl7d_140",RTt="_SegmentedControlThumb_1sl7d_219",r9={SegmentedControl:jTt,SegmentedControlOption:NTt,SegmentedControlThumb:RTt},cd=({value:e,onChange:t,children:n,block:i,pill:r=!0,size:s="md",gutterSize:o,className:l,onClick:c,...u})=>{const d=p.useRef(null),f=p.useRef(null),h=p.useCallback(g=>{const b=d.current,v=f.current;if(!b||!v)return;const y=b==null?void 0:b.querySelector('[data-state="on"]');if(!y)return;const w=b.clientWidth;let x=Math.floor(y.clientWidth);const O=y.offsetLeft;if(w-(x+O)<2&&(x=x-1),v.style.width=`${Math.floor(x)}px`,v.style.transform=`translateX(${O}px)`,b.scrollWidth>w){const k=w*.15,S=b.scrollLeft,C=y.offsetLeft,E=C+x;(CS+w-k)&&g&&y.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"})}},[]);nNe({ref:d,onResize:()=>{const g=f.current;if(!g)return;const b=g.style.transition;g.style.transition="",h(!1),g.style.transition=b}}),p.useLayoutEffect(()=>{const g=d.current,b=f.current;!g||!b||(h(!!b.style.transition),b.style.transition||hI(()=>{b.style.transition="width 300ms var(--cubic-enter), transform 300ms var(--cubic-enter)"}))},[h,e,s,o,r]);const m=g=>{g&&t&&t(g)};return a.jsxs(xft,{ref:d,className:Qi(r9.SegmentedControl,l),type:"single",value:e,loop:!1,onValueChange:m,onClick:c,"data-block":i?"":void 0,"data-pill":r?"":void 0,"data-size":s,"data-gutter-size":o,...u,children:[a.jsx("div",{className:r9.SegmentedControlThumb,ref:f}),n]})},ITt=({children:e,...t})=>a.jsx(Eft,{className:r9.SegmentedControlOption,...t,onPointerEnter:kV,children:a.jsx("span",{className:"relative",children:e})});cd.Option=ITt;function PTt({children:e,label:t,language:n,source:i,streaming:r=!1}){const{t:s}=Te("conversation"),[o,l]=p.useState("preview"),c=r?"code":o;return a.jsxs("section",{className:"visualization-card","aria-label":s("visualization.cardAria",{label:t}),children:[a.jsx("div",{className:"visualization-card__toolbar",children:a.jsxs(cd,{className:"visualization-card__tabs",value:c,size:"sm",gutterSize:"sm",pill:!1,"aria-label":s("visualization.viewAria",{label:t}),onChange:u=>{r||l(u)},children:[a.jsx(cd.Option,{value:"preview",disabled:r,children:s("visualization.preview")}),a.jsx(cd.Option,{value:"code",children:s("visualization.code")})]})}),a.jsx("div",{className:"visualization-card__body",children:c==="code"?a.jsx("pre",{className:"visualization-card__code",children:a.jsx("code",{className:`language-${n}`,children:i})}):e})]})}const DTt=p.memo(PTt);function qMe(e){const t=e==null?void 0:e.trim().toLowerCase();if(t==="mermaid")return"mermaid";if(t==="echart"||t==="echarts")return"echarts"}const WMe=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function s9(e){return typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(s9).join(""):p.isValidElement(e)?s9(e.props.children):""}function MTt(e){var i;const t=p.Children.toArray(e)[0];if(!p.isValidElement(t))return;const n=(i=t.props.className)==null?void 0:i.split(/\s+/).find(r=>r.startsWith("language-"));return qMe(n==null?void 0:n.slice(9))}function KMe(e){if(!e)return!1;try{const t=e.toLowerCase();return WMe.some(n=>t.includes(n))}catch{return!1}}function LTt(e){var i;const t=(i=e==null?void 0:e.properties)==null?void 0:i.href;if(!t)return!1;if(KMe(t))return!0;const n=e==null?void 0:e.children;if(n&&Array.isArray(n)){const r=n.map(s=>(s==null?void 0:s.value)||"").join("").toLowerCase();return WMe.some(s=>r.includes(s))}return!1}function $Tt({text:e,className:t,allowRawHtml:n=!0,streaming:i=!1}){const{t:r}=Te("conversation"),s=p.useContext(Aje),[o,l]=p.useState(null),c=(f,h)=>{if(f.src)return f.src;if(h){const m=b=>{var v;if(!b)return null;if(b.type==="source"&&((v=b.properties)!=null&&v.src))return b.properties.src;if(b.children)for(const y of b.children){const w=m(y);if(w)return w}return null},g=m({children:h});if(g)return g}return""},u=f=>{try{const m=new URL(f).pathname.split("/");return m[m.length-1]||"video.mp4"}catch{return"video.mp4"}},d=f=>f?Array.isArray(f)?f.map(h=>(h==null?void 0:h.value)||"").join("")||"video":(f==null?void 0:f.value)||"video":"video";return a.jsxs("div",{className:t?`md ${t}`:"md",children:[a.jsx(qPe,{disallowedElements:s?["file-card","personal-drive-enable-card"]:void 0,remarkPlugins:[bDe],rehypePlugins:n?[JAt,sne]:[sne],components:{pre:({node:f,children:h,...m})=>{const g=MTt(h);if(g==="mermaid"||g==="echarts"){const b=s9(h).replace(/\n$/,"");return a.jsx(DTt,{label:g==="mermaid"?"Mermaid":"ECharts",language:g,source:b,streaming:i,children:g==="mermaid"?a.jsx(_Tt,{source:b}):a.jsx(STt,{source:b})})}return a.jsx("pre",{...m,children:h})},a:({node:f,...h})=>{const m=h.href,g=s&&zst(m);if(g)return a.jsx(Vst,{...s,path:g,children:h.children});if(m&&(KMe(m)||LTt(f))){const b=m,v=d(f==null?void 0:f.children);return a.jsxs("div",{className:"video-container",children:[a.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":r("markdown.playVideo",{name:v}),onClick:()=>l({src:b,title:v}),children:[a.jsx("video",{src:b,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),a.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:a.jsx(ZS,{})})]}),a.jsx("div",{className:"video-caption",children:a.jsx("a",{href:b,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:v})})]})}return a.jsx("a",{...h,target:"_blank",rel:"noopener noreferrer"})},img:({node:f,src:h,alt:m,...g})=>{const b=a.jsx("img",{...g,src:h,alt:m??"",loading:"lazy"});return h?a.jsx(MAe,{src:h,children:a.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":r("markdown.enlargeImage",{name:m||r("markdown.image")}),children:[b,a.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:a.jsx(ZS,{})})]})}):b},video:({node:f,src:h,children:m,...g})=>{const b=c({src:h},m);return b?a.jsx("div",{className:"video-container",children:a.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":r("markdown.enlargeVideo"),onClick:()=>l({src:b}),children:[a.jsx("video",{src:b,...g,playsInline:!0,className:"video-thumbnail",children:m}),a.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:a.jsx(ZS,{})})]})}):a.jsx("video",{src:h,controls:!0,playsInline:!0,className:"video-inline",...g,children:m})}},children:e}),o&&a.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":r("markdown.videoPreview"),onClick:()=>l(null),children:a.jsxs("div",{className:"video-viewer",onClick:f=>f.stopPropagation(),children:[a.jsxs("div",{className:"video-viewer-header",children:[a.jsx("div",{className:"video-viewer-title",children:o.title||u(o.src)}),a.jsxs("nav",{className:"video-viewer-nav",children:[a.jsx("a",{href:o.src,download:o.title||u(o.src),"aria-label":r("markdown.downloadVideo"),title:r("markdown.downloadVideo"),className:"video-viewer-download",children:a.jsx(eM,{})}),a.jsx("button",{type:"button",className:"video-viewer-close","aria-label":r("markdown.close"),onClick:()=>l(null),children:a.jsx(Mo,{})})]})]}),a.jsx("div",{className:"video-viewer-body",children:a.jsx("video",{src:o.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const _d=p.memo($Tt);function P4(e){return(e==null?void 0:e.trim())||_b("resourceMetadata.unknownSource")}function GMe(e){return(e==null?void 0:e.trim())||_b("resourceMetadata.unknownCreator")}function FTt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5 5.5A2.5 2.5 0 0 1 7.5 3H19v16H7.5A2.5 2.5 0 0 0 5 21.5v-16Z"}),a.jsx("path",{d:"M5 18.5A2.5 2.5 0 0 1 7.5 16H19"}),a.jsx("path",{d:"M9 7h6M9 10h4"})]})}function BTt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3h8l4 4v14H6V3Z"}),a.jsx("path",{d:"M14 3v5h5M9 12h6M9 16h6"})]})}function UTt(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m7 7 10 10M17 7 7 17"})})}function QTt(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 5v14M5 12h14"})})}function hT({title:e,children:t,onClose:n,busy:i=!1,className:r=""}){const{t:s}=Te("ui"),o=p.useId(),l=p.useRef(null),c=p.useRef(null),u=p.useRef(i),d=p.useRef(n);return p.useEffect(()=>{u.current=i,d.current=n},[i,n]),p.useEffect(()=>{var g;const f=document.activeElement instanceof HTMLElement?document.activeElement:null,h=document.body.style.overflow;document.body.style.overflow="hidden",(g=l.current)==null||g.focus();const m=b=>{if(b.key==="Escape"&&!u.current){d.current();return}if(b.key!=="Tab")return;const v=c.current;if(!v)return;const y=Array.from(v.querySelectorAll('button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), a[href], audio[controls], video[controls], iframe, [tabindex]:not([tabindex="-1"])')).filter(O=>O.getClientRects().length>0);if(y.length===0){b.preventDefault();return}const w=y[0],x=y[y.length-1];b.shiftKey&&(document.activeElement===w||!v.contains(document.activeElement))?(b.preventDefault(),x.focus()):!b.shiftKey&&(document.activeElement===x||!v.contains(document.activeElement))&&(b.preventDefault(),w.focus())};return window.addEventListener("keydown",m),()=>{window.removeEventListener("keydown",m),document.body.style.overflow=h,f!=null&&f.isConnected&&f.focus()}},[]),vi.createPortal(a.jsx("div",{className:"knowledge-dialog-backdrop",onMouseDown:f=>{f.target===f.currentTarget&&!i&&n()},children:a.jsxs("section",{ref:c,className:`knowledge-dialog${r?` ${r}`:""}`,role:"dialog","aria-modal":"true","aria-labelledby":o,"aria-busy":i||void 0,children:[a.jsxs("header",{className:"knowledge-dialog__header",children:[a.jsx("h2",{id:o,children:e}),a.jsx("button",{ref:l,type:"button",onClick:n,disabled:i,"aria-label":s("common.close"),children:a.jsx(UTt,{})})]}),t]})}),document.body)}function OC({message:e}){return e?a.jsx("div",{className:"knowledge-form-error",role:"alert",children:e}):null}function a9(e){return e instanceof DOMException&&e.name==="AbortError"}function zTt(e,t){if(!e)return"";const n=Date.parse(e);return Number.isFinite(n)?new Intl.DateTimeFormat(t,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(n):e}const XMe=[".jpg",".jpeg",".png"].join(","),VTt=new Set(XMe.split(",")),YMe=[".pdf",".pptx",".docx",".xlsx",".txt"].join(","),HTt=new Set(YMe.split(",")),qTt=200*1024*1024;function o9(e){const t=e.lastIndexOf(".");return t<0?"":e.slice(t).toLocaleLowerCase()}function WTt(e,t,n){return e.size>qTt?n("knowledge.errors.fileTooLarge"):t==="image"?VTt.has(o9(e.name))?"":n("knowledge.errors.invalidImageType"):HTt.has(o9(e.name))?"":n("knowledge.errors.invalidDocumentType")}function aq(e){return e<=0?"-":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function l9(e){var r;const t=e.type.trim().replace(/^\./,"");if(t)return t.toUpperCase();const n=e.name.trim(),i=n.includes(".")?(r=n.split(".").pop())==null?void 0:r.trim():"";return i?i.toUpperCase():"-"}function KTt({region:e,onClose:t,onCreated:n}){const{t:i}=Te("ui"),[r,s]=p.useState(""),[o,l]=p.useState(""),[c,u]=p.useState(!1),[d,f]=p.useState(!1),[h,m]=p.useState(""),g=r.trim(),b=!!(g&&!/^[A-Za-z][A-Za-z0-9_]{0,47}$/.test(g)),v=async y=>{if(y.preventDefault(),u(!0),!g||b)return;f(!0),m("");const w={name:g,description:o.trim()||void 0,region:e};try{n(await jbt(w))}catch(x){m(Al(x,i("knowledge.errors.createBase")))}finally{f(!1)}};return a.jsx(hT,{title:i("knowledge.createBase"),onClose:t,busy:d,children:a.jsxs("form",{onSubmit:y=>void v(y),children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:i("common.name")}),a.jsx("input",{autoFocus:!0,value:r,maxLength:48,"aria-invalid":c&&b||void 0,"aria-describedby":"knowledge-name-help",onBlur:()=>u(!0),onChange:y=>s(y.target.value)})]}),a.jsx("p",{id:"knowledge-name-help",className:`knowledge-dialog__note${c&&b?" is-error":""}`,role:c&&b?"alert":void 0,children:i(c&&b?"knowledge.invalidName":"knowledge.nameHelp")}),a.jsxs("label",{children:[a.jsx("span",{children:i("knowledge.optionalDescription")}),a.jsx("textarea",{value:o,maxLength:80,onChange:y=>l(y.target.value)})]}),a.jsx(OC,{message:h})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:t,disabled:d,children:i("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:d||!g||b,children:i(d?"common.creating":"common.create")})]})]})})}function GTt({item:e,onClose:t,onUpdated:n}){const{t:i}=Te("ui"),[r,s]=p.useState(e.description),[o,l]=p.useState(!1),[c,u]=p.useState(""),d=async f=>{f.preventDefault(),l(!0),u("");try{n(await Nbt(e.id,e.region,{description:r.trim()}))}catch(h){u(Al(h,i("knowledge.errors.updateBase")))}finally{l(!1)}};return a.jsx(hT,{title:i("knowledge.editBase"),onClose:t,busy:o,children:a.jsxs("form",{onSubmit:f=>void d(f),children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:i("common.name")}),a.jsx("input",{value:e.name,disabled:!0})]}),a.jsxs("label",{children:[a.jsx("span",{children:i("common.description")}),a.jsx("textarea",{autoFocus:!0,value:r,maxLength:80,onChange:f=>s(f.target.value)})]}),a.jsx("p",{className:"knowledge-dialog__note",children:i("knowledge.descriptionOnly")}),a.jsx(OC,{message:c})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:t,disabled:o,children:i("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:o,children:i(o?"common.saving":"common.save")})]})]})})}function ZMe(e,t){if(!e.trim())return{};const n=JSON.parse(e);if(!n||Array.isArray(n)||typeof n!="object")throw new Error(t);return n}function XTt({base:e,onClose:t,onCreated:n,onAssociationInvalid:i}){const{t:r}=Te("ui"),[s,o]=p.useState("document"),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(""),[m,g]=p.useState(null),[b,v]=p.useState(!1),[y,w]=p.useState("{}"),[x,O]=p.useState(""),[k,S]=p.useState(""),[C,E]=p.useState(null),j=p.useRef(null),T=p.useRef(null),R=p.useRef(null),A=p.useRef(0),N=!!x;p.useEffect(()=>{var L;C&&!N&&((L=R.current)==null||L.focus())},[N,C]);const P=L=>{N||L===s||(o(L),g(null),h(""),c(""),d(""),S(""),E(null),v(!1),A.current=0,j.current&&(j.current.value=""))},I=L=>{if(!L||s==="web")return;const F=WTt(L,s,r);if(F){g(null),c(""),d(""),S(F);return}g(L),S(""),c(L.name.replace(/\.[^.]+$/,"")),d(o9(L.name).slice(1))},D=async L=>{if(L.preventDefault(),s==="web"?!f.trim():!m)return;let F;try{F=ZMe(y,r("knowledge.errors.metadataObject"))}catch(M){S(Al(M,r("knowledge.errors.metadataFormat")));return}O(s==="web"?C?"save":"preview":"upload"),S("");try{if(s==="web")if(C){const M={sourceType:"url",metadata:C.metadata,url:C.preview.url,sourceTitle:C.preview.name,sourceMarkdown:C.preview.sourceMarkdown};await Dbt(e.id,e.region,M),n()}else{const M=await Mbt(e.id,e.region,{url:f.trim()});if(!M.sourceMarkdown.trim())throw new Error(r("knowledge.errors.noWebPreview"));E({preview:M,metadata:F})}else m&&(await Lbt(e.id,e.region,{file:m,name:l.trim()||void 0,documentType:u.trim()||void 0,metadata:F}),n())}catch(M){M instanceof gM&&M.errorCode===sPe?i(M):S(Al(M,r(s==="web"?C?"knowledge.errors.addWeb":"knowledge.errors.previewWeb":"knowledge.errors.uploadFile")))}finally{O("")}},_=()=>{N||(E(null),S(""),requestAnimationFrame(()=>{var L;return(L=T.current)==null?void 0:L.focus()}))};return a.jsx(hT,{title:r(C?"knowledge.previewWeb":"knowledge.addData"),onClose:t,busy:N,className:C?"knowledge-dialog--preview knowledge-dialog--web-confirm":"",children:a.jsx("form",{onSubmit:L=>void D(L),children:C?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"knowledge-preview knowledge-web-preview",children:[a.jsxs("div",{className:"knowledge-preview__meta",children:[a.jsx("strong",{title:C.preview.name,children:C.preview.name}),a.jsx("a",{href:C.preview.url,target:"_blank",rel:"noopener noreferrer",children:r("knowledge.openOriginalWeb")})]}),a.jsx("div",{className:"knowledge-preview__body","aria-live":"polite",children:a.jsx("div",{className:"knowledge-preview__markdown-shell",children:a.jsx(_d,{text:C.preview.sourceMarkdown,allowRawHtml:!1,className:"knowledge-preview__markdown"})})}),k?a.jsx("div",{className:"knowledge-web-preview__error",children:a.jsx(OC,{message:k})}):null]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",className:"is-back",onClick:_,disabled:N,children:r("knowledge.backToEdit")}),a.jsx("button",{type:"button",onClick:t,disabled:N,children:r("common.cancel")}),a.jsx("button",{ref:R,type:"submit",className:"is-primary",disabled:N,children:r(x==="save"?"common.adding":"knowledge.confirmAdd")})]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsx("div",{className:"knowledge-source-tabs",role:"tablist","aria-label":r("knowledge.source"),children:[["image",r("knowledge.image")],["document",r("knowledge.documentFile")],["web",r("knowledge.webPage")]].map(([L,F])=>a.jsx("button",{type:"button",role:"tab",id:`knowledge-source-${L}-tab`,"aria-controls":`knowledge-source-${L}-panel`,"aria-selected":s===L,tabIndex:s===L?0:-1,className:s===L?"is-active":"",disabled:N,onClick:()=>P(L),onKeyDown:M=>{const z=["image","document","web"];if(!["ArrowLeft","ArrowRight","Home","End"].includes(M.key))return;M.preventDefault();const q=z.indexOf(L),U=M.key==="Home"?z[0]:M.key==="End"?z[z.length-1]:z[(q+(M.key==="ArrowRight"?1:-1)+z.length)%z.length];P(U),requestAnimationFrame(()=>{var J;return(J=document.getElementById(`knowledge-source-${U}-tab`))==null?void 0:J.focus()})},children:F},L))}),a.jsx("div",{id:`knowledge-source-${s}-panel`,className:"knowledge-source-panel",role:"tabpanel","aria-labelledby":`knowledge-source-${s}-tab`,children:s==="web"?a.jsxs(a.Fragment,{children:[a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.webUrl")}),a.jsx("input",{ref:T,autoFocus:!0,type:"url",value:f,disabled:N,onChange:L=>{h(L.target.value),S("")},placeholder:"https://example.com/article"})]}),a.jsx("div",{className:"knowledge-upload-status",role:"status","aria-live":"polite",children:x==="preview"?a.jsx(hn,{children:r("knowledge.generatingWebPreview")}):null})]}):a.jsxs(a.Fragment,{children:[a.jsx("input",{ref:j,className:"knowledge-upload-input",type:"file","aria-label":r("knowledge.selectFile"),accept:s==="image"?XMe:YMe,disabled:N,onChange:L=>{var F;I(((F=L.currentTarget.files)==null?void 0:F[0])??null),L.currentTarget.value=""}}),a.jsxs("button",{type:"button",className:`knowledge-upload-dropzone${b?" is-dragging":""}${m?" is-ready":""}`,disabled:N,onClick:()=>{var L;return(L=j.current)==null?void 0:L.click()},onDragEnter:L=>{L.preventDefault(),!N&&(A.current+=1,v(!0))},onDragOver:L=>{L.preventDefault(),N||(L.dataTransfer.dropEffect="copy")},onDragLeave:L=>{L.preventDefault(),A.current=Math.max(0,A.current-1),A.current===0&&v(!1)},onDrop:L=>{var F;L.preventDefault(),A.current=0,v(!1),N||I(((F=L.dataTransfer.files)==null?void 0:F[0])??null)},children:[a.jsx("strong",{children:m?m.name:r("knowledge.selectOrDropFile")}),a.jsx("span",{children:m?r("knowledge.selectedFile",{size:aq(m.size)}):r(s==="image"?"knowledge.imageFileHelp":"knowledge.documentFileHelp")})]}),a.jsx("div",{className:"knowledge-upload-status",role:"status","aria-live":"polite",children:N?a.jsx(hn,{children:r("knowledge.uploadingFile")}):null})]})}),s!=="web"?a.jsxs("div",{className:"knowledge-dialog__fields",children:[a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.optionalName")}),a.jsx("input",{value:l,disabled:N,maxLength:256,onChange:L=>c(L.target.value)})]}),a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.optionalType")}),a.jsx("input",{value:u,disabled:N,maxLength:64,onChange:L=>d(L.target.value),placeholder:"pdf, docx, png"})]})]}):null,a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.metadataJson")}),a.jsx("textarea",{className:"is-code",value:y,disabled:N,onChange:L=>w(L.target.value),spellCheck:!1})]}),a.jsx(OC,{message:k})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:t,disabled:N,children:r("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:N||(s==="web"?!f.trim():!m),children:r(N?s==="web"?"common.generating":"common.uploading":s==="web"?"knowledge.generatePreview":"knowledge.uploadFile")})]})]})})})}function YTt({base:e,item:t,onClose:n,onUpdated:i}){const{t:r}=Te("ui"),[s,o]=p.useState(()=>JSON.stringify(t.metadata??{},null,2)),[l,c]=p.useState(!1),[u,d]=p.useState(""),f=async h=>{h.preventDefault();let m;try{m=ZMe(s,r("knowledge.errors.metadataObject"))}catch(g){d(Al(g,r("knowledge.errors.metadataFormat")));return}c(!0),d("");try{i(await $bt(e.id,t.id,e.region,{metadata:m}))}catch(g){d(Al(g,r("knowledge.errors.updateDocument")))}finally{c(!1)}};return a.jsx(hT,{title:r("knowledge.editMetadata"),onClose:n,busy:l,children:a.jsxs("form",{onSubmit:h=>void f(h),children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.knowledge")}),a.jsx("input",{value:t.name||t.id,disabled:!0})]}),a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.metadataJson")}),a.jsx("textarea",{autoFocus:!0,className:"is-code knowledge-metadata-editor",value:s,onChange:h=>o(h.target.value),spellCheck:!1})]}),a.jsx(OC,{message:u})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:n,disabled:l,children:r("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:l,children:r(l?"common.saving":"common.save")})]})]})})}const JMe=new Set(["avif","bmp","gif","jpeg","jpg","png","svg","webp"]),eLe=new Set(["aac","flac","m4a","mp3","ogg","wav","webm"]),tLe=new Set(["m4v","mov","mp4","mpeg","mpg","ogg","webm"]),ZTt=new Set(["pdf"]),JTt=new Set(["doc","docx","ppt","pptx","xls","xlsx"]),e2t=new Set(["creating","indexing","pending","processing","queued","submitted"]),t2t=new Set(["error","failed","unavailable"]);function Ane(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}}function __(e){if(e==null||e==="")return"-";if(["string","number","boolean"].includes(typeof e))return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function n2t(e,t){if(Array.isArray(e)){if(e.length===0)return null;const r=e.map(Ane);if(r.some(s=>Object.keys(s).length>0)){const s=[...new Set(r.flatMap(o=>Object.keys(o)))];return{columns:s,rows:r.map(o=>s.map(l=>__(o[l])))}}return{columns:[t("knowledge.value")],rows:e.map(s=>[__(s)])}}const n=Ane(e),i=Object.entries(n);if(i.length===0)return null;if(i.every(([,r])=>Array.isArray(r))){const r=i.map(([o])=>o),s=Math.max(...i.map(([,o])=>o.length));return{columns:r,rows:Array.from({length:s},(o,l)=>i.map(([,c])=>__(c[l])))}}return{columns:[t("knowledge.field"),t("knowledge.value")],rows:i.map(([r,s])=>[r,__(s)])}}function nLe(e){const t=e.trim();if(!t||t.startsWith("//"))return"";if(t.startsWith("/"))return t;try{const n=new URL(t);return["http:","https:"].includes(n.protocol)?n.href:""}catch{return""}}function i2t(e){const t=nLe(e);return t.startsWith("http://")||t.startsWith("https://")?t:""}function r2t(e){var r;const t=e.attachmentType.trim().toLocaleLowerCase();if(t==="image"||t==="doc-image"||t.startsWith("image/"))return"image";if(t==="audio"||t.startsWith("audio/"))return"audio";if(t==="video"||t.startsWith("video/"))return"video";if(t==="pdf"||t==="application/pdf")return"pdf";const n=e.attachmentUrl.split(/[?#]/,1)[0],i=n.includes(".")?((r=n.split(".").pop())==null?void 0:r.toLocaleLowerCase())??"":"";return JMe.has(i)?"image":eLe.has(i)?"audio":tLe.has(i)?"video":ZTt.has(i)?"pdf":t||i?"file":"none"}function s2t(e,t){const n=e.status.trim().toLocaleLowerCase();if(e2t.has(n))return{title:t("knowledge.preview.processingTitle"),detail:t("knowledge.preview.processingDetail")};if(t2t.has(n))return{title:t("knowledge.preview.failedTitle"),detail:t("knowledge.preview.failedDetail")};const i=l9(e).toLocaleLowerCase();return i==="pdf"||JTt.has(i)?{title:t("knowledge.preview.noParsedTitle"),detail:t("knowledge.preview.noParsedDetail")}:JMe.has(i)||eLe.has(i)||tLe.has(i)?{title:t("knowledge.preview.noMediaTitle"),detail:t("knowledge.preview.noMediaDetail")}:{title:t("knowledge.preview.noDataTitle"),detail:t("knowledge.preview.noDataDetail")}}function a2t({chunk:e}){const{t}=Te("ui"),[n,i]=p.useState(!1),r=nLe(e.attachmentUrl),s=r2t(e);return!r||s==="none"?null:n?a.jsx("div",{className:"knowledge-preview__attachment-error",children:t("knowledge.preview.attachmentError")}):s==="image"?a.jsx("img",{className:"knowledge-preview__image",src:r,alt:e.title||t("knowledge.preview.imageAlt"),loading:"lazy",onError:()=>i(!0)}):s==="audio"?a.jsx("audio",{className:"knowledge-preview__audio",src:r,controls:!0,preload:"metadata",onError:()=>i(!0),children:t("knowledge.preview.audioUnsupported")}):s==="video"?a.jsx("video",{className:"knowledge-preview__video",src:r,controls:!0,playsInline:!0,preload:"metadata",onError:()=>i(!0),children:t("knowledge.preview.videoUnsupported")}):s==="pdf"?a.jsxs("div",{className:"knowledge-preview__pdf",children:[a.jsx("iframe",{src:r,title:e.title?t("knowledge.preview.namedPdf",{name:e.title}):t("knowledge.preview.pdf"),sandbox:"",referrerPolicy:"no-referrer",onError:()=>i(!0)}),a.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:t("knowledge.preview.openPdf")})]}):a.jsxs("div",{className:"knowledge-preview__file-fallback",children:[a.jsx("p",{children:t("knowledge.preview.fileUnsupported")}),a.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:t("knowledge.preview.openOriginalFile")})]})}function o2t({base:e,item:t,onClose:n}){const{t:i}=Te("ui"),[r,s]=p.useState([]),[o,l]=p.useState(t),[c,u]=p.useState(""),[d,f]=p.useState(!0),[h,m]=p.useState(!1),[g,b]=p.useState(!1),[v,y]=p.useState(""),w=p.useRef(0),x=p.useRef(null),O=p.useCallback(async(E=0)=>{var R;(R=x.current)==null||R.abort();const j=new AbortController;x.current=j;const T=w.current+1;w.current=T,E>0?m(!0):f(!0),y(""),E===0&&(s([]),b(!1));try{const A=await Pbt(e.id,t.id,{region:e.region,offset:E,signal:j.signal});if(w.current!==T)return;l(A.document.id?A.document:t),u(A.sourceMarkdown||A.document.sourceMarkdown),s(N=>E>0?[...N,...A.chunks]:A.chunks),b(A.hasMore)}catch(A){!a9(A)&&w.current===T&&y(Al(A,i("knowledge.errors.loadPreview")))}finally{w.current===T&&(f(!1),m(!1))}},[e.id,e.region,t,i]);p.useEffect(()=>(O(),()=>{var E;(E=x.current)==null||E.abort(),w.current+=1}),[O]);const k=i2t(o.url||t.url),S=s2t(o,i),C=o.metadata._veadk_content_format==="markdown";return a.jsx(hT,{title:o.name||t.name||t.id,onClose:n,className:"knowledge-dialog--preview",children:a.jsxs("div",{className:"knowledge-preview",children:[o.sizeBytes>0||k?a.jsxs("div",{className:"knowledge-preview__meta",children:[o.sizeBytes>0?a.jsx("span",{children:aq(o.sizeBytes)}):null,k?a.jsx("a",{href:k,target:"_blank",rel:"noopener noreferrer",children:i("knowledge.openOriginalWeb")}):null]}):null,a.jsx("div",{className:"knowledge-preview__body","aria-live":"polite",children:c?a.jsx("div",{className:"knowledge-preview__markdown-shell",children:a.jsx(_d,{text:c,allowRawHtml:!1,className:"knowledge-preview__markdown"})}):d?a.jsx("div",{className:"knowledge-preview__state",role:"status",children:a.jsx(hn,{as:"span",duration:2.4,children:i("knowledge.preview.loading")})}):v&&r.length===0?a.jsxs("div",{className:"knowledge-preview__state is-error",role:"alert",children:[a.jsx("p",{children:v}),a.jsx("button",{type:"button",onClick:()=>void O(),children:i("common.retry")})]}):r.length===0?a.jsxs("div",{className:"knowledge-preview__state",children:[a.jsx("p",{children:S.title}),a.jsx("span",{children:k?i("knowledge.preview.openOriginalHint"):S.detail}),a.jsx("button",{type:"button",onClick:()=>void O(),children:i("common.reload")})]}):a.jsxs("div",{className:"knowledge-preview__chunks",children:[r.map((E,j)=>{const T=n2t(E.tableFields,i),R=E.id||`${j}:${E.title}`;return a.jsxs("article",{className:"knowledge-preview__chunk",children:[a.jsx("header",{children:a.jsx("h3",{children:E.title||i("knowledge.preview.chunk",{index:j+1})})}),E.content?C?a.jsx(_d,{text:E.content,allowRawHtml:!1,className:"knowledge-preview__markdown"}):a.jsx("p",{className:"knowledge-preview__content",children:E.content}):null,T?a.jsx("div",{className:"knowledge-preview__table-wrap",children:a.jsxs("table",{children:[a.jsx("thead",{children:a.jsx("tr",{children:T.columns.map((A,N)=>a.jsx("th",{scope:"col",children:A},`${A}:${N}`))})}),a.jsx("tbody",{children:T.rows.map((A,N)=>a.jsx("tr",{children:A.map((P,I)=>a.jsx("td",{children:P},I))},N))})]})}):null,a.jsx(a2t,{chunk:E})]},R)}),v?a.jsx("div",{className:"knowledge-preview__more-error",role:"alert",children:v}):null,g?a.jsx("button",{type:"button",className:"knowledge-preview__load-more",disabled:h,onClick:()=>void O(r.length),children:h?a.jsx(hn,{as:"span",duration:2.4,children:i("knowledge.preview.loadingMore")}):i("knowledge.preview.loadMore")}):null]})})]})})}function l2t({cloudProvider:e,region:t,active:n=!0,activationRevision:i=0,onDetailChange:r,toolbarLeading:s,toolbarFilters:o}){const{t:l,i18n:c}=Te("ui"),[u,d]=p.useState([]),[f,h]=p.useState({}),[m,g]=p.useState([]),[b,v]=p.useState(""),[y,w]=p.useState("overview"),[x,O]=p.useState(""),[k,S]=p.useState(""),[C,E]=p.useState(!0),[j,T]=p.useState(!1),[R,A]=p.useState(""),[N,P]=p.useState([]),[I,D]=p.useState(!1),[_,L]=p.useState(""),[F,M]=p.useState(""),[z,q]=p.useState(""),[U,J]=p.useState(!1),[V,Z]=p.useState(!1),[ne,W]=p.useState(!1),[G,H]=p.useState(null),[se,Y]=p.useState(null),[X,ie]=p.useState(null),[ee,be]=p.useState(null),[ue,pe]=p.useState(null),[ke,je]=p.useState(!1),Pe=p.useRef(0),Ee=p.useRef(0),Qe=p.useRef([]),_e=p.useRef(!1),ae=p.useRef(!1),le=p.useRef(null),ge=p.useRef(null),Oe=p.useRef({}),Se=p.useRef(!1),qe=p.useRef(null),Xe=p.useRef(null),ye=p.useRef(null),we=p.useRef(null),Ae=p.useMemo(()=>[t],[t]),Ve=p.useCallback(We=>`${We.region}\0${We.id}`,[]),Be=u.find(We=>Ve(We)===b)??null,_t=!!(Be&&z===Ve(Be));p.useEffect(()=>{r==null||r(!!Be)},[r,Be]),p.useEffect(()=>{w("overview"),S("")},[b]);const Pt=p.useMemo(()=>{const We=x.trim().toLocaleLowerCase();return We?u.filter(kt=>[kt.name,kt.description,kt.ownerLabel,kt.providerKnowledgeId].some(He=>He.toLocaleLowerCase().includes(We))):u},[u,x]),Kt=p.useMemo(()=>{const We=k.trim().toLocaleLowerCase();return We?N.filter(kt=>[kt.name,kt.id,l9(kt)].some(He=>He.toLocaleLowerCase().includes(We))):N},[k,N]);p.useEffect(()=>{Y(null)},[Be==null?void 0:Be.id,Be==null?void 0:Be.region]);const Et=p.useCallback(async(We=!1)=>{var nt;if(We&&(Se.current||Object.keys(Oe.current).length===0))return;(nt=le.current)==null||nt.abort();const kt=new AbortController;le.current=kt;const He=Pe.current+1;Pe.current=He,Se.current=!0,We?T(!0):E(!0),A(""),We||g([]);try{const et=await _bt({regions:Ae,nextTokens:We?Oe.current:void 0,signal:kt.signal});if(Pe.current!==He)return;d(St=>We?[...St,...et.items.filter(Ct=>!St.some(It=>Ve(It)===Ve(Ct)))]:et.items),Oe.current=et.nextTokens,h(et.nextTokens);const ft=et.failures.map(({region:St,error:Ct})=>`${xh(St,e)}: ${Al(Ct,l("common.loadFailed"))}`);g(St=>We?[...new Set([...St,...ft])]:ft),We||v(St=>et.items.some(Ct=>Ve(Ct)===St)?St:"")}catch(et){if(a9(et))return;Pe.current===He&&(We?g(ft=>[...new Set([...ft,Al(et,l("knowledge.errors.loadMoreBases"))])]):A(Al(et,l("knowledge.errors.loadBases"))))}finally{Pe.current===He&&(Se.current=!1,E(!1),T(!1))}},[Ve,e,Ae,l]),vt=p.useCallback(async(We,kt=!1)=>{var et;if(kt&&_e.current)return;(et=ge.current)==null||et.abort();const He=new AbortController;ge.current=He;const nt=Ee.current+1;Ee.current=nt,kt||(Qe.current=[],ae.current=!1,P([]),J(!1),M("")),_e.current=!0,D(!0),kt?M(""):L("");try{const ft=await Ibt(We.id,{region:We.region,offset:kt?Qe.current.length:0,signal:He.signal});if(Ee.current!==nt)return;q(Gt=>Gt===Ve(We)?"":Gt);const St=Qe.current,Ct=kt?[...St,...ft.items.filter(Gt=>!Gt.id||!St.some(Ge=>Ge.id===Gt.id))]:ft.items,It=ft.hasMore&&(!kt||Ct.length>St.length);Qe.current=Ct,ae.current=It,P(Ct),J(It)}catch(ft){if(a9(ft))return;Ee.current===nt&&(ft instanceof gM&&ft.errorCode===sPe&&(q(Ve(We)),H(Ct=>Ct&&Ve(Ct)===Ve(We)?null:Ct)),kt?M(Al(ft,l("knowledge.errors.loadMoreData"))):L(Al(ft,l("knowledge.errors.loadData"))))}finally{Ee.current===nt&&(_e.current=!1,D(!1))}},[Ve,l]);p.useEffect(()=>{var We;(We=le.current)==null||We.abort(),Pe.current+=1,Se.current=!1,Oe.current={},d([]),h({}),g([]),v(""),q(""),A(""),E(!0)},[e]),p.useEffect(()=>{if(n)return Et(),()=>{var We;(We=le.current)==null||We.abort(),Pe.current+=1,Se.current=!1}},[n,i,Et]),p.useEffect(()=>{var We,kt;if(!n){(We=ge.current)==null||We.abort(),Ee.current+=1,_e.current=!1;return}if(!Be){(kt=ge.current)==null||kt.abort(),Ee.current+=1,Qe.current=[],_e.current=!1,ae.current=!1,P([]),J(!1),M("");return}return vt(Be),()=>{var He;(He=ge.current)==null||He.abort(),Ee.current+=1,_e.current=!1}},[n,i,Be==null?void 0:Be.id,Be==null?void 0:Be.region]);const tt=n&&!Be&&!x.trim()&&!C&&!j&&!R&&Object.keys(f).length>0;p.useEffect(()=>{const We=Xe.current,kt=qe.current;if(!We||!kt||!tt)return;const He=new IntersectionObserver(([nt])=>{nt.isIntersecting&&Et(!0)},{root:kt,rootMargin:"240px 0px",threshold:.01});return He.observe(We),()=>He.disconnect()},[tt,Et]);const mt=()=>{const We=qe.current;!We||!tt||We.scrollHeight-We.scrollTop-We.clientHeight<=240&&Et(!0)},Ne=!!(Be&&N.length>0&&U&&!I&&!F);p.useEffect(()=>{const We=we.current,kt=ye.current;if(!Be||!We||!kt||!Ne)return;const He=new IntersectionObserver(([nt])=>{nt.isIntersecting&&vt(Be,!0)},{root:ye.current,rootMargin:"240px 0px",threshold:.01});return He.observe(We),()=>He.disconnect()},[Ne,vt,Be==null?void 0:Be.id,Be==null?void 0:Be.region]);const wt=()=>{const We=ye.current;if(!Be||!We||!ae.current||_e.current||F)return;const{scrollHeight:kt,scrollTop:He,clientHeight:nt}=We;kt-He-nt<=240&&vt(Be,!0)},jt=We=>{d(kt=>kt.map(He=>Ve(He)===Ve(We)?We:He))},Yt=async()=>{if(ee){je(!0);try{await Rbt(ee.id,ee.region),d(We=>We.filter(kt=>Ve(kt)!==Ve(ee))),q(We=>We===Ve(ee)?"":We),b===Ve(ee)&&v(""),be(null)}catch(We){A(Al(We,l("knowledge.errors.deleteBase"))),be(null)}finally{je(!1)}}},wn=async()=>{if(!(!Be||!ue)){je(!0);try{await Fbt(Be.id,ue.id,Be.region);const We=Qe.current.filter(kt=>kt.id!==ue.id);Qe.current=We,P(We),pe(null)}catch(We){L(Al(We,l("knowledge.errors.deleteDocument"))),pe(null)}finally{je(!1)}}};return a.jsxs("section",{className:`knowledge-library${Be?" is-detail":" resource-collection"}`,"aria-label":l("knowledge.library"),children:[Be?a.jsx(nT,{className:"knowledge-library__detail",title:Be.name,description:Be.description||l("common.noDescription"),identitySeed:Be.name,backLabel:l("knowledge.backToList"),onBack:()=>v(""),sections:[{key:"overview",label:l("skillCenter.overview"),content:a.jsx("section",{className:"knowledge-overview",children:a.jsxs(bH,{className:"knowledge-overview__summary",children:[a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.provider")}),a.jsx("dd",{children:Be.providerType||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.knowledgeId")}),a.jsx("dd",{className:"knowledge-keyboard-reveal",tabIndex:0,title:Be.providerKnowledgeId,children:Be.providerKnowledgeId||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.project")}),a.jsx("dd",{children:Be.projectName||"default"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.creator")}),a.jsx("dd",{children:P4(Be.ownerLabel)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("skillCenter.updatedAt")}),a.jsx("dd",{children:zTt(Be.updatedAt,c.resolvedLanguage??c.language)||"-"})]})]})})},{key:"data",label:l("knowledge.data"),content:a.jsx("section",{className:"knowledge-documents",children:a.jsx("div",{className:`knowledge-documents__body${N.length>0?" is-table":""}`,"aria-live":"polite",children:I&&N.length===0?a.jsx(cl,{}):_&&N.length===0?a.jsxs("div",{className:"knowledge-library__state is-error",role:"alert",children:[a.jsx("p",{children:_}),_t&&Be.canManage?a.jsx("button",{type:"button",onClick:()=>be(Be),children:l("knowledge.deleteInvalidAssociation")}):a.jsx("button",{type:"button",onClick:()=>void vt(Be),children:l("common.retry")})]}):N.length===0?a.jsxs("div",{className:"knowledge-library__state",children:[a.jsx(BTt,{}),a.jsx("p",{children:l("knowledge.noData")}),Be.canManage&&a.jsx("button",{type:"button",onClick:()=>H(Be),children:l("knowledge.addFirstData")})]}):a.jsx(yH,{rows:Kt,rowKey:We=>We.id,rowLabel:We=>We.name||We.id,columns:[{key:"name",header:l("common.name"),className:"is-primary-column",render:We=>a.jsx("span",{title:We.name||We.id,children:We.name||We.id})},{key:"format",header:l("knowledge.format"),className:"is-compact-column",render:We=>l9(We)},{key:"size",header:l("knowledge.size"),className:"is-compact-column",render:We=>aq(We.sizeBytes)}],searchValue:k,onSearchChange:S,searchPlaceholder:l("knowledge.searchData"),searchLabel:l("knowledge.searchLibraryData"),primaryAction:Be.canManage?{label:l(_t?"knowledge.associationInvalid":"knowledge.addData"),disabled:_t,title:_t?l("knowledge.providerMissing"):void 0,onClick:()=>H(Be)}:void 0,rowActions:We=>[{label:l("common.preview"),onSelect:()=>Y(We)},...Be.canManage?[{label:l("common.edit"),onSelect:()=>ie(We)},{label:l("common.delete"),onSelect:()=>pe(We),danger:!0}]:[]],scrollRef:ye,onScroll:wt,busy:I,emptyLabel:l("knowledge.noMatchingData"),footer:I?a.jsxs("div",{className:"knowledge-document-pagination",role:"status","aria-live":"polite",children:[a.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),a.jsx("span",{children:l("knowledge.loadingMoreData")})]}):F?a.jsxs("div",{className:"knowledge-document-pagination is-error",role:"alert",children:[a.jsx("span",{children:F}),a.jsx("button",{type:"button",onClick:()=>void vt(Be,!0),children:l("knowledge.retryLoading")})]}):U?a.jsx("div",{ref:we,className:"knowledge-document-pagination",role:"status","aria-live":"polite",children:l("skillCenter.scrollForMore")}):null})})})}],activeSectionKey:y,navigationLabel:l("knowledge.details"),onSectionChange:w,actions:Be.canManage?a.jsxs(a.Fragment,{children:[a.jsx(Tt,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>be(Be),children:l("common.delete")}),a.jsx(Tt,{type:"button",color:"primary",size:"lg",pill:!1,onClick:()=>W(!0),children:l("common.edit")})]}):void 0}):a.jsxs(a.Fragment,{children:[a.jsxs(ab,{className:"knowledge-library__toolbar library-resource-toolbar",children:[s,a.jsxs("div",{className:"resource-toolbar__actions",children:[o,a.jsx(em,{value:x,onChange:We=>O(We.target.value),placeholder:l("knowledge.searchBases"),"aria-label":l("knowledge.searchBases")})]})]}),a.jsxs(tm,{ref:qe,"aria-live":"polite",onScroll:mt,children:[m.length>0&&!C&&a.jsxs("div",{className:"knowledge-region-warning",role:"status",children:[a.jsx("span",{children:l("knowledge.someBasesFailed")}),a.jsx("button",{type:"button",onClick:()=>void Et(),children:l("common.retry")})]}),C&&u.length===0?a.jsx(cl,{}):R?a.jsxs("div",{className:"knowledge-library__state is-error",role:"alert",children:[a.jsx("p",{children:R}),a.jsx("button",{type:"button",onClick:()=>void Et(),children:l("common.retry")})]}):Pt.length===0&&x.trim()?a.jsxs("div",{className:"knowledge-library__state",children:[a.jsx(FTt,{}),a.jsx("p",{children:l("knowledge.noMatchingBases")})]}):a.jsxs(V0,{children:[x.trim()?null:a.jsx(cb,{"aria-label":l("knowledge.createBase"),icon:a.jsx(QTt,{}),onClick:()=>Z(!0),children:l("knowledge.createBase")}),Pt.map(We=>a.jsx(q0,{className:"knowledge-card",title:We.name,description:We.description||l("common.noDescription"),metadata:[{label:l("knowledge.creator"),value:P4(We.ownerLabel),title:P4(We.ownerLabel)},{label:l("knowledge.project"),value:We.projectName||"default",title:We.projectName||"default"}],action:{label:z===Ve(We)?l("knowledge.associationInvalid"):l("knowledge.addData"),icon:"plus",disabled:!We.canManage||z===Ve(We),title:We.canManage?z===Ve(We)?l("knowledge.providerMissing"):void 0:l("knowledge.noManagePermission"),onClick:()=>H(We)},detailAction:{label:l("common.viewDetails"),onClick:()=>v(Ve(We))}},Ve(We)))]}),tt||j?a.jsx("div",{ref:Xe,className:"my-agent-load-more",role:"status","aria-live":"polite",children:j?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),a.jsx("span",{children:l("knowledge.loadingMoreBases")})]}):tt?a.jsx("span",{children:l("skillCenter.scrollForMore")}):null}):null]})]}),V&&a.jsx(KTt,{region:t,onClose:()=>Z(!1),onCreated:We=>{d(kt=>[We,...kt]),v(Ve(We)),Z(!1)}}),Be&&ne&&a.jsx(GTt,{item:Be,onClose:()=>W(!1),onUpdated:We=>{jt(We),W(!1)}}),Be&&se&&a.jsx(o2t,{base:Be,item:se,onClose:()=>Y(null)}),G&&a.jsx(XTt,{base:G,onClose:()=>H(null),onAssociationInvalid:We=>{q(Ve(G)),Be&&Ve(Be)===Ve(G)&&L(Al(We,l("knowledge.associationInvalid"))),H(null)},onCreated:()=>{Be&&Ve(Be)===Ve(G)&&vt(Be),H(null)}}),Be&&X&&a.jsx(YTt,{base:Be,item:X,onClose:()=>ie(null),onUpdated:We=>{const kt=Qe.current.map(He=>He.id===We.id?We:He);Qe.current=kt,P(kt),ie(null)}}),ee&&a.jsx(Ad,{title:l("knowledge.deleteBaseTitle"),description:l("knowledge.deleteBaseDescription",{name:ee.name}),confirmLabel:l(ke?"common.deleting":"common.delete"),variant:"danger",busy:ke,onCancel:()=>be(null),onConfirm:()=>void Yt()}),ue&&a.jsx(Ad,{title:l("knowledge.deleteDocumentTitle"),description:l("knowledge.deleteDocumentDescription",{name:ue.name||ue.id}),confirmLabel:l(ke?"common.deleting":"common.delete"),variant:"danger",busy:ke,onCancel:()=>pe(null),onConfirm:()=>void wn()})]})}const c2t="_EmptyMessage_1r5gu_1",u2t="_IconBadge_1r5gu_16",d2t="_Title_1r5gu_54",f2t="_Description_1r5gu_69",h2t="_ActionRow_1r5gu_77",pT={EmptyMessage:c2t,IconBadge:u2t,Title:d2t,Description:f2t,ActionRow:h2t},Hn=({children:e,className:t,fill:n="static"})=>a.jsx("div",{className:Qi(pT.EmptyMessage,t),"data-fill":n,children:e}),p2t=({size:e="md",color:t="secondary",children:n,className:i})=>a.jsx("div",{className:Qi(pT.IconBadge,i),"data-size":e,"data-color":t,children:n}),m2t=({children:e,className:t,color:n="secondary"})=>a.jsx("div",{className:Qi(pT.Title,t),"data-color":n,children:e}),g2t=({children:e,className:t})=>a.jsx("div",{className:Qi(pT.Description,t),children:e}),b2t=({children:e,className:t})=>a.jsx("div",{className:Qi(pT.ActionRow,t),children:e});Hn.Icon=p2t;Hn.Title=m2t;Hn.Description=g2t;Hn.ActionRow=b2t;yn.hasResourceBundle("en-US","skills")||yn.addResourceBundle("en-US","skills",zme,!0,!0);yn.hasResourceBundle("zh-CN","skills")||yn.addResourceBundle("zh-CN","skills",Gwe,!0,!0);function tn(e,t={}){return yn.t(e,{...t,ns:"skills"})}const y2t="/web/skill-workbench";class c9 extends Error{constructor(t,n,i="SKILL_WORKBENCH_ERROR",r=!1,s="",o,l=""){super(t),this.status=n,this.code=i,this.retryable=r,this.statusText=s,this.originalError=o,this.rawResponse=l,this.name="SkillWorkbenchApiError"}}function kd(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(tn("api.invalidFormat",{label:t}));return e}function Tne(e,t){if(e!=null){if(typeof e!="string"||!e.trim()||e.trim().length>256)throw new Error(tn("api.invalidFormat",{label:t}));return e.trim()}}function v2t(e){if(e!=null){if(e==="pending"||e==="ready"||e==="failed"||e==="unknown")return e;throw new Error(tn("api.invalidFormat",{label:tn("api.recoveryStatus")}))}}async function kh(e,t={},n=ho){return fetch(ja(`${y2t}${e}`),{...t,headers:fc(t.headers),signal:po(t.signal,n)})}async function oq(e,t){var i;const n=await e.text().catch(()=>"");try{const r=kd(JSON.parse(n),tn("api.errorResponse")),s=r.detail&&typeof r.detail=="object"?kd(r.detail,tn("api.errorDetails")):r;return new c9(typeof s.message=="string"?s.message:t,e.status,typeof s.code=="string"?s.code:"SKILL_WORKBENCH_ERROR",s.retryable===!0,e.statusText,s.originalError&&typeof s.originalError=="object"?s.originalError:void 0,n)}catch{const r=((i=e.headers.get("content-type"))==null?void 0:i.split(";",1)[0])||tn("api.missingContentType");return new c9(tn("api.gatewayError",{fallback:t,status:e.status,contentType:r}),e.status,"SKILL_WORKBENCH_ERROR",!1,e.statusText,void 0,n)}}async function db(e,t){if(!e.ok)throw await oq(e,t);const n=e.headers.get("content-type")??"";if(!n.includes("application/json")){const i=n.split(";",1)[0]||tn("api.missingContentType");throw new Error(tn("api.nonJson",{fallback:t,status:e.status,contentType:i}))}return e.json()}function x2t(e){return Array.isArray(e)?e.map(t=>{const n=kd(t,tn("api.activity")),i=n.kind,r=n.status;if(typeof n.id!="string"||!["status","thinking","message","tool"].includes(String(i))||!["running","done"].includes(String(r)))throw new Error(tn("api.invalidActivity"));if(i==="tool"){if(typeof n.name!="string")throw new Error(tn("api.invalidToolActivity"));return{id:n.id,kind:i,status:r,name:n.name,...n.input!==void 0?{args:n.input}:{},...n.output!==void 0?{response:n.output}:{}}}if(typeof n.text!="string")throw new Error(tn("api.invalidTextActivity"));return{id:n.id,kind:i,status:r,text:n.text}}):[]}function w2t(e){if(e==null)return;const t=kd(e,tn("api.publication"));if(typeof t.revision!="number"||typeof t.skillId!="string"||typeof t.version!="string"||!Array.isArray(t.skillSpaceIds)||!t.skillSpaceIds.every(n=>typeof n=="string")||t.disposition!=="create-new"&&t.disposition!=="update-source"||!CD(t.region)||typeof t.projectName!="string")throw new Error(tn("api.invalidFormat",{label:tn("api.publication")}));return{revision:t.revision,skillId:t.skillId,version:t.version,skillSpaceIds:t.skillSpaceIds,disposition:t.disposition,region:t.region,projectName:t.projectName}}function kC(e){const t=kd(e,tn("api.task"));if(typeof t.jobId!="string"||t.operation!=="create"&&t.operation!=="optimize"||typeof t.intent!="string"||typeof t.revision!="number"||typeof t.state!="string")throw new Error(tn("api.invalidFormat",{label:tn("api.task")}));const n=Array.isArray(t.files)?t.files.flatMap(l=>{const c=kd(l,tn("api.file"));return typeof c.path=="string"&&typeof c.size=="number"?[{path:c.path,size:c.size}]:[]}):[];if(!["running","ready","failed","cancelled","expired","published"].includes(t.state))throw new Error(tn("api.unknownTaskState"));const r=Tne(t.toolId,"Tool ID"),s=Tne(t.sessionId,"Session ID"),o=v2t(t.recoveryStatus);return{jobId:t.jobId,operation:t.operation,intent:t.intent,...typeof t.model=="string"?{model:t.model}:{},...typeof t.style=="string"?{style:t.style}:{},...typeof t.requestedName=="string"?{requestedName:t.requestedName}:{},revision:t.revision,...r?{toolId:r}:{},...s?{sessionId:s}:{},...typeof t.sessionTtlSeconds=="number"?{sessionTtlSeconds:t.sessionTtlSeconds}:{},...typeof t.expiresAt=="string"?{expiresAt:t.expiresAt}:{},...typeof t.recoveryAvailable=="boolean"?{recoveryAvailable:t.recoveryAvailable}:{},...o?{recoveryStatus:o}:{},...typeof t.recoveredFromSnapshot=="boolean"?{recoveredFromSnapshot:t.recoveredFromSnapshot}:{},state:t.state,stage:typeof t.stage=="string"?t.stage:"generating",activities:x2t(t.activities),files:n,...t.source&&typeof t.source=="object"?{source:t.source}:{},...typeof t.name=="string"?{name:t.name}:{},...typeof t.description=="string"?{description:t.description}:{},...typeof t.skillMd=="string"?{skillMd:t.skillMd}:{},...typeof t.error=="string"?{error:t.error}:{},...t.validation&&typeof t.validation=="object"?{validation:t.validation}:{},...t.publication?{publication:w2t(t.publication)}:{}}}async function jM(e){const t=kd(await db(await kh("/capabilities",{signal:e}),tn("api.loadCapability")),tn("api.capability"));return{enabled:t.enabled===!0,reason:typeof t.reason=="string"?t.reason:"",operations:Array.isArray(t.operations)?t.operations.filter(n=>n==="create"||n==="optimize"):[],models:Array.isArray(t.models)?t.models.flatMap(n=>{if(!n||typeof n!="object")return[];const i=n;return typeof i.id=="string"&&typeof i.label=="string"?[{id:i.id,label:i.label}]:[]}):[],styles:t.styles&&typeof t.styles=="object"&&!Array.isArray(t.styles)?Object.fromEntries(Object.entries(t.styles).filter(n=>typeof n[1]=="string")):{},...typeof t.maxUploadBytes=="number"?{maxUploadBytes:t.maxUploadBytes}:{}}}async function O2t(e){if(e.file){const n=new URLSearchParams({operation:"optimize",intent:e.intent});e.jobId&&n.set("job_id",e.jobId),e.model&&n.set("model",e.model),e.style&&n.set("style",e.style),e.name&&n.set("name",e.name);const i=await kh(`/tasks/from-upload?${n}`,{method:"POST",body:e.file,headers:{"Content-Type":"application/zip"},signal:e.signal},mr);return kC(await db(i,tn("api.startOptimization")))}const t=await kh("/tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operation:e.operation,intent:e.intent,...e.model?{model:e.model}:{},...e.style?{style:e.style}:{},...e.name?{name:e.name}:{},...e.jobId?{jobId:e.jobId}:{},...e.source?{source:{kind:"skill-center",skillId:e.source.skillId,skillName:e.source.name,version:e.source.version,region:e.source.region,projectName:e.source.projectName,skillSpaceId:e.source.skillSpaceId,skillSpaceName:e.source.skillSpaceName}}:{}}),signal:e.signal},mr);return kC(await db(t,tn("api.startTask")))}async function k2t(e,t){return kC(await db(await kh(`/tasks/${encodeURIComponent(e)}`,{signal:t}),tn("api.loadTask")))}async function D4(e,t,n){const i=new URLSearchParams;i.set("expected_revision",String(t));const r=kd(await db(await kh(`/tasks/${encodeURIComponent(e)}/artifact?${i.toString()}`,{signal:n}),tn("api.loadArtifact")),tn("api.artifact"));if(r.jobId!==e||r.revision!==t||!Number.isSafeInteger(r.revision)||r.revision<1||typeof r.sha256!="string"||!/^[0-9a-f]{64}$/.test(r.sha256)||typeof r.name!="string"||typeof r.description!="string"||!Array.isArray(r.files))throw new Error(tn("api.invalidFormat",{label:tn("api.artifact")}));const s=r.files.map(o=>{const l=kd(o,tn("api.artifactFile"));if(typeof l.path!="string"||typeof l.size!="number"||typeof l.content!="string")throw new Error(tn("api.invalidFormat",{label:tn("api.artifactFile")}));return{path:l.path,size:l.size,content:l.content}});return{jobId:r.jobId,revision:r.revision,sha256:r.sha256,name:r.name,description:r.description,files:s}}async function M4(e){const t=await kh(`/tasks/${encodeURIComponent(e.jobId)}/refinements`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({intent:e.intent,expectedRevision:e.expectedRevision})},mr);return kC(await db(t,tn("api.refine")))}async function S2t(e){const t=await kh(`/tasks/${encodeURIComponent(e.jobId)}/stop`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expectedRevision:e.expectedRevision})});return kC(await db(t,tn("api.stop")))}async function E2t(e){const t=await kh(`/tasks/${encodeURIComponent(e.jobId)}/publish-stream`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/x-ndjson"},body:JSON.stringify({disposition:e.disposition,expectedRevision:e.expectedRevision,expectedArtifactSha256:e.expectedArtifactSha256,skillSpaceIds:e.skillSpaceIds??[],projectName:e.projectName,region:e.region}),signal:e.signal},0);if(!t.ok)throw await oq(t,tn("api.publish"));if(!(t.headers.get("content-type")??"").includes("application/x-ndjson"))throw new Error(tn("api.nonNdjson"));if(!t.body)throw new Error(tn("api.missingStream"));const i=new Set(["preparing","uploading","registering","activating","publishing"]);let r=null,s="";const o=new TextDecoder,l=t.body.getReader(),c=u=>{var h;if(!u.trim())return;const d=kd(JSON.parse(u),tn("api.publishProgress"));if(d.type==="progress"){if(typeof d.phase!="string"||!i.has(d.phase)||typeof d.message!="string")throw new Error(tn("api.invalidPublishProgress"));(h=e.onProgress)==null||h.call(e,{phase:d.phase,message:d.message});return}if(d.type==="error"){const m=kd(d.error,tn("api.publishError"));throw new c9(typeof m.message=="string"?m.message:tn("api.publish"),500,typeof m.code=="string"?m.code:"SKILL_PUBLISH_FAILED",m.retryable===!0,"",m.originalError&&typeof m.originalError=="object"?m.originalError:void 0,JSON.stringify(d.error))}if(d.type!=="complete")throw new Error(tn("api.unknownPublishEvent"));const f=kd(d.result,tn("api.publishResult"));if(typeof f.skillId!="string"||typeof f.version!="string"||!Array.isArray(f.skillSpaceIds)||!f.skillSpaceIds.every(m=>typeof m=="string")||f.disposition!=="create-new"&&f.disposition!=="update-source"||!CD(f.region)||typeof f.projectName!="string")throw new Error(tn("api.invalidFormat",{label:tn("api.publishResult")}));r={skillId:f.skillId,version:f.version,skillSpaceIds:f.skillSpaceIds,disposition:f.disposition,region:f.region,projectName:f.projectName}};for(;;){const{value:u,done:d}=await l.read();s+=o.decode(u,{stream:!d});const f=s.split(` -`);if(s=f.pop()??"",f.forEach(c),d)break}if(c(s),!r)throw new Error(tn("api.streamEnded"));return r}async function C2t(e){await db(await kh(`/tasks/${encodeURIComponent(e)}`,{method:"DELETE"}),tn("api.deleteTask"))}async function A2t(e,t,n){var c;const i=new URLSearchParams;i.set("expected_revision",String(t)),i.set("expected_sha256",n);const r=await kh(`/tasks/${encodeURIComponent(e)}/download?${i.toString()}`,{},mr);if(!r.ok)throw await oq(r,tn("api.download"));const o=((c=(r.headers.get("content-disposition")??"").match(/filename="([^"]+)"/))==null?void 0:c[1])??"skill.zip",l=URL.createObjectURL(await r.blob());try{const u=document.createElement("a");u.href=l,u.download=o,u.click()}finally{URL.revokeObjectURL(l)}}const iLe=p.createContext(void 0);function Y0(e){const t=p.useContext(iLe);if(t===void 0&&!e)throw new Error(Vc(47));return t}const T2t={...mje,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class _2t extends FD{constructor(n,i,r){const s=new cV;super(j2t(n,s,i,r),N2t(s),T2t);Zt(this,"setOpen",(n,i)=>{var f,h;const r=i.reason===pu,s=i.reason===Gw&&i.event.detail===0,o=!n&&(i.reason===T_e||i.reason==null),l=sst(i),c=this.select("activeTriggerId");if(!n&&i.reason===A_e&&i.trigger==null&&c!=null&&(i.trigger=this.context.triggerElements.getById(c)??this.select("activeTriggerElement")??void 0),(h=(f=this.context).onOpenChange)==null||h.call(f,n,i),i.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,i);const u=()=>{const m={open:n,openChangeReason:i.reason};aje(m,n,i.trigger,l()),this.update(m)};r?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(Iit,()=>{this.set("stickIfOpen",!1)}),vi.flushSync(u)):u();let d;s?d="click":o?d="dismiss":i.reason===rC&&(d="focus"),this.set("instantType",d)})}}function j2t(e,t,n,i=!1){const r={...fje(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return r.open&&(e==null?void 0:e.mounted)===void 0&&(r.mounted=!0),r.floatingRootContext=hje(t,n,i),r}function N2t(e){return{popupRef:p.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:p.createRef(),beforeContentFocusGuardRef:p.createRef(),stickIfOpenTimeout:new Mu,triggerElements:e}}function _ne({props:e}){const{children:t,open:n,defaultOpen:i=!1,onOpenChange:r,onOpenChangeComplete:s,modal:o=!1,handle:l,triggerId:c,defaultTriggerId:u=null}=e,d=I2t(l,{modal:o,open:i,openProp:n,activeTriggerId:u,triggerIdProp:c});d.useControlledProp("openProp",n),d.useControlledProp("triggerIdProp",c);const f=d.useState("open"),h=d.useState("mounted"),m=d.useState("payload");d.useContextCallback("onOpenChange",r),d.useContextCallback("onOpenChangeComplete",s),dje(d,f),lje(d);const{forceUnmount:g}=cje(f,d,()=>{d.update({stickIfOpen:!0,openChangeReason:null})});d.useSyncedValues({modal:o}),p.useEffect(()=>{f||d.context.stickIfOpenTimeout.clear()},[d,f]),p.useImperativeHandle(e.actionsRef,()=>({unmount:g,close:()=>d.setOpen(!1,ha(__e))}),[g,d]);const b=f||h;return a.jsxs(iLe.Provider,{value:d,children:[l&&a.jsx(sje,{handle:l,store:d}),b&&a.jsx(P2t,{store:d,modal:o}),typeof t=="function"?t({payload:m}):t]})}function R2t(e){return Y0(!0)?a.jsx(_ne,{props:e}):a.jsx(frt,{children:a.jsx(_ne,{props:e})})}function I2t(e,t){const n=rje((i,r)=>new _2t(t,i,r));return p.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function P2t({store:e,modal:t}){const n=e.useState("floatingRootContext"),i=U_e(n,{outsidePressEvent:{mouse:t==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),r=i.reference,s=i.floating;return uje(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:s}),null}const D2t=300;function nm(e){return FA(e,"base-ui")}function M2t(e,t){const n=p.useRef(null);function i(s){vi.flushSync(()=>{e.setOpen(!1,ha(rC,s.nativeEvent,s.currentTarget))});const o=cit(n.current);o==null||o.focus()}function r(s){var l;const o=e.select("positionerElement");if(o&&nw(s,o))(l=e.context.beforeContentFocusGuardRef.current)==null||l.focus();else{vi.flushSync(()=>{e.setOpen(!1,ha(rC,s.nativeEvent,s.currentTarget))});let c=lit(e.context.triggerFocusTargetRef.current||t.current);for(;c!==null&&ii(o,c);){const u=c;if(c=Jz(c),c===u)break}c==null||c.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:i,handleFocusTargetFocus:r}}function L2t(e){const t=p.useRef(""),n=p.useCallback(r=>{r.defaultPrevented||(t.current=r.pointerType,e(r,r.pointerType))},[e]);return{onClick:p.useCallback(r=>{if(r.detail===0){e(r,"keyboard");return}"pointerType"in r?e(r,r.pointerType):e(r,t.current),t.current=""},[e]),onPointerDown:n}}function rLe(e,t){const n=li((s,o)=>{(typeof e=="function"?e():e)||t(o||(VD?"touch":""))}),{onClick:i,onPointerDown:r}=L2t(n);return p.useMemo(()=>({onClick:i,onPointerDown:r}),[i,r])}const $2t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,disabled:o=!1,nativeButton:l=!0,handle:c,payload:u,openOnHover:d=!1,delay:f=D2t,closeDelay:h=0,id:m,...g}=t,b=Y0(!0),y=gje(c)??b;if(!y)throw new Error(Vc(74));const w=nm(m),x=y.useState("isTriggerActive",w),O=y.useState("floatingRootContext"),k=y.useState("isOpenedByTrigger",w),S=y.useState("triggerPopupId",w),C=p.useRef(null),{registerTrigger:E,isMountedByThisTrigger:j}=oje(w,C,y,{payload:u,disabled:o,openOnHover:d,closeDelay:h}),T=y.useState("openChangeReason"),R=y.useState("stickIfOpen"),A=y.useState("openMethod"),N=y.useState("focusManagerModal"),P=fst(O,{enabled:!o&&d&&(A!=="touch"||T!==Gw),mouseOnly:!0,move:!1,handleClose:mst(),restMs:f,delay:{close:h},triggerElementRef:C,isActiveTrigger:x,isClosing:()=>y.select("transitionStatus")==="ending"}),I=B_e(O,{stickIfOpen:R}),D=rLe(()=>y.select("open"),ne=>{y.set("openMethod",ne)}),_=y.useState("triggerProps",j),{getButtonProps:L,buttonRef:F}=KD({disabled:o,native:l}),M={open(ne){return ne&&T===Gw?_st.open(ne):xje.open(ne)}},{preFocusGuardRef:z,handlePreFocusGuardFocus:q,handleFocusTargetFocus:U}=M2t(y,C),V=Pa("button",t,{state:{disabled:o,open:k},ref:[F,n,E,C],props:[I.reference,P,_,D,{[sV]:"",id:w,"aria-haspopup":"dialog","aria-expanded":k,"aria-controls":S},g,L],stateAttributesMapping:M}),Z=a.jsx(p.Fragment,{children:V},w);return j&&!N?a.jsxs(p.Fragment,{children:[a.jsx(c0,{ref:z,onFocus:q}),Z,a.jsx(c0,{ref:y.context.triggerFocusTargetRef,onFocus:U})]}):Z}),sLe=p.createContext(void 0);function F2t(){const e=p.useContext(sLe);if(e===void 0)throw new Error(Vc(45));return e}const B2t=p.forwardRef(function(t,n){const{keepMounted:i=!1,...r}=t;return Y0().useState("mounted")||i?a.jsx(sLe.Provider,{value:i,children:a.jsx(I_e,{ref:n,...r})}):null}),aLe=p.createContext(void 0);function U2t(){const e=p.useContext(aLe);if(!e)throw new Error(Vc(46));return e}const oLe=p.forwardRef(function(t,n){const{cutout:i,...r}=t;let s;if(i){const o=i.getBoundingClientRect();s=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${o.left}px ${o.top}px,${o.left}px ${o.bottom}px,${o.right}px ${o.bottom}px,${o.right}px ${o.top}px,${o.left}px ${o.top}px)`}return a.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...r,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});let jne={},Nne={},Rne="";function NM(e,t){return MA(e)?e:t}function Ine(e,t,n){return/hidden|clip/.test(e.getComputedStyle(NM(t,n)).overflowY)}function Q2t(e){if(typeof document>"u")return!1;const t=Sr(e);return na(t).innerWidth-t.documentElement.clientWidth>0}function z2t(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Sr(e),i=n.documentElement,r=n.body,s=NM(i,r),o=s.style.overflowY,l=i.style.scrollbarGutter;i.style.scrollbarGutter="stable",s.style.overflowY="scroll";const c=s.offsetWidth;s.style.overflowY="hidden";const u=s.offsetWidth;return s.style.overflowY=o,i.style.scrollbarGutter=l,c===u}function V2t(e){const t=Sr(e),n=t.documentElement,i=t.body,r=NM(n,i),s={overflowY:r.style.overflowY,overflowX:r.style.overflowX};return Object.assign(r.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(r.style,s)}}function H2t(e){var m;const t=Sr(e),n=t.documentElement,i=t.body,r=na(n);let s=0,o=0,l=!1;const c=_c.create();if(U1&&(((m=r.visualViewport)==null?void 0:m.scale)??1)!==1)return()=>{};function u(){const g=r.getComputedStyle(n),b=r.getComputedStyle(i),w=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,o=n.scrollLeft,jne={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Rne=n.style.scrollBehavior,Nne={position:i.style.position,height:i.style.height,width:i.style.width,boxSizing:i.style.boxSizing,overflowY:i.style.overflowY,overflowX:i.style.overflowX,scrollBehavior:i.style.scrollBehavior};const x=n.scrollHeight>n.clientHeight,O=n.scrollWidth>n.clientWidth,k=g.overflowY==="scroll"||b.overflowY==="scroll",S=g.overflowX==="scroll"||b.overflowX==="scroll",C=Math.max(0,r.innerWidth-i.clientWidth),E=Math.max(0,r.innerHeight-i.clientHeight),j=parseFloat(b.marginTop)+parseFloat(b.marginBottom),T=parseFloat(b.marginLeft)+parseFloat(b.marginRight),R=NM(n,i);if(l=z2t(e),l){n.style.scrollbarGutter=w,R.style.overflowY="hidden",R.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:w,overflowY:"hidden",overflowX:"hidden"}),(x||k)&&(n.style.overflowY="scroll"),(O||S)&&(n.style.overflowX="scroll"),Object.assign(i.style,{position:"relative",height:j||E?`calc(100dvh - ${j+E}px)`:"100dvh",width:T||C?`calc(100vw - ${T+C}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),i.scrollTop=s,i.scrollLeft=o,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function d(){Object.assign(n.style,jne),Object.assign(i.style,Nne),l||(n.scrollTop=s,n.scrollLeft=o,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=Rne)}function f(){d(),c.request(u)}u();const h=Ni(r,"resize",f);return()=>{c.cancel(),d(),typeof r.removeEventListener=="function"&&h()}}class q2t{constructor(){Zt(this,"lockCount",0);Zt(this,"restore",null);Zt(this,"timeoutLock",Mu.create());Zt(this,"timeoutUnlock",Mu.create());Zt(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});Zt(this,"unlock",()=>{var t;this.lockCount===0&&this.restore&&((t=this.restore)==null||t.call(this),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const n=Sr(t),i=n.documentElement,r=n.body,s=na(i);if(Ine(s,i,r)){const l=new s.MutationObserver(()=>{Ine(s,i,r)||(l.disconnect(),this.restore=null,this.lock(t))}),c={attributes:!0};l.observe(i,c),l.observe(r,c),this.restore=()=>l.disconnect();return}const o=VD||!Q2t(t);this.restore=o?V2t(t):H2t(t)}}const W2t=new q2t;function lLe(e=!0,t=null){Jn(()=>{if(e)return W2t.acquire(t)},[e,t])}const K2t=20;function G2t(e,t,n,i){const[r,s]=p.useState(!1);Jn(()=>{if(!e||!t||n==null){s(!1);return}const o=Sr(n).documentElement.clientWidth,l=n.offsetWidth;s(o>0&&l>0&&l>=o-K2t)},[e,t,n]),lLe(e&&(!t||r),i)}const X2t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,anchor:o,positionMethod:l,side:c,align:u,sideOffset:d,alignOffset:f,collisionBoundary:h="clipping-ancestors",collisionPadding:m,arrowPadding:g,sticky:b,disableAnchorTracking:v=!1,collisionAvoidance:y=Fit,...w}=t,x=Y0(),O=F2t(),k=urt(),S=x.useState("floatingRootContext"),C=x.useState("mounted"),E=x.useState("open"),j=x.useState("openChangeReason"),T=x.useState("activeTriggerElement"),R=x.useState("modal"),A=x.useState("openMethod"),N=x.useState("positionerElement"),P=x.useState("instantType"),I=x.useState("transitionStatus"),D=x.useState("adaptiveOrigin"),_=p.useRef(null),L=rV(N),F=Ost({anchor:o,floatingRootContext:S,positionMethod:l,mounted:C,side:c,sideOffset:d,align:u,alignOffset:f,arrowPadding:g,collisionBoundary:h,collisionPadding:m,sticky:b,disableAnchorTracking:v,keepMounted:O,nodeId:k,collisionAvoidance:y,adaptiveOrigin:D}),M=S.useState("domReferenceElement");Jn(()=>{const V=M,Z=_.current;if(V&&(_.current=V),Z&&V&&V!==Z){x.set("instantType",void 0);const ne=new AbortController;return L(()=>{x.set("instantType","trigger-change")},ne.signal),()=>{ne.abort()}}},[M,L,x]);const z=R===!0&&j!==pu;G2t(E&&z,A==="touch",N,T);const q=x.useStateSetter("positionerElement"),U={open:E,side:F.side,align:F.align,anchorHidden:F.anchorHidden,instant:P},J=jst(t,U,{styles:F.positionerStyles,transitionStatus:I,props:w,refs:[n,q],hidden:!C,inert:!E});return a.jsxs(aLe.Provider,{value:F,children:[C&&z&&a.jsx(oLe,{inert:iV(!E),cutout:T}),a.jsx(drt,{id:k,children:J})]})}),Y2t="ArrowUp",Z2t="ArrowDown",J2t="ArrowLeft",e_t="ArrowRight",t_t="Home",n_t="End",cLe=new Set([Y2t,Z2t,J2t,e_t,t_t,n_t]),i_t=p.createContext(void 0);function r_t(e){return p.useContext(i_t)}const s_t=p.createContext(void 0);function a_t(){const[e,t]=p.useState(0),n=li(()=>(t(r=>r+1),()=>{t(r=>Math.max(0,r-1))}));return{context:p.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}const o_t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,initialFocus:o,finalFocus:l,...c}=t,u=Y0(),d=U2t(),f=r_t()!=null,{context:h,hasClosePart:m}=a_t(),g=u.useState("open"),b=u.useState("openMethod"),v=u.useState("instantType"),y=u.useState("transitionStatus"),w=u.useState("popupProps"),x=u.useState("titleElementId"),O=u.useState("descriptionElementId"),k=u.useState("modal"),S=u.useState("mounted"),C=u.useState("openChangeReason"),E=u.useState("activeTriggerElement"),j=u.useState("floatingRootContext"),T=j.useState("floatingId"),R=u.useState("disabled"),A=u.useState("openOnHover"),N=u.useState("closeDelay");$A({open:g,ref:u.context.popupRef,onComplete(){var F,M;g&&((M=(F=u.context).onOpenChangeComplete)==null||M.call(F,!0))}}),ust(j,{enabled:A&&!R,closeDelay:N});const P=o===void 0?ije(u.context.popupRef):o,I=k!==!1&&m;u.useSyncedValue("focusManagerModal",I);const D=u.useStateSetter("popupElement"),_={open:g,side:d.side,align:d.align,instant:v,transitionStatus:y},L=Pa("div",t,{state:_,ref:[n,u.context.popupRef,D],props:[w,{id:T,role:"dialog",...nje,"aria-labelledby":x,"aria-describedby":O,onKeyDown(F){f&&cLe.has(F.key)&&F.stopPropagation()}},Oje(y),c],stateAttributesMapping:wje});return a.jsx(F_e,{context:j,openInteractionType:b,modal:I,disabled:!S||C===pu,initialFocus:P,returnFocus:l,restoreFocus:"popup",previousFocusableElement:ea(E)?E:void 0,nextFocusableElement:u.context.triggerFocusTargetRef,beforeContentFocusGuardRef:u.context.beforeContentFocusGuardRef,children:a.jsx(s_t.Provider,{value:h,children:L})})}),l_t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...o}=t,l=Y0(),c=nm(o.id);return l.useSyncedValueWithCleanup("titleElementId",c),Pa("h2",t,{ref:n,props:[{id:c},o]})}),c_t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...o}=t,l=Y0(),c=nm(o.id);return l.useSyncedValueWithCleanup("descriptionElementId",c),Pa("p",t,{ref:n,props:[{id:c},o]})});function Pne(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"10.25",cy:"10.25",r:"6.25"}),a.jsx("path",{d:"M4.15 10.25h12.2M10.25 4c1.65 1.72 2.5 3.8 2.5 6.25s-.85 4.53-2.5 6.25M10.25 4c-1.65 1.72-2.5 3.8-2.5 6.25s.85 4.53 2.5 6.25M14.8 14.8 20 20"})]})}function u_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.25",y:"5.25",width:"15.5",height:"13.5",rx:"2.25"}),a.jsx("circle",{cx:"8.1",cy:"9.3",r:"1.35"}),a.jsx("path",{d:"m4.7 16.5 3.65-3.7 2.45 2.25 2.2-2.2 4.35 4.1"}),a.jsx("path",{d:"m19.4 2.75.48 1.37 1.37.48-1.37.48-.48 1.37-.48-1.37-1.37-.48 1.37-.48.48-1.37Z",fill:"currentColor",stroke:"none"})]})}function lq(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{className:"video-generate-icon__body",d:"M3.25 9h17.5v7.35a2.4 2.4 0 0 1-2.4 2.4H5.65a2.4 2.4 0 0 1-2.4-2.4V9Z"}),a.jsxs("g",{className:"video-generate-icon__clapper",children:[a.jsx("path",{d:"M3.25 9V7.65a2.4 2.4 0 0 1 2.4-2.4h12.7a2.4 2.4 0 0 1 2.4 2.4V9H3.25Z"}),a.jsx("path",{d:"M6.75 5.25 9.3 9M12 5.25 14.55 9M17.25 5.25 19.8 9"})]}),a.jsx("path",{d:"m10.25 11.45 4 2.55-4 2.55v-5.1Z"})]})}function d_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M4.25 5.25h15.5v10.5H4.25zM8.25 19.75h7.5M12 15.75v4"}),a.jsx("path",{d:"m7.25 12.75 2.35-2.4 2.15 1.65 3.4-3.6 1.6 1.55"}),a.jsx("circle",{cx:"7.25",cy:"8.4",r:".7",fill:"currentColor",stroke:"none"})]})}function f_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5 7.4c0-1.55 3.13-2.8 7-2.8s7 1.25 7 2.8-3.13 2.8-7 2.8-7-1.25-7-2.8Z"}),a.jsx("path",{d:"M5 7.4v4.55c0 1.55 3.13 2.8 7 2.8s7-1.25 7-2.8V7.4M5 11.95v4.55c0 1.55 3.13 2.8 7 2.8s7-1.25 7-2.8v-4.55"}),a.jsx("path",{d:"M8.2 12.25h.01M8.2 16.8h.01"})]})}function h_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M4.25 4.25h4.5v15.5h-4.5zM8.75 5.75h5v14h-5zM13.75 4.25h4.1v10.25h-4.1z"}),a.jsx("path",{d:"M5.75 7h1.5M10.25 8.25h2M10.25 11h2M15.15 7h1.3"}),a.jsx("circle",{cx:"17.45",cy:"17.35",r:"2.45"}),a.jsx("path",{d:"m19.25 19.15 1.55 1.55"})]})}function p_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M4.25 6.25h6.25c1 0 1.5.55 1.5 1.45v11.05c0-.9-.5-1.45-1.5-1.45H4.25V6.25Z"}),a.jsx("path",{d:"M19.75 9.1v8.2H13.5c-1 0-1.5.55-1.5 1.45V7.7c0-.9.5-1.45 1.5-1.45h2.15"}),a.jsx("path",{d:"m19 3.2.58 1.62 1.62.58-1.62.58L19 7.6l-.58-1.62-1.62-.58 1.62-.58L19 3.2Z",fill:"currentColor",stroke:"none"})]})}function m_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"m4.2 8.4 1.15 10.2h13.3L19.8 8.4"}),a.jsx("path",{d:"M4.2 8.4h15.6L17.9 5H6.1L4.2 8.4Z"}),a.jsx("path",{d:"M7.2 12.2c1.1-1 2.25 1.25 3.4.25 1.05-.9 2.15 1.3 3.3.25"}),a.jsx("path",{d:"m8.2 15.1 1.45 1.35 1.45-1.35M13.55 16.45h2.35"})]})}function g_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"6",cy:"6.25",r:"2.25"}),a.jsx("circle",{cx:"18",cy:"6.25",r:"2.25"}),a.jsx("circle",{cx:"12",cy:"17.75",r:"2.25"}),a.jsx("path",{d:"m7.7 7.75 2.7 7.55M16.3 7.75l-2.7 7.55M8.25 6.25h7.5"})]})}function Dne(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"9",cy:"8",r:"3"}),a.jsx("path",{d:"M3.75 18.75c.45-3.05 2.2-4.65 5.25-4.65s4.8 1.6 5.25 4.65"}),a.jsx("path",{d:"M17.75 4.25v5.5M15 7h5.5M16 13.25h4.25M18.125 11.125v4.25"})]})}function b_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"4",y:"4.25",width:"16",height:"5",rx:"1.5"}),a.jsx("rect",{x:"4",y:"14.75",width:"16",height:"5",rx:"1.5"}),a.jsx("path",{d:"M7.25 6.75h.01M7.25 17.25h.01M10 6.75h6.5M10 17.25h6.5"})]})}function y_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3.75h8l4 4v12.5H6V3.75Z"}),a.jsx("path",{d:"M14 3.75v4h4M8.75 11h6.5M8.75 14.25h6.5M8.75 17.5h4"})]})}function Mne(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.75",y:"4.5",width:"16.5",height:"15",rx:"2.5"}),a.jsx("path",{d:"m7.5 9 2.75 2.5L7.5 14M12.5 14h4"}),a.jsx("path",{d:"M3.75 7.5h16.5",opacity:".62"})]})}function rO(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m6 3.25 4.5 4.75L6 12.75"})})}function v_t({value:e}){const{t,i18n:n}=Te("adk"),[i,r]=p.useState(!1),s=f=>f==null?t("developmentRuns.notReported"):f.toLocaleString(n.resolvedLanguage||n.language),o=z2e,l=e.usage,c=(l==null?void 0:l.inputTokens)!=null&&l.cachedInputTokens!=null&&l.cachedInputTokens<=l.inputTokens?l.inputTokens-l.cachedInputTokens:void 0,u=l!=null&&l.inputTokens&&l.cachedInputTokens!=null&&c!=null?`${(l.cachedInputTokens/l.inputTokens*100).toFixed(1)}%`:void 0,d=[["inputTokens",l==null?void 0:l.inputTokens],["cachedInputTokens",l==null?void 0:l.cachedInputTokens],["uncachedInputTokens",c],["cacheWriteInputTokens",l==null?void 0:l.cacheWriteInputTokens],["outputTokens",l==null?void 0:l.outputTokens],["reasoningOutputTokens",l==null?void 0:l.reasoningOutputTokens]];return a.jsxs("div",{className:"development-turn-summary","data-turn-id":e.turnId,children:[a.jsx("span",{children:t(`developmentRuns.turnStatus.${e.status}`)}),a.jsx("span",{children:t("developmentRuns.toolCalls",{count:e.toolCalls})}),a.jsx("span",{children:t("developmentRuns.turnDuration",{duration:o(e.durationMs)})}),a.jsx("span",{title:t("developmentRuns.toolDurationHelp"),children:t(e.toolDurationComplete?"developmentRuns.toolDuration":"developmentRuns.toolDurationPartial",{duration:o(e.toolDurationMs)})}),a.jsxs(R2t,{open:i,onOpenChange:r,children:[a.jsxs($2t,{className:"development-token-trigger",openOnHover:!0,delay:150,closeDelay:150,onFocus:f=>{f.currentTarget.matches(":focus-visible")&&r(!0)},children:[a.jsx("span",{children:"Tokens"}),a.jsx("span",{className:"development-token-value",children:s(l==null?void 0:l.totalTokens)}),e.usageIncomplete&&a.jsxs("span",{children:["· ",t("developmentRuns.partial")]}),a.jsx(rO,{className:"development-token-chevron"})]}),a.jsx(B2t,{children:a.jsx(X2t,{side:"top",align:"end",sideOffset:8,className:"development-token-positioner",children:a.jsxs(o_t,{className:"development-token-popup",initialFocus:!1,finalFocus:!1,children:[a.jsx(l_t,{className:"development-token-title",children:t("developmentRuns.tokenDetails")}),a.jsxs("dl",{children:[a.jsxs("div",{children:[a.jsx("dt",{children:t("developmentRuns.model")}),a.jsx("dd",{children:e.model||t("developmentRuns.notReported")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:t("developmentRuns.totalTokens")}),a.jsx("dd",{children:s(l==null?void 0:l.totalTokens)})]}),d.map(([f,h])=>a.jsxs("div",{children:[a.jsx("dt",{children:t(`developmentRuns.${f}`)}),a.jsx("dd",{children:s(h)})]},f)),a.jsxs("div",{children:[a.jsx("dt",{children:t("developmentRuns.cacheHitRate")}),a.jsx("dd",{children:u||t("developmentRuns.notReported")})]})]}),a.jsxs(c_t,{className:"development-token-note",children:[t("developmentRuns.tokenHelp"),e.usageIncomplete?` ${t("developmentRuns.partialHelp")}`:""]})]})})})]})]})}function cq(e){return a.jsx("svg",{viewBox:"0 0 111 117",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M0 5.6016C7.82288e-05 0.621244 6.02226 -1.87314 9.54395 1.64847L40.1289 32.2334L68.5732 3.7891C69.5834 2.77903 70.9533 2.21099 72.3818 2.21097H82.7031C82.7917 2.20658 82.8806 2.20414 82.9697 2.20414H104.775C109.574 2.20427 111.977 8.00691 108.584 11.4004L64.916 55.0664C64.3075 55.8528 63.9436 56.7647 63.8242 57.6993C63.7142 56.4884 63.1964 55.3069 62.2695 54.3799L45.4082 37.5186H45.4072L40.124 32.2354L17.832 54.5284C16.7671 55.5933 16.2416 56.993 16.2549 58.3887C16.2417 59.7843 16.7672 61.1842 17.832 62.2491L39.9287 84.3467L9.54395 114.733C6.0223 118.255 0.000223474 115.761 0 110.78V5.6016ZM63.8018 58.8702C63.8962 59.9086 64.2936 60.9229 64.9961 61.7735L108.591 105.368C111.984 108.762 109.58 114.564 104.781 114.564H94.4336C94.3543 114.568 94.274 114.569 94.1934 114.569H72.3877C70.9592 114.569 69.5892 114.002 68.5791 112.992L39.9336 84.3467L58.4531 65.8282L58.4453 65.8203L62.2695 61.9981C63.1476 61.12 63.6567 60.0136 63.8018 58.8702Z",fill:"currentColor"})})}function RM({kind:e,...t}){return e==="thinking"?a.jsx(cq,{...t}):a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:e==="tool"?a.jsxs(a.Fragment,{children:[a.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"3"}),a.jsx("path",{d:"m7 9 3 3-3 3m6 0h4"})]}):e==="plan"?a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"m4 7 1.5 1.5L8 6m-4 7 1.5 1.5L8 12M11 7h9m-9 6h9m-9 6h9"}),a.jsx("circle",{cx:"6",cy:"19",r:"1"})]}):a.jsx(a.Fragment,{children:a.jsx("path",{d:"M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9zM14 3v6h6M8 13h8m-4-3v6M8 18h8"})})})}function x_t({blocks:e,active:t,status:n,render:i}){const{t:r}=Te("adk"),[s,o]=p.useState(!1),l=[...e].reverse().find(h=>"done"in h&&!h.done),c=e.filter(h=>h.kind==="tool"),u=c.filter(h=>h.durationMs!=null),d=u.reduce((h,m)=>h+(m.durationMs||0),0);let f=r("developmentRuns.processSummary",{count:e.length});return t&&(f=n||((l==null?void 0:l.kind)==="thinking"?r("developmentRuns.thinking"):(l==null?void 0:l.kind)==="tool"?V2e(l):(l==null?void 0:l.kind)==="plan"?r("developmentRuns.plan"):(l==null?void 0:l.kind)==="diff"?r("developmentRuns.diff"):r("developmentRuns.processing"))),a.jsxs("section",{className:"development-process",children:[a.jsxs("button",{type:"button",className:"development-process__toggle","aria-expanded":s,onClick:()=>o(!s),children:[a.jsx(rO,{className:`tool-chevron${s?" is-open":""}`}),a.jsx("span",{className:"tool-icon",children:a.jsx(RM,{kind:(l==null?void 0:l.kind)==="thinking"||(l==null?void 0:l.kind)==="plan"||(l==null?void 0:l.kind)==="diff"?l.kind:"tool"})}),t?a.jsx(hn,{className:"development-process__title","aria-live":"polite",children:f}):a.jsx("span",{className:"development-process__title",children:f}),!t&&c.length>0&&a.jsxs("span",{className:"development-process__duration",children:[r("developmentRuns.toolCalls",{count:c.length}),u.length>0?` · ${r(u.length===c.length?"developmentRuns.toolDuration":"developmentRuns.toolDurationPartial",{duration:z2e(d)})}`:""]})]}),a.jsx("div",{className:"development-process__items",hidden:!s,children:i(e)})]})}function w_t({blocks:e,active:t,status:n="",render:i}){const{t:r}=Te("adk"),s=nnt(e),o=s[s.length-1],l=[...e].reverse().find(u=>u.kind==="progress"),c=n||((l==null?void 0:l.kind)==="progress"?l.text:"");return a.jsxs(a.Fragment,{children:[s.map(u=>u.process?a.jsx(x_t,{blocks:u.blocks,active:t&&u===o,status:c,render:i},u.id):a.jsx("div",{"data-assistant-phase":u.blocks[0].phase,children:i(u.blocks)},u.id)),t&&!(o!=null&&o.process)&&a.jsxs("div",{className:"development-process__status",role:"status",children:[a.jsx("span",{className:"tool-icon",children:a.jsx(RM,{kind:"thinking"})}),a.jsx(hn,{children:c||r("developmentRuns.processing")})]})]})}const O_t={formatDate(e){const t=e.value??e.date??e.timestamp;if(t==null)return"";const n=new Date(t);return isNaN(n.getTime())?String(t):n.toLocaleString()}};function k_t(e,t){if(!t||t==="/")return e;const n=t.replace(/^\//,"").split("/").map(r=>r.replace(/~1/g,"/").replace(/~0/g,"~"));let i=e;for(const r of n){if(i==null||typeof i!="object")return;i=i[r]}return i}function S_t(e){return typeof e=="object"&&e!==null&&typeof e.path=="string"}function E_t(e){return typeof e=="object"&&e!==null&&typeof e.call=="string"}function uq(e,t){if(S_t(e))return k_t(t,e.path);if(E_t(e)){const n=O_t[e.call],i={};for(const[r,s]of Object.entries(e.args??{}))i[r]=uq(s,t);return n?n(i):`[unknown fn: ${e.call}]`}return e}function C_t(e,t){const n=uq(e,t);return n==null?"":typeof n=="string"?n:String(n)}const uLe=new Map;function Z0(e,t){uLe.set(e,t)}function A_t(e){return uLe.get(e)}function T_t(e,t,n){const i=t.replace(/^\//,"").split("/").map(s=>s.replace(/~1/g,"/").replace(/~0/g,"~"));let r=e;for(let s=0;suq(i,e.dataModel),resolveString:i=>C_t(i,e.dataModel),dispatchAction:t,render:i=>{if(!i)return null;const r=e.components[i];if(!r)return null;const s=A_t(r.component)??__t;return a.jsx(s,{node:r,ctx:n},i)}};return a.jsx("div",{className:"a2ui-surface","data-a2ui-surface":e.surfaceId,children:n.render(e.rootId)})}function fLe(e){const t=p.useRef(null),n=p.useRef(!0),i=28,r=p.useCallback(()=>{const s=t.current;s&&(n.current=s.scrollHeight-s.scrollTop-s.clientHeight{const s=t.current;s&&n.current&&(s.scrollTop=s.scrollHeight)},[e]),{ref:t,onScroll:r}}function IM({value:e,skillPrefix:t="/",onRemoveSkill:n,onRemoveAgent:i}){const{t:r}=Te("conversation");return e.skills.length===0&&!e.targetAgent?null:a.jsxs("div",{className:"invocation-chips","aria-label":r("invocation.ariaLabel"),children:[e.skills.map(s=>a.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:s.description,children:[a.jsx(lC,{"aria-hidden":!0}),a.jsxs("span",{children:[t,s.name]}),n?a.jsx("button",{type:"button",onClick:()=>n(s.name),"aria-label":r("invocation.removeSkill",{name:s.name}),children:a.jsx(Mo,{})}):null]},s.name)),e.targetAgent?a.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:e.targetAgent.description,children:[a.jsx(Mje,{"aria-hidden":!0}),a.jsx("span",{children:e.targetAgent.name}),i?a.jsx("button",{type:"button",onClick:i,"aria-label":r("invocation.removeAgent",{name:e.targetAgent.name}),children:a.jsx(Mo,{})}):null]}):null]})}function dq(e=""){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e==="application/pdf"?"pdf":e==="text/markdown"?"markdown":"text"}function hLe(e){var n,i,r,s;const t=dq(e.mimeType);return t==="pdf"?"PDF":t==="markdown"?"MD":t==="video"?((i=(n=e.mimeType)==null?void 0:n.split("/")[1])==null?void 0:i.toUpperCase())??"VIDEO":t==="image"?((s=(r=e.mimeType)==null?void 0:r.split("/")[1])==null?void 0:s.toUpperCase())??"IMAGE":"TXT"}function pLe(e){return e?e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`:""}function mLe(e,t){return e.previewUrl?e.previewUrl:e.data?`data:${e.mimeType??"application/octet-stream"};base64,${e.data}`:e.uri?hTe(t,e.uri):""}function N_t({kind:e}){return e==="image"?a.jsx(bV,{}):e==="video"?a.jsx($je,{}):e==="pdf"?a.jsx(Pat,{}):a.jsx(mV,{})}function PM({appName:e,items:t,compact:n=!1,onRemove:i}){const{t:r}=Te("conversation"),[s,o]=p.useState(null);return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:`media-grid${n?" media-grid--compact":""}`,children:t.map(l=>{const c=dq(l.mimeType),u=mLe(l,e),d=l.status==="uploading"||l.status==="error"||!u,f=a.jsxs("button",{type:"button",className:"media-card-main",disabled:d,onClick:c==="image"?void 0:()=>o(l),"aria-label":r("media.preview",{name:l.name??r("media.attachment")}),children:[c==="image"&&u?a.jsx("img",{className:"media-card-image",src:u,alt:l.name??r("media.image"),loading:"lazy"}):c==="video"&&u?a.jsxs("div",{className:"media-card-video-container",children:[a.jsx("video",{className:"media-card-video",src:u,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),a.jsx("span",{className:"media-card-video-play",children:a.jsx(Uje,{})})]}):a.jsx("span",{className:"media-card-icon",children:a.jsx(N_t,{kind:c})}),a.jsxs("span",{className:"media-card-copy",children:[a.jsx("span",{className:"media-card-name",children:l.name??r("media.attachment")}),a.jsxs("span",{className:"media-card-meta",children:[a.jsx("span",{className:"media-card-type",children:hLe(l)}),l.status==="uploading"?a.jsxs(a.Fragment,{children:[a.jsx(Bi,{className:"media-card-spinner"})," ",r("media.uploading")]}):l.status==="error"?l.error??r("media.uploadFailed"):pLe(l.sizeBytes)]})]}),!n&&l.status!=="uploading"&&l.status!=="error"?a.jsx(ZS,{className:"media-card-open"}):null]});return a.jsxs(Ar.div,{className:`media-card media-card--${c}${l.status==="error"?" media-card--error":""}`,layout:!0,initial:{opacity:0,scale:.985,y:4},animate:{opacity:1,scale:1,y:0},children:[c==="image"&&!d?a.jsx(MAe,{src:u,children:f}):f,i?a.jsx("button",{type:"button",className:"media-card-remove","aria-label":r("media.remove",{name:l.name??r("media.attachment")}),onClick:()=>i(l.id),children:a.jsx(Mo,{})}):null]},l.id)})}),a.jsx(hf,{children:s?a.jsx(R_t,{appName:e,item:s,onClose:()=>o(null)}):null})]})}function R_t({appName:e,item:t,onClose:n}){const{t:i}=Te("conversation"),r=p.useMemo(()=>mLe(t,e),[e,t]),s=dq(t.mimeType),[o,l]=p.useState(""),[c,u]=p.useState(s==="text"||s==="markdown"),[d,f]=p.useState("");return p.useEffect(()=>{const h=m=>{m.key==="Escape"&&n()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[n]),p.useEffect(()=>{if(s!=="text"&&s!=="markdown")return;const h=new AbortController;return u(!0),f(""),fetch(r,{signal:h.signal}).then(m=>{if(!m.ok)throw new Error(`HTTP ${m.status}`);return m.text()}).then(l).catch(m=>{h.signal.aborted||f(m instanceof Error?m.message:String(m))}).finally(()=>{h.signal.aborted||u(!1)}),()=>h.abort()},[s,r]),a.jsx(Ar.div,{className:"media-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":i("media.previewDialog",{name:t.name??i("media.attachment")}),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onMouseDown:h=>{h.target===h.currentTarget&&n()},children:a.jsxs(Ar.div,{className:"media-viewer",initial:{opacity:0,y:18,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.99},transition:{type:"spring",stiffness:420,damping:30},children:[a.jsxs("header",{className:"media-viewer-header",children:[a.jsxs("div",{children:[a.jsx("strong",{children:t.name??i("media.attachment")}),a.jsxs("span",{children:[hLe(t),t.sizeBytes?` · ${pLe(t.sizeBytes)}`:""]})]}),a.jsxs("nav",{children:[a.jsx("a",{href:r,download:t.name,"aria-label":i("media.download"),children:a.jsx(eM,{})}),a.jsx("button",{type:"button",onClick:n,"aria-label":i("media.close"),children:a.jsx(Mo,{})})]})]}),a.jsxs("div",{className:`media-viewer-body media-viewer-body--${s}`,children:[s==="image"?a.jsx("img",{src:r,alt:t.name??i("media.image")}):null,s==="video"?a.jsx("div",{className:"media-viewer-video-wrapper",children:a.jsx("video",{src:r,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",className:"media-viewer-video"})}):null,s==="pdf"?a.jsx("iframe",{src:r,title:t.name??"PDF"}):null,c?a.jsxs("div",{className:"media-viewer-loading",children:[a.jsx(Bi,{})," ",i("media.reading")]}):null,!c&&d?a.jsx("div",{className:"media-viewer-loading",children:i("media.loadFailed",{error:d})}):null,!c&&s==="markdown"?a.jsx("div",{className:"media-document",children:a.jsx(_d,{text:o})}):null,!c&&s==="text"?a.jsx("pre",{className:"media-document media-document--plain",children:o}):null]})]})})}function I_t({definition:e,label:t,done:n,open:i,onToggle:r}){const{t:s}=Te("conversation"),o=e.icon,l=n?e.doneLabel:e.runningLabel,c=t??s(`blocks.tools.${e.name}.${n?"done":"running"}`,{defaultValue:l});return a.jsxs("button",{type:"button",className:`builtin-tool-head${n?" is-done":" is-running"}`,"data-tool-tone":e.tone,onClick:r,"aria-expanded":i,children:[a.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:a.jsx(o,{})}),n?a.jsx("span",{className:"builtin-tool-label",children:c}):a.jsx(hn,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:c}),a.jsx(rO,{className:`builtin-tool-chevron${i?" is-open":""}`})]})}function ju(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Vn(e){return typeof e=="string"?e:""}function Lne(e){return typeof e=="number"&&Number.isFinite(e)?e:0}function ud(e){return Array.isArray(e)?e:[]}function u9(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return{}}const n=ju(t)??{};return ju(n.result)??n}function DM(e){if(typeof e=="string")try{return DM(JSON.parse(e))}catch{return e}const t=ju(e);if(!t)return"";const n=ju(t.result);return Vn(t.error)||Vn(t.message)||Vn(n==null?void 0:n.error)||Vn(n==null?void 0:n.message)}function P_t(e){if(e.kind==="tool")return"tool";if(e.kind==="knowledge_base")return"knowledge_base";const t=ju(e.metadata),n=Vn(t==null?void 0:t.source_type).toLowerCase(),i=Vn(e.source).toLowerCase();return n==="skillhub"||i.startsWith("skill_hub:")?"skill_hub":"skill_space"}const gLe={tool:"Tools",knowledge:"AgentKit Knowledge Base",skillCenter:"AgentKit Skill Center",unknownSource:"Unknown source",unnamedResource:"Unnamed resource",unnamedAgent:"Unnamed agent"};function D_t(e,t){return e==="veadk_builtin_tools"?t.tool:e==="agentkit_knowledge"?t.knowledge:e.startsWith("skill_hub:")?`Skill Hub ${e.slice(10)}`:e.startsWith("skill_space:")?`${t.skillCenter} ${e.slice(12)}`:e||t.unknownSource}function M_t(e){return e==="veadk_builtin_tools"?"tool":e==="agentkit_knowledge"?"knowledge_base":e.startsWith("skill_hub:")?"skill_hub":"skill_space"}function L_t(e,t=gLe){const n=u9(e),i=ju(n.capabilities)??{},r=ud(n.resources).flatMap(o=>{const l=ju(o);if(!l)return[];const c=l.kind==="tool"?"tool":l.kind==="knowledge_base"?"knowledge_base":"skill";return[{ref:Vn(l.ref),kind:c,category:P_t(l),name:Vn(l.name)||Vn(l.ref)||t.unnamedResource,description:Vn(l.description),source:Vn(l.source),version:Vn(l.version)}]}),s=ud(n.sources).flatMap(o=>{const l=ju(o);if(!l)return[];const c=Vn(l.source),u=Vn(l.status),d=u==="error"?"error":u==="skipped"?"skipped":"ok";return[{source:c,category:M_t(c),label:D_t(c,t),status:d,count:Lne(l.count),message:Vn(l.message),searchKeywords:ud(l.search_keywords).map(Vn).filter(Boolean)}]});return{collectionId:Vn(n.collection_id),capabilities:{googleAdkVersion:Vn(i.google_adk_version),agentTypes:ud(i.agent_types).map(Vn).filter(Boolean),maxOrchestrationDepth:Lne(i.max_orchestration_depth)},resources:r,sources:s,counts:{all:r.length,skill_hub:r.filter(o=>o.category==="skill_hub").length,skill_space:r.filter(o=>o.category==="skill_space").length,knowledge_base:r.filter(o=>o.category==="knowledge_base").length,tool:r.filter(o=>o.category==="tool").length}}}function $_t(e,t){return{resources:e.resources.filter(n=>n.category===t),sources:e.sources.filter(n=>n.category===t)}}function bLe(e,t,n=gLe){const i=u9(e),r=u9(t),s=new Map(ud(r.results).flatMap(d=>{const f=ju(d),h=Vn(f==null?void 0:f.name);return f&&h?[[h,f]]:[]})),o=ud(i.agents).flatMap(d=>{const f=ju(d),h=Vn(f==null?void 0:f.name);return f&&h?[f]:[]}),l=new Set(o.map(d=>Vn(d.name))),c=[...s.entries()].filter(([d])=>!l.has(d)).map(([d])=>({name:d})),u=[...o,...c].map(d=>{const f=Vn(d.name),h=ud(d.nodes).flatMap(C=>{const E=ju(C);return E?[E]:[]}),m=Vn(d.root_node),g=h.find(C=>Vn(C.id)===m),b=h.filter(C=>Vn(C.id)!==m).map(C=>({id:Vn(C.id)||n.unnamedAgent,type:Vn(C.type)||"llm",description:Vn(C.description)})),v=s.get(f),y=Vn(v==null?void 0:v.status),w=y==="failed"?"failed":y==="completed"?"completed":"running",x=$ne(v==null?void 0:v.resources),O=x.length>0?x:$ne(h.flatMap(C=>ud(C.resources))),k=Fne(v==null?void 0:v.python_tools),S=k.length>0?k:Fne(h.flatMap(C=>ud(C.python_tools)));return{name:f,description:Vn(v==null?void 0:v.description)||Vn(g==null?void 0:g.description)||Vn(d.task),task:Vn(d.task),rootType:Vn(v==null?void 0:v.root_type)||Vn(g==null?void 0:g.type)||"llm",nodeCount:h.length,subAgentCount:b.length,resourceCount:O.length,pythonToolCount:S.length,skills:O.filter(C=>C.kind==="skill"),knowledgeBases:O.filter(C=>C.kind==="knowledge_base"),builtinTools:O.filter(C=>C.kind==="tool"),pythonTools:S,subAgents:b,status:w,output:Vn(v==null?void 0:v.output),error:Vn(v==null?void 0:v.error)}});return{collectionId:Vn(r.collection_id)||Vn(i.collection_id),agents:u,completedCount:u.filter(d=>d.status==="completed").length,failedCount:u.filter(d=>d.status==="failed").length,runningCount:u.filter(d=>d.status==="running").length}}function F_t(e,t){return!!DM(t)||bLe(e,t).failedCount>0}function $ne(e){const t=new Set;return ud(e).flatMap(n=>{const i=ju(n),r=Vn(i?i.ref:n);if(!r||t.has(r))return[];t.add(r);const s=Vn(i==null?void 0:i.kind),o=s==="tool"||r.startsWith("veadk_tool:")?"tool":s==="knowledge_base"||r.startsWith("agentkit_kb:")?"knowledge_base":"skill",l=r.split(":");return[{ref:r,kind:o,name:Vn(i==null?void 0:i.name)||l[l.length-1]||r,description:Vn(i==null?void 0:i.description),version:Vn(i==null?void 0:i.version),source:Vn(i==null?void 0:i.source)}]})}function Fne(e){const t=new Set;return ud(e).flatMap(n=>{const i=ju(n),r=Vn(i==null?void 0:i.name),s=Vn(i==null?void 0:i.code),o=`${r}\0${s}`;return!i||!r||t.has(o)?[]:(t.add(o),[{name:r,description:Vn(i.description),code:s,entrypoint:Vn(i.entrypoint)||r,dependencies:ud(i.dependencies).map(Vn).filter(Boolean)}])})}function B_t({branch:e}){return a.jsxs("div",{className:`branch-compare__body${e.status==="running"?" is-streaming":""}`,"aria-live":"polite",children:[e.content?a.jsx(_d,{text:e.content,streaming:e.status==="running"}):null,e.status==="running"?a.jsx("span",{className:"branch-compare__caret","aria-hidden":"true"}):null,e.error?a.jsx("p",{className:"branch-compare__error",children:e.error}):null]})}function U_t({args:e,response:t,status:n,onBranchSelect:i}){const{t:r}=Te("conversation"),s=p.useMemo(()=>Vje(e,t,n),[e,t,n]),[o,l]=p.useState(0);return a.jsxs("section",{className:"branch-compare","aria-label":r("blocks.branchCompare.ariaLabel"),children:[a.jsx("div",{className:"branch-compare__tabs",role:"tablist","aria-label":r("blocks.branchCompare.selectDirection"),children:s.branches.map((c,u)=>a.jsx("button",{className:`branch-compare__tab${o===u?" is-active":""}`,type:"button",role:"tab","aria-selected":o===u,"aria-controls":`branch-compare-panel-${u}`,onClick:()=>l(u),children:a.jsx(Ya,{color:"info",size:"sm",variant:"soft",children:c.label})},`${c.label}:${u}`))}),a.jsx("div",{className:"branch-compare__branches",children:s.branches.map((c,u)=>a.jsxs("article",{className:`branch-compare__branch${o===u?" is-active":""}`,id:`branch-compare-panel-${u}`,role:"tabpanel",children:[a.jsx("header",{className:"branch-compare__head",children:a.jsx(Ya,{color:"info",size:"sm",variant:"soft",children:c.label})}),a.jsx(B_t,{branch:c}),a.jsx("footer",{className:"branch-compare__footer",children:a.jsx(Tt,{type:"button",color:"info",variant:"ghost",size:"sm",pill:!1,disabled:c.status!=="completed",onClick:()=>i==null?void 0:i(c),children:r("blocks.branchCompare.continue")})})]},`${c.label}:${u}`))})]})}function yLe({controlled:e,default:t,name:n,state:i="value"}){const{current:r}=p.useRef(e!==void 0),[s,o]=p.useState(t),l=r?e:s,c=p.useCallback(u=>{r||o(u)},[]);return[l,c]}const vLe=p.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function Q_t(){return p.useContext(vLe)}function z_t(e){const{children:t,elementsRef:n,labelsRef:i,onMapChange:r}=e,s=li(r),[,o]=p.useState(!1),l=Cd(H_t).current,c=Cd(V_t).current,u=p.useRef(0),d=p.useRef(!0),f=p.useRef([]),h=p.useRef(null),m=li(()=>{d.current||(d.current=!0,o(k=>!k))}),g=li((k,S)=>{c.set(k,S),m()}),b=li(k=>{c.delete(k),m()}),v=li(k=>{const S=new Map;return n.current.length=0,i&&(i.current.length=0),k.forEach(C=>{var E,j;S.set(C.element,{...C.registration.metadata??{},index:C.index}),n.current[C.index]=C.element,i&&(i.current[C.index]=C.registration.label!==void 0?C.registration.label:((j=(E=C.registration.textRef)==null?void 0:E.current)==null?void 0:j.textContent)??C.element.textContent)}),u.current=n.current.length,S});function y(k){var E;if((E=h.current)==null||E.disconnect(),h.current=null,typeof MutationObserver!="function"||k.length<2)return;const S=new MutationObserver(j=>{if(!K_t(j))return;let T=null;for(const R of k)if(R.isConnected){if(T&&xLe(T,R)>0){S.disconnect(),m();return}T=R}});h.current=S;const C=new Set;for(let j=1;jS.observe(j,{childList:!0}))}const w=li(()=>{const[k,S]=q_t(c),C=v(k);y(S),f.current=k,d.current=!1,l.forEach(E=>E(C)),s(C)});Jn(()=>(d.current||v(f.current),()=>{n.current=[],i&&(i.current=[])}),[n,i,v]),Jn(()=>{d.current&&w()}),Jn(()=>()=>{var k;(k=h.current)==null||k.disconnect(),d.current=!0},[]);const x=li(k=>(l.add(k),()=>{l.delete(k)})),O=p.useMemo(()=>({register:g,unregister:b,subscribeMapChange:x,nextIndexRef:u}),[g,b,x,u]);return a.jsx(vLe.Provider,{value:O,children:t})}function V_t(){return new Map}function H_t(){return new Set}function q_t(e){const t=new Set,n=[],i=[];e.forEach((s,o)=>{if(!o.isConnected)return;const l=s.index,c={index:l??-1,element:o,registration:s};l===null?i.push(c):l>=0&&(t.add(l),n.push(c))});let r=0;return i.sort((s,o)=>xLe(s.element,o.element)),i.forEach(s=>{for(;t.has(r);)r+=1;s.index=r,n.push(s),r+=1}),t.size>0&&n.sort((s,o)=>s.index-o.index),[n,i.map(s=>s.element)]}function W_t(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function K_t(e){for(const t of e)for(let n=0;nnull},kLe=p.forwardRef(function(t,n){const{render:i,className:r,disabled:s=!1,hiddenUntilFound:o,keepMounted:l,loopFocus:c,onValueChange:u,multiple:d=!1,orientation:f="vertical",value:h,defaultValue:m,style:g,...b}=t,v=p.useMemo(()=>{if(h===void 0)return m??[]},[h,m]),y=p.useRef([]),[w,x]=yLe({controlled:h,default:v,name:"Accordion",state:"value"}),O=li((E,j,T)=>{if(d)if(j){const R=w.slice();if(R.push(E),u==null||u(R,T),T.isCanceled)return;x(R)}else{const R=w.filter(A=>A!==E);if(u==null||u(R,T),T.isCanceled)return;x(R)}else{const R=w[0]===E?[]:[E];if(u==null||u(R,T),T.isCanceled)return;x(R)}}),k=p.useMemo(()=>({value:w,disabled:s,orientation:f}),[w,s,f]),S=p.useMemo(()=>({disabled:s,handleValueChange:O,hiddenUntilFound:o??!1,keepMounted:l??!1,state:k,value:w}),[s,O,o,l,k,w]),C=Pa("div",t,{state:k,ref:n,props:b,stateAttributesMapping:G_t});return a.jsx(wLe.Provider,{value:S,children:a.jsx(z_t,{elementsRef:y,children:C})})});function X_t(e){const{open:t,defaultOpen:n,onOpenChange:i,disabled:r}=e,[s,o]=yLe({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:l,setMounted:c,transitionStatus:u}=tje(s,!0,!0),d=nm(),[f,h]=p.useState(),m=f===null?void 0:f??d,g=li(b=>{const v=!s,y=ha(Gw,b.nativeEvent);i(v,y),!y.isCanceled&&o(v)});return p.useMemo(()=>({defaultPanelId:d,disabled:r,handleTrigger:g,mounted:l,open:s,panelId:m,setMounted:c,setOpen:o,setPanelIdState:h,transitionStatus:u}),[d,r,g,l,s,m,c,o,h,u])}const SLe=p.createContext(void 0);function ELe(){const e=p.useContext(SLe);if(e===void 0)throw new Error(Vc(15));return e}function Y_t(e={}){const{guess:t,label:n,metadata:i,textRef:r,index:s}=e,{register:o,unregister:l,subscribeMapChange:c,nextIndexRef:u}=Q_t(),d=p.useRef(-1),[f,h]=p.useState(s==null&&t?()=>{if(d.current===-1){const v=u.current;u.current+=1,d.current=v}return d.current}:-1),m=s??f,g=p.useRef(null),b=p.useCallback(v=>{const y=g.current;y&&l(y),g.current=v,v&&o(v,{metadata:i??null,index:s??null,label:n,textRef:r})},[s,o,l,i,n,r]);return Jn(()=>{if(s==null)return c(v=>{var w;const y=g.current?(w=v.get(g.current))==null?void 0:w.index:null;y!=null&&h(y)})},[s,c]),{ref:b,index:m}}const CLe=p.createContext(void 0);function fq(){const e=p.useContext(CLe);if(e===void 0)throw new Error(Vc(9));return e}let hq=function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=aI.startingStyle]="startingStyle",e[e.endingStyle=aI.endingStyle]="endingStyle",e}({}),Z_t=function(e){return e.panelOpen="data-panel-open",e}({});const J_t={[hq.open]:""},ejt={[hq.closed]:""},tjt={open(e){return e?{[Z_t.panelOpen]:""}:null}},njt={open(e){return e?J_t:ejt}};let ijt=function(e){return e.index="data-index",e.disabled="data-disabled",e.open="data-open",e}({});const pq={...njt,index:e=>({[ijt.index]:String(e)}),...WD,value:()=>null},ALe=p.forwardRef(function(t,n){const{className:i,disabled:r=!1,onOpenChange:s,render:o,value:l,style:c,...u}=t,{ref:d,index:f}=Y_t(),h=Kw(n,d),{disabled:m,handleValueChange:g,state:b,value:v}=OLe(),y=nm(),w=l??y,x=r||m,O=v.indexOf(w)!==-1,k=li((D,_)=>{s==null||s(D,_),!_.isCanceled&&g(w,D,_)}),S=X_t({open:O,onOpenChange:k,disabled:x}),C=p.useMemo(()=>({open:S.open,disabled:S.disabled,transitionStatus:S.transitionStatus}),[S.open,S.disabled,S.transitionStatus]),E=p.useMemo(()=>({...S,onOpenChange:k,state:C}),[S,C,k]),j=p.useMemo(()=>({...b,hidden:!O&&!S.mounted,index:f,disabled:x,open:O}),[S.mounted,x,f,O,b]),T=nm(),[R,A]=p.useState(),N=R===null?void 0:R??T,P=p.useMemo(()=>({defaultTriggerId:T,open:O,state:j,setTriggerId:A,triggerId:N}),[T,O,j,A,N]),I=Pa("div",t,{state:j,ref:h,props:u,stateAttributesMapping:pq});return a.jsx(SLe.Provider,{value:E,children:a.jsx(CLe.Provider,{value:P,children:I})})}),TLe=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...o}=t,{state:l}=fq();return Pa("h3",t,{state:l,ref:n,props:o,stateAttributesMapping:pq})}),_Le=p.forwardRef(function(t,n){const{disabled:i,className:r,id:s,render:o,nativeButton:l=!0,style:c,...u}=t,{panelId:d,open:f,handleTrigger:h,disabled:m}=ELe(),g=i||m,{getButtonProps:b,buttonRef:v}=KD({disabled:g,focusableWhenDisabled:!0,native:l}),{defaultTriggerId:y,state:w,setTriggerId:x}=fq(),O=s||void 0,k=O??y;return Jn(()=>(x(E=>O??(E===null?void 0:E)),()=>{x(E=>E===O?null:E)}),[O,x]),Pa("button",t,{state:w,ref:[n,v],props:[{"aria-controls":f?d:void 0,"aria-expanded":f,id:k,onClick:h},u,b],stateAttributesMapping:tjt})}),mk={height:void 0,width:void 0};function rjt(e){const{externalRef:t,hiddenUntilFound:n,id:i,keepMounted:r,mounted:s,onOpenChange:o,open:l,setMounted:c,setOpen:u,transitionStatus:d}=e,f=p.useRef(null),h=p.useRef(null),[m,g]=p.useState(mk),b=p.useRef(mk),v=p.useRef(!1),y=p.useRef(l),w=p.useRef(!1),[x,O]=p.useState(!1),k=p.useRef(null),S=Kw(t,f),C=ec(l),E=rV(f),j=!l&&!s,T=x?"idle":d,R=l&&(y.current||w.current),A=!l&&s&&h.current==="css-animation"&&m.height===void 0&&m.width===void 0?b.current:m,N=n&&j&&h.current!=="css-animation",P=li((F,M=!0)=>{M&&(b.current=F),g(F)}),I=li(()=>{var F;(F=k.current)==null||F.call(k),k.current=null}),D=li(F=>{I(),k.current=()=>{k.current=null,F()}}),_=li(()=>{l&&s&&h.current==="css-animation"&&(w.current=!0)});Jn(()=>{!x||d==="starting"||O(!1)},[x,d]),p.useEffect(()=>()=>{_(),I()},[_,I]),Jn(()=>{const F=f.current;if(!F)return;!l&&k.current&&I();const M=sjt(F,R);if(h.current=M,l&&d==="idle"&&y.current&&M==="css-animation"){b.current=$v(F);return}if(l&&d==="starting"){const U=v.current;if(v.current=!1,M==="none"){P($v(F)),O(!0);return}if(M==="css-transition"){const Z=ajt(F);if(P($v(F)),!U)return Z;const ne=j_(F,"transition-duration","0s");return D(ne),O(!0),Z}P($v(F));const J=j_(F,"animation-name","none");if(!U){J();return}const V=j_(F,"animation-duration","0s");J(),D(V),O(!0);return}if(!l&&s&&(d==="idle"||d==="starting")){if(y.current=!1,w.current=!1,M==="none"){P(mk,!1),c(!1);return}P($v(F));return}if(d!=="ending")return;if(M==="none"){c(!1);return}const z=$v(F);if(!(z.height>0||z.width>0)){c(!1);return}P(z),M==="css-animation"&&j_(F,"animation-name","none")()},[s,l,I,P,c,D,R,d]),$A({enabled:l&&s&&T==="idle",open:!0,ref:f,onComplete(){l&&P(mk,!1)}}),p.useEffect(()=>{if(l||!s||T!=="ending"||!f.current)return;const M=new AbortController;let z=-1;function q(){C.current||(c(!1),P(mk,!1))}return z=_c.request(()=>{E(q,M.signal)}),()=>{_c.cancel(z),M.abort()}},[C,s,l,T,E,P,c]),Jn(()=>{const F=f.current;!F||!n||!j||F.setAttribute("hidden","until-found")},[j,n]),p.useEffect(function(){const M=f.current;if(!M)return;function z(q){const U=ha(E_e,q);o(!0,U),!U.isCanceled&&(v.current=!0,u(!0))}return Ni(M,"beforematch",z)},[o,u]);const L=r||n||s||l;return{height:A.height,props:{...N?{[hq.startingStyle]:""}:void 0,hidden:j,id:i},ref:S,shouldPreventOpenAnimation:R,shouldRender:L,transitionStatus:T,width:A.width}}function $v(e){return{height:e.scrollHeight,width:e.scrollWidth}}function sjt(e,t){const n=na(e).getComputedStyle(e),i=(n.animationName.split(",").map(s=>s.trim()).some(s=>s!==""&&s!=="none")||t)&&Bne(n.animationDuration),r=Bne(n.transitionDuration);return i&&r||r?"css-transition":i?"css-animation":"none"}function Bne(e){return e.split(",").map(t=>t.trim()).some(t=>t!==""&&Number.parseFloat(t)>0)}function j_(e,t,n){const i=e.style.getPropertyValue(t),r=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(i===""){e.style.removeProperty(t);return}e.style.setProperty(t,i,r)}}function ajt(e){const t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(r=>{e.style.setProperty(r,"initial","important")});function n(){Object.entries(t).forEach(([r,s])=>{if(s===""){e.style.removeProperty(r);return}e.style.setProperty(r,s)})}const i=_c.request(n);return()=>{_c.cancel(i),n()}}let Une=function(e){return e.accordionPanelHeight="--accordion-panel-height",e.accordionPanelWidth="--accordion-panel-width",e}({});const jLe=p.forwardRef(function(t,n){const{className:i,hiddenUntilFound:r,keepMounted:s,id:o,render:l,style:c,...u}=t,{hiddenUntilFound:d,keepMounted:f}=OLe(),{defaultPanelId:h,mounted:m,onOpenChange:g,open:b,setMounted:v,setOpen:y,setPanelIdState:w,transitionStatus:x}=ELe(),O=r??d,k=s??f,S=o||void 0,C=o??h;Jn(()=>(w(M=>S??(M===null?void 0:M)),()=>{w(M=>M===S?null:M)}),[S,w]);const{height:E,props:j,ref:T,shouldPreventOpenAnimation:R,shouldRender:A,transitionStatus:N,width:P}=rjt({externalRef:n,hiddenUntilFound:O,id:C,keepMounted:k,mounted:m,onOpenChange:g,open:b,setMounted:v,setOpen:y,transitionStatus:x}),{state:I,triggerId:D}=fq(),_={...I,transitionStatus:N},L=m_e(c,_),F=Pa("div",{...t,style:void 0},{state:_,ref:T,props:[j,{"aria-labelledby":D,role:"region",style:{[Une.accordionPanelHeight]:E===void 0?"auto":`${E}px`,[Une.accordionPanelWidth]:P===void 0?"auto":`${P}px`}},u,L?{style:L}:void 0,R?{style:{animationName:"none"}}:void 0],stateAttributesMapping:pq});return A?F:null}),ojt=(e,t)=>{const n=e.currentTarget,i={x:e.clientX,y:e.clientY},r=ljt(i,n.getBoundingClientRect()),s=cjt(i,r),o=ujt(t.getBoundingClientRect());return fjt([...s,...o])};function ljt(e,t){const n=Math.abs(t.top-e.y),i=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,i,r,s)){case s:return"left";case r:return"right";case n:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function cjt(e,t,n=5){const i=[];switch(t){case"top":i.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":i.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":i.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":i.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return i}function ujt(e){const{top:t,right:n,bottom:i,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:i},{x:r,y:i}]}function djt(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,o=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}function fjt(e){const t=e.slice();return t.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),hjt(t)}function hjt(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i=2;){const s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let i=e.length-1;i>=0;i--){const r=e[i];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const pjt="_Transition_1wdpp_1",mjt="_Popover_1wdpp_3",NLe={Transition:pjt,Popover:mjt},RLe=p.createContext(null),MM=()=>{const e=p.use(RLe);if(!e)throw new Error("Popover components must be wrapped in ");return e},$g=({open:e,onOpenChange:t,showOnHover:n=!1,hoverOpenDelay:i=150,children:r})=>{const[s,o]=p.useState(!1),[l,c]=p.useState(!1),u=p.useRef(null),d=p.useRef(null),f=p.useRef(void 0),h=p.useRef(!1),m=p.useRef(!1),g=e??s,[b,v]=p.useState(!1);OV(()=>v(!1),b?500:null);const y=sb(t),w=sb(C=>{var E,j;clearTimeout(f.current),g!==C&&(C||(c(!1),n&&h.current&&((E=u.current)==null||E.focus()),h.current=!1),(j=y.current)==null||j.call(y,C),o(C),n&&v(C))}),x=p.useCallback(C=>{w.current(C)},[w]),O=p.useCallback(()=>{f.current=setTimeout(()=>x(!0),i)},[x,i]),k=p.useCallback(()=>{clearTimeout(f.current)},[]);p.useEffect(()=>()=>{clearTimeout(f.current)},[]);const S=p.useMemo(()=>({open:g,setOpen:x,shake:l,setShake:c,showOnHover:n,temporarilyPreventClickToClose:b,onTriggerEnter:O,onTriggerLeave:k,isPointerInTransitRef:m,triggerRef:u,contentRef:d,hoverOpenFocusedWithTab:h}),[g,x,l,c,n,b,h,m,O,k]);return a.jsx(RLe,{value:S,children:a.jsx(IRe,{open:g,onOpenChange:x,modal:!1,children:r})})},gjt=({children:e,onPointerDown:t,onClick:n})=>{const{setOpen:i,showOnHover:r,temporarilyPreventClickToClose:s,onTriggerEnter:o,onTriggerLeave:l,isPointerInTransitRef:c,triggerRef:u,contentRef:d}=MM(),f=p.useRef(!1),h=b=>{!(b.currentTarget.nodeName.toLocaleLowerCase()==="a")&&s&&(b.preventDefault(),b.stopPropagation())},m=b=>{b.pointerType!=="touch"&&!f.current&&!c.current&&(o(),f.current=!0)},g=()=>{f.current&&(l(),f.current=!1)};return a.jsx(PRe,{asChild:!0,ref:u,onPointerDown:b=>{h(b),t==null||t(b)},onClick:b=>{h(b),n==null||n(b)},onPointerMove:r?m:void 0,onPointerLeave:r?g:void 0,onFocus:r?()=>i(!0):void 0,onBlur:r?()=>{setTimeout(()=>{var b;(b=d.current)!=null&&b.contains(document.activeElement)||i(!1)},50)}:void 0,children:e})},ILe=({children:e,avoidCollisions:t,width:n,minWidth:i,maxWidth:r,side:s,sideOffset:o=8,align:l,alignOffset:c,translucent:u,className:d,autoFocus:f=!0})=>{const{showOnHover:h,shake:m,contentRef:g}=MM(),b=v=>{const y=g.current;if(y&&v.target===y&&v.key==="Tab"&&v.shiftKey){v.preventDefault(),v.stopPropagation();const w=sNe(y),x=w[w.length-1];x==null||x.focus()}};return p.useEffect(()=>{const v=g.current;!v||!f||v!=null&&v.contains(document.activeElement)||h||v.focus({preventScroll:!0})},[g,h,f]),a.jsx(MRe,{forceMount:!0,ref:g,className:Qi(NLe.Popover,d),style:B0({"popover-width":n,"popover-min-width":i,"popover-max-width":r}),onCloseAutoFocus:h?Lp:void 0,"data-animate":m?"shake":void 0,"data-translucent":u?"true":void 0,side:s,sideOffset:o,align:l,alignOffset:c??(l==="center"?0:-5),avoidCollisions:t??!0,hideWhenDetached:!0,collisionPadding:20,onOpenAutoFocus:Lp,onEscapeKeyDown:Lp,onKeyDown:b,children:e})},bjt=e=>{const{setOpen:t,triggerRef:n,contentRef:i,isPointerInTransitRef:r,hoverOpenFocusedWithTab:s}=MM(),[o,l]=p.useState(null),c=p.useCallback(()=>{l(null),r.current=!1},[r]),u=p.useCallback((d,f)=>{const h=ojt(d,f);l(h),r.current=!0},[r]);return p.useEffect(()=>()=>c(),[c]),p.useEffect(()=>{const d=n.current,f=i.current;if(!d||!f)return;const h=g=>u(g,f),m=g=>u(g,d);return d.addEventListener("pointerleave",h),f.addEventListener("pointerleave",m),()=>{d.removeEventListener("pointerleave",h),f.removeEventListener("pointerleave",m)}},[i,n,u,c]),p.useEffect(()=>{if(!o)return;const d=f=>{const h=n.current,m=i.current,g=f.target,b={x:f.clientX,y:f.clientY},v=(h==null?void 0:h.contains(g))||(m==null?void 0:m.contains(g)),y=!djt(b,o),w=g.hasAttribute("aria-haspopup");v?c():(y||w)&&(c(),t(!1))};return document.addEventListener("pointermove",d),()=>document.removeEventListener("pointermove",d)},[o,t,c,n,i]),p.useEffect(()=>{const d=f=>{if(i.current&&f.key==="Tab"&&!f.shiftKey){const[h]=sNe(i.current);h&&(f.preventDefault(),h.focus(),s.current=!0,document.removeEventListener("keydown",d))}};return document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d)}},[i,s]),a.jsx(ILe,{...e})},yjt=e=>{const{open:t,showOnHover:n,setOpen:i}=MM();return KA(t,()=>{i(!1)}),a.jsx(DRe,{forceMount:!0,children:a.jsx(G1,{enterDuration:600,exitDuration:300,className:NLe.Transition,disableAnimations:!0,children:t&&(n?a.jsx(bjt,{...e},"popover-hover"):a.jsx(ILe,{...e},"popover"))})})};$g.Trigger=gjt;$g.Content=yjt;const vjt=["skill_hub","skill_space","knowledge_base","tool"];function PLe(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m4 6 4 4 4-4"})})}function DLe({label:e}){return a.jsx("div",{className:"create-agent-card__loading",role:"status","aria-label":e,children:[0,1,2].map(t=>a.jsxs("div",{className:"create-agent-card__skeleton-row","aria-hidden":"true",children:[a.jsx("span",{}),a.jsx("span",{})]},t))})}function xjt(e,t){return e.kind==="tool"?t("blocks.createAgents.builtinTool"):e.kind==="knowledge_base"?t("blocks.createAgents.knowledgeBase"):e.source.startsWith("skill_hub:")?"Skill Hub":e.source.startsWith("skill_space:")?t("blocks.createAgents.skillCenter"):"Skill"}function L4({label:e,resources:t}){const{t:n}=Te("conversation");return t.length===0?null:a.jsxs("section",{className:"create-agent-card__popover-section",children:[a.jsx("h4",{children:e}),a.jsx("div",{className:"create-agent-card__popover-list",children:t.map(i=>a.jsxs("div",{className:"create-agent-card__popover-item",children:[a.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[a.jsx("strong",{children:i.name}),a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",children:xjt(i,n)})]}),i.description?a.jsx("p",{children:i.description}):null]},i.ref))})]})}function wjt({tools:e}){const{t}=Te("conversation");return e.length===0?null:a.jsxs("section",{className:"create-agent-card__popover-section",children:[a.jsx("h4",{children:t("blocks.createAgents.selfAuthoredTools")}),a.jsx(kLe,{children:e.map((n,i)=>a.jsxs(ALe,{className:"create-agent-card__python-tool",value:`${n.name}:${i}`,children:[a.jsx(TLe,{className:"create-agent-card__python-tool-header",children:a.jsxs(_Le,{className:"create-agent-card__python-tool-trigger",children:[a.jsxs("span",{children:[a.jsx("strong",{children:n.name}),n.description?a.jsx("small",{children:n.description}):null]}),a.jsxs("span",{className:"create-agent-card__python-tool-meta",children:[a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",children:t("blocks.createAgents.selfAuthoredTools")}),a.jsx(PLe,{className:"create-agent-card__python-tool-chevron"})]})]})}),a.jsxs(jLe,{className:"create-agent-card__python-tool-panel",children:[n.dependencies.length>0?a.jsx("div",{className:"create-agent-card__python-tool-dependencies",children:t("blocks.createAgents.dependencies",{items:n.dependencies.join(", ")})}):null,a.jsx("pre",{tabIndex:0,"aria-label":t("blocks.createAgents.fullCode",{name:n.name}),children:a.jsx("code",{children:n.code})})]})]},`${n.name}:${i}`))})]})}function Ojt({agents:e}){const{t}=Te("conversation");return e.length===0?null:a.jsxs("section",{className:"create-agent-card__popover-section",children:[a.jsx("h4",{children:t("blocks.createAgents.subAgents")}),a.jsx("div",{className:"create-agent-card__popover-list",children:e.map(n=>a.jsxs("div",{className:"create-agent-card__popover-item",children:[a.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[a.jsx("strong",{children:n.id}),a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",children:t(`blocks.createAgents.agentTypes.${n.type}`,{defaultValue:n.type})})]}),n.description?a.jsx("p",{children:n.description}):null]},n.id))})]})}function N_({label:e,count:t,icon:n,children:i}){const{t:r}=Te("conversation"),s=a.jsxs("button",{className:"create-agent-card__resource-metric",type:"button",disabled:t===0,"aria-label":r("blocks.createAgents.itemCount",{label:e,count:t}),children:[n,a.jsx("span",{children:t})]});return t===0?s:a.jsxs($g,{showOnHover:!0,hoverOpenDelay:120,children:[a.jsx($g.Trigger,{children:s}),a.jsx($g.Content,{side:"top",align:"start",minWidth:"auto",maxWidth:360,className:"create-agent-card__resource-popover",children:i})]})}function kjt({response:e,status:t}){const{t:n}=Te("conversation"),i=p.useMemo(()=>({tool:n("blocks.createAgents.sourceLabels.tool"),knowledge:n("blocks.createAgents.sourceLabels.knowledge"),skillCenter:n("blocks.createAgents.sourceLabels.skillCenter"),unknownSource:n("blocks.createAgents.sourceLabels.unknown"),unnamedResource:n("blocks.createAgents.unnamedResource"),unnamedAgent:n("blocks.createAgents.unnamedAgent")}),[n]),r=p.useMemo(()=>L_t(e,i),[i,e]),s=p.useMemo(()=>vjt.map(c=>{const u=$_t(r,c);return{value:c,label:n(`blocks.createAgents.categories.${c}`),...u,searchKeywords:[...new Set(u.sources.flatMap(d=>d.searchKeywords))]}}),[r,n]),o=t==="failed",l=o?DM(e):"";return a.jsx("section",{className:"create-agent-tool-card","aria-label":n("blocks.createAgents.collectionAria"),children:t==="running"?a.jsx(DLe,{label:n("blocks.createAgents.retrieving")}):o?a.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[a.jsx("span",{className:"create-agent-card__message-title",children:n("blocks.createAgents.retrievalFailed")}),a.jsx("span",{children:l||n("blocks.createAgents.checkConfig")})]}):a.jsx(kLe,{className:"create-agent-card__accordion",children:s.map(c=>a.jsxs(ALe,{className:"create-agent-card__accordion-item",value:c.value,children:[a.jsx(TLe,{className:"create-agent-card__accordion-header",children:a.jsxs(_Le,{className:"create-agent-card__accordion-trigger",children:[a.jsx("span",{children:c.label}),a.jsxs("span",{className:"create-agent-card__accordion-meta",children:[a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",children:c.sources.length===0?c.value==="skill_hub"?n("blocks.createAgents.notSearched"):n("blocks.createAgents.notConfigured"):c.resources.length}),a.jsx(PLe,{className:"create-agent-card__accordion-chevron"})]})]})}),a.jsx(jLe,{className:"create-agent-card__accordion-content",children:a.jsxs("div",{className:"create-agent-card__accordion-scroll",role:"region","aria-label":n("blocks.createAgents.resourceList",{label:c.label}),tabIndex:0,children:[c.value==="skill_hub"&&c.searchKeywords.length>0?a.jsxs("div",{className:"create-agent-card__search-keywords",children:[a.jsx("span",{children:n("blocks.createAgents.searchKeywords")}),a.jsx("span",{children:c.searchKeywords.join("、")})]}):null,c.resources.length>0?a.jsx("div",{className:"create-agent-card__resource-list",children:c.resources.map(u=>a.jsx("div",{className:"create-agent-card__resource",children:a.jsxs("div",{className:"create-agent-card__resource-main",children:[a.jsxs("div",{className:"create-agent-card__resource-title",children:[a.jsx("span",{className:"create-agent-card__resource-name",children:u.name}),u.version?a.jsx(Ya,{className:"create-agent-card__resource-version",color:"secondary",size:"sm",variant:"soft",children:u.version}):null]}),u.description?a.jsx("p",{children:u.description}):null]})},u.ref))}):a.jsxs("div",{className:"create-agent-card__empty-category",children:[a.jsx("p",{children:c.sources.length===0?c.value==="skill_hub"?n("blocks.createAgents.skillHubSkipped"):n("blocks.createAgents.sourceSkipped",{label:c.label}):n("blocks.createAgents.noResources")}),c.sources.filter(u=>u.message).map(u=>a.jsx("p",{className:"create-agent-card__raw-source-error",children:u.message},u.source))]})]})})]},c.value))},r.collectionId||"collected-resources")})}function Sjt({args:e,response:t,status:n}){const{t:i}=Te("conversation"),r=p.useMemo(()=>({tool:i("blocks.createAgents.sourceLabels.tool"),knowledge:i("blocks.createAgents.sourceLabels.knowledge"),skillCenter:i("blocks.createAgents.sourceLabels.skillCenter"),unknownSource:i("blocks.createAgents.sourceLabels.unknown"),unnamedResource:i("blocks.createAgents.unnamedResource"),unnamedAgent:i("blocks.createAgents.unnamedAgent")}),[i]),s=p.useMemo(()=>bLe(e,t,r),[e,r,t]),o=n==="failed"?DM(t):"";return a.jsxs("section",{className:"create-agent-tool-card is-agent-results","aria-label":i("blocks.createAgents.resultAria"),children:[o?a.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[a.jsx("span",{className:"create-agent-card__message-title",children:i("blocks.createAgents.creationFailed")}),a.jsx("span",{children:o})]}):null,s.agents.length>0?a.jsx("div",{className:"create-agent-card__agent-grid",children:s.agents.map(l=>{const c=n==="failed"?"failed":l.status,u=l.error||c==="failed"&&o,d=l.builtinTools.length+l.pythonTools.length;return a.jsxs(vH,{className:`create-agent-card__agent-card${u?" is-error":""}`,children:[a.jsx(xH,{leading:a.jsx(Jw,{seed:l.name}),title:l.name,titleText:l.name,status:a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",children:i(`blocks.createAgents.agentTypes.${l.rootType}`,{defaultValue:l.rootType})})}),l.description?a.jsx(wH,{children:l.description}):null,u?a.jsx("div",{className:"create-agent-card__agent-result is-error",role:"alert",children:u}):null,a.jsxs("div",{className:"create-agent-card__agent-resources","aria-label":i("blocks.createAgents.agentResources",{name:l.name}),children:[a.jsx(N_,{label:i("blocks.createAgents.skill"),count:l.skills.length,icon:a.jsx(pN,{"aria-hidden":"true"}),children:a.jsx(L4,{label:i("blocks.createAgents.skill"),resources:l.skills})}),a.jsx(N_,{label:i("blocks.createAgents.knowledgeBase"),count:l.knowledgeBases.length,icon:a.jsx(mIe,{"aria-hidden":"true"}),children:a.jsx(L4,{label:i("blocks.createAgents.knowledgeBase"),resources:l.knowledgeBases})}),a.jsxs(N_,{label:i("blocks.createAgents.toolsLabel"),count:d,icon:a.jsx(pat,{"aria-hidden":"true"}),children:[a.jsx(L4,{label:i("blocks.createAgents.builtinTool"),resources:l.builtinTools}),a.jsx(wjt,{tools:l.pythonTools})]}),a.jsx(N_,{label:i("blocks.createAgents.subAgents"),count:l.subAgentCount,icon:a.jsx(gat,{"aria-hidden":"true"}),children:a.jsx(Ojt,{agents:l.subAgents})})]})]},l.name)})}):n==="running"?a.jsx(DLe,{label:i("blocks.createAgents.creating")}):a.jsxs("div",{className:"create-agent-card__message",children:[a.jsx("span",{className:"create-agent-card__message-title",children:i("blocks.createAgents.noAgents")}),a.jsx("span",{children:i("blocks.createAgents.noAgentResult")})]})]})}const Ejt={web_search:{name:"web_search",runningLabel:"Searching the web",doneLabel:"Web search complete",tone:"search",icon:Pne},link_reader:{name:"link_reader",runningLabel:"Reading webpage",doneLabel:"Webpage read complete",tone:"search",icon:Pne},run_code:{name:"run_code",runningLabel:"Running code in the AgentKit sandbox",doneLabel:"Code execution completed in the AgentKit sandbox",tone:"sandbox",icon:m_t},list_envs:{name:"list_envs",runningLabel:"Checking available environments",doneLabel:"Available environments loaded",tone:"resources",icon:b_t},get_env_manifest:{name:"get_env_manifest",runningLabel:"Loading the environment manifest",doneLabel:"Environment manifest loaded",tone:"knowledge",icon:y_t},execute_in_sandbox:{name:"execute_in_sandbox",runningLabel:"Running a command in the environment",doneLabel:"Command completed in the environment",tone:"sandbox",icon:Mne},delegate_to_codex_sandbox:{name:"delegate_to_codex_sandbox",runningLabel:"Codex Sandbox is running",doneLabel:"Codex Sandbox completed",failedLabel:"Codex Sandbox failed",tone:"sandbox",icon:Mne},image_generate:{name:"image_generate",runningLabel:"Generating image",doneLabel:"Image generated",tone:"image",icon:u_t},video_generate:{name:"video_generate",runningLabel:"Generating video",doneLabel:"Video generated",tone:"video",icon:lq},ppt_generate:{name:"ppt_generate",runningLabel:"Generating presentation",doneLabel:"Presentation generated",tone:"presentation",icon:d_t},load_memory:{name:"load_memory",runningLabel:"Searching long-term memory",doneLabel:"Memory search complete",tone:"memory",icon:f_t},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"Searching the knowledge base",doneLabel:"Knowledge base search complete",tone:"knowledge",icon:h_t},load_skill:{name:"load_skill",runningLabel:"Loading skill",doneLabel:"Skill loaded",tone:"skill",icon:p_t},collect_resources:{name:"collect_resources",runningLabel:"Collecting available resources",doneLabel:"Resource collection complete",failedLabel:"Resource collection failed",tone:"resources",icon:g_t,detailRenderer:kjt},create_agents:{name:"create_agents",runningLabel:"Creating and running agents",doneLabel:"Agent creation complete",failedLabel:"Agent creation failed",tone:"agent",icon:Dne,detailRenderer:Sjt},branch_compare:{name:"branch_compare",runningLabel:"",doneLabel:"",failedLabel:"",tone:"search",icon:Dne,detailRenderer:U_t,hideHeader:!0}};function mq(e){return Ejt[e]}function Cjt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3h8l4 4v14H6Z"}),a.jsx("path",{d:"M14 3v5h5"}),a.jsx("path",{d:"m10 12-2 2 2 2M14 12l2 2-2 2"})]})}function Ajt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M12 3 19 6v5c0 4.6-2.8 7.8-7 10-4.2-2.2-7-5.4-7-10V6l7-3Z"}),a.jsx("path",{d:"m9 12 2 2 4-4"})]})}function Tjt(e,t){const n=new Map(e.map(o=>[o.path,o.content])),i=new Map(t.map(o=>[o.path,o.content])),r=new Set([...n.keys(),...i.keys()]),s=[];for(const o of[...r].sort((l,c)=>l.localeCompare(c))){const l=n.get(o),c=i.get(o);l!==c&&s.push({path:o,status:l===void 0?"added":c===void 0?"deleted":"modified",before:l??"",after:c??""})}return s}function Rb(e){return{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,...e}}function MLe(e){return a.jsx("svg",{...Rb(e),children:a.jsx("path",{d:"m9 7-5 5 5 5M15 7l5 5-5 5M13.5 4l-3 16"})})}function $4(e){return a.jsx("svg",{...Rb(e),children:a.jsx("path",{d:"M6.5 3.75h7l4 4V20.25h-11zM13.5 3.75v4h4M9 12h6M9 15.5h4.5"})})}function _jt(e){return a.jsx("svg",{...Rb(e),children:a.jsx("path",{d:"M3.75 7.25h6l1.75 2h8.75v9.25H3.75zM3.75 7.25V5.5h5l1.5 1.75"})})}function jjt(e){return a.jsx("svg",{...Rb(e),children:a.jsx("path",{d:"m9 5 7 7-7 7"})})}function mT(e){return a.jsx("svg",{...Rb(e),children:a.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function Njt(e){return a.jsxs("svg",{...Rb(e),children:[a.jsx("circle",{cx:"12",cy:"12",r:"3.25"}),a.jsx("path",{d:"M12 2.75v2M12 19.25v2M2.75 12h2M19.25 12h2M5.45 5.45l1.4 1.4M17.15 17.15l1.4 1.4M18.55 5.45l-1.4 1.4M6.85 17.15l-1.4 1.4"})]})}function Rjt(e){return a.jsx("svg",{...Rb(e),children:a.jsx("path",{d:"M19.25 15.25A8 8 0 0 1 8.75 4.75a8 8 0 1 0 10.5 10.5Z"})})}function LLe(e){return a.jsxs("svg",{...Rb(e),children:[a.jsx("path",{d:"M19.25 8.25V4.5l-1.8 1.8a7.5 7.5 0 1 0 1.8 7.65"}),a.jsx("path",{d:"M19.25 4.5H15.5"})]})}const Ijt=p.lazy(()=>Js(()=>Promise.resolve().then(()=>wFe),void 0)),Pjt=p.lazy(()=>Js(()=>import("../chunks/CodeDiffEditor-Dvmt5gm9.js"),[])),$Le="veadk-code-workspace-theme";function Djt(e){const t={name:"",children:new Map};for(const n of e){const i=n.path.split("/").filter(Boolean);let r=t;i.forEach((s,o)=>{let l=r.children.get(s);l||(l={name:s,children:new Map},r.children.set(s,l)),o===i.length-1&&(l.path=n.path),r=l})}return t}function Mjt(e,t=!1){return[...e.children.values()].sort((n,i)=>{const r=n.children.size>0&&n.path===void 0,s=i.children.size>0&&i.path===void 0;return r!==s?t?r?1:-1:r?-1:1:n.name.localeCompare(i.name)})}function Ljt(){if(typeof window>"u")return"light";try{return window.localStorage.getItem($Le)==="dark"?"dark":"light"}catch{return"light"}}function $jt(e){return e===""?0:e.split(` -`).length}function r1({project:e,open:t,onClose:n,onChange:i,readOnly:r=!1,comparison:s}){var N;const{t:o}=Te("workspaceTools"),l=p.useId(),c=p.useRef(null),u=p.useRef(null),d=p.useRef(n),[f,h]=p.useState(Ljt),m=p.useMemo(()=>s?Tjt(s.baseProject.files,e.files):[],[s,e.files]),g=p.useMemo(()=>s?m.map(P=>({path:P.path,content:P.status==="deleted"?P.before:P.after})):e.files,[m,s,e.files]),b=p.useMemo(()=>new Map(m.map(P=>[P.path,P.status])),[m]),[v,y]=p.useState(((N=g[0])==null?void 0:N.path)??null),[w,x]=p.useState(new Set),O=p.useMemo(()=>Djt(g),[g]),k=g.find(P=>P.path===v)??null,S=m.find(P=>P.path===v)??null;if(d.current=n,p.useEffect(()=>{try{window.localStorage.setItem($Le,f)}catch{}},[f]),p.useEffect(()=>{var _;if(!t)return;const P=document.body.style.overflow,I=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(_=u.current)==null||_.focus();const D=L=>{if(L.key==="Escape"){L.preventDefault(),d.current();return}if(L.key!=="Tab"||!c.current)return;const F=[...c.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')].filter(q=>q.offsetParent!==null);if(F.length===0)return;const M=F[0],z=F[F.length-1];L.shiftKey&&document.activeElement===M?(L.preventDefault(),z.focus()):!L.shiftKey&&document.activeElement===z&&(L.preventDefault(),M.focus())};return window.addEventListener("keydown",D),()=>{document.body.style.overflow=P,window.removeEventListener("keydown",D),I!=null&&I.isConnected&&I.focus()}},[t]),p.useEffect(()=>{k||g.length===0||y(g[0].path)},[g,k]),!t)return null;function C(P){x(I=>{const D=new Set(I);return D.has(P)?D.delete(P):D.add(P),D})}function E(P){return P?a.jsx("span",{className:`code-browser-change is-${P}`,children:o(`codeBrowser.change.${P}`)}):null}function j(P,I,D){return Mjt(P,I===0).map(_=>{const L=D?`${D}/${_.name}`:_.name;if(!(_.children.size>0&&_.path===void 0)&&_.path){const z=b.get(_.path);return a.jsxs("button",{type:"button",className:`code-browser-file${v===_.path?" is-active":""}`,style:{paddingLeft:`${12+I*16}px`},onClick:()=>y(_.path??null),title:_.path,"aria-pressed":v===_.path,children:[a.jsx($4,{}),a.jsx("span",{children:_.name}),E(z)]},L)}const M=w.has(L);return a.jsxs("div",{children:[a.jsxs("button",{type:"button",className:"code-browser-folder",style:{paddingLeft:`${10+I*16}px`},onClick:()=>C(L),"aria-expanded":!M,children:[a.jsx(jjt,{className:M?"":"is-open"}),a.jsx(_jt,{}),a.jsx("span",{children:_.name})]}),!M&&j(_,I+1,L)]},L)})}function T(P){!k||s||i({...e,files:e.files.map(I=>I.path===k.path?{...I,content:P}:I)})}const R=f==="light"?"dark":"light",A=o(s?"codeBrowser.noChanges":"codeBrowser.chooseFile");return vi.createPortal(a.jsx("div",{className:"code-browser-backdrop",onMouseDown:P=>{P.target===P.currentTarget&&n()},children:a.jsxs("section",{ref:c,className:`code-browser-dialog is-${f}`,role:"dialog","aria-modal":"true","aria-labelledby":l,children:[a.jsxs("header",{className:"code-browser-head",children:[a.jsxs("div",{className:"code-browser-title-wrap",children:[a.jsx("span",{className:"code-browser-title-icon",children:a.jsx(MLe,{})}),a.jsxs("div",{children:[a.jsx("h2",{id:l,children:o(s?"codeBrowser.compareTitle":"codeBrowser.workspaceTitle")}),a.jsx("p",{title:e.name,children:e.name||o("codeBrowser.projectFallback")})]})]}),a.jsxs("div",{className:"code-browser-head-actions",children:[a.jsx("button",{type:"button",className:"code-browser-icon-button",onClick:()=>h(R),"aria-label":o("codeBrowser.switchTheme"),title:o("codeBrowser.switchThemeTitle",{theme:o(`codeBrowser.themes.${R}`)}),children:f==="light"?a.jsx(Rjt,{}):a.jsx(Njt,{})}),a.jsx("button",{ref:u,type:"button",className:"code-browser-icon-button",onClick:n,"aria-label":o("codeBrowser.closeWorkspace"),title:o("codeBrowser.close"),children:a.jsx(mT,{})})]})]}),a.jsxs("div",{className:"code-browser-workspace",children:[a.jsxs("aside",{className:"code-browser-sidebar","aria-label":o(s?"codeBrowser.changedFiles":"codeBrowser.projectFiles"),children:[a.jsxs("div",{className:"code-browser-sidebar-head",children:[a.jsx("span",{children:o(s?"codeBrowser.changes":"codeBrowser.files")}),a.jsx("span",{children:g.length})]}),a.jsx("div",{className:"code-browser-tree",children:g.length>0?j(O,0,""):a.jsx("div",{className:"code-browser-empty",children:A})})]}),a.jsxs("main",{className:"code-browser-main",children:[a.jsx("div",{className:"code-browser-tabs",role:"tablist","aria-label":o("codeBrowser.openFiles"),children:k?a.jsxs("div",{className:"code-browser-tab",role:"tab","aria-selected":"true",children:[a.jsx($4,{}),a.jsx("span",{children:k.path.split("/").pop()}),E(S==null?void 0:S.status)]}):null}),a.jsxs("div",{className:"code-browser-path",children:[a.jsx($4,{}),a.jsx("span",{children:(k==null?void 0:k.path)??o("codeBrowser.noFileSelected")})]}),s?a.jsxs("div",{className:"code-browser-diff-labels","aria-label":o("codeBrowser.comparisonDirection"),children:[a.jsx("span",{children:s.baseLabel??o("codeBrowser.before")}),a.jsx("span",{children:s.targetLabel??o("codeBrowser.after")})]}):null,a.jsx("div",{className:"code-browser-editor",children:k?a.jsx(p.Suspense,{fallback:a.jsx("div",{className:"code-browser-empty",children:o("codeBrowser.loadingEditor")}),children:S?a.jsx(Pjt,{before:S.before,after:S.after,path:S.path,theme:f}):a.jsx(Ijt,{value:k.content,path:k.path,onChange:T,readOnly:r,theme:f})}):a.jsx("div",{className:"code-browser-empty",children:A})}),a.jsxs("footer",{className:"code-browser-statusbar",children:[a.jsx("span",{children:s?o("codeBrowser.changedFileCount",{count:m.length}):o("codeBrowser.fileCount",{count:e.files.length})}),a.jsx("span",{children:k?o("codeBrowser.lineCount",{count:$jt(k.content)}):"UTF-8"})]})]})]})]})}),document.body)}function Fjt({project:e,onChange:t,className:n="",label:i}){const{t:r}=Te("workspaceTools"),[s,o]=p.useState(!1),l=i??r("codeBrowser.viewSource");return a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:`code-browser-trigger ${n}`.trim(),onClick:()=>o(!0),"aria-label":r("codeBrowser.viewSourceAria"),title:l,children:[a.jsx(MLe,{}),a.jsx("span",{children:l})]}),a.jsx(r1,{project:e,open:s,onClose:()=>o(!1),onChange:t})]})}const fy="••••••••",R_=5,Fv=8e3,Bjt=8,Ujt=/(?:authorization|cookie|password|passwd|secret|token|api[_-]?key|access[_-]?key|credential|signature|^env(?:ironment)?$|^ak$|^sk$)/i,FLe=/\u001b\[[0-?]*[ -/]*[@-~]/g,BLe=/\u001b\][^\u0007]*(?:\u0007|\u001b\\)/g,ULe=/[\u0000-\u0008\u000b\u000c\u000e-\u001a\u001c-\u001f\u007f-\u009f]/g,Qjt=new Set(["exec_command","commandExecution","command_execution","run_code","execute_in_sandbox","Run command"]),zjt=new Set(["web_search","search","grep","rg"]),Vjt=new Set(["read_file","read","list_files","glob","ls"]),Hjt=new Set(["apply_patch","file_change","fileChange"]),qjt=new Set(["create_goal","update_goal","get_goal"]);function xg(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function p0(...e){for(const t of e)if(typeof t=="string"&&t.trim())return t.trim();return""}function F4(...e){for(const t of e){if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"&&t.trim()&&Number.isFinite(Number(t)))return Number(t)}}function II(e){const t=xg(e);if(!t)return[];const n=[t];for(const i of["payload","input","arguments","args","goal","result","display","safeCommandSummary","safeInputSummary"]){const r=xg(t[i]);r&&n.push(r)}return n}function uE(e,...t){return p0(...e.flatMap(n=>t.map(i=>n[i])))}function Wjt(e){let t=e.replace(FLe,"").replace(BLe,"").replace(ULe,"");return/[=:]|Bearer|Cookie|AKLT/i.test(t)&&(t=t.replace(/\bBearer\s+[^\s,;]+/gi,`Bearer ${fy}`).replace(/\b(?:set-)?cookie\s*:\s*[^\r\n]*/gi,`cookie: ${fy}`).replace(/\bAKLT[A-Za-z0-9_-]{6,}\b/g,fy).replace(/((?:access[_-]?key(?:[_-]?id)?|secret(?:[_-]?(?:access)?[_-]?key)?|session[_-]?token|security[_-]?token|client[_-]?secret|api[_-]?key|authorization|cookie|[a-z0-9_-]{0,80}(?:password|secret|token)|credential|ak|sk)\s*[:=]\s*)(?:"[^"]*"|'[^']*'|[^\s,;&]+)/gi,`$1${fy}`).replace(/([?&](?:access[_-]?key|api[_-]?key|client[_-]?secret|security[_-]?token|session[_-]?token|secret|token|password|authorization|cookie|credential)=)[^&#\s]+/gi,`$1${fy}`).replace(/([?&](?:x-amz-(?:credential|signature|security-token)|x-tos-signature|signature)=)[^&#\s]+/gi,`$1${fy}`)),t}function sf(e){return Wjt(e).replace(FLe,"").replace(BLe,"").replace(ULe,"")}function PI(e,t=0,n=new WeakSet){if(t>=Bjt)return"[truncated: maximum depth]";if(typeof e=="string")return sf(e);if(e===null||typeof e!="object")return e;if(n.has(e))return"[circular]";if(n.add(e),Array.isArray(e))return e.map(r=>PI(r,t+1,n));const i=xg(e);return i?Object.fromEntries(Object.entries(i).map(([r,s])=>[r,Ujt.test(r)?fy:PI(s,t+1,n)])):e}function B4(e){const t=sf(e).trimEnd();if(!t)return;const n=t.split(/\r?\n/);return t.length>Fv*2?{text:t.slice(0,Fv)+t.slice(-Fv),head:[t.slice(0,Fv)],tail:[t.slice(-Fv)],omittedLines:0,omittedCharacters:t.length-Fv*2}:n.length<=R_*2?{text:t,head:n,tail:[],omittedLines:0,omittedCharacters:0}:{text:t,head:n.slice(0,R_),tail:n.slice(-R_),omittedLines:n.length-R_*2,omittedCharacters:0}}function Kjt(e){return qjt.has(e)?"goal":Qjt.has(e)?"command":zjt.has(e)||/search/i.test(e)?"search":Vjt.has(e)||/(?:read|list|glob)/i.test(e)?"read":Hjt.has(e)||/(?:write|edit|patch|file.?change)/i.test(e)?"file-change":/^(?:mcp|tool__)/i.test(e)||e.includes("/")?"mcp":/auth|credential|approval/i.test(e)?"authorization":"generic"}function Gjt(e,t){if(e.status)return e.status;const n=p0(t==null?void 0:t.status).toLowerCase();return(t==null?void 0:t.ok)===!1||["failed","error","cancelled","denied","timeout"].includes(n)?"failed":e.done||["completed","done","success"].includes(n)?"completed":"running"}function Qne(e){return typeof e=="string"?e.trim()?[e.trim()]:[]:Array.isArray(e)?e.flatMap(t=>{if(typeof t=="string")return t.trim()?[t.trim()]:[];const n=xg(t),i=p0(n==null?void 0:n.path,n==null?void 0:n.filename,n==null?void 0:n.name);return i?[i]:[]}):[]}function Xjt(e,t,n,i,r){const s=[...II(n),...II(i)];return e==="goal"?sf(uE(s,"objective","title","name")):e==="command"?sf(uE(s,"command","cmd","script","commandPreview","binary")):e==="search"?sf(uE(s,"query","pattern","search")):e==="read"||e==="file-change"?r.slice(0,2).map(sf).join(", "):sf(e==="mcp"?p0(n==null?void 0:n.query,n==null?void 0:n.resource,n==null?void 0:n.path):p0(n==null?void 0:n.title,n==null?void 0:n.name,i==null?void 0:i.message,i==null?void 0:i.status,t))}function gq(e){const t=xg(e.args),n=xg(e.response),i=e.args===void 0?void 0:PI(e.args),r=e.response===void 0?void 0:PI(e.response),s=[...II(e.args),...II(e.response)],o=Kjt(e.name),l=Gjt(e,n),c=xg(n==null?void 0:n.display)??xg(t==null?void 0:t.display),u=p0(n==null?void 0:n.aggregatedOutput,n==null?void 0:n.aggregated_output,n==null?void 0:n.output,n==null?void 0:n.errorMessage,n==null?void 0:n.error_message),d=[...Qne((t==null?void 0:t.paths)??(t==null?void 0:t.files)??(t==null?void 0:t.changes)??(t==null?void 0:t.path)),...Qne((n==null?void 0:n.paths)??(n==null?void 0:n.files)??(n==null?void 0:n.changes))],f=F4(n==null?void 0:n.exitCode,n==null?void 0:n.exit_code),h=F4(n==null?void 0:n.durationMs,n==null?void 0:n.duration_ms,c==null?void 0:c.durationMs),m=F4(n==null?void 0:n.count,n==null?void 0:n.total,n==null?void 0:n.totalCount);return{category:o,titleKey:o==="generic"?`generic.named.${l}`:`${o}.${l}`,titleParams:o==="generic"?{tool:e.name}:void 0,title:e.title,summary:Xjt(o,e.name,t,n,d),status:l,source:e.source,command:o==="command"?sf(p0(uE(s,"command","cmd","script","commandPreview","binary"))):void 0,cwd:o==="command"&&sf(uE(s,"cwd"))||void 0,output:B4(u),exitCode:f,durationMs:h,resultCount:m,paths:[...new Set(d.map(sf))],defaultOpen:e.defaultOpen===!0||l==="running"||l==="failed",rawArgs:i,rawResponse:r,rawArgsPreview:i===void 0?void 0:B4(zne(i)),rawResponsePreview:r===void 0?void 0:B4(zne(r))}}function zne(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}function Vne(e){return e.status==="completed"&&(e.category==="read"||e.category==="search")}function Rd(e){return{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,...e}}function Yjt(e){return a.jsxs("svg",{...Rd(e),children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),a.jsx("path",{d:"m7.5 9 2.7 2.5L7.5 14M12.7 14h3.8M3.8 7.5h16.4"})]})}function QLe(e){return a.jsxs("svg",{...Rd(e),children:[a.jsx("path",{d:"M6 3.5h7l5 5v12H6zM13 3.5v5h5M8.8 13h5.7M8.8 16h3.8"}),a.jsx("circle",{cx:"16.8",cy:"16.5",r:"2.3"}),a.jsx("path",{d:"m18.5 18.2 1.8 1.8"})]})}function Zjt(e){return a.jsxs("svg",{...Rd(e),children:[a.jsx("circle",{cx:"10.5",cy:"10.5",r:"5.75"}),a.jsx("path",{d:"m15 15 4.25 4.25"})]})}function Jjt(e){return a.jsxs("svg",{...Rd(e),children:[a.jsx("path",{d:"M5.5 3.5h7l4 4v4M12.5 3.5v4h4M10.5 20.5h-5v-17"}),a.jsx("path",{d:"m12.5 17.5 5.6-5.6 2 2-5.6 5.6-2.8.8z"})]})}function eNt(e){return a.jsxs("svg",{...Rd(e),children:[a.jsx("path",{d:"M8 8V4.5M16 8V4.5M6.5 8h11v3.5a5.5 5.5 0 0 1-11 0zM12 17v3"}),a.jsx("path",{d:"M5.5 4.5h5M13.5 4.5h5"})]})}function tNt(e){return a.jsxs("svg",{...Rd(e),children:[a.jsx("path",{d:"M12 3.5 19 6v5.2c0 4.3-2.7 7.6-7 9.3-4.3-1.7-7-5-7-9.3V6z"}),a.jsx("path",{d:"m8.8 12 2 2 4.4-4.4"})]})}function Hne(e){return a.jsx("svg",{...Rd(e),children:a.jsx("path",{d:"M14.8 6.2a4.1 4.1 0 0 0-5.6 5.6l-5.4 5.4a2 2 0 0 0 2.8 2.8l5.4-5.4a4.1 4.1 0 0 0 5.6-5.6l-2.5 2.5-2.6-.6-.6-2.6z"})})}function bq(e){return a.jsx("svg",{...Rd(e),children:a.jsx("path",{d:"m9 5 7 7-7 7"})})}function zLe(e){return a.jsx("svg",{...Rd(e),children:a.jsx("path",{d:"m5 12.5 4.5 4.5L19 7.5"})})}function nNt(e){return a.jsxs("svg",{...Rd(e),children:[a.jsx("circle",{cx:"12",cy:"12",r:"8.5"}),a.jsx("path",{d:"M12 7.5v5.25M12 16.25h.01"})]})}function iNt(e){return a.jsx("svg",{...Rd(e),children:a.jsx("path",{d:"M20 12a8 8 0 1 1-2.35-5.65"})})}function rNt(e){return a.jsxs("svg",{...Rd(e),children:[a.jsx("rect",{x:"8",y:"8",width:"11",height:"11",rx:"2"}),a.jsx("path",{d:"M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2"})]})}const sNt={goal:Hne,command:Yjt,read:QLe,search:Zjt,"file-change":Jjt,mcp:eNt,authorization:tNt,generic:Hne};function aNt(e){return e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(e<1e4?1:0)} s`}function VLe(e){if(e===void 0)return"";if(typeof e=="string"){const t=e.trim();if(t.startsWith("{")||t.startsWith("["))try{return JSON.stringify(JSON.parse(t),null,2)}catch{return e}return e}try{return JSON.stringify(e,null,2)}catch{return String(e)}}function oNt({status:e}){return e==="running"||e==="queued"?a.jsx(iNt,{className:"tool-activity__status-icon is-spinning"}):e==="failed"?a.jsx(nNt,{className:"tool-activity__status-icon"}):a.jsx(zLe,{className:"tool-activity__status-icon"})}function lNt({presentation:e,callId:t}){const{t:n}=Te("conversation"),[i,r]=p.useState(!1),[s,o]=p.useState(""),[l,c]=p.useState(!1),u=p.useRef(void 0);p.useEffect(()=>()=>window.clearTimeout(u.current),[]);const d=async(f,h)=>{window.clearTimeout(u.current);try{await navigator.clipboard.writeText(typeof h=="string"?h:VLe(h)),o(f),c(!1),u.current=window.setTimeout(()=>o(""),1500)}catch{o(""),c(!0),u.current=window.setTimeout(()=>c(!1),3e3)}};return e.rawArgs===void 0&&e.rawResponse===void 0&&!t?null:a.jsxs("div",{className:"tool-activity__raw",children:[a.jsxs("button",{type:"button",onClick:()=>r(f=>!f),"aria-expanded":i,children:[n("blocks.toolActivity.rawData"),a.jsx(bq,{className:i?"is-open":""})]}),i?a.jsxs("div",{className:"tool-activity__raw-body",children:[t?a.jsxs("div",{className:"tool-activity__raw-id",children:[a.jsx("span",{children:n("blocks.toolActivity.callId")}),a.jsx("code",{children:t}),a.jsx("button",{type:"button",onClick:()=>void d("id",t),"aria-label":n("blocks.toolActivity.copyCallId"),children:a.jsx(rNt,{})})]}):null,e.rawArgs!==void 0?a.jsx(qne,{label:n("blocks.arguments"),value:e.rawArgs,preview:e.rawArgsPreview,copied:s==="input",onCopy:()=>void d("input",e.rawArgs)}):null,e.rawResponse!==void 0?a.jsx(qne,{label:n("blocks.result"),value:e.rawResponse,preview:e.rawResponsePreview,copied:s==="result",onCopy:()=>void d("result",e.rawResponse)}):null,l?a.jsx("span",{className:"tool-activity__copy-error",role:"alert",children:n("blocks.toolActivity.copyFailed")}):null]}):null]})}function qne({label:e,value:t,preview:n,copied:i,onCopy:r}){const{t:s}=Te("conversation");return a.jsxs("section",{className:"tool-activity__raw-section",children:[a.jsxs("div",{children:[a.jsx("span",{children:e}),a.jsx("button",{type:"button",onClick:r,children:s(i?"blocks.toolActivity.copied":"blocks.toolActivity.copy")})]}),a.jsxs("pre",{children:[(n==null?void 0:n.head.join(` +`+v+"]"}return r.pop(),s=v,w}};const fTt={parse:sTt,stringify:dTt};var VMe=fTt;const hTt=2e5,pTt=new Set(["__proto__","constructor","prototype"]),mTt=/^(?:https?:|data:|blob:|file:|javascript:|image:\/\/)/i;function pS(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function II(e,t=0){if(t>30)throw new Error("ECharts option nesting is too deep");if(typeof e=="number"&&!Number.isFinite(e))throw new Error("ECharts option contains a non-finite number");if(typeof e=="string"&&mTt.test(e.trim()))throw new Error("ECharts option contains an external resource");if(Array.isArray(e)){for(const n of e)II(n,t+1);return}if(pS(e))for(const[n,i]of Object.entries(e)){if(pTt.has(n))throw new Error("ECharts option contains an unsafe key");II(i,t+1)}}function gTt(e){var i;const t=e.trim(),n=t.match(/^(?:(?:const|let|var)\s+)?option\s*=\s*([\s\S]*?)\s*;?$/);return((i=n==null?void 0:n[1])==null?void 0:i.trim())||t}function bTt(e,t){let n=1,i="",r=!1,s=!1,o=!1;for(let l=t+1;li+2)throw new Error("Invalid ECharts gradient argument count");const r=n.slice(0,i).map(yTt),s=n[i],o=n[i+1]??!1;if(!Array.isArray(s)||typeof o!="boolean")throw new Error("Invalid ECharts gradient data");return e==="linear"?{type:e,x:r[0],y:r[1],x2:r[2],y2:r[3],colorStops:s,global:o}:{type:e,x:r[0],y:r[1],r:r[2],colorStops:s,global:o}}function xTt(e,t){const n=/^(?:new\s+)?echarts\.graphic\.(LinearGradient|RadialGradient)\s*\(/;let i="",r=!1,s=!1,o=!1;for(let l=t;lhTt)throw new Error("ECharts option is too large");const n=wTt(gTt(e));let i;try{i=VMe.parse(n)}catch(o){throw/\bfunction\s*\(|=>/.test(n)?new Error("ECharts function callbacks are not supported"):o}if(!pS(i))throw new Error("ECharts option must be a data object");II(i);const r={...i};r.aria={...pS(r.aria)?r.aria:{},enabled:!0};const s=r.tooltip;return pS(s)?r.tooltip={...s,renderMode:"richText"}:Array.isArray(s)&&(r.tooltip=s.map(o=>pS(o)?{...o,renderMode:"richText"}:o)),t&&(r.animation=!1),r}let I4;function OTt(){return I4??(I4=Zs(()=>import("../visualizations/echarts/index-CGT341lL.js"),[]).catch(e=>{throw I4=void 0,e})),I4}function kTt({source:e}){const{t}=Te("conversation"),n=p.useRef(null),[i,r]=p.useState(!1),[s,o]=p.useState("");return p.useEffect(()=>{let l=!1,c,u,d;r(!1);try{d=HMe(e,window.matchMedia("(prefers-reduced-motion: reduce)").matches),o("")}catch{o("invalid");return}return OTt().then(f=>{const h=n.current;l||!h||(c=f.init(h,void 0,{renderer:"svg"}),c.setOption(d,{notMerge:!0}),typeof ResizeObserver<"u"&&(u=new ResizeObserver(()=>c==null?void 0:c.resize()),u.observe(h)),r(!0))}).catch(()=>{c==null||c.dispose(),c=void 0,l||o("render")}),()=>{l=!0,u==null||u.disconnect(),c==null||c.dispose()}},[e]),a.jsxs("div",{className:`echarts-diagram${s?" echarts-diagram--error":""}`,role:"img","aria-label":t("visualization.echartsAria"),"aria-busy":!i&&!s,children:[a.jsx("div",{ref:n,className:"echarts-diagram__canvas",hidden:!!s}),!i&&!s?a.jsx("div",{className:"echarts-diagram__state","aria-live":"polite",children:a.jsx(fn,{duration:2.2,spread:15,children:t("visualization.rendering")})}):null,s?a.jsx("p",{className:"echarts-diagram__error",role:"alert",children:t(s==="invalid"?"visualization.invalidEcharts":"visualization.renderFailed")}):null]})}const STt=p.memo(kTt);let Ene,Cne=Promise.resolve(),ETt=0;function CTt(){return Ene??(Ene=Zs(async()=>{const{default:e}=await import("../visualizations/mermaid/mermaid.core-Vsbm7qIM.js").then(t=>t.ay);return{default:e}},__vite__mapDeps([0,1])).then(({default:e})=>(e.initialize({startOnLoad:!1,securityLevel:"strict",suppressErrorRendering:!0,theme:"neutral"}),e))),Ene}function ATt(e){const t=Cne.then(async()=>{const n=await CTt(),i=`mermaid-diagram-${ETt+=1}`;return n.render(i,e)});return Cne=t.then(()=>{},()=>{}),t}function TTt({source:e}){const{t}=Te("conversation"),n=p.useRef(null),[i,r]=p.useState(null),[s,o]=p.useState(!1);return p.useEffect(()=>{let l=!1;return r(null),o(!1),ATt(e).then(c=>{l||r(c)}).catch(()=>{l||o(!0)}),()=>{l=!0}},[e]),p.useEffect(()=>{!(i!=null&&i.bindFunctions)||!n.current||i.bindFunctions(n.current)},[i]),s?a.jsx("div",{className:"mermaid-diagram mermaid-diagram--error",children:a.jsx("p",{className:"mermaid-diagram__error",role:"alert",children:t("visualization.mermaidFailed")})}):i?a.jsx("div",{ref:n,className:"mermaid-diagram",role:"img","aria-label":t("visualization.mermaidAria"),dangerouslySetInnerHTML:{__html:i.svg}}):a.jsx("div",{className:"mermaid-diagram mermaid-diagram--loading","aria-live":"polite",children:a.jsx(fn,{duration:2.2,spread:15,children:t("visualization.rendering")})})}const _Tt=p.memo(TTt),jTt="_SegmentedControl_1sl7d_1",NTt="_SegmentedControlOption_1sl7d_140",RTt="_SegmentedControlThumb_1sl7d_219",r9={SegmentedControl:jTt,SegmentedControlOption:NTt,SegmentedControlThumb:RTt},ld=({value:e,onChange:t,children:n,block:i,pill:r=!0,size:s="md",gutterSize:o,className:l,onClick:c,...u})=>{const d=p.useRef(null),f=p.useRef(null),h=p.useCallback(g=>{const b=d.current,v=f.current;if(!b||!v)return;const y=b==null?void 0:b.querySelector('[data-state="on"]');if(!y)return;const w=b.clientWidth;let x=Math.floor(y.clientWidth);const O=y.offsetLeft;if(w-(x+O)<2&&(x=x-1),v.style.width=`${Math.floor(x)}px`,v.style.transform=`translateX(${O}px)`,b.scrollWidth>w){const k=w*.15,S=b.scrollLeft,C=y.offsetLeft,E=C+x;(CS+w-k)&&g&&y.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"})}},[]);nNe({ref:d,onResize:()=>{const g=f.current;if(!g)return;const b=g.style.transition;g.style.transition="",h(!1),g.style.transition=b}}),p.useLayoutEffect(()=>{const g=d.current,b=f.current;!g||!b||(h(!!b.style.transition),b.style.transition||pI(()=>{b.style.transition="width 300ms var(--cubic-enter), transform 300ms var(--cubic-enter)"}))},[h,e,s,o,r]);const m=g=>{g&&t&&t(g)};return a.jsxs(xft,{ref:d,className:Ui(r9.SegmentedControl,l),type:"single",value:e,loop:!1,onValueChange:m,onClick:c,"data-block":i?"":void 0,"data-pill":r?"":void 0,"data-size":s,"data-gutter-size":o,...u,children:[a.jsx("div",{className:r9.SegmentedControlThumb,ref:f}),n]})},ITt=({children:e,...t})=>a.jsx(Eft,{className:r9.SegmentedControlOption,...t,onPointerEnter:kV,children:a.jsx("span",{className:"relative",children:e})});ld.Option=ITt;function PTt({children:e,label:t,language:n,source:i,streaming:r=!1}){const{t:s}=Te("conversation"),[o,l]=p.useState("preview"),c=r?"code":o;return a.jsxs("section",{className:"visualization-card","aria-label":s("visualization.cardAria",{label:t}),children:[a.jsx("div",{className:"visualization-card__toolbar",children:a.jsxs(ld,{className:"visualization-card__tabs",value:c,size:"sm",gutterSize:"sm",pill:!1,"aria-label":s("visualization.viewAria",{label:t}),onChange:u=>{r||l(u)},children:[a.jsx(ld.Option,{value:"preview",disabled:r,children:s("visualization.preview")}),a.jsx(ld.Option,{value:"code",children:s("visualization.code")})]})}),a.jsx("div",{className:"visualization-card__body",children:c==="code"?a.jsx("pre",{className:"visualization-card__code",children:a.jsx("code",{className:`language-${n}`,children:i})}):e})]})}const DTt=p.memo(PTt);function qMe(e){const t=e==null?void 0:e.trim().toLowerCase();if(t==="mermaid")return"mermaid";if(t==="echart"||t==="echarts")return"echarts"}const WMe=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function s9(e){return typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(s9).join(""):p.isValidElement(e)?s9(e.props.children):""}function MTt(e){var i;const t=p.Children.toArray(e)[0];if(!p.isValidElement(t))return;const n=(i=t.props.className)==null?void 0:i.split(/\s+/).find(r=>r.startsWith("language-"));return qMe(n==null?void 0:n.slice(9))}function KMe(e){if(!e)return!1;try{const t=e.toLowerCase();return WMe.some(n=>t.includes(n))}catch{return!1}}function LTt(e){var i;const t=(i=e==null?void 0:e.properties)==null?void 0:i.href;if(!t)return!1;if(KMe(t))return!0;const n=e==null?void 0:e.children;if(n&&Array.isArray(n)){const r=n.map(s=>(s==null?void 0:s.value)||"").join("").toLowerCase();return WMe.some(s=>r.includes(s))}return!1}function $Tt({text:e,className:t,allowRawHtml:n=!0,streaming:i=!1}){const{t:r}=Te("conversation"),s=p.useContext(Aje),[o,l]=p.useState(null),c=(f,h)=>{if(f.src)return f.src;if(h){const m=b=>{var v;if(!b)return null;if(b.type==="source"&&((v=b.properties)!=null&&v.src))return b.properties.src;if(b.children)for(const y of b.children){const w=m(y);if(w)return w}return null},g=m({children:h});if(g)return g}return""},u=f=>{try{const m=new URL(f).pathname.split("/");return m[m.length-1]||"video.mp4"}catch{return"video.mp4"}},d=f=>f?Array.isArray(f)?f.map(h=>(h==null?void 0:h.value)||"").join("")||"video":(f==null?void 0:f.value)||"video":"video";return a.jsxs("div",{className:t?`md ${t}`:"md",children:[a.jsx(qPe,{disallowedElements:s?["file-card","personal-drive-enable-card"]:void 0,remarkPlugins:[bDe],rehypePlugins:n?[JAt,sne]:[sne],components:{pre:({node:f,children:h,...m})=>{const g=MTt(h);if(g==="mermaid"||g==="echarts"){const b=s9(h).replace(/\n$/,"");return a.jsx(DTt,{label:g==="mermaid"?"Mermaid":"ECharts",language:g,source:b,streaming:i,children:g==="mermaid"?a.jsx(_Tt,{source:b}):a.jsx(STt,{source:b})})}return a.jsx("pre",{...m,children:h})},a:({node:f,...h})=>{const m=h.href,g=s&&zst(m);if(g)return a.jsx(Vst,{...s,path:g,children:h.children});if(m&&(KMe(m)||LTt(f))){const b=m,v=d(f==null?void 0:f.children);return a.jsxs("div",{className:"video-container",children:[a.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":r("markdown.playVideo",{name:v}),onClick:()=>l({src:b,title:v}),children:[a.jsx("video",{src:b,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),a.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:a.jsx(iE,{})})]}),a.jsx("div",{className:"video-caption",children:a.jsx("a",{href:b,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:v})})]})}return a.jsx("a",{...h,target:"_blank",rel:"noopener noreferrer"})},img:({node:f,src:h,alt:m,...g})=>{const b=a.jsx("img",{...g,src:h,alt:m??"",loading:"lazy"});return h?a.jsx(MAe,{src:h,children:a.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":r("markdown.enlargeImage",{name:m||r("markdown.image")}),children:[b,a.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:a.jsx(iE,{})})]})}):b},video:({node:f,src:h,children:m,...g})=>{const b=c({src:h},m);return b?a.jsx("div",{className:"video-container",children:a.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":r("markdown.enlargeVideo"),onClick:()=>l({src:b}),children:[a.jsx("video",{src:b,...g,playsInline:!0,className:"video-thumbnail",children:m}),a.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:a.jsx(iE,{})})]})}):a.jsx("video",{src:h,controls:!0,playsInline:!0,className:"video-inline",...g,children:m})}},children:e}),o&&a.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":r("markdown.videoPreview"),onClick:()=>l(null),children:a.jsxs("div",{className:"video-viewer",onClick:f=>f.stopPropagation(),children:[a.jsxs("div",{className:"video-viewer-header",children:[a.jsx("div",{className:"video-viewer-title",children:o.title||u(o.src)}),a.jsxs("nav",{className:"video-viewer-nav",children:[a.jsx("a",{href:o.src,download:o.title||u(o.src),"aria-label":r("markdown.downloadVideo"),title:r("markdown.downloadVideo"),className:"video-viewer-download",children:a.jsx(tM,{})}),a.jsx("button",{type:"button",className:"video-viewer-close","aria-label":r("markdown.close"),onClick:()=>l(null),children:a.jsx(Do,{})})]})]}),a.jsx("div",{className:"video-viewer-body",children:a.jsx("video",{src:o.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const Td=p.memo($Tt);function P4(e){return(e==null?void 0:e.trim())||Tb("resourceMetadata.unknownSource")}function GMe(e){return(e==null?void 0:e.trim())||Tb("resourceMetadata.unknownCreator")}function FTt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5 5.5A2.5 2.5 0 0 1 7.5 3H19v16H7.5A2.5 2.5 0 0 0 5 21.5v-16Z"}),a.jsx("path",{d:"M5 18.5A2.5 2.5 0 0 1 7.5 16H19"}),a.jsx("path",{d:"M9 7h6M9 10h4"})]})}function BTt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3h8l4 4v14H6V3Z"}),a.jsx("path",{d:"M14 3v5h5M9 12h6M9 16h6"})]})}function UTt(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m7 7 10 10M17 7 7 17"})})}function QTt(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 5v14M5 12h14"})})}function yT({title:e,children:t,onClose:n,busy:i=!1,className:r=""}){const{t:s}=Te("ui"),o=p.useId(),l=p.useRef(null),c=p.useRef(null),u=p.useRef(i),d=p.useRef(n);return p.useEffect(()=>{u.current=i,d.current=n},[i,n]),p.useEffect(()=>{var g;const f=document.activeElement instanceof HTMLElement?document.activeElement:null,h=document.body.style.overflow;document.body.style.overflow="hidden",(g=l.current)==null||g.focus();const m=b=>{if(b.key==="Escape"&&!u.current){d.current();return}if(b.key!=="Tab")return;const v=c.current;if(!v)return;const y=Array.from(v.querySelectorAll('button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), a[href], audio[controls], video[controls], iframe, [tabindex]:not([tabindex="-1"])')).filter(O=>O.getClientRects().length>0);if(y.length===0){b.preventDefault();return}const w=y[0],x=y[y.length-1];b.shiftKey&&(document.activeElement===w||!v.contains(document.activeElement))?(b.preventDefault(),x.focus()):!b.shiftKey&&(document.activeElement===x||!v.contains(document.activeElement))&&(b.preventDefault(),w.focus())};return window.addEventListener("keydown",m),()=>{window.removeEventListener("keydown",m),document.body.style.overflow=h,f!=null&&f.isConnected&&f.focus()}},[]),yi.createPortal(a.jsx("div",{className:"knowledge-dialog-backdrop",onMouseDown:f=>{f.target===f.currentTarget&&!i&&n()},children:a.jsxs("section",{ref:c,className:`knowledge-dialog${r?` ${r}`:""}`,role:"dialog","aria-modal":"true","aria-labelledby":o,"aria-busy":i||void 0,children:[a.jsxs("header",{className:"knowledge-dialog__header",children:[a.jsx("h2",{id:o,children:e}),a.jsx("button",{ref:l,type:"button",onClick:n,disabled:i,"aria-label":s("common.close"),children:a.jsx(UTt,{})})]}),t]})}),document.body)}function AC({message:e}){return e?a.jsx("div",{className:"knowledge-form-error",role:"alert",children:e}):null}function a9(e){return e instanceof DOMException&&e.name==="AbortError"}function zTt(e,t){if(!e)return"";const n=Date.parse(e);return Number.isFinite(n)?new Intl.DateTimeFormat(t,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(n):e}const XMe=[".jpg",".jpeg",".png"].join(","),VTt=new Set(XMe.split(",")),YMe=[".pdf",".pptx",".docx",".xlsx",".txt"].join(","),HTt=new Set(YMe.split(",")),qTt=200*1024*1024;function o9(e){const t=e.lastIndexOf(".");return t<0?"":e.slice(t).toLocaleLowerCase()}function WTt(e,t,n){return e.size>qTt?n("knowledge.errors.fileTooLarge"):t==="image"?VTt.has(o9(e.name))?"":n("knowledge.errors.invalidImageType"):HTt.has(o9(e.name))?"":n("knowledge.errors.invalidDocumentType")}function aq(e){return e<=0?"-":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function l9(e){var r;const t=e.type.trim().replace(/^\./,"");if(t)return t.toUpperCase();const n=e.name.trim(),i=n.includes(".")?(r=n.split(".").pop())==null?void 0:r.trim():"";return i?i.toUpperCase():"-"}function KTt({region:e,onClose:t,onCreated:n}){const{t:i}=Te("ui"),[r,s]=p.useState(""),[o,l]=p.useState(""),[c,u]=p.useState(!1),[d,f]=p.useState(!1),[h,m]=p.useState(""),g=r.trim(),b=!!(g&&!/^[A-Za-z][A-Za-z0-9_]{0,47}$/.test(g)),v=async y=>{if(y.preventDefault(),u(!0),!g||b)return;f(!0),m("");const w={name:g,description:o.trim()||void 0,region:e};try{n(await jbt(w))}catch(x){m(El(x,i("knowledge.errors.createBase")))}finally{f(!1)}};return a.jsx(yT,{title:i("knowledge.createBase"),onClose:t,busy:d,children:a.jsxs("form",{onSubmit:y=>void v(y),children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:i("common.name")}),a.jsx("input",{autoFocus:!0,value:r,maxLength:48,"aria-invalid":c&&b||void 0,"aria-describedby":"knowledge-name-help",onBlur:()=>u(!0),onChange:y=>s(y.target.value)})]}),a.jsx("p",{id:"knowledge-name-help",className:`knowledge-dialog__note${c&&b?" is-error":""}`,role:c&&b?"alert":void 0,children:i(c&&b?"knowledge.invalidName":"knowledge.nameHelp")}),a.jsxs("label",{children:[a.jsx("span",{children:i("knowledge.optionalDescription")}),a.jsx("textarea",{value:o,maxLength:80,onChange:y=>l(y.target.value)})]}),a.jsx(AC,{message:h})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:t,disabled:d,children:i("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:d||!g||b,children:i(d?"common.creating":"common.create")})]})]})})}function GTt({item:e,onClose:t,onUpdated:n}){const{t:i}=Te("ui"),[r,s]=p.useState(e.description),[o,l]=p.useState(!1),[c,u]=p.useState(""),d=async f=>{f.preventDefault(),l(!0),u("");try{n(await Nbt(e.id,e.region,{description:r.trim()}))}catch(h){u(El(h,i("knowledge.errors.updateBase")))}finally{l(!1)}};return a.jsx(yT,{title:i("knowledge.editBase"),onClose:t,busy:o,children:a.jsxs("form",{onSubmit:f=>void d(f),children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:i("common.name")}),a.jsx("input",{value:e.name,disabled:!0})]}),a.jsxs("label",{children:[a.jsx("span",{children:i("common.description")}),a.jsx("textarea",{autoFocus:!0,value:r,maxLength:80,onChange:f=>s(f.target.value)})]}),a.jsx("p",{className:"knowledge-dialog__note",children:i("knowledge.descriptionOnly")}),a.jsx(AC,{message:c})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:t,disabled:o,children:i("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:o,children:i(o?"common.saving":"common.save")})]})]})})}function ZMe(e,t){if(!e.trim())return{};const n=JSON.parse(e);if(!n||Array.isArray(n)||typeof n!="object")throw new Error(t);return n}function XTt({base:e,onClose:t,onCreated:n,onAssociationInvalid:i}){const{t:r}=Te("ui"),[s,o]=p.useState("document"),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(""),[m,g]=p.useState(null),[b,v]=p.useState(!1),[y,w]=p.useState("{}"),[x,O]=p.useState(""),[k,S]=p.useState(""),[C,E]=p.useState(null),j=p.useRef(null),T=p.useRef(null),R=p.useRef(null),A=p.useRef(0),N=!!x;p.useEffect(()=>{var L;C&&!N&&((L=R.current)==null||L.focus())},[N,C]);const P=L=>{N||L===s||(o(L),g(null),h(""),c(""),d(""),S(""),E(null),v(!1),A.current=0,j.current&&(j.current.value=""))},I=L=>{if(!L||s==="web")return;const F=WTt(L,s,r);if(F){g(null),c(""),d(""),S(F);return}g(L),S(""),c(L.name.replace(/\.[^.]+$/,"")),d(o9(L.name).slice(1))},D=async L=>{if(L.preventDefault(),s==="web"?!f.trim():!m)return;let F;try{F=ZMe(y,r("knowledge.errors.metadataObject"))}catch(M){S(El(M,r("knowledge.errors.metadataFormat")));return}O(s==="web"?C?"save":"preview":"upload"),S("");try{if(s==="web")if(C){const M={sourceType:"url",metadata:C.metadata,url:C.preview.url,sourceTitle:C.preview.name,sourceMarkdown:C.preview.sourceMarkdown};await Dbt(e.id,e.region,M),n()}else{const M=await Mbt(e.id,e.region,{url:f.trim()});if(!M.sourceMarkdown.trim())throw new Error(r("knowledge.errors.noWebPreview"));E({preview:M,metadata:F})}else m&&(await Lbt(e.id,e.region,{file:m,name:l.trim()||void 0,documentType:u.trim()||void 0,metadata:F}),n())}catch(M){M instanceof bM&&M.errorCode===sPe?i(M):S(El(M,r(s==="web"?C?"knowledge.errors.addWeb":"knowledge.errors.previewWeb":"knowledge.errors.uploadFile")))}finally{O("")}},_=()=>{N||(E(null),S(""),requestAnimationFrame(()=>{var L;return(L=T.current)==null?void 0:L.focus()}))};return a.jsx(yT,{title:r(C?"knowledge.previewWeb":"knowledge.addData"),onClose:t,busy:N,className:C?"knowledge-dialog--preview knowledge-dialog--web-confirm":"",children:a.jsx("form",{onSubmit:L=>void D(L),children:C?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"knowledge-preview knowledge-web-preview",children:[a.jsxs("div",{className:"knowledge-preview__meta",children:[a.jsx("strong",{title:C.preview.name,children:C.preview.name}),a.jsx("a",{href:C.preview.url,target:"_blank",rel:"noopener noreferrer",children:r("knowledge.openOriginalWeb")})]}),a.jsx("div",{className:"knowledge-preview__body","aria-live":"polite",children:a.jsx("div",{className:"knowledge-preview__markdown-shell",children:a.jsx(Td,{text:C.preview.sourceMarkdown,allowRawHtml:!1,className:"knowledge-preview__markdown"})})}),k?a.jsx("div",{className:"knowledge-web-preview__error",children:a.jsx(AC,{message:k})}):null]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",className:"is-back",onClick:_,disabled:N,children:r("knowledge.backToEdit")}),a.jsx("button",{type:"button",onClick:t,disabled:N,children:r("common.cancel")}),a.jsx("button",{ref:R,type:"submit",className:"is-primary",disabled:N,children:r(x==="save"?"common.adding":"knowledge.confirmAdd")})]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsx("div",{className:"knowledge-source-tabs",role:"tablist","aria-label":r("knowledge.source"),children:[["image",r("knowledge.image")],["document",r("knowledge.documentFile")],["web",r("knowledge.webPage")]].map(([L,F])=>a.jsx("button",{type:"button",role:"tab",id:`knowledge-source-${L}-tab`,"aria-controls":`knowledge-source-${L}-panel`,"aria-selected":s===L,tabIndex:s===L?0:-1,className:s===L?"is-active":"",disabled:N,onClick:()=>P(L),onKeyDown:M=>{const V=["image","document","web"];if(!["ArrowLeft","ArrowRight","Home","End"].includes(M.key))return;M.preventDefault();const q=V.indexOf(L),U=M.key==="Home"?V[0]:M.key==="End"?V[V.length-1]:V[(q+(M.key==="ArrowRight"?1:-1)+V.length)%V.length];P(U),requestAnimationFrame(()=>{var J;return(J=document.getElementById(`knowledge-source-${U}-tab`))==null?void 0:J.focus()})},children:F},L))}),a.jsx("div",{id:`knowledge-source-${s}-panel`,className:"knowledge-source-panel",role:"tabpanel","aria-labelledby":`knowledge-source-${s}-tab`,children:s==="web"?a.jsxs(a.Fragment,{children:[a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.webUrl")}),a.jsx("input",{ref:T,autoFocus:!0,type:"url",value:f,disabled:N,onChange:L=>{h(L.target.value),S("")},placeholder:"https://example.com/article"})]}),a.jsx("div",{className:"knowledge-upload-status",role:"status","aria-live":"polite",children:x==="preview"?a.jsx(fn,{children:r("knowledge.generatingWebPreview")}):null})]}):a.jsxs(a.Fragment,{children:[a.jsx("input",{ref:j,className:"knowledge-upload-input",type:"file","aria-label":r("knowledge.selectFile"),accept:s==="image"?XMe:YMe,disabled:N,onChange:L=>{var F;I(((F=L.currentTarget.files)==null?void 0:F[0])??null),L.currentTarget.value=""}}),a.jsxs("button",{type:"button",className:`knowledge-upload-dropzone${b?" is-dragging":""}${m?" is-ready":""}`,disabled:N,onClick:()=>{var L;return(L=j.current)==null?void 0:L.click()},onDragEnter:L=>{L.preventDefault(),!N&&(A.current+=1,v(!0))},onDragOver:L=>{L.preventDefault(),N||(L.dataTransfer.dropEffect="copy")},onDragLeave:L=>{L.preventDefault(),A.current=Math.max(0,A.current-1),A.current===0&&v(!1)},onDrop:L=>{var F;L.preventDefault(),A.current=0,v(!1),N||I(((F=L.dataTransfer.files)==null?void 0:F[0])??null)},children:[a.jsx("strong",{children:m?m.name:r("knowledge.selectOrDropFile")}),a.jsx("span",{children:m?r("knowledge.selectedFile",{size:aq(m.size)}):r(s==="image"?"knowledge.imageFileHelp":"knowledge.documentFileHelp")})]}),a.jsx("div",{className:"knowledge-upload-status",role:"status","aria-live":"polite",children:N?a.jsx(fn,{children:r("knowledge.uploadingFile")}):null})]})}),s!=="web"?a.jsxs("div",{className:"knowledge-dialog__fields",children:[a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.optionalName")}),a.jsx("input",{value:l,disabled:N,maxLength:256,onChange:L=>c(L.target.value)})]}),a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.optionalType")}),a.jsx("input",{value:u,disabled:N,maxLength:64,onChange:L=>d(L.target.value),placeholder:"pdf, docx, png"})]})]}):null,a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.metadataJson")}),a.jsx("textarea",{className:"is-code",value:y,disabled:N,onChange:L=>w(L.target.value),spellCheck:!1})]}),a.jsx(AC,{message:k})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:t,disabled:N,children:r("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:N||(s==="web"?!f.trim():!m),children:r(N?s==="web"?"common.generating":"common.uploading":s==="web"?"knowledge.generatePreview":"knowledge.uploadFile")})]})]})})})}function YTt({base:e,item:t,onClose:n,onUpdated:i}){const{t:r}=Te("ui"),[s,o]=p.useState(()=>JSON.stringify(t.metadata??{},null,2)),[l,c]=p.useState(!1),[u,d]=p.useState(""),f=async h=>{h.preventDefault();let m;try{m=ZMe(s,r("knowledge.errors.metadataObject"))}catch(g){d(El(g,r("knowledge.errors.metadataFormat")));return}c(!0),d("");try{i(await $bt(e.id,t.id,e.region,{metadata:m}))}catch(g){d(El(g,r("knowledge.errors.updateDocument")))}finally{c(!1)}};return a.jsx(yT,{title:r("knowledge.editMetadata"),onClose:n,busy:l,children:a.jsxs("form",{onSubmit:h=>void f(h),children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.knowledge")}),a.jsx("input",{value:t.name||t.id,disabled:!0})]}),a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.metadataJson")}),a.jsx("textarea",{autoFocus:!0,className:"is-code knowledge-metadata-editor",value:s,onChange:h=>o(h.target.value),spellCheck:!1})]}),a.jsx(AC,{message:u})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:n,disabled:l,children:r("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:l,children:r(l?"common.saving":"common.save")})]})]})})}const JMe=new Set(["avif","bmp","gif","jpeg","jpg","png","svg","webp"]),eLe=new Set(["aac","flac","m4a","mp3","ogg","wav","webm"]),tLe=new Set(["m4v","mov","mp4","mpeg","mpg","ogg","webm"]),ZTt=new Set(["pdf"]),JTt=new Set(["doc","docx","ppt","pptx","xls","xlsx"]),e2t=new Set(["creating","indexing","pending","processing","queued","submitted"]),t2t=new Set(["error","failed","unavailable"]);function Ane(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}}function j_(e){if(e==null||e==="")return"-";if(["string","number","boolean"].includes(typeof e))return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function n2t(e,t){if(Array.isArray(e)){if(e.length===0)return null;const r=e.map(Ane);if(r.some(s=>Object.keys(s).length>0)){const s=[...new Set(r.flatMap(o=>Object.keys(o)))];return{columns:s,rows:r.map(o=>s.map(l=>j_(o[l])))}}return{columns:[t("knowledge.value")],rows:e.map(s=>[j_(s)])}}const n=Ane(e),i=Object.entries(n);if(i.length===0)return null;if(i.every(([,r])=>Array.isArray(r))){const r=i.map(([o])=>o),s=Math.max(...i.map(([,o])=>o.length));return{columns:r,rows:Array.from({length:s},(o,l)=>i.map(([,c])=>j_(c[l])))}}return{columns:[t("knowledge.field"),t("knowledge.value")],rows:i.map(([r,s])=>[r,j_(s)])}}function nLe(e){const t=e.trim();if(!t||t.startsWith("//"))return"";if(t.startsWith("/"))return t;try{const n=new URL(t);return["http:","https:"].includes(n.protocol)?n.href:""}catch{return""}}function i2t(e){const t=nLe(e);return t.startsWith("http://")||t.startsWith("https://")?t:""}function r2t(e){var r;const t=e.attachmentType.trim().toLocaleLowerCase();if(t==="image"||t==="doc-image"||t.startsWith("image/"))return"image";if(t==="audio"||t.startsWith("audio/"))return"audio";if(t==="video"||t.startsWith("video/"))return"video";if(t==="pdf"||t==="application/pdf")return"pdf";const n=e.attachmentUrl.split(/[?#]/,1)[0],i=n.includes(".")?((r=n.split(".").pop())==null?void 0:r.toLocaleLowerCase())??"":"";return JMe.has(i)?"image":eLe.has(i)?"audio":tLe.has(i)?"video":ZTt.has(i)?"pdf":t||i?"file":"none"}function s2t(e,t){const n=e.status.trim().toLocaleLowerCase();if(e2t.has(n))return{title:t("knowledge.preview.processingTitle"),detail:t("knowledge.preview.processingDetail")};if(t2t.has(n))return{title:t("knowledge.preview.failedTitle"),detail:t("knowledge.preview.failedDetail")};const i=l9(e).toLocaleLowerCase();return i==="pdf"||JTt.has(i)?{title:t("knowledge.preview.noParsedTitle"),detail:t("knowledge.preview.noParsedDetail")}:JMe.has(i)||eLe.has(i)||tLe.has(i)?{title:t("knowledge.preview.noMediaTitle"),detail:t("knowledge.preview.noMediaDetail")}:{title:t("knowledge.preview.noDataTitle"),detail:t("knowledge.preview.noDataDetail")}}function a2t({chunk:e}){const{t}=Te("ui"),[n,i]=p.useState(!1),r=nLe(e.attachmentUrl),s=r2t(e);return!r||s==="none"?null:n?a.jsx("div",{className:"knowledge-preview__attachment-error",children:t("knowledge.preview.attachmentError")}):s==="image"?a.jsx("img",{className:"knowledge-preview__image",src:r,alt:e.title||t("knowledge.preview.imageAlt"),loading:"lazy",onError:()=>i(!0)}):s==="audio"?a.jsx("audio",{className:"knowledge-preview__audio",src:r,controls:!0,preload:"metadata",onError:()=>i(!0),children:t("knowledge.preview.audioUnsupported")}):s==="video"?a.jsx("video",{className:"knowledge-preview__video",src:r,controls:!0,playsInline:!0,preload:"metadata",onError:()=>i(!0),children:t("knowledge.preview.videoUnsupported")}):s==="pdf"?a.jsxs("div",{className:"knowledge-preview__pdf",children:[a.jsx("iframe",{src:r,title:e.title?t("knowledge.preview.namedPdf",{name:e.title}):t("knowledge.preview.pdf"),sandbox:"",referrerPolicy:"no-referrer",onError:()=>i(!0)}),a.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:t("knowledge.preview.openPdf")})]}):a.jsxs("div",{className:"knowledge-preview__file-fallback",children:[a.jsx("p",{children:t("knowledge.preview.fileUnsupported")}),a.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:t("knowledge.preview.openOriginalFile")})]})}function o2t({base:e,item:t,onClose:n}){const{t:i}=Te("ui"),[r,s]=p.useState([]),[o,l]=p.useState(t),[c,u]=p.useState(""),[d,f]=p.useState(!0),[h,m]=p.useState(!1),[g,b]=p.useState(!1),[v,y]=p.useState(""),w=p.useRef(0),x=p.useRef(null),O=p.useCallback(async(E=0)=>{var R;(R=x.current)==null||R.abort();const j=new AbortController;x.current=j;const T=w.current+1;w.current=T,E>0?m(!0):f(!0),y(""),E===0&&(s([]),b(!1));try{const A=await Pbt(e.id,t.id,{region:e.region,offset:E,signal:j.signal});if(w.current!==T)return;l(A.document.id?A.document:t),u(A.sourceMarkdown||A.document.sourceMarkdown),s(N=>E>0?[...N,...A.chunks]:A.chunks),b(A.hasMore)}catch(A){!a9(A)&&w.current===T&&y(El(A,i("knowledge.errors.loadPreview")))}finally{w.current===T&&(f(!1),m(!1))}},[e.id,e.region,t,i]);p.useEffect(()=>(O(),()=>{var E;(E=x.current)==null||E.abort(),w.current+=1}),[O]);const k=i2t(o.url||t.url),S=s2t(o,i),C=o.metadata._veadk_content_format==="markdown";return a.jsx(yT,{title:o.name||t.name||t.id,onClose:n,className:"knowledge-dialog--preview",children:a.jsxs("div",{className:"knowledge-preview",children:[o.sizeBytes>0||k?a.jsxs("div",{className:"knowledge-preview__meta",children:[o.sizeBytes>0?a.jsx("span",{children:aq(o.sizeBytes)}):null,k?a.jsx("a",{href:k,target:"_blank",rel:"noopener noreferrer",children:i("knowledge.openOriginalWeb")}):null]}):null,a.jsx("div",{className:"knowledge-preview__body","aria-live":"polite",children:c?a.jsx("div",{className:"knowledge-preview__markdown-shell",children:a.jsx(Td,{text:c,allowRawHtml:!1,className:"knowledge-preview__markdown"})}):d?a.jsx("div",{className:"knowledge-preview__state",role:"status",children:a.jsx(fn,{as:"span",duration:2.4,children:i("knowledge.preview.loading")})}):v&&r.length===0?a.jsxs("div",{className:"knowledge-preview__state is-error",role:"alert",children:[a.jsx("p",{children:v}),a.jsx("button",{type:"button",onClick:()=>void O(),children:i("common.retry")})]}):r.length===0?a.jsxs("div",{className:"knowledge-preview__state",children:[a.jsx("p",{children:S.title}),a.jsx("span",{children:k?i("knowledge.preview.openOriginalHint"):S.detail}),a.jsx("button",{type:"button",onClick:()=>void O(),children:i("common.reload")})]}):a.jsxs("div",{className:"knowledge-preview__chunks",children:[r.map((E,j)=>{const T=n2t(E.tableFields,i),R=E.id||`${j}:${E.title}`;return a.jsxs("article",{className:"knowledge-preview__chunk",children:[a.jsx("header",{children:a.jsx("h3",{children:E.title||i("knowledge.preview.chunk",{index:j+1})})}),E.content?C?a.jsx(Td,{text:E.content,allowRawHtml:!1,className:"knowledge-preview__markdown"}):a.jsx("p",{className:"knowledge-preview__content",children:E.content}):null,T?a.jsx("div",{className:"knowledge-preview__table-wrap",children:a.jsxs("table",{children:[a.jsx("thead",{children:a.jsx("tr",{children:T.columns.map((A,N)=>a.jsx("th",{scope:"col",children:A},`${A}:${N}`))})}),a.jsx("tbody",{children:T.rows.map((A,N)=>a.jsx("tr",{children:A.map((P,I)=>a.jsx("td",{children:P},I))},N))})]})}):null,a.jsx(a2t,{chunk:E})]},R)}),v?a.jsx("div",{className:"knowledge-preview__more-error",role:"alert",children:v}):null,g?a.jsx("button",{type:"button",className:"knowledge-preview__load-more",disabled:h,onClick:()=>void O(r.length),children:h?a.jsx(fn,{as:"span",duration:2.4,children:i("knowledge.preview.loadingMore")}):i("knowledge.preview.loadMore")}):null]})})]})})}function l2t({cloudProvider:e,region:t,active:n=!0,activationRevision:i=0,onDetailChange:r,toolbarLeading:s,toolbarFilters:o}){const{t:l,i18n:c}=Te("ui"),[u,d]=p.useState([]),[f,h]=p.useState({}),[m,g]=p.useState([]),[b,v]=p.useState(""),[y,w]=p.useState("overview"),[x,O]=p.useState(""),[k,S]=p.useState(""),[C,E]=p.useState(!0),[j,T]=p.useState(!1),[R,A]=p.useState(""),[N,P]=p.useState([]),[I,D]=p.useState(!1),[_,L]=p.useState(""),[F,M]=p.useState(""),[V,q]=p.useState(""),[U,J]=p.useState(!1),[z,Z]=p.useState(!1),[ne,W]=p.useState(!1),[G,H]=p.useState(null),[se,Y]=p.useState(null),[X,ie]=p.useState(null),[ee,be]=p.useState(null),[ue,pe]=p.useState(null),[ke,je]=p.useState(!1),Pe=p.useRef(0),Ee=p.useRef(0),ze=p.useRef([]),_e=p.useRef(!1),ae=p.useRef(!1),le=p.useRef(null),ge=p.useRef(null),Oe=p.useRef({}),Se=p.useRef(!1),We=p.useRef(null),Ye=p.useRef(null),ye=p.useRef(null),we=p.useRef(null),Ae=p.useMemo(()=>[t],[t]),He=p.useCallback(Ke=>`${Ke.region}\0${Ke.id}`,[]),Ue=u.find(Ke=>He(Ke)===b)??null,jt=!!(Ue&&V===He(Ue));p.useEffect(()=>{r==null||r(!!Ue)},[r,Ue]),p.useEffect(()=>{w("overview"),S("")},[b]);const Pt=p.useMemo(()=>{const Ke=x.trim().toLocaleLowerCase();return Ke?u.filter(St=>[St.name,St.description,St.ownerLabel,St.providerKnowledgeId].some(qe=>qe.toLocaleLowerCase().includes(Ke))):u},[u,x]),Kt=p.useMemo(()=>{const Ke=k.trim().toLocaleLowerCase();return Ke?N.filter(St=>[St.name,St.id,l9(St)].some(qe=>qe.toLocaleLowerCase().includes(Ke))):N},[k,N]);p.useEffect(()=>{Y(null)},[Ue==null?void 0:Ue.id,Ue==null?void 0:Ue.region]);const Ct=p.useCallback(async(Ke=!1)=>{var nt;if(Ke&&(Se.current||Object.keys(Oe.current).length===0))return;(nt=le.current)==null||nt.abort();const St=new AbortController;le.current=St;const qe=Pe.current+1;Pe.current=qe,Se.current=!0,Ke?T(!0):E(!0),A(""),Ke||g([]);try{const et=await _bt({regions:Ae,nextTokens:Ke?Oe.current:void 0,signal:St.signal});if(Pe.current!==qe)return;d(Et=>Ke?[...Et,...et.items.filter(At=>!Et.some(It=>He(It)===He(At)))]:et.items),Oe.current=et.nextTokens,h(et.nextTokens);const ft=et.failures.map(({region:Et,error:At})=>`${wh(Et,e)}: ${El(At,l("common.loadFailed"))}`);g(Et=>Ke?[...new Set([...Et,...ft])]:ft),Ke||v(Et=>et.items.some(At=>He(At)===Et)?Et:"")}catch(et){if(a9(et))return;Pe.current===qe&&(Ke?g(ft=>[...new Set([...ft,El(et,l("knowledge.errors.loadMoreBases"))])]):A(El(et,l("knowledge.errors.loadBases"))))}finally{Pe.current===qe&&(Se.current=!1,E(!1),T(!1))}},[He,e,Ae,l]),xt=p.useCallback(async(Ke,St=!1)=>{var et;if(St&&_e.current)return;(et=ge.current)==null||et.abort();const qe=new AbortController;ge.current=qe;const nt=Ee.current+1;Ee.current=nt,St||(ze.current=[],ae.current=!1,P([]),J(!1),M("")),_e.current=!0,D(!0),St?M(""):L("");try{const ft=await Ibt(Ke.id,{region:Ke.region,offset:St?ze.current.length:0,signal:qe.signal});if(Ee.current!==nt)return;q(Gt=>Gt===He(Ke)?"":Gt);const Et=ze.current,At=St?[...Et,...ft.items.filter(Gt=>!Gt.id||!Et.some(Xe=>Xe.id===Gt.id))]:ft.items,It=ft.hasMore&&(!St||At.length>Et.length);ze.current=At,ae.current=It,P(At),J(It)}catch(ft){if(a9(ft))return;Ee.current===nt&&(ft instanceof bM&&ft.errorCode===sPe&&(q(He(Ke)),H(At=>At&&He(At)===He(Ke)?null:At)),St?M(El(ft,l("knowledge.errors.loadMoreData"))):L(El(ft,l("knowledge.errors.loadData"))))}finally{Ee.current===nt&&(_e.current=!1,D(!1))}},[He,l]);p.useEffect(()=>{var Ke;(Ke=le.current)==null||Ke.abort(),Pe.current+=1,Se.current=!1,Oe.current={},d([]),h({}),g([]),v(""),q(""),A(""),E(!0)},[e]),p.useEffect(()=>{if(n)return Ct(),()=>{var Ke;(Ke=le.current)==null||Ke.abort(),Pe.current+=1,Se.current=!1}},[n,i,Ct]),p.useEffect(()=>{var Ke,St;if(!n){(Ke=ge.current)==null||Ke.abort(),Ee.current+=1,_e.current=!1;return}if(!Ue){(St=ge.current)==null||St.abort(),Ee.current+=1,ze.current=[],_e.current=!1,ae.current=!1,P([]),J(!1),M("");return}return xt(Ue),()=>{var qe;(qe=ge.current)==null||qe.abort(),Ee.current+=1,_e.current=!1}},[n,i,Ue==null?void 0:Ue.id,Ue==null?void 0:Ue.region]);const tt=n&&!Ue&&!x.trim()&&!C&&!j&&!R&&Object.keys(f).length>0;p.useEffect(()=>{const Ke=Ye.current,St=We.current;if(!Ke||!St||!tt)return;const qe=new IntersectionObserver(([nt])=>{nt.isIntersecting&&Ct(!0)},{root:St,rootMargin:"240px 0px",threshold:.01});return qe.observe(Ke),()=>qe.disconnect()},[tt,Ct]);const mt=()=>{const Ke=We.current;!Ke||!tt||Ke.scrollHeight-Ke.scrollTop-Ke.clientHeight<=240&&Ct(!0)},Ne=!!(Ue&&N.length>0&&U&&!I&&!F);p.useEffect(()=>{const Ke=we.current,St=ye.current;if(!Ue||!Ke||!St||!Ne)return;const qe=new IntersectionObserver(([nt])=>{nt.isIntersecting&&xt(Ue,!0)},{root:ye.current,rootMargin:"240px 0px",threshold:.01});return qe.observe(Ke),()=>qe.disconnect()},[Ne,xt,Ue==null?void 0:Ue.id,Ue==null?void 0:Ue.region]);const Ot=()=>{const Ke=ye.current;if(!Ue||!Ke||!ae.current||_e.current||F)return;const{scrollHeight:St,scrollTop:qe,clientHeight:nt}=Ke;St-qe-nt<=240&&xt(Ue,!0)},Nt=Ke=>{d(St=>St.map(qe=>He(qe)===He(Ke)?Ke:qe))},Yt=async()=>{if(ee){je(!0);try{await Rbt(ee.id,ee.region),d(Ke=>Ke.filter(St=>He(St)!==He(ee))),q(Ke=>Ke===He(ee)?"":Ke),b===He(ee)&&v(""),be(null)}catch(Ke){A(El(Ke,l("knowledge.errors.deleteBase"))),be(null)}finally{je(!1)}}},xn=async()=>{if(!(!Ue||!ue)){je(!0);try{await Fbt(Ue.id,ue.id,Ue.region);const Ke=ze.current.filter(St=>St.id!==ue.id);ze.current=Ke,P(Ke),pe(null)}catch(Ke){L(El(Ke,l("knowledge.errors.deleteDocument"))),pe(null)}finally{je(!1)}}};return a.jsxs("section",{className:`knowledge-library${Ue?" is-detail":" resource-collection"}`,"aria-label":l("knowledge.library"),children:[Ue?a.jsx(oT,{className:"knowledge-library__detail",title:Ue.name,description:Ue.description||l("common.noDescription"),identitySeed:Ue.name,backLabel:l("knowledge.backToList"),onBack:()=>v(""),sections:[{key:"overview",label:l("skillCenter.overview"),content:a.jsx("section",{className:"knowledge-overview",children:a.jsxs(bH,{className:"knowledge-overview__summary",children:[a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.provider")}),a.jsx("dd",{children:Ue.providerType||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.knowledgeId")}),a.jsx("dd",{className:"knowledge-keyboard-reveal",tabIndex:0,title:Ue.providerKnowledgeId,children:Ue.providerKnowledgeId||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.project")}),a.jsx("dd",{children:Ue.projectName||"default"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.creator")}),a.jsx("dd",{children:P4(Ue.ownerLabel)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("skillCenter.updatedAt")}),a.jsx("dd",{children:zTt(Ue.updatedAt,c.resolvedLanguage??c.language)||"-"})]})]})})},{key:"data",label:l("knowledge.data"),content:a.jsx("section",{className:"knowledge-documents",children:a.jsx("div",{className:`knowledge-documents__body${N.length>0?" is-table":""}`,"aria-live":"polite",children:I&&N.length===0?a.jsx(cl,{}):_&&N.length===0?a.jsxs("div",{className:"knowledge-library__state is-error",role:"alert",children:[a.jsx("p",{children:_}),jt&&Ue.canManage?a.jsx("button",{type:"button",onClick:()=>be(Ue),children:l("knowledge.deleteInvalidAssociation")}):a.jsx("button",{type:"button",onClick:()=>void xt(Ue),children:l("common.retry")})]}):N.length===0?a.jsxs("div",{className:"knowledge-library__state",children:[a.jsx(BTt,{}),a.jsx("p",{children:l("knowledge.noData")}),Ue.canManage&&a.jsx("button",{type:"button",onClick:()=>H(Ue),children:l("knowledge.addFirstData")})]}):a.jsx(yH,{rows:Kt,rowKey:Ke=>Ke.id,rowLabel:Ke=>Ke.name||Ke.id,columns:[{key:"name",header:l("common.name"),className:"is-primary-column",render:Ke=>a.jsx("span",{title:Ke.name||Ke.id,children:Ke.name||Ke.id})},{key:"format",header:l("knowledge.format"),className:"is-compact-column",render:Ke=>l9(Ke)},{key:"size",header:l("knowledge.size"),className:"is-compact-column",render:Ke=>aq(Ke.sizeBytes)}],searchValue:k,onSearchChange:S,searchPlaceholder:l("knowledge.searchData"),searchLabel:l("knowledge.searchLibraryData"),primaryAction:Ue.canManage?{label:l(jt?"knowledge.associationInvalid":"knowledge.addData"),disabled:jt,title:jt?l("knowledge.providerMissing"):void 0,onClick:()=>H(Ue)}:void 0,rowActions:Ke=>[{label:l("common.preview"),onSelect:()=>Y(Ke)},...Ue.canManage?[{label:l("common.edit"),onSelect:()=>ie(Ke)},{label:l("common.delete"),onSelect:()=>pe(Ke),danger:!0}]:[]],scrollRef:ye,onScroll:Ot,busy:I,emptyLabel:l("knowledge.noMatchingData"),footer:I?a.jsxs("div",{className:"knowledge-document-pagination",role:"status","aria-live":"polite",children:[a.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),a.jsx("span",{children:l("knowledge.loadingMoreData")})]}):F?a.jsxs("div",{className:"knowledge-document-pagination is-error",role:"alert",children:[a.jsx("span",{children:F}),a.jsx("button",{type:"button",onClick:()=>void xt(Ue,!0),children:l("knowledge.retryLoading")})]}):U?a.jsx("div",{ref:we,className:"knowledge-document-pagination",role:"status","aria-live":"polite",children:l("skillCenter.scrollForMore")}):null})})})}],activeSectionKey:y,navigationLabel:l("knowledge.details"),onSectionChange:w,actions:Ue.canManage?a.jsxs(a.Fragment,{children:[a.jsx(_t,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>be(Ue),children:l("common.delete")}),a.jsx(_t,{type:"button",color:"primary",size:"lg",pill:!1,onClick:()=>W(!0),children:l("common.edit")})]}):void 0}):a.jsxs(a.Fragment,{children:[a.jsxs(sb,{className:"knowledge-library__toolbar library-resource-toolbar",children:[s,a.jsxs("div",{className:"resource-toolbar__actions",children:[o,a.jsx(Zp,{value:x,onChange:Ke=>O(Ke.target.value),placeholder:l("knowledge.searchBases"),"aria-label":l("knowledge.searchBases")})]})]}),a.jsxs(Jp,{ref:We,"aria-live":"polite",onScroll:mt,children:[m.length>0&&!C&&a.jsxs("div",{className:"knowledge-region-warning",role:"status",children:[a.jsx("span",{children:l("knowledge.someBasesFailed")}),a.jsx("button",{type:"button",onClick:()=>void Ct(),children:l("common.retry")})]}),C&&u.length===0?a.jsx(cl,{}):R?a.jsxs("div",{className:"knowledge-library__state is-error",role:"alert",children:[a.jsx("p",{children:R}),a.jsx("button",{type:"button",onClick:()=>void Ct(),children:l("common.retry")})]}):Pt.length===0&&x.trim()?a.jsxs("div",{className:"knowledge-library__state",children:[a.jsx(FTt,{}),a.jsx("p",{children:l("knowledge.noMatchingBases")})]}):a.jsxs(W0,{children:[x.trim()?null:a.jsx(lb,{"aria-label":l("knowledge.createBase"),icon:a.jsx(QTt,{}),onClick:()=>Z(!0),children:l("knowledge.createBase")}),Pt.map(Ke=>a.jsx(G0,{className:"knowledge-card",title:Ke.name,description:Ke.description||l("common.noDescription"),metadata:[{label:l("knowledge.creator"),value:P4(Ke.ownerLabel),title:P4(Ke.ownerLabel)},{label:l("knowledge.project"),value:Ke.projectName||"default",title:Ke.projectName||"default"}],action:{label:V===He(Ke)?l("knowledge.associationInvalid"):l("knowledge.addData"),icon:"plus",disabled:!Ke.canManage||V===He(Ke),title:Ke.canManage?V===He(Ke)?l("knowledge.providerMissing"):void 0:l("knowledge.noManagePermission"),onClick:()=>H(Ke)},detailAction:{label:l("common.viewDetails"),onClick:()=>v(He(Ke))}},He(Ke)))]}),tt||j?a.jsx("div",{ref:Ye,className:"my-agent-load-more",role:"status","aria-live":"polite",children:j?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),a.jsx("span",{children:l("knowledge.loadingMoreBases")})]}):tt?a.jsx("span",{children:l("skillCenter.scrollForMore")}):null}):null]})]}),z&&a.jsx(KTt,{region:t,onClose:()=>Z(!1),onCreated:Ke=>{d(St=>[Ke,...St]),v(He(Ke)),Z(!1)}}),Ue&&ne&&a.jsx(GTt,{item:Ue,onClose:()=>W(!1),onUpdated:Ke=>{Nt(Ke),W(!1)}}),Ue&&se&&a.jsx(o2t,{base:Ue,item:se,onClose:()=>Y(null)}),G&&a.jsx(XTt,{base:G,onClose:()=>H(null),onAssociationInvalid:Ke=>{q(He(G)),Ue&&He(Ue)===He(G)&&L(El(Ke,l("knowledge.associationInvalid"))),H(null)},onCreated:()=>{Ue&&He(Ue)===He(G)&&xt(Ue),H(null)}}),Ue&&X&&a.jsx(YTt,{base:Ue,item:X,onClose:()=>ie(null),onUpdated:Ke=>{const St=ze.current.map(qe=>qe.id===Ke.id?Ke:qe);ze.current=St,P(St),ie(null)}}),ee&&a.jsx(Cd,{title:l("knowledge.deleteBaseTitle"),description:l("knowledge.deleteBaseDescription",{name:ee.name}),confirmLabel:l(ke?"common.deleting":"common.delete"),variant:"danger",busy:ke,onCancel:()=>be(null),onConfirm:()=>void Yt()}),ue&&a.jsx(Cd,{title:l("knowledge.deleteDocumentTitle"),description:l("knowledge.deleteDocumentDescription",{name:ue.name||ue.id}),confirmLabel:l(ke?"common.deleting":"common.delete"),variant:"danger",busy:ke,onCancel:()=>pe(null),onConfirm:()=>void xn()})]})}const c2t="_EmptyMessage_1r5gu_1",u2t="_IconBadge_1r5gu_16",d2t="_Title_1r5gu_54",f2t="_Description_1r5gu_69",h2t="_ActionRow_1r5gu_77",vT={EmptyMessage:c2t,IconBadge:u2t,Title:d2t,Description:f2t,ActionRow:h2t},Wn=({children:e,className:t,fill:n="static"})=>a.jsx("div",{className:Ui(vT.EmptyMessage,t),"data-fill":n,children:e}),p2t=({size:e="md",color:t="secondary",children:n,className:i})=>a.jsx("div",{className:Ui(vT.IconBadge,i),"data-size":e,"data-color":t,children:n}),m2t=({children:e,className:t,color:n="secondary"})=>a.jsx("div",{className:Ui(vT.Title,t),"data-color":n,children:e}),g2t=({children:e,className:t})=>a.jsx("div",{className:Ui(vT.Description,t),children:e}),b2t=({children:e,className:t})=>a.jsx("div",{className:Ui(vT.ActionRow,t),children:e});Wn.Icon=p2t;Wn.Title=m2t;Wn.Description=g2t;Wn.ActionRow=b2t;bn.hasResourceBundle("en-US","skills")||bn.addResourceBundle("en-US","skills",zme,!0,!0);bn.hasResourceBundle("zh-CN","skills")||bn.addResourceBundle("zh-CN","skills",Gwe,!0,!0);function en(e,t={}){return bn.t(e,{...t,ns:"skills"})}const y2t="/web/skill-workbench";class c9 extends Error{constructor(t,n,i="SKILL_WORKBENCH_ERROR",r=!1,s="",o,l=""){super(t),this.status=n,this.code=i,this.retryable=r,this.statusText=s,this.originalError=o,this.rawResponse=l,this.name="SkillWorkbenchApiError"}}function Od(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(en("api.invalidFormat",{label:t}));return e}function Tne(e,t){if(e!=null){if(typeof e!="string"||!e.trim()||e.trim().length>256)throw new Error(en("api.invalidFormat",{label:t}));return e.trim()}}function v2t(e){if(e!=null){if(e==="pending"||e==="ready"||e==="failed"||e==="unknown")return e;throw new Error(en("api.invalidFormat",{label:en("api.recoveryStatus")}))}}async function Sh(e,t={},n=ho){return fetch(Ta(`${y2t}${e}`),{...t,headers:uc(t.headers),signal:po(t.signal,n)})}async function oq(e,t){var i;const n=await e.text().catch(()=>"");try{const r=Od(JSON.parse(n),en("api.errorResponse")),s=r.detail&&typeof r.detail=="object"?Od(r.detail,en("api.errorDetails")):r;return new c9(typeof s.message=="string"?s.message:t,e.status,typeof s.code=="string"?s.code:"SKILL_WORKBENCH_ERROR",s.retryable===!0,e.statusText,s.originalError&&typeof s.originalError=="object"?s.originalError:void 0,n)}catch{const r=((i=e.headers.get("content-type"))==null?void 0:i.split(";",1)[0])||en("api.missingContentType");return new c9(en("api.gatewayError",{fallback:t,status:e.status,contentType:r}),e.status,"SKILL_WORKBENCH_ERROR",!1,e.statusText,void 0,n)}}async function ub(e,t){if(!e.ok)throw await oq(e,t);const n=e.headers.get("content-type")??"";if(!n.includes("application/json")){const i=n.split(";",1)[0]||en("api.missingContentType");throw new Error(en("api.nonJson",{fallback:t,status:e.status,contentType:i}))}return e.json()}function x2t(e){return Array.isArray(e)?e.map(t=>{const n=Od(t,en("api.activity")),i=n.kind,r=n.status;if(typeof n.id!="string"||!["status","thinking","message","tool"].includes(String(i))||!["running","done"].includes(String(r)))throw new Error(en("api.invalidActivity"));if(i==="tool"){if(typeof n.name!="string")throw new Error(en("api.invalidToolActivity"));return{id:n.id,kind:i,status:r,name:n.name,...n.input!==void 0?{args:n.input}:{},...n.output!==void 0?{response:n.output}:{}}}if(typeof n.text!="string")throw new Error(en("api.invalidTextActivity"));return{id:n.id,kind:i,status:r,text:n.text}}):[]}function w2t(e){if(e==null)return;const t=Od(e,en("api.publication"));if(typeof t.revision!="number"||typeof t.skillId!="string"||typeof t.version!="string"||!Array.isArray(t.skillSpaceIds)||!t.skillSpaceIds.every(n=>typeof n=="string")||t.disposition!=="create-new"&&t.disposition!=="update-source"||!AD(t.region)||typeof t.projectName!="string")throw new Error(en("api.invalidFormat",{label:en("api.publication")}));return{revision:t.revision,skillId:t.skillId,version:t.version,skillSpaceIds:t.skillSpaceIds,disposition:t.disposition,region:t.region,projectName:t.projectName}}function TC(e){const t=Od(e,en("api.task"));if(typeof t.jobId!="string"||t.operation!=="create"&&t.operation!=="optimize"||typeof t.intent!="string"||typeof t.revision!="number"||typeof t.state!="string")throw new Error(en("api.invalidFormat",{label:en("api.task")}));const n=Array.isArray(t.files)?t.files.flatMap(l=>{const c=Od(l,en("api.file"));return typeof c.path=="string"&&typeof c.size=="number"?[{path:c.path,size:c.size}]:[]}):[];if(!["running","ready","failed","cancelled","expired","published"].includes(t.state))throw new Error(en("api.unknownTaskState"));const r=Tne(t.toolId,"Tool ID"),s=Tne(t.sessionId,"Session ID"),o=v2t(t.recoveryStatus);return{jobId:t.jobId,operation:t.operation,intent:t.intent,...typeof t.model=="string"?{model:t.model}:{},...typeof t.style=="string"?{style:t.style}:{},...typeof t.requestedName=="string"?{requestedName:t.requestedName}:{},revision:t.revision,...r?{toolId:r}:{},...s?{sessionId:s}:{},...typeof t.sessionTtlSeconds=="number"?{sessionTtlSeconds:t.sessionTtlSeconds}:{},...typeof t.expiresAt=="string"?{expiresAt:t.expiresAt}:{},...typeof t.recoveryAvailable=="boolean"?{recoveryAvailable:t.recoveryAvailable}:{},...o?{recoveryStatus:o}:{},...typeof t.recoveredFromSnapshot=="boolean"?{recoveredFromSnapshot:t.recoveredFromSnapshot}:{},state:t.state,stage:typeof t.stage=="string"?t.stage:"generating",activities:x2t(t.activities),files:n,...t.source&&typeof t.source=="object"?{source:t.source}:{},...typeof t.name=="string"?{name:t.name}:{},...typeof t.description=="string"?{description:t.description}:{},...typeof t.skillMd=="string"?{skillMd:t.skillMd}:{},...typeof t.error=="string"?{error:t.error}:{},...t.validation&&typeof t.validation=="object"?{validation:t.validation}:{},...t.publication?{publication:w2t(t.publication)}:{}}}async function NM(e){const t=Od(await ub(await Sh("/capabilities",{signal:e}),en("api.loadCapability")),en("api.capability"));return{enabled:t.enabled===!0,reason:typeof t.reason=="string"?t.reason:"",operations:Array.isArray(t.operations)?t.operations.filter(n=>n==="create"||n==="optimize"):[],models:Array.isArray(t.models)?t.models.flatMap(n=>{if(!n||typeof n!="object")return[];const i=n;return typeof i.id=="string"&&typeof i.label=="string"?[{id:i.id,label:i.label}]:[]}):[],styles:t.styles&&typeof t.styles=="object"&&!Array.isArray(t.styles)?Object.fromEntries(Object.entries(t.styles).filter(n=>typeof n[1]=="string")):{},...typeof t.maxUploadBytes=="number"?{maxUploadBytes:t.maxUploadBytes}:{}}}async function O2t(e){if(e.file){const n=new URLSearchParams({operation:"optimize",intent:e.intent});e.jobId&&n.set("job_id",e.jobId),e.model&&n.set("model",e.model),e.style&&n.set("style",e.style),e.name&&n.set("name",e.name);const i=await Sh(`/tasks/from-upload?${n}`,{method:"POST",body:e.file,headers:{"Content-Type":"application/zip"},signal:e.signal},hr);return TC(await ub(i,en("api.startOptimization")))}const t=await Sh("/tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operation:e.operation,intent:e.intent,...e.model?{model:e.model}:{},...e.style?{style:e.style}:{},...e.name?{name:e.name}:{},...e.jobId?{jobId:e.jobId}:{},...e.source?{source:{kind:"skill-center",skillId:e.source.skillId,skillName:e.source.name,version:e.source.version,region:e.source.region,projectName:e.source.projectName,skillSpaceId:e.source.skillSpaceId,skillSpaceName:e.source.skillSpaceName}}:{}}),signal:e.signal},hr);return TC(await ub(t,en("api.startTask")))}async function k2t(e,t){return TC(await ub(await Sh(`/tasks/${encodeURIComponent(e)}`,{signal:t}),en("api.loadTask")))}async function D4(e,t,n){const i=new URLSearchParams;i.set("expected_revision",String(t));const r=Od(await ub(await Sh(`/tasks/${encodeURIComponent(e)}/artifact?${i.toString()}`,{signal:n}),en("api.loadArtifact")),en("api.artifact"));if(r.jobId!==e||r.revision!==t||!Number.isSafeInteger(r.revision)||r.revision<1||typeof r.sha256!="string"||!/^[0-9a-f]{64}$/.test(r.sha256)||typeof r.name!="string"||typeof r.description!="string"||!Array.isArray(r.files))throw new Error(en("api.invalidFormat",{label:en("api.artifact")}));const s=r.files.map(o=>{const l=Od(o,en("api.artifactFile"));if(typeof l.path!="string"||typeof l.size!="number"||typeof l.content!="string")throw new Error(en("api.invalidFormat",{label:en("api.artifactFile")}));return{path:l.path,size:l.size,content:l.content}});return{jobId:r.jobId,revision:r.revision,sha256:r.sha256,name:r.name,description:r.description,files:s}}async function M4(e){const t=await Sh(`/tasks/${encodeURIComponent(e.jobId)}/refinements`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({intent:e.intent,expectedRevision:e.expectedRevision})},hr);return TC(await ub(t,en("api.refine")))}async function S2t(e){const t=await Sh(`/tasks/${encodeURIComponent(e.jobId)}/stop`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expectedRevision:e.expectedRevision})});return TC(await ub(t,en("api.stop")))}async function E2t(e){const t=await Sh(`/tasks/${encodeURIComponent(e.jobId)}/publish-stream`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/x-ndjson"},body:JSON.stringify({disposition:e.disposition,expectedRevision:e.expectedRevision,expectedArtifactSha256:e.expectedArtifactSha256,skillSpaceIds:e.skillSpaceIds??[],projectName:e.projectName,region:e.region}),signal:e.signal},0);if(!t.ok)throw await oq(t,en("api.publish"));if(!(t.headers.get("content-type")??"").includes("application/x-ndjson"))throw new Error(en("api.nonNdjson"));if(!t.body)throw new Error(en("api.missingStream"));const i=new Set(["preparing","uploading","registering","activating","publishing"]);let r=null,s="";const o=new TextDecoder,l=t.body.getReader(),c=u=>{var h;if(!u.trim())return;const d=Od(JSON.parse(u),en("api.publishProgress"));if(d.type==="progress"){if(typeof d.phase!="string"||!i.has(d.phase)||typeof d.message!="string")throw new Error(en("api.invalidPublishProgress"));(h=e.onProgress)==null||h.call(e,{phase:d.phase,message:d.message});return}if(d.type==="error"){const m=Od(d.error,en("api.publishError"));throw new c9(typeof m.message=="string"?m.message:en("api.publish"),500,typeof m.code=="string"?m.code:"SKILL_PUBLISH_FAILED",m.retryable===!0,"",m.originalError&&typeof m.originalError=="object"?m.originalError:void 0,JSON.stringify(d.error))}if(d.type!=="complete")throw new Error(en("api.unknownPublishEvent"));const f=Od(d.result,en("api.publishResult"));if(typeof f.skillId!="string"||typeof f.version!="string"||!Array.isArray(f.skillSpaceIds)||!f.skillSpaceIds.every(m=>typeof m=="string")||f.disposition!=="create-new"&&f.disposition!=="update-source"||!AD(f.region)||typeof f.projectName!="string")throw new Error(en("api.invalidFormat",{label:en("api.publishResult")}));r={skillId:f.skillId,version:f.version,skillSpaceIds:f.skillSpaceIds,disposition:f.disposition,region:f.region,projectName:f.projectName}};for(;;){const{value:u,done:d}=await l.read();s+=o.decode(u,{stream:!d});const f=s.split(` +`);if(s=f.pop()??"",f.forEach(c),d)break}if(c(s),!r)throw new Error(en("api.streamEnded"));return r}async function C2t(e){await ub(await Sh(`/tasks/${encodeURIComponent(e)}`,{method:"DELETE"}),en("api.deleteTask"))}async function A2t(e,t,n){var c;const i=new URLSearchParams;i.set("expected_revision",String(t)),i.set("expected_sha256",n);const r=await Sh(`/tasks/${encodeURIComponent(e)}/download?${i.toString()}`,{},hr);if(!r.ok)throw await oq(r,en("api.download"));const o=((c=(r.headers.get("content-disposition")??"").match(/filename="([^"]+)"/))==null?void 0:c[1])??"skill.zip",l=URL.createObjectURL(await r.blob());try{const u=document.createElement("a");u.href=l,u.download=o,u.click()}finally{URL.revokeObjectURL(l)}}const iLe=p.createContext(void 0);function ev(e){const t=p.useContext(iLe);if(t===void 0&&!e)throw new Error(Vc(47));return t}const T2t={...mje,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class _2t extends BD{constructor(n,i,r){const s=new cV;super(j2t(n,s,i,r),N2t(s),T2t);Zt(this,"setOpen",(n,i)=>{var f,h;const r=i.reason===mu,s=i.reason===Yw&&i.event.detail===0,o=!n&&(i.reason===T_e||i.reason==null),l=sst(i),c=this.select("activeTriggerId");if(!n&&i.reason===A_e&&i.trigger==null&&c!=null&&(i.trigger=this.context.triggerElements.getById(c)??this.select("activeTriggerElement")??void 0),(h=(f=this.context).onOpenChange)==null||h.call(f,n,i),i.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,i);const u=()=>{const m={open:n,openChangeReason:i.reason};aje(m,n,i.trigger,l()),this.update(m)};r?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(Iit,()=>{this.set("stickIfOpen",!1)}),yi.flushSync(u)):u();let d;s?d="click":o?d="dismiss":i.reason===cC&&(d="focus"),this.set("instantType",d)})}}function j2t(e,t,n,i=!1){const r={...fje(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return r.open&&(e==null?void 0:e.mounted)===void 0&&(r.mounted=!0),r.floatingRootContext=hje(t,n,i),r}function N2t(e){return{popupRef:p.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:p.createRef(),beforeContentFocusGuardRef:p.createRef(),stickIfOpenTimeout:new Lu,triggerElements:e}}function _ne({props:e}){const{children:t,open:n,defaultOpen:i=!1,onOpenChange:r,onOpenChangeComplete:s,modal:o=!1,handle:l,triggerId:c,defaultTriggerId:u=null}=e,d=I2t(l,{modal:o,open:i,openProp:n,activeTriggerId:u,triggerIdProp:c});d.useControlledProp("openProp",n),d.useControlledProp("triggerIdProp",c);const f=d.useState("open"),h=d.useState("mounted"),m=d.useState("payload");d.useContextCallback("onOpenChange",r),d.useContextCallback("onOpenChangeComplete",s),dje(d,f),lje(d);const{forceUnmount:g}=cje(f,d,()=>{d.update({stickIfOpen:!0,openChangeReason:null})});d.useSyncedValues({modal:o}),p.useEffect(()=>{f||d.context.stickIfOpenTimeout.clear()},[d,f]),p.useImperativeHandle(e.actionsRef,()=>({unmount:g,close:()=>d.setOpen(!1,fa(__e))}),[g,d]);const b=f||h;return a.jsxs(iLe.Provider,{value:d,children:[l&&a.jsx(sje,{handle:l,store:d}),b&&a.jsx(P2t,{store:d,modal:o}),typeof t=="function"?t({payload:m}):t]})}function R2t(e){return ev(!0)?a.jsx(_ne,{props:e}):a.jsx(frt,{children:a.jsx(_ne,{props:e})})}function I2t(e,t){const n=rje((i,r)=>new _2t(t,i,r));return p.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function P2t({store:e,modal:t}){const n=e.useState("floatingRootContext"),i=U_e(n,{outsidePressEvent:{mouse:t==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),r=i.reference,s=i.floating;return uje(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:s}),null}const D2t=300;function em(e){return VA(e,"base-ui")}function M2t(e,t){const n=p.useRef(null);function i(s){yi.flushSync(()=>{e.setOpen(!1,fa(cC,s.nativeEvent,s.currentTarget))});const o=cit(n.current);o==null||o.focus()}function r(s){var l;const o=e.select("positionerElement");if(o&&rw(s,o))(l=e.context.beforeContentFocusGuardRef.current)==null||l.focus();else{yi.flushSync(()=>{e.setOpen(!1,fa(cC,s.nativeEvent,s.currentTarget))});let c=lit(e.context.triggerFocusTargetRef.current||t.current);for(;c!==null&&ii(o,c);){const u=c;if(c=Jz(c),c===u)break}c==null||c.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:i,handleFocusTargetFocus:r}}function L2t(e){const t=p.useRef(""),n=p.useCallback(r=>{r.defaultPrevented||(t.current=r.pointerType,e(r,r.pointerType))},[e]);return{onClick:p.useCallback(r=>{if(r.detail===0){e(r,"keyboard");return}"pointerType"in r?e(r,r.pointerType):e(r,t.current),t.current=""},[e]),onPointerDown:n}}function rLe(e,t){const n=ci((s,o)=>{(typeof e=="function"?e():e)||t(o||(HD?"touch":""))}),{onClick:i,onPointerDown:r}=L2t(n);return p.useMemo(()=>({onClick:i,onPointerDown:r}),[i,r])}const $2t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,disabled:o=!1,nativeButton:l=!0,handle:c,payload:u,openOnHover:d=!1,delay:f=D2t,closeDelay:h=0,id:m,...g}=t,b=ev(!0),y=gje(c)??b;if(!y)throw new Error(Vc(74));const w=em(m),x=y.useState("isTriggerActive",w),O=y.useState("floatingRootContext"),k=y.useState("isOpenedByTrigger",w),S=y.useState("triggerPopupId",w),C=p.useRef(null),{registerTrigger:E,isMountedByThisTrigger:j}=oje(w,C,y,{payload:u,disabled:o,openOnHover:d,closeDelay:h}),T=y.useState("openChangeReason"),R=y.useState("stickIfOpen"),A=y.useState("openMethod"),N=y.useState("focusManagerModal"),P=fst(O,{enabled:!o&&d&&(A!=="touch"||T!==Yw),mouseOnly:!0,move:!1,handleClose:mst(),restMs:f,delay:{close:h},triggerElementRef:C,isActiveTrigger:x,isClosing:()=>y.select("transitionStatus")==="ending"}),I=B_e(O,{stickIfOpen:R}),D=rLe(()=>y.select("open"),ne=>{y.set("openMethod",ne)}),_=y.useState("triggerProps",j),{getButtonProps:L,buttonRef:F}=GD({disabled:o,native:l}),M={open(ne){return ne&&T===Yw?_st.open(ne):xje.open(ne)}},{preFocusGuardRef:V,handlePreFocusGuardFocus:q,handleFocusTargetFocus:U}=M2t(y,C),z=Ra("button",t,{state:{disabled:o,open:k},ref:[F,n,E,C],props:[I.reference,P,_,D,{[sV]:"",id:w,"aria-haspopup":"dialog","aria-expanded":k,"aria-controls":S},g,L],stateAttributesMapping:M}),Z=a.jsx(p.Fragment,{children:z},w);return j&&!N?a.jsxs(p.Fragment,{children:[a.jsx(f0,{ref:V,onFocus:q}),Z,a.jsx(f0,{ref:y.context.triggerFocusTargetRef,onFocus:U})]}):Z}),sLe=p.createContext(void 0);function F2t(){const e=p.useContext(sLe);if(e===void 0)throw new Error(Vc(45));return e}const B2t=p.forwardRef(function(t,n){const{keepMounted:i=!1,...r}=t;return ev().useState("mounted")||i?a.jsx(sLe.Provider,{value:i,children:a.jsx(I_e,{ref:n,...r})}):null}),aLe=p.createContext(void 0);function U2t(){const e=p.useContext(aLe);if(!e)throw new Error(Vc(46));return e}const oLe=p.forwardRef(function(t,n){const{cutout:i,...r}=t;let s;if(i){const o=i.getBoundingClientRect();s=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${o.left}px ${o.top}px,${o.left}px ${o.bottom}px,${o.right}px ${o.bottom}px,${o.right}px ${o.top}px,${o.left}px ${o.top}px)`}return a.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...r,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});let jne={},Nne={},Rne="";function RM(e,t){return UA(e)?e:t}function Ine(e,t,n){return/hidden|clip/.test(e.getComputedStyle(RM(t,n)).overflowY)}function Q2t(e){if(typeof document>"u")return!1;const t=kr(e);return ta(t).innerWidth-t.documentElement.clientWidth>0}function z2t(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=kr(e),i=n.documentElement,r=n.body,s=RM(i,r),o=s.style.overflowY,l=i.style.scrollbarGutter;i.style.scrollbarGutter="stable",s.style.overflowY="scroll";const c=s.offsetWidth;s.style.overflowY="hidden";const u=s.offsetWidth;return s.style.overflowY=o,i.style.scrollbarGutter=l,c===u}function V2t(e){const t=kr(e),n=t.documentElement,i=t.body,r=RM(n,i),s={overflowY:r.style.overflowY,overflowX:r.style.overflowX};return Object.assign(r.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(r.style,s)}}function H2t(e){var m;const t=kr(e),n=t.documentElement,i=t.body,r=ta(n);let s=0,o=0,l=!1;const c=_c.create();if(z1&&(((m=r.visualViewport)==null?void 0:m.scale)??1)!==1)return()=>{};function u(){const g=r.getComputedStyle(n),b=r.getComputedStyle(i),w=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,o=n.scrollLeft,jne={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Rne=n.style.scrollBehavior,Nne={position:i.style.position,height:i.style.height,width:i.style.width,boxSizing:i.style.boxSizing,overflowY:i.style.overflowY,overflowX:i.style.overflowX,scrollBehavior:i.style.scrollBehavior};const x=n.scrollHeight>n.clientHeight,O=n.scrollWidth>n.clientWidth,k=g.overflowY==="scroll"||b.overflowY==="scroll",S=g.overflowX==="scroll"||b.overflowX==="scroll",C=Math.max(0,r.innerWidth-i.clientWidth),E=Math.max(0,r.innerHeight-i.clientHeight),j=parseFloat(b.marginTop)+parseFloat(b.marginBottom),T=parseFloat(b.marginLeft)+parseFloat(b.marginRight),R=RM(n,i);if(l=z2t(e),l){n.style.scrollbarGutter=w,R.style.overflowY="hidden",R.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:w,overflowY:"hidden",overflowX:"hidden"}),(x||k)&&(n.style.overflowY="scroll"),(O||S)&&(n.style.overflowX="scroll"),Object.assign(i.style,{position:"relative",height:j||E?`calc(100dvh - ${j+E}px)`:"100dvh",width:T||C?`calc(100vw - ${T+C}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),i.scrollTop=s,i.scrollLeft=o,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function d(){Object.assign(n.style,jne),Object.assign(i.style,Nne),l||(n.scrollTop=s,n.scrollLeft=o,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=Rne)}function f(){d(),c.request(u)}u();const h=Ni(r,"resize",f);return()=>{c.cancel(),d(),typeof r.removeEventListener=="function"&&h()}}class q2t{constructor(){Zt(this,"lockCount",0);Zt(this,"restore",null);Zt(this,"timeoutLock",Lu.create());Zt(this,"timeoutUnlock",Lu.create());Zt(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});Zt(this,"unlock",()=>{var t;this.lockCount===0&&this.restore&&((t=this.restore)==null||t.call(this),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const n=kr(t),i=n.documentElement,r=n.body,s=ta(i);if(Ine(s,i,r)){const l=new s.MutationObserver(()=>{Ine(s,i,r)||(l.disconnect(),this.restore=null,this.lock(t))}),c={attributes:!0};l.observe(i,c),l.observe(r,c),this.restore=()=>l.disconnect();return}const o=HD||!Q2t(t);this.restore=o?V2t(t):H2t(t)}}const W2t=new q2t;function lLe(e=!0,t=null){Jn(()=>{if(e)return W2t.acquire(t)},[e,t])}const K2t=20;function G2t(e,t,n,i){const[r,s]=p.useState(!1);Jn(()=>{if(!e||!t||n==null){s(!1);return}const o=kr(n).documentElement.clientWidth,l=n.offsetWidth;s(o>0&&l>0&&l>=o-K2t)},[e,t,n]),lLe(e&&(!t||r),i)}const X2t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,anchor:o,positionMethod:l,side:c,align:u,sideOffset:d,alignOffset:f,collisionBoundary:h="clipping-ancestors",collisionPadding:m,arrowPadding:g,sticky:b,disableAnchorTracking:v=!1,collisionAvoidance:y=Fit,...w}=t,x=ev(),O=F2t(),k=urt(),S=x.useState("floatingRootContext"),C=x.useState("mounted"),E=x.useState("open"),j=x.useState("openChangeReason"),T=x.useState("activeTriggerElement"),R=x.useState("modal"),A=x.useState("openMethod"),N=x.useState("positionerElement"),P=x.useState("instantType"),I=x.useState("transitionStatus"),D=x.useState("adaptiveOrigin"),_=p.useRef(null),L=rV(N),F=Ost({anchor:o,floatingRootContext:S,positionMethod:l,mounted:C,side:c,sideOffset:d,align:u,alignOffset:f,arrowPadding:g,collisionBoundary:h,collisionPadding:m,sticky:b,disableAnchorTracking:v,keepMounted:O,nodeId:k,collisionAvoidance:y,adaptiveOrigin:D}),M=S.useState("domReferenceElement");Jn(()=>{const z=M,Z=_.current;if(z&&(_.current=z),Z&&z&&z!==Z){x.set("instantType",void 0);const ne=new AbortController;return L(()=>{x.set("instantType","trigger-change")},ne.signal),()=>{ne.abort()}}},[M,L,x]);const V=R===!0&&j!==mu;G2t(E&&V,A==="touch",N,T);const q=x.useStateSetter("positionerElement"),U={open:E,side:F.side,align:F.align,anchorHidden:F.anchorHidden,instant:P},J=jst(t,U,{styles:F.positionerStyles,transitionStatus:I,props:w,refs:[n,q],hidden:!C,inert:!E});return a.jsxs(aLe.Provider,{value:F,children:[C&&V&&a.jsx(oLe,{inert:iV(!E),cutout:T}),a.jsx(drt,{id:k,children:J})]})}),Y2t="ArrowUp",Z2t="ArrowDown",J2t="ArrowLeft",e_t="ArrowRight",t_t="Home",n_t="End",cLe=new Set([Y2t,Z2t,J2t,e_t,t_t,n_t]),i_t=p.createContext(void 0);function r_t(e){return p.useContext(i_t)}const s_t=p.createContext(void 0);function a_t(){const[e,t]=p.useState(0),n=ci(()=>(t(r=>r+1),()=>{t(r=>Math.max(0,r-1))}));return{context:p.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}const o_t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,initialFocus:o,finalFocus:l,...c}=t,u=ev(),d=U2t(),f=r_t()!=null,{context:h,hasClosePart:m}=a_t(),g=u.useState("open"),b=u.useState("openMethod"),v=u.useState("instantType"),y=u.useState("transitionStatus"),w=u.useState("popupProps"),x=u.useState("titleElementId"),O=u.useState("descriptionElementId"),k=u.useState("modal"),S=u.useState("mounted"),C=u.useState("openChangeReason"),E=u.useState("activeTriggerElement"),j=u.useState("floatingRootContext"),T=j.useState("floatingId"),R=u.useState("disabled"),A=u.useState("openOnHover"),N=u.useState("closeDelay");zA({open:g,ref:u.context.popupRef,onComplete(){var F,M;g&&((M=(F=u.context).onOpenChangeComplete)==null||M.call(F,!0))}}),ust(j,{enabled:A&&!R,closeDelay:N});const P=o===void 0?ije(u.context.popupRef):o,I=k!==!1&&m;u.useSyncedValue("focusManagerModal",I);const D=u.useStateSetter("popupElement"),_={open:g,side:d.side,align:d.align,instant:v,transitionStatus:y},L=Ra("div",t,{state:_,ref:[n,u.context.popupRef,D],props:[w,{id:T,role:"dialog",...nje,"aria-labelledby":x,"aria-describedby":O,onKeyDown(F){f&&cLe.has(F.key)&&F.stopPropagation()}},Oje(y),c],stateAttributesMapping:wje});return a.jsx(F_e,{context:j,openInteractionType:b,modal:I,disabled:!S||C===mu,initialFocus:P,returnFocus:l,restoreFocus:"popup",previousFocusableElement:Js(E)?E:void 0,nextFocusableElement:u.context.triggerFocusTargetRef,beforeContentFocusGuardRef:u.context.beforeContentFocusGuardRef,children:a.jsx(s_t.Provider,{value:h,children:L})})}),l_t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...o}=t,l=ev(),c=em(o.id);return l.useSyncedValueWithCleanup("titleElementId",c),Ra("h2",t,{ref:n,props:[{id:c},o]})}),c_t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...o}=t,l=ev(),c=em(o.id);return l.useSyncedValueWithCleanup("descriptionElementId",c),Ra("p",t,{ref:n,props:[{id:c},o]})});function Pne(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"10.25",cy:"10.25",r:"6.25"}),a.jsx("path",{d:"M4.15 10.25h12.2M10.25 4c1.65 1.72 2.5 3.8 2.5 6.25s-.85 4.53-2.5 6.25M10.25 4c-1.65 1.72-2.5 3.8-2.5 6.25s.85 4.53 2.5 6.25M14.8 14.8 20 20"})]})}function u_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.25",y:"5.25",width:"15.5",height:"13.5",rx:"2.25"}),a.jsx("circle",{cx:"8.1",cy:"9.3",r:"1.35"}),a.jsx("path",{d:"m4.7 16.5 3.65-3.7 2.45 2.25 2.2-2.2 4.35 4.1"}),a.jsx("path",{d:"m19.4 2.75.48 1.37 1.37.48-1.37.48-.48 1.37-.48-1.37-1.37-.48 1.37-.48.48-1.37Z",fill:"currentColor",stroke:"none"})]})}function lq(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{className:"video-generate-icon__body",d:"M3.25 9h17.5v7.35a2.4 2.4 0 0 1-2.4 2.4H5.65a2.4 2.4 0 0 1-2.4-2.4V9Z"}),a.jsxs("g",{className:"video-generate-icon__clapper",children:[a.jsx("path",{d:"M3.25 9V7.65a2.4 2.4 0 0 1 2.4-2.4h12.7a2.4 2.4 0 0 1 2.4 2.4V9H3.25Z"}),a.jsx("path",{d:"M6.75 5.25 9.3 9M12 5.25 14.55 9M17.25 5.25 19.8 9"})]}),a.jsx("path",{d:"m10.25 11.45 4 2.55-4 2.55v-5.1Z"})]})}function d_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M4.25 5.25h15.5v10.5H4.25zM8.25 19.75h7.5M12 15.75v4"}),a.jsx("path",{d:"m7.25 12.75 2.35-2.4 2.15 1.65 3.4-3.6 1.6 1.55"}),a.jsx("circle",{cx:"7.25",cy:"8.4",r:".7",fill:"currentColor",stroke:"none"})]})}function f_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5 7.4c0-1.55 3.13-2.8 7-2.8s7 1.25 7 2.8-3.13 2.8-7 2.8-7-1.25-7-2.8Z"}),a.jsx("path",{d:"M5 7.4v4.55c0 1.55 3.13 2.8 7 2.8s7-1.25 7-2.8V7.4M5 11.95v4.55c0 1.55 3.13 2.8 7 2.8s7-1.25 7-2.8v-4.55"}),a.jsx("path",{d:"M8.2 12.25h.01M8.2 16.8h.01"})]})}function h_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M4.25 4.25h4.5v15.5h-4.5zM8.75 5.75h5v14h-5zM13.75 4.25h4.1v10.25h-4.1z"}),a.jsx("path",{d:"M5.75 7h1.5M10.25 8.25h2M10.25 11h2M15.15 7h1.3"}),a.jsx("circle",{cx:"17.45",cy:"17.35",r:"2.45"}),a.jsx("path",{d:"m19.25 19.15 1.55 1.55"})]})}function p_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M4.25 6.25h6.25c1 0 1.5.55 1.5 1.45v11.05c0-.9-.5-1.45-1.5-1.45H4.25V6.25Z"}),a.jsx("path",{d:"M19.75 9.1v8.2H13.5c-1 0-1.5.55-1.5 1.45V7.7c0-.9.5-1.45 1.5-1.45h2.15"}),a.jsx("path",{d:"m19 3.2.58 1.62 1.62.58-1.62.58L19 7.6l-.58-1.62-1.62-.58 1.62-.58L19 3.2Z",fill:"currentColor",stroke:"none"})]})}function m_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"m4.2 8.4 1.15 10.2h13.3L19.8 8.4"}),a.jsx("path",{d:"M4.2 8.4h15.6L17.9 5H6.1L4.2 8.4Z"}),a.jsx("path",{d:"M7.2 12.2c1.1-1 2.25 1.25 3.4.25 1.05-.9 2.15 1.3 3.3.25"}),a.jsx("path",{d:"m8.2 15.1 1.45 1.35 1.45-1.35M13.55 16.45h2.35"})]})}function g_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"6",cy:"6.25",r:"2.25"}),a.jsx("circle",{cx:"18",cy:"6.25",r:"2.25"}),a.jsx("circle",{cx:"12",cy:"17.75",r:"2.25"}),a.jsx("path",{d:"m7.7 7.75 2.7 7.55M16.3 7.75l-2.7 7.55M8.25 6.25h7.5"})]})}function Dne(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"9",cy:"8",r:"3"}),a.jsx("path",{d:"M3.75 18.75c.45-3.05 2.2-4.65 5.25-4.65s4.8 1.6 5.25 4.65"}),a.jsx("path",{d:"M17.75 4.25v5.5M15 7h5.5M16 13.25h4.25M18.125 11.125v4.25"})]})}function b_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"4",y:"4.25",width:"16",height:"5",rx:"1.5"}),a.jsx("rect",{x:"4",y:"14.75",width:"16",height:"5",rx:"1.5"}),a.jsx("path",{d:"M7.25 6.75h.01M7.25 17.25h.01M10 6.75h6.5M10 17.25h6.5"})]})}function y_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3.75h8l4 4v12.5H6V3.75Z"}),a.jsx("path",{d:"M14 3.75v4h4M8.75 11h6.5M8.75 14.25h6.5M8.75 17.5h4"})]})}function Mne(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.75",y:"4.5",width:"16.5",height:"15",rx:"2.5"}),a.jsx("path",{d:"m7.5 9 2.75 2.5L7.5 14M12.5 14h4"}),a.jsx("path",{d:"M3.75 7.5h16.5",opacity:".62"})]})}function aO(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m6 3.25 4.5 4.75L6 12.75"})})}function v_t({value:e}){const{t,i18n:n}=Te("adk"),[i,r]=p.useState(!1),s=f=>f==null?t("developmentRuns.notReported"):f.toLocaleString(n.resolvedLanguage||n.language),o=z2e,l=e.usage,c=(l==null?void 0:l.inputTokens)!=null&&l.cachedInputTokens!=null&&l.cachedInputTokens<=l.inputTokens?l.inputTokens-l.cachedInputTokens:void 0,u=l!=null&&l.inputTokens&&l.cachedInputTokens!=null&&c!=null?`${(l.cachedInputTokens/l.inputTokens*100).toFixed(1)}%`:void 0,d=[["inputTokens",l==null?void 0:l.inputTokens],["cachedInputTokens",l==null?void 0:l.cachedInputTokens],["uncachedInputTokens",c],["cacheWriteInputTokens",l==null?void 0:l.cacheWriteInputTokens],["outputTokens",l==null?void 0:l.outputTokens],["reasoningOutputTokens",l==null?void 0:l.reasoningOutputTokens]];return a.jsxs("div",{className:"development-turn-summary","data-turn-id":e.turnId,children:[a.jsx("span",{children:t(`developmentRuns.turnStatus.${e.status}`)}),a.jsx("span",{children:t("developmentRuns.toolCalls",{count:e.toolCalls})}),a.jsx("span",{children:t("developmentRuns.turnDuration",{duration:o(e.durationMs)})}),a.jsx("span",{title:t("developmentRuns.toolDurationHelp"),children:t(e.toolDurationComplete?"developmentRuns.toolDuration":"developmentRuns.toolDurationPartial",{duration:o(e.toolDurationMs)})}),a.jsxs(R2t,{open:i,onOpenChange:r,children:[a.jsxs($2t,{className:"development-token-trigger",openOnHover:!0,delay:150,closeDelay:150,onFocus:f=>{f.currentTarget.matches(":focus-visible")&&r(!0)},children:[a.jsx("span",{children:"Tokens"}),a.jsx("span",{className:"development-token-value",children:s(l==null?void 0:l.totalTokens)}),e.usageIncomplete&&a.jsxs("span",{children:["· ",t("developmentRuns.partial")]}),a.jsx(aO,{className:"development-token-chevron"})]}),a.jsx(B2t,{children:a.jsx(X2t,{side:"top",align:"end",sideOffset:8,className:"development-token-positioner",children:a.jsxs(o_t,{className:"development-token-popup",initialFocus:!1,finalFocus:!1,children:[a.jsx(l_t,{className:"development-token-title",children:t("developmentRuns.tokenDetails")}),a.jsxs("dl",{children:[a.jsxs("div",{children:[a.jsx("dt",{children:t("developmentRuns.model")}),a.jsx("dd",{children:e.model||t("developmentRuns.notReported")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:t("developmentRuns.totalTokens")}),a.jsx("dd",{children:s(l==null?void 0:l.totalTokens)})]}),d.map(([f,h])=>a.jsxs("div",{children:[a.jsx("dt",{children:t(`developmentRuns.${f}`)}),a.jsx("dd",{children:s(h)})]},f)),a.jsxs("div",{children:[a.jsx("dt",{children:t("developmentRuns.cacheHitRate")}),a.jsx("dd",{children:u||t("developmentRuns.notReported")})]})]}),a.jsxs(c_t,{className:"development-token-note",children:[t("developmentRuns.tokenHelp"),e.usageIncomplete?` ${t("developmentRuns.partialHelp")}`:""]})]})})})]})]})}function cq(e){return a.jsx("svg",{viewBox:"0 0 111 117",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M0 5.6016C7.82288e-05 0.621244 6.02226 -1.87314 9.54395 1.64847L40.1289 32.2334L68.5732 3.7891C69.5834 2.77903 70.9533 2.21099 72.3818 2.21097H82.7031C82.7917 2.20658 82.8806 2.20414 82.9697 2.20414H104.775C109.574 2.20427 111.977 8.00691 108.584 11.4004L64.916 55.0664C64.3075 55.8528 63.9436 56.7647 63.8242 57.6993C63.7142 56.4884 63.1964 55.3069 62.2695 54.3799L45.4082 37.5186H45.4072L40.124 32.2354L17.832 54.5284C16.7671 55.5933 16.2416 56.993 16.2549 58.3887C16.2417 59.7843 16.7672 61.1842 17.832 62.2491L39.9287 84.3467L9.54395 114.733C6.0223 118.255 0.000223474 115.761 0 110.78V5.6016ZM63.8018 58.8702C63.8962 59.9086 64.2936 60.9229 64.9961 61.7735L108.591 105.368C111.984 108.762 109.58 114.564 104.781 114.564H94.4336C94.3543 114.568 94.274 114.569 94.1934 114.569H72.3877C70.9592 114.569 69.5892 114.002 68.5791 112.992L39.9336 84.3467L58.4531 65.8282L58.4453 65.8203L62.2695 61.9981C63.1476 61.12 63.6567 60.0136 63.8018 58.8702Z",fill:"currentColor"})})}function IM({kind:e,...t}){return e==="thinking"?a.jsx(cq,{...t}):a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:e==="tool"?a.jsxs(a.Fragment,{children:[a.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"3"}),a.jsx("path",{d:"m7 9 3 3-3 3m6 0h4"})]}):e==="plan"?a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"m4 7 1.5 1.5L8 6m-4 7 1.5 1.5L8 12M11 7h9m-9 6h9m-9 6h9"}),a.jsx("circle",{cx:"6",cy:"19",r:"1"})]}):a.jsx(a.Fragment,{children:a.jsx("path",{d:"M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9zM14 3v6h6M8 13h8m-4-3v6M8 18h8"})})})}function x_t({blocks:e,active:t,status:n,render:i}){const{t:r}=Te("adk"),[s,o]=p.useState(!1),l=[...e].reverse().find(h=>"done"in h&&!h.done),c=e.filter(h=>h.kind==="tool"),u=c.filter(h=>h.durationMs!=null),d=u.reduce((h,m)=>h+(m.durationMs||0),0);let f=r("developmentRuns.processSummary",{count:e.length});return t&&(f=n||((l==null?void 0:l.kind)==="thinking"?r("developmentRuns.thinking"):(l==null?void 0:l.kind)==="tool"?V2e(l):(l==null?void 0:l.kind)==="plan"?r("developmentRuns.plan"):(l==null?void 0:l.kind)==="diff"?r("developmentRuns.diff"):r("developmentRuns.processing"))),a.jsxs("section",{className:"development-process",children:[a.jsxs("button",{type:"button",className:"development-process__toggle","aria-expanded":s,onClick:()=>o(!s),children:[a.jsx(aO,{className:`tool-chevron${s?" is-open":""}`}),a.jsx("span",{className:"tool-icon",children:a.jsx(IM,{kind:(l==null?void 0:l.kind)==="thinking"||(l==null?void 0:l.kind)==="plan"||(l==null?void 0:l.kind)==="diff"?l.kind:"tool"})}),t?a.jsx(fn,{className:"development-process__title","aria-live":"polite",children:f}):a.jsx("span",{className:"development-process__title",children:f}),!t&&c.length>0&&a.jsxs("span",{className:"development-process__duration",children:[r("developmentRuns.toolCalls",{count:c.length}),u.length>0?` · ${r(u.length===c.length?"developmentRuns.toolDuration":"developmentRuns.toolDurationPartial",{duration:z2e(d)})}`:""]})]}),a.jsx("div",{className:"development-process__items",hidden:!s,children:i(e)})]})}function w_t({blocks:e,active:t,status:n="",render:i}){const{t:r}=Te("adk"),s=nnt(e),o=s[s.length-1],l=[...e].reverse().find(u=>u.kind==="progress"),c=n||((l==null?void 0:l.kind)==="progress"?l.text:"");return a.jsxs(a.Fragment,{children:[s.map(u=>u.process?a.jsx(x_t,{blocks:u.blocks,active:t&&u===o,status:c,render:i},u.id):a.jsx("div",{"data-assistant-phase":u.blocks[0].phase,children:i(u.blocks)},u.id)),t&&!(o!=null&&o.process)&&a.jsxs("div",{className:"development-process__status",role:"status",children:[a.jsx("span",{className:"tool-icon",children:a.jsx(IM,{kind:"thinking"})}),a.jsx(fn,{children:c||r("developmentRuns.processing")})]})]})}const O_t={formatDate(e){const t=e.value??e.date??e.timestamp;if(t==null)return"";const n=new Date(t);return isNaN(n.getTime())?String(t):n.toLocaleString()}};function k_t(e,t){if(!t||t==="/")return e;const n=t.replace(/^\//,"").split("/").map(r=>r.replace(/~1/g,"/").replace(/~0/g,"~"));let i=e;for(const r of n){if(i==null||typeof i!="object")return;i=i[r]}return i}function S_t(e){return typeof e=="object"&&e!==null&&typeof e.path=="string"}function E_t(e){return typeof e=="object"&&e!==null&&typeof e.call=="string"}function uq(e,t){if(S_t(e))return k_t(t,e.path);if(E_t(e)){const n=O_t[e.call],i={};for(const[r,s]of Object.entries(e.args??{}))i[r]=uq(s,t);return n?n(i):`[unknown fn: ${e.call}]`}return e}function C_t(e,t){const n=uq(e,t);return n==null?"":typeof n=="string"?n:String(n)}const uLe=new Map;function tv(e,t){uLe.set(e,t)}function A_t(e){return uLe.get(e)}function T_t(e,t,n){const i=t.replace(/^\//,"").split("/").map(s=>s.replace(/~1/g,"/").replace(/~0/g,"~"));let r=e;for(let s=0;suq(i,e.dataModel),resolveString:i=>C_t(i,e.dataModel),dispatchAction:t,render:i=>{if(!i)return null;const r=e.components[i];if(!r)return null;const s=A_t(r.component)??__t;return a.jsx(s,{node:r,ctx:n},i)}};return a.jsx("div",{className:"a2ui-surface","data-a2ui-surface":e.surfaceId,children:n.render(e.rootId)})}function fLe(e){const t=p.useRef(null),n=p.useRef(!0),i=28,r=p.useCallback(()=>{const s=t.current;s&&(n.current=s.scrollHeight-s.scrollTop-s.clientHeight{const s=t.current;s&&n.current&&(s.scrollTop=s.scrollHeight)},[e]),{ref:t,onScroll:r}}function PM({value:e,skillPrefix:t="/",onRemoveSkill:n,onRemoveAgent:i}){const{t:r}=Te("conversation");return e.skills.length===0&&!e.targetAgent?null:a.jsxs("div",{className:"invocation-chips","aria-label":r("invocation.ariaLabel"),children:[e.skills.map(s=>a.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:s.description,children:[a.jsx(hC,{"aria-hidden":!0}),a.jsxs("span",{children:[t,s.name]}),n?a.jsx("button",{type:"button",onClick:()=>n(s.name),"aria-label":r("invocation.removeSkill",{name:s.name}),children:a.jsx(Do,{})}):null]},s.name)),e.targetAgent?a.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:e.targetAgent.description,children:[a.jsx(Mje,{"aria-hidden":!0}),a.jsx("span",{children:e.targetAgent.name}),i?a.jsx("button",{type:"button",onClick:i,"aria-label":r("invocation.removeAgent",{name:e.targetAgent.name}),children:a.jsx(Do,{})}):null]}):null]})}function dq(e=""){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e==="application/pdf"?"pdf":e==="text/markdown"?"markdown":"text"}function hLe(e){var n,i,r,s;const t=dq(e.mimeType);return t==="pdf"?"PDF":t==="markdown"?"MD":t==="video"?((i=(n=e.mimeType)==null?void 0:n.split("/")[1])==null?void 0:i.toUpperCase())??"VIDEO":t==="image"?((s=(r=e.mimeType)==null?void 0:r.split("/")[1])==null?void 0:s.toUpperCase())??"IMAGE":"TXT"}function pLe(e){return e?e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`:""}function mLe(e,t){return e.previewUrl?e.previewUrl:e.data?`data:${e.mimeType??"application/octet-stream"};base64,${e.data}`:e.uri?hTe(t,e.uri):""}function N_t({kind:e}){return e==="image"?a.jsx(bV,{}):e==="video"?a.jsx($je,{}):e==="pdf"?a.jsx(Pat,{}):a.jsx(mV,{})}function DM({appName:e,items:t,compact:n=!1,onRemove:i}){const{t:r}=Te("conversation"),[s,o]=p.useState(null);return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:`media-grid${n?" media-grid--compact":""}`,children:t.map(l=>{const c=dq(l.mimeType),u=mLe(l,e),d=l.status==="uploading"||l.status==="error"||!u,f=a.jsxs("button",{type:"button",className:"media-card-main",disabled:d,onClick:c==="image"?void 0:()=>o(l),"aria-label":r("media.preview",{name:l.name??r("media.attachment")}),children:[c==="image"&&u?a.jsx("img",{className:"media-card-image",src:u,alt:l.name??r("media.image"),loading:"lazy"}):c==="video"&&u?a.jsxs("div",{className:"media-card-video-container",children:[a.jsx("video",{className:"media-card-video",src:u,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),a.jsx("span",{className:"media-card-video-play",children:a.jsx(Uje,{})})]}):a.jsx("span",{className:"media-card-icon",children:a.jsx(N_t,{kind:c})}),a.jsxs("span",{className:"media-card-copy",children:[a.jsx("span",{className:"media-card-name",children:l.name??r("media.attachment")}),a.jsxs("span",{className:"media-card-meta",children:[a.jsx("span",{className:"media-card-type",children:hLe(l)}),l.status==="uploading"?a.jsxs(a.Fragment,{children:[a.jsx(Fi,{className:"media-card-spinner"})," ",r("media.uploading")]}):l.status==="error"?l.error??r("media.uploadFailed"):pLe(l.sizeBytes)]})]}),!n&&l.status!=="uploading"&&l.status!=="error"?a.jsx(iE,{className:"media-card-open"}):null]});return a.jsxs(Cr.div,{className:`media-card media-card--${c}${l.status==="error"?" media-card--error":""}`,layout:!0,initial:{opacity:0,scale:.985,y:4},animate:{opacity:1,scale:1,y:0},children:[c==="image"&&!d?a.jsx(MAe,{src:u,children:f}):f,i?a.jsx("button",{type:"button",className:"media-card-remove","aria-label":r("media.remove",{name:l.name??r("media.attachment")}),onClick:()=>i(l.id),children:a.jsx(Do,{})}):null]},l.id)})}),a.jsx(ff,{children:s?a.jsx(R_t,{appName:e,item:s,onClose:()=>o(null)}):null})]})}function R_t({appName:e,item:t,onClose:n}){const{t:i}=Te("conversation"),r=p.useMemo(()=>mLe(t,e),[e,t]),s=dq(t.mimeType),[o,l]=p.useState(""),[c,u]=p.useState(s==="text"||s==="markdown"),[d,f]=p.useState("");return p.useEffect(()=>{const h=m=>{m.key==="Escape"&&n()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[n]),p.useEffect(()=>{if(s!=="text"&&s!=="markdown")return;const h=new AbortController;return u(!0),f(""),fetch(r,{signal:h.signal}).then(m=>{if(!m.ok)throw new Error(`HTTP ${m.status}`);return m.text()}).then(l).catch(m=>{h.signal.aborted||f(m instanceof Error?m.message:String(m))}).finally(()=>{h.signal.aborted||u(!1)}),()=>h.abort()},[s,r]),a.jsx(Cr.div,{className:"media-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":i("media.previewDialog",{name:t.name??i("media.attachment")}),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onMouseDown:h=>{h.target===h.currentTarget&&n()},children:a.jsxs(Cr.div,{className:"media-viewer",initial:{opacity:0,y:18,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.99},transition:{type:"spring",stiffness:420,damping:30},children:[a.jsxs("header",{className:"media-viewer-header",children:[a.jsxs("div",{children:[a.jsx("strong",{children:t.name??i("media.attachment")}),a.jsxs("span",{children:[hLe(t),t.sizeBytes?` · ${pLe(t.sizeBytes)}`:""]})]}),a.jsxs("nav",{children:[a.jsx("a",{href:r,download:t.name,"aria-label":i("media.download"),children:a.jsx(tM,{})}),a.jsx("button",{type:"button",onClick:n,"aria-label":i("media.close"),children:a.jsx(Do,{})})]})]}),a.jsxs("div",{className:`media-viewer-body media-viewer-body--${s}`,children:[s==="image"?a.jsx("img",{src:r,alt:t.name??i("media.image")}):null,s==="video"?a.jsx("div",{className:"media-viewer-video-wrapper",children:a.jsx("video",{src:r,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",className:"media-viewer-video"})}):null,s==="pdf"?a.jsx("iframe",{src:r,title:t.name??"PDF"}):null,c?a.jsxs("div",{className:"media-viewer-loading",children:[a.jsx(Fi,{})," ",i("media.reading")]}):null,!c&&d?a.jsx("div",{className:"media-viewer-loading",children:i("media.loadFailed",{error:d})}):null,!c&&s==="markdown"?a.jsx("div",{className:"media-document",children:a.jsx(Td,{text:o})}):null,!c&&s==="text"?a.jsx("pre",{className:"media-document media-document--plain",children:o}):null]})]})})}function I_t({definition:e,label:t,done:n,open:i,onToggle:r}){const{t:s}=Te("conversation"),o=e.icon,l=n?e.doneLabel:e.runningLabel,c=t??s(`blocks.tools.${e.name}.${n?"done":"running"}`,{defaultValue:l});return a.jsxs("button",{type:"button",className:`builtin-tool-head${n?" is-done":" is-running"}`,"data-tool-tone":e.tone,onClick:r,"aria-expanded":i,children:[a.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:a.jsx(o,{})}),n?a.jsx("span",{className:"builtin-tool-label",children:c}):a.jsx(fn,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:c}),a.jsx(aO,{className:`builtin-tool-chevron${i?" is-open":""}`})]})}function Nu(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function qn(e){return typeof e=="string"?e:""}function Lne(e){return typeof e=="number"&&Number.isFinite(e)?e:0}function cd(e){return Array.isArray(e)?e:[]}function u9(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return{}}const n=Nu(t)??{};return Nu(n.result)??n}function MM(e){if(typeof e=="string")try{return MM(JSON.parse(e))}catch{return e}const t=Nu(e);if(!t)return"";const n=Nu(t.result);return qn(t.error)||qn(t.message)||qn(n==null?void 0:n.error)||qn(n==null?void 0:n.message)}function P_t(e){if(e.kind==="tool")return"tool";if(e.kind==="knowledge_base")return"knowledge_base";const t=Nu(e.metadata),n=qn(t==null?void 0:t.source_type).toLowerCase(),i=qn(e.source).toLowerCase();return n==="skillhub"||i.startsWith("skill_hub:")?"skill_hub":"skill_space"}const gLe={tool:"Tools",knowledge:"AgentKit Knowledge Base",skillCenter:"AgentKit Skill Center",unknownSource:"Unknown source",unnamedResource:"Unnamed resource",unnamedAgent:"Unnamed agent"};function D_t(e,t){return e==="veadk_builtin_tools"?t.tool:e==="agentkit_knowledge"?t.knowledge:e.startsWith("skill_hub:")?`Skill Hub ${e.slice(10)}`:e.startsWith("skill_space:")?`${t.skillCenter} ${e.slice(12)}`:e||t.unknownSource}function M_t(e){return e==="veadk_builtin_tools"?"tool":e==="agentkit_knowledge"?"knowledge_base":e.startsWith("skill_hub:")?"skill_hub":"skill_space"}function L_t(e,t=gLe){const n=u9(e),i=Nu(n.capabilities)??{},r=cd(n.resources).flatMap(o=>{const l=Nu(o);if(!l)return[];const c=l.kind==="tool"?"tool":l.kind==="knowledge_base"?"knowledge_base":"skill";return[{ref:qn(l.ref),kind:c,category:P_t(l),name:qn(l.name)||qn(l.ref)||t.unnamedResource,description:qn(l.description),source:qn(l.source),version:qn(l.version)}]}),s=cd(n.sources).flatMap(o=>{const l=Nu(o);if(!l)return[];const c=qn(l.source),u=qn(l.status),d=u==="error"?"error":u==="skipped"?"skipped":"ok";return[{source:c,category:M_t(c),label:D_t(c,t),status:d,count:Lne(l.count),message:qn(l.message),searchKeywords:cd(l.search_keywords).map(qn).filter(Boolean)}]});return{collectionId:qn(n.collection_id),capabilities:{googleAdkVersion:qn(i.google_adk_version),agentTypes:cd(i.agent_types).map(qn).filter(Boolean),maxOrchestrationDepth:Lne(i.max_orchestration_depth)},resources:r,sources:s,counts:{all:r.length,skill_hub:r.filter(o=>o.category==="skill_hub").length,skill_space:r.filter(o=>o.category==="skill_space").length,knowledge_base:r.filter(o=>o.category==="knowledge_base").length,tool:r.filter(o=>o.category==="tool").length}}}function $_t(e,t){return{resources:e.resources.filter(n=>n.category===t),sources:e.sources.filter(n=>n.category===t)}}function bLe(e,t,n=gLe){const i=u9(e),r=u9(t),s=new Map(cd(r.results).flatMap(d=>{const f=Nu(d),h=qn(f==null?void 0:f.name);return f&&h?[[h,f]]:[]})),o=cd(i.agents).flatMap(d=>{const f=Nu(d),h=qn(f==null?void 0:f.name);return f&&h?[f]:[]}),l=new Set(o.map(d=>qn(d.name))),c=[...s.entries()].filter(([d])=>!l.has(d)).map(([d])=>({name:d})),u=[...o,...c].map(d=>{const f=qn(d.name),h=cd(d.nodes).flatMap(C=>{const E=Nu(C);return E?[E]:[]}),m=qn(d.root_node),g=h.find(C=>qn(C.id)===m),b=h.filter(C=>qn(C.id)!==m).map(C=>({id:qn(C.id)||n.unnamedAgent,type:qn(C.type)||"llm",description:qn(C.description)})),v=s.get(f),y=qn(v==null?void 0:v.status),w=y==="failed"?"failed":y==="completed"?"completed":"running",x=$ne(v==null?void 0:v.resources),O=x.length>0?x:$ne(h.flatMap(C=>cd(C.resources))),k=Fne(v==null?void 0:v.python_tools),S=k.length>0?k:Fne(h.flatMap(C=>cd(C.python_tools)));return{name:f,description:qn(v==null?void 0:v.description)||qn(g==null?void 0:g.description)||qn(d.task),task:qn(d.task),rootType:qn(v==null?void 0:v.root_type)||qn(g==null?void 0:g.type)||"llm",nodeCount:h.length,subAgentCount:b.length,resourceCount:O.length,pythonToolCount:S.length,skills:O.filter(C=>C.kind==="skill"),knowledgeBases:O.filter(C=>C.kind==="knowledge_base"),builtinTools:O.filter(C=>C.kind==="tool"),pythonTools:S,subAgents:b,status:w,output:qn(v==null?void 0:v.output),error:qn(v==null?void 0:v.error)}});return{collectionId:qn(r.collection_id)||qn(i.collection_id),agents:u,completedCount:u.filter(d=>d.status==="completed").length,failedCount:u.filter(d=>d.status==="failed").length,runningCount:u.filter(d=>d.status==="running").length}}function F_t(e,t){return!!MM(t)||bLe(e,t).failedCount>0}function $ne(e){const t=new Set;return cd(e).flatMap(n=>{const i=Nu(n),r=qn(i?i.ref:n);if(!r||t.has(r))return[];t.add(r);const s=qn(i==null?void 0:i.kind),o=s==="tool"||r.startsWith("veadk_tool:")?"tool":s==="knowledge_base"||r.startsWith("agentkit_kb:")?"knowledge_base":"skill",l=r.split(":");return[{ref:r,kind:o,name:qn(i==null?void 0:i.name)||l[l.length-1]||r,description:qn(i==null?void 0:i.description),version:qn(i==null?void 0:i.version),source:qn(i==null?void 0:i.source)}]})}function Fne(e){const t=new Set;return cd(e).flatMap(n=>{const i=Nu(n),r=qn(i==null?void 0:i.name),s=qn(i==null?void 0:i.code),o=`${r}\0${s}`;return!i||!r||t.has(o)?[]:(t.add(o),[{name:r,description:qn(i.description),code:s,entrypoint:qn(i.entrypoint)||r,dependencies:cd(i.dependencies).map(qn).filter(Boolean)}])})}function B_t({branch:e}){return a.jsxs("div",{className:`branch-compare__body${e.status==="running"?" is-streaming":""}`,"aria-live":"polite",children:[e.content?a.jsx(Td,{text:e.content,streaming:e.status==="running"}):null,e.status==="running"?a.jsx("span",{className:"branch-compare__caret","aria-hidden":"true"}):null,e.error?a.jsx("p",{className:"branch-compare__error",children:e.error}):null]})}function U_t({args:e,response:t,status:n,onBranchSelect:i}){const{t:r}=Te("conversation"),s=p.useMemo(()=>Vje(e,t,n),[e,t,n]),[o,l]=p.useState(0);return a.jsxs("section",{className:"branch-compare","aria-label":r("blocks.branchCompare.ariaLabel"),children:[a.jsx("div",{className:"branch-compare__tabs",role:"tablist","aria-label":r("blocks.branchCompare.selectDirection"),children:s.branches.map((c,u)=>a.jsx("button",{className:`branch-compare__tab${o===u?" is-active":""}`,type:"button",role:"tab","aria-selected":o===u,"aria-controls":`branch-compare-panel-${u}`,onClick:()=>l(u),children:a.jsx(Ya,{color:"info",size:"sm",variant:"soft",children:c.label})},`${c.label}:${u}`))}),a.jsx("div",{className:"branch-compare__branches",children:s.branches.map((c,u)=>a.jsxs("article",{className:`branch-compare__branch${o===u?" is-active":""}`,id:`branch-compare-panel-${u}`,role:"tabpanel",children:[a.jsx("header",{className:"branch-compare__head",children:a.jsx(Ya,{color:"info",size:"sm",variant:"soft",children:c.label})}),a.jsx(B_t,{branch:c}),a.jsx("footer",{className:"branch-compare__footer",children:a.jsx(_t,{type:"button",color:"info",variant:"ghost",size:"sm",pill:!1,disabled:c.status!=="completed",onClick:()=>i==null?void 0:i(c),children:r("blocks.branchCompare.continue")})})]},`${c.label}:${u}`))})]})}function yLe({controlled:e,default:t,name:n,state:i="value"}){const{current:r}=p.useRef(e!==void 0),[s,o]=p.useState(t),l=r?e:s,c=p.useCallback(u=>{r||o(u)},[]);return[l,c]}const vLe=p.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function Q_t(){return p.useContext(vLe)}function z_t(e){const{children:t,elementsRef:n,labelsRef:i,onMapChange:r}=e,s=ci(r),[,o]=p.useState(!1),l=Ed(H_t).current,c=Ed(V_t).current,u=p.useRef(0),d=p.useRef(!0),f=p.useRef([]),h=p.useRef(null),m=ci(()=>{d.current||(d.current=!0,o(k=>!k))}),g=ci((k,S)=>{c.set(k,S),m()}),b=ci(k=>{c.delete(k),m()}),v=ci(k=>{const S=new Map;return n.current.length=0,i&&(i.current.length=0),k.forEach(C=>{var E,j;S.set(C.element,{...C.registration.metadata??{},index:C.index}),n.current[C.index]=C.element,i&&(i.current[C.index]=C.registration.label!==void 0?C.registration.label:((j=(E=C.registration.textRef)==null?void 0:E.current)==null?void 0:j.textContent)??C.element.textContent)}),u.current=n.current.length,S});function y(k){var E;if((E=h.current)==null||E.disconnect(),h.current=null,typeof MutationObserver!="function"||k.length<2)return;const S=new MutationObserver(j=>{if(!K_t(j))return;let T=null;for(const R of k)if(R.isConnected){if(T&&xLe(T,R)>0){S.disconnect(),m();return}T=R}});h.current=S;const C=new Set;for(let j=1;jS.observe(j,{childList:!0}))}const w=ci(()=>{const[k,S]=q_t(c),C=v(k);y(S),f.current=k,d.current=!1,l.forEach(E=>E(C)),s(C)});Jn(()=>(d.current||v(f.current),()=>{n.current=[],i&&(i.current=[])}),[n,i,v]),Jn(()=>{d.current&&w()}),Jn(()=>()=>{var k;(k=h.current)==null||k.disconnect(),d.current=!0},[]);const x=ci(k=>(l.add(k),()=>{l.delete(k)})),O=p.useMemo(()=>({register:g,unregister:b,subscribeMapChange:x,nextIndexRef:u}),[g,b,x,u]);return a.jsx(vLe.Provider,{value:O,children:t})}function V_t(){return new Map}function H_t(){return new Set}function q_t(e){const t=new Set,n=[],i=[];e.forEach((s,o)=>{if(!o.isConnected)return;const l=s.index,c={index:l??-1,element:o,registration:s};l===null?i.push(c):l>=0&&(t.add(l),n.push(c))});let r=0;return i.sort((s,o)=>xLe(s.element,o.element)),i.forEach(s=>{for(;t.has(r);)r+=1;s.index=r,n.push(s),r+=1}),t.size>0&&n.sort((s,o)=>s.index-o.index),[n,i.map(s=>s.element)]}function W_t(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function K_t(e){for(const t of e)for(let n=0;nnull},kLe=p.forwardRef(function(t,n){const{render:i,className:r,disabled:s=!1,hiddenUntilFound:o,keepMounted:l,loopFocus:c,onValueChange:u,multiple:d=!1,orientation:f="vertical",value:h,defaultValue:m,style:g,...b}=t,v=p.useMemo(()=>{if(h===void 0)return m??[]},[h,m]),y=p.useRef([]),[w,x]=yLe({controlled:h,default:v,name:"Accordion",state:"value"}),O=ci((E,j,T)=>{if(d)if(j){const R=w.slice();if(R.push(E),u==null||u(R,T),T.isCanceled)return;x(R)}else{const R=w.filter(A=>A!==E);if(u==null||u(R,T),T.isCanceled)return;x(R)}else{const R=w[0]===E?[]:[E];if(u==null||u(R,T),T.isCanceled)return;x(R)}}),k=p.useMemo(()=>({value:w,disabled:s,orientation:f}),[w,s,f]),S=p.useMemo(()=>({disabled:s,handleValueChange:O,hiddenUntilFound:o??!1,keepMounted:l??!1,state:k,value:w}),[s,O,o,l,k,w]),C=Ra("div",t,{state:k,ref:n,props:b,stateAttributesMapping:G_t});return a.jsx(wLe.Provider,{value:S,children:a.jsx(z_t,{elementsRef:y,children:C})})});function X_t(e){const{open:t,defaultOpen:n,onOpenChange:i,disabled:r}=e,[s,o]=yLe({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:l,setMounted:c,transitionStatus:u}=tje(s,!0,!0),d=em(),[f,h]=p.useState(),m=f===null?void 0:f??d,g=ci(b=>{const v=!s,y=fa(Yw,b.nativeEvent);i(v,y),!y.isCanceled&&o(v)});return p.useMemo(()=>({defaultPanelId:d,disabled:r,handleTrigger:g,mounted:l,open:s,panelId:m,setMounted:c,setOpen:o,setPanelIdState:h,transitionStatus:u}),[d,r,g,l,s,m,c,o,h,u])}const SLe=p.createContext(void 0);function ELe(){const e=p.useContext(SLe);if(e===void 0)throw new Error(Vc(15));return e}function Y_t(e={}){const{guess:t,label:n,metadata:i,textRef:r,index:s}=e,{register:o,unregister:l,subscribeMapChange:c,nextIndexRef:u}=Q_t(),d=p.useRef(-1),[f,h]=p.useState(s==null&&t?()=>{if(d.current===-1){const v=u.current;u.current+=1,d.current=v}return d.current}:-1),m=s??f,g=p.useRef(null),b=p.useCallback(v=>{const y=g.current;y&&l(y),g.current=v,v&&o(v,{metadata:i??null,index:s??null,label:n,textRef:r})},[s,o,l,i,n,r]);return Jn(()=>{if(s==null)return c(v=>{var w;const y=g.current?(w=v.get(g.current))==null?void 0:w.index:null;y!=null&&h(y)})},[s,c]),{ref:b,index:m}}const CLe=p.createContext(void 0);function fq(){const e=p.useContext(CLe);if(e===void 0)throw new Error(Vc(9));return e}let hq=function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=oI.startingStyle]="startingStyle",e[e.endingStyle=oI.endingStyle]="endingStyle",e}({}),Z_t=function(e){return e.panelOpen="data-panel-open",e}({});const J_t={[hq.open]:""},ejt={[hq.closed]:""},tjt={open(e){return e?{[Z_t.panelOpen]:""}:null}},njt={open(e){return e?J_t:ejt}};let ijt=function(e){return e.index="data-index",e.disabled="data-disabled",e.open="data-open",e}({});const pq={...njt,index:e=>({[ijt.index]:String(e)}),...KD,value:()=>null},ALe=p.forwardRef(function(t,n){const{className:i,disabled:r=!1,onOpenChange:s,render:o,value:l,style:c,...u}=t,{ref:d,index:f}=Y_t(),h=Xw(n,d),{disabled:m,handleValueChange:g,state:b,value:v}=OLe(),y=em(),w=l??y,x=r||m,O=v.indexOf(w)!==-1,k=ci((D,_)=>{s==null||s(D,_),!_.isCanceled&&g(w,D,_)}),S=X_t({open:O,onOpenChange:k,disabled:x}),C=p.useMemo(()=>({open:S.open,disabled:S.disabled,transitionStatus:S.transitionStatus}),[S.open,S.disabled,S.transitionStatus]),E=p.useMemo(()=>({...S,onOpenChange:k,state:C}),[S,C,k]),j=p.useMemo(()=>({...b,hidden:!O&&!S.mounted,index:f,disabled:x,open:O}),[S.mounted,x,f,O,b]),T=em(),[R,A]=p.useState(),N=R===null?void 0:R??T,P=p.useMemo(()=>({defaultTriggerId:T,open:O,state:j,setTriggerId:A,triggerId:N}),[T,O,j,A,N]),I=Ra("div",t,{state:j,ref:h,props:u,stateAttributesMapping:pq});return a.jsx(SLe.Provider,{value:E,children:a.jsx(CLe.Provider,{value:P,children:I})})}),TLe=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...o}=t,{state:l}=fq();return Ra("h3",t,{state:l,ref:n,props:o,stateAttributesMapping:pq})}),_Le=p.forwardRef(function(t,n){const{disabled:i,className:r,id:s,render:o,nativeButton:l=!0,style:c,...u}=t,{panelId:d,open:f,handleTrigger:h,disabled:m}=ELe(),g=i||m,{getButtonProps:b,buttonRef:v}=GD({disabled:g,focusableWhenDisabled:!0,native:l}),{defaultTriggerId:y,state:w,setTriggerId:x}=fq(),O=s||void 0,k=O??y;return Jn(()=>(x(E=>O??(E===null?void 0:E)),()=>{x(E=>E===O?null:E)}),[O,x]),Ra("button",t,{state:w,ref:[n,v],props:[{"aria-controls":f?d:void 0,"aria-expanded":f,id:k,onClick:h},u,b],stateAttributesMapping:tjt})}),xk={height:void 0,width:void 0};function rjt(e){const{externalRef:t,hiddenUntilFound:n,id:i,keepMounted:r,mounted:s,onOpenChange:o,open:l,setMounted:c,setOpen:u,transitionStatus:d}=e,f=p.useRef(null),h=p.useRef(null),[m,g]=p.useState(xk),b=p.useRef(xk),v=p.useRef(!1),y=p.useRef(l),w=p.useRef(!1),[x,O]=p.useState(!1),k=p.useRef(null),S=Xw(t,f),C=Zl(l),E=rV(f),j=!l&&!s,T=x?"idle":d,R=l&&(y.current||w.current),A=!l&&s&&h.current==="css-animation"&&m.height===void 0&&m.width===void 0?b.current:m,N=n&&j&&h.current!=="css-animation",P=ci((F,M=!0)=>{M&&(b.current=F),g(F)}),I=ci(()=>{var F;(F=k.current)==null||F.call(k),k.current=null}),D=ci(F=>{I(),k.current=()=>{k.current=null,F()}}),_=ci(()=>{l&&s&&h.current==="css-animation"&&(w.current=!0)});Jn(()=>{!x||d==="starting"||O(!1)},[x,d]),p.useEffect(()=>()=>{_(),I()},[_,I]),Jn(()=>{const F=f.current;if(!F)return;!l&&k.current&&I();const M=sjt(F,R);if(h.current=M,l&&d==="idle"&&y.current&&M==="css-animation"){b.current=Bv(F);return}if(l&&d==="starting"){const U=v.current;if(v.current=!1,M==="none"){P(Bv(F)),O(!0);return}if(M==="css-transition"){const Z=ajt(F);if(P(Bv(F)),!U)return Z;const ne=N_(F,"transition-duration","0s");return D(ne),O(!0),Z}P(Bv(F));const J=N_(F,"animation-name","none");if(!U){J();return}const z=N_(F,"animation-duration","0s");J(),D(z),O(!0);return}if(!l&&s&&(d==="idle"||d==="starting")){if(y.current=!1,w.current=!1,M==="none"){P(xk,!1),c(!1);return}P(Bv(F));return}if(d!=="ending")return;if(M==="none"){c(!1);return}const V=Bv(F);if(!(V.height>0||V.width>0)){c(!1);return}P(V),M==="css-animation"&&N_(F,"animation-name","none")()},[s,l,I,P,c,D,R,d]),zA({enabled:l&&s&&T==="idle",open:!0,ref:f,onComplete(){l&&P(xk,!1)}}),p.useEffect(()=>{if(l||!s||T!=="ending"||!f.current)return;const M=new AbortController;let V=-1;function q(){C.current||(c(!1),P(xk,!1))}return V=_c.request(()=>{E(q,M.signal)}),()=>{_c.cancel(V),M.abort()}},[C,s,l,T,E,P,c]),Jn(()=>{const F=f.current;!F||!n||!j||F.setAttribute("hidden","until-found")},[j,n]),p.useEffect(function(){const M=f.current;if(!M)return;function V(q){const U=fa(E_e,q);o(!0,U),!U.isCanceled&&(v.current=!0,u(!0))}return Ni(M,"beforematch",V)},[o,u]);const L=r||n||s||l;return{height:A.height,props:{...N?{[hq.startingStyle]:""}:void 0,hidden:j,id:i},ref:S,shouldPreventOpenAnimation:R,shouldRender:L,transitionStatus:T,width:A.width}}function Bv(e){return{height:e.scrollHeight,width:e.scrollWidth}}function sjt(e,t){const n=ta(e).getComputedStyle(e),i=(n.animationName.split(",").map(s=>s.trim()).some(s=>s!==""&&s!=="none")||t)&&Bne(n.animationDuration),r=Bne(n.transitionDuration);return i&&r||r?"css-transition":i?"css-animation":"none"}function Bne(e){return e.split(",").map(t=>t.trim()).some(t=>t!==""&&Number.parseFloat(t)>0)}function N_(e,t,n){const i=e.style.getPropertyValue(t),r=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(i===""){e.style.removeProperty(t);return}e.style.setProperty(t,i,r)}}function ajt(e){const t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(r=>{e.style.setProperty(r,"initial","important")});function n(){Object.entries(t).forEach(([r,s])=>{if(s===""){e.style.removeProperty(r);return}e.style.setProperty(r,s)})}const i=_c.request(n);return()=>{_c.cancel(i),n()}}let Une=function(e){return e.accordionPanelHeight="--accordion-panel-height",e.accordionPanelWidth="--accordion-panel-width",e}({});const jLe=p.forwardRef(function(t,n){const{className:i,hiddenUntilFound:r,keepMounted:s,id:o,render:l,style:c,...u}=t,{hiddenUntilFound:d,keepMounted:f}=OLe(),{defaultPanelId:h,mounted:m,onOpenChange:g,open:b,setMounted:v,setOpen:y,setPanelIdState:w,transitionStatus:x}=ELe(),O=r??d,k=s??f,S=o||void 0,C=o??h;Jn(()=>(w(M=>S??(M===null?void 0:M)),()=>{w(M=>M===S?null:M)}),[S,w]);const{height:E,props:j,ref:T,shouldPreventOpenAnimation:R,shouldRender:A,transitionStatus:N,width:P}=rjt({externalRef:n,hiddenUntilFound:O,id:C,keepMounted:k,mounted:m,onOpenChange:g,open:b,setMounted:v,setOpen:y,transitionStatus:x}),{state:I,triggerId:D}=fq(),_={...I,transitionStatus:N},L=m_e(c,_),F=Ra("div",{...t,style:void 0},{state:_,ref:T,props:[j,{"aria-labelledby":D,role:"region",style:{[Une.accordionPanelHeight]:E===void 0?"auto":`${E}px`,[Une.accordionPanelWidth]:P===void 0?"auto":`${P}px`}},u,L?{style:L}:void 0,R?{style:{animationName:"none"}}:void 0],stateAttributesMapping:pq});return A?F:null}),ojt=(e,t)=>{const n=e.currentTarget,i={x:e.clientX,y:e.clientY},r=ljt(i,n.getBoundingClientRect()),s=cjt(i,r),o=ujt(t.getBoundingClientRect());return fjt([...s,...o])};function ljt(e,t){const n=Math.abs(t.top-e.y),i=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,i,r,s)){case s:return"left";case r:return"right";case n:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function cjt(e,t,n=5){const i=[];switch(t){case"top":i.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":i.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":i.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":i.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return i}function ujt(e){const{top:t,right:n,bottom:i,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:i},{x:r,y:i}]}function djt(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,o=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}function fjt(e){const t=e.slice();return t.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),hjt(t)}function hjt(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i=2;){const s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let i=e.length-1;i>=0;i--){const r=e[i];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const pjt="_Transition_1wdpp_1",mjt="_Popover_1wdpp_3",NLe={Transition:pjt,Popover:mjt},RLe=p.createContext(null),LM=()=>{const e=p.use(RLe);if(!e)throw new Error("Popover components must be wrapped in ");return e},Lg=({open:e,onOpenChange:t,showOnHover:n=!1,hoverOpenDelay:i=150,children:r})=>{const[s,o]=p.useState(!1),[l,c]=p.useState(!1),u=p.useRef(null),d=p.useRef(null),f=p.useRef(void 0),h=p.useRef(!1),m=p.useRef(!1),g=e??s,[b,v]=p.useState(!1);OV(()=>v(!1),b?500:null);const y=rb(t),w=rb(C=>{var E,j;clearTimeout(f.current),g!==C&&(C||(c(!1),n&&h.current&&((E=u.current)==null||E.focus()),h.current=!1),(j=y.current)==null||j.call(y,C),o(C),n&&v(C))}),x=p.useCallback(C=>{w.current(C)},[w]),O=p.useCallback(()=>{f.current=setTimeout(()=>x(!0),i)},[x,i]),k=p.useCallback(()=>{clearTimeout(f.current)},[]);p.useEffect(()=>()=>{clearTimeout(f.current)},[]);const S=p.useMemo(()=>({open:g,setOpen:x,shake:l,setShake:c,showOnHover:n,temporarilyPreventClickToClose:b,onTriggerEnter:O,onTriggerLeave:k,isPointerInTransitRef:m,triggerRef:u,contentRef:d,hoverOpenFocusedWithTab:h}),[g,x,l,c,n,b,h,m,O,k]);return a.jsx(RLe,{value:S,children:a.jsx(IRe,{open:g,onOpenChange:x,modal:!1,children:r})})},gjt=({children:e,onPointerDown:t,onClick:n})=>{const{setOpen:i,showOnHover:r,temporarilyPreventClickToClose:s,onTriggerEnter:o,onTriggerLeave:l,isPointerInTransitRef:c,triggerRef:u,contentRef:d}=LM(),f=p.useRef(!1),h=b=>{!(b.currentTarget.nodeName.toLocaleLowerCase()==="a")&&s&&(b.preventDefault(),b.stopPropagation())},m=b=>{b.pointerType!=="touch"&&!f.current&&!c.current&&(o(),f.current=!0)},g=()=>{f.current&&(l(),f.current=!1)};return a.jsx(PRe,{asChild:!0,ref:u,onPointerDown:b=>{h(b),t==null||t(b)},onClick:b=>{h(b),n==null||n(b)},onPointerMove:r?m:void 0,onPointerLeave:r?g:void 0,onFocus:r?()=>i(!0):void 0,onBlur:r?()=>{setTimeout(()=>{var b;(b=d.current)!=null&&b.contains(document.activeElement)||i(!1)},50)}:void 0,children:e})},ILe=({children:e,avoidCollisions:t,width:n,minWidth:i,maxWidth:r,side:s,sideOffset:o=8,align:l,alignOffset:c,translucent:u,className:d,autoFocus:f=!0})=>{const{showOnHover:h,shake:m,contentRef:g}=LM(),b=v=>{const y=g.current;if(y&&v.target===y&&v.key==="Tab"&&v.shiftKey){v.preventDefault(),v.stopPropagation();const w=sNe(y),x=w[w.length-1];x==null||x.focus()}};return p.useEffect(()=>{const v=g.current;!v||!f||v!=null&&v.contains(document.activeElement)||h||v.focus({preventScroll:!0})},[g,h,f]),a.jsx(MRe,{forceMount:!0,ref:g,className:Ui(NLe.Popover,d),style:z0({"popover-width":n,"popover-min-width":i,"popover-max-width":r}),onCloseAutoFocus:h?Dp:void 0,"data-animate":m?"shake":void 0,"data-translucent":u?"true":void 0,side:s,sideOffset:o,align:l,alignOffset:c??(l==="center"?0:-5),avoidCollisions:t??!0,hideWhenDetached:!0,collisionPadding:20,onOpenAutoFocus:Dp,onEscapeKeyDown:Dp,onKeyDown:b,children:e})},bjt=e=>{const{setOpen:t,triggerRef:n,contentRef:i,isPointerInTransitRef:r,hoverOpenFocusedWithTab:s}=LM(),[o,l]=p.useState(null),c=p.useCallback(()=>{l(null),r.current=!1},[r]),u=p.useCallback((d,f)=>{const h=ojt(d,f);l(h),r.current=!0},[r]);return p.useEffect(()=>()=>c(),[c]),p.useEffect(()=>{const d=n.current,f=i.current;if(!d||!f)return;const h=g=>u(g,f),m=g=>u(g,d);return d.addEventListener("pointerleave",h),f.addEventListener("pointerleave",m),()=>{d.removeEventListener("pointerleave",h),f.removeEventListener("pointerleave",m)}},[i,n,u,c]),p.useEffect(()=>{if(!o)return;const d=f=>{const h=n.current,m=i.current,g=f.target,b={x:f.clientX,y:f.clientY},v=(h==null?void 0:h.contains(g))||(m==null?void 0:m.contains(g)),y=!djt(b,o),w=g.hasAttribute("aria-haspopup");v?c():(y||w)&&(c(),t(!1))};return document.addEventListener("pointermove",d),()=>document.removeEventListener("pointermove",d)},[o,t,c,n,i]),p.useEffect(()=>{const d=f=>{if(i.current&&f.key==="Tab"&&!f.shiftKey){const[h]=sNe(i.current);h&&(f.preventDefault(),h.focus(),s.current=!0,document.removeEventListener("keydown",d))}};return document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d)}},[i,s]),a.jsx(ILe,{...e})},yjt=e=>{const{open:t,showOnHover:n,setOpen:i}=LM();return JA(t,()=>{i(!1)}),a.jsx(DRe,{forceMount:!0,children:a.jsx(Y1,{enterDuration:600,exitDuration:300,className:NLe.Transition,disableAnimations:!0,children:t&&(n?a.jsx(bjt,{...e},"popover-hover"):a.jsx(ILe,{...e},"popover"))})})};Lg.Trigger=gjt;Lg.Content=yjt;const vjt=["skill_hub","skill_space","knowledge_base","tool"];function PLe(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m4 6 4 4 4-4"})})}function DLe({label:e}){return a.jsx("div",{className:"create-agent-card__loading",role:"status","aria-label":e,children:[0,1,2].map(t=>a.jsxs("div",{className:"create-agent-card__skeleton-row","aria-hidden":"true",children:[a.jsx("span",{}),a.jsx("span",{})]},t))})}function xjt(e,t){return e.kind==="tool"?t("blocks.createAgents.builtinTool"):e.kind==="knowledge_base"?t("blocks.createAgents.knowledgeBase"):e.source.startsWith("skill_hub:")?"Skill Hub":e.source.startsWith("skill_space:")?t("blocks.createAgents.skillCenter"):"Skill"}function L4({label:e,resources:t}){const{t:n}=Te("conversation");return t.length===0?null:a.jsxs("section",{className:"create-agent-card__popover-section",children:[a.jsx("h4",{children:e}),a.jsx("div",{className:"create-agent-card__popover-list",children:t.map(i=>a.jsxs("div",{className:"create-agent-card__popover-item",children:[a.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[a.jsx("strong",{children:i.name}),a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",children:xjt(i,n)})]}),i.description?a.jsx("p",{children:i.description}):null]},i.ref))})]})}function wjt({tools:e}){const{t}=Te("conversation");return e.length===0?null:a.jsxs("section",{className:"create-agent-card__popover-section",children:[a.jsx("h4",{children:t("blocks.createAgents.selfAuthoredTools")}),a.jsx(kLe,{children:e.map((n,i)=>a.jsxs(ALe,{className:"create-agent-card__python-tool",value:`${n.name}:${i}`,children:[a.jsx(TLe,{className:"create-agent-card__python-tool-header",children:a.jsxs(_Le,{className:"create-agent-card__python-tool-trigger",children:[a.jsxs("span",{children:[a.jsx("strong",{children:n.name}),n.description?a.jsx("small",{children:n.description}):null]}),a.jsxs("span",{className:"create-agent-card__python-tool-meta",children:[a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",children:t("blocks.createAgents.selfAuthoredTools")}),a.jsx(PLe,{className:"create-agent-card__python-tool-chevron"})]})]})}),a.jsxs(jLe,{className:"create-agent-card__python-tool-panel",children:[n.dependencies.length>0?a.jsx("div",{className:"create-agent-card__python-tool-dependencies",children:t("blocks.createAgents.dependencies",{items:n.dependencies.join(", ")})}):null,a.jsx("pre",{tabIndex:0,"aria-label":t("blocks.createAgents.fullCode",{name:n.name}),children:a.jsx("code",{children:n.code})})]})]},`${n.name}:${i}`))})]})}function Ojt({agents:e}){const{t}=Te("conversation");return e.length===0?null:a.jsxs("section",{className:"create-agent-card__popover-section",children:[a.jsx("h4",{children:t("blocks.createAgents.subAgents")}),a.jsx("div",{className:"create-agent-card__popover-list",children:e.map(n=>a.jsxs("div",{className:"create-agent-card__popover-item",children:[a.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[a.jsx("strong",{children:n.id}),a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",children:t(`blocks.createAgents.agentTypes.${n.type}`,{defaultValue:n.type})})]}),n.description?a.jsx("p",{children:n.description}):null]},n.id))})]})}function R_({label:e,count:t,icon:n,children:i}){const{t:r}=Te("conversation"),s=a.jsxs("button",{className:"create-agent-card__resource-metric",type:"button",disabled:t===0,"aria-label":r("blocks.createAgents.itemCount",{label:e,count:t}),children:[n,a.jsx("span",{children:t})]});return t===0?s:a.jsxs(Lg,{showOnHover:!0,hoverOpenDelay:120,children:[a.jsx(Lg.Trigger,{children:s}),a.jsx(Lg.Content,{side:"top",align:"start",minWidth:"auto",maxWidth:360,className:"create-agent-card__resource-popover",children:i})]})}function kjt({response:e,status:t}){const{t:n}=Te("conversation"),i=p.useMemo(()=>({tool:n("blocks.createAgents.sourceLabels.tool"),knowledge:n("blocks.createAgents.sourceLabels.knowledge"),skillCenter:n("blocks.createAgents.sourceLabels.skillCenter"),unknownSource:n("blocks.createAgents.sourceLabels.unknown"),unnamedResource:n("blocks.createAgents.unnamedResource"),unnamedAgent:n("blocks.createAgents.unnamedAgent")}),[n]),r=p.useMemo(()=>L_t(e,i),[i,e]),s=p.useMemo(()=>vjt.map(c=>{const u=$_t(r,c);return{value:c,label:n(`blocks.createAgents.categories.${c}`),...u,searchKeywords:[...new Set(u.sources.flatMap(d=>d.searchKeywords))]}}),[r,n]),o=t==="failed",l=o?MM(e):"";return a.jsx("section",{className:"create-agent-tool-card","aria-label":n("blocks.createAgents.collectionAria"),children:t==="running"?a.jsx(DLe,{label:n("blocks.createAgents.retrieving")}):o?a.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[a.jsx("span",{className:"create-agent-card__message-title",children:n("blocks.createAgents.retrievalFailed")}),a.jsx("span",{children:l||n("blocks.createAgents.checkConfig")})]}):a.jsx(kLe,{className:"create-agent-card__accordion",children:s.map(c=>a.jsxs(ALe,{className:"create-agent-card__accordion-item",value:c.value,children:[a.jsx(TLe,{className:"create-agent-card__accordion-header",children:a.jsxs(_Le,{className:"create-agent-card__accordion-trigger",children:[a.jsx("span",{children:c.label}),a.jsxs("span",{className:"create-agent-card__accordion-meta",children:[a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",children:c.sources.length===0?c.value==="skill_hub"?n("blocks.createAgents.notSearched"):n("blocks.createAgents.notConfigured"):c.resources.length}),a.jsx(PLe,{className:"create-agent-card__accordion-chevron"})]})]})}),a.jsx(jLe,{className:"create-agent-card__accordion-content",children:a.jsxs("div",{className:"create-agent-card__accordion-scroll",role:"region","aria-label":n("blocks.createAgents.resourceList",{label:c.label}),tabIndex:0,children:[c.value==="skill_hub"&&c.searchKeywords.length>0?a.jsxs("div",{className:"create-agent-card__search-keywords",children:[a.jsx("span",{children:n("blocks.createAgents.searchKeywords")}),a.jsx("span",{children:c.searchKeywords.join("、")})]}):null,c.resources.length>0?a.jsx("div",{className:"create-agent-card__resource-list",children:c.resources.map(u=>a.jsx("div",{className:"create-agent-card__resource",children:a.jsxs("div",{className:"create-agent-card__resource-main",children:[a.jsxs("div",{className:"create-agent-card__resource-title",children:[a.jsx("span",{className:"create-agent-card__resource-name",children:u.name}),u.version?a.jsx(Ya,{className:"create-agent-card__resource-version",color:"secondary",size:"sm",variant:"soft",children:u.version}):null]}),u.description?a.jsx("p",{children:u.description}):null]})},u.ref))}):a.jsxs("div",{className:"create-agent-card__empty-category",children:[a.jsx("p",{children:c.sources.length===0?c.value==="skill_hub"?n("blocks.createAgents.skillHubSkipped"):n("blocks.createAgents.sourceSkipped",{label:c.label}):n("blocks.createAgents.noResources")}),c.sources.filter(u=>u.message).map(u=>a.jsx("p",{className:"create-agent-card__raw-source-error",children:u.message},u.source))]})]})})]},c.value))},r.collectionId||"collected-resources")})}function Sjt({args:e,response:t,status:n}){const{t:i}=Te("conversation"),r=p.useMemo(()=>({tool:i("blocks.createAgents.sourceLabels.tool"),knowledge:i("blocks.createAgents.sourceLabels.knowledge"),skillCenter:i("blocks.createAgents.sourceLabels.skillCenter"),unknownSource:i("blocks.createAgents.sourceLabels.unknown"),unnamedResource:i("blocks.createAgents.unnamedResource"),unnamedAgent:i("blocks.createAgents.unnamedAgent")}),[i]),s=p.useMemo(()=>bLe(e,t,r),[e,r,t]),o=n==="failed"?MM(t):"";return a.jsxs("section",{className:"create-agent-tool-card is-agent-results","aria-label":i("blocks.createAgents.resultAria"),children:[o?a.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[a.jsx("span",{className:"create-agent-card__message-title",children:i("blocks.createAgents.creationFailed")}),a.jsx("span",{children:o})]}):null,s.agents.length>0?a.jsx("div",{className:"create-agent-card__agent-grid",children:s.agents.map(l=>{const c=n==="failed"?"failed":l.status,u=l.error||c==="failed"&&o,d=l.builtinTools.length+l.pythonTools.length;return a.jsxs(vH,{className:`create-agent-card__agent-card${u?" is-error":""}`,children:[a.jsx(xH,{leading:a.jsx(t1,{seed:l.name}),title:l.name,titleText:l.name,status:a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",children:i(`blocks.createAgents.agentTypes.${l.rootType}`,{defaultValue:l.rootType})})}),l.description?a.jsx(wH,{children:l.description}):null,u?a.jsx("div",{className:"create-agent-card__agent-result is-error",role:"alert",children:u}):null,a.jsxs("div",{className:"create-agent-card__agent-resources","aria-label":i("blocks.createAgents.agentResources",{name:l.name}),children:[a.jsx(R_,{label:i("blocks.createAgents.skill"),count:l.skills.length,icon:a.jsx(mN,{"aria-hidden":"true"}),children:a.jsx(L4,{label:i("blocks.createAgents.skill"),resources:l.skills})}),a.jsx(R_,{label:i("blocks.createAgents.knowledgeBase"),count:l.knowledgeBases.length,icon:a.jsx(mIe,{"aria-hidden":"true"}),children:a.jsx(L4,{label:i("blocks.createAgents.knowledgeBase"),resources:l.knowledgeBases})}),a.jsxs(R_,{label:i("blocks.createAgents.toolsLabel"),count:d,icon:a.jsx(pat,{"aria-hidden":"true"}),children:[a.jsx(L4,{label:i("blocks.createAgents.builtinTool"),resources:l.builtinTools}),a.jsx(wjt,{tools:l.pythonTools})]}),a.jsx(R_,{label:i("blocks.createAgents.subAgents"),count:l.subAgentCount,icon:a.jsx(gat,{"aria-hidden":"true"}),children:a.jsx(Ojt,{agents:l.subAgents})})]})]},l.name)})}):n==="running"?a.jsx(DLe,{label:i("blocks.createAgents.creating")}):a.jsxs("div",{className:"create-agent-card__message",children:[a.jsx("span",{className:"create-agent-card__message-title",children:i("blocks.createAgents.noAgents")}),a.jsx("span",{children:i("blocks.createAgents.noAgentResult")})]})]})}const Ejt={web_search:{name:"web_search",runningLabel:"Searching the web",doneLabel:"Web search complete",tone:"search",icon:Pne},link_reader:{name:"link_reader",runningLabel:"Reading webpage",doneLabel:"Webpage read complete",tone:"search",icon:Pne},run_code:{name:"run_code",runningLabel:"Running code in the AgentKit sandbox",doneLabel:"Code execution completed in the AgentKit sandbox",tone:"sandbox",icon:m_t},list_envs:{name:"list_envs",runningLabel:"Checking available environments",doneLabel:"Available environments loaded",tone:"resources",icon:b_t},get_env_manifest:{name:"get_env_manifest",runningLabel:"Loading the environment manifest",doneLabel:"Environment manifest loaded",tone:"knowledge",icon:y_t},execute_in_sandbox:{name:"execute_in_sandbox",runningLabel:"Running a command in the environment",doneLabel:"Command completed in the environment",tone:"sandbox",icon:Mne},delegate_to_codex_sandbox:{name:"delegate_to_codex_sandbox",runningLabel:"Codex Sandbox is running",doneLabel:"Codex Sandbox completed",failedLabel:"Codex Sandbox failed",tone:"sandbox",icon:Mne},image_generate:{name:"image_generate",runningLabel:"Generating image",doneLabel:"Image generated",tone:"image",icon:u_t},video_generate:{name:"video_generate",runningLabel:"Generating video",doneLabel:"Video generated",tone:"video",icon:lq},ppt_generate:{name:"ppt_generate",runningLabel:"Generating presentation",doneLabel:"Presentation generated",tone:"presentation",icon:d_t},load_memory:{name:"load_memory",runningLabel:"Searching long-term memory",doneLabel:"Memory search complete",tone:"memory",icon:f_t},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"Searching the knowledge base",doneLabel:"Knowledge base search complete",tone:"knowledge",icon:h_t},load_skill:{name:"load_skill",runningLabel:"Loading skill",doneLabel:"Skill loaded",tone:"skill",icon:p_t},collect_resources:{name:"collect_resources",runningLabel:"Collecting available resources",doneLabel:"Resource collection complete",failedLabel:"Resource collection failed",tone:"resources",icon:g_t,detailRenderer:kjt},create_agents:{name:"create_agents",runningLabel:"Creating and running agents",doneLabel:"Agent creation complete",failedLabel:"Agent creation failed",tone:"agent",icon:Dne,detailRenderer:Sjt},branch_compare:{name:"branch_compare",runningLabel:"",doneLabel:"",failedLabel:"",tone:"search",icon:Dne,detailRenderer:U_t,hideHeader:!0}};function mq(e){return Ejt[e]}function Cjt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3h8l4 4v14H6Z"}),a.jsx("path",{d:"M14 3v5h5"}),a.jsx("path",{d:"m10 12-2 2 2 2M14 12l2 2-2 2"})]})}function Ajt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M12 3 19 6v5c0 4.6-2.8 7.8-7 10-4.2-2.2-7-5.4-7-10V6l7-3Z"}),a.jsx("path",{d:"m9 12 2 2 4-4"})]})}function Tjt(e,t){const n=new Map(e.map(o=>[o.path,o.content])),i=new Map(t.map(o=>[o.path,o.content])),r=new Set([...n.keys(),...i.keys()]),s=[];for(const o of[...r].sort((l,c)=>l.localeCompare(c))){const l=n.get(o),c=i.get(o);l!==c&&s.push({path:o,status:l===void 0?"added":c===void 0?"deleted":"modified",before:l??"",after:c??""})}return s}function Nb(e){return{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,...e}}function MLe(e){return a.jsx("svg",{...Nb(e),children:a.jsx("path",{d:"m9 7-5 5 5 5M15 7l5 5-5 5M13.5 4l-3 16"})})}function $4(e){return a.jsx("svg",{...Nb(e),children:a.jsx("path",{d:"M6.5 3.75h7l4 4V20.25h-11zM13.5 3.75v4h4M9 12h6M9 15.5h4.5"})})}function _jt(e){return a.jsx("svg",{...Nb(e),children:a.jsx("path",{d:"M3.75 7.25h6l1.75 2h8.75v9.25H3.75zM3.75 7.25V5.5h5l1.5 1.75"})})}function jjt(e){return a.jsx("svg",{...Nb(e),children:a.jsx("path",{d:"m9 5 7 7-7 7"})})}function xT(e){return a.jsx("svg",{...Nb(e),children:a.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function Njt(e){return a.jsxs("svg",{...Nb(e),children:[a.jsx("circle",{cx:"12",cy:"12",r:"3.25"}),a.jsx("path",{d:"M12 2.75v2M12 19.25v2M2.75 12h2M19.25 12h2M5.45 5.45l1.4 1.4M17.15 17.15l1.4 1.4M18.55 5.45l-1.4 1.4M6.85 17.15l-1.4 1.4"})]})}function Rjt(e){return a.jsx("svg",{...Nb(e),children:a.jsx("path",{d:"M19.25 15.25A8 8 0 0 1 8.75 4.75a8 8 0 1 0 10.5 10.5Z"})})}function LLe(e){return a.jsxs("svg",{...Nb(e),children:[a.jsx("path",{d:"M19.25 8.25V4.5l-1.8 1.8a7.5 7.5 0 1 0 1.8 7.65"}),a.jsx("path",{d:"M19.25 4.5H15.5"})]})}const Ijt=p.lazy(()=>Zs(()=>Promise.resolve().then(()=>wFe),void 0)),Pjt=p.lazy(()=>Zs(()=>import("../chunks/CodeDiffEditor-D2VDIxmZ.js"),[])),$Le="veadk-code-workspace-theme";function Djt(e){const t={name:"",children:new Map};for(const n of e){const i=n.path.split("/").filter(Boolean);let r=t;i.forEach((s,o)=>{let l=r.children.get(s);l||(l={name:s,children:new Map},r.children.set(s,l)),o===i.length-1&&(l.path=n.path),r=l})}return t}function Mjt(e,t=!1){return[...e.children.values()].sort((n,i)=>{const r=n.children.size>0&&n.path===void 0,s=i.children.size>0&&i.path===void 0;return r!==s?t?r?1:-1:r?-1:1:n.name.localeCompare(i.name)})}function Ljt(){if(typeof window>"u")return"light";try{return window.localStorage.getItem($Le)==="dark"?"dark":"light"}catch{return"light"}}function $jt(e){return e===""?0:e.split(` +`).length}function a1({project:e,open:t,onClose:n,onChange:i,readOnly:r=!1,comparison:s}){var N;const{t:o}=Te("workspaceTools"),l=p.useId(),c=p.useRef(null),u=p.useRef(null),d=p.useRef(n),[f,h]=p.useState(Ljt),m=p.useMemo(()=>s?Tjt(s.baseProject.files,e.files):[],[s,e.files]),g=p.useMemo(()=>s?m.map(P=>({path:P.path,content:P.status==="deleted"?P.before:P.after})):e.files,[m,s,e.files]),b=p.useMemo(()=>new Map(m.map(P=>[P.path,P.status])),[m]),[v,y]=p.useState(((N=g[0])==null?void 0:N.path)??null),[w,x]=p.useState(new Set),O=p.useMemo(()=>Djt(g),[g]),k=g.find(P=>P.path===v)??null,S=m.find(P=>P.path===v)??null;if(d.current=n,p.useEffect(()=>{try{window.localStorage.setItem($Le,f)}catch{}},[f]),p.useEffect(()=>{var _;if(!t)return;const P=document.body.style.overflow,I=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(_=u.current)==null||_.focus();const D=L=>{if(L.key==="Escape"){L.preventDefault(),d.current();return}if(L.key!=="Tab"||!c.current)return;const F=[...c.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')].filter(q=>q.offsetParent!==null);if(F.length===0)return;const M=F[0],V=F[F.length-1];L.shiftKey&&document.activeElement===M?(L.preventDefault(),V.focus()):!L.shiftKey&&document.activeElement===V&&(L.preventDefault(),M.focus())};return window.addEventListener("keydown",D),()=>{document.body.style.overflow=P,window.removeEventListener("keydown",D),I!=null&&I.isConnected&&I.focus()}},[t]),p.useEffect(()=>{k||g.length===0||y(g[0].path)},[g,k]),!t)return null;function C(P){x(I=>{const D=new Set(I);return D.has(P)?D.delete(P):D.add(P),D})}function E(P){return P?a.jsx("span",{className:`code-browser-change is-${P}`,children:o(`codeBrowser.change.${P}`)}):null}function j(P,I,D){return Mjt(P,I===0).map(_=>{const L=D?`${D}/${_.name}`:_.name;if(!(_.children.size>0&&_.path===void 0)&&_.path){const V=b.get(_.path);return a.jsxs("button",{type:"button",className:`code-browser-file${v===_.path?" is-active":""}`,style:{paddingLeft:`${12+I*16}px`},onClick:()=>y(_.path??null),title:_.path,"aria-pressed":v===_.path,children:[a.jsx($4,{}),a.jsx("span",{children:_.name}),E(V)]},L)}const M=w.has(L);return a.jsxs("div",{children:[a.jsxs("button",{type:"button",className:"code-browser-folder",style:{paddingLeft:`${10+I*16}px`},onClick:()=>C(L),"aria-expanded":!M,children:[a.jsx(jjt,{className:M?"":"is-open"}),a.jsx(_jt,{}),a.jsx("span",{children:_.name})]}),!M&&j(_,I+1,L)]},L)})}function T(P){!k||s||i({...e,files:e.files.map(I=>I.path===k.path?{...I,content:P}:I)})}const R=f==="light"?"dark":"light",A=o(s?"codeBrowser.noChanges":"codeBrowser.chooseFile");return yi.createPortal(a.jsx("div",{className:"code-browser-backdrop",onMouseDown:P=>{P.target===P.currentTarget&&n()},children:a.jsxs("section",{ref:c,className:`code-browser-dialog is-${f}`,role:"dialog","aria-modal":"true","aria-labelledby":l,children:[a.jsxs("header",{className:"code-browser-head",children:[a.jsxs("div",{className:"code-browser-title-wrap",children:[a.jsx("span",{className:"code-browser-title-icon",children:a.jsx(MLe,{})}),a.jsxs("div",{children:[a.jsx("h2",{id:l,children:o(s?"codeBrowser.compareTitle":"codeBrowser.workspaceTitle")}),a.jsx("p",{title:e.name,children:e.name||o("codeBrowser.projectFallback")})]})]}),a.jsxs("div",{className:"code-browser-head-actions",children:[a.jsx("button",{type:"button",className:"code-browser-icon-button",onClick:()=>h(R),"aria-label":o("codeBrowser.switchTheme"),title:o("codeBrowser.switchThemeTitle",{theme:o(`codeBrowser.themes.${R}`)}),children:f==="light"?a.jsx(Rjt,{}):a.jsx(Njt,{})}),a.jsx("button",{ref:u,type:"button",className:"code-browser-icon-button",onClick:n,"aria-label":o("codeBrowser.closeWorkspace"),title:o("codeBrowser.close"),children:a.jsx(xT,{})})]})]}),a.jsxs("div",{className:"code-browser-workspace",children:[a.jsxs("aside",{className:"code-browser-sidebar","aria-label":o(s?"codeBrowser.changedFiles":"codeBrowser.projectFiles"),children:[a.jsxs("div",{className:"code-browser-sidebar-head",children:[a.jsx("span",{children:o(s?"codeBrowser.changes":"codeBrowser.files")}),a.jsx("span",{children:g.length})]}),a.jsx("div",{className:"code-browser-tree",children:g.length>0?j(O,0,""):a.jsx("div",{className:"code-browser-empty",children:A})})]}),a.jsxs("main",{className:"code-browser-main",children:[a.jsx("div",{className:"code-browser-tabs",role:"tablist","aria-label":o("codeBrowser.openFiles"),children:k?a.jsxs("div",{className:"code-browser-tab",role:"tab","aria-selected":"true",children:[a.jsx($4,{}),a.jsx("span",{children:k.path.split("/").pop()}),E(S==null?void 0:S.status)]}):null}),a.jsxs("div",{className:"code-browser-path",children:[a.jsx($4,{}),a.jsx("span",{children:(k==null?void 0:k.path)??o("codeBrowser.noFileSelected")})]}),s?a.jsxs("div",{className:"code-browser-diff-labels","aria-label":o("codeBrowser.comparisonDirection"),children:[a.jsx("span",{children:s.baseLabel??o("codeBrowser.before")}),a.jsx("span",{children:s.targetLabel??o("codeBrowser.after")})]}):null,a.jsx("div",{className:"code-browser-editor",children:k?a.jsx(p.Suspense,{fallback:a.jsx("div",{className:"code-browser-empty",children:o("codeBrowser.loadingEditor")}),children:S?a.jsx(Pjt,{before:S.before,after:S.after,path:S.path,theme:f}):a.jsx(Ijt,{value:k.content,path:k.path,onChange:T,readOnly:r,theme:f})}):a.jsx("div",{className:"code-browser-empty",children:A})}),a.jsxs("footer",{className:"code-browser-statusbar",children:[a.jsx("span",{children:s?o("codeBrowser.changedFileCount",{count:m.length}):o("codeBrowser.fileCount",{count:e.files.length})}),a.jsx("span",{children:k?o("codeBrowser.lineCount",{count:$jt(k.content)}):"UTF-8"})]})]})]})]})}),document.body)}function Fjt({project:e,onChange:t,className:n="",label:i}){const{t:r}=Te("workspaceTools"),[s,o]=p.useState(!1),l=i??r("codeBrowser.viewSource");return a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:`code-browser-trigger ${n}`.trim(),onClick:()=>o(!0),"aria-label":r("codeBrowser.viewSourceAria"),title:l,children:[a.jsx(MLe,{}),a.jsx("span",{children:l})]}),a.jsx(a1,{project:e,open:s,onClose:()=>o(!1),onChange:t})]})}const my="••••••••",I_=5,Uv=8e3,Bjt=8,Ujt=/(?:authorization|cookie|password|passwd|secret|token|api[_-]?key|access[_-]?key|credential|signature|^env(?:ironment)?$|^ak$|^sk$)/i,FLe=/\u001b\[[0-?]*[ -/]*[@-~]/g,BLe=/\u001b\][^\u0007]*(?:\u0007|\u001b\\)/g,ULe=/[\u0000-\u0008\u000b\u000c\u000e-\u001a\u001c-\u001f\u007f-\u009f]/g,Qjt=new Set(["exec_command","commandExecution","command_execution","run_code","execute_in_sandbox","Run command"]),zjt=new Set(["web_search","search","grep","rg"]),Vjt=new Set(["read_file","read","list_files","glob","ls"]),Hjt=new Set(["apply_patch","file_change","fileChange"]),qjt=new Set(["create_goal","update_goal","get_goal"]);function vg(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function b0(...e){for(const t of e)if(typeof t=="string"&&t.trim())return t.trim();return""}function F4(...e){for(const t of e){if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"&&t.trim()&&Number.isFinite(Number(t)))return Number(t)}}function PI(e){const t=vg(e);if(!t)return[];const n=[t];for(const i of["payload","input","arguments","args","goal","result","display","safeCommandSummary","safeInputSummary"]){const r=vg(t[i]);r&&n.push(r)}return n}function mE(e,...t){return b0(...e.flatMap(n=>t.map(i=>n[i])))}function Wjt(e){let t=e.replace(FLe,"").replace(BLe,"").replace(ULe,"");return/[=:]|Bearer|Cookie|AKLT/i.test(t)&&(t=t.replace(/\bBearer\s+[^\s,;]+/gi,`Bearer ${my}`).replace(/\b(?:set-)?cookie\s*:\s*[^\r\n]*/gi,`cookie: ${my}`).replace(/\bAKLT[A-Za-z0-9_-]{6,}\b/g,my).replace(/((?:access[_-]?key(?:[_-]?id)?|secret(?:[_-]?(?:access)?[_-]?key)?|session[_-]?token|security[_-]?token|client[_-]?secret|api[_-]?key|authorization|cookie|[a-z0-9_-]{0,80}(?:password|secret|token)|credential|ak|sk)\s*[:=]\s*)(?:"[^"]*"|'[^']*'|[^\s,;&]+)/gi,`$1${my}`).replace(/([?&](?:access[_-]?key|api[_-]?key|client[_-]?secret|security[_-]?token|session[_-]?token|secret|token|password|authorization|cookie|credential)=)[^&#\s]+/gi,`$1${my}`).replace(/([?&](?:x-amz-(?:credential|signature|security-token)|x-tos-signature|signature)=)[^&#\s]+/gi,`$1${my}`)),t}function rf(e){return Wjt(e).replace(FLe,"").replace(BLe,"").replace(ULe,"")}function DI(e,t=0,n=new WeakSet){if(t>=Bjt)return"[truncated: maximum depth]";if(typeof e=="string")return rf(e);if(e===null||typeof e!="object")return e;if(n.has(e))return"[circular]";if(n.add(e),Array.isArray(e))return e.map(r=>DI(r,t+1,n));const i=vg(e);return i?Object.fromEntries(Object.entries(i).map(([r,s])=>[r,Ujt.test(r)?my:DI(s,t+1,n)])):e}function B4(e){const t=rf(e).trimEnd();if(!t)return;const n=t.split(/\r?\n/);return t.length>Uv*2?{text:t.slice(0,Uv)+t.slice(-Uv),head:[t.slice(0,Uv)],tail:[t.slice(-Uv)],omittedLines:0,omittedCharacters:t.length-Uv*2}:n.length<=I_*2?{text:t,head:n,tail:[],omittedLines:0,omittedCharacters:0}:{text:t,head:n.slice(0,I_),tail:n.slice(-I_),omittedLines:n.length-I_*2,omittedCharacters:0}}function Kjt(e){return qjt.has(e)?"goal":Qjt.has(e)?"command":zjt.has(e)||/search/i.test(e)?"search":Vjt.has(e)||/(?:read|list|glob)/i.test(e)?"read":Hjt.has(e)||/(?:write|edit|patch|file.?change)/i.test(e)?"file-change":/^(?:mcp|tool__)/i.test(e)||e.includes("/")?"mcp":/auth|credential|approval/i.test(e)?"authorization":"generic"}function Gjt(e,t){if(e.status)return e.status;const n=b0(t==null?void 0:t.status).toLowerCase();return(t==null?void 0:t.ok)===!1||["failed","error","cancelled","denied","timeout"].includes(n)?"failed":e.done||["completed","done","success"].includes(n)?"completed":"running"}function Qne(e){return typeof e=="string"?e.trim()?[e.trim()]:[]:Array.isArray(e)?e.flatMap(t=>{if(typeof t=="string")return t.trim()?[t.trim()]:[];const n=vg(t),i=b0(n==null?void 0:n.path,n==null?void 0:n.filename,n==null?void 0:n.name);return i?[i]:[]}):[]}function Xjt(e,t,n,i,r){const s=[...PI(n),...PI(i)];return e==="goal"?rf(mE(s,"objective","title","name")):e==="command"?rf(mE(s,"command","cmd","script","commandPreview","binary")):e==="search"?rf(mE(s,"query","pattern","search")):e==="read"||e==="file-change"?r.slice(0,2).map(rf).join(", "):rf(e==="mcp"?b0(n==null?void 0:n.query,n==null?void 0:n.resource,n==null?void 0:n.path):b0(n==null?void 0:n.title,n==null?void 0:n.name,i==null?void 0:i.message,i==null?void 0:i.status,t))}function gq(e){const t=vg(e.args),n=vg(e.response),i=e.args===void 0?void 0:DI(e.args),r=e.response===void 0?void 0:DI(e.response),s=[...PI(e.args),...PI(e.response)],o=Kjt(e.name),l=Gjt(e,n),c=vg(n==null?void 0:n.display)??vg(t==null?void 0:t.display),u=b0(n==null?void 0:n.aggregatedOutput,n==null?void 0:n.aggregated_output,n==null?void 0:n.output,n==null?void 0:n.errorMessage,n==null?void 0:n.error_message),d=[...Qne((t==null?void 0:t.paths)??(t==null?void 0:t.files)??(t==null?void 0:t.changes)??(t==null?void 0:t.path)),...Qne((n==null?void 0:n.paths)??(n==null?void 0:n.files)??(n==null?void 0:n.changes))],f=F4(n==null?void 0:n.exitCode,n==null?void 0:n.exit_code),h=F4(n==null?void 0:n.durationMs,n==null?void 0:n.duration_ms,c==null?void 0:c.durationMs),m=F4(n==null?void 0:n.count,n==null?void 0:n.total,n==null?void 0:n.totalCount);return{category:o,titleKey:o==="generic"?`generic.named.${l}`:`${o}.${l}`,titleParams:o==="generic"?{tool:e.name}:void 0,title:e.title,summary:Xjt(o,e.name,t,n,d),status:l,source:e.source,command:o==="command"?rf(b0(mE(s,"command","cmd","script","commandPreview","binary"))):void 0,cwd:o==="command"&&rf(mE(s,"cwd"))||void 0,output:B4(u),exitCode:f,durationMs:h,resultCount:m,paths:[...new Set(d.map(rf))],defaultOpen:e.defaultOpen===!0||l==="running"||l==="failed",rawArgs:i,rawResponse:r,rawArgsPreview:i===void 0?void 0:B4(zne(i)),rawResponsePreview:r===void 0?void 0:B4(zne(r))}}function zne(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}function Vne(e){return e.status==="completed"&&(e.category==="read"||e.category==="search")}function Nd(e){return{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,...e}}function Yjt(e){return a.jsxs("svg",{...Nd(e),children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),a.jsx("path",{d:"m7.5 9 2.7 2.5L7.5 14M12.7 14h3.8M3.8 7.5h16.4"})]})}function QLe(e){return a.jsxs("svg",{...Nd(e),children:[a.jsx("path",{d:"M6 3.5h7l5 5v12H6zM13 3.5v5h5M8.8 13h5.7M8.8 16h3.8"}),a.jsx("circle",{cx:"16.8",cy:"16.5",r:"2.3"}),a.jsx("path",{d:"m18.5 18.2 1.8 1.8"})]})}function Zjt(e){return a.jsxs("svg",{...Nd(e),children:[a.jsx("circle",{cx:"10.5",cy:"10.5",r:"5.75"}),a.jsx("path",{d:"m15 15 4.25 4.25"})]})}function Jjt(e){return a.jsxs("svg",{...Nd(e),children:[a.jsx("path",{d:"M5.5 3.5h7l4 4v4M12.5 3.5v4h4M10.5 20.5h-5v-17"}),a.jsx("path",{d:"m12.5 17.5 5.6-5.6 2 2-5.6 5.6-2.8.8z"})]})}function eNt(e){return a.jsxs("svg",{...Nd(e),children:[a.jsx("path",{d:"M8 8V4.5M16 8V4.5M6.5 8h11v3.5a5.5 5.5 0 0 1-11 0zM12 17v3"}),a.jsx("path",{d:"M5.5 4.5h5M13.5 4.5h5"})]})}function tNt(e){return a.jsxs("svg",{...Nd(e),children:[a.jsx("path",{d:"M12 3.5 19 6v5.2c0 4.3-2.7 7.6-7 9.3-4.3-1.7-7-5-7-9.3V6z"}),a.jsx("path",{d:"m8.8 12 2 2 4.4-4.4"})]})}function Hne(e){return a.jsx("svg",{...Nd(e),children:a.jsx("path",{d:"M14.8 6.2a4.1 4.1 0 0 0-5.6 5.6l-5.4 5.4a2 2 0 0 0 2.8 2.8l5.4-5.4a4.1 4.1 0 0 0 5.6-5.6l-2.5 2.5-2.6-.6-.6-2.6z"})})}function bq(e){return a.jsx("svg",{...Nd(e),children:a.jsx("path",{d:"m9 5 7 7-7 7"})})}function zLe(e){return a.jsx("svg",{...Nd(e),children:a.jsx("path",{d:"m5 12.5 4.5 4.5L19 7.5"})})}function nNt(e){return a.jsxs("svg",{...Nd(e),children:[a.jsx("circle",{cx:"12",cy:"12",r:"8.5"}),a.jsx("path",{d:"M12 7.5v5.25M12 16.25h.01"})]})}function iNt(e){return a.jsx("svg",{...Nd(e),children:a.jsx("path",{d:"M20 12a8 8 0 1 1-2.35-5.65"})})}function rNt(e){return a.jsxs("svg",{...Nd(e),children:[a.jsx("rect",{x:"8",y:"8",width:"11",height:"11",rx:"2"}),a.jsx("path",{d:"M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2"})]})}const sNt={goal:Hne,command:Yjt,read:QLe,search:Zjt,"file-change":Jjt,mcp:eNt,authorization:tNt,generic:Hne};function aNt(e){return e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(e<1e4?1:0)} s`}function VLe(e){if(e===void 0)return"";if(typeof e=="string"){const t=e.trim();if(t.startsWith("{")||t.startsWith("["))try{return JSON.stringify(JSON.parse(t),null,2)}catch{return e}return e}try{return JSON.stringify(e,null,2)}catch{return String(e)}}function oNt({status:e}){return e==="running"||e==="queued"?a.jsx(iNt,{className:"tool-activity__status-icon is-spinning"}):e==="failed"?a.jsx(nNt,{className:"tool-activity__status-icon"}):a.jsx(zLe,{className:"tool-activity__status-icon"})}function lNt({presentation:e,callId:t}){const{t:n}=Te("conversation"),[i,r]=p.useState(!1),[s,o]=p.useState(""),[l,c]=p.useState(!1),u=p.useRef(void 0);p.useEffect(()=>()=>window.clearTimeout(u.current),[]);const d=async(f,h)=>{window.clearTimeout(u.current);try{await navigator.clipboard.writeText(typeof h=="string"?h:VLe(h)),o(f),c(!1),u.current=window.setTimeout(()=>o(""),1500)}catch{o(""),c(!0),u.current=window.setTimeout(()=>c(!1),3e3)}};return e.rawArgs===void 0&&e.rawResponse===void 0&&!t?null:a.jsxs("div",{className:"tool-activity__raw",children:[a.jsxs("button",{type:"button",onClick:()=>r(f=>!f),"aria-expanded":i,children:[n("blocks.toolActivity.rawData"),a.jsx(bq,{className:i?"is-open":""})]}),i?a.jsxs("div",{className:"tool-activity__raw-body",children:[t?a.jsxs("div",{className:"tool-activity__raw-id",children:[a.jsx("span",{children:n("blocks.toolActivity.callId")}),a.jsx("code",{children:t}),a.jsx("button",{type:"button",onClick:()=>void d("id",t),"aria-label":n("blocks.toolActivity.copyCallId"),children:a.jsx(rNt,{})})]}):null,e.rawArgs!==void 0?a.jsx(qne,{label:n("blocks.arguments"),value:e.rawArgs,preview:e.rawArgsPreview,copied:s==="input",onCopy:()=>void d("input",e.rawArgs)}):null,e.rawResponse!==void 0?a.jsx(qne,{label:n("blocks.result"),value:e.rawResponse,preview:e.rawResponsePreview,copied:s==="result",onCopy:()=>void d("result",e.rawResponse)}):null,l?a.jsx("span",{className:"tool-activity__copy-error",role:"alert",children:n("blocks.toolActivity.copyFailed")}):null]}):null]})}function qne({label:e,value:t,preview:n,copied:i,onCopy:r}){const{t:s}=Te("conversation");return a.jsxs("section",{className:"tool-activity__raw-section",children:[a.jsxs("div",{children:[a.jsx("span",{children:e}),a.jsx("button",{type:"button",onClick:r,children:s(i?"blocks.toolActivity.copied":"blocks.toolActivity.copy")})]}),a.jsxs("pre",{children:[(n==null?void 0:n.head.join(` `))??VLe(t),n&&n.omittedCharacters>0?` ${s("blocks.toolActivity.omittedCharacters",{count:n.omittedCharacters})} ${n.tail.join(` @@ -598,79 +598,79 @@ ${n.tail.join(` `)}`:""]}):null}function HLe({input:e,children:t}){const{t:n}=Te("conversation"),i=gq(e),[r,s]=p.useState(i.defaultOpen),o=p.useRef(!1);p.useEffect(()=>{o.current||s(i.defaultOpen)},[i.defaultOpen]);const l=sNt[i.category],c=i.title||n(`blocks.toolActivity.${i.titleKey}`,{...i.titleParams,defaultValue:e.name||n("blocks.toolActivity.generic.completed")}),u=[i.durationMs===void 0?"":aNt(i.durationMs),i.exitCode===void 0?"":n("blocks.toolActivity.exitCode",{code:i.exitCode})].filter(Boolean),d=!!(t||i.command||i.output||i.paths.length||i.rawArgs!==void 0||i.rawResponse!==void 0);return a.jsxs("section",{className:"tool-activity","data-status":i.status,"data-category":i.category,children:[a.jsxs("button",{className:"tool-activity__head",type:"button","aria-expanded":d?r:void 0,disabled:!d,onClick:()=>{o.current=!0,s(f=>!f)},children:[a.jsx("span",{className:"tool-activity__icon","aria-hidden":"true",children:a.jsx(l,{})}),a.jsx("span",{className:"tool-activity__status",role:"img","aria-label":n(`blocks.toolActivity.status.${i.status}`),children:a.jsx(oNt,{status:i.status})}),a.jsx("span",{className:"tool-activity__title",children:c}),i.summary?a.jsx("span",{className:"tool-activity__summary",children:i.summary}):null,u.length?a.jsx("span",{className:"tool-activity__metrics",children:u.join(" · ")}):null,d?a.jsx(bq,{className:`tool-activity__chevron${r?" is-open":""}`,"aria-hidden":"true"}):null]}),a.jsx("div",{className:`tool-activity__collapse${r&&d?" is-open":""}`,"aria-hidden":!r||!d,inert:!r||!d?!0:void 0,children:a.jsx("div",{className:"tool-activity__collapse-inner",children:a.jsxs("div",{className:"tool-activity__detail",children:[i.command?a.jsxs("code",{className:"tool-activity__command",children:["$ ",i.command]}):null,i.cwd?a.jsx("div",{className:"tool-activity__cwd",children:i.cwd}):null,i.paths.length?a.jsx("ul",{className:"tool-activity__paths",children:i.paths.map(f=>a.jsx("li",{children:f},f))}):null,a.jsx(cNt,{presentation:i}),t,a.jsx(lNt,{presentation:i,callId:e.callId})]})})})]})}function uNt({items:e}){const{t}=Te("conversation"),[n,i]=p.useState(!1);return a.jsxs("section",{className:"tool-activity tool-activity--exploration",children:[a.jsxs("button",{className:"tool-activity__head",type:"button","aria-expanded":n,onClick:()=>i(r=>!r),children:[a.jsx("span",{className:"tool-activity__icon","aria-hidden":"true",children:a.jsx(QLe,{})}),a.jsx("span",{className:"tool-activity__status",role:"img","aria-label":t("blocks.toolActivity.status.completed"),children:a.jsx(zLe,{className:"tool-activity__status-icon"})}),a.jsx("span",{className:"tool-activity__title",children:t("blocks.toolActivity.explored",{count:e.length})}),a.jsx("span",{className:"tool-activity__summary",children:e.map(r=>gq(r).summary).filter(Boolean).slice(0,2).join(", ")}),a.jsx(bq,{className:`tool-activity__chevron${n?" is-open":""}`,"aria-hidden":"true"})]}),a.jsx("div",{className:`tool-activity__collapse${n?" is-open":""}`,"aria-hidden":!n,inert:n?void 0:!0,children:a.jsx("div",{className:"tool-activity__collapse-inner",children:a.jsx("div",{className:"tool-activity__exploration-items",children:e.map((r,s)=>a.jsx(HLe,{input:r},r.callId||`${r.name}:${s}`))})})})]})}const qLe="send_a2ui_json_to_client",dNt=28,fNt=3e3;function hNt(e,t,n){let i=t;for(let r=0;r65535?2:1}return i}function pNt(e){return e<=4?1:Math.min(18,Math.max(2,Math.ceil(e/6)))}function WLe(e,t,n,i){const[r,s]=p.useState(()=>t?"":e),o=p.useRef(r),l=p.useRef(e),c=p.useRef(null),u=p.useRef(0),d=p.useRef(n);return l.current=e,d.current=n,p.useEffect(()=>{const f=o.current,h=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(!t||h||!e.startsWith(f)){c.current!==null&&window.cancelAnimationFrame(c.current),c.current=null,f!==e&&(o.current=e,s(e));return}if(f===e||c.current!==null)return;const m=g=>{const b=l.current,v=o.current;if(!b.startsWith(v)){o.current=b,s(b),c.current=null;return}if(g-u.current{var f;(f=d.current)==null||f.call(d)},[r]),p.useEffect(()=>{r===e&&(i==null||i())},[r,i,e]),p.useEffect(()=>()=>{c.current!==null&&(window.cancelAnimationFrame(c.current),c.current=null)},[]),r}function mNt(){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M14.3 5.25a4.6 4.6 0 0 0-5.55 5.55L3.6 15.95a1.8 1.8 0 0 0 0 2.55l1.9 1.9a1.8 1.8 0 0 0 2.55 0l5.15-5.15a4.6 4.6 0 0 0 5.55-5.55l-2.9 2.9-2.45-.55-.55-2.45 2.9-2.9a4.6 4.6 0 0 0-1.45-1.45Z"})})}function gNt(){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"m4.5 7 1.8 1.8L9.5 5.5"}),a.jsx("path",{d:"M12 7h7.5"}),a.jsx("path",{d:"m4.5 13 1.8 1.8 3.2-3.3"}),a.jsx("path",{d:"M12 13h7.5"}),a.jsx("path",{d:"M5 19h4"}),a.jsx("path",{d:"M12 19h7.5"})]})}function bNt(){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M5 5v7.25A3.75 3.75 0 0 0 8.75 16H19"}),a.jsx("path",{d:"m15.5 12.5 3.5 3.5-3.5 3.5"})]})}function yNt({activity:e}){const{t}=Te("conversation"),n=[["Agent Session",e.agentSessionId],["Sandbox Session",e.sandboxSessionId],["Codex Thread",e.threadId]].filter(i=>!!i[1]);return n.length?a.jsx("dl",{className:"codex-sandbox-run__identity","aria-label":t("blocks.sandboxIdentity"),children:n.map(([i,r])=>a.jsxs("div",{children:[a.jsx("dt",{children:i}),a.jsx("dd",{title:r,children:r})]},i))}):null}function d9(e,t,n){if(e!=="load_skill"||t==null||typeof t!="object"||Array.isArray(t))return;const i=t.skill_name;if(!(typeof i!="string"||!i.trim()))return n("blocks.useSkill",{name:i.trim()})}function KLe({text:e,done:t,thoughtKind:n="thought",answerStarted:i=!1,streaming:r=!1,onStreamFrame:s}){const{t:o}=Te("conversation"),[l,c]=p.useState(!(t||i)),u=p.useRef(!1);p.useEffect(()=>{u.current||c(!(t||i))},[i,t]);const d=()=>{u.current=!0,c(b=>!b)},f=e.replace(/\r\n?/g,` `).trimStart().split(/\n{2,}/).map(b=>b.replace(/[^\S\n]*\n[^\S\n]*/g,(v,y,w)=>{const x=w[y-1]??"",O=w[y+v.length]??"";return!x||!O||new RegExp("\\p{Script=Han}","u").test(x)&&new RegExp("\\p{Script=Han}","u").test(O)||/[(\[{“‘/]/u.test(x)||/[),.\]},。!?;:、”’]/u.test(O)?"":" "})).join(` -`),h=WLe(f,!t||r,s),{ref:m,onScroll:g}=fLe(h);return a.jsxs("div",{className:"block-thinking",children:[a.jsxs("button",{className:"think-head",onClick:d,type:"button",children:[a.jsx("span",{className:"think-icon","aria-hidden":"true",children:a.jsx(cq,{className:`thinking-logo ${t?"":"is-active"}`})}),t?a.jsx("span",{className:"think-label think-label--done",children:o(n==="reasoning"?"blocks.reasoningDone":"blocks.thinkingDone")}):a.jsx(hn,{className:"think-label",duration:2.4,spread:18,children:o(n==="reasoning"?"blocks.reasoning":"blocks.thinking")}),a.jsx(BA,{className:`chev ${l?"open":""}`})]}),a.jsx("div",{className:`think-collapse ${l&&h?"open":""}`,children:a.jsx("div",{className:"think-collapse-inner",children:a.jsx("div",{className:"think-body scroll",ref:m,onScroll:g,children:h})})})]})}function GLe({text:e}){return a.jsx("div",{className:"block-progress",role:"status","aria-live":"polite","aria-atomic":"true",children:a.jsxs("div",{className:"think-head progress-head",children:[a.jsx("span",{className:"think-icon","aria-hidden":"true",children:a.jsx(cq,{className:"thinking-logo is-active"})}),a.jsx(hn,{className:"think-label",duration:2.4,spread:18,children:e})]})})}function vNt({value:e,onResolve:t,onResolveComparison:n,onDownload:i,onDeploy:r}){const{t:s,i18n:o}=Te("conversation"),l=N=>N.split(new RegExp("(?<=[/_-])")).map((P,I)=>a.jsxs(p.Fragment,{children:[P,a.jsx("wbr",{})]},`${I}:${P}`)),[c,u]=p.useState(e.files?e:null),[d,f]=p.useState(!1),[h,m]=p.useState(!1),[g,b]=p.useState(null),[v,y]=p.useState(null),[w,x]=p.useState(""),[O,k]=p.useState(null),S=new Date(e.validatedAt),C=e.validatedAt?Number.isNaN(S.getTime())?e.validatedAt:S.toLocaleString(o.resolvedLanguage??o.language,{hour12:!1}):s("blocks.justNow");p.useEffect(()=>{if(!O)return;const N=window.setTimeout(()=>k(null),fNt);return()=>window.clearTimeout(N)},[O]);async function E(){if(c)return c;if(!t)throw new Error(s("blocks.sourceUnavailable"));const N=await t(e);return u(N),N}async function j(){y("source"),x(""),k(null);try{await E(),f(!0)}catch(N){x(N instanceof Error?N.message:String(N))}finally{y(null)}}async function T(){if(i){y("download"),x(""),k(null);try{await i(e),k({message:s("blocks.downloadStarted")})}catch(N){x(N instanceof Error?N.message:String(N))}finally{y(null)}}}async function R(){if(n){y("compare"),x(""),k(null);try{const N=g??await n(e);b(N),m(!0)}catch(N){x(N instanceof Error?N.message:String(N))}finally{y(null)}}}async function A(){y("deploy"),x(""),k(null);try{r==null||r(await E())}catch(N){x(N instanceof Error?N.message:String(N))}finally{y(null)}}return a.jsxs(a.Fragment,{children:[a.jsxs("section",{className:`delivery-card${e.verified?" is-verified":" is-unverified"}`,"aria-label":e.verified?s("blocks.verifiedDelivery"):s("blocks.generatedSource"),children:[a.jsxs("header",{className:"delivery-card-header",children:[a.jsx("span",{className:"delivery-card-icon",children:e.verified?a.jsx(Ajt,{}):a.jsx(Cjt,{})}),a.jsxs("div",{className:"delivery-card-heading",children:[a.jsx("strong",{children:l(e.agentName)}),a.jsx("span",{children:e.verified?s("blocks.verifiedDelivery"):s("blocks.generatedSource")})]})]}),a.jsxs("dl",{className:"delivery-card-grid",children:[a.jsxs("div",{className:"delivery-card-entry",children:[a.jsx("dt",{children:s("blocks.entryPoint")}),a.jsx("dd",{children:a.jsx("code",{children:l(e.entryPoint)})})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("blocks.fileCount")}),a.jsx("dd",{children:e.fileCount})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("blocks.size")}),a.jsxs("dd",{children:[(e.artifactSize/1024).toFixed(1)," KiB"]})]}),a.jsxs("div",{className:"delivery-card-time",children:[a.jsx("dt",{children:e.verified?s("blocks.validationTime"):s("blocks.generationTime")}),a.jsx("dd",{children:C})]})]}),a.jsxs("p",{className:"delivery-card-gates",children:[e.verified?s("blocks.checksPassed",{count:e.gateSummary.length}):s("blocks.sourceReady")," ","· ",a.jsx("code",{children:e.artifactSha256.slice(0,12)})]}),e.verified?null:a.jsx("p",{className:"delivery-card-guidance",children:s("blocks.sourceGuidance")}),a.jsxs("div",{className:"delivery-card-actions",children:[a.jsxs("div",{className:"delivery-card-secondary-actions",children:[a.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void j(),disabled:!t||v!==null,children:[v==="source"?a.jsx(Bi,{className:"spin","aria-hidden":"true"}):null,s("blocks.viewSource")]}),e.projectId&&e.versionId&&e.parentVersionId?a.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void R(),disabled:!n||v!==null,children:[v==="compare"?a.jsx(Bi,{className:"spin","aria-hidden":"true"}):null,s(v==="compare"?"blocks.preparing":"blocks.viewChanges")]}):null,a.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void T(),disabled:!i||v!==null,"aria-busy":v==="download",children:[v==="download"?a.jsx(Bi,{className:"spin","aria-hidden":"true"}):null,s(v==="download"?"blocks.preparing":"blocks.downloadSource")]})]}),a.jsxs("button",{type:"button",className:"delivery-card-primary",onClick:()=>void A(),disabled:!e.deployable||!r||!t||v!==null,title:e.deployable?s("blocks.manualDeploy"):s("blocks.sourceNotReady"),children:[v==="deploy"?a.jsx(Bi,{className:"spin","aria-hidden":"true"}):null,s("blocks.deployAgent")]})]}),w?a.jsx("p",{className:"delivery-card-error",role:"alert",children:w}):null,O?a.jsx("p",{className:"delivery-card-status",role:"status","aria-live":"polite",children:O.message}):null]}),a.jsx(r1,{project:{name:e.agentName,files:(c==null?void 0:c.files)??[]},open:d,onClose:()=>f(!1),onChange:()=>{},readOnly:!0}),a.jsx(r1,{project:{name:(g==null?void 0:g.target.agentName)??e.agentName,files:(g==null?void 0:g.target.files)??[]},comparison:g?{baseProject:{name:g.base.agentName,files:g.base.files??[]},baseLabel:s("blocks.beforeOptimization"),targetLabel:s("blocks.afterOptimization")}:void 0,open:h,onClose:()=>m(!1),onChange:()=>{},readOnly:!0})]})}function XLe({a2aStatus:e}){const{t}=Te("conversation");return e==="connecting"||e==="submitted"||e==="working"?a.jsx(GLe,{text:t(`blocks.a2a.${e}`)}):a.jsx(KLe,{text:"",done:!1})}const xNt=p.memo(function({text:t,streaming:n,onStreamFrame:i,onStreamComplete:r}){const s=WLe(t,n,i,r);return s?a.jsx("div",{className:"bubble",children:a.jsx(_d,{text:s,streaming:n})}):null});function wNt({title:e,summary:t,items:n,done:i}){const{t:r}=Te("conversation"),[s,o]=p.useState(!i),l=p.useRef(!1);p.useEffect(()=>{l.current||o(!i)},[i]);const c=()=>{l.current=!0,o(u=>!u)};return a.jsxs("div",{className:"block-plan",children:[a.jsxs("button",{className:"plan-head",type:"button",onClick:c,"aria-expanded":n.length>0?s:void 0,disabled:n.length===0,children:[a.jsx("span",{className:"plan-icon","aria-hidden":"true",children:a.jsx(gNt,{})}),i?a.jsx("span",{className:"plan-title",children:e}):a.jsx(hn,{className:"plan-title",duration:2.2,spread:15,children:e}),t?a.jsx("span",{className:"plan-summary",children:t}):null,n.length>0?a.jsx(rO,{className:`plan-chevron${s?" is-open":""}`}):null]}),a.jsx("div",{className:`think-collapse ${s&&n.length>0?"open":""}`,children:a.jsx("div",{className:"think-collapse-inner",children:n.length>0?a.jsx("ol",{className:"plan-items",children:n.map((u,d)=>a.jsxs("li",{"data-status":u.status,children:[a.jsx("span",{className:"plan-item-marker","aria-hidden":"true"}),a.jsx("span",{className:"plan-item-text",children:u.text}),a.jsx("small",{children:r(`blocks.planStatuses.${u.status}`)})]},`${d}:${u.text}`))}):null})})]})}function ONt(e){if(!e||typeof e!="object")return[];const t=e,n=t.result;let i=[];if(Array.isArray(t.studio_artifacts))i=t.studio_artifacts;else if(n&&typeof n=="object"){const r=n.studio_artifacts;Array.isArray(r)&&(i=r)}return i.flatMap(r=>{if(!r||typeof r!="object")return[];const s=r;return typeof s.name=="string"&&typeof s.contentUrl=="string"?[{name:s.name,contentUrl:s.contentUrl}]:[]})}function kNt({name:e,callId:t,args:n,response:i,done:r,status:s,defaultOpen:o=!1,retrying:l=!1,codexActivity:c,native:u=!1,progressText:d,source:f,onBranchSelect:h,onAction:m}){const{t:g}=Te("conversation"),v=e==="create_agents"&&r&&F_t(n,i)?"failed":s??(r?"completed":"running"),y=e==="create_agents"&&v==="failed"&&l,w=mq(e),x=w==null?void 0:w.detailRenderer,O=(w==null?void 0:w.hideHeader)===!0,k=O||o||!!x||!!c,[S,C]=p.useState(k),E=p.useRef(!1);p.useEffect(()=>{!E.current&&k&&C(!0)},[k]);const j=()=>{E.current=!0,C(P=>!P)},T=e===qLe?g("blocks.renderUi"):e,R=ONt(i);if((!w||!x)&&!c){const P=w?v==="failed"?g(`blocks.tools.${w.name}.failed`,{defaultValue:w.failedLabel??w.doneLabel}):v==="running"?g(`blocks.tools.${w.name}.running`,{defaultValue:w.runningLabel}):g(`blocks.tools.${w.name}.done`,{defaultValue:w.doneLabel}):void 0;return a.jsx(HLe,{input:{name:e,title:d9(e,n,g)??P,callId:t,args:n,response:i,done:r,status:v,defaultOpen:o,source:f},children:R.length>0?a.jsx("div",{className:"studio-tool-artifacts",children:R.map(I=>a.jsx("a",{href:I.contentUrl,download:I.name,children:g("blocks.downloadNamed",{name:I.name})},`${I.contentUrl}:${I.name}`))}):null})}const A=i==null?null:typeof i=="string"?i:JSON.stringify(i,null,2),N=!u&&A&&A.length>2e3?`${A.slice(0,2e3)} -${g("blocks.truncated")}`:A;return a.jsxs(Ar.div,{className:`block-tool${w?" block-tool--builtin":""}`,"data-status":v,initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[w&&!O?a.jsx(I_t,{definition:w,label:y?g("blocks.agentAdjusting"):v==="failed"?g(`blocks.tools.${w.name}.failed`,{defaultValue:w.failedLabel??w.doneLabel}):d9(e,n,g),done:r,open:S,onToggle:j}):w?null:a.jsxs("button",{className:"tool-head tool-head--generic",onClick:j,type:"button","aria-expanded":S,children:[a.jsx("span",{className:"tool-icon tool-icon--generic","aria-hidden":"true",children:u?a.jsx(RM,{kind:"tool"}):a.jsx(mNt,{})}),r?a.jsx("span",{className:"tool-name",children:T}):a.jsx(hn,{className:"tool-name",duration:2.2,spread:15,children:T}),u&&v==="failed"&&a.jsx("span",{className:"development-tool-failure",children:a.jsx(_w,{ns:"adk",i18nKey:"developmentRuns.toolFailed"})}),a.jsx(rO,{className:`tool-chevron${S?" is-open":""}`})]}),a.jsx("div",{className:`${O?"":"think-collapse "}${S?"open":""}`,children:a.jsxs("div",{className:"think-collapse-inner",children:[c?a.jsxs("section",{className:"codex-sandbox-run","aria-label":g("blocks.sandboxDetails"),children:[a.jsxs("div",{className:"codex-sandbox-run__label",children:[a.jsxs("span",{className:"codex-sandbox-run__badge",children:[a.jsx(bNt,{}),a.jsx("span",{children:"Codex Sandbox"})]}),a.jsx("span",{className:"codex-sandbox-run__title",children:c.title})]}),a.jsx(yNt,{activity:c}),a.jsx("div",{className:"codex-sandbox-run__stream",children:c.items.length>0?a.jsx(m0,{blocks:c.items.map(P=>P.block),streaming:!r,onAction:m}):a.jsx(hn,{className:"codex-sandbox-run__empty",children:g("blocks.waitingCodex")})})]}):null,x?a.jsx(x,{args:n,response:i,status:v,onBranchSelect:h}):c?null:a.jsxs("div",{className:"tool-detail",children:[d&&a.jsx("div",{className:"development-tool-meta",children:d}),n!=null&&a.jsxs("div",{className:"tool-section",children:[a.jsx("div",{className:"tool-section-label",children:g("blocks.arguments")}),a.jsx("pre",{className:"tool-args",children:JSON.stringify(n,null,2)})]}),N!=null&&a.jsxs("div",{className:"tool-section",children:[a.jsx("div",{className:"tool-section-label",children:g("blocks.result")}),a.jsx("pre",{className:"tool-args tool-result",children:N})]}),R.length>0&&a.jsxs("div",{className:"tool-section",children:[a.jsx("div",{className:"tool-section-label",children:g("blocks.artifacts")}),a.jsx("div",{className:"studio-tool-artifacts",children:R.map(P=>a.jsx("a",{href:P.contentUrl,download:P.name,children:g("blocks.downloadNamed",{name:P.name})},`${P.contentUrl}:${P.name}`))})]})]})]})})]})}function SNt({block:e,onDownload:t,onPreview:n}){const{t:i}=Te("conversation"),[r,s]=p.useState(""),[o,l]=p.useState(""),[c,u]=p.useState(null);p.useEffect(()=>()=>{c&&URL.revokeObjectURL(c.url)},[c]);const d=()=>u(null),f=async(g,b)=>{if(t){s(`download:${g}`),l("");try{await t(g,b)}catch(v){l(v instanceof Error?v.message:String(v))}finally{s("")}}},h=async(g,b,v)=>{if(n){s(`preview:${v}`),l("");try{const y=await n(g,b);u({name:v,url:y})}catch(y){l(y instanceof Error?y.message:String(y))}finally{s("")}}},m=e.files.filter(g=>!g.filename.endsWith(".preview.webp"));return a.jsxs("div",{className:"artifact-list",children:[m.map(g=>{const b=`${g.filename.replace(/\.pptx$/i,"")}.preview.webp`,v=e.files.find(y=>y.filename===b);return a.jsxs("div",{className:"artifact-card",children:[a.jsx("span",{className:"artifact-card__icon","aria-hidden":"true",children:a.jsx(mV,{})}),a.jsxs("span",{className:"artifact-card__copy",children:[a.jsx("span",{className:"artifact-card__name",children:g.filename}),a.jsx("span",{className:"artifact-card__hint",children:i("blocks.powerpoint")})]}),a.jsxs("span",{className:"artifact-card__actions",children:[v&&a.jsxs("button",{className:"artifact-card__action",type:"button",disabled:!n||r!=="",onClick:()=>void h(v.filename,v.version,g.filename),children:[r===`preview:${g.filename}`?a.jsx(Bi,{className:"spin"}):a.jsx(Nat,{}),i("blocks.preview")]}),a.jsxs("button",{className:"artifact-card__action artifact-card__action--primary",type:"button",disabled:!t||r!=="",onClick:()=>void f(g.filename,g.version),children:[r===`download:${g.filename}`?a.jsx(Bi,{className:"spin"}):a.jsx(eM,{}),i("blocks.download")]})]})]},`${g.filename}:${g.version}`)}),o&&a.jsx("div",{className:"artifact-card__error",children:o}),c&&a.jsxs("div",{className:"artifact-preview",role:"dialog","aria-modal":"true","aria-label":i("blocks.previewDialog",{name:c.name}),children:[a.jsx("button",{className:"artifact-preview__backdrop",type:"button","aria-label":i("blocks.closePreview"),onClick:d}),a.jsxs("div",{className:"artifact-preview__panel",children:[a.jsxs("div",{className:"artifact-preview__header",children:[a.jsx("span",{children:c.name}),a.jsx("button",{type:"button","aria-label":i("blocks.closePreview"),onClick:d,children:a.jsx(Mo,{})})]}),a.jsx("div",{className:"artifact-preview__canvas",children:a.jsx("img",{src:c.url,alt:i("blocks.slidePreview",{name:c.name})})})]})]})]})}function ENt({block:e,onAuth:t}){const{t:n}=Te("conversation"),[i,r]=p.useState(e.done?"done":"idle"),[s,o]=p.useState(""),l=e.label||n("blocks.mcpToolset"),c=(()=>{try{return e.authUri?new URL(e.authUri).host:""}catch{return""}})(),u=async()=>{if(t){o(""),r("authorizing");try{await t(e),r("done")}catch(f){o(f instanceof Error?f.message:String(f)),r("idle")}}};return e.done||i==="done"?a.jsxs(Ar.div,{className:"auth-card-collapsed",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},children:[a.jsx(GJ,{className:"auth-card-icon auth-card-icon--done"}),a.jsx("span",{children:n("blocks.authorized",{tool:l})})]}):a.jsxs(Ar.div,{className:"auth-card",initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[a.jsxs("div",{className:"auth-card-head",children:[a.jsx(GJ,{className:"auth-card-icon"}),a.jsx("span",{className:"auth-card-title",children:n("blocks.authorizationRequired",{tool:l})})]}),a.jsxs("p",{className:"auth-card-desc",children:[a.jsx(_w,{t:n,i18nKey:"blocks.oauthDescription",values:{tool:l},components:{code:a.jsx("code",{className:"auth-card-code"})}}),c&&a.jsxs(a.Fragment,{children:[" ",a.jsx(_w,{t:n,i18nKey:"blocks.oauthProvider",values:{provider:c},components:{code:a.jsx("code",{className:"auth-card-code"})}})," "]}),n("blocks.oauthContinue")]}),a.jsx("button",{className:"auth-card-btn",onClick:u,disabled:i==="authorizing"||!e.authUri,children:i==="authorizing"?a.jsxs(a.Fragment,{children:[a.jsx(Bi,{className:"cw-i spin"})," ",n("blocks.waitingAuthorization")]}):a.jsx(a.Fragment,{children:n("blocks.authorize")})}),!e.authUri&&a.jsx("div",{className:"auth-card-err",children:n("blocks.missingAuthorizationUrl")}),s&&a.jsx("div",{className:"auth-card-err",children:s})]})}function CNt(e,t,n){const i=mq(e.name),r=d9(e.name,e.args,n);if(r||!i)return r;const s=t==="failed"?"failed":t==="running"?"running":"done",o=t==="failed"?i.failedLabel??i.doneLabel:t==="running"?i.runningLabel:i.doneLabel;return n(`blocks.tools.${i.name}.${s}`,{defaultValue:o})}function Wne(e,t){const n=e.status??(e.done?"completed":"running");return{name:e.name,title:t?CNt(e,n,t):void 0,callId:e.callId,args:e.args,response:e.response,done:e.done,status:e.status,defaultOpen:e.defaultOpen,source:e.source}}function ANt(e,t){var s;const n=[];let i=[];const r=()=>{i.length&&(n.push(i.length>1?{kind:"tool-exploration",items:i.map(o=>Wne(o,t))}:i[0]),i=[])};for(const o of e){if(o.kind!=="tool"||(s=mq(o.name))!=null&&s.detailRenderer){r(),n.push(o);continue}const l=gq(Wne(o)),c=!i.length||i[i.length-1].source===o.source;if(Vne(l)&&c){i.push(o);continue}r(),Vne(l)?i.push(o):n.push(o)}return r(),n}function m0({groupProcess:e=!1,liveStatus:t,blocks:n,appName:i="",streaming:r=!1,onStreamFrame:s,onStreamComplete:o,onAction:l,onAuth:c,onArtifactDownload:u,onArtifactPreview:d,onResolveDelivery:f,onResolveDeliveryComparison:h,onDownloadDelivery:m,onDeployDelivery:g,onBranchSelect:b}){if(e)return a.jsx(w_t,{blocks:n,active:r,status:t,render:x=>a.jsx(m0,{blocks:x,appName:i,streaming:r,onStreamFrame:s,onStreamComplete:o,onAction:l,onAuth:c,onArtifactDownload:u,onArtifactPreview:d,onResolveDelivery:f,onResolveDeliveryComparison:h,onDownloadDelivery:m,onDeployDelivery:g,onBranchSelect:b})});const{t:v}=Te("conversation"),y=ANt(Oot(n),v),w=y.reduce((x,O,k)=>O.kind==="text"?k:x,-1);return a.jsx(a.Fragment,{children:y.map((x,O)=>{switch(x.kind){case"turn-summary":return a.jsx(v_t,{value:x.value},x.id||O);case"diff":return a.jsxs("details",{className:"development-diff",children:[a.jsxs("summary",{children:[a.jsx("span",{className:"tool-icon",children:a.jsx(RM,{kind:"diff"})}),a.jsx("span",{children:a.jsx(_w,{ns:"adk",i18nKey:"developmentRuns.diff"})}),a.jsx(rO,{className:"tool-chevron"})]}),a.jsx("pre",{children:x.text})]},x.id??O);case"progress":return a.jsx(GLe,{text:x.text},"build-progress");case"activity-source":return a.jsx("div",{className:"tool-activity-source",children:x.label},`${O}:${x.label}`);case"tool-exploration":return a.jsx(uNt,{items:x.items},`exploration:${O}`);case"thinking":{const k=y.slice(O+1).some(S=>S.kind==="text"&&!!S.text.trim());return a.jsx(KLe,{text:x.text,done:x.done,thoughtKind:x.thoughtKind,answerStarted:k,streaming:r,onStreamFrame:s},x.id??O)}case"text":{const k=x.text.replace(/^\s+/,"");return k?a.jsx(xNt,{text:k,streaming:r,onStreamFrame:s,onStreamComplete:O===w?o:void 0},x.id??O):null}case"plan":return a.jsx(wNt,{title:x.title,summary:x.summary,items:x.items,done:x.done},x.id??O);case"attachment":return a.jsx(PM,{appName:i,items:x.files},x.id??O);case"artifact":return a.jsx(SNt,{block:x,onDownload:u,onPreview:d},x.id??O);case"delivery":return a.jsx(vNt,{value:x.value,onResolve:f,onResolveComparison:h,onDownload:m,onDeploy:g},x.id??O);case"invocation":return a.jsx(IM,{value:x.value},x.id??O);case"tool":{if(x.name===qLe&&x.done)return null;const k=x.name==="create_agents"&&y.slice(O+1).some(S=>S.kind==="tool"&&S.name==="create_agents");return a.jsx(kNt,{name:x.itemType?V2e(x):x.name,callId:x.callId,native:!!x.itemType,progressText:x.progressText,args:x.args,response:x.response,done:x.done,status:x.status,defaultOpen:x.defaultOpen,retrying:x.name==="create_agents"&&(r||k),codexActivity:x.codexActivity,source:x.source,onBranchSelect:b,onAction:l},x.id??O)}case"agent-transfer":return null;case"auth":return a.jsx(ENt,{block:x,onAuth:c},x.id??O);case"a2ui":return dLe(x.messages).filter(k=>k.components[k.rootId]).map(k=>a.jsx(Ar.div,{initial:{opacity:0,y:8,scale:.985},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:380,damping:30},children:a.jsx(j_t,{surface:k,onAction:l})},`${O}-${k.surfaceId}`));default:return null}})})}const TNt=()=>{};function _Nt(e){if(e.kind==="message")return{kind:"text",text:e.text};if(e.kind==="thinking")return{kind:"thinking",text:e.text,done:e.status==="done"};if(e.kind==="tool")return{kind:"tool",name:e.name,args:e.args,response:e.response,done:e.status==="done"};throw new Error(tn("conversation.unsupportedActivity"))}function jNt({activities:e}){const{t}=Te("skills"),n=p.useMemo(()=>e.filter(i=>i.kind!=="status").map(_Nt),[e]);return n.length===0?null:a.jsx("div",{className:"skill-conversation","aria-label":t("conversation.ariaLabel"),"aria-live":"polite",children:a.jsx(m0,{blocks:n,onAction:TNt})})}function Kne(){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m7 9 5 5 5-5",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}function NN({label:e,value:t,options:n,onChange:i,disabled:r=!1,allowCustom:s=!1,required:o=!1,placeholder:l,error:c}){const{t:u}=Te("skills"),d=l??u("configSelect.placeholder"),f=p.useId(),h=p.useId(),m=p.useId(),g=p.useRef(null),b=p.useRef(null),v=p.useRef(null),y=p.useRef(null),w=p.useRef([]),x=n.findIndex(I=>I.value===t),O=t.trim().toLocaleLowerCase(),k=s&&O?n.filter(I=>I.value.toLocaleLowerCase().includes(O)||I.label.toLocaleLowerCase().includes(O)):n,[S,C]=p.useState(!1),[E,j]=p.useState(Math.max(0,x)),T=x>=0?n[x]:void 0,R=r||!s&&n.length===0,A=(I=!1)=>{C(!1),I&&window.requestAnimationFrame(()=>{var D,_;return s?(D=v.current)==null?void 0:D.focus():(_=b.current)==null?void 0:_.focus()})},N=I=>{R||k.length!==0&&(j(Math.min(Math.max(I,0),k.length-1)),C(!0))};p.useEffect(()=>{if(!S)return;const I=y.current,D=s?void 0:window.requestAnimationFrame(()=>{var M;(M=w.current[E])==null||M.focus()}),_=M=>{if(!I)return;const z=I.scrollTop<=0,q=I.scrollTop+I.clientHeight>=I.scrollHeight-1;(I.scrollHeight<=I.clientHeight||M.deltaY<0&&z||M.deltaY>0&&q)&&M.preventDefault(),M.stopPropagation()},L=M=>{var z;M.target instanceof Node&&!((z=g.current)!=null&&z.contains(M.target))&&A()},F=M=>{M.key==="Escape"&&A(!0)};return I==null||I.addEventListener("wheel",_,{passive:!1}),window.addEventListener("pointerdown",L),window.addEventListener("keydown",F),()=>{D!==void 0&&window.cancelAnimationFrame(D),I==null||I.removeEventListener("wheel",_),window.removeEventListener("pointerdown",L),window.removeEventListener("keydown",F)}},[E,s,S]);const P=I=>{var _;if(k.length===0)return;const D=(I+k.length)%k.length;j(D),(_=w.current[D])==null||_.focus()};return a.jsxs("div",{ref:g,className:`skill-config-select${S?" is-open":""}`,onBlur:I=>{var D;(!I.relatedTarget||!((D=g.current)!=null&&D.contains(I.relatedTarget)))&&A()},children:[a.jsxs("span",{id:h,className:"skill-config-select__label",children:[e,o?a.jsx("span",{className:"skill-required-mark","aria-hidden":"true",children:"*"}):null]}),s?a.jsxs("div",{className:`skill-config-select__trigger is-editable${r?" is-disabled":""}`,"aria-expanded":S,children:[a.jsx("input",{ref:v,value:t,disabled:r,role:"combobox","aria-autocomplete":"list","aria-expanded":S,"aria-controls":S?f:void 0,"aria-labelledby":h,"aria-required":o,"aria-invalid":!!c,"aria-describedby":c?m:void 0,placeholder:d,onChange:I=>{i(I.target.value),j(0),n.length>0&&C(!0)},onClick:()=>{!S&&k.length>0&&N(0)},onKeyDown:I=>{var D,_;if(!(I.nativeEvent.isComposing||I.keyCode===229))if(I.key==="ArrowDown")I.preventDefault(),S?(D=w.current[E])==null||D.focus():N(0);else if(I.key==="ArrowUp")I.preventDefault(),S?(_=w.current[k.length-1])==null||_.focus():N(k.length-1);else if(I.key==="Enter"&&S){I.preventDefault();const L=k[E];L&&i(L.value),A()}else I.key==="Escape"&&(I.preventDefault(),A())}}),a.jsx("button",{type:"button",className:"skill-config-select__toggle",disabled:r||n.length===0,"aria-label":u(S?"configSelect.collapseOptions":"configSelect.expandOptions"),onClick:()=>{S?A():N(0)},children:a.jsx(Kne,{})})]}):a.jsxs("button",{ref:b,type:"button",className:"skill-config-select__trigger",disabled:R,"aria-haspopup":"listbox","aria-expanded":S,"aria-controls":S?f:void 0,"aria-labelledby":h,"aria-required":o,onClick:()=>{S?A():N(x>=0?x:0)},onKeyDown:I=>{I.key==="ArrowDown"?(I.preventDefault(),N(x>=0?x:0)):I.key==="ArrowUp"&&(I.preventDefault(),N(x>=0?x:n.length-1))},children:[a.jsx("span",{className:T?void 0:"is-placeholder",title:T==null?void 0:T.label,children:(T==null?void 0:T.label)||(n.length===0?u("configSelect.noOptions"):d)}),a.jsx(Kne,{})]}),S?a.jsxs("div",{ref:y,id:f,className:"skill-config-select__menu",role:"listbox","aria-labelledby":h,children:[k.length===0?a.jsx("div",{className:"skill-config-select__empty",role:"status",children:u("configSelect.noMatches")}):null,k.map((I,D)=>{const _=I.value===t;return a.jsx("button",{ref:L=>{w.current[D]=L},type:"button",role:"option","aria-selected":_,tabIndex:D===E?0:-1,className:`skill-config-select__option${_?" is-selected":""}`,title:I.label,onFocus:()=>j(D),onClick:()=>{i(I.value),A(!0)},onKeyDown:L=>{L.key==="Enter"||L.key===" "?(L.preventDefault(),i(I.value),A(!0)):L.key==="ArrowDown"?(L.preventDefault(),P(D+1)):L.key==="ArrowUp"?(L.preventDefault(),P(D-1)):L.key==="Home"?(L.preventDefault(),P(0)):L.key==="End"&&(L.preventDefault(),P(n.length-1))},children:I.label},I.value)})]}):null,c?a.jsx("span",{id:m,className:"skill-config-select__error",role:"alert",children:c}):null]})}function Mr(e,t){return e instanceof Error?e:typeof e=="string"&&e.trim()?new Error(e.trim()):new Error(t)}function Ns({error:e}){var s,o,l,c,u;const{t}=Te("skills"),n=e,i=(o=(s=n.originalError)==null?void 0:s.message)==null?void 0:o.trim(),r=[typeof n.status=="number"?`HTTP ${n.status}${n.statusText?` ${n.statusText}`:""}`:"",n.code?t("errorDetails.code",{code:n.code}):"",(l=n.originalError)!=null&&l.type?t("errorDetails.type",{type:n.originalError.type}):"",(c=n.originalError)!=null&&c.repr&&n.originalError.repr!==i?t("errorDetails.representation",{value:n.originalError.repr}):"",(u=n.rawResponse)!=null&&u.trim()?t("errorDetails.rawResponse",{value:n.rawResponse.trim()}):""].filter(Boolean);return a.jsxs("div",{className:"skill-error-details",children:[a.jsx("div",{className:"skill-error-details__summary",children:e.message}),i?a.jsx("div",{className:"skill-error-details__original",children:t("errorDetails.original",{message:i})}):null,r.length>0?a.jsxs("details",{children:[a.jsx("summary",{children:t("errorDetails.details")}),a.jsx("pre",{children:r.join(` -`)})]}):null]})}const yq=Symbol.for("yaml.alias"),f9=Symbol.for("yaml.document"),Fg=Symbol.for("yaml.map"),YLe=Symbol.for("yaml.pair"),Sh=Symbol.for("yaml.scalar"),sO=Symbol.for("yaml.seq"),jd=Symbol.for("yaml.node.type"),aO=e=>!!e&&typeof e=="object"&&e[jd]===yq,gT=e=>!!e&&typeof e=="object"&&e[jd]===f9,bT=e=>!!e&&typeof e=="object"&&e[jd]===Fg,Ra=e=>!!e&&typeof e=="object"&&e[jd]===YLe,Os=e=>!!e&&typeof e=="object"&&e[jd]===Sh,yT=e=>!!e&&typeof e=="object"&&e[jd]===sO;function Ta(e){if(e&&typeof e=="object")switch(e[jd]){case Fg:case sO:return!0}return!1}function Na(e){if(e&&typeof e=="object")switch(e[jd]){case yq:case Fg:case Sh:case sO:return!0}return!1}const ZLe=e=>(Os(e)||Ta(e))&&!!e.anchor,hy=Symbol("break visit"),NNt=Symbol("skip children"),dE=Symbol("remove node");function oO(e,t){const n=RNt(t);gT(e)?Px(null,e.contents,n,Object.freeze([e]))===dE&&(e.contents=null):Px(null,e,n,Object.freeze([]))}oO.BREAK=hy;oO.SKIP=NNt;oO.REMOVE=dE;function Px(e,t,n,i){const r=INt(e,t,n,i);if(Na(r)||Ra(r))return PNt(e,i,r),Px(e,r,n,i);if(typeof r!="symbol"){if(Ta(t)){i=Object.freeze(i.concat(t));for(let s=0;se.replace(/[!,[\]{}]/g,t=>DNt[t]);class Zl{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Zl.defaultYaml,t),this.tags=Object.assign({},Zl.defaultTags,n)}clone(){const t=new Zl(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Zl(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Zl.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Zl.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Zl.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Zl.defaultTags),this.atNextDocument=!1);const i=t.trim().split(/[ \t]+/),r=i.shift();switch(r){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;const[s,o]=i;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[s]=i;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{const o=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,o),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const o=t.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,i,r]=t.match(/^(.*!)([^!]*)$/s);r||n(`The ${t} tag has no suffix`);const s=this.tags[i];if(s)try{return s+decodeURIComponent(r)}catch(o){return n(String(o)),null}return i==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,i]of Object.entries(this.tags))if(t.startsWith(i))return n+MNt(t.substring(i.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags);let r;if(t&&i.length>0&&Na(t.contents)){const s={};oO(t.contents,(o,l)=>{Na(l)&&l.tag&&(s[l.tag]=!0)}),r=Object.keys(s)}else r=[];for(const[s,o]of i)s==="!!"&&o==="tag:yaml.org,2002:"||(!t||r.some(l=>l.startsWith(o)))&&n.push(`%TAG ${s} ${o}`);return n.join(` -`)}}Zl.defaultYaml={explicit:!1,version:"1.2"};Zl.defaultTags={"!!":"tag:yaml.org,2002:"};function JLe(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function e5e(e){const t=new Set;return oO(e,{Value(n,i){i.anchor&&t.add(i.anchor)}}),t}function t5e(e,t){for(let n=1;;++n){const i=`${e}${n}`;if(!t.has(i))return i}}function LNt(e,t){const n=[],i=new Map;let r=null;return{onAnchor:s=>{n.push(s),r??(r=e5e(e));const o=t5e(t,r);return r.add(o),o},setAnchors:()=>{for(const s of n){const o=i.get(s);if(typeof o=="object"&&o.anchor&&(Os(o.node)||Ta(o.node)))o.node.anchor=o.anchor;else{const l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=s,l}}},sourceObjects:i}}function Dx(e,t,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,s=i.length;rSd(i,String(r),n));if(e&&typeof e.toJSON=="function"){if(!n||!ZLe(e))return e.toJSON(t,n);const i={aliasCount:0,count:1,res:void 0};n.anchors.set(e,i),n.onCreate=s=>{i.res=s,delete n.onCreate};const r=e.toJSON(t,n);return n.onCreate&&n.onCreate(r),r}return typeof e=="bigint"&&!(n!=null&&n.keep)?Number(e):e}class vq{constructor(t){Object.defineProperty(this,jd,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:s}={}){if(!gT(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=Sd(this,"",o);if(typeof r=="function")for(const{count:c,res:u}of o.anchors.values())r(u,c);return typeof s=="function"?Dx(s,{"":l},"",l):l}}let xq=class extends vq{constructor(t){super(yq),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if((n==null?void 0:n.maxAliasCount)===0)throw new ReferenceError("Alias resolution is disabled");let i;n!=null&&n.aliasResolveCache?i=n.aliasResolveCache:(i=[],oO(t,{Node:(s,o)=>{(aO(o)||ZLe(o))&&i.push(o)}}),n&&(n.aliasResolveCache=i));let r;for(const s of i){if(s===this)break;s.anchor===this.source&&(r=s)}return r}toJSON(t,n){if(!n)return{source:this.source};const{anchors:i,doc:r,maxAliasCount:s}=n,o=this.resolve(r,n);if(!o){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let l=i.get(o);if(l||(Sd(o,null,n),l=i.get(o)),(l==null?void 0:l.res)===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(s>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=RN(r,o,i)),l.count*l.aliasCount>s)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return l.res}toString(t,n,i){const r=`*${this.source}`;if(t){if(JLe(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(t.implicitKey)return`${r} `}return r}};function RN(e,t,n){if(aO(t)){const i=t.resolve(e),r=n&&i&&n.get(i);return r?r.count*r.aliasCount:0}else if(Ta(t)){let i=0;for(const r of t.items){const s=RN(e,r,n);s>i&&(i=s)}return i}else if(Ra(t)){const i=RN(e,t.key,n),r=RN(e,t.value,n);return Math.max(i,r)}return 1}const n5e=e=>!e||typeof e!="function"&&typeof e!="object";class Oi extends vq{constructor(t){super(Sh),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:Sd(this.value,t,n)}toString(){return String(this.value)}}Oi.BLOCK_FOLDED="BLOCK_FOLDED";Oi.BLOCK_LITERAL="BLOCK_LITERAL";Oi.PLAIN="PLAIN";Oi.QUOTE_DOUBLE="QUOTE_DOUBLE";Oi.QUOTE_SINGLE="QUOTE_SINGLE";const $Nt="tag:yaml.org,2002:";function FNt(e,t,n){if(t){const i=n.filter(s=>s.tag===t),r=i.find(s=>!s.format)??i[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return n.find(i=>{var r;return((r=i.identify)==null?void 0:r.call(i,e))&&!i.format})}function SC(e,t,n){var f,h,m;if(gT(e)&&(e=e.contents),Na(e))return e;if(Ra(e)){const g=(h=(f=n.schema[Fg]).createNode)==null?void 0:h.call(f,n.schema,null,n);return g.items.push(e),g}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:i,onAnchor:r,onTagObj:s,schema:o,sourceObjects:l}=n;let c;if(i&&e&&typeof e=="object"){if(c=l.get(e),c)return c.anchor??(c.anchor=r(e)),new xq(c.anchor);c={anchor:null,node:null},l.set(e,c)}t!=null&&t.startsWith("!!")&&(t=$Nt+t.slice(2));let u=FNt(e,t,o.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const g=new Oi(e);return c&&(c.node=g),g}u=e instanceof Map?o[Fg]:Symbol.iterator in Object(e)?o[sO]:o[Fg]}s&&(s(u),delete n.onTagObj);const d=u!=null&&u.createNode?u.createNode(n.schema,e,n):typeof((m=u==null?void 0:u.nodeClass)==null?void 0:m.from)=="function"?u.nodeClass.from(n.schema,e,n):new Oi(e);return t?d.tag=t:u.default||(d.tag=u.tag),c&&(c.node=d),d}function DI(e,t,n){let i=n;for(let r=t.length-1;r>=0;--r){const s=t[r];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){const o=[];o[s]=i,i=o}else i=new Map([[s,i]])}return SC(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const uS=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class i5e extends vq{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(i=>Na(i)||Ra(i)?i.clone(t):i),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(uS(t))this.add(n);else{const[i,...r]=t,s=this.get(i,!0);if(Ta(s))s.addIn(r,n);else if(s===void 0&&this.schema)this.set(i,DI(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}deleteIn(t){const[n,...i]=t;if(i.length===0)return this.delete(n);const r=this.get(n,!0);if(Ta(r))return r.deleteIn(i);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(t,n){const[i,...r]=t,s=this.get(i,!0);return r.length===0?!n&&Os(s)?s.value:s:Ta(s)?s.getIn(r,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!Ra(n))return!1;const i=n.value;return i==null||t&&Os(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(t){const[n,...i]=t;if(i.length===0)return this.has(n);const r=this.get(n,!0);return Ta(r)?r.hasIn(i):!1}setIn(t,n){const[i,...r]=t;if(r.length===0)this.set(i,n);else{const s=this.get(i,!0);if(Ta(s))s.setIn(r,n);else if(s===void 0&&this.schema)this.set(i,DI(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}}const BNt=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Ap(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const _y=(e,t,n)=>e.endsWith(` -`)?Ap(n,t):n.includes(` +`),h=WLe(f,!t||r,s),{ref:m,onScroll:g}=fLe(h);return a.jsxs("div",{className:"block-thinking",children:[a.jsxs("button",{className:"think-head",onClick:d,type:"button",children:[a.jsx("span",{className:"think-icon","aria-hidden":"true",children:a.jsx(cq,{className:`thinking-logo ${t?"":"is-active"}`})}),t?a.jsx("span",{className:"think-label think-label--done",children:o(n==="reasoning"?"blocks.reasoningDone":"blocks.thinkingDone")}):a.jsx(fn,{className:"think-label",duration:2.4,spread:18,children:o(n==="reasoning"?"blocks.reasoning":"blocks.thinking")}),a.jsx(HA,{className:`chev ${l?"open":""}`})]}),a.jsx("div",{className:`think-collapse ${l&&h?"open":""}`,children:a.jsx("div",{className:"think-collapse-inner",children:a.jsx("div",{className:"think-body scroll",ref:m,onScroll:g,children:h})})})]})}function GLe({text:e}){return a.jsx("div",{className:"block-progress",role:"status","aria-live":"polite","aria-atomic":"true",children:a.jsxs("div",{className:"think-head progress-head",children:[a.jsx("span",{className:"think-icon","aria-hidden":"true",children:a.jsx(cq,{className:"thinking-logo is-active"})}),a.jsx(fn,{className:"think-label",duration:2.4,spread:18,children:e})]})})}function vNt({value:e,onResolve:t,onResolveComparison:n,onDownload:i,onDeploy:r}){const{t:s,i18n:o}=Te("conversation"),l=N=>N.split(new RegExp("(?<=[/_-])")).map((P,I)=>a.jsxs(p.Fragment,{children:[P,a.jsx("wbr",{})]},`${I}:${P}`)),[c,u]=p.useState(e.files?e:null),[d,f]=p.useState(!1),[h,m]=p.useState(!1),[g,b]=p.useState(null),[v,y]=p.useState(null),[w,x]=p.useState(""),[O,k]=p.useState(null),S=new Date(e.validatedAt),C=e.validatedAt?Number.isNaN(S.getTime())?e.validatedAt:S.toLocaleString(o.resolvedLanguage??o.language,{hour12:!1}):s("blocks.justNow");p.useEffect(()=>{if(!O)return;const N=window.setTimeout(()=>k(null),fNt);return()=>window.clearTimeout(N)},[O]);async function E(){if(c)return c;if(!t)throw new Error(s("blocks.sourceUnavailable"));const N=await t(e);return u(N),N}async function j(){y("source"),x(""),k(null);try{await E(),f(!0)}catch(N){x(N instanceof Error?N.message:String(N))}finally{y(null)}}async function T(){if(i){y("download"),x(""),k(null);try{await i(e),k({message:s("blocks.downloadStarted")})}catch(N){x(N instanceof Error?N.message:String(N))}finally{y(null)}}}async function R(){if(n){y("compare"),x(""),k(null);try{const N=g??await n(e);b(N),m(!0)}catch(N){x(N instanceof Error?N.message:String(N))}finally{y(null)}}}async function A(){y("deploy"),x(""),k(null);try{r==null||r(await E())}catch(N){x(N instanceof Error?N.message:String(N))}finally{y(null)}}return a.jsxs(a.Fragment,{children:[a.jsxs("section",{className:`delivery-card${e.verified?" is-verified":" is-unverified"}`,"aria-label":e.verified?s("blocks.verifiedDelivery"):s("blocks.generatedSource"),children:[a.jsxs("header",{className:"delivery-card-header",children:[a.jsx("span",{className:"delivery-card-icon",children:e.verified?a.jsx(Ajt,{}):a.jsx(Cjt,{})}),a.jsxs("div",{className:"delivery-card-heading",children:[a.jsx("strong",{children:l(e.agentName)}),a.jsx("span",{children:e.verified?s("blocks.verifiedDelivery"):s("blocks.generatedSource")})]})]}),a.jsxs("dl",{className:"delivery-card-grid",children:[a.jsxs("div",{className:"delivery-card-entry",children:[a.jsx("dt",{children:s("blocks.entryPoint")}),a.jsx("dd",{children:a.jsx("code",{children:l(e.entryPoint)})})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("blocks.fileCount")}),a.jsx("dd",{children:e.fileCount})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("blocks.size")}),a.jsxs("dd",{children:[(e.artifactSize/1024).toFixed(1)," KiB"]})]}),a.jsxs("div",{className:"delivery-card-time",children:[a.jsx("dt",{children:e.verified?s("blocks.validationTime"):s("blocks.generationTime")}),a.jsx("dd",{children:C})]})]}),a.jsxs("p",{className:"delivery-card-gates",children:[e.verified?s("blocks.checksPassed",{count:e.gateSummary.length}):s("blocks.sourceReady")," ","· ",a.jsx("code",{children:e.artifactSha256.slice(0,12)})]}),e.verified?null:a.jsx("p",{className:"delivery-card-guidance",children:s("blocks.sourceGuidance")}),a.jsxs("div",{className:"delivery-card-actions",children:[a.jsxs("div",{className:"delivery-card-secondary-actions",children:[a.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void j(),disabled:!t||v!==null,children:[v==="source"?a.jsx(Fi,{className:"spin","aria-hidden":"true"}):null,s("blocks.viewSource")]}),e.projectId&&e.versionId&&e.parentVersionId?a.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void R(),disabled:!n||v!==null,children:[v==="compare"?a.jsx(Fi,{className:"spin","aria-hidden":"true"}):null,s(v==="compare"?"blocks.preparing":"blocks.viewChanges")]}):null,a.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void T(),disabled:!i||v!==null,"aria-busy":v==="download",children:[v==="download"?a.jsx(Fi,{className:"spin","aria-hidden":"true"}):null,s(v==="download"?"blocks.preparing":"blocks.downloadSource")]})]}),a.jsxs("button",{type:"button",className:"delivery-card-primary",onClick:()=>void A(),disabled:!e.deployable||!r||!t||v!==null,title:e.deployable?s("blocks.manualDeploy"):s("blocks.sourceNotReady"),children:[v==="deploy"?a.jsx(Fi,{className:"spin","aria-hidden":"true"}):null,s("blocks.deployAgent")]})]}),w?a.jsx("p",{className:"delivery-card-error",role:"alert",children:w}):null,O?a.jsx("p",{className:"delivery-card-status",role:"status","aria-live":"polite",children:O.message}):null]}),a.jsx(a1,{project:{name:e.agentName,files:(c==null?void 0:c.files)??[]},open:d,onClose:()=>f(!1),onChange:()=>{},readOnly:!0}),a.jsx(a1,{project:{name:(g==null?void 0:g.target.agentName)??e.agentName,files:(g==null?void 0:g.target.files)??[]},comparison:g?{baseProject:{name:g.base.agentName,files:g.base.files??[]},baseLabel:s("blocks.beforeOptimization"),targetLabel:s("blocks.afterOptimization")}:void 0,open:h,onClose:()=>m(!1),onChange:()=>{},readOnly:!0})]})}function XLe({a2aStatus:e}){const{t}=Te("conversation");return e==="connecting"||e==="submitted"||e==="working"?a.jsx(GLe,{text:t(`blocks.a2a.${e}`)}):a.jsx(KLe,{text:"",done:!1})}const xNt=p.memo(function({text:t,streaming:n,onStreamFrame:i,onStreamComplete:r}){const s=WLe(t,n,i,r);return s?a.jsx("div",{className:"bubble",children:a.jsx(Td,{text:s,streaming:n})}):null});function wNt({title:e,summary:t,items:n,done:i}){const{t:r}=Te("conversation"),[s,o]=p.useState(!i),l=p.useRef(!1);p.useEffect(()=>{l.current||o(!i)},[i]);const c=()=>{l.current=!0,o(u=>!u)};return a.jsxs("div",{className:"block-plan",children:[a.jsxs("button",{className:"plan-head",type:"button",onClick:c,"aria-expanded":n.length>0?s:void 0,disabled:n.length===0,children:[a.jsx("span",{className:"plan-icon","aria-hidden":"true",children:a.jsx(gNt,{})}),i?a.jsx("span",{className:"plan-title",children:e}):a.jsx(fn,{className:"plan-title",duration:2.2,spread:15,children:e}),t?a.jsx("span",{className:"plan-summary",children:t}):null,n.length>0?a.jsx(aO,{className:`plan-chevron${s?" is-open":""}`}):null]}),a.jsx("div",{className:`think-collapse ${s&&n.length>0?"open":""}`,children:a.jsx("div",{className:"think-collapse-inner",children:n.length>0?a.jsx("ol",{className:"plan-items",children:n.map((u,d)=>a.jsxs("li",{"data-status":u.status,children:[a.jsx("span",{className:"plan-item-marker","aria-hidden":"true"}),a.jsx("span",{className:"plan-item-text",children:u.text}),a.jsx("small",{children:r(`blocks.planStatuses.${u.status}`)})]},`${d}:${u.text}`))}):null})})]})}function ONt(e){if(!e||typeof e!="object")return[];const t=e,n=t.result;let i=[];if(Array.isArray(t.studio_artifacts))i=t.studio_artifacts;else if(n&&typeof n=="object"){const r=n.studio_artifacts;Array.isArray(r)&&(i=r)}return i.flatMap(r=>{if(!r||typeof r!="object")return[];const s=r;return typeof s.name=="string"&&typeof s.contentUrl=="string"?[{name:s.name,contentUrl:s.contentUrl}]:[]})}function kNt({name:e,callId:t,args:n,response:i,done:r,status:s,defaultOpen:o=!1,retrying:l=!1,codexActivity:c,native:u=!1,progressText:d,source:f,onBranchSelect:h,onAction:m}){const{t:g}=Te("conversation"),v=e==="create_agents"&&r&&F_t(n,i)?"failed":s??(r?"completed":"running"),y=e==="create_agents"&&v==="failed"&&l,w=mq(e),x=w==null?void 0:w.detailRenderer,O=(w==null?void 0:w.hideHeader)===!0,k=O||o||!!x||!!c,[S,C]=p.useState(k),E=p.useRef(!1);p.useEffect(()=>{!E.current&&k&&C(!0)},[k]);const j=()=>{E.current=!0,C(P=>!P)},T=e===qLe?g("blocks.renderUi"):e,R=ONt(i);if((!w||!x)&&!c){const P=w?v==="failed"?g(`blocks.tools.${w.name}.failed`,{defaultValue:w.failedLabel??w.doneLabel}):v==="running"?g(`blocks.tools.${w.name}.running`,{defaultValue:w.runningLabel}):g(`blocks.tools.${w.name}.done`,{defaultValue:w.doneLabel}):void 0;return a.jsx(HLe,{input:{name:e,title:d9(e,n,g)??P,callId:t,args:n,response:i,done:r,status:v,defaultOpen:o,source:f},children:R.length>0?a.jsx("div",{className:"studio-tool-artifacts",children:R.map(I=>a.jsx("a",{href:I.contentUrl,download:I.name,children:g("blocks.downloadNamed",{name:I.name})},`${I.contentUrl}:${I.name}`))}):null})}const A=i==null?null:typeof i=="string"?i:JSON.stringify(i,null,2),N=!u&&A&&A.length>2e3?`${A.slice(0,2e3)} +${g("blocks.truncated")}`:A;return a.jsxs(Cr.div,{className:`block-tool${w?" block-tool--builtin":""}`,"data-status":v,initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[w&&!O?a.jsx(I_t,{definition:w,label:y?g("blocks.agentAdjusting"):v==="failed"?g(`blocks.tools.${w.name}.failed`,{defaultValue:w.failedLabel??w.doneLabel}):d9(e,n,g),done:r,open:S,onToggle:j}):w?null:a.jsxs("button",{className:"tool-head tool-head--generic",onClick:j,type:"button","aria-expanded":S,children:[a.jsx("span",{className:"tool-icon tool-icon--generic","aria-hidden":"true",children:u?a.jsx(IM,{kind:"tool"}):a.jsx(mNt,{})}),r?a.jsx("span",{className:"tool-name",children:T}):a.jsx(fn,{className:"tool-name",duration:2.2,spread:15,children:T}),u&&v==="failed"&&a.jsx("span",{className:"development-tool-failure",children:a.jsx(Nw,{ns:"adk",i18nKey:"developmentRuns.toolFailed"})}),a.jsx(aO,{className:`tool-chevron${S?" is-open":""}`})]}),a.jsx("div",{className:`${O?"":"think-collapse "}${S?"open":""}`,children:a.jsxs("div",{className:"think-collapse-inner",children:[c?a.jsxs("section",{className:"codex-sandbox-run","aria-label":g("blocks.sandboxDetails"),children:[a.jsxs("div",{className:"codex-sandbox-run__label",children:[a.jsxs("span",{className:"codex-sandbox-run__badge",children:[a.jsx(bNt,{}),a.jsx("span",{children:"Codex Sandbox"})]}),a.jsx("span",{className:"codex-sandbox-run__title",children:c.title})]}),a.jsx(yNt,{activity:c}),a.jsx("div",{className:"codex-sandbox-run__stream",children:c.items.length>0?a.jsx(y0,{blocks:c.items.map(P=>P.block),streaming:!r,onAction:m}):a.jsx(fn,{className:"codex-sandbox-run__empty",children:g("blocks.waitingCodex")})})]}):null,x?a.jsx(x,{args:n,response:i,status:v,onBranchSelect:h}):c?null:a.jsxs("div",{className:"tool-detail",children:[d&&a.jsx("div",{className:"development-tool-meta",children:d}),n!=null&&a.jsxs("div",{className:"tool-section",children:[a.jsx("div",{className:"tool-section-label",children:g("blocks.arguments")}),a.jsx("pre",{className:"tool-args",children:JSON.stringify(n,null,2)})]}),N!=null&&a.jsxs("div",{className:"tool-section",children:[a.jsx("div",{className:"tool-section-label",children:g("blocks.result")}),a.jsx("pre",{className:"tool-args tool-result",children:N})]}),R.length>0&&a.jsxs("div",{className:"tool-section",children:[a.jsx("div",{className:"tool-section-label",children:g("blocks.artifacts")}),a.jsx("div",{className:"studio-tool-artifacts",children:R.map(P=>a.jsx("a",{href:P.contentUrl,download:P.name,children:g("blocks.downloadNamed",{name:P.name})},`${P.contentUrl}:${P.name}`))})]})]})]})})]})}function SNt({block:e,onDownload:t,onPreview:n}){const{t:i}=Te("conversation"),[r,s]=p.useState(""),[o,l]=p.useState(""),[c,u]=p.useState(null);p.useEffect(()=>()=>{c&&URL.revokeObjectURL(c.url)},[c]);const d=()=>u(null),f=async(g,b)=>{if(t){s(`download:${g}`),l("");try{await t(g,b)}catch(v){l(v instanceof Error?v.message:String(v))}finally{s("")}}},h=async(g,b,v)=>{if(n){s(`preview:${v}`),l("");try{const y=await n(g,b);u({name:v,url:y})}catch(y){l(y instanceof Error?y.message:String(y))}finally{s("")}}},m=e.files.filter(g=>!g.filename.endsWith(".preview.webp"));return a.jsxs("div",{className:"artifact-list",children:[m.map(g=>{const b=`${g.filename.replace(/\.pptx$/i,"")}.preview.webp`,v=e.files.find(y=>y.filename===b);return a.jsxs("div",{className:"artifact-card",children:[a.jsx("span",{className:"artifact-card__icon","aria-hidden":"true",children:a.jsx(mV,{})}),a.jsxs("span",{className:"artifact-card__copy",children:[a.jsx("span",{className:"artifact-card__name",children:g.filename}),a.jsx("span",{className:"artifact-card__hint",children:i("blocks.powerpoint")})]}),a.jsxs("span",{className:"artifact-card__actions",children:[v&&a.jsxs("button",{className:"artifact-card__action",type:"button",disabled:!n||r!=="",onClick:()=>void h(v.filename,v.version,g.filename),children:[r===`preview:${g.filename}`?a.jsx(Fi,{className:"spin"}):a.jsx(Nat,{}),i("blocks.preview")]}),a.jsxs("button",{className:"artifact-card__action artifact-card__action--primary",type:"button",disabled:!t||r!=="",onClick:()=>void f(g.filename,g.version),children:[r===`download:${g.filename}`?a.jsx(Fi,{className:"spin"}):a.jsx(tM,{}),i("blocks.download")]})]})]},`${g.filename}:${g.version}`)}),o&&a.jsx("div",{className:"artifact-card__error",children:o}),c&&a.jsxs("div",{className:"artifact-preview",role:"dialog","aria-modal":"true","aria-label":i("blocks.previewDialog",{name:c.name}),children:[a.jsx("button",{className:"artifact-preview__backdrop",type:"button","aria-label":i("blocks.closePreview"),onClick:d}),a.jsxs("div",{className:"artifact-preview__panel",children:[a.jsxs("div",{className:"artifact-preview__header",children:[a.jsx("span",{children:c.name}),a.jsx("button",{type:"button","aria-label":i("blocks.closePreview"),onClick:d,children:a.jsx(Do,{})})]}),a.jsx("div",{className:"artifact-preview__canvas",children:a.jsx("img",{src:c.url,alt:i("blocks.slidePreview",{name:c.name})})})]})]})]})}function ENt({block:e,onAuth:t}){const{t:n}=Te("conversation"),[i,r]=p.useState(e.done?"done":"idle"),[s,o]=p.useState(""),l=e.label||n("blocks.mcpToolset"),c=(()=>{try{return e.authUri?new URL(e.authUri).host:""}catch{return""}})(),u=async()=>{if(t){o(""),r("authorizing");try{await t(e),r("done")}catch(f){o(f instanceof Error?f.message:String(f)),r("idle")}}};return e.done||i==="done"?a.jsxs(Cr.div,{className:"auth-card-collapsed",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},children:[a.jsx(GJ,{className:"auth-card-icon auth-card-icon--done"}),a.jsx("span",{children:n("blocks.authorized",{tool:l})})]}):a.jsxs(Cr.div,{className:"auth-card",initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[a.jsxs("div",{className:"auth-card-head",children:[a.jsx(GJ,{className:"auth-card-icon"}),a.jsx("span",{className:"auth-card-title",children:n("blocks.authorizationRequired",{tool:l})})]}),a.jsxs("p",{className:"auth-card-desc",children:[a.jsx(Nw,{t:n,i18nKey:"blocks.oauthDescription",values:{tool:l},components:{code:a.jsx("code",{className:"auth-card-code"})}}),c&&a.jsxs(a.Fragment,{children:[" ",a.jsx(Nw,{t:n,i18nKey:"blocks.oauthProvider",values:{provider:c},components:{code:a.jsx("code",{className:"auth-card-code"})}})," "]}),n("blocks.oauthContinue")]}),a.jsx("button",{className:"auth-card-btn",onClick:u,disabled:i==="authorizing"||!e.authUri,children:i==="authorizing"?a.jsxs(a.Fragment,{children:[a.jsx(Fi,{className:"cw-i spin"})," ",n("blocks.waitingAuthorization")]}):a.jsx(a.Fragment,{children:n("blocks.authorize")})}),!e.authUri&&a.jsx("div",{className:"auth-card-err",children:n("blocks.missingAuthorizationUrl")}),s&&a.jsx("div",{className:"auth-card-err",children:s})]})}function CNt(e,t,n){const i=mq(e.name),r=d9(e.name,e.args,n);if(r||!i)return r;const s=t==="failed"?"failed":t==="running"?"running":"done",o=t==="failed"?i.failedLabel??i.doneLabel:t==="running"?i.runningLabel:i.doneLabel;return n(`blocks.tools.${i.name}.${s}`,{defaultValue:o})}function Wne(e,t){const n=e.status??(e.done?"completed":"running");return{name:e.name,title:t?CNt(e,n,t):void 0,callId:e.callId,args:e.args,response:e.response,done:e.done,status:e.status,defaultOpen:e.defaultOpen,source:e.source}}function ANt(e,t){var s;const n=[];let i=[];const r=()=>{i.length&&(n.push(i.length>1?{kind:"tool-exploration",items:i.map(o=>Wne(o,t))}:i[0]),i=[])};for(const o of e){if(o.kind!=="tool"||(s=mq(o.name))!=null&&s.detailRenderer){r(),n.push(o);continue}const l=gq(Wne(o)),c=!i.length||i[i.length-1].source===o.source;if(Vne(l)&&c){i.push(o);continue}r(),Vne(l)?i.push(o):n.push(o)}return r(),n}function y0({groupProcess:e=!1,liveStatus:t,blocks:n,appName:i="",streaming:r=!1,onStreamFrame:s,onStreamComplete:o,onAction:l,onAuth:c,onArtifactDownload:u,onArtifactPreview:d,onResolveDelivery:f,onResolveDeliveryComparison:h,onDownloadDelivery:m,onDeployDelivery:g,onBranchSelect:b}){if(e)return a.jsx(w_t,{blocks:n,active:r,status:t,render:x=>a.jsx(y0,{blocks:x,appName:i,streaming:r,onStreamFrame:s,onStreamComplete:o,onAction:l,onAuth:c,onArtifactDownload:u,onArtifactPreview:d,onResolveDelivery:f,onResolveDeliveryComparison:h,onDownloadDelivery:m,onDeployDelivery:g,onBranchSelect:b})});const{t:v}=Te("conversation"),y=ANt(Oot(n),v),w=y.reduce((x,O,k)=>O.kind==="text"?k:x,-1);return a.jsx(a.Fragment,{children:y.map((x,O)=>{switch(x.kind){case"turn-summary":return a.jsx(v_t,{value:x.value},x.id||O);case"diff":return a.jsxs("details",{className:"development-diff",children:[a.jsxs("summary",{children:[a.jsx("span",{className:"tool-icon",children:a.jsx(IM,{kind:"diff"})}),a.jsx("span",{children:a.jsx(Nw,{ns:"adk",i18nKey:"developmentRuns.diff"})}),a.jsx(aO,{className:"tool-chevron"})]}),a.jsx("pre",{children:x.text})]},x.id??O);case"progress":return a.jsx(GLe,{text:x.text},"build-progress");case"activity-source":return a.jsx("div",{className:"tool-activity-source",children:x.label},`${O}:${x.label}`);case"tool-exploration":return a.jsx(uNt,{items:x.items},`exploration:${O}`);case"thinking":{const k=y.slice(O+1).some(S=>S.kind==="text"&&!!S.text.trim());return a.jsx(KLe,{text:x.text,done:x.done,thoughtKind:x.thoughtKind,answerStarted:k,streaming:r,onStreamFrame:s},x.id??O)}case"text":{const k=x.text.replace(/^\s+/,"");return k?a.jsx(xNt,{text:k,streaming:r,onStreamFrame:s,onStreamComplete:O===w?o:void 0},x.id??O):null}case"plan":return a.jsx(wNt,{title:x.title,summary:x.summary,items:x.items,done:x.done},x.id??O);case"attachment":return a.jsx(DM,{appName:i,items:x.files},x.id??O);case"artifact":return a.jsx(SNt,{block:x,onDownload:u,onPreview:d},x.id??O);case"delivery":return a.jsx(vNt,{value:x.value,onResolve:f,onResolveComparison:h,onDownload:m,onDeploy:g},x.id??O);case"invocation":return a.jsx(PM,{value:x.value},x.id??O);case"tool":{if(x.name===qLe&&x.done)return null;const k=x.name==="create_agents"&&y.slice(O+1).some(S=>S.kind==="tool"&&S.name==="create_agents");return a.jsx(kNt,{name:x.itemType?V2e(x):x.name,callId:x.callId,native:!!x.itemType,progressText:x.progressText,args:x.args,response:x.response,done:x.done,status:x.status,defaultOpen:x.defaultOpen,retrying:x.name==="create_agents"&&(r||k),codexActivity:x.codexActivity,source:x.source,onBranchSelect:b,onAction:l},x.id??O)}case"agent-transfer":return null;case"auth":return a.jsx(ENt,{block:x,onAuth:c},x.id??O);case"a2ui":return dLe(x.messages).filter(k=>k.components[k.rootId]).map(k=>a.jsx(Cr.div,{initial:{opacity:0,y:8,scale:.985},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:380,damping:30},children:a.jsx(j_t,{surface:k,onAction:l})},`${O}-${k.surfaceId}`));default:return null}})})}const TNt=()=>{};function _Nt(e){if(e.kind==="message")return{kind:"text",text:e.text};if(e.kind==="thinking")return{kind:"thinking",text:e.text,done:e.status==="done"};if(e.kind==="tool")return{kind:"tool",name:e.name,args:e.args,response:e.response,done:e.status==="done"};throw new Error(en("conversation.unsupportedActivity"))}function jNt({activities:e}){const{t}=Te("skills"),n=p.useMemo(()=>e.filter(i=>i.kind!=="status").map(_Nt),[e]);return n.length===0?null:a.jsx("div",{className:"skill-conversation","aria-label":t("conversation.ariaLabel"),"aria-live":"polite",children:a.jsx(y0,{blocks:n,onAction:TNt})})}function Kne(){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m7 9 5 5 5-5",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}function RN({label:e,value:t,options:n,onChange:i,disabled:r=!1,allowCustom:s=!1,required:o=!1,placeholder:l,error:c}){const{t:u}=Te("skills"),d=l??u("configSelect.placeholder"),f=p.useId(),h=p.useId(),m=p.useId(),g=p.useRef(null),b=p.useRef(null),v=p.useRef(null),y=p.useRef(null),w=p.useRef([]),x=n.findIndex(I=>I.value===t),O=t.trim().toLocaleLowerCase(),k=s&&O?n.filter(I=>I.value.toLocaleLowerCase().includes(O)||I.label.toLocaleLowerCase().includes(O)):n,[S,C]=p.useState(!1),[E,j]=p.useState(Math.max(0,x)),T=x>=0?n[x]:void 0,R=r||!s&&n.length===0,A=(I=!1)=>{C(!1),I&&window.requestAnimationFrame(()=>{var D,_;return s?(D=v.current)==null?void 0:D.focus():(_=b.current)==null?void 0:_.focus()})},N=I=>{R||k.length!==0&&(j(Math.min(Math.max(I,0),k.length-1)),C(!0))};p.useEffect(()=>{if(!S)return;const I=y.current,D=s?void 0:window.requestAnimationFrame(()=>{var M;(M=w.current[E])==null||M.focus()}),_=M=>{if(!I)return;const V=I.scrollTop<=0,q=I.scrollTop+I.clientHeight>=I.scrollHeight-1;(I.scrollHeight<=I.clientHeight||M.deltaY<0&&V||M.deltaY>0&&q)&&M.preventDefault(),M.stopPropagation()},L=M=>{var V;M.target instanceof Node&&!((V=g.current)!=null&&V.contains(M.target))&&A()},F=M=>{M.key==="Escape"&&A(!0)};return I==null||I.addEventListener("wheel",_,{passive:!1}),window.addEventListener("pointerdown",L),window.addEventListener("keydown",F),()=>{D!==void 0&&window.cancelAnimationFrame(D),I==null||I.removeEventListener("wheel",_),window.removeEventListener("pointerdown",L),window.removeEventListener("keydown",F)}},[E,s,S]);const P=I=>{var _;if(k.length===0)return;const D=(I+k.length)%k.length;j(D),(_=w.current[D])==null||_.focus()};return a.jsxs("div",{ref:g,className:`skill-config-select${S?" is-open":""}`,onBlur:I=>{var D;(!I.relatedTarget||!((D=g.current)!=null&&D.contains(I.relatedTarget)))&&A()},children:[a.jsxs("span",{id:h,className:"skill-config-select__label",children:[e,o?a.jsx("span",{className:"skill-required-mark","aria-hidden":"true",children:"*"}):null]}),s?a.jsxs("div",{className:`skill-config-select__trigger is-editable${r?" is-disabled":""}`,"aria-expanded":S,children:[a.jsx("input",{ref:v,value:t,disabled:r,role:"combobox","aria-autocomplete":"list","aria-expanded":S,"aria-controls":S?f:void 0,"aria-labelledby":h,"aria-required":o,"aria-invalid":!!c,"aria-describedby":c?m:void 0,placeholder:d,onChange:I=>{i(I.target.value),j(0),n.length>0&&C(!0)},onClick:()=>{!S&&k.length>0&&N(0)},onKeyDown:I=>{var D,_;if(!(I.nativeEvent.isComposing||I.keyCode===229))if(I.key==="ArrowDown")I.preventDefault(),S?(D=w.current[E])==null||D.focus():N(0);else if(I.key==="ArrowUp")I.preventDefault(),S?(_=w.current[k.length-1])==null||_.focus():N(k.length-1);else if(I.key==="Enter"&&S){I.preventDefault();const L=k[E];L&&i(L.value),A()}else I.key==="Escape"&&(I.preventDefault(),A())}}),a.jsx("button",{type:"button",className:"skill-config-select__toggle",disabled:r||n.length===0,"aria-label":u(S?"configSelect.collapseOptions":"configSelect.expandOptions"),onClick:()=>{S?A():N(0)},children:a.jsx(Kne,{})})]}):a.jsxs("button",{ref:b,type:"button",className:"skill-config-select__trigger",disabled:R,"aria-haspopup":"listbox","aria-expanded":S,"aria-controls":S?f:void 0,"aria-labelledby":h,"aria-required":o,onClick:()=>{S?A():N(x>=0?x:0)},onKeyDown:I=>{I.key==="ArrowDown"?(I.preventDefault(),N(x>=0?x:0)):I.key==="ArrowUp"&&(I.preventDefault(),N(x>=0?x:n.length-1))},children:[a.jsx("span",{className:T?void 0:"is-placeholder",title:T==null?void 0:T.label,children:(T==null?void 0:T.label)||(n.length===0?u("configSelect.noOptions"):d)}),a.jsx(Kne,{})]}),S?a.jsxs("div",{ref:y,id:f,className:"skill-config-select__menu",role:"listbox","aria-labelledby":h,children:[k.length===0?a.jsx("div",{className:"skill-config-select__empty",role:"status",children:u("configSelect.noMatches")}):null,k.map((I,D)=>{const _=I.value===t;return a.jsx("button",{ref:L=>{w.current[D]=L},type:"button",role:"option","aria-selected":_,tabIndex:D===E?0:-1,className:`skill-config-select__option${_?" is-selected":""}`,title:I.label,onFocus:()=>j(D),onClick:()=>{i(I.value),A(!0)},onKeyDown:L=>{L.key==="Enter"||L.key===" "?(L.preventDefault(),i(I.value),A(!0)):L.key==="ArrowDown"?(L.preventDefault(),P(D+1)):L.key==="ArrowUp"?(L.preventDefault(),P(D-1)):L.key==="Home"?(L.preventDefault(),P(0)):L.key==="End"&&(L.preventDefault(),P(n.length-1))},children:I.label},I.value)})]}):null,c?a.jsx("span",{id:m,className:"skill-config-select__error",role:"alert",children:c}):null]})}function Pr(e,t){return e instanceof Error?e:typeof e=="string"&&e.trim()?new Error(e.trim()):new Error(t)}function Ns({error:e}){var s,o,l,c,u;const{t}=Te("skills"),n=e,i=(o=(s=n.originalError)==null?void 0:s.message)==null?void 0:o.trim(),r=[typeof n.status=="number"?`HTTP ${n.status}${n.statusText?` ${n.statusText}`:""}`:"",n.code?t("errorDetails.code",{code:n.code}):"",(l=n.originalError)!=null&&l.type?t("errorDetails.type",{type:n.originalError.type}):"",(c=n.originalError)!=null&&c.repr&&n.originalError.repr!==i?t("errorDetails.representation",{value:n.originalError.repr}):"",(u=n.rawResponse)!=null&&u.trim()?t("errorDetails.rawResponse",{value:n.rawResponse.trim()}):""].filter(Boolean);return a.jsxs("div",{className:"skill-error-details",children:[a.jsx("div",{className:"skill-error-details__summary",children:e.message}),i?a.jsx("div",{className:"skill-error-details__original",children:t("errorDetails.original",{message:i})}):null,r.length>0?a.jsxs("details",{children:[a.jsx("summary",{children:t("errorDetails.details")}),a.jsx("pre",{children:r.join(` +`)})]}):null]})}const yq=Symbol.for("yaml.alias"),f9=Symbol.for("yaml.document"),$g=Symbol.for("yaml.map"),YLe=Symbol.for("yaml.pair"),Eh=Symbol.for("yaml.scalar"),oO=Symbol.for("yaml.seq"),_d=Symbol.for("yaml.node.type"),lO=e=>!!e&&typeof e=="object"&&e[_d]===yq,wT=e=>!!e&&typeof e=="object"&&e[_d]===f9,OT=e=>!!e&&typeof e=="object"&&e[_d]===$g,ja=e=>!!e&&typeof e=="object"&&e[_d]===YLe,xs=e=>!!e&&typeof e=="object"&&e[_d]===Eh,kT=e=>!!e&&typeof e=="object"&&e[_d]===oO;function Ca(e){if(e&&typeof e=="object")switch(e[_d]){case $g:case oO:return!0}return!1}function _a(e){if(e&&typeof e=="object")switch(e[_d]){case yq:case $g:case Eh:case oO:return!0}return!1}const ZLe=e=>(xs(e)||Ca(e))&&!!e.anchor,gy=Symbol("break visit"),NNt=Symbol("skip children"),gE=Symbol("remove node");function cO(e,t){const n=RNt(t);wT(e)?Mx(null,e.contents,n,Object.freeze([e]))===gE&&(e.contents=null):Mx(null,e,n,Object.freeze([]))}cO.BREAK=gy;cO.SKIP=NNt;cO.REMOVE=gE;function Mx(e,t,n,i){const r=INt(e,t,n,i);if(_a(r)||ja(r))return PNt(e,i,r),Mx(e,r,n,i);if(typeof r!="symbol"){if(Ca(t)){i=Object.freeze(i.concat(t));for(let s=0;se.replace(/[!,[\]{}]/g,t=>DNt[t]);class Xl{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Xl.defaultYaml,t),this.tags=Object.assign({},Xl.defaultTags,n)}clone(){const t=new Xl(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Xl(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Xl.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Xl.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Xl.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Xl.defaultTags),this.atNextDocument=!1);const i=t.trim().split(/[ \t]+/),r=i.shift();switch(r){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;const[s,o]=i;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[s]=i;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{const o=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,o),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const o=t.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,i,r]=t.match(/^(.*!)([^!]*)$/s);r||n(`The ${t} tag has no suffix`);const s=this.tags[i];if(s)try{return s+decodeURIComponent(r)}catch(o){return n(String(o)),null}return i==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,i]of Object.entries(this.tags))if(t.startsWith(i))return n+MNt(t.substring(i.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags);let r;if(t&&i.length>0&&_a(t.contents)){const s={};cO(t.contents,(o,l)=>{_a(l)&&l.tag&&(s[l.tag]=!0)}),r=Object.keys(s)}else r=[];for(const[s,o]of i)s==="!!"&&o==="tag:yaml.org,2002:"||(!t||r.some(l=>l.startsWith(o)))&&n.push(`%TAG ${s} ${o}`);return n.join(` +`)}}Xl.defaultYaml={explicit:!1,version:"1.2"};Xl.defaultTags={"!!":"tag:yaml.org,2002:"};function JLe(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function e5e(e){const t=new Set;return cO(e,{Value(n,i){i.anchor&&t.add(i.anchor)}}),t}function t5e(e,t){for(let n=1;;++n){const i=`${e}${n}`;if(!t.has(i))return i}}function LNt(e,t){const n=[],i=new Map;let r=null;return{onAnchor:s=>{n.push(s),r??(r=e5e(e));const o=t5e(t,r);return r.add(o),o},setAnchors:()=>{for(const s of n){const o=i.get(s);if(typeof o=="object"&&o.anchor&&(xs(o.node)||Ca(o.node)))o.node.anchor=o.anchor;else{const l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=s,l}}},sourceObjects:i}}function Lx(e,t,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,s=i.length;rkd(i,String(r),n));if(e&&typeof e.toJSON=="function"){if(!n||!ZLe(e))return e.toJSON(t,n);const i={aliasCount:0,count:1,res:void 0};n.anchors.set(e,i),n.onCreate=s=>{i.res=s,delete n.onCreate};const r=e.toJSON(t,n);return n.onCreate&&n.onCreate(r),r}return typeof e=="bigint"&&!(n!=null&&n.keep)?Number(e):e}class vq{constructor(t){Object.defineProperty(this,_d,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:s}={}){if(!wT(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=kd(this,"",o);if(typeof r=="function")for(const{count:c,res:u}of o.anchors.values())r(u,c);return typeof s=="function"?Lx(s,{"":l},"",l):l}}let xq=class extends vq{constructor(t){super(yq),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if((n==null?void 0:n.maxAliasCount)===0)throw new ReferenceError("Alias resolution is disabled");let i;n!=null&&n.aliasResolveCache?i=n.aliasResolveCache:(i=[],cO(t,{Node:(s,o)=>{(lO(o)||ZLe(o))&&i.push(o)}}),n&&(n.aliasResolveCache=i));let r;for(const s of i){if(s===this)break;s.anchor===this.source&&(r=s)}return r}toJSON(t,n){if(!n)return{source:this.source};const{anchors:i,doc:r,maxAliasCount:s}=n,o=this.resolve(r,n);if(!o){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let l=i.get(o);if(l||(kd(o,null,n),l=i.get(o)),(l==null?void 0:l.res)===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(s>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=IN(r,o,i)),l.count*l.aliasCount>s)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return l.res}toString(t,n,i){const r=`*${this.source}`;if(t){if(JLe(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(t.implicitKey)return`${r} `}return r}};function IN(e,t,n){if(lO(t)){const i=t.resolve(e),r=n&&i&&n.get(i);return r?r.count*r.aliasCount:0}else if(Ca(t)){let i=0;for(const r of t.items){const s=IN(e,r,n);s>i&&(i=s)}return i}else if(ja(t)){const i=IN(e,t.key,n),r=IN(e,t.value,n);return Math.max(i,r)}return 1}const n5e=e=>!e||typeof e!="function"&&typeof e!="object";class wi extends vq{constructor(t){super(Eh),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:kd(this.value,t,n)}toString(){return String(this.value)}}wi.BLOCK_FOLDED="BLOCK_FOLDED";wi.BLOCK_LITERAL="BLOCK_LITERAL";wi.PLAIN="PLAIN";wi.QUOTE_DOUBLE="QUOTE_DOUBLE";wi.QUOTE_SINGLE="QUOTE_SINGLE";const $Nt="tag:yaml.org,2002:";function FNt(e,t,n){if(t){const i=n.filter(s=>s.tag===t),r=i.find(s=>!s.format)??i[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return n.find(i=>{var r;return((r=i.identify)==null?void 0:r.call(i,e))&&!i.format})}function _C(e,t,n){var f,h,m;if(wT(e)&&(e=e.contents),_a(e))return e;if(ja(e)){const g=(h=(f=n.schema[$g]).createNode)==null?void 0:h.call(f,n.schema,null,n);return g.items.push(e),g}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:i,onAnchor:r,onTagObj:s,schema:o,sourceObjects:l}=n;let c;if(i&&e&&typeof e=="object"){if(c=l.get(e),c)return c.anchor??(c.anchor=r(e)),new xq(c.anchor);c={anchor:null,node:null},l.set(e,c)}t!=null&&t.startsWith("!!")&&(t=$Nt+t.slice(2));let u=FNt(e,t,o.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const g=new wi(e);return c&&(c.node=g),g}u=e instanceof Map?o[$g]:Symbol.iterator in Object(e)?o[oO]:o[$g]}s&&(s(u),delete n.onTagObj);const d=u!=null&&u.createNode?u.createNode(n.schema,e,n):typeof((m=u==null?void 0:u.nodeClass)==null?void 0:m.from)=="function"?u.nodeClass.from(n.schema,e,n):new wi(e);return t?d.tag=t:u.default||(d.tag=u.tag),c&&(c.node=d),d}function MI(e,t,n){let i=n;for(let r=t.length-1;r>=0;--r){const s=t[r];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){const o=[];o[s]=i,i=o}else i=new Map([[s,i]])}return _C(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const mS=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class i5e extends vq{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(i=>_a(i)||ja(i)?i.clone(t):i),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(mS(t))this.add(n);else{const[i,...r]=t,s=this.get(i,!0);if(Ca(s))s.addIn(r,n);else if(s===void 0&&this.schema)this.set(i,MI(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}deleteIn(t){const[n,...i]=t;if(i.length===0)return this.delete(n);const r=this.get(n,!0);if(Ca(r))return r.deleteIn(i);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(t,n){const[i,...r]=t,s=this.get(i,!0);return r.length===0?!n&&xs(s)?s.value:s:Ca(s)?s.getIn(r,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!ja(n))return!1;const i=n.value;return i==null||t&&xs(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(t){const[n,...i]=t;if(i.length===0)return this.has(n);const r=this.get(n,!0);return Ca(r)?r.hasIn(i):!1}setIn(t,n){const[i,...r]=t;if(r.length===0)this.set(i,n);else{const s=this.get(i,!0);if(Ca(s))s.setIn(r,n);else if(s===void 0&&this.schema)this.set(i,MI(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}}const BNt=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Ep(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Ry=(e,t,n)=>e.endsWith(` +`)?Ep(n,t):n.includes(` `)?` -`+Ap(n,t):(e.endsWith(" ")?"":" ")+n,r5e="flow",h9="block",IN="quoted";function LM(e,t,n="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:s=20,onFold:o,onOverflow:l}={}){if(!r||r<0)return e;rr-Math.max(2,s)?u.push(0):f=r-i);let h,m,g=!1,b=-1,v=-1,y=-1;n===h9&&(b=Gne(e,b,t.length),b!==-1&&(f=b+c));for(let x;x=e[b+=1];){if(n===IN&&x==="\\"){switch(v=b,e[b+1]){case"x":b+=3;break;case"u":b+=5;break;case"U":b+=9;break;default:b+=1}y=b}if(x===` +`+Ep(n,t):(e.endsWith(" ")?"":" ")+n,r5e="flow",h9="block",PN="quoted";function $M(e,t,n="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:s=20,onFold:o,onOverflow:l}={}){if(!r||r<0)return e;rr-Math.max(2,s)?u.push(0):f=r-i);let h,m,g=!1,b=-1,v=-1,y=-1;n===h9&&(b=Gne(e,b,t.length),b!==-1&&(f=b+c));for(let x;x=e[b+=1];){if(n===PN&&x==="\\"){switch(v=b,e[b+1]){case"x":b+=3;break;case"u":b+=5;break;case"U":b+=9;break;default:b+=1}y=b}if(x===` `)n===h9&&(b=Gne(e,b,t.length)),f=b+t.length+c,h=void 0;else{if(x===" "&&m&&m!==" "&&m!==` `&&m!==" "){const O=e[b+1];O&&O!==" "&&O!==` -`&&O!==" "&&(h=b)}if(b>=f)if(h)u.push(h),f=h+c,h=void 0;else if(n===IN){for(;m===" "||m===" ";)m=x,x=e[b+=1],g=!0;const O=b>y+1?b-2:v-1;if(d[O])return e;u.push(O),d[O]=!0,f=O+c,h=void 0}else g=!0}m=x}if(g&&l&&l(),u.length===0)return e;o&&o();let w=e.slice(0,u[0]);for(let x=0;x=f)if(h)u.push(h),f=h+c,h=void 0;else if(n===PN){for(;m===" "||m===" ";)m=x,x=e[b+=1],g=!0;const O=b>y+1?b-2:v-1;if(d[O])return e;u.push(O),d[O]=!0,f=O+c,h=void 0}else g=!0}m=x}if(g&&l&&l(),u.length===0)return e;o&&o();let w=e.slice(0,u[0]);for(let x=0;x({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),FM=e=>/^(%|---|\.\.\.)/m.test(e);function UNt(e,t,n){if(!t||t<0)return!1;const i=t-n,r=e.length;if(r<=i)return!1;for(let s=0,o=0;si)return!0;if(o=s+1,r-o<=i)return!1}return!0}function fE(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:i}=t,r=t.options.doubleQuotedMinMultiLineLength,s=t.indent||(FM(e)?" ":"");let o="",l=0;for(let c=0,u=n[c];u;u=n[++c])if(u===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(o+=n.slice(l,c)+"\\ ",c+=1,l=c,u="\\"),u==="\\")switch(n[c+1]){case"u":{o+=n.slice(l,c);const d=n.substr(c+2,4);switch(d){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:d.substr(0,2)==="00"?o+="\\x"+d.substr(2):o+=n.substr(c,6)}c+=5,l=c+1}break;case"n":if(i||n[c+2]==='"'||n.length({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),BM=e=>/^(%|---|\.\.\.)/m.test(e);function UNt(e,t,n){if(!t||t<0)return!1;const i=t-n,r=e.length;if(r<=i)return!1;for(let s=0,o=0;si)return!0;if(o=s+1,r-o<=i)return!1}return!0}function bE(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:i}=t,r=t.options.doubleQuotedMinMultiLineLength,s=t.indent||(BM(e)?" ":"");let o="",l=0;for(let c=0,u=n[c];u;u=n[++c])if(u===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(o+=n.slice(l,c)+"\\ ",c+=1,l=c,u="\\"),u==="\\")switch(n[c+1]){case"u":{o+=n.slice(l,c);const d=n.substr(c+2,4);switch(d){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:d.substr(0,2)==="00"?o+="\\x"+d.substr(2):o+=n.substr(c,6)}c+=5,l=c+1}break;case"n":if(i||n[c+2]==='"'||n.length `;let f,h;for(h=n.length;h>0;--h){const k=n[h-1];if(k!==` `&&k!==" "&&k!==" ")break}let m=n.substring(h);const g=m.indexOf(` `);g===-1?f="-":n===m||g!==m.length-1?(f="+",s&&s()):f="",m&&(n=n.slice(0,-m.length),m[m.length-1]===` `&&(m=m.slice(0,-1)),m=m.replace(m9,`$&${u}`));let b=!1,v,y=-1;for(v=0;v{S=!0});const E=LM(`${w}${k}${m}`,u,h9,C);if(!S)return`>${O} +$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${u}`);let S=!1;const C=FM(i,!0);o!=="folded"&&t!==wi.BLOCK_FOLDED&&(C.onOverflow=()=>{S=!0});const E=$M(`${w}${k}${m}`,u,h9,C);if(!S)return`>${O} ${u}${E}`}return n=n.replace(/\n+/g,`$&${u}`),`|${O} ${u}${w}${n}${m}`}function QNt(e,t,n,i){const{type:r,value:s}=e,{actualString:o,implicitKey:l,indent:c,indentStep:u,inFlow:d}=t;if(l&&s.includes(` -`)||d&&/[[\]{},]/.test(s))return Mx(s,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||d||!s.includes(` -`)?Mx(s,t):PN(e,t,n,i);if(!l&&!d&&r!==Oi.PLAIN&&s.includes(` -`))return PN(e,t,n,i);if(FM(s)){if(c==="")return t.forceBlockIndent=!0,PN(e,t,n,i);if(l&&c===u)return Mx(s,t)}const f=s.replace(/\n+/g,`$& -${c}`);if(o){const h=b=>{var v;return b.default&&b.tag!=="tag:yaml.org,2002:str"&&((v=b.test)==null?void 0:v.test(f))},{compat:m,tags:g}=t.doc.schema;if(g.some(h)||m!=null&&m.some(h))return Mx(s,t)}return l?f:LM(f,c,r5e,$M(t,!1))}function wq(e,t,n,i){const{implicitKey:r,inFlow:s}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:l}=e;l!==Oi.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(l=Oi.QUOTE_DOUBLE);const c=d=>{switch(d){case Oi.BLOCK_FOLDED:case Oi.BLOCK_LITERAL:return r||s?Mx(o.value,t):PN(o,t,n,i);case Oi.QUOTE_DOUBLE:return fE(o.value,t);case Oi.QUOTE_SINGLE:return p9(o.value,t);case Oi.PLAIN:return QNt(o,t,n,i);default:return null}};let u=c(l);if(u===null){const{defaultKeyType:d,defaultStringType:f}=t.options,h=r&&d||f;if(u=c(h),u===null)throw new Error(`Unsupported default string type ${h}`)}return u}function s5e(e,t){const n=Object.assign({blockQuote:!0,commentString:BNt,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let i;switch(n.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:i,options:n}}function zNt(e,t){var r;if(t.tag){const s=e.filter(o=>o.tag===t.tag);if(s.length>0)return s.find(o=>o.format===t.format)??s[0]}let n,i;if(Os(t)){i=t.value;let s=e.filter(o=>{var l;return(l=o.identify)==null?void 0:l.call(o,i)});if(s.length>1){const o=s.filter(l=>l.test);o.length>0&&(s=o)}n=s.find(o=>o.format===t.format)??s.find(o=>!o.format)}else i=t,n=e.find(s=>s.nodeClass&&i instanceof s.nodeClass);if(!n){const s=((r=i==null?void 0:i.constructor)==null?void 0:r.name)??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${s} value`)}return n}function VNt(e,t,{anchors:n,doc:i}){if(!i.directives)return"";const r=[],s=(Os(e)||Ta(e))&&e.anchor;s&&JLe(s)&&(n.add(s),r.push(`&${s}`));const o=e.tag??(t.default?null:t.tag);return o&&r.push(i.directives.tagString(o)),r.join(" ")}function s1(e,t,n,i){var c;if(Ra(e))return e.toString(t,n,i);if(aO(e)){if(t.doc.directives)return e.toString(t);if((c=t.resolvedAliases)!=null&&c.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let r;const s=Na(e)?e:t.doc.createNode(e,{onTagObj:u=>r=u});r??(r=zNt(t.doc.schema.tags,s));const o=VNt(s,r,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const l=typeof r.stringify=="function"?r.stringify(s,t,n,i):Os(s)?wq(s,t,n,i):s.toString(t,n,i);return o?Os(s)||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o} -${t.indent}${l}`:l}function HNt({key:e,value:t},n,i,r){const{allNullValues:s,doc:o,indent:l,indentStep:c,options:{commentString:u,indentSeq:d,simpleKeys:f}}=n;let h=Na(e)&&e.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(Ta(e)||!Na(e)&&typeof e=="object"){const C="With simple keys, collection cannot be used as a key value";throw new Error(C)}}let m=!f&&(!e||h&&t==null&&!n.inFlow||Ta(e)||(Os(e)?e.type===Oi.BLOCK_FOLDED||e.type===Oi.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!m&&(f||!s),indent:l+c});let g=!1,b=!1,v=s1(e,n,()=>g=!0,()=>b=!0);if(!m&&!n.inFlow&&v.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(n.inFlow){if(s||t==null)return g&&i&&i(),v===""?"?":m?`? ${v}`:v}else if(s&&!f||t==null&&m)return v=`? ${v}`,h&&!g?v+=_y(v,n.indent,u(h)):b&&r&&r(),v;g&&(h=null),m?(h&&(v+=_y(v,n.indent,u(h))),v=`? ${v} -${l}:`):(v=`${v}:`,h&&(v+=_y(v,n.indent,u(h))));let y,w,x;Na(t)?(y=!!t.spaceBefore,w=t.commentBefore,x=t.comment):(y=!1,w=null,x=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!m&&!h&&Os(t)&&(n.indentAtStart=v.length+1),b=!1,!d&&c.length>=2&&!n.inFlow&&!m&&yT(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let O=!1;const k=s1(t,n,()=>O=!0,()=>b=!0);let S=" ";if(h||y||w){if(S=y?` +`)||d&&/[[\]{},]/.test(s))return $x(s,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||d||!s.includes(` +`)?$x(s,t):DN(e,t,n,i);if(!l&&!d&&r!==wi.PLAIN&&s.includes(` +`))return DN(e,t,n,i);if(BM(s)){if(c==="")return t.forceBlockIndent=!0,DN(e,t,n,i);if(l&&c===u)return $x(s,t)}const f=s.replace(/\n+/g,`$& +${c}`);if(o){const h=b=>{var v;return b.default&&b.tag!=="tag:yaml.org,2002:str"&&((v=b.test)==null?void 0:v.test(f))},{compat:m,tags:g}=t.doc.schema;if(g.some(h)||m!=null&&m.some(h))return $x(s,t)}return l?f:$M(f,c,r5e,FM(t,!1))}function wq(e,t,n,i){const{implicitKey:r,inFlow:s}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:l}=e;l!==wi.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(l=wi.QUOTE_DOUBLE);const c=d=>{switch(d){case wi.BLOCK_FOLDED:case wi.BLOCK_LITERAL:return r||s?$x(o.value,t):DN(o,t,n,i);case wi.QUOTE_DOUBLE:return bE(o.value,t);case wi.QUOTE_SINGLE:return p9(o.value,t);case wi.PLAIN:return QNt(o,t,n,i);default:return null}};let u=c(l);if(u===null){const{defaultKeyType:d,defaultStringType:f}=t.options,h=r&&d||f;if(u=c(h),u===null)throw new Error(`Unsupported default string type ${h}`)}return u}function s5e(e,t){const n=Object.assign({blockQuote:!0,commentString:BNt,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let i;switch(n.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:i,options:n}}function zNt(e,t){var r;if(t.tag){const s=e.filter(o=>o.tag===t.tag);if(s.length>0)return s.find(o=>o.format===t.format)??s[0]}let n,i;if(xs(t)){i=t.value;let s=e.filter(o=>{var l;return(l=o.identify)==null?void 0:l.call(o,i)});if(s.length>1){const o=s.filter(l=>l.test);o.length>0&&(s=o)}n=s.find(o=>o.format===t.format)??s.find(o=>!o.format)}else i=t,n=e.find(s=>s.nodeClass&&i instanceof s.nodeClass);if(!n){const s=((r=i==null?void 0:i.constructor)==null?void 0:r.name)??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${s} value`)}return n}function VNt(e,t,{anchors:n,doc:i}){if(!i.directives)return"";const r=[],s=(xs(e)||Ca(e))&&e.anchor;s&&JLe(s)&&(n.add(s),r.push(`&${s}`));const o=e.tag??(t.default?null:t.tag);return o&&r.push(i.directives.tagString(o)),r.join(" ")}function o1(e,t,n,i){var c;if(ja(e))return e.toString(t,n,i);if(lO(e)){if(t.doc.directives)return e.toString(t);if((c=t.resolvedAliases)!=null&&c.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let r;const s=_a(e)?e:t.doc.createNode(e,{onTagObj:u=>r=u});r??(r=zNt(t.doc.schema.tags,s));const o=VNt(s,r,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const l=typeof r.stringify=="function"?r.stringify(s,t,n,i):xs(s)?wq(s,t,n,i):s.toString(t,n,i);return o?xs(s)||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o} +${t.indent}${l}`:l}function HNt({key:e,value:t},n,i,r){const{allNullValues:s,doc:o,indent:l,indentStep:c,options:{commentString:u,indentSeq:d,simpleKeys:f}}=n;let h=_a(e)&&e.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(Ca(e)||!_a(e)&&typeof e=="object"){const C="With simple keys, collection cannot be used as a key value";throw new Error(C)}}let m=!f&&(!e||h&&t==null&&!n.inFlow||Ca(e)||(xs(e)?e.type===wi.BLOCK_FOLDED||e.type===wi.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!m&&(f||!s),indent:l+c});let g=!1,b=!1,v=o1(e,n,()=>g=!0,()=>b=!0);if(!m&&!n.inFlow&&v.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(n.inFlow){if(s||t==null)return g&&i&&i(),v===""?"?":m?`? ${v}`:v}else if(s&&!f||t==null&&m)return v=`? ${v}`,h&&!g?v+=Ry(v,n.indent,u(h)):b&&r&&r(),v;g&&(h=null),m?(h&&(v+=Ry(v,n.indent,u(h))),v=`? ${v} +${l}:`):(v=`${v}:`,h&&(v+=Ry(v,n.indent,u(h))));let y,w,x;_a(t)?(y=!!t.spaceBefore,w=t.commentBefore,x=t.comment):(y=!1,w=null,x=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!m&&!h&&xs(t)&&(n.indentAtStart=v.length+1),b=!1,!d&&c.length>=2&&!n.inFlow&&!m&&kT(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let O=!1;const k=o1(t,n,()=>O=!0,()=>b=!0);let S=" ";if(h||y||w){if(S=y?` `:"",w){const C=u(w);S+=` -${Ap(C,n.indent)}`}k===""&&!n.inFlow?S===` +${Ep(C,n.indent)}`}k===""&&!n.inFlow?S===` `&&x&&(S=` `):S+=` -${n.indent}`}else if(!m&&Ta(t)){const C=k[0],E=k.indexOf(` +${n.indent}`}else if(!m&&Ca(t)){const C=k[0],E=k.indexOf(` `),j=E!==-1,T=n.inFlow??t.flow??t.items.length===0;if(j||!T){let R=!1;if(j&&(C==="&"||C==="!")){let A=k.indexOf(" ");C==="&"&&A!==-1&&Ae===I_||typeof e=="symbol"&&e.description===I_,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Oi(Symbol(I_)),{addToJSMap:o5e}),stringify:()=>I_},qNt=(e,t)=>(Up.identify(t)||Os(t)&&(!t.type||t.type===Oi.PLAIN)&&Up.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===Up.tag&&n.default));function o5e(e,t,n){const i=l5e(e,n);if(yT(i))for(const r of i.items)U4(e,t,r);else if(Array.isArray(i))for(const r of i)U4(e,t,r);else U4(e,t,i)}function U4(e,t,n){const i=l5e(e,n);if(!bT(i))throw new Error("Merge sources must be maps or map aliases");const r=i.toJSON(null,e,Map);for(const[s,o]of r)t instanceof Map?t.has(s)||t.set(s,o):t instanceof Set?t.add(s):Object.prototype.hasOwnProperty.call(t,s)||Object.defineProperty(t,s,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function l5e(e,t){return e&&aO(t)?t.resolve(e.doc,e):t}function c5e(e,t,{key:n,value:i}){if(Na(n)&&n.addToJSMap)n.addToJSMap(e,t,i);else if(qNt(e,n))o5e(e,t,i);else{const r=Sd(n,"",e);if(t instanceof Map)t.set(r,Sd(i,r,e));else if(t instanceof Set)t.add(r);else{const s=WNt(n,r,e),o=Sd(i,s,e);s in t?Object.defineProperty(t,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[s]=o}}return t}function WNt(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Na(e)&&(n!=null&&n.doc)){const i=s5e(n.doc,{});i.anchors=new Set;for(const s of n.anchors.keys())i.anchors.add(s.anchor);i.inFlow=!0,i.inStringifyKey=!0;const r=e.toString(i);if(!n.mapKeyWarned){let s=JSON.stringify(r);s.length>40&&(s=s.substring(0,36)+'..."'),a5e(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function Oq(e,t,n){const i=SC(e,void 0,n),r=SC(t,void 0,n);return new oc(i,r)}class oc{constructor(t,n=null){Object.defineProperty(this,jd,{value:YLe}),this.key=t,this.value=n}clone(t){let{key:n,value:i}=this;return Na(n)&&(n=n.clone(t)),Na(i)&&(i=i.clone(t)),new oc(n,i)}toJSON(t,n){const i=n!=null&&n.mapAsMap?new Map:{};return c5e(n,i,this)}toString(t,n,i){return t!=null&&t.doc?HNt(this,t,n,i):JSON.stringify(this)}}function u5e(e,t,n){return(t.inFlow??e.flow?GNt:KNt)(e,t,n)}function KNt({comment:e,items:t},n,{blockItemPrefix:i,flowChars:r,itemIndent:s,onChompKeep:o,onComment:l}){const{indent:c,options:{commentString:u}}=n,d=Object.assign({},n,{indent:s,type:null});let f=!1;const h=[];for(let g=0;gv=null,()=>f=!0);v&&(y+=_y(y,s,u(v))),f&&v&&(f=!1),h.push(i+y)}let m;if(h.length===0)m=r.start+r.end;else{m=h[0];for(let g=1;ge===P_||typeof e=="symbol"&&e.description===P_,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new wi(Symbol(P_)),{addToJSMap:o5e}),stringify:()=>P_},qNt=(e,t)=>(Fp.identify(t)||xs(t)&&(!t.type||t.type===wi.PLAIN)&&Fp.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===Fp.tag&&n.default));function o5e(e,t,n){const i=l5e(e,n);if(kT(i))for(const r of i.items)U4(e,t,r);else if(Array.isArray(i))for(const r of i)U4(e,t,r);else U4(e,t,i)}function U4(e,t,n){const i=l5e(e,n);if(!OT(i))throw new Error("Merge sources must be maps or map aliases");const r=i.toJSON(null,e,Map);for(const[s,o]of r)t instanceof Map?t.has(s)||t.set(s,o):t instanceof Set?t.add(s):Object.prototype.hasOwnProperty.call(t,s)||Object.defineProperty(t,s,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function l5e(e,t){return e&&lO(t)?t.resolve(e.doc,e):t}function c5e(e,t,{key:n,value:i}){if(_a(n)&&n.addToJSMap)n.addToJSMap(e,t,i);else if(qNt(e,n))o5e(e,t,i);else{const r=kd(n,"",e);if(t instanceof Map)t.set(r,kd(i,r,e));else if(t instanceof Set)t.add(r);else{const s=WNt(n,r,e),o=kd(i,s,e);s in t?Object.defineProperty(t,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[s]=o}}return t}function WNt(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(_a(e)&&(n!=null&&n.doc)){const i=s5e(n.doc,{});i.anchors=new Set;for(const s of n.anchors.keys())i.anchors.add(s.anchor);i.inFlow=!0,i.inStringifyKey=!0;const r=e.toString(i);if(!n.mapKeyWarned){let s=JSON.stringify(r);s.length>40&&(s=s.substring(0,36)+'..."'),a5e(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function Oq(e,t,n){const i=_C(e,void 0,n),r=_C(t,void 0,n);return new sc(i,r)}class sc{constructor(t,n=null){Object.defineProperty(this,_d,{value:YLe}),this.key=t,this.value=n}clone(t){let{key:n,value:i}=this;return _a(n)&&(n=n.clone(t)),_a(i)&&(i=i.clone(t)),new sc(n,i)}toJSON(t,n){const i=n!=null&&n.mapAsMap?new Map:{};return c5e(n,i,this)}toString(t,n,i){return t!=null&&t.doc?HNt(this,t,n,i):JSON.stringify(this)}}function u5e(e,t,n){return(t.inFlow??e.flow?GNt:KNt)(e,t,n)}function KNt({comment:e,items:t},n,{blockItemPrefix:i,flowChars:r,itemIndent:s,onChompKeep:o,onComment:l}){const{indent:c,options:{commentString:u}}=n,d=Object.assign({},n,{indent:s,type:null});let f=!1;const h=[];for(let g=0;gv=null,()=>f=!0);v&&(y+=Ry(y,s,u(v))),f&&v&&(f=!1),h.push(i+y)}let m;if(h.length===0)m=r.start+r.end;else{m=h[0];for(let g=1;gv=null);u||(u=f.length>d||y.includes(` -`)),g0&&(u||(u=f.reduce((w,x)=>w+x.length+2,2)+(y.length+2)>t.options.lineWidth)),u&&(y+=",")),v&&(y+=_y(y,i,l(v))),f.push(y),d=f.length}const{start:h,end:m}=n;if(f.length===0)return h+m;if(!u){const g=f.reduce((b,v)=>b+v.length+2,2);u=t.options.lineWidth>0&&g>t.options.lineWidth}if(u){let g=h;for(const b of f)g+=b?` +`+Ep(u(e),c),l&&l()):f&&o&&o(),m}function GNt({items:e},t,{flowChars:n,itemIndent:i}){const{indent:r,indentStep:s,flowCollectionPadding:o,options:{commentString:l}}=t;i+=s;const c=Object.assign({},t,{indent:i,inFlow:!0,type:null});let u=!1,d=0;const f=[];for(let g=0;gv=null);u||(u=f.length>d||y.includes(` +`)),g0&&(u||(u=f.reduce((w,x)=>w+x.length+2,2)+(y.length+2)>t.options.lineWidth)),u&&(y+=",")),v&&(y+=Ry(y,i,l(v))),f.push(y),d=f.length}const{start:h,end:m}=n;if(f.length===0)return h+m;if(!u){const g=f.reduce((b,v)=>b+v.length+2,2);u=t.options.lineWidth>0&&g>t.options.lineWidth}if(u){let g=h;for(const b of f)g+=b?` ${s}${r}${b}`:` `;return`${g} -${r}${m}`}else return`${h}${o}${f.join(" ")}${o}${m}`}function MI({indent:e,options:{commentString:t}},n,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){const s=Ap(t(i),e);n.push(s.trimStart())}}function jy(e,t){const n=Os(t)?t.value:t;for(const i of e)if(Ra(i)&&(i.key===t||i.key===n||Os(i.key)&&i.key.value===n))return i}class dd extends i5e{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Fg,t),this.items=[]}static from(t,n,i){const{keepUndefined:r,replacer:s}=i,o=new this(t),l=(c,u)=>{if(typeof s=="function")u=s.call(n,c,u);else if(Array.isArray(s)&&!s.includes(c))return;(u!==void 0||r)&&o.items.push(Oq(c,u,i))};if(n instanceof Map)for(const[c,u]of n)l(c,u);else if(n&&typeof n=="object")for(const c of Object.keys(n))l(c,n[c]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,n){var o;let i;Ra(t)?i=t:!t||typeof t!="object"||!("key"in t)?i=new oc(t,t==null?void 0:t.value):i=new oc(t.key,t.value);const r=jy(this.items,i.key),s=(o=this.schema)==null?void 0:o.sortMapEntries;if(r){if(!n)throw new Error(`Key ${i.key} already set`);Os(r.value)&&n5e(i.value)?r.value.value=i.value:r.value=i.value}else if(s){const l=this.items.findIndex(c=>s(i,c)<0);l===-1?this.items.push(i):this.items.splice(l,0,i)}else this.items.push(i)}delete(t){const n=jy(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const i=jy(this.items,t),r=i==null?void 0:i.value;return(!n&&Os(r)?r.value:r)??void 0}has(t){return!!jy(this.items,t)}set(t,n){this.add(new oc(t,n),!0)}toJSON(t,n,i){const r=i?new i:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(r);for(const s of this.items)c5e(n,r,s);return r}toString(t,n,i){if(!t)return JSON.stringify(this);for(const r of this.items)if(!Ra(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),u5e(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:i,onComment:n})}}const lO={collection:"map",default:!0,nodeClass:dd,tag:"tag:yaml.org,2002:map",resolve(e,t){return bT(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>dd.from(e,t,n)};class g0 extends i5e{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(sO,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=P_(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const i=P_(t);if(typeof i!="number")return;const r=this.items[i];return!n&&Os(r)?r.value:r}has(t){const n=P_(t);return typeof n=="number"&&n=0?t:null}const cO={collection:"seq",default:!0,nodeClass:g0,tag:"tag:yaml.org,2002:seq",resolve(e,t){return yT(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>g0.from(e,t,n)},BM={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,i){return t=Object.assign({actualString:!0},t),wq(e,t,n,i)}},UM={identify:e=>e==null,createNode:()=>new Oi(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Oi(null),stringify:({source:e},t)=>typeof e=="string"&&UM.test.test(e)?e:t.options.nullStr},kq={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Oi(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&kq.test.test(e)){const i=e[0]==="t"||e[0]==="T";if(t===i)return e}return t?n.options.trueStr:n.options.falseStr}};function jf({format:e,minFractionDigits:t,tag:n,value:i}){if(typeof i=="bigint")return String(i);const r=typeof i=="number"?i:Number(i);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let s=Object.is(i,-0)?"-0":JSON.stringify(i);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let o=s.indexOf(".");o<0&&(o=s.length,s+=".");let l=t-(s.length-o-1);for(;l-- >0;)s+="0"}return s}const d5e={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:jf},f5e={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():jf(e)}},h5e={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new Oi(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:jf},QM=e=>typeof e=="bigint"||Number.isInteger(e),Sq=(e,t,n,{intAsBigInt:i})=>i?BigInt(e):parseInt(e.substring(t),n);function p5e(e,t,n){const{value:i}=e;return QM(i)&&i>=0?n+i.toString(t):jf(e)}const m5e={identify:e=>QM(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Sq(e,2,8,n),stringify:e=>p5e(e,8,"0o")},g5e={identify:QM,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Sq(e,0,10,n),stringify:jf},b5e={identify:e=>QM(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Sq(e,2,16,n),stringify:e=>p5e(e,16,"0x")},XNt=[lO,cO,BM,UM,kq,m5e,g5e,b5e,d5e,f5e,h5e];function Xne(e){return typeof e=="bigint"||Number.isInteger(e)}const D_=({value:e})=>JSON.stringify(e),YNt=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:D_},{identify:e=>e==null,createNode:()=>new Oi(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:D_},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:D_},{identify:Xne,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Xne(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:D_}],ZNt={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},JNt=[lO,cO].concat(YNt,ZNt),Eq={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),i=new Uint8Array(n.length);for(let r=0;r1&&t("Each pair must have its own sequence indicator");const r=i.items[0]||new oc(new Oi(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore} +${r}${m}`}else return`${h}${o}${f.join(" ")}${o}${m}`}function LI({indent:e,options:{commentString:t}},n,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){const s=Ep(t(i),e);n.push(s.trimStart())}}function Iy(e,t){const n=xs(t)?t.value:t;for(const i of e)if(ja(i)&&(i.key===t||i.key===n||xs(i.key)&&i.key.value===n))return i}class ud extends i5e{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super($g,t),this.items=[]}static from(t,n,i){const{keepUndefined:r,replacer:s}=i,o=new this(t),l=(c,u)=>{if(typeof s=="function")u=s.call(n,c,u);else if(Array.isArray(s)&&!s.includes(c))return;(u!==void 0||r)&&o.items.push(Oq(c,u,i))};if(n instanceof Map)for(const[c,u]of n)l(c,u);else if(n&&typeof n=="object")for(const c of Object.keys(n))l(c,n[c]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,n){var o;let i;ja(t)?i=t:!t||typeof t!="object"||!("key"in t)?i=new sc(t,t==null?void 0:t.value):i=new sc(t.key,t.value);const r=Iy(this.items,i.key),s=(o=this.schema)==null?void 0:o.sortMapEntries;if(r){if(!n)throw new Error(`Key ${i.key} already set`);xs(r.value)&&n5e(i.value)?r.value.value=i.value:r.value=i.value}else if(s){const l=this.items.findIndex(c=>s(i,c)<0);l===-1?this.items.push(i):this.items.splice(l,0,i)}else this.items.push(i)}delete(t){const n=Iy(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const i=Iy(this.items,t),r=i==null?void 0:i.value;return(!n&&xs(r)?r.value:r)??void 0}has(t){return!!Iy(this.items,t)}set(t,n){this.add(new sc(t,n),!0)}toJSON(t,n,i){const r=i?new i:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(r);for(const s of this.items)c5e(n,r,s);return r}toString(t,n,i){if(!t)return JSON.stringify(this);for(const r of this.items)if(!ja(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),u5e(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:i,onComment:n})}}const uO={collection:"map",default:!0,nodeClass:ud,tag:"tag:yaml.org,2002:map",resolve(e,t){return OT(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>ud.from(e,t,n)};class v0 extends i5e{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(oO,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=D_(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const i=D_(t);if(typeof i!="number")return;const r=this.items[i];return!n&&xs(r)?r.value:r}has(t){const n=D_(t);return typeof n=="number"&&n=0?t:null}const dO={collection:"seq",default:!0,nodeClass:v0,tag:"tag:yaml.org,2002:seq",resolve(e,t){return kT(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>v0.from(e,t,n)},UM={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,i){return t=Object.assign({actualString:!0},t),wq(e,t,n,i)}},QM={identify:e=>e==null,createNode:()=>new wi(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new wi(null),stringify:({source:e},t)=>typeof e=="string"&&QM.test.test(e)?e:t.options.nullStr},kq={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new wi(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&kq.test.test(e)){const i=e[0]==="t"||e[0]==="T";if(t===i)return e}return t?n.options.trueStr:n.options.falseStr}};function _f({format:e,minFractionDigits:t,tag:n,value:i}){if(typeof i=="bigint")return String(i);const r=typeof i=="number"?i:Number(i);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let s=Object.is(i,-0)?"-0":JSON.stringify(i);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let o=s.indexOf(".");o<0&&(o=s.length,s+=".");let l=t-(s.length-o-1);for(;l-- >0;)s+="0"}return s}const d5e={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:_f},f5e={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():_f(e)}},h5e={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new wi(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:_f},zM=e=>typeof e=="bigint"||Number.isInteger(e),Sq=(e,t,n,{intAsBigInt:i})=>i?BigInt(e):parseInt(e.substring(t),n);function p5e(e,t,n){const{value:i}=e;return zM(i)&&i>=0?n+i.toString(t):_f(e)}const m5e={identify:e=>zM(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Sq(e,2,8,n),stringify:e=>p5e(e,8,"0o")},g5e={identify:zM,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Sq(e,0,10,n),stringify:_f},b5e={identify:e=>zM(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Sq(e,2,16,n),stringify:e=>p5e(e,16,"0x")},XNt=[uO,dO,UM,QM,kq,m5e,g5e,b5e,d5e,f5e,h5e];function Xne(e){return typeof e=="bigint"||Number.isInteger(e)}const M_=({value:e})=>JSON.stringify(e),YNt=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:M_},{identify:e=>e==null,createNode:()=>new wi(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:M_},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:M_},{identify:Xne,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Xne(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:M_}],ZNt={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},JNt=[uO,dO].concat(YNt,ZNt),Eq={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),i=new Uint8Array(n.length);for(let r=0;r1&&t("Each pair must have its own sequence indicator");const r=i.items[0]||new sc(new wi(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore} ${r.key.commentBefore}`:i.commentBefore),i.comment){const s=r.value??r.key;s.comment=s.comment?`${i.comment} -${s.comment}`:i.comment}i=r}e.items[n]=Ra(i)?i:new oc(i)}}else t("Expected a sequence for this tag");return e}function v5e(e,t,n){const{replacer:i}=n,r=new g0(e);r.tag="tag:yaml.org,2002:pairs";let s=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof i=="function"&&(o=i.call(t,String(s++),o));let l,c;if(Array.isArray(o))if(o.length===2)l=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const u=Object.keys(o);if(u.length===1)l=u[0],c=o[l];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else l=o;r.items.push(Oq(l,c,n))}return r}const Cq={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:y5e,createNode:v5e};class dw extends g0{constructor(){super(),this.add=dd.prototype.add.bind(this),this.delete=dd.prototype.delete.bind(this),this.get=dd.prototype.get.bind(this),this.has=dd.prototype.has.bind(this),this.set=dd.prototype.set.bind(this),this.tag=dw.tag}toJSON(t,n){if(!n)return super.toJSON(t);const i=new Map;n!=null&&n.onCreate&&n.onCreate(i);for(const r of this.items){let s,o;if(Ra(r)?(s=Sd(r.key,"",n),o=Sd(r.value,s,n)):s=Sd(r,"",n),i.has(s))throw new Error("Ordered maps must not include duplicate keys");i.set(s,o)}return i}static from(t,n,i){const r=v5e(t,n,i),s=new this;return s.items=r.items,s}}dw.tag="tag:yaml.org,2002:omap";const Aq={collection:"seq",identify:e=>e instanceof Map,nodeClass:dw,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=y5e(e,t),i=[];for(const{key:r}of n.items)Os(r)&&(i.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new dw,n)},createNode:(e,t,n)=>dw.from(e,t,n)};function x5e({value:e,source:t},n){return t&&(e?w5e:O5e).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const w5e={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Oi(!0),stringify:x5e},O5e={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Oi(!1),stringify:x5e},eRt={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:jf},tRt={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():jf(e)}},nRt={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new Oi(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const i=e.substring(n+1).replace(/_/g,"");i[i.length-1]==="0"&&(t.minFractionDigits=i.length)}return t},stringify:jf},vT=e=>typeof e=="bigint"||Number.isInteger(e);function zM(e,t,n,{intAsBigInt:i}){const r=e[0];if((r==="-"||r==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),i){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const o=BigInt(e);return r==="-"?BigInt(-1)*o:o}const s=parseInt(e,n);return r==="-"?-1*s:s}function Tq(e,t,n){const{value:i}=e;if(vT(i)){const r=i.toString(t);return i<0?"-"+n+r.substr(1):n+r}return jf(e)}const iRt={identify:vT,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>zM(e,2,2,n),stringify:e=>Tq(e,2,"0b")},rRt={identify:vT,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>zM(e,1,8,n),stringify:e=>Tq(e,8,"0")},sRt={identify:vT,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>zM(e,0,10,n),stringify:jf},aRt={identify:vT,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>zM(e,2,16,n),stringify:e=>Tq(e,16,"0x")};class fw extends dd{constructor(t){super(t),this.tag=fw.tag}add(t){let n;Ra(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new oc(t.key,null):n=new oc(t,null),jy(this.items,n.key)||this.items.push(n)}get(t,n){const i=jy(this.items,t);return!n&&Ra(i)?Os(i.key)?i.key.value:i.key:i}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const i=jy(this.items,t);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new oc(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,i){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,i);throw new Error("Set items must all have null values")}static from(t,n,i){const{replacer:r}=i,s=new this(t);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof r=="function"&&(o=r.call(n,o,o)),s.items.push(Oq(o,null,i));return s}}fw.tag="tag:yaml.org,2002:set";const _q={collection:"map",identify:e=>e instanceof Set,nodeClass:fw,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>fw.from(e,t,n),resolve(e,t){if(bT(e)){if(e.hasAllNullValues(!0))return Object.assign(new fw,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function jq(e,t){const n=e[0],i=n==="-"||n==="+"?e.substring(1):e,r=o=>t?BigInt(o):Number(o),s=i.replace(/_/g,"").split(":").reduce((o,l)=>o*r(60)+r(l),r(0));return n==="-"?r(-1)*s:s}function k5e(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return jf(e);let i="";t<0&&(i="-",t*=n(-1));const r=n(60),s=[t%r];return t<60?s.unshift(0):(t=(t-s[0])/r,s.unshift(t%r),t>=60&&(t=(t-s[0])/r,s.unshift(t))),i+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const S5e={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>jq(e,n),stringify:k5e},E5e={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>jq(e,!1),stringify:k5e},VM={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(VM.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,i,r,s,o,l]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0;let u=Date.UTC(n,i-1,r,s||0,o||0,l||0,c);const d=t[8];if(d&&d!=="Z"){let f=jq(d,!1);Math.abs(f)<30&&(f*=60),u-=6e4*f}return new Date(u)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},Yne=[lO,cO,BM,UM,w5e,O5e,iRt,rRt,sRt,aRt,eRt,tRt,nRt,Eq,Up,Aq,Cq,_q,S5e,E5e,VM],Zne=new Map([["core",XNt],["failsafe",[lO,cO,BM]],["json",JNt],["yaml11",Yne],["yaml-1.1",Yne]]),Jne={binary:Eq,bool:kq,float:h5e,floatExp:f5e,floatNaN:d5e,floatTime:E5e,int:g5e,intHex:b5e,intOct:m5e,intTime:S5e,map:lO,merge:Up,null:UM,omap:Aq,pairs:Cq,seq:cO,set:_q,timestamp:VM},oRt={"tag:yaml.org,2002:binary":Eq,"tag:yaml.org,2002:merge":Up,"tag:yaml.org,2002:omap":Aq,"tag:yaml.org,2002:pairs":Cq,"tag:yaml.org,2002:set":_q,"tag:yaml.org,2002:timestamp":VM};function Q4(e,t,n){const i=Zne.get(t);if(i&&!e)return n&&!i.includes(Up)?i.concat(Up):i.slice();let r=i;if(!r)if(Array.isArray(e))r=[];else{const s=Array.from(Zne.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${s} or define customTags array`)}if(Array.isArray(e))for(const s of e)r=r.concat(s);else typeof e=="function"&&(r=e(r.slice()));return n&&(r=r.concat(Up)),r.reduce((s,o)=>{const l=typeof o=="string"?Jne[o]:o;if(!l){const c=JSON.stringify(o),u=Object.keys(Jne).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${u}`)}return s.includes(l)||s.push(l),s},[])}const lRt=(e,t)=>e.keyt.key?1:0;let cRt=class C5e{constructor({compat:t,customTags:n,merge:i,resolveKnownTags:r,schema:s,sortMapEntries:o,toStringDefaults:l}){this.compat=Array.isArray(t)?Q4(t,"compat"):t?Q4(null,t):null,this.name=typeof s=="string"&&s||"core",this.knownTags=r?oRt:{},this.tags=Q4(n,this.name,i),this.toStringOptions=l??null,Object.defineProperty(this,Fg,{value:lO}),Object.defineProperty(this,Sh,{value:BM}),Object.defineProperty(this,sO,{value:cO}),this.sortMapEntries=typeof o=="function"?o:o===!0?lRt:null}clone(){const t=Object.create(C5e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function uRt(e,t){var c;const n=[];let i=t.directives===!0;if(t.directives!==!1&&e.directives){const u=e.directives.toString(e);u?(n.push(u),i=!0):e.directives.docStart&&(i=!0)}i&&n.push("---");const r=s5e(e,t),{commentString:s}=r.options;if(e.commentBefore){n.length!==1&&n.unshift("");const u=s(e.commentBefore);n.unshift(Ap(u,""))}let o=!1,l=null;if(e.contents){if(Na(e.contents)){if(e.contents.spaceBefore&&i&&n.push(""),e.contents.commentBefore){const f=s(e.contents.commentBefore);n.push(Ap(f,""))}r.forceBlockIndent=!!e.comment,l=e.contents.comment}const u=l?void 0:()=>o=!0;let d=s1(e.contents,r,()=>l=null,u);l&&(d+=_y(d,"",s(l))),(d[0]==="|"||d[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${d}`:n.push(d)}else n.push(s1(e.contents,r));if((c=e.directives)!=null&&c.docEnd)if(e.comment){const u=s(e.comment);u.includes(` -`)?(n.push("..."),n.push(Ap(u,""))):n.push(`... ${u}`)}else n.push("...");else{let u=e.comment;u&&o&&(u=u.replace(/^\n+/,"")),u&&((!o||l)&&n[n.length-1]!==""&&n.push(""),n.push(Ap(s(u),"")))}return n.join(` +${s.comment}`:i.comment}i=r}e.items[n]=ja(i)?i:new sc(i)}}else t("Expected a sequence for this tag");return e}function v5e(e,t,n){const{replacer:i}=n,r=new v0(e);r.tag="tag:yaml.org,2002:pairs";let s=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof i=="function"&&(o=i.call(t,String(s++),o));let l,c;if(Array.isArray(o))if(o.length===2)l=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const u=Object.keys(o);if(u.length===1)l=u[0],c=o[l];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else l=o;r.items.push(Oq(l,c,n))}return r}const Cq={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:y5e,createNode:v5e};class hw extends v0{constructor(){super(),this.add=ud.prototype.add.bind(this),this.delete=ud.prototype.delete.bind(this),this.get=ud.prototype.get.bind(this),this.has=ud.prototype.has.bind(this),this.set=ud.prototype.set.bind(this),this.tag=hw.tag}toJSON(t,n){if(!n)return super.toJSON(t);const i=new Map;n!=null&&n.onCreate&&n.onCreate(i);for(const r of this.items){let s,o;if(ja(r)?(s=kd(r.key,"",n),o=kd(r.value,s,n)):s=kd(r,"",n),i.has(s))throw new Error("Ordered maps must not include duplicate keys");i.set(s,o)}return i}static from(t,n,i){const r=v5e(t,n,i),s=new this;return s.items=r.items,s}}hw.tag="tag:yaml.org,2002:omap";const Aq={collection:"seq",identify:e=>e instanceof Map,nodeClass:hw,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=y5e(e,t),i=[];for(const{key:r}of n.items)xs(r)&&(i.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new hw,n)},createNode:(e,t,n)=>hw.from(e,t,n)};function x5e({value:e,source:t},n){return t&&(e?w5e:O5e).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const w5e={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new wi(!0),stringify:x5e},O5e={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new wi(!1),stringify:x5e},eRt={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:_f},tRt={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():_f(e)}},nRt={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new wi(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const i=e.substring(n+1).replace(/_/g,"");i[i.length-1]==="0"&&(t.minFractionDigits=i.length)}return t},stringify:_f},ST=e=>typeof e=="bigint"||Number.isInteger(e);function VM(e,t,n,{intAsBigInt:i}){const r=e[0];if((r==="-"||r==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),i){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const o=BigInt(e);return r==="-"?BigInt(-1)*o:o}const s=parseInt(e,n);return r==="-"?-1*s:s}function Tq(e,t,n){const{value:i}=e;if(ST(i)){const r=i.toString(t);return i<0?"-"+n+r.substr(1):n+r}return _f(e)}const iRt={identify:ST,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>VM(e,2,2,n),stringify:e=>Tq(e,2,"0b")},rRt={identify:ST,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>VM(e,1,8,n),stringify:e=>Tq(e,8,"0")},sRt={identify:ST,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>VM(e,0,10,n),stringify:_f},aRt={identify:ST,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>VM(e,2,16,n),stringify:e=>Tq(e,16,"0x")};class pw extends ud{constructor(t){super(t),this.tag=pw.tag}add(t){let n;ja(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new sc(t.key,null):n=new sc(t,null),Iy(this.items,n.key)||this.items.push(n)}get(t,n){const i=Iy(this.items,t);return!n&&ja(i)?xs(i.key)?i.key.value:i.key:i}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const i=Iy(this.items,t);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new sc(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,i){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,i);throw new Error("Set items must all have null values")}static from(t,n,i){const{replacer:r}=i,s=new this(t);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof r=="function"&&(o=r.call(n,o,o)),s.items.push(Oq(o,null,i));return s}}pw.tag="tag:yaml.org,2002:set";const _q={collection:"map",identify:e=>e instanceof Set,nodeClass:pw,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>pw.from(e,t,n),resolve(e,t){if(OT(e)){if(e.hasAllNullValues(!0))return Object.assign(new pw,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function jq(e,t){const n=e[0],i=n==="-"||n==="+"?e.substring(1):e,r=o=>t?BigInt(o):Number(o),s=i.replace(/_/g,"").split(":").reduce((o,l)=>o*r(60)+r(l),r(0));return n==="-"?r(-1)*s:s}function k5e(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return _f(e);let i="";t<0&&(i="-",t*=n(-1));const r=n(60),s=[t%r];return t<60?s.unshift(0):(t=(t-s[0])/r,s.unshift(t%r),t>=60&&(t=(t-s[0])/r,s.unshift(t))),i+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const S5e={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>jq(e,n),stringify:k5e},E5e={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>jq(e,!1),stringify:k5e},HM={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(HM.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,i,r,s,o,l]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0;let u=Date.UTC(n,i-1,r,s||0,o||0,l||0,c);const d=t[8];if(d&&d!=="Z"){let f=jq(d,!1);Math.abs(f)<30&&(f*=60),u-=6e4*f}return new Date(u)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},Yne=[uO,dO,UM,QM,w5e,O5e,iRt,rRt,sRt,aRt,eRt,tRt,nRt,Eq,Fp,Aq,Cq,_q,S5e,E5e,HM],Zne=new Map([["core",XNt],["failsafe",[uO,dO,UM]],["json",JNt],["yaml11",Yne],["yaml-1.1",Yne]]),Jne={binary:Eq,bool:kq,float:h5e,floatExp:f5e,floatNaN:d5e,floatTime:E5e,int:g5e,intHex:b5e,intOct:m5e,intTime:S5e,map:uO,merge:Fp,null:QM,omap:Aq,pairs:Cq,seq:dO,set:_q,timestamp:HM},oRt={"tag:yaml.org,2002:binary":Eq,"tag:yaml.org,2002:merge":Fp,"tag:yaml.org,2002:omap":Aq,"tag:yaml.org,2002:pairs":Cq,"tag:yaml.org,2002:set":_q,"tag:yaml.org,2002:timestamp":HM};function Q4(e,t,n){const i=Zne.get(t);if(i&&!e)return n&&!i.includes(Fp)?i.concat(Fp):i.slice();let r=i;if(!r)if(Array.isArray(e))r=[];else{const s=Array.from(Zne.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${s} or define customTags array`)}if(Array.isArray(e))for(const s of e)r=r.concat(s);else typeof e=="function"&&(r=e(r.slice()));return n&&(r=r.concat(Fp)),r.reduce((s,o)=>{const l=typeof o=="string"?Jne[o]:o;if(!l){const c=JSON.stringify(o),u=Object.keys(Jne).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${u}`)}return s.includes(l)||s.push(l),s},[])}const lRt=(e,t)=>e.keyt.key?1:0;let cRt=class C5e{constructor({compat:t,customTags:n,merge:i,resolveKnownTags:r,schema:s,sortMapEntries:o,toStringDefaults:l}){this.compat=Array.isArray(t)?Q4(t,"compat"):t?Q4(null,t):null,this.name=typeof s=="string"&&s||"core",this.knownTags=r?oRt:{},this.tags=Q4(n,this.name,i),this.toStringOptions=l??null,Object.defineProperty(this,$g,{value:uO}),Object.defineProperty(this,Eh,{value:UM}),Object.defineProperty(this,oO,{value:dO}),this.sortMapEntries=typeof o=="function"?o:o===!0?lRt:null}clone(){const t=Object.create(C5e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function uRt(e,t){var c;const n=[];let i=t.directives===!0;if(t.directives!==!1&&e.directives){const u=e.directives.toString(e);u?(n.push(u),i=!0):e.directives.docStart&&(i=!0)}i&&n.push("---");const r=s5e(e,t),{commentString:s}=r.options;if(e.commentBefore){n.length!==1&&n.unshift("");const u=s(e.commentBefore);n.unshift(Ep(u,""))}let o=!1,l=null;if(e.contents){if(_a(e.contents)){if(e.contents.spaceBefore&&i&&n.push(""),e.contents.commentBefore){const f=s(e.contents.commentBefore);n.push(Ep(f,""))}r.forceBlockIndent=!!e.comment,l=e.contents.comment}const u=l?void 0:()=>o=!0;let d=o1(e.contents,r,()=>l=null,u);l&&(d+=Ry(d,"",s(l))),(d[0]==="|"||d[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${d}`:n.push(d)}else n.push(o1(e.contents,r));if((c=e.directives)!=null&&c.docEnd)if(e.comment){const u=s(e.comment);u.includes(` +`)?(n.push("..."),n.push(Ep(u,""))):n.push(`... ${u}`)}else n.push("...");else{let u=e.comment;u&&o&&(u=u.replace(/^\n+/,"")),u&&((!o||l)&&n[n.length-1]!==""&&n.push(""),n.push(Ep(s(u),"")))}return n.join(` `)+` -`}class xT{constructor(t,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,jd,{value:f9});let r=null;typeof n=="function"||Array.isArray(n)?r=n:i===void 0&&n&&(i=n,n=void 0);const s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=s;let{version:o}=s;i!=null&&i._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Zl({version:o}),this.setSchema(o,i),this.contents=t===void 0?null:this.createNode(t,r,i)}clone(){const t=Object.create(xT.prototype,{[jd]:{value:f9}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=Na(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Bv(this.contents)&&this.contents.add(t)}addIn(t,n){Bv(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const i=e5e(this);t.anchor=!n||i.has(n)?t5e(n||"a",i):n}return new xq(t.anchor)}createNode(t,n,i){let r;if(typeof n=="function")t=n.call({"":t},"",t),r=n;else if(Array.isArray(n)){const v=w=>typeof w=="number"||w instanceof String||w instanceof Number,y=n.filter(v).map(String);y.length>0&&(n=n.concat(y)),r=n}else i===void 0&&n&&(i=n,n=void 0);const{aliasDuplicateObjects:s,anchorPrefix:o,flow:l,keepUndefined:c,onTagObj:u,tag:d}=i??{},{onAnchor:f,setAnchors:h,sourceObjects:m}=LNt(this,o||"a"),g={aliasDuplicateObjects:s??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:u,replacer:r,schema:this.schema,sourceObjects:m},b=SC(t,d,g);return l&&Ta(b)&&(b.flow=!0),h(),b}createPair(t,n,i={}){const r=this.createNode(t,null,i),s=this.createNode(n,null,i);return new oc(r,s)}delete(t){return Bv(this.contents)?this.contents.delete(t):!1}deleteIn(t){return uS(t)?this.contents==null?!1:(this.contents=null,!0):Bv(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return Ta(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return uS(t)?!n&&Os(this.contents)?this.contents.value:this.contents:Ta(this.contents)?this.contents.getIn(t,n):void 0}has(t){return Ta(this.contents)?this.contents.has(t):!1}hasIn(t){return uS(t)?this.contents!==void 0:Ta(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=DI(this.schema,[t],n):Bv(this.contents)&&this.contents.set(t,n)}setIn(t,n){uS(t)?this.contents=n:this.contents==null?this.contents=DI(this.schema,Array.from(t),n):Bv(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let i;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Zl({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new Zl({version:t}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{const r=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(i)this.schema=new cRt(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:i,maxAliasCount:r,onAnchor:s,reviver:o}={}){const l={anchors:new Map,doc:this,keep:!t,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=Sd(this.contents,n??"",l);if(typeof s=="function")for(const{count:u,res:d}of l.anchors.values())s(d,u);return typeof o=="function"?Dx(o,{"":c},"",c):c}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return uRt(this,t)}}function Bv(e){if(Ta(e))return!0;throw new Error("Expected a YAML collection as document contents")}class A5e extends Error{constructor(t,n,i,r){super(),this.name=t,this.code=i,this.message=r,this.pos=n}}class dS extends A5e{constructor(t,n,i){super("YAMLParseError",t,n,i)}}class dRt extends A5e{constructor(t,n,i){super("YAMLWarning",t,n,i)}}const eie=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(l=>t.linePos(l));const{line:i,col:r}=n.linePos[0];n.message+=` at line ${i}, column ${r}`;let s=r-1,o=e.substring(t.lineStarts[i-1],t.lineStarts[i]).replace(/[\n\r]+$/,"");if(s>=60&&o.length>80){const l=Math.min(s-39,o.length-79);o="…"+o.substring(l),s-=l-1}if(o.length>80&&(o=o.substring(0,79)+"…"),i>1&&/^ *$/.test(o.substring(0,s))){let l=e.substring(t.lineStarts[i-2],t.lineStarts[i-1]);l.length>80&&(l=l.substring(0,79)+`… +`}class ET{constructor(t,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,_d,{value:f9});let r=null;typeof n=="function"||Array.isArray(n)?r=n:i===void 0&&n&&(i=n,n=void 0);const s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=s;let{version:o}=s;i!=null&&i._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Xl({version:o}),this.setSchema(o,i),this.contents=t===void 0?null:this.createNode(t,r,i)}clone(){const t=Object.create(ET.prototype,{[_d]:{value:f9}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=_a(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Qv(this.contents)&&this.contents.add(t)}addIn(t,n){Qv(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const i=e5e(this);t.anchor=!n||i.has(n)?t5e(n||"a",i):n}return new xq(t.anchor)}createNode(t,n,i){let r;if(typeof n=="function")t=n.call({"":t},"",t),r=n;else if(Array.isArray(n)){const v=w=>typeof w=="number"||w instanceof String||w instanceof Number,y=n.filter(v).map(String);y.length>0&&(n=n.concat(y)),r=n}else i===void 0&&n&&(i=n,n=void 0);const{aliasDuplicateObjects:s,anchorPrefix:o,flow:l,keepUndefined:c,onTagObj:u,tag:d}=i??{},{onAnchor:f,setAnchors:h,sourceObjects:m}=LNt(this,o||"a"),g={aliasDuplicateObjects:s??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:u,replacer:r,schema:this.schema,sourceObjects:m},b=_C(t,d,g);return l&&Ca(b)&&(b.flow=!0),h(),b}createPair(t,n,i={}){const r=this.createNode(t,null,i),s=this.createNode(n,null,i);return new sc(r,s)}delete(t){return Qv(this.contents)?this.contents.delete(t):!1}deleteIn(t){return mS(t)?this.contents==null?!1:(this.contents=null,!0):Qv(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return Ca(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return mS(t)?!n&&xs(this.contents)?this.contents.value:this.contents:Ca(this.contents)?this.contents.getIn(t,n):void 0}has(t){return Ca(this.contents)?this.contents.has(t):!1}hasIn(t){return mS(t)?this.contents!==void 0:Ca(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=MI(this.schema,[t],n):Qv(this.contents)&&this.contents.set(t,n)}setIn(t,n){mS(t)?this.contents=n:this.contents==null?this.contents=MI(this.schema,Array.from(t),n):Qv(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let i;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Xl({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new Xl({version:t}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{const r=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(i)this.schema=new cRt(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:i,maxAliasCount:r,onAnchor:s,reviver:o}={}){const l={anchors:new Map,doc:this,keep:!t,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=kd(this.contents,n??"",l);if(typeof s=="function")for(const{count:u,res:d}of l.anchors.values())s(d,u);return typeof o=="function"?Lx(o,{"":c},"",c):c}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return uRt(this,t)}}function Qv(e){if(Ca(e))return!0;throw new Error("Expected a YAML collection as document contents")}class A5e extends Error{constructor(t,n,i,r){super(),this.name=t,this.code=i,this.message=r,this.pos=n}}class gS extends A5e{constructor(t,n,i){super("YAMLParseError",t,n,i)}}class dRt extends A5e{constructor(t,n,i){super("YAMLWarning",t,n,i)}}const eie=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(l=>t.linePos(l));const{line:i,col:r}=n.linePos[0];n.message+=` at line ${i}, column ${r}`;let s=r-1,o=e.substring(t.lineStarts[i-1],t.lineStarts[i]).replace(/[\n\r]+$/,"");if(s>=60&&o.length>80){const l=Math.min(s-39,o.length-79);o="…"+o.substring(l),s-=l-1}if(o.length>80&&(o=o.substring(0,79)+"…"),i>1&&/^ *$/.test(o.substring(0,s))){let l=e.substring(t.lineStarts[i-2],t.lineStarts[i-1]);l.length>80&&(l=l.substring(0,79)+`… `),o=l+o}if(/[^ ]/.test(o)){let l=1;const c=n.linePos[1];(c==null?void 0:c.line)===i&&c.col>r&&(l=Math.max(1,Math.min(c.col-r,80-s)));const u=" ".repeat(s)+"^".repeat(l);n.message+=`: ${o} ${u} -`}};function a1(e,{flow:t,indicator:n,next:i,offset:r,onError:s,parentIndent:o,startOnNewline:l}){let c=!1,u=l,d=l,f="",h="",m=!1,g=!1,b=null,v=null,y=null,w=null,x=null,O=null,k=null;for(const E of e)switch(g&&(E.type!=="space"&&E.type!=="newline"&&E.type!=="comma"&&s(E.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g=!1),b&&(u&&E.type!=="comment"&&E.type!=="newline"&&s(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),b=null),E.type){case"space":!t&&(n!=="doc-start"||(i==null?void 0:i.type)!=="flow-collection")&&E.source.includes(" ")&&(b=E),d=!0;break;case"comment":{d||s(E,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const j=E.source.substring(1)||" ";f?f+=h+j:f=j,h="",u=!1;break}case"newline":u?f?f+=E.source:(!O||n!=="seq-item-ind")&&(c=!0):h+=E.source,u=!0,m=!0,(v||y)&&(w=E),d=!0;break;case"anchor":v&&s(E,"MULTIPLE_ANCHORS","A node can have at most one anchor"),E.source.endsWith(":")&&s(E.offset+E.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),v=E,k??(k=E.offset),u=!1,d=!1,g=!0;break;case"tag":{y&&s(E,"MULTIPLE_TAGS","A node can have at most one tag"),y=E,k??(k=E.offset),u=!1,d=!1,g=!0;break}case n:(v||y)&&s(E,"BAD_PROP_ORDER",`Anchors and tags must be after the ${E.source} indicator`),O&&s(E,"UNEXPECTED_TOKEN",`Unexpected ${E.source} in ${t??"collection"}`),O=E,u=n==="seq-item-ind"||n==="explicit-key-ind",d=!1;break;case"comma":if(t){x&&s(E,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),x=E,u=!1,d=!1;break}default:s(E,"UNEXPECTED_TOKEN",`Unexpected ${E.type} token`),u=!1,d=!1}const S=e[e.length-1],C=S?S.offset+S.source.length:r;return g&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&s(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),b&&(u&&b.indent<=o||(i==null?void 0:i.type)==="block-map"||(i==null?void 0:i.type)==="block-seq")&&s(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:x,found:O,spaceBefore:c,comment:f,hasNewline:m,anchor:v,tag:y,newlineAfterProp:w,end:C,start:k??C}}function EC(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(` -`))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(EC(t.key)||EC(t.value))return!0}return!1;default:return!0}}function g9(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const i=t.end[0];i.indent===e&&(i.source==="]"||i.source==="}")&&EC(t)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function T5e(e,t,n){const{uniqueKeys:i}=e.options;if(i===!1)return!1;const r=typeof i=="function"?i:(s,o)=>s===o||Os(s)&&Os(o)&&s.value===o.value;return t.some(s=>r(s.key,n))}const tie="All mapping items must start at the same column";function fRt({composeNode:e,composeEmptyNode:t},n,i,r,s){var d;const o=(s==null?void 0:s.nodeClass)??dd,l=new o(n.schema);n.atRoot&&(n.atRoot=!1);let c=i.offset,u=null;for(const f of i.items){const{start:h,key:m,sep:g,value:b}=f,v=a1(h,{indicator:"explicit-key-ind",next:m??(g==null?void 0:g[0]),offset:c,onError:r,parentIndent:i.indent,startOnNewline:!0}),y=!v.found;if(y){if(m&&(m.type==="block-seq"?r(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in m&&m.indent!==i.indent&&r(c,"BAD_INDENT",tie)),!v.anchor&&!v.tag&&!g){u=v.end,v.comment&&(l.comment?l.comment+=` -`+v.comment:l.comment=v.comment);continue}(v.newlineAfterProp||EC(m))&&r(m??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((d=v.found)==null?void 0:d.indent)!==i.indent&&r(c,"BAD_INDENT",tie);n.atKey=!0;const w=v.end,x=m?e(n,m,v,r):t(n,w,h,null,v,r);n.schema.compat&&g9(i.indent,m,r),n.atKey=!1,T5e(n,l.items,x)&&r(w,"DUPLICATE_KEY","Map keys must be unique");const O=a1(g??[],{indicator:"map-value-ind",next:b,offset:x.range[2],onError:r,parentIndent:i.indent,startOnNewline:!m||m.type==="block-scalar"});if(c=O.end,O.found){y&&((b==null?void 0:b.type)==="block-map"&&!O.hasNewline&&r(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&v.starte&&(e.type==="block-map"||e.type==="block-seq");function pRt({composeNode:e,composeEmptyNode:t},n,i,r,s){var v;const o=i.start.source==="{",l=o?"flow map":"flow sequence",c=(s==null?void 0:s.nodeClass)??(o?dd:g0),u=new c(n.schema);u.flow=!0;const d=n.atRoot;d&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=i.offset+i.start.source.length;for(let y=0;y0){const y=wT(g,b,n.options.strict,r);y.comment&&(u.comment?u.comment+=` -`+y.comment:u.comment=y.comment),u.range=[i.offset,b,y.offset]}else u.range=[i.offset,b,b];return u}function H4(e,t,n,i,r,s){const o=n.type==="block-map"?fRt(e,t,n,i,s):n.type==="block-seq"?hRt(e,t,n,i,s):pRt(e,t,n,i,s),l=o.constructor;return r==="!"||r===l.tagName?(o.tag=l.tagName,o):(r&&(o.tag=r),o)}function mRt(e,t,n,i,r){var h;const s=i.tag,o=s?t.directives.tagName(s.source,m=>r(s,"TAG_RESOLVE_FAILED",m)):null;if(n.type==="block-seq"){const{anchor:m,newlineAfterProp:g}=i,b=m&&s?m.offset>s.offset?m:s:m??s;b&&(!g||g.offsetm.tag===o&&m.collection===l);if(!c){const m=t.schema.knownTags[o];if((m==null?void 0:m.collection)===l)t.schema.tags.push(Object.assign({},m,{default:!1})),c=m;else return m?r(s,"BAD_COLLECTION_TYPE",`${m.tag} used for ${l} collection, but expects ${m.collection??"scalar"}`,!0):r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),H4(e,t,n,r,o)}const u=H4(e,t,n,r,o,c),d=((h=c.resolve)==null?void 0:h.call(c,u,m=>r(s,"TAG_RESOLVE_FAILED",m),t.options))??u,f=Na(d)?d:new Oi(d);return f.range=u.range,f.tag=o,c!=null&&c.format&&(f.format=c.format),f}function gRt(e,t,n){const i=t.offset,r=bRt(t,e.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};const s=r.mode===">"?Oi.BLOCK_FOLDED:Oi.BLOCK_LITERAL,o=t.source?yRt(t.source):[];let l=o.length;for(let b=o.length-1;b>=0;--b){const v=o[b][1];if(v===""||v==="\r")l=b;else break}if(l===0){const b=r.chomp==="+"&&o.length>0?` +`}};function l1(e,{flow:t,indicator:n,next:i,offset:r,onError:s,parentIndent:o,startOnNewline:l}){let c=!1,u=l,d=l,f="",h="",m=!1,g=!1,b=null,v=null,y=null,w=null,x=null,O=null,k=null;for(const E of e)switch(g&&(E.type!=="space"&&E.type!=="newline"&&E.type!=="comma"&&s(E.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g=!1),b&&(u&&E.type!=="comment"&&E.type!=="newline"&&s(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),b=null),E.type){case"space":!t&&(n!=="doc-start"||(i==null?void 0:i.type)!=="flow-collection")&&E.source.includes(" ")&&(b=E),d=!0;break;case"comment":{d||s(E,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const j=E.source.substring(1)||" ";f?f+=h+j:f=j,h="",u=!1;break}case"newline":u?f?f+=E.source:(!O||n!=="seq-item-ind")&&(c=!0):h+=E.source,u=!0,m=!0,(v||y)&&(w=E),d=!0;break;case"anchor":v&&s(E,"MULTIPLE_ANCHORS","A node can have at most one anchor"),E.source.endsWith(":")&&s(E.offset+E.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),v=E,k??(k=E.offset),u=!1,d=!1,g=!0;break;case"tag":{y&&s(E,"MULTIPLE_TAGS","A node can have at most one tag"),y=E,k??(k=E.offset),u=!1,d=!1,g=!0;break}case n:(v||y)&&s(E,"BAD_PROP_ORDER",`Anchors and tags must be after the ${E.source} indicator`),O&&s(E,"UNEXPECTED_TOKEN",`Unexpected ${E.source} in ${t??"collection"}`),O=E,u=n==="seq-item-ind"||n==="explicit-key-ind",d=!1;break;case"comma":if(t){x&&s(E,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),x=E,u=!1,d=!1;break}default:s(E,"UNEXPECTED_TOKEN",`Unexpected ${E.type} token`),u=!1,d=!1}const S=e[e.length-1],C=S?S.offset+S.source.length:r;return g&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&s(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),b&&(u&&b.indent<=o||(i==null?void 0:i.type)==="block-map"||(i==null?void 0:i.type)==="block-seq")&&s(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:x,found:O,spaceBefore:c,comment:f,hasNewline:m,anchor:v,tag:y,newlineAfterProp:w,end:C,start:k??C}}function jC(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(` +`))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(jC(t.key)||jC(t.value))return!0}return!1;default:return!0}}function g9(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const i=t.end[0];i.indent===e&&(i.source==="]"||i.source==="}")&&jC(t)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function T5e(e,t,n){const{uniqueKeys:i}=e.options;if(i===!1)return!1;const r=typeof i=="function"?i:(s,o)=>s===o||xs(s)&&xs(o)&&s.value===o.value;return t.some(s=>r(s.key,n))}const tie="All mapping items must start at the same column";function fRt({composeNode:e,composeEmptyNode:t},n,i,r,s){var d;const o=(s==null?void 0:s.nodeClass)??ud,l=new o(n.schema);n.atRoot&&(n.atRoot=!1);let c=i.offset,u=null;for(const f of i.items){const{start:h,key:m,sep:g,value:b}=f,v=l1(h,{indicator:"explicit-key-ind",next:m??(g==null?void 0:g[0]),offset:c,onError:r,parentIndent:i.indent,startOnNewline:!0}),y=!v.found;if(y){if(m&&(m.type==="block-seq"?r(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in m&&m.indent!==i.indent&&r(c,"BAD_INDENT",tie)),!v.anchor&&!v.tag&&!g){u=v.end,v.comment&&(l.comment?l.comment+=` +`+v.comment:l.comment=v.comment);continue}(v.newlineAfterProp||jC(m))&&r(m??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((d=v.found)==null?void 0:d.indent)!==i.indent&&r(c,"BAD_INDENT",tie);n.atKey=!0;const w=v.end,x=m?e(n,m,v,r):t(n,w,h,null,v,r);n.schema.compat&&g9(i.indent,m,r),n.atKey=!1,T5e(n,l.items,x)&&r(w,"DUPLICATE_KEY","Map keys must be unique");const O=l1(g??[],{indicator:"map-value-ind",next:b,offset:x.range[2],onError:r,parentIndent:i.indent,startOnNewline:!m||m.type==="block-scalar"});if(c=O.end,O.found){y&&((b==null?void 0:b.type)==="block-map"&&!O.hasNewline&&r(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&v.starte&&(e.type==="block-map"||e.type==="block-seq");function pRt({composeNode:e,composeEmptyNode:t},n,i,r,s){var v;const o=i.start.source==="{",l=o?"flow map":"flow sequence",c=(s==null?void 0:s.nodeClass)??(o?ud:v0),u=new c(n.schema);u.flow=!0;const d=n.atRoot;d&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=i.offset+i.start.source.length;for(let y=0;y0){const y=CT(g,b,n.options.strict,r);y.comment&&(u.comment?u.comment+=` +`+y.comment:u.comment=y.comment),u.range=[i.offset,b,y.offset]}else u.range=[i.offset,b,b];return u}function H4(e,t,n,i,r,s){const o=n.type==="block-map"?fRt(e,t,n,i,s):n.type==="block-seq"?hRt(e,t,n,i,s):pRt(e,t,n,i,s),l=o.constructor;return r==="!"||r===l.tagName?(o.tag=l.tagName,o):(r&&(o.tag=r),o)}function mRt(e,t,n,i,r){var h;const s=i.tag,o=s?t.directives.tagName(s.source,m=>r(s,"TAG_RESOLVE_FAILED",m)):null;if(n.type==="block-seq"){const{anchor:m,newlineAfterProp:g}=i,b=m&&s?m.offset>s.offset?m:s:m??s;b&&(!g||g.offsetm.tag===o&&m.collection===l);if(!c){const m=t.schema.knownTags[o];if((m==null?void 0:m.collection)===l)t.schema.tags.push(Object.assign({},m,{default:!1})),c=m;else return m?r(s,"BAD_COLLECTION_TYPE",`${m.tag} used for ${l} collection, but expects ${m.collection??"scalar"}`,!0):r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),H4(e,t,n,r,o)}const u=H4(e,t,n,r,o,c),d=((h=c.resolve)==null?void 0:h.call(c,u,m=>r(s,"TAG_RESOLVE_FAILED",m),t.options))??u,f=_a(d)?d:new wi(d);return f.range=u.range,f.tag=o,c!=null&&c.format&&(f.format=c.format),f}function gRt(e,t,n){const i=t.offset,r=bRt(t,e.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};const s=r.mode===">"?wi.BLOCK_FOLDED:wi.BLOCK_LITERAL,o=t.source?yRt(t.source):[];let l=o.length;for(let b=o.length-1;b>=0;--b){const v=o[b][1];if(v===""||v==="\r")l=b;else break}if(l===0){const b=r.chomp==="+"&&o.length>0?` `.repeat(Math.max(1,o.length-1)):"";let v=i+r.length;return t.source&&(v+=t.source.length),{value:b,type:s,comment:r.comment,range:[i,v,v]}}let c=t.indent+r.indent,u=t.offset+r.length,d=0;for(let b=0;bc&&(c=v.length);else{v.length=l;--b)o[b][0].length>c&&(l=b+1);let f="",h="",m=!1;for(let b=0;bc||y[0]===" "?(h===" "?h=` `:!m&&h===` `&&(h=` @@ -683,7 +683,7 @@ ${u} `+o[b][0].slice(c);f[f.length-1]!==` `&&(f+=` `);break;default:f+=` -`}const g=i+r.length+t.source.length;return{value:f,type:s,comment:r.comment,range:[i,g,g]}}function bRt({offset:e,props:t},n,i){if(t[0].type!=="block-scalar-header")return i(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:r}=t[0],s=r[0];let o=0,l="",c=-1;for(let h=1;hn(i+h,m,g);switch(r){case"scalar":l=Oi.PLAIN,c=xRt(s,u);break;case"single-quoted-scalar":l=Oi.QUOTE_SINGLE,c=wRt(s,u);break;case"double-quoted-scalar":l=Oi.QUOTE_DOUBLE,c=ORt(s,u);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[i,i+s.length,i+s.length]}}const d=i+s.length,f=wT(o,d,t,n);return{value:c,type:l,comment:f.comment,range:[i,d,f.offset]}}function xRt(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),_5e(e)}function wRt(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),_5e(e.slice(1,-1)).replace(/''/g,"'")}function _5e(e){let t,n;try{t=new RegExp(`(.*?)(?n(i+h,m,g);switch(r){case"scalar":l=wi.PLAIN,c=xRt(s,u);break;case"single-quoted-scalar":l=wi.QUOTE_SINGLE,c=wRt(s,u);break;case"double-quoted-scalar":l=wi.QUOTE_DOUBLE,c=ORt(s,u);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[i,i+s.length,i+s.length]}}const d=i+s.length,f=CT(o,d,t,n);return{value:c,type:l,comment:f.comment,range:[i,d,f.offset]}}function xRt(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),_5e(e)}function wRt(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),_5e(e.slice(1,-1)).replace(/''/g,"'")}function _5e(e){let t,n;try{t=new RegExp(`(.*?)(?i(n,"TAG_RESOLVE_FAILED",f)):null;let u;e.options.stringKeys&&e.atKey?u=e.schema[Sh]:c?u=CRt(e.schema,r,c,n,i):t.type==="scalar"?u=ARt(e,r,t,i):u=e.schema[Sh];let d;try{const f=u.resolve(r,h=>i(n??t,"TAG_RESOLVE_FAILED",h),e.options);d=Os(f)?f:new Oi(f)}catch(f){const h=f instanceof Error?f.message:String(f);i(n??t,"TAG_RESOLVE_FAILED",h),d=new Oi(r)}return d.range=l,d.source=r,s&&(d.type=s),c&&(d.tag=c),u.format&&(d.format=u.format),o&&(d.comment=o),d}function CRt(e,t,n,i,r){var l;if(n==="!")return e[Sh];const s=[];for(const c of e.tags)if(!c.collection&&c.tag===n)if(c.default&&c.test)s.push(c);else return c;for(const c of s)if((l=c.test)!=null&&l.test(t))return c;const o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[Sh])}function ARt({atKey:e,directives:t,schema:n},i,r,s){const o=n.tags.find(l=>{var c;return(l.default===!0||e&&l.default==="key")&&((c=l.test)==null?void 0:c.test(i))})||n[Sh];if(n.compat){const l=n.compat.find(c=>{var u;return c.default&&((u=c.test)==null?void 0:u.test(i))})??n[Sh];if(o.tag!==l.tag){const c=t.tagString(o.tag),u=t.tagString(l.tag),d=`Value may be parsed as either ${c} or ${u}`;s(r,"TAG_RESOLVE_FAILED",d,!0)}}return o}function TRt(e,t,n){if(t){n??(n=t.length);for(let i=n-1;i>=0;--i){let r=t[i];switch(r.type){case"space":case"comment":case"newline":e-=r.source.length;continue}for(r=t[++i];(r==null?void 0:r.type)==="space";)e+=r.source.length,r=t[++i];break}}return e}const _Rt={composeNode:N5e,composeEmptyNode:Nq};function N5e(e,t,n,i){const r=e.atKey,{spaceBefore:s,comment:o,anchor:l,tag:c}=n;let u,d=!0;switch(t.type){case"alias":u=jRt(e,t,i),(l||c)&&i(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":u=j5e(e,t,c,i),l&&(u.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=mRt(_Rt,e,t,n,i),l&&(u.anchor=l.source.substring(1))}catch(f){const h=f instanceof Error?f.message:String(f);i(t,"RESOURCE_EXHAUSTION",h)}break;default:{const f=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;i(t,"UNEXPECTED_TOKEN",f),d=!1}}return u??(u=Nq(e,t.offset,void 0,null,n,i)),l&&u.anchor===""&&i(l,"BAD_ALIAS","Anchor cannot be an empty string"),r&&e.options.stringKeys&&(!Os(u)||typeof u.value!="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str")&&i(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(u.spaceBefore=!0),o&&(t.type==="scalar"&&t.source===""?u.comment=o:u.commentBefore=o),e.options.keepSourceTokens&&d&&(u.srcToken=t),u}function Nq(e,t,n,i,{spaceBefore:r,comment:s,anchor:o,tag:l,end:c},u){const d={type:"scalar",offset:TRt(t,n,i),indent:-1,source:""},f=j5e(e,d,l,u);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&u(o,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(f.spaceBefore=!0),s&&(f.comment=s,f.range[2]=c),f}function jRt({options:e},{offset:t,source:n,end:i},r){const s=new xq(n.substring(1));s.source===""&&r(t,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&r(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=t+n.length,l=wT(i,o,e.strict,r);return s.range=[t,o,l.offset],l.comment&&(s.comment=l.comment),s}function NRt(e,t,{offset:n,start:i,value:r,end:s},o){const l=Object.assign({_directives:t},e),c=new xT(void 0,l),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=a1(i,{indicator:"doc-start",next:r??(s==null?void 0:s[0]),offset:n,onError:o,parentIndent:0,startOnNewline:!0});d.found&&(c.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!d.hasNewline&&o(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=r?N5e(u,r,d,o):Nq(u,d.end,i,null,d,o);const f=c.contents.range[2],h=wT(s,f,!1,o);return h.comment&&(c.comment=h.comment),c.range=[n,f,h.offset],c}function gk(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function nie(e){var r;let t="",n=!1,i=!1;for(let s=0;si(n,"TAG_RESOLVE_FAILED",f)):null;let u;e.options.stringKeys&&e.atKey?u=e.schema[Eh]:c?u=CRt(e.schema,r,c,n,i):t.type==="scalar"?u=ARt(e,r,t,i):u=e.schema[Eh];let d;try{const f=u.resolve(r,h=>i(n??t,"TAG_RESOLVE_FAILED",h),e.options);d=xs(f)?f:new wi(f)}catch(f){const h=f instanceof Error?f.message:String(f);i(n??t,"TAG_RESOLVE_FAILED",h),d=new wi(r)}return d.range=l,d.source=r,s&&(d.type=s),c&&(d.tag=c),u.format&&(d.format=u.format),o&&(d.comment=o),d}function CRt(e,t,n,i,r){var l;if(n==="!")return e[Eh];const s=[];for(const c of e.tags)if(!c.collection&&c.tag===n)if(c.default&&c.test)s.push(c);else return c;for(const c of s)if((l=c.test)!=null&&l.test(t))return c;const o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[Eh])}function ARt({atKey:e,directives:t,schema:n},i,r,s){const o=n.tags.find(l=>{var c;return(l.default===!0||e&&l.default==="key")&&((c=l.test)==null?void 0:c.test(i))})||n[Eh];if(n.compat){const l=n.compat.find(c=>{var u;return c.default&&((u=c.test)==null?void 0:u.test(i))})??n[Eh];if(o.tag!==l.tag){const c=t.tagString(o.tag),u=t.tagString(l.tag),d=`Value may be parsed as either ${c} or ${u}`;s(r,"TAG_RESOLVE_FAILED",d,!0)}}return o}function TRt(e,t,n){if(t){n??(n=t.length);for(let i=n-1;i>=0;--i){let r=t[i];switch(r.type){case"space":case"comment":case"newline":e-=r.source.length;continue}for(r=t[++i];(r==null?void 0:r.type)==="space";)e+=r.source.length,r=t[++i];break}}return e}const _Rt={composeNode:N5e,composeEmptyNode:Nq};function N5e(e,t,n,i){const r=e.atKey,{spaceBefore:s,comment:o,anchor:l,tag:c}=n;let u,d=!0;switch(t.type){case"alias":u=jRt(e,t,i),(l||c)&&i(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":u=j5e(e,t,c,i),l&&(u.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=mRt(_Rt,e,t,n,i),l&&(u.anchor=l.source.substring(1))}catch(f){const h=f instanceof Error?f.message:String(f);i(t,"RESOURCE_EXHAUSTION",h)}break;default:{const f=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;i(t,"UNEXPECTED_TOKEN",f),d=!1}}return u??(u=Nq(e,t.offset,void 0,null,n,i)),l&&u.anchor===""&&i(l,"BAD_ALIAS","Anchor cannot be an empty string"),r&&e.options.stringKeys&&(!xs(u)||typeof u.value!="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str")&&i(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(u.spaceBefore=!0),o&&(t.type==="scalar"&&t.source===""?u.comment=o:u.commentBefore=o),e.options.keepSourceTokens&&d&&(u.srcToken=t),u}function Nq(e,t,n,i,{spaceBefore:r,comment:s,anchor:o,tag:l,end:c},u){const d={type:"scalar",offset:TRt(t,n,i),indent:-1,source:""},f=j5e(e,d,l,u);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&u(o,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(f.spaceBefore=!0),s&&(f.comment=s,f.range[2]=c),f}function jRt({options:e},{offset:t,source:n,end:i},r){const s=new xq(n.substring(1));s.source===""&&r(t,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&r(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=t+n.length,l=CT(i,o,e.strict,r);return s.range=[t,o,l.offset],l.comment&&(s.comment=l.comment),s}function NRt(e,t,{offset:n,start:i,value:r,end:s},o){const l=Object.assign({_directives:t},e),c=new ET(void 0,l),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=l1(i,{indicator:"doc-start",next:r??(s==null?void 0:s[0]),offset:n,onError:o,parentIndent:0,startOnNewline:!0});d.found&&(c.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!d.hasNewline&&o(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=r?N5e(u,r,d,o):Nq(u,d.end,i,null,d,o);const f=c.contents.range[2],h=CT(s,f,!1,o);return h.comment&&(c.comment=h.comment),c.range=[n,f,h.offset],c}function wk(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function nie(e){var r;let t="",n=!1,i=!1;for(let s=0;s{const o=gk(n);s?this.warnings.push(new dRt(o,i,r)):this.errors.push(new dS(o,i,r))},this.directives=new Zl({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:i,afterEmptyLine:r}=nie(this.prelude);if(i){const s=t.contents;if(n)t.comment=t.comment?`${t.comment} -${i}`:i;else if(r||t.directives.docStart||!s)t.commentBefore=i;else if(Ta(s)&&!s.flow&&s.items.length>0){let o=s.items[0];Ra(o)&&(o=o.key);const l=o.commentBefore;o.commentBefore=l?`${i} +`)+(o.substring(1)||" "),n=!0,i=!1;break;case"%":((r=e[s+1])==null?void 0:r[0])!=="#"&&(s+=1),n=!1;break;default:n||(i=!0),n=!1}}return{comment:t,afterEmptyLine:i}}let RRt=class{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,i,r,s)=>{const o=wk(n);s?this.warnings.push(new dRt(o,i,r)):this.errors.push(new gS(o,i,r))},this.directives=new Xl({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:i,afterEmptyLine:r}=nie(this.prelude);if(i){const s=t.contents;if(n)t.comment=t.comment?`${t.comment} +${i}`:i;else if(r||t.directives.docStart||!s)t.commentBefore=i;else if(Ca(s)&&!s.flow&&s.items.length>0){let o=s.items[0];ja(o)&&(o=o.key);const l=o.commentBefore;o.commentBefore=l?`${i} ${l}`:i}else{const o=s.commentBefore;s.commentBefore=o?`${i} -${o}`:i}}if(n){for(let s=0;s{const s=gk(t);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",i,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=NRt(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,i=new dS(gk(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){const i="Unexpected doc-end without preceding document";this.errors.push(new dS(gk(t),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;const n=wT(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const i=this.doc.comment;this.doc.comment=i?`${i} -${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new dS(gk(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const i=Object.assign({_directives:this.directives},this.options),r=new xT(void 0,i);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}};const R5e="\uFEFF",I5e="",P5e="",b9="";function IRt(e){switch(e){case R5e:return"byte-order-mark";case I5e:return"doc-mode";case P5e:return"flow-error-end";case b9:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` +${o}`:i}}if(n){for(let s=0;s{const s=wk(t);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",i,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=NRt(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,i=new gS(wk(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){const i="Unexpected doc-end without preceding document";this.errors.push(new gS(wk(t),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;const n=CT(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const i=this.doc.comment;this.doc.comment=i?`${i} +${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new gS(wk(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const i=Object.assign({_directives:this.directives},this.options),r=new ET(void 0,i);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}};const R5e="\uFEFF",I5e="",P5e="",b9="";function IRt(e){switch(e){case R5e:return"byte-order-mark";case I5e:return"doc-mode";case P5e:return"flow-error-end";case b9:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` `:case`\r -`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function Kd(e){switch(e){case void 0:case" ":case` -`:case"\r":case" ":return!0;default:return!1}}const iie=new Set("0123456789ABCDEFabcdef"),PRt=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),M_=new Set(",[]{}"),DRt=new Set(` ,[]{} +`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function Wd(e){switch(e){case void 0:case" ":case` +`:case"\r":case" ":return!0;default:return!1}}const iie=new Set("0123456789ABCDEFabcdef"),PRt=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),L_=new Set(",[]{}"),DRt=new Set(` ,[]{} \r `),q4=e=>!e||DRt.has(e);class MRt{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let i=this.next??"stream";for(;i&&(n||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===` `?!0:n==="\r"?this.buffer[t+1]===` `:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let i=0;for(;n===" ";)n=this.buffer[++i+t];if(n==="\r"){const r=this.buffer[i+t+1];if(r===` `||!r&&!this.atEnd)return t+i+1}return n===` -`||i>=this.indentNext||!n&&!this.atEnd?t+i:-1}if(n==="-"||n==="."){const i=this.buffer.substr(t,3);if((i==="---"||i==="...")&&Kd(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&tthis.indentValue&&!Kd(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&Kd(n)){const i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(q4),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,i=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=i=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const r=this.getLine();if(r===null)return this.setNext("flow");if((i!==-1&&i=this.indentNext||!n&&!this.atEnd?t+i:-1}if(n==="-"||n==="."){const i=this.buffer.substr(t,3);if((i==="---"||i==="...")&&Wd(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&tthis.indentValue&&!Wd(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&Wd(n)){const i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(q4),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,i=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=i=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const r=this.getLine();if(r===null)return this.setNext("flow");if((i!==-1&&i"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>Kd(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,i;e:for(let s=this.pos;i=this.buffer[s];++s)switch(i){case" ":n+=1;break;case` +`,s)}r!==-1&&(n=r-(i[r-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const n=this.buffer[++t];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>Wd(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,i;e:for(let s=this.pos;i=this.buffer[s];++s)switch(i){case" ":n+=1;break;case` `:t=s,n=0;break;case"\r":{const o=this.buffer[s+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===` `)break}default:break e}if(!i&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const s=this.continueScalar(t+1);if(s===-1)break;t=this.buffer.indexOf(` `,s)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let r=t+1;for(i=this.buffer[r];i===" ";)i=this.buffer[++r];if(i===" "){for(;i===" "||i===" "||i==="\r"||i===` `;)i=this.buffer[++r];t=r-1}else if(!this.blockScalarKeep)do{let s=t-1,o=this.buffer[s];o==="\r"&&(o=this.buffer[--s]);const l=s;for(;o===" ";)o=this.buffer[--s];if(o===` -`&&s>=this.pos&&s+1+n>l)t=s;else break}while(!0);return yield b9,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,i=this.pos-1,r;for(;r=this.buffer[++i];)if(r===":"){const s=this.buffer[i+1];if(Kd(s)||t&&M_.has(s))break;n=i}else if(Kd(r)){let s=this.buffer[i+1];if(r==="\r"&&(s===` +`&&s>=this.pos&&s+1+n>l)t=s;else break}while(!0);return yield b9,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,i=this.pos-1,r;for(;r=this.buffer[++i];)if(r===":"){const s=this.buffer[i+1];if(Wd(s)||t&&L_.has(s))break;n=i}else if(Wd(r)){let s=this.buffer[i+1];if(r==="\r"&&(s===` `?(i+=1,r=` -`,s=this.buffer[i+1]):n=i),s==="#"||t&&M_.has(s))break;if(r===` -`){const o=this.continueScalar(i+1);if(o===-1)break;i=Math.max(i,o-2)}}else{if(t&&M_.has(r))break;n=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield b9,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const i=this.buffer.slice(this.pos,t);return i?(yield i,this.pos+=i.length,i.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(q4),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,i=this.charAt(1);if(Kd(i)||n&&M_.has(i)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!Kd(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(PRt.has(n))n=this.buffer[++t];else if(n==="%"&&iie.has(this.buffer[t+1])&&iie.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===` +`,s=this.buffer[i+1]):n=i),s==="#"||t&&L_.has(s))break;if(r===` +`){const o=this.continueScalar(i+1);if(o===-1)break;i=Math.max(i,o-2)}}else{if(t&&L_.has(r))break;n=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield b9,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const i=this.buffer.slice(this.pos,t);return i?(yield i,this.pos+=i.length,i.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(q4),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,i=this.charAt(1);if(Wd(i)||n&&L_.has(i)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!Wd(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(PRt.has(n))n=this.buffer[++t];else if(n==="%"&&iie.has(this.buffer[t+1])&&iie.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===` `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===` -`?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,i;do i=this.buffer[++n];while(i===" "||t&&i===" ");const r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(t){let n=this.pos,i=this.buffer[n];for(;!t(i);)i=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class LRt{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,i=this.lineStarts.length;for(;n>1;this.lineStarts[s]=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=e[++t])==null?void 0:n.type)==="space";);return e.splice(t,e.length)}function LI(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&(t==null?void 0:t.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const i=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in i?i.indent:0:n.type==="flow-collection"&&i.type==="document"&&(n.indent=0),n.type==="flow-collection"&&sie(n),i.type){case"document":i.value=n;break;case"block-scalar":i.props.push(n);break;case"block-map":{const r=i.items[i.items.length-1];if(r.value){i.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{const r=i.items[i.items.length-1];r.value?i.items.push({start:[],value:n}):r.value=n;break}case"flow-collection":{const r=i.items[i.items.length-1];!r||r.value?i.items.push({start:[],key:n,sep:[]}):r.sep?r.value=n:Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const r=n.items[n.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&rie(r.start)===-1&&(n.indent===0||r.start.every(s=>s.type!=="comment"||s.indent0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(t){let n=this.pos,i=this.buffer[n];for(;!t(i);)i=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class LRt{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,i=this.lineStarts.length;for(;n>1;this.lineStarts[s]=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=e[++t])==null?void 0:n.type)==="space";);return e.splice(t,e.length)}function $I(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&(t==null?void 0:t.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const i=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in i?i.indent:0:n.type==="flow-collection"&&i.type==="document"&&(n.indent=0),n.type==="flow-collection"&&sie(n),i.type){case"document":i.value=n;break;case"block-scalar":i.props.push(n);break;case"block-map":{const r=i.items[i.items.length-1];if(r.value){i.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{const r=i.items[i.items.length-1];r.value?i.items.push({start:[],value:n}):r.value=n;break}case"flow-collection":{const r=i.items[i.items.length-1];!r||r.value?i.items.push({start:[],key:n,sep:[]}):r.sep?r.value=n:Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const r=n.items[n.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&rie(r.start)===-1&&(n.indent===0||r.start.every(s=>s.type!=="comment"||s.indent=t.indent){const r=!this.onKeyLine&&this.indent===t.indent,s=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let o=[];if(s&&n.sep&&!n.value){const l=[];for(let c=0;ct.indent&&(l.length=0);break;default:l.length=0}}l.length>=2&&(o=n.sep.splice(l[1]))}switch(this.type){case"anchor":case"tag":s||n.value?(o.push(this.sourceToken),t.items.push({start:o}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):s||n.value?(o.push(this.sourceToken),t.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Xm(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(D5e(n.key)&&!Xm(n.sep,"newline")){const l=Uv(n.start),c=n.key,u=n.sep;u.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:c,sep:u}]})}else o.length>0?n.sep=n.sep.concat(o,this.sourceToken):n.sep.push(this.sourceToken);else if(Xm(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const l=Uv(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||s?t.items.push({start:o,key:null,sep:[this.sourceToken]}):Xm(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const l=this.flowScalar(this.type);s||n.value?(t.items.push({start:o,key:l,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(l):(Object.assign(n,{key:l,sep:[]}),this.onKeyLine=!0);return}default:{const l=this.startBlockValue(t);if(l){if(l.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Xm(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&t.items.push({start:o});this.stack.push(l);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var i;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const r="end"in n.value?n.value.end:void 0,s=Array.isArray(r)?r[r.length-1]:void 0;(s==null?void 0:s.type)==="comment"?r==null||r.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const r=t.items[t.items.length-2],s=(i=r==null?void 0:r.value)==null?void 0:i.end;if(Array.isArray(s)){LI(s,n.start),s.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||Xm(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const r=this.startBlockValue(t);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while((i==null?void 0:i.type)==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const r=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const i=this.startBlockValue(t);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{const i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===t.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){const r=L_(i),s=Uv(r);sie(t);const o=t.end.splice(1,t.end.length);o.push(this.sourceToken);const l={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:s,key:t,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(` +`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){var i;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const r="end"in n.value?n.value.end:void 0,s=Array.isArray(r)?r[r.length-1]:void 0;(s==null?void 0:s.type)==="comment"?r==null||r.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const r=t.items[t.items.length-2],s=(i=r==null?void 0:r.value)==null?void 0:i.end;if(Array.isArray(s)){$I(s,n.start),s.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const r=!this.onKeyLine&&this.indent===t.indent,s=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let o=[];if(s&&n.sep&&!n.value){const l=[];for(let c=0;ct.indent&&(l.length=0);break;default:l.length=0}}l.length>=2&&(o=n.sep.splice(l[1]))}switch(this.type){case"anchor":case"tag":s||n.value?(o.push(this.sourceToken),t.items.push({start:o}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):s||n.value?(o.push(this.sourceToken),t.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Gm(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(D5e(n.key)&&!Gm(n.sep,"newline")){const l=zv(n.start),c=n.key,u=n.sep;u.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:c,sep:u}]})}else o.length>0?n.sep=n.sep.concat(o,this.sourceToken):n.sep.push(this.sourceToken);else if(Gm(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const l=zv(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||s?t.items.push({start:o,key:null,sep:[this.sourceToken]}):Gm(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const l=this.flowScalar(this.type);s||n.value?(t.items.push({start:o,key:l,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(l):(Object.assign(n,{key:l,sep:[]}),this.onKeyLine=!0);return}default:{const l=this.startBlockValue(t);if(l){if(l.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Gm(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&t.items.push({start:o});this.stack.push(l);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var i;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const r="end"in n.value?n.value.end:void 0,s=Array.isArray(r)?r[r.length-1]:void 0;(s==null?void 0:s.type)==="comment"?r==null||r.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const r=t.items[t.items.length-2],s=(i=r==null?void 0:r.value)==null?void 0:i.end;if(Array.isArray(s)){$I(s,n.start),s.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||Gm(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const r=this.startBlockValue(t);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while((i==null?void 0:i.type)==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const r=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const i=this.startBlockValue(t);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{const i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===t.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){const r=$_(i),s=zv(r);sie(t);const o=t.end.splice(1,t.end.length);o.push(this.sourceToken);const l={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:s,key:t,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(` `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(` -`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=L_(t),i=Uv(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=L_(t),i=Uv(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};function FRt(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new LRt||null,prettyErrors:t}}function M5e(e,t={}){const{lineCounter:n,prettyErrors:i}=FRt(t),r=new $Rt(n==null?void 0:n.addNewLine),s=new RRt(t);let o=null;for(const l of s.compose(r.parse(e),!0,e.length))if(!o)o=l;else if(o.options.logLevel!=="silent"){o.errors.push(new dS(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(o.errors.forEach(eie(e,n)),o.warnings.forEach(eie(e,n))),o}function BRt(e,t,n){let i;const r=M5e(e,n);if(!r)return null;if(r.warnings.forEach(s=>a5e(r.options.logLevel,s)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:i},n))}function HM(e,t,n){let i=null;if(typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){const r=Math.round(n);n=r<1?void 0:r>8?{indent:8}:{indent:r}}if(e===void 0){const{keepUndefined:r}=n??t??{};if(!r)return}return gT(e)&&!i?e.toString(n):new xT(e,i,n).toString(n)}const L5e=1024;let URt=0,pd=class{constructor(t,n){this.from=t,this.to=n}};class ci{constructor(t={}){this.id=URt++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=t.combine||null}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof t!="function"&&(t=Za.match(t)),n=>{let i=t(n);return i===void 0?null:[this,i]}}}ci.closedBy=new ci({deserialize:e=>e.split(" ")});ci.openedBy=new ci({deserialize:e=>e.split(" ")});ci.group=new ci({deserialize:e=>e.split(" ")});ci.isolate=new ci({deserialize:e=>{if(e&&e!="rtl"&&e!="ltr"&&e!="auto")throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}});ci.contextHash=new ci({perNode:!0});ci.lookAhead=new ci({perNode:!0});ci.mounted=new ci({perNode:!0});class hw{constructor(t,n,i,r=!1){this.tree=t,this.overlay=n,this.parser=i,this.bracketed=r}static get(t){return t&&t.props&&t.props[ci.mounted.id]}}const QRt=Object.create(null);class Za{constructor(t,n,i,r=0){this.name=t,this.props=n,this.id=i,this.flags=r}static define(t){let n=t.props&&t.props.length?Object.create(null):QRt,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),r=new Za(t.name||"",n,t.id,i);if(t.props){for(let s of t.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[s[0].id]=s[1]}}return r}prop(t){return this.props[t.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(t){if(typeof t=="string"){if(this.name==t)return!0;let n=this.prop(ci.group);return n?n.indexOf(t)>-1:!1}return this.id==t}static match(t){let n=Object.create(null);for(let i in t)for(let r of i.split(" "))n[r]=t[i];return i=>{for(let r=i.prop(ci.group),s=-1;s<(r?r.length:0);s++){let o=n[s<0?i.name:r[s]];if(o)return o}}}}Za.none=new Za("",Object.create(null),0,8);class uO{constructor(t){this.types=t;for(let n=0;n0;for(let c=this.cursor(o|Er.IncludeAnonymous);;){let u=!1;if(c.from<=s&&c.to>=r&&(!l&&c.type.isAnonymous||n(c)!==!1)){if(c.firstChild())continue;u=!0}for(;u&&i&&(l||!c.type.isAnonymous)&&i(c),!c.nextSibling();){if(!c.parent())return;u=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let n in this.props)t.push([+n,this.props[n]]);return t}balance(t={}){return this.children.length<=8?this:Pq(Za.none,this.children,this.positions,0,this.children.length,0,this.length,(n,i,r)=>new Ui(this.type,n,i,r,this.propValues),t.makeTree||((n,i,r)=>new Ui(Za.none,n,i,r)))}static build(t){return qRt(t)}}Ui.empty=new Ui(Za.none,[],[],0);class Rq{constructor(t,n){this.buffer=t,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Rq(this.buffer,this.index)}}class fb{constructor(t,n,i){this.buffer=t,this.length=n,this.set=i}get type(){return Za.none}toString(){let t=[];for(let n=0;n0));c=o[c+3]);return l}slice(t,n,i){let r=this.buffer,s=new Uint16Array(n-t),o=0;for(let l=t,c=0;l=t&&nt;case 1:return n<=t&&i>t;case 2:return i>t;case 4:return!0}}function CC(e,t,n,i){for(var r;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to0?l.length:-1;t!=u;t+=n){let d=l[t],f=c[t]+o.from,h;if(!(!(s&Er.EnterBracketed&&d instanceof Ui&&(h=hw.get(d))&&!h.overlay&&h.bracketed&&i>=f&&i<=f+d.length)&&!$5e(r,i,f,f+d.length))){if(d instanceof fb){if(s&Er.ExcludeBuffers)continue;let m=d.findChild(0,d.buffer.length,n,i-f,r);if(m>-1)return new ah(new zRt(o,d,t,f),null,m)}else if(s&Er.IncludeAnonymous||!d.type.isAnonymous||Iq(d)){let m;if(!(s&Er.IgnoreMounts)&&(m=hw.get(d))&&!m.overlay)return new Rl(m.tree,f,t,o);let g=new Rl(d,f,t,o);return s&Er.IncludeAnonymous||!g.type.isAnonymous?g:g.nextChild(n<0?d.children.length-1:0,n,i,r,s)}}}if(s&Er.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?t=o.index+n:t=n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}prop(t){return this._tree.prop(t)}enter(t,n,i=0){let r;if(!(i&Er.IgnoreOverlays)&&(r=hw.get(this._tree))&&r.overlay){let s=t-this.from,o=i&Er.EnterBracketed&&r.bracketed;for(let{from:l,to:c}of r.overlay)if((n>0||o?l<=s:l=s:c>s))return new Rl(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,i)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function oie(e,t,n,i){let r=e.cursor(),s=[];if(!r.firstChild())return s;if(n!=null){for(let o=!1;!o;)if(o=r.type.is(n),!r.nextSibling())return s}for(;;){if(i!=null&&r.type.is(i))return s;if(r.type.is(t)&&s.push(r.node),!r.nextSibling())return i==null?s:[]}}function y9(e,t,n=t.length-1){for(let i=e;n>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(t[n]&&t[n]!=i.name)return!1;n--}}return!0}class zRt{constructor(t,n,i,r){this.parent=t,this.buffer=n,this.index=i,this.start=r}}class ah extends F5e{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,n,i){super(),this.context=t,this._parent=n,this.index=i,this.type=t.buffer.set.types[t.buffer.buffer[i]]}child(t,n,i){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t,n-this.context.start,i);return s<0?null:new ah(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}prop(t){return this.type.prop(t)}enter(t,n,i=0){if(i&Er.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return s<0?null:new ah(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new ah(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new ah(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],n=[],{buffer:i}=this.context,r=this.index+4,s=i.buffer[this.index+3];if(s>r){let o=i.buffer[this.index+1];t.push(i.slice(r,s,o)),n.push(0)}return new Ui(this.type,t,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function B5e(e){if(!e.length)return null;let t=0,n=e[0];for(let s=1;sn.from||o.to=t){let l=new Rl(o.tree,o.overlay[0].from+s.from,-1,s);(r||(r=[i])).push(CC(l,t,n,!1))}}return r?B5e(r):i}class $I{get name(){return this.type.name}constructor(t,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~Er.EnterBracketed,t instanceof Rl)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let i=t._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=t,this.yieldBuf(t.index)}}yieldNode(t){return t?(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0):!1}yieldBuf(t,n){this.index=t;let{start:i,buffer:r}=this.buffer;return this.type=n||r.set.types[r.buffer[t]],this.from=i+r.buffer[t+1],this.to=i+r.buffer[t+2],!0}yield(t){return t?t instanceof Rl?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,n,i){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,n,i,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],t,n-this.buffer.start,i);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,n,i=this.mode){return this.buffer?i&Er.ExcludeBuffers?!1:this.enterChild(1,t,n):this.yield(this._tree.enter(t,n,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Er.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&Er.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode)):!1;let{buffer:n}=this.buffer,i=this.stack.length-1;if(t<0){let r=i<0?0:this.stack[i]+4;if(this.index!=r)return this.yieldBuf(n.findChild(r,this.index,-1,0,4))}else{let r=n.buffer[this.index+3];if(r<(i<0?n.buffer.length:n.buffer[this.stack[i]+3]))return this.yieldBuf(r)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let n,i,{buffer:r}=this;if(r){if(t>0){if(this.index-1)for(let s=n+t,o=t<0?-1:i._tree.children.length;s!=o;s+=t){let l=i._tree.children[s];if(this.mode&Er.IncludeAnonymous||l instanceof fb||!l.type.isAnonymous||Iq(l))return!1}return!0}move(t,n){if(n&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,n=0){for(;(this.from==this.to||(n<1?this.from>=t:this.from>t)||(n>-1?this.to<=t:this.to=0;){for(let o=t;o;o=o._parent)if(o.index==r){if(r==this.index)return o;n=o,i=s+1;break e}r=this.stack[--s]}for(let r=i;r=0;s--){if(s<0)return y9(this._tree,t,r);let o=i[n.buffer[this.stack[s]]];if(!o.isAnonymous){if(t[r]&&t[r]!=o.name)return!1;r--}}return!0}}function Iq(e){return e.children.some(t=>t instanceof fb||!t.type.isAnonymous||Iq(t))}function qRt(e){var t;let{buffer:n,nodeSet:i,maxBufferLength:r=L5e,reused:s=[],minRepeatType:o=i.types.length}=e,l=Array.isArray(n)?new Rq(n,n.length):n,c=i.types,u=0,d=0;function f(k,S,C,E,j,T){let{id:R,start:A,end:N,size:P}=l,I=d,D=u;if(P<0)if(l.next(),P==-1){let z=s[R];C.push(z),E.push(A-k);return}else if(P==-3){u=R;return}else if(P==-4){d=R;return}else throw new RangeError(`Unrecognized record size: ${P}`);let _=c[R],L,F,M=A-k;if(N-A<=r&&(F=v(l.pos-S,j))){let z=new Uint16Array(F.size-F.skip),q=l.pos-F.size,U=z.length;for(;l.pos>q;)U=y(F.start,z,U);L=new fb(z,N-F.start,i),M=F.start-k}else{let z=l.pos-P;l.next();let q=[],U=[],J=R>=o?R:-1,V=0,Z=N;for(;l.pos>z;)J>=0&&l.id==J&&l.size>=0?(l.end<=Z-r&&(g(q,U,A,V,l.end,Z,J,I,D),V=q.length,Z=l.end),l.next()):T>2500?h(A,z,q,U):f(A,z,q,U,J,T+1);if(J>=0&&V>0&&V-1&&V>0){let ne=m(_,D);L=Pq(_,q,U,0,q.length,0,N-A,ne,ne)}else L=b(_,q,U,N-A,I-N,D)}C.push(L),E.push(M)}function h(k,S,C,E){let j=[],T=0,R=-1;for(;l.pos>S;){let{id:A,start:N,end:P,size:I}=l;if(I>4)l.next();else{if(R>-1&&N=0;P-=3)A[I++]=j[P],A[I++]=j[P+1]-N,A[I++]=j[P+2]-N,A[I++]=I;C.push(new fb(A,j[2]-N,i)),E.push(N-k)}}function m(k,S){return(C,E,j)=>{let T=0,R=C.length-1,A,N;if(R>=0&&(A=C[R])instanceof Ui){if(!R&&A.type==k&&A.length==j)return A;(N=A.prop(ci.lookAhead))&&(T=E[R]+A.length+N)}return b(k,C,E,j,T,S)}}function g(k,S,C,E,j,T,R,A,N){let P=[],I=[];for(;k.length>E;)P.push(k.pop()),I.push(S.pop()+C-j);k.push(b(i.types[R],P,I,T-j,A-T,N)),S.push(j-C)}function b(k,S,C,E,j,T,R){if(T){let A=[ci.contextHash,T];R=R?[A].concat(R):[A]}if(j>25){let A=[ci.lookAhead,j];R=R?[A].concat(R):[A]}return new Ui(k,S,C,E,R)}function v(k,S){let C=l.fork(),E=0,j=0,T=0,R=C.end-r,A={size:0,start:0,skip:0};e:for(let N=C.pos-k;C.pos>N;){let P=C.size;if(C.id==S&&P>=0){A.size=E,A.start=j,A.skip=T,T+=4,E+=4,C.next();continue}let I=C.pos-P;if(P<0||I=o?4:0,_=C.start;for(C.next();C.pos>I;){if(C.size<0)if(C.size==-3||C.size==-4)D+=4;else break e;else C.id>=o&&(D+=4);C.next()}j=_,E+=P,T+=D}return(S<0||E==k)&&(A.size=E,A.start=j,A.skip=T),A.size>4?A:void 0}function y(k,S,C){let{id:E,start:j,end:T,size:R}=l;if(l.next(),R>=0&&E4){let N=l.pos-(R-4);for(;l.pos>N;)C=y(k,S,C)}S[--C]=A,S[--C]=T-k,S[--C]=j-k,S[--C]=E}else R==-3?u=E:R==-4&&(d=E);return C}let w=[],x=[];for(;l.pos>0;)f(e.start||0,e.bufferStart||0,w,x,-1,0);let O=(t=e.length)!==null&&t!==void 0?t:w.length?x[0]+w[0].length:0;return new Ui(c[e.topID],w.reverse(),x.reverse(),O)}const lie=new WeakMap;function DN(e,t){if(!e.isAnonymous||t instanceof fb||t.type!=e)return 1;let n=lie.get(t);if(n==null){n=1;for(let i of t.children){if(i.type!=e||!(i instanceof Ui)){n=1;break}n+=DN(e,i)}lie.set(t,n)}return n}function Pq(e,t,n,i,r,s,o,l,c){let u=0;for(let g=i;g=d)break;S+=C}if(x==O+1){if(S>d){let C=g[O];m(C.children,C.positions,0,C.children.length,b[O]+w);continue}f.push(g[O])}else{let C=b[x-1]+g[x-1].length-k;f.push(Pq(e,g,b,O,x,k,C,null,c))}h.push(k+w-s)}}return m(t,n,i,r,0),(l||c)(f,h,o)}class Dq{constructor(){this.map=new WeakMap}setBuffer(t,n,i){let r=this.map.get(t);r||this.map.set(t,r=new Map),r.set(n,i)}getBuffer(t,n){let i=this.map.get(t);return i&&i.get(n)}set(t,n){t instanceof ah?this.setBuffer(t.context.buffer,t.index,n):t instanceof Rl&&this.map.set(t.tree,n)}get(t){return t instanceof ah?this.getBuffer(t.context.buffer,t.index):t instanceof Rl?this.map.get(t.tree):void 0}cursorSet(t,n){t.buffer?this.setBuffer(t.buffer.buffer,t.index,n):this.map.set(t.tree,n)}cursorGet(t){return t.buffer?this.getBuffer(t.buffer.buffer,t.index):this.map.get(t.tree)}}class Qp{constructor(t,n,i,r,s=!1,o=!1){this.from=t,this.to=n,this.tree=i,this.offset=r,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],i=!1){let r=[new Qp(0,t.length,t,0,!1,i)];for(let s of n)s.to>t.length&&r.push(s);return r}static applyChanges(t,n,i=128){if(!n.length)return t;let r=[],s=1,o=t.length?t[0]:null;for(let l=0,c=0,u=0;;l++){let d=l=i)for(;o&&o.from=h.from||f<=h.to||u){let m=Math.max(h.from,c)-u,g=Math.min(h.to,f)-u;h=m>=g?null:new Qp(m,g,h.tree,h.offset+u,l>0,!!d)}if(h&&r.push(h),o.to>f)break;o=snew pd(r.from,r.to)):[new pd(0,0)]:[new pd(0,t.length)],this.createParse(t,n||[],i)}parse(t,n,i){let r=this.startParse(t,n,i);for(;;){let s=r.advance();if(s)return s}}}class WRt{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,n){return this.string.slice(t,n)}}function U5e(e){return(t,n,i,r)=>new GRt(t,e,n,i,r)}class cie{constructor(t,n,i,r,s,o){this.parser=t,this.parse=n,this.overlay=i,this.bracketed=r,this.target=s,this.from=o}}function uie(e){if(!e.length||e.some(t=>t.from>=t.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(e))}class KRt{constructor(t,n,i,r,s,o,l,c){this.parser=t,this.predicate=n,this.mounts=i,this.index=r,this.start=s,this.bracketed=o,this.target=l,this.prev=c,this.depth=0,this.ranges=[]}}const v9=new ci({perNode:!0});class GRt{constructor(t,n,i,r,s){this.nest=n,this.input=i,this.fragments=r,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=t}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new Ui(i.type,i.children,i.positions,i.length,i.propValues.concat([[v9,this.stoppedAt]]))),i}let t=this.inner[this.innerDone],n=t.parse.advance();if(n){this.innerDone++;let i=Object.assign(Object.create(null),t.target.props);i[ci.mounted.id]=new hw(n,t.overlay,t.parser,t.bracketed),t.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let t=this.input.length;for(let n=this.innerDone;n=this.stoppedAt)l=!1;else if(t.hasNode(r)){if(n){let u=n.mounts.find(d=>d.frag.from<=r.from&&d.frag.to>=r.to&&d.mount.overlay);if(u)for(let d of u.mount.overlay){let f=d.from+u.pos,h=d.to+u.pos;f>=r.from&&h<=r.to&&!n.ranges.some(m=>m.fromf)&&n.ranges.push({from:f,to:h})}}l=!1}else if(i&&(o=XRt(i.ranges,r.from,r.to)))l=o!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.fromnew pd(f.from-r.from,f.to-r.from)):null,!!s.bracketed,r.tree,d.length?d[0].from:r.from)),s.overlay?d.length&&(i={ranges:d,depth:0,prev:i}):l=!1}}else if(n&&(c=n.predicate(r))&&(c===!0&&(c=new pd(r.from,r.to)),c.from=0&&n.ranges[u].to==c.from?n.ranges[u]={from:n.ranges[u].from,to:c.to}:n.ranges.push(c)}if(l&&r.firstChild())n&&n.depth++,i&&i.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(n&&!--n.depth){let u=hie(this.ranges,n.ranges);u.length&&(uie(u),this.inner.splice(n.index,0,new cie(n.parser,n.parser.startParse(this.input,pie(n.mounts,u),u),n.ranges.map(d=>new pd(d.from-n.start,d.to-n.start)),n.bracketed,n.target,u[0].from))),n=n.prev}i&&!--i.depth&&(i=i.prev)}}}}function XRt(e,t,n){for(let i of e){if(i.from>=n)break;if(i.to>t)return i.from<=t&&i.to>=n?2:1}return 0}function die(e,t,n,i,r,s){if(t=t&&n.enter(i,1,Er.IgnoreOverlays|Er.ExcludeBuffers)))if(n.to<=t)n.next(!1)||(this.done=!0);else break}hasNode(t){if(this.moveTo(t.from),!this.done&&this.cursor.from+this.offset==t.from&&this.cursor.tree)for(let n=this.cursor.tree;;){if(n==t.tree)return!0;if(n.children.length&&n.positions[0]==0&&n.children[0]instanceof Ui)n=n.children[0];else break}return!1}}let ZRt=class{constructor(t){var n;if(this.fragments=t,this.curTo=0,this.fragI=0,t.length){let i=this.curFrag=t[0];this.curTo=(n=i.tree.prop(v9))!==null&&n!==void 0?n:i.to,this.inner=new fie(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(t){for(;this.curFrag&&t.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=t.from&&this.curTo>=t.to&&this.inner.hasNode(t)}nextFrag(){var t;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let n=this.curFrag=this.fragments[this.fragI];this.curTo=(t=n.tree.prop(v9))!==null&&t!==void 0?t:n.to,this.inner=new fie(n.tree,-n.offset)}}findMounts(t,n){var i;let r=[];if(this.inner){this.inner.cursor.moveTo(t,1);for(let s=this.inner.cursor.node;s;s=s.parent){let o=(i=s.tree)===null||i===void 0?void 0:i.prop(ci.mounted);if(o&&o.parser==n)for(let l=this.fragI;l=s.to)break;c.tree==this.curFrag.tree&&r.push({frag:c,pos:s.from-c.offset,mount:o})}}}return r}};function hie(e,t){let n=null,i=t;for(let r=1,s=0;r=l)break;c.to<=o||(n||(i=n=t.slice()),c.froml&&n.splice(s+1,0,new pd(l,c.to))):c.to>l?n[s--]=new pd(l,c.to):n.splice(s--,1))}}return i}function JRt(e,t,n,i){let r=0,s=0,o=!1,l=!1,c=-1e9,u=[];for(;;){let d=r==e.length?1e9:o?e[r].to:e[r].from,f=s==t.length?1e9:l?t[s].to:t[s].from;if(o!=l){let h=Math.max(c,n),m=Math.min(d,f,i);hnew pd(h.from+i,h.to+i)),f=JRt(t,d,c,u);for(let h=0,m=c;;h++){let g=h==f.length,b=g?u:f[h].from;if(b>m&&n.push(new Qp(m,b,r.tree,-o,s.from>=m||s.openStart,s.to<=b||s.openEnd)),g)break;m=f[h].to}}else n.push(new Qp(c,u,r.tree,-o,s.from>=o||s.openStart,s.to<=l||s.openEnd))}return n}let x9=[],Q5e=[];(()=>{let e="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(t=>t?parseInt(t,36):1);for(let t=0,n=0;t>1;if(e=Q5e[i])t=i+1;else return!0;if(t==n)return!1}}function mie(e){return e>=127462&&e<=127487}const gie=8205;function tIt(e,t,n=!0,i=!0){return(n?z5e:nIt)(e,t,i)}function z5e(e,t,n){if(t==e.length)return t;t&&V5e(e.charCodeAt(t))&&H5e(e.charCodeAt(t-1))&&t--;let i=W4(e,t);for(t+=bie(i);t=0&&mie(W4(e,o));)s++,o-=2;if(s%2==0)break;t+=2}else break}return t}function nIt(e,t,n){for(;t>1;){let i=z5e(e,t-2,n);if(i=56320&&e<57344}function H5e(e){return e>=55296&&e<56320}function bie(e){return e<65536?1:2}let Or=class q5e{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,n,i){[t,n]=o1(this,t,n);let r=[];return this.decompose(0,t,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(n,this.length,r,1),Zf.from(r,this.length-(n-t)+i.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,n=this.length){[t,n]=o1(this,t,n);let i=[];return this.decompose(t,n,i,0),Zf.from(i,n-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let n=this.scanIdentical(t,1),i=this.length-this.scanIdentical(t,-1),r=new hE(this),s=new hE(t);for(let o=n,l=n;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=i)return!0}}iter(t=1){return new hE(this,t)}iterRange(t,n=this.length){return new W5e(this,t,n)}iterLines(t,n){let i;if(t==null)i=this.iter();else{n==null&&(n=this.lines+1);let r=this.line(t).from;i=this.iterRange(r,Math.max(r,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new K5e(i)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(t.length==0)throw new RangeError("A document must have at least one line");return t.length==1&&!t[0]?q5e.empty:t.length<=32?new ka(t):Zf.from(ka.split(t,[]))}};class ka extends Or{constructor(t,n=iIt(t)){super(),this.text=t,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(t,n,i,r){for(let s=0;;s++){let o=this.text[s],l=r+o.length;if((n?i:l)>=t)return new rIt(r,l,i,o);r=l+1,i++}}decompose(t,n,i,r){let s=t<=0&&n>=this.length?this:new ka(yie(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(r&1){let o=i.pop(),l=MN(s.text,o.text.slice(),0,s.length);if(l.length<=32)i.push(new ka(l,o.length+s.length));else{let c=l.length>>1;i.push(new ka(l.slice(0,c)),new ka(l.slice(c)))}}else i.push(s)}replace(t,n,i){if(!(i instanceof ka))return super.replace(t,n,i);[t,n]=o1(this,t,n);let r=MN(this.text,MN(i.text,yie(this.text,0,t)),n),s=this.length+i.length-(n-t);return r.length<=32?new ka(r,s):Zf.from(ka.split(r,[]),s)}sliceString(t,n=this.length,i=` -`){[t,n]=o1(this,t,n);let r="";for(let s=0,o=0;s<=n&&ot&&o&&(r+=i),ts&&(r+=l.slice(Math.max(0,t-s),n-s)),s=c+1}return r}flatten(t){for(let n of this.text)t.push(n)}scanIdentical(){return 0}static split(t,n){let i=[],r=-1;for(let s of t)i.push(s),r+=s.length+1,i.length==32&&(n.push(new ka(i,r)),i=[],r=-1);return r>-1&&n.push(new ka(i,r)),n}}class Zf extends Or{constructor(t,n){super(),this.children=t,this.length=n,this.lines=0;for(let i of t)this.lines+=i.lines}lineInner(t,n,i,r){for(let s=0;;s++){let o=this.children[s],l=r+o.length,c=i+o.lines-1;if((n?c:l)>=t)return o.lineInner(t,n,i,r);r=l+1,i=c+1}}decompose(t,n,i,r){for(let s=0,o=0;o<=n&&s=o){let u=r&((o<=t?1:0)|(c>=n?2:0));o>=t&&c<=n&&!u?i.push(l):l.decompose(t-o,n-o,i,u)}o=c+1}}replace(t,n,i){if([t,n]=o1(this,t,n),i.lines=s&&n<=l){let c=o.replace(t-s,n-s,i),u=this.lines-o.lines+c.lines;if(c.lines>4&&c.lines>u>>6){let d=this.children.slice();return d[r]=c,new Zf(d,this.length-(n-t)+i.length)}return super.replace(s,l,c)}s=l+1}return super.replace(t,n,i)}sliceString(t,n=this.length,i=` -`){[t,n]=o1(this,t,n);let r="";for(let s=0,o=0;st&&s&&(r+=i),to&&(r+=l.sliceString(t-o,n-o,i)),o=c+1}return r}flatten(t){for(let n of this.children)n.flatten(t)}scanIdentical(t,n){if(!(t instanceof Zf))return 0;let i=0,[r,s,o,l]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;r+=n,s+=n){if(r==o||s==l)return i;let c=this.children[r],u=t.children[s];if(c!=u)return i+c.scanIdentical(u,n);i+=c.length+1}}static from(t,n=t.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let m of t)i+=m.lines;if(i<32){let m=[];for(let g of t)g.flatten(m);return new ka(m,n)}let r=Math.max(32,i>>5),s=r<<1,o=r>>1,l=[],c=0,u=-1,d=[];function f(m){let g;if(m.lines>s&&m instanceof Zf)for(let b of m.children)f(b);else m.lines>o&&(c>o||!c)?(h(),l.push(m)):m instanceof ka&&c&&(g=d[d.length-1])instanceof ka&&m.lines+g.lines<=32?(c+=m.lines,u+=m.length+1,d[d.length-1]=new ka(g.text.concat(m.text),g.length+1+m.length)):(c+m.lines>r&&h(),c+=m.lines,u+=m.length+1,d.push(m))}function h(){c!=0&&(l.push(d.length==1?d[0]:Zf.from(d,u)),u=-1,c=d.length=0)}for(let m of t)f(m);return h(),l.length==1?l[0]:new Zf(l,n)}}Or.empty=new ka([""],0);function iIt(e){let t=-1;for(let n of e)t+=n.length+1;return t}function MN(e,t,n=0,i=1e9){for(let r=0,s=0,o=!0;s=n&&(c>i&&(l=l.slice(0,i-r)),r0?1:(t instanceof ka?t.text.length:t.children.length)<<1]}nextInner(t,n){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,r=this.nodes[i],s=this.offsets[i],o=s>>1,l=r instanceof ka?r.text.length:r.children.length;if(o==(n>0?l:0)){if(i==0)return this.done=!0,this.value="",this;n>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(n>0?0:1)){if(this.offsets[i]+=n,t==0)return this.lineBreak=!0,this.value=` -`,this;t--}else if(r instanceof ka){let c=r.text[o+(n<0?-1:0)];if(this.offsets[i]+=n,c.length>Math.max(0,t))return this.value=t==0?c:n>0?c.slice(t):c.slice(0,c.length-t),this;t-=c.length}else{let c=r.children[o+(n<0?-1:0)];t>c.length?(t-=c.length,this.offsets[i]+=n):(n<0&&this.offsets[i]--,this.nodes.push(c),this.offsets.push(n>0?1:(c instanceof ka?c.text.length:c.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class W5e{constructor(t,n,i){this.value="",this.done=!1,this.cursor=new hE(t,n>i?-1:1),this.pos=n>i?t.length:0,this.from=Math.min(n,i),this.to=Math.max(n,i)}nextInner(t,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let i=n<0?this.pos-this.from:this.to-this.pos;t>i&&(t=i),i-=t;let{value:r}=this.cursor.next(t);return this.pos+=(r.length+t)*n,this.value=r.length<=i?r:n<0?r.slice(r.length-i):r.slice(0,i),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class K5e{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:n,lineBreak:i,value:r}=this.inner.next(t);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Or.prototype[Symbol.iterator]=function(){return this.iter()},hE.prototype[Symbol.iterator]=W5e.prototype[Symbol.iterator]=K5e.prototype[Symbol.iterator]=function(){return this});let rIt=class{constructor(t,n,i,r){this.from=t,this.to=n,this.number=i,this.text=r}get length(){return this.to-this.from}};function o1(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function Io(e,t,n=!0,i=!0){return tIt(e,t,n,i)}function sIt(e){return e>=56320&&e<57344}function aIt(e){return e>=55296&&e<56320}function jc(e,t){let n=e.charCodeAt(t);if(!aIt(n)||t+1==e.length)return n;let i=e.charCodeAt(t+1);return sIt(i)?(n-55296<<10)+(i-56320)+65536:n}function Mq(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function Jf(e){return e<65536?1:2}const w9=/\r\n?|\n/;var il=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(il||(il={}));class gh{constructor(t){this.sections=t}get length(){let t=0;for(let n=0;nt)return s+(t-r);s+=l}else{if(i!=il.Simple&&u>=t&&(i==il.TrackDel&&rt||i==il.TrackBefore&&rt))return null;if(u>t||u==t&&n<0&&!l)return t==r||n<0?s:s+c;s+=c}r=u}if(t>r)throw new RangeError(`Position ${t} is out of range for changeset of length ${r}`);return s}touchesRange(t,n=t){for(let i=0,r=0;i=0&&r<=n&&l>=t)return rn?"cover":!0;r=l}return!1}toString(){let t="";for(let n=0;n=0?":"+r:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new gh(t)}static create(t){return new gh(t)}}class lo extends gh{constructor(t,n){super(t),this.inserted=n}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return O9(this,(n,i,r,s,o)=>t=t.replace(r,r+(i-n),o),!1),t}mapDesc(t,n=!1){return k9(this,t,n,!0)}invert(t){let n=this.sections.slice(),i=[];for(let r=0,s=0;r=0){n[r]=l,n[r+1]=o;let c=r>>1;for(;i.length0&&wg(i,n,s.text),s.forward(d),l+=d}let u=t[o++];for(;l>1].toJSON()))}return t}static of(t,n,i){let r=[],s=[],o=0,l=null;function c(d=!1){if(!d&&!r.length)return;oh||f<0||h>n)throw new RangeError(`Invalid change range ${f} to ${h} (in doc of length ${n})`);let g=m?typeof m=="string"?Or.of(m.split(i||w9)):m:Or.empty,b=g.length;if(f==h&&b==0)return;fo&&Tl(r,f-o,-1),Tl(r,h-f,b),wg(s,r,g),o=h}}return u(t),c(!l),l}static empty(t){return new lo(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],i=[];for(let r=0;rl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)n.push(s[0],0);else{for(;i.length=0&&n<=0&&n==e[r+1]?e[r]+=t:r>=0&&t==0&&e[r]==0?e[r+1]+=n:i?(e[r]+=t,e[r+1]+=n):e.push(t,n)}function wg(e,t,n){if(n.length==0)return;let i=t.length-2>>1;if(i>1])),!(n||o==e.sections.length||e.sections[o+1]<0);)l=e.sections[o++],c=e.sections[o++];t(r,u,s,d,f),r=u,s=d}}}function k9(e,t,n,i=!1){let r=[],s=i?[]:null,o=new AC(e),l=new AC(t);for(let c=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let u=Math.min(o.len,l.len);Tl(r,u,-1),o.forward(u),l.forward(u)}else if(l.ins>=0&&(o.ins<0||c==o.i||o.off==0&&(l.len=0&&c=0){let u=0,d=o.len;for(;d;)if(l.ins==-1){let f=Math.min(d,l.len);u+=f,d-=f,l.forward(f)}else if(l.ins==0&&l.lenc||o.ins>=0&&o.len>c)&&(l||i.length>u),s.forward2(c),o.forward(c)}}}}class AC{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i>1;return n>=t.length?Or.empty:t[n]}textBit(t){let{inserted:n}=this.set,i=this.i-2>>1;return i>=n.length&&!t?Or.empty:n[i].slice(this.off,t==null?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){this.ins==-1?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class og{constructor(t,n,i,r){this.from=t,this.to=n,this.flags=i,this.goalColumn=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let t=this.flags&7;return t==7?null:t}map(t,n=-1){let i,r;return this.empty?i=r=t.mapPos(this.from,n):(i=t.mapPos(this.from,1),r=t.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new og(i,r,this.flags,this.goalColumn)}extend(t,n=t,i=0){if(t<=this.anchor&&n>=this.anchor)return ht.range(t,n,void 0,void 0,i);let r=Math.abs(t-this.anchor)>Math.abs(n-this.anchor)?t:n;return ht.range(this.anchor,r,void 0,void 0,i)}eq(t,n=!1){return this.anchor==t.anchor&&this.head==t.head&&this.goalColumn==t.goalColumn&&(!n||!this.empty||this.assoc==t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return ht.range(t.anchor,t.head)}static create(t,n,i,r){return new og(t,n,i,r)}}class ht{constructor(t,n){this.ranges=t,this.mainIndex=n}map(t,n=-1){return t.empty?this:ht.create(this.ranges.map(i=>i.map(t,n)),this.mainIndex)}eq(t,n=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let i=0;it.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!="number"||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new ht(t.ranges.map(n=>og.fromJSON(n)),t.main)}static single(t,n=t){return new ht([ht.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,r=0;rr.from-s.from),n=t.indexOf(i);for(let r=1;rs.head?ht.range(c,l):ht.range(l,c))}}return new ht(t,n)}}function X5e(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let Lq=0;class gn{constructor(t,n,i,r,s){this.combine=t,this.compareInput=n,this.compare=i,this.isStatic=r,this.id=Lq++,this.default=t([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(t={}){return new gn(t.combine||(n=>n),t.compareInput||((n,i)=>n===i),t.compare||(t.combine?(n,i)=>n===i:$q),!!t.static,t.enables)}of(t){return new LN([],this,0,t)}compute(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new LN(t,this,1,n)}computeN(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new LN(t,this,2,n)}from(t,n){return n||(n=i=>i),this.compute([t],i=>n(i.field(t)))}}function $q(e,t){return e==t||e.length==t.length&&e.every((n,i)=>n===t[i])}class LN{constructor(t,n,i,r){this.dependencies=t,this.facet=n,this.type=i,this.value=r,this.id=Lq++}dynamicSlot(t){var n;let i=this.value,r=this.facet.compareInput,s=this.id,o=t[s]>>1,l=this.type==2,c=!1,u=!1,d=[];for(let f of this.dependencies)f=="doc"?c=!0:f=="selection"?u=!0:((n=t[f.id])!==null&&n!==void 0?n:1)&1||d.push(t[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,h){if(c&&h.docChanged||u&&(h.docChanged||h.selection)||S9(f,d)){let m=i(f);if(l?!vie(m,f.values[o],r):!r(m,f.values[o]))return f.values[o]=m,1}return 0},reconfigure:(f,h)=>{let m,g=h.config.address[s];if(g!=null){let b=BI(h,g);if(this.dependencies.every(v=>v instanceof gn?h.facet(v)===f.facet(v):v instanceof dl?h.field(v,!1)==f.field(v,!1):!0)||(l?vie(m=i(f),b,r):r(m=i(f),b)))return f.values[o]=b,0}else m=i(f);return f.values[o]=m,1}}}get extension(){return this}}function vie(e,t,n){if(e.length!=t.length)return!1;for(let i=0;ie[c.id]),r=n.map(c=>c.type),s=i.filter(c=>!(c&1)),o=e[t.id]>>1;function l(c){let u=[];for(let d=0;di===r),t);return t.provide&&(n.provides=t.provide(n)),n}create(t){let n=t.facet(F_).find(i=>i.field==this);return((n==null?void 0:n.create)||this.createF)(t)}slot(t){let n=t[this.id]>>1;return{create:i=>(i.values[n]=this.create(i),1),update:(i,r)=>{let s=i.values[n],o=this.updateF(s,r);return this.compareF(s,o)?0:(i.values[n]=o,1)},reconfigure:(i,r)=>{let s=i.facet(F_),o=r.facet(F_),l;return(l=s.find(c=>c.field==this))&&l!=o.find(c=>c.field==this)?(i.values[n]=l.create(i),1):r.config.address[this.id]!=null?(i.values[n]=r.field(this),0):(i.values[n]=this.create(i),1)}}}init(t){return[this,F_.of({field:this,create:t})]}get extension(){return this}}const yy={lowest:4,low:3,default:2,high:1,highest:0};function bk(e){return t=>new Y5e(t,e)}const ym={highest:bk(yy.highest),high:bk(yy.high),default:bk(yy.default),low:bk(yy.low),lowest:bk(yy.lowest)};class Y5e{constructor(t,n){this.inner=t,this.prec=n}get extension(){return this}}class WM{of(t){return new E9(this,t)}reconfigure(t){return WM.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class E9{constructor(t,n){this.compartment=t,this.inner=n}get extension(){return this}}class FI{constructor(t,n,i,r,s,o){for(this.base=t,this.compartments=n,this.dynamicSlots=i,this.address=r,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(t,n,i){let r=[],s=Object.create(null),o=new Map;for(let h of lIt(t,n,o))h instanceof dl?r.push(h):(s[h.facet.id]||(s[h.facet.id]=[])).push(h);let l=Object.create(null),c=[],u=[];for(let h of r)l[h.id]=u.length<<1,u.push(m=>h.slot(m));let d=i==null?void 0:i.config.facets;for(let h in s){let m=s[h],g=m[0].facet,b=d&&d[h]||[];if(m.every(v=>v.type==0))if(l[g.id]=c.length<<1|1,$q(b,m))c.push(i.facet(g));else{let v=g.combine(m.map(y=>y.value));c.push(i&&g.compare(v,i.facet(g))?i.facet(g):v)}else{for(let v of m)v.type==0?(l[v.id]=c.length<<1|1,c.push(v.value)):(l[v.id]=u.length<<1,u.push(y=>v.dynamicSlot(y)));l[g.id]=u.length<<1,u.push(v=>oIt(v,g,m))}}let f=u.map(h=>h(l));return new FI(t,o,f,l,c,s)}}function lIt(e,t,n){let i=[[],[],[],[],[]],r=new Map;function s(o,l){let c=r.get(o);if(c!=null){if(c<=l)return;let u=i[c].indexOf(o);u>-1&&i[c].splice(u,1),o instanceof E9&&n.delete(o.compartment)}if(r.set(o,l),Array.isArray(o))for(let u of o)s(u,l);else if(o instanceof E9){if(n.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let u=t.get(o.compartment)||o.inner;n.set(o.compartment,u),s(u,l)}else if(o instanceof Y5e)s(o.inner,o.prec);else if(o instanceof dl)i[l].push(o),o.provides&&s(o.provides,l);else if(o instanceof LN)i[l].push(o),o.facet.extensions&&s(o.facet.extensions,yy.default);else{let u=o.extension;if(!u)throw new Error(`Unrecognized extension value in extension set (${o}).`);if(u==o)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(u,l)}}return s(e,yy.default),i.reduce((o,l)=>o.concat(l))}function pE(e,t){if(t&1)return 2;let n=t>>1,i=e.status[n];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;e.status[n]=4;let r=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|r}function BI(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}const Z5e=gn.define(),C9=gn.define({combine:e=>e.some(t=>t),static:!0}),J5e=gn.define({combine:e=>e.length?e[0]:void 0,static:!0}),e3e=gn.define(),t3e=gn.define(),n3e=gn.define(),i3e=gn.define({combine:e=>e.length?e[0]:!1});class Nh{constructor(t,n){this.type=t,this.value=n}static define(){return new cIt}}class cIt{of(t){return new Nh(this,t)}}class uIt{constructor(t){this.map=t}of(t){return new hi(this,t)}}class hi{constructor(t,n){this.type=t,this.value=n}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new hi(this.type,n)}is(t){return this.type==t}static define(t={}){return new uIt(t.map||(n=>n))}static mapEffects(t,n){if(!t.length)return t;let i=[];for(let r of t){let s=r.map(n);s&&i.push(s)}return i}}hi.reconfigure=hi.define();hi.appendConfig=hi.define();class Xa{constructor(t,n,i,r,s,o){this.startState=t,this.changes=n,this.selection=i,this.effects=r,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,i&&X5e(i,n.newLength),s.some(l=>l.type==Xa.time)||(this.annotations=s.concat(Xa.time.of(Date.now())))}static create(t,n,i,r,s,o){return new Xa(t,n,i,r,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let n of this.annotations)if(n.type==t)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(Xa.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]=="."))}}Xa.time=Nh.define();Xa.userEvent=Nh.define();Xa.addToHistory=Nh.define();Xa.remote=Nh.define();function dIt(e,t){let n=[];for(let i=0,r=0;;){let s,o;if(i=e[i]))s=e[i++],o=e[i++];else if(r=0;r--){let s=i[r](e);s instanceof Xa?e=s:Array.isArray(s)&&s.length==1&&s[0]instanceof Xa?e=s[0]:e=s3e(t,pw(s),!1)}return e}function hIt(e){let t=e.startState,n=t.facet(n3e),i=e;for(let r=n.length-1;r>=0;r--){let s=n[r](e);s&&Object.keys(s).length&&(i=r3e(i,A9(t,s,e.changes.newLength),!0))}return i==e?e:Xa.create(t,e.changes,e.selection,i.effects,i.annotations,i.scrollIntoView)}const pIt=[];function pw(e){return e==null?pIt:Array.isArray(e)?e:[e]}var zs=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(zs||(zs={}));const mIt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let T9;try{T9=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function gIt(e){if(T9)return T9.test(e);for(let t=0;t"€"&&(n.toUpperCase()!=n.toLowerCase()||mIt.test(n)))return!0}return!1}function bIt(e){return t=>{if(!/\S/.test(t))return zs.Space;if(gIt(t))return zs.Word;for(let n=0;n-1)return zs.Word;return zs.Other}}class tr{constructor(t,n,i,r,s,o){this.config=t,this.doc=n,this.selection=i,this.values=r,this.status=t.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let l=0;lr.set(u,c)),n=null),r.set(l.value.compartment,l.value.extension)):l.is(hi.reconfigure)?(n=null,i=l.value):l.is(hi.appendConfig)&&(n=null,i=pw(i).concat(l.value));let s;n?s=t.startState.values.slice():(n=FI.resolve(i,r,this),s=new tr(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(c,u)=>u.reconfigure(c,this),null).values);let o=t.startState.facet(C9)?t.newSelection:t.newSelection.asSingle();new tr(n,t.newDoc,o,s,(l,c)=>c.update(l,t),t)}replaceSelection(t){return typeof t=="string"&&(t=this.toText(t)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:t},range:ht.cursor(n.from+t.length)}))}changeByRange(t){let n=this.selection,i=t(n.ranges[0]),r=this.changes(i.changes),s=[i.range],o=pw(i.effects);for(let l=1;lo.spec.fromJSON(l,c)))}}return tr.create({doc:t.doc,selection:ht.fromJSON(t.selection),extensions:n.extensions?r.concat([n.extensions]):r})}static create(t={}){let n=FI.resolve(t.extensions||[],new Map),i=t.doc instanceof Or?t.doc:Or.of((t.doc||"").split(n.staticFacet(tr.lineSeparator)||w9)),r=t.selection?t.selection instanceof ht?t.selection:ht.single(t.selection.anchor,t.selection.head):ht.single(0);return X5e(r,i.length),n.staticFacet(C9)||(r=r.asSingle()),new tr(n,i,r,n.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(tr.tabSize)}get lineBreak(){return this.facet(tr.lineSeparator)||` -`}get readOnly(){return this.facet(i3e)}phrase(t,...n){for(let i of this.facet(tr.phrases))if(Object.prototype.hasOwnProperty.call(i,t)){t=i[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(i,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>n.length?i:n[s-1]})),t}languageDataAt(t,n,i=-1){let r=[];for(let s of this.facet(Z5e))for(let o of s(this,n,i))Object.prototype.hasOwnProperty.call(o,t)&&r.push(o[t]);return r}charCategorizer(t){let n=this.languageDataAt("wordChars",t);return bIt(n.length?n[0]:"")}wordAt(t){let{text:n,from:i,length:r}=this.doc.lineAt(t),s=this.charCategorizer(t),o=t-i,l=t-i;for(;o>0;){let c=Io(n,o,!1);if(s(n.slice(c,o))!=zs.Word)break;o=c}for(;le.length?e[0]:4});tr.lineSeparator=J5e;tr.readOnly=i3e;tr.phrases=gn.define({compare(e,t){let n=Object.keys(e),i=Object.keys(t);return n.length==i.length&&n.every(r=>e[r]==t[r])}});tr.languageData=Z5e;tr.changeFilter=e3e;tr.transactionFilter=t3e;tr.transactionExtender=n3e;WM.reconfigure=hi.define();function Rh(e,t,n={}){let i={};for(let r of e)for(let s of Object.keys(r)){let o=r[s],l=i[s];if(l===void 0)i[s]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(n,s))i[s]=n[s](l,o);else throw new Error("Config merge conflict for field "+s)}for(let r in t)i[r]===void 0&&(i[r]=t[r]);return i}class hb{eq(t){return this==t}range(t,n=t){return TC.create(t,n,this)}}hb.prototype.startSide=hb.prototype.endSide=0;hb.prototype.point=!1;hb.prototype.mapMode=il.TrackDel;function Fq(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}class TC{constructor(t,n,i){this.from=t,this.to=n,this.value=i}static create(t,n,i){return new TC(t,n,i)}}function _9(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class Bq{constructor(t,n,i,r){this.from=t,this.to=n,this.value=i,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(t,n,i,r=0){let s=i?this.to:this.from;for(let o=r,l=s.length;;){if(o==l)return o;let c=o+l>>1,u=s[c]-t||(i?this.value[c].endSide:this.value[c].startSide)-n;if(c==o)return u>=0?o:l;u>=0?l=c:o=c+1}}between(t,n,i,r){for(let s=this.findIndex(n,-1e9,!0),o=this.findIndex(i,1e9,!1,s);sm||h==m&&u.startSide>0&&u.endSide<=0)continue;(m-h||u.endSide-u.startSide)<0||(o<0&&(o=h),u.point&&(l=Math.max(l,m-h)),i.push(u),r.push(h-o),s.push(m-o))}return{mapped:i.length?new Bq(r,s,i,l):null,pos:o}}}class Gi{constructor(t,n,i,r){this.chunkPos=t,this.chunk=n,this.nextLayer=i,this.maxPoint=r}static create(t,n,i,r){return new Gi(t,n,i,r)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let n of this.chunk)t+=n.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:n=[],sort:i=!1,filterFrom:r=0,filterTo:s=this.length}=t,o=t.filter;if(n.length==0&&!o)return this;if(i&&(n=n.slice().sort(_9)),this.isEmpty)return n.length?Gi.of(n):this;let l=new a3e(this,null,-1).goto(0),c=0,u=[],d=new im;for(;l.value||c=0){let f=n[c++];d.addInner(f.from,f.to,f.value)||u.push(f)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||sl.to||s=s&&t<=s+o.length&&o.between(s,t-s,n-s,i)===!1)return}this.nextLayer.between(t,n,i)}}iter(t=0){return _C.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,n=0){return _C.from(t).goto(n)}static compare(t,n,i,r,s=-1){let o=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),l=n.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),c=xie(o,l,i),u=new yk(o,c,s),d=new yk(l,c,s);i.iterGaps((f,h,m)=>wie(u,f,d,h,m,r)),i.empty&&i.length==0&&wie(u,0,d,0,0,r)}static eq(t,n,i=0,r){r==null&&(r=999999999);let s=t.filter(d=>!d.isEmpty&&n.indexOf(d)<0),o=n.filter(d=>!d.isEmpty&&t.indexOf(d)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let l=xie(s,o),c=new yk(s,l,0).goto(i),u=new yk(o,l,0).goto(i);for(;;){if(c.to!=u.to||!j9(c.active,u.active)||c.point&&(!u.point||!Fq(c.point,u.point)))return!1;if(c.to>r)return!0;c.next(),u.next()}}static spans(t,n,i,r,s=-1){let o=new yk(t,null,s).goto(n),l=n,c=o.openStart;for(;;){let u=Math.min(o.to,i);if(o.point){let d=o.activeForPoint(o.to),f=o.pointFroml&&(r.span(l,u,o.active,c),c=o.openEnd(u));if(o.to>i)return c+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(t,n=!1){let i=new im;for(let r of t instanceof TC?[t]:n?yIt(t):t)i.add(r.from,r.to,r.value);return i.finish()}static join(t){if(!t.length)return Gi.empty;let n=t[t.length-1];for(let i=t.length-2;i>=0;i--)for(let r=t[i];r!=Gi.empty;r=r.nextLayer)n=new Gi(r.chunkPos,r.chunk,n,Math.max(r.maxPoint,n.maxPoint));return n}}Gi.empty=new Gi([],[],null,-1);function yIt(e){if(e.length>1)for(let t=e[0],n=1;n0)return e.slice().sort(_9);t=i}return e}Gi.empty.nextLayer=Gi.empty;class im{finishChunk(t){this.chunks.push(new Bq(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,n,i){this.addInner(t,n,i)||(this.nextLayer||(this.nextLayer=new im)).add(t,n,i)}addInner(t,n,i){let r=t-this.lastTo||i.startSide-this.last.endSide;if(r<=0&&(t-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(n-this.chunkStart),this.last=i,this.lastFrom=t,this.lastTo=n,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,n-t)),!0)}addChunk(t,n){if((t-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(t);let i=n.value.length-1;return this.last=n.value[i],this.lastFrom=n.from[i]+t,this.lastTo=n.to[i]+t,!0}finish(){return this.finishInner(Gi.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return t;let n=Gi.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,n}}function xie(e,t,n){let i=new Map;for(let s of e)for(let o=0;o=this.minPoint)break}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&r.push(new a3e(o,n,i,s));return r.length==1?r[0]:new _C(r)}get startSide(){return this.value?this.value.startSide:0}goto(t,n=-1e9){for(let i of this.heap)i.goto(t,n);for(let i=this.heap.length>>1;i>=0;i--)K4(this.heap,i);return this.next(),this}forward(t,n){for(let i of this.heap)i.forward(t,n);for(let i=this.heap.length>>1;i>=0;i--)K4(this.heap,i);(this.to-t||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),K4(this.heap,0)}}}function K4(e,t){for(let n=e[t];;){let i=(t<<1)+1;if(i>=e.length)break;let r=e[i];if(i+1=0&&(r=e[i+1],i++),n.compare(r)<0)break;e[i]=n,e[t]=r,t=i}}class yk{constructor(t,n,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=_C.from(t,n,i)}goto(t,n=-1e9){return this.cursor.goto(t,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=n,this.openStart=-1,this.next(),this}forward(t,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(t,n)}removeActive(t){B_(this.active,t),B_(this.activeTo,t),B_(this.activeRank,t),this.minActive=Oie(this.active,this.activeTo)}addActive(t){let n=0,{value:i,to:r,rank:s}=this.cursor;for(;n0;)n++;U_(this.active,n,i),U_(this.activeTo,n,r),U_(this.activeRank,n,s),t&&U_(t,n,this.cursor.from),this.minActive=Oie(this.active,this.activeTo)}next(){let t=this.to,n=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>t){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&B_(i,r)}else if(this.cursor.value)if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(i),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from=0&&i[r]=0&&!(this.activeRank[i]t||this.activeTo[i]==t&&this.active[i].endSide>=this.point.endSide)&&n.push(this.active[i]);return n.reverse()}openEnd(t){let n=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>t;i--)n++;return n}}function wie(e,t,n,i,r,s){e.goto(t),n.goto(i);let o=i+r,l=i,c=i-t,u=!!s.boundChange;for(let d=!1;;){let f=e.to+c-n.to,h=f||e.endSide-n.endSide,m=h<0?e.to+c:n.to,g=Math.min(m,o);if(e.point||n.point?(e.point&&n.point&&Fq(e.point,n.point)&&j9(e.activeForPoint(e.to),n.activeForPoint(n.to))||s.comparePoint(l,g,e.point,n.point),d=!1):(d&&s.boundChange(l),g>l&&!j9(e.active,n.active)&&s.compareRange(l,g,e.active,n.active),u&&go)break;l=m,h<=0&&e.next(),h>=0&&n.next()}}function j9(e,t){if(e.length!=t.length)return!1;for(let n=0;n=t;i--)e[i+1]=e[i];e[t]=n}function Oie(e,t){let n=-1,i=1e9;for(let r=0;r=t)return r;if(r==e.length)break;s+=e.charCodeAt(r)==9?n-s%n:1,r=Io(e,r)}return i===!0?-1:e.length}const R9="ͼ",kie=typeof Symbol>"u"?"__"+R9:Symbol.for(R9),I9=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Sie=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class pb{constructor(t,n){this.rules=[];let{finish:i}=n||{};function r(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,l,c,u){let d=[],f=/^@(\w+)\b/.exec(o[0]),h=f&&f[1]=="keyframes";if(f&&l==null)return c.push(o[0]+";");for(let m in l){let g=l[m];if(/&/.test(m))s(m.split(/,\s*/).map(b=>o.map(v=>b.replace(/&/,v))).reduce((b,v)=>b.concat(v)),g,c);else if(g&&typeof g=="object"){if(!f)throw new RangeError("The value of a property ("+m+") should be a primitive value.");s(r(m),g,d,h)}else g!=null&&d.push(m.replace(/_.*/,"").replace(/[A-Z]/g,b=>"-"+b.toLowerCase())+": "+g+";")}(d.length||h)&&c.push((i&&!f&&!u?o.map(i):o).join(", ")+" {"+d.join(" ")+"}")}for(let o in t)s(r(o),t[o],this.rules)}getRules(){return this.rules.join(` +`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=$_(t),i=zv(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=$_(t),i=zv(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};function FRt(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new LRt||null,prettyErrors:t}}function M5e(e,t={}){const{lineCounter:n,prettyErrors:i}=FRt(t),r=new $Rt(n==null?void 0:n.addNewLine),s=new RRt(t);let o=null;for(const l of s.compose(r.parse(e),!0,e.length))if(!o)o=l;else if(o.options.logLevel!=="silent"){o.errors.push(new gS(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(o.errors.forEach(eie(e,n)),o.warnings.forEach(eie(e,n))),o}function BRt(e,t,n){let i;const r=M5e(e,n);if(!r)return null;if(r.warnings.forEach(s=>a5e(r.options.logLevel,s)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:i},n))}function qM(e,t,n){let i=null;if(typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){const r=Math.round(n);n=r<1?void 0:r>8?{indent:8}:{indent:r}}if(e===void 0){const{keepUndefined:r}=n??t??{};if(!r)return}return wT(e)&&!i?e.toString(n):new ET(e,i,n).toString(n)}const L5e=1024;let URt=0,hd=class{constructor(t,n){this.from=t,this.to=n}};class ui{constructor(t={}){this.id=URt++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=t.combine||null}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof t!="function"&&(t=Za.match(t)),n=>{let i=t(n);return i===void 0?null:[this,i]}}}ui.closedBy=new ui({deserialize:e=>e.split(" ")});ui.openedBy=new ui({deserialize:e=>e.split(" ")});ui.group=new ui({deserialize:e=>e.split(" ")});ui.isolate=new ui({deserialize:e=>{if(e&&e!="rtl"&&e!="ltr"&&e!="auto")throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}});ui.contextHash=new ui({perNode:!0});ui.lookAhead=new ui({perNode:!0});ui.mounted=new ui({perNode:!0});class mw{constructor(t,n,i,r=!1){this.tree=t,this.overlay=n,this.parser=i,this.bracketed=r}static get(t){return t&&t.props&&t.props[ui.mounted.id]}}const QRt=Object.create(null);class Za{constructor(t,n,i,r=0){this.name=t,this.props=n,this.id=i,this.flags=r}static define(t){let n=t.props&&t.props.length?Object.create(null):QRt,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),r=new Za(t.name||"",n,t.id,i);if(t.props){for(let s of t.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[s[0].id]=s[1]}}return r}prop(t){return this.props[t.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(t){if(typeof t=="string"){if(this.name==t)return!0;let n=this.prop(ui.group);return n?n.indexOf(t)>-1:!1}return this.id==t}static match(t){let n=Object.create(null);for(let i in t)for(let r of i.split(" "))n[r]=t[i];return i=>{for(let r=i.prop(ui.group),s=-1;s<(r?r.length:0);s++){let o=n[s<0?i.name:r[s]];if(o)return o}}}}Za.none=new Za("",Object.create(null),0,8);class fO{constructor(t){this.types=t;for(let n=0;n0;for(let c=this.cursor(o|Sr.IncludeAnonymous);;){let u=!1;if(c.from<=s&&c.to>=r&&(!l&&c.type.isAnonymous||n(c)!==!1)){if(c.firstChild())continue;u=!0}for(;u&&i&&(l||!c.type.isAnonymous)&&i(c),!c.nextSibling();){if(!c.parent())return;u=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let n in this.props)t.push([+n,this.props[n]]);return t}balance(t={}){return this.children.length<=8?this:Pq(Za.none,this.children,this.positions,0,this.children.length,0,this.length,(n,i,r)=>new Bi(this.type,n,i,r,this.propValues),t.makeTree||((n,i,r)=>new Bi(Za.none,n,i,r)))}static build(t){return qRt(t)}}Bi.empty=new Bi(Za.none,[],[],0);class Rq{constructor(t,n){this.buffer=t,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Rq(this.buffer,this.index)}}class db{constructor(t,n,i){this.buffer=t,this.length=n,this.set=i}get type(){return Za.none}toString(){let t=[];for(let n=0;n0));c=o[c+3]);return l}slice(t,n,i){let r=this.buffer,s=new Uint16Array(n-t),o=0;for(let l=t,c=0;l=t&&nt;case 1:return n<=t&&i>t;case 2:return i>t;case 4:return!0}}function NC(e,t,n,i){for(var r;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to0?l.length:-1;t!=u;t+=n){let d=l[t],f=c[t]+o.from,h;if(!(!(s&Sr.EnterBracketed&&d instanceof Bi&&(h=mw.get(d))&&!h.overlay&&h.bracketed&&i>=f&&i<=f+d.length)&&!$5e(r,i,f,f+d.length))){if(d instanceof db){if(s&Sr.ExcludeBuffers)continue;let m=d.findChild(0,d.buffer.length,n,i-f,r);if(m>-1)return new oh(new zRt(o,d,t,f),null,m)}else if(s&Sr.IncludeAnonymous||!d.type.isAnonymous||Iq(d)){let m;if(!(s&Sr.IgnoreMounts)&&(m=mw.get(d))&&!m.overlay)return new jl(m.tree,f,t,o);let g=new jl(d,f,t,o);return s&Sr.IncludeAnonymous||!g.type.isAnonymous?g:g.nextChild(n<0?d.children.length-1:0,n,i,r,s)}}}if(s&Sr.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?t=o.index+n:t=n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}prop(t){return this._tree.prop(t)}enter(t,n,i=0){let r;if(!(i&Sr.IgnoreOverlays)&&(r=mw.get(this._tree))&&r.overlay){let s=t-this.from,o=i&Sr.EnterBracketed&&r.bracketed;for(let{from:l,to:c}of r.overlay)if((n>0||o?l<=s:l=s:c>s))return new jl(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,i)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function oie(e,t,n,i){let r=e.cursor(),s=[];if(!r.firstChild())return s;if(n!=null){for(let o=!1;!o;)if(o=r.type.is(n),!r.nextSibling())return s}for(;;){if(i!=null&&r.type.is(i))return s;if(r.type.is(t)&&s.push(r.node),!r.nextSibling())return i==null?s:[]}}function y9(e,t,n=t.length-1){for(let i=e;n>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(t[n]&&t[n]!=i.name)return!1;n--}}return!0}class zRt{constructor(t,n,i,r){this.parent=t,this.buffer=n,this.index=i,this.start=r}}class oh extends F5e{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,n,i){super(),this.context=t,this._parent=n,this.index=i,this.type=t.buffer.set.types[t.buffer.buffer[i]]}child(t,n,i){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t,n-this.context.start,i);return s<0?null:new oh(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}prop(t){return this.type.prop(t)}enter(t,n,i=0){if(i&Sr.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return s<0?null:new oh(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new oh(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new oh(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],n=[],{buffer:i}=this.context,r=this.index+4,s=i.buffer[this.index+3];if(s>r){let o=i.buffer[this.index+1];t.push(i.slice(r,s,o)),n.push(0)}return new Bi(this.type,t,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function B5e(e){if(!e.length)return null;let t=0,n=e[0];for(let s=1;sn.from||o.to=t){let l=new jl(o.tree,o.overlay[0].from+s.from,-1,s);(r||(r=[i])).push(NC(l,t,n,!1))}}return r?B5e(r):i}class FI{get name(){return this.type.name}constructor(t,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~Sr.EnterBracketed,t instanceof jl)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let i=t._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=t,this.yieldBuf(t.index)}}yieldNode(t){return t?(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0):!1}yieldBuf(t,n){this.index=t;let{start:i,buffer:r}=this.buffer;return this.type=n||r.set.types[r.buffer[t]],this.from=i+r.buffer[t+1],this.to=i+r.buffer[t+2],!0}yield(t){return t?t instanceof jl?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,n,i){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,n,i,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],t,n-this.buffer.start,i);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,n,i=this.mode){return this.buffer?i&Sr.ExcludeBuffers?!1:this.enterChild(1,t,n):this.yield(this._tree.enter(t,n,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Sr.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&Sr.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode)):!1;let{buffer:n}=this.buffer,i=this.stack.length-1;if(t<0){let r=i<0?0:this.stack[i]+4;if(this.index!=r)return this.yieldBuf(n.findChild(r,this.index,-1,0,4))}else{let r=n.buffer[this.index+3];if(r<(i<0?n.buffer.length:n.buffer[this.stack[i]+3]))return this.yieldBuf(r)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let n,i,{buffer:r}=this;if(r){if(t>0){if(this.index-1)for(let s=n+t,o=t<0?-1:i._tree.children.length;s!=o;s+=t){let l=i._tree.children[s];if(this.mode&Sr.IncludeAnonymous||l instanceof db||!l.type.isAnonymous||Iq(l))return!1}return!0}move(t,n){if(n&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,n=0){for(;(this.from==this.to||(n<1?this.from>=t:this.from>t)||(n>-1?this.to<=t:this.to=0;){for(let o=t;o;o=o._parent)if(o.index==r){if(r==this.index)return o;n=o,i=s+1;break e}r=this.stack[--s]}for(let r=i;r=0;s--){if(s<0)return y9(this._tree,t,r);let o=i[n.buffer[this.stack[s]]];if(!o.isAnonymous){if(t[r]&&t[r]!=o.name)return!1;r--}}return!0}}function Iq(e){return e.children.some(t=>t instanceof db||!t.type.isAnonymous||Iq(t))}function qRt(e){var t;let{buffer:n,nodeSet:i,maxBufferLength:r=L5e,reused:s=[],minRepeatType:o=i.types.length}=e,l=Array.isArray(n)?new Rq(n,n.length):n,c=i.types,u=0,d=0;function f(k,S,C,E,j,T){let{id:R,start:A,end:N,size:P}=l,I=d,D=u;if(P<0)if(l.next(),P==-1){let V=s[R];C.push(V),E.push(A-k);return}else if(P==-3){u=R;return}else if(P==-4){d=R;return}else throw new RangeError(`Unrecognized record size: ${P}`);let _=c[R],L,F,M=A-k;if(N-A<=r&&(F=v(l.pos-S,j))){let V=new Uint16Array(F.size-F.skip),q=l.pos-F.size,U=V.length;for(;l.pos>q;)U=y(F.start,V,U);L=new db(V,N-F.start,i),M=F.start-k}else{let V=l.pos-P;l.next();let q=[],U=[],J=R>=o?R:-1,z=0,Z=N;for(;l.pos>V;)J>=0&&l.id==J&&l.size>=0?(l.end<=Z-r&&(g(q,U,A,z,l.end,Z,J,I,D),z=q.length,Z=l.end),l.next()):T>2500?h(A,V,q,U):f(A,V,q,U,J,T+1);if(J>=0&&z>0&&z-1&&z>0){let ne=m(_,D);L=Pq(_,q,U,0,q.length,0,N-A,ne,ne)}else L=b(_,q,U,N-A,I-N,D)}C.push(L),E.push(M)}function h(k,S,C,E){let j=[],T=0,R=-1;for(;l.pos>S;){let{id:A,start:N,end:P,size:I}=l;if(I>4)l.next();else{if(R>-1&&N=0;P-=3)A[I++]=j[P],A[I++]=j[P+1]-N,A[I++]=j[P+2]-N,A[I++]=I;C.push(new db(A,j[2]-N,i)),E.push(N-k)}}function m(k,S){return(C,E,j)=>{let T=0,R=C.length-1,A,N;if(R>=0&&(A=C[R])instanceof Bi){if(!R&&A.type==k&&A.length==j)return A;(N=A.prop(ui.lookAhead))&&(T=E[R]+A.length+N)}return b(k,C,E,j,T,S)}}function g(k,S,C,E,j,T,R,A,N){let P=[],I=[];for(;k.length>E;)P.push(k.pop()),I.push(S.pop()+C-j);k.push(b(i.types[R],P,I,T-j,A-T,N)),S.push(j-C)}function b(k,S,C,E,j,T,R){if(T){let A=[ui.contextHash,T];R=R?[A].concat(R):[A]}if(j>25){let A=[ui.lookAhead,j];R=R?[A].concat(R):[A]}return new Bi(k,S,C,E,R)}function v(k,S){let C=l.fork(),E=0,j=0,T=0,R=C.end-r,A={size:0,start:0,skip:0};e:for(let N=C.pos-k;C.pos>N;){let P=C.size;if(C.id==S&&P>=0){A.size=E,A.start=j,A.skip=T,T+=4,E+=4,C.next();continue}let I=C.pos-P;if(P<0||I=o?4:0,_=C.start;for(C.next();C.pos>I;){if(C.size<0)if(C.size==-3||C.size==-4)D+=4;else break e;else C.id>=o&&(D+=4);C.next()}j=_,E+=P,T+=D}return(S<0||E==k)&&(A.size=E,A.start=j,A.skip=T),A.size>4?A:void 0}function y(k,S,C){let{id:E,start:j,end:T,size:R}=l;if(l.next(),R>=0&&E4){let N=l.pos-(R-4);for(;l.pos>N;)C=y(k,S,C)}S[--C]=A,S[--C]=T-k,S[--C]=j-k,S[--C]=E}else R==-3?u=E:R==-4&&(d=E);return C}let w=[],x=[];for(;l.pos>0;)f(e.start||0,e.bufferStart||0,w,x,-1,0);let O=(t=e.length)!==null&&t!==void 0?t:w.length?x[0]+w[0].length:0;return new Bi(c[e.topID],w.reverse(),x.reverse(),O)}const lie=new WeakMap;function MN(e,t){if(!e.isAnonymous||t instanceof db||t.type!=e)return 1;let n=lie.get(t);if(n==null){n=1;for(let i of t.children){if(i.type!=e||!(i instanceof Bi)){n=1;break}n+=MN(e,i)}lie.set(t,n)}return n}function Pq(e,t,n,i,r,s,o,l,c){let u=0;for(let g=i;g=d)break;S+=C}if(x==O+1){if(S>d){let C=g[O];m(C.children,C.positions,0,C.children.length,b[O]+w);continue}f.push(g[O])}else{let C=b[x-1]+g[x-1].length-k;f.push(Pq(e,g,b,O,x,k,C,null,c))}h.push(k+w-s)}}return m(t,n,i,r,0),(l||c)(f,h,o)}class Dq{constructor(){this.map=new WeakMap}setBuffer(t,n,i){let r=this.map.get(t);r||this.map.set(t,r=new Map),r.set(n,i)}getBuffer(t,n){let i=this.map.get(t);return i&&i.get(n)}set(t,n){t instanceof oh?this.setBuffer(t.context.buffer,t.index,n):t instanceof jl&&this.map.set(t.tree,n)}get(t){return t instanceof oh?this.getBuffer(t.context.buffer,t.index):t instanceof jl?this.map.get(t.tree):void 0}cursorSet(t,n){t.buffer?this.setBuffer(t.buffer.buffer,t.index,n):this.map.set(t.tree,n)}cursorGet(t){return t.buffer?this.getBuffer(t.buffer.buffer,t.index):this.map.get(t.tree)}}class Bp{constructor(t,n,i,r,s=!1,o=!1){this.from=t,this.to=n,this.tree=i,this.offset=r,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],i=!1){let r=[new Bp(0,t.length,t,0,!1,i)];for(let s of n)s.to>t.length&&r.push(s);return r}static applyChanges(t,n,i=128){if(!n.length)return t;let r=[],s=1,o=t.length?t[0]:null;for(let l=0,c=0,u=0;;l++){let d=l=i)for(;o&&o.from=h.from||f<=h.to||u){let m=Math.max(h.from,c)-u,g=Math.min(h.to,f)-u;h=m>=g?null:new Bp(m,g,h.tree,h.offset+u,l>0,!!d)}if(h&&r.push(h),o.to>f)break;o=snew hd(r.from,r.to)):[new hd(0,0)]:[new hd(0,t.length)],this.createParse(t,n||[],i)}parse(t,n,i){let r=this.startParse(t,n,i);for(;;){let s=r.advance();if(s)return s}}}class WRt{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,n){return this.string.slice(t,n)}}function U5e(e){return(t,n,i,r)=>new GRt(t,e,n,i,r)}class cie{constructor(t,n,i,r,s,o){this.parser=t,this.parse=n,this.overlay=i,this.bracketed=r,this.target=s,this.from=o}}function uie(e){if(!e.length||e.some(t=>t.from>=t.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(e))}class KRt{constructor(t,n,i,r,s,o,l,c){this.parser=t,this.predicate=n,this.mounts=i,this.index=r,this.start=s,this.bracketed=o,this.target=l,this.prev=c,this.depth=0,this.ranges=[]}}const v9=new ui({perNode:!0});class GRt{constructor(t,n,i,r,s){this.nest=n,this.input=i,this.fragments=r,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=t}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new Bi(i.type,i.children,i.positions,i.length,i.propValues.concat([[v9,this.stoppedAt]]))),i}let t=this.inner[this.innerDone],n=t.parse.advance();if(n){this.innerDone++;let i=Object.assign(Object.create(null),t.target.props);i[ui.mounted.id]=new mw(n,t.overlay,t.parser,t.bracketed),t.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let t=this.input.length;for(let n=this.innerDone;n=this.stoppedAt)l=!1;else if(t.hasNode(r)){if(n){let u=n.mounts.find(d=>d.frag.from<=r.from&&d.frag.to>=r.to&&d.mount.overlay);if(u)for(let d of u.mount.overlay){let f=d.from+u.pos,h=d.to+u.pos;f>=r.from&&h<=r.to&&!n.ranges.some(m=>m.fromf)&&n.ranges.push({from:f,to:h})}}l=!1}else if(i&&(o=XRt(i.ranges,r.from,r.to)))l=o!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.fromnew hd(f.from-r.from,f.to-r.from)):null,!!s.bracketed,r.tree,d.length?d[0].from:r.from)),s.overlay?d.length&&(i={ranges:d,depth:0,prev:i}):l=!1}}else if(n&&(c=n.predicate(r))&&(c===!0&&(c=new hd(r.from,r.to)),c.from=0&&n.ranges[u].to==c.from?n.ranges[u]={from:n.ranges[u].from,to:c.to}:n.ranges.push(c)}if(l&&r.firstChild())n&&n.depth++,i&&i.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(n&&!--n.depth){let u=hie(this.ranges,n.ranges);u.length&&(uie(u),this.inner.splice(n.index,0,new cie(n.parser,n.parser.startParse(this.input,pie(n.mounts,u),u),n.ranges.map(d=>new hd(d.from-n.start,d.to-n.start)),n.bracketed,n.target,u[0].from))),n=n.prev}i&&!--i.depth&&(i=i.prev)}}}}function XRt(e,t,n){for(let i of e){if(i.from>=n)break;if(i.to>t)return i.from<=t&&i.to>=n?2:1}return 0}function die(e,t,n,i,r,s){if(t=t&&n.enter(i,1,Sr.IgnoreOverlays|Sr.ExcludeBuffers)))if(n.to<=t)n.next(!1)||(this.done=!0);else break}hasNode(t){if(this.moveTo(t.from),!this.done&&this.cursor.from+this.offset==t.from&&this.cursor.tree)for(let n=this.cursor.tree;;){if(n==t.tree)return!0;if(n.children.length&&n.positions[0]==0&&n.children[0]instanceof Bi)n=n.children[0];else break}return!1}}let ZRt=class{constructor(t){var n;if(this.fragments=t,this.curTo=0,this.fragI=0,t.length){let i=this.curFrag=t[0];this.curTo=(n=i.tree.prop(v9))!==null&&n!==void 0?n:i.to,this.inner=new fie(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(t){for(;this.curFrag&&t.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=t.from&&this.curTo>=t.to&&this.inner.hasNode(t)}nextFrag(){var t;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let n=this.curFrag=this.fragments[this.fragI];this.curTo=(t=n.tree.prop(v9))!==null&&t!==void 0?t:n.to,this.inner=new fie(n.tree,-n.offset)}}findMounts(t,n){var i;let r=[];if(this.inner){this.inner.cursor.moveTo(t,1);for(let s=this.inner.cursor.node;s;s=s.parent){let o=(i=s.tree)===null||i===void 0?void 0:i.prop(ui.mounted);if(o&&o.parser==n)for(let l=this.fragI;l=s.to)break;c.tree==this.curFrag.tree&&r.push({frag:c,pos:s.from-c.offset,mount:o})}}}return r}};function hie(e,t){let n=null,i=t;for(let r=1,s=0;r=l)break;c.to<=o||(n||(i=n=t.slice()),c.froml&&n.splice(s+1,0,new hd(l,c.to))):c.to>l?n[s--]=new hd(l,c.to):n.splice(s--,1))}}return i}function JRt(e,t,n,i){let r=0,s=0,o=!1,l=!1,c=-1e9,u=[];for(;;){let d=r==e.length?1e9:o?e[r].to:e[r].from,f=s==t.length?1e9:l?t[s].to:t[s].from;if(o!=l){let h=Math.max(c,n),m=Math.min(d,f,i);hnew hd(h.from+i,h.to+i)),f=JRt(t,d,c,u);for(let h=0,m=c;;h++){let g=h==f.length,b=g?u:f[h].from;if(b>m&&n.push(new Bp(m,b,r.tree,-o,s.from>=m||s.openStart,s.to<=b||s.openEnd)),g)break;m=f[h].to}}else n.push(new Bp(c,u,r.tree,-o,s.from>=o||s.openStart,s.to<=l||s.openEnd))}return n}let x9=[],Q5e=[];(()=>{let e="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(t=>t?parseInt(t,36):1);for(let t=0,n=0;t>1;if(e=Q5e[i])t=i+1;else return!0;if(t==n)return!1}}function mie(e){return e>=127462&&e<=127487}const gie=8205;function tIt(e,t,n=!0,i=!0){return(n?z5e:nIt)(e,t,i)}function z5e(e,t,n){if(t==e.length)return t;t&&V5e(e.charCodeAt(t))&&H5e(e.charCodeAt(t-1))&&t--;let i=W4(e,t);for(t+=bie(i);t=0&&mie(W4(e,o));)s++,o-=2;if(s%2==0)break;t+=2}else break}return t}function nIt(e,t,n){for(;t>1;){let i=z5e(e,t-2,n);if(i=56320&&e<57344}function H5e(e){return e>=55296&&e<56320}function bie(e){return e<65536?1:2}let xr=class q5e{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,n,i){[t,n]=c1(this,t,n);let r=[];return this.decompose(0,t,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(n,this.length,r,1),Jf.from(r,this.length-(n-t)+i.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,n=this.length){[t,n]=c1(this,t,n);let i=[];return this.decompose(t,n,i,0),Jf.from(i,n-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let n=this.scanIdentical(t,1),i=this.length-this.scanIdentical(t,-1),r=new yE(this),s=new yE(t);for(let o=n,l=n;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=i)return!0}}iter(t=1){return new yE(this,t)}iterRange(t,n=this.length){return new W5e(this,t,n)}iterLines(t,n){let i;if(t==null)i=this.iter();else{n==null&&(n=this.lines+1);let r=this.line(t).from;i=this.iterRange(r,Math.max(r,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new K5e(i)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(t.length==0)throw new RangeError("A document must have at least one line");return t.length==1&&!t[0]?q5e.empty:t.length<=32?new wa(t):Jf.from(wa.split(t,[]))}};class wa extends xr{constructor(t,n=iIt(t)){super(),this.text=t,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(t,n,i,r){for(let s=0;;s++){let o=this.text[s],l=r+o.length;if((n?i:l)>=t)return new rIt(r,l,i,o);r=l+1,i++}}decompose(t,n,i,r){let s=t<=0&&n>=this.length?this:new wa(yie(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(r&1){let o=i.pop(),l=LN(s.text,o.text.slice(),0,s.length);if(l.length<=32)i.push(new wa(l,o.length+s.length));else{let c=l.length>>1;i.push(new wa(l.slice(0,c)),new wa(l.slice(c)))}}else i.push(s)}replace(t,n,i){if(!(i instanceof wa))return super.replace(t,n,i);[t,n]=c1(this,t,n);let r=LN(this.text,LN(i.text,yie(this.text,0,t)),n),s=this.length+i.length-(n-t);return r.length<=32?new wa(r,s):Jf.from(wa.split(r,[]),s)}sliceString(t,n=this.length,i=` +`){[t,n]=c1(this,t,n);let r="";for(let s=0,o=0;s<=n&&ot&&o&&(r+=i),ts&&(r+=l.slice(Math.max(0,t-s),n-s)),s=c+1}return r}flatten(t){for(let n of this.text)t.push(n)}scanIdentical(){return 0}static split(t,n){let i=[],r=-1;for(let s of t)i.push(s),r+=s.length+1,i.length==32&&(n.push(new wa(i,r)),i=[],r=-1);return r>-1&&n.push(new wa(i,r)),n}}class Jf extends xr{constructor(t,n){super(),this.children=t,this.length=n,this.lines=0;for(let i of t)this.lines+=i.lines}lineInner(t,n,i,r){for(let s=0;;s++){let o=this.children[s],l=r+o.length,c=i+o.lines-1;if((n?c:l)>=t)return o.lineInner(t,n,i,r);r=l+1,i=c+1}}decompose(t,n,i,r){for(let s=0,o=0;o<=n&&s=o){let u=r&((o<=t?1:0)|(c>=n?2:0));o>=t&&c<=n&&!u?i.push(l):l.decompose(t-o,n-o,i,u)}o=c+1}}replace(t,n,i){if([t,n]=c1(this,t,n),i.lines=s&&n<=l){let c=o.replace(t-s,n-s,i),u=this.lines-o.lines+c.lines;if(c.lines>4&&c.lines>u>>6){let d=this.children.slice();return d[r]=c,new Jf(d,this.length-(n-t)+i.length)}return super.replace(s,l,c)}s=l+1}return super.replace(t,n,i)}sliceString(t,n=this.length,i=` +`){[t,n]=c1(this,t,n);let r="";for(let s=0,o=0;st&&s&&(r+=i),to&&(r+=l.sliceString(t-o,n-o,i)),o=c+1}return r}flatten(t){for(let n of this.children)n.flatten(t)}scanIdentical(t,n){if(!(t instanceof Jf))return 0;let i=0,[r,s,o,l]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;r+=n,s+=n){if(r==o||s==l)return i;let c=this.children[r],u=t.children[s];if(c!=u)return i+c.scanIdentical(u,n);i+=c.length+1}}static from(t,n=t.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let m of t)i+=m.lines;if(i<32){let m=[];for(let g of t)g.flatten(m);return new wa(m,n)}let r=Math.max(32,i>>5),s=r<<1,o=r>>1,l=[],c=0,u=-1,d=[];function f(m){let g;if(m.lines>s&&m instanceof Jf)for(let b of m.children)f(b);else m.lines>o&&(c>o||!c)?(h(),l.push(m)):m instanceof wa&&c&&(g=d[d.length-1])instanceof wa&&m.lines+g.lines<=32?(c+=m.lines,u+=m.length+1,d[d.length-1]=new wa(g.text.concat(m.text),g.length+1+m.length)):(c+m.lines>r&&h(),c+=m.lines,u+=m.length+1,d.push(m))}function h(){c!=0&&(l.push(d.length==1?d[0]:Jf.from(d,u)),u=-1,c=d.length=0)}for(let m of t)f(m);return h(),l.length==1?l[0]:new Jf(l,n)}}xr.empty=new wa([""],0);function iIt(e){let t=-1;for(let n of e)t+=n.length+1;return t}function LN(e,t,n=0,i=1e9){for(let r=0,s=0,o=!0;s=n&&(c>i&&(l=l.slice(0,i-r)),r0?1:(t instanceof wa?t.text.length:t.children.length)<<1]}nextInner(t,n){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,r=this.nodes[i],s=this.offsets[i],o=s>>1,l=r instanceof wa?r.text.length:r.children.length;if(o==(n>0?l:0)){if(i==0)return this.done=!0,this.value="",this;n>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(n>0?0:1)){if(this.offsets[i]+=n,t==0)return this.lineBreak=!0,this.value=` +`,this;t--}else if(r instanceof wa){let c=r.text[o+(n<0?-1:0)];if(this.offsets[i]+=n,c.length>Math.max(0,t))return this.value=t==0?c:n>0?c.slice(t):c.slice(0,c.length-t),this;t-=c.length}else{let c=r.children[o+(n<0?-1:0)];t>c.length?(t-=c.length,this.offsets[i]+=n):(n<0&&this.offsets[i]--,this.nodes.push(c),this.offsets.push(n>0?1:(c instanceof wa?c.text.length:c.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class W5e{constructor(t,n,i){this.value="",this.done=!1,this.cursor=new yE(t,n>i?-1:1),this.pos=n>i?t.length:0,this.from=Math.min(n,i),this.to=Math.max(n,i)}nextInner(t,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let i=n<0?this.pos-this.from:this.to-this.pos;t>i&&(t=i),i-=t;let{value:r}=this.cursor.next(t);return this.pos+=(r.length+t)*n,this.value=r.length<=i?r:n<0?r.slice(r.length-i):r.slice(0,i),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class K5e{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:n,lineBreak:i,value:r}=this.inner.next(t);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(xr.prototype[Symbol.iterator]=function(){return this.iter()},yE.prototype[Symbol.iterator]=W5e.prototype[Symbol.iterator]=K5e.prototype[Symbol.iterator]=function(){return this});let rIt=class{constructor(t,n,i,r){this.from=t,this.to=n,this.number=i,this.text=r}get length(){return this.to-this.from}};function c1(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function Ro(e,t,n=!0,i=!0){return tIt(e,t,n,i)}function sIt(e){return e>=56320&&e<57344}function aIt(e){return e>=55296&&e<56320}function jc(e,t){let n=e.charCodeAt(t);if(!aIt(n)||t+1==e.length)return n;let i=e.charCodeAt(t+1);return sIt(i)?(n-55296<<10)+(i-56320)+65536:n}function Mq(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function eh(e){return e<65536?1:2}const w9=/\r\n?|\n/;var il=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(il||(il={}));class bh{constructor(t){this.sections=t}get length(){let t=0;for(let n=0;nt)return s+(t-r);s+=l}else{if(i!=il.Simple&&u>=t&&(i==il.TrackDel&&rt||i==il.TrackBefore&&rt))return null;if(u>t||u==t&&n<0&&!l)return t==r||n<0?s:s+c;s+=c}r=u}if(t>r)throw new RangeError(`Position ${t} is out of range for changeset of length ${r}`);return s}touchesRange(t,n=t){for(let i=0,r=0;i=0&&r<=n&&l>=t)return rn?"cover":!0;r=l}return!1}toString(){let t="";for(let n=0;n=0?":"+r:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new bh(t)}static create(t){return new bh(t)}}class lo extends bh{constructor(t,n){super(t),this.inserted=n}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return O9(this,(n,i,r,s,o)=>t=t.replace(r,r+(i-n),o),!1),t}mapDesc(t,n=!1){return k9(this,t,n,!0)}invert(t){let n=this.sections.slice(),i=[];for(let r=0,s=0;r=0){n[r]=l,n[r+1]=o;let c=r>>1;for(;i.length0&&xg(i,n,s.text),s.forward(d),l+=d}let u=t[o++];for(;l>1].toJSON()))}return t}static of(t,n,i){let r=[],s=[],o=0,l=null;function c(d=!1){if(!d&&!r.length)return;oh||f<0||h>n)throw new RangeError(`Invalid change range ${f} to ${h} (in doc of length ${n})`);let g=m?typeof m=="string"?xr.of(m.split(i||w9)):m:xr.empty,b=g.length;if(f==h&&b==0)return;fo&&Cl(r,f-o,-1),Cl(r,h-f,b),xg(s,r,g),o=h}}return u(t),c(!l),l}static empty(t){return new lo(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],i=[];for(let r=0;rl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)n.push(s[0],0);else{for(;i.length=0&&n<=0&&n==e[r+1]?e[r]+=t:r>=0&&t==0&&e[r]==0?e[r+1]+=n:i?(e[r]+=t,e[r+1]+=n):e.push(t,n)}function xg(e,t,n){if(n.length==0)return;let i=t.length-2>>1;if(i>1])),!(n||o==e.sections.length||e.sections[o+1]<0);)l=e.sections[o++],c=e.sections[o++];t(r,u,s,d,f),r=u,s=d}}}function k9(e,t,n,i=!1){let r=[],s=i?[]:null,o=new RC(e),l=new RC(t);for(let c=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let u=Math.min(o.len,l.len);Cl(r,u,-1),o.forward(u),l.forward(u)}else if(l.ins>=0&&(o.ins<0||c==o.i||o.off==0&&(l.len=0&&c=0){let u=0,d=o.len;for(;d;)if(l.ins==-1){let f=Math.min(d,l.len);u+=f,d-=f,l.forward(f)}else if(l.ins==0&&l.lenc||o.ins>=0&&o.len>c)&&(l||i.length>u),s.forward2(c),o.forward(c)}}}}class RC{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i>1;return n>=t.length?xr.empty:t[n]}textBit(t){let{inserted:n}=this.set,i=this.i-2>>1;return i>=n.length&&!t?xr.empty:n[i].slice(this.off,t==null?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){this.ins==-1?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class ag{constructor(t,n,i,r){this.from=t,this.to=n,this.flags=i,this.goalColumn=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let t=this.flags&7;return t==7?null:t}map(t,n=-1){let i,r;return this.empty?i=r=t.mapPos(this.from,n):(i=t.mapPos(this.from,1),r=t.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new ag(i,r,this.flags,this.goalColumn)}extend(t,n=t,i=0){if(t<=this.anchor&&n>=this.anchor)return ht.range(t,n,void 0,void 0,i);let r=Math.abs(t-this.anchor)>Math.abs(n-this.anchor)?t:n;return ht.range(this.anchor,r,void 0,void 0,i)}eq(t,n=!1){return this.anchor==t.anchor&&this.head==t.head&&this.goalColumn==t.goalColumn&&(!n||!this.empty||this.assoc==t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return ht.range(t.anchor,t.head)}static create(t,n,i,r){return new ag(t,n,i,r)}}class ht{constructor(t,n){this.ranges=t,this.mainIndex=n}map(t,n=-1){return t.empty?this:ht.create(this.ranges.map(i=>i.map(t,n)),this.mainIndex)}eq(t,n=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let i=0;it.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!="number"||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new ht(t.ranges.map(n=>ag.fromJSON(n)),t.main)}static single(t,n=t){return new ht([ht.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,r=0;rr.from-s.from),n=t.indexOf(i);for(let r=1;rs.head?ht.range(c,l):ht.range(l,c))}}return new ht(t,n)}}function X5e(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let Lq=0;class mn{constructor(t,n,i,r,s){this.combine=t,this.compareInput=n,this.compare=i,this.isStatic=r,this.id=Lq++,this.default=t([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(t={}){return new mn(t.combine||(n=>n),t.compareInput||((n,i)=>n===i),t.compare||(t.combine?(n,i)=>n===i:$q),!!t.static,t.enables)}of(t){return new $N([],this,0,t)}compute(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new $N(t,this,1,n)}computeN(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new $N(t,this,2,n)}from(t,n){return n||(n=i=>i),this.compute([t],i=>n(i.field(t)))}}function $q(e,t){return e==t||e.length==t.length&&e.every((n,i)=>n===t[i])}class $N{constructor(t,n,i,r){this.dependencies=t,this.facet=n,this.type=i,this.value=r,this.id=Lq++}dynamicSlot(t){var n;let i=this.value,r=this.facet.compareInput,s=this.id,o=t[s]>>1,l=this.type==2,c=!1,u=!1,d=[];for(let f of this.dependencies)f=="doc"?c=!0:f=="selection"?u=!0:((n=t[f.id])!==null&&n!==void 0?n:1)&1||d.push(t[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,h){if(c&&h.docChanged||u&&(h.docChanged||h.selection)||S9(f,d)){let m=i(f);if(l?!vie(m,f.values[o],r):!r(m,f.values[o]))return f.values[o]=m,1}return 0},reconfigure:(f,h)=>{let m,g=h.config.address[s];if(g!=null){let b=UI(h,g);if(this.dependencies.every(v=>v instanceof mn?h.facet(v)===f.facet(v):v instanceof dl?h.field(v,!1)==f.field(v,!1):!0)||(l?vie(m=i(f),b,r):r(m=i(f),b)))return f.values[o]=b,0}else m=i(f);return f.values[o]=m,1}}}get extension(){return this}}function vie(e,t,n){if(e.length!=t.length)return!1;for(let i=0;ie[c.id]),r=n.map(c=>c.type),s=i.filter(c=>!(c&1)),o=e[t.id]>>1;function l(c){let u=[];for(let d=0;di===r),t);return t.provide&&(n.provides=t.provide(n)),n}create(t){let n=t.facet(B_).find(i=>i.field==this);return((n==null?void 0:n.create)||this.createF)(t)}slot(t){let n=t[this.id]>>1;return{create:i=>(i.values[n]=this.create(i),1),update:(i,r)=>{let s=i.values[n],o=this.updateF(s,r);return this.compareF(s,o)?0:(i.values[n]=o,1)},reconfigure:(i,r)=>{let s=i.facet(B_),o=r.facet(B_),l;return(l=s.find(c=>c.field==this))&&l!=o.find(c=>c.field==this)?(i.values[n]=l.create(i),1):r.config.address[this.id]!=null?(i.values[n]=r.field(this),0):(i.values[n]=this.create(i),1)}}}init(t){return[this,B_.of({field:this,create:t})]}get extension(){return this}}const wy={lowest:4,low:3,default:2,high:1,highest:0};function Ok(e){return t=>new Y5e(t,e)}const gm={highest:Ok(wy.highest),high:Ok(wy.high),default:Ok(wy.default),low:Ok(wy.low),lowest:Ok(wy.lowest)};class Y5e{constructor(t,n){this.inner=t,this.prec=n}get extension(){return this}}class KM{of(t){return new E9(this,t)}reconfigure(t){return KM.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class E9{constructor(t,n){this.compartment=t,this.inner=n}get extension(){return this}}class BI{constructor(t,n,i,r,s,o){for(this.base=t,this.compartments=n,this.dynamicSlots=i,this.address=r,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(t,n,i){let r=[],s=Object.create(null),o=new Map;for(let h of lIt(t,n,o))h instanceof dl?r.push(h):(s[h.facet.id]||(s[h.facet.id]=[])).push(h);let l=Object.create(null),c=[],u=[];for(let h of r)l[h.id]=u.length<<1,u.push(m=>h.slot(m));let d=i==null?void 0:i.config.facets;for(let h in s){let m=s[h],g=m[0].facet,b=d&&d[h]||[];if(m.every(v=>v.type==0))if(l[g.id]=c.length<<1|1,$q(b,m))c.push(i.facet(g));else{let v=g.combine(m.map(y=>y.value));c.push(i&&g.compare(v,i.facet(g))?i.facet(g):v)}else{for(let v of m)v.type==0?(l[v.id]=c.length<<1|1,c.push(v.value)):(l[v.id]=u.length<<1,u.push(y=>v.dynamicSlot(y)));l[g.id]=u.length<<1,u.push(v=>oIt(v,g,m))}}let f=u.map(h=>h(l));return new BI(t,o,f,l,c,s)}}function lIt(e,t,n){let i=[[],[],[],[],[]],r=new Map;function s(o,l){let c=r.get(o);if(c!=null){if(c<=l)return;let u=i[c].indexOf(o);u>-1&&i[c].splice(u,1),o instanceof E9&&n.delete(o.compartment)}if(r.set(o,l),Array.isArray(o))for(let u of o)s(u,l);else if(o instanceof E9){if(n.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let u=t.get(o.compartment)||o.inner;n.set(o.compartment,u),s(u,l)}else if(o instanceof Y5e)s(o.inner,o.prec);else if(o instanceof dl)i[l].push(o),o.provides&&s(o.provides,l);else if(o instanceof $N)i[l].push(o),o.facet.extensions&&s(o.facet.extensions,wy.default);else{let u=o.extension;if(!u)throw new Error(`Unrecognized extension value in extension set (${o}).`);if(u==o)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(u,l)}}return s(e,wy.default),i.reduce((o,l)=>o.concat(l))}function vE(e,t){if(t&1)return 2;let n=t>>1,i=e.status[n];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;e.status[n]=4;let r=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|r}function UI(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}const Z5e=mn.define(),C9=mn.define({combine:e=>e.some(t=>t),static:!0}),J5e=mn.define({combine:e=>e.length?e[0]:void 0,static:!0}),e3e=mn.define(),t3e=mn.define(),n3e=mn.define(),i3e=mn.define({combine:e=>e.length?e[0]:!1});class Rh{constructor(t,n){this.type=t,this.value=n}static define(){return new cIt}}class cIt{of(t){return new Rh(this,t)}}class uIt{constructor(t){this.map=t}of(t){return new pi(this,t)}}class pi{constructor(t,n){this.type=t,this.value=n}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new pi(this.type,n)}is(t){return this.type==t}static define(t={}){return new uIt(t.map||(n=>n))}static mapEffects(t,n){if(!t.length)return t;let i=[];for(let r of t){let s=r.map(n);s&&i.push(s)}return i}}pi.reconfigure=pi.define();pi.appendConfig=pi.define();class Xa{constructor(t,n,i,r,s,o){this.startState=t,this.changes=n,this.selection=i,this.effects=r,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,i&&X5e(i,n.newLength),s.some(l=>l.type==Xa.time)||(this.annotations=s.concat(Xa.time.of(Date.now())))}static create(t,n,i,r,s,o){return new Xa(t,n,i,r,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let n of this.annotations)if(n.type==t)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(Xa.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]=="."))}}Xa.time=Rh.define();Xa.userEvent=Rh.define();Xa.addToHistory=Rh.define();Xa.remote=Rh.define();function dIt(e,t){let n=[];for(let i=0,r=0;;){let s,o;if(i=e[i]))s=e[i++],o=e[i++];else if(r=0;r--){let s=i[r](e);s instanceof Xa?e=s:Array.isArray(s)&&s.length==1&&s[0]instanceof Xa?e=s[0]:e=s3e(t,gw(s),!1)}return e}function hIt(e){let t=e.startState,n=t.facet(n3e),i=e;for(let r=n.length-1;r>=0;r--){let s=n[r](e);s&&Object.keys(s).length&&(i=r3e(i,A9(t,s,e.changes.newLength),!0))}return i==e?e:Xa.create(t,e.changes,e.selection,i.effects,i.annotations,i.scrollIntoView)}const pIt=[];function gw(e){return e==null?pIt:Array.isArray(e)?e:[e]}var Qs=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(Qs||(Qs={}));const mIt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let T9;try{T9=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function gIt(e){if(T9)return T9.test(e);for(let t=0;t"€"&&(n.toUpperCase()!=n.toLowerCase()||mIt.test(n)))return!0}return!1}function bIt(e){return t=>{if(!/\S/.test(t))return Qs.Space;if(gIt(t))return Qs.Word;for(let n=0;n-1)return Qs.Word;return Qs.Other}}class tr{constructor(t,n,i,r,s,o){this.config=t,this.doc=n,this.selection=i,this.values=r,this.status=t.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let l=0;lr.set(u,c)),n=null),r.set(l.value.compartment,l.value.extension)):l.is(pi.reconfigure)?(n=null,i=l.value):l.is(pi.appendConfig)&&(n=null,i=gw(i).concat(l.value));let s;n?s=t.startState.values.slice():(n=BI.resolve(i,r,this),s=new tr(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(c,u)=>u.reconfigure(c,this),null).values);let o=t.startState.facet(C9)?t.newSelection:t.newSelection.asSingle();new tr(n,t.newDoc,o,s,(l,c)=>c.update(l,t),t)}replaceSelection(t){return typeof t=="string"&&(t=this.toText(t)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:t},range:ht.cursor(n.from+t.length)}))}changeByRange(t){let n=this.selection,i=t(n.ranges[0]),r=this.changes(i.changes),s=[i.range],o=gw(i.effects);for(let l=1;lo.spec.fromJSON(l,c)))}}return tr.create({doc:t.doc,selection:ht.fromJSON(t.selection),extensions:n.extensions?r.concat([n.extensions]):r})}static create(t={}){let n=BI.resolve(t.extensions||[],new Map),i=t.doc instanceof xr?t.doc:xr.of((t.doc||"").split(n.staticFacet(tr.lineSeparator)||w9)),r=t.selection?t.selection instanceof ht?t.selection:ht.single(t.selection.anchor,t.selection.head):ht.single(0);return X5e(r,i.length),n.staticFacet(C9)||(r=r.asSingle()),new tr(n,i,r,n.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(tr.tabSize)}get lineBreak(){return this.facet(tr.lineSeparator)||` +`}get readOnly(){return this.facet(i3e)}phrase(t,...n){for(let i of this.facet(tr.phrases))if(Object.prototype.hasOwnProperty.call(i,t)){t=i[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(i,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>n.length?i:n[s-1]})),t}languageDataAt(t,n,i=-1){let r=[];for(let s of this.facet(Z5e))for(let o of s(this,n,i))Object.prototype.hasOwnProperty.call(o,t)&&r.push(o[t]);return r}charCategorizer(t){let n=this.languageDataAt("wordChars",t);return bIt(n.length?n[0]:"")}wordAt(t){let{text:n,from:i,length:r}=this.doc.lineAt(t),s=this.charCategorizer(t),o=t-i,l=t-i;for(;o>0;){let c=Ro(n,o,!1);if(s(n.slice(c,o))!=Qs.Word)break;o=c}for(;le.length?e[0]:4});tr.lineSeparator=J5e;tr.readOnly=i3e;tr.phrases=mn.define({compare(e,t){let n=Object.keys(e),i=Object.keys(t);return n.length==i.length&&n.every(r=>e[r]==t[r])}});tr.languageData=Z5e;tr.changeFilter=e3e;tr.transactionFilter=t3e;tr.transactionExtender=n3e;KM.reconfigure=pi.define();function Ih(e,t,n={}){let i={};for(let r of e)for(let s of Object.keys(r)){let o=r[s],l=i[s];if(l===void 0)i[s]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(n,s))i[s]=n[s](l,o);else throw new Error("Config merge conflict for field "+s)}for(let r in t)i[r]===void 0&&(i[r]=t[r]);return i}class fb{eq(t){return this==t}range(t,n=t){return IC.create(t,n,this)}}fb.prototype.startSide=fb.prototype.endSide=0;fb.prototype.point=!1;fb.prototype.mapMode=il.TrackDel;function Fq(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}class IC{constructor(t,n,i){this.from=t,this.to=n,this.value=i}static create(t,n,i){return new IC(t,n,i)}}function _9(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class Bq{constructor(t,n,i,r){this.from=t,this.to=n,this.value=i,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(t,n,i,r=0){let s=i?this.to:this.from;for(let o=r,l=s.length;;){if(o==l)return o;let c=o+l>>1,u=s[c]-t||(i?this.value[c].endSide:this.value[c].startSide)-n;if(c==o)return u>=0?o:l;u>=0?l=c:o=c+1}}between(t,n,i,r){for(let s=this.findIndex(n,-1e9,!0),o=this.findIndex(i,1e9,!1,s);sm||h==m&&u.startSide>0&&u.endSide<=0)continue;(m-h||u.endSide-u.startSide)<0||(o<0&&(o=h),u.point&&(l=Math.max(l,m-h)),i.push(u),r.push(h-o),s.push(m-o))}return{mapped:i.length?new Bq(r,s,i,l):null,pos:o}}}class Ki{constructor(t,n,i,r){this.chunkPos=t,this.chunk=n,this.nextLayer=i,this.maxPoint=r}static create(t,n,i,r){return new Ki(t,n,i,r)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let n of this.chunk)t+=n.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:n=[],sort:i=!1,filterFrom:r=0,filterTo:s=this.length}=t,o=t.filter;if(n.length==0&&!o)return this;if(i&&(n=n.slice().sort(_9)),this.isEmpty)return n.length?Ki.of(n):this;let l=new a3e(this,null,-1).goto(0),c=0,u=[],d=new tm;for(;l.value||c=0){let f=n[c++];d.addInner(f.from,f.to,f.value)||u.push(f)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||sl.to||s=s&&t<=s+o.length&&o.between(s,t-s,n-s,i)===!1)return}this.nextLayer.between(t,n,i)}}iter(t=0){return PC.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,n=0){return PC.from(t).goto(n)}static compare(t,n,i,r,s=-1){let o=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),l=n.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),c=xie(o,l,i),u=new kk(o,c,s),d=new kk(l,c,s);i.iterGaps((f,h,m)=>wie(u,f,d,h,m,r)),i.empty&&i.length==0&&wie(u,0,d,0,0,r)}static eq(t,n,i=0,r){r==null&&(r=999999999);let s=t.filter(d=>!d.isEmpty&&n.indexOf(d)<0),o=n.filter(d=>!d.isEmpty&&t.indexOf(d)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let l=xie(s,o),c=new kk(s,l,0).goto(i),u=new kk(o,l,0).goto(i);for(;;){if(c.to!=u.to||!j9(c.active,u.active)||c.point&&(!u.point||!Fq(c.point,u.point)))return!1;if(c.to>r)return!0;c.next(),u.next()}}static spans(t,n,i,r,s=-1){let o=new kk(t,null,s).goto(n),l=n,c=o.openStart;for(;;){let u=Math.min(o.to,i);if(o.point){let d=o.activeForPoint(o.to),f=o.pointFroml&&(r.span(l,u,o.active,c),c=o.openEnd(u));if(o.to>i)return c+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(t,n=!1){let i=new tm;for(let r of t instanceof IC?[t]:n?yIt(t):t)i.add(r.from,r.to,r.value);return i.finish()}static join(t){if(!t.length)return Ki.empty;let n=t[t.length-1];for(let i=t.length-2;i>=0;i--)for(let r=t[i];r!=Ki.empty;r=r.nextLayer)n=new Ki(r.chunkPos,r.chunk,n,Math.max(r.maxPoint,n.maxPoint));return n}}Ki.empty=new Ki([],[],null,-1);function yIt(e){if(e.length>1)for(let t=e[0],n=1;n0)return e.slice().sort(_9);t=i}return e}Ki.empty.nextLayer=Ki.empty;class tm{finishChunk(t){this.chunks.push(new Bq(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,n,i){this.addInner(t,n,i)||(this.nextLayer||(this.nextLayer=new tm)).add(t,n,i)}addInner(t,n,i){let r=t-this.lastTo||i.startSide-this.last.endSide;if(r<=0&&(t-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(n-this.chunkStart),this.last=i,this.lastFrom=t,this.lastTo=n,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,n-t)),!0)}addChunk(t,n){if((t-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(t);let i=n.value.length-1;return this.last=n.value[i],this.lastFrom=n.from[i]+t,this.lastTo=n.to[i]+t,!0}finish(){return this.finishInner(Ki.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return t;let n=Ki.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,n}}function xie(e,t,n){let i=new Map;for(let s of e)for(let o=0;o=this.minPoint)break}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&r.push(new a3e(o,n,i,s));return r.length==1?r[0]:new PC(r)}get startSide(){return this.value?this.value.startSide:0}goto(t,n=-1e9){for(let i of this.heap)i.goto(t,n);for(let i=this.heap.length>>1;i>=0;i--)K4(this.heap,i);return this.next(),this}forward(t,n){for(let i of this.heap)i.forward(t,n);for(let i=this.heap.length>>1;i>=0;i--)K4(this.heap,i);(this.to-t||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),K4(this.heap,0)}}}function K4(e,t){for(let n=e[t];;){let i=(t<<1)+1;if(i>=e.length)break;let r=e[i];if(i+1=0&&(r=e[i+1],i++),n.compare(r)<0)break;e[i]=n,e[t]=r,t=i}}class kk{constructor(t,n,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=PC.from(t,n,i)}goto(t,n=-1e9){return this.cursor.goto(t,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=n,this.openStart=-1,this.next(),this}forward(t,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(t,n)}removeActive(t){U_(this.active,t),U_(this.activeTo,t),U_(this.activeRank,t),this.minActive=Oie(this.active,this.activeTo)}addActive(t){let n=0,{value:i,to:r,rank:s}=this.cursor;for(;n0;)n++;Q_(this.active,n,i),Q_(this.activeTo,n,r),Q_(this.activeRank,n,s),t&&Q_(t,n,this.cursor.from),this.minActive=Oie(this.active,this.activeTo)}next(){let t=this.to,n=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>t){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&U_(i,r)}else if(this.cursor.value)if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(i),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from=0&&i[r]=0&&!(this.activeRank[i]t||this.activeTo[i]==t&&this.active[i].endSide>=this.point.endSide)&&n.push(this.active[i]);return n.reverse()}openEnd(t){let n=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>t;i--)n++;return n}}function wie(e,t,n,i,r,s){e.goto(t),n.goto(i);let o=i+r,l=i,c=i-t,u=!!s.boundChange;for(let d=!1;;){let f=e.to+c-n.to,h=f||e.endSide-n.endSide,m=h<0?e.to+c:n.to,g=Math.min(m,o);if(e.point||n.point?(e.point&&n.point&&Fq(e.point,n.point)&&j9(e.activeForPoint(e.to),n.activeForPoint(n.to))||s.comparePoint(l,g,e.point,n.point),d=!1):(d&&s.boundChange(l),g>l&&!j9(e.active,n.active)&&s.compareRange(l,g,e.active,n.active),u&&go)break;l=m,h<=0&&e.next(),h>=0&&n.next()}}function j9(e,t){if(e.length!=t.length)return!1;for(let n=0;n=t;i--)e[i+1]=e[i];e[t]=n}function Oie(e,t){let n=-1,i=1e9;for(let r=0;r=t)return r;if(r==e.length)break;s+=e.charCodeAt(r)==9?n-s%n:1,r=Ro(e,r)}return i===!0?-1:e.length}const R9="ͼ",kie=typeof Symbol>"u"?"__"+R9:Symbol.for(R9),I9=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Sie=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class hb{constructor(t,n){this.rules=[];let{finish:i}=n||{};function r(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,l,c,u){let d=[],f=/^@(\w+)\b/.exec(o[0]),h=f&&f[1]=="keyframes";if(f&&l==null)return c.push(o[0]+";");for(let m in l){let g=l[m];if(/&/.test(m))s(m.split(/,\s*/).map(b=>o.map(v=>b.replace(/&/,v))).reduce((b,v)=>b.concat(v)),g,c);else if(g&&typeof g=="object"){if(!f)throw new RangeError("The value of a property ("+m+") should be a primitive value.");s(r(m),g,d,h)}else g!=null&&d.push(m.replace(/_.*/,"").replace(/[A-Z]/g,b=>"-"+b.toLowerCase())+": "+g+";")}(d.length||h)&&c.push((i&&!f&&!u?o.map(i):o).join(", ")+" {"+d.join(" ")+"}")}for(let o in t)s(r(o),t[o],this.rules)}getRules(){return this.rules.join(` `)}static newName(){let t=Sie[kie]||1;return Sie[kie]=t+1,R9+t.toString(36)}static mount(t,n,i){let r=t[I9],s=i&&i.nonce;r?s&&r.setNonce(s):r=new vIt(t,s),r.mount(Array.isArray(n)?n:[n],t)}}let Eie=new Map;class vIt{constructor(t,n){let i=t.ownerDocument||t,r=i.defaultView;if(!t.head&&t.adoptedStyleSheets&&r.CSSStyleSheet){let s=Eie.get(i);if(s)return t[I9]=s;this.sheet=new r.CSSStyleSheet,Eie.set(i,this)}else this.styleTag=i.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],t[I9]=this}mount(t,n){let i=this.sheet,r=0,s=0;for(let o=0;o-1&&(this.modules.splice(c,1),s--,c=-1),c==-1){if(this.modules.splice(s++,0,l),i)for(let u=0;u",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},xIt=typeof navigator<"u"&&/Mac/.test(navigator.platform),wIt=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var el=0;el<10;el++)mb[48+el]=mb[96+el]=String(el);for(var el=1;el<=24;el++)mb[el+111]="F"+el;for(var el=65;el<=90;el++)mb[el]=String.fromCharCode(el+32),jC[el]=String.fromCharCode(el);for(var G4 in mb)jC.hasOwnProperty(G4)||(jC[G4]=mb[G4]);function OIt(e){var t=xIt&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||wIt&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?jC:mb)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function Xr(){var e=arguments[0];typeof e=="string"&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var r=n[i];typeof r=="string"?e.setAttribute(i,r):r!=null&&(e[i]=r)}t++}for(;t2);var pn={mac:Tie||/Mac/.test(Jl.platform),windows:/Win/.test(Jl.platform),linux:/Linux|X11/.test(Jl.platform),ie:KM,ie_version:l3e?P9.documentMode||6:M9?+M9[1]:D9?+D9[1]:0,gecko:Cie,gecko_version:Cie?+(/Firefox\/(\d+)/.exec(Jl.userAgent)||[0,0])[1]:0,chrome:!!X4,chrome_version:X4?+X4[1]:0,ios:Tie,android:/Android\b/.test(Jl.userAgent),webkit:Aie,webkit_version:Aie?+(/\bAppleWebKit\/(\d+)/.exec(Jl.userAgent)||[0,0])[1]:0,safari:L9,safari_version:L9?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Jl.userAgent)||[0,0])[1]:0,tabSize:P9.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function Uq(e,t){for(let n in e)n=="class"&&t.class?t.class+=" "+e.class:n=="style"&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}const UI=Object.create(null);function Qq(e,t,n){if(e==t)return!0;e||(e=UI),t||(t=UI);let i=Object.keys(e),r=Object.keys(t);if(i.length-0!=r.length-0)return!1;for(let s of i)if(s!=n&&(r.indexOf(s)==-1||e[s]!==t[s]))return!1;return!0}function kIt(e,t){for(let n=e.attributes.length-1;n>=0;n--){let i=e.attributes[n].name;t[i]==null&&e.removeAttribute(i)}for(let n in t){let i=t[n];n=="style"?e.style.cssText=i:e.getAttribute(n)!=i&&e.setAttribute(n,i)}}function _ie(e,t,n){let i=!1;if(t)for(let r in t)n&&r in n||(i=!0,r=="style"?e.style.cssText="":e.removeAttribute(r));if(n)for(let r in n)t&&t[r]==n[r]||(i=!0,r=="style"?e.style.cssText=n[r]:e.setAttribute(r,n[r]));return i}function SIt(e){let t=Object.create(null);for(let n=0;n0?3e8:-4e8:n>0?1e8:-1e8,new b0(t,n,n,i,t.widget||null,!1)}static replace(t){let n=!!t.block,i,r;if(t.isBlockGap)i=-5e8,r=4e8;else{let{start:s,end:o}=c3e(t,n);i=(s?n?-3e8:-1:5e8)-1,r=(o?n?2e8:1:-6e8)+1}return new b0(t,i,r,n,t.widget||null,!0)}static line(t){return new kT(t)}static set(t,n=!1){return Gi.of(t,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}$n.none=Gi.empty;class OT extends $n{constructor(t){let{start:n,end:i}=c3e(t);super(n?-1:5e8,i?1:-6e8,null,t),this.tagName=t.tagName||"span",this.attrs=t.class&&t.attributes?Uq(t.attributes,{class:t.class}):t.class?{class:t.class}:t.attributes||UI}eq(t){return this==t||t instanceof OT&&this.tagName==t.tagName&&Qq(this.attrs,t.attrs)}range(t,n=t){if(t>=n)throw new RangeError("Mark decorations may not be empty");return super.range(t,n)}}OT.prototype.point=!1;class kT extends $n{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof kT&&this.spec.class==t.spec.class&&Qq(this.spec.attributes,t.spec.attributes)}range(t,n=t){if(n!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,n)}}kT.prototype.mapMode=il.TrackBefore;kT.prototype.point=!0;class b0 extends $n{constructor(t,n,i,r,s,o){super(n,i,s,t),this.block=r,this.isReplace=o,this.mapMode=r?n<=0?il.TrackBefore:il.TrackAfter:il.TrackDel}get type(){return this.startSide!=this.endSide?ol.WidgetRange:this.startSide<=0?ol.WidgetBefore:ol.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof b0&&EIt(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(t,n=t){if(this.isReplace&&(t>n||t==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,n)}}b0.prototype.point=!0;function c3e(e,t=!1){let{inclusiveStart:n,inclusiveEnd:i}=e;return n==null&&(n=e.inclusive),i==null&&(i=e.inclusive),{start:n??t,end:i??t}}function EIt(e,t){return e==t||!!(e&&t&&e.compare(t))}function mw(e,t,n,i=0){let r=n.length-1;r>=0&&n[r]+i>=e?n[r]=Math.max(n[r],t):n.push(e,t)}class NC extends hb{constructor(t,n,i){super(),this.tagName=t,this.attributes=n,this.rank=i}eq(t){return t==this||t instanceof NC&&this.tagName==t.tagName&&Qq(this.attributes,t.attributes)}static create(t){return new NC(t.tagName,t.attributes||UI,t.rank==null?50:Math.max(0,Math.min(t.rank,100)))}static set(t,n=!1){return Gi.of(t,n)}}NC.prototype.startSide=NC.prototype.endSide=-1;function RC(e){let t;return e.nodeType==11?t=e.getSelection?e:e.ownerDocument:t=e,t.getSelection()}function $9(e,t){return t?e==t||e.contains(t.nodeType!=1?t.parentNode:t):!1}function mE(e,t){if(!t.anchorNode)return!1;try{return $9(e,t.anchorNode)}catch{return!1}}function gE(e){return e.nodeType==3?PC(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function bE(e,t,n,i){return n?jie(e,t,n,i,-1)||jie(e,t,n,i,1):!1}function gb(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function QI(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function jie(e,t,n,i,r){for(;;){if(e==n&&t==i)return!0;if(t==(r<0?0:rm(e))){if(e.nodeName=="DIV")return!1;let s=e.parentNode;if(!s||s.nodeType!=1)return!1;t=gb(e)+(r<0?0:1),e=s}else if(e.nodeType==1){if(e=e.childNodes[t+(r<0?-1:0)],e.nodeType==1&&e.contentEditable=="false")return!1;t=r<0?rm(e):0}else return!1}}function rm(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function IC(e,t){let{left:n,right:i}=e;if(n==i)return e;let r=t?n:i;return{left:r,right:r,top:e.top,bottom:e.bottom}}function CIt(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function u3e(e,t){let n=t.width/e.offsetWidth,i=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(t.height-e.offsetHeight)<1)&&(i=1),{scaleX:n,scaleY:i}}function AIt(e,t,n,i,r,s,o,l){let c=e.ownerDocument,u=c.defaultView||window;for(let d=e,f=!1;d&&!f;)if(d.nodeType==1){let h,m=d==c.body,g=1,b=1;if(m)h=CIt(u);else{if(/^(fixed|sticky)$/.test(getComputedStyle(d).position)&&(f=!0),d.scrollHeight<=d.clientHeight&&d.scrollWidth<=d.clientWidth){d=d.assignedSlot||d.parentNode;continue}let w=d.getBoundingClientRect();({scaleX:g,scaleY:b}=u3e(d,w)),h={left:w.left,right:w.left+d.clientWidth*g,top:w.top,bottom:w.top+d.clientHeight*b}}let v=0,y=0;if(r=="nearest")t.top0&&t.bottom>h.bottom+y&&(y=t.bottom-h.bottom+o)):t.bottom>h.bottom-o&&(y=t.bottom-h.bottom+o,n<0&&t.top-y0&&t.right>h.right+v&&(v=t.right-h.right+s)):t.right>h.right-s&&(v=t.right-h.right+s,n<0&&t.lefth.bottom||t.lefth.right)&&(t={left:Math.max(t.left,h.left),right:Math.min(t.right,h.right),top:Math.max(t.top,h.top),bottom:Math.min(t.bottom,h.bottom)}),d=d.assignedSlot||d.parentNode}else if(d.nodeType==11)d=d.host;else break}function d3e(e,t=!0){let n=e.ownerDocument,i=null,r=null;for(let s=e.parentNode;s&&!(s==n.body||(!t||i)&&r);)if(s.nodeType==1)!r&&s.scrollHeight>s.clientHeight&&(r=s),t&&!i&&s.scrollWidth>s.clientWidth&&(i=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:i,y:r}}class TIt{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:n,focusNode:i}=t;this.set(n,Math.min(t.anchorOffset,n?rm(n):0),i,Math.min(t.focusOffset,i?rm(i):0))}set(t,n,i,r){this.anchorNode=t,this.anchorOffset=n,this.focusNode=i,this.focusOffset=r}}let py=null;pn.safari&&pn.safari_version>=26&&(py=!1);function f3e(e){if(e.setActive)return e.setActive();if(py)return e.focus(py);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(py==null?{get preventScroll(){return py={preventScroll:!0},!0}}:void 0),!py){py=!1;for(let n=0;nMath.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function p3e(e,t){for(let n=e,i=t;;){if(n.nodeType==3&&i>0)return{node:n,offset:i};if(n.nodeType==1&&i>0){if(n.contentEditable=="false")return null;n=n.childNodes[i-1],i=rm(n)}else if(n.parentNode&&!QI(n))i=gb(n),n=n.parentNode;else return null}}function m3e(e,t){for(let n=e,i=t;;){if(n.nodeType==3&&i=n){if(l.level==i)return o;(s<0||(r!=0?r<0?l.fromn:t[s].level>l.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}}function y3e(e,t){if(e.length!=t.length)return!1;for(let n=0;n=0;b-=3)if(Uf[b+1]==-m){let v=Uf[b+2],y=v&2?r:v&4?v&1?s:r:0;y&&(ls[f]=ls[Uf[b]]=y),l=b;break}}else{if(Uf.length==189)break;Uf[l++]=f,Uf[l++]=h,Uf[l++]=c}else if((g=ls[f])==2||g==1){let b=g==r;c=b?0:1;for(let v=l-3;v>=0;v-=3){let y=Uf[v+2];if(y&2)break;if(b)Uf[v+2]|=2;else{if(y&4)break;Uf[v+2]|=4}}}}}function MIt(e,t,n,i){for(let r=0,s=i;r<=n.length;r++){let o=r?n[r-1].to:e,l=rc;)g==v&&(g=n[--b].from,v=b?n[b-1].to:e),ls[--g]=m;c=d}else s=u,c++}}}function B9(e,t,n,i,r,s,o){let l=i%2?2:1;if(i%2==r%2)for(let c=t,u=0;cc&&o.push(new oh(c,b.from,m));let v=b.direction==y0!=!(m%2);U9(e,v?i+1:i,r,b.inner,b.from,b.to,o),c=b.to}g=b.to}else{if(g==n||(d?ls[g]!=l:ls[g]==l))break;g++}h?B9(e,c,g,i+1,r,h,o):ct;){let d=!0,f=!1;if(!u||c>s[u-1].to){let b=ls[c-1];b!=l&&(d=!1,f=b==16)}let h=!d&&l==1?[]:null,m=d?i:i+1,g=c;e:for(;;)if(u&&g==s[u-1].to){if(f)break e;let b=s[--u];if(!d)for(let v=b.from,y=u;;){if(v==t)break e;if(y&&s[y-1].to==v)v=s[--y].from;else{if(ls[v-1]==l)break e;break}}if(h)h.push(b);else{b.tols.length;)ls[ls.length]=256;let i=[],r=t==y0?0:1;return U9(e,r,r,n,0,e.length,i),i}function v3e(e){return[new oh(0,e,0)]}let x3e="";function $It(e,t,n,i,r){var s;let o=i.head-e.from,l=oh.find(t,o,(s=i.bidiLevel)!==null&&s!==void 0?s:-1,i.assoc),c=t[l],u=c.side(r,n);if(o==u){let h=l+=r?1:-1;if(h<0||h>=t.length)return null;c=t[l=h],o=c.side(!r,n),u=c.side(r,n)}let d=Io(e.text,o,c.forward(r,n));(dc.to)&&(d=u),x3e=e.text.slice(Math.min(o,d),Math.max(o,d));let f=l==(r?t.length-1:0)?null:t[l+(r?1:-1)];return f&&d==u&&f.level+(r?0:1)e.some(t=>t)}),T3e=gn.define({combine:e=>e.some(t=>t)}),_3e=gn.define();class bw{constructor(t,n,i,r,s,o=!1){this.range=t,this.y=n,this.x=i,this.yMargin=r,this.xMargin=s,this.isSnapshot=o}map(t){return t.empty?this:new bw(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new bw(ht.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Q_=hi.define({map:(e,t)=>e.map(t)}),j3e=hi.define();function Dc(e,t,n){let i=e.facet(S3e);i.length?i[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+":",t):console.error(t))}const Op=gn.define({combine:e=>e.length?e[0]:!0});let BIt=0;const Lx=gn.define({combine(e){return e.filter((t,n)=>{for(let i=0;i{let c=[];return o&&c.push(GM.of(u=>{let d=u.plugin(l);return d?o(d):$n.none})),s&&c.push(s(l)),c})}static fromClass(t,n){return ga.define((i,r)=>new t(i,r),n)}}class Y4{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(t){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(i){if(Dc(n.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(t,this.spec.arg)}catch(n){Dc(t.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(i){Dc(t.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const N3e=gn.define(),qq=gn.define(),GM=gn.define(),R3e=gn.define(),Wq=gn.define(),ST=gn.define(),I3e=gn.define();function Rie(e,t){let n=e.state.facet(I3e);if(!n.length)return n;let i=n.map(s=>s instanceof Function?s(e):s),r=[];return Gi.spans(i,t.from,t.to,{point(){},span(s,o,l,c){let u=s-t.from,d=o-t.from,f=r;for(let h=l.length-1;h>=0;h--,c--){let m=l[h].spec.bidiIsolate,g;if(m==null&&(m=FIt(t.text,u,d)),c>0&&f.length&&(g=f[f.length-1]).to==u&&g.direction==m)g.to=d,f=g.inner;else{let b={from:u,to:d,direction:m,inner:[]};f.push(b),f=b.inner}}}}),r}const P3e=gn.define();function Kq(e){let t=0,n=0,i=0,r=0;for(let s of e.state.facet(P3e)){let o=s(e);o&&(o.left!=null&&(t=Math.max(t,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(r=Math.max(r,o.bottom)))}return{left:t,right:n,top:i,bottom:r}}const fS=gn.define();class md{constructor(t,n,i,r){this.fromA=t,this.toA=n,this.fromB=i,this.toB=r}join(t){return new md(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let n=t.length,i=this;for(;n>0;n--){let r=t[n-1];if(!(r.fromA>i.toA)){if(r.toAr.push(new md(s,o,l,c))),this.changedRanges=r}static create(t,n,i){return new zI(t,n,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(t=>t.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const UIt=[];class ma{constructor(t,n,i=0){this.dom=t,this.length=n,this.flags=i,this.parent=null,t.cmTile=this}get breakAfter(){return this.flags&1}get children(){return UIt}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(t){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&kIt(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(t){this.dom=t,t.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(t,n=this.posAtStart){let i=n;for(let r of this.children){if(r==t)return i;i+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(t){return this.posBefore(t)+t.length}covers(t){return!0}coordsIn(t,n,i){return null}domPosFor(t,n){let i=gb(this.dom),r=this.length?t>0:n>0;return new uf(this.parent.dom,i+(r?1:0),t==0||t==this.length)}markDirty(t){this.flags&=-3,t&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let t=this;t;t=t.parent)if(t instanceof YM)return t;return null}static get(t){return t.cmTile}}class XM extends ma{constructor(t){super(t,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(t){this.children.push(t),t.parent=this}sync(t){if(this.flags&2)return;super.sync(t);let n=this.dom,i=null,r,s=(t==null?void 0:t.node)==n?t:null,o=0;for(let l of this.children){if(l.sync(t),o+=l.length+l.breakAfter,r=i?i.nextSibling:n.firstChild,s&&r!=l.dom&&(s.written=!0),l.dom.parentNode==n)for(;r&&r!=l.dom;)r=Iie(r);else n.insertBefore(l.dom,r);i=l.dom}for(r=i?i.nextSibling:n.firstChild,s&&r&&(s.written=!0);r;)r=Iie(r);this.length=o}}function Iie(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class YM extends XM{constructor(t,n){super(n),this.view=t}owns(t){for(;t;t=t.parent)if(t==this)return!0;return!1}isBlock(){return!0}nearest(t){for(;;){if(!t)return null;let n=ma.get(t);if(n&&this.owns(n))return n;t=t.parentNode}}blockTiles(t){for(let n=[],i=this,r=0,s=0;;)if(r==i.children.length){if(!n.length)return;i=i.parent,i.breakAfter&&s++,r=n.pop()}else{let o=i.children[r++];if(o instanceof zp)n.push(r),i=o,r=0;else{let l=s+o.length,c=t(o,s);if(c!==void 0)return c;s=l+o.breakAfter}}}resolveBlock(t,n){let i,r=-1,s,o=-1;if(this.blockTiles((l,c)=>{let u=c+l.length;if(t>=c&&t<=u){if(l.isWidget()&&n>=-1&&n<=1){if(l.flags&32)return!0;l.flags&16&&(i=void 0)}(ct||t==c&&(n>1?l.length:l.covers(-1)))&&(!s||!l.isWidget()&&s.isWidget())&&(s=l,o=t-c)}}),!i&&!s)throw new Error("No tile at position "+t);return i&&n<0||!s?{tile:i,offset:r}:{tile:s,offset:o}}}class zp extends XM{constructor(t,n){super(t),this.wrapper=n}isBlock(){return!0}covers(t){return this.children.length?t<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(t,n){let i=new zp(n||document.createElement(t.tagName),t);return n||(i.flags|=4),i}}class l1 extends XM{constructor(t,n){super(t),this.attrs=n}isLine(){return!0}static start(t,n,i){let r=new l1(n||document.createElement("div"),t);return(!n||!i)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(t,n,i){let r=null,s=-1,o=null,l=-1;function c(d,f){for(let h=0,m=0;h=f&&(g.isComposite()?c(g,f-m):(!o||o.isHidden&&(n>0&&!(o.flags&32)||i&&zIt(o,g)))&&(b>f||g.flags&32)?(o=g,l=f-m):(mr&&(t=r);let s=t,o=t,l=0;t==0&&n<0||t==r&&n>=0?pn.chrome||pn.gecko||(t?(s--,l=1):o=0)?0:c.length-1];return pn.safari&&!l&&u.width==0&&(u=Array.prototype.find.call(c,d=>d.width)||u),i==null?u:IC(u,(l?l>0:n<0)==i)}static of(t,n){let i=new Ny(n||document.createTextNode(t),t);return n||(i.flags|=2),i}}class v0 extends ma{constructor(t,n,i,r){super(t,n,r),this.widget=i}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(t){return this.flags&48?!1:(this.flags&(t<0?64:128))>0}coordsIn(t,n){return this.coordsInWidget(t,n,!1)}coordsInWidget(t,n,i){let r=this.widget.coordsAt(this.dom,t,n);if(r)return r;if(i)return IC(this.dom.getBoundingClientRect(),this.length?t==0:n<=0);{let s=this.dom.getClientRects(),o=null;if(!s.length)return null;let l=this.flags&16?!0:this.flags&32?!1:t>0;for(let c=l?s.length-1:0;o=s[c],!(t>0?c==0:c==s.length-1||o.top0==i)}}class VIt{constructor(t){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=t}advance(t,n,i){let{tile:r,index:s,beforeBreak:o,parents:l}=this;for(;t||n>0;)if(r.isComposite())if(o){if(!t)break;i&&i.break(),t--,o=!1}else if(s==r.children.length){if(!t&&!l.length)break;i&&i.leave(r),o=!!r.breakAfter,{tile:r,index:s}=l.pop(),s++}else{let c=r.children[s],u=c.breakAfter;(n>0?c.length<=t:c.length=0;l--){let c=n.marks[l],u=r.lastChild;if(u instanceof Ic&&u.mark.eq(c.mark))u.dom!=c.dom&&u.setDOM(Z4(c.dom)),r=u;else{if(this.cache.reused.get(c)){let f=ma.get(c.dom);f&&f.setDOM(Z4(c.dom))}let d=Ic.of(c.mark,c.dom);r.append(d),r=d}this.cache.reused.set(c,2)}let s=ma.get(t.text);s&&this.cache.reused.set(s,2);let o=new Ny(t.text,t.text.nodeValue);o.flags|=8,this.pos=t.range.toB,r.append(o)}addInlineWidget(t,n,i){let r=this.afterWidget&&t.flags&48&&(this.afterWidget.flags&48)==(t.flags&48);r||this.flushBuffer();let s=this.ensureMarks(n,i);!r&&!(t.flags&16)&&s.append(this.getBuffer(1)),s.append(t),this.pos+=t.length,this.afterWidget=t}addMark(t,n,i){this.flushBuffer(),this.ensureMarks(n,i).append(t),this.pos+=t.length,this.afterWidget=null}addBlockWidget(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}continueWidget(t){let n=this.afterWidget||this.lastBlock;n.length+=t,this.pos+=t}addLineStart(t,n){var i;t||(t=D3e);let r=l1.start(t,n||((i=this.cache.find(l1))===null||i===void 0?void 0:i.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(t){this.blockPosCovered()||this.addLineStart(t)}ensureLine(t){this.curLine||this.addLineStart(t)}ensureMarks(t,n){var i;let r=this.curLine;for(let s=t.length-1;s>=0;s--){let o=t[s],l;if(n>0&&(l=r.lastChild)&&l instanceof Ic&&l.mark.eq(o))r=l,n--;else{let c=Ic.of(o,(i=this.cache.find(Ic,u=>u.mark.eq(o)))===null||i===void 0?void 0:i.dom);r.append(c),r=c,n=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let t=this.curLine.lastChild;(!t||!Pie(this.curLine,!1)||t.dom.nodeName!="BR"&&t.isWidget()&&!(pn.ios&&Pie(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(J4,0,32)||new v0(J4.toDOM(),0,J4,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let t=this.wrappers.length-1;t>=0;t--)this.wrappers[t].to=this.pos){let n=t.rank*102+t.value.rank,i=new HIt(t.from,t.to,t.value,n),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-i.rank||this.wrappers[r-1].to-i.to)<0;)r--;this.wrappers.splice(r,0,i)}this.wrapperPos=this.pos}getBlockPos(){var t;this.updateBlockWrappers();let n=this.root;for(let i of this.wrappers){let r=n.lastChild;if(i.fromo.wrapper.eq(i.wrapper)))===null||t===void 0?void 0:t.dom);n.append(s),n=s}}return n}blockPosCovered(){let t=this.lastBlock;return t!=null&&!t.breakAfter&&(!t.isWidget()||(t.flags&160)>0)}getBuffer(t){let n=2|(t<0?16:32),i=this.cache.find(VI,void 0,1);return i&&(i.flags=n),i||new VI(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class WIt{constructor(t){this.skipCount=0,this.text="",this.textOff=0,this.cursor=t.iter()}skip(t){this.textOff+t<=this.text.length?this.textOff+=t:(this.skipCount+=t-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(t){if(this.textOff==this.text.length){let{value:r,lineBreak:s,done:o}=this.cursor.next(this.skipCount);if(this.skipCount=0,o)throw new Error("Ran out of text content when drawing inline views");this.text=r;let l=this.textOff=Math.min(t,r.length);return s?null:r.slice(0,l)}let n=Math.min(this.text.length,this.textOff+t),i=this.text.slice(this.textOff,n);return this.textOff=n,i}}const HI=[v0,l1,Ny,Ic,VI,zp,YM];for(let e=0;e[]),this.index=HI.map(()=>0),this.reused=new Map}add(t){let n=t.constructor.bucket,i=this.buckets[n];i.length<6?i.push(t):i[this.index[n]=(this.index[n]+1)%6]=t}find(t,n,i=2){let r=t.bucket,s=this.buckets[r],o=this.index[r];for(let l=0;l{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(t,n){let i=n&&this.getCompositionContext(n.text);for(let r=0,s=0,o=0;;){let l=or){let u=c-r;this.preserve(u,!o,!l),r=c,s+=u}if(!l)break;n&&l.fromA<=n.range.fromA&&l.toA>=n.range.toA?(this.forward(l.fromA,n.range.fromA,n.range.fromA{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(c-l);else{let u=c>0||l{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof Ic&&r.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?r.length&&(r.length=s=0):o instanceof Ic&&(r.shift(),s=Math.min(s,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(t)}emit(t,n){let i=null,r=this.builder,s=-1,o=Gi.spans(this.decorations,t,n,{point:(l,c,u,d,f,h)=>{if(u instanceof b0){if(this.disallowBlockEffectsFor[h]){if(u.block)throw new RangeError("Block decorations may not be specified via plugins");if(c>this.view.state.doc.lineAt(l).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=d.length,f>d.length)r.continueWidget(c-l);else{let m=u.widget||(u.block?c1.block:c1.inline),g=XIt(u),b=this.cache.findWidget(m,c-l,g)||v0.of(m,this.view,c-l,g);u.block?(u.startSide>0&&r.addLineStartIfNotCovered(i),r.addBlockWidget(b)):(r.ensureLine(i),r.addInlineWidget(b,d,f))}i=null}else i=YIt(i,u);c>l&&this.text.skip(c-l)},span:(l,c,u,d)=>{for(let f=l;f-1&&(this.openWidget=o>s),this.openWidget||r.addLineStartIfNotCovered(i),this.openMarks=o}forward(t,n,i=1){n-t<=10?this.old.advance(n-t,i,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-t-10,-1),this.old.advance(5,i,this.reuseWalker))}getCompositionContext(t){let n=[],i=null;for(let r=t.parentNode;;r=r.parentNode){let s=ma.get(r);if(r==this.view.contentDOM)break;s instanceof Ic?n.push(s):s!=null&&s.isLine()?i=s:s instanceof zp||(r.nodeName=="DIV"&&!i&&r!=this.view.contentDOM?i=new l1(r,D3e):i||n.push(Ic.of(new OT({tagName:r.nodeName.toLowerCase(),attributes:SIt(r)}),r)))}return{line:i,marks:n}}}function Pie(e,t){let n=i=>{for(let r of i.children)if((t?r.isText():r.length)||n(r))return!0;return!1};return n(e)}function XIt(e){let t=e.isReplace?(e.startSide<0?64:0)|(e.endSide>0?128:0):e.startSide>0?32:16;return e.block&&(t|=256),t}const D3e={class:"cm-line"};function YIt(e,t){let n=t.spec.attributes,i=t.spec.class;return!n&&!i||(e||(e={class:"cm-line"}),n&&Uq(n,e),i&&(e.class+=" "+i)),e}function ZIt(e){let t=[];for(let n=e.parents.length;n>1;n--){let i=n==e.parents.length?e.tile:e.parents[n].tile;i instanceof Ic&&t.push(i.mark)}return t}function Z4(e){let t=ma.get(e);return t&&t.setDOM(e.cloneNode()),e}class c1 extends Nf{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}c1.inline=new c1("span");c1.block=new c1("div");const J4=new class extends Nf{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class Die{constructor(t){this.view=t,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=$n.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new YM(t,t.contentDOM),this.updateInner([new md(0,0,0,t.state.doc.length)],null)}update(t){var n;let i=t.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:d,toA:f})=>fthis.minWidthTo)?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(t);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?r=this.domChanged.newSel.head:!oPt(t.changes,this.hasComposition)&&!t.selectionSet&&(r=t.state.selection.main.head));let s=r>-1?ePt(this.view,t.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:d,to:f}=this.hasComposition;i=new md(d,f,t.changes.mapPos(d,-1),t.changes.mapPos(f,1)).addToSet(i.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(pn.ie||pn.chrome)&&!s&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.blockWrappers;this.updateDeco();let c=iPt(o,this.decorations,t.changes);c.length&&(i=md.extendWithRanges(i,c));let u=sPt(l,this.blockWrappers,t.changes);return u.length&&(i=md.extendWithRanges(i,u)),s&&!i.some(d=>d.fromA<=s.range.fromA&&d.toA>=s.range.toA)&&(i=s.range.addToSet(i.slice())),this.tile.flags&2&&i.length==0?!1:(this.updateInner(i,s),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,n){this.view.viewState.mustMeasureContent=!0;let{observer:i}=this.view;i.ignore(()=>{if(n||t.length){let o=this.tile,l=new GIt(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&ma.get(n.text)&&l.cache.reused.set(ma.get(n.text),2),this.tile=l.run(t,n),z9(o,l.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=pn.chrome||pn.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||i.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to-1)&&mE(i,this.view.observer.selectionRange)&&!(r&&i.contains(r));if(!(s||n||o))return;let l=this.forceSelection;this.forceSelection=!1;let c=this.view.state.selection.main,u,d;if(c.empty?d=u=this.inlineDOMNearPos(c.anchor,c.assoc||1):(d=this.inlineDOMNearPos(c.head,c.head==c.from?1:-1),u=this.inlineDOMNearPos(c.anchor,c.anchor==c.from?1:-1)),pn.gecko&&c.empty&&!this.hasComposition&&JIt(u)){let h=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(h,u.node.childNodes[u.offset]||null)),u=d=new uf(h,0),l=!0}let f=this.view.observer.selectionRange;(l||!f.focusNode||(!bE(u.node,u.offset,f.anchorNode,f.anchorOffset)||!bE(d.node,d.offset,f.focusNode,f.focusOffset))&&!this.suppressWidgetCursorChange(f,c))&&(this.view.observer.ignore(()=>{pn.android&&pn.chrome&&i.contains(f.focusNode)&&aPt(f.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let h=RC(this.view.root);if(h)if(c.empty){if(pn.gecko){let m=tPt(u.node,u.offset);if(m&&m!=3){let g=(m==1?p3e:m3e)(u.node,u.offset);g&&(u=new uf(g.node,g.offset))}}h.collapse(u.node,u.offset),c.bidiLevel!=null&&h.caretBidiLevel!==void 0&&(h.caretBidiLevel=c.bidiLevel)}else if(h.extend){h.collapse(u.node,u.offset);try{h.extend(d.node,d.offset)}catch{}}else{let m=document.createRange();c.anchor>c.head&&([u,d]=[d,u]),m.setEnd(d.node,d.offset),m.setStart(u.node,u.offset),h.removeAllRanges(),h.addRange(m)}o&&this.view.root.activeElement==i&&(i.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(u,d)),this.impreciseAnchor=u.precise?null:new uf(f.anchorNode,f.anchorOffset),this.impreciseHead=d.precise?null:new uf(f.focusNode,f.focusOffset)}suppressWidgetCursorChange(t,n){return this.hasComposition&&n.empty&&bE(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,n=t.state.selection.main,i=RC(t.root),{anchorNode:r,anchorOffset:s}=t.observer.selectionRange;if(!i||!n.empty||!n.assoc||!i.modify)return;let o=this.lineAt(n.head,n.assoc);if(!o)return;let l=o.posAtStart;if(n.head==l||n.head==l+o.length)return;let c=this.coordsAt(n.head,-1),u=this.coordsAt(n.head,1);if(!c||!u||c.bottom>u.top)return;let d=this.domAtPos(n.head+n.assoc,n.assoc);i.collapse(d.node,d.offset),i.modify("move",n.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let f=t.observer.selectionRange;t.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=n.from&&i.collapse(r,s)}posFromDOM(t,n){let i=this.tile.nearest(t);if(!i)return this.tile.dom.compareDocumentPosition(t)&2?0:this.view.state.doc.length;let r=i.posAtStart;if(i.isComposite()){let s;if(t==i.dom)s=i.dom.childNodes[n];else{let o=rm(t)==0?0:n==0?-1:1;for(;;){let l=t.parentNode;if(l==i.dom)break;o==0&&l.firstChild!=l.lastChild&&(t==l.firstChild?o=-1:o=1),t=l}o<0?s=t:s=t.nextSibling}if(s==i.dom.firstChild)return r;for(;s&&!ma.get(s);)s=s.nextSibling;if(!s)return r+i.length;for(let o=0,l=r;;o++){let c=i.children[o];if(c.dom==s)return l;l+=c.length+c.breakAfter}}else return i.isText()?t==i.dom?r+n:r+(n?i.length:0):r}domAtPos(t,n){let{tile:i,offset:r}=this.tile.resolveBlock(t,n);return i.isWidget()?i.domPosFor(r,n):i.domIn(r,n)}inlineDOMNearPos(t,n){let i,r=-1,s=!1,o,l=-1,c=!1;return this.tile.blockTiles((u,d)=>{if(u.isWidget()){if(u.flags&32&&d>=t)return!0;u.flags&16&&(s=!0)}else{let f=d+u.length;if(d<=t&&(i=u,r=t-d,s=f=t&&!o&&(o=u,l=t-d,c=d>t),d>t&&o)return!0}}),!i&&!o?this.domAtPos(t,n):(s&&o?i=null:c&&i&&(o=null),i&&n<0||!o?i.domIn(r,n):o.domIn(l,n))}coordsAt(t,n,i){let{tile:r,offset:s}=this.tile.resolveBlock(t,n);return r.isWidget()?r.widget instanceof e$?null:r.coordsInWidget(s,n,!0):r.coordsIn(s,n,i)}lineAt(t,n){let{tile:i}=this.tile.resolveBlock(t,n);return i.isLine()?i:null}coordsForChar(t){let{tile:n,offset:i}=this.tile.resolveBlock(t,1);if(!n.isLine())return null;function r(s,o){if(s.isComposite())for(let l of s.children){if(l.length>=o){let c=r(l,o);if(c)return c}if(o-=l.length,o<0)break}else if(s.isText()&&oMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,c=this.view.textDirection==cs.LTR,u=0,d=(f,h,m)=>{for(let g=0;gr);g++){let b=f.children[g],v=h+b.length,y=b.dom.getBoundingClientRect(),{height:w}=y;if(m&&!g&&(u+=y.top-m.top),b instanceof zp)v>i&&d(b,h,y);else if(h>=i&&(u>0&&n.push(-u),n.push(w+u),u=0,o)){let x=b.dom.lastChild,O=x?gE(x):[];if(O.length){let k=O[O.length-1],S=c?k.right-y.left:y.right-k.left;S>l&&(l=S,this.minWidth=s,this.minWidthFrom=h,this.minWidthTo=v)}}m&&g==f.children.length-1&&(u+=m.bottom-y.bottom),h=v+b.breakAfter}};return d(this.tile,0,null),n}textDirectionAt(t){let{tile:n}=this.tile.resolveBlock(t,1);return getComputedStyle(n.dom).direction=="rtl"?cs.RTL:cs.LTR}measureTextSize(){let t=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let l=0,c;for(let u of o.children){if(!u.isText()||/[^ -~]/.test(u.text))return;let d=gE(u.dom);if(d.length!=1)return;l+=d[0].width,c=d[0].height}if(l)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:l/o.length,textHeight:c}}});if(t)return t;let n=document.createElement("div"),i,r,s;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let o=gE(n.firstChild)[0];i=n.getBoundingClientRect().height,r=o&&o.width?o.width/27:7,s=o&&o.height?o.height:i,n.remove()}),{lineHeight:i,charWidth:r,textHeight:s}}computeBlockGapDeco(){let t=[],n=this.view.viewState;for(let i=0,r=0;;r++){let s=r==n.viewports.length?null:n.viewports[r],o=s?s.from-1:this.view.state.doc.length;if(o>i){let l=(n.lineBlockAt(o).bottom-n.lineBlockAt(i).top)/this.view.scaleY;t.push($n.replace({widget:new e$(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!s)break;i=s.to+1}return $n.set(t)}updateDeco(){let t=1,n=this.view.state.facet(GM).map(s=>(this.dynamicDecorationMap[t++]=typeof s=="function")?s(this.view):s),i=!1,r=this.view.state.facet(Wq).map((s,o)=>{let l=typeof s=="function";return l&&(i=!0),l?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[t++]=i,n.push(Gi.join(r))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];ttypeof s=="function"?s(this.view):s)}scrollIntoView(t){if(t.isSnapshot){let u=this.view.viewState.lineBlockAt(t.range.head);this.view.scrollDOM.scrollTop=u.top-t.yMargin,this.view.scrollDOM.scrollLeft=t.xMargin;return}for(let u of this.view.state.facet(_3e))try{if(u(this.view,t.range,t))return!0}catch(d){Dc(this.view.state,d,"scroll handler")}let{range:n}=t,i=this.coordsAt(n.head,n.assoc||(n.head>n.anchor?-1:1)),r;if(!i)return;!n.empty&&(r=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(i={left:Math.min(i.left,r.left),top:Math.min(i.top,r.top),right:Math.max(i.right,r.right),bottom:Math.max(i.bottom,r.bottom)});let s=Kq(this.view),o={left:i.left-s.left,top:i.top-s.top,right:i.right+s.right,bottom:i.bottom+s.bottom},{offsetWidth:l,offsetHeight:c}=this.view.scrollDOM;if(AIt(this.view.scrollDOM,o,n.head1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottomi.isWidget()||i.children.some(n);return n(this.tile.resolveBlock(t,1).tile)}destroy(){z9(this.tile)}}function z9(e,t){let n=t==null?void 0:t.get(e);if(n!=1){n==null&&e.destroy();for(let i of e.children)z9(i,t)}}function JIt(e){return e.node.nodeType==1&&e.node.firstChild&&(e.offset==0||e.node.childNodes[e.offset-1].contentEditable=="false")&&(e.offset==e.node.childNodes.length||e.node.childNodes[e.offset].contentEditable=="false")}function M3e(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let i=p3e(n.focusNode,n.focusOffset),r=m3e(n.focusNode,n.focusOffset),s=i||r;if(r&&i&&r.node!=i.node){let l=ma.get(r.node);if(!l||l.isText()&&l.text!=r.node.nodeValue)s=r;else if(e.docView.lastCompositionAfterCursor){let c=ma.get(i.node);!c||c.isText()&&c.text!=i.node.nodeValue||(s=r)}}if(e.docView.lastCompositionAfterCursor=s!=i,!s)return null;let o=t-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function ePt(e,t,n){let i=M3e(e,n);if(!i)return null;let{node:r,from:s,to:o}=i,l=r.nodeValue;if(/[\n\r]/.test(l)||e.state.doc.sliceString(i.from,i.to)!=l)return null;let c=t.invertedDesc;return{range:new md(c.mapPos(s),c.mapPos(o),s,o),text:r}}function tPt(e,t){return e.nodeType!=1?0:(t&&e.childNodes[t-1].contentEditable=="false"?1:0)|(t{it.from&&(n=!0)}),n}class e$ extends Nf{constructor(t){super(),this.height=t}toDOM(){let t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function lPt(e,t,n=1){let i=e.charCategorizer(t),r=e.doc.lineAt(t),s=t-r.from;if(r.length==0)return ht.cursor(t);s==0?n=1:s==r.length&&(n=-1);let o=s,l=s;n<0?o=Io(r.text,s,!1):l=Io(r.text,s);let c=i(r.text.slice(o,l));for(;o>0;){let u=Io(r.text,o,!1);if(i(r.text.slice(u,o))!=c)break;o=u}for(;le.defaultLineHeight*1.5){let l=e.viewState.heightOracle.textHeight,c=Math.floor((r-n.top-(e.defaultLineHeight-l)*.5)/l);s+=c*e.viewState.heightOracle.lineLength}let o=e.state.sliceDoc(n.from,n.to);return n.from+N9(o,s,e.state.tabSize)}function V9(e,t,n){let i=e.lineBlockAt(t);if(Array.isArray(i.type)){let r;for(let s of i.type){if(s.from>t)break;if(!(s.tot)return s;(!r||s.type==ol.Text&&(r.type!=s.type||(n<0?s.fromt)))&&(r=s)}}return r||i}return i}function uPt(e,t,n,i){let r=V9(e,t.head,t.assoc||-1),s=!i||r.type!=ol.Text||!(e.lineWrapping||r.widgetLineBreaks)?null:e.coordsAtPos(t.assoc<0&&t.head>r.from?t.head-1:t.head);if(s){let o=e.dom.getBoundingClientRect(),l=e.textDirectionAt(r.from),c=e.posAtCoords({x:n==(l==cs.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(c!=null)return ht.cursor(c,n?-1:1)}return ht.cursor(n?r.to:r.from,n?-1:1)}function Mie(e,t,n,i){let r=e.state.doc.lineAt(t.head),s=e.bidiSpans(r),o=e.textDirectionAt(r.from);for(let l=t,c=null;;){let u=$It(r,s,o,l,n),d=x3e;if(!u){if(r.number==(n?e.state.doc.lines:1))return l;d=` -`,r=e.state.doc.line(r.number+(n?1:-1)),s=e.bidiSpans(r),u=e.visualLineSide(r,!n)}if(c){if(!c(d))return l}else{if(!i)return u;c=i(d)}l=u}}function dPt(e,t,n){let i=e.state.charCategorizer(t),r=i(n);return s=>{let o=i(s);return r==zs.Space&&(r=o),r==o}}function fPt(e,t,n,i){let r=t.head,s=n?1:-1;if(r==(n?e.state.doc.length:0))return ht.cursor(r,t.assoc);let o=t.goalColumn,l,c=e.contentDOM.getBoundingClientRect(),u=e.coordsAtPos(r,t.assoc||((t.empty?n:t.head==t.from)?1:-1)),d=e.documentTop;if(u)o==null&&(o=u.left-c.left),l=s<0?u.top:u.bottom;else{let g=e.viewState.lineBlockAt(r);o==null&&(o=Math.min(c.right-c.left,e.defaultCharacterWidth*(r-g.from))),l=(s<0?g.top:g.bottom)+d}let f=c.left+o,h=e.viewState.heightOracle.textHeight>>1,m=i??h;for(let g=0;;g+=h){let b=l+(m+g)*s,v=H9(e,{x:f,y:b},!1,s);if(n?b>c.bottom:bl:w{if(t>s&&tr(e)),n.from,t.head>n.from?-1:1);return i==n.from?n:ht.cursor(i,ie.viewState.docHeight)return new eh(e.state.doc.length,-1);if(u=e.elementAtHeight(c),i==null)break;if(u.type==ol.Text){if(i<0?u.toe.viewport.to)break;let h=e.docView.coordsAt(i<0?u.from:u.to,i>0?-1:1);if(h&&(i<0?h.top<=c+s:h.bottom>=c+s))break}let f=e.viewState.heightOracle.textHeight/2;c=i>0?u.bottom+f:u.top-f}if(e.viewport.from>=u.to||e.viewport.to<=u.from){if(n)return null;if(u.type==ol.Text){let f=cPt(e,r,u,o,l);return new eh(f,f==u.from?1:-1)}}if(u.type!=ol.Text)return c<(u.top+u.bottom)/2?new eh(u.from,1):new eh(u.to,-1);let d=e.docView.lineAt(u.from,2);return(!d||d.length!=u.length)&&(d=e.docView.lineAt(u.from,-2)),new hPt(e,o,l,e.textDirectionAt(u.from)).scanTile(d,u.from)}class hPt{constructor(t,n,i,r){this.view=t,this.x=n,this.y=i,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(t){return(!this.line||this.line.from>t||this.line.to1||i.length&&(i[0].level!=this.baseDir||i[0].to+r.from>1;t:if(o.has(b)){let y=r+Math.floor(Math.random()*g);for(let w=0;w1)){if(w.bottomthis.y)(!u||u.top>w.top)&&(u=w),x=-1;else{let O=w.left>this.x?this.x-w.left:w.right(g+g+b)/3)return this.y=c.bottom-1,this.scan(t,n,!0);if(u&&u.top<(g+b+b)/3)return this.y=u.top+1,this.scan(t,n,!0)}let m=(l?this.dirAt(t[d],1):this.baseDir)==cs.LTR;return{i:d,after:this.x>(h.left+h.right)/2==m}}scanText(t,n){let i=[];for(let s=0;s{let o=i[s]-n,l=i[s+1]-n;return PC(t.dom,o,l).getClientRects()});return r.after?new eh(i[r.i+1],-1):new eh(i[r.i],1)}scanTile(t,n){if(!t.length)return new eh(n,1);if(t.children.length==1){let l=t.children[0];if(l.isText())return this.scanText(l,n);if(l.isComposite())return this.scanTile(l,n)}let i=[n];for(let l=0,c=n;l{let c=t.children[l];return c.flags&48?null:(c.dom.nodeType==1?c.dom:PC(c.dom,0,c.length)).getClientRects()}),s=t.children[r.i],o=i[r.i];return s.isText()?this.scanText(s,o):s.isComposite()?this.scanTile(s,o):r.after?new eh(i[r.i+1],-1):new eh(o,1)}}const ox="￿";class pPt{constructor(t,n){this.points=t,this.view=n,this.text="",this.lineSeparator=n.state.facet(tr.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=ox}readRange(t,n){if(!t)return this;let i=t.parentNode;for(let r=t;;){this.findPointBefore(i,r);let s=this.text.length;this.readNode(r);let o=ma.get(r),l=r.nextSibling;if(l==n){o!=null&&o.breakAfter&&!l&&i!=this.view.contentDOM&&this.lineBreak();break}let c=ma.get(l);(o&&c?o.breakAfter:(o?o.breakAfter:QI(r))||QI(l)&&(r.nodeName!="BR"||o!=null&&o.isWidget())&&this.text.length>s)&&!gPt(l,n)&&this.lineBreak(),r=l}return this.findPointBefore(i,n),this}readTextNode(t){let n=t.nodeValue;for(let i of this.points)i.node==t&&(i.pos=this.text.length+Math.min(i.offset,n.length));for(let i=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,l;if(this.lineSeparator?(s=n.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=r.exec(n))&&(s=l.index,o=l[0].length),this.append(n.slice(i,s<0?n.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let c of this.points)c.node==t&&c.pos>this.text.length&&(c.pos-=o-1);i=s+o}}readNode(t){let n=ma.get(t),i=n&&n.overrideDOMText;if(i!=null){this.findPointInside(t,i.length);for(let r=i.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else t.nodeType==3?this.readTextNode(t):t.nodeName=="BR"?t.nextSibling&&this.lineBreak():t.nodeType==1&&this.readRange(t.firstChild,null)}findPointBefore(t,n){for(let i of this.points)i.node==t&&t.childNodes[i.offset]==n&&(i.pos=this.text.length)}findPointInside(t,n){for(let i of this.points)(t.nodeType==3?i.node==t:t.contains(i.node))&&(i.pos=this.text.length+(mPt(t,i.node,i.offset)?n:0))}}function mPt(e,t,n){for(;;){if(!t||n-1;let{impreciseHead:s,impreciseAnchor:o}=t.docView,l=t.state.selection;if(t.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=$3e(t.docView.tile,n,i,0))){let c=s||o?[]:vPt(t),u=new pPt(c,t);u.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=u.text,this.newSel=xPt(c,this.bounds.from)}else{let c=t.observer.selectionRange,u=s&&s.node==c.focusNode&&s.offset==c.focusOffset||!$9(t.contentDOM,c.focusNode)?l.main.head:t.docView.posFromDOM(c.focusNode,c.focusOffset),d=o&&o.node==c.anchorNode&&o.offset==c.anchorOffset||!$9(t.contentDOM,c.anchorNode)?l.main.anchor:t.docView.posFromDOM(c.anchorNode,c.anchorOffset),f=t.viewport;if((pn.ios||pn.chrome)&&u!=d&&Math.min(u,d)<=l.main.from&&Math.max(u,d)>=l.main.to&&(f.from>0||f.to-1&&l.ranges.length>1)this.newSel=l.replaceRange(ht.range(d,u));else if(t.lineWrapping&&d==u&&!(l.main.empty&&l.main.head==u)&&t.inputState.lastTouchTime>Date.now()-100){let h=t.coordsAtPos(u,-1),m=0;h&&(m=t.inputState.lastTouchY<=h.bottom?-1:1),this.newSel=ht.create([ht.cursor(u,m)])}else this.newSel=ht.single(d,u)}}}function $3e(e,t,n,i){if(e.isComposite()){let r=-1,s=-1,o=-1,l=-1;for(let c=0,u=i,d=i;cn)return $3e(f,t,n,u);if(h>=t&&r==-1&&(r=c,s=u),u>n&&f.dom.parentNode==e.dom){o=c,l=d;break}d=h,u=h+f.breakAfter}return{from:s,to:l<0?i+e.length:l,startDOM:(r?e.children[r-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:o=0?e.children[o].dom:null}}else return e.isText()?{from:i,to:i+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling}:null}function F3e(e,t){let n,{newSel:i}=t,{state:r}=e,s=r.selection.main,o=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:l,to:c}=t.bounds,u=s.from,d=null;(o===8||pn.android&&t.text.length=l&&s.to<=c&&(t.typeOver||f!=t.text)&&f.slice(0,s.from-l)==t.text.slice(0,s.from-l)&&f.slice(s.to-l)==t.text.slice(h=t.text.length-(f.length-(s.to-l)))?n={from:s.from,to:s.to,insert:Or.of(t.text.slice(s.from-l,h).split(ox))}:(m=B3e(f,t.text,u-l,d))&&(pn.chrome&&o==13&&m.toB==m.from+2&&t.text.slice(m.from,m.toB)==ox+ox&&m.toB--,n={from:l+m.from,to:l+m.toA,insert:Or.of(t.text.slice(m.from,m.toB).split(ox))})}else i&&(!e.hasFocus&&r.facet(Op)||qI(i,s))&&(i=null);if(!n&&!i)return!1;if((pn.mac||pn.android)&&n&&n.from==n.to&&n.from==s.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute("autocorrect")=="off"?(i&&n.insert.length==2&&(i=ht.single(i.main.anchor-1,i.main.head-1)),n={from:n.from,to:n.to,insert:Or.of([n.insert.toString().replace("."," ")])}):r.doc.lineAt(s.from).toDate.now()-50?n={from:s.from,to:s.to,insert:r.toText(e.inputState.insertingText)}:pn.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==` - `&&e.lineWrapping&&(i&&(i=ht.single(i.main.anchor-1,i.main.head-1)),n={from:s.from,to:s.to,insert:Or.of([" "])}),n)return Gq(e,n,i,o);if(i&&!qI(i,s)){let l=!1,c="select";return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin=="select"&&(l=!0),c=e.inputState.lastSelectionOrigin,c=="select.pointer"&&(i=L3e(r.facet(ST).map(u=>u(e)),i))),e.dispatch({selection:i,scrollIntoView:l,userEvent:c}),!0}else return!1}function Gq(e,t,n,i=-1){if(pn.ios&&e.inputState.flushIOSKey(t))return!0;let r=e.state.selection.main;if(pn.android&&(t.to==r.to&&(t.from==r.from||t.from==r.from-1&&e.state.sliceDoc(t.from,r.from)==" ")&&t.insert.length==1&&t.insert.lines==2&&gw(e.contentDOM,"Enter",13)||(t.from==r.from-1&&t.to==r.to&&t.insert.length==0||i==8&&t.insert.lengthr.head)&&gw(e.contentDOM,"Backspace",8)||t.from==r.from&&t.to==r.to+1&&t.insert.length==0&&gw(e.contentDOM,"Delete",46)))return!0;let s=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let o,l=()=>o||(o=yPt(e,t,n));return e.state.facet(E3e).some(c=>c(e,t.from,t.to,s,l))||e.dispatch(l()),!0}function yPt(e,t,n){let i,r=e.state,s=r.selection.main,o=-1;if(t.from==t.to&&t.froms.to){let c=t.fromf(e)),u,c);t.from==d&&(o=d)}if(o>-1)i={changes:t,selection:ht.cursor(t.from+t.insert.length,-1)};else if(t.from>=s.from&&t.to<=s.to&&t.to-t.from>=(s.to-s.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let c=s.fromt.to?r.sliceDoc(t.to,s.to):"";i=r.replaceSelection(e.state.toText(c+t.insert.sliceString(0,void 0,e.state.lineBreak)+u))}else{let c=r.changes(t),u=n&&n.main.to<=c.newLength?n.main:void 0;if(r.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=s.to+10&&t.to>=s.to-10){let d=e.state.sliceDoc(t.from,t.to),f,h=n&&M3e(e,n.main.head);if(h){let g=t.insert.length-(t.to-t.from);f={from:h.from,to:h.to-g}}else f=e.state.doc.lineAt(s.head);let m=s.to-t.to;i=r.changeByRange(g=>{if(g.from==s.from&&g.to==s.to)return{changes:c,range:u||g.map(c)};let b=g.to-m,v=b-d.length;if(e.state.sliceDoc(v,b)!=d||b>=f.from&&v<=f.to)return{range:g};let y=r.changes({from:v,to:b,insert:t.insert}),w=g.to-s.to;return{changes:y,range:u?ht.range(Math.max(0,u.anchor+w),Math.max(0,u.head+w)):g.map(y)}})}else i={changes:c,selection:u&&r.selection.replaceRange(u)}}let l="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,l+=".compose",e.inputState.compositionFirstChange&&(l+=".start",e.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:l,scrollIntoView:!0})}function B3e(e,t,n,i){let r=Math.min(e.length,t.length),s=0;for(;s0&&l>0&&e.charCodeAt(o-1)==t.charCodeAt(l-1);)o--,l--;if(i=="end"){let c=Math.max(0,s-Math.min(o,l));n-=o+c-s}if(o=o?s-n:0;s-=c,l=s+(l-o),o=s}else if(l=l?s-n:0;s-=c,o=s+(o-l),l=s}return{from:s,toA:o,toB:l}}function vPt(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}=e.observer.selectionRange;return n&&(t.push(new Lie(n,i)),(r!=n||s!=i)&&t.push(new Lie(r,s))),t}function xPt(e,t){if(e.length==0)return null;let n=e[0].pos,i=e.length==2?e[1].pos:n;return n>-1&&i>-1?ht.single(n+t,i+t):null}function qI(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}class wPt{setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}constructor(t){this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,pn.safari&&t.contentDOM.addEventListener("input",()=>null),pn.gecko&&LPt(t.contentDOM.ownerDocument)}handleEvent(t){!jPt(this.view,t)||this.ignoreDuringComposition(t)||t.type=="keydown"&&this.keydown(t)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(t.type,t)):this.runHandlers(t.type,t))}runHandlers(t,n){let i=this.handlers[t];if(i){for(let r of i.observers)r(this.view,n);for(let r of i.handlers){if(n.defaultPrevented)break;if(r(this.view,n)){n.preventDefault();break}}}}ensureHandlers(t){let n=kPt(t),i=this.handlers,r=this.view.contentDOM;for(let s in n)if(s!="scroll"){let o=!n[s].handlers.length,l=i[s];l&&o!=!l.handlers.length&&(r.removeEventListener(s,this.handleEvent),l=null),l||r.addEventListener(s,this.handleEvent,{passive:o})}for(let s in i)s!="scroll"&&!n[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=n}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&t.keyCode!=27&&Q3e.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),pn.android&&pn.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;if(pn.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&(U3e.some(n=>n.keyCode==t.keyCode)&&!t.ctrlKey||SPt.indexOf(t.key)>-1&&t.ctrlKey)){let n={ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey,shiftKey:t.shiftKey};return n.shiftKey&&pn.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&OPt(this.view.win)&&(n.shiftKey=!1),this.pendingIOSKey={key:t.key,keyCode:t.keyCode,mods:n},setTimeout(()=>this.flushIOSKey(),250),!0}return t.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(t){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&t&&t.from0?!0:pn.safari&&!pn.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.view.observer.update(t),this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function OPt(e){return e.visualViewport?e.visualViewport.height*e.visualViewport.scale/e.document.documentElement.clientHeight<.85:!1}function $ie(e,t){return(n,i)=>{try{return t.call(e,i,n)}catch(r){Dc(n.state,r)}}}function kPt(e){let t=Object.create(null);function n(i){return t[i]||(t[i]={observers:[],handlers:[]})}for(let i of e){let r=i.spec,s=r&&r.plugin.domEventHandlers,o=r&&r.plugin.domEventObservers;if(s)for(let l in s){let c=s[l];c&&n(l).handlers.push($ie(i.value,c))}if(o)for(let l in o){let c=o[l];c&&n(l).observers.push($ie(i.value,c))}}for(let i in kf)n(i).handlers.push(kf[i]);for(let i in cc)n(i).observers.push(cc[i]);return t}const U3e=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],SPt="dthko",Q3e=[16,17,18,20,91,92,224,225],z_=6;function V_(e){return Math.max(0,e)*.7+8}function EPt(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}class CPt{constructor(t,n,i,r){this.view=t,this.startEvent=n,this.style=i,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=d3e(t.contentDOM),this.atoms=t.state.facet(ST).map(o=>o(t));let s=t.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=t.state.facet(tr.allowMultipleSelections)&&APt(t,n),this.dragging=_Pt(t,n)&&H3e(n)==1?null:!1}start(t){this.dragging===!1&&this.select(t)}move(t){if(t.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&EPt(this.startEvent,t)<10)return;this.select(this.lastEvent=t);let n=0,i=0,r=0,s=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:l}=this.scrollParents.y.getBoundingClientRect());let c=Kq(this.view);t.clientX-c.left<=r+z_?n=-V_(r-t.clientX):t.clientX+c.right>=o-z_&&(n=V_(t.clientX-o)),t.clientY-c.top<=s+z_?i=-V_(s-t.clientY):t.clientY+c.bottom>=l-z_&&(i=V_(t.clientY-l)),this.setScrollSpeed(n,i)}up(t){this.dragging==null&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,n){this.scrollSpeed={x:t,y:n},t||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:t,y:n}=this.scrollSpeed;t&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=t,t=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(t||n)&&this.view.win.scrollBy(t,n),this.dragging===!1&&this.select(this.lastEvent)}select(t){let{view:n}=this,i=L3e(this.atoms,this.style.get(t,this.extend,this.multiple));(this.mustSelect||!i.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(t){t.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(t)&&setTimeout(()=>this.select(this.lastEvent),20)}}function APt(e,t){let n=e.state.facet(w3e);return n.length?n[0](t):pn.mac?t.metaKey:t.ctrlKey}function TPt(e,t){let n=e.state.facet(O3e);return n.length?n[0](t):pn.mac?!t.altKey:!t.ctrlKey}function _Pt(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let i=RC(e.root);if(!i||i.rangeCount==0)return!0;let r=i.getRangeAt(0).getClientRects();for(let s=0;s=t.clientX&&o.top<=t.clientY&&o.bottom>=t.clientY)return!0}return!1}function jPt(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,i;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(i=ma.get(n))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(t))return!1;return!0}const kf=Object.create(null),cc=Object.create(null),z3e=pn.ie&&pn.ie_version<15||pn.ios&&pn.webkit_version<604;function NPt(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{e.focus(),n.remove(),V3e(e,n.value)},50)}function ZM(e,t,n){for(let i of e.facet(t))n=i(n,e);return n}function V3e(e,t){t=ZM(e.state,Vq,t);let{state:n}=e,i,r=1,s=n.toText(t),o=s.lines==n.selection.ranges.length;if(q9!=null&&n.selection.ranges.every(c=>c.empty)&&q9==s.toString()){let c=-1;i=n.changeByRange(u=>{let d=n.doc.lineAt(u.from);if(d.from==c)return{range:u};c=d.from;let f=n.toText((o?s.line(r++).text:t)+n.lineBreak);return{changes:{from:d.from,insert:f},range:ht.cursor(u.from+f.length)}})}else o?i=n.changeByRange(c=>{let u=s.line(r++);return{changes:{from:c.from,to:c.to,insert:u.text},range:ht.cursor(c.from+u.length)}}):i=n.replaceSelection(s);e.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}cc.scroll=e=>{let t=e.inputState;t.lastScrollTop=e.scrollDOM.scrollTop,t.lastScrollLeft=e.scrollDOM.scrollLeft,pn.ios&&!t.touchActive&&(t.lastIOSMomentumScroll=Date.now())};cc.wheel=cc.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()};kf.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1);cc.touchstart=(e,t)=>{let n=e.inputState,i=t.targetTouches[0];n.touchActive=!0,n.lastTouchTime=Date.now(),i&&(n.lastTouchX=i.clientX,n.lastTouchY=i.clientY),n.setSelectionOrigin("select.pointer")};cc.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")};cc.touchend=(e,t)=>{e.inputState.touchActive=!1};kf.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let i of e.state.facet(k3e))if(n=i(e,t),n)break;if(!n&&t.button==0&&(n=IPt(e,t)),n){let i=!e.hasFocus;e.inputState.startMouseSelection(new CPt(e,t,n,i)),i&&e.observer.ignore(()=>{f3e(e.contentDOM);let s=e.root.activeElement;s&&!s.contains(e.contentDOM)&&s.blur()});let r=e.inputState.mouseSelection;if(r)return r.start(t),r.dragging===!1}else e.inputState.setSelectionOrigin("select.pointer");return!1};function Fie(e,t,n,i){if(i==1)return ht.cursor(t,n);if(i==2)return lPt(e.state,t,n);{let r=e.docView.lineAt(t,n),s=e.state.doc.lineAt(r?r.posAtEnd:t),o=r?r.posAtStart:s.from,l=r?r.posAtEnd:s.to;return lDate.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(Uie+1)%3:1}function IPt(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),i=H3e(t),r=e.state.selection;return{update(s){s.docChanged&&(n.pos=s.changes.mapPos(n.pos),r=r.map(s.changes))},get(s,o,l){let c=e.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),u,d=Fie(e,c.pos,c.assoc,i);if(n.pos!=c.pos&&!o){let f=Fie(e,n.pos,n.assoc,i),h=Math.min(f.from,d.from),m=Math.max(f.to,d.to);d=h1&&(u=PPt(r,c.pos))?u:l?r.addRange(d):ht.create([d])}}}function PPt(e,t){for(let n=0;n=t)return ht.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n?1:0))}return null}kf.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.tile.nearest(t.target);if(r&&r.isWidget()){let s=r.posAtStart,o=s+r.length;(s>=n.to||o<=n.from)&&(n=ht.undirectionalRange(s,o))}}let{inputState:i}=e;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",ZM(e.state,Hq,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1};kf.dragend=e=>(e.inputState.draggedContent=null,!1);function zie(e,t,n,i){if(n=ZM(e.state,Vq,n),!n)return;let r=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:s}=e.inputState,o=i&&s&&TPt(e,t)?{from:s.from,to:s.to}:null,l={from:r,insert:n},c=e.state.changes(o?[o,l]:l);e.focus(),e.dispatch({changes:c,selection:{anchor:c.mapPos(r,-1),head:c.mapPos(r,1)},userEvent:o?"move.drop":"input.drop"}),e.inputState.draggedContent=null}kf.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let i=Array(n.length),r=0,s=()=>{++r==n.length&&zie(e,t,i.filter(o=>o!=null).join(e.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),s()},l.readAsText(n[o])}return!0}else{let i=t.dataTransfer.getData("Text");if(i)return zie(e,t,i,!0),!0}return!1};kf.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=z3e?null:t.clipboardData;return n?(V3e(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(NPt(e),!1)};function DPt(e,t){let n=e.dom.parentNode;if(!n)return;let i=n.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=t,i.focus(),i.selectionEnd=t.length,i.selectionStart=0,setTimeout(()=>{i.remove(),e.focus()},50)}function MPt(e){let t=[],n=[],i=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let r=-1;for(let{from:s}of e.selection.ranges){let o=e.doc.lineAt(s);o.number>r&&(t.push(o.text),n.push({from:o.from,to:Math.min(e.doc.length,o.to+1)})),r=o.number}i=!0}return{text:ZM(e,Hq,t.join(e.lineBreak)),ranges:n,linewise:i}}let q9=null;kf.copy=kf.cut=(e,t)=>{if(!mE(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:i,linewise:r}=MPt(e.state);if(!n&&!r)return!1;q9=r?n:null,t.type=="cut"&&!e.state.readOnly&&e.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let s=z3e?null:t.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):(DPt(e,n),!1)};const q3e=Nh.define();function W3e(e,t){let n=[];for(let i of e.facet(C3e)){let r=i(e,t);r&&n.push(r)}return n.length?e.update({effects:n,annotations:q3e.of(!0)}):null}function K3e(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=W3e(e.state,t);n?e.dispatch(n):e.update([])}},10)}cc.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),K3e(e)};cc.blur=e=>{e.observer.clearSelectionRange(),K3e(e)};cc.compositionstart=cc.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange==null&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))};cc.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,pn.chrome&&pn.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))};cc.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()};kf.beforeinput=(e,t)=>{var n,i;if((t.inputType=="insertText"||t.inputType=="insertCompositionText")&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),t.inputType=="insertReplacementText"&&e.observer.editContext){let s=(n=t.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),o=t.getTargetRanges();if(s&&o.length){let l=o[0],c=e.posAtDOM(l.startContainer,l.startOffset),u=e.posAtDOM(l.endContainer,l.endOffset);return Gq(e,{from:c,to:u,insert:e.state.toText(s)},null),!0}}let r;if(pn.chrome&&pn.android&&(r=U3e.find(s=>s.inputType==t.inputType))&&(e.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let s=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return pn.ios&&t.inputType=="deleteContentForward"&&e.observer.flushSoon(),pn.safari&&t.inputType=="insertText"&&e.inputState.composing>=0&&setTimeout(()=>cc.compositionend(e,t),20),!1};const Vie=new Set;function LPt(e){Vie.has(e)||(Vie.add(e),e.addEventListener("copy",()=>{}),e.addEventListener("cut",()=>{}))}const Hie=["pre-wrap","normal","pre-line","break-spaces"];let u1=!1;function qie(){u1=!1}class $Pt{constructor(t){this.lineWrapping=t,this.doc=Or.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(t,n){let i=this.doc.lineAt(n).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((n-t-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return Hie.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let n=!1;for(let i=0;i-1,c=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=n,this.charWidth=i,this.textHeight=r,this.lineLength=s,c){this.heightSamples={};for(let u=0;u0}set outdated(t){this.flags=(t?2:0)|this.flags&-3}setHeight(t){this.height!=t&&(Math.abs(this.height-t)>$N&&(u1=!0),this.height=t)}replace(t,n,i){return lc.of(i)}decomposeLeft(t,n){n.push(this)}decomposeRight(t,n){n.push(this)}applyChanges(t,n,i,r){let s=this,o=i.doc;for(let l=r.length-1;l>=0;l--){let{fromA:c,toA:u,fromB:d,toB:f}=r[l],h=s.lineAt(c,ys.ByPosNoHeight,i.setDoc(n),0,0),m=h.to>=u?h:s.lineAt(u,ys.ByPosNoHeight,i,0,0);for(f+=m.to-u,u=m.to;l>0&&h.from<=r[l-1].toA;)c=r[l-1].fromA,d=r[l-1].fromB,l--,cs*2){let l=t[n-1];l.break?t.splice(--n,1,l.left,null,l.right):t.splice(--n,1,l.left,l.right),i+=1+l.break,r-=l.size}else if(s>r*2){let l=t[i];l.break?t.splice(i,1,l.left,null,l.right):t.splice(i,1,l.left,l.right),i+=2+l.break,s-=l.size}else break;else if(r=s&&o(this.lineAt(0,ys.ByPos,i,r,s))}setMeasuredHeight(t){let n=t.heights[t.index++];n<0?(this.spaceAbove=-n,n=t.heights[t.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(t,n=0,i=!1,r){return r&&r.from<=n&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}}class uu extends G3e{constructor(t,n,i){super(t,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=i}mainBlock(t,n){return new lf(n,this.length,t+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(t,n,i){let r=i[0];return i.length==1&&(r instanceof uu||r instanceof Zo&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof Zo?r=new uu(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):lc.of(i)}updateHeight(t,n=0,i=!1,r){return r&&r.from<=n&&r.more?this.setMeasuredHeight(r):(i||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Zo extends lc{constructor(t){super(t,0)}heightMetrics(t,n){let i=t.doc.lineAt(n).number,r=t.doc.lineAt(n+this.length).number,s=r-i+1,o,l=0;if(t.lineWrapping){let c=Math.min(this.height,t.lineHeight*s);o=c/s,this.length>s+1&&(l=(this.height-c)/(this.length-s-1))}else o=this.height/s;return{firstLine:i,lastLine:r,perLine:o,perChar:l}}blockAt(t,n,i,r){let{firstLine:s,lastLine:o,perLine:l,perChar:c}=this.heightMetrics(n,r);if(n.lineWrapping){let u=r+(t0){let s=i[i.length-1];s instanceof Zo?i[i.length-1]=new Zo(s.length+r):i.push(null,new Zo(r-1))}if(t>0){let s=i[0];s instanceof Zo?i[0]=new Zo(t+s.length):i.unshift(new Zo(t-1),null)}return lc.of(i)}decomposeLeft(t,n){n.push(new Zo(t-1),null)}decomposeRight(t,n){n.push(null,new Zo(this.length-t-1))}updateHeight(t,n=0,i=!1,r){let s=n+this.length;if(r&&r.from<=n+this.length&&r.more){let o=[],l=Math.max(n,r.from),c=-1;for(r.from>n&&o.push(new Zo(r.from-n-1).updateHeight(t,n));l<=s&&r.more;){let d=t.doc.lineAt(l).length;o.length&&o.push(null);let f=r.heights[r.index++],h=0;f<0&&(h=-f,f=r.heights[r.index++]),c==-1?c=f:Math.abs(f-c)>=$N&&(c=-2);let m=new uu(d,f,h);m.outdated=!1,o.push(m),l+=d+1}l<=s&&o.push(null,new Zo(s-l).updateHeight(t,l));let u=lc.of(o);return(c<0||Math.abs(u.height-this.height)>=$N||Math.abs(c-this.heightMetrics(t,n).perLine)>=$N)&&(u1=!0),WI(this,u)}else(i||this.outdated)&&(this.setHeight(t.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class UPt extends lc{constructor(t,n,i){super(t.length+n+i.length,t.height+i.height,n|(t.outdated||i.outdated?2:0)),this.left=t,this.right=i,this.size=t.size+i.size}get break(){return this.flags&1}blockAt(t,n,i,r){let s=i+this.left.height;return tl))return u;let d=n==ys.ByPosNoHeight?ys.ByPosNoHeight:ys.ByPos;return c?u.join(this.right.lineAt(l,d,i,o,l)):this.left.lineAt(l,d,i,r,s).join(u)}forEachLine(t,n,i,r,s,o){let l=r+this.left.height,c=s+this.left.length+this.break;if(this.break)t=c&&this.right.forEachLine(t,n,i,l,c,o);else{let u=this.lineAt(c,ys.ByPos,i,r,s);t=t&&u.from<=n&&o(u),n>u.to&&this.right.forEachLine(u.to+1,n,i,l,c,o)}}replace(t,n,i){let r=this.left.length+this.break;if(nthis.left.length)return this.balanced(this.left,this.right.replace(t-r,n-r,i));let s=[];t>0&&this.decomposeLeft(t,s);let o=s.length;for(let l of i)s.push(l);if(t>0&&Wie(s,o-1),n=i&&n.push(null)),t>i&&this.right.decomposeLeft(t-i,n)}decomposeRight(t,n){let i=this.left.length,r=i+this.break;if(t>=r)return this.right.decomposeRight(t-r,n);t2*n.size||n.size>2*t.size?lc.of(this.break?[t,null,n]:[t,n]):(this.left=WI(this.left,t),this.right=WI(this.right,n),this.setHeight(t.height+n.height),this.outdated=t.outdated||n.outdated,this.size=t.size+n.size,this.length=t.length+this.break+n.length,this)}updateHeight(t,n=0,i=!1,r){let{left:s,right:o}=this,l=n+s.length+this.break,c=null;return r&&r.from<=n+s.length&&r.more?c=s=s.updateHeight(t,n,i,r):s.updateHeight(t,n,i),r&&r.from<=l+o.length&&r.more?c=o=o.updateHeight(t,l,i,r):o.updateHeight(t,l,i),c?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Wie(e,t){let n,i;e[t]==null&&(n=e[t-1])instanceof Zo&&(i=e[t+1])instanceof Zo&&e.splice(t-1,3,new Zo(n.length+1+i.length))}const QPt=5;class Xq{constructor(t,n){this.pos=t,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,n){if(this.lineStart>-1){let i=Math.min(n,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof uu?r.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new uu(i-this.pos,-1,0)),this.writtenTo=i,n>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(t,n,i){if(t=QPt)&&this.addLineDeco(r,s,o)}else n>t&&this.span(t,n);this.lineEnd>-1&&this.lineEnd-1)return;let{from:t,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=n,this.writtenTot&&this.nodes.push(new uu(this.pos-t,-1,0)),this.writtenTo=this.pos}blankContent(t,n){let i=new Zo(n-t);return this.oracle.doc.lineAt(t).to==n&&(i.flags|=4),i}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof uu)return t;let n=new uu(0,-1,0);return this.nodes.push(n),n}addBlock(t){this.enterLine();let n=t.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,n&&n.endSide>0&&(this.covering=t)}addLineDeco(t,n,i){let r=this.ensureLine();r.length+=i,r.collapsed+=i,r.widgetHeight=Math.max(r.widgetHeight,t),r.breaks+=n,this.writtenTo=this.pos=this.pos+i}finish(t){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof uu)&&!this.isCovered?this.nodes.push(new uu(0,-1,0)):(this.writtenTod.clientHeight||d.scrollWidth>d.clientWidth)&&f.overflow!="visible"){let h=d.getBoundingClientRect();s=Math.max(s,h.left),o=Math.min(o,h.right),l=Math.max(l,h.top),c=Math.min(u==e.parentNode?r.innerHeight:c,h.bottom)}u=f.position=="absolute"||f.position=="fixed"?d.offsetParent:d.parentNode}else if(u.nodeType==11)u=u.host;else break;return{left:s-n.left,right:Math.max(s,o)-n.left,top:l-(n.top+t),bottom:Math.max(l,c)-(n.top+t)}}function qPt(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left0&&t.top0}function WPt(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class n${constructor(t,n,i,r){this.from=t,this.to=n,this.size=i,this.displaySize=r}static same(t,n){if(t.length!=n.length)return!1;for(let i=0;itypeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new $Pt(i),this.stateDeco=Xie(n),this.heightMap=lc.empty().applyChanges(this.stateDeco,Or.empty,this.heightOracle.setDoc(n.doc),[new md(0,0,0,n.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=$n.set(this.lineGaps.map(r=>r.draw(this,!1))),this.scrollParent=t.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:n}=this.state.selection;for(let i=0;i<=1;i++){let r=i?n.head:n.anchor;if(!t.some(({from:s,to:o})=>r>=s&&r<=o)){let{from:s,to:o}=this.lineBlockAt(r);t.push(new H_(s,o))}}return this.viewports=t.sort((i,r)=>i.from-r.from),this.updateScaler()}updateScaler(){let t=this.scaler;return this.scaler=this.heightMap.height<=7e6?Gie:new Yq(this.heightOracle,this.heightMap,this.viewports),t.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,t=>{this.viewportLines.push(hS(t,this.scaler))})}update(t,n=null){this.state=t.state;let i=this.stateDeco;this.stateDeco=Xie(this.state);let r=t.changedRanges,s=md.extendWithRanges(r,zPt(i,this.stateDeco,t?t.changes:lo.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);qie(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||u1)&&(t.flags|=2),l?(this.scrollAnchorPos=t.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let c=s.length?this.mapViewport(this.viewport,t.changes):this.viewport;(n&&(n.range.headc.to)||!this.viewportIsAppropriate(c))&&(c=this.getViewport(0,n));let u=c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,t.flags|=this.updateForViewport(),(u||!t.changes.empty||t.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(t.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(t.selectionSet||t.focusChanged)&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(T3e)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:t}=this,n=t.contentDOM,i=window.getComputedStyle(n),r=this.heightOracle,s=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?cs.RTL:cs.LTR;let o=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",l=n.getBoundingClientRect(),c=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let u=0,d=0;if(l.width&&l.height){let{scaleX:k,scaleY:S}=u3e(n,l);(k>.005&&Math.abs(this.scaleX-k)>.005||S>.005&&Math.abs(this.scaleY-S)>.005)&&(this.scaleX=k,this.scaleY=S,u|=16,o=c=!0)}let f=(parseInt(i.paddingTop)||0)*this.scaleY,h=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=h)&&(this.paddingTop=f,this.paddingBottom=h,u|=18),this.editorWidth!=t.scrollDOM.clientWidth&&(r.lineWrapping&&(c=!0),this.editorWidth=t.scrollDOM.clientWidth,u|=16);let m=d3e(this.view.contentDOM,!1).y;m!=this.scrollParent&&(this.scrollParent=m,this.scrollAnchorHeight=-1,this.scrollOffset=0);let g=this.getScrollOffset();this.scrollOffset!=g&&(this.scrollAnchorHeight=-1,this.scrollOffset=g),this.scrolledToBottom=h3e(this.scrollParent||t.win);let b=(this.printing?WPt:HPt)(n,this.paddingTop),v=b.top-this.pixelViewport.top,y=b.bottom-this.pixelViewport.bottom;this.pixelViewport=b;let w=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(w!=this.inView&&(this.inView=w,w&&(c=!0)),!this.inView&&!this.scrollTarget&&!qPt(t.dom))return 0;let x=l.width;if((this.contentDOMWidth!=x||this.editorHeight!=t.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=t.scrollDOM.clientHeight,u|=16),c){let k=t.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(k)&&(o=!0),o||r.lineWrapping&&Math.abs(x-this.contentDOMWidth)>r.charWidth){let{lineHeight:S,charWidth:C,textHeight:E}=t.docView.measureTextSize();o=S>0&&r.refresh(s,S,C,E,Math.max(5,x/C),k),o&&(t.docView.minWidth=0,u|=16)}v>0&&y>0?d=Math.max(v,y):v<0&&y<0&&(d=Math.min(v,y)),qie();for(let S of this.viewports){let C=S.from==this.viewport.from?k:t.docView.measureVisibleLineHeights(S);this.heightMap=(o?lc.empty().applyChanges(this.stateDeco,Or.empty,this.heightOracle,[new md(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(r,0,o,new FPt(S.from,C))}u1&&(u|=2)}let O=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return O&&(u&2&&(u|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),u|=this.updateForViewport()),(u&2||O)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,t)),u|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),u}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,n){let i=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,c=new H_(r.lineAt(o-i*1e3,ys.ByHeight,s,0,0).from,r.lineAt(l+(1-i)*1e3,ys.ByHeight,s,0,0).to);if(n){let{head:u}=n.range;if(uc.to){let d=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=r.lineAt(u,ys.ByPos,s,0,0),h;n.y=="center"?h=(f.top+f.bottom)/2-d/2:n.y=="start"||n.y=="nearest"&&u=l+Math.max(10,Math.min(i,250)))&&r>o-2*1e3&&s>1,o=r<<1;if(this.defaultTextDirection!=cs.LTR&&!i)return[];let l=[],c=(d,f,h,m)=>{if(f-dd&&yy.from>=h.from&&y.to<=h.to&&Math.abs(y.from-d)y.fromw));if(!v){if(fx.from<=f&&x.to>=f)){let x=n.moveToLineBoundary(ht.cursor(f),!1,!0).head;x>d&&(f=x)}let y=this.gapSize(h,d,f,m),w=i||y<2e6?y:2e6;v=new n$(d,f,y,w)}l.push(v)},u=d=>{if(d.length2e6)for(let S of t)S.from>=d.from&&S.fromd.from&&c(d.from,m,d,f),gn.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(t){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let i=[];Gi.spans(n,this.viewport.from,this.viewport.to,{span(s,o){i.push({from:s,to:o})},point(){}},20);let r=0;if(i.length!=this.visibleRanges.length)r=12;else for(let s=0;s=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(n=>n.from<=t&&n.to>=t)||hS(this.heightMap.lineAt(t,ys.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=t&&n.bottom>=t)||hS(this.heightMap.lineAt(this.scaler.fromDOM(t),ys.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(t){let n=this.lineBlockAtHeight(t+8);return n.from>=this.viewport.from||this.viewportLines[0].top-t>200?n:this.viewportLines[0]}elementAtHeight(t){return hS(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}let H_=class{constructor(t,n){this.from=t,this.to=n}};function GPt(e,t,n){let i=[],r=e,s=0;return Gi.spans(n,e,t,{span(){},point(o,l){o>r&&(i.push({from:r,to:o}),s+=o-r),r=l}},20),r=1)return t[t.length-1].to;let i=Math.floor(e*n);for(let r=0;;r++){let{from:s,to:o}=t[r],l=o-s;if(i<=l)return s+i;i-=l}}function W_(e,t){let n=0;for(let{from:i,to:r}of e.ranges){if(t<=r){n+=t-i;break}n+=r-i}return n/e.total}function XPt(e,t){for(let n of e)if(t(n))return n}const Gie={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};function Xie(e){let t=e.facet(GM).filter(i=>typeof i!="function"),n=e.facet(Wq).filter(i=>typeof i!="function");return n.length&&t.push(Gi.join(n)),t}class Yq{constructor(t,n,i){let r=0,s=0,o=0;this.viewports=i.map(({from:l,to:c})=>{let u=n.lineAt(l,ys.ByPos,t,0,0).top,d=n.lineAt(c,ys.ByPos,t,0,0).bottom;return r+=d-u,{from:l,to:c,top:u,bottom:d,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(n.height-r);for(let l of this.viewports)l.domTop=o+(l.top-s)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),s=l.bottom}toDOM(t){for(let n=0,i=0,r=0;;n++){let s=nn.from==t.viewports[i].from&&n.to==t.viewports[i].to):!1}}function hS(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),i=t.toDOM(e.bottom);return new lf(e.from,e.length,n,i-n,Array.isArray(e._content)?e._content.map(r=>hS(r,t)):e._content)}const K_=gn.define({combine:e=>e.join(" ")}),W9=gn.define({combine:e=>e.indexOf(!0)>-1}),K9=pb.newName(),X3e=pb.newName(),Y3e=pb.newName(),Z3e={"&light":"."+X3e,"&dark":"."+Y3e};function G9(e,t,n){return new pb(t,{finish(i){return/&/.test(i)?i.replace(/&\w*/,r=>{if(r=="&")return e;if(!n||!n[r])throw new RangeError(`Unsupported selector: ${r}`);return n[r]}):e+" "+i}})}const YPt=G9("."+K9,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Z3e),ZPt={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},i$=pn.ie&&pn.ie_version<=11;class JPt{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new TIt,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver(n=>{for(let i of n)this.queue.push(i);(pn.ie&&pn.ie_version<=11||pn.ios&&t.composing)&&n.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&pn.android&&t.constructor.EDIT_CONTEXT!==!1&&!(pn.chrome&&pn.chrome_version<126)&&(this.editContext=new tDt(t),t.state.facet(Op)&&(t.contentDOM.editContext=this.editContext.editContext)),i$&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(t){(t.type=="change"||!t.type)&&!t.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some((n,i)=>n!=t[i]))){this.gapIntersection.disconnect();for(let n of t)this.gapIntersection.observe(n);this.gaps=t}}onSelectionChange(t){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,r=this.selectionRange;if(i.state.facet(Op)?i.root.activeElement!=this.dom:!mE(this.dom,r))return;let s=r.anchorNode&&i.docView.tile.nearest(r.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(t)){n||(this.selectionChanged=!1);return}(pn.ie&&pn.ie_version<=11||pn.android&&pn.chrome)&&!i.state.selection.main.empty&&r.focusNode&&bE(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,n=RC(t.root);if(!n)return!1;let i=pn.safari&&t.root.nodeType==11&&t.root.activeElement==this.dom&&eDt(this.view,n)||n;if(!i||this.selectionRange.eq(i))return!1;let r=mE(this.dom,i);return r&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&gw(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||t=="Enter")&&(this.delayedAndroidKey={key:t,keyCode:n,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let n=-1,i=-1,r=!1;for(let s of t){let o=this.readMutation(s);o&&(o.typeOver&&(r=!0),n==-1?{from:n,to:i}=o:(n=Math.min(o.from,n),i=Math.max(o.to,i)))}return{from:n,to:i,typeOver:r}}readChange(){let{from:t,to:n,typeOver:i}=this.processRecords(),r=this.selectionChanged&&mE(this.dom,this.selectionRange);if(t<0&&!r)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new bPt(this.view,t,n,i);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let i=this.view.state,r=F3e(this.view,n);return this.view.state==i&&(n.domChanged||n.newSel&&!qI(this.view.state.selection,n.newSel.main))&&this.view.update([]),r}readMutation(t){let n=this.view.docView.tile.nearest(t.target);if(!n||n.isWidget())return null;if(n.markDirty(t.type=="attributes"),t.type=="childList"){let i=Yie(n,t.previousSibling||t.target.previousSibling,-1),r=Yie(n,t.nextSibling||t.target.nextSibling,1);return{from:i?n.posAfter(i):n.posAtStart,to:r?n.posBefore(r):n.posAtEnd,typeOver:!1}}else return t.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}update(t){this.editContext&&(this.editContext.update(t),t.startState.facet(Op)!=t.state.facet(Op)&&(t.view.contentDOM.editContext=t.state.facet(Op)?this.editContext.editContext:null))}destroy(){var t,n,i;this.stop(),(t=this.intersection)===null||t===void 0||t.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function Yie(e,t,n){for(;t;){let i=ma.get(t);if(i&&i.parent==e)return i;let r=t.parentNode;t=r!=e.dom?r:n>0?t.nextSibling:t.previousSibling}return null}function Zie(e,t){let n=t.startContainer,i=t.startOffset,r=t.endContainer,s=t.endOffset,o=e.docView.domAtPos(e.state.selection.main.anchor,1);return bE(o.node,o.offset,r,s)&&([n,i,r,s]=[r,s,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}}function eDt(e,t){if(t.getComposedRanges){let r=t.getComposedRanges(e.root)[0];if(r)return Zie(e,r)}let n=null;function i(r){r.preventDefault(),r.stopImmediatePropagation(),n=r.getTargetRanges()[0]}return e.contentDOM.addEventListener("beforeinput",i,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",i,!0),n?Zie(e,n):null}class tDt{constructor(t){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(t.state);let n=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});this.handlers.textupdate=i=>{let r=t.state.selection.main,{anchor:s,head:o}=r,l=this.toEditorPos(i.updateRangeStart),c=this.toEditorPos(i.updateRangeEnd);t.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:l,drifted:!1});let u=c-l>i.text.length;l==this.from&&sthis.to&&(c=s);let d=B3e(t.state.sliceDoc(l,c),i.text,(u?r.from:r.to)-l,u?"end":null);if(!d){let h=ht.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));qI(h,r)||t.dispatch({selection:h,userEvent:"select"});return}let f={from:d.from+l,to:d.toA+l,insert:Or.of(i.text.slice(d.from,d.toB).split(` -`))};if((pn.mac||pn.android)&&f.from==o-1&&/^\. ?$/.test(i.text)&&t.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:l,to:c,insert:Or.of([i.text.replace("."," ")])}),this.pendingContextChange=f,!t.state.readOnly){let h=this.to-this.from+(f.to-f.from+f.insert.length);Gq(t,f,ht.single(this.toEditorPos(i.selectionStart,h),this.toEditorPos(i.selectionEnd,h)))}this.pendingContextChange&&(this.revertPending(t.state),this.setSelection(t.state)),f.from=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(n.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let r=[],s=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o{let r=[];for(let s of i.getTextFormats()){let o=s.underlineStyle,l=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(l)){let c=this.toEditorPos(s.rangeStart),u=this.toEditorPos(s.rangeEnd);if(c{t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(t.inputState.composing=-1,t.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(t.state)}};for(let i in this.handlers)n.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{let r=RC(i.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let n=0,i=!1,r=this.pendingContextChange;return t.changes.iterChanges((s,o,l,c,u)=>{if(i)return;let d=u.length-(o-s);if(r&&o>=r.to)if(r.from==s&&r.to==o&&r.insert.eq(u)){r=this.pendingContextChange=null,n+=d,this.to+=d;return}else r=null,this.revertPending(t.state);if(s+=n,o+=n,o<=this.from)this.from+=d,this.to+=d;else if(sthis.to||this.to-this.from+u.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),u.toString()),this.to+=d}n+=d}),r&&!i&&this.revertPending(t.state),!i}update(t){let n=this.pendingContextChange,i=t.startState.selection.main;this.composing&&(this.composing.drifted||!t.changes.touchesRange(i.from,i.to)&&t.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=t.changes.mapPos(this.composing.editorBase)):!this.applyEdits(t)||!this.rangeIsValid(t.state)?(this.pendingContextChange=null,this.reset(t.state)):(t.docChanged||t.selectionSet||n)&&this.setSelection(t.state),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:n}=t.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(t.doc.length,n+1e4)}reset(t){this.resetRange(t),this.editContext.updateText(0,this.editContext.text.length,t.doc.sliceString(this.from,this.to)),this.setSelection(t)}revertPending(t){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),t.doc.sliceString(n.from,n.to))}setSelection(t){let{main:n}=t.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),r=this.toContextPos(n.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(i,r)}rangeIsValid(t){let{head:n}=t.selection.main;return!(this.from>0&&n-this.from<500||this.to1e4*3)}toEditorPos(t,n=this.to-this.from){t=Math.min(t,n);let i=this.composing;return i&&i.drifted?i.editorBase+(t-i.contextBase):t+this.from}toContextPos(t){let n=this.composing;return n&&n.drifted?n.contextBase+(t-n.editorBase):t-this.from}destroy(){for(let t in this.handlers)this.editContext.removeEventListener(t,this.handlers[t])}}class en{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),t.parent&&t.parent.appendChild(this.dom);let{dispatch:i}=t;this.dispatchTransactions=t.dispatchTransactions||i&&(r=>r.forEach(s=>i(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=t.root||_It(t.parent)||document,this.viewState=new Kie(this,t.state||tr.create(t)),t.scrollTo&&t.scrollTo.is(Q_)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Lx).map(r=>new Y4(r));for(let r of this.plugins)r.update(this);this.observer=new JPt(this),this.inputState=new wPt(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Die(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...t){let n=t.length==1&&t[0]instanceof Xa?t:t.length==1&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(n,this)}update(t){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,i=!1,r,s=this.state;for(let h of t){if(h.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=h.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,l=0,c=null;t.some(h=>h.annotation(q3e))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,c=W3e(s,o),c||(l=1));let u=this.observer.delayedAndroidKey,d=null;if(u?(this.observer.clearDelayedAndroidKey(),d=this.observer.readChange(),(d&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(d=null)):this.observer.clear(),s.facet(tr.phrases)!=this.state.facet(tr.phrases))return this.setState(s);r=zI.create(this,s,t),r.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let h of t){if(f&&(f=f.map(h.changes)),h.scrollIntoView){let{main:m}=h.state.selection,{x:g,y:b}=this.state.facet(en.cursorScrollMargin);f=new bw(m.empty?m:ht.cursor(m.head,m.head>m.anchor?-1:1),"nearest","nearest",b,g)}for(let m of h.effects)m.is(Q_)&&(f=m.value.clip(this.state))}this.viewState.update(r,f),this.bidiCache=KI.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),n=this.docView.update(r),this.state.facet(fS)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(n,t.some(h=>h.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(K_)!=r.state.facet(K_)&&(this.viewState.mustMeasureContent=!0),(n||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!r.empty)for(let h of this.state.facet(Q9))try{h(r)}catch(m){Dc(this.state,m,"update listener")}(c||d)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),d&&!F3e(this,d)&&u.force&&gw(this.contentDOM,u.key,u.keyCode)})}setState(t){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=t;return}this.updateState=2;let n=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new Kie(this,t),this.plugins=t.facet(Lx).map(i=>new Y4(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new Die(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(t){let n=t.startState.facet(Lx),i=t.state.facet(Lx);if(n!=i){let r=[];for(let s of i){let o=n.indexOf(s);if(o<0)r.push(new Y4(s));else{let l=this.plugins[o];l.mustUpdate=t,r.push(l)}}for(let s of this.plugins)s.mustUpdate!=t&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=t;for(let r=0;r-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,t&&this.observer.forceFlush();let n=null,i=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(h3e(i||this.win))s=-1,o=this.viewState.heightMap.height;else{let m=this.viewState.scrollAnchorAt(r);s=m.from,o=m.top}this.updateState=1;let c=this.viewState.measure();if(!c&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let u=[];c&4||([this.measureRequests,u]=[u,this.measureRequests]);let d=u.map(m=>{try{return m.read(this)}catch(g){return Dc(this.state,g),Jie}}),f=zI.create(this,this.state,[]),h=!1;f.flags|=c,n?n.flags|=c:n=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),h=this.docView.update(f),h&&this.docViewUpdate());for(let m=0;m1||g<-1)&&!(pn.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(i==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r=r+g,i?i.scrollTop+=g:this.win.scrollBy(0,g),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let l of this.state.facet(Q9))l(n)}get themeClasses(){return K9+" "+(this.state.facet(W9)?Y3e:X3e)+" "+this.state.facet(K_)}updateAttrs(){let t=ere(this,N3e,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Op)?"true":"false",class:"cm-content",style:`${pn.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),ere(this,qq,n);let i=this.observer.ignore(()=>{let r=_ie(this.contentDOM,this.contentAttrs,n),s=_ie(this.dom,this.editorAttrs,t);return r||s});return this.editorAttrs=t,this.contentAttrs=n,i}showAnnouncements(t){let n=!0;for(let i of t)for(let r of i.effects)if(r.is(en.announce)){n&&(this.announceDOM.textContent=""),n=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(fS);let t=this.state.facet(en.cspNonce);pb.mount(this.root,this.styleModules.concat(YPt).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),t){if(this.measureRequests.indexOf(t)>-1)return;if(t.key!=null){for(let n=0;ni.plugin==t)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,n,i){return t$(this,t,Mie(this,t,n,i))}moveByGroup(t,n){return t$(this,t,Mie(this,t,n,i=>dPt(this,t.head,i)))}visualLineSide(t,n){let i=this.bidiSpans(t),r=this.textDirectionAt(t.from),s=i[n?i.length-1:0];return ht.cursor(s.side(n,r)+t.from,s.forward(!n,r)?1:-1)}moveToLineBoundary(t,n,i=!0){return uPt(this,t,n,i)}moveVertically(t,n,i){return t$(this,t,fPt(this,t,n,i))}domAtPos(t,n=1){return this.docView.domAtPos(t,n)}posAtDOM(t,n=0){return this.docView.posFromDOM(t,n)}posAtCoords(t,n=!0){this.readMeasured();let i=H9(this,t,n);return i&&i.pos}posAndSideAtCoords(t,n=!0){return this.readMeasured(),H9(this,t,n)}coordsAtPos(t,n=1){this.readMeasured();let i=this.state.doc.lineAt(t),r=this.bidiSpans(i),s=r[oh.find(r,t-i.from,-1,n)];return this.docView.coordsAt(t,n,s.dir==cs.RTL)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(A3e)||tthis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>nDt)return v3e(t.length);let n=this.textDirectionAt(t.from),i;for(let s of this.bidiCache)if(s.from==t.from&&s.dir==n&&(s.fresh||y3e(s.isolates,i=Rie(this,t))))return s.order;i||(i=Rie(this,t));let r=LIt(t.text,n,i);return this.bidiCache.push(new KI(t.from,t.to,n,i,!0,r)),r}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||pn.safari&&((t=this.inputState)===null||t===void 0?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{f3e(this.contentDOM),this.docView.updateSelection()})}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((t.nodeType==9?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,n={}){var i,r,s,o;return Q_.of(new bw(typeof t=="number"?ht.cursor(t):t,(i=n.y)!==null&&i!==void 0?i:"nearest",(r=n.x)!==null&&r!==void 0?r:"nearest",(s=n.yMargin)!==null&&s!==void 0?s:5,(o=n.xMargin)!==null&&o!==void 0?o:5))}scrollSnapshot(){let{scrollTop:t,scrollLeft:n}=this.scrollDOM,i=this.viewState.scrollAnchorAt(t);return Q_.of(new bw(ht.cursor(i.from),"start","start",i.top-t,n,!0))}setTabFocusMode(t){t==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof t=="boolean"?this.inputState.tabFocusMode=t?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+t)}static domEventHandlers(t){return ga.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return ga.define(()=>({}),{eventObservers:t})}static theme(t,n){let i=pb.newName(),r=[K_.of(i),fS.of(G9(`.${i}`,t))];return n&&n.dark&&r.push(W9.of(!0)),r}static baseTheme(t){return ym.lowest(fS.of(G9("."+K9,t,Z3e)))}static findFromDOM(t){var n;let i=t.querySelector(".cm-content"),r=i&&ma.get(i)||ma.get(t);return((n=r==null?void 0:r.root)===null||n===void 0?void 0:n.view)||null}}en.styleModule=fS;en.inputHandler=E3e;en.clipboardInputFilter=Vq;en.clipboardOutputFilter=Hq;en.scrollHandler=_3e;en.focusChangeEffect=C3e;en.perLineTextDirection=A3e;en.exceptionSink=S3e;en.updateListener=Q9;en.editable=Op;en.mouseSelectionStyle=k3e;en.dragMovesSelection=O3e;en.clickAddsSelectionRange=w3e;en.decorations=GM;en.blockWrappers=R3e;en.outerDecorations=Wq;en.atomicRanges=ST;en.bidiIsolatedRanges=I3e;en.cursorScrollMargin=gn.define({combine:e=>{let t=5,n=5;for(let i of e)typeof i=="number"?t=n=i:{x:t,y:n}=i;return{x:t,y:n}}});en.scrollMargins=P3e;en.darkTheme=W9;en.cspNonce=gn.define({combine:e=>e.length?e[0]:""});en.contentAttributes=qq;en.editorAttributes=N3e;en.lineWrapping=en.contentAttributes.of({class:"cm-lineWrapping"});en.announce=hi.define();const nDt=4096,Jie={};class KI{constructor(t,n,i,r,s,o){this.from=t,this.to=n,this.dir=i,this.isolates=r,this.fresh=s,this.order=o}static update(t,n){if(n.empty&&!t.some(s=>s.fresh))return t;let i=[],r=t.length?t[t.length-1].dir:cs.LTR;for(let s=Math.max(0,t.length-10);s=0;r--){let s=i[r],o=typeof s=="function"?s(e):s;o&&Uq(o,n)}return n}const iDt=pn.mac?"mac":pn.windows?"win":pn.linux?"linux":"key";function rDt(e,t){const n=e.split(/-(?!$)/);let i=n[n.length-1];i=="Space"&&(i=" ");let r,s,o,l;for(let c=0;ci.concat(r),[]))),n}function aDt(e,t,n){return e4e(J3e(e.state),t,e,n)}let lg=null;const oDt=4e3;function lDt(e,t=iDt){let n=Object.create(null),i=Object.create(null),r=(o,l)=>{let c=i[o];if(c==null)i[o]=l;else if(c!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,l,c,u,d)=>{var f,h;let m=n[o]||(n[o]=Object.create(null)),g=l.split(/ (?!$)/).map(y=>rDt(y,t));for(let y=1;y{let O=lg={view:x,prefix:w,scope:o};return setTimeout(()=>{lg==O&&(lg=null)},oDt),!0}]})}let b=g.join(" ");r(b,!1);let v=m[b]||(m[b]={preventDefault:!1,stopPropagation:!1,run:((h=(f=m._any)===null||f===void 0?void 0:f.run)===null||h===void 0?void 0:h.slice())||[]});c&&v.run.push(c),u&&(v.preventDefault=!0),d&&(v.stopPropagation=!0)};for(let o of e){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let u of l){let d=n[u]||(n[u]=Object.create(null));d._any||(d._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=o;for(let h in d)d[h].run.push(m=>f(m,X9))}let c=o[t]||o.key;if(c)for(let u of l)s(u,c,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(u,"Shift-"+c,o.shift,o.preventDefault,o.stopPropagation)}return n}let X9=null;function e4e(e,t,n,i){X9=t;let r=OIt(t),s=jc(r,0),o=Jf(s)==r.length&&r!=" ",l="",c=!1,u=!1,d=!1;lg&&lg.view==n&&lg.scope==i&&(l=lg.prefix+" ",Q3e.indexOf(t.keyCode)<0&&(u=!0,lg=null));let f=new Set,h=v=>{if(v){for(let y of v.run)if(!f.has(y)&&(f.add(y),y(n)))return v.stopPropagation&&(d=!0),!0;v.preventDefault&&(v.stopPropagation&&(d=!0),u=!0)}return!1},m=e[i],g,b;return m&&(h(m[l+G_(r,t,!o)])?c=!0:o&&(t.altKey||t.metaKey||t.ctrlKey)&&!(pn.windows&&t.ctrlKey&&t.altKey)&&!(pn.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(g=mb[t.keyCode])&&g!=r?(h(m[l+G_(g,t,!0)])||t.shiftKey&&(b=jC[t.keyCode])!=r&&b!=g&&h(m[l+G_(b,t,!1)]))&&(c=!0):o&&t.shiftKey&&h(m[l+G_(r,t,!0)])&&(c=!0),!c&&h(m._any)&&(c=!0)),u&&(c=!0),c&&d&&t.stopPropagation(),X9=null,c}class Gy{constructor(t,n,i,r,s){this.className=t,this.left=n,this.top=i,this.width=r,this.height=s}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}update(t,n){return n.className!=this.className?!1:(this.adjust(t),!0)}adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",this.width!=null&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}static forRange(t,n,i){if(i.empty){let r=t.coordsAtPos(i.head,i.assoc||1);if(!r)return[];let s=t4e(t);return[new Gy(n,r.left-s.left,r.top-s.top,null,r.bottom-r.top)]}else return cDt(t,n,i)}}function t4e(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==cs.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function nre(e,t,n,i){let r=e.coordsAtPos(t,n*2);if(!r)return i;let s=e.dom.getBoundingClientRect(),o=(r.top+r.bottom)/2,l=e.posAtCoords({x:s.left+1,y:o}),c=e.posAtCoords({x:s.right-1,y:o});return l==null||c==null?i:{from:Math.max(i.from,Math.min(l,c)),to:Math.min(i.to,Math.max(l,c))}}function cDt(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let i=Math.max(n.from,e.viewport.from),r=Math.min(n.to,e.viewport.to),s=e.textDirection==cs.LTR,o=e.contentDOM,l=o.getBoundingClientRect(),c=t4e(e),u=o.querySelector(".cm-line"),d=u&&window.getComputedStyle(u),f=l.left+(d?parseInt(d.paddingLeft)+Math.min(0,parseInt(d.textIndent)):0),h=l.right-(d?parseInt(d.paddingRight):0),m=V9(e,i,1),g=V9(e,r,-1),b=m.type==ol.Text?m:null,v=g.type==ol.Text?g:null;if(b&&(e.lineWrapping||m.widgetLineBreaks)&&(b=nre(e,i,1,b)),v&&(e.lineWrapping||g.widgetLineBreaks)&&(v=nre(e,r,-1,v)),b&&v&&b.from==v.from&&b.to==v.to)return w(x(n.from,n.to,b));{let k=b?x(n.from,null,b):O(m,!1),S=v?x(null,n.to,v):O(g,!0),C=[];return(b||m).to<(v||g).from-(b&&v?1:0)||m.widgetLineBreaks>1&&k.bottom+e.defaultLineHeight/2A&&P.from=D)break;M>I&&R(Math.max(F,I),k==null&&F<=A,Math.min(M,D),S==null&&M>=N,L.dir)}if(I=_.to+1,I>=D)break}return T.length==0&&R(A,k==null,N,S==null,e.textDirection),{top:E,bottom:j,horizontal:T}}function O(k,S){let C=l.top+(S?k.top:k.bottom);return{top:C,bottom:C,horizontal:[]}}}function uDt(e,t){return e.constructor==t.constructor&&e.eq(t)}class dDt{constructor(t,n){this.view=t,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,t)}update(t){t.startState.facet(FN)!=t.state.facet(FN)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq))}docViewUpdate(t){this.layer.updateOnDocViewUpdate!==!1&&t.requestMeasure(this.measureReq)}setOrder(t){let n=0,i=t.facet(FN);for(;n!uDt(n,this.drawn[i]))){let n=this.dom.firstChild,i=0;for(let r of t)r.update&&n&&r.constructor&&this.drawn[i].constructor&&r.update(n,this.drawn[i])?(n=n.nextSibling,i++):this.dom.insertBefore(r.draw(),n);for(;n;){let r=n.nextSibling;n.remove(),n=r}this.drawn=t,pn.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const FN=gn.define();function n4e(e){return[ga.define(t=>new dDt(t,e)),FN.of(e)]}const d1=gn.define({combine(e){return Rh(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(t,n)=>Math.min(t,n),drawRangeCursor:(t,n)=>t||n})}});function fDt(e={}){return[d1.of(e),hDt,pDt,mDt,T3e.of(!0)]}function i4e(e){return e.startState.facet(d1)!=e.state.facet(d1)}const hDt=n4e({above:!0,markers(e){let{state:t}=e,n=t.facet(d1),i=[];for(let r of t.selection.ranges){let s=r==t.selection.main;if(r.empty||n.drawRangeCursor&&!(s&&pn.ios&&n.iosSelectionHandles)){let o=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=r.empty?r:ht.cursor(r.head,r.assoc);for(let c of Gy.forRange(e,o,l))i.push(c)}}return i},update(e,t){e.transactions.some(i=>i.selection)&&(t.style.animationName=t.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=i4e(e);return n&&ire(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){ire(t.state,e)},class:"cm-cursorLayer"});function ire(e,t){t.style.animationDuration=e.facet(d1).cursorBlinkRate+"ms"}const pDt=n4e({above:!1,markers(e){let t=[],{main:n,ranges:i}=e.state.selection;for(let r of i)if(!r.empty)for(let s of Gy.forRange(e,"cm-selectionBackground",r))t.push(s);if(pn.ios&&!n.empty&&e.state.facet(d1).iosSelectionHandles){for(let r of Gy.forRange(e,"cm-selectionHandle cm-selectionHandle-start",ht.cursor(n.from,1)))t.push(r);for(let r of Gy.forRange(e,"cm-selectionHandle cm-selectionHandle-end",ht.cursor(n.to,1)))t.push(r)}return t},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||i4e(e)},class:"cm-selectionLayer"}),mDt=ym.highest(en.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),r4e=hi.define({map(e,t){return e==null?null:t.mapPos(e)}}),pS=dl.define({create(){return null},update(e,t){return e!=null&&(e=t.changes.mapPos(e)),t.effects.reduce((n,i)=>i.is(r4e)?i.value:n,e)}}),gDt=ga.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(pS);n==null?this.cursor!=null&&((t=this.cursor)===null||t===void 0||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(pS)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(pS),n=t!=null&&e.coordsAtPos(t);if(!n)return null;let i=e.scrollDOM.getBoundingClientRect();return{left:n.left-i.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-i.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/n+"px",this.cursor.style.height=e.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(pS)!=e&&this.view.dispatch({effects:r4e.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){(e.target==this.view.contentDOM||!this.view.contentDOM.contains(e.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function bDt(){return[pS,gDt]}function rre(e,t,n,i,r){t.lastIndex=0;for(let s=e.iterRange(n,i),o=n,l;!s.next().done;o+=s.value.length)if(!s.lineBreak)for(;l=t.exec(s.value);)r(o+l.index,l)}function yDt(e,t){let n=e.visibleRanges;if(n.length==1&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let i=[];for(let{from:r,to:s}of n)r=Math.max(e.state.doc.lineAt(r).from,r-t),s=Math.min(e.state.doc.lineAt(s).to,s+t),i.length&&i[i.length-1].to>=r?i[i.length-1].to=s:i.push({from:r,to:s});return i}class vDt{constructor(t){const{regexp:n,decoration:i,decorate:r,boundary:s,maxLength:o=1e3}=t;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,r)this.addMatch=(l,c,u,d)=>r(d,u,u+l[0].length,l,c);else if(typeof i=="function")this.addMatch=(l,c,u,d)=>{let f=i(l,c,u);f&&d(u,u+l[0].length,f)};else if(i)this.addMatch=(l,c,u,d)=>d(u,u+l[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=o}createDeco(t){let n=new im,i=n.add.bind(n);for(let{from:r,to:s}of yDt(t,this.maxLength))rre(t.state.doc,this.regexp,r,s,(o,l)=>this.addMatch(l,t,o,i));return n.finish()}updateDeco(t,n){let i=1e9,r=-1;return t.docChanged&&t.changes.iterChanges((s,o,l,c)=>{c>=t.view.viewport.from&&l<=t.view.viewport.to&&(i=Math.min(l,i),r=Math.max(c,r))}),t.viewportMoved||r-i>1e3?this.createDeco(t.view):r>-1?this.updateRange(t.view,n.map(t.changes),i,r):n}updateRange(t,n,i,r){for(let s of t.visibleRanges){let o=Math.max(s.from,i),l=Math.min(s.to,r);if(l>=o){let c=t.state.doc.lineAt(o),u=c.toc.from;o--)if(this.boundary.test(c.text[o-1-c.from])){d=o;break}for(;lh.push(y.range(b,v));if(c==u)for(this.regexp.lastIndex=d-c.from;(m=this.regexp.exec(c.text))&&m.indexthis.addMatch(v,t,b,g));n=n.update({filterFrom:d,filterTo:f,filter:(b,v)=>bf,add:h})}}return n}}const Y9=/x/.unicode!=null?"gu":"g",xDt=new RegExp(`[\0-\b ---Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Y9),wDt={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let r$=null;function ODt(){var e;if(r$==null&&typeof document<"u"&&document.body){let t=document.body.style;r$=((e=t.tabSize)!==null&&e!==void 0?e:t.MozTabSize)!=null}return r$||!1}const BN=gn.define({combine(e){let t=Rh(e,{render:null,specialChars:xDt,addSpecialChars:null});return(t.replaceTabs=!ODt())&&(t.specialChars=new RegExp(" |"+t.specialChars.source,Y9)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,Y9)),t}});function kDt(e={}){return[BN.of(e),SDt()]}let sre=null;function SDt(){return sre||(sre=ga.fromClass(class{constructor(e){this.view=e,this.decorations=$n.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(BN)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new vDt({regexp:e.specialChars,decoration:(t,n,i)=>{let{doc:r}=n.state,s=jc(t[0],0);if(s==9){let o=r.lineAt(i),l=n.state.tabSize,c=Of(o.text,l,i-o.from);return $n.replace({widget:new TDt((l-c%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=$n.replace({widget:new ADt(e,s)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(BN);e.startState.facet(BN)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))}const EDt="•";function CDt(e){return e>=32?EDt:e==10?"␤":String.fromCharCode(9216+e)}class ADt extends Nf{constructor(t,n){super(),this.options=t,this.code=n}eq(t){return t.code==this.code}toDOM(t){let n=CDt(this.code),i=t.state.phrase("Control character")+" "+(wDt[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,i,n);if(r)return r;let s=document.createElement("span");return s.textContent=n,s.title=i,s.setAttribute("aria-label",i),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class TDt extends Nf{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent=" ",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}function _Dt(){return NDt}const jDt=$n.line({class:"cm-activeLine"}),NDt=ga.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let i of e.state.selection.ranges){let r=e.lineBlockAt(i.head);r.from>t&&(n.push(jDt.range(r.from)),t=r.from)}return $n.set(n)}},{decorations:e=>e.decorations});class RDt extends Nf{constructor(t){super(),this.content=t}toDOM(t){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(t):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(t){let n=t.firstChild?gE(t.firstChild):[];if(!n.length)return null;let i=window.getComputedStyle(t.parentNode),r=IC(n[0],i.direction!="rtl"),s=parseInt(i.lineHeight);return r.bottom-r.top>s*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+s}:r}ignoreEvent(){return!1}}function IDt(e){let t=ga.fromClass(class{constructor(n){this.view=n,this.placeholder=e?$n.set([$n.widget({widget:new RDt(e),side:1}).range(0)]):$n.none}get decorations(){return this.view.state.doc.length?$n.none:this.placeholder}},{decorations:n=>n.decorations});return typeof e=="string"?[t,en.contentAttributes.of({"aria-placeholder":e})]:t}const Z9=2e3;function PDt(e,t,n){let i=Math.min(t.line,n.line),r=Math.max(t.line,n.line),s=[];if(t.off>Z9||n.off>Z9||t.col<0||n.col<0){let o=Math.min(t.off,n.off),l=Math.max(t.off,n.off);for(let c=i;c<=r;c++){let u=e.doc.line(c);u.length<=l&&s.push(ht.range(u.from+o,u.to+l))}}else{let o=Math.min(t.col,n.col),l=Math.max(t.col,n.col);for(let c=i;c<=r;c++){let u=e.doc.line(c),d=N9(u.text,o,e.tabSize,!0);if(d<0)s.push(ht.cursor(u.to));else{let f=N9(u.text,l,e.tabSize);s.push(ht.range(u.from+d,u.from+f))}}}return s}function DDt(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}function are(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),i=e.state.doc.lineAt(n),r=n-i.from,s=r>Z9?-1:r==i.length?DDt(e,t.clientX):Of(i.text,e.state.tabSize,n-i.from);return{line:i.number,col:s,off:r}}function MDt(e,t){let n=are(e,t),i=e.state.selection;return n?{update(r){if(r.docChanged){let s=r.changes.mapPos(r.startState.doc.line(n.line).from),o=r.state.doc.lineAt(s);n={line:o.number,col:n.col,off:Math.min(n.off,o.length)},i=i.map(r.changes)}},get(r,s,o){let l=are(e,r);if(!l)return i;let c=PDt(e.state,n,l);return c.length?o?ht.create(c.concat(i.ranges)):ht.create(c):i}}:null}function LDt(e){let t=n=>n.altKey&&n.button==0;return en.mouseSelectionStyle.of((n,i)=>t(i)?MDt(n,i):null)}const $Dt={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},FDt={style:"cursor: crosshair"};function BDt(e={}){let[t,n]=$Dt[e.key||"Alt"],i=ga.fromClass(class{constructor(r){this.view=r,this.isDown=!1}set(r){this.isDown!=r&&(this.isDown=r,this.view.update([]))}},{eventObservers:{keydown(r){this.set(r.keyCode==t||n(r))},keyup(r){(r.keyCode==t||!n(r))&&this.set(!1)},mousemove(r){this.set(n(r))}}});return[i,en.contentAttributes.of(r=>{var s;return!((s=r.plugin(i))===null||s===void 0)&&s.isDown?FDt:null})]}const X_="-10000px";class s4e{constructor(t,n,i,r){this.facet=n,this.createTooltipView=i,this.removeTooltipView=r,this.input=t.state.facet(n),this.tooltips=this.input.filter(o=>o);let s=null;this.tooltipViews=this.tooltips.map(o=>s=i(o,s))}update(t,n){var i;let r=t.state.facet(this.facet),s=r.filter(c=>c);if(r===this.input){for(let c of this.tooltipViews)c.update&&c.update(t);return!1}let o=[],l=n?[]:null;for(let c=0;cn[u]=c),n.length=l.length),this.input=r,this.tooltips=s,this.tooltipViews=o,!0}}function UDt(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}const s$=gn.define({combine:e=>{var t,n,i;return{position:pn.ios?"absolute":((t=e.find(r=>r.position))===null||t===void 0?void 0:t.position)||"fixed",parent:((n=e.find(r=>r.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((i=e.find(r=>r.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||UDt}}}),ore=new WeakMap,Zq=ga.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(s$);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new s4e(e,Jq,(n,i)=>this.createTooltip(n,i),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,i=e.state.facet(s$);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;n=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),i=t?t.dom:null;if(n.dom.classList.add("cm-tooltip"),e.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let r=document.createElement("div");r.className="cm-tooltip-arrow",n.dom.appendChild(r)}return n.dom.style.position=this.position,n.dom.style.top=X_,n.dom.style.left="0px",this.container.insertBefore(n.dom,i),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(e=i.destroy)===null||e===void 0||e.call(i);this.parent&&this.container.remove(),(t=this.resizeObserver)===null||t===void 0||t.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(pn.safari){let o=s.getBoundingClientRect();n=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}else n=!!s.offsetParent&&s.offsetParent!=this.container.ownerDocument.body}if(n||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(e=s.width/this.parent.offsetWidth,t=s.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),r=Kq(this.view);return{visible:{left:i.left+r.left,top:i.top+r.top,right:i.right-r.right,bottom:i.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,o)=>{let l=this.manager.tooltipViews[o];return l.getCoords?l.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(s$).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){var t;if(e.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:n,space:i,scaleX:r,scaleY:s}=e,o=[];for(let l=0;l=Math.min(n.bottom,i.bottom)||f.rightMath.min(n.right,i.right)+.1)){d.style.top=X_;continue}let m=c.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,g=m?7:0,b=h.right-h.left,v=(t=ore.get(u))!==null&&t!==void 0?t:h.bottom-h.top,y=u.offset||zDt,w=this.view.textDirection==cs.LTR,x=h.width>i.right-i.left?w?i.left:i.right-h.width:w?Math.max(i.left,Math.min(f.left-(m?14:0)+y.x,i.right-b)):Math.min(Math.max(i.left,f.left-b+(m?14:0)-y.x),i.right-b),O=this.above[l];!c.strictSide&&(O?f.top-v-g-y.yi.bottom)&&O==i.bottom-f.bottom>f.top-i.top&&(O=this.above[l]=!O);let k=(O?f.top-i.top:i.bottom-f.bottom)-g;if(kx&&E.topS&&(S=O?E.top-v-2-g:E.bottom+g+2);if(this.position=="absolute"?(d.style.top=(S-e.parent.top)/s+"px",lre(d,(x-e.parent.left)/r)):(d.style.top=S/s+"px",lre(d,x/r)),m){let E=f.left+(w?y.x:-y.x)-(x+14-7);m.style.left=E/r+"px"}u.overlap!==!0&&o.push({left:x,top:S,right:C,bottom:S+v}),d.classList.toggle("cm-tooltip-above",O),d.classList.toggle("cm-tooltip-below",!O),u.positioned&&u.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=X_}},{eventObservers:{scroll(){this.maybeMeasure()}}});function lre(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}const QDt=en.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),zDt={x:0,y:0},Jq=gn.define({enables:[Zq,QDt]}),GI=gn.define({combine:e=>e.reduce((t,n)=>t.concat(n),[])});class JM{static create(t){return new JM(t)}constructor(t){this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new s4e(t,GI,(n,i)=>this.createHostedView(n,i),n=>n.dom.remove())}createHostedView(t,n){let i=t.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}mount(t){for(let n of this.manager.tooltipViews)n.mount&&n.mount(t);this.mounted=!0}positioned(t){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(t)}update(t){this.manager.update(t)}destroy(){var t;for(let n of this.manager.tooltipViews)(t=n.destroy)===null||t===void 0||t.call(n)}passProp(t){let n;for(let i of this.manager.tooltipViews){let r=i[t];if(r!==void 0){if(n===void 0)n=r;else if(n!==r)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const VDt=Jq.compute([GI],e=>{let t=e.facet(GI);return t.length===0?null:{pos:Math.min(...t.map(n=>n.pos)),end:Math.max(...t.map(n=>{var i;return(i=n.end)!==null&&i!==void 0?i:n.pos})),create:JM.create,above:t[0].above,arrow:t.some(n=>n.arrow)}}),a4e=gn.define();class HDt{constructor(t,n,i,r,s,o){this.view=t,this.source=n,this.field=i,this.locked=r,this.setHover=s,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:t.dom,time:0},this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(t){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let t=Date.now()-this.lastMove.time;to.bottom||n.xo.right+t.defaultCharacterWidth)return;let l=t.bidiSpans(t.state.doc.lineAt(r)).find(u=>u.from<=r&&u.to>=r),c=l&&l.dir==cs.RTL?-1:1;s=n.x{if(l&&!(Array.isArray(l)&&!l.length)){let c=Array.isArray(l)?l:[l];r&&this.locked.set(c,r),t.dispatch({effects:this.setHover.of(c)})}};if(s&&"then"in s){let l=this.pending={pos:n};s.then(c=>{this.pending==l&&(this.pending=null,o(c))},c=>Dc(t.state,c,"hover tooltip"))}else o(s)}get tooltip(){let t=this.view.plugin(Zq),n=t?t.manager.tooltips.findIndex(i=>i.create==JM.create):-1;return n>-1?t.manager.tooltipViews[n]:null}mousemove(t){var n,i;this.lastMove={x:t.clientX,y:t.clientY,target:t.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:s}=this;if(r.length&&!this.locked.has(r)&&s&&!qDt(s.dom,t)||this.pending){let{pos:o}=r[0]||this.pending,l=(i=(n=r[0])===null||n===void 0?void 0:n.end)!==null&&i!==void 0?i:o;(o==l?this.view.posAtCoords(this.lastMove)!=o:!WDt(this.view,o,l,t.clientX,t.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(t){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length&&!this.locked.has(n)){let{tooltip:i}=this;i&&i.dom.contains(t.relatedTarget)?this.watchTooltipLeave(i.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(t){let n=i=>{t.removeEventListener("mouseleave",n);let{active:r}=this;r.length&&!this.locked.has(r)&&!this.view.dom.contains(i.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};t.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const Y_=4;function qDt(e,t){let{left:n,right:i,top:r,bottom:s}=e.getBoundingClientRect(),o;if(o=e.querySelector(".cm-tooltip-arrow")){let l=o.getBoundingClientRect();r=Math.min(l.top,r),s=Math.max(l.bottom,s)}return t.clientX>=n-Y_&&t.clientX<=i+Y_&&t.clientY>=r-Y_&&t.clientY<=s+Y_}function WDt(e,t,n,i,r,s){let o=e.scrollDOM.getBoundingClientRect(),l=e.documentTop+e.documentPadding.top+e.contentHeight;if(o.left>i||o.rightr||Math.min(o.bottom,l)=t&&c<=n}function KDt(e,t={}){let n=hi.define(),i=new WeakMap,r=dl.define({create(){return[]},update(o,l){let c=i.get(o);if(o.length&&(t.hideOnChange&&(l.docChanged||l.selection)?o=[]:c&&c(l)?o=[]:t.hideOn&&(o=o.filter(u=>!t.hideOn(l,u)))),l.docChanged&&o.length){let u=[];for(let d of o){let f=l.changes.mapPos(d.pos,-1,il.TrackDel);if(f!=null){let h=Object.assign(Object.create(null),d);h.pos=f,h.end!=null&&(h.end=l.changes.mapPos(h.end)),u.push(h)}}o=u}for(let u of l.effects)u.is(n)&&(o=u.value,c=void 0),(u.is(XDt)&&!u.value||u.value==r)&&(o=[]);return o.length&&c&&i.set(o,c),o},provide:o=>GI.from(o)});const s=ga.define(o=>new HDt(o,e,r,i,n,t.hoverTime||300));return{active:r,extension:[r,s,a4e.of(s),VDt]}}function GDt(e,t,n,i={}){var r;let s=e.state.facet(a4e).map(o=>e.plugin(o)).filter(o=>!!o);if(i.tooltip&&i.tooltip.active){let o=s.find(l=>l.field==i.tooltip.active);o&&(s=[o])}for(let o of s)o.activateHover(e,t,n,(r=i.until)!==null&&r!==void 0?r:()=>!1)}function o4e(e,t){let n=e.plugin(Zq);if(!n)return null;let i=n.manager.tooltips.indexOf(t);return i<0?null:n.manager.tooltipViews[i]}const XDt=hi.define(),cre=gn.define({combine(e){let t,n;for(let i of e)t=t||i.topContainer,n=n||i.bottomContainer;return{topContainer:t,bottomContainer:n}}});function eW(e,t){let n=e.plugin(l4e),i=n?n.specs.indexOf(t):-1;return i>-1?n.panels[i]:null}const l4e=ga.fromClass(class{constructor(e){this.input=e.state.facet(DC),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(e));let t=e.state.facet(cre);this.top=new Z_(e,!0,t.topContainer),this.bottom=new Z_(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(e){let t=e.state.facet(cre);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new Z_(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new Z_(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(DC);if(n!=this.input){let i=n.filter(c=>c),r=[],s=[],o=[],l=[];for(let c of i){let u=this.specs.indexOf(c),d;u<0?(d=c(e.view),l.push(d)):(d=this.panels[u],d.update&&d.update(e)),r.push(d),(d.top?s:o).push(d)}this.specs=i,this.panels=r,this.top.sync(s),this.bottom.sync(o);for(let c of l)c.dom.classList.add("cm-panel"),c.mount&&c.mount()}else for(let i of this.panels)i.update&&i.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>en.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class Z_{constructor(t,n,i){this.view=t,this.top=n,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let n of this.panels)n.destroy&&t.indexOf(n)<0&&n.destroy();this.panels=t,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let t=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;t!=n.dom;)t=ure(t);t=t.nextSibling}else this.dom.insertBefore(n.dom,t);for(;t;)t=ure(t)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let t of this.classes.split(" "))t&&this.container.classList.remove(t);for(let t of(this.classes=this.view.themeClasses).split(" "))t&&this.container.classList.add(t)}}}function ure(e){let t=e.nextSibling;return e.remove(),t}const DC=gn.define({enables:l4e});function YDt(e,t){let n,i=new Promise(o=>n=o),r=o=>ZDt(o,t,n);e.state.field(a$,!1)?e.dispatch({effects:c4e.of(r)}):e.dispatch({effects:hi.appendConfig.of(a$.init(()=>[r]))});let s=u4e.of(r);return{close:s,result:i.then(o=>((e.win.queueMicrotask||(c=>e.win.setTimeout(c,10)))(()=>{e.state.field(a$).indexOf(r)>-1&&e.dispatch({effects:s})}),o))}}const a$=dl.define({create(){return[]},update(e,t){for(let n of t.effects)n.is(c4e)?e=[n.value].concat(e):n.is(u4e)&&(e=e.filter(i=>i!=n.value));return e},provide:e=>DC.computeN([e],t=>t.field(e))}),c4e=hi.define(),u4e=hi.define();function ZDt(e,t,n){let i=t.content?t.content(e,()=>o(null)):null;if(!i){if(i=Xr("form"),t.input){let l=Xr("input",t.input);/^(text|password|number|email|tel|url)$/.test(l.type)&&l.classList.add("cm-textfield"),l.name||(l.name="input"),i.appendChild(Xr("label",(t.label||"")+": ",l))}else i.appendChild(document.createTextNode(t.label||""));i.appendChild(document.createTextNode(" ")),i.appendChild(Xr("button",{class:"cm-button",type:"submit"},t.submitLabel||"OK"))}let r=i.nodeName=="FORM"?[i]:i.querySelectorAll("form");for(let l=0;l{u.keyCode==27?(u.preventDefault(),o(null)):u.keyCode==13&&(u.preventDefault(),o(c))}),c.addEventListener("submit",u=>{u.preventDefault(),o(c)})}let s=Xr("div",i,Xr("button",{onclick:()=>o(null),"aria-label":e.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));t.class&&(s.className=t.class),s.classList.add("cm-dialog");function o(l){s.contains(s.ownerDocument.activeElement)&&e.focus(),n(l)}return{dom:s,top:t.top,mount:()=>{if(t.focus){let l;typeof t.focus=="string"?l=i.querySelector(t.focus):l=i.querySelector("input")||i.querySelector("button"),l&&"select"in l?l.select():l&&"focus"in l&&l.focus()}}}}class sm extends hb{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}sm.prototype.elementClass="";sm.prototype.toDOM=void 0;sm.prototype.mapMode=il.TrackBefore;sm.prototype.startSide=sm.prototype.endSide=-1;sm.prototype.point=!0;const UN=gn.define(),JDt=gn.define(),eMt={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Gi.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},vE=gn.define();function tMt(e){return[d4e(),vE.of({...eMt,...e})]}const dre=gn.define({combine:e=>e.some(t=>t)});function d4e(e){return[nMt]}const nMt=ga.fromClass(class{constructor(e){this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=e.state.facet(vE).map(t=>new hre(e,t)),this.fixed=!e.state.facet(dre);for(let t of this.gutters)t.config.side=="after"?this.getDOMAfter().appendChild(t.dom):this.dom.appendChild(t.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,i=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(i<(n.to-n.from)*.8)}if(e.geometryChanged){let t=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=t,this.domAfter&&(this.domAfter.style.minHeight=t)}this.view.state.facet(dre)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=Gi.iter(this.view.state.facet(UN),this.view.viewport.from),i=[],r=this.gutters.map(s=>new iMt(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(s.type)){let o=!0;for(let l of s.type)if(l.type==ol.Text&&o){J9(n,i,l.from);for(let c of r)c.line(this.view,l,i);o=!1}else if(l.widget)for(let c of r)c.widget(this.view,l)}else if(s.type==ol.Text){J9(n,i,s.from);for(let o of r)o.line(this.view,s,i)}else if(s.widget)for(let o of r)o.widget(this.view,s);for(let s of r)s.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(vE),n=e.state.facet(vE),i=e.docChanged||e.heightChanged||e.viewportChanged||!Gi.eq(e.startState.facet(UN),e.state.facet(UN),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let r of this.gutters)r.update(e)&&(i=!0);else{i=!0;let r=[];for(let s of n){let o=t.indexOf(s);o<0?r.push(new hre(this.view,s)):(this.gutters[o].update(e),r.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),r.indexOf(s)<0&&s.destroy();for(let s of r)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=r}return i}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>en.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||n.gutters.length==0||!n.fixed)return null;let i=n.dom.offsetWidth*t.scaleX,r=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==cs.LTR?{left:i,right:r}:{right:i,left:r}})});function fre(e){return Array.isArray(e)?e:[e]}function J9(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class iMt{constructor(t,n,i){this.gutter=t,this.height=i,this.i=0,this.cursor=Gi.iter(t.markers,n.from)}addElement(t,n,i){let{gutter:r}=this,s=(n.top-this.height)/t.scaleY,o=n.height/t.scaleY;if(this.i==r.elements.length){let l=new f4e(t,o,s,i);r.elements.push(l),r.dom.appendChild(l.dom)}else r.elements[this.i].update(t,o,s,i);this.height=n.bottom,this.i++}line(t,n,i){let r=[];J9(this.cursor,r,n.from),i.length&&(r=r.concat(i));let s=this.gutter.config.lineMarker(t,n,r);s&&r.unshift(s);let o=this.gutter;r.length==0&&!o.config.renderEmptyElements||this.addElement(t,n,r)}widget(t,n){let i=this.gutter.config.widgetMarker(t,n.widget,n),r=i?[i]:null;for(let s of t.state.facet(JDt)){let o=s(t,n.widget,n);o&&(r||(r=[])).push(o)}r&&this.addElement(t,n,r)}finish(){let t=this.gutter;for(;t.elements.length>this.i;){let n=t.elements.pop();t.dom.removeChild(n.dom),n.destroy()}}}class hre{constructor(t,n){this.view=t,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in n.domEventHandlers)this.dom.addEventListener(i,r=>{let s=r.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let c=s.getBoundingClientRect();o=(c.top+c.bottom)/2}else o=r.clientY;let l=t.lineBlockAtHeight(o-t.documentTop);n.domEventHandlers[i](t,l,r)&&r.preventDefault()});this.markers=fre(n.markers(t)),n.initialSpacer&&(this.spacer=new f4e(t,0,0,[n.initialSpacer(t)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(t){let n=this.markers;if(this.markers=fre(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],t);r!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[r])}let i=t.view.viewport;return!Gi.eq(this.markers,n,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(t):!1)}destroy(){for(let t of this.elements)t.destroy()}}class f4e{constructor(t,n,i,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(t,n,i,r)}update(t,n,i,r){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),rMt(this.markers,r)||this.setMarkers(t,r)}setMarkers(t,n){let i="cm-gutterElement",r=this.dom.firstChild;for(let s=0,o=0;;){let l=o,c=ss(l,c,u)||o(l,c,u):o}return i}})}});class o$ extends sm{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function l$(e,t){return e.state.facet($x).formatNumber(t,e.state)}const oMt=vE.compute([$x],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(t){return t.state.facet(sMt)},lineMarker(t,n,i){return i.some(r=>r.toDOM)?null:new o$(l$(t,t.state.doc.lineAt(n.from).number))},widgetMarker:(t,n,i)=>{for(let r of t.state.facet(aMt)){let s=r(t,n,i);if(s)return s}return null},lineMarkerChange:t=>t.startState.facet($x)!=t.state.facet($x),initialSpacer(t){return new o$(l$(t,pre(t.state.doc.lines)))},updateSpacer(t,n){let i=l$(n.view,pre(n.view.state.doc.lines));return i==t.number?t:new o$(i)},domEventHandlers:e.facet($x).domEventHandlers,side:"before"}));function h4e(e={}){return[$x.of(e),d4e(),oMt]}function pre(e){let t=9;for(;t{let t=[],n=-1;for(let i of e.selection.ranges){let r=e.doc.lineAt(i.head).from;r>n&&(n=r,t.push(lMt.range(r)))}return Gi.of(t)});function uMt(){return cMt}let dMt=0,Gf=class e7{constructor(t,n,i,r){this.name=t,this.set=n,this.base=i,this.modified=r,this.id=dMt++}toString(){let{name:t}=this;for(let n of this.modified)n.name&&(t=`${n.name}(${t})`);return t}static define(t,n){let i=typeof t=="string"?t:"?";if(t instanceof e7&&(n=t),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let r=new e7(i,[],null,[]);if(r.set.push(r),n)for(let s of n.set)r.set.push(s);return r}static defineModifier(t){let n=new XI(t);return i=>i.modified.indexOf(n)>-1?i:XI.get(i.base||i,i.modified.concat(n).sort((r,s)=>r.id-s.id))}},fMt=0;class XI{constructor(t){this.name=t,this.instances=[],this.id=fMt++}static get(t,n){if(!n.length)return t;let i=n[0].instances.find(l=>l.base==t&&hMt(n,l.modified));if(i)return i;let r=[],s=new Gf(t.name,r,t,n);for(let l of n)l.instances.push(s);let o=pMt(n);for(let l of t.set)if(!l.modified.length)for(let c of o)r.push(XI.get(l,c));return s}}function hMt(e,t){return e.length==t.length&&e.every((n,i)=>n==t[i])}function pMt(e){let t=[[]];for(let n=0;ni.length-n.length)}function vm(e){let t=Object.create(null);for(let n in e){let i=e[n];Array.isArray(i)||(i=[i]);for(let r of n.split(" "))if(r){let s=[],o=2,l=r;for(let f=0;;){if(l=="..."&&f>0&&f+3==r.length){o=1;break}let h=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!h)throw new RangeError("Invalid path: "+r);if(s.push(h[0]=="*"?"":h[0][0]=='"'?JSON.parse(h[0]):h[0]),f+=h[0].length,f==r.length)break;let m=r[f++];if(f==r.length&&m=="!"){o=0;break}if(m!="/")throw new RangeError("Invalid path: "+r);l=r.slice(f)}let c=s.length-1,u=s[c];if(!u)throw new RangeError("Invalid path: "+r);let d=new MC(i,o,c>0?s.slice(0,c):null);t[u]=d.sort(t[u])}}return p4e.add(t)}const p4e=new ci({combine(e,t){let n,i,r;for(;e||t;){if(!e||t&&e.depth>=t.depth?(r=t,t=t.next):(r=e,e=e.next),n&&n.mode==r.mode&&!r.context&&!n.context)continue;let s=new MC(r.tags,r.mode,r.context);n?n.next=s:i=s,n=s}return i}});let MC=class{constructor(t,n,i,r){this.tags=t,this.mode=n,this.context=i,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(t){return!t||t.depth{let o=r;for(let l of s)for(let c of l.set){let u=n[c.id];if(u){o=o?o+" "+u:u;break}}return o},scope:i}}function mMt(e,t){let n=null;for(let i of e){let r=i.style(t);r&&(n=n?n+" "+r:r)}return n}function gMt(e,t,n,i=0,r=e.length){let s=new bMt(i,Array.isArray(t)?t:[t],n);s.highlightRange(e.cursor(),i,r,"",s.highlighters),s.flush(r)}class bMt{constructor(t,n,i){this.at=t,this.highlighters=n,this.span=i,this.class=""}startSpan(t,n){n!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=n)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,n,i,r,s){let{type:o,from:l,to:c}=t;if(l>=i||c<=n)return;o.isTop&&(s=this.highlighters.filter(m=>!m.scope||m.scope(o)));let u=r,d=yMt(t)||MC.empty,f=mMt(s,d.tags);if(f&&(u&&(u+=" "),u+=f,d.mode==1&&(r+=(r?" ":"")+f)),this.startSpan(Math.max(n,l),u),d.opaque)return;let h=t.tree&&t.tree.prop(ci.mounted);if(h&&h.overlay){let m=t.node.enter(h.overlay[0].from+l,1),g=this.highlighters.filter(v=>!v.scope||v.scope(h.tree.type)),b=t.firstChild();for(let v=0,y=l;;v++){let w=v=x||!t.nextSibling())););if(!w||x>i)break;y=w.to+l,y>n&&(this.highlightRange(m.cursor(),Math.max(n,w.from+l),Math.min(i,y),"",g),this.startSpan(Math.min(i,y),u))}b&&t.parent()}else if(t.firstChild()){h&&(r="");do if(!(t.to<=n)){if(t.from>=i)break;this.highlightRange(t,n,i,r,s),this.startSpan(Math.min(i,t.to),u)}while(t.nextSibling());t.parent()}}}function yMt(e){let t=e.type.prop(p4e);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}const an=Gf.define,J_=an(),Ym=an(),mre=an(Ym),gre=an(Ym),Zm=an(),ej=an(Zm),c$=an(Zm),qf=an(),Yb=an(qf),Qf=an(),zf=an(),t7=an(),vk=an(t7),tj=an(),fe={comment:J_,lineComment:an(J_),blockComment:an(J_),docComment:an(J_),name:Ym,variableName:an(Ym),typeName:mre,tagName:an(mre),propertyName:gre,attributeName:an(gre),className:an(Ym),labelName:an(Ym),namespace:an(Ym),macroName:an(Ym),literal:Zm,string:ej,docString:an(ej),character:an(ej),attributeValue:an(ej),number:c$,integer:an(c$),float:an(c$),bool:an(Zm),regexp:an(Zm),escape:an(Zm),color:an(Zm),url:an(Zm),keyword:Qf,self:an(Qf),null:an(Qf),atom:an(Qf),unit:an(Qf),modifier:an(Qf),operatorKeyword:an(Qf),controlKeyword:an(Qf),definitionKeyword:an(Qf),moduleKeyword:an(Qf),operator:zf,derefOperator:an(zf),arithmeticOperator:an(zf),logicOperator:an(zf),bitwiseOperator:an(zf),compareOperator:an(zf),updateOperator:an(zf),definitionOperator:an(zf),typeOperator:an(zf),controlOperator:an(zf),punctuation:t7,separator:an(t7),bracket:vk,angleBracket:an(vk),squareBracket:an(vk),paren:an(vk),brace:an(vk),content:qf,heading:Yb,heading1:an(Yb),heading2:an(Yb),heading3:an(Yb),heading4:an(Yb),heading5:an(Yb),heading6:an(Yb),contentSeparator:an(qf),list:an(qf),quote:an(qf),emphasis:an(qf),strong:an(qf),link:an(qf),monospace:an(qf),strikethrough:an(qf),inserted:an(),deleted:an(),changed:an(),invalid:an(),meta:tj,documentMeta:an(tj),annotation:an(tj),processingInstruction:an(tj),definition:Gf.defineModifier("definition"),constant:Gf.defineModifier("constant"),function:Gf.defineModifier("function"),standard:Gf.defineModifier("standard"),local:Gf.defineModifier("local"),special:Gf.defineModifier("special")};for(let e in fe){let t=fe[e];t instanceof Gf&&(t.name=e)}m4e([{tag:fe.link,class:"tok-link"},{tag:fe.heading,class:"tok-heading"},{tag:fe.emphasis,class:"tok-emphasis"},{tag:fe.strong,class:"tok-strong"},{tag:fe.keyword,class:"tok-keyword"},{tag:fe.atom,class:"tok-atom"},{tag:fe.bool,class:"tok-bool"},{tag:fe.url,class:"tok-url"},{tag:fe.labelName,class:"tok-labelName"},{tag:fe.inserted,class:"tok-inserted"},{tag:fe.deleted,class:"tok-deleted"},{tag:fe.literal,class:"tok-literal"},{tag:fe.string,class:"tok-string"},{tag:fe.number,class:"tok-number"},{tag:[fe.regexp,fe.escape,fe.special(fe.string)],class:"tok-string2"},{tag:fe.variableName,class:"tok-variableName"},{tag:fe.local(fe.variableName),class:"tok-variableName tok-local"},{tag:fe.definition(fe.variableName),class:"tok-variableName tok-definition"},{tag:fe.special(fe.variableName),class:"tok-variableName2"},{tag:fe.definition(fe.propertyName),class:"tok-propertyName tok-definition"},{tag:fe.typeName,class:"tok-typeName"},{tag:fe.namespace,class:"tok-namespace"},{tag:fe.className,class:"tok-className"},{tag:fe.macroName,class:"tok-macroName"},{tag:fe.propertyName,class:"tok-propertyName"},{tag:fe.operator,class:"tok-operator"},{tag:fe.comment,class:"tok-comment"},{tag:fe.meta,class:"tok-meta"},{tag:fe.invalid,class:"tok-invalid"},{tag:fe.punctuation,class:"tok-punctuation"}]);var u$;const Og=new ci;function eL(e){return gn.define({combine:e?t=>t.concat(e):void 0})}const tW=new ci;class wu{constructor(t,n,i=[],r=""){this.data=t,this.name=r,tr.prototype.hasOwnProperty("tree")||Object.defineProperty(tr.prototype,"tree",{get(){return Jr(this)}}),this.parser=n,this.extension=[bb.of(this),tr.languageData.of((s,o,l)=>{let c=bre(s,o,l),u=c.type.prop(Og);if(!u)return[];let d=s.facet(u),f=c.type.prop(tW);if(f){let h=c.resolve(o-c.from,l);for(let m of f)if(m.test(h,s)){let g=s.facet(m.facet);return m.type=="replace"?g:g.concat(d)}}return d})].concat(i)}isActiveAt(t,n,i=-1){return bre(t,n,i).type.prop(Og)==this.data}findRegions(t){let n=t.facet(bb);if((n==null?void 0:n.data)==this.data)return[{from:0,to:t.doc.length}];if(!n||!n.allowsNesting)return[];let i=[],r=(s,o)=>{if(s.prop(Og)==this.data){i.push({from:o,to:o+s.length});return}let l=s.prop(ci.mounted);if(l){if(l.tree.prop(Og)==this.data){if(l.overlay)for(let c of l.overlay)i.push({from:c.from+o,to:c.to+o});else i.push({from:o,to:o+s.length});return}else if(l.overlay){let c=i.length;if(r(l.tree,l.overlay[0].from+o),i.length>c)return}}for(let c=0;ci.isTop?n:void 0)]}),t.name)}configure(t,n){return new am(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Jr(e){let t=e.field(wu.state,!1);return t?t.tree:Ui.empty}class vMt{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,n){let i=this.cursorPos-this.string.length;return t=this.cursorPos?this.doc.sliceString(t,n):this.string.slice(t-i,n-i)}}let xk=null;class x0{constructor(t,n,i=[],r,s,o,l,c){this.parser=t,this.state=n,this.fragments=i,this.tree=r,this.treeLen=s,this.viewport=o,this.skipped=l,this.scheduleOn=c,this.parse=null,this.tempSkipped=[]}static create(t,n,i){return new x0(t,n,[],Ui.empty,0,i,[],null)}startParse(){return this.parser.startParse(new vMt(this.state.doc),this.fragments)}work(t,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Ui.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof t=="number"){let r=Date.now()+t;t=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=t,this.tree=n,this.fragments=this.withoutTempSkipped(Qp.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let n=xk;xk=this;try{return t()}finally{xk=n}}withoutTempSkipped(t){for(let n;n=this.tempSkipped.pop();)t=yre(t,n.from,n.to);return t}changes(t,n){let{fragments:i,tree:r,treeLen:s,viewport:o,skipped:l}=this;if(this.takeTree(),!t.empty){let c=[];if(t.iterChangedRanges((u,d,f,h)=>c.push({fromA:u,toA:d,fromB:f,toB:h})),i=Qp.applyChanges(i,c),r=Ui.empty,s=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){l=[];for(let u of this.skipped){let d=t.mapPos(u.from,1),f=t.mapPos(u.to,-1);dt.from&&(this.fragments=yre(this.fragments,r,s),this.skipped.splice(i--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,n){this.skipped.push({from:t,to:n})}static getSkippingParser(t){return new class extends qM{createParse(n,i,r){let s=r[0].from,o=r[r.length-1].to;return{parsedPos:s,advance(){let c=xk;if(c){for(let u of r)c.tempSkipped.push(u);t&&(c.scheduleOn=c.scheduleOn?Promise.all([c.scheduleOn,t]):t)}return this.parsedPos=o,new Ui(Za.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let n=this.fragments;return this.treeLen>=t&&n.length&&n[0].from==0&&n[0].to>=t}static get(){return xk}}function yre(e,t,n){return Qp.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class f1{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),i=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,i)||n.takeTree(),new f1(n)}static init(t){let n=Math.min(3e3,t.doc.length),i=x0.create(t.facet(bb).parser,t,{from:0,to:n});return i.work(20,n)||i.takeTree(),new f1(i)}}wu.state=dl.define({create:f1.init,update(e,t){for(let n of t.effects)if(n.is(wu.setState))return n.value;return t.startState.facet(bb)!=t.state.facet(bb)?f1.init(t.state):e.apply(t)}});let g4e=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&(g4e=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const d$=typeof navigator<"u"&&(!((u$=navigator.scheduling)===null||u$===void 0)&&u$.isInputPending)?()=>navigator.scheduling.isInputPending():null,xMt=ga.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let n=this.view.state.field(wu.state).context;(n.updateViewport(t.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:t}=this.view,n=t.field(wu.state);(n.tree!=n.context.tree||!n.context.isDone(t.doc.length))&&(this.working=g4e(this.work))}work(t){this.working=null;let n=Date.now();if(this.chunkEndr+1e3,c=s.context.work(()=>d$&&d$()||Date.now()>o,r+(l?0:1e5));this.chunkBudget-=Date.now()-n,(c||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:wu.setState.of(new f1(s.context))})),this.chunkBudget>0&&!(c&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Dc(this.view.state,n)).then(()=>this.workScheduled--),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),bb=gn.define({combine(e){return e.length?e[0]:null},enables:e=>[wu.state,xMt,en.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class yb{constructor(t,n=[]){this.language=t,this.support=n,this.extension=[t,n]}}class YI{constructor(t,n,i,r,s,o=void 0){this.name=t,this.alias=n,this.extensions=i,this.filename=r,this.loadFunc=s,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(t=>this.support=t,t=>{throw this.loading=null,t}))}static of(t){let{load:n,support:i}=t;if(!n){if(!i)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");n=()=>Promise.resolve(i)}return new YI(t.name,(t.alias||[]).concat(t.name).map(r=>r.toLowerCase()),t.extensions||[],t.filename,n,i)}static matchFilename(t,n){for(let r of t)if(r.filename&&r.filename.test(n))return r;let i=/\.([^.]+)$/.exec(n);if(i){for(let r of t)if(r.extensions.indexOf(i[1])>-1)return r}return null}static matchLanguageName(t,n,i=!0){n=n.toLowerCase();for(let r of t)if(r.alias.some(s=>s==n))return r;if(i)for(let r of t)for(let s of r.alias){let o=n.indexOf(s);if(o>-1&&(s.length>2||!/\w/.test(n[o-1])&&!/\w/.test(n[o+s.length])))return r}return null}}const wMt=gn.define(),fO=gn.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(n=>n!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function w0(e){let t=e.facet(fO);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function LC(e,t){let n="",i=e.tabSize,r=e.facet(fO)[0];if(r==" "){for(;t>=i;)n+=" ",t-=i;r=" "}for(let s=0;s=t?OMt(e,n,t):null}class tL{constructor(t,n={}){this.state=t,this.options=n,this.unit=w0(t)}lineAt(t,n=1){let i=this.state.doc.lineAt(t),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=i.from&&r<=i.to?s&&r==t?{text:"",from:t}:(n<0?r-1&&(s+=o-this.countColumn(i,i.search(/\S|$/))),s}countColumn(t,n=t.length){return Of(t,this.state.tabSize,n)}lineIndent(t,n=1){let{text:i,from:r}=this.lineAt(t,n),s=this.options.overrideIndentation;if(s){let o=s(r);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const xm=new ci;function OMt(e,t,n){let i=t.resolveStack(n),r=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(r!=i.node){let s=[];for(let o=r;o&&!(o.fromi.node.to||o.from==i.node.from&&o.type==i.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)i={node:s[o],next:i}}return b4e(i,e,n)}function b4e(e,t,n){for(let i=e;i;i=i.next){let r=SMt(i.node);if(r)return r(iW.create(t,n,i))}return 0}function kMt(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function SMt(e){let t=e.type.prop(xm);if(t)return t;let n=e.firstChild,i;if(n&&(i=n.type.prop(ci.closedBy))){let r=e.lastChild,s=r&&i.indexOf(r.name)>-1;return o=>y4e(o,!0,1,void 0,s&&!kMt(o)?r.from:void 0)}return e.parent==null?EMt:null}function EMt(){return 0}class iW extends tL{constructor(t,n,i){super(t.state,t.options),this.base=t,this.pos=n,this.context=i}get node(){return this.context.node}static create(t,n,i){return new iW(t,n,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let n=this.state.doc.lineAt(t.from);for(;;){let i=t.resolve(n.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(CMt(i,t))break;n=this.state.doc.lineAt(i.from)}return this.lineIndent(n.from)}continue(){return b4e(this.context.next,this.base,this.pos)}}function CMt(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function AMt(e){let t=e.node,n=t.childAfter(t.from),i=t.lastChild;if(!n)return null;let r=e.options.simulateBreak,s=e.state.doc.lineAt(n.from),o=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let l=n.to;;){let c=t.childAfter(l);if(!c||c==i)return null;if(!c.type.isSkipped){if(c.from>=o)return null;let u=/^ */.exec(s.text.slice(n.to-s.from))[0].length;return{from:n.from,to:n.to+u}}l=c.to}}function yw({closing:e,align:t=!0,units:n=1}){return i=>y4e(i,t,n,e)}function y4e(e,t,n,i,r){let s=e.textAfter,o=s.match(/^\s*/)[0].length,l=i&&s.slice(o,o+i.length)==i||r==e.pos+o,c=t?AMt(e):null;return c?l?e.column(c.from):e.column(c.to):e.baseIndent+(l?0:e.unit*n)}const TMt=e=>e.baseIndent;function vw({except:e,units:t=1}={}){return n=>{let i=e&&e.test(n.textAfter);return n.baseIndent+(i?0:t*n.unit)}}const _Mt=200;function jMt(){return tr.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:i}=e.newSelection.main,r=n.lineAt(i);if(i>r.from+_Mt)return e;let s=n.sliceString(r.from,i);if(!t.some(u=>u.test(s)))return e;let{state:o}=e,l=-1,c=[];for(let{head:u}of o.selection.ranges){let d=o.doc.lineAt(u);if(d.from==l)continue;l=d.from;let f=nW(o,d.from);if(f==null)continue;let h=/^\s*/.exec(d.text)[0],m=LC(o,f);h!=m&&c.push({from:d.from,to:d.from+h.length,insert:m})}return c.length?[e,{changes:c,sequential:!0}]:e})}const v4e=gn.define(),wm=new ci;function ET(e){let t=e.firstChild,n=e.lastChild;return t&&t.ton)continue;if(s&&l.from=t&&u.to>n&&(s=u)}}return s}function RMt(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function ZI(e,t,n){for(let i of e.facet(v4e)){let r=i(e,t,n);if(r)return r}return NMt(e,t,n)}function x4e(e,t){let n=t.mapPos(e.from,1),i=t.mapPos(e.to,-1);return n>=i?void 0:{from:n,to:i}}const nL=hi.define({map:x4e}),CT=hi.define({map:x4e});function w4e(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(i=>i.from<=n&&i.to>=n)||t.push(e.lineBlockAt(n));return t}const O0=dl.define({create(){return $n.none},update(e,t){t.isUserEvent("delete")&&t.changes.iterChangedRanges((i,r)=>e=vre(e,i,r)),e=e.map(t.changes);let n=[];for(let i of t.effects)i.is(nL)&&!IMt(e,i.value.from,i.value.to)?n.push(i.value):i.is(CT)&&(e=e.update({filter:(r,s)=>i.value.from!=r||i.value.to!=s,filterFrom:i.value.from,filterTo:i.value.to}));if(n.length){let{preparePlaceholder:i}=t.state.facet(S4e),r=n.map(s=>(i?$n.replace({widget:new BMt(i(t.state,s))}):xre).range(s.from,s.to));e=e.update({add:r})}return t.selection&&(e=vre(e,t.selection.main.head)),e},provide:e=>en.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(i,r)=>{n.push(i,r)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n{rt&&(i=!0)}),i?e.update({filterFrom:t,filterTo:n,filter:(r,s)=>r>=n||s<=t}):e}function JI(e,t,n){var i;let r=null;return(i=e.field(O0,!1))===null||i===void 0||i.between(t,n,(s,o)=>{(!r||r.from>s)&&(r={from:s,to:o})}),r}function IMt(e,t,n){let i=!1;return e.between(t,t,(r,s)=>{r==t&&s==n&&(i=!0)}),i}function O4e(e,t){return e.field(O0,!1)?t:t.concat(hi.appendConfig.of(E4e()))}const PMt=e=>{for(let t of w4e(e)){let n=ZI(e.state,t.from,t.to);if(n)return e.dispatch({effects:O4e(e.state,[nL.of(n),k4e(e,n)])}),!0}return!1},DMt=e=>{if(!e.state.field(O0,!1))return!1;let t=[];for(let n of w4e(e)){let i=JI(e.state,n.from,n.to);i&&t.push(CT.of(i),k4e(e,i,!1))}return t.length&&e.dispatch({effects:t}),t.length>0};function k4e(e,t,n=!0){let i=e.state.doc.lineAt(t.from).number,r=e.state.doc.lineAt(t.to).number;return en.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${i} ${e.state.phrase("to")} ${r}.`)}const MMt=e=>{let{state:t}=e,n=[];for(let i=0;i{let t=e.state.field(O0,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(i,r)=>{n.push(CT.of({from:i,to:r}))}),e.dispatch({effects:n}),!0},$Mt=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:PMt},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:DMt},{key:"Ctrl-Alt-[",run:MMt},{key:"Ctrl-Alt-]",run:LMt}],FMt={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},S4e=gn.define({combine(e){return Rh(e,FMt)}});function E4e(e){return[O0,zMt]}function C4e(e,t){let{state:n}=e,i=n.facet(S4e),r=o=>{let l=e.lineBlockAt(e.posAtDOM(o.target)),c=JI(e.state,l.from,l.to);c&&e.dispatch({effects:CT.of(c)}),o.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(e,r,t);let s=document.createElement("span");return s.textContent=i.placeholderText,s.setAttribute("aria-label",n.phrase("folded code")),s.title=n.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=r,s}const xre=$n.replace({widget:new class extends Nf{toDOM(e){return C4e(e,null)}}});class BMt extends Nf{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return C4e(t,this.value)}}const UMt={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class f$ extends sm{constructor(t,n){super(),this.config=t,this.open=n}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=t.state.phrase(this.open?"Fold line":"Unfold line"),n}}function QMt(e={}){let t={...UMt,...e},n=new f$(t,!0),i=new f$(t,!1),r=ga.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(bb)!=o.state.facet(bb)||o.startState.field(O0,!1)!=o.state.field(O0,!1)||Jr(o.startState)!=Jr(o.state)||t.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new im;for(let c of o.viewportLineBlocks){let u=JI(o.state,c.from,c.to)?i:ZI(o.state,c.from,c.to)?n:null;u&&l.add(c.from,c.from,u)}return l.finish()}}),{domEventHandlers:s}=t;return[r,tMt({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(r))===null||l===void 0?void 0:l.markers)||Gi.empty},initialSpacer(){return new f$(t,!1)},domEventHandlers:{...s,click:(o,l,c)=>{if(s.click&&s.click(o,l,c))return!0;let u=JI(o.state,l.from,l.to);if(u)return o.dispatch({effects:CT.of(u)}),!0;let d=ZI(o.state,l.from,l.to);return d?(o.dispatch({effects:nL.of(d)}),!0):!1}}}),E4e()]}const zMt=en.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class AT{constructor(t,n){this.specs=t;let i;function r(l){let c=pb.newName();return(i||(i=Object.create(null)))["."+c]=l,c}const s=typeof n.all=="string"?n.all:n.all?r(n.all):void 0,o=n.scope;this.scope=o instanceof wu?l=>l.prop(Og)==o.data:o?l=>l==o:void 0,this.style=m4e(t.map(l=>({tag:l.tag,class:l.class||r(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=i?new pb(i):null,this.themeType=n.themeType}static define(t,n){return new AT(t,n||{})}}const n7=gn.define(),A4e=gn.define({combine(e){return e.length?[e[0]]:null}});function QN(e){let t=e.facet(n7);return t.length?t:e.facet(A4e)}function T4e(e,t){let n=[HMt],i;return e instanceof AT&&(e.module&&n.push(en.styleModule.of(e.module)),i=e.themeType),t!=null&&t.fallback?n.push(A4e.of(e)):i?n.push(n7.computeN([en.darkTheme],r=>r.facet(en.darkTheme)==(i=="dark")?[e]:[])):n.push(n7.of(e)),n}function Bhn(e,t,n){let i=QN(e),r=null;if(i){for(let s of i)if(!s.scope||n){let o=s.style(t);o&&(r=r?r+" "+o:o)}}return r}class VMt{constructor(t){this.markCache=Object.create(null),this.tree=Jr(t.state),this.decorations=this.buildDeco(t,QN(t.state)),this.decoratedTo=t.viewport.to}update(t){let n=Jr(t.state),i=QN(t.state),r=i!=QN(t.startState),{viewport:s}=t.view,o=t.changes.mapPos(this.decoratedTo,1);n.length=s.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=o):(n!=this.tree||t.viewportChanged||r)&&(this.tree=n,this.decorations=this.buildDeco(t.view,i),this.decoratedTo=s.to)}buildDeco(t,n){if(!n||!this.tree.length)return $n.none;let i=new im;for(let{from:r,to:s}of t.visibleRanges)gMt(this.tree,n,(o,l,c)=>{i.add(o,l,this.markCache[c]||(this.markCache[c]=$n.mark({class:c})))},r,s);return i.finish()}}const HMt=ym.high(ga.fromClass(VMt,{decorations:e=>e.decorations})),qMt=AT.define([{tag:fe.meta,color:"#404740"},{tag:fe.link,textDecoration:"underline"},{tag:fe.heading,textDecoration:"underline",fontWeight:"bold"},{tag:fe.emphasis,fontStyle:"italic"},{tag:fe.strong,fontWeight:"bold"},{tag:fe.strikethrough,textDecoration:"line-through"},{tag:fe.keyword,color:"#708"},{tag:[fe.atom,fe.bool,fe.url,fe.contentSeparator,fe.labelName],color:"#219"},{tag:[fe.literal,fe.inserted],color:"#164"},{tag:[fe.string,fe.deleted],color:"#a11"},{tag:[fe.regexp,fe.escape,fe.special(fe.string)],color:"#e40"},{tag:fe.definition(fe.variableName),color:"#00f"},{tag:fe.local(fe.variableName),color:"#30a"},{tag:[fe.typeName,fe.namespace],color:"#085"},{tag:fe.className,color:"#167"},{tag:[fe.special(fe.variableName),fe.macroName],color:"#256"},{tag:fe.definition(fe.propertyName),color:"#00c"},{tag:fe.comment,color:"#940"},{tag:fe.invalid,color:"#f00"}]),WMt=en.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),_4e=1e4,j4e="()[]{}",N4e=gn.define({combine(e){return Rh(e,{afterCursor:!0,brackets:j4e,maxScanDistance:_4e,renderMatch:XMt})}}),KMt=$n.mark({class:"cm-matchingBracket"}),GMt=$n.mark({class:"cm-nonmatchingBracket"});function XMt(e){let t=[],n=e.matched?KMt:GMt;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}function wre(e){let t=[],n=e.facet(N4e);for(let i of e.selection.ranges){if(!i.empty)continue;let r=lh(e,i.head,-1,n)||i.head>0&&lh(e,i.head-1,1,n)||n.afterCursor&&(lh(e,i.head,1,n)||i.heade.decorations}),ZMt=[YMt,WMt];function JMt(e={}){return[N4e.of(e),ZMt]}const R4e=new ci;function i7(e,t,n){let i=e.prop(t<0?ci.openedBy:ci.closedBy);if(i)return i;if(e.name.length==1){let r=n.indexOf(e.name);if(r>-1&&r%2==(t<0?1:0))return[n[r+t]]}return null}function r7(e){let t=e.type.prop(R4e);return t?t(e.node):e}function lh(e,t,n,i={}){let r=i.maxScanDistance||_4e,s=i.brackets||j4e,o=Jr(e),l=o.resolveInner(t,n);for(let c=l;c;c=c.parent){let u=i7(c.type,n,s);if(u&&c.from0?t>=d.from&&td.from&&t<=d.to))return eLt(e,t,n,c,d,u,s)}}return tLt(e,t,n,o,l.type,r,s)}function eLt(e,t,n,i,r,s,o){let l=i.parent,c={from:r.from,to:r.to},u=0,d=l==null?void 0:l.cursor();if(d&&(n<0?d.childBefore(i.from):d.childAfter(i.to)))do if(n<0?d.to<=i.from:d.from>=i.to){if(u==0&&s.indexOf(d.type.name)>-1&&d.from0)return null;let u={from:n<0?t-1:t,to:n>0?t+1:t},d=e.doc.iterRange(t,n>0?e.doc.length:0),f=0;for(let h=0;!d.next().done&&h<=s;){let m=d.value;n<0&&(h+=m.length);let g=t+h*n;for(let b=n>0?0:m.length-1,v=n>0?m.length:-1;b!=v;b+=n){let y=o.indexOf(m[b]);if(!(y<0||i.resolveInner(g+b,1).type!=r))if(y%2==0==n>0)f++;else{if(f==1)return{start:u,end:{from:g+b,to:g+b+1},matched:y>>1==c>>1};f--}}n>0&&(h+=m.length)}return d.done?{start:u,matched:!1}:null}function Ore(e,t,n,i=0,r=0){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));let s=r;for(let o=i;o=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.posn}eatSpace(){let t=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t}skipToEnd(){this.pos=this.string.length}skipTo(t){let n=this.string.indexOf(t,this.pos);if(n>-1)return this.pos=n,!0}backUp(t){this.pos-=t}column(){return this.lastColumnPosi?o.toLowerCase():o,s=this.string.substr(this.pos,t.length);return r(s)==r(t)?(n!==!1&&(this.pos+=t.length),!0):null}else{let r=this.string.slice(this.pos).match(t);return r&&r.index>0?null:(r&&n!==!1&&(this.pos+=r[0].length),r)}}current(){return this.string.slice(this.start,this.pos)}}function nLt(e){return{name:e.name||"",token:e.token,blankLine:e.blankLine||(()=>{}),startState:e.startState||(()=>!0),copyState:e.copyState||iLt,indent:e.indent||(()=>null),languageData:e.languageData||{},tokenTable:e.tokenTable||aW,mergeTokens:e.mergeTokens!==!1}}function iLt(e){if(typeof e!="object")return e;let t={};for(let n in e){let i=e[n];t[n]=i instanceof Array?i.slice():i}return t}const kre=new WeakMap;class rW extends wu{constructor(t){let n=eL(t.languageData),i=nLt(t),r,s=new class extends qM{createParse(o,l,c){return new sLt(r,o,l,c)}};super(n,s,[],t.name),this.topNode=lLt(n,this),r=this,this.streamParser=i,this.stateAfter=new ci({perNode:!0}),this.tokenTable=t.tokenTable?new L4e(i.tokenTable):oLt}static define(t){return new rW(t)}getIndent(t){let n,{overrideIndentation:i}=t.options;i&&(n=kre.get(t.state),n!=null&&n1e4)return null;for(;s=i&&n+t.length<=r&&t.prop(e.stateAfter);if(s)return{state:e.streamParser.copyState(s),pos:n+t.length};for(let o=t.children.length-1;o>=0;o--){let l=t.children[o],c=n+t.positions[o],u=l instanceof Ui&&c=t.length)return t;!r&&n==0&&t.type==e.topNode&&(r=!0);for(let s=t.children.length-1;s>=0;s--){let o=t.positions[s],l=t.children[s],c;if(on&&sW(e,s.tree,0-s.offset,n,l),u;if(c&&c.pos<=i&&(u=P4e(e,s.tree,n+s.offset,c.pos+s.offset,!1)))return{state:c.state,tree:u}}return{state:e.streamParser.startState(r?w0(r):4),tree:Ui.empty}}let sLt=class{constructor(t,n,i,r){this.lang=t,this.input=n,this.fragments=i,this.ranges=r,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=r[r.length-1].to;let s=x0.get(),o=r[0].from,{state:l,tree:c}=rLt(t,i,o,this.to,s==null?void 0:s.state);this.state=l,this.parsedPos=this.chunkStart=o+c.length;for(let u=0;uu.from<=s.viewport.from&&u.to>=s.viewport.from)&&(this.state=this.lang.streamParser.startState(w0(s.state)),s.skipUntilInView(this.parsedPos,s.viewport.from),this.parsedPos=s.viewport.from),this.moveRangeIndex()}advance(){let t=x0.get(),n=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),i=Math.min(n,this.chunkStart+512);for(t&&(i=Math.min(i,t.viewport.to));this.parsedPos=n?this.finish():t&&this.parsedPos>=t.viewport.to?(t.skipUntilInView(this.parsedPos,n),this.finish()):null}stopAt(t){this.stoppedAt=t}lineAfter(t){let n=this.input.chunk(t);if(this.input.lineChunks)n==` +`;this.styleTag.textContent=o;let l=n.head||n;this.styleTag.parentNode!=l&&l.insertBefore(this.styleTag,l.firstChild)}}setNonce(t){this.styleTag&&this.styleTag.getAttribute("nonce")!=t&&this.styleTag.setAttribute("nonce",t)}}var pb={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},DC={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},xIt=typeof navigator<"u"&&/Mac/.test(navigator.platform),wIt=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var el=0;el<10;el++)pb[48+el]=pb[96+el]=String(el);for(var el=1;el<=24;el++)pb[el+111]="F"+el;for(var el=65;el<=90;el++)pb[el]=String.fromCharCode(el+32),DC[el]=String.fromCharCode(el);for(var G4 in pb)DC.hasOwnProperty(G4)||(DC[G4]=pb[G4]);function OIt(e){var t=xIt&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||wIt&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?DC:pb)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function Kr(){var e=arguments[0];typeof e=="string"&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var r=n[i];typeof r=="string"?e.setAttribute(i,r):r!=null&&(e[i]=r)}t++}for(;t2);var hn={mac:Tie||/Mac/.test(Yl.platform),windows:/Win/.test(Yl.platform),linux:/Linux|X11/.test(Yl.platform),ie:GM,ie_version:l3e?P9.documentMode||6:M9?+M9[1]:D9?+D9[1]:0,gecko:Cie,gecko_version:Cie?+(/Firefox\/(\d+)/.exec(Yl.userAgent)||[0,0])[1]:0,chrome:!!X4,chrome_version:X4?+X4[1]:0,ios:Tie,android:/Android\b/.test(Yl.userAgent),webkit:Aie,webkit_version:Aie?+(/\bAppleWebKit\/(\d+)/.exec(Yl.userAgent)||[0,0])[1]:0,safari:L9,safari_version:L9?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Yl.userAgent)||[0,0])[1]:0,tabSize:P9.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function Uq(e,t){for(let n in e)n=="class"&&t.class?t.class+=" "+e.class:n=="style"&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}const QI=Object.create(null);function Qq(e,t,n){if(e==t)return!0;e||(e=QI),t||(t=QI);let i=Object.keys(e),r=Object.keys(t);if(i.length-0!=r.length-0)return!1;for(let s of i)if(s!=n&&(r.indexOf(s)==-1||e[s]!==t[s]))return!1;return!0}function kIt(e,t){for(let n=e.attributes.length-1;n>=0;n--){let i=e.attributes[n].name;t[i]==null&&e.removeAttribute(i)}for(let n in t){let i=t[n];n=="style"?e.style.cssText=i:e.getAttribute(n)!=i&&e.setAttribute(n,i)}}function _ie(e,t,n){let i=!1;if(t)for(let r in t)n&&r in n||(i=!0,r=="style"?e.style.cssText="":e.removeAttribute(r));if(n)for(let r in n)t&&t[r]==n[r]||(i=!0,r=="style"?e.style.cssText=n[r]:e.setAttribute(r,n[r]));return i}function SIt(e){let t=Object.create(null);for(let n=0;n0?3e8:-4e8:n>0?1e8:-1e8,new x0(t,n,n,i,t.widget||null,!1)}static replace(t){let n=!!t.block,i,r;if(t.isBlockGap)i=-5e8,r=4e8;else{let{start:s,end:o}=c3e(t,n);i=(s?n?-3e8:-1:5e8)-1,r=(o?n?2e8:1:-6e8)+1}return new x0(t,i,r,n,t.widget||null,!0)}static line(t){return new TT(t)}static set(t,n=!1){return Ki.of(t,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Fn.none=Ki.empty;class AT extends Fn{constructor(t){let{start:n,end:i}=c3e(t);super(n?-1:5e8,i?1:-6e8,null,t),this.tagName=t.tagName||"span",this.attrs=t.class&&t.attributes?Uq(t.attributes,{class:t.class}):t.class?{class:t.class}:t.attributes||QI}eq(t){return this==t||t instanceof AT&&this.tagName==t.tagName&&Qq(this.attrs,t.attrs)}range(t,n=t){if(t>=n)throw new RangeError("Mark decorations may not be empty");return super.range(t,n)}}AT.prototype.point=!1;class TT extends Fn{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof TT&&this.spec.class==t.spec.class&&Qq(this.spec.attributes,t.spec.attributes)}range(t,n=t){if(n!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,n)}}TT.prototype.mapMode=il.TrackBefore;TT.prototype.point=!0;class x0 extends Fn{constructor(t,n,i,r,s,o){super(n,i,s,t),this.block=r,this.isReplace=o,this.mapMode=r?n<=0?il.TrackBefore:il.TrackAfter:il.TrackDel}get type(){return this.startSide!=this.endSide?ol.WidgetRange:this.startSide<=0?ol.WidgetBefore:ol.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof x0&&EIt(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(t,n=t){if(this.isReplace&&(t>n||t==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,n)}}x0.prototype.point=!0;function c3e(e,t=!1){let{inclusiveStart:n,inclusiveEnd:i}=e;return n==null&&(n=e.inclusive),i==null&&(i=e.inclusive),{start:n??t,end:i??t}}function EIt(e,t){return e==t||!!(e&&t&&e.compare(t))}function bw(e,t,n,i=0){let r=n.length-1;r>=0&&n[r]+i>=e?n[r]=Math.max(n[r],t):n.push(e,t)}class MC extends fb{constructor(t,n,i){super(),this.tagName=t,this.attributes=n,this.rank=i}eq(t){return t==this||t instanceof MC&&this.tagName==t.tagName&&Qq(this.attributes,t.attributes)}static create(t){return new MC(t.tagName,t.attributes||QI,t.rank==null?50:Math.max(0,Math.min(t.rank,100)))}static set(t,n=!1){return Ki.of(t,n)}}MC.prototype.startSide=MC.prototype.endSide=-1;function LC(e){let t;return e.nodeType==11?t=e.getSelection?e:e.ownerDocument:t=e,t.getSelection()}function $9(e,t){return t?e==t||e.contains(t.nodeType!=1?t.parentNode:t):!1}function xE(e,t){if(!t.anchorNode)return!1;try{return $9(e,t.anchorNode)}catch{return!1}}function wE(e){return e.nodeType==3?FC(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function OE(e,t,n,i){return n?jie(e,t,n,i,-1)||jie(e,t,n,i,1):!1}function mb(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function zI(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function jie(e,t,n,i,r){for(;;){if(e==n&&t==i)return!0;if(t==(r<0?0:nm(e))){if(e.nodeName=="DIV")return!1;let s=e.parentNode;if(!s||s.nodeType!=1)return!1;t=mb(e)+(r<0?0:1),e=s}else if(e.nodeType==1){if(e=e.childNodes[t+(r<0?-1:0)],e.nodeType==1&&e.contentEditable=="false")return!1;t=r<0?nm(e):0}else return!1}}function nm(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function $C(e,t){let{left:n,right:i}=e;if(n==i)return e;let r=t?n:i;return{left:r,right:r,top:e.top,bottom:e.bottom}}function CIt(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function u3e(e,t){let n=t.width/e.offsetWidth,i=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(t.height-e.offsetHeight)<1)&&(i=1),{scaleX:n,scaleY:i}}function AIt(e,t,n,i,r,s,o,l){let c=e.ownerDocument,u=c.defaultView||window;for(let d=e,f=!1;d&&!f;)if(d.nodeType==1){let h,m=d==c.body,g=1,b=1;if(m)h=CIt(u);else{if(/^(fixed|sticky)$/.test(getComputedStyle(d).position)&&(f=!0),d.scrollHeight<=d.clientHeight&&d.scrollWidth<=d.clientWidth){d=d.assignedSlot||d.parentNode;continue}let w=d.getBoundingClientRect();({scaleX:g,scaleY:b}=u3e(d,w)),h={left:w.left,right:w.left+d.clientWidth*g,top:w.top,bottom:w.top+d.clientHeight*b}}let v=0,y=0;if(r=="nearest")t.top0&&t.bottom>h.bottom+y&&(y=t.bottom-h.bottom+o)):t.bottom>h.bottom-o&&(y=t.bottom-h.bottom+o,n<0&&t.top-y0&&t.right>h.right+v&&(v=t.right-h.right+s)):t.right>h.right-s&&(v=t.right-h.right+s,n<0&&t.lefth.bottom||t.lefth.right)&&(t={left:Math.max(t.left,h.left),right:Math.min(t.right,h.right),top:Math.max(t.top,h.top),bottom:Math.min(t.bottom,h.bottom)}),d=d.assignedSlot||d.parentNode}else if(d.nodeType==11)d=d.host;else break}function d3e(e,t=!0){let n=e.ownerDocument,i=null,r=null;for(let s=e.parentNode;s&&!(s==n.body||(!t||i)&&r);)if(s.nodeType==1)!r&&s.scrollHeight>s.clientHeight&&(r=s),t&&!i&&s.scrollWidth>s.clientWidth&&(i=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:i,y:r}}class TIt{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:n,focusNode:i}=t;this.set(n,Math.min(t.anchorOffset,n?nm(n):0),i,Math.min(t.focusOffset,i?nm(i):0))}set(t,n,i,r){this.anchorNode=t,this.anchorOffset=n,this.focusNode=i,this.focusOffset=r}}let by=null;hn.safari&&hn.safari_version>=26&&(by=!1);function f3e(e){if(e.setActive)return e.setActive();if(by)return e.focus(by);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(by==null?{get preventScroll(){return by={preventScroll:!0},!0}}:void 0),!by){by=!1;for(let n=0;nMath.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function p3e(e,t){for(let n=e,i=t;;){if(n.nodeType==3&&i>0)return{node:n,offset:i};if(n.nodeType==1&&i>0){if(n.contentEditable=="false")return null;n=n.childNodes[i-1],i=nm(n)}else if(n.parentNode&&!zI(n))i=mb(n),n=n.parentNode;else return null}}function m3e(e,t){for(let n=e,i=t;;){if(n.nodeType==3&&i=n){if(l.level==i)return o;(s<0||(r!=0?r<0?l.fromn:t[s].level>l.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}}function y3e(e,t){if(e.length!=t.length)return!1;for(let n=0;n=0;b-=3)if(Qf[b+1]==-m){let v=Qf[b+2],y=v&2?r:v&4?v&1?s:r:0;y&&(as[f]=as[Qf[b]]=y),l=b;break}}else{if(Qf.length==189)break;Qf[l++]=f,Qf[l++]=h,Qf[l++]=c}else if((g=as[f])==2||g==1){let b=g==r;c=b?0:1;for(let v=l-3;v>=0;v-=3){let y=Qf[v+2];if(y&2)break;if(b)Qf[v+2]|=2;else{if(y&4)break;Qf[v+2]|=4}}}}}function MIt(e,t,n,i){for(let r=0,s=i;r<=n.length;r++){let o=r?n[r-1].to:e,l=rc;)g==v&&(g=n[--b].from,v=b?n[b-1].to:e),as[--g]=m;c=d}else s=u,c++}}}function B9(e,t,n,i,r,s,o){let l=i%2?2:1;if(i%2==r%2)for(let c=t,u=0;cc&&o.push(new lh(c,b.from,m));let v=b.direction==w0!=!(m%2);U9(e,v?i+1:i,r,b.inner,b.from,b.to,o),c=b.to}g=b.to}else{if(g==n||(d?as[g]!=l:as[g]==l))break;g++}h?B9(e,c,g,i+1,r,h,o):ct;){let d=!0,f=!1;if(!u||c>s[u-1].to){let b=as[c-1];b!=l&&(d=!1,f=b==16)}let h=!d&&l==1?[]:null,m=d?i:i+1,g=c;e:for(;;)if(u&&g==s[u-1].to){if(f)break e;let b=s[--u];if(!d)for(let v=b.from,y=u;;){if(v==t)break e;if(y&&s[y-1].to==v)v=s[--y].from;else{if(as[v-1]==l)break e;break}}if(h)h.push(b);else{b.toas.length;)as[as.length]=256;let i=[],r=t==w0?0:1;return U9(e,r,r,n,0,e.length,i),i}function v3e(e){return[new lh(0,e,0)]}let x3e="";function $It(e,t,n,i,r){var s;let o=i.head-e.from,l=lh.find(t,o,(s=i.bidiLevel)!==null&&s!==void 0?s:-1,i.assoc),c=t[l],u=c.side(r,n);if(o==u){let h=l+=r?1:-1;if(h<0||h>=t.length)return null;c=t[l=h],o=c.side(!r,n),u=c.side(r,n)}let d=Ro(e.text,o,c.forward(r,n));(dc.to)&&(d=u),x3e=e.text.slice(Math.min(o,d),Math.max(o,d));let f=l==(r?t.length-1:0)?null:t[l+(r?1:-1)];return f&&d==u&&f.level+(r?0:1)e.some(t=>t)}),T3e=mn.define({combine:e=>e.some(t=>t)}),_3e=mn.define();class vw{constructor(t,n,i,r,s,o=!1){this.range=t,this.y=n,this.x=i,this.yMargin=r,this.xMargin=s,this.isSnapshot=o}map(t){return t.empty?this:new vw(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new vw(ht.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const z_=pi.define({map:(e,t)=>e.map(t)}),j3e=pi.define();function Dc(e,t,n){let i=e.facet(S3e);i.length?i[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+":",t):console.error(t))}const xp=mn.define({combine:e=>e.length?e[0]:!0});let BIt=0;const Fx=mn.define({combine(e){return e.filter((t,n)=>{for(let i=0;i{let c=[];return o&&c.push(XM.of(u=>{let d=u.plugin(l);return d?o(d):Fn.none})),s&&c.push(s(l)),c})}static fromClass(t,n){return ma.define((i,r)=>new t(i,r),n)}}class Y4{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(t){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(i){if(Dc(n.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(t,this.spec.arg)}catch(n){Dc(t.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(i){Dc(t.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const N3e=mn.define(),qq=mn.define(),XM=mn.define(),R3e=mn.define(),Wq=mn.define(),_T=mn.define(),I3e=mn.define();function Rie(e,t){let n=e.state.facet(I3e);if(!n.length)return n;let i=n.map(s=>s instanceof Function?s(e):s),r=[];return Ki.spans(i,t.from,t.to,{point(){},span(s,o,l,c){let u=s-t.from,d=o-t.from,f=r;for(let h=l.length-1;h>=0;h--,c--){let m=l[h].spec.bidiIsolate,g;if(m==null&&(m=FIt(t.text,u,d)),c>0&&f.length&&(g=f[f.length-1]).to==u&&g.direction==m)g.to=d,f=g.inner;else{let b={from:u,to:d,direction:m,inner:[]};f.push(b),f=b.inner}}}}),r}const P3e=mn.define();function Kq(e){let t=0,n=0,i=0,r=0;for(let s of e.state.facet(P3e)){let o=s(e);o&&(o.left!=null&&(t=Math.max(t,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(r=Math.max(r,o.bottom)))}return{left:t,right:n,top:i,bottom:r}}const bS=mn.define();class pd{constructor(t,n,i,r){this.fromA=t,this.toA=n,this.fromB=i,this.toB=r}join(t){return new pd(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let n=t.length,i=this;for(;n>0;n--){let r=t[n-1];if(!(r.fromA>i.toA)){if(r.toAr.push(new pd(s,o,l,c))),this.changedRanges=r}static create(t,n,i){return new VI(t,n,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(t=>t.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const UIt=[];class pa{constructor(t,n,i=0){this.dom=t,this.length=n,this.flags=i,this.parent=null,t.cmTile=this}get breakAfter(){return this.flags&1}get children(){return UIt}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(t){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&kIt(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(t){this.dom=t,t.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(t,n=this.posAtStart){let i=n;for(let r of this.children){if(r==t)return i;i+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(t){return this.posBefore(t)+t.length}covers(t){return!0}coordsIn(t,n,i){return null}domPosFor(t,n){let i=mb(this.dom),r=this.length?t>0:n>0;return new cf(this.parent.dom,i+(r?1:0),t==0||t==this.length)}markDirty(t){this.flags&=-3,t&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let t=this;t;t=t.parent)if(t instanceof ZM)return t;return null}static get(t){return t.cmTile}}class YM extends pa{constructor(t){super(t,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(t){this.children.push(t),t.parent=this}sync(t){if(this.flags&2)return;super.sync(t);let n=this.dom,i=null,r,s=(t==null?void 0:t.node)==n?t:null,o=0;for(let l of this.children){if(l.sync(t),o+=l.length+l.breakAfter,r=i?i.nextSibling:n.firstChild,s&&r!=l.dom&&(s.written=!0),l.dom.parentNode==n)for(;r&&r!=l.dom;)r=Iie(r);else n.insertBefore(l.dom,r);i=l.dom}for(r=i?i.nextSibling:n.firstChild,s&&r&&(s.written=!0);r;)r=Iie(r);this.length=o}}function Iie(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class ZM extends YM{constructor(t,n){super(n),this.view=t}owns(t){for(;t;t=t.parent)if(t==this)return!0;return!1}isBlock(){return!0}nearest(t){for(;;){if(!t)return null;let n=pa.get(t);if(n&&this.owns(n))return n;t=t.parentNode}}blockTiles(t){for(let n=[],i=this,r=0,s=0;;)if(r==i.children.length){if(!n.length)return;i=i.parent,i.breakAfter&&s++,r=n.pop()}else{let o=i.children[r++];if(o instanceof Up)n.push(r),i=o,r=0;else{let l=s+o.length,c=t(o,s);if(c!==void 0)return c;s=l+o.breakAfter}}}resolveBlock(t,n){let i,r=-1,s,o=-1;if(this.blockTiles((l,c)=>{let u=c+l.length;if(t>=c&&t<=u){if(l.isWidget()&&n>=-1&&n<=1){if(l.flags&32)return!0;l.flags&16&&(i=void 0)}(ct||t==c&&(n>1?l.length:l.covers(-1)))&&(!s||!l.isWidget()&&s.isWidget())&&(s=l,o=t-c)}}),!i&&!s)throw new Error("No tile at position "+t);return i&&n<0||!s?{tile:i,offset:r}:{tile:s,offset:o}}}class Up extends YM{constructor(t,n){super(t),this.wrapper=n}isBlock(){return!0}covers(t){return this.children.length?t<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(t,n){let i=new Up(n||document.createElement(t.tagName),t);return n||(i.flags|=4),i}}class u1 extends YM{constructor(t,n){super(t),this.attrs=n}isLine(){return!0}static start(t,n,i){let r=new u1(n||document.createElement("div"),t);return(!n||!i)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(t,n,i){let r=null,s=-1,o=null,l=-1;function c(d,f){for(let h=0,m=0;h=f&&(g.isComposite()?c(g,f-m):(!o||o.isHidden&&(n>0&&!(o.flags&32)||i&&zIt(o,g)))&&(b>f||g.flags&32)?(o=g,l=f-m):(mr&&(t=r);let s=t,o=t,l=0;t==0&&n<0||t==r&&n>=0?hn.chrome||hn.gecko||(t?(s--,l=1):o=0)?0:c.length-1];return hn.safari&&!l&&u.width==0&&(u=Array.prototype.find.call(c,d=>d.width)||u),i==null?u:$C(u,(l?l>0:n<0)==i)}static of(t,n){let i=new Py(n||document.createTextNode(t),t);return n||(i.flags|=2),i}}class O0 extends pa{constructor(t,n,i,r){super(t,n,r),this.widget=i}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(t){return this.flags&48?!1:(this.flags&(t<0?64:128))>0}coordsIn(t,n){return this.coordsInWidget(t,n,!1)}coordsInWidget(t,n,i){let r=this.widget.coordsAt(this.dom,t,n);if(r)return r;if(i)return $C(this.dom.getBoundingClientRect(),this.length?t==0:n<=0);{let s=this.dom.getClientRects(),o=null;if(!s.length)return null;let l=this.flags&16?!0:this.flags&32?!1:t>0;for(let c=l?s.length-1:0;o=s[c],!(t>0?c==0:c==s.length-1||o.top0==i)}}class VIt{constructor(t){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=t}advance(t,n,i){let{tile:r,index:s,beforeBreak:o,parents:l}=this;for(;t||n>0;)if(r.isComposite())if(o){if(!t)break;i&&i.break(),t--,o=!1}else if(s==r.children.length){if(!t&&!l.length)break;i&&i.leave(r),o=!!r.breakAfter,{tile:r,index:s}=l.pop(),s++}else{let c=r.children[s],u=c.breakAfter;(n>0?c.length<=t:c.length=0;l--){let c=n.marks[l],u=r.lastChild;if(u instanceof Ic&&u.mark.eq(c.mark))u.dom!=c.dom&&u.setDOM(Z4(c.dom)),r=u;else{if(this.cache.reused.get(c)){let f=pa.get(c.dom);f&&f.setDOM(Z4(c.dom))}let d=Ic.of(c.mark,c.dom);r.append(d),r=d}this.cache.reused.set(c,2)}let s=pa.get(t.text);s&&this.cache.reused.set(s,2);let o=new Py(t.text,t.text.nodeValue);o.flags|=8,this.pos=t.range.toB,r.append(o)}addInlineWidget(t,n,i){let r=this.afterWidget&&t.flags&48&&(this.afterWidget.flags&48)==(t.flags&48);r||this.flushBuffer();let s=this.ensureMarks(n,i);!r&&!(t.flags&16)&&s.append(this.getBuffer(1)),s.append(t),this.pos+=t.length,this.afterWidget=t}addMark(t,n,i){this.flushBuffer(),this.ensureMarks(n,i).append(t),this.pos+=t.length,this.afterWidget=null}addBlockWidget(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}continueWidget(t){let n=this.afterWidget||this.lastBlock;n.length+=t,this.pos+=t}addLineStart(t,n){var i;t||(t=D3e);let r=u1.start(t,n||((i=this.cache.find(u1))===null||i===void 0?void 0:i.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(t){this.blockPosCovered()||this.addLineStart(t)}ensureLine(t){this.curLine||this.addLineStart(t)}ensureMarks(t,n){var i;let r=this.curLine;for(let s=t.length-1;s>=0;s--){let o=t[s],l;if(n>0&&(l=r.lastChild)&&l instanceof Ic&&l.mark.eq(o))r=l,n--;else{let c=Ic.of(o,(i=this.cache.find(Ic,u=>u.mark.eq(o)))===null||i===void 0?void 0:i.dom);r.append(c),r=c,n=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let t=this.curLine.lastChild;(!t||!Pie(this.curLine,!1)||t.dom.nodeName!="BR"&&t.isWidget()&&!(hn.ios&&Pie(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(J4,0,32)||new O0(J4.toDOM(),0,J4,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let t=this.wrappers.length-1;t>=0;t--)this.wrappers[t].to=this.pos){let n=t.rank*102+t.value.rank,i=new HIt(t.from,t.to,t.value,n),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-i.rank||this.wrappers[r-1].to-i.to)<0;)r--;this.wrappers.splice(r,0,i)}this.wrapperPos=this.pos}getBlockPos(){var t;this.updateBlockWrappers();let n=this.root;for(let i of this.wrappers){let r=n.lastChild;if(i.fromo.wrapper.eq(i.wrapper)))===null||t===void 0?void 0:t.dom);n.append(s),n=s}}return n}blockPosCovered(){let t=this.lastBlock;return t!=null&&!t.breakAfter&&(!t.isWidget()||(t.flags&160)>0)}getBuffer(t){let n=2|(t<0?16:32),i=this.cache.find(HI,void 0,1);return i&&(i.flags=n),i||new HI(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class WIt{constructor(t){this.skipCount=0,this.text="",this.textOff=0,this.cursor=t.iter()}skip(t){this.textOff+t<=this.text.length?this.textOff+=t:(this.skipCount+=t-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(t){if(this.textOff==this.text.length){let{value:r,lineBreak:s,done:o}=this.cursor.next(this.skipCount);if(this.skipCount=0,o)throw new Error("Ran out of text content when drawing inline views");this.text=r;let l=this.textOff=Math.min(t,r.length);return s?null:r.slice(0,l)}let n=Math.min(this.text.length,this.textOff+t),i=this.text.slice(this.textOff,n);return this.textOff=n,i}}const qI=[O0,u1,Py,Ic,HI,Up,ZM];for(let e=0;e[]),this.index=qI.map(()=>0),this.reused=new Map}add(t){let n=t.constructor.bucket,i=this.buckets[n];i.length<6?i.push(t):i[this.index[n]=(this.index[n]+1)%6]=t}find(t,n,i=2){let r=t.bucket,s=this.buckets[r],o=this.index[r];for(let l=0;l{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(t,n){let i=n&&this.getCompositionContext(n.text);for(let r=0,s=0,o=0;;){let l=or){let u=c-r;this.preserve(u,!o,!l),r=c,s+=u}if(!l)break;n&&l.fromA<=n.range.fromA&&l.toA>=n.range.toA?(this.forward(l.fromA,n.range.fromA,n.range.fromA{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(c-l);else{let u=c>0||l{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof Ic&&r.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?r.length&&(r.length=s=0):o instanceof Ic&&(r.shift(),s=Math.min(s,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(t)}emit(t,n){let i=null,r=this.builder,s=-1,o=Ki.spans(this.decorations,t,n,{point:(l,c,u,d,f,h)=>{if(u instanceof x0){if(this.disallowBlockEffectsFor[h]){if(u.block)throw new RangeError("Block decorations may not be specified via plugins");if(c>this.view.state.doc.lineAt(l).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=d.length,f>d.length)r.continueWidget(c-l);else{let m=u.widget||(u.block?d1.block:d1.inline),g=XIt(u),b=this.cache.findWidget(m,c-l,g)||O0.of(m,this.view,c-l,g);u.block?(u.startSide>0&&r.addLineStartIfNotCovered(i),r.addBlockWidget(b)):(r.ensureLine(i),r.addInlineWidget(b,d,f))}i=null}else i=YIt(i,u);c>l&&this.text.skip(c-l)},span:(l,c,u,d)=>{for(let f=l;f-1&&(this.openWidget=o>s),this.openWidget||r.addLineStartIfNotCovered(i),this.openMarks=o}forward(t,n,i=1){n-t<=10?this.old.advance(n-t,i,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-t-10,-1),this.old.advance(5,i,this.reuseWalker))}getCompositionContext(t){let n=[],i=null;for(let r=t.parentNode;;r=r.parentNode){let s=pa.get(r);if(r==this.view.contentDOM)break;s instanceof Ic?n.push(s):s!=null&&s.isLine()?i=s:s instanceof Up||(r.nodeName=="DIV"&&!i&&r!=this.view.contentDOM?i=new u1(r,D3e):i||n.push(Ic.of(new AT({tagName:r.nodeName.toLowerCase(),attributes:SIt(r)}),r)))}return{line:i,marks:n}}}function Pie(e,t){let n=i=>{for(let r of i.children)if((t?r.isText():r.length)||n(r))return!0;return!1};return n(e)}function XIt(e){let t=e.isReplace?(e.startSide<0?64:0)|(e.endSide>0?128:0):e.startSide>0?32:16;return e.block&&(t|=256),t}const D3e={class:"cm-line"};function YIt(e,t){let n=t.spec.attributes,i=t.spec.class;return!n&&!i||(e||(e={class:"cm-line"}),n&&Uq(n,e),i&&(e.class+=" "+i)),e}function ZIt(e){let t=[];for(let n=e.parents.length;n>1;n--){let i=n==e.parents.length?e.tile:e.parents[n].tile;i instanceof Ic&&t.push(i.mark)}return t}function Z4(e){let t=pa.get(e);return t&&t.setDOM(e.cloneNode()),e}class d1 extends jf{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}d1.inline=new d1("span");d1.block=new d1("div");const J4=new class extends jf{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class Die{constructor(t){this.view=t,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=Fn.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new ZM(t,t.contentDOM),this.updateInner([new pd(0,0,0,t.state.doc.length)],null)}update(t){var n;let i=t.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:d,toA:f})=>fthis.minWidthTo)?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(t);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?r=this.domChanged.newSel.head:!oPt(t.changes,this.hasComposition)&&!t.selectionSet&&(r=t.state.selection.main.head));let s=r>-1?ePt(this.view,t.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:d,to:f}=this.hasComposition;i=new pd(d,f,t.changes.mapPos(d,-1),t.changes.mapPos(f,1)).addToSet(i.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(hn.ie||hn.chrome)&&!s&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.blockWrappers;this.updateDeco();let c=iPt(o,this.decorations,t.changes);c.length&&(i=pd.extendWithRanges(i,c));let u=sPt(l,this.blockWrappers,t.changes);return u.length&&(i=pd.extendWithRanges(i,u)),s&&!i.some(d=>d.fromA<=s.range.fromA&&d.toA>=s.range.toA)&&(i=s.range.addToSet(i.slice())),this.tile.flags&2&&i.length==0?!1:(this.updateInner(i,s),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,n){this.view.viewState.mustMeasureContent=!0;let{observer:i}=this.view;i.ignore(()=>{if(n||t.length){let o=this.tile,l=new GIt(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&pa.get(n.text)&&l.cache.reused.set(pa.get(n.text),2),this.tile=l.run(t,n),z9(o,l.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=hn.chrome||hn.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||i.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to-1)&&xE(i,this.view.observer.selectionRange)&&!(r&&i.contains(r));if(!(s||n||o))return;let l=this.forceSelection;this.forceSelection=!1;let c=this.view.state.selection.main,u,d;if(c.empty?d=u=this.inlineDOMNearPos(c.anchor,c.assoc||1):(d=this.inlineDOMNearPos(c.head,c.head==c.from?1:-1),u=this.inlineDOMNearPos(c.anchor,c.anchor==c.from?1:-1)),hn.gecko&&c.empty&&!this.hasComposition&&JIt(u)){let h=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(h,u.node.childNodes[u.offset]||null)),u=d=new cf(h,0),l=!0}let f=this.view.observer.selectionRange;(l||!f.focusNode||(!OE(u.node,u.offset,f.anchorNode,f.anchorOffset)||!OE(d.node,d.offset,f.focusNode,f.focusOffset))&&!this.suppressWidgetCursorChange(f,c))&&(this.view.observer.ignore(()=>{hn.android&&hn.chrome&&i.contains(f.focusNode)&&aPt(f.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let h=LC(this.view.root);if(h)if(c.empty){if(hn.gecko){let m=tPt(u.node,u.offset);if(m&&m!=3){let g=(m==1?p3e:m3e)(u.node,u.offset);g&&(u=new cf(g.node,g.offset))}}h.collapse(u.node,u.offset),c.bidiLevel!=null&&h.caretBidiLevel!==void 0&&(h.caretBidiLevel=c.bidiLevel)}else if(h.extend){h.collapse(u.node,u.offset);try{h.extend(d.node,d.offset)}catch{}}else{let m=document.createRange();c.anchor>c.head&&([u,d]=[d,u]),m.setEnd(d.node,d.offset),m.setStart(u.node,u.offset),h.removeAllRanges(),h.addRange(m)}o&&this.view.root.activeElement==i&&(i.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(u,d)),this.impreciseAnchor=u.precise?null:new cf(f.anchorNode,f.anchorOffset),this.impreciseHead=d.precise?null:new cf(f.focusNode,f.focusOffset)}suppressWidgetCursorChange(t,n){return this.hasComposition&&n.empty&&OE(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,n=t.state.selection.main,i=LC(t.root),{anchorNode:r,anchorOffset:s}=t.observer.selectionRange;if(!i||!n.empty||!n.assoc||!i.modify)return;let o=this.lineAt(n.head,n.assoc);if(!o)return;let l=o.posAtStart;if(n.head==l||n.head==l+o.length)return;let c=this.coordsAt(n.head,-1),u=this.coordsAt(n.head,1);if(!c||!u||c.bottom>u.top)return;let d=this.domAtPos(n.head+n.assoc,n.assoc);i.collapse(d.node,d.offset),i.modify("move",n.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let f=t.observer.selectionRange;t.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=n.from&&i.collapse(r,s)}posFromDOM(t,n){let i=this.tile.nearest(t);if(!i)return this.tile.dom.compareDocumentPosition(t)&2?0:this.view.state.doc.length;let r=i.posAtStart;if(i.isComposite()){let s;if(t==i.dom)s=i.dom.childNodes[n];else{let o=nm(t)==0?0:n==0?-1:1;for(;;){let l=t.parentNode;if(l==i.dom)break;o==0&&l.firstChild!=l.lastChild&&(t==l.firstChild?o=-1:o=1),t=l}o<0?s=t:s=t.nextSibling}if(s==i.dom.firstChild)return r;for(;s&&!pa.get(s);)s=s.nextSibling;if(!s)return r+i.length;for(let o=0,l=r;;o++){let c=i.children[o];if(c.dom==s)return l;l+=c.length+c.breakAfter}}else return i.isText()?t==i.dom?r+n:r+(n?i.length:0):r}domAtPos(t,n){let{tile:i,offset:r}=this.tile.resolveBlock(t,n);return i.isWidget()?i.domPosFor(r,n):i.domIn(r,n)}inlineDOMNearPos(t,n){let i,r=-1,s=!1,o,l=-1,c=!1;return this.tile.blockTiles((u,d)=>{if(u.isWidget()){if(u.flags&32&&d>=t)return!0;u.flags&16&&(s=!0)}else{let f=d+u.length;if(d<=t&&(i=u,r=t-d,s=f=t&&!o&&(o=u,l=t-d,c=d>t),d>t&&o)return!0}}),!i&&!o?this.domAtPos(t,n):(s&&o?i=null:c&&i&&(o=null),i&&n<0||!o?i.domIn(r,n):o.domIn(l,n))}coordsAt(t,n,i){let{tile:r,offset:s}=this.tile.resolveBlock(t,n);return r.isWidget()?r.widget instanceof e$?null:r.coordsInWidget(s,n,!0):r.coordsIn(s,n,i)}lineAt(t,n){let{tile:i}=this.tile.resolveBlock(t,n);return i.isLine()?i:null}coordsForChar(t){let{tile:n,offset:i}=this.tile.resolveBlock(t,1);if(!n.isLine())return null;function r(s,o){if(s.isComposite())for(let l of s.children){if(l.length>=o){let c=r(l,o);if(c)return c}if(o-=l.length,o<0)break}else if(s.isText()&&oMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,c=this.view.textDirection==os.LTR,u=0,d=(f,h,m)=>{for(let g=0;gr);g++){let b=f.children[g],v=h+b.length,y=b.dom.getBoundingClientRect(),{height:w}=y;if(m&&!g&&(u+=y.top-m.top),b instanceof Up)v>i&&d(b,h,y);else if(h>=i&&(u>0&&n.push(-u),n.push(w+u),u=0,o)){let x=b.dom.lastChild,O=x?wE(x):[];if(O.length){let k=O[O.length-1],S=c?k.right-y.left:y.right-k.left;S>l&&(l=S,this.minWidth=s,this.minWidthFrom=h,this.minWidthTo=v)}}m&&g==f.children.length-1&&(u+=m.bottom-y.bottom),h=v+b.breakAfter}};return d(this.tile,0,null),n}textDirectionAt(t){let{tile:n}=this.tile.resolveBlock(t,1);return getComputedStyle(n.dom).direction=="rtl"?os.RTL:os.LTR}measureTextSize(){let t=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let l=0,c;for(let u of o.children){if(!u.isText()||/[^ -~]/.test(u.text))return;let d=wE(u.dom);if(d.length!=1)return;l+=d[0].width,c=d[0].height}if(l)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:l/o.length,textHeight:c}}});if(t)return t;let n=document.createElement("div"),i,r,s;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let o=wE(n.firstChild)[0];i=n.getBoundingClientRect().height,r=o&&o.width?o.width/27:7,s=o&&o.height?o.height:i,n.remove()}),{lineHeight:i,charWidth:r,textHeight:s}}computeBlockGapDeco(){let t=[],n=this.view.viewState;for(let i=0,r=0;;r++){let s=r==n.viewports.length?null:n.viewports[r],o=s?s.from-1:this.view.state.doc.length;if(o>i){let l=(n.lineBlockAt(o).bottom-n.lineBlockAt(i).top)/this.view.scaleY;t.push(Fn.replace({widget:new e$(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!s)break;i=s.to+1}return Fn.set(t)}updateDeco(){let t=1,n=this.view.state.facet(XM).map(s=>(this.dynamicDecorationMap[t++]=typeof s=="function")?s(this.view):s),i=!1,r=this.view.state.facet(Wq).map((s,o)=>{let l=typeof s=="function";return l&&(i=!0),l?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[t++]=i,n.push(Ki.join(r))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];ttypeof s=="function"?s(this.view):s)}scrollIntoView(t){if(t.isSnapshot){let u=this.view.viewState.lineBlockAt(t.range.head);this.view.scrollDOM.scrollTop=u.top-t.yMargin,this.view.scrollDOM.scrollLeft=t.xMargin;return}for(let u of this.view.state.facet(_3e))try{if(u(this.view,t.range,t))return!0}catch(d){Dc(this.view.state,d,"scroll handler")}let{range:n}=t,i=this.coordsAt(n.head,n.assoc||(n.head>n.anchor?-1:1)),r;if(!i)return;!n.empty&&(r=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(i={left:Math.min(i.left,r.left),top:Math.min(i.top,r.top),right:Math.max(i.right,r.right),bottom:Math.max(i.bottom,r.bottom)});let s=Kq(this.view),o={left:i.left-s.left,top:i.top-s.top,right:i.right+s.right,bottom:i.bottom+s.bottom},{offsetWidth:l,offsetHeight:c}=this.view.scrollDOM;if(AIt(this.view.scrollDOM,o,n.head1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottomi.isWidget()||i.children.some(n);return n(this.tile.resolveBlock(t,1).tile)}destroy(){z9(this.tile)}}function z9(e,t){let n=t==null?void 0:t.get(e);if(n!=1){n==null&&e.destroy();for(let i of e.children)z9(i,t)}}function JIt(e){return e.node.nodeType==1&&e.node.firstChild&&(e.offset==0||e.node.childNodes[e.offset-1].contentEditable=="false")&&(e.offset==e.node.childNodes.length||e.node.childNodes[e.offset].contentEditable=="false")}function M3e(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let i=p3e(n.focusNode,n.focusOffset),r=m3e(n.focusNode,n.focusOffset),s=i||r;if(r&&i&&r.node!=i.node){let l=pa.get(r.node);if(!l||l.isText()&&l.text!=r.node.nodeValue)s=r;else if(e.docView.lastCompositionAfterCursor){let c=pa.get(i.node);!c||c.isText()&&c.text!=i.node.nodeValue||(s=r)}}if(e.docView.lastCompositionAfterCursor=s!=i,!s)return null;let o=t-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function ePt(e,t,n){let i=M3e(e,n);if(!i)return null;let{node:r,from:s,to:o}=i,l=r.nodeValue;if(/[\n\r]/.test(l)||e.state.doc.sliceString(i.from,i.to)!=l)return null;let c=t.invertedDesc;return{range:new pd(c.mapPos(s),c.mapPos(o),s,o),text:r}}function tPt(e,t){return e.nodeType!=1?0:(t&&e.childNodes[t-1].contentEditable=="false"?1:0)|(t{it.from&&(n=!0)}),n}class e$ extends jf{constructor(t){super(),this.height=t}toDOM(){let t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function lPt(e,t,n=1){let i=e.charCategorizer(t),r=e.doc.lineAt(t),s=t-r.from;if(r.length==0)return ht.cursor(t);s==0?n=1:s==r.length&&(n=-1);let o=s,l=s;n<0?o=Ro(r.text,s,!1):l=Ro(r.text,s);let c=i(r.text.slice(o,l));for(;o>0;){let u=Ro(r.text,o,!1);if(i(r.text.slice(u,o))!=c)break;o=u}for(;le.defaultLineHeight*1.5){let l=e.viewState.heightOracle.textHeight,c=Math.floor((r-n.top-(e.defaultLineHeight-l)*.5)/l);s+=c*e.viewState.heightOracle.lineLength}let o=e.state.sliceDoc(n.from,n.to);return n.from+N9(o,s,e.state.tabSize)}function V9(e,t,n){let i=e.lineBlockAt(t);if(Array.isArray(i.type)){let r;for(let s of i.type){if(s.from>t)break;if(!(s.tot)return s;(!r||s.type==ol.Text&&(r.type!=s.type||(n<0?s.fromt)))&&(r=s)}}return r||i}return i}function uPt(e,t,n,i){let r=V9(e,t.head,t.assoc||-1),s=!i||r.type!=ol.Text||!(e.lineWrapping||r.widgetLineBreaks)?null:e.coordsAtPos(t.assoc<0&&t.head>r.from?t.head-1:t.head);if(s){let o=e.dom.getBoundingClientRect(),l=e.textDirectionAt(r.from),c=e.posAtCoords({x:n==(l==os.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(c!=null)return ht.cursor(c,n?-1:1)}return ht.cursor(n?r.to:r.from,n?-1:1)}function Mie(e,t,n,i){let r=e.state.doc.lineAt(t.head),s=e.bidiSpans(r),o=e.textDirectionAt(r.from);for(let l=t,c=null;;){let u=$It(r,s,o,l,n),d=x3e;if(!u){if(r.number==(n?e.state.doc.lines:1))return l;d=` +`,r=e.state.doc.line(r.number+(n?1:-1)),s=e.bidiSpans(r),u=e.visualLineSide(r,!n)}if(c){if(!c(d))return l}else{if(!i)return u;c=i(d)}l=u}}function dPt(e,t,n){let i=e.state.charCategorizer(t),r=i(n);return s=>{let o=i(s);return r==Qs.Space&&(r=o),r==o}}function fPt(e,t,n,i){let r=t.head,s=n?1:-1;if(r==(n?e.state.doc.length:0))return ht.cursor(r,t.assoc);let o=t.goalColumn,l,c=e.contentDOM.getBoundingClientRect(),u=e.coordsAtPos(r,t.assoc||((t.empty?n:t.head==t.from)?1:-1)),d=e.documentTop;if(u)o==null&&(o=u.left-c.left),l=s<0?u.top:u.bottom;else{let g=e.viewState.lineBlockAt(r);o==null&&(o=Math.min(c.right-c.left,e.defaultCharacterWidth*(r-g.from))),l=(s<0?g.top:g.bottom)+d}let f=c.left+o,h=e.viewState.heightOracle.textHeight>>1,m=i??h;for(let g=0;;g+=h){let b=l+(m+g)*s,v=H9(e,{x:f,y:b},!1,s);if(n?b>c.bottom:bl:w{if(t>s&&tr(e)),n.from,t.head>n.from?-1:1);return i==n.from?n:ht.cursor(i,ie.viewState.docHeight)return new th(e.state.doc.length,-1);if(u=e.elementAtHeight(c),i==null)break;if(u.type==ol.Text){if(i<0?u.toe.viewport.to)break;let h=e.docView.coordsAt(i<0?u.from:u.to,i>0?-1:1);if(h&&(i<0?h.top<=c+s:h.bottom>=c+s))break}let f=e.viewState.heightOracle.textHeight/2;c=i>0?u.bottom+f:u.top-f}if(e.viewport.from>=u.to||e.viewport.to<=u.from){if(n)return null;if(u.type==ol.Text){let f=cPt(e,r,u,o,l);return new th(f,f==u.from?1:-1)}}if(u.type!=ol.Text)return c<(u.top+u.bottom)/2?new th(u.from,1):new th(u.to,-1);let d=e.docView.lineAt(u.from,2);return(!d||d.length!=u.length)&&(d=e.docView.lineAt(u.from,-2)),new hPt(e,o,l,e.textDirectionAt(u.from)).scanTile(d,u.from)}class hPt{constructor(t,n,i,r){this.view=t,this.x=n,this.y=i,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(t){return(!this.line||this.line.from>t||this.line.to1||i.length&&(i[0].level!=this.baseDir||i[0].to+r.from>1;t:if(o.has(b)){let y=r+Math.floor(Math.random()*g);for(let w=0;w1)){if(w.bottomthis.y)(!u||u.top>w.top)&&(u=w),x=-1;else{let O=w.left>this.x?this.x-w.left:w.right(g+g+b)/3)return this.y=c.bottom-1,this.scan(t,n,!0);if(u&&u.top<(g+b+b)/3)return this.y=u.top+1,this.scan(t,n,!0)}let m=(l?this.dirAt(t[d],1):this.baseDir)==os.LTR;return{i:d,after:this.x>(h.left+h.right)/2==m}}scanText(t,n){let i=[];for(let s=0;s{let o=i[s]-n,l=i[s+1]-n;return FC(t.dom,o,l).getClientRects()});return r.after?new th(i[r.i+1],-1):new th(i[r.i],1)}scanTile(t,n){if(!t.length)return new th(n,1);if(t.children.length==1){let l=t.children[0];if(l.isText())return this.scanText(l,n);if(l.isComposite())return this.scanTile(l,n)}let i=[n];for(let l=0,c=n;l{let c=t.children[l];return c.flags&48?null:(c.dom.nodeType==1?c.dom:FC(c.dom,0,c.length)).getClientRects()}),s=t.children[r.i],o=i[r.i];return s.isText()?this.scanText(s,o):s.isComposite()?this.scanTile(s,o):r.after?new th(i[r.i+1],-1):new th(o,1)}}const cx="￿";class pPt{constructor(t,n){this.points=t,this.view=n,this.text="",this.lineSeparator=n.state.facet(tr.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=cx}readRange(t,n){if(!t)return this;let i=t.parentNode;for(let r=t;;){this.findPointBefore(i,r);let s=this.text.length;this.readNode(r);let o=pa.get(r),l=r.nextSibling;if(l==n){o!=null&&o.breakAfter&&!l&&i!=this.view.contentDOM&&this.lineBreak();break}let c=pa.get(l);(o&&c?o.breakAfter:(o?o.breakAfter:zI(r))||zI(l)&&(r.nodeName!="BR"||o!=null&&o.isWidget())&&this.text.length>s)&&!gPt(l,n)&&this.lineBreak(),r=l}return this.findPointBefore(i,n),this}readTextNode(t){let n=t.nodeValue;for(let i of this.points)i.node==t&&(i.pos=this.text.length+Math.min(i.offset,n.length));for(let i=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,l;if(this.lineSeparator?(s=n.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=r.exec(n))&&(s=l.index,o=l[0].length),this.append(n.slice(i,s<0?n.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let c of this.points)c.node==t&&c.pos>this.text.length&&(c.pos-=o-1);i=s+o}}readNode(t){let n=pa.get(t),i=n&&n.overrideDOMText;if(i!=null){this.findPointInside(t,i.length);for(let r=i.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else t.nodeType==3?this.readTextNode(t):t.nodeName=="BR"?t.nextSibling&&this.lineBreak():t.nodeType==1&&this.readRange(t.firstChild,null)}findPointBefore(t,n){for(let i of this.points)i.node==t&&t.childNodes[i.offset]==n&&(i.pos=this.text.length)}findPointInside(t,n){for(let i of this.points)(t.nodeType==3?i.node==t:t.contains(i.node))&&(i.pos=this.text.length+(mPt(t,i.node,i.offset)?n:0))}}function mPt(e,t,n){for(;;){if(!t||n-1;let{impreciseHead:s,impreciseAnchor:o}=t.docView,l=t.state.selection;if(t.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=$3e(t.docView.tile,n,i,0))){let c=s||o?[]:vPt(t),u=new pPt(c,t);u.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=u.text,this.newSel=xPt(c,this.bounds.from)}else{let c=t.observer.selectionRange,u=s&&s.node==c.focusNode&&s.offset==c.focusOffset||!$9(t.contentDOM,c.focusNode)?l.main.head:t.docView.posFromDOM(c.focusNode,c.focusOffset),d=o&&o.node==c.anchorNode&&o.offset==c.anchorOffset||!$9(t.contentDOM,c.anchorNode)?l.main.anchor:t.docView.posFromDOM(c.anchorNode,c.anchorOffset),f=t.viewport;if((hn.ios||hn.chrome)&&u!=d&&Math.min(u,d)<=l.main.from&&Math.max(u,d)>=l.main.to&&(f.from>0||f.to-1&&l.ranges.length>1)this.newSel=l.replaceRange(ht.range(d,u));else if(t.lineWrapping&&d==u&&!(l.main.empty&&l.main.head==u)&&t.inputState.lastTouchTime>Date.now()-100){let h=t.coordsAtPos(u,-1),m=0;h&&(m=t.inputState.lastTouchY<=h.bottom?-1:1),this.newSel=ht.create([ht.cursor(u,m)])}else this.newSel=ht.single(d,u)}}}function $3e(e,t,n,i){if(e.isComposite()){let r=-1,s=-1,o=-1,l=-1;for(let c=0,u=i,d=i;cn)return $3e(f,t,n,u);if(h>=t&&r==-1&&(r=c,s=u),u>n&&f.dom.parentNode==e.dom){o=c,l=d;break}d=h,u=h+f.breakAfter}return{from:s,to:l<0?i+e.length:l,startDOM:(r?e.children[r-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:o=0?e.children[o].dom:null}}else return e.isText()?{from:i,to:i+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling}:null}function F3e(e,t){let n,{newSel:i}=t,{state:r}=e,s=r.selection.main,o=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:l,to:c}=t.bounds,u=s.from,d=null;(o===8||hn.android&&t.text.length=l&&s.to<=c&&(t.typeOver||f!=t.text)&&f.slice(0,s.from-l)==t.text.slice(0,s.from-l)&&f.slice(s.to-l)==t.text.slice(h=t.text.length-(f.length-(s.to-l)))?n={from:s.from,to:s.to,insert:xr.of(t.text.slice(s.from-l,h).split(cx))}:(m=B3e(f,t.text,u-l,d))&&(hn.chrome&&o==13&&m.toB==m.from+2&&t.text.slice(m.from,m.toB)==cx+cx&&m.toB--,n={from:l+m.from,to:l+m.toA,insert:xr.of(t.text.slice(m.from,m.toB).split(cx))})}else i&&(!e.hasFocus&&r.facet(xp)||WI(i,s))&&(i=null);if(!n&&!i)return!1;if((hn.mac||hn.android)&&n&&n.from==n.to&&n.from==s.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute("autocorrect")=="off"?(i&&n.insert.length==2&&(i=ht.single(i.main.anchor-1,i.main.head-1)),n={from:n.from,to:n.to,insert:xr.of([n.insert.toString().replace("."," ")])}):r.doc.lineAt(s.from).toDate.now()-50?n={from:s.from,to:s.to,insert:r.toText(e.inputState.insertingText)}:hn.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==` + `&&e.lineWrapping&&(i&&(i=ht.single(i.main.anchor-1,i.main.head-1)),n={from:s.from,to:s.to,insert:xr.of([" "])}),n)return Gq(e,n,i,o);if(i&&!WI(i,s)){let l=!1,c="select";return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin=="select"&&(l=!0),c=e.inputState.lastSelectionOrigin,c=="select.pointer"&&(i=L3e(r.facet(_T).map(u=>u(e)),i))),e.dispatch({selection:i,scrollIntoView:l,userEvent:c}),!0}else return!1}function Gq(e,t,n,i=-1){if(hn.ios&&e.inputState.flushIOSKey(t))return!0;let r=e.state.selection.main;if(hn.android&&(t.to==r.to&&(t.from==r.from||t.from==r.from-1&&e.state.sliceDoc(t.from,r.from)==" ")&&t.insert.length==1&&t.insert.lines==2&&yw(e.contentDOM,"Enter",13)||(t.from==r.from-1&&t.to==r.to&&t.insert.length==0||i==8&&t.insert.lengthr.head)&&yw(e.contentDOM,"Backspace",8)||t.from==r.from&&t.to==r.to+1&&t.insert.length==0&&yw(e.contentDOM,"Delete",46)))return!0;let s=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let o,l=()=>o||(o=yPt(e,t,n));return e.state.facet(E3e).some(c=>c(e,t.from,t.to,s,l))||e.dispatch(l()),!0}function yPt(e,t,n){let i,r=e.state,s=r.selection.main,o=-1;if(t.from==t.to&&t.froms.to){let c=t.fromf(e)),u,c);t.from==d&&(o=d)}if(o>-1)i={changes:t,selection:ht.cursor(t.from+t.insert.length,-1)};else if(t.from>=s.from&&t.to<=s.to&&t.to-t.from>=(s.to-s.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let c=s.fromt.to?r.sliceDoc(t.to,s.to):"";i=r.replaceSelection(e.state.toText(c+t.insert.sliceString(0,void 0,e.state.lineBreak)+u))}else{let c=r.changes(t),u=n&&n.main.to<=c.newLength?n.main:void 0;if(r.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=s.to+10&&t.to>=s.to-10){let d=e.state.sliceDoc(t.from,t.to),f,h=n&&M3e(e,n.main.head);if(h){let g=t.insert.length-(t.to-t.from);f={from:h.from,to:h.to-g}}else f=e.state.doc.lineAt(s.head);let m=s.to-t.to;i=r.changeByRange(g=>{if(g.from==s.from&&g.to==s.to)return{changes:c,range:u||g.map(c)};let b=g.to-m,v=b-d.length;if(e.state.sliceDoc(v,b)!=d||b>=f.from&&v<=f.to)return{range:g};let y=r.changes({from:v,to:b,insert:t.insert}),w=g.to-s.to;return{changes:y,range:u?ht.range(Math.max(0,u.anchor+w),Math.max(0,u.head+w)):g.map(y)}})}else i={changes:c,selection:u&&r.selection.replaceRange(u)}}let l="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,l+=".compose",e.inputState.compositionFirstChange&&(l+=".start",e.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:l,scrollIntoView:!0})}function B3e(e,t,n,i){let r=Math.min(e.length,t.length),s=0;for(;s0&&l>0&&e.charCodeAt(o-1)==t.charCodeAt(l-1);)o--,l--;if(i=="end"){let c=Math.max(0,s-Math.min(o,l));n-=o+c-s}if(o=o?s-n:0;s-=c,l=s+(l-o),o=s}else if(l=l?s-n:0;s-=c,o=s+(o-l),l=s}return{from:s,toA:o,toB:l}}function vPt(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}=e.observer.selectionRange;return n&&(t.push(new Lie(n,i)),(r!=n||s!=i)&&t.push(new Lie(r,s))),t}function xPt(e,t){if(e.length==0)return null;let n=e[0].pos,i=e.length==2?e[1].pos:n;return n>-1&&i>-1?ht.single(n+t,i+t):null}function WI(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}class wPt{setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}constructor(t){this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,hn.safari&&t.contentDOM.addEventListener("input",()=>null),hn.gecko&&LPt(t.contentDOM.ownerDocument)}handleEvent(t){!jPt(this.view,t)||this.ignoreDuringComposition(t)||t.type=="keydown"&&this.keydown(t)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(t.type,t)):this.runHandlers(t.type,t))}runHandlers(t,n){let i=this.handlers[t];if(i){for(let r of i.observers)r(this.view,n);for(let r of i.handlers){if(n.defaultPrevented)break;if(r(this.view,n)){n.preventDefault();break}}}}ensureHandlers(t){let n=kPt(t),i=this.handlers,r=this.view.contentDOM;for(let s in n)if(s!="scroll"){let o=!n[s].handlers.length,l=i[s];l&&o!=!l.handlers.length&&(r.removeEventListener(s,this.handleEvent),l=null),l||r.addEventListener(s,this.handleEvent,{passive:o})}for(let s in i)s!="scroll"&&!n[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=n}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&t.keyCode!=27&&Q3e.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),hn.android&&hn.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;if(hn.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&(U3e.some(n=>n.keyCode==t.keyCode)&&!t.ctrlKey||SPt.indexOf(t.key)>-1&&t.ctrlKey)){let n={ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey,shiftKey:t.shiftKey};return n.shiftKey&&hn.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&OPt(this.view.win)&&(n.shiftKey=!1),this.pendingIOSKey={key:t.key,keyCode:t.keyCode,mods:n},setTimeout(()=>this.flushIOSKey(),250),!0}return t.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(t){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&t&&t.from0?!0:hn.safari&&!hn.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.view.observer.update(t),this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function OPt(e){return e.visualViewport?e.visualViewport.height*e.visualViewport.scale/e.document.documentElement.clientHeight<.85:!1}function $ie(e,t){return(n,i)=>{try{return t.call(e,i,n)}catch(r){Dc(n.state,r)}}}function kPt(e){let t=Object.create(null);function n(i){return t[i]||(t[i]={observers:[],handlers:[]})}for(let i of e){let r=i.spec,s=r&&r.plugin.domEventHandlers,o=r&&r.plugin.domEventObservers;if(s)for(let l in s){let c=s[l];c&&n(l).handlers.push($ie(i.value,c))}if(o)for(let l in o){let c=o[l];c&&n(l).observers.push($ie(i.value,c))}}for(let i in Of)n(i).handlers.push(Of[i]);for(let i in oc)n(i).observers.push(oc[i]);return t}const U3e=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],SPt="dthko",Q3e=[16,17,18,20,91,92,224,225],V_=6;function H_(e){return Math.max(0,e)*.7+8}function EPt(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}class CPt{constructor(t,n,i,r){this.view=t,this.startEvent=n,this.style=i,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=d3e(t.contentDOM),this.atoms=t.state.facet(_T).map(o=>o(t));let s=t.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=t.state.facet(tr.allowMultipleSelections)&&APt(t,n),this.dragging=_Pt(t,n)&&H3e(n)==1?null:!1}start(t){this.dragging===!1&&this.select(t)}move(t){if(t.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&EPt(this.startEvent,t)<10)return;this.select(this.lastEvent=t);let n=0,i=0,r=0,s=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:l}=this.scrollParents.y.getBoundingClientRect());let c=Kq(this.view);t.clientX-c.left<=r+V_?n=-H_(r-t.clientX):t.clientX+c.right>=o-V_&&(n=H_(t.clientX-o)),t.clientY-c.top<=s+V_?i=-H_(s-t.clientY):t.clientY+c.bottom>=l-V_&&(i=H_(t.clientY-l)),this.setScrollSpeed(n,i)}up(t){this.dragging==null&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,n){this.scrollSpeed={x:t,y:n},t||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:t,y:n}=this.scrollSpeed;t&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=t,t=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(t||n)&&this.view.win.scrollBy(t,n),this.dragging===!1&&this.select(this.lastEvent)}select(t){let{view:n}=this,i=L3e(this.atoms,this.style.get(t,this.extend,this.multiple));(this.mustSelect||!i.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(t){t.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(t)&&setTimeout(()=>this.select(this.lastEvent),20)}}function APt(e,t){let n=e.state.facet(w3e);return n.length?n[0](t):hn.mac?t.metaKey:t.ctrlKey}function TPt(e,t){let n=e.state.facet(O3e);return n.length?n[0](t):hn.mac?!t.altKey:!t.ctrlKey}function _Pt(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let i=LC(e.root);if(!i||i.rangeCount==0)return!0;let r=i.getRangeAt(0).getClientRects();for(let s=0;s=t.clientX&&o.top<=t.clientY&&o.bottom>=t.clientY)return!0}return!1}function jPt(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,i;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(i=pa.get(n))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(t))return!1;return!0}const Of=Object.create(null),oc=Object.create(null),z3e=hn.ie&&hn.ie_version<15||hn.ios&&hn.webkit_version<604;function NPt(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{e.focus(),n.remove(),V3e(e,n.value)},50)}function JM(e,t,n){for(let i of e.facet(t))n=i(n,e);return n}function V3e(e,t){t=JM(e.state,Vq,t);let{state:n}=e,i,r=1,s=n.toText(t),o=s.lines==n.selection.ranges.length;if(q9!=null&&n.selection.ranges.every(c=>c.empty)&&q9==s.toString()){let c=-1;i=n.changeByRange(u=>{let d=n.doc.lineAt(u.from);if(d.from==c)return{range:u};c=d.from;let f=n.toText((o?s.line(r++).text:t)+n.lineBreak);return{changes:{from:d.from,insert:f},range:ht.cursor(u.from+f.length)}})}else o?i=n.changeByRange(c=>{let u=s.line(r++);return{changes:{from:c.from,to:c.to,insert:u.text},range:ht.cursor(c.from+u.length)}}):i=n.replaceSelection(s);e.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}oc.scroll=e=>{let t=e.inputState;t.lastScrollTop=e.scrollDOM.scrollTop,t.lastScrollLeft=e.scrollDOM.scrollLeft,hn.ios&&!t.touchActive&&(t.lastIOSMomentumScroll=Date.now())};oc.wheel=oc.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()};Of.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1);oc.touchstart=(e,t)=>{let n=e.inputState,i=t.targetTouches[0];n.touchActive=!0,n.lastTouchTime=Date.now(),i&&(n.lastTouchX=i.clientX,n.lastTouchY=i.clientY),n.setSelectionOrigin("select.pointer")};oc.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")};oc.touchend=(e,t)=>{e.inputState.touchActive=!1};Of.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let i of e.state.facet(k3e))if(n=i(e,t),n)break;if(!n&&t.button==0&&(n=IPt(e,t)),n){let i=!e.hasFocus;e.inputState.startMouseSelection(new CPt(e,t,n,i)),i&&e.observer.ignore(()=>{f3e(e.contentDOM);let s=e.root.activeElement;s&&!s.contains(e.contentDOM)&&s.blur()});let r=e.inputState.mouseSelection;if(r)return r.start(t),r.dragging===!1}else e.inputState.setSelectionOrigin("select.pointer");return!1};function Fie(e,t,n,i){if(i==1)return ht.cursor(t,n);if(i==2)return lPt(e.state,t,n);{let r=e.docView.lineAt(t,n),s=e.state.doc.lineAt(r?r.posAtEnd:t),o=r?r.posAtStart:s.from,l=r?r.posAtEnd:s.to;return lDate.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(Uie+1)%3:1}function IPt(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),i=H3e(t),r=e.state.selection;return{update(s){s.docChanged&&(n.pos=s.changes.mapPos(n.pos),r=r.map(s.changes))},get(s,o,l){let c=e.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),u,d=Fie(e,c.pos,c.assoc,i);if(n.pos!=c.pos&&!o){let f=Fie(e,n.pos,n.assoc,i),h=Math.min(f.from,d.from),m=Math.max(f.to,d.to);d=h1&&(u=PPt(r,c.pos))?u:l?r.addRange(d):ht.create([d])}}}function PPt(e,t){for(let n=0;n=t)return ht.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n?1:0))}return null}Of.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.tile.nearest(t.target);if(r&&r.isWidget()){let s=r.posAtStart,o=s+r.length;(s>=n.to||o<=n.from)&&(n=ht.undirectionalRange(s,o))}}let{inputState:i}=e;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",JM(e.state,Hq,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1};Of.dragend=e=>(e.inputState.draggedContent=null,!1);function zie(e,t,n,i){if(n=JM(e.state,Vq,n),!n)return;let r=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:s}=e.inputState,o=i&&s&&TPt(e,t)?{from:s.from,to:s.to}:null,l={from:r,insert:n},c=e.state.changes(o?[o,l]:l);e.focus(),e.dispatch({changes:c,selection:{anchor:c.mapPos(r,-1),head:c.mapPos(r,1)},userEvent:o?"move.drop":"input.drop"}),e.inputState.draggedContent=null}Of.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let i=Array(n.length),r=0,s=()=>{++r==n.length&&zie(e,t,i.filter(o=>o!=null).join(e.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),s()},l.readAsText(n[o])}return!0}else{let i=t.dataTransfer.getData("Text");if(i)return zie(e,t,i,!0),!0}return!1};Of.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=z3e?null:t.clipboardData;return n?(V3e(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(NPt(e),!1)};function DPt(e,t){let n=e.dom.parentNode;if(!n)return;let i=n.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=t,i.focus(),i.selectionEnd=t.length,i.selectionStart=0,setTimeout(()=>{i.remove(),e.focus()},50)}function MPt(e){let t=[],n=[],i=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let r=-1;for(let{from:s}of e.selection.ranges){let o=e.doc.lineAt(s);o.number>r&&(t.push(o.text),n.push({from:o.from,to:Math.min(e.doc.length,o.to+1)})),r=o.number}i=!0}return{text:JM(e,Hq,t.join(e.lineBreak)),ranges:n,linewise:i}}let q9=null;Of.copy=Of.cut=(e,t)=>{if(!xE(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:i,linewise:r}=MPt(e.state);if(!n&&!r)return!1;q9=r?n:null,t.type=="cut"&&!e.state.readOnly&&e.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let s=z3e?null:t.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):(DPt(e,n),!1)};const q3e=Rh.define();function W3e(e,t){let n=[];for(let i of e.facet(C3e)){let r=i(e,t);r&&n.push(r)}return n.length?e.update({effects:n,annotations:q3e.of(!0)}):null}function K3e(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=W3e(e.state,t);n?e.dispatch(n):e.update([])}},10)}oc.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),K3e(e)};oc.blur=e=>{e.observer.clearSelectionRange(),K3e(e)};oc.compositionstart=oc.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange==null&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))};oc.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,hn.chrome&&hn.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))};oc.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()};Of.beforeinput=(e,t)=>{var n,i;if((t.inputType=="insertText"||t.inputType=="insertCompositionText")&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),t.inputType=="insertReplacementText"&&e.observer.editContext){let s=(n=t.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),o=t.getTargetRanges();if(s&&o.length){let l=o[0],c=e.posAtDOM(l.startContainer,l.startOffset),u=e.posAtDOM(l.endContainer,l.endOffset);return Gq(e,{from:c,to:u,insert:e.state.toText(s)},null),!0}}let r;if(hn.chrome&&hn.android&&(r=U3e.find(s=>s.inputType==t.inputType))&&(e.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let s=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return hn.ios&&t.inputType=="deleteContentForward"&&e.observer.flushSoon(),hn.safari&&t.inputType=="insertText"&&e.inputState.composing>=0&&setTimeout(()=>oc.compositionend(e,t),20),!1};const Vie=new Set;function LPt(e){Vie.has(e)||(Vie.add(e),e.addEventListener("copy",()=>{}),e.addEventListener("cut",()=>{}))}const Hie=["pre-wrap","normal","pre-line","break-spaces"];let f1=!1;function qie(){f1=!1}class $Pt{constructor(t){this.lineWrapping=t,this.doc=xr.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(t,n){let i=this.doc.lineAt(n).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((n-t-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return Hie.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let n=!1;for(let i=0;i-1,c=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=n,this.charWidth=i,this.textHeight=r,this.lineLength=s,c){this.heightSamples={};for(let u=0;u0}set outdated(t){this.flags=(t?2:0)|this.flags&-3}setHeight(t){this.height!=t&&(Math.abs(this.height-t)>FN&&(f1=!0),this.height=t)}replace(t,n,i){return ac.of(i)}decomposeLeft(t,n){n.push(this)}decomposeRight(t,n){n.push(this)}applyChanges(t,n,i,r){let s=this,o=i.doc;for(let l=r.length-1;l>=0;l--){let{fromA:c,toA:u,fromB:d,toB:f}=r[l],h=s.lineAt(c,gs.ByPosNoHeight,i.setDoc(n),0,0),m=h.to>=u?h:s.lineAt(u,gs.ByPosNoHeight,i,0,0);for(f+=m.to-u,u=m.to;l>0&&h.from<=r[l-1].toA;)c=r[l-1].fromA,d=r[l-1].fromB,l--,cs*2){let l=t[n-1];l.break?t.splice(--n,1,l.left,null,l.right):t.splice(--n,1,l.left,l.right),i+=1+l.break,r-=l.size}else if(s>r*2){let l=t[i];l.break?t.splice(i,1,l.left,null,l.right):t.splice(i,1,l.left,l.right),i+=2+l.break,s-=l.size}else break;else if(r=s&&o(this.lineAt(0,gs.ByPos,i,r,s))}setMeasuredHeight(t){let n=t.heights[t.index++];n<0?(this.spaceAbove=-n,n=t.heights[t.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(t,n=0,i=!1,r){return r&&r.from<=n&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}}class du extends G3e{constructor(t,n,i){super(t,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=i}mainBlock(t,n){return new of(n,this.length,t+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(t,n,i){let r=i[0];return i.length==1&&(r instanceof du||r instanceof Zo&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof Zo?r=new du(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):ac.of(i)}updateHeight(t,n=0,i=!1,r){return r&&r.from<=n&&r.more?this.setMeasuredHeight(r):(i||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Zo extends ac{constructor(t){super(t,0)}heightMetrics(t,n){let i=t.doc.lineAt(n).number,r=t.doc.lineAt(n+this.length).number,s=r-i+1,o,l=0;if(t.lineWrapping){let c=Math.min(this.height,t.lineHeight*s);o=c/s,this.length>s+1&&(l=(this.height-c)/(this.length-s-1))}else o=this.height/s;return{firstLine:i,lastLine:r,perLine:o,perChar:l}}blockAt(t,n,i,r){let{firstLine:s,lastLine:o,perLine:l,perChar:c}=this.heightMetrics(n,r);if(n.lineWrapping){let u=r+(t0){let s=i[i.length-1];s instanceof Zo?i[i.length-1]=new Zo(s.length+r):i.push(null,new Zo(r-1))}if(t>0){let s=i[0];s instanceof Zo?i[0]=new Zo(t+s.length):i.unshift(new Zo(t-1),null)}return ac.of(i)}decomposeLeft(t,n){n.push(new Zo(t-1),null)}decomposeRight(t,n){n.push(null,new Zo(this.length-t-1))}updateHeight(t,n=0,i=!1,r){let s=n+this.length;if(r&&r.from<=n+this.length&&r.more){let o=[],l=Math.max(n,r.from),c=-1;for(r.from>n&&o.push(new Zo(r.from-n-1).updateHeight(t,n));l<=s&&r.more;){let d=t.doc.lineAt(l).length;o.length&&o.push(null);let f=r.heights[r.index++],h=0;f<0&&(h=-f,f=r.heights[r.index++]),c==-1?c=f:Math.abs(f-c)>=FN&&(c=-2);let m=new du(d,f,h);m.outdated=!1,o.push(m),l+=d+1}l<=s&&o.push(null,new Zo(s-l).updateHeight(t,l));let u=ac.of(o);return(c<0||Math.abs(u.height-this.height)>=FN||Math.abs(c-this.heightMetrics(t,n).perLine)>=FN)&&(f1=!0),KI(this,u)}else(i||this.outdated)&&(this.setHeight(t.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class UPt extends ac{constructor(t,n,i){super(t.length+n+i.length,t.height+i.height,n|(t.outdated||i.outdated?2:0)),this.left=t,this.right=i,this.size=t.size+i.size}get break(){return this.flags&1}blockAt(t,n,i,r){let s=i+this.left.height;return tl))return u;let d=n==gs.ByPosNoHeight?gs.ByPosNoHeight:gs.ByPos;return c?u.join(this.right.lineAt(l,d,i,o,l)):this.left.lineAt(l,d,i,r,s).join(u)}forEachLine(t,n,i,r,s,o){let l=r+this.left.height,c=s+this.left.length+this.break;if(this.break)t=c&&this.right.forEachLine(t,n,i,l,c,o);else{let u=this.lineAt(c,gs.ByPos,i,r,s);t=t&&u.from<=n&&o(u),n>u.to&&this.right.forEachLine(u.to+1,n,i,l,c,o)}}replace(t,n,i){let r=this.left.length+this.break;if(nthis.left.length)return this.balanced(this.left,this.right.replace(t-r,n-r,i));let s=[];t>0&&this.decomposeLeft(t,s);let o=s.length;for(let l of i)s.push(l);if(t>0&&Wie(s,o-1),n=i&&n.push(null)),t>i&&this.right.decomposeLeft(t-i,n)}decomposeRight(t,n){let i=this.left.length,r=i+this.break;if(t>=r)return this.right.decomposeRight(t-r,n);t2*n.size||n.size>2*t.size?ac.of(this.break?[t,null,n]:[t,n]):(this.left=KI(this.left,t),this.right=KI(this.right,n),this.setHeight(t.height+n.height),this.outdated=t.outdated||n.outdated,this.size=t.size+n.size,this.length=t.length+this.break+n.length,this)}updateHeight(t,n=0,i=!1,r){let{left:s,right:o}=this,l=n+s.length+this.break,c=null;return r&&r.from<=n+s.length&&r.more?c=s=s.updateHeight(t,n,i,r):s.updateHeight(t,n,i),r&&r.from<=l+o.length&&r.more?c=o=o.updateHeight(t,l,i,r):o.updateHeight(t,l,i),c?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Wie(e,t){let n,i;e[t]==null&&(n=e[t-1])instanceof Zo&&(i=e[t+1])instanceof Zo&&e.splice(t-1,3,new Zo(n.length+1+i.length))}const QPt=5;class Xq{constructor(t,n){this.pos=t,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,n){if(this.lineStart>-1){let i=Math.min(n,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof du?r.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new du(i-this.pos,-1,0)),this.writtenTo=i,n>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(t,n,i){if(t=QPt)&&this.addLineDeco(r,s,o)}else n>t&&this.span(t,n);this.lineEnd>-1&&this.lineEnd-1)return;let{from:t,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=n,this.writtenTot&&this.nodes.push(new du(this.pos-t,-1,0)),this.writtenTo=this.pos}blankContent(t,n){let i=new Zo(n-t);return this.oracle.doc.lineAt(t).to==n&&(i.flags|=4),i}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof du)return t;let n=new du(0,-1,0);return this.nodes.push(n),n}addBlock(t){this.enterLine();let n=t.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,n&&n.endSide>0&&(this.covering=t)}addLineDeco(t,n,i){let r=this.ensureLine();r.length+=i,r.collapsed+=i,r.widgetHeight=Math.max(r.widgetHeight,t),r.breaks+=n,this.writtenTo=this.pos=this.pos+i}finish(t){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof du)&&!this.isCovered?this.nodes.push(new du(0,-1,0)):(this.writtenTod.clientHeight||d.scrollWidth>d.clientWidth)&&f.overflow!="visible"){let h=d.getBoundingClientRect();s=Math.max(s,h.left),o=Math.min(o,h.right),l=Math.max(l,h.top),c=Math.min(u==e.parentNode?r.innerHeight:c,h.bottom)}u=f.position=="absolute"||f.position=="fixed"?d.offsetParent:d.parentNode}else if(u.nodeType==11)u=u.host;else break;return{left:s-n.left,right:Math.max(s,o)-n.left,top:l-(n.top+t),bottom:Math.max(l,c)-(n.top+t)}}function qPt(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left0&&t.top0}function WPt(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class n${constructor(t,n,i,r){this.from=t,this.to=n,this.size=i,this.displaySize=r}static same(t,n){if(t.length!=n.length)return!1;for(let i=0;itypeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new $Pt(i),this.stateDeco=Xie(n),this.heightMap=ac.empty().applyChanges(this.stateDeco,xr.empty,this.heightOracle.setDoc(n.doc),[new pd(0,0,0,n.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Fn.set(this.lineGaps.map(r=>r.draw(this,!1))),this.scrollParent=t.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:n}=this.state.selection;for(let i=0;i<=1;i++){let r=i?n.head:n.anchor;if(!t.some(({from:s,to:o})=>r>=s&&r<=o)){let{from:s,to:o}=this.lineBlockAt(r);t.push(new q_(s,o))}}return this.viewports=t.sort((i,r)=>i.from-r.from),this.updateScaler()}updateScaler(){let t=this.scaler;return this.scaler=this.heightMap.height<=7e6?Gie:new Yq(this.heightOracle,this.heightMap,this.viewports),t.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,t=>{this.viewportLines.push(yS(t,this.scaler))})}update(t,n=null){this.state=t.state;let i=this.stateDeco;this.stateDeco=Xie(this.state);let r=t.changedRanges,s=pd.extendWithRanges(r,zPt(i,this.stateDeco,t?t.changes:lo.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);qie(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||f1)&&(t.flags|=2),l?(this.scrollAnchorPos=t.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let c=s.length?this.mapViewport(this.viewport,t.changes):this.viewport;(n&&(n.range.headc.to)||!this.viewportIsAppropriate(c))&&(c=this.getViewport(0,n));let u=c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,t.flags|=this.updateForViewport(),(u||!t.changes.empty||t.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(t.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(t.selectionSet||t.focusChanged)&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(T3e)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:t}=this,n=t.contentDOM,i=window.getComputedStyle(n),r=this.heightOracle,s=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?os.RTL:os.LTR;let o=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",l=n.getBoundingClientRect(),c=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let u=0,d=0;if(l.width&&l.height){let{scaleX:k,scaleY:S}=u3e(n,l);(k>.005&&Math.abs(this.scaleX-k)>.005||S>.005&&Math.abs(this.scaleY-S)>.005)&&(this.scaleX=k,this.scaleY=S,u|=16,o=c=!0)}let f=(parseInt(i.paddingTop)||0)*this.scaleY,h=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=h)&&(this.paddingTop=f,this.paddingBottom=h,u|=18),this.editorWidth!=t.scrollDOM.clientWidth&&(r.lineWrapping&&(c=!0),this.editorWidth=t.scrollDOM.clientWidth,u|=16);let m=d3e(this.view.contentDOM,!1).y;m!=this.scrollParent&&(this.scrollParent=m,this.scrollAnchorHeight=-1,this.scrollOffset=0);let g=this.getScrollOffset();this.scrollOffset!=g&&(this.scrollAnchorHeight=-1,this.scrollOffset=g),this.scrolledToBottom=h3e(this.scrollParent||t.win);let b=(this.printing?WPt:HPt)(n,this.paddingTop),v=b.top-this.pixelViewport.top,y=b.bottom-this.pixelViewport.bottom;this.pixelViewport=b;let w=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(w!=this.inView&&(this.inView=w,w&&(c=!0)),!this.inView&&!this.scrollTarget&&!qPt(t.dom))return 0;let x=l.width;if((this.contentDOMWidth!=x||this.editorHeight!=t.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=t.scrollDOM.clientHeight,u|=16),c){let k=t.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(k)&&(o=!0),o||r.lineWrapping&&Math.abs(x-this.contentDOMWidth)>r.charWidth){let{lineHeight:S,charWidth:C,textHeight:E}=t.docView.measureTextSize();o=S>0&&r.refresh(s,S,C,E,Math.max(5,x/C),k),o&&(t.docView.minWidth=0,u|=16)}v>0&&y>0?d=Math.max(v,y):v<0&&y<0&&(d=Math.min(v,y)),qie();for(let S of this.viewports){let C=S.from==this.viewport.from?k:t.docView.measureVisibleLineHeights(S);this.heightMap=(o?ac.empty().applyChanges(this.stateDeco,xr.empty,this.heightOracle,[new pd(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(r,0,o,new FPt(S.from,C))}f1&&(u|=2)}let O=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return O&&(u&2&&(u|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),u|=this.updateForViewport()),(u&2||O)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,t)),u|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),u}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,n){let i=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,c=new q_(r.lineAt(o-i*1e3,gs.ByHeight,s,0,0).from,r.lineAt(l+(1-i)*1e3,gs.ByHeight,s,0,0).to);if(n){let{head:u}=n.range;if(uc.to){let d=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=r.lineAt(u,gs.ByPos,s,0,0),h;n.y=="center"?h=(f.top+f.bottom)/2-d/2:n.y=="start"||n.y=="nearest"&&u=l+Math.max(10,Math.min(i,250)))&&r>o-2*1e3&&s>1,o=r<<1;if(this.defaultTextDirection!=os.LTR&&!i)return[];let l=[],c=(d,f,h,m)=>{if(f-dd&&yy.from>=h.from&&y.to<=h.to&&Math.abs(y.from-d)y.fromw));if(!v){if(fx.from<=f&&x.to>=f)){let x=n.moveToLineBoundary(ht.cursor(f),!1,!0).head;x>d&&(f=x)}let y=this.gapSize(h,d,f,m),w=i||y<2e6?y:2e6;v=new n$(d,f,y,w)}l.push(v)},u=d=>{if(d.length2e6)for(let S of t)S.from>=d.from&&S.fromd.from&&c(d.from,m,d,f),gn.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(t){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let i=[];Ki.spans(n,this.viewport.from,this.viewport.to,{span(s,o){i.push({from:s,to:o})},point(){}},20);let r=0;if(i.length!=this.visibleRanges.length)r=12;else for(let s=0;s=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(n=>n.from<=t&&n.to>=t)||yS(this.heightMap.lineAt(t,gs.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=t&&n.bottom>=t)||yS(this.heightMap.lineAt(this.scaler.fromDOM(t),gs.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(t){let n=this.lineBlockAtHeight(t+8);return n.from>=this.viewport.from||this.viewportLines[0].top-t>200?n:this.viewportLines[0]}elementAtHeight(t){return yS(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}let q_=class{constructor(t,n){this.from=t,this.to=n}};function GPt(e,t,n){let i=[],r=e,s=0;return Ki.spans(n,e,t,{span(){},point(o,l){o>r&&(i.push({from:r,to:o}),s+=o-r),r=l}},20),r=1)return t[t.length-1].to;let i=Math.floor(e*n);for(let r=0;;r++){let{from:s,to:o}=t[r],l=o-s;if(i<=l)return s+i;i-=l}}function K_(e,t){let n=0;for(let{from:i,to:r}of e.ranges){if(t<=r){n+=t-i;break}n+=r-i}return n/e.total}function XPt(e,t){for(let n of e)if(t(n))return n}const Gie={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};function Xie(e){let t=e.facet(XM).filter(i=>typeof i!="function"),n=e.facet(Wq).filter(i=>typeof i!="function");return n.length&&t.push(Ki.join(n)),t}class Yq{constructor(t,n,i){let r=0,s=0,o=0;this.viewports=i.map(({from:l,to:c})=>{let u=n.lineAt(l,gs.ByPos,t,0,0).top,d=n.lineAt(c,gs.ByPos,t,0,0).bottom;return r+=d-u,{from:l,to:c,top:u,bottom:d,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(n.height-r);for(let l of this.viewports)l.domTop=o+(l.top-s)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),s=l.bottom}toDOM(t){for(let n=0,i=0,r=0;;n++){let s=nn.from==t.viewports[i].from&&n.to==t.viewports[i].to):!1}}function yS(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),i=t.toDOM(e.bottom);return new of(e.from,e.length,n,i-n,Array.isArray(e._content)?e._content.map(r=>yS(r,t)):e._content)}const G_=mn.define({combine:e=>e.join(" ")}),W9=mn.define({combine:e=>e.indexOf(!0)>-1}),K9=hb.newName(),X3e=hb.newName(),Y3e=hb.newName(),Z3e={"&light":"."+X3e,"&dark":"."+Y3e};function G9(e,t,n){return new hb(t,{finish(i){return/&/.test(i)?i.replace(/&\w*/,r=>{if(r=="&")return e;if(!n||!n[r])throw new RangeError(`Unsupported selector: ${r}`);return n[r]}):e+" "+i}})}const YPt=G9("."+K9,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Z3e),ZPt={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},i$=hn.ie&&hn.ie_version<=11;class JPt{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new TIt,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver(n=>{for(let i of n)this.queue.push(i);(hn.ie&&hn.ie_version<=11||hn.ios&&t.composing)&&n.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&hn.android&&t.constructor.EDIT_CONTEXT!==!1&&!(hn.chrome&&hn.chrome_version<126)&&(this.editContext=new tDt(t),t.state.facet(xp)&&(t.contentDOM.editContext=this.editContext.editContext)),i$&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(t){(t.type=="change"||!t.type)&&!t.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some((n,i)=>n!=t[i]))){this.gapIntersection.disconnect();for(let n of t)this.gapIntersection.observe(n);this.gaps=t}}onSelectionChange(t){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,r=this.selectionRange;if(i.state.facet(xp)?i.root.activeElement!=this.dom:!xE(this.dom,r))return;let s=r.anchorNode&&i.docView.tile.nearest(r.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(t)){n||(this.selectionChanged=!1);return}(hn.ie&&hn.ie_version<=11||hn.android&&hn.chrome)&&!i.state.selection.main.empty&&r.focusNode&&OE(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,n=LC(t.root);if(!n)return!1;let i=hn.safari&&t.root.nodeType==11&&t.root.activeElement==this.dom&&eDt(this.view,n)||n;if(!i||this.selectionRange.eq(i))return!1;let r=xE(this.dom,i);return r&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&yw(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||t=="Enter")&&(this.delayedAndroidKey={key:t,keyCode:n,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let n=-1,i=-1,r=!1;for(let s of t){let o=this.readMutation(s);o&&(o.typeOver&&(r=!0),n==-1?{from:n,to:i}=o:(n=Math.min(o.from,n),i=Math.max(o.to,i)))}return{from:n,to:i,typeOver:r}}readChange(){let{from:t,to:n,typeOver:i}=this.processRecords(),r=this.selectionChanged&&xE(this.dom,this.selectionRange);if(t<0&&!r)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new bPt(this.view,t,n,i);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let i=this.view.state,r=F3e(this.view,n);return this.view.state==i&&(n.domChanged||n.newSel&&!WI(this.view.state.selection,n.newSel.main))&&this.view.update([]),r}readMutation(t){let n=this.view.docView.tile.nearest(t.target);if(!n||n.isWidget())return null;if(n.markDirty(t.type=="attributes"),t.type=="childList"){let i=Yie(n,t.previousSibling||t.target.previousSibling,-1),r=Yie(n,t.nextSibling||t.target.nextSibling,1);return{from:i?n.posAfter(i):n.posAtStart,to:r?n.posBefore(r):n.posAtEnd,typeOver:!1}}else return t.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}update(t){this.editContext&&(this.editContext.update(t),t.startState.facet(xp)!=t.state.facet(xp)&&(t.view.contentDOM.editContext=t.state.facet(xp)?this.editContext.editContext:null))}destroy(){var t,n,i;this.stop(),(t=this.intersection)===null||t===void 0||t.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function Yie(e,t,n){for(;t;){let i=pa.get(t);if(i&&i.parent==e)return i;let r=t.parentNode;t=r!=e.dom?r:n>0?t.nextSibling:t.previousSibling}return null}function Zie(e,t){let n=t.startContainer,i=t.startOffset,r=t.endContainer,s=t.endOffset,o=e.docView.domAtPos(e.state.selection.main.anchor,1);return OE(o.node,o.offset,r,s)&&([n,i,r,s]=[r,s,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}}function eDt(e,t){if(t.getComposedRanges){let r=t.getComposedRanges(e.root)[0];if(r)return Zie(e,r)}let n=null;function i(r){r.preventDefault(),r.stopImmediatePropagation(),n=r.getTargetRanges()[0]}return e.contentDOM.addEventListener("beforeinput",i,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",i,!0),n?Zie(e,n):null}class tDt{constructor(t){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(t.state);let n=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});this.handlers.textupdate=i=>{let r=t.state.selection.main,{anchor:s,head:o}=r,l=this.toEditorPos(i.updateRangeStart),c=this.toEditorPos(i.updateRangeEnd);t.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:l,drifted:!1});let u=c-l>i.text.length;l==this.from&&sthis.to&&(c=s);let d=B3e(t.state.sliceDoc(l,c),i.text,(u?r.from:r.to)-l,u?"end":null);if(!d){let h=ht.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));WI(h,r)||t.dispatch({selection:h,userEvent:"select"});return}let f={from:d.from+l,to:d.toA+l,insert:xr.of(i.text.slice(d.from,d.toB).split(` +`))};if((hn.mac||hn.android)&&f.from==o-1&&/^\. ?$/.test(i.text)&&t.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:l,to:c,insert:xr.of([i.text.replace("."," ")])}),this.pendingContextChange=f,!t.state.readOnly){let h=this.to-this.from+(f.to-f.from+f.insert.length);Gq(t,f,ht.single(this.toEditorPos(i.selectionStart,h),this.toEditorPos(i.selectionEnd,h)))}this.pendingContextChange&&(this.revertPending(t.state),this.setSelection(t.state)),f.from=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(n.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let r=[],s=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o{let r=[];for(let s of i.getTextFormats()){let o=s.underlineStyle,l=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(l)){let c=this.toEditorPos(s.rangeStart),u=this.toEditorPos(s.rangeEnd);if(c{t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(t.inputState.composing=-1,t.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(t.state)}};for(let i in this.handlers)n.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{let r=LC(i.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let n=0,i=!1,r=this.pendingContextChange;return t.changes.iterChanges((s,o,l,c,u)=>{if(i)return;let d=u.length-(o-s);if(r&&o>=r.to)if(r.from==s&&r.to==o&&r.insert.eq(u)){r=this.pendingContextChange=null,n+=d,this.to+=d;return}else r=null,this.revertPending(t.state);if(s+=n,o+=n,o<=this.from)this.from+=d,this.to+=d;else if(sthis.to||this.to-this.from+u.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),u.toString()),this.to+=d}n+=d}),r&&!i&&this.revertPending(t.state),!i}update(t){let n=this.pendingContextChange,i=t.startState.selection.main;this.composing&&(this.composing.drifted||!t.changes.touchesRange(i.from,i.to)&&t.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=t.changes.mapPos(this.composing.editorBase)):!this.applyEdits(t)||!this.rangeIsValid(t.state)?(this.pendingContextChange=null,this.reset(t.state)):(t.docChanged||t.selectionSet||n)&&this.setSelection(t.state),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:n}=t.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(t.doc.length,n+1e4)}reset(t){this.resetRange(t),this.editContext.updateText(0,this.editContext.text.length,t.doc.sliceString(this.from,this.to)),this.setSelection(t)}revertPending(t){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),t.doc.sliceString(n.from,n.to))}setSelection(t){let{main:n}=t.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),r=this.toContextPos(n.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(i,r)}rangeIsValid(t){let{head:n}=t.selection.main;return!(this.from>0&&n-this.from<500||this.to1e4*3)}toEditorPos(t,n=this.to-this.from){t=Math.min(t,n);let i=this.composing;return i&&i.drifted?i.editorBase+(t-i.contextBase):t+this.from}toContextPos(t){let n=this.composing;return n&&n.drifted?n.contextBase+(t-n.editorBase):t-this.from}destroy(){for(let t in this.handlers)this.editContext.removeEventListener(t,this.handlers[t])}}class Jt{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),t.parent&&t.parent.appendChild(this.dom);let{dispatch:i}=t;this.dispatchTransactions=t.dispatchTransactions||i&&(r=>r.forEach(s=>i(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=t.root||_It(t.parent)||document,this.viewState=new Kie(this,t.state||tr.create(t)),t.scrollTo&&t.scrollTo.is(z_)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Fx).map(r=>new Y4(r));for(let r of this.plugins)r.update(this);this.observer=new JPt(this),this.inputState=new wPt(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Die(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...t){let n=t.length==1&&t[0]instanceof Xa?t:t.length==1&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(n,this)}update(t){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,i=!1,r,s=this.state;for(let h of t){if(h.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=h.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,l=0,c=null;t.some(h=>h.annotation(q3e))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,c=W3e(s,o),c||(l=1));let u=this.observer.delayedAndroidKey,d=null;if(u?(this.observer.clearDelayedAndroidKey(),d=this.observer.readChange(),(d&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(d=null)):this.observer.clear(),s.facet(tr.phrases)!=this.state.facet(tr.phrases))return this.setState(s);r=VI.create(this,s,t),r.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let h of t){if(f&&(f=f.map(h.changes)),h.scrollIntoView){let{main:m}=h.state.selection,{x:g,y:b}=this.state.facet(Jt.cursorScrollMargin);f=new vw(m.empty?m:ht.cursor(m.head,m.head>m.anchor?-1:1),"nearest","nearest",b,g)}for(let m of h.effects)m.is(z_)&&(f=m.value.clip(this.state))}this.viewState.update(r,f),this.bidiCache=GI.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),n=this.docView.update(r),this.state.facet(bS)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(n,t.some(h=>h.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(G_)!=r.state.facet(G_)&&(this.viewState.mustMeasureContent=!0),(n||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!r.empty)for(let h of this.state.facet(Q9))try{h(r)}catch(m){Dc(this.state,m,"update listener")}(c||d)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),d&&!F3e(this,d)&&u.force&&yw(this.contentDOM,u.key,u.keyCode)})}setState(t){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=t;return}this.updateState=2;let n=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new Kie(this,t),this.plugins=t.facet(Fx).map(i=>new Y4(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new Die(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(t){let n=t.startState.facet(Fx),i=t.state.facet(Fx);if(n!=i){let r=[];for(let s of i){let o=n.indexOf(s);if(o<0)r.push(new Y4(s));else{let l=this.plugins[o];l.mustUpdate=t,r.push(l)}}for(let s of this.plugins)s.mustUpdate!=t&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=t;for(let r=0;r-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,t&&this.observer.forceFlush();let n=null,i=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(h3e(i||this.win))s=-1,o=this.viewState.heightMap.height;else{let m=this.viewState.scrollAnchorAt(r);s=m.from,o=m.top}this.updateState=1;let c=this.viewState.measure();if(!c&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let u=[];c&4||([this.measureRequests,u]=[u,this.measureRequests]);let d=u.map(m=>{try{return m.read(this)}catch(g){return Dc(this.state,g),Jie}}),f=VI.create(this,this.state,[]),h=!1;f.flags|=c,n?n.flags|=c:n=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),h=this.docView.update(f),h&&this.docViewUpdate());for(let m=0;m1||g<-1)&&!(hn.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(i==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r=r+g,i?i.scrollTop+=g:this.win.scrollBy(0,g),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let l of this.state.facet(Q9))l(n)}get themeClasses(){return K9+" "+(this.state.facet(W9)?Y3e:X3e)+" "+this.state.facet(G_)}updateAttrs(){let t=ere(this,N3e,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(xp)?"true":"false",class:"cm-content",style:`${hn.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),ere(this,qq,n);let i=this.observer.ignore(()=>{let r=_ie(this.contentDOM,this.contentAttrs,n),s=_ie(this.dom,this.editorAttrs,t);return r||s});return this.editorAttrs=t,this.contentAttrs=n,i}showAnnouncements(t){let n=!0;for(let i of t)for(let r of i.effects)if(r.is(Jt.announce)){n&&(this.announceDOM.textContent=""),n=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(bS);let t=this.state.facet(Jt.cspNonce);hb.mount(this.root,this.styleModules.concat(YPt).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),t){if(this.measureRequests.indexOf(t)>-1)return;if(t.key!=null){for(let n=0;ni.plugin==t)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,n,i){return t$(this,t,Mie(this,t,n,i))}moveByGroup(t,n){return t$(this,t,Mie(this,t,n,i=>dPt(this,t.head,i)))}visualLineSide(t,n){let i=this.bidiSpans(t),r=this.textDirectionAt(t.from),s=i[n?i.length-1:0];return ht.cursor(s.side(n,r)+t.from,s.forward(!n,r)?1:-1)}moveToLineBoundary(t,n,i=!0){return uPt(this,t,n,i)}moveVertically(t,n,i){return t$(this,t,fPt(this,t,n,i))}domAtPos(t,n=1){return this.docView.domAtPos(t,n)}posAtDOM(t,n=0){return this.docView.posFromDOM(t,n)}posAtCoords(t,n=!0){this.readMeasured();let i=H9(this,t,n);return i&&i.pos}posAndSideAtCoords(t,n=!0){return this.readMeasured(),H9(this,t,n)}coordsAtPos(t,n=1){this.readMeasured();let i=this.state.doc.lineAt(t),r=this.bidiSpans(i),s=r[lh.find(r,t-i.from,-1,n)];return this.docView.coordsAt(t,n,s.dir==os.RTL)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(A3e)||tthis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>nDt)return v3e(t.length);let n=this.textDirectionAt(t.from),i;for(let s of this.bidiCache)if(s.from==t.from&&s.dir==n&&(s.fresh||y3e(s.isolates,i=Rie(this,t))))return s.order;i||(i=Rie(this,t));let r=LIt(t.text,n,i);return this.bidiCache.push(new GI(t.from,t.to,n,i,!0,r)),r}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||hn.safari&&((t=this.inputState)===null||t===void 0?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{f3e(this.contentDOM),this.docView.updateSelection()})}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((t.nodeType==9?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,n={}){var i,r,s,o;return z_.of(new vw(typeof t=="number"?ht.cursor(t):t,(i=n.y)!==null&&i!==void 0?i:"nearest",(r=n.x)!==null&&r!==void 0?r:"nearest",(s=n.yMargin)!==null&&s!==void 0?s:5,(o=n.xMargin)!==null&&o!==void 0?o:5))}scrollSnapshot(){let{scrollTop:t,scrollLeft:n}=this.scrollDOM,i=this.viewState.scrollAnchorAt(t);return z_.of(new vw(ht.cursor(i.from),"start","start",i.top-t,n,!0))}setTabFocusMode(t){t==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof t=="boolean"?this.inputState.tabFocusMode=t?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+t)}static domEventHandlers(t){return ma.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return ma.define(()=>({}),{eventObservers:t})}static theme(t,n){let i=hb.newName(),r=[G_.of(i),bS.of(G9(`.${i}`,t))];return n&&n.dark&&r.push(W9.of(!0)),r}static baseTheme(t){return gm.lowest(bS.of(G9("."+K9,t,Z3e)))}static findFromDOM(t){var n;let i=t.querySelector(".cm-content"),r=i&&pa.get(i)||pa.get(t);return((n=r==null?void 0:r.root)===null||n===void 0?void 0:n.view)||null}}Jt.styleModule=bS;Jt.inputHandler=E3e;Jt.clipboardInputFilter=Vq;Jt.clipboardOutputFilter=Hq;Jt.scrollHandler=_3e;Jt.focusChangeEffect=C3e;Jt.perLineTextDirection=A3e;Jt.exceptionSink=S3e;Jt.updateListener=Q9;Jt.editable=xp;Jt.mouseSelectionStyle=k3e;Jt.dragMovesSelection=O3e;Jt.clickAddsSelectionRange=w3e;Jt.decorations=XM;Jt.blockWrappers=R3e;Jt.outerDecorations=Wq;Jt.atomicRanges=_T;Jt.bidiIsolatedRanges=I3e;Jt.cursorScrollMargin=mn.define({combine:e=>{let t=5,n=5;for(let i of e)typeof i=="number"?t=n=i:{x:t,y:n}=i;return{x:t,y:n}}});Jt.scrollMargins=P3e;Jt.darkTheme=W9;Jt.cspNonce=mn.define({combine:e=>e.length?e[0]:""});Jt.contentAttributes=qq;Jt.editorAttributes=N3e;Jt.lineWrapping=Jt.contentAttributes.of({class:"cm-lineWrapping"});Jt.announce=pi.define();const nDt=4096,Jie={};class GI{constructor(t,n,i,r,s,o){this.from=t,this.to=n,this.dir=i,this.isolates=r,this.fresh=s,this.order=o}static update(t,n){if(n.empty&&!t.some(s=>s.fresh))return t;let i=[],r=t.length?t[t.length-1].dir:os.LTR;for(let s=Math.max(0,t.length-10);s=0;r--){let s=i[r],o=typeof s=="function"?s(e):s;o&&Uq(o,n)}return n}const iDt=hn.mac?"mac":hn.windows?"win":hn.linux?"linux":"key";function rDt(e,t){const n=e.split(/-(?!$)/);let i=n[n.length-1];i=="Space"&&(i=" ");let r,s,o,l;for(let c=0;ci.concat(r),[]))),n}function aDt(e,t,n){return e4e(J3e(e.state),t,e,n)}let og=null;const oDt=4e3;function lDt(e,t=iDt){let n=Object.create(null),i=Object.create(null),r=(o,l)=>{let c=i[o];if(c==null)i[o]=l;else if(c!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,l,c,u,d)=>{var f,h;let m=n[o]||(n[o]=Object.create(null)),g=l.split(/ (?!$)/).map(y=>rDt(y,t));for(let y=1;y{let O=og={view:x,prefix:w,scope:o};return setTimeout(()=>{og==O&&(og=null)},oDt),!0}]})}let b=g.join(" ");r(b,!1);let v=m[b]||(m[b]={preventDefault:!1,stopPropagation:!1,run:((h=(f=m._any)===null||f===void 0?void 0:f.run)===null||h===void 0?void 0:h.slice())||[]});c&&v.run.push(c),u&&(v.preventDefault=!0),d&&(v.stopPropagation=!0)};for(let o of e){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let u of l){let d=n[u]||(n[u]=Object.create(null));d._any||(d._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=o;for(let h in d)d[h].run.push(m=>f(m,X9))}let c=o[t]||o.key;if(c)for(let u of l)s(u,c,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(u,"Shift-"+c,o.shift,o.preventDefault,o.stopPropagation)}return n}let X9=null;function e4e(e,t,n,i){X9=t;let r=OIt(t),s=jc(r,0),o=eh(s)==r.length&&r!=" ",l="",c=!1,u=!1,d=!1;og&&og.view==n&&og.scope==i&&(l=og.prefix+" ",Q3e.indexOf(t.keyCode)<0&&(u=!0,og=null));let f=new Set,h=v=>{if(v){for(let y of v.run)if(!f.has(y)&&(f.add(y),y(n)))return v.stopPropagation&&(d=!0),!0;v.preventDefault&&(v.stopPropagation&&(d=!0),u=!0)}return!1},m=e[i],g,b;return m&&(h(m[l+X_(r,t,!o)])?c=!0:o&&(t.altKey||t.metaKey||t.ctrlKey)&&!(hn.windows&&t.ctrlKey&&t.altKey)&&!(hn.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(g=pb[t.keyCode])&&g!=r?(h(m[l+X_(g,t,!0)])||t.shiftKey&&(b=DC[t.keyCode])!=r&&b!=g&&h(m[l+X_(b,t,!1)]))&&(c=!0):o&&t.shiftKey&&h(m[l+X_(r,t,!0)])&&(c=!0),!c&&h(m._any)&&(c=!0)),u&&(c=!0),c&&d&&t.stopPropagation(),X9=null,c}class Zy{constructor(t,n,i,r,s){this.className=t,this.left=n,this.top=i,this.width=r,this.height=s}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}update(t,n){return n.className!=this.className?!1:(this.adjust(t),!0)}adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",this.width!=null&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}static forRange(t,n,i){if(i.empty){let r=t.coordsAtPos(i.head,i.assoc||1);if(!r)return[];let s=t4e(t);return[new Zy(n,r.left-s.left,r.top-s.top,null,r.bottom-r.top)]}else return cDt(t,n,i)}}function t4e(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==os.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function nre(e,t,n,i){let r=e.coordsAtPos(t,n*2);if(!r)return i;let s=e.dom.getBoundingClientRect(),o=(r.top+r.bottom)/2,l=e.posAtCoords({x:s.left+1,y:o}),c=e.posAtCoords({x:s.right-1,y:o});return l==null||c==null?i:{from:Math.max(i.from,Math.min(l,c)),to:Math.min(i.to,Math.max(l,c))}}function cDt(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let i=Math.max(n.from,e.viewport.from),r=Math.min(n.to,e.viewport.to),s=e.textDirection==os.LTR,o=e.contentDOM,l=o.getBoundingClientRect(),c=t4e(e),u=o.querySelector(".cm-line"),d=u&&window.getComputedStyle(u),f=l.left+(d?parseInt(d.paddingLeft)+Math.min(0,parseInt(d.textIndent)):0),h=l.right-(d?parseInt(d.paddingRight):0),m=V9(e,i,1),g=V9(e,r,-1),b=m.type==ol.Text?m:null,v=g.type==ol.Text?g:null;if(b&&(e.lineWrapping||m.widgetLineBreaks)&&(b=nre(e,i,1,b)),v&&(e.lineWrapping||g.widgetLineBreaks)&&(v=nre(e,r,-1,v)),b&&v&&b.from==v.from&&b.to==v.to)return w(x(n.from,n.to,b));{let k=b?x(n.from,null,b):O(m,!1),S=v?x(null,n.to,v):O(g,!0),C=[];return(b||m).to<(v||g).from-(b&&v?1:0)||m.widgetLineBreaks>1&&k.bottom+e.defaultLineHeight/2A&&P.from=D)break;M>I&&R(Math.max(F,I),k==null&&F<=A,Math.min(M,D),S==null&&M>=N,L.dir)}if(I=_.to+1,I>=D)break}return T.length==0&&R(A,k==null,N,S==null,e.textDirection),{top:E,bottom:j,horizontal:T}}function O(k,S){let C=l.top+(S?k.top:k.bottom);return{top:C,bottom:C,horizontal:[]}}}function uDt(e,t){return e.constructor==t.constructor&&e.eq(t)}class dDt{constructor(t,n){this.view=t,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,t)}update(t){t.startState.facet(BN)!=t.state.facet(BN)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq))}docViewUpdate(t){this.layer.updateOnDocViewUpdate!==!1&&t.requestMeasure(this.measureReq)}setOrder(t){let n=0,i=t.facet(BN);for(;n!uDt(n,this.drawn[i]))){let n=this.dom.firstChild,i=0;for(let r of t)r.update&&n&&r.constructor&&this.drawn[i].constructor&&r.update(n,this.drawn[i])?(n=n.nextSibling,i++):this.dom.insertBefore(r.draw(),n);for(;n;){let r=n.nextSibling;n.remove(),n=r}this.drawn=t,hn.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const BN=mn.define();function n4e(e){return[ma.define(t=>new dDt(t,e)),BN.of(e)]}const h1=mn.define({combine(e){return Ih(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(t,n)=>Math.min(t,n),drawRangeCursor:(t,n)=>t||n})}});function fDt(e={}){return[h1.of(e),hDt,pDt,mDt,T3e.of(!0)]}function i4e(e){return e.startState.facet(h1)!=e.state.facet(h1)}const hDt=n4e({above:!0,markers(e){let{state:t}=e,n=t.facet(h1),i=[];for(let r of t.selection.ranges){let s=r==t.selection.main;if(r.empty||n.drawRangeCursor&&!(s&&hn.ios&&n.iosSelectionHandles)){let o=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=r.empty?r:ht.cursor(r.head,r.assoc);for(let c of Zy.forRange(e,o,l))i.push(c)}}return i},update(e,t){e.transactions.some(i=>i.selection)&&(t.style.animationName=t.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=i4e(e);return n&&ire(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){ire(t.state,e)},class:"cm-cursorLayer"});function ire(e,t){t.style.animationDuration=e.facet(h1).cursorBlinkRate+"ms"}const pDt=n4e({above:!1,markers(e){let t=[],{main:n,ranges:i}=e.state.selection;for(let r of i)if(!r.empty)for(let s of Zy.forRange(e,"cm-selectionBackground",r))t.push(s);if(hn.ios&&!n.empty&&e.state.facet(h1).iosSelectionHandles){for(let r of Zy.forRange(e,"cm-selectionHandle cm-selectionHandle-start",ht.cursor(n.from,1)))t.push(r);for(let r of Zy.forRange(e,"cm-selectionHandle cm-selectionHandle-end",ht.cursor(n.to,1)))t.push(r)}return t},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||i4e(e)},class:"cm-selectionLayer"}),mDt=gm.highest(Jt.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),r4e=pi.define({map(e,t){return e==null?null:t.mapPos(e)}}),vS=dl.define({create(){return null},update(e,t){return e!=null&&(e=t.changes.mapPos(e)),t.effects.reduce((n,i)=>i.is(r4e)?i.value:n,e)}}),gDt=ma.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(vS);n==null?this.cursor!=null&&((t=this.cursor)===null||t===void 0||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(vS)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(vS),n=t!=null&&e.coordsAtPos(t);if(!n)return null;let i=e.scrollDOM.getBoundingClientRect();return{left:n.left-i.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-i.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/n+"px",this.cursor.style.height=e.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(vS)!=e&&this.view.dispatch({effects:r4e.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){(e.target==this.view.contentDOM||!this.view.contentDOM.contains(e.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function bDt(){return[vS,gDt]}function rre(e,t,n,i,r){t.lastIndex=0;for(let s=e.iterRange(n,i),o=n,l;!s.next().done;o+=s.value.length)if(!s.lineBreak)for(;l=t.exec(s.value);)r(o+l.index,l)}function yDt(e,t){let n=e.visibleRanges;if(n.length==1&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let i=[];for(let{from:r,to:s}of n)r=Math.max(e.state.doc.lineAt(r).from,r-t),s=Math.min(e.state.doc.lineAt(s).to,s+t),i.length&&i[i.length-1].to>=r?i[i.length-1].to=s:i.push({from:r,to:s});return i}class vDt{constructor(t){const{regexp:n,decoration:i,decorate:r,boundary:s,maxLength:o=1e3}=t;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,r)this.addMatch=(l,c,u,d)=>r(d,u,u+l[0].length,l,c);else if(typeof i=="function")this.addMatch=(l,c,u,d)=>{let f=i(l,c,u);f&&d(u,u+l[0].length,f)};else if(i)this.addMatch=(l,c,u,d)=>d(u,u+l[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=o}createDeco(t){let n=new tm,i=n.add.bind(n);for(let{from:r,to:s}of yDt(t,this.maxLength))rre(t.state.doc,this.regexp,r,s,(o,l)=>this.addMatch(l,t,o,i));return n.finish()}updateDeco(t,n){let i=1e9,r=-1;return t.docChanged&&t.changes.iterChanges((s,o,l,c)=>{c>=t.view.viewport.from&&l<=t.view.viewport.to&&(i=Math.min(l,i),r=Math.max(c,r))}),t.viewportMoved||r-i>1e3?this.createDeco(t.view):r>-1?this.updateRange(t.view,n.map(t.changes),i,r):n}updateRange(t,n,i,r){for(let s of t.visibleRanges){let o=Math.max(s.from,i),l=Math.min(s.to,r);if(l>=o){let c=t.state.doc.lineAt(o),u=c.toc.from;o--)if(this.boundary.test(c.text[o-1-c.from])){d=o;break}for(;lh.push(y.range(b,v));if(c==u)for(this.regexp.lastIndex=d-c.from;(m=this.regexp.exec(c.text))&&m.indexthis.addMatch(v,t,b,g));n=n.update({filterFrom:d,filterTo:f,filter:(b,v)=>bf,add:h})}}return n}}const Y9=/x/.unicode!=null?"gu":"g",xDt=new RegExp(`[\0-\b +--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Y9),wDt={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let r$=null;function ODt(){var e;if(r$==null&&typeof document<"u"&&document.body){let t=document.body.style;r$=((e=t.tabSize)!==null&&e!==void 0?e:t.MozTabSize)!=null}return r$||!1}const UN=mn.define({combine(e){let t=Ih(e,{render:null,specialChars:xDt,addSpecialChars:null});return(t.replaceTabs=!ODt())&&(t.specialChars=new RegExp(" |"+t.specialChars.source,Y9)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,Y9)),t}});function kDt(e={}){return[UN.of(e),SDt()]}let sre=null;function SDt(){return sre||(sre=ma.fromClass(class{constructor(e){this.view=e,this.decorations=Fn.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(UN)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new vDt({regexp:e.specialChars,decoration:(t,n,i)=>{let{doc:r}=n.state,s=jc(t[0],0);if(s==9){let o=r.lineAt(i),l=n.state.tabSize,c=wf(o.text,l,i-o.from);return Fn.replace({widget:new TDt((l-c%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=Fn.replace({widget:new ADt(e,s)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(UN);e.startState.facet(UN)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))}const EDt="•";function CDt(e){return e>=32?EDt:e==10?"␤":String.fromCharCode(9216+e)}class ADt extends jf{constructor(t,n){super(),this.options=t,this.code=n}eq(t){return t.code==this.code}toDOM(t){let n=CDt(this.code),i=t.state.phrase("Control character")+" "+(wDt[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,i,n);if(r)return r;let s=document.createElement("span");return s.textContent=n,s.title=i,s.setAttribute("aria-label",i),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class TDt extends jf{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent=" ",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}function _Dt(){return NDt}const jDt=Fn.line({class:"cm-activeLine"}),NDt=ma.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let i of e.state.selection.ranges){let r=e.lineBlockAt(i.head);r.from>t&&(n.push(jDt.range(r.from)),t=r.from)}return Fn.set(n)}},{decorations:e=>e.decorations});class RDt extends jf{constructor(t){super(),this.content=t}toDOM(t){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(t):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(t){let n=t.firstChild?wE(t.firstChild):[];if(!n.length)return null;let i=window.getComputedStyle(t.parentNode),r=$C(n[0],i.direction!="rtl"),s=parseInt(i.lineHeight);return r.bottom-r.top>s*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+s}:r}ignoreEvent(){return!1}}function IDt(e){let t=ma.fromClass(class{constructor(n){this.view=n,this.placeholder=e?Fn.set([Fn.widget({widget:new RDt(e),side:1}).range(0)]):Fn.none}get decorations(){return this.view.state.doc.length?Fn.none:this.placeholder}},{decorations:n=>n.decorations});return typeof e=="string"?[t,Jt.contentAttributes.of({"aria-placeholder":e})]:t}const Z9=2e3;function PDt(e,t,n){let i=Math.min(t.line,n.line),r=Math.max(t.line,n.line),s=[];if(t.off>Z9||n.off>Z9||t.col<0||n.col<0){let o=Math.min(t.off,n.off),l=Math.max(t.off,n.off);for(let c=i;c<=r;c++){let u=e.doc.line(c);u.length<=l&&s.push(ht.range(u.from+o,u.to+l))}}else{let o=Math.min(t.col,n.col),l=Math.max(t.col,n.col);for(let c=i;c<=r;c++){let u=e.doc.line(c),d=N9(u.text,o,e.tabSize,!0);if(d<0)s.push(ht.cursor(u.to));else{let f=N9(u.text,l,e.tabSize);s.push(ht.range(u.from+d,u.from+f))}}}return s}function DDt(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}function are(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),i=e.state.doc.lineAt(n),r=n-i.from,s=r>Z9?-1:r==i.length?DDt(e,t.clientX):wf(i.text,e.state.tabSize,n-i.from);return{line:i.number,col:s,off:r}}function MDt(e,t){let n=are(e,t),i=e.state.selection;return n?{update(r){if(r.docChanged){let s=r.changes.mapPos(r.startState.doc.line(n.line).from),o=r.state.doc.lineAt(s);n={line:o.number,col:n.col,off:Math.min(n.off,o.length)},i=i.map(r.changes)}},get(r,s,o){let l=are(e,r);if(!l)return i;let c=PDt(e.state,n,l);return c.length?o?ht.create(c.concat(i.ranges)):ht.create(c):i}}:null}function LDt(e){let t=n=>n.altKey&&n.button==0;return Jt.mouseSelectionStyle.of((n,i)=>t(i)?MDt(n,i):null)}const $Dt={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},FDt={style:"cursor: crosshair"};function BDt(e={}){let[t,n]=$Dt[e.key||"Alt"],i=ma.fromClass(class{constructor(r){this.view=r,this.isDown=!1}set(r){this.isDown!=r&&(this.isDown=r,this.view.update([]))}},{eventObservers:{keydown(r){this.set(r.keyCode==t||n(r))},keyup(r){(r.keyCode==t||!n(r))&&this.set(!1)},mousemove(r){this.set(n(r))}}});return[i,Jt.contentAttributes.of(r=>{var s;return!((s=r.plugin(i))===null||s===void 0)&&s.isDown?FDt:null})]}const Y_="-10000px";class s4e{constructor(t,n,i,r){this.facet=n,this.createTooltipView=i,this.removeTooltipView=r,this.input=t.state.facet(n),this.tooltips=this.input.filter(o=>o);let s=null;this.tooltipViews=this.tooltips.map(o=>s=i(o,s))}update(t,n){var i;let r=t.state.facet(this.facet),s=r.filter(c=>c);if(r===this.input){for(let c of this.tooltipViews)c.update&&c.update(t);return!1}let o=[],l=n?[]:null;for(let c=0;cn[u]=c),n.length=l.length),this.input=r,this.tooltips=s,this.tooltipViews=o,!0}}function UDt(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}const s$=mn.define({combine:e=>{var t,n,i;return{position:hn.ios?"absolute":((t=e.find(r=>r.position))===null||t===void 0?void 0:t.position)||"fixed",parent:((n=e.find(r=>r.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((i=e.find(r=>r.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||UDt}}}),ore=new WeakMap,Zq=ma.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(s$);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new s4e(e,Jq,(n,i)=>this.createTooltip(n,i),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,i=e.state.facet(s$);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;n=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),i=t?t.dom:null;if(n.dom.classList.add("cm-tooltip"),e.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let r=document.createElement("div");r.className="cm-tooltip-arrow",n.dom.appendChild(r)}return n.dom.style.position=this.position,n.dom.style.top=Y_,n.dom.style.left="0px",this.container.insertBefore(n.dom,i),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(e=i.destroy)===null||e===void 0||e.call(i);this.parent&&this.container.remove(),(t=this.resizeObserver)===null||t===void 0||t.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(hn.safari){let o=s.getBoundingClientRect();n=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}else n=!!s.offsetParent&&s.offsetParent!=this.container.ownerDocument.body}if(n||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(e=s.width/this.parent.offsetWidth,t=s.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),r=Kq(this.view);return{visible:{left:i.left+r.left,top:i.top+r.top,right:i.right-r.right,bottom:i.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,o)=>{let l=this.manager.tooltipViews[o];return l.getCoords?l.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(s$).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){var t;if(e.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:n,space:i,scaleX:r,scaleY:s}=e,o=[];for(let l=0;l=Math.min(n.bottom,i.bottom)||f.rightMath.min(n.right,i.right)+.1)){d.style.top=Y_;continue}let m=c.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,g=m?7:0,b=h.right-h.left,v=(t=ore.get(u))!==null&&t!==void 0?t:h.bottom-h.top,y=u.offset||zDt,w=this.view.textDirection==os.LTR,x=h.width>i.right-i.left?w?i.left:i.right-h.width:w?Math.max(i.left,Math.min(f.left-(m?14:0)+y.x,i.right-b)):Math.min(Math.max(i.left,f.left-b+(m?14:0)-y.x),i.right-b),O=this.above[l];!c.strictSide&&(O?f.top-v-g-y.yi.bottom)&&O==i.bottom-f.bottom>f.top-i.top&&(O=this.above[l]=!O);let k=(O?f.top-i.top:i.bottom-f.bottom)-g;if(kx&&E.topS&&(S=O?E.top-v-2-g:E.bottom+g+2);if(this.position=="absolute"?(d.style.top=(S-e.parent.top)/s+"px",lre(d,(x-e.parent.left)/r)):(d.style.top=S/s+"px",lre(d,x/r)),m){let E=f.left+(w?y.x:-y.x)-(x+14-7);m.style.left=E/r+"px"}u.overlap!==!0&&o.push({left:x,top:S,right:C,bottom:S+v}),d.classList.toggle("cm-tooltip-above",O),d.classList.toggle("cm-tooltip-below",!O),u.positioned&&u.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=Y_}},{eventObservers:{scroll(){this.maybeMeasure()}}});function lre(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}const QDt=Jt.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),zDt={x:0,y:0},Jq=mn.define({enables:[Zq,QDt]}),XI=mn.define({combine:e=>e.reduce((t,n)=>t.concat(n),[])});class eL{static create(t){return new eL(t)}constructor(t){this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new s4e(t,XI,(n,i)=>this.createHostedView(n,i),n=>n.dom.remove())}createHostedView(t,n){let i=t.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}mount(t){for(let n of this.manager.tooltipViews)n.mount&&n.mount(t);this.mounted=!0}positioned(t){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(t)}update(t){this.manager.update(t)}destroy(){var t;for(let n of this.manager.tooltipViews)(t=n.destroy)===null||t===void 0||t.call(n)}passProp(t){let n;for(let i of this.manager.tooltipViews){let r=i[t];if(r!==void 0){if(n===void 0)n=r;else if(n!==r)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const VDt=Jq.compute([XI],e=>{let t=e.facet(XI);return t.length===0?null:{pos:Math.min(...t.map(n=>n.pos)),end:Math.max(...t.map(n=>{var i;return(i=n.end)!==null&&i!==void 0?i:n.pos})),create:eL.create,above:t[0].above,arrow:t.some(n=>n.arrow)}}),a4e=mn.define();class HDt{constructor(t,n,i,r,s,o){this.view=t,this.source=n,this.field=i,this.locked=r,this.setHover=s,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:t.dom,time:0},this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(t){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let t=Date.now()-this.lastMove.time;to.bottom||n.xo.right+t.defaultCharacterWidth)return;let l=t.bidiSpans(t.state.doc.lineAt(r)).find(u=>u.from<=r&&u.to>=r),c=l&&l.dir==os.RTL?-1:1;s=n.x{if(l&&!(Array.isArray(l)&&!l.length)){let c=Array.isArray(l)?l:[l];r&&this.locked.set(c,r),t.dispatch({effects:this.setHover.of(c)})}};if(s&&"then"in s){let l=this.pending={pos:n};s.then(c=>{this.pending==l&&(this.pending=null,o(c))},c=>Dc(t.state,c,"hover tooltip"))}else o(s)}get tooltip(){let t=this.view.plugin(Zq),n=t?t.manager.tooltips.findIndex(i=>i.create==eL.create):-1;return n>-1?t.manager.tooltipViews[n]:null}mousemove(t){var n,i;this.lastMove={x:t.clientX,y:t.clientY,target:t.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:s}=this;if(r.length&&!this.locked.has(r)&&s&&!qDt(s.dom,t)||this.pending){let{pos:o}=r[0]||this.pending,l=(i=(n=r[0])===null||n===void 0?void 0:n.end)!==null&&i!==void 0?i:o;(o==l?this.view.posAtCoords(this.lastMove)!=o:!WDt(this.view,o,l,t.clientX,t.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(t){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length&&!this.locked.has(n)){let{tooltip:i}=this;i&&i.dom.contains(t.relatedTarget)?this.watchTooltipLeave(i.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(t){let n=i=>{t.removeEventListener("mouseleave",n);let{active:r}=this;r.length&&!this.locked.has(r)&&!this.view.dom.contains(i.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};t.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const Z_=4;function qDt(e,t){let{left:n,right:i,top:r,bottom:s}=e.getBoundingClientRect(),o;if(o=e.querySelector(".cm-tooltip-arrow")){let l=o.getBoundingClientRect();r=Math.min(l.top,r),s=Math.max(l.bottom,s)}return t.clientX>=n-Z_&&t.clientX<=i+Z_&&t.clientY>=r-Z_&&t.clientY<=s+Z_}function WDt(e,t,n,i,r,s){let o=e.scrollDOM.getBoundingClientRect(),l=e.documentTop+e.documentPadding.top+e.contentHeight;if(o.left>i||o.rightr||Math.min(o.bottom,l)=t&&c<=n}function KDt(e,t={}){let n=pi.define(),i=new WeakMap,r=dl.define({create(){return[]},update(o,l){let c=i.get(o);if(o.length&&(t.hideOnChange&&(l.docChanged||l.selection)?o=[]:c&&c(l)?o=[]:t.hideOn&&(o=o.filter(u=>!t.hideOn(l,u)))),l.docChanged&&o.length){let u=[];for(let d of o){let f=l.changes.mapPos(d.pos,-1,il.TrackDel);if(f!=null){let h=Object.assign(Object.create(null),d);h.pos=f,h.end!=null&&(h.end=l.changes.mapPos(h.end)),u.push(h)}}o=u}for(let u of l.effects)u.is(n)&&(o=u.value,c=void 0),(u.is(XDt)&&!u.value||u.value==r)&&(o=[]);return o.length&&c&&i.set(o,c),o},provide:o=>XI.from(o)});const s=ma.define(o=>new HDt(o,e,r,i,n,t.hoverTime||300));return{active:r,extension:[r,s,a4e.of(s),VDt]}}function GDt(e,t,n,i={}){var r;let s=e.state.facet(a4e).map(o=>e.plugin(o)).filter(o=>!!o);if(i.tooltip&&i.tooltip.active){let o=s.find(l=>l.field==i.tooltip.active);o&&(s=[o])}for(let o of s)o.activateHover(e,t,n,(r=i.until)!==null&&r!==void 0?r:()=>!1)}function o4e(e,t){let n=e.plugin(Zq);if(!n)return null;let i=n.manager.tooltips.indexOf(t);return i<0?null:n.manager.tooltipViews[i]}const XDt=pi.define(),cre=mn.define({combine(e){let t,n;for(let i of e)t=t||i.topContainer,n=n||i.bottomContainer;return{topContainer:t,bottomContainer:n}}});function eW(e,t){let n=e.plugin(l4e),i=n?n.specs.indexOf(t):-1;return i>-1?n.panels[i]:null}const l4e=ma.fromClass(class{constructor(e){this.input=e.state.facet(BC),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(e));let t=e.state.facet(cre);this.top=new J_(e,!0,t.topContainer),this.bottom=new J_(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(e){let t=e.state.facet(cre);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new J_(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new J_(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(BC);if(n!=this.input){let i=n.filter(c=>c),r=[],s=[],o=[],l=[];for(let c of i){let u=this.specs.indexOf(c),d;u<0?(d=c(e.view),l.push(d)):(d=this.panels[u],d.update&&d.update(e)),r.push(d),(d.top?s:o).push(d)}this.specs=i,this.panels=r,this.top.sync(s),this.bottom.sync(o);for(let c of l)c.dom.classList.add("cm-panel"),c.mount&&c.mount()}else for(let i of this.panels)i.update&&i.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>Jt.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class J_{constructor(t,n,i){this.view=t,this.top=n,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let n of this.panels)n.destroy&&t.indexOf(n)<0&&n.destroy();this.panels=t,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let t=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;t!=n.dom;)t=ure(t);t=t.nextSibling}else this.dom.insertBefore(n.dom,t);for(;t;)t=ure(t)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let t of this.classes.split(" "))t&&this.container.classList.remove(t);for(let t of(this.classes=this.view.themeClasses).split(" "))t&&this.container.classList.add(t)}}}function ure(e){let t=e.nextSibling;return e.remove(),t}const BC=mn.define({enables:l4e});function YDt(e,t){let n,i=new Promise(o=>n=o),r=o=>ZDt(o,t,n);e.state.field(a$,!1)?e.dispatch({effects:c4e.of(r)}):e.dispatch({effects:pi.appendConfig.of(a$.init(()=>[r]))});let s=u4e.of(r);return{close:s,result:i.then(o=>((e.win.queueMicrotask||(c=>e.win.setTimeout(c,10)))(()=>{e.state.field(a$).indexOf(r)>-1&&e.dispatch({effects:s})}),o))}}const a$=dl.define({create(){return[]},update(e,t){for(let n of t.effects)n.is(c4e)?e=[n.value].concat(e):n.is(u4e)&&(e=e.filter(i=>i!=n.value));return e},provide:e=>BC.computeN([e],t=>t.field(e))}),c4e=pi.define(),u4e=pi.define();function ZDt(e,t,n){let i=t.content?t.content(e,()=>o(null)):null;if(!i){if(i=Kr("form"),t.input){let l=Kr("input",t.input);/^(text|password|number|email|tel|url)$/.test(l.type)&&l.classList.add("cm-textfield"),l.name||(l.name="input"),i.appendChild(Kr("label",(t.label||"")+": ",l))}else i.appendChild(document.createTextNode(t.label||""));i.appendChild(document.createTextNode(" ")),i.appendChild(Kr("button",{class:"cm-button",type:"submit"},t.submitLabel||"OK"))}let r=i.nodeName=="FORM"?[i]:i.querySelectorAll("form");for(let l=0;l{u.keyCode==27?(u.preventDefault(),o(null)):u.keyCode==13&&(u.preventDefault(),o(c))}),c.addEventListener("submit",u=>{u.preventDefault(),o(c)})}let s=Kr("div",i,Kr("button",{onclick:()=>o(null),"aria-label":e.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));t.class&&(s.className=t.class),s.classList.add("cm-dialog");function o(l){s.contains(s.ownerDocument.activeElement)&&e.focus(),n(l)}return{dom:s,top:t.top,mount:()=>{if(t.focus){let l;typeof t.focus=="string"?l=i.querySelector(t.focus):l=i.querySelector("input")||i.querySelector("button"),l&&"select"in l?l.select():l&&"focus"in l&&l.focus()}}}}class im extends fb{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}im.prototype.elementClass="";im.prototype.toDOM=void 0;im.prototype.mapMode=il.TrackBefore;im.prototype.startSide=im.prototype.endSide=-1;im.prototype.point=!0;const QN=mn.define(),JDt=mn.define(),eMt={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Ki.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},SE=mn.define();function tMt(e){return[d4e(),SE.of({...eMt,...e})]}const dre=mn.define({combine:e=>e.some(t=>t)});function d4e(e){return[nMt]}const nMt=ma.fromClass(class{constructor(e){this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=e.state.facet(SE).map(t=>new hre(e,t)),this.fixed=!e.state.facet(dre);for(let t of this.gutters)t.config.side=="after"?this.getDOMAfter().appendChild(t.dom):this.dom.appendChild(t.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,i=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(i<(n.to-n.from)*.8)}if(e.geometryChanged){let t=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=t,this.domAfter&&(this.domAfter.style.minHeight=t)}this.view.state.facet(dre)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=Ki.iter(this.view.state.facet(QN),this.view.viewport.from),i=[],r=this.gutters.map(s=>new iMt(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(s.type)){let o=!0;for(let l of s.type)if(l.type==ol.Text&&o){J9(n,i,l.from);for(let c of r)c.line(this.view,l,i);o=!1}else if(l.widget)for(let c of r)c.widget(this.view,l)}else if(s.type==ol.Text){J9(n,i,s.from);for(let o of r)o.line(this.view,s,i)}else if(s.widget)for(let o of r)o.widget(this.view,s);for(let s of r)s.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(SE),n=e.state.facet(SE),i=e.docChanged||e.heightChanged||e.viewportChanged||!Ki.eq(e.startState.facet(QN),e.state.facet(QN),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let r of this.gutters)r.update(e)&&(i=!0);else{i=!0;let r=[];for(let s of n){let o=t.indexOf(s);o<0?r.push(new hre(this.view,s)):(this.gutters[o].update(e),r.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),r.indexOf(s)<0&&s.destroy();for(let s of r)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=r}return i}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>Jt.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||n.gutters.length==0||!n.fixed)return null;let i=n.dom.offsetWidth*t.scaleX,r=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==os.LTR?{left:i,right:r}:{right:i,left:r}})});function fre(e){return Array.isArray(e)?e:[e]}function J9(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class iMt{constructor(t,n,i){this.gutter=t,this.height=i,this.i=0,this.cursor=Ki.iter(t.markers,n.from)}addElement(t,n,i){let{gutter:r}=this,s=(n.top-this.height)/t.scaleY,o=n.height/t.scaleY;if(this.i==r.elements.length){let l=new f4e(t,o,s,i);r.elements.push(l),r.dom.appendChild(l.dom)}else r.elements[this.i].update(t,o,s,i);this.height=n.bottom,this.i++}line(t,n,i){let r=[];J9(this.cursor,r,n.from),i.length&&(r=r.concat(i));let s=this.gutter.config.lineMarker(t,n,r);s&&r.unshift(s);let o=this.gutter;r.length==0&&!o.config.renderEmptyElements||this.addElement(t,n,r)}widget(t,n){let i=this.gutter.config.widgetMarker(t,n.widget,n),r=i?[i]:null;for(let s of t.state.facet(JDt)){let o=s(t,n.widget,n);o&&(r||(r=[])).push(o)}r&&this.addElement(t,n,r)}finish(){let t=this.gutter;for(;t.elements.length>this.i;){let n=t.elements.pop();t.dom.removeChild(n.dom),n.destroy()}}}class hre{constructor(t,n){this.view=t,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in n.domEventHandlers)this.dom.addEventListener(i,r=>{let s=r.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let c=s.getBoundingClientRect();o=(c.top+c.bottom)/2}else o=r.clientY;let l=t.lineBlockAtHeight(o-t.documentTop);n.domEventHandlers[i](t,l,r)&&r.preventDefault()});this.markers=fre(n.markers(t)),n.initialSpacer&&(this.spacer=new f4e(t,0,0,[n.initialSpacer(t)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(t){let n=this.markers;if(this.markers=fre(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],t);r!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[r])}let i=t.view.viewport;return!Ki.eq(this.markers,n,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(t):!1)}destroy(){for(let t of this.elements)t.destroy()}}class f4e{constructor(t,n,i,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(t,n,i,r)}update(t,n,i,r){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),rMt(this.markers,r)||this.setMarkers(t,r)}setMarkers(t,n){let i="cm-gutterElement",r=this.dom.firstChild;for(let s=0,o=0;;){let l=o,c=ss(l,c,u)||o(l,c,u):o}return i}})}});class o$ extends im{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function l$(e,t){return e.state.facet(Bx).formatNumber(t,e.state)}const oMt=SE.compute([Bx],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(t){return t.state.facet(sMt)},lineMarker(t,n,i){return i.some(r=>r.toDOM)?null:new o$(l$(t,t.state.doc.lineAt(n.from).number))},widgetMarker:(t,n,i)=>{for(let r of t.state.facet(aMt)){let s=r(t,n,i);if(s)return s}return null},lineMarkerChange:t=>t.startState.facet(Bx)!=t.state.facet(Bx),initialSpacer(t){return new o$(l$(t,pre(t.state.doc.lines)))},updateSpacer(t,n){let i=l$(n.view,pre(n.view.state.doc.lines));return i==t.number?t:new o$(i)},domEventHandlers:e.facet(Bx).domEventHandlers,side:"before"}));function h4e(e={}){return[Bx.of(e),d4e(),oMt]}function pre(e){let t=9;for(;t{let t=[],n=-1;for(let i of e.selection.ranges){let r=e.doc.lineAt(i.head).from;r>n&&(n=r,t.push(lMt.range(r)))}return Ki.of(t)});function uMt(){return cMt}let dMt=0,Xf=class e7{constructor(t,n,i,r){this.name=t,this.set=n,this.base=i,this.modified=r,this.id=dMt++}toString(){let{name:t}=this;for(let n of this.modified)n.name&&(t=`${n.name}(${t})`);return t}static define(t,n){let i=typeof t=="string"?t:"?";if(t instanceof e7&&(n=t),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let r=new e7(i,[],null,[]);if(r.set.push(r),n)for(let s of n.set)r.set.push(s);return r}static defineModifier(t){let n=new YI(t);return i=>i.modified.indexOf(n)>-1?i:YI.get(i.base||i,i.modified.concat(n).sort((r,s)=>r.id-s.id))}},fMt=0;class YI{constructor(t){this.name=t,this.instances=[],this.id=fMt++}static get(t,n){if(!n.length)return t;let i=n[0].instances.find(l=>l.base==t&&hMt(n,l.modified));if(i)return i;let r=[],s=new Xf(t.name,r,t,n);for(let l of n)l.instances.push(s);let o=pMt(n);for(let l of t.set)if(!l.modified.length)for(let c of o)r.push(YI.get(l,c));return s}}function hMt(e,t){return e.length==t.length&&e.every((n,i)=>n==t[i])}function pMt(e){let t=[[]];for(let n=0;ni.length-n.length)}function bm(e){let t=Object.create(null);for(let n in e){let i=e[n];Array.isArray(i)||(i=[i]);for(let r of n.split(" "))if(r){let s=[],o=2,l=r;for(let f=0;;){if(l=="..."&&f>0&&f+3==r.length){o=1;break}let h=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!h)throw new RangeError("Invalid path: "+r);if(s.push(h[0]=="*"?"":h[0][0]=='"'?JSON.parse(h[0]):h[0]),f+=h[0].length,f==r.length)break;let m=r[f++];if(f==r.length&&m=="!"){o=0;break}if(m!="/")throw new RangeError("Invalid path: "+r);l=r.slice(f)}let c=s.length-1,u=s[c];if(!u)throw new RangeError("Invalid path: "+r);let d=new UC(i,o,c>0?s.slice(0,c):null);t[u]=d.sort(t[u])}}return p4e.add(t)}const p4e=new ui({combine(e,t){let n,i,r;for(;e||t;){if(!e||t&&e.depth>=t.depth?(r=t,t=t.next):(r=e,e=e.next),n&&n.mode==r.mode&&!r.context&&!n.context)continue;let s=new UC(r.tags,r.mode,r.context);n?n.next=s:i=s,n=s}return i}});let UC=class{constructor(t,n,i,r){this.tags=t,this.mode=n,this.context=i,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(t){return!t||t.depth{let o=r;for(let l of s)for(let c of l.set){let u=n[c.id];if(u){o=o?o+" "+u:u;break}}return o},scope:i}}function mMt(e,t){let n=null;for(let i of e){let r=i.style(t);r&&(n=n?n+" "+r:r)}return n}function gMt(e,t,n,i=0,r=e.length){let s=new bMt(i,Array.isArray(t)?t:[t],n);s.highlightRange(e.cursor(),i,r,"",s.highlighters),s.flush(r)}class bMt{constructor(t,n,i){this.at=t,this.highlighters=n,this.span=i,this.class=""}startSpan(t,n){n!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=n)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,n,i,r,s){let{type:o,from:l,to:c}=t;if(l>=i||c<=n)return;o.isTop&&(s=this.highlighters.filter(m=>!m.scope||m.scope(o)));let u=r,d=yMt(t)||UC.empty,f=mMt(s,d.tags);if(f&&(u&&(u+=" "),u+=f,d.mode==1&&(r+=(r?" ":"")+f)),this.startSpan(Math.max(n,l),u),d.opaque)return;let h=t.tree&&t.tree.prop(ui.mounted);if(h&&h.overlay){let m=t.node.enter(h.overlay[0].from+l,1),g=this.highlighters.filter(v=>!v.scope||v.scope(h.tree.type)),b=t.firstChild();for(let v=0,y=l;;v++){let w=v=x||!t.nextSibling())););if(!w||x>i)break;y=w.to+l,y>n&&(this.highlightRange(m.cursor(),Math.max(n,w.from+l),Math.min(i,y),"",g),this.startSpan(Math.min(i,y),u))}b&&t.parent()}else if(t.firstChild()){h&&(r="");do if(!(t.to<=n)){if(t.from>=i)break;this.highlightRange(t,n,i,r,s),this.startSpan(Math.min(i,t.to),u)}while(t.nextSibling());t.parent()}}}function yMt(e){let t=e.type.prop(p4e);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}const an=Xf.define,ej=an(),Xm=an(),mre=an(Xm),gre=an(Xm),Ym=an(),tj=an(Ym),c$=an(Ym),Wf=an(),ey=an(Wf),zf=an(),Vf=an(),t7=an(),Sk=an(t7),nj=an(),fe={comment:ej,lineComment:an(ej),blockComment:an(ej),docComment:an(ej),name:Xm,variableName:an(Xm),typeName:mre,tagName:an(mre),propertyName:gre,attributeName:an(gre),className:an(Xm),labelName:an(Xm),namespace:an(Xm),macroName:an(Xm),literal:Ym,string:tj,docString:an(tj),character:an(tj),attributeValue:an(tj),number:c$,integer:an(c$),float:an(c$),bool:an(Ym),regexp:an(Ym),escape:an(Ym),color:an(Ym),url:an(Ym),keyword:zf,self:an(zf),null:an(zf),atom:an(zf),unit:an(zf),modifier:an(zf),operatorKeyword:an(zf),controlKeyword:an(zf),definitionKeyword:an(zf),moduleKeyword:an(zf),operator:Vf,derefOperator:an(Vf),arithmeticOperator:an(Vf),logicOperator:an(Vf),bitwiseOperator:an(Vf),compareOperator:an(Vf),updateOperator:an(Vf),definitionOperator:an(Vf),typeOperator:an(Vf),controlOperator:an(Vf),punctuation:t7,separator:an(t7),bracket:Sk,angleBracket:an(Sk),squareBracket:an(Sk),paren:an(Sk),brace:an(Sk),content:Wf,heading:ey,heading1:an(ey),heading2:an(ey),heading3:an(ey),heading4:an(ey),heading5:an(ey),heading6:an(ey),contentSeparator:an(Wf),list:an(Wf),quote:an(Wf),emphasis:an(Wf),strong:an(Wf),link:an(Wf),monospace:an(Wf),strikethrough:an(Wf),inserted:an(),deleted:an(),changed:an(),invalid:an(),meta:nj,documentMeta:an(nj),annotation:an(nj),processingInstruction:an(nj),definition:Xf.defineModifier("definition"),constant:Xf.defineModifier("constant"),function:Xf.defineModifier("function"),standard:Xf.defineModifier("standard"),local:Xf.defineModifier("local"),special:Xf.defineModifier("special")};for(let e in fe){let t=fe[e];t instanceof Xf&&(t.name=e)}m4e([{tag:fe.link,class:"tok-link"},{tag:fe.heading,class:"tok-heading"},{tag:fe.emphasis,class:"tok-emphasis"},{tag:fe.strong,class:"tok-strong"},{tag:fe.keyword,class:"tok-keyword"},{tag:fe.atom,class:"tok-atom"},{tag:fe.bool,class:"tok-bool"},{tag:fe.url,class:"tok-url"},{tag:fe.labelName,class:"tok-labelName"},{tag:fe.inserted,class:"tok-inserted"},{tag:fe.deleted,class:"tok-deleted"},{tag:fe.literal,class:"tok-literal"},{tag:fe.string,class:"tok-string"},{tag:fe.number,class:"tok-number"},{tag:[fe.regexp,fe.escape,fe.special(fe.string)],class:"tok-string2"},{tag:fe.variableName,class:"tok-variableName"},{tag:fe.local(fe.variableName),class:"tok-variableName tok-local"},{tag:fe.definition(fe.variableName),class:"tok-variableName tok-definition"},{tag:fe.special(fe.variableName),class:"tok-variableName2"},{tag:fe.definition(fe.propertyName),class:"tok-propertyName tok-definition"},{tag:fe.typeName,class:"tok-typeName"},{tag:fe.namespace,class:"tok-namespace"},{tag:fe.className,class:"tok-className"},{tag:fe.macroName,class:"tok-macroName"},{tag:fe.propertyName,class:"tok-propertyName"},{tag:fe.operator,class:"tok-operator"},{tag:fe.comment,class:"tok-comment"},{tag:fe.meta,class:"tok-meta"},{tag:fe.invalid,class:"tok-invalid"},{tag:fe.punctuation,class:"tok-punctuation"}]);var u$;const wg=new ui;function tL(e){return mn.define({combine:e?t=>t.concat(e):void 0})}const tW=new ui;class Ou{constructor(t,n,i=[],r=""){this.data=t,this.name=r,tr.prototype.hasOwnProperty("tree")||Object.defineProperty(tr.prototype,"tree",{get(){return Yr(this)}}),this.parser=n,this.extension=[gb.of(this),tr.languageData.of((s,o,l)=>{let c=bre(s,o,l),u=c.type.prop(wg);if(!u)return[];let d=s.facet(u),f=c.type.prop(tW);if(f){let h=c.resolve(o-c.from,l);for(let m of f)if(m.test(h,s)){let g=s.facet(m.facet);return m.type=="replace"?g:g.concat(d)}}return d})].concat(i)}isActiveAt(t,n,i=-1){return bre(t,n,i).type.prop(wg)==this.data}findRegions(t){let n=t.facet(gb);if((n==null?void 0:n.data)==this.data)return[{from:0,to:t.doc.length}];if(!n||!n.allowsNesting)return[];let i=[],r=(s,o)=>{if(s.prop(wg)==this.data){i.push({from:o,to:o+s.length});return}let l=s.prop(ui.mounted);if(l){if(l.tree.prop(wg)==this.data){if(l.overlay)for(let c of l.overlay)i.push({from:c.from+o,to:c.to+o});else i.push({from:o,to:o+s.length});return}else if(l.overlay){let c=i.length;if(r(l.tree,l.overlay[0].from+o),i.length>c)return}}for(let c=0;ci.isTop?n:void 0)]}),t.name)}configure(t,n){return new rm(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Yr(e){let t=e.field(Ou.state,!1);return t?t.tree:Bi.empty}class vMt{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,n){let i=this.cursorPos-this.string.length;return t=this.cursorPos?this.doc.sliceString(t,n):this.string.slice(t-i,n-i)}}let Ek=null;class k0{constructor(t,n,i=[],r,s,o,l,c){this.parser=t,this.state=n,this.fragments=i,this.tree=r,this.treeLen=s,this.viewport=o,this.skipped=l,this.scheduleOn=c,this.parse=null,this.tempSkipped=[]}static create(t,n,i){return new k0(t,n,[],Bi.empty,0,i,[],null)}startParse(){return this.parser.startParse(new vMt(this.state.doc),this.fragments)}work(t,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Bi.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof t=="number"){let r=Date.now()+t;t=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=t,this.tree=n,this.fragments=this.withoutTempSkipped(Bp.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let n=Ek;Ek=this;try{return t()}finally{Ek=n}}withoutTempSkipped(t){for(let n;n=this.tempSkipped.pop();)t=yre(t,n.from,n.to);return t}changes(t,n){let{fragments:i,tree:r,treeLen:s,viewport:o,skipped:l}=this;if(this.takeTree(),!t.empty){let c=[];if(t.iterChangedRanges((u,d,f,h)=>c.push({fromA:u,toA:d,fromB:f,toB:h})),i=Bp.applyChanges(i,c),r=Bi.empty,s=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){l=[];for(let u of this.skipped){let d=t.mapPos(u.from,1),f=t.mapPos(u.to,-1);dt.from&&(this.fragments=yre(this.fragments,r,s),this.skipped.splice(i--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,n){this.skipped.push({from:t,to:n})}static getSkippingParser(t){return new class extends WM{createParse(n,i,r){let s=r[0].from,o=r[r.length-1].to;return{parsedPos:s,advance(){let c=Ek;if(c){for(let u of r)c.tempSkipped.push(u);t&&(c.scheduleOn=c.scheduleOn?Promise.all([c.scheduleOn,t]):t)}return this.parsedPos=o,new Bi(Za.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let n=this.fragments;return this.treeLen>=t&&n.length&&n[0].from==0&&n[0].to>=t}static get(){return Ek}}function yre(e,t,n){return Bp.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class p1{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),i=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,i)||n.takeTree(),new p1(n)}static init(t){let n=Math.min(3e3,t.doc.length),i=k0.create(t.facet(gb).parser,t,{from:0,to:n});return i.work(20,n)||i.takeTree(),new p1(i)}}Ou.state=dl.define({create:p1.init,update(e,t){for(let n of t.effects)if(n.is(Ou.setState))return n.value;return t.startState.facet(gb)!=t.state.facet(gb)?p1.init(t.state):e.apply(t)}});let g4e=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&(g4e=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const d$=typeof navigator<"u"&&(!((u$=navigator.scheduling)===null||u$===void 0)&&u$.isInputPending)?()=>navigator.scheduling.isInputPending():null,xMt=ma.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let n=this.view.state.field(Ou.state).context;(n.updateViewport(t.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:t}=this.view,n=t.field(Ou.state);(n.tree!=n.context.tree||!n.context.isDone(t.doc.length))&&(this.working=g4e(this.work))}work(t){this.working=null;let n=Date.now();if(this.chunkEndr+1e3,c=s.context.work(()=>d$&&d$()||Date.now()>o,r+(l?0:1e5));this.chunkBudget-=Date.now()-n,(c||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:Ou.setState.of(new p1(s.context))})),this.chunkBudget>0&&!(c&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Dc(this.view.state,n)).then(()=>this.workScheduled--),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),gb=mn.define({combine(e){return e.length?e[0]:null},enables:e=>[Ou.state,xMt,Jt.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class bb{constructor(t,n=[]){this.language=t,this.support=n,this.extension=[t,n]}}class ZI{constructor(t,n,i,r,s,o=void 0){this.name=t,this.alias=n,this.extensions=i,this.filename=r,this.loadFunc=s,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(t=>this.support=t,t=>{throw this.loading=null,t}))}static of(t){let{load:n,support:i}=t;if(!n){if(!i)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");n=()=>Promise.resolve(i)}return new ZI(t.name,(t.alias||[]).concat(t.name).map(r=>r.toLowerCase()),t.extensions||[],t.filename,n,i)}static matchFilename(t,n){for(let r of t)if(r.filename&&r.filename.test(n))return r;let i=/\.([^.]+)$/.exec(n);if(i){for(let r of t)if(r.extensions.indexOf(i[1])>-1)return r}return null}static matchLanguageName(t,n,i=!0){n=n.toLowerCase();for(let r of t)if(r.alias.some(s=>s==n))return r;if(i)for(let r of t)for(let s of r.alias){let o=n.indexOf(s);if(o>-1&&(s.length>2||!/\w/.test(n[o-1])&&!/\w/.test(n[o+s.length])))return r}return null}}const wMt=mn.define(),pO=mn.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(n=>n!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function S0(e){let t=e.facet(pO);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function QC(e,t){let n="",i=e.tabSize,r=e.facet(pO)[0];if(r==" "){for(;t>=i;)n+=" ",t-=i;r=" "}for(let s=0;s=t?OMt(e,n,t):null}class nL{constructor(t,n={}){this.state=t,this.options=n,this.unit=S0(t)}lineAt(t,n=1){let i=this.state.doc.lineAt(t),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=i.from&&r<=i.to?s&&r==t?{text:"",from:t}:(n<0?r-1&&(s+=o-this.countColumn(i,i.search(/\S|$/))),s}countColumn(t,n=t.length){return wf(t,this.state.tabSize,n)}lineIndent(t,n=1){let{text:i,from:r}=this.lineAt(t,n),s=this.options.overrideIndentation;if(s){let o=s(r);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const ym=new ui;function OMt(e,t,n){let i=t.resolveStack(n),r=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(r!=i.node){let s=[];for(let o=r;o&&!(o.fromi.node.to||o.from==i.node.from&&o.type==i.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)i={node:s[o],next:i}}return b4e(i,e,n)}function b4e(e,t,n){for(let i=e;i;i=i.next){let r=SMt(i.node);if(r)return r(iW.create(t,n,i))}return 0}function kMt(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function SMt(e){let t=e.type.prop(ym);if(t)return t;let n=e.firstChild,i;if(n&&(i=n.type.prop(ui.closedBy))){let r=e.lastChild,s=r&&i.indexOf(r.name)>-1;return o=>y4e(o,!0,1,void 0,s&&!kMt(o)?r.from:void 0)}return e.parent==null?EMt:null}function EMt(){return 0}class iW extends nL{constructor(t,n,i){super(t.state,t.options),this.base=t,this.pos=n,this.context=i}get node(){return this.context.node}static create(t,n,i){return new iW(t,n,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let n=this.state.doc.lineAt(t.from);for(;;){let i=t.resolve(n.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(CMt(i,t))break;n=this.state.doc.lineAt(i.from)}return this.lineIndent(n.from)}continue(){return b4e(this.context.next,this.base,this.pos)}}function CMt(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function AMt(e){let t=e.node,n=t.childAfter(t.from),i=t.lastChild;if(!n)return null;let r=e.options.simulateBreak,s=e.state.doc.lineAt(n.from),o=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let l=n.to;;){let c=t.childAfter(l);if(!c||c==i)return null;if(!c.type.isSkipped){if(c.from>=o)return null;let u=/^ */.exec(s.text.slice(n.to-s.from))[0].length;return{from:n.from,to:n.to+u}}l=c.to}}function xw({closing:e,align:t=!0,units:n=1}){return i=>y4e(i,t,n,e)}function y4e(e,t,n,i,r){let s=e.textAfter,o=s.match(/^\s*/)[0].length,l=i&&s.slice(o,o+i.length)==i||r==e.pos+o,c=t?AMt(e):null;return c?l?e.column(c.from):e.column(c.to):e.baseIndent+(l?0:e.unit*n)}const TMt=e=>e.baseIndent;function ww({except:e,units:t=1}={}){return n=>{let i=e&&e.test(n.textAfter);return n.baseIndent+(i?0:t*n.unit)}}const _Mt=200;function jMt(){return tr.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:i}=e.newSelection.main,r=n.lineAt(i);if(i>r.from+_Mt)return e;let s=n.sliceString(r.from,i);if(!t.some(u=>u.test(s)))return e;let{state:o}=e,l=-1,c=[];for(let{head:u}of o.selection.ranges){let d=o.doc.lineAt(u);if(d.from==l)continue;l=d.from;let f=nW(o,d.from);if(f==null)continue;let h=/^\s*/.exec(d.text)[0],m=QC(o,f);h!=m&&c.push({from:d.from,to:d.from+h.length,insert:m})}return c.length?[e,{changes:c,sequential:!0}]:e})}const v4e=mn.define(),vm=new ui;function jT(e){let t=e.firstChild,n=e.lastChild;return t&&t.ton)continue;if(s&&l.from=t&&u.to>n&&(s=u)}}return s}function RMt(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function JI(e,t,n){for(let i of e.facet(v4e)){let r=i(e,t,n);if(r)return r}return NMt(e,t,n)}function x4e(e,t){let n=t.mapPos(e.from,1),i=t.mapPos(e.to,-1);return n>=i?void 0:{from:n,to:i}}const iL=pi.define({map:x4e}),NT=pi.define({map:x4e});function w4e(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(i=>i.from<=n&&i.to>=n)||t.push(e.lineBlockAt(n));return t}const E0=dl.define({create(){return Fn.none},update(e,t){t.isUserEvent("delete")&&t.changes.iterChangedRanges((i,r)=>e=vre(e,i,r)),e=e.map(t.changes);let n=[];for(let i of t.effects)i.is(iL)&&!IMt(e,i.value.from,i.value.to)?n.push(i.value):i.is(NT)&&(e=e.update({filter:(r,s)=>i.value.from!=r||i.value.to!=s,filterFrom:i.value.from,filterTo:i.value.to}));if(n.length){let{preparePlaceholder:i}=t.state.facet(S4e),r=n.map(s=>(i?Fn.replace({widget:new BMt(i(t.state,s))}):xre).range(s.from,s.to));e=e.update({add:r})}return t.selection&&(e=vre(e,t.selection.main.head)),e},provide:e=>Jt.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(i,r)=>{n.push(i,r)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n{rt&&(i=!0)}),i?e.update({filterFrom:t,filterTo:n,filter:(r,s)=>r>=n||s<=t}):e}function eP(e,t,n){var i;let r=null;return(i=e.field(E0,!1))===null||i===void 0||i.between(t,n,(s,o)=>{(!r||r.from>s)&&(r={from:s,to:o})}),r}function IMt(e,t,n){let i=!1;return e.between(t,t,(r,s)=>{r==t&&s==n&&(i=!0)}),i}function O4e(e,t){return e.field(E0,!1)?t:t.concat(pi.appendConfig.of(E4e()))}const PMt=e=>{for(let t of w4e(e)){let n=JI(e.state,t.from,t.to);if(n)return e.dispatch({effects:O4e(e.state,[iL.of(n),k4e(e,n)])}),!0}return!1},DMt=e=>{if(!e.state.field(E0,!1))return!1;let t=[];for(let n of w4e(e)){let i=eP(e.state,n.from,n.to);i&&t.push(NT.of(i),k4e(e,i,!1))}return t.length&&e.dispatch({effects:t}),t.length>0};function k4e(e,t,n=!0){let i=e.state.doc.lineAt(t.from).number,r=e.state.doc.lineAt(t.to).number;return Jt.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${i} ${e.state.phrase("to")} ${r}.`)}const MMt=e=>{let{state:t}=e,n=[];for(let i=0;i{let t=e.state.field(E0,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(i,r)=>{n.push(NT.of({from:i,to:r}))}),e.dispatch({effects:n}),!0},$Mt=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:PMt},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:DMt},{key:"Ctrl-Alt-[",run:MMt},{key:"Ctrl-Alt-]",run:LMt}],FMt={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},S4e=mn.define({combine(e){return Ih(e,FMt)}});function E4e(e){return[E0,zMt]}function C4e(e,t){let{state:n}=e,i=n.facet(S4e),r=o=>{let l=e.lineBlockAt(e.posAtDOM(o.target)),c=eP(e.state,l.from,l.to);c&&e.dispatch({effects:NT.of(c)}),o.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(e,r,t);let s=document.createElement("span");return s.textContent=i.placeholderText,s.setAttribute("aria-label",n.phrase("folded code")),s.title=n.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=r,s}const xre=Fn.replace({widget:new class extends jf{toDOM(e){return C4e(e,null)}}});class BMt extends jf{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return C4e(t,this.value)}}const UMt={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class f$ extends im{constructor(t,n){super(),this.config=t,this.open=n}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=t.state.phrase(this.open?"Fold line":"Unfold line"),n}}function QMt(e={}){let t={...UMt,...e},n=new f$(t,!0),i=new f$(t,!1),r=ma.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(gb)!=o.state.facet(gb)||o.startState.field(E0,!1)!=o.state.field(E0,!1)||Yr(o.startState)!=Yr(o.state)||t.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new tm;for(let c of o.viewportLineBlocks){let u=eP(o.state,c.from,c.to)?i:JI(o.state,c.from,c.to)?n:null;u&&l.add(c.from,c.from,u)}return l.finish()}}),{domEventHandlers:s}=t;return[r,tMt({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(r))===null||l===void 0?void 0:l.markers)||Ki.empty},initialSpacer(){return new f$(t,!1)},domEventHandlers:{...s,click:(o,l,c)=>{if(s.click&&s.click(o,l,c))return!0;let u=eP(o.state,l.from,l.to);if(u)return o.dispatch({effects:NT.of(u)}),!0;let d=JI(o.state,l.from,l.to);return d?(o.dispatch({effects:iL.of(d)}),!0):!1}}}),E4e()]}const zMt=Jt.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class RT{constructor(t,n){this.specs=t;let i;function r(l){let c=hb.newName();return(i||(i=Object.create(null)))["."+c]=l,c}const s=typeof n.all=="string"?n.all:n.all?r(n.all):void 0,o=n.scope;this.scope=o instanceof Ou?l=>l.prop(wg)==o.data:o?l=>l==o:void 0,this.style=m4e(t.map(l=>({tag:l.tag,class:l.class||r(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=i?new hb(i):null,this.themeType=n.themeType}static define(t,n){return new RT(t,n||{})}}const n7=mn.define(),A4e=mn.define({combine(e){return e.length?[e[0]]:null}});function zN(e){let t=e.facet(n7);return t.length?t:e.facet(A4e)}function T4e(e,t){let n=[HMt],i;return e instanceof RT&&(e.module&&n.push(Jt.styleModule.of(e.module)),i=e.themeType),t!=null&&t.fallback?n.push(A4e.of(e)):i?n.push(n7.computeN([Jt.darkTheme],r=>r.facet(Jt.darkTheme)==(i=="dark")?[e]:[])):n.push(n7.of(e)),n}function Bhn(e,t,n){let i=zN(e),r=null;if(i){for(let s of i)if(!s.scope||n){let o=s.style(t);o&&(r=r?r+" "+o:o)}}return r}class VMt{constructor(t){this.markCache=Object.create(null),this.tree=Yr(t.state),this.decorations=this.buildDeco(t,zN(t.state)),this.decoratedTo=t.viewport.to}update(t){let n=Yr(t.state),i=zN(t.state),r=i!=zN(t.startState),{viewport:s}=t.view,o=t.changes.mapPos(this.decoratedTo,1);n.length=s.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=o):(n!=this.tree||t.viewportChanged||r)&&(this.tree=n,this.decorations=this.buildDeco(t.view,i),this.decoratedTo=s.to)}buildDeco(t,n){if(!n||!this.tree.length)return Fn.none;let i=new tm;for(let{from:r,to:s}of t.visibleRanges)gMt(this.tree,n,(o,l,c)=>{i.add(o,l,this.markCache[c]||(this.markCache[c]=Fn.mark({class:c})))},r,s);return i.finish()}}const HMt=gm.high(ma.fromClass(VMt,{decorations:e=>e.decorations})),qMt=RT.define([{tag:fe.meta,color:"#404740"},{tag:fe.link,textDecoration:"underline"},{tag:fe.heading,textDecoration:"underline",fontWeight:"bold"},{tag:fe.emphasis,fontStyle:"italic"},{tag:fe.strong,fontWeight:"bold"},{tag:fe.strikethrough,textDecoration:"line-through"},{tag:fe.keyword,color:"#708"},{tag:[fe.atom,fe.bool,fe.url,fe.contentSeparator,fe.labelName],color:"#219"},{tag:[fe.literal,fe.inserted],color:"#164"},{tag:[fe.string,fe.deleted],color:"#a11"},{tag:[fe.regexp,fe.escape,fe.special(fe.string)],color:"#e40"},{tag:fe.definition(fe.variableName),color:"#00f"},{tag:fe.local(fe.variableName),color:"#30a"},{tag:[fe.typeName,fe.namespace],color:"#085"},{tag:fe.className,color:"#167"},{tag:[fe.special(fe.variableName),fe.macroName],color:"#256"},{tag:fe.definition(fe.propertyName),color:"#00c"},{tag:fe.comment,color:"#940"},{tag:fe.invalid,color:"#f00"}]),WMt=Jt.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),_4e=1e4,j4e="()[]{}",N4e=mn.define({combine(e){return Ih(e,{afterCursor:!0,brackets:j4e,maxScanDistance:_4e,renderMatch:XMt})}}),KMt=Fn.mark({class:"cm-matchingBracket"}),GMt=Fn.mark({class:"cm-nonmatchingBracket"});function XMt(e){let t=[],n=e.matched?KMt:GMt;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}function wre(e){let t=[],n=e.facet(N4e);for(let i of e.selection.ranges){if(!i.empty)continue;let r=ch(e,i.head,-1,n)||i.head>0&&ch(e,i.head-1,1,n)||n.afterCursor&&(ch(e,i.head,1,n)||i.heade.decorations}),ZMt=[YMt,WMt];function JMt(e={}){return[N4e.of(e),ZMt]}const R4e=new ui;function i7(e,t,n){let i=e.prop(t<0?ui.openedBy:ui.closedBy);if(i)return i;if(e.name.length==1){let r=n.indexOf(e.name);if(r>-1&&r%2==(t<0?1:0))return[n[r+t]]}return null}function r7(e){let t=e.type.prop(R4e);return t?t(e.node):e}function ch(e,t,n,i={}){let r=i.maxScanDistance||_4e,s=i.brackets||j4e,o=Yr(e),l=o.resolveInner(t,n);for(let c=l;c;c=c.parent){let u=i7(c.type,n,s);if(u&&c.from0?t>=d.from&&td.from&&t<=d.to))return eLt(e,t,n,c,d,u,s)}}return tLt(e,t,n,o,l.type,r,s)}function eLt(e,t,n,i,r,s,o){let l=i.parent,c={from:r.from,to:r.to},u=0,d=l==null?void 0:l.cursor();if(d&&(n<0?d.childBefore(i.from):d.childAfter(i.to)))do if(n<0?d.to<=i.from:d.from>=i.to){if(u==0&&s.indexOf(d.type.name)>-1&&d.from0)return null;let u={from:n<0?t-1:t,to:n>0?t+1:t},d=e.doc.iterRange(t,n>0?e.doc.length:0),f=0;for(let h=0;!d.next().done&&h<=s;){let m=d.value;n<0&&(h+=m.length);let g=t+h*n;for(let b=n>0?0:m.length-1,v=n>0?m.length:-1;b!=v;b+=n){let y=o.indexOf(m[b]);if(!(y<0||i.resolveInner(g+b,1).type!=r))if(y%2==0==n>0)f++;else{if(f==1)return{start:u,end:{from:g+b,to:g+b+1},matched:y>>1==c>>1};f--}}n>0&&(h+=m.length)}return d.done?{start:u,matched:!1}:null}function Ore(e,t,n,i=0,r=0){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));let s=r;for(let o=i;o=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.posn}eatSpace(){let t=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t}skipToEnd(){this.pos=this.string.length}skipTo(t){let n=this.string.indexOf(t,this.pos);if(n>-1)return this.pos=n,!0}backUp(t){this.pos-=t}column(){return this.lastColumnPosi?o.toLowerCase():o,s=this.string.substr(this.pos,t.length);return r(s)==r(t)?(n!==!1&&(this.pos+=t.length),!0):null}else{let r=this.string.slice(this.pos).match(t);return r&&r.index>0?null:(r&&n!==!1&&(this.pos+=r[0].length),r)}}current(){return this.string.slice(this.start,this.pos)}}function nLt(e){return{name:e.name||"",token:e.token,blankLine:e.blankLine||(()=>{}),startState:e.startState||(()=>!0),copyState:e.copyState||iLt,indent:e.indent||(()=>null),languageData:e.languageData||{},tokenTable:e.tokenTable||aW,mergeTokens:e.mergeTokens!==!1}}function iLt(e){if(typeof e!="object")return e;let t={};for(let n in e){let i=e[n];t[n]=i instanceof Array?i.slice():i}return t}const kre=new WeakMap;class rW extends Ou{constructor(t){let n=tL(t.languageData),i=nLt(t),r,s=new class extends WM{createParse(o,l,c){return new sLt(r,o,l,c)}};super(n,s,[],t.name),this.topNode=lLt(n,this),r=this,this.streamParser=i,this.stateAfter=new ui({perNode:!0}),this.tokenTable=t.tokenTable?new L4e(i.tokenTable):oLt}static define(t){return new rW(t)}getIndent(t){let n,{overrideIndentation:i}=t.options;i&&(n=kre.get(t.state),n!=null&&n1e4)return null;for(;s=i&&n+t.length<=r&&t.prop(e.stateAfter);if(s)return{state:e.streamParser.copyState(s),pos:n+t.length};for(let o=t.children.length-1;o>=0;o--){let l=t.children[o],c=n+t.positions[o],u=l instanceof Bi&&c=t.length)return t;!r&&n==0&&t.type==e.topNode&&(r=!0);for(let s=t.children.length-1;s>=0;s--){let o=t.positions[s],l=t.children[s],c;if(on&&sW(e,s.tree,0-s.offset,n,l),u;if(c&&c.pos<=i&&(u=P4e(e,s.tree,n+s.offset,c.pos+s.offset,!1)))return{state:c.state,tree:u}}return{state:e.streamParser.startState(r?S0(r):4),tree:Bi.empty}}let sLt=class{constructor(t,n,i,r){this.lang=t,this.input=n,this.fragments=i,this.ranges=r,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=r[r.length-1].to;let s=k0.get(),o=r[0].from,{state:l,tree:c}=rLt(t,i,o,this.to,s==null?void 0:s.state);this.state=l,this.parsedPos=this.chunkStart=o+c.length;for(let u=0;uu.from<=s.viewport.from&&u.to>=s.viewport.from)&&(this.state=this.lang.streamParser.startState(S0(s.state)),s.skipUntilInView(this.parsedPos,s.viewport.from),this.parsedPos=s.viewport.from),this.moveRangeIndex()}advance(){let t=k0.get(),n=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),i=Math.min(n,this.chunkStart+512);for(t&&(i=Math.min(i,t.viewport.to));this.parsedPos=n?this.finish():t&&this.parsedPos>=t.viewport.to?(t.skipUntilInView(this.parsedPos,n),this.finish()):null}stopAt(t){this.stoppedAt=t}lineAfter(t){let n=this.input.chunk(t);if(this.input.lineChunks)n==` `&&(n="");else{let i=n.indexOf(` -`);i>-1&&(n=n.slice(0,i))}return t+n.length<=this.to?n:n.slice(0,this.to-t)}nextLine(){let t=this.parsedPos,n=this.lineAfter(t),i=t+n.length;for(let r=this.rangeIndex;;){let s=this.ranges[r].to;if(s>=i||(n=n.slice(0,s-(i-n.length)),r++,r==this.ranges.length))break;let o=this.ranges[r].from,l=this.lineAfter(o);n+=l,i=o+l.length}return{line:n,end:i}}skipGapsTo(t,n,i){for(;;){let r=this.ranges[this.rangeIndex].to,s=t+n;if(i>0?r>s:r>=s)break;let o=this.ranges[++this.rangeIndex].from;n+=o-r}return n}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){r=this.skipGapsTo(n,r,1),n+=r;let l=this.chunk.length;r=this.skipGapsTo(i,r,-1),i+=r,s+=this.chunk.length-l}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&s==4&&o>=0&&this.chunk[o]==t&&this.chunk[o+2]==n?this.chunk[o+2]=i:this.chunk.push(t,n,i,s),r}parseLine(t){let{line:n,end:i}=this.nextLine(),r=0,{streamParser:s}=this.lang,o=new I4e(n,t?t.state.tabSize:4,t?w0(t.state):2);if(o.eol())s.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=D4e(s.token,o,this.state);if(l&&(r=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,r)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPost.start)return r}throw new Error("Stream parser failed to advance stream.")}const aW=Object.create(null),$C=[Za.none],aLt=new uO($C),Sre=[],Ere=Object.create(null),M4e=Object.create(null);for(let[e,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])M4e[e]=$4e(aW,t);class L4e{constructor(t){this.extra=t,this.table=Object.assign(Object.create(null),M4e)}resolve(t){return t?this.table[t]||(this.table[t]=$4e(this.extra,t)):0}}const oLt=new L4e(aW);function h$(e,t){Sre.indexOf(e)>-1||(Sre.push(e),console.warn(t))}function $4e(e,t){let n=[];for(let l of t.split(" ")){let c=[];for(let u of l.split(".")){let d=e[u]||fe[u];d?typeof d=="function"?c.length?c=c.map(d):h$(u,`Modifier ${u} used at start of tag`):c.length?h$(u,`Tag ${u} used as modifier`):c=Array.isArray(d)?d:[d]:h$(u,`Unknown highlighting tag ${u}`)}for(let u of c)n.push(u)}if(!n.length)return 0;let i=t.replace(/ /g,"_"),r=i+" "+n.map(l=>l.id),s=Ere[r];if(s)return s.id;let o=Ere[r]=Za.define({id:$C.length,name:i,props:[vm({[i]:n})]});return $C.push(o),o.id}function lLt(e,t){let n=Za.define({id:$C.length,name:"Document",props:[Og.add(()=>e),xm.add(()=>i=>t.getIndent(i))],top:!0});return $C.push(n),n}cs.RTL,cs.LTR;var Cre={};class eP{constructor(t,n,i,r,s,o,l,c,u,d=0,f){this.p=t,this.stack=n,this.state=i,this.reducePos=r,this.pos=s,this.score=o,this.buffer=l,this.bufferBase=c,this.curContext=u,this.lookAhead=d,this.parent=f}toString(){return`[${this.stack.filter((t,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,n,i=0){let r=t.parser.context;return new eP(t,[],n,i,i,0,[],0,r?new Are(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var n;let i=t>>19,r=t&65535,{parser:s}=this.p,o=this.reducePos=2e3&&!(!((n=this.p.parser.nodeSet.types[r])===null||n===void 0)&&n.isAnonymous)&&(u==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=d):this.p.lastBigReductionSizec;)this.stack.pop();this.reduceContext(r,u)}storeNode(t,n,i,r=4,s=!1){if(t==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&this.buffer[o-4]==0&&this.buffer[o-1]>-1){if(n==i)return;if(this.buffer[o-2]>=n){this.buffer[o-2]=i;return}}}if(!s||this.pos==i)this.buffer.push(t,n,i,r);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let l=!1;for(let c=o;c>0&&this.buffer[c-2]>i;c-=4)if(this.buffer[c-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>i;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,r>4&&(r-=4)}this.buffer[o]=t,this.buffer[o+1]=n,this.buffer[o+2]=i,this.buffer[o+3]=r}}shift(t,n,i,r){if(t&131072)this.pushState(t&65535,this.pos);else if(t&262144)this.pos=r,this.shiftContext(n,i),n<=this.p.parser.maxNode&&this.buffer.push(n,i,r,4);else{let s=t,{parser:o}=this.p;this.pos=r;let l=o.stateFlag(s,1);!l&&(r>i||n<=o.maxNode)&&(this.reducePos=r),this.pushState(s,l?i:Math.min(i,this.reducePos)),this.shiftContext(n,i),n<=o.maxNode&&this.buffer.push(n,i,r,4)}}apply(t,n,i,r){t&65536?this.reduce(t):this.shift(t,n,i,r)}useNode(t,n){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=t)&&(this.p.reused.push(t),i++);let r=this.pos;this.reducePos=this.pos=r+t.length,this.pushState(n,r),this.buffer.push(i,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,n=t.buffer.length;for(n&&t.buffer[n-4]==0&&(n-=4);n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let i=t.buffer.slice(n),r=t.bufferBase+n;for(;t&&r==t.bufferBase;)t=t.parent;return new eP(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,r,this.curContext,this.lookAhead,t)}recoverByDelete(t,n){let i=t<=this.p.parser.maxNode;i&&this.storeNode(t,this.pos,n,4),this.storeNode(0,this.pos,n,i?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(t){for(let n=new cLt(this);;){let i=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,t);if(i==0)return!1;if(!(i&65536))return!0;n.reduce(i)}}recoverByInsert(t){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let r=[];for(let s=0,o;sc&1&&l==o)||r.push(n[s],o)}n=r}let i=[];for(let r=0;r>19,r=n&65535,s=this.stack.length-i*3;if(s<0||t.getGoto(this.stack[s],r,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;n=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:t}=this.p,n=[],i=(r,s)=>{if(!n.includes(r))return n.push(r),t.allActions(r,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-s;if(l>1){let c=o&65535,u=this.stack.length-l*3;if(u>=0&&t.getGoto(this.stack[u],c,!1)>=0)return l<<19|65536|c}}else{let l=i(o,s+1);if(l!=null)return l}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:t}=this.p;return t.data[t.stateSlot(this.state,1)]==65535&&!t.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let n=0;n0&&this.emitLookAhead()}}class Are{constructor(t,n){this.tracker=t,this.context=n,this.hash=t.strict?t.hash(n):0}}class cLt{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let n=t&65535,i=t>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=r}}class tP{constructor(t,n,i){this.stack=t,this.pos=n,this.index=i,this.buffer=t.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new tP(t,n,n-t.bufferBase)}maybeNext(){let t=this.stack.parent;t!=null&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new tP(this.stack,this.pos,this.index)}}function mS(e,t=Uint16Array){if(typeof e!="string")return e;let n=null;for(let i=0,r=0;i=92&&o--,o>=34&&o--;let c=o-32;if(c>=46&&(c-=46,l=!0),s+=c,l)break;s*=46}n?n[r++]=s:n=new t(s)}return n}class zN{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Tre=new zN;class uLt{constructor(t,n){this.input=t,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Tre,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(t,n){let i=this.range,r=this.rangeIndex,s=this.pos+t;for(;si.to:s>=i.to;){if(r==this.ranges.length-1)return null;let o=this.ranges[++r];s+=o.from-i.to,i=o}return s}clipPos(t){if(t>=this.range.from&&tt)return Math.max(t,n.from);return this.end}peek(t){let n=this.chunkOff+t,i,r;if(n>=0&&n=this.chunk2Pos&&il.to&&(this.chunk2=this.chunk2.slice(0,l.to-i)),r=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),r}acceptToken(t,n=0){let i=n?this.resolveOffset(n,-1):this.pos;if(i==null||i=this.chunk2Pos&&this.posthis.range.to?t.slice(0,this.range.to-this.pos):t,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(t,n){if(n?(this.token=n,n.start=t,n.lookAhead=t+1,n.value=n.extended=-1):this.token=Tre,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,n-this.chunkPos);if(t>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,n-this.chunk2Pos);if(t>=this.range.from&&n<=this.range.to)return this.input.read(t,n);let i="";for(let r of this.ranges){if(r.from>=n)break;r.to>t&&(i+=this.input.read(Math.max(r.from,t),Math.min(r.to,n)))}return i}}class xw{constructor(t,n){this.data=t,this.id=n}token(t,n){let{parser:i}=n.p;F4e(this.data,t,n,this.id,i.data,i.tokenPrecTable)}}xw.prototype.contextual=xw.prototype.fallback=xw.prototype.extend=!1;class nP{constructor(t,n,i){this.precTable=n,this.elseToken=i,this.data=typeof t=="string"?mS(t):t}token(t,n){let i=t.pos,r=0;for(;;){let s=t.next<0,o=t.resolveOffset(1,1);if(F4e(this.data,t,n,0,this.data,this.precTable),t.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,o==null)break;t.reset(o,t.token)}r&&(t.reset(i,t.token),t.acceptToken(this.elseToken,r))}}nP.prototype.contextual=xw.prototype.fallback=xw.prototype.extend=!1;class Da{constructor(t,n={}){this.token=t,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function F4e(e,t,n,i,r,s){let o=0,l=1<0){let g=e[m];if(c.allows(g)&&(t.token.value==-1||t.token.value==g||dLt(g,t.token.value,r,s))){t.acceptToken(g);break}}let d=t.next,f=0,h=e[o+2];if(t.next<0&&h>f&&e[u+h*3-3]==65535){o=e[u+h*3-1];continue e}for(;f>1,g=u+m+(m<<1),b=e[g],v=e[g+1]||65536;if(d=v)f=m+1;else{o=e[g+2],t.advance();continue e}}break}}function _re(e,t,n){for(let i=t,r;(r=e[i])!=65535;i++)if(r==n)return i-t;return-1}function dLt(e,t,n,i){let r=_re(n,i,t);return r<0||_re(n,i,e)t)&&!i.type.isError)return n<0?Math.max(0,Math.min(i.to-1,t-25)):Math.min(e.length,Math.max(i.from+1,t+25));if(n<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return n<0?0:e.length}}let fLt=class{constructor(t,n){this.fragments=t,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?jre(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?jre(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(tt)return this.nextStart=o,null;if(s instanceof Ui){if(o==t){if(o=Math.max(this.safeFrom,t)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[n]++,this.nextStart=o+s.length}}};class hLt{constructor(t,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(i=>new zN)}getActions(t){let n=0,i=null,{parser:r}=t.p,{tokenizers:s}=r,o=r.stateSlot(t.state,3),l=t.curContext?t.curContext.hash:0,c=0;for(let u=0;uf.end+25&&(c=Math.max(f.lookAhead,c)),f.value!=0)){let h=n;if(f.extended>-1&&(n=this.addActions(t,f.extended,f.end,n)),n=this.addActions(t,f.value,f.end,n),!d.extend&&(i=f,n>h))break}}for(;this.actions.length>n;)this.actions.pop();return c&&t.setLookAhead(c),!i&&t.pos==this.stream.end&&(i=new zN,i.value=t.p.parser.eofTerm,i.start=i.end=t.pos,n=this.addActions(t,i.value,i.end,n)),this.mainToken=i,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let n=new zN,{pos:i,p:r}=t;return n.start=i,n.end=Math.min(i+1,r.stream.end),n.value=i==r.stream.end?r.parser.eofTerm:0,n}updateCachedToken(t,n,i){let r=this.stream.clipPos(i.pos);if(n.token(this.stream.reset(r,t),i),t.value>-1){let{parser:s}=i.p;for(let o=0;o=0&&i.p.parser.dialect.allows(l>>1)){l&1?t.extended=l>>1:t.value=l>>1;break}}}else t.value=0,t.end=this.stream.clipPos(r+1)}putAction(t,n,i,r){for(let s=0;st.bufferLength*4?new fLt(i,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t=this.stacks,n=this.minStackPos,i=this.stacks=[],r,s;if(this.bigReductionCount>300&&t.length==1){let[o]=t;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;on)i.push(l);else{if(this.advanceStack(l,i,t))continue;{r||(r=[],s=[]),r.push(l);let c=this.tokens.getMainToken(l);s.push(c.value,c.end)}}break}}if(!i.length){let o=r&&gLt(r);if(o)return tu&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw tu&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&r){let o=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,i);if(o)return tu&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(i.length>o)for(i.sort((l,c)=>c.score-l.score);i.length>o;)i.pop();i.some(l=>l.reducePos>n)&&this.recovering--}else if(i.length>1){e:for(let o=0;o500&&u.buffer.length>500)if((l.score-u.score||l.buffer.length-u.buffer.length)>0)i.splice(c--,1);else{i.splice(o--,1);continue e}}}i.length>12&&(i.sort((o,l)=>l.score-o.score),i.splice(12,i.length-12))}this.minStackPos=i[0].pos;for(let o=1;o ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let u=t.curContext&&t.curContext.tracker.strict,d=u?t.curContext.hash:0;for(let f=this.fragments.nodeAt(r);f;){let h=this.parser.nodeSet.types[f.type.id]==f.type?s.getGoto(t.state,f.type.id):-1;if(h>-1&&f.length&&(!u||(f.prop(ci.contextHash)||0)==d))return t.useNode(f,h),tu&&console.log(o+this.stackID(t)+` (via reuse of ${s.getName(f.type.id)})`),!0;if(!(f instanceof Ui)||f.children.length==0||f.positions[0]>0)break;let m=f.children[0];if(m instanceof Ui&&f.positions[0]==0)f=m;else break}}let l=s.stateSlot(t.state,4);if(l>0)return t.reduce(l),tu&&console.log(o+this.stackID(t)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(t.stack.length>=8400)for(;t.stack.length>6e3&&t.forceReduce(););let c=this.tokens.getActions(t);for(let u=0;ur?n.push(g):i.push(g)}return!1}advanceFully(t,n){let i=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>i)return Nre(t,n),!0}}runRecovery(t,n,i){let r=null,s=!1;for(let o=0;o ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),tu&&console.log(d+this.stackID(l)+" (restarted)"),this.advanceFully(l,i))))continue;let f=l.split(),h=d;for(let m=0;m<10&&f.forceReduce()&&(tu&&console.log(h+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,i));m++)tu&&(h=this.stackID(f)+" -> ");for(let m of l.recoverByInsert(c))tu&&console.log(d+this.stackID(m)+" (via recover-insert)"),this.advanceFully(m,i);this.stream.end>l.pos?(u==l.pos&&(u++,c=0),l.recoverByDelete(c,u),tu&&console.log(d+this.stackID(l)+` (via recover-delete ${this.parser.getName(c)})`),Nre(l,i)):(!r||r.scoree;class iL{constructor(t){this.start=t.start,this.shift=t.shift||m$,this.reduce=t.reduce||m$,this.reuse=t.reuse||m$,this.hash=t.hash||(()=>0),this.strict=t.strict!==!1}}class om extends qM{constructor(t){if(super(),this.wrappers=[],t.version!=14)throw new RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);let n=t.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let l=0;lt.topRules[l][1]),r=[];for(let l=0;l=0)s(d,c,l[u++]);else{let f=l[u+-d];for(let h=-d;h>0;h--)s(l[u++],c,f);u++}}}this.nodeSet=new uO(n.map((l,c)=>Za.define({name:c>=this.minRepeatTerm?void 0:l,id:c,props:r[c],top:i.indexOf(c)>-1,error:c==0,skipped:t.skippedNodes&&t.skippedNodes.indexOf(c)>-1}))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=L5e;let o=mS(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new xw(o,l):l),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,n,i){let r=new pLt(this,t,n,i);for(let s of this.wrappers)r=s(r,t,n,i);return r}getGoto(t,n,i=!1){let r=this.goto;if(n>=r[0])return-1;for(let s=r[n+1];;){let o=r[s++],l=o&1,c=r[s++];if(l&&i)return c;for(let u=s+(o>>1);s0}validAction(t,n){return!!this.allActions(t,i=>i==n?!0:null)}allActions(t,n){let i=this.stateSlot(t,4),r=i?n(i):void 0;for(let s=this.stateSlot(t,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=gp(this.data,s+2);else break;r=n(gp(this.data,s+1))}return r}nextStates(t){let n=[];for(let i=this.stateSlot(t,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=gp(this.data,i+2);else break;if(!(this.data[i+2]&1)){let r=this.data[i+1];n.some((s,o)=>o&1&&s==r)||n.push(this.data[i],r)}}return n}configure(t){let n=Object.assign(Object.create(om.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let i=this.topRules[t.top];if(!i)throw new RangeError(`Invalid top rule name ${t.top}`);n.top=i}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(i=>{let r=t.tokenizers.find(s=>s.from==i);return r?r.to:i})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((i,r)=>{let s=t.specializers.find(l=>l.from==i.external);if(!s)return i;let o=Object.assign(Object.assign({},i),{external:s.to});return n.specializers[r]=Rre(o),o})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let n=this.dynamicPrecedences;return n==null?0:n[t]||0}parseDialect(t){let n=Object.keys(this.dialects),i=n.map(()=>!1);if(t)for(let s of t.split(" ")){let o=n.indexOf(s);o>=0&&(i[o]=!0)}let r=null;for(let s=0;si)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.scoree.external(n,i)<<1|t}return e.get}const bLt=316,yLt=317,Ire=1,vLt=2,xLt=3,wLt=4,OLt=318,kLt=320,SLt=321,ELt=5,CLt=6,ALt=0,s7=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],B4e=125,TLt=59,a7=47,_Lt=42,jLt=43,NLt=45,RLt=60,ILt=44,PLt=63,DLt=46,MLt=91,LLt=new iL({start:!1,shift(e,t){return t==ELt||t==CLt||t==kLt?e:t==SLt},strict:!1}),$Lt=new Da((e,t)=>{let{next:n}=e;(n==B4e||n==-1||t.context)&&e.acceptToken(OLt)},{contextual:!0,fallback:!0}),FLt=new Da((e,t)=>{let{next:n}=e,i;s7.indexOf(n)>-1||n==a7&&((i=e.peek(1))==a7||i==_Lt)||n!=B4e&&n!=TLt&&n!=-1&&!t.context&&e.acceptToken(bLt)},{contextual:!0}),BLt=new Da((e,t)=>{e.next==MLt&&!t.context&&e.acceptToken(yLt)},{contextual:!0}),ULt=new Da((e,t)=>{let{next:n}=e;if(n==jLt||n==NLt){if(e.advance(),n==e.next){e.advance();let i=!t.context&&t.canShift(Ire);e.acceptToken(i?Ire:vLt)}}else n==PLt&&e.peek(1)==DLt&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(xLt))},{contextual:!0});function g$(e,t){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!t&&e>=48&&e<=57}const QLt=new Da((e,t)=>{if(e.next!=RLt||!t.dialectEnabled(ALt)||(e.advance(),e.next==a7))return;let n=0;for(;s7.indexOf(e.next)>-1;)e.advance(),n++;if(g$(e.next,!0)){for(e.advance(),n++;g$(e.next,!1);)e.advance(),n++;for(;s7.indexOf(e.next)>-1;)e.advance(),n++;if(e.next==ILt)return;for(let i=0;;i++){if(i==7){if(!g$(e.next,!0))return;break}if(e.next!="extends".charCodeAt(i))break;e.advance(),n++}}e.acceptToken(wLt,-n)}),zLt=vm({"get set async static":fe.modifier,"for while do if else switch try catch finally return throw break continue default case defer":fe.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":fe.operatorKeyword,"let var const using function class extends":fe.definitionKeyword,"import export from":fe.moduleKeyword,"with debugger new":fe.keyword,TemplateString:fe.special(fe.string),super:fe.atom,BooleanLiteral:fe.bool,this:fe.self,null:fe.null,Star:fe.modifier,VariableName:fe.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":fe.function(fe.variableName),VariableDefinition:fe.definition(fe.variableName),Label:fe.labelName,PropertyName:fe.propertyName,PrivatePropertyName:fe.special(fe.propertyName),"CallExpression/MemberExpression/PropertyName":fe.function(fe.propertyName),"FunctionDeclaration/VariableDefinition":fe.function(fe.definition(fe.variableName)),"ClassDeclaration/VariableDefinition":fe.definition(fe.className),"NewExpression/VariableName":fe.className,PropertyDefinition:fe.definition(fe.propertyName),PrivatePropertyDefinition:fe.definition(fe.special(fe.propertyName)),UpdateOp:fe.updateOperator,"LineComment Hashbang":fe.lineComment,BlockComment:fe.blockComment,Number:fe.number,String:fe.string,Escape:fe.escape,ArithOp:fe.arithmeticOperator,LogicOp:fe.logicOperator,BitOp:fe.bitwiseOperator,CompareOp:fe.compareOperator,RegExp:fe.regexp,Equals:fe.definitionOperator,Arrow:fe.function(fe.punctuation),": Spread":fe.punctuation,"( )":fe.paren,"[ ]":fe.squareBracket,"{ }":fe.brace,"InterpolationStart InterpolationEnd":fe.special(fe.brace),".":fe.derefOperator,", ;":fe.separator,"@":fe.meta,TypeName:fe.typeName,TypeDefinition:fe.definition(fe.typeName),"type enum interface implements namespace module declare":fe.definitionKeyword,"abstract global Privacy readonly override":fe.modifier,"is keyof unique infer asserts":fe.operatorKeyword,JSXAttributeValue:fe.attributeValue,JSXText:fe.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":fe.angleBracket,"JSXIdentifier JSXNameSpacedName":fe.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":fe.attributeName,"JSXBuiltin/JSXIdentifier":fe.standard(fe.tagName)}),VLt={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},HLt={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},qLt={__proto__:null,"<":193},WLt=om.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-EtOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-EPO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-ERQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<VO!l$xO#jROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!OVO!l$xO#jVO!l$xO#jROe!iOpkOrPO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]VO!l$xO#j^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOrROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]WO!l$xO#jgPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{SU+P%]S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mR>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o>UPS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^T)z$u){V+P%]S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SS#q]SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uSSR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:mSR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:oS)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>X>ZR>Y>['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mSS$oh$pR4U/U'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:mS#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^Q+T%aQ/c*Oo4OP>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^n=rTQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o4OP>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f]>^nZ>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f]>^nZ>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.lPQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.nSR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:LLt,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[zLt],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$i&j(Wp(Z!b'|0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(X#S$i&j'}0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$i&j(Wp(Z!b'}0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$i&j!p),Q(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(V':f$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$i&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$d`$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$d``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$d`$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(Z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$d`(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$i&j(Wp(Z!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$i&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(Z!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$i&j(WpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(WpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Wp(Z!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$i&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$i&j(Z!b!X7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(Z!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(Z!b!X7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(Z!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$i&j(Z!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!g$b$i&j$O)Lv(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#R-v$?V_!^(CdvBr$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!q7`$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$i&j(Wp(Z!b'|0/l$]#t(T,2j(e$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[FLt,BLt,ULt,QLt,2,3,4,5,6,7,8,9,10,11,12,13,14,$Lt,new nP("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new nP("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:e=>VLt[e]||-1},{term:343,get:e=>HLt[e]||-1},{term:95,get:e=>qLt[e]||-1}],tokenPrec:15201});class oW{constructor(t,n,i,r){this.state=t,this.pos=n,this.explicit=i,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let n=Jr(this.state).resolveInner(this.pos,-1);for(;n&&t.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(t){let n=this.state.doc.lineAt(this.pos),i=Math.max(n.from,this.pos-250),r=n.text.slice(i-n.from,this.pos-n.from),s=r.search(Q4e(t,!1));return s<0?null:{from:i+s,to:this.pos,text:r.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(t,n,i){t=="abort"&&this.abortListeners&&(this.abortListeners.push(n),i&&i.onDocChange&&(this.abortOnDocChange=!0))}}function Pre(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function KLt(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let s=1;stypeof r=="string"?{label:r}:r),[n,i]=t.every(r=>/^\w+$/.test(r.label))?[/\w*$/,/\w+$/]:KLt(t);return r=>{let s=r.matchBefore(i);return s||r.explicit?{from:s?s.from:r.pos,options:t,validFor:n}:null}}function U4e(e,t){return n=>{for(let i=Jr(n.state).resolveInner(n.pos,-1);i;i=i.parent){if(e.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return t(n)}}class Dre{constructor(t,n,i,r){this.completion=t,this.source=n,this.match=i,this.score=r}}function Xy(e){return e.selection.main.from}function Q4e(e,t){var n;let{source:i}=e,r=t&&i[0]!="^",s=i[i.length-1]!="$";return!r&&!s?e:new RegExp(`${r?"^":""}(?:${i})${s?"$":""}`,(n=e.flags)!==null&&n!==void 0?n:e.ignoreCase?"i":"")}const cW=Nh.define();function GLt(e,t,n,i){let{main:r}=e.selection,s=n-r.from,o=i-r.from;return{...e.changeByRange(l=>{if(l!=r&&n!=i&&e.sliceDoc(l.from+s,l.from+o)!=e.sliceDoc(n,i))return{range:l};let c=e.toText(t);return{changes:{from:l.from+s,to:i==r.from?l.to:l.from+o,insert:c},range:ht.cursor(l.from+s+c.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const Mre=new WeakMap;function XLt(e){if(!Array.isArray(e))return e;let t=Mre.get(e);return t||Mre.set(e,t=lW(e)),t}const iP=hi.define(),FC=hi.define();class YLt{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n=48&&k<=57||k>=97&&k<=122?2:k>=65&&k<=90?1:0:(S=Mq(k))!=S.toLowerCase()?1:S!=S.toUpperCase()?2:0;(!w||C==1&&v||O==0&&C!=0)&&(n[f]==k||i[f]==k&&(h=!0)?o[f++]=w:o.length&&(y=!1)),O=C,w+=Jf(k)}return f==c&&o[0]==0&&y?this.result(-100+(h?-200:0),o,t):m==c&&g==0?this.ret(-200-t.length+(b==t.length?0:-100),[0,b]):l>-1?this.ret(-700-t.length,[l,l+this.pattern.length]):m==c?this.ret(-900-t.length,[g,b]):f==c?this.result(-100+(h?-200:0)+-700+(y?0:-1100),o,t):n.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,t)}result(t,n,i){let r=[],s=0;for(let o of n){let l=o+(this.astral?Jf(jc(i,o)):1);s&&r[s-1]==o?r[s-1]=l:(r[s++]=o,r[s++]=l)}return this.ret(t-i.length,r)}}class ZLt{constructor(t){this.pattern=t,this.matched=[],this.score=0,this.folded=t.toLowerCase()}match(t){if(t.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:JLt,filterStrict:!1,compareCompletions:(t,n)=>(t.sortText||t.label).localeCompare(n.sortText||n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(t,n)=>t&&n,closeOnBlur:(t,n)=>t&&n,icons:(t,n)=>t&&n,tooltipClass:(t,n)=>i=>Lre(t(i),n(i)),optionClass:(t,n)=>i=>Lre(t(i),n(i)),addToOptions:(t,n)=>t.concat(n),filterStrict:(t,n)=>t||n})}});function Lre(e,t){return e?t?e+" "+t:e:t}function JLt(e,t,n,i,r,s){let o=e.textDirection==cs.RTL,l=o,c=!1,u="top",d,f,h=t.left-r.left,m=r.right-t.right,g=i.right-i.left,b=i.bottom-i.top;if(l&&h=b||w>t.top?d=n.bottom-t.top:(u="bottom",d=t.bottom-n.top)}let v=(t.bottom-t.top)/s.offsetHeight,y=(t.right-t.left)/s.offsetWidth;return{style:`${u}: ${d/v}px; max-width: ${f/y}px`,class:"cm-completionInfo-"+(c?o?"left-narrow":"right-narrow":l?"left":"right")}}const uW=hi.define();function e5t(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(n){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),n.type&&i.classList.add(...n.type.split(/\s+/g).map(r=>"cm-completionIcon-"+r)),i.setAttribute("aria-hidden","true"),i},position:20}),t.push({render(n,i,r,s){let o=document.createElement("span");o.className="cm-completionLabel";let l=n.displayLabel||n.label,c=0;for(let u=0;uc&&o.appendChild(document.createTextNode(l.slice(c,d)));let h=o.appendChild(document.createElement("span"));h.appendChild(document.createTextNode(l.slice(d,f))),h.className="cm-completionMatchedText",c=f}return cn.position-i.position).map(n=>n.render)}function b$(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let r=Math.floor(t/n);return{from:r*n,to:(r+1)*n}}let i=Math.ceil((e-t)/n);return{from:e-i*n,to:e-(i-1)*n}}class t5t{constructor(t,n,i){this.view=t,this.stateField=n,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:c=>this.placeInfo(c),key:this},this.space=null,this.currentClass="";let r=t.state.field(n),{options:s,selected:o}=r.open,l=t.state.facet(No);this.optionContent=e5t(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=b$(s.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",c=>{let{options:u}=t.state.field(n).open;for(let d=c.target,f;d&&d!=this.dom;d=d.parentNode)if(d.nodeName=="LI"&&(f=/-(\d+)$/.exec(d.id))&&+f[1]this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;d!=null&&(t.dispatch({effects:uW.of(d)}),c.preventDefault())}}),this.dom.addEventListener("focusout",c=>{let u=t.state.field(this.stateField,!1);u&&u.tooltip&&t.state.facet(No).closeOnBlur&&c.relatedTarget!=t.contentDOM&&t.dispatch({effects:FC.of(null)})}),this.showOptions(s,r.id)}mount(){this.updateSel()}showOptions(t,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(t){var n;let i=t.state.field(this.stateField),r=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),i!=r){let{options:s,selected:o,disabled:l}=i.open;(!r.open||r.open.options!=s)&&(this.range=b$(s.length,o,t.state.facet(No).maxRenderedOptions),this.showOptions(s,i.id)),this.updateSel(),l!=((n=r.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(t){let n=this.tooltipClass(t);if(n!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of n.split(" "))i&&this.dom.classList.add(i);this.currentClass=n}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),n=t.open;(n.selected>-1&&n.selected=this.range.to)&&(this.range=b$(n.options.length,n.selected,this.view.state.facet(No).maxRenderedOptions),this.showOptions(n.options,t.id));let i=this.updateSelectedOption(n.selected);if(i){this.destroyInfo();let{completion:r}=n.options[n.selected],{info:s}=r;if(!s)return;let o=typeof s=="string"?document.createTextNode(s):s(r);if(!o)return;"then"in o?o.then(l=>{l&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(l,r)}).catch(l=>Dc(this.view.state,l,"completion info")):(this.addInfoPane(o,r),i.setAttribute("aria-describedby",this.info.id))}}addInfoPane(t,n){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",i.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),t.nodeType!=null)i.appendChild(t),this.infoDestroy=null;else{let{dom:r,destroy:s}=t;i.appendChild(r),this.infoDestroy=s||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){let n=null;for(let i=this.list.firstChild,r=this.range.from;i;i=i.nextSibling,r++)i.nodeName!="LI"||!i.id?r--:r==t?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),n=i):i.hasAttribute("aria-selected")&&(i.removeAttribute("aria-selected"),i.removeAttribute("aria-describedby"));return n&&i5t(this.list,n),n}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let n=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),r=t.getBoundingClientRect(),s=this.space;if(!s){let o=this.dom.ownerDocument.documentElement;s={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return r.top>Math.min(s.bottom,n.bottom)-10||r.bottom{o.target==r&&o.preventDefault()});let s=null;for(let o=i.from;oi.from||i.from==0))if(s=h,typeof u!="string"&&u.header)r.appendChild(u.header(u));else{let m=r.appendChild(document.createElement("completion-section"));m.textContent=h}}const d=r.appendChild(document.createElement("li"));d.id=n+"-"+o,d.setAttribute("role","option");let f=this.optionClass(l);f&&(d.className=f);for(let h of this.optionContent){let m=h(l,this.view.state,this.view,c);m&&d.appendChild(m)}}return i.from&&r.classList.add("cm-completionListIncompleteTop"),i.tonew t5t(n,e,t)}function i5t(e,t){let n=e.getBoundingClientRect(),i=t.getBoundingClientRect(),r=n.height/e.offsetHeight;i.topn.bottom&&(e.scrollTop+=(i.bottom-n.bottom)/r)}function $re(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}function r5t(e,t){let n=[],i=null,r=null,s=d=>{n.push(d);let{section:f}=d.completion;if(f){i||(i=[]);let h=typeof f=="string"?f:f.name;i.some(m=>m.name==h)||i.push(typeof f=="string"?{name:h}:f)}},o=t.facet(No);for(let d of e)if(d.hasResult()){let f=d.result.getMatch;if(d.result.filter===!1)for(let h of d.result.options)s(new Dre(h,d.source,f?f(h):[],1e9-n.length));else{let h=t.sliceDoc(d.from,d.to),m,g=o.filterStrict?new ZLt(h):new YLt(h);for(let b of d.result.options)if(m=g.match(b.label)){let v=b.displayLabel?f?f(b,m.matched):[]:m.matched,y=m.score+(b.boost||0);if(s(new Dre(b,d.source,v,y)),typeof b.section=="object"&&b.section.rank==="dynamic"){let{name:w}=b.section;r||(r=Object.create(null)),r[w]=Math.max(y,r[w]||-1e9)}}}}if(i){let d=Object.create(null),f=0,h=(m,g)=>(m.rank==="dynamic"&&g.rank==="dynamic"?r[g.name]-r[m.name]:0)||(typeof m.rank=="number"?m.rank:1e9)-(typeof g.rank=="number"?g.rank:1e9)||(m.nameh.score-f.score||u(f.completion,h.completion))){let f=d.completion;!c||c.label!=f.label||c.detail!=f.detail||c.type!=null&&f.type!=null&&c.type!=f.type||c.apply!=f.apply||c.boost!=f.boost?l.push(d):$re(d.completion)>$re(c)&&(l[l.length-1]=d),c=d.completion}return l}class Fx{constructor(t,n,i,r,s,o){this.options=t,this.attrs=n,this.tooltip=i,this.timestamp=r,this.selected=s,this.disabled=o}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new Fx(this.options,Fre(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,i,r,s,o){if(r&&!o&&t.some(u=>u.isPending))return r.setDisabled();let l=r5t(t,n);if(!l.length)return r&&t.some(u=>u.isPending)?r.setDisabled():null;let c=n.facet(No).selectOnOpen?0:-1;if(r&&r.selected!=c&&r.selected!=-1){let u=r.options[r.selected].completion;for(let d=0;dd.hasResult()?Math.min(u,d.from):u,1e8),create:u5t,above:s.aboveCursor},r?r.timestamp:Date.now(),c,!1)}map(t){return new Fx(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new Fx(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class rP{constructor(t,n,i){this.active=t,this.id=n,this.open=i}static start(){return new rP(l5t,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,i=n.facet(No),s=(i.override||n.languageDataAt("autocomplete",Xy(n)).map(XLt)).map(c=>(this.active.find(d=>d.source==c)||new gd(c,this.active.some(d=>d.state!=0)?1:0)).update(t,i));s.length==this.active.length&&s.every((c,u)=>c==this.active[u])&&(s=this.active);let o=this.open,l=t.effects.some(c=>c.is(dW));o&&t.docChanged&&(o=o.map(t.changes)),t.selection||s.some(c=>c.hasResult()&&t.changes.touchesRange(c.from,c.to))||!s5t(s,this.active)||l?o=Fx.build(s,n,this.id,o,i,l):o&&o.disabled&&!s.some(c=>c.isPending)&&(o=null),!o&&s.every(c=>!c.isPending)&&s.some(c=>c.hasResult())&&(s=s.map(c=>c.hasResult()?new gd(c.source,0):c));for(let c of t.effects)c.is(uW)&&(o=o&&o.setSelected(c.value,this.id));return s==this.active&&o==this.open?this:new rP(s,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?a5t:o5t}}function s5t(e,t){if(e==t)return!0;for(let n=0,i=0;;){for(;n-1&&(n["aria-activedescendant"]=e+"-"+t),n}const l5t=[];function z4e(e,t){if(e.isUserEvent("input.complete")){let i=e.annotation(cW);if(i&&t.activateOnCompletion(i))return 12}let n=e.isUserEvent("input.type");return n&&t.activateOnTyping?5:n?1:e.isUserEvent("delete.backward")?2:e.selection?8:e.docChanged?16:0}class gd{constructor(t,n,i=!1){this.source=t,this.state=n,this.explicit=i}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let i=z4e(t,n),r=this;(i&8||i&16&&this.touches(t))&&(r=new gd(r.source,0)),i&4&&r.state==0&&(r=new gd(this.source,1)),r=r.updateFor(t,i);for(let s of t.effects)if(s.is(iP))r=new gd(r.source,1,s.value);else if(s.is(FC))r=new gd(r.source,0);else if(s.is(dW))for(let o of s.value)o.source==r.source&&(r=o);return r}updateFor(t,n){return this.map(t.changes)}map(t){return this}touches(t){return t.changes.touchesRange(Xy(t.state))}}class ww extends gd{constructor(t,n,i,r,s,o){super(t,3,n),this.limit=i,this.result=r,this.from=s,this.to=o}hasResult(){return!0}updateFor(t,n){var i;if(!(n&3))return this.map(t.changes);let r=this.result;r.map&&!t.changes.empty&&(r=r.map(r,t.changes));let s=t.changes.mapPos(this.from),o=t.changes.mapPos(this.to,1),l=Xy(t.state);if(l>o||!r||n&2&&(Xy(t.startState)==this.from||ln.map(t))}}),Nc=dl.define({create(){return rP.start()},update(e,t){return e.update(t)},provide:e=>[Jq.from(e,t=>t.tooltip),en.contentAttributes.from(e,t=>t.attrs)]});function fW(e,t){const n=t.completion.apply||t.completion.label;let i=e.state.field(Nc).active.find(r=>r.source==t.source);return i instanceof ww?(typeof n=="string"?e.dispatch({...GLt(e.state,n,i.from,i.to),annotations:cW.of(t.completion)}):n(e,t.completion,i.from,i.to),!0):!1}const u5t=n5t(Nc,fW);function nj(e,t="option"){return n=>{let i=n.state.field(Nc,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp-1?i.open.selected+r*(e?1:-1):e?0:o-1;return l<0?l=t=="page"?0:o-1:l>=o&&(l=t=="page"?o-1:0),n.dispatch({effects:uW.of(l)}),!0}}const d5t=e=>{let t=e.state.field(Nc,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestampe.state.field(Nc,!1)?(e.dispatch({effects:iP.of(!0)}),!0):!1,f5t=e=>{let t=e.state.field(Nc,!1);return!t||!t.active.some(n=>n.state!=0)?!1:(e.dispatch({effects:FC.of(null)}),!0)};class h5t{constructor(t,n){this.active=t,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const p5t=50,m5t=1e3,g5t=ga.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(Nc).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(Nc),n=e.state.facet(No);if(!e.selectionSet&&!e.docChanged&&e.startState.field(Nc)==t)return;let i=e.transactions.some(s=>{let o=z4e(s,n);return o&8||(s.selection||s.docChanged)&&!(o&3)});for(let s=0;sp5t&&Date.now()-o.time>m5t){for(let l of o.context.abortListeners)try{l()}catch(c){Dc(this.view.state,c)}o.context.abortListeners=null,this.running.splice(s--,1)}else o.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(s=>s.effects.some(o=>o.is(iP)))&&(this.pendingStart=!0);let r=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(s=>s.isPending&&!this.running.some(o=>o.active.source==s.source))?setTimeout(()=>this.startUpdate(),r):-1,this.composing!=0)for(let s of e.transactions)s.isUserEvent("input.type")?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(Nc);for(let n of t.active)n.isPending&&!this.running.some(i=>i.active.source==n.source)&&this.startQuery(n);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(No).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=Xy(t),i=new oW(t,n,e.explicit,this.view),r=new h5t(e,i);this.running.push(r),Promise.resolve(e.source(i)).then(s=>{r.context.aborted||(r.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:FC.of(null)}),Dc(this.view.state,s)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(No).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(No),i=this.view.state.field(Nc);for(let r=0;rl.source==s.active.source);if(o&&o.isPending)if(s.done==null){let l=new gd(s.active.source,0);for(let c of s.updates)l=l.update(c,n);l.isPending||t.push(l)}else this.startQuery(o)}(t.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:dW.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(Nc,!1);if(t&&t.tooltip&&this.view.state.facet(No).closeOnBlur){let n=t.open&&o4e(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:FC.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:iP.of(!1)}),20),this.composing=0}}}),b5t=typeof navigator=="object"&&/Win/.test(navigator.platform),y5t=ym.highest(en.domEventHandlers({keydown(e,t){let n=t.state.field(Nc,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(b5t&&e.altKey)||e.metaKey)return!1;let i=n.open.options[n.open.selected],r=n.active.find(o=>o.source==i.source),s=i.completion.commitCharacters||r.result.commitCharacters;return s&&s.indexOf(e.key)>-1&&fW(t,i),!1}})),V4e=en.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class v5t{constructor(t,n,i,r){this.field=t,this.line=n,this.from=i,this.to=r}}class hW{constructor(t,n,i){this.field=t,this.from=n,this.to=i}map(t){let n=t.mapPos(this.from,-1,il.TrackDel),i=t.mapPos(this.to,1,il.TrackDel);return n==null||i==null?null:new hW(this.field,n,i)}}class pW{constructor(t,n){this.lines=t,this.fieldPositions=n}instantiate(t,n){let i=[],r=[n],s=t.doc.lineAt(n),o=/^\s*/.exec(s.text)[0];for(let c of this.lines){if(i.length){let u=o,d=/^\t*/.exec(c)[0].length;for(let f=0;fnew hW(c.field,r[c.line]+c.from,r[c.line]+c.to));return{text:i,ranges:l}}static parse(t){let n=[],i=[],r=[],s;for(let o of t.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(o);){let l=s[1]?+s[1]:null,c=s[2]||s[3]||"",u=-1;l===0&&(l=1e9);let d=c.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f=u&&h.field++}for(let f of r)if(f.line==i.length&&f.from>s.index){let h=s[2]?3+(s[1]||"").length:2;f.from-=h,f.to-=h}r.push(new v5t(u,i.length,s.index,s.index+d.length)),o=o.slice(0,s.index)+c+o.slice(s.index+s[0].length)}o=o.replace(/\\([{}])/g,(l,c,u)=>{for(let d of r)d.line==i.length&&d.from>u&&(d.from--,d.to--);return c}),i.push(o)}return new pW(i,r)}}let x5t=$n.widget({widget:new class extends Nf{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),w5t=$n.mark({class:"cm-snippetField"});class hO{constructor(t,n){this.ranges=t,this.active=n,this.deco=$n.set(t.map(i=>(i.from==i.to?x5t:w5t).range(i.from,i.to)),!0)}map(t){let n=[];for(let i of this.ranges){let r=i.map(t);if(!r)return null;n.push(r)}return new hO(n,this.active)}selectionInsideField(t){return t.ranges.every(n=>this.ranges.some(i=>i.field==this.active&&i.from<=n.from&&i.to>=n.to))}}const TT=hi.define({map(e,t){return e&&e.map(t)}}),O5t=hi.define(),BC=dl.define({create(){return null},update(e,t){for(let n of t.effects){if(n.is(TT))return n.value;if(n.is(O5t)&&e)return new hO(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>en.decorations.from(e,t=>t?t.deco:$n.none)});function mW(e,t){return ht.create(e.filter(n=>n.field==t).map(n=>ht.range(n.from,n.to)))}function k5t(e){let t=pW.parse(e);return(n,i,r,s)=>{let{text:o,ranges:l}=t.instantiate(n.state,r),{main:c}=n.state.selection,u={changes:{from:r,to:s==c.from?c.to:s,insert:Or.of(o)},scrollIntoView:!0,annotations:i?[cW.of(i),Xa.userEvent.of("input.complete")]:void 0};if(l.length&&(u.selection=mW(l,0)),l.some(d=>d.field>0)){let d=new hO(l,0),f=u.effects=[TT.of(d)];n.state.field(BC,!1)===void 0&&f.push(hi.appendConfig.of([BC,T5t,_5t,V4e]))}n.dispatch(n.state.update(u))}}function H4e(e){return({state:t,dispatch:n})=>{let i=t.field(BC,!1);if(!i||e<0&&i.active==0)return!1;let r=i.active+e,s=e>0&&!i.ranges.some(o=>o.field==r+e);return n(t.update({selection:mW(i.ranges,r),effects:TT.of(s?null:new hO(i.ranges,r)),scrollIntoView:!0})),!0}}const S5t=({state:e,dispatch:t})=>e.field(BC,!1)?(t(e.update({effects:TT.of(null)})),!0):!1,E5t=H4e(1),C5t=H4e(-1),A5t=[{key:"Tab",run:E5t,shift:C5t},{key:"Escape",run:S5t}],Bre=gn.define({combine(e){return e.length?e[0]:A5t}}),T5t=ym.highest(dO.compute([Bre],e=>e.facet(Bre)));function Zs(e,t){return{...t,apply:k5t(e)}}const _5t=en.domEventHandlers({mousedown(e,t){let n=t.state.field(BC,!1),i;if(!n||(i=t.posAtCoords({x:e.clientX,y:e.clientY}))==null)return!1;let r=n.ranges.find(s=>s.from<=i&&s.to>=i);return!r||r.field==n.active?!1:(t.dispatch({selection:mW(n.ranges,r.field),effects:TT.of(n.ranges.some(s=>s.field>r.field)?new hO(n.ranges,r.field):null),scrollIntoView:!0}),!0)}}),UC={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Ry=hi.define({map(e,t){let n=t.mapPos(e,-1,il.TrackAfter);return n??void 0}}),gW=new class extends hb{};gW.startSide=1;gW.endSide=-1;const q4e=dl.define({create(){return Gi.empty},update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:i=>i>=n.from&&i<=n.to})}for(let n of t.effects)n.is(Ry)&&(e=e.update({add:[gW.range(n.value,n.value+1)]}));return e}});function j5t(){return[R5t,q4e]}const v$="()[]{}<>«»»«[]{}";function W4e(e){for(let t=0;t{if((N5t?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let r=e.state.selection.main;if(i.length>2||i.length==2&&Jf(jc(i,0))==1||t!=r.from||n!=r.to)return!1;let s=D5t(e.state,i);return s?(e.dispatch(s),!0):!1}),I5t=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=K4e(e,e.selection.main.head).brackets||UC.brackets,r=null,s=e.changeByRange(o=>{if(o.empty){let l=M5t(e.doc,o.head);for(let c of i)if(c==l&&rL(e.doc,o.head)==W4e(jc(c,0)))return{changes:{from:o.head-c.length,to:o.head+c.length},range:ht.cursor(o.head-c.length)}}return{range:r=o}});return r||t(e.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!r},P5t=[{key:"Backspace",run:I5t}];function D5t(e,t){let n=K4e(e,e.selection.main.head),i=n.brackets||UC.brackets;for(let r of i){let s=W4e(jc(r,0));if(t==r)return s==r?F5t(e,r,i.indexOf(r+r+r)>-1,n):L5t(e,r,s,n.before||UC.before);if(t==s&&G4e(e,e.selection.main.from))return $5t(e,r,s)}return null}function G4e(e,t){let n=!1;return e.field(q4e).between(0,e.doc.length,i=>{i==t&&(n=!0)}),n}function rL(e,t){let n=e.sliceString(t,t+2);return n.slice(0,Jf(jc(n,0)))}function M5t(e,t){let n=e.sliceString(t-2,t);return Jf(jc(n,0))==n.length?n:n.slice(1)}function L5t(e,t,n,i){let r=null,s=e.changeByRange(o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:n,from:o.to}],effects:Ry.of(o.to+t.length),range:ht.range(o.anchor+t.length,o.head+t.length)};let l=rL(e.doc,o.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:t+n,from:o.head},effects:Ry.of(o.head+t.length),range:ht.cursor(o.head+t.length)}:{range:r=o}});return r?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function $5t(e,t,n){let i=null,r=e.changeByRange(s=>s.empty&&rL(e.doc,s.head)==n?{changes:{from:s.head,to:s.head+n.length,insert:n},range:ht.cursor(s.head+n.length)}:i={range:s});return i?null:e.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function F5t(e,t,n,i){let r=i.stringPrefixes||UC.stringPrefixes,s=null,o=e.changeByRange(l=>{if(!l.empty)return{changes:[{insert:t,from:l.from},{insert:t,from:l.to}],effects:Ry.of(l.to+t.length),range:ht.range(l.anchor+t.length,l.head+t.length)};let c=l.head,u=rL(e.doc,c),d;if(u==t){if(Ure(e,c))return{changes:{insert:t+t,from:c},effects:Ry.of(c+t.length),range:ht.cursor(c+t.length)};if(G4e(e,c)){let h=n&&e.sliceDoc(c,c+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:c,to:c+h.length,insert:h},range:ht.cursor(c+h.length)}}}else{if(n&&e.sliceDoc(c-2*t.length,c)==t+t&&(d=Qre(e,c-2*t.length,r))>-1&&Ure(e,d))return{changes:{insert:t+t+t+t,from:c},effects:Ry.of(c+t.length),range:ht.cursor(c+t.length)};if(e.charCategorizer(c)(u)!=zs.Word&&Qre(e,c,r)>-1&&!B5t(e,c,t,r))return{changes:{insert:t+t,from:c},effects:Ry.of(c+t.length),range:ht.cursor(c+t.length)}}return{range:s=l}});return s?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function Ure(e,t){let n=Jr(e).resolveInner(t+1);return n.parent&&n.from==t}function B5t(e,t,n,i){let r=Jr(e).resolveInner(t,-1),s=i.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=e.sliceDoc(r.from,Math.min(r.to,r.from+n.length+s)),c=l.indexOf(n);if(!c||c>-1&&i.indexOf(l.slice(0,c))>-1){let d=r.firstChild;for(;d&&d.from==r.from&&d.to-d.from>n.length+c;){if(e.sliceDoc(d.to-n.length,d.to)==n)return!1;d=d.firstChild}return!0}let u=r.to==t&&r.parent;if(!u)break;r=u}return!1}function Qre(e,t,n){let i=e.charCategorizer(t);if(i(e.sliceDoc(t-1,t))!=zs.Word)return t;for(let r of n){let s=t-r.length;if(e.sliceDoc(s,t)==r&&i(e.sliceDoc(s-1,s))!=zs.Word)return s}return-1}function U5t(e={}){return[y5t,Nc,No.of(e),g5t,Q5t,V4e]}const X4e=[{key:"Ctrl-Space",run:y$},{mac:"Alt-`",run:y$},{mac:"Alt-i",run:y$},{key:"Escape",run:f5t},{key:"ArrowDown",run:nj(!0)},{key:"ArrowUp",run:nj(!1)},{key:"PageDown",run:nj(!0,"page")},{key:"PageUp",run:nj(!1,"page")},{key:"Enter",run:d5t}],Q5t=ym.highest(dO.computeN([No],e=>e.facet(No).defaultKeymap?[X4e]:[])),Y4e=[Zs("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Zs("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Zs("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Zs("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Zs("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Zs(`try { +`);i>-1&&(n=n.slice(0,i))}return t+n.length<=this.to?n:n.slice(0,this.to-t)}nextLine(){let t=this.parsedPos,n=this.lineAfter(t),i=t+n.length;for(let r=this.rangeIndex;;){let s=this.ranges[r].to;if(s>=i||(n=n.slice(0,s-(i-n.length)),r++,r==this.ranges.length))break;let o=this.ranges[r].from,l=this.lineAfter(o);n+=l,i=o+l.length}return{line:n,end:i}}skipGapsTo(t,n,i){for(;;){let r=this.ranges[this.rangeIndex].to,s=t+n;if(i>0?r>s:r>=s)break;let o=this.ranges[++this.rangeIndex].from;n+=o-r}return n}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){r=this.skipGapsTo(n,r,1),n+=r;let l=this.chunk.length;r=this.skipGapsTo(i,r,-1),i+=r,s+=this.chunk.length-l}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&s==4&&o>=0&&this.chunk[o]==t&&this.chunk[o+2]==n?this.chunk[o+2]=i:this.chunk.push(t,n,i,s),r}parseLine(t){let{line:n,end:i}=this.nextLine(),r=0,{streamParser:s}=this.lang,o=new I4e(n,t?t.state.tabSize:4,t?S0(t.state):2);if(o.eol())s.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=D4e(s.token,o,this.state);if(l&&(r=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,r)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPost.start)return r}throw new Error("Stream parser failed to advance stream.")}const aW=Object.create(null),zC=[Za.none],aLt=new fO(zC),Sre=[],Ere=Object.create(null),M4e=Object.create(null);for(let[e,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])M4e[e]=$4e(aW,t);class L4e{constructor(t){this.extra=t,this.table=Object.assign(Object.create(null),M4e)}resolve(t){return t?this.table[t]||(this.table[t]=$4e(this.extra,t)):0}}const oLt=new L4e(aW);function h$(e,t){Sre.indexOf(e)>-1||(Sre.push(e),console.warn(t))}function $4e(e,t){let n=[];for(let l of t.split(" ")){let c=[];for(let u of l.split(".")){let d=e[u]||fe[u];d?typeof d=="function"?c.length?c=c.map(d):h$(u,`Modifier ${u} used at start of tag`):c.length?h$(u,`Tag ${u} used as modifier`):c=Array.isArray(d)?d:[d]:h$(u,`Unknown highlighting tag ${u}`)}for(let u of c)n.push(u)}if(!n.length)return 0;let i=t.replace(/ /g,"_"),r=i+" "+n.map(l=>l.id),s=Ere[r];if(s)return s.id;let o=Ere[r]=Za.define({id:zC.length,name:i,props:[bm({[i]:n})]});return zC.push(o),o.id}function lLt(e,t){let n=Za.define({id:zC.length,name:"Document",props:[wg.add(()=>e),ym.add(()=>i=>t.getIndent(i))],top:!0});return zC.push(n),n}os.RTL,os.LTR;var Cre={};class tP{constructor(t,n,i,r,s,o,l,c,u,d=0,f){this.p=t,this.stack=n,this.state=i,this.reducePos=r,this.pos=s,this.score=o,this.buffer=l,this.bufferBase=c,this.curContext=u,this.lookAhead=d,this.parent=f}toString(){return`[${this.stack.filter((t,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,n,i=0){let r=t.parser.context;return new tP(t,[],n,i,i,0,[],0,r?new Are(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var n;let i=t>>19,r=t&65535,{parser:s}=this.p,o=this.reducePos=2e3&&!(!((n=this.p.parser.nodeSet.types[r])===null||n===void 0)&&n.isAnonymous)&&(u==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=d):this.p.lastBigReductionSizec;)this.stack.pop();this.reduceContext(r,u)}storeNode(t,n,i,r=4,s=!1){if(t==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&this.buffer[o-4]==0&&this.buffer[o-1]>-1){if(n==i)return;if(this.buffer[o-2]>=n){this.buffer[o-2]=i;return}}}if(!s||this.pos==i)this.buffer.push(t,n,i,r);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let l=!1;for(let c=o;c>0&&this.buffer[c-2]>i;c-=4)if(this.buffer[c-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>i;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,r>4&&(r-=4)}this.buffer[o]=t,this.buffer[o+1]=n,this.buffer[o+2]=i,this.buffer[o+3]=r}}shift(t,n,i,r){if(t&131072)this.pushState(t&65535,this.pos);else if(t&262144)this.pos=r,this.shiftContext(n,i),n<=this.p.parser.maxNode&&this.buffer.push(n,i,r,4);else{let s=t,{parser:o}=this.p;this.pos=r;let l=o.stateFlag(s,1);!l&&(r>i||n<=o.maxNode)&&(this.reducePos=r),this.pushState(s,l?i:Math.min(i,this.reducePos)),this.shiftContext(n,i),n<=o.maxNode&&this.buffer.push(n,i,r,4)}}apply(t,n,i,r){t&65536?this.reduce(t):this.shift(t,n,i,r)}useNode(t,n){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=t)&&(this.p.reused.push(t),i++);let r=this.pos;this.reducePos=this.pos=r+t.length,this.pushState(n,r),this.buffer.push(i,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,n=t.buffer.length;for(n&&t.buffer[n-4]==0&&(n-=4);n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let i=t.buffer.slice(n),r=t.bufferBase+n;for(;t&&r==t.bufferBase;)t=t.parent;return new tP(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,r,this.curContext,this.lookAhead,t)}recoverByDelete(t,n){let i=t<=this.p.parser.maxNode;i&&this.storeNode(t,this.pos,n,4),this.storeNode(0,this.pos,n,i?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(t){for(let n=new cLt(this);;){let i=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,t);if(i==0)return!1;if(!(i&65536))return!0;n.reduce(i)}}recoverByInsert(t){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let r=[];for(let s=0,o;sc&1&&l==o)||r.push(n[s],o)}n=r}let i=[];for(let r=0;r>19,r=n&65535,s=this.stack.length-i*3;if(s<0||t.getGoto(this.stack[s],r,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;n=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:t}=this.p,n=[],i=(r,s)=>{if(!n.includes(r))return n.push(r),t.allActions(r,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-s;if(l>1){let c=o&65535,u=this.stack.length-l*3;if(u>=0&&t.getGoto(this.stack[u],c,!1)>=0)return l<<19|65536|c}}else{let l=i(o,s+1);if(l!=null)return l}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:t}=this.p;return t.data[t.stateSlot(this.state,1)]==65535&&!t.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let n=0;n0&&this.emitLookAhead()}}class Are{constructor(t,n){this.tracker=t,this.context=n,this.hash=t.strict?t.hash(n):0}}class cLt{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let n=t&65535,i=t>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=r}}class nP{constructor(t,n,i){this.stack=t,this.pos=n,this.index=i,this.buffer=t.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new nP(t,n,n-t.bufferBase)}maybeNext(){let t=this.stack.parent;t!=null&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new nP(this.stack,this.pos,this.index)}}function xS(e,t=Uint16Array){if(typeof e!="string")return e;let n=null;for(let i=0,r=0;i=92&&o--,o>=34&&o--;let c=o-32;if(c>=46&&(c-=46,l=!0),s+=c,l)break;s*=46}n?n[r++]=s:n=new t(s)}return n}class VN{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Tre=new VN;class uLt{constructor(t,n){this.input=t,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Tre,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(t,n){let i=this.range,r=this.rangeIndex,s=this.pos+t;for(;si.to:s>=i.to;){if(r==this.ranges.length-1)return null;let o=this.ranges[++r];s+=o.from-i.to,i=o}return s}clipPos(t){if(t>=this.range.from&&tt)return Math.max(t,n.from);return this.end}peek(t){let n=this.chunkOff+t,i,r;if(n>=0&&n=this.chunk2Pos&&il.to&&(this.chunk2=this.chunk2.slice(0,l.to-i)),r=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),r}acceptToken(t,n=0){let i=n?this.resolveOffset(n,-1):this.pos;if(i==null||i=this.chunk2Pos&&this.posthis.range.to?t.slice(0,this.range.to-this.pos):t,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(t,n){if(n?(this.token=n,n.start=t,n.lookAhead=t+1,n.value=n.extended=-1):this.token=Tre,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,n-this.chunkPos);if(t>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,n-this.chunk2Pos);if(t>=this.range.from&&n<=this.range.to)return this.input.read(t,n);let i="";for(let r of this.ranges){if(r.from>=n)break;r.to>t&&(i+=this.input.read(Math.max(r.from,t),Math.min(r.to,n)))}return i}}class Ow{constructor(t,n){this.data=t,this.id=n}token(t,n){let{parser:i}=n.p;F4e(this.data,t,n,this.id,i.data,i.tokenPrecTable)}}Ow.prototype.contextual=Ow.prototype.fallback=Ow.prototype.extend=!1;class iP{constructor(t,n,i){this.precTable=n,this.elseToken=i,this.data=typeof t=="string"?xS(t):t}token(t,n){let i=t.pos,r=0;for(;;){let s=t.next<0,o=t.resolveOffset(1,1);if(F4e(this.data,t,n,0,this.data,this.precTable),t.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,o==null)break;t.reset(o,t.token)}r&&(t.reset(i,t.token),t.acceptToken(this.elseToken,r))}}iP.prototype.contextual=Ow.prototype.fallback=Ow.prototype.extend=!1;class Ia{constructor(t,n={}){this.token=t,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function F4e(e,t,n,i,r,s){let o=0,l=1<0){let g=e[m];if(c.allows(g)&&(t.token.value==-1||t.token.value==g||dLt(g,t.token.value,r,s))){t.acceptToken(g);break}}let d=t.next,f=0,h=e[o+2];if(t.next<0&&h>f&&e[u+h*3-3]==65535){o=e[u+h*3-1];continue e}for(;f>1,g=u+m+(m<<1),b=e[g],v=e[g+1]||65536;if(d=v)f=m+1;else{o=e[g+2],t.advance();continue e}}break}}function _re(e,t,n){for(let i=t,r;(r=e[i])!=65535;i++)if(r==n)return i-t;return-1}function dLt(e,t,n,i){let r=_re(n,i,t);return r<0||_re(n,i,e)t)&&!i.type.isError)return n<0?Math.max(0,Math.min(i.to-1,t-25)):Math.min(e.length,Math.max(i.from+1,t+25));if(n<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return n<0?0:e.length}}let fLt=class{constructor(t,n){this.fragments=t,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?jre(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?jre(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(tt)return this.nextStart=o,null;if(s instanceof Bi){if(o==t){if(o=Math.max(this.safeFrom,t)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[n]++,this.nextStart=o+s.length}}};class hLt{constructor(t,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(i=>new VN)}getActions(t){let n=0,i=null,{parser:r}=t.p,{tokenizers:s}=r,o=r.stateSlot(t.state,3),l=t.curContext?t.curContext.hash:0,c=0;for(let u=0;uf.end+25&&(c=Math.max(f.lookAhead,c)),f.value!=0)){let h=n;if(f.extended>-1&&(n=this.addActions(t,f.extended,f.end,n)),n=this.addActions(t,f.value,f.end,n),!d.extend&&(i=f,n>h))break}}for(;this.actions.length>n;)this.actions.pop();return c&&t.setLookAhead(c),!i&&t.pos==this.stream.end&&(i=new VN,i.value=t.p.parser.eofTerm,i.start=i.end=t.pos,n=this.addActions(t,i.value,i.end,n)),this.mainToken=i,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let n=new VN,{pos:i,p:r}=t;return n.start=i,n.end=Math.min(i+1,r.stream.end),n.value=i==r.stream.end?r.parser.eofTerm:0,n}updateCachedToken(t,n,i){let r=this.stream.clipPos(i.pos);if(n.token(this.stream.reset(r,t),i),t.value>-1){let{parser:s}=i.p;for(let o=0;o=0&&i.p.parser.dialect.allows(l>>1)){l&1?t.extended=l>>1:t.value=l>>1;break}}}else t.value=0,t.end=this.stream.clipPos(r+1)}putAction(t,n,i,r){for(let s=0;st.bufferLength*4?new fLt(i,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t=this.stacks,n=this.minStackPos,i=this.stacks=[],r,s;if(this.bigReductionCount>300&&t.length==1){let[o]=t;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;on)i.push(l);else{if(this.advanceStack(l,i,t))continue;{r||(r=[],s=[]),r.push(l);let c=this.tokens.getMainToken(l);s.push(c.value,c.end)}}break}}if(!i.length){let o=r&&gLt(r);if(o)return nu&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw nu&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&r){let o=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,i);if(o)return nu&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(i.length>o)for(i.sort((l,c)=>c.score-l.score);i.length>o;)i.pop();i.some(l=>l.reducePos>n)&&this.recovering--}else if(i.length>1){e:for(let o=0;o500&&u.buffer.length>500)if((l.score-u.score||l.buffer.length-u.buffer.length)>0)i.splice(c--,1);else{i.splice(o--,1);continue e}}}i.length>12&&(i.sort((o,l)=>l.score-o.score),i.splice(12,i.length-12))}this.minStackPos=i[0].pos;for(let o=1;o ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let u=t.curContext&&t.curContext.tracker.strict,d=u?t.curContext.hash:0;for(let f=this.fragments.nodeAt(r);f;){let h=this.parser.nodeSet.types[f.type.id]==f.type?s.getGoto(t.state,f.type.id):-1;if(h>-1&&f.length&&(!u||(f.prop(ui.contextHash)||0)==d))return t.useNode(f,h),nu&&console.log(o+this.stackID(t)+` (via reuse of ${s.getName(f.type.id)})`),!0;if(!(f instanceof Bi)||f.children.length==0||f.positions[0]>0)break;let m=f.children[0];if(m instanceof Bi&&f.positions[0]==0)f=m;else break}}let l=s.stateSlot(t.state,4);if(l>0)return t.reduce(l),nu&&console.log(o+this.stackID(t)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(t.stack.length>=8400)for(;t.stack.length>6e3&&t.forceReduce(););let c=this.tokens.getActions(t);for(let u=0;ur?n.push(g):i.push(g)}return!1}advanceFully(t,n){let i=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>i)return Nre(t,n),!0}}runRecovery(t,n,i){let r=null,s=!1;for(let o=0;o ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),nu&&console.log(d+this.stackID(l)+" (restarted)"),this.advanceFully(l,i))))continue;let f=l.split(),h=d;for(let m=0;m<10&&f.forceReduce()&&(nu&&console.log(h+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,i));m++)nu&&(h=this.stackID(f)+" -> ");for(let m of l.recoverByInsert(c))nu&&console.log(d+this.stackID(m)+" (via recover-insert)"),this.advanceFully(m,i);this.stream.end>l.pos?(u==l.pos&&(u++,c=0),l.recoverByDelete(c,u),nu&&console.log(d+this.stackID(l)+` (via recover-delete ${this.parser.getName(c)})`),Nre(l,i)):(!r||r.scoree;class rL{constructor(t){this.start=t.start,this.shift=t.shift||m$,this.reduce=t.reduce||m$,this.reuse=t.reuse||m$,this.hash=t.hash||(()=>0),this.strict=t.strict!==!1}}class sm extends WM{constructor(t){if(super(),this.wrappers=[],t.version!=14)throw new RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);let n=t.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let l=0;lt.topRules[l][1]),r=[];for(let l=0;l=0)s(d,c,l[u++]);else{let f=l[u+-d];for(let h=-d;h>0;h--)s(l[u++],c,f);u++}}}this.nodeSet=new fO(n.map((l,c)=>Za.define({name:c>=this.minRepeatTerm?void 0:l,id:c,props:r[c],top:i.indexOf(c)>-1,error:c==0,skipped:t.skippedNodes&&t.skippedNodes.indexOf(c)>-1}))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=L5e;let o=xS(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new Ow(o,l):l),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,n,i){let r=new pLt(this,t,n,i);for(let s of this.wrappers)r=s(r,t,n,i);return r}getGoto(t,n,i=!1){let r=this.goto;if(n>=r[0])return-1;for(let s=r[n+1];;){let o=r[s++],l=o&1,c=r[s++];if(l&&i)return c;for(let u=s+(o>>1);s0}validAction(t,n){return!!this.allActions(t,i=>i==n?!0:null)}allActions(t,n){let i=this.stateSlot(t,4),r=i?n(i):void 0;for(let s=this.stateSlot(t,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=pp(this.data,s+2);else break;r=n(pp(this.data,s+1))}return r}nextStates(t){let n=[];for(let i=this.stateSlot(t,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=pp(this.data,i+2);else break;if(!(this.data[i+2]&1)){let r=this.data[i+1];n.some((s,o)=>o&1&&s==r)||n.push(this.data[i],r)}}return n}configure(t){let n=Object.assign(Object.create(sm.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let i=this.topRules[t.top];if(!i)throw new RangeError(`Invalid top rule name ${t.top}`);n.top=i}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(i=>{let r=t.tokenizers.find(s=>s.from==i);return r?r.to:i})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((i,r)=>{let s=t.specializers.find(l=>l.from==i.external);if(!s)return i;let o=Object.assign(Object.assign({},i),{external:s.to});return n.specializers[r]=Rre(o),o})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let n=this.dynamicPrecedences;return n==null?0:n[t]||0}parseDialect(t){let n=Object.keys(this.dialects),i=n.map(()=>!1);if(t)for(let s of t.split(" ")){let o=n.indexOf(s);o>=0&&(i[o]=!0)}let r=null;for(let s=0;si)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.scoree.external(n,i)<<1|t}return e.get}const bLt=316,yLt=317,Ire=1,vLt=2,xLt=3,wLt=4,OLt=318,kLt=320,SLt=321,ELt=5,CLt=6,ALt=0,s7=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],B4e=125,TLt=59,a7=47,_Lt=42,jLt=43,NLt=45,RLt=60,ILt=44,PLt=63,DLt=46,MLt=91,LLt=new rL({start:!1,shift(e,t){return t==ELt||t==CLt||t==kLt?e:t==SLt},strict:!1}),$Lt=new Ia((e,t)=>{let{next:n}=e;(n==B4e||n==-1||t.context)&&e.acceptToken(OLt)},{contextual:!0,fallback:!0}),FLt=new Ia((e,t)=>{let{next:n}=e,i;s7.indexOf(n)>-1||n==a7&&((i=e.peek(1))==a7||i==_Lt)||n!=B4e&&n!=TLt&&n!=-1&&!t.context&&e.acceptToken(bLt)},{contextual:!0}),BLt=new Ia((e,t)=>{e.next==MLt&&!t.context&&e.acceptToken(yLt)},{contextual:!0}),ULt=new Ia((e,t)=>{let{next:n}=e;if(n==jLt||n==NLt){if(e.advance(),n==e.next){e.advance();let i=!t.context&&t.canShift(Ire);e.acceptToken(i?Ire:vLt)}}else n==PLt&&e.peek(1)==DLt&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(xLt))},{contextual:!0});function g$(e,t){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!t&&e>=48&&e<=57}const QLt=new Ia((e,t)=>{if(e.next!=RLt||!t.dialectEnabled(ALt)||(e.advance(),e.next==a7))return;let n=0;for(;s7.indexOf(e.next)>-1;)e.advance(),n++;if(g$(e.next,!0)){for(e.advance(),n++;g$(e.next,!1);)e.advance(),n++;for(;s7.indexOf(e.next)>-1;)e.advance(),n++;if(e.next==ILt)return;for(let i=0;;i++){if(i==7){if(!g$(e.next,!0))return;break}if(e.next!="extends".charCodeAt(i))break;e.advance(),n++}}e.acceptToken(wLt,-n)}),zLt=bm({"get set async static":fe.modifier,"for while do if else switch try catch finally return throw break continue default case defer":fe.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":fe.operatorKeyword,"let var const using function class extends":fe.definitionKeyword,"import export from":fe.moduleKeyword,"with debugger new":fe.keyword,TemplateString:fe.special(fe.string),super:fe.atom,BooleanLiteral:fe.bool,this:fe.self,null:fe.null,Star:fe.modifier,VariableName:fe.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":fe.function(fe.variableName),VariableDefinition:fe.definition(fe.variableName),Label:fe.labelName,PropertyName:fe.propertyName,PrivatePropertyName:fe.special(fe.propertyName),"CallExpression/MemberExpression/PropertyName":fe.function(fe.propertyName),"FunctionDeclaration/VariableDefinition":fe.function(fe.definition(fe.variableName)),"ClassDeclaration/VariableDefinition":fe.definition(fe.className),"NewExpression/VariableName":fe.className,PropertyDefinition:fe.definition(fe.propertyName),PrivatePropertyDefinition:fe.definition(fe.special(fe.propertyName)),UpdateOp:fe.updateOperator,"LineComment Hashbang":fe.lineComment,BlockComment:fe.blockComment,Number:fe.number,String:fe.string,Escape:fe.escape,ArithOp:fe.arithmeticOperator,LogicOp:fe.logicOperator,BitOp:fe.bitwiseOperator,CompareOp:fe.compareOperator,RegExp:fe.regexp,Equals:fe.definitionOperator,Arrow:fe.function(fe.punctuation),": Spread":fe.punctuation,"( )":fe.paren,"[ ]":fe.squareBracket,"{ }":fe.brace,"InterpolationStart InterpolationEnd":fe.special(fe.brace),".":fe.derefOperator,", ;":fe.separator,"@":fe.meta,TypeName:fe.typeName,TypeDefinition:fe.definition(fe.typeName),"type enum interface implements namespace module declare":fe.definitionKeyword,"abstract global Privacy readonly override":fe.modifier,"is keyof unique infer asserts":fe.operatorKeyword,JSXAttributeValue:fe.attributeValue,JSXText:fe.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":fe.angleBracket,"JSXIdentifier JSXNameSpacedName":fe.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":fe.attributeName,"JSXBuiltin/JSXIdentifier":fe.standard(fe.tagName)}),VLt={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},HLt={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},qLt={__proto__:null,"<":193},WLt=sm.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-EtOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-EPO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-ERQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<VO!l$xO#jROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!OVO!l$xO#jVO!l$xO#jROe!iOpkOrPO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]VO!l$xO#j^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOrROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]WO!l$xO#jgPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{SU+P%]S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mR>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o>UPS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^T)z$u){V+P%]S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SS#q]SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uSSR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:mSR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:oS)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>X>ZR>Y>['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mSS$oh$pR4U/U'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:mS#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^Q+T%aQ/c*Oo4OP>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^n=rTQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o4OP>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f]>^nZ>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f]>^nZ>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.lPQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.nSR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:LLt,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[zLt],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$i&j(Wp(Z!b'|0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(X#S$i&j'}0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$i&j(Wp(Z!b'}0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$i&j!p),Q(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(V':f$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$i&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$d`$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$d``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$d`$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(Z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$d`(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$i&j(Wp(Z!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$i&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(Z!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$i&j(WpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(WpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Wp(Z!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$i&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$i&j(Z!b!X7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(Z!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(Z!b!X7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(Z!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$i&j(Z!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!g$b$i&j$O)Lv(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#R-v$?V_!^(CdvBr$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!q7`$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$i&j(Wp(Z!b'|0/l$]#t(T,2j(e$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[FLt,BLt,ULt,QLt,2,3,4,5,6,7,8,9,10,11,12,13,14,$Lt,new iP("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new iP("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:e=>VLt[e]||-1},{term:343,get:e=>HLt[e]||-1},{term:95,get:e=>qLt[e]||-1}],tokenPrec:15201});class oW{constructor(t,n,i,r){this.state=t,this.pos=n,this.explicit=i,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let n=Yr(this.state).resolveInner(this.pos,-1);for(;n&&t.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(t){let n=this.state.doc.lineAt(this.pos),i=Math.max(n.from,this.pos-250),r=n.text.slice(i-n.from,this.pos-n.from),s=r.search(Q4e(t,!1));return s<0?null:{from:i+s,to:this.pos,text:r.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(t,n,i){t=="abort"&&this.abortListeners&&(this.abortListeners.push(n),i&&i.onDocChange&&(this.abortOnDocChange=!0))}}function Pre(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function KLt(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let s=1;stypeof r=="string"?{label:r}:r),[n,i]=t.every(r=>/^\w+$/.test(r.label))?[/\w*$/,/\w+$/]:KLt(t);return r=>{let s=r.matchBefore(i);return s||r.explicit?{from:s?s.from:r.pos,options:t,validFor:n}:null}}function U4e(e,t){return n=>{for(let i=Yr(n.state).resolveInner(n.pos,-1);i;i=i.parent){if(e.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return t(n)}}class Dre{constructor(t,n,i,r){this.completion=t,this.source=n,this.match=i,this.score=r}}function Jy(e){return e.selection.main.from}function Q4e(e,t){var n;let{source:i}=e,r=t&&i[0]!="^",s=i[i.length-1]!="$";return!r&&!s?e:new RegExp(`${r?"^":""}(?:${i})${s?"$":""}`,(n=e.flags)!==null&&n!==void 0?n:e.ignoreCase?"i":"")}const cW=Rh.define();function GLt(e,t,n,i){let{main:r}=e.selection,s=n-r.from,o=i-r.from;return{...e.changeByRange(l=>{if(l!=r&&n!=i&&e.sliceDoc(l.from+s,l.from+o)!=e.sliceDoc(n,i))return{range:l};let c=e.toText(t);return{changes:{from:l.from+s,to:i==r.from?l.to:l.from+o,insert:c},range:ht.cursor(l.from+s+c.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const Mre=new WeakMap;function XLt(e){if(!Array.isArray(e))return e;let t=Mre.get(e);return t||Mre.set(e,t=lW(e)),t}const rP=pi.define(),VC=pi.define();class YLt{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n=48&&k<=57||k>=97&&k<=122?2:k>=65&&k<=90?1:0:(S=Mq(k))!=S.toLowerCase()?1:S!=S.toUpperCase()?2:0;(!w||C==1&&v||O==0&&C!=0)&&(n[f]==k||i[f]==k&&(h=!0)?o[f++]=w:o.length&&(y=!1)),O=C,w+=eh(k)}return f==c&&o[0]==0&&y?this.result(-100+(h?-200:0),o,t):m==c&&g==0?this.ret(-200-t.length+(b==t.length?0:-100),[0,b]):l>-1?this.ret(-700-t.length,[l,l+this.pattern.length]):m==c?this.ret(-900-t.length,[g,b]):f==c?this.result(-100+(h?-200:0)+-700+(y?0:-1100),o,t):n.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,t)}result(t,n,i){let r=[],s=0;for(let o of n){let l=o+(this.astral?eh(jc(i,o)):1);s&&r[s-1]==o?r[s-1]=l:(r[s++]=o,r[s++]=l)}return this.ret(t-i.length,r)}}class ZLt{constructor(t){this.pattern=t,this.matched=[],this.score=0,this.folded=t.toLowerCase()}match(t){if(t.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:JLt,filterStrict:!1,compareCompletions:(t,n)=>(t.sortText||t.label).localeCompare(n.sortText||n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(t,n)=>t&&n,closeOnBlur:(t,n)=>t&&n,icons:(t,n)=>t&&n,tooltipClass:(t,n)=>i=>Lre(t(i),n(i)),optionClass:(t,n)=>i=>Lre(t(i),n(i)),addToOptions:(t,n)=>t.concat(n),filterStrict:(t,n)=>t||n})}});function Lre(e,t){return e?t?e+" "+t:e:t}function JLt(e,t,n,i,r,s){let o=e.textDirection==os.RTL,l=o,c=!1,u="top",d,f,h=t.left-r.left,m=r.right-t.right,g=i.right-i.left,b=i.bottom-i.top;if(l&&h=b||w>t.top?d=n.bottom-t.top:(u="bottom",d=t.bottom-n.top)}let v=(t.bottom-t.top)/s.offsetHeight,y=(t.right-t.left)/s.offsetWidth;return{style:`${u}: ${d/v}px; max-width: ${f/y}px`,class:"cm-completionInfo-"+(c?o?"left-narrow":"right-narrow":l?"left":"right")}}const uW=pi.define();function e5t(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(n){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),n.type&&i.classList.add(...n.type.split(/\s+/g).map(r=>"cm-completionIcon-"+r)),i.setAttribute("aria-hidden","true"),i},position:20}),t.push({render(n,i,r,s){let o=document.createElement("span");o.className="cm-completionLabel";let l=n.displayLabel||n.label,c=0;for(let u=0;uc&&o.appendChild(document.createTextNode(l.slice(c,d)));let h=o.appendChild(document.createElement("span"));h.appendChild(document.createTextNode(l.slice(d,f))),h.className="cm-completionMatchedText",c=f}return cn.position-i.position).map(n=>n.render)}function b$(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let r=Math.floor(t/n);return{from:r*n,to:(r+1)*n}}let i=Math.ceil((e-t)/n);return{from:e-i*n,to:e-(i-1)*n}}class t5t{constructor(t,n,i){this.view=t,this.stateField=n,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:c=>this.placeInfo(c),key:this},this.space=null,this.currentClass="";let r=t.state.field(n),{options:s,selected:o}=r.open,l=t.state.facet(jo);this.optionContent=e5t(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=b$(s.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",c=>{let{options:u}=t.state.field(n).open;for(let d=c.target,f;d&&d!=this.dom;d=d.parentNode)if(d.nodeName=="LI"&&(f=/-(\d+)$/.exec(d.id))&&+f[1]this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;d!=null&&(t.dispatch({effects:uW.of(d)}),c.preventDefault())}}),this.dom.addEventListener("focusout",c=>{let u=t.state.field(this.stateField,!1);u&&u.tooltip&&t.state.facet(jo).closeOnBlur&&c.relatedTarget!=t.contentDOM&&t.dispatch({effects:VC.of(null)})}),this.showOptions(s,r.id)}mount(){this.updateSel()}showOptions(t,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(t){var n;let i=t.state.field(this.stateField),r=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),i!=r){let{options:s,selected:o,disabled:l}=i.open;(!r.open||r.open.options!=s)&&(this.range=b$(s.length,o,t.state.facet(jo).maxRenderedOptions),this.showOptions(s,i.id)),this.updateSel(),l!=((n=r.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(t){let n=this.tooltipClass(t);if(n!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of n.split(" "))i&&this.dom.classList.add(i);this.currentClass=n}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),n=t.open;(n.selected>-1&&n.selected=this.range.to)&&(this.range=b$(n.options.length,n.selected,this.view.state.facet(jo).maxRenderedOptions),this.showOptions(n.options,t.id));let i=this.updateSelectedOption(n.selected);if(i){this.destroyInfo();let{completion:r}=n.options[n.selected],{info:s}=r;if(!s)return;let o=typeof s=="string"?document.createTextNode(s):s(r);if(!o)return;"then"in o?o.then(l=>{l&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(l,r)}).catch(l=>Dc(this.view.state,l,"completion info")):(this.addInfoPane(o,r),i.setAttribute("aria-describedby",this.info.id))}}addInfoPane(t,n){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",i.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),t.nodeType!=null)i.appendChild(t),this.infoDestroy=null;else{let{dom:r,destroy:s}=t;i.appendChild(r),this.infoDestroy=s||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){let n=null;for(let i=this.list.firstChild,r=this.range.from;i;i=i.nextSibling,r++)i.nodeName!="LI"||!i.id?r--:r==t?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),n=i):i.hasAttribute("aria-selected")&&(i.removeAttribute("aria-selected"),i.removeAttribute("aria-describedby"));return n&&i5t(this.list,n),n}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let n=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),r=t.getBoundingClientRect(),s=this.space;if(!s){let o=this.dom.ownerDocument.documentElement;s={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return r.top>Math.min(s.bottom,n.bottom)-10||r.bottom{o.target==r&&o.preventDefault()});let s=null;for(let o=i.from;oi.from||i.from==0))if(s=h,typeof u!="string"&&u.header)r.appendChild(u.header(u));else{let m=r.appendChild(document.createElement("completion-section"));m.textContent=h}}const d=r.appendChild(document.createElement("li"));d.id=n+"-"+o,d.setAttribute("role","option");let f=this.optionClass(l);f&&(d.className=f);for(let h of this.optionContent){let m=h(l,this.view.state,this.view,c);m&&d.appendChild(m)}}return i.from&&r.classList.add("cm-completionListIncompleteTop"),i.tonew t5t(n,e,t)}function i5t(e,t){let n=e.getBoundingClientRect(),i=t.getBoundingClientRect(),r=n.height/e.offsetHeight;i.topn.bottom&&(e.scrollTop+=(i.bottom-n.bottom)/r)}function $re(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}function r5t(e,t){let n=[],i=null,r=null,s=d=>{n.push(d);let{section:f}=d.completion;if(f){i||(i=[]);let h=typeof f=="string"?f:f.name;i.some(m=>m.name==h)||i.push(typeof f=="string"?{name:h}:f)}},o=t.facet(jo);for(let d of e)if(d.hasResult()){let f=d.result.getMatch;if(d.result.filter===!1)for(let h of d.result.options)s(new Dre(h,d.source,f?f(h):[],1e9-n.length));else{let h=t.sliceDoc(d.from,d.to),m,g=o.filterStrict?new ZLt(h):new YLt(h);for(let b of d.result.options)if(m=g.match(b.label)){let v=b.displayLabel?f?f(b,m.matched):[]:m.matched,y=m.score+(b.boost||0);if(s(new Dre(b,d.source,v,y)),typeof b.section=="object"&&b.section.rank==="dynamic"){let{name:w}=b.section;r||(r=Object.create(null)),r[w]=Math.max(y,r[w]||-1e9)}}}}if(i){let d=Object.create(null),f=0,h=(m,g)=>(m.rank==="dynamic"&&g.rank==="dynamic"?r[g.name]-r[m.name]:0)||(typeof m.rank=="number"?m.rank:1e9)-(typeof g.rank=="number"?g.rank:1e9)||(m.nameh.score-f.score||u(f.completion,h.completion))){let f=d.completion;!c||c.label!=f.label||c.detail!=f.detail||c.type!=null&&f.type!=null&&c.type!=f.type||c.apply!=f.apply||c.boost!=f.boost?l.push(d):$re(d.completion)>$re(c)&&(l[l.length-1]=d),c=d.completion}return l}class Ux{constructor(t,n,i,r,s,o){this.options=t,this.attrs=n,this.tooltip=i,this.timestamp=r,this.selected=s,this.disabled=o}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new Ux(this.options,Fre(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,i,r,s,o){if(r&&!o&&t.some(u=>u.isPending))return r.setDisabled();let l=r5t(t,n);if(!l.length)return r&&t.some(u=>u.isPending)?r.setDisabled():null;let c=n.facet(jo).selectOnOpen?0:-1;if(r&&r.selected!=c&&r.selected!=-1){let u=r.options[r.selected].completion;for(let d=0;dd.hasResult()?Math.min(u,d.from):u,1e8),create:u5t,above:s.aboveCursor},r?r.timestamp:Date.now(),c,!1)}map(t){return new Ux(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new Ux(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class sP{constructor(t,n,i){this.active=t,this.id=n,this.open=i}static start(){return new sP(l5t,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,i=n.facet(jo),s=(i.override||n.languageDataAt("autocomplete",Jy(n)).map(XLt)).map(c=>(this.active.find(d=>d.source==c)||new md(c,this.active.some(d=>d.state!=0)?1:0)).update(t,i));s.length==this.active.length&&s.every((c,u)=>c==this.active[u])&&(s=this.active);let o=this.open,l=t.effects.some(c=>c.is(dW));o&&t.docChanged&&(o=o.map(t.changes)),t.selection||s.some(c=>c.hasResult()&&t.changes.touchesRange(c.from,c.to))||!s5t(s,this.active)||l?o=Ux.build(s,n,this.id,o,i,l):o&&o.disabled&&!s.some(c=>c.isPending)&&(o=null),!o&&s.every(c=>!c.isPending)&&s.some(c=>c.hasResult())&&(s=s.map(c=>c.hasResult()?new md(c.source,0):c));for(let c of t.effects)c.is(uW)&&(o=o&&o.setSelected(c.value,this.id));return s==this.active&&o==this.open?this:new sP(s,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?a5t:o5t}}function s5t(e,t){if(e==t)return!0;for(let n=0,i=0;;){for(;n-1&&(n["aria-activedescendant"]=e+"-"+t),n}const l5t=[];function z4e(e,t){if(e.isUserEvent("input.complete")){let i=e.annotation(cW);if(i&&t.activateOnCompletion(i))return 12}let n=e.isUserEvent("input.type");return n&&t.activateOnTyping?5:n?1:e.isUserEvent("delete.backward")?2:e.selection?8:e.docChanged?16:0}class md{constructor(t,n,i=!1){this.source=t,this.state=n,this.explicit=i}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let i=z4e(t,n),r=this;(i&8||i&16&&this.touches(t))&&(r=new md(r.source,0)),i&4&&r.state==0&&(r=new md(this.source,1)),r=r.updateFor(t,i);for(let s of t.effects)if(s.is(rP))r=new md(r.source,1,s.value);else if(s.is(VC))r=new md(r.source,0);else if(s.is(dW))for(let o of s.value)o.source==r.source&&(r=o);return r}updateFor(t,n){return this.map(t.changes)}map(t){return this}touches(t){return t.changes.touchesRange(Jy(t.state))}}class kw extends md{constructor(t,n,i,r,s,o){super(t,3,n),this.limit=i,this.result=r,this.from=s,this.to=o}hasResult(){return!0}updateFor(t,n){var i;if(!(n&3))return this.map(t.changes);let r=this.result;r.map&&!t.changes.empty&&(r=r.map(r,t.changes));let s=t.changes.mapPos(this.from),o=t.changes.mapPos(this.to,1),l=Jy(t.state);if(l>o||!r||n&2&&(Jy(t.startState)==this.from||ln.map(t))}}),Nc=dl.define({create(){return sP.start()},update(e,t){return e.update(t)},provide:e=>[Jq.from(e,t=>t.tooltip),Jt.contentAttributes.from(e,t=>t.attrs)]});function fW(e,t){const n=t.completion.apply||t.completion.label;let i=e.state.field(Nc).active.find(r=>r.source==t.source);return i instanceof kw?(typeof n=="string"?e.dispatch({...GLt(e.state,n,i.from,i.to),annotations:cW.of(t.completion)}):n(e,t.completion,i.from,i.to),!0):!1}const u5t=n5t(Nc,fW);function ij(e,t="option"){return n=>{let i=n.state.field(Nc,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp-1?i.open.selected+r*(e?1:-1):e?0:o-1;return l<0?l=t=="page"?0:o-1:l>=o&&(l=t=="page"?o-1:0),n.dispatch({effects:uW.of(l)}),!0}}const d5t=e=>{let t=e.state.field(Nc,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestampe.state.field(Nc,!1)?(e.dispatch({effects:rP.of(!0)}),!0):!1,f5t=e=>{let t=e.state.field(Nc,!1);return!t||!t.active.some(n=>n.state!=0)?!1:(e.dispatch({effects:VC.of(null)}),!0)};class h5t{constructor(t,n){this.active=t,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const p5t=50,m5t=1e3,g5t=ma.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(Nc).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(Nc),n=e.state.facet(jo);if(!e.selectionSet&&!e.docChanged&&e.startState.field(Nc)==t)return;let i=e.transactions.some(s=>{let o=z4e(s,n);return o&8||(s.selection||s.docChanged)&&!(o&3)});for(let s=0;sp5t&&Date.now()-o.time>m5t){for(let l of o.context.abortListeners)try{l()}catch(c){Dc(this.view.state,c)}o.context.abortListeners=null,this.running.splice(s--,1)}else o.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(s=>s.effects.some(o=>o.is(rP)))&&(this.pendingStart=!0);let r=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(s=>s.isPending&&!this.running.some(o=>o.active.source==s.source))?setTimeout(()=>this.startUpdate(),r):-1,this.composing!=0)for(let s of e.transactions)s.isUserEvent("input.type")?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(Nc);for(let n of t.active)n.isPending&&!this.running.some(i=>i.active.source==n.source)&&this.startQuery(n);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(jo).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=Jy(t),i=new oW(t,n,e.explicit,this.view),r=new h5t(e,i);this.running.push(r),Promise.resolve(e.source(i)).then(s=>{r.context.aborted||(r.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:VC.of(null)}),Dc(this.view.state,s)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(jo).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(jo),i=this.view.state.field(Nc);for(let r=0;rl.source==s.active.source);if(o&&o.isPending)if(s.done==null){let l=new md(s.active.source,0);for(let c of s.updates)l=l.update(c,n);l.isPending||t.push(l)}else this.startQuery(o)}(t.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:dW.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(Nc,!1);if(t&&t.tooltip&&this.view.state.facet(jo).closeOnBlur){let n=t.open&&o4e(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:VC.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:rP.of(!1)}),20),this.composing=0}}}),b5t=typeof navigator=="object"&&/Win/.test(navigator.platform),y5t=gm.highest(Jt.domEventHandlers({keydown(e,t){let n=t.state.field(Nc,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(b5t&&e.altKey)||e.metaKey)return!1;let i=n.open.options[n.open.selected],r=n.active.find(o=>o.source==i.source),s=i.completion.commitCharacters||r.result.commitCharacters;return s&&s.indexOf(e.key)>-1&&fW(t,i),!1}})),V4e=Jt.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class v5t{constructor(t,n,i,r){this.field=t,this.line=n,this.from=i,this.to=r}}class hW{constructor(t,n,i){this.field=t,this.from=n,this.to=i}map(t){let n=t.mapPos(this.from,-1,il.TrackDel),i=t.mapPos(this.to,1,il.TrackDel);return n==null||i==null?null:new hW(this.field,n,i)}}class pW{constructor(t,n){this.lines=t,this.fieldPositions=n}instantiate(t,n){let i=[],r=[n],s=t.doc.lineAt(n),o=/^\s*/.exec(s.text)[0];for(let c of this.lines){if(i.length){let u=o,d=/^\t*/.exec(c)[0].length;for(let f=0;fnew hW(c.field,r[c.line]+c.from,r[c.line]+c.to));return{text:i,ranges:l}}static parse(t){let n=[],i=[],r=[],s;for(let o of t.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(o);){let l=s[1]?+s[1]:null,c=s[2]||s[3]||"",u=-1;l===0&&(l=1e9);let d=c.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f=u&&h.field++}for(let f of r)if(f.line==i.length&&f.from>s.index){let h=s[2]?3+(s[1]||"").length:2;f.from-=h,f.to-=h}r.push(new v5t(u,i.length,s.index,s.index+d.length)),o=o.slice(0,s.index)+c+o.slice(s.index+s[0].length)}o=o.replace(/\\([{}])/g,(l,c,u)=>{for(let d of r)d.line==i.length&&d.from>u&&(d.from--,d.to--);return c}),i.push(o)}return new pW(i,r)}}let x5t=Fn.widget({widget:new class extends jf{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),w5t=Fn.mark({class:"cm-snippetField"});class mO{constructor(t,n){this.ranges=t,this.active=n,this.deco=Fn.set(t.map(i=>(i.from==i.to?x5t:w5t).range(i.from,i.to)),!0)}map(t){let n=[];for(let i of this.ranges){let r=i.map(t);if(!r)return null;n.push(r)}return new mO(n,this.active)}selectionInsideField(t){return t.ranges.every(n=>this.ranges.some(i=>i.field==this.active&&i.from<=n.from&&i.to>=n.to))}}const IT=pi.define({map(e,t){return e&&e.map(t)}}),O5t=pi.define(),HC=dl.define({create(){return null},update(e,t){for(let n of t.effects){if(n.is(IT))return n.value;if(n.is(O5t)&&e)return new mO(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>Jt.decorations.from(e,t=>t?t.deco:Fn.none)});function mW(e,t){return ht.create(e.filter(n=>n.field==t).map(n=>ht.range(n.from,n.to)))}function k5t(e){let t=pW.parse(e);return(n,i,r,s)=>{let{text:o,ranges:l}=t.instantiate(n.state,r),{main:c}=n.state.selection,u={changes:{from:r,to:s==c.from?c.to:s,insert:xr.of(o)},scrollIntoView:!0,annotations:i?[cW.of(i),Xa.userEvent.of("input.complete")]:void 0};if(l.length&&(u.selection=mW(l,0)),l.some(d=>d.field>0)){let d=new mO(l,0),f=u.effects=[IT.of(d)];n.state.field(HC,!1)===void 0&&f.push(pi.appendConfig.of([HC,T5t,_5t,V4e]))}n.dispatch(n.state.update(u))}}function H4e(e){return({state:t,dispatch:n})=>{let i=t.field(HC,!1);if(!i||e<0&&i.active==0)return!1;let r=i.active+e,s=e>0&&!i.ranges.some(o=>o.field==r+e);return n(t.update({selection:mW(i.ranges,r),effects:IT.of(s?null:new mO(i.ranges,r)),scrollIntoView:!0})),!0}}const S5t=({state:e,dispatch:t})=>e.field(HC,!1)?(t(e.update({effects:IT.of(null)})),!0):!1,E5t=H4e(1),C5t=H4e(-1),A5t=[{key:"Tab",run:E5t,shift:C5t},{key:"Escape",run:S5t}],Bre=mn.define({combine(e){return e.length?e[0]:A5t}}),T5t=gm.highest(hO.compute([Bre],e=>e.facet(Bre)));function Ys(e,t){return{...t,apply:k5t(e)}}const _5t=Jt.domEventHandlers({mousedown(e,t){let n=t.state.field(HC,!1),i;if(!n||(i=t.posAtCoords({x:e.clientX,y:e.clientY}))==null)return!1;let r=n.ranges.find(s=>s.from<=i&&s.to>=i);return!r||r.field==n.active?!1:(t.dispatch({selection:mW(n.ranges,r.field),effects:IT.of(n.ranges.some(s=>s.field>r.field)?new mO(n.ranges,r.field):null),scrollIntoView:!0}),!0)}}),qC={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Dy=pi.define({map(e,t){let n=t.mapPos(e,-1,il.TrackAfter);return n??void 0}}),gW=new class extends fb{};gW.startSide=1;gW.endSide=-1;const q4e=dl.define({create(){return Ki.empty},update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:i=>i>=n.from&&i<=n.to})}for(let n of t.effects)n.is(Dy)&&(e=e.update({add:[gW.range(n.value,n.value+1)]}));return e}});function j5t(){return[R5t,q4e]}const v$="()[]{}<>«»»«[]{}";function W4e(e){for(let t=0;t{if((N5t?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let r=e.state.selection.main;if(i.length>2||i.length==2&&eh(jc(i,0))==1||t!=r.from||n!=r.to)return!1;let s=D5t(e.state,i);return s?(e.dispatch(s),!0):!1}),I5t=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=K4e(e,e.selection.main.head).brackets||qC.brackets,r=null,s=e.changeByRange(o=>{if(o.empty){let l=M5t(e.doc,o.head);for(let c of i)if(c==l&&sL(e.doc,o.head)==W4e(jc(c,0)))return{changes:{from:o.head-c.length,to:o.head+c.length},range:ht.cursor(o.head-c.length)}}return{range:r=o}});return r||t(e.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!r},P5t=[{key:"Backspace",run:I5t}];function D5t(e,t){let n=K4e(e,e.selection.main.head),i=n.brackets||qC.brackets;for(let r of i){let s=W4e(jc(r,0));if(t==r)return s==r?F5t(e,r,i.indexOf(r+r+r)>-1,n):L5t(e,r,s,n.before||qC.before);if(t==s&&G4e(e,e.selection.main.from))return $5t(e,r,s)}return null}function G4e(e,t){let n=!1;return e.field(q4e).between(0,e.doc.length,i=>{i==t&&(n=!0)}),n}function sL(e,t){let n=e.sliceString(t,t+2);return n.slice(0,eh(jc(n,0)))}function M5t(e,t){let n=e.sliceString(t-2,t);return eh(jc(n,0))==n.length?n:n.slice(1)}function L5t(e,t,n,i){let r=null,s=e.changeByRange(o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:n,from:o.to}],effects:Dy.of(o.to+t.length),range:ht.range(o.anchor+t.length,o.head+t.length)};let l=sL(e.doc,o.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:t+n,from:o.head},effects:Dy.of(o.head+t.length),range:ht.cursor(o.head+t.length)}:{range:r=o}});return r?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function $5t(e,t,n){let i=null,r=e.changeByRange(s=>s.empty&&sL(e.doc,s.head)==n?{changes:{from:s.head,to:s.head+n.length,insert:n},range:ht.cursor(s.head+n.length)}:i={range:s});return i?null:e.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function F5t(e,t,n,i){let r=i.stringPrefixes||qC.stringPrefixes,s=null,o=e.changeByRange(l=>{if(!l.empty)return{changes:[{insert:t,from:l.from},{insert:t,from:l.to}],effects:Dy.of(l.to+t.length),range:ht.range(l.anchor+t.length,l.head+t.length)};let c=l.head,u=sL(e.doc,c),d;if(u==t){if(Ure(e,c))return{changes:{insert:t+t,from:c},effects:Dy.of(c+t.length),range:ht.cursor(c+t.length)};if(G4e(e,c)){let h=n&&e.sliceDoc(c,c+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:c,to:c+h.length,insert:h},range:ht.cursor(c+h.length)}}}else{if(n&&e.sliceDoc(c-2*t.length,c)==t+t&&(d=Qre(e,c-2*t.length,r))>-1&&Ure(e,d))return{changes:{insert:t+t+t+t,from:c},effects:Dy.of(c+t.length),range:ht.cursor(c+t.length)};if(e.charCategorizer(c)(u)!=Qs.Word&&Qre(e,c,r)>-1&&!B5t(e,c,t,r))return{changes:{insert:t+t,from:c},effects:Dy.of(c+t.length),range:ht.cursor(c+t.length)}}return{range:s=l}});return s?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function Ure(e,t){let n=Yr(e).resolveInner(t+1);return n.parent&&n.from==t}function B5t(e,t,n,i){let r=Yr(e).resolveInner(t,-1),s=i.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=e.sliceDoc(r.from,Math.min(r.to,r.from+n.length+s)),c=l.indexOf(n);if(!c||c>-1&&i.indexOf(l.slice(0,c))>-1){let d=r.firstChild;for(;d&&d.from==r.from&&d.to-d.from>n.length+c;){if(e.sliceDoc(d.to-n.length,d.to)==n)return!1;d=d.firstChild}return!0}let u=r.to==t&&r.parent;if(!u)break;r=u}return!1}function Qre(e,t,n){let i=e.charCategorizer(t);if(i(e.sliceDoc(t-1,t))!=Qs.Word)return t;for(let r of n){let s=t-r.length;if(e.sliceDoc(s,t)==r&&i(e.sliceDoc(s-1,s))!=Qs.Word)return s}return-1}function U5t(e={}){return[y5t,Nc,jo.of(e),g5t,Q5t,V4e]}const X4e=[{key:"Ctrl-Space",run:y$},{mac:"Alt-`",run:y$},{mac:"Alt-i",run:y$},{key:"Escape",run:f5t},{key:"ArrowDown",run:ij(!0)},{key:"ArrowUp",run:ij(!1)},{key:"PageDown",run:ij(!0,"page")},{key:"PageUp",run:ij(!1,"page")},{key:"Enter",run:d5t}],Q5t=gm.highest(hO.computeN([jo],e=>e.facet(jo).defaultKeymap?[X4e]:[])),Y4e=[Ys("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Ys("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Ys("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Ys("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Ys("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Ys(`try { \${} } catch (\${error}) { \${} -}`,{label:"try",detail:"/ catch block",type:"keyword"}),Zs("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),Zs(`if (\${}) { +}`,{label:"try",detail:"/ catch block",type:"keyword"}),Ys("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),Ys(`if (\${}) { \${} } else { \${} -}`,{label:"if",detail:"/ else block",type:"keyword"}),Zs(`class \${name} { +}`,{label:"if",detail:"/ else block",type:"keyword"}),Ys(`class \${name} { constructor(\${params}) { \${} } -}`,{label:"class",detail:"definition",type:"keyword"}),Zs('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Zs('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],z5t=Y4e.concat([Zs("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Zs("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Zs("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),zre=new Dq,Z4e=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function wk(e){return(t,n)=>{let i=t.node.getChild("VariableDefinition");return i&&n(i,e),!0}}const V5t=["FunctionDeclaration"],H5t={FunctionDeclaration:wk("function"),ClassDeclaration:wk("class"),ClassExpression:()=>!0,EnumDeclaration:wk("constant"),TypeAliasDeclaration:wk("type"),NamespaceDeclaration:wk("namespace"),VariableDefinition(e,t){e.matchContext(V5t)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function J4e(e,t){let n=zre.get(t);if(n)return n;let i=[],r=!0;function s(o,l){let c=e.sliceString(o.from,o.to);i.push({label:c,type:l})}return t.cursor(Er.IncludeAnonymous).iterate(o=>{if(r)r=!1;else if(o.name){let l=H5t[o.name];if(l&&l(o,s)||Z4e.has(o.name))return!1}else if(o.to-o.from>8192){for(let l of J4e(e,o.node))i.push(l);return!1}}),zre.set(t,i),i}const Vre=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,e$e=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function q5t(e){let t=Jr(e.state).resolveInner(e.pos,-1);if(e$e.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&Vre.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let i=[];for(let r=t;r;r=r.parent)Z4e.has(r.name)&&(i=i.concat(J4e(e.state.doc,r)));return{options:i,from:n?t.from:e.pos,validFor:Vre}}const bh=am.define({name:"javascript",parser:WLt.configure({props:[xm.add({IfStatement:vw({except:/^\s*({|else\b)/}),TryStatement:vw({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:TMt,SwitchBody:e=>{let t=e.textAfter,n=/^\s*\}/.test(t),i=/^\s*(case|default)\b/.test(t);return e.baseIndent+(n?0:i?1:2)*e.unit},Block:yw({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":vw({except:/^\s*{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),wm.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":ET,BlockComment(e){return{from:e.from+2,to:e.to-2}},JSXElement(e){let t=e.firstChild;if(!t||t.name=="JSXSelfClosingTag")return null;let n=e.lastChild;return{from:t.to,to:n.type.isError?e.to:n.from}},"JSXSelfClosingTag JSXOpenTag"(e){var t;let n=(t=e.firstChild)===null||t===void 0?void 0:t.nextSibling,i=e.lastChild;return!n||n.type.isError?null:{from:n.to,to:i.type.isError?e.to:i.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),t$e={test:e=>/^JSX/.test(e.name),facet:eL({commentTokens:{block:{open:"{/*",close:"*/}"}}})},n$e=bh.configure({dialect:"ts"},"typescript"),i$e=bh.configure({dialect:"jsx",props:[tW.add(e=>e.isTop?[t$e]:void 0)]}),r$e=bh.configure({dialect:"jsx ts",props:[tW.add(e=>e.isTop?[t$e]:void 0)]},"typescript");let s$e=e=>({label:e,type:"keyword"});const a$e="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(s$e),W5t=a$e.concat(["declare","implements","private","protected","public"].map(s$e));function o7(e={}){let t=e.jsx?e.typescript?r$e:i$e:e.typescript?n$e:bh,n=e.typescript?z5t.concat(W5t):Y4e.concat(a$e);return new yb(t,[bh.data.of({autocomplete:U4e(e$e,lW(n))}),bh.data.of({autocomplete:q5t}),e.jsx?X5t:[]])}function K5t(e){for(;;){if(e.name=="JSXOpenTag"||e.name=="JSXSelfClosingTag"||e.name=="JSXFragmentTag")return e;if(e.name=="JSXEscape"||!e.parent)return null;e=e.parent}}function Hre(e,t,n=e.length){for(let i=t==null?void 0:t.firstChild;i;i=i.nextSibling)if(i.name=="JSXIdentifier"||i.name=="JSXBuiltin"||i.name=="JSXNamespacedName"||i.name=="JSXMemberExpression")return e.sliceString(i.from,Math.min(i.to,n));return""}const G5t=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),X5t=en.inputHandler.of((e,t,n,i,r)=>{if((G5t?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||i!=">"&&i!="/"||!bh.isActiveAt(e.state,t,-1))return!1;let s=r(),{state:o}=s,l=o.changeByRange(c=>{var u;let{head:d}=c,f=Jr(o).resolveInner(d-1,-1),h;if(f.name=="JSXStartTag"&&(f=f.parent),!(o.doc.sliceString(d-1,d)!=i||f.name=="JSXAttributeValue"&&f.to>d)){if(i==">"&&f.name=="JSXFragmentTag")return{range:c,changes:{from:d,insert:""}};if(i=="/"&&f.name=="JSXStartCloseTag"){let m=f.parent,g=m.parent;if(g&&m.from==d-2&&((h=Hre(o.doc,g.firstChild,d))||((u=g.firstChild)===null||u===void 0?void 0:u.name)=="JSXFragmentTag")){let b=`${h}>`;return{range:ht.cursor(d+b.length,-1),changes:{from:d,insert:b}}}}else if(i==">"){let m=K5t(f);if(m&&m.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(o.doc.sliceString(d,d+2))&&(h=Hre(o.doc,m,d)))return{range:c,changes:{from:d,insert:``}}}}return{range:c}});return l.changes.empty?!1:(e.dispatch([s,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Y5t=vm({String:fe.string,Number:fe.number,"True False":fe.bool,PropertyName:fe.propertyName,Null:fe.null,", :":fe.separator,"[ ]":fe.squareBracket,"{ }":fe.brace}),Z5t=om.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[Y5t],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),J5t=am.define({name:"json",parser:Z5t.configure({props:[xm.add({Object:vw({except:/^\s*\}/}),Array:vw({except:/^\s*\]/})}),wm.add({"Object Array":ET})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function e3t(){return new yb(J5t)}class sP{static create(t,n,i,r,s){let o=r+(r<<8)+t+(n<<4)|0;return new sP(t,n,i,o,s,[],[])}constructor(t,n,i,r,s,o,l){this.type=t,this.value=n,this.from=i,this.hash=r,this.end=s,this.children=o,this.positions=l,this.hashProp=[[ci.contextHash,r]]}addChild(t,n){t.prop(ci.contextHash)!=this.hash&&(t=new Ui(t.type,t.children,t.positions,t.length,this.hashProp)),this.children.push(t),this.positions.push(n)}toTree(t,n=this.end){let i=this.children.length-1;return i>=0&&(n=Math.max(n,this.positions[i]+this.children[i].length+this.from)),new Ui(t.types[this.type],this.children,this.positions,n-this.from).balance({makeTree:(r,s,o)=>new Ui(Za.none,r,s,o,this.hashProp)})}}var qt;(function(e){e[e.Document=1]="Document",e[e.CodeBlock=2]="CodeBlock",e[e.FencedCode=3]="FencedCode",e[e.Blockquote=4]="Blockquote",e[e.HorizontalRule=5]="HorizontalRule",e[e.BulletList=6]="BulletList",e[e.OrderedList=7]="OrderedList",e[e.ListItem=8]="ListItem",e[e.ATXHeading1=9]="ATXHeading1",e[e.ATXHeading2=10]="ATXHeading2",e[e.ATXHeading3=11]="ATXHeading3",e[e.ATXHeading4=12]="ATXHeading4",e[e.ATXHeading5=13]="ATXHeading5",e[e.ATXHeading6=14]="ATXHeading6",e[e.SetextHeading1=15]="SetextHeading1",e[e.SetextHeading2=16]="SetextHeading2",e[e.HTMLBlock=17]="HTMLBlock",e[e.LinkReference=18]="LinkReference",e[e.Paragraph=19]="Paragraph",e[e.CommentBlock=20]="CommentBlock",e[e.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",e[e.Escape=22]="Escape",e[e.Entity=23]="Entity",e[e.HardBreak=24]="HardBreak",e[e.Emphasis=25]="Emphasis",e[e.StrongEmphasis=26]="StrongEmphasis",e[e.Link=27]="Link",e[e.Image=28]="Image",e[e.InlineCode=29]="InlineCode",e[e.HTMLTag=30]="HTMLTag",e[e.Comment=31]="Comment",e[e.ProcessingInstruction=32]="ProcessingInstruction",e[e.Autolink=33]="Autolink",e[e.HeaderMark=34]="HeaderMark",e[e.QuoteMark=35]="QuoteMark",e[e.ListMark=36]="ListMark",e[e.LinkMark=37]="LinkMark",e[e.EmphasisMark=38]="EmphasisMark",e[e.CodeMark=39]="CodeMark",e[e.CodeText=40]="CodeText",e[e.CodeInfo=41]="CodeInfo",e[e.LinkTitle=42]="LinkTitle",e[e.LinkLabel=43]="LinkLabel",e[e.URL=44]="URL"})(qt||(qt={}));class t3t{constructor(t,n){this.start=t,this.content=n,this.marks=[],this.parsers=[]}}class n3t{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let t=this.skipSpace(this.basePos);this.indent=this.countIndent(t,this.pos,this.indent),this.pos=t,this.next=t==this.text.length?-1:this.text.charCodeAt(t)}skipSpace(t){return xE(this.text,t)}reset(t){for(this.text=t,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(t){this.basePos=t,this.baseIndent=this.countIndent(t,this.pos,this.indent)}moveBaseColumn(t){this.baseIndent=t,this.basePos=this.findColumn(t)}addMarker(t){this.markers.push(t)}countIndent(t,n=0,i=0){for(let r=n;r=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let i=(e.type==qt.OrderedList?vW:yW)(n,t,!1);return i>0&&(e.type!=qt.BulletList||bW(n,t,!1)<0)&&n.text.charCodeAt(n.pos+i-1)==e.value}const o$e={[qt.Blockquote](e,t,n){return n.next!=62?!1:(n.markers.push(dr(qt.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(Id(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0)},[qt.ListItem](e,t,n){return n.indent-1?!1:(n.moveBaseColumn(n.baseIndent+e.value),!0)},[qt.OrderedList]:qre,[qt.BulletList]:qre,[qt.Document](){return!0}};function Id(e){return e==32||e==9||e==10||e==13}function xE(e,t=0){for(;tn&&Id(e.charCodeAt(t-1));)t--;return t}function l$e(e){if(e.next!=96&&e.next!=126)return-1;let t=e.pos+1;for(;t-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf(g$e.SetextHeading)>-1||i<3?-1:1}function u$e(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function yW(e,t,n){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||Id(e.text.charCodeAt(e.pos+1)))&&(!n||u$e(t,qt.BulletList)||e.skipSpace(e.pos+2)=48&&r<=57;){i++;if(i==e.text.length)return-1;r=e.text.charCodeAt(i)}return i==e.pos||i>e.pos+9||r!=46&&r!=41||ie.pos+1||e.next!=49)?-1:i+1-e.pos}function d$e(e){if(e.next!=35)return-1;let t=e.pos+1;for(;t6?-1:n}function f$e(e){if(e.next!=45&&e.next!=61||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t/,p$e=/\?>/,c7=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/,p$e=/\?>/,c7=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/i.exec(i);if(s)return e.append(dr(qt.Comment,n,n+1+s[0].length));let o=/^\?[^]*?\?>/.exec(i);if(o)return e.append(dr(qt.ProcessingInstruction,n,n+1+o[0].length));let l=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(i);return l?e.append(dr(qt.HTMLTag,n,n+1+l[0].length)):-1},Emphasis(e,t,n){if(t!=95&&t!=42)return-1;let i=n+1;for(;e.char(i)==t;)i++;let r=e.slice(n-1,n),s=e.slice(i,i+1),o=zC.test(r),l=zC.test(s),c=/\s|^$/.test(r),u=/\s|^$/.test(s),d=!u&&(!l||c||o),f=!c&&(!o||u||l),h=d&&(t==42||!f||o),m=f&&(t==42||!d||l);return e.append(new du(t==95?w$e:O$e,n,i,(h?1:0)|(m?2:0)))},HardBreak(e,t,n){if(t==92&&e.char(n+1)==10)return e.append(dr(qt.HardBreak,n,n+2));if(t==32){let i=n+1;for(;e.char(i)==32;)i++;if(e.char(i)==10&&i>=n+2)return e.append(dr(qt.HardBreak,n,i+1))}return-1},Link(e,t,n){return t==91?e.append(new du(vy,n,n+1,1)):-1},Image(e,t,n){return t==33&&e.char(n+1)==91?e.append(new du(aP,n,n+2,1)):-1},LinkEnd(e,t,n){if(t!=93)return-1;for(let i=e.parts.length-1;i>=0;i--){let r=e.parts[i];if(r instanceof du&&(r.type==vy||r.type==aP)){if(!r.side||e.skipSpace(r.to)==n&&!/[(\[]/.test(e.slice(n+1,n+2)))return e.parts[i]=null,-1;let s=e.takeContent(i),o=e.parts[i]=l3t(e,s,r.type==vy?qt.Link:qt.Image,r.from,n+1);if(r.type==vy)for(let l=0;lt?dr(qt.URL,t+n,s+n):s==e.length?null:!1}}function S$e(e,t,n){let i=e.charCodeAt(t);if(i!=39&&i!=34&&i!=40)return!1;let r=i==40?41:i;for(let s=t+1,o=!1;s=this.end?-1:this.text.charCodeAt(t-this.offset)}get end(){return this.offset+this.text.length}slice(t,n){return this.text.slice(t-this.offset,n-this.offset)}append(t){return this.parts.push(t),t.to}addDelimiter(t,n,i,r,s){return this.append(new du(t,n,i,(r?1:0)|(s?2:0)))}get hasOpenLink(){for(let t=this.parts.length-1;t>=0;t--){let n=this.parts[t];if(n instanceof du&&(n.type==vy||n.type==aP))return!0}return!1}addElement(t){return this.append(t)}resolveMarkers(t){for(let i=t;i=t;c--){let b=this.parts[c];if(b instanceof du&&b.side&1&&b.type==r.type&&!(s&&(r.side&1||b.side&2)&&(b.to-b.from+o)%3==0&&((b.to-b.from)%3||o%3))){l=b;break}}if(!l)continue;let u=r.type.resolve,d=[],f=l.from,h=r.to;if(s){let b=Math.min(2,l.to-l.from,o);f=l.to-b,h=r.from+b,u=b==1?"Emphasis":"StrongEmphasis"}l.type.mark&&d.push(this.elt(l.type.mark,f,l.to));for(let b=c+1;b=0;n--){let i=this.parts[n];if(i instanceof du&&i.type==t&&i.side&1)return n}return null}takeContent(t){let n=this.resolveMarkers(t);return this.parts.length=t,n}getDelimiterAt(t){let n=this.parts[t];return n instanceof du?n:null}skipSpace(t){return xE(this.text,t-this.offset)+this.offset}elt(t,n,i,r){return typeof t=="string"?dr(this.parser.getNodeType(t),n,i,r):new x$e(t,n)}}xW.linkStart=vy;xW.imageStart=aP;function d7(e,t){if(!t.length)return e;if(!e.length)return t;let n=e.slice(),i=0;for(let r of t){for(;i(t?t-1:0))return!1;if(this.fragmentEnd<0){let s=this.fragment.to;for(;s>0&&this.input.read(s-1,s)!=` -`;)s--;this.fragmentEnd=s?s-1:0}let i=this.cursor;i||(i=this.cursor=this.fragment.tree.cursor(),i.firstChild());let r=t+this.fragment.offset;for(;i.to<=r;)if(!i.parent())return!1;for(;;){if(i.from>=r)return this.fragment.from<=n;if(!i.childAfter(r))return!1}}matches(t){let n=this.cursor.tree;return n&&n.prop(ci.contextHash)==t}takeNodes(t){let n=this.cursor,i=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),s=t.absoluteLineStart,o=s,l=t.block.children.length,c=o,u=l;for(;;){if(n.to-i>r){if(n.type.isAnonymous&&n.firstChild())continue;break}let d=C$e(n.from-i,t.ranges);if(n.to-i<=t.ranges[t.rangeI].to)t.addNode(n.tree,d);else{let f=new Ui(t.parser.nodeSet.types[qt.Paragraph],[],[],0,t.block.hashProp);t.reusePlaceholders.set(f,n.tree),t.addNode(f,d)}if(n.type.is("Block")&&(c3t.indexOf(n.type.id)<0?(o=n.to-i,l=t.block.children.length):(o=c,l=u),c=n.to-i,u=t.block.children.length),!n.nextSibling())break}for(;t.block.children.length>l;)t.block.children.pop(),t.block.positions.pop();return o-s}}function C$e(e,t){let n=e;for(let i=1;iij[e]),Object.keys(ij).map(e=>g$e[e]),Object.keys(ij),s3t,o$e,Object.keys(w$).map(e=>w$[e]),Object.keys(w$),[]);function h3t(e,t,n){let i=[];for(let r=e.firstChild,s=t;;r=r.nextSibling){let o=r?r.from:n;if(o>s&&i.push({from:s,to:o}),!r)break;s=r.to}return i}function p3t(e){let{codeParser:t,htmlParser:n}=e;return{wrap:U5e((r,s)=>{let o=r.type.id;if(t&&(o==qt.CodeBlock||o==qt.FencedCode)){let l="";if(o==qt.FencedCode){let u=r.node.getChild(qt.CodeInfo);u&&(l=s.read(u.from,u.to))}let c=t(l);if(c)return{parser:c,overlay:u=>u.type.id==qt.CodeText,bracketed:o==qt.FencedCode}}else if(n&&(o==qt.HTMLBlock||o==qt.HTMLTag||o==qt.CommentBlock))return{parser:n,overlay:h3t(r.node,r.from,r.to)};return null})}}const m3t={resolve:"Strikethrough",mark:"StrikethroughMark"},g3t={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":fe.strikethrough}},{name:"StrikethroughMark",style:fe.processingInstruction}],parseInline:[{name:"Strikethrough",parse(e,t,n){if(t!=126||e.char(n+1)!=126||e.char(n+2)==126)return-1;let i=e.slice(n-1,n),r=e.slice(n+2,n+3),s=/\s|^$/.test(i),o=/\s|^$/.test(r),l=zC.test(i),c=zC.test(r);return e.addDelimiter(m3t,n,n+2,!o&&(!c||s||l),!s&&(!l||o||c))},after:"Emphasis"}]};function wE(e,t,n=0,i,r=0){let s=0,o=!0,l=-1,c=-1,u=!1,d=()=>{i.push(e.elt("TableCell",r+l,r+c,e.parser.parseInline(t.slice(l,c),r+l)))};for(let f=n;f-1)&&s++,o=!1,i&&(l>-1&&d(),i.push(e.elt("TableDelimiter",f+r,f+r+1))),l=c=-1):(u||h!=32&&h!=9)&&(l<0&&(l=f),c=f+1),u=!u&&h==92}return l>-1&&(s++,i&&d()),s}function Xre(e,t){for(let n=t;n\s]*\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class Yre{constructor(){this.rows=null}nextLine(t,n,i){if(this.rows==null){this.rows=!1;let r;if((n.next==45||n.next==58||n.next==124)&&A$e.test(r=n.text.slice(n.pos))){let s=[];wE(t,i.content,0,s,i.start)==wE(t,r,0)&&(this.rows=[t.elt("TableHeader",i.start,i.start+i.content.length,s),t.elt("TableDelimiter",t.lineStart+n.pos,t.lineStart+n.text.length)])}}else if(this.rows){let r=[];wE(t,n.text,n.pos,r,t.lineStart),this.rows.push(t.elt("TableRow",t.lineStart+n.pos,t.lineStart+n.text.length,r))}return!1}finish(t,n){return this.rows?(t.addLeafElement(n,t.elt("Table",n.start,n.start+n.content.length,this.rows)),!0):!1}}const b3t={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":fe.heading}},"TableRow",{name:"TableCell",style:fe.content},{name:"TableDelimiter",style:fe.processingInstruction}],parseBlock:[{name:"Table",leaf(e,t){return Xre(t.content,0)?new Yre:null},endLeaf(e,t,n){if(n.parsers.some(r=>r instanceof Yre)||!Xre(t.text,t.basePos))return!1;let i=e.peekLine();return A$e.test(i)&&wE(e,t.text,t.basePos)==wE(e,i,t.basePos)},before:"SetextHeading"}]};class y3t{nextLine(){return!1}finish(t,n){return t.addLeafElement(n,t.elt("Task",n.start,n.start+n.content.length,[t.elt("TaskMarker",n.start,n.start+3),...t.parser.parseInline(n.content.slice(3),n.start+3)])),!0}}const v3t={defineNodes:[{name:"Task",block:!0,style:fe.list},{name:"TaskMarker",style:fe.atom}],parseBlock:[{name:"TaskList",leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name=="ListItem"?new y3t:null},after:"SetextHeading"}]},Zre=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,Jre=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,x3t=/[\w-]+\.[\w-]+($|[/:])/,ese=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,tse=/\/[a-zA-Z\d@.]+/gy;function nse(e,t,n,i){let r=0;for(let s=t;s-1)return-1;let i=t+n[0].length;for(;;){let r=e[i-1],s;if(/[?!.,:*_~]/.test(r)||r==")"&&nse(e,t,i,")")>nse(e,t,i,"("))i--;else if(r==";"&&(s=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,i))))i=t+s.index;else break}return i}function ise(e,t){ese.lastIndex=t;let n=ese.exec(e);if(!n)return-1;let i=n[0][n[0].length-1];return i=="_"||i=="-"?-1:t+n[0].length-(i=="."?1:0)}const O3t={parseInline:[{name:"Autolink",parse(e,t,n){let i=n-e.offset;if(i&&/\w/.test(e.text[i-1]))return-1;Zre.lastIndex=i;let r=Zre.exec(e.text),s=-1;if(!r)return-1;if(r[1]||r[2]){if(s=w3t(e.text,i+r[0].length),s>-1&&e.hasOpenLink){let o=/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(i,s));s=i+o[0].length}}else r[3]?s=ise(e.text,i):(s=ise(e.text,i+r[0].length),s>-1&&r[0]=="xmpp:"&&(tse.lastIndex=s,r=tse.exec(e.text),r&&(s=r.index+r[0].length)));return s<0?-1:(e.addElement(e.elt("URL",n,s+e.offset)),s+e.offset)}}]},k3t=[b3t,v3t,g3t,O3t];function T$e(e,t,n){return(i,r,s)=>{if(r!=e||i.char(s+1)==e)return-1;let o=[i.elt(n,s,s+1)];for(let l=s+1;l=65&&e<=90||e==95||e>=97&&e<=122||e>=161}let ose=null,lse=null,cse=0;function h7(e,t){let n=e.pos+t;if(cse==n&&lse==e)return ose;let i=e.peek(t),r="";for(;X3t(i);)r+=String.fromCharCode(i),i=e.peek(++t);return lse=e,cse=n,ose=r?r.toLowerCase():i==Y3t||i==Z3t?void 0:null}const M$e=60,oP=62,OW=47,Y3t=63,Z3t=33,J3t=45;function use(e,t){this.name=e,this.parent=t}const e4t=[wW,R$e,_$e,j$e,N$e],t4t=new iL({start:null,shift(e,t,n,i){return e4t.indexOf(t)>-1?new use(h7(i,1)||"",e):e},reduce(e,t){return t==I$e&&e?e.parent:e},reuse(e,t,n,i){let r=t.type.id;return r==wW||r==V3t?new use(h7(i,1)||"",e):e},strict:!1}),n4t=new Da((e,t)=>{if(e.next!=M$e){e.next<0&&t.context&&e.acceptToken(O$);return}e.advance();let n=e.next==OW;n&&e.advance();let i=h7(e,0);if(i===void 0)return;if(!i)return e.acceptToken(n?$3t:L3t);let r=t.context?t.context.name:null;if(n){if(i==r)return e.acceptToken(P3t);if(r&&G3t[r])return e.acceptToken(O$,-2);if(t.dialectEnabled(q3t))return e.acceptToken(D3t);for(let s=t.context;s;s=s.parent)if(s.name==i)return;e.acceptToken(M3t)}else{if(i=="script")return e.acceptToken(_$e);if(i=="style")return e.acceptToken(j$e);if(i=="textarea")return e.acceptToken(N$e);if(K3t.hasOwnProperty(i))return e.acceptToken(R$e);r&&ase[r]&&ase[r][i]?e.acceptToken(O$,-1):e.acceptToken(wW)}},{contextual:!0}),i4t=new Da(e=>{for(let t=0,n=0;;n++){if(e.next<0){n&&e.acceptToken(sse);break}if(e.next==J3t)t++;else if(e.next==oP&&t>=2){n>=3&&e.acceptToken(sse,-2);break}else t=0;e.advance()}});function r4t(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const s4t=new Da((e,t)=>{if(e.next==OW&&e.peek(1)==oP){let n=t.dialectEnabled(W3t)||r4t(t.context);e.acceptToken(n?I3t:rse,2)}else e.next==oP&&e.acceptToken(rse,1)});function kW(e,t,n){let i=2+e.length;return new Da(r=>{for(let s=0,o=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(t);break}if(s==0&&r.next==M$e||s==1&&r.next==OW||s>=2&&so?r.acceptToken(t,-o):r.acceptToken(n,-(o-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(t,1);break}else s=o=0;r.advance()}})}const a4t=kW("script",A3t,T3t),o4t=kW("style",_3t,j3t),l4t=kW("textarea",N3t,R3t),c4t=vm({"Text RawText IncompleteTag IncompleteCloseTag":fe.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":fe.angleBracket,TagName:fe.tagName,"MismatchedCloseTag/TagName":[fe.tagName,fe.invalid],AttributeName:fe.attributeName,"AttributeValue UnquotedAttributeValue":fe.attributeValue,Is:fe.definitionOperator,"EntityReference CharacterReference":fe.character,Comment:fe.blockComment,ProcessingInst:fe.processingInstruction,DoctypeDecl:fe.documentMeta}),u4t=om.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:",c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:t4t,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[c4t],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let u=l.type.id;if(u==U3t)return k$(l,c,n);if(u==Q3t)return k$(l,c,i);if(u==z3t)return k$(l,c,r);if(u==I$e&&s.length){let d=l.node,f=d.firstChild,h=f&&dse(f,c),m;if(h){for(let g of s)if(g.tag==h&&(!g.attrs||g.attrs(m||(m=L$e(f,c))))){let b=d.lastChild,v=b.type.id==H3t?b.from:d.to;if(v>f.to)return{parser:g.parser,overlay:[{from:f.to,to:v}]}}}}if(o&&u==P$e){let d=l.node,f;if(f=d.firstChild){let h=o[c.read(f.from,f.to)];if(h)for(let m of h){if(m.tagName&&m.tagName!=dse(d.parent,c))continue;let g=d.lastChild;if(g.type.id==f7){let b=g.from+1,v=g.lastChild,y=g.to-(v&&v.isError?0:1);if(y>b)return{parser:m.parser,overlay:[{from:b,to:y}],bracketed:!0}}else if(g.type.id==D$e)return{parser:m.parser,overlay:[{from:g.from,to:g.to}]}}}}return null})}const d4t=145,fse=1,f4t=146,h4t=147,F$e=2,p4t=148,m4t=3,g4t=4,B$e=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],b4t=58,y4t=40,U$e=95,v4t=91,VN=45,x4t=46,w4t=35,O4t=37,k4t=38,S4t=92,E4t=10,C4t=42;function VC(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function SW(e){return e>=48&&e<=57}function hse(e){return SW(e)||e>=97&&e<=102||e>=65&&e<=70}const Q$e=(e,t,n)=>(i,r)=>{for(let s=!1,o=0,l=0;;l++){let{next:c}=i;if(VC(c)||c==VN||c==U$e||s&&SW(c))!s&&(c!=VN||l>0)&&(s=!0),o===l&&c==VN&&o++,i.advance();else if(c==S4t&&i.peek(1)!=E4t){if(i.advance(),hse(i.next)){do i.advance();while(hse(i.next));i.next==32&&i.advance()}else i.next>-1&&i.advance();s=!0}else{s&&i.acceptToken(o==2&&r.canShift(F$e)?t:c==y4t?n:e);break}}},A4t=new Da(Q$e(f4t,F$e,h4t),{contextual:!0}),T4t=new Da(Q$e(p4t,m4t,g4t),{contextual:!0}),_4t=new Da(e=>{if(B$e.includes(e.peek(-1))){let{next:t}=e;(VC(t)||t==U$e||t==w4t||t==x4t||t==C4t||t==v4t||t==b4t&&VC(e.peek(1))||t==VN||t==k4t)&&e.acceptToken(d4t)}}),j4t=new Da(e=>{if(!B$e.includes(e.peek(-1))){let{next:t}=e;if(t==O4t&&(e.advance(),e.acceptToken(fse)),VC(t)){do e.advance();while(VC(e.next)||SW(e.next));e.acceptToken(fse)}}}),N4t=vm({"AtKeyword import charset namespace keyframes media supports font-feature-values":fe.definitionKeyword,"from to selector scope MatchFlag":fe.keyword,NamespaceName:fe.namespace,KeyframeName:fe.labelName,KeyframeRangeName:fe.operatorKeyword,TagName:fe.tagName,ClassName:fe.className,PseudoClassName:fe.constant(fe.className),IdName:fe.labelName,"FeatureName PropertyName":fe.propertyName,AttributeName:fe.attributeName,NumberLiteral:fe.number,KeywordQuery:fe.keyword,UnaryQueryOp:fe.operatorKeyword,"CallTag ValueName FontName":fe.atom,VariableName:fe.variableName,Callee:fe.operatorKeyword,Unit:fe.unit,"UniversalSelector NestingSelector":fe.definitionOperator,"MatchOp CompareOp":fe.compareOperator,"ChildOp SiblingOp, LogicOp":fe.logicOperator,BinOp:fe.arithmeticOperator,Important:fe.modifier,Comment:fe.blockComment,ColorLiteral:fe.color,"ParenthesizedContent StringLiteral":fe.string,":":fe.punctuation,"PseudoOp #":fe.derefOperator,"; , |":fe.separator,"( )":fe.paren,"[ ]":fe.squareBracket,"{ }":fe.brace}),R4t={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:152,"url-prefix":152,domain:152,regexp:152},I4t={__proto__:null,or:104,and:104,not:112,only:112,layer:206},P4t={__proto__:null,selector:118,style:124,layer:202},D4t={__proto__:null,"@import":198,"@media":210,"@charset":214,"@namespace":218,"@keyframes":224,"@supports":236,"@scope":240,"@font-feature-values":246},M4t={__proto__:null,to:243},L4t=om.deserialize({version:14,states:"MlQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FnO&XQdO'#CkO&xQaO'#CcO'SQdO'#CnO'_QdO'#EOO'dQdO'#EQO'oQdO'#EXO'oQdO'#E[OOQP'#Fn'#FnO)RQhO'#E}OOQS'#Fm'#FmOOQS'#FQ'#FQQYQdOOO)YQdO'#EbO*iQhO'#EhO)YQdO'#EjO*pQdO'#ElO*{QdO'#EoO)}QhO'#EuO+TQdO'#EwO+`QdO'#EzO+eQaO'#CfO+lQ`O'#E_O+qQ`O'#F{O+|QdO'#F{QOQ`OOP,WO&jO'#CaPOOO)CA])CA]OOQP'#Ci'#CiOOQP,59R,59RO%VQdO,59ROOQP'#Cm'#CmOOQP,59V,59VO&XQdO,59VO,cQdO,59YO'_QdO,5:jO'dQdO,5:lO'oQdO,5:sO'oQdO,5:uO'oQdO,5:vO'oQdO'#FXO,nQ`O,58}O,vQdO'#E^OOQS,58},58}OOQP'#Cq'#CqOOQO'#D|'#D|OOQP,59Y,59YO,}Q`O,59YO-SQ`O,59YOOQP'#EP'#EPOOQP,5:j,5:jO-XQpO'#ERO-dQdO'#ESO-iQ`O'#ESO-nQpO,5:lO.XQaO,5:sO.oQaO,5:vOOQW'#D^'#D^O/nQhO'#DgO0RQhO,5;iO)}QhO'#DeO0`Q`O'#DnO0eQhO'#DxOOQW'#Ft'#FtOOQS,5;i,5;iO0jQ`O'#DhO0oQ`O'#DkOOQS-E9O-E9OOOQ['#Cv'#CvO0tQdO'#CwO1[QdO'#C}O1rQdO'#DQO2YQ!pO'#DSO4fQ!jO,5:|OOQO'#DX'#DXO-SQ`O'#DWO4vQ!nO'#FqO6|Q`O'#DYO7RQ`O'#DyOOQ['#Fq'#FqO7WQhO'#GOO7fQ`O,5;SO7kQ!bO,5;UOOQS'#En'#EnO7sQ`O,5;WO7xQdO,5;WOOQO'#Eq'#EqO8QQ`O,5;ZO8VQhO,5;aO'oQdO'#DjOOQS,5;c,5;cO0jQ`O,5;cO8_QdO,5;cOOQS'#F`'#F`O8gQdO'#E|O7fQ`O,5;fO8oQdO,5:yO9PQdO'#FZO9^Q`O,5lQhO'#DoOOQW,5:Y,5:YOOQW,5:d,5:dOOQW,5:S,5:SO>vQhO,5:VO?bQ!fO'#FrOOQS'#Fr'#FrOOQS'#FS'#FSO@rQdO,59cOOQ[,59c,59cOAYQdO,59iOOQ[,59i,59iOApQdO,59lOOQ[,59l,59lOOQ[,59n,59nO)YQdO,59pOBWQhO'#EdOOQW'#Ed'#EdOBuQ`O1G0hO4oQhO1G0hOOQ[,59r,59rO)}QhO'#D[OOQ[,59t,59tOBzQ#tO,5:eOCVQhO'#F]OCdQ`O,5vQhO'#DmOI_QhO'#DqOIgQhO'#DsOIlQhO'#FwOOQO'#Fw'#FwOItQ!bO'#DwOOQO'#Fy'#FyOOQO'#Fv'#FvOIyQ`O1G/qOOQS-E9Q-E9QOOQ[1G.}1G.}OOQ[1G/T1G/TOOQ[1G/W1G/WOOQ[1G/[1G/[OJOQdO,5;OOOQS7+&S7+&SOJTQ`O7+&SOJYQhO'#D]OJbQ`O,59vO)}QhO,59vOOQ[1G0P1G0POJjQ`O1G0POJoQhO,5;wOOQO-E9Z-E9ZOOQS7+&^7+&^OJ}QbO'#DSOOQO'#Et'#EtOK]Q`O'#EsOOQO'#Es'#EsOKhQ`O'#F^OKpQdO,5;^OOQS,5;^,5;^OOQ[1G/p1G/pOOQS7+&i7+&iO7fQ`O7+&iOK{Q!fO'#FYO)YQdO'#FYOMSQdO7+&POOQO7+&P7+&POOQO,5:{,5:{OOQO1G1a1G1aOMgQ!bO<vQhO'#DrOOQO,5:],5:]O! hQhO,5:_OGUQhO,5:cOOQW7+%]7+%]OOQO'#Ef'#EfO! pQ`O1G0jOOQS<xAN>xO!#zQ`OAN>xO!$PQaO,5;rOOQO-E9U-E9UO!$ZQdO,5;qOOQO-E9T-E9TOOQW<vQhO'#DuOOQO1G/y1G/yO!%vQ!bO1G/}OJOQdO'#F[O!&OQ`O7+&UOOQW7+&U7+&UO!&WQ!bO1G/cOOQ[7+$|7+$|O!&cQhO7+$|P!&jQ`O'#FTOOQO,5;y,5;yOOQO-E9]-E9]OOQS1G1d1G1dOOQPG24dG24dO!&oQ`OAN>ZO)YQdO1G1[O!&tQ`O7+'jOOQO1G/x1G/xO!&|Q`O,5:aO!$eQhO7+%iOOQO,5;v,5;vOOQO-E9Y-E9YOOQW<Q!]!^>|!^!_?_!_!`@Z!`!a@n!a!b%Z!b!cAo!c!k%Z!k!lC|!l!u%Z!u!vC|!v!}%Z!}#OD_#O#P%Z#P#QDp#Q#R2X#R#]%Z#]#^ER#^#g%Z#g#hC|#h#o%Z#o#pIf#p#qIw#q#rJ`#r#sJq#s#y%Z#y#z&R#z$f%Z$f$g&R$g#BY%Z#BY#BZ&R#BZ$IS%Z$IS$I_&R$I_$I|%Z$I|$JO&R$JO$JT%Z$JT$JU&R$JU$KV%Z$KV$KW&R$KW&FU%Z&FU&FV&R&FV;'S%Z;'S;=`KY<%lO%Z`%^SOy%jz;'S%j;'S;=`%{<%lO%j`%oS!o`Oy%jz;'S%j;'S;=`%{<%lO%j`&OP;=`<%l%j~&Wh$[~OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%j~'yh$[~!o`OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%jj)jS$qYOy%jz;'S%j;'S;=`%{<%lO%j~)yWOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d<%lO)v~*hOw~~*kRO;'S)v;'S;=`*t;=`O)v~*wXOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d;=`<%l)v<%lO)v~+gP;=`<%l)vj+oYmYOy%jz!Q%j!Q![,_![!c%j!c!i,_!i#T%j#T#Z,_#Z;'S%j;'S;=`%{<%lO%jj,dY!o`Oy%jz!Q%j!Q![-S![!c%j!c!i-S!i#T%j#T#Z-S#Z;'S%j;'S;=`%{<%lO%jj-XY!o`Oy%jz!Q%j!Q![-w![!c%j!c!i-w!i#T%j#T#Z-w#Z;'S%j;'S;=`%{<%lO%jj.OYuY!o`Oy%jz!Q%j!Q![.n![!c%j!c!i.n!i#T%j#T#Z.n#Z;'S%j;'S;=`%{<%lO%jj.uYuY!o`Oy%jz!Q%j!Q![/e![!c%j!c!i/e!i#T%j#T#Z/e#Z;'S%j;'S;=`%{<%lO%jj/jY!o`Oy%jz!Q%j!Q![0Y![!c%j!c!i0Y!i#T%j#T#Z0Y#Z;'S%j;'S;=`%{<%lO%jj0aYuY!o`Oy%jz!Q%j!Q![1P![!c%j!c!i1P!i#T%j#T#Z1P#Z;'S%j;'S;=`%{<%lO%jj1UY!o`Oy%jz!Q%j!Q![1t![!c%j!c!i1t!i#T%j#T#Z1t#Z;'S%j;'S;=`%{<%lO%jj1{SuY!o`Oy%jz;'S%j;'S;=`%{<%lO%jd2[UOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jd2uS!yS!o`Oy%jz;'S%j;'S;=`%{<%lO%jb3WS^QOy%jz;'S%j;'S;=`%{<%lO%j~3gWOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{<%lO3d~4SRO;'S3d;'S;=`4];=`O3d~4`XOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{;=`<%l3d<%lO3d~5OP;=`<%l3dj5WShYOy%jz;'S%j;'S;=`%{<%lO%j~5iOg~n5pUWQyWOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jj6ZWyW#PQOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj6xU!o`Oy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%jj7cY!o`$gYOy%jz!Q%j!Q![7[![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj8WY!o`Oy%jz{%j{|8v|}%j}!O8v!O!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj8{U!o`Oy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj9fU!o`$gYOy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj:P[!o`$gYOy%jz!O%j!O!P7[!P!Q%j!Q![9x![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj:zS!dYOy%jz;'S%j;'S;=`%{<%lO%jj;]WyWOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj;zU`YOy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%j~VUcYOy%jz![%j![!]>i!];'S%j;'S;=`%{<%lO%jj>pSdY!o`Oy%jz;'S%j;'S;=`%{<%lO%jj?RSnYOy%jz;'S%j;'S;=`%{<%lO%jh?dU!WWOy%jz!_%j!_!`?v!`;'S%j;'S;=`%{<%lO%jh?}S!WW!o`Oy%jz;'S%j;'S;=`%{<%lO%jl@bS!WW!ySOy%jz;'S%j;'S;=`%{<%lO%jj@uV!|Q!WWOy%jz!_%j!_!`?v!`!aA[!a;'S%j;'S;=`%{<%lO%jbAcS!|Q!o`Oy%jz;'S%j;'S;=`%{<%lO%jjArYOy%jz}%j}!OBb!O!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjBgW!o`Oy%jz!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjCW[lY!o`Oy%jz}%j}!OCP!O!Q%j!Q![CP![!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jhDRS!zWOy%jz;'S%j;'S;=`%{<%lO%jjDdSpYOy%jz;'S%j;'S;=`%{<%lO%jnDuSo^Oy%jz;'S%j;'S;=`%{<%lO%jjEWU!zWOy%jz#a%j#a#bEj#b;'S%j;'S;=`%{<%lO%jbEoU!o`Oy%jz#d%j#d#eFR#e;'S%j;'S;=`%{<%lO%jbFWU!o`Oy%jz#c%j#c#dFj#d;'S%j;'S;=`%{<%lO%jbFoU!o`Oy%jz#f%j#f#gGR#g;'S%j;'S;=`%{<%lO%jbGWU!o`Oy%jz#h%j#h#iGj#i;'S%j;'S;=`%{<%lO%jbGoU!o`Oy%jz#T%j#T#UHR#U;'S%j;'S;=`%{<%lO%jbHWU!o`Oy%jz#b%j#b#cHj#c;'S%j;'S;=`%{<%lO%jbHoU!o`Oy%jz#h%j#h#iIR#i;'S%j;'S;=`%{<%lO%jbIYS$pQ!o`Oy%jz;'S%j;'S;=`%{<%lO%jjIkSsYOy%jz;'S%j;'S;=`%{<%lO%jfI|U$cUOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jjJeSrYOy%jz;'S%j;'S;=`%{<%lO%jfJvU#PQOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%j`K]P;=`<%l%Z",tokenizers:[_4t,j4t,A4t,T4t,1,2,3,4,new nP("m~RRYZ[z{a~~g~aO$_~~dP!P!Qg~lO$`~~",28,152)],topRules:{StyleSheet:[0,6],Styles:[1,126]},dynamicPrecedences:{94:1},specialized:[{term:147,get:e=>R4t[e]||-1},{term:148,get:e=>I4t[e]||-1},{term:4,get:e=>P4t[e]||-1},{term:28,get:e=>D4t[e]||-1},{term:146,get:e=>M4t[e]||-1}],tokenPrec:2405});let S$=null;function E$(){if(!S$&&typeof document=="object"&&document.body){let{style:e}=document.body,t=[],n=new Set;for(let i in e)i!="cssText"&&i!="cssFloat"&&typeof e[i]=="string"&&(/[A-Z]/.test(i)&&(i=i.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),n.has(i)||(t.push(i),n.add(i)));S$=t.sort().map(i=>({type:"property",label:i,apply:i+": "}))}return S$||[]}const pse=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(e=>({type:"class",label:e})),mse=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(e=>({type:"keyword",label:e})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(e=>({type:"constant",label:e}))),$4t=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(e=>({type:"type",label:e})),F4t=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(e=>({type:"keyword",label:e})),Jh=/^(\w[\w-]*|-\w[\w-]*|)$/,B4t=/^-(-[\w-]*)?$/;function U4t(e,t){var n;if((e.name=="("||e.type.isError)&&(e=e.parent||e),e.name!="ArgList")return!1;let i=(n=e.parent)===null||n===void 0?void 0:n.firstChild;return(i==null?void 0:i.name)!="Callee"?!1:t.sliceString(i.from,i.to)=="var"}const gse=new Dq,Q4t=["Declaration"];function z4t(e){for(let t=e;;){if(t.type.isTop)return t;if(!(t=t.parent))return e}}function z$e(e,t,n){if(t.to-t.from>4096){let i=gse.get(t);if(i)return i;let r=[],s=new Set,o=t.cursor(Er.IncludeAnonymous);if(o.firstChild())do for(let l of z$e(e,o.node,n))s.has(l.label)||(s.add(l.label),r.push(l));while(o.nextSibling());return gse.set(t,r),r}else{let i=[],r=new Set;return t.cursor().iterate(s=>{var o;if(n(s)&&s.matchContext(Q4t)&&((o=s.node.nextSibling)===null||o===void 0?void 0:o.name)==":"){let l=e.sliceString(s.from,s.to);r.has(l)||(r.add(l),i.push({label:l,type:"variable"}))}}),i}}const V4t=e=>t=>{let{state:n,pos:i}=t,r=Jr(n).resolveInner(i,-1),s=r.type.isError&&r.from==r.to-1&&n.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:E$(),validFor:Jh};if(r.name=="ValueName")return{from:r.from,options:mse,validFor:Jh};if(r.name=="PseudoClassName")return{from:r.from,options:pse,validFor:Jh};if(e(r)||(t.explicit||s)&&U4t(r,n.doc))return{from:e(r)||s?r.from:i,options:z$e(n.doc,z4t(r),e),validFor:B4t};if(r.name=="TagName"){for(let{parent:c}=r;c;c=c.parent)if(c.name=="Block")return{from:r.from,options:E$(),validFor:Jh};return{from:r.from,options:$4t,validFor:Jh}}if(r.name=="AtKeyword")return{from:r.from,options:F4t,validFor:Jh};if(!t.explicit)return null;let o=r.resolve(i),l=o.childBefore(i);return l&&l.name==":"&&o.name=="PseudoClassSelector"?{from:i,options:pse,validFor:Jh}:l&&l.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:i,options:mse,validFor:Jh}:o.name=="Block"||o.name=="Styles"?{from:i,options:E$(),validFor:Jh}:null},H4t=V4t(e=>e.name=="VariableName"),lP=am.define({name:"css",parser:L4t.configure({props:[xm.add({Declaration:vw()}),wm.add({"Block KeyframeList":ET})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function q4t(){return new yb(lP,lP.data.of({autocomplete:H4t}))}const kk=["_blank","_self","_top","_parent"],C$=["ascii","utf-8","utf-16","latin1","latin1"],A$=["get","post","put","delete"],T$=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],nu=["true","false"],In={},W4t={a:{attrs:{href:null,ping:null,type:null,media:null,target:kk,hreflang:null}},abbr:In,address:In,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:In,aside:In,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:In,base:{attrs:{href:null,target:kk}},bdi:In,bdo:In,blockquote:{attrs:{cite:null}},body:In,br:In,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:T$,formmethod:A$,formnovalidate:["novalidate"],formtarget:kk,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:In,center:In,cite:In,code:In,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:In,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:In,div:In,dl:In,dt:In,em:In,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:In,figure:In,footer:In,form:{attrs:{action:null,name:null,"accept-charset":C$,autocomplete:["on","off"],enctype:T$,method:A$,novalidate:["novalidate"],target:kk}},h1:In,h2:In,h3:In,h4:In,h5:In,h6:In,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:In,hgroup:In,hr:In,html:{attrs:{manifest:null}},i:In,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:T$,formmethod:A$,formnovalidate:["novalidate"],formtarget:kk,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:In,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:In,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:In,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:C$,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:In,noscript:In,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:In,param:{attrs:{name:null,value:null}},pre:In,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:In,rt:In,ruby:In,samp:In,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:C$}},section:In,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:In,source:{attrs:{src:null,type:null,media:null}},span:In,strong:In,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:In,summary:In,sup:In,table:In,tbody:In,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:In,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:In,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:In,time:{attrs:{datetime:null}},title:In,tr:In,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:In,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:In},V$e={accesskey:null,class:null,contenteditable:nu,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:nu,autocorrect:nu,autocapitalize:nu,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":nu,"aria-autocomplete":["inline","list","both","none"],"aria-busy":nu,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":nu,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":nu,"aria-hidden":nu,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":nu,"aria-multiselectable":nu,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":nu,"aria-relevant":null,"aria-required":nu,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},H$e="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of H$e)V$e[e]=null;class HC{constructor(t,n){this.tags={...W4t,...t},this.globalAttrs={...V$e,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}HC.default=new HC;function p1(e,t,n=e.length){if(!t)return"";let i=t.firstChild,r=i&&i.getChild("TagName");return r?e.sliceString(r.from,Math.min(r.to,n)):""}function m1(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function q$e(e,t,n){let i=n.tags[p1(e,m1(t))];return(i==null?void 0:i.children)||n.allTags}function EW(e,t){let n=[];for(let i=m1(t);i&&!i.type.isTop;i=m1(i.parent)){let r=p1(e,i);if(r&&i.lastChild.name=="CloseTag")break;r&&n.indexOf(r)<0&&(t.name=="EndTag"||t.from>=i.firstChild.to)&&n.push(r)}return n}const W$e=/^[:\-\.\w\u00b7-\uffff]*$/;function bse(e,t,n,i,r){let s=/\s*>/.test(e.sliceDoc(r,r+5))?"":">",o=m1(n,n.name=="StartTag"||n.name=="TagName");return{from:i,to:r,options:q$e(e.doc,o,t).map(l=>({label:l,type:"type"})).concat(EW(e.doc,n).map((l,c)=>({label:"/"+l,apply:"/"+l+s,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function yse(e,t,n,i){let r=/\s*>/.test(e.sliceDoc(i,i+5))?"":">";return{from:n,to:i,options:EW(e.doc,t).map((s,o)=>({label:s,apply:s+r,type:"type",boost:99-o})),validFor:W$e}}function K4t(e,t,n,i){let r=[],s=0;for(let o of q$e(e.doc,n,t))r.push({label:"<"+o,type:"type"});for(let o of EW(e.doc,n))r.push({label:"",type:"type",boost:99-s++});return{from:i,to:i,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function G4t(e,t,n,i,r){let s=m1(n),o=s?t.tags[p1(e.doc,s)]:null,l=o&&o.attrs?Object.keys(o.attrs):[],c=o&&o.globalAttrs===!1?l:l.length?l.concat(t.globalAttrNames):t.globalAttrNames;return{from:i,to:r,options:c.map(u=>({label:u,type:"property"})),validFor:W$e}}function X4t(e,t,n,i,r){var s;let o=(s=n.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),l=[],c;if(o){let u=e.sliceDoc(o.from,o.to),d=t.globalAttrs[u];if(!d){let f=m1(n),h=f?t.tags[p1(e.doc,f)]:null;d=(h==null?void 0:h.attrs)&&h.attrs[u]}if(d){let f=e.sliceDoc(i,r).toLowerCase(),h='"',m='"';/^['"]/.test(f)?(c=f[0]=='"'?/^[^"]*$/:/^[^']*$/,h="",m=e.sliceDoc(r,r+1)==f[0]?"":f[0],f=f.slice(1),i++):c=/^[^\s<>='"]*$/;for(let g of d)l.push({label:g,apply:h+g+m,type:"constant"})}}return{from:i,to:r,options:l,validFor:c}}function K$e(e,t){let{state:n,pos:i}=t,r=Jr(n).resolveInner(i,-1),s=r.resolve(i);for(let o=i,l;s==r&&(l=r.childBefore(o));){let c=l.lastChild;if(!c||!c.type.isError||c.fromK$e(i,r)}const J4t=bh.parser.configure({top:"SingleExpression"}),G$e=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:n$e.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:i$e.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:r$e.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:J4t},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:bh.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:lP.parser}],X$e=[{name:"style",parser:lP.parser.configure({top:"Styles"})}].concat(H$e.map(e=>({name:e,parser:bh.parser}))),Y$e=am.define({name:"html",parser:u4t.configure({props:[xm.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].lengthe.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),HN=Y$e.configure({wrap:$$e(G$e,X$e)});function e$t(e={}){let t="",n;e.matchClosingTags===!1&&(t="noMatch"),e.selfClosingTags===!0&&(t=(t?t+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(n=$$e((e.nestedLanguages||[]).concat(G$e),(e.nestedAttributes||[]).concat(X$e)));let i=n?Y$e.configure({wrap:n,dialect:t}):t?HN.configure({dialect:t}):HN;return new yb(i,[HN.data.of({autocomplete:Z4t(e)}),e.autoCloseTags!==!1?t$t:[],o7().support,q4t().support])}const vse=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),t$t=en.inputHandler.of((e,t,n,i,r)=>{if(e.composing||e.state.readOnly||t!=n||i!=">"&&i!="/"||!HN.isActiveAt(e.state,t,-1))return!1;let s=r(),{state:o}=s,l=o.changeByRange(c=>{var u,d,f;let h=o.doc.sliceString(c.from-1,c.to)==i,{head:m}=c,g=Jr(o).resolveInner(m,-1),b;if(h&&i==">"&&g.name=="EndTag"){let v=g.parent;if(((d=(u=v.parent)===null||u===void 0?void 0:u.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(b=p1(o.doc,v.parent,m))&&!vse.has(b)){let y=m+(o.doc.sliceString(m,m+1)===">"?1:0),w=``;return{range:c,changes:{from:m,to:y,insert:w}}}}else if(h&&i=="/"&&g.name=="IncompleteCloseTag"){let v=g.parent;if(g.from==m-2&&((f=v.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(b=p1(o.doc,v,m))&&!vse.has(b)){let y=m+(o.doc.sliceString(m,m+1)===">"?1:0),w=`${b}>`;return{range:ht.cursor(m+w.length,-1),changes:{from:m,to:y,insert:w}}}}return{range:c}});return l.changes.empty?!1:(e.dispatch([s,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Z$e=eL({commentTokens:{block:{open:""}}}),J$e=new ci,e6e=f3t.configure({props:[wm.add(e=>!e.is("Block")||e.is("Document")||p7(e)!=null||n$t(e)?void 0:(t,n)=>({from:n.doc.lineAt(t.from).to,to:t.to})),J$e.add(p7),xm.add({Document:()=>null}),Og.add({Document:Z$e})]});function p7(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function n$t(e){return e.name=="OrderedList"||e.name=="BulletList"}function i$t(e,t){let n=e;for(;;){let i=n.nextSibling,r;if(!i||(r=p7(i.type))!=null&&r<=t)break;n=i}return n.to}const r$t=v4e.of((e,t,n)=>{for(let i=Jr(e).resolveInner(n,-1);i&&!(i.fromn)return{from:n,to:s}}return null});function CW(e){return new wu(Z$e,e,[],"markdown")}const s$t=CW(e6e),a$t=e6e.configure([k3t,E3t,S3t,C3t,{props:[wm.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),cP=CW(a$t);function o$t(e,t){return n=>{if(n&&e){let i=null;if(n=/\S*/.exec(n)[0],typeof e=="function"?i=e(n):i=YI.matchLanguageName(e,n,!0),i instanceof YI)return i.support?i.support.language.parser:x0.getSkippingParser(i.load());if(i)return i.parser}return t?t.parser:null}}let _$=class{constructor(t,n,i,r,s,o,l){this.node=t,this.from=n,this.to=i,this.spaceBefore=r,this.spaceAfter=s,this.type=o,this.item=l}blank(t,n=!0){let i=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(t!=null){for(;i.length0;r--)i+=" ";return i+(n?this.spaceAfter:"")}}marker(t,n){let i=this.node.name=="OrderedList"?String(+n6e(this.item,t)[2]+n):"";return this.spaceBefore+i+this.type+this.spaceAfter}};function t6e(e,t){let n=[],i=[];for(let r=e;r;r=r.parent){if(r.name=="FencedCode")return i;(r.name=="ListItem"||r.name=="Blockquote")&&n.push(r)}for(let r=n.length-1;r>=0;r--){let s=n[r],o,l=t.lineAt(s.from),c=s.from-l.from;if(s.name=="Blockquote"&&(o=/^ *>( ?)/.exec(l.text.slice(c))))i.push(new _$(s,c,c+o[0].length,"",o[1],">",null));else if(s.name=="ListItem"&&s.parent.name=="OrderedList"&&(o=/^( *)\d+([.)])( *)/.exec(l.text.slice(c)))){let u=o[3],d=o[0].length;u.length>=4&&(u=u.slice(0,u.length-4),d-=4),i.push(new _$(s.parent,c,c+d,o[1],u,o[2],s))}else if(s.name=="ListItem"&&s.parent.name=="BulletList"&&(o=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(l.text.slice(c)))){let u=o[4],d=o[0].length;u.length>4&&(u=u.slice(0,u.length-4),d-=4);let f=o[2];o[3]&&(f+=o[3].replace(/[xX]/," ")),i.push(new _$(s.parent,c,c+d,o[1],u,f,s))}}return i}function n6e(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function j$(e,t,n,i=0){for(let r=-1,s=e;;){if(s.name=="ListItem"){let l=n6e(s,t),c=+l[2];if(r>=0){if(c!=r+1)return;n.push({from:s.from+l[1].length,to:s.from+l[0].length,insert:String(r+2+i)})}r=c}let o=s.nextSibling;if(!o)break;s=o}}function AW(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(fO)!=" ")return e;let i=Of(e,4,n),r="";for(let s=i;s>0;)s>=4?(r+=" ",s-=4):(r+=" ",s--);return r+e.slice(n)}const l$t=(e={})=>({state:t,dispatch:n})=>{let i=Jr(t),{doc:r}=t,s=null,o=t.changeByRange(l=>{if(!l.empty||!cP.isActiveAt(t,l.from,-1)&&!cP.isActiveAt(t,l.from,1))return s={range:l};let c=l.from,u=r.lineAt(c),d=t6e(i.resolveInner(c,-1),r);for(;d.length&&d[d.length-1].from>c-u.from;)d.pop();if(!d.length)return s={range:l};let f=d[d.length-1];if(f.to-f.spaceAfter.length>c-u.from)return s={range:l};let h=c>=f.to-f.spaceAfter.length&&!/\S/.test(u.text.slice(f.to));if(f.item&&h){let y=f.node.firstChild,w=f.node.getChild("ListItem","ListItem");if(y.to>=c||w&&w.to0&&!/[^\s>]/.test(r.lineAt(u.from-1).text)||e.nonTightLists===!1){let x=d.length>1?d[d.length-2]:null,O,k="";x&&x.item?(O=u.from+x.from,k=x.marker(r,1)):O=u.from+(x?x.to:0);let S=[{from:O,to:c,insert:k}];return f.node.name=="OrderedList"&&j$(f.item,r,S,-2),x&&x.node.name=="OrderedList"&&j$(x.item,r,S),{range:ht.cursor(O+k.length),changes:S}}else{let x=wse(d,t,u);return{range:ht.cursor(c+x.length+1),changes:{from:u.from,insert:x+t.lineBreak}}}}if(f.node.name=="Blockquote"&&h&&u.from){let y=r.lineAt(u.from-1),w=/>\s*$/.exec(y.text);if(w&&w.index==f.from){let x=t.changes([{from:y.from+w.index,to:y.to},{from:u.from+f.from,to:u.to}]);return{range:l.map(x),changes:x}}}let m=[];f.node.name=="OrderedList"&&j$(f.item,r,m);let g=f.item&&f.item.from]*/.exec(u.text)[0].length>=f.to)for(let y=0,w=d.length-1;y<=w;y++)b+=y==w&&!g?d[y].marker(r,1):d[y].blank(yu.from&&/\s/.test(u.text.charAt(v-u.from-1));)v--;return b=AW(b,t),u$t(f.node,t.doc)&&(b=wse(d,t,u)+t.lineBreak+b),m.push({from:v,to:c,insert:t.lineBreak+b}),{range:ht.cursor(v+b.length+1),changes:m}});return s?!1:(n(t.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)},c$t=l$t();function xse(e){return e.name=="QuoteMark"||e.name=="ListMark"}function u$t(e,t){if(e.name!="OrderedList"&&e.name!="BulletList")return!1;let n=e.firstChild,i=e.getChild("ListItem","ListItem");if(!i)return!1;let r=t.lineAt(n.to),s=t.lineAt(i.from),o=/^[\s>]*$/.test(r.text);return r.number+(o?0:1){let n=Jr(e),i=null,r=e.changeByRange(s=>{let o=s.from,{doc:l}=e;if(s.empty&&cP.isActiveAt(e,s.from)){let c=l.lineAt(o),u=t6e(d$t(n,o),l);if(u.length){let d=u[u.length-1],f=d.to-d.spaceAfter.length+(d.spaceAfter?1:0);if(o-c.from>f&&!/\S/.test(c.text.slice(f,o-c.from)))return{range:ht.cursor(c.from+f),changes:{from:c.from+f,to:o}};if(o-c.from==f&&(d.item&&c.from<=d.item.from||/^[\s>]*$/.test(c.text.slice(0,d.to)))){let h=c.from+d.from;if(d.item&&d.node.from{var n;let{main:i}=t.state.selection;if(i.empty)return!1;let r=(n=e.clipboardData)===null||n===void 0?void 0:n.getData("text/plain");if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r="https://"+r),!cP.isActiveAt(t.state,i.from,1)))return!1;let s=Jr(t.state),o=!1;return s.iterate({from:i.from,to:i.to,enter:l=>{(l.from>i.from||b$t.test(l.name))&&(o=!0)},leave:l=>{l.to=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}const y6t=new Da((e,t)=>{let n;if(e.next<0)e.acceptToken(O$t);else if(t.context.flags&qN)R$(e.next)&&e.acceptToken(w$t,1);else if(((n=e.peek(-1))<0||R$(n))&&t.canShift(Ose)){let i=0;for(;e.next==TW||e.next==aL;)e.advance(),i++;(e.next==k0||e.next==qC||e.next==_W)&&e.acceptToken(Ose,-i)}else R$(e.next)&&e.acceptToken(x$t,1)},{contextual:!0}),v6t=new Da((e,t)=>{let n=t.context;if(n.flags)return;let i=e.peek(-1);if(i==k0||i==qC){let r=0,s=0;for(;;){if(e.next==TW)r++;else if(e.next==aL)r+=8-r%8;else break;e.advance(),s++}r!=n.indent&&e.next!=k0&&e.next!=qC&&e.next!=_W&&(r[e,t|u6e])),O6t=new iL({start:x6t,reduce(e,t,n,i){return e.flags&qN&&b6t.has(t)||(t==F$t||t==o6e)&&e.flags&u6e?e.parent:e},shift(e,t,n,i){return t==r6e?new WN(e,w6t(i.read(i.pos,n.pos)),0):t==s6e?e.parent:t==E$t||t==_$t||t==R$t||t==a6e?new WN(e,0,qN):Cse.has(t)?new WN(e,0,Cse.get(t)|e.flags&qN):e},hash(e){return e.hash}}),k6t=new Da(e=>{for(let t=0;t<5;t++){if(e.next!="print".charCodeAt(t))return;e.advance()}if(!/\w/.test(String.fromCharCode(e.next)))for(let t=0;;t++){let n=e.peek(t);if(!(n==TW||n==aL)){n!=u6t&&n!=d6t&&n!=k0&&n!=qC&&n!=_W&&e.acceptToken(v$t);return}}}),S6t=new Da((e,t)=>{let{flags:n}=t.context,i=n&op?c6e:l6e,r=(n&lp)>0,s=!(n&cp),o=(n&up)>0,l=e.pos;for(;!(e.next<0);)if(o&&e.next==m7)if(e.peek(1)==m7)e.advance(2);else{if(e.pos==l){e.acceptToken(a6e,1);return}break}else if(s&&e.next==Ese){if(e.pos==l){e.advance();let c=e.next;c>=0&&(e.advance(),E6t(e,c)),e.acceptToken(S$t);return}break}else if(e.next==Ese&&!s&&e.peek(1)>-1)e.advance(2);else if(e.next==i&&(!r||e.peek(1)==i&&e.peek(2)==i)){if(e.pos==l){e.acceptToken(kse,r?3:1);return}break}else if(e.next==k0){if(r)e.advance();else if(e.pos==l){e.acceptToken(kse);return}break}else e.advance();e.pos>l&&e.acceptToken(k$t)});function E6t(e,t){if(t==f6t)for(let n=0;n<2&&e.next>=48&&e.next<=55;n++)e.advance();else if(t==h6t)for(let n=0;n<2&&I$(e.next);n++)e.advance();else if(t==m6t)for(let n=0;n<4&&I$(e.next);n++)e.advance();else if(t==g6t)for(let n=0;n<8&&I$(e.next);n++)e.advance();else if(t==p6t&&e.next==m7){for(e.advance();e.next>=0&&e.next!=Sse&&e.next!=l6e&&e.next!=c6e&&e.next!=k0;)e.advance();e.next==Sse&&e.advance()}}const C6t=vm({'async "*" "**" FormatConversion FormatSpec':fe.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":fe.controlKeyword,"in not and or is del":fe.operatorKeyword,"from def class global nonlocal lambda":fe.definitionKeyword,import:fe.moduleKeyword,"with as print":fe.keyword,Boolean:fe.bool,None:fe.null,VariableName:fe.variableName,"CallExpression/VariableName":fe.function(fe.variableName),"FunctionDefinition/VariableName":fe.function(fe.definition(fe.variableName)),"ClassDefinition/VariableName":fe.definition(fe.className),PropertyName:fe.propertyName,"CallExpression/MemberExpression/PropertyName":fe.function(fe.propertyName),Comment:fe.lineComment,Number:fe.number,String:fe.string,FormatString:fe.special(fe.string),Escape:fe.escape,UpdateOp:fe.updateOperator,"ArithOp!":fe.arithmeticOperator,BitOp:fe.bitwiseOperator,CompareOp:fe.compareOperator,AssignOp:fe.definitionOperator,Ellipsis:fe.punctuation,At:fe.meta,"( )":fe.paren,"[ ]":fe.squareBracket,"{ }":fe.brace,".":fe.derefOperator,", ;":fe.separator}),A6t={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},T6t=om.deserialize({version:14,states:"##jQ`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO5TQdO'#DoOOQS,5:Y,5:YO5hQdO'#HdOOQS,5:],5:]O5uQ!fO,5:]O5zQtO,59YO1lQdO,59bO1lQdO,59bO1lQdO,59bO8jQdO,59bO8oQdO,59bO8vQdO,59jO8}QdO'#HTO:TQdO'#HSOOQS'#HS'#HSOOQS'#D['#D[O:lQdO,59aO'vQdO,59aO:zQdO,59aOOQS,59y,59yO;PQdO,5:RO'vQdO,5:ROOQS,5:Q,5:QO;_QdO,5:QO;dQdO,5:XO'vQdO,5:XO'vQdO,5:VOOQS,5:U,5:UO;uQdO,5:UO;zQdO,5:WOOOW'#Fy'#FyOOOOQS'#Ds'#DsOOQS1G/w1G/wOOQS1G.|1G.|O!/[QtO1G.|O!/cQtO1G.|O1lQdO1G.|O!0OQdO1G/UOOQS'#DZ'#DZO0rQdO,59tOOQS1G.{1G.{O!0VQdO1G/eO!0gQdO1G/eO!0oQdO1G/fO'vQdO'#H[O!0tQdO'#H[O!0yQtO1G.{O!1ZQdO,59iO!2aQdO,5=zO!2qQdO,5=zO!2yQdO1G/mO!3OQtO1G/mOOQS1G/l1G/lO!3`QdO,5=uO!4VQdO,5=uO0rQdO1G/qO!4tQdO1G/sO!4yQtO1G/sO!5ZQtO1G/qOOQS1G/p1G/pOOQS1G/r1G/rOOOW-E9w-E9wOOQS1G/{1G/{O!5kQdO'#HxO0rQdO'#HxO!5|QdO,5>cOOOW-E9x-E9xOOQS1G/|1G/|OOQS-E9{-E9{O!6[Q#xO1G2zO!6{QtO1G2zO'vQdO,5kOOQS1G1`1G1`O!8RQdO1G1`OOQS'#DV'#DVO0rQdO,5=qOOQS,5=q,5=qO!8WQdO'#FrO!8cQdO,59oO!8kQdO1G/XO!8uQtO,5=uOOQS1G3`1G3`OOQS,5:m,5:mO!9fQdO'#GtOOQS,5jO!;ZQdO,5>jO1XQdO,5>jO!;lQdO,5>iOOQS-E:R-E:RO!;qQdO1G0lO!;|QdO1G0lO!lO!lO!hO!=VQdO,5>hO!=hQdO'#EpO0rQdO1G0tO!=sQdO1G0tO!=xQgO1G0zO!AvQgO1G0}O!EqQdO,5>oO!E{QdO,5>oO!FTQtO,5>oO0rQdO1G1PO!F_QdO1G1PO4iQdO1G1UO!!vQdO1G1WOOQV,5;a,5;aO!FdQfO,5;aO!FiQgO1G1QO!JjQdO'#GZO4iQdO1G1QO4iQdO1G1QO!JzQdO,5>pO!KXQdO,5>pO1XQdO,5>pOOQV1G1U1G1UO!KaQdO'#FSO!KrQ!fO1G1WO!KzQdO1G1WOOQV1G1]1G1]O4iQdO1G1]O!LPQdO1G1]O!LXQdO'#F^OOQV1G1b1G1bO!#ZQtO1G1bPOOO1G2v1G2vP!L^OSO1G2vOOQS,5=},5=}OOQS'#Dp'#DpO0rQdO,5=}O!LfQdO,5=|O!LyQdO,5=|OOQS1G/u1G/uO!MRQdO,5>PO!McQdO,5>PO!MkQdO,5>PO!NOQdO,5>PO!N`QdO,5>POOQS1G3j1G3jOOQS7+$h7+$hO!8kQdO7+$pO#!RQdO1G.|O#!YQdO1G.|OOQS1G/`1G/`OOQS,5<`,5<`O'vQdO,5<`OOQS7+%P7+%PO#!aQdO7+%POOQS-E9r-E9rOOQS7+%Q7+%QO#!qQdO,5=vO'vQdO,5=vOOQS7+$g7+$gO#!vQdO7+%PO##OQdO7+%QO##TQdO1G3fOOQS7+%X7+%XO##eQdO1G3fO##mQdO7+%XOOQS,5<_,5<_O'vQdO,5<_O##rQdO1G3aOOQS-E9q-E9qO#$iQdO7+%]OOQS7+%_7+%_O#$wQdO1G3aO#%fQdO7+%_O#%kQdO1G3gO#%{QdO1G3gO#&TQdO7+%]O#&YQdO,5>dO#&sQdO,5>dO#&sQdO,5>dOOQS'#Dx'#DxO#'UO&jO'#DzO#'aO`O'#HyOOOW1G3}1G3}O#'fQdO1G3}O#'nQdO1G3}O#'yQ#xO7+(fO#(jQtO1G2UP#)TQdO'#GOOOQS,5nQdO,5sQdO1G4OOOQS-E9y-E9yO#?^QdO1G4OO<[QdO'#H{OOOO'#D{'#D{OOOO'#F|'#F|O#?oO&jO,5:fOOOW,5>e,5>eOOOW7+)i7+)iO#?zQdO7+)iO#@SQdO1G2zO#@mQdO1G2zP'vQdO'#FuO0rQdO<mO#BQQdO,5>mOOQS1G0v1G0vOOQS<rO#KgQdO,5>rO#KrQdO,5>rO#K}QdO,5>qO#L`QdO,5>qOOQS1G1Y1G1YOOQS,5;p,5;pOOQV<VAN>VO$ oQdO<cAN>cO0rQdO1G1|O$!PQtO1G1|P$!ZQdO'#FvOOQS1G2R1G2RP$!hQdO'#F{O$!uQdO7+)jO$#`QdO,5>gOOOO-E9z-E9zOOOW<tO$4{QdO,5>tO1XQdO,5vO$)nQdO,5>vOOQS1G1p1G1pOOQS,5<[,5<[OOQU7+'P7+'PO$+zQdO1G/iO$)nQdO,5wO$8zQdO,5>wOOQS1G1s1G1sOOQS7+'S7+'SP$)nQdO'#GdO$9SQdO1G4bO$9^QdO1G4bO$9fQdO1G4bOOQS7+%T7+%TO$9tQdO1G1tO$:SQtO'#FaO$:ZQdO,5<}OOQS,5<},5<}O$:iQdO1G4cOOQS-E:a-E:aO$)nQdO,5<|O$:pQdO,5<|O$:uQdO7+)|OOQS-E:`-E:`O$;PQdO7+)|O$)nQdO,5S~O%cOS%^OSSOS%]PQ~OPdOVaOfoOhYOopOs!POvqO!PrO!Q{O!T!SO!U!RO!XZO!][O!h`O!r`O!s`O!t`O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#l!QO#o!TO#s!UO#u!VO#z!WO#}hO$P!XO%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~O%]!YO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%j![O%k!]O%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aO~Ok%xXl%xXm%xXn%xXo%xXp%xXs%xXz%xX{%xX!x%xX#g%xX%[%xX%_%xX%z%xXg%xX!T%xX!U%xX%{%xX!W%xX![%xX!Q%xX#[%xXt%xX!m%xX~P%SOfoOhYO!XZO!][O!h`O!r`O!s`O!t`O%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~Oz%wX{%wX#g%wX%[%wX%_%wX%z%wX~Ok!pOl!qOm!oOn!oOo!rOp!sOs!tO!x%wX~P)pOV!zOg!|Oo0cOv0qO!PrO~P'vOV#OOo0cOv0qO!W#PO~P'vOV#SOa#TOo0cOv0qO![#UO~P'vOQ#XO%`#XO%a#ZO~OQ#^OR#[O%`#^O%a#`O~OV%iX_%iXa%iXh%iXk%iXl%iXm%iXn%iXo%iXp%iXs%iXz%iX!X%iX!f%iX%j%iX%k%iX%l%iX%m%iX%n%iX%o%iX%p%iX%q%iX%r%iX%s%iXg%iX!T%iX!U%iX~O&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O{%iX!x%iX#g%iX%[%iX%_%iX%z%iX%{%iX!W%iX![%iX!Q%iX#[%iXt%iX!m%iX~P,eOz#dO{%hX!x%hX#g%hX%[%hX%_%hX%z%hX~Oo0cOv0qO~P'vO#g#gO%[#iO%_#iO~O%uWO~O!T#nO#u!VO#z!WO#}hO~OopO~P'vOV#sOa#tO%uWO{wP~OV#xOo0cOv0qO!Q#yO~P'vO{#{O!x$QO%z#|O#g!yX%[!yX%_!yX~OV#xOo0cOv0qO#g#SX%[#SX%_#SX~P'vOo0cOv0qO#g#WX%[#WX%_#WX~P'vOh$WO%uWO~O!f$YO!r$YO%uWO~OV$eO~P'vO!U$gO#s$hO#u$iO~O{$jO~OV$qO~P'vOS$sO%[$rO%_$rO%c$tO~OV$}Oa$}Og%POo0cOv0qO~P'vOo0cOv0qO{%SO~P'vO&Y%UO~Oa!bOh!iO!X!kO!f!mOVba_bakbalbambanbaobapbasbazba{ba!xba#gba%[ba%_ba%jba%kba%lba%mba%nba%oba%pba%qba%rba%sba%zbagba!Tba!Uba%{ba!Wba![ba!Qba#[batba!mba~On%ZO~Oo%ZO~P'vOo0cO~P'vOk0eOl0fOm0dOn0dOo0mOp0nOs0rOg%wX!T%wX!U%wX%{%wX!W%wX![%wX!Q%wX#[%wX!m%wX~P)pO%{%]Og%vXz%vX!T%vX!U%vX!W%vX{%vX~Og%_Oz%`O!T%dO!U%cO~Og%_O~Oz%gO!T%dO!U%cO!W&SX~O!W%kO~Oz%lO{%nO!T%dO!U%cO![%}X~O![%rO~O![%sO~OQ#XO%`#XO%a%uO~OV%wOo0cOv0qO!PrO~P'vOQ#^OR#[O%`#^O%a%zO~OV!qa_!qaa!qah!qak!qal!qam!qan!qao!qap!qas!qaz!qa{!qa!X!qa!f!qa!x!qa#g!qa%[!qa%_!qa%j!qa%k!qa%l!qa%m!qa%n!qa%o!qa%p!qa%q!qa%r!qa%s!qa%z!qag!qa!T!qa!U!qa%{!qa!W!qa![!qa!Q!qa#[!qat!qa!m!qa~P#yOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P%SOV&OOopOvqO{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P'vOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#g$zX%[$zX%_$zX~P'vO#g#gO%[&TO%_&TO~O!f&UOh&sX%[&sXz&sX#[&sX#g&sX%_&sX#Z&sXg&sX~Oh!iO%[&WO~Okealeameaneaoeapeaseazea{ea!xea#gea%[ea%_ea%zeagea!Tea!Uea%{ea!Wea![ea!Qea#[eatea!mea~P%SOsqazqa{qa#gqa%[qa%_qa%zqa~Ok!pOl!qOm!oOn!oOo!rOp!sO!xqa~PEcO%z&YOz%yX{%yX~O%uWOz%yX{%yX~Oz&]O{wX~O{&_O~Oz%lO#g%}X%[%}X%_%}Xg%}X{%}X![%}X!m%}X%z%}X~OV0lOo0cOv0qO!PrO~P'vO%z#|O#gUa%[Ua%_Ua~Oz&hO#g&PX%[&PX%_&PXn&PX~P%SOz&kO!Q&jO#g#Wa%[#Wa%_#Wa~Oz&lO#[&nO#g&rX%[&rX%_&rXg&rX~O!f$YO!r$YO#Z&qO%uWO~O#Z&qO~Oz&sO#g&tX%[&tX%_&tX~Oz&uO#g&pX%[&pX%_&pX{&pX~O!X&wO%z&xO~Oz&|On&wX~P%SOn'PO~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO%['UO~P'vOt'YO#p'WO#q'XOP#naV#naf#nah#nao#nas#nav#na!P#na!Q#na!T#na!U#na!X#na!]#na!h#na!r#na!s#na!t#na!{#na!}#na#P#na#R#na#T#na#X#na#Z#na#^#na#_#na#a#na#c#na#l#na#o#na#s#na#u#na#z#na#}#na$P#na%X#na%o#na%p#na%t#na%u#na&Z#na&[#na&]#na&^#na&_#na&`#na&a#na&b#na&c#na&d#na&e#na&f#na&g#na&h#na&i#na&j#na%Z#na%_#na~Oz'ZO#[']O{&xX~Oh'_O!X&wO~Oh!iO{$jO!X&wO~O{'eO~P%SO%['hO%_'hO~OS'iO%['hO%_'hO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%k!]O~P!#uO%kWi~P!#uOV!aO_!aOa!bOh!iO!X!kO!f!mO%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%m!_O%n!_O~P!&pO%mWi%nWi~P!&pOa!bOh!iO!X!kO!f!mOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%mWi%nWi%oWi%pWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~OV!aO_!aO%q!aO%r!aO%s!aO~P!)nOVWi_Wi%qWi%rWi%sWi~P!)nO!T%dO!U%cOg&VXz&VX~O%z'kO%{'kO~P,eOz'mOg&UX~Og'oO~Oz'pO{'rO!W&XX~Oo0cOv0qOz'pO{'sO!W&XX~P'vO!W'uO~Om!oOn!oOo!rOp!sOkjisjizji{ji!xji#gji%[ji%_ji%zji~Ol!qO~P!.aOlji~P!.aOk0eOl0fOm0dOn0dOo0mOp0nO~Ot'wO~P!/jOV'|Og'}Oo0cOv0qO~P'vOg'}Oz(OO~Og(QO~O!U(SO~Og(TOz(OO!T%dO!U%cO~P%SOk0eOl0fOm0dOn0dOo0mOp0nOgqa!Tqa!Uqa%{qa!Wqa![qa!Qqa#[qatqa!mqa~PEcOV'|Oo0cOv0qO!W&Sa~P'vOz(WO!W&Sa~O!W(XO~Oz(WO!T%dO!U%cO!W&Sa~P%SOV(]Oo0cOv0qO![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~P'vOz(^O![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~O![(aO~Oz(^O!T%dO!U%cO![%}a~P%SOz(dO!T%dO!U%cO![&Ta~P%SOz(gO{&lX![&lX!m&lX%z&lX~O{(kO![(mO!m(nO%z(jO~OV&OOopOvqO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~P'vOz(pO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~O!f&UOh&sa%[&saz&sa#[&sa#g&sa%_&sa#Z&sag&sa~O%[(uO~OV#sOa#tO%uWO~Oz&]O{wa~OopOvqO~P'vOz(^O#g%}a%[%}a%_%}ag%}a{%}a![%}a!m%}a%z%}a~P%SOz(zO#g%hX%[%hX%_%hX%z%hX~O%z#|O#gUi%[Ui%_Ui~O#g&Pa%[&Pa%_&Pan&Pa~P'vOz(}O#g&Pa%[&Pa%_&Pan&Pa~O%uWO#g&ra%[&ra%_&rag&ra~Oz)SO#g&ra%[&ra%_&rag&ra~Og)VO~OV)WOh$WO%uWO~O#Z)XO~O%uWO#g&ta%[&ta%_&ta~Oz)ZO#g&ta%[&ta%_&ta~Oo0cOv0qO#g&pa%[&pa%_&pa{&pa~P'vOz)^O#g&pa%[&pa%_&pa{&pa~OV)`Oa)`O%uWO~O%z)eO~Ot)hO#j)gOP#hiV#hif#hih#hio#his#hiv#hi!P#hi!Q#hi!T#hi!U#hi!X#hi!]#hi!h#hi!r#hi!s#hi!t#hi!{#hi!}#hi#P#hi#R#hi#T#hi#X#hi#Z#hi#^#hi#_#hi#a#hi#c#hi#l#hi#o#hi#s#hi#u#hi#z#hi#}#hi$P#hi%X#hi%o#hi%p#hi%t#hi%u#hi&Z#hi&[#hi&]#hi&^#hi&_#hi&`#hi&a#hi&b#hi&c#hi&d#hi&e#hi&f#hi&g#hi&h#hi&i#hi&j#hi%Z#hi%_#hi~Ot)iOP#kiV#kif#kih#kio#kis#kiv#ki!P#ki!Q#ki!T#ki!U#ki!X#ki!]#ki!h#ki!r#ki!s#ki!t#ki!{#ki!}#ki#P#ki#R#ki#T#ki#X#ki#Z#ki#^#ki#_#ki#a#ki#c#ki#l#ki#o#ki#s#ki#u#ki#z#ki#}#ki$P#ki%X#ki%o#ki%p#ki%t#ki%u#ki&Z#ki&[#ki&]#ki&^#ki&_#ki&`#ki&a#ki&b#ki&c#ki&d#ki&e#ki&f#ki&g#ki&h#ki&i#ki&j#ki%Z#ki%_#ki~OV)kOn&wa~P'vOz)lOn&wa~Oz)lOn&wa~P%SOn)pO~O%Y)tO~Ot)wO#p'WO#q)vOP#niV#nif#nih#nio#nis#niv#ni!P#ni!Q#ni!T#ni!U#ni!X#ni!]#ni!h#ni!r#ni!s#ni!t#ni!{#ni!}#ni#P#ni#R#ni#T#ni#X#ni#Z#ni#^#ni#_#ni#a#ni#c#ni#l#ni#o#ni#s#ni#u#ni#z#ni#}#ni$P#ni%X#ni%o#ni%p#ni%t#ni%u#ni&Z#ni&[#ni&]#ni&^#ni&_#ni&`#ni&a#ni&b#ni&c#ni&d#ni&e#ni&f#ni&g#ni&h#ni&i#ni&j#ni%Z#ni%_#ni~OV)zOo0cOv0qO{$jO~P'vOo0cOv0qO{&xa~P'vOz*OO{&xa~OV*SOa*TOg*WO%q*UO%uWO~O{$jO&{*YO~Oh'_O~Oh!iO{$jO~O%[*_O~O%[*aO%_*aO~OV$}Oa$}Oo0cOv0qOg&Ua~P'vOz*dOg&Ua~Oo0cOv0qO{*gO!W&Xa~P'vOz*hO!W&Xa~Oo0cOv0qOz*hO{*kO!W&Xa~P'vOo0cOv0qOz*hO!W&Xa~P'vOz*hO{*kO!W&Xa~Om0dOn0dOo0mOp0nOgjikjisjizji!Tji!Uji%{ji!Wji{ji![ji#gji%[ji%_ji!Qji#[jitji!mji%zji~Ol0fO~P!NkOlji~P!NkOV'|Og*pOo0cOv0qO~P'vOn*rO~Og*pOz*tO~Og*uO~OV'|Oo0cOv0qO!W&Si~P'vOz*vO!W&Si~O!W*wO~OV(]Oo0cOv0qO![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~P'vOz*zO!T%dO!U%cO![&Ti~Oz*}O![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~O![+OO~Oa+QOo0cOv0qO![&Ti~P'vOz*zO![&Ti~O![+SO~OV+UOo0cOv0qO{&la![&la!m&la%z&la~P'vOz+VO{&la![&la!m&la%z&la~O!]+YO&n+[O![!nX~O![+^O~O{(kO![+_O~O{(kO![+_O!m+`O~OV&OOopOvqO{%hq!x%hq#g%hq%[%hq%_%hq%z%hq~P'vOz$ri{$ri!x$ri#g$ri%[$ri%_$ri%z$ri~P%SOV&OOopOvqO~P'vOV&OOo0cOv0qO#g%ha%[%ha%_%ha%z%ha~P'vOz+aO#g%ha%[%ha%_%ha%z%ha~Oz$ia#g$ia%[$ia%_$ian$ia~P%SO#g&Pi%[&Pi%_&Pin&Pi~P'vOz+dO#g#Wq%[#Wq%_#Wq~O#[+eOz$va#g$va%[$va%_$vag$va~O%uWO#g&ri%[&ri%_&rig&ri~Oz+gO#g&ri%[&ri%_&rig&ri~OV+iOh$WO%uWO~O%uWO#g&ti%[&ti%_&ti~Oo0cOv0qO#g&pi%[&pi%_&pi{&pi~P'vO{#{Oz#eX!W#eX~Oz+mO!W&uX~O!W+oO~Ot+rO#j)gOP#hqV#hqf#hqh#hqo#hqs#hqv#hq!P#hq!Q#hq!T#hq!U#hq!X#hq!]#hq!h#hq!r#hq!s#hq!t#hq!{#hq!}#hq#P#hq#R#hq#T#hq#X#hq#Z#hq#^#hq#_#hq#a#hq#c#hq#l#hq#o#hq#s#hq#u#hq#z#hq#}#hq$P#hq%X#hq%o#hq%p#hq%t#hq%u#hq&Z#hq&[#hq&]#hq&^#hq&_#hq&`#hq&a#hq&b#hq&c#hq&d#hq&e#hq&f#hq&g#hq&h#hq&i#hq&j#hq%Z#hq%_#hq~On$|az$|a~P%SOV)kOn&wi~P'vOz+yOn&wi~Oz,TO{$jO#[,TO~O#q,VOP#nqV#nqf#nqh#nqo#nqs#nqv#nq!P#nq!Q#nq!T#nq!U#nq!X#nq!]#nq!h#nq!r#nq!s#nq!t#nq!{#nq!}#nq#P#nq#R#nq#T#nq#X#nq#Z#nq#^#nq#_#nq#a#nq#c#nq#l#nq#o#nq#s#nq#u#nq#z#nq#}#nq$P#nq%X#nq%o#nq%p#nq%t#nq%u#nq&Z#nq&[#nq&]#nq&^#nq&_#nq&`#nq&a#nq&b#nq&c#nq&d#nq&e#nq&f#nq&g#nq&h#nq&i#nq&j#nq%Z#nq%_#nq~O#[,WOz%Oa{%Oa~Oo0cOv0qO{&xi~P'vOz,YO{&xi~O{#{O%z,[Og&zXz&zX~O%uWOg&zXz&zX~Oz,`Og&yX~Og,bO~O%Y,eO~O!T%dO!U%cOg&Viz&Vi~OV$}Oa$}Oo0cOv0qOg&Ui~P'vO{,hOz$la!W$la~Oo0cOv0qO{,iOz$la!W$la~P'vOo0cOv0qO{*gO!W&Xi~P'vOz,lO!W&Xi~Oo0cOv0qOz,lO!W&Xi~P'vOz,lO{,oO!W&Xi~Og$hiz$hi!W$hi~P%SOV'|Oo0cOv0qO~P'vOn,qO~OV'|Og,rOo0cOv0qO~P'vOV'|Oo0cOv0qO!W&Sq~P'vOz$gi![$gi#g$gi%[$gi%_$gig$gi{$gi!m$gi%z$gi~P%SOV(]Oo0cOv0qO~P'vOa+QOo0cOv0qO![&Tq~P'vOz,sO![&Tq~O![,tO~OV(]Oo0cOv0qO![%}q#g%}q%[%}q%_%}qg%}q{%}q!m%}q%z%}q~P'vO{,uO~OV+UOo0cOv0qO{&li![&li!m&li%z&li~P'vOz,zO{&li![&li!m&li%z&li~O!]+YO&n+[O![!na~O{(kO![,}O~OV&OOo0cOv0qO#g%hi%[%hi%_%hi%z%hi~P'vOz-OO#g%hi%[%hi%_%hi%z%hi~O%uWO#g&rq%[&rq%_&rqg&rq~Oz-RO#g&rq%[&rq%_&rqg&rq~OV)`Oa)`O%uWO!W&ua~Oz-TO!W&ua~On$|iz$|i~P%SOV)kO~P'vOV)kOn&wq~P'vOt-XOP#myV#myf#myh#myo#mys#myv#my!P#my!Q#my!T#my!U#my!X#my!]#my!h#my!r#my!s#my!t#my!{#my!}#my#P#my#R#my#T#my#X#my#Z#my#^#my#_#my#a#my#c#my#l#my#o#my#s#my#u#my#z#my#}#my$P#my%X#my%o#my%p#my%t#my%u#my&Z#my&[#my&]#my&^#my&_#my&`#my&a#my&b#my&c#my&d#my&e#my&f#my&g#my&h#my&i#my&j#my%Z#my%_#my~O%Z-]O%_-]O~P`O#q-^OP#nyV#nyf#nyh#nyo#nys#nyv#ny!P#ny!Q#ny!T#ny!U#ny!X#ny!]#ny!h#ny!r#ny!s#ny!t#ny!{#ny!}#ny#P#ny#R#ny#T#ny#X#ny#Z#ny#^#ny#_#ny#a#ny#c#ny#l#ny#o#ny#s#ny#u#ny#z#ny#}#ny$P#ny%X#ny%o#ny%p#ny%t#ny%u#ny&Z#ny&[#ny&]#ny&^#ny&_#ny&`#ny&a#ny&b#ny&c#ny&d#ny&e#ny&f#ny&g#ny&h#ny&i#ny&j#ny%Z#ny%_#ny~Oz-aO{$jO#[-aO~Oo0cOv0qO{&xq~P'vOz-dO{&xq~O%z,[Og&zaz&za~O{#{Og&zaz&za~OV*SOa*TO%q*UO%uWOg&ya~Oz-hOg&ya~O$S-lO~OV$}Oa$}Oo0cOv0qO~P'vOo0cOv0qO{-mOz$li!W$li~P'vOo0cOv0qOz$li!W$li~P'vO{-mOz$li!W$li~Oo0cOv0qO{*gO~P'vOo0cOv0qO{*gO!W&Xq~P'vOz-pO!W&Xq~Oo0cOv0qOz-pO!W&Xq~P'vOs-sO!T%dO!U%cOg&Oq!W&Oq![&Oqz&Oq~P!/jOa+QOo0cOv0qO![&Ty~P'vOz$ji![$ji~P%SOa+QOo0cOv0qO~P'vOV+UOo0cOv0qO~P'vOV+UOo0cOv0qO{&lq![&lq!m&lq%z&lq~P'vO{(kO![-xO!m-yO%z-wO~OV&OOo0cOv0qO#g%hq%[%hq%_%hq%z%hq~P'vO%uWO#g&ry%[&ry%_&ryg&ry~OV)`Oa)`O%uWO!W&ui~Ot-}OP#m!RV#m!Rf#m!Rh#m!Ro#m!Rs#m!Rv#m!R!P#m!R!Q#m!R!T#m!R!U#m!R!X#m!R!]#m!R!h#m!R!r#m!R!s#m!R!t#m!R!{#m!R!}#m!R#P#m!R#R#m!R#T#m!R#X#m!R#Z#m!R#^#m!R#_#m!R#a#m!R#c#m!R#l#m!R#o#m!R#s#m!R#u#m!R#z#m!R#}#m!R$P#m!R%X#m!R%o#m!R%p#m!R%t#m!R%u#m!R&Z#m!R&[#m!R&]#m!R&^#m!R&_#m!R&`#m!R&a#m!R&b#m!R&c#m!R&d#m!R&e#m!R&f#m!R&g#m!R&h#m!R&i#m!R&j#m!R%Z#m!R%_#m!R~Oo0cOv0qO{&xy~P'vOV*SOa*TO%q*UO%uWOg&yi~O$S-lO%Z.VO%_.VO~OV.aOh._O!X.^O!].`O!h.YO!s.[O!t.[O%p.XO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O~Oo0cOv0qOz$lq!W$lq~P'vO{.fOz$lq!W$lq~Oo0cOv0qO{*gO!W&Xy~P'vOz.gO!W&Xy~Oo0cOv.kO~P'vOs-sO!T%dO!U%cOg&Oy!W&Oy![&Oyz&Oy~P!/jO{(kO![.nO~O{(kO![.nO!m.oO~OV*SOa*TO%q*UO%uWO~Oh.tO!f.rOz$TX#[$TX%j$TXg$TX~Os$TX{$TX!W$TX![$TX~P$-bO%o.vO%p.vOs$UXz$UX{$UX#[$UX%j$UX!W$UXg$UX![$UX~O!h.xO~Oz.|O#[/OO%j.yOs&|X{&|X!W&|Xg&|X~Oa/RO~P$)zOh.tOs&}Xz&}X{&}X#[&}X%j&}X!W&}Xg&}X![&}X~Os/VO{$jO~Oo0cOv0qOz$ly!W$ly~P'vOo0cOv0qO{*gO!W&X!R~P'vOz/ZO!W&X!R~Og&RXs&RX!T&RX!U&RX!W&RX![&RXz&RX~P!/jOs-sO!T%dO!U%cOg&Qa!W&Qa![&Qaz&Qa~O{(kO![/^O~O!f.rOh$[as$[az$[a{$[a#[$[a%j$[a!W$[ag$[a![$[a~O!h/eO~O%o.vO%p.vOs$Uaz$Ua{$Ua#[$Ua%j$Ua!W$Uag$Ua![$Ua~O%j.yOs$Yaz$Ya{$Ya#[$Ya!W$Yag$Ya![$Ya~Os&|a{&|a!W&|ag&|a~P$)nOz/jOs&|a{&|a!W&|ag&|a~O!W/mO~Og/mO~O{/oO~O![/pO~Oo0cOv0qO{*gO!W&X!Z~P'vO{/sO~O%z/tO~P$-bOz/uO#[/OO%j.yOg'PX~Oz/uOg'PX~Og/wO~O!h/xO~O#[/OOs%Saz%Sa{%Sa%j%Sa!W%Sag%Sa![%Sa~O#[/OO%j.yOs%Waz%Wa{%Wa!W%Wag%Wa~Os&|i{&|i!W&|ig&|i~P$)nOz/zO#[/OO%j.yO!['Oa~Og'Pa~P$)nOz0SOg'Pa~Oa0UO!['Oi~P$)zOz0WO!['Oi~Oz0WO#[/OO%j.yO!['Oi~O#[/OO%j.yOg$biz$bi~O%z0ZO~P$-bO#[/OO%j.yOg%Vaz%Va~Og'Pi~P$)nO{0^O~Oa0UO!['Oq~P$)zOz0`O!['Oq~O#[/OO%j.yOz%Ui![%Ui~Oa0UO~P$)zOa0UO!['Oy~P$)zO#[/OO%j.yOg$ciz$ci~O#[/OO%j.yOz%Uq![%Uq~Oz+aO#g%ha%[%ha%_%ha%z%ha~P%SOV&OOo0cOv0qO~P'vOn0hO~Oo0hO~P'vO{0iO~Ot0jO~P!/jO&]&Z&j&h&i&g&f&d&e&c&b&`&a&_&^&[%u~",goto:"!=j'QPPPPPP'RP'Z*s+[+t,_,y-fP.SP'Z.r.r'ZPPP'Z2[PPPPPP2[5PPP5PP7b7k=sPP=v>h>kPP'Z'ZPP>zPP'Z'ZPP'Z'Z'Z'Z'Z?O?w'ZP?zP@QDXGuGyPG|HWH['ZPPPH_Hk'RP'R'RP'RP'RP'RP'RP'R'R'RP'RPP'RPP'RP'RPHqH}IVPI^IdPI^PI^I^PPPI^PKrPK{LVL]KrPI^LfPI^PLmLsPLwM]MzNeLwLwNkNxLwLwLwLw! ^! d! g! l! o! y!!P!!]!!o!!u!#P!#V!#s!#y!$P!$Z!$a!$g!$y!%T!%Z!%a!%k!%q!%w!%}!&T!&Z!&e!&k!&u!&{!'U!'[!'k!'s!'}!(UPPPPPPPPPPP!([!(_!(e!(n!(x!)TPPPPPPPPPPPP!-u!/Z!3^!6oPP!6w!7W!7a!8Y!8P!8c!8i!8l!8o!8r!8z!9jPPPPPPPPPPPPPPPPP!9m!9q!9wP!:]!:a!:m!:v!;S!;j!;m!;p!;v!;|!_![!]Do!]!^Es!^!_FZ!_!`Gk!`!aHX!a!b%T!b!cIf!c!dJU!d!eK^!e!hJU!h!i!#f!i!tJU!t!u!,|!u!wJU!w!x!.t!x!}JU!}#O!0S#O#P&o#P#Q!0j#Q#R!1Q#R#SJU#S#T%T#T#UJU#U#VK^#V#YJU#Y#Z!#f#Z#fJU#f#g!,|#g#iJU#i#j!.t#j#oJU#o#p!1n#p#q!1s#q#r!2a#r#s!2f#s$g%T$g;'SJU;'S;=`KW<%lOJU`%YT&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T`%lP;=`<%l%To%v]&n`%c_OX%TXY%oY[%T[]%o]p%Tpq%oq#O%T#O#P&o#P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To&tX&n`OY%TYZ%oZ]%T]^%o^#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc'f[&n`O!_%T!_!`([!`#T%T#T#U(r#U#f%T#f#g(r#g#h(r#h#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(cTmR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(yT!mR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk)aV&n`&[ZOr%Trs)vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk){V&n`Or%Trs*bs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk*iT&n`&^ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To+PZS_&n`OY*xYZ%TZ]*x]^%T^#o*x#o#p+r#p#q*x#q#r+r#r;'S*x;'S;=`,^<%lO*x_+wTS_OY+rZ]+r^;'S+r;'S;=`,W<%lO+r_,ZP;=`<%l+ro,aP;=`<%l*xj,kV%rQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-XT!xY&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-oV%lQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.]V&n`&ZZOw%Twx.rx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.wV&n`Ow%Twx/^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/eT&n`&]ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/{ThZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc0cTgR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk0yXVZ&n`Oz%Tz{1f{!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk1mVaR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk2ZV%oZ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc2wTzR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To3_W%pZ&n`O!_%T!_!`-Q!`!a3w!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Td4OT&{S&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk4fX!fQ&n`O!O%T!O!P5R!P!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5WV&n`O!O%T!O!P5m!P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5tT!rZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti6[a!hX&n`O!Q%T!Q![6T![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S6T#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti7fZ&n`O{%T{|8X|}%T}!O8X!O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8^V&n`O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8z]!hX&n`O!Q%T!Q![8s![!l%T!l!m9s!m#R%T#R#S8s#S#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti9zT!hX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk:bX%qR&n`O!P%T!P!Q:}!Q!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj;UV%sQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti;ro!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!d%T!d!e?q!e!g%T!g!h7a!h!l%T!l!m9s!m!q%T!q!rA]!r!z%T!z!{Bq!{#R%T#R#S>_#S#U%T#U#V?q#V#X%T#X#Y7a#Y#^%T#^#_9s#_#c%T#c#dA]#d#l%T#l#mBq#m#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti=xV&n`O!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti>fc!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S>_#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti?vY&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti@mY!hX&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiAbX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBUX!hX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBv]&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiCv]!hX&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToDvV{_&n`O!_%T!_!`E]!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TcEdT%{R&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkEzT#gZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkFbXmR&n`O!^%T!^!_F}!_!`([!`!a([!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjGUV%mQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkGrV%zZ&n`O!_%T!_!`([!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkH`WmR&n`O!_%T!_!`([!`!aHx!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjIPV%nQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkIoV_Q#}P&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToJ_]&n`&YS%uZO!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoKZP;=`<%lJUoKge&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!tJU!t!uLx!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#gLx#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoMRa&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUkN_V&n`&`ZOr%TrsNts#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkNyV&n`Or%Trs! `s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! gT&n`&bZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! }V&n`&_ZOw%Twx!!dx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!!iV&n`Ow%Twx!#Ox#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!#VT&n`&aZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!#oe&n`&YS%uZOr%Trs!%Qsw%Twx!&px!Q%T!Q![JU![!c%T!c!tJU!t!u!(`!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#g!(`#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!%XV&n`&dZOr%Trs!%ns#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!%sV&n`Or%Trs!&Ys#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&aT&n`&fZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&wV&n`&cZOw%Twx!'^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!'cV&n`Ow%Twx!'xx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!(PT&n`&eZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!(ia&n`&YS%uZOr%Trs!)nsw%Twx!+^x!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!)uV&n`&hZOr%Trs!*[s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*aV&n`Or%Trs!*vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*}T&n`&jZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!+eV&n`&gZOw%Twx!+zx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,PV&n`Ow%Twx!,fx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,mT&n`&iZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!-Vi&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[k6t,v6t,y6t,S6t,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:e=>A6t[e]||-1}],tokenPrec:7668}),Ase=new Dq,d6e=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function sj(e){return(t,n,i)=>{if(i)return!1;let r=t.node.getChild("VariableName");return r&&n(r,e),!0}}const _6t={FunctionDefinition:sj("function"),ClassDefinition:sj("class"),ForStatement(e,t,n){if(n){for(let i=e.node.firstChild;i;i=i.nextSibling)if(i.name=="VariableName")t(i,"variable");else if(i.name=="in")break}},ImportStatement(e,t){var n,i;let{node:r}=e,s=((n=r.firstChild)===null||n===void 0?void 0:n.name)=="from";for(let o=r.getChild("import");o;o=o.nextSibling)o.name=="VariableName"&&((i=o.nextSibling)===null||i===void 0?void 0:i.name)!="as"&&t(o,s?"variable":"namespace")},AssignStatement(e,t){for(let n=e.node.firstChild;n;n=n.nextSibling)if(n.name=="VariableName")t(n,"variable");else if(n.name==":"||n.name=="AssignOp")break},ParamList(e,t){for(let n=null,i=e.node.firstChild;i;i=i.nextSibling)i.name=="VariableName"&&(!n||!/\*|AssignOp/.test(n.name))&&t(i,"variable"),n=i},CapturePattern:sj("variable"),AsPattern:sj("variable"),__proto__:null};function f6e(e,t){let n=Ase.get(t);if(n)return n;let i=[],r=!0;function s(o,l){let c=e.sliceString(o.from,o.to);i.push({label:c,type:l})}return t.cursor(Er.IncludeAnonymous).iterate(o=>{if(o.name){let l=_6t[o.name];if(l&&l(o,s,r)||!r&&d6e.has(o.name))return!1;r=!1}else if(o.to-o.from>8192){for(let l of f6e(e,o.node))i.push(l);return!1}}),Ase.set(t,i),i}const Tse=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,h6e=["String","FormatString","Comment","PropertyName"];function j6t(e){let t=Jr(e.state).resolveInner(e.pos,-1);if(h6e.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&Tse.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let i=[];for(let r=t;r;r=r.parent)d6e.has(r.name)&&(i=i.concat(f6e(e.state.doc,r)));return{options:i,from:n?t.from:e.pos,validFor:Tse}}const N6t=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(e=>({label:e,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(e=>({label:e,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(e=>({label:e,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(e=>({label:e,type:"function"}))),R6t=[Zs("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),Zs("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),Zs("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),Zs("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),Zs(`if \${}: +`);i=r<0?n:n.slice(0,r)}return t+i.length>this.to?i.slice(0,this.to-t):i}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(t,n,i=0){this.block=aP.create(t,i,this.lineStart+n,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(t,n,i=0){this.startContext(this.parser.getNodeType(t),n,i)}addNode(t,n,i){typeof t=="number"&&(t=new Bi(this.parser.nodeSet.types[t],m1,m1,(i??this.prevLineEnd())-n)),this.block.addChild(t,n-this.block.from)}addElement(t){this.block.addChild(t.toTree(this.parser.nodeSet),t.from-this.block.from)}addLeafElement(t,n){this.addNode(this.buffer.writeElements(d7(n.children,t.marks),-n.from).finish(n.type,n.to-n.from),n.from)}finishContext(){let t=this.stack.pop(),n=this.stack[this.stack.length-1];n.addChild(t.toTree(this.parser.nodeSet),t.from-n.from),this.block=n}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(t){return this.ranges.length>1?b$e(this.ranges,0,t.topNode,this.ranges[0].from,this.reusePlaceholders):t}finishLeaf(t){for(let i of t.parsers)if(i.finish(this,t))return;let n=d7(this.parser.parseInline(t.content,t.start),t.marks);this.addNode(this.buffer.writeElements(n,-t.start).finish(qt.Paragraph,t.content.length),t.start)}elt(t,n,i,r){return typeof t=="string"?ur(this.parser.getNodeType(t),n,i,r):new x$e(t,n)}get buffer(){return new v$e(this.parser.nodeSet)}}function b$e(e,t,n,i,r){let s=e[t].to,o=[],l=[],c=n.from+i;function u(d,f){for(;f?d>=s:d>s;){let h=e[t+1].from-s;i+=h,d+=h,t++,s=e[t].to}}for(let d=n.firstChild;d;d=d.nextSibling){u(d.from+i,!0);let f=d.from+i,h,m=r.get(d.tree);m?h=m:d.to+i>s?(h=b$e(e,t,d,i,r),u(d.to+i,!1)):h=d.toTree(),o.push(h),l.push(f-c)}return u(n.to+i,!1),new Bi(n.type,o,l,n.to+i-c,n.tree?n.tree.propValues:void 0)}class aL extends WM{constructor(t,n,i,r,s,o,l,c,u){super(),this.nodeSet=t,this.blockParsers=n,this.leafBlockParsers=i,this.blockNames=r,this.endLeafBlock=s,this.skipContextMarkup=o,this.inlineParsers=l,this.inlineNames=c,this.wrappers=u,this.nodeTypes=Object.create(null);for(let d of t.types)this.nodeTypes[d.name]=d.id}createParse(t,n,i){let r=new o3t(this,t,n,i);for(let s of this.wrappers)r=s(r,t,n,i);return r}configure(t){let n=u7(t);if(!n)return this;let{nodeSet:i,skipContextMarkup:r}=this,s=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),l=this.blockNames.slice(),c=this.inlineParsers.slice(),u=this.inlineNames.slice(),d=this.endLeafBlock.slice(),f=this.wrappers;if(Ak(n.defineNodes)){r=Object.assign({},r);let h=i.types.slice(),m;for(let g of n.defineNodes){let{name:b,block:v,composite:y,style:w}=typeof g=="string"?{name:g}:g;if(h.some(k=>k.name==b))continue;y&&(r[h.length]=(k,S,C)=>y(S,C,k.value));let x=h.length,O=y?["Block","BlockContext"]:v?x>=qt.ATXHeading1&&x<=qt.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;h.push(Za.define({id:x,name:b,props:O&&[[ui.group,O]]})),w&&(m||(m={}),Array.isArray(w)||w instanceof Xf?m[b]=w:Object.assign(m,w))}i=new fO(h),m&&(i=i.extend(bm(m)))}if(Ak(n.props)&&(i=i.extend(...n.props)),Ak(n.remove))for(let h of n.remove){let m=this.blockNames.indexOf(h),g=this.inlineNames.indexOf(h);m>-1&&(s[m]=o[m]=void 0),g>-1&&(c[g]=void 0)}if(Ak(n.parseBlock))for(let h of n.parseBlock){let m=l.indexOf(h.name);if(m>-1)s[m]=h.parse,o[m]=h.leaf;else{let g=h.before?sj(l,h.before):h.after?sj(l,h.after)+1:l.length-1;s.splice(g,0,h.parse),o.splice(g,0,h.leaf),l.splice(g,0,h.name)}h.endLeaf&&d.push(h.endLeaf)}if(Ak(n.parseInline))for(let h of n.parseInline){let m=u.indexOf(h.name);if(m>-1)c[m]=h.parse;else{let g=h.before?sj(u,h.before):h.after?sj(u,h.after)+1:u.length-1;c.splice(g,0,h.parse),u.splice(g,0,h.name)}}return n.wrap&&(f=f.concat(n.wrap)),new aL(i,s,o,l,d,r,c,u,f)}getNodeType(t){let n=this.nodeTypes[t];if(n==null)throw new RangeError(`Unknown node type '${t}'`);return n}parseInline(t,n){let i=new xW(this,t,n);e:for(let r=n;r=0){r=l;continue e}}r++}return i.resolveMarkers(0)}}function Ak(e){return e!=null&&e.length>0}function u7(e){if(!Array.isArray(e))return e;if(e.length==0)return null;let t=u7(e[0]);if(e.length==1)return t;let n=u7(e.slice(1));if(!n||!t)return t||n;let i=(o,l)=>(o||m1).concat(l||m1),r=t.wrap,s=n.wrap;return{props:i(t.props,n.props),defineNodes:i(t.defineNodes,n.defineNodes),parseBlock:i(t.parseBlock,n.parseBlock),parseInline:i(t.parseInline,n.parseInline),remove:i(t.remove,n.remove),wrap:r?s?(o,l,c,u)=>r(s(o,l,c,u),l,c,u):r:s}}function sj(e,t){let n=e.indexOf(t);if(n<0)throw new RangeError(`Position specified relative to unknown parser ${t}`);return n}let y$e=[Za.none];for(let e=1,t;t=qt[e];e++)y$e[e]=Za.define({id:e,name:t,props:e>=qt.Escape?[]:[[ui.group,e in o$e?["Block","BlockContext"]:["Block","LeafBlock"]]],top:t=="Document"});const m1=[];class v$e{constructor(t){this.nodeSet=t,this.content=[],this.nodes=[]}write(t,n,i,r=0){return this.content.push(t,n,i,4+r*4),this}writeElements(t,n=0){for(let i of t)i.writeTo(this,n);return this}finish(t,n){return Bi.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:t,length:n})}}let WC=class{constructor(t,n,i,r=m1){this.type=t,this.from=n,this.to=i,this.children=r}writeTo(t,n){let i=t.content.length;t.writeElements(this.children,n),t.content.push(this.type,this.from+n,this.to+n,t.content.length+4-i)}toTree(t){return new v$e(t).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class x$e{constructor(t,n){this.tree=t,this.from=n}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return m1}writeTo(t,n){t.nodes.push(this.tree),t.content.push(t.nodes.length-1,this.from+n,this.to+n,-1)}toTree(){return this.tree}}function ur(e,t,n,i){return new WC(e,t,n,i)}const w$e={resolve:"Emphasis",mark:"EmphasisMark"},O$e={resolve:"Emphasis",mark:"EmphasisMark"},Oy={},oP={};class fu{constructor(t,n,i,r){this.type=t,this.from=n,this.to=i,this.side=r}}const Gre="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let KC=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{KC=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}const w$={Escape(e,t,n){if(t!=92||n==e.end-1)return-1;let i=e.char(n+1);for(let r=0;r]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(i);if(r)return e.append(ur(qt.Autolink,n,n+1+r[0].length,[ur(qt.LinkMark,n,n+1),ur(qt.URL,n+1,n+r[0].length),ur(qt.LinkMark,n+r[0].length,n+1+r[0].length)]));let s=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(i);if(s)return e.append(ur(qt.Comment,n,n+1+s[0].length));let o=/^\?[^]*?\?>/.exec(i);if(o)return e.append(ur(qt.ProcessingInstruction,n,n+1+o[0].length));let l=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(i);return l?e.append(ur(qt.HTMLTag,n,n+1+l[0].length)):-1},Emphasis(e,t,n){if(t!=95&&t!=42)return-1;let i=n+1;for(;e.char(i)==t;)i++;let r=e.slice(n-1,n),s=e.slice(i,i+1),o=KC.test(r),l=KC.test(s),c=/\s|^$/.test(r),u=/\s|^$/.test(s),d=!u&&(!l||c||o),f=!c&&(!o||u||l),h=d&&(t==42||!f||o),m=f&&(t==42||!d||l);return e.append(new fu(t==95?w$e:O$e,n,i,(h?1:0)|(m?2:0)))},HardBreak(e,t,n){if(t==92&&e.char(n+1)==10)return e.append(ur(qt.HardBreak,n,n+2));if(t==32){let i=n+1;for(;e.char(i)==32;)i++;if(e.char(i)==10&&i>=n+2)return e.append(ur(qt.HardBreak,n,i+1))}return-1},Link(e,t,n){return t==91?e.append(new fu(Oy,n,n+1,1)):-1},Image(e,t,n){return t==33&&e.char(n+1)==91?e.append(new fu(oP,n,n+2,1)):-1},LinkEnd(e,t,n){if(t!=93)return-1;for(let i=e.parts.length-1;i>=0;i--){let r=e.parts[i];if(r instanceof fu&&(r.type==Oy||r.type==oP)){if(!r.side||e.skipSpace(r.to)==n&&!/[(\[]/.test(e.slice(n+1,n+2)))return e.parts[i]=null,-1;let s=e.takeContent(i),o=e.parts[i]=l3t(e,s,r.type==Oy?qt.Link:qt.Image,r.from,n+1);if(r.type==Oy)for(let l=0;lt?ur(qt.URL,t+n,s+n):s==e.length?null:!1}}function S$e(e,t,n){let i=e.charCodeAt(t);if(i!=39&&i!=34&&i!=40)return!1;let r=i==40?41:i;for(let s=t+1,o=!1;s=this.end?-1:this.text.charCodeAt(t-this.offset)}get end(){return this.offset+this.text.length}slice(t,n){return this.text.slice(t-this.offset,n-this.offset)}append(t){return this.parts.push(t),t.to}addDelimiter(t,n,i,r,s){return this.append(new fu(t,n,i,(r?1:0)|(s?2:0)))}get hasOpenLink(){for(let t=this.parts.length-1;t>=0;t--){let n=this.parts[t];if(n instanceof fu&&(n.type==Oy||n.type==oP))return!0}return!1}addElement(t){return this.append(t)}resolveMarkers(t){for(let i=t;i=t;c--){let b=this.parts[c];if(b instanceof fu&&b.side&1&&b.type==r.type&&!(s&&(r.side&1||b.side&2)&&(b.to-b.from+o)%3==0&&((b.to-b.from)%3||o%3))){l=b;break}}if(!l)continue;let u=r.type.resolve,d=[],f=l.from,h=r.to;if(s){let b=Math.min(2,l.to-l.from,o);f=l.to-b,h=r.from+b,u=b==1?"Emphasis":"StrongEmphasis"}l.type.mark&&d.push(this.elt(l.type.mark,f,l.to));for(let b=c+1;b=0;n--){let i=this.parts[n];if(i instanceof fu&&i.type==t&&i.side&1)return n}return null}takeContent(t){let n=this.resolveMarkers(t);return this.parts.length=t,n}getDelimiterAt(t){let n=this.parts[t];return n instanceof fu?n:null}skipSpace(t){return EE(this.text,t-this.offset)+this.offset}elt(t,n,i,r){return typeof t=="string"?ur(this.parser.getNodeType(t),n,i,r):new x$e(t,n)}}xW.linkStart=Oy;xW.imageStart=oP;function d7(e,t){if(!t.length)return e;if(!e.length)return t;let n=e.slice(),i=0;for(let r of t){for(;i(t?t-1:0))return!1;if(this.fragmentEnd<0){let s=this.fragment.to;for(;s>0&&this.input.read(s-1,s)!=` +`;)s--;this.fragmentEnd=s?s-1:0}let i=this.cursor;i||(i=this.cursor=this.fragment.tree.cursor(),i.firstChild());let r=t+this.fragment.offset;for(;i.to<=r;)if(!i.parent())return!1;for(;;){if(i.from>=r)return this.fragment.from<=n;if(!i.childAfter(r))return!1}}matches(t){let n=this.cursor.tree;return n&&n.prop(ui.contextHash)==t}takeNodes(t){let n=this.cursor,i=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),s=t.absoluteLineStart,o=s,l=t.block.children.length,c=o,u=l;for(;;){if(n.to-i>r){if(n.type.isAnonymous&&n.firstChild())continue;break}let d=C$e(n.from-i,t.ranges);if(n.to-i<=t.ranges[t.rangeI].to)t.addNode(n.tree,d);else{let f=new Bi(t.parser.nodeSet.types[qt.Paragraph],[],[],0,t.block.hashProp);t.reusePlaceholders.set(f,n.tree),t.addNode(f,d)}if(n.type.is("Block")&&(c3t.indexOf(n.type.id)<0?(o=n.to-i,l=t.block.children.length):(o=c,l=u),c=n.to-i,u=t.block.children.length),!n.nextSibling())break}for(;t.block.children.length>l;)t.block.children.pop(),t.block.positions.pop();return o-s}}function C$e(e,t){let n=e;for(let i=1;irj[e]),Object.keys(rj).map(e=>g$e[e]),Object.keys(rj),s3t,o$e,Object.keys(w$).map(e=>w$[e]),Object.keys(w$),[]);function h3t(e,t,n){let i=[];for(let r=e.firstChild,s=t;;r=r.nextSibling){let o=r?r.from:n;if(o>s&&i.push({from:s,to:o}),!r)break;s=r.to}return i}function p3t(e){let{codeParser:t,htmlParser:n}=e;return{wrap:U5e((r,s)=>{let o=r.type.id;if(t&&(o==qt.CodeBlock||o==qt.FencedCode)){let l="";if(o==qt.FencedCode){let u=r.node.getChild(qt.CodeInfo);u&&(l=s.read(u.from,u.to))}let c=t(l);if(c)return{parser:c,overlay:u=>u.type.id==qt.CodeText,bracketed:o==qt.FencedCode}}else if(n&&(o==qt.HTMLBlock||o==qt.HTMLTag||o==qt.CommentBlock))return{parser:n,overlay:h3t(r.node,r.from,r.to)};return null})}}const m3t={resolve:"Strikethrough",mark:"StrikethroughMark"},g3t={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":fe.strikethrough}},{name:"StrikethroughMark",style:fe.processingInstruction}],parseInline:[{name:"Strikethrough",parse(e,t,n){if(t!=126||e.char(n+1)!=126||e.char(n+2)==126)return-1;let i=e.slice(n-1,n),r=e.slice(n+2,n+3),s=/\s|^$/.test(i),o=/\s|^$/.test(r),l=KC.test(i),c=KC.test(r);return e.addDelimiter(m3t,n,n+2,!o&&(!c||s||l),!s&&(!l||o||c))},after:"Emphasis"}]};function CE(e,t,n=0,i,r=0){let s=0,o=!0,l=-1,c=-1,u=!1,d=()=>{i.push(e.elt("TableCell",r+l,r+c,e.parser.parseInline(t.slice(l,c),r+l)))};for(let f=n;f-1)&&s++,o=!1,i&&(l>-1&&d(),i.push(e.elt("TableDelimiter",f+r,f+r+1))),l=c=-1):(u||h!=32&&h!=9)&&(l<0&&(l=f),c=f+1),u=!u&&h==92}return l>-1&&(s++,i&&d()),s}function Xre(e,t){for(let n=t;n\s]*\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class Yre{constructor(){this.rows=null}nextLine(t,n,i){if(this.rows==null){this.rows=!1;let r;if((n.next==45||n.next==58||n.next==124)&&A$e.test(r=n.text.slice(n.pos))){let s=[];CE(t,i.content,0,s,i.start)==CE(t,r,0)&&(this.rows=[t.elt("TableHeader",i.start,i.start+i.content.length,s),t.elt("TableDelimiter",t.lineStart+n.pos,t.lineStart+n.text.length)])}}else if(this.rows){let r=[];CE(t,n.text,n.pos,r,t.lineStart),this.rows.push(t.elt("TableRow",t.lineStart+n.pos,t.lineStart+n.text.length,r))}return!1}finish(t,n){return this.rows?(t.addLeafElement(n,t.elt("Table",n.start,n.start+n.content.length,this.rows)),!0):!1}}const b3t={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":fe.heading}},"TableRow",{name:"TableCell",style:fe.content},{name:"TableDelimiter",style:fe.processingInstruction}],parseBlock:[{name:"Table",leaf(e,t){return Xre(t.content,0)?new Yre:null},endLeaf(e,t,n){if(n.parsers.some(r=>r instanceof Yre)||!Xre(t.text,t.basePos))return!1;let i=e.peekLine();return A$e.test(i)&&CE(e,t.text,t.basePos)==CE(e,i,t.basePos)},before:"SetextHeading"}]};class y3t{nextLine(){return!1}finish(t,n){return t.addLeafElement(n,t.elt("Task",n.start,n.start+n.content.length,[t.elt("TaskMarker",n.start,n.start+3),...t.parser.parseInline(n.content.slice(3),n.start+3)])),!0}}const v3t={defineNodes:[{name:"Task",block:!0,style:fe.list},{name:"TaskMarker",style:fe.atom}],parseBlock:[{name:"TaskList",leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name=="ListItem"?new y3t:null},after:"SetextHeading"}]},Zre=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,Jre=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,x3t=/[\w-]+\.[\w-]+($|[/:])/,ese=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,tse=/\/[a-zA-Z\d@.]+/gy;function nse(e,t,n,i){let r=0;for(let s=t;s-1)return-1;let i=t+n[0].length;for(;;){let r=e[i-1],s;if(/[?!.,:*_~]/.test(r)||r==")"&&nse(e,t,i,")")>nse(e,t,i,"("))i--;else if(r==";"&&(s=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,i))))i=t+s.index;else break}return i}function ise(e,t){ese.lastIndex=t;let n=ese.exec(e);if(!n)return-1;let i=n[0][n[0].length-1];return i=="_"||i=="-"?-1:t+n[0].length-(i=="."?1:0)}const O3t={parseInline:[{name:"Autolink",parse(e,t,n){let i=n-e.offset;if(i&&/\w/.test(e.text[i-1]))return-1;Zre.lastIndex=i;let r=Zre.exec(e.text),s=-1;if(!r)return-1;if(r[1]||r[2]){if(s=w3t(e.text,i+r[0].length),s>-1&&e.hasOpenLink){let o=/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(i,s));s=i+o[0].length}}else r[3]?s=ise(e.text,i):(s=ise(e.text,i+r[0].length),s>-1&&r[0]=="xmpp:"&&(tse.lastIndex=s,r=tse.exec(e.text),r&&(s=r.index+r[0].length)));return s<0?-1:(e.addElement(e.elt("URL",n,s+e.offset)),s+e.offset)}}]},k3t=[b3t,v3t,g3t,O3t];function T$e(e,t,n){return(i,r,s)=>{if(r!=e||i.char(s+1)==e)return-1;let o=[i.elt(n,s,s+1)];for(let l=s+1;l=65&&e<=90||e==95||e>=97&&e<=122||e>=161}let ose=null,lse=null,cse=0;function h7(e,t){let n=e.pos+t;if(cse==n&&lse==e)return ose;let i=e.peek(t),r="";for(;X3t(i);)r+=String.fromCharCode(i),i=e.peek(++t);return lse=e,cse=n,ose=r?r.toLowerCase():i==Y3t||i==Z3t?void 0:null}const M$e=60,lP=62,OW=47,Y3t=63,Z3t=33,J3t=45;function use(e,t){this.name=e,this.parent=t}const e4t=[wW,R$e,_$e,j$e,N$e],t4t=new rL({start:null,shift(e,t,n,i){return e4t.indexOf(t)>-1?new use(h7(i,1)||"",e):e},reduce(e,t){return t==I$e&&e?e.parent:e},reuse(e,t,n,i){let r=t.type.id;return r==wW||r==V3t?new use(h7(i,1)||"",e):e},strict:!1}),n4t=new Ia((e,t)=>{if(e.next!=M$e){e.next<0&&t.context&&e.acceptToken(O$);return}e.advance();let n=e.next==OW;n&&e.advance();let i=h7(e,0);if(i===void 0)return;if(!i)return e.acceptToken(n?$3t:L3t);let r=t.context?t.context.name:null;if(n){if(i==r)return e.acceptToken(P3t);if(r&&G3t[r])return e.acceptToken(O$,-2);if(t.dialectEnabled(q3t))return e.acceptToken(D3t);for(let s=t.context;s;s=s.parent)if(s.name==i)return;e.acceptToken(M3t)}else{if(i=="script")return e.acceptToken(_$e);if(i=="style")return e.acceptToken(j$e);if(i=="textarea")return e.acceptToken(N$e);if(K3t.hasOwnProperty(i))return e.acceptToken(R$e);r&&ase[r]&&ase[r][i]?e.acceptToken(O$,-1):e.acceptToken(wW)}},{contextual:!0}),i4t=new Ia(e=>{for(let t=0,n=0;;n++){if(e.next<0){n&&e.acceptToken(sse);break}if(e.next==J3t)t++;else if(e.next==lP&&t>=2){n>=3&&e.acceptToken(sse,-2);break}else t=0;e.advance()}});function r4t(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const s4t=new Ia((e,t)=>{if(e.next==OW&&e.peek(1)==lP){let n=t.dialectEnabled(W3t)||r4t(t.context);e.acceptToken(n?I3t:rse,2)}else e.next==lP&&e.acceptToken(rse,1)});function kW(e,t,n){let i=2+e.length;return new Ia(r=>{for(let s=0,o=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(t);break}if(s==0&&r.next==M$e||s==1&&r.next==OW||s>=2&&so?r.acceptToken(t,-o):r.acceptToken(n,-(o-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(t,1);break}else s=o=0;r.advance()}})}const a4t=kW("script",A3t,T3t),o4t=kW("style",_3t,j3t),l4t=kW("textarea",N3t,R3t),c4t=bm({"Text RawText IncompleteTag IncompleteCloseTag":fe.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":fe.angleBracket,TagName:fe.tagName,"MismatchedCloseTag/TagName":[fe.tagName,fe.invalid],AttributeName:fe.attributeName,"AttributeValue UnquotedAttributeValue":fe.attributeValue,Is:fe.definitionOperator,"EntityReference CharacterReference":fe.character,Comment:fe.blockComment,ProcessingInst:fe.processingInstruction,DoctypeDecl:fe.documentMeta}),u4t=sm.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:",c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:t4t,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[c4t],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let u=l.type.id;if(u==U3t)return k$(l,c,n);if(u==Q3t)return k$(l,c,i);if(u==z3t)return k$(l,c,r);if(u==I$e&&s.length){let d=l.node,f=d.firstChild,h=f&&dse(f,c),m;if(h){for(let g of s)if(g.tag==h&&(!g.attrs||g.attrs(m||(m=L$e(f,c))))){let b=d.lastChild,v=b.type.id==H3t?b.from:d.to;if(v>f.to)return{parser:g.parser,overlay:[{from:f.to,to:v}]}}}}if(o&&u==P$e){let d=l.node,f;if(f=d.firstChild){let h=o[c.read(f.from,f.to)];if(h)for(let m of h){if(m.tagName&&m.tagName!=dse(d.parent,c))continue;let g=d.lastChild;if(g.type.id==f7){let b=g.from+1,v=g.lastChild,y=g.to-(v&&v.isError?0:1);if(y>b)return{parser:m.parser,overlay:[{from:b,to:y}],bracketed:!0}}else if(g.type.id==D$e)return{parser:m.parser,overlay:[{from:g.from,to:g.to}]}}}}return null})}const d4t=145,fse=1,f4t=146,h4t=147,F$e=2,p4t=148,m4t=3,g4t=4,B$e=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],b4t=58,y4t=40,U$e=95,v4t=91,HN=45,x4t=46,w4t=35,O4t=37,k4t=38,S4t=92,E4t=10,C4t=42;function GC(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function SW(e){return e>=48&&e<=57}function hse(e){return SW(e)||e>=97&&e<=102||e>=65&&e<=70}const Q$e=(e,t,n)=>(i,r)=>{for(let s=!1,o=0,l=0;;l++){let{next:c}=i;if(GC(c)||c==HN||c==U$e||s&&SW(c))!s&&(c!=HN||l>0)&&(s=!0),o===l&&c==HN&&o++,i.advance();else if(c==S4t&&i.peek(1)!=E4t){if(i.advance(),hse(i.next)){do i.advance();while(hse(i.next));i.next==32&&i.advance()}else i.next>-1&&i.advance();s=!0}else{s&&i.acceptToken(o==2&&r.canShift(F$e)?t:c==y4t?n:e);break}}},A4t=new Ia(Q$e(f4t,F$e,h4t),{contextual:!0}),T4t=new Ia(Q$e(p4t,m4t,g4t),{contextual:!0}),_4t=new Ia(e=>{if(B$e.includes(e.peek(-1))){let{next:t}=e;(GC(t)||t==U$e||t==w4t||t==x4t||t==C4t||t==v4t||t==b4t&&GC(e.peek(1))||t==HN||t==k4t)&&e.acceptToken(d4t)}}),j4t=new Ia(e=>{if(!B$e.includes(e.peek(-1))){let{next:t}=e;if(t==O4t&&(e.advance(),e.acceptToken(fse)),GC(t)){do e.advance();while(GC(e.next)||SW(e.next));e.acceptToken(fse)}}}),N4t=bm({"AtKeyword import charset namespace keyframes media supports font-feature-values":fe.definitionKeyword,"from to selector scope MatchFlag":fe.keyword,NamespaceName:fe.namespace,KeyframeName:fe.labelName,KeyframeRangeName:fe.operatorKeyword,TagName:fe.tagName,ClassName:fe.className,PseudoClassName:fe.constant(fe.className),IdName:fe.labelName,"FeatureName PropertyName":fe.propertyName,AttributeName:fe.attributeName,NumberLiteral:fe.number,KeywordQuery:fe.keyword,UnaryQueryOp:fe.operatorKeyword,"CallTag ValueName FontName":fe.atom,VariableName:fe.variableName,Callee:fe.operatorKeyword,Unit:fe.unit,"UniversalSelector NestingSelector":fe.definitionOperator,"MatchOp CompareOp":fe.compareOperator,"ChildOp SiblingOp, LogicOp":fe.logicOperator,BinOp:fe.arithmeticOperator,Important:fe.modifier,Comment:fe.blockComment,ColorLiteral:fe.color,"ParenthesizedContent StringLiteral":fe.string,":":fe.punctuation,"PseudoOp #":fe.derefOperator,"; , |":fe.separator,"( )":fe.paren,"[ ]":fe.squareBracket,"{ }":fe.brace}),R4t={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:152,"url-prefix":152,domain:152,regexp:152},I4t={__proto__:null,or:104,and:104,not:112,only:112,layer:206},P4t={__proto__:null,selector:118,style:124,layer:202},D4t={__proto__:null,"@import":198,"@media":210,"@charset":214,"@namespace":218,"@keyframes":224,"@supports":236,"@scope":240,"@font-feature-values":246},M4t={__proto__:null,to:243},L4t=sm.deserialize({version:14,states:"MlQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FnO&XQdO'#CkO&xQaO'#CcO'SQdO'#CnO'_QdO'#EOO'dQdO'#EQO'oQdO'#EXO'oQdO'#E[OOQP'#Fn'#FnO)RQhO'#E}OOQS'#Fm'#FmOOQS'#FQ'#FQQYQdOOO)YQdO'#EbO*iQhO'#EhO)YQdO'#EjO*pQdO'#ElO*{QdO'#EoO)}QhO'#EuO+TQdO'#EwO+`QdO'#EzO+eQaO'#CfO+lQ`O'#E_O+qQ`O'#F{O+|QdO'#F{QOQ`OOP,WO&jO'#CaPOOO)CA])CA]OOQP'#Ci'#CiOOQP,59R,59RO%VQdO,59ROOQP'#Cm'#CmOOQP,59V,59VO&XQdO,59VO,cQdO,59YO'_QdO,5:jO'dQdO,5:lO'oQdO,5:sO'oQdO,5:uO'oQdO,5:vO'oQdO'#FXO,nQ`O,58}O,vQdO'#E^OOQS,58},58}OOQP'#Cq'#CqOOQO'#D|'#D|OOQP,59Y,59YO,}Q`O,59YO-SQ`O,59YOOQP'#EP'#EPOOQP,5:j,5:jO-XQpO'#ERO-dQdO'#ESO-iQ`O'#ESO-nQpO,5:lO.XQaO,5:sO.oQaO,5:vOOQW'#D^'#D^O/nQhO'#DgO0RQhO,5;iO)}QhO'#DeO0`Q`O'#DnO0eQhO'#DxOOQW'#Ft'#FtOOQS,5;i,5;iO0jQ`O'#DhO0oQ`O'#DkOOQS-E9O-E9OOOQ['#Cv'#CvO0tQdO'#CwO1[QdO'#C}O1rQdO'#DQO2YQ!pO'#DSO4fQ!jO,5:|OOQO'#DX'#DXO-SQ`O'#DWO4vQ!nO'#FqO6|Q`O'#DYO7RQ`O'#DyOOQ['#Fq'#FqO7WQhO'#GOO7fQ`O,5;SO7kQ!bO,5;UOOQS'#En'#EnO7sQ`O,5;WO7xQdO,5;WOOQO'#Eq'#EqO8QQ`O,5;ZO8VQhO,5;aO'oQdO'#DjOOQS,5;c,5;cO0jQ`O,5;cO8_QdO,5;cOOQS'#F`'#F`O8gQdO'#E|O7fQ`O,5;fO8oQdO,5:yO9PQdO'#FZO9^Q`O,5lQhO'#DoOOQW,5:Y,5:YOOQW,5:d,5:dOOQW,5:S,5:SO>vQhO,5:VO?bQ!fO'#FrOOQS'#Fr'#FrOOQS'#FS'#FSO@rQdO,59cOOQ[,59c,59cOAYQdO,59iOOQ[,59i,59iOApQdO,59lOOQ[,59l,59lOOQ[,59n,59nO)YQdO,59pOBWQhO'#EdOOQW'#Ed'#EdOBuQ`O1G0hO4oQhO1G0hOOQ[,59r,59rO)}QhO'#D[OOQ[,59t,59tOBzQ#tO,5:eOCVQhO'#F]OCdQ`O,5vQhO'#DmOI_QhO'#DqOIgQhO'#DsOIlQhO'#FwOOQO'#Fw'#FwOItQ!bO'#DwOOQO'#Fy'#FyOOQO'#Fv'#FvOIyQ`O1G/qOOQS-E9Q-E9QOOQ[1G.}1G.}OOQ[1G/T1G/TOOQ[1G/W1G/WOOQ[1G/[1G/[OJOQdO,5;OOOQS7+&S7+&SOJTQ`O7+&SOJYQhO'#D]OJbQ`O,59vO)}QhO,59vOOQ[1G0P1G0POJjQ`O1G0POJoQhO,5;wOOQO-E9Z-E9ZOOQS7+&^7+&^OJ}QbO'#DSOOQO'#Et'#EtOK]Q`O'#EsOOQO'#Es'#EsOKhQ`O'#F^OKpQdO,5;^OOQS,5;^,5;^OOQ[1G/p1G/pOOQS7+&i7+&iO7fQ`O7+&iOK{Q!fO'#FYO)YQdO'#FYOMSQdO7+&POOQO7+&P7+&POOQO,5:{,5:{OOQO1G1a1G1aOMgQ!bO<vQhO'#DrOOQO,5:],5:]O! hQhO,5:_OGUQhO,5:cOOQW7+%]7+%]OOQO'#Ef'#EfO! pQ`O1G0jOOQS<xAN>xO!#zQ`OAN>xO!$PQaO,5;rOOQO-E9U-E9UO!$ZQdO,5;qOOQO-E9T-E9TOOQW<vQhO'#DuOOQO1G/y1G/yO!%vQ!bO1G/}OJOQdO'#F[O!&OQ`O7+&UOOQW7+&U7+&UO!&WQ!bO1G/cOOQ[7+$|7+$|O!&cQhO7+$|P!&jQ`O'#FTOOQO,5;y,5;yOOQO-E9]-E9]OOQS1G1d1G1dOOQPG24dG24dO!&oQ`OAN>ZO)YQdO1G1[O!&tQ`O7+'jOOQO1G/x1G/xO!&|Q`O,5:aO!$eQhO7+%iOOQO,5;v,5;vOOQO-E9Y-E9YOOQW<Q!]!^>|!^!_?_!_!`@Z!`!a@n!a!b%Z!b!cAo!c!k%Z!k!lC|!l!u%Z!u!vC|!v!}%Z!}#OD_#O#P%Z#P#QDp#Q#R2X#R#]%Z#]#^ER#^#g%Z#g#hC|#h#o%Z#o#pIf#p#qIw#q#rJ`#r#sJq#s#y%Z#y#z&R#z$f%Z$f$g&R$g#BY%Z#BY#BZ&R#BZ$IS%Z$IS$I_&R$I_$I|%Z$I|$JO&R$JO$JT%Z$JT$JU&R$JU$KV%Z$KV$KW&R$KW&FU%Z&FU&FV&R&FV;'S%Z;'S;=`KY<%lO%Z`%^SOy%jz;'S%j;'S;=`%{<%lO%j`%oS!o`Oy%jz;'S%j;'S;=`%{<%lO%j`&OP;=`<%l%j~&Wh$[~OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%j~'yh$[~!o`OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%jj)jS$qYOy%jz;'S%j;'S;=`%{<%lO%j~)yWOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d<%lO)v~*hOw~~*kRO;'S)v;'S;=`*t;=`O)v~*wXOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d;=`<%l)v<%lO)v~+gP;=`<%l)vj+oYmYOy%jz!Q%j!Q![,_![!c%j!c!i,_!i#T%j#T#Z,_#Z;'S%j;'S;=`%{<%lO%jj,dY!o`Oy%jz!Q%j!Q![-S![!c%j!c!i-S!i#T%j#T#Z-S#Z;'S%j;'S;=`%{<%lO%jj-XY!o`Oy%jz!Q%j!Q![-w![!c%j!c!i-w!i#T%j#T#Z-w#Z;'S%j;'S;=`%{<%lO%jj.OYuY!o`Oy%jz!Q%j!Q![.n![!c%j!c!i.n!i#T%j#T#Z.n#Z;'S%j;'S;=`%{<%lO%jj.uYuY!o`Oy%jz!Q%j!Q![/e![!c%j!c!i/e!i#T%j#T#Z/e#Z;'S%j;'S;=`%{<%lO%jj/jY!o`Oy%jz!Q%j!Q![0Y![!c%j!c!i0Y!i#T%j#T#Z0Y#Z;'S%j;'S;=`%{<%lO%jj0aYuY!o`Oy%jz!Q%j!Q![1P![!c%j!c!i1P!i#T%j#T#Z1P#Z;'S%j;'S;=`%{<%lO%jj1UY!o`Oy%jz!Q%j!Q![1t![!c%j!c!i1t!i#T%j#T#Z1t#Z;'S%j;'S;=`%{<%lO%jj1{SuY!o`Oy%jz;'S%j;'S;=`%{<%lO%jd2[UOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jd2uS!yS!o`Oy%jz;'S%j;'S;=`%{<%lO%jb3WS^QOy%jz;'S%j;'S;=`%{<%lO%j~3gWOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{<%lO3d~4SRO;'S3d;'S;=`4];=`O3d~4`XOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{;=`<%l3d<%lO3d~5OP;=`<%l3dj5WShYOy%jz;'S%j;'S;=`%{<%lO%j~5iOg~n5pUWQyWOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jj6ZWyW#PQOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj6xU!o`Oy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%jj7cY!o`$gYOy%jz!Q%j!Q![7[![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj8WY!o`Oy%jz{%j{|8v|}%j}!O8v!O!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj8{U!o`Oy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj9fU!o`$gYOy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj:P[!o`$gYOy%jz!O%j!O!P7[!P!Q%j!Q![9x![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj:zS!dYOy%jz;'S%j;'S;=`%{<%lO%jj;]WyWOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj;zU`YOy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%j~VUcYOy%jz![%j![!]>i!];'S%j;'S;=`%{<%lO%jj>pSdY!o`Oy%jz;'S%j;'S;=`%{<%lO%jj?RSnYOy%jz;'S%j;'S;=`%{<%lO%jh?dU!WWOy%jz!_%j!_!`?v!`;'S%j;'S;=`%{<%lO%jh?}S!WW!o`Oy%jz;'S%j;'S;=`%{<%lO%jl@bS!WW!ySOy%jz;'S%j;'S;=`%{<%lO%jj@uV!|Q!WWOy%jz!_%j!_!`?v!`!aA[!a;'S%j;'S;=`%{<%lO%jbAcS!|Q!o`Oy%jz;'S%j;'S;=`%{<%lO%jjArYOy%jz}%j}!OBb!O!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjBgW!o`Oy%jz!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjCW[lY!o`Oy%jz}%j}!OCP!O!Q%j!Q![CP![!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jhDRS!zWOy%jz;'S%j;'S;=`%{<%lO%jjDdSpYOy%jz;'S%j;'S;=`%{<%lO%jnDuSo^Oy%jz;'S%j;'S;=`%{<%lO%jjEWU!zWOy%jz#a%j#a#bEj#b;'S%j;'S;=`%{<%lO%jbEoU!o`Oy%jz#d%j#d#eFR#e;'S%j;'S;=`%{<%lO%jbFWU!o`Oy%jz#c%j#c#dFj#d;'S%j;'S;=`%{<%lO%jbFoU!o`Oy%jz#f%j#f#gGR#g;'S%j;'S;=`%{<%lO%jbGWU!o`Oy%jz#h%j#h#iGj#i;'S%j;'S;=`%{<%lO%jbGoU!o`Oy%jz#T%j#T#UHR#U;'S%j;'S;=`%{<%lO%jbHWU!o`Oy%jz#b%j#b#cHj#c;'S%j;'S;=`%{<%lO%jbHoU!o`Oy%jz#h%j#h#iIR#i;'S%j;'S;=`%{<%lO%jbIYS$pQ!o`Oy%jz;'S%j;'S;=`%{<%lO%jjIkSsYOy%jz;'S%j;'S;=`%{<%lO%jfI|U$cUOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jjJeSrYOy%jz;'S%j;'S;=`%{<%lO%jfJvU#PQOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%j`K]P;=`<%l%Z",tokenizers:[_4t,j4t,A4t,T4t,1,2,3,4,new iP("m~RRYZ[z{a~~g~aO$_~~dP!P!Qg~lO$`~~",28,152)],topRules:{StyleSheet:[0,6],Styles:[1,126]},dynamicPrecedences:{94:1},specialized:[{term:147,get:e=>R4t[e]||-1},{term:148,get:e=>I4t[e]||-1},{term:4,get:e=>P4t[e]||-1},{term:28,get:e=>D4t[e]||-1},{term:146,get:e=>M4t[e]||-1}],tokenPrec:2405});let S$=null;function E$(){if(!S$&&typeof document=="object"&&document.body){let{style:e}=document.body,t=[],n=new Set;for(let i in e)i!="cssText"&&i!="cssFloat"&&typeof e[i]=="string"&&(/[A-Z]/.test(i)&&(i=i.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),n.has(i)||(t.push(i),n.add(i)));S$=t.sort().map(i=>({type:"property",label:i,apply:i+": "}))}return S$||[]}const pse=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(e=>({type:"class",label:e})),mse=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(e=>({type:"keyword",label:e})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(e=>({type:"constant",label:e}))),$4t=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(e=>({type:"type",label:e})),F4t=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(e=>({type:"keyword",label:e})),Yh=/^(\w[\w-]*|-\w[\w-]*|)$/,B4t=/^-(-[\w-]*)?$/;function U4t(e,t){var n;if((e.name=="("||e.type.isError)&&(e=e.parent||e),e.name!="ArgList")return!1;let i=(n=e.parent)===null||n===void 0?void 0:n.firstChild;return(i==null?void 0:i.name)!="Callee"?!1:t.sliceString(i.from,i.to)=="var"}const gse=new Dq,Q4t=["Declaration"];function z4t(e){for(let t=e;;){if(t.type.isTop)return t;if(!(t=t.parent))return e}}function z$e(e,t,n){if(t.to-t.from>4096){let i=gse.get(t);if(i)return i;let r=[],s=new Set,o=t.cursor(Sr.IncludeAnonymous);if(o.firstChild())do for(let l of z$e(e,o.node,n))s.has(l.label)||(s.add(l.label),r.push(l));while(o.nextSibling());return gse.set(t,r),r}else{let i=[],r=new Set;return t.cursor().iterate(s=>{var o;if(n(s)&&s.matchContext(Q4t)&&((o=s.node.nextSibling)===null||o===void 0?void 0:o.name)==":"){let l=e.sliceString(s.from,s.to);r.has(l)||(r.add(l),i.push({label:l,type:"variable"}))}}),i}}const V4t=e=>t=>{let{state:n,pos:i}=t,r=Yr(n).resolveInner(i,-1),s=r.type.isError&&r.from==r.to-1&&n.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:E$(),validFor:Yh};if(r.name=="ValueName")return{from:r.from,options:mse,validFor:Yh};if(r.name=="PseudoClassName")return{from:r.from,options:pse,validFor:Yh};if(e(r)||(t.explicit||s)&&U4t(r,n.doc))return{from:e(r)||s?r.from:i,options:z$e(n.doc,z4t(r),e),validFor:B4t};if(r.name=="TagName"){for(let{parent:c}=r;c;c=c.parent)if(c.name=="Block")return{from:r.from,options:E$(),validFor:Yh};return{from:r.from,options:$4t,validFor:Yh}}if(r.name=="AtKeyword")return{from:r.from,options:F4t,validFor:Yh};if(!t.explicit)return null;let o=r.resolve(i),l=o.childBefore(i);return l&&l.name==":"&&o.name=="PseudoClassSelector"?{from:i,options:pse,validFor:Yh}:l&&l.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:i,options:mse,validFor:Yh}:o.name=="Block"||o.name=="Styles"?{from:i,options:E$(),validFor:Yh}:null},H4t=V4t(e=>e.name=="VariableName"),cP=rm.define({name:"css",parser:L4t.configure({props:[ym.add({Declaration:ww()}),vm.add({"Block KeyframeList":jT})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function q4t(){return new bb(cP,cP.data.of({autocomplete:H4t}))}const Tk=["_blank","_self","_top","_parent"],C$=["ascii","utf-8","utf-16","latin1","latin1"],A$=["get","post","put","delete"],T$=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],iu=["true","false"],Pn={},W4t={a:{attrs:{href:null,ping:null,type:null,media:null,target:Tk,hreflang:null}},abbr:Pn,address:Pn,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Pn,aside:Pn,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Pn,base:{attrs:{href:null,target:Tk}},bdi:Pn,bdo:Pn,blockquote:{attrs:{cite:null}},body:Pn,br:Pn,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:T$,formmethod:A$,formnovalidate:["novalidate"],formtarget:Tk,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Pn,center:Pn,cite:Pn,code:Pn,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:Pn,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Pn,div:Pn,dl:Pn,dt:Pn,em:Pn,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Pn,figure:Pn,footer:Pn,form:{attrs:{action:null,name:null,"accept-charset":C$,autocomplete:["on","off"],enctype:T$,method:A$,novalidate:["novalidate"],target:Tk}},h1:Pn,h2:Pn,h3:Pn,h4:Pn,h5:Pn,h6:Pn,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Pn,hgroup:Pn,hr:Pn,html:{attrs:{manifest:null}},i:Pn,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:T$,formmethod:A$,formnovalidate:["novalidate"],formtarget:Tk,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:Pn,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Pn,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:Pn,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:C$,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Pn,noscript:Pn,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Pn,param:{attrs:{name:null,value:null}},pre:Pn,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Pn,rt:Pn,ruby:Pn,samp:Pn,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:C$}},section:Pn,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Pn,source:{attrs:{src:null,type:null,media:null}},span:Pn,strong:Pn,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Pn,summary:Pn,sup:Pn,table:Pn,tbody:Pn,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Pn,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:Pn,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Pn,time:{attrs:{datetime:null}},title:Pn,tr:Pn,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Pn,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:Pn},V$e={accesskey:null,class:null,contenteditable:iu,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:iu,autocorrect:iu,autocapitalize:iu,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":iu,"aria-autocomplete":["inline","list","both","none"],"aria-busy":iu,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":iu,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":iu,"aria-hidden":iu,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":iu,"aria-multiselectable":iu,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":iu,"aria-relevant":null,"aria-required":iu,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},H$e="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of H$e)V$e[e]=null;class XC{constructor(t,n){this.tags={...W4t,...t},this.globalAttrs={...V$e,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}XC.default=new XC;function g1(e,t,n=e.length){if(!t)return"";let i=t.firstChild,r=i&&i.getChild("TagName");return r?e.sliceString(r.from,Math.min(r.to,n)):""}function b1(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function q$e(e,t,n){let i=n.tags[g1(e,b1(t))];return(i==null?void 0:i.children)||n.allTags}function EW(e,t){let n=[];for(let i=b1(t);i&&!i.type.isTop;i=b1(i.parent)){let r=g1(e,i);if(r&&i.lastChild.name=="CloseTag")break;r&&n.indexOf(r)<0&&(t.name=="EndTag"||t.from>=i.firstChild.to)&&n.push(r)}return n}const W$e=/^[:\-\.\w\u00b7-\uffff]*$/;function bse(e,t,n,i,r){let s=/\s*>/.test(e.sliceDoc(r,r+5))?"":">",o=b1(n,n.name=="StartTag"||n.name=="TagName");return{from:i,to:r,options:q$e(e.doc,o,t).map(l=>({label:l,type:"type"})).concat(EW(e.doc,n).map((l,c)=>({label:"/"+l,apply:"/"+l+s,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function yse(e,t,n,i){let r=/\s*>/.test(e.sliceDoc(i,i+5))?"":">";return{from:n,to:i,options:EW(e.doc,t).map((s,o)=>({label:s,apply:s+r,type:"type",boost:99-o})),validFor:W$e}}function K4t(e,t,n,i){let r=[],s=0;for(let o of q$e(e.doc,n,t))r.push({label:"<"+o,type:"type"});for(let o of EW(e.doc,n))r.push({label:"",type:"type",boost:99-s++});return{from:i,to:i,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function G4t(e,t,n,i,r){let s=b1(n),o=s?t.tags[g1(e.doc,s)]:null,l=o&&o.attrs?Object.keys(o.attrs):[],c=o&&o.globalAttrs===!1?l:l.length?l.concat(t.globalAttrNames):t.globalAttrNames;return{from:i,to:r,options:c.map(u=>({label:u,type:"property"})),validFor:W$e}}function X4t(e,t,n,i,r){var s;let o=(s=n.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),l=[],c;if(o){let u=e.sliceDoc(o.from,o.to),d=t.globalAttrs[u];if(!d){let f=b1(n),h=f?t.tags[g1(e.doc,f)]:null;d=(h==null?void 0:h.attrs)&&h.attrs[u]}if(d){let f=e.sliceDoc(i,r).toLowerCase(),h='"',m='"';/^['"]/.test(f)?(c=f[0]=='"'?/^[^"]*$/:/^[^']*$/,h="",m=e.sliceDoc(r,r+1)==f[0]?"":f[0],f=f.slice(1),i++):c=/^[^\s<>='"]*$/;for(let g of d)l.push({label:g,apply:h+g+m,type:"constant"})}}return{from:i,to:r,options:l,validFor:c}}function K$e(e,t){let{state:n,pos:i}=t,r=Yr(n).resolveInner(i,-1),s=r.resolve(i);for(let o=i,l;s==r&&(l=r.childBefore(o));){let c=l.lastChild;if(!c||!c.type.isError||c.fromK$e(i,r)}const J4t=yh.parser.configure({top:"SingleExpression"}),G$e=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:n$e.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:i$e.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:r$e.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:J4t},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:yh.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:cP.parser}],X$e=[{name:"style",parser:cP.parser.configure({top:"Styles"})}].concat(H$e.map(e=>({name:e,parser:yh.parser}))),Y$e=rm.define({name:"html",parser:u4t.configure({props:[ym.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].lengthe.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),qN=Y$e.configure({wrap:$$e(G$e,X$e)});function e$t(e={}){let t="",n;e.matchClosingTags===!1&&(t="noMatch"),e.selfClosingTags===!0&&(t=(t?t+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(n=$$e((e.nestedLanguages||[]).concat(G$e),(e.nestedAttributes||[]).concat(X$e)));let i=n?Y$e.configure({wrap:n,dialect:t}):t?qN.configure({dialect:t}):qN;return new bb(i,[qN.data.of({autocomplete:Z4t(e)}),e.autoCloseTags!==!1?t$t:[],o7().support,q4t().support])}const vse=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),t$t=Jt.inputHandler.of((e,t,n,i,r)=>{if(e.composing||e.state.readOnly||t!=n||i!=">"&&i!="/"||!qN.isActiveAt(e.state,t,-1))return!1;let s=r(),{state:o}=s,l=o.changeByRange(c=>{var u,d,f;let h=o.doc.sliceString(c.from-1,c.to)==i,{head:m}=c,g=Yr(o).resolveInner(m,-1),b;if(h&&i==">"&&g.name=="EndTag"){let v=g.parent;if(((d=(u=v.parent)===null||u===void 0?void 0:u.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(b=g1(o.doc,v.parent,m))&&!vse.has(b)){let y=m+(o.doc.sliceString(m,m+1)===">"?1:0),w=``;return{range:c,changes:{from:m,to:y,insert:w}}}}else if(h&&i=="/"&&g.name=="IncompleteCloseTag"){let v=g.parent;if(g.from==m-2&&((f=v.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(b=g1(o.doc,v,m))&&!vse.has(b)){let y=m+(o.doc.sliceString(m,m+1)===">"?1:0),w=`${b}>`;return{range:ht.cursor(m+w.length,-1),changes:{from:m,to:y,insert:w}}}}return{range:c}});return l.changes.empty?!1:(e.dispatch([s,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Z$e=tL({commentTokens:{block:{open:""}}}),J$e=new ui,e6e=f3t.configure({props:[vm.add(e=>!e.is("Block")||e.is("Document")||p7(e)!=null||n$t(e)?void 0:(t,n)=>({from:n.doc.lineAt(t.from).to,to:t.to})),J$e.add(p7),ym.add({Document:()=>null}),wg.add({Document:Z$e})]});function p7(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function n$t(e){return e.name=="OrderedList"||e.name=="BulletList"}function i$t(e,t){let n=e;for(;;){let i=n.nextSibling,r;if(!i||(r=p7(i.type))!=null&&r<=t)break;n=i}return n.to}const r$t=v4e.of((e,t,n)=>{for(let i=Yr(e).resolveInner(n,-1);i&&!(i.fromn)return{from:n,to:s}}return null});function CW(e){return new Ou(Z$e,e,[],"markdown")}const s$t=CW(e6e),a$t=e6e.configure([k3t,E3t,S3t,C3t,{props:[vm.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),uP=CW(a$t);function o$t(e,t){return n=>{if(n&&e){let i=null;if(n=/\S*/.exec(n)[0],typeof e=="function"?i=e(n):i=ZI.matchLanguageName(e,n,!0),i instanceof ZI)return i.support?i.support.language.parser:k0.getSkippingParser(i.load());if(i)return i.parser}return t?t.parser:null}}let _$=class{constructor(t,n,i,r,s,o,l){this.node=t,this.from=n,this.to=i,this.spaceBefore=r,this.spaceAfter=s,this.type=o,this.item=l}blank(t,n=!0){let i=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(t!=null){for(;i.length0;r--)i+=" ";return i+(n?this.spaceAfter:"")}}marker(t,n){let i=this.node.name=="OrderedList"?String(+n6e(this.item,t)[2]+n):"";return this.spaceBefore+i+this.type+this.spaceAfter}};function t6e(e,t){let n=[],i=[];for(let r=e;r;r=r.parent){if(r.name=="FencedCode")return i;(r.name=="ListItem"||r.name=="Blockquote")&&n.push(r)}for(let r=n.length-1;r>=0;r--){let s=n[r],o,l=t.lineAt(s.from),c=s.from-l.from;if(s.name=="Blockquote"&&(o=/^ *>( ?)/.exec(l.text.slice(c))))i.push(new _$(s,c,c+o[0].length,"",o[1],">",null));else if(s.name=="ListItem"&&s.parent.name=="OrderedList"&&(o=/^( *)\d+([.)])( *)/.exec(l.text.slice(c)))){let u=o[3],d=o[0].length;u.length>=4&&(u=u.slice(0,u.length-4),d-=4),i.push(new _$(s.parent,c,c+d,o[1],u,o[2],s))}else if(s.name=="ListItem"&&s.parent.name=="BulletList"&&(o=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(l.text.slice(c)))){let u=o[4],d=o[0].length;u.length>4&&(u=u.slice(0,u.length-4),d-=4);let f=o[2];o[3]&&(f+=o[3].replace(/[xX]/," ")),i.push(new _$(s.parent,c,c+d,o[1],u,f,s))}}return i}function n6e(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function j$(e,t,n,i=0){for(let r=-1,s=e;;){if(s.name=="ListItem"){let l=n6e(s,t),c=+l[2];if(r>=0){if(c!=r+1)return;n.push({from:s.from+l[1].length,to:s.from+l[0].length,insert:String(r+2+i)})}r=c}let o=s.nextSibling;if(!o)break;s=o}}function AW(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(pO)!=" ")return e;let i=wf(e,4,n),r="";for(let s=i;s>0;)s>=4?(r+=" ",s-=4):(r+=" ",s--);return r+e.slice(n)}const l$t=(e={})=>({state:t,dispatch:n})=>{let i=Yr(t),{doc:r}=t,s=null,o=t.changeByRange(l=>{if(!l.empty||!uP.isActiveAt(t,l.from,-1)&&!uP.isActiveAt(t,l.from,1))return s={range:l};let c=l.from,u=r.lineAt(c),d=t6e(i.resolveInner(c,-1),r);for(;d.length&&d[d.length-1].from>c-u.from;)d.pop();if(!d.length)return s={range:l};let f=d[d.length-1];if(f.to-f.spaceAfter.length>c-u.from)return s={range:l};let h=c>=f.to-f.spaceAfter.length&&!/\S/.test(u.text.slice(f.to));if(f.item&&h){let y=f.node.firstChild,w=f.node.getChild("ListItem","ListItem");if(y.to>=c||w&&w.to0&&!/[^\s>]/.test(r.lineAt(u.from-1).text)||e.nonTightLists===!1){let x=d.length>1?d[d.length-2]:null,O,k="";x&&x.item?(O=u.from+x.from,k=x.marker(r,1)):O=u.from+(x?x.to:0);let S=[{from:O,to:c,insert:k}];return f.node.name=="OrderedList"&&j$(f.item,r,S,-2),x&&x.node.name=="OrderedList"&&j$(x.item,r,S),{range:ht.cursor(O+k.length),changes:S}}else{let x=wse(d,t,u);return{range:ht.cursor(c+x.length+1),changes:{from:u.from,insert:x+t.lineBreak}}}}if(f.node.name=="Blockquote"&&h&&u.from){let y=r.lineAt(u.from-1),w=/>\s*$/.exec(y.text);if(w&&w.index==f.from){let x=t.changes([{from:y.from+w.index,to:y.to},{from:u.from+f.from,to:u.to}]);return{range:l.map(x),changes:x}}}let m=[];f.node.name=="OrderedList"&&j$(f.item,r,m);let g=f.item&&f.item.from]*/.exec(u.text)[0].length>=f.to)for(let y=0,w=d.length-1;y<=w;y++)b+=y==w&&!g?d[y].marker(r,1):d[y].blank(yu.from&&/\s/.test(u.text.charAt(v-u.from-1));)v--;return b=AW(b,t),u$t(f.node,t.doc)&&(b=wse(d,t,u)+t.lineBreak+b),m.push({from:v,to:c,insert:t.lineBreak+b}),{range:ht.cursor(v+b.length+1),changes:m}});return s?!1:(n(t.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)},c$t=l$t();function xse(e){return e.name=="QuoteMark"||e.name=="ListMark"}function u$t(e,t){if(e.name!="OrderedList"&&e.name!="BulletList")return!1;let n=e.firstChild,i=e.getChild("ListItem","ListItem");if(!i)return!1;let r=t.lineAt(n.to),s=t.lineAt(i.from),o=/^[\s>]*$/.test(r.text);return r.number+(o?0:1){let n=Yr(e),i=null,r=e.changeByRange(s=>{let o=s.from,{doc:l}=e;if(s.empty&&uP.isActiveAt(e,s.from)){let c=l.lineAt(o),u=t6e(d$t(n,o),l);if(u.length){let d=u[u.length-1],f=d.to-d.spaceAfter.length+(d.spaceAfter?1:0);if(o-c.from>f&&!/\S/.test(c.text.slice(f,o-c.from)))return{range:ht.cursor(c.from+f),changes:{from:c.from+f,to:o}};if(o-c.from==f&&(d.item&&c.from<=d.item.from||/^[\s>]*$/.test(c.text.slice(0,d.to)))){let h=c.from+d.from;if(d.item&&d.node.from{var n;let{main:i}=t.state.selection;if(i.empty)return!1;let r=(n=e.clipboardData)===null||n===void 0?void 0:n.getData("text/plain");if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r="https://"+r),!uP.isActiveAt(t.state,i.from,1)))return!1;let s=Yr(t.state),o=!1;return s.iterate({from:i.from,to:i.to,enter:l=>{(l.from>i.from||b$t.test(l.name))&&(o=!0)},leave:l=>{l.to=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}const y6t=new Ia((e,t)=>{let n;if(e.next<0)e.acceptToken(O$t);else if(t.context.flags&WN)R$(e.next)&&e.acceptToken(w$t,1);else if(((n=e.peek(-1))<0||R$(n))&&t.canShift(Ose)){let i=0;for(;e.next==TW||e.next==oL;)e.advance(),i++;(e.next==C0||e.next==YC||e.next==_W)&&e.acceptToken(Ose,-i)}else R$(e.next)&&e.acceptToken(x$t,1)},{contextual:!0}),v6t=new Ia((e,t)=>{let n=t.context;if(n.flags)return;let i=e.peek(-1);if(i==C0||i==YC){let r=0,s=0;for(;;){if(e.next==TW)r++;else if(e.next==oL)r+=8-r%8;else break;e.advance(),s++}r!=n.indent&&e.next!=C0&&e.next!=YC&&e.next!=_W&&(r[e,t|u6e])),O6t=new rL({start:x6t,reduce(e,t,n,i){return e.flags&WN&&b6t.has(t)||(t==F$t||t==o6e)&&e.flags&u6e?e.parent:e},shift(e,t,n,i){return t==r6e?new KN(e,w6t(i.read(i.pos,n.pos)),0):t==s6e?e.parent:t==E$t||t==_$t||t==R$t||t==a6e?new KN(e,0,WN):Cse.has(t)?new KN(e,0,Cse.get(t)|e.flags&WN):e},hash(e){return e.hash}}),k6t=new Ia(e=>{for(let t=0;t<5;t++){if(e.next!="print".charCodeAt(t))return;e.advance()}if(!/\w/.test(String.fromCharCode(e.next)))for(let t=0;;t++){let n=e.peek(t);if(!(n==TW||n==oL)){n!=u6t&&n!=d6t&&n!=C0&&n!=YC&&n!=_W&&e.acceptToken(v$t);return}}}),S6t=new Ia((e,t)=>{let{flags:n}=t.context,i=n&sp?c6e:l6e,r=(n&ap)>0,s=!(n&op),o=(n&lp)>0,l=e.pos;for(;!(e.next<0);)if(o&&e.next==m7)if(e.peek(1)==m7)e.advance(2);else{if(e.pos==l){e.acceptToken(a6e,1);return}break}else if(s&&e.next==Ese){if(e.pos==l){e.advance();let c=e.next;c>=0&&(e.advance(),E6t(e,c)),e.acceptToken(S$t);return}break}else if(e.next==Ese&&!s&&e.peek(1)>-1)e.advance(2);else if(e.next==i&&(!r||e.peek(1)==i&&e.peek(2)==i)){if(e.pos==l){e.acceptToken(kse,r?3:1);return}break}else if(e.next==C0){if(r)e.advance();else if(e.pos==l){e.acceptToken(kse);return}break}else e.advance();e.pos>l&&e.acceptToken(k$t)});function E6t(e,t){if(t==f6t)for(let n=0;n<2&&e.next>=48&&e.next<=55;n++)e.advance();else if(t==h6t)for(let n=0;n<2&&I$(e.next);n++)e.advance();else if(t==m6t)for(let n=0;n<4&&I$(e.next);n++)e.advance();else if(t==g6t)for(let n=0;n<8&&I$(e.next);n++)e.advance();else if(t==p6t&&e.next==m7){for(e.advance();e.next>=0&&e.next!=Sse&&e.next!=l6e&&e.next!=c6e&&e.next!=C0;)e.advance();e.next==Sse&&e.advance()}}const C6t=bm({'async "*" "**" FormatConversion FormatSpec':fe.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":fe.controlKeyword,"in not and or is del":fe.operatorKeyword,"from def class global nonlocal lambda":fe.definitionKeyword,import:fe.moduleKeyword,"with as print":fe.keyword,Boolean:fe.bool,None:fe.null,VariableName:fe.variableName,"CallExpression/VariableName":fe.function(fe.variableName),"FunctionDefinition/VariableName":fe.function(fe.definition(fe.variableName)),"ClassDefinition/VariableName":fe.definition(fe.className),PropertyName:fe.propertyName,"CallExpression/MemberExpression/PropertyName":fe.function(fe.propertyName),Comment:fe.lineComment,Number:fe.number,String:fe.string,FormatString:fe.special(fe.string),Escape:fe.escape,UpdateOp:fe.updateOperator,"ArithOp!":fe.arithmeticOperator,BitOp:fe.bitwiseOperator,CompareOp:fe.compareOperator,AssignOp:fe.definitionOperator,Ellipsis:fe.punctuation,At:fe.meta,"( )":fe.paren,"[ ]":fe.squareBracket,"{ }":fe.brace,".":fe.derefOperator,", ;":fe.separator}),A6t={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},T6t=sm.deserialize({version:14,states:"##jQ`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO5TQdO'#DoOOQS,5:Y,5:YO5hQdO'#HdOOQS,5:],5:]O5uQ!fO,5:]O5zQtO,59YO1lQdO,59bO1lQdO,59bO1lQdO,59bO8jQdO,59bO8oQdO,59bO8vQdO,59jO8}QdO'#HTO:TQdO'#HSOOQS'#HS'#HSOOQS'#D['#D[O:lQdO,59aO'vQdO,59aO:zQdO,59aOOQS,59y,59yO;PQdO,5:RO'vQdO,5:ROOQS,5:Q,5:QO;_QdO,5:QO;dQdO,5:XO'vQdO,5:XO'vQdO,5:VOOQS,5:U,5:UO;uQdO,5:UO;zQdO,5:WOOOW'#Fy'#FyOOOOQS'#Ds'#DsOOQS1G/w1G/wOOQS1G.|1G.|O!/[QtO1G.|O!/cQtO1G.|O1lQdO1G.|O!0OQdO1G/UOOQS'#DZ'#DZO0rQdO,59tOOQS1G.{1G.{O!0VQdO1G/eO!0gQdO1G/eO!0oQdO1G/fO'vQdO'#H[O!0tQdO'#H[O!0yQtO1G.{O!1ZQdO,59iO!2aQdO,5=zO!2qQdO,5=zO!2yQdO1G/mO!3OQtO1G/mOOQS1G/l1G/lO!3`QdO,5=uO!4VQdO,5=uO0rQdO1G/qO!4tQdO1G/sO!4yQtO1G/sO!5ZQtO1G/qOOQS1G/p1G/pOOQS1G/r1G/rOOOW-E9w-E9wOOQS1G/{1G/{O!5kQdO'#HxO0rQdO'#HxO!5|QdO,5>cOOOW-E9x-E9xOOQS1G/|1G/|OOQS-E9{-E9{O!6[Q#xO1G2zO!6{QtO1G2zO'vQdO,5kOOQS1G1`1G1`O!8RQdO1G1`OOQS'#DV'#DVO0rQdO,5=qOOQS,5=q,5=qO!8WQdO'#FrO!8cQdO,59oO!8kQdO1G/XO!8uQtO,5=uOOQS1G3`1G3`OOQS,5:m,5:mO!9fQdO'#GtOOQS,5jO!;ZQdO,5>jO1XQdO,5>jO!;lQdO,5>iOOQS-E:R-E:RO!;qQdO1G0lO!;|QdO1G0lO!lO!lO!hO!=VQdO,5>hO!=hQdO'#EpO0rQdO1G0tO!=sQdO1G0tO!=xQgO1G0zO!AvQgO1G0}O!EqQdO,5>oO!E{QdO,5>oO!FTQtO,5>oO0rQdO1G1PO!F_QdO1G1PO4iQdO1G1UO!!vQdO1G1WOOQV,5;a,5;aO!FdQfO,5;aO!FiQgO1G1QO!JjQdO'#GZO4iQdO1G1QO4iQdO1G1QO!JzQdO,5>pO!KXQdO,5>pO1XQdO,5>pOOQV1G1U1G1UO!KaQdO'#FSO!KrQ!fO1G1WO!KzQdO1G1WOOQV1G1]1G1]O4iQdO1G1]O!LPQdO1G1]O!LXQdO'#F^OOQV1G1b1G1bO!#ZQtO1G1bPOOO1G2v1G2vP!L^OSO1G2vOOQS,5=},5=}OOQS'#Dp'#DpO0rQdO,5=}O!LfQdO,5=|O!LyQdO,5=|OOQS1G/u1G/uO!MRQdO,5>PO!McQdO,5>PO!MkQdO,5>PO!NOQdO,5>PO!N`QdO,5>POOQS1G3j1G3jOOQS7+$h7+$hO!8kQdO7+$pO#!RQdO1G.|O#!YQdO1G.|OOQS1G/`1G/`OOQS,5<`,5<`O'vQdO,5<`OOQS7+%P7+%PO#!aQdO7+%POOQS-E9r-E9rOOQS7+%Q7+%QO#!qQdO,5=vO'vQdO,5=vOOQS7+$g7+$gO#!vQdO7+%PO##OQdO7+%QO##TQdO1G3fOOQS7+%X7+%XO##eQdO1G3fO##mQdO7+%XOOQS,5<_,5<_O'vQdO,5<_O##rQdO1G3aOOQS-E9q-E9qO#$iQdO7+%]OOQS7+%_7+%_O#$wQdO1G3aO#%fQdO7+%_O#%kQdO1G3gO#%{QdO1G3gO#&TQdO7+%]O#&YQdO,5>dO#&sQdO,5>dO#&sQdO,5>dOOQS'#Dx'#DxO#'UO&jO'#DzO#'aO`O'#HyOOOW1G3}1G3}O#'fQdO1G3}O#'nQdO1G3}O#'yQ#xO7+(fO#(jQtO1G2UP#)TQdO'#GOOOQS,5nQdO,5sQdO1G4OOOQS-E9y-E9yO#?^QdO1G4OO<[QdO'#H{OOOO'#D{'#D{OOOO'#F|'#F|O#?oO&jO,5:fOOOW,5>e,5>eOOOW7+)i7+)iO#?zQdO7+)iO#@SQdO1G2zO#@mQdO1G2zP'vQdO'#FuO0rQdO<mO#BQQdO,5>mOOQS1G0v1G0vOOQS<rO#KgQdO,5>rO#KrQdO,5>rO#K}QdO,5>qO#L`QdO,5>qOOQS1G1Y1G1YOOQS,5;p,5;pOOQV<VAN>VO$ oQdO<cAN>cO0rQdO1G1|O$!PQtO1G1|P$!ZQdO'#FvOOQS1G2R1G2RP$!hQdO'#F{O$!uQdO7+)jO$#`QdO,5>gOOOO-E9z-E9zOOOW<tO$4{QdO,5>tO1XQdO,5vO$)nQdO,5>vOOQS1G1p1G1pOOQS,5<[,5<[OOQU7+'P7+'PO$+zQdO1G/iO$)nQdO,5wO$8zQdO,5>wOOQS1G1s1G1sOOQS7+'S7+'SP$)nQdO'#GdO$9SQdO1G4bO$9^QdO1G4bO$9fQdO1G4bOOQS7+%T7+%TO$9tQdO1G1tO$:SQtO'#FaO$:ZQdO,5<}OOQS,5<},5<}O$:iQdO1G4cOOQS-E:a-E:aO$)nQdO,5<|O$:pQdO,5<|O$:uQdO7+)|OOQS-E:`-E:`O$;PQdO7+)|O$)nQdO,5S~O%cOS%^OSSOS%]PQ~OPdOVaOfoOhYOopOs!POvqO!PrO!Q{O!T!SO!U!RO!XZO!][O!h`O!r`O!s`O!t`O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#l!QO#o!TO#s!UO#u!VO#z!WO#}hO$P!XO%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~O%]!YO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%j![O%k!]O%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aO~Ok%xXl%xXm%xXn%xXo%xXp%xXs%xXz%xX{%xX!x%xX#g%xX%[%xX%_%xX%z%xXg%xX!T%xX!U%xX%{%xX!W%xX![%xX!Q%xX#[%xXt%xX!m%xX~P%SOfoOhYO!XZO!][O!h`O!r`O!s`O!t`O%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~Oz%wX{%wX#g%wX%[%wX%_%wX%z%wX~Ok!pOl!qOm!oOn!oOo!rOp!sOs!tO!x%wX~P)pOV!zOg!|Oo0cOv0qO!PrO~P'vOV#OOo0cOv0qO!W#PO~P'vOV#SOa#TOo0cOv0qO![#UO~P'vOQ#XO%`#XO%a#ZO~OQ#^OR#[O%`#^O%a#`O~OV%iX_%iXa%iXh%iXk%iXl%iXm%iXn%iXo%iXp%iXs%iXz%iX!X%iX!f%iX%j%iX%k%iX%l%iX%m%iX%n%iX%o%iX%p%iX%q%iX%r%iX%s%iXg%iX!T%iX!U%iX~O&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O{%iX!x%iX#g%iX%[%iX%_%iX%z%iX%{%iX!W%iX![%iX!Q%iX#[%iXt%iX!m%iX~P,eOz#dO{%hX!x%hX#g%hX%[%hX%_%hX%z%hX~Oo0cOv0qO~P'vO#g#gO%[#iO%_#iO~O%uWO~O!T#nO#u!VO#z!WO#}hO~OopO~P'vOV#sOa#tO%uWO{wP~OV#xOo0cOv0qO!Q#yO~P'vO{#{O!x$QO%z#|O#g!yX%[!yX%_!yX~OV#xOo0cOv0qO#g#SX%[#SX%_#SX~P'vOo0cOv0qO#g#WX%[#WX%_#WX~P'vOh$WO%uWO~O!f$YO!r$YO%uWO~OV$eO~P'vO!U$gO#s$hO#u$iO~O{$jO~OV$qO~P'vOS$sO%[$rO%_$rO%c$tO~OV$}Oa$}Og%POo0cOv0qO~P'vOo0cOv0qO{%SO~P'vO&Y%UO~Oa!bOh!iO!X!kO!f!mOVba_bakbalbambanbaobapbasbazba{ba!xba#gba%[ba%_ba%jba%kba%lba%mba%nba%oba%pba%qba%rba%sba%zbagba!Tba!Uba%{ba!Wba![ba!Qba#[batba!mba~On%ZO~Oo%ZO~P'vOo0cO~P'vOk0eOl0fOm0dOn0dOo0mOp0nOs0rOg%wX!T%wX!U%wX%{%wX!W%wX![%wX!Q%wX#[%wX!m%wX~P)pO%{%]Og%vXz%vX!T%vX!U%vX!W%vX{%vX~Og%_Oz%`O!T%dO!U%cO~Og%_O~Oz%gO!T%dO!U%cO!W&SX~O!W%kO~Oz%lO{%nO!T%dO!U%cO![%}X~O![%rO~O![%sO~OQ#XO%`#XO%a%uO~OV%wOo0cOv0qO!PrO~P'vOQ#^OR#[O%`#^O%a%zO~OV!qa_!qaa!qah!qak!qal!qam!qan!qao!qap!qas!qaz!qa{!qa!X!qa!f!qa!x!qa#g!qa%[!qa%_!qa%j!qa%k!qa%l!qa%m!qa%n!qa%o!qa%p!qa%q!qa%r!qa%s!qa%z!qag!qa!T!qa!U!qa%{!qa!W!qa![!qa!Q!qa#[!qat!qa!m!qa~P#yOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P%SOV&OOopOvqO{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P'vOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#g$zX%[$zX%_$zX~P'vO#g#gO%[&TO%_&TO~O!f&UOh&sX%[&sXz&sX#[&sX#g&sX%_&sX#Z&sXg&sX~Oh!iO%[&WO~Okealeameaneaoeapeaseazea{ea!xea#gea%[ea%_ea%zeagea!Tea!Uea%{ea!Wea![ea!Qea#[eatea!mea~P%SOsqazqa{qa#gqa%[qa%_qa%zqa~Ok!pOl!qOm!oOn!oOo!rOp!sO!xqa~PEcO%z&YOz%yX{%yX~O%uWOz%yX{%yX~Oz&]O{wX~O{&_O~Oz%lO#g%}X%[%}X%_%}Xg%}X{%}X![%}X!m%}X%z%}X~OV0lOo0cOv0qO!PrO~P'vO%z#|O#gUa%[Ua%_Ua~Oz&hO#g&PX%[&PX%_&PXn&PX~P%SOz&kO!Q&jO#g#Wa%[#Wa%_#Wa~Oz&lO#[&nO#g&rX%[&rX%_&rXg&rX~O!f$YO!r$YO#Z&qO%uWO~O#Z&qO~Oz&sO#g&tX%[&tX%_&tX~Oz&uO#g&pX%[&pX%_&pX{&pX~O!X&wO%z&xO~Oz&|On&wX~P%SOn'PO~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO%['UO~P'vOt'YO#p'WO#q'XOP#naV#naf#nah#nao#nas#nav#na!P#na!Q#na!T#na!U#na!X#na!]#na!h#na!r#na!s#na!t#na!{#na!}#na#P#na#R#na#T#na#X#na#Z#na#^#na#_#na#a#na#c#na#l#na#o#na#s#na#u#na#z#na#}#na$P#na%X#na%o#na%p#na%t#na%u#na&Z#na&[#na&]#na&^#na&_#na&`#na&a#na&b#na&c#na&d#na&e#na&f#na&g#na&h#na&i#na&j#na%Z#na%_#na~Oz'ZO#[']O{&xX~Oh'_O!X&wO~Oh!iO{$jO!X&wO~O{'eO~P%SO%['hO%_'hO~OS'iO%['hO%_'hO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%k!]O~P!#uO%kWi~P!#uOV!aO_!aOa!bOh!iO!X!kO!f!mO%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%m!_O%n!_O~P!&pO%mWi%nWi~P!&pOa!bOh!iO!X!kO!f!mOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%mWi%nWi%oWi%pWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~OV!aO_!aO%q!aO%r!aO%s!aO~P!)nOVWi_Wi%qWi%rWi%sWi~P!)nO!T%dO!U%cOg&VXz&VX~O%z'kO%{'kO~P,eOz'mOg&UX~Og'oO~Oz'pO{'rO!W&XX~Oo0cOv0qOz'pO{'sO!W&XX~P'vO!W'uO~Om!oOn!oOo!rOp!sOkjisjizji{ji!xji#gji%[ji%_ji%zji~Ol!qO~P!.aOlji~P!.aOk0eOl0fOm0dOn0dOo0mOp0nO~Ot'wO~P!/jOV'|Og'}Oo0cOv0qO~P'vOg'}Oz(OO~Og(QO~O!U(SO~Og(TOz(OO!T%dO!U%cO~P%SOk0eOl0fOm0dOn0dOo0mOp0nOgqa!Tqa!Uqa%{qa!Wqa![qa!Qqa#[qatqa!mqa~PEcOV'|Oo0cOv0qO!W&Sa~P'vOz(WO!W&Sa~O!W(XO~Oz(WO!T%dO!U%cO!W&Sa~P%SOV(]Oo0cOv0qO![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~P'vOz(^O![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~O![(aO~Oz(^O!T%dO!U%cO![%}a~P%SOz(dO!T%dO!U%cO![&Ta~P%SOz(gO{&lX![&lX!m&lX%z&lX~O{(kO![(mO!m(nO%z(jO~OV&OOopOvqO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~P'vOz(pO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~O!f&UOh&sa%[&saz&sa#[&sa#g&sa%_&sa#Z&sag&sa~O%[(uO~OV#sOa#tO%uWO~Oz&]O{wa~OopOvqO~P'vOz(^O#g%}a%[%}a%_%}ag%}a{%}a![%}a!m%}a%z%}a~P%SOz(zO#g%hX%[%hX%_%hX%z%hX~O%z#|O#gUi%[Ui%_Ui~O#g&Pa%[&Pa%_&Pan&Pa~P'vOz(}O#g&Pa%[&Pa%_&Pan&Pa~O%uWO#g&ra%[&ra%_&rag&ra~Oz)SO#g&ra%[&ra%_&rag&ra~Og)VO~OV)WOh$WO%uWO~O#Z)XO~O%uWO#g&ta%[&ta%_&ta~Oz)ZO#g&ta%[&ta%_&ta~Oo0cOv0qO#g&pa%[&pa%_&pa{&pa~P'vOz)^O#g&pa%[&pa%_&pa{&pa~OV)`Oa)`O%uWO~O%z)eO~Ot)hO#j)gOP#hiV#hif#hih#hio#his#hiv#hi!P#hi!Q#hi!T#hi!U#hi!X#hi!]#hi!h#hi!r#hi!s#hi!t#hi!{#hi!}#hi#P#hi#R#hi#T#hi#X#hi#Z#hi#^#hi#_#hi#a#hi#c#hi#l#hi#o#hi#s#hi#u#hi#z#hi#}#hi$P#hi%X#hi%o#hi%p#hi%t#hi%u#hi&Z#hi&[#hi&]#hi&^#hi&_#hi&`#hi&a#hi&b#hi&c#hi&d#hi&e#hi&f#hi&g#hi&h#hi&i#hi&j#hi%Z#hi%_#hi~Ot)iOP#kiV#kif#kih#kio#kis#kiv#ki!P#ki!Q#ki!T#ki!U#ki!X#ki!]#ki!h#ki!r#ki!s#ki!t#ki!{#ki!}#ki#P#ki#R#ki#T#ki#X#ki#Z#ki#^#ki#_#ki#a#ki#c#ki#l#ki#o#ki#s#ki#u#ki#z#ki#}#ki$P#ki%X#ki%o#ki%p#ki%t#ki%u#ki&Z#ki&[#ki&]#ki&^#ki&_#ki&`#ki&a#ki&b#ki&c#ki&d#ki&e#ki&f#ki&g#ki&h#ki&i#ki&j#ki%Z#ki%_#ki~OV)kOn&wa~P'vOz)lOn&wa~Oz)lOn&wa~P%SOn)pO~O%Y)tO~Ot)wO#p'WO#q)vOP#niV#nif#nih#nio#nis#niv#ni!P#ni!Q#ni!T#ni!U#ni!X#ni!]#ni!h#ni!r#ni!s#ni!t#ni!{#ni!}#ni#P#ni#R#ni#T#ni#X#ni#Z#ni#^#ni#_#ni#a#ni#c#ni#l#ni#o#ni#s#ni#u#ni#z#ni#}#ni$P#ni%X#ni%o#ni%p#ni%t#ni%u#ni&Z#ni&[#ni&]#ni&^#ni&_#ni&`#ni&a#ni&b#ni&c#ni&d#ni&e#ni&f#ni&g#ni&h#ni&i#ni&j#ni%Z#ni%_#ni~OV)zOo0cOv0qO{$jO~P'vOo0cOv0qO{&xa~P'vOz*OO{&xa~OV*SOa*TOg*WO%q*UO%uWO~O{$jO&{*YO~Oh'_O~Oh!iO{$jO~O%[*_O~O%[*aO%_*aO~OV$}Oa$}Oo0cOv0qOg&Ua~P'vOz*dOg&Ua~Oo0cOv0qO{*gO!W&Xa~P'vOz*hO!W&Xa~Oo0cOv0qOz*hO{*kO!W&Xa~P'vOo0cOv0qOz*hO!W&Xa~P'vOz*hO{*kO!W&Xa~Om0dOn0dOo0mOp0nOgjikjisjizji!Tji!Uji%{ji!Wji{ji![ji#gji%[ji%_ji!Qji#[jitji!mji%zji~Ol0fO~P!NkOlji~P!NkOV'|Og*pOo0cOv0qO~P'vOn*rO~Og*pOz*tO~Og*uO~OV'|Oo0cOv0qO!W&Si~P'vOz*vO!W&Si~O!W*wO~OV(]Oo0cOv0qO![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~P'vOz*zO!T%dO!U%cO![&Ti~Oz*}O![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~O![+OO~Oa+QOo0cOv0qO![&Ti~P'vOz*zO![&Ti~O![+SO~OV+UOo0cOv0qO{&la![&la!m&la%z&la~P'vOz+VO{&la![&la!m&la%z&la~O!]+YO&n+[O![!nX~O![+^O~O{(kO![+_O~O{(kO![+_O!m+`O~OV&OOopOvqO{%hq!x%hq#g%hq%[%hq%_%hq%z%hq~P'vOz$ri{$ri!x$ri#g$ri%[$ri%_$ri%z$ri~P%SOV&OOopOvqO~P'vOV&OOo0cOv0qO#g%ha%[%ha%_%ha%z%ha~P'vOz+aO#g%ha%[%ha%_%ha%z%ha~Oz$ia#g$ia%[$ia%_$ian$ia~P%SO#g&Pi%[&Pi%_&Pin&Pi~P'vOz+dO#g#Wq%[#Wq%_#Wq~O#[+eOz$va#g$va%[$va%_$vag$va~O%uWO#g&ri%[&ri%_&rig&ri~Oz+gO#g&ri%[&ri%_&rig&ri~OV+iOh$WO%uWO~O%uWO#g&ti%[&ti%_&ti~Oo0cOv0qO#g&pi%[&pi%_&pi{&pi~P'vO{#{Oz#eX!W#eX~Oz+mO!W&uX~O!W+oO~Ot+rO#j)gOP#hqV#hqf#hqh#hqo#hqs#hqv#hq!P#hq!Q#hq!T#hq!U#hq!X#hq!]#hq!h#hq!r#hq!s#hq!t#hq!{#hq!}#hq#P#hq#R#hq#T#hq#X#hq#Z#hq#^#hq#_#hq#a#hq#c#hq#l#hq#o#hq#s#hq#u#hq#z#hq#}#hq$P#hq%X#hq%o#hq%p#hq%t#hq%u#hq&Z#hq&[#hq&]#hq&^#hq&_#hq&`#hq&a#hq&b#hq&c#hq&d#hq&e#hq&f#hq&g#hq&h#hq&i#hq&j#hq%Z#hq%_#hq~On$|az$|a~P%SOV)kOn&wi~P'vOz+yOn&wi~Oz,TO{$jO#[,TO~O#q,VOP#nqV#nqf#nqh#nqo#nqs#nqv#nq!P#nq!Q#nq!T#nq!U#nq!X#nq!]#nq!h#nq!r#nq!s#nq!t#nq!{#nq!}#nq#P#nq#R#nq#T#nq#X#nq#Z#nq#^#nq#_#nq#a#nq#c#nq#l#nq#o#nq#s#nq#u#nq#z#nq#}#nq$P#nq%X#nq%o#nq%p#nq%t#nq%u#nq&Z#nq&[#nq&]#nq&^#nq&_#nq&`#nq&a#nq&b#nq&c#nq&d#nq&e#nq&f#nq&g#nq&h#nq&i#nq&j#nq%Z#nq%_#nq~O#[,WOz%Oa{%Oa~Oo0cOv0qO{&xi~P'vOz,YO{&xi~O{#{O%z,[Og&zXz&zX~O%uWOg&zXz&zX~Oz,`Og&yX~Og,bO~O%Y,eO~O!T%dO!U%cOg&Viz&Vi~OV$}Oa$}Oo0cOv0qOg&Ui~P'vO{,hOz$la!W$la~Oo0cOv0qO{,iOz$la!W$la~P'vOo0cOv0qO{*gO!W&Xi~P'vOz,lO!W&Xi~Oo0cOv0qOz,lO!W&Xi~P'vOz,lO{,oO!W&Xi~Og$hiz$hi!W$hi~P%SOV'|Oo0cOv0qO~P'vOn,qO~OV'|Og,rOo0cOv0qO~P'vOV'|Oo0cOv0qO!W&Sq~P'vOz$gi![$gi#g$gi%[$gi%_$gig$gi{$gi!m$gi%z$gi~P%SOV(]Oo0cOv0qO~P'vOa+QOo0cOv0qO![&Tq~P'vOz,sO![&Tq~O![,tO~OV(]Oo0cOv0qO![%}q#g%}q%[%}q%_%}qg%}q{%}q!m%}q%z%}q~P'vO{,uO~OV+UOo0cOv0qO{&li![&li!m&li%z&li~P'vOz,zO{&li![&li!m&li%z&li~O!]+YO&n+[O![!na~O{(kO![,}O~OV&OOo0cOv0qO#g%hi%[%hi%_%hi%z%hi~P'vOz-OO#g%hi%[%hi%_%hi%z%hi~O%uWO#g&rq%[&rq%_&rqg&rq~Oz-RO#g&rq%[&rq%_&rqg&rq~OV)`Oa)`O%uWO!W&ua~Oz-TO!W&ua~On$|iz$|i~P%SOV)kO~P'vOV)kOn&wq~P'vOt-XOP#myV#myf#myh#myo#mys#myv#my!P#my!Q#my!T#my!U#my!X#my!]#my!h#my!r#my!s#my!t#my!{#my!}#my#P#my#R#my#T#my#X#my#Z#my#^#my#_#my#a#my#c#my#l#my#o#my#s#my#u#my#z#my#}#my$P#my%X#my%o#my%p#my%t#my%u#my&Z#my&[#my&]#my&^#my&_#my&`#my&a#my&b#my&c#my&d#my&e#my&f#my&g#my&h#my&i#my&j#my%Z#my%_#my~O%Z-]O%_-]O~P`O#q-^OP#nyV#nyf#nyh#nyo#nys#nyv#ny!P#ny!Q#ny!T#ny!U#ny!X#ny!]#ny!h#ny!r#ny!s#ny!t#ny!{#ny!}#ny#P#ny#R#ny#T#ny#X#ny#Z#ny#^#ny#_#ny#a#ny#c#ny#l#ny#o#ny#s#ny#u#ny#z#ny#}#ny$P#ny%X#ny%o#ny%p#ny%t#ny%u#ny&Z#ny&[#ny&]#ny&^#ny&_#ny&`#ny&a#ny&b#ny&c#ny&d#ny&e#ny&f#ny&g#ny&h#ny&i#ny&j#ny%Z#ny%_#ny~Oz-aO{$jO#[-aO~Oo0cOv0qO{&xq~P'vOz-dO{&xq~O%z,[Og&zaz&za~O{#{Og&zaz&za~OV*SOa*TO%q*UO%uWOg&ya~Oz-hOg&ya~O$S-lO~OV$}Oa$}Oo0cOv0qO~P'vOo0cOv0qO{-mOz$li!W$li~P'vOo0cOv0qOz$li!W$li~P'vO{-mOz$li!W$li~Oo0cOv0qO{*gO~P'vOo0cOv0qO{*gO!W&Xq~P'vOz-pO!W&Xq~Oo0cOv0qOz-pO!W&Xq~P'vOs-sO!T%dO!U%cOg&Oq!W&Oq![&Oqz&Oq~P!/jOa+QOo0cOv0qO![&Ty~P'vOz$ji![$ji~P%SOa+QOo0cOv0qO~P'vOV+UOo0cOv0qO~P'vOV+UOo0cOv0qO{&lq![&lq!m&lq%z&lq~P'vO{(kO![-xO!m-yO%z-wO~OV&OOo0cOv0qO#g%hq%[%hq%_%hq%z%hq~P'vO%uWO#g&ry%[&ry%_&ryg&ry~OV)`Oa)`O%uWO!W&ui~Ot-}OP#m!RV#m!Rf#m!Rh#m!Ro#m!Rs#m!Rv#m!R!P#m!R!Q#m!R!T#m!R!U#m!R!X#m!R!]#m!R!h#m!R!r#m!R!s#m!R!t#m!R!{#m!R!}#m!R#P#m!R#R#m!R#T#m!R#X#m!R#Z#m!R#^#m!R#_#m!R#a#m!R#c#m!R#l#m!R#o#m!R#s#m!R#u#m!R#z#m!R#}#m!R$P#m!R%X#m!R%o#m!R%p#m!R%t#m!R%u#m!R&Z#m!R&[#m!R&]#m!R&^#m!R&_#m!R&`#m!R&a#m!R&b#m!R&c#m!R&d#m!R&e#m!R&f#m!R&g#m!R&h#m!R&i#m!R&j#m!R%Z#m!R%_#m!R~Oo0cOv0qO{&xy~P'vOV*SOa*TO%q*UO%uWOg&yi~O$S-lO%Z.VO%_.VO~OV.aOh._O!X.^O!].`O!h.YO!s.[O!t.[O%p.XO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O~Oo0cOv0qOz$lq!W$lq~P'vO{.fOz$lq!W$lq~Oo0cOv0qO{*gO!W&Xy~P'vOz.gO!W&Xy~Oo0cOv.kO~P'vOs-sO!T%dO!U%cOg&Oy!W&Oy![&Oyz&Oy~P!/jO{(kO![.nO~O{(kO![.nO!m.oO~OV*SOa*TO%q*UO%uWO~Oh.tO!f.rOz$TX#[$TX%j$TXg$TX~Os$TX{$TX!W$TX![$TX~P$-bO%o.vO%p.vOs$UXz$UX{$UX#[$UX%j$UX!W$UXg$UX![$UX~O!h.xO~Oz.|O#[/OO%j.yOs&|X{&|X!W&|Xg&|X~Oa/RO~P$)zOh.tOs&}Xz&}X{&}X#[&}X%j&}X!W&}Xg&}X![&}X~Os/VO{$jO~Oo0cOv0qOz$ly!W$ly~P'vOo0cOv0qO{*gO!W&X!R~P'vOz/ZO!W&X!R~Og&RXs&RX!T&RX!U&RX!W&RX![&RXz&RX~P!/jOs-sO!T%dO!U%cOg&Qa!W&Qa![&Qaz&Qa~O{(kO![/^O~O!f.rOh$[as$[az$[a{$[a#[$[a%j$[a!W$[ag$[a![$[a~O!h/eO~O%o.vO%p.vOs$Uaz$Ua{$Ua#[$Ua%j$Ua!W$Uag$Ua![$Ua~O%j.yOs$Yaz$Ya{$Ya#[$Ya!W$Yag$Ya![$Ya~Os&|a{&|a!W&|ag&|a~P$)nOz/jOs&|a{&|a!W&|ag&|a~O!W/mO~Og/mO~O{/oO~O![/pO~Oo0cOv0qO{*gO!W&X!Z~P'vO{/sO~O%z/tO~P$-bOz/uO#[/OO%j.yOg'PX~Oz/uOg'PX~Og/wO~O!h/xO~O#[/OOs%Saz%Sa{%Sa%j%Sa!W%Sag%Sa![%Sa~O#[/OO%j.yOs%Waz%Wa{%Wa!W%Wag%Wa~Os&|i{&|i!W&|ig&|i~P$)nOz/zO#[/OO%j.yO!['Oa~Og'Pa~P$)nOz0SOg'Pa~Oa0UO!['Oi~P$)zOz0WO!['Oi~Oz0WO#[/OO%j.yO!['Oi~O#[/OO%j.yOg$biz$bi~O%z0ZO~P$-bO#[/OO%j.yOg%Vaz%Va~Og'Pi~P$)nO{0^O~Oa0UO!['Oq~P$)zOz0`O!['Oq~O#[/OO%j.yOz%Ui![%Ui~Oa0UO~P$)zOa0UO!['Oy~P$)zO#[/OO%j.yOg$ciz$ci~O#[/OO%j.yOz%Uq![%Uq~Oz+aO#g%ha%[%ha%_%ha%z%ha~P%SOV&OOo0cOv0qO~P'vOn0hO~Oo0hO~P'vO{0iO~Ot0jO~P!/jO&]&Z&j&h&i&g&f&d&e&c&b&`&a&_&^&[%u~",goto:"!=j'QPPPPPP'RP'Z*s+[+t,_,y-fP.SP'Z.r.r'ZPPP'Z2[PPPPPP2[5PPP5PP7b7k=sPP=v>h>kPP'Z'ZPP>zPP'Z'ZPP'Z'Z'Z'Z'Z?O?w'ZP?zP@QDXGuGyPG|HWH['ZPPPH_Hk'RP'R'RP'RP'RP'RP'RP'R'R'RP'RPP'RPP'RP'RPHqH}IVPI^IdPI^PI^I^PPPI^PKrPK{LVL]KrPI^LfPI^PLmLsPLwM]MzNeLwLwNkNxLwLwLwLw! ^! d! g! l! o! y!!P!!]!!o!!u!#P!#V!#s!#y!$P!$Z!$a!$g!$y!%T!%Z!%a!%k!%q!%w!%}!&T!&Z!&e!&k!&u!&{!'U!'[!'k!'s!'}!(UPPPPPPPPPPP!([!(_!(e!(n!(x!)TPPPPPPPPPPPP!-u!/Z!3^!6oPP!6w!7W!7a!8Y!8P!8c!8i!8l!8o!8r!8z!9jPPPPPPPPPPPPPPPPP!9m!9q!9wP!:]!:a!:m!:v!;S!;j!;m!;p!;v!;|!_![!]Do!]!^Es!^!_FZ!_!`Gk!`!aHX!a!b%T!b!cIf!c!dJU!d!eK^!e!hJU!h!i!#f!i!tJU!t!u!,|!u!wJU!w!x!.t!x!}JU!}#O!0S#O#P&o#P#Q!0j#Q#R!1Q#R#SJU#S#T%T#T#UJU#U#VK^#V#YJU#Y#Z!#f#Z#fJU#f#g!,|#g#iJU#i#j!.t#j#oJU#o#p!1n#p#q!1s#q#r!2a#r#s!2f#s$g%T$g;'SJU;'S;=`KW<%lOJU`%YT&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T`%lP;=`<%l%To%v]&n`%c_OX%TXY%oY[%T[]%o]p%Tpq%oq#O%T#O#P&o#P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To&tX&n`OY%TYZ%oZ]%T]^%o^#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc'f[&n`O!_%T!_!`([!`#T%T#T#U(r#U#f%T#f#g(r#g#h(r#h#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(cTmR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(yT!mR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk)aV&n`&[ZOr%Trs)vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk){V&n`Or%Trs*bs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk*iT&n`&^ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To+PZS_&n`OY*xYZ%TZ]*x]^%T^#o*x#o#p+r#p#q*x#q#r+r#r;'S*x;'S;=`,^<%lO*x_+wTS_OY+rZ]+r^;'S+r;'S;=`,W<%lO+r_,ZP;=`<%l+ro,aP;=`<%l*xj,kV%rQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-XT!xY&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-oV%lQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.]V&n`&ZZOw%Twx.rx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.wV&n`Ow%Twx/^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/eT&n`&]ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/{ThZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc0cTgR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk0yXVZ&n`Oz%Tz{1f{!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk1mVaR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk2ZV%oZ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc2wTzR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To3_W%pZ&n`O!_%T!_!`-Q!`!a3w!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Td4OT&{S&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk4fX!fQ&n`O!O%T!O!P5R!P!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5WV&n`O!O%T!O!P5m!P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5tT!rZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti6[a!hX&n`O!Q%T!Q![6T![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S6T#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti7fZ&n`O{%T{|8X|}%T}!O8X!O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8^V&n`O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8z]!hX&n`O!Q%T!Q![8s![!l%T!l!m9s!m#R%T#R#S8s#S#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti9zT!hX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk:bX%qR&n`O!P%T!P!Q:}!Q!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj;UV%sQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti;ro!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!d%T!d!e?q!e!g%T!g!h7a!h!l%T!l!m9s!m!q%T!q!rA]!r!z%T!z!{Bq!{#R%T#R#S>_#S#U%T#U#V?q#V#X%T#X#Y7a#Y#^%T#^#_9s#_#c%T#c#dA]#d#l%T#l#mBq#m#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti=xV&n`O!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti>fc!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S>_#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti?vY&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti@mY!hX&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiAbX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBUX!hX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBv]&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiCv]!hX&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToDvV{_&n`O!_%T!_!`E]!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TcEdT%{R&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkEzT#gZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkFbXmR&n`O!^%T!^!_F}!_!`([!`!a([!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjGUV%mQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkGrV%zZ&n`O!_%T!_!`([!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkH`WmR&n`O!_%T!_!`([!`!aHx!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjIPV%nQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkIoV_Q#}P&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToJ_]&n`&YS%uZO!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoKZP;=`<%lJUoKge&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!tJU!t!uLx!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#gLx#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoMRa&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUkN_V&n`&`ZOr%TrsNts#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkNyV&n`Or%Trs! `s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! gT&n`&bZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! }V&n`&_ZOw%Twx!!dx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!!iV&n`Ow%Twx!#Ox#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!#VT&n`&aZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!#oe&n`&YS%uZOr%Trs!%Qsw%Twx!&px!Q%T!Q![JU![!c%T!c!tJU!t!u!(`!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#g!(`#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!%XV&n`&dZOr%Trs!%ns#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!%sV&n`Or%Trs!&Ys#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&aT&n`&fZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&wV&n`&cZOw%Twx!'^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!'cV&n`Ow%Twx!'xx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!(PT&n`&eZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!(ia&n`&YS%uZOr%Trs!)nsw%Twx!+^x!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!)uV&n`&hZOr%Trs!*[s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*aV&n`Or%Trs!*vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*}T&n`&jZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!+eV&n`&gZOw%Twx!+zx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,PV&n`Ow%Twx!,fx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,mT&n`&iZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!-Vi&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[k6t,v6t,y6t,S6t,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:e=>A6t[e]||-1}],tokenPrec:7668}),Ase=new Dq,d6e=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function aj(e){return(t,n,i)=>{if(i)return!1;let r=t.node.getChild("VariableName");return r&&n(r,e),!0}}const _6t={FunctionDefinition:aj("function"),ClassDefinition:aj("class"),ForStatement(e,t,n){if(n){for(let i=e.node.firstChild;i;i=i.nextSibling)if(i.name=="VariableName")t(i,"variable");else if(i.name=="in")break}},ImportStatement(e,t){var n,i;let{node:r}=e,s=((n=r.firstChild)===null||n===void 0?void 0:n.name)=="from";for(let o=r.getChild("import");o;o=o.nextSibling)o.name=="VariableName"&&((i=o.nextSibling)===null||i===void 0?void 0:i.name)!="as"&&t(o,s?"variable":"namespace")},AssignStatement(e,t){for(let n=e.node.firstChild;n;n=n.nextSibling)if(n.name=="VariableName")t(n,"variable");else if(n.name==":"||n.name=="AssignOp")break},ParamList(e,t){for(let n=null,i=e.node.firstChild;i;i=i.nextSibling)i.name=="VariableName"&&(!n||!/\*|AssignOp/.test(n.name))&&t(i,"variable"),n=i},CapturePattern:aj("variable"),AsPattern:aj("variable"),__proto__:null};function f6e(e,t){let n=Ase.get(t);if(n)return n;let i=[],r=!0;function s(o,l){let c=e.sliceString(o.from,o.to);i.push({label:c,type:l})}return t.cursor(Sr.IncludeAnonymous).iterate(o=>{if(o.name){let l=_6t[o.name];if(l&&l(o,s,r)||!r&&d6e.has(o.name))return!1;r=!1}else if(o.to-o.from>8192){for(let l of f6e(e,o.node))i.push(l);return!1}}),Ase.set(t,i),i}const Tse=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,h6e=["String","FormatString","Comment","PropertyName"];function j6t(e){let t=Yr(e.state).resolveInner(e.pos,-1);if(h6e.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&Tse.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let i=[];for(let r=t;r;r=r.parent)d6e.has(r.name)&&(i=i.concat(f6e(e.state.doc,r)));return{options:i,from:n?t.from:e.pos,validFor:Tse}}const N6t=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(e=>({label:e,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(e=>({label:e,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(e=>({label:e,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(e=>({label:e,type:"function"}))),R6t=[Ys("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),Ys("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),Ys("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),Ys("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),Ys(`if \${}: -`,{label:"if",detail:"block",type:"keyword"}),Zs("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),Zs("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),Zs("import ${module}",{label:"import",detail:"statement",type:"keyword"}),Zs("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],I6t=U4e(h6e,lW(N6t.concat(R6t)));function P$(e){let{node:t,pos:n}=e,i=e.lineIndent(n,-1),r=null;for(;;){let s=t.childBefore(n);if(s)if(s.name=="Comment")n=s.from;else if(s.name=="Body"||s.name=="MatchBody")e.baseIndentFor(s)+e.unit<=i&&(r=s),t=s;else if(s.name=="MatchClause")t=s;else if(s.type.is("Statement"))t=s;else break;else break}return r}function D$(e,t){let n=e.baseIndentFor(t),i=e.lineAt(e.pos,-1),r=i.from+i.text.length;return/^\s*($|#)/.test(i.text)&&e.node.ton?null:n+e.unit}const M$=am.define({name:"python",parser:T6t.configure({props:[xm.add({Body:e=>{var t;let n=/^\s*(#|$)/.test(e.textAfter)&&P$(e)||e.node;return(t=D$(e,n))!==null&&t!==void 0?t:e.continue()},MatchBody:e=>{var t;let n=P$(e);return(t=D$(e,n||e.node))!==null&&t!==void 0?t:e.continue()},IfStatement:e=>/^\s*(else:|elif )/.test(e.textAfter)?e.baseIndent:e.continue(),"ForStatement WhileStatement":e=>/^\s*else:/.test(e.textAfter)?e.baseIndent:e.continue(),TryStatement:e=>/^\s*(except[ :]|finally:|else:)/.test(e.textAfter)?e.baseIndent:e.continue(),MatchStatement:e=>/^\s*case /.test(e.textAfter)?e.baseIndent+e.unit:e.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":yw({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":yw({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":yw({closing:"]"}),MemberExpression:e=>e.baseIndent+e.unit,"String FormatString":()=>null,Script:e=>{var t;let n=P$(e);return(t=n&&D$(e,n))!==null&&t!==void 0?t:e.continue()}}),wm.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":ET,Body:(e,t)=>({from:e.from+1,to:e.to-(e.to==t.doc.length?0:1)}),"String FormatString":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/}});function P6t(){return new yb(M$,[M$.data.of({autocomplete:j6t}),M$.data.of({autocomplete:I6t})])}const lx=63,_se=64,D6t=1,M6t=2,p6e=3,L6t=4,m6e=5,$6t=6,F6t=7,g6e=65,B6t=66,U6t=8,Q6t=9,z6t=10,V6t=11,H6t=12,b6e=13,q6t=19,W6t=20,K6t=29,G6t=33,X6t=34,Y6t=47,Z6t=0,jW=1,g7=2,WC=3,b7=4;class xy{constructor(t,n,i){this.parent=t,this.depth=n,this.type=i,this.hash=(t?t.hash+t.hash<<8:0)+n+(n<<4)+i}}xy.top=new xy(null,-1,Z6t);function OE(e,t){for(let n=0,i=t-e.pos-1;;i--,n++){let r=e.peek(i);if(lm(r)||r==-1)return n}}function y7(e){return e==32||e==9}function lm(e){return e==10||e==13}function y6e(e){return y7(e)||lm(e)}function Iy(e){return e<0||y6e(e)}const J6t=new iL({start:xy.top,reduce(e,t){return e.type==WC&&(t==W6t||t==X6t)?e.parent:e},shift(e,t,n,i){if(t==p6e)return new xy(e,OE(i,i.pos),jW);if(t==g6e||t==m6e)return new xy(e,OE(i,i.pos),g7);if(t==lx)return e.parent;if(t==q6t||t==G6t)return new xy(e,0,WC);if(t==b6e&&e.type==b7)return e.parent;if(t==Y6t){let r=/[1-9]/.exec(i.read(i.pos,n.pos));if(r)return new xy(e,e.depth+ +r[0],b7)}return e},hash(e){return e.hash}});function g1(e,t,n=0){return e.peek(n)==t&&e.peek(n+1)==t&&e.peek(n+2)==t&&Iy(e.peek(n+3))}const eFt=new Da((e,t)=>{if(e.next==-1&&t.canShift(_se))return e.acceptToken(_se);let n=e.peek(-1);if((lm(n)||n<0)&&t.context.type!=WC){if(g1(e,45))if(t.canShift(lx))e.acceptToken(lx);else return e.acceptToken(D6t,3);if(g1(e,46))if(t.canShift(lx))e.acceptToken(lx);else return e.acceptToken(M6t,3);let i=0;for(;e.next==32;)i++,e.advance();(i{if(t.context.type==WC){e.next==63&&(e.advance(),Iy(e.next)&&e.acceptToken(F6t));return}if(e.next==45)e.advance(),Iy(e.next)&&e.acceptToken(t.context.type==jW&&t.context.depth==OE(e,e.pos-1)?L6t:p6e);else if(e.next==63)e.advance(),Iy(e.next)&&e.acceptToken(t.context.type==g7&&t.context.depth==OE(e,e.pos-1)?$6t:m6e);else{let n=e.pos;for(;;)if(y7(e.next)){if(e.pos==n)return;e.advance()}else if(e.next==33)v6e(e);else if(e.next==38)v7(e);else if(e.next==42){v7(e);break}else if(e.next==39||e.next==34){if(NW(e,!0))break;return}else if(e.next==91||e.next==123){if(!iFt(e))return;break}else{x6e(e,!0,!1,0);break}for(;y7(e.next);)e.advance();if(e.next==58){if(e.pos==n&&t.canShift(K6t))return;let i=e.peek(1);Iy(i)&&e.acceptTokenTo(t.context.type==g7&&t.context.depth==OE(e,n)?B6t:g6e,n)}}},{contextual:!0});function nFt(e){return e>32&&e<127&&e!=34&&e!=37&&e!=44&&e!=60&&e!=62&&e!=92&&e!=94&&e!=96&&e!=123&&e!=124&&e!=125}function jse(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function Nse(e,t){return e.next==37?(e.advance(),jse(e.next)&&e.advance(),jse(e.next)&&e.advance(),!0):nFt(e.next)||t&&e.next==44?(e.advance(),!0):!1}function v6e(e){if(e.advance(),e.next==60){for(e.advance();;)if(!Nse(e,!0)){e.next==62&&e.advance();break}}else for(;Nse(e,!1););}function v7(e){for(e.advance();!Iy(e.next)&&uP(e.next)!="f";)e.advance()}function NW(e,t){let n=e.next,i=!1,r=e.pos;for(e.advance();;){let s=e.next;if(s<0)break;if(e.advance(),s==n)if(s==39)if(e.next==39)e.advance();else break;else break;else if(s==92&&n==34)e.next>=0&&e.advance();else if(lm(s)){if(t)return!1;i=!0}else if(t&&e.pos>=r+1024)return!1}return!i}function iFt(e){for(let t=[],n=e.pos+1024;;)if(e.next==91||e.next==123)t.push(e.next),e.advance();else if(e.next==39||e.next==34){if(!NW(e,!0))return!1}else if(e.next==93||e.next==125){if(t[t.length-1]!=e.next-2)return!1;if(t.pop(),e.advance(),!t.length)return!0}else{if(e.next<0||e.pos>n||lm(e.next))return!1;e.advance()}}const rFt="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function uP(e){return e<33?"u":e>125?"s":rFt[e-33]}function L$(e,t){let n=uP(e);return n!="u"&&!(t&&n=="f")}function x6e(e,t,n,i){if(uP(e.next)=="s"||(e.next==63||e.next==58||e.next==45)&&L$(e.peek(1),n))e.advance();else return!1;let r=e.pos;for(;;){let s=e.next,o=0,l=i+1;for(;y6e(s);){if(lm(s)){if(t)return!1;l=0}else l++;s=e.peek(++o)}if(!(s>=0&&(s==58?L$(e.peek(o+1),n):s==35?e.peek(o-1)!=32:L$(s,n)))||!n&&l<=i||l==0&&!n&&(g1(e,45,o)||g1(e,46,o)))break;if(t&&uP(s)=="f")return!1;for(let u=o;u>=0;u--)e.advance();if(t&&e.pos>r+1024)return!1}return!0}const sFt=new Da((e,t)=>{if(e.next==33)v6e(e),e.acceptToken(H6t);else if(e.next==38||e.next==42){let n=e.next==38?z6t:V6t;v7(e),e.acceptToken(n)}else e.next==39||e.next==34?(NW(e,!1),e.acceptToken(Q6t)):x6e(e,!1,t.context.type==WC,t.context.depth)&&e.acceptToken(U6t)}),aFt=new Da((e,t)=>{let n=t.context.type==b7?t.context.depth:-1,i=e.pos;e:for(;;){let r=0,s=e.next;for(;s==32;)s=e.peek(++r);if(!r&&(g1(e,45,r)||g1(e,46,r))||!lm(s)&&(n<0&&(n=Math.max(t.context.depth+1,r)),rYAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:J6t,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[oFt],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[eFt,tFt,sFt,aFt,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),cFt=am.define({name:"yaml",parser:lFt.configure({props:[xm.add({Stream:e=>{for(let t=e.node.resolve(e.pos,-1);t&&t.to>=e.pos;t=t.parent){if(t.name=="BlockLiteralContent"&&t.frome.pos)return null}}return null},FlowMapping:yw({closing:"}"}),FlowSequence:yw({closing:"]"})}),wm.add({"FlowMapping FlowSequence":ET,"Item Pair BlockLiteral":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function uFt(){return new yb(cFt)}function dFt(e){w6e(e,"start");var t={},n=e.languageData||{},i=!1;for(var r in e)if(r!=n&&e.hasOwnProperty(r))for(var s=t[r]=[],o=e[r],l=0;l2&&o.token&&typeof o.token!="string"){n.pending=[];for(var u=2;u-1)return null;var r=n.indent.length-1,s=e[n.state];e:for(;;){for(var o=0;o{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),i=IW(e.state,n.from);return i.line?AFt(e):i.block?_Ft(e):!1};function RW(e,t){return({state:n,dispatch:i})=>{if(n.readOnly)return!1;let r=e(t,n);return r?(i(n.update(r)),!0):!1}}const AFt=RW(RFt,0),TFt=RW(C6e,0),_Ft=RW((e,t)=>C6e(e,t,NFt(t)),0);function IW(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const Sk=50;function jFt(e,{open:t,close:n},i,r){let s=e.sliceDoc(i-Sk,i),o=e.sliceDoc(r,r+Sk),l=/\s*$/.exec(s)[0].length,c=/^\s*/.exec(o)[0].length,u=s.length-l;if(s.slice(u-t.length,u)==t&&o.slice(c,c+n.length)==n)return{open:{pos:i-l,margin:l&&1},close:{pos:r+c,margin:c&&1}};let d,f;r-i<=2*Sk?d=f=e.sliceDoc(i,r):(d=e.sliceDoc(i,i+Sk),f=e.sliceDoc(r-Sk,r));let h=/^\s*/.exec(d)[0].length,m=/\s*$/.exec(f)[0].length,g=f.length-m-n.length;return d.slice(h,h+t.length)==t&&f.slice(g,g+n.length)==n?{open:{pos:i+h+t.length,margin:/\s/.test(d.charAt(h+t.length))?1:0},close:{pos:r-m-n.length,margin:/\s/.test(f.charAt(g-1))?1:0}}:null}function NFt(e){let t=[];for(let n of e.selection.ranges){let i=e.doc.lineAt(n.from),r=n.to<=i.to?i:e.doc.lineAt(n.to);r.from>i.from&&r.from==n.to&&(r=n.to==i.to+1?i:e.doc.lineAt(n.to-1));let s=t.length-1;s>=0&&t[s].to>i.from?t[s].to=r.to:t.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return t}function C6e(e,t,n=t.selection.ranges){let i=n.map(s=>IW(t,s.from).block);if(!i.every(s=>s))return null;let r=n.map((s,o)=>jFt(t,i[o],s.from,s.to));if(e!=2&&!r.every(s=>s))return{changes:t.changes(n.map((s,o)=>r[o]?[]:[{from:s.from,insert:i[o].open+" "},{from:s.to,insert:" "+i[o].close}]))};if(e!=1&&r.some(s=>s)){let s=[];for(let o=0,l;or&&(s==o||o>f.from)){r=f.from;let h=/^\s*/.exec(f.text)[0].length,m=h==f.length,g=f.text.slice(h,h+u.length)==u?h:-1;hs.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:l,token:c,indent:u,empty:d,single:f}of i)(f||!d)&&s.push({from:l.from+u,insert:c+" "});let o=t.changes(s);return{changes:o,selection:t.selection.map(o,1)}}else if(e!=1&&i.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:l,token:c}of i)if(l>=0){let u=o.from+l,d=u+c.length;o.text[d-o.from]==" "&&d++,s.push({from:u,to:d})}return{changes:s}}return null}const w7=Nh.define(),IFt=Nh.define(),PFt=gn.define(),A6e=gn.define({combine(e){return Rh(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,n)=>(i,r)=>t(i,r)||n(i,r)})}}),T6e=dl.define({create(){return ch.empty},update(e,t){let n=t.state.facet(A6e),i=t.annotation(w7);if(i){let c=Mc.fromTransaction(t,i.selection),u=i.side,d=u==0?e.undone:e.done;return c?d=dP(d,d.length,n.minDepth,c):d=N6e(d,t.startState.selection),new ch(u==0?i.rest:d,u==0?d:i.rest)}let r=t.annotation(IFt);if((r=="full"||r=="before")&&(e=e.isolate()),t.annotation(Xa.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let s=Mc.fromTransaction(t),o=t.annotation(Xa.time),l=t.annotation(Xa.userEvent);return s?e=e.addChanges(s,o,l,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,l,n.newGroupDelay)),(r=="full"||r=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(t=>t.toJSON()),undone:e.undone.map(t=>t.toJSON())}},fromJSON(e){return new ch(e.done.map(Mc.fromJSON),e.undone.map(Mc.fromJSON))}});function DFt(e={}){return[T6e,A6e.of(e),en.domEventHandlers({beforeinput(t,n){let i=t.inputType=="historyUndo"?_6e:t.inputType=="historyRedo"?O7:null;return i?(t.preventDefault(),i(n)):!1}})]}function oL(e,t){return function({state:n,dispatch:i}){if(!t&&n.readOnly)return!1;let r=n.field(T6e,!1);if(!r)return!1;let s=r.pop(e,n,t);return s?(i(s),!0):!1}}const _6e=oL(0,!1),O7=oL(1,!1),MFt=oL(0,!0),LFt=oL(1,!0);class Mc{constructor(t,n,i,r,s){this.changes=t,this.effects=n,this.mapped=i,this.startSelection=r,this.selectionsAfter=s}setSelAfter(t){return new Mc(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,n,i;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(t){return new Mc(t.changes&&lo.fromJSON(t.changes),[],t.mapped&&gh.fromJSON(t.mapped),t.startSelection&&ht.fromJSON(t.startSelection),t.selectionsAfter.map(ht.fromJSON))}static fromTransaction(t,n){let i=bd;for(let r of t.startState.facet(PFt)){let s=r(t);s.length&&(i=i.concat(s))}return!i.length&&t.changes.empty?null:new Mc(t.changes.invert(t.startState.doc),i,void 0,n||t.startState.selection,bd)}static selection(t){return new Mc(void 0,bd,void 0,void 0,t)}}function dP(e,t,n,i){let r=t+1>n+20?t-n-1:0,s=e.slice(r,t);return s.push(i),s}function $Ft(e,t){let n=[],i=!1;return e.iterChangedRanges((r,s)=>n.push(r,s)),t.iterChangedRanges((r,s,o,l)=>{for(let c=0;c=u&&o<=d&&(i=!0)}}),i}function FFt(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,i)=>n.empty!=t.ranges[i].empty).length===0}function j6e(e,t){return e.length?t.length?e.concat(t):e:t}const bd=[],BFt=200;function N6e(e,t){if(e.length){let n=e[e.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-BFt));return i.length&&i[i.length-1].eq(t)?e:(i.push(t),dP(e,e.length-1,1e9,n.setSelAfter(i)))}else return[Mc.selection([t])]}function UFt(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function $$(e,t){if(!e.length)return e;let n=e.length,i=bd;for(;n;){let r=QFt(e[n-1],t,i);if(r.changes&&!r.changes.empty||r.effects.length){let s=e.slice(0,n);return s[n-1]=r,s}else t=r.mapped,n--,i=r.selectionsAfter}return i.length?[Mc.selection(i)]:bd}function QFt(e,t,n){let i=j6e(e.selectionsAfter.length?e.selectionsAfter.map(l=>l.map(t)):bd,n);if(!e.changes)return Mc.selection(i);let r=e.changes.map(t),s=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(s):s;return new Mc(r,hi.mapEffects(e.effects,t),o,e.startSelection.map(s),i)}const zFt=/^(input\.type|delete)($|\.)/;class ch{constructor(t,n,i=0,r=void 0){this.done=t,this.undone=n,this.prevTime=i,this.prevUserEvent=r}isolate(){return this.prevTime?new ch(this.done,this.undone):this}addChanges(t,n,i,r,s){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&t.changes&&(!i||zFt.test(i))&&(!l.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?e.moveByChar(n,t):lL(n,t))}function Dl(e){return e.textDirectionAt(e.state.selection.main.head)==cs.LTR}const I6e=e=>R6e(e,!Dl(e)),P6e=e=>R6e(e,Dl(e));function D6e(e,t){return If(e,n=>n.empty?e.moveByGroup(n,t):lL(n,t))}const HFt=e=>D6e(e,!Dl(e)),qFt=e=>D6e(e,Dl(e));function WFt(e,t,n){if(t.type.prop(n))return!0;let i=t.to-t.from;return i&&(i>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function cL(e,t,n){let i=Jr(e).resolveInner(t.head),r=n?ci.closedBy:ci.openedBy;for(let c=t.head;;){let u=n?i.childAfter(c):i.childBefore(c);if(!u)break;WFt(e,u,r)?i=u:c=n?u.to:u.from}let s=i.type.prop(r),o,l;return s&&(o=n?lh(e,i.from,1):lh(e,i.to,-1))&&o.matched?l=n?o.end.to:o.end.from:l=n?i.to:i.from,ht.cursor(l,n?-1:1)}const KFt=e=>If(e,t=>cL(e.state,t,!Dl(e))),GFt=e=>If(e,t=>cL(e.state,t,Dl(e)));function M6e(e,t){return If(e,n=>{if(!n.empty)return lL(n,t);let i=e.moveVertically(n,t);return i.head!=n.head?i:e.moveToLineBoundary(n,t)})}const L6e=e=>M6e(e,!1),$6e=e=>M6e(e,!0);function F6e(e){let t=e.scrollDOM.clientHeighto.empty?e.moveVertically(o,t,n.height):lL(o,t));if(r.eq(i.selection))return!1;let s;if(n.selfScroll){let o=e.coordsAtPos(i.selection.main.head),l=e.scrollDOM.getBoundingClientRect(),c=l.top+n.marginTop,u=l.bottom-n.marginBottom;o&&o.top>c&&o.bottomB6e(e,!1),k7=e=>B6e(e,!0);function Ib(e,t,n){let i=e.lineBlockAt(t.head),r=e.moveToLineBoundary(t,n);if(r.head==t.head&&r.head!=(n?i.to:i.from)&&(r=e.moveToLineBoundary(t,n,!1)),!n&&r.head==i.from&&i.length){let s=/^\s*/.exec(e.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;s&&t.head!=i.from+s&&(r=ht.cursor(i.from+s))}return r}const XFt=e=>If(e,t=>Ib(e,t,!0)),YFt=e=>If(e,t=>Ib(e,t,!1)),ZFt=e=>If(e,t=>Ib(e,t,!Dl(e))),JFt=e=>If(e,t=>Ib(e,t,Dl(e))),e8t=e=>If(e,t=>ht.cursor(e.lineBlockAt(t.head).from,1)),t8t=e=>If(e,t=>ht.cursor(e.lineBlockAt(t.head).to,-1));function n8t(e,t,n){let i=!1,r=pO(e.selection,s=>{let o=lh(e,s.head,-1)||lh(e,s.head,1)||s.head>0&&lh(e,s.head-1,1)||s.headn8t(e,t);function Pd(e,t,n){let i=pO(e.state.selection,r=>{r.undirectional&&r.head>=r.anchor!=t&&(r=ht.range(r.head,r.anchor));let s=n(r);return ht.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return i.eq(e.state.selection)?!1:(e.dispatch(Rf(e.state,i)),!0)}function U6e(e,t){return Pd(e,t,n=>e.moveByChar(n,t))}const Q6e=e=>U6e(e,!Dl(e)),z6e=e=>U6e(e,Dl(e));function V6e(e,t){return Pd(e,t,n=>e.moveByGroup(n,t))}const r8t=e=>V6e(e,!Dl(e)),s8t=e=>V6e(e,Dl(e)),a8t=e=>{let t=!Dl(e);return Pd(e,t,n=>cL(e.state,n,t))},o8t=e=>{let t=Dl(e);return Pd(e,t,n=>cL(e.state,n,t))};function H6e(e,t){return Pd(e,t,n=>e.moveVertically(n,t))}const q6e=e=>H6e(e,!1),W6e=e=>H6e(e,!0);function K6e(e,t){return Pd(e,t,n=>e.moveVertically(n,t,F6e(e).height))}const Ise=e=>K6e(e,!1),Pse=e=>K6e(e,!0),l8t=e=>Pd(e,!0,t=>Ib(e,t,!0)),c8t=e=>Pd(e,!1,t=>Ib(e,t,!1)),u8t=e=>{let t=!Dl(e);return Pd(e,t,n=>Ib(e,n,t))},d8t=e=>{let t=Dl(e);return Pd(e,t,n=>Ib(e,n,t))},f8t=e=>Pd(e,!1,t=>ht.cursor(e.lineBlockAt(t.head).from)),h8t=e=>Pd(e,!0,t=>ht.cursor(e.lineBlockAt(t.head).to)),Dse=({state:e,dispatch:t})=>(t(Rf(e,{anchor:0})),!0),Mse=({state:e,dispatch:t})=>(t(Rf(e,{anchor:e.doc.length})),!0),Lse=({state:e,dispatch:t})=>(t(Rf(e,{anchor:e.selection.main.anchor,head:0})),!0),$se=({state:e,dispatch:t})=>(t(Rf(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),p8t=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),m8t=({state:e,dispatch:t})=>{let n=uL(e).map(({from:i,to:r})=>ht.range(i,Math.min(r+1,e.doc.length)));return t(e.update({selection:ht.create(n),userEvent:"select"})),!0},g8t=({state:e,dispatch:t})=>{let n=pO(e.selection,i=>{let r=Jr(e),s=r.resolveStack(i.from,1);if(i.empty){let o=r.resolveStack(i.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}for(let o=s;o;o=o.next){let{node:l}=o;if((l.from=i.to||l.to>i.to&&l.from<=i.from)&&o.next)return ht.range(l.to,l.from)}return i});return n.eq(e.selection)?!1:(t(Rf(e,n)),!0)};function G6e(e,t){let{state:n}=e,i=n.selection,r=n.selection.ranges.slice();for(let s of n.selection.ranges){let o=n.doc.lineAt(s.head);if(t?o.to0)for(let l=s;;){let c=e.moveVertically(l,t);if(c.heado.to){r.some(u=>u.head==c.head)||r.push(c);break}else{if(c.head==l.head)break;l=c}}}return r.length==i.ranges.length?!1:(e.dispatch(Rf(n,ht.create(r,r.length-1))),!0)}const b8t=e=>G6e(e,!1),y8t=e=>G6e(e,!0),v8t=({state:e,dispatch:t})=>{let n=e.selection,i=null;return n.ranges.length>1?i=ht.create([n.main]):n.main.empty||(i=ht.create([ht.cursor(n.main.head)])),i?(t(Rf(e,i)),!0):!1};function _T(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:i}=e,r=i.changeByRange(s=>{let{from:o,to:l}=s;if(o==l){let c=t(s);co&&(n="delete.forward",c=aj(e,c,!0)),o=Math.min(o,c),l=Math.max(l,c)}else o=aj(e,o,!1),l=aj(e,l,!0);return o==l?{range:s}:{changes:{from:o,to:l},range:ht.cursor(o,or(e)))i.between(t,t,(r,s)=>{rt&&(t=n?s:r)});return t}const X6e=(e,t,n)=>_T(e,i=>{let r=i.from,{state:s}=e,o=s.doc.lineAt(r),l,c;if(n&&!t&&r>o.from&&rX6e(e,!1,!0),Y6e=e=>X6e(e,!0,!1),Z6e=(e,t)=>_T(e,n=>{let i=n.head,{state:r}=e,s=r.doc.lineAt(i),o=r.charCategorizer(i);for(let l=null;;){if(i==(t?s.to:s.from)){i==n.head&&s.number!=(t?r.doc.lines:1)&&(i+=t?1:-1);break}let c=Io(s.text,i-s.from,t)+s.from,u=s.text.slice(Math.min(i,c)-s.from,Math.max(i,c)-s.from),d=o(u);if(l!=null&&d!=l)break;(u!=" "||i!=n.head)&&(l=d),i=c}return i}),J6e=e=>Z6e(e,!1),x8t=e=>Z6e(e,!0),w8t=e=>_T(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head_T(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),k8t=e=>_T(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head{if(e.readOnly)return!1;let n=e.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:Or.of(["",""])},range:ht.cursor(i.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},E8t=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(i=>{if(!i.empty||i.from==0||i.from==e.doc.length)return{range:i};let r=i.from,s=e.doc.lineAt(r),o=r==s.from?r-1:Io(s.text,r-s.from,!1)+s.from,l=r==s.to?r+1:Io(s.text,r-s.from,!0)+s.from;return{changes:{from:o,to:l,insert:e.doc.slice(r,l).append(e.doc.slice(o,r))},range:ht.cursor(l)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function uL(e){let t=[],n=-1;for(let i of e.selection.ranges){let r=e.doc.lineAt(i.from),s=e.doc.lineAt(i.to);if(!i.empty&&i.to==s.from&&(s=e.doc.lineAt(i.to-1)),n>=r.number){let o=t[t.length-1];o.to=s.to,o.ranges.push(i)}else t.push({from:r.from,to:s.to,ranges:[i]});n=s.number+1}return t}function eFe(e,t,n){if(e.readOnly)return!1;let i=[],r=[];for(let s of uL(e)){if(n?s.to==e.doc.length:s.from==0)continue;let o=e.doc.lineAt(n?s.to+1:s.from-1),l=o.length+1;if(n){i.push({from:s.to,to:o.to},{from:s.from,insert:o.text+e.lineBreak});for(let c of s.ranges)r.push(ht.range(Math.min(e.doc.length,c.anchor+l),Math.min(e.doc.length,c.head+l)))}else{i.push({from:o.from,to:s.from},{from:s.to,insert:e.lineBreak+o.text});for(let c of s.ranges)r.push(ht.range(c.anchor-l,c.head-l))}}return i.length?(t(e.update({changes:i,scrollIntoView:!0,selection:ht.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const C8t=({state:e,dispatch:t})=>eFe(e,t,!1),A8t=({state:e,dispatch:t})=>eFe(e,t,!0);function tFe(e,t,n){if(e.readOnly)return!1;let i=[];for(let s of uL(e))n?i.push({from:s.from,insert:e.doc.slice(s.from,s.to)+e.lineBreak}):i.push({from:s.to,insert:e.lineBreak+e.doc.slice(s.from,s.to)});let r=e.changes(i);return t(e.update({changes:r,selection:e.selection.map(r,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const T8t=({state:e,dispatch:t})=>tFe(e,t,!1),_8t=({state:e,dispatch:t})=>tFe(e,t,!0),j8t=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(uL(t).map(({from:r,to:s})=>(r>0?r--:s{let s;if(e.lineWrapping){let o=e.lineBlockAt(r.head),l=e.coordsAtPos(r.head,r.assoc||1);l&&(s=o.bottom+e.documentTop-l.bottom+e.defaultLineHeight/2)}return e.moveVertically(r,!0,s)}).map(n);return e.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function N8t(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=Jr(e).resolveInner(t),i=n.childBefore(t),r=n.childAfter(t),s;return i&&r&&i.to<=t&&r.from>=t&&(s=i.type.prop(ci.closedBy))&&s.indexOf(r.name)>-1&&e.doc.lineAt(i.to).from==e.doc.lineAt(r.from).from&&!/\S/.test(e.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}const Fse=nFe(!1),R8t=nFe(!0);function nFe(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let i=t.changeByRange(r=>{let{from:s,to:o}=r,l=t.doc.lineAt(s),c=!e&&s==o&&N8t(t,s);e&&(s=o=(o<=l.to?l:t.doc.lineAt(o)).to);let u=new tL(t,{simulateBreak:s,simulateDoubleBreak:!!c}),d=nW(u,s);for(d==null&&(d=Of(/^\s*/.exec(t.doc.lineAt(s).text)[0],t.tabSize));ol.from&&s{let r=[];for(let o=i.from;o<=i.to;){let l=e.doc.lineAt(o);l.number>n&&(i.empty||i.to>l.from)&&(t(l,r,i),n=l.number),o=l.to+1}let s=e.changes(r);return{changes:r,range:ht.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}const I8t=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),i=new tL(e,{overrideIndentation:s=>{let o=n[s];return o??-1}}),r=PW(e,(s,o,l)=>{let c=nW(i,s.from);if(c==null)return;/\S/.test(s.text)||(c=0);let u=/^\s*/.exec(s.text)[0],d=LC(e,c);(u!=d||l.frome.readOnly?!1:(t(e.update(PW(e,(n,i)=>{i.push({from:n.from,insert:e.facet(fO)})}),{userEvent:"input.indent"})),!0),rFe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(PW(e,(n,i)=>{let r=/^\s*/.exec(n.text)[0];if(!r)return;let s=Of(r,e.tabSize),o=0,l=LC(e,Math.max(0,s-w0(e)));for(;o(e.setTabFocusMode(),!0),D8t=[{key:"Ctrl-b",run:I6e,shift:Q6e,preventDefault:!0},{key:"Ctrl-f",run:P6e,shift:z6e},{key:"Ctrl-p",run:L6e,shift:q6e},{key:"Ctrl-n",run:$6e,shift:W6e},{key:"Ctrl-a",run:e8t,shift:f8t},{key:"Ctrl-e",run:t8t,shift:h8t},{key:"Ctrl-d",run:Y6e},{key:"Ctrl-h",run:S7},{key:"Ctrl-k",run:w8t},{key:"Ctrl-Alt-h",run:J6e},{key:"Ctrl-o",run:S8t},{key:"Ctrl-t",run:E8t},{key:"Ctrl-v",run:k7}],M8t=[{key:"ArrowLeft",run:I6e,shift:Q6e,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:HFt,shift:r8t,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:ZFt,shift:u8t,preventDefault:!0},{key:"ArrowRight",run:P6e,shift:z6e,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:qFt,shift:s8t,preventDefault:!0},{mac:"Cmd-ArrowRight",run:JFt,shift:d8t,preventDefault:!0},{key:"ArrowUp",run:L6e,shift:q6e,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Dse,shift:Lse},{mac:"Ctrl-ArrowUp",run:Rse,shift:Ise},{key:"ArrowDown",run:$6e,shift:W6e,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Mse,shift:$se},{mac:"Ctrl-ArrowDown",run:k7,shift:Pse},{key:"PageUp",run:Rse,shift:Ise},{key:"PageDown",run:k7,shift:Pse},{key:"Home",run:YFt,shift:c8t,preventDefault:!0},{key:"Mod-Home",run:Dse,shift:Lse},{key:"End",run:XFt,shift:l8t,preventDefault:!0},{key:"Mod-End",run:Mse,shift:$se},{key:"Enter",run:Fse,shift:Fse},{key:"Mod-a",run:p8t},{key:"Backspace",run:S7,shift:S7,preventDefault:!0},{key:"Delete",run:Y6e,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:J6e,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:x8t,preventDefault:!0},{mac:"Mod-Backspace",run:O8t,preventDefault:!0},{mac:"Mod-Delete",run:k8t,preventDefault:!0}].concat(D8t.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),L8t=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:KFt,shift:a8t},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:GFt,shift:o8t},{key:"Alt-ArrowUp",run:C8t},{key:"Shift-Alt-ArrowUp",run:T8t},{key:"Alt-ArrowDown",run:A8t},{key:"Shift-Alt-ArrowDown",run:_8t},{key:"Mod-Alt-ArrowUp",run:b8t},{key:"Mod-Alt-ArrowDown",run:y8t},{key:"Escape",run:v8t},{key:"Mod-Enter",run:R8t},{key:"Alt-l",mac:"Ctrl-l",run:m8t},{key:"Mod-i",run:g8t,preventDefault:!0},{key:"Mod-[",run:rFe},{key:"Mod-]",run:iFe},{key:"Mod-Alt-\\",run:I8t},{key:"Shift-Mod-k",run:j8t},{key:"Shift-Mod-\\",run:i8t},{key:"Mod-/",run:CFt},{key:"Alt-A",run:TFt},{key:"Ctrl-m",mac:"Shift-Alt-m",run:P8t}].concat(M8t),$8t={key:"Tab",run:iFe,shift:rFe},Bse=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class b1{constructor(t,n,i=0,r=t.length,s,o){this.test=o,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(i,r),this.bufferStart=i,this.normalize=s?l=>s(Bse(l)):Bse,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return jc(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let n=Mq(t),i=this.bufferStart+this.bufferPos;this.bufferPos+=Jf(t);let r=this.normalize(n);if(r.length)for(let s=0,o=i,l=!0;;s++){let c=r.charCodeAt(s),u=this.match(c,o,l,this.bufferPos+this.bufferStart,s==r.length-1);if(u)return this.value=u,this;if(s==r.length-1)break;l&&sthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let i=this.curLineStart+n.index,r=i+n[0].length;if(this.matchPos=fP(this.text,r+(i==r?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,r,n)))return this.value={from:i,to:r,precise:!0,match:n},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=i||r.to<=n){let l=new Ow(n,t.sliceString(n,i));return F$.set(t,l),l}if(r.from==n&&r.to==i)return r;let{text:s,from:o}=r;return o>n&&(s=t.sliceString(n,o)+s,o=n),r.to=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==t&&(this.re.lastIndex=t+1,n=this.re.exec(this.flat.text)),n){let i=this.flat.from+n.index,r=i+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,r,n)))return this.value={from:i,to:r,precise:!0,match:n},this.matchPos=fP(this.text,r+(i==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Ow.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(aFe.prototype[Symbol.iterator]=oFe.prototype[Symbol.iterator]=function(){return this});function F8t(e){try{return new RegExp(e,DW),!0}catch{return!1}}function fP(e,t){if(t>=e.length)return t;let n=e.lineAt(t),i;for(;t=56320&&i<57344;)t++;return t}const B8t=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:i,result:r}=YDt(e,{label:t.phrase("Go to line"),input:{type:"text",name:"line",value:n},focus:!0,submitLabel:t.phrase("go")});return r.then(s=>{let o=s&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(s.elements.line.value);if(!o){e.dispatch({effects:i});return}let l=t.doc.lineAt(t.selection.main.head),[,c,u,d,f]=o,h=d?+d.slice(1):0,m=u?+u:l.number;if(u&&f){let v=m/100;c&&(v=v*(c=="-"?-1:1)+l.number/t.doc.lines),m=Math.round(t.doc.lines*v)}else u&&c&&(m=m*(c=="-"?-1:1)+l.number);let g=t.doc.line(Math.max(1,Math.min(t.doc.lines,m))),b=ht.cursor(g.from+Math.max(0,Math.min(h,g.length)));e.dispatch({effects:[i,en.scrollIntoView(b.from,{y:"center"})],selection:b})}),!0},U8t={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Q8t=gn.define({combine(e){return Rh(e,U8t,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function z8t(e){return[K8t,W8t]}const V8t=$n.mark({class:"cm-selectionMatch"}),H8t=$n.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Use(e,t,n,i){return(n==0||e(t.sliceDoc(n-1,n))!=zs.Word)&&(i==t.doc.length||e(t.sliceDoc(i,i+1))!=zs.Word)}function q8t(e,t,n,i){return e(t.sliceDoc(n,n+1))==zs.Word&&e(t.sliceDoc(i-1,i))==zs.Word}const W8t=ga.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(Q8t),{state:n}=e,i=n.selection;if(i.ranges.length>1)return $n.none;let r=i.main,s,o=null;if(r.empty){if(!t.highlightWordAroundCursor)return $n.none;let c=n.wordAt(r.head);if(!c)return $n.none;o=n.charCategorizer(r.head),s=n.sliceDoc(c.from,c.to)}else{let c=r.to-r.from;if(c200)return $n.none;if(t.wholeWords){if(s=n.sliceDoc(r.from,r.to),o=n.charCategorizer(r.head),!(Use(o,n,r.from,r.to)&&q8t(o,n,r.from,r.to)))return $n.none}else if(s=n.sliceDoc(r.from,r.to),!s)return $n.none}let l=[];for(let c of e.visibleRanges){let u=new b1(n.doc,s,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!o||Use(o,n,d,f))&&(r.empty&&d<=r.from&&f>=r.to?l.push(H8t.range(d,f)):(d>=r.to||f<=r.from)&&l.push(V8t.range(d,f)),l.length>t.maxMatches))return $n.none}}return $n.set(l)}},{decorations:e=>e.decorations}),K8t=en.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),G8t=({state:e,dispatch:t})=>{let{selection:n}=e,i=ht.create(n.ranges.map(r=>e.wordAt(r.head)||ht.cursor(r.head)),n.mainIndex);return i.eq(n)?!1:(t(e.update({selection:i})),!0)};function X8t(e,t){let{main:n,ranges:i}=e.selection,r=e.wordAt(n.head),s=r&&r.from==n.from&&r.to==n.to;for(let o=!1,l=new b1(e.doc,t,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new b1(e.doc,t,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(c=>c.from==l.value.from))continue;if(s){let c=e.wordAt(l.value.from);if(!c||c.from!=l.value.from||c.to!=l.value.to)continue}return l.value}}const Y8t=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(s=>s.from===s.to))return G8t({state:e,dispatch:t});let i=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(s=>e.sliceDoc(s.from,s.to)!=i))return!1;let r=X8t(e,i);return r?(t(e.update({selection:e.selection.addRange(ht.range(r.from,r.to),!1),effects:en.scrollIntoView(r.to)})),!0):!1},mO=gn.define({combine(e){return Rh(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new dBt(t),scrollToMatch:t=>en.scrollIntoView(t)})}});class lFe{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||F8t(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord,this.test=t.test}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(n,i)=>i=="n"?` -`:i=="r"?"\r":i=="t"?" ":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord&&this.test==t.test}create(){return this.regexp?new iBt(this):new eBt(this)}getCursor(t,n=0,i){let r=t.doc?t:tr.create({doc:t});return i==null&&(i=r.doc.length),this.regexp?ux(this,r,n,i):cx(this,r,n,i)}}class cFe{constructor(t){this.spec=t}}function Z8t(e,t,n){return(i,r,s,o)=>{if(n&&!n(i,r,s,o))return!1;let l=i>=o&&r<=o+s.length?s.slice(i-o,r-o):t.doc.sliceString(i,r);return e(l,t,i,r)}}function cx(e,t,n,i){let r;return e.wholeWord&&(r=J8t(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(r=Z8t(e.test,t,r)),new b1(t.doc,e.unquoted,n,i,e.caseSensitive?void 0:s=>s.toLowerCase(),r)}function J8t(e,t){return(n,i,r,s)=>((s>n||s+r.length=n)return null;r.push(i.value)}return r}highlight(t,n,i,r){let s=cx(this.spec,t,Math.max(0,n-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,t.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}function tBt(e,t,n){return(i,r,s)=>(!n||n(i,r,s))&&e(s[0],t,i,r)}function ux(e,t,n,i){let r;return e.wholeWord&&(r=nBt(t.charCategorizer(t.selection.main.head))),e.test&&(r=tBt(e.test,t,r)),new aFe(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:r},n,i)}function hP(e,t){return e.slice(Io(e,t,!1),t)}function pP(e,t){return e.slice(t,Io(e,t))}function nBt(e){return(t,n,i)=>!i[0].length||(e(hP(i.input,i.index))!=zs.Word||e(pP(i.input,i.index))!=zs.Word)&&(e(pP(i.input,i.index+i[0].length))!=zs.Word||e(hP(i.input,i.index+i[0].length))!=zs.Word)}class iBt extends cFe{nextMatch(t,n,i){let r=ux(this.spec,t,i,t.doc.length).next();return r.done&&(r=ux(this.spec,t,0,n).next()),r.done?null:r.value}prevMatchInRange(t,n,i){for(let r=1;;r++){let s=Math.max(n,i-r*1e4),o=ux(this.spec,t,s,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(s==n||l.from>s+10))return l;if(s==n)return null}}prevMatch(t,n,i){return this.prevMatchInRange(t,0,n)||this.prevMatchInRange(t,i,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,i)=>{if(i=="&")return t.match[0];if(i=="$")return"$";for(let r=i.length;r>0;r--){let s=+i.slice(0,r);if(s>0&&s=n)return null;r.push(i.value)}return r}highlight(t,n,i,r){let s=ux(this.spec,t,Math.max(0,n-250),Math.min(i+250,t.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}const KC=hi.define(),MW=hi.define(),Bg=dl.define({create(e){return new B$(E7(e).create(),null)},update(e,t){for(let n of t.effects)n.is(KC)?e=new B$(n.value.create(),e.panel):n.is(MW)&&(e=new B$(e.query,n.value?LW:null));return e},provide:e=>DC.from(e,t=>t.panel)});class B${constructor(t,n){this.query=t,this.panel=n}}const rBt=$n.mark({class:"cm-searchMatch"}),sBt=$n.mark({class:"cm-searchMatch cm-searchMatch-selected"}),aBt=ga.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(Bg))}update(e){let t=e.state.field(Bg);(t!=e.startState.field(Bg)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return $n.none;let{view:n}=this,i=new im;for(let r=0,s=n.visibleRanges,o=s.length;rs[r+1].from-2*250;)c=s[++r].to;e.highlight(n.state,l,c,(u,d)=>{let f=n.state.selection.ranges.some(h=>h.from==u&&h.to==d);i.add(u,d,f?sBt:rBt)})}return i.finish()}},{decorations:e=>e.decorations});function jT(e){return t=>{let n=t.state.field(Bg,!1);return n&&n.query.spec.valid?e(t,n):fFe(t)}}const mP=jT((e,{query:t})=>{let{to:n}=e.state.selection.main,i=t.nextMatch(e.state,n,n);if(!i)return!1;let r=ht.single(i.from,i.to),s=e.state.facet(mO);return e.dispatch({selection:r,effects:[$W(e,i),s.scrollToMatch(r.main,e)],userEvent:"select.search"}),dFe(e),!0}),gP=jT((e,{query:t})=>{let{state:n}=e,{from:i}=n.selection.main,r=t.prevMatch(n,i,i);if(!r)return!1;let s=ht.single(r.from,r.to),o=e.state.facet(mO);return e.dispatch({selection:s,effects:[$W(e,r),o.scrollToMatch(s.main,e)],userEvent:"select.search"}),dFe(e),!0}),oBt=jT((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:ht.create(n.map(i=>ht.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),lBt=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:i,to:r}=n.main,s=[],o=0;for(let l=new b1(e.doc,e.sliceDoc(i,r));!l.next().done;){if(s.length>1e3)return!1;l.value.from==i&&(o=s.length),s.push(ht.range(l.value.from,l.value.to))}return t(e.update({selection:ht.create(s,o),userEvent:"select.search.matches"})),!0},Qse=jT((e,{query:t})=>{let{state:n}=e,{from:i,to:r}=n.selection.main;if(n.readOnly)return!1;let s=t.nextMatch(n,i,i);if(!s)return!1;let o=s,l=[],c,u,d=[];o.precise?o.from==i&&o.to==r&&(u=n.toText(t.getReplacement(o)),l.push({from:o.from,to:o.to,insert:u}),o=t.nextMatch(n,o.from,o.to),d.push(en.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(i).number)+"."))):o=t.nextMatch(n,o.from,o.to);let f=e.state.changes(l);return o&&(c=ht.single(o.from,o.to).map(f),d.push($W(e,o)),d.push(n.facet(mO).scrollToMatch(c.main,e))),e.dispatch({changes:f,selection:c,effects:d,userEvent:"input.replace"}),!0}),cBt=jT((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let r of t.matchAll(e.state,1e9)){let{from:s,to:o,precise:l}=r;l&&n.push({from:s,to:o,insert:t.getReplacement(r)})}if(!n.length)return!1;let i=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:en.announce.of(i),userEvent:"input.replace.all"}),!0});function LW(e){return e.state.facet(mO).createPanel(e)}function E7(e,t){var n,i,r,s,o;let l=e.selection.main,c=l.empty||l.to>l.from+100?"":e.sliceDoc(l.from,l.to);if(t&&!c)return t;let u=e.facet(mO);return new lFe({search:((n=t==null?void 0:t.literal)!==null&&n!==void 0?n:u.literal)?c:c.replace(/\n/g,"\\n"),caseSensitive:(i=t==null?void 0:t.caseSensitive)!==null&&i!==void 0?i:u.caseSensitive,literal:(r=t==null?void 0:t.literal)!==null&&r!==void 0?r:u.literal,regexp:(s=t==null?void 0:t.regexp)!==null&&s!==void 0?s:u.regexp,wholeWord:(o=t==null?void 0:t.wholeWord)!==null&&o!==void 0?o:u.wholeWord})}function uFe(e){let t=eW(e,LW);return t&&t.dom.querySelector("[main-field]")}function dFe(e){let t=uFe(e);t&&t==e.root.activeElement&&t.select()}const fFe=e=>{let t=e.state.field(Bg,!1);if(t&&t.panel){let n=uFe(e);if(n&&n!=e.root.activeElement){let i=E7(e.state,t.query.spec);i.valid&&e.dispatch({effects:KC.of(i)}),n.focus(),n.select()}}else e.dispatch({effects:[MW.of(!0),t?KC.of(E7(e.state,t.query.spec)):hi.appendConfig.of(hBt)]});return!0},hFe=e=>{let t=e.state.field(Bg,!1);if(!t||!t.panel)return!1;let n=eW(e,LW);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:MW.of(!1)}),!0},uBt=[{key:"Mod-f",run:fFe,scope:"editor search-panel"},{key:"F3",run:mP,shift:gP,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:mP,shift:gP,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:hFe,scope:"editor search-panel"},{key:"Mod-Shift-l",run:lBt},{key:"Mod-Alt-g",run:B8t},{key:"Mod-d",run:Y8t,preventDefault:!0}];class dBt{constructor(t){this.view=t;let n=this.query=t.state.field(Bg).query.spec;this.commit=this.commit.bind(this),this.searchField=Xr("input",{value:n.search,placeholder:iu(t,"Find"),"aria-label":iu(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Xr("input",{value:n.replace,placeholder:iu(t,"Replace"),"aria-label":iu(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Xr("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=Xr("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=Xr("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function i(r,s,o){return Xr("button",{class:"cm-button",name:r,onclick:s,type:"button"},o)}this.dom=Xr("div",{onkeydown:r=>this.keydown(r),class:"cm-search"},[this.searchField,i("next",()=>mP(t),[iu(t,"next")]),i("prev",()=>gP(t),[iu(t,"previous")]),i("select",()=>oBt(t),[iu(t,"all")]),Xr("label",null,[this.caseField,iu(t,"match case")]),Xr("label",null,[this.reField,iu(t,"regexp")]),Xr("label",null,[this.wordField,iu(t,"by word")]),...t.state.readOnly?[]:[Xr("br"),this.replaceField,i("replace",()=>Qse(t),[iu(t,"replace")]),i("replaceAll",()=>cBt(t),[iu(t,"replace all")])],Xr("button",{name:"close",onclick:()=>hFe(t),"aria-label":iu(t,"close"),type:"button"},["×"])])}commit(){let t=new lFe({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:KC.of(t)}))}keydown(t){aDt(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?gP:mP)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),Qse(this.view))}update(t){for(let n of t.transactions)for(let i of n.effects)i.is(KC)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(mO).top}}function iu(e,t){return e.state.phrase(t)}const oj=30,lj=/[\s\.,:;?!]/;function $W(e,{from:t,to:n}){let i=e.state.doc.lineAt(t),r=e.state.doc.lineAt(n).to,s=Math.max(i.from,t-oj),o=Math.min(r,n+oj),l=e.state.sliceDoc(s,o);if(s!=i.from){for(let c=0;cl.length-oj;c--)if(!lj.test(l[c-1])&&lj.test(l[c])){l=l.slice(0,c);break}}return en.announce.of(`${e.state.phrase("current match")}. ${l} ${e.state.phrase("on line")} ${i.number}.`)}const fBt=en.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),hBt=[Bg,ym.low(aBt),fBt];class zse{constructor(t,n,i){this.from=t,this.to=n,this.diagnostic=i}}class wy{constructor(t,n,i){this.diagnostics=t,this.panel=n,this.selected=i}static init(t,n,i){let r=i.facet(GC).markerFilter;r&&(t=r(t,i));let s=t.slice().sort((m,g)=>m.from-g.from||m.to-g.to),o=new im,l=[],c=0,u=i.doc.iter(),d=0,f=i.doc.length;for(let m=0;;){let g=m==s.length?null:s[m];if(!g&&!l.length)break;let b,v;if(l.length)b=c,v=l.reduce((x,O)=>Math.min(x,O.to),g&&g.from>b?g.from:1e8);else{if(b=g.from,b>f)break;v=g.to,l.push(g),m++}for(;mx.from||x.to==b))l.push(x),m++,v=Math.min(x.to,v);else{v=Math.min(x.from,v);break}}v=Math.min(v,f);let y=!1;if(l.some(x=>x.from==b&&(x.to==v||v==f))&&(y=b==v,!y&&v-b<10)){let x=b-(d+u.value.length);x>0&&(u.next(x),d=b);for(let O=b;;){if(O>=v){y=!0;break}if(!u.lineBreak&&d+u.value.length>O)break;O=d+u.value.length,d+=u.value.length,u.next()}}let w=CBt(l);if(y)o.add(b,b,$n.widget({widget:new OBt(w),diagnostics:l.slice()}));else{let x=l.reduce((O,k)=>k.markClass?O+" "+k.markClass:O,"");o.add(b,v,$n.mark({class:"cm-lintRange cm-lintRange-"+w+x,diagnostics:l.slice(),inclusiveEnd:l.some(O=>O.to>v)}))}if(c=v,c==f)break;for(let x=0;x{if(!(t&&o.diagnostics.indexOf(t)<0))if(!i)i=new zse(r,s,t||o.diagnostics[0]);else{if(o.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new zse(i.from,s,i.diagnostic)}}),i}function pBt(e,t){let n=t.pos,i=t.end||n,r=e.state.facet(GC).hideOn(e,n,i);if(r!=null)return r;let s=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(o=>o.is(pFe))||e.changes.touchesRange(s.from,Math.max(s.to,i)))}function mBt(e,t){return e.field(Ou,!1)?t:t.concat(hi.appendConfig.of(ABt))}const pFe=hi.define(),FW=hi.define(),mFe=hi.define(),Ou=dl.define({create(){return new wy($n.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),i=null,r=e.panel;if(e.selected){let s=t.changes.mapPos(e.selected.from,1);i=vb(n,e.selected.diagnostic,s)||vb(n,null,s)}!n.size&&r&&t.state.facet(GC).autoPanel&&(r=null),e=new wy(n,r,i)}for(let n of t.effects)if(n.is(pFe)){let i=t.state.facet(GC).autoPanel?n.value.length?XC.open:null:e.panel;e=wy.init(n.value,i,t.state)}else n.is(FW)?e=new wy(e.diagnostics,n.value?XC.open:null,e.selected):n.is(mFe)&&(e=new wy(e.diagnostics,e.panel,n.value));return e},provide:e=>[DC.from(e,t=>t.panel),en.decorations.from(e,t=>t.diagnostics)]}),gBt=$n.mark({class:"cm-lintRange cm-lintRange-active"});function bBt(e,t,n){let{diagnostics:i}=e.state.field(Ou),r,s=-1,o=-1;i.between(t-(n<0?1:0),t+(n>0?1:0),(c,u,{spec:d})=>{if(t>=c&&t<=u&&(c==u||(t>c||n>0)&&(tbFe(e,n,!1)))}const vBt=e=>{let t=e.state.field(Ou,!1);(!t||!t.panel)&&e.dispatch({effects:mBt(e.state,[FW.of(!0)])});let n=eW(e,XC.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},Vse=e=>{let t=e.state.field(Ou,!1);return!t||!t.panel?!1:(e.dispatch({effects:FW.of(!1)}),!0)},xBt=e=>{let t=e.state.field(Ou,!1);if(!t)return!1;let n=e.state.selection.main,i=vb(t.diagnostics,null,n.to+1);return!i&&(i=vb(t.diagnostics,null,0),!i||i.from==n.from&&i.to==n.to)?!1:(e.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),GDt(e,i.from,1,{tooltip:yFe,until:r=>r.docChanged||r.newSelection.main.headi.to}),!0)},wBt=[{key:"Mod-Shift-m",run:vBt,preventDefault:!0},{key:"F8",run:xBt}],GC=gn.define({combine(e){return{sources:e.map(t=>t.source).filter(t=>t!=null),...Rh(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:Hse,tooltipFilter:Hse,needsRefresh:(t,n)=>t?n?i=>t(i)||n(i):t:n,hideOn:(t,n)=>t?n?(i,r,s)=>t(i,r,s)||n(i,r,s):t:n,autoPanel:(t,n)=>t||n})}}});function Hse(e,t){return e?t?(n,i)=>t(e(n,i),i):e:t}function gFe(e){let t=[];if(e)e:for(let{name:n}of e){for(let i=0;is.toLowerCase()==r.toLowerCase())){t.push(r);continue e}}t.push("")}return t}function bFe(e,t,n){var i;let r=n?gFe(t.actions):[];return Xr("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},Xr("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),(i=t.actions)===null||i===void 0?void 0:i.map((s,o)=>{let l=!1,c=m=>{if(m.preventDefault(),l)return;l=!0;let g=vb(e.state.field(Ou).diagnostics,t);g&&s.apply(e,g.from,g.to)},{name:u}=s,d=r[o]?u.indexOf(r[o]):-1,f=d<0?u:[u.slice(0,d),Xr("u",u.slice(d,d+1)),u.slice(d+1)],h=s.markClass?" "+s.markClass:"";return Xr("button",{type:"button",class:"cm-diagnosticAction"+h,onclick:c,onmousedown:c,"aria-label":` Action: ${u}${d<0?"":` (access key "${r[o]})"`}.`},f)}),t.source&&Xr("div",{class:"cm-diagnosticSource"},t.source))}class OBt extends Nf{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return Xr("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class qse{constructor(t,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=bFe(t,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class XC{constructor(t){this.view=t,this.items=[];let n=r=>{if(!(r.ctrlKey||r.altKey||r.metaKey)){if(r.keyCode==27)Vse(this.view),this.view.focus();else if(r.keyCode==38||r.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(r.keyCode==40||r.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(r.keyCode==36)this.moveSelection(0);else if(r.keyCode==35)this.moveSelection(this.items.length-1);else if(r.keyCode==13)this.view.focus();else if(r.keyCode>=65&&r.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],o=gFe(s.actions);for(let l=0;l{for(let s=0;sVse(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(Ou).selected;if(!t)return-1;for(let n=0;n{for(let d of u.diagnostics){if(o.has(d))continue;o.add(d);let f=-1,h;for(let m=i;mi&&(this.items.splice(i,f-i),r=!0)),n&&h.diagnostic==n.diagnostic?h.dom.hasAttribute("aria-selected")||(h.dom.setAttribute("aria-selected","true"),s=h):h.dom.hasAttribute("aria-selected")&&h.dom.removeAttribute("aria-selected"),i++}});i({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:c})=>{let u=c.height/this.list.offsetHeight;l.topc.bottom&&(this.list.scrollTop+=(l.bottom-c.bottom)/u)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let t=this.list.firstChild;function n(){let i=t;t=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;t!=i.dom;)n();t=i.dom.nextSibling}else this.list.insertBefore(i.dom,t);for(;t;)n()}moveSelection(t){if(this.selectedIndex<0)return;let n=this.view.state.field(Ou),i=vb(n.diagnostics,this.items[t].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:mFe.of(i)})}static open(t){return new XC(t)}}function kBt(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(e)}')`}function cj(e){return kBt(``,'width="6" height="3"')}const SBt=en.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:cj("#f11")},".cm-lintRange-warning":{backgroundImage:cj("orange")},".cm-lintRange-info":{backgroundImage:cj("#999")},".cm-lintRange-hint":{backgroundImage:cj("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function EBt(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}function CBt(e){let t="hint",n=1;for(let i of e){let r=EBt(i.severity);r>n&&(n=r,t=i.severity)}return t}const yFe=KDt(bBt,{hideOn:pBt}),ABt=[Ou,en.decorations.compute([Ou],e=>{let{selected:t,panel:n}=e.field(Ou);return!t||!n||t.from==t.to?$n.none:$n.set([gBt.range(t.from,t.to)])}),yFe,SBt];var Wse=function(t){t===void 0&&(t={});var n=t,i=n.crosshairCursor,r=i===void 0?!1:i,s=[];t.closeBracketsKeymap!==!1&&(s=s.concat(P5t)),t.defaultKeymap!==!1&&(s=s.concat(L8t)),t.searchKeymap!==!1&&(s=s.concat(uBt)),t.historyKeymap!==!1&&(s=s.concat(VFt)),t.foldKeymap!==!1&&(s=s.concat($Mt)),t.completionKeymap!==!1&&(s=s.concat(X4e)),t.lintKeymap!==!1&&(s=s.concat(wBt));var o=[];return t.lineNumbers!==!1&&o.push(h4e()),t.highlightActiveLineGutter!==!1&&o.push(uMt()),t.highlightSpecialChars!==!1&&o.push(kDt()),t.history!==!1&&o.push(DFt()),t.foldGutter!==!1&&o.push(QMt()),t.drawSelection!==!1&&o.push(fDt()),t.dropCursor!==!1&&o.push(bDt()),t.allowMultipleSelections!==!1&&o.push(tr.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&o.push(jMt()),t.syntaxHighlighting!==!1&&o.push(T4e(qMt,{fallback:!0})),t.bracketMatching!==!1&&o.push(JMt()),t.closeBrackets!==!1&&o.push(j5t()),t.autocompletion!==!1&&o.push(U5t()),t.rectangularSelection!==!1&&o.push(LDt()),r!==!1&&o.push(BDt()),t.highlightActiveLine!==!1&&o.push(_Dt()),t.highlightSelectionMatches!==!1&&o.push(z8t()),t.tabSize&&typeof t.tabSize=="number"&&o.push(fO.of(" ".repeat(t.tabSize))),o.concat([dO.of(s.flat())]).filter(Boolean)};const TBt="#e5c07b",Kse="#e06c75",_Bt="#56b6c2",jBt="#ffffff",KN="#abb2bf",C7="#7d8799",NBt="#61afef",RBt="#98c379",Gse="#d19a66",IBt="#c678dd",PBt="#21252b",Xse="#2c313a",Yse="#282c34",U$="#353a42",DBt="#3E4451",Zse="#528bff",MBt=en.theme({"&":{color:KN,backgroundColor:Yse},".cm-content":{caretColor:Zse},".cm-cursor, .cm-dropCursor":{borderLeftColor:Zse},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:DBt},".cm-panels":{backgroundColor:PBt,color:KN},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:Yse,color:C7,border:"none"},".cm-activeLineGutter":{backgroundColor:Xse},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:U$},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:U$,borderBottomColor:U$},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Xse,color:KN}}},{dark:!0}),LBt=AT.define([{tag:fe.keyword,color:IBt},{tag:[fe.name,fe.deleted,fe.character,fe.propertyName,fe.macroName],color:Kse},{tag:[fe.function(fe.variableName),fe.labelName],color:NBt},{tag:[fe.color,fe.constant(fe.name),fe.standard(fe.name)],color:Gse},{tag:[fe.definition(fe.name),fe.separator],color:KN},{tag:[fe.typeName,fe.className,fe.number,fe.changed,fe.annotation,fe.modifier,fe.self,fe.namespace],color:TBt},{tag:[fe.operator,fe.operatorKeyword,fe.url,fe.escape,fe.regexp,fe.link,fe.special(fe.string)],color:_Bt},{tag:[fe.meta,fe.comment],color:C7},{tag:fe.strong,fontWeight:"bold"},{tag:fe.emphasis,fontStyle:"italic"},{tag:fe.strikethrough,textDecoration:"line-through"},{tag:fe.link,color:C7,textDecoration:"underline"},{tag:fe.heading,fontWeight:"bold",color:Kse},{tag:[fe.atom,fe.bool,fe.special(fe.variableName)],color:Gse},{tag:[fe.processingInstruction,fe.string,fe.inserted],color:RBt},{tag:fe.invalid,color:jBt}]),$Bt=[MBt,T4e(LBt)];var FBt=en.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),BBt=function(t){t===void 0&&(t={});var n=t,i=n.indentWithTab,r=i===void 0?!0:i,s=n.editable,o=s===void 0?!0:s,l=n.readOnly,c=l===void 0?!1:l,u=n.theme,d=u===void 0?"light":u,f=n.placeholder,h=f===void 0?"":f,m=n.basicSetup,g=m===void 0?!0:m,b=[];switch(r&&b.unshift(dO.of([$8t])),g&&(typeof g=="boolean"?b.unshift(Wse()):b.unshift(Wse(g))),h&&b.unshift(IDt(h)),d){case"light":b.push(FBt);break;case"dark":b.push($Bt);break;case"none":break;default:b.push(d);break}return o===!1&&b.push(en.editable.of(!1)),c&&b.push(tr.readOnly.of(!0)),[...b]},UBt=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(t=>!t.empty)});class QBt{constructor(t,n){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=n,this.timeoutMS=n,this.callbacks.push(t)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var t=this.callbacks.slice();this.callbacks.length=0,t.forEach(n=>{try{n()}catch(i){console.error("TimeoutLatch callback error:",i)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class Jse{constructor(){this.interval=null,this.latches=new Set}add(t){this.latches.add(t),this.start()}remove(t){this.latches.delete(t),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(t=>{t.tick(),t.isDone&&this.remove(t)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}}var Q$=null,zBt=()=>typeof window>"u"?new Jse:(Q$||(Q$=new Jse),Q$),VBt=en.theme({"& .cm-scroller":{height:"100% !important"}}),eae=null,z$=null;function HBt(e,t,n,i,r,s){if(!e&&!t&&!n&&!i&&!r&&!s)return null;var o=JSON.stringify({height:e,minHeight:t,maxHeight:n,width:i,minWidth:r,maxWidth:s});return o===eae||(eae=o,z$=en.theme({"&":{height:e,minHeight:t,maxHeight:n,width:i,minWidth:r,maxWidth:s}})),z$}var tae=Nh.define(),qBt=200,WBt=[];function KBt(e){var t=e.value,n=e.selection,i=e.onChange,r=e.onStatistics,s=e.onCreateEditor,o=e.onUpdate,l=e.extensions,c=l===void 0?WBt:l,u=e.autoFocus,d=e.theme,f=d===void 0?"light":d,h=e.height,m=h===void 0?null:h,g=e.minHeight,b=g===void 0?null:g,v=e.maxHeight,y=v===void 0?null:v,w=e.width,x=w===void 0?null:w,O=e.minWidth,k=O===void 0?null:O,S=e.maxWidth,C=S===void 0?null:S,E=e.placeholder,j=E===void 0?"":E,T=e.editable,R=T===void 0?!0:T,A=e.readOnly,N=A===void 0?!1:A,P=e.indentWithTab,I=P===void 0?!0:P,D=e.basicSetup,_=D===void 0?!0:D,L=e.root,F=e.initialState,M=p.useState(),z=M[0],q=M[1],U=p.useState(),J=U[0],V=U[1],Z=p.useState(),ne=Z[0],W=Z[1],G=p.useState(()=>({current:null}))[0],H=p.useState(()=>({current:null}))[0],se=HBt(m,b,y,x,k,C),Y=en.updateListener.of(ee=>{if(ee.docChanged&&typeof i=="function"&&!ee.transactions.some(pe=>pe.annotation(tae))){G.current?G.current.reset():(G.current=new QBt(()=>{if(H.current){var pe=H.current;H.current=null,pe()}G.current=null},qBt),zBt().add(G.current));var be=ee.state.doc,ue=be.toString();i(ue,ee)}r&&r(UBt(ee))}),X=BBt({theme:f,editable:R,readOnly:N,placeholder:j,indentWithTab:I,basicSetup:_}),ie=[Y,...se?[se]:[],VBt,...X];return o&&typeof o=="function"&&ie.push(en.updateListener.of(o)),ie=ie.concat(c),p.useLayoutEffect(()=>{if(z&&!ne){var ee={doc:t,selection:n,extensions:ie},be=F?tr.fromJSON(F.json,ee,F.fields):tr.create(ee);if(W(be),!J){var ue=new en({state:be,parent:z,root:L});V(ue),s&&s(ue,be)}}return()=>{J&&(W(void 0),V(void 0))}},[z,ne]),p.useEffect(()=>{e.container&&q(e.container)},[e.container]),p.useEffect(()=>()=>{J&&(J.destroy(),V(void 0)),G.current&&(G.current.cancel(),G.current=null)},[J]),p.useEffect(()=>{u&&J&&J.focus()},[u,J]),p.useEffect(()=>{J&&J.dispatch({effects:hi.reconfigure.of(ie)})},[f,c,m,b,y,x,k,C,j,R,N,I,_,i,o]),p.useEffect(()=>{if(t!==void 0){var ee=J?J.state.doc.toString():"";if(J&&t!==ee){var be=G.current&&!G.current.isDone,ue=()=>{J&&t!==J.state.doc.toString()&&J.dispatch({changes:{from:0,to:J.state.doc.toString().length,insert:t||""},annotations:[tae.of(!0)]})};be?H.current=ue:ue()}}},[t,J]),{state:ne,setState:W,view:J,setView:V,container:z,setContainer:q}}var GBt=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],vFe=p.forwardRef((e,t)=>{var n=e.className,i=e.value,r=i===void 0?"":i,s=e.selection,o=e.extensions,l=o===void 0?[]:o,c=e.onChange,u=e.onStatistics,d=e.onCreateEditor,f=e.onUpdate,h=e.autoFocus,m=e.theme,g=m===void 0?"light":m,b=e.height,v=e.minHeight,y=e.maxHeight,w=e.width,x=e.minWidth,O=e.maxWidth,k=e.basicSetup,S=e.placeholder,C=e.indentWithTab,E=e.editable,j=e.readOnly,T=e.root,R=e.initialState,A=EFt(e,GBt),N=p.useRef(null),P=KBt({root:T,value:r,autoFocus:h,theme:g,height:b,minHeight:v,maxHeight:y,width:w,minWidth:x,maxWidth:O,basicSetup:k,placeholder:S,indentWithTab:C,editable:E,readOnly:j,selection:s,onChange:c,onStatistics:u,onCreateEditor:d,onUpdate:f,extensions:l,initialState:R}),I=P.state,D=P.view,_=P.container,L=P.setContainer;p.useImperativeHandle(t,()=>({editor:N.current,state:I,view:D}),[N,_,I,D]);var F=p.useCallback(z=>{N.current=z,L(z)},[L]);if(typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var M=typeof g=="string"?"cm-theme-"+g:"cm-theme";return a.jsx("div",x7({ref:F,className:""+M+(n?" "+n:"")},A))});vFe.displayName="CodeMirror";function xFe(e){const t=e.toLowerCase(),n=t.split("/").pop()??t,i=n.includes(".")?n.split(".").pop():"";return n==="dockerfile"||n.startsWith("dockerfile.")||n.endsWith(".dockerfile")?[rW.define(SFt)]:i==="py"||i==="pyi"?[P6t()]:["ts","tsx","mts","cts"].includes(i??"")?[o7({typescript:!0,jsx:i==="tsx"})]:["js","jsx","mjs","cjs"].includes(i??"")?[o7({jsx:i==="jsx"})]:i==="json"||i==="jsonc"?[e3t()]:i==="yaml"||i==="yml"?[uFt()]:["md","markdown"].includes(i??"")?[p$t()]:[]}function NT({value:e,path:t,onChange:n,readOnly:i=!1,theme:r="light",lineNumberStart:s=1,height:o="100%",minHeight:l,maxHeight:c,extensions:u}){const d=p.useMemo(()=>[...xFe(t),...s===1?[]:[h4e({formatNumber:f=>String(f+s-1)})],...u??[]],[s,t,u]);return a.jsx(vFe,{value:e,height:o,minHeight:l,maxHeight:c,theme:r,extensions:d,editable:!i,onChange:n,basicSetup:{lineNumbers:s===1,foldGutter:!0,highlightActiveLine:!0,highlightActiveLineGutter:!0,autocompletion:!1}})}const wFe=Object.freeze(Object.defineProperty({__proto__:null,default:NT,languageFor:xFe},Symbol.toStringTag,{value:"Module"}));function XBt(e){var s;const t=e.split(/\r?\n/);if(((s=t[0])==null?void 0:s.trim())!=="---")return{body:e,frontmatter:[]};const n=t.findIndex((o,l)=>l>0&&o.trim()==="---");if(n<0)return{body:e,frontmatter:[]};const i=M5e(t.slice(1,n).join(` +`,{label:"if",detail:"block",type:"keyword"}),Ys("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),Ys("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),Ys("import ${module}",{label:"import",detail:"statement",type:"keyword"}),Ys("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],I6t=U4e(h6e,lW(N6t.concat(R6t)));function P$(e){let{node:t,pos:n}=e,i=e.lineIndent(n,-1),r=null;for(;;){let s=t.childBefore(n);if(s)if(s.name=="Comment")n=s.from;else if(s.name=="Body"||s.name=="MatchBody")e.baseIndentFor(s)+e.unit<=i&&(r=s),t=s;else if(s.name=="MatchClause")t=s;else if(s.type.is("Statement"))t=s;else break;else break}return r}function D$(e,t){let n=e.baseIndentFor(t),i=e.lineAt(e.pos,-1),r=i.from+i.text.length;return/^\s*($|#)/.test(i.text)&&e.node.ton?null:n+e.unit}const M$=rm.define({name:"python",parser:T6t.configure({props:[ym.add({Body:e=>{var t;let n=/^\s*(#|$)/.test(e.textAfter)&&P$(e)||e.node;return(t=D$(e,n))!==null&&t!==void 0?t:e.continue()},MatchBody:e=>{var t;let n=P$(e);return(t=D$(e,n||e.node))!==null&&t!==void 0?t:e.continue()},IfStatement:e=>/^\s*(else:|elif )/.test(e.textAfter)?e.baseIndent:e.continue(),"ForStatement WhileStatement":e=>/^\s*else:/.test(e.textAfter)?e.baseIndent:e.continue(),TryStatement:e=>/^\s*(except[ :]|finally:|else:)/.test(e.textAfter)?e.baseIndent:e.continue(),MatchStatement:e=>/^\s*case /.test(e.textAfter)?e.baseIndent+e.unit:e.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":xw({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":xw({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":xw({closing:"]"}),MemberExpression:e=>e.baseIndent+e.unit,"String FormatString":()=>null,Script:e=>{var t;let n=P$(e);return(t=n&&D$(e,n))!==null&&t!==void 0?t:e.continue()}}),vm.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":jT,Body:(e,t)=>({from:e.from+1,to:e.to-(e.to==t.doc.length?0:1)}),"String FormatString":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/}});function P6t(){return new bb(M$,[M$.data.of({autocomplete:j6t}),M$.data.of({autocomplete:I6t})])}const ux=63,_se=64,D6t=1,M6t=2,p6e=3,L6t=4,m6e=5,$6t=6,F6t=7,g6e=65,B6t=66,U6t=8,Q6t=9,z6t=10,V6t=11,H6t=12,b6e=13,q6t=19,W6t=20,K6t=29,G6t=33,X6t=34,Y6t=47,Z6t=0,jW=1,g7=2,ZC=3,b7=4;class ky{constructor(t,n,i){this.parent=t,this.depth=n,this.type=i,this.hash=(t?t.hash+t.hash<<8:0)+n+(n<<4)+i}}ky.top=new ky(null,-1,Z6t);function AE(e,t){for(let n=0,i=t-e.pos-1;;i--,n++){let r=e.peek(i);if(am(r)||r==-1)return n}}function y7(e){return e==32||e==9}function am(e){return e==10||e==13}function y6e(e){return y7(e)||am(e)}function My(e){return e<0||y6e(e)}const J6t=new rL({start:ky.top,reduce(e,t){return e.type==ZC&&(t==W6t||t==X6t)?e.parent:e},shift(e,t,n,i){if(t==p6e)return new ky(e,AE(i,i.pos),jW);if(t==g6e||t==m6e)return new ky(e,AE(i,i.pos),g7);if(t==ux)return e.parent;if(t==q6t||t==G6t)return new ky(e,0,ZC);if(t==b6e&&e.type==b7)return e.parent;if(t==Y6t){let r=/[1-9]/.exec(i.read(i.pos,n.pos));if(r)return new ky(e,e.depth+ +r[0],b7)}return e},hash(e){return e.hash}});function y1(e,t,n=0){return e.peek(n)==t&&e.peek(n+1)==t&&e.peek(n+2)==t&&My(e.peek(n+3))}const eFt=new Ia((e,t)=>{if(e.next==-1&&t.canShift(_se))return e.acceptToken(_se);let n=e.peek(-1);if((am(n)||n<0)&&t.context.type!=ZC){if(y1(e,45))if(t.canShift(ux))e.acceptToken(ux);else return e.acceptToken(D6t,3);if(y1(e,46))if(t.canShift(ux))e.acceptToken(ux);else return e.acceptToken(M6t,3);let i=0;for(;e.next==32;)i++,e.advance();(i{if(t.context.type==ZC){e.next==63&&(e.advance(),My(e.next)&&e.acceptToken(F6t));return}if(e.next==45)e.advance(),My(e.next)&&e.acceptToken(t.context.type==jW&&t.context.depth==AE(e,e.pos-1)?L6t:p6e);else if(e.next==63)e.advance(),My(e.next)&&e.acceptToken(t.context.type==g7&&t.context.depth==AE(e,e.pos-1)?$6t:m6e);else{let n=e.pos;for(;;)if(y7(e.next)){if(e.pos==n)return;e.advance()}else if(e.next==33)v6e(e);else if(e.next==38)v7(e);else if(e.next==42){v7(e);break}else if(e.next==39||e.next==34){if(NW(e,!0))break;return}else if(e.next==91||e.next==123){if(!iFt(e))return;break}else{x6e(e,!0,!1,0);break}for(;y7(e.next);)e.advance();if(e.next==58){if(e.pos==n&&t.canShift(K6t))return;let i=e.peek(1);My(i)&&e.acceptTokenTo(t.context.type==g7&&t.context.depth==AE(e,n)?B6t:g6e,n)}}},{contextual:!0});function nFt(e){return e>32&&e<127&&e!=34&&e!=37&&e!=44&&e!=60&&e!=62&&e!=92&&e!=94&&e!=96&&e!=123&&e!=124&&e!=125}function jse(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function Nse(e,t){return e.next==37?(e.advance(),jse(e.next)&&e.advance(),jse(e.next)&&e.advance(),!0):nFt(e.next)||t&&e.next==44?(e.advance(),!0):!1}function v6e(e){if(e.advance(),e.next==60){for(e.advance();;)if(!Nse(e,!0)){e.next==62&&e.advance();break}}else for(;Nse(e,!1););}function v7(e){for(e.advance();!My(e.next)&&dP(e.next)!="f";)e.advance()}function NW(e,t){let n=e.next,i=!1,r=e.pos;for(e.advance();;){let s=e.next;if(s<0)break;if(e.advance(),s==n)if(s==39)if(e.next==39)e.advance();else break;else break;else if(s==92&&n==34)e.next>=0&&e.advance();else if(am(s)){if(t)return!1;i=!0}else if(t&&e.pos>=r+1024)return!1}return!i}function iFt(e){for(let t=[],n=e.pos+1024;;)if(e.next==91||e.next==123)t.push(e.next),e.advance();else if(e.next==39||e.next==34){if(!NW(e,!0))return!1}else if(e.next==93||e.next==125){if(t[t.length-1]!=e.next-2)return!1;if(t.pop(),e.advance(),!t.length)return!0}else{if(e.next<0||e.pos>n||am(e.next))return!1;e.advance()}}const rFt="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function dP(e){return e<33?"u":e>125?"s":rFt[e-33]}function L$(e,t){let n=dP(e);return n!="u"&&!(t&&n=="f")}function x6e(e,t,n,i){if(dP(e.next)=="s"||(e.next==63||e.next==58||e.next==45)&&L$(e.peek(1),n))e.advance();else return!1;let r=e.pos;for(;;){let s=e.next,o=0,l=i+1;for(;y6e(s);){if(am(s)){if(t)return!1;l=0}else l++;s=e.peek(++o)}if(!(s>=0&&(s==58?L$(e.peek(o+1),n):s==35?e.peek(o-1)!=32:L$(s,n)))||!n&&l<=i||l==0&&!n&&(y1(e,45,o)||y1(e,46,o)))break;if(t&&dP(s)=="f")return!1;for(let u=o;u>=0;u--)e.advance();if(t&&e.pos>r+1024)return!1}return!0}const sFt=new Ia((e,t)=>{if(e.next==33)v6e(e),e.acceptToken(H6t);else if(e.next==38||e.next==42){let n=e.next==38?z6t:V6t;v7(e),e.acceptToken(n)}else e.next==39||e.next==34?(NW(e,!1),e.acceptToken(Q6t)):x6e(e,!1,t.context.type==ZC,t.context.depth)&&e.acceptToken(U6t)}),aFt=new Ia((e,t)=>{let n=t.context.type==b7?t.context.depth:-1,i=e.pos;e:for(;;){let r=0,s=e.next;for(;s==32;)s=e.peek(++r);if(!r&&(y1(e,45,r)||y1(e,46,r))||!am(s)&&(n<0&&(n=Math.max(t.context.depth+1,r)),rYAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:J6t,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[oFt],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[eFt,tFt,sFt,aFt,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),cFt=rm.define({name:"yaml",parser:lFt.configure({props:[ym.add({Stream:e=>{for(let t=e.node.resolve(e.pos,-1);t&&t.to>=e.pos;t=t.parent){if(t.name=="BlockLiteralContent"&&t.frome.pos)return null}}return null},FlowMapping:xw({closing:"}"}),FlowSequence:xw({closing:"]"})}),vm.add({"FlowMapping FlowSequence":jT,"Item Pair BlockLiteral":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function uFt(){return new bb(cFt)}function dFt(e){w6e(e,"start");var t={},n=e.languageData||{},i=!1;for(var r in e)if(r!=n&&e.hasOwnProperty(r))for(var s=t[r]=[],o=e[r],l=0;l2&&o.token&&typeof o.token!="string"){n.pending=[];for(var u=2;u-1)return null;var r=n.indent.length-1,s=e[n.state];e:for(;;){for(var o=0;o{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),i=IW(e.state,n.from);return i.line?AFt(e):i.block?_Ft(e):!1};function RW(e,t){return({state:n,dispatch:i})=>{if(n.readOnly)return!1;let r=e(t,n);return r?(i(n.update(r)),!0):!1}}const AFt=RW(RFt,0),TFt=RW(C6e,0),_Ft=RW((e,t)=>C6e(e,t,NFt(t)),0);function IW(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const _k=50;function jFt(e,{open:t,close:n},i,r){let s=e.sliceDoc(i-_k,i),o=e.sliceDoc(r,r+_k),l=/\s*$/.exec(s)[0].length,c=/^\s*/.exec(o)[0].length,u=s.length-l;if(s.slice(u-t.length,u)==t&&o.slice(c,c+n.length)==n)return{open:{pos:i-l,margin:l&&1},close:{pos:r+c,margin:c&&1}};let d,f;r-i<=2*_k?d=f=e.sliceDoc(i,r):(d=e.sliceDoc(i,i+_k),f=e.sliceDoc(r-_k,r));let h=/^\s*/.exec(d)[0].length,m=/\s*$/.exec(f)[0].length,g=f.length-m-n.length;return d.slice(h,h+t.length)==t&&f.slice(g,g+n.length)==n?{open:{pos:i+h+t.length,margin:/\s/.test(d.charAt(h+t.length))?1:0},close:{pos:r-m-n.length,margin:/\s/.test(f.charAt(g-1))?1:0}}:null}function NFt(e){let t=[];for(let n of e.selection.ranges){let i=e.doc.lineAt(n.from),r=n.to<=i.to?i:e.doc.lineAt(n.to);r.from>i.from&&r.from==n.to&&(r=n.to==i.to+1?i:e.doc.lineAt(n.to-1));let s=t.length-1;s>=0&&t[s].to>i.from?t[s].to=r.to:t.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return t}function C6e(e,t,n=t.selection.ranges){let i=n.map(s=>IW(t,s.from).block);if(!i.every(s=>s))return null;let r=n.map((s,o)=>jFt(t,i[o],s.from,s.to));if(e!=2&&!r.every(s=>s))return{changes:t.changes(n.map((s,o)=>r[o]?[]:[{from:s.from,insert:i[o].open+" "},{from:s.to,insert:" "+i[o].close}]))};if(e!=1&&r.some(s=>s)){let s=[];for(let o=0,l;or&&(s==o||o>f.from)){r=f.from;let h=/^\s*/.exec(f.text)[0].length,m=h==f.length,g=f.text.slice(h,h+u.length)==u?h:-1;hs.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:l,token:c,indent:u,empty:d,single:f}of i)(f||!d)&&s.push({from:l.from+u,insert:c+" "});let o=t.changes(s);return{changes:o,selection:t.selection.map(o,1)}}else if(e!=1&&i.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:l,token:c}of i)if(l>=0){let u=o.from+l,d=u+c.length;o.text[d-o.from]==" "&&d++,s.push({from:u,to:d})}return{changes:s}}return null}const w7=Rh.define(),IFt=Rh.define(),PFt=mn.define(),A6e=mn.define({combine(e){return Ih(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,n)=>(i,r)=>t(i,r)||n(i,r)})}}),T6e=dl.define({create(){return uh.empty},update(e,t){let n=t.state.facet(A6e),i=t.annotation(w7);if(i){let c=Mc.fromTransaction(t,i.selection),u=i.side,d=u==0?e.undone:e.done;return c?d=fP(d,d.length,n.minDepth,c):d=N6e(d,t.startState.selection),new uh(u==0?i.rest:d,u==0?d:i.rest)}let r=t.annotation(IFt);if((r=="full"||r=="before")&&(e=e.isolate()),t.annotation(Xa.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let s=Mc.fromTransaction(t),o=t.annotation(Xa.time),l=t.annotation(Xa.userEvent);return s?e=e.addChanges(s,o,l,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,l,n.newGroupDelay)),(r=="full"||r=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(t=>t.toJSON()),undone:e.undone.map(t=>t.toJSON())}},fromJSON(e){return new uh(e.done.map(Mc.fromJSON),e.undone.map(Mc.fromJSON))}});function DFt(e={}){return[T6e,A6e.of(e),Jt.domEventHandlers({beforeinput(t,n){let i=t.inputType=="historyUndo"?_6e:t.inputType=="historyRedo"?O7:null;return i?(t.preventDefault(),i(n)):!1}})]}function lL(e,t){return function({state:n,dispatch:i}){if(!t&&n.readOnly)return!1;let r=n.field(T6e,!1);if(!r)return!1;let s=r.pop(e,n,t);return s?(i(s),!0):!1}}const _6e=lL(0,!1),O7=lL(1,!1),MFt=lL(0,!0),LFt=lL(1,!0);class Mc{constructor(t,n,i,r,s){this.changes=t,this.effects=n,this.mapped=i,this.startSelection=r,this.selectionsAfter=s}setSelAfter(t){return new Mc(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,n,i;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(t){return new Mc(t.changes&&lo.fromJSON(t.changes),[],t.mapped&&bh.fromJSON(t.mapped),t.startSelection&&ht.fromJSON(t.startSelection),t.selectionsAfter.map(ht.fromJSON))}static fromTransaction(t,n){let i=gd;for(let r of t.startState.facet(PFt)){let s=r(t);s.length&&(i=i.concat(s))}return!i.length&&t.changes.empty?null:new Mc(t.changes.invert(t.startState.doc),i,void 0,n||t.startState.selection,gd)}static selection(t){return new Mc(void 0,gd,void 0,void 0,t)}}function fP(e,t,n,i){let r=t+1>n+20?t-n-1:0,s=e.slice(r,t);return s.push(i),s}function $Ft(e,t){let n=[],i=!1;return e.iterChangedRanges((r,s)=>n.push(r,s)),t.iterChangedRanges((r,s,o,l)=>{for(let c=0;c=u&&o<=d&&(i=!0)}}),i}function FFt(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,i)=>n.empty!=t.ranges[i].empty).length===0}function j6e(e,t){return e.length?t.length?e.concat(t):e:t}const gd=[],BFt=200;function N6e(e,t){if(e.length){let n=e[e.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-BFt));return i.length&&i[i.length-1].eq(t)?e:(i.push(t),fP(e,e.length-1,1e9,n.setSelAfter(i)))}else return[Mc.selection([t])]}function UFt(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function $$(e,t){if(!e.length)return e;let n=e.length,i=gd;for(;n;){let r=QFt(e[n-1],t,i);if(r.changes&&!r.changes.empty||r.effects.length){let s=e.slice(0,n);return s[n-1]=r,s}else t=r.mapped,n--,i=r.selectionsAfter}return i.length?[Mc.selection(i)]:gd}function QFt(e,t,n){let i=j6e(e.selectionsAfter.length?e.selectionsAfter.map(l=>l.map(t)):gd,n);if(!e.changes)return Mc.selection(i);let r=e.changes.map(t),s=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(s):s;return new Mc(r,pi.mapEffects(e.effects,t),o,e.startSelection.map(s),i)}const zFt=/^(input\.type|delete)($|\.)/;class uh{constructor(t,n,i=0,r=void 0){this.done=t,this.undone=n,this.prevTime=i,this.prevUserEvent=r}isolate(){return this.prevTime?new uh(this.done,this.undone):this}addChanges(t,n,i,r,s){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&t.changes&&(!i||zFt.test(i))&&(!l.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?e.moveByChar(n,t):cL(n,t))}function Il(e){return e.textDirectionAt(e.state.selection.main.head)==os.LTR}const I6e=e=>R6e(e,!Il(e)),P6e=e=>R6e(e,Il(e));function D6e(e,t){return Rf(e,n=>n.empty?e.moveByGroup(n,t):cL(n,t))}const HFt=e=>D6e(e,!Il(e)),qFt=e=>D6e(e,Il(e));function WFt(e,t,n){if(t.type.prop(n))return!0;let i=t.to-t.from;return i&&(i>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function uL(e,t,n){let i=Yr(e).resolveInner(t.head),r=n?ui.closedBy:ui.openedBy;for(let c=t.head;;){let u=n?i.childAfter(c):i.childBefore(c);if(!u)break;WFt(e,u,r)?i=u:c=n?u.to:u.from}let s=i.type.prop(r),o,l;return s&&(o=n?ch(e,i.from,1):ch(e,i.to,-1))&&o.matched?l=n?o.end.to:o.end.from:l=n?i.to:i.from,ht.cursor(l,n?-1:1)}const KFt=e=>Rf(e,t=>uL(e.state,t,!Il(e))),GFt=e=>Rf(e,t=>uL(e.state,t,Il(e)));function M6e(e,t){return Rf(e,n=>{if(!n.empty)return cL(n,t);let i=e.moveVertically(n,t);return i.head!=n.head?i:e.moveToLineBoundary(n,t)})}const L6e=e=>M6e(e,!1),$6e=e=>M6e(e,!0);function F6e(e){let t=e.scrollDOM.clientHeighto.empty?e.moveVertically(o,t,n.height):cL(o,t));if(r.eq(i.selection))return!1;let s;if(n.selfScroll){let o=e.coordsAtPos(i.selection.main.head),l=e.scrollDOM.getBoundingClientRect(),c=l.top+n.marginTop,u=l.bottom-n.marginBottom;o&&o.top>c&&o.bottomB6e(e,!1),k7=e=>B6e(e,!0);function Rb(e,t,n){let i=e.lineBlockAt(t.head),r=e.moveToLineBoundary(t,n);if(r.head==t.head&&r.head!=(n?i.to:i.from)&&(r=e.moveToLineBoundary(t,n,!1)),!n&&r.head==i.from&&i.length){let s=/^\s*/.exec(e.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;s&&t.head!=i.from+s&&(r=ht.cursor(i.from+s))}return r}const XFt=e=>Rf(e,t=>Rb(e,t,!0)),YFt=e=>Rf(e,t=>Rb(e,t,!1)),ZFt=e=>Rf(e,t=>Rb(e,t,!Il(e))),JFt=e=>Rf(e,t=>Rb(e,t,Il(e))),e8t=e=>Rf(e,t=>ht.cursor(e.lineBlockAt(t.head).from,1)),t8t=e=>Rf(e,t=>ht.cursor(e.lineBlockAt(t.head).to,-1));function n8t(e,t,n){let i=!1,r=gO(e.selection,s=>{let o=ch(e,s.head,-1)||ch(e,s.head,1)||s.head>0&&ch(e,s.head-1,1)||s.headn8t(e,t);function Id(e,t,n){let i=gO(e.state.selection,r=>{r.undirectional&&r.head>=r.anchor!=t&&(r=ht.range(r.head,r.anchor));let s=n(r);return ht.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return i.eq(e.state.selection)?!1:(e.dispatch(Nf(e.state,i)),!0)}function U6e(e,t){return Id(e,t,n=>e.moveByChar(n,t))}const Q6e=e=>U6e(e,!Il(e)),z6e=e=>U6e(e,Il(e));function V6e(e,t){return Id(e,t,n=>e.moveByGroup(n,t))}const r8t=e=>V6e(e,!Il(e)),s8t=e=>V6e(e,Il(e)),a8t=e=>{let t=!Il(e);return Id(e,t,n=>uL(e.state,n,t))},o8t=e=>{let t=Il(e);return Id(e,t,n=>uL(e.state,n,t))};function H6e(e,t){return Id(e,t,n=>e.moveVertically(n,t))}const q6e=e=>H6e(e,!1),W6e=e=>H6e(e,!0);function K6e(e,t){return Id(e,t,n=>e.moveVertically(n,t,F6e(e).height))}const Ise=e=>K6e(e,!1),Pse=e=>K6e(e,!0),l8t=e=>Id(e,!0,t=>Rb(e,t,!0)),c8t=e=>Id(e,!1,t=>Rb(e,t,!1)),u8t=e=>{let t=!Il(e);return Id(e,t,n=>Rb(e,n,t))},d8t=e=>{let t=Il(e);return Id(e,t,n=>Rb(e,n,t))},f8t=e=>Id(e,!1,t=>ht.cursor(e.lineBlockAt(t.head).from)),h8t=e=>Id(e,!0,t=>ht.cursor(e.lineBlockAt(t.head).to)),Dse=({state:e,dispatch:t})=>(t(Nf(e,{anchor:0})),!0),Mse=({state:e,dispatch:t})=>(t(Nf(e,{anchor:e.doc.length})),!0),Lse=({state:e,dispatch:t})=>(t(Nf(e,{anchor:e.selection.main.anchor,head:0})),!0),$se=({state:e,dispatch:t})=>(t(Nf(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),p8t=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),m8t=({state:e,dispatch:t})=>{let n=dL(e).map(({from:i,to:r})=>ht.range(i,Math.min(r+1,e.doc.length)));return t(e.update({selection:ht.create(n),userEvent:"select"})),!0},g8t=({state:e,dispatch:t})=>{let n=gO(e.selection,i=>{let r=Yr(e),s=r.resolveStack(i.from,1);if(i.empty){let o=r.resolveStack(i.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}for(let o=s;o;o=o.next){let{node:l}=o;if((l.from=i.to||l.to>i.to&&l.from<=i.from)&&o.next)return ht.range(l.to,l.from)}return i});return n.eq(e.selection)?!1:(t(Nf(e,n)),!0)};function G6e(e,t){let{state:n}=e,i=n.selection,r=n.selection.ranges.slice();for(let s of n.selection.ranges){let o=n.doc.lineAt(s.head);if(t?o.to0)for(let l=s;;){let c=e.moveVertically(l,t);if(c.heado.to){r.some(u=>u.head==c.head)||r.push(c);break}else{if(c.head==l.head)break;l=c}}}return r.length==i.ranges.length?!1:(e.dispatch(Nf(n,ht.create(r,r.length-1))),!0)}const b8t=e=>G6e(e,!1),y8t=e=>G6e(e,!0),v8t=({state:e,dispatch:t})=>{let n=e.selection,i=null;return n.ranges.length>1?i=ht.create([n.main]):n.main.empty||(i=ht.create([ht.cursor(n.main.head)])),i?(t(Nf(e,i)),!0):!1};function PT(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:i}=e,r=i.changeByRange(s=>{let{from:o,to:l}=s;if(o==l){let c=t(s);co&&(n="delete.forward",c=oj(e,c,!0)),o=Math.min(o,c),l=Math.max(l,c)}else o=oj(e,o,!1),l=oj(e,l,!0);return o==l?{range:s}:{changes:{from:o,to:l},range:ht.cursor(o,or(e)))i.between(t,t,(r,s)=>{rt&&(t=n?s:r)});return t}const X6e=(e,t,n)=>PT(e,i=>{let r=i.from,{state:s}=e,o=s.doc.lineAt(r),l,c;if(n&&!t&&r>o.from&&rX6e(e,!1,!0),Y6e=e=>X6e(e,!0,!1),Z6e=(e,t)=>PT(e,n=>{let i=n.head,{state:r}=e,s=r.doc.lineAt(i),o=r.charCategorizer(i);for(let l=null;;){if(i==(t?s.to:s.from)){i==n.head&&s.number!=(t?r.doc.lines:1)&&(i+=t?1:-1);break}let c=Ro(s.text,i-s.from,t)+s.from,u=s.text.slice(Math.min(i,c)-s.from,Math.max(i,c)-s.from),d=o(u);if(l!=null&&d!=l)break;(u!=" "||i!=n.head)&&(l=d),i=c}return i}),J6e=e=>Z6e(e,!1),x8t=e=>Z6e(e,!0),w8t=e=>PT(e,t=>{let n=e.lineBlockAt(t.head).to;return t.headPT(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),k8t=e=>PT(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head{if(e.readOnly)return!1;let n=e.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:xr.of(["",""])},range:ht.cursor(i.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},E8t=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(i=>{if(!i.empty||i.from==0||i.from==e.doc.length)return{range:i};let r=i.from,s=e.doc.lineAt(r),o=r==s.from?r-1:Ro(s.text,r-s.from,!1)+s.from,l=r==s.to?r+1:Ro(s.text,r-s.from,!0)+s.from;return{changes:{from:o,to:l,insert:e.doc.slice(r,l).append(e.doc.slice(o,r))},range:ht.cursor(l)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function dL(e){let t=[],n=-1;for(let i of e.selection.ranges){let r=e.doc.lineAt(i.from),s=e.doc.lineAt(i.to);if(!i.empty&&i.to==s.from&&(s=e.doc.lineAt(i.to-1)),n>=r.number){let o=t[t.length-1];o.to=s.to,o.ranges.push(i)}else t.push({from:r.from,to:s.to,ranges:[i]});n=s.number+1}return t}function eFe(e,t,n){if(e.readOnly)return!1;let i=[],r=[];for(let s of dL(e)){if(n?s.to==e.doc.length:s.from==0)continue;let o=e.doc.lineAt(n?s.to+1:s.from-1),l=o.length+1;if(n){i.push({from:s.to,to:o.to},{from:s.from,insert:o.text+e.lineBreak});for(let c of s.ranges)r.push(ht.range(Math.min(e.doc.length,c.anchor+l),Math.min(e.doc.length,c.head+l)))}else{i.push({from:o.from,to:s.from},{from:s.to,insert:e.lineBreak+o.text});for(let c of s.ranges)r.push(ht.range(c.anchor-l,c.head-l))}}return i.length?(t(e.update({changes:i,scrollIntoView:!0,selection:ht.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const C8t=({state:e,dispatch:t})=>eFe(e,t,!1),A8t=({state:e,dispatch:t})=>eFe(e,t,!0);function tFe(e,t,n){if(e.readOnly)return!1;let i=[];for(let s of dL(e))n?i.push({from:s.from,insert:e.doc.slice(s.from,s.to)+e.lineBreak}):i.push({from:s.to,insert:e.lineBreak+e.doc.slice(s.from,s.to)});let r=e.changes(i);return t(e.update({changes:r,selection:e.selection.map(r,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const T8t=({state:e,dispatch:t})=>tFe(e,t,!1),_8t=({state:e,dispatch:t})=>tFe(e,t,!0),j8t=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(dL(t).map(({from:r,to:s})=>(r>0?r--:s{let s;if(e.lineWrapping){let o=e.lineBlockAt(r.head),l=e.coordsAtPos(r.head,r.assoc||1);l&&(s=o.bottom+e.documentTop-l.bottom+e.defaultLineHeight/2)}return e.moveVertically(r,!0,s)}).map(n);return e.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function N8t(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=Yr(e).resolveInner(t),i=n.childBefore(t),r=n.childAfter(t),s;return i&&r&&i.to<=t&&r.from>=t&&(s=i.type.prop(ui.closedBy))&&s.indexOf(r.name)>-1&&e.doc.lineAt(i.to).from==e.doc.lineAt(r.from).from&&!/\S/.test(e.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}const Fse=nFe(!1),R8t=nFe(!0);function nFe(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let i=t.changeByRange(r=>{let{from:s,to:o}=r,l=t.doc.lineAt(s),c=!e&&s==o&&N8t(t,s);e&&(s=o=(o<=l.to?l:t.doc.lineAt(o)).to);let u=new nL(t,{simulateBreak:s,simulateDoubleBreak:!!c}),d=nW(u,s);for(d==null&&(d=wf(/^\s*/.exec(t.doc.lineAt(s).text)[0],t.tabSize));ol.from&&s{let r=[];for(let o=i.from;o<=i.to;){let l=e.doc.lineAt(o);l.number>n&&(i.empty||i.to>l.from)&&(t(l,r,i),n=l.number),o=l.to+1}let s=e.changes(r);return{changes:r,range:ht.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}const I8t=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),i=new nL(e,{overrideIndentation:s=>{let o=n[s];return o??-1}}),r=PW(e,(s,o,l)=>{let c=nW(i,s.from);if(c==null)return;/\S/.test(s.text)||(c=0);let u=/^\s*/.exec(s.text)[0],d=QC(e,c);(u!=d||l.frome.readOnly?!1:(t(e.update(PW(e,(n,i)=>{i.push({from:n.from,insert:e.facet(pO)})}),{userEvent:"input.indent"})),!0),rFe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(PW(e,(n,i)=>{let r=/^\s*/.exec(n.text)[0];if(!r)return;let s=wf(r,e.tabSize),o=0,l=QC(e,Math.max(0,s-S0(e)));for(;o(e.setTabFocusMode(),!0),D8t=[{key:"Ctrl-b",run:I6e,shift:Q6e,preventDefault:!0},{key:"Ctrl-f",run:P6e,shift:z6e},{key:"Ctrl-p",run:L6e,shift:q6e},{key:"Ctrl-n",run:$6e,shift:W6e},{key:"Ctrl-a",run:e8t,shift:f8t},{key:"Ctrl-e",run:t8t,shift:h8t},{key:"Ctrl-d",run:Y6e},{key:"Ctrl-h",run:S7},{key:"Ctrl-k",run:w8t},{key:"Ctrl-Alt-h",run:J6e},{key:"Ctrl-o",run:S8t},{key:"Ctrl-t",run:E8t},{key:"Ctrl-v",run:k7}],M8t=[{key:"ArrowLeft",run:I6e,shift:Q6e,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:HFt,shift:r8t,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:ZFt,shift:u8t,preventDefault:!0},{key:"ArrowRight",run:P6e,shift:z6e,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:qFt,shift:s8t,preventDefault:!0},{mac:"Cmd-ArrowRight",run:JFt,shift:d8t,preventDefault:!0},{key:"ArrowUp",run:L6e,shift:q6e,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Dse,shift:Lse},{mac:"Ctrl-ArrowUp",run:Rse,shift:Ise},{key:"ArrowDown",run:$6e,shift:W6e,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Mse,shift:$se},{mac:"Ctrl-ArrowDown",run:k7,shift:Pse},{key:"PageUp",run:Rse,shift:Ise},{key:"PageDown",run:k7,shift:Pse},{key:"Home",run:YFt,shift:c8t,preventDefault:!0},{key:"Mod-Home",run:Dse,shift:Lse},{key:"End",run:XFt,shift:l8t,preventDefault:!0},{key:"Mod-End",run:Mse,shift:$se},{key:"Enter",run:Fse,shift:Fse},{key:"Mod-a",run:p8t},{key:"Backspace",run:S7,shift:S7,preventDefault:!0},{key:"Delete",run:Y6e,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:J6e,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:x8t,preventDefault:!0},{mac:"Mod-Backspace",run:O8t,preventDefault:!0},{mac:"Mod-Delete",run:k8t,preventDefault:!0}].concat(D8t.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),L8t=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:KFt,shift:a8t},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:GFt,shift:o8t},{key:"Alt-ArrowUp",run:C8t},{key:"Shift-Alt-ArrowUp",run:T8t},{key:"Alt-ArrowDown",run:A8t},{key:"Shift-Alt-ArrowDown",run:_8t},{key:"Mod-Alt-ArrowUp",run:b8t},{key:"Mod-Alt-ArrowDown",run:y8t},{key:"Escape",run:v8t},{key:"Mod-Enter",run:R8t},{key:"Alt-l",mac:"Ctrl-l",run:m8t},{key:"Mod-i",run:g8t,preventDefault:!0},{key:"Mod-[",run:rFe},{key:"Mod-]",run:iFe},{key:"Mod-Alt-\\",run:I8t},{key:"Shift-Mod-k",run:j8t},{key:"Shift-Mod-\\",run:i8t},{key:"Mod-/",run:CFt},{key:"Alt-A",run:TFt},{key:"Ctrl-m",mac:"Shift-Alt-m",run:P8t}].concat(M8t),$8t={key:"Tab",run:iFe,shift:rFe},Bse=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class v1{constructor(t,n,i=0,r=t.length,s,o){this.test=o,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(i,r),this.bufferStart=i,this.normalize=s?l=>s(Bse(l)):Bse,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return jc(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let n=Mq(t),i=this.bufferStart+this.bufferPos;this.bufferPos+=eh(t);let r=this.normalize(n);if(r.length)for(let s=0,o=i,l=!0;;s++){let c=r.charCodeAt(s),u=this.match(c,o,l,this.bufferPos+this.bufferStart,s==r.length-1);if(u)return this.value=u,this;if(s==r.length-1)break;l&&sthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let i=this.curLineStart+n.index,r=i+n[0].length;if(this.matchPos=hP(this.text,r+(i==r?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,r,n)))return this.value={from:i,to:r,precise:!0,match:n},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=i||r.to<=n){let l=new Sw(n,t.sliceString(n,i));return F$.set(t,l),l}if(r.from==n&&r.to==i)return r;let{text:s,from:o}=r;return o>n&&(s=t.sliceString(n,o)+s,o=n),r.to=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==t&&(this.re.lastIndex=t+1,n=this.re.exec(this.flat.text)),n){let i=this.flat.from+n.index,r=i+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,r,n)))return this.value={from:i,to:r,precise:!0,match:n},this.matchPos=hP(this.text,r+(i==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Sw.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(aFe.prototype[Symbol.iterator]=oFe.prototype[Symbol.iterator]=function(){return this});function F8t(e){try{return new RegExp(e,DW),!0}catch{return!1}}function hP(e,t){if(t>=e.length)return t;let n=e.lineAt(t),i;for(;t=56320&&i<57344;)t++;return t}const B8t=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:i,result:r}=YDt(e,{label:t.phrase("Go to line"),input:{type:"text",name:"line",value:n},focus:!0,submitLabel:t.phrase("go")});return r.then(s=>{let o=s&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(s.elements.line.value);if(!o){e.dispatch({effects:i});return}let l=t.doc.lineAt(t.selection.main.head),[,c,u,d,f]=o,h=d?+d.slice(1):0,m=u?+u:l.number;if(u&&f){let v=m/100;c&&(v=v*(c=="-"?-1:1)+l.number/t.doc.lines),m=Math.round(t.doc.lines*v)}else u&&c&&(m=m*(c=="-"?-1:1)+l.number);let g=t.doc.line(Math.max(1,Math.min(t.doc.lines,m))),b=ht.cursor(g.from+Math.max(0,Math.min(h,g.length)));e.dispatch({effects:[i,Jt.scrollIntoView(b.from,{y:"center"})],selection:b})}),!0},U8t={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Q8t=mn.define({combine(e){return Ih(e,U8t,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function z8t(e){return[K8t,W8t]}const V8t=Fn.mark({class:"cm-selectionMatch"}),H8t=Fn.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Use(e,t,n,i){return(n==0||e(t.sliceDoc(n-1,n))!=Qs.Word)&&(i==t.doc.length||e(t.sliceDoc(i,i+1))!=Qs.Word)}function q8t(e,t,n,i){return e(t.sliceDoc(n,n+1))==Qs.Word&&e(t.sliceDoc(i-1,i))==Qs.Word}const W8t=ma.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(Q8t),{state:n}=e,i=n.selection;if(i.ranges.length>1)return Fn.none;let r=i.main,s,o=null;if(r.empty){if(!t.highlightWordAroundCursor)return Fn.none;let c=n.wordAt(r.head);if(!c)return Fn.none;o=n.charCategorizer(r.head),s=n.sliceDoc(c.from,c.to)}else{let c=r.to-r.from;if(c200)return Fn.none;if(t.wholeWords){if(s=n.sliceDoc(r.from,r.to),o=n.charCategorizer(r.head),!(Use(o,n,r.from,r.to)&&q8t(o,n,r.from,r.to)))return Fn.none}else if(s=n.sliceDoc(r.from,r.to),!s)return Fn.none}let l=[];for(let c of e.visibleRanges){let u=new v1(n.doc,s,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!o||Use(o,n,d,f))&&(r.empty&&d<=r.from&&f>=r.to?l.push(H8t.range(d,f)):(d>=r.to||f<=r.from)&&l.push(V8t.range(d,f)),l.length>t.maxMatches))return Fn.none}}return Fn.set(l)}},{decorations:e=>e.decorations}),K8t=Jt.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),G8t=({state:e,dispatch:t})=>{let{selection:n}=e,i=ht.create(n.ranges.map(r=>e.wordAt(r.head)||ht.cursor(r.head)),n.mainIndex);return i.eq(n)?!1:(t(e.update({selection:i})),!0)};function X8t(e,t){let{main:n,ranges:i}=e.selection,r=e.wordAt(n.head),s=r&&r.from==n.from&&r.to==n.to;for(let o=!1,l=new v1(e.doc,t,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new v1(e.doc,t,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(c=>c.from==l.value.from))continue;if(s){let c=e.wordAt(l.value.from);if(!c||c.from!=l.value.from||c.to!=l.value.to)continue}return l.value}}const Y8t=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(s=>s.from===s.to))return G8t({state:e,dispatch:t});let i=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(s=>e.sliceDoc(s.from,s.to)!=i))return!1;let r=X8t(e,i);return r?(t(e.update({selection:e.selection.addRange(ht.range(r.from,r.to),!1),effects:Jt.scrollIntoView(r.to)})),!0):!1},bO=mn.define({combine(e){return Ih(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new dBt(t),scrollToMatch:t=>Jt.scrollIntoView(t)})}});class lFe{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||F8t(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord,this.test=t.test}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(n,i)=>i=="n"?` +`:i=="r"?"\r":i=="t"?" ":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord&&this.test==t.test}create(){return this.regexp?new iBt(this):new eBt(this)}getCursor(t,n=0,i){let r=t.doc?t:tr.create({doc:t});return i==null&&(i=r.doc.length),this.regexp?fx(this,r,n,i):dx(this,r,n,i)}}class cFe{constructor(t){this.spec=t}}function Z8t(e,t,n){return(i,r,s,o)=>{if(n&&!n(i,r,s,o))return!1;let l=i>=o&&r<=o+s.length?s.slice(i-o,r-o):t.doc.sliceString(i,r);return e(l,t,i,r)}}function dx(e,t,n,i){let r;return e.wholeWord&&(r=J8t(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(r=Z8t(e.test,t,r)),new v1(t.doc,e.unquoted,n,i,e.caseSensitive?void 0:s=>s.toLowerCase(),r)}function J8t(e,t){return(n,i,r,s)=>((s>n||s+r.length=n)return null;r.push(i.value)}return r}highlight(t,n,i,r){let s=dx(this.spec,t,Math.max(0,n-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,t.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}function tBt(e,t,n){return(i,r,s)=>(!n||n(i,r,s))&&e(s[0],t,i,r)}function fx(e,t,n,i){let r;return e.wholeWord&&(r=nBt(t.charCategorizer(t.selection.main.head))),e.test&&(r=tBt(e.test,t,r)),new aFe(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:r},n,i)}function pP(e,t){return e.slice(Ro(e,t,!1),t)}function mP(e,t){return e.slice(t,Ro(e,t))}function nBt(e){return(t,n,i)=>!i[0].length||(e(pP(i.input,i.index))!=Qs.Word||e(mP(i.input,i.index))!=Qs.Word)&&(e(mP(i.input,i.index+i[0].length))!=Qs.Word||e(pP(i.input,i.index+i[0].length))!=Qs.Word)}class iBt extends cFe{nextMatch(t,n,i){let r=fx(this.spec,t,i,t.doc.length).next();return r.done&&(r=fx(this.spec,t,0,n).next()),r.done?null:r.value}prevMatchInRange(t,n,i){for(let r=1;;r++){let s=Math.max(n,i-r*1e4),o=fx(this.spec,t,s,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(s==n||l.from>s+10))return l;if(s==n)return null}}prevMatch(t,n,i){return this.prevMatchInRange(t,0,n)||this.prevMatchInRange(t,i,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,i)=>{if(i=="&")return t.match[0];if(i=="$")return"$";for(let r=i.length;r>0;r--){let s=+i.slice(0,r);if(s>0&&s=n)return null;r.push(i.value)}return r}highlight(t,n,i,r){let s=fx(this.spec,t,Math.max(0,n-250),Math.min(i+250,t.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}const JC=pi.define(),MW=pi.define(),Fg=dl.define({create(e){return new B$(E7(e).create(),null)},update(e,t){for(let n of t.effects)n.is(JC)?e=new B$(n.value.create(),e.panel):n.is(MW)&&(e=new B$(e.query,n.value?LW:null));return e},provide:e=>BC.from(e,t=>t.panel)});class B${constructor(t,n){this.query=t,this.panel=n}}const rBt=Fn.mark({class:"cm-searchMatch"}),sBt=Fn.mark({class:"cm-searchMatch cm-searchMatch-selected"}),aBt=ma.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(Fg))}update(e){let t=e.state.field(Fg);(t!=e.startState.field(Fg)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return Fn.none;let{view:n}=this,i=new tm;for(let r=0,s=n.visibleRanges,o=s.length;rs[r+1].from-2*250;)c=s[++r].to;e.highlight(n.state,l,c,(u,d)=>{let f=n.state.selection.ranges.some(h=>h.from==u&&h.to==d);i.add(u,d,f?sBt:rBt)})}return i.finish()}},{decorations:e=>e.decorations});function DT(e){return t=>{let n=t.state.field(Fg,!1);return n&&n.query.spec.valid?e(t,n):fFe(t)}}const gP=DT((e,{query:t})=>{let{to:n}=e.state.selection.main,i=t.nextMatch(e.state,n,n);if(!i)return!1;let r=ht.single(i.from,i.to),s=e.state.facet(bO);return e.dispatch({selection:r,effects:[$W(e,i),s.scrollToMatch(r.main,e)],userEvent:"select.search"}),dFe(e),!0}),bP=DT((e,{query:t})=>{let{state:n}=e,{from:i}=n.selection.main,r=t.prevMatch(n,i,i);if(!r)return!1;let s=ht.single(r.from,r.to),o=e.state.facet(bO);return e.dispatch({selection:s,effects:[$W(e,r),o.scrollToMatch(s.main,e)],userEvent:"select.search"}),dFe(e),!0}),oBt=DT((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:ht.create(n.map(i=>ht.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),lBt=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:i,to:r}=n.main,s=[],o=0;for(let l=new v1(e.doc,e.sliceDoc(i,r));!l.next().done;){if(s.length>1e3)return!1;l.value.from==i&&(o=s.length),s.push(ht.range(l.value.from,l.value.to))}return t(e.update({selection:ht.create(s,o),userEvent:"select.search.matches"})),!0},Qse=DT((e,{query:t})=>{let{state:n}=e,{from:i,to:r}=n.selection.main;if(n.readOnly)return!1;let s=t.nextMatch(n,i,i);if(!s)return!1;let o=s,l=[],c,u,d=[];o.precise?o.from==i&&o.to==r&&(u=n.toText(t.getReplacement(o)),l.push({from:o.from,to:o.to,insert:u}),o=t.nextMatch(n,o.from,o.to),d.push(Jt.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(i).number)+"."))):o=t.nextMatch(n,o.from,o.to);let f=e.state.changes(l);return o&&(c=ht.single(o.from,o.to).map(f),d.push($W(e,o)),d.push(n.facet(bO).scrollToMatch(c.main,e))),e.dispatch({changes:f,selection:c,effects:d,userEvent:"input.replace"}),!0}),cBt=DT((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let r of t.matchAll(e.state,1e9)){let{from:s,to:o,precise:l}=r;l&&n.push({from:s,to:o,insert:t.getReplacement(r)})}if(!n.length)return!1;let i=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:Jt.announce.of(i),userEvent:"input.replace.all"}),!0});function LW(e){return e.state.facet(bO).createPanel(e)}function E7(e,t){var n,i,r,s,o;let l=e.selection.main,c=l.empty||l.to>l.from+100?"":e.sliceDoc(l.from,l.to);if(t&&!c)return t;let u=e.facet(bO);return new lFe({search:((n=t==null?void 0:t.literal)!==null&&n!==void 0?n:u.literal)?c:c.replace(/\n/g,"\\n"),caseSensitive:(i=t==null?void 0:t.caseSensitive)!==null&&i!==void 0?i:u.caseSensitive,literal:(r=t==null?void 0:t.literal)!==null&&r!==void 0?r:u.literal,regexp:(s=t==null?void 0:t.regexp)!==null&&s!==void 0?s:u.regexp,wholeWord:(o=t==null?void 0:t.wholeWord)!==null&&o!==void 0?o:u.wholeWord})}function uFe(e){let t=eW(e,LW);return t&&t.dom.querySelector("[main-field]")}function dFe(e){let t=uFe(e);t&&t==e.root.activeElement&&t.select()}const fFe=e=>{let t=e.state.field(Fg,!1);if(t&&t.panel){let n=uFe(e);if(n&&n!=e.root.activeElement){let i=E7(e.state,t.query.spec);i.valid&&e.dispatch({effects:JC.of(i)}),n.focus(),n.select()}}else e.dispatch({effects:[MW.of(!0),t?JC.of(E7(e.state,t.query.spec)):pi.appendConfig.of(hBt)]});return!0},hFe=e=>{let t=e.state.field(Fg,!1);if(!t||!t.panel)return!1;let n=eW(e,LW);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:MW.of(!1)}),!0},uBt=[{key:"Mod-f",run:fFe,scope:"editor search-panel"},{key:"F3",run:gP,shift:bP,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:gP,shift:bP,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:hFe,scope:"editor search-panel"},{key:"Mod-Shift-l",run:lBt},{key:"Mod-Alt-g",run:B8t},{key:"Mod-d",run:Y8t,preventDefault:!0}];class dBt{constructor(t){this.view=t;let n=this.query=t.state.field(Fg).query.spec;this.commit=this.commit.bind(this),this.searchField=Kr("input",{value:n.search,placeholder:ru(t,"Find"),"aria-label":ru(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Kr("input",{value:n.replace,placeholder:ru(t,"Replace"),"aria-label":ru(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Kr("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=Kr("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=Kr("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function i(r,s,o){return Kr("button",{class:"cm-button",name:r,onclick:s,type:"button"},o)}this.dom=Kr("div",{onkeydown:r=>this.keydown(r),class:"cm-search"},[this.searchField,i("next",()=>gP(t),[ru(t,"next")]),i("prev",()=>bP(t),[ru(t,"previous")]),i("select",()=>oBt(t),[ru(t,"all")]),Kr("label",null,[this.caseField,ru(t,"match case")]),Kr("label",null,[this.reField,ru(t,"regexp")]),Kr("label",null,[this.wordField,ru(t,"by word")]),...t.state.readOnly?[]:[Kr("br"),this.replaceField,i("replace",()=>Qse(t),[ru(t,"replace")]),i("replaceAll",()=>cBt(t),[ru(t,"replace all")])],Kr("button",{name:"close",onclick:()=>hFe(t),"aria-label":ru(t,"close"),type:"button"},["×"])])}commit(){let t=new lFe({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:JC.of(t)}))}keydown(t){aDt(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?bP:gP)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),Qse(this.view))}update(t){for(let n of t.transactions)for(let i of n.effects)i.is(JC)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(bO).top}}function ru(e,t){return e.state.phrase(t)}const lj=30,cj=/[\s\.,:;?!]/;function $W(e,{from:t,to:n}){let i=e.state.doc.lineAt(t),r=e.state.doc.lineAt(n).to,s=Math.max(i.from,t-lj),o=Math.min(r,n+lj),l=e.state.sliceDoc(s,o);if(s!=i.from){for(let c=0;cl.length-lj;c--)if(!cj.test(l[c-1])&&cj.test(l[c])){l=l.slice(0,c);break}}return Jt.announce.of(`${e.state.phrase("current match")}. ${l} ${e.state.phrase("on line")} ${i.number}.`)}const fBt=Jt.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),hBt=[Fg,gm.low(aBt),fBt];class zse{constructor(t,n,i){this.from=t,this.to=n,this.diagnostic=i}}class Sy{constructor(t,n,i){this.diagnostics=t,this.panel=n,this.selected=i}static init(t,n,i){let r=i.facet(eA).markerFilter;r&&(t=r(t,i));let s=t.slice().sort((m,g)=>m.from-g.from||m.to-g.to),o=new tm,l=[],c=0,u=i.doc.iter(),d=0,f=i.doc.length;for(let m=0;;){let g=m==s.length?null:s[m];if(!g&&!l.length)break;let b,v;if(l.length)b=c,v=l.reduce((x,O)=>Math.min(x,O.to),g&&g.from>b?g.from:1e8);else{if(b=g.from,b>f)break;v=g.to,l.push(g),m++}for(;mx.from||x.to==b))l.push(x),m++,v=Math.min(x.to,v);else{v=Math.min(x.from,v);break}}v=Math.min(v,f);let y=!1;if(l.some(x=>x.from==b&&(x.to==v||v==f))&&(y=b==v,!y&&v-b<10)){let x=b-(d+u.value.length);x>0&&(u.next(x),d=b);for(let O=b;;){if(O>=v){y=!0;break}if(!u.lineBreak&&d+u.value.length>O)break;O=d+u.value.length,d+=u.value.length,u.next()}}let w=CBt(l);if(y)o.add(b,b,Fn.widget({widget:new OBt(w),diagnostics:l.slice()}));else{let x=l.reduce((O,k)=>k.markClass?O+" "+k.markClass:O,"");o.add(b,v,Fn.mark({class:"cm-lintRange cm-lintRange-"+w+x,diagnostics:l.slice(),inclusiveEnd:l.some(O=>O.to>v)}))}if(c=v,c==f)break;for(let x=0;x{if(!(t&&o.diagnostics.indexOf(t)<0))if(!i)i=new zse(r,s,t||o.diagnostics[0]);else{if(o.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new zse(i.from,s,i.diagnostic)}}),i}function pBt(e,t){let n=t.pos,i=t.end||n,r=e.state.facet(eA).hideOn(e,n,i);if(r!=null)return r;let s=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(o=>o.is(pFe))||e.changes.touchesRange(s.from,Math.max(s.to,i)))}function mBt(e,t){return e.field(ku,!1)?t:t.concat(pi.appendConfig.of(ABt))}const pFe=pi.define(),FW=pi.define(),mFe=pi.define(),ku=dl.define({create(){return new Sy(Fn.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),i=null,r=e.panel;if(e.selected){let s=t.changes.mapPos(e.selected.from,1);i=yb(n,e.selected.diagnostic,s)||yb(n,null,s)}!n.size&&r&&t.state.facet(eA).autoPanel&&(r=null),e=new Sy(n,r,i)}for(let n of t.effects)if(n.is(pFe)){let i=t.state.facet(eA).autoPanel?n.value.length?tA.open:null:e.panel;e=Sy.init(n.value,i,t.state)}else n.is(FW)?e=new Sy(e.diagnostics,n.value?tA.open:null,e.selected):n.is(mFe)&&(e=new Sy(e.diagnostics,e.panel,n.value));return e},provide:e=>[BC.from(e,t=>t.panel),Jt.decorations.from(e,t=>t.diagnostics)]}),gBt=Fn.mark({class:"cm-lintRange cm-lintRange-active"});function bBt(e,t,n){let{diagnostics:i}=e.state.field(ku),r,s=-1,o=-1;i.between(t-(n<0?1:0),t+(n>0?1:0),(c,u,{spec:d})=>{if(t>=c&&t<=u&&(c==u||(t>c||n>0)&&(tbFe(e,n,!1)))}const vBt=e=>{let t=e.state.field(ku,!1);(!t||!t.panel)&&e.dispatch({effects:mBt(e.state,[FW.of(!0)])});let n=eW(e,tA.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},Vse=e=>{let t=e.state.field(ku,!1);return!t||!t.panel?!1:(e.dispatch({effects:FW.of(!1)}),!0)},xBt=e=>{let t=e.state.field(ku,!1);if(!t)return!1;let n=e.state.selection.main,i=yb(t.diagnostics,null,n.to+1);return!i&&(i=yb(t.diagnostics,null,0),!i||i.from==n.from&&i.to==n.to)?!1:(e.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),GDt(e,i.from,1,{tooltip:yFe,until:r=>r.docChanged||r.newSelection.main.headi.to}),!0)},wBt=[{key:"Mod-Shift-m",run:vBt,preventDefault:!0},{key:"F8",run:xBt}],eA=mn.define({combine(e){return{sources:e.map(t=>t.source).filter(t=>t!=null),...Ih(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:Hse,tooltipFilter:Hse,needsRefresh:(t,n)=>t?n?i=>t(i)||n(i):t:n,hideOn:(t,n)=>t?n?(i,r,s)=>t(i,r,s)||n(i,r,s):t:n,autoPanel:(t,n)=>t||n})}}});function Hse(e,t){return e?t?(n,i)=>t(e(n,i),i):e:t}function gFe(e){let t=[];if(e)e:for(let{name:n}of e){for(let i=0;is.toLowerCase()==r.toLowerCase())){t.push(r);continue e}}t.push("")}return t}function bFe(e,t,n){var i;let r=n?gFe(t.actions):[];return Kr("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},Kr("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),(i=t.actions)===null||i===void 0?void 0:i.map((s,o)=>{let l=!1,c=m=>{if(m.preventDefault(),l)return;l=!0;let g=yb(e.state.field(ku).diagnostics,t);g&&s.apply(e,g.from,g.to)},{name:u}=s,d=r[o]?u.indexOf(r[o]):-1,f=d<0?u:[u.slice(0,d),Kr("u",u.slice(d,d+1)),u.slice(d+1)],h=s.markClass?" "+s.markClass:"";return Kr("button",{type:"button",class:"cm-diagnosticAction"+h,onclick:c,onmousedown:c,"aria-label":` Action: ${u}${d<0?"":` (access key "${r[o]})"`}.`},f)}),t.source&&Kr("div",{class:"cm-diagnosticSource"},t.source))}class OBt extends jf{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return Kr("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class qse{constructor(t,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=bFe(t,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class tA{constructor(t){this.view=t,this.items=[];let n=r=>{if(!(r.ctrlKey||r.altKey||r.metaKey)){if(r.keyCode==27)Vse(this.view),this.view.focus();else if(r.keyCode==38||r.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(r.keyCode==40||r.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(r.keyCode==36)this.moveSelection(0);else if(r.keyCode==35)this.moveSelection(this.items.length-1);else if(r.keyCode==13)this.view.focus();else if(r.keyCode>=65&&r.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],o=gFe(s.actions);for(let l=0;l{for(let s=0;sVse(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(ku).selected;if(!t)return-1;for(let n=0;n{for(let d of u.diagnostics){if(o.has(d))continue;o.add(d);let f=-1,h;for(let m=i;mi&&(this.items.splice(i,f-i),r=!0)),n&&h.diagnostic==n.diagnostic?h.dom.hasAttribute("aria-selected")||(h.dom.setAttribute("aria-selected","true"),s=h):h.dom.hasAttribute("aria-selected")&&h.dom.removeAttribute("aria-selected"),i++}});i({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:c})=>{let u=c.height/this.list.offsetHeight;l.topc.bottom&&(this.list.scrollTop+=(l.bottom-c.bottom)/u)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let t=this.list.firstChild;function n(){let i=t;t=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;t!=i.dom;)n();t=i.dom.nextSibling}else this.list.insertBefore(i.dom,t);for(;t;)n()}moveSelection(t){if(this.selectedIndex<0)return;let n=this.view.state.field(ku),i=yb(n.diagnostics,this.items[t].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:mFe.of(i)})}static open(t){return new tA(t)}}function kBt(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(e)}')`}function uj(e){return kBt(``,'width="6" height="3"')}const SBt=Jt.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:uj("#f11")},".cm-lintRange-warning":{backgroundImage:uj("orange")},".cm-lintRange-info":{backgroundImage:uj("#999")},".cm-lintRange-hint":{backgroundImage:uj("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function EBt(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}function CBt(e){let t="hint",n=1;for(let i of e){let r=EBt(i.severity);r>n&&(n=r,t=i.severity)}return t}const yFe=KDt(bBt,{hideOn:pBt}),ABt=[ku,Jt.decorations.compute([ku],e=>{let{selected:t,panel:n}=e.field(ku);return!t||!n||t.from==t.to?Fn.none:Fn.set([gBt.range(t.from,t.to)])}),yFe,SBt];var Wse=function(t){t===void 0&&(t={});var n=t,i=n.crosshairCursor,r=i===void 0?!1:i,s=[];t.closeBracketsKeymap!==!1&&(s=s.concat(P5t)),t.defaultKeymap!==!1&&(s=s.concat(L8t)),t.searchKeymap!==!1&&(s=s.concat(uBt)),t.historyKeymap!==!1&&(s=s.concat(VFt)),t.foldKeymap!==!1&&(s=s.concat($Mt)),t.completionKeymap!==!1&&(s=s.concat(X4e)),t.lintKeymap!==!1&&(s=s.concat(wBt));var o=[];return t.lineNumbers!==!1&&o.push(h4e()),t.highlightActiveLineGutter!==!1&&o.push(uMt()),t.highlightSpecialChars!==!1&&o.push(kDt()),t.history!==!1&&o.push(DFt()),t.foldGutter!==!1&&o.push(QMt()),t.drawSelection!==!1&&o.push(fDt()),t.dropCursor!==!1&&o.push(bDt()),t.allowMultipleSelections!==!1&&o.push(tr.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&o.push(jMt()),t.syntaxHighlighting!==!1&&o.push(T4e(qMt,{fallback:!0})),t.bracketMatching!==!1&&o.push(JMt()),t.closeBrackets!==!1&&o.push(j5t()),t.autocompletion!==!1&&o.push(U5t()),t.rectangularSelection!==!1&&o.push(LDt()),r!==!1&&o.push(BDt()),t.highlightActiveLine!==!1&&o.push(_Dt()),t.highlightSelectionMatches!==!1&&o.push(z8t()),t.tabSize&&typeof t.tabSize=="number"&&o.push(pO.of(" ".repeat(t.tabSize))),o.concat([hO.of(s.flat())]).filter(Boolean)};const TBt="#e5c07b",Kse="#e06c75",_Bt="#56b6c2",jBt="#ffffff",GN="#abb2bf",C7="#7d8799",NBt="#61afef",RBt="#98c379",Gse="#d19a66",IBt="#c678dd",PBt="#21252b",Xse="#2c313a",Yse="#282c34",U$="#353a42",DBt="#3E4451",Zse="#528bff",MBt=Jt.theme({"&":{color:GN,backgroundColor:Yse},".cm-content":{caretColor:Zse},".cm-cursor, .cm-dropCursor":{borderLeftColor:Zse},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:DBt},".cm-panels":{backgroundColor:PBt,color:GN},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:Yse,color:C7,border:"none"},".cm-activeLineGutter":{backgroundColor:Xse},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:U$},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:U$,borderBottomColor:U$},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Xse,color:GN}}},{dark:!0}),LBt=RT.define([{tag:fe.keyword,color:IBt},{tag:[fe.name,fe.deleted,fe.character,fe.propertyName,fe.macroName],color:Kse},{tag:[fe.function(fe.variableName),fe.labelName],color:NBt},{tag:[fe.color,fe.constant(fe.name),fe.standard(fe.name)],color:Gse},{tag:[fe.definition(fe.name),fe.separator],color:GN},{tag:[fe.typeName,fe.className,fe.number,fe.changed,fe.annotation,fe.modifier,fe.self,fe.namespace],color:TBt},{tag:[fe.operator,fe.operatorKeyword,fe.url,fe.escape,fe.regexp,fe.link,fe.special(fe.string)],color:_Bt},{tag:[fe.meta,fe.comment],color:C7},{tag:fe.strong,fontWeight:"bold"},{tag:fe.emphasis,fontStyle:"italic"},{tag:fe.strikethrough,textDecoration:"line-through"},{tag:fe.link,color:C7,textDecoration:"underline"},{tag:fe.heading,fontWeight:"bold",color:Kse},{tag:[fe.atom,fe.bool,fe.special(fe.variableName)],color:Gse},{tag:[fe.processingInstruction,fe.string,fe.inserted],color:RBt},{tag:fe.invalid,color:jBt}]),$Bt=[MBt,T4e(LBt)];var FBt=Jt.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),BBt=function(t){t===void 0&&(t={});var n=t,i=n.indentWithTab,r=i===void 0?!0:i,s=n.editable,o=s===void 0?!0:s,l=n.readOnly,c=l===void 0?!1:l,u=n.theme,d=u===void 0?"light":u,f=n.placeholder,h=f===void 0?"":f,m=n.basicSetup,g=m===void 0?!0:m,b=[];switch(r&&b.unshift(hO.of([$8t])),g&&(typeof g=="boolean"?b.unshift(Wse()):b.unshift(Wse(g))),h&&b.unshift(IDt(h)),d){case"light":b.push(FBt);break;case"dark":b.push($Bt);break;case"none":break;default:b.push(d);break}return o===!1&&b.push(Jt.editable.of(!1)),c&&b.push(tr.readOnly.of(!0)),[...b]},UBt=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(t=>!t.empty)});class QBt{constructor(t,n){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=n,this.timeoutMS=n,this.callbacks.push(t)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var t=this.callbacks.slice();this.callbacks.length=0,t.forEach(n=>{try{n()}catch(i){console.error("TimeoutLatch callback error:",i)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class Jse{constructor(){this.interval=null,this.latches=new Set}add(t){this.latches.add(t),this.start()}remove(t){this.latches.delete(t),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(t=>{t.tick(),t.isDone&&this.remove(t)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}}var Q$=null,zBt=()=>typeof window>"u"?new Jse:(Q$||(Q$=new Jse),Q$),VBt=Jt.theme({"& .cm-scroller":{height:"100% !important"}}),eae=null,z$=null;function HBt(e,t,n,i,r,s){if(!e&&!t&&!n&&!i&&!r&&!s)return null;var o=JSON.stringify({height:e,minHeight:t,maxHeight:n,width:i,minWidth:r,maxWidth:s});return o===eae||(eae=o,z$=Jt.theme({"&":{height:e,minHeight:t,maxHeight:n,width:i,minWidth:r,maxWidth:s}})),z$}var tae=Rh.define(),qBt=200,WBt=[];function KBt(e){var t=e.value,n=e.selection,i=e.onChange,r=e.onStatistics,s=e.onCreateEditor,o=e.onUpdate,l=e.extensions,c=l===void 0?WBt:l,u=e.autoFocus,d=e.theme,f=d===void 0?"light":d,h=e.height,m=h===void 0?null:h,g=e.minHeight,b=g===void 0?null:g,v=e.maxHeight,y=v===void 0?null:v,w=e.width,x=w===void 0?null:w,O=e.minWidth,k=O===void 0?null:O,S=e.maxWidth,C=S===void 0?null:S,E=e.placeholder,j=E===void 0?"":E,T=e.editable,R=T===void 0?!0:T,A=e.readOnly,N=A===void 0?!1:A,P=e.indentWithTab,I=P===void 0?!0:P,D=e.basicSetup,_=D===void 0?!0:D,L=e.root,F=e.initialState,M=p.useState(),V=M[0],q=M[1],U=p.useState(),J=U[0],z=U[1],Z=p.useState(),ne=Z[0],W=Z[1],G=p.useState(()=>({current:null}))[0],H=p.useState(()=>({current:null}))[0],se=HBt(m,b,y,x,k,C),Y=Jt.updateListener.of(ee=>{if(ee.docChanged&&typeof i=="function"&&!ee.transactions.some(pe=>pe.annotation(tae))){G.current?G.current.reset():(G.current=new QBt(()=>{if(H.current){var pe=H.current;H.current=null,pe()}G.current=null},qBt),zBt().add(G.current));var be=ee.state.doc,ue=be.toString();i(ue,ee)}r&&r(UBt(ee))}),X=BBt({theme:f,editable:R,readOnly:N,placeholder:j,indentWithTab:I,basicSetup:_}),ie=[Y,...se?[se]:[],VBt,...X];return o&&typeof o=="function"&&ie.push(Jt.updateListener.of(o)),ie=ie.concat(c),p.useLayoutEffect(()=>{if(V&&!ne){var ee={doc:t,selection:n,extensions:ie},be=F?tr.fromJSON(F.json,ee,F.fields):tr.create(ee);if(W(be),!J){var ue=new Jt({state:be,parent:V,root:L});z(ue),s&&s(ue,be)}}return()=>{J&&(W(void 0),z(void 0))}},[V,ne]),p.useEffect(()=>{e.container&&q(e.container)},[e.container]),p.useEffect(()=>()=>{J&&(J.destroy(),z(void 0)),G.current&&(G.current.cancel(),G.current=null)},[J]),p.useEffect(()=>{u&&J&&J.focus()},[u,J]),p.useEffect(()=>{J&&J.dispatch({effects:pi.reconfigure.of(ie)})},[f,c,m,b,y,x,k,C,j,R,N,I,_,i,o]),p.useEffect(()=>{if(t!==void 0){var ee=J?J.state.doc.toString():"";if(J&&t!==ee){var be=G.current&&!G.current.isDone,ue=()=>{J&&t!==J.state.doc.toString()&&J.dispatch({changes:{from:0,to:J.state.doc.toString().length,insert:t||""},annotations:[tae.of(!0)]})};be?H.current=ue:ue()}}},[t,J]),{state:ne,setState:W,view:J,setView:z,container:V,setContainer:q}}var GBt=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],vFe=p.forwardRef((e,t)=>{var n=e.className,i=e.value,r=i===void 0?"":i,s=e.selection,o=e.extensions,l=o===void 0?[]:o,c=e.onChange,u=e.onStatistics,d=e.onCreateEditor,f=e.onUpdate,h=e.autoFocus,m=e.theme,g=m===void 0?"light":m,b=e.height,v=e.minHeight,y=e.maxHeight,w=e.width,x=e.minWidth,O=e.maxWidth,k=e.basicSetup,S=e.placeholder,C=e.indentWithTab,E=e.editable,j=e.readOnly,T=e.root,R=e.initialState,A=EFt(e,GBt),N=p.useRef(null),P=KBt({root:T,value:r,autoFocus:h,theme:g,height:b,minHeight:v,maxHeight:y,width:w,minWidth:x,maxWidth:O,basicSetup:k,placeholder:S,indentWithTab:C,editable:E,readOnly:j,selection:s,onChange:c,onStatistics:u,onCreateEditor:d,onUpdate:f,extensions:l,initialState:R}),I=P.state,D=P.view,_=P.container,L=P.setContainer;p.useImperativeHandle(t,()=>({editor:N.current,state:I,view:D}),[N,_,I,D]);var F=p.useCallback(V=>{N.current=V,L(V)},[L]);if(typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var M=typeof g=="string"?"cm-theme-"+g:"cm-theme";return a.jsx("div",x7({ref:F,className:""+M+(n?" "+n:"")},A))});vFe.displayName="CodeMirror";function xFe(e){const t=e.toLowerCase(),n=t.split("/").pop()??t,i=n.includes(".")?n.split(".").pop():"";return n==="dockerfile"||n.startsWith("dockerfile.")||n.endsWith(".dockerfile")?[rW.define(SFt)]:i==="py"||i==="pyi"?[P6t()]:["ts","tsx","mts","cts"].includes(i??"")?[o7({typescript:!0,jsx:i==="tsx"})]:["js","jsx","mjs","cjs"].includes(i??"")?[o7({jsx:i==="jsx"})]:i==="json"||i==="jsonc"?[e3t()]:i==="yaml"||i==="yml"?[uFt()]:["md","markdown"].includes(i??"")?[p$t()]:[]}function MT({value:e,path:t,onChange:n,readOnly:i=!1,theme:r="light",lineNumberStart:s=1,height:o="100%",minHeight:l,maxHeight:c,extensions:u}){const d=p.useMemo(()=>[...xFe(t),...s===1?[]:[h4e({formatNumber:f=>String(f+s-1)})],...u??[]],[s,t,u]);return a.jsx(vFe,{value:e,height:o,minHeight:l,maxHeight:c,theme:r,extensions:d,editable:!i,onChange:n,basicSetup:{lineNumbers:s===1,foldGutter:!0,highlightActiveLine:!0,highlightActiveLineGutter:!0,autocompletion:!1}})}const wFe=Object.freeze(Object.defineProperty({__proto__:null,default:MT,languageFor:xFe},Symbol.toStringTag,{value:"Module"}));function XBt(e){var s;const t=e.split(/\r?\n/);if(((s=t[0])==null?void 0:s.trim())!=="---")return{body:e,frontmatter:[]};const n=t.findIndex((o,l)=>l>0&&o.trim()==="---");if(n<0)return{body:e,frontmatter:[]};const i=M5e(t.slice(1,n).join(` `));if(i.errors.length>0)return{body:e,frontmatter:[]};const r=i.toJS();return!r||typeof r!="object"||Array.isArray(r)?{body:e,frontmatter:[]}:{body:t.slice(n+1).join(` -`).replace(/^\s*\n/,""),frontmatter:Object.entries(r).map(([o,l])=>({key:o,value:typeof l=="string"?l:HM(l).trim()}))}}function YBt(){return a.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M2.75 5.5h5l1.5 1.75h8v7.25a1.75 1.75 0 0 1-1.75 1.75h-11a1.75 1.75 0 0 1-1.75-1.75v-9Z"})})}function ZBt(){return a.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[a.jsx("path",{d:"M5 2.75h6l4 4v10.5H5z"}),a.jsx("path",{d:"M11 2.75v4h4"})]})}function JBt(e){const t={children:[]};for(const i of e){let r=t;const s=i.path.split("/").filter(Boolean);s.forEach((o,l)=>{let c=r.children.find(u=>u.name===o);if(!c){const u=s.slice(0,l+1).join("/");c={name:o,path:u,children:[]},r.children.push(c)}l===s.length-1&&(c.file=i),r=c})}const n=i=>{i.sort((r,s)=>+!!r.file-+!!s.file||r.name.localeCompare(s.name)),i.forEach(r=>n(r.children))};return n(t.children),t.children}function OFe({nodes:e,depth:t,activePath:n,onSelect:i}){return e.map(r=>a.jsxs("div",{children:[r.file?a.jsxs("button",{type:"button",className:`skill-file-tree__row${r.path===n?" is-active":""}`,style:{paddingLeft:`${12+t*16}px`},onClick:()=>i(r.file),title:r.path,children:[a.jsx(ZBt,{}),a.jsx("span",{children:r.name}),a.jsxs("small",{children:[r.file.size.toLocaleString()," B"]})]}):a.jsxs("div",{className:"skill-file-tree__row is-folder",style:{paddingLeft:`${12+t*16}px`},title:r.path,children:[a.jsx(YBt,{}),a.jsx("span",{children:r.name})]}),r.children.length>0?a.jsx(OFe,{nodes:r.children,depth:t+1,activePath:n,onSelect:i}):null]},r.path))}function e9t(e){if(e.content===void 0)return;if(e.content.startsWith("data:")){const i=document.createElement("a");i.href=e.content,i.download=e.path.split("/").pop()||"skill-file",i.click();return}const t=URL.createObjectURL(new Blob([e.content])),n=document.createElement("a");n.href=t,n.download=e.path.split("/").pop()||"skill-file",n.click(),URL.revokeObjectURL(t)}function dL({files:e}){var m;const{t,i18n:n}=Te("skills"),i=p.useMemo(()=>JBt(e),[e]),[r,s]=p.useState(((m=e[0])==null?void 0:m.path)||""),[o,l]=p.useState("preview"),c=e.find(g=>g.path===r)||e[0],u=(c==null?void 0:c.path.toLowerCase())||"",d=u.endsWith(".md")||u.endsWith(".markdown"),f=/\.(png|jpe?g|gif|webp|svg)$/.test(u),h=p.useMemo(()=>XBt(d&&(c==null?void 0:c.content)!==void 0?c.content:""),[c==null?void 0:c.content,d]);return a.jsxs("div",{className:"skill-file-browser",children:[a.jsx("aside",{className:"skill-file-tree","aria-label":t("fileTree.ariaLabel"),children:a.jsx(OFe,{nodes:i,depth:0,activePath:(c==null?void 0:c.path)||"",onSelect:g=>s(g.path)})}),a.jsx("section",{className:"skill-file-preview",children:c?a.jsxs(a.Fragment,{children:[a.jsxs("header",{children:[a.jsx("span",{title:c.path,children:c.path}),a.jsxs("div",{children:[d?a.jsx("button",{type:"button",onClick:()=>l(g=>g==="preview"?"source":"preview"),children:t(o==="preview"?"fileTree.viewSource":"fileTree.viewPreview")}):null,a.jsx("button",{type:"button",disabled:c.content===void 0,onClick:()=>e9t(c),children:t("fileTree.download")})]})]}),a.jsx("div",{className:"skill-file-preview__body",children:c.kind==="binary"||c.content===void 0?a.jsxs("div",{className:"skill-file-preview__binary",children:[a.jsx("strong",{children:t("fileTree.binaryFile")}),a.jsx("span",{children:t("fileTree.bytes",{value:new Intl.NumberFormat(n.resolvedLanguage).format(c.size)})}),a.jsx("span",{children:t("fileTree.binaryDescription")})]}):f?a.jsx("img",{src:c.content.startsWith("data:")?c.content:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(c.content)}`,alt:c.path}):d&&o==="preview"?a.jsxs("div",{className:"skill-file-preview__markdown",children:[h.frontmatter.length>0?a.jsx("dl",{className:"skill-file-preview__frontmatter","aria-label":t("fileTree.metadata"),children:h.frontmatter.map(g=>a.jsxs("div",{children:[a.jsx("dt",{children:g.key}),a.jsx("dd",{children:g.value})]},g.key))}):null,a.jsx(_d,{text:h.body,allowRawHtml:!1,className:"skill-file-preview__markdown-body"})]}):a.jsx(NT,{value:c.content,path:c.path,readOnly:!0,onChange:()=>{}})})]}):a.jsx("div",{className:"skill-file-preview__binary",children:t("fileTree.noFiles")})})]})}const t9t=Object.freeze(Object.defineProperty({__proto__:null,SkillFileTree:dL},Symbol.toStringTag,{value:"Module"})),n9t=1200,i9t=3,kFe=2,r9t=/SKILL\.md|frontmatter|Skill name|description|根目录|目录名|UTF-8|文本文件|文件数|符号链接|敏感凭证/i,nae={concise:"generation.styles.concise",strict:"generation.styles.strict",tutorial:"generation.styles.tutorial",automation:"generation.styles.automation"};function iae(e,t){var n;return{id:`group-${Date.now()}-${e}`,model:((n=t.models[e%Math.max(1,t.models.length)])==null?void 0:n.id)||"",style:"concise",customStyle:""}}function s9t(e){return e?e.state==="ready"?tn("generation.stages.ready"):e.state==="failed"?tn("generation.stages.failed"):e.state==="cancelled"?tn("generation.stages.cancelled"):e.stage==="validating"?tn("generation.stages.validating"):e.stage==="packaging"?tn("generation.stages.packaging"):tn("generation.stages.generating"):tn("generation.stages.preparing")}function V$(e){var t;return e.state==="failed"&&((t=e.validation)==null?void 0:t.valid)===!1&&e.validation.errors.some(n=>r9t.test(n))}function rae(e){var n;const t=((n=e.validation)==null?void 0:n.errors.join(` -`))||e.error||tn("generation.validation.fallback");return[tn("generation.validation.repairInstruction"),tn("generation.validation.recheckInstruction"),t.slice(0,2e3)].join(` +`).replace(/^\s*\n/,""),frontmatter:Object.entries(r).map(([o,l])=>({key:o,value:typeof l=="string"?l:qM(l).trim()}))}}function YBt(){return a.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M2.75 5.5h5l1.5 1.75h8v7.25a1.75 1.75 0 0 1-1.75 1.75h-11a1.75 1.75 0 0 1-1.75-1.75v-9Z"})})}function ZBt(){return a.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[a.jsx("path",{d:"M5 2.75h6l4 4v10.5H5z"}),a.jsx("path",{d:"M11 2.75v4h4"})]})}function JBt(e){const t={children:[]};for(const i of e){let r=t;const s=i.path.split("/").filter(Boolean);s.forEach((o,l)=>{let c=r.children.find(u=>u.name===o);if(!c){const u=s.slice(0,l+1).join("/");c={name:o,path:u,children:[]},r.children.push(c)}l===s.length-1&&(c.file=i),r=c})}const n=i=>{i.sort((r,s)=>+!!r.file-+!!s.file||r.name.localeCompare(s.name)),i.forEach(r=>n(r.children))};return n(t.children),t.children}function OFe({nodes:e,depth:t,activePath:n,onSelect:i}){return e.map(r=>a.jsxs("div",{children:[r.file?a.jsxs("button",{type:"button",className:`skill-file-tree__row${r.path===n?" is-active":""}`,style:{paddingLeft:`${12+t*16}px`},onClick:()=>i(r.file),title:r.path,children:[a.jsx(ZBt,{}),a.jsx("span",{children:r.name}),a.jsxs("small",{children:[r.file.size.toLocaleString()," B"]})]}):a.jsxs("div",{className:"skill-file-tree__row is-folder",style:{paddingLeft:`${12+t*16}px`},title:r.path,children:[a.jsx(YBt,{}),a.jsx("span",{children:r.name})]}),r.children.length>0?a.jsx(OFe,{nodes:r.children,depth:t+1,activePath:n,onSelect:i}):null]},r.path))}function e9t(e){if(e.content===void 0)return;if(e.content.startsWith("data:")){const i=document.createElement("a");i.href=e.content,i.download=e.path.split("/").pop()||"skill-file",i.click();return}const t=URL.createObjectURL(new Blob([e.content])),n=document.createElement("a");n.href=t,n.download=e.path.split("/").pop()||"skill-file",n.click(),URL.revokeObjectURL(t)}function fL({files:e}){var m;const{t,i18n:n}=Te("skills"),i=p.useMemo(()=>JBt(e),[e]),[r,s]=p.useState(((m=e[0])==null?void 0:m.path)||""),[o,l]=p.useState("preview"),c=e.find(g=>g.path===r)||e[0],u=(c==null?void 0:c.path.toLowerCase())||"",d=u.endsWith(".md")||u.endsWith(".markdown"),f=/\.(png|jpe?g|gif|webp|svg)$/.test(u),h=p.useMemo(()=>XBt(d&&(c==null?void 0:c.content)!==void 0?c.content:""),[c==null?void 0:c.content,d]);return a.jsxs("div",{className:"skill-file-browser",children:[a.jsx("aside",{className:"skill-file-tree","aria-label":t("fileTree.ariaLabel"),children:a.jsx(OFe,{nodes:i,depth:0,activePath:(c==null?void 0:c.path)||"",onSelect:g=>s(g.path)})}),a.jsx("section",{className:"skill-file-preview",children:c?a.jsxs(a.Fragment,{children:[a.jsxs("header",{children:[a.jsx("span",{title:c.path,children:c.path}),a.jsxs("div",{children:[d?a.jsx("button",{type:"button",onClick:()=>l(g=>g==="preview"?"source":"preview"),children:t(o==="preview"?"fileTree.viewSource":"fileTree.viewPreview")}):null,a.jsx("button",{type:"button",disabled:c.content===void 0,onClick:()=>e9t(c),children:t("fileTree.download")})]})]}),a.jsx("div",{className:"skill-file-preview__body",children:c.kind==="binary"||c.content===void 0?a.jsxs("div",{className:"skill-file-preview__binary",children:[a.jsx("strong",{children:t("fileTree.binaryFile")}),a.jsx("span",{children:t("fileTree.bytes",{value:new Intl.NumberFormat(n.resolvedLanguage).format(c.size)})}),a.jsx("span",{children:t("fileTree.binaryDescription")})]}):f?a.jsx("img",{src:c.content.startsWith("data:")?c.content:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(c.content)}`,alt:c.path}):d&&o==="preview"?a.jsxs("div",{className:"skill-file-preview__markdown",children:[h.frontmatter.length>0?a.jsx("dl",{className:"skill-file-preview__frontmatter","aria-label":t("fileTree.metadata"),children:h.frontmatter.map(g=>a.jsxs("div",{children:[a.jsx("dt",{children:g.key}),a.jsx("dd",{children:g.value})]},g.key))}):null,a.jsx(Td,{text:h.body,allowRawHtml:!1,className:"skill-file-preview__markdown-body"})]}):a.jsx(MT,{value:c.content,path:c.path,readOnly:!0,onChange:()=>{}})})]}):a.jsx("div",{className:"skill-file-preview__binary",children:t("fileTree.noFiles")})})]})}const t9t=Object.freeze(Object.defineProperty({__proto__:null,SkillFileTree:fL},Symbol.toStringTag,{value:"Module"})),n9t=1200,i9t=3,kFe=2,r9t=/SKILL\.md|frontmatter|Skill name|description|根目录|目录名|UTF-8|文本文件|文件数|符号链接|敏感凭证/i,nae={concise:"generation.styles.concise",strict:"generation.styles.strict",tutorial:"generation.styles.tutorial",automation:"generation.styles.automation"};function iae(e,t){var n;return{id:`group-${Date.now()}-${e}`,model:((n=t.models[e%Math.max(1,t.models.length)])==null?void 0:n.id)||"",style:"concise",customStyle:""}}function s9t(e){return e?e.state==="ready"?en("generation.stages.ready"):e.state==="failed"?en("generation.stages.failed"):e.state==="cancelled"?en("generation.stages.cancelled"):e.stage==="validating"?en("generation.stages.validating"):e.stage==="packaging"?en("generation.stages.packaging"):en("generation.stages.generating"):en("generation.stages.preparing")}function V$(e){var t;return e.state==="failed"&&((t=e.validation)==null?void 0:t.valid)===!1&&e.validation.errors.some(n=>r9t.test(n))}function rae(e){var n;const t=((n=e.validation)==null?void 0:n.errors.join(` +`))||e.error||en("generation.validation.fallback");return[en("generation.validation.repairInstruction"),en("generation.validation.recheckInstruction"),t.slice(0,2e3)].join(` -`)}function a9t(e){var t;if(e.repairing||((t=e.task)==null?void 0:t.state)==="running"&&e.repairMode){if(e.repairMode==="manual")return tn("generation.stages.repairingAgain");const n=Math.max(1,e.repairAttempts||1);return tn("generation.stages.autoRepairing",{attempt:n,max:kFe})}return s9t(e.task)}function sae(){return a.jsxs("svg",{className:"skill-generation__spinner",viewBox:"0 0 20 20","aria-hidden":"true",children:[a.jsx("circle",{cx:"10",cy:"10",r:"7"}),a.jsx("path",{d:"M10 3a7 7 0 0 1 7 7"})]})}function o9t(e,t=Date.now()){if(!(e!=null&&e.expiresAt))return tn("generation.sessionMax");const n=Math.max(0,new Date(e.expiresAt).getTime()-t),i=Math.floor(n/6e4),r=Math.floor(n%6e4/1e3);return tn("generation.remaining",{minutes:i,seconds:String(r).padStart(2,"0")})}function l9t(e){return e?e.length>64?tn("generation.validation.nameTooLong"):/^[a-z0-9-]+$/.test(e)?"":tn("generation.validation.invalidName"):""}function aae(e){return e?e.length>128?tn("generation.validation.modelTooLong"):/^[A-Za-z0-9][A-Za-z0-9._:/-]*$/.test(e)?"":tn("generation.validation.invalidModel"):""}function H$(e){return`${e.region||""}:${e.id}`}function c9t(){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m14.5 6-6 6 6 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}function u9t({operation:e,cloudProvider:t,space:n,availableSpaces:i=[],spacesLoading:r=!1,initialIntent:s="",source:o,onBack:l,onPublished:c}){var Oe,Se,qe,Xe;const{t:u}=Te("skills"),[d,f]=p.useState(null),[h,m]=p.useState(null),[g,b]=p.useState(s),[v,y]=p.useState(""),[w,x]=p.useState([]),[O,k]=p.useState([]),[S,C]=p.useState(""),[E,j]=p.useState(!1),[T,R]=p.useState(""),[A,N]=p.useState(""),[P,I]=p.useState(null),[D,_]=p.useState(""),[L,F]=p.useState(""),[M,z]=p.useState(n?H$(n):""),[q,U]=p.useState(Date.now()),J=p.useRef([]);p.useEffect(()=>{const ye=new AbortController;return jM(ye.signal).then(we=>{f(we),x([iae(0,we)])}).catch(we=>{ye.signal.aborted||m(Mr(we,tn("generation.errors.loadCapability")))}),()=>ye.abort()},[]),p.useEffect(()=>{J.current=O},[O]),p.useEffect(()=>{const ye=window.setInterval(()=>U(Date.now()),1e3);return()=>window.clearInterval(ye)},[]),p.useEffect(()=>{const ye=we=>{J.current.some(Ae=>{var Ve;return((Ve=Ae.task)==null?void 0:Ve.state)==="running"||Ae.repairing})&&we.preventDefault()};return window.addEventListener("beforeunload",ye),()=>{var we;window.removeEventListener("beforeunload",ye);for(const Ae of J.current)(we=Ae.task)!=null&&we.jobId&&C2t(Ae.task.jobId).catch(()=>{})}},[]),p.useEffect(()=>{if(!O.some(Ve=>{var Be;return((Be=Ve.task)==null?void 0:Be.state)==="running"||Ve.repairing}))return;let ye=!1,we;const Ae=async()=>{const Ve=J.current,Be=await Promise.all(Ve.map(async _t=>{var Pt;if(((Pt=_t.task)==null?void 0:Pt.state)!=="running")return _t;try{const Kt=await k2t(_t.task.jobId);if(V$(Kt)&&(_t.repairAttempts||0)tt.map(mt=>mt.id===_t.id?{...mt,task:Kt,repairing:!0,repairMode:"auto",repairAttempts:vt,repairError:void 0}:mt));try{const tt=await M4({jobId:Kt.jobId,intent:rae(Kt),expectedRevision:Kt.revision});return{..._t,task:tt,artifact:void 0,repairing:!1,repairMode:"auto",repairAttempts:vt,repairError:void 0,error:void 0,pollError:void 0}}catch(tt){return{..._t,task:Kt,repairing:!1,repairMode:void 0,repairAttempts:vt,repairError:Mr(tt,tn("generation.errors.autoRepair")),pollError:void 0}}}let Et=_t.artifact;return Kt.state==="ready"&&(Et=await D4(Kt.jobId,Kt.revision)),{..._t,task:Kt,artifact:Et,repairing:!1,repairMode:Kt.state==="running"?_t.repairMode:void 0,repairError:void 0,error:void 0,pollError:void 0}}catch(Kt){return{..._t,pollError:Mr(Kt,tn("generation.errors.pollCandidate"))}}}));ye||(k(Be),we=window.setTimeout(()=>void Ae(),n9t))};return Ae(),()=>{ye=!0,we!==void 0&&window.clearTimeout(we)}},[O.some(ye=>{var we;return((we=ye.task)==null?void 0:we.state)==="running"||ye.repairing})]);const V=O.find(ye=>ye.id===S)||O[0],Z=e==="create"&&!n,ne=i.find(ye=>H$(ye)===M)??null,W=n??ne,G=i.map(ye=>({value:H$(ye),label:`${Pc(ye)||u("generation.unnamedSpace")} · ${xh(ye.region||"cn-beijing",t)}`})),H=l9t(v),se=!!(d!=null&&d.enabled&&g.trim()&&!H&&w.length>0&&w.every(ye=>ye.model.trim()&&!aae(ye.model.trim()))),Y=(ye,we)=>{x(Ae=>Ae.map(Ve=>Ve.id===ye?{...Ve,...we}:Ve))},X=async ye=>{const we={...ye,model:ye.model.trim()},Ae=ye.style==="custom"?ye.customStyle.trim():ye.style;try{const Ve=await O2t({operation:e,intent:g.trim(),model:we.model,style:Ae,name:v.trim()||void 0,source:o});return{id:ye.id,config:we,task:Ve}}catch(Ve){return{id:ye.id,config:we,error:Mr(Ve,tn("generation.errors.createCandidate"))}}},ie=async()=>{if(!se)return;j(!0),I(null);const ye=w.map(Ae=>({id:Ae.id,config:Ae}));k(ye),C(w[0].id);const we=await Promise.all(w.map(X));k(we)},ee=async ye=>{k(Ae=>Ae.map(Ve=>Ve.id===ye.id?{...Ve,error:void 0}:Ve));const we=await X(ye.config);k(Ae=>Ae.map(Ve=>Ve.id===ye.id?we:Ve))},be=async()=>{if(!(!(V!=null&&V.task)||!T.trim()||V.task.state!=="ready")){N("refine"),I(null);try{const ye=await M4({jobId:V.task.jobId,intent:T.trim(),expectedRevision:V.task.revision});k(we=>we.map(Ae=>Ae.id===V.id?{...Ae,task:ye,artifact:void 0}:Ae)),R("")}catch(ye){I(Mr(ye,tn("generation.errors.refine")))}finally{N("")}}},ue=async()=>{if(!(!(V!=null&&V.task)||!V$(V.task))){N("refine"),I(null),k(ye=>ye.map(we=>we.id===V.id?{...we,repairing:!0,repairMode:"manual",repairError:void 0}:we));try{const ye=await M4({jobId:V.task.jobId,intent:rae(V.task),expectedRevision:V.task.revision});k(we=>we.map(Ae=>Ae.id===V.id?{...Ae,task:ye,artifact:void 0,repairing:!1,repairMode:"manual",repairError:void 0}:Ae))}catch(ye){k(we=>we.map(Ae=>Ae.id===V.id?{...Ae,repairing:!1,repairMode:void 0,repairError:Mr(ye,tn("generation.errors.repairAgain"))}:Ae))}finally{N("")}}},pe=async()=>{if(!(!(V!=null&&V.task)||V.task.state!=="ready"||L)){N("publish"),I(null);try{if(!W)throw new Error(tn("generation.errors.selectSpace"));const ye=V.artifact||await D4(V.task.jobId,V.task.revision),we=(o==null?void 0:o.region)||W.region||"";if(!CD(we))throw new Error(tn("generation.errors.unsupportedRegion"));await E2t({jobId:V.task.jobId,expectedRevision:V.task.revision,expectedArtifactSha256:ye.sha256,disposition:e==="optimize"?"update-source":"create-new",skillSpaceIds:[W.id],projectName:(o==null?void 0:o.projectName)||W.projectName,region:we,onProgress:Ae=>_(Ae.message)}),F(V.id),c()}catch(ye){I(Mr(ye,tn("generation.errors.upload")))}finally{N(""),_("")}}},ke=async()=>{if(!(!(V!=null&&V.task)||V.task.state!=="ready")){N("download");try{const ye=V.artifact||await D4(V.task.jobId,V.task.revision);await A2t(V.task.jobId,V.task.revision,ye.sha256)}catch(ye){I(Mr(ye,tn("generation.errors.download")))}finally{N("")}}},je=async()=>{O.some(ye=>{var we;return((we=ye.task)==null?void 0:we.state)==="running"})&&!window.confirm(tn("generation.leaveConfirmation"))||(await Promise.allSettled(O.flatMap(ye=>{var we;return((we=ye.task)==null?void 0:we.state)==="running"?[S2t({jobId:ye.task.jobId,expectedRevision:ye.task.revision})]:[]})),l())},Pe=e==="create"?u("generation.createTitle"):u("generation.optimizeTitle",{name:(o==null?void 0:o.name)||u("generation.skillFallback")}),Ee=ye=>{var we;return((we=d==null?void 0:d.models.find(Ae=>Ae.id===ye))==null?void 0:we.label)||ye},Qe=ye=>ye.config.style==="custom"?ye.config.customStyle.trim()||u("generation.styles.customFallback"):u(nae[ye.config.style]),_e=[...Object.entries(nae).map(([ye,we])=>({value:ye,label:u(we)})),{value:"custom",label:u("generation.styles.custom")}],ae=ye=>ye.error||ye.repairError?u("generation.stages.failed"):a9t(ye),le=ye=>!ye.error&&!ye.repairError&&(ye.repairing||!ye.task||ye.task.state==="running"),ge=O.some(ye=>{var we;return((we=ye.task)==null?void 0:we.state)==="ready"});return a.jsxs("section",{className:"skill-generation",children:[a.jsxs("header",{className:"skill-generation__header",children:[a.jsx("button",{type:"button",className:"skillcenter-back",onClick:()=>void je(),"aria-label":u("generation.back"),children:a.jsx(c9t,{})}),a.jsxs("div",{children:[a.jsx("h1",{children:Pe}),a.jsx("p",{children:Pc(n)||u("generation.home")})]}),O.length>0?a.jsx("span",{className:"skill-generation__ttl",children:o9t(V==null?void 0:V.task,q)}):null]}),E?a.jsxs("div",{className:"skill-generation__workspace",children:[a.jsx("div",{className:"skill-generation__candidate-tabs",role:"tablist","aria-label":u("generation.candidates"),children:O.map(ye=>a.jsxs("button",{type:"button",role:"tab","aria-selected":(V==null?void 0:V.id)===ye.id,className:(V==null?void 0:V.id)===ye.id?"is-active":"",onClick:()=>C(ye.id),children:[a.jsxs("span",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.style")}),a.jsx("strong",{children:Qe(ye)})]}),a.jsxs("span",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.model")}),a.jsx("strong",{children:Ee(ye.config.model)})]}),a.jsxs("span",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.progress")}),a.jsxs("strong",{children:[le(ye)?a.jsx(sae,{}):null,ae(ye)]})]})]},ye.id))}),V?a.jsxs("div",{className:"skill-generation__candidate",children:[a.jsxs("section",{className:"skill-generation__activity",children:[a.jsx("header",{children:a.jsxs("div",{className:"skill-generation__candidate-summary",children:[a.jsxs("div",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.style")}),a.jsx("strong",{children:Qe(V)})]}),a.jsxs("div",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.model")}),a.jsx("strong",{children:Ee(V.config.model)})]}),a.jsxs("div",{className:"skill-generation__summary-row","aria-live":"polite",children:[a.jsx("span",{children:u("generation.progress")}),a.jsxs("strong",{children:[le(V)?a.jsx(sae,{}):null,le(V)?a.jsx(hn,{children:ae(V)}):ae(V)]})]})]})}),V.task?a.jsx(jNt,{activities:V.task.activities}):null,V.pollError?a.jsx("div",{className:"skill-inline-notice",children:a.jsx(Ns,{error:V.pollError})}):null,V.repairError?a.jsx("div",{className:"skill-inline-notice",children:a.jsx(Ns,{error:V.repairError})}):null,V.error?a.jsxs("div",{className:"skill-inline-error",children:[a.jsx(Ns,{error:V.error}),a.jsx("button",{type:"button",onClick:()=>void ee(V),children:u("generation.retryCandidate")})]}):null,(Oe=V.task)!=null&&Oe.validation&&!V.task.validation.valid&&!V.repairing&&V.task.state==="failed"?a.jsxs("div",{className:"skill-validation-errors",children:[a.jsx("strong",{children:u("generation.formatValidationFailed")}),V.task.validation.errors.map(ye=>a.jsx("p",{children:ye},ye)),V$(V.task)?a.jsx("button",{type:"button",disabled:!!A,onClick:()=>void ue(),children:u("generation.repairAgain")}):null]}):null]}),a.jsxs("section",{className:"skill-generation__files",children:[a.jsxs("header",{children:[a.jsx("h2",{children:u("generation.files")}),((Se=V.task)==null?void 0:Se.state)==="ready"?a.jsx("button",{type:"button",onClick:()=>void ke(),disabled:!!A,children:u("generation.downloadZip")}):null]}),V.artifact?a.jsx(dL,{files:V.artifact.files}):a.jsx("div",{className:"skill-generation__files-empty",children:((qe=V.task)==null?void 0:qe.state)==="ready"?u("generation.loadingFiles"):u("generation.filesPending")})]}),((Xe=V.task)==null?void 0:Xe.state)==="ready"?a.jsxs("div",{className:"skill-generation__ready-actions",children:[Z?a.jsx("div",{className:"skill-generation__publish-target",children:a.jsx(NN,{label:u("generation.uploadToSpace"),value:M,options:G,onChange:z,disabled:r,placeholder:u(r?"generation.loadingSpaces":"generation.selectSpace")})}):null,a.jsxs("footer",{className:"skill-generation__followup",children:[a.jsx("textarea",{value:T,onChange:ye=>R(ye.target.value),placeholder:u("generation.continuePlaceholder")}),a.jsx("button",{type:"button",className:"skill-button",disabled:!T.trim()||!!A,onClick:()=>void be(),children:u("generation.continue")}),a.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!!A||!!L||!W,onClick:()=>void pe(),children:A==="publish"?D||u("generation.uploading"):u(e==="optimize"?"generation.overwrite":Z?"generation.uploadToSelectedSpace":"generation.uploadToCurrentSpace")})]})]}):null,P?a.jsx("div",{className:"skill-inline-error skill-generation__action-error",children:a.jsx(Ns,{error:P})}):null]}):null,!ge&&O.every(ye=>ye.error)?a.jsx("div",{className:"skill-inline-error",children:u("generation.allCandidatesFailed")}):null]}):a.jsxs("div",{className:"skill-generation__setup",children:[a.jsx("div",{className:"skill-generation__section-head is-basic",children:a.jsx("div",{children:a.jsx("strong",{children:u("generation.basicInfo")})})}),a.jsxs("label",{children:[a.jsxs("span",{children:[u("generation.goal"),a.jsx("span",{className:"skill-required-mark","aria-hidden":"true",children:"*"})]}),a.jsx("textarea",{required:!0,value:g,onChange:ye=>b(ye.target.value),placeholder:u(e==="create"?"generation.createIntentPlaceholder":"generation.optimizeIntentPlaceholder")})]}),a.jsxs("label",{children:[a.jsx("span",{children:u("generation.skillName")}),a.jsx("input",{value:v,onChange:ye=>y(ye.target.value),placeholder:u("generation.autoNamePlaceholder"),"aria-invalid":!!H,"aria-describedby":"skill-name-help"}),H?a.jsx("span",{id:"skill-name-help",className:"skill-generation__field-error",role:"alert",children:H}):a.jsx("span",{id:"skill-name-help",className:"skill-generation__field-help",children:u("generation.nameHelp")})]}),a.jsx("div",{className:"skill-generation__section-head",children:a.jsxs("div",{children:[a.jsx("strong",{children:u(e==="create"?"generation.createPlans":"generation.optimizePlans")}),a.jsx("span",{children:u(e==="create"?"generation.createPlansDescription":"generation.optimizePlansDescription")})]})}),a.jsxs("div",{className:"skill-generation__groups",children:[w.map((ye,we)=>a.jsxs("article",{className:"skill-generation__group",children:[a.jsxs("header",{children:[a.jsx("strong",{children:u("generation.plan",{count:we+1})}),w.length>1?a.jsx("button",{type:"button",onClick:()=>x(Ae=>Ae.filter(Ve=>Ve.id!==ye.id)),children:u("generation.remove")}):null]}),a.jsx(NN,{label:u("generation.model"),required:!0,value:ye.model,options:(d==null?void 0:d.models.map(Ae=>({value:Ae.id,label:Ae.label})))||[],onChange:Ae=>Y(ye.id,{model:Ae}),allowCustom:!0,placeholder:u("generation.modelPlaceholder"),error:aae(ye.model.trim())}),a.jsx(NN,{label:u("generation.style"),required:!0,value:ye.style,options:_e,onChange:Ae=>Y(ye.id,{style:Ae})}),ye.style==="custom"?a.jsxs("label",{children:[a.jsx("span",{children:u("generation.customStyle")}),a.jsx("textarea",{value:ye.customStyle,onChange:Ae=>Y(ye.id,{customStyle:Ae.target.value}),placeholder:u("generation.customStylePlaceholder")})]}):null]},ye.id)),d&&w.lengthx(ye=>[...ye,iae(ye.length,d)]),children:u("generation.addConfiguration")}):null]}),h?a.jsx("div",{className:"skill-inline-error",children:a.jsx(Ns,{error:h})}):null,d&&!d.enabled?a.jsx("div",{className:"skill-inline-notice",children:u("generation.notConfigured")}):null,a.jsx("div",{className:"skill-generation__setup-actions",children:a.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!se,onClick:()=>void ie(),children:u("generation.generate")})})]})]})}async function SFe(e,t,n,i){const r=new URLSearchParams({region:e.region}),s=await fetch(ja(`/web/skill-management/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/versions?${r}`),{...t,headers:ul(fc(t.headers)),signal:po(e.signal,i)});if(!s.ok)throw await YA(s,n);return s.json()}function d9t(e){return SFe(e,{},Q("skills.listVersionsFailed"),ho)}function f9t(e){return SFe(e,{method:"POST",headers:{"Content-Type":"application/zip"},body:e.file},Q("skills.uploadVersionFailed"),mr)}function EFe(e){const t=new Map;for(const n of e){const i=`${n.sourceSkillId}:${n.version}`,r=t.get(i);(!r||n.submittedAt>r.submittedAt)&&t.set(i,n)}return t}function h9t(e,t,n,i){const r=i.trim().toLocaleLowerCase();return e.filter(s=>s.kind===t&&(n==="all"||s.status===n)&&`${s.name} ${s.description} ${s.author} ${s.version}`.toLocaleLowerCase().includes(r))}const CFe=p.createContext(void 0);function Pb(e){const t=p.useContext(CFe);if(!e&&t===void 0)throw new Error(Vc(27));return t}const J0=p.forwardRef(function(t,n){const{render:i,className:r,style:s,forceRender:o=!1,...l}=t,c=Pb(),u=c.useState("open"),d=c.useState("nested"),f=c.useState("mounted"),h=c.useState("transitionStatus");return Pa("div",t,{state:{open:u,transitionStatus:h},ref:[c.context.backdropRef,n],stateAttributesMapping:wje,props:[{role:"presentation",hidden:!f,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:o||!d})}),fL=p.forwardRef(function(t,n){const{render:i,className:r,style:s,disabled:o=!1,nativeButton:l=!0,...c}=t,u=Pb(),d=u.useState("open"),{getButtonProps:f,buttonRef:h}=KD({disabled:o,native:l}),m={disabled:o};function g(b){d&&u.setOpen(!1,ha(A_e,b.nativeEvent))}return Pa("button",t,{state:m,ref:[n,h],props:[{onClick:g},c,f]})}),RT=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:o,...l}=t,c=Pb(),u=nm(o);return c.useSyncedValueWithCleanup("descriptionElementId",u),Pa("p",t,{ref:n,props:[{id:u},l]})}),AFe=p.createContext(void 0);function p9t(){const e=p.useContext(AFe);if(e===void 0)throw new Error(Vc(26));return e}const m9t={...fV,...WD,nestedDialogOpen(e){return e?{"data-nested-dialog-open":""}:null}},ev=p.forwardRef(function(t,n){const{render:i,className:r,style:s,finalFocus:o,initialFocus:l,...c}=t,u=Pb(),d=u.useState("descriptionElementId"),f=u.useState("disablePointerDismissal"),h=u.useState("floatingRootContext"),m=u.useState("popupProps"),g=u.useState("modal"),b=u.useState("mounted"),v=u.useState("nested"),y=u.useState("nestedOpenDialogCount"),w=u.useState("open"),x=u.useState("openMethod"),O=u.useState("titleElementId"),k=u.useState("transitionStatus"),S=u.useState("role"),C=h.useState("floatingId");p9t(),$A({open:w,ref:u.context.popupRef,onComplete(){var N,P;w&&((P=(N=u.context).onOpenChangeComplete)==null||P.call(N,!0))}});const E=l===void 0?ije(u.context.popupRef):l,j=y>0,T=u.useStateSetter("popupElement"),A=Pa("div",t,{state:{open:w,nested:v,transitionStatus:k,nestedDialogOpen:j},props:[m,{id:C,"aria-labelledby":O,"aria-describedby":d,role:S,...nje,hidden:!b,onKeyDown(N){cLe.has(N.key)&&N.stopPropagation()},style:{"--nested-dialogs":y}},c],ref:[n,u.context.popupRef,T],stateAttributesMapping:m9t});return a.jsx(F_e,{context:h,openInteractionType:x,disabled:!b,closeOnFocusOut:!f,initialFocus:E,returnFocus:o,modal:g!==!1,restoreFocus:"popup",children:A})}),tv=p.forwardRef(function(t,n){const{keepMounted:i=!1,...r}=t,s=Pb(),o=s.useState("mounted"),l=s.useState("modal"),c=s.useState("open");return o||i?a.jsx(AFe.Provider,{value:i,children:a.jsxs(I_e,{ref:n,...r,children:[o&&l===!0&&a.jsx(oLe,{ref:s.context.internalBackdropRef,inert:iV(!c)}),t.children]})}):null});function g9t({store:e,parentContext:t,isDrawer:n}){const i=e.useState("open"),r=e.useState("disablePointerDismissal"),s=e.useState("modal"),o=e.useState("popupElement"),l=e.useState("floatingRootContext"),[c,u]=p.useState(0),[d,f]=p.useState(0),h=c===0,m=U_e(l,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:s==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(g){if(!e.context.outsidePressEnabledRef.current||"button"in g&&g.button!==0)return!1;if("touches"in g){if(g.type==="touchend"){if(g.changedTouches.length!==1||g.touches.length!==0)return!1}else if(g.touches.length!==1)return!1}const b=uo(g);if(h&&!r){if(s){const v=e.context.internalBackdropRef.current,y=e.context.backdropRef.current;return v||y?v===b||y===b||ii(b,o)&&!(b!=null&&b.hasAttribute("data-base-ui-portal")):!0}return!0}return!1},escapeKey:h});return lLe(i&&s===!0,o),e.useContextCallback("onNestedDialogOpen",(g,b)=>{u(g),f(b)}),Jn(()=>(t!=null&&t.onNestedDialogOpen&&(i?t.onNestedDialogOpen(c+1,d+(n?1:0)):t.onNestedDialogOpen(0,0)),()=>{t!=null&&t.onNestedDialogOpen&&i&&t.onNestedDialogOpen(0,0)}),[n,i,c,d,t]),uje(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:c,nestedOpenDrawerCount:d}),null}const b9t={...mje,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role};class y9t extends FD{constructor(n,i,r){const s=new cV,o=v9t(n,s,i,r);super(o,x9t(s),b9t);Zt(this,"setOpen",(n,i)=>{var s,o;if(i.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!n&&i.trigger==null&&this.state.activeTriggerId!=null&&(i.trigger=this.state.activeTriggerElement??void 0),(o=(s=this.context).onOpenChange)==null||o.call(s,n,i),i.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,i);const r={open:n};aje(r,n,i.trigger),this.update(r)})}}function v9t(e,t,n,i=!1){const r={...fje(),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e};return r.floatingRootContext=hje(t,n,i),r}function x9t(e){return{popupRef:p.createRef(),backdropRef:p.createRef(),internalBackdropRef:p.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function w9t(e,t){const{children:n,open:i,defaultOpen:r=!1,onOpenChange:s,onOpenChangeComplete:o,disablePointerDismissal:l=!1,modal:c=!0,actionsRef:u,handle:d,triggerId:f,defaultTriggerId:h=null}=t,m=e==="drawer",g=c,b=l,v="dialog",y=Pb(!0),w=y!=null,x={modal:g,disablePointerDismissal:b,nested:w,role:v},O=rje((T,R)=>new y9t({open:r,openProp:i,activeTriggerId:h,triggerIdProp:f,...x},T,R),!0);O.useControlledProp("openProp",i),O.useControlledProp("triggerIdProp",f),O.useSyncedValues(x),O.useContextCallback("onOpenChange",s),O.useContextCallback("onOpenChangeComplete",o);const k=O.useState("open"),S=O.useState("mounted"),C=O.useState("payload");dje(O,k),lje(O);const{forceUnmount:E}=cje(k,O);p.useImperativeHandle(u,()=>({unmount:E,close:()=>O.setOpen(!1,ha(__e))}),[E,O]);const j=k||S;return a.jsxs(CFe.Provider,{value:O,children:[d&&a.jsx(sje,{handle:d,store:O}),j&&a.jsx(g9t,{store:O,parentContext:y==null?void 0:y.context,isDrawer:m}),typeof n=="function"?n({payload:C}):n]})}function nv(e){return w9t("dialog",e)}const gO=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:o,...l}=t,c=Pb(),u=nm(o);return c.useSyncedValueWithCleanup("titleElementId",u),Pa("h2",t,{ref:n,props:[{id:u},l]})}),TFe=p.forwardRef(function(t,n){const{render:i,className:r,style:s,disabled:o=!1,nativeButton:l=!0,id:c,payload:u,handle:d,...f}=t,h=Pb(!0),g=gje(d)??h;if(!g)throw new Error(Vc(79));const b=nm(c),v=g.useState("floatingRootContext"),y=g.useState("isOpenedByTrigger",b),w=g.useState("triggerPopupId",b),x=p.useRef(null),{registerTrigger:O,isMountedByThisTrigger:k}=oje(b,x,g,{payload:u}),{getButtonProps:S,buttonRef:C}=KD({disabled:o,native:l}),E=B_e(v),j=rLe(()=>g.select("open"),A=>{g.set("openMethod",A)}),T={disabled:o,open:y},R=g.useState("triggerProps",k);return Pa("button",t,{state:T,ref:[C,n,O,x],props:[E.reference,R,j,{[sV]:"",id:b,"aria-haspopup":"dialog","aria-expanded":y,"aria-controls":w},f,S],stateAttributesMapping:xje})});async function _Fe(e,t){const n=new URLSearchParams({region:e.region}),i=t?"/retry":`?${n}`,r=await fetch(ja(`/web/skill-management/reviews/${encodeURIComponent(e.id)}/score${i}`),{method:t?"POST":"GET",headers:ul(fc(t?{"Content-Type":"application/json"}:void 0)),...t?{body:JSON.stringify({region:e.region})}:{},signal:po(e.signal,ho)});if(!r.ok)throw await YA(r,yn.t(t?"score.retryFailed":"score.loadFailed",{ns:"reviews"}));return r.json()}const O9t=e=>_Fe(e,!1),k9t=e=>_Fe(e,!0),S9t=["safety","usability","completeness","reliability","maintainability"];function jFe(e){return(e==null?void 0:e.status)==="queued"||(e==null?void 0:e.status)==="running"}function E9t(e){if(e.status!=="not_requested")return{status:e.status,overallScore:e.overallScore,scoredAt:e.scoredAt,modelName:e.modelName,rubricVersion:e.rubricVersion,error:e.error}}function BW({score:e}){const{t}=Te("reviews");return a.jsx("span",{className:`review-score-label is-${(e==null?void 0:e.status)||"unscored"}`,children:(e==null?void 0:e.status)==="completed"?typeof e.overallScore=="number"?t("score.points",{score:e.overallScore}):t("score.insufficient"):t(`score.status.${(e==null?void 0:e.status)||"unscored"}`)})}function NFe({application:e,canRetry:t=!1,onScoreChanged:n}){const{t:i,i18n:r}=Te("reviews"),[s,o]=p.useState(e.aiReview),[l,c]=p.useState(!!e.aiReview),[u,d]=p.useState(null),[f,h]=p.useState({revision:0,retry:!1}),[m,g]=p.useState(""),b=p.useRef(-1),v=p.useRef(n);v.current=n;const{id:y,region:w}=e,x=!!e.aiReview;p.useEffect(()=>{if(!x&&f.revision===0)return;const S=new AbortController;let C,E=!1,j=!0;const T=async(N,P=!1)=>{var I;if(!(E||S.signal.aborted)&&!(!P&&document.visibilityState==="hidden")){E=!0,P&&c(!0),d(null);try{const D=await(N?k9t:O9t)({id:y,region:w,signal:S.signal});if(S.signal.aborted)return;o(D),(I=v.current)==null||I.call(v,D,N),j=jFe(D),j&&document.visibilityState!=="hidden"&&(C=setTimeout(()=>void T(!1),5e3))}catch(D){S.signal.aborted||(j=!1,d(Mr(D,i(N?"score.retryFailed":"score.loadFailed"))))}finally{E=!1,S.signal.aborted||c(!1)}}},R=()=>{clearTimeout(C),j&&document.visibilityState!=="hidden"&&T(!1)},A=f.retry&&b.current!==f.revision;return A&&(b.current=f.revision),T(A,!0),document.addEventListener("visibilitychange",R),()=>{S.abort(),clearTimeout(C),document.removeEventListener("visibilitychange",R)}},[y,w,x,f,i]);const O=(s==null?void 0:s.status)==="completed"?s.result:void 0;p.useEffect(()=>{if(!O){g("");return}const S=URL.createObjectURL(new Blob([JSON.stringify(O,null,2)],{type:"application/json"}));return g(S),()=>URL.revokeObjectURL(S)},[O]);const k=S=>h(C=>({revision:C.revision+1,retry:S}));return a.jsxs("section",{className:"review-score","aria-label":i("score.title"),children:[a.jsxs("div",{className:"review-score__header",children:[a.jsx("div",{"aria-live":"polite",children:l?a.jsx(hn,{children:i(f.retry?"score.starting":"score.loading")}):a.jsx(BW,{score:s})}),a.jsxs("div",{className:"review-score__actions",children:[m?a.jsx("a",{className:"cw-btn cw-btn-ghost",href:m,download:`${y}-score.json`,children:i("score.download")}):null,t&&(!s||s.status==="failed"||s.status==="not_requested")?a.jsx("button",{type:"button",className:"cw-btn cw-btn-ghost",disabled:l,onClick:()=>k(!0),children:i((s==null?void 0:s.status)==="failed"?"score.retry":"score.start")}):null]})]}),a.jsx("p",{className:"review-score__hint",children:i("score.hint")}),u?a.jsxs("div",{className:"review-score__error",role:"alert",children:[a.jsx(Ns,{error:u}),a.jsx("button",{type:"button",className:"cw-btn cw-btn-ghost",disabled:l,onClick:()=>k(!1),children:i("score.reload")})]}):null,s!=null&&s.error?a.jsx("div",{role:"alert",className:"review-score__error",children:a.jsxs("details",{className:"review-score__raw-error",open:!0,children:[a.jsx("summary",{children:i("score.originalError")}),a.jsx("pre",{children:s.error})]})}):(s==null?void 0:s.status)==="failed"?a.jsx("p",{role:"alert",className:"review-score__error",children:i("score.failed")}):null,O?a.jsxs(a.Fragment,{children:[O.riskFlags.length?a.jsxs("div",{className:"review-score__risks",children:[a.jsx("h3",{children:i("score.risks")}),a.jsx("ul",{children:O.riskFlags.map((S,C)=>a.jsxs("li",{children:[a.jsx("strong",{children:i(`score.severity.${S.severity}`)})," · ",S.reason]},`${C}:${S.reason}`))})]}):null,O.coverage&&!O.coverage.complete?a.jsxs("div",{className:"review-score__coverage",children:[a.jsx("h3",{children:i("score.coverage")}),a.jsx("p",{children:i("score.coverageIncomplete")}),a.jsx("p",{children:i("score.coverageCount",{included:O.coverage.includedFiles,total:O.coverage.totalFiles})}),a.jsxs("ul",{children:[O.coverage.omittedFiles.map(S=>a.jsx("li",{children:i("score.omittedFile",S)},`omitted:${S.path}`)),O.coverage.truncatedFiles.map(S=>a.jsx("li",{children:i("score.truncatedFile",S)},`truncated:${S.path}`))]})]}):null,a.jsx("dl",{className:"review-score__dimensions",children:S9t.map(S=>{const C=O.dimensions[S];return a.jsxs("div",{className:S==="safety"&&C.score!==null&&C.score<60?"is-risk":void 0,children:[a.jsxs("dt",{children:[a.jsx("span",{children:i(`score.dimensions.${S}`)}),a.jsx("strong",{children:C.score===null?i("score.insufficient"):i("score.points",{score:C.score})})]}),a.jsx("dd",{children:C.reason})]},S)})}),O.suggestions.length?a.jsxs("div",{className:"review-score__suggestions",children:[a.jsx("h3",{children:i("score.suggestions")}),a.jsx("ul",{children:O.suggestions.map((S,C)=>a.jsx("li",{children:S},`${C}:${S}`))})]}):null,a.jsxs("dl",{className:"review-score__metadata",children:[a.jsxs("div",{children:[a.jsx("dt",{children:i("score.model")}),a.jsx("dd",{children:O.modelName})]}),a.jsxs("div",{children:[a.jsx("dt",{children:i("score.rubric")}),a.jsx("dd",{children:O.rubricVersion})]}),a.jsxs("div",{children:[a.jsx("dt",{children:i("score.time")}),a.jsx("dd",{children:a.jsx("time",{dateTime:O.scoredAt,children:new Date(O.scoredAt).toLocaleString(r.language,{hour12:!1})})})]})]})]}):null]})}function C9t({application:e}){const{t}=Te("reviews"),[n,i]=p.useState(!1),[r,s]=p.useState(e.aiReview),o=p.useId();return p.useEffect(()=>s(e.aiReview),[e.aiReview]),a.jsxs("div",{className:"review-score-history",children:[a.jsxs("button",{type:"button",className:"review-score-history__toggle","aria-expanded":n,"aria-controls":o,onClick:()=>i(l=>!l),children:[a.jsx("span",{children:t("score.title")}),a.jsx(BW,{score:r}),a.jsx("span",{children:t(n?"score.collapse":"score.expand")})]}),n?a.jsx("div",{id:o,children:a.jsx(NFe,{application:e,onScoreChanged:s},`${e.region}:${e.id}`)}):null]})}function IT({status:e}){const{t}=Te("reviews");return a.jsxs("span",{className:`review-status is-${e}`,children:[a.jsx("span",{"aria-hidden":"true"}),t(`status.${e}`)]})}function UW({person:e,fallback:t,compact:n=!1}){const{t:i}=Te("reviews"),[r,s]=p.useState(""),o=(e==null?void 0:e.name)||t||i("detail.unknownReviewer"),l=e==null?void 0:e.avatarUrl;return a.jsxs("span",{className:`review-person${n?" is-compact":""}`,children:[l&&l!==r?a.jsx("img",{className:"review-person__avatar",src:l,alt:"",referrerPolicy:"no-referrer",onError:()=>s(l)}):a.jsx("span",{className:"review-person__avatar is-fallback","aria-hidden":"true",children:Array.from(o)[0]}),a.jsxs("span",{className:"review-person__text",children:[a.jsx("span",{children:o}),!n&&(e!=null&&e.email)?a.jsx("span",{className:"review-person__email",children:e.email}):null]})]})}function QW({application:e}){const{t,i18n:n}=Te("reviews");return a.jsxs("div",{className:"review-outcome",children:[a.jsx(IT,{status:e.status}),e.reviewer||e.reviewedBy||e.reviewedAt?a.jsxs("dl",{className:"review-outcome__facts",children:[e.reviewer||e.reviewedBy?a.jsxs("div",{children:[a.jsx("dt",{children:t(`detail.${e.status==="returned"?"returnedBy":e.status==="approved"?"approvedBy":"reviewer"}`)}),a.jsx("dd",{children:a.jsx(UW,{person:e.reviewer,fallback:e.reviewedBy})})]}):null,e.reviewedAt?a.jsxs("div",{children:[a.jsx("dt",{children:t("detail.reviewedAt")}),a.jsx("dd",{children:a.jsx("time",{dateTime:e.reviewedAt,children:new Date(e.reviewedAt).toLocaleString(n.language,{hour12:!1})})})]}):null]}):null,e.reason?a.jsxs("div",{className:"review-outcome__message is-returned",children:[a.jsx("strong",{children:t("decision.reason")}),a.jsx("p",{children:e.reason})]}):null,e.comment?a.jsxs("div",{className:"review-outcome__message",children:[a.jsx("strong",{children:t("detail.comment")}),a.jsx("p",{children:e.comment})]}):null,e.status==="pending"?a.jsx("p",{className:"review-outcome__hint",children:t("detail.pendingHint")}):null,e.status==="approving"?a.jsx("p",{className:"review-outcome__hint",children:t("detail.approvingHint")}):null]})}function zW({applications:e}){const{t,i18n:n}=Te("reviews");return e.length?a.jsx("ol",{className:"review-source-history",children:[...e].sort((i,r)=>r.submittedAt.localeCompare(i.submittedAt)).map(i=>a.jsxs("li",{children:[a.jsxs("div",{className:"review-source-history__submission",children:[a.jsx("strong",{children:i.version}),a.jsx("span",{children:t("detail.submitted",{name:i.author})}),a.jsx("time",{dateTime:i.submittedAt,children:new Date(i.submittedAt).toLocaleString(n.language,{hour12:!1})})]}),a.jsx(QW,{application:i}),a.jsx(C9t,{application:i})]},i.id))}):a.jsx("p",{className:"review-outcome__hint",children:t("detail.noHistory")})}function A9t({name:e,applications:t,onClose:n}){const{t:i}=Te("reviews"),r=p.useRef(document.activeElement instanceof HTMLElement?document.activeElement:null);return a.jsx(nv,{open:!0,onOpenChange:s=>{s||n()},children:a.jsxs(tv,{children:[a.jsx(J0,{className:"review-backdrop"}),a.jsxs(ev,{className:"review-drawer",finalFocus:()=>{var s;return(s=r.current)!=null&&s.isConnected?r.current:null},children:[a.jsxs("header",{className:"review-drawer__header",children:[a.jsxs("div",{children:[a.jsx(gO,{children:i("detail.history")}),a.jsx(RT,{children:e})]}),a.jsx(fL,{className:"review-icon-button","aria-label":i("actions.close"),children:a.jsx(mT,{})})]}),a.jsx("div",{className:"review-drawer__body",children:a.jsx(zW,{applications:t})})]})]})})}function T9t({skill:e,space:t,region:n,reviews:i,onClose:r,onChanged:s,onSubmitReview:o}){const{t:l,i18n:c}=Te("ui"),[u,d]=p.useState(null),[f,h]=p.useState(e.version),[m,g]=p.useState(!0),[b,v]=p.useState(null),[y,w]=p.useState(null),[x,O]=p.useState([]),[k,S]=p.useState(!1),[C,E]=p.useState(null),[j,T]=p.useState(0),[R,A]=p.useState(0),[N,P]=p.useState(null),I=p.useRef(null),D=p.useRef(null),_=p.useRef(null),L=p.useRef(!1),F=p.useRef(!0),M=p.useRef({onClose:r,busy:N});M.current={onClose:r,busy:N};const z=u==null?void 0:u.items.find(G=>G.version===f),q=p.useMemo(()=>EFe(i),[i]),U=q.get(`${e.skillId}:${f}`),J=i.filter(G=>G.sourceSkillId===e.skillId&&G.version===f&&G.id!==(U==null?void 0:U.id)),V=!!(o&&(u!=null&&u.canUpdate)&&z&&["running","ready"].includes(z.status.toLowerCase())&&(!U||U.status==="returned"));p.useEffect(()=>{var se;F.current=!0;const G=document.activeElement instanceof HTMLElement?document.activeElement:null;(se=_.current)==null||se.focus();const H=Y=>{var be;if(Y.key==="Escape"&&(Y.preventDefault(),M.current.busy||M.current.onClose()),Y.key!=="Tab")return;const X=Array.from(((be=I.current)==null?void 0:be.querySelectorAll('button:not([disabled]), input:not([disabled]):not([type="file"]), a[href], summary, [tabindex="0"]'))||[]),ie=X[0],ee=X[X.length-1];Y.shiftKey&&document.activeElement===ie&&(Y.preventDefault(),ee==null||ee.focus()),!Y.shiftKey&&document.activeElement===ee&&(Y.preventDefault(),ie==null||ie.focus())};return document.addEventListener("keydown",H),()=>{F.current=!1,document.removeEventListener("keydown",H),G!=null&&G.isConnected&&G.focus()}},[]),p.useEffect(()=>{const G=new AbortController;return g(!0),v(null),d9t({spaceId:t.id,skillId:e.skillId,region:n,signal:G.signal}).then(H=>{G.signal.aborted||(d(H),h(se=>{var Y;return H.items.some(X=>X.version===se)?se:((Y=H.items[0])==null?void 0:Y.version)||""}))}).catch(H=>{G.signal.aborted||v(Mr(H,l("skillCenter.versions.loadFailed")))}).finally(()=>{G.signal.aborted||g(!1)}),()=>G.abort()},[t.id,e.skillId,n,j,l]),p.useEffect(()=>{if(!f||!z)return;let G=!0;return S(!0),E(null),O([]),wIe({spaceId:t.id,skillId:e.skillId,region:n,version:f}).then(H=>{G&&O(H)}).catch(H=>{G&&E(Mr(H,l("skillCenter.versions.filesFailed")))}).finally(()=>{G&&S(!1)}),()=>{G=!1}},[t.id,e.skillId,n,f,!!z,R,l]);async function Z(G){if(!L.current){L.current=!0,P("upload"),w(null);try{const H=await f9t({spaceId:t.id,skillId:e.skillId,region:n,file:G});if(!F.current)return;h(H.version),T(se=>se+1),s()}catch(H){F.current&&w(Mr(H,l("skillCenter.versions.uploadFailed")))}finally{L.current=!1,F.current&&P(null)}}}async function ne(){if(!(!V||!o||L.current)){L.current=!0,P("submit"),w(null);try{await o(f)}catch(G){F.current&&w(Mr(G,l("skillCenter.versions.submitFailed")))}finally{L.current=!1,F.current&&P(null)}}}function W(G){if(!G)return"—";const H=new Date(G);return Number.isNaN(H.getTime())?G:H.toLocaleString(c.resolvedLanguage||c.language)}return a.jsx("div",{className:"skill-detail-backdrop",onMouseDown:G=>{G.target===G.currentTarget&&!N&&r()},children:a.jsxs("section",{className:"skill-detail-dialog skill-versions",role:"dialog","aria-modal":"true","aria-labelledby":"skill-versions-title",ref:I,children:[a.jsxs("header",{className:"skill-detail-head",children:[a.jsx("div",{className:"skill-detail-heading",children:a.jsxs("div",{children:[a.jsx("h2",{id:"skill-versions-title",children:l("skillCenter.versions.title")}),a.jsx("p",{title:e.skillName,children:e.skillName})]})}),a.jsxs("div",{className:"skill-detail-actions",children:[a.jsx("button",{type:"button",disabled:m||!!N,onClick:()=>T(G=>G+1),children:l("skillCenter.versions.refresh")}),u!=null&&u.canUpdate?a.jsx("button",{type:"button",disabled:!!N,onClick:()=>{var G;return(G=D.current)==null?void 0:G.click()},children:l(N==="upload"?"skillCenter.versions.uploading":"skillCenter.versions.upload")}):null,a.jsx("button",{type:"button",ref:_,disabled:!!N,onClick:r,children:l("skillCenter.versions.close")})]}),a.jsx("input",{className:"skill-versions__file-input",ref:D,type:"file",accept:".zip,application/zip","aria-label":l("skillCenter.versions.upload"),onChange:G=>{var se;const H=(se=G.target.files)==null?void 0:se[0];G.target.value="",H&&Z(H)}})]}),y?a.jsx("div",{className:"skill-versions__notice",role:"alert",children:a.jsx(Ns,{error:y})}):null,u!=null&&u.canUpdate?a.jsx("p",{className:"skill-versions__hint",children:l("skillCenter.versions.hint")}):null,a.jsxs("div",{className:"skill-versions__body",children:[a.jsxs("div",{className:"skill-versions__history","aria-busy":m,children:[m&&!u?a.jsx("p",{role:"status",children:l("skillCenter.versions.loading")}):null,b?a.jsxs("div",{role:"alert",children:[a.jsx(Ns,{error:b}),a.jsx("button",{className:"cw-btn cw-btn-ghost",type:"button",onClick:()=>T(G=>G+1),children:l("skillCenter.versions.retry")})]}):null,!m&&!b&&!(u!=null&&u.items.length)?a.jsx("p",{children:l("skillCenter.versions.empty")}):null,a.jsx("div",{className:"skill-versions__list",role:"list","aria-label":l("skillCenter.versions.title"),children:u==null?void 0:u.items.map(G=>a.jsx("div",{role:"listitem",children:a.jsxs("button",{type:"button",className:`skill-versions__version${f===G.version?" is-active":""}`,"aria-pressed":f===G.version,onClick:()=>h(G.version),children:[a.jsxs("span",{className:"skill-versions__version-title",children:[a.jsx("strong",{children:G.sourceVersion||G.version}),G.isCurrent?a.jsx("span",{children:l("skillCenter.versions.current")}):null]}),a.jsx("time",{dateTime:G.createdAt,children:W(G.createdAt)}),q.get(`${e.skillId}:${G.version}`)?a.jsx(IT,{status:q.get(`${e.skillId}:${G.version}`).status}):a.jsx("span",{children:l(t.isShared?"skillCenter.versions.shared":"skillCenter.versions.notSubmitted")})]})},G.version))})]}),a.jsx("div",{className:"skill-versions__detail",children:z?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"skill-versions__summary",children:[a.jsxs("div",{children:[a.jsx("h3",{children:z.sourceVersion||z.version}),a.jsx("p",{title:z.description,children:z.description}),z.author||e.author?a.jsx("p",{className:"skill-versions__author",children:l("skillCenter.authorName",{name:z.author||e.author})}):null]}),o&&(u!=null&&u.canUpdate)?a.jsx("button",{type:"button",className:"cw-btn cw-btn-primary",disabled:!V||!!N,onClick:()=>void ne(),children:l(N==="submit"?"skillCenter.versions.submitting":"skillCenter.versions.submit")}):null]}),z.error?a.jsx("p",{className:"skill-versions__notice",role:"alert",children:z.error}):null,["running","ready"].includes(z.status.toLowerCase())?null:a.jsx("p",{role:"status",children:l("skillCenter.versions.processing",{status:z.status})}),U?a.jsx(QW,{application:U}):null,J.length?a.jsxs("details",{className:"skill-versions__review-history",children:[a.jsx("summary",{children:l("skillCenter.versions.history")}),a.jsx(zW,{applications:J})]}):null,a.jsx("div",{className:"skill-versions__files",children:k?a.jsx("p",{role:"status",children:l("skillCenter.versions.filesLoading")}):C?a.jsxs("div",{role:"alert",children:[a.jsx(Ns,{error:C}),a.jsx("button",{className:"cw-btn cw-btn-ghost",type:"button",onClick:()=>A(G=>G+1),children:l("skillCenter.versions.retry")})]}):x.length?a.jsx(dL,{files:x},f):a.jsx("p",{children:l("skillCenter.versions.filesEmpty")})})]}):null})]})]})})}function _9t({region:e,active:t,revision:n,onOpen:i}){const{t:r}=Te("ui"),[s,o]=p.useState(null),[l,c]=p.useState(null),[u,d]=p.useState(0);return p.useEffect(()=>{if(!t)return;const f=new AbortController;return c(null),jpt({region:e,signal:f.signal}).then(h=>{f.signal.aborted||o(h)}).catch(h=>{f.signal.aborted||c(Mr(h,r("skillCenter.sharedLoadFailed")))}),()=>f.abort()},[t,e,u,n,r]),a.jsxs("div",{className:"skillcenter-shared-space",children:[a.jsx(q0,{className:"skillcenter-space-card",title:r("skillCenter.sharedSpace"),description:r("skillCenter.sharedDescription"),status:a.jsx("span",{className:"skillcenter-shared-badge",children:r("skillCenter.sharedVisibility")}),metadata:[{label:r("skillCenter.skillCount"),value:s?r("skillCenter.skillCountValue",{count:s.skillCount??0}):r(l?"skillCenter.sharedLoadFailed":"skillCenter.sharedPreparing")}],detailAction:{label:r("common.viewDetails"),disabled:!s||!!l,onClick:()=>{s&&i(s)}},action:l?{label:r("common.reload"),onClick:()=>d(f=>f+1)}:void 0}),l?a.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:a.jsx(Ns,{error:l})}):null]})}function VW({title:e,children:t,onClose:n,className:i=""}){const{t:r}=Te("skills"),s=p.useRef(null);return p.useEffect(()=>{var l;(l=s.current)==null||l.focus();const o=c=>c.key==="Escape"&&n();return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[n]),a.jsx("div",{className:"skill-dialog-backdrop",onMouseDown:n,children:a.jsxs("section",{className:`skill-dialog${i?` ${i}`:""}`,role:"dialog","aria-modal":"true","aria-label":e,onMouseDown:o=>o.stopPropagation(),children:[a.jsxs("header",{children:[a.jsx("h2",{children:e}),a.jsx("button",{ref:s,type:"button",onClick:n,"aria-label":r("management.close"),children:r("management.close")})]}),t]})})}function j9t({region:e,regionOptions:t,onClose:n,onCreated:i}){const{t:r}=Te("skills"),[s,o]=p.useState(""),[l,c]=p.useState(""),[u,d]=p.useState(e),[f,h]=p.useState(!1),[m,g]=p.useState(null),b=async()=>{if(s.trim()){h(!0),g(null);try{const v=await _pt({name:s.trim(),description:l.trim()||void 0,region:u});i({...v,region:v.region||u})}catch(v){g(Mr(v,r("management.createSpaceFailed")))}finally{h(!1)}}};return a.jsxs(VW,{title:r("management.createSpaceTitle"),onClose:n,children:[a.jsxs("div",{className:"skill-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:r("management.name")}),a.jsx("input",{autoFocus:!0,value:s,maxLength:128,onChange:v=>o(v.target.value)})]}),a.jsx(NN,{label:r("management.region"),value:u,options:t,onChange:d,required:!0}),a.jsxs("label",{children:[a.jsx("span",{children:r("management.optionalDescription")}),a.jsx("textarea",{value:l,maxLength:1024,onChange:v=>c(v.target.value)})]}),m?a.jsx("div",{className:"skill-inline-error",children:a.jsx(Ns,{error:m})}):null]}),a.jsxs("footer",{children:[a.jsx("button",{type:"button",className:"skill-button",onClick:n,children:r("management.cancel")}),a.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!s.trim()||f,onClick:()=>void b(),children:r(f?"management.creating":"management.create")})]})]})}function N9t({space:e,region:t,onClose:n,onUpdated:i}){const{t:r}=Te("skills"),[s,o]=p.useState(e.name),[l,c]=p.useState(e.description||""),[u,d]=p.useState(!1),[f,h]=p.useState(null),m=async()=>{if(s.trim()){d(!0),h(null);try{const g=await Mpt({spaceId:e.id,name:s.trim(),description:l.trim()||void 0,region:t});i({...e,...g,skillCount:e.skillCount})}catch(g){h(Mr(g,r("management.updateSpaceFailed")))}finally{d(!1)}}};return a.jsxs(VW,{title:r("management.editSpaceTitle"),onClose:n,children:[a.jsxs("div",{className:"skill-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:r("management.name")}),a.jsx("input",{autoFocus:!0,value:s,maxLength:128,onChange:g=>o(g.target.value)})]}),a.jsxs("label",{children:[a.jsx("span",{children:r("management.optionalDescription")}),a.jsx("textarea",{value:l,maxLength:1024,onChange:g=>c(g.target.value)})]}),f?a.jsx("div",{className:"skill-inline-error",children:a.jsx(Ns,{error:f})}):null]}),a.jsxs("footer",{children:[a.jsx("button",{type:"button",className:"skill-button",onClick:n,children:r("management.cancel")}),a.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!s.trim()||u,onClick:()=>void m(),children:r(u?"management.saving":"management.save")})]})]})}function R9t({space:e,region:t,onClose:n,onUploaded:i}){const{t:r,i18n:s}=Te("skills"),[o,l]=p.useState(null),[c,u]=p.useState(null),[d,f]=p.useState(!1),[h,m]=p.useState(!1),[g,b]=p.useState(null),[v,y]=p.useState(!1),w=p.useRef(0),x=p.useRef(null),O=async S=>{const C=w.current+1;if(w.current=C,l(S),u(null),b(null),f(!!S),!!S)try{const E=await Fpt(S);w.current===C&&u({name:E.name,fileCount:E.files.length})}catch(E){w.current===C&&b(Mr(E,r("management.archiveValidationFailed")))}finally{w.current===C&&f(!1)}},k=async()=>{if(!(!o||!c)){m(!0),b(null);try{await $pt({spaceId:e.id,region:t,project:e.projectName,file:o}),i()}catch(S){b(Mr(S,r("management.uploadFailed")))}finally{m(!1)}}};return a.jsxs(VW,{title:r("management.uploadTitle",{name:Pc(e)}),className:"skill-upload-dialog",onClose:n,children:[a.jsxs("div",{className:"skill-dialog__body",children:[a.jsx("input",{ref:x,className:"skill-upload-dialog__input",type:"file",accept:".zip,application/zip",onChange:S=>{var C;return void O(((C=S.target.files)==null?void 0:C[0])||null)}}),a.jsxs("button",{type:"button",className:`skill-upload-dropzone${v?" is-dragging":""}`,onClick:()=>{var S;return(S=x.current)==null?void 0:S.click()},onDragEnter:S=>{S.preventDefault(),y(!0)},onDragOver:S=>{S.preventDefault(),S.dataTransfer.dropEffect="copy",y(!0)},onDragLeave:S=>{S.currentTarget.contains(S.relatedTarget)||y(!1)},onDrop:S=>{var C;S.preventDefault(),y(!1),O(((C=S.dataTransfer.files)==null?void 0:C[0])||null)},children:[a.jsx("strong",{children:o?o.name:r("management.dropzone")}),a.jsx("span",{children:o?r("fileTree.bytes",{value:new Intl.NumberFormat(s.resolvedLanguage).format(o.size)}):r("management.chooseLocalFile")})]}),a.jsx("p",{children:r("management.archiveHelp")}),d?a.jsx("div",{className:"skill-inline-notice",children:r("management.validating")}):null,c?a.jsx("div",{className:"skill-inline-notice",children:r("management.validationPassed",{name:c.name,count:c.fileCount})}):null,g?a.jsx("div",{className:"skill-inline-error",children:a.jsx(Ns,{error:g})}):null]}),a.jsxs("footer",{children:[a.jsx("button",{type:"button",className:"skill-button",onClick:n,children:r("management.cancel")}),a.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!o||!c||d||h,onClick:()=>void k(),children:r(h?"management.uploading":"management.upload")})]})]})}function I9t(e){if(typeof e=="number")return e<1e12?e*1e3:e;const t=e.trim(),n=Number(t);return/^\d+(?:\.\d+)?$/.test(t)?n<1e12?n*1e3:n:Date.parse(t)}function PT(e,t=Date.now(),n="zh-CN"){if(e===void 0||e==="")return"—";const i=I9t(e);if(!Number.isFinite(i))return"—";const r=Math.floor(Math.max(0,t-i)/1e3),s=new Intl.RelativeTimeFormat(n,{numeric:"always"}),o=(f,h,m)=>n.toLowerCase().startsWith("zh")?`${f} ${m}前`:s.format(-f,h);if(r<60)return o(r,"second","秒");const l=Math.floor(r/60);if(l<60)return o(l,"minute","分钟");const c=Math.floor(l/60);if(c<24)return o(c,"hour","小时");const u=Math.floor(c/24);if(u<30)return o(u,"day","天");const d=Math.floor(u/30);return d<12?o(d,"month","个月"):o(Math.floor(d/12),"year","年")}const P9t=12,oae=12;function bP({disabled:e,placement:t="top",children:n}){const{t:i}=Te("ui"),r=p.useId();return a.jsxs("span",{className:`skillcenter-disabled-action${e?" is-disabled":""} is-${t}`,tabIndex:e?0:void 0,"aria-describedby":e?r:void 0,children:[n,e?a.jsx("span",{id:r,className:"skillcenter-disabled-tooltip",role:"tooltip",children:i("skillCenter.sandboxNotConfigured")}):null]})}const D9t=new Set(["active","available","creating","disabled","enabled","failed","inactive","pending","published","ready","released","running","success","unavailable","unreleased","updating"]);function RFe(e,t){const n=(e||"").trim().toLowerCase();return D9t.has(n)?t(`skillCenter.status.${n}`):t("skillCenter.status.unknown")}function M9t(e){const t=(e||"").toLowerCase();return["active","available","enabled","published","ready","released","success"].includes(t)||t==="running"?"is-positive":["creating","pending","updating"].includes(t)?"is-progress":["failed","unavailable"].includes(t)?"is-danger":"is-muted"}function L9t(e,t){if(!e)return"";const n=e.trim(),i=Number(n),r=/^\d+(?:\.\d+)?$/.test(n)?new Date(i<1e12?i*1e3:i):new Date(n);return Number.isNaN(r.getTime())?e:new Intl.DateTimeFormat(t,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(r)}function lae(e){if(!e)return 0;const t=e.trim(),n=Number(t),i=/^\d+(?:\.\d+)?$/.test(t)?new Date(n<1e12?n*1e3:n):new Date(t);return Number.isNaN(i.getTime())?0:i.getTime()}function lu(e){return`${e.region||"default"}:${e.projectName||"default"}:${e.id}`}function $9t(e,t){const n=new Map(e.map(i=>[lu(i),i]));for(const i of t)n.set(lu(i),i);return[...n.values()].sort((i,r)=>lae(r.updatedAt)-lae(i.updatedAt))}function F9t(e){const t=e.replace(/\r\n/g,` +`)}function a9t(e){var t;if(e.repairing||((t=e.task)==null?void 0:t.state)==="running"&&e.repairMode){if(e.repairMode==="manual")return en("generation.stages.repairingAgain");const n=Math.max(1,e.repairAttempts||1);return en("generation.stages.autoRepairing",{attempt:n,max:kFe})}return s9t(e.task)}function sae(){return a.jsxs("svg",{className:"skill-generation__spinner",viewBox:"0 0 20 20","aria-hidden":"true",children:[a.jsx("circle",{cx:"10",cy:"10",r:"7"}),a.jsx("path",{d:"M10 3a7 7 0 0 1 7 7"})]})}function o9t(e,t=Date.now()){if(!(e!=null&&e.expiresAt))return en("generation.sessionMax");const n=Math.max(0,new Date(e.expiresAt).getTime()-t),i=Math.floor(n/6e4),r=Math.floor(n%6e4/1e3);return en("generation.remaining",{minutes:i,seconds:String(r).padStart(2,"0")})}function l9t(e){return e?e.length>64?en("generation.validation.nameTooLong"):/^[a-z0-9-]+$/.test(e)?"":en("generation.validation.invalidName"):""}function aae(e){return e?e.length>128?en("generation.validation.modelTooLong"):/^[A-Za-z0-9][A-Za-z0-9._:/-]*$/.test(e)?"":en("generation.validation.invalidModel"):""}function H$(e){return`${e.region||""}:${e.id}`}function c9t(){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m14.5 6-6 6 6 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}function u9t({operation:e,cloudProvider:t,space:n,availableSpaces:i=[],spacesLoading:r=!1,initialIntent:s="",source:o,onBack:l,onPublished:c}){var Oe,Se,We,Ye;const{t:u}=Te("skills"),[d,f]=p.useState(null),[h,m]=p.useState(null),[g,b]=p.useState(s),[v,y]=p.useState(""),[w,x]=p.useState([]),[O,k]=p.useState([]),[S,C]=p.useState(""),[E,j]=p.useState(!1),[T,R]=p.useState(""),[A,N]=p.useState(""),[P,I]=p.useState(null),[D,_]=p.useState(""),[L,F]=p.useState(""),[M,V]=p.useState(n?H$(n):""),[q,U]=p.useState(Date.now()),J=p.useRef([]);p.useEffect(()=>{const ye=new AbortController;return NM(ye.signal).then(we=>{f(we),x([iae(0,we)])}).catch(we=>{ye.signal.aborted||m(Pr(we,en("generation.errors.loadCapability")))}),()=>ye.abort()},[]),p.useEffect(()=>{J.current=O},[O]),p.useEffect(()=>{const ye=window.setInterval(()=>U(Date.now()),1e3);return()=>window.clearInterval(ye)},[]),p.useEffect(()=>{const ye=we=>{J.current.some(Ae=>{var He;return((He=Ae.task)==null?void 0:He.state)==="running"||Ae.repairing})&&we.preventDefault()};return window.addEventListener("beforeunload",ye),()=>{var we;window.removeEventListener("beforeunload",ye);for(const Ae of J.current)(we=Ae.task)!=null&&we.jobId&&C2t(Ae.task.jobId).catch(()=>{})}},[]),p.useEffect(()=>{if(!O.some(He=>{var Ue;return((Ue=He.task)==null?void 0:Ue.state)==="running"||He.repairing}))return;let ye=!1,we;const Ae=async()=>{const He=J.current,Ue=await Promise.all(He.map(async jt=>{var Pt;if(((Pt=jt.task)==null?void 0:Pt.state)!=="running")return jt;try{const Kt=await k2t(jt.task.jobId);if(V$(Kt)&&(jt.repairAttempts||0)tt.map(mt=>mt.id===jt.id?{...mt,task:Kt,repairing:!0,repairMode:"auto",repairAttempts:xt,repairError:void 0}:mt));try{const tt=await M4({jobId:Kt.jobId,intent:rae(Kt),expectedRevision:Kt.revision});return{...jt,task:tt,artifact:void 0,repairing:!1,repairMode:"auto",repairAttempts:xt,repairError:void 0,error:void 0,pollError:void 0}}catch(tt){return{...jt,task:Kt,repairing:!1,repairMode:void 0,repairAttempts:xt,repairError:Pr(tt,en("generation.errors.autoRepair")),pollError:void 0}}}let Ct=jt.artifact;return Kt.state==="ready"&&(Ct=await D4(Kt.jobId,Kt.revision)),{...jt,task:Kt,artifact:Ct,repairing:!1,repairMode:Kt.state==="running"?jt.repairMode:void 0,repairError:void 0,error:void 0,pollError:void 0}}catch(Kt){return{...jt,pollError:Pr(Kt,en("generation.errors.pollCandidate"))}}}));ye||(k(Ue),we=window.setTimeout(()=>void Ae(),n9t))};return Ae(),()=>{ye=!0,we!==void 0&&window.clearTimeout(we)}},[O.some(ye=>{var we;return((we=ye.task)==null?void 0:we.state)==="running"||ye.repairing})]);const z=O.find(ye=>ye.id===S)||O[0],Z=e==="create"&&!n,ne=i.find(ye=>H$(ye)===M)??null,W=n??ne,G=i.map(ye=>({value:H$(ye),label:`${Pc(ye)||u("generation.unnamedSpace")} · ${wh(ye.region||"cn-beijing",t)}`})),H=l9t(v),se=!!(d!=null&&d.enabled&&g.trim()&&!H&&w.length>0&&w.every(ye=>ye.model.trim()&&!aae(ye.model.trim()))),Y=(ye,we)=>{x(Ae=>Ae.map(He=>He.id===ye?{...He,...we}:He))},X=async ye=>{const we={...ye,model:ye.model.trim()},Ae=ye.style==="custom"?ye.customStyle.trim():ye.style;try{const He=await O2t({operation:e,intent:g.trim(),model:we.model,style:Ae,name:v.trim()||void 0,source:o});return{id:ye.id,config:we,task:He}}catch(He){return{id:ye.id,config:we,error:Pr(He,en("generation.errors.createCandidate"))}}},ie=async()=>{if(!se)return;j(!0),I(null);const ye=w.map(Ae=>({id:Ae.id,config:Ae}));k(ye),C(w[0].id);const we=await Promise.all(w.map(X));k(we)},ee=async ye=>{k(Ae=>Ae.map(He=>He.id===ye.id?{...He,error:void 0}:He));const we=await X(ye.config);k(Ae=>Ae.map(He=>He.id===ye.id?we:He))},be=async()=>{if(!(!(z!=null&&z.task)||!T.trim()||z.task.state!=="ready")){N("refine"),I(null);try{const ye=await M4({jobId:z.task.jobId,intent:T.trim(),expectedRevision:z.task.revision});k(we=>we.map(Ae=>Ae.id===z.id?{...Ae,task:ye,artifact:void 0}:Ae)),R("")}catch(ye){I(Pr(ye,en("generation.errors.refine")))}finally{N("")}}},ue=async()=>{if(!(!(z!=null&&z.task)||!V$(z.task))){N("refine"),I(null),k(ye=>ye.map(we=>we.id===z.id?{...we,repairing:!0,repairMode:"manual",repairError:void 0}:we));try{const ye=await M4({jobId:z.task.jobId,intent:rae(z.task),expectedRevision:z.task.revision});k(we=>we.map(Ae=>Ae.id===z.id?{...Ae,task:ye,artifact:void 0,repairing:!1,repairMode:"manual",repairError:void 0}:Ae))}catch(ye){k(we=>we.map(Ae=>Ae.id===z.id?{...Ae,repairing:!1,repairMode:void 0,repairError:Pr(ye,en("generation.errors.repairAgain"))}:Ae))}finally{N("")}}},pe=async()=>{if(!(!(z!=null&&z.task)||z.task.state!=="ready"||L)){N("publish"),I(null);try{if(!W)throw new Error(en("generation.errors.selectSpace"));const ye=z.artifact||await D4(z.task.jobId,z.task.revision),we=(o==null?void 0:o.region)||W.region||"";if(!AD(we))throw new Error(en("generation.errors.unsupportedRegion"));await E2t({jobId:z.task.jobId,expectedRevision:z.task.revision,expectedArtifactSha256:ye.sha256,disposition:e==="optimize"?"update-source":"create-new",skillSpaceIds:[W.id],projectName:(o==null?void 0:o.projectName)||W.projectName,region:we,onProgress:Ae=>_(Ae.message)}),F(z.id),c()}catch(ye){I(Pr(ye,en("generation.errors.upload")))}finally{N(""),_("")}}},ke=async()=>{if(!(!(z!=null&&z.task)||z.task.state!=="ready")){N("download");try{const ye=z.artifact||await D4(z.task.jobId,z.task.revision);await A2t(z.task.jobId,z.task.revision,ye.sha256)}catch(ye){I(Pr(ye,en("generation.errors.download")))}finally{N("")}}},je=async()=>{O.some(ye=>{var we;return((we=ye.task)==null?void 0:we.state)==="running"})&&!window.confirm(en("generation.leaveConfirmation"))||(await Promise.allSettled(O.flatMap(ye=>{var we;return((we=ye.task)==null?void 0:we.state)==="running"?[S2t({jobId:ye.task.jobId,expectedRevision:ye.task.revision})]:[]})),l())},Pe=e==="create"?u("generation.createTitle"):u("generation.optimizeTitle",{name:(o==null?void 0:o.name)||u("generation.skillFallback")}),Ee=ye=>{var we;return((we=d==null?void 0:d.models.find(Ae=>Ae.id===ye))==null?void 0:we.label)||ye},ze=ye=>ye.config.style==="custom"?ye.config.customStyle.trim()||u("generation.styles.customFallback"):u(nae[ye.config.style]),_e=[...Object.entries(nae).map(([ye,we])=>({value:ye,label:u(we)})),{value:"custom",label:u("generation.styles.custom")}],ae=ye=>ye.error||ye.repairError?u("generation.stages.failed"):a9t(ye),le=ye=>!ye.error&&!ye.repairError&&(ye.repairing||!ye.task||ye.task.state==="running"),ge=O.some(ye=>{var we;return((we=ye.task)==null?void 0:we.state)==="ready"});return a.jsxs("section",{className:"skill-generation",children:[a.jsxs("header",{className:"skill-generation__header",children:[a.jsx("button",{type:"button",className:"skillcenter-back",onClick:()=>void je(),"aria-label":u("generation.back"),children:a.jsx(c9t,{})}),a.jsxs("div",{children:[a.jsx("h1",{children:Pe}),a.jsx("p",{children:Pc(n)||u("generation.home")})]}),O.length>0?a.jsx("span",{className:"skill-generation__ttl",children:o9t(z==null?void 0:z.task,q)}):null]}),E?a.jsxs("div",{className:"skill-generation__workspace",children:[a.jsx("div",{className:"skill-generation__candidate-tabs",role:"tablist","aria-label":u("generation.candidates"),children:O.map(ye=>a.jsxs("button",{type:"button",role:"tab","aria-selected":(z==null?void 0:z.id)===ye.id,className:(z==null?void 0:z.id)===ye.id?"is-active":"",onClick:()=>C(ye.id),children:[a.jsxs("span",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.style")}),a.jsx("strong",{children:ze(ye)})]}),a.jsxs("span",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.model")}),a.jsx("strong",{children:Ee(ye.config.model)})]}),a.jsxs("span",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.progress")}),a.jsxs("strong",{children:[le(ye)?a.jsx(sae,{}):null,ae(ye)]})]})]},ye.id))}),z?a.jsxs("div",{className:"skill-generation__candidate",children:[a.jsxs("section",{className:"skill-generation__activity",children:[a.jsx("header",{children:a.jsxs("div",{className:"skill-generation__candidate-summary",children:[a.jsxs("div",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.style")}),a.jsx("strong",{children:ze(z)})]}),a.jsxs("div",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.model")}),a.jsx("strong",{children:Ee(z.config.model)})]}),a.jsxs("div",{className:"skill-generation__summary-row","aria-live":"polite",children:[a.jsx("span",{children:u("generation.progress")}),a.jsxs("strong",{children:[le(z)?a.jsx(sae,{}):null,le(z)?a.jsx(fn,{children:ae(z)}):ae(z)]})]})]})}),z.task?a.jsx(jNt,{activities:z.task.activities}):null,z.pollError?a.jsx("div",{className:"skill-inline-notice",children:a.jsx(Ns,{error:z.pollError})}):null,z.repairError?a.jsx("div",{className:"skill-inline-notice",children:a.jsx(Ns,{error:z.repairError})}):null,z.error?a.jsxs("div",{className:"skill-inline-error",children:[a.jsx(Ns,{error:z.error}),a.jsx("button",{type:"button",onClick:()=>void ee(z),children:u("generation.retryCandidate")})]}):null,(Oe=z.task)!=null&&Oe.validation&&!z.task.validation.valid&&!z.repairing&&z.task.state==="failed"?a.jsxs("div",{className:"skill-validation-errors",children:[a.jsx("strong",{children:u("generation.formatValidationFailed")}),z.task.validation.errors.map(ye=>a.jsx("p",{children:ye},ye)),V$(z.task)?a.jsx("button",{type:"button",disabled:!!A,onClick:()=>void ue(),children:u("generation.repairAgain")}):null]}):null]}),a.jsxs("section",{className:"skill-generation__files",children:[a.jsxs("header",{children:[a.jsx("h2",{children:u("generation.files")}),((Se=z.task)==null?void 0:Se.state)==="ready"?a.jsx("button",{type:"button",onClick:()=>void ke(),disabled:!!A,children:u("generation.downloadZip")}):null]}),z.artifact?a.jsx(fL,{files:z.artifact.files}):a.jsx("div",{className:"skill-generation__files-empty",children:((We=z.task)==null?void 0:We.state)==="ready"?u("generation.loadingFiles"):u("generation.filesPending")})]}),((Ye=z.task)==null?void 0:Ye.state)==="ready"?a.jsxs("div",{className:"skill-generation__ready-actions",children:[Z?a.jsx("div",{className:"skill-generation__publish-target",children:a.jsx(RN,{label:u("generation.uploadToSpace"),value:M,options:G,onChange:V,disabled:r,placeholder:u(r?"generation.loadingSpaces":"generation.selectSpace")})}):null,a.jsxs("footer",{className:"skill-generation__followup",children:[a.jsx("textarea",{value:T,onChange:ye=>R(ye.target.value),placeholder:u("generation.continuePlaceholder")}),a.jsx("button",{type:"button",className:"skill-button",disabled:!T.trim()||!!A,onClick:()=>void be(),children:u("generation.continue")}),a.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!!A||!!L||!W,onClick:()=>void pe(),children:A==="publish"?D||u("generation.uploading"):u(e==="optimize"?"generation.overwrite":Z?"generation.uploadToSelectedSpace":"generation.uploadToCurrentSpace")})]})]}):null,P?a.jsx("div",{className:"skill-inline-error skill-generation__action-error",children:a.jsx(Ns,{error:P})}):null]}):null,!ge&&O.every(ye=>ye.error)?a.jsx("div",{className:"skill-inline-error",children:u("generation.allCandidatesFailed")}):null]}):a.jsxs("div",{className:"skill-generation__setup",children:[a.jsx("div",{className:"skill-generation__section-head is-basic",children:a.jsx("div",{children:a.jsx("strong",{children:u("generation.basicInfo")})})}),a.jsxs("label",{children:[a.jsxs("span",{children:[u("generation.goal"),a.jsx("span",{className:"skill-required-mark","aria-hidden":"true",children:"*"})]}),a.jsx("textarea",{required:!0,value:g,onChange:ye=>b(ye.target.value),placeholder:u(e==="create"?"generation.createIntentPlaceholder":"generation.optimizeIntentPlaceholder")})]}),a.jsxs("label",{children:[a.jsx("span",{children:u("generation.skillName")}),a.jsx("input",{value:v,onChange:ye=>y(ye.target.value),placeholder:u("generation.autoNamePlaceholder"),"aria-invalid":!!H,"aria-describedby":"skill-name-help"}),H?a.jsx("span",{id:"skill-name-help",className:"skill-generation__field-error",role:"alert",children:H}):a.jsx("span",{id:"skill-name-help",className:"skill-generation__field-help",children:u("generation.nameHelp")})]}),a.jsx("div",{className:"skill-generation__section-head",children:a.jsxs("div",{children:[a.jsx("strong",{children:u(e==="create"?"generation.createPlans":"generation.optimizePlans")}),a.jsx("span",{children:u(e==="create"?"generation.createPlansDescription":"generation.optimizePlansDescription")})]})}),a.jsxs("div",{className:"skill-generation__groups",children:[w.map((ye,we)=>a.jsxs("article",{className:"skill-generation__group",children:[a.jsxs("header",{children:[a.jsx("strong",{children:u("generation.plan",{count:we+1})}),w.length>1?a.jsx("button",{type:"button",onClick:()=>x(Ae=>Ae.filter(He=>He.id!==ye.id)),children:u("generation.remove")}):null]}),a.jsx(RN,{label:u("generation.model"),required:!0,value:ye.model,options:(d==null?void 0:d.models.map(Ae=>({value:Ae.id,label:Ae.label})))||[],onChange:Ae=>Y(ye.id,{model:Ae}),allowCustom:!0,placeholder:u("generation.modelPlaceholder"),error:aae(ye.model.trim())}),a.jsx(RN,{label:u("generation.style"),required:!0,value:ye.style,options:_e,onChange:Ae=>Y(ye.id,{style:Ae})}),ye.style==="custom"?a.jsxs("label",{children:[a.jsx("span",{children:u("generation.customStyle")}),a.jsx("textarea",{value:ye.customStyle,onChange:Ae=>Y(ye.id,{customStyle:Ae.target.value}),placeholder:u("generation.customStylePlaceholder")})]}):null]},ye.id)),d&&w.lengthx(ye=>[...ye,iae(ye.length,d)]),children:u("generation.addConfiguration")}):null]}),h?a.jsx("div",{className:"skill-inline-error",children:a.jsx(Ns,{error:h})}):null,d&&!d.enabled?a.jsx("div",{className:"skill-inline-notice",children:u("generation.notConfigured")}):null,a.jsx("div",{className:"skill-generation__setup-actions",children:a.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!se,onClick:()=>void ie(),children:u("generation.generate")})})]})]})}async function SFe(e,t,n,i){const r=new URLSearchParams({region:e.region}),s=await fetch(Ta(`/web/skill-management/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/versions?${r}`),{...t,headers:ul(uc(t.headers)),signal:po(e.signal,i)});if(!s.ok)throw await nT(s,n);return s.json()}function d9t(e){return SFe(e,{},Q("skills.listVersionsFailed"),ho)}function f9t(e){return SFe(e,{method:"POST",headers:{"Content-Type":"application/zip"},body:e.file},Q("skills.uploadVersionFailed"),hr)}function EFe(e){const t=new Map;for(const n of e){const i=`${n.sourceSkillId}:${n.version}`,r=t.get(i);(!r||n.submittedAt>r.submittedAt)&&t.set(i,n)}return t}function h9t(e,t,n,i){const r=i.trim().toLocaleLowerCase();return e.filter(s=>s.kind===t&&(n==="all"||s.status===n)&&`${s.name} ${s.description} ${s.author} ${s.version}`.toLocaleLowerCase().includes(r))}const CFe=p.createContext(void 0);function Ib(e){const t=p.useContext(CFe);if(!e&&t===void 0)throw new Error(Vc(27));return t}const nv=p.forwardRef(function(t,n){const{render:i,className:r,style:s,forceRender:o=!1,...l}=t,c=Ib(),u=c.useState("open"),d=c.useState("nested"),f=c.useState("mounted"),h=c.useState("transitionStatus");return Ra("div",t,{state:{open:u,transitionStatus:h},ref:[c.context.backdropRef,n],stateAttributesMapping:wje,props:[{role:"presentation",hidden:!f,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:o||!d})}),hL=p.forwardRef(function(t,n){const{render:i,className:r,style:s,disabled:o=!1,nativeButton:l=!0,...c}=t,u=Ib(),d=u.useState("open"),{getButtonProps:f,buttonRef:h}=GD({disabled:o,native:l}),m={disabled:o};function g(b){d&&u.setOpen(!1,fa(A_e,b.nativeEvent))}return Ra("button",t,{state:m,ref:[n,h],props:[{onClick:g},c,f]})}),LT=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:o,...l}=t,c=Ib(),u=em(o);return c.useSyncedValueWithCleanup("descriptionElementId",u),Ra("p",t,{ref:n,props:[{id:u},l]})}),AFe=p.createContext(void 0);function p9t(){const e=p.useContext(AFe);if(e===void 0)throw new Error(Vc(26));return e}const m9t={...fV,...KD,nestedDialogOpen(e){return e?{"data-nested-dialog-open":""}:null}},iv=p.forwardRef(function(t,n){const{render:i,className:r,style:s,finalFocus:o,initialFocus:l,...c}=t,u=Ib(),d=u.useState("descriptionElementId"),f=u.useState("disablePointerDismissal"),h=u.useState("floatingRootContext"),m=u.useState("popupProps"),g=u.useState("modal"),b=u.useState("mounted"),v=u.useState("nested"),y=u.useState("nestedOpenDialogCount"),w=u.useState("open"),x=u.useState("openMethod"),O=u.useState("titleElementId"),k=u.useState("transitionStatus"),S=u.useState("role"),C=h.useState("floatingId");p9t(),zA({open:w,ref:u.context.popupRef,onComplete(){var N,P;w&&((P=(N=u.context).onOpenChangeComplete)==null||P.call(N,!0))}});const E=l===void 0?ije(u.context.popupRef):l,j=y>0,T=u.useStateSetter("popupElement"),A=Ra("div",t,{state:{open:w,nested:v,transitionStatus:k,nestedDialogOpen:j},props:[m,{id:C,"aria-labelledby":O,"aria-describedby":d,role:S,...nje,hidden:!b,onKeyDown(N){cLe.has(N.key)&&N.stopPropagation()},style:{"--nested-dialogs":y}},c],ref:[n,u.context.popupRef,T],stateAttributesMapping:m9t});return a.jsx(F_e,{context:h,openInteractionType:x,disabled:!b,closeOnFocusOut:!f,initialFocus:E,returnFocus:o,modal:g!==!1,restoreFocus:"popup",children:A})}),rv=p.forwardRef(function(t,n){const{keepMounted:i=!1,...r}=t,s=Ib(),o=s.useState("mounted"),l=s.useState("modal"),c=s.useState("open");return o||i?a.jsx(AFe.Provider,{value:i,children:a.jsxs(I_e,{ref:n,...r,children:[o&&l===!0&&a.jsx(oLe,{ref:s.context.internalBackdropRef,inert:iV(!c)}),t.children]})}):null});function g9t({store:e,parentContext:t,isDrawer:n}){const i=e.useState("open"),r=e.useState("disablePointerDismissal"),s=e.useState("modal"),o=e.useState("popupElement"),l=e.useState("floatingRootContext"),[c,u]=p.useState(0),[d,f]=p.useState(0),h=c===0,m=U_e(l,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:s==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(g){if(!e.context.outsidePressEnabledRef.current||"button"in g&&g.button!==0)return!1;if("touches"in g){if(g.type==="touchend"){if(g.changedTouches.length!==1||g.touches.length!==0)return!1}else if(g.touches.length!==1)return!1}const b=uo(g);if(h&&!r){if(s){const v=e.context.internalBackdropRef.current,y=e.context.backdropRef.current;return v||y?v===b||y===b||ii(b,o)&&!(b!=null&&b.hasAttribute("data-base-ui-portal")):!0}return!0}return!1},escapeKey:h});return lLe(i&&s===!0,o),e.useContextCallback("onNestedDialogOpen",(g,b)=>{u(g),f(b)}),Jn(()=>(t!=null&&t.onNestedDialogOpen&&(i?t.onNestedDialogOpen(c+1,d+(n?1:0)):t.onNestedDialogOpen(0,0)),()=>{t!=null&&t.onNestedDialogOpen&&i&&t.onNestedDialogOpen(0,0)}),[n,i,c,d,t]),uje(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:c,nestedOpenDrawerCount:d}),null}const b9t={...mje,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role};class y9t extends BD{constructor(n,i,r){const s=new cV,o=v9t(n,s,i,r);super(o,x9t(s),b9t);Zt(this,"setOpen",(n,i)=>{var s,o;if(i.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!n&&i.trigger==null&&this.state.activeTriggerId!=null&&(i.trigger=this.state.activeTriggerElement??void 0),(o=(s=this.context).onOpenChange)==null||o.call(s,n,i),i.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,i);const r={open:n};aje(r,n,i.trigger),this.update(r)})}}function v9t(e,t,n,i=!1){const r={...fje(),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e};return r.floatingRootContext=hje(t,n,i),r}function x9t(e){return{popupRef:p.createRef(),backdropRef:p.createRef(),internalBackdropRef:p.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function w9t(e,t){const{children:n,open:i,defaultOpen:r=!1,onOpenChange:s,onOpenChangeComplete:o,disablePointerDismissal:l=!1,modal:c=!0,actionsRef:u,handle:d,triggerId:f,defaultTriggerId:h=null}=t,m=e==="drawer",g=c,b=l,v="dialog",y=Ib(!0),w=y!=null,x={modal:g,disablePointerDismissal:b,nested:w,role:v},O=rje((T,R)=>new y9t({open:r,openProp:i,activeTriggerId:h,triggerIdProp:f,...x},T,R),!0);O.useControlledProp("openProp",i),O.useControlledProp("triggerIdProp",f),O.useSyncedValues(x),O.useContextCallback("onOpenChange",s),O.useContextCallback("onOpenChangeComplete",o);const k=O.useState("open"),S=O.useState("mounted"),C=O.useState("payload");dje(O,k),lje(O);const{forceUnmount:E}=cje(k,O);p.useImperativeHandle(u,()=>({unmount:E,close:()=>O.setOpen(!1,fa(__e))}),[E,O]);const j=k||S;return a.jsxs(CFe.Provider,{value:O,children:[d&&a.jsx(sje,{handle:d,store:O}),j&&a.jsx(g9t,{store:O,parentContext:y==null?void 0:y.context,isDrawer:m}),typeof n=="function"?n({payload:C}):n]})}function sv(e){return w9t("dialog",e)}const yO=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:o,...l}=t,c=Ib(),u=em(o);return c.useSyncedValueWithCleanup("titleElementId",u),Ra("h2",t,{ref:n,props:[{id:u},l]})}),TFe=p.forwardRef(function(t,n){const{render:i,className:r,style:s,disabled:o=!1,nativeButton:l=!0,id:c,payload:u,handle:d,...f}=t,h=Ib(!0),g=gje(d)??h;if(!g)throw new Error(Vc(79));const b=em(c),v=g.useState("floatingRootContext"),y=g.useState("isOpenedByTrigger",b),w=g.useState("triggerPopupId",b),x=p.useRef(null),{registerTrigger:O,isMountedByThisTrigger:k}=oje(b,x,g,{payload:u}),{getButtonProps:S,buttonRef:C}=GD({disabled:o,native:l}),E=B_e(v),j=rLe(()=>g.select("open"),A=>{g.set("openMethod",A)}),T={disabled:o,open:y},R=g.useState("triggerProps",k);return Ra("button",t,{state:T,ref:[C,n,O,x],props:[E.reference,R,j,{[sV]:"",id:b,"aria-haspopup":"dialog","aria-expanded":y,"aria-controls":w},f,S],stateAttributesMapping:xje})});async function _Fe(e,t){const n=new URLSearchParams({region:e.region}),i=t?"/retry":`?${n}`,r=await fetch(Ta(`/web/skill-management/reviews/${encodeURIComponent(e.id)}/score${i}`),{method:t?"POST":"GET",headers:ul(uc(t?{"Content-Type":"application/json"}:void 0)),...t?{body:JSON.stringify({region:e.region})}:{},signal:po(e.signal,ho)});if(!r.ok)throw await nT(r,bn.t(t?"score.retryFailed":"score.loadFailed",{ns:"reviews"}));return r.json()}const O9t=e=>_Fe(e,!1),k9t=e=>_Fe(e,!0),S9t=["safety","usability","completeness","reliability","maintainability"];function jFe(e){return(e==null?void 0:e.status)==="queued"||(e==null?void 0:e.status)==="running"}function E9t(e){if(e.status!=="not_requested")return{status:e.status,overallScore:e.overallScore,scoredAt:e.scoredAt,modelName:e.modelName,rubricVersion:e.rubricVersion,error:e.error}}function BW({score:e}){const{t}=Te("reviews");return a.jsx("span",{className:`review-score-label is-${(e==null?void 0:e.status)||"unscored"}`,children:(e==null?void 0:e.status)==="completed"?typeof e.overallScore=="number"?t("score.points",{score:e.overallScore}):t("score.insufficient"):t(`score.status.${(e==null?void 0:e.status)||"unscored"}`)})}function NFe({application:e,canRetry:t=!1,onScoreChanged:n}){const{t:i,i18n:r}=Te("reviews"),[s,o]=p.useState(e.aiReview),[l,c]=p.useState(!!e.aiReview),[u,d]=p.useState(null),[f,h]=p.useState({revision:0,retry:!1}),[m,g]=p.useState(""),b=p.useRef(-1),v=p.useRef(n);v.current=n;const{id:y,region:w}=e,x=!!e.aiReview;p.useEffect(()=>{if(!x&&f.revision===0)return;const S=new AbortController;let C,E=!1,j=!0;const T=async(N,P=!1)=>{var I;if(!(E||S.signal.aborted)&&!(!P&&document.visibilityState==="hidden")){E=!0,P&&c(!0),d(null);try{const D=await(N?k9t:O9t)({id:y,region:w,signal:S.signal});if(S.signal.aborted)return;o(D),(I=v.current)==null||I.call(v,D,N),j=jFe(D),j&&document.visibilityState!=="hidden"&&(C=setTimeout(()=>void T(!1),5e3))}catch(D){S.signal.aborted||(j=!1,d(Pr(D,i(N?"score.retryFailed":"score.loadFailed"))))}finally{E=!1,S.signal.aborted||c(!1)}}},R=()=>{clearTimeout(C),j&&document.visibilityState!=="hidden"&&T(!1)},A=f.retry&&b.current!==f.revision;return A&&(b.current=f.revision),T(A,!0),document.addEventListener("visibilitychange",R),()=>{S.abort(),clearTimeout(C),document.removeEventListener("visibilitychange",R)}},[y,w,x,f,i]);const O=(s==null?void 0:s.status)==="completed"?s.result:void 0;p.useEffect(()=>{if(!O){g("");return}const S=URL.createObjectURL(new Blob([JSON.stringify(O,null,2)],{type:"application/json"}));return g(S),()=>URL.revokeObjectURL(S)},[O]);const k=S=>h(C=>({revision:C.revision+1,retry:S}));return a.jsxs("section",{className:"review-score","aria-label":i("score.title"),children:[a.jsxs("div",{className:"review-score__header",children:[a.jsx("div",{"aria-live":"polite",children:l?a.jsx(fn,{children:i(f.retry?"score.starting":"score.loading")}):a.jsx(BW,{score:s})}),a.jsxs("div",{className:"review-score__actions",children:[m?a.jsx("a",{className:"cw-btn cw-btn-ghost",href:m,download:`${y}-score.json`,children:i("score.download")}):null,t&&(!s||s.status==="failed"||s.status==="not_requested")?a.jsx("button",{type:"button",className:"cw-btn cw-btn-ghost",disabled:l,onClick:()=>k(!0),children:i((s==null?void 0:s.status)==="failed"?"score.retry":"score.start")}):null]})]}),a.jsx("p",{className:"review-score__hint",children:i("score.hint")}),u?a.jsxs("div",{className:"review-score__error",role:"alert",children:[a.jsx(Ns,{error:u}),a.jsx("button",{type:"button",className:"cw-btn cw-btn-ghost",disabled:l,onClick:()=>k(!1),children:i("score.reload")})]}):null,s!=null&&s.error?a.jsx("div",{role:"alert",className:"review-score__error",children:a.jsxs("details",{className:"review-score__raw-error",open:!0,children:[a.jsx("summary",{children:i("score.originalError")}),a.jsx("pre",{children:s.error})]})}):(s==null?void 0:s.status)==="failed"?a.jsx("p",{role:"alert",className:"review-score__error",children:i("score.failed")}):null,O?a.jsxs(a.Fragment,{children:[O.riskFlags.length?a.jsxs("div",{className:"review-score__risks",children:[a.jsx("h3",{children:i("score.risks")}),a.jsx("ul",{children:O.riskFlags.map((S,C)=>a.jsxs("li",{children:[a.jsx("strong",{children:i(`score.severity.${S.severity}`)})," · ",S.reason]},`${C}:${S.reason}`))})]}):null,O.coverage&&!O.coverage.complete?a.jsxs("div",{className:"review-score__coverage",children:[a.jsx("h3",{children:i("score.coverage")}),a.jsx("p",{children:i("score.coverageIncomplete")}),a.jsx("p",{children:i("score.coverageCount",{included:O.coverage.includedFiles,total:O.coverage.totalFiles})}),a.jsxs("ul",{children:[O.coverage.omittedFiles.map(S=>a.jsx("li",{children:i("score.omittedFile",S)},`omitted:${S.path}`)),O.coverage.truncatedFiles.map(S=>a.jsx("li",{children:i("score.truncatedFile",S)},`truncated:${S.path}`))]})]}):null,a.jsx("dl",{className:"review-score__dimensions",children:S9t.map(S=>{const C=O.dimensions[S];return a.jsxs("div",{className:S==="safety"&&C.score!==null&&C.score<60?"is-risk":void 0,children:[a.jsxs("dt",{children:[a.jsx("span",{children:i(`score.dimensions.${S}`)}),a.jsx("strong",{children:C.score===null?i("score.insufficient"):i("score.points",{score:C.score})})]}),a.jsx("dd",{children:C.reason})]},S)})}),O.suggestions.length?a.jsxs("div",{className:"review-score__suggestions",children:[a.jsx("h3",{children:i("score.suggestions")}),a.jsx("ul",{children:O.suggestions.map((S,C)=>a.jsx("li",{children:S},`${C}:${S}`))})]}):null,a.jsxs("dl",{className:"review-score__metadata",children:[a.jsxs("div",{children:[a.jsx("dt",{children:i("score.model")}),a.jsx("dd",{children:O.modelName})]}),a.jsxs("div",{children:[a.jsx("dt",{children:i("score.rubric")}),a.jsx("dd",{children:O.rubricVersion})]}),a.jsxs("div",{children:[a.jsx("dt",{children:i("score.time")}),a.jsx("dd",{children:a.jsx("time",{dateTime:O.scoredAt,children:new Date(O.scoredAt).toLocaleString(r.language,{hour12:!1})})})]})]})]}):null]})}function C9t({application:e}){const{t}=Te("reviews"),[n,i]=p.useState(!1),[r,s]=p.useState(e.aiReview),o=p.useId();return p.useEffect(()=>s(e.aiReview),[e.aiReview]),a.jsxs("div",{className:"review-score-history",children:[a.jsxs("button",{type:"button",className:"review-score-history__toggle","aria-expanded":n,"aria-controls":o,onClick:()=>i(l=>!l),children:[a.jsx("span",{children:t("score.title")}),a.jsx(BW,{score:r}),a.jsx("span",{children:t(n?"score.collapse":"score.expand")})]}),n?a.jsx("div",{id:o,children:a.jsx(NFe,{application:e,onScoreChanged:s},`${e.region}:${e.id}`)}):null]})}function $T({status:e}){const{t}=Te("reviews");return a.jsxs("span",{className:`review-status is-${e}`,children:[a.jsx("span",{"aria-hidden":"true"}),t(`status.${e}`)]})}function UW({person:e,fallback:t,compact:n=!1}){const{t:i}=Te("reviews"),[r,s]=p.useState(""),o=(e==null?void 0:e.name)||t||i("detail.unknownReviewer"),l=e==null?void 0:e.avatarUrl;return a.jsxs("span",{className:`review-person${n?" is-compact":""}`,children:[l&&l!==r?a.jsx("img",{className:"review-person__avatar",src:l,alt:"",referrerPolicy:"no-referrer",onError:()=>s(l)}):a.jsx("span",{className:"review-person__avatar is-fallback","aria-hidden":"true",children:Array.from(o)[0]}),a.jsxs("span",{className:"review-person__text",children:[a.jsx("span",{children:o}),!n&&(e!=null&&e.email)?a.jsx("span",{className:"review-person__email",children:e.email}):null]})]})}function QW({application:e}){const{t,i18n:n}=Te("reviews");return a.jsxs("div",{className:"review-outcome",children:[a.jsx($T,{status:e.status}),e.reviewer||e.reviewedBy||e.reviewedAt?a.jsxs("dl",{className:"review-outcome__facts",children:[e.reviewer||e.reviewedBy?a.jsxs("div",{children:[a.jsx("dt",{children:t(`detail.${e.status==="returned"?"returnedBy":e.status==="approved"?"approvedBy":"reviewer"}`)}),a.jsx("dd",{children:a.jsx(UW,{person:e.reviewer,fallback:e.reviewedBy})})]}):null,e.reviewedAt?a.jsxs("div",{children:[a.jsx("dt",{children:t("detail.reviewedAt")}),a.jsx("dd",{children:a.jsx("time",{dateTime:e.reviewedAt,children:new Date(e.reviewedAt).toLocaleString(n.language,{hour12:!1})})})]}):null]}):null,e.reason?a.jsxs("div",{className:"review-outcome__message is-returned",children:[a.jsx("strong",{children:t("decision.reason")}),a.jsx("p",{children:e.reason})]}):null,e.comment?a.jsxs("div",{className:"review-outcome__message",children:[a.jsx("strong",{children:t("detail.comment")}),a.jsx("p",{children:e.comment})]}):null,e.status==="pending"?a.jsx("p",{className:"review-outcome__hint",children:t("detail.pendingHint")}):null,e.status==="approving"?a.jsx("p",{className:"review-outcome__hint",children:t("detail.approvingHint")}):null]})}function zW({applications:e}){const{t,i18n:n}=Te("reviews");return e.length?a.jsx("ol",{className:"review-source-history",children:[...e].sort((i,r)=>r.submittedAt.localeCompare(i.submittedAt)).map(i=>a.jsxs("li",{children:[a.jsxs("div",{className:"review-source-history__submission",children:[a.jsx("strong",{children:i.version}),a.jsx("span",{children:t("detail.submitted",{name:i.author})}),a.jsx("time",{dateTime:i.submittedAt,children:new Date(i.submittedAt).toLocaleString(n.language,{hour12:!1})})]}),a.jsx(QW,{application:i}),a.jsx(C9t,{application:i})]},i.id))}):a.jsx("p",{className:"review-outcome__hint",children:t("detail.noHistory")})}function A9t({name:e,applications:t,onClose:n}){const{t:i}=Te("reviews"),r=p.useRef(document.activeElement instanceof HTMLElement?document.activeElement:null);return a.jsx(sv,{open:!0,onOpenChange:s=>{s||n()},children:a.jsxs(rv,{children:[a.jsx(nv,{className:"review-backdrop"}),a.jsxs(iv,{className:"review-drawer",finalFocus:()=>{var s;return(s=r.current)!=null&&s.isConnected?r.current:null},children:[a.jsxs("header",{className:"review-drawer__header",children:[a.jsxs("div",{children:[a.jsx(yO,{children:i("detail.history")}),a.jsx(LT,{children:e})]}),a.jsx(hL,{className:"review-icon-button","aria-label":i("actions.close"),children:a.jsx(xT,{})})]}),a.jsx("div",{className:"review-drawer__body",children:a.jsx(zW,{applications:t})})]})]})})}function T9t({skill:e,space:t,region:n,reviews:i,onClose:r,onChanged:s,onSubmitReview:o}){const{t:l,i18n:c}=Te("ui"),[u,d]=p.useState(null),[f,h]=p.useState(e.version),[m,g]=p.useState(!0),[b,v]=p.useState(null),[y,w]=p.useState(null),[x,O]=p.useState([]),[k,S]=p.useState(!1),[C,E]=p.useState(null),[j,T]=p.useState(0),[R,A]=p.useState(0),[N,P]=p.useState(null),I=p.useRef(null),D=p.useRef(null),_=p.useRef(null),L=p.useRef(!1),F=p.useRef(!0),M=p.useRef({onClose:r,busy:N});M.current={onClose:r,busy:N};const V=u==null?void 0:u.items.find(G=>G.version===f),q=p.useMemo(()=>EFe(i),[i]),U=q.get(`${e.skillId}:${f}`),J=i.filter(G=>G.sourceSkillId===e.skillId&&G.version===f&&G.id!==(U==null?void 0:U.id)),z=!!(o&&(u!=null&&u.canUpdate)&&V&&["running","ready"].includes(V.status.toLowerCase())&&(!U||U.status==="returned"));p.useEffect(()=>{var se;F.current=!0;const G=document.activeElement instanceof HTMLElement?document.activeElement:null;(se=_.current)==null||se.focus();const H=Y=>{var be;if(Y.key==="Escape"&&(Y.preventDefault(),M.current.busy||M.current.onClose()),Y.key!=="Tab")return;const X=Array.from(((be=I.current)==null?void 0:be.querySelectorAll('button:not([disabled]), input:not([disabled]):not([type="file"]), a[href], summary, [tabindex="0"]'))||[]),ie=X[0],ee=X[X.length-1];Y.shiftKey&&document.activeElement===ie&&(Y.preventDefault(),ee==null||ee.focus()),!Y.shiftKey&&document.activeElement===ee&&(Y.preventDefault(),ie==null||ie.focus())};return document.addEventListener("keydown",H),()=>{F.current=!1,document.removeEventListener("keydown",H),G!=null&&G.isConnected&&G.focus()}},[]),p.useEffect(()=>{const G=new AbortController;return g(!0),v(null),d9t({spaceId:t.id,skillId:e.skillId,region:n,signal:G.signal}).then(H=>{G.signal.aborted||(d(H),h(se=>{var Y;return H.items.some(X=>X.version===se)?se:((Y=H.items[0])==null?void 0:Y.version)||""}))}).catch(H=>{G.signal.aborted||v(Pr(H,l("skillCenter.versions.loadFailed")))}).finally(()=>{G.signal.aborted||g(!1)}),()=>G.abort()},[t.id,e.skillId,n,j,l]),p.useEffect(()=>{if(!f||!V)return;let G=!0;return S(!0),E(null),O([]),wIe({spaceId:t.id,skillId:e.skillId,region:n,version:f}).then(H=>{G&&O(H)}).catch(H=>{G&&E(Pr(H,l("skillCenter.versions.filesFailed")))}).finally(()=>{G&&S(!1)}),()=>{G=!1}},[t.id,e.skillId,n,f,!!V,R,l]);async function Z(G){if(!L.current){L.current=!0,P("upload"),w(null);try{const H=await f9t({spaceId:t.id,skillId:e.skillId,region:n,file:G});if(!F.current)return;h(H.version),T(se=>se+1),s()}catch(H){F.current&&w(Pr(H,l("skillCenter.versions.uploadFailed")))}finally{L.current=!1,F.current&&P(null)}}}async function ne(){if(!(!z||!o||L.current)){L.current=!0,P("submit"),w(null);try{await o(f)}catch(G){F.current&&w(Pr(G,l("skillCenter.versions.submitFailed")))}finally{L.current=!1,F.current&&P(null)}}}function W(G){if(!G)return"—";const H=new Date(G);return Number.isNaN(H.getTime())?G:H.toLocaleString(c.resolvedLanguage||c.language)}return a.jsx("div",{className:"skill-detail-backdrop",onMouseDown:G=>{G.target===G.currentTarget&&!N&&r()},children:a.jsxs("section",{className:"skill-detail-dialog skill-versions",role:"dialog","aria-modal":"true","aria-labelledby":"skill-versions-title",ref:I,children:[a.jsxs("header",{className:"skill-detail-head",children:[a.jsx("div",{className:"skill-detail-heading",children:a.jsxs("div",{children:[a.jsx("h2",{id:"skill-versions-title",children:l("skillCenter.versions.title")}),a.jsx("p",{title:e.skillName,children:e.skillName})]})}),a.jsxs("div",{className:"skill-detail-actions",children:[a.jsx("button",{type:"button",disabled:m||!!N,onClick:()=>T(G=>G+1),children:l("skillCenter.versions.refresh")}),u!=null&&u.canUpdate?a.jsx("button",{type:"button",disabled:!!N,onClick:()=>{var G;return(G=D.current)==null?void 0:G.click()},children:l(N==="upload"?"skillCenter.versions.uploading":"skillCenter.versions.upload")}):null,a.jsx("button",{type:"button",ref:_,disabled:!!N,onClick:r,children:l("skillCenter.versions.close")})]}),a.jsx("input",{className:"skill-versions__file-input",ref:D,type:"file",accept:".zip,application/zip","aria-label":l("skillCenter.versions.upload"),onChange:G=>{var se;const H=(se=G.target.files)==null?void 0:se[0];G.target.value="",H&&Z(H)}})]}),y?a.jsx("div",{className:"skill-versions__notice",role:"alert",children:a.jsx(Ns,{error:y})}):null,u!=null&&u.canUpdate?a.jsx("p",{className:"skill-versions__hint",children:l("skillCenter.versions.hint")}):null,a.jsxs("div",{className:"skill-versions__body",children:[a.jsxs("div",{className:"skill-versions__history","aria-busy":m,children:[m&&!u?a.jsx("p",{role:"status",children:l("skillCenter.versions.loading")}):null,b?a.jsxs("div",{role:"alert",children:[a.jsx(Ns,{error:b}),a.jsx("button",{className:"cw-btn cw-btn-ghost",type:"button",onClick:()=>T(G=>G+1),children:l("skillCenter.versions.retry")})]}):null,!m&&!b&&!(u!=null&&u.items.length)?a.jsx("p",{children:l("skillCenter.versions.empty")}):null,a.jsx("div",{className:"skill-versions__list",role:"list","aria-label":l("skillCenter.versions.title"),children:u==null?void 0:u.items.map(G=>a.jsx("div",{role:"listitem",children:a.jsxs("button",{type:"button",className:`skill-versions__version${f===G.version?" is-active":""}`,"aria-pressed":f===G.version,onClick:()=>h(G.version),children:[a.jsxs("span",{className:"skill-versions__version-title",children:[a.jsx("strong",{children:G.sourceVersion||G.version}),G.isCurrent?a.jsx("span",{children:l("skillCenter.versions.current")}):null]}),a.jsx("time",{dateTime:G.createdAt,children:W(G.createdAt)}),q.get(`${e.skillId}:${G.version}`)?a.jsx($T,{status:q.get(`${e.skillId}:${G.version}`).status}):a.jsx("span",{children:l(t.isShared?"skillCenter.versions.shared":"skillCenter.versions.notSubmitted")})]})},G.version))})]}),a.jsx("div",{className:"skill-versions__detail",children:V?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"skill-versions__summary",children:[a.jsxs("div",{children:[a.jsx("h3",{children:V.sourceVersion||V.version}),a.jsx("p",{title:V.description,children:V.description}),V.author||e.author?a.jsx("p",{className:"skill-versions__author",children:l("skillCenter.authorName",{name:V.author||e.author})}):null]}),o&&(u!=null&&u.canUpdate)?a.jsx("button",{type:"button",className:"cw-btn cw-btn-primary",disabled:!z||!!N,onClick:()=>void ne(),children:l(N==="submit"?"skillCenter.versions.submitting":"skillCenter.versions.submit")}):null]}),V.error?a.jsx("p",{className:"skill-versions__notice",role:"alert",children:V.error}):null,["running","ready"].includes(V.status.toLowerCase())?null:a.jsx("p",{role:"status",children:l("skillCenter.versions.processing",{status:V.status})}),U?a.jsx(QW,{application:U}):null,J.length?a.jsxs("details",{className:"skill-versions__review-history",children:[a.jsx("summary",{children:l("skillCenter.versions.history")}),a.jsx(zW,{applications:J})]}):null,a.jsx("div",{className:"skill-versions__files",children:k?a.jsx("p",{role:"status",children:l("skillCenter.versions.filesLoading")}):C?a.jsxs("div",{role:"alert",children:[a.jsx(Ns,{error:C}),a.jsx("button",{className:"cw-btn cw-btn-ghost",type:"button",onClick:()=>A(G=>G+1),children:l("skillCenter.versions.retry")})]}):x.length?a.jsx(fL,{files:x},f):a.jsx("p",{children:l("skillCenter.versions.filesEmpty")})})]}):null})]})]})})}function _9t({region:e,active:t,revision:n,onOpen:i}){const{t:r}=Te("ui"),[s,o]=p.useState(null),[l,c]=p.useState(null),[u,d]=p.useState(0);return p.useEffect(()=>{if(!t)return;const f=new AbortController;return c(null),jpt({region:e,signal:f.signal}).then(h=>{f.signal.aborted||o(h)}).catch(h=>{f.signal.aborted||c(Pr(h,r("skillCenter.sharedLoadFailed")))}),()=>f.abort()},[t,e,u,n,r]),a.jsxs("div",{className:"skillcenter-shared-space",children:[a.jsx(G0,{className:"skillcenter-space-card",title:r("skillCenter.sharedSpace"),description:r("skillCenter.sharedDescription"),status:a.jsx("span",{className:"skillcenter-shared-badge",children:r("skillCenter.sharedVisibility")}),metadata:[{label:r("skillCenter.skillCount"),value:s?r("skillCenter.skillCountValue",{count:s.skillCount??0}):r(l?"skillCenter.sharedLoadFailed":"skillCenter.sharedPreparing")}],detailAction:{label:r("common.viewDetails"),disabled:!s||!!l,onClick:()=>{s&&i(s)}},action:l?{label:r("common.reload"),onClick:()=>d(f=>f+1)}:void 0}),l?a.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:a.jsx(Ns,{error:l})}):null]})}function VW({title:e,children:t,onClose:n,className:i=""}){const{t:r}=Te("skills"),s=p.useRef(null);return p.useEffect(()=>{var l;(l=s.current)==null||l.focus();const o=c=>c.key==="Escape"&&n();return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[n]),a.jsx("div",{className:"skill-dialog-backdrop",onMouseDown:n,children:a.jsxs("section",{className:`skill-dialog${i?` ${i}`:""}`,role:"dialog","aria-modal":"true","aria-label":e,onMouseDown:o=>o.stopPropagation(),children:[a.jsxs("header",{children:[a.jsx("h2",{children:e}),a.jsx("button",{ref:s,type:"button",onClick:n,"aria-label":r("management.close"),children:r("management.close")})]}),t]})})}function j9t({region:e,regionOptions:t,onClose:n,onCreated:i}){const{t:r}=Te("skills"),[s,o]=p.useState(""),[l,c]=p.useState(""),[u,d]=p.useState(e),[f,h]=p.useState(!1),[m,g]=p.useState(null),b=async()=>{if(s.trim()){h(!0),g(null);try{const v=await _pt({name:s.trim(),description:l.trim()||void 0,region:u});i({...v,region:v.region||u})}catch(v){g(Pr(v,r("management.createSpaceFailed")))}finally{h(!1)}}};return a.jsxs(VW,{title:r("management.createSpaceTitle"),onClose:n,children:[a.jsxs("div",{className:"skill-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:r("management.name")}),a.jsx("input",{autoFocus:!0,value:s,maxLength:128,onChange:v=>o(v.target.value)})]}),a.jsx(RN,{label:r("management.region"),value:u,options:t,onChange:d,required:!0}),a.jsxs("label",{children:[a.jsx("span",{children:r("management.optionalDescription")}),a.jsx("textarea",{value:l,maxLength:1024,onChange:v=>c(v.target.value)})]}),m?a.jsx("div",{className:"skill-inline-error",children:a.jsx(Ns,{error:m})}):null]}),a.jsxs("footer",{children:[a.jsx("button",{type:"button",className:"skill-button",onClick:n,children:r("management.cancel")}),a.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!s.trim()||f,onClick:()=>void b(),children:r(f?"management.creating":"management.create")})]})]})}function N9t({space:e,region:t,onClose:n,onUpdated:i}){const{t:r}=Te("skills"),[s,o]=p.useState(e.name),[l,c]=p.useState(e.description||""),[u,d]=p.useState(!1),[f,h]=p.useState(null),m=async()=>{if(s.trim()){d(!0),h(null);try{const g=await Mpt({spaceId:e.id,name:s.trim(),description:l.trim()||void 0,region:t});i({...e,...g,skillCount:e.skillCount})}catch(g){h(Pr(g,r("management.updateSpaceFailed")))}finally{d(!1)}}};return a.jsxs(VW,{title:r("management.editSpaceTitle"),onClose:n,children:[a.jsxs("div",{className:"skill-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:r("management.name")}),a.jsx("input",{autoFocus:!0,value:s,maxLength:128,onChange:g=>o(g.target.value)})]}),a.jsxs("label",{children:[a.jsx("span",{children:r("management.optionalDescription")}),a.jsx("textarea",{value:l,maxLength:1024,onChange:g=>c(g.target.value)})]}),f?a.jsx("div",{className:"skill-inline-error",children:a.jsx(Ns,{error:f})}):null]}),a.jsxs("footer",{children:[a.jsx("button",{type:"button",className:"skill-button",onClick:n,children:r("management.cancel")}),a.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!s.trim()||u,onClick:()=>void m(),children:r(u?"management.saving":"management.save")})]})]})}function R9t({space:e,region:t,onClose:n,onUploaded:i}){const{t:r,i18n:s}=Te("skills"),[o,l]=p.useState(null),[c,u]=p.useState(null),[d,f]=p.useState(!1),[h,m]=p.useState(!1),[g,b]=p.useState(null),[v,y]=p.useState(!1),w=p.useRef(0),x=p.useRef(null),O=async S=>{const C=w.current+1;if(w.current=C,l(S),u(null),b(null),f(!!S),!!S)try{const E=await Fpt(S);w.current===C&&u({name:E.name,fileCount:E.files.length})}catch(E){w.current===C&&b(Pr(E,r("management.archiveValidationFailed")))}finally{w.current===C&&f(!1)}},k=async()=>{if(!(!o||!c)){m(!0),b(null);try{await $pt({spaceId:e.id,region:t,project:e.projectName,file:o}),i()}catch(S){b(Pr(S,r("management.uploadFailed")))}finally{m(!1)}}};return a.jsxs(VW,{title:r("management.uploadTitle",{name:Pc(e)}),className:"skill-upload-dialog",onClose:n,children:[a.jsxs("div",{className:"skill-dialog__body",children:[a.jsx("input",{ref:x,className:"skill-upload-dialog__input",type:"file",accept:".zip,application/zip",onChange:S=>{var C;return void O(((C=S.target.files)==null?void 0:C[0])||null)}}),a.jsxs("button",{type:"button",className:`skill-upload-dropzone${v?" is-dragging":""}`,onClick:()=>{var S;return(S=x.current)==null?void 0:S.click()},onDragEnter:S=>{S.preventDefault(),y(!0)},onDragOver:S=>{S.preventDefault(),S.dataTransfer.dropEffect="copy",y(!0)},onDragLeave:S=>{S.currentTarget.contains(S.relatedTarget)||y(!1)},onDrop:S=>{var C;S.preventDefault(),y(!1),O(((C=S.dataTransfer.files)==null?void 0:C[0])||null)},children:[a.jsx("strong",{children:o?o.name:r("management.dropzone")}),a.jsx("span",{children:o?r("fileTree.bytes",{value:new Intl.NumberFormat(s.resolvedLanguage).format(o.size)}):r("management.chooseLocalFile")})]}),a.jsx("p",{children:r("management.archiveHelp")}),d?a.jsx("div",{className:"skill-inline-notice",children:r("management.validating")}):null,c?a.jsx("div",{className:"skill-inline-notice",children:r("management.validationPassed",{name:c.name,count:c.fileCount})}):null,g?a.jsx("div",{className:"skill-inline-error",children:a.jsx(Ns,{error:g})}):null]}),a.jsxs("footer",{children:[a.jsx("button",{type:"button",className:"skill-button",onClick:n,children:r("management.cancel")}),a.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!o||!c||d||h,onClick:()=>void k(),children:r(h?"management.uploading":"management.upload")})]})]})}function I9t(e){if(typeof e=="number")return e<1e12?e*1e3:e;const t=e.trim(),n=Number(t);return/^\d+(?:\.\d+)?$/.test(t)?n<1e12?n*1e3:n:Date.parse(t)}function FT(e,t=Date.now(),n="zh-CN"){if(e===void 0||e==="")return"—";const i=I9t(e);if(!Number.isFinite(i))return"—";const r=Math.floor(Math.max(0,t-i)/1e3),s=new Intl.RelativeTimeFormat(n,{numeric:"always"}),o=(f,h,m)=>n.toLowerCase().startsWith("zh")?`${f} ${m}前`:s.format(-f,h);if(r<60)return o(r,"second","秒");const l=Math.floor(r/60);if(l<60)return o(l,"minute","分钟");const c=Math.floor(l/60);if(c<24)return o(c,"hour","小时");const u=Math.floor(c/24);if(u<30)return o(u,"day","天");const d=Math.floor(u/30);return d<12?o(d,"month","个月"):o(Math.floor(d/12),"year","年")}const P9t=12,oae=12;function yP({disabled:e,placement:t="top",children:n}){const{t:i}=Te("ui"),r=p.useId();return a.jsxs("span",{className:`skillcenter-disabled-action${e?" is-disabled":""} is-${t}`,tabIndex:e?0:void 0,"aria-describedby":e?r:void 0,children:[n,e?a.jsx("span",{id:r,className:"skillcenter-disabled-tooltip",role:"tooltip",children:i("skillCenter.sandboxNotConfigured")}):null]})}const D9t=new Set(["active","available","creating","disabled","enabled","failed","inactive","pending","published","ready","released","running","success","unavailable","unreleased","updating"]);function RFe(e,t){const n=(e||"").trim().toLowerCase();return D9t.has(n)?t(`skillCenter.status.${n}`):t("skillCenter.status.unknown")}function M9t(e){const t=(e||"").toLowerCase();return["active","available","enabled","published","ready","released","success"].includes(t)||t==="running"?"is-positive":["creating","pending","updating"].includes(t)?"is-progress":["failed","unavailable"].includes(t)?"is-danger":"is-muted"}function L9t(e,t){if(!e)return"";const n=e.trim(),i=Number(n),r=/^\d+(?:\.\d+)?$/.test(n)?new Date(i<1e12?i*1e3:i):new Date(n);return Number.isNaN(r.getTime())?e:new Intl.DateTimeFormat(t,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(r)}function lae(e){if(!e)return 0;const t=e.trim(),n=Number(t),i=/^\d+(?:\.\d+)?$/.test(t)?new Date(n<1e12?n*1e3:n):new Date(t);return Number.isNaN(i.getTime())?0:i.getTime()}function cu(e){return`${e.region||"default"}:${e.projectName||"default"}:${e.id}`}function $9t(e,t){const n=new Map(e.map(i=>[cu(i),i]));for(const i of t)n.set(cu(i),i);return[...n.values()].sort((i,r)=>lae(r.updatedAt)-lae(i.updatedAt))}function F9t(e){const t=e.replace(/\r\n/g,` `);if(!t.startsWith(`--- `))return e;const n=t.indexOf(` --- -`,4);return n>=0?t.slice(n+5).trimStart():e}function IFe(e,t){const n=(e||"").trim();return!n||[">",">-","|","|-"].includes(n)?t("common.noDescription"):n}function B9t(){return a.jsx("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:a.jsx("path",{d:"m7.5 7.5 9 9m0-9-9 9",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function U9t(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 5.5v13M5.5 12h13",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}function cae({direction:e}){return a.jsx("svg",{className:"icon",viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,children:a.jsx("path",{d:e==="left"?"m11.7 5.5-4.2 4.5 4.2 4.5":"m8.3 5.5 4.2 4.5-4.2 4.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function Q9t(){return a.jsx("span",{className:"skillcenter-loading-mark","aria-hidden":!0})}function z9t({page:e,total:t,pageSize:n,onPage:i}){const{t:r}=Te("ui"),s=Math.max(1,Math.ceil(t/n));return a.jsxs("footer",{className:"skillcenter-pager",children:[a.jsx("span",{children:r("skillCenter.totalItems",{count:t})}),a.jsxs("div",{className:"skillcenter-pager-actions",children:[a.jsx("button",{type:"button",onClick:()=>i(e-1),disabled:e<=1,"aria-label":r("common.previousPage"),children:a.jsx(cae,{direction:"left"})}),a.jsxs("span",{children:[e," / ",s]}),a.jsx("button",{type:"button",onClick:()=>i(e+1),disabled:e>=s,"aria-label":r("common.nextPage"),children:a.jsx(cae,{direction:"right"})})]})]})}function V9t({children:e}){return a.jsx("div",{className:"skillcenter-empty",children:e})}function q$({kind:e,title:t,description:n,error:i,action:r}){return a.jsx("div",{className:`skillcenter-page-state is-${e}`,role:e==="error"?"alert":"status",children:a.jsxs(Hn,{fill:"none",children:[a.jsx(Hn.Title,{children:t}),n?a.jsx(Hn.Description,{children:n}):null,i?a.jsx(Ns,{error:i}):null,r?a.jsx(Hn.ActionRow,{children:a.jsx(Tt,{color:"secondary",size:"lg",onClick:r.onClick,children:r.label})}):null]})})}function uae({errors:e,cloudProvider:t,fullPage:n=!1,onRetry:i}){const{t:r}=Te("ui");return a.jsxs("div",{className:`skillcenter-space-errors${n?" is-full-page":""}`,role:"alert",children:[a.jsxs("div",{className:"skillcenter-space-errors__content",children:[a.jsx("strong",{children:r(n?"skillCenter.cannotLoadSpaces":"skillCenter.someSpacesFailed")}),e.map(({region:s,error:o})=>a.jsxs("section",{children:[a.jsx("span",{children:xh(s,t)}),a.jsx(Ns,{error:o})]},s))]}),a.jsx("button",{type:"button",onClick:i,children:r("common.reload")})]})}function H9t({skill:e,space:t,region:n,cloudProvider:i,detail:r,files:s,loading:o,error:l,canOptimize:c,reviews:u,reviewsLoading:d,reviewsError:f,onOptimize:h,onDownload:m,onClose:g}){const{t:b}=Te("ui"),[v,y]=p.useState("files");return p.useEffect(()=>{const w=x=>{x.key==="Escape"&&g()};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[g]),a.jsx("div",{className:"skill-detail-backdrop",role:"presentation",onMouseDown:g,children:a.jsxs("section",{className:"skill-detail-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-detail-title",onMouseDown:w=>w.stopPropagation(),children:[a.jsxs("header",{className:"skill-detail-head",children:[a.jsx("div",{className:"skill-detail-heading",children:a.jsxs("div",{children:[a.jsx("h2",{id:"skill-detail-title",children:(r==null?void 0:r.name)||e.skillName}),a.jsx("p",{children:IFe((r==null?void 0:r.description)||e.skillDescription,b)})]})}),a.jsxs("div",{className:"skill-detail-actions",children:[a.jsx("button",{type:"button",onClick:m,disabled:s.length===0,children:b("skillCenter.downloadZip")}),t.isShared?null:a.jsx(bP,{disabled:!c,placement:"bottom",children:a.jsx("button",{type:"button",onClick:h,disabled:!c,children:b("skillCenter.optimize")})}),a.jsx("button",{type:"button",className:"skill-detail-close",onClick:g,"aria-label":b("skillCenter.closeSkillDetails"),children:a.jsx(B9t,{})})]})]}),a.jsxs("dl",{className:"skill-detail-meta",children:[a.jsxs("div",{children:[a.jsx("dt",{children:b("skillCenter.skillId")}),a.jsx("dd",{title:e.skillId,children:e.skillId})]}),a.jsxs("div",{children:[a.jsx("dt",{children:b("agentSelector.version")}),a.jsx("dd",{children:e.sourceVersion||(r==null?void 0:r.version)||e.version||"—"})]}),e.author?a.jsxs("div",{children:[a.jsx("dt",{children:b("skillCenter.author")}),a.jsx("dd",{children:e.author})]}):null,a.jsxs("div",{children:[a.jsx("dt",{children:b("agentSelector.status")}),a.jsx("dd",{children:RFe(e.skillStatus,b)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:b("skillCenter.skillSpace")}),a.jsx("dd",{title:Pc(t),children:t.isShared?b("skillCenter.sharedSpace"):Pc(t)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:b("myAgents.region")}),a.jsx("dd",{children:xh(n,i)})]})]}),a.jsx(ob,{className:"skill-detail-tabs",idPrefix:"skill-detail",ariaLabel:b("skillCenter.skillDetailSections"),value:v,items:[{id:"files",label:b("skillCenter.allFiles"),panelId:"skill-detail-panel"},{id:"reviews",label:b("skillCenter.reviewHistory"),panelId:"skill-detail-panel"}],onChange:y}),a.jsx("div",{className:`skill-detail-content${v==="files"?" skill-detail-content--files":" skill-detail-content--reviews"}`,id:"skill-detail-panel",role:"tabpanel","aria-labelledby":`skill-detail-${v}-tab`,children:v==="reviews"?d?a.jsx(cl,{}):f?a.jsx("div",{role:"alert",children:a.jsx(Ns,{error:f})}):a.jsx(zW,{applications:u}):o?a.jsxs("div",{className:"skillcenter-loading",children:[a.jsx(Q9t,{}),b("skillCenter.loadingSkillContent")]}):l?a.jsx("div",{className:"skillcenter-error",children:a.jsx(Ns,{error:l})}):s.length>0?a.jsx(dL,{files:s.map(w=>w.path.endsWith("SKILL.md")&&w.content?{...w,content:F9t(w.content)}:w)}):a.jsx(V9t,{children:b("skillCenter.noSkillContent")})})]})})}function q9t({space:e,canUseSandbox:t,onUpload:n,onSandbox:i,onClose:r}){const{t:s}=Te("ui");return p.useEffect(()=>{const o=l=>{l.key==="Escape"&&r()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[r]),a.jsx("div",{className:"skill-dialog-backdrop",role:"presentation",onMouseDown:r,children:a.jsxs("section",{className:"skill-dialog skill-add-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-add-dialog-title",onMouseDown:o=>o.stopPropagation(),children:[a.jsxs("header",{children:[a.jsxs("div",{children:[a.jsx("h2",{id:"skill-add-dialog-title",children:s("skillCenter.addSkill")}),a.jsx("p",{title:Pc(e),children:Pc(e)})]}),a.jsx("button",{type:"button",onClick:r,children:s("common.cancel")})]}),a.jsxs("div",{className:"skill-add-dialog__options",children:[a.jsxs("button",{type:"button",onClick:n,children:[a.jsx("strong",{children:s("skillCenter.localUpload")}),a.jsx("span",{children:s("skillCenter.localUploadDescription")})]}),a.jsx(bP,{disabled:!t,placement:"inside",children:a.jsxs("button",{type:"button",disabled:!t,onClick:i,children:[a.jsx("strong",{children:s("skillCenter.autoCreate")}),a.jsx("span",{children:s("skillCenter.autoCreateDescription")})]})})]})]})})}function W9t({cloudProvider:e="volcengine",region:t,active:n=!0,activationRevision:i=0,initialWorkspace:r=null,onInitialWorkspaceConsumed:s,onPageTitleChange:o,toolbarLeading:l,toolbarFilters:c}){var zt;const{t:u,i18n:d}=Te("ui"),f=p.useMemo(()=>[t],[t]),[h,m]=p.useState([]),[g,b]=p.useState(null),[v,y]=p.useState([]),w=p.useMemo(()=>EFe(v),[v]),[x,O]=p.useState(null),[k,S]=p.useState(null),[C,E]=p.useState(!1),j=p.useRef(""),T=p.useRef(!1),[R,A]=p.useState({}),[N,P]=p.useState(!1),[I,D]=p.useState(""),[_,L]=p.useState((r==null?void 0:r.space)??null),F=p.useRef(_);F.current=_;const[M,z]=p.useState([]),[q,U]=p.useState(1),[J,V]=p.useState(0),[Z,ne]=p.useState(!1),[W,G]=p.useState(null),[H,se]=p.useState(!1),[Y,X]=p.useState(""),[ie,ee]=p.useState("overview"),[be,ue]=p.useState(null),[pe,ke]=p.useState(null),[je,Pe]=p.useState(null),[Ee,Qe]=p.useState([]),[_e,ae]=p.useState(!1),[le,ge]=p.useState(null),[Oe,Se]=p.useState(null),[qe,Xe]=p.useState(!1),[ye,we]=p.useState(null),[Ae,Ve]=p.useState(null),[Be,_t]=p.useState(null),[Pt,Kt]=p.useState(0),[Et,vt]=p.useState(0),[tt,mt]=p.useState(""),[Ne,wt]=p.useState(""),[jt,Yt]=p.useState(null),[wn,We]=p.useState(r),kt=p.useRef(0),He=p.useRef(0),nt=p.useRef(!1),et=p.useRef(null),ft=p.useRef(null),St=p.useRef(null),Ct=p.useDeferredValue(I),It=p.useDeferredValue(Y),Gt=wn&&(_||wn.selectPublishSpace)?wn.operation==="create"?u("skillCenter.createSkill"):u("skillCenter.optimizeNamed",{name:((zt=wn.source)==null?void 0:zt.name)||u("skillCenter.skill")}):"",Ge=_!=null&&_.isShared?u("skillCenter.sharedSpace"):Pc(_),xt=!(_!=null&&_.isShared)||_.canWrite===!0,yt=Gt||Ge||u("skillCenter.library");p.useEffect(()=>{n&&(o==null||o(yt))},[n,o,yt]),p.useEffect(()=>{r&&(s==null||s())},[r,s]);const nn=p.useMemo(()=>{const Ue=Ct.trim().toLocaleLowerCase(),bt=h.filter(Ht=>!Ht.isShared);return Ue?bt.filter(Ht=>`${Pc(Ht)} ${Ht.name} ${Ht.description||""} ${Ht.projectName||""}`.toLocaleLowerCase().includes(Ue)):bt},[Ct,h]),Qt=p.useMemo(()=>{const Ue=It.trim().toLocaleLowerCase();return Ue?M.filter(bt=>`${bt.skillName} ${bt.skillDescription||""}`.toLocaleLowerCase().includes(Ue)):M},[It,M]),cn=(_==null?void 0:_.region)||Zi(e);p.useEffect(()=>{if(!n||!_)return;const Ue=()=>vt(Ht=>Ht+1),bt=()=>{document.visibilityState==="visible"&&Ue()};return window.addEventListener("focus",Ue),document.addEventListener("visibilitychange",bt),()=>{window.removeEventListener("focus",Ue),document.removeEventListener("visibilitychange",bt)}},[n,_==null?void 0:_.id]),p.useEffect(()=>{const Ue=_?`${cn}:${_.id}`:"";if(j.current!==Ue&&(j.current=Ue,y([]),O(null),ke(null)),S(null),E(!1),!n||!_||_.isShared)return;const bt=new AbortController;return E(!0),Dpt({spaceId:_.id,region:cn,signal:bt.signal}).then(Ht=>{bt.signal.aborted||y(Ht.items)}).catch(Ht=>{bt.signal.aborted||S(Mr(Ht,u("skillCenter.reviewStatusFailed")))}).finally(()=>{bt.signal.aborted||E(!1)}),()=>bt.abort()},[_==null?void 0:_.id,_==null?void 0:_.isShared,cn,Et,n,i,u]);const Me=p.useMemo(()=>f.flatMap(Ue=>{var Ht;const bt=(Ht=R[Ue])==null?void 0:Ht.error;return bt?[{region:Ue,error:bt}]:[]}),[R,f]),on=f.some(Ue=>{const bt=R[Ue];return!!(bt&&!bt.done&&!bt.error)}),kn=Me.length===f.length;p.useEffect(()=>{const Ue=new AbortController;return jM(Ue.signal).then(Se).catch(()=>Se({enabled:!1,reason:u("skillCenter.adminNotConfigured"),operations:["create","optimize"],models:[],styles:{}})),()=>Ue.abort()},[u]);const Sn=p.useCallback(async(Ue,bt)=>{var Lr;if(nt.current||Ue.length===0)return;nt.current=!0,P(!0),bt&&((Lr=et.current)==null||Lr.abort(),m([]),A(Object.fromEntries(Ue.map(({region:ti})=>[ti,{nextPage:1,loadedCount:0,done:!1,error:null}]))));const Ht=new AbortController;et.current=Ht;const _n=++He.current,Nr=await Promise.allSettled(Ue.map(async({region:ti,page:Ei})=>({region:ti,page:Ei,result:await Tpt({region:ti,page:Ei,pageSize:P9t,signal:Ht.signal})})));if(He.current!==_n)return;const qs=Nr.map((ti,Ei)=>{const es=Ue[Ei];return ti.status==="rejected"?{request:es,error:Mr(ti.reason,u("skillCenter.errors.loadSpaces")),items:[],totalCount:0,scannedCount:0}:{request:es,error:null,items:(ti.value.result.items||[]).map(ts=>({...ts,region:ts.region||ti.value.region})),totalCount:ti.value.result.totalCount||0,scannedCount:ti.value.result.scannedCount??ti.value.result.items.length}}),Ws=qs.flatMap(ti=>ti.items);A(ti=>{const Ei={...ti};return qs.forEach(({request:es,error:ts,scannedCount:ba,totalCount:go})=>{const fs=Ei[es.region]||{nextPage:es.page,loadedCount:0,done:!1,error:null};if(ts){Ei[es.region]={...fs,error:ts};return}const he=fs.loadedCount+ba;Ei[es.region]={nextPage:es.page+1,loadedCount:he,done:ba===0||he>=go,error:null}}),Ei}),m(ti=>$9t(bt?[]:ti,Ws)),L(ti=>ti&&(Ws.find(Ei=>lu(Ei)===lu(ti))||ti)),nt.current=!1,P(!1)},[]),zi=p.useCallback(()=>{if(nt.current)return;const Ue=f.flatMap(bt=>{const Ht=R[bt];return Ht&&!Ht.done&&!Ht.error?[{region:bt,page:Ht.nextPage}]:[]});Sn(Ue,!1)},[Sn,R,f]);p.useEffect(()=>{ei(),L(null),z([]),U(1)},[e]),p.useEffect(()=>{if(n)return Sn(f.map(Ue=>({region:Ue,page:1})),!0),()=>{var Ue;He.current+=1,(Ue=et.current)==null||Ue.abort(),nt.current=!1}},[n,i,Sn,f,Pt]),p.useEffect(()=>{const Ue=St.current,bt=ft.current;if(!Ue||!bt||!on||N)return;const Ht=new IntersectionObserver(([_n])=>{_n.isIntersecting&&zi()},{root:bt,rootMargin:"240px 0px",threshold:.01});return Ht.observe(Ue),()=>Ht.disconnect()},[on,zi,N]);const un=()=>{const Ue=ft.current;!Ue||!on||N||Ue.scrollHeight-Ue.scrollTop-Ue.clientHeight<=240&&zi()};p.useEffect(()=>{if(!_){z([]),V(0),se(!1);return}let Ue=!0;return ne(!0),G(null),SIe(_.id,{region:cn,page:q,pageSize:oae,project:_.projectName}).then(bt=>{Ue&&(z(bt.items||[]),V(bt.totalCount||0),se(bt.degraded===!0))}).catch(bt=>{Ue&&(z([]),V(0),se(!1),G(Mr(bt,u("skillCenter.errors.loadSkills"))))}).finally(()=>{Ue&&ne(!1)}),()=>{Ue=!1}},[cn,_,q,Et,u]);const or=Ue=>{ei(),L(Ue),ee("overview"),U(1),X("")},Pn=()=>{ei(),L(null),z([]),V(0),se(!1),ee("overview"),U(1),X(""),Yt(null)},ei=()=>{kt.current+=1,ue(null),Pe(null),Qe([]),ge(null),ae(!1)},Fn=async Ue=>{if(!_)return;const bt=Cy(Ue),Ht=kt.current+1;kt.current=Ht,ue(Ue),Pe(null),ge(null),ae(!0);try{const[_n,Nr]=await Promise.all([Qpt(_.id,bt,Ue.version,cn,_.projectName,Ue.skillName,_.name),wIe({spaceId:_.id,skillId:bt,version:Ue.version,region:cn,skillSpaceName:_.name,skillName:Ue.skillName})]);kt.current===Ht&&(Pe(_n),Qe(Nr))}catch(_n){kt.current===Ht&&ge(Mr(_n,u("skillCenter.errors.loadSkillDetails")))}finally{kt.current===Ht&&ae(!1)}},Si=Ue=>{if(_)return{kind:"skill-center",skillId:Cy(Ue),version:Ue.version,region:cn,projectName:_.projectName,skillSpaceId:_.id,skillSpaceName:_.name,name:Ue.skillName,description:Ue.skillDescription}},Qn=Ue=>{const bt=Si(Ue);!bt||!(Oe!=null&&Oe.enabled)||(ei(),We({operation:"optimize",source:bt}))},Rn=async Ue=>{if(!(!_||!window.confirm(u("skillCenter.deleteSkillConfirm",{name:Ue.skillName})))){mt(Ue.skillId),Yt(null);try{await Bpt({spaceId:_.id,skillId:Ue.skillId,region:cn}),vt(bt=>bt+1),Kt(bt=>bt+1)}catch(bt){Yt(Mr(bt,u("skillCenter.errors.deleteSkill")))}finally{mt("")}}},ui=async Ue=>{if(!window.confirm(u("skillCenter.deleteSpaceConfirm",{name:Pc(Ue)})))return;const bt=lu(Ue);wt(bt),Yt(null);try{await Lpt({spaceId:Ue.id,region:Ue.region||Zi(e)}),_&&lu(_)===bt&&Pn(),Kt(Ht=>Ht+1)}catch(Ht){Yt(Mr(Ht,u("skillCenter.errors.deleteSpace")))}finally{wt("")}},rt=async(Ue,bt=Ue.version,Ht=!1)=>{var qs,Ws,Lr,ti;if(!_||T.current)return;const _n=_,Nr=`${_n.region}:${_n.id}:${Ue.skillId}:${bt}`;T.current=!0,b(Nr),Yt(null);try{const Ei=await Npt({spaceId:_n.id,skillId:Ue.skillId,version:bt,region:_n.region||cn});((qs=F.current)==null?void 0:qs.id)===_n.id&&((Ws=F.current)==null?void 0:Ws.region)===_n.region&&y(es=>[...es.filter(ts=>ts.id!==Ei.id),Ei])}catch(Ei){if(Ht)throw Mr(Ei,u("skillCenter.reviewFailed"));((Lr=F.current)==null?void 0:Lr.id)===_n.id&&((ti=F.current)==null?void 0:ti.region)===_n.region&&Yt(Mr(Ei,u("skillCenter.reviewFailed")))}finally{T.current=!1,b(null)}};return wn&&(_||wn.selectPublishSpace)?a.jsx(u9t,{operation:wn.operation,cloudProvider:e,space:_??void 0,availableSpaces:h.filter(Ue=>!Ue.isShared),spacesLoading:N,initialIntent:wn.initialIntent,source:wn.source,onBack:()=>We(null),onPublished:()=>{vt(Ue=>Ue+1),Kt(Ue=>Ue+1)}}):a.jsxs("section",{className:`skillcenter${_?" is-space":" resource-collection"}`,children:[_?a.jsx(nT,{className:"skillcenter-detail",title:Ge||_.name,description:_.isShared?u("skillCenter.sharedDescription"):_.description||u("skillCenter.manageSpaceDescription"),identitySeed:_.name,backLabel:u("skillCenter.backToSpaces"),onBack:Pn,sections:[{key:"overview",label:u("skillCenter.overview"),content:a.jsxs(a.Fragment,{children:[jt?a.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:a.jsx(Ns,{error:jt})}):null,k?a.jsxs("div",{className:"skillcenter-inline-error",role:"alert",children:[a.jsx(Ns,{error:k}),a.jsx("button",{type:"button",onClick:()=>vt(Ue=>Ue+1),children:u("common.reload")})]}):null,a.jsx("section",{className:"skillcenter-overview",children:a.jsxs(bH,{className:"skillcenter-detail-facts",children:[a.jsxs("div",{children:[a.jsx("dt",{children:u("skillCenter.skillCount")}),a.jsx("dd",{children:J})]}),a.jsxs("div",{children:[a.jsx("dt",{children:u("skillCenter.updatedAt")}),a.jsx("dd",{children:_.updatedAt?L9t(_.updatedAt,d.resolvedLanguage??d.language):"—"})]})]})})]})},{key:"skills",label:u("skillCenter.skills"),content:a.jsxs(a.Fragment,{children:[jt?a.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:a.jsx(Ns,{error:jt})}):null,k?a.jsxs("div",{className:"skillcenter-inline-error",role:"alert",children:[a.jsx(Ns,{error:k}),a.jsx("button",{type:"button",onClick:()=>vt(Ue=>Ue+1),children:u("common.reload")})]}):null,a.jsxs("section",{className:"skillcenter-results","aria-label":u("skillCenter.skillsInSpace",{name:Ge||_.name}),children:[a.jsx(XIe,{title:u("skillCenter.skills"),description:u("skillCenter.totalItems",{count:J}),actions:a.jsxs(a.Fragment,{children:[a.jsx(em,{"aria-label":u("skillCenter.searchSkills"),value:Y,onChange:Ue=>X(Ue.target.value),placeholder:u("skillCenter.searchSkills")}),a.jsx(Tt,{color:"secondary",variant:"outline",size:"sm",pill:!1,disabled:Z||C,onClick:()=>vt(Ue=>Ue+1),children:u("common.refresh")})]})}),H?a.jsx("div",{className:"skillcenter-inline-warning",role:"status",children:u("skillCenter.degradedRelationWarning")}):null,Z&&M.length===0?a.jsx(cl,{}):W&&M.length===0?a.jsx(q$,{kind:"error",title:u("skillCenter.cannotLoadSkills"),error:W,action:{label:u("common.reload"),onClick:()=>vt(Ue=>Ue+1)}}):Qt.length===0?a.jsx(q$,{kind:"empty",title:Y.trim()?u("skillCenter.noMatchingSkills"):u("skillCenter.noSkills"),description:Y.trim()?u("skillCenter.tryAnotherName"):u(_.isShared?"skillCenter.sharedEmpty":"skillCenter.emptySkillsDescription"),action:!Y.trim()&&xt?{label:u("skillCenter.localUpload"),onClick:()=>_t(_)}:void 0}):a.jsx("div",{className:"skillcenter-table-wrap",children:a.jsxs("table",{className:"skillcenter-table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:u("skillCenter.skills")}),a.jsx("th",{scope:"col",children:u("agentSelector.status")}),a.jsx("th",{scope:"col",className:"skillcenter-table__actions-heading",children:u("skillCenter.actions")})]})}),a.jsx("tbody",{children:Qt.map(Ue=>{const bt=w.get(`${Ue.skillId}:${Ue.version}`);return a.jsxs("tr",{children:[a.jsx("td",{className:"skillcenter-table__skill",children:a.jsxs("button",{type:"button",onClick:()=>void Fn(Ue),children:[a.jsxs("span",{className:"skillcenter-table__title-row",children:[a.jsx("strong",{title:Ue.skillName,children:Ue.skillName}),Ue.version?a.jsx("span",{className:"skillcenter-table__version-badge",children:Ue.sourceVersion||Ue.version}):null]}),a.jsx("span",{className:"skillcenter-table__description",children:IFe(Ue.skillDescription,u)}),_.isShared&&Ue.author?a.jsx("span",{className:"skillcenter-table__author",children:u("skillCenter.authorName",{name:Ue.author})}):null]})}),a.jsx("td",{children:a.jsxs("div",{className:"skillcenter-review-status",children:[a.jsx("span",{className:`skillcenter-status ${M9t(Ue.skillStatus)}`,children:RFe(Ue.skillStatus,u)}),bt?a.jsx(IT,{status:bt.status}):null,bt!=null&&bt.reviewer||bt!=null&&bt.reviewedBy?a.jsx(UW,{compact:!0,person:bt.reviewer,fallback:bt.reviewedBy}):null]})}),a.jsx("td",{children:a.jsxs("div",{className:"skillcenter-table__actions",children:[a.jsx("button",{type:"button",onClick:()=>void Fn(Ue),children:u("common.view")}),!Ue.lookupByName&&Ue.skillId?a.jsx("button",{type:"button",onClick:()=>ke(Ue),children:u("skillCenter.versions.title")}):null,!_.isShared&&!Ue.lookupByName&&Ue.skillId?a.jsx("button",{type:"button",disabled:C||k!==null||g!==null||bt!==void 0&&bt.status!=="returned",onClick:()=>void rt(Ue),children:g===`${_.region}:${_.id}:${Ue.skillId}:${Ue.version}`?u("skillCenter.reviewSubmitting"):u(bt?{pending:"skillCenter.reviewPending",approving:"skillCenter.reviewApproving",approved:"skillCenter.reviewApproved",returned:"skillCenter.reviewRetry"}[bt.status]:"skillCenter.requestPublication")}):null,v.some(Ht=>Ht.sourceSkillId===Ue.skillId)?a.jsx("button",{type:"button",onClick:()=>O(Ue),children:u("skillCenter.reviewHistory")}):null,_.isShared?null:a.jsx(bP,{disabled:!(Oe!=null&&Oe.enabled),children:a.jsx("button",{type:"button",disabled:!(Oe!=null&&Oe.enabled),onClick:()=>Qn(Ue),children:u("skillCenter.optimize")})}),!Ue.lookupByName&&xt?a.jsx("button",{type:"button",className:"is-danger",disabled:tt===Ue.skillId,onClick:()=>void Rn(Ue),children:tt===Ue.skillId?u("common.deleting"):u("common.delete")}):null]})})]},`${Cy(Ue)}:${Ue.version}`)})})]})}),!Y.trim()&&!Z&&!W&&J>0?a.jsx(z9t,{page:q,total:J,pageSize:oae,onPage:U}):null]})]})}],activeSectionKey:ie,navigationLabel:u("skillCenter.spaceDetails"),onSectionChange:Ue=>ee(Ue),actionsClassName:"skillcenter-toolbar-actions",actions:a.jsxs(a.Fragment,{children:[_.isShared?null:a.jsxs(a.Fragment,{children:[a.jsx(Tt,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:()=>we(_),children:u("skillCenter.editSpace")}),a.jsx(Tt,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,disabled:Ne===lu(_),onClick:()=>void ui(_),children:Ne===lu(_)?u("common.deleting"):u("skillCenter.deleteSpace")})]}),xt?a.jsx(Tt,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:()=>_t(_),children:u("skillCenter.localUpload")}):null,_.isShared?null:a.jsx(bP,{disabled:!(Oe!=null&&Oe.enabled),children:a.jsxs(Tt,{type:"button",color:"primary",size:"lg",pill:!1,disabled:!(Oe!=null&&Oe.enabled),onClick:()=>We({operation:"create"}),children:[a.jsx(Rje,{"aria-hidden":"true"}),a.jsx("span",{children:u("skillCenter.createSkill")})]})})]})}):a.jsxs(a.Fragment,{children:[a.jsxs(ab,{className:"skillcenter-list-toolbar library-resource-toolbar",children:[l,a.jsxs("div",{className:"resource-toolbar__actions",children:[c,a.jsx(em,{"aria-label":u("skillCenter.searchSpaces"),value:I,onChange:Ue=>D(Ue.target.value),placeholder:u("skillCenter.searchSpaces")})]})]}),jt?a.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:a.jsx(Ns,{error:jt})}):null,a.jsxs(tm,{className:"skillcenter-list-results",ref:ft,"aria-label":u("skillCenter.spaceList"),onScroll:un,children:[Me.length>0&&!kn?a.jsx(uae,{errors:Me,cloudProvider:e,onRetry:()=>Kt(Ue=>Ue+1)}):null,a.jsxs(V0,{children:[a.jsx(_9t,{region:t,active:n,revision:Pt+i,onOpen:or},`${e}:${t}`),I.trim()?null:a.jsx(cb,{"aria-label":u("skillCenter.createSpace"),icon:a.jsx(U9t,{}),onClick:()=>Xe(!0),children:u("skillCenter.newSpace")}),nn.map(Ue=>{const bt=lu(Ue);return a.jsx(q0,{className:"skillcenter-space-card",title:Pc(Ue),description:Ue.description||u("common.noDescription"),metadata:[{label:u("skillCenter.skillCount"),value:u("skillCenter.skillCountValue",{count:Ue.skillCount??0})},{label:u("skillCenter.updatedAt"),value:PT(Ue.updatedAt,Date.now(),d.resolvedLanguage??d.language)}],action:{label:u("skillCenter.addSkill"),icon:"plus",onClick:()=>Ve(Ue)},detailAction:{label:u("common.viewDetails"),onClick:()=>or(Ue)}},bt)})]}),N&&h.length===0?a.jsx(cl,{}):kn&&h.length===0?a.jsx(uae,{errors:Me,cloudProvider:e,fullPage:!0,onRetry:()=>Kt(Ue=>Ue+1)}):nn.length===0&&I.trim()?a.jsx(q$,{kind:"empty",title:u("skillCenter.noMatchingSpaces"),description:u("skillCenter.tryAnotherName")}):null,!kn&&h.length>0?a.jsx("div",{className:"my-agent-load-more",ref:St,"aria-live":"polite",children:N?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),a.jsx("span",{children:u("skillCenter.loadingMoreSpaces")})]}):on?a.jsx("span",{children:u("skillCenter.scrollForMore")}):Me.length>0?a.jsx("span",{children:u("skillCenter.someSpacesFailed")}):a.jsx("span",{children:u("skillCenter.allSpacesLoaded")})}):null]})]}),pe&&_?a.jsx(T9t,{skill:pe,space:_,region:cn,reviews:v.filter(Ue=>Ue.sourceSkillId===pe.skillId),onClose:()=>ke(null),onChanged:()=>vt(Ue=>Ue+1),onSubmitReview:!_.isShared&&!C&&!k?Ue=>rt(pe,Ue,!0):void 0},`${cn}:${_.id}:${pe.skillId}`):null,x?a.jsx(A9t,{name:x.skillName,applications:v.filter(Ue=>Ue.sourceSkillId===x.skillId),onClose:()=>O(null)}):null,be&&_&&a.jsx(H9t,{skill:be,space:_,region:cn,cloudProvider:e,detail:je,files:Ee,loading:_e,error:le,reviews:v.filter(Ue=>Ue.sourceSkillId===be.skillId),reviewsLoading:C,reviewsError:k,canOptimize:!_.isShared&&(Oe==null?void 0:Oe.enabled)===!0,onOptimize:()=>Qn(be),onDownload:()=>void Upt({spaceId:_.id,skillId:Cy(be),version:be.version,region:cn,fallbackName:be.skillName,skillSpaceName:_.name,skillName:be.skillName}).catch(Ue=>ge(Mr(Ue,u("skillCenter.errors.downloadSkill")))),onClose:ei}),qe?a.jsx(j9t,{region:t,regionOptions:Tu(e),onClose:()=>Xe(!1),onCreated:Ue=>{Xe(!1),Kt(bt=>bt+1),L({...Ue,region:Ue.region||t})}}):null,ye?a.jsx(N9t,{space:ye,region:ye.region||Zi(e),onClose:()=>we(null),onUpdated:Ue=>{const bt={...Ue,region:Ue.region||ye.region||Zi(e)};we(null),L(Ht=>Ht&&lu(Ht)===lu(bt)?bt:Ht),m(Ht=>Ht.map(_n=>lu(_n)===lu(bt)?bt:_n)),Kt(Ht=>Ht+1)}}):null,Ae?a.jsx(q9t,{space:Ae,canUseSandbox:(Oe==null?void 0:Oe.enabled)===!0,onClose:()=>Ve(null),onUpload:()=>{_t(Ae),Ve(null)},onSandbox:()=>{const Ue=Ae;Ve(null),or(Ue),We({operation:"create"})}}):null,Be?a.jsx(R9t,{space:Be,region:Be.region||Zi(e),onClose:()=>_t(null),onUploaded:()=>{_t(null),vt(Ue=>Ue+1),Kt(Ue=>Ue+1)}}):null]})}function K9t(e){return[{id:"skills",label:e("library.tabs.skills"),panelId:"library-skills-panel"},{id:"knowledge",label:e("library.tabs.knowledge"),panelId:"library-knowledge-panel"},{id:"artifacts",label:e("library.tabs.artifacts"),panelId:"library-artifacts-panel"}]}function G9t({cloudProvider:e,studioRegion:t="",activeTab:n,onTabChange:i,onPageTitleChange:r,skillInitialWorkspace:s=null,onSkillInitialWorkspaceConsumed:o,artifactSources:l=[],artifactUserId:c="",onArtifactActivate:u,onArtifactSourceOpen:d}){const{t:f,i18n:h}=Te("workspaceTools"),m=p.useMemo(()=>K9t(f),[f]),g=f("library.tabs.skills"),b=CD(t)?t:Zi(e),[v,y]=p.useState(b),[w,x]=p.useState(g),O=p.useRef(g),[k,S]=p.useState(!1),[C,E]=p.useState(()=>new Set(["skills",n])),[j,T]=p.useState({skills:0,knowledge:0,artifacts:0}),R=p.useRef(u),[A,N]=p.useState([]),[P,I]=p.useState(!1),[D,_]=p.useState(""),L=p.useMemo(()=>{const ne=abt(l,f("library.untitledSession"));return{key:JSON.stringify(ne),candidates:ne}},[l,f]),F=p.useRef(L);F.current.key!==L.key&&(F.current=L);const M=F.current.candidates,z=p.useMemo(()=>Tu(e),[e]);p.useEffect(()=>{y(b)},[b]),p.useEffect(()=>{const ne=O.current;x(W=>W===ne?g:W),O.current=g},[g]),p.useEffect(()=>{R.current=u},[u]),p.useEffect(()=>{E(ne=>{if(ne.has(n))return ne;const W=new Set(ne);return W.add(n),W})},[n]),p.useEffect(()=>{var W;const ne=n==="skills"?w:((W=m.find(G=>G.id===n))==null?void 0:W.label)||f("library.title");r==null||r(ne)},[n,r,w,f,m]),p.useEffect(()=>{var ne;n==="artifacts"&&((ne=R.current)==null||ne.call(R))},[n,j.artifacts]);const q=p.useCallback(async()=>{I(!0),_("");try{N(await mbt(M))}catch(ne){_(ne instanceof Error?ne.message:String(ne))}finally{I(!1)}},[M]);p.useEffect(()=>{n==="artifacts"&&q()},[n,j.artifacts,q]);const U=ne=>{E(W=>{if(W.has(ne))return W;const G=new Set(W);return G.add(ne),G}),T(W=>({...W,[ne]:W[ne]+1})),i(ne)},J=a.jsx(ob,{idPrefix:"library",ariaLabel:f("library.categoryAria"),value:n,items:m,onChange:U}),V=ne=>a.jsx(lb,{id:ne,ariaLabel:f("library.regionAria"),value:v,options:z,onChange:y}),Z=n==="skills"?w!==g:n==="knowledge"&&k;return a.jsxs(Oh,{className:`library-view${Z?" is-detail":""}`,"aria-label":f("library.title"),children:[Z?null:a.jsx(z0,{className:"library-view__header",title:f("library.title")}),a.jsxs("div",{className:"library-panels",children:[C.has("skills")?a.jsx("div",{id:"library-skills-panel",className:"library-panel",role:"tabpanel","aria-labelledby":"library-skills-tab",hidden:n!=="skills",children:a.jsx(W9t,{cloudProvider:e,region:v,active:n==="skills",activationRevision:j.skills,onPageTitleChange:x,initialWorkspace:s,onInitialWorkspaceConsumed:o,toolbarLeading:J,toolbarFilters:V("library-skills-region-filter")})}):null,C.has("knowledge")?a.jsx("div",{id:"library-knowledge-panel",className:"library-panel",role:"tabpanel","aria-labelledby":"library-knowledge-tab",hidden:n!=="knowledge",children:a.jsx(l2t,{cloudProvider:e,region:v,active:n==="knowledge",activationRevision:j.knowledge,onDetailChange:S,toolbarLeading:J,toolbarFilters:V("library-knowledge-region-filter")})}):null,C.has("artifacts")?a.jsx("div",{id:"library-artifacts-panel",className:"library-panel",role:"tabpanel","aria-labelledby":"library-artifacts-tab",hidden:n!=="artifacts",children:a.jsx(fbt,{items:A,region:v,userId:c,active:n==="artifacts",activationRevision:j.artifacts,loading:P,error:D?Eo(D,h.resolvedLanguage||h.language)||f("artifactLibrary.loadDetailFallback"):"",onRetry:()=>void q(),onEdit:gbt,onDelete:bbt,onDownload:ybt,onOpenSource:d?ne=>d(ne.appName,ne.sessionId):void 0,toolbarLeading:J,toolbarFilters:V("library-artifacts-region-filter")})}):null]})]})}const PFe="veadk_agentkit_connections",X9t=3e3,dae=6e4;function af(){try{const e=localStorage.getItem(PFe);return(e?JSON.parse(e):[]).filter(n=>!n.runtimeId||!!n.region)}catch{return[]}}function hL(e){try{localStorage.setItem(PFe,JSON.stringify(e))}catch{}}function bf(e,t){return`agentkit:${e}:${t}`}function DFe(e){try{return new URL(e).host}catch{return e}}function bO(e){WAe();for(const t of e)if(!(t.runtimeId&&!t.region))for(const n of t.apps)qAe(bf(t.id,n),t.runtimeId?{app:n,runtimeId:t.runtimeId,mpaInstanceId:t.mpaInstanceId,region:t.region,agentCategory:t.agentCategory}:{app:n,base:t.base,apiKey:t.apiKey})}function MFe(e,t,n,i,r,s,o,l){const c=af(),u=c.findIndex(h=>h.runtimeId===e),d=u===-1?void 0:c[u],f={id:`rt_${e}`,name:t||e,runtimeId:e,region:n,apps:i,appLabels:r,currentVersion:s,agentCategory:o??(d==null?void 0:d.agentCategory),mpaInstanceId:(l==null?void 0:l.trim())||(d==null?void 0:d.mpaInstanceId)};return u===-1?c.push(f):c[u]=f,hL(c),bO(c),f}async function Y9t(e,t,n,i,r,s,o){let l=null,c=n||"cn-beijing",u=null;for(const m of RA(n))try{const g=await Hw(e,m,{retryProbe:!0,preferCached:!0,currentVersion:i});if(g&&g.length>0){await w2e(e,m),l=g,c=m;break}}catch(g){if(g instanceof F1)throw yP(e),g;if(g instanceof Sa&&g.unsupported){u=g;continue}throw g}if(!l||l.length===0)throw yP(e),u||new Sa(Q("connections.runtimeUnsupported"),!0,!0);const d=(r==null?void 0:r.trim())||l[0],f=Object.fromEntries(l.map(m=>[m,m===l[0]?d:m])),h=MFe(e,t,c,l,f,i,s,o);return bf(h.id,l[0])}function Z9t(e){return new Promise(t=>window.setTimeout(t,e))}async function GN(e,t,n,i,r={}){const s=Date.now();for(;;)try{return await Y9t(e,t,n,i,r.agentName,r.agentCategory,r.mpaInstanceId)}catch(o){const l=Date.now()-s;if(!r.waitForReady||!(o instanceof Sa)||!o.retryable||l>=dae)throw o;const c=Math.min(X9t,dae-l);await Z9t(c)}}async function LFe(e,t,n,i){const r=t.trim().replace(/\/+$/,""),s=await IA(r,n.trim()),o={id:Date.now().toString(36),name:e.trim()||DFe(r),base:r,apiKey:n.trim(),apps:s,appLabels:i&&s.length>0?{[s[0]]:i}:void 0},l=[...af().filter(c=>c.base!==r),o];return hL(l),bO(l),o}function J9t(e){const t=af().filter(n=>n.id!==e);return hL(t),bO(t),t}function yP(e){const t=af().filter(n=>n.runtimeId!==e);return hL(t),bO(t),t}function $Fe(e,t){const n=e.map(r=>({id:r,label:r,app:r,remote:!1})),i=t.flatMap(r=>r.apps.map(s=>{var l;const o=((l=r.appLabels)==null?void 0:l[s])??s;return{id:bf(r.id,s),label:o,app:s,remote:!0,host:r.runtimeId?r.name:DFe(r.base??""),runtimeId:r.runtimeId,region:r.region,currentVersion:r.currentVersion,agentCategory:r.agentCategory,mpaInstanceId:r.mpaInstanceId}}));return[...n,...i]}const fae=Object.freeze(Object.defineProperty({__proto__:null,addConnection:LFe,addRuntimeConnection:MFe,buildAgentEntries:$Fe,connectRuntime:GN,loadConnections:af,registerConnections:bO,remoteAppId:bf,removeConnection:J9t,removeRuntimeConnection:yP},Symbol.toStringTag,{value:"Module"}));function e7t({onAdded:e,onCancel:t}){const{t:n}=Te("conversation"),[i,r]=p.useState(""),[s,o]=p.useState(""),[l,c]=p.useState(""),[u,d]=p.useState(!1),[f,h]=p.useState(""),m=i.trim().length>0&&s.trim().length>0&&!u;async function g(){if(m){d(!0),h("");try{const b=await LFe(l,i,s,l);if(b.apps.length===0){h(n("addAgentKit.noAgents")),d(!1);return}e(bf(b.id,b.apps[0]))}catch(b){h(n("addAgentKit.connectionFailed",{error:String(b)})),d(!1)}}}return a.jsx("div",{className:"addagent",children:a.jsxs("div",{className:"addagent-card",children:[a.jsx("h2",{className:"addagent-title",children:n("addAgentKit.title")}),a.jsx("p",{className:"addagent-sub",children:n("addAgentKit.description")}),a.jsxs("label",{className:"addagent-field",children:[a.jsx("span",{className:"addagent-label",children:n("addAgentKit.url")}),a.jsx("input",{className:"addagent-input",value:i,onChange:b=>r(b.target.value),placeholder:"https://xxxxx.apigateway-cn-beijing.volceapi.com",autoFocus:!0})]}),a.jsxs("label",{className:"addagent-field",children:[a.jsx("span",{className:"addagent-label",children:"API Key"}),a.jsx("input",{className:"addagent-input",type:"password",value:s,onChange:b=>o(b.target.value),placeholder:n("addAgentKit.apiKeyHint")})]}),a.jsxs("label",{className:"addagent-field",children:[a.jsx("span",{className:"addagent-label",children:n("addAgentKit.displayName")}),a.jsx("input",{className:"addagent-input",value:l,onChange:b=>c(b.target.value),placeholder:n("addAgentKit.displayNameHint")})]}),f&&a.jsx("div",{className:"addagent-error",children:f}),a.jsxs("div",{className:"addagent-actions",children:[a.jsx("button",{className:"addagent-btn addagent-btn--ghost",onClick:t,disabled:u,children:n("addAgentKit.cancel")}),a.jsxs("button",{className:"addagent-btn addagent-btn--primary",onClick:g,disabled:!m,children:[u?a.jsx(Bi,{className:"icon spin"}):null,n(u?"addAgentKit.connecting":"addAgentKit.connect")]})]})]})})}const t7t=/[\u3400-\u4dbf\u4e00-\u9fff\uf900-\ufaff]/u,n7t={"deploy.build.logs_syncing":"client.deploymentProgress.buildLogsSyncing","deploy.build.logs_complete":"client.deploymentProgress.buildLogsComplete","deploy.build.failed_logs_synced":"client.deploymentProgress.buildFailedLogsSynced","deploy.build.logs_unavailable":"client.deploymentProgress.buildLogsUnavailable","deploy.build.final_logs_unavailable":"client.deploymentProgress.finalBuildLogsUnavailable"},i7t={prepare:"client.deploymentProgress.preparing",upload:"client.deploymentProgress.uploading",build:"client.deploymentProgress.building",deploy:"client.deploymentProgress.deploying",publish:"client.deploymentProgress.publishing",evaluation:"client.deploymentProgress.evaluating",update:"client.deploymentProgress.updating",profile_applying:"client.deploymentProgress.applyingMpaProfile",smoke_running:"client.deploymentProgress.runningMpaSmoke",runnable:"client.deploymentProgress.mpaReady",complete:"client.deploymentProgress.completing",github:"client.deploymentProgress.github"};function pL(e){var r,s;const t=((r=e.message)==null?void 0:r.trim())??"",n=e.messageCode?n7t[e.messageCode]:void 0;if(n)return Q(n);if(t&&(j8().toLowerCase()==="zh-cn"||!t7t.test(t)))return t;if(e.phase==="build"&&((s=e.buildLog)!=null&&s.status)){const o={running:"client.deploymentProgress.buildLogsSyncing",complete:"client.deploymentProgress.buildLogsComplete",error:"client.deploymentProgress.buildLogsUnavailable"}[e.buildLog.status];if(o)return Q(o)}const i=e.phase?i7t[e.phase]:void 0;return i?Q(i):t||Q("client.deploymentProgress.inProgress")}function eo(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,i;n{}};function mL(){for(var e=0,t=arguments.length,n={},i;e=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}XN.prototype=mL.prototype={constructor:XN,on:function(e,t){var n=this._,i=s7t(e+"",n),r,s=-1,o=i.length;if(arguments.length<2){for(;++s0)for(var n=new Array(r),i=0,r,s;i=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),pae.hasOwnProperty(t)?{space:pae[t],local:e}:e}function o7t(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===A7&&t.documentElement.namespaceURI===A7?t.createElement(e):t.createElementNS(n,e)}}function l7t(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function FFe(e){var t=gL(e);return(t.local?l7t:o7t)(t)}function c7t(){}function HW(e){return e==null?c7t:function(){return this.querySelector(e)}}function u7t(e){typeof e!="function"&&(e=HW(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r=x&&(x=w+1);!(k=v[x])&&++x=0;)(o=i[r])&&(s&&o.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(o,s),s=o);return this}function D7t(e){e||(e=M7t);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var n=this._groups,i=n.length,r=new Array(i),s=0;st?1:e>=t?0:NaN}function L7t(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function $7t(){return Array.from(this)}function F7t(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?X7t:typeof t=="function"?Z7t:Y7t)(e,t,n??"")):y1(this.node(),e)}function y1(e,t){return e.style.getPropertyValue(t)||VFe(e).getComputedStyle(e,null).getPropertyValue(t)}function eUt(e){return function(){delete this[e]}}function tUt(e,t){return function(){this[e]=t}}function nUt(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function iUt(e,t){return arguments.length>1?this.each((t==null?eUt:typeof t=="function"?nUt:tUt)(e,t)):this.node()[e]}function HFe(e){return e.trim().split(/^|\s+/)}function qW(e){return e.classList||new qFe(e)}function qFe(e){this._node=e,this._names=HFe(e.getAttribute("class")||"")}qFe.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function WFe(e,t){for(var n=qW(e),i=-1,r=t.length;++i=0&&(n=t.slice(i+1),t=t.slice(0,i)),{type:t,name:n}})}function NUt(e){return function(){var t=this.__on;if(t){for(var n=0,i=-1,r=t.length,s;n()=>e;function T7(e,{sourceEvent:t,subject:n,target:i,identifier:r,active:s,x:o,y:l,dx:c,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}T7.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function UUt(e){return!e.ctrlKey&&!e.button}function QUt(){return this.parentNode}function zUt(e,t){return t??{x:e.x,y:e.y}}function VUt(){return navigator.maxTouchPoints||"ontouchstart"in this}function JFe(){var e=UUt,t=QUt,n=zUt,i=VUt,r={},s=mL("start","drag","end"),o=0,l,c,u,d,f=0;function h(O){O.on("mousedown.drag",m).filter(i).on("touchstart.drag",v).on("touchmove.drag",y,BUt).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(O,k){if(!(d||!e.call(this,O,k))){var S=x(this,t.call(this,O,k),O,k,"mouse");S&&(yu(O.view).on("mousemove.drag",g,YC).on("mouseup.drag",b,YC),YFe(O.view),W$(O),u=!1,l=O.clientX,c=O.clientY,S("start",O))}}function g(O){if(kw(O),!u){var k=O.clientX-l,S=O.clientY-c;u=k*k+S*S>f}r.mouse("drag",O)}function b(O){yu(O.view).on("mousemove.drag mouseup.drag",null),ZFe(O.view,u),kw(O),r.mouse("end",O)}function v(O,k){if(e.call(this,O,k)){var S=O.changedTouches,C=t.call(this,O,k),E=S.length,j,T;for(j=0;j>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?dj(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?dj(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=qUt.exec(e))?new Lc(t[1],t[2],t[3],1):(t=WUt.exec(e))?new Lc(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=KUt.exec(e))?dj(t[1],t[2],t[3],t[4]):(t=GUt.exec(e))?dj(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=XUt.exec(e))?wae(t[1],t[2]/100,t[3]/100,1):(t=YUt.exec(e))?wae(t[1],t[2]/100,t[3]/100,t[4]):mae.hasOwnProperty(e)?yae(mae[e]):e==="transparent"?new Lc(NaN,NaN,NaN,0):null}function yae(e){return new Lc(e>>16&255,e>>8&255,e&255,1)}function dj(e,t,n,i){return i<=0&&(e=t=n=NaN),new Lc(e,t,n,i)}function eQt(e){return e instanceof MT||(e=S0(e)),e?(e=e.rgb(),new Lc(e.r,e.g,e.b,e.opacity)):new Lc}function _7(e,t,n,i){return arguments.length===1?eQt(e):new Lc(e,t,n,i??1)}function Lc(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}WW(Lc,_7,e8e(MT,{brighter(e){return e=e==null?xP:Math.pow(xP,e),new Lc(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ZC:Math.pow(ZC,e),new Lc(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Lc(Yy(this.r),Yy(this.g),Yy(this.b),wP(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:vae,formatHex:vae,formatHex8:tQt,formatRgb:xae,toString:xae}));function vae(){return`#${Py(this.r)}${Py(this.g)}${Py(this.b)}`}function tQt(){return`#${Py(this.r)}${Py(this.g)}${Py(this.b)}${Py((isNaN(this.opacity)?1:this.opacity)*255)}`}function xae(){const e=wP(this.opacity);return`${e===1?"rgb(":"rgba("}${Yy(this.r)}, ${Yy(this.g)}, ${Yy(this.b)}${e===1?")":`, ${e})`}`}function wP(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Yy(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Py(e){return e=Yy(e),(e<16?"0":"")+e.toString(16)}function wae(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new cf(e,t,n,i)}function t8e(e){if(e instanceof cf)return new cf(e.h,e.s,e.l,e.opacity);if(e instanceof MT||(e=S0(e)),!e)return new cf;if(e instanceof cf)return e;e=e.rgb();var t=e.r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),s=Math.max(t,n,i),o=NaN,l=s-r,c=(s+r)/2;return l?(t===s?o=(n-i)/l+(n0&&c<1?0:o,new cf(o,l,c,e.opacity)}function nQt(e,t,n,i){return arguments.length===1?t8e(e):new cf(e,t,n,i??1)}function cf(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}WW(cf,nQt,e8e(MT,{brighter(e){return e=e==null?xP:Math.pow(xP,e),new cf(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ZC:Math.pow(ZC,e),new cf(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new Lc(K$(e>=240?e-240:e+120,r,i),K$(e,r,i),K$(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new cf(Oae(this.h),fj(this.s),fj(this.l),wP(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=wP(this.opacity);return`${e===1?"hsl(":"hsla("}${Oae(this.h)}, ${fj(this.s)*100}%, ${fj(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Oae(e){return e=(e||0)%360,e<0?e+360:e}function fj(e){return Math.max(0,Math.min(1,e||0))}function K$(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const bL=e=>()=>e;function n8e(e,t){return function(n){return e+n*t}}function iQt(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}function Hhn(e,t){var n=t-e;return n?n8e(e,n>180||n<-180?n-360*Math.round(n/360):n):bL(isNaN(e)?t:e)}function rQt(e){return(e=+e)==1?i8e:function(t,n){return n-t?iQt(t,n,e):bL(isNaN(t)?n:t)}}function i8e(e,t){var n=t-e;return n?n8e(e,n):bL(isNaN(e)?t:e)}const OP=function e(t){var n=rQt(t);function i(r,s){var o=n((r=_7(r)).r,(s=_7(s)).r),l=n(r.g,s.g),c=n(r.b,s.b),u=i8e(r.opacity,s.opacity);return function(d){return r.r=o(d),r.g=l(d),r.b=c(d),r.opacity=u(d),r+""}}return i.gamma=e,i}(1);function sQt(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,i=t.slice(),r;return function(s){for(r=0;rn&&(s=t.slice(n,s),l[o]?l[o]+=s:l[++o]=s),(i=i[0])===(r=r[0])?l[o]?l[o]+=r:l[++o]=r:(l[++o]=null,c.push({i:o,x:Xf(i,r)})),n=G$.lastIndex;return n180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(r(f)+"rotate(",null,i)-2,x:Xf(u,d)})):d&&f.push(r(f)+"rotate("+d+i)}function l(u,d,f,h){u!==d?h.push({i:f.push(r(f)+"skewX(",null,i)-2,x:Xf(u,d)}):d&&f.push(r(f)+"skewX("+d+i)}function c(u,d,f,h,m,g){if(u!==f||d!==h){var b=m.push(r(m)+"scale(",null,",",null,")");g.push({i:b-4,x:Xf(u,f)},{i:b-2,x:Xf(d,h)})}else(f!==1||h!==1)&&m.push(r(m)+"scale("+f+","+h+")")}return function(u,d){var f=[],h=[];return u=e(u),d=e(d),s(u.translateX,u.translateY,d.translateX,d.translateY,f,h),o(u.rotate,d.rotate,f,h),l(u.skewX,d.skewX,f,h),c(u.scaleX,u.scaleY,d.scaleX,d.scaleY,f,h),u=d=null,function(m){for(var g=-1,b=h.length,v;++g=0&&e._call.call(void 0,t),e=e._next;--v1}function Eae(){E0=(SP=eA.now())+yL,v1=gS=0;try{xQt()}finally{v1=0,OQt(),E0=0}}function wQt(){var e=eA.now(),t=e-SP;t>o8e&&(yL-=t,SP=e)}function OQt(){for(var e,t=kP,n,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:kP=n);bS=e,R7(i)}function R7(e){if(!v1){gS&&(gS=clearTimeout(gS));var t=e-E0;t>24?(e<1/0&&(gS=setTimeout(Eae,e-eA.now()-yL)),Ek&&(Ek=clearInterval(Ek))):(Ek||(SP=eA.now(),Ek=setInterval(wQt,o8e)),v1=1,l8e(Eae))}}function Cae(e,t,n){var i=new EP;return t=t==null?0:+t,i.restart(r=>{i.stop(),e(r+t)},t,n),i}var kQt=mL("start","end","cancel","interrupt"),SQt=[],u8e=0,Aae=1,I7=2,ZN=3,Tae=4,P7=5,JN=6;function vL(e,t,n,i,r,s){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;EQt(e,n,{name:t,index:i,group:r,on:kQt,tween:SQt,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:u8e})}function GW(e,t){var n=Pf(e,t);if(n.state>u8e)throw new Error("too late; already scheduled");return n}function Ih(e,t){var n=Pf(e,t);if(n.state>ZN)throw new Error("too late; already running");return n}function Pf(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function EQt(e,t,n){var i=e.__transition,r;i[t]=n,n.timer=c8e(s,0,n.time);function s(u){n.state=Aae,n.timer.restart(o,n.delay,n.time),n.delay<=u&&o(u-n.delay)}function o(u){var d,f,h,m;if(n.state!==Aae)return c();for(d in i)if(m=i[d],m.name===n.name){if(m.state===ZN)return Cae(o);m.state===Tae?(m.state=JN,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete i[d]):+dI7&&i.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function tzt(e,t,n){var i,r,s=ezt(t)?GW:Ih;return function(){var o=s(this,e),l=o.on;l!==i&&(r=(i=l).copy()).on(t,n),o.on=r}}function nzt(e,t){var n=this._id;return arguments.length<2?Pf(this.node(),n).on.on(e):this.each(tzt(n,e,t))}function izt(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function rzt(){return this.on("end.remove",izt(this._id))}function szt(e){var t=this._name,n=this._id;typeof e!="function"&&(e=HW(e));for(var i=this._groups,r=i.length,s=new Array(r),o=0;o()=>e;function jzt(e,{sourceEvent:t,target:n,transform:i,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:r}})}function Tp(e,t,n){this.k=e,this.x=t,this.y=n}Tp.prototype={constructor:Tp,scale:function(e){return e===1?this:new Tp(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Tp(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var xL=new Tp(1,0,0);p8e.prototype=Tp.prototype;function p8e(e){for(;!e.__zoom;)if(!(e=e.parentNode))return xL;return e.__zoom}function X$(e){e.stopImmediatePropagation()}function Ck(e){e.preventDefault(),e.stopImmediatePropagation()}function Nzt(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Rzt(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function _ae(){return this.__zoom||xL}function Izt(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Pzt(){return navigator.maxTouchPoints||"ontouchstart"in this}function Dzt(e,t,n){var i=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(r>i?(i+r)/2:Math.min(0,i)||Math.max(0,r),o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o))}function m8e(){var e=Nzt,t=Rzt,n=Dzt,i=Izt,r=Pzt,s=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,c=YN,u=mL("start","zoom","end"),d,f,h,m=500,g=150,b=0,v=10;function y(P){P.property("__zoom",_ae).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",j).on("dblclick.zoom",T).filter(r).on("touchstart.zoom",R).on("touchmove.zoom",A).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(P,I,D,_){var L=P.selection?P.selection():P;L.property("__zoom",_ae),P!==L?k(P,I,D,_):L.interrupt().each(function(){S(this,arguments).event(_).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},y.scaleBy=function(P,I,D,_){y.scaleTo(P,function(){var L=this.__zoom.k,F=typeof I=="function"?I.apply(this,arguments):I;return L*F},D,_)},y.scaleTo=function(P,I,D,_){y.transform(P,function(){var L=t.apply(this,arguments),F=this.__zoom,M=D==null?O(L):typeof D=="function"?D.apply(this,arguments):D,z=F.invert(M),q=typeof I=="function"?I.apply(this,arguments):I;return n(x(w(F,q),M,z),L,o)},D,_)},y.translateBy=function(P,I,D,_){y.transform(P,function(){return n(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof D=="function"?D.apply(this,arguments):D),t.apply(this,arguments),o)},null,_)},y.translateTo=function(P,I,D,_,L){y.transform(P,function(){var F=t.apply(this,arguments),M=this.__zoom,z=_==null?O(F):typeof _=="function"?_.apply(this,arguments):_;return n(xL.translate(z[0],z[1]).scale(M.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof D=="function"?-D.apply(this,arguments):-D),F,o)},_,L)};function w(P,I){return I=Math.max(s[0],Math.min(s[1],I)),I===P.k?P:new Tp(I,P.x,P.y)}function x(P,I,D){var _=I[0]-D[0]*P.k,L=I[1]-D[1]*P.k;return _===P.x&&L===P.y?P:new Tp(P.k,_,L)}function O(P){return[(+P[0][0]+ +P[1][0])/2,(+P[0][1]+ +P[1][1])/2]}function k(P,I,D,_){P.on("start.zoom",function(){S(this,arguments).event(_).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(_).end()}).tween("zoom",function(){var L=this,F=arguments,M=S(L,F).event(_),z=t.apply(L,F),q=D==null?O(z):typeof D=="function"?D.apply(L,F):D,U=Math.max(z[1][0]-z[0][0],z[1][1]-z[0][1]),J=L.__zoom,V=typeof I=="function"?I.apply(L,F):I,Z=c(J.invert(q).concat(U/J.k),V.invert(q).concat(U/V.k));return function(ne){if(ne===1)ne=V;else{var W=Z(ne),G=U/W[2];ne=new Tp(G,q[0]-W[0]*G,q[1]-W[1]*G)}M.zoom(null,ne)}})}function S(P,I,D){return!D&&P.__zooming||new C(P,I)}function C(P,I){this.that=P,this.args=I,this.active=0,this.sourceEvent=null,this.extent=t.apply(P,I),this.taps=0}C.prototype={event:function(P){return P&&(this.sourceEvent=P),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(P,I){return this.mouse&&P!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&P!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&P!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(P){var I=yu(this.that).datum();u.call(P,this.that,new jzt(P,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:u}),I)}};function E(P,...I){if(!e.apply(this,arguments))return;var D=S(this,I).event(P),_=this.__zoom,L=Math.max(s[0],Math.min(s[1],_.k*Math.pow(2,i.apply(this,arguments)))),F=nf(P);if(D.wheel)(D.mouse[0][0]!==F[0]||D.mouse[0][1]!==F[1])&&(D.mouse[1]=_.invert(D.mouse[0]=F)),clearTimeout(D.wheel);else{if(_.k===L)return;D.mouse=[F,_.invert(F)],eR(this),D.start()}Ck(P),D.wheel=setTimeout(M,g),D.zoom("mouse",n(x(w(_,L),D.mouse[0],D.mouse[1]),D.extent,o));function M(){D.wheel=null,D.end()}}function j(P,...I){if(h||!e.apply(this,arguments))return;var D=P.currentTarget,_=S(this,I,!0).event(P),L=yu(P.view).on("mousemove.zoom",q,!0).on("mouseup.zoom",U,!0),F=nf(P,D),M=P.clientX,z=P.clientY;YFe(P.view),X$(P),_.mouse=[F,this.__zoom.invert(F)],eR(this),_.start();function q(J){if(Ck(J),!_.moved){var V=J.clientX-M,Z=J.clientY-z;_.moved=V*V+Z*Z>b}_.event(J).zoom("mouse",n(x(_.that.__zoom,_.mouse[0]=nf(J,D),_.mouse[1]),_.extent,o))}function U(J){L.on("mousemove.zoom mouseup.zoom",null),ZFe(J.view,_.moved),Ck(J),_.event(J).end()}}function T(P,...I){if(e.apply(this,arguments)){var D=this.__zoom,_=nf(P.changedTouches?P.changedTouches[0]:P,this),L=D.invert(_),F=D.k*(P.shiftKey?.5:2),M=n(x(w(D,F),_,L),t.apply(this,I),o);Ck(P),l>0?yu(this).transition().duration(l).call(k,M,_,P):yu(this).call(y.transform,M,_,P)}}function R(P,...I){if(e.apply(this,arguments)){var D=P.touches,_=D.length,L=S(this,I,P.changedTouches.length===_).event(P),F,M,z,q;for(X$(P),M=0;M<_;++M)z=D[M],q=nf(z,this),q=[q,this.__zoom.invert(q),z.identifier],L.touch0?!L.touch1&&L.touch0[2]!==q[2]&&(L.touch1=q,L.taps=0):(L.touch0=q,F=!0,L.taps=1+!!d);d&&(d=clearTimeout(d)),F&&(L.taps<2&&(f=q[0],d=setTimeout(function(){d=null},m)),eR(this),L.start())}}function A(P,...I){if(this.__zooming){var D=S(this,I).event(P),_=P.changedTouches,L=_.length,F,M,z,q;for(Ck(P),F=0;F`Seems like you have not used zustand provider as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:i})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:i}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},tA=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],g8e=["Enter"," ","Escape"],b8e={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var x1;(function(e){e.Strict="strict",e.Loose="loose"})(x1||(x1={}));var Zy;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Zy||(Zy={}));var nA;(function(e){e.Partial="partial",e.Full="full"})(nA||(nA={}));const y8e={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var cg;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(cg||(cg={}));var iA;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(iA||(iA={}));var xn;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(xn||(xn={}));const jae={[xn.Left]:xn.Right,[xn.Right]:xn.Left,[xn.Top]:xn.Bottom,[xn.Bottom]:xn.Top};function v8e(e){return e===null?null:e?"valid":"invalid"}const x8e=e=>"id"in e&&"source"in e&&"target"in e,Mzt=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),YW=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),LT=(e,t=[0,0])=>{const{width:n,height:i}=Om(e),r=e.origin??t,s=n*r[0],o=i*r[1];return{x:e.position.x-s,y:e.position.y-o}},Lzt=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((i,r)=>{const s=typeof r=="string";let o=!t.nodeLookup&&!s?r:void 0;t.nodeLookup&&(o=s?t.nodeLookup.get(r):YW(r)?r:t.nodeLookup.get(r.id));const l=o?CP(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return wL(i,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return OL(n)},$T=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},i=!1;return e.forEach(r=>{(t.filter===void 0||t.filter(r))&&(n=wL(n,CP(r)),i=!0)}),i?OL(n):{x:0,y:0,width:0,height:0}},ZW=(e,t,[n,i,r]=[0,0,1],s=!1,o=!1)=>{const l={...yO(t,[n,i,r]),width:t.width/r,height:t.height/r},c=[];for(const u of e.values()){const{measured:d,selectable:f=!0,hidden:h=!1}=u;if(o&&!f||h)continue;const m=d.width??u.width??u.initialWidth??null,g=d.height??u.height??u.initialHeight??null,b=rA(l,O1(u)),v=(m??0)*(g??0),y=s&&b>0;(!u.internals.handleBounds||y||b>=v||u.dragging)&&c.push(u)}return c},$zt=(e,t)=>{const n=new Set;return e.forEach(i=>{n.add(i.id)}),t.filter(i=>n.has(i.source)||n.has(i.target))};function Fzt(e,t){const n=new Map,i=t!=null&&t.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{r.measured.width&&r.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!r.hidden)&&(!i||i.has(r.id))&&n.set(r.id,r)}),n}async function Bzt({nodes:e,width:t,height:n,panZoom:i,minZoom:r,maxZoom:s},o){if(e.size===0)return!0;const l=Fzt(e,o),c=$T(l),u=eK(c,t,n,(o==null?void 0:o.minZoom)??r,(o==null?void 0:o.maxZoom)??s,(o==null?void 0:o.padding)??.1);return await i.setViewport(u,{duration:o==null?void 0:o.duration,ease:o==null?void 0:o.ease,interpolate:o==null?void 0:o.interpolate}),!0}function w8e({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:i=[0,0],nodeExtent:r,onError:s}){const o=n.get(e),l=o.parentId?n.get(o.parentId):void 0,{x:c,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},d=o.origin??i;let f=o.extent||r;if(o.extent==="parent"&&!o.expandParent)if(!l)s==null||s("005",Sf.error005());else{const m=l.measured.width,g=l.measured.height;m&&g&&(f=[[c,u],[c+m,u+g]])}else l&&A0(o.extent)&&(f=[[o.extent[0][0]+c,o.extent[0][1]+u],[o.extent[1][0]+c,o.extent[1][1]+u]]);const h=A0(f)?C0(t,f,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(s==null||s("015",Sf.error015())),{position:{x:h.x-c+(o.measured.width??0)*d[0],y:h.y-u+(o.measured.height??0)*d[1]},positionAbsolute:h}}async function Uzt({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:i,onBeforeDelete:r}){const s=new Set(e.map(h=>h.id)),o=[];for(const h of n){if(h.deletable===!1)continue;const m=s.has(h.id),g=!m&&h.parentId&&o.find(b=>b.id===h.parentId);(m||g)&&o.push(h)}const l=new Set(t.map(h=>h.id)),c=i.filter(h=>h.deletable!==!1),d=$zt(o,c);for(const h of c)l.has(h.id)&&!d.find(g=>g.id===h.id)&&d.push(h);if(!r)return{edges:d,nodes:o};const f=await r({nodes:o,edges:d});return typeof f=="boolean"?f?{edges:d,nodes:o}:{edges:[],nodes:[]}:f}const w1=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),C0=(e={x:0,y:0},t,n)=>({x:w1(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:w1(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function O8e(e,t,n){const{width:i,height:r}=Om(n),{x:s,y:o}=n.internals.positionAbsolute;return C0(e,[[s,o],[s+i,o+r]],t)}const Nae=(e,t,n)=>en?-w1(Math.abs(e-n),1,t)/t:0,JW=(e,t,n=15,i=40)=>{const r=Nae(e.x,i,t.width-i)*n,s=Nae(e.y,i,t.height-i)*n;return[r,s]},wL=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),D7=({x:e,y:t,width:n,height:i})=>({x:e,y:t,x2:e+n,y2:t+i}),OL=({x:e,y:t,x2:n,y2:i})=>({x:e,y:t,width:n-e,height:i-t}),O1=(e,t=[0,0])=>{var r,s;const{x:n,y:i}=YW(e)?e.internals.positionAbsolute:LT(e,t);return{x:n,y:i,width:((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0,height:((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0}},CP=(e,t=[0,0])=>{var r,s;const{x:n,y:i}=YW(e)?e.internals.positionAbsolute:LT(e,t);return{x:n,y:i,x2:n+(((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0),y2:i+(((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0)}},k8e=(e,t)=>OL(wL(D7(e),D7(t))),rA=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),i=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*i)},Rae=e=>df(e.width)&&df(e.height)&&df(e.x)&&df(e.y),df=e=>!isNaN(e)&&isFinite(e),S8e=(e,t)=>(n,i)=>{},FT=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),yO=({x:e,y:t},[n,i,r],s=!1,o=[1,1])=>{const l={x:(e-n)/r,y:(t-i)/r};return s?FT(l,o):l},k1=({x:e,y:t},[n,i,r])=>({x:e*r+n,y:t*r+i});function Qv(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Qzt(e,t,n){if(typeof e=="string"||typeof e=="number"){const i=Qv(e,n),r=Qv(e,t);return{top:i,right:r,bottom:i,left:r,x:r*2,y:i*2}}if(typeof e=="object"){const i=Qv(e.top??e.y??0,n),r=Qv(e.bottom??e.y??0,n),s=Qv(e.left??e.x??0,t),o=Qv(e.right??e.x??0,t);return{top:i,right:o,bottom:r,left:s,x:s+o,y:i+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function zzt(e,t,n,i,r,s){const{x:o,y:l}=k1(e,[t,n,i]),{x:c,y:u}=k1({x:e.x+e.width,y:e.y+e.height},[t,n,i]),d=r-c,f=s-u;return{left:Math.floor(o),top:Math.floor(l),right:Math.floor(d),bottom:Math.floor(f)}}const eK=(e,t,n,i,r,s)=>{const o=Qzt(s,t,n),l=(t-o.x)/e.width,c=(n-o.y)/e.height,u=Math.min(l,c),d=w1(u,i,r),f=e.x+e.width/2,h=e.y+e.height/2,m=t/2-f*d,g=n/2-h*d,b=zzt(e,m,g,d,t,n),v={left:Math.min(b.left-o.left,0),top:Math.min(b.top-o.top,0),right:Math.min(b.right-o.right,0),bottom:Math.min(b.bottom-o.bottom,0)};return{x:m-v.left+v.right,y:g-v.top+v.bottom,zoom:d}},sA=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function A0(e){return e!=null&&e!=="parent"}function Om(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function tK(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function E8e(e,t={width:0,height:0},n,i,r){const s={...e},o=i.get(n);if(o){const l=o.origin||r;s.x+=o.internals.positionAbsolute.x-(t.width??0)*l[0],s.y+=o.internals.positionAbsolute.y-(t.height??0)*l[1]}return s}function Iae(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Vzt(){let e,t;return{promise:new Promise((i,r)=>{e=i,t=r}),resolve:e,reject:t}}function Hzt(e){return{...b8e,...e||{}}}function SE(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:i,containerBounds:r}){const{x:s,y:o}=ff(e),l=yO({x:s-((r==null?void 0:r.left)??0),y:o-((r==null?void 0:r.top)??0)},i),{x:c,y:u}=n?FT(l,t):l;return{xSnapped:c,ySnapped:u,...l}}const nK=e=>({width:e.offsetWidth,height:e.offsetHeight}),C8e=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},qzt=["INPUT","SELECT","TEXTAREA"];function A8e(e){var i,r;const t=((r=(i=e.composedPath)==null?void 0:i.call(e))==null?void 0:r[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:qzt.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const T8e=e=>"clientX"in e,ff=(e,t)=>{var s,o;const n=T8e(e),i=n?e.clientX:(s=e.touches)==null?void 0:s[0].clientX,r=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:i-((t==null?void 0:t.left)??0),y:r-((t==null?void 0:t.top)??0)}},Pae=(e,t,n,i,r)=>{const s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(o=>{const l=o.getBoundingClientRect();return{id:o.getAttribute("data-handleid"),type:e,nodeId:r,position:o.getAttribute("data-handlepos"),x:(l.left-n.left)/i,y:(l.top-n.top)/i,...nK(o)}})};function _8e({sourceX:e,sourceY:t,targetX:n,targetY:i,sourceControlX:r,sourceControlY:s,targetControlX:o,targetControlY:l}){const c=e*.125+r*.375+o*.375+n*.125,u=t*.125+s*.375+l*.375+i*.125,d=Math.abs(c-e),f=Math.abs(u-t);return[c,u,d,f]}function mj(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Dae({pos:e,x1:t,y1:n,x2:i,y2:r,c:s}){switch(e){case xn.Left:return[t-mj(t-i,s),n];case xn.Right:return[t+mj(i-t,s),n];case xn.Top:return[t,n-mj(n-r,s)];case xn.Bottom:return[t,n+mj(r-n,s)]}}function j8e({sourceX:e,sourceY:t,sourcePosition:n=xn.Bottom,targetX:i,targetY:r,targetPosition:s=xn.Top,curvature:o=.25}){const[l,c]=Dae({pos:n,x1:e,y1:t,x2:i,y2:r,c:o}),[u,d]=Dae({pos:s,x1:i,y1:r,x2:e,y2:t,c:o}),[f,h,m,g]=_8e({sourceX:e,sourceY:t,targetX:i,targetY:r,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${e},${t} C${l},${c} ${u},${d} ${i},${r}`,f,h,m,g]}function N8e({sourceX:e,sourceY:t,targetX:n,targetY:i}){const r=Math.abs(n-e)/2,s=n0}const Gzt=({source:e,sourceHandle:t,target:n,targetHandle:i})=>`xy-edge__${e}${t||""}-${n}${i||""}`,Xzt=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),Yzt=(e,t,n={})=>{var s;if(!e.source||!e.target)return(s=n.onError)==null||s.call(n,"006",Sf.error006()),t;const i=n.getEdgeId||Gzt;let r;return x8e(e)?r={...e}:r={...e,id:i(e)},Xzt(r,t)?t:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,t.concat(r))};function R8e({sourceX:e,sourceY:t,targetX:n,targetY:i}){const[r,s,o,l]=N8e({sourceX:e,sourceY:t,targetX:n,targetY:i});return[`M ${e},${t}L ${n},${i}`,r,s,o,l]}const Mae={[xn.Left]:{x:-1,y:0},[xn.Right]:{x:1,y:0},[xn.Top]:{x:0,y:-1},[xn.Bottom]:{x:0,y:1}},Zzt=({source:e,sourcePosition:t=xn.Bottom,target:n})=>t===xn.Left||t===xn.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Jzt({source:e,sourcePosition:t=xn.Bottom,target:n,targetPosition:i=xn.Top,center:r,offset:s,stepPosition:o}){const l=Mae[t],c=Mae[i],u={x:e.x+l.x*s,y:e.y+l.y*s},d={x:n.x+c.x*s,y:n.y+c.y*s},f=Zzt({source:u,sourcePosition:t,target:d}),h=f.x!==0?"x":"y",m=f[h];let g=[],b,v;const y={x:0,y:0},w={x:0,y:0},[,,x,O]=N8e({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[h]*c[h]===-1){h==="x"?(b=r.x??u.x+(d.x-u.x)*o,v=r.y??(u.y+d.y)/2):(b=r.x??(u.x+d.x)/2,v=r.y??u.y+(d.y-u.y)*o);const E=[{x:b,y:u.y},{x:b,y:d.y}],j=[{x:u.x,y:v},{x:d.x,y:v}];l[h]===m?g=h==="x"?E:j:g=h==="x"?j:E}else{const E=[{x:u.x,y:d.y}],j=[{x:d.x,y:u.y}];if(h==="x"?g=l.x===m?j:E:g=l.y===m?E:j,t===i){const P=Math.abs(e[h]-n[h]);if(P<=s){const I=Math.min(s-1,s-P);l[h]===m?y[h]=(u[h]>e[h]?-1:1)*I:w[h]=(d[h]>n[h]?-1:1)*I}}if(t!==i){const P=h==="x"?"y":"x",I=l[h]===c[P],D=u[P]>d[P],_=u[P]=N?(b=(T.x+R.x)/2,v=g[0].y):(b=g[0].x,v=(T.y+R.y)/2)}const k={x:u.x+y.x,y:u.y+y.y},S={x:d.x+w.x,y:d.y+w.y};return[[e,...k.x!==g[0].x||k.y!==g[0].y?[k]:[],...g,...S.x!==g[g.length-1].x||S.y!==g[g.length-1].y?[S]:[],n],b,v,x,O]}function eVt(e,t,n,i){const r=Math.min(Lae(e,t)/2,Lae(t,n)/2,i),{x:s,y:o}=t;if(e.x===s&&s===n.x||e.y===o&&o===n.y)return`L${s} ${o}`;if(e.y===o){const u=e.xn.id===t):e[0])||null}function M7(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`:""}function nVt(e,{id:t,defaultColor:n,defaultMarkerStart:i,defaultMarkerEnd:r}){const s=new Set;return e.reduce((o,l)=>([l.markerStart||i,l.markerEnd||r].forEach(c=>{if(c&&typeof c=="object"){const u=M7(c,t);s.has(u)||(o.push({id:u,color:c.color||n,...c}),s.add(u))}}),o),[]).sort((o,l)=>o.id.localeCompare(l.id))}const I8e=1e3,iVt=10,iK={nodeOrigin:[0,0],nodeExtent:tA,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},rVt={...iK,checkEquality:!0};function rK(e,t){const n={...e};for(const i in t)t[i]!==void 0&&(n[i]=t[i]);return n}function sVt(e,t,n){const i=rK(iK,n);for(const r of e.values())if(r.parentId)aK(r,e,t,i);else{const s=LT(r,i.nodeOrigin),o=A0(r.extent)?r.extent:i.nodeExtent,l=C0(s,o,Om(r));r.internals.positionAbsolute=l}}function aVt(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],i=[];for(const r of e.handles){const s={id:r.id,width:r.width??1,height:r.height??1,nodeId:e.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?n.push(s):r.type==="target"&&i.push(s)}return{source:n,target:i}}function sK(e){return e==="manual"}function L7(e,t,n,i={}){var d,f;const r=rK(rVt,i),s={i:0},o=new Map(t),l=r!=null&&r.elevateNodesOnSelect&&!sK(r.zIndexMode)?I8e:0;let c=e.length>0,u=!1;t.clear(),n.clear();for(const h of e){let m=o.get(h.id);if(r.checkEquality&&h===(m==null?void 0:m.internals.userNode))t.set(h.id,m);else{const g=LT(h,r.nodeOrigin),b=A0(h.extent)?h.extent:r.nodeExtent,v=C0(g,b,Om(h));m={...r.defaults,...h,measured:{width:(d=h.measured)==null?void 0:d.width,height:(f=h.measured)==null?void 0:f.height},internals:{positionAbsolute:v,handleBounds:aVt(h,m),z:P8e(h,l,r.zIndexMode),userNode:h}},t.set(h.id,m)}(m.measured===void 0||m.measured.width===void 0||m.measured.height===void 0)&&!m.hidden&&(c=!1),h.parentId&&aK(m,t,n,i,s),u||(u=h.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:u}}function oVt(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function aK(e,t,n,i,r){const{elevateNodesOnSelect:s,nodeOrigin:o,nodeExtent:l,zIndexMode:c}=rK(iK,i),u=e.parentId,d=t.get(u);if(!d){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}oVt(e,n),r&&!d.parentId&&d.internals.rootParentIndex===void 0&&c==="auto"&&(d.internals.rootParentIndex=++r.i,d.internals.z=d.internals.z+r.i*iVt),r&&d.internals.rootParentIndex!==void 0&&(r.i=d.internals.rootParentIndex);const f=s&&!sK(c)?I8e:0,{x:h,y:m,z:g}=lVt(e,d,o,l,f,c),{positionAbsolute:b}=e.internals,v=h!==b.x||m!==b.y;(v||g!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:h,y:m}:b,z:g}})}function P8e(e,t,n){const i=df(e.zIndex)?e.zIndex:0;return sK(n)?i:i+(e.selected?t:0)}function lVt(e,t,n,i,r,s){const{x:o,y:l}=t.internals.positionAbsolute,c=Om(e),u=LT(e,n),d=A0(e.extent)?C0(u,e.extent,c):u;let f=C0({x:o+d.x,y:l+d.y},i,c);e.extent==="parent"&&(f=O8e(f,c,t));const h=P8e(e,r,s),m=t.internals.z??0;return{x:f.x,y:f.y,z:m>=h?m+1:h}}function oK(e,t,n,i=[0,0]){var o;const r=[],s=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const u=((o=s.get(l.parentId))==null?void 0:o.expandedRect)??O1(c),d=k8e(u,l.rect);s.set(l.parentId,{expandedRect:d,parent:c})}return s.size>0&&s.forEach(({expandedRect:l,parent:c},u)=>{var x;const d=c.internals.positionAbsolute,f=Om(c),h=c.origin??i,m=l.x0||g>0||y||w)&&(r.push({id:u,type:"position",position:{x:c.position.x-m+y,y:c.position.y-g+w}}),(x=n.get(u))==null||x.forEach(O=>{e.some(k=>k.id===O.id)||r.push({id:O.id,type:"position",position:{x:O.position.x+m,y:O.position.y+g}})})),(f.width0){const m=oK(h,t,n,r);u.push(...m)}return{changes:u,updatedInternals:c}}async function uVt({delta:e,panZoom:t,transform:n,translateExtent:i,width:r,height:s}){if(!t||!e.x&&!e.y)return!1;const o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,s]],i);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function Uae(e,t,n,i,r,s){let o=r;const l=i.get(o)||new Map;i.set(o,l.set(n,t)),o=`${r}-${e}`;const c=i.get(o)||new Map;if(i.set(o,c.set(n,t)),s){o=`${r}-${e}-${s}`;const u=i.get(o)||new Map;i.set(o,u.set(n,t))}}function D8e(e,t,n){e.clear(),t.clear();for(const i of n){const{source:r,target:s,sourceHandle:o=null,targetHandle:l=null}=i,c={edgeId:i.id,source:r,target:s,sourceHandle:o,targetHandle:l},u=`${r}-${o}--${s}-${l}`,d=`${s}-${l}--${r}-${o}`;Uae("source",c,d,e,r,o),Uae("target",c,u,e,s,l),t.set(i.id,i)}}function M8e(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:M8e(n,t):!1}function Qae(e,t,n){var r;let i=e;do{if((r=i==null?void 0:i.matches)!=null&&r.call(i,t))return!0;if(i===n)return!1;i=i==null?void 0:i.parentElement}while(i);return!1}function dVt(e,t,n,i){const r=new Map;for(const[s,o]of e)if((o.selected||o.id===i)&&(!o.parentId||!M8e(o,e))&&(o.draggable||t&&typeof o.draggable>"u")){const l=e.get(s);l&&r.set(s,{id:s,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return r}function Y$({nodeId:e,dragItems:t,nodeLookup:n,dragging:i=!0}){var o,l,c;const r=[];for(const[u,d]of t){const f=(o=n.get(u))==null?void 0:o.internals.userNode;f&&r.push({...f,position:d.position,dragging:i})}if(!e)return[r[0],r];const s=(l=n.get(e))==null?void 0:l.internals.userNode;return[s?{...s,position:((c=t.get(e))==null?void 0:c.position)||s.position,dragging:i}:r[0],r]}function fVt({dragItems:e,snapGrid:t,x:n,y:i}){const r=e.values().next().value;if(!r)return null;const s={x:n-r.distance.x,y:i-r.distance.y},o=FT(s,t);return{x:o.x-s.x,y:o.y-s.y}}function hVt({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:i,onDragStop:r}){let s={x:null,y:null},o=0,l=new Map,c=!1,u={x:0,y:0},d=null,f=!1,h=null,m=!1,g=!1,b=null;function v({noDragClassName:w,handleSelector:x,domNode:O,isSelectable:k,nodeId:S,nodeClickDistance:C=0}){h=yu(O);function E({x:A,y:N}){const{nodeLookup:P,nodeExtent:I,snapGrid:D,snapToGrid:_,nodeOrigin:L,onNodeDrag:F,onSelectionDrag:M,onError:z,updateNodePositions:q}=t();s={x:A,y:N};let U=!1;const J=l.size>1,V=J&&I?D7($T(l)):null,Z=J&&_?fVt({dragItems:l,snapGrid:D,x:A,y:N}):null;for(const[ne,W]of l){if(!P.has(ne))continue;let G={x:A-W.distance.x,y:N-W.distance.y};_&&(G=Z?{x:Math.round(G.x+Z.x),y:Math.round(G.y+Z.y)}:FT(G,D));let H=null;if(J&&I&&!W.extent&&V){const{positionAbsolute:X}=W.internals,ie=X.x-V.x+I[0][0],ee=X.x+W.measured.width-V.x2+I[1][0],be=X.y-V.y+I[0][1],ue=X.y+W.measured.height-V.y2+I[1][1];H=[[ie,be],[ee,ue]]}const{position:se,positionAbsolute:Y}=w8e({nodeId:ne,nextPosition:G,nodeLookup:P,nodeExtent:H||I,nodeOrigin:L,onError:z});U=U||W.position.x!==se.x||W.position.y!==se.y,W.position=se,W.internals.positionAbsolute=Y}if(g=g||U,!!U&&(q(l,!0),b&&(i||F||!S&&M))){const[ne,W]=Y$({nodeId:S,dragItems:l,nodeLookup:P});i==null||i(b,l,ne,W),F==null||F(b,ne,W),S||M==null||M(b,W)}}async function j(){if(!d)return;const{transform:A,panBy:N,autoPanSpeed:P,autoPanOnNodeDrag:I}=t();if(!I){c=!1,cancelAnimationFrame(o);return}const[D,_]=JW(u,d,P);(D!==0||_!==0)&&(s.x=(s.x??0)-D/A[2],s.y=(s.y??0)-_/A[2],await N({x:D,y:_})&&E(s)),o=requestAnimationFrame(j)}function T(A){var J;const{nodeLookup:N,multiSelectionActive:P,nodesDraggable:I,transform:D,snapGrid:_,snapToGrid:L,selectNodesOnDrag:F,onNodeDragStart:M,onSelectionDragStart:z,unselectNodesAndEdges:q}=t();f=!0,(!F||!k)&&!P&&S&&((J=N.get(S))!=null&&J.selected||q()),k&&F&&S&&(e==null||e(S));const U=SE(A.sourceEvent,{transform:D,snapGrid:_,snapToGrid:L,containerBounds:d});if(s=U,l=dVt(N,I,U,S),l.size>0&&(n||M||!S&&z)){const[V,Z]=Y$({nodeId:S,dragItems:l,nodeLookup:N});n==null||n(A.sourceEvent,l,V,Z),M==null||M(A.sourceEvent,V,Z),S||z==null||z(A.sourceEvent,Z)}}const R=JFe().clickDistance(C).on("start",A=>{const{domNode:N,nodeDragThreshold:P,transform:I,snapGrid:D,snapToGrid:_}=t();d=(N==null?void 0:N.getBoundingClientRect())||null,m=!1,g=!1,b=A.sourceEvent,P===0&&T(A),s=SE(A.sourceEvent,{transform:I,snapGrid:D,snapToGrid:_,containerBounds:d}),u=ff(A.sourceEvent,d)}).on("drag",A=>{const{autoPanOnNodeDrag:N,transform:P,snapGrid:I,snapToGrid:D,nodeDragThreshold:_,nodeLookup:L}=t(),F=SE(A.sourceEvent,{transform:P,snapGrid:I,snapToGrid:D,containerBounds:d});if(b=A.sourceEvent,(A.sourceEvent.type==="touchmove"&&A.sourceEvent.touches.length>1||S&&!L.has(S))&&(m=!0),!m){if(!c&&N&&f&&(c=!0,j()),!f){const M=ff(A.sourceEvent,d),z=M.x-u.x,q=M.y-u.y;Math.sqrt(z*z+q*q)>_&&T(A)}(s.x!==F.xSnapped||s.y!==F.ySnapped)&&l&&f&&(u=ff(A.sourceEvent,d),E(F))}}).on("end",A=>{if(!f||m){m&&l.size>0&&t().updateNodePositions(l,!1);return}if(c=!1,f=!1,cancelAnimationFrame(o),l.size>0){const{nodeLookup:N,updateNodePositions:P,onNodeDragStop:I,onSelectionDragStop:D}=t();if(g&&(P(l,!1),g=!1),r||I||!S&&D){const[_,L]=Y$({nodeId:S,dragItems:l,nodeLookup:N,dragging:!1});r==null||r(A.sourceEvent,l,_,L),I==null||I(A.sourceEvent,_,L),S||D==null||D(A.sourceEvent,L)}}}).filter(A=>{const N=A.target;return!A.button&&(!w||!Qae(N,`.${w}`,O))&&(!x||Qae(N,x,O))});h.call(R)}function y(){h==null||h.on(".drag",null)}return{update:v,destroy:y}}function pVt(e,t,n){const i=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const s of t.values())rA(r,O1(s))>0&&i.push(s);return i}const mVt=250;function gVt(e,t,n,i){var l,c;let r=[],s=1/0;const o=pVt(e,n,t+mVt);for(const u of o){const d=[...((l=u.internals.handleBounds)==null?void 0:l.source)??[],...((c=u.internals.handleBounds)==null?void 0:c.target)??[]];for(const f of d){if(i.nodeId===f.nodeId&&i.type===f.type&&i.id===f.id)continue;const{x:h,y:m}=T0(u,f,f.position,!0),g=Math.sqrt(Math.pow(h-e.x,2)+Math.pow(m-e.y,2));g>t||(g1){const u=i.type==="source"?"target":"source";return r.find(d=>d.type===u)??r[0]}return r[0]}function L8e(e,t,n,i,r,s=!1){var u,d,f;const o=i.get(e);if(!o)return null;const l=r==="strict"?(u=o.internals.handleBounds)==null?void 0:u[t]:[...((d=o.internals.handleBounds)==null?void 0:d.source)??[],...((f=o.internals.handleBounds)==null?void 0:f.target)??[]],c=(n?l==null?void 0:l.find(h=>h.id===n):l==null?void 0:l[0])??null;return c&&s?{...c,...T0(o,c,c.position,!0)}:c}function $8e(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function bVt(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const F8e=()=>!0;function yVt(e,{connectionMode:t,connectionRadius:n,handleId:i,nodeId:r,edgeUpdaterType:s,isTarget:o,domNode:l,nodeLookup:c,lib:u,autoPanOnConnect:d,flowId:f,panBy:h,cancelConnection:m,onConnectStart:g,onConnect:b,onConnectEnd:v,isValidConnection:y=F8e,onReconnectEnd:w,updateConnection:x,getTransform:O,getFromHandle:k,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:E}){const j=C8e(e.target);let T=0,R;const{x:A,y:N}=ff(e),P=$8e(s,E),I=l==null?void 0:l.getBoundingClientRect();let D=!1;if(!I||!P)return;const _=L8e(r,P,i,c,t);if(!_)return;let L=ff(e,I),F=!1,M=null,z=!1,q=null;function U(){if(!d||!I)return;const[se,Y]=JW(L,I,S);h({x:se,y:Y}),T=requestAnimationFrame(U)}const J={..._,nodeId:r,type:P,position:_.position},V=c.get(r);let ne={inProgress:!0,isValid:null,from:T0(V,J,xn.Left,!0),fromHandle:J,fromPosition:J.position,fromNode:V,to:L,toHandle:null,toPosition:jae[J.position],toNode:null,pointer:L};function W(){D=!0,x(ne),g==null||g(e,{nodeId:r,handleId:i,handleType:P})}C===0&&W();function G(se){if(!D){const{x:ue,y:pe}=ff(se),ke=ue-A,je=pe-N;if(!(ke*ke+je*je>C*C))return;W()}if(!k()||!J){H(se);return}const Y=O();L=ff(se,I),R=gVt(yO(L,Y,!1,[1,1]),n,c,J),F||(U(),F=!0);const X=B8e(se,{handle:R,connectionMode:t,fromNodeId:r,fromHandleId:i,fromType:o?"target":"source",isValidConnection:y,doc:j,lib:u,flowId:f,nodeLookup:c});q=X.handleDomNode,M=X.connection,z=bVt(!!R,X.isValid);const ie=c.get(r),ee=ie?T0(ie,J,xn.Left,!0):ne.from,be={...ne,from:ee,isValid:z,to:X.toHandle&&z?k1({x:X.toHandle.x,y:X.toHandle.y},Y):L,toHandle:X.toHandle,toPosition:z&&X.toHandle?X.toHandle.position:jae[J.position],toNode:X.toHandle?c.get(X.toHandle.nodeId):null,pointer:L};x(be),ne=be}function H(se){if(!("touches"in se&&se.touches.length>0)){if(D){(R||q)&&M&&z&&(b==null||b(M));const{inProgress:Y,...X}=ne,ie={...X,toPosition:ne.toHandle?ne.toPosition:null};v==null||v(se,ie),s&&(w==null||w(se,ie))}m(),cancelAnimationFrame(T),F=!1,z=!1,M=null,q=null,j.removeEventListener("mousemove",G),j.removeEventListener("mouseup",H),j.removeEventListener("touchmove",G),j.removeEventListener("touchend",H)}}j.addEventListener("mousemove",G),j.addEventListener("mouseup",H),j.addEventListener("touchmove",G),j.addEventListener("touchend",H)}function B8e(e,{handle:t,connectionMode:n,fromNodeId:i,fromHandleId:r,fromType:s,doc:o,lib:l,flowId:c,isValidConnection:u=F8e,nodeLookup:d}){const f=s==="target",h=t?o.querySelector(`.${l}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:m,y:g}=ff(e),b=o.elementFromPoint(m,g),v=b!=null&&b.classList.contains(`${l}-flow__handle`)?b:h,y={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const w=$8e(void 0,v),x=v.getAttribute("data-nodeid"),O=v.getAttribute("data-handleid"),k=v.classList.contains("connectable"),S=v.classList.contains("connectableend");if(!x||!w)return y;const C={source:f?x:i,sourceHandle:f?O:r,target:f?i:x,targetHandle:f?r:O};y.connection=C;const j=k&&S&&(n===x1.Strict?f&&w==="source"||!f&&w==="target":x!==i||O!==r);y.isValid=j&&u(C),y.toHandle=L8e(x,w,O,d,n,!0)}return y}const $7={onPointerDown:yVt,isValid:B8e};function vVt({domNode:e,panZoom:t,getTransform:n,getViewScale:i}){const r=yu(e);function s({translateExtent:l,width:c,height:u,zoomStep:d=1,pannable:f=!0,zoomable:h=!0,inversePan:m=!1}){const g=x=>{if(x.sourceEvent.type!=="wheel"||!t)return;const O=n(),k=x.sourceEvent.ctrlKey&&sA()?10:1,S=-x.sourceEvent.deltaY*(x.sourceEvent.deltaMode===1?.05:x.sourceEvent.deltaMode?1:.002)*d,C=O[2]*Math.pow(2,S*k);t.scaleTo(C)};let b=[0,0];const v=x=>{(x.sourceEvent.type==="mousedown"||x.sourceEvent.type==="touchstart")&&(b=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY])},y=x=>{const O=n();if(x.sourceEvent.type!=="mousemove"&&x.sourceEvent.type!=="touchmove"||!t)return;const k=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY],S=[k[0]-b[0],k[1]-b[1]];b=k;const C=i()*Math.max(O[2],Math.log(O[2]))*(m?-1:1),E={x:O[0]-S[0]*C,y:O[1]-S[1]*C},j=[[0,0],[c,u]];t.setViewportConstrained({x:E.x,y:E.y,zoom:O[2]},j,l)},w=m8e().on("start",v).on("zoom",f?y:null).on("zoom.wheel",h?g:null);r.call(w,{})}function o(){r.on("zoom",null)}return{update:s,destroy:o,pointer:nf}}const kL=e=>({x:e.x,y:e.y,zoom:e.k}),Z$=({x:e,y:t,zoom:n})=>xL.translate(e,t).scale(n),Bx=(e,t)=>e.target.closest(`.${t}`),U8e=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),xVt=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,J$=(e,t=0,n=xVt,i=()=>{})=>{const r=typeof t=="number"&&t>0;return r||i(),r?e.transition().duration(t).ease(n).on("end",i):e},Q8e=e=>{const t=e.ctrlKey&&sA()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function wVt({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:i,panOnScrollMode:r,panOnScrollSpeed:s,zoomOnPinch:o,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:u}){return d=>{if(Bx(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(d.ctrlKey&&o){const v=nf(d),y=Q8e(d),w=f*Math.pow(2,y);i.scaleTo(n,w,v,d);return}const h=d.deltaMode===1?20:1;let m=r===Zy.Vertical?0:d.deltaX*h,g=r===Zy.Horizontal?0:d.deltaY*h;!sA()&&d.shiftKey&&r!==Zy.Vertical&&(m=d.deltaY*h,g=0),i.translateBy(n,-(m/f)*s,-(g/f)*s,{internal:!0});const b=kL(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(d,b),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,b),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(d,b))}}function OVt({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(i,r){const s=i.type==="wheel",o=!t&&s&&!i.ctrlKey,l=Bx(i,e);if(i.ctrlKey&&s&&l&&i.preventDefault(),o||l)return null;i.preventDefault(),n.call(this,i,r)}}function kVt({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return i=>{var s,o,l;if((s=i.sourceEvent)!=null&&s.internal)return;const r=kL(i.transform);e.mouseButton=((o=i.sourceEvent)==null?void 0:o.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=r,((l=i.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(i.sourceEvent,r))}}function SVt({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:i,onPanZoom:r}){return s=>{var o,l;e.usedRightMouseButton=!!(n&&U8e(t,e.mouseButton??0)),(o=s.sourceEvent)!=null&&o.sync||i([s.transform.x,s.transform.y,s.transform.k]),r&&!((l=s.sourceEvent)!=null&&l.internal)&&(r==null||r(s.sourceEvent,kL(s.transform)))}}function EVt({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:i,onPanZoomEnd:r,onPaneContextMenu:s}){return o=>{var l;if(!((l=o.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,s&&U8e(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&s(o.sourceEvent),e.usedRightMouseButton=!1,i(!1),r)){const c=kL(o.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r==null||r(o.sourceEvent,c)},n?150:0)}}}function CVt({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:i,panOnScroll:r,zoomOnDoubleClick:s,userSelectionActive:o,noWheelClassName:l,noPanClassName:c,lib:u,connectionInProgress:d}){return f=>{var v;const h=e||t,m=n&&f.ctrlKey,g=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(Bx(f,`${u}-flow__node`)||Bx(f,`${u}-flow__edge`)))return!0;if(!i&&!h&&!r&&!s&&!n||o||d&&!g||Bx(f,l)&&g||Bx(f,c)&&(!g||r&&g&&!e)||!n&&f.ctrlKey&&g)return!1;if(!n&&f.type==="touchstart"&&((v=f.touches)==null?void 0:v.length)>1)return f.preventDefault(),!1;if(!h&&!r&&!m&&g||!i&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(i)&&!i.includes(f.button)&&f.type==="mousedown")return!1;const b=Array.isArray(i)&&i.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||g)&&b}}function AVt({domNode:e,minZoom:t,maxZoom:n,translateExtent:i,viewport:r,onPanZoom:s,onPanZoomStart:o,onPanZoomEnd:l,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=m8e().scaleExtent([t,n]).translateExtent(i),h=yu(e).call(f);w({x:r.x,y:r.y,zoom:w1(r.zoom,t,n)},[[0,0],[d.width,d.height]],i);const m=h.on("wheel.zoom"),g=h.on("dblclick.zoom");f.wheelDelta(Q8e);async function b(R,A){return h?new Promise(N=>{f==null||f.interpolate((A==null?void 0:A.interpolate)==="linear"?kE:YN).transform(J$(h,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>N(!0)),R)}):!1}function v({noWheelClassName:R,noPanClassName:A,onPaneContextMenu:N,userSelectionActive:P,panOnScroll:I,panOnDrag:D,panOnScrollMode:_,panOnScrollSpeed:L,preventScrolling:F,zoomOnPinch:M,zoomOnScroll:z,zoomOnDoubleClick:q,zoomActivationKeyPressed:U,lib:J,onTransformChange:V,connectionInProgress:Z,paneClickDistance:ne,selectionOnDrag:W}){P&&!u.isZoomingOrPanning&&y();const G=I&&!U&&!P;f.clickDistance(W?1/0:!df(ne)||ne<0?0:ne);const H=G?wVt({zoomPanValues:u,noWheelClassName:R,d3Selection:h,d3Zoom:f,panOnScrollMode:_,panOnScrollSpeed:L,zoomOnPinch:M,onPanZoomStart:o,onPanZoom:s,onPanZoomEnd:l}):OVt({noWheelClassName:R,preventScrolling:F,d3ZoomHandler:m});h.on("wheel.zoom",H,{passive:!1});const se=kVt({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:o});f.on("start",se);const Y=SVt({zoomPanValues:u,panOnDrag:D,onPaneContextMenu:!!N,onPanZoom:s,onTransformChange:V});f.on("zoom",Y);const X=EVt({zoomPanValues:u,panOnDrag:D,panOnScroll:I,onPaneContextMenu:N,onPanZoomEnd:l,onDraggingChange:c});f.on("end",X);const ie=CVt({zoomActivationKeyPressed:U,panOnDrag:D,zoomOnScroll:z,panOnScroll:I,zoomOnDoubleClick:q,zoomOnPinch:M,userSelectionActive:P,noPanClassName:A,noWheelClassName:R,lib:J,connectionInProgress:Z});f.filter(ie),q?h.on("dblclick.zoom",g):h.on("dblclick.zoom",null)}function y(){f.on("zoom",null)}async function w(R,A,N){const P=Z$(R),I=f==null?void 0:f.constrain()(P,A,N);return I&&await b(I),I}async function x(R,A){const N=Z$(R);return await b(N,A),N}function O(R){if(h){const A=Z$(R),N=h.property("__zoom");(N.k!==R.zoom||N.x!==R.x||N.y!==R.y)&&(f==null||f.transform(h,A,null,{sync:!0}))}}function k(){const R=h?p8e(h.node()):{x:0,y:0,k:1};return{x:R.x,y:R.y,zoom:R.k}}async function S(R,A){return h?new Promise(N=>{f==null||f.interpolate((A==null?void 0:A.interpolate)==="linear"?kE:YN).scaleTo(J$(h,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>N(!0)),R)}):!1}async function C(R,A){return h?new Promise(N=>{f==null||f.interpolate((A==null?void 0:A.interpolate)==="linear"?kE:YN).scaleBy(J$(h,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>N(!0)),R)}):!1}function E(R){f==null||f.scaleExtent(R)}function j(R){f==null||f.translateExtent(R)}function T(R){const A=!df(R)||R<0?0:R;f==null||f.clickDistance(A)}return{update:v,destroy:y,setViewport:x,setViewportConstrained:w,getViewport:k,scaleTo:S,scaleBy:C,setScaleExtent:E,setTranslateExtent:j,syncViewport:O,setClickDistance:T}}var S1;(function(e){e.Line="line",e.Handle="handle"})(S1||(S1={}));function TVt({width:e,prevWidth:t,height:n,prevHeight:i,affectsX:r,affectsY:s}){const o=e-t,l=n-i,c=[o>0?1:o<0?-1:0,l>0?1:l<0?-1:0];return o&&r&&(c[0]=c[0]*-1),l&&s&&(c[1]=c[1]*-1),c}function zae(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),i=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:i,affectsY:r}}function Fm(e,t){return Math.max(0,t-e)}function Bm(e,t){return Math.max(0,e-t)}function gj(e,t,n){return Math.max(0,t-e,e-n)}function Vae(e,t){return e?!t:t}function _Vt(e,t,n,i,r,s,o,l){let{affectsX:c,affectsY:u}=t;const{isHorizontal:d,isVertical:f}=t,h=d&&f,{xSnapped:m,ySnapped:g}=n,{minWidth:b,maxWidth:v,minHeight:y,maxHeight:w}=i,{x,y:O,width:k,height:S,aspectRatio:C}=e;let E=Math.floor(d?m-e.pointerX:0),j=Math.floor(f?g-e.pointerY:0);const T=k+(c?-E:E),R=S+(u?-j:j),A=-s[0]*k,N=-s[1]*S;let P=gj(T,b,v),I=gj(R,y,w);if(o){let L=0,F=0;c&&E<0?L=Fm(x+E+A,o[0][0]):!c&&E>0&&(L=Bm(x+T+A,o[1][0])),u&&j<0?F=Fm(O+j+N,o[0][1]):!u&&j>0&&(F=Bm(O+R+N,o[1][1])),P=Math.max(P,L),I=Math.max(I,F)}if(l){let L=0,F=0;c&&E>0?L=Bm(x+E,l[0][0]):!c&&E<0&&(L=Fm(x+T,l[1][0])),u&&j>0?F=Bm(O+j,l[0][1]):!u&&j<0&&(F=Fm(O+R,l[1][1])),P=Math.max(P,L),I=Math.max(I,F)}if(r){if(d){const L=gj(T/C,y,w)*C;if(P=Math.max(P,L),o){let F=0;!c&&!u||c&&!u&&h?F=Bm(O+N+T/C,o[1][1])*C:F=Fm(O+N+(c?E:-E)/C,o[0][1])*C,P=Math.max(P,F)}if(l){let F=0;!c&&!u||c&&!u&&h?F=Fm(O+T/C,l[1][1])*C:F=Bm(O+(c?E:-E)/C,l[0][1])*C,P=Math.max(P,F)}}if(f){const L=gj(R*C,b,v)/C;if(I=Math.max(I,L),o){let F=0;!c&&!u||u&&!c&&h?F=Bm(x+R*C+A,o[1][0])/C:F=Fm(x+(u?j:-j)*C+A,o[0][0])/C,I=Math.max(I,F)}if(l){let F=0;!c&&!u||u&&!c&&h?F=Fm(x+R*C,l[1][0])/C:F=Bm(x+(u?j:-j)*C,l[0][0])/C,I=Math.max(I,F)}}}j=j+(j<0?I:-I),E=E+(E<0?P:-P),r&&(h?T>R*C?j=(Vae(c,u)?-E:E)/C:E=(Vae(c,u)?-j:j)*C:d?(j=E/C,u=c):(E=j*C,c=u));const D=c?x+E:x,_=u?O+j:O;return{width:k+(c?-E:E),height:S+(u?-j:j),x:s[0]*E*(c?-1:1)+D,y:s[1]*j*(u?-1:1)+_}}const z8e={width:0,height:0,x:0,y:0},jVt={...z8e,pointerX:0,pointerY:0,aspectRatio:1};function NVt(e,t,n){const i=t.position.x+e.position.x,r=t.position.y+e.position.y,s=e.measured.width??0,o=e.measured.height??0,l=n[0]*s,c=n[1]*o;return[[i-l,r-c],[i+s-l,r+o-c]]}function RVt({domNode:e,nodeId:t,getStoreItems:n,onChange:i,onEnd:r}){const s=yu(e);let o={controlDirection:zae("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:u,boundaries:d,keepAspectRatio:f,resizeDirection:h,onResizeStart:m,onResize:g,onResizeEnd:b,shouldResize:v}){let y={...z8e},w={...jVt};o={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:zae(u)};let x,O=null,k=[],S,C,E,j=!1;const T=JFe().on("start",R=>{const{nodeLookup:A,transform:N,snapGrid:P,snapToGrid:I,nodeOrigin:D,paneDomNode:_}=n();if(x=A.get(t),!x)return;O=(_==null?void 0:_.getBoundingClientRect())??null;const{xSnapped:L,ySnapped:F}=SE(R.sourceEvent,{transform:N,snapGrid:P,snapToGrid:I,containerBounds:O});y={width:x.measured.width??0,height:x.measured.height??0,x:x.position.x??0,y:x.position.y??0},w={...y,pointerX:L,pointerY:F,aspectRatio:y.width/y.height},S=void 0,C=A0(x.extent)?x.extent:void 0,x.parentId&&(x.extent==="parent"||x.expandParent)&&(S=A.get(x.parentId)),S&&x.extent==="parent"&&(C=[[0,0],[S.measured.width,S.measured.height]]),k=[],E=void 0;for(const[M,z]of A)if(z.parentId===t&&(k.push({id:M,position:{...z.position},extent:z.extent}),z.extent==="parent"||z.expandParent)){const q=NVt(z,x,z.origin??D);E?E=[[Math.min(q[0][0],E[0][0]),Math.min(q[0][1],E[0][1])],[Math.max(q[1][0],E[1][0]),Math.max(q[1][1],E[1][1])]]:E=q}m==null||m(R,{...y})}).on("drag",R=>{const{transform:A,snapGrid:N,snapToGrid:P,nodeOrigin:I}=n(),D=SE(R.sourceEvent,{transform:A,snapGrid:N,snapToGrid:P,containerBounds:O}),_=[];if(!x)return;const{x:L,y:F,width:M,height:z}=y,q={},U=x.origin??I,{width:J,height:V,x:Z,y:ne}=_Vt(w,o.controlDirection,D,o.boundaries,o.keepAspectRatio,U,C,E),W=J!==M,G=V!==z,H=Z!==L&&W,se=ne!==F&&G;if(!H&&!se&&!W&&!G)return;if((H||se||U[0]===1||U[1]===1)&&(q.x=H?Z:y.x,q.y=se?ne:y.y,y.x=q.x,y.y=q.y,k.length>0)){const ee=Z-L,be=ne-F;for(const ue of k)ue.position={x:ue.position.x-ee+U[0]*(J-M),y:ue.position.y-be+U[1]*(V-z)},_.push(ue)}if((W||G)&&(q.width=W&&(!o.resizeDirection||o.resizeDirection==="horizontal")?J:y.width,q.height=G&&(!o.resizeDirection||o.resizeDirection==="vertical")?V:y.height,y.width=q.width,y.height=q.height),S&&x.expandParent){const ee=U[0]*(q.width??0);q.x&&q.x{j&&(b==null||b(R,{...y}),r==null||r({...y}),j=!1)});s.call(T)}function c(){s.on(".drag",null)}return{update:l,destroy:c}}const IVt={},Hae=e=>{let t;const n=new Set,i=(d,f)=>{const h=typeof d=="function"?d(t):d;if(!Object.is(h,t)){const m=t;t=f??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(g=>g(t,m))}},r=()=>t,c={setState:i,getState:r,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(IVt?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=t=e(i,r,c);return c},PVt=e=>e?Hae(e):Hae,{useDebugValue:DVt}=ji,{useSyncExternalStoreWithSelector:MVt}=bnt,LVt=e=>e;function V8e(e,t=LVt,n){const i=MVt(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return DVt(i),i}const qae=(e,t)=>{const n=PVt(e),i=(r,s=t)=>V8e(n,r,s);return Object.assign(i,n),i},$Vt=(e,t)=>e?qae(e,t):qae;function Vs(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[i,r]of e)if(!Object.is(r,t.get(i)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const i of n)if(!Object.prototype.hasOwnProperty.call(t,i)||!Object.is(e[i],t[i]))return!1;return!0}const SL=p.createContext(null),FVt=SL.Provider,H8e=Sf.error001("react");function ir(e,t){const n=p.useContext(SL);if(n===null)throw new Error(H8e);return V8e(n,e,t)}function Hs(){const e=p.useContext(SL);if(e===null)throw new Error(H8e);return p.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Wae={display:"none"},BVt={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},q8e="react-flow__node-desc",W8e="react-flow__edge-desc",UVt="react-flow__aria-live",QVt=e=>e.ariaLiveMessage,zVt=e=>e.ariaLabelConfig;function VVt({rfId:e}){const t=ir(QVt);return a.jsx("div",{id:`${UVt}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:BVt,children:t})}function HVt({rfId:e,disableKeyboardA11y:t}){const n=ir(zVt);return a.jsxs(a.Fragment,{children:[a.jsx("div",{id:`${q8e}-${e}`,style:Wae,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),a.jsx("div",{id:`${W8e}-${e}`,style:Wae,children:n["edge.a11yDescription.default"]}),!t&&a.jsx(VVt,{rfId:e})]})}const EL=p.forwardRef(({position:e="top-left",children:t,className:n,style:i,...r},s)=>{const o=`${e}`.split("-");return a.jsx("div",{className:eo(["react-flow__panel",n,...o]),style:i,ref:s,...r,children:t})});EL.displayName="Panel";function qVt({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:a.jsx(EL,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:a.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const WVt=e=>{const t=[],n=[];for(const[,i]of e.nodeLookup)i.selected&&t.push(i.internals.userNode);for(const[,i]of e.edgeLookup)i.selected&&n.push(i);return{selectedNodes:t,selectedEdges:n}},bj=e=>e.id;function KVt(e,t){return Vs(e.selectedNodes.map(bj),t.selectedNodes.map(bj))&&Vs(e.selectedEdges.map(bj),t.selectedEdges.map(bj))}function GVt({onSelectionChange:e}){const t=Hs(),{selectedNodes:n,selectedEdges:i}=ir(WVt,KVt);return p.useEffect(()=>{const r={nodes:n,edges:i};e==null||e(r),t.getState().onSelectionChangeHandlers.forEach(s=>s(r))},[n,i,e]),null}const XVt=e=>!!e.onSelectionChangeHandlers;function YVt({onSelectionChange:e}){const t=ir(XVt);return e||t?a.jsx(GVt,{onSelectionChange:e}):null}const K8e=[0,0],ZVt={x:0,y:0,zoom:1},JVt=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],Kae=[...JVt,"rfId"],eHt=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),Gae={translateExtent:tA,nodeOrigin:K8e,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function tHt(e){const{setNodes:t,setEdges:n,setMinZoom:i,setMaxZoom:r,setTranslateExtent:s,setNodeExtent:o,reset:l,setDefaultNodesAndEdges:c}=ir(eHt,Vs),u=Hs();p.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{d.current=Gae,l()}),[]);const d=p.useRef(Gae);return p.useEffect(()=>{for(const f of Kae){const h=e[f],m=d.current[f];h!==m&&(typeof e[f]>"u"||(f==="nodes"?t(h):f==="edges"?n(h):f==="minZoom"?i(h):f==="maxZoom"?r(h):f==="translateExtent"?s(h):f==="nodeExtent"?o(h):f==="ariaLabelConfig"?u.setState({ariaLabelConfig:Hzt(h)}):f==="fitView"?u.setState({fitViewQueued:h}):f==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[f]:h})))}d.current=e},Kae.map(f=>e[f])),null}function Xae(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function nHt(e){var i;const[t,n]=p.useState(e==="system"?null:e);return p.useEffect(()=>{if(e!=="system"){n(e);return}const r=Xae(),s=()=>n(r!=null&&r.matches?"dark":"light");return s(),r==null||r.addEventListener("change",s),()=>{r==null||r.removeEventListener("change",s)}},[e]),t!==null?t:(i=Xae())!=null&&i.matches?"dark":"light"}const Yae=typeof document<"u"?document:null;function aA(e=null,t={target:Yae,actInsideInputWithModifier:!0}){const[n,i]=p.useState(!1),r=p.useRef(!1),s=p.useRef(new Set([])),[o,l]=p.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",` +`,4);return n>=0?t.slice(n+5).trimStart():e}function IFe(e,t){const n=(e||"").trim();return!n||[">",">-","|","|-"].includes(n)?t("common.noDescription"):n}function B9t(){return a.jsx("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:a.jsx("path",{d:"m7.5 7.5 9 9m0-9-9 9",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function U9t(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 5.5v13M5.5 12h13",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}function cae({direction:e}){return a.jsx("svg",{className:"icon",viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,children:a.jsx("path",{d:e==="left"?"m11.7 5.5-4.2 4.5 4.2 4.5":"m8.3 5.5 4.2 4.5-4.2 4.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function Q9t(){return a.jsx("span",{className:"skillcenter-loading-mark","aria-hidden":!0})}function z9t({page:e,total:t,pageSize:n,onPage:i}){const{t:r}=Te("ui"),s=Math.max(1,Math.ceil(t/n));return a.jsxs("footer",{className:"skillcenter-pager",children:[a.jsx("span",{children:r("skillCenter.totalItems",{count:t})}),a.jsxs("div",{className:"skillcenter-pager-actions",children:[a.jsx("button",{type:"button",onClick:()=>i(e-1),disabled:e<=1,"aria-label":r("common.previousPage"),children:a.jsx(cae,{direction:"left"})}),a.jsxs("span",{children:[e," / ",s]}),a.jsx("button",{type:"button",onClick:()=>i(e+1),disabled:e>=s,"aria-label":r("common.nextPage"),children:a.jsx(cae,{direction:"right"})})]})]})}function V9t({children:e}){return a.jsx("div",{className:"skillcenter-empty",children:e})}function q$({kind:e,title:t,description:n,error:i,action:r}){return a.jsx("div",{className:`skillcenter-page-state is-${e}`,role:e==="error"?"alert":"status",children:a.jsxs(Wn,{fill:"none",children:[a.jsx(Wn.Title,{children:t}),n?a.jsx(Wn.Description,{children:n}):null,i?a.jsx(Ns,{error:i}):null,r?a.jsx(Wn.ActionRow,{children:a.jsx(_t,{color:"secondary",size:"lg",onClick:r.onClick,children:r.label})}):null]})})}function uae({errors:e,cloudProvider:t,fullPage:n=!1,onRetry:i}){const{t:r}=Te("ui");return a.jsxs("div",{className:`skillcenter-space-errors${n?" is-full-page":""}`,role:"alert",children:[a.jsxs("div",{className:"skillcenter-space-errors__content",children:[a.jsx("strong",{children:r(n?"skillCenter.cannotLoadSpaces":"skillCenter.someSpacesFailed")}),e.map(({region:s,error:o})=>a.jsxs("section",{children:[a.jsx("span",{children:wh(s,t)}),a.jsx(Ns,{error:o})]},s))]}),a.jsx("button",{type:"button",onClick:i,children:r("common.reload")})]})}function H9t({skill:e,space:t,region:n,cloudProvider:i,detail:r,files:s,loading:o,error:l,canOptimize:c,reviews:u,reviewsLoading:d,reviewsError:f,onOptimize:h,onDownload:m,onClose:g}){const{t:b}=Te("ui"),[v,y]=p.useState("files");return p.useEffect(()=>{const w=x=>{x.key==="Escape"&&g()};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[g]),a.jsx("div",{className:"skill-detail-backdrop",role:"presentation",onMouseDown:g,children:a.jsxs("section",{className:"skill-detail-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-detail-title",onMouseDown:w=>w.stopPropagation(),children:[a.jsxs("header",{className:"skill-detail-head",children:[a.jsx("div",{className:"skill-detail-heading",children:a.jsxs("div",{children:[a.jsx("h2",{id:"skill-detail-title",children:(r==null?void 0:r.name)||e.skillName}),a.jsx("p",{children:IFe((r==null?void 0:r.description)||e.skillDescription,b)})]})}),a.jsxs("div",{className:"skill-detail-actions",children:[a.jsx("button",{type:"button",onClick:m,disabled:s.length===0,children:b("skillCenter.downloadZip")}),t.isShared?null:a.jsx(yP,{disabled:!c,placement:"bottom",children:a.jsx("button",{type:"button",onClick:h,disabled:!c,children:b("skillCenter.optimize")})}),a.jsx("button",{type:"button",className:"skill-detail-close",onClick:g,"aria-label":b("skillCenter.closeSkillDetails"),children:a.jsx(B9t,{})})]})]}),a.jsxs("dl",{className:"skill-detail-meta",children:[a.jsxs("div",{children:[a.jsx("dt",{children:b("skillCenter.skillId")}),a.jsx("dd",{title:e.skillId,children:e.skillId})]}),a.jsxs("div",{children:[a.jsx("dt",{children:b("agentSelector.version")}),a.jsx("dd",{children:e.sourceVersion||(r==null?void 0:r.version)||e.version||"—"})]}),e.author?a.jsxs("div",{children:[a.jsx("dt",{children:b("skillCenter.author")}),a.jsx("dd",{children:e.author})]}):null,a.jsxs("div",{children:[a.jsx("dt",{children:b("agentSelector.status")}),a.jsx("dd",{children:RFe(e.skillStatus,b)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:b("skillCenter.skillSpace")}),a.jsx("dd",{title:Pc(t),children:t.isShared?b("skillCenter.sharedSpace"):Pc(t)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:b("myAgents.region")}),a.jsx("dd",{children:wh(n,i)})]})]}),a.jsx(ab,{className:"skill-detail-tabs",idPrefix:"skill-detail",ariaLabel:b("skillCenter.skillDetailSections"),value:v,items:[{id:"files",label:b("skillCenter.allFiles"),panelId:"skill-detail-panel"},{id:"reviews",label:b("skillCenter.reviewHistory"),panelId:"skill-detail-panel"}],onChange:y}),a.jsx("div",{className:`skill-detail-content${v==="files"?" skill-detail-content--files":" skill-detail-content--reviews"}`,id:"skill-detail-panel",role:"tabpanel","aria-labelledby":`skill-detail-${v}-tab`,children:v==="reviews"?d?a.jsx(cl,{}):f?a.jsx("div",{role:"alert",children:a.jsx(Ns,{error:f})}):a.jsx(zW,{applications:u}):o?a.jsxs("div",{className:"skillcenter-loading",children:[a.jsx(Q9t,{}),b("skillCenter.loadingSkillContent")]}):l?a.jsx("div",{className:"skillcenter-error",children:a.jsx(Ns,{error:l})}):s.length>0?a.jsx(fL,{files:s.map(w=>w.path.endsWith("SKILL.md")&&w.content?{...w,content:F9t(w.content)}:w)}):a.jsx(V9t,{children:b("skillCenter.noSkillContent")})})]})})}function q9t({space:e,canUseSandbox:t,onUpload:n,onSandbox:i,onClose:r}){const{t:s}=Te("ui");return p.useEffect(()=>{const o=l=>{l.key==="Escape"&&r()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[r]),a.jsx("div",{className:"skill-dialog-backdrop",role:"presentation",onMouseDown:r,children:a.jsxs("section",{className:"skill-dialog skill-add-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-add-dialog-title",onMouseDown:o=>o.stopPropagation(),children:[a.jsxs("header",{children:[a.jsxs("div",{children:[a.jsx("h2",{id:"skill-add-dialog-title",children:s("skillCenter.addSkill")}),a.jsx("p",{title:Pc(e),children:Pc(e)})]}),a.jsx("button",{type:"button",onClick:r,children:s("common.cancel")})]}),a.jsxs("div",{className:"skill-add-dialog__options",children:[a.jsxs("button",{type:"button",onClick:n,children:[a.jsx("strong",{children:s("skillCenter.localUpload")}),a.jsx("span",{children:s("skillCenter.localUploadDescription")})]}),a.jsx(yP,{disabled:!t,placement:"inside",children:a.jsxs("button",{type:"button",disabled:!t,onClick:i,children:[a.jsx("strong",{children:s("skillCenter.autoCreate")}),a.jsx("span",{children:s("skillCenter.autoCreateDescription")})]})})]})]})})}function W9t({cloudProvider:e="volcengine",region:t,active:n=!0,activationRevision:i=0,initialWorkspace:r=null,onInitialWorkspaceConsumed:s,onPageTitleChange:o,toolbarLeading:l,toolbarFilters:c}){var zt;const{t:u,i18n:d}=Te("ui"),f=p.useMemo(()=>[t],[t]),[h,m]=p.useState([]),[g,b]=p.useState(null),[v,y]=p.useState([]),w=p.useMemo(()=>EFe(v),[v]),[x,O]=p.useState(null),[k,S]=p.useState(null),[C,E]=p.useState(!1),j=p.useRef(""),T=p.useRef(!1),[R,A]=p.useState({}),[N,P]=p.useState(!1),[I,D]=p.useState(""),[_,L]=p.useState((r==null?void 0:r.space)??null),F=p.useRef(_);F.current=_;const[M,V]=p.useState([]),[q,U]=p.useState(1),[J,z]=p.useState(0),[Z,ne]=p.useState(!1),[W,G]=p.useState(null),[H,se]=p.useState(!1),[Y,X]=p.useState(""),[ie,ee]=p.useState("overview"),[be,ue]=p.useState(null),[pe,ke]=p.useState(null),[je,Pe]=p.useState(null),[Ee,ze]=p.useState([]),[_e,ae]=p.useState(!1),[le,ge]=p.useState(null),[Oe,Se]=p.useState(null),[We,Ye]=p.useState(!1),[ye,we]=p.useState(null),[Ae,He]=p.useState(null),[Ue,jt]=p.useState(null),[Pt,Kt]=p.useState(0),[Ct,xt]=p.useState(0),[tt,mt]=p.useState(""),[Ne,Ot]=p.useState(""),[Nt,Yt]=p.useState(null),[xn,Ke]=p.useState(r),St=p.useRef(0),qe=p.useRef(0),nt=p.useRef(!1),et=p.useRef(null),ft=p.useRef(null),Et=p.useRef(null),At=p.useDeferredValue(I),It=p.useDeferredValue(Y),Gt=xn&&(_||xn.selectPublishSpace)?xn.operation==="create"?u("skillCenter.createSkill"):u("skillCenter.optimizeNamed",{name:((zt=xn.source)==null?void 0:zt.name)||u("skillCenter.skill")}):"",Xe=_!=null&&_.isShared?u("skillCenter.sharedSpace"):Pc(_),wt=!(_!=null&&_.isShared)||_.canWrite===!0,vt=Gt||Xe||u("skillCenter.library");p.useEffect(()=>{n&&(o==null||o(vt))},[n,o,vt]),p.useEffect(()=>{r&&(s==null||s())},[r,s]);const tn=p.useMemo(()=>{const Qe=At.trim().toLocaleLowerCase(),bt=h.filter(Ht=>!Ht.isShared);return Qe?bt.filter(Ht=>`${Pc(Ht)} ${Ht.name} ${Ht.description||""} ${Ht.projectName||""}`.toLocaleLowerCase().includes(Qe)):bt},[At,h]),Qt=p.useMemo(()=>{const Qe=It.trim().toLocaleLowerCase();return Qe?M.filter(bt=>`${bt.skillName} ${bt.skillDescription||""}`.toLocaleLowerCase().includes(Qe)):M},[It,M]),cn=(_==null?void 0:_.region)||Zi(e);p.useEffect(()=>{if(!n||!_)return;const Qe=()=>xt(Ht=>Ht+1),bt=()=>{document.visibilityState==="visible"&&Qe()};return window.addEventListener("focus",Qe),document.addEventListener("visibilitychange",bt),()=>{window.removeEventListener("focus",Qe),document.removeEventListener("visibilitychange",bt)}},[n,_==null?void 0:_.id]),p.useEffect(()=>{const Qe=_?`${cn}:${_.id}`:"";if(j.current!==Qe&&(j.current=Qe,y([]),O(null),ke(null)),S(null),E(!1),!n||!_||_.isShared)return;const bt=new AbortController;return E(!0),Dpt({spaceId:_.id,region:cn,signal:bt.signal}).then(Ht=>{bt.signal.aborted||y(Ht.items)}).catch(Ht=>{bt.signal.aborted||S(Pr(Ht,u("skillCenter.reviewStatusFailed")))}).finally(()=>{bt.signal.aborted||E(!1)}),()=>bt.abort()},[_==null?void 0:_.id,_==null?void 0:_.isShared,cn,Ct,n,i,u]);const Me=p.useMemo(()=>f.flatMap(Qe=>{var Ht;const bt=(Ht=R[Qe])==null?void 0:Ht.error;return bt?[{region:Qe,error:bt}]:[]}),[R,f]),on=f.some(Qe=>{const bt=R[Qe];return!!(bt&&!bt.done&&!bt.error)}),On=Me.length===f.length;p.useEffect(()=>{const Qe=new AbortController;return NM(Qe.signal).then(Se).catch(()=>Se({enabled:!1,reason:u("skillCenter.adminNotConfigured"),operations:["create","optimize"],models:[],styles:{}})),()=>Qe.abort()},[u]);const Sn=p.useCallback(async(Qe,bt)=>{var Dr;if(nt.current||Qe.length===0)return;nt.current=!0,P(!0),bt&&((Dr=et.current)==null||Dr.abort(),m([]),A(Object.fromEntries(Qe.map(({region:ti})=>[ti,{nextPage:1,loadedCount:0,done:!1,error:null}]))));const Ht=new AbortController;et.current=Ht;const _n=++qe.current,jr=await Promise.allSettled(Qe.map(async({region:ti,page:Si})=>({region:ti,page:Si,result:await Tpt({region:ti,page:Si,pageSize:P9t,signal:Ht.signal})})));if(qe.current!==_n)return;const Hs=jr.map((ti,Si)=>{const Zr=Qe[Si];return ti.status==="rejected"?{request:Zr,error:Pr(ti.reason,u("skillCenter.errors.loadSpaces")),items:[],totalCount:0,scannedCount:0}:{request:Zr,error:null,items:(ti.value.result.items||[]).map(Jr=>({...Jr,region:Jr.region||ti.value.region})),totalCount:ti.value.result.totalCount||0,scannedCount:ti.value.result.scannedCount??ti.value.result.items.length}}),qs=Hs.flatMap(ti=>ti.items);A(ti=>{const Si={...ti};return Hs.forEach(({request:Zr,error:Jr,scannedCount:ga,totalCount:go})=>{const us=Si[Zr.region]||{nextPage:Zr.page,loadedCount:0,done:!1,error:null};if(Jr){Si[Zr.region]={...us,error:Jr};return}const he=us.loadedCount+ga;Si[Zr.region]={nextPage:Zr.page+1,loadedCount:he,done:ga===0||he>=go,error:null}}),Si}),m(ti=>$9t(bt?[]:ti,qs)),L(ti=>ti&&(qs.find(Si=>cu(Si)===cu(ti))||ti)),nt.current=!1,P(!1)},[]),Qi=p.useCallback(()=>{if(nt.current)return;const Qe=f.flatMap(bt=>{const Ht=R[bt];return Ht&&!Ht.done&&!Ht.error?[{region:bt,page:Ht.nextPage}]:[]});Sn(Qe,!1)},[Sn,R,f]);p.useEffect(()=>{ei(),L(null),V([]),U(1)},[e]),p.useEffect(()=>{if(n)return Sn(f.map(Qe=>({region:Qe,page:1})),!0),()=>{var Qe;qe.current+=1,(Qe=et.current)==null||Qe.abort(),nt.current=!1}},[n,i,Sn,f,Pt]),p.useEffect(()=>{const Qe=Et.current,bt=ft.current;if(!Qe||!bt||!on||N)return;const Ht=new IntersectionObserver(([_n])=>{_n.isIntersecting&&Qi()},{root:bt,rootMargin:"240px 0px",threshold:.01});return Ht.observe(Qe),()=>Ht.disconnect()},[on,Qi,N]);const un=()=>{const Qe=ft.current;!Qe||!on||N||Qe.scrollHeight-Qe.scrollTop-Qe.clientHeight<=240&&Qi()};p.useEffect(()=>{if(!_){V([]),z(0),se(!1);return}let Qe=!0;return ne(!0),G(null),SIe(_.id,{region:cn,page:q,pageSize:oae,project:_.projectName}).then(bt=>{Qe&&(V(bt.items||[]),z(bt.totalCount||0),se(bt.degraded===!0))}).catch(bt=>{Qe&&(V([]),z(0),se(!1),G(Pr(bt,u("skillCenter.errors.loadSkills"))))}).finally(()=>{Qe&&ne(!1)}),()=>{Qe=!1}},[cn,_,q,Ct,u]);const lr=Qe=>{ei(),L(Qe),ee("overview"),U(1),X("")},Mn=()=>{ei(),L(null),V([]),z(0),se(!1),ee("overview"),U(1),X(""),Yt(null)},ei=()=>{St.current+=1,ue(null),Pe(null),ze([]),ge(null),ae(!1)},Bn=async Qe=>{if(!_)return;const bt=_y(Qe),Ht=St.current+1;St.current=Ht,ue(Qe),Pe(null),ge(null),ae(!0);try{const[_n,jr]=await Promise.all([Qpt(_.id,bt,Qe.version,cn,_.projectName,Qe.skillName,_.name),wIe({spaceId:_.id,skillId:bt,version:Qe.version,region:cn,skillSpaceName:_.name,skillName:Qe.skillName})]);St.current===Ht&&(Pe(_n),ze(jr))}catch(_n){St.current===Ht&&ge(Pr(_n,u("skillCenter.errors.loadSkillDetails")))}finally{St.current===Ht&&ae(!1)}},ki=Qe=>{if(_)return{kind:"skill-center",skillId:_y(Qe),version:Qe.version,region:cn,projectName:_.projectName,skillSpaceId:_.id,skillSpaceName:_.name,name:Qe.skillName,description:Qe.skillDescription}},zn=Qe=>{const bt=ki(Qe);!bt||!(Oe!=null&&Oe.enabled)||(ei(),Ke({operation:"optimize",source:bt}))},Rn=async Qe=>{if(!(!_||!window.confirm(u("skillCenter.deleteSkillConfirm",{name:Qe.skillName})))){mt(Qe.skillId),Yt(null);try{await Bpt({spaceId:_.id,skillId:Qe.skillId,region:cn}),xt(bt=>bt+1),Kt(bt=>bt+1)}catch(bt){Yt(Pr(bt,u("skillCenter.errors.deleteSkill")))}finally{mt("")}}},di=async Qe=>{if(!window.confirm(u("skillCenter.deleteSpaceConfirm",{name:Pc(Qe)})))return;const bt=cu(Qe);Ot(bt),Yt(null);try{await Lpt({spaceId:Qe.id,region:Qe.region||Zi(e)}),_&&cu(_)===bt&&Mn(),Kt(Ht=>Ht+1)}catch(Ht){Yt(Pr(Ht,u("skillCenter.errors.deleteSpace")))}finally{Ot("")}},rt=async(Qe,bt=Qe.version,Ht=!1)=>{var Hs,qs,Dr,ti;if(!_||T.current)return;const _n=_,jr=`${_n.region}:${_n.id}:${Qe.skillId}:${bt}`;T.current=!0,b(jr),Yt(null);try{const Si=await Npt({spaceId:_n.id,skillId:Qe.skillId,version:bt,region:_n.region||cn});((Hs=F.current)==null?void 0:Hs.id)===_n.id&&((qs=F.current)==null?void 0:qs.region)===_n.region&&y(Zr=>[...Zr.filter(Jr=>Jr.id!==Si.id),Si])}catch(Si){if(Ht)throw Pr(Si,u("skillCenter.reviewFailed"));((Dr=F.current)==null?void 0:Dr.id)===_n.id&&((ti=F.current)==null?void 0:ti.region)===_n.region&&Yt(Pr(Si,u("skillCenter.reviewFailed")))}finally{T.current=!1,b(null)}};return xn&&(_||xn.selectPublishSpace)?a.jsx(u9t,{operation:xn.operation,cloudProvider:e,space:_??void 0,availableSpaces:h.filter(Qe=>!Qe.isShared),spacesLoading:N,initialIntent:xn.initialIntent,source:xn.source,onBack:()=>Ke(null),onPublished:()=>{xt(Qe=>Qe+1),Kt(Qe=>Qe+1)}}):a.jsxs("section",{className:`skillcenter${_?" is-space":" resource-collection"}`,children:[_?a.jsx(oT,{className:"skillcenter-detail",title:Xe||_.name,description:_.isShared?u("skillCenter.sharedDescription"):_.description||u("skillCenter.manageSpaceDescription"),identitySeed:_.name,backLabel:u("skillCenter.backToSpaces"),onBack:Mn,sections:[{key:"overview",label:u("skillCenter.overview"),content:a.jsxs(a.Fragment,{children:[Nt?a.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:a.jsx(Ns,{error:Nt})}):null,k?a.jsxs("div",{className:"skillcenter-inline-error",role:"alert",children:[a.jsx(Ns,{error:k}),a.jsx("button",{type:"button",onClick:()=>xt(Qe=>Qe+1),children:u("common.reload")})]}):null,a.jsx("section",{className:"skillcenter-overview",children:a.jsxs(bH,{className:"skillcenter-detail-facts",children:[a.jsxs("div",{children:[a.jsx("dt",{children:u("skillCenter.skillCount")}),a.jsx("dd",{children:J})]}),a.jsxs("div",{children:[a.jsx("dt",{children:u("skillCenter.updatedAt")}),a.jsx("dd",{children:_.updatedAt?L9t(_.updatedAt,d.resolvedLanguage??d.language):"—"})]})]})})]})},{key:"skills",label:u("skillCenter.skills"),content:a.jsxs(a.Fragment,{children:[Nt?a.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:a.jsx(Ns,{error:Nt})}):null,k?a.jsxs("div",{className:"skillcenter-inline-error",role:"alert",children:[a.jsx(Ns,{error:k}),a.jsx("button",{type:"button",onClick:()=>xt(Qe=>Qe+1),children:u("common.reload")})]}):null,a.jsxs("section",{className:"skillcenter-results","aria-label":u("skillCenter.skillsInSpace",{name:Xe||_.name}),children:[a.jsx(XIe,{title:u("skillCenter.skills"),description:u("skillCenter.totalItems",{count:J}),actions:a.jsxs(a.Fragment,{children:[a.jsx(Zp,{"aria-label":u("skillCenter.searchSkills"),value:Y,onChange:Qe=>X(Qe.target.value),placeholder:u("skillCenter.searchSkills")}),a.jsx(_t,{color:"secondary",variant:"outline",size:"sm",pill:!1,disabled:Z||C,onClick:()=>xt(Qe=>Qe+1),children:u("common.refresh")})]})}),H?a.jsx("div",{className:"skillcenter-inline-warning",role:"status",children:u("skillCenter.degradedRelationWarning")}):null,Z&&M.length===0?a.jsx(cl,{}):W&&M.length===0?a.jsx(q$,{kind:"error",title:u("skillCenter.cannotLoadSkills"),error:W,action:{label:u("common.reload"),onClick:()=>xt(Qe=>Qe+1)}}):Qt.length===0?a.jsx(q$,{kind:"empty",title:Y.trim()?u("skillCenter.noMatchingSkills"):u("skillCenter.noSkills"),description:Y.trim()?u("skillCenter.tryAnotherName"):u(_.isShared?"skillCenter.sharedEmpty":"skillCenter.emptySkillsDescription"),action:!Y.trim()&&wt?{label:u("skillCenter.localUpload"),onClick:()=>jt(_)}:void 0}):a.jsx("div",{className:"skillcenter-table-wrap",children:a.jsxs("table",{className:"skillcenter-table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:u("skillCenter.skills")}),a.jsx("th",{scope:"col",children:u("agentSelector.status")}),a.jsx("th",{scope:"col",className:"skillcenter-table__actions-heading",children:u("skillCenter.actions")})]})}),a.jsx("tbody",{children:Qt.map(Qe=>{const bt=w.get(`${Qe.skillId}:${Qe.version}`);return a.jsxs("tr",{children:[a.jsx("td",{className:"skillcenter-table__skill",children:a.jsxs("button",{type:"button",onClick:()=>void Bn(Qe),children:[a.jsxs("span",{className:"skillcenter-table__title-row",children:[a.jsx("strong",{title:Qe.skillName,children:Qe.skillName}),Qe.version?a.jsx("span",{className:"skillcenter-table__version-badge",children:Qe.sourceVersion||Qe.version}):null]}),a.jsx("span",{className:"skillcenter-table__description",children:IFe(Qe.skillDescription,u)}),_.isShared&&Qe.author?a.jsx("span",{className:"skillcenter-table__author",children:u("skillCenter.authorName",{name:Qe.author})}):null]})}),a.jsx("td",{children:a.jsxs("div",{className:"skillcenter-review-status",children:[a.jsx("span",{className:`skillcenter-status ${M9t(Qe.skillStatus)}`,children:RFe(Qe.skillStatus,u)}),bt?a.jsx($T,{status:bt.status}):null,bt!=null&&bt.reviewer||bt!=null&&bt.reviewedBy?a.jsx(UW,{compact:!0,person:bt.reviewer,fallback:bt.reviewedBy}):null]})}),a.jsx("td",{children:a.jsxs("div",{className:"skillcenter-table__actions",children:[a.jsx("button",{type:"button",onClick:()=>void Bn(Qe),children:u("common.view")}),!Qe.lookupByName&&Qe.skillId?a.jsx("button",{type:"button",onClick:()=>ke(Qe),children:u("skillCenter.versions.title")}):null,!_.isShared&&!Qe.lookupByName&&Qe.skillId?a.jsx("button",{type:"button",disabled:C||k!==null||g!==null||bt!==void 0&&bt.status!=="returned",onClick:()=>void rt(Qe),children:g===`${_.region}:${_.id}:${Qe.skillId}:${Qe.version}`?u("skillCenter.reviewSubmitting"):u(bt?{pending:"skillCenter.reviewPending",approving:"skillCenter.reviewApproving",approved:"skillCenter.reviewApproved",returned:"skillCenter.reviewRetry"}[bt.status]:"skillCenter.requestPublication")}):null,v.some(Ht=>Ht.sourceSkillId===Qe.skillId)?a.jsx("button",{type:"button",onClick:()=>O(Qe),children:u("skillCenter.reviewHistory")}):null,_.isShared?null:a.jsx(yP,{disabled:!(Oe!=null&&Oe.enabled),children:a.jsx("button",{type:"button",disabled:!(Oe!=null&&Oe.enabled),onClick:()=>zn(Qe),children:u("skillCenter.optimize")})}),!Qe.lookupByName&&wt?a.jsx("button",{type:"button",className:"is-danger",disabled:tt===Qe.skillId,onClick:()=>void Rn(Qe),children:tt===Qe.skillId?u("common.deleting"):u("common.delete")}):null]})})]},`${_y(Qe)}:${Qe.version}`)})})]})}),!Y.trim()&&!Z&&!W&&J>0?a.jsx(z9t,{page:q,total:J,pageSize:oae,onPage:U}):null]})]})}],activeSectionKey:ie,navigationLabel:u("skillCenter.spaceDetails"),onSectionChange:Qe=>ee(Qe),actionsClassName:"skillcenter-toolbar-actions",actions:a.jsxs(a.Fragment,{children:[_.isShared?null:a.jsxs(a.Fragment,{children:[a.jsx(_t,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:()=>we(_),children:u("skillCenter.editSpace")}),a.jsx(_t,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,disabled:Ne===cu(_),onClick:()=>void di(_),children:Ne===cu(_)?u("common.deleting"):u("skillCenter.deleteSpace")})]}),wt?a.jsx(_t,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:()=>jt(_),children:u("skillCenter.localUpload")}):null,_.isShared?null:a.jsx(yP,{disabled:!(Oe!=null&&Oe.enabled),children:a.jsxs(_t,{type:"button",color:"primary",size:"lg",pill:!1,disabled:!(Oe!=null&&Oe.enabled),onClick:()=>Ke({operation:"create"}),children:[a.jsx(Rje,{"aria-hidden":"true"}),a.jsx("span",{children:u("skillCenter.createSkill")})]})})]})}):a.jsxs(a.Fragment,{children:[a.jsxs(sb,{className:"skillcenter-list-toolbar library-resource-toolbar",children:[l,a.jsxs("div",{className:"resource-toolbar__actions",children:[c,a.jsx(Zp,{"aria-label":u("skillCenter.searchSpaces"),value:I,onChange:Qe=>D(Qe.target.value),placeholder:u("skillCenter.searchSpaces")})]})]}),Nt?a.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:a.jsx(Ns,{error:Nt})}):null,a.jsxs(Jp,{className:"skillcenter-list-results",ref:ft,"aria-label":u("skillCenter.spaceList"),onScroll:un,children:[Me.length>0&&!On?a.jsx(uae,{errors:Me,cloudProvider:e,onRetry:()=>Kt(Qe=>Qe+1)}):null,a.jsxs(W0,{children:[a.jsx(_9t,{region:t,active:n,revision:Pt+i,onOpen:lr},`${e}:${t}`),I.trim()?null:a.jsx(lb,{"aria-label":u("skillCenter.createSpace"),icon:a.jsx(U9t,{}),onClick:()=>Ye(!0),children:u("skillCenter.newSpace")}),tn.map(Qe=>{const bt=cu(Qe);return a.jsx(G0,{className:"skillcenter-space-card",title:Pc(Qe),description:Qe.description||u("common.noDescription"),metadata:[{label:u("skillCenter.skillCount"),value:u("skillCenter.skillCountValue",{count:Qe.skillCount??0})},{label:u("skillCenter.updatedAt"),value:FT(Qe.updatedAt,Date.now(),d.resolvedLanguage??d.language)}],action:{label:u("skillCenter.addSkill"),icon:"plus",onClick:()=>He(Qe)},detailAction:{label:u("common.viewDetails"),onClick:()=>lr(Qe)}},bt)})]}),N&&h.length===0?a.jsx(cl,{}):On&&h.length===0?a.jsx(uae,{errors:Me,cloudProvider:e,fullPage:!0,onRetry:()=>Kt(Qe=>Qe+1)}):tn.length===0&&I.trim()?a.jsx(q$,{kind:"empty",title:u("skillCenter.noMatchingSpaces"),description:u("skillCenter.tryAnotherName")}):null,!On&&h.length>0?a.jsx("div",{className:"my-agent-load-more",ref:Et,"aria-live":"polite",children:N?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),a.jsx("span",{children:u("skillCenter.loadingMoreSpaces")})]}):on?a.jsx("span",{children:u("skillCenter.scrollForMore")}):Me.length>0?a.jsx("span",{children:u("skillCenter.someSpacesFailed")}):a.jsx("span",{children:u("skillCenter.allSpacesLoaded")})}):null]})]}),pe&&_?a.jsx(T9t,{skill:pe,space:_,region:cn,reviews:v.filter(Qe=>Qe.sourceSkillId===pe.skillId),onClose:()=>ke(null),onChanged:()=>xt(Qe=>Qe+1),onSubmitReview:!_.isShared&&!C&&!k?Qe=>rt(pe,Qe,!0):void 0},`${cn}:${_.id}:${pe.skillId}`):null,x?a.jsx(A9t,{name:x.skillName,applications:v.filter(Qe=>Qe.sourceSkillId===x.skillId),onClose:()=>O(null)}):null,be&&_&&a.jsx(H9t,{skill:be,space:_,region:cn,cloudProvider:e,detail:je,files:Ee,loading:_e,error:le,reviews:v.filter(Qe=>Qe.sourceSkillId===be.skillId),reviewsLoading:C,reviewsError:k,canOptimize:!_.isShared&&(Oe==null?void 0:Oe.enabled)===!0,onOptimize:()=>zn(be),onDownload:()=>void Upt({spaceId:_.id,skillId:_y(be),version:be.version,region:cn,fallbackName:be.skillName,skillSpaceName:_.name,skillName:be.skillName}).catch(Qe=>ge(Pr(Qe,u("skillCenter.errors.downloadSkill")))),onClose:ei}),We?a.jsx(j9t,{region:t,regionOptions:_u(e),onClose:()=>Ye(!1),onCreated:Qe=>{Ye(!1),Kt(bt=>bt+1),L({...Qe,region:Qe.region||t})}}):null,ye?a.jsx(N9t,{space:ye,region:ye.region||Zi(e),onClose:()=>we(null),onUpdated:Qe=>{const bt={...Qe,region:Qe.region||ye.region||Zi(e)};we(null),L(Ht=>Ht&&cu(Ht)===cu(bt)?bt:Ht),m(Ht=>Ht.map(_n=>cu(_n)===cu(bt)?bt:_n)),Kt(Ht=>Ht+1)}}):null,Ae?a.jsx(q9t,{space:Ae,canUseSandbox:(Oe==null?void 0:Oe.enabled)===!0,onClose:()=>He(null),onUpload:()=>{jt(Ae),He(null)},onSandbox:()=>{const Qe=Ae;He(null),lr(Qe),Ke({operation:"create"})}}):null,Ue?a.jsx(R9t,{space:Ue,region:Ue.region||Zi(e),onClose:()=>jt(null),onUploaded:()=>{jt(null),xt(Qe=>Qe+1),Kt(Qe=>Qe+1)}}):null]})}function K9t(e){return[{id:"skills",label:e("library.tabs.skills"),panelId:"library-skills-panel"},{id:"knowledge",label:e("library.tabs.knowledge"),panelId:"library-knowledge-panel"},{id:"artifacts",label:e("library.tabs.artifacts"),panelId:"library-artifacts-panel"}]}function G9t({cloudProvider:e,studioRegion:t="",activeTab:n,onTabChange:i,onPageTitleChange:r,skillInitialWorkspace:s=null,onSkillInitialWorkspaceConsumed:o,artifactSources:l=[],artifactUserId:c="",onArtifactActivate:u,onArtifactSourceOpen:d}){const{t:f,i18n:h}=Te("workspaceTools"),m=p.useMemo(()=>K9t(f),[f]),g=f("library.tabs.skills"),b=AD(t)?t:Zi(e),[v,y]=p.useState(b),[w,x]=p.useState(g),O=p.useRef(g),[k,S]=p.useState(!1),[C,E]=p.useState(()=>new Set(["skills",n])),[j,T]=p.useState({skills:0,knowledge:0,artifacts:0}),R=p.useRef(u),[A,N]=p.useState([]),[P,I]=p.useState(!1),[D,_]=p.useState(""),L=p.useMemo(()=>{const ne=abt(l,f("library.untitledSession"));return{key:JSON.stringify(ne),candidates:ne}},[l,f]),F=p.useRef(L);F.current.key!==L.key&&(F.current=L);const M=F.current.candidates,V=p.useMemo(()=>_u(e),[e]);p.useEffect(()=>{y(b)},[b]),p.useEffect(()=>{const ne=O.current;x(W=>W===ne?g:W),O.current=g},[g]),p.useEffect(()=>{R.current=u},[u]),p.useEffect(()=>{E(ne=>{if(ne.has(n))return ne;const W=new Set(ne);return W.add(n),W})},[n]),p.useEffect(()=>{var W;const ne=n==="skills"?w:((W=m.find(G=>G.id===n))==null?void 0:W.label)||f("library.title");r==null||r(ne)},[n,r,w,f,m]),p.useEffect(()=>{var ne;n==="artifacts"&&((ne=R.current)==null||ne.call(R))},[n,j.artifacts]);const q=p.useCallback(async()=>{I(!0),_("");try{N(await mbt(M))}catch(ne){_(ne instanceof Error?ne.message:String(ne))}finally{I(!1)}},[M]);p.useEffect(()=>{n==="artifacts"&&q()},[n,j.artifacts,q]);const U=ne=>{E(W=>{if(W.has(ne))return W;const G=new Set(W);return G.add(ne),G}),T(W=>({...W,[ne]:W[ne]+1})),i(ne)},J=a.jsx(ab,{idPrefix:"library",ariaLabel:f("library.categoryAria"),value:n,items:m,onChange:U}),z=ne=>a.jsx(ob,{id:ne,ariaLabel:f("library.regionAria"),value:v,options:V,onChange:y}),Z=n==="skills"?w!==g:n==="knowledge"&&k;return a.jsxs(kh,{className:`library-view${Z?" is-detail":""}`,"aria-label":f("library.title"),children:[Z?null:a.jsx(q0,{className:"library-view__header",title:f("library.title")}),a.jsxs("div",{className:"library-panels",children:[C.has("skills")?a.jsx("div",{id:"library-skills-panel",className:"library-panel",role:"tabpanel","aria-labelledby":"library-skills-tab",hidden:n!=="skills",children:a.jsx(W9t,{cloudProvider:e,region:v,active:n==="skills",activationRevision:j.skills,onPageTitleChange:x,initialWorkspace:s,onInitialWorkspaceConsumed:o,toolbarLeading:J,toolbarFilters:z("library-skills-region-filter")})}):null,C.has("knowledge")?a.jsx("div",{id:"library-knowledge-panel",className:"library-panel",role:"tabpanel","aria-labelledby":"library-knowledge-tab",hidden:n!=="knowledge",children:a.jsx(l2t,{cloudProvider:e,region:v,active:n==="knowledge",activationRevision:j.knowledge,onDetailChange:S,toolbarLeading:J,toolbarFilters:z("library-knowledge-region-filter")})}):null,C.has("artifacts")?a.jsx("div",{id:"library-artifacts-panel",className:"library-panel",role:"tabpanel","aria-labelledby":"library-artifacts-tab",hidden:n!=="artifacts",children:a.jsx(fbt,{items:A,region:v,userId:c,active:n==="artifacts",activationRevision:j.artifacts,loading:P,error:D?So(D,h.resolvedLanguage||h.language)||f("artifactLibrary.loadDetailFallback"):"",onRetry:()=>void q(),onEdit:gbt,onDelete:bbt,onDownload:ybt,onOpenSource:d?ne=>d(ne.appName,ne.sessionId):void 0,toolbarLeading:J,toolbarFilters:z("library-artifacts-region-filter")})}):null]})]})}const PFe="veadk_agentkit_connections",X9t=3e3,dae=6e4;function sf(){try{const e=localStorage.getItem(PFe);return(e?JSON.parse(e):[]).filter(n=>!n.runtimeId||!!n.region)}catch{return[]}}function pL(e){try{localStorage.setItem(PFe,JSON.stringify(e))}catch{}}function gf(e,t){return`agentkit:${e}:${t}`}function DFe(e){try{return new URL(e).host}catch{return e}}function vO(e){WAe();for(const t of e)if(!(t.runtimeId&&!t.region))for(const n of t.apps)qAe(gf(t.id,n),t.runtimeId?{app:n,runtimeId:t.runtimeId,mpaInstanceId:t.mpaInstanceId,region:t.region,agentCategory:t.agentCategory}:{app:n,base:t.base,apiKey:t.apiKey})}function MFe(e,t,n,i,r,s,o,l){const c=sf(),u=c.findIndex(h=>h.runtimeId===e),d=u===-1?void 0:c[u],f={id:`rt_${e}`,name:t||e,runtimeId:e,region:n,apps:i,appLabels:r,currentVersion:s,agentCategory:o??(d==null?void 0:d.agentCategory),mpaInstanceId:(l==null?void 0:l.trim())||(d==null?void 0:d.mpaInstanceId)};return u===-1?c.push(f):c[u]=f,pL(c),vO(c),f}async function Y9t(e,t,n,i,r,s,o){let l=null,c=n||"cn-beijing",u=null;for(const m of LA(n))try{const g=await Ww(e,m,{retryProbe:!0,preferCached:!0,currentVersion:i});if(g&&g.length>0){await w2e(e,m),l=g,c=m;break}}catch(g){if(g instanceof U1)throw vP(e),g;if(g instanceof Oa&&g.unsupported){u=g;continue}throw g}if(!l||l.length===0)throw vP(e),u||new Oa(Q("connections.runtimeUnsupported"),!0,!0);const d=(r==null?void 0:r.trim())||l[0],f=Object.fromEntries(l.map(m=>[m,m===l[0]?d:m])),h=MFe(e,t,c,l,f,i,s,o);return gf(h.id,l[0])}function Z9t(e){return new Promise(t=>window.setTimeout(t,e))}async function XN(e,t,n,i,r={}){const s=Date.now();for(;;)try{return await Y9t(e,t,n,i,r.agentName,r.agentCategory,r.mpaInstanceId)}catch(o){const l=Date.now()-s;if(!r.waitForReady||!(o instanceof Oa)||!o.retryable||l>=dae)throw o;const c=Math.min(X9t,dae-l);await Z9t(c)}}async function LFe(e,t,n,i){const r=t.trim().replace(/\/+$/,""),s=await $A(r,n.trim()),o={id:Date.now().toString(36),name:e.trim()||DFe(r),base:r,apiKey:n.trim(),apps:s,appLabels:i&&s.length>0?{[s[0]]:i}:void 0},l=[...sf().filter(c=>c.base!==r),o];return pL(l),vO(l),o}function J9t(e){const t=sf().filter(n=>n.id!==e);return pL(t),vO(t),t}function vP(e){const t=sf().filter(n=>n.runtimeId!==e);return pL(t),vO(t),t}function $Fe(e,t){const n=e.map(r=>({id:r,label:r,app:r,remote:!1})),i=t.flatMap(r=>r.apps.map(s=>{var l;const o=((l=r.appLabels)==null?void 0:l[s])??s;return{id:gf(r.id,s),label:o,app:s,remote:!0,host:r.runtimeId?r.name:DFe(r.base??""),runtimeId:r.runtimeId,region:r.region,currentVersion:r.currentVersion,agentCategory:r.agentCategory,mpaInstanceId:r.mpaInstanceId}}));return[...n,...i]}const fae=Object.freeze(Object.defineProperty({__proto__:null,addConnection:LFe,addRuntimeConnection:MFe,buildAgentEntries:$Fe,connectRuntime:XN,loadConnections:sf,registerConnections:vO,remoteAppId:gf,removeConnection:J9t,removeRuntimeConnection:vP},Symbol.toStringTag,{value:"Module"}));function e7t({onAdded:e,onCancel:t}){const{t:n}=Te("conversation"),[i,r]=p.useState(""),[s,o]=p.useState(""),[l,c]=p.useState(""),[u,d]=p.useState(!1),[f,h]=p.useState(""),m=i.trim().length>0&&s.trim().length>0&&!u;async function g(){if(m){d(!0),h("");try{const b=await LFe(l,i,s,l);if(b.apps.length===0){h(n("addAgentKit.noAgents")),d(!1);return}e(gf(b.id,b.apps[0]))}catch(b){h(n("addAgentKit.connectionFailed",{error:String(b)})),d(!1)}}}return a.jsx("div",{className:"addagent",children:a.jsxs("div",{className:"addagent-card",children:[a.jsx("h2",{className:"addagent-title",children:n("addAgentKit.title")}),a.jsx("p",{className:"addagent-sub",children:n("addAgentKit.description")}),a.jsxs("label",{className:"addagent-field",children:[a.jsx("span",{className:"addagent-label",children:n("addAgentKit.url")}),a.jsx("input",{className:"addagent-input",value:i,onChange:b=>r(b.target.value),placeholder:"https://xxxxx.apigateway-cn-beijing.volceapi.com",autoFocus:!0})]}),a.jsxs("label",{className:"addagent-field",children:[a.jsx("span",{className:"addagent-label",children:"API Key"}),a.jsx("input",{className:"addagent-input",type:"password",value:s,onChange:b=>o(b.target.value),placeholder:n("addAgentKit.apiKeyHint")})]}),a.jsxs("label",{className:"addagent-field",children:[a.jsx("span",{className:"addagent-label",children:n("addAgentKit.displayName")}),a.jsx("input",{className:"addagent-input",value:l,onChange:b=>c(b.target.value),placeholder:n("addAgentKit.displayNameHint")})]}),f&&a.jsx("div",{className:"addagent-error",children:f}),a.jsxs("div",{className:"addagent-actions",children:[a.jsx("button",{className:"addagent-btn addagent-btn--ghost",onClick:t,disabled:u,children:n("addAgentKit.cancel")}),a.jsxs("button",{className:"addagent-btn addagent-btn--primary",onClick:g,disabled:!m,children:[u?a.jsx(Fi,{className:"icon spin"}):null,n(u?"addAgentKit.connecting":"addAgentKit.connect")]})]})]})})}const t7t=/[\u3400-\u4dbf\u4e00-\u9fff\uf900-\ufaff]/u,n7t={"deploy.build.logs_syncing":"client.deploymentProgress.buildLogsSyncing","deploy.build.logs_complete":"client.deploymentProgress.buildLogsComplete","deploy.build.failed_logs_synced":"client.deploymentProgress.buildFailedLogsSynced","deploy.build.logs_unavailable":"client.deploymentProgress.buildLogsUnavailable","deploy.build.final_logs_unavailable":"client.deploymentProgress.finalBuildLogsUnavailable"},i7t={prepare:"client.deploymentProgress.preparing",upload:"client.deploymentProgress.uploading",build:"client.deploymentProgress.building",deploy:"client.deploymentProgress.deploying",publish:"client.deploymentProgress.publishing",evaluation:"client.deploymentProgress.evaluating",update:"client.deploymentProgress.updating",profile_applying:"client.deploymentProgress.applyingMpaProfile",smoke_running:"client.deploymentProgress.runningMpaSmoke",runnable:"client.deploymentProgress.mpaReady",complete:"client.deploymentProgress.completing",github:"client.deploymentProgress.github"};function mL(e){var r,s;const t=((r=e.message)==null?void 0:r.trim())??"",n=e.messageCode?n7t[e.messageCode]:void 0;if(n)return Q(n);if(t&&(j8().toLowerCase()==="zh-cn"||!t7t.test(t)))return t;if(e.phase==="build"&&((s=e.buildLog)!=null&&s.status)){const o={running:"client.deploymentProgress.buildLogsSyncing",complete:"client.deploymentProgress.buildLogsComplete",error:"client.deploymentProgress.buildLogsUnavailable"}[e.buildLog.status];if(o)return Q(o)}const i=e.phase?i7t[e.phase]:void 0;return i?Q(i):t||Q("client.deploymentProgress.inProgress")}function eo(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,i;n{}};function gL(){for(var e=0,t=arguments.length,n={},i;e=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}YN.prototype=gL.prototype={constructor:YN,on:function(e,t){var n=this._,i=s7t(e+"",n),r,s=-1,o=i.length;if(arguments.length<2){for(;++s0)for(var n=new Array(r),i=0,r,s;i=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),pae.hasOwnProperty(t)?{space:pae[t],local:e}:e}function o7t(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===A7&&t.documentElement.namespaceURI===A7?t.createElement(e):t.createElementNS(n,e)}}function l7t(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function FFe(e){var t=bL(e);return(t.local?l7t:o7t)(t)}function c7t(){}function HW(e){return e==null?c7t:function(){return this.querySelector(e)}}function u7t(e){typeof e!="function"&&(e=HW(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r=x&&(x=w+1);!(k=v[x])&&++x=0;)(o=i[r])&&(s&&o.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(o,s),s=o);return this}function D7t(e){e||(e=M7t);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var n=this._groups,i=n.length,r=new Array(i),s=0;st?1:e>=t?0:NaN}function L7t(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function $7t(){return Array.from(this)}function F7t(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?X7t:typeof t=="function"?Z7t:Y7t)(e,t,n??"")):x1(this.node(),e)}function x1(e,t){return e.style.getPropertyValue(t)||VFe(e).getComputedStyle(e,null).getPropertyValue(t)}function eUt(e){return function(){delete this[e]}}function tUt(e,t){return function(){this[e]=t}}function nUt(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function iUt(e,t){return arguments.length>1?this.each((t==null?eUt:typeof t=="function"?nUt:tUt)(e,t)):this.node()[e]}function HFe(e){return e.trim().split(/^|\s+/)}function qW(e){return e.classList||new qFe(e)}function qFe(e){this._node=e,this._names=HFe(e.getAttribute("class")||"")}qFe.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function WFe(e,t){for(var n=qW(e),i=-1,r=t.length;++i=0&&(n=t.slice(i+1),t=t.slice(0,i)),{type:t,name:n}})}function NUt(e){return function(){var t=this.__on;if(t){for(var n=0,i=-1,r=t.length,s;n()=>e;function T7(e,{sourceEvent:t,subject:n,target:i,identifier:r,active:s,x:o,y:l,dx:c,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}T7.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function UUt(e){return!e.ctrlKey&&!e.button}function QUt(){return this.parentNode}function zUt(e,t){return t??{x:e.x,y:e.y}}function VUt(){return navigator.maxTouchPoints||"ontouchstart"in this}function JFe(){var e=UUt,t=QUt,n=zUt,i=VUt,r={},s=gL("start","drag","end"),o=0,l,c,u,d,f=0;function h(O){O.on("mousedown.drag",m).filter(i).on("touchstart.drag",v).on("touchmove.drag",y,BUt).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(O,k){if(!(d||!e.call(this,O,k))){var S=x(this,t.call(this,O,k),O,k,"mouse");S&&(vu(O.view).on("mousemove.drag",g,nA).on("mouseup.drag",b,nA),YFe(O.view),W$(O),u=!1,l=O.clientX,c=O.clientY,S("start",O))}}function g(O){if(Ew(O),!u){var k=O.clientX-l,S=O.clientY-c;u=k*k+S*S>f}r.mouse("drag",O)}function b(O){vu(O.view).on("mousemove.drag mouseup.drag",null),ZFe(O.view,u),Ew(O),r.mouse("end",O)}function v(O,k){if(e.call(this,O,k)){var S=O.changedTouches,C=t.call(this,O,k),E=S.length,j,T;for(j=0;j>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?fj(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?fj(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=qUt.exec(e))?new Lc(t[1],t[2],t[3],1):(t=WUt.exec(e))?new Lc(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=KUt.exec(e))?fj(t[1],t[2],t[3],t[4]):(t=GUt.exec(e))?fj(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=XUt.exec(e))?wae(t[1],t[2]/100,t[3]/100,1):(t=YUt.exec(e))?wae(t[1],t[2]/100,t[3]/100,t[4]):mae.hasOwnProperty(e)?yae(mae[e]):e==="transparent"?new Lc(NaN,NaN,NaN,0):null}function yae(e){return new Lc(e>>16&255,e>>8&255,e&255,1)}function fj(e,t,n,i){return i<=0&&(e=t=n=NaN),new Lc(e,t,n,i)}function eQt(e){return e instanceof UT||(e=A0(e)),e?(e=e.rgb(),new Lc(e.r,e.g,e.b,e.opacity)):new Lc}function _7(e,t,n,i){return arguments.length===1?eQt(e):new Lc(e,t,n,i??1)}function Lc(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}WW(Lc,_7,e8e(UT,{brighter(e){return e=e==null?wP:Math.pow(wP,e),new Lc(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?iA:Math.pow(iA,e),new Lc(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Lc(e0(this.r),e0(this.g),e0(this.b),OP(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:vae,formatHex:vae,formatHex8:tQt,formatRgb:xae,toString:xae}));function vae(){return`#${Ly(this.r)}${Ly(this.g)}${Ly(this.b)}`}function tQt(){return`#${Ly(this.r)}${Ly(this.g)}${Ly(this.b)}${Ly((isNaN(this.opacity)?1:this.opacity)*255)}`}function xae(){const e=OP(this.opacity);return`${e===1?"rgb(":"rgba("}${e0(this.r)}, ${e0(this.g)}, ${e0(this.b)}${e===1?")":`, ${e})`}`}function OP(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function e0(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ly(e){return e=e0(e),(e<16?"0":"")+e.toString(16)}function wae(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new lf(e,t,n,i)}function t8e(e){if(e instanceof lf)return new lf(e.h,e.s,e.l,e.opacity);if(e instanceof UT||(e=A0(e)),!e)return new lf;if(e instanceof lf)return e;e=e.rgb();var t=e.r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),s=Math.max(t,n,i),o=NaN,l=s-r,c=(s+r)/2;return l?(t===s?o=(n-i)/l+(n0&&c<1?0:o,new lf(o,l,c,e.opacity)}function nQt(e,t,n,i){return arguments.length===1?t8e(e):new lf(e,t,n,i??1)}function lf(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}WW(lf,nQt,e8e(UT,{brighter(e){return e=e==null?wP:Math.pow(wP,e),new lf(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?iA:Math.pow(iA,e),new lf(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new Lc(K$(e>=240?e-240:e+120,r,i),K$(e,r,i),K$(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new lf(Oae(this.h),hj(this.s),hj(this.l),OP(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=OP(this.opacity);return`${e===1?"hsl(":"hsla("}${Oae(this.h)}, ${hj(this.s)*100}%, ${hj(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Oae(e){return e=(e||0)%360,e<0?e+360:e}function hj(e){return Math.max(0,Math.min(1,e||0))}function K$(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const yL=e=>()=>e;function n8e(e,t){return function(n){return e+n*t}}function iQt(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}function Hhn(e,t){var n=t-e;return n?n8e(e,n>180||n<-180?n-360*Math.round(n/360):n):yL(isNaN(e)?t:e)}function rQt(e){return(e=+e)==1?i8e:function(t,n){return n-t?iQt(t,n,e):yL(isNaN(t)?n:t)}}function i8e(e,t){var n=t-e;return n?n8e(e,n):yL(isNaN(e)?t:e)}const kP=function e(t){var n=rQt(t);function i(r,s){var o=n((r=_7(r)).r,(s=_7(s)).r),l=n(r.g,s.g),c=n(r.b,s.b),u=i8e(r.opacity,s.opacity);return function(d){return r.r=o(d),r.g=l(d),r.b=c(d),r.opacity=u(d),r+""}}return i.gamma=e,i}(1);function sQt(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,i=t.slice(),r;return function(s){for(r=0;rn&&(s=t.slice(n,s),l[o]?l[o]+=s:l[++o]=s),(i=i[0])===(r=r[0])?l[o]?l[o]+=r:l[++o]=r:(l[++o]=null,c.push({i:o,x:Yf(i,r)})),n=G$.lastIndex;return n180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(r(f)+"rotate(",null,i)-2,x:Yf(u,d)})):d&&f.push(r(f)+"rotate("+d+i)}function l(u,d,f,h){u!==d?h.push({i:f.push(r(f)+"skewX(",null,i)-2,x:Yf(u,d)}):d&&f.push(r(f)+"skewX("+d+i)}function c(u,d,f,h,m,g){if(u!==f||d!==h){var b=m.push(r(m)+"scale(",null,",",null,")");g.push({i:b-4,x:Yf(u,f)},{i:b-2,x:Yf(d,h)})}else(f!==1||h!==1)&&m.push(r(m)+"scale("+f+","+h+")")}return function(u,d){var f=[],h=[];return u=e(u),d=e(d),s(u.translateX,u.translateY,d.translateX,d.translateY,f,h),o(u.rotate,d.rotate,f,h),l(u.skewX,d.skewX,f,h),c(u.scaleX,u.scaleY,d.scaleX,d.scaleY,f,h),u=d=null,function(m){for(var g=-1,b=h.length,v;++g=0&&e._call.call(void 0,t),e=e._next;--w1}function Eae(){T0=(EP=sA.now())+vL,w1=wS=0;try{xQt()}finally{w1=0,OQt(),T0=0}}function wQt(){var e=sA.now(),t=e-EP;t>o8e&&(vL-=t,EP=e)}function OQt(){for(var e,t=SP,n,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:SP=n);OS=e,R7(i)}function R7(e){if(!w1){wS&&(wS=clearTimeout(wS));var t=e-T0;t>24?(e<1/0&&(wS=setTimeout(Eae,e-sA.now()-vL)),jk&&(jk=clearInterval(jk))):(jk||(EP=sA.now(),jk=setInterval(wQt,o8e)),w1=1,l8e(Eae))}}function Cae(e,t,n){var i=new CP;return t=t==null?0:+t,i.restart(r=>{i.stop(),e(r+t)},t,n),i}var kQt=gL("start","end","cancel","interrupt"),SQt=[],u8e=0,Aae=1,I7=2,JN=3,Tae=4,P7=5,eR=6;function xL(e,t,n,i,r,s){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;EQt(e,n,{name:t,index:i,group:r,on:kQt,tween:SQt,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:u8e})}function GW(e,t){var n=If(e,t);if(n.state>u8e)throw new Error("too late; already scheduled");return n}function Ph(e,t){var n=If(e,t);if(n.state>JN)throw new Error("too late; already running");return n}function If(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function EQt(e,t,n){var i=e.__transition,r;i[t]=n,n.timer=c8e(s,0,n.time);function s(u){n.state=Aae,n.timer.restart(o,n.delay,n.time),n.delay<=u&&o(u-n.delay)}function o(u){var d,f,h,m;if(n.state!==Aae)return c();for(d in i)if(m=i[d],m.name===n.name){if(m.state===JN)return Cae(o);m.state===Tae?(m.state=eR,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete i[d]):+dI7&&i.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function tzt(e,t,n){var i,r,s=ezt(t)?GW:Ph;return function(){var o=s(this,e),l=o.on;l!==i&&(r=(i=l).copy()).on(t,n),o.on=r}}function nzt(e,t){var n=this._id;return arguments.length<2?If(this.node(),n).on.on(e):this.each(tzt(n,e,t))}function izt(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function rzt(){return this.on("end.remove",izt(this._id))}function szt(e){var t=this._name,n=this._id;typeof e!="function"&&(e=HW(e));for(var i=this._groups,r=i.length,s=new Array(r),o=0;o()=>e;function jzt(e,{sourceEvent:t,target:n,transform:i,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:r}})}function Cp(e,t,n){this.k=e,this.x=t,this.y=n}Cp.prototype={constructor:Cp,scale:function(e){return e===1?this:new Cp(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Cp(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var wL=new Cp(1,0,0);p8e.prototype=Cp.prototype;function p8e(e){for(;!e.__zoom;)if(!(e=e.parentNode))return wL;return e.__zoom}function X$(e){e.stopImmediatePropagation()}function Nk(e){e.preventDefault(),e.stopImmediatePropagation()}function Nzt(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Rzt(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function _ae(){return this.__zoom||wL}function Izt(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Pzt(){return navigator.maxTouchPoints||"ontouchstart"in this}function Dzt(e,t,n){var i=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(r>i?(i+r)/2:Math.min(0,i)||Math.max(0,r),o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o))}function m8e(){var e=Nzt,t=Rzt,n=Dzt,i=Izt,r=Pzt,s=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,c=ZN,u=gL("start","zoom","end"),d,f,h,m=500,g=150,b=0,v=10;function y(P){P.property("__zoom",_ae).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",j).on("dblclick.zoom",T).filter(r).on("touchstart.zoom",R).on("touchmove.zoom",A).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(P,I,D,_){var L=P.selection?P.selection():P;L.property("__zoom",_ae),P!==L?k(P,I,D,_):L.interrupt().each(function(){S(this,arguments).event(_).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},y.scaleBy=function(P,I,D,_){y.scaleTo(P,function(){var L=this.__zoom.k,F=typeof I=="function"?I.apply(this,arguments):I;return L*F},D,_)},y.scaleTo=function(P,I,D,_){y.transform(P,function(){var L=t.apply(this,arguments),F=this.__zoom,M=D==null?O(L):typeof D=="function"?D.apply(this,arguments):D,V=F.invert(M),q=typeof I=="function"?I.apply(this,arguments):I;return n(x(w(F,q),M,V),L,o)},D,_)},y.translateBy=function(P,I,D,_){y.transform(P,function(){return n(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof D=="function"?D.apply(this,arguments):D),t.apply(this,arguments),o)},null,_)},y.translateTo=function(P,I,D,_,L){y.transform(P,function(){var F=t.apply(this,arguments),M=this.__zoom,V=_==null?O(F):typeof _=="function"?_.apply(this,arguments):_;return n(wL.translate(V[0],V[1]).scale(M.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof D=="function"?-D.apply(this,arguments):-D),F,o)},_,L)};function w(P,I){return I=Math.max(s[0],Math.min(s[1],I)),I===P.k?P:new Cp(I,P.x,P.y)}function x(P,I,D){var _=I[0]-D[0]*P.k,L=I[1]-D[1]*P.k;return _===P.x&&L===P.y?P:new Cp(P.k,_,L)}function O(P){return[(+P[0][0]+ +P[1][0])/2,(+P[0][1]+ +P[1][1])/2]}function k(P,I,D,_){P.on("start.zoom",function(){S(this,arguments).event(_).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(_).end()}).tween("zoom",function(){var L=this,F=arguments,M=S(L,F).event(_),V=t.apply(L,F),q=D==null?O(V):typeof D=="function"?D.apply(L,F):D,U=Math.max(V[1][0]-V[0][0],V[1][1]-V[0][1]),J=L.__zoom,z=typeof I=="function"?I.apply(L,F):I,Z=c(J.invert(q).concat(U/J.k),z.invert(q).concat(U/z.k));return function(ne){if(ne===1)ne=z;else{var W=Z(ne),G=U/W[2];ne=new Cp(G,q[0]-W[0]*G,q[1]-W[1]*G)}M.zoom(null,ne)}})}function S(P,I,D){return!D&&P.__zooming||new C(P,I)}function C(P,I){this.that=P,this.args=I,this.active=0,this.sourceEvent=null,this.extent=t.apply(P,I),this.taps=0}C.prototype={event:function(P){return P&&(this.sourceEvent=P),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(P,I){return this.mouse&&P!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&P!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&P!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(P){var I=vu(this.that).datum();u.call(P,this.that,new jzt(P,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:u}),I)}};function E(P,...I){if(!e.apply(this,arguments))return;var D=S(this,I).event(P),_=this.__zoom,L=Math.max(s[0],Math.min(s[1],_.k*Math.pow(2,i.apply(this,arguments)))),F=tf(P);if(D.wheel)(D.mouse[0][0]!==F[0]||D.mouse[0][1]!==F[1])&&(D.mouse[1]=_.invert(D.mouse[0]=F)),clearTimeout(D.wheel);else{if(_.k===L)return;D.mouse=[F,_.invert(F)],tR(this),D.start()}Nk(P),D.wheel=setTimeout(M,g),D.zoom("mouse",n(x(w(_,L),D.mouse[0],D.mouse[1]),D.extent,o));function M(){D.wheel=null,D.end()}}function j(P,...I){if(h||!e.apply(this,arguments))return;var D=P.currentTarget,_=S(this,I,!0).event(P),L=vu(P.view).on("mousemove.zoom",q,!0).on("mouseup.zoom",U,!0),F=tf(P,D),M=P.clientX,V=P.clientY;YFe(P.view),X$(P),_.mouse=[F,this.__zoom.invert(F)],tR(this),_.start();function q(J){if(Nk(J),!_.moved){var z=J.clientX-M,Z=J.clientY-V;_.moved=z*z+Z*Z>b}_.event(J).zoom("mouse",n(x(_.that.__zoom,_.mouse[0]=tf(J,D),_.mouse[1]),_.extent,o))}function U(J){L.on("mousemove.zoom mouseup.zoom",null),ZFe(J.view,_.moved),Nk(J),_.event(J).end()}}function T(P,...I){if(e.apply(this,arguments)){var D=this.__zoom,_=tf(P.changedTouches?P.changedTouches[0]:P,this),L=D.invert(_),F=D.k*(P.shiftKey?.5:2),M=n(x(w(D,F),_,L),t.apply(this,I),o);Nk(P),l>0?vu(this).transition().duration(l).call(k,M,_,P):vu(this).call(y.transform,M,_,P)}}function R(P,...I){if(e.apply(this,arguments)){var D=P.touches,_=D.length,L=S(this,I,P.changedTouches.length===_).event(P),F,M,V,q;for(X$(P),M=0;M<_;++M)V=D[M],q=tf(V,this),q=[q,this.__zoom.invert(q),V.identifier],L.touch0?!L.touch1&&L.touch0[2]!==q[2]&&(L.touch1=q,L.taps=0):(L.touch0=q,F=!0,L.taps=1+!!d);d&&(d=clearTimeout(d)),F&&(L.taps<2&&(f=q[0],d=setTimeout(function(){d=null},m)),tR(this),L.start())}}function A(P,...I){if(this.__zooming){var D=S(this,I).event(P),_=P.changedTouches,L=_.length,F,M,V,q;for(Nk(P),F=0;F`Seems like you have not used zustand provider as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:i})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:i}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},aA=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],g8e=["Enter"," ","Escape"],b8e={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var O1;(function(e){e.Strict="strict",e.Loose="loose"})(O1||(O1={}));var t0;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(t0||(t0={}));var oA;(function(e){e.Partial="partial",e.Full="full"})(oA||(oA={}));const y8e={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var lg;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(lg||(lg={}));var lA;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(lA||(lA={}));var vn;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(vn||(vn={}));const jae={[vn.Left]:vn.Right,[vn.Right]:vn.Left,[vn.Top]:vn.Bottom,[vn.Bottom]:vn.Top};function v8e(e){return e===null?null:e?"valid":"invalid"}const x8e=e=>"id"in e&&"source"in e&&"target"in e,Mzt=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),YW=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),QT=(e,t=[0,0])=>{const{width:n,height:i}=xm(e),r=e.origin??t,s=n*r[0],o=i*r[1];return{x:e.position.x-s,y:e.position.y-o}},Lzt=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((i,r)=>{const s=typeof r=="string";let o=!t.nodeLookup&&!s?r:void 0;t.nodeLookup&&(o=s?t.nodeLookup.get(r):YW(r)?r:t.nodeLookup.get(r.id));const l=o?AP(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return OL(i,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return kL(n)},zT=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},i=!1;return e.forEach(r=>{(t.filter===void 0||t.filter(r))&&(n=OL(n,AP(r)),i=!0)}),i?kL(n):{x:0,y:0,width:0,height:0}},ZW=(e,t,[n,i,r]=[0,0,1],s=!1,o=!1)=>{const l={...xO(t,[n,i,r]),width:t.width/r,height:t.height/r},c=[];for(const u of e.values()){const{measured:d,selectable:f=!0,hidden:h=!1}=u;if(o&&!f||h)continue;const m=d.width??u.width??u.initialWidth??null,g=d.height??u.height??u.initialHeight??null,b=cA(l,S1(u)),v=(m??0)*(g??0),y=s&&b>0;(!u.internals.handleBounds||y||b>=v||u.dragging)&&c.push(u)}return c},$zt=(e,t)=>{const n=new Set;return e.forEach(i=>{n.add(i.id)}),t.filter(i=>n.has(i.source)||n.has(i.target))};function Fzt(e,t){const n=new Map,i=t!=null&&t.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{r.measured.width&&r.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!r.hidden)&&(!i||i.has(r.id))&&n.set(r.id,r)}),n}async function Bzt({nodes:e,width:t,height:n,panZoom:i,minZoom:r,maxZoom:s},o){if(e.size===0)return!0;const l=Fzt(e,o),c=zT(l),u=eK(c,t,n,(o==null?void 0:o.minZoom)??r,(o==null?void 0:o.maxZoom)??s,(o==null?void 0:o.padding)??.1);return await i.setViewport(u,{duration:o==null?void 0:o.duration,ease:o==null?void 0:o.ease,interpolate:o==null?void 0:o.interpolate}),!0}function w8e({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:i=[0,0],nodeExtent:r,onError:s}){const o=n.get(e),l=o.parentId?n.get(o.parentId):void 0,{x:c,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},d=o.origin??i;let f=o.extent||r;if(o.extent==="parent"&&!o.expandParent)if(!l)s==null||s("005",kf.error005());else{const m=l.measured.width,g=l.measured.height;m&&g&&(f=[[c,u],[c+m,u+g]])}else l&&j0(o.extent)&&(f=[[o.extent[0][0]+c,o.extent[0][1]+u],[o.extent[1][0]+c,o.extent[1][1]+u]]);const h=j0(f)?_0(t,f,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(s==null||s("015",kf.error015())),{position:{x:h.x-c+(o.measured.width??0)*d[0],y:h.y-u+(o.measured.height??0)*d[1]},positionAbsolute:h}}async function Uzt({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:i,onBeforeDelete:r}){const s=new Set(e.map(h=>h.id)),o=[];for(const h of n){if(h.deletable===!1)continue;const m=s.has(h.id),g=!m&&h.parentId&&o.find(b=>b.id===h.parentId);(m||g)&&o.push(h)}const l=new Set(t.map(h=>h.id)),c=i.filter(h=>h.deletable!==!1),d=$zt(o,c);for(const h of c)l.has(h.id)&&!d.find(g=>g.id===h.id)&&d.push(h);if(!r)return{edges:d,nodes:o};const f=await r({nodes:o,edges:d});return typeof f=="boolean"?f?{edges:d,nodes:o}:{edges:[],nodes:[]}:f}const k1=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),_0=(e={x:0,y:0},t,n)=>({x:k1(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:k1(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function O8e(e,t,n){const{width:i,height:r}=xm(n),{x:s,y:o}=n.internals.positionAbsolute;return _0(e,[[s,o],[s+i,o+r]],t)}const Nae=(e,t,n)=>en?-k1(Math.abs(e-n),1,t)/t:0,JW=(e,t,n=15,i=40)=>{const r=Nae(e.x,i,t.width-i)*n,s=Nae(e.y,i,t.height-i)*n;return[r,s]},OL=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),D7=({x:e,y:t,width:n,height:i})=>({x:e,y:t,x2:e+n,y2:t+i}),kL=({x:e,y:t,x2:n,y2:i})=>({x:e,y:t,width:n-e,height:i-t}),S1=(e,t=[0,0])=>{var r,s;const{x:n,y:i}=YW(e)?e.internals.positionAbsolute:QT(e,t);return{x:n,y:i,width:((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0,height:((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0}},AP=(e,t=[0,0])=>{var r,s;const{x:n,y:i}=YW(e)?e.internals.positionAbsolute:QT(e,t);return{x:n,y:i,x2:n+(((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0),y2:i+(((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0)}},k8e=(e,t)=>kL(OL(D7(e),D7(t))),cA=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),i=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*i)},Rae=e=>uf(e.width)&&uf(e.height)&&uf(e.x)&&uf(e.y),uf=e=>!isNaN(e)&&isFinite(e),S8e=(e,t)=>(n,i)=>{},VT=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),xO=({x:e,y:t},[n,i,r],s=!1,o=[1,1])=>{const l={x:(e-n)/r,y:(t-i)/r};return s?VT(l,o):l},E1=({x:e,y:t},[n,i,r])=>({x:e*r+n,y:t*r+i});function Vv(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Qzt(e,t,n){if(typeof e=="string"||typeof e=="number"){const i=Vv(e,n),r=Vv(e,t);return{top:i,right:r,bottom:i,left:r,x:r*2,y:i*2}}if(typeof e=="object"){const i=Vv(e.top??e.y??0,n),r=Vv(e.bottom??e.y??0,n),s=Vv(e.left??e.x??0,t),o=Vv(e.right??e.x??0,t);return{top:i,right:o,bottom:r,left:s,x:s+o,y:i+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function zzt(e,t,n,i,r,s){const{x:o,y:l}=E1(e,[t,n,i]),{x:c,y:u}=E1({x:e.x+e.width,y:e.y+e.height},[t,n,i]),d=r-c,f=s-u;return{left:Math.floor(o),top:Math.floor(l),right:Math.floor(d),bottom:Math.floor(f)}}const eK=(e,t,n,i,r,s)=>{const o=Qzt(s,t,n),l=(t-o.x)/e.width,c=(n-o.y)/e.height,u=Math.min(l,c),d=k1(u,i,r),f=e.x+e.width/2,h=e.y+e.height/2,m=t/2-f*d,g=n/2-h*d,b=zzt(e,m,g,d,t,n),v={left:Math.min(b.left-o.left,0),top:Math.min(b.top-o.top,0),right:Math.min(b.right-o.right,0),bottom:Math.min(b.bottom-o.bottom,0)};return{x:m-v.left+v.right,y:g-v.top+v.bottom,zoom:d}},uA=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function j0(e){return e!=null&&e!=="parent"}function xm(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function tK(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function E8e(e,t={width:0,height:0},n,i,r){const s={...e},o=i.get(n);if(o){const l=o.origin||r;s.x+=o.internals.positionAbsolute.x-(t.width??0)*l[0],s.y+=o.internals.positionAbsolute.y-(t.height??0)*l[1]}return s}function Iae(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Vzt(){let e,t;return{promise:new Promise((i,r)=>{e=i,t=r}),resolve:e,reject:t}}function Hzt(e){return{...b8e,...e||{}}}function _E(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:i,containerBounds:r}){const{x:s,y:o}=df(e),l=xO({x:s-((r==null?void 0:r.left)??0),y:o-((r==null?void 0:r.top)??0)},i),{x:c,y:u}=n?VT(l,t):l;return{xSnapped:c,ySnapped:u,...l}}const nK=e=>({width:e.offsetWidth,height:e.offsetHeight}),C8e=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},qzt=["INPUT","SELECT","TEXTAREA"];function A8e(e){var i,r;const t=((r=(i=e.composedPath)==null?void 0:i.call(e))==null?void 0:r[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:qzt.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const T8e=e=>"clientX"in e,df=(e,t)=>{var s,o;const n=T8e(e),i=n?e.clientX:(s=e.touches)==null?void 0:s[0].clientX,r=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:i-((t==null?void 0:t.left)??0),y:r-((t==null?void 0:t.top)??0)}},Pae=(e,t,n,i,r)=>{const s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(o=>{const l=o.getBoundingClientRect();return{id:o.getAttribute("data-handleid"),type:e,nodeId:r,position:o.getAttribute("data-handlepos"),x:(l.left-n.left)/i,y:(l.top-n.top)/i,...nK(o)}})};function _8e({sourceX:e,sourceY:t,targetX:n,targetY:i,sourceControlX:r,sourceControlY:s,targetControlX:o,targetControlY:l}){const c=e*.125+r*.375+o*.375+n*.125,u=t*.125+s*.375+l*.375+i*.125,d=Math.abs(c-e),f=Math.abs(u-t);return[c,u,d,f]}function gj(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Dae({pos:e,x1:t,y1:n,x2:i,y2:r,c:s}){switch(e){case vn.Left:return[t-gj(t-i,s),n];case vn.Right:return[t+gj(i-t,s),n];case vn.Top:return[t,n-gj(n-r,s)];case vn.Bottom:return[t,n+gj(r-n,s)]}}function j8e({sourceX:e,sourceY:t,sourcePosition:n=vn.Bottom,targetX:i,targetY:r,targetPosition:s=vn.Top,curvature:o=.25}){const[l,c]=Dae({pos:n,x1:e,y1:t,x2:i,y2:r,c:o}),[u,d]=Dae({pos:s,x1:i,y1:r,x2:e,y2:t,c:o}),[f,h,m,g]=_8e({sourceX:e,sourceY:t,targetX:i,targetY:r,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${e},${t} C${l},${c} ${u},${d} ${i},${r}`,f,h,m,g]}function N8e({sourceX:e,sourceY:t,targetX:n,targetY:i}){const r=Math.abs(n-e)/2,s=n0}const Gzt=({source:e,sourceHandle:t,target:n,targetHandle:i})=>`xy-edge__${e}${t||""}-${n}${i||""}`,Xzt=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),Yzt=(e,t,n={})=>{var s;if(!e.source||!e.target)return(s=n.onError)==null||s.call(n,"006",kf.error006()),t;const i=n.getEdgeId||Gzt;let r;return x8e(e)?r={...e}:r={...e,id:i(e)},Xzt(r,t)?t:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,t.concat(r))};function R8e({sourceX:e,sourceY:t,targetX:n,targetY:i}){const[r,s,o,l]=N8e({sourceX:e,sourceY:t,targetX:n,targetY:i});return[`M ${e},${t}L ${n},${i}`,r,s,o,l]}const Mae={[vn.Left]:{x:-1,y:0},[vn.Right]:{x:1,y:0},[vn.Top]:{x:0,y:-1},[vn.Bottom]:{x:0,y:1}},Zzt=({source:e,sourcePosition:t=vn.Bottom,target:n})=>t===vn.Left||t===vn.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Jzt({source:e,sourcePosition:t=vn.Bottom,target:n,targetPosition:i=vn.Top,center:r,offset:s,stepPosition:o}){const l=Mae[t],c=Mae[i],u={x:e.x+l.x*s,y:e.y+l.y*s},d={x:n.x+c.x*s,y:n.y+c.y*s},f=Zzt({source:u,sourcePosition:t,target:d}),h=f.x!==0?"x":"y",m=f[h];let g=[],b,v;const y={x:0,y:0},w={x:0,y:0},[,,x,O]=N8e({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[h]*c[h]===-1){h==="x"?(b=r.x??u.x+(d.x-u.x)*o,v=r.y??(u.y+d.y)/2):(b=r.x??(u.x+d.x)/2,v=r.y??u.y+(d.y-u.y)*o);const E=[{x:b,y:u.y},{x:b,y:d.y}],j=[{x:u.x,y:v},{x:d.x,y:v}];l[h]===m?g=h==="x"?E:j:g=h==="x"?j:E}else{const E=[{x:u.x,y:d.y}],j=[{x:d.x,y:u.y}];if(h==="x"?g=l.x===m?j:E:g=l.y===m?E:j,t===i){const P=Math.abs(e[h]-n[h]);if(P<=s){const I=Math.min(s-1,s-P);l[h]===m?y[h]=(u[h]>e[h]?-1:1)*I:w[h]=(d[h]>n[h]?-1:1)*I}}if(t!==i){const P=h==="x"?"y":"x",I=l[h]===c[P],D=u[P]>d[P],_=u[P]=N?(b=(T.x+R.x)/2,v=g[0].y):(b=g[0].x,v=(T.y+R.y)/2)}const k={x:u.x+y.x,y:u.y+y.y},S={x:d.x+w.x,y:d.y+w.y};return[[e,...k.x!==g[0].x||k.y!==g[0].y?[k]:[],...g,...S.x!==g[g.length-1].x||S.y!==g[g.length-1].y?[S]:[],n],b,v,x,O]}function eVt(e,t,n,i){const r=Math.min(Lae(e,t)/2,Lae(t,n)/2,i),{x:s,y:o}=t;if(e.x===s&&s===n.x||e.y===o&&o===n.y)return`L${s} ${o}`;if(e.y===o){const u=e.xn.id===t):e[0])||null}function M7(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`:""}function nVt(e,{id:t,defaultColor:n,defaultMarkerStart:i,defaultMarkerEnd:r}){const s=new Set;return e.reduce((o,l)=>([l.markerStart||i,l.markerEnd||r].forEach(c=>{if(c&&typeof c=="object"){const u=M7(c,t);s.has(u)||(o.push({id:u,color:c.color||n,...c}),s.add(u))}}),o),[]).sort((o,l)=>o.id.localeCompare(l.id))}const I8e=1e3,iVt=10,iK={nodeOrigin:[0,0],nodeExtent:aA,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},rVt={...iK,checkEquality:!0};function rK(e,t){const n={...e};for(const i in t)t[i]!==void 0&&(n[i]=t[i]);return n}function sVt(e,t,n){const i=rK(iK,n);for(const r of e.values())if(r.parentId)aK(r,e,t,i);else{const s=QT(r,i.nodeOrigin),o=j0(r.extent)?r.extent:i.nodeExtent,l=_0(s,o,xm(r));r.internals.positionAbsolute=l}}function aVt(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],i=[];for(const r of e.handles){const s={id:r.id,width:r.width??1,height:r.height??1,nodeId:e.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?n.push(s):r.type==="target"&&i.push(s)}return{source:n,target:i}}function sK(e){return e==="manual"}function L7(e,t,n,i={}){var d,f;const r=rK(rVt,i),s={i:0},o=new Map(t),l=r!=null&&r.elevateNodesOnSelect&&!sK(r.zIndexMode)?I8e:0;let c=e.length>0,u=!1;t.clear(),n.clear();for(const h of e){let m=o.get(h.id);if(r.checkEquality&&h===(m==null?void 0:m.internals.userNode))t.set(h.id,m);else{const g=QT(h,r.nodeOrigin),b=j0(h.extent)?h.extent:r.nodeExtent,v=_0(g,b,xm(h));m={...r.defaults,...h,measured:{width:(d=h.measured)==null?void 0:d.width,height:(f=h.measured)==null?void 0:f.height},internals:{positionAbsolute:v,handleBounds:aVt(h,m),z:P8e(h,l,r.zIndexMode),userNode:h}},t.set(h.id,m)}(m.measured===void 0||m.measured.width===void 0||m.measured.height===void 0)&&!m.hidden&&(c=!1),h.parentId&&aK(m,t,n,i,s),u||(u=h.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:u}}function oVt(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function aK(e,t,n,i,r){const{elevateNodesOnSelect:s,nodeOrigin:o,nodeExtent:l,zIndexMode:c}=rK(iK,i),u=e.parentId,d=t.get(u);if(!d){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}oVt(e,n),r&&!d.parentId&&d.internals.rootParentIndex===void 0&&c==="auto"&&(d.internals.rootParentIndex=++r.i,d.internals.z=d.internals.z+r.i*iVt),r&&d.internals.rootParentIndex!==void 0&&(r.i=d.internals.rootParentIndex);const f=s&&!sK(c)?I8e:0,{x:h,y:m,z:g}=lVt(e,d,o,l,f,c),{positionAbsolute:b}=e.internals,v=h!==b.x||m!==b.y;(v||g!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:h,y:m}:b,z:g}})}function P8e(e,t,n){const i=uf(e.zIndex)?e.zIndex:0;return sK(n)?i:i+(e.selected?t:0)}function lVt(e,t,n,i,r,s){const{x:o,y:l}=t.internals.positionAbsolute,c=xm(e),u=QT(e,n),d=j0(e.extent)?_0(u,e.extent,c):u;let f=_0({x:o+d.x,y:l+d.y},i,c);e.extent==="parent"&&(f=O8e(f,c,t));const h=P8e(e,r,s),m=t.internals.z??0;return{x:f.x,y:f.y,z:m>=h?m+1:h}}function oK(e,t,n,i=[0,0]){var o;const r=[],s=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const u=((o=s.get(l.parentId))==null?void 0:o.expandedRect)??S1(c),d=k8e(u,l.rect);s.set(l.parentId,{expandedRect:d,parent:c})}return s.size>0&&s.forEach(({expandedRect:l,parent:c},u)=>{var x;const d=c.internals.positionAbsolute,f=xm(c),h=c.origin??i,m=l.x0||g>0||y||w)&&(r.push({id:u,type:"position",position:{x:c.position.x-m+y,y:c.position.y-g+w}}),(x=n.get(u))==null||x.forEach(O=>{e.some(k=>k.id===O.id)||r.push({id:O.id,type:"position",position:{x:O.position.x+m,y:O.position.y+g}})})),(f.width0){const m=oK(h,t,n,r);u.push(...m)}return{changes:u,updatedInternals:c}}async function uVt({delta:e,panZoom:t,transform:n,translateExtent:i,width:r,height:s}){if(!t||!e.x&&!e.y)return!1;const o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,s]],i);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function Uae(e,t,n,i,r,s){let o=r;const l=i.get(o)||new Map;i.set(o,l.set(n,t)),o=`${r}-${e}`;const c=i.get(o)||new Map;if(i.set(o,c.set(n,t)),s){o=`${r}-${e}-${s}`;const u=i.get(o)||new Map;i.set(o,u.set(n,t))}}function D8e(e,t,n){e.clear(),t.clear();for(const i of n){const{source:r,target:s,sourceHandle:o=null,targetHandle:l=null}=i,c={edgeId:i.id,source:r,target:s,sourceHandle:o,targetHandle:l},u=`${r}-${o}--${s}-${l}`,d=`${s}-${l}--${r}-${o}`;Uae("source",c,d,e,r,o),Uae("target",c,u,e,s,l),t.set(i.id,i)}}function M8e(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:M8e(n,t):!1}function Qae(e,t,n){var r;let i=e;do{if((r=i==null?void 0:i.matches)!=null&&r.call(i,t))return!0;if(i===n)return!1;i=i==null?void 0:i.parentElement}while(i);return!1}function dVt(e,t,n,i){const r=new Map;for(const[s,o]of e)if((o.selected||o.id===i)&&(!o.parentId||!M8e(o,e))&&(o.draggable||t&&typeof o.draggable>"u")){const l=e.get(s);l&&r.set(s,{id:s,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return r}function Y$({nodeId:e,dragItems:t,nodeLookup:n,dragging:i=!0}){var o,l,c;const r=[];for(const[u,d]of t){const f=(o=n.get(u))==null?void 0:o.internals.userNode;f&&r.push({...f,position:d.position,dragging:i})}if(!e)return[r[0],r];const s=(l=n.get(e))==null?void 0:l.internals.userNode;return[s?{...s,position:((c=t.get(e))==null?void 0:c.position)||s.position,dragging:i}:r[0],r]}function fVt({dragItems:e,snapGrid:t,x:n,y:i}){const r=e.values().next().value;if(!r)return null;const s={x:n-r.distance.x,y:i-r.distance.y},o=VT(s,t);return{x:o.x-s.x,y:o.y-s.y}}function hVt({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:i,onDragStop:r}){let s={x:null,y:null},o=0,l=new Map,c=!1,u={x:0,y:0},d=null,f=!1,h=null,m=!1,g=!1,b=null;function v({noDragClassName:w,handleSelector:x,domNode:O,isSelectable:k,nodeId:S,nodeClickDistance:C=0}){h=vu(O);function E({x:A,y:N}){const{nodeLookup:P,nodeExtent:I,snapGrid:D,snapToGrid:_,nodeOrigin:L,onNodeDrag:F,onSelectionDrag:M,onError:V,updateNodePositions:q}=t();s={x:A,y:N};let U=!1;const J=l.size>1,z=J&&I?D7(zT(l)):null,Z=J&&_?fVt({dragItems:l,snapGrid:D,x:A,y:N}):null;for(const[ne,W]of l){if(!P.has(ne))continue;let G={x:A-W.distance.x,y:N-W.distance.y};_&&(G=Z?{x:Math.round(G.x+Z.x),y:Math.round(G.y+Z.y)}:VT(G,D));let H=null;if(J&&I&&!W.extent&&z){const{positionAbsolute:X}=W.internals,ie=X.x-z.x+I[0][0],ee=X.x+W.measured.width-z.x2+I[1][0],be=X.y-z.y+I[0][1],ue=X.y+W.measured.height-z.y2+I[1][1];H=[[ie,be],[ee,ue]]}const{position:se,positionAbsolute:Y}=w8e({nodeId:ne,nextPosition:G,nodeLookup:P,nodeExtent:H||I,nodeOrigin:L,onError:V});U=U||W.position.x!==se.x||W.position.y!==se.y,W.position=se,W.internals.positionAbsolute=Y}if(g=g||U,!!U&&(q(l,!0),b&&(i||F||!S&&M))){const[ne,W]=Y$({nodeId:S,dragItems:l,nodeLookup:P});i==null||i(b,l,ne,W),F==null||F(b,ne,W),S||M==null||M(b,W)}}async function j(){if(!d)return;const{transform:A,panBy:N,autoPanSpeed:P,autoPanOnNodeDrag:I}=t();if(!I){c=!1,cancelAnimationFrame(o);return}const[D,_]=JW(u,d,P);(D!==0||_!==0)&&(s.x=(s.x??0)-D/A[2],s.y=(s.y??0)-_/A[2],await N({x:D,y:_})&&E(s)),o=requestAnimationFrame(j)}function T(A){var J;const{nodeLookup:N,multiSelectionActive:P,nodesDraggable:I,transform:D,snapGrid:_,snapToGrid:L,selectNodesOnDrag:F,onNodeDragStart:M,onSelectionDragStart:V,unselectNodesAndEdges:q}=t();f=!0,(!F||!k)&&!P&&S&&((J=N.get(S))!=null&&J.selected||q()),k&&F&&S&&(e==null||e(S));const U=_E(A.sourceEvent,{transform:D,snapGrid:_,snapToGrid:L,containerBounds:d});if(s=U,l=dVt(N,I,U,S),l.size>0&&(n||M||!S&&V)){const[z,Z]=Y$({nodeId:S,dragItems:l,nodeLookup:N});n==null||n(A.sourceEvent,l,z,Z),M==null||M(A.sourceEvent,z,Z),S||V==null||V(A.sourceEvent,Z)}}const R=JFe().clickDistance(C).on("start",A=>{const{domNode:N,nodeDragThreshold:P,transform:I,snapGrid:D,snapToGrid:_}=t();d=(N==null?void 0:N.getBoundingClientRect())||null,m=!1,g=!1,b=A.sourceEvent,P===0&&T(A),s=_E(A.sourceEvent,{transform:I,snapGrid:D,snapToGrid:_,containerBounds:d}),u=df(A.sourceEvent,d)}).on("drag",A=>{const{autoPanOnNodeDrag:N,transform:P,snapGrid:I,snapToGrid:D,nodeDragThreshold:_,nodeLookup:L}=t(),F=_E(A.sourceEvent,{transform:P,snapGrid:I,snapToGrid:D,containerBounds:d});if(b=A.sourceEvent,(A.sourceEvent.type==="touchmove"&&A.sourceEvent.touches.length>1||S&&!L.has(S))&&(m=!0),!m){if(!c&&N&&f&&(c=!0,j()),!f){const M=df(A.sourceEvent,d),V=M.x-u.x,q=M.y-u.y;Math.sqrt(V*V+q*q)>_&&T(A)}(s.x!==F.xSnapped||s.y!==F.ySnapped)&&l&&f&&(u=df(A.sourceEvent,d),E(F))}}).on("end",A=>{if(!f||m){m&&l.size>0&&t().updateNodePositions(l,!1);return}if(c=!1,f=!1,cancelAnimationFrame(o),l.size>0){const{nodeLookup:N,updateNodePositions:P,onNodeDragStop:I,onSelectionDragStop:D}=t();if(g&&(P(l,!1),g=!1),r||I||!S&&D){const[_,L]=Y$({nodeId:S,dragItems:l,nodeLookup:N,dragging:!1});r==null||r(A.sourceEvent,l,_,L),I==null||I(A.sourceEvent,_,L),S||D==null||D(A.sourceEvent,L)}}}).filter(A=>{const N=A.target;return!A.button&&(!w||!Qae(N,`.${w}`,O))&&(!x||Qae(N,x,O))});h.call(R)}function y(){h==null||h.on(".drag",null)}return{update:v,destroy:y}}function pVt(e,t,n){const i=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const s of t.values())cA(r,S1(s))>0&&i.push(s);return i}const mVt=250;function gVt(e,t,n,i){var l,c;let r=[],s=1/0;const o=pVt(e,n,t+mVt);for(const u of o){const d=[...((l=u.internals.handleBounds)==null?void 0:l.source)??[],...((c=u.internals.handleBounds)==null?void 0:c.target)??[]];for(const f of d){if(i.nodeId===f.nodeId&&i.type===f.type&&i.id===f.id)continue;const{x:h,y:m}=N0(u,f,f.position,!0),g=Math.sqrt(Math.pow(h-e.x,2)+Math.pow(m-e.y,2));g>t||(g1){const u=i.type==="source"?"target":"source";return r.find(d=>d.type===u)??r[0]}return r[0]}function L8e(e,t,n,i,r,s=!1){var u,d,f;const o=i.get(e);if(!o)return null;const l=r==="strict"?(u=o.internals.handleBounds)==null?void 0:u[t]:[...((d=o.internals.handleBounds)==null?void 0:d.source)??[],...((f=o.internals.handleBounds)==null?void 0:f.target)??[]],c=(n?l==null?void 0:l.find(h=>h.id===n):l==null?void 0:l[0])??null;return c&&s?{...c,...N0(o,c,c.position,!0)}:c}function $8e(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function bVt(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const F8e=()=>!0;function yVt(e,{connectionMode:t,connectionRadius:n,handleId:i,nodeId:r,edgeUpdaterType:s,isTarget:o,domNode:l,nodeLookup:c,lib:u,autoPanOnConnect:d,flowId:f,panBy:h,cancelConnection:m,onConnectStart:g,onConnect:b,onConnectEnd:v,isValidConnection:y=F8e,onReconnectEnd:w,updateConnection:x,getTransform:O,getFromHandle:k,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:E}){const j=C8e(e.target);let T=0,R;const{x:A,y:N}=df(e),P=$8e(s,E),I=l==null?void 0:l.getBoundingClientRect();let D=!1;if(!I||!P)return;const _=L8e(r,P,i,c,t);if(!_)return;let L=df(e,I),F=!1,M=null,V=!1,q=null;function U(){if(!d||!I)return;const[se,Y]=JW(L,I,S);h({x:se,y:Y}),T=requestAnimationFrame(U)}const J={..._,nodeId:r,type:P,position:_.position},z=c.get(r);let ne={inProgress:!0,isValid:null,from:N0(z,J,vn.Left,!0),fromHandle:J,fromPosition:J.position,fromNode:z,to:L,toHandle:null,toPosition:jae[J.position],toNode:null,pointer:L};function W(){D=!0,x(ne),g==null||g(e,{nodeId:r,handleId:i,handleType:P})}C===0&&W();function G(se){if(!D){const{x:ue,y:pe}=df(se),ke=ue-A,je=pe-N;if(!(ke*ke+je*je>C*C))return;W()}if(!k()||!J){H(se);return}const Y=O();L=df(se,I),R=gVt(xO(L,Y,!1,[1,1]),n,c,J),F||(U(),F=!0);const X=B8e(se,{handle:R,connectionMode:t,fromNodeId:r,fromHandleId:i,fromType:o?"target":"source",isValidConnection:y,doc:j,lib:u,flowId:f,nodeLookup:c});q=X.handleDomNode,M=X.connection,V=bVt(!!R,X.isValid);const ie=c.get(r),ee=ie?N0(ie,J,vn.Left,!0):ne.from,be={...ne,from:ee,isValid:V,to:X.toHandle&&V?E1({x:X.toHandle.x,y:X.toHandle.y},Y):L,toHandle:X.toHandle,toPosition:V&&X.toHandle?X.toHandle.position:jae[J.position],toNode:X.toHandle?c.get(X.toHandle.nodeId):null,pointer:L};x(be),ne=be}function H(se){if(!("touches"in se&&se.touches.length>0)){if(D){(R||q)&&M&&V&&(b==null||b(M));const{inProgress:Y,...X}=ne,ie={...X,toPosition:ne.toHandle?ne.toPosition:null};v==null||v(se,ie),s&&(w==null||w(se,ie))}m(),cancelAnimationFrame(T),F=!1,V=!1,M=null,q=null,j.removeEventListener("mousemove",G),j.removeEventListener("mouseup",H),j.removeEventListener("touchmove",G),j.removeEventListener("touchend",H)}}j.addEventListener("mousemove",G),j.addEventListener("mouseup",H),j.addEventListener("touchmove",G),j.addEventListener("touchend",H)}function B8e(e,{handle:t,connectionMode:n,fromNodeId:i,fromHandleId:r,fromType:s,doc:o,lib:l,flowId:c,isValidConnection:u=F8e,nodeLookup:d}){const f=s==="target",h=t?o.querySelector(`.${l}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:m,y:g}=df(e),b=o.elementFromPoint(m,g),v=b!=null&&b.classList.contains(`${l}-flow__handle`)?b:h,y={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const w=$8e(void 0,v),x=v.getAttribute("data-nodeid"),O=v.getAttribute("data-handleid"),k=v.classList.contains("connectable"),S=v.classList.contains("connectableend");if(!x||!w)return y;const C={source:f?x:i,sourceHandle:f?O:r,target:f?i:x,targetHandle:f?r:O};y.connection=C;const j=k&&S&&(n===O1.Strict?f&&w==="source"||!f&&w==="target":x!==i||O!==r);y.isValid=j&&u(C),y.toHandle=L8e(x,w,O,d,n,!0)}return y}const $7={onPointerDown:yVt,isValid:B8e};function vVt({domNode:e,panZoom:t,getTransform:n,getViewScale:i}){const r=vu(e);function s({translateExtent:l,width:c,height:u,zoomStep:d=1,pannable:f=!0,zoomable:h=!0,inversePan:m=!1}){const g=x=>{if(x.sourceEvent.type!=="wheel"||!t)return;const O=n(),k=x.sourceEvent.ctrlKey&&uA()?10:1,S=-x.sourceEvent.deltaY*(x.sourceEvent.deltaMode===1?.05:x.sourceEvent.deltaMode?1:.002)*d,C=O[2]*Math.pow(2,S*k);t.scaleTo(C)};let b=[0,0];const v=x=>{(x.sourceEvent.type==="mousedown"||x.sourceEvent.type==="touchstart")&&(b=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY])},y=x=>{const O=n();if(x.sourceEvent.type!=="mousemove"&&x.sourceEvent.type!=="touchmove"||!t)return;const k=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY],S=[k[0]-b[0],k[1]-b[1]];b=k;const C=i()*Math.max(O[2],Math.log(O[2]))*(m?-1:1),E={x:O[0]-S[0]*C,y:O[1]-S[1]*C},j=[[0,0],[c,u]];t.setViewportConstrained({x:E.x,y:E.y,zoom:O[2]},j,l)},w=m8e().on("start",v).on("zoom",f?y:null).on("zoom.wheel",h?g:null);r.call(w,{})}function o(){r.on("zoom",null)}return{update:s,destroy:o,pointer:tf}}const SL=e=>({x:e.x,y:e.y,zoom:e.k}),Z$=({x:e,y:t,zoom:n})=>wL.translate(e,t).scale(n),Qx=(e,t)=>e.target.closest(`.${t}`),U8e=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),xVt=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,J$=(e,t=0,n=xVt,i=()=>{})=>{const r=typeof t=="number"&&t>0;return r||i(),r?e.transition().duration(t).ease(n).on("end",i):e},Q8e=e=>{const t=e.ctrlKey&&uA()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function wVt({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:i,panOnScrollMode:r,panOnScrollSpeed:s,zoomOnPinch:o,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:u}){return d=>{if(Qx(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(d.ctrlKey&&o){const v=tf(d),y=Q8e(d),w=f*Math.pow(2,y);i.scaleTo(n,w,v,d);return}const h=d.deltaMode===1?20:1;let m=r===t0.Vertical?0:d.deltaX*h,g=r===t0.Horizontal?0:d.deltaY*h;!uA()&&d.shiftKey&&r!==t0.Vertical&&(m=d.deltaY*h,g=0),i.translateBy(n,-(m/f)*s,-(g/f)*s,{internal:!0});const b=SL(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(d,b),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,b),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(d,b))}}function OVt({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(i,r){const s=i.type==="wheel",o=!t&&s&&!i.ctrlKey,l=Qx(i,e);if(i.ctrlKey&&s&&l&&i.preventDefault(),o||l)return null;i.preventDefault(),n.call(this,i,r)}}function kVt({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return i=>{var s,o,l;if((s=i.sourceEvent)!=null&&s.internal)return;const r=SL(i.transform);e.mouseButton=((o=i.sourceEvent)==null?void 0:o.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=r,((l=i.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(i.sourceEvent,r))}}function SVt({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:i,onPanZoom:r}){return s=>{var o,l;e.usedRightMouseButton=!!(n&&U8e(t,e.mouseButton??0)),(o=s.sourceEvent)!=null&&o.sync||i([s.transform.x,s.transform.y,s.transform.k]),r&&!((l=s.sourceEvent)!=null&&l.internal)&&(r==null||r(s.sourceEvent,SL(s.transform)))}}function EVt({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:i,onPanZoomEnd:r,onPaneContextMenu:s}){return o=>{var l;if(!((l=o.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,s&&U8e(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&s(o.sourceEvent),e.usedRightMouseButton=!1,i(!1),r)){const c=SL(o.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r==null||r(o.sourceEvent,c)},n?150:0)}}}function CVt({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:i,panOnScroll:r,zoomOnDoubleClick:s,userSelectionActive:o,noWheelClassName:l,noPanClassName:c,lib:u,connectionInProgress:d}){return f=>{var v;const h=e||t,m=n&&f.ctrlKey,g=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(Qx(f,`${u}-flow__node`)||Qx(f,`${u}-flow__edge`)))return!0;if(!i&&!h&&!r&&!s&&!n||o||d&&!g||Qx(f,l)&&g||Qx(f,c)&&(!g||r&&g&&!e)||!n&&f.ctrlKey&&g)return!1;if(!n&&f.type==="touchstart"&&((v=f.touches)==null?void 0:v.length)>1)return f.preventDefault(),!1;if(!h&&!r&&!m&&g||!i&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(i)&&!i.includes(f.button)&&f.type==="mousedown")return!1;const b=Array.isArray(i)&&i.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||g)&&b}}function AVt({domNode:e,minZoom:t,maxZoom:n,translateExtent:i,viewport:r,onPanZoom:s,onPanZoomStart:o,onPanZoomEnd:l,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=m8e().scaleExtent([t,n]).translateExtent(i),h=vu(e).call(f);w({x:r.x,y:r.y,zoom:k1(r.zoom,t,n)},[[0,0],[d.width,d.height]],i);const m=h.on("wheel.zoom"),g=h.on("dblclick.zoom");f.wheelDelta(Q8e);async function b(R,A){return h?new Promise(N=>{f==null||f.interpolate((A==null?void 0:A.interpolate)==="linear"?TE:ZN).transform(J$(h,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>N(!0)),R)}):!1}function v({noWheelClassName:R,noPanClassName:A,onPaneContextMenu:N,userSelectionActive:P,panOnScroll:I,panOnDrag:D,panOnScrollMode:_,panOnScrollSpeed:L,preventScrolling:F,zoomOnPinch:M,zoomOnScroll:V,zoomOnDoubleClick:q,zoomActivationKeyPressed:U,lib:J,onTransformChange:z,connectionInProgress:Z,paneClickDistance:ne,selectionOnDrag:W}){P&&!u.isZoomingOrPanning&&y();const G=I&&!U&&!P;f.clickDistance(W?1/0:!uf(ne)||ne<0?0:ne);const H=G?wVt({zoomPanValues:u,noWheelClassName:R,d3Selection:h,d3Zoom:f,panOnScrollMode:_,panOnScrollSpeed:L,zoomOnPinch:M,onPanZoomStart:o,onPanZoom:s,onPanZoomEnd:l}):OVt({noWheelClassName:R,preventScrolling:F,d3ZoomHandler:m});h.on("wheel.zoom",H,{passive:!1});const se=kVt({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:o});f.on("start",se);const Y=SVt({zoomPanValues:u,panOnDrag:D,onPaneContextMenu:!!N,onPanZoom:s,onTransformChange:z});f.on("zoom",Y);const X=EVt({zoomPanValues:u,panOnDrag:D,panOnScroll:I,onPaneContextMenu:N,onPanZoomEnd:l,onDraggingChange:c});f.on("end",X);const ie=CVt({zoomActivationKeyPressed:U,panOnDrag:D,zoomOnScroll:V,panOnScroll:I,zoomOnDoubleClick:q,zoomOnPinch:M,userSelectionActive:P,noPanClassName:A,noWheelClassName:R,lib:J,connectionInProgress:Z});f.filter(ie),q?h.on("dblclick.zoom",g):h.on("dblclick.zoom",null)}function y(){f.on("zoom",null)}async function w(R,A,N){const P=Z$(R),I=f==null?void 0:f.constrain()(P,A,N);return I&&await b(I),I}async function x(R,A){const N=Z$(R);return await b(N,A),N}function O(R){if(h){const A=Z$(R),N=h.property("__zoom");(N.k!==R.zoom||N.x!==R.x||N.y!==R.y)&&(f==null||f.transform(h,A,null,{sync:!0}))}}function k(){const R=h?p8e(h.node()):{x:0,y:0,k:1};return{x:R.x,y:R.y,zoom:R.k}}async function S(R,A){return h?new Promise(N=>{f==null||f.interpolate((A==null?void 0:A.interpolate)==="linear"?TE:ZN).scaleTo(J$(h,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>N(!0)),R)}):!1}async function C(R,A){return h?new Promise(N=>{f==null||f.interpolate((A==null?void 0:A.interpolate)==="linear"?TE:ZN).scaleBy(J$(h,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>N(!0)),R)}):!1}function E(R){f==null||f.scaleExtent(R)}function j(R){f==null||f.translateExtent(R)}function T(R){const A=!uf(R)||R<0?0:R;f==null||f.clickDistance(A)}return{update:v,destroy:y,setViewport:x,setViewportConstrained:w,getViewport:k,scaleTo:S,scaleBy:C,setScaleExtent:E,setTranslateExtent:j,syncViewport:O,setClickDistance:T}}var C1;(function(e){e.Line="line",e.Handle="handle"})(C1||(C1={}));function TVt({width:e,prevWidth:t,height:n,prevHeight:i,affectsX:r,affectsY:s}){const o=e-t,l=n-i,c=[o>0?1:o<0?-1:0,l>0?1:l<0?-1:0];return o&&r&&(c[0]=c[0]*-1),l&&s&&(c[1]=c[1]*-1),c}function zae(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),i=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:i,affectsY:r}}function $m(e,t){return Math.max(0,t-e)}function Fm(e,t){return Math.max(0,e-t)}function bj(e,t,n){return Math.max(0,t-e,e-n)}function Vae(e,t){return e?!t:t}function _Vt(e,t,n,i,r,s,o,l){let{affectsX:c,affectsY:u}=t;const{isHorizontal:d,isVertical:f}=t,h=d&&f,{xSnapped:m,ySnapped:g}=n,{minWidth:b,maxWidth:v,minHeight:y,maxHeight:w}=i,{x,y:O,width:k,height:S,aspectRatio:C}=e;let E=Math.floor(d?m-e.pointerX:0),j=Math.floor(f?g-e.pointerY:0);const T=k+(c?-E:E),R=S+(u?-j:j),A=-s[0]*k,N=-s[1]*S;let P=bj(T,b,v),I=bj(R,y,w);if(o){let L=0,F=0;c&&E<0?L=$m(x+E+A,o[0][0]):!c&&E>0&&(L=Fm(x+T+A,o[1][0])),u&&j<0?F=$m(O+j+N,o[0][1]):!u&&j>0&&(F=Fm(O+R+N,o[1][1])),P=Math.max(P,L),I=Math.max(I,F)}if(l){let L=0,F=0;c&&E>0?L=Fm(x+E,l[0][0]):!c&&E<0&&(L=$m(x+T,l[1][0])),u&&j>0?F=Fm(O+j,l[0][1]):!u&&j<0&&(F=$m(O+R,l[1][1])),P=Math.max(P,L),I=Math.max(I,F)}if(r){if(d){const L=bj(T/C,y,w)*C;if(P=Math.max(P,L),o){let F=0;!c&&!u||c&&!u&&h?F=Fm(O+N+T/C,o[1][1])*C:F=$m(O+N+(c?E:-E)/C,o[0][1])*C,P=Math.max(P,F)}if(l){let F=0;!c&&!u||c&&!u&&h?F=$m(O+T/C,l[1][1])*C:F=Fm(O+(c?E:-E)/C,l[0][1])*C,P=Math.max(P,F)}}if(f){const L=bj(R*C,b,v)/C;if(I=Math.max(I,L),o){let F=0;!c&&!u||u&&!c&&h?F=Fm(x+R*C+A,o[1][0])/C:F=$m(x+(u?j:-j)*C+A,o[0][0])/C,I=Math.max(I,F)}if(l){let F=0;!c&&!u||u&&!c&&h?F=$m(x+R*C,l[1][0])/C:F=Fm(x+(u?j:-j)*C,l[0][0])/C,I=Math.max(I,F)}}}j=j+(j<0?I:-I),E=E+(E<0?P:-P),r&&(h?T>R*C?j=(Vae(c,u)?-E:E)/C:E=(Vae(c,u)?-j:j)*C:d?(j=E/C,u=c):(E=j*C,c=u));const D=c?x+E:x,_=u?O+j:O;return{width:k+(c?-E:E),height:S+(u?-j:j),x:s[0]*E*(c?-1:1)+D,y:s[1]*j*(u?-1:1)+_}}const z8e={width:0,height:0,x:0,y:0},jVt={...z8e,pointerX:0,pointerY:0,aspectRatio:1};function NVt(e,t,n){const i=t.position.x+e.position.x,r=t.position.y+e.position.y,s=e.measured.width??0,o=e.measured.height??0,l=n[0]*s,c=n[1]*o;return[[i-l,r-c],[i+s-l,r+o-c]]}function RVt({domNode:e,nodeId:t,getStoreItems:n,onChange:i,onEnd:r}){const s=vu(e);let o={controlDirection:zae("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:u,boundaries:d,keepAspectRatio:f,resizeDirection:h,onResizeStart:m,onResize:g,onResizeEnd:b,shouldResize:v}){let y={...z8e},w={...jVt};o={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:zae(u)};let x,O=null,k=[],S,C,E,j=!1;const T=JFe().on("start",R=>{const{nodeLookup:A,transform:N,snapGrid:P,snapToGrid:I,nodeOrigin:D,paneDomNode:_}=n();if(x=A.get(t),!x)return;O=(_==null?void 0:_.getBoundingClientRect())??null;const{xSnapped:L,ySnapped:F}=_E(R.sourceEvent,{transform:N,snapGrid:P,snapToGrid:I,containerBounds:O});y={width:x.measured.width??0,height:x.measured.height??0,x:x.position.x??0,y:x.position.y??0},w={...y,pointerX:L,pointerY:F,aspectRatio:y.width/y.height},S=void 0,C=j0(x.extent)?x.extent:void 0,x.parentId&&(x.extent==="parent"||x.expandParent)&&(S=A.get(x.parentId)),S&&x.extent==="parent"&&(C=[[0,0],[S.measured.width,S.measured.height]]),k=[],E=void 0;for(const[M,V]of A)if(V.parentId===t&&(k.push({id:M,position:{...V.position},extent:V.extent}),V.extent==="parent"||V.expandParent)){const q=NVt(V,x,V.origin??D);E?E=[[Math.min(q[0][0],E[0][0]),Math.min(q[0][1],E[0][1])],[Math.max(q[1][0],E[1][0]),Math.max(q[1][1],E[1][1])]]:E=q}m==null||m(R,{...y})}).on("drag",R=>{const{transform:A,snapGrid:N,snapToGrid:P,nodeOrigin:I}=n(),D=_E(R.sourceEvent,{transform:A,snapGrid:N,snapToGrid:P,containerBounds:O}),_=[];if(!x)return;const{x:L,y:F,width:M,height:V}=y,q={},U=x.origin??I,{width:J,height:z,x:Z,y:ne}=_Vt(w,o.controlDirection,D,o.boundaries,o.keepAspectRatio,U,C,E),W=J!==M,G=z!==V,H=Z!==L&&W,se=ne!==F&&G;if(!H&&!se&&!W&&!G)return;if((H||se||U[0]===1||U[1]===1)&&(q.x=H?Z:y.x,q.y=se?ne:y.y,y.x=q.x,y.y=q.y,k.length>0)){const ee=Z-L,be=ne-F;for(const ue of k)ue.position={x:ue.position.x-ee+U[0]*(J-M),y:ue.position.y-be+U[1]*(z-V)},_.push(ue)}if((W||G)&&(q.width=W&&(!o.resizeDirection||o.resizeDirection==="horizontal")?J:y.width,q.height=G&&(!o.resizeDirection||o.resizeDirection==="vertical")?z:y.height,y.width=q.width,y.height=q.height),S&&x.expandParent){const ee=U[0]*(q.width??0);q.x&&q.x{j&&(b==null||b(R,{...y}),r==null||r({...y}),j=!1)});s.call(T)}function c(){s.on(".drag",null)}return{update:l,destroy:c}}const IVt={},Hae=e=>{let t;const n=new Set,i=(d,f)=>{const h=typeof d=="function"?d(t):d;if(!Object.is(h,t)){const m=t;t=f??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(g=>g(t,m))}},r=()=>t,c={setState:i,getState:r,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(IVt?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=t=e(i,r,c);return c},PVt=e=>e?Hae(e):Hae,{useDebugValue:DVt}=ji,{useSyncExternalStoreWithSelector:MVt}=bnt,LVt=e=>e;function V8e(e,t=LVt,n){const i=MVt(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return DVt(i),i}const qae=(e,t)=>{const n=PVt(e),i=(r,s=t)=>V8e(n,r,s);return Object.assign(i,n),i},$Vt=(e,t)=>e?qae(e,t):qae;function zs(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[i,r]of e)if(!Object.is(r,t.get(i)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const i of n)if(!Object.prototype.hasOwnProperty.call(t,i)||!Object.is(e[i],t[i]))return!1;return!0}const EL=p.createContext(null),FVt=EL.Provider,H8e=kf.error001("react");function ir(e,t){const n=p.useContext(EL);if(n===null)throw new Error(H8e);return V8e(n,e,t)}function Vs(){const e=p.useContext(EL);if(e===null)throw new Error(H8e);return p.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Wae={display:"none"},BVt={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},q8e="react-flow__node-desc",W8e="react-flow__edge-desc",UVt="react-flow__aria-live",QVt=e=>e.ariaLiveMessage,zVt=e=>e.ariaLabelConfig;function VVt({rfId:e}){const t=ir(QVt);return a.jsx("div",{id:`${UVt}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:BVt,children:t})}function HVt({rfId:e,disableKeyboardA11y:t}){const n=ir(zVt);return a.jsxs(a.Fragment,{children:[a.jsx("div",{id:`${q8e}-${e}`,style:Wae,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),a.jsx("div",{id:`${W8e}-${e}`,style:Wae,children:n["edge.a11yDescription.default"]}),!t&&a.jsx(VVt,{rfId:e})]})}const CL=p.forwardRef(({position:e="top-left",children:t,className:n,style:i,...r},s)=>{const o=`${e}`.split("-");return a.jsx("div",{className:eo(["react-flow__panel",n,...o]),style:i,ref:s,...r,children:t})});CL.displayName="Panel";function qVt({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:a.jsx(CL,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:a.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const WVt=e=>{const t=[],n=[];for(const[,i]of e.nodeLookup)i.selected&&t.push(i.internals.userNode);for(const[,i]of e.edgeLookup)i.selected&&n.push(i);return{selectedNodes:t,selectedEdges:n}},yj=e=>e.id;function KVt(e,t){return zs(e.selectedNodes.map(yj),t.selectedNodes.map(yj))&&zs(e.selectedEdges.map(yj),t.selectedEdges.map(yj))}function GVt({onSelectionChange:e}){const t=Vs(),{selectedNodes:n,selectedEdges:i}=ir(WVt,KVt);return p.useEffect(()=>{const r={nodes:n,edges:i};e==null||e(r),t.getState().onSelectionChangeHandlers.forEach(s=>s(r))},[n,i,e]),null}const XVt=e=>!!e.onSelectionChangeHandlers;function YVt({onSelectionChange:e}){const t=ir(XVt);return e||t?a.jsx(GVt,{onSelectionChange:e}):null}const K8e=[0,0],ZVt={x:0,y:0,zoom:1},JVt=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],Kae=[...JVt,"rfId"],eHt=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),Gae={translateExtent:aA,nodeOrigin:K8e,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function tHt(e){const{setNodes:t,setEdges:n,setMinZoom:i,setMaxZoom:r,setTranslateExtent:s,setNodeExtent:o,reset:l,setDefaultNodesAndEdges:c}=ir(eHt,zs),u=Vs();p.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{d.current=Gae,l()}),[]);const d=p.useRef(Gae);return p.useEffect(()=>{for(const f of Kae){const h=e[f],m=d.current[f];h!==m&&(typeof e[f]>"u"||(f==="nodes"?t(h):f==="edges"?n(h):f==="minZoom"?i(h):f==="maxZoom"?r(h):f==="translateExtent"?s(h):f==="nodeExtent"?o(h):f==="ariaLabelConfig"?u.setState({ariaLabelConfig:Hzt(h)}):f==="fitView"?u.setState({fitViewQueued:h}):f==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[f]:h})))}d.current=e},Kae.map(f=>e[f])),null}function Xae(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function nHt(e){var i;const[t,n]=p.useState(e==="system"?null:e);return p.useEffect(()=>{if(e!=="system"){n(e);return}const r=Xae(),s=()=>n(r!=null&&r.matches?"dark":"light");return s(),r==null||r.addEventListener("change",s),()=>{r==null||r.removeEventListener("change",s)}},[e]),t!==null?t:(i=Xae())!=null&&i.matches?"dark":"light"}const Yae=typeof document<"u"?document:null;function dA(e=null,t={target:Yae,actInsideInputWithModifier:!0}){const[n,i]=p.useState(!1),r=p.useRef(!1),s=p.useRef(new Set([])),[o,l]=p.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",` `).replace(` `,` +`).split(` -`)),d=u.reduce((f,h)=>f.concat(...h),[]);return[u,d]}return[[],[]]},[e]);return p.useEffect(()=>{const c=(t==null?void 0:t.target)??Yae,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=m=>{var v,y;if(r.current=m.ctrlKey||m.metaKey||m.shiftKey||m.altKey,(!r.current||r.current&&!u)&&A8e(m))return!1;const b=Jae(m.code,l);if(s.current.add(m[b]),Zae(o,s.current,!1)){const w=((y=(v=m.composedPath)==null?void 0:v.call(m))==null?void 0:y[0])||m.target,x=(w==null?void 0:w.nodeName)==="BUTTON"||(w==null?void 0:w.nodeName)==="A";t.preventDefault!==!1&&(r.current||!x)&&m.preventDefault(),i(!0)}},f=m=>{const g=Jae(m.code,l);Zae(o,s.current,!0)?(i(!1),s.current.clear()):s.current.delete(m[g]),m.key==="Meta"&&s.current.clear(),r.current=!1},h=()=>{s.current.clear(),i(!1)};return c==null||c.addEventListener("keydown",d),c==null||c.addEventListener("keyup",f),window.addEventListener("blur",h),window.addEventListener("contextmenu",h),()=>{c==null||c.removeEventListener("keydown",d),c==null||c.removeEventListener("keyup",f),window.removeEventListener("blur",h),window.removeEventListener("contextmenu",h)}}},[e,i]),n}function Zae(e,t,n){return e.filter(i=>n||i.length===t.size).some(i=>i.every(r=>t.has(r)))}function Jae(e,t){return t.includes(e)?"code":"key"}const iHt=()=>{const e=Hs();return p.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:i}=e.getState();return i?i.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[i,r,s],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??i,y:t.y??r,zoom:t.zoom??s},n),!0):!1},getViewport:()=>{const[t,n,i]=e.getState().transform;return{x:t,y:n,zoom:i}},setCenter:async(t,n,i)=>e.getState().setCenter(t,n,i),fitBounds:async(t,n)=>{const{width:i,height:r,minZoom:s,maxZoom:o,panZoom:l}=e.getState(),c=eK(t,i,r,s,o,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(c,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:i,snapGrid:r,snapToGrid:s,domNode:o}=e.getState();if(!o)return t;const{x:l,y:c}=o.getBoundingClientRect(),u={x:t.x-l,y:t.y-c},d=n.snapGrid??r,f=n.snapToGrid??s;return yO(u,i,f,d)},flowToScreenPosition:t=>{const{transform:n,domNode:i}=e.getState();if(!i)return t;const{x:r,y:s}=i.getBoundingClientRect(),o=k1(t,n);return{x:o.x+r,y:o.y+s}}}),[])};function G8e(e,t){const n=[],i=new Map,r=[];for(const s of e)if(s.type==="add"){r.push(s);continue}else if(s.type==="remove"||s.type==="replace")i.set(s.id,[s]);else{const o=i.get(s.id);o?o.push(s):i.set(s.id,[s])}for(const s of t){const o=i.get(s.id);if(!o){n.push(s);continue}if(o[0].type==="remove")continue;if(o[0].type==="replace"){n.push({...o[0].item});continue}const l={...s};for(const c of o)rHt(c,l);n.push(l)}return r.length&&r.forEach(s=>{s.index!==void 0?n.splice(s.index,0,{...s.item}):n.push({...s.item})}),n}function rHt(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function X8e(e,t){return G8e(e,t)}function Y8e(e,t){return G8e(e,t)}function my(e,t){return{id:e,type:"select",selected:t}}function Ux(e,t=new Set,n=!1){const i=[];for(const[r,s]of e){const o=t.has(r);!(s.selected===void 0&&!o)&&s.selected!==o&&(n&&(s.selected=o),i.push(my(s.id,o)))}return i}function eoe({items:e=[],lookup:t}){var r;const n=[],i=new Map(e.map(s=>[s.id,s]));for(const[s,o]of e.entries()){const l=t.get(o.id),c=((r=l==null?void 0:l.internals)==null?void 0:r.userNode)??l;c!==void 0&&c!==o&&n.push({id:o.id,item:o,type:"replace"}),c===void 0&&n.push({item:o,type:"add",index:s})}for(const[s]of t)i.get(s)===void 0&&n.push({id:s,type:"remove"});return n}function toe(e){return{id:e.id,type:"remove"}}const sHt=S8e();function aHt(e,t,n={}){return Yzt(e,t,{...n,onError:n.onError??sHt})}const noe=e=>Mzt(e),oHt=e=>x8e(e);function Z8e(e){return p.forwardRef(e)}const lHt=typeof window<"u"?p.useLayoutEffect:p.useEffect;function ioe(e){const[t,n]=p.useState(BigInt(0)),[i]=p.useState(()=>cHt(()=>n(r=>r+BigInt(1))));return lHt(()=>{const r=i.get();r.length&&(e(r),i.reset())},[t]),i}function cHt(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const J8e=p.createContext(null);function uHt({children:e}){const t=Hs(),n=p.useCallback(l=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:d,onNodesChange:f,nodeLookup:h,fitViewQueued:m,onNodesChangeMiddlewareMap:g}=t.getState();let b=c;for(const y of l)b=typeof y=="function"?y(b):y;let v=eoe({items:b,lookup:h});for(const y of g.values())v=y(v);d&&u(b),v.length>0?f==null||f(v):m&&window.requestAnimationFrame(()=>{const{fitViewQueued:y,nodes:w,setNodes:x}=t.getState();y&&x(w)})},[]),i=ioe(n),r=p.useCallback(l=>{const{edges:c=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:f,edgeLookup:h}=t.getState();let m=c;for(const g of l)m=typeof g=="function"?g(m):g;d?u(m):f&&f(eoe({items:m,lookup:h}))},[]),s=ioe(r),o=p.useMemo(()=>({nodeQueue:i,edgeQueue:s}),[]);return a.jsx(J8e.Provider,{value:o,children:e})}function dHt(){const e=p.useContext(J8e);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const fHt=e=>!!e.panZoom;function CL(){const e=iHt(),t=Hs(),n=dHt(),i=ir(fHt),r=p.useMemo(()=>{const s=f=>t.getState().nodeLookup.get(f),o=f=>{n.nodeQueue.push(f)},l=f=>{n.edgeQueue.push(f)},c=f=>{var y,w;const{nodeLookup:h,nodeOrigin:m}=t.getState(),g=noe(f)?f:h.get(f.id),b=g.parentId?E8e(g.position,g.measured,g.parentId,h,m):g.position,v={...g,position:b,width:((y=g.measured)==null?void 0:y.width)??g.width,height:((w=g.measured)==null?void 0:w.height)??g.height};return O1(v)},u=(f,h,m={replace:!1})=>{o(g=>g.map(b=>{if(b.id===f){const v=typeof h=="function"?h(b):h;return m.replace&&noe(v)?v:{...b,...v}}return b}))},d=(f,h,m={replace:!1})=>{l(g=>g.map(b=>{if(b.id===f){const v=typeof h=="function"?h(b):h;return m.replace&&oHt(v)?v:{...b,...v}}return b}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var h;return(h=s(f))==null?void 0:h.internals.userNode},getInternalNode:s,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(h=>({...h}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:o,setEdges:l,addNodes:f=>{const h=Array.isArray(f)?f:[f];n.nodeQueue.push(m=>[...m,...h])},addEdges:f=>{const h=Array.isArray(f)?f:[f];n.edgeQueue.push(m=>[...m,...h])},toObject:()=>{const{nodes:f=[],edges:h=[],transform:m}=t.getState(),[g,b,v]=m;return{nodes:f.map(y=>({...y})),edges:h.map(y=>({...y})),viewport:{x:g,y:b,zoom:v}}},deleteElements:async({nodes:f=[],edges:h=[]})=>{const{nodes:m,edges:g,onNodesDelete:b,onEdgesDelete:v,triggerNodeChanges:y,triggerEdgeChanges:w,onDelete:x,onBeforeDelete:O}=t.getState(),{nodes:k,edges:S}=await Uzt({nodesToRemove:f,edgesToRemove:h,nodes:m,edges:g,onBeforeDelete:O}),C=S.length>0,E=k.length>0;if(C){const j=S.map(toe);v==null||v(S),w(j)}if(E){const j=k.map(toe);b==null||b(k),y(j)}return(E||C)&&(x==null||x({nodes:k,edges:S})),{deletedNodes:k,deletedEdges:S}},getIntersectingNodes:(f,h=!0,m)=>{const g=Rae(f),b=g?f:c(f),v=m!==void 0;return b?(m||t.getState().nodes).filter(y=>{const w=t.getState().nodeLookup.get(y.id);if(w&&!g&&(y.id===f.id||!w.internals.positionAbsolute))return!1;const x=O1(v?y:w),O=rA(x,b);return h&&O>0||O>=x.width*x.height||O>=b.width*b.height}):[]},isNodeIntersecting:(f,h,m=!0)=>{const b=Rae(f)?f:c(f);if(!b)return!1;const v=rA(b,h);return m&&v>0||v>=h.width*h.height||v>=b.width*b.height},updateNode:u,updateNodeData:(f,h,m={replace:!1})=>{u(f,g=>{const b=typeof h=="function"?h(g):h;return m.replace?{...g,data:b}:{...g,data:{...g.data,...b}}},m)},updateEdge:d,updateEdgeData:(f,h,m={replace:!1})=>{d(f,g=>{const b=typeof h=="function"?h(g):h;return m.replace?{...g,data:b}:{...g,data:{...g.data,...b}}},m)},getNodesBounds:f=>{const{nodeLookup:h,nodeOrigin:m}=t.getState();return Lzt(f,{nodeLookup:h,nodeOrigin:m})},getHandleConnections:({type:f,id:h,nodeId:m})=>{var g;return Array.from(((g=t.getState().connectionLookup.get(`${m}-${f}${h?`-${h}`:""}`))==null?void 0:g.values())??[])},getNodeConnections:({type:f,handleId:h,nodeId:m})=>{var g;return Array.from(((g=t.getState().connectionLookup.get(`${m}${f?h?`-${f}-${h}`:`-${f}`:""}`))==null?void 0:g.values())??[])},fitView:async f=>{const h=t.getState().fitViewResolver??Vzt();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:h}),n.nodeQueue.push(m=>[...m]),h.promise}}},[]);return p.useMemo(()=>({...r,...e,viewportInitialized:i}),[i])}const roe=e=>e.selected,hHt=typeof window<"u"?window:void 0;function pHt({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Hs(),{deleteElements:i}=CL(),r=aA(e,{actInsideInputWithModifier:!1}),s=aA(t,{target:hHt});p.useEffect(()=>{if(r){const{edges:o,nodes:l}=n.getState();i({nodes:l.filter(roe),edges:o.filter(roe)}),n.setState({nodesSelectionActive:!1})}},[r]),p.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])}function mHt(e){const t=Hs();p.useEffect(()=>{const n=()=>{var r,s,o,l;if(!e.current||!(((s=(r=e.current).checkVisibility)==null?void 0:s.call(r))??!0))return!1;const i=nK(e.current);(i.height===0||i.width===0)&&((l=(o=t.getState()).onError)==null||l.call(o,"004",Sf.error004())),t.setState({width:i.width||500,height:i.height||500})};if(e.current){n(),window.addEventListener("resize",n);const i=new ResizeObserver(()=>n());return i.observe(e.current),()=>{window.removeEventListener("resize",n),i&&e.current&&i.unobserve(e.current)}}},[])}const AL={position:"absolute",width:"100%",height:"100%",top:0,left:0},gHt=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function bHt({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:i=!1,panOnScrollSpeed:r=.5,panOnScrollMode:s=Zy.Free,zoomOnDoubleClick:o=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:m=!0,children:g,noWheelClassName:b,noPanClassName:v,onViewportChange:y,isControlledViewport:w,paneClickDistance:x,selectionOnDrag:O}){const k=Hs(),S=p.useRef(null),{userSelectionActive:C,lib:E,connectionInProgress:j}=ir(gHt,Vs),T=aA(h),R=p.useRef();mHt(S);const A=p.useCallback(N=>{y==null||y({x:N[0],y:N[1],zoom:N[2]}),w||k.setState({transform:N})},[y,w]);return p.useEffect(()=>{if(S.current){R.current=AVt({domNode:S.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:c,onDraggingChange:D=>k.setState(_=>_.paneDragging===D?_:{paneDragging:D}),onPanZoomStart:(D,_)=>{const{onViewportChangeStart:L,onMoveStart:F}=k.getState();F==null||F(D,_),L==null||L(_)},onPanZoom:(D,_)=>{const{onViewportChange:L,onMove:F}=k.getState();F==null||F(D,_),L==null||L(_)},onPanZoomEnd:(D,_)=>{const{onViewportChangeEnd:L,onMoveEnd:F}=k.getState();F==null||F(D,_),L==null||L(_)}});const{x:N,y:P,zoom:I}=R.current.getViewport();return k.setState({panZoom:R.current,transform:[N,P,I],domNode:S.current.closest(".react-flow")}),()=>{var D;(D=R.current)==null||D.destroy()}}},[]),p.useEffect(()=>{var N;(N=R.current)==null||N.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:i,panOnScrollSpeed:r,panOnScrollMode:s,zoomOnDoubleClick:o,panOnDrag:l,zoomActivationKeyPressed:T,preventScrolling:m,noPanClassName:v,userSelectionActive:C,noWheelClassName:b,lib:E,onTransformChange:A,connectionInProgress:j,selectionOnDrag:O,paneClickDistance:x})},[e,t,n,i,r,s,o,l,T,m,v,C,b,E,A,j,O,x]),a.jsx("div",{className:"react-flow__renderer",ref:S,style:AL,children:g})}const yHt=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function vHt(){const{userSelectionActive:e,userSelectionRect:t}=ir(yHt,Vs);return e&&t?a.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const e6=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},xHt=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function wHt({isSelecting:e,selectionKeyPressed:t,selectionMode:n=nA.Full,panOnDrag:i,autoPanOnSelection:r,paneClickDistance:s,selectionOnDrag:o,onSelectionStart:l,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:f,onPaneMouseEnter:h,onPaneMouseMove:m,onPaneMouseLeave:g,children:b}){const v=p.useRef(0),y=Hs(),{userSelectionActive:w,elementsSelectable:x,dragging:O,connectionInProgress:k,panBy:S,autoPanSpeed:C}=ir(xHt,Vs),E=x&&(e||w),j=p.useRef(null),T=p.useRef(),R=p.useRef(new Set),A=p.useRef(new Set),N=p.useRef(!1),P=p.useRef({x:0,y:0}),I=p.useRef(!1),D=W=>{if(N.current||k){N.current=!1;return}u==null||u(W),y.getState().resetSelectedElements(),y.setState({nodesSelectionActive:!1})},_=W=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){W.preventDefault();return}d==null||d(W)},L=f?W=>f(W):void 0,F=W=>{N.current&&(W.stopPropagation(),N.current=!1)},M=W=>{var ue,pe;const{domNode:G,transform:H}=y.getState();if(T.current=G==null?void 0:G.getBoundingClientRect(),!T.current)return;const se=W.target===j.current;if(!se&&!!W.target.closest(".nokey")||!e||!(o&&se||t)||W.button!==0||!W.isPrimary)return;(pe=(ue=W.target)==null?void 0:ue.setPointerCapture)==null||pe.call(ue,W.pointerId),N.current=!1;const{x:ie,y:ee}=ff(W.nativeEvent,T.current),be=yO({x:ie,y:ee},H);y.setState({userSelectionRect:{width:0,height:0,startX:be.x,startY:be.y,x:ie,y:ee}}),se||(W.stopPropagation(),W.preventDefault())};function z(W,G){const{userSelectionRect:H}=y.getState();if(!H)return;const{transform:se,nodeLookup:Y,edgeLookup:X,connectionLookup:ie,triggerNodeChanges:ee,triggerEdgeChanges:be,defaultEdgeOptions:ue}=y.getState(),pe={x:H.startX,y:H.startY},{x:ke,y:je}=k1(pe,se),Pe={startX:pe.x,startY:pe.y,x:Wae.id)),A.current=new Set;const _e=(ue==null?void 0:ue.selectable)??!0;for(const ae of R.current){const le=ie.get(ae);if(le)for(const{edgeId:ge}of le.values()){const Oe=X.get(ge);Oe&&(Oe.selectable??_e)&&A.current.add(ge)}}if(!Iae(Ee,R.current)){const ae=Ux(Y,R.current,!0);ee(ae)}if(!Iae(Qe,A.current)){const ae=Ux(X,A.current);be(ae)}y.setState({userSelectionRect:Pe,userSelectionActive:!0,nodesSelectionActive:!1})}function q(){if(!r||!T.current)return;const[W,G]=JW(P.current,T.current,C);S({x:W,y:G}).then(H=>{if(!N.current||!H){v.current=requestAnimationFrame(q);return}const{x:se,y:Y}=P.current;z(se,Y),v.current=requestAnimationFrame(q)})}const U=()=>{cancelAnimationFrame(v.current),v.current=0,I.current=!1};p.useEffect(()=>()=>U(),[]);const J=W=>{const{userSelectionRect:G,transform:H,resetSelectedElements:se}=y.getState();if(!T.current||!G)return;const{x:Y,y:X}=ff(W.nativeEvent,T.current);P.current={x:Y,y:X};const ie=k1({x:G.startX,y:G.startY},H);if(!N.current){const ee=t?0:s;if(Math.hypot(Y-ie.x,X-ie.y)<=ee)return;se(),l==null||l(W)}N.current=!0,I.current||(q(),I.current=!0),z(Y,X)},V=W=>{var G,H;W.button===0&&((H=(G=W.target)==null?void 0:G.releasePointerCapture)==null||H.call(G,W.pointerId),!w&&W.target===j.current&&y.getState().userSelectionRect&&(D==null||D(W)),y.setState({userSelectionActive:!1,userSelectionRect:null}),N.current&&(c==null||c(W),y.setState({nodesSelectionActive:R.current.size>0})),U())},Z=W=>{var G,H;(H=(G=W.target)==null?void 0:G.releasePointerCapture)==null||H.call(G,W.pointerId),U()},ne=i===!0||Array.isArray(i)&&i.includes(0);return a.jsxs("div",{className:eo(["react-flow__pane",{draggable:ne,dragging:O,selection:e}]),onClick:E?void 0:e6(D,j),onContextMenu:e6(_,j),onWheel:e6(L,j),onPointerEnter:E?void 0:h,onPointerMove:E?J:m,onPointerUp:E?V:void 0,onPointerCancel:E?Z:void 0,onPointerDownCapture:E?M:void 0,onClickCapture:E?F:void 0,onPointerLeave:g,ref:j,style:AL,children:[b,a.jsx(vHt,{})]})}function F7({id:e,store:t,unselect:n=!1,nodeRef:i}){const{addSelectedNodes:r,unselectNodesAndEdges:s,multiSelectionActive:o,nodeLookup:l,onError:c}=t.getState(),u=l.get(e);if(!u){c==null||c("012",Sf.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&o)&&(s({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var d;return(d=i==null?void 0:i.current)==null?void 0:d.blur()})):r([e])}function eBe({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:i,nodeId:r,isSelectable:s,nodeClickDistance:o}){const l=Hs(),[c,u]=p.useState(!1),d=p.useRef();return p.useEffect(()=>{d.current=hVt({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{F7({id:f,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),p.useEffect(()=>{if(!(t||!e.current||!d.current))return d.current.update({noDragClassName:n,handleSelector:i,domNode:e.current,isSelectable:s,nodeId:r,nodeClickDistance:o}),()=>{var f;(f=d.current)==null||f.destroy()}},[n,i,t,s,e,r,o]),c}const OHt=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function tBe(){const e=Hs();return p.useCallback(n=>{const{nodeExtent:i,snapToGrid:r,snapGrid:s,nodesDraggable:o,onError:l,updateNodePositions:c,nodeLookup:u,nodeOrigin:d}=e.getState(),f=new Map,h=OHt(o),m=r?s[0]:5,g=r?s[1]:5,b=n.direction.x*m*n.factor,v=n.direction.y*g*n.factor;for(const[,y]of u){if(!h(y))continue;let w={x:y.internals.positionAbsolute.x+b,y:y.internals.positionAbsolute.y+v};r&&(w=FT(w,s));const{position:x,positionAbsolute:O}=w8e({nodeId:y.id,nextPosition:w,nodeLookup:u,nodeExtent:i,nodeOrigin:d,onError:l});y.position=x,y.internals.positionAbsolute=O,f.set(y.id,y)}c(f)},[])}const lK=p.createContext(null),kHt=lK.Provider;lK.Consumer;const nBe=()=>p.useContext(lK),SHt=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),EHt=(e,t,n)=>i=>{const{connectionClickStartHandle:r,connectionMode:s,connection:o}=i,{fromHandle:l,toHandle:c,isValid:u}=o,d=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:d,clickConnecting:(r==null?void 0:r.nodeId)===e&&(r==null?void 0:r.id)===t&&(r==null?void 0:r.type)===n,isPossibleEndHandle:s===x1.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!r,valid:d&&u}};function CHt({type:e="source",position:t=xn.Top,isValidConnection:n,isConnectable:i=!0,isConnectableStart:r=!0,isConnectableEnd:s=!0,id:o,onConnect:l,children:c,className:u,onMouseDown:d,onTouchStart:f,...h},m){var I,D;const g=o||null,b=e==="target",v=Hs(),y=nBe(),{connectOnClick:w,noPanClassName:x,rfId:O}=ir(SHt,Vs),{connectingFrom:k,connectingTo:S,clickConnecting:C,isPossibleEndHandle:E,connectionInProcess:j,clickConnectionInProcess:T,valid:R}=ir(EHt(y,g,e),Vs);y||(D=(I=v.getState()).onError)==null||D.call(I,"010",Sf.error010());const A=_=>{const{defaultEdgeOptions:L,onConnect:F,hasDefaultEdges:M}=v.getState(),z={...L,..._};if(M){const{edges:q,setEdges:U,onError:J}=v.getState();U(aHt(z,q,{onError:J}))}F==null||F(z),l==null||l(z)},N=_=>{if(!y)return;const L=T8e(_.nativeEvent);if(r&&(L&&_.button===0||!L)){const F=v.getState();$7.onPointerDown(_.nativeEvent,{handleDomNode:_.currentTarget,autoPanOnConnect:F.autoPanOnConnect,connectionMode:F.connectionMode,connectionRadius:F.connectionRadius,domNode:F.domNode,nodeLookup:F.nodeLookup,lib:F.lib,isTarget:b,handleId:g,nodeId:y,flowId:F.rfId,panBy:F.panBy,cancelConnection:F.cancelConnection,onConnectStart:F.onConnectStart,onConnectEnd:(...M)=>{var z,q;return(q=(z=v.getState()).onConnectEnd)==null?void 0:q.call(z,...M)},updateConnection:F.updateConnection,onConnect:A,isValidConnection:n||((...M)=>{var z,q;return((q=(z=v.getState()).isValidConnection)==null?void 0:q.call(z,...M))??!0}),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:F.autoPanSpeed,dragThreshold:F.connectionDragThreshold})}L?d==null||d(_):f==null||f(_)},P=_=>{const{onClickConnectStart:L,onClickConnectEnd:F,connectionClickStartHandle:M,connectionMode:z,isValidConnection:q,lib:U,rfId:J,nodeLookup:V,connection:Z}=v.getState();if(!y||!M&&!r)return;if(!M){L==null||L(_.nativeEvent,{nodeId:y,handleId:g,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:y,type:e,id:g}});return}const ne=C8e(_.target),W=n||q,{connection:G,isValid:H}=$7.isValid(_.nativeEvent,{handle:{nodeId:y,id:g,type:e},connectionMode:z,fromNodeId:M.nodeId,fromHandleId:M.id||null,fromType:M.type,isValidConnection:W,flowId:J,doc:ne,lib:U,nodeLookup:V});H&&G&&A(G);const se=structuredClone(Z);delete se.inProgress,se.toPosition=se.toHandle?se.toHandle.position:null,F==null||F(_,se),v.setState({connectionClickStartHandle:null})};return a.jsx("div",{"data-handleid":g,"data-nodeid":y,"data-handlepos":t,"data-id":`${O}-${y}-${g}-${e}`,className:eo(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",x,u,{source:!b,target:b,connectable:i,connectablestart:r,connectableend:s,clickconnecting:C,connectingfrom:k,connectingto:S,valid:R,connectionindicator:i&&(!j||E)&&(j||T?s:r)}]),onMouseDown:N,onTouchStart:N,onClick:w?P:void 0,ref:m,...h,children:c})}const $c=p.memo(Z8e(CHt));function AHt({data:e,isConnectable:t,sourcePosition:n=xn.Bottom}){return a.jsxs(a.Fragment,{children:[e==null?void 0:e.label,a.jsx($c,{type:"source",position:n,isConnectable:t})]})}function THt({data:e,isConnectable:t,targetPosition:n=xn.Top,sourcePosition:i=xn.Bottom}){return a.jsxs(a.Fragment,{children:[a.jsx($c,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,a.jsx($c,{type:"source",position:i,isConnectable:t})]})}function _Ht(){return null}function jHt({data:e,isConnectable:t,targetPosition:n=xn.Top}){return a.jsxs(a.Fragment,{children:[a.jsx($c,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const TP={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},soe={input:AHt,default:THt,output:jHt,group:_Ht};function NHt(e){var t,n,i,r;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((i=e.style)==null?void 0:i.width),height:e.height??((r=e.style)==null?void 0:r.height)}}const RHt=e=>{const{width:t,height:n,x:i,y:r}=$T(e.nodeLookup,{filter:s=>!!s.selected});return{width:df(t)?t:null,height:df(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${i}px,${r}px)`}};function IHt({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const i=Hs(),{width:r,height:s,transformString:o,userSelectionActive:l}=ir(RHt,Vs),c=tBe(),u=p.useRef(null);p.useEffect(()=>{var m;n||(m=u.current)==null||m.focus({preventScroll:!0})},[n]);const d=!l&&r!==null&&s!==null;if(eBe({nodeRef:u,disabled:!d}),!d)return null;const f=e?m=>{const g=i.getState().nodes.filter(b=>b.selected);e(m,g)}:void 0,h=m=>{Object.prototype.hasOwnProperty.call(TP,m.key)&&(m.preventDefault(),c({direction:TP[m.key],factor:m.shiftKey?4:1}))};return a.jsx("div",{className:eo(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:a.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:r,height:s}})})}const aoe=typeof window<"u"?window:void 0,PHt=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function iBe({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:o,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:d,selectionMode:f,onSelectionStart:h,onSelectionEnd:m,multiSelectionKeyCode:g,panActivationKeyCode:b,zoomActivationKeyCode:v,elementsSelectable:y,zoomOnScroll:w,zoomOnPinch:x,panOnScroll:O,panOnScrollSpeed:k,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:E,autoPanOnSelection:j,defaultViewport:T,translateExtent:R,minZoom:A,maxZoom:N,preventScrolling:P,onSelectionContextMenu:I,noWheelClassName:D,noPanClassName:_,disableKeyboardA11y:L,onViewportChange:F,isControlledViewport:M}){const{nodesSelectionActive:z,userSelectionActive:q}=ir(PHt,Vs),U=aA(u,{target:aoe}),J=aA(b,{target:aoe}),V=J||E,Z=J||O,ne=d&&V!==!0,W=U||q||ne;return pHt({deleteKeyCode:c,multiSelectionKeyCode:g}),a.jsx(bHt,{onPaneContextMenu:s,elementsSelectable:y,zoomOnScroll:w,zoomOnPinch:x,panOnScroll:Z,panOnScrollSpeed:k,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:!U&&V,defaultViewport:T,translateExtent:R,minZoom:A,maxZoom:N,zoomActivationKeyCode:v,preventScrolling:P,noWheelClassName:D,noPanClassName:_,onViewportChange:F,isControlledViewport:M,paneClickDistance:l,selectionOnDrag:ne,children:a.jsxs(wHt,{onSelectionStart:h,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:o,panOnDrag:V,autoPanOnSelection:j,isSelecting:!!W,selectionMode:f,selectionKeyPressed:U,paneClickDistance:l,selectionOnDrag:ne,children:[e,z&&a.jsx(IHt,{onSelectionContextMenu:I,noPanClassName:_,disableKeyboardA11y:L})]})})}iBe.displayName="FlowRenderer";const DHt=p.memo(iBe),MHt=e=>t=>e?ZW(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function LHt(e){return ir(p.useCallback(MHt(e),[e]),Vs)}const $Ht=e=>e.updateNodeInternals;function FHt(){const e=ir($Ht),[t]=p.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const i=new Map;n.forEach(r=>{const s=r.target.getAttribute("data-id");i.set(s,{id:s,nodeElement:r.target,force:!0})}),e(i)}));return p.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function BHt({node:e,nodeType:t,hasDimensions:n,resizeObserver:i}){const r=Hs(),s=p.useRef(null),o=p.useRef(null),l=p.useRef(e.sourcePosition),c=p.useRef(e.targetPosition),u=p.useRef(t),d=n&&!!e.internals.handleBounds;return p.useEffect(()=>{s.current&&!e.hidden&&(!d||o.current!==s.current)&&(o.current&&(i==null||i.unobserve(o.current)),i==null||i.observe(s.current),o.current=s.current)},[d,e.hidden]),p.useEffect(()=>()=>{o.current&&(i==null||i.unobserve(o.current),o.current=null)},[]),p.useEffect(()=>{if(s.current){const f=u.current!==t,h=l.current!==e.sourcePosition,m=c.current!==e.targetPosition;(f||h||m)&&(u.current=t,l.current=e.sourcePosition,c.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:s.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),s}function UHt({id:e,onClick:t,onMouseEnter:n,onMouseMove:i,onMouseLeave:r,onContextMenu:s,onDoubleClick:o,nodesDraggable:l,elementsSelectable:c,nodesConnectable:u,nodesFocusable:d,resizeObserver:f,noDragClassName:h,noPanClassName:m,disableKeyboardA11y:g,rfId:b,nodeTypes:v,nodeClickDistance:y,onError:w}){const{node:x,internals:O,isParent:k}=ir(W=>{const G=W.nodeLookup.get(e),H=W.parentLookup.has(e);return{node:G,internals:G.internals,isParent:H}},Vs);let S=x.type||"default",C=(v==null?void 0:v[S])||soe[S];C===void 0&&(w==null||w("003",Sf.error003(S)),S="default",C=(v==null?void 0:v.default)||soe.default);const E=!!(x.draggable||l&&typeof x.draggable>"u"),j=!!(x.selectable||c&&typeof x.selectable>"u"),T=!!(x.connectable||u&&typeof x.connectable>"u"),R=!!(x.focusable||d&&typeof x.focusable>"u"),A=Hs(),N=tK(x),P=BHt({node:x,nodeType:S,hasDimensions:N,resizeObserver:f}),I=eBe({nodeRef:P,disabled:x.hidden||!E,noDragClassName:h,handleSelector:x.dragHandle,nodeId:e,isSelectable:j,nodeClickDistance:y}),D=tBe();if(x.hidden)return null;const _=Om(x),L=NHt(x),F=j||E||t||n||i||r,M=n?W=>n(W,{...O.userNode}):void 0,z=i?W=>i(W,{...O.userNode}):void 0,q=r?W=>r(W,{...O.userNode}):void 0,U=s?W=>s(W,{...O.userNode}):void 0,J=o?W=>o(W,{...O.userNode}):void 0,V=W=>{const{selectNodesOnDrag:G,nodeDragThreshold:H}=A.getState();j&&(!G||!E||H>0)&&F7({id:e,store:A,nodeRef:P}),t&&t(W,{...O.userNode})},Z=W=>{if(!(A8e(W.nativeEvent)||g)){if(g8e.includes(W.key)&&j){const G=W.key==="Escape";F7({id:e,store:A,unselect:G,nodeRef:P})}else if(E&&x.selected&&Object.prototype.hasOwnProperty.call(TP,W.key)){W.preventDefault();const{ariaLabelConfig:G}=A.getState();A.setState({ariaLiveMessage:G["node.a11yDescription.ariaLiveMessage"]({direction:W.key.replace("Arrow","").toLowerCase(),x:~~O.positionAbsolute.x,y:~~O.positionAbsolute.y})}),D({direction:TP[W.key],factor:W.shiftKey?4:1})}}},ne=()=>{var ie;if(g||!((ie=P.current)!=null&&ie.matches(":focus-visible")))return;const{transform:W,width:G,height:H,autoPanOnNodeFocus:se,setCenter:Y}=A.getState();if(!se)return;ZW(new Map([[e,x]]),{x:0,y:0,width:G,height:H},W,!0).length>0||Y(x.position.x+_.width/2,x.position.y+_.height/2,{zoom:W[2]})};return a.jsx("div",{className:eo(["react-flow__node",`react-flow__node-${S}`,{[m]:E},x.className,{selected:x.selected,selectable:j,parent:k,draggable:E,dragging:I}]),ref:P,style:{zIndex:O.z,transform:`translate(${O.positionAbsolute.x}px,${O.positionAbsolute.y}px)`,pointerEvents:F?"all":"none",visibility:N?"visible":"hidden",...x.style,...L},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:M,onMouseMove:z,onMouseLeave:q,onContextMenu:U,onClick:V,onDoubleClick:J,onKeyDown:R?Z:void 0,tabIndex:R?0:void 0,onFocus:R?ne:void 0,role:x.ariaRole??(R?"group":void 0),"aria-roledescription":"node","aria-describedby":g?void 0:`${q8e}-${b}`,"aria-label":x.ariaLabel,...x.domAttributes,children:a.jsx(kHt,{value:e,children:a.jsx(C,{id:e,data:x.data,type:S,positionAbsoluteX:O.positionAbsolute.x,positionAbsoluteY:O.positionAbsolute.y,selected:x.selected??!1,selectable:j,draggable:E,deletable:x.deletable??!0,isConnectable:T,sourcePosition:x.sourcePosition,targetPosition:x.targetPosition,dragging:I,dragHandle:x.dragHandle,zIndex:O.z,parentId:x.parentId,..._})})})}var QHt=p.memo(UHt);const zHt=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function rBe(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:r,onError:s}=ir(zHt,Vs),o=LHt(e.onlyRenderVisibleElements),l=FHt();return a.jsx("div",{className:"react-flow__nodes",style:AL,children:o.map(c=>a.jsx(QHt,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:s},c))})}rBe.displayName="NodeRenderer";const VHt=p.memo(rBe);function HHt(e){return ir(p.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const i=[];if(n.width&&n.height)for(const r of n.edges){const s=n.nodeLookup.get(r.source),o=n.nodeLookup.get(r.target);s&&o&&Kzt({sourceNode:s,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&i.push(r.id)}return i},[e]),Vs)}const qHt=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return a.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},WHt=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return a.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},ooe={[iA.Arrow]:qHt,[iA.ArrowClosed]:WHt};function KHt(e){const t=Hs();return p.useMemo(()=>{var r,s;return Object.prototype.hasOwnProperty.call(ooe,e)?ooe[e]:((s=(r=t.getState()).onError)==null||s.call(r,"009",Sf.error009(e)),null)},[e])}const GHt=({id:e,type:t,color:n,width:i=12.5,height:r=12.5,markerUnits:s="strokeWidth",strokeWidth:o,orient:l="auto-start-reverse"})=>{const c=KHt(t);return c?a.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${i}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:l,refX:"0",refY:"0",children:a.jsx(c,{color:n,strokeWidth:o})}):null},sBe=({defaultColor:e,rfId:t})=>{const n=ir(s=>s.edges),i=ir(s=>s.defaultEdgeOptions),r=p.useMemo(()=>nVt(n,{id:t,defaultColor:e,defaultMarkerStart:i==null?void 0:i.markerStart,defaultMarkerEnd:i==null?void 0:i.markerEnd}),[n,i,t,e]);return r.length?a.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:a.jsx("defs",{children:r.map(s=>a.jsx(GHt,{id:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient},s.id))})}):null};sBe.displayName="MarkerDefinitions";var XHt=p.memo(sBe);function aBe({x:e,y:t,label:n,labelStyle:i,labelShowBg:r=!0,labelBgStyle:s,labelBgPadding:o=[2,4],labelBgBorderRadius:l=2,children:c,className:u,...d}){const[f,h]=p.useState({x:1,y:0,width:0,height:0}),m=eo(["react-flow__edge-textwrapper",u]),g=p.useRef(null);return p.useEffect(()=>{if(g.current){const b=g.current.getBBox();h({x:b.x,y:b.y,width:b.width,height:b.height})}},[n]),n?a.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:m,visibility:f.width?"visible":"hidden",...d,children:[r&&a.jsx("rect",{width:f.width+2*o[0],x:-o[0],y:-o[1],height:f.height+2*o[1],className:"react-flow__edge-textbg",style:s,rx:l,ry:l}),a.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:g,style:i,children:n}),c]}):null}aBe.displayName="EdgeText";const YHt=p.memo(aBe);function BT({path:e,labelX:t,labelY:n,label:i,labelStyle:r,labelShowBg:s,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:u=20,...d}){return a.jsxs(a.Fragment,{children:[a.jsx("path",{...d,d:e,fill:"none",className:eo(["react-flow__edge-path",d.className])}),u?a.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,i&&df(t)&&df(n)?a.jsx(YHt,{x:t,y:n,label:i,labelStyle:r,labelShowBg:s,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function loe({pos:e,x1:t,y1:n,x2:i,y2:r}){return e===xn.Left||e===xn.Right?[.5*(t+i),n]:[t,.5*(n+r)]}function oBe({sourceX:e,sourceY:t,sourcePosition:n=xn.Bottom,targetX:i,targetY:r,targetPosition:s=xn.Top}){const[o,l]=loe({pos:n,x1:e,y1:t,x2:i,y2:r}),[c,u]=loe({pos:s,x1:i,y1:r,x2:e,y2:t}),[d,f,h,m]=_8e({sourceX:e,sourceY:t,targetX:i,targetY:r,sourceControlX:o,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${o},${l} ${c},${u} ${i},${r}`,d,f,h,m]}function lBe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:o,targetPosition:l,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,interactionWidth:y})=>{const[w,x,O]=oBe({sourceX:n,sourceY:i,sourcePosition:o,targetX:r,targetY:s,targetPosition:l}),k=e.isInternal?void 0:t;return a.jsx(BT,{id:k,path:w,labelX:x,labelY:O,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,interactionWidth:y})})}const ZHt=lBe({isInternal:!1}),cBe=lBe({isInternal:!0});ZHt.displayName="SimpleBezierEdge";cBe.displayName="SimpleBezierEdgeInternal";function uBe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,sourcePosition:m=xn.Bottom,targetPosition:g=xn.Top,markerEnd:b,markerStart:v,pathOptions:y,interactionWidth:w})=>{const[x,O,k]=AP({sourceX:n,sourceY:i,sourcePosition:m,targetX:r,targetY:s,targetPosition:g,borderRadius:y==null?void 0:y.borderRadius,offset:y==null?void 0:y.offset,stepPosition:y==null?void 0:y.stepPosition}),S=e.isInternal?void 0:t;return a.jsx(BT,{id:S,path:x,labelX:O,labelY:k,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:b,markerStart:v,interactionWidth:w})})}const dBe=uBe({isInternal:!1}),fBe=uBe({isInternal:!0});dBe.displayName="SmoothStepEdge";fBe.displayName="SmoothStepEdgeInternal";function hBe(e){return p.memo(({id:t,...n})=>{var r;const i=e.isInternal?void 0:t;return a.jsx(dBe,{...n,id:i,pathOptions:p.useMemo(()=>{var s;return{borderRadius:0,offset:(s=n.pathOptions)==null?void 0:s.offset}},[(r=n.pathOptions)==null?void 0:r.offset])})})}const JHt=hBe({isInternal:!1}),pBe=hBe({isInternal:!0});JHt.displayName="StepEdge";pBe.displayName="StepEdgeInternal";function mBe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:m,markerStart:g,interactionWidth:b})=>{const[v,y,w]=R8e({sourceX:n,sourceY:i,targetX:r,targetY:s}),x=e.isInternal?void 0:t;return a.jsx(BT,{id:x,path:v,labelX:y,labelY:w,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:m,markerStart:g,interactionWidth:b})})}const eqt=mBe({isInternal:!1}),gBe=mBe({isInternal:!0});eqt.displayName="StraightEdge";gBe.displayName="StraightEdgeInternal";function bBe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:o=xn.Bottom,targetPosition:l=xn.Top,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,pathOptions:y,interactionWidth:w})=>{const[x,O,k]=j8e({sourceX:n,sourceY:i,sourcePosition:o,targetX:r,targetY:s,targetPosition:l,curvature:y==null?void 0:y.curvature}),S=e.isInternal?void 0:t;return a.jsx(BT,{id:S,path:x,labelX:O,labelY:k,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,interactionWidth:w})})}const tqt=bBe({isInternal:!1}),yBe=bBe({isInternal:!0});tqt.displayName="BezierEdge";yBe.displayName="BezierEdgeInternal";const coe={default:yBe,straight:gBe,step:pBe,smoothstep:fBe,simplebezier:cBe},uoe={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},nqt=(e,t,n)=>n===xn.Left?e-t:n===xn.Right?e+t:e,iqt=(e,t,n)=>n===xn.Top?e-t:n===xn.Bottom?e+t:e,doe="react-flow__edgeupdater";function foe({position:e,centerX:t,centerY:n,radius:i=10,onMouseDown:r,onMouseEnter:s,onMouseOut:o,type:l}){return a.jsx("circle",{onMouseDown:r,onMouseEnter:s,onMouseOut:o,className:eo([doe,`${doe}-${l}`]),cx:nqt(t,i,e),cy:iqt(n,i,e),r:i,stroke:"transparent",fill:"transparent"})}function rqt({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:i,sourceY:r,targetX:s,targetY:o,sourcePosition:l,targetPosition:c,onReconnect:u,onReconnectStart:d,onReconnectEnd:f,setReconnecting:h,setUpdateHover:m}){const g=Hs(),b=(O,k)=>{if(O.button!==0)return;const{autoPanOnConnect:S,domNode:C,connectionMode:E,connectionRadius:j,lib:T,onConnectStart:R,cancelConnection:A,nodeLookup:N,rfId:P,panBy:I,updateConnection:D}=g.getState(),_=k.type==="target",L=(z,q)=>{h(!1),f==null||f(z,n,k.type,q)},F=z=>u==null?void 0:u(n,z),M=(z,q)=>{h(!0),d==null||d(O,n,k.type),R==null||R(z,q)};$7.onPointerDown(O.nativeEvent,{autoPanOnConnect:S,connectionMode:E,connectionRadius:j,domNode:C,handleId:k.id,nodeId:k.nodeId,nodeLookup:N,isTarget:_,edgeUpdaterType:k.type,lib:T,flowId:P,cancelConnection:A,panBy:I,isValidConnection:(...z)=>{var q,U;return((U=(q=g.getState()).isValidConnection)==null?void 0:U.call(q,...z))??!0},onConnect:F,onConnectStart:M,onConnectEnd:(...z)=>{var q,U;return(U=(q=g.getState()).onConnectEnd)==null?void 0:U.call(q,...z)},onReconnectEnd:L,updateConnection:D,getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,dragThreshold:g.getState().connectionDragThreshold,handleDomNode:O.currentTarget})},v=O=>b(O,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),y=O=>b(O,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),w=()=>m(!0),x=()=>m(!1);return a.jsxs(a.Fragment,{children:[(e===!0||e==="source")&&a.jsx(foe,{position:l,centerX:i,centerY:r,radius:t,onMouseDown:v,onMouseEnter:w,onMouseOut:x,type:"source"}),(e===!0||e==="target")&&a.jsx(foe,{position:c,centerX:s,centerY:o,radius:t,onMouseDown:y,onMouseEnter:w,onMouseOut:x,type:"target"})]})}function sqt({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:i,onClick:r,onDoubleClick:s,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:m,rfId:g,edgeTypes:b,noPanClassName:v,onError:y,disableKeyboardA11y:w}){let x=ir(Y=>Y.edgeLookup.get(e));const O=ir(Y=>Y.defaultEdgeOptions);x=O?{...O,...x}:x;let k=x.type||"default",S=(b==null?void 0:b[k])||coe[k];S===void 0&&(y==null||y("011",Sf.error011(k)),k="default",S=(b==null?void 0:b.default)||coe.default);const C=!!(x.focusable||t&&typeof x.focusable>"u"),E=typeof f<"u"&&(x.reconnectable||n&&typeof x.reconnectable>"u"),j=!!(x.selectable||i&&typeof x.selectable>"u"),T=p.useRef(null),[R,A]=p.useState(!1),[N,P]=p.useState(!1),I=Hs(),{zIndex:D,sourceX:_,sourceY:L,targetX:F,targetY:M,sourcePosition:z,targetPosition:q}=ir(p.useCallback(Y=>{const X=Y.nodeLookup.get(x.source),ie=Y.nodeLookup.get(x.target);if(!X||!ie)return{zIndex:x.zIndex,...uoe};const ee=tVt({id:e,sourceNode:X,targetNode:ie,sourceHandle:x.sourceHandle||null,targetHandle:x.targetHandle||null,connectionMode:Y.connectionMode,onError:y});return{zIndex:Wzt({selected:x.selected,zIndex:x.zIndex,sourceNode:X,targetNode:ie,elevateOnSelect:Y.elevateEdgesOnSelect,zIndexMode:Y.zIndexMode}),...ee||uoe}},[x.source,x.target,x.sourceHandle,x.targetHandle,x.selected,x.zIndex]),Vs),U=p.useMemo(()=>x.markerStart?`url('#${M7(x.markerStart,g)}')`:void 0,[x.markerStart,g]),J=p.useMemo(()=>x.markerEnd?`url('#${M7(x.markerEnd,g)}')`:void 0,[x.markerEnd,g]);if(x.hidden||_===null||L===null||F===null||M===null)return null;const V=Y=>{var be;const{addSelectedEdges:X,unselectNodesAndEdges:ie,multiSelectionActive:ee}=I.getState();j&&(I.setState({nodesSelectionActive:!1}),x.selected&&ee?(ie({nodes:[],edges:[x]}),(be=T.current)==null||be.blur()):X([e])),r&&r(Y,x)},Z=s?Y=>{s(Y,{...x})}:void 0,ne=o?Y=>{o(Y,{...x})}:void 0,W=l?Y=>{l(Y,{...x})}:void 0,G=c?Y=>{c(Y,{...x})}:void 0,H=u?Y=>{u(Y,{...x})}:void 0,se=Y=>{var X;if(!w&&g8e.includes(Y.key)&&j){const{unselectNodesAndEdges:ie,addSelectedEdges:ee}=I.getState();Y.key==="Escape"?((X=T.current)==null||X.blur(),ie({edges:[x]})):ee([e])}};return a.jsx("svg",{style:{zIndex:D},children:a.jsxs("g",{className:eo(["react-flow__edge",`react-flow__edge-${k}`,x.className,v,{selected:x.selected,animated:x.animated,inactive:!j&&!r,updating:R,selectable:j}]),onClick:V,onDoubleClick:Z,onContextMenu:ne,onMouseEnter:W,onMouseMove:G,onMouseLeave:H,onKeyDown:C?se:void 0,tabIndex:C?0:void 0,role:x.ariaRole??(C?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":x.ariaLabel===null?void 0:x.ariaLabel||`Edge from ${x.source} to ${x.target}`,"aria-describedby":C?`${W8e}-${g}`:void 0,ref:T,...x.domAttributes,children:[!N&&a.jsx(S,{id:e,source:x.source,target:x.target,type:x.type,selected:x.selected,animated:x.animated,selectable:j,deletable:x.deletable??!0,label:x.label,labelStyle:x.labelStyle,labelShowBg:x.labelShowBg,labelBgStyle:x.labelBgStyle,labelBgPadding:x.labelBgPadding,labelBgBorderRadius:x.labelBgBorderRadius,sourceX:_,sourceY:L,targetX:F,targetY:M,sourcePosition:z,targetPosition:q,data:x.data,style:x.style,sourceHandleId:x.sourceHandle,targetHandleId:x.targetHandle,markerStart:U,markerEnd:J,pathOptions:"pathOptions"in x?x.pathOptions:void 0,interactionWidth:x.interactionWidth}),E&&a.jsx(rqt,{edge:x,isReconnectable:E,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:m,sourceX:_,sourceY:L,targetX:F,targetY:M,sourcePosition:z,targetPosition:q,setUpdateHover:A,setReconnecting:P})]})})}var aqt=p.memo(sqt);const oqt=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function vBe({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:i,noPanClassName:r,onReconnect:s,onEdgeContextMenu:o,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:f,onEdgeDoubleClick:h,onReconnectStart:m,onReconnectEnd:g,disableKeyboardA11y:b}){const{edgesFocusable:v,edgesReconnectable:y,elementsSelectable:w,onError:x}=ir(oqt,Vs),O=HHt(t);return a.jsxs("div",{className:"react-flow__edges",children:[a.jsx(XHt,{defaultColor:e,rfId:n}),O.map(k=>a.jsx(aqt,{id:k,edgesFocusable:v,edgesReconnectable:y,elementsSelectable:w,noPanClassName:r,onReconnect:s,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,reconnectRadius:f,onDoubleClick:h,onReconnectStart:m,onReconnectEnd:g,rfId:n,onError:x,edgeTypes:i,disableKeyboardA11y:b},k))]})}vBe.displayName="EdgeRenderer";const lqt=p.memo(vBe),cqt=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function uqt({children:e}){const t=ir(cqt);return a.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function dqt(e){const t=CL(),n=p.useRef(!1);p.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const fqt=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function hqt(e){const t=ir(fqt),n=Hs();return p.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function pqt(e){return e.connection.inProgress?{...e.connection,to:yO(e.connection.to,e.transform)}:{...e.connection}}function mqt(e){return pqt}function gqt(e){const t=mqt();return ir(t,Vs)}const bqt=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function yqt({containerStyle:e,style:t,type:n,component:i}){const{nodesConnectable:r,width:s,height:o,isValid:l,inProgress:c}=ir(bqt,Vs);return!(s&&r&&c)?null:a.jsx("svg",{style:e,width:s,height:o,className:"react-flow__connectionline react-flow__container",children:a.jsx("g",{className:eo(["react-flow__connection",v8e(l)]),children:a.jsx(xBe,{style:t,type:n,CustomComponent:i,isValid:l})})})}const xBe=({style:e,type:t=cg.Bezier,CustomComponent:n,isValid:i})=>{const{inProgress:r,from:s,fromNode:o,fromHandle:l,fromPosition:c,to:u,toNode:d,toHandle:f,toPosition:h,pointer:m}=gqt();if(!r)return;if(n)return a.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:l,fromX:s.x,fromY:s.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:h,connectionStatus:v8e(i),toNode:d,toHandle:f,pointer:m});let g="";const b={sourceX:s.x,sourceY:s.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:h};switch(t){case cg.Bezier:[g]=j8e(b);break;case cg.SimpleBezier:[g]=oBe(b);break;case cg.Step:[g]=AP({...b,borderRadius:0});break;case cg.SmoothStep:[g]=AP(b);break;default:[g]=R8e(b)}return a.jsx("path",{d:g,fill:"none",className:"react-flow__connection-path",style:e})};xBe.displayName="ConnectionLine";const vqt={};function hoe(e=vqt){p.useRef(e),Hs(),p.useEffect(()=>{},[e])}function xqt(){Hs(),p.useRef(!1),p.useEffect(()=>{},[])}function wBe({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:i,onEdgeClick:r,onNodeDoubleClick:s,onEdgeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:f,onSelectionStart:h,onSelectionEnd:m,connectionLineType:g,connectionLineStyle:b,connectionLineComponent:v,connectionLineContainerStyle:y,selectionKeyCode:w,selectionOnDrag:x,selectionMode:O,multiSelectionKeyCode:k,panActivationKeyCode:S,zoomActivationKeyCode:C,deleteKeyCode:E,onlyRenderVisibleElements:j,elementsSelectable:T,defaultViewport:R,translateExtent:A,minZoom:N,maxZoom:P,preventScrolling:I,defaultMarkerColor:D,zoomOnScroll:_,zoomOnPinch:L,panOnScroll:F,panOnScrollSpeed:M,panOnScrollMode:z,zoomOnDoubleClick:q,panOnDrag:U,autoPanOnSelection:J,onPaneClick:V,onPaneMouseEnter:Z,onPaneMouseMove:ne,onPaneMouseLeave:W,onPaneScroll:G,onPaneContextMenu:H,paneClickDistance:se,nodeClickDistance:Y,onEdgeContextMenu:X,onEdgeMouseEnter:ie,onEdgeMouseMove:ee,onEdgeMouseLeave:be,reconnectRadius:ue,onReconnect:pe,onReconnectStart:ke,onReconnectEnd:je,noDragClassName:Pe,noWheelClassName:Ee,noPanClassName:Qe,disableKeyboardA11y:_e,nodeExtent:ae,rfId:le,viewport:ge,onViewportChange:Oe}){return hoe(e),hoe(t),xqt(),dqt(n),hqt(ge),a.jsx(DHt,{onPaneClick:V,onPaneMouseEnter:Z,onPaneMouseMove:ne,onPaneMouseLeave:W,onPaneContextMenu:H,onPaneScroll:G,paneClickDistance:se,deleteKeyCode:E,selectionKeyCode:w,selectionOnDrag:x,selectionMode:O,onSelectionStart:h,onSelectionEnd:m,multiSelectionKeyCode:k,panActivationKeyCode:S,zoomActivationKeyCode:C,elementsSelectable:T,zoomOnScroll:_,zoomOnPinch:L,zoomOnDoubleClick:q,panOnScroll:F,panOnScrollSpeed:M,panOnScrollMode:z,panOnDrag:U,autoPanOnSelection:J,defaultViewport:R,translateExtent:A,minZoom:N,maxZoom:P,onSelectionContextMenu:f,preventScrolling:I,noDragClassName:Pe,noWheelClassName:Ee,noPanClassName:Qe,disableKeyboardA11y:_e,onViewportChange:Oe,isControlledViewport:!!ge,children:a.jsxs(uqt,{children:[a.jsx(lqt,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:o,onReconnect:pe,onReconnectStart:ke,onReconnectEnd:je,onlyRenderVisibleElements:j,onEdgeContextMenu:X,onEdgeMouseEnter:ie,onEdgeMouseMove:ee,onEdgeMouseLeave:be,reconnectRadius:ue,defaultMarkerColor:D,noPanClassName:Qe,disableKeyboardA11y:_e,rfId:le}),a.jsx(yqt,{style:b,type:g,component:v,containerStyle:y}),a.jsx("div",{className:"react-flow__edgelabel-renderer"}),a.jsx(VHt,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:Y,onlyRenderVisibleElements:j,noPanClassName:Qe,noDragClassName:Pe,disableKeyboardA11y:_e,nodeExtent:ae,rfId:le}),a.jsx("div",{className:"react-flow__viewport-portal"})]})})}wBe.displayName="GraphView";const wqt=p.memo(wBe),Oqt=S8e(),poe=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:o,fitViewOptions:l,minZoom:c=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:f,zIndexMode:h="basic"}={})=>{const m=new Map,g=new Map,b=new Map,v=new Map,y=i??t??[],w=n??e??[],x=d??[0,0],O=f??tA;D8e(b,v,y);const{nodesInitialized:k}=L7(w,m,g,{nodeOrigin:x,nodeExtent:O,zIndexMode:h});let S=[0,0,1];if(o&&r&&s){const C=$T(m,{filter:R=>!!((R.width||R.initialWidth)&&(R.height||R.initialHeight))}),{x:E,y:j,zoom:T}=eK(C,r,s,c,u,(l==null?void 0:l.padding)??.1);S=[E,j,T]}return{rfId:"1",width:r??0,height:s??0,transform:S,nodes:w,nodesInitialized:k,nodeLookup:m,parentLookup:g,edges:y,edgeLookup:v,connectionLookup:b,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:i!==void 0,panZoom:null,minZoom:c,maxZoom:u,translateExtent:tA,nodeExtent:O,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:x1.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:x,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:l,fitViewResolver:null,connection:{...y8e},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Oqt,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:b8e,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},kqt=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h})=>$Vt((m,g)=>{async function b(){const{nodeLookup:v,panZoom:y,fitViewOptions:w,fitViewResolver:x,width:O,height:k,minZoom:S,maxZoom:C}=g();y&&(await Bzt({nodes:v,width:O,height:k,panZoom:y,minZoom:S,maxZoom:C},w),x==null||x.resolve(!0),m({fitViewResolver:null}))}return{...poe({nodes:e,edges:t,width:r,height:s,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,defaultNodes:n,defaultEdges:i,zIndexMode:h}),setNodes:v=>{const{nodeLookup:y,parentLookup:w,nodeOrigin:x,elevateNodesOnSelect:O,fitViewQueued:k,zIndexMode:S,nodesSelectionActive:C}=g(),{nodesInitialized:E,hasSelectedNodes:j}=L7(v,y,w,{nodeOrigin:x,nodeExtent:f,elevateNodesOnSelect:O,checkEquality:!0,zIndexMode:S}),T=C&&j;k&&E?(b(),m({nodes:v,nodesInitialized:E,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:T})):m({nodes:v,nodesInitialized:E,nodesSelectionActive:T})},setEdges:v=>{const{connectionLookup:y,edgeLookup:w}=g();D8e(y,w,v),m({edges:v})},setDefaultNodesAndEdges:(v,y)=>{if(v){const{setNodes:w}=g();w(v),m({hasDefaultNodes:!0})}if(y){const{setEdges:w}=g();w(y),m({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:y,nodeLookup:w,parentLookup:x,domNode:O,nodeOrigin:k,nodeExtent:S,debug:C,fitViewQueued:E,zIndexMode:j}=g(),{changes:T,updatedInternals:R}=cVt(v,w,x,O,k,S,j);R&&(sVt(w,x,{nodeOrigin:k,nodeExtent:S,zIndexMode:j}),E?(b(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),(T==null?void 0:T.length)>0&&(C&&console.log("React Flow: trigger node changes",T),y==null||y(T)))},updateNodePositions:(v,y=!1)=>{const w=[];let x=[];const{nodeLookup:O,triggerNodeChanges:k,connection:S,updateConnection:C,onNodesChangeMiddlewareMap:E}=g();for(const[j,T]of v){const R=O.get(j),A=!!(R!=null&&R.expandParent&&(R!=null&&R.parentId)&&(T!=null&&T.position)),N={id:j,type:"position",position:A?{x:Math.max(0,T.position.x),y:Math.max(0,T.position.y)}:T.position,dragging:y};if(R&&S.inProgress&&S.fromNode.id===R.id){const P=T0(R,S.fromHandle,xn.Left,!0);C({...S,from:P})}A&&R.parentId&&w.push({id:j,parentId:R.parentId,rect:{...T.internals.positionAbsolute,width:T.measured.width??0,height:T.measured.height??0}}),x.push(N)}if(w.length>0){const{parentLookup:j,nodeOrigin:T}=g(),R=oK(w,O,j,T);x.push(...R)}for(const j of E.values())x=j(x);k(x)},triggerNodeChanges:v=>{const{onNodesChange:y,setNodes:w,nodes:x,hasDefaultNodes:O,debug:k}=g();if(v!=null&&v.length){if(O){const S=X8e(v,x);w(S)}k&&console.log("React Flow: trigger node changes",v),y==null||y(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:y,setEdges:w,edges:x,hasDefaultEdges:O,debug:k}=g();if(v!=null&&v.length){if(O){const S=Y8e(v,x);w(S)}k&&console.log("React Flow: trigger edge changes",v),y==null||y(v)}},addSelectedNodes:v=>{const{multiSelectionActive:y,edgeLookup:w,nodeLookup:x,triggerNodeChanges:O,triggerEdgeChanges:k}=g();if(y){const S=v.map(C=>my(C,!0));O(S);return}O(Ux(x,new Set([...v]),!0)),k(Ux(w))},addSelectedEdges:v=>{const{multiSelectionActive:y,edgeLookup:w,nodeLookup:x,triggerNodeChanges:O,triggerEdgeChanges:k}=g();if(y){const S=v.map(C=>my(C,!0));k(S);return}k(Ux(w,new Set([...v]))),O(Ux(x,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:y}={})=>{const{edges:w,nodes:x,nodeLookup:O,triggerNodeChanges:k,triggerEdgeChanges:S}=g(),C=v||x,E=y||w,j=[];for(const R of C){if(!R.selected)continue;const A=O.get(R.id);A&&(A.selected=!1),j.push(my(R.id,!1))}const T=[];for(const R of E)R.selected&&T.push(my(R.id,!1));k(j),S(T)},setMinZoom:v=>{const{panZoom:y,maxZoom:w}=g();y==null||y.setScaleExtent([v,w]),m({minZoom:v})},setMaxZoom:v=>{const{panZoom:y,minZoom:w}=g();y==null||y.setScaleExtent([w,v]),m({maxZoom:v})},setTranslateExtent:v=>{var y;(y=g().panZoom)==null||y.setTranslateExtent(v),m({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:y,triggerNodeChanges:w,triggerEdgeChanges:x,elementsSelectable:O}=g();if(!O)return;const k=y.reduce((C,E)=>E.selected?[...C,my(E.id,!1)]:C,[]),S=v.reduce((C,E)=>E.selected?[...C,my(E.id,!1)]:C,[]);w(k),x(S)},setNodeExtent:v=>{const{nodes:y,nodeLookup:w,parentLookup:x,nodeOrigin:O,elevateNodesOnSelect:k,nodeExtent:S,zIndexMode:C}=g();v[0][0]===S[0][0]&&v[0][1]===S[0][1]&&v[1][0]===S[1][0]&&v[1][1]===S[1][1]||(L7(y,w,x,{nodeOrigin:O,nodeExtent:v,elevateNodesOnSelect:k,checkEquality:!1,zIndexMode:C}),m({nodeExtent:v}))},panBy:v=>{const{transform:y,width:w,height:x,panZoom:O,translateExtent:k}=g();return uVt({delta:v,panZoom:O,transform:y,translateExtent:k,width:w,height:x})},setCenter:async(v,y,w)=>{const{width:x,height:O,maxZoom:k,panZoom:S}=g();if(!S)return!1;const C=typeof(w==null?void 0:w.zoom)<"u"?w.zoom:k;return await S.setViewport({x:x/2-v*C,y:O/2-y*C,zoom:C},{duration:w==null?void 0:w.duration,ease:w==null?void 0:w.ease,interpolate:w==null?void 0:w.interpolate}),!0},cancelConnection:()=>{m({connection:{...y8e}})},updateConnection:v=>{m({connection:v})},reset:()=>m({...poe()})}},Object.is);function OBe({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:i,initialWidth:r,initialHeight:s,initialMinZoom:o,initialMaxZoom:l,initialFitViewOptions:c,fitView:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:m}){const[g]=p.useState(()=>kqt({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:u,minZoom:o,maxZoom:l,fitViewOptions:c,nodeOrigin:d,nodeExtent:f,zIndexMode:h}));return a.jsx(FVt,{value:g,children:a.jsx(uHt,{children:m})})}function Sqt({children:e,nodes:t,edges:n,defaultNodes:i,defaultEdges:r,width:s,height:o,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:m}){return p.useContext(SL)?a.jsx(a.Fragment,{children:e}):a.jsx(OBe,{initialNodes:t,initialEdges:n,defaultNodes:i,defaultEdges:r,initialWidth:s,initialHeight:o,fitView:l,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:m,children:e})}const Eqt={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Cqt({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,className:r,nodeTypes:s,edgeTypes:o,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:h,onConnect:m,onConnectStart:g,onConnectEnd:b,onClickConnectStart:v,onClickConnectEnd:y,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:O,onNodeContextMenu:k,onNodeDoubleClick:S,onNodeDragStart:C,onNodeDrag:E,onNodeDragStop:j,onNodesDelete:T,onEdgesDelete:R,onDelete:A,onSelectionChange:N,onSelectionDragStart:P,onSelectionDrag:I,onSelectionDragStop:D,onSelectionContextMenu:_,onSelectionStart:L,onSelectionEnd:F,onBeforeDelete:M,connectionMode:z,connectionLineType:q=cg.Bezier,connectionLineStyle:U,connectionLineComponent:J,connectionLineContainerStyle:V,deleteKeyCode:Z="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:W=!1,selectionMode:G=nA.Full,panActivationKeyCode:H="Space",multiSelectionKeyCode:se=sA()?"Meta":"Control",zoomActivationKeyCode:Y=sA()?"Meta":"Control",snapToGrid:X,snapGrid:ie,onlyRenderVisibleElements:ee=!1,selectNodesOnDrag:be,nodesDraggable:ue,autoPanOnNodeFocus:pe,nodesConnectable:ke,nodesFocusable:je,nodeOrigin:Pe=K8e,edgesFocusable:Ee,edgesReconnectable:Qe,elementsSelectable:_e=!0,defaultViewport:ae=ZVt,minZoom:le=.5,maxZoom:ge=2,translateExtent:Oe=tA,preventScrolling:Se=!0,nodeExtent:qe,defaultMarkerColor:Xe="#b1b1b7",zoomOnScroll:ye=!0,zoomOnPinch:we=!0,panOnScroll:Ae=!1,panOnScrollSpeed:Ve=.5,panOnScrollMode:Be=Zy.Free,zoomOnDoubleClick:_t=!0,panOnDrag:Pt=!0,onPaneClick:Kt,onPaneMouseEnter:Et,onPaneMouseMove:vt,onPaneMouseLeave:tt,onPaneScroll:mt,onPaneContextMenu:Ne,paneClickDistance:wt=1,nodeClickDistance:jt=0,children:Yt,onReconnect:wn,onReconnectStart:We,onReconnectEnd:kt,onEdgeContextMenu:He,onEdgeDoubleClick:nt,onEdgeMouseEnter:et,onEdgeMouseMove:ft,onEdgeMouseLeave:St,reconnectRadius:Ct=10,onNodesChange:It,onEdgesChange:Gt,noDragClassName:Ge="nodrag",noWheelClassName:xt="nowheel",noPanClassName:yt="nopan",fitView:nn,fitViewOptions:Qt,connectOnClick:cn,attributionPosition:Me,proOptions:on,defaultEdgeOptions:kn,elevateNodesOnSelect:Sn=!0,elevateEdgesOnSelect:zi=!1,disableKeyboardA11y:un=!1,autoPanOnConnect:or,autoPanOnNodeDrag:Pn,autoPanOnSelection:ei=!0,autoPanSpeed:Fn,connectionRadius:Si,isValidConnection:Qn,onError:Rn,style:ui,id:rt,nodeDragThreshold:zt,connectionDragThreshold:Ue,viewport:bt,onViewportChange:Ht,width:_n,height:Nr,colorMode:qs="light",debug:Ws,onScroll:Lr,ariaLabelConfig:ti,zIndexMode:Ei="basic",...es},ts){const ba=rt||"1",go=nHt(qs),fs=p.useCallback(he=>{he.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Lr==null||Lr(he)},[Lr]);return a.jsx("div",{"data-testid":"rf__wrapper",...es,onScroll:fs,style:{...ui,...Eqt},ref:ts,className:eo(["react-flow",r,go]),id:rt,role:"application",children:a.jsxs(Sqt,{nodes:e,edges:t,width:_n,height:Nr,fitView:nn,fitViewOptions:Qt,minZoom:le,maxZoom:ge,nodeOrigin:Pe,nodeExtent:qe,zIndexMode:Ei,children:[a.jsx(tHt,{nodes:e,edges:t,defaultNodes:n,defaultEdges:i,onConnect:m,onConnectStart:g,onConnectEnd:b,onClickConnectStart:v,onClickConnectEnd:y,nodesDraggable:ue,autoPanOnNodeFocus:pe,nodesConnectable:ke,nodesFocusable:je,edgesFocusable:Ee,edgesReconnectable:Qe,elementsSelectable:_e,elevateNodesOnSelect:Sn,elevateEdgesOnSelect:zi,minZoom:le,maxZoom:ge,nodeExtent:qe,onNodesChange:It,onEdgesChange:Gt,snapToGrid:X,snapGrid:ie,connectionMode:z,translateExtent:Oe,connectOnClick:cn,defaultEdgeOptions:kn,fitView:nn,fitViewOptions:Qt,onNodesDelete:T,onEdgesDelete:R,onDelete:A,onNodeDragStart:C,onNodeDrag:E,onNodeDragStop:j,onSelectionDrag:I,onSelectionDragStart:P,onSelectionDragStop:D,onMove:d,onMoveStart:f,onMoveEnd:h,noPanClassName:yt,nodeOrigin:Pe,rfId:ba,autoPanOnConnect:or,autoPanOnNodeDrag:Pn,autoPanSpeed:Fn,onError:Rn,connectionRadius:Si,isValidConnection:Qn,selectNodesOnDrag:be,nodeDragThreshold:zt,connectionDragThreshold:Ue,onBeforeDelete:M,debug:Ws,ariaLabelConfig:ti,zIndexMode:Ei}),a.jsx(wqt,{onInit:u,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:O,onNodeContextMenu:k,onNodeDoubleClick:S,nodeTypes:s,edgeTypes:o,connectionLineType:q,connectionLineStyle:U,connectionLineComponent:J,connectionLineContainerStyle:V,selectionKeyCode:ne,selectionOnDrag:W,selectionMode:G,deleteKeyCode:Z,multiSelectionKeyCode:se,panActivationKeyCode:H,zoomActivationKeyCode:Y,onlyRenderVisibleElements:ee,defaultViewport:ae,translateExtent:Oe,minZoom:le,maxZoom:ge,preventScrolling:Se,zoomOnScroll:ye,zoomOnPinch:we,zoomOnDoubleClick:_t,panOnScroll:Ae,panOnScrollSpeed:Ve,panOnScrollMode:Be,panOnDrag:Pt,autoPanOnSelection:ei,onPaneClick:Kt,onPaneMouseEnter:Et,onPaneMouseMove:vt,onPaneMouseLeave:tt,onPaneScroll:mt,onPaneContextMenu:Ne,paneClickDistance:wt,nodeClickDistance:jt,onSelectionContextMenu:_,onSelectionStart:L,onSelectionEnd:F,onReconnect:wn,onReconnectStart:We,onReconnectEnd:kt,onEdgeContextMenu:He,onEdgeDoubleClick:nt,onEdgeMouseEnter:et,onEdgeMouseMove:ft,onEdgeMouseLeave:St,reconnectRadius:Ct,defaultMarkerColor:Xe,noDragClassName:Ge,noWheelClassName:xt,noPanClassName:yt,rfId:ba,disableKeyboardA11y:un,nodeExtent:qe,viewport:bt,onViewportChange:Ht}),a.jsx(YVt,{onSelectionChange:N}),Yt,a.jsx(qVt,{proOptions:on,position:Me}),a.jsx(HVt,{rfId:ba,disableKeyboardA11y:un})]})})}var Aqt=Z8e(Cqt);const Tqt=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function _qt({children:e}){const t=ir(Tqt);return t?vi.createPortal(e,t):null}function jqt(e){const[t,n]=p.useState(e),i=p.useCallback(r=>n(s=>X8e(r,s)),[]);return[t,n,i]}function Nqt(e){const[t,n]=p.useState(e),i=p.useCallback(r=>n(s=>Y8e(r,s)),[]);return[t,n,i]}const Rqt=e=>t=>{if(!e.includeHiddenNodes)return t.nodesInitialized;if(t.nodeLookup.size===0)return!1;for(const[,{internals:n}]of t.nodeLookup)if(n.handleBounds===void 0||!tK(n.userNode))return!1;return!0};function Iqt(e={includeHiddenNodes:!1}){return ir(Rqt(e))}function Pqt({dimensions:e,lineWidth:t,variant:n,className:i}){return a.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:eo(["react-flow__background-pattern",n,i])})}function Dqt({radius:e,className:t}){return a.jsx("circle",{cx:e,cy:e,r:e,className:eo(["react-flow__background-pattern","dots",t])})}var Ug;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Ug||(Ug={}));const Mqt={[Ug.Dots]:1,[Ug.Lines]:1,[Ug.Cross]:6},Lqt=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function kBe({id:e,variant:t=Ug.Dots,gap:n=20,size:i,lineWidth:r=1,offset:s=0,color:o,bgColor:l,style:c,className:u,patternClassName:d}){const f=p.useRef(null),{transform:h,patternId:m}=ir(Lqt,Vs),g=i||Mqt[t],b=t===Ug.Dots,v=t===Ug.Cross,y=Array.isArray(n)?n:[n,n],w=[y[0]*h[2]||1,y[1]*h[2]||1],x=g*h[2],O=Array.isArray(s)?s:[s,s],k=v?[x,x]:w,S=[O[0]*h[2]||1+k[0]/2,O[1]*h[2]||1+k[1]/2],C=`${m}${e||""}`;return a.jsxs("svg",{className:eo(["react-flow__background",u]),style:{...c,...AL,"--xy-background-color-props":l,"--xy-background-pattern-color-props":o},ref:f,"data-testid":"rf__background",children:[a.jsx("pattern",{id:C,x:h[0]%w[0],y:h[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${S[0]},-${S[1]})`,children:b?a.jsx(Dqt,{radius:x/2,className:d}):a.jsx(Pqt,{dimensions:k,lineWidth:r,variant:t,className:d})}),a.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${C})`})]})}kBe.displayName="Background";const $qt=p.memo(kBe);function Fqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:a.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Bqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:a.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Uqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:a.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function Qqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:a.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function zqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:a.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function yj({children:e,className:t,...n}){return a.jsx("button",{type:"button",className:eo(["react-flow__controls-button",t]),...n,children:e})}const Vqt=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function SBe({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:i=!0,fitViewOptions:r,onZoomIn:s,onZoomOut:o,onFitView:l,onInteractiveChange:c,className:u,children:d,position:f="bottom-left",orientation:h="vertical","aria-label":m}){const g=Hs(),{isInteractive:b,minZoomReached:v,maxZoomReached:y,ariaLabelConfig:w}=ir(Vqt,Vs),{zoomIn:x,zoomOut:O,fitView:k}=CL(),S=()=>{x(),s==null||s()},C=()=>{O(),o==null||o()},E=()=>{k(r),l==null||l()},j=()=>{g.setState({nodesDraggable:!b,nodesConnectable:!b,elementsSelectable:!b}),c==null||c(!b)},T=h==="horizontal"?"horizontal":"vertical";return a.jsxs(EL,{className:eo(["react-flow__controls",T,u]),position:f,style:e,"data-testid":"rf__controls","aria-label":m??w["controls.ariaLabel"],children:[t&&a.jsxs(a.Fragment,{children:[a.jsx(yj,{onClick:S,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:y,children:a.jsx(Fqt,{})}),a.jsx(yj,{onClick:C,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:v,children:a.jsx(Bqt,{})})]}),n&&a.jsx(yj,{className:"react-flow__controls-fitview",onClick:E,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:a.jsx(Uqt,{})}),i&&a.jsx(yj,{className:"react-flow__controls-interactive",onClick:j,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:b?a.jsx(zqt,{}):a.jsx(Qqt,{})}),d]})}SBe.displayName="Controls";const Hqt=p.memo(SBe);function qqt({id:e,x:t,y:n,width:i,height:r,style:s,color:o,strokeColor:l,strokeWidth:c,className:u,borderRadius:d,shapeRendering:f,selected:h,onClick:m}){const{background:g,backgroundColor:b}=s||{},v=o||g||b;return a.jsx("rect",{className:eo(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:d,ry:d,width:i,height:r,style:{fill:v,stroke:l,strokeWidth:c},shapeRendering:f,onClick:m?y=>m(y,e):void 0})}const Wqt=p.memo(qqt),Kqt=e=>e.nodes.map(t=>t.id),t6=e=>e instanceof Function?e:()=>e;function Gqt({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:r,nodeComponent:s=Wqt,onClick:o}){const l=ir(Kqt,Vs),c=t6(t),u=t6(e),d=t6(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return a.jsx(a.Fragment,{children:l.map(h=>a.jsx(Yqt,{id:h,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:i,nodeStrokeWidth:r,NodeComponent:s,onClick:o,shapeRendering:f},h))})}function Xqt({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:i,nodeBorderRadius:r,nodeStrokeWidth:s,shapeRendering:o,NodeComponent:l,onClick:c}){const{node:u,x:d,y:f,width:h,height:m}=ir(g=>{const b=g.nodeLookup.get(e);if(!b)return{node:void 0,x:0,y:0,width:0,height:0};const v=b.internals.userNode,{x:y,y:w}=b.internals.positionAbsolute,{width:x,height:O}=Om(v);return{node:v,x:y,y:w,width:x,height:O}},Vs);return!u||u.hidden||!tK(u)?null:a.jsx(l,{x:d,y:f,width:h,height:m,style:u.style,selected:!!u.selected,className:i(u),color:t(u),borderRadius:r,strokeColor:n(u),strokeWidth:s,shapeRendering:o,onClick:c,id:u.id})}const Yqt=p.memo(Xqt);var Zqt=p.memo(Gqt);const Jqt=200,eWt=150,tWt=e=>!e.hidden,nWt=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?k8e($T(e.nodeLookup,{filter:tWt}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},iWt="react-flow__minimap-desc";function EBe({style:e,className:t,nodeStrokeColor:n,nodeColor:i,nodeClassName:r="",nodeBorderRadius:s=5,nodeStrokeWidth:o,nodeComponent:l,bgColor:c,maskColor:u,maskStrokeColor:d,maskStrokeWidth:f,position:h="bottom-right",onClick:m,onNodeClick:g,pannable:b=!1,zoomable:v=!1,ariaLabel:y,inversePan:w,zoomStep:x=1,offsetScale:O=5}){const k=Hs(),S=p.useRef(null),{boundingRect:C,viewBB:E,rfId:j,panZoom:T,translateExtent:R,flowWidth:A,flowHeight:N,ariaLabelConfig:P}=ir(nWt,Vs),I=(e==null?void 0:e.width)??Jqt,D=(e==null?void 0:e.height)??eWt,_=C.width/I,L=C.height/D,F=Math.max(_,L),M=F*I,z=F*D,q=O*F,U=C.x-(M-C.width)/2-q,J=C.y-(z-C.height)/2-q,V=M+q*2,Z=z+q*2,ne=`${iWt}-${j}`,W=p.useRef(0),G=p.useRef();W.current=F,p.useEffect(()=>{if(S.current&&T)return G.current=vVt({domNode:S.current,panZoom:T,getTransform:()=>k.getState().transform,getViewScale:()=>W.current}),()=>{var X;(X=G.current)==null||X.destroy()}},[T]),p.useEffect(()=>{var X;(X=G.current)==null||X.update({translateExtent:R,width:A,height:N,inversePan:w,pannable:b,zoomStep:x,zoomable:v})},[b,v,w,x,R,A,N]);const H=m?X=>{var be;const[ie,ee]=((be=G.current)==null?void 0:be.pointer(X))||[0,0];m(X,{x:ie,y:ee})}:void 0,se=g?p.useCallback((X,ie)=>{const ee=k.getState().nodeLookup.get(ie).internals.userNode;g(X,ee)},[]):void 0,Y=y??P["minimap.ariaLabel"];return a.jsx(EL,{position:h,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*F:void 0,"--xy-minimap-node-background-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o=="number"?o:void 0},className:eo(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:a.jsxs("svg",{width:I,height:D,viewBox:`${U} ${J} ${V} ${Z}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ne,ref:S,onClick:H,children:[Y&&a.jsx("title",{id:ne,children:Y}),a.jsx(Zqt,{onClick:se,nodeColor:i,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:r,nodeStrokeWidth:o,nodeComponent:l}),a.jsx("path",{className:"react-flow__minimap-mask",d:`M${U-q},${J-q}h${V+q*2}v${Z+q*2}h${-V-q*2}z - M${E.x},${E.y}h${E.width}v${E.height}h${-E.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}EBe.displayName="MiniMap";p.memo(EBe);const rWt=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,sWt={[S1.Line]:"right",[S1.Handle]:"bottom-right"};function aWt({nodeId:e,position:t,variant:n=S1.Handle,className:i,style:r=void 0,children:s,color:o,minWidth:l=10,minHeight:c=10,maxWidth:u=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:h,autoScale:m=!0,shouldResize:g,onResizeStart:b,onResize:v,onResizeEnd:y}){const w=nBe(),x=typeof e=="string"?e:w,O=Hs(),k=p.useRef(null),S=n===S1.Handle,C=ir(p.useCallback(rWt(S&&m),[S,m]),Vs),E=p.useRef(null),j=t??sWt[n];p.useEffect(()=>{if(!(!k.current||!x))return E.current||(E.current=RVt({domNode:k.current,nodeId:x,getStoreItems:()=>{const{nodeLookup:R,transform:A,snapGrid:N,snapToGrid:P,nodeOrigin:I,domNode:D}=O.getState();return{nodeLookup:R,transform:A,snapGrid:N,snapToGrid:P,nodeOrigin:I,paneDomNode:D}},onChange:(R,A)=>{const{triggerNodeChanges:N,nodeLookup:P,parentLookup:I,nodeOrigin:D}=O.getState(),_=[],L={x:R.x,y:R.y},F=P.get(x);if(F&&F.expandParent&&F.parentId){const M=F.origin??D,z=R.width??F.measured.width??0,q=R.height??F.measured.height??0,U={id:F.id,parentId:F.parentId,rect:{width:z,height:q,...E8e({x:R.x??F.position.x,y:R.y??F.position.y},{width:z,height:q},F.parentId,P,M)}},J=oK([U],P,I,D);_.push(...J),L.x=R.x?Math.max(M[0]*z,R.x):void 0,L.y=R.y?Math.max(M[1]*q,R.y):void 0}if(L.x!==void 0&&L.y!==void 0){const M={id:x,type:"position",position:{...L}};_.push(M)}if(R.width!==void 0&&R.height!==void 0){const z={id:x,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:R.width,height:R.height}};_.push(z)}for(const M of A){const z={...M,type:"position"};_.push(z)}N(_)},onEnd:({width:R,height:A})=>{const N={id:x,type:"dimensions",resizing:!1,dimensions:{width:R,height:A}};O.getState().triggerNodeChanges([N])}})),E.current.update({controlPosition:j,boundaries:{minWidth:l,minHeight:c,maxWidth:u,maxHeight:d},keepAspectRatio:f,resizeDirection:h,onResizeStart:b,onResize:v,onResizeEnd:y,shouldResize:g}),()=>{var R;(R=E.current)==null||R.destroy()}},[j,l,c,u,d,f,b,v,y,g]);const T=j.split("-");return a.jsx("div",{className:eo(["react-flow__resize-control","nodrag",...T,n,i]),ref:k,style:{...r,scale:C,...o&&{[S?"backgroundColor":"borderColor"]:o}},children:s})}p.memo(aWt);var CBe=Object.defineProperty,oWt=(e,t,n)=>t in e?CBe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lWt=(e,t)=>{for(var n in t)CBe(e,n,{get:t[n],enumerable:!0})},cWt=(e,t,n)=>oWt(e,t+"",n),ABe={};lWt(ABe,{Graph:()=>Dd,alg:()=>cK,json:()=>_Be,version:()=>fWt});var uWt=Object.defineProperty,TBe=(e,t)=>{for(var n in t)uWt(e,n,{get:t[n],enumerable:!0})},Dd=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected="directed"in e?e.directed:!0,this._isMultigraph="multigraph"in e?e.multigraph:!1,this._isCompound="compound"in e?e.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return typeof e!="function"?this._defaultNodeLabelFn=()=>e:this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(n=>{t!==void 0?this.setNode(n,t):this.setNode(n)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]="\0",this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(n=>{this.setParent(n)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(t===void 0)t="\0";else{t+="";for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!=="\0")return t}}children(e="\0"){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e==="\0")return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t);for(let i of this.successors(e))n.add(i);return Array.from(n.values())}}isLeaf(e){let t;return this.isDirected()?t=this.successors(e):t=this.neighbors(e),t.length===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([r,s])=>{e(r)&&t.setNode(r,s)}),Object.values(this._edgeObjs).forEach(r=>{t.hasNode(r.v)&&t.hasNode(r.w)&&t.setEdge(r,this.edge(r))});let n={},i=r=>{let s=this.parent(r);return!s||t.hasNode(s)?(n[r]=s??void 0,s??void 0):s in n?n[s]:i(s)};return this._isCompound&&t.nodes().forEach(r=>t.setParent(r,i(r))),t}setDefaultEdgeLabel(e){return typeof e!="function"?this._defaultEdgeLabelFn=()=>e:this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((n,i)=>(t!==void 0?this.setEdge(n,i,t):this.setEdge(n,i),i)),this}setEdge(e,t,n,i){let r,s,o,l,c=!1;typeof e=="object"&&e!==null&&"v"in e?(r=e.v,s=e.w,o=e.name,arguments.length===2&&(l=t,c=!0)):(r=e,s=t,o=i,arguments.length>2&&(l=n,c=!0)),r=""+r,s=""+s,o!==void 0&&(o=""+o);let u=yS(this._isDirected,r,s,o);if(u in this._edgeLabels)return c&&(this._edgeLabels[u]=l),this;if(o!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(r),this.setNode(s),this._edgeLabels[u]=c?l:this._defaultEdgeLabelFn(r,s,o);let d=dWt(this._isDirected,r,s,o);return r=d.v,s=d.w,Object.freeze(d),this._edgeObjs[u]=d,moe(this._preds[s],r),moe(this._sucs[r],s),this._in[s][u]=d,this._out[r][u]=d,this._edgeCount++,this}edge(e,t,n){let i=arguments.length===1?n6(this._isDirected,e):yS(this._isDirected,e,t,n);return this._edgeLabels[i]}edgeAsObj(e,t,n){let i=arguments.length===1?this.edge(e):this.edge(e,t,n);return typeof i!="object"?{label:i}:i}hasEdge(e,t,n){return(arguments.length===1?n6(this._isDirected,e):yS(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let i=arguments.length===1?n6(this._isDirected,e):yS(this._isDirected,e,t,n),r=this._edgeObjs[i];if(r){let s=r.v,o=r.w;delete this._edgeLabels[i],delete this._edgeObjs[i],goe(this._preds[o],s),goe(this._sucs[s],o),delete this._in[o][i],delete this._out[s][i],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,n){if(!e)return;let i=Object.values(e);return n?i.filter(r=>r.v===t&&r.w===n||r.v===n&&r.w===t):i}};function moe(e,t){e[t]?e[t]++:e[t]=1}function goe(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function yS(e,t,n,i){let r=""+t,s=""+n;if(!e&&r>s){let o=r;r=s,s=o}return r+""+s+""+(i===void 0?"\0":i)}function dWt(e,t,n,i){let r=""+t,s=""+n;if(!e&&r>s){let l=r;r=s,s=l}let o={v:r,w:s};return i&&(o.name=i),o}function n6(e,t){return yS(e,t.v,t.w,t.name)}var fWt="4.0.1",_Be={};TBe(_Be,{read:()=>gWt,write:()=>hWt});function hWt(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:pWt(e),edges:mWt(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function pWt(e){return e.nodes().map(t=>{let n=e.node(t),i=e.parent(t),r={v:t};return n!==void 0&&(r.value=n),i!==void 0&&(r.parent=i),r})}function mWt(e){return e.edges().map(t=>{let n=e.edge(t),i={v:t.v,w:t.w};return t.name!==void 0&&(i.name=t.name),n!==void 0&&(i.value=n),i})}function gWt(e){let t=new Dd(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(n=>{t.setNode(n.v,n.value),n.parent&&t.setParent(n.v,n.parent)}),e.edges.forEach(n=>{t.setEdge({v:n.v,w:n.w,name:n.name},n.value)}),t}var cK={};TBe(cK,{CycleException:()=>jP,bellmanFord:()=>jBe,components:()=>vWt,dijkstra:()=>_P,dijkstraAll:()=>OWt,findCycles:()=>kWt,floydWarshall:()=>EWt,isAcyclic:()=>AWt,postorder:()=>_Wt,preorder:()=>jWt,prim:()=>NWt,shortestPaths:()=>RWt,tarjan:()=>RBe,topsort:()=>IBe});var bWt=()=>1;function jBe(e,t,n,i){return yWt(e,String(t),n||bWt,i||function(r){return e.outEdges(r)})}function yWt(e,t,n,i){let r={},s,o=0,l=e.nodes(),c=function(f){let h=n(f);r[f.v].distance+he.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(e,t){let n=this._keyIndices,i=String(e);if(!(i in n)){let r=this._arr,s=r.length;return n[i]=s,r.push({key:i,priority:t}),this._decrease(s),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw new Error(`Key not found: ${e}`);let i=this._arr[n].priority;if(t>i)throw new Error(`New priority is greater than current priority. Key: ${e} Old: ${i} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,i=n+1,r=e;n>1,!(t[i].priority1;function _P(e,t,n,i){let r=function(s){return e.outEdges(s)};return wWt(e,String(t),n||xWt,i||r)}function wWt(e,t,n,i){let r={},s=new NBe,o,l,c=function(u){let d=u.v!==o?u.v:u.w,f=r[d],h=n(u),m=l.distance+h;if(h<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+u+" Weight: "+h);m0&&(o=s.removeMin(),l=r[o],l.distance!==Number.POSITIVE_INFINITY);)i(o).forEach(c);return r}function OWt(e,t,n){return e.nodes().reduce(function(i,r){return i[r]=_P(e,r,t,n),i},{})}function RBe(e){let t=0,n=[],i={},r=[];function s(o){let l=i[o]={onStack:!0,lowlink:t,index:t++};if(n.push(o),e.successors(o).forEach(function(c){c in i?i[c].onStack&&(l.lowlink=Math.min(l.lowlink,i[c].index)):(s(c),l.lowlink=Math.min(l.lowlink,i[c].lowlink))}),l.lowlink===l.index){let c=[],u;do u=n.pop(),i[u].onStack=!1,c.push(u);while(o!==u);r.push(c)}}return e.nodes().forEach(function(o){o in i||s(o)}),r}function kWt(e){return RBe(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var SWt=()=>1;function EWt(e,t,n){return CWt(e,t||SWt,n||function(i){return e.outEdges(i)})}function CWt(e,t,n){let i={},r=e.nodes();return r.forEach(function(s){i[s]={},i[s][s]={distance:0,predecessor:""},r.forEach(function(o){s!==o&&(i[s][o]={distance:Number.POSITIVE_INFINITY,predecessor:""})}),n(s).forEach(function(o){let l=o.v===s?o.w:o.v,c=t(o);i[s][l]={distance:c,predecessor:s}})}),r.forEach(function(s){let o=i[s];r.forEach(function(l){let c=i[l];r.forEach(function(u){let d=c[s],f=o[u],h=c[u],m=d.distance+f.distance;m{var c;return(c=e.isDirected()?e.successors(l):e.neighbors(l))!=null?c:[]},o={};return t.forEach(function(l){if(!e.hasNode(l))throw new Error("Graph does not have node: "+l);r=PBe(e,l,n==="post",o,s,i,r)}),r}function PBe(e,t,n,i,r,s,o){return t in i||(i[t]=!0,n||(o=s(o,t)),r(t).forEach(function(l){o=PBe(e,l,n,i,r,s,o)}),n&&(o=s(o,t))),o}function DBe(e,t,n){return TWt(e,t,n,function(i,r){return i.push(r),i},[])}function _Wt(e,t){return DBe(e,t,"post")}function jWt(e,t){return DBe(e,t,"pre")}function NWt(e,t){let n=new Dd,i={},r=new NBe,s;function o(c){let u=c.v===s?c.w:c.v,d=r.priority(u);if(d!==void 0){let f=t(c);f0;){if(s=r.removeMin(),s in i)n.setEdge(s,i[s]);else{if(l)throw new Error("Input graph is not connected: "+e);l=!0}e.nodeEdges(s).forEach(o)}return n}function RWt(e,t,n,i){return IWt(e,t,n,i??(r=>{let s=e.outEdges(r);return s??[]}))}function IWt(e,t,n,i){if(n===void 0)return _P(e,t,n,i);let r=!1,s=e.nodes();for(let o=0;ot.setNode(n,e.node(n))),e.edges().forEach(n=>{let i=t.edge(n.v,n.w)||{weight:0,minlen:1},r=e.edge(n);t.setEdge(n.v,n.w,{weight:i.weight+r.weight,minlen:Math.max(i.minlen,r.minlen)})}),t}function MBe(e){let t=new Dd({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function boe(e,t){let n=e.x,i=e.y,r=t.x-n,s=t.y-i,o=e.width/2,l=e.height/2;if(!r&&!s)throw new Error("Not possible to find intersection inside of the rectangle");let c,u;return Math.abs(s)*o>Math.abs(r)*l?(s<0&&(l=-l),c=l*r/s,u=l):(r<0&&(o=-o),c=o,u=o*s/r),{x:n+c,y:i+u}}function UT(e){let t=oA($Be(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let i=e.node(n),r=i.rank;r!==void 0&&(t[r]||(t[r]=[]),t[r][i.order]=n)}),t}function DWt(e){let t=e.nodes().map(i=>{let r=e.node(i).rank;return r===void 0?Number.MAX_VALUE:r}),n=uh(Math.min,t);e.nodes().forEach(i=>{let r=e.node(i);Object.hasOwn(r,"rank")&&(r.rank-=n)})}function MWt(e){let t=e.nodes().map(o=>e.node(o).rank).filter(o=>o!==void 0),n=uh(Math.min,t),i=[];e.nodes().forEach(o=>{let l=e.node(o).rank-n;i[l]||(i[l]=[]),i[l].push(o)});let r=0,s=e.graph().nodeRankFactor;Array.from(i).forEach((o,l)=>{o===void 0&&l%s!==0?--r:o!==void 0&&r&&o.forEach(c=>e.node(c).rank+=r)})}function yoe(e,t,n,i){let r={width:0,height:0};return arguments.length>=4&&(r.rank=n,r.order=i),vO(e,"border",r,t)}function LWt(e,t=LBe){let n=[];for(let i=0;iLBe){let n=LWt(t);return e(...n.map(i=>e(...i)))}else return e(...t)}function $Be(e){let t=e.nodes().map(n=>{let i=e.node(n).rank;return i===void 0?Number.MIN_VALUE:i});return uh(Math.max,t)}function $Wt(e,t){let n={lhs:[],rhs:[]};return e.forEach(i=>{t(i)?n.lhs.push(i):n.rhs.push(i)}),n}function FBe(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}}function BBe(e,t){return t()}var FWt=0;function uK(e){let t=++FWt;return e+(""+t)}function oA(e,t,n=1){t==null&&(t=e,e=0);let i=s=>sti[t]:n=t,Object.entries(e).reduce((i,[r,s])=>(i[r]=n(s,r),i),{})}function BWt(e,t){return e.reduce((n,i,r)=>(n[i]=t[r],n),{})}var _L="\0",UWt="3.0.0",QWt=class{constructor(){cWt(this,"_sentinel");let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return voe(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&voe(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,zWt)),n=n._prev;return"["+e.join(", ")+"]"}};function voe(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function zWt(e,t){if(e!=="_next"&&e!=="_prev")return t}var VWt=QWt,HWt=()=>1;function qWt(e,t){if(e.nodeCount()<=1)return[];let n=KWt(e,t||HWt);return WWt(n.graph,n.buckets,n.zeroIdx).flatMap(i=>e.outEdges(i.v,i.w)||[])}function WWt(e,t,n){var i;let r=[],s=t[t.length-1],o=t[0],l;for(;e.nodeCount();){for(;l=o.dequeue();)i6(e,t,n,l);for(;l=s.dequeue();)i6(e,t,n,l);if(e.nodeCount()){for(let c=t.length-2;c>0;--c)if(l=(i=t[c])==null?void 0:i.dequeue(),l){r=r.concat(i6(e,t,n,l,!0)||[]);break}}}return r}function i6(e,t,n,i,r){let s=[],o=r?s:void 0;return(e.inEdges(i.v)||[]).forEach(l=>{let c=e.edge(l),u=e.node(l.v);r&&s.push({v:l.v,w:l.w}),u.out-=c,B7(t,n,u)}),(e.outEdges(i.v)||[]).forEach(l=>{let c=e.edge(l),u=l.w,d=e.node(u);d.in-=c,B7(t,n,d)}),e.removeNode(i.v),o}function KWt(e,t){let n=new Dd,i=0,r=0;e.nodes().forEach(l=>{n.setNode(l,{v:l,in:0,out:0})}),e.edges().forEach(l=>{let c=n.edge(l.v,l.w)||0,u=t(l),d=c+u;n.setEdge(l.v,l.w,d);let f=n.node(l.v),h=n.node(l.w);r=Math.max(r,f.out+=u),i=Math.max(i,h.in+=u)});let s=GWt(r+i+3).map(()=>new VWt),o=i+1;return n.nodes().forEach(l=>{B7(s,o,n.node(l))}),{graph:n,buckets:s,zeroIdx:o}}function B7(e,t,n){var i,r,s;n.out?n.in?(s=e[n.out-n.in+t])==null||s.enqueue(n):(r=e[e.length-1])==null||r.enqueue(n):(i=e[0])==null||i.enqueue(n)}function GWt(e){let t=[];for(let n=0;n{let i=e.edge(n);e.removeEdge(n),i.forwardName=n.name,i.reversed=!0,e.setEdge(n.w,n.v,i,uK("rev"))});function t(n){return i=>n.edge(i).weight}}function YWt(e){let t=[],n={},i={};function r(s){Object.hasOwn(i,s)||(i[s]=!0,n[s]=!0,e.outEdges(s).forEach(o=>{Object.hasOwn(n,o.w)?t.push(o):r(o.w)}),delete n[s])}return e.nodes().forEach(r),t}function ZWt(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let i=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,i)}})}function JWt(e){e.graph().dummyChains=[],e.edges().forEach(t=>eKt(e,t))}function eKt(e,t){let n=t.v,i=e.node(n).rank,r=t.w,s=e.node(r).rank,o=t.name,l=e.edge(t),c=l.labelRank;if(s===i+1)return;e.removeEdge(t);let u,d,f;for(f=0,++i;i{let n=e.node(t),i=n.edgeLabel,r;for(e.setEdge(n.edgeObj,i);n.dummy;)r=e.successors(t)[0],e.removeNode(t),i.points.push({x:n.x,y:n.y}),n.dummy==="edge-label"&&(i.x=n.x,i.y=n.y,i.width=n.width,i.height=n.height),t=r,n=e.node(t)})}function dK(e){let t={};function n(i){let r=e.node(i);if(Object.hasOwn(t,i))return r.rank;t[i]=!0;let s=e.outEdges(i),o=s?s.map(c=>c==null?Number.POSITIVE_INFINITY:n(c.w)-e.edge(c).minlen):[],l=uh(Math.min,o);return l===Number.POSITIVE_INFINITY&&(l=0),r.rank=l}e.sources().forEach(n)}function E1(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var UBe=nKt;function nKt(e){let t=new Dd({directed:!1}),n=e.nodes();if(n.length===0)throw new Error("Graph must have at least one node");let i=n[0],r=e.nodeCount();t.setNode(i,{});let s,o;for(;iKt(t,e){let o=s.v,l=i===o?s.w:o;!e.hasNode(l)&&!E1(t,s)&&(e.setNode(l,{}),e.setEdge(i,l,{}),n(l))})}return e.nodes().forEach(n),e.nodeCount()}function rKt(e,t){return t.edges().reduce((n,i)=>{let r=Number.POSITIVE_INFINITY;return e.hasNode(i.v)!==e.hasNode(i.w)&&(r=E1(t,i)),rt.node(i).rank+=n)}var{preorder:aKt,postorder:oKt}=cK,lKt=iv;iv.initLowLimValues=hK;iv.initCutValues=fK;iv.calcCutValue=QBe;iv.leaveEdge=VBe;iv.enterEdge=HBe;iv.exchangeEdges=qBe;function iv(e){e=PWt(e),dK(e);let t=UBe(e);hK(t),fK(t,e);let n,i;for(;n=VBe(t);)i=HBe(t,e,n),qBe(t,e,n,i)}function fK(e,t){let n=oKt(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(i=>cKt(e,t,i))}function cKt(e,t,n){let i=e.node(n).parent,r=e.edge(n,i);r.cutvalue=QBe(e,t,n)}function QBe(e,t,n){let i=e.node(n).parent,r=!0,s=t.edge(n,i),o=0;s||(r=!1,s=t.edge(i,n)),o=s.weight;let l=t.nodeEdges(n);return l&&l.forEach(c=>{let u=c.v===n,d=u?c.w:c.v;if(d!==i){let f=u===r,h=t.edge(c).weight;if(o+=f?h:-h,dKt(e,n,d)){let m=e.edge(n,d).cutvalue;o+=f?-m:m}}}),o}function hK(e,t){arguments.length<2&&(t=e.nodes()[0]),zBe(e,{},1,t)}function zBe(e,t,n,i,r){let s=n,o=e.node(i);t[i]=!0;let l=e.neighbors(i);return l&&l.forEach(c=>{Object.hasOwn(t,c)||(n=zBe(e,t,n,c,i))}),o.low=s,o.lim=n++,r?o.parent=r:delete o.parent,n}function VBe(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function HBe(e,t,n){let i=n.v,r=n.w;t.hasEdge(i,r)||(i=n.w,r=n.v);let s=e.node(i),o=e.node(r),l=s,c=!1;return s.lim>o.lim&&(l=o,c=!0),t.edges().filter(u=>c===xoe(e,e.node(u.v),l)&&c!==xoe(e,e.node(u.w),l)).reduce((u,d)=>E1(t,d)!e.node(r).parent);if(!n)return;let i=aKt(e,[n]);i=i.slice(1),i.forEach(r=>{let s=e.node(r).parent,o=t.edge(r,s),l=!1;o||(o=t.edge(s,r),l=!0),t.node(r).rank=t.node(s).rank+(l?o.minlen:-o.minlen)})}function dKt(e,t,n){return e.hasEdge(t,n)}function xoe(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var fKt=hKt;function hKt(e){let t=e.graph().ranker;if(typeof t=="function")return t(e);switch(t){case"network-simplex":woe(e);break;case"tight-tree":mKt(e);break;case"longest-path":pKt(e);break;case"none":break;default:woe(e)}}var pKt=dK;function mKt(e){dK(e),UBe(e)}function woe(e){lKt(e)}var gKt=bKt;function bKt(e){let t=vKt(e);e.graph().dummyChains.forEach(n=>{let i=e.node(n),r=i.edgeObj,s=yKt(e,t,r.v,r.w),o=s.path,l=s.lca,c=0,u=o[c],d=!0;for(;n!==r.w;){if(i=e.node(n),d){for(;(u=o[c])!==l&&e.node(u).maxRanko||l>t[c].lim));let u=c,d=i;for(;(d=e.parent(d))!==u;)s.push(d);return{path:r.concat(s.reverse()),lca:u}}function vKt(e){let t={},n=0;function i(r){let s=n;e.children(r).forEach(i),t[r]={low:s,lim:n++}}return e.children(_L).forEach(i),t}function xKt(e){let t=vO(e,"root",{},"_root"),n=wKt(e),i=Object.values(n),r=uh(Math.max,i)-1,s=2*r+1;e.graph().nestingRoot=t,e.edges().forEach(l=>e.edge(l).minlen*=s);let o=OKt(e)+1;e.children(_L).forEach(l=>WBe(e,t,s,o,r,n,l)),e.graph().nodeRankFactor=s}function WBe(e,t,n,i,r,s,o){var l;let c=e.children(o);if(!c.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}let u=yoe(e,"_bt"),d=yoe(e,"_bb"),f=e.node(o);e.setParent(u,o),f.borderTop=u,e.setParent(d,o),f.borderBottom=d,c.forEach(h=>{var m;WBe(e,t,n,i,r,s,h);let g=e.node(h),b=g.borderTop?g.borderTop:h,v=g.borderBottom?g.borderBottom:h,y=g.borderTop?i:2*i,w=b!==v?1:r-((m=s[o])!=null?m:0)+1;e.setEdge(u,b,{weight:y,minlen:w,nestingEdge:!0}),e.setEdge(v,d,{weight:y,minlen:w,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,u,{weight:0,minlen:r+((l=s[o])!=null?l:0)})}function wKt(e){let t={};function n(i,r){let s=e.children(i);s&&s.length&&s.forEach(o=>n(o,r+1)),t[i]=r}return e.children(_L).forEach(i=>n(i,1)),t}function OKt(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function kKt(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(n=>{e.edge(n).nestingEdge&&e.removeEdge(n)})}var SKt=EKt;function EKt(e){function t(n){let i=e.children(n),r=e.node(n);if(i.length&&i.forEach(t),Object.hasOwn(r,"minRank")){r.borderLeft=[],r.borderRight=[];for(let s=r.minRank,o=r.maxRank+1;skoe(e.node(t))),e.edges().forEach(t=>koe(e.edge(t)))}function koe(e){let t=e.width;e.width=e.height,e.height=t}function TKt(e){e.nodes().forEach(t=>r6(e.node(t))),e.edges().forEach(t=>{var n;let i=e.edge(t);(n=i.points)==null||n.forEach(r6),Object.hasOwn(i,"y")&&r6(i)})}function r6(e){e.y=-e.y}function _Kt(e){e.nodes().forEach(t=>s6(e.node(t))),e.edges().forEach(t=>{var n;let i=e.edge(t);(n=i.points)==null||n.forEach(s6),Object.hasOwn(i,"x")&&s6(i)})}function s6(e){let t=e.x;e.x=e.y,e.y=t}function jKt(e){let t={},n=e.nodes().filter(l=>!e.children(l).length),i=n.map(l=>e.node(l).rank),r=uh(Math.max,i),s=oA(r+1).map(()=>[]);function o(l){if(t[l])return;t[l]=!0;let c=e.node(l);s[c.rank].push(l);let u=e.successors(l);u&&u.forEach(o)}return n.sort((l,c)=>e.node(l).rank-e.node(c).rank).forEach(o),s}function NKt(e,t){let n=0;for(let i=1;id)),r=t.flatMap(u=>{let d=e.outEdges(u);return d?d.map(f=>({pos:i[f.w],weight:e.edge(f).weight})).sort((f,h)=>f.pos-h.pos):[]}),s=1;for(;s{let d=u.pos+s;l[d]+=u.weight;let f=0;for(;d>0;)d%2&&(f+=l[d+1]),d=d-1>>1,l[d]+=u.weight;c+=u.weight*f}),c}function IKt(e,t=[]){return t.map(n=>{let i=e.inEdges(n);if(!i||!i.length)return{v:n};{let r=i.reduce((s,o)=>{let l=e.edge(o),c=e.node(o.v);return{sum:s.sum+l.weight*c.order,weight:s.weight+l.weight}},{sum:0,weight:0});return{v:n,barycenter:r.sum/r.weight,weight:r.weight}}})}function PKt(e,t){let n={};e.forEach((r,s)=>{let o={indegree:0,in:[],out:[],vs:[r.v],i:s};r.barycenter!==void 0&&(o.barycenter=r.barycenter,o.weight=r.weight),n[r.v]=o}),t.edges().forEach(r=>{let s=n[r.v],o=n[r.w];s!==void 0&&o!==void 0&&(o.indegree++,s.out.push(o))});let i=Object.values(n).filter(r=>!r.indegree);return DKt(i)}function DKt(e){let t=[];function n(r){return s=>{s.merged||(s.barycenter===void 0||r.barycenter===void 0||s.barycenter>=r.barycenter)&&MKt(r,s)}}function i(r){return s=>{s.in.push(r),--s.indegree===0&&e.push(s)}}for(;e.length;){let r=e.pop();t.push(r),r.in.reverse().forEach(n(r)),r.out.forEach(i(r))}return t.filter(r=>!r.merged).map(r=>NP(r,["vs","i","barycenter","weight"]))}function MKt(e,t){let n=0,i=0;e.weight&&(n+=e.barycenter*e.weight,i+=e.weight),t.weight&&(n+=t.barycenter*t.weight,i+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/i,e.weight=i,e.i=Math.min(t.i,e.i),t.merged=!0}function LKt(e,t){let n=$Wt(e,d=>Object.hasOwn(d,"barycenter")),i=n.lhs,r=n.rhs.sort((d,f)=>f.i-d.i),s=[],o=0,l=0,c=0;i.sort($Kt(!!t)),c=Soe(s,r,c),i.forEach(d=>{c+=d.vs.length,s.push(d.vs),o+=d.barycenter*d.weight,l+=d.weight,c=Soe(s,r,c)});let u={vs:s.flat(1)};return l&&(u.barycenter=o/l,u.weight=l),u}function Soe(e,t,n){let i;for(;t.length&&(i=t[t.length-1]).i<=n;)t.pop(),e.push(i.vs),n++;return n}function $Kt(e){return(t,n)=>t.barycentern.barycenter?1:e?n.i-t.i:t.i-n.i}function GBe(e,t,n,i){let r=e.children(t),s=e.node(t),o=s?s.borderLeft:void 0,l=s?s.borderRight:void 0,c={};o&&(r=r.filter(h=>h!==o&&h!==l));let u=IKt(e,r);u.forEach(h=>{if(e.children(h.v).length){let m=GBe(e,h.v,n,i);c[h.v]=m,Object.hasOwn(m,"barycenter")&&BKt(h,m)}});let d=PKt(u,n);FKt(d,c);let f=LKt(d,i);if(o&&l){f.vs=[o,f.vs,l].flat(1);let h=e.predecessors(o);if(h&&h.length){let m=e.node(h[0]),g=e.predecessors(l),b=e.node(g[0]);Object.hasOwn(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+m.order+b.order)/(f.weight+2),f.weight+=2}}return f}function FKt(e,t){e.forEach(n=>{n.vs=n.vs.flatMap(i=>t[i]?t[i].vs:i)})}function BKt(e,t){e.barycenter!==void 0?(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight):(e.barycenter=t.barycenter,e.weight=t.weight)}function UKt(e,t,n,i){i||(i=e.nodes());let r=QKt(e),s=new Dd({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(o=>e.node(o));return i.forEach(o=>{let l=e.node(o),c=e.parent(o);if(l.rank===t||l.minRank<=t&&t<=l.maxRank){s.setNode(o),s.setParent(o,c||r);let u=e[n](o);u&&u.forEach(d=>{let f=d.v===o?d.w:d.v,h=s.edge(f,o),m=h!==void 0?h.weight:0;s.setEdge(f,o,{weight:e.edge(d).weight+m})}),Object.hasOwn(l,"minRank")&&s.setNode(o,{borderLeft:l.borderLeft[t],borderRight:l.borderRight[t]})}}),s}function QKt(e){let t;for(;e.hasNode(t=uK("_root")););return t}function zKt(e,t,n){let i={},r;n.forEach(s=>{let o=e.parent(s),l,c;for(;o;){if(l=e.parent(o),l?(c=i[l],i[l]=o):(c=r,r=o),c&&c!==o){t.setEdge(c,o);return}o=l}})}function XBe(e,t={}){if(typeof t.customOrder=="function"){t.customOrder(e,XBe);return}let n=$Be(e),i=Eoe(e,oA(1,n+1),"inEdges"),r=Eoe(e,oA(n-1,-1,-1),"outEdges"),s=jKt(e);if(Coe(e,s),t.disableOptimalOrderHeuristic)return;let o=Number.POSITIVE_INFINITY,l,c=t.constraints||[];for(let u=0,d=0;d<4;++u,++d){VKt(u%2?i:r,u%4>=2,c),s=UT(e);let f=NKt(e,s);f{i.has(s)||i.set(s,[]),i.get(s).push(o)};for(let s of e.nodes()){let o=e.node(s);if(typeof o.rank=="number"&&r(o.rank,s),typeof o.minRank=="number"&&typeof o.maxRank=="number")for(let l=o.minRank;l<=o.maxRank;l++)l!==o.rank&&r(l,s)}return t.map(function(s){return UKt(e,s,n,i.get(s)||[])})}function VKt(e,t,n){let i=new Dd;e.forEach(function(r){n.forEach(l=>i.setEdge(l.left,l.right));let s=r.graph().root,o=GBe(r,s,i,t);o.vs.forEach((l,c)=>r.node(l).order=c),zKt(r,i,o.vs)})}function Coe(e,t){Object.values(t).forEach(n=>n.forEach((i,r)=>e.node(i).order=r))}function HKt(e,t){let n={};function i(r,s){let o=0,l=0,c=r.length,u=s[s.length-1];return s.forEach((d,f)=>{let h=WKt(e,d),m=h?e.node(h).order:c;(h||d===u)&&(s.slice(l,f+1).forEach(g=>{let b=e.predecessors(g);b&&b.forEach(v=>{let y=e.node(v),w=y.order;(w{let f=s[d];if(f!==void 0&&e.node(f).dummy){let h=e.predecessors(f);h&&h.forEach(m=>{if(m===void 0)return;let g=e.node(m);g.dummy&&(g.orderu)&&YBe(n,m,f)})}})}function r(s,o){let l=-1,c=-1,u=0;return o.forEach((d,f)=>{if(e.node(d).dummy==="border"){let h=e.predecessors(d);if(h&&h.length){let m=h[0];if(m===void 0)return;c=e.node(m).order,i(o,u,f,l,c),u=f,l=c}}i(o,u,o.length,c,s.length)}),o}return t.length&&t.reduce(r),n}function WKt(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(i=>e.node(i).dummy)}}function YBe(e,t,n){if(t>n){let r=t;t=n,n=r}let i=e[t];i||(e[t]=i={}),i[n]=!0}function KKt(e,t,n){if(t>n){let r=t;t=n,n=r}let i=e[t];return i!==void 0&&Object.hasOwn(i,n)}function GKt(e,t,n,i){let r={},s={},o={};return t.forEach(l=>{l.forEach((c,u)=>{r[c]=c,s[c]=c,o[c]=u})}),t.forEach(l=>{let c=-1;l.forEach(u=>{let d=i(u);if(d&&d.length){let f=d.sort((m,g)=>{let b=o[m],v=o[g];return(b!==void 0?b:0)-(v!==void 0?v:0)}),h=(f.length-1)/2;for(let m=Math.floor(h),g=Math.ceil(h);m<=g;++m){let b=f[m];if(b===void 0)continue;let v=o[b];if(v!==void 0&&s[u]===u&&c{var y;let w=(y=s[v.v])!=null?y:0,x=o.edge(v);return Math.max(b,w+(x!==void 0?x:0))},0):s[m]=0}function d(m){let g=o.outEdges(m),b=Number.POSITIVE_INFINITY;g&&(b=g.reduce((y,w)=>{let x=s[w.w],O=o.edge(w);return Math.min(y,(x!==void 0?x:0)-(O!==void 0?O:0))},Number.POSITIVE_INFINITY));let v=e.node(m);b!==Number.POSITIVE_INFINITY&&v.borderType!==l&&(s[m]=Math.max(s[m]!==void 0?s[m]:0,b))}function f(m){return o.predecessors(m)||[]}function h(m){return o.successors(m)||[]}return c(u,f),c(d,h),Object.keys(i).forEach(m=>{var g;let b=n[m];b!==void 0&&(s[m]=(g=s[b])!=null?g:0)}),s}function YKt(e,t,n,i){let r=new Dd,s=e.graph(),o=nGt(s.nodesep,s.edgesep,i);return t.forEach(l=>{let c;l.forEach(u=>{let d=n[u];if(d!==void 0){if(r.setNode(d),c!==void 0){let f=n[c];if(f!==void 0){let h=r.edge(f,d);r.setEdge(f,d,Math.max(o(e,u,c),h||0))}}c=u}})}),r}function ZKt(e,t){return Object.values(t).reduce((n,i)=>{let r=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY;Object.entries(i).forEach(([l,c])=>{let u=iGt(e,l)/2;r=Math.max(c+u,r),s=Math.min(c-u,s)});let o=r-s;return o{["l","r"].forEach(o=>{let l=s+o,c=e[l];if(!c||c===t)return;let u=Object.values(c),d=i-uh(Math.min,u);o!=="l"&&(d=r-uh(Math.max,u)),d&&(e[l]=TL(c,f=>f+d))})})}function eGt(e,t=void 0){let n=e.ul;return n?TL(n,(i,r)=>{var s,o;if(t){let c=t.toLowerCase(),u=e[c];if(u&&u[r]!==void 0)return u[r]}let l=Object.values(e).map(c=>{let u=c[r];return u!==void 0?u:0}).sort((c,u)=>c-u);return(((s=l[1])!=null?s:0)+((o=l[2])!=null?o:0))/2}):{}}function tGt(e){let t=UT(e),n=Object.assign(HKt(e,t),qKt(e,t)),i={},r;["u","d"].forEach(o=>{r=o==="u"?t:Object.values(t).reverse(),["l","r"].forEach(l=>{l==="r"&&(r=r.map(d=>Object.values(d).reverse()));let c=GKt(e,r,n,d=>(o==="u"?e.predecessors(d):e.successors(d))||[]),u=XKt(e,r,c.root,c.align,l==="r");l==="r"&&(u=TL(u,d=>-d)),i[o+l]=u})});let s=ZKt(e,i);return JKt(i,s),eGt(i,e.graph().align)}function nGt(e,t,n){return(i,r,s)=>{let o=i.node(r),l=i.node(s),c=0,u;if(c+=o.width/2,Object.hasOwn(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":u=-o.width/2;break;case"r":u=o.width/2;break}if(u&&(c+=n?u:-u),u=void 0,c+=(o.dummy?t:e)/2,c+=(l.dummy?t:e)/2,c+=l.width/2,Object.hasOwn(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":u=l.width/2;break;case"r":u=-l.width/2;break}return u&&(c+=n?u:-u),c}}function iGt(e,t){return e.node(t).width}function rGt(e){e=MBe(e),sGt(e),Object.entries(tGt(e)).forEach(([t,n])=>e.node(t).x=n)}function sGt(e){let t=UT(e),n=e.graph(),i=n.ranksep,r=n.rankalign,s=0;t.forEach(o=>{let l=o.reduce((c,u)=>{var d;let f=(d=e.node(u).height)!=null?d:0;return c>f?c:f},0);o.forEach(c=>{let u=e.node(c);r==="top"?u.y=s+u.height/2:r==="bottom"?u.y=s+l-u.height/2:u.y=s+l/2}),s+=l+i})}function aGt(e,t={}){let n=t.debugTiming?FBe:BBe;return n("layout",()=>{let i=n(" buildLayoutGraph",()=>gGt(e));return n(" runLayout",()=>oGt(i,n,t)),n(" updateInputGraph",()=>lGt(e,i)),i})}function oGt(e,t,n){t(" makeSpaceForEdgeLabels",()=>bGt(e)),t(" removeSelfEdges",()=>CGt(e)),t(" acyclic",()=>XWt(e)),t(" nestingGraph.run",()=>xKt(e)),t(" rank",()=>fKt(MBe(e))),t(" injectEdgeLabelProxies",()=>yGt(e)),t(" removeEmptyRanks",()=>MWt(e)),t(" nestingGraph.cleanup",()=>kKt(e)),t(" normalizeRanks",()=>DWt(e)),t(" assignRankMinMax",()=>vGt(e)),t(" removeEdgeLabelProxies",()=>xGt(e)),t(" normalize.run",()=>JWt(e)),t(" parentDummyChains",()=>gKt(e)),t(" addBorderSegments",()=>SKt(e)),t(" order",()=>XBe(e,n)),t(" insertSelfEdges",()=>AGt(e)),t(" adjustCoordinateSystem",()=>CKt(e)),t(" position",()=>rGt(e)),t(" positionSelfEdges",()=>TGt(e)),t(" removeBorderNodes",()=>EGt(e)),t(" normalize.undo",()=>tKt(e)),t(" fixupEdgeLabelCoords",()=>kGt(e)),t(" undoCoordinateSystem",()=>AKt(e)),t(" translateGraph",()=>wGt(e)),t(" assignNodeIntersects",()=>OGt(e)),t(" reversePoints",()=>SGt(e)),t(" acyclic.undo",()=>ZWt(e))}function lGt(e,t){e.nodes().forEach(n=>{let i=e.node(n),r=t.node(n);i&&(i.x=r.x,i.y=r.y,i.order=r.order,i.rank=r.rank,t.children(n).length&&(i.width=r.width,i.height=r.height))}),e.edges().forEach(n=>{let i=e.edge(n),r=t.edge(n);i.points=r.points,Object.hasOwn(r,"x")&&(i.x=r.x,i.y=r.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var cGt=["nodesep","edgesep","ranksep","marginx","marginy"],uGt={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},dGt=["acyclicer","ranker","rankdir","align","rankalign"],fGt=["width","height","rank"],Aoe={width:0,height:0},hGt=["minlen","weight","width","height","labeloffset"],pGt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},mGt=["labelpos"];function gGt(e){let t=new Dd({multigraph:!0,compound:!0}),n=o6(e.graph());return t.setGraph(Object.assign({},uGt,a6(n,cGt),NP(n,dGt))),e.nodes().forEach(i=>{let r=o6(e.node(i)),s=a6(r,fGt);Object.keys(Aoe).forEach(l=>{s[l]===void 0&&(s[l]=Aoe[l])}),t.setNode(i,s);let o=e.parent(i);o!==void 0&&t.setParent(i,o)}),e.edges().forEach(i=>{let r=o6(e.edge(i));t.setEdge(i,Object.assign({},pGt,a6(r,hGt),NP(r,mGt)))}),t}function bGt(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let i=e.edge(n);i.minlen*=2,i.labelpos.toLowerCase()!=="c"&&(t.rankdir==="TB"||t.rankdir==="BT"?i.width+=i.labeloffset:i.height+=i.labeloffset)})}function yGt(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let i=e.node(t.v),r={rank:(e.node(t.w).rank-i.rank)/2+i.rank,e:t};vO(e,"edge-proxy",r,"_ep")}})}function vGt(e){let t=0;e.nodes().forEach(n=>{let i=e.node(n);i.borderTop&&(i.minRank=e.node(i.borderTop).rank,i.maxRank=e.node(i.borderBottom).rank,t=Math.max(t,i.maxRank))}),e.graph().maxRank=t}function xGt(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy==="edge-proxy"){let i=n;e.edge(i.e).labelRank=n.rank,e.removeNode(t)}})}function wGt(e){let t=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,r=0,s=e.graph(),o=s.marginx||0,l=s.marginy||0;function c(u){let d=u.x,f=u.y,h=u.width,m=u.height;t=Math.min(t,d-h/2),n=Math.max(n,d+h/2),i=Math.min(i,f-m/2),r=Math.max(r,f+m/2)}e.nodes().forEach(u=>c(e.node(u))),e.edges().forEach(u=>{let d=e.edge(u);Object.hasOwn(d,"x")&&c(d)}),t-=o,i-=l,e.nodes().forEach(u=>{let d=e.node(u);d.x-=t,d.y-=i}),e.edges().forEach(u=>{let d=e.edge(u);d.points.forEach(f=>{f.x-=t,f.y-=i}),Object.hasOwn(d,"x")&&(d.x-=t),Object.hasOwn(d,"y")&&(d.y-=i)}),s.width=n-t+o,s.height=r-i+l}function OGt(e){e.edges().forEach(t=>{let n=e.edge(t),i=e.node(t.v),r=e.node(t.w),s,o;n.points?(s=n.points[0],o=n.points[n.points.length-1]):(n.points=[],s=r,o=i),n.points.unshift(boe(i,s)),n.points.push(boe(r,o))})}function kGt(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,"x"))switch((n.labelpos==="l"||n.labelpos==="r")&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}})}function SGt(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function EGt(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),i=e.node(n.borderTop),r=e.node(n.borderBottom),s=e.node(n.borderLeft[n.borderLeft.length-1]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-s.x),n.height=Math.abs(r.y-i.y),n.x=s.x+n.width/2,n.y=i.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy==="border"&&e.removeNode(t)})}function CGt(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function AGt(e){UT(e).forEach(t=>{let n=0;t.forEach((i,r)=>{let s=e.node(i);s.order=r+n,(s.selfEdges||[]).forEach(o=>{vO(e,"selfedge",{width:o.label.width,height:o.label.height,rank:s.rank,order:r+ ++n,e:o.e,label:o.label},"_se")}),delete s.selfEdges})})}function TGt(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy==="selfedge"){let i=n,r=e.node(i.e.v),s=r.x+r.width/2,o=r.y,l=n.x-s,c=r.height/2;e.setEdge(i.e,i.label),e.removeNode(t),i.label.points=[{x:s+2*l/3,y:o-c},{x:s+5*l/6,y:o-c},{x:s+l,y:o},{x:s+5*l/6,y:o+c},{x:s+2*l/3,y:o+c}],i.label.x=n.x,i.label.y=n.y}})}function a6(e,t){return TL(NP(e,t),Number)}function o6(e){let t={};return e&&Object.entries(e).forEach(([n,i])=>{typeof n=="string"&&(n=n.toLowerCase()),t[n]=i}),t}function _Gt(e){let t=UT(e),n=new Dd({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(i=>{n.setNode(i,{label:i}),n.setParent(i,"layer"+e.node(i).rank)}),e.edges().forEach(i=>n.setEdge(i.v,i.w,{},i.name)),t.forEach((i,r)=>{let s="layer"+r;n.setNode(s,{rank:"same"}),i.reduce((o,l)=>(n.setEdge(o,l,{style:"invis"}),l))}),n}var jGt={graphlib:ABe,version:UWt,layout:aGt,debug:_Gt,util:{time:FBe,notime:BBe}},Toe=jGt;/*! For license information please see dagre.esm.js.LEGAL.txt */const vS={llm:{labelKey:"buildCanvas.patterns.llm.label",descriptionKey:"buildCanvas.patterns.llm.description",icon:Lje},sequential:{labelKey:"buildCanvas.patterns.sequential.label",descriptionKey:"buildCanvas.patterns.sequential.description",icon:Bat},parallel:{labelKey:"buildCanvas.patterns.parallel.label",descriptionKey:"buildCanvas.patterns.parallel.description",icon:xat},loop:{labelKey:"buildCanvas.patterns.loop.label",descriptionKey:"buildCanvas.patterns.loop.description",icon:Qje},a2a:{labelKey:"buildCanvas.patterns.a2a.label",descriptionKey:"buildCanvas.patterns.a2a.description",icon:tM}},U7=220,Q7=88,_oe=96,joe=34,EE=64,l6=310,Qx=24,ZBe=56,z7=40,Noe=40,NGt=18,RGt=58,IGt=!1,PGt=e=>e==="sequential"||e==="parallel"||e==="loop";function V7(e,t){const n=e.agentType??"llm";return PGt(n)||n==="llm"&&(t.length===0||e.subAgents.length>0)}function H7(e,t=[],n="horizontal",i=!1){const r=e.agentType??"llm";if(!V7(e,t))return{width:U7,height:Q7};if(i&&e.subAgents.length===0)return{width:l6,height:EE};const s=e.subAgents.map((f,h)=>H7(f,[...t,h],n,i)),o=s.length?Math.max(...s.map(f=>f.width)):0,l=s.length?Math.max(...s.map(f=>f.height)):0,c=s.length&&r!=="parallel"?ZBe:Qx,u=n==="horizontal"?r!=="parallel":r==="parallel",d=s.length?r==="parallel"?NGt+Noe:r==="loop"?RGt:0:Noe;return u?{width:Math.max(l6,s.reduce((f,h)=>f+h.width,0)+z7*Math.max(0,s.length-1)+c*2),height:EE+Qx+l+d+Qx}:{width:Math.max(l6,o+Qx*2),height:EE+c+s.reduce((f,h)=>f+h.height,0)+z7*Math.max(0,s.length-1)+d+c}}function Ak(e){return e.length===0?"agent-root":`agent-${e.join("-")}`}function DGt(e,t){return e.length===t.length&&e.every((n,i)=>n===t[i])}function Roe(e){const t=n=>[n.agentType??"llm",n.subAgents.map(t)];return JSON.stringify(t(e))}function Tk(e,t,n,i){const r=(i==null?void 0:i.tone)==="sequential"?"hsl(213 40% 40%)":(i==null?void 0:i.tone)==="loop"?"hsl(151 34% 34%)":"hsl(220 9% 38%)";return{id:`${e}-${t}${i!=null&&i.loop?"-loop":""}`,source:e,target:t,sourceHandle:i!=null&&i.loop?"loop-source":void 0,targetHandle:i!=null&&i.loop?"loop-target":void 0,label:n,type:"insertStep",data:i?{insert:i.insert,loop:i.loop,tone:i.tone}:void 0,animated:i==null?void 0:i.loop,markerEnd:{type:iA.ArrowClosed,width:16,height:16,color:r},style:{stroke:r,strokeWidth:1.5},labelStyle:{fill:"hsl(215 14% 42%)",fontSize:10,fontWeight:600},labelBgStyle:{fill:"hsl(var(--background))",fillOpacity:.92}}}function Ioe(e,t,n=!1,i){const r=[{id:"terminal-input",type:"terminal",position:{x:0,y:0},data:{kind:"terminal",title:i("buildCanvas.terminals.input")},selectable:!1,draggable:!1},{id:"terminal-output",type:"terminal",position:{x:0,y:0},data:{kind:"terminal",title:i("buildCanvas.terminals.output")},selectable:!1,draggable:!1}],s=[];function o(f,h,m,g,b){const v=f.agentType??"llm",y=Ak(h);return V7(f,h)?(l(f,h,m,g,b),y):(r.push({id:y,type:"agent",parentId:m,extent:"parent",position:g,data:{kind:"agent",path:h,agent:f,title:v==="a2a"?i("buildCanvas.patterns.a2a.label"):f.name.trim()||(h.length===0?i("buildCanvas.rootAgent"):i("buildCanvas.unnamedStep")),pattern:v,description:f.description.trim()||i(vS[v].descriptionKey),childCount:f.subAgents.length,containedIn:b}}),y)}function l(f,h,m,g={x:0,y:0},b){const v=f.agentType??"sequential",y=Ak(h),w=H7(f,h,t,n);r.push({id:y,type:"group",parentId:m,extent:m?"parent":void 0,position:g,style:{width:w.width,height:w.height},data:{kind:"agent",path:h,agent:f,title:f.name.trim()||(h.length===0?i("buildCanvas.rootAgent"):i(vS[v].labelKey)),pattern:v,description:f.description.trim()||i(vS[v].descriptionKey),childCount:f.subAgents.length,containedIn:b,layoutWidth:w.width,layoutHeight:w.height,compactEmptyGroup:n&&f.subAgents.length===0}});const x=f.subAgents.map((E,j)=>H7(E,[...h,j],t,n)),O=x.length&&v!=="parallel"?ZBe:Qx,k=t==="horizontal"?v!=="parallel":v==="parallel";let S=O;const C=f.subAgents.map((E,j)=>{const T=x[j],R=k?{x:S,y:EE+Qx}:{x:(w.width-T.width)/2,y:EE+S};return S+=(k?T.width:T.height)+z7,o(E,[...h,j],y,R,v)});if(v==="sequential"||v==="loop"){for(let E=0;E1&&s.push(Tk(C[C.length-1],C[0],i("buildCanvas.edges.continueLoop"),{loop:!0,tone:"loop"}))}return y}const c=(f,h)=>{const m=f.agentType??"llm",g=Ak(h);if(V7(f,h))return l(f,h),[g];if(r.push({id:g,type:"agent",position:{x:0,y:0},data:{kind:"agent",path:h,agent:f,title:m==="a2a"?i("buildCanvas.patterns.a2a.label"):f.name.trim()||(h.length===0?i("buildCanvas.rootAgent"):i("buildCanvas.unnamedStep")),pattern:m,description:f.description.trim()||i(vS[m].descriptionKey),childCount:f.subAgents.length}}),f.subAgents.length===0)return[g];const b=[];return f.subAgents.forEach((v,y)=>{const w=[...h,y],x=Ak(w);s.push(Tk(g,x,i("buildCanvas.edges.call"),{insert:{parentPath:h,index:y}})),b.push(...c(v,w))}),b},u=Ak([]),d=c(e,[]);return s.push(Tk("terminal-input",u)),d.forEach(f=>s.push(Tk(f,"terminal-output"))),MGt(r,s,t)}function MGt(e,t,n){const i=new Toe.graphlib.Graph().setDefaultEdgeLabel(()=>({}));i.setGraph({rankdir:n==="vertical"?"TB":"LR",ranksep:50,nodesep:34,edgesep:14,marginx:24,marginy:24});const r=new Set(e.filter(s=>!s.parentId).map(s=>s.id));return e.filter(s=>!s.parentId).forEach(s=>{const o=s.data.kind==="terminal";i.setNode(s.id,{width:o?_oe:s.data.layoutWidth??U7,height:o?joe:s.data.layoutHeight??Q7})}),t.filter(s=>r.has(s.source)&&r.has(s.target)).forEach(s=>i.setEdge(s.source,s.target)),Toe.layout(i),{nodes:e.map(s=>{if(s.parentId)return s;const o=i.node(s.id),l=s.data.kind==="terminal",c=l?_oe:s.data.layoutWidth??U7,u=l?joe:s.data.layoutHeight??Q7;return{...s,position:{x:o.x-c/2,y:o.y-u/2}}}),edges:t}}const jL=p.createContext(null),NL=p.createContext("horizontal");function LGt({id:e,sourceX:t,sourceY:n,targetX:i,targetY:r,sourcePosition:s,targetPosition:o,markerEnd:l,style:c,label:u,data:d}){const{t:f}=Te("create"),h=p.useContext(jL),[m,g]=p.useState(!1),[b,v,y]=AP({sourceX:t,sourceY:n,targetX:i,targetY:r,sourcePosition:s,targetPosition:o,offset:d!=null&&d.loop?28:20});return a.jsxs(a.Fragment,{children:[a.jsx(BT,{id:e,path:b,markerEnd:l,style:c}),h&&(d==null?void 0:d.insert)&&a.jsx("path",{d:b,className:"abc-edge-hover-path",onPointerEnter:()=>g(!0),onPointerLeave:()=>g(!1)}),(u||h&&(d==null?void 0:d.insert))&&a.jsx(_qt,{children:a.jsxs("div",{className:`abc-edge-tools${h&&(d!=null&&d.insert)?" can-insert":""}${m?" is-visible":""}`,style:{transform:`translate(-50%, -50%) translate(${v}px, ${y}px)`},onPointerEnter:()=>g(!0),onPointerLeave:()=>g(!1),children:[u&&a.jsx("span",{className:"abc-edge-label",children:u}),h&&(d==null?void 0:d.insert)&&a.jsx("button",{type:"button",className:"abc-edge-add nodrag nopan","aria-label":f("buildCanvas.actions.insertHere"),title:f("buildCanvas.actions.insertHere"),onClick:w=>{w.stopPropagation(),h==null||h.onInsert(d.insert.parentPath,d.insert.index)},children:a.jsx(sc,{})})]})})]})}function $Gt({data:e,selected:t}){const{t:n}=Te("create"),i=p.useContext(jL),r=p.useContext(NL),s=r==="vertical"?xn.Top:xn.Left,o=r==="vertical"?xn.Bottom:xn.Right,l=r==="vertical"?xn.Right:xn.Bottom,c=e.pattern??"llm",u=vS[c],d=u.icon;return a.jsxs("div",{className:`abc-node is-${c}${e.containedIn?` is-contained-in-${e.containedIn}`:""}${t?" is-selected":""}`,children:[a.jsx($c,{type:"target",position:s,className:"abc-handle"}),c!=="llm"&&a.jsx("span",{className:"abc-node-icon",children:a.jsx(d,{})}),a.jsxs("span",{className:"abc-node-copy",children:[a.jsx("span",{className:"abc-node-meta",children:a.jsx("span",{children:n(u.labelKey)})}),a.jsx("strong",{children:e.title}),a.jsx("small",{children:e.description})]}),i&&e.path!==void 0&&e.path.length>0&&a.jsx("button",{type:"button",className:"abc-node-delete nodrag nopan","aria-label":n("buildCanvas.actions.deleteNamed",{name:e.title}),title:n("buildCanvas.actions.deleteNode"),onClick:f=>{f.stopPropagation(),i==null||i.onDelete(e.path)},children:a.jsx(eb,{})}),a.jsx($c,{type:"source",position:o,className:"abc-handle"}),e.containedIn==="loop"&&a.jsxs(a.Fragment,{children:[a.jsx($c,{id:"loop-target",type:"target",position:l,className:"abc-handle abc-loop-handle"}),a.jsx($c,{id:"loop-source",type:"source",position:l,className:"abc-handle abc-loop-handle"})]})]})}function FGt({data:e,selected:t}){const{t:n}=Te("create"),i=p.useContext(jL),r=p.useContext(NL),s=r==="vertical"?xn.Top:xn.Left,o=r==="vertical"?xn.Bottom:xn.Right,l=r==="vertical"?xn.Right:xn.Bottom,c=e.pattern??"sequential",u=e.childCount??0,d=n(c==="llm"?"buildCanvas.actions.addSubagent":c==="parallel"?"buildCanvas.actions.addParallelStep":c==="loop"?"buildCanvas.actions.addLoopStep":"buildCanvas.actions.addNextStep");return a.jsxs("div",{className:`abc-group is-${c}${e.compactEmptyGroup?" is-compact-empty":""}${t?" is-selected":""}`,children:[a.jsx($c,{type:"target",position:s,className:"abc-handle"}),a.jsx("header",{className:"abc-group-head",children:a.jsxs("span",{children:[a.jsx("strong",{title:e.title,children:e.title}),a.jsx("small",{children:e.description})]})}),i&&e.path!==void 0&&u>0&&c!=="parallel"&&a.jsxs("div",{className:"abc-group-boundary-actions",children:[a.jsx("button",{type:"button",className:"abc-group-boundary-add is-start nodrag nopan","aria-label":n("buildCanvas.actions.addFirst"),title:n("buildCanvas.actions.addFirst"),onClick:f=>{f.stopPropagation(),i.onInsert(e.path,0)},children:a.jsx(sc,{})}),a.jsx("button",{type:"button",className:"abc-group-boundary-add is-end nodrag nopan","aria-label":n("buildCanvas.actions.addLast"),title:n("buildCanvas.actions.addLast"),onClick:f=>{f.stopPropagation(),i.onAdd(e.path)},children:a.jsx(sc,{})})]}),i&&e.path!==void 0&&u>0&&c==="parallel"&&a.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-bottom nodrag nopan",onClick:f=>{f.stopPropagation(),i.onAdd(e.path)},children:[a.jsx(sc,{}),a.jsx("span",{children:d})]}),i&&e.path!==void 0&&u===0&&a.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-empty nodrag nopan",onClick:f=>{f.stopPropagation(),i.onAdd(e.path)},children:[a.jsx(sc,{}),a.jsx("span",{children:d})]}),i&&e.path!==void 0&&e.path.length>0&&a.jsx("button",{type:"button",className:"abc-node-delete nodrag nopan","aria-label":n("buildCanvas.actions.deleteNamed",{name:e.title}),title:n("buildCanvas.actions.deleteNode"),onClick:f=>{f.stopPropagation(),i==null||i.onDelete(e.path)},children:a.jsx(eb,{})}),a.jsx($c,{type:"source",position:o,className:"abc-handle"}),e.containedIn==="loop"&&a.jsxs(a.Fragment,{children:[a.jsx($c,{id:"loop-target",type:"target",position:l,className:"abc-handle abc-loop-handle"}),a.jsx($c,{id:"loop-source",type:"source",position:l,className:"abc-handle abc-loop-handle"})]})]})}function BGt({data:e}){const t=p.useContext(NL);return a.jsxs("div",{className:"abc-terminal",children:[a.jsx($c,{type:"target",position:t==="vertical"?xn.Top:xn.Left,className:"abc-handle"}),a.jsx("span",{children:e.title}),a.jsx($c,{type:"source",position:t==="vertical"?xn.Bottom:xn.Right,className:"abc-handle"})]})}const UGt={agent:$Gt,group:FGt,terminal:BGt},QGt={insertStep:LGt};function zGt({draft:e,selectedPath:t,onSelect:n,onAdd:i,onInsert:r,onDelete:s,readOnly:o=!1,interactivePreview:l=!1,direction:c="horizontal"}){const{t:u}=Te("create"),d=p.useMemo(()=>Ioe(e,c,o,u),[]),[f,h,m]=jqt(d.nodes),[g,b,v]=Nqt(d.edges),y=Iqt(),w=p.useRef(`${c}:${o?"readonly":"editable"}:${Roe(e)}`),x=p.useRef(null),{fitView:O}=CL(),k=p.useMemo(()=>Ioe(e,c,o,u),[c,e,o,u]),[S,C]=p.useState(()=>window.matchMedia("(max-width: 860px)").matches),E=p.useMemo(()=>o?{padding:.16,minZoom:.05,maxZoom:.9}:S?{padding:.08,minZoom:.35,maxZoom:.9}:{padding:.14,minZoom:.42,maxZoom:1.1},[S,o]),j=p.useCallback((R=0)=>{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{const A=x.current;if(A&&(A.clientWidth===0||A.clientHeight===0)&&R<8){j(R+1);return}O(E)})})},[E,O]);p.useEffect(()=>{const R=window.matchMedia("(max-width: 860px)"),A=N=>C(N.matches);return R.addEventListener("change",A),()=>R.removeEventListener("change",A)},[]),p.useEffect(()=>{const R=`${c}:${o?"readonly":"editable"}:${Roe(e)}`,A=R!==w.current;w.current=R,b(k.edges),h(N=>{const P=new Map(N.map(I=>[I.id,I]));return k.nodes.map(I=>{const D=P.get(I.id);return{...I,measured:!A&&D&&D.type===I.type?D.measured:void 0,position:!A&&D?D.position:I.position,selected:I.data.kind==="agent"&&!!I.data.path&&DGt(I.data.path,t)}})}),A&&j()},[k,e,j,t,b,h]),p.useEffect(()=>{j()},[S,j]),p.useEffect(()=>{y&&j()},[k,j,y]),p.useEffect(()=>{if(!o||!x.current)return;const R=new ResizeObserver(()=>j());return R.observe(x.current),j(),()=>R.disconnect()},[j,o]);const T=p.useMemo(()=>o?null:{onAdd:i,onInsert:r,onDelete:s},[i,s,r,o]);return a.jsx(NL.Provider,{value:c,children:a.jsx(jL.Provider,{value:T,children:a.jsx("section",{className:`abc-root is-${c}${o?" is-readonly":""}`,"aria-label":u(o?"buildCanvas.readOnlyLabel":"buildCanvas.label"),children:a.jsx("div",{ref:x,className:"abc-canvas",children:a.jsxs(Aqt,{nodes:f,edges:g,nodeTypes:UGt,edgeTypes:QGt,onNodesChange:m,onEdgesChange:v,onNodeClick:(R,A)=>{!o&&A.data.kind==="agent"&&A.data.path&&n(A.data.path)},nodesDraggable:!o,nodesConnectable:!1,nodesFocusable:!o,elementsSelectable:!o,edgesFocusable:!1,edgesReconnectable:!1,panOnDrag:!o||l,zoomOnDoubleClick:l,zoomOnPinch:!o||l,zoomOnScroll:!o||l,fitView:!0,fitViewOptions:E,onInit:()=>j(),minZoom:o?.05:.35,maxZoom:1.6,proOptions:{hideAttribution:!0},ariaLabelConfig:{"controls.ariaLabel":u("buildCanvas.controls.ariaLabel"),"controls.zoomIn.ariaLabel":u("buildCanvas.controls.zoomIn"),"controls.zoomOut.ariaLabel":u("buildCanvas.controls.zoomOut"),"controls.fitView.ariaLabel":u("buildCanvas.controls.fitView")},children:[a.jsx($qt,{gap:20,size:1.2,color:"hsl(34 20% 82%)"}),(!o||l)&&a.jsx(Hqt,{showInteractive:!1}),IGt]})})})})})}function RP(e){return a.jsx(OBe,{children:a.jsx(zGt,{...e})})}function VGt(e){return[{id:"case-1",itemKey:"case-1",kind:"good",input:e("agentWorkspace.defaultCases.weeklyFeedback.input"),output:e("agentWorkspace.defaultCases.weeklyFeedback.output"),referenceOutput:e("agentWorkspace.defaultCases.weeklyFeedback.output"),comment:"",agentName:e("agentWorkspace.defaultCases.agentName"),sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T09:12:00+08:00",evaluationSetId:"",evaluationSetName:e("agentWorkspace.defaultCases.goodSetName"),workspaceId:"",tag:e("agentWorkspace.defaultCases.weeklyFeedback.tag"),source:"auto",score:.92,reason:e("agentWorkspace.defaultCases.weeklyFeedback.reason")},{id:"case-2",itemKey:"case-2",kind:"good",input:e("agentWorkspace.defaultCases.research.input"),output:e("agentWorkspace.defaultCases.research.output"),referenceOutput:e("agentWorkspace.defaultCases.research.output"),comment:"",agentName:e("agentWorkspace.defaultCases.agentName"),sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T08:47:00+08:00",evaluationSetId:"",evaluationSetName:e("agentWorkspace.defaultCases.goodSetName"),workspaceId:"",tag:e("agentWorkspace.defaultCases.research.tag"),source:"user"},{id:"case-3",itemKey:"case-3",kind:"bad",input:e("agentWorkspace.defaultCases.uncertainConclusion.input"),output:e("agentWorkspace.defaultCases.uncertainConclusion.output"),referenceOutput:"",comment:"",agentName:e("agentWorkspace.defaultCases.agentName"),sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T07:35:00+08:00",evaluationSetId:"",evaluationSetName:e("agentWorkspace.defaultCases.badSetName"),workspaceId:"",tag:e("agentWorkspace.defaultCases.uncertainConclusion.tag"),source:"auto",score:.28,reason:e("agentWorkspace.defaultCases.uncertainConclusion.reason")},{id:"case-4",itemKey:"case-4",kind:"bad",input:e("agentWorkspace.defaultCases.repeatedTool.input"),output:e("agentWorkspace.defaultCases.repeatedTool.output"),referenceOutput:"",comment:"",agentName:e("agentWorkspace.defaultCases.agentName"),sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T06:58:00+08:00",evaluationSetId:"",evaluationSetName:e("agentWorkspace.defaultCases.badSetName"),workspaceId:"",tag:e("agentWorkspace.defaultCases.repeatedTool.tag"),source:"user"}]}const HGt=[{id:"eval-regression",name:"核心能力回归",agentIds:[],caseSet:"核心回归集",evaluator:"综合质量评估器",metrics:["回答质量","工具调用"],concurrency:"4",history:[{id:"run-1",createdAt:"今天 10:32",score:88,status:"completed"},{id:"run-2",createdAt:"昨天 16:08",score:84,status:"completed"}]},{id:"eval-safety",name:"安全与幻觉检查",agentIds:[],caseSet:"安全边界集",evaluator:"事实一致性评估器",metrics:["事实准确性","拒答合理性"],concurrency:"2",history:[{id:"run-3",createdAt:"7 月 25 日 14:20",score:91,status:"completed"}]}],qGt={核心能力回归:"agentWorkspace.evaluationDefaults.coreRegression",安全与幻觉检查:"agentWorkspace.evaluationDefaults.safetyCheck",核心回归集:"agentWorkspace.evaluationDefaults.coreSet",安全边界集:"agentWorkspace.evaluationDefaults.safetySet",工具调用集:"agentWorkspace.evaluationDefaults.toolSet",综合质量评估器:"agentWorkspace.evaluationDefaults.qualityEvaluator",事实一致性评估器:"agentWorkspace.evaluationDefaults.factualEvaluator",工具调用评估器:"agentWorkspace.evaluationDefaults.toolEvaluator",回答质量:"agentWorkspace.evaluationDefaults.responseQuality",事实准确性:"agentWorkspace.evaluationDefaults.factualAccuracy",工具调用:"agentWorkspace.evaluationDefaults.toolUse",响应效率:"agentWorkspace.evaluationDefaults.responseEfficiency","今天 10:32":"agentWorkspace.evaluationDefaults.todayTime","昨天 16:08":"agentWorkspace.evaluationDefaults.yesterdayTime","7 月 25 日 14:20":"agentWorkspace.evaluationDefaults.julyTime",刚刚:"agentWorkspace.evaluationDefaults.justNow"};function xS(e,t){const n=qGt[e];return n?t(n):e}const WGt=["basic","profileConfig","sessionConfig","usage","diagnostics","evaluations","optimizations","integrations","versions"],KGt=20;function JBe(e,t,n){const i=Date.parse(e);return Number.isNaN(i)?n("agentWorkspace.notProvided"):new Intl.DateTimeFormat(t,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).format(i)}const _k=[{id:"api-server",label:"API Server"},{id:"a2a",label:"A2A"}];function e9e(e){if(!e||typeof e!="object")return"";const t=e.id;return typeof t=="string"?t:""}function dx(e){var t;return e9e((t=e==null?void 0:e.effectiveRefs)==null?void 0:t.model)}function Poe(e,t){var r;const n=(r=e==null?void 0:e.overrides)==null?void 0:r[t];if(!n||typeof n!="object")return"";const i=n.mode;return i==="replace"||i==="clear"||i==="inherit"?i:""}function t9e(e){var n;const t=(n=e==null?void 0:e.effectiveRefs)==null?void 0:n.mcpServers;return Array.isArray(t)?t.map(e9e).filter(Boolean):[]}function GGt(e,t){switch(e){case"active_operation":return t("agentWorkspace.mpaDeleteBlockerActiveOperation");case"active_sessions":return t("agentWorkspace.mpaDeleteBlockerActiveSessions");case"binding_ambiguous":return t("agentWorkspace.mpaDeleteBlockerBindingAmbiguous");case"runtime_missing":return t("agentWorkspace.mpaDeleteBlockerRuntimeMissing");case"orphan_runtime":return t("agentWorkspace.mpaDeleteBlockerOrphanRuntime");default:return e}}function XGt(e,t){switch(e){case"runtime_legacy_auth_unsupported":return t("agentWorkspace.mpaRuntimeLegacyAuthUnsupported");case"profile_not_found":return t("agentWorkspace.mpaRuntimeOrphan");case"binding_ambiguous":return t("agentWorkspace.mpaRuntimeBindingAmbiguous");case"runtime_missing":return t("agentWorkspace.mpaRuntimeMissing");default:return e??""}}function YGt({preview:e,t}){const n=e.blockers.map(i=>GGt(i,t));return a.jsxs("div",{className:"aw-mpa-delete-preview",children:[a.jsx("p",{children:t("agentWorkspace.mpaDeletePreviewSummary")}),a.jsxs("dl",{className:"aw-mpa-delete-preview__stats",children:[a.jsxs("div",{children:[a.jsx("dt",{children:t("agentWorkspace.mpaDeletePreviewSessions")}),a.jsx("dd",{children:e.sessionCounts.total})]}),a.jsxs("div",{children:[a.jsx("dt",{children:t("agentWorkspace.mpaDeletePreviewActiveSessions")}),a.jsx("dd",{children:e.sessionCounts.active})]}),a.jsxs("div",{children:[a.jsx("dt",{children:t("agentWorkspace.mpaDeletePreviewIdleSessions")}),a.jsx("dd",{children:e.sessionCounts.idle})]})]}),n.length>0?a.jsxs("div",{className:"aw-mpa-delete-preview__blockers",role:"status",children:[a.jsx("strong",{children:t("agentWorkspace.mpaDeleteBlocked")}),a.jsx("ul",{children:n.map(i=>a.jsx("li",{children:i},i))})]}):a.jsx("ol",{className:"aw-mpa-delete-preview__plan",children:e.cleanupPlan.map(i=>a.jsx("li",{children:t(`agentWorkspace.mpaDeleteStage.${i.stage}`,{count:i.count})},i.stage))})]})}function c6(e,t){return e instanceof ew&&e.status===412?t:e instanceof Error?e.message:String(e)}function ZGt(e){return t9e(e).length}function Doe(e,t){const n=t9e(e);return n.length?n.join(", "):t("agentWorkspace.none")}function Moe(e,t){var n;return!!((n=e==null?void 0:e.overrides)!=null&&n[t])}function JGt(e,t,n){return`mpa-session-profile-upgrade:${e}:${t}:${n}`}function u6(e,t){return e?`${e.replace(/\/+$/,"")}${t}`:""}function eXt(e,t){const n=e.trim();if(!n||!t)return n;try{const i=new URL(n),r=i.hostname.replace(/^\[|\]$/g,"").toLowerCase();if(!["localhost","127.0.0.1","::1"].includes(r))return n;const s=new URL(t);return i.protocol=s.protocol,i.hostname=s.hostname,i.port=s.port,i.toString()}catch{return n}}function Loe(e,t){return e==="key_auth"?"API Key":e==="custom_jwt"?"OAuth / JWT":t(e==="none"?"agentWorkspace.noAuthentication":"agentWorkspace.notAvailable")}function $oe(e,t){return t(e==="published"?"agentWorkspace.githubStatus.published":e==="publishing"?"agentWorkspace.githubStatus.publishing":e==="failed"?"agentWorkspace.githubStatus.failed":e==="pending"?"agentWorkspace.githubStatus.pending":"agentWorkspace.githubStatus.unknown")}function tXt(e,t){return e.changeType==="rollback"?t("agentWorkspace.rollbackEvent"):e.version}function q7(e){return JSON.stringify(e)}function n9e(e){return e==="key_auth"?`API_KEY = "" +`)),d=u.reduce((f,h)=>f.concat(...h),[]);return[u,d]}return[[],[]]},[e]);return p.useEffect(()=>{const c=(t==null?void 0:t.target)??Yae,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=m=>{var v,y;if(r.current=m.ctrlKey||m.metaKey||m.shiftKey||m.altKey,(!r.current||r.current&&!u)&&A8e(m))return!1;const b=Jae(m.code,l);if(s.current.add(m[b]),Zae(o,s.current,!1)){const w=((y=(v=m.composedPath)==null?void 0:v.call(m))==null?void 0:y[0])||m.target,x=(w==null?void 0:w.nodeName)==="BUTTON"||(w==null?void 0:w.nodeName)==="A";t.preventDefault!==!1&&(r.current||!x)&&m.preventDefault(),i(!0)}},f=m=>{const g=Jae(m.code,l);Zae(o,s.current,!0)?(i(!1),s.current.clear()):s.current.delete(m[g]),m.key==="Meta"&&s.current.clear(),r.current=!1},h=()=>{s.current.clear(),i(!1)};return c==null||c.addEventListener("keydown",d),c==null||c.addEventListener("keyup",f),window.addEventListener("blur",h),window.addEventListener("contextmenu",h),()=>{c==null||c.removeEventListener("keydown",d),c==null||c.removeEventListener("keyup",f),window.removeEventListener("blur",h),window.removeEventListener("contextmenu",h)}}},[e,i]),n}function Zae(e,t,n){return e.filter(i=>n||i.length===t.size).some(i=>i.every(r=>t.has(r)))}function Jae(e,t){return t.includes(e)?"code":"key"}const iHt=()=>{const e=Vs();return p.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:i}=e.getState();return i?i.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[i,r,s],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??i,y:t.y??r,zoom:t.zoom??s},n),!0):!1},getViewport:()=>{const[t,n,i]=e.getState().transform;return{x:t,y:n,zoom:i}},setCenter:async(t,n,i)=>e.getState().setCenter(t,n,i),fitBounds:async(t,n)=>{const{width:i,height:r,minZoom:s,maxZoom:o,panZoom:l}=e.getState(),c=eK(t,i,r,s,o,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(c,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:i,snapGrid:r,snapToGrid:s,domNode:o}=e.getState();if(!o)return t;const{x:l,y:c}=o.getBoundingClientRect(),u={x:t.x-l,y:t.y-c},d=n.snapGrid??r,f=n.snapToGrid??s;return xO(u,i,f,d)},flowToScreenPosition:t=>{const{transform:n,domNode:i}=e.getState();if(!i)return t;const{x:r,y:s}=i.getBoundingClientRect(),o=E1(t,n);return{x:o.x+r,y:o.y+s}}}),[])};function G8e(e,t){const n=[],i=new Map,r=[];for(const s of e)if(s.type==="add"){r.push(s);continue}else if(s.type==="remove"||s.type==="replace")i.set(s.id,[s]);else{const o=i.get(s.id);o?o.push(s):i.set(s.id,[s])}for(const s of t){const o=i.get(s.id);if(!o){n.push(s);continue}if(o[0].type==="remove")continue;if(o[0].type==="replace"){n.push({...o[0].item});continue}const l={...s};for(const c of o)rHt(c,l);n.push(l)}return r.length&&r.forEach(s=>{s.index!==void 0?n.splice(s.index,0,{...s.item}):n.push({...s.item})}),n}function rHt(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function X8e(e,t){return G8e(e,t)}function Y8e(e,t){return G8e(e,t)}function yy(e,t){return{id:e,type:"select",selected:t}}function zx(e,t=new Set,n=!1){const i=[];for(const[r,s]of e){const o=t.has(r);!(s.selected===void 0&&!o)&&s.selected!==o&&(n&&(s.selected=o),i.push(yy(s.id,o)))}return i}function eoe({items:e=[],lookup:t}){var r;const n=[],i=new Map(e.map(s=>[s.id,s]));for(const[s,o]of e.entries()){const l=t.get(o.id),c=((r=l==null?void 0:l.internals)==null?void 0:r.userNode)??l;c!==void 0&&c!==o&&n.push({id:o.id,item:o,type:"replace"}),c===void 0&&n.push({item:o,type:"add",index:s})}for(const[s]of t)i.get(s)===void 0&&n.push({id:s,type:"remove"});return n}function toe(e){return{id:e.id,type:"remove"}}const sHt=S8e();function aHt(e,t,n={}){return Yzt(e,t,{...n,onError:n.onError??sHt})}const noe=e=>Mzt(e),oHt=e=>x8e(e);function Z8e(e){return p.forwardRef(e)}const lHt=typeof window<"u"?p.useLayoutEffect:p.useEffect;function ioe(e){const[t,n]=p.useState(BigInt(0)),[i]=p.useState(()=>cHt(()=>n(r=>r+BigInt(1))));return lHt(()=>{const r=i.get();r.length&&(e(r),i.reset())},[t]),i}function cHt(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const J8e=p.createContext(null);function uHt({children:e}){const t=Vs(),n=p.useCallback(l=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:d,onNodesChange:f,nodeLookup:h,fitViewQueued:m,onNodesChangeMiddlewareMap:g}=t.getState();let b=c;for(const y of l)b=typeof y=="function"?y(b):y;let v=eoe({items:b,lookup:h});for(const y of g.values())v=y(v);d&&u(b),v.length>0?f==null||f(v):m&&window.requestAnimationFrame(()=>{const{fitViewQueued:y,nodes:w,setNodes:x}=t.getState();y&&x(w)})},[]),i=ioe(n),r=p.useCallback(l=>{const{edges:c=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:f,edgeLookup:h}=t.getState();let m=c;for(const g of l)m=typeof g=="function"?g(m):g;d?u(m):f&&f(eoe({items:m,lookup:h}))},[]),s=ioe(r),o=p.useMemo(()=>({nodeQueue:i,edgeQueue:s}),[]);return a.jsx(J8e.Provider,{value:o,children:e})}function dHt(){const e=p.useContext(J8e);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const fHt=e=>!!e.panZoom;function AL(){const e=iHt(),t=Vs(),n=dHt(),i=ir(fHt),r=p.useMemo(()=>{const s=f=>t.getState().nodeLookup.get(f),o=f=>{n.nodeQueue.push(f)},l=f=>{n.edgeQueue.push(f)},c=f=>{var y,w;const{nodeLookup:h,nodeOrigin:m}=t.getState(),g=noe(f)?f:h.get(f.id),b=g.parentId?E8e(g.position,g.measured,g.parentId,h,m):g.position,v={...g,position:b,width:((y=g.measured)==null?void 0:y.width)??g.width,height:((w=g.measured)==null?void 0:w.height)??g.height};return S1(v)},u=(f,h,m={replace:!1})=>{o(g=>g.map(b=>{if(b.id===f){const v=typeof h=="function"?h(b):h;return m.replace&&noe(v)?v:{...b,...v}}return b}))},d=(f,h,m={replace:!1})=>{l(g=>g.map(b=>{if(b.id===f){const v=typeof h=="function"?h(b):h;return m.replace&&oHt(v)?v:{...b,...v}}return b}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var h;return(h=s(f))==null?void 0:h.internals.userNode},getInternalNode:s,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(h=>({...h}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:o,setEdges:l,addNodes:f=>{const h=Array.isArray(f)?f:[f];n.nodeQueue.push(m=>[...m,...h])},addEdges:f=>{const h=Array.isArray(f)?f:[f];n.edgeQueue.push(m=>[...m,...h])},toObject:()=>{const{nodes:f=[],edges:h=[],transform:m}=t.getState(),[g,b,v]=m;return{nodes:f.map(y=>({...y})),edges:h.map(y=>({...y})),viewport:{x:g,y:b,zoom:v}}},deleteElements:async({nodes:f=[],edges:h=[]})=>{const{nodes:m,edges:g,onNodesDelete:b,onEdgesDelete:v,triggerNodeChanges:y,triggerEdgeChanges:w,onDelete:x,onBeforeDelete:O}=t.getState(),{nodes:k,edges:S}=await Uzt({nodesToRemove:f,edgesToRemove:h,nodes:m,edges:g,onBeforeDelete:O}),C=S.length>0,E=k.length>0;if(C){const j=S.map(toe);v==null||v(S),w(j)}if(E){const j=k.map(toe);b==null||b(k),y(j)}return(E||C)&&(x==null||x({nodes:k,edges:S})),{deletedNodes:k,deletedEdges:S}},getIntersectingNodes:(f,h=!0,m)=>{const g=Rae(f),b=g?f:c(f),v=m!==void 0;return b?(m||t.getState().nodes).filter(y=>{const w=t.getState().nodeLookup.get(y.id);if(w&&!g&&(y.id===f.id||!w.internals.positionAbsolute))return!1;const x=S1(v?y:w),O=cA(x,b);return h&&O>0||O>=x.width*x.height||O>=b.width*b.height}):[]},isNodeIntersecting:(f,h,m=!0)=>{const b=Rae(f)?f:c(f);if(!b)return!1;const v=cA(b,h);return m&&v>0||v>=h.width*h.height||v>=b.width*b.height},updateNode:u,updateNodeData:(f,h,m={replace:!1})=>{u(f,g=>{const b=typeof h=="function"?h(g):h;return m.replace?{...g,data:b}:{...g,data:{...g.data,...b}}},m)},updateEdge:d,updateEdgeData:(f,h,m={replace:!1})=>{d(f,g=>{const b=typeof h=="function"?h(g):h;return m.replace?{...g,data:b}:{...g,data:{...g.data,...b}}},m)},getNodesBounds:f=>{const{nodeLookup:h,nodeOrigin:m}=t.getState();return Lzt(f,{nodeLookup:h,nodeOrigin:m})},getHandleConnections:({type:f,id:h,nodeId:m})=>{var g;return Array.from(((g=t.getState().connectionLookup.get(`${m}-${f}${h?`-${h}`:""}`))==null?void 0:g.values())??[])},getNodeConnections:({type:f,handleId:h,nodeId:m})=>{var g;return Array.from(((g=t.getState().connectionLookup.get(`${m}${f?h?`-${f}-${h}`:`-${f}`:""}`))==null?void 0:g.values())??[])},fitView:async f=>{const h=t.getState().fitViewResolver??Vzt();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:h}),n.nodeQueue.push(m=>[...m]),h.promise}}},[]);return p.useMemo(()=>({...r,...e,viewportInitialized:i}),[i])}const roe=e=>e.selected,hHt=typeof window<"u"?window:void 0;function pHt({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Vs(),{deleteElements:i}=AL(),r=dA(e,{actInsideInputWithModifier:!1}),s=dA(t,{target:hHt});p.useEffect(()=>{if(r){const{edges:o,nodes:l}=n.getState();i({nodes:l.filter(roe),edges:o.filter(roe)}),n.setState({nodesSelectionActive:!1})}},[r]),p.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])}function mHt(e){const t=Vs();p.useEffect(()=>{const n=()=>{var r,s,o,l;if(!e.current||!(((s=(r=e.current).checkVisibility)==null?void 0:s.call(r))??!0))return!1;const i=nK(e.current);(i.height===0||i.width===0)&&((l=(o=t.getState()).onError)==null||l.call(o,"004",kf.error004())),t.setState({width:i.width||500,height:i.height||500})};if(e.current){n(),window.addEventListener("resize",n);const i=new ResizeObserver(()=>n());return i.observe(e.current),()=>{window.removeEventListener("resize",n),i&&e.current&&i.unobserve(e.current)}}},[])}const TL={position:"absolute",width:"100%",height:"100%",top:0,left:0},gHt=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function bHt({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:i=!1,panOnScrollSpeed:r=.5,panOnScrollMode:s=t0.Free,zoomOnDoubleClick:o=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:m=!0,children:g,noWheelClassName:b,noPanClassName:v,onViewportChange:y,isControlledViewport:w,paneClickDistance:x,selectionOnDrag:O}){const k=Vs(),S=p.useRef(null),{userSelectionActive:C,lib:E,connectionInProgress:j}=ir(gHt,zs),T=dA(h),R=p.useRef();mHt(S);const A=p.useCallback(N=>{y==null||y({x:N[0],y:N[1],zoom:N[2]}),w||k.setState({transform:N})},[y,w]);return p.useEffect(()=>{if(S.current){R.current=AVt({domNode:S.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:c,onDraggingChange:D=>k.setState(_=>_.paneDragging===D?_:{paneDragging:D}),onPanZoomStart:(D,_)=>{const{onViewportChangeStart:L,onMoveStart:F}=k.getState();F==null||F(D,_),L==null||L(_)},onPanZoom:(D,_)=>{const{onViewportChange:L,onMove:F}=k.getState();F==null||F(D,_),L==null||L(_)},onPanZoomEnd:(D,_)=>{const{onViewportChangeEnd:L,onMoveEnd:F}=k.getState();F==null||F(D,_),L==null||L(_)}});const{x:N,y:P,zoom:I}=R.current.getViewport();return k.setState({panZoom:R.current,transform:[N,P,I],domNode:S.current.closest(".react-flow")}),()=>{var D;(D=R.current)==null||D.destroy()}}},[]),p.useEffect(()=>{var N;(N=R.current)==null||N.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:i,panOnScrollSpeed:r,panOnScrollMode:s,zoomOnDoubleClick:o,panOnDrag:l,zoomActivationKeyPressed:T,preventScrolling:m,noPanClassName:v,userSelectionActive:C,noWheelClassName:b,lib:E,onTransformChange:A,connectionInProgress:j,selectionOnDrag:O,paneClickDistance:x})},[e,t,n,i,r,s,o,l,T,m,v,C,b,E,A,j,O,x]),a.jsx("div",{className:"react-flow__renderer",ref:S,style:TL,children:g})}const yHt=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function vHt(){const{userSelectionActive:e,userSelectionRect:t}=ir(yHt,zs);return e&&t?a.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const e6=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},xHt=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function wHt({isSelecting:e,selectionKeyPressed:t,selectionMode:n=oA.Full,panOnDrag:i,autoPanOnSelection:r,paneClickDistance:s,selectionOnDrag:o,onSelectionStart:l,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:f,onPaneMouseEnter:h,onPaneMouseMove:m,onPaneMouseLeave:g,children:b}){const v=p.useRef(0),y=Vs(),{userSelectionActive:w,elementsSelectable:x,dragging:O,connectionInProgress:k,panBy:S,autoPanSpeed:C}=ir(xHt,zs),E=x&&(e||w),j=p.useRef(null),T=p.useRef(),R=p.useRef(new Set),A=p.useRef(new Set),N=p.useRef(!1),P=p.useRef({x:0,y:0}),I=p.useRef(!1),D=W=>{if(N.current||k){N.current=!1;return}u==null||u(W),y.getState().resetSelectedElements(),y.setState({nodesSelectionActive:!1})},_=W=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){W.preventDefault();return}d==null||d(W)},L=f?W=>f(W):void 0,F=W=>{N.current&&(W.stopPropagation(),N.current=!1)},M=W=>{var ue,pe;const{domNode:G,transform:H}=y.getState();if(T.current=G==null?void 0:G.getBoundingClientRect(),!T.current)return;const se=W.target===j.current;if(!se&&!!W.target.closest(".nokey")||!e||!(o&&se||t)||W.button!==0||!W.isPrimary)return;(pe=(ue=W.target)==null?void 0:ue.setPointerCapture)==null||pe.call(ue,W.pointerId),N.current=!1;const{x:ie,y:ee}=df(W.nativeEvent,T.current),be=xO({x:ie,y:ee},H);y.setState({userSelectionRect:{width:0,height:0,startX:be.x,startY:be.y,x:ie,y:ee}}),se||(W.stopPropagation(),W.preventDefault())};function V(W,G){const{userSelectionRect:H}=y.getState();if(!H)return;const{transform:se,nodeLookup:Y,edgeLookup:X,connectionLookup:ie,triggerNodeChanges:ee,triggerEdgeChanges:be,defaultEdgeOptions:ue}=y.getState(),pe={x:H.startX,y:H.startY},{x:ke,y:je}=E1(pe,se),Pe={startX:pe.x,startY:pe.y,x:Wae.id)),A.current=new Set;const _e=(ue==null?void 0:ue.selectable)??!0;for(const ae of R.current){const le=ie.get(ae);if(le)for(const{edgeId:ge}of le.values()){const Oe=X.get(ge);Oe&&(Oe.selectable??_e)&&A.current.add(ge)}}if(!Iae(Ee,R.current)){const ae=zx(Y,R.current,!0);ee(ae)}if(!Iae(ze,A.current)){const ae=zx(X,A.current);be(ae)}y.setState({userSelectionRect:Pe,userSelectionActive:!0,nodesSelectionActive:!1})}function q(){if(!r||!T.current)return;const[W,G]=JW(P.current,T.current,C);S({x:W,y:G}).then(H=>{if(!N.current||!H){v.current=requestAnimationFrame(q);return}const{x:se,y:Y}=P.current;V(se,Y),v.current=requestAnimationFrame(q)})}const U=()=>{cancelAnimationFrame(v.current),v.current=0,I.current=!1};p.useEffect(()=>()=>U(),[]);const J=W=>{const{userSelectionRect:G,transform:H,resetSelectedElements:se}=y.getState();if(!T.current||!G)return;const{x:Y,y:X}=df(W.nativeEvent,T.current);P.current={x:Y,y:X};const ie=E1({x:G.startX,y:G.startY},H);if(!N.current){const ee=t?0:s;if(Math.hypot(Y-ie.x,X-ie.y)<=ee)return;se(),l==null||l(W)}N.current=!0,I.current||(q(),I.current=!0),V(Y,X)},z=W=>{var G,H;W.button===0&&((H=(G=W.target)==null?void 0:G.releasePointerCapture)==null||H.call(G,W.pointerId),!w&&W.target===j.current&&y.getState().userSelectionRect&&(D==null||D(W)),y.setState({userSelectionActive:!1,userSelectionRect:null}),N.current&&(c==null||c(W),y.setState({nodesSelectionActive:R.current.size>0})),U())},Z=W=>{var G,H;(H=(G=W.target)==null?void 0:G.releasePointerCapture)==null||H.call(G,W.pointerId),U()},ne=i===!0||Array.isArray(i)&&i.includes(0);return a.jsxs("div",{className:eo(["react-flow__pane",{draggable:ne,dragging:O,selection:e}]),onClick:E?void 0:e6(D,j),onContextMenu:e6(_,j),onWheel:e6(L,j),onPointerEnter:E?void 0:h,onPointerMove:E?J:m,onPointerUp:E?z:void 0,onPointerCancel:E?Z:void 0,onPointerDownCapture:E?M:void 0,onClickCapture:E?F:void 0,onPointerLeave:g,ref:j,style:TL,children:[b,a.jsx(vHt,{})]})}function F7({id:e,store:t,unselect:n=!1,nodeRef:i}){const{addSelectedNodes:r,unselectNodesAndEdges:s,multiSelectionActive:o,nodeLookup:l,onError:c}=t.getState(),u=l.get(e);if(!u){c==null||c("012",kf.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&o)&&(s({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var d;return(d=i==null?void 0:i.current)==null?void 0:d.blur()})):r([e])}function eBe({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:i,nodeId:r,isSelectable:s,nodeClickDistance:o}){const l=Vs(),[c,u]=p.useState(!1),d=p.useRef();return p.useEffect(()=>{d.current=hVt({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{F7({id:f,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),p.useEffect(()=>{if(!(t||!e.current||!d.current))return d.current.update({noDragClassName:n,handleSelector:i,domNode:e.current,isSelectable:s,nodeId:r,nodeClickDistance:o}),()=>{var f;(f=d.current)==null||f.destroy()}},[n,i,t,s,e,r,o]),c}const OHt=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function tBe(){const e=Vs();return p.useCallback(n=>{const{nodeExtent:i,snapToGrid:r,snapGrid:s,nodesDraggable:o,onError:l,updateNodePositions:c,nodeLookup:u,nodeOrigin:d}=e.getState(),f=new Map,h=OHt(o),m=r?s[0]:5,g=r?s[1]:5,b=n.direction.x*m*n.factor,v=n.direction.y*g*n.factor;for(const[,y]of u){if(!h(y))continue;let w={x:y.internals.positionAbsolute.x+b,y:y.internals.positionAbsolute.y+v};r&&(w=VT(w,s));const{position:x,positionAbsolute:O}=w8e({nodeId:y.id,nextPosition:w,nodeLookup:u,nodeExtent:i,nodeOrigin:d,onError:l});y.position=x,y.internals.positionAbsolute=O,f.set(y.id,y)}c(f)},[])}const lK=p.createContext(null),kHt=lK.Provider;lK.Consumer;const nBe=()=>p.useContext(lK),SHt=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),EHt=(e,t,n)=>i=>{const{connectionClickStartHandle:r,connectionMode:s,connection:o}=i,{fromHandle:l,toHandle:c,isValid:u}=o,d=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:d,clickConnecting:(r==null?void 0:r.nodeId)===e&&(r==null?void 0:r.id)===t&&(r==null?void 0:r.type)===n,isPossibleEndHandle:s===O1.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!r,valid:d&&u}};function CHt({type:e="source",position:t=vn.Top,isValidConnection:n,isConnectable:i=!0,isConnectableStart:r=!0,isConnectableEnd:s=!0,id:o,onConnect:l,children:c,className:u,onMouseDown:d,onTouchStart:f,...h},m){var I,D;const g=o||null,b=e==="target",v=Vs(),y=nBe(),{connectOnClick:w,noPanClassName:x,rfId:O}=ir(SHt,zs),{connectingFrom:k,connectingTo:S,clickConnecting:C,isPossibleEndHandle:E,connectionInProcess:j,clickConnectionInProcess:T,valid:R}=ir(EHt(y,g,e),zs);y||(D=(I=v.getState()).onError)==null||D.call(I,"010",kf.error010());const A=_=>{const{defaultEdgeOptions:L,onConnect:F,hasDefaultEdges:M}=v.getState(),V={...L,..._};if(M){const{edges:q,setEdges:U,onError:J}=v.getState();U(aHt(V,q,{onError:J}))}F==null||F(V),l==null||l(V)},N=_=>{if(!y)return;const L=T8e(_.nativeEvent);if(r&&(L&&_.button===0||!L)){const F=v.getState();$7.onPointerDown(_.nativeEvent,{handleDomNode:_.currentTarget,autoPanOnConnect:F.autoPanOnConnect,connectionMode:F.connectionMode,connectionRadius:F.connectionRadius,domNode:F.domNode,nodeLookup:F.nodeLookup,lib:F.lib,isTarget:b,handleId:g,nodeId:y,flowId:F.rfId,panBy:F.panBy,cancelConnection:F.cancelConnection,onConnectStart:F.onConnectStart,onConnectEnd:(...M)=>{var V,q;return(q=(V=v.getState()).onConnectEnd)==null?void 0:q.call(V,...M)},updateConnection:F.updateConnection,onConnect:A,isValidConnection:n||((...M)=>{var V,q;return((q=(V=v.getState()).isValidConnection)==null?void 0:q.call(V,...M))??!0}),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:F.autoPanSpeed,dragThreshold:F.connectionDragThreshold})}L?d==null||d(_):f==null||f(_)},P=_=>{const{onClickConnectStart:L,onClickConnectEnd:F,connectionClickStartHandle:M,connectionMode:V,isValidConnection:q,lib:U,rfId:J,nodeLookup:z,connection:Z}=v.getState();if(!y||!M&&!r)return;if(!M){L==null||L(_.nativeEvent,{nodeId:y,handleId:g,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:y,type:e,id:g}});return}const ne=C8e(_.target),W=n||q,{connection:G,isValid:H}=$7.isValid(_.nativeEvent,{handle:{nodeId:y,id:g,type:e},connectionMode:V,fromNodeId:M.nodeId,fromHandleId:M.id||null,fromType:M.type,isValidConnection:W,flowId:J,doc:ne,lib:U,nodeLookup:z});H&&G&&A(G);const se=structuredClone(Z);delete se.inProgress,se.toPosition=se.toHandle?se.toHandle.position:null,F==null||F(_,se),v.setState({connectionClickStartHandle:null})};return a.jsx("div",{"data-handleid":g,"data-nodeid":y,"data-handlepos":t,"data-id":`${O}-${y}-${g}-${e}`,className:eo(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",x,u,{source:!b,target:b,connectable:i,connectablestart:r,connectableend:s,clickconnecting:C,connectingfrom:k,connectingto:S,valid:R,connectionindicator:i&&(!j||E)&&(j||T?s:r)}]),onMouseDown:N,onTouchStart:N,onClick:w?P:void 0,ref:m,...h,children:c})}const $c=p.memo(Z8e(CHt));function AHt({data:e,isConnectable:t,sourcePosition:n=vn.Bottom}){return a.jsxs(a.Fragment,{children:[e==null?void 0:e.label,a.jsx($c,{type:"source",position:n,isConnectable:t})]})}function THt({data:e,isConnectable:t,targetPosition:n=vn.Top,sourcePosition:i=vn.Bottom}){return a.jsxs(a.Fragment,{children:[a.jsx($c,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,a.jsx($c,{type:"source",position:i,isConnectable:t})]})}function _Ht(){return null}function jHt({data:e,isConnectable:t,targetPosition:n=vn.Top}){return a.jsxs(a.Fragment,{children:[a.jsx($c,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const _P={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},soe={input:AHt,default:THt,output:jHt,group:_Ht};function NHt(e){var t,n,i,r;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((i=e.style)==null?void 0:i.width),height:e.height??((r=e.style)==null?void 0:r.height)}}const RHt=e=>{const{width:t,height:n,x:i,y:r}=zT(e.nodeLookup,{filter:s=>!!s.selected});return{width:uf(t)?t:null,height:uf(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${i}px,${r}px)`}};function IHt({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const i=Vs(),{width:r,height:s,transformString:o,userSelectionActive:l}=ir(RHt,zs),c=tBe(),u=p.useRef(null);p.useEffect(()=>{var m;n||(m=u.current)==null||m.focus({preventScroll:!0})},[n]);const d=!l&&r!==null&&s!==null;if(eBe({nodeRef:u,disabled:!d}),!d)return null;const f=e?m=>{const g=i.getState().nodes.filter(b=>b.selected);e(m,g)}:void 0,h=m=>{Object.prototype.hasOwnProperty.call(_P,m.key)&&(m.preventDefault(),c({direction:_P[m.key],factor:m.shiftKey?4:1}))};return a.jsx("div",{className:eo(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:a.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:r,height:s}})})}const aoe=typeof window<"u"?window:void 0,PHt=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function iBe({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:o,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:d,selectionMode:f,onSelectionStart:h,onSelectionEnd:m,multiSelectionKeyCode:g,panActivationKeyCode:b,zoomActivationKeyCode:v,elementsSelectable:y,zoomOnScroll:w,zoomOnPinch:x,panOnScroll:O,panOnScrollSpeed:k,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:E,autoPanOnSelection:j,defaultViewport:T,translateExtent:R,minZoom:A,maxZoom:N,preventScrolling:P,onSelectionContextMenu:I,noWheelClassName:D,noPanClassName:_,disableKeyboardA11y:L,onViewportChange:F,isControlledViewport:M}){const{nodesSelectionActive:V,userSelectionActive:q}=ir(PHt,zs),U=dA(u,{target:aoe}),J=dA(b,{target:aoe}),z=J||E,Z=J||O,ne=d&&z!==!0,W=U||q||ne;return pHt({deleteKeyCode:c,multiSelectionKeyCode:g}),a.jsx(bHt,{onPaneContextMenu:s,elementsSelectable:y,zoomOnScroll:w,zoomOnPinch:x,panOnScroll:Z,panOnScrollSpeed:k,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:!U&&z,defaultViewport:T,translateExtent:R,minZoom:A,maxZoom:N,zoomActivationKeyCode:v,preventScrolling:P,noWheelClassName:D,noPanClassName:_,onViewportChange:F,isControlledViewport:M,paneClickDistance:l,selectionOnDrag:ne,children:a.jsxs(wHt,{onSelectionStart:h,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:o,panOnDrag:z,autoPanOnSelection:j,isSelecting:!!W,selectionMode:f,selectionKeyPressed:U,paneClickDistance:l,selectionOnDrag:ne,children:[e,V&&a.jsx(IHt,{onSelectionContextMenu:I,noPanClassName:_,disableKeyboardA11y:L})]})})}iBe.displayName="FlowRenderer";const DHt=p.memo(iBe),MHt=e=>t=>e?ZW(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function LHt(e){return ir(p.useCallback(MHt(e),[e]),zs)}const $Ht=e=>e.updateNodeInternals;function FHt(){const e=ir($Ht),[t]=p.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const i=new Map;n.forEach(r=>{const s=r.target.getAttribute("data-id");i.set(s,{id:s,nodeElement:r.target,force:!0})}),e(i)}));return p.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function BHt({node:e,nodeType:t,hasDimensions:n,resizeObserver:i}){const r=Vs(),s=p.useRef(null),o=p.useRef(null),l=p.useRef(e.sourcePosition),c=p.useRef(e.targetPosition),u=p.useRef(t),d=n&&!!e.internals.handleBounds;return p.useEffect(()=>{s.current&&!e.hidden&&(!d||o.current!==s.current)&&(o.current&&(i==null||i.unobserve(o.current)),i==null||i.observe(s.current),o.current=s.current)},[d,e.hidden]),p.useEffect(()=>()=>{o.current&&(i==null||i.unobserve(o.current),o.current=null)},[]),p.useEffect(()=>{if(s.current){const f=u.current!==t,h=l.current!==e.sourcePosition,m=c.current!==e.targetPosition;(f||h||m)&&(u.current=t,l.current=e.sourcePosition,c.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:s.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),s}function UHt({id:e,onClick:t,onMouseEnter:n,onMouseMove:i,onMouseLeave:r,onContextMenu:s,onDoubleClick:o,nodesDraggable:l,elementsSelectable:c,nodesConnectable:u,nodesFocusable:d,resizeObserver:f,noDragClassName:h,noPanClassName:m,disableKeyboardA11y:g,rfId:b,nodeTypes:v,nodeClickDistance:y,onError:w}){const{node:x,internals:O,isParent:k}=ir(W=>{const G=W.nodeLookup.get(e),H=W.parentLookup.has(e);return{node:G,internals:G.internals,isParent:H}},zs);let S=x.type||"default",C=(v==null?void 0:v[S])||soe[S];C===void 0&&(w==null||w("003",kf.error003(S)),S="default",C=(v==null?void 0:v.default)||soe.default);const E=!!(x.draggable||l&&typeof x.draggable>"u"),j=!!(x.selectable||c&&typeof x.selectable>"u"),T=!!(x.connectable||u&&typeof x.connectable>"u"),R=!!(x.focusable||d&&typeof x.focusable>"u"),A=Vs(),N=tK(x),P=BHt({node:x,nodeType:S,hasDimensions:N,resizeObserver:f}),I=eBe({nodeRef:P,disabled:x.hidden||!E,noDragClassName:h,handleSelector:x.dragHandle,nodeId:e,isSelectable:j,nodeClickDistance:y}),D=tBe();if(x.hidden)return null;const _=xm(x),L=NHt(x),F=j||E||t||n||i||r,M=n?W=>n(W,{...O.userNode}):void 0,V=i?W=>i(W,{...O.userNode}):void 0,q=r?W=>r(W,{...O.userNode}):void 0,U=s?W=>s(W,{...O.userNode}):void 0,J=o?W=>o(W,{...O.userNode}):void 0,z=W=>{const{selectNodesOnDrag:G,nodeDragThreshold:H}=A.getState();j&&(!G||!E||H>0)&&F7({id:e,store:A,nodeRef:P}),t&&t(W,{...O.userNode})},Z=W=>{if(!(A8e(W.nativeEvent)||g)){if(g8e.includes(W.key)&&j){const G=W.key==="Escape";F7({id:e,store:A,unselect:G,nodeRef:P})}else if(E&&x.selected&&Object.prototype.hasOwnProperty.call(_P,W.key)){W.preventDefault();const{ariaLabelConfig:G}=A.getState();A.setState({ariaLiveMessage:G["node.a11yDescription.ariaLiveMessage"]({direction:W.key.replace("Arrow","").toLowerCase(),x:~~O.positionAbsolute.x,y:~~O.positionAbsolute.y})}),D({direction:_P[W.key],factor:W.shiftKey?4:1})}}},ne=()=>{var ie;if(g||!((ie=P.current)!=null&&ie.matches(":focus-visible")))return;const{transform:W,width:G,height:H,autoPanOnNodeFocus:se,setCenter:Y}=A.getState();if(!se)return;ZW(new Map([[e,x]]),{x:0,y:0,width:G,height:H},W,!0).length>0||Y(x.position.x+_.width/2,x.position.y+_.height/2,{zoom:W[2]})};return a.jsx("div",{className:eo(["react-flow__node",`react-flow__node-${S}`,{[m]:E},x.className,{selected:x.selected,selectable:j,parent:k,draggable:E,dragging:I}]),ref:P,style:{zIndex:O.z,transform:`translate(${O.positionAbsolute.x}px,${O.positionAbsolute.y}px)`,pointerEvents:F?"all":"none",visibility:N?"visible":"hidden",...x.style,...L},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:M,onMouseMove:V,onMouseLeave:q,onContextMenu:U,onClick:z,onDoubleClick:J,onKeyDown:R?Z:void 0,tabIndex:R?0:void 0,onFocus:R?ne:void 0,role:x.ariaRole??(R?"group":void 0),"aria-roledescription":"node","aria-describedby":g?void 0:`${q8e}-${b}`,"aria-label":x.ariaLabel,...x.domAttributes,children:a.jsx(kHt,{value:e,children:a.jsx(C,{id:e,data:x.data,type:S,positionAbsoluteX:O.positionAbsolute.x,positionAbsoluteY:O.positionAbsolute.y,selected:x.selected??!1,selectable:j,draggable:E,deletable:x.deletable??!0,isConnectable:T,sourcePosition:x.sourcePosition,targetPosition:x.targetPosition,dragging:I,dragHandle:x.dragHandle,zIndex:O.z,parentId:x.parentId,..._})})})}var QHt=p.memo(UHt);const zHt=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function rBe(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:r,onError:s}=ir(zHt,zs),o=LHt(e.onlyRenderVisibleElements),l=FHt();return a.jsx("div",{className:"react-flow__nodes",style:TL,children:o.map(c=>a.jsx(QHt,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:s},c))})}rBe.displayName="NodeRenderer";const VHt=p.memo(rBe);function HHt(e){return ir(p.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const i=[];if(n.width&&n.height)for(const r of n.edges){const s=n.nodeLookup.get(r.source),o=n.nodeLookup.get(r.target);s&&o&&Kzt({sourceNode:s,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&i.push(r.id)}return i},[e]),zs)}const qHt=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return a.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},WHt=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return a.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},ooe={[lA.Arrow]:qHt,[lA.ArrowClosed]:WHt};function KHt(e){const t=Vs();return p.useMemo(()=>{var r,s;return Object.prototype.hasOwnProperty.call(ooe,e)?ooe[e]:((s=(r=t.getState()).onError)==null||s.call(r,"009",kf.error009(e)),null)},[e])}const GHt=({id:e,type:t,color:n,width:i=12.5,height:r=12.5,markerUnits:s="strokeWidth",strokeWidth:o,orient:l="auto-start-reverse"})=>{const c=KHt(t);return c?a.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${i}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:l,refX:"0",refY:"0",children:a.jsx(c,{color:n,strokeWidth:o})}):null},sBe=({defaultColor:e,rfId:t})=>{const n=ir(s=>s.edges),i=ir(s=>s.defaultEdgeOptions),r=p.useMemo(()=>nVt(n,{id:t,defaultColor:e,defaultMarkerStart:i==null?void 0:i.markerStart,defaultMarkerEnd:i==null?void 0:i.markerEnd}),[n,i,t,e]);return r.length?a.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:a.jsx("defs",{children:r.map(s=>a.jsx(GHt,{id:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient},s.id))})}):null};sBe.displayName="MarkerDefinitions";var XHt=p.memo(sBe);function aBe({x:e,y:t,label:n,labelStyle:i,labelShowBg:r=!0,labelBgStyle:s,labelBgPadding:o=[2,4],labelBgBorderRadius:l=2,children:c,className:u,...d}){const[f,h]=p.useState({x:1,y:0,width:0,height:0}),m=eo(["react-flow__edge-textwrapper",u]),g=p.useRef(null);return p.useEffect(()=>{if(g.current){const b=g.current.getBBox();h({x:b.x,y:b.y,width:b.width,height:b.height})}},[n]),n?a.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:m,visibility:f.width?"visible":"hidden",...d,children:[r&&a.jsx("rect",{width:f.width+2*o[0],x:-o[0],y:-o[1],height:f.height+2*o[1],className:"react-flow__edge-textbg",style:s,rx:l,ry:l}),a.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:g,style:i,children:n}),c]}):null}aBe.displayName="EdgeText";const YHt=p.memo(aBe);function HT({path:e,labelX:t,labelY:n,label:i,labelStyle:r,labelShowBg:s,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:u=20,...d}){return a.jsxs(a.Fragment,{children:[a.jsx("path",{...d,d:e,fill:"none",className:eo(["react-flow__edge-path",d.className])}),u?a.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,i&&uf(t)&&uf(n)?a.jsx(YHt,{x:t,y:n,label:i,labelStyle:r,labelShowBg:s,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function loe({pos:e,x1:t,y1:n,x2:i,y2:r}){return e===vn.Left||e===vn.Right?[.5*(t+i),n]:[t,.5*(n+r)]}function oBe({sourceX:e,sourceY:t,sourcePosition:n=vn.Bottom,targetX:i,targetY:r,targetPosition:s=vn.Top}){const[o,l]=loe({pos:n,x1:e,y1:t,x2:i,y2:r}),[c,u]=loe({pos:s,x1:i,y1:r,x2:e,y2:t}),[d,f,h,m]=_8e({sourceX:e,sourceY:t,targetX:i,targetY:r,sourceControlX:o,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${o},${l} ${c},${u} ${i},${r}`,d,f,h,m]}function lBe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:o,targetPosition:l,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,interactionWidth:y})=>{const[w,x,O]=oBe({sourceX:n,sourceY:i,sourcePosition:o,targetX:r,targetY:s,targetPosition:l}),k=e.isInternal?void 0:t;return a.jsx(HT,{id:k,path:w,labelX:x,labelY:O,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,interactionWidth:y})})}const ZHt=lBe({isInternal:!1}),cBe=lBe({isInternal:!0});ZHt.displayName="SimpleBezierEdge";cBe.displayName="SimpleBezierEdgeInternal";function uBe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,sourcePosition:m=vn.Bottom,targetPosition:g=vn.Top,markerEnd:b,markerStart:v,pathOptions:y,interactionWidth:w})=>{const[x,O,k]=TP({sourceX:n,sourceY:i,sourcePosition:m,targetX:r,targetY:s,targetPosition:g,borderRadius:y==null?void 0:y.borderRadius,offset:y==null?void 0:y.offset,stepPosition:y==null?void 0:y.stepPosition}),S=e.isInternal?void 0:t;return a.jsx(HT,{id:S,path:x,labelX:O,labelY:k,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:b,markerStart:v,interactionWidth:w})})}const dBe=uBe({isInternal:!1}),fBe=uBe({isInternal:!0});dBe.displayName="SmoothStepEdge";fBe.displayName="SmoothStepEdgeInternal";function hBe(e){return p.memo(({id:t,...n})=>{var r;const i=e.isInternal?void 0:t;return a.jsx(dBe,{...n,id:i,pathOptions:p.useMemo(()=>{var s;return{borderRadius:0,offset:(s=n.pathOptions)==null?void 0:s.offset}},[(r=n.pathOptions)==null?void 0:r.offset])})})}const JHt=hBe({isInternal:!1}),pBe=hBe({isInternal:!0});JHt.displayName="StepEdge";pBe.displayName="StepEdgeInternal";function mBe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:m,markerStart:g,interactionWidth:b})=>{const[v,y,w]=R8e({sourceX:n,sourceY:i,targetX:r,targetY:s}),x=e.isInternal?void 0:t;return a.jsx(HT,{id:x,path:v,labelX:y,labelY:w,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:m,markerStart:g,interactionWidth:b})})}const eqt=mBe({isInternal:!1}),gBe=mBe({isInternal:!0});eqt.displayName="StraightEdge";gBe.displayName="StraightEdgeInternal";function bBe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:o=vn.Bottom,targetPosition:l=vn.Top,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,pathOptions:y,interactionWidth:w})=>{const[x,O,k]=j8e({sourceX:n,sourceY:i,sourcePosition:o,targetX:r,targetY:s,targetPosition:l,curvature:y==null?void 0:y.curvature}),S=e.isInternal?void 0:t;return a.jsx(HT,{id:S,path:x,labelX:O,labelY:k,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,interactionWidth:w})})}const tqt=bBe({isInternal:!1}),yBe=bBe({isInternal:!0});tqt.displayName="BezierEdge";yBe.displayName="BezierEdgeInternal";const coe={default:yBe,straight:gBe,step:pBe,smoothstep:fBe,simplebezier:cBe},uoe={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},nqt=(e,t,n)=>n===vn.Left?e-t:n===vn.Right?e+t:e,iqt=(e,t,n)=>n===vn.Top?e-t:n===vn.Bottom?e+t:e,doe="react-flow__edgeupdater";function foe({position:e,centerX:t,centerY:n,radius:i=10,onMouseDown:r,onMouseEnter:s,onMouseOut:o,type:l}){return a.jsx("circle",{onMouseDown:r,onMouseEnter:s,onMouseOut:o,className:eo([doe,`${doe}-${l}`]),cx:nqt(t,i,e),cy:iqt(n,i,e),r:i,stroke:"transparent",fill:"transparent"})}function rqt({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:i,sourceY:r,targetX:s,targetY:o,sourcePosition:l,targetPosition:c,onReconnect:u,onReconnectStart:d,onReconnectEnd:f,setReconnecting:h,setUpdateHover:m}){const g=Vs(),b=(O,k)=>{if(O.button!==0)return;const{autoPanOnConnect:S,domNode:C,connectionMode:E,connectionRadius:j,lib:T,onConnectStart:R,cancelConnection:A,nodeLookup:N,rfId:P,panBy:I,updateConnection:D}=g.getState(),_=k.type==="target",L=(V,q)=>{h(!1),f==null||f(V,n,k.type,q)},F=V=>u==null?void 0:u(n,V),M=(V,q)=>{h(!0),d==null||d(O,n,k.type),R==null||R(V,q)};$7.onPointerDown(O.nativeEvent,{autoPanOnConnect:S,connectionMode:E,connectionRadius:j,domNode:C,handleId:k.id,nodeId:k.nodeId,nodeLookup:N,isTarget:_,edgeUpdaterType:k.type,lib:T,flowId:P,cancelConnection:A,panBy:I,isValidConnection:(...V)=>{var q,U;return((U=(q=g.getState()).isValidConnection)==null?void 0:U.call(q,...V))??!0},onConnect:F,onConnectStart:M,onConnectEnd:(...V)=>{var q,U;return(U=(q=g.getState()).onConnectEnd)==null?void 0:U.call(q,...V)},onReconnectEnd:L,updateConnection:D,getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,dragThreshold:g.getState().connectionDragThreshold,handleDomNode:O.currentTarget})},v=O=>b(O,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),y=O=>b(O,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),w=()=>m(!0),x=()=>m(!1);return a.jsxs(a.Fragment,{children:[(e===!0||e==="source")&&a.jsx(foe,{position:l,centerX:i,centerY:r,radius:t,onMouseDown:v,onMouseEnter:w,onMouseOut:x,type:"source"}),(e===!0||e==="target")&&a.jsx(foe,{position:c,centerX:s,centerY:o,radius:t,onMouseDown:y,onMouseEnter:w,onMouseOut:x,type:"target"})]})}function sqt({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:i,onClick:r,onDoubleClick:s,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:m,rfId:g,edgeTypes:b,noPanClassName:v,onError:y,disableKeyboardA11y:w}){let x=ir(Y=>Y.edgeLookup.get(e));const O=ir(Y=>Y.defaultEdgeOptions);x=O?{...O,...x}:x;let k=x.type||"default",S=(b==null?void 0:b[k])||coe[k];S===void 0&&(y==null||y("011",kf.error011(k)),k="default",S=(b==null?void 0:b.default)||coe.default);const C=!!(x.focusable||t&&typeof x.focusable>"u"),E=typeof f<"u"&&(x.reconnectable||n&&typeof x.reconnectable>"u"),j=!!(x.selectable||i&&typeof x.selectable>"u"),T=p.useRef(null),[R,A]=p.useState(!1),[N,P]=p.useState(!1),I=Vs(),{zIndex:D,sourceX:_,sourceY:L,targetX:F,targetY:M,sourcePosition:V,targetPosition:q}=ir(p.useCallback(Y=>{const X=Y.nodeLookup.get(x.source),ie=Y.nodeLookup.get(x.target);if(!X||!ie)return{zIndex:x.zIndex,...uoe};const ee=tVt({id:e,sourceNode:X,targetNode:ie,sourceHandle:x.sourceHandle||null,targetHandle:x.targetHandle||null,connectionMode:Y.connectionMode,onError:y});return{zIndex:Wzt({selected:x.selected,zIndex:x.zIndex,sourceNode:X,targetNode:ie,elevateOnSelect:Y.elevateEdgesOnSelect,zIndexMode:Y.zIndexMode}),...ee||uoe}},[x.source,x.target,x.sourceHandle,x.targetHandle,x.selected,x.zIndex]),zs),U=p.useMemo(()=>x.markerStart?`url('#${M7(x.markerStart,g)}')`:void 0,[x.markerStart,g]),J=p.useMemo(()=>x.markerEnd?`url('#${M7(x.markerEnd,g)}')`:void 0,[x.markerEnd,g]);if(x.hidden||_===null||L===null||F===null||M===null)return null;const z=Y=>{var be;const{addSelectedEdges:X,unselectNodesAndEdges:ie,multiSelectionActive:ee}=I.getState();j&&(I.setState({nodesSelectionActive:!1}),x.selected&&ee?(ie({nodes:[],edges:[x]}),(be=T.current)==null||be.blur()):X([e])),r&&r(Y,x)},Z=s?Y=>{s(Y,{...x})}:void 0,ne=o?Y=>{o(Y,{...x})}:void 0,W=l?Y=>{l(Y,{...x})}:void 0,G=c?Y=>{c(Y,{...x})}:void 0,H=u?Y=>{u(Y,{...x})}:void 0,se=Y=>{var X;if(!w&&g8e.includes(Y.key)&&j){const{unselectNodesAndEdges:ie,addSelectedEdges:ee}=I.getState();Y.key==="Escape"?((X=T.current)==null||X.blur(),ie({edges:[x]})):ee([e])}};return a.jsx("svg",{style:{zIndex:D},children:a.jsxs("g",{className:eo(["react-flow__edge",`react-flow__edge-${k}`,x.className,v,{selected:x.selected,animated:x.animated,inactive:!j&&!r,updating:R,selectable:j}]),onClick:z,onDoubleClick:Z,onContextMenu:ne,onMouseEnter:W,onMouseMove:G,onMouseLeave:H,onKeyDown:C?se:void 0,tabIndex:C?0:void 0,role:x.ariaRole??(C?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":x.ariaLabel===null?void 0:x.ariaLabel||`Edge from ${x.source} to ${x.target}`,"aria-describedby":C?`${W8e}-${g}`:void 0,ref:T,...x.domAttributes,children:[!N&&a.jsx(S,{id:e,source:x.source,target:x.target,type:x.type,selected:x.selected,animated:x.animated,selectable:j,deletable:x.deletable??!0,label:x.label,labelStyle:x.labelStyle,labelShowBg:x.labelShowBg,labelBgStyle:x.labelBgStyle,labelBgPadding:x.labelBgPadding,labelBgBorderRadius:x.labelBgBorderRadius,sourceX:_,sourceY:L,targetX:F,targetY:M,sourcePosition:V,targetPosition:q,data:x.data,style:x.style,sourceHandleId:x.sourceHandle,targetHandleId:x.targetHandle,markerStart:U,markerEnd:J,pathOptions:"pathOptions"in x?x.pathOptions:void 0,interactionWidth:x.interactionWidth}),E&&a.jsx(rqt,{edge:x,isReconnectable:E,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:m,sourceX:_,sourceY:L,targetX:F,targetY:M,sourcePosition:V,targetPosition:q,setUpdateHover:A,setReconnecting:P})]})})}var aqt=p.memo(sqt);const oqt=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function vBe({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:i,noPanClassName:r,onReconnect:s,onEdgeContextMenu:o,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:f,onEdgeDoubleClick:h,onReconnectStart:m,onReconnectEnd:g,disableKeyboardA11y:b}){const{edgesFocusable:v,edgesReconnectable:y,elementsSelectable:w,onError:x}=ir(oqt,zs),O=HHt(t);return a.jsxs("div",{className:"react-flow__edges",children:[a.jsx(XHt,{defaultColor:e,rfId:n}),O.map(k=>a.jsx(aqt,{id:k,edgesFocusable:v,edgesReconnectable:y,elementsSelectable:w,noPanClassName:r,onReconnect:s,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,reconnectRadius:f,onDoubleClick:h,onReconnectStart:m,onReconnectEnd:g,rfId:n,onError:x,edgeTypes:i,disableKeyboardA11y:b},k))]})}vBe.displayName="EdgeRenderer";const lqt=p.memo(vBe),cqt=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function uqt({children:e}){const t=ir(cqt);return a.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function dqt(e){const t=AL(),n=p.useRef(!1);p.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const fqt=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function hqt(e){const t=ir(fqt),n=Vs();return p.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function pqt(e){return e.connection.inProgress?{...e.connection,to:xO(e.connection.to,e.transform)}:{...e.connection}}function mqt(e){return pqt}function gqt(e){const t=mqt();return ir(t,zs)}const bqt=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function yqt({containerStyle:e,style:t,type:n,component:i}){const{nodesConnectable:r,width:s,height:o,isValid:l,inProgress:c}=ir(bqt,zs);return!(s&&r&&c)?null:a.jsx("svg",{style:e,width:s,height:o,className:"react-flow__connectionline react-flow__container",children:a.jsx("g",{className:eo(["react-flow__connection",v8e(l)]),children:a.jsx(xBe,{style:t,type:n,CustomComponent:i,isValid:l})})})}const xBe=({style:e,type:t=lg.Bezier,CustomComponent:n,isValid:i})=>{const{inProgress:r,from:s,fromNode:o,fromHandle:l,fromPosition:c,to:u,toNode:d,toHandle:f,toPosition:h,pointer:m}=gqt();if(!r)return;if(n)return a.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:l,fromX:s.x,fromY:s.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:h,connectionStatus:v8e(i),toNode:d,toHandle:f,pointer:m});let g="";const b={sourceX:s.x,sourceY:s.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:h};switch(t){case lg.Bezier:[g]=j8e(b);break;case lg.SimpleBezier:[g]=oBe(b);break;case lg.Step:[g]=TP({...b,borderRadius:0});break;case lg.SmoothStep:[g]=TP(b);break;default:[g]=R8e(b)}return a.jsx("path",{d:g,fill:"none",className:"react-flow__connection-path",style:e})};xBe.displayName="ConnectionLine";const vqt={};function hoe(e=vqt){p.useRef(e),Vs(),p.useEffect(()=>{},[e])}function xqt(){Vs(),p.useRef(!1),p.useEffect(()=>{},[])}function wBe({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:i,onEdgeClick:r,onNodeDoubleClick:s,onEdgeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:f,onSelectionStart:h,onSelectionEnd:m,connectionLineType:g,connectionLineStyle:b,connectionLineComponent:v,connectionLineContainerStyle:y,selectionKeyCode:w,selectionOnDrag:x,selectionMode:O,multiSelectionKeyCode:k,panActivationKeyCode:S,zoomActivationKeyCode:C,deleteKeyCode:E,onlyRenderVisibleElements:j,elementsSelectable:T,defaultViewport:R,translateExtent:A,minZoom:N,maxZoom:P,preventScrolling:I,defaultMarkerColor:D,zoomOnScroll:_,zoomOnPinch:L,panOnScroll:F,panOnScrollSpeed:M,panOnScrollMode:V,zoomOnDoubleClick:q,panOnDrag:U,autoPanOnSelection:J,onPaneClick:z,onPaneMouseEnter:Z,onPaneMouseMove:ne,onPaneMouseLeave:W,onPaneScroll:G,onPaneContextMenu:H,paneClickDistance:se,nodeClickDistance:Y,onEdgeContextMenu:X,onEdgeMouseEnter:ie,onEdgeMouseMove:ee,onEdgeMouseLeave:be,reconnectRadius:ue,onReconnect:pe,onReconnectStart:ke,onReconnectEnd:je,noDragClassName:Pe,noWheelClassName:Ee,noPanClassName:ze,disableKeyboardA11y:_e,nodeExtent:ae,rfId:le,viewport:ge,onViewportChange:Oe}){return hoe(e),hoe(t),xqt(),dqt(n),hqt(ge),a.jsx(DHt,{onPaneClick:z,onPaneMouseEnter:Z,onPaneMouseMove:ne,onPaneMouseLeave:W,onPaneContextMenu:H,onPaneScroll:G,paneClickDistance:se,deleteKeyCode:E,selectionKeyCode:w,selectionOnDrag:x,selectionMode:O,onSelectionStart:h,onSelectionEnd:m,multiSelectionKeyCode:k,panActivationKeyCode:S,zoomActivationKeyCode:C,elementsSelectable:T,zoomOnScroll:_,zoomOnPinch:L,zoomOnDoubleClick:q,panOnScroll:F,panOnScrollSpeed:M,panOnScrollMode:V,panOnDrag:U,autoPanOnSelection:J,defaultViewport:R,translateExtent:A,minZoom:N,maxZoom:P,onSelectionContextMenu:f,preventScrolling:I,noDragClassName:Pe,noWheelClassName:Ee,noPanClassName:ze,disableKeyboardA11y:_e,onViewportChange:Oe,isControlledViewport:!!ge,children:a.jsxs(uqt,{children:[a.jsx(lqt,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:o,onReconnect:pe,onReconnectStart:ke,onReconnectEnd:je,onlyRenderVisibleElements:j,onEdgeContextMenu:X,onEdgeMouseEnter:ie,onEdgeMouseMove:ee,onEdgeMouseLeave:be,reconnectRadius:ue,defaultMarkerColor:D,noPanClassName:ze,disableKeyboardA11y:_e,rfId:le}),a.jsx(yqt,{style:b,type:g,component:v,containerStyle:y}),a.jsx("div",{className:"react-flow__edgelabel-renderer"}),a.jsx(VHt,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:Y,onlyRenderVisibleElements:j,noPanClassName:ze,noDragClassName:Pe,disableKeyboardA11y:_e,nodeExtent:ae,rfId:le}),a.jsx("div",{className:"react-flow__viewport-portal"})]})})}wBe.displayName="GraphView";const wqt=p.memo(wBe),Oqt=S8e(),poe=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:o,fitViewOptions:l,minZoom:c=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:f,zIndexMode:h="basic"}={})=>{const m=new Map,g=new Map,b=new Map,v=new Map,y=i??t??[],w=n??e??[],x=d??[0,0],O=f??aA;D8e(b,v,y);const{nodesInitialized:k}=L7(w,m,g,{nodeOrigin:x,nodeExtent:O,zIndexMode:h});let S=[0,0,1];if(o&&r&&s){const C=zT(m,{filter:R=>!!((R.width||R.initialWidth)&&(R.height||R.initialHeight))}),{x:E,y:j,zoom:T}=eK(C,r,s,c,u,(l==null?void 0:l.padding)??.1);S=[E,j,T]}return{rfId:"1",width:r??0,height:s??0,transform:S,nodes:w,nodesInitialized:k,nodeLookup:m,parentLookup:g,edges:y,edgeLookup:v,connectionLookup:b,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:i!==void 0,panZoom:null,minZoom:c,maxZoom:u,translateExtent:aA,nodeExtent:O,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:O1.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:x,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:l,fitViewResolver:null,connection:{...y8e},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Oqt,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:b8e,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},kqt=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h})=>$Vt((m,g)=>{async function b(){const{nodeLookup:v,panZoom:y,fitViewOptions:w,fitViewResolver:x,width:O,height:k,minZoom:S,maxZoom:C}=g();y&&(await Bzt({nodes:v,width:O,height:k,panZoom:y,minZoom:S,maxZoom:C},w),x==null||x.resolve(!0),m({fitViewResolver:null}))}return{...poe({nodes:e,edges:t,width:r,height:s,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,defaultNodes:n,defaultEdges:i,zIndexMode:h}),setNodes:v=>{const{nodeLookup:y,parentLookup:w,nodeOrigin:x,elevateNodesOnSelect:O,fitViewQueued:k,zIndexMode:S,nodesSelectionActive:C}=g(),{nodesInitialized:E,hasSelectedNodes:j}=L7(v,y,w,{nodeOrigin:x,nodeExtent:f,elevateNodesOnSelect:O,checkEquality:!0,zIndexMode:S}),T=C&&j;k&&E?(b(),m({nodes:v,nodesInitialized:E,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:T})):m({nodes:v,nodesInitialized:E,nodesSelectionActive:T})},setEdges:v=>{const{connectionLookup:y,edgeLookup:w}=g();D8e(y,w,v),m({edges:v})},setDefaultNodesAndEdges:(v,y)=>{if(v){const{setNodes:w}=g();w(v),m({hasDefaultNodes:!0})}if(y){const{setEdges:w}=g();w(y),m({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:y,nodeLookup:w,parentLookup:x,domNode:O,nodeOrigin:k,nodeExtent:S,debug:C,fitViewQueued:E,zIndexMode:j}=g(),{changes:T,updatedInternals:R}=cVt(v,w,x,O,k,S,j);R&&(sVt(w,x,{nodeOrigin:k,nodeExtent:S,zIndexMode:j}),E?(b(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),(T==null?void 0:T.length)>0&&(C&&console.log("React Flow: trigger node changes",T),y==null||y(T)))},updateNodePositions:(v,y=!1)=>{const w=[];let x=[];const{nodeLookup:O,triggerNodeChanges:k,connection:S,updateConnection:C,onNodesChangeMiddlewareMap:E}=g();for(const[j,T]of v){const R=O.get(j),A=!!(R!=null&&R.expandParent&&(R!=null&&R.parentId)&&(T!=null&&T.position)),N={id:j,type:"position",position:A?{x:Math.max(0,T.position.x),y:Math.max(0,T.position.y)}:T.position,dragging:y};if(R&&S.inProgress&&S.fromNode.id===R.id){const P=N0(R,S.fromHandle,vn.Left,!0);C({...S,from:P})}A&&R.parentId&&w.push({id:j,parentId:R.parentId,rect:{...T.internals.positionAbsolute,width:T.measured.width??0,height:T.measured.height??0}}),x.push(N)}if(w.length>0){const{parentLookup:j,nodeOrigin:T}=g(),R=oK(w,O,j,T);x.push(...R)}for(const j of E.values())x=j(x);k(x)},triggerNodeChanges:v=>{const{onNodesChange:y,setNodes:w,nodes:x,hasDefaultNodes:O,debug:k}=g();if(v!=null&&v.length){if(O){const S=X8e(v,x);w(S)}k&&console.log("React Flow: trigger node changes",v),y==null||y(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:y,setEdges:w,edges:x,hasDefaultEdges:O,debug:k}=g();if(v!=null&&v.length){if(O){const S=Y8e(v,x);w(S)}k&&console.log("React Flow: trigger edge changes",v),y==null||y(v)}},addSelectedNodes:v=>{const{multiSelectionActive:y,edgeLookup:w,nodeLookup:x,triggerNodeChanges:O,triggerEdgeChanges:k}=g();if(y){const S=v.map(C=>yy(C,!0));O(S);return}O(zx(x,new Set([...v]),!0)),k(zx(w))},addSelectedEdges:v=>{const{multiSelectionActive:y,edgeLookup:w,nodeLookup:x,triggerNodeChanges:O,triggerEdgeChanges:k}=g();if(y){const S=v.map(C=>yy(C,!0));k(S);return}k(zx(w,new Set([...v]))),O(zx(x,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:y}={})=>{const{edges:w,nodes:x,nodeLookup:O,triggerNodeChanges:k,triggerEdgeChanges:S}=g(),C=v||x,E=y||w,j=[];for(const R of C){if(!R.selected)continue;const A=O.get(R.id);A&&(A.selected=!1),j.push(yy(R.id,!1))}const T=[];for(const R of E)R.selected&&T.push(yy(R.id,!1));k(j),S(T)},setMinZoom:v=>{const{panZoom:y,maxZoom:w}=g();y==null||y.setScaleExtent([v,w]),m({minZoom:v})},setMaxZoom:v=>{const{panZoom:y,minZoom:w}=g();y==null||y.setScaleExtent([w,v]),m({maxZoom:v})},setTranslateExtent:v=>{var y;(y=g().panZoom)==null||y.setTranslateExtent(v),m({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:y,triggerNodeChanges:w,triggerEdgeChanges:x,elementsSelectable:O}=g();if(!O)return;const k=y.reduce((C,E)=>E.selected?[...C,yy(E.id,!1)]:C,[]),S=v.reduce((C,E)=>E.selected?[...C,yy(E.id,!1)]:C,[]);w(k),x(S)},setNodeExtent:v=>{const{nodes:y,nodeLookup:w,parentLookup:x,nodeOrigin:O,elevateNodesOnSelect:k,nodeExtent:S,zIndexMode:C}=g();v[0][0]===S[0][0]&&v[0][1]===S[0][1]&&v[1][0]===S[1][0]&&v[1][1]===S[1][1]||(L7(y,w,x,{nodeOrigin:O,nodeExtent:v,elevateNodesOnSelect:k,checkEquality:!1,zIndexMode:C}),m({nodeExtent:v}))},panBy:v=>{const{transform:y,width:w,height:x,panZoom:O,translateExtent:k}=g();return uVt({delta:v,panZoom:O,transform:y,translateExtent:k,width:w,height:x})},setCenter:async(v,y,w)=>{const{width:x,height:O,maxZoom:k,panZoom:S}=g();if(!S)return!1;const C=typeof(w==null?void 0:w.zoom)<"u"?w.zoom:k;return await S.setViewport({x:x/2-v*C,y:O/2-y*C,zoom:C},{duration:w==null?void 0:w.duration,ease:w==null?void 0:w.ease,interpolate:w==null?void 0:w.interpolate}),!0},cancelConnection:()=>{m({connection:{...y8e}})},updateConnection:v=>{m({connection:v})},reset:()=>m({...poe()})}},Object.is);function OBe({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:i,initialWidth:r,initialHeight:s,initialMinZoom:o,initialMaxZoom:l,initialFitViewOptions:c,fitView:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:m}){const[g]=p.useState(()=>kqt({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:u,minZoom:o,maxZoom:l,fitViewOptions:c,nodeOrigin:d,nodeExtent:f,zIndexMode:h}));return a.jsx(FVt,{value:g,children:a.jsx(uHt,{children:m})})}function Sqt({children:e,nodes:t,edges:n,defaultNodes:i,defaultEdges:r,width:s,height:o,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:m}){return p.useContext(EL)?a.jsx(a.Fragment,{children:e}):a.jsx(OBe,{initialNodes:t,initialEdges:n,defaultNodes:i,defaultEdges:r,initialWidth:s,initialHeight:o,fitView:l,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:m,children:e})}const Eqt={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Cqt({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,className:r,nodeTypes:s,edgeTypes:o,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:h,onConnect:m,onConnectStart:g,onConnectEnd:b,onClickConnectStart:v,onClickConnectEnd:y,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:O,onNodeContextMenu:k,onNodeDoubleClick:S,onNodeDragStart:C,onNodeDrag:E,onNodeDragStop:j,onNodesDelete:T,onEdgesDelete:R,onDelete:A,onSelectionChange:N,onSelectionDragStart:P,onSelectionDrag:I,onSelectionDragStop:D,onSelectionContextMenu:_,onSelectionStart:L,onSelectionEnd:F,onBeforeDelete:M,connectionMode:V,connectionLineType:q=lg.Bezier,connectionLineStyle:U,connectionLineComponent:J,connectionLineContainerStyle:z,deleteKeyCode:Z="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:W=!1,selectionMode:G=oA.Full,panActivationKeyCode:H="Space",multiSelectionKeyCode:se=uA()?"Meta":"Control",zoomActivationKeyCode:Y=uA()?"Meta":"Control",snapToGrid:X,snapGrid:ie,onlyRenderVisibleElements:ee=!1,selectNodesOnDrag:be,nodesDraggable:ue,autoPanOnNodeFocus:pe,nodesConnectable:ke,nodesFocusable:je,nodeOrigin:Pe=K8e,edgesFocusable:Ee,edgesReconnectable:ze,elementsSelectable:_e=!0,defaultViewport:ae=ZVt,minZoom:le=.5,maxZoom:ge=2,translateExtent:Oe=aA,preventScrolling:Se=!0,nodeExtent:We,defaultMarkerColor:Ye="#b1b1b7",zoomOnScroll:ye=!0,zoomOnPinch:we=!0,panOnScroll:Ae=!1,panOnScrollSpeed:He=.5,panOnScrollMode:Ue=t0.Free,zoomOnDoubleClick:jt=!0,panOnDrag:Pt=!0,onPaneClick:Kt,onPaneMouseEnter:Ct,onPaneMouseMove:xt,onPaneMouseLeave:tt,onPaneScroll:mt,onPaneContextMenu:Ne,paneClickDistance:Ot=1,nodeClickDistance:Nt=0,children:Yt,onReconnect:xn,onReconnectStart:Ke,onReconnectEnd:St,onEdgeContextMenu:qe,onEdgeDoubleClick:nt,onEdgeMouseEnter:et,onEdgeMouseMove:ft,onEdgeMouseLeave:Et,reconnectRadius:At=10,onNodesChange:It,onEdgesChange:Gt,noDragClassName:Xe="nodrag",noWheelClassName:wt="nowheel",noPanClassName:vt="nopan",fitView:tn,fitViewOptions:Qt,connectOnClick:cn,attributionPosition:Me,proOptions:on,defaultEdgeOptions:On,elevateNodesOnSelect:Sn=!0,elevateEdgesOnSelect:Qi=!1,disableKeyboardA11y:un=!1,autoPanOnConnect:lr,autoPanOnNodeDrag:Mn,autoPanOnSelection:ei=!0,autoPanSpeed:Bn,connectionRadius:ki,isValidConnection:zn,onError:Rn,style:di,id:rt,nodeDragThreshold:zt,connectionDragThreshold:Qe,viewport:bt,onViewportChange:Ht,width:_n,height:jr,colorMode:Hs="light",debug:qs,onScroll:Dr,ariaLabelConfig:ti,zIndexMode:Si="basic",...Zr},Jr){const ga=rt||"1",go=nHt(Hs),us=p.useCallback(he=>{he.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Dr==null||Dr(he)},[Dr]);return a.jsx("div",{"data-testid":"rf__wrapper",...Zr,onScroll:us,style:{...di,...Eqt},ref:Jr,className:eo(["react-flow",r,go]),id:rt,role:"application",children:a.jsxs(Sqt,{nodes:e,edges:t,width:_n,height:jr,fitView:tn,fitViewOptions:Qt,minZoom:le,maxZoom:ge,nodeOrigin:Pe,nodeExtent:We,zIndexMode:Si,children:[a.jsx(tHt,{nodes:e,edges:t,defaultNodes:n,defaultEdges:i,onConnect:m,onConnectStart:g,onConnectEnd:b,onClickConnectStart:v,onClickConnectEnd:y,nodesDraggable:ue,autoPanOnNodeFocus:pe,nodesConnectable:ke,nodesFocusable:je,edgesFocusable:Ee,edgesReconnectable:ze,elementsSelectable:_e,elevateNodesOnSelect:Sn,elevateEdgesOnSelect:Qi,minZoom:le,maxZoom:ge,nodeExtent:We,onNodesChange:It,onEdgesChange:Gt,snapToGrid:X,snapGrid:ie,connectionMode:V,translateExtent:Oe,connectOnClick:cn,defaultEdgeOptions:On,fitView:tn,fitViewOptions:Qt,onNodesDelete:T,onEdgesDelete:R,onDelete:A,onNodeDragStart:C,onNodeDrag:E,onNodeDragStop:j,onSelectionDrag:I,onSelectionDragStart:P,onSelectionDragStop:D,onMove:d,onMoveStart:f,onMoveEnd:h,noPanClassName:vt,nodeOrigin:Pe,rfId:ga,autoPanOnConnect:lr,autoPanOnNodeDrag:Mn,autoPanSpeed:Bn,onError:Rn,connectionRadius:ki,isValidConnection:zn,selectNodesOnDrag:be,nodeDragThreshold:zt,connectionDragThreshold:Qe,onBeforeDelete:M,debug:qs,ariaLabelConfig:ti,zIndexMode:Si}),a.jsx(wqt,{onInit:u,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:O,onNodeContextMenu:k,onNodeDoubleClick:S,nodeTypes:s,edgeTypes:o,connectionLineType:q,connectionLineStyle:U,connectionLineComponent:J,connectionLineContainerStyle:z,selectionKeyCode:ne,selectionOnDrag:W,selectionMode:G,deleteKeyCode:Z,multiSelectionKeyCode:se,panActivationKeyCode:H,zoomActivationKeyCode:Y,onlyRenderVisibleElements:ee,defaultViewport:ae,translateExtent:Oe,minZoom:le,maxZoom:ge,preventScrolling:Se,zoomOnScroll:ye,zoomOnPinch:we,zoomOnDoubleClick:jt,panOnScroll:Ae,panOnScrollSpeed:He,panOnScrollMode:Ue,panOnDrag:Pt,autoPanOnSelection:ei,onPaneClick:Kt,onPaneMouseEnter:Ct,onPaneMouseMove:xt,onPaneMouseLeave:tt,onPaneScroll:mt,onPaneContextMenu:Ne,paneClickDistance:Ot,nodeClickDistance:Nt,onSelectionContextMenu:_,onSelectionStart:L,onSelectionEnd:F,onReconnect:xn,onReconnectStart:Ke,onReconnectEnd:St,onEdgeContextMenu:qe,onEdgeDoubleClick:nt,onEdgeMouseEnter:et,onEdgeMouseMove:ft,onEdgeMouseLeave:Et,reconnectRadius:At,defaultMarkerColor:Ye,noDragClassName:Xe,noWheelClassName:wt,noPanClassName:vt,rfId:ga,disableKeyboardA11y:un,nodeExtent:We,viewport:bt,onViewportChange:Ht}),a.jsx(YVt,{onSelectionChange:N}),Yt,a.jsx(qVt,{proOptions:on,position:Me}),a.jsx(HVt,{rfId:ga,disableKeyboardA11y:un})]})})}var Aqt=Z8e(Cqt);const Tqt=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function _qt({children:e}){const t=ir(Tqt);return t?yi.createPortal(e,t):null}function jqt(e){const[t,n]=p.useState(e),i=p.useCallback(r=>n(s=>X8e(r,s)),[]);return[t,n,i]}function Nqt(e){const[t,n]=p.useState(e),i=p.useCallback(r=>n(s=>Y8e(r,s)),[]);return[t,n,i]}const Rqt=e=>t=>{if(!e.includeHiddenNodes)return t.nodesInitialized;if(t.nodeLookup.size===0)return!1;for(const[,{internals:n}]of t.nodeLookup)if(n.handleBounds===void 0||!tK(n.userNode))return!1;return!0};function Iqt(e={includeHiddenNodes:!1}){return ir(Rqt(e))}function Pqt({dimensions:e,lineWidth:t,variant:n,className:i}){return a.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:eo(["react-flow__background-pattern",n,i])})}function Dqt({radius:e,className:t}){return a.jsx("circle",{cx:e,cy:e,r:e,className:eo(["react-flow__background-pattern","dots",t])})}var Bg;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Bg||(Bg={}));const Mqt={[Bg.Dots]:1,[Bg.Lines]:1,[Bg.Cross]:6},Lqt=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function kBe({id:e,variant:t=Bg.Dots,gap:n=20,size:i,lineWidth:r=1,offset:s=0,color:o,bgColor:l,style:c,className:u,patternClassName:d}){const f=p.useRef(null),{transform:h,patternId:m}=ir(Lqt,zs),g=i||Mqt[t],b=t===Bg.Dots,v=t===Bg.Cross,y=Array.isArray(n)?n:[n,n],w=[y[0]*h[2]||1,y[1]*h[2]||1],x=g*h[2],O=Array.isArray(s)?s:[s,s],k=v?[x,x]:w,S=[O[0]*h[2]||1+k[0]/2,O[1]*h[2]||1+k[1]/2],C=`${m}${e||""}`;return a.jsxs("svg",{className:eo(["react-flow__background",u]),style:{...c,...TL,"--xy-background-color-props":l,"--xy-background-pattern-color-props":o},ref:f,"data-testid":"rf__background",children:[a.jsx("pattern",{id:C,x:h[0]%w[0],y:h[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${S[0]},-${S[1]})`,children:b?a.jsx(Dqt,{radius:x/2,className:d}):a.jsx(Pqt,{dimensions:k,lineWidth:r,variant:t,className:d})}),a.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${C})`})]})}kBe.displayName="Background";const $qt=p.memo(kBe);function Fqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:a.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Bqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:a.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Uqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:a.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function Qqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:a.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function zqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:a.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function vj({children:e,className:t,...n}){return a.jsx("button",{type:"button",className:eo(["react-flow__controls-button",t]),...n,children:e})}const Vqt=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function SBe({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:i=!0,fitViewOptions:r,onZoomIn:s,onZoomOut:o,onFitView:l,onInteractiveChange:c,className:u,children:d,position:f="bottom-left",orientation:h="vertical","aria-label":m}){const g=Vs(),{isInteractive:b,minZoomReached:v,maxZoomReached:y,ariaLabelConfig:w}=ir(Vqt,zs),{zoomIn:x,zoomOut:O,fitView:k}=AL(),S=()=>{x(),s==null||s()},C=()=>{O(),o==null||o()},E=()=>{k(r),l==null||l()},j=()=>{g.setState({nodesDraggable:!b,nodesConnectable:!b,elementsSelectable:!b}),c==null||c(!b)},T=h==="horizontal"?"horizontal":"vertical";return a.jsxs(CL,{className:eo(["react-flow__controls",T,u]),position:f,style:e,"data-testid":"rf__controls","aria-label":m??w["controls.ariaLabel"],children:[t&&a.jsxs(a.Fragment,{children:[a.jsx(vj,{onClick:S,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:y,children:a.jsx(Fqt,{})}),a.jsx(vj,{onClick:C,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:v,children:a.jsx(Bqt,{})})]}),n&&a.jsx(vj,{className:"react-flow__controls-fitview",onClick:E,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:a.jsx(Uqt,{})}),i&&a.jsx(vj,{className:"react-flow__controls-interactive",onClick:j,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:b?a.jsx(zqt,{}):a.jsx(Qqt,{})}),d]})}SBe.displayName="Controls";const Hqt=p.memo(SBe);function qqt({id:e,x:t,y:n,width:i,height:r,style:s,color:o,strokeColor:l,strokeWidth:c,className:u,borderRadius:d,shapeRendering:f,selected:h,onClick:m}){const{background:g,backgroundColor:b}=s||{},v=o||g||b;return a.jsx("rect",{className:eo(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:d,ry:d,width:i,height:r,style:{fill:v,stroke:l,strokeWidth:c},shapeRendering:f,onClick:m?y=>m(y,e):void 0})}const Wqt=p.memo(qqt),Kqt=e=>e.nodes.map(t=>t.id),t6=e=>e instanceof Function?e:()=>e;function Gqt({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:r,nodeComponent:s=Wqt,onClick:o}){const l=ir(Kqt,zs),c=t6(t),u=t6(e),d=t6(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return a.jsx(a.Fragment,{children:l.map(h=>a.jsx(Yqt,{id:h,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:i,nodeStrokeWidth:r,NodeComponent:s,onClick:o,shapeRendering:f},h))})}function Xqt({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:i,nodeBorderRadius:r,nodeStrokeWidth:s,shapeRendering:o,NodeComponent:l,onClick:c}){const{node:u,x:d,y:f,width:h,height:m}=ir(g=>{const b=g.nodeLookup.get(e);if(!b)return{node:void 0,x:0,y:0,width:0,height:0};const v=b.internals.userNode,{x:y,y:w}=b.internals.positionAbsolute,{width:x,height:O}=xm(v);return{node:v,x:y,y:w,width:x,height:O}},zs);return!u||u.hidden||!tK(u)?null:a.jsx(l,{x:d,y:f,width:h,height:m,style:u.style,selected:!!u.selected,className:i(u),color:t(u),borderRadius:r,strokeColor:n(u),strokeWidth:s,shapeRendering:o,onClick:c,id:u.id})}const Yqt=p.memo(Xqt);var Zqt=p.memo(Gqt);const Jqt=200,eWt=150,tWt=e=>!e.hidden,nWt=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?k8e(zT(e.nodeLookup,{filter:tWt}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},iWt="react-flow__minimap-desc";function EBe({style:e,className:t,nodeStrokeColor:n,nodeColor:i,nodeClassName:r="",nodeBorderRadius:s=5,nodeStrokeWidth:o,nodeComponent:l,bgColor:c,maskColor:u,maskStrokeColor:d,maskStrokeWidth:f,position:h="bottom-right",onClick:m,onNodeClick:g,pannable:b=!1,zoomable:v=!1,ariaLabel:y,inversePan:w,zoomStep:x=1,offsetScale:O=5}){const k=Vs(),S=p.useRef(null),{boundingRect:C,viewBB:E,rfId:j,panZoom:T,translateExtent:R,flowWidth:A,flowHeight:N,ariaLabelConfig:P}=ir(nWt,zs),I=(e==null?void 0:e.width)??Jqt,D=(e==null?void 0:e.height)??eWt,_=C.width/I,L=C.height/D,F=Math.max(_,L),M=F*I,V=F*D,q=O*F,U=C.x-(M-C.width)/2-q,J=C.y-(V-C.height)/2-q,z=M+q*2,Z=V+q*2,ne=`${iWt}-${j}`,W=p.useRef(0),G=p.useRef();W.current=F,p.useEffect(()=>{if(S.current&&T)return G.current=vVt({domNode:S.current,panZoom:T,getTransform:()=>k.getState().transform,getViewScale:()=>W.current}),()=>{var X;(X=G.current)==null||X.destroy()}},[T]),p.useEffect(()=>{var X;(X=G.current)==null||X.update({translateExtent:R,width:A,height:N,inversePan:w,pannable:b,zoomStep:x,zoomable:v})},[b,v,w,x,R,A,N]);const H=m?X=>{var be;const[ie,ee]=((be=G.current)==null?void 0:be.pointer(X))||[0,0];m(X,{x:ie,y:ee})}:void 0,se=g?p.useCallback((X,ie)=>{const ee=k.getState().nodeLookup.get(ie).internals.userNode;g(X,ee)},[]):void 0,Y=y??P["minimap.ariaLabel"];return a.jsx(CL,{position:h,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*F:void 0,"--xy-minimap-node-background-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o=="number"?o:void 0},className:eo(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:a.jsxs("svg",{width:I,height:D,viewBox:`${U} ${J} ${z} ${Z}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ne,ref:S,onClick:H,children:[Y&&a.jsx("title",{id:ne,children:Y}),a.jsx(Zqt,{onClick:se,nodeColor:i,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:r,nodeStrokeWidth:o,nodeComponent:l}),a.jsx("path",{className:"react-flow__minimap-mask",d:`M${U-q},${J-q}h${z+q*2}v${Z+q*2}h${-z-q*2}z + M${E.x},${E.y}h${E.width}v${E.height}h${-E.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}EBe.displayName="MiniMap";p.memo(EBe);const rWt=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,sWt={[C1.Line]:"right",[C1.Handle]:"bottom-right"};function aWt({nodeId:e,position:t,variant:n=C1.Handle,className:i,style:r=void 0,children:s,color:o,minWidth:l=10,minHeight:c=10,maxWidth:u=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:h,autoScale:m=!0,shouldResize:g,onResizeStart:b,onResize:v,onResizeEnd:y}){const w=nBe(),x=typeof e=="string"?e:w,O=Vs(),k=p.useRef(null),S=n===C1.Handle,C=ir(p.useCallback(rWt(S&&m),[S,m]),zs),E=p.useRef(null),j=t??sWt[n];p.useEffect(()=>{if(!(!k.current||!x))return E.current||(E.current=RVt({domNode:k.current,nodeId:x,getStoreItems:()=>{const{nodeLookup:R,transform:A,snapGrid:N,snapToGrid:P,nodeOrigin:I,domNode:D}=O.getState();return{nodeLookup:R,transform:A,snapGrid:N,snapToGrid:P,nodeOrigin:I,paneDomNode:D}},onChange:(R,A)=>{const{triggerNodeChanges:N,nodeLookup:P,parentLookup:I,nodeOrigin:D}=O.getState(),_=[],L={x:R.x,y:R.y},F=P.get(x);if(F&&F.expandParent&&F.parentId){const M=F.origin??D,V=R.width??F.measured.width??0,q=R.height??F.measured.height??0,U={id:F.id,parentId:F.parentId,rect:{width:V,height:q,...E8e({x:R.x??F.position.x,y:R.y??F.position.y},{width:V,height:q},F.parentId,P,M)}},J=oK([U],P,I,D);_.push(...J),L.x=R.x?Math.max(M[0]*V,R.x):void 0,L.y=R.y?Math.max(M[1]*q,R.y):void 0}if(L.x!==void 0&&L.y!==void 0){const M={id:x,type:"position",position:{...L}};_.push(M)}if(R.width!==void 0&&R.height!==void 0){const V={id:x,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:R.width,height:R.height}};_.push(V)}for(const M of A){const V={...M,type:"position"};_.push(V)}N(_)},onEnd:({width:R,height:A})=>{const N={id:x,type:"dimensions",resizing:!1,dimensions:{width:R,height:A}};O.getState().triggerNodeChanges([N])}})),E.current.update({controlPosition:j,boundaries:{minWidth:l,minHeight:c,maxWidth:u,maxHeight:d},keepAspectRatio:f,resizeDirection:h,onResizeStart:b,onResize:v,onResizeEnd:y,shouldResize:g}),()=>{var R;(R=E.current)==null||R.destroy()}},[j,l,c,u,d,f,b,v,y,g]);const T=j.split("-");return a.jsx("div",{className:eo(["react-flow__resize-control","nodrag",...T,n,i]),ref:k,style:{...r,scale:C,...o&&{[S?"backgroundColor":"borderColor"]:o}},children:s})}p.memo(aWt);var CBe=Object.defineProperty,oWt=(e,t,n)=>t in e?CBe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lWt=(e,t)=>{for(var n in t)CBe(e,n,{get:t[n],enumerable:!0})},cWt=(e,t,n)=>oWt(e,t+"",n),ABe={};lWt(ABe,{Graph:()=>Pd,alg:()=>cK,json:()=>_Be,version:()=>fWt});var uWt=Object.defineProperty,TBe=(e,t)=>{for(var n in t)uWt(e,n,{get:t[n],enumerable:!0})},Pd=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected="directed"in e?e.directed:!0,this._isMultigraph="multigraph"in e?e.multigraph:!1,this._isCompound="compound"in e?e.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return typeof e!="function"?this._defaultNodeLabelFn=()=>e:this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(n=>{t!==void 0?this.setNode(n,t):this.setNode(n)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]="\0",this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(n=>{this.setParent(n)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(t===void 0)t="\0";else{t+="";for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!=="\0")return t}}children(e="\0"){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e==="\0")return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t);for(let i of this.successors(e))n.add(i);return Array.from(n.values())}}isLeaf(e){let t;return this.isDirected()?t=this.successors(e):t=this.neighbors(e),t.length===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([r,s])=>{e(r)&&t.setNode(r,s)}),Object.values(this._edgeObjs).forEach(r=>{t.hasNode(r.v)&&t.hasNode(r.w)&&t.setEdge(r,this.edge(r))});let n={},i=r=>{let s=this.parent(r);return!s||t.hasNode(s)?(n[r]=s??void 0,s??void 0):s in n?n[s]:i(s)};return this._isCompound&&t.nodes().forEach(r=>t.setParent(r,i(r))),t}setDefaultEdgeLabel(e){return typeof e!="function"?this._defaultEdgeLabelFn=()=>e:this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((n,i)=>(t!==void 0?this.setEdge(n,i,t):this.setEdge(n,i),i)),this}setEdge(e,t,n,i){let r,s,o,l,c=!1;typeof e=="object"&&e!==null&&"v"in e?(r=e.v,s=e.w,o=e.name,arguments.length===2&&(l=t,c=!0)):(r=e,s=t,o=i,arguments.length>2&&(l=n,c=!0)),r=""+r,s=""+s,o!==void 0&&(o=""+o);let u=kS(this._isDirected,r,s,o);if(u in this._edgeLabels)return c&&(this._edgeLabels[u]=l),this;if(o!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(r),this.setNode(s),this._edgeLabels[u]=c?l:this._defaultEdgeLabelFn(r,s,o);let d=dWt(this._isDirected,r,s,o);return r=d.v,s=d.w,Object.freeze(d),this._edgeObjs[u]=d,moe(this._preds[s],r),moe(this._sucs[r],s),this._in[s][u]=d,this._out[r][u]=d,this._edgeCount++,this}edge(e,t,n){let i=arguments.length===1?n6(this._isDirected,e):kS(this._isDirected,e,t,n);return this._edgeLabels[i]}edgeAsObj(e,t,n){let i=arguments.length===1?this.edge(e):this.edge(e,t,n);return typeof i!="object"?{label:i}:i}hasEdge(e,t,n){return(arguments.length===1?n6(this._isDirected,e):kS(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let i=arguments.length===1?n6(this._isDirected,e):kS(this._isDirected,e,t,n),r=this._edgeObjs[i];if(r){let s=r.v,o=r.w;delete this._edgeLabels[i],delete this._edgeObjs[i],goe(this._preds[o],s),goe(this._sucs[s],o),delete this._in[o][i],delete this._out[s][i],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,n){if(!e)return;let i=Object.values(e);return n?i.filter(r=>r.v===t&&r.w===n||r.v===n&&r.w===t):i}};function moe(e,t){e[t]?e[t]++:e[t]=1}function goe(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function kS(e,t,n,i){let r=""+t,s=""+n;if(!e&&r>s){let o=r;r=s,s=o}return r+""+s+""+(i===void 0?"\0":i)}function dWt(e,t,n,i){let r=""+t,s=""+n;if(!e&&r>s){let l=r;r=s,s=l}let o={v:r,w:s};return i&&(o.name=i),o}function n6(e,t){return kS(e,t.v,t.w,t.name)}var fWt="4.0.1",_Be={};TBe(_Be,{read:()=>gWt,write:()=>hWt});function hWt(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:pWt(e),edges:mWt(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function pWt(e){return e.nodes().map(t=>{let n=e.node(t),i=e.parent(t),r={v:t};return n!==void 0&&(r.value=n),i!==void 0&&(r.parent=i),r})}function mWt(e){return e.edges().map(t=>{let n=e.edge(t),i={v:t.v,w:t.w};return t.name!==void 0&&(i.name=t.name),n!==void 0&&(i.value=n),i})}function gWt(e){let t=new Pd(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(n=>{t.setNode(n.v,n.value),n.parent&&t.setParent(n.v,n.parent)}),e.edges.forEach(n=>{t.setEdge({v:n.v,w:n.w,name:n.name},n.value)}),t}var cK={};TBe(cK,{CycleException:()=>NP,bellmanFord:()=>jBe,components:()=>vWt,dijkstra:()=>jP,dijkstraAll:()=>OWt,findCycles:()=>kWt,floydWarshall:()=>EWt,isAcyclic:()=>AWt,postorder:()=>_Wt,preorder:()=>jWt,prim:()=>NWt,shortestPaths:()=>RWt,tarjan:()=>RBe,topsort:()=>IBe});var bWt=()=>1;function jBe(e,t,n,i){return yWt(e,String(t),n||bWt,i||function(r){return e.outEdges(r)})}function yWt(e,t,n,i){let r={},s,o=0,l=e.nodes(),c=function(f){let h=n(f);r[f.v].distance+he.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(e,t){let n=this._keyIndices,i=String(e);if(!(i in n)){let r=this._arr,s=r.length;return n[i]=s,r.push({key:i,priority:t}),this._decrease(s),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw new Error(`Key not found: ${e}`);let i=this._arr[n].priority;if(t>i)throw new Error(`New priority is greater than current priority. Key: ${e} Old: ${i} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,i=n+1,r=e;n>1,!(t[i].priority1;function jP(e,t,n,i){let r=function(s){return e.outEdges(s)};return wWt(e,String(t),n||xWt,i||r)}function wWt(e,t,n,i){let r={},s=new NBe,o,l,c=function(u){let d=u.v!==o?u.v:u.w,f=r[d],h=n(u),m=l.distance+h;if(h<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+u+" Weight: "+h);m0&&(o=s.removeMin(),l=r[o],l.distance!==Number.POSITIVE_INFINITY);)i(o).forEach(c);return r}function OWt(e,t,n){return e.nodes().reduce(function(i,r){return i[r]=jP(e,r,t,n),i},{})}function RBe(e){let t=0,n=[],i={},r=[];function s(o){let l=i[o]={onStack:!0,lowlink:t,index:t++};if(n.push(o),e.successors(o).forEach(function(c){c in i?i[c].onStack&&(l.lowlink=Math.min(l.lowlink,i[c].index)):(s(c),l.lowlink=Math.min(l.lowlink,i[c].lowlink))}),l.lowlink===l.index){let c=[],u;do u=n.pop(),i[u].onStack=!1,c.push(u);while(o!==u);r.push(c)}}return e.nodes().forEach(function(o){o in i||s(o)}),r}function kWt(e){return RBe(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var SWt=()=>1;function EWt(e,t,n){return CWt(e,t||SWt,n||function(i){return e.outEdges(i)})}function CWt(e,t,n){let i={},r=e.nodes();return r.forEach(function(s){i[s]={},i[s][s]={distance:0,predecessor:""},r.forEach(function(o){s!==o&&(i[s][o]={distance:Number.POSITIVE_INFINITY,predecessor:""})}),n(s).forEach(function(o){let l=o.v===s?o.w:o.v,c=t(o);i[s][l]={distance:c,predecessor:s}})}),r.forEach(function(s){let o=i[s];r.forEach(function(l){let c=i[l];r.forEach(function(u){let d=c[s],f=o[u],h=c[u],m=d.distance+f.distance;m{var c;return(c=e.isDirected()?e.successors(l):e.neighbors(l))!=null?c:[]},o={};return t.forEach(function(l){if(!e.hasNode(l))throw new Error("Graph does not have node: "+l);r=PBe(e,l,n==="post",o,s,i,r)}),r}function PBe(e,t,n,i,r,s,o){return t in i||(i[t]=!0,n||(o=s(o,t)),r(t).forEach(function(l){o=PBe(e,l,n,i,r,s,o)}),n&&(o=s(o,t))),o}function DBe(e,t,n){return TWt(e,t,n,function(i,r){return i.push(r),i},[])}function _Wt(e,t){return DBe(e,t,"post")}function jWt(e,t){return DBe(e,t,"pre")}function NWt(e,t){let n=new Pd,i={},r=new NBe,s;function o(c){let u=c.v===s?c.w:c.v,d=r.priority(u);if(d!==void 0){let f=t(c);f0;){if(s=r.removeMin(),s in i)n.setEdge(s,i[s]);else{if(l)throw new Error("Input graph is not connected: "+e);l=!0}e.nodeEdges(s).forEach(o)}return n}function RWt(e,t,n,i){return IWt(e,t,n,i??(r=>{let s=e.outEdges(r);return s??[]}))}function IWt(e,t,n,i){if(n===void 0)return jP(e,t,n,i);let r=!1,s=e.nodes();for(let o=0;ot.setNode(n,e.node(n))),e.edges().forEach(n=>{let i=t.edge(n.v,n.w)||{weight:0,minlen:1},r=e.edge(n);t.setEdge(n.v,n.w,{weight:i.weight+r.weight,minlen:Math.max(i.minlen,r.minlen)})}),t}function MBe(e){let t=new Pd({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function boe(e,t){let n=e.x,i=e.y,r=t.x-n,s=t.y-i,o=e.width/2,l=e.height/2;if(!r&&!s)throw new Error("Not possible to find intersection inside of the rectangle");let c,u;return Math.abs(s)*o>Math.abs(r)*l?(s<0&&(l=-l),c=l*r/s,u=l):(r<0&&(o=-o),c=o,u=o*s/r),{x:n+c,y:i+u}}function qT(e){let t=fA($Be(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let i=e.node(n),r=i.rank;r!==void 0&&(t[r]||(t[r]=[]),t[r][i.order]=n)}),t}function DWt(e){let t=e.nodes().map(i=>{let r=e.node(i).rank;return r===void 0?Number.MAX_VALUE:r}),n=dh(Math.min,t);e.nodes().forEach(i=>{let r=e.node(i);Object.hasOwn(r,"rank")&&(r.rank-=n)})}function MWt(e){let t=e.nodes().map(o=>e.node(o).rank).filter(o=>o!==void 0),n=dh(Math.min,t),i=[];e.nodes().forEach(o=>{let l=e.node(o).rank-n;i[l]||(i[l]=[]),i[l].push(o)});let r=0,s=e.graph().nodeRankFactor;Array.from(i).forEach((o,l)=>{o===void 0&&l%s!==0?--r:o!==void 0&&r&&o.forEach(c=>e.node(c).rank+=r)})}function yoe(e,t,n,i){let r={width:0,height:0};return arguments.length>=4&&(r.rank=n,r.order=i),wO(e,"border",r,t)}function LWt(e,t=LBe){let n=[];for(let i=0;iLBe){let n=LWt(t);return e(...n.map(i=>e(...i)))}else return e(...t)}function $Be(e){let t=e.nodes().map(n=>{let i=e.node(n).rank;return i===void 0?Number.MIN_VALUE:i});return dh(Math.max,t)}function $Wt(e,t){let n={lhs:[],rhs:[]};return e.forEach(i=>{t(i)?n.lhs.push(i):n.rhs.push(i)}),n}function FBe(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}}function BBe(e,t){return t()}var FWt=0;function uK(e){let t=++FWt;return e+(""+t)}function fA(e,t,n=1){t==null&&(t=e,e=0);let i=s=>sti[t]:n=t,Object.entries(e).reduce((i,[r,s])=>(i[r]=n(s,r),i),{})}function BWt(e,t){return e.reduce((n,i,r)=>(n[i]=t[r],n),{})}var jL="\0",UWt="3.0.0",QWt=class{constructor(){cWt(this,"_sentinel");let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return voe(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&voe(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,zWt)),n=n._prev;return"["+e.join(", ")+"]"}};function voe(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function zWt(e,t){if(e!=="_next"&&e!=="_prev")return t}var VWt=QWt,HWt=()=>1;function qWt(e,t){if(e.nodeCount()<=1)return[];let n=KWt(e,t||HWt);return WWt(n.graph,n.buckets,n.zeroIdx).flatMap(i=>e.outEdges(i.v,i.w)||[])}function WWt(e,t,n){var i;let r=[],s=t[t.length-1],o=t[0],l;for(;e.nodeCount();){for(;l=o.dequeue();)i6(e,t,n,l);for(;l=s.dequeue();)i6(e,t,n,l);if(e.nodeCount()){for(let c=t.length-2;c>0;--c)if(l=(i=t[c])==null?void 0:i.dequeue(),l){r=r.concat(i6(e,t,n,l,!0)||[]);break}}}return r}function i6(e,t,n,i,r){let s=[],o=r?s:void 0;return(e.inEdges(i.v)||[]).forEach(l=>{let c=e.edge(l),u=e.node(l.v);r&&s.push({v:l.v,w:l.w}),u.out-=c,B7(t,n,u)}),(e.outEdges(i.v)||[]).forEach(l=>{let c=e.edge(l),u=l.w,d=e.node(u);d.in-=c,B7(t,n,d)}),e.removeNode(i.v),o}function KWt(e,t){let n=new Pd,i=0,r=0;e.nodes().forEach(l=>{n.setNode(l,{v:l,in:0,out:0})}),e.edges().forEach(l=>{let c=n.edge(l.v,l.w)||0,u=t(l),d=c+u;n.setEdge(l.v,l.w,d);let f=n.node(l.v),h=n.node(l.w);r=Math.max(r,f.out+=u),i=Math.max(i,h.in+=u)});let s=GWt(r+i+3).map(()=>new VWt),o=i+1;return n.nodes().forEach(l=>{B7(s,o,n.node(l))}),{graph:n,buckets:s,zeroIdx:o}}function B7(e,t,n){var i,r,s;n.out?n.in?(s=e[n.out-n.in+t])==null||s.enqueue(n):(r=e[e.length-1])==null||r.enqueue(n):(i=e[0])==null||i.enqueue(n)}function GWt(e){let t=[];for(let n=0;n{let i=e.edge(n);e.removeEdge(n),i.forwardName=n.name,i.reversed=!0,e.setEdge(n.w,n.v,i,uK("rev"))});function t(n){return i=>n.edge(i).weight}}function YWt(e){let t=[],n={},i={};function r(s){Object.hasOwn(i,s)||(i[s]=!0,n[s]=!0,e.outEdges(s).forEach(o=>{Object.hasOwn(n,o.w)?t.push(o):r(o.w)}),delete n[s])}return e.nodes().forEach(r),t}function ZWt(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let i=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,i)}})}function JWt(e){e.graph().dummyChains=[],e.edges().forEach(t=>eKt(e,t))}function eKt(e,t){let n=t.v,i=e.node(n).rank,r=t.w,s=e.node(r).rank,o=t.name,l=e.edge(t),c=l.labelRank;if(s===i+1)return;e.removeEdge(t);let u,d,f;for(f=0,++i;i{let n=e.node(t),i=n.edgeLabel,r;for(e.setEdge(n.edgeObj,i);n.dummy;)r=e.successors(t)[0],e.removeNode(t),i.points.push({x:n.x,y:n.y}),n.dummy==="edge-label"&&(i.x=n.x,i.y=n.y,i.width=n.width,i.height=n.height),t=r,n=e.node(t)})}function dK(e){let t={};function n(i){let r=e.node(i);if(Object.hasOwn(t,i))return r.rank;t[i]=!0;let s=e.outEdges(i),o=s?s.map(c=>c==null?Number.POSITIVE_INFINITY:n(c.w)-e.edge(c).minlen):[],l=dh(Math.min,o);return l===Number.POSITIVE_INFINITY&&(l=0),r.rank=l}e.sources().forEach(n)}function A1(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var UBe=nKt;function nKt(e){let t=new Pd({directed:!1}),n=e.nodes();if(n.length===0)throw new Error("Graph must have at least one node");let i=n[0],r=e.nodeCount();t.setNode(i,{});let s,o;for(;iKt(t,e){let o=s.v,l=i===o?s.w:o;!e.hasNode(l)&&!A1(t,s)&&(e.setNode(l,{}),e.setEdge(i,l,{}),n(l))})}return e.nodes().forEach(n),e.nodeCount()}function rKt(e,t){return t.edges().reduce((n,i)=>{let r=Number.POSITIVE_INFINITY;return e.hasNode(i.v)!==e.hasNode(i.w)&&(r=A1(t,i)),rt.node(i).rank+=n)}var{preorder:aKt,postorder:oKt}=cK,lKt=av;av.initLowLimValues=hK;av.initCutValues=fK;av.calcCutValue=QBe;av.leaveEdge=VBe;av.enterEdge=HBe;av.exchangeEdges=qBe;function av(e){e=PWt(e),dK(e);let t=UBe(e);hK(t),fK(t,e);let n,i;for(;n=VBe(t);)i=HBe(t,e,n),qBe(t,e,n,i)}function fK(e,t){let n=oKt(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(i=>cKt(e,t,i))}function cKt(e,t,n){let i=e.node(n).parent,r=e.edge(n,i);r.cutvalue=QBe(e,t,n)}function QBe(e,t,n){let i=e.node(n).parent,r=!0,s=t.edge(n,i),o=0;s||(r=!1,s=t.edge(i,n)),o=s.weight;let l=t.nodeEdges(n);return l&&l.forEach(c=>{let u=c.v===n,d=u?c.w:c.v;if(d!==i){let f=u===r,h=t.edge(c).weight;if(o+=f?h:-h,dKt(e,n,d)){let m=e.edge(n,d).cutvalue;o+=f?-m:m}}}),o}function hK(e,t){arguments.length<2&&(t=e.nodes()[0]),zBe(e,{},1,t)}function zBe(e,t,n,i,r){let s=n,o=e.node(i);t[i]=!0;let l=e.neighbors(i);return l&&l.forEach(c=>{Object.hasOwn(t,c)||(n=zBe(e,t,n,c,i))}),o.low=s,o.lim=n++,r?o.parent=r:delete o.parent,n}function VBe(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function HBe(e,t,n){let i=n.v,r=n.w;t.hasEdge(i,r)||(i=n.w,r=n.v);let s=e.node(i),o=e.node(r),l=s,c=!1;return s.lim>o.lim&&(l=o,c=!0),t.edges().filter(u=>c===xoe(e,e.node(u.v),l)&&c!==xoe(e,e.node(u.w),l)).reduce((u,d)=>A1(t,d)!e.node(r).parent);if(!n)return;let i=aKt(e,[n]);i=i.slice(1),i.forEach(r=>{let s=e.node(r).parent,o=t.edge(r,s),l=!1;o||(o=t.edge(s,r),l=!0),t.node(r).rank=t.node(s).rank+(l?o.minlen:-o.minlen)})}function dKt(e,t,n){return e.hasEdge(t,n)}function xoe(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var fKt=hKt;function hKt(e){let t=e.graph().ranker;if(typeof t=="function")return t(e);switch(t){case"network-simplex":woe(e);break;case"tight-tree":mKt(e);break;case"longest-path":pKt(e);break;case"none":break;default:woe(e)}}var pKt=dK;function mKt(e){dK(e),UBe(e)}function woe(e){lKt(e)}var gKt=bKt;function bKt(e){let t=vKt(e);e.graph().dummyChains.forEach(n=>{let i=e.node(n),r=i.edgeObj,s=yKt(e,t,r.v,r.w),o=s.path,l=s.lca,c=0,u=o[c],d=!0;for(;n!==r.w;){if(i=e.node(n),d){for(;(u=o[c])!==l&&e.node(u).maxRanko||l>t[c].lim));let u=c,d=i;for(;(d=e.parent(d))!==u;)s.push(d);return{path:r.concat(s.reverse()),lca:u}}function vKt(e){let t={},n=0;function i(r){let s=n;e.children(r).forEach(i),t[r]={low:s,lim:n++}}return e.children(jL).forEach(i),t}function xKt(e){let t=wO(e,"root",{},"_root"),n=wKt(e),i=Object.values(n),r=dh(Math.max,i)-1,s=2*r+1;e.graph().nestingRoot=t,e.edges().forEach(l=>e.edge(l).minlen*=s);let o=OKt(e)+1;e.children(jL).forEach(l=>WBe(e,t,s,o,r,n,l)),e.graph().nodeRankFactor=s}function WBe(e,t,n,i,r,s,o){var l;let c=e.children(o);if(!c.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}let u=yoe(e,"_bt"),d=yoe(e,"_bb"),f=e.node(o);e.setParent(u,o),f.borderTop=u,e.setParent(d,o),f.borderBottom=d,c.forEach(h=>{var m;WBe(e,t,n,i,r,s,h);let g=e.node(h),b=g.borderTop?g.borderTop:h,v=g.borderBottom?g.borderBottom:h,y=g.borderTop?i:2*i,w=b!==v?1:r-((m=s[o])!=null?m:0)+1;e.setEdge(u,b,{weight:y,minlen:w,nestingEdge:!0}),e.setEdge(v,d,{weight:y,minlen:w,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,u,{weight:0,minlen:r+((l=s[o])!=null?l:0)})}function wKt(e){let t={};function n(i,r){let s=e.children(i);s&&s.length&&s.forEach(o=>n(o,r+1)),t[i]=r}return e.children(jL).forEach(i=>n(i,1)),t}function OKt(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function kKt(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(n=>{e.edge(n).nestingEdge&&e.removeEdge(n)})}var SKt=EKt;function EKt(e){function t(n){let i=e.children(n),r=e.node(n);if(i.length&&i.forEach(t),Object.hasOwn(r,"minRank")){r.borderLeft=[],r.borderRight=[];for(let s=r.minRank,o=r.maxRank+1;skoe(e.node(t))),e.edges().forEach(t=>koe(e.edge(t)))}function koe(e){let t=e.width;e.width=e.height,e.height=t}function TKt(e){e.nodes().forEach(t=>r6(e.node(t))),e.edges().forEach(t=>{var n;let i=e.edge(t);(n=i.points)==null||n.forEach(r6),Object.hasOwn(i,"y")&&r6(i)})}function r6(e){e.y=-e.y}function _Kt(e){e.nodes().forEach(t=>s6(e.node(t))),e.edges().forEach(t=>{var n;let i=e.edge(t);(n=i.points)==null||n.forEach(s6),Object.hasOwn(i,"x")&&s6(i)})}function s6(e){let t=e.x;e.x=e.y,e.y=t}function jKt(e){let t={},n=e.nodes().filter(l=>!e.children(l).length),i=n.map(l=>e.node(l).rank),r=dh(Math.max,i),s=fA(r+1).map(()=>[]);function o(l){if(t[l])return;t[l]=!0;let c=e.node(l);s[c.rank].push(l);let u=e.successors(l);u&&u.forEach(o)}return n.sort((l,c)=>e.node(l).rank-e.node(c).rank).forEach(o),s}function NKt(e,t){let n=0;for(let i=1;id)),r=t.flatMap(u=>{let d=e.outEdges(u);return d?d.map(f=>({pos:i[f.w],weight:e.edge(f).weight})).sort((f,h)=>f.pos-h.pos):[]}),s=1;for(;s{let d=u.pos+s;l[d]+=u.weight;let f=0;for(;d>0;)d%2&&(f+=l[d+1]),d=d-1>>1,l[d]+=u.weight;c+=u.weight*f}),c}function IKt(e,t=[]){return t.map(n=>{let i=e.inEdges(n);if(!i||!i.length)return{v:n};{let r=i.reduce((s,o)=>{let l=e.edge(o),c=e.node(o.v);return{sum:s.sum+l.weight*c.order,weight:s.weight+l.weight}},{sum:0,weight:0});return{v:n,barycenter:r.sum/r.weight,weight:r.weight}}})}function PKt(e,t){let n={};e.forEach((r,s)=>{let o={indegree:0,in:[],out:[],vs:[r.v],i:s};r.barycenter!==void 0&&(o.barycenter=r.barycenter,o.weight=r.weight),n[r.v]=o}),t.edges().forEach(r=>{let s=n[r.v],o=n[r.w];s!==void 0&&o!==void 0&&(o.indegree++,s.out.push(o))});let i=Object.values(n).filter(r=>!r.indegree);return DKt(i)}function DKt(e){let t=[];function n(r){return s=>{s.merged||(s.barycenter===void 0||r.barycenter===void 0||s.barycenter>=r.barycenter)&&MKt(r,s)}}function i(r){return s=>{s.in.push(r),--s.indegree===0&&e.push(s)}}for(;e.length;){let r=e.pop();t.push(r),r.in.reverse().forEach(n(r)),r.out.forEach(i(r))}return t.filter(r=>!r.merged).map(r=>RP(r,["vs","i","barycenter","weight"]))}function MKt(e,t){let n=0,i=0;e.weight&&(n+=e.barycenter*e.weight,i+=e.weight),t.weight&&(n+=t.barycenter*t.weight,i+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/i,e.weight=i,e.i=Math.min(t.i,e.i),t.merged=!0}function LKt(e,t){let n=$Wt(e,d=>Object.hasOwn(d,"barycenter")),i=n.lhs,r=n.rhs.sort((d,f)=>f.i-d.i),s=[],o=0,l=0,c=0;i.sort($Kt(!!t)),c=Soe(s,r,c),i.forEach(d=>{c+=d.vs.length,s.push(d.vs),o+=d.barycenter*d.weight,l+=d.weight,c=Soe(s,r,c)});let u={vs:s.flat(1)};return l&&(u.barycenter=o/l,u.weight=l),u}function Soe(e,t,n){let i;for(;t.length&&(i=t[t.length-1]).i<=n;)t.pop(),e.push(i.vs),n++;return n}function $Kt(e){return(t,n)=>t.barycentern.barycenter?1:e?n.i-t.i:t.i-n.i}function GBe(e,t,n,i){let r=e.children(t),s=e.node(t),o=s?s.borderLeft:void 0,l=s?s.borderRight:void 0,c={};o&&(r=r.filter(h=>h!==o&&h!==l));let u=IKt(e,r);u.forEach(h=>{if(e.children(h.v).length){let m=GBe(e,h.v,n,i);c[h.v]=m,Object.hasOwn(m,"barycenter")&&BKt(h,m)}});let d=PKt(u,n);FKt(d,c);let f=LKt(d,i);if(o&&l){f.vs=[o,f.vs,l].flat(1);let h=e.predecessors(o);if(h&&h.length){let m=e.node(h[0]),g=e.predecessors(l),b=e.node(g[0]);Object.hasOwn(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+m.order+b.order)/(f.weight+2),f.weight+=2}}return f}function FKt(e,t){e.forEach(n=>{n.vs=n.vs.flatMap(i=>t[i]?t[i].vs:i)})}function BKt(e,t){e.barycenter!==void 0?(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight):(e.barycenter=t.barycenter,e.weight=t.weight)}function UKt(e,t,n,i){i||(i=e.nodes());let r=QKt(e),s=new Pd({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(o=>e.node(o));return i.forEach(o=>{let l=e.node(o),c=e.parent(o);if(l.rank===t||l.minRank<=t&&t<=l.maxRank){s.setNode(o),s.setParent(o,c||r);let u=e[n](o);u&&u.forEach(d=>{let f=d.v===o?d.w:d.v,h=s.edge(f,o),m=h!==void 0?h.weight:0;s.setEdge(f,o,{weight:e.edge(d).weight+m})}),Object.hasOwn(l,"minRank")&&s.setNode(o,{borderLeft:l.borderLeft[t],borderRight:l.borderRight[t]})}}),s}function QKt(e){let t;for(;e.hasNode(t=uK("_root")););return t}function zKt(e,t,n){let i={},r;n.forEach(s=>{let o=e.parent(s),l,c;for(;o;){if(l=e.parent(o),l?(c=i[l],i[l]=o):(c=r,r=o),c&&c!==o){t.setEdge(c,o);return}o=l}})}function XBe(e,t={}){if(typeof t.customOrder=="function"){t.customOrder(e,XBe);return}let n=$Be(e),i=Eoe(e,fA(1,n+1),"inEdges"),r=Eoe(e,fA(n-1,-1,-1),"outEdges"),s=jKt(e);if(Coe(e,s),t.disableOptimalOrderHeuristic)return;let o=Number.POSITIVE_INFINITY,l,c=t.constraints||[];for(let u=0,d=0;d<4;++u,++d){VKt(u%2?i:r,u%4>=2,c),s=qT(e);let f=NKt(e,s);f{i.has(s)||i.set(s,[]),i.get(s).push(o)};for(let s of e.nodes()){let o=e.node(s);if(typeof o.rank=="number"&&r(o.rank,s),typeof o.minRank=="number"&&typeof o.maxRank=="number")for(let l=o.minRank;l<=o.maxRank;l++)l!==o.rank&&r(l,s)}return t.map(function(s){return UKt(e,s,n,i.get(s)||[])})}function VKt(e,t,n){let i=new Pd;e.forEach(function(r){n.forEach(l=>i.setEdge(l.left,l.right));let s=r.graph().root,o=GBe(r,s,i,t);o.vs.forEach((l,c)=>r.node(l).order=c),zKt(r,i,o.vs)})}function Coe(e,t){Object.values(t).forEach(n=>n.forEach((i,r)=>e.node(i).order=r))}function HKt(e,t){let n={};function i(r,s){let o=0,l=0,c=r.length,u=s[s.length-1];return s.forEach((d,f)=>{let h=WKt(e,d),m=h?e.node(h).order:c;(h||d===u)&&(s.slice(l,f+1).forEach(g=>{let b=e.predecessors(g);b&&b.forEach(v=>{let y=e.node(v),w=y.order;(w{let f=s[d];if(f!==void 0&&e.node(f).dummy){let h=e.predecessors(f);h&&h.forEach(m=>{if(m===void 0)return;let g=e.node(m);g.dummy&&(g.orderu)&&YBe(n,m,f)})}})}function r(s,o){let l=-1,c=-1,u=0;return o.forEach((d,f)=>{if(e.node(d).dummy==="border"){let h=e.predecessors(d);if(h&&h.length){let m=h[0];if(m===void 0)return;c=e.node(m).order,i(o,u,f,l,c),u=f,l=c}}i(o,u,o.length,c,s.length)}),o}return t.length&&t.reduce(r),n}function WKt(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(i=>e.node(i).dummy)}}function YBe(e,t,n){if(t>n){let r=t;t=n,n=r}let i=e[t];i||(e[t]=i={}),i[n]=!0}function KKt(e,t,n){if(t>n){let r=t;t=n,n=r}let i=e[t];return i!==void 0&&Object.hasOwn(i,n)}function GKt(e,t,n,i){let r={},s={},o={};return t.forEach(l=>{l.forEach((c,u)=>{r[c]=c,s[c]=c,o[c]=u})}),t.forEach(l=>{let c=-1;l.forEach(u=>{let d=i(u);if(d&&d.length){let f=d.sort((m,g)=>{let b=o[m],v=o[g];return(b!==void 0?b:0)-(v!==void 0?v:0)}),h=(f.length-1)/2;for(let m=Math.floor(h),g=Math.ceil(h);m<=g;++m){let b=f[m];if(b===void 0)continue;let v=o[b];if(v!==void 0&&s[u]===u&&c{var y;let w=(y=s[v.v])!=null?y:0,x=o.edge(v);return Math.max(b,w+(x!==void 0?x:0))},0):s[m]=0}function d(m){let g=o.outEdges(m),b=Number.POSITIVE_INFINITY;g&&(b=g.reduce((y,w)=>{let x=s[w.w],O=o.edge(w);return Math.min(y,(x!==void 0?x:0)-(O!==void 0?O:0))},Number.POSITIVE_INFINITY));let v=e.node(m);b!==Number.POSITIVE_INFINITY&&v.borderType!==l&&(s[m]=Math.max(s[m]!==void 0?s[m]:0,b))}function f(m){return o.predecessors(m)||[]}function h(m){return o.successors(m)||[]}return c(u,f),c(d,h),Object.keys(i).forEach(m=>{var g;let b=n[m];b!==void 0&&(s[m]=(g=s[b])!=null?g:0)}),s}function YKt(e,t,n,i){let r=new Pd,s=e.graph(),o=nGt(s.nodesep,s.edgesep,i);return t.forEach(l=>{let c;l.forEach(u=>{let d=n[u];if(d!==void 0){if(r.setNode(d),c!==void 0){let f=n[c];if(f!==void 0){let h=r.edge(f,d);r.setEdge(f,d,Math.max(o(e,u,c),h||0))}}c=u}})}),r}function ZKt(e,t){return Object.values(t).reduce((n,i)=>{let r=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY;Object.entries(i).forEach(([l,c])=>{let u=iGt(e,l)/2;r=Math.max(c+u,r),s=Math.min(c-u,s)});let o=r-s;return o{["l","r"].forEach(o=>{let l=s+o,c=e[l];if(!c||c===t)return;let u=Object.values(c),d=i-dh(Math.min,u);o!=="l"&&(d=r-dh(Math.max,u)),d&&(e[l]=_L(c,f=>f+d))})})}function eGt(e,t=void 0){let n=e.ul;return n?_L(n,(i,r)=>{var s,o;if(t){let c=t.toLowerCase(),u=e[c];if(u&&u[r]!==void 0)return u[r]}let l=Object.values(e).map(c=>{let u=c[r];return u!==void 0?u:0}).sort((c,u)=>c-u);return(((s=l[1])!=null?s:0)+((o=l[2])!=null?o:0))/2}):{}}function tGt(e){let t=qT(e),n=Object.assign(HKt(e,t),qKt(e,t)),i={},r;["u","d"].forEach(o=>{r=o==="u"?t:Object.values(t).reverse(),["l","r"].forEach(l=>{l==="r"&&(r=r.map(d=>Object.values(d).reverse()));let c=GKt(e,r,n,d=>(o==="u"?e.predecessors(d):e.successors(d))||[]),u=XKt(e,r,c.root,c.align,l==="r");l==="r"&&(u=_L(u,d=>-d)),i[o+l]=u})});let s=ZKt(e,i);return JKt(i,s),eGt(i,e.graph().align)}function nGt(e,t,n){return(i,r,s)=>{let o=i.node(r),l=i.node(s),c=0,u;if(c+=o.width/2,Object.hasOwn(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":u=-o.width/2;break;case"r":u=o.width/2;break}if(u&&(c+=n?u:-u),u=void 0,c+=(o.dummy?t:e)/2,c+=(l.dummy?t:e)/2,c+=l.width/2,Object.hasOwn(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":u=l.width/2;break;case"r":u=-l.width/2;break}return u&&(c+=n?u:-u),c}}function iGt(e,t){return e.node(t).width}function rGt(e){e=MBe(e),sGt(e),Object.entries(tGt(e)).forEach(([t,n])=>e.node(t).x=n)}function sGt(e){let t=qT(e),n=e.graph(),i=n.ranksep,r=n.rankalign,s=0;t.forEach(o=>{let l=o.reduce((c,u)=>{var d;let f=(d=e.node(u).height)!=null?d:0;return c>f?c:f},0);o.forEach(c=>{let u=e.node(c);r==="top"?u.y=s+u.height/2:r==="bottom"?u.y=s+l-u.height/2:u.y=s+l/2}),s+=l+i})}function aGt(e,t={}){let n=t.debugTiming?FBe:BBe;return n("layout",()=>{let i=n(" buildLayoutGraph",()=>gGt(e));return n(" runLayout",()=>oGt(i,n,t)),n(" updateInputGraph",()=>lGt(e,i)),i})}function oGt(e,t,n){t(" makeSpaceForEdgeLabels",()=>bGt(e)),t(" removeSelfEdges",()=>CGt(e)),t(" acyclic",()=>XWt(e)),t(" nestingGraph.run",()=>xKt(e)),t(" rank",()=>fKt(MBe(e))),t(" injectEdgeLabelProxies",()=>yGt(e)),t(" removeEmptyRanks",()=>MWt(e)),t(" nestingGraph.cleanup",()=>kKt(e)),t(" normalizeRanks",()=>DWt(e)),t(" assignRankMinMax",()=>vGt(e)),t(" removeEdgeLabelProxies",()=>xGt(e)),t(" normalize.run",()=>JWt(e)),t(" parentDummyChains",()=>gKt(e)),t(" addBorderSegments",()=>SKt(e)),t(" order",()=>XBe(e,n)),t(" insertSelfEdges",()=>AGt(e)),t(" adjustCoordinateSystem",()=>CKt(e)),t(" position",()=>rGt(e)),t(" positionSelfEdges",()=>TGt(e)),t(" removeBorderNodes",()=>EGt(e)),t(" normalize.undo",()=>tKt(e)),t(" fixupEdgeLabelCoords",()=>kGt(e)),t(" undoCoordinateSystem",()=>AKt(e)),t(" translateGraph",()=>wGt(e)),t(" assignNodeIntersects",()=>OGt(e)),t(" reversePoints",()=>SGt(e)),t(" acyclic.undo",()=>ZWt(e))}function lGt(e,t){e.nodes().forEach(n=>{let i=e.node(n),r=t.node(n);i&&(i.x=r.x,i.y=r.y,i.order=r.order,i.rank=r.rank,t.children(n).length&&(i.width=r.width,i.height=r.height))}),e.edges().forEach(n=>{let i=e.edge(n),r=t.edge(n);i.points=r.points,Object.hasOwn(r,"x")&&(i.x=r.x,i.y=r.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var cGt=["nodesep","edgesep","ranksep","marginx","marginy"],uGt={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},dGt=["acyclicer","ranker","rankdir","align","rankalign"],fGt=["width","height","rank"],Aoe={width:0,height:0},hGt=["minlen","weight","width","height","labeloffset"],pGt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},mGt=["labelpos"];function gGt(e){let t=new Pd({multigraph:!0,compound:!0}),n=o6(e.graph());return t.setGraph(Object.assign({},uGt,a6(n,cGt),RP(n,dGt))),e.nodes().forEach(i=>{let r=o6(e.node(i)),s=a6(r,fGt);Object.keys(Aoe).forEach(l=>{s[l]===void 0&&(s[l]=Aoe[l])}),t.setNode(i,s);let o=e.parent(i);o!==void 0&&t.setParent(i,o)}),e.edges().forEach(i=>{let r=o6(e.edge(i));t.setEdge(i,Object.assign({},pGt,a6(r,hGt),RP(r,mGt)))}),t}function bGt(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let i=e.edge(n);i.minlen*=2,i.labelpos.toLowerCase()!=="c"&&(t.rankdir==="TB"||t.rankdir==="BT"?i.width+=i.labeloffset:i.height+=i.labeloffset)})}function yGt(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let i=e.node(t.v),r={rank:(e.node(t.w).rank-i.rank)/2+i.rank,e:t};wO(e,"edge-proxy",r,"_ep")}})}function vGt(e){let t=0;e.nodes().forEach(n=>{let i=e.node(n);i.borderTop&&(i.minRank=e.node(i.borderTop).rank,i.maxRank=e.node(i.borderBottom).rank,t=Math.max(t,i.maxRank))}),e.graph().maxRank=t}function xGt(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy==="edge-proxy"){let i=n;e.edge(i.e).labelRank=n.rank,e.removeNode(t)}})}function wGt(e){let t=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,r=0,s=e.graph(),o=s.marginx||0,l=s.marginy||0;function c(u){let d=u.x,f=u.y,h=u.width,m=u.height;t=Math.min(t,d-h/2),n=Math.max(n,d+h/2),i=Math.min(i,f-m/2),r=Math.max(r,f+m/2)}e.nodes().forEach(u=>c(e.node(u))),e.edges().forEach(u=>{let d=e.edge(u);Object.hasOwn(d,"x")&&c(d)}),t-=o,i-=l,e.nodes().forEach(u=>{let d=e.node(u);d.x-=t,d.y-=i}),e.edges().forEach(u=>{let d=e.edge(u);d.points.forEach(f=>{f.x-=t,f.y-=i}),Object.hasOwn(d,"x")&&(d.x-=t),Object.hasOwn(d,"y")&&(d.y-=i)}),s.width=n-t+o,s.height=r-i+l}function OGt(e){e.edges().forEach(t=>{let n=e.edge(t),i=e.node(t.v),r=e.node(t.w),s,o;n.points?(s=n.points[0],o=n.points[n.points.length-1]):(n.points=[],s=r,o=i),n.points.unshift(boe(i,s)),n.points.push(boe(r,o))})}function kGt(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,"x"))switch((n.labelpos==="l"||n.labelpos==="r")&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}})}function SGt(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function EGt(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),i=e.node(n.borderTop),r=e.node(n.borderBottom),s=e.node(n.borderLeft[n.borderLeft.length-1]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-s.x),n.height=Math.abs(r.y-i.y),n.x=s.x+n.width/2,n.y=i.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy==="border"&&e.removeNode(t)})}function CGt(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function AGt(e){qT(e).forEach(t=>{let n=0;t.forEach((i,r)=>{let s=e.node(i);s.order=r+n,(s.selfEdges||[]).forEach(o=>{wO(e,"selfedge",{width:o.label.width,height:o.label.height,rank:s.rank,order:r+ ++n,e:o.e,label:o.label},"_se")}),delete s.selfEdges})})}function TGt(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy==="selfedge"){let i=n,r=e.node(i.e.v),s=r.x+r.width/2,o=r.y,l=n.x-s,c=r.height/2;e.setEdge(i.e,i.label),e.removeNode(t),i.label.points=[{x:s+2*l/3,y:o-c},{x:s+5*l/6,y:o-c},{x:s+l,y:o},{x:s+5*l/6,y:o+c},{x:s+2*l/3,y:o+c}],i.label.x=n.x,i.label.y=n.y}})}function a6(e,t){return _L(RP(e,t),Number)}function o6(e){let t={};return e&&Object.entries(e).forEach(([n,i])=>{typeof n=="string"&&(n=n.toLowerCase()),t[n]=i}),t}function _Gt(e){let t=qT(e),n=new Pd({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(i=>{n.setNode(i,{label:i}),n.setParent(i,"layer"+e.node(i).rank)}),e.edges().forEach(i=>n.setEdge(i.v,i.w,{},i.name)),t.forEach((i,r)=>{let s="layer"+r;n.setNode(s,{rank:"same"}),i.reduce((o,l)=>(n.setEdge(o,l,{style:"invis"}),l))}),n}var jGt={graphlib:ABe,version:UWt,layout:aGt,debug:_Gt,util:{time:FBe,notime:BBe}},Toe=jGt;/*! For license information please see dagre.esm.js.LEGAL.txt */const SS={llm:{labelKey:"buildCanvas.patterns.llm.label",descriptionKey:"buildCanvas.patterns.llm.description",icon:Lje},sequential:{labelKey:"buildCanvas.patterns.sequential.label",descriptionKey:"buildCanvas.patterns.sequential.description",icon:Bat},parallel:{labelKey:"buildCanvas.patterns.parallel.label",descriptionKey:"buildCanvas.patterns.parallel.description",icon:xat},loop:{labelKey:"buildCanvas.patterns.loop.label",descriptionKey:"buildCanvas.patterns.loop.description",icon:Qje},a2a:{labelKey:"buildCanvas.patterns.a2a.label",descriptionKey:"buildCanvas.patterns.a2a.description",icon:nM}},U7=220,Q7=88,_oe=96,joe=34,jE=64,l6=310,Vx=24,ZBe=56,z7=40,Noe=40,NGt=18,RGt=58,IGt=!1,PGt=e=>e==="sequential"||e==="parallel"||e==="loop";function V7(e,t){const n=e.agentType??"llm";return PGt(n)||n==="llm"&&(t.length===0||e.subAgents.length>0)}function H7(e,t=[],n="horizontal",i=!1){const r=e.agentType??"llm";if(!V7(e,t))return{width:U7,height:Q7};if(i&&e.subAgents.length===0)return{width:l6,height:jE};const s=e.subAgents.map((f,h)=>H7(f,[...t,h],n,i)),o=s.length?Math.max(...s.map(f=>f.width)):0,l=s.length?Math.max(...s.map(f=>f.height)):0,c=s.length&&r!=="parallel"?ZBe:Vx,u=n==="horizontal"?r!=="parallel":r==="parallel",d=s.length?r==="parallel"?NGt+Noe:r==="loop"?RGt:0:Noe;return u?{width:Math.max(l6,s.reduce((f,h)=>f+h.width,0)+z7*Math.max(0,s.length-1)+c*2),height:jE+Vx+l+d+Vx}:{width:Math.max(l6,o+Vx*2),height:jE+c+s.reduce((f,h)=>f+h.height,0)+z7*Math.max(0,s.length-1)+d+c}}function Rk(e){return e.length===0?"agent-root":`agent-${e.join("-")}`}function DGt(e,t){return e.length===t.length&&e.every((n,i)=>n===t[i])}function Roe(e){const t=n=>[n.agentType??"llm",n.subAgents.map(t)];return JSON.stringify(t(e))}function Ik(e,t,n,i){const r=(i==null?void 0:i.tone)==="sequential"?"hsl(213 40% 40%)":(i==null?void 0:i.tone)==="loop"?"hsl(151 34% 34%)":"hsl(220 9% 38%)";return{id:`${e}-${t}${i!=null&&i.loop?"-loop":""}`,source:e,target:t,sourceHandle:i!=null&&i.loop?"loop-source":void 0,targetHandle:i!=null&&i.loop?"loop-target":void 0,label:n,type:"insertStep",data:i?{insert:i.insert,loop:i.loop,tone:i.tone}:void 0,animated:i==null?void 0:i.loop,markerEnd:{type:lA.ArrowClosed,width:16,height:16,color:r},style:{stroke:r,strokeWidth:1.5},labelStyle:{fill:"hsl(215 14% 42%)",fontSize:10,fontWeight:600},labelBgStyle:{fill:"hsl(var(--background))",fillOpacity:.92}}}function Ioe(e,t,n=!1,i){const r=[{id:"terminal-input",type:"terminal",position:{x:0,y:0},data:{kind:"terminal",title:i("buildCanvas.terminals.input")},selectable:!1,draggable:!1},{id:"terminal-output",type:"terminal",position:{x:0,y:0},data:{kind:"terminal",title:i("buildCanvas.terminals.output")},selectable:!1,draggable:!1}],s=[];function o(f,h,m,g,b){const v=f.agentType??"llm",y=Rk(h);return V7(f,h)?(l(f,h,m,g,b),y):(r.push({id:y,type:"agent",parentId:m,extent:"parent",position:g,data:{kind:"agent",path:h,agent:f,title:v==="a2a"?i("buildCanvas.patterns.a2a.label"):f.name.trim()||(h.length===0?i("buildCanvas.rootAgent"):i("buildCanvas.unnamedStep")),pattern:v,description:f.description.trim()||i(SS[v].descriptionKey),childCount:f.subAgents.length,containedIn:b}}),y)}function l(f,h,m,g={x:0,y:0},b){const v=f.agentType??"sequential",y=Rk(h),w=H7(f,h,t,n);r.push({id:y,type:"group",parentId:m,extent:m?"parent":void 0,position:g,style:{width:w.width,height:w.height},data:{kind:"agent",path:h,agent:f,title:f.name.trim()||(h.length===0?i("buildCanvas.rootAgent"):i(SS[v].labelKey)),pattern:v,description:f.description.trim()||i(SS[v].descriptionKey),childCount:f.subAgents.length,containedIn:b,layoutWidth:w.width,layoutHeight:w.height,compactEmptyGroup:n&&f.subAgents.length===0}});const x=f.subAgents.map((E,j)=>H7(E,[...h,j],t,n)),O=x.length&&v!=="parallel"?ZBe:Vx,k=t==="horizontal"?v!=="parallel":v==="parallel";let S=O;const C=f.subAgents.map((E,j)=>{const T=x[j],R=k?{x:S,y:jE+Vx}:{x:(w.width-T.width)/2,y:jE+S};return S+=(k?T.width:T.height)+z7,o(E,[...h,j],y,R,v)});if(v==="sequential"||v==="loop"){for(let E=0;E1&&s.push(Ik(C[C.length-1],C[0],i("buildCanvas.edges.continueLoop"),{loop:!0,tone:"loop"}))}return y}const c=(f,h)=>{const m=f.agentType??"llm",g=Rk(h);if(V7(f,h))return l(f,h),[g];if(r.push({id:g,type:"agent",position:{x:0,y:0},data:{kind:"agent",path:h,agent:f,title:m==="a2a"?i("buildCanvas.patterns.a2a.label"):f.name.trim()||(h.length===0?i("buildCanvas.rootAgent"):i("buildCanvas.unnamedStep")),pattern:m,description:f.description.trim()||i(SS[m].descriptionKey),childCount:f.subAgents.length}}),f.subAgents.length===0)return[g];const b=[];return f.subAgents.forEach((v,y)=>{const w=[...h,y],x=Rk(w);s.push(Ik(g,x,i("buildCanvas.edges.call"),{insert:{parentPath:h,index:y}})),b.push(...c(v,w))}),b},u=Rk([]),d=c(e,[]);return s.push(Ik("terminal-input",u)),d.forEach(f=>s.push(Ik(f,"terminal-output"))),MGt(r,s,t)}function MGt(e,t,n){const i=new Toe.graphlib.Graph().setDefaultEdgeLabel(()=>({}));i.setGraph({rankdir:n==="vertical"?"TB":"LR",ranksep:50,nodesep:34,edgesep:14,marginx:24,marginy:24});const r=new Set(e.filter(s=>!s.parentId).map(s=>s.id));return e.filter(s=>!s.parentId).forEach(s=>{const o=s.data.kind==="terminal";i.setNode(s.id,{width:o?_oe:s.data.layoutWidth??U7,height:o?joe:s.data.layoutHeight??Q7})}),t.filter(s=>r.has(s.source)&&r.has(s.target)).forEach(s=>i.setEdge(s.source,s.target)),Toe.layout(i),{nodes:e.map(s=>{if(s.parentId)return s;const o=i.node(s.id),l=s.data.kind==="terminal",c=l?_oe:s.data.layoutWidth??U7,u=l?joe:s.data.layoutHeight??Q7;return{...s,position:{x:o.x-c/2,y:o.y-u/2}}}),edges:t}}const NL=p.createContext(null),RL=p.createContext("horizontal");function LGt({id:e,sourceX:t,sourceY:n,targetX:i,targetY:r,sourcePosition:s,targetPosition:o,markerEnd:l,style:c,label:u,data:d}){const{t:f}=Te("create"),h=p.useContext(NL),[m,g]=p.useState(!1),[b,v,y]=TP({sourceX:t,sourceY:n,targetX:i,targetY:r,sourcePosition:s,targetPosition:o,offset:d!=null&&d.loop?28:20});return a.jsxs(a.Fragment,{children:[a.jsx(HT,{id:e,path:b,markerEnd:l,style:c}),h&&(d==null?void 0:d.insert)&&a.jsx("path",{d:b,className:"abc-edge-hover-path",onPointerEnter:()=>g(!0),onPointerLeave:()=>g(!1)}),(u||h&&(d==null?void 0:d.insert))&&a.jsx(_qt,{children:a.jsxs("div",{className:`abc-edge-tools${h&&(d!=null&&d.insert)?" can-insert":""}${m?" is-visible":""}`,style:{transform:`translate(-50%, -50%) translate(${v}px, ${y}px)`},onPointerEnter:()=>g(!0),onPointerLeave:()=>g(!1),children:[u&&a.jsx("span",{className:"abc-edge-label",children:u}),h&&(d==null?void 0:d.insert)&&a.jsx("button",{type:"button",className:"abc-edge-add nodrag nopan","aria-label":f("buildCanvas.actions.insertHere"),title:f("buildCanvas.actions.insertHere"),onClick:w=>{w.stopPropagation(),h==null||h.onInsert(d.insert.parentPath,d.insert.index)},children:a.jsx(ic,{})})]})})]})}function $Gt({data:e,selected:t}){const{t:n}=Te("create"),i=p.useContext(NL),r=p.useContext(RL),s=r==="vertical"?vn.Top:vn.Left,o=r==="vertical"?vn.Bottom:vn.Right,l=r==="vertical"?vn.Right:vn.Bottom,c=e.pattern??"llm",u=SS[c],d=u.icon;return a.jsxs("div",{className:`abc-node is-${c}${e.containedIn?` is-contained-in-${e.containedIn}`:""}${t?" is-selected":""}`,children:[a.jsx($c,{type:"target",position:s,className:"abc-handle"}),c!=="llm"&&a.jsx("span",{className:"abc-node-icon",children:a.jsx(d,{})}),a.jsxs("span",{className:"abc-node-copy",children:[a.jsx("span",{className:"abc-node-meta",children:a.jsx("span",{children:n(u.labelKey)})}),a.jsx("strong",{children:e.title}),a.jsx("small",{children:e.description})]}),i&&e.path!==void 0&&e.path.length>0&&a.jsx("button",{type:"button",className:"abc-node-delete nodrag nopan","aria-label":n("buildCanvas.actions.deleteNamed",{name:e.title}),title:n("buildCanvas.actions.deleteNode"),onClick:f=>{f.stopPropagation(),i==null||i.onDelete(e.path)},children:a.jsx(Jg,{})}),a.jsx($c,{type:"source",position:o,className:"abc-handle"}),e.containedIn==="loop"&&a.jsxs(a.Fragment,{children:[a.jsx($c,{id:"loop-target",type:"target",position:l,className:"abc-handle abc-loop-handle"}),a.jsx($c,{id:"loop-source",type:"source",position:l,className:"abc-handle abc-loop-handle"})]})]})}function FGt({data:e,selected:t}){const{t:n}=Te("create"),i=p.useContext(NL),r=p.useContext(RL),s=r==="vertical"?vn.Top:vn.Left,o=r==="vertical"?vn.Bottom:vn.Right,l=r==="vertical"?vn.Right:vn.Bottom,c=e.pattern??"sequential",u=e.childCount??0,d=n(c==="llm"?"buildCanvas.actions.addSubagent":c==="parallel"?"buildCanvas.actions.addParallelStep":c==="loop"?"buildCanvas.actions.addLoopStep":"buildCanvas.actions.addNextStep");return a.jsxs("div",{className:`abc-group is-${c}${e.compactEmptyGroup?" is-compact-empty":""}${t?" is-selected":""}`,children:[a.jsx($c,{type:"target",position:s,className:"abc-handle"}),a.jsx("header",{className:"abc-group-head",children:a.jsxs("span",{children:[a.jsx("strong",{title:e.title,children:e.title}),a.jsx("small",{children:e.description})]})}),i&&e.path!==void 0&&u>0&&c!=="parallel"&&a.jsxs("div",{className:"abc-group-boundary-actions",children:[a.jsx("button",{type:"button",className:"abc-group-boundary-add is-start nodrag nopan","aria-label":n("buildCanvas.actions.addFirst"),title:n("buildCanvas.actions.addFirst"),onClick:f=>{f.stopPropagation(),i.onInsert(e.path,0)},children:a.jsx(ic,{})}),a.jsx("button",{type:"button",className:"abc-group-boundary-add is-end nodrag nopan","aria-label":n("buildCanvas.actions.addLast"),title:n("buildCanvas.actions.addLast"),onClick:f=>{f.stopPropagation(),i.onAdd(e.path)},children:a.jsx(ic,{})})]}),i&&e.path!==void 0&&u>0&&c==="parallel"&&a.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-bottom nodrag nopan",onClick:f=>{f.stopPropagation(),i.onAdd(e.path)},children:[a.jsx(ic,{}),a.jsx("span",{children:d})]}),i&&e.path!==void 0&&u===0&&a.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-empty nodrag nopan",onClick:f=>{f.stopPropagation(),i.onAdd(e.path)},children:[a.jsx(ic,{}),a.jsx("span",{children:d})]}),i&&e.path!==void 0&&e.path.length>0&&a.jsx("button",{type:"button",className:"abc-node-delete nodrag nopan","aria-label":n("buildCanvas.actions.deleteNamed",{name:e.title}),title:n("buildCanvas.actions.deleteNode"),onClick:f=>{f.stopPropagation(),i==null||i.onDelete(e.path)},children:a.jsx(Jg,{})}),a.jsx($c,{type:"source",position:o,className:"abc-handle"}),e.containedIn==="loop"&&a.jsxs(a.Fragment,{children:[a.jsx($c,{id:"loop-target",type:"target",position:l,className:"abc-handle abc-loop-handle"}),a.jsx($c,{id:"loop-source",type:"source",position:l,className:"abc-handle abc-loop-handle"})]})]})}function BGt({data:e}){const t=p.useContext(RL);return a.jsxs("div",{className:"abc-terminal",children:[a.jsx($c,{type:"target",position:t==="vertical"?vn.Top:vn.Left,className:"abc-handle"}),a.jsx("span",{children:e.title}),a.jsx($c,{type:"source",position:t==="vertical"?vn.Bottom:vn.Right,className:"abc-handle"})]})}const UGt={agent:$Gt,group:FGt,terminal:BGt},QGt={insertStep:LGt};function zGt({draft:e,selectedPath:t,onSelect:n,onAdd:i,onInsert:r,onDelete:s,readOnly:o=!1,interactivePreview:l=!1,direction:c="horizontal"}){const{t:u}=Te("create"),d=p.useMemo(()=>Ioe(e,c,o,u),[]),[f,h,m]=jqt(d.nodes),[g,b,v]=Nqt(d.edges),y=Iqt(),w=p.useRef(`${c}:${o?"readonly":"editable"}:${Roe(e)}`),x=p.useRef(null),{fitView:O}=AL(),k=p.useMemo(()=>Ioe(e,c,o,u),[c,e,o,u]),[S,C]=p.useState(()=>window.matchMedia("(max-width: 860px)").matches),E=p.useMemo(()=>o?{padding:.16,minZoom:.05,maxZoom:.9}:S?{padding:.08,minZoom:.35,maxZoom:.9}:{padding:.14,minZoom:.42,maxZoom:1.1},[S,o]),j=p.useCallback((R=0)=>{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{const A=x.current;if(A&&(A.clientWidth===0||A.clientHeight===0)&&R<8){j(R+1);return}O(E)})})},[E,O]);p.useEffect(()=>{const R=window.matchMedia("(max-width: 860px)"),A=N=>C(N.matches);return R.addEventListener("change",A),()=>R.removeEventListener("change",A)},[]),p.useEffect(()=>{const R=`${c}:${o?"readonly":"editable"}:${Roe(e)}`,A=R!==w.current;w.current=R,b(k.edges),h(N=>{const P=new Map(N.map(I=>[I.id,I]));return k.nodes.map(I=>{const D=P.get(I.id);return{...I,measured:!A&&D&&D.type===I.type?D.measured:void 0,position:!A&&D?D.position:I.position,selected:I.data.kind==="agent"&&!!I.data.path&&DGt(I.data.path,t)}})}),A&&j()},[k,e,j,t,b,h]),p.useEffect(()=>{j()},[S,j]),p.useEffect(()=>{y&&j()},[k,j,y]),p.useEffect(()=>{if(!o||!x.current)return;const R=new ResizeObserver(()=>j());return R.observe(x.current),j(),()=>R.disconnect()},[j,o]);const T=p.useMemo(()=>o?null:{onAdd:i,onInsert:r,onDelete:s},[i,s,r,o]);return a.jsx(RL.Provider,{value:c,children:a.jsx(NL.Provider,{value:T,children:a.jsx("section",{className:`abc-root is-${c}${o?" is-readonly":""}`,"aria-label":u(o?"buildCanvas.readOnlyLabel":"buildCanvas.label"),children:a.jsx("div",{ref:x,className:"abc-canvas",children:a.jsxs(Aqt,{nodes:f,edges:g,nodeTypes:UGt,edgeTypes:QGt,onNodesChange:m,onEdgesChange:v,onNodeClick:(R,A)=>{!o&&A.data.kind==="agent"&&A.data.path&&n(A.data.path)},nodesDraggable:!o,nodesConnectable:!1,nodesFocusable:!o,elementsSelectable:!o,edgesFocusable:!1,edgesReconnectable:!1,panOnDrag:!o||l,zoomOnDoubleClick:l,zoomOnPinch:!o||l,zoomOnScroll:!o||l,fitView:!0,fitViewOptions:E,onInit:()=>j(),minZoom:o?.05:.35,maxZoom:1.6,proOptions:{hideAttribution:!0},ariaLabelConfig:{"controls.ariaLabel":u("buildCanvas.controls.ariaLabel"),"controls.zoomIn.ariaLabel":u("buildCanvas.controls.zoomIn"),"controls.zoomOut.ariaLabel":u("buildCanvas.controls.zoomOut"),"controls.fitView.ariaLabel":u("buildCanvas.controls.fitView")},children:[a.jsx($qt,{gap:20,size:1.2,color:"hsl(34 20% 82%)"}),(!o||l)&&a.jsx(Hqt,{showInteractive:!1}),IGt]})})})})})}function IP(e){return a.jsx(OBe,{children:a.jsx(zGt,{...e})})}function VGt(e){return[{id:"case-1",itemKey:"case-1",kind:"good",input:e("agentWorkspace.defaultCases.weeklyFeedback.input"),output:e("agentWorkspace.defaultCases.weeklyFeedback.output"),referenceOutput:e("agentWorkspace.defaultCases.weeklyFeedback.output"),comment:"",agentName:e("agentWorkspace.defaultCases.agentName"),sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T09:12:00+08:00",evaluationSetId:"",evaluationSetName:e("agentWorkspace.defaultCases.goodSetName"),workspaceId:"",tag:e("agentWorkspace.defaultCases.weeklyFeedback.tag"),source:"auto",score:.92,reason:e("agentWorkspace.defaultCases.weeklyFeedback.reason")},{id:"case-2",itemKey:"case-2",kind:"good",input:e("agentWorkspace.defaultCases.research.input"),output:e("agentWorkspace.defaultCases.research.output"),referenceOutput:e("agentWorkspace.defaultCases.research.output"),comment:"",agentName:e("agentWorkspace.defaultCases.agentName"),sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T08:47:00+08:00",evaluationSetId:"",evaluationSetName:e("agentWorkspace.defaultCases.goodSetName"),workspaceId:"",tag:e("agentWorkspace.defaultCases.research.tag"),source:"user"},{id:"case-3",itemKey:"case-3",kind:"bad",input:e("agentWorkspace.defaultCases.uncertainConclusion.input"),output:e("agentWorkspace.defaultCases.uncertainConclusion.output"),referenceOutput:"",comment:"",agentName:e("agentWorkspace.defaultCases.agentName"),sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T07:35:00+08:00",evaluationSetId:"",evaluationSetName:e("agentWorkspace.defaultCases.badSetName"),workspaceId:"",tag:e("agentWorkspace.defaultCases.uncertainConclusion.tag"),source:"auto",score:.28,reason:e("agentWorkspace.defaultCases.uncertainConclusion.reason")},{id:"case-4",itemKey:"case-4",kind:"bad",input:e("agentWorkspace.defaultCases.repeatedTool.input"),output:e("agentWorkspace.defaultCases.repeatedTool.output"),referenceOutput:"",comment:"",agentName:e("agentWorkspace.defaultCases.agentName"),sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T06:58:00+08:00",evaluationSetId:"",evaluationSetName:e("agentWorkspace.defaultCases.badSetName"),workspaceId:"",tag:e("agentWorkspace.defaultCases.repeatedTool.tag"),source:"user"}]}const HGt=[{id:"eval-regression",name:"核心能力回归",agentIds:[],caseSet:"核心回归集",evaluator:"综合质量评估器",metrics:["回答质量","工具调用"],concurrency:"4",history:[{id:"run-1",createdAt:"今天 10:32",score:88,status:"completed"},{id:"run-2",createdAt:"昨天 16:08",score:84,status:"completed"}]},{id:"eval-safety",name:"安全与幻觉检查",agentIds:[],caseSet:"安全边界集",evaluator:"事实一致性评估器",metrics:["事实准确性","拒答合理性"],concurrency:"2",history:[{id:"run-3",createdAt:"7 月 25 日 14:20",score:91,status:"completed"}]}],qGt={核心能力回归:"agentWorkspace.evaluationDefaults.coreRegression",安全与幻觉检查:"agentWorkspace.evaluationDefaults.safetyCheck",核心回归集:"agentWorkspace.evaluationDefaults.coreSet",安全边界集:"agentWorkspace.evaluationDefaults.safetySet",工具调用集:"agentWorkspace.evaluationDefaults.toolSet",综合质量评估器:"agentWorkspace.evaluationDefaults.qualityEvaluator",事实一致性评估器:"agentWorkspace.evaluationDefaults.factualEvaluator",工具调用评估器:"agentWorkspace.evaluationDefaults.toolEvaluator",回答质量:"agentWorkspace.evaluationDefaults.responseQuality",事实准确性:"agentWorkspace.evaluationDefaults.factualAccuracy",工具调用:"agentWorkspace.evaluationDefaults.toolUse",响应效率:"agentWorkspace.evaluationDefaults.responseEfficiency","今天 10:32":"agentWorkspace.evaluationDefaults.todayTime","昨天 16:08":"agentWorkspace.evaluationDefaults.yesterdayTime","7 月 25 日 14:20":"agentWorkspace.evaluationDefaults.julyTime",刚刚:"agentWorkspace.evaluationDefaults.justNow"};function ES(e,t){const n=qGt[e];return n?t(n):e}const WGt=["basic","profileConfig","sessionConfig","usage","diagnostics","evaluations","optimizations","integrations","versions"],KGt=20;function JBe(e,t,n){const i=Date.parse(e);return Number.isNaN(i)?n("agentWorkspace.notProvided"):new Intl.DateTimeFormat(t,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).format(i)}const Pk=[{id:"api-server",label:"API Server"},{id:"a2a",label:"A2A"}];function e9e(e){if(!e||typeof e!="object")return"";const t=e.id;return typeof t=="string"?t:""}function hx(e){var t;return e9e((t=e==null?void 0:e.effectiveRefs)==null?void 0:t.model)}function Poe(e,t){var r;const n=(r=e==null?void 0:e.overrides)==null?void 0:r[t];if(!n||typeof n!="object")return"";const i=n.mode;return i==="replace"||i==="clear"||i==="inherit"?i:""}function t9e(e){var n;const t=(n=e==null?void 0:e.effectiveRefs)==null?void 0:n.mcpServers;return Array.isArray(t)?t.map(e9e).filter(Boolean):[]}function GGt(e,t){switch(e){case"active_operation":return t("agentWorkspace.mpaDeleteBlockerActiveOperation");case"active_sessions":return t("agentWorkspace.mpaDeleteBlockerActiveSessions");case"binding_ambiguous":return t("agentWorkspace.mpaDeleteBlockerBindingAmbiguous");case"runtime_missing":return t("agentWorkspace.mpaDeleteBlockerRuntimeMissing");case"orphan_runtime":return t("agentWorkspace.mpaDeleteBlockerOrphanRuntime");default:return e}}function XGt(e,t){switch(e){case"runtime_legacy_auth_unsupported":return t("agentWorkspace.mpaRuntimeLegacyAuthUnsupported");case"profile_not_found":return t("agentWorkspace.mpaRuntimeOrphan");case"binding_ambiguous":return t("agentWorkspace.mpaRuntimeBindingAmbiguous");case"runtime_missing":return t("agentWorkspace.mpaRuntimeMissing");default:return e??""}}function YGt({preview:e,t}){const n=e.blockers.map(i=>GGt(i,t));return a.jsxs("div",{className:"aw-mpa-delete-preview",children:[a.jsx("p",{children:t("agentWorkspace.mpaDeletePreviewSummary")}),a.jsxs("dl",{className:"aw-mpa-delete-preview__stats",children:[a.jsxs("div",{children:[a.jsx("dt",{children:t("agentWorkspace.mpaDeletePreviewSessions")}),a.jsx("dd",{children:e.sessionCounts.total})]}),a.jsxs("div",{children:[a.jsx("dt",{children:t("agentWorkspace.mpaDeletePreviewActiveSessions")}),a.jsx("dd",{children:e.sessionCounts.active})]}),a.jsxs("div",{children:[a.jsx("dt",{children:t("agentWorkspace.mpaDeletePreviewIdleSessions")}),a.jsx("dd",{children:e.sessionCounts.idle})]})]}),n.length>0?a.jsxs("div",{className:"aw-mpa-delete-preview__blockers",role:"status",children:[a.jsx("strong",{children:t("agentWorkspace.mpaDeleteBlocked")}),a.jsx("ul",{children:n.map(i=>a.jsx("li",{children:i},i))})]}):a.jsx("ol",{className:"aw-mpa-delete-preview__plan",children:e.cleanupPlan.map(i=>a.jsx("li",{children:t(`agentWorkspace.mpaDeleteStage.${i.stage}`,{count:i.count})},i.stage))})]})}function c6(e,t){return e instanceof nw&&e.status===412?t:e instanceof Error?e.message:String(e)}function ZGt(e){return t9e(e).length}function Doe(e,t){const n=t9e(e);return n.length?n.join(", "):t("agentWorkspace.none")}function Moe(e,t){var n;return!!((n=e==null?void 0:e.overrides)!=null&&n[t])}function JGt(e,t,n){return`mpa-session-profile-upgrade:${e}:${t}:${n}`}function u6(e,t){return e?`${e.replace(/\/+$/,"")}${t}`:""}function eXt(e,t){const n=e.trim();if(!n||!t)return n;try{const i=new URL(n),r=i.hostname.replace(/^\[|\]$/g,"").toLowerCase();if(!["localhost","127.0.0.1","::1"].includes(r))return n;const s=new URL(t);return i.protocol=s.protocol,i.hostname=s.hostname,i.port=s.port,i.toString()}catch{return n}}function Loe(e,t){return e==="key_auth"?"API Key":e==="custom_jwt"?"OAuth / JWT":t(e==="none"?"agentWorkspace.noAuthentication":"agentWorkspace.notAvailable")}function $oe(e,t){return t(e==="published"?"agentWorkspace.githubStatus.published":e==="publishing"?"agentWorkspace.githubStatus.publishing":e==="failed"?"agentWorkspace.githubStatus.failed":e==="pending"?"agentWorkspace.githubStatus.pending":"agentWorkspace.githubStatus.unknown")}function tXt(e,t){return e.changeType==="rollback"?t("agentWorkspace.rollbackEvent"):e.version}function q7(e){return JSON.stringify(e)}function n9e(e){return e==="key_auth"?`API_KEY = "" HEADERS = {"Authorization": f"Bearer {API_KEY}"}`:e==="custom_jwt"?`ACCESS_TOKEN = "" HEADERS = {"Authorization": f"Bearer {ACCESS_TOKEN}"}`:e==="none"?"HEADERS = {}":`AUTH_TOKEN = "" HEADERS = {"Authorization": f"Bearer {AUTH_TOKEN}"}`}function nXt(e,t,n){const i=e.replace(/\/+$/,"");return`\`\`\`python @@ -846,18 +846,18 @@ response = requests.post( ) response.raise_for_status() print(response.json()) -\`\`\``}function rXt({visible:e}){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M2.8 12s3.3-5.4 9.2-5.4 9.2 5.4 9.2 5.4-3.3 5.4-9.2 5.4S2.8 12 2.8 12Z"}),a.jsx("circle",{cx:"12",cy:"12",r:"2.4"}),!e&&a.jsx("path",{d:"m4.2 4.2 15.6 15.6"})]})}function Foe({available:e,authType:t,value:n,visible:i,loading:r,error:s,onToggle:o}){const{t:l}=Te("ui");return e?t==="none"?l("agentWorkspace.noApiKeyRequired"):t==="custom_jwt"?l("agentWorkspace.usesOauthJwt"):t!=="key_auth"?l("agentWorkspace.notAvailable"):a.jsxs("span",{className:"aw-integration-secret",children:[a.jsx("span",{className:"aw-integration-secret-value","aria-live":"polite",children:i&&n?n:"****"}),a.jsx("button",{type:"button",className:"aw-integration-secret-toggle","aria-label":l(i?"agentWorkspace.hideApiKey":"agentWorkspace.showApiKey"),title:l(i?"agentWorkspace.hideApiKey":"agentWorkspace.showApiKey"),disabled:r,onClick:o,children:r?a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}):a.jsx(rXt,{visible:i})}),s&&a.jsx("span",{className:"aw-integration-secret-error",role:"alert",children:s})]}):l("agentWorkspace.notAvailable")}function Boe({protocol:e,title:t,available:n,fields:i,example:r}){const{t:s}=Te("ui");return a.jsxs("section",{className:`aw-integration-panel${n&&r?" has-example":""}`,id:`integration-${e}-panel`,role:"tabpanel","aria-labelledby":`integration-${e}-tab`,children:[a.jsx("header",{children:a.jsx("h3",{children:t})}),a.jsx("dl",{children:i.map(o=>a.jsxs("div",{children:[a.jsx("dt",{children:o.label}),a.jsx("dd",{children:o.value||s("agentWorkspace.notAvailable")})]},o.label))}),n&&r&&a.jsxs("section",{className:"aw-integration-example",children:[a.jsx("h4",{children:s("agentWorkspace.pythonExample")}),a.jsx(_d,{text:r,className:"aw-integration-example-code",allowRawHtml:!1})]})]})}function zv(e,t){const n=(e??[]).flatMap(i=>{const r=i.name??i.id??i.skillId??i.source;return typeof r=="string"&&r.trim()?[r.trim()]:[]});return n.length?n.join(", "):t}function W7(e){return Array.isArray(e)?`[${e.map(W7).join(",")}]`:e&&typeof e=="object"?`{${Object.entries(e).filter(([,n])=>n!==void 0).sort(([n],[i])=>n.localeCompare(i)).map(([n,i])=>`${JSON.stringify(n)}:${W7(i)}`).join(",")}}`:JSON.stringify(e)}async function sXt(e,t,n){const i=new TextEncoder().encode(W7(n)),r=await crypto.subtle.digest("SHA-256",i),s=Array.from(new Uint8Array(r),o=>o.toString(16).padStart(2,"0")).join("");return`mpa-profile:${e}:${t}:${s}`}function aXt({profile:e,profileStatus:t,runtimeReady:n,disabledReason:i,saving:r,error:s,notice:o,onApply:l,onEditProfile:c,onRefresh:u}){var m;const{t:d}=Te("ui"),f=(t==null?void 0:t.status)==="applied",h=n&&!r;return a.jsxs("section",{className:"aw-session-config aw-profile-config","aria-busy":r,children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:d("agentWorkspace.profileConfigTitle")}),a.jsx("p",{children:d("agentWorkspace.profileConfigDescription")})]}),i?a.jsx("div",{className:"aw-session-config-state",children:i}):a.jsxs(a.Fragment,{children:[s&&a.jsxs("div",{className:"aw-session-config-state is-error",role:"alert",children:[a.jsx("span",{children:s}),a.jsx("button",{type:"button",onClick:u,disabled:r,children:d("common.retry")})]}),o&&!s&&a.jsx("div",{className:"aw-session-config-notice",role:"status",children:o}),a.jsxs("div",{className:"aw-session-config-actions",children:[a.jsx("button",{type:"button",onClick:c,disabled:r,children:d("agentWorkspace.editProfile")}),a.jsx("button",{type:"button",onClick:u,disabled:r,children:d("common.refresh")})]}),a.jsxs("dl",{className:"aw-session-config-grid",children:[a.jsxs("div",{children:[a.jsx("dt",{children:d("agentWorkspace.profileStatus")}),a.jsx("dd",{children:d(f?"agentWorkspace.profileApplied":"agentWorkspace.profileNotApplied")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:d("agentWorkspace.latestProfileRevision")}),a.jsx("dd",{children:(t==null?void 0:t.profileRevision)??d("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:d("agentWorkspace.modelId")}),a.jsx("dd",{children:String(((m=e.model)==null?void 0:m.id)||d("agentWorkspace.notAvailable"))})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"ETag"}),a.jsx("dd",{children:(t==null?void 0:t.etag)||d("agentWorkspace.notAvailable")})]})]}),!f&&a.jsxs("div",{className:"aw-session-config-upgrade",role:"status",children:[a.jsx("span",{children:d("agentWorkspace.profileNotAppliedDescription")}),a.jsx("button",{type:"button",onClick:l,disabled:!h,children:d(r?"agentWorkspace.profileApplying":"agentWorkspace.applyProfile")})]}),f&&a.jsx("div",{className:"aw-session-config-actions",children:a.jsx("button",{type:"button",onClick:l,disabled:!h,children:d(r?"agentWorkspace.profileApplying":"agentWorkspace.reapplyProfile")})}),a.jsx("div",{className:"aw-session-config-card",children:a.jsxs("div",{children:[a.jsx("h4",{children:d("agentWorkspace.profilePrompt")}),a.jsx("p",{children:e.system||d("agentWorkspace.notAvailable")})]})}),a.jsxs("div",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:d("agentWorkspace.profileResources")}),a.jsx("p",{children:d("agentWorkspace.profileResourceSummary",{tools:e.tools.length,skills:e.skills.length,mcp:e.mcpServers.length})})]}),a.jsxs("div",{className:"aw-profile-config-list",children:[a.jsxs("span",{title:zv(e.tools,d("agentWorkspace.notAvailable")),children:[d("agentSelector.tools"),": ",zv(e.tools,d("agentWorkspace.notAvailable"))]}),a.jsxs("span",{title:zv(e.skills,d("agentWorkspace.notAvailable")),children:[d("agentSelector.skills"),": ",zv(e.skills,d("agentWorkspace.notAvailable"))]}),a.jsxs("span",{title:zv(e.mcpServers,d("agentWorkspace.notAvailable")),children:["MCP: ",zv(e.mcpServers,d("agentWorkspace.notAvailable"))]})]})]})]})]})}function oXt({config:e,profileStatus:t,loadable:n,disabledReason:i,loading:r,saving:s,upgrading:o,error:l,notice:c,modelValue:u,modelDirty:d,profileUpgradeAvailable:f,onModelChange:h,onSaveModel:m,onInheritModel:g,onClearMcp:b,onInheritMcp:v,onUpgradeProfile:y,onRefresh:w}){const{t:x}=Te("ui"),O=r||s||o,k=Poe(e,"model"),S=Poe(e,"mcpServers"),C=dx(e),E=(t==null?void 0:t.status)==="applied"?t.profileRevision:null;return a.jsxs("section",{className:"aw-session-config","aria-busy":O,children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:x("agentWorkspace.sessionConfigTitle")}),a.jsx("p",{children:x("agentWorkspace.sessionConfigDescription")})]}),n?r&&!e?a.jsxs("div",{className:"aw-session-config-state",role:"status",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsx("span",{children:x("agentWorkspace.loadingSessionConfig")})]}):a.jsxs(a.Fragment,{children:[l&&a.jsxs("div",{className:"aw-session-config-state is-error",role:"alert",children:[a.jsx("span",{children:l}),a.jsx("button",{type:"button",onClick:w,disabled:O,children:x("common.retry")})]}),c&&!l&&a.jsx("div",{className:"aw-session-config-notice",role:"status",children:c}),e&&a.jsxs(a.Fragment,{children:[a.jsxs("dl",{className:"aw-session-config-grid",children:[a.jsxs("div",{children:[a.jsx("dt",{children:x("agentWorkspace.sessionConfigRevision")}),a.jsx("dd",{children:e.revision})]}),a.jsxs("div",{children:[a.jsx("dt",{children:x("agentWorkspace.sessionProfileRevision")}),a.jsx("dd",{children:e.profileRevision})]}),a.jsxs("div",{children:[a.jsx("dt",{children:x("agentWorkspace.latestProfileRevision")}),a.jsx("dd",{children:E??x("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"ETag"}),a.jsx("dd",{children:e.etag||x("agentWorkspace.notAvailable")})]})]}),f&&E!=null&&a.jsxs("div",{className:"aw-session-config-upgrade",role:"status",children:[a.jsx("span",{children:x("agentWorkspace.sessionProfileUpgradeAvailable",{current:e.profileRevision,target:E})}),a.jsx("button",{type:"button",onClick:y,disabled:O,children:x(o?"agentWorkspace.sessionProfileUpgrading":"agentWorkspace.upgradeSessionProfile")})]}),a.jsxs("div",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:x("agentWorkspace.sessionModelOverride")}),a.jsx("p",{children:x(k?`agentWorkspace.executionConfigMode.${k}`:"agentWorkspace.executionConfigMode.inherit")})]}),a.jsxs("label",{className:"aw-session-config-field",children:[a.jsx("span",{children:x("agentWorkspace.modelId")}),a.jsx("input",{type:"text",value:u,onChange:j=>h(j.currentTarget.value),placeholder:C||x("agentWorkspace.inheritProfileDefault"),disabled:O})]}),a.jsxs("div",{className:"aw-session-config-actions",children:[a.jsx("button",{type:"button",onClick:m,disabled:O||!d,children:x(s?"common.saving":"common.save")}),a.jsx("button",{type:"button",onClick:g,disabled:O||!Moe(e,"model"),children:x("agentWorkspace.inheritProfileDefault")})]})]}),a.jsxs("div",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:x("agentWorkspace.sessionMcpServers")}),a.jsx("p",{children:x(S?`agentWorkspace.executionConfigMode.${S}`:"agentWorkspace.executionConfigMode.inherit")})]}),a.jsxs("div",{className:"aw-session-config-value",children:[a.jsx("span",{children:x("agentWorkspace.mcpServerCount",{count:ZGt(e)})}),a.jsx("small",{title:Doe(e,x),children:Doe(e,x)})]}),a.jsxs("div",{className:"aw-session-config-actions",children:[a.jsx("button",{type:"button",onClick:b,disabled:O||S==="clear",children:x("agentWorkspace.clearSessionMcp")}),a.jsx("button",{type:"button",onClick:v,disabled:O||!Moe(e,"mcpServers"),children:x("agentWorkspace.inheritProfileDefault")})]})]})]})]}):a.jsx("div",{className:"aw-session-config-state",children:i})]})}function Uoe(e,t){const n=e==null?void 0:e[t];return n==null||n===""?"":String(n)}function lXt(e,t){const n=e==null?void 0:e.worker;if(!n||typeof n!="object")return"";const i=n[t];return i==null||i===""?"":String(i)}function cXt(e,t){return typeof e!="number"||!Number.isFinite(e)?t("agentWorkspace.notAvailable"):`${Math.round(e)} ms`}function uXt({data:e,loadable:t,disabledReason:n,loading:i,error:r,onRefresh:s,locale:o}){const{t:l}=Te("ui"),c=(e==null?void 0:e.runs)??[],u=(e==null?void 0:e.trace)??null,d=c[0],f=(u==null?void 0:u.correlation)??{},h=[["mpaInstanceId",l("agentWorkspace.mpaInstanceId")],["profileRevision",l("agentWorkspace.sessionProfileRevision")],["executionConfigRevision",l("agentWorkspace.sessionConfigRevision")],["turnId",l("agentWorkspace.turnId")],["taskId",l("agentWorkspace.taskId")],["runtimeId","Runtime ID"],["runtimeVersion",l("systemInfo.currentVersion")]],m=[["kind",l("agentWorkspace.workerKind")],["sessionId",l("agentWorkspace.workerSession")],["turnId",l("agentWorkspace.workerTurn")],["profileId",l("agentWorkspace.workerProfile")],["profileVersion",l("agentWorkspace.workerProfileVersion")]];return a.jsxs("section",{className:"aw-mpa-diagnostics","aria-busy":i,children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:l("agentWorkspace.mpaDiagnosticsTitle")}),a.jsx("p",{children:l("agentWorkspace.mpaDiagnosticsDescription")})]}),t?i&&!e?a.jsxs("div",{className:"aw-session-config-state",role:"status",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsx("span",{children:l("agentWorkspace.loadingMpaDiagnostics")})]}):r?a.jsxs("div",{className:"aw-session-config-state is-error",role:"alert",children:[a.jsx("span",{children:r}),a.jsx("button",{type:"button",onClick:s,disabled:i,children:l("common.retry")})]}):d?a.jsxs(a.Fragment,{children:[a.jsxs("dl",{className:"aw-session-config-grid",children:[a.jsxs("div",{children:[a.jsx("dt",{children:l("agentWorkspace.latestRun")}),a.jsx("dd",{children:d.invocationId})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("agentSelector.status")}),a.jsx("dd",{children:d.status})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("agentWorkspace.lastUsed")}),a.jsx("dd",{children:JBe(d.startedAt,o,l)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("agentWorkspace.stepCount")}),a.jsx("dd",{children:d.stepCount})]})]}),a.jsxs("section",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:l("agentWorkspace.traceCorrelation")}),a.jsx("p",{children:l("agentWorkspace.traceCorrelationDescription")})]}),a.jsxs("dl",{className:"aw-mpa-correlation",children:[h.map(([g,b])=>a.jsxs("div",{children:[a.jsx("dt",{children:b}),a.jsx("dd",{children:Uoe(f,g)||l("agentWorkspace.notAvailable")})]},g)),m.map(([g,b])=>a.jsxs("div",{children:[a.jsx("dt",{children:b}),a.jsx("dd",{children:lXt(f,g)||l("agentWorkspace.notAvailable")})]},`worker-${g}`))]})]}),a.jsxs("section",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:l("agentWorkspace.traceSteps")}),a.jsx("p",{children:l("agentWorkspace.traceStepsDescription")})]}),u!=null&&u.steps.length?a.jsx("div",{className:"aw-usage-table-wrap",children:a.jsxs("table",{className:"aw-usage-table aw-mpa-trace-table",children:[a.jsx("caption",{children:l("agentWorkspace.traceSteps")}),a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:l("agentWorkspace.step")}),a.jsx("th",{scope:"col",children:l("agentSelector.status")}),a.jsx("th",{scope:"col",children:l("agentWorkspace.duration")}),a.jsx("th",{scope:"col",children:l("agentWorkspace.turnId")})]})}),a.jsx("tbody",{children:u.steps.slice(0,20).map(g=>a.jsxs("tr",{children:[a.jsxs("td",{children:[a.jsx("strong",{children:g.title||g.kind}),a.jsx("small",{children:g.kind})]}),a.jsx("td",{children:g.status}),a.jsx("td",{children:cXt(g.durationMs,l)}),a.jsx("td",{children:Uoe(g.correlation,"turnId")||l("agentWorkspace.notAvailable")})]},g.stepId))})]})}):a.jsx("div",{className:"aw-session-config-value",children:a.jsx("span",{children:l("agentWorkspace.noTraceSteps")})})]})]}):a.jsx("div",{className:"aw-session-config-state",children:l("agentWorkspace.noMpaDiagnostics")}):a.jsx("div",{className:"aw-session-config-state",children:n})]})}function dXt(e,t,n){var i;return fH({appName:((i=e==null?void 0:e.appName)==null?void 0:i.trim())||t,name:e==null?void 0:e.name,description:e==null?void 0:e.description,type:e==null?void 0:e.type,model:e==null?void 0:e.model,tools:e==null?void 0:e.tools,skills:e==null?void 0:e.skills,graph:e==null?void 0:e.graph,draft:e==null?void 0:e.draft},n)}function i9e(e){return e?1+e.children.reduce((t,n)=>t+i9e(n),0):1}function r9e(e){return 1+e.subAgents.reduce((t,n)=>t+r9e(n),0)}function K7(e){if(!e)return 0;const t=Number(e);if(Number.isFinite(t))return t<1e12?t*1e3:t;const n=Date.parse(e);return Number.isFinite(n)?n:0}function fXt(e,t,n){const i=K7(e);return i?new Intl.DateTimeFormat(t,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(i)):n("agentWorkspace.unknownTime")}function hXt(e,t){return typeof e.score!="number"||!Number.isFinite(e.score)?"—":t("agentWorkspace.scoreValue",{score:Math.round(e.score*100)})}function pXt(e,t){return t(`agentWorkspace.priority.${e}`)}const mXt={agent_structure:"agentWorkspace.modules.agentStructure",prompt:"agentWorkspace.modules.prompt",tool:"agentWorkspace.modules.tool",knowledge:"agentWorkspace.modules.knowledge",memory:"agentWorkspace.modules.memory",workflow:"agentWorkspace.modules.workflow",other:"agentWorkspace.modules.other"};function gXt(e,t){var n;return e.module==="other"?((n=e.customModule)==null?void 0:n.trim())||t("agentWorkspace.modules.other"):t(mXt[e.module])}function bXt(e,t){return e.find(n=>n.kind===t)}function Qoe(e,t){return e.items.map(n=>({...n,tag:t(n.kind==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")})).sort((n,i)=>K7(i.createdAt)-K7(n.createdAt))}function yXt(e){const t=n=>[n.name,n.description,n.agentType??"llm",n.modelName??"",n.tools??[],n.builtinTools??[],(n.customTools??[]).map(i=>i.name),(n.mcpTools??[]).map(i=>i.name),n.skills??[],(n.selectedSkills??[]).map(i=>i.name),(n.subAgents??[]).map(t)];return JSON.stringify(t(e))}function vXt(e){return[{phase:"prepare",label:e("agentWorkspace.deploymentSteps.prepare.label"),description:e("agentWorkspace.deploymentSteps.prepare.description")},{phase:"build",label:e("agentWorkspace.deploymentSteps.build.label"),description:e("agentWorkspace.deploymentSteps.build.description")},{phase:"deploy",label:e("agentWorkspace.deploymentSteps.deploy.label"),description:e("agentWorkspace.deploymentSteps.deploy.description")},{phase:"publish",label:e("agentWorkspace.deploymentSteps.publish.label"),description:e("agentWorkspace.deploymentSteps.publish.description")},{phase:"complete",label:e("agentWorkspace.deploymentSteps.complete.label"),description:e("agentWorkspace.deploymentSteps.complete.description")}]}function xXt(e,t){return{phase:"update",label:t("agentWorkspace.deploymentSteps.update.label"),description:t("agentWorkspace.deploymentSteps.update.description",e)}}function s9e(e,t){const n=vXt(t),i=[...n.slice(0,-1)];return e.instanceRange&&i.push(xXt(e.instanceRange,t)),e.createEvaluationSets&&i.push({phase:"evaluation",label:t("agentWorkspace.deploymentSteps.evaluation.label"),description:t("agentWorkspace.deploymentSteps.evaluation.description")}),e.mpaProfile&&(i.push({phase:"profile_applying",label:t("agentWorkspace.deploymentSteps.profileApplying.label"),description:t("agentWorkspace.deploymentSteps.profileApplying.description")}),e.mpaSmoke&&(i.push({phase:"smoke_running",label:t("agentWorkspace.deploymentSteps.smokeRunning.label"),description:t("agentWorkspace.deploymentSteps.smokeRunning.description")}),i.push({phase:"runnable",label:t("agentWorkspace.deploymentSteps.runnable.label"),description:t("agentWorkspace.deploymentSteps.runnable.description")}))),e.githubDelivery&&i.push({phase:"github",label:t("agentWorkspace.deploymentSteps.github.label"),description:t("agentWorkspace.deploymentSteps.github.description")}),i.push(n[n.length-1]),i}function a9e(e,t){const n=s9e(e,t);if(e.status==="success")return n.length-1;const i=e.phase??{准备部署:"prepare",构建镜像:"build",部署:"deploy",发布:"publish",创建评测集:"evaluation","应用 MPA Profile":"profile_applying","验证 MPA Runtime":"smoke_running","MPA Runtime 可运行":"runnable","挂载 GitHub 持续交付":"github",部署完成:"complete"}[e.label],r=n.findIndex(s=>s.phase===i);return r<0?0:r}function wXt(e,t){if(!e)return"";try{return new Intl.DateTimeFormat(t,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(new Date(e))}catch{return""}}function o9e({log:e,autoExpand:t,title:n,ariaLabel:i,copyLabel:r,defaultPendingMessage:s}){const{t:o,i18n:l}=Te("ui"),c=p.useRef(null),u=!!((e==null?void 0:e.status)!=="complete"&&t),[d,f]=p.useState(u),[h,m]=p.useState(!1),g=!!(e!=null&&e.text||e!=null&&e.error),b=(e==null?void 0:e.text)||(e==null?void 0:e.error)||"",v=b.split(` +\`\`\``}function rXt({visible:e}){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M2.8 12s3.3-5.4 9.2-5.4 9.2 5.4 9.2 5.4-3.3 5.4-9.2 5.4S2.8 12 2.8 12Z"}),a.jsx("circle",{cx:"12",cy:"12",r:"2.4"}),!e&&a.jsx("path",{d:"m4.2 4.2 15.6 15.6"})]})}function Foe({available:e,authType:t,value:n,visible:i,loading:r,error:s,onToggle:o}){const{t:l}=Te("ui");return e?t==="none"?l("agentWorkspace.noApiKeyRequired"):t==="custom_jwt"?l("agentWorkspace.usesOauthJwt"):t!=="key_auth"?l("agentWorkspace.notAvailable"):a.jsxs("span",{className:"aw-integration-secret",children:[a.jsx("span",{className:"aw-integration-secret-value","aria-live":"polite",children:i&&n?n:"****"}),a.jsx("button",{type:"button",className:"aw-integration-secret-toggle","aria-label":l(i?"agentWorkspace.hideApiKey":"agentWorkspace.showApiKey"),title:l(i?"agentWorkspace.hideApiKey":"agentWorkspace.showApiKey"),disabled:r,onClick:o,children:r?a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}):a.jsx(rXt,{visible:i})}),s&&a.jsx("span",{className:"aw-integration-secret-error",role:"alert",children:s})]}):l("agentWorkspace.notAvailable")}function Boe({protocol:e,title:t,available:n,fields:i,example:r}){const{t:s}=Te("ui");return a.jsxs("section",{className:`aw-integration-panel${n&&r?" has-example":""}`,id:`integration-${e}-panel`,role:"tabpanel","aria-labelledby":`integration-${e}-tab`,children:[a.jsx("header",{children:a.jsx("h3",{children:t})}),a.jsx("dl",{children:i.map(o=>a.jsxs("div",{children:[a.jsx("dt",{children:o.label}),a.jsx("dd",{children:o.value||s("agentWorkspace.notAvailable")})]},o.label))}),n&&r&&a.jsxs("section",{className:"aw-integration-example",children:[a.jsx("h4",{children:s("agentWorkspace.pythonExample")}),a.jsx(Td,{text:r,className:"aw-integration-example-code",allowRawHtml:!1})]})]})}function Hv(e,t){const n=(e??[]).flatMap(i=>{const r=i.name??i.id??i.skillId??i.source;return typeof r=="string"&&r.trim()?[r.trim()]:[]});return n.length?n.join(", "):t}function W7(e){return Array.isArray(e)?`[${e.map(W7).join(",")}]`:e&&typeof e=="object"?`{${Object.entries(e).filter(([,n])=>n!==void 0).sort(([n],[i])=>n.localeCompare(i)).map(([n,i])=>`${JSON.stringify(n)}:${W7(i)}`).join(",")}}`:JSON.stringify(e)}async function sXt(e,t,n){const i=new TextEncoder().encode(W7(n)),r=await crypto.subtle.digest("SHA-256",i),s=Array.from(new Uint8Array(r),o=>o.toString(16).padStart(2,"0")).join("");return`mpa-profile:${e}:${t}:${s}`}function aXt({profile:e,profileStatus:t,runtimeReady:n,disabledReason:i,saving:r,error:s,notice:o,onApply:l,onEditProfile:c,onRefresh:u}){var m;const{t:d}=Te("ui"),f=(t==null?void 0:t.status)==="applied",h=n&&!r;return a.jsxs("section",{className:"aw-session-config aw-profile-config","aria-busy":r,children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:d("agentWorkspace.profileConfigTitle")}),a.jsx("p",{children:d("agentWorkspace.profileConfigDescription")})]}),i?a.jsx("div",{className:"aw-session-config-state",children:i}):a.jsxs(a.Fragment,{children:[s&&a.jsxs("div",{className:"aw-session-config-state is-error",role:"alert",children:[a.jsx("span",{children:s}),a.jsx("button",{type:"button",onClick:u,disabled:r,children:d("common.retry")})]}),o&&!s&&a.jsx("div",{className:"aw-session-config-notice",role:"status",children:o}),a.jsxs("div",{className:"aw-session-config-actions",children:[a.jsx("button",{type:"button",onClick:c,disabled:r,children:d("agentWorkspace.editProfile")}),a.jsx("button",{type:"button",onClick:u,disabled:r,children:d("common.refresh")})]}),a.jsxs("dl",{className:"aw-session-config-grid",children:[a.jsxs("div",{children:[a.jsx("dt",{children:d("agentWorkspace.profileStatus")}),a.jsx("dd",{children:d(f?"agentWorkspace.profileApplied":"agentWorkspace.profileNotApplied")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:d("agentWorkspace.latestProfileRevision")}),a.jsx("dd",{children:(t==null?void 0:t.profileRevision)??d("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:d("agentWorkspace.modelId")}),a.jsx("dd",{children:String(((m=e.model)==null?void 0:m.id)||d("agentWorkspace.notAvailable"))})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"ETag"}),a.jsx("dd",{children:(t==null?void 0:t.etag)||d("agentWorkspace.notAvailable")})]})]}),!f&&a.jsxs("div",{className:"aw-session-config-upgrade",role:"status",children:[a.jsx("span",{children:d("agentWorkspace.profileNotAppliedDescription")}),a.jsx("button",{type:"button",onClick:l,disabled:!h,children:d(r?"agentWorkspace.profileApplying":"agentWorkspace.applyProfile")})]}),f&&a.jsx("div",{className:"aw-session-config-actions",children:a.jsx("button",{type:"button",onClick:l,disabled:!h,children:d(r?"agentWorkspace.profileApplying":"agentWorkspace.reapplyProfile")})}),a.jsx("div",{className:"aw-session-config-card",children:a.jsxs("div",{children:[a.jsx("h4",{children:d("agentWorkspace.profilePrompt")}),a.jsx("p",{children:e.system||d("agentWorkspace.notAvailable")})]})}),a.jsxs("div",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:d("agentWorkspace.profileResources")}),a.jsx("p",{children:d("agentWorkspace.profileResourceSummary",{tools:e.tools.length,skills:e.skills.length,mcp:e.mcpServers.length})})]}),a.jsxs("div",{className:"aw-profile-config-list",children:[a.jsxs("span",{title:Hv(e.tools,d("agentWorkspace.notAvailable")),children:[d("agentSelector.tools"),": ",Hv(e.tools,d("agentWorkspace.notAvailable"))]}),a.jsxs("span",{title:Hv(e.skills,d("agentWorkspace.notAvailable")),children:[d("agentSelector.skills"),": ",Hv(e.skills,d("agentWorkspace.notAvailable"))]}),a.jsxs("span",{title:Hv(e.mcpServers,d("agentWorkspace.notAvailable")),children:["MCP: ",Hv(e.mcpServers,d("agentWorkspace.notAvailable"))]})]})]})]})]})}function oXt({config:e,profileStatus:t,loadable:n,disabledReason:i,loading:r,saving:s,upgrading:o,error:l,notice:c,modelValue:u,modelDirty:d,profileUpgradeAvailable:f,onModelChange:h,onSaveModel:m,onInheritModel:g,onClearMcp:b,onInheritMcp:v,onUpgradeProfile:y,onRefresh:w}){const{t:x}=Te("ui"),O=r||s||o,k=Poe(e,"model"),S=Poe(e,"mcpServers"),C=hx(e),E=(t==null?void 0:t.status)==="applied"?t.profileRevision:null;return a.jsxs("section",{className:"aw-session-config","aria-busy":O,children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:x("agentWorkspace.sessionConfigTitle")}),a.jsx("p",{children:x("agentWorkspace.sessionConfigDescription")})]}),n?r&&!e?a.jsxs("div",{className:"aw-session-config-state",role:"status",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsx("span",{children:x("agentWorkspace.loadingSessionConfig")})]}):a.jsxs(a.Fragment,{children:[l&&a.jsxs("div",{className:"aw-session-config-state is-error",role:"alert",children:[a.jsx("span",{children:l}),a.jsx("button",{type:"button",onClick:w,disabled:O,children:x("common.retry")})]}),c&&!l&&a.jsx("div",{className:"aw-session-config-notice",role:"status",children:c}),e&&a.jsxs(a.Fragment,{children:[a.jsxs("dl",{className:"aw-session-config-grid",children:[a.jsxs("div",{children:[a.jsx("dt",{children:x("agentWorkspace.sessionConfigRevision")}),a.jsx("dd",{children:e.revision})]}),a.jsxs("div",{children:[a.jsx("dt",{children:x("agentWorkspace.sessionProfileRevision")}),a.jsx("dd",{children:e.profileRevision})]}),a.jsxs("div",{children:[a.jsx("dt",{children:x("agentWorkspace.latestProfileRevision")}),a.jsx("dd",{children:E??x("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"ETag"}),a.jsx("dd",{children:e.etag||x("agentWorkspace.notAvailable")})]})]}),f&&E!=null&&a.jsxs("div",{className:"aw-session-config-upgrade",role:"status",children:[a.jsx("span",{children:x("agentWorkspace.sessionProfileUpgradeAvailable",{current:e.profileRevision,target:E})}),a.jsx("button",{type:"button",onClick:y,disabled:O,children:x(o?"agentWorkspace.sessionProfileUpgrading":"agentWorkspace.upgradeSessionProfile")})]}),a.jsxs("div",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:x("agentWorkspace.sessionModelOverride")}),a.jsx("p",{children:x(k?`agentWorkspace.executionConfigMode.${k}`:"agentWorkspace.executionConfigMode.inherit")})]}),a.jsxs("label",{className:"aw-session-config-field",children:[a.jsx("span",{children:x("agentWorkspace.modelId")}),a.jsx("input",{type:"text",value:u,onChange:j=>h(j.currentTarget.value),placeholder:C||x("agentWorkspace.inheritProfileDefault"),disabled:O})]}),a.jsxs("div",{className:"aw-session-config-actions",children:[a.jsx("button",{type:"button",onClick:m,disabled:O||!d,children:x(s?"common.saving":"common.save")}),a.jsx("button",{type:"button",onClick:g,disabled:O||!Moe(e,"model"),children:x("agentWorkspace.inheritProfileDefault")})]})]}),a.jsxs("div",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:x("agentWorkspace.sessionMcpServers")}),a.jsx("p",{children:x(S?`agentWorkspace.executionConfigMode.${S}`:"agentWorkspace.executionConfigMode.inherit")})]}),a.jsxs("div",{className:"aw-session-config-value",children:[a.jsx("span",{children:x("agentWorkspace.mcpServerCount",{count:ZGt(e)})}),a.jsx("small",{title:Doe(e,x),children:Doe(e,x)})]}),a.jsxs("div",{className:"aw-session-config-actions",children:[a.jsx("button",{type:"button",onClick:b,disabled:O||S==="clear",children:x("agentWorkspace.clearSessionMcp")}),a.jsx("button",{type:"button",onClick:v,disabled:O||!Moe(e,"mcpServers"),children:x("agentWorkspace.inheritProfileDefault")})]})]})]})]}):a.jsx("div",{className:"aw-session-config-state",children:i})]})}function Uoe(e,t){const n=e==null?void 0:e[t];return n==null||n===""?"":String(n)}function lXt(e,t){const n=e==null?void 0:e.worker;if(!n||typeof n!="object")return"";const i=n[t];return i==null||i===""?"":String(i)}function cXt(e,t){return typeof e!="number"||!Number.isFinite(e)?t("agentWorkspace.notAvailable"):`${Math.round(e)} ms`}function uXt({data:e,loadable:t,disabledReason:n,loading:i,error:r,onRefresh:s,locale:o}){const{t:l}=Te("ui"),c=(e==null?void 0:e.runs)??[],u=(e==null?void 0:e.trace)??null,d=c[0],f=(u==null?void 0:u.correlation)??{},h=[["mpaInstanceId",l("agentWorkspace.mpaInstanceId")],["profileRevision",l("agentWorkspace.sessionProfileRevision")],["executionConfigRevision",l("agentWorkspace.sessionConfigRevision")],["turnId",l("agentWorkspace.turnId")],["taskId",l("agentWorkspace.taskId")],["runtimeId","Runtime ID"],["runtimeVersion",l("systemInfo.currentVersion")]],m=[["kind",l("agentWorkspace.workerKind")],["sessionId",l("agentWorkspace.workerSession")],["turnId",l("agentWorkspace.workerTurn")],["profileId",l("agentWorkspace.workerProfile")],["profileVersion",l("agentWorkspace.workerProfileVersion")]];return a.jsxs("section",{className:"aw-mpa-diagnostics","aria-busy":i,children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:l("agentWorkspace.mpaDiagnosticsTitle")}),a.jsx("p",{children:l("agentWorkspace.mpaDiagnosticsDescription")})]}),t?i&&!e?a.jsxs("div",{className:"aw-session-config-state",role:"status",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsx("span",{children:l("agentWorkspace.loadingMpaDiagnostics")})]}):r?a.jsxs("div",{className:"aw-session-config-state is-error",role:"alert",children:[a.jsx("span",{children:r}),a.jsx("button",{type:"button",onClick:s,disabled:i,children:l("common.retry")})]}):d?a.jsxs(a.Fragment,{children:[a.jsxs("dl",{className:"aw-session-config-grid",children:[a.jsxs("div",{children:[a.jsx("dt",{children:l("agentWorkspace.latestRun")}),a.jsx("dd",{children:d.invocationId})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("agentSelector.status")}),a.jsx("dd",{children:d.status})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("agentWorkspace.lastUsed")}),a.jsx("dd",{children:JBe(d.startedAt,o,l)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("agentWorkspace.stepCount")}),a.jsx("dd",{children:d.stepCount})]})]}),a.jsxs("section",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:l("agentWorkspace.traceCorrelation")}),a.jsx("p",{children:l("agentWorkspace.traceCorrelationDescription")})]}),a.jsxs("dl",{className:"aw-mpa-correlation",children:[h.map(([g,b])=>a.jsxs("div",{children:[a.jsx("dt",{children:b}),a.jsx("dd",{children:Uoe(f,g)||l("agentWorkspace.notAvailable")})]},g)),m.map(([g,b])=>a.jsxs("div",{children:[a.jsx("dt",{children:b}),a.jsx("dd",{children:lXt(f,g)||l("agentWorkspace.notAvailable")})]},`worker-${g}`))]})]}),a.jsxs("section",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:l("agentWorkspace.traceSteps")}),a.jsx("p",{children:l("agentWorkspace.traceStepsDescription")})]}),u!=null&&u.steps.length?a.jsx("div",{className:"aw-usage-table-wrap",children:a.jsxs("table",{className:"aw-usage-table aw-mpa-trace-table",children:[a.jsx("caption",{children:l("agentWorkspace.traceSteps")}),a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:l("agentWorkspace.step")}),a.jsx("th",{scope:"col",children:l("agentSelector.status")}),a.jsx("th",{scope:"col",children:l("agentWorkspace.duration")}),a.jsx("th",{scope:"col",children:l("agentWorkspace.turnId")})]})}),a.jsx("tbody",{children:u.steps.slice(0,20).map(g=>a.jsxs("tr",{children:[a.jsxs("td",{children:[a.jsx("strong",{children:g.title||g.kind}),a.jsx("small",{children:g.kind})]}),a.jsx("td",{children:g.status}),a.jsx("td",{children:cXt(g.durationMs,l)}),a.jsx("td",{children:Uoe(g.correlation,"turnId")||l("agentWorkspace.notAvailable")})]},g.stepId))})]})}):a.jsx("div",{className:"aw-session-config-value",children:a.jsx("span",{children:l("agentWorkspace.noTraceSteps")})})]})]}):a.jsx("div",{className:"aw-session-config-state",children:l("agentWorkspace.noMpaDiagnostics")}):a.jsx("div",{className:"aw-session-config-state",children:n})]})}function dXt(e,t,n){var i;return fH({appName:((i=e==null?void 0:e.appName)==null?void 0:i.trim())||t,name:e==null?void 0:e.name,description:e==null?void 0:e.description,type:e==null?void 0:e.type,model:e==null?void 0:e.model,tools:e==null?void 0:e.tools,skills:e==null?void 0:e.skills,graph:e==null?void 0:e.graph,draft:e==null?void 0:e.draft},n)}function i9e(e){return e?1+e.children.reduce((t,n)=>t+i9e(n),0):1}function r9e(e){return 1+e.subAgents.reduce((t,n)=>t+r9e(n),0)}function K7(e){if(!e)return 0;const t=Number(e);if(Number.isFinite(t))return t<1e12?t*1e3:t;const n=Date.parse(e);return Number.isFinite(n)?n:0}function fXt(e,t,n){const i=K7(e);return i?new Intl.DateTimeFormat(t,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(i)):n("agentWorkspace.unknownTime")}function hXt(e,t){return typeof e.score!="number"||!Number.isFinite(e.score)?"—":t("agentWorkspace.scoreValue",{score:Math.round(e.score*100)})}function pXt(e,t){return t(`agentWorkspace.priority.${e}`)}const mXt={agent_structure:"agentWorkspace.modules.agentStructure",prompt:"agentWorkspace.modules.prompt",tool:"agentWorkspace.modules.tool",knowledge:"agentWorkspace.modules.knowledge",memory:"agentWorkspace.modules.memory",workflow:"agentWorkspace.modules.workflow",other:"agentWorkspace.modules.other"};function gXt(e,t){var n;return e.module==="other"?((n=e.customModule)==null?void 0:n.trim())||t("agentWorkspace.modules.other"):t(mXt[e.module])}function bXt(e,t){return e.find(n=>n.kind===t)}function Qoe(e,t){return e.items.map(n=>({...n,tag:t(n.kind==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")})).sort((n,i)=>K7(i.createdAt)-K7(n.createdAt))}function yXt(e){const t=n=>[n.name,n.description,n.agentType??"llm",n.modelName??"",n.tools??[],n.builtinTools??[],(n.customTools??[]).map(i=>i.name),(n.mcpTools??[]).map(i=>i.name),n.skills??[],(n.selectedSkills??[]).map(i=>i.name),(n.subAgents??[]).map(t)];return JSON.stringify(t(e))}function vXt(e){return[{phase:"prepare",label:e("agentWorkspace.deploymentSteps.prepare.label"),description:e("agentWorkspace.deploymentSteps.prepare.description")},{phase:"build",label:e("agentWorkspace.deploymentSteps.build.label"),description:e("agentWorkspace.deploymentSteps.build.description")},{phase:"deploy",label:e("agentWorkspace.deploymentSteps.deploy.label"),description:e("agentWorkspace.deploymentSteps.deploy.description")},{phase:"publish",label:e("agentWorkspace.deploymentSteps.publish.label"),description:e("agentWorkspace.deploymentSteps.publish.description")},{phase:"complete",label:e("agentWorkspace.deploymentSteps.complete.label"),description:e("agentWorkspace.deploymentSteps.complete.description")}]}function xXt(e,t){return{phase:"update",label:t("agentWorkspace.deploymentSteps.update.label"),description:t("agentWorkspace.deploymentSteps.update.description",e)}}function s9e(e,t){const n=vXt(t),i=[...n.slice(0,-1)];return e.instanceRange&&i.push(xXt(e.instanceRange,t)),e.createEvaluationSets&&i.push({phase:"evaluation",label:t("agentWorkspace.deploymentSteps.evaluation.label"),description:t("agentWorkspace.deploymentSteps.evaluation.description")}),e.mpaProfile&&(i.push({phase:"profile_applying",label:t("agentWorkspace.deploymentSteps.profileApplying.label"),description:t("agentWorkspace.deploymentSteps.profileApplying.description")}),e.mpaSmoke&&(i.push({phase:"smoke_running",label:t("agentWorkspace.deploymentSteps.smokeRunning.label"),description:t("agentWorkspace.deploymentSteps.smokeRunning.description")}),i.push({phase:"runnable",label:t("agentWorkspace.deploymentSteps.runnable.label"),description:t("agentWorkspace.deploymentSteps.runnable.description")}))),e.githubDelivery&&i.push({phase:"github",label:t("agentWorkspace.deploymentSteps.github.label"),description:t("agentWorkspace.deploymentSteps.github.description")}),i.push(n[n.length-1]),i}function a9e(e,t){const n=s9e(e,t);if(e.status==="success")return n.length-1;const i=e.phase??{准备部署:"prepare",构建镜像:"build",部署:"deploy",发布:"publish",创建评测集:"evaluation","应用 MPA Profile":"profile_applying","验证 MPA Runtime":"smoke_running","MPA Runtime 可运行":"runnable","挂载 GitHub 持续交付":"github",部署完成:"complete"}[e.label],r=n.findIndex(s=>s.phase===i);return r<0?0:r}function wXt(e,t){if(!e)return"";try{return new Intl.DateTimeFormat(t,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(new Date(e))}catch{return""}}function o9e({log:e,autoExpand:t,title:n,ariaLabel:i,copyLabel:r,defaultPendingMessage:s}){const{t:o,i18n:l}=Te("ui"),c=p.useRef(null),u=!!((e==null?void 0:e.status)!=="complete"&&t),[d,f]=p.useState(u),[h,m]=p.useState(!1),g=!!(e!=null&&e.text||e!=null&&e.error),b=(e==null?void 0:e.text)||(e==null?void 0:e.error)||"",v=b.split(` `),y=d?b:v.slice(-36).join(` -`),w=(e==null?void 0:e.pendingMessage)||s;if(p.useEffect(()=>{e&&f(u)},[e==null?void 0:e.status,u]),p.useEffect(()=>{if(!d||!g)return;const E=c.current;E&&(E.scrollTop=E.scrollHeight)},[d,g,y]),!e||!e.text&&e.status!=="error"&&!e.pendingMessage)return null;const x=wXt(e.updatedAt,l.resolvedLanguage??l.language),O=e.status==="complete"?o("agentWorkspace.logStatus.synced"):e.status==="error"?o("agentWorkspace.logStatus.failed"):o("agentWorkspace.logStatus.syncing"),k=e.omittedEarly?o("agentWorkspace.logStatus.earlyOmitted"):e.snapshotTruncated?o("agentWorkspace.logStatus.recentOnly"):e.truncated?o("agentWorkspace.logStatus.partiallyOmitted"):"",S=[O,e.lineCount?o("agentWorkspace.logLines",{count:e.lineCount}):"",k,x].filter(Boolean).join(" · ");async function C(){try{await navigator.clipboard.writeText(b),m(!0),window.setTimeout(()=>m(!1),1500)}catch{m(!1)}}return a.jsxs("section",{className:`aw-deploy-log is-${e.status}${d?"":" is-collapsed"}`,"aria-label":i,children:[a.jsxs("header",{children:[a.jsxs("div",{children:[a.jsx("strong",{children:n}),a.jsx("span",{children:S})]}),a.jsxs("div",{className:"aw-deploy-log-actions",children:[g&&a.jsx("button",{type:"button",onClick:()=>f(E=>!E),children:o(d?"common.collapse":"common.expand")}),g&&a.jsxs("button",{type:"button",onClick:()=>void C(),"aria-label":h?o("agentWorkspace.copiedLabel",{label:r}):o("agentWorkspace.copyLabel",{label:r}),title:h?o("agentWorkspace.copied"):o("agentWorkspace.copyLabel",{label:r}),children:[h?a.jsx(Cf,{"aria-hidden":!0}):a.jsx(JD,{"aria-hidden":!0}),a.jsx("span",{children:o(h?"agentWorkspace.copied":"agentWorkspace.copy")})]})]})]}),d&&(g?a.jsx("pre",{ref:c,children:y}):a.jsx("div",{className:"aw-deploy-log-empty",children:w}))]})}function OXt({task:e}){var n;const{t}=Te("ui");return a.jsx(o9e,{log:e.buildLog,autoExpand:((n=e.buildLog)==null?void 0:n.status)!=="complete"&&(e.status==="running"||e.status==="error")&&a9e(e,t)===1,title:t("agentWorkspace.buildLog"),ariaLabel:t("agentWorkspace.buildLog"),copyLabel:t("agentWorkspace.buildLog"),defaultPendingMessage:t("agentWorkspace.waitingBuildLog")})}function kXt({task:e}){var n;const{t}=Te("ui");return a.jsx(o9e,{log:e.githubLog,autoExpand:((n=e.githubLog)==null?void 0:n.status)!=="complete"&&(e.status==="running"||e.status==="error")&&e.phase==="github",title:t("agentWorkspace.githubMountLog"),ariaLabel:t("agentWorkspace.githubDeliveryMountLog"),copyLabel:t("agentWorkspace.githubMountLog"),defaultPendingMessage:t("agentWorkspace.waitingGithubMountLog")})}function SXt({task:e,onReturnToEdit:t}){const{t:n}=Te("ui"),[i,r]=p.useState(!1),s=s9e(e,n),o=a9e(e,n),l=e.status==="success"?100:Math.max(6,Math.min(100,e.pct??6)),c=e.status==="running"&&e.statusUnconfirmed?n("agentWorkspace.deployStatus.unconfirmed"):e.status==="running"?n("agentWorkspace.deployStatus.running"):e.status==="success"?n("agentWorkspace.deployStatus.success"):e.status==="error"?n("agentWorkspace.deployStatus.error"):n("agentWorkspace.deployStatus.cancelled"),u=()=>{i||!e.retry||(r(!0),e.retry().catch(()=>{}).finally(()=>r(!1)))};return a.jsxs("section",{className:`aw-deploy-progress-card is-${e.status}`,"aria-live":"polite",children:[a.jsxs("div",{className:"aw-deploy-progress-head",children:[a.jsxs("div",{children:[a.jsx("span",{className:"aw-deploy-progress-icon","aria-hidden":!0,children:e.status==="running"&&e.statusUnconfirmed?a.jsx(mN,{}):e.status==="running"?a.jsx(Bi,{className:"spin"}):e.status==="success"?a.jsx(Cat,{}):e.status==="error"?a.jsx(mN,{}):a.jsx(oB,{})}),a.jsxs("div",{children:[a.jsx("h3",{children:c}),a.jsx("p",{children:e.runtimeName})]})]}),a.jsx("strong",{children:e.status==="running"&&!e.statusUnconfirmed?`${Math.round(l)}%`:e.label})]}),a.jsx("div",{className:"aw-deploy-progress-track",role:"progressbar","aria-label":n("agentWorkspace.deploymentProgress"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(l),children:a.jsx("span",{style:{width:`${l}%`}})}),a.jsx("ol",{className:"aw-deploy-steps",children:s.map((d,f)=>{const h=e.status==="success"||fnew Set),[or,Pn]=p.useState(()=>new Set),[ei,Fn]=p.useState(!1),[Si,Qn]=p.useState(""),[Rn,ui]=p.useState(null),[rt,zt]=p.useState([]),[Ue,bt]=p.useState([]),[Ht,_n]=p.useState(!1),[Nr,qs]=p.useState(""),[Ws,Lr]=p.useState(""),[ti,Ei]=p.useState(0),[es,ts]=p.useState([]),[ba,go]=p.useState(!1),[fs,he]=p.useState(""),[gr,bo]=p.useState(0),[to,fl]=p.useState(null),[no,ks]=p.useState(1),[Ks,Ti]=p.useState(!1),[rr,Ds]=p.useState(""),[Ml,hl]=p.useState(0),[br,$r]=p.useState(null),[pl,Lo]=p.useState(null),[Rr,$o]=p.useState(null),[ns,ya]=p.useState(!1),[Mi,Ms]=p.useState(""),[Vr,hs]=p.useState(null),[ml,ia]=p.useState(!1),[gi,Ll]=p.useState(""),[Fo,Gs]=p.useState(0),[gl,Bo]=p.useState(""),[Ma,bl]=p.useState(!1),[Bu,Uo]=p.useState(!1),[mc,Md]=p.useState(!1),[Ld,yo]=p.useState(""),[$d,yl]=p.useState(""),[$l,La]=p.useState(0),[Qo,zo]=p.useState({saving:!1,error:"",notice:""}),[Uu,vl]=p.useState(!1),[Fl,Ls]=p.useState(()=>new Set),[$a,sn]=p.useState(!1),[Bl,Ss]=p.useState(""),[is,rs]=p.useState(""),[Fd,Ul]=p.useState(()=>new Set),Vo=p.useRef(!1),Ql=p.useRef(""),Kc=p.useRef(null),vo=p.useRef(0),ra=p.useRef(0),io=p.useRef(0),Re=p.useRef(0),[ot,$t]=p.useState(HGt),[Dn,On]=p.useState("");p.useEffect(()=>{e.length!==0&&$t(ce=>ce.map((Le,Ke)=>Ke===0&&Le.agentIds.length===0?{...Le,agentIds:e.slice(0,2).map(pt=>pt.id)}:Le))},[e]);const mn=p.useMemo(()=>{const ce=new Map;for(const Le of e)Le.runtimeId&&ce.set(Le.runtimeId,Le);return ce},[e]),jn=p.useMemo(()=>{var Le;const ce=new Map;for(const Ke of t){const pt=(Le=Ke.deploymentTarget)==null?void 0:Le.runtimeId;if(!pt||!mn.has(pt))continue;const dn=ce.get(pt);(!dn||Ke.updatedAt>dn.updatedAt)&&ce.set(pt,Ke)}return ce},[mn,t]),Wt=p.useMemo(()=>{const ce=new Map;for(const Le of f){if(!Le.runtimeId)continue;const Ke=ce.get(Le.runtimeId);(!Ke||Le.startedAt>Ke.startedAt)&&ce.set(Le.runtimeId,Le)}return ce},[f]),bn=p.useMemo(()=>{const ce=et.trim().toLowerCase();return ce?e.filter(Le=>{const Ke=Le.runtimeId?jn.get(Le.runtimeId):void 0,pt=Le.runtimeId?Wt.get(Le.runtimeId):void 0;return[Le.label,Le.app,Le.host??"",(Ke==null?void 0:Ke.draft.name)??"",(Ke==null?void 0:Ke.draft.description)??"",(pt==null?void 0:pt.runtimeName)??""].join(" ").toLowerCase().includes(ce)}):e},[e,Wt,et,jn]),Mn=p.useMemo(()=>{const ce=et.trim().toLowerCase();return t.filter(Le=>{var pt;const Ke=(pt=Le.deploymentTarget)==null?void 0:pt.runtimeId;return Ke&&mn.has(Ke)?!1:ce?`${Le.draft.name} ${Le.draft.description}`.toLowerCase().includes(ce):!0})},[mn,t,et]),ai=p.useMemo(()=>t.filter(ce=>{var Ke;const Le=(Ke=ce.deploymentTarget)==null?void 0:Ke.runtimeId;return!Le||!mn.has(Le)}).length,[mn,t]),ss=p.useMemo(()=>{const ce=et.trim().toLowerCase();return ce?ot.filter(Le=>Le.name.toLowerCase().includes(ce)):ot},[ot,et]),re=e.find(ce=>ce.id===U),zn=t.find(ce=>ce.id===V),bi=h?f.find(ce=>ce.id===h):void 0,Fa=re!=null&&re.runtimeId?jn.get(re.runtimeId):void 0,oe=x?vt:U&&r===U?i:null,$e=(oe==null?void 0:oe.appName)||(re==null?void 0:re.runtimeApp)||(re==null?void 0:re.app)||"",st=(re==null?void 0:re.agentCategory)??"general",Ye=(ne==null?void 0:ne.runtimeId)===(re==null?void 0:re.runtimeId)?ne:null,de=Ye==null?void 0:Ye.mpaInstanceId,Fe=(re==null?void 0:re.mpaInstanceId)??de??(re==null?void 0:re.runtimeId)??"",ct=WGt.filter(ce=>ce==="profileConfig"?st==="mpa":ce==="usage"?c&&(re==null?void 0:re.runtimeId):ce==="sessionConfig"?st==="mpa":ce==="diagnostics"?st==="mpa"&&(re==null?void 0:re.runtimeId):!0).map(ce=>({id:ce,label:_(`agentWorkspace.sections.${ce}`)})),Lt=JSON.stringify([(re==null?void 0:re.runtimeId)??"",(re==null?void 0:re.region)??"cn-beijing",$e,no]),ln=(to==null?void 0:to.requestKey)===Lt?to.value:null,yr=`${(re==null?void 0:re.region)??"cn-beijing"}:${(re==null?void 0:re.runtimeId)??""}`,Jt=JSON.stringify([(re==null?void 0:re.runtimeId)??"",Fe,(re==null?void 0:re.region)??"cn-beijing",y]),pi=JSON.stringify([(re==null?void 0:re.runtimeId)??"",Fe,(re==null?void 0:re.region)??"cn-beijing"]),Vt=pi,yi=JSON.stringify([(re==null?void 0:re.runtimeId)??"",(re==null?void 0:re.region)??"cn-beijing",y]),Ln=(ke==null?void 0:ke.requestKey)===yr?ke.value:"",Xn=(G==null?void 0:G.requestKey)===yr?G:null,mi=(br==null?void 0:br.requestKey)===Jt&&y?br.value:null,lr=(Rr==null?void 0:Rr.requestKey)===pi?Rr.value:null,cr=(pl==null?void 0:pl.requestKey)===Vt?pl.value:(lr==null?void 0:lr.profile)??null,pr=(lr==null?void 0:lr.bindingStatus)??"",ro=XGt((di=lr==null?void 0:lr.safeError)==null?void 0:di.code,_),Sm=(lr==null?void 0:lr.capabilities.canWrite)===!0,lv=(Vr==null?void 0:Vr.requestKey)===yi?Vr:null,cv=!!(re!=null&&re.runtimeId&&st==="mpa"&&pr!=="runtime_missing"&&pr!=="binding_ambiguous"),Mh=!!((re==null?void 0:re.agentCategory)==="mpa"&&(re!=null&&re.runtimeId)&&(re==null?void 0:re.runtimeId)===w&&pr==="bound"&&y),Df=(cr==null?void 0:cr.status)==="applied"?cr.profileRevision:null,uv=!!(Mh&&mi&&Df!=null&&Df>mi.profileRevision),Ir=dx(mi),xl=gl.trim()!==Ir,xo=!!((u2=Xn==null?void 0:Xn.apiApps)!=null&&u2.length),Qu=!!(Xn!=null&&Xn.a2a),wl=((bc=Xn==null?void 0:Xn.apiApps)==null?void 0:bc[0])??$e,zu=(ne==null?void 0:ne.endpoint)??"",Lh=eXt(((bv=Xn==null?void 0:Xn.a2a)==null?void 0:bv.endpoint)??"",zu),zl=(re==null?void 0:re.runtimeApp)||"",Vu=JSON.stringify([(re==null?void 0:re.runtimeId)??"",(re==null?void 0:re.region)??"",(re==null?void 0:re.currentVersion)??null,zl]),Ol=l&&(re!=null&&re.runtimeId)&&re.region&&He===0?H8({runtimeId:re.runtimeId,region:re.region,appName:zl,currentVersion:re.currentVersion}):null,Pi=(Ve==null?void 0:Ve.requestKey)===Vu?Ve.value:Ol,Nt=Pi!=null&&Pi.reason?Eo(Pi.reason,L.resolvedLanguage||L.language):"",gc=(Pi==null?void 0:Pi.warnings.filter(ce=>Eo(ce,L.resolvedLanguage||L.language)))??[],Vi=st!=="mpa";p.useEffect(()=>{const ce=vo.current+1;vo.current=ce,Be(null),Et("");const Le=(re==null?void 0:re.runtimeId)??"",Ke=(re==null?void 0:re.region)??"";if(!Vi||!l||!Le||!Ke){Pt(!1);return}const pt=He===0?H8({runtimeId:Le,region:Ke,appName:zl,currentVersion:re==null?void 0:re.currentVersion}):null;if(pt){Be({requestKey:Vu,value:pt}),Pt(!1);return}const dn=new AbortController;let Ze,En=0;const qr=60;Pt(!0);const Di=va=>{ID({runtimeId:Le,region:Ke,appName:zl,currentVersion:re==null?void 0:re.currentVersion,signal:dn.signal,force:va&&He>0}).then(aa=>{var zh,PO;if(ce!==vo.current)return;const zd=aa.recoveryStatus==="preparing";if(aa.runtime.runtimeId!==Le||aa.runtime.region!==Ke||!zd&&zl&&((zh=aa.agent)==null?void 0:zh.appName)!==zl||aa.canUpdate&&!((PO=aa.agent)!=null&&PO.appName)){Et(_("agentWorkspace.errors.updateCapabilityMismatch"));return}if(Be({requestKey:Vu,value:aa}),Pt(!1),!!zd){if(En+=1,En>=qr){Et(_("agentWorkspace.errors.updateConfigRestoring"));return}Ze=window.setTimeout(()=>Di(!1),1e3)}}).catch(()=>{ce!==vo.current||dn.signal.aborted||Et(_("agentWorkspace.errors.checkUpdateCapability"))}).finally(()=>{ce===vo.current&&!dn.signal.aborted&&Pt(!1)})};return Di(!0),()=>{dn.abort(),Ze!=null&&window.clearTimeout(Ze)}},[l,zl,He,re==null?void 0:re.currentVersion,re==null?void 0:re.region,re==null?void 0:re.runtimeId,Vi,Vu]);const Hr=p.useMemo(()=>{const ce=new Map(e.map((Ke,pt)=>[Ke.id,pt])),Le=new Map(n.map((Ke,pt)=>[Ke,pt]));return[...bn].sort((Ke,pt)=>{const dn=Ke.runtimeId?Wt.get(Ke.runtimeId):void 0,Ze=pt.runtimeId?Wt.get(pt.runtimeId):void 0,En=(dn==null?void 0:dn.status)==="running"?dn.startedAt:0,qr=(Ze==null?void 0:Ze.status)==="running"?Ze.startedAt:0;if(En!==qr)return qr-En;const Di=Le.get(Ke.id),va=Le.get(pt.id);return Di!=null&&va!=null?Di-va:Di!=null?-1:va!=null?1:(ce.get(Ke.id)??0)-(ce.get(pt.id)??0)})},[n,e,bn,Wt]),Bn=(re==null?void 0:re.label)||(oe==null?void 0:oe.name)||(zn==null?void 0:zn.draft.name)||(bi==null?void 0:bi.agentName)||((Qd=bi==null?void 0:bi.agentDraft)==null?void 0:Qd.name)||_("agentWorkspace.noAgentSelected"),$h=ot.find(ce=>ce.id===Dn),CO=Hr.filter(ce=>ce.canDelete===!0),Fh=Hr.filter(ce=>zi.has(ce.id)&&ce.canDelete===!0),dv=Mn.filter(ce=>or.has(ce.id)),Hu=CO.length+Mn.length,fv=Fh.length+dv.length,$s=p.useMemo(()=>{var Le;if(bi!=null&&bi.agentDraft)return bi.agentDraft;if(zn!=null&&zn.draft)return zn.draft;const ce=(Le=re==null?void 0:re.region)!=null&&Le.startsWith("ap-")?"byteplus":"volcengine";return Pi!=null&&Pi.agent&&(Pi.recoveryStatus==="complete"||Pi.recoveryStatus==="draft-only")?fH(Pi.agent,ce,Pi.runtime.configuredEnvKeys):dXt(oe,$e||(re==null?void 0:re.label)||"agent",ce)},[oe,$e,re==null?void 0:re.label,re==null?void 0:re.region,zn==null?void 0:zn.draft,bi==null?void 0:bi.agentDraft,Pi]),qu=((IO=oe==null?void 0:oe.draft)==null?void 0:IO.harnessSidecar)??lmt(ne==null?void 0:ne.envs),Wn=qu?X1.filter(ce=>qu.componentOverrides[ce]):[],KT=p.useMemo(()=>PA($s),[$s]),Bh=zn?o?"":_("agentWorkspace.errors.noCreatePermission"):st==="mpa"?"":l?re!=null&&re.runtimeId?re.region?_t?_("agentWorkspace.errors.checkingUpdateConfig"):Kt||(Pi?Pi.recoveryStatus!=="complete"&&Pi.recoveryStatus!=="draft-only"?Nt||_("agentWorkspace.errors.originalConfigUnavailable"):Pi.canUpdate?(sa=Pi.agent)!=null&&sa.appName?"":_("agentWorkspace.errors.agentInfoMissing"):Nt||_("agentWorkspace.errors.updateUnsupported"):_("agentWorkspace.errors.updateCapabilityPending")):_("agentWorkspace.errors.runtimeRegionMissing"):_("agentWorkspace.errors.cloudOnlyUpdate"):_("agentWorkspace.errors.noManagePermission"),AO="aw-update-disabled-reason",TO=re?st!=="mpa"?_("agentWorkspace.sessionConfigNonMpa"):ns?_("agentWorkspace.loadingMpaAgentView"):Mi||ro||(pr==="runtime_missing"?_("agentWorkspace.mpaRuntimeMissing"):pr==="binding_ambiguous"?_("agentWorkspace.mpaRuntimeBindingAmbiguous"):pr&&!cv?_("agentWorkspace.mpaRuntimeMissing"):Sm?"":_("agentWorkspace.errors.noManagePermission")):_("agentWorkspace.sessionConfigNoAgent"),GT=re?st!=="mpa"?_("agentWorkspace.sessionConfigNonMpa"):ns?_("agentWorkspace.loadingMpaAgentView"):Mi||ro||(pr==="runtime_missing"?_("agentWorkspace.mpaRuntimeMissing"):pr==="binding_ambiguous"?_("agentWorkspace.mpaRuntimeBindingAmbiguous"):pr==="orphan_runtime"?_("agentWorkspace.mpaRuntimeOrphan"):y?re.runtimeId!==w?_("agentWorkspace.sessionConfigDifferentRuntime"):"":_("agentWorkspace.sessionConfigNoSession")):_("agentWorkspace.sessionConfigNoAgent"),Mb=re?st!=="mpa"?_("agentWorkspace.sessionConfigNonMpa"):ns?_("agentWorkspace.loadingMpaAgentView"):Mi||(pr!=="bound"?GT:y?re.runtimeId!==w?_("agentWorkspace.sessionConfigDifferentRuntime"):"":_("agentWorkspace.sessionConfigNoSession")):_("agentWorkspace.sessionConfigNoAgent"),XT=p.useMemo(()=>{if(oe)return oe.tools;const ce=($s.builtinTools??[]).map(Le=>{var Ke;return((Ke=JA.find(pt=>pt.id===Le))==null?void 0:Ke.label)??Le});return Array.from(new Set([...$s.tools,...ce,...($s.customTools??[]).map(Le=>Le.name),...($s.mcpTools??[]).map(Le=>Le.name)].filter(Boolean)))},[$s,oe]),Uh=p.useMemo(()=>oe?oe.skillsPreviewSupported?oe.skills.map(ce=>ce.name):null:Array.from(new Set([...($s.selectedSkills??[]).map(ce=>ce.name),...$s.skills].filter(Boolean))),[$s,oe]),Pr=p.useMemo(()=>{if(bi)return bi;if(zn){const ce=f.filter(Le=>Le.draftId===zn.id).sort((Le,Ke)=>Ke.startedAt-Le.startedAt)[0];return ce||f.filter(Le=>{var Ke,pt;return((Ke=Le.agentDraft)==null?void 0:Ke.name)===zn.draft.name||Le.agentName===zn.draft.name||!!((pt=zn.deploymentTarget)!=null&&pt.runtimeId)&&Le.runtimeId===zn.deploymentTarget.runtimeId}).sort((Le,Ke)=>Ke.startedAt-Le.startedAt)[0]}if(re)return f.filter(ce=>!!re.runtimeId&&ce.runtimeId===re.runtimeId||ce.agentName===re.label).sort((ce,Le)=>Le.startedAt-ce.startedAt)[0]},[f,re,zn,bi]),HL=!!(h&&Pr&&Pr.id===h),YT=!!(Pr&&(Pr.status!=="success"||HL)),Em=(Pr==null?void 0:Pr.status)==="running",Bd=Pr!=null&&Pr.draftId?t.find(ce=>ce.id===Pr.draftId)??(Pr.agentDraft?{id:Pr.draftId,draft:Pr.agentDraft,updatedAt:Pr.startedAt}:void 0):void 0,Cm=p.useMemo(()=>yXt($s),[$s]),wo=(re==null?void 0:re.currentVersion)??(ne==null?void 0:ne.currentVersion)??null,qL=wo??(bi==null?void 0:bi.startedAt)??"unknown",Mf=oe?`runtime:${(re==null?void 0:re.runtimeId)??oe.name}:v${qL}:${Cm}`:`draft:${(bi==null?void 0:bi.id)??(zn==null?void 0:zn.id)??(re==null?void 0:re.id)??Bn}:${Cm}`;p.useEffect(()=>{let ce=!1;const Le=(re==null?void 0:re.runtimeId)??"",Ke=Fe||Le,pt=(re==null?void 0:re.region)??"cn-beijing",dn=pi;if(Ms(""),st!=="mpa"||!Le){$o(null),ya(!1);return}const Ze=new AbortController;return ya(!0),ETe({mpaInstanceId:Ke,runtimeId:Le,region:pt,signal:Ze.signal}).then(En=>{ce||($o({requestKey:dn,value:En}),Lo(En.profile?{requestKey:Vt,value:En.profile}:null))}).catch(En=>{ce||Ze.signal.aborted||($o(null),Ms(En instanceof Error?En.message:_("agentWorkspace.errors.loadMpaAgentView")))}).finally(()=>{ce||ya(!1)}),()=>{ce=!0,Ze.abort()}},[He,pi,Fe,re==null?void 0:re.region,re==null?void 0:re.runtimeId,st,Vt,_]),p.useEffect(()=>{z==="usage"&&!c&&q("basic")},[c,z]),p.useEffect(()=>{z==="sessionConfig"&&(!(re!=null&&re.runtimeId)||st!=="mpa")&&q("basic")},[z,re==null?void 0:re.runtimeId,st]),p.useEffect(()=>{z==="diagnostics"&&(!(re!=null&&re.runtimeId)||st!=="mpa")&&q("basic")},[z,re==null?void 0:re.runtimeId,st]),p.useEffect(()=>{if(!h)return;const ce=f.find(Ke=>Ke.id===h),Le=ce!=null&&ce.runtimeId?mn.get(ce.runtimeId):void 0;if(Le){Z(""),J(Le.id),q("basic");return}J(""),Z(""),q("basic")},[mn,f,h]),p.useEffect(()=>{if(!m){Ql.current="";return}const ce=`${m}:${g}:${b}:${c}`;Ql.current!==ce&&e.some(Le=>Le.id===m)&&(Ql.current=ce,Z(""),J(m),q(g==="usage"&&!c?"basic":g),g==="evaluations"&&(Ct(b),Gt("")))},[e,c,m,g,b]),p.useEffect(()=>{for(const ce of Hr.slice(0,8)){if(!ce.runtimeId)continue;const Le=ce.region??"cn-beijing";A2e(ce.runtimeId,Le),vTe(ce.runtimeId,Le,ce.runtimeApp??"")}},[Hr]),p.useEffect(()=>{let ce=!1;const Le=(re==null?void 0:re.runtimeId)??"",Ke=(re==null?void 0:re.region)??"cn-beijing",pt=(re==null?void 0:re.runtimeApp)??"",dn=Le?yTe(Le,Ke,pt):null;if(tt(dn),jt(""),wn(!1),Ne(!!dn||!x||!Le),!(!x||!Le))return Cz(Le,Ke,pt,{force:!0}).then(Ze=>{ce||tt(Ze)}).catch(Ze=>{!ce&&!dn&&tt(null),ce||(wn(Ze instanceof Sa&&Ze.unsupported),jt(_("agentWorkspace.errors.loadAgentInfo")))}).finally(()=>{ce||Ne(!0)}),()=>{ce=!0}},[x,He,re==null?void 0:re.currentVersion,re==null?void 0:re.region,re==null?void 0:re.runtimeApp,re==null?void 0:re.runtimeId]),p.useEffect(()=>{let ce=!1;const Le=(re==null?void 0:re.runtimeId)??"",Ke=(re==null?void 0:re.region)??"cn-beijing";if(ts([]),he(""),z!=="optimizations"||!Le){go(!1);return}if(x&&!$e){go(!mt);return}return go(!0),rTe({runtimeId:Le,region:Ke,appName:$e}).then(pt=>{ce||ts(pt.groups)}).catch(()=>{ce||he(_("agentWorkspace.errors.loadOptimizations"))}).finally(()=>{ce||go(!1)}),()=>{ce=!0}},[mt,x,gr,z,$e,re==null?void 0:re.region,re==null?void 0:re.runtimeId]),p.useEffect(()=>{ks(1)},[re==null?void 0:re.runtimeId,$e]),p.useEffect(()=>{const ce=io.current+1;io.current=ce;const Le=(re==null?void 0:re.runtimeId)??"",Ke=(re==null?void 0:re.region)??"cn-beijing",pt=$e;if(Ds(""),z!=="usage"||!Le){Ti(!1);return}if(!pt){Ti(x&&!mt);return}const dn=new AbortController;return Ti(!0),h2e({runtimeId:Le,region:Ke,appName:pt,page:no,pageSize:KGt,signal:dn.signal}).then(Ze=>{if(ce===io.current){if(Ze.runtimeId!==Le||Ze.appName!==pt||Ze.page!==no){Ds(_("agentWorkspace.errors.usageMismatch"));return}fl({requestKey:Lt,value:Ze})}}).catch(()=>{ce!==io.current||dn.signal.aborted||Ds(_("agentWorkspace.errors.loadUsage"))}).finally(()=>{ce===io.current&&Ti(!1)}),()=>{dn.abort()}},[no,Ml,Lt,mt,x,z,$e,re==null?void 0:re.region,re==null?void 0:re.runtimeId]),p.useEffect(()=>{ra.current+=1,je(null),Ee(!1),_e(!1),le(""),pe("api-server")},[yr,z]),p.useEffect(()=>{const ce=(re==null?void 0:re.runtimeId)??"",Le=(re==null?void 0:re.region)??"cn-beijing",Ke=yi;if(Ll(""),z!=="diagnostics"||st!=="mpa"||pr!=="bound"||!ce||!y||ce!==w){ia(!1),z!=="diagnostics"&&hs(null);return}const pt=new AbortController;let dn=!1;return ia(!0),ATe({runtimeId:ce,region:Le,sessionId:y,signal:pt.signal}).then(async Ze=>{const En=Ze.runs[0],qr=En?await TTe({runtimeId:ce,region:Le,sessionId:y,invocationId:En.invocationId,signal:pt.signal}):null;return{runs:Ze.runs,trace:qr}}).then(Ze=>{dn||hs({requestKey:Ke,...Ze})}).catch(Ze=>{dn||pt.signal.aborted||(hs(null),Ll(Ze instanceof Error?Ze.message:_("agentWorkspace.errors.loadMpaDiagnostics")))}).finally(()=>{dn||ia(!1)}),()=>{dn=!0,pt.abort()}},[w,y,Fo,yi,z,re==null?void 0:re.region,re==null?void 0:re.runtimeId,st,pr,_]);function Ri(){ra.current+=1,je(null),Ee(!1),_e(!1),le("")}function so(ce){ce!==ue&&(Ri(),pe(ce))}async function ps(){if(Pe){Ri();return}const ce=(re==null?void 0:re.runtimeId)??"",Le=(re==null?void 0:re.region)??"cn-beijing";if(!ce)return;const Ke=ra.current+1;ra.current=Ke,_e(!0),le("");try{const pt=await k2e(ce,Le);if(Ke!==ra.current)return;je({requestKey:yr,value:pt}),Ee(!0)}catch(pt){if(Ke!==ra.current)return;je(null),Ee(!1),le(pt instanceof Error?pt.message:_("agentWorkspace.errors.loadApiKey"))}finally{Ke===ra.current&&_e(!1)}}p.useEffect(()=>{let ce=!1;const Le=(re==null?void 0:re.runtimeId)??"",Ke=(re==null?void 0:re.region)??"cn-beijing",pt=Le?C2e(Le,Ke):null;if(W(pt),kt(""),!!Le)return PD(Le,Ke,{force:!0}).then(dn=>{ce||W(dn)}).catch(()=>{!ce&&!pt&&W(null),ce||kt(_("agentWorkspace.errors.loadRuntimeDetails"))}),()=>{ce=!0}},[He,re==null?void 0:re.currentVersion,re==null?void 0:re.region,re==null?void 0:re.runtimeId]),p.useEffect(()=>{const ce=Re.current+1;if(Re.current=ce,yo(""),yl(""),Uo(!1),Md(!1),z!=="sessionConfig"||!Mh||!(re!=null&&re.runtimeId)){bl(!1),$r(null),Bo("");return}const Le=re.runtimeId,Ke=Fe||Le,pt=re.region??"cn-beijing",dn=Jt,Ze=new AbortController;return bl(!0),Promise.all([Rz({runtimeId:Le,region:pt,sessionId:y,signal:Ze.signal}),STe({runtimeId:Le,region:pt,mpaInstanceId:Ke,signal:Ze.signal}).catch(()=>null)]).then(([En,qr])=>{ce===Re.current&&($r({requestKey:dn,value:En}),Bo(dx(En)),Lo(qr?{requestKey:Vt,value:qr}:null))}).catch(En=>{ce!==Re.current||Ze.signal.aborted||(En==null?void 0:En.name)==="AbortError"||($r(null),Bo(""),yo(En instanceof Error?En.message:_("agentWorkspace.errors.loadSessionConfig")))}).finally(()=>{ce===Re.current&&!Ze.signal.aborted&&bl(!1)}),()=>{Ze.abort()}},[y,$l,Jt,Mh,z,Vt,Fe,re==null?void 0:re.region,re==null?void 0:re.runtimeId,_]),p.useEffect(()=>{let ce=!1;const Le=(re==null?void 0:re.runtimeId)??"";if(ye(""),z!=="versions"||!Le){qe(!1),Le||Oe(null);return}return qe(!0),uN(Le).then(Ke=>{ce||Oe(Ke)}).catch(()=>{ce||(Oe(null),ye(_("agentWorkspace.errors.loadGithubVersions")))}).finally(()=>{ce||qe(!1)}),()=>{ce=!0}},[z,re==null?void 0:re.currentVersion,re==null?void 0:re.runtimeId]),p.useEffect(()=>{let ce=!1;const Le=(re==null?void 0:re.runtimeId)??"",Ke=(re==null?void 0:re.region)??"cn-beijing",pt=`${Ke}:${Le}`;if(ie(""),z!=="integrations"||!Le){Y(!1),Le||H(null);return}Y(!0);const dn=Hw(Le,Ke,{retryProbe:!0}).catch(Ze=>{if(Ze instanceof Sa&&Ze.unsupported)return null;throw Ze});return Promise.all([dn,O2e(Le,Ke,{retryProbe:!0})]).then(([Ze,En])=>{ce||H({requestKey:pt,apiApps:Ze,a2a:En})}).catch(()=>{ce||(H(null),ie(_("agentWorkspace.errors.probeIntegration")))}).finally(()=>{ce||Y(!1)}),()=>{ce=!0}},[ee,z,re==null?void 0:re.currentVersion,re==null?void 0:re.region,re==null?void 0:re.runtimeId]),p.useEffect(()=>{let ce=!1;const Le=(re==null?void 0:re.runtimeId)??"",Ke=(re==null?void 0:re.region)??"cn-beijing",pt=Le&&$e?sTe({runtimeId:Le,region:Ke,appName:$e,pageSize:100}):null;if(zt(pt?Qoe(pt,_):[]),bt((pt==null?void 0:pt.sets)??[]),qs(""),Lr((pt==null?void 0:pt.unsupportedMessage)??""),z!=="evaluations"||!Le){_n(!1);return}if(x&&!$e){_n(!mt);return}return _n(!pt),TD({runtimeId:Le,region:Ke,appName:$e,pageSize:100},{force:!0}).then(dn=>{ce||(bt(dn.sets),zt(Qoe(dn,_)),Lr(dn.unsupportedMessage??""))}).catch(()=>{ce||(qs(_("agentWorkspace.errors.loadEvaluations")),Lr(""))}).finally(()=>{ce||_n(!1)}),()=>{ce=!0}},[mt,x,ti,z,$e,oe==null?void 0:oe.appName,re==null?void 0:re.region,re==null?void 0:re.runtimeId,_]);async function ZT(ce){const Le=(re==null?void 0:re.runtimeId)??"",Ke=ce.commitSha??"";if(!(!Le||!Ke||we)){Ae(Ke),ye("");try{await r2e({runtimeId:Le,targetCommitSha:Ke,region:re==null?void 0:re.region,agentCategory:st});const pt=await uN(Le);Oe(pt)}catch(pt){ye(pt instanceof Error?pt.message:_("agentWorkspace.errors.rollbackVersion"))}finally{Ae("")}}}function Lb(ce,Le){return!(ce instanceof ew)||ce.status!==412||!ce.currentState?!1:($r({requestKey:Jt,value:ce.currentState}),Bo(dx(ce.currentState)),yo(Le),!0)}async function JT(ce="replace"){if(!(re!=null&&re.runtimeId)||!mi)return;const Le=re.runtimeId,Ke=re.region??"cn-beijing",pt=gl.trim(),dn=ce==="inherit"?{category:"model",mode:ce}:pt?{category:"model",mode:ce,value:{id:pt}}:{category:"model",mode:"inherit"};Uo(!0),yo(""),yl("");try{const Ze=await B8({runtimeId:Le,region:Ke,sessionId:y,etag:mi.etag,changes:[dn]});$r({requestKey:Jt,value:Ze}),Bo(dx(Ze)),yl(_("agentWorkspace.sessionConfigSaved"))}catch(Ze){Lb(Ze,_("agentWorkspace.sessionConfigStale"))||yo(c6(Ze,_("agentWorkspace.sessionConfigStale")))}finally{Uo(!1)}}async function e2(ce){if(!(re!=null&&re.runtimeId)||!mi)return;const Le=re.runtimeId,Ke=re.region??"cn-beijing";Uo(!0),yo(""),yl("");try{const pt=await B8({runtimeId:Le,region:Ke,sessionId:y,etag:mi.etag,changes:[{category:"mcpServers",mode:ce}]});$r({requestKey:Jt,value:pt}),yl(_("agentWorkspace.sessionConfigSaved"))}catch(pt){Lb(pt,_("agentWorkspace.sessionConfigStale"))||yo(c6(pt,_("agentWorkspace.sessionConfigStale")))}finally{Uo(!1)}}async function t2(){if(!(re!=null&&re.runtimeId)||!mi||!Df)return;const ce=re.runtimeId,Le=re.region??"cn-beijing";Md(!0),yo(""),yl("");try{const Ke=await _Te({runtimeId:ce,region:Le,sessionId:y,etag:mi.etag,idempotencyKey:JGt(ce,y,Df),targetProfileRevision:Df});$r({requestKey:Jt,value:Ke}),Bo(dx(Ke)),yl(_("agentWorkspace.sessionProfileUpgraded"))}catch(Ke){Lb(Ke,_("agentWorkspace.sessionConfigStale"))||yo(c6(Ke,_("agentWorkspace.sessionProfileUpgradeFailed")))}finally{Md(!1)}}async function WL(){if(!(re!=null&&re.runtimeId))return;const ce=re.runtimeId,Le=re.region??"cn-beijing",Ke=Fe||ce,pt=(cr==null?void 0:cr.status)==="applied"?"update":"create",dn=(cr==null?void 0:cr.runtimeRevision)||(cr==null?void 0:cr.etag)||"",Ze=await sXt(ce,pt,KT);zo({saving:!0,error:"",notice:""});try{const En=await jz({operationKind:pt,runtimeId:ce,region:Le,mpaInstanceId:Ke,sourceProfileId:`studio-runtime:${ce}:${$e||"a2a-default"}`,targetKey:pt==="update"?Ke:`runtime:${Le}:${ce}`,runtimeRevision:pt==="update"?dn:void 0,draft:$s,idempotencyKey:Ze});zo({saving:!1,error:En.status==="succeeded"?"":En.safeErrorCode||_("agentWorkspace.profileApplyIncomplete"),notice:En.status==="succeeded"?_("agentWorkspace.profileAppliedNotice",{revision:En.profileRevision??_("agentWorkspace.notAvailable")}):""}),nt(qr=>qr+1),La(qr=>qr+1)}catch(En){zo({saving:!1,error:En instanceof Error?En.message:_("agentWorkspace.profileApplyFailed"),notice:""})}}function hv(){!(re!=null&&re.runtimeId)||st!=="mpa"||I==null||I({draft:$s,runtimeId:re.runtimeId,mpaInstanceId:Fe||re.runtimeId,name:Bn,region:re.region??"cn-beijing",appName:$e||"a2a-default",currentVersion:re.currentVersion??(ne==null?void 0:ne.currentVersion),runtimeRevision:(cr==null?void 0:cr.runtimeRevision)||(cr==null?void 0:cr.etag)||void 0})}p.useEffect(()=>{zo({saving:!1,error:"",notice:""})},[pi]),p.useEffect(()=>{const ce=new Set(rt.map(Le=>Le.id));Ls(Le=>{const Ke=new Set([...Le].filter(pt=>ce.has(pt)));return Ke.size===Le.size?Le:Ke}),Ul(Le=>{const Ke=new Set([...Le].filter(pt=>ce.has(pt)));return Ke.size===Le.size?Le:Ke}),is&&!ce.has(is)&&rs("")},[rt,is]),p.useEffect(()=>{vl(!1),Ls(new Set),Ul(new Set),Ss(""),rs("")},[re==null?void 0:re.runtimeId]),p.useEffect(()=>{const ce=new Set(Hr.filter(Le=>Le.canDelete===!0).map(Le=>Le.id));un(Le=>{const Ke=new Set([...Le].filter(pt=>ce.has(pt)));return Ke.size===Le.size?Le:Ke})},[Hr]),p.useEffect(()=>{const ce=new Set(Mn.map(Le=>Le.id));Pn(Le=>{const Ke=new Set([...Le].filter(pt=>ce.has(pt)));return Ke.size===Le.size?Le:Ke})},[Mn]);const Qh=p.useMemo(()=>!v||!(re!=null&&re.runtimeId)||v.runtimeId!==re.runtimeId||$e&&v.agentName&&v.agentName!==$e?null:{...v,tag:_(v.kind==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")},[v,re==null?void 0:re.runtimeId,$e,_]),n2=p.useMemo(()=>VGt(_),[_]),Ba=p.useMemo(()=>re!=null&&re.runtimeId?Qh?[Qh,...rt.filter(ce=>ce.id!==Qh.id&&(!ce.messageId||ce.messageId!==Qh.messageId))]:rt:n2,[n2,rt,Qh,re==null?void 0:re.runtimeId]),Nn=Ba.filter(ce=>{if(ce.kind!==St||(ce.source==="auto"?"auto":"user")!==Ge)return!1;const Ke=It.trim().toLowerCase();return Ke?[ce.input,ce.output,ce.referenceOutput,ce.comment,ce.tag??"",ce.sessionId,ce.messageId,ce.userId,ce.evaluationSetName].join(" ").toLowerCase().includes(Ke):!0}),_O=Nn.filter(ce=>Fl.has(ce.id)),i2=!!(re!=null&&re.runtimeId),r2=ce=>{Ct(ce),Gt(""),Ss("");const Le=Ba.find(Ke=>Ke.kind===ce);rs((Le==null?void 0:Le.id)??""),window.setTimeout(()=>{var Ke;(Ke=Kc.current)==null||Ke.scrollIntoView({behavior:"smooth",block:"start"})},0)},s2=ce=>{Ss(""),Ls(Le=>{const Ke=new Set(Le);return Ke.has(ce.id)?Ke.delete(ce.id):Ke.add(ce.id),Ke})},KL=()=>{Ss(""),Ls(new Set(Nn.map(ce=>ce.id)))},jO=()=>{Ss(""),Ls(new Set),vl(!1)},Ud=ce=>{Ul(Le=>{const Ke=new Set(Le);return Ke.has(ce)?Ke.delete(ce):Ke.add(ce),Ke})},a2=ce=>{rs(ce.id),Ss(""),!(!ce.sessionId||!ce.messageId)&&(R==null||R(ce))},pv=async ce=>{if(!(re!=null&&re.runtimeId)||!$e||$a||ce.length===0)return;const Le=ce.length===1?_("agentWorkspace.deleteOneCaseConfirm"):_("agentWorkspace.deleteCasesConfirm",{count:ce.length});if(!window.confirm(Le))return;const Ke=ce.map(dn=>dn.id),pt=new Set(Ke);sn(!0),Ss("");try{await lTe({runtimeId:re.runtimeId,region:re.region??"cn-beijing",appName:$e,itemIds:Ke});const dn=new Map;for(const Ze of ce)dn.set(Ze.kind,(dn.get(Ze.kind)??0)+1);zt(Ze=>Ze.filter(En=>!pt.has(En.id))),bt(Ze=>Ze.map(En=>({...En,itemCount:Math.max(0,En.itemCount-(dn.get(En.kind)??0))}))),Ls(Ze=>new Set([...Ze].filter(En=>!pt.has(En)))),Ul(Ze=>new Set([...Ze].filter(En=>!pt.has(En)))),is&&pt.has(is)&&rs(""),ce.length>1&&vl(!1),A==null||A(ce)}catch(dn){Ss(dn instanceof Error?dn.message:String(dn))}finally{sn(!1)}},o2=ce=>{$t(Le=>Le.map(Ke=>Ke.id===ce.id?ce:Ke))},l2=()=>{const ce=new Set(e.map(pt=>pt.id)),Le=n.filter(pt=>ce.has(pt)),Ke=new Set(Le);return[...Le,...e.filter(pt=>!Ke.has(pt.id)).map(pt=>pt.id)]},Am=(ce,Le,Ke)=>{if(!S||ce===Le)return;const pt=l2().filter(En=>En!==ce),dn=pt.indexOf(Le),Ze=dn<0?pt.length:Ke==="after"?dn+1:dn;pt.splice(Ze,0,ce),S(pt)},ms=(ce,Le)=>{if(!yt||yt===Le)return;const Ke=ce.currentTarget.getBoundingClientRect();cn(Le),on(ce.clientY>Ke.top+Ke.height/2?"after":"before")},c2=(ce,Le)=>{if(!S)return;const Ke=l2(),pt=Ke.indexOf(ce),dn=Math.max(0,Math.min(Ke.length-1,pt+Le));pt<0||pt===dn||(Ke.splice(pt,1),Ke.splice(dn,0,ce),S(Ke))},NO=ce=>{ce.canDelete===!0&&(Qn(""),un(Le=>{const Ke=new Set(Le);return Ke.has(ce.id)?Ke.delete(ce.id):Ke.add(ce.id),Ke}))},mv=ce=>{Qn(""),Pn(Le=>{const Ke=new Set(Le);return Ke.has(ce.id)?Ke.delete(ce.id):Ke.add(ce.id),Ke})},RO=()=>{Qn(""),un(new Set(CO.map(ce=>ce.id))),Pn(new Set(Mn.map(ce=>ce.id)))},GL=()=>{Qn(""),un(new Set),Pn(new Set),Sn(!1)},XL=()=>{if(fv===0||ei)return;const ce=Fh.length,Le=dv.length;if(ce===1&&Le===0){$b(Fh[0]);return}Qn(""),ui({kind:"selection",title:_(ce===1&&Le===0?"agentWorkspace.deleteAgentTitle":ce===0&&Le===1?"myAgents.deleteDraftTitle":"agentWorkspace.deleteSelectedTitle"),description:ce===1&&Le===0?_("agentWorkspace.deleteAgentDescription",{name:Fh[0].label}):ce===0&&Le===1?_("agentWorkspace.deleteDraftDescription",{name:dv[0].draft.name||_("agentSelector.unnamedAgent")}):_("agentWorkspace.deleteSelectionDescription",{count:fv,warning:ce>0?_("agentWorkspace.runtimeDeletionWarning",{count:ce}):_("agentWorkspace.draftDeletionWarning")}),confirmLabel:_(ce===0&&Le===1?"myAgents.deleteDraft":"agentWorkspace.deleteSelected"),agents:Fh,drafts:dv})},YL=async()=>{if(!(!Rn||ei)){Fn(!0),Qn("");try{if(Rn.kind==="selection"){const{agents:ce,drafts:Le}=Rn;if(ce.length>0){if(!C)throw new Error(_("agentWorkspace.errors.deleteDeployedUnsupported"));await C(ce)}Le.length>0&&(E==null||E(Le)),un(new Set),Pn(new Set),Sn(!1),ce.some(Ke=>Ke.id===U)&&J(""),Le.some(Ke=>Ke.id===V)&&Z("")}else if(Rn.kind==="agent"){if(!C)throw new Error(_("agentWorkspace.errors.deleteDeployedUnsupported"));await C([Rn.agent]),U===Rn.agent.id&&J("")}else{if(!E)throw new Error(_("agentWorkspace.errors.deleteDraftUnsupported"));E([Rn.draft]),V===Rn.draft.id&&Z("")}ui(null)}catch(ce){Qn(ce instanceof Error?ce.message:String(ce))}finally{Fn(!1)}}},$b=async ce=>{if(!C||ce.canDelete!==!0||ei)return;Qn("");let Le=null;if(ce.agentCategory==="mpa"){if(!ce.runtimeId||!ce.region){Qn(_("agentWorkspace.errors.loadMpaDeletePreview"));return}try{Le=await CTe({mpaInstanceId:ce.mpaInstanceId??ce.runtimeId,runtimeId:ce.runtimeId,region:ce.region})}catch(Ke){Qn(Ke instanceof Error?Ke.message:String(Ke));return}}ui({kind:"agent",title:_("agentWorkspace.deleteAgentTitle"),description:Le?a.jsx(YGt,{preview:Le,t:_}):_("agentWorkspace.deleteAgentDescription",{name:ce.label}),confirmLabel:_("agentWorkspace.deleteAgent"),canConfirm:Le?Le.canDelete:!0,agent:ce})},gv=ce=>{if(!E||ei)return;const Le=ce.draft.name||_("agentSelector.unnamedAgent");Qn(""),ui({kind:"draft",title:_("myAgents.deleteDraftTitle"),description:_("agentWorkspace.deleteDraftDescription",{name:Le}),confirmLabel:_("myAgents.deleteDraft"),draft:ce})},as=()=>{const ce=`eval-${Date.now()}`,Le={id:ce,name:_("agentWorkspace.newEvaluationGroupName",{count:ot.length+1}),agentIds:[],caseSet:"核心回归集",evaluator:"综合质量评估器",metrics:["回答质量"],concurrency:"4",history:[]};$t(Ke=>[Le,...Ke]),On(ce)},Tm=ce=>{o2({...ce,history:[{id:`run-${Date.now()}`,createdAt:_("agentWorkspace.evaluationDefaults.justNow"),score:86+ce.history.length%7,status:"completed"},...ce.history]})};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`aw-root${x?" is-detail-only":""}`,children:[a.jsxs("nav",{className:"aw-view-tabs","aria-label":_("agentWorkspace.workspace"),children:[a.jsx("button",{type:"button",className:F==="library"?"is-active":"","aria-pressed":F==="library",onClick:()=>{M("library"),ft("")},children:_("agentWorkspace.library")}),a.jsx("button",{type:"button",className:F==="evaluation"?"is-active":"","aria-pressed":F==="evaluation",onClick:()=>{M("evaluation"),ft("")},children:_("agentWorkspace.evaluation")})]}),a.jsxs("div",{className:"aw-workspace-frame",children:[a.jsxs("div",{className:"aw-workspace","aria-hidden":F==="evaluation"||void 0,ref:ce=>{ce==null||ce.toggleAttribute("inert",F==="evaluation")},children:[a.jsxs("aside",{className:"aw-sidebar","aria-label":_(F==="library"?"agentWorkspace.agentList":"agentWorkspace.evaluationGroupList"),children:[a.jsxs("label",{className:"aw-search",children:[a.jsx(dI,{"aria-hidden":!0}),a.jsx("input",{value:et,onChange:ce=>ft(ce.currentTarget.value),placeholder:_(F==="library"?"myAgents.searchAgents":"agentWorkspace.searchEvaluationGroups"),"aria-label":_(F==="library"?"myAgents.searchAgents":"agentWorkspace.searchEvaluationGroups")})]}),a.jsxs("button",{type:"button",className:"aw-create-card",onClick:F==="library"?N:as,disabled:F==="library"&&!o,children:[a.jsx(sc,{"aria-hidden":!0}),a.jsx("span",{children:_(F==="library"?"agentWorkspace.newAgent":"agentWorkspace.newEvaluationGroup")})]}),F==="library"&&(C||E)&&a.jsx("div",{className:`aw-selection-toolbar${kn?" is-active":""}`,children:kn?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"aw-selection-count",children:_("agentWorkspace.selectedCount",{count:fv})}),a.jsx("button",{type:"button",onClick:RO,disabled:Hu===0||ei,children:_("agentWorkspace.selectAll")}),a.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void XL(),disabled:fv===0||ei,children:_(ei?"common.deleting":"agentWorkspace.deleteSelected")}),a.jsx("button",{type:"button",onClick:GL,disabled:ei,children:_("common.cancel")})]}):a.jsx("button",{type:"button",onClick:()=>{Qn(""),Sn(!0)},disabled:Hu===0,children:_("common.select")})}),F==="library"&&Si&&a.jsx("div",{className:"aw-delete-error",role:"alert",children:Si}),a.jsx("div",{className:"aw-agent-list",children:F==="evaluation"?ss.length===0?a.jsx("div",{className:"aw-list-empty",children:_("agentWorkspace.noMatchingEvaluationGroups")}):ss.map(ce=>a.jsxs("button",{type:"button",className:`aw-agent-item${ce.id===Dn?" is-active":""}`,onClick:()=>On(ce.id),children:[a.jsxs("span",{className:"aw-agent-copy aw-eval-group-copy",children:[a.jsx("strong",{children:xS(ce.name,_)}),a.jsx("small",{children:_("agentWorkspace.groupStats",{agents:ce.agentIds.length,runs:ce.history.length})})]}),a.jsx(YS,{"aria-hidden":!0})]},ce.id)):u&&Hr.length===0&&Mn.length===0?a.jsx("div",{className:"aw-list-empty",children:_("agentWorkspace.loadingCloudAgents")}):d&&Hr.length===0&&Mn.length===0?a.jsxs("div",{className:"aw-list-empty aw-list-error",children:[a.jsx("span",{children:d}),k&&a.jsx("button",{type:"button",onClick:k,children:_("common.retry")})]}):Hr.length===0&&Mn.length===0?a.jsx("div",{className:"aw-list-empty",children:_("myAgents.noMatchingAgents")}):a.jsxs(a.Fragment,{children:[Mn.map(ce=>{const Ke=f.filter(dn=>dn.draftId===ce.id).sort((dn,Ze)=>Ze.startedAt-dn.startedAt)[0]??f.filter(dn=>{var Ze,En;return((Ze=dn.agentDraft)==null?void 0:Ze.name)===ce.draft.name||dn.agentName===ce.draft.name||!!((En=ce.deploymentTarget)!=null&&En.runtimeId)&&dn.runtimeId===ce.deploymentTarget.runtimeId}).sort((dn,Ze)=>Ze.startedAt-dn.startedAt)[0],pt=or.has(ce.id);return a.jsxs("button",{type:"button",className:["aw-agent-item",kn?"is-selecting":"",pt?"is-selected-for-delete":"",ce.id===V?"is-active":""].filter(Boolean).join(" "),"aria-pressed":kn?pt:void 0,onClick:()=>{if(kn){mv(ce);return}J(""),Z(ce.id),q("basic")},children:[kn&&a.jsx("span",{className:`aw-select-marker${pt?" is-checked":""}`,"aria-hidden":"true"}),a.jsxs("span",{className:"aw-agent-copy",children:[a.jsxs("span",{className:"aw-agent-name-row",children:[a.jsx("strong",{children:ce.draft.name||_("agentSelector.unnamedAgent")}),a.jsx("span",{className:`aw-draft-badge${(Ke==null?void 0:Ke.status)==="running"?" is-deploying":""}`,children:(Ke==null?void 0:Ke.status)==="running"?_("myAgents.deploying"):_("myAgents.draft")})]}),a.jsx("small",{children:ce.deploymentTarget?_("agentWorkspace.updatePending"):_("agentWorkspace.notPublished")})]}),a.jsx(YS,{"aria-hidden":!0})]},ce.id)}),Hr.map(ce=>{const Le=ce.runtimeId?Wt.get(ce.runtimeId):void 0,Ke=ce.runtimeId?jn.get(ce.runtimeId):void 0,pt=zi.has(ce.id),dn=ce.canDelete===!0,Ze=(Le==null?void 0:Le.status)==="running"?{label:_("myAgents.deploying"),className:" is-deploying"}:(Le==null?void 0:Le.status)==="error"?{label:_("agentWorkspace.failed"),className:" is-error"}:(Le==null?void 0:Le.status)==="cancelled"?{label:_("agentWorkspace.cancelled"),className:" is-muted"}:Ke?{label:_("agentWorkspace.updatePending"),className:""}:null,En=(Le==null?void 0:Le.status)==="running"?_("agentWorkspace.updatingDeployment"):Ke?_("agentWorkspace.updatePending"):ce.remote?ce.host||_("agentWorkspace.remoteAgent"):_("agentWorkspace.localAgent"),qr=["aw-agent-item","aw-agent-item--sortable",ce.id===U?"is-active":"",kn?"is-selecting":"",pt?"is-selected-for-delete":"",kn&&!dn?"is-selection-disabled":"",ce.id===yt?"is-dragging":"",ce.id===Qt&&ce.id!==yt?`is-drop-target is-drop-${Me}`:""].filter(Boolean).join(" ");return a.jsxs("button",{type:"button",draggable:!!S&&!kn,className:qr,"aria-pressed":kn?pt:void 0,"aria-keyshortcuts":S?"Alt+ArrowUp Alt+ArrowDown":void 0,onDragStart:Di=>{S&&(Vo.current=!0,nn(ce.id),Di.dataTransfer.effectAllowed="move",Di.dataTransfer.setData("text/plain",ce.id))},onDragEnter:Di=>{ms(Di,ce.id)},onDragOver:Di=>{!yt||yt===ce.id||(Di.preventDefault(),Di.dataTransfer.dropEffect="move",ms(Di,ce.id))},onDragLeave:Di=>{const va=Di.relatedTarget;va instanceof Node&&Di.currentTarget.contains(va)||Qt===ce.id&&cn("")},onDrop:Di=>{Di.preventDefault();const va=Di.dataTransfer.getData("text/plain")||yt;Am(va,ce.id,Me),nn(""),cn(""),on("before")},onDragEnd:()=>{nn(""),cn(""),on("before"),window.setTimeout(()=>{Vo.current=!1},0)},onKeyDown:Di=>{Di.altKey&&(Di.key==="ArrowUp"?(Di.preventDefault(),c2(ce.id,-1)):Di.key==="ArrowDown"&&(Di.preventDefault(),c2(ce.id,1)))},onClick:Di=>{if(kn){Di.preventDefault(),NO(ce);return}if(Vo.current){Di.preventDefault(),Vo.current=!1;return}Z(""),J(ce.id),q("basic"),j(ce.id)},children:[kn&&a.jsx("span",{className:`aw-select-marker${pt?" is-checked":""}`,"aria-hidden":"true"}),a.jsxs("span",{className:"aw-agent-copy",children:[a.jsxs("span",{className:"aw-agent-name-row",children:[a.jsx("strong",{children:ce.label}),ce.currentVersion!=null&&a.jsxs("span",{className:"aw-version-badge",children:["v",ce.currentVersion]}),Ze&&a.jsx("span",{className:`aw-draft-badge${Ze.className}`,children:Ze.label})]}),a.jsx("small",{children:En})]}),a.jsx(YS,{"aria-hidden":!0})]},ce.id)})]})}),a.jsx("div",{className:"aw-list-count",children:_("agentWorkspace.totalCount",{count:F==="library"?e.length+ai:ot.length})})]}),F==="evaluation"&&$h?a.jsx(_Xt,{group:$h,agents:e,cases:Ba,onChange:o2,onRun:Tm}):F==="evaluation"?a.jsx("main",{className:"aw-main aw-empty-selection",children:a.jsx("p",{children:_("agentWorkspace.noEvaluationGroupSelected")})}):!re&&!zn&&!bi?a.jsx("main",{className:"aw-main aw-empty-selection",children:a.jsx("p",{children:_("agentWorkspace.noAgentSelected")})}):a.jsxs("main",{className:`aw-main${Em?" is-deploying":""}${x?" resource-page":""}`,children:[re&&!oe&&s&&a.jsx("div",{className:"aw-detail-loading",role:"status","aria-live":"polite",children:a.jsxs("div",{className:"aw-detail-loading-card",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsxs("span",{children:[a.jsx("strong",{children:_("agentWorkspace.loadingAgent")}),a.jsx("small",{children:_("agentWorkspace.loadingAgentDescription")})]})]})}),z==="integrations"&&se&&a.jsx("div",{className:"aw-detail-loading",role:"status","aria-live":"polite",children:a.jsxs("div",{className:"aw-detail-loading-card",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsxs("span",{children:[a.jsx("strong",{children:_("agentWorkspace.probingIntegration")}),a.jsx("small",{children:_("agentWorkspace.probingIntegrationDescription")})]})]})}),a.jsx(nT,{className:"aw-agent-detail",title:Bn,description:$s.description||_(s||x&&!mt?"agentWorkspace.loadingAgentInfo":"common.noDescription"),identitySeed:Bn,backLabel:_("agentWorkspace.backToAgentList"),onBack:x?O:void 0,meta:a.jsxs(a.Fragment,{children:[wo!=null&&a.jsxs("span",{className:"aw-agent-meta",children:["v",wo]}),zn&&a.jsx("span",{className:"aw-agent-meta",children:_("myAgents.draft")}),Fa&&a.jsx("span",{className:"aw-agent-meta",children:_("agentWorkspace.updatePending")}),!re&&!zn&&bi&&a.jsx("span",{className:"aw-agent-meta",children:bi.label})]}),actionsClassName:"aw-head-actions",bodyClassName:"aw-agent-detail__body",actions:zn||Fa||re!=null&&re.canDelete?a.jsxs(a.Fragment,{children:[(zn||Fa)&&a.jsxs(Tt,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>{const ce=zn??Fa;ce&&gv(ce)},disabled:ei,"aria-label":_("myAgents.deleteDraft"),title:_("myAgents.deleteDraft"),children:[a.jsx(eb,{"aria-hidden":!0}),a.jsx("span",{children:_("myAgents.deleteDraft")})]}),(re==null?void 0:re.canDelete)&&a.jsxs(Tt,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>void $b(re),disabled:ei,"aria-label":_("agentWorkspace.deleteAgent"),title:_("agentWorkspace.deleteAgent"),children:[a.jsx(eb,{"aria-hidden":!0}),a.jsx("span",{children:_(ei?"common.deleting":"agentWorkspace.deleteAgent")})]})]}):void 0,sections:ct.map(ce=>{var Le,Ke,pt,dn;return{key:ce.id,label:ce.label,disabled:Em,content:ce.id===z?a.jsxs(a.Fragment,{children:[Pr&&YT&&a.jsx("div",{className:`aw-detail-deployment${Em?" is-running":""}`,children:a.jsx(SXt,{task:Pr,onReturnToEdit:Bd&&D?()=>D(Bd):void 0})}),a.jsxs("div",{className:"aw-content",children:[z==="basic"&&a.jsxs("div",{className:"aw-basic-stack",children:[Yt&&a.jsx(Lg,{className:"aw-detail-fetch-alert",color:"warning",variant:"soft",title:_("agentWorkspace.partialInfoUnavailable"),description:_("agentWorkspace.upgradeRuntimeForDetails")}),(wt&&!Yt||We)&&a.jsx(Lg,{className:"aw-detail-fetch-alert",color:"danger",variant:"soft",title:_("agentWorkspace.detailLoadFailed"),description:_("agentWorkspace.detailLoadFailedDescription"),actions:a.jsx(Tt,{type:"button",color:"danger",variant:"soft",size:"sm",pill:!1,onClick:()=>nt(Ze=>Ze+1),children:_("common.retry")})}),st==="mpa"&&(ns||Mi||pr)&&a.jsx(Lg,{className:"aw-detail-fetch-alert",color:pr==="bound"&&!Mi?"success":"warning",variant:"soft",title:_("agentWorkspace.mpaControlPlane"),description:ns?_("agentWorkspace.loadingMpaAgentView"):Mi||ro||_(pr==="bound"?"agentWorkspace.mpaRuntimeBound":pr==="binding_ambiguous"?"agentWorkspace.mpaRuntimeBindingAmbiguous":pr==="orphan_runtime"?"agentWorkspace.mpaRuntimeOrphan":"agentWorkspace.mpaRuntimeMissing")}),re&&st!=="mpa"&&Pi&&!Pi.canUpdate&&a.jsxs("div",{className:"aw-update-recovery-notice",role:Pi.recoveryStatus==="preparing"?"status":"alert",children:[a.jsx("strong",{children:Pi.recoveryStatus==="preparing"?_("agentWorkspace.restoringUpdateConfig"):_("agentWorkspace.updateConfigUnavailable")}),Nt&&a.jsx("span",{children:Nt}),gc.map(Ze=>a.jsx("span",{children:Ze},Ze))]}),a.jsxs("section",{className:"aw-deployment-panel aw-settings-card",children:[a.jsx("div",{className:"aw-section-head",children:a.jsxs("div",{children:[a.jsx("h3",{children:_("agentWorkspace.deploymentConfig")}),a.jsx("p",{children:_("agentWorkspace.deploymentConfigDescription")})]})}),a.jsxs("dl",{className:"aw-readonly-config",children:[a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.runtimeStatus")}),a.jsxs("dd",{className:(ne==null?void 0:ne.status.toLowerCase())==="ready"?"is-ready":void 0,children:[(ne==null?void 0:ne.status.toLowerCase())==="ready"&&a.jsx("span",{className:"aw-status-dot"}),(ne==null?void 0:ne.status)||_("agentWorkspace.loading")]})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.deploymentRegion")}),a.jsx("dd",{children:(ne==null?void 0:ne.region)||(re==null?void 0:re.region)||(Pr==null?void 0:Pr.region)||_("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.networkAccess")}),a.jsx("dd",{children:ne!=null&&ne.networkTypes.length?ne.networkTypes.join(" / "):_("agentWorkspace.notAvailable")})]})]})]}),a.jsxs("section",{className:"aw-canvas-card",children:[a.jsx("div",{className:"aw-card-head",children:a.jsx("strong",{children:_("agentWorkspace.executionFlow")})}),a.jsx("div",{className:"aw-canvas",children:a.jsx(RP,{draft:$s,direction:"horizontal",selectedPath:[],onSelect:()=>{},onAdd:()=>{},onInsert:()=>{},onDelete:()=>{},readOnly:!0,interactivePreview:!0},Mf)})]}),a.jsxs("section",{className:"aw-details-card",children:[a.jsx("div",{className:"aw-card-head",children:a.jsx("strong",{children:_("agentWorkspace.details")})}),a.jsxs("dl",{className:"aw-facts",children:[a.jsxs("div",{children:[a.jsx("dt",{children:_("agentSelector.model")}),a.jsx("dd",{children:dH(oe==null?void 0:oe.model)||$s.modelName||_("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.agentCountLabel")}),a.jsx("dd",{children:oe!=null&&oe.graph?i9e(oe.graph):r9e($s)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentSelector.tools")}),a.jsx("dd",{className:"aw-fact-badges",children:XT.length?XT.map(Ze=>a.jsx("span",{children:Ze},Ze)):_("agentWorkspace.none")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentSelector.skills")}),a.jsx("dd",{className:"aw-fact-badges",children:Uh===null?_("agentSelector.previewUnsupported"):Uh.length?Uh.map(Ze=>a.jsx("span",{children:Ze},Ze)):_("agentWorkspace.none")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("systemInfo.currentVersion")}),a.jsx("dd",{children:wo!=null?`v${wo}`:_("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentSelector.status")}),a.jsx("dd",{children:zn?_("myAgents.draft"):(Pr==null?void 0:Pr.status)==="error"?_("agentWorkspace.deploymentFailed"):(Pr==null?void 0:Pr.status)==="cancelled"?_("agentWorkspace.cancelled"):Fa?_("agentWorkspace.updatePending"):a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"aw-status-dot"}),_("skillCenter.status.available")]})})]})]})]}),a.jsxs("section",{className:"aw-sidecar-panel aw-settings-card","aria-label":_("agentWorkspace.selectedOptimizations"),children:[a.jsx("div",{className:"aw-section-head",children:a.jsxs("div",{children:[a.jsx("h3",{children:_("agentWorkspace.selectedOptimizations")}),a.jsx("p",{children:_("agentWorkspace.selectedOptimizationsDescription")})]})}),a.jsxs("dl",{className:"aw-readonly-config",children:[a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.configurationStatus")}),a.jsx("dd",{className:qu!=null&&qu.enabled?"is-ready":void 0,children:qu?qu.enabled?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"aw-status-dot"}),_("skillCenter.status.enabled")]}):_("skillCenter.status.inactive"):_("agentWorkspace.notRecorded")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.optimizationProfile")}),a.jsx("dd",{children:qu?amt(qu.profile):_("agentWorkspace.legacyConfigMissing")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.selectedOptimizations")}),a.jsx("dd",{className:"aw-fact-badges",children:qu?Wn.length?Wn.map(Ze=>a.jsx("span",{children:kN(Ze)},Ze)):_("agentWorkspace.noneSelected"):_("agentWorkspace.legacyConfigMissing")})]})]})]})]}),z==="usage"&&(re==null?void 0:re.runtimeId)&&a.jsxs("section",{className:"aw-usage","aria-busy":Ks,children:[a.jsx("div",{className:"aw-usage-intro",children:a.jsx("h3",{children:_("agentWorkspace.usageOverview")})}),Ks&&!ln&&a.jsx("div",{className:"aw-usage-state",role:"status","aria-live":"polite",children:a.jsx(hn,{as:"span",children:_("agentWorkspace.loadingUsage")})}),rr&&a.jsxs("div",{className:"aw-usage-state is-error",role:"alert",children:[a.jsx("span",{children:rr}),a.jsx("button",{type:"button",onClick:()=>hl(Ze=>Ze+1),children:_("common.retry")})]}),!Ks&&!rr&&!ln&&!$e&&a.jsx("div",{className:"aw-usage-state",children:_("agentWorkspace.usageUnavailable")}),ln&&a.jsxs(a.Fragment,{children:[a.jsxs("dl",{className:"aw-usage-summary","aria-label":_("agentWorkspace.usageSummary"),children:[a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.totalCalls")}),a.jsx("dd",{children:ln.totalInvocations.toLocaleString(L.resolvedLanguage??L.language)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.userCount")}),a.jsx("dd",{children:ln.totalUsers.toLocaleString(L.resolvedLanguage??L.language)})]})]}),a.jsxs("div",{className:"aw-usage-users-head",children:[a.jsx("h3",{children:_("agentWorkspace.userDetails")}),Ks&&a.jsx(hn,{as:"span",role:"status","aria-live":"polite",children:_("agentWorkspace.refreshing")})]}),ln.users.length===0?a.jsx("div",{className:"aw-usage-state",children:_("agentWorkspace.noUsage")}):a.jsx("div",{className:"aw-usage-table-wrap",children:a.jsxs("table",{className:"aw-usage-table",children:[a.jsx("caption",{children:_("agentWorkspace.usageUserList")}),a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:_("agentWorkspace.user")}),a.jsx("th",{scope:"col",children:_("agentWorkspace.callCount")}),a.jsx("th",{scope:"col",children:_("agentWorkspace.lastUsed")})]})}),a.jsx("tbody",{children:ln.users.map(Ze=>a.jsxs("tr",{children:[a.jsxs("td",{children:[a.jsx("strong",{children:Ze.displayName||Ze.userId||_("agentWorkspace.unknownUser")}),Ze.displayName&&Ze.userId&&a.jsx("small",{title:Ze.userId,children:Ze.userId})]}),a.jsx("td",{children:Ze.invocationCount.toLocaleString(L.resolvedLanguage??L.language)}),a.jsx("td",{children:a.jsx("time",{dateTime:Ze.lastUsedAt,children:JBe(Ze.lastUsedAt,L.resolvedLanguage??L.language,_)})})]},Ze.userId))})]})}),ln.totalPages>1&&a.jsxs("nav",{className:"aw-usage-pagination","aria-label":_("agentWorkspace.usagePagination"),children:[a.jsx("button",{type:"button",disabled:Ks||ln.page<=1,onClick:()=>ks(Ze=>Math.max(1,Ze-1)),children:_("common.previousPage")}),a.jsx("span",{"aria-live":"polite",children:_("agentWorkspace.pageOf",{page:ln.page,total:ln.totalPages})}),a.jsx("button",{type:"button",disabled:Ks||ln.page>=ln.totalPages,onClick:()=>ks(Ze=>Ze+1),children:_("common.nextPage")})]})]})]}),z==="sessionConfig"&&a.jsx(oXt,{config:mi,profileStatus:cr,loadable:Mh,disabledReason:GT,loading:Ma,saving:Bu,upgrading:mc,error:Ld,notice:$d,modelValue:gl,modelDirty:xl,profileUpgradeAvailable:uv,onModelChange:Bo,onSaveModel:()=>void JT(),onInheritModel:()=>void JT("inherit"),onClearMcp:()=>void e2("clear"),onInheritMcp:()=>void e2("inherit"),onUpgradeProfile:()=>void t2(),onRefresh:()=>La(Ze=>Ze+1)}),z==="profileConfig"&&a.jsx(aXt,{profile:KT,profileStatus:cr,runtimeReady:Sm,disabledReason:TO,saving:Qo.saving,error:Qo.error,notice:Qo.notice,onApply:()=>void WL(),onEditProfile:hv,onRefresh:()=>nt(Ze=>Ze+1)}),z==="diagnostics"&&a.jsx(uXt,{data:lv,loadable:!Mb,disabledReason:Mb,loading:ml,error:gi,onRefresh:()=>Gs(Ze=>Ze+1),locale:L.resolvedLanguage??L.language}),z==="versions"&&a.jsxs("section",{className:"aw-version-stack",children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:_("agentWorkspace.githubVersions")}),a.jsx("p",{children:(Le=ge==null?void 0:ge.cicd)!=null&&Le.enabled?_("agentWorkspace.githubVersionsDescription"):_("agentWorkspace.currentVersionOnly")})]}),Se&&a.jsx("div",{className:"aw-case-empty",children:_("agentWorkspace.loadingVersions")}),Xe&&a.jsxs("div",{className:"aw-integration-error",role:"alert",children:[a.jsx("span",{children:Xe}),(re==null?void 0:re.runtimeId)&&a.jsx("button",{type:"button",onClick:()=>void uN(re.runtimeId??"").then(Oe),children:_("common.retry")})]}),!Se&&!Xe&&a.jsxs("div",{className:"aw-version-list",children:[(ge==null?void 0:ge.githubSyncError)&&a.jsx("div",{className:"aw-integration-error",role:"alert",children:a.jsx("span",{children:ge.githubSyncError})}),(ge==null?void 0:ge.latestSourceRuntimeStatus)&&ge.latestSourceRuntimeStatus!=="published"&&((Ke=ge.versions[0])==null?void 0:Ke.commitSha)&&ge.versions[0].commitSha!==ge.currentCommitSha&&a.jsx("div",{className:"aw-integration-notice",role:"status",children:a.jsxs("span",{children:[_("agentWorkspace.sourceMergedRuntimeStill"),$oe(ge.latestSourceRuntimeStatus,_),_("agentWorkspace.currentProductionVersionHint")]})}),ge!=null&&ge.versions.length?ge.versions.map(Ze=>{var aa;const En=Ze.commitSha??"",qr=Ze.runtimeStatus??Ze.status,Di=Ze.changeType==="rollback",va=!!((aa=ge.cicd)!=null&&aa.enabled)&&!!En&&!Di&&En!==ge.currentCommitSha;return a.jsxs("article",{className:"aw-version-row",children:[a.jsxs("div",{children:[a.jsx("strong",{children:tXt(Ze,_)}),a.jsx("small",{children:Ze.createdAt||_("agentWorkspace.noTime")})]}),a.jsxs("div",{children:[a.jsx("span",{children:_("agentWorkspace.prLink")}),Ze.pullRequestUrl?a.jsx("a",{href:Ze.pullRequestUrl,target:"_blank",rel:"noopener noreferrer",children:_("agentWorkspace.viewPr")}):a.jsx("em",{children:_("agentWorkspace.noPr")})]}),a.jsxs("div",{children:[a.jsx("span",{children:_("agentWorkspace.author")}),a.jsx("em",{children:Ze.author||"Studio"})]}),a.jsxs("div",{children:[a.jsx("span",{children:_("agentWorkspace.publishStatus")}),a.jsx("em",{children:$oe(qr,_)})]}),a.jsxs("div",{className:"aw-version-actions",children:[a.jsx("button",{type:"button",disabled:!va||we===En,onClick:()=>void ZT(Ze),children:_(we===En?"agentWorkspace.rollingBack":"agentWorkspace.rollbackToVersion")}),Ze.workflowRunUrl&&a.jsx("a",{href:Ze.workflowRunUrl,target:"_blank",rel:"noopener noreferrer",children:_("agentWorkspace.viewRelease")})]})]},`${Ze.version}-${En||Ze.createdAt}`)}):a.jsxs("article",{className:"aw-version-row",children:[a.jsxs("div",{children:[a.jsx("strong",{children:wo!=null?`v${wo}`:_("agentWorkspace.noVersion")}),a.jsx("small",{children:(ne==null?void 0:ne.updatedAt)||_("agentWorkspace.noTime")})]}),a.jsx("p",{children:_("agentWorkspace.currentVersionOnly")})]})]})]}),z==="integrations"&&a.jsxs("div",{className:"aw-integration-stack",children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:_("agentWorkspace.integrationMethods")}),a.jsx("p",{children:_("agentWorkspace.integrationDescription")})]}),X&&a.jsxs("div",{className:"aw-integration-error",role:"alert",children:[a.jsx("span",{children:X}),a.jsx("button",{type:"button",onClick:()=>be(Ze=>Ze+1),children:_("common.retry")})]}),!X&&a.jsxs("div",{className:"aw-integration-body",children:[a.jsxs("div",{className:`aw-integration-protocol-tabs${ue==="a2a"?" is-a2a":""}`,role:"tablist","aria-label":_("agentWorkspace.integrationProtocol"),children:[a.jsx("span",{className:"aw-integration-protocol-slider","aria-hidden":"true"}),_k.map((Ze,En)=>a.jsx("button",{type:"button",id:`integration-${Ze.id}-tab`,role:"tab","aria-selected":ue===Ze.id,"aria-controls":`integration-${Ze.id}-panel`,tabIndex:ue===Ze.id?0:-1,onClick:()=>so(Ze.id),onKeyDown:qr=>{var aa;if(!["ArrowLeft","ArrowRight","Home","End"].includes(qr.key))return;qr.preventDefault();const Di=qr.key==="Home"?0:qr.key==="End"?_k.length-1:(En+(qr.key==="ArrowRight"?1:-1)+_k.length)%_k.length,va=_k[Di];so(va.id),(aa=document.getElementById(`integration-${va.id}-tab`))==null||aa.focus()},children:Ze.label},Ze.id))]}),ue==="api-server"?a.jsx(Boe,{protocol:"api-server",title:"API Server",available:xo,fields:[{label:"Agent",value:xo?((pt=Xn==null?void 0:Xn.apiApps)==null?void 0:pt.join("、"))??"":""},{label:_("agentWorkspace.discoveryEndpoint"),value:xo?u6(zu,"/list-apps"):""},{label:_("agentWorkspace.invocationEndpoint"),value:xo?u6(zu,"/run_sse"):""},{label:_("agentWorkspace.authentication"),value:xo?Loe(ne==null?void 0:ne.authType,_):""},{label:"API Key",value:a.jsx(Foe,{available:xo,authType:ne==null?void 0:ne.authType,value:Ln,visible:Pe&&!!Ln,loading:Qe,error:ae,onToggle:()=>void ps()})}],example:xo?nXt(zu,wl,ne==null?void 0:ne.authType):""}):a.jsx(Boe,{protocol:"a2a",title:"A2A",available:Qu,fields:[{label:"Agent",value:((dn=Xn==null?void 0:Xn.a2a)==null?void 0:dn.name)??""},{label:"Agent Card",value:Qu?u6(zu,"/.well-known/agent-card.json"):""},{label:_("agentWorkspace.invocationUrl"),value:Lh},{label:_("agentWorkspace.authentication"),value:Qu?Loe(ne==null?void 0:ne.authType,_):""},{label:"API Key",value:a.jsx(Foe,{available:Qu,authType:ne==null?void 0:ne.authType,value:Ln,visible:Pe&&!!Ln,loading:Qe,error:ae,onToggle:()=>void ps()})}],example:Qu?iXt(Lh,ne==null?void 0:ne.authType):""})]})]}),z==="evaluations"&&a.jsxs("section",{className:"aw-cases",children:[(re==null?void 0:re.runtimeId)&&a.jsx("div",{className:"aw-case-summary",children:["good","bad"].map(Ze=>{const En=bXt(Ue,Ze),qr=Ba.filter(va=>va.kind===Ze).length,Di=Qh?qr:(En==null?void 0:En.itemCount)??qr;return a.jsxs("button",{type:"button",onClick:()=>r2(Ze),children:[a.jsx("strong",{children:Di}),a.jsx("span",{children:_(Ze==="good"?"agentWorkspace.goodCases":"agentWorkspace.badCases")})]},Ze)})}),a.jsxs("div",{className:"aw-case-filter-bar",children:[a.jsxs("div",{className:"aw-case-filter-stack",children:[a.jsx("div",{className:"aw-case-filters","aria-label":_("agentWorkspace.caseResultFilter"),children:["good","bad"].map(Ze=>a.jsx("button",{type:"button",className:St===Ze?"is-active":"","aria-pressed":St===Ze,onClick:()=>Ct(Ze),children:_(Ze==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")},Ze))}),a.jsx("div",{className:"aw-case-source-filters","aria-label":_("agentWorkspace.feedbackSourceFilter"),children:["auto","user"].map(Ze=>a.jsx("button",{type:"button",className:Ge===Ze?"is-active":"","aria-pressed":Ge===Ze,onClick:()=>xt(Ze),children:_(Ze==="auto"?"agentWorkspace.automaticFeedback":"agentWorkspace.manualFeedback")},Ze))})]}),a.jsxs("label",{className:"aw-case-search",children:[a.jsx(dI,{"aria-hidden":!0}),a.jsx("input",{type:"search",value:It,onChange:Ze=>Gt(Ze.currentTarget.value),placeholder:_("agentWorkspace.searchCasesPlaceholder"),"aria-label":_("agentWorkspace.searchCases")})]})]}),i2&&a.jsx("div",{className:`aw-case-toolbar${Uu?" is-active":""}`,children:Uu?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"aw-selection-count",children:_("agentWorkspace.selectedCaseCount",{count:_O.length})}),a.jsx("button",{type:"button",onClick:KL,disabled:Nn.length===0||$a,children:_("agentWorkspace.selectAllVisible")}),a.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void pv(_O),disabled:_O.length===0||$a,children:_($a?"common.deleting":"agentWorkspace.deleteSelected")}),a.jsx("button",{type:"button",onClick:jO,disabled:$a,children:_("common.cancel")})]}):a.jsx("button",{type:"button",onClick:()=>{Ss(""),vl(!0)},disabled:Nn.length===0||$a,children:_("agentWorkspace.selectCases")})}),Bl&&a.jsx("div",{className:"aw-delete-error",role:"alert",children:Bl}),a.jsx("div",{ref:Kc,children:a.jsx(TXt,{cases:Nn,loading:Ht&&Nn.length===0,error:Nr,notice:Ws,runtimeBacked:!!(re!=null&&re.runtimeId),selectionMode:Uu,selectedCaseIds:Fl,focusedCaseId:is,expandedCaseIds:Fd,deleting:$a,canDelete:i2,onOpenCase:a2,onToggleCase:s2,onToggleExpanded:Ud,onDeleteCase:Ze=>void pv([Ze]),onRetry:()=>Ei(Ze=>Ze+1)})})]}),z==="optimizations"&&a.jsxs("section",{className:"aw-optimizations",children:[a.jsxs("div",{className:"aw-optimization-intro",children:[a.jsx("h3",{children:_("agentWorkspace.optimizations")}),a.jsx("p",{children:_("agentWorkspace.optimizationsDescription")})]}),ba?a.jsxs("div",{className:"aw-optimization-state",role:"status",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsx("span",{children:_("agentWorkspace.loadingOptimizations")})]}):fs?a.jsxs("div",{className:"aw-optimization-state is-error",role:"alert",children:[a.jsx("span",{children:fs}),a.jsx("button",{type:"button",onClick:()=>bo(Ze=>Ze+1),children:_("common.retry")})]}):es.length>0?a.jsx(CXt,{groups:es}):a.jsx("div",{className:"aw-optimization-state",children:_("agentWorkspace.noOptimizations")})]})]}),z==="basic"&&(re||zn)&&a.jsxs("div",{className:"aw-basic-actions",children:[re&&a.jsxs("button",{type:"button",className:"aw-talk studio-update-action",onClick:()=>T==null?void 0:T(re),children:[a.jsx(zat,{"aria-hidden":!0}),a.jsx("span",{children:_("agentWorkspace.chat")})]}),a.jsxs("span",{className:`aw-update-wrap${Bh?" is-disabled":""}`,tabIndex:Bh?0:void 0,"aria-describedby":Bh?AO:void 0,children:[a.jsx("button",{type:"button",className:"aw-update studio-update-action",disabled:st==="mpa"?!1:!!Bh,"aria-busy":_t||void 0,"aria-describedby":Bh?AO:void 0,onClick:()=>{if(st==="mpa"){q("profileConfig");return}if(zn){D==null||D(zn);return}Pi&&P(Pi)},children:_t?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"loading-gap-spinner aw-update-spinner","aria-hidden":"true"}),a.jsx("span",{children:_("agentWorkspace.preparing")})]}):_(st==="mpa"?"agentWorkspace.profileConfig":zn||Fa?"agentWorkspace.continueEditing":"agentWorkspace.update")}),Bh&&a.jsx("span",{id:AO,className:"aw-update-disabled-reason",role:"tooltip",children:Bh})]})]})]}):null}}),activeSectionKey:z,navigationLabel:_("agentWorkspace.agentDetails"),onSectionChange:q})]})]}),F==="evaluation"&&a.jsx("div",{className:"aw-evaluation-glass",role:"status",children:a.jsx("span",{children:_("agentWorkspace.comingSoon")})})]})]}),Rn&&a.jsx(Ad,{variant:"danger",title:Rn.title,description:Rn.description,confirmLabel:ei?_("common.deleting"):Rn.confirmLabel,closeLabel:_("agentWorkspace.closeDeleteConfirmation"),busy:ei,confirmDisabled:Rn.canConfirm===!1,onCancel:()=>ui(null),onConfirm:()=>void YL()})]})}function CXt({groups:e}){const{t}=Te("ui");return a.jsx("div",{className:"aw-optimization-table-wrap",children:a.jsxs("table",{className:"aw-optimization-table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:t("agentWorkspace.fixPriority")}),a.jsx("th",{scope:"col",children:t("agentWorkspace.suggestedModule")}),a.jsx("th",{scope:"col",children:t("agentWorkspace.suggestionAndReason")})]})}),a.jsx("tbody",{children:e.map(n=>a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx("span",{className:`aw-priority is-${n.priority}`,children:pXt(n.priority,t)})}),a.jsx("td",{children:a.jsx("span",{className:"aw-optimization-module",children:gXt(n,t)})}),a.jsx("td",{children:a.jsx("ul",{className:"aw-optimization-list",children:n.items.map(i=>a.jsxs("li",{children:[a.jsx("strong",{children:i.suggestion}),a.jsx("p",{children:i.reason})]},`${i.suggestion}:${i.reason}`))})})]},`${n.priority}:${n.module}:${n.customModule??""}`))})]})})}function AXt(){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M4.5 7h15"}),a.jsx("path",{d:"M9 7V4.8h6V7"}),a.jsx("path",{d:"m6.5 7 .8 12h9.4l.8-12"}),a.jsx("path",{d:"M10 10.5v5M14 10.5v5"})]})}function TXt({cases:e,loading:t=!1,error:n="",notice:i="",runtimeBacked:r=!1,selectionMode:s=!1,selectedCaseIds:o,focusedCaseId:l="",expandedCaseIds:c,deleting:u=!1,canDelete:d=!1,onOpenCase:f,onToggleCase:h,onToggleExpanded:m,onDeleteCase:g,onRetry:b}){const{t:v,i18n:y}=Te("ui");return a.jsxs("div",{className:"aw-case-table",children:[a.jsxs("div",{className:"aw-case-row aw-case-row-head",children:[a.jsx("span",{children:v("agentWorkspace.userInput")}),a.jsx("span",{children:v("agentWorkspace.agentOutput")}),a.jsx("span",{children:v("agentWorkspace.score")}),a.jsx("span",{children:v("agentWorkspace.scoreReason")}),a.jsx("span",{className:"aw-case-action-head",children:v("skillCenter.actions")})]}),t?a.jsx("div",{className:"aw-case-empty",children:v("agentWorkspace.loadingEvaluationSet")}):n?a.jsxs("div",{className:"aw-case-empty aw-case-error",children:[a.jsx("span",{children:n}),b&&a.jsx("button",{type:"button",onClick:b,children:v("common.retry")})]}):i?a.jsx("div",{className:"aw-case-empty",children:i}):e.length===0?a.jsx("div",{className:"aw-case-empty",children:v(r?"agentWorkspace.noFeedbackCases":"agentWorkspace.noMatchingCases")}):e.map(w=>{var T,R;const x=w.id.startsWith("local:"),O=(o==null?void 0:o.has(w.id))??!1,k=(c==null?void 0:c.has(w.id))??!1,C=w.output.length+w.referenceOutput.length>220||(((T=w.reason)==null?void 0:T.length)??0)>120,E=d&&!x,j=!!(w.comment&&w.comment.trim()!==((R=w.reason)==null?void 0:R.trim()));return a.jsxs("div",{className:["aw-case-row",l===w.id?"is-focused":"",s?"is-selecting":"",O?"is-selected-for-delete":""].filter(Boolean).join(" "),role:"row",tabIndex:0,"aria-selected":s?O:void 0,onClick:()=>{if(s){E&&(h==null||h(w));return}f==null||f(w)},onKeyDown:A=>{A.target===A.currentTarget&&(A.key!=="Enter"&&A.key!==" "||(A.preventDefault(),s?E&&(h==null||h(w)):f==null||f(w)))},children:[a.jsxs("div",{className:"aw-case-text aw-case-cell","data-label":v("agentWorkspace.userInput"),children:[a.jsxs("span",{className:"aw-case-title-line",children:[s&&E&&a.jsx("span",{className:`aw-select-marker${O?" is-checked":""}`,"aria-hidden":"true"}),a.jsx("strong",{title:w.input,children:w.input||v("agentWorkspace.noUserInput")})]}),j&&a.jsxs("small",{title:w.comment,children:[v("agentWorkspace.note"),w.comment]}),a.jsx("small",{className:"aw-case-time",children:fXt(w.createdAt,y.resolvedLanguage??y.language,v)}),(w.userId||w.sessionId)&&a.jsx("small",{title:[w.userId,w.sessionId].filter(Boolean).join(" · "),children:[w.userId,w.sessionId].filter(Boolean).join(" · ")})]}),a.jsxs("div",{className:`aw-case-output aw-case-cell${k?" is-expanded":""}`,"data-label":v("agentWorkspace.agentOutput"),children:[a.jsx("p",{className:"aw-case-output-preview",title:w.output,children:w.output||v("agentWorkspace.noVisibleResponse")}),w.referenceOutput&&a.jsxs("small",{className:"aw-case-output-preview",title:w.referenceOutput,children:[v("agentWorkspace.reference"),": ",w.referenceOutput]}),C&&a.jsx("button",{type:"button",className:"aw-case-expand",onClick:A=>{A.stopPropagation(),m==null||m(w.id)},children:v(k?"common.collapse":"common.expand")})]}),a.jsx("div",{className:"aw-case-score aw-case-cell","data-label":v("agentWorkspace.score"),children:hXt(w,v)}),a.jsx("div",{className:`aw-case-reason aw-case-cell${k?" is-expanded":""}`,"data-label":v("agentWorkspace.scoreReason"),children:a.jsx("p",{title:w.reason||void 0,children:w.reason||"—"})}),a.jsx("div",{className:"aw-case-actions aw-case-cell","data-label":v("skillCenter.actions"),children:E&&a.jsx("button",{type:"button",className:"aw-case-delete",onClick:A=>{A.stopPropagation(),g==null||g(w)},disabled:u,title:v("agentWorkspace.deleteFeedbackCase"),"aria-label":v("agentWorkspace.deleteFeedbackCase"),children:a.jsx(AXt,{})})})]},w.id)})]})}function _Xt({group:e,agents:t,cases:n,onChange:i,onRun:r}){const{t:s}=Te("ui"),[o,l]=p.useState("config"),c=e.agentIds.map(h=>t.find(m=>m.id===h)).filter(h=>!!h),u=["回答质量","事实准确性","工具调用","响应效率"];p.useEffect(()=>l("config"),[e.id]);const d=h=>{i({...e,agentIds:e.agentIds.includes(h)?e.agentIds.filter(m=>m!==h):[...e.agentIds,h]})},f=h=>{i({...e,metrics:e.metrics.includes(h)?e.metrics.filter(m=>m!==h):[...e.metrics,h]})};return a.jsxs("main",{className:"aw-main",children:[a.jsxs("div",{className:"aw-eval-head",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"aw-agent-title-row",children:[a.jsx("h2",{children:xS(e.name,s)}),a.jsx("span",{children:s("agentWorkspace.evaluationGroup")})]}),a.jsx("p",{children:s("agentWorkspace.evaluationGroupStats",{agents:c.length,caseSet:xS(e.caseSet,s),runs:e.history.length})})]}),a.jsxs("button",{type:"button",className:"aw-run",onClick:()=>r(e),disabled:!0,children:[a.jsx(Mat,{"aria-hidden":!0}),s("agentWorkspace.startEvaluation")]})]}),a.jsxs("nav",{className:"aw-agent-tabs","aria-label":s("agentWorkspace.evaluationGroupDetails"),children:[a.jsx("button",{type:"button",className:o==="config"?"is-active":"","aria-pressed":o==="config",onClick:()=>l("config"),disabled:!0,children:s("agentWorkspace.evaluationConfig")}),a.jsx("button",{type:"button",className:o==="history"?"is-active":"","aria-pressed":o==="history",onClick:()=>l("history"),disabled:!0,children:s("agentWorkspace.historyResults")})]}),a.jsx("div",{className:"aw-content",children:o==="config"?a.jsxs("div",{className:"aw-eval-setup",children:[a.jsxs("section",{className:"aw-eval-block",children:[a.jsxs("div",{className:"aw-card-head",children:[a.jsx("strong",{children:s("agentWorkspace.participatingAgents")}),a.jsx("span",{children:s("agentWorkspace.selectedCount",{count:c.length})})]}),a.jsx("div",{className:"aw-eval-agent-grid",children:t.map(h=>a.jsxs("label",{children:[a.jsx("input",{type:"checkbox",checked:e.agentIds.includes(h.id),onChange:()=>d(h.id)}),a.jsxs("span",{children:[a.jsx("strong",{children:h.label}),a.jsx("small",{children:h.remote?s("agentWorkspace.remote"):s("agentWorkspace.local")})]})]},h.id))})]}),a.jsxs("div",{className:"aw-eval-setting-grid",children:[a.jsxs("section",{className:"aw-eval-block",children:[a.jsx("div",{className:"aw-card-head",children:a.jsx("strong",{children:s("agentWorkspace.evaluationResources")})}),a.jsxs("div",{className:"aw-eval-fields",children:[a.jsxs("label",{children:[a.jsx("span",{children:s("agentWorkspace.evaluationSet")}),a.jsxs("select",{value:e.caseSet,onChange:h=>i({...e,caseSet:h.currentTarget.value}),children:[a.jsx("option",{value:"核心回归集",children:s("agentWorkspace.evaluationDefaults.coreSet")}),a.jsx("option",{value:"安全边界集",children:s("agentWorkspace.evaluationDefaults.safetySet")}),a.jsx("option",{value:"工具调用集",children:s("agentWorkspace.evaluationDefaults.toolSet")})]}),a.jsx("small",{children:s("agentWorkspace.caseCount",{count:n.length})})]}),a.jsxs("label",{children:[a.jsx("span",{children:s("agentWorkspace.evaluator")}),a.jsxs("select",{value:e.evaluator,onChange:h=>i({...e,evaluator:h.currentTarget.value}),children:[a.jsx("option",{value:"综合质量评估器",children:s("agentWorkspace.evaluationDefaults.qualityEvaluator")}),a.jsx("option",{value:"事实一致性评估器",children:s("agentWorkspace.evaluationDefaults.factualEvaluator")}),a.jsx("option",{value:"工具调用评估器",children:s("agentWorkspace.evaluationDefaults.toolEvaluator")})]})]}),a.jsxs("label",{children:[a.jsx("span",{children:s("agentWorkspace.concurrency")}),a.jsxs("select",{value:e.concurrency,onChange:h=>i({...e,concurrency:h.currentTarget.value}),children:[a.jsx("option",{value:"2",children:"2"}),a.jsx("option",{value:"4",children:"4"}),a.jsx("option",{value:"8",children:"8"})]})]})]})]}),a.jsxs("section",{className:"aw-eval-block",children:[a.jsxs("div",{className:"aw-card-head",children:[a.jsx("strong",{children:s("agentWorkspace.evaluationMetrics")}),a.jsx("span",{children:s("agentWorkspace.selectedMetricCount",{count:e.metrics.length})})]}),a.jsx("div",{className:"aw-metric-list",children:u.map(h=>a.jsxs("label",{children:[a.jsx("input",{type:"checkbox",checked:e.metrics.includes(h),onChange:()=>f(h)}),a.jsx("span",{children:xS(h,s)})]},h))})]})]})]}):a.jsxs("section",{className:"aw-eval-history",children:[a.jsx("div",{className:"aw-section-head",children:a.jsxs("div",{children:[a.jsx("h3",{children:s("agentWorkspace.historyResults")}),a.jsx("p",{children:s("agentWorkspace.historyDescription")})]})}),e.history.length===0?a.jsxs("div",{className:"aw-results-empty",children:[a.jsx("strong",{children:s("agentWorkspace.noHistory")}),a.jsx("span",{children:s("agentWorkspace.noHistoryDescription")})]}):a.jsx("div",{className:"aw-history-list",children:e.history.map((h,m)=>a.jsxs("button",{type:"button",children:[a.jsxs("span",{children:[a.jsx("strong",{children:s("agentWorkspace.evaluationRun",{index:e.history.length-m})}),a.jsx("small",{children:s("agentWorkspace.evaluationRunMeta",{time:xS(h.createdAt,s),agents:c.length})})]}),a.jsxs("span",{className:"aw-history-score",children:[a.jsx("strong",{children:h.score}),a.jsx("small",{children:s("agentWorkspace.overallScore")})]}),a.jsxs("span",{className:"aw-complete",children:[a.jsx(Cf,{}),s("agentWorkspace.completed")]}),a.jsx(YS,{"aria-hidden":!0})]},h.id))})]})})]})}async function pK(e,t={}){const n=await fetch(ja(`/web/agent-reviews${e}`),{...t,headers:ul(fc({"Content-Type":"application/json"})),signal:po(t.signal??void 0,6e4)});if(!n.ok)throw new Error(await n.text());return n.json()}function jXt(e,t){return pK(`?${new URLSearchParams({region:e})}`,{signal:t})}function NXt(e,t,n){return pK(`/${encodeURIComponent(e)}?${new URLSearchParams({region:t})}`,{signal:n})}function RXt(e,t,n){return pK(`/${encodeURIComponent(e)}/${t}`,{method:"POST",body:JSON.stringify(n)})}const IXt=20,zoe=256;function d6({label:e,value:t,onChange:n,limit:i,disabled:r,required:s=!1}){const{t:o}=Te("agentReviews");return a.jsxs("label",{children:[e,a.jsx("textarea",{"aria-label":e,value:t,onChange:l=>n(Array.from(l.target.value).slice(0,i).join("")),maxLength:i*2,disabled:r,required:s,rows:3}),a.jsx("span",{className:"agent-review-text-count",children:o("textCount",{count:Array.from(t).length,limit:i})})]})}function IP({person:e}){return a.jsxs("span",{className:"agent-review-person",title:e.email||e.name,children:[e.avatarUrl?a.jsx("img",{src:e.avatarUrl,alt:"",referrerPolicy:"no-referrer",onError:t=>{t.currentTarget.hidden=!0}}):null,a.jsx("span",{children:e.name||e.id})]})}function l9e({runtimeId:e,region:t,name:n,canPublish:i,onClose:r,onChanged:s}){const{t:o,i18n:l}=Te("agentReviews"),[c,u]=p.useState(null),[d,f]=p.useState(!0),[h,m]=p.useState(!1),[g,b]=p.useState(""),[v,y]=p.useState(""),[w,x]=p.useState(""),[O,k]=p.useState(""),[S,C]=p.useState(0),[E,j]=p.useState(!1),[T,R]=p.useState(null);p.useEffect(()=>{const _=new AbortController;return f(!0),b(""),NXt(e,t,_.signal).then(L=>{_.signal.aborted||u(L.application)}).catch(L=>{_.signal.aborted||b(L instanceof Error?L.message:String(L))}).finally(()=>{_.signal.aborted||f(!1)}),()=>_.abort()},[e,t,S]);async function A(_,L){if(!h){m(!0),b("");try{const F=await RXt(e,_,{region:t,..._==="submit"?{message:v}:{},..._==="publish"||_==="decision"?{comment:w}:{},..._==="decision"?{applicationId:c==null?void 0:c.id,decision:L,reason:O}:{}});u(F),x(""),k(""),j(!1),R(null),s()}catch(F){b(F instanceof Error?F.message:String(F))}finally{m(!1)}}}const N=(c==null?void 0:c.status)==="pending",P=!!(c!=null&&c.published),I=!N&&!P,D=_=>new Date(_).toLocaleString(l.language);return a.jsx(nv,{open:!0,onOpenChange:_=>{!_&&!h&&r()},children:a.jsxs(tv,{children:[a.jsx(J0,{className:"agent-review-backdrop"}),a.jsxs(ev,{className:"agent-review-dialog",children:[a.jsxs("header",{className:"agent-review-dialog-header",children:[a.jsxs("div",{children:[a.jsx(gO,{children:n}),a.jsx(RT,{children:o("dialogDescription")})]}),a.jsx(fL,{className:"agent-review-close",disabled:h,"aria-label":o("close"),children:a.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m6 6 12 12M6 18 18 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})})]}),a.jsxs("div",{className:"agent-review-dialog-body",children:[d?a.jsx(cl,{}):null,g?a.jsxs("div",{className:"agent-review-error",role:"alert",children:[a.jsx("p",{children:g}),a.jsx("button",{type:"button",disabled:h||d,onClick:()=>C(_=>_+1),children:o("refresh")})]}):null,!d&&c?a.jsxs(a.Fragment,{children:[a.jsxs("dl",{className:"agent-review-facts",children:[a.jsxs("div",{children:[a.jsx("dt",{children:o("statusTitle")}),a.jsxs("dd",{children:[o(`status.${c.status}`),c.status==="approved"&&!P?` · ${o("private")}`:""]})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("submitter")}),a.jsx("dd",{children:a.jsx(IP,{person:c.submitter})})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("submittedAt")}),a.jsx("dd",{children:D(c.submittedAt)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("version")}),a.jsx("dd",{children:c.agent.version??"—"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("model")}),a.jsx("dd",{children:c.agent.model||"—"})]}),c.reviewer?a.jsxs("div",{children:[a.jsx("dt",{children:o(c.status==="returned"?"returnedBy":"approvedBy")}),a.jsx("dd",{children:a.jsx(IP,{person:c.reviewer})})]}):null,c.reviewedAt?a.jsxs("div",{children:[a.jsx("dt",{children:o("reviewedAt")}),a.jsx("dd",{children:D(c.reviewedAt)})]}):null]}),a.jsxs("section",{children:[a.jsx("h3",{children:o("description")}),a.jsx("p",{children:c.agent.description||"—"})]}),c.message?a.jsxs("section",{children:[a.jsx("h3",{children:o("message")}),a.jsx("p",{children:c.message})]}):null,c.reason?a.jsxs("section",{children:[a.jsx("h3",{children:o("reason")}),a.jsx("p",{children:c.reason})]}):null,c.comment?a.jsxs("section",{children:[a.jsx("h3",{children:o("comment")}),a.jsx("p",{children:c.comment})]}):null,c.contentChanged?a.jsx("p",{role:"alert",className:"agent-review-warning",children:o("contentChanged")}):null]}):null,!d&&!g&&I&&!i?a.jsx(d6,{label:o("message"),value:v,onChange:y,limit:IXt,disabled:h}):null,!d&&!g&&i&&(N||I)?a.jsx(d6,{label:o("comment"),value:w,onChange:x,limit:zoe,disabled:h}):null,E?a.jsx(d6,{label:o("reasonRequired"),value:O,onChange:k,limit:zoe,disabled:h,required:!0}):null,T?a.jsx("p",{role:"status",children:o(`${T}Confirm`)}):null]}),a.jsxs("footer",{className:"agent-review-dialog-footer",children:[h?a.jsx("span",{role:"status",children:o("saving")}):null,!d&&(!g||c)?T?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",disabled:h,onClick:()=>R(null),children:o("cancel")}),a.jsx("button",{type:"button",disabled:h,onClick:()=>void A(T),children:o("confirm")})]}):E?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",disabled:h,onClick:()=>j(!1),children:o("cancel")}),a.jsx("button",{type:"button",disabled:h||!O.trim(),onClick:()=>void A("decision","returned"),children:o("return")})]}):a.jsxs(a.Fragment,{children:[P?a.jsx("button",{type:"button",disabled:h,onClick:()=>R("unpublish"),children:o("unpublish")}):null,N?a.jsx("button",{type:"button",disabled:h,onClick:()=>R("withdraw"),children:o("withdraw")}):null,N&&i?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",disabled:h,onClick:()=>j(!0),children:o("return")}),a.jsx("button",{type:"button",className:"is-primary",disabled:h||(c==null?void 0:c.contentChanged),onClick:()=>void A("decision","approved"),children:o("approve")})]}):null,I?a.jsx("button",{type:"button",className:"is-primary",disabled:h,onClick:()=>void A(i?"publish":"submit"),children:o(i?"publish":"submit")}):null]}):null]})]})]})})}const PXt=5e3,DXt=4;let f6=0;const Voe=[];function Hoe(e){return e instanceof Error&&e.name==="AbortError"}function MXt(e){return e instanceof Error&&e.name==="TimeoutError"}function LXt(e){return MXt(e)||e instanceof RD&&[500,502,503,504].includes(e.status)}function $Xt(e,t){return t!=null&&t.aborted?Promise.reject(t.reason??new DOMException("Request aborted","AbortError")):new Promise((n,i)=>{const r=()=>{globalThis.clearTimeout(s),i((t==null?void 0:t.reason)??new DOMException("Request aborted","AbortError"))},s=globalThis.setTimeout(()=>{t==null||t.removeEventListener("abort",r),n()},e);t==null||t.addEventListener("abort",r,{once:!0})})}async function FXt(e={},t={}){const n=t.request??F0,i=t.wait??$Xt;try{return await n(e)}catch(r){if(!LXt(r))throw r;return await i(PXt,e.signal),n(e)}}async function c9e(e){var t;f6>=DXt&&await new Promise(n=>Voe.push(n)),f6+=1;try{return await e()}finally{f6-=1,(t=Voe.shift())==null||t()}}async function BXt(e,t){await Promise.allSettled(e.map(n=>c9e(()=>t(n))))}function Oy(e,t,n){const i=e instanceof Error?`${e.name}: ${e.message}`:String(e||Q("common.unknownError"));return[Q("requestError.actionFailed",{action:t}),Q("requestError.detail",{detail:i}),n?Q("requestError.request",{request:n}):""].filter(Boolean).join(` -`)}function _p({className:e="icon"}){return a.jsxs("svg",{className:`${e} sidebar-agent-face`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("rect",{x:"4.25",y:"5.25",width:"15.5",height:"13.5",rx:"4.75"}),a.jsx("path",{className:"sidebar-agent-face__eye",d:"M8.5 10.7v2"}),a.jsx("path",{className:"sidebar-agent-face__eye",d:"M15.5 10.7v2"})]})}function UXt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M8.4 18.4H7.2a4.2 4.2 0 0 1-.65-8.35A5.7 5.7 0 0 1 17.3 8.2a4.6 4.6 0 0 1-.4 9.2h-3.2"}),a.jsx("path",{d:"m7.8 12.3 2 2-2 2M12.2 16.3h3.2"})]})}function QXt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M18.9 6.25A8.4 8.4 0 1 0 19.6 16"}),a.jsx("path",{d:"M19 6.2c.1 2.1-.65 3.75-2.25 4.95-1.2.9-2.75 1.25-4.2.9"}),a.jsx("circle",{cx:"10.6",cy:"12.8",r:"2.45"}),a.jsx("path",{d:"m5.25 18.6 3.65-3.9M14.8 17.9c1.9-.45 3.55-1.65 4.65-3.35"})]})}function zXt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6.2 20c.55-2.15.75-4.1.75-6.7V9.8A5.35 5.35 0 0 1 12.35 4c3.35 0 5.65 2.35 5.65 5.65v4.6c0 2.35.35 4.25 1.15 5.75"}),a.jsx("path",{d:"M8.05 10.2c1.35-.6 2.2-1.65 2.55-3.15.45 1.55 1.35 2.55 2.7 3.05.1-1 .4-1.95.85-2.75.45 1.25 1.2 2.2 2.15 2.75"}),a.jsx("path",{d:"M9.3 12.65h.01M14.9 12.65h.01M10.8 15.55c.8.5 1.65.5 2.45 0"}),a.jsx("path",{d:"M8.45 19.85c.95-.85 1.45-1.95 1.5-3.25M15.1 16.65c.05 1.2.55 2.3 1.55 3.2"})]})}function VXt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5.2 17.2V8.1a3 3 0 0 1 3-3h7.6a3 3 0 0 1 3 3v9.1"}),a.jsx("path",{d:"M7.4 17.2h9.2M9 19.9h6"}),a.jsx("path",{d:"M9.1 9.25h5.8M9.1 12h3.1"}),a.jsx("path",{d:"m14.1 12.4 2 2.1M16.2 12.4l-2.1 2.1"})]})}function lA({kind:e,...t}){return e==="codex"?a.jsx(UXt,{...t}):e==="deepseek-harness"?a.jsx(VXt,{...t}):e==="openclaw"?a.jsx(QXt,{...t}):a.jsx(zXt,{...t})}const HXt="data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20overflow='visible'%20style='display:%20block;'%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Icon%20Frame'%3e%3cpath%20id='Vector%208798'%20d='M5%205L15%2015'%20stroke='white'%20stroke-opacity='0.15'%20stroke-width='1.25'%20stroke-linecap='round'/%3e%3cpath%20id='Vector%208800'%20d='M15%205L5%2015'%20stroke='white'%20stroke-opacity='0.15'%20stroke-width='1.25'%20stroke-linecap='round'/%3e%3c/g%3e%3c/svg%3e";function u9e({title:e,topGlow:t=!0,children:n,footer:i,cancelLabel:r="Cancel",confirmLabel:s="Confirm",closeLabel:o="Close",onClose:l,onCancel:c,onConfirm:u,className:d="",...f}){const h=p.useId();return a.jsxs("div",{role:"dialog","aria-labelledby":h,...f,className:`studio-modal-layout ${t?"studio-modal-layout--glow":""} ${d}`.trim(),children:[a.jsxs("header",{className:"studio-modal-layout__header",children:[a.jsx("h3",{id:h,children:e}),a.jsx(Ki,{variant:"ghost",size:"compact",iconOnly:!0,className:"studio-modal-layout__close","aria-label":o,onClick:l,startIcon:a.jsx("img",{src:HXt,alt:""})})]}),a.jsx("div",{className:"studio-modal-layout__body",children:n}),i!==null&&a.jsx("footer",{className:"studio-modal-layout__footer",children:i===void 0?a.jsxs(a.Fragment,{children:[a.jsx(Ki,{variant:"outline",className:"studio-modal-layout__cancel",onClick:c,children:r}),a.jsx(Ki,{className:"studio-modal-layout__confirm",onClick:u,children:s})]}):i})]})}class d9e extends Error{constructor(t,n){super(n),this.status=t,this.name="MpaCreationRequestError"}}async function RL(e,t,n){const i=await fetch(ja(`/web/mpa-creation/${e}`),{method:n===void 0?"GET":"POST",headers:ul(fc({"Content-Type":"application/json"})),body:n===void 0?void 0:JSON.stringify(n),signal:po(t,ho)});if(!i.ok){const r=await i.json().catch(()=>({}));throw new d9e(i.status,typeof r.detail=="string"?r.detail:`HTTP ${i.status}`)}return i.json()}const qXt=(e,t)=>RL(`config?region=${encodeURIComponent(e)}`,t),WXt=(e,t)=>RL("tasks",t,e),KXt=(e,t)=>RL(`tasks/${encodeURIComponent(e)}`,t),GXt=(e,t)=>RL(`tasks/${encodeURIComponent(e)}/cancel`,t,{}),XXt=/^[A-Za-z0-9_-]+$/,f9e=4,PP=64,DP=6,qoe="agent-runtime";function h9e(e){const t=e.trim();if(!t)return qoe;let n=t.replace(/[^A-Za-z0-9_-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").slice(0,PP);return n?(n.lengthXt(`validation.runtimeName.${n}`)){return e?XXt.test(e)?e.lengthPP?t("length"):null:t("characters"):t("required")}function JXt(e="",t=""){const n=e.trim(),i=t.trim();return!n&&!i||n.length<=255&&/^[A-Za-z0-9][A-Za-z0-9.-]*$/.test(n)&&!n.includes("..")&&/^[0-9]{1,5}$/.test(i)&&Number(i)>=1&&Number(i)<=65535}function eYt(e="",t="",n=""){const i=e.trim(),r=t.trim();if(!i&&!r&&!n)return!0;if(!i||!r||!n.trim()||i.length>1024||/\s/.test(i)||i.replace(/^https:\/\//,"").split("/",1)[0].includes(":"))return!1;try{const o=new URL(i);return o.protocol==="https:"&&!!o.hostname&&!o.username&&!o.password&&!o.port&&!o.search&&!o.hash&&r.length<=128&&/^ov-[a-zA-Z0-9_-]+$/.test(r)}catch{return!1}}const tYt="https://console.volcengine.com/aidap/region:aidap+cn-beijing/",nYt="https://console.volcengine.com/vikingdb/openviking/region:openviking+cn-beijing/ov-6689fabdf032294/context-management?accountId=default&userId=default&projectName=default";function p9e(e){return{region:e,requestId:crypto.randomUUID(),name:"",description:""}}function MP(e){return{...e,tosAccessKey:void 0,tosSecretKey:void 0}}function iYt(e){var t;try{const n=JSON.parse(sessionStorage.getItem(`mpa-create:${e}`)||"null");if(((t=n==null?void 0:n.input)==null?void 0:t.region)===e&&typeof n.input.requestId=="string"){if(n.submitted||n.taskId)return{...n,input:MP(n.input)};const i={...n.input,name:typeof n.input.name=="string"?n.input.name:""};return delete i.agentId,delete i.runtimeImage,delete i.workerImage,{...n,input:MP(i)}}}catch{}return{input:p9e(e)}}function rYt({region:e,onClose:t,onCreated:n}){var X,ie;const{t:i}=Te("ui"),r=ee=>`myAgents.mpaCreate.${ee}`,[s]=p.useState(()=>iYt(e)),[o,l]=p.useState(s.input),[c,u]=p.useState(""),[d,f]=p.useState(s.submitted||s.taskId?2:Math.min(2,Math.max(0,s.step??0))),[h,m]=p.useState(s.taskId),[g,b]=p.useState(!!(s.submitted||s.taskId)),[v,y]=p.useState(null),[w,x]=p.useState(null),[O,k]=p.useState(!0),[S,C]=p.useState(!1),[E,j]=p.useState(""),[T,R]=p.useState(0),[A,N]=p.useState(!1),P=p.useRef(!1),I=p.useRef(!1),D=p.useRef(!0),_=p.useRef(null),L=p.useRef(n);L.current=n;const F=(v==null?void 0:v.state)==="running"||(v==null?void 0:v.state)==="cancelling",z=g&&o.name===void 0&&!!o.agentId?null:rv((o.name??"").trim(),ee=>i(`validation.runtimeName.${ee}`,{ns:"create"})),q=!z,U=(w==null?void 0:w.postgresMode)==="auto",J=U?!o.pgHost&&!o.pgPort:JXt(o.pgHost,o.pgPort),V=eYt(o.openvikingUrl,o.openvikingResourceId,c),Z=[o.tosAccessKey,o.tosSecretKey,o.tosBucket].map(ee=>(ee==null?void 0:ee.trim())??""),ne=Z.every(Boolean)||Z.every(ee=>!ee),W=S||g&&(!v||F||v.state==="succeeded");p.useEffect(()=>{if(!(g||h))try{sessionStorage.setItem(`mpa-create:${e}`,JSON.stringify({input:MP(o),step:d}))}catch{}},[o,d,e,g,h]);function G(ee){try{sessionStorage.setItem(`mpa-create:${e}`,JSON.stringify({input:MP(o),taskId:ee,submitted:!0,step:2}))}catch{}}p.useEffect(()=>(D.current=!0,()=>{var ee;D.current=!1,(ee=_.current)==null||ee.abort()}),[]),p.useEffect(()=>{const ee=new AbortController;return k(!0),qXt(e,ee.signal).then(be=>{ee.signal.aborted||(x(be),be.configured&&!s.submitted&&!s.taskId&&!P.current&&l(ue=>({...ue,pgHost:be.postgresMode==="auto"?"":ue.pgHost??be.pgHost??"",pgPort:be.postgresMode==="auto"?"":ue.pgPort??be.pgPort??""})))}).catch(()=>{ee.signal.aborted||j(i(r("loadFailed")))}).finally(()=>{ee.signal.aborted||k(!1)}),()=>ee.abort()},[e,T,i]),p.useEffect(()=>{if(!h)return;const ee=new AbortController;let be;async function ue(){try{const pe=await KXt(h,ee.signal);if(ee.signal.aborted)return;if(y(pe),j(""),pe.state==="succeeded"&&!I.current){I.current=!0;try{sessionStorage.removeItem(`mpa-create:${e}`)}catch{}L.current()}if(pe.state!=="running"&&pe.state!=="cancelling")return}catch{if(ee.signal.aborted)return;j(i(r("pollFailed")))}be=setTimeout(ue,2e3)}return ue(),()=>{ee.abort(),clearTimeout(be)}},[h,e,T,i]);async function H(){if(P.current||!(w!=null&&w.configured)||!q||!J||!V||!ne||d!==2||F||(v==null?void 0:v.state)==="succeeded")return;P.current=!0,C(!0),b(!0),j(""),G(h);const ee=new AbortController;_.current=ee;try{const be=await WXt({...o,...o.name===void 0?{}:{name:o.name.trim()},openvikingApiKey:c},ee.signal);if(!D.current||ee.signal.aborted)return;G(be.taskId),m(be.taskId),y(be),R(ue=>ue+1)}catch(be){D.current&&!ee.signal.aborted&&(be instanceof d9e&&(be.status===400||be.status===422)&&b(!1),j(be instanceof Error?be.message:i(r("creationFailed"))))}finally{P.current=!1,D.current&&C(!1)}}async function se(){if(!h||P.current)return;N(!1),P.current=!0,C(!0);const ee=new AbortController;_.current=ee;try{const be=await GXt(h,ee.signal);D.current&&!ee.signal.aborted&&y(be)}catch{D.current&&!ee.signal.aborted&&j(i(r("cancelFailed")))}finally{P.current=!1,D.current&&C(!1)}}function Y(){const ee={...p9e(e),pgHost:U?"":(w==null?void 0:w.pgHost)??"",pgPort:U?"":(w==null?void 0:w.pgPort)??""};try{sessionStorage.setItem(`mpa-create:${e}`,JSON.stringify({input:ee,step:0}))}catch{}l(ee),u(""),f(0),m(void 0),b(!1),y(null),j(""),N(!1),I.current=!1}return a.jsx(a.Fragment,{children:a.jsx(nv,{open:!0,onOpenChange:ee=>{!ee&&!S&&(A?N(!1):t())},children:a.jsxs(tv,{children:[a.jsx(J0,{className:"studio-modal-button__backdrop mpa-create-backdrop"}),a.jsx(ev,{className:"mpa-create-popup","aria-label":i(r("title")),children:a.jsx(u9e,{className:"mpa-create-dialog",title:i(r("title")),topGlow:!1,footer:null,onClose:()=>{S||t()},closeLabel:i(r("close")),children:a.jsxs("div",{className:"mpa-create-body",children:[a.jsx("ol",{className:"mpa-create-steps","aria-label":i(r("stepsLabel")),children:["basics","postgres","openviking"].map((ee,be)=>a.jsx("li",{"aria-current":d===be?"step":void 0,children:a.jsxs("button",{type:"button",disabled:S||be>d&&!g&&(!q||be===2&&!J),onClick:()=>f(be),children:[a.jsx("span",{children:be+1}),i(r(`steps.${ee==="postgres"&&U?"autoPostgres":ee}`))]})},ee))}),d===0&&a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[i(r("region")),":",e]}),a.jsxs("label",{children:[i(r("name")),a.jsx("input",{name:"name",placeholder:i(r("namePlaceholder")),value:o.name??o.agentId??"",maxLength:64,disabled:S||g,required:!0,autoComplete:"off","aria-invalid":!!z,"aria-describedby":"mpa-name-help",onChange:ee=>l({...o,name:ee.target.value})}),a.jsx("p",{id:"mpa-name-help",role:z?"alert":void 0,children:z||i(r("nameHelp"))})]}),a.jsxs("label",{children:[i(r("description")),a.jsx(EIe,{className:"mpa-create-description",value:o.description,maxLength:512,disabled:S||g,onChange:ee=>l({...o,description:ee.target.value})})]}),a.jsxs("section",{className:"mpa-create-plan","aria-label":i(r("plan")),children:[a.jsx("strong",{children:i(r("plan"))}),a.jsxs("ul",{children:[a.jsx("li",{children:i(r("sharedResources"))}),a.jsx("li",{children:i(r("agentResources"))}),a.jsx("li",{children:i(r("readiness"))})]})]})]}),d===1&&a.jsxs(a.Fragment,{children:[a.jsx("p",{children:i(r(U?"pgAutoDescription":(w==null?void 0:w.postgresLayout)==="split-workspaces"?"pgSplitDescription":"pgDescription"))}),a.jsx("a",{href:tYt,target:"_blank",rel:"noopener noreferrer",children:i(r("pgConsole"))}),!U&&a.jsxs(a.Fragment,{children:[a.jsxs("label",{children:[i(r("pgHost")),a.jsx("input",{name:"pgHost",value:o.pgHost??"",maxLength:255,disabled:S||g,"aria-invalid":!J,onChange:ee=>l(be=>({...be,pgHost:ee.target.value}))})]}),a.jsxs("label",{children:[i(r("pgPort")),a.jsx("input",{name:"pgPort",value:o.pgPort??"",inputMode:"numeric",maxLength:5,disabled:S||g,"aria-invalid":!J,onChange:ee=>l(be=>({...be,pgPort:ee.target.value}))})]}),!J&&a.jsx("p",{role:"alert",children:i(r("pgInvalid"))}),a.jsx("p",{children:i(r("pgCredentials"))})]})]}),d===2&&a.jsxs(a.Fragment,{children:[a.jsx("p",{children:i(r("openvikingDescription"))}),a.jsx("a",{href:nYt,target:"_blank",rel:"noopener noreferrer",children:i(r("openvikingConsole"))}),a.jsxs("label",{children:[i(r("openvikingUrl")),a.jsx("input",{name:"openvikingUrl",value:o.openvikingUrl??"",maxLength:1024,disabled:S||g,autoComplete:"off",spellCheck:!1,"aria-invalid":!V,onChange:ee=>l(be=>({...be,openvikingUrl:ee.target.value}))})]}),a.jsxs("label",{children:[i(r("openvikingResourceId")),a.jsx("input",{name:"openvikingResourceId",value:o.openvikingResourceId??"",maxLength:128,disabled:S||g,autoComplete:"off",spellCheck:!1,"aria-invalid":!V,onChange:ee=>l(be=>({...be,openvikingResourceId:ee.target.value}))})]}),a.jsxs("label",{children:[i(r("openvikingApiKey")),a.jsx("input",{type:"password",name:"openvikingApiKey",value:c,maxLength:512,disabled:S||F||(v==null?void 0:v.state)==="succeeded",autoComplete:"off",spellCheck:!1,onChange:ee=>u(ee.target.value)})]}),!V&&a.jsx("p",{role:"alert",children:i(r("openvikingInvalid"))}),a.jsx("p",{children:i(r("openvikingCredentials"))}),a.jsxs("fieldset",{className:"mpa-create-tos",children:[a.jsx("legend",{children:i(r("tosTitle"))}),a.jsx("p",{children:i(r("tosDescription"))}),["tosAccessKey","tosSecretKey","tosBucket"].map(ee=>a.jsxs("label",{children:[i(r(ee)),a.jsx("input",{name:ee,type:ee==="tosBucket"?"text":"password",value:o[ee]??"",maxLength:256,disabled:W,autoComplete:ee==="tosBucket"?"off":"new-password",spellCheck:!1,"aria-invalid":!ne,onChange:be=>l(ue=>({...ue,[ee]:be.target.value}))})]},ee)),!ne&&a.jsx("p",{role:"alert",children:i(r("tosInvalid"))}),a.jsx("p",{children:i(r("tosCredentials"))})]})]}),O?a.jsx("p",{role:"status",children:i(r("checking"))}):w!=null&&w.configured?a.jsx("p",{children:i(r("configured"))}):a.jsxs("div",{role:"alert",children:[a.jsx("p",{children:i(r("notConfigured"))}),a.jsx("p",{children:w!=null&&w.postgresMigrationRequired?i(r("pgMigrationRequired")):w==null?void 0:w.error}),a.jsx(Ki,{variant:"outline",onClick:()=>R(ee=>ee+1),children:i(r("reload"))})]}),v&&a.jsxs("section",{"aria-live":"polite",children:[a.jsx("strong",{children:i(r(`states.${v.state}`))}),v.state!=="succeeded"&&a.jsx("p",{children:i(r(`stages.${v.stage}`),{defaultValue:v.stage})}),v.state==="failed"||v.state==="cancelled"?a.jsx("p",{children:i(r(v.error||"creationFailed"))}):null,((X=v.result)==null?void 0:X.runtime_id)&&a.jsxs("p",{children:["Runtime ID:",v.result.runtime_id]}),((ie=v.result)==null?void 0:ie.skill_space_id)&&a.jsxs("p",{children:[i(r("skillSpace")),":",v.result.skill_space_id]})]}),U&&!J&&a.jsx("p",{role:"alert",children:i(r("pgModeChanged"))}),E&&a.jsx("p",{role:"alert",children:E}),F&&a.jsx("p",{children:i(r("background"))}),g&&a.jsx("p",{children:i(r("newAgentDescription"))}),A?a.jsxs("section",{role:"alertdialog","aria-label":i(r("cancel")),className:"mpa-create-plan",children:[a.jsx("p",{children:i(r("cancelDescription"))}),a.jsxs("div",{className:"mpa-create-actions",children:[a.jsx(Ki,{autoFocus:!0,variant:"outline",onClick:()=>N(!1),children:i(r("back"))}),a.jsx(Ki,{onClick:()=>void se(),children:i(r("confirmCancel"))})]})]}):a.jsxs("div",{className:"mpa-create-actions",children:[a.jsx(Ki,{variant:"outline",disabled:S,onClick:t,children:i(r("close"))}),g&&a.jsx(Ki,{variant:"outline",disabled:S||O,onClick:Y,children:i(r("newAgent"))}),d>0&&a.jsx(Ki,{variant:"outline",disabled:S,onClick:()=>f(ee=>ee-1),children:i(r("previousStep"))}),F?a.jsx(Ki,{variant:"outline",disabled:S||(v==null?void 0:v.state)==="cancelling",onClick:()=>N(!0),children:i(r("cancel"))}):(v==null?void 0:v.state)!=="succeeded"&&d<2?a.jsx(Ki,{disabled:S||d===0&&!q||d===1&&!J,onClick:()=>f(ee=>ee+1),children:i(r("next"))}):(v==null?void 0:v.state)!=="succeeded"?a.jsx(Ki,{loading:S,disabled:O||!(w!=null&&w.configured)||!q||!J||!V||!ne,onClick:()=>void H(),children:i(r(v?"retry":"submit"))}):null]})]})})})]})})})}const sYt=["general","mpa","codex","deepseek-harness","openclaw","hermes"];function aYt(e){return e!=="general"&&e!=="mpa"}const oYt=24,lYt=3e4,cYt=7e3,uYt=2e4,dYt=6,fYt=2,hYt=250,kg=new Map,Ew=new Map,pYt=new Set;function Zb(e){const t=e.runtime;return t?`${t.region}:${t.runtimeId}:${t.currentVersion??""}`:""}function Woe(e,t){const n=e instanceof Error&&e.message.trim()?e.message.trim():t("myAgents.compatibility.unknownError");return{status:e instanceof Sa&&e.unsupported?"unsupported":"error",message:n}}function Jm(e){if(!e){kg.clear(),Ew.clear(),W8();return}const t=new Set(e);if(t.size!==0){for(const[n,i]of Ew)i.page.runtimes.some(r=>t.has(r.runtimeId))&&Ew.delete(n);for(const n of t)W8(n);kg.clear()}}function mYt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function gYt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M8.313 3.646a.5.5 0 0 1 .707 0l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 1 1-.707-.708L11.46 8.5H3.333a.5.5 0 0 1 0-1h8.127L8.313 4.354a.5.5 0 0 1 0-.708Z",fill:"currentColor"})})}function bYt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M2.75 5.25h8.75m0 0-2-2m2 2-2 2M13.25 10.75H4.5m0 0 2 2m-2-2 2-2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function yYt({type:e}){return e==="general"||e==="mpa"?a.jsx(_p,{}):a.jsx(lA,{kind:e})}function vYt(e,t=Date.now(),n){const i=Date.parse(e);if(!Number.isFinite(i)||i-t<6e4)return n("myAgents.expiringSoon");const r=Math.ceil((i-t)/6e4),s=Math.floor(r/60),o=r%60;return n("myAgents.sandboxRemaining",{hours:s,minutes:o})}function Koe(e,t,n="general"){var r;const i=e.agentCategory??n;return{id:e.runtimeId,name:e.name,description:((r=e.description)==null?void 0:r.trim())||t("common.noDescription"),createdAt:e.createdAt??"",specificationLabel:t("myAgents.creator"),specification:GMe(e.author),isMine:e.isMine,agentCategory:i,runtime:{runtimeId:e.runtimeId,mpaInstanceId:e.mpaInstanceId,region:e.region,currentVersion:e.currentVersion,agentCategory:e.agentCategory??n,canDelete:e.canDelete,canManage:e.canManage,canPublish:e.canPublish,visibility:e.visibility,reviewStatus:e.reviewStatus}}}function xYt(e,t){const n=DD(e.status);return{id:e.id,name:e.displayName||t("myAgents.namedAgent",{name:e.toolName}),description:t(`myAgents.sandboxStatus.${n}`,{defaultValue:t("myAgents.sandboxStatus.unknown")}),createdAt:e.createdAt,specificationLabel:t("myAgents.creator"),specification:GMe(e.createdBy),isMine:e.isMine,region:e.region,sandbox:e}}function wYt(e,t){var n,i;return{id:e.id,name:e.draft.name||t("agentSelector.unnamedAgent"),description:((n=e.draft.description)==null?void 0:n.trim())||t("common.noDescription"),createdAt:new Date(e.updatedAt).toISOString(),specificationLabel:t("myAgents.storageLocation"),specification:t("myAgents.currentBrowser"),isMine:!0,region:(i=e.deploymentTarget)==null?void 0:i.region,draft:e}}function OYt(e,t,n){if(!e.draft)return e;const i=e.draft.deploymentTarget;return i?t.find(r=>{var s;return((s=r.runtime)==null?void 0:s.runtimeId)===i.runtimeId&&r.runtime.region===i.region})??{id:i.runtimeId,appName:i.appName,name:i.name||e.name,description:e.description,createdAt:e.createdAt,specificationLabel:n("myAgents.region"),specification:i.region,isMine:!0,runtime:{runtimeId:i.runtimeId,mpaInstanceId:i.mpaInstanceId,region:i.region,currentVersion:i.currentVersion,canDelete:!1}}:null}function kYt(e,t){return e.trim()||Zi(t)}async function SYt(e,t,n,i,r,s,o){const l=`${e}:${t}:${n}:${i}`,c=Ew.get(l);if(c&&c.expiresAt>Date.now())return r(c.page.runtimes.map(f=>Koe(f,s,e))),c.page.nextToken;c&&Ew.delete(l);let u=kg.get(l);u||(u=FXt({agentCategory:e,scope:t,region:n,pageSize:oYt,nextToken:i,signal:o}),kg.set(l,u),u.then(()=>kg.delete(l),()=>kg.delete(l)));const d=await u;return Ew.set(l,{page:d,expiresAt:Date.now()+lYt}),r(d.runtimes.map(f=>Koe(f,s,e))),d.nextToken}function EYt({agent:e,onReview:t,onUse:n,onViewDetails:i,onPrepareUpdate:r,compatibility:s,onRetryCompatibility:o,connecting:l,connectError:c,connected:u,deploymentTask:d,nowMs:f,onViewDeploymentTask:h,onEditDraft:m,onDeleteDraft:g}){var R,A,N,P;const{t:b,i18n:v}=Te("ui"),y=(R=e.sandbox)==null?void 0:R.status.toLowerCase(),w=((A=e.sandbox)==null?void 0:A.resourceType)==="snapshot",x=!!(e.runtime||y==="ready"||y==="wakeable"),O=(s==null?void 0:s.status)==="checking",k=(s==null?void 0:s.status)==="unsupported",S=(s==null?void 0:s.status)==="error",C=((N=e.sandbox)==null?void 0:N.resourceType)==="snapshot"?e.sandbox.sourceSessionId||e.sandbox.snapshotId:(P=e.sandbox)==null?void 0:P.id,E=()=>{if(e.draft){d?h==null||h(d):i==null||i(e);return}!x&&!e.sandbox||(d?h==null||h(d):i==null||i(e))},j=(e.draft||x||!!e.sandbox)&&!!(d?h:i),T=e.draft?d?b("myAgents.viewDeploymentProgress",{name:e.name}):b("myAgents.viewRuntimeDetails",{name:e.name}):d?b("myAgents.viewDeploymentProgress",{name:e.name}):b("myAgents.viewDetails",{name:e.name});return a.jsxs(vH,{className:`my-agent-card${l?" is-connecting":""}${e.runtime?" has-review":""}`,activateLabel:j?T:void 0,onActivate:j?E:void 0,onPointerEnter:()=>r==null?void 0:r(e),onFocusCapture:()=>r==null?void 0:r(e),footer:a.jsxs("div",{className:"my-agent-card-footer",children:[a.jsx(YIe,{className:"my-agent-meta",items:[{label:e.specificationLabel,value:e.specification,hideLabel:!0,className:"my-agent-region"},{label:b("myAgents.time"),value:PT(e.createdAt,f,v.resolvedLanguage??v.language),hideLabel:!0,className:"my-agent-created-at"},...e.sandbox?[{label:b("myAgents.remainingTime"),value:e.sandbox.resourceType==="snapshot"||e.sandbox.persistent?b("myAgents.neverExpires"):vYt(e.sandbox.expireAt,f,b),className:`my-agent-expiry${e.sandbox.resourceType==="snapshot"||e.sandbox.persistent?"":" is-expiring"}`}]:[]]}),e.runtime?a.jsxs("div",{className:"agent-review-card-controls",children:[a.jsx("span",{className:"agent-review-card-status",children:b(e.runtime.visibility==="enterprise"?"enterprise":"private",{ns:"agentReviews"})}),e.runtime.canManage?a.jsxs(EN,{className:"agent-review-card-action",onClick:I=>{I.stopPropagation(),t==null||t(e)},children:[b(e.runtime.reviewStatus?"details":e.runtime.canPublish?"publish":"submit",{ns:"agentReviews"}),e.runtime.reviewStatus?` · ${b(`status.${e.runtime.reviewStatus}`,{ns:"agentReviews"})}`:""]}):null]}):null]}),actions:e.draft?a.jsxs(a.Fragment,{children:[a.jsx(EN,{"aria-label":d?b("myAgents.viewDeploymentProgress",{name:e.name}):b("myAgents.editDraftNamed",{name:e.name}),onClick:()=>d?h==null?void 0:h(d):m==null?void 0:m(e.draft),children:b(d?"myAgents.viewProgress":"common.edit")}),a.jsx(EN,{tone:"danger","aria-label":b("myAgents.deleteDraftNamed",{name:e.name}),onClick:()=>g==null?void 0:g(e.draft),children:b("common.delete")})]}):S||k?a.jsxs(Tt,{type:"button",color:"primary",size:"sm",pill:!1,"aria-label":b("myAgents.recheckCompatibility",{name:e.name}),onClick:()=>o==null?void 0:o(e),children:[a.jsx(ZD,{}),b("common.retry")]}):a.jsx(MB,{className:u?"my-agent-use is-connected":"my-agent-use",disabled:!x||O||k||l||u,"aria-busy":l||void 0,label:u?b("myAgents.connectedNamed",{name:e.name}):w?b("myAgents.wakeAndChat",{name:e.name}):b("myAgents.chatWith",{name:e.name}),onClick:()=>void(n==null?void 0:n(e)),children:l?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"my-agent-use-spinner","aria-hidden":"true"}),a.jsx("span",{className:"sr-only",children:b(w?"myAgents.waking":"agentSelector.connecting")})]}):a.jsx(gYt,{})}),children:[a.jsx(xH,{leading:a.jsx(Jw,{seed:e.name}),title:e.name,subtitle:e.sandbox?a.jsx("span",{className:"my-agent-session-id",title:C,children:C}):void 0,status:e.draft?d?a.jsx("span",{className:"my-agent-deploying-badge",children:b("myAgents.deploying")}):a.jsx("span",{className:"my-agent-draft-badge",children:b("myAgents.draft")}):e.sandbox?a.jsx("span",{className:"my-agent-status-label","data-ready":DD(e.sandbox.status)==="ready"||void 0,children:e.description}):e.runtime&&d?a.jsx("span",{className:"my-agent-deploying-badge",children:b("myAgents.deploying")}):O?a.jsx(Ea,{content:s==null?void 0:s.message,contentClassName:"my-agent-compatibility-tooltip",maxWidth:360,align:"end",interactive:!0,preventUnintentionalClickToClose:!0,children:a.jsx("span",{className:"my-agent-compatibility-trigger",tabIndex:0,children:a.jsxs(Ya,{className:"my-agent-compatibility-status",color:"secondary",variant:"soft",size:"sm",pill:!0,children:[a.jsx("span",{className:"my-agent-compatibility-spinner","aria-hidden":"true"}),a.jsx("span",{children:b("myAgents.checking")})]})})}):k?a.jsx(Ea,{content:s==null?void 0:s.message,contentClassName:"my-agent-compatibility-tooltip",maxWidth:360,align:"end",interactive:!0,preventUnintentionalClickToClose:!0,children:a.jsx("span",{className:"my-agent-compatibility-trigger",tabIndex:0,children:a.jsx(Ya,{className:"my-agent-compatibility-status",color:"warning",variant:"soft",size:"sm",pill:!0,children:b("myAgents.chatUnsupported")})})}):S?a.jsx(Ea,{content:s==null?void 0:s.message,contentClassName:"my-agent-compatibility-tooltip",maxWidth:360,align:"end",interactive:!0,preventUnintentionalClickToClose:!0,children:a.jsx("span",{className:"my-agent-compatibility-trigger",tabIndex:0,children:a.jsx(Ya,{className:"my-agent-compatibility-status",color:"danger",variant:"soft",size:"sm",pill:!0,children:b("myAgents.checkFailed")})})}):null}),c?a.jsx(Ea,{content:c,contentClassName:"my-agent-error-tooltip",maxWidth:360,interactive:!0,children:a.jsx("p",{className:"my-agent-wake-note",role:"alert",tabIndex:0,children:c})}):null,w&&l?a.jsx("p",{className:"my-agent-wake-note",role:"status",children:a.jsx(hn,{children:b("myAgents.wakingHint")})}):null,e.sandbox?null:a.jsx(wH,{children:e.description})]})}function CYt({cloudProvider:e,studioRegion:t,canCreateRuntimeAgents:n,canCreatePersonalAgents:i,canUpdate:r,runtimeScope:s,onCreateAgent:o,onOpenCodexProjectUpload:l,onUseAgent:c,onViewAgentDetails:u,onCreateSandboxAgent:d,onUseSandboxAgent:f,onViewSandboxAgentDetails:h,activeType:m,onActiveTypeChange:g,sandboxRefreshKey:b=0,connectedRuntimeId:v="",hiddenRuntimeIds:y=pYt,drafts:w=[],deploymentTasks:x=[],draftDeploymentTaskIds:O={},onViewDeploymentTask:k,onEditDraft:S,onDeleteDraft:C}){const{t:E}=Te("ui"),j=p.useRef(null),T=p.useRef(null),R=p.useRef(0),A=p.useRef(null),N=p.useRef(0),P=p.useRef(null),I=p.useRef(new Map),D=kYt(t,e),[_,L]=p.useState(null),[F,M]=p.useState(""),[z,q]=p.useState(s==="mine"?"mine":"all"),[U,J]=p.useState(D),[V,Z]=p.useState(null),[ne,W]=p.useState([]),[G,H]=p.useState(""),[se,Y]=p.useState(!0),[X,ie]=p.useState(""),[ee,be]=p.useState([]),[ue,pe]=p.useState(!1),[ke,je]=p.useState(""),[Pe,Ee]=p.useState(""),[Qe,_e]=p.useState({}),[ae,le]=p.useState({}),[ge,Oe]=p.useState(null),[Se,qe]=p.useState(()=>Date.now()),Xe=p.useMemo(()=>sYt.map(He=>({value:He,label:E(`myAgents.agentTypes.${He}`)})),[E]),ye=p.useMemo(()=>{const He=Tu(e);return He.some(nt=>nt.value===D)?He:[{value:D,label:D},...He]},[e,D]);p.useEffect(()=>{s==="mine"&&q("mine")},[s]),p.useEffect(()=>{J(D)},[D]),p.useEffect(()=>{qe(Date.now());const He=window.setInterval(()=>qe(Date.now()),1e3);return()=>window.clearInterval(He)},[]);const we=p.useMemo(()=>w.map(He=>wYt(He,E)),[w,E]),Ae=p.useMemo(()=>{const He=new Map,nt=new Map,et=new Map;for(const ft of x){if(ft.status!=="running")continue;if(He.set(ft.id,ft),ft.draftId){const Ct=nt.get(ft.draftId);(!Ct||ft.startedAt>Ct.startedAt)&&nt.set(ft.draftId,ft)}if(!ft.runtimeId)continue;const St=et.get(ft.runtimeId);(!St||ft.startedAt>St.startedAt)&&et.set(ft.runtimeId,ft)}return{byId:He,byDraftId:nt,byRuntimeId:et}},[x]),Ve=p.useCallback(He=>{var et;if(He.draft){const ft=O[He.draft.id];return Ae.byDraftId.get(He.draft.id)??(ft?Ae.byId.get(ft):void 0)}const nt=(et=He.runtime)==null?void 0:et.runtimeId;return nt?Ae.byRuntimeId.get(nt):void 0},[Ae,O]),Be=p.useCallback((He,nt)=>{var Ct;(Ct=A.current)==null||Ct.abort(),kg.clear();const et=new AbortController;A.current=et;const ft=++R.current;return Y(!0),ie(""),SYt(m==="mpa"?"mpa":"general",z,U,He,It=>{R.current===ft&&W(Gt=>nt?It:[...Gt,...It])},E,et.signal).then(It=>{R.current===ft&&H(It)}).catch(It=>{R.current===ft&&(Hoe(It)||ie(Oy(It,E("myAgents.loadGeneralAgents"),"GET /web/runtimes")))}).finally(()=>{R.current===ft&&Y(!1),A.current===et&&(A.current=null)})},[m,z,U,E]);p.useEffect(()=>{if(!(m!=="general"&&m!=="mpa"))return W([]),H(""),Be("",!0),()=>{var He;(He=A.current)==null||He.abort(),A.current=null,kg.clear(),R.current+=1}},[m,Be]),p.useEffect(()=>{if(m!=="general"&&m!=="mpa"){for(const et of I.current.values())et.abort();I.current.clear();return}const He=new Set(ne.filter(et=>{var ft,St;return((ft=et.runtime)==null?void 0:ft.runtimeId)!==v&&((St=et.runtime)==null?void 0:St.region)===U}).map(Zb).filter(Boolean));for(const[et,ft]of I.current)He.has(et)||(ft.abort(),I.current.delete(et));const nt=ne.filter(et=>{var It,Gt,Ge;const ft=(It=et.runtime)==null?void 0:It.runtimeId;if(!ft||ft===v||((Gt=et.runtime)==null?void 0:Gt.region)!==U)return!1;const St=Zb(et),Ct=(Ge=ae[St])==null?void 0:Ge.status;return!I.current.has(St)&&(!Ct||Ct==="checking")});for(const et of nt)I.current.set(Zb(et),new AbortController);le(et=>{var Ct,It;let ft=!1;const St={...et};for(const Gt of ne){const Ge=Zb(Gt);if(!Ge)continue;const xt=((Ct=Gt.runtime)==null?void 0:Ct.runtimeId)===v;xt&&((It=St[Ge])==null?void 0:It.status)!=="compatible"?(St[Ge]={status:"compatible",message:E("myAgents.compatibility.supported")},ft=!0):!xt&&!St[Ge]&&(St[Ge]={status:"checking",message:E("myAgents.compatibility.checking")},ft=!0)}return ft?St:et}),BXt(nt,async et=>{const ft=et.runtime;if(!ft)return;const St=Zb(et),Ct=I.current.get(St);if(Ct)try{const It=await Hw(ft.runtimeId,ft.region,{signal:Ct.signal,preferCached:!0,timeoutMs:cYt,currentVersion:ft.currentVersion});if(Ct.signal.aborted)return;le(Gt=>({...Gt,[St]:It&&It.length>0?{status:"compatible",message:E("myAgents.compatibility.supported")}:{status:"unsupported",message:E("myAgents.compatibility.empty")}}))}catch(It){if(Ct.signal.aborted||(It==null?void 0:It.name)==="AbortError")return;le(Gt=>({...Gt,[St]:Woe(It,E)}))}finally{I.current.get(St)===Ct&&I.current.delete(St)}})},[m,v,U,ne,E]),p.useEffect(()=>()=>{var He;(He=A.current)==null||He.abort();for(const nt of I.current.values())nt.abort();I.current.clear()},[]);const _t=p.useCallback(async He=>{var ft;(ft=P.current)==null||ft.abort();const nt=new AbortController;P.current=nt;const et=++N.current;pe(!0),je(""),be([]);try{const St=He==="codex"?await Ur.listSessions({signal:nt.signal,autoResumeSnapshots:!1}):await Ur.listAgentSessions(He,{signal:nt.signal,autoResumeSnapshots:!1});if(N.current!==et)return;be(St.map(Ct=>xYt(Ct,E)))}catch(St){if((St==null?void 0:St.name)==="AbortError"||N.current!==et)return;je(Oy(St,E("myAgents.loadAgentType",{type:E(`myAgents.agentTypes.${He}`)}),`GET /web/${He==="codex"?"sandbox":He}/sessions`))}finally{P.current===nt&&(P.current=null),N.current===et&&pe(!1)}},[E]);function Pt(He){var nt;He!==m&&(He==="general"||He==="mpa"?(R.current+=1,W([]),H(""),ie(""),Y(!0)):((nt=P.current)==null||nt.abort(),P.current=null,N.current+=1,be([]),je(""),pe(!0)),g(He))}function Kt(){m!=="general"&&m!=="mpa"||(R.current+=1,W([]),H(""),ie(""),Y(!0))}function Et(He){He!==z&&(Kt(),q(He))}function vt(He){He!==U&&(Kt(),J(He))}p.useEffect(()=>{var He;if(m==="general"||m==="mpa"){(He=P.current)==null||He.abort(),P.current=null,N.current+=1;return}return _t(m),()=>{var nt;(nt=P.current)==null||nt.abort(),P.current=null,N.current+=1}},[m,_t,b]),p.useEffect(()=>{const He=T.current,nt=j.current;if(!He||!nt||m!=="general"&&m!=="mpa"||!G||se)return;const et=new IntersectionObserver(([ft])=>{ft.isIntersecting&&Be(G,!1)},{root:nt,rootMargin:"240px 0px",threshold:.01});return et.observe(He),()=>et.disconnect()},[m,Be,se,G]);const tt=p.useCallback(async He=>{if(!Pe){Ee(He.id),_e(nt=>({...nt,[He.id]:""}));try{await new Promise(nt=>requestAnimationFrame(()=>nt())),He.sandbox?await f(He.sandbox):await c(He)}catch(nt){_e(et=>({...et,[He.id]:nt instanceof Error?nt.message:String(nt)}))}finally{Ee("")}}},[Pe,c,f]),mt=p.useCallback(async He=>{var St;const nt=He.runtime;if(!nt)return;const et=Zb(He);le(Ct=>({...Ct,[et]:{status:"checking",message:E("myAgents.compatibility.checking")}})),(St=I.current.get(et))==null||St.abort();const ft=new AbortController;I.current.set(et,ft);try{const Ct=await c9e(()=>Hw(nt.runtimeId,nt.region,{retryProbe:!0,signal:ft.signal,timeoutMs:uYt,currentVersion:nt.currentVersion}));if(ft.signal.aborted)return;le(It=>({...It,[et]:Ct&&Ct.length>0?{status:"compatible",message:E("myAgents.compatibility.supported")}:{status:"unsupported",message:E("myAgents.compatibility.empty")}}))}catch(Ct){if(ft.signal.aborted||Hoe(Ct))return;le(It=>({...It,[et]:Woe(Ct,E)}))}finally{I.current.get(et)===ft&&I.current.delete(et)}},[E]),Ne=p.useCallback(He=>{const nt=He.runtime;!r||!nt||Ve(He)||q8({runtimeId:nt.runtimeId,region:nt.region,appName:He.appName,currentVersion:nt.currentVersion})},[r,Ve]),wt=p.useMemo(()=>{const He=F.trim().toLocaleLowerCase(),nt=m==="general"||m==="mpa"?[...we,...ne]:ee,ft=(z==="mine"?nt.filter(Gt=>Gt.isMine):nt).filter(Gt=>{var xt;const Ge=((xt=Gt.runtime)==null?void 0:xt.region)??Gt.region;return!Ge||Ge===U}),St=He?ft.filter(Gt=>Gt.name.toLocaleLowerCase().includes(He)):ft;if(m!=="general"&&m!=="mpa")return St;const Ct=y.size>0?St.filter(Gt=>!Gt.runtime||!y.has(Gt.runtime.runtimeId)):St,It=Ct.findIndex(Gt=>{var Ge;return((Ge=Gt.runtime)==null?void 0:Ge.runtimeId)===v});return It<=0?Ct:[Ct[It],...Ct.slice(0,It),...Ct.slice(It+1)]},[m,v,we,y,F,z,U,ne,ee]);p.useEffect(()=>{if(!r||m!=="general"&&m!=="mpa")return;const He=wt.filter(Ct=>!!Ct.runtime).filter(Ct=>!Ve(Ct)).slice(0,dYt);if(He.length===0)return;let nt=!1,et=0;const ft=async()=>{for(;!nt;){const Ct=He[et];if(et+=1,!(Ct!=null&&Ct.runtime)||(await q8({runtimeId:Ct.runtime.runtimeId,region:Ct.runtime.region,appName:Ct.appName,currentVersion:Ct.runtime.currentVersion}),nt))return}},St=window.setTimeout(()=>{for(let Ct=0;Ct{nt=!0,window.clearTimeout(St)}},[m,r,Ve,wt]);const jt=E(`myAgents.agentTypes.${m}`,{defaultValue:E("myAgents.agent")}),Yt=m==="general"||m==="mpa"?se&&ne.length===0&&we.length===0:ue&&ee.length===0,wn=!Yt&&wt.length===0;let We;m==="general"&&n?We=()=>o(U,"general"):m==="mpa"&&n&&e==="volcengine"?We=()=>Z(U):aYt(m)&&i&&(We=()=>d(m));const kt=m==="codex"&&i&&!!l;return a.jsxs(Oh,{className:"my-agents-page","aria-label":E("myAgents.agent"),children:[a.jsx(z0,{title:E("myAgents.agent"),className:"my-agents-header"}),a.jsxs(ab,{className:"my-agent-toolbar",children:[a.jsx(ob,{idPrefix:"my-agent-ownership",ariaLabel:E("myAgents.creatorFilter"),value:z,items:[{id:"all",label:E("common.all"),disabled:s==="mine"},{id:"mine",label:E("agentSelector.createdByMe")}],onChange:Et}),a.jsxs("div",{className:"resource-toolbar__actions",children:[a.jsx(lb,{id:"my-agent-type-filter",ariaLabel:E("myAgents.agentType"),value:m,options:Xe,onChange:Pt}),a.jsx(lb,{id:"my-agent-region-filter",ariaLabel:E("myAgents.region"),value:U,options:ye,onChange:vt}),a.jsx(em,{className:"my-agent-search","aria-label":E("myAgents.searchAgents"),value:F,onChange:He=>M(He.target.value),placeholder:E("common.search")}),kt?a.jsxs("button",{type:"button",className:"my-agent-create-secondary",onClick:l,children:[a.jsx(bYt,{}),a.jsx("span",{children:E("myAgents.handoff")})]}):null]})]}),a.jsxs(tm,{className:"my-agent-results",ref:j,"aria-label":E("myAgents.agentList",{type:jt}),children:[Yt?a.jsx(cl,{}):(m==="general"||m==="mpa"?X:ke)&&wt.length===0?a.jsxs("div",{className:"my-agent-empty",role:"alert",children:[a.jsx("p",{children:m==="general"||m==="mpa"?X:ke}),a.jsx("button",{type:"button",onClick:()=>{m==="general"||m==="mpa"?Be("",!0):_t(m)},children:E("common.reload")})]}):wn&&!We?F.trim()||z==="mine"||U!==D?a.jsx("div",{className:"my-agent-empty-message",children:a.jsxs(Hn,{fill:"none",children:[a.jsx(Hn.Icon,{children:a.jsx(rat,{})}),a.jsx(Hn.Title,{children:E("myAgents.noMatchingAgents")}),a.jsx(Hn.Description,{children:E("myAgents.adjustSearch")})]})}):m!=="general"?a.jsx("div",{className:"my-agent-empty-message",children:a.jsxs(Hn,{fill:"none",children:[a.jsx(Hn.Icon,{children:a.jsx(yYt,{type:m})}),a.jsx(Hn.Title,{className:"my-agent-sandbox-empty-title",children:E("myAgents.noAgentType",{type:jt})})]})}):a.jsx("div",{className:"my-agent-empty-message",children:a.jsxs(Hn,{fill:"none",children:[a.jsx(Hn.Icon,{children:a.jsx(_p,{})}),a.jsx(Hn.Title,{children:E("myAgents.noGeneralAgents")}),a.jsx(Hn.Description,{children:E("myAgents.createGeneralAgentDescription")})]})}):a.jsxs(a.Fragment,{children:[(m==="general"||m==="mpa")&&X?a.jsxs("div",{className:"my-agent-inline-error",role:"alert",children:[a.jsx("span",{children:X}),a.jsx("button",{type:"button",onClick:()=>void Be("",!0),children:E("common.reload")})]}):null,a.jsxs(V0,{className:"my-agent-grid",children:[We?a.jsx(cb,{className:"my-agent-create-card","aria-label":E("myAgents.createAgentType",{type:jt}),onClick:We,icon:a.jsx(mYt,{}),children:E(m==="mpa"?"myAgents.mpaCreate.title":"myAgents.createAgent")}):null,wt.map(He=>{var et,ft,St,Ct,It;const nt=OYt(He,ne,E);return a.jsx(EYt,{agent:He,onReview:L,deploymentTask:Ve(He),nowMs:Se,onViewDeploymentTask:k,onUse:tt,compatibility:He.runtime?ae[Zb(He)]??{status:"checking",message:E("myAgents.compatibility.checking")}:void 0,onRetryCompatibility:mt,onPrepareUpdate:((et=He.runtime)==null?void 0:et.canManage)===!1||((ft=He.runtime)==null?void 0:ft.visibility)==="enterprise"||((St=He.runtime)==null?void 0:St.reviewStatus)==="pending"?void 0:Ne,onViewDetails:nt&&((Ct=He.runtime)==null?void 0:Ct.canManage)!==!1?()=>{nt.sandbox?h(nt.sandbox):u(nt)}:void 0,connecting:He.id===Pe,connectError:Qe[He.id],connected:((It=He.runtime)==null?void 0:It.runtimeId)===v,onEditDraft:S,onDeleteDraft:Oe},He.id)})]})]}),(m==="general"||m==="mpa")&&!X&&!Yt&&(wt.length>0||!!G)&&a.jsx("div",{className:"my-agent-load-more",ref:T,"aria-live":"polite",children:se?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),a.jsx("span",{children:E("myAgents.loadingMore")})]}):G?a.jsx("span",{children:E("myAgents.scrollForMore")}):a.jsx("span",{children:E("myAgents.allLoaded")})})]}),V&&a.jsx(rYt,{region:V,onClose:()=>Z(null),onCreated:()=>{Jm(),U===V&&m==="mpa"&&Be("",!0)}},V),_!=null&&_.runtime?a.jsx(l9e,{runtimeId:_.runtime.runtimeId,region:_.runtime.region,name:_.name,canPublish:_.runtime.canPublish===!0,onClose:()=>L(null),onChanged:()=>{Jm(),Be("",!0)}},`${_.runtime.region}:${_.runtime.runtimeId}`):null,ge?a.jsx(Ad,{title:E("myAgents.deleteDraftTitle"),description:E("myAgents.deleteDraftDescription",{name:ge.draft.name||E("agentSelector.unnamedAgent")}),confirmLabel:E("myAgents.deleteDraft"),variant:"danger",onCancel:()=>Oe(null),onConfirm:()=>{C==null||C(ge),Oe(null)}}):null]})}function gK({section:e,onWorkspace:t,onEnvironment:n,onProjects:i,actions:r,children:s,className:o=""}){const{t:l}=Te("ui"),c=l(e==="workspaces"?"workspace.title":e==="environments"?"common.environment":"workspace.codeProjects");return a.jsxs(Oh,{className:`workspace-center ${o}`,"aria-label":c,children:[a.jsx(z0,{title:c}),a.jsxs(ab,{children:[(t||n)&&a.jsx(ob,{items:[{id:"workspaces",label:l("workspace.title")},{id:"environments",label:l("common.environment")},...i?[{id:"projects",label:l("workspace.codeProjects")}]:[]],value:e,onChange:u=>{u==="workspaces"&&(t==null||t()),u==="environments"&&(n==null||n()),u==="projects"&&(i==null||i())},ariaLabel:l("workspace.resourceType"),idPrefix:"workspace-center"}),a.jsx("div",{className:"resource-toolbar__actions",children:r})]}),s]})}const AYt="_Container_13560_1",TYt="_Textarea_13560_174",Goe={Container:AYt,Textarea:TYt},xb=e=>{const t=p.useRef(null),i=`search-ui-input-${p.useId()}`,{id:r,name:s,variant:o="outline",size:l="md",gutterSize:c,className:u,autoComplete:d,disabled:f=!1,readOnly:h=!1,invalid:m=!1,allowAutofillExtensions:g=!!s,onFocus:b,onBlur:v,onAnimationStart:y,onAutofill:w,autoSelect:x,rows:O=3,maxRows:k,autoResize:S,ref:C,onChange:E,...j}=e,[T,R]=p.useState(!1),A=S?Math.max(k??10,O):O;p.useEffect(()=>{var I;x&&((I=t.current)==null||I.select())},[x]);const N=I=>{y==null||y(I),I.animationName==="native-autofill-in"&&(w==null||w())},P=p.useCallback(()=>{if(!S||!t.current||A===void 0)return;t.current.style.height="0px";const I=t.current.scrollHeight;t.current.style.height=I+"px"},[S,A]);return p.useEffect(()=>{P()},[e.value,O,P]),a.jsx("div",{className:Qi(Goe.Container,u),"data-variant":o,"data-size":l,"data-gutter-size":c,"data-focused":T,"data-disabled":f?"":void 0,"data-readonly":h?"":void 0,"data-invalid":m?"":void 0,style:B0({"textarea-min-rows":`${O}`,"textarea-max-rows":`${A}`}),children:a.jsx("textarea",{...j,onChange:I=>{E==null||E(I),P()},ref:GA([t,C]),id:r||(g?void 0:i),className:Goe.Textarea,name:s,readOnly:h,disabled:f,rows:O,onFocus:I=>{R(!0),b==null||b(I)},onBlur:I=>{R(!1),v==null||v(I)},onAnimationStart:N,"data-lpignore":g?void 0:!0,"data-1p-ignore":g?void 0:!0})})},IL="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2048%2048'%3e%3cimage%20width='48'%20height='48'%20href='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAMKADAAQAAAABAAAAMAAAAADbN2wMAAAH7UlEQVRoBdVZWWwbVRQ9492Onc1xTfaWLukq9oSqLKnYBZRSNgn6AagsAgmJRfzxg4SEEDtiER8IBKKAChK0FS1tKYWW0lZQKKV0gxCVJm3ikDiO17EdzrUzSdw4jj1OpeQqNzO237vvnHfvu/e9GWVwcBBDYue1mrqE2kI1UqeSJAnmIHUzNUCNUmGiKtQy6oPUR6geqnw/FSVOUH9R36KupfaDHnBQn6MGqEnqVJcEAfZTBbNL4b+lZPI1VbwwnaSfYO8z8N+TVMd0Qj6EVdbs3eIBP29cVFkL00kk+wSEwHAamgh9bDAJSQWTITZFnF+85J1tBPyOUC9OqqnsVdTIRkVBi70Msy125uriHJ8XAXFRfzKBTQM+rO0/hc54cSQE8iyzAx/XLcEltjIU44uCQijOaHvPfxIv97TjWCzEcMo7+sZ4TGa+2V6KT2rPQ73ZptsPBZE30fVrymvxTvUCtDoqYC0ijhMk/3MkgDd62xFheOqVggjIIAbOVaujEh/ULsaNzioUsxhVAv/A34GD0YBubxZMQJupWpMNr58zHytcHth1ekICsDcRx4u+fxBK6vOCbgKyEIXEK975WOmaoZuErKv1QR8ORQd0eUE3Ac0TNSYrXvI24fZSLxwGfebiDKW3e08gln9J0oYvKoMNG6kmiRdmzMOtTi8sOsJJJfANA93oiseGbeZ7k1EHZAKCEcApu4wCxUsSz3rm4HQiim3B/wpOsBJA2yP/4cZIJYIBFcGwCjWeSKEwm4wosZtR7rKizGXJQJZRB1TuttftAprnAbOrM9rl9UHqwg+s1o+eOow/GNN5CaPOklSgdKq4us+Ji7pt6Dw1AF9vBOGImjJht5lRVWFDY7UL58/3wOt2YPEcN2xWVpPRe6EQC+y9rwINPNKsuRaYX5cXhIxGkks+Y7V+6vQRdLBi5yx1bGwicFebivj+ARgOhZGMJMFyQyWpoV2GRIa2ZXOX2bDyqnPxzEPNKC+1Zj957eDBTbz34PXAwvoMfBN+kGV8Bxf00VgQz/vaEB6nSCnRQVj2h2DZG4TyZwQWlSils3m8RDDEhk2uaqlHaYklVb3Ha42dh4B3eMzZ//eEmMc0kGL3cEU9WksqU4XvzAYKZ9n6fQCOz3thORCGkhgCf2bDMz4bjQpW39yE65Y1QO5FxiUgP+76E3hzI7D1VyBcwP5NTFcZzXjaPRMNZmvGPkfA23YMwLHRD0Mf3ZwTgaBIi8GgYMGsSjx2z3kEP9Jp5E5rOeoqQH75C3htPfDpD4CskXxFvHC5vQKPVjSwPqQfcKTAfxuA/Ws/lBAXwEhUTGjWSAL3r1qYykSju+UkIFbZDx09wPvb0iH1W9uEYw03MHAV3ltew1CqgDkyCNtWgt/cnwY/3GriG5n9hbMrccNljRmzLz0nJCCNJBsEwsCH24E3NgDr96brhfyWS2Sm3EYLVsOL0i0DsG8h+LDkqcLExHhfc9siVDDrjJ59sZJRyHKZFRKybiSkTtIjR08CrXwEdtGcXL2A4+192LOuDeatfqg6wMvsL5lbhWuWysIdO995E9BgSkh19THX7wQOtANXLgKWLQSaarUWI9dNP7bjo68OY9uef6GqhcW8ZkViX2a/nBWYQ4+RggmIBfFGnHgOcD0c7wD2HgOW0xuXk0xN5SDaOwL4cnsb1m05joPHejKK0hgEOb4Q8Muba3H1pXUwZZl96aqLgHSU2RCbEe6/9hzh875OYPdhYF5NDLt/Oohd+46gNxBjm2zzJhZyi/RyV5TggdsvRJnTOm5j3QQ0i9ra6OHj1u9+B/YdNcLXVQdDmYNPy9oZ971IcIPHjUHadVrHHFfZNphtTtx508W4eJEHsg7Gk6IJaIZlDEn3EdUEl7sBg4la2MtqkYgNIOz/F9FgF6IhX6p5mozcjgbGasw/xWCCs7IeN7U24b4VddwZj26jjTZynTQCmknxSBqIETanh7ceWEpmpIiokT7E6JFosBvxaD/iJCeNDQYzTFYnzHY3SsobmfM9eOyucjTO0KyOf510AqOHkl2kiMlSQoAlsPLAk4hHSCaIJMMqmUgfYBQeggxGK4xmOxprXHh8lYK51em+E/0/qwQyBh8iY+Q52pjlOZD8XFcFPHELcGlT3stlbBaymtOROTReBoZJ+0DjZ9pv4SFq9fL0YWqcjJl1+AwP8OSGS+amq6y4P/fyyWqvoC9lDAG7ainPEJcBs7xMBGOLbU6bGQTMJHAnDUlG2biPFZevEM4GCZl9sSsnPgG+bAHfa+l8vZJxpNSo+oPp/c4XP6bPBN0kog2qtdFz1WzIkfXmZuAKVm6JewlbvZKVgGZMilMPwW9ngdr5B3CEG7iEbCY5ffl6RgPtYDGdybS4ogW4YDbgLefTD5s2kv5rTgKaWdlKi1fau4BDJ3jM5I70NDd0J7grzfZEUMg5CM5Tmg4TiW3ZtVYxTKpcgM2iWS7+mhcBbRiZ/TBTd4jPjtSEVF3AxxdUPgkxTrUUMTcBykKUmLZwhQlYPhWBeCBV5DRjk3QtiEC2McUDsjPVCEhWEQ8Umk2y2c7nOyEwrV/ySdbdQo3nw3aKtRHM3wiBtVQu02knISJ+SQh8Q32TyqTJJ6xTXyQzyzb2LeoBWQOy5pjwcDf1YSqzNIooLex99kTCppsq4N+l+oUArylhoku9sb+O18VU8c5UEiZu7KGyrKKTmgr7/wGxhy03aZIycwAAAABJRU5ErkJggg=='%20/%3e%3c/svg%3e",_Yt="data:image/svg+xml,%3c?xml%20version='1.0'?%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20100%20100'%3e%3ctitle%3ePandoc%20Icon%3c/title%3e%3cdesc%20property='dc:creator'%3eAlbert%20Krewinkel%3c/desc%3e%3cmetadata%20id='license'%20xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23'%20xmlns:dc='http://purl.org/dc/elements/1.1/'%20xmlns:cc='http://creativecommons.org/ns%23'%3e%3crdf:RDF%3e%3ccc:Work%20rdf:about=''%3e%3cdc:format%3eimage/svg+xml%3c/dc:format%3e%3cdc:type%20rdf:resource='http://purl.org/dc/dcmitype/StillImage'%20/%3e%3ccc:license%20rdf:resource='http://creativecommons.org/licenses/by-sa/4.0/'%20/%3e%3c/cc:Work%3e%3ccc:License%20rdf:about='http://creativecommons.org/licenses/by-sa/4.0/'%3e%3ccc:permits%20rdf:resource='http://creativecommons.org/ns%23Reproduction'%20/%3e%3ccc:permits%20rdf:resource='http://creativecommons.org/ns%23Distribution'%20/%3e%3ccc:requires%20rdf:resource='http://creativecommons.org/ns%23Notice'%20/%3e%3ccc:requires%20rdf:resource='http://creativecommons.org/ns%23Attribution'%20/%3e%3ccc:permits%20rdf:resource='http://creativecommons.org/ns%23DerivativeWorks'%20/%3e%3ccc:requires%20rdf:resource='http://creativecommons.org/ns%23ShareAlike'%20/%3e%3c/cc:License%3e%3c/rdf:RDF%3e%3c/metadata%3e%3crect%20fill='%23fed'%20stroke='%23fed'%20width='100'%20height='100'/%3e%3cg%20fill='none'%20stroke='%234093da'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='8'%20transform='skewX(-6)%20translate(8%201)'%3e%3cpath%20d='M%2030,10%20l%200,80%20M%2045,10%20l%200,80%20M%2020,10%20l%2040,0%20l%2018,18%20l%200,25%20l%20-33,0'%20/%3e%3cpath%20fill='%234093da'%20stroke-width='6'%20d='M%2061,10%20l%2017,17%20l%20-17,0%20l%200,-17'%20/%3e%3c/g%3e%3c/svg%3e",jYt="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%20100%20100'%20version='1.1'%20id='svg4'%20sodipodi:docname='favicon.svg'%20inkscape:version='1.4.4%20(dcaf3e7,%202026-05-05)'%20xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape'%20xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:svg='http://www.w3.org/2000/svg'%3e%3csodipodi:namedview%20id='namedview4'%20pagecolor='%23ffffff'%20bordercolor='%23000000'%20borderopacity='0.25'%20inkscape:showpageshadow='2'%20inkscape:pageopacity='0.0'%20inkscape:pagecheckerboard='0'%20inkscape:deskcolor='%23d1d1d1'%20showgrid='true'%20inkscape:zoom='8.2236519'%20inkscape:cx='34.534536'%20inkscape:cy='45.174577'%20inkscape:window-width='1881'%20inkscape:window-height='1382'%20inkscape:window-x='1512'%20inkscape:window-y='30'%20inkscape:window-maximized='0'%20inkscape:current-layer='svg4'%3e%3cinkscape:grid%20type='axonomgrid'%20id='grid4'%20units='px'%20originx='0'%20originy='0'%20spacingx='3.7795276'%20spacingy='3.7795276'%20empcolor='%230099e5'%20empopacity='0.30196078'%20color='%230099e5'%20opacity='0.14901961'%20empspacing='0'%20dotted='false'%20gridanglex='40'%20gridanglez='40'%20enabled='true'%20visible='true'%20/%3e%3c/sodipodi:namedview%3e%3cdefs%20id='defs1'%3e%3cfilter%20id='shadow'%20x='0'%20y='0'%20width='1'%20height='1'%3e%3cfeDropShadow%20dx='0'%20dy='2'%20stdDeviation='3'%20flood-color='rgba(50,%2050,%2093,%200.18)'%20/%3e%3c/filter%3e%3c/defs%3e%3crect%20x='4'%20y='4'%20width='92'%20height='92'%20rx='22.08'%20fill='%23e8efff'%20filter='url(%23shadow)'%20id='rect1'%20transform='matrix(1.0869565,0,0,1.0869565,-4.347826,-4.347826)'%20style='stroke-width:0.92'%20ry='22.08'%20/%3e%3cpath%20style='fill:%230a2540;fill-opacity:1;stroke-width:1.88976'%20d='M%2049.999999,6.535431%204.9573423,44.330708%2049.999999,82.125984%2092.790523,46.220471%2095.042656,44.330708%20Z'%20id='path1'%20/%3e%3cpath%20style='fill:%23425466;fill-opacity:1;stroke-width:1.88976'%20d='M%204.9573423,44.330708%20V%2055.669291%20L%2049.999999,93.464567%20V%2082.125984%20Z'%20id='path2'%20/%3e%3cpath%20style='fill:%231a3550;fill-opacity:1;stroke-width:1.88976'%20d='M%2049.999999,82.125984%2095.042656,44.330708%20V%2055.669291%20L%2049.999999,93.464567%20Z'%20id='path3'%20/%3e%3cpath%20style='fill:%234ade80;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;fill-opacity:1'%20d='m%2045.042657,30.236221%209.008531,-7.559055%2022.521328,18.897638%20-9.008531,7.559056%20z'%20id='path5'%20/%3e%3cpath%20style='fill:none;fill-opacity:1;stroke:%234ade80;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1'%20d='M%2027.025594,49.133859%2047.29479,47.244096%2045.042657,64.25197'%20id='path6'%20/%3e%3c/svg%3e",NYt="data:image/svg+xml,%3csvg%20fill='%23261230'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eAstral%3c/title%3e%3cpath%20d='M1.44%200C.6422%200%200%20.6422%200%201.44v21.12C0%2023.3578.6422%2024%201.44%2024h21.12c.7978%200%201.44-.6422%201.44-1.44V1.44C24%20.6422%2023.3578%200%2022.56%200Zm4.7998%204.8h11.5199c.7953%200%201.44.6447%201.44%201.44V19.2h-6.624v-4.32h-1.152v4.32H4.8V6.24c0-.7953.6446-1.44%201.4398-1.44m4.032%205.472v1.152h3.456v-1.152z'/%3e%3c/svg%3e",RYt="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='1.34em'%20height='1em'%20viewBox='0%200%20256%20192'%3e%3cpath%20fill='%232d4552'%20d='M84.38%20108.352c-9.556%202.712-15.826%207.467-19.956%2012.218c3.956-3.461%209.255-6.639%2016.402-8.665c7.311-2.072%2013.548-2.057%2018.702-1.062v-4.03c-4.397-.402-9.437-.082-15.148%201.539M63.987%2074.475l-35.49%209.35s.646.914%201.844%202.133l30.092-7.93s-.427%205.495-4.13%2010.41c7.005-5.299%207.684-13.963%207.684-13.963m29.709%2083.41c-49.946%2013.452-76.37-44.43-84.37-74.472c-3.696-13.868-5.31-24.37-5.74-31.148a11.5%2011.5%200%200%201%20.025-1.84C1.021%2050.58-.22%2051.927.032%2055.82c.43%206.773%202.044%2017.275%205.74%2031.147c7.997%2030.038%2034.424%2087.92%2084.37%2074.468c10.871-2.929%2019.038-8.263%2025.17-15.073c-5.652%205.104-12.724%209.123-21.616%2011.523M103.08%2039.05v3.555h19.59c-.401-1.259-.806-2.393-1.208-3.555z'/%3e%3cpath%20fill='%232d4552'%20d='M127.05%2068.325c8.81%202.503%2013.47%208.68%2015.933%2014.146l9.824%202.79s-1.34-19.132-18.645-24.047c-16.189-4.6-26.151%208.995-27.363%2010.754c4.71-3.355%2011.586-6.102%2020.251-3.643m78.197%2014.234c-16.204-4.62-26.162%209.003-27.356%2010.737c4.713-3.351%2011.586-6.099%2020.247-3.629c8.797%202.506%2013.452%208.676%2015.923%2014.146l9.837%202.8s-1.361-19.135-18.651-24.054m-9.76%2050.443l-81.718-22.845s.885%204.485%204.279%2010.293l68.803%2019.234c5.664-3.277%208.636-6.682%208.636-6.682m-56.655%2049.174C74.127%20164.828%2081.949%2082.386%2092.419%2043.32c4.311-16.1%208.743-28.066%2012.419-36.088c-2.193-.451-4.01.704-5.804%204.354C95.13%2019.5%2090.14%2032.387%2085.312%2050.427c-10.467%2039.066-18.29%20121.506%2046.412%20138.854c30.497%208.17%2054.256-4.247%2071.966-23.749c-16.81%2015.226-38.274%2023.763-64.858%2016.644'/%3e%3cpath%20fill='%23e2574c'%20d='M103.081%20138.565v-16.637l-46.223%2013.108s3.415-19.846%2027.522-26.684c7.311-2.072%2013.549-2.058%2018.701-1.063V39.05h23.145c-2.52-7.787-4.958-13.782-7.006-17.948c-3.387-6.895-6.859-2.324-14.741%204.269c-5.552%204.638-19.583%2014.533-40.698%2020.222c-21.114%205.694-38.185%204.184-45.307%202.95c-10.097-1.742-15.378-3.96-14.884%203.721c.43%206.774%202.043%2017.277%205.74%2031.148c7.996%2030.039%2034.424%2087.92%2084.37%2074.468c13.046-3.515%2022.254-10.464%2028.637-19.32h-19.256zm-74.588-54.74l35.494-9.35s-1.034%2013.654-14.34%2017.162c-13.31%203.504-21.154-7.812-21.154-7.812'/%3e%3cpath%20fill='%232ead33'%20d='M236.664%2039.84c-9.226%201.617-31.361%203.632-58.716-3.7c-27.363-7.328-45.517-20.144-52.71-26.168c-10.197-8.54-14.682-14.476-19.096-5.498c-3.902%207.918-8.893%2020.805-13.723%2038.846c-10.466%2039.066-18.289%20121.505%2046.413%20138.853c64.687%2017.333%2099.126-57.978%20109.593-97.047c4.83-18.037%206.948-31.695%207.53-40.502c.665-9.976-6.187-7.08-19.29-4.784M106.668%2072.161s10.196-15.859%2027.49-10.943c17.305%204.915%2018.645%2024.046%2018.645%2024.046zm42.215%2071.163c-30.419-8.91-35.11-33.167-35.11-33.167l81.714%2022.846c0-.004-16.494%2019.12-46.604%2010.32m28.89-49.85s10.183-15.847%2027.474-10.918c17.29%204.923%2018.651%2024.054%2018.651%2024.054z'/%3e%3cpath%20fill='%23d65348'%20d='m86.928%20126.51l-30.07%208.522s3.266-18.609%2025.418-25.983L65.25%2045.147l-1.471.447c-21.115%205.694-38.185%204.184-45.307%202.95c-10.097-1.741-15.379-3.96-14.885%203.722c.43%206.774%202.044%2017.276%205.74%2031.147c7.997%2030.039%2034.425%2087.92%2084.37%2074.468l1.471-.462zM28.493%2083.825l35.494-9.351s-1.034%2013.654-14.34%2017.162c-13.31%203.504-21.154-7.811-21.154-7.811'/%3e%3cpath%20fill='%231d8d22'%20d='m150.255%20143.658l-1.376-.335c-30.419-8.91-35.11-33.166-35.11-33.166l42.137%2011.778l22.308-85.724l-.27-.07c-27.362-7.329-45.516-20.145-52.71-26.17c-10.196-8.54-14.682-14.475-19.096-5.497c-3.898%207.918-8.889%2020.805-13.719%2038.846c-10.466%2039.066-18.289%20121.505%2046.413%20138.852l1.326.3zM106.668%2072.16s10.196-15.859%2027.49-10.943c17.305%204.915%2018.645%2024.046%2018.645%2024.046z'/%3e%3cpath%20fill='%23c04b41'%20d='m88.46%20126.072l-8.064%202.289c1.906%2010.74%205.264%2021.047%2010.534%2030.152c.918-.202%201.828-.376%202.762-.632c2.449-.66%204.72-1.479%206.906-2.371c-5.89-8.74-9.785-18.804-12.137-29.438m-3.148-75.644c-4.144%2015.467-7.852%2037.73-6.831%2060.06c1.826-.793%203.756-1.532%205.9-2.14l1.492-.334c-1.82-23.852%202.114-48.157%206.546-64.694a323%20323%200%200%201%203.373-11.704a105%20105%200%200%201-5.974%203.547a307%20307%200%200%200-4.506%2015.265'/%3e%3c/svg%3e",IYt="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='512'%20height='512'%20version='1.1'%20viewBox='0%200%20135.47%20135.47'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m67.733%2067.733%2029.33%2016.933-29.33%2050.8c37.408%200%2067.733-30.325%2067.733-67.733%200-12.341-3.3168-23.901-9.0837-33.867h-58.65z'%20fill='%23afccf9'/%3e%3cpath%20d='m67.733-1e-6c-25.07%200-46.942%2013.63-58.654%2033.875l29.324%2050.792%2029.33-16.933v-33.867h58.65c-11.714-20.24-33.583-33.867-58.65-33.867z'%20fill='%231767d1'/%3e%3cpath%20d='m0%2067.733c0%2037.408%2030.324%2067.733%2067.733%2067.733l29.33-50.8-29.33-16.933-29.33%2016.933-29.324-50.792c-5.7637%209.9632-9.0794%2021.519-9.0794%2033.858'%20fill='%23679ef5'/%3e%3cpath%20d='m101.6%2067.733c0%2018.704-15.163%2033.867-33.867%2033.867-18.704%200-33.867-15.163-33.867-33.867s15.163-33.867%2033.867-33.867c18.704%200%2033.867%2015.163%2033.867%2033.867'%20fill='%23fff'/%3e%3cpath%20d='m95.25%2067.733c0%2015.197-12.32%2027.517-27.517%2027.517-15.197%200-27.517-12.32-27.517-27.517%200-15.197%2012.32-27.517%2027.517-27.517%2015.197%200%2027.517%2012.32%2027.517%2027.517'%20fill='%231a74e7'/%3e%3c/svg%3e",PYt="data:image/svg+xml,%3csvg%20fill='%23F03C2E'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGit%3c/title%3e%3cpath%20d='M13.09%2023.549a1.54%201.54%200%200%201-2.18%200L.451%2013.089a1.54%201.54%200%200%201%200-2.179l7.191-7.19%202.733%202.733a1.85%201.85%200%200%200%20.964%202.326v6.66a1.849%201.849%200%201%200%201.54%200V8.957l2.508%202.508a1.85%201.85%200%201%200%201.09-1.09l-2.634-2.634a1.85%201.85%200%200%200-2.378-2.377L8.73%202.63%2010.91.451a1.54%201.54%200%200%201%202.179%200l10.459%2010.46a1.54%201.54%200%200%201%200%202.179z'/%3e%3c/svg%3e",DYt="data:image/svg+xml,%3csvg%20fill='%23073551'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3ecurl%3c/title%3e%3cpath%20d='M.803%2014.8169c0-.5342.433-.9665.9665-.9665.5335%200%20.9665.4323.9665.9665%200%20.5335-.433.9657-.9665.9657-.5335%200-.9666-.4322-.9666-.9657m2.736%200c0-.1963-.0532-.376-.1119-.5525-.2344-.7024-.876-1.2169-1.6575-1.2169-.1249%200-.2344.0465-.3524.0708C.6149%2013.2865%200%2013.9646%200%2014.817c0%20.9764.7923%201.7694%201.7695%201.7694.9772%200%201.7694-.793%201.7694-1.7694m-1.7694-7.149c.5335%200%20.9665.433.9665.9665%200%20.5335-.433.9665-.9665.9665-.5343%200-.9666-.433-.9666-.9665%200-.5335.4323-.9665.9666-.9665m0%202.7359c.9772%200%201.7694-.7923%201.7694-1.7694%200-.1956-.0532-.376-.1119-.5525-.2344-.7024-.8767-1.2169-1.6575-1.2169-.1249%200-.2344.0465-.3524.0716C.6149%207.104%200%207.782%200%208.6344c0%20.9771.7923%201.7694%201.7695%201.7694m13.221-5.694c-.5342%200-.9665-.433-.9665-.9664a.966.966%200%2001.9666-.9665c.5335%200%20.9658.4322.9658.9665%200%20.5334-.4323.9664-.9658.9664m-9.6%2016.5133c-.5335%200-.9666-.433-.9666-.9665%200-.5342.433-.9665.9666-.9665a.966.966%200%2001.9665.9665c0%20.5335-.4323.9665-.9665.9665m9.6-19.2491c-.978%200-1.7695.7922-1.7695%201.7694%200%20.2085.0525.4025.1187.5882L5.039%2018.5581c-.803.1681-1.4179.8462-1.4179%201.6985%200%20.9772.7923%201.7694%201.7695%201.7694.9772%200%201.7694-.7922%201.7694-1.7694%200-.1963-.0525-.3759-.111-.5525l8.3427-14.2728c.7778-.1865%201.3683-.8531%201.3683-1.688%200-.977-.793-1.7693-1.7694-1.7693m7.24%202.7359c-.5343%200-.9666-.433-.9666-.9665a.966.966%200%2001.9665-.9665c.5335%200%20.9666.4322.9666.9665%200%20.5334-.433.9665-.9666.9665M12.6313%2021.223c-.5343%200-.9665-.433-.9665-.9665a.966.966%200%2001.9665-.9665c.5335%200%20.9658.4323.9658.9665%200%20.5335-.4323.9665-.9658.9665M22.2305%201.974c-.9772%200-1.7694.7922-1.7694%201.7694%200%20.2085.0525.4025.1187.5882l-8.3009%2014.2265c-.8021.1681-1.417.8462-1.417%201.6985%200%20.9772.7922%201.7694%201.7694%201.7694.9764%200%201.7687-.7922%201.7687-1.7694%200-.1963-.0525-.3759-.1111-.5525l8.3427-14.2728C23.4094%205.2448%2024%204.5782%2024%203.7433c0-.977-.7923-1.7693-1.7695-1.7693'/%3e%3c/svg%3e",MYt="data:image/svg+xml,%3csvg%20fill='%23007808'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eFFmpeg%3c/title%3e%3cpath%20d='M21.72%2017.91V6.5l-.53-.49L9.05%2018.52l-1.29-.06L24%201.53l-.33-.95-11.93%201-5.75%206.6v-.23l4.7-5.39-1.38-.77-9.11.77v2.85l1.91.46v.01l.19-.01-.56.66v10.6c.609-.126%201.22-.241%201.83-.36L14.12%205.22l.83-.04L0%2021.44l9.67.82%201.35-.77%206.82-6.74v2.15l-5.72%205.57%2011.26.95.35-.94v-3.16l-3.29-.18c.434-.403.858-.816%201.28-1.23z'/%3e%3c/svg%3e",LYt="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%201080%201080'%3e%3c!--%20Generator:%20Adobe%20Illustrator%2030.3.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.3%20Build%20182)%20--%3e%3cdefs%3e%3cstyle%3e%20.st0%20{%20fill:%20%23ff0;%20}%20.st1%20{%20fill:%20%23333;%20}%20%3c/style%3e%3c/defs%3e%3cpath%20class='st0'%20d='M660.52,419.49l-195.15-52.98c-15.84-4.3-19.16-25.29-5.43-34.28l169.23-110.7-9.91-201.97c-.8-16.39,18.13-26.04,30.92-15.76l157.57,126.74,189.03-71.84c15.34-5.83,30.37,9.2,24.54,24.54l-71.84,189.03,126.74,157.57c10.29,12.79.64,31.73-15.76,30.92l-201.97-9.91-110.7,169.23c-8.98,13.73-29.98,10.41-34.28-5.43l-52.98-195.15h-.01Z'/%3e%3cpath%20class='st1'%20d='M603.34,476.66l32.94,121.68,4.45,16.23-429.11,429.11c-48.45,48.45-126.85,48.45-175.3,0C12.16,1019.51,0,987.89,0,956.15s12.02-63.48,36.31-87.77l429.11-429.11,16.35,4.33,121.56,33.06h0Z'/%3e%3c/svg%3e";function bK(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 .5C5.65.5.5 5.65.5 12c0 5.08 3.29 9.39 7.86 10.91 .58 .11 .79-.25.79-.56v-2.02c-3.2.7-3.88-1.36-3.88-1.36-.52-1.33-1.28-1.69-1.28-1.69-1.05-.72.08-.7.08-.7 1.16.08 1.77 1.19 1.77 1.19 1.03 1.77 2.71 1.26 3.37.96.1-.75.4-1.26.73-1.55-2.56-.29-5.25-1.28-5.25-5.7 0-1.26.45-2.29 1.19-3.1-.12-.29-.52-1.47.11-3.06 0 0 .97-.31 3.16 1.18A10.98 10.98 0 0 1 12 6.11c.98 0 1.96.13 2.87.39 2.19-1.49 3.16-1.18 3.16-1.18.63 1.59.23 2.77.11 3.06.74.81 1.19 1.84 1.19 3.1 0 4.43-2.7 5.4-5.27 5.69.42.36.78 1.06.78 2.14v3.04c0 .31.21.67.8.56A11.51 11.51 0 0 0 23.5 12C23.5 5.65 18.35.5 12 .5Z"})})}al.registerLanguage("bash",SM);const $Yt=48;function FYt(e,t=$Yt){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}function BYt(e){return al.highlight(e,{language:"bash",ignoreIllegals:!0}).value}function UYt({status:e}){return e==="succeeded"?a.jsx(Cf,{"aria-hidden":!0}):e==="failed"?a.jsx(oB,{"aria-hidden":!0}):e==="running"?a.jsx(Bi,{className:"studio-build-progress__spinner","aria-hidden":!0}):a.jsx(Aat,{"aria-hidden":!0})}function Xoe(e,t){if(!e)return"";const n=Date.parse(e);return Number.isNaN(n)?"":new Intl.DateTimeFormat(t,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(n)}function QYt({steps:e,log:t,logError:n="",logTruncated:i=!1,logUpdatedAt:r,loading:s=!1}){const{t:o,i18n:l}=Te("ui"),c=p.useRef(null),u=p.useRef(!0),[d,f]=p.useState(!1),h=p.useMemo(()=>BYt(t),[t]);p.useEffect(()=>{const g=c.current;g&&t&&u.current&&(g.scrollTop=g.scrollHeight)},[t]);const m=async()=>{try{await navigator.clipboard.writeText(t),f(!0),window.setTimeout(()=>f(!1),1500)}catch{f(!1)}};return a.jsxs("div",{className:"studio-build-progress",children:[a.jsx("ol",{className:"studio-build-progress__steps","aria-label":o("studioBuildProgress.steps"),children:e.map(g=>a.jsxs("li",{className:`is-${g.status}`,children:[a.jsx("span",{className:"studio-build-progress__step-icon",children:a.jsx(UYt,{status:g.status})}),a.jsx("span",{children:g.label})]},g.key))}),a.jsxs("section",{className:"studio-build-progress__log","aria-label":o("studioBuildProgress.log"),children:[a.jsxs("header",{children:[a.jsxs("div",{children:[a.jsx("strong",{children:o("studioBuildProgress.log")}),a.jsxs("span",{children:[o(s?"studioBuildProgress.syncing":n?"studioBuildProgress.loadFailed":"studioBuildProgress.synced"),i?o("studioBuildProgress.recentOnly"):"",Xoe(r,l.resolvedLanguage??l.language)?` · ${Xoe(r,l.resolvedLanguage??l.language)}`:""]})]}),a.jsxs(Tt,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:!t,onClick:()=>void m(),"aria-label":o(d?"studioBuildProgress.copiedLog":"studioBuildProgress.copyLog"),children:[d?a.jsx(Cf,{"aria-hidden":!0}):a.jsx(JD,{"aria-hidden":!0}),o(d?"studioBuildProgress.copied":"studioBuildProgress.copy")]})]}),t?a.jsx("pre",{ref:c,tabIndex:0,"aria-label":o("studioBuildProgress.logContent"),onScroll:g=>{u.current=FYt(g.currentTarget)},children:a.jsx("code",{className:"hljs language-bash",dangerouslySetInnerHTML:{__html:h}})}):a.jsx("div",{className:`studio-build-progress__log-empty${n?" is-error":""}`,children:n||o(s?"studioBuildProgress.waiting":"studioBuildProgress.empty")})]})]})}function Yoe({name:e,description:t,icon:n,selected:i,disabled:r=!1,onChange:s,className:o=""}){return a.jsxs("button",{type:"button",className:`studio-package-option${i?" is-selected":""}${o?` ${o}`:""}`,"aria-pressed":i,disabled:r,onClick:()=>s(!i),children:[a.jsx("span",{className:"studio-package-option__icon","aria-hidden":"true",children:n}),a.jsxs("span",{className:"studio-package-option__content",children:[a.jsx("strong",{children:e}),t?a.jsx("span",{children:t}):null]}),a.jsx("span",{className:"studio-package-option__action","aria-hidden":"true",children:i?a.jsx(oat,{}):a.jsx(uat,{})})]})}function Jb(e,t){return e[t]|e[t+1]<<8}function Vv(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}async function zYt(e){const t=new DecompressionStream("deflate-raw"),n=new Blob([new Uint8Array(e)]).stream().pipeThrough(t);return new Uint8Array(await new Response(n).arrayBuffer())}async function m9e(e,t={}){let i=-1;for(let u=e.length-22;u>=0&&u>e.length-65557;u--)if(Vv(e,u)===101010256){i=u;break}if(i<0)throw new Error(Xt("helpers.zip.invalid"));const r=Jb(e,i+10);if(t.maxEntries!==void 0&&r>t.maxEntries)throw new Error(Xt("helpers.zip.tooManyFiles",{count:t.maxEntries}));let s=Vv(e,i+16);const o=new TextDecoder("utf-8"),l=[];let c=0;for(let u=0;ut.maxUncompressedBytes)throw new Error(Xt("helpers.zip.tooLarge"));const w=Jb(e,v+26),x=Jb(e,v+28),O=v+30+w+x,k=e.subarray(O,O+f);let S;if(d===0)S=k;else if(d===8)S=await zYt(k);else{s+=46+m+g+b;continue}l.push({name:y,text:o.decode(S)}),s+=46+m+g+b}return l}const G7=/(^|\/)skill\.md$/i;function VYt(e){const t=(e??"").replace(/\r\n?/g,` +`),w=(e==null?void 0:e.pendingMessage)||s;if(p.useEffect(()=>{e&&f(u)},[e==null?void 0:e.status,u]),p.useEffect(()=>{if(!d||!g)return;const E=c.current;E&&(E.scrollTop=E.scrollHeight)},[d,g,y]),!e||!e.text&&e.status!=="error"&&!e.pendingMessage)return null;const x=wXt(e.updatedAt,l.resolvedLanguage??l.language),O=e.status==="complete"?o("agentWorkspace.logStatus.synced"):e.status==="error"?o("agentWorkspace.logStatus.failed"):o("agentWorkspace.logStatus.syncing"),k=e.omittedEarly?o("agentWorkspace.logStatus.earlyOmitted"):e.snapshotTruncated?o("agentWorkspace.logStatus.recentOnly"):e.truncated?o("agentWorkspace.logStatus.partiallyOmitted"):"",S=[O,e.lineCount?o("agentWorkspace.logLines",{count:e.lineCount}):"",k,x].filter(Boolean).join(" · ");async function C(){try{await navigator.clipboard.writeText(b),m(!0),window.setTimeout(()=>m(!1),1500)}catch{m(!1)}}return a.jsxs("section",{className:`aw-deploy-log is-${e.status}${d?"":" is-collapsed"}`,"aria-label":i,children:[a.jsxs("header",{children:[a.jsxs("div",{children:[a.jsx("strong",{children:n}),a.jsx("span",{children:S})]}),a.jsxs("div",{className:"aw-deploy-log-actions",children:[g&&a.jsx("button",{type:"button",onClick:()=>f(E=>!E),children:o(d?"common.collapse":"common.expand")}),g&&a.jsxs("button",{type:"button",onClick:()=>void C(),"aria-label":h?o("agentWorkspace.copiedLabel",{label:r}):o("agentWorkspace.copyLabel",{label:r}),title:h?o("agentWorkspace.copied"):o("agentWorkspace.copyLabel",{label:r}),children:[h?a.jsx(Ef,{"aria-hidden":!0}):a.jsx(eM,{"aria-hidden":!0}),a.jsx("span",{children:o(h?"agentWorkspace.copied":"agentWorkspace.copy")})]})]})]}),d&&(g?a.jsx("pre",{ref:c,children:y}):a.jsx("div",{className:"aw-deploy-log-empty",children:w}))]})}function OXt({task:e}){var n;const{t}=Te("ui");return a.jsx(o9e,{log:e.buildLog,autoExpand:((n=e.buildLog)==null?void 0:n.status)!=="complete"&&(e.status==="running"||e.status==="error")&&a9e(e,t)===1,title:t("agentWorkspace.buildLog"),ariaLabel:t("agentWorkspace.buildLog"),copyLabel:t("agentWorkspace.buildLog"),defaultPendingMessage:t("agentWorkspace.waitingBuildLog")})}function kXt({task:e}){var n;const{t}=Te("ui");return a.jsx(o9e,{log:e.githubLog,autoExpand:((n=e.githubLog)==null?void 0:n.status)!=="complete"&&(e.status==="running"||e.status==="error")&&e.phase==="github",title:t("agentWorkspace.githubMountLog"),ariaLabel:t("agentWorkspace.githubDeliveryMountLog"),copyLabel:t("agentWorkspace.githubMountLog"),defaultPendingMessage:t("agentWorkspace.waitingGithubMountLog")})}function SXt({task:e,onReturnToEdit:t}){const{t:n}=Te("ui"),[i,r]=p.useState(!1),s=s9e(e,n),o=a9e(e,n),l=e.status==="success"?100:Math.max(6,Math.min(100,e.pct??6)),c=e.status==="running"&&e.statusUnconfirmed?n("agentWorkspace.deployStatus.unconfirmed"):e.status==="running"?n("agentWorkspace.deployStatus.running"):e.status==="success"?n("agentWorkspace.deployStatus.success"):e.status==="error"?n("agentWorkspace.deployStatus.error"):n("agentWorkspace.deployStatus.cancelled"),u=()=>{i||!e.retry||(r(!0),e.retry().catch(()=>{}).finally(()=>r(!1)))};return a.jsxs("section",{className:`aw-deploy-progress-card is-${e.status}`,"aria-live":"polite",children:[a.jsxs("div",{className:"aw-deploy-progress-head",children:[a.jsxs("div",{children:[a.jsx("span",{className:"aw-deploy-progress-icon","aria-hidden":!0,children:e.status==="running"&&e.statusUnconfirmed?a.jsx(gN,{}):e.status==="running"?a.jsx(Fi,{className:"spin"}):e.status==="success"?a.jsx(Cat,{}):e.status==="error"?a.jsx(gN,{}):a.jsx(oB,{})}),a.jsxs("div",{children:[a.jsx("h3",{children:c}),a.jsx("p",{children:e.runtimeName})]})]}),a.jsx("strong",{children:e.status==="running"&&!e.statusUnconfirmed?`${Math.round(l)}%`:e.label})]}),a.jsx("div",{className:"aw-deploy-progress-track",role:"progressbar","aria-label":n("agentWorkspace.deploymentProgress"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(l),children:a.jsx("span",{style:{width:`${l}%`}})}),a.jsx("ol",{className:"aw-deploy-steps",children:s.map((d,f)=>{const h=e.status==="success"||fnew Set),[lr,Mn]=p.useState(()=>new Set),[ei,Bn]=p.useState(!1),[ki,zn]=p.useState(""),[Rn,di]=p.useState(null),[rt,zt]=p.useState([]),[Qe,bt]=p.useState([]),[Ht,_n]=p.useState(!1),[jr,Hs]=p.useState(""),[qs,Dr]=p.useState(""),[ti,Si]=p.useState(0),[Zr,Jr]=p.useState([]),[ga,go]=p.useState(!1),[us,he]=p.useState(""),[pr,bo]=p.useState(0),[to,fl]=p.useState(null),[no,ws]=p.useState(1),[Ws,Ai]=p.useState(!1),[rr,Ds]=p.useState(""),[Pl,hl]=p.useState(0),[mr,Mr]=p.useState(null),[pl,Mo]=p.useState(null),[Nr,Lo]=p.useState(null),[es,ba]=p.useState(!1),[Di,Ms]=p.useState(""),[zr,ds]=p.useState(null),[ml,na]=p.useState(!1),[gi,Dl]=p.useState(""),[$o,Ks]=p.useState(0),[gl,Fo]=p.useState(""),[Pa,bl]=p.useState(!1),[Uu,Bo]=p.useState(!1),[hc,Dd]=p.useState(!1),[Md,yo]=p.useState(""),[Ld,yl]=p.useState(""),[Ml,Da]=p.useState(0),[Uo,Qo]=p.useState({saving:!1,error:"",notice:""}),[Qu,vl]=p.useState(!1),[Ll,Ls]=p.useState(()=>new Set),[Ma,rn]=p.useState(!1),[$l,Os]=p.useState(""),[ts,ns]=p.useState(""),[$d,Fl]=p.useState(()=>new Set),zo=p.useRef(!1),Bl=p.useRef(""),Kc=p.useRef(null),vo=p.useRef(0),ia=p.useRef(0),io=p.useRef(0),Re=p.useRef(0),[lt,Lt]=p.useState(HGt),[Ln,wn]=p.useState("");p.useEffect(()=>{e.length!==0&&Lt(ce=>ce.map(($e,Ge)=>Ge===0&&$e.agentIds.length===0?{...$e,agentIds:e.slice(0,2).map(pt=>pt.id)}:$e))},[e]);const pn=p.useMemo(()=>{const ce=new Map;for(const $e of e)$e.runtimeId&&ce.set($e.runtimeId,$e);return ce},[e]),jn=p.useMemo(()=>{var $e;const ce=new Map;for(const Ge of t){const pt=($e=Ge.deploymentTarget)==null?void 0:$e.runtimeId;if(!pt||!pn.has(pt))continue;const ln=ce.get(pt);(!ln||Ge.updatedAt>ln.updatedAt)&&ce.set(pt,Ge)}return ce},[pn,t]),Wt=p.useMemo(()=>{const ce=new Map;for(const $e of f){if(!$e.runtimeId)continue;const Ge=ce.get($e.runtimeId);(!Ge||$e.startedAt>Ge.startedAt)&&ce.set($e.runtimeId,$e)}return ce},[f]),gn=p.useMemo(()=>{const ce=et.trim().toLowerCase();return ce?e.filter($e=>{const Ge=$e.runtimeId?jn.get($e.runtimeId):void 0,pt=$e.runtimeId?Wt.get($e.runtimeId):void 0;return[$e.label,$e.app,$e.host??"",(Ge==null?void 0:Ge.draft.name)??"",(Ge==null?void 0:Ge.draft.description)??"",(pt==null?void 0:pt.runtimeName)??""].join(" ").toLowerCase().includes(ce)}):e},[e,Wt,et,jn]),$n=p.useMemo(()=>{const ce=et.trim().toLowerCase();return t.filter($e=>{var pt;const Ge=(pt=$e.deploymentTarget)==null?void 0:pt.runtimeId;return Ge&&pn.has(Ge)?!1:ce?`${$e.draft.name} ${$e.draft.description}`.toLowerCase().includes(ce):!0})},[pn,t,et]),ai=p.useMemo(()=>t.filter(ce=>{var Ge;const $e=(Ge=ce.deploymentTarget)==null?void 0:Ge.runtimeId;return!$e||!pn.has($e)}).length,[pn,t]),is=p.useMemo(()=>{const ce=et.trim().toLowerCase();return ce?lt.filter($e=>$e.name.toLowerCase().includes(ce)):lt},[lt,et]),re=e.find(ce=>ce.id===U),Vn=t.find(ce=>ce.id===z),bi=h?f.find(ce=>ce.id===h):void 0,La=re!=null&&re.runtimeId?jn.get(re.runtimeId):void 0,oe=x?xt:U&&r===U?i:null,Le=(oe==null?void 0:oe.appName)||(re==null?void 0:re.runtimeApp)||(re==null?void 0:re.app)||"",st=(re==null?void 0:re.agentCategory)??"general",Fe=st==="mpa"?"basic":V,de=(ne==null?void 0:ne.runtimeId)===(re==null?void 0:re.runtimeId)?ne:null,Be=de==null?void 0:de.mpaInstanceId,at=(re==null?void 0:re.mpaInstanceId)??Be??(re==null?void 0:re.runtimeId)??"",$t=WGt.filter(ce=>st==="mpa"?ce==="basic":ce==="profileConfig"?!1:ce==="usage"?c&&(re==null?void 0:re.runtimeId):!(ce==="sessionConfig"||ce==="diagnostics")).map(ce=>({id:ce,label:_(`agentWorkspace.sections.${ce}`)})),kn=JSON.stringify([(re==null?void 0:re.runtimeId)??"",(re==null?void 0:re.region)??"cn-beijing",Le,no]),Ti=(to==null?void 0:to.requestKey)===kn?to.value:null,sn=`${(re==null?void 0:re.region)??"cn-beijing"}:${(re==null?void 0:re.runtimeId)??""}`,oi=JSON.stringify([(re==null?void 0:re.runtimeId)??"",at,(re==null?void 0:re.region)??"cn-beijing",y]),Vt=JSON.stringify([(re==null?void 0:re.runtimeId)??"",at,(re==null?void 0:re.region)??"cn-beijing"]),fi=Vt,Un=JSON.stringify([(re==null?void 0:re.runtimeId)??"",(re==null?void 0:re.region)??"cn-beijing",y]),sr=(ke==null?void 0:ke.requestKey)===sn?ke.value:"",Hn=(G==null?void 0:G.requestKey)===sn?G:null,gr=(mr==null?void 0:mr.requestKey)===oi&&y?mr.value:null,ks=(Nr==null?void 0:Nr.requestKey)===Vt?Nr.value:null,zi=(pl==null?void 0:pl.requestKey)===fi?pl.value:(ks==null?void 0:ks.profile)??null,wr=(ks==null?void 0:ks.bindingStatus)??"",Fd=XGt((d2=ks==null?void 0:ks.safeError)==null?void 0:d2.code,_),Db=(ks==null?void 0:ks.capabilities.canWrite)===!0,dv=(zr==null?void 0:zr.requestKey)===Un?zr:null,fv=!!(re!=null&&re.runtimeId&&st==="mpa"&&wr!=="runtime_missing"&&wr!=="binding_ambiguous"),Lh=!!((re==null?void 0:re.agentCategory)==="mpa"&&(re!=null&&re.runtimeId)&&(re==null?void 0:re.runtimeId)===w&&wr==="bound"&&y),Pf=(zi==null?void 0:zi.status)==="applied"?zi.profileRevision:null,Rr=!!(Lh&&gr&&Pf!=null&&Pf>gr.profileRevision),xl=hx(gr),zu=gl.trim()!==xl,pc=!!((bc=Hn==null?void 0:Hn.apiApps)!=null&&bc.length),$a=!!(Hn!=null&&Hn.a2a),Om=((vv=Hn==null?void 0:Hn.apiApps)==null?void 0:vv[0])??Le,Vu=(ne==null?void 0:ne.endpoint)??"",Df=eXt(((Qd=Hn==null?void 0:Hn.a2a)==null?void 0:Qd.endpoint)??"",Vu),Ul=(re==null?void 0:re.runtimeApp)||"",ro=JSON.stringify([(re==null?void 0:re.runtimeId)??"",(re==null?void 0:re.region)??"",(re==null?void 0:re.currentVersion)??null,Ul]),mc=l&&(re!=null&&re.runtimeId)&&re.region&&qe===0?H8({runtimeId:re.runtimeId,region:re.region,appName:Ul,currentVersion:re.currentVersion}):null,yt=(He==null?void 0:He.requestKey)===ro?He.value:mc,Vo=yt!=null&&yt.reason?So(yt.reason,L.resolvedLanguage||L.language):"",Xi=(yt==null?void 0:yt.warnings.filter(ce=>So(ce,L.resolvedLanguage||L.language)))??[],Fa=st!=="mpa";p.useEffect(()=>{const ce=vo.current+1;vo.current=ce,Ue(null),Ct("");const $e=(re==null?void 0:re.runtimeId)??"",Ge=(re==null?void 0:re.region)??"";if(!Fa||!l||!$e||!Ge){Pt(!1);return}const pt=qe===0?H8({runtimeId:$e,region:Ge,appName:Ul,currentVersion:re==null?void 0:re.currentVersion}):null;if(pt){Ue({requestKey:ro,value:pt}),Pt(!1);return}const ln=new AbortController;let Ze,En=0;const Lr=60;Pt(!0);const Ri=hs=>{PD({runtimeId:$e,region:Ge,appName:Ul,currentVersion:re==null?void 0:re.currentVersion,signal:ln.signal,force:hs&&qe>0}).then(sa=>{var FO,Ub;if(ce!==vo.current)return;const Uh=sa.recoveryStatus==="preparing";if(sa.runtime.runtimeId!==$e||sa.runtime.region!==Ge||!Uh&&Ul&&((FO=sa.agent)==null?void 0:FO.appName)!==Ul||sa.canUpdate&&!((Ub=sa.agent)!=null&&Ub.appName)){Ct(_("agentWorkspace.errors.updateCapabilityMismatch"));return}if(Ue({requestKey:ro,value:sa}),Pt(!1),!!Uh){if(En+=1,En>=Lr){Ct(_("agentWorkspace.errors.updateConfigRestoring"));return}Ze=window.setTimeout(()=>Ri(!1),1e3)}}).catch(()=>{ce!==vo.current||ln.signal.aborted||Ct(_("agentWorkspace.errors.checkUpdateCapability"))}).finally(()=>{ce===vo.current&&!ln.signal.aborted&&Pt(!1)})};return Ri(!0),()=>{ln.abort(),Ze!=null&&window.clearTimeout(Ze)}},[l,Ul,qe,re==null?void 0:re.currentVersion,re==null?void 0:re.region,re==null?void 0:re.runtimeId,Fa,ro]);const Nn=p.useMemo(()=>{const ce=new Map(e.map((Ge,pt)=>[Ge.id,pt])),$e=new Map(n.map((Ge,pt)=>[Ge,pt]));return[...gn].sort((Ge,pt)=>{const ln=Ge.runtimeId?Wt.get(Ge.runtimeId):void 0,Ze=pt.runtimeId?Wt.get(pt.runtimeId):void 0,En=(ln==null?void 0:ln.status)==="running"?ln.startedAt:0,Lr=(Ze==null?void 0:Ze.status)==="running"?Ze.startedAt:0;if(En!==Lr)return Lr-En;const Ri=$e.get(Ge.id),hs=$e.get(pt.id);return Ri!=null&&hs!=null?Ri-hs:Ri!=null?-1:hs!=null?1:(ce.get(Ge.id)??0)-(ce.get(pt.id)??0)})},[n,e,gn,Wt]),Bd=(re==null?void 0:re.label)||(oe==null?void 0:oe.name)||(Vn==null?void 0:Vn.draft.name)||(bi==null?void 0:bi.agentName)||(($O=bi==null?void 0:bi.agentDraft)==null?void 0:$O.name)||_("agentWorkspace.noAgentSelected"),TO=lt.find(ce=>ce.id===Ln),hv=Nn.filter(ce=>ce.canDelete===!0),Mb=Nn.filter(ce=>Qi.has(ce.id)&&ce.canDelete===!0),gc=$n.filter(ce=>lr.has(ce.id)),JT=hv.length+$n.length,Mf=Mb.length+gc.length,Ba=p.useMemo(()=>{var $e;if(bi!=null&&bi.agentDraft)return bi.agentDraft;if(Vn!=null&&Vn.draft)return Vn.draft;const ce=($e=re==null?void 0:re.region)!=null&&$e.startsWith("ap-")?"byteplus":"volcengine";return yt!=null&&yt.agent&&(yt.recoveryStatus==="complete"||yt.recoveryStatus==="draft-only")?fH(yt.agent,ce,yt.runtime.configuredEnvKeys):dXt(oe,Le||(re==null?void 0:re.label)||"agent",ce)},[oe,Le,re==null?void 0:re.label,re==null?void 0:re.region,Vn==null?void 0:Vn.draft,bi==null?void 0:bi.agentDraft,yt]),Dn=((ra=oe==null?void 0:oe.draft)==null?void 0:ra.harnessSidecar)??lmt(ne==null?void 0:ne.envs),e2=Dn?Z1.filter(ce=>Dn.componentOverrides[ce]):[],t2=p.useMemo(()=>FA(Ba),[Ba]),$h=Vn?o?"":_("agentWorkspace.errors.noCreatePermission"):st==="mpa"?"":l?re!=null&&re.runtimeId?re.region?jt?_("agentWorkspace.errors.checkingUpdateConfig"):Kt||(yt?yt.recoveryStatus!=="complete"&&yt.recoveryStatus!=="draft-only"?Vo||_("agentWorkspace.errors.originalConfigUnavailable"):yt.canUpdate?(f2=yt.agent)!=null&&f2.appName?"":_("agentWorkspace.errors.agentInfoMissing"):Vo||_("agentWorkspace.errors.updateUnsupported"):_("agentWorkspace.errors.updateCapabilityPending")):_("agentWorkspace.errors.runtimeRegionMissing"):_("agentWorkspace.errors.cloudOnlyUpdate"):_("agentWorkspace.errors.noManagePermission"),Lb="aw-update-disabled-reason",qL=re?st!=="mpa"?_("agentWorkspace.sessionConfigNonMpa"):es?_("agentWorkspace.loadingMpaAgentView"):Di||Fd||(wr==="runtime_missing"?_("agentWorkspace.mpaRuntimeMissing"):wr==="binding_ambiguous"?_("agentWorkspace.mpaRuntimeBindingAmbiguous"):wr&&!fv?_("agentWorkspace.mpaRuntimeMissing"):Db?"":_("agentWorkspace.errors.noManagePermission")):_("agentWorkspace.sessionConfigNoAgent"),$b=re?st!=="mpa"?_("agentWorkspace.sessionConfigNonMpa"):es?_("agentWorkspace.loadingMpaAgentView"):Di||Fd||(wr==="runtime_missing"?_("agentWorkspace.mpaRuntimeMissing"):wr==="binding_ambiguous"?_("agentWorkspace.mpaRuntimeBindingAmbiguous"):wr==="orphan_runtime"?_("agentWorkspace.mpaRuntimeOrphan"):y?re.runtimeId!==w?_("agentWorkspace.sessionConfigDifferentRuntime"):"":_("agentWorkspace.sessionConfigNoSession")):_("agentWorkspace.sessionConfigNoAgent"),n2=re?st!=="mpa"?_("agentWorkspace.sessionConfigNonMpa"):es?_("agentWorkspace.loadingMpaAgentView"):Di||(wr!=="bound"?$b:y?re.runtimeId!==w?_("agentWorkspace.sessionConfigDifferentRuntime"):"":_("agentWorkspace.sessionConfigNoSession")):_("agentWorkspace.sessionConfigNoAgent"),km=p.useMemo(()=>{if(oe)return oe.tools;const ce=(Ba.builtinTools??[]).map($e=>{var Ge;return((Ge=rT.find(pt=>pt.id===$e))==null?void 0:Ge.label)??$e});return Array.from(new Set([...Ba.tools,...ce,...(Ba.customTools??[]).map($e=>$e.name),...(Ba.mcpTools??[]).map($e=>$e.name)].filter(Boolean)))},[Ba,oe]),Fb=p.useMemo(()=>oe?oe.skillsPreviewSupported?oe.skills.map(ce=>ce.name):null:Array.from(new Set([...(Ba.selectedSkills??[]).map(ce=>ce.name),...Ba.skills].filter(Boolean))),[Ba,oe]),Vr=p.useMemo(()=>{if(bi)return bi;if(Vn){const ce=f.filter($e=>$e.draftId===Vn.id).sort(($e,Ge)=>Ge.startedAt-$e.startedAt)[0];return ce||f.filter($e=>{var Ge,pt;return((Ge=$e.agentDraft)==null?void 0:Ge.name)===Vn.draft.name||$e.agentName===Vn.draft.name||!!((pt=Vn.deploymentTarget)!=null&&pt.runtimeId)&&$e.runtimeId===Vn.deploymentTarget.runtimeId}).sort(($e,Ge)=>Ge.startedAt-$e.startedAt)[0]}if(re)return f.filter(ce=>!!re.runtimeId&&ce.runtimeId===re.runtimeId||ce.agentName===re.label).sort((ce,$e)=>$e.startedAt-ce.startedAt)[0]},[f,re,Vn,bi]),i2=!!(h&&Vr&&Vr.id===h),pv=!!(Vr&&(Vr.status!=="success"||i2)),Hu=(Vr==null?void 0:Vr.status)==="running",Sm=Vr!=null&&Vr.draftId?t.find(ce=>ce.id===Vr.draftId)??(Vr.agentDraft?{id:Vr.draftId,draft:Vr.agentDraft,updatedAt:Vr.startedAt}:void 0):void 0,Gc=p.useMemo(()=>yXt(Ba),[Ba]),Fh=(re==null?void 0:re.currentVersion)??(ne==null?void 0:ne.currentVersion)??null,Lf=Fh??(bi==null?void 0:bi.startedAt)??"unknown",Pi=oe?`runtime:${(re==null?void 0:re.runtimeId)??oe.name}:v${Lf}:${Gc}`:`draft:${(bi==null?void 0:bi.id)??(Vn==null?void 0:Vn.id)??(re==null?void 0:re.id)??Bd}:${Gc}`;p.useEffect(()=>{let ce=!1;const $e=(re==null?void 0:re.runtimeId)??"",Ge=at||$e,pt=(re==null?void 0:re.region)??"cn-beijing",ln=Vt;if(Ms(""),st!=="mpa"||!$e||Fe!=="profileConfig"&&Fe!=="sessionConfig"){Lo(null),ba(!1);return}const Ze=new AbortController;return ba(!0),ETe({mpaInstanceId:Ge,runtimeId:$e,region:pt,signal:Ze.signal}).then(En=>{ce||(Lo({requestKey:ln,value:En}),Mo(En.profile?{requestKey:fi,value:En.profile}:null))}).catch(En=>{ce||Ze.signal.aborted||(Lo(null),Ms(En instanceof Error?En.message:_("agentWorkspace.errors.loadMpaAgentView")))}).finally(()=>{ce||ba(!1)}),()=>{ce=!0,Ze.abort()}},[qe,Vt,Fe,at,re==null?void 0:re.region,re==null?void 0:re.runtimeId,st,fi,_]),p.useEffect(()=>{Fe==="usage"&&!c&&q("basic")},[c,Fe]),p.useEffect(()=>{Fe==="sessionConfig"&&(!(re!=null&&re.runtimeId)||st!=="mpa")&&q("basic")},[Fe,re==null?void 0:re.runtimeId,st]),p.useEffect(()=>{Fe==="diagnostics"&&(!(re!=null&&re.runtimeId)||st!=="mpa")&&q("basic")},[Fe,re==null?void 0:re.runtimeId,st]),p.useEffect(()=>{if(!h)return;const ce=f.find(Ge=>Ge.id===h),$e=ce!=null&&ce.runtimeId?pn.get(ce.runtimeId):void 0;if($e){Z(""),J($e.id),q("basic");return}J(""),Z(""),q("basic")},[pn,f,h]),p.useEffect(()=>{if(!m){Bl.current="";return}const ce=`${m}:${g}:${b}:${c}`;Bl.current!==ce&&e.some($e=>$e.id===m)&&(Bl.current=ce,Z(""),J(m),q(g==="usage"&&!c?"basic":g),g==="evaluations"&&(At(b),Gt("")))},[e,c,m,g,b]),p.useEffect(()=>{for(const ce of Nn.slice(0,8)){if(!ce.runtimeId)continue;const $e=ce.region??"cn-beijing";A2e(ce.runtimeId,$e),vTe(ce.runtimeId,$e,ce.runtimeApp??"")}},[Nn]),p.useEffect(()=>{let ce=!1;const $e=(re==null?void 0:re.runtimeId)??"",Ge=(re==null?void 0:re.region)??"cn-beijing",pt=(re==null?void 0:re.runtimeApp)??"",ln=$e?yTe($e,Ge,pt):null;if(tt(ln),Nt(""),xn(!1),Ne(!!ln||!x||!$e),!(!x||!$e))return Cz($e,Ge,pt,{force:!0}).then(Ze=>{ce||tt(Ze)}).catch(Ze=>{!ce&&!ln&&tt(null),ce||(xn(Ze instanceof Oa&&Ze.unsupported),Nt(_("agentWorkspace.errors.loadAgentInfo")))}).finally(()=>{ce||Ne(!0)}),()=>{ce=!0}},[x,qe,re==null?void 0:re.currentVersion,re==null?void 0:re.region,re==null?void 0:re.runtimeApp,re==null?void 0:re.runtimeId]),p.useEffect(()=>{let ce=!1;const $e=(re==null?void 0:re.runtimeId)??"",Ge=(re==null?void 0:re.region)??"cn-beijing";if(Jr([]),he(""),Fe!=="optimizations"||!$e){go(!1);return}if(x&&!Le){go(!mt);return}return go(!0),rTe({runtimeId:$e,region:Ge,appName:Le}).then(pt=>{ce||Jr(pt.groups)}).catch(()=>{ce||he(_("agentWorkspace.errors.loadOptimizations"))}).finally(()=>{ce||go(!1)}),()=>{ce=!0}},[mt,x,pr,Fe,Le,re==null?void 0:re.region,re==null?void 0:re.runtimeId]),p.useEffect(()=>{ws(1)},[re==null?void 0:re.runtimeId,Le]),p.useEffect(()=>{const ce=io.current+1;io.current=ce;const $e=(re==null?void 0:re.runtimeId)??"",Ge=(re==null?void 0:re.region)??"cn-beijing",pt=Le;if(Ds(""),Fe!=="usage"||!$e){Ai(!1);return}if(!pt){Ai(x&&!mt);return}const ln=new AbortController;return Ai(!0),h2e({runtimeId:$e,region:Ge,appName:pt,page:no,pageSize:KGt,signal:ln.signal}).then(Ze=>{if(ce===io.current){if(Ze.runtimeId!==$e||Ze.appName!==pt||Ze.page!==no){Ds(_("agentWorkspace.errors.usageMismatch"));return}fl({requestKey:kn,value:Ze})}}).catch(()=>{ce!==io.current||ln.signal.aborted||Ds(_("agentWorkspace.errors.loadUsage"))}).finally(()=>{ce===io.current&&Ai(!1)}),()=>{ln.abort()}},[no,Pl,kn,mt,x,Fe,Le,re==null?void 0:re.region,re==null?void 0:re.runtimeId]),p.useEffect(()=>{ia.current+=1,je(null),Ee(!1),_e(!1),le(""),pe("api-server")},[sn,Fe]),p.useEffect(()=>{const ce=(re==null?void 0:re.runtimeId)??"",$e=(re==null?void 0:re.region)??"cn-beijing",Ge=Un;if(Dl(""),Fe!=="diagnostics"||st!=="mpa"||wr!=="bound"||!ce||!y||ce!==w){na(!1),Fe!=="diagnostics"&&ds(null);return}const pt=new AbortController;let ln=!1;return na(!0),ATe({runtimeId:ce,region:$e,sessionId:y,signal:pt.signal}).then(async Ze=>{const En=Ze.runs[0],Lr=En?await TTe({runtimeId:ce,region:$e,sessionId:y,invocationId:En.invocationId,signal:pt.signal}):null;return{runs:Ze.runs,trace:Lr}}).then(Ze=>{ln||ds({requestKey:Ge,...Ze})}).catch(Ze=>{ln||pt.signal.aborted||(ds(null),Dl(Ze instanceof Error?Ze.message:_("agentWorkspace.errors.loadMpaDiagnostics")))}).finally(()=>{ln||na(!1)}),()=>{ln=!0,pt.abort()}},[w,y,$o,Un,Fe,re==null?void 0:re.region,re==null?void 0:re.runtimeId,st,wr,_]);function so(){ia.current+=1,je(null),Ee(!1),_e(!1),le("")}function fs(ce){ce!==ue&&(so(),pe(ce))}async function _O(){if(Pe){so();return}const ce=(re==null?void 0:re.runtimeId)??"",$e=(re==null?void 0:re.region)??"cn-beijing";if(!ce)return;const Ge=ia.current+1;ia.current=Ge,_e(!0),le("");try{const pt=await k2e(ce,$e);if(Ge!==ia.current)return;je({requestKey:sn,value:pt}),Ee(!0)}catch(pt){if(Ge!==ia.current)return;je(null),Ee(!1),le(pt instanceof Error?pt.message:_("agentWorkspace.errors.loadApiKey"))}finally{Ge===ia.current&&_e(!1)}}p.useEffect(()=>{let ce=!1;const $e=(re==null?void 0:re.runtimeId)??"",Ge=(re==null?void 0:re.region)??"cn-beijing",pt=$e?C2e($e,Ge):null;if(W(pt),St(""),!!$e)return DD($e,Ge,{force:!0}).then(ln=>{ce||W(ln)}).catch(()=>{!ce&&!pt&&W(null),ce||St(_("agentWorkspace.errors.loadRuntimeDetails"))}),()=>{ce=!0}},[qe,re==null?void 0:re.currentVersion,re==null?void 0:re.region,re==null?void 0:re.runtimeId]),p.useEffect(()=>{const ce=Re.current+1;if(Re.current=ce,yo(""),yl(""),Bo(!1),Dd(!1),Fe!=="sessionConfig"||!Lh||!(re!=null&&re.runtimeId)){bl(!1),Mr(null),Fo("");return}const $e=re.runtimeId,Ge=at||$e,pt=re.region??"cn-beijing",ln=oi,Ze=new AbortController;return bl(!0),Promise.all([Rz({runtimeId:$e,region:pt,sessionId:y,signal:Ze.signal}),STe({runtimeId:$e,region:pt,mpaInstanceId:Ge,signal:Ze.signal}).catch(()=>null)]).then(([En,Lr])=>{ce===Re.current&&(Mr({requestKey:ln,value:En}),Fo(hx(En)),Mo(Lr?{requestKey:fi,value:Lr}:null))}).catch(En=>{ce!==Re.current||Ze.signal.aborted||(En==null?void 0:En.name)==="AbortError"||(Mr(null),Fo(""),yo(En instanceof Error?En.message:_("agentWorkspace.errors.loadSessionConfig")))}).finally(()=>{ce===Re.current&&!Ze.signal.aborted&&bl(!1)}),()=>{Ze.abort()}},[y,Ml,oi,Lh,Fe,fi,at,re==null?void 0:re.region,re==null?void 0:re.runtimeId,_]),p.useEffect(()=>{let ce=!1;const $e=(re==null?void 0:re.runtimeId)??"";if(ye(""),Fe!=="versions"||!$e){We(!1),$e||Oe(null);return}return We(!0),dN($e).then(Ge=>{ce||Oe(Ge)}).catch(()=>{ce||(Oe(null),ye(_("agentWorkspace.errors.loadGithubVersions")))}).finally(()=>{ce||We(!1)}),()=>{ce=!0}},[Fe,re==null?void 0:re.currentVersion,re==null?void 0:re.runtimeId]),p.useEffect(()=>{let ce=!1;const $e=(re==null?void 0:re.runtimeId)??"",Ge=(re==null?void 0:re.region)??"cn-beijing",pt=`${Ge}:${$e}`;if(ie(""),Fe!=="integrations"||!$e){Y(!1),$e||H(null);return}Y(!0);const ln=Ww($e,Ge,{retryProbe:!0}).catch(Ze=>{if(Ze instanceof Oa&&Ze.unsupported)return null;throw Ze});return Promise.all([ln,O2e($e,Ge,{retryProbe:!0})]).then(([Ze,En])=>{ce||H({requestKey:pt,apiApps:Ze,a2a:En})}).catch(()=>{ce||(H(null),ie(_("agentWorkspace.errors.probeIntegration")))}).finally(()=>{ce||Y(!1)}),()=>{ce=!0}},[ee,Fe,re==null?void 0:re.currentVersion,re==null?void 0:re.region,re==null?void 0:re.runtimeId]),p.useEffect(()=>{let ce=!1;const $e=(re==null?void 0:re.runtimeId)??"",Ge=(re==null?void 0:re.region)??"cn-beijing",pt=$e&&Le?sTe({runtimeId:$e,region:Ge,appName:Le,pageSize:100}):null;if(zt(pt?Qoe(pt,_):[]),bt((pt==null?void 0:pt.sets)??[]),Hs(""),Dr((pt==null?void 0:pt.unsupportedMessage)??""),Fe!=="evaluations"||!$e){_n(!1);return}if(x&&!Le){_n(!mt);return}return _n(!pt),_D({runtimeId:$e,region:Ge,appName:Le,pageSize:100},{force:!0}).then(ln=>{ce||(bt(ln.sets),zt(Qoe(ln,_)),Dr(ln.unsupportedMessage??""))}).catch(()=>{ce||(Hs(_("agentWorkspace.errors.loadEvaluations")),Dr(""))}).finally(()=>{ce||_n(!1)}),()=>{ce=!0}},[mt,x,ti,Fe,Le,oe==null?void 0:oe.appName,re==null?void 0:re.region,re==null?void 0:re.runtimeId,_]);async function jO(ce){const $e=(re==null?void 0:re.runtimeId)??"",Ge=ce.commitSha??"";if(!(!$e||!Ge||we)){Ae(Ge),ye("");try{await r2e({runtimeId:$e,targetCommitSha:Ge,region:re==null?void 0:re.region,agentCategory:st});const pt=await dN($e);Oe(pt)}catch(pt){ye(pt instanceof Error?pt.message:_("agentWorkspace.errors.rollbackVersion"))}finally{Ae("")}}}function NO(ce,$e){return!(ce instanceof nw)||ce.status!==412||!ce.currentState?!1:(Mr({requestKey:oi,value:ce.currentState}),Fo(hx(ce.currentState)),yo($e),!0)}async function r2(ce="replace"){if(!(re!=null&&re.runtimeId)||!gr)return;const $e=re.runtimeId,Ge=re.region??"cn-beijing",pt=gl.trim(),ln=ce==="inherit"?{category:"model",mode:ce}:pt?{category:"model",mode:ce,value:{id:pt}}:{category:"model",mode:"inherit"};Bo(!0),yo(""),yl("");try{const Ze=await B8({runtimeId:$e,region:Ge,sessionId:y,etag:gr.etag,changes:[ln]});Mr({requestKey:oi,value:Ze}),Fo(hx(Ze)),yl(_("agentWorkspace.sessionConfigSaved"))}catch(Ze){NO(Ze,_("agentWorkspace.sessionConfigStale"))||yo(c6(Ze,_("agentWorkspace.sessionConfigStale")))}finally{Bo(!1)}}async function RO(ce){if(!(re!=null&&re.runtimeId)||!gr)return;const $e=re.runtimeId,Ge=re.region??"cn-beijing";Bo(!0),yo(""),yl("");try{const pt=await B8({runtimeId:$e,region:Ge,sessionId:y,etag:gr.etag,changes:[{category:"mcpServers",mode:ce}]});Mr({requestKey:oi,value:pt}),yl(_("agentWorkspace.sessionConfigSaved"))}catch(pt){NO(pt,_("agentWorkspace.sessionConfigStale"))||yo(c6(pt,_("agentWorkspace.sessionConfigStale")))}finally{Bo(!1)}}async function WL(){if(!(re!=null&&re.runtimeId)||!gr||!Pf)return;const ce=re.runtimeId,$e=re.region??"cn-beijing";Dd(!0),yo(""),yl("");try{const Ge=await _Te({runtimeId:ce,region:$e,sessionId:y,etag:gr.etag,idempotencyKey:JGt(ce,y,Pf),targetProfileRevision:Pf});Mr({requestKey:oi,value:Ge}),Fo(hx(Ge)),yl(_("agentWorkspace.sessionProfileUpgraded"))}catch(Ge){NO(Ge,_("agentWorkspace.sessionConfigStale"))||yo(c6(Ge,_("agentWorkspace.sessionProfileUpgradeFailed")))}finally{Dd(!1)}}async function mv(){if(!(re!=null&&re.runtimeId))return;const ce=re.runtimeId,$e=re.region??"cn-beijing",Ge=at||ce,pt=(zi==null?void 0:zi.status)==="applied"?"update":"create",ln=(zi==null?void 0:zi.runtimeRevision)||(zi==null?void 0:zi.etag)||"",Ze=await sXt(ce,pt,t2);Qo({saving:!0,error:"",notice:""});try{const En=await jz({operationKind:pt,runtimeId:ce,region:$e,mpaInstanceId:Ge,sourceProfileId:`studio-runtime:${ce}:${Le||"a2a-default"}`,targetKey:pt==="update"?Ge:`runtime:${$e}:${ce}`,runtimeRevision:pt==="update"?ln:void 0,draft:Ba,idempotencyKey:Ze});Qo({saving:!1,error:En.status==="succeeded"?"":En.safeErrorCode||_("agentWorkspace.profileApplyIncomplete"),notice:En.status==="succeeded"?_("agentWorkspace.profileAppliedNotice",{revision:En.profileRevision??_("agentWorkspace.notAvailable")}):""}),nt(Lr=>Lr+1),Da(Lr=>Lr+1)}catch(En){Qo({saving:!1,error:En instanceof Error?En.message:_("agentWorkspace.profileApplyFailed"),notice:""})}}function s2(){!(re!=null&&re.runtimeId)||st!=="mpa"||I==null||I({draft:Ba,runtimeId:re.runtimeId,mpaInstanceId:at||re.runtimeId,name:Bd,region:re.region??"cn-beijing",appName:Le||"a2a-default",currentVersion:re.currentVersion??(ne==null?void 0:ne.currentVersion),runtimeRevision:(zi==null?void 0:zi.runtimeRevision)||(zi==null?void 0:zi.etag)||void 0})}p.useEffect(()=>{Qo({saving:!1,error:"",notice:""})},[Vt]),p.useEffect(()=>{const ce=new Set(rt.map($e=>$e.id));Ls($e=>{const Ge=new Set([...$e].filter(pt=>ce.has(pt)));return Ge.size===$e.size?$e:Ge}),Fl($e=>{const Ge=new Set([...$e].filter(pt=>ce.has(pt)));return Ge.size===$e.size?$e:Ge}),ts&&!ce.has(ts)&&ns("")},[rt,ts]),p.useEffect(()=>{vl(!1),Ls(new Set),Fl(new Set),Os(""),ns("")},[re==null?void 0:re.runtimeId]),p.useEffect(()=>{const ce=new Set(Nn.filter($e=>$e.canDelete===!0).map($e=>$e.id));un($e=>{const Ge=new Set([...$e].filter(pt=>ce.has(pt)));return Ge.size===$e.size?$e:Ge})},[Nn]),p.useEffect(()=>{const ce=new Set($n.map($e=>$e.id));Mn($e=>{const Ge=new Set([...$e].filter(pt=>ce.has(pt)));return Ge.size===$e.size?$e:Ge})},[$n]);const Em=p.useMemo(()=>!v||!(re!=null&&re.runtimeId)||v.runtimeId!==re.runtimeId||Le&&v.agentName&&v.agentName!==Le?null:{...v,tag:_(v.kind==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")},[v,re==null?void 0:re.runtimeId,Le,_]),xo=p.useMemo(()=>VGt(_),[_]),In=p.useMemo(()=>re!=null&&re.runtimeId?Em?[Em,...rt.filter(ce=>ce.id!==Em.id&&(!ce.messageId||ce.messageId!==Em.messageId))]:rt:xo,[xo,rt,Em,re==null?void 0:re.runtimeId]),Cm=In.filter(ce=>{if(ce.kind!==Et||(ce.source==="auto"?"auto":"user")!==Xe)return!1;const Ge=It.trim().toLowerCase();return Ge?[ce.input,ce.output,ce.referenceOutput,ce.comment,ce.tag??"",ce.sessionId,ce.messageId,ce.userId,ce.evaluationSetName].join(" ").toLowerCase().includes(Ge):!0}),IO=Cm.filter(ce=>Ll.has(ce.id)),PO=!!(re!=null&&re.runtimeId),a2=ce=>{At(ce),Gt(""),Os("");const $e=In.find(Ge=>Ge.kind===ce);ns(($e==null?void 0:$e.id)??""),window.setTimeout(()=>{var Ge;(Ge=Kc.current)==null||Ge.scrollIntoView({behavior:"smooth",block:"start"})},0)},KL=ce=>{Os(""),Ls($e=>{const Ge=new Set($e);return Ge.has(ce.id)?Ge.delete(ce.id):Ge.add(ce.id),Ge})},DO=()=>{Os(""),Ls(new Set(Cm.map(ce=>ce.id)))},Ud=()=>{Os(""),Ls(new Set),vl(!1)},o2=ce=>{Fl($e=>{const Ge=new Set($e);return Ge.has(ce)?Ge.delete(ce):Ge.add(ce),Ge})},MO=ce=>{ns(ce.id),Os(""),!(!ce.sessionId||!ce.messageId)&&(R==null||R(ce))},l2=async ce=>{if(!(re!=null&&re.runtimeId)||!Le||Ma||ce.length===0)return;const $e=ce.length===1?_("agentWorkspace.deleteOneCaseConfirm"):_("agentWorkspace.deleteCasesConfirm",{count:ce.length});if(!window.confirm($e))return;const Ge=ce.map(ln=>ln.id),pt=new Set(Ge);rn(!0),Os("");try{await lTe({runtimeId:re.runtimeId,region:re.region??"cn-beijing",appName:Le,itemIds:Ge});const ln=new Map;for(const Ze of ce)ln.set(Ze.kind,(ln.get(Ze.kind)??0)+1);zt(Ze=>Ze.filter(En=>!pt.has(En.id))),bt(Ze=>Ze.map(En=>({...En,itemCount:Math.max(0,En.itemCount-(ln.get(En.kind)??0))}))),Ls(Ze=>new Set([...Ze].filter(En=>!pt.has(En)))),Fl(Ze=>new Set([...Ze].filter(En=>!pt.has(En)))),ts&&pt.has(ts)&&ns(""),ce.length>1&&vl(!1),A==null||A(ce)}catch(ln){Os(ln instanceof Error?ln.message:String(ln))}finally{rn(!1)}},c2=ce=>{Lt($e=>$e.map(Ge=>Ge.id===ce.id?ce:Ge))},Bh=()=>{const ce=new Set(e.map(pt=>pt.id)),$e=n.filter(pt=>ce.has(pt)),Ge=new Set($e);return[...$e,...e.filter(pt=>!Ge.has(pt.id)).map(pt=>pt.id)]},Ss=(ce,$e,Ge)=>{if(!S||ce===$e)return;const pt=Bh().filter(En=>En!==ce),ln=pt.indexOf($e),Ze=ln<0?pt.length:Ge==="after"?ln+1:ln;pt.splice(Ze,0,ce),S(pt)},u2=(ce,$e)=>{if(!vt||vt===$e)return;const Ge=ce.currentTarget.getBoundingClientRect();cn($e),on(ce.clientY>Ge.top+Ge.height/2?"after":"before")},gv=(ce,$e)=>{if(!S)return;const Ge=Bh(),pt=Ge.indexOf(ce),ln=Math.max(0,Math.min(Ge.length-1,pt+$e));pt<0||pt===ln||(Ge.splice(pt,1),Ge.splice(ln,0,ce),S(Ge))},bv=ce=>{ce.canDelete===!0&&(zn(""),un($e=>{const Ge=new Set($e);return Ge.has(ce.id)?Ge.delete(ce.id):Ge.add(ce.id),Ge}))},LO=ce=>{zn(""),Mn($e=>{const Ge=new Set($e);return Ge.has(ce.id)?Ge.delete(ce.id):Ge.add(ce.id),Ge})},GL=()=>{zn(""),un(new Set(hv.map(ce=>ce.id))),Mn(new Set($n.map(ce=>ce.id)))},XL=()=>{zn(""),un(new Set),Mn(new Set),Sn(!1)},YL=()=>{if(Mf===0||ei)return;const ce=Mb.length,$e=gc.length;if(ce===1&&$e===0){Bb(Mb[0]);return}zn(""),di({kind:"selection",title:_(ce===1&&$e===0?"agentWorkspace.deleteAgentTitle":ce===0&&$e===1?"myAgents.deleteDraftTitle":"agentWorkspace.deleteSelectedTitle"),description:ce===1&&$e===0?_("agentWorkspace.deleteAgentDescription",{name:Mb[0].label}):ce===0&&$e===1?_("agentWorkspace.deleteDraftDescription",{name:gc[0].draft.name||_("agentSelector.unnamedAgent")}):_("agentWorkspace.deleteSelectionDescription",{count:Mf,warning:ce>0?_("agentWorkspace.runtimeDeletionWarning",{count:ce}):_("agentWorkspace.draftDeletionWarning")}),confirmLabel:_(ce===0&&$e===1?"myAgents.deleteDraft":"agentWorkspace.deleteSelected"),agents:Mb,drafts:gc})},yv=async()=>{if(!(!Rn||ei)){Bn(!0),zn("");try{if(Rn.kind==="selection"){const{agents:ce,drafts:$e}=Rn;if(ce.length>0){if(!C)throw new Error(_("agentWorkspace.errors.deleteDeployedUnsupported"));await C(ce)}$e.length>0&&(E==null||E($e)),un(new Set),Mn(new Set),Sn(!1),ce.some(Ge=>Ge.id===U)&&J(""),$e.some(Ge=>Ge.id===z)&&Z("")}else if(Rn.kind==="agent"){if(!C)throw new Error(_("agentWorkspace.errors.deleteDeployedUnsupported"));await C([Rn.agent]),U===Rn.agent.id&&J("")}else{if(!E)throw new Error(_("agentWorkspace.errors.deleteDraftUnsupported"));E([Rn.draft]),z===Rn.draft.id&&Z("")}di(null)}catch(ce){zn(ce instanceof Error?ce.message:String(ce))}finally{Bn(!1)}}},Bb=async ce=>{if(!C||ce.canDelete!==!0||ei)return;zn("");let $e=null;if(ce.agentCategory==="mpa"){if(!ce.runtimeId||!ce.region){zn(_("agentWorkspace.errors.loadMpaDeletePreview"));return}try{$e=await CTe({mpaInstanceId:ce.mpaInstanceId??ce.runtimeId,runtimeId:ce.runtimeId,region:ce.region})}catch(Ge){zn(Ge instanceof Error?Ge.message:String(Ge));return}}di({kind:"agent",title:_("agentWorkspace.deleteAgentTitle"),description:$e?a.jsx(YGt,{preview:$e,t:_}):_("agentWorkspace.deleteAgentDescription",{name:ce.label}),confirmLabel:_("agentWorkspace.deleteAgent"),canConfirm:$e?$e.canDelete:!0,agent:ce})},rs=ce=>{if(!E||ei)return;const $e=ce.draft.name||_("agentSelector.unnamedAgent");zn(""),di({kind:"draft",title:_("myAgents.deleteDraftTitle"),description:_("agentWorkspace.deleteDraftDescription",{name:$e}),confirmLabel:_("myAgents.deleteDraft"),draft:ce})},Am=()=>{const ce=`eval-${Date.now()}`,$e={id:ce,name:_("agentWorkspace.newEvaluationGroupName",{count:lt.length+1}),agentIds:[],caseSet:"核心回归集",evaluator:"综合质量评估器",metrics:["回答质量"],concurrency:"4",history:[]};Lt(Ge=>[$e,...Ge]),wn(ce)},mi=ce=>{c2({...ce,history:[{id:`run-${Date.now()}`,createdAt:_("agentWorkspace.evaluationDefaults.justNow"),score:86+ce.history.length%7,status:"completed"},...ce.history]})};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`aw-root${x?" is-detail-only":""}`,children:[a.jsxs("nav",{className:"aw-view-tabs","aria-label":_("agentWorkspace.workspace"),children:[a.jsx("button",{type:"button",className:F==="library"?"is-active":"","aria-pressed":F==="library",onClick:()=>{M("library"),ft("")},children:_("agentWorkspace.library")}),a.jsx("button",{type:"button",className:F==="evaluation"?"is-active":"","aria-pressed":F==="evaluation",onClick:()=>{M("evaluation"),ft("")},children:_("agentWorkspace.evaluation")})]}),a.jsxs("div",{className:"aw-workspace-frame",children:[a.jsxs("div",{className:"aw-workspace","aria-hidden":F==="evaluation"||void 0,ref:ce=>{ce==null||ce.toggleAttribute("inert",F==="evaluation")},children:[a.jsxs("aside",{className:"aw-sidebar","aria-label":_(F==="library"?"agentWorkspace.agentList":"agentWorkspace.evaluationGroupList"),children:[a.jsxs("label",{className:"aw-search",children:[a.jsx(fI,{"aria-hidden":!0}),a.jsx("input",{value:et,onChange:ce=>ft(ce.currentTarget.value),placeholder:_(F==="library"?"myAgents.searchAgents":"agentWorkspace.searchEvaluationGroups"),"aria-label":_(F==="library"?"myAgents.searchAgents":"agentWorkspace.searchEvaluationGroups")})]}),a.jsxs("button",{type:"button",className:"aw-create-card",onClick:F==="library"?N:Am,disabled:F==="library"&&!o,children:[a.jsx(ic,{"aria-hidden":!0}),a.jsx("span",{children:_(F==="library"?"agentWorkspace.newAgent":"agentWorkspace.newEvaluationGroup")})]}),F==="library"&&(C||E)&&a.jsx("div",{className:`aw-selection-toolbar${On?" is-active":""}`,children:On?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"aw-selection-count",children:_("agentWorkspace.selectedCount",{count:Mf})}),a.jsx("button",{type:"button",onClick:GL,disabled:JT===0||ei,children:_("agentWorkspace.selectAll")}),a.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void YL(),disabled:Mf===0||ei,children:_(ei?"common.deleting":"agentWorkspace.deleteSelected")}),a.jsx("button",{type:"button",onClick:XL,disabled:ei,children:_("common.cancel")})]}):a.jsx("button",{type:"button",onClick:()=>{zn(""),Sn(!0)},disabled:JT===0,children:_("common.select")})}),F==="library"&&ki&&a.jsx("div",{className:"aw-delete-error",role:"alert",children:ki}),a.jsx("div",{className:"aw-agent-list",children:F==="evaluation"?is.length===0?a.jsx("div",{className:"aw-list-empty",children:_("agentWorkspace.noMatchingEvaluationGroups")}):is.map(ce=>a.jsxs("button",{type:"button",className:`aw-agent-item${ce.id===Ln?" is-active":""}`,onClick:()=>wn(ce.id),children:[a.jsxs("span",{className:"aw-agent-copy aw-eval-group-copy",children:[a.jsx("strong",{children:ES(ce.name,_)}),a.jsx("small",{children:_("agentWorkspace.groupStats",{agents:ce.agentIds.length,runs:ce.history.length})})]}),a.jsx(nE,{"aria-hidden":!0})]},ce.id)):u&&Nn.length===0&&$n.length===0?a.jsx("div",{className:"aw-list-empty",children:_("agentWorkspace.loadingCloudAgents")}):d&&Nn.length===0&&$n.length===0?a.jsxs("div",{className:"aw-list-empty aw-list-error",children:[a.jsx("span",{children:d}),k&&a.jsx("button",{type:"button",onClick:k,children:_("common.retry")})]}):Nn.length===0&&$n.length===0?a.jsx("div",{className:"aw-list-empty",children:_("myAgents.noMatchingAgents")}):a.jsxs(a.Fragment,{children:[$n.map(ce=>{const Ge=f.filter(ln=>ln.draftId===ce.id).sort((ln,Ze)=>Ze.startedAt-ln.startedAt)[0]??f.filter(ln=>{var Ze,En;return((Ze=ln.agentDraft)==null?void 0:Ze.name)===ce.draft.name||ln.agentName===ce.draft.name||!!((En=ce.deploymentTarget)!=null&&En.runtimeId)&&ln.runtimeId===ce.deploymentTarget.runtimeId}).sort((ln,Ze)=>Ze.startedAt-ln.startedAt)[0],pt=lr.has(ce.id);return a.jsxs("button",{type:"button",className:["aw-agent-item",On?"is-selecting":"",pt?"is-selected-for-delete":"",ce.id===z?"is-active":""].filter(Boolean).join(" "),"aria-pressed":On?pt:void 0,onClick:()=>{if(On){LO(ce);return}J(""),Z(ce.id),q("basic")},children:[On&&a.jsx("span",{className:`aw-select-marker${pt?" is-checked":""}`,"aria-hidden":"true"}),a.jsxs("span",{className:"aw-agent-copy",children:[a.jsxs("span",{className:"aw-agent-name-row",children:[a.jsx("strong",{children:ce.draft.name||_("agentSelector.unnamedAgent")}),a.jsx("span",{className:`aw-draft-badge${(Ge==null?void 0:Ge.status)==="running"?" is-deploying":""}`,children:(Ge==null?void 0:Ge.status)==="running"?_("myAgents.deploying"):_("myAgents.draft")})]}),a.jsx("small",{children:ce.deploymentTarget?_("agentWorkspace.updatePending"):_("agentWorkspace.notPublished")})]}),a.jsx(nE,{"aria-hidden":!0})]},ce.id)}),Nn.map(ce=>{const $e=ce.runtimeId?Wt.get(ce.runtimeId):void 0,Ge=ce.runtimeId?jn.get(ce.runtimeId):void 0,pt=Qi.has(ce.id),ln=ce.canDelete===!0,Ze=($e==null?void 0:$e.status)==="running"?{label:_("myAgents.deploying"),className:" is-deploying"}:($e==null?void 0:$e.status)==="error"?{label:_("agentWorkspace.failed"),className:" is-error"}:($e==null?void 0:$e.status)==="cancelled"?{label:_("agentWorkspace.cancelled"),className:" is-muted"}:Ge?{label:_("agentWorkspace.updatePending"),className:""}:null,En=($e==null?void 0:$e.status)==="running"?_("agentWorkspace.updatingDeployment"):Ge?_("agentWorkspace.updatePending"):ce.remote?ce.host||_("agentWorkspace.remoteAgent"):_("agentWorkspace.localAgent"),Lr=["aw-agent-item","aw-agent-item--sortable",ce.id===U?"is-active":"",On?"is-selecting":"",pt?"is-selected-for-delete":"",On&&!ln?"is-selection-disabled":"",ce.id===vt?"is-dragging":"",ce.id===Qt&&ce.id!==vt?`is-drop-target is-drop-${Me}`:""].filter(Boolean).join(" ");return a.jsxs("button",{type:"button",draggable:!!S&&!On,className:Lr,"aria-pressed":On?pt:void 0,"aria-keyshortcuts":S?"Alt+ArrowUp Alt+ArrowDown":void 0,onDragStart:Ri=>{S&&(zo.current=!0,tn(ce.id),Ri.dataTransfer.effectAllowed="move",Ri.dataTransfer.setData("text/plain",ce.id))},onDragEnter:Ri=>{u2(Ri,ce.id)},onDragOver:Ri=>{!vt||vt===ce.id||(Ri.preventDefault(),Ri.dataTransfer.dropEffect="move",u2(Ri,ce.id))},onDragLeave:Ri=>{const hs=Ri.relatedTarget;hs instanceof Node&&Ri.currentTarget.contains(hs)||Qt===ce.id&&cn("")},onDrop:Ri=>{Ri.preventDefault();const hs=Ri.dataTransfer.getData("text/plain")||vt;Ss(hs,ce.id,Me),tn(""),cn(""),on("before")},onDragEnd:()=>{tn(""),cn(""),on("before"),window.setTimeout(()=>{zo.current=!1},0)},onKeyDown:Ri=>{Ri.altKey&&(Ri.key==="ArrowUp"?(Ri.preventDefault(),gv(ce.id,-1)):Ri.key==="ArrowDown"&&(Ri.preventDefault(),gv(ce.id,1)))},onClick:Ri=>{if(On){Ri.preventDefault(),bv(ce);return}if(zo.current){Ri.preventDefault(),zo.current=!1;return}Z(""),J(ce.id),q("basic"),j(ce.id)},children:[On&&a.jsx("span",{className:`aw-select-marker${pt?" is-checked":""}`,"aria-hidden":"true"}),a.jsxs("span",{className:"aw-agent-copy",children:[a.jsxs("span",{className:"aw-agent-name-row",children:[a.jsx("strong",{children:ce.label}),ce.currentVersion!=null&&a.jsxs("span",{className:"aw-version-badge",children:["v",ce.currentVersion]}),Ze&&a.jsx("span",{className:`aw-draft-badge${Ze.className}`,children:Ze.label})]}),a.jsx("small",{children:En})]}),a.jsx(nE,{"aria-hidden":!0})]},ce.id)})]})}),a.jsx("div",{className:"aw-list-count",children:_("agentWorkspace.totalCount",{count:F==="library"?e.length+ai:lt.length})})]}),F==="evaluation"&&TO?a.jsx(_Xt,{group:TO,agents:e,cases:In,onChange:c2,onRun:mi}):F==="evaluation"?a.jsx("main",{className:"aw-main aw-empty-selection",children:a.jsx("p",{children:_("agentWorkspace.noEvaluationGroupSelected")})}):!re&&!Vn&&!bi?a.jsx("main",{className:"aw-main aw-empty-selection",children:a.jsx("p",{children:_("agentWorkspace.noAgentSelected")})}):a.jsxs("main",{className:`aw-main${Hu?" is-deploying":""}${x?" resource-page":""}`,children:[re&&!oe&&s&&a.jsx("div",{className:"aw-detail-loading",role:"status","aria-live":"polite",children:a.jsxs("div",{className:"aw-detail-loading-card",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsxs("span",{children:[a.jsx("strong",{children:_("agentWorkspace.loadingAgent")}),a.jsx("small",{children:_("agentWorkspace.loadingAgentDescription")})]})]})}),Fe==="integrations"&&se&&a.jsx("div",{className:"aw-detail-loading",role:"status","aria-live":"polite",children:a.jsxs("div",{className:"aw-detail-loading-card",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsxs("span",{children:[a.jsx("strong",{children:_("agentWorkspace.probingIntegration")}),a.jsx("small",{children:_("agentWorkspace.probingIntegrationDescription")})]})]})}),a.jsx(oT,{className:"aw-agent-detail",title:Bd,description:Ba.description||_(s||x&&!mt?"agentWorkspace.loadingAgentInfo":"common.noDescription"),identitySeed:Bd,backLabel:_("agentWorkspace.backToAgentList"),onBack:x?O:void 0,meta:a.jsxs(a.Fragment,{children:[Fh!=null&&a.jsxs("span",{className:"aw-agent-meta",children:["v",Fh]}),Vn&&a.jsx("span",{className:"aw-agent-meta",children:_("myAgents.draft")}),La&&a.jsx("span",{className:"aw-agent-meta",children:_("agentWorkspace.updatePending")}),!re&&!Vn&&bi&&a.jsx("span",{className:"aw-agent-meta",children:bi.label})]}),actionsClassName:"aw-head-actions",bodyClassName:"aw-agent-detail__body",actions:Vn||La||re!=null&&re.canDelete?a.jsxs(a.Fragment,{children:[(Vn||La)&&a.jsxs(_t,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>{const ce=Vn??La;ce&&rs(ce)},disabled:ei,"aria-label":_("myAgents.deleteDraft"),title:_("myAgents.deleteDraft"),children:[a.jsx(Jg,{"aria-hidden":!0}),a.jsx("span",{children:_("myAgents.deleteDraft")})]}),(re==null?void 0:re.canDelete)&&a.jsxs(_t,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>void Bb(re),disabled:ei,"aria-label":_("agentWorkspace.deleteAgent"),title:_("agentWorkspace.deleteAgent"),children:[a.jsx(Jg,{"aria-hidden":!0}),a.jsx("span",{children:_(ei?"common.deleting":"agentWorkspace.deleteAgent")})]})]}):void 0,sections:$t.map(ce=>{var $e,Ge,pt,ln;return{key:ce.id,label:ce.label,disabled:Hu,content:ce.id===Fe?a.jsxs(a.Fragment,{children:[Vr&&pv&&a.jsx("div",{className:`aw-detail-deployment${Hu?" is-running":""}`,children:a.jsx(SXt,{task:Vr,onReturnToEdit:Sm&&D?()=>D(Sm):void 0})}),a.jsxs("div",{className:"aw-content",children:[Fe==="basic"&&a.jsxs("div",{className:"aw-basic-stack",children:[Yt&&a.jsx(Mg,{className:"aw-detail-fetch-alert",color:"warning",variant:"soft",title:_("agentWorkspace.partialInfoUnavailable"),description:_("agentWorkspace.upgradeRuntimeForDetails")}),(Ot&&!Yt||Ke)&&a.jsx(Mg,{className:"aw-detail-fetch-alert",color:"danger",variant:"soft",title:_("agentWorkspace.detailLoadFailed"),description:_("agentWorkspace.detailLoadFailedDescription"),actions:a.jsx(_t,{type:"button",color:"danger",variant:"soft",size:"sm",pill:!1,onClick:()=>nt(Ze=>Ze+1),children:_("common.retry")})}),st==="mpa"&&(es||Di||wr)&&a.jsx(Mg,{className:"aw-detail-fetch-alert",color:wr==="bound"&&!Di?"success":"warning",variant:"soft",title:_("agentWorkspace.mpaControlPlane"),description:es?_("agentWorkspace.loadingMpaAgentView"):Di||Fd||_(wr==="bound"?"agentWorkspace.mpaRuntimeBound":wr==="binding_ambiguous"?"agentWorkspace.mpaRuntimeBindingAmbiguous":wr==="orphan_runtime"?"agentWorkspace.mpaRuntimeOrphan":"agentWorkspace.mpaRuntimeMissing")}),re&&st!=="mpa"&&yt&&!yt.canUpdate&&a.jsxs("div",{className:"aw-update-recovery-notice",role:yt.recoveryStatus==="preparing"?"status":"alert",children:[a.jsx("strong",{children:yt.recoveryStatus==="preparing"?_("agentWorkspace.restoringUpdateConfig"):_("agentWorkspace.updateConfigUnavailable")}),Vo&&a.jsx("span",{children:Vo}),Xi.map(Ze=>a.jsx("span",{children:Ze},Ze))]}),a.jsxs("section",{className:"aw-deployment-panel aw-settings-card",children:[a.jsx("div",{className:"aw-section-head",children:a.jsxs("div",{children:[a.jsx("h3",{children:_("agentWorkspace.deploymentConfig")}),a.jsx("p",{children:_("agentWorkspace.deploymentConfigDescription")})]})}),a.jsxs("dl",{className:"aw-readonly-config",children:[a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.runtimeStatus")}),a.jsxs("dd",{className:(ne==null?void 0:ne.status.toLowerCase())==="ready"?"is-ready":void 0,children:[(ne==null?void 0:ne.status.toLowerCase())==="ready"&&a.jsx("span",{className:"aw-status-dot"}),(ne==null?void 0:ne.status)||_("agentWorkspace.loading")]})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.deploymentRegion")}),a.jsx("dd",{children:(ne==null?void 0:ne.region)||(re==null?void 0:re.region)||(Vr==null?void 0:Vr.region)||_("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.networkAccess")}),a.jsx("dd",{children:ne!=null&&ne.networkTypes.length?ne.networkTypes.join(" / "):_("agentWorkspace.notAvailable")})]})]})]}),a.jsxs("section",{className:"aw-canvas-card",children:[a.jsx("div",{className:"aw-card-head",children:a.jsx("strong",{children:_("agentWorkspace.executionFlow")})}),a.jsx("div",{className:"aw-canvas",children:a.jsx(IP,{draft:Ba,direction:"horizontal",selectedPath:[],onSelect:()=>{},onAdd:()=>{},onInsert:()=>{},onDelete:()=>{},readOnly:!0,interactivePreview:!0},Pi)})]}),a.jsxs("section",{className:"aw-details-card",children:[a.jsx("div",{className:"aw-card-head",children:a.jsx("strong",{children:_("agentWorkspace.details")})}),a.jsxs("dl",{className:"aw-facts",children:[a.jsxs("div",{children:[a.jsx("dt",{children:_("agentSelector.model")}),a.jsx("dd",{children:dH(oe==null?void 0:oe.model)||Ba.modelName||_("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.agentCountLabel")}),a.jsx("dd",{children:oe!=null&&oe.graph?i9e(oe.graph):r9e(Ba)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentSelector.tools")}),a.jsx("dd",{className:"aw-fact-badges",children:km.length?km.map(Ze=>a.jsx("span",{children:Ze},Ze)):_("agentWorkspace.none")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentSelector.skills")}),a.jsx("dd",{className:"aw-fact-badges",children:Fb===null?_("agentSelector.previewUnsupported"):Fb.length?Fb.map(Ze=>a.jsx("span",{children:Ze},Ze)):_("agentWorkspace.none")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("systemInfo.currentVersion")}),a.jsx("dd",{children:Fh!=null?`v${Fh}`:_("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentSelector.status")}),a.jsx("dd",{children:Vn?_("myAgents.draft"):(Vr==null?void 0:Vr.status)==="error"?_("agentWorkspace.deploymentFailed"):(Vr==null?void 0:Vr.status)==="cancelled"?_("agentWorkspace.cancelled"):La?_("agentWorkspace.updatePending"):a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"aw-status-dot"}),_("skillCenter.status.available")]})})]})]})]}),a.jsxs("section",{className:"aw-sidecar-panel aw-settings-card","aria-label":_("agentWorkspace.selectedOptimizations"),children:[a.jsx("div",{className:"aw-section-head",children:a.jsxs("div",{children:[a.jsx("h3",{children:_("agentWorkspace.selectedOptimizations")}),a.jsx("p",{children:_("agentWorkspace.selectedOptimizationsDescription")})]})}),a.jsxs("dl",{className:"aw-readonly-config",children:[a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.configurationStatus")}),a.jsx("dd",{className:Dn!=null&&Dn.enabled?"is-ready":void 0,children:Dn?Dn.enabled?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"aw-status-dot"}),_("skillCenter.status.enabled")]}):_("skillCenter.status.inactive"):_("agentWorkspace.notRecorded")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.optimizationProfile")}),a.jsx("dd",{children:Dn?amt(Dn.profile):_("agentWorkspace.legacyConfigMissing")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.selectedOptimizations")}),a.jsx("dd",{className:"aw-fact-badges",children:Dn?e2.length?e2.map(Ze=>a.jsx("span",{children:SN(Ze)},Ze)):_("agentWorkspace.noneSelected"):_("agentWorkspace.legacyConfigMissing")})]})]})]})]}),Fe==="usage"&&(re==null?void 0:re.runtimeId)&&a.jsxs("section",{className:"aw-usage","aria-busy":Ws,children:[a.jsx("div",{className:"aw-usage-intro",children:a.jsx("h3",{children:_("agentWorkspace.usageOverview")})}),Ws&&!Ti&&a.jsx("div",{className:"aw-usage-state",role:"status","aria-live":"polite",children:a.jsx(fn,{as:"span",children:_("agentWorkspace.loadingUsage")})}),rr&&a.jsxs("div",{className:"aw-usage-state is-error",role:"alert",children:[a.jsx("span",{children:rr}),a.jsx("button",{type:"button",onClick:()=>hl(Ze=>Ze+1),children:_("common.retry")})]}),!Ws&&!rr&&!Ti&&!Le&&a.jsx("div",{className:"aw-usage-state",children:_("agentWorkspace.usageUnavailable")}),Ti&&a.jsxs(a.Fragment,{children:[a.jsxs("dl",{className:"aw-usage-summary","aria-label":_("agentWorkspace.usageSummary"),children:[a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.totalCalls")}),a.jsx("dd",{children:Ti.totalInvocations.toLocaleString(L.resolvedLanguage??L.language)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.userCount")}),a.jsx("dd",{children:Ti.totalUsers.toLocaleString(L.resolvedLanguage??L.language)})]})]}),a.jsxs("div",{className:"aw-usage-users-head",children:[a.jsx("h3",{children:_("agentWorkspace.userDetails")}),Ws&&a.jsx(fn,{as:"span",role:"status","aria-live":"polite",children:_("agentWorkspace.refreshing")})]}),Ti.users.length===0?a.jsx("div",{className:"aw-usage-state",children:_("agentWorkspace.noUsage")}):a.jsx("div",{className:"aw-usage-table-wrap",children:a.jsxs("table",{className:"aw-usage-table",children:[a.jsx("caption",{children:_("agentWorkspace.usageUserList")}),a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:_("agentWorkspace.user")}),a.jsx("th",{scope:"col",children:_("agentWorkspace.callCount")}),a.jsx("th",{scope:"col",children:_("agentWorkspace.lastUsed")})]})}),a.jsx("tbody",{children:Ti.users.map(Ze=>a.jsxs("tr",{children:[a.jsxs("td",{children:[a.jsx("strong",{children:Ze.displayName||Ze.userId||_("agentWorkspace.unknownUser")}),Ze.displayName&&Ze.userId&&a.jsx("small",{title:Ze.userId,children:Ze.userId})]}),a.jsx("td",{children:Ze.invocationCount.toLocaleString(L.resolvedLanguage??L.language)}),a.jsx("td",{children:a.jsx("time",{dateTime:Ze.lastUsedAt,children:JBe(Ze.lastUsedAt,L.resolvedLanguage??L.language,_)})})]},Ze.userId))})]})}),Ti.totalPages>1&&a.jsxs("nav",{className:"aw-usage-pagination","aria-label":_("agentWorkspace.usagePagination"),children:[a.jsx("button",{type:"button",disabled:Ws||Ti.page<=1,onClick:()=>ws(Ze=>Math.max(1,Ze-1)),children:_("common.previousPage")}),a.jsx("span",{"aria-live":"polite",children:_("agentWorkspace.pageOf",{page:Ti.page,total:Ti.totalPages})}),a.jsx("button",{type:"button",disabled:Ws||Ti.page>=Ti.totalPages,onClick:()=>ws(Ze=>Ze+1),children:_("common.nextPage")})]})]})]}),Fe==="sessionConfig"&&a.jsx(oXt,{config:gr,profileStatus:zi,loadable:Lh,disabledReason:$b,loading:Pa,saving:Uu,upgrading:hc,error:Md,notice:Ld,modelValue:gl,modelDirty:zu,profileUpgradeAvailable:Rr,onModelChange:Fo,onSaveModel:()=>void r2(),onInheritModel:()=>void r2("inherit"),onClearMcp:()=>void RO("clear"),onInheritMcp:()=>void RO("inherit"),onUpgradeProfile:()=>void WL(),onRefresh:()=>Da(Ze=>Ze+1)}),Fe==="profileConfig"&&a.jsx(aXt,{profile:t2,profileStatus:zi,runtimeReady:Db,disabledReason:qL,saving:Uo.saving,error:Uo.error,notice:Uo.notice,onApply:()=>void mv(),onEditProfile:s2,onRefresh:()=>nt(Ze=>Ze+1)}),Fe==="diagnostics"&&a.jsx(uXt,{data:dv,loadable:!n2,disabledReason:n2,loading:ml,error:gi,onRefresh:()=>Ks(Ze=>Ze+1),locale:L.resolvedLanguage??L.language}),Fe==="versions"&&a.jsxs("section",{className:"aw-version-stack",children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:_("agentWorkspace.githubVersions")}),a.jsx("p",{children:($e=ge==null?void 0:ge.cicd)!=null&&$e.enabled?_("agentWorkspace.githubVersionsDescription"):_("agentWorkspace.currentVersionOnly")})]}),Se&&a.jsx("div",{className:"aw-case-empty",children:_("agentWorkspace.loadingVersions")}),Ye&&a.jsxs("div",{className:"aw-integration-error",role:"alert",children:[a.jsx("span",{children:Ye}),(re==null?void 0:re.runtimeId)&&a.jsx("button",{type:"button",onClick:()=>void dN(re.runtimeId??"").then(Oe),children:_("common.retry")})]}),!Se&&!Ye&&a.jsxs("div",{className:"aw-version-list",children:[(ge==null?void 0:ge.githubSyncError)&&a.jsx("div",{className:"aw-integration-error",role:"alert",children:a.jsx("span",{children:ge.githubSyncError})}),(ge==null?void 0:ge.latestSourceRuntimeStatus)&&ge.latestSourceRuntimeStatus!=="published"&&((Ge=ge.versions[0])==null?void 0:Ge.commitSha)&&ge.versions[0].commitSha!==ge.currentCommitSha&&a.jsx("div",{className:"aw-integration-notice",role:"status",children:a.jsxs("span",{children:[_("agentWorkspace.sourceMergedRuntimeStill"),$oe(ge.latestSourceRuntimeStatus,_),_("agentWorkspace.currentProductionVersionHint")]})}),ge!=null&&ge.versions.length?ge.versions.map(Ze=>{var sa;const En=Ze.commitSha??"",Lr=Ze.runtimeStatus??Ze.status,Ri=Ze.changeType==="rollback",hs=!!((sa=ge.cicd)!=null&&sa.enabled)&&!!En&&!Ri&&En!==ge.currentCommitSha;return a.jsxs("article",{className:"aw-version-row",children:[a.jsxs("div",{children:[a.jsx("strong",{children:tXt(Ze,_)}),a.jsx("small",{children:Ze.createdAt||_("agentWorkspace.noTime")})]}),a.jsxs("div",{children:[a.jsx("span",{children:_("agentWorkspace.prLink")}),Ze.pullRequestUrl?a.jsx("a",{href:Ze.pullRequestUrl,target:"_blank",rel:"noopener noreferrer",children:_("agentWorkspace.viewPr")}):a.jsx("em",{children:_("agentWorkspace.noPr")})]}),a.jsxs("div",{children:[a.jsx("span",{children:_("agentWorkspace.author")}),a.jsx("em",{children:Ze.author||"Studio"})]}),a.jsxs("div",{children:[a.jsx("span",{children:_("agentWorkspace.publishStatus")}),a.jsx("em",{children:$oe(Lr,_)})]}),a.jsxs("div",{className:"aw-version-actions",children:[a.jsx("button",{type:"button",disabled:!hs||we===En,onClick:()=>void jO(Ze),children:_(we===En?"agentWorkspace.rollingBack":"agentWorkspace.rollbackToVersion")}),Ze.workflowRunUrl&&a.jsx("a",{href:Ze.workflowRunUrl,target:"_blank",rel:"noopener noreferrer",children:_("agentWorkspace.viewRelease")})]})]},`${Ze.version}-${En||Ze.createdAt}`)}):a.jsxs("article",{className:"aw-version-row",children:[a.jsxs("div",{children:[a.jsx("strong",{children:Fh!=null?`v${Fh}`:_("agentWorkspace.noVersion")}),a.jsx("small",{children:(ne==null?void 0:ne.updatedAt)||_("agentWorkspace.noTime")})]}),a.jsx("p",{children:_("agentWorkspace.currentVersionOnly")})]})]})]}),Fe==="integrations"&&a.jsxs("div",{className:"aw-integration-stack",children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:_("agentWorkspace.integrationMethods")}),a.jsx("p",{children:_("agentWorkspace.integrationDescription")})]}),X&&a.jsxs("div",{className:"aw-integration-error",role:"alert",children:[a.jsx("span",{children:X}),a.jsx("button",{type:"button",onClick:()=>be(Ze=>Ze+1),children:_("common.retry")})]}),!X&&a.jsxs("div",{className:"aw-integration-body",children:[a.jsxs("div",{className:`aw-integration-protocol-tabs${ue==="a2a"?" is-a2a":""}`,role:"tablist","aria-label":_("agentWorkspace.integrationProtocol"),children:[a.jsx("span",{className:"aw-integration-protocol-slider","aria-hidden":"true"}),Pk.map((Ze,En)=>a.jsx("button",{type:"button",id:`integration-${Ze.id}-tab`,role:"tab","aria-selected":ue===Ze.id,"aria-controls":`integration-${Ze.id}-panel`,tabIndex:ue===Ze.id?0:-1,onClick:()=>fs(Ze.id),onKeyDown:Lr=>{var sa;if(!["ArrowLeft","ArrowRight","Home","End"].includes(Lr.key))return;Lr.preventDefault();const Ri=Lr.key==="Home"?0:Lr.key==="End"?Pk.length-1:(En+(Lr.key==="ArrowRight"?1:-1)+Pk.length)%Pk.length,hs=Pk[Ri];fs(hs.id),(sa=document.getElementById(`integration-${hs.id}-tab`))==null||sa.focus()},children:Ze.label},Ze.id))]}),ue==="api-server"?a.jsx(Boe,{protocol:"api-server",title:"API Server",available:pc,fields:[{label:"Agent",value:pc?((pt=Hn==null?void 0:Hn.apiApps)==null?void 0:pt.join("、"))??"":""},{label:_("agentWorkspace.discoveryEndpoint"),value:pc?u6(Vu,"/list-apps"):""},{label:_("agentWorkspace.invocationEndpoint"),value:pc?u6(Vu,"/run_sse"):""},{label:_("agentWorkspace.authentication"),value:pc?Loe(ne==null?void 0:ne.authType,_):""},{label:"API Key",value:a.jsx(Foe,{available:pc,authType:ne==null?void 0:ne.authType,value:sr,visible:Pe&&!!sr,loading:ze,error:ae,onToggle:()=>void _O()})}],example:pc?nXt(Vu,Om,ne==null?void 0:ne.authType):""}):a.jsx(Boe,{protocol:"a2a",title:"A2A",available:$a,fields:[{label:"Agent",value:((ln=Hn==null?void 0:Hn.a2a)==null?void 0:ln.name)??""},{label:"Agent Card",value:$a?u6(Vu,"/.well-known/agent-card.json"):""},{label:_("agentWorkspace.invocationUrl"),value:Df},{label:_("agentWorkspace.authentication"),value:$a?Loe(ne==null?void 0:ne.authType,_):""},{label:"API Key",value:a.jsx(Foe,{available:$a,authType:ne==null?void 0:ne.authType,value:sr,visible:Pe&&!!sr,loading:ze,error:ae,onToggle:()=>void _O()})}],example:$a?iXt(Df,ne==null?void 0:ne.authType):""})]})]}),Fe==="evaluations"&&a.jsxs("section",{className:"aw-cases",children:[(re==null?void 0:re.runtimeId)&&a.jsx("div",{className:"aw-case-summary",children:["good","bad"].map(Ze=>{const En=bXt(Qe,Ze),Lr=In.filter(hs=>hs.kind===Ze).length,Ri=Em?Lr:(En==null?void 0:En.itemCount)??Lr;return a.jsxs("button",{type:"button",onClick:()=>a2(Ze),children:[a.jsx("strong",{children:Ri}),a.jsx("span",{children:_(Ze==="good"?"agentWorkspace.goodCases":"agentWorkspace.badCases")})]},Ze)})}),a.jsxs("div",{className:"aw-case-filter-bar",children:[a.jsxs("div",{className:"aw-case-filter-stack",children:[a.jsx("div",{className:"aw-case-filters","aria-label":_("agentWorkspace.caseResultFilter"),children:["good","bad"].map(Ze=>a.jsx("button",{type:"button",className:Et===Ze?"is-active":"","aria-pressed":Et===Ze,onClick:()=>At(Ze),children:_(Ze==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")},Ze))}),a.jsx("div",{className:"aw-case-source-filters","aria-label":_("agentWorkspace.feedbackSourceFilter"),children:["auto","user"].map(Ze=>a.jsx("button",{type:"button",className:Xe===Ze?"is-active":"","aria-pressed":Xe===Ze,onClick:()=>wt(Ze),children:_(Ze==="auto"?"agentWorkspace.automaticFeedback":"agentWorkspace.manualFeedback")},Ze))})]}),a.jsxs("label",{className:"aw-case-search",children:[a.jsx(fI,{"aria-hidden":!0}),a.jsx("input",{type:"search",value:It,onChange:Ze=>Gt(Ze.currentTarget.value),placeholder:_("agentWorkspace.searchCasesPlaceholder"),"aria-label":_("agentWorkspace.searchCases")})]})]}),PO&&a.jsx("div",{className:`aw-case-toolbar${Qu?" is-active":""}`,children:Qu?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"aw-selection-count",children:_("agentWorkspace.selectedCaseCount",{count:IO.length})}),a.jsx("button",{type:"button",onClick:DO,disabled:Cm.length===0||Ma,children:_("agentWorkspace.selectAllVisible")}),a.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void l2(IO),disabled:IO.length===0||Ma,children:_(Ma?"common.deleting":"agentWorkspace.deleteSelected")}),a.jsx("button",{type:"button",onClick:Ud,disabled:Ma,children:_("common.cancel")})]}):a.jsx("button",{type:"button",onClick:()=>{Os(""),vl(!0)},disabled:Cm.length===0||Ma,children:_("agentWorkspace.selectCases")})}),$l&&a.jsx("div",{className:"aw-delete-error",role:"alert",children:$l}),a.jsx("div",{ref:Kc,children:a.jsx(TXt,{cases:Cm,loading:Ht&&Cm.length===0,error:jr,notice:qs,runtimeBacked:!!(re!=null&&re.runtimeId),selectionMode:Qu,selectedCaseIds:Ll,focusedCaseId:ts,expandedCaseIds:$d,deleting:Ma,canDelete:PO,onOpenCase:MO,onToggleCase:KL,onToggleExpanded:o2,onDeleteCase:Ze=>void l2([Ze]),onRetry:()=>Si(Ze=>Ze+1)})})]}),Fe==="optimizations"&&a.jsxs("section",{className:"aw-optimizations",children:[a.jsxs("div",{className:"aw-optimization-intro",children:[a.jsx("h3",{children:_("agentWorkspace.optimizations")}),a.jsx("p",{children:_("agentWorkspace.optimizationsDescription")})]}),ga?a.jsxs("div",{className:"aw-optimization-state",role:"status",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsx("span",{children:_("agentWorkspace.loadingOptimizations")})]}):us?a.jsxs("div",{className:"aw-optimization-state is-error",role:"alert",children:[a.jsx("span",{children:us}),a.jsx("button",{type:"button",onClick:()=>bo(Ze=>Ze+1),children:_("common.retry")})]}):Zr.length>0?a.jsx(CXt,{groups:Zr}):a.jsx("div",{className:"aw-optimization-state",children:_("agentWorkspace.noOptimizations")})]})]}),Fe==="basic"&&(re||Vn)&&a.jsxs("div",{className:"aw-basic-actions",children:[re&&a.jsxs("button",{type:"button",className:"aw-talk studio-update-action",onClick:()=>T==null?void 0:T(re),children:[a.jsx(zat,{"aria-hidden":!0}),a.jsx("span",{children:_("agentWorkspace.chat")})]}),st!=="mpa"&&a.jsxs("span",{className:`aw-update-wrap${$h?" is-disabled":""}`,tabIndex:$h?0:void 0,"aria-describedby":$h?Lb:void 0,children:[a.jsx("button",{type:"button",className:"aw-update studio-update-action",disabled:!!$h,"aria-busy":jt||void 0,"aria-describedby":$h?Lb:void 0,onClick:()=>{if(Vn){D==null||D(Vn);return}yt&&P(yt)},children:jt?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"loading-gap-spinner aw-update-spinner","aria-hidden":"true"}),a.jsx("span",{children:_("agentWorkspace.preparing")})]}):_(Vn||La?"agentWorkspace.continueEditing":"agentWorkspace.update")}),$h&&a.jsx("span",{id:Lb,className:"aw-update-disabled-reason",role:"tooltip",children:$h})]})]})]}):null}}),activeSectionKey:Fe,navigationLabel:_("agentWorkspace.agentDetails"),onSectionChange:q})]})]}),F==="evaluation"&&a.jsx("div",{className:"aw-evaluation-glass",role:"status",children:a.jsx("span",{children:_("agentWorkspace.comingSoon")})})]})]}),Rn&&a.jsx(Cd,{variant:"danger",title:Rn.title,description:Rn.description,confirmLabel:ei?_("common.deleting"):Rn.confirmLabel,closeLabel:_("agentWorkspace.closeDeleteConfirmation"),busy:ei,confirmDisabled:Rn.canConfirm===!1,onCancel:()=>di(null),onConfirm:()=>void yv()})]})}function CXt({groups:e}){const{t}=Te("ui");return a.jsx("div",{className:"aw-optimization-table-wrap",children:a.jsxs("table",{className:"aw-optimization-table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:t("agentWorkspace.fixPriority")}),a.jsx("th",{scope:"col",children:t("agentWorkspace.suggestedModule")}),a.jsx("th",{scope:"col",children:t("agentWorkspace.suggestionAndReason")})]})}),a.jsx("tbody",{children:e.map(n=>a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx("span",{className:`aw-priority is-${n.priority}`,children:pXt(n.priority,t)})}),a.jsx("td",{children:a.jsx("span",{className:"aw-optimization-module",children:gXt(n,t)})}),a.jsx("td",{children:a.jsx("ul",{className:"aw-optimization-list",children:n.items.map(i=>a.jsxs("li",{children:[a.jsx("strong",{children:i.suggestion}),a.jsx("p",{children:i.reason})]},`${i.suggestion}:${i.reason}`))})})]},`${n.priority}:${n.module}:${n.customModule??""}`))})]})})}function AXt(){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M4.5 7h15"}),a.jsx("path",{d:"M9 7V4.8h6V7"}),a.jsx("path",{d:"m6.5 7 .8 12h9.4l.8-12"}),a.jsx("path",{d:"M10 10.5v5M14 10.5v5"})]})}function TXt({cases:e,loading:t=!1,error:n="",notice:i="",runtimeBacked:r=!1,selectionMode:s=!1,selectedCaseIds:o,focusedCaseId:l="",expandedCaseIds:c,deleting:u=!1,canDelete:d=!1,onOpenCase:f,onToggleCase:h,onToggleExpanded:m,onDeleteCase:g,onRetry:b}){const{t:v,i18n:y}=Te("ui");return a.jsxs("div",{className:"aw-case-table",children:[a.jsxs("div",{className:"aw-case-row aw-case-row-head",children:[a.jsx("span",{children:v("agentWorkspace.userInput")}),a.jsx("span",{children:v("agentWorkspace.agentOutput")}),a.jsx("span",{children:v("agentWorkspace.score")}),a.jsx("span",{children:v("agentWorkspace.scoreReason")}),a.jsx("span",{className:"aw-case-action-head",children:v("skillCenter.actions")})]}),t?a.jsx("div",{className:"aw-case-empty",children:v("agentWorkspace.loadingEvaluationSet")}):n?a.jsxs("div",{className:"aw-case-empty aw-case-error",children:[a.jsx("span",{children:n}),b&&a.jsx("button",{type:"button",onClick:b,children:v("common.retry")})]}):i?a.jsx("div",{className:"aw-case-empty",children:i}):e.length===0?a.jsx("div",{className:"aw-case-empty",children:v(r?"agentWorkspace.noFeedbackCases":"agentWorkspace.noMatchingCases")}):e.map(w=>{var T,R;const x=w.id.startsWith("local:"),O=(o==null?void 0:o.has(w.id))??!1,k=(c==null?void 0:c.has(w.id))??!1,C=w.output.length+w.referenceOutput.length>220||(((T=w.reason)==null?void 0:T.length)??0)>120,E=d&&!x,j=!!(w.comment&&w.comment.trim()!==((R=w.reason)==null?void 0:R.trim()));return a.jsxs("div",{className:["aw-case-row",l===w.id?"is-focused":"",s?"is-selecting":"",O?"is-selected-for-delete":""].filter(Boolean).join(" "),role:"row",tabIndex:0,"aria-selected":s?O:void 0,onClick:()=>{if(s){E&&(h==null||h(w));return}f==null||f(w)},onKeyDown:A=>{A.target===A.currentTarget&&(A.key!=="Enter"&&A.key!==" "||(A.preventDefault(),s?E&&(h==null||h(w)):f==null||f(w)))},children:[a.jsxs("div",{className:"aw-case-text aw-case-cell","data-label":v("agentWorkspace.userInput"),children:[a.jsxs("span",{className:"aw-case-title-line",children:[s&&E&&a.jsx("span",{className:`aw-select-marker${O?" is-checked":""}`,"aria-hidden":"true"}),a.jsx("strong",{title:w.input,children:w.input||v("agentWorkspace.noUserInput")})]}),j&&a.jsxs("small",{title:w.comment,children:[v("agentWorkspace.note"),w.comment]}),a.jsx("small",{className:"aw-case-time",children:fXt(w.createdAt,y.resolvedLanguage??y.language,v)}),(w.userId||w.sessionId)&&a.jsx("small",{title:[w.userId,w.sessionId].filter(Boolean).join(" · "),children:[w.userId,w.sessionId].filter(Boolean).join(" · ")})]}),a.jsxs("div",{className:`aw-case-output aw-case-cell${k?" is-expanded":""}`,"data-label":v("agentWorkspace.agentOutput"),children:[a.jsx("p",{className:"aw-case-output-preview",title:w.output,children:w.output||v("agentWorkspace.noVisibleResponse")}),w.referenceOutput&&a.jsxs("small",{className:"aw-case-output-preview",title:w.referenceOutput,children:[v("agentWorkspace.reference"),": ",w.referenceOutput]}),C&&a.jsx("button",{type:"button",className:"aw-case-expand",onClick:A=>{A.stopPropagation(),m==null||m(w.id)},children:v(k?"common.collapse":"common.expand")})]}),a.jsx("div",{className:"aw-case-score aw-case-cell","data-label":v("agentWorkspace.score"),children:hXt(w,v)}),a.jsx("div",{className:`aw-case-reason aw-case-cell${k?" is-expanded":""}`,"data-label":v("agentWorkspace.scoreReason"),children:a.jsx("p",{title:w.reason||void 0,children:w.reason||"—"})}),a.jsx("div",{className:"aw-case-actions aw-case-cell","data-label":v("skillCenter.actions"),children:E&&a.jsx("button",{type:"button",className:"aw-case-delete",onClick:A=>{A.stopPropagation(),g==null||g(w)},disabled:u,title:v("agentWorkspace.deleteFeedbackCase"),"aria-label":v("agentWorkspace.deleteFeedbackCase"),children:a.jsx(AXt,{})})})]},w.id)})]})}function _Xt({group:e,agents:t,cases:n,onChange:i,onRun:r}){const{t:s}=Te("ui"),[o,l]=p.useState("config"),c=e.agentIds.map(h=>t.find(m=>m.id===h)).filter(h=>!!h),u=["回答质量","事实准确性","工具调用","响应效率"];p.useEffect(()=>l("config"),[e.id]);const d=h=>{i({...e,agentIds:e.agentIds.includes(h)?e.agentIds.filter(m=>m!==h):[...e.agentIds,h]})},f=h=>{i({...e,metrics:e.metrics.includes(h)?e.metrics.filter(m=>m!==h):[...e.metrics,h]})};return a.jsxs("main",{className:"aw-main",children:[a.jsxs("div",{className:"aw-eval-head",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"aw-agent-title-row",children:[a.jsx("h2",{children:ES(e.name,s)}),a.jsx("span",{children:s("agentWorkspace.evaluationGroup")})]}),a.jsx("p",{children:s("agentWorkspace.evaluationGroupStats",{agents:c.length,caseSet:ES(e.caseSet,s),runs:e.history.length})})]}),a.jsxs("button",{type:"button",className:"aw-run",onClick:()=>r(e),disabled:!0,children:[a.jsx(Mat,{"aria-hidden":!0}),s("agentWorkspace.startEvaluation")]})]}),a.jsxs("nav",{className:"aw-agent-tabs","aria-label":s("agentWorkspace.evaluationGroupDetails"),children:[a.jsx("button",{type:"button",className:o==="config"?"is-active":"","aria-pressed":o==="config",onClick:()=>l("config"),disabled:!0,children:s("agentWorkspace.evaluationConfig")}),a.jsx("button",{type:"button",className:o==="history"?"is-active":"","aria-pressed":o==="history",onClick:()=>l("history"),disabled:!0,children:s("agentWorkspace.historyResults")})]}),a.jsx("div",{className:"aw-content",children:o==="config"?a.jsxs("div",{className:"aw-eval-setup",children:[a.jsxs("section",{className:"aw-eval-block",children:[a.jsxs("div",{className:"aw-card-head",children:[a.jsx("strong",{children:s("agentWorkspace.participatingAgents")}),a.jsx("span",{children:s("agentWorkspace.selectedCount",{count:c.length})})]}),a.jsx("div",{className:"aw-eval-agent-grid",children:t.map(h=>a.jsxs("label",{children:[a.jsx("input",{type:"checkbox",checked:e.agentIds.includes(h.id),onChange:()=>d(h.id)}),a.jsxs("span",{children:[a.jsx("strong",{children:h.label}),a.jsx("small",{children:h.remote?s("agentWorkspace.remote"):s("agentWorkspace.local")})]})]},h.id))})]}),a.jsxs("div",{className:"aw-eval-setting-grid",children:[a.jsxs("section",{className:"aw-eval-block",children:[a.jsx("div",{className:"aw-card-head",children:a.jsx("strong",{children:s("agentWorkspace.evaluationResources")})}),a.jsxs("div",{className:"aw-eval-fields",children:[a.jsxs("label",{children:[a.jsx("span",{children:s("agentWorkspace.evaluationSet")}),a.jsxs("select",{value:e.caseSet,onChange:h=>i({...e,caseSet:h.currentTarget.value}),children:[a.jsx("option",{value:"核心回归集",children:s("agentWorkspace.evaluationDefaults.coreSet")}),a.jsx("option",{value:"安全边界集",children:s("agentWorkspace.evaluationDefaults.safetySet")}),a.jsx("option",{value:"工具调用集",children:s("agentWorkspace.evaluationDefaults.toolSet")})]}),a.jsx("small",{children:s("agentWorkspace.caseCount",{count:n.length})})]}),a.jsxs("label",{children:[a.jsx("span",{children:s("agentWorkspace.evaluator")}),a.jsxs("select",{value:e.evaluator,onChange:h=>i({...e,evaluator:h.currentTarget.value}),children:[a.jsx("option",{value:"综合质量评估器",children:s("agentWorkspace.evaluationDefaults.qualityEvaluator")}),a.jsx("option",{value:"事实一致性评估器",children:s("agentWorkspace.evaluationDefaults.factualEvaluator")}),a.jsx("option",{value:"工具调用评估器",children:s("agentWorkspace.evaluationDefaults.toolEvaluator")})]})]}),a.jsxs("label",{children:[a.jsx("span",{children:s("agentWorkspace.concurrency")}),a.jsxs("select",{value:e.concurrency,onChange:h=>i({...e,concurrency:h.currentTarget.value}),children:[a.jsx("option",{value:"2",children:"2"}),a.jsx("option",{value:"4",children:"4"}),a.jsx("option",{value:"8",children:"8"})]})]})]})]}),a.jsxs("section",{className:"aw-eval-block",children:[a.jsxs("div",{className:"aw-card-head",children:[a.jsx("strong",{children:s("agentWorkspace.evaluationMetrics")}),a.jsx("span",{children:s("agentWorkspace.selectedMetricCount",{count:e.metrics.length})})]}),a.jsx("div",{className:"aw-metric-list",children:u.map(h=>a.jsxs("label",{children:[a.jsx("input",{type:"checkbox",checked:e.metrics.includes(h),onChange:()=>f(h)}),a.jsx("span",{children:ES(h,s)})]},h))})]})]})]}):a.jsxs("section",{className:"aw-eval-history",children:[a.jsx("div",{className:"aw-section-head",children:a.jsxs("div",{children:[a.jsx("h3",{children:s("agentWorkspace.historyResults")}),a.jsx("p",{children:s("agentWorkspace.historyDescription")})]})}),e.history.length===0?a.jsxs("div",{className:"aw-results-empty",children:[a.jsx("strong",{children:s("agentWorkspace.noHistory")}),a.jsx("span",{children:s("agentWorkspace.noHistoryDescription")})]}):a.jsx("div",{className:"aw-history-list",children:e.history.map((h,m)=>a.jsxs("button",{type:"button",children:[a.jsxs("span",{children:[a.jsx("strong",{children:s("agentWorkspace.evaluationRun",{index:e.history.length-m})}),a.jsx("small",{children:s("agentWorkspace.evaluationRunMeta",{time:ES(h.createdAt,s),agents:c.length})})]}),a.jsxs("span",{className:"aw-history-score",children:[a.jsx("strong",{children:h.score}),a.jsx("small",{children:s("agentWorkspace.overallScore")})]}),a.jsxs("span",{className:"aw-complete",children:[a.jsx(Ef,{}),s("agentWorkspace.completed")]}),a.jsx(nE,{"aria-hidden":!0})]},h.id))})]})})]})}async function pK(e,t={}){const n=await fetch(Ta(`/web/agent-reviews${e}`),{...t,headers:ul(uc({"Content-Type":"application/json"})),signal:po(t.signal??void 0,6e4)});if(!n.ok)throw new Error(await n.text());return n.json()}function jXt(e,t){return pK(`?${new URLSearchParams({region:e})}`,{signal:t})}function NXt(e,t,n){return pK(`/${encodeURIComponent(e)}?${new URLSearchParams({region:t})}`,{signal:n})}function RXt(e,t,n){return pK(`/${encodeURIComponent(e)}/${t}`,{method:"POST",body:JSON.stringify(n)})}const IXt=20,zoe=256;function d6({label:e,value:t,onChange:n,limit:i,disabled:r,required:s=!1}){const{t:o}=Te("agentReviews");return a.jsxs("label",{children:[e,a.jsx("textarea",{"aria-label":e,value:t,onChange:l=>n(Array.from(l.target.value).slice(0,i).join("")),maxLength:i*2,disabled:r,required:s,rows:3}),a.jsx("span",{className:"agent-review-text-count",children:o("textCount",{count:Array.from(t).length,limit:i})})]})}function PP({person:e}){return a.jsxs("span",{className:"agent-review-person",title:e.email||e.name,children:[e.avatarUrl?a.jsx("img",{src:e.avatarUrl,alt:"",referrerPolicy:"no-referrer",onError:t=>{t.currentTarget.hidden=!0}}):null,a.jsx("span",{children:e.name||e.id})]})}function l9e({runtimeId:e,region:t,name:n,canPublish:i,onClose:r,onChanged:s}){const{t:o,i18n:l}=Te("agentReviews"),[c,u]=p.useState(null),[d,f]=p.useState(!0),[h,m]=p.useState(!1),[g,b]=p.useState(""),[v,y]=p.useState(""),[w,x]=p.useState(""),[O,k]=p.useState(""),[S,C]=p.useState(0),[E,j]=p.useState(!1),[T,R]=p.useState(null);p.useEffect(()=>{const _=new AbortController;return f(!0),b(""),NXt(e,t,_.signal).then(L=>{_.signal.aborted||u(L.application)}).catch(L=>{_.signal.aborted||b(L instanceof Error?L.message:String(L))}).finally(()=>{_.signal.aborted||f(!1)}),()=>_.abort()},[e,t,S]);async function A(_,L){if(!h){m(!0),b("");try{const F=await RXt(e,_,{region:t,..._==="submit"?{message:v}:{},..._==="publish"||_==="decision"?{comment:w}:{},..._==="decision"?{applicationId:c==null?void 0:c.id,decision:L,reason:O}:{}});u(F),x(""),k(""),j(!1),R(null),s()}catch(F){b(F instanceof Error?F.message:String(F))}finally{m(!1)}}}const N=(c==null?void 0:c.status)==="pending",P=!!(c!=null&&c.published),I=!N&&!P,D=_=>new Date(_).toLocaleString(l.language);return a.jsx(sv,{open:!0,onOpenChange:_=>{!_&&!h&&r()},children:a.jsxs(rv,{children:[a.jsx(nv,{className:"agent-review-backdrop"}),a.jsxs(iv,{className:"agent-review-dialog",children:[a.jsxs("header",{className:"agent-review-dialog-header",children:[a.jsxs("div",{children:[a.jsx(yO,{children:n}),a.jsx(LT,{children:o("dialogDescription")})]}),a.jsx(hL,{className:"agent-review-close",disabled:h,"aria-label":o("close"),children:a.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m6 6 12 12M6 18 18 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})})]}),a.jsxs("div",{className:"agent-review-dialog-body",children:[d?a.jsx(cl,{}):null,g?a.jsxs("div",{className:"agent-review-error",role:"alert",children:[a.jsx("p",{children:g}),a.jsx("button",{type:"button",disabled:h||d,onClick:()=>C(_=>_+1),children:o("refresh")})]}):null,!d&&c?a.jsxs(a.Fragment,{children:[a.jsxs("dl",{className:"agent-review-facts",children:[a.jsxs("div",{children:[a.jsx("dt",{children:o("statusTitle")}),a.jsxs("dd",{children:[o(`status.${c.status}`),c.status==="approved"&&!P?` · ${o("private")}`:""]})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("submitter")}),a.jsx("dd",{children:a.jsx(PP,{person:c.submitter})})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("submittedAt")}),a.jsx("dd",{children:D(c.submittedAt)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("version")}),a.jsx("dd",{children:c.agent.version??"—"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("model")}),a.jsx("dd",{children:c.agent.model||"—"})]}),c.reviewer?a.jsxs("div",{children:[a.jsx("dt",{children:o(c.status==="returned"?"returnedBy":"approvedBy")}),a.jsx("dd",{children:a.jsx(PP,{person:c.reviewer})})]}):null,c.reviewedAt?a.jsxs("div",{children:[a.jsx("dt",{children:o("reviewedAt")}),a.jsx("dd",{children:D(c.reviewedAt)})]}):null]}),a.jsxs("section",{children:[a.jsx("h3",{children:o("description")}),a.jsx("p",{children:c.agent.description||"—"})]}),c.message?a.jsxs("section",{children:[a.jsx("h3",{children:o("message")}),a.jsx("p",{children:c.message})]}):null,c.reason?a.jsxs("section",{children:[a.jsx("h3",{children:o("reason")}),a.jsx("p",{children:c.reason})]}):null,c.comment?a.jsxs("section",{children:[a.jsx("h3",{children:o("comment")}),a.jsx("p",{children:c.comment})]}):null,c.contentChanged?a.jsx("p",{role:"alert",className:"agent-review-warning",children:o("contentChanged")}):null]}):null,!d&&!g&&I&&!i?a.jsx(d6,{label:o("message"),value:v,onChange:y,limit:IXt,disabled:h}):null,!d&&!g&&i&&(N||I)?a.jsx(d6,{label:o("comment"),value:w,onChange:x,limit:zoe,disabled:h}):null,E?a.jsx(d6,{label:o("reasonRequired"),value:O,onChange:k,limit:zoe,disabled:h,required:!0}):null,T?a.jsx("p",{role:"status",children:o(`${T}Confirm`)}):null]}),a.jsxs("footer",{className:"agent-review-dialog-footer",children:[h?a.jsx("span",{role:"status",children:o("saving")}):null,!d&&(!g||c)?T?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",disabled:h,onClick:()=>R(null),children:o("cancel")}),a.jsx("button",{type:"button",disabled:h,onClick:()=>void A(T),children:o("confirm")})]}):E?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",disabled:h,onClick:()=>j(!1),children:o("cancel")}),a.jsx("button",{type:"button",disabled:h||!O.trim(),onClick:()=>void A("decision","returned"),children:o("return")})]}):a.jsxs(a.Fragment,{children:[P?a.jsx("button",{type:"button",disabled:h,onClick:()=>R("unpublish"),children:o("unpublish")}):null,N?a.jsx("button",{type:"button",disabled:h,onClick:()=>R("withdraw"),children:o("withdraw")}):null,N&&i?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",disabled:h,onClick:()=>j(!0),children:o("return")}),a.jsx("button",{type:"button",className:"is-primary",disabled:h||(c==null?void 0:c.contentChanged),onClick:()=>void A("decision","approved"),children:o("approve")})]}):null,I?a.jsx("button",{type:"button",className:"is-primary",disabled:h,onClick:()=>void A(i?"publish":"submit"),children:o(i?"publish":"submit")}):null]}):null]})]})]})})}const PXt=5e3,DXt=4;let f6=0;const Voe=[];function Hoe(e){return e instanceof Error&&e.name==="AbortError"}function MXt(e){return e instanceof Error&&e.name==="TimeoutError"}function LXt(e){return MXt(e)||e instanceof ID&&[500,502,503,504].includes(e.status)}function $Xt(e,t){return t!=null&&t.aborted?Promise.reject(t.reason??new DOMException("Request aborted","AbortError")):new Promise((n,i)=>{const r=()=>{globalThis.clearTimeout(s),i((t==null?void 0:t.reason)??new DOMException("Request aborted","AbortError"))},s=globalThis.setTimeout(()=>{t==null||t.removeEventListener("abort",r),n()},e);t==null||t.addEventListener("abort",r,{once:!0})})}async function FXt(e={},t={}){const n=t.request??Q0,i=t.wait??$Xt;try{return await n(e)}catch(r){if(!LXt(r))throw r;return await i(PXt,e.signal),n(e)}}async function c9e(e){var t;f6>=DXt&&await new Promise(n=>Voe.push(n)),f6+=1;try{return await e()}finally{f6-=1,(t=Voe.shift())==null||t()}}async function BXt(e,t){await Promise.allSettled(e.map(n=>c9e(()=>t(n))))}function Ey(e,t,n){const i=e instanceof Error?`${e.name}: ${e.message}`:String(e||Q("common.unknownError"));return[Q("requestError.actionFailed",{action:t}),Q("requestError.detail",{detail:i}),n?Q("requestError.request",{request:n}):""].filter(Boolean).join(` +`)}function Ap({className:e="icon"}){return a.jsxs("svg",{className:`${e} sidebar-agent-face`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("rect",{x:"4.25",y:"5.25",width:"15.5",height:"13.5",rx:"4.75"}),a.jsx("path",{className:"sidebar-agent-face__eye",d:"M8.5 10.7v2"}),a.jsx("path",{className:"sidebar-agent-face__eye",d:"M15.5 10.7v2"})]})}function UXt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M8.4 18.4H7.2a4.2 4.2 0 0 1-.65-8.35A5.7 5.7 0 0 1 17.3 8.2a4.6 4.6 0 0 1-.4 9.2h-3.2"}),a.jsx("path",{d:"m7.8 12.3 2 2-2 2M12.2 16.3h3.2"})]})}function QXt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M18.9 6.25A8.4 8.4 0 1 0 19.6 16"}),a.jsx("path",{d:"M19 6.2c.1 2.1-.65 3.75-2.25 4.95-1.2.9-2.75 1.25-4.2.9"}),a.jsx("circle",{cx:"10.6",cy:"12.8",r:"2.45"}),a.jsx("path",{d:"m5.25 18.6 3.65-3.9M14.8 17.9c1.9-.45 3.55-1.65 4.65-3.35"})]})}function zXt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6.2 20c.55-2.15.75-4.1.75-6.7V9.8A5.35 5.35 0 0 1 12.35 4c3.35 0 5.65 2.35 5.65 5.65v4.6c0 2.35.35 4.25 1.15 5.75"}),a.jsx("path",{d:"M8.05 10.2c1.35-.6 2.2-1.65 2.55-3.15.45 1.55 1.35 2.55 2.7 3.05.1-1 .4-1.95.85-2.75.45 1.25 1.2 2.2 2.15 2.75"}),a.jsx("path",{d:"M9.3 12.65h.01M14.9 12.65h.01M10.8 15.55c.8.5 1.65.5 2.45 0"}),a.jsx("path",{d:"M8.45 19.85c.95-.85 1.45-1.95 1.5-3.25M15.1 16.65c.05 1.2.55 2.3 1.55 3.2"})]})}function VXt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5.2 17.2V8.1a3 3 0 0 1 3-3h7.6a3 3 0 0 1 3 3v9.1"}),a.jsx("path",{d:"M7.4 17.2h9.2M9 19.9h6"}),a.jsx("path",{d:"M9.1 9.25h5.8M9.1 12h3.1"}),a.jsx("path",{d:"m14.1 12.4 2 2.1M16.2 12.4l-2.1 2.1"})]})}function hA({kind:e,...t}){return e==="codex"?a.jsx(UXt,{...t}):e==="deepseek-harness"?a.jsx(VXt,{...t}):e==="openclaw"?a.jsx(QXt,{...t}):a.jsx(zXt,{...t})}const HXt="data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20overflow='visible'%20style='display:%20block;'%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Icon%20Frame'%3e%3cpath%20id='Vector%208798'%20d='M5%205L15%2015'%20stroke='white'%20stroke-opacity='0.15'%20stroke-width='1.25'%20stroke-linecap='round'/%3e%3cpath%20id='Vector%208800'%20d='M15%205L5%2015'%20stroke='white'%20stroke-opacity='0.15'%20stroke-width='1.25'%20stroke-linecap='round'/%3e%3c/g%3e%3c/svg%3e";function u9e({title:e,topGlow:t=!0,children:n,footer:i,cancelLabel:r="Cancel",confirmLabel:s="Confirm",closeLabel:o="Close",onClose:l,onCancel:c,onConfirm:u,className:d="",...f}){const h=p.useId();return a.jsxs("div",{role:"dialog","aria-labelledby":h,...f,className:`studio-modal-layout ${t?"studio-modal-layout--glow":""} ${d}`.trim(),children:[a.jsxs("header",{className:"studio-modal-layout__header",children:[a.jsx("h3",{id:h,children:e}),a.jsx(Wi,{variant:"ghost",size:"compact",iconOnly:!0,className:"studio-modal-layout__close","aria-label":o,onClick:l,startIcon:a.jsx("img",{src:HXt,alt:""})})]}),a.jsx("div",{className:"studio-modal-layout__body",children:n}),i!==null&&a.jsx("footer",{className:"studio-modal-layout__footer",children:i===void 0?a.jsxs(a.Fragment,{children:[a.jsx(Wi,{variant:"outline",className:"studio-modal-layout__cancel",onClick:c,children:r}),a.jsx(Wi,{className:"studio-modal-layout__confirm",onClick:u,children:s})]}):i})]})}class d9e extends Error{constructor(t,n){super(n),this.status=t,this.name="MpaCreationRequestError"}}async function IL(e,t,n){const i=await fetch(Ta(`/web/mpa-creation/${e}`),{method:n===void 0?"GET":"POST",headers:ul(uc({"Content-Type":"application/json"})),body:n===void 0?void 0:JSON.stringify(n),signal:po(t,ho)});if(!i.ok){const r=await i.json().catch(()=>({}));throw new d9e(i.status,typeof r.detail=="string"?r.detail:`HTTP ${i.status}`)}return i.json()}const qXt=(e,t)=>IL(`config?region=${encodeURIComponent(e)}`,t),WXt=(e,t)=>IL("tasks",t,e),KXt=(e,t)=>IL(`tasks/${encodeURIComponent(e)}`,t),GXt=(e,t)=>IL(`tasks/${encodeURIComponent(e)}/cancel`,t,{}),XXt=/^[A-Za-z0-9_-]+$/,f9e=4,DP=64,MP=6,qoe="agent-runtime";function h9e(e){const t=e.trim();if(!t)return qoe;let n=t.replace(/[^A-Za-z0-9_-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").slice(0,DP);return n?(n.lengthXt(`validation.runtimeName.${n}`)){return e?XXt.test(e)?e.lengthDP?t("length"):null:t("characters"):t("required")}function JXt(e="",t=""){const n=e.trim(),i=t.trim();return!n&&!i||n.length<=255&&/^[A-Za-z0-9][A-Za-z0-9.-]*$/.test(n)&&!n.includes("..")&&/^[0-9]{1,5}$/.test(i)&&Number(i)>=1&&Number(i)<=65535}function eYt(e="",t="",n=""){const i=e.trim(),r=t.trim();if(!i&&!r&&!n)return!0;if(!i||!r||!n.trim()||i.length>1024||/\s/.test(i)||i.replace(/^https:\/\//,"").split("/",1)[0].includes(":"))return!1;try{const o=new URL(i);return o.protocol==="https:"&&!!o.hostname&&!o.username&&!o.password&&!o.port&&!o.search&&!o.hash&&r.length<=128&&/^ov-[a-zA-Z0-9_-]+$/.test(r)}catch{return!1}}const tYt="https://console.volcengine.com/aidap/region:aidap+cn-beijing/",nYt="https://console.volcengine.com/vikingdb/openviking/region:openviking+cn-beijing/ov-6689fabdf032294/context-management?accountId=default&userId=default&projectName=default";function p9e(e){return{region:e,requestId:crypto.randomUUID(),name:"",description:""}}function LP(e){return{...e,tosAccessKey:void 0,tosSecretKey:void 0}}function iYt(e){var t;try{const n=JSON.parse(sessionStorage.getItem(`mpa-create:${e}`)||"null");if(((t=n==null?void 0:n.input)==null?void 0:t.region)===e&&typeof n.input.requestId=="string"){if(n.submitted||n.taskId)return{...n,input:LP(n.input)};const i={...n.input,name:typeof n.input.name=="string"?n.input.name:""};return delete i.agentId,delete i.runtimeImage,delete i.workerImage,{...n,input:LP(i)}}}catch{}return{input:p9e(e)}}function rYt({region:e,onClose:t,onCreated:n}){var X,ie;const{t:i}=Te("ui"),r=ee=>`myAgents.mpaCreate.${ee}`,[s]=p.useState(()=>iYt(e)),[o,l]=p.useState(s.input),[c,u]=p.useState(""),[d,f]=p.useState(s.submitted||s.taskId?2:Math.min(2,Math.max(0,s.step??0))),[h,m]=p.useState(s.taskId),[g,b]=p.useState(!!(s.submitted||s.taskId)),[v,y]=p.useState(null),[w,x]=p.useState(null),[O,k]=p.useState(!0),[S,C]=p.useState(!1),[E,j]=p.useState(""),[T,R]=p.useState(0),[A,N]=p.useState(!1),P=p.useRef(!1),I=p.useRef(!1),D=p.useRef(!0),_=p.useRef(null),L=p.useRef(n);L.current=n;const F=(v==null?void 0:v.state)==="running"||(v==null?void 0:v.state)==="cancelling",V=g&&o.name===void 0&&!!o.agentId?null:ov((o.name??"").trim(),ee=>i(`validation.runtimeName.${ee}`,{ns:"create"})),q=!V,U=(w==null?void 0:w.postgresMode)==="auto",J=U?!o.pgHost&&!o.pgPort:JXt(o.pgHost,o.pgPort),z=eYt(o.openvikingUrl,o.openvikingResourceId,c),Z=[o.tosAccessKey,o.tosSecretKey,o.tosBucket].map(ee=>(ee==null?void 0:ee.trim())??""),ne=Z.every(Boolean)||Z.every(ee=>!ee),W=S||g&&(!v||F||v.state==="succeeded");p.useEffect(()=>{if(!(g||h))try{sessionStorage.setItem(`mpa-create:${e}`,JSON.stringify({input:LP(o),step:d}))}catch{}},[o,d,e,g,h]);function G(ee){try{sessionStorage.setItem(`mpa-create:${e}`,JSON.stringify({input:LP(o),taskId:ee,submitted:!0,step:2}))}catch{}}p.useEffect(()=>(D.current=!0,()=>{var ee;D.current=!1,(ee=_.current)==null||ee.abort()}),[]),p.useEffect(()=>{const ee=new AbortController;return k(!0),qXt(e,ee.signal).then(be=>{ee.signal.aborted||(x(be),be.configured&&!s.submitted&&!s.taskId&&!P.current&&l(ue=>({...ue,pgHost:be.postgresMode==="auto"?"":ue.pgHost??be.pgHost??"",pgPort:be.postgresMode==="auto"?"":ue.pgPort??be.pgPort??""})))}).catch(()=>{ee.signal.aborted||j(i(r("loadFailed")))}).finally(()=>{ee.signal.aborted||k(!1)}),()=>ee.abort()},[e,T,i]),p.useEffect(()=>{if(!h)return;const ee=new AbortController;let be;async function ue(){try{const pe=await KXt(h,ee.signal);if(ee.signal.aborted)return;if(y(pe),j(""),pe.state==="succeeded"&&!I.current){I.current=!0;try{sessionStorage.removeItem(`mpa-create:${e}`)}catch{}L.current()}if(pe.state!=="running"&&pe.state!=="cancelling")return}catch{if(ee.signal.aborted)return;j(i(r("pollFailed")))}be=setTimeout(ue,2e3)}return ue(),()=>{ee.abort(),clearTimeout(be)}},[h,e,T,i]);async function H(){if(P.current||!(w!=null&&w.configured)||!q||!J||!z||!ne||d!==2||F||(v==null?void 0:v.state)==="succeeded")return;P.current=!0,C(!0),b(!0),j(""),G(h);const ee=new AbortController;_.current=ee;try{const be=await WXt({...o,...o.name===void 0?{}:{name:o.name.trim()},openvikingApiKey:c},ee.signal);if(!D.current||ee.signal.aborted)return;G(be.taskId),m(be.taskId),y(be),R(ue=>ue+1)}catch(be){D.current&&!ee.signal.aborted&&(be instanceof d9e&&(be.status===400||be.status===422)&&b(!1),j(be instanceof Error?be.message:i(r("creationFailed"))))}finally{P.current=!1,D.current&&C(!1)}}async function se(){if(!h||P.current)return;N(!1),P.current=!0,C(!0);const ee=new AbortController;_.current=ee;try{const be=await GXt(h,ee.signal);D.current&&!ee.signal.aborted&&y(be)}catch{D.current&&!ee.signal.aborted&&j(i(r("cancelFailed")))}finally{P.current=!1,D.current&&C(!1)}}function Y(){const ee={...p9e(e),pgHost:U?"":(w==null?void 0:w.pgHost)??"",pgPort:U?"":(w==null?void 0:w.pgPort)??""};try{sessionStorage.setItem(`mpa-create:${e}`,JSON.stringify({input:ee,step:0}))}catch{}l(ee),u(""),f(0),m(void 0),b(!1),y(null),j(""),N(!1),I.current=!1}return a.jsx(a.Fragment,{children:a.jsx(sv,{open:!0,onOpenChange:ee=>{!ee&&!S&&(A?N(!1):t())},children:a.jsxs(rv,{children:[a.jsx(nv,{className:"studio-modal-button__backdrop mpa-create-backdrop"}),a.jsx(iv,{className:"mpa-create-popup","aria-label":i(r("title")),children:a.jsx(u9e,{className:"mpa-create-dialog",title:i(r("title")),topGlow:!1,footer:null,onClose:()=>{S||t()},closeLabel:i(r("close")),children:a.jsxs("div",{className:"mpa-create-body",children:[a.jsx("ol",{className:"mpa-create-steps","aria-label":i(r("stepsLabel")),children:["basics","postgres","openviking"].map((ee,be)=>a.jsx("li",{"aria-current":d===be?"step":void 0,children:a.jsxs("button",{type:"button",disabled:S||be>d&&!g&&(!q||be===2&&!J),onClick:()=>f(be),children:[a.jsx("span",{children:be+1}),i(r(`steps.${ee==="postgres"&&U?"autoPostgres":ee}`))]})},ee))}),d===0&&a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[i(r("region")),":",e]}),a.jsxs("label",{children:[i(r("name")),a.jsx("input",{name:"name",placeholder:i(r("namePlaceholder")),value:o.name??o.agentId??"",maxLength:64,disabled:S||g,required:!0,autoComplete:"off","aria-invalid":!!V,"aria-describedby":"mpa-name-help",onChange:ee=>l({...o,name:ee.target.value})}),a.jsx("p",{id:"mpa-name-help",role:V?"alert":void 0,children:V||i(r("nameHelp"))})]}),a.jsxs("label",{children:[i(r("description")),a.jsx(EIe,{className:"mpa-create-description",value:o.description,maxLength:512,disabled:S||g,onChange:ee=>l({...o,description:ee.target.value})})]}),a.jsxs("section",{className:"mpa-create-plan","aria-label":i(r("plan")),children:[a.jsx("strong",{children:i(r("plan"))}),a.jsxs("ul",{children:[a.jsx("li",{children:i(r("sharedResources"))}),a.jsx("li",{children:i(r("agentResources"))}),a.jsx("li",{children:i(r("readiness"))})]})]})]}),d===1&&a.jsxs(a.Fragment,{children:[a.jsx("p",{children:i(r(U?"pgAutoDescription":(w==null?void 0:w.postgresLayout)==="split-workspaces"?"pgSplitDescription":"pgDescription"))}),a.jsx("a",{href:tYt,target:"_blank",rel:"noopener noreferrer",children:i(r("pgConsole"))}),!U&&a.jsxs(a.Fragment,{children:[a.jsxs("label",{children:[i(r("pgHost")),a.jsx("input",{name:"pgHost",value:o.pgHost??"",maxLength:255,disabled:S||g,"aria-invalid":!J,onChange:ee=>l(be=>({...be,pgHost:ee.target.value}))})]}),a.jsxs("label",{children:[i(r("pgPort")),a.jsx("input",{name:"pgPort",value:o.pgPort??"",inputMode:"numeric",maxLength:5,disabled:S||g,"aria-invalid":!J,onChange:ee=>l(be=>({...be,pgPort:ee.target.value}))})]}),!J&&a.jsx("p",{role:"alert",children:i(r("pgInvalid"))}),a.jsx("p",{children:i(r("pgCredentials"))})]})]}),d===2&&a.jsxs(a.Fragment,{children:[a.jsx("p",{children:i(r("openvikingDescription"))}),a.jsx("a",{href:nYt,target:"_blank",rel:"noopener noreferrer",children:i(r("openvikingConsole"))}),a.jsxs("label",{children:[i(r("openvikingUrl")),a.jsx("input",{name:"openvikingUrl",value:o.openvikingUrl??"",maxLength:1024,disabled:S||g,autoComplete:"off",spellCheck:!1,"aria-invalid":!z,onChange:ee=>l(be=>({...be,openvikingUrl:ee.target.value}))})]}),a.jsxs("label",{children:[i(r("openvikingResourceId")),a.jsx("input",{name:"openvikingResourceId",value:o.openvikingResourceId??"",maxLength:128,disabled:S||g,autoComplete:"off",spellCheck:!1,"aria-invalid":!z,onChange:ee=>l(be=>({...be,openvikingResourceId:ee.target.value}))})]}),a.jsxs("label",{children:[i(r("openvikingApiKey")),a.jsx("input",{type:"password",name:"openvikingApiKey",value:c,maxLength:512,disabled:S||F||(v==null?void 0:v.state)==="succeeded",autoComplete:"off",spellCheck:!1,onChange:ee=>u(ee.target.value)})]}),!z&&a.jsx("p",{role:"alert",children:i(r("openvikingInvalid"))}),a.jsx("p",{children:i(r("openvikingCredentials"))}),a.jsxs("fieldset",{className:"mpa-create-tos",children:[a.jsx("legend",{children:i(r("tosTitle"))}),a.jsx("p",{children:i(r("tosDescription"))}),["tosAccessKey","tosSecretKey","tosBucket"].map(ee=>a.jsxs("label",{children:[i(r(ee)),a.jsx("input",{name:ee,type:ee==="tosBucket"?"text":"password",value:o[ee]??"",maxLength:256,disabled:W,autoComplete:ee==="tosBucket"?"off":"new-password",spellCheck:!1,"aria-invalid":!ne,onChange:be=>l(ue=>({...ue,[ee]:be.target.value}))})]},ee)),!ne&&a.jsx("p",{role:"alert",children:i(r("tosInvalid"))}),a.jsx("p",{children:i(r("tosCredentials"))})]})]}),O?a.jsx("p",{role:"status",children:i(r("checking"))}):w!=null&&w.configured?a.jsx("p",{children:i(r("configured"))}):a.jsxs("div",{role:"alert",children:[a.jsx("p",{children:i(r("notConfigured"))}),a.jsx("p",{children:w!=null&&w.postgresMigrationRequired?i(r("pgMigrationRequired")):w==null?void 0:w.error}),a.jsx(Wi,{variant:"outline",onClick:()=>R(ee=>ee+1),children:i(r("reload"))})]}),v&&a.jsxs("section",{"aria-live":"polite",children:[a.jsx("strong",{children:i(r(`states.${v.state}`))}),v.state!=="succeeded"&&a.jsx("p",{children:i(r(`stages.${v.stage}`),{defaultValue:v.stage})}),v.state==="failed"||v.state==="cancelled"?a.jsx("p",{children:i(r(v.error||"creationFailed"))}):null,((X=v.result)==null?void 0:X.runtime_id)&&a.jsxs("p",{children:["Runtime ID:",v.result.runtime_id]}),((ie=v.result)==null?void 0:ie.skill_space_id)&&a.jsxs("p",{children:[i(r("skillSpace")),":",v.result.skill_space_id]})]}),U&&!J&&a.jsx("p",{role:"alert",children:i(r("pgModeChanged"))}),E&&a.jsx("p",{role:"alert",children:E}),F&&a.jsx("p",{children:i(r("background"))}),g&&a.jsx("p",{children:i(r("newAgentDescription"))}),A?a.jsxs("section",{role:"alertdialog","aria-label":i(r("cancel")),className:"mpa-create-plan",children:[a.jsx("p",{children:i(r("cancelDescription"))}),a.jsxs("div",{className:"mpa-create-actions",children:[a.jsx(Wi,{autoFocus:!0,variant:"outline",onClick:()=>N(!1),children:i(r("back"))}),a.jsx(Wi,{onClick:()=>void se(),children:i(r("confirmCancel"))})]})]}):a.jsxs("div",{className:"mpa-create-actions",children:[a.jsx(Wi,{variant:"outline",disabled:S,onClick:t,children:i(r("close"))}),g&&a.jsx(Wi,{variant:"outline",disabled:S||O,onClick:Y,children:i(r("newAgent"))}),d>0&&a.jsx(Wi,{variant:"outline",disabled:S,onClick:()=>f(ee=>ee-1),children:i(r("previousStep"))}),F?a.jsx(Wi,{variant:"outline",disabled:S||(v==null?void 0:v.state)==="cancelling",onClick:()=>N(!0),children:i(r("cancel"))}):(v==null?void 0:v.state)!=="succeeded"&&d<2?a.jsx(Wi,{disabled:S||d===0&&!q||d===1&&!J,onClick:()=>f(ee=>ee+1),children:i(r("next"))}):(v==null?void 0:v.state)!=="succeeded"?a.jsx(Wi,{loading:S,disabled:O||!(w!=null&&w.configured)||!q||!J||!z||!ne,onClick:()=>void H(),children:i(r(v?"retry":"submit"))}):null]})]})})})]})})})}const sYt=["general","mpa","codex","deepseek-harness","openclaw","hermes"];function aYt(e){return e!=="general"&&e!=="mpa"}const oYt=24,lYt=3e4,cYt=7e3,uYt=2e4,dYt=6,fYt=2,hYt=250,Og=new Map,Aw=new Map,pYt=new Set;function ty(e){const t=e.runtime;return t?`${t.region}:${t.runtimeId}:${t.currentVersion??""}`:""}function Woe(e,t){const n=e instanceof Error&&e.message.trim()?e.message.trim():t("myAgents.compatibility.unknownError");return{status:e instanceof Oa&&e.unsupported?"unsupported":"error",message:n}}function Zm(e){if(!e){Og.clear(),Aw.clear(),W8();return}const t=new Set(e);if(t.size!==0){for(const[n,i]of Aw)i.page.runtimes.some(r=>t.has(r.runtimeId))&&Aw.delete(n);for(const n of t)W8(n);Og.clear()}}function mYt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function gYt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M8.313 3.646a.5.5 0 0 1 .707 0l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 1 1-.707-.708L11.46 8.5H3.333a.5.5 0 0 1 0-1h8.127L8.313 4.354a.5.5 0 0 1 0-.708Z",fill:"currentColor"})})}function bYt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M2.75 5.25h8.75m0 0-2-2m2 2-2 2M13.25 10.75H4.5m0 0 2 2m-2-2 2-2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function yYt({type:e}){return e==="general"||e==="mpa"?a.jsx(Ap,{}):a.jsx(hA,{kind:e})}function vYt(e,t=Date.now(),n){const i=Date.parse(e);if(!Number.isFinite(i)||i-t<6e4)return n("myAgents.expiringSoon");const r=Math.ceil((i-t)/6e4),s=Math.floor(r/60),o=r%60;return n("myAgents.sandboxRemaining",{hours:s,minutes:o})}function Koe(e,t,n="general"){var r;const i=e.agentCategory??n;return{id:e.runtimeId,name:e.name,description:((r=e.description)==null?void 0:r.trim())||t("common.noDescription"),createdAt:e.createdAt??"",specificationLabel:t("myAgents.creator"),specification:GMe(e.author),isMine:e.isMine,agentCategory:i,runtime:{runtimeId:e.runtimeId,mpaInstanceId:e.mpaInstanceId,region:e.region,currentVersion:e.currentVersion,agentCategory:e.agentCategory??n,canDelete:e.canDelete,canManage:e.canManage,canPublish:e.canPublish,visibility:e.visibility,reviewStatus:e.reviewStatus}}}function xYt(e,t){const n=MD(e.status);return{id:e.id,name:e.displayName||t("myAgents.namedAgent",{name:e.toolName}),description:t(`myAgents.sandboxStatus.${n}`,{defaultValue:t("myAgents.sandboxStatus.unknown")}),createdAt:e.createdAt,specificationLabel:t("myAgents.creator"),specification:GMe(e.createdBy),isMine:e.isMine,region:e.region,sandbox:e}}function wYt(e,t){var n,i;return{id:e.id,name:e.draft.name||t("agentSelector.unnamedAgent"),description:((n=e.draft.description)==null?void 0:n.trim())||t("common.noDescription"),createdAt:new Date(e.updatedAt).toISOString(),specificationLabel:t("myAgents.storageLocation"),specification:t("myAgents.currentBrowser"),isMine:!0,region:(i=e.deploymentTarget)==null?void 0:i.region,draft:e}}function OYt(e,t,n){if(!e.draft)return e;const i=e.draft.deploymentTarget;return i?t.find(r=>{var s;return((s=r.runtime)==null?void 0:s.runtimeId)===i.runtimeId&&r.runtime.region===i.region})??{id:i.runtimeId,appName:i.appName,name:i.name||e.name,description:e.description,createdAt:e.createdAt,specificationLabel:n("myAgents.region"),specification:i.region,isMine:!0,runtime:{runtimeId:i.runtimeId,mpaInstanceId:i.mpaInstanceId,region:i.region,currentVersion:i.currentVersion,canDelete:!1}}:null}function kYt(e,t){return e.trim()||Zi(t)}async function SYt(e,t,n,i,r,s,o){const l=`${e}:${t}:${n}:${i}`,c=Aw.get(l);if(c&&c.expiresAt>Date.now())return r(c.page.runtimes.map(f=>Koe(f,s,e))),c.page.nextToken;c&&Aw.delete(l);let u=Og.get(l);u||(u=FXt({agentCategory:e,scope:t,region:n,pageSize:oYt,nextToken:i,signal:o}),Og.set(l,u),u.then(()=>Og.delete(l),()=>Og.delete(l)));const d=await u;return Aw.set(l,{page:d,expiresAt:Date.now()+lYt}),r(d.runtimes.map(f=>Koe(f,s,e))),d.nextToken}function EYt({agent:e,onReview:t,onUse:n,onViewDetails:i,onPrepareUpdate:r,compatibility:s,onRetryCompatibility:o,connecting:l,connectError:c,connected:u,deploymentTask:d,nowMs:f,onViewDeploymentTask:h,onEditDraft:m,onDeleteDraft:g}){var R,A,N,P;const{t:b,i18n:v}=Te("ui"),y=(R=e.sandbox)==null?void 0:R.status.toLowerCase(),w=((A=e.sandbox)==null?void 0:A.resourceType)==="snapshot",x=!!(e.runtime||y==="ready"||y==="wakeable"),O=(s==null?void 0:s.status)==="checking",k=(s==null?void 0:s.status)==="unsupported",S=(s==null?void 0:s.status)==="error",C=((N=e.sandbox)==null?void 0:N.resourceType)==="snapshot"?e.sandbox.sourceSessionId||e.sandbox.snapshotId:(P=e.sandbox)==null?void 0:P.id,E=()=>{if(e.draft){d?h==null||h(d):i==null||i(e);return}!x&&!e.sandbox||(d?h==null||h(d):i==null||i(e))},j=(e.draft||x||!!e.sandbox)&&!!(d?h:i),T=e.draft?d?b("myAgents.viewDeploymentProgress",{name:e.name}):b("myAgents.viewRuntimeDetails",{name:e.name}):d?b("myAgents.viewDeploymentProgress",{name:e.name}):b("myAgents.viewDetails",{name:e.name});return a.jsxs(vH,{className:`my-agent-card${l?" is-connecting":""}${e.runtime?" has-review":""}`,activateLabel:j?T:void 0,onActivate:j?E:void 0,onPointerEnter:()=>r==null?void 0:r(e),onFocusCapture:()=>r==null?void 0:r(e),footer:a.jsxs("div",{className:"my-agent-card-footer",children:[a.jsx(YIe,{className:"my-agent-meta",items:[{label:e.specificationLabel,value:e.specification,hideLabel:!0,className:"my-agent-region"},{label:b("myAgents.time"),value:FT(e.createdAt,f,v.resolvedLanguage??v.language),hideLabel:!0,className:"my-agent-created-at"},...e.sandbox?[{label:b("myAgents.remainingTime"),value:e.sandbox.resourceType==="snapshot"||e.sandbox.persistent?b("myAgents.neverExpires"):vYt(e.sandbox.expireAt,f,b),className:`my-agent-expiry${e.sandbox.resourceType==="snapshot"||e.sandbox.persistent?"":" is-expiring"}`}]:[]]}),e.runtime?a.jsxs("div",{className:"agent-review-card-controls",children:[a.jsx("span",{className:"agent-review-card-status",children:b(e.runtime.visibility==="enterprise"?"enterprise":"private",{ns:"agentReviews"})}),e.runtime.canManage?a.jsxs(CN,{className:"agent-review-card-action",onClick:I=>{I.stopPropagation(),t==null||t(e)},children:[b(e.runtime.reviewStatus?"details":e.runtime.canPublish?"publish":"submit",{ns:"agentReviews"}),e.runtime.reviewStatus?` · ${b(`status.${e.runtime.reviewStatus}`,{ns:"agentReviews"})}`:""]}):null]}):null]}),actions:e.draft?a.jsxs(a.Fragment,{children:[a.jsx(CN,{"aria-label":d?b("myAgents.viewDeploymentProgress",{name:e.name}):b("myAgents.editDraftNamed",{name:e.name}),onClick:()=>d?h==null?void 0:h(d):m==null?void 0:m(e.draft),children:b(d?"myAgents.viewProgress":"common.edit")}),a.jsx(CN,{tone:"danger","aria-label":b("myAgents.deleteDraftNamed",{name:e.name}),onClick:()=>g==null?void 0:g(e.draft),children:b("common.delete")})]}):S||k?a.jsxs(_t,{type:"button",color:"primary",size:"sm",pill:!1,"aria-label":b("myAgents.recheckCompatibility",{name:e.name}),onClick:()=>o==null?void 0:o(e),children:[a.jsx(JD,{}),b("common.retry")]}):a.jsx(MB,{className:u?"my-agent-use is-connected":"my-agent-use",disabled:!x||O||k||l||u,"aria-busy":l||void 0,label:u?b("myAgents.connectedNamed",{name:e.name}):w?b("myAgents.wakeAndChat",{name:e.name}):b("myAgents.chatWith",{name:e.name}),onClick:()=>void(n==null?void 0:n(e)),children:l?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"my-agent-use-spinner","aria-hidden":"true"}),a.jsx("span",{className:"sr-only",children:b(w?"myAgents.waking":"agentSelector.connecting")})]}):a.jsx(gYt,{})}),children:[a.jsx(xH,{leading:a.jsx(t1,{seed:e.name}),title:e.name,subtitle:e.sandbox?a.jsx("span",{className:"my-agent-session-id",title:C,children:C}):void 0,status:e.draft?d?a.jsx("span",{className:"my-agent-deploying-badge",children:b("myAgents.deploying")}):a.jsx("span",{className:"my-agent-draft-badge",children:b("myAgents.draft")}):e.sandbox?a.jsx("span",{className:"my-agent-status-label","data-ready":MD(e.sandbox.status)==="ready"||void 0,children:e.description}):e.runtime&&d?a.jsx("span",{className:"my-agent-deploying-badge",children:b("myAgents.deploying")}):O?a.jsx(ka,{content:s==null?void 0:s.message,contentClassName:"my-agent-compatibility-tooltip",maxWidth:360,align:"end",interactive:!0,preventUnintentionalClickToClose:!0,children:a.jsx("span",{className:"my-agent-compatibility-trigger",tabIndex:0,children:a.jsxs(Ya,{className:"my-agent-compatibility-status",color:"secondary",variant:"soft",size:"sm",pill:!0,children:[a.jsx("span",{className:"my-agent-compatibility-spinner","aria-hidden":"true"}),a.jsx("span",{children:b("myAgents.checking")})]})})}):k?a.jsx(ka,{content:s==null?void 0:s.message,contentClassName:"my-agent-compatibility-tooltip",maxWidth:360,align:"end",interactive:!0,preventUnintentionalClickToClose:!0,children:a.jsx("span",{className:"my-agent-compatibility-trigger",tabIndex:0,children:a.jsx(Ya,{className:"my-agent-compatibility-status",color:"warning",variant:"soft",size:"sm",pill:!0,children:b("myAgents.chatUnsupported")})})}):S?a.jsx(ka,{content:s==null?void 0:s.message,contentClassName:"my-agent-compatibility-tooltip",maxWidth:360,align:"end",interactive:!0,preventUnintentionalClickToClose:!0,children:a.jsx("span",{className:"my-agent-compatibility-trigger",tabIndex:0,children:a.jsx(Ya,{className:"my-agent-compatibility-status",color:"danger",variant:"soft",size:"sm",pill:!0,children:b("myAgents.checkFailed")})})}):null}),c?a.jsx(ka,{content:c,contentClassName:"my-agent-error-tooltip",maxWidth:360,interactive:!0,children:a.jsx("p",{className:"my-agent-wake-note",role:"alert",tabIndex:0,children:c})}):null,w&&l?a.jsx("p",{className:"my-agent-wake-note",role:"status",children:a.jsx(fn,{children:b("myAgents.wakingHint")})}):null,e.sandbox?null:a.jsx(wH,{children:e.description})]})}function CYt({cloudProvider:e,studioRegion:t,canCreateRuntimeAgents:n,canCreatePersonalAgents:i,canUpdate:r,runtimeScope:s,onCreateAgent:o,onOpenCodexProjectUpload:l,onUseAgent:c,onViewAgentDetails:u,onCreateSandboxAgent:d,onUseSandboxAgent:f,onViewSandboxAgentDetails:h,activeType:m,onActiveTypeChange:g,sandboxRefreshKey:b=0,connectedRuntimeId:v="",hiddenRuntimeIds:y=pYt,drafts:w=[],deploymentTasks:x=[],draftDeploymentTaskIds:O={},onViewDeploymentTask:k,onEditDraft:S,onDeleteDraft:C}){const{t:E}=Te("ui"),j=p.useRef(null),T=p.useRef(null),R=p.useRef(0),A=p.useRef(null),N=p.useRef(0),P=p.useRef(null),I=p.useRef(new Map),D=kYt(t,e),[_,L]=p.useState(null),[F,M]=p.useState(""),[V,q]=p.useState(s==="mine"?"mine":"all"),[U,J]=p.useState(D),[z,Z]=p.useState(null),[ne,W]=p.useState([]),[G,H]=p.useState(""),[se,Y]=p.useState(!0),[X,ie]=p.useState(""),[ee,be]=p.useState([]),[ue,pe]=p.useState(!1),[ke,je]=p.useState(""),[Pe,Ee]=p.useState(""),[ze,_e]=p.useState({}),[ae,le]=p.useState({}),[ge,Oe]=p.useState(null),[Se,We]=p.useState(()=>Date.now()),Ye=p.useMemo(()=>sYt.map(qe=>({value:qe,label:E(`myAgents.agentTypes.${qe}`)})),[E]),ye=p.useMemo(()=>{const qe=_u(e);return qe.some(nt=>nt.value===D)?qe:[{value:D,label:D},...qe]},[e,D]);p.useEffect(()=>{s==="mine"&&q("mine")},[s]),p.useEffect(()=>{J(D)},[D]),p.useEffect(()=>{We(Date.now());const qe=window.setInterval(()=>We(Date.now()),1e3);return()=>window.clearInterval(qe)},[]);const we=p.useMemo(()=>w.map(qe=>wYt(qe,E)),[w,E]),Ae=p.useMemo(()=>{const qe=new Map,nt=new Map,et=new Map;for(const ft of x){if(ft.status!=="running")continue;if(qe.set(ft.id,ft),ft.draftId){const At=nt.get(ft.draftId);(!At||ft.startedAt>At.startedAt)&&nt.set(ft.draftId,ft)}if(!ft.runtimeId)continue;const Et=et.get(ft.runtimeId);(!Et||ft.startedAt>Et.startedAt)&&et.set(ft.runtimeId,ft)}return{byId:qe,byDraftId:nt,byRuntimeId:et}},[x]),He=p.useCallback(qe=>{var et;if(qe.draft){const ft=O[qe.draft.id];return Ae.byDraftId.get(qe.draft.id)??(ft?Ae.byId.get(ft):void 0)}const nt=(et=qe.runtime)==null?void 0:et.runtimeId;return nt?Ae.byRuntimeId.get(nt):void 0},[Ae,O]),Ue=p.useCallback((qe,nt)=>{var At;(At=A.current)==null||At.abort(),Og.clear();const et=new AbortController;A.current=et;const ft=++R.current;return Y(!0),ie(""),SYt(m==="mpa"?"mpa":"general",V,U,qe,It=>{R.current===ft&&W(Gt=>nt?It:[...Gt,...It])},E,et.signal).then(It=>{R.current===ft&&H(It)}).catch(It=>{R.current===ft&&(Hoe(It)||ie(Ey(It,E("myAgents.loadGeneralAgents"),"GET /web/runtimes")))}).finally(()=>{R.current===ft&&Y(!1),A.current===et&&(A.current=null)})},[m,V,U,E]);p.useEffect(()=>{if(!(m!=="general"&&m!=="mpa"))return W([]),H(""),Ue("",!0),()=>{var qe;(qe=A.current)==null||qe.abort(),A.current=null,Og.clear(),R.current+=1}},[m,Ue]),p.useEffect(()=>{if(m!=="general"&&m!=="mpa"){for(const et of I.current.values())et.abort();I.current.clear();return}const qe=new Set(ne.filter(et=>{var ft,Et;return((ft=et.runtime)==null?void 0:ft.runtimeId)!==v&&((Et=et.runtime)==null?void 0:Et.region)===U}).map(ty).filter(Boolean));for(const[et,ft]of I.current)qe.has(et)||(ft.abort(),I.current.delete(et));const nt=ne.filter(et=>{var It,Gt,Xe;const ft=(It=et.runtime)==null?void 0:It.runtimeId;if(!ft||ft===v||((Gt=et.runtime)==null?void 0:Gt.region)!==U)return!1;const Et=ty(et),At=(Xe=ae[Et])==null?void 0:Xe.status;return!I.current.has(Et)&&(!At||At==="checking")});for(const et of nt)I.current.set(ty(et),new AbortController);le(et=>{var At,It;let ft=!1;const Et={...et};for(const Gt of ne){const Xe=ty(Gt);if(!Xe)continue;const wt=((At=Gt.runtime)==null?void 0:At.runtimeId)===v;wt&&((It=Et[Xe])==null?void 0:It.status)!=="compatible"?(Et[Xe]={status:"compatible",message:E("myAgents.compatibility.supported")},ft=!0):!wt&&!Et[Xe]&&(Et[Xe]={status:"checking",message:E("myAgents.compatibility.checking")},ft=!0)}return ft?Et:et}),BXt(nt,async et=>{const ft=et.runtime;if(!ft)return;const Et=ty(et),At=I.current.get(Et);if(At)try{const It=await Ww(ft.runtimeId,ft.region,{signal:At.signal,preferCached:!0,timeoutMs:cYt,currentVersion:ft.currentVersion});if(At.signal.aborted)return;le(Gt=>({...Gt,[Et]:It&&It.length>0?{status:"compatible",message:E("myAgents.compatibility.supported")}:{status:"unsupported",message:E("myAgents.compatibility.empty")}}))}catch(It){if(At.signal.aborted||(It==null?void 0:It.name)==="AbortError")return;le(Gt=>({...Gt,[Et]:Woe(It,E)}))}finally{I.current.get(Et)===At&&I.current.delete(Et)}})},[m,v,U,ne,E]),p.useEffect(()=>()=>{var qe;(qe=A.current)==null||qe.abort();for(const nt of I.current.values())nt.abort();I.current.clear()},[]);const jt=p.useCallback(async qe=>{var ft;(ft=P.current)==null||ft.abort();const nt=new AbortController;P.current=nt;const et=++N.current;pe(!0),je(""),be([]);try{const Et=qe==="codex"?await Br.listSessions({signal:nt.signal,autoResumeSnapshots:!1}):await Br.listAgentSessions(qe,{signal:nt.signal,autoResumeSnapshots:!1});if(N.current!==et)return;be(Et.map(At=>xYt(At,E)))}catch(Et){if((Et==null?void 0:Et.name)==="AbortError"||N.current!==et)return;je(Ey(Et,E("myAgents.loadAgentType",{type:E(`myAgents.agentTypes.${qe}`)}),`GET /web/${qe==="codex"?"sandbox":qe}/sessions`))}finally{P.current===nt&&(P.current=null),N.current===et&&pe(!1)}},[E]);function Pt(qe){var nt;qe!==m&&(qe==="general"||qe==="mpa"?(R.current+=1,W([]),H(""),ie(""),Y(!0)):((nt=P.current)==null||nt.abort(),P.current=null,N.current+=1,be([]),je(""),pe(!0)),g(qe))}function Kt(){m!=="general"&&m!=="mpa"||(R.current+=1,W([]),H(""),ie(""),Y(!0))}function Ct(qe){qe!==V&&(Kt(),q(qe))}function xt(qe){qe!==U&&(Kt(),J(qe))}p.useEffect(()=>{var qe;if(m==="general"||m==="mpa"){(qe=P.current)==null||qe.abort(),P.current=null,N.current+=1;return}return jt(m),()=>{var nt;(nt=P.current)==null||nt.abort(),P.current=null,N.current+=1}},[m,jt,b]),p.useEffect(()=>{const qe=T.current,nt=j.current;if(!qe||!nt||m!=="general"&&m!=="mpa"||!G||se)return;const et=new IntersectionObserver(([ft])=>{ft.isIntersecting&&Ue(G,!1)},{root:nt,rootMargin:"240px 0px",threshold:.01});return et.observe(qe),()=>et.disconnect()},[m,Ue,se,G]);const tt=p.useCallback(async qe=>{if(!Pe){Ee(qe.id),_e(nt=>({...nt,[qe.id]:""}));try{await new Promise(nt=>requestAnimationFrame(()=>nt())),qe.sandbox?await f(qe.sandbox):await c(qe)}catch(nt){_e(et=>({...et,[qe.id]:nt instanceof Error?nt.message:String(nt)}))}finally{Ee("")}}},[Pe,c,f]),mt=p.useCallback(async qe=>{var Et;const nt=qe.runtime;if(!nt)return;const et=ty(qe);le(At=>({...At,[et]:{status:"checking",message:E("myAgents.compatibility.checking")}})),(Et=I.current.get(et))==null||Et.abort();const ft=new AbortController;I.current.set(et,ft);try{const At=await c9e(()=>Ww(nt.runtimeId,nt.region,{retryProbe:!0,signal:ft.signal,timeoutMs:uYt,currentVersion:nt.currentVersion}));if(ft.signal.aborted)return;le(It=>({...It,[et]:At&&At.length>0?{status:"compatible",message:E("myAgents.compatibility.supported")}:{status:"unsupported",message:E("myAgents.compatibility.empty")}}))}catch(At){if(ft.signal.aborted||Hoe(At))return;le(It=>({...It,[et]:Woe(At,E)}))}finally{I.current.get(et)===ft&&I.current.delete(et)}},[E]),Ne=p.useCallback(qe=>{const nt=qe.runtime;!r||!nt||He(qe)||q8({runtimeId:nt.runtimeId,region:nt.region,appName:qe.appName,currentVersion:nt.currentVersion})},[r,He]),Ot=p.useMemo(()=>{const qe=F.trim().toLocaleLowerCase(),nt=m==="general"||m==="mpa"?[...we,...ne]:ee,ft=(V==="mine"?nt.filter(Gt=>Gt.isMine):nt).filter(Gt=>{var wt;const Xe=((wt=Gt.runtime)==null?void 0:wt.region)??Gt.region;return!Xe||Xe===U}),Et=qe?ft.filter(Gt=>Gt.name.toLocaleLowerCase().includes(qe)):ft;if(m!=="general"&&m!=="mpa")return Et;const At=y.size>0?Et.filter(Gt=>!Gt.runtime||!y.has(Gt.runtime.runtimeId)):Et,It=At.findIndex(Gt=>{var Xe;return((Xe=Gt.runtime)==null?void 0:Xe.runtimeId)===v});return It<=0?At:[At[It],...At.slice(0,It),...At.slice(It+1)]},[m,v,we,y,F,V,U,ne,ee]);p.useEffect(()=>{if(!r||m!=="general"&&m!=="mpa")return;const qe=Ot.filter(At=>!!At.runtime).filter(At=>!He(At)).slice(0,dYt);if(qe.length===0)return;let nt=!1,et=0;const ft=async()=>{for(;!nt;){const At=qe[et];if(et+=1,!(At!=null&&At.runtime)||(await q8({runtimeId:At.runtime.runtimeId,region:At.runtime.region,appName:At.appName,currentVersion:At.runtime.currentVersion}),nt))return}},Et=window.setTimeout(()=>{for(let At=0;At{nt=!0,window.clearTimeout(Et)}},[m,r,He,Ot]);const Nt=E(`myAgents.agentTypes.${m}`,{defaultValue:E("myAgents.agent")}),Yt=m==="general"||m==="mpa"?se&&ne.length===0&&we.length===0:ue&&ee.length===0,xn=!Yt&&Ot.length===0;let Ke;m==="general"&&n?Ke=()=>o(U,"general"):m==="mpa"&&n&&e==="volcengine"?Ke=()=>Z(U):aYt(m)&&i&&(Ke=()=>d(m));const St=m==="codex"&&i&&!!l;return a.jsxs(kh,{className:"my-agents-page","aria-label":E("myAgents.agent"),children:[a.jsx(q0,{title:E("myAgents.agent"),className:"my-agents-header"}),a.jsxs(sb,{className:"my-agent-toolbar",children:[a.jsx(ab,{idPrefix:"my-agent-ownership",ariaLabel:E("myAgents.creatorFilter"),value:V,items:[{id:"all",label:E("common.all"),disabled:s==="mine"},{id:"mine",label:E("agentSelector.createdByMe")}],onChange:Ct}),a.jsxs("div",{className:"resource-toolbar__actions",children:[a.jsx(ob,{id:"my-agent-type-filter",ariaLabel:E("myAgents.agentType"),value:m,options:Ye,onChange:Pt}),a.jsx(ob,{id:"my-agent-region-filter",ariaLabel:E("myAgents.region"),value:U,options:ye,onChange:xt}),a.jsx(Zp,{className:"my-agent-search","aria-label":E("myAgents.searchAgents"),value:F,onChange:qe=>M(qe.target.value),placeholder:E("common.search")}),St?a.jsxs("button",{type:"button",className:"my-agent-create-secondary",onClick:l,children:[a.jsx(bYt,{}),a.jsx("span",{children:E("myAgents.handoff")})]}):null]})]}),a.jsxs(Jp,{className:"my-agent-results",ref:j,"aria-label":E("myAgents.agentList",{type:Nt}),children:[Yt?a.jsx(cl,{}):(m==="general"||m==="mpa"?X:ke)&&Ot.length===0?a.jsxs("div",{className:"my-agent-empty",role:"alert",children:[a.jsx("p",{children:m==="general"||m==="mpa"?X:ke}),a.jsx("button",{type:"button",onClick:()=>{m==="general"||m==="mpa"?Ue("",!0):jt(m)},children:E("common.reload")})]}):xn&&!Ke?F.trim()||V==="mine"||U!==D?a.jsx("div",{className:"my-agent-empty-message",children:a.jsxs(Wn,{fill:"none",children:[a.jsx(Wn.Icon,{children:a.jsx(rat,{})}),a.jsx(Wn.Title,{children:E("myAgents.noMatchingAgents")}),a.jsx(Wn.Description,{children:E("myAgents.adjustSearch")})]})}):m!=="general"?a.jsx("div",{className:"my-agent-empty-message",children:a.jsxs(Wn,{fill:"none",children:[a.jsx(Wn.Icon,{children:a.jsx(yYt,{type:m})}),a.jsx(Wn.Title,{className:"my-agent-sandbox-empty-title",children:E("myAgents.noAgentType",{type:Nt})})]})}):a.jsx("div",{className:"my-agent-empty-message",children:a.jsxs(Wn,{fill:"none",children:[a.jsx(Wn.Icon,{children:a.jsx(Ap,{})}),a.jsx(Wn.Title,{children:E("myAgents.noGeneralAgents")}),a.jsx(Wn.Description,{children:E("myAgents.createGeneralAgentDescription")})]})}):a.jsxs(a.Fragment,{children:[(m==="general"||m==="mpa")&&X?a.jsxs("div",{className:"my-agent-inline-error",role:"alert",children:[a.jsx("span",{children:X}),a.jsx("button",{type:"button",onClick:()=>void Ue("",!0),children:E("common.reload")})]}):null,a.jsxs(W0,{className:"my-agent-grid",children:[Ke?a.jsx(lb,{className:"my-agent-create-card","aria-label":E("myAgents.createAgentType",{type:Nt}),onClick:Ke,icon:a.jsx(mYt,{}),children:E(m==="mpa"?"myAgents.mpaCreate.title":"myAgents.createAgent")}):null,Ot.map(qe=>{var et,ft,Et,At,It;const nt=OYt(qe,ne,E);return a.jsx(EYt,{agent:qe,onReview:L,deploymentTask:He(qe),nowMs:Se,onViewDeploymentTask:k,onUse:tt,compatibility:qe.runtime?ae[ty(qe)]??{status:"checking",message:E("myAgents.compatibility.checking")}:void 0,onRetryCompatibility:mt,onPrepareUpdate:((et=qe.runtime)==null?void 0:et.canManage)===!1||((ft=qe.runtime)==null?void 0:ft.visibility)==="enterprise"||((Et=qe.runtime)==null?void 0:Et.reviewStatus)==="pending"?void 0:Ne,onViewDetails:nt&&((At=qe.runtime)==null?void 0:At.canManage)!==!1?()=>{nt.sandbox?h(nt.sandbox):u(nt)}:void 0,connecting:qe.id===Pe,connectError:ze[qe.id],connected:((It=qe.runtime)==null?void 0:It.runtimeId)===v,onEditDraft:S,onDeleteDraft:Oe},qe.id)})]})]}),(m==="general"||m==="mpa")&&!X&&!Yt&&(Ot.length>0||!!G)&&a.jsx("div",{className:"my-agent-load-more",ref:T,"aria-live":"polite",children:se?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),a.jsx("span",{children:E("myAgents.loadingMore")})]}):G?a.jsx("span",{children:E("myAgents.scrollForMore")}):a.jsx("span",{children:E("myAgents.allLoaded")})})]}),z&&a.jsx(rYt,{region:z,onClose:()=>Z(null),onCreated:()=>{Zm(),U===z&&m==="mpa"&&Ue("",!0)}},z),_!=null&&_.runtime?a.jsx(l9e,{runtimeId:_.runtime.runtimeId,region:_.runtime.region,name:_.name,canPublish:_.runtime.canPublish===!0,onClose:()=>L(null),onChanged:()=>{Zm(),Ue("",!0)}},`${_.runtime.region}:${_.runtime.runtimeId}`):null,ge?a.jsx(Cd,{title:E("myAgents.deleteDraftTitle"),description:E("myAgents.deleteDraftDescription",{name:ge.draft.name||E("agentSelector.unnamedAgent")}),confirmLabel:E("myAgents.deleteDraft"),variant:"danger",onCancel:()=>Oe(null),onConfirm:()=>{C==null||C(ge),Oe(null)}}):null]})}function gK({section:e,onWorkspace:t,onEnvironment:n,onProjects:i,actions:r,children:s,className:o=""}){const{t:l}=Te("ui"),c=l(e==="workspaces"?"workspace.title":e==="environments"?"common.environment":"workspace.codeProjects");return a.jsxs(kh,{className:`workspace-center ${o}`,"aria-label":c,children:[a.jsx(q0,{title:c}),a.jsxs(sb,{children:[(t||n)&&a.jsx(ab,{items:[{id:"workspaces",label:l("workspace.title")},{id:"environments",label:l("common.environment")},...i?[{id:"projects",label:l("workspace.codeProjects")}]:[]],value:e,onChange:u=>{u==="workspaces"&&(t==null||t()),u==="environments"&&(n==null||n()),u==="projects"&&(i==null||i())},ariaLabel:l("workspace.resourceType"),idPrefix:"workspace-center"}),a.jsx("div",{className:"resource-toolbar__actions",children:r})]}),s]})}const AYt="_Container_13560_1",TYt="_Textarea_13560_174",Goe={Container:AYt,Textarea:TYt},vb=e=>{const t=p.useRef(null),i=`search-ui-input-${p.useId()}`,{id:r,name:s,variant:o="outline",size:l="md",gutterSize:c,className:u,autoComplete:d,disabled:f=!1,readOnly:h=!1,invalid:m=!1,allowAutofillExtensions:g=!!s,onFocus:b,onBlur:v,onAnimationStart:y,onAutofill:w,autoSelect:x,rows:O=3,maxRows:k,autoResize:S,ref:C,onChange:E,...j}=e,[T,R]=p.useState(!1),A=S?Math.max(k??10,O):O;p.useEffect(()=>{var I;x&&((I=t.current)==null||I.select())},[x]);const N=I=>{y==null||y(I),I.animationName==="native-autofill-in"&&(w==null||w())},P=p.useCallback(()=>{if(!S||!t.current||A===void 0)return;t.current.style.height="0px";const I=t.current.scrollHeight;t.current.style.height=I+"px"},[S,A]);return p.useEffect(()=>{P()},[e.value,O,P]),a.jsx("div",{className:Ui(Goe.Container,u),"data-variant":o,"data-size":l,"data-gutter-size":c,"data-focused":T,"data-disabled":f?"":void 0,"data-readonly":h?"":void 0,"data-invalid":m?"":void 0,style:z0({"textarea-min-rows":`${O}`,"textarea-max-rows":`${A}`}),children:a.jsx("textarea",{...j,onChange:I=>{E==null||E(I),P()},ref:eT([t,C]),id:r||(g?void 0:i),className:Goe.Textarea,name:s,readOnly:h,disabled:f,rows:O,onFocus:I=>{R(!0),b==null||b(I)},onBlur:I=>{R(!1),v==null||v(I)},onAnimationStart:N,"data-lpignore":g?void 0:!0,"data-1p-ignore":g?void 0:!0})})},PL="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2048%2048'%3e%3cimage%20width='48'%20height='48'%20href='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAMKADAAQAAAABAAAAMAAAAADbN2wMAAAH7UlEQVRoBdVZWWwbVRQ9492Onc1xTfaWLukq9oSqLKnYBZRSNgn6AagsAgmJRfzxg4SEEDtiER8IBKKAChK0FS1tKYWW0lZQKKV0gxCVJm3ikDiO17EdzrUzSdw4jj1OpeQqNzO237vvnHfvu/e9GWVwcBBDYue1mrqE2kI1UqeSJAnmIHUzNUCNUmGiKtQy6oPUR6geqnw/FSVOUH9R36KupfaDHnBQn6MGqEnqVJcEAfZTBbNL4b+lZPI1VbwwnaSfYO8z8N+TVMd0Qj6EVdbs3eIBP29cVFkL00kk+wSEwHAamgh9bDAJSQWTITZFnF+85J1tBPyOUC9OqqnsVdTIRkVBi70Msy125uriHJ8XAXFRfzKBTQM+rO0/hc54cSQE8iyzAx/XLcEltjIU44uCQijOaHvPfxIv97TjWCzEcMo7+sZ4TGa+2V6KT2rPQ73ZptsPBZE30fVrymvxTvUCtDoqYC0ijhMk/3MkgDd62xFheOqVggjIIAbOVaujEh/ULsaNzioUsxhVAv/A34GD0YBubxZMQJupWpMNr58zHytcHth1ekICsDcRx4u+fxBK6vOCbgKyEIXEK975WOmaoZuErKv1QR8ORQd0eUE3Ac0TNSYrXvI24fZSLxwGfebiDKW3e08gln9J0oYvKoMNG6kmiRdmzMOtTi8sOsJJJfANA93oiseGbeZ7k1EHZAKCEcApu4wCxUsSz3rm4HQiim3B/wpOsBJA2yP/4cZIJYIBFcGwCjWeSKEwm4wosZtR7rKizGXJQJZRB1TuttftAprnAbOrM9rl9UHqwg+s1o+eOow/GNN5CaPOklSgdKq4us+Ji7pt6Dw1AF9vBOGImjJht5lRVWFDY7UL58/3wOt2YPEcN2xWVpPRe6EQC+y9rwINPNKsuRaYX5cXhIxGkks+Y7V+6vQRdLBi5yx1bGwicFebivj+ARgOhZGMJMFyQyWpoV2GRIa2ZXOX2bDyqnPxzEPNKC+1Zj957eDBTbz34PXAwvoMfBN+kGV8Bxf00VgQz/vaEB6nSCnRQVj2h2DZG4TyZwQWlSils3m8RDDEhk2uaqlHaYklVb3Ha42dh4B3eMzZ//eEmMc0kGL3cEU9WksqU4XvzAYKZ9n6fQCOz3thORCGkhgCf2bDMz4bjQpW39yE65Y1QO5FxiUgP+76E3hzI7D1VyBcwP5NTFcZzXjaPRMNZmvGPkfA23YMwLHRD0Mf3ZwTgaBIi8GgYMGsSjx2z3kEP9Jp5E5rOeoqQH75C3htPfDpD4CskXxFvHC5vQKPVjSwPqQfcKTAfxuA/Ws/lBAXwEhUTGjWSAL3r1qYykSju+UkIFbZDx09wPvb0iH1W9uEYw03MHAV3ltew1CqgDkyCNtWgt/cnwY/3GriG5n9hbMrccNljRmzLz0nJCCNJBsEwsCH24E3NgDr96brhfyWS2Sm3EYLVsOL0i0DsG8h+LDkqcLExHhfc9siVDDrjJ59sZJRyHKZFRKybiSkTtIjR08CrXwEdtGcXL2A4+192LOuDeatfqg6wMvsL5lbhWuWysIdO995E9BgSkh19THX7wQOtANXLgKWLQSaarUWI9dNP7bjo68OY9uef6GqhcW8ZkViX2a/nBWYQ4+RggmIBfFGnHgOcD0c7wD2HgOW0xuXk0xN5SDaOwL4cnsb1m05joPHejKK0hgEOb4Q8Muba3H1pXUwZZl96aqLgHSU2RCbEe6/9hzh875OYPdhYF5NDLt/Oohd+46gNxBjm2zzJhZyi/RyV5TggdsvRJnTOm5j3QQ0i9ra6OHj1u9+B/YdNcLXVQdDmYNPy9oZ971IcIPHjUHadVrHHFfZNphtTtx508W4eJEHsg7Gk6IJaIZlDEn3EdUEl7sBg4la2MtqkYgNIOz/F9FgF6IhX6p5mozcjgbGasw/xWCCs7IeN7U24b4VddwZj26jjTZynTQCmknxSBqIETanh7ceWEpmpIiokT7E6JFosBvxaD/iJCeNDQYzTFYnzHY3SsobmfM9eOyucjTO0KyOf510AqOHkl2kiMlSQoAlsPLAk4hHSCaIJMMqmUgfYBQeggxGK4xmOxprXHh8lYK51em+E/0/qwQyBh8iY+Q52pjlOZD8XFcFPHELcGlT3stlbBaymtOROTReBoZJ+0DjZ9pv4SFq9fL0YWqcjJl1+AwP8OSGS+amq6y4P/fyyWqvoC9lDAG7ainPEJcBs7xMBGOLbU6bGQTMJHAnDUlG2biPFZevEM4GCZl9sSsnPgG+bAHfa+l8vZJxpNSo+oPp/c4XP6bPBN0kog2qtdFz1WzIkfXmZuAKVm6JewlbvZKVgGZMilMPwW9ngdr5B3CEG7iEbCY5ffl6RgPtYDGdybS4ogW4YDbgLefTD5s2kv5rTgKaWdlKi1fau4BDJ3jM5I70NDd0J7grzfZEUMg5CM5Tmg4TiW3ZtVYxTKpcgM2iWS7+mhcBbRiZ/TBTd4jPjtSEVF3AxxdUPgkxTrUUMTcBykKUmLZwhQlYPhWBeCBV5DRjk3QtiEC2McUDsjPVCEhWEQ8Umk2y2c7nOyEwrV/ySdbdQo3nw3aKtRHM3wiBtVQu02knISJ+SQh8Q32TyqTJJ6xTXyQzyzb2LeoBWQOy5pjwcDf1YSqzNIooLex99kTCppsq4N+l+oUArylhoku9sb+O18VU8c5UEiZu7KGyrKKTmgr7/wGxhy03aZIycwAAAABJRU5ErkJggg=='%20/%3e%3c/svg%3e",_Yt="data:image/svg+xml,%3c?xml%20version='1.0'?%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20100%20100'%3e%3ctitle%3ePandoc%20Icon%3c/title%3e%3cdesc%20property='dc:creator'%3eAlbert%20Krewinkel%3c/desc%3e%3cmetadata%20id='license'%20xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23'%20xmlns:dc='http://purl.org/dc/elements/1.1/'%20xmlns:cc='http://creativecommons.org/ns%23'%3e%3crdf:RDF%3e%3ccc:Work%20rdf:about=''%3e%3cdc:format%3eimage/svg+xml%3c/dc:format%3e%3cdc:type%20rdf:resource='http://purl.org/dc/dcmitype/StillImage'%20/%3e%3ccc:license%20rdf:resource='http://creativecommons.org/licenses/by-sa/4.0/'%20/%3e%3c/cc:Work%3e%3ccc:License%20rdf:about='http://creativecommons.org/licenses/by-sa/4.0/'%3e%3ccc:permits%20rdf:resource='http://creativecommons.org/ns%23Reproduction'%20/%3e%3ccc:permits%20rdf:resource='http://creativecommons.org/ns%23Distribution'%20/%3e%3ccc:requires%20rdf:resource='http://creativecommons.org/ns%23Notice'%20/%3e%3ccc:requires%20rdf:resource='http://creativecommons.org/ns%23Attribution'%20/%3e%3ccc:permits%20rdf:resource='http://creativecommons.org/ns%23DerivativeWorks'%20/%3e%3ccc:requires%20rdf:resource='http://creativecommons.org/ns%23ShareAlike'%20/%3e%3c/cc:License%3e%3c/rdf:RDF%3e%3c/metadata%3e%3crect%20fill='%23fed'%20stroke='%23fed'%20width='100'%20height='100'/%3e%3cg%20fill='none'%20stroke='%234093da'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='8'%20transform='skewX(-6)%20translate(8%201)'%3e%3cpath%20d='M%2030,10%20l%200,80%20M%2045,10%20l%200,80%20M%2020,10%20l%2040,0%20l%2018,18%20l%200,25%20l%20-33,0'%20/%3e%3cpath%20fill='%234093da'%20stroke-width='6'%20d='M%2061,10%20l%2017,17%20l%20-17,0%20l%200,-17'%20/%3e%3c/g%3e%3c/svg%3e",jYt="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%20100%20100'%20version='1.1'%20id='svg4'%20sodipodi:docname='favicon.svg'%20inkscape:version='1.4.4%20(dcaf3e7,%202026-05-05)'%20xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape'%20xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:svg='http://www.w3.org/2000/svg'%3e%3csodipodi:namedview%20id='namedview4'%20pagecolor='%23ffffff'%20bordercolor='%23000000'%20borderopacity='0.25'%20inkscape:showpageshadow='2'%20inkscape:pageopacity='0.0'%20inkscape:pagecheckerboard='0'%20inkscape:deskcolor='%23d1d1d1'%20showgrid='true'%20inkscape:zoom='8.2236519'%20inkscape:cx='34.534536'%20inkscape:cy='45.174577'%20inkscape:window-width='1881'%20inkscape:window-height='1382'%20inkscape:window-x='1512'%20inkscape:window-y='30'%20inkscape:window-maximized='0'%20inkscape:current-layer='svg4'%3e%3cinkscape:grid%20type='axonomgrid'%20id='grid4'%20units='px'%20originx='0'%20originy='0'%20spacingx='3.7795276'%20spacingy='3.7795276'%20empcolor='%230099e5'%20empopacity='0.30196078'%20color='%230099e5'%20opacity='0.14901961'%20empspacing='0'%20dotted='false'%20gridanglex='40'%20gridanglez='40'%20enabled='true'%20visible='true'%20/%3e%3c/sodipodi:namedview%3e%3cdefs%20id='defs1'%3e%3cfilter%20id='shadow'%20x='0'%20y='0'%20width='1'%20height='1'%3e%3cfeDropShadow%20dx='0'%20dy='2'%20stdDeviation='3'%20flood-color='rgba(50,%2050,%2093,%200.18)'%20/%3e%3c/filter%3e%3c/defs%3e%3crect%20x='4'%20y='4'%20width='92'%20height='92'%20rx='22.08'%20fill='%23e8efff'%20filter='url(%23shadow)'%20id='rect1'%20transform='matrix(1.0869565,0,0,1.0869565,-4.347826,-4.347826)'%20style='stroke-width:0.92'%20ry='22.08'%20/%3e%3cpath%20style='fill:%230a2540;fill-opacity:1;stroke-width:1.88976'%20d='M%2049.999999,6.535431%204.9573423,44.330708%2049.999999,82.125984%2092.790523,46.220471%2095.042656,44.330708%20Z'%20id='path1'%20/%3e%3cpath%20style='fill:%23425466;fill-opacity:1;stroke-width:1.88976'%20d='M%204.9573423,44.330708%20V%2055.669291%20L%2049.999999,93.464567%20V%2082.125984%20Z'%20id='path2'%20/%3e%3cpath%20style='fill:%231a3550;fill-opacity:1;stroke-width:1.88976'%20d='M%2049.999999,82.125984%2095.042656,44.330708%20V%2055.669291%20L%2049.999999,93.464567%20Z'%20id='path3'%20/%3e%3cpath%20style='fill:%234ade80;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;fill-opacity:1'%20d='m%2045.042657,30.236221%209.008531,-7.559055%2022.521328,18.897638%20-9.008531,7.559056%20z'%20id='path5'%20/%3e%3cpath%20style='fill:none;fill-opacity:1;stroke:%234ade80;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1'%20d='M%2027.025594,49.133859%2047.29479,47.244096%2045.042657,64.25197'%20id='path6'%20/%3e%3c/svg%3e",NYt="data:image/svg+xml,%3csvg%20fill='%23261230'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eAstral%3c/title%3e%3cpath%20d='M1.44%200C.6422%200%200%20.6422%200%201.44v21.12C0%2023.3578.6422%2024%201.44%2024h21.12c.7978%200%201.44-.6422%201.44-1.44V1.44C24%20.6422%2023.3578%200%2022.56%200Zm4.7998%204.8h11.5199c.7953%200%201.44.6447%201.44%201.44V19.2h-6.624v-4.32h-1.152v4.32H4.8V6.24c0-.7953.6446-1.44%201.4398-1.44m4.032%205.472v1.152h3.456v-1.152z'/%3e%3c/svg%3e",RYt="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='1.34em'%20height='1em'%20viewBox='0%200%20256%20192'%3e%3cpath%20fill='%232d4552'%20d='M84.38%20108.352c-9.556%202.712-15.826%207.467-19.956%2012.218c3.956-3.461%209.255-6.639%2016.402-8.665c7.311-2.072%2013.548-2.057%2018.702-1.062v-4.03c-4.397-.402-9.437-.082-15.148%201.539M63.987%2074.475l-35.49%209.35s.646.914%201.844%202.133l30.092-7.93s-.427%205.495-4.13%2010.41c7.005-5.299%207.684-13.963%207.684-13.963m29.709%2083.41c-49.946%2013.452-76.37-44.43-84.37-74.472c-3.696-13.868-5.31-24.37-5.74-31.148a11.5%2011.5%200%200%201%20.025-1.84C1.021%2050.58-.22%2051.927.032%2055.82c.43%206.773%202.044%2017.275%205.74%2031.147c7.997%2030.038%2034.424%2087.92%2084.37%2074.468c10.871-2.929%2019.038-8.263%2025.17-15.073c-5.652%205.104-12.724%209.123-21.616%2011.523M103.08%2039.05v3.555h19.59c-.401-1.259-.806-2.393-1.208-3.555z'/%3e%3cpath%20fill='%232d4552'%20d='M127.05%2068.325c8.81%202.503%2013.47%208.68%2015.933%2014.146l9.824%202.79s-1.34-19.132-18.645-24.047c-16.189-4.6-26.151%208.995-27.363%2010.754c4.71-3.355%2011.586-6.102%2020.251-3.643m78.197%2014.234c-16.204-4.62-26.162%209.003-27.356%2010.737c4.713-3.351%2011.586-6.099%2020.247-3.629c8.797%202.506%2013.452%208.676%2015.923%2014.146l9.837%202.8s-1.361-19.135-18.651-24.054m-9.76%2050.443l-81.718-22.845s.885%204.485%204.279%2010.293l68.803%2019.234c5.664-3.277%208.636-6.682%208.636-6.682m-56.655%2049.174C74.127%20164.828%2081.949%2082.386%2092.419%2043.32c4.311-16.1%208.743-28.066%2012.419-36.088c-2.193-.451-4.01.704-5.804%204.354C95.13%2019.5%2090.14%2032.387%2085.312%2050.427c-10.467%2039.066-18.29%20121.506%2046.412%20138.854c30.497%208.17%2054.256-4.247%2071.966-23.749c-16.81%2015.226-38.274%2023.763-64.858%2016.644'/%3e%3cpath%20fill='%23e2574c'%20d='M103.081%20138.565v-16.637l-46.223%2013.108s3.415-19.846%2027.522-26.684c7.311-2.072%2013.549-2.058%2018.701-1.063V39.05h23.145c-2.52-7.787-4.958-13.782-7.006-17.948c-3.387-6.895-6.859-2.324-14.741%204.269c-5.552%204.638-19.583%2014.533-40.698%2020.222c-21.114%205.694-38.185%204.184-45.307%202.95c-10.097-1.742-15.378-3.96-14.884%203.721c.43%206.774%202.043%2017.277%205.74%2031.148c7.996%2030.039%2034.424%2087.92%2084.37%2074.468c13.046-3.515%2022.254-10.464%2028.637-19.32h-19.256zm-74.588-54.74l35.494-9.35s-1.034%2013.654-14.34%2017.162c-13.31%203.504-21.154-7.812-21.154-7.812'/%3e%3cpath%20fill='%232ead33'%20d='M236.664%2039.84c-9.226%201.617-31.361%203.632-58.716-3.7c-27.363-7.328-45.517-20.144-52.71-26.168c-10.197-8.54-14.682-14.476-19.096-5.498c-3.902%207.918-8.893%2020.805-13.723%2038.846c-10.466%2039.066-18.289%20121.505%2046.413%20138.853c64.687%2017.333%2099.126-57.978%20109.593-97.047c4.83-18.037%206.948-31.695%207.53-40.502c.665-9.976-6.187-7.08-19.29-4.784M106.668%2072.161s10.196-15.859%2027.49-10.943c17.305%204.915%2018.645%2024.046%2018.645%2024.046zm42.215%2071.163c-30.419-8.91-35.11-33.167-35.11-33.167l81.714%2022.846c0-.004-16.494%2019.12-46.604%2010.32m28.89-49.85s10.183-15.847%2027.474-10.918c17.29%204.923%2018.651%2024.054%2018.651%2024.054z'/%3e%3cpath%20fill='%23d65348'%20d='m86.928%20126.51l-30.07%208.522s3.266-18.609%2025.418-25.983L65.25%2045.147l-1.471.447c-21.115%205.694-38.185%204.184-45.307%202.95c-10.097-1.741-15.379-3.96-14.885%203.722c.43%206.774%202.044%2017.276%205.74%2031.147c7.997%2030.039%2034.425%2087.92%2084.37%2074.468l1.471-.462zM28.493%2083.825l35.494-9.351s-1.034%2013.654-14.34%2017.162c-13.31%203.504-21.154-7.811-21.154-7.811'/%3e%3cpath%20fill='%231d8d22'%20d='m150.255%20143.658l-1.376-.335c-30.419-8.91-35.11-33.166-35.11-33.166l42.137%2011.778l22.308-85.724l-.27-.07c-27.362-7.329-45.516-20.145-52.71-26.17c-10.196-8.54-14.682-14.475-19.096-5.497c-3.898%207.918-8.889%2020.805-13.719%2038.846c-10.466%2039.066-18.289%20121.505%2046.413%20138.852l1.326.3zM106.668%2072.16s10.196-15.859%2027.49-10.943c17.305%204.915%2018.645%2024.046%2018.645%2024.046z'/%3e%3cpath%20fill='%23c04b41'%20d='m88.46%20126.072l-8.064%202.289c1.906%2010.74%205.264%2021.047%2010.534%2030.152c.918-.202%201.828-.376%202.762-.632c2.449-.66%204.72-1.479%206.906-2.371c-5.89-8.74-9.785-18.804-12.137-29.438m-3.148-75.644c-4.144%2015.467-7.852%2037.73-6.831%2060.06c1.826-.793%203.756-1.532%205.9-2.14l1.492-.334c-1.82-23.852%202.114-48.157%206.546-64.694a323%20323%200%200%201%203.373-11.704a105%20105%200%200%201-5.974%203.547a307%20307%200%200%200-4.506%2015.265'/%3e%3c/svg%3e",IYt="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='512'%20height='512'%20version='1.1'%20viewBox='0%200%20135.47%20135.47'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m67.733%2067.733%2029.33%2016.933-29.33%2050.8c37.408%200%2067.733-30.325%2067.733-67.733%200-12.341-3.3168-23.901-9.0837-33.867h-58.65z'%20fill='%23afccf9'/%3e%3cpath%20d='m67.733-1e-6c-25.07%200-46.942%2013.63-58.654%2033.875l29.324%2050.792%2029.33-16.933v-33.867h58.65c-11.714-20.24-33.583-33.867-58.65-33.867z'%20fill='%231767d1'/%3e%3cpath%20d='m0%2067.733c0%2037.408%2030.324%2067.733%2067.733%2067.733l29.33-50.8-29.33-16.933-29.33%2016.933-29.324-50.792c-5.7637%209.9632-9.0794%2021.519-9.0794%2033.858'%20fill='%23679ef5'/%3e%3cpath%20d='m101.6%2067.733c0%2018.704-15.163%2033.867-33.867%2033.867-18.704%200-33.867-15.163-33.867-33.867s15.163-33.867%2033.867-33.867c18.704%200%2033.867%2015.163%2033.867%2033.867'%20fill='%23fff'/%3e%3cpath%20d='m95.25%2067.733c0%2015.197-12.32%2027.517-27.517%2027.517-15.197%200-27.517-12.32-27.517-27.517%200-15.197%2012.32-27.517%2027.517-27.517%2015.197%200%2027.517%2012.32%2027.517%2027.517'%20fill='%231a74e7'/%3e%3c/svg%3e",PYt="data:image/svg+xml,%3csvg%20fill='%23F03C2E'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGit%3c/title%3e%3cpath%20d='M13.09%2023.549a1.54%201.54%200%200%201-2.18%200L.451%2013.089a1.54%201.54%200%200%201%200-2.179l7.191-7.19%202.733%202.733a1.85%201.85%200%200%200%20.964%202.326v6.66a1.849%201.849%200%201%200%201.54%200V8.957l2.508%202.508a1.85%201.85%200%201%200%201.09-1.09l-2.634-2.634a1.85%201.85%200%200%200-2.378-2.377L8.73%202.63%2010.91.451a1.54%201.54%200%200%201%202.179%200l10.459%2010.46a1.54%201.54%200%200%201%200%202.179z'/%3e%3c/svg%3e",DYt="data:image/svg+xml,%3csvg%20fill='%23073551'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3ecurl%3c/title%3e%3cpath%20d='M.803%2014.8169c0-.5342.433-.9665.9665-.9665.5335%200%20.9665.4323.9665.9665%200%20.5335-.433.9657-.9665.9657-.5335%200-.9666-.4322-.9666-.9657m2.736%200c0-.1963-.0532-.376-.1119-.5525-.2344-.7024-.876-1.2169-1.6575-1.2169-.1249%200-.2344.0465-.3524.0708C.6149%2013.2865%200%2013.9646%200%2014.817c0%20.9764.7923%201.7694%201.7695%201.7694.9772%200%201.7694-.793%201.7694-1.7694m-1.7694-7.149c.5335%200%20.9665.433.9665.9665%200%20.5335-.433.9665-.9665.9665-.5343%200-.9666-.433-.9666-.9665%200-.5335.4323-.9665.9666-.9665m0%202.7359c.9772%200%201.7694-.7923%201.7694-1.7694%200-.1956-.0532-.376-.1119-.5525-.2344-.7024-.8767-1.2169-1.6575-1.2169-.1249%200-.2344.0465-.3524.0716C.6149%207.104%200%207.782%200%208.6344c0%20.9771.7923%201.7694%201.7695%201.7694m13.221-5.694c-.5342%200-.9665-.433-.9665-.9664a.966.966%200%2001.9666-.9665c.5335%200%20.9658.4322.9658.9665%200%20.5334-.4323.9664-.9658.9664m-9.6%2016.5133c-.5335%200-.9666-.433-.9666-.9665%200-.5342.433-.9665.9666-.9665a.966.966%200%2001.9665.9665c0%20.5335-.4323.9665-.9665.9665m9.6-19.2491c-.978%200-1.7695.7922-1.7695%201.7694%200%20.2085.0525.4025.1187.5882L5.039%2018.5581c-.803.1681-1.4179.8462-1.4179%201.6985%200%20.9772.7923%201.7694%201.7695%201.7694.9772%200%201.7694-.7922%201.7694-1.7694%200-.1963-.0525-.3759-.111-.5525l8.3427-14.2728c.7778-.1865%201.3683-.8531%201.3683-1.688%200-.977-.793-1.7693-1.7694-1.7693m7.24%202.7359c-.5343%200-.9666-.433-.9666-.9665a.966.966%200%2001.9665-.9665c.5335%200%20.9666.4322.9666.9665%200%20.5334-.433.9665-.9666.9665M12.6313%2021.223c-.5343%200-.9665-.433-.9665-.9665a.966.966%200%2001.9665-.9665c.5335%200%20.9658.4323.9658.9665%200%20.5335-.4323.9665-.9658.9665M22.2305%201.974c-.9772%200-1.7694.7922-1.7694%201.7694%200%20.2085.0525.4025.1187.5882l-8.3009%2014.2265c-.8021.1681-1.417.8462-1.417%201.6985%200%20.9772.7922%201.7694%201.7694%201.7694.9764%200%201.7687-.7922%201.7687-1.7694%200-.1963-.0525-.3759-.1111-.5525l8.3427-14.2728C23.4094%205.2448%2024%204.5782%2024%203.7433c0-.977-.7923-1.7693-1.7695-1.7693'/%3e%3c/svg%3e",MYt="data:image/svg+xml,%3csvg%20fill='%23007808'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eFFmpeg%3c/title%3e%3cpath%20d='M21.72%2017.91V6.5l-.53-.49L9.05%2018.52l-1.29-.06L24%201.53l-.33-.95-11.93%201-5.75%206.6v-.23l4.7-5.39-1.38-.77-9.11.77v2.85l1.91.46v.01l.19-.01-.56.66v10.6c.609-.126%201.22-.241%201.83-.36L14.12%205.22l.83-.04L0%2021.44l9.67.82%201.35-.77%206.82-6.74v2.15l-5.72%205.57%2011.26.95.35-.94v-3.16l-3.29-.18c.434-.403.858-.816%201.28-1.23z'/%3e%3c/svg%3e",LYt="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%201080%201080'%3e%3c!--%20Generator:%20Adobe%20Illustrator%2030.3.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.3%20Build%20182)%20--%3e%3cdefs%3e%3cstyle%3e%20.st0%20{%20fill:%20%23ff0;%20}%20.st1%20{%20fill:%20%23333;%20}%20%3c/style%3e%3c/defs%3e%3cpath%20class='st0'%20d='M660.52,419.49l-195.15-52.98c-15.84-4.3-19.16-25.29-5.43-34.28l169.23-110.7-9.91-201.97c-.8-16.39,18.13-26.04,30.92-15.76l157.57,126.74,189.03-71.84c15.34-5.83,30.37,9.2,24.54,24.54l-71.84,189.03,126.74,157.57c10.29,12.79.64,31.73-15.76,30.92l-201.97-9.91-110.7,169.23c-8.98,13.73-29.98,10.41-34.28-5.43l-52.98-195.15h-.01Z'/%3e%3cpath%20class='st1'%20d='M603.34,476.66l32.94,121.68,4.45,16.23-429.11,429.11c-48.45,48.45-126.85,48.45-175.3,0C12.16,1019.51,0,987.89,0,956.15s12.02-63.48,36.31-87.77l429.11-429.11,16.35,4.33,121.56,33.06h0Z'/%3e%3c/svg%3e";function bK(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 .5C5.65.5.5 5.65.5 12c0 5.08 3.29 9.39 7.86 10.91 .58 .11 .79-.25.79-.56v-2.02c-3.2.7-3.88-1.36-3.88-1.36-.52-1.33-1.28-1.69-1.28-1.69-1.05-.72.08-.7.08-.7 1.16.08 1.77 1.19 1.77 1.19 1.03 1.77 2.71 1.26 3.37.96.1-.75.4-1.26.73-1.55-2.56-.29-5.25-1.28-5.25-5.7 0-1.26.45-2.29 1.19-3.1-.12-.29-.52-1.47.11-3.06 0 0 .97-.31 3.16 1.18A10.98 10.98 0 0 1 12 6.11c.98 0 1.96.13 2.87.39 2.19-1.49 3.16-1.18 3.16-1.18.63 1.59.23 2.77.11 3.06.74.81 1.19 1.84 1.19 3.1 0 4.43-2.7 5.4-5.27 5.69.42.36.78 1.06.78 2.14v3.04c0 .31.21.67.8.56A11.51 11.51 0 0 0 23.5 12C23.5 5.65 18.35.5 12 .5Z"})})}al.registerLanguage("bash",EM);const $Yt=48;function FYt(e,t=$Yt){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}function BYt(e){return al.highlight(e,{language:"bash",ignoreIllegals:!0}).value}function UYt({status:e}){return e==="succeeded"?a.jsx(Ef,{"aria-hidden":!0}):e==="failed"?a.jsx(oB,{"aria-hidden":!0}):e==="running"?a.jsx(Fi,{className:"studio-build-progress__spinner","aria-hidden":!0}):a.jsx(Aat,{"aria-hidden":!0})}function Xoe(e,t){if(!e)return"";const n=Date.parse(e);return Number.isNaN(n)?"":new Intl.DateTimeFormat(t,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(n)}function QYt({steps:e,log:t,logError:n="",logTruncated:i=!1,logUpdatedAt:r,loading:s=!1}){const{t:o,i18n:l}=Te("ui"),c=p.useRef(null),u=p.useRef(!0),[d,f]=p.useState(!1),h=p.useMemo(()=>BYt(t),[t]);p.useEffect(()=>{const g=c.current;g&&t&&u.current&&(g.scrollTop=g.scrollHeight)},[t]);const m=async()=>{try{await navigator.clipboard.writeText(t),f(!0),window.setTimeout(()=>f(!1),1500)}catch{f(!1)}};return a.jsxs("div",{className:"studio-build-progress",children:[a.jsx("ol",{className:"studio-build-progress__steps","aria-label":o("studioBuildProgress.steps"),children:e.map(g=>a.jsxs("li",{className:`is-${g.status}`,children:[a.jsx("span",{className:"studio-build-progress__step-icon",children:a.jsx(UYt,{status:g.status})}),a.jsx("span",{children:g.label})]},g.key))}),a.jsxs("section",{className:"studio-build-progress__log","aria-label":o("studioBuildProgress.log"),children:[a.jsxs("header",{children:[a.jsxs("div",{children:[a.jsx("strong",{children:o("studioBuildProgress.log")}),a.jsxs("span",{children:[o(s?"studioBuildProgress.syncing":n?"studioBuildProgress.loadFailed":"studioBuildProgress.synced"),i?o("studioBuildProgress.recentOnly"):"",Xoe(r,l.resolvedLanguage??l.language)?` · ${Xoe(r,l.resolvedLanguage??l.language)}`:""]})]}),a.jsxs(_t,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:!t,onClick:()=>void m(),"aria-label":o(d?"studioBuildProgress.copiedLog":"studioBuildProgress.copyLog"),children:[d?a.jsx(Ef,{"aria-hidden":!0}):a.jsx(eM,{"aria-hidden":!0}),o(d?"studioBuildProgress.copied":"studioBuildProgress.copy")]})]}),t?a.jsx("pre",{ref:c,tabIndex:0,"aria-label":o("studioBuildProgress.logContent"),onScroll:g=>{u.current=FYt(g.currentTarget)},children:a.jsx("code",{className:"hljs language-bash",dangerouslySetInnerHTML:{__html:h}})}):a.jsx("div",{className:`studio-build-progress__log-empty${n?" is-error":""}`,children:n||o(s?"studioBuildProgress.waiting":"studioBuildProgress.empty")})]})]})}function Yoe({name:e,description:t,icon:n,selected:i,disabled:r=!1,onChange:s,className:o=""}){return a.jsxs("button",{type:"button",className:`studio-package-option${i?" is-selected":""}${o?` ${o}`:""}`,"aria-pressed":i,disabled:r,onClick:()=>s(!i),children:[a.jsx("span",{className:"studio-package-option__icon","aria-hidden":"true",children:n}),a.jsxs("span",{className:"studio-package-option__content",children:[a.jsx("strong",{children:e}),t?a.jsx("span",{children:t}):null]}),a.jsx("span",{className:"studio-package-option__action","aria-hidden":"true",children:i?a.jsx(oat,{}):a.jsx(uat,{})})]})}function ny(e,t){return e[t]|e[t+1]<<8}function qv(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}async function zYt(e){const t=new DecompressionStream("deflate-raw"),n=new Blob([new Uint8Array(e)]).stream().pipeThrough(t);return new Uint8Array(await new Response(n).arrayBuffer())}async function m9e(e,t={}){let i=-1;for(let u=e.length-22;u>=0&&u>e.length-65557;u--)if(qv(e,u)===101010256){i=u;break}if(i<0)throw new Error(Xt("helpers.zip.invalid"));const r=ny(e,i+10);if(t.maxEntries!==void 0&&r>t.maxEntries)throw new Error(Xt("helpers.zip.tooManyFiles",{count:t.maxEntries}));let s=qv(e,i+16);const o=new TextDecoder("utf-8"),l=[];let c=0;for(let u=0;ut.maxUncompressedBytes)throw new Error(Xt("helpers.zip.tooLarge"));const w=ny(e,v+26),x=ny(e,v+28),O=v+30+w+x,k=e.subarray(O,O+f);let S;if(d===0)S=k;else if(d===8)S=await zYt(k);else{s+=46+m+g+b;continue}l.push({name:y,text:o.decode(S)}),s+=46+m+g+b}return l}const G7=/(^|\/)skill\.md$/i;function VYt(e){const t=(e??"").replace(/\r\n?/g,` `).split(` -`);if(!t.length||t[0].trim()!=="---")return{name:"",description:""};let n=-1;for(let r=1;r=2&&(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))}function qYt(...e){var t;for(const n of e){const i=(t=n.trim().replace(/\\/g,"/").split("/").filter(Boolean).pop())==null?void 0:t.replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"");if(i)return i.slice(0,64)}return"local-skill"}function WYt(e,t){return t.trim()||e}function g9e(e){const t=e.map(i=>({path:i.path.replace(/\\/g,"/").replace(/^\.\//,""),text:i.text})).filter(i=>i.path.length>0&&!i.path.endsWith("/")),n=new Set(t.map(i=>i.path.split("/")[0]));if(n.size===1&&t.every(i=>i.path.includes("/"))){const i=[...n][0]+"/";return t.map(r=>({path:r.path.slice(i.length),text:r.text}))}return t}function KYt(e){const t=new Map,n=new Set;for(const i of e)if(G7.test("/"+i.path)){const r=i.path.split("/");n.add(r.slice(0,-1).join("/"))}for(const i of e){const r=i.path.split("/");let s="";for(let u=r.length-1;u>=0;u--){const d=r.slice(0,u).join("/");if(n.has(d)){s=d;break}}const o=G7.test("/"+i.path);if(!s&&!o&&!n.has("")||!n.has(s)&&!o)continue;const l=s?i.path.slice(s.length+1):i.path,c=t.get(s)||[];c.push({path:l,text:i.text}),t.set(s,c)}return t}function GYt(e,t,n){const i=`${n}${e?"/"+e:""}`,r=t.find(c=>G7.test("/"+c.path));if(!r)return{hit:null,error:Xt("helpers.skills.missingManifest",{location:i})};const s=VYt(r.text),o=qYt(s.name,e,n.replace(/\.[^.]+$/,"")),l=[];for(const c of t){if(c.path.split("/").some(f=>f===".."))return{hit:null,error:Xt("helpers.skills.invalidParentPath",{location:i,path:c.path})};const d=`skills/${o}/${c.path}`;if(!d.startsWith(`skills/${o}/`))return{hit:null,error:Xt("helpers.skills.invalidPath",{location:i,path:c.path})};l.push({path:d,content:c.text})}return{hit:{source:"local",id:`local:${o}:${t.length}`,name:WYt(o,s.name),description:s.description||Xt("helpers.skills.localDescription"),folder:o,localFiles:l},error:null}}async function XYt(e){const t=new Uint8Array(await e.arrayBuffer()),i=(await m9e(t)).map(r=>({path:r.name,text:r.text}));return b9e(g9e(i),e.name)}async function YYt(e,t=new Map){const n=[];for(let i=0;ie.file(t,n))}async function JYt(e){const t=e.createReader(),n=[];for(;;){const i=await new Promise((r,s)=>t.readEntries(r,s));if(i.length===0)return n;n.push(...i)}}async function y9e(e,t=""){const n=t?`${t}/${e.name}`:e.name;if(e.isFile)return[{file:await ZYt(e),path:n}];if(!e.isDirectory)return[];const i=await JYt(e);return(await Promise.all(i.map(r=>y9e(r,n)))).flat()}function eZt({selected:e,onChange:t}){const{t:n}=Te("create"),[i,r]=p.useState([]),[s,o]=p.useState([]),[l,c]=p.useState(!1),[u,d]=p.useState(!1),f=p.useRef(0),h=O=>e.some(k=>k.source==="local"&&k.folder===O),m=O=>{O.localFiles&&(h(O.folder||O.name)?t(e.filter(k=>!(k.source==="local"&&k.folder===(O.folder||O.name)))):t([...e,{source:"local",folder:O.folder||O.name,name:O.name,description:O.description,localFiles:O.localFiles}]))},g=p.useRef([]),b=p.useRef(e);p.useEffect(()=>{g.current=s},[s]),p.useEffect(()=>{b.current=e},[e]);const v=O=>{const k=new Set([...g.current.map(j=>j.folder||j.name),...b.current.filter(j=>j.source==="local").map(j=>j.folder)]),S=[],C=[];for(const j of O.hits){const T=j.folder||j.name;if(k.has(T)){S.push(j.name);continue}k.add(T),C.push(j)}o(j=>[...j,...C]);const E=[...O.errors];if(S.length>0&&E.push(n("skills.local.duplicatesSkipped",{names:S.join(", ")})),r(E),C.length===1&&O.errors.length===0&&S.length===0){const j=C[0];j.localFiles&&t([...b.current,{source:"local",folder:j.folder||j.name,name:j.name,description:j.description,localFiles:j.localFiles}])}},y=O=>{O.preventDefault(),f.current+=1,d(!0)},w=O=>{O.preventDefault(),f.current=Math.max(0,f.current-1),f.current===0&&d(!1)},x=async O=>{if(O.preventDefault(),f.current=0,d(!1),l)return;const k=Array.from(O.dataTransfer.items).map(S=>{var C;return(C=S.webkitGetAsEntry)==null?void 0:C.call(S)}).filter(S=>S!==null);if(k.length===0){r([n("skills.local.invalidDrop")]);return}c(!0);try{const S=(await Promise.all(k.map(j=>y9e(j)))).flat(),C=k.some(j=>j.isDirectory);if(!C&&S.length===1&&S[0].file.name.toLowerCase().endsWith(".zip")){v(await XYt(S[0].file));return}if(!C){r([n("skills.local.invalidDrop")]);return}const E=new Map(S.map(({file:j,path:T})=>[j,T]));v(await YYt(S.map(({file:j})=>j),E))}catch(S){r([n("skills.local.readError",{detail:S instanceof Error?S.message:String(S)})])}finally{c(!1)}};return a.jsxs("div",{className:"cw-local",children:[a.jsxs("div",{className:`cw-local-dropzone ${u?"is-dragging":""}`,role:"group","aria-label":n("skills.local.dropLabel"),onDragEnter:y,onDragOver:O=>O.preventDefault(),onDragLeave:w,onDrop:O=>void x(O),children:[a.jsx(gV,{className:"cw-local-drop-icon","aria-hidden":!0}),a.jsx("p",{className:"cw-local-drop-hint",children:n("skills.local.dropLabel")})]}),a.jsx("p",{className:"cw-local-hint",children:n("skills.local.hint")}),l&&a.jsx("p",{className:"cw-empty-line",children:n("skills.local.reading")}),i.length>0&&a.jsxs("div",{className:"cw-banner",children:[a.jsx(gm,{className:"cw-i"}),a.jsx("span",{children:i.join(";")})]}),s.length>0&&a.jsx("div",{className:"cw-skill-results",children:s.map(O=>{var S;const k=h(O.folder||O.name);return a.jsxs("button",{type:"button",className:`cw-skill-result ${k?"is-on":""}`,onClick:()=>m(O),"aria-pressed":k,children:[a.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:k?a.jsx(Cf,{className:"cw-i cw-i-sm"}):a.jsx(sc,{className:"cw-i cw-i-sm"})}),a.jsxs("span",{className:"cw-skill-result-meta",children:[a.jsx("span",{className:"cw-skill-result-name",children:O.name}),O.description&&a.jsx("span",{className:"cw-skill-result-desc",children:pC(O.description)}),a.jsx("span",{className:"cw-skill-result-repo",children:n("skills.local.fileCount",{count:((S=O.localFiles)==null?void 0:S.length)??0})})]})]},O.id)})})]})}const tZt="/harness/skills/findskill";async function nZt(e,t="public"){const n=e.trim(),i=new URLSearchParams({query:n,page_number:"1",page_size:"20"}),r=`${tZt}?${i.toString()}`,s=await fetch(r,{headers:{accept:"application/json"},signal:po(void 0,ho)});if(!s.ok)throw new Error(Xt("helpers.skills.searchFailed",{status:s.status}));return((await s.json()).items??[]).map(l=>({source:"skillhub",id:l.slug??l.name??"",slug:l.slug??"",name:l.name??l.slug??"",description:l.description??"",namespace:t,sourceRepo:l.sourceRepo,downloadCount:l.downloadCount,version:l.version}))}function iZt({selected:e,onChange:t}){const{t:n}=Te("create"),[i,r]=p.useState(""),[s,o]=p.useState([]),[l,c]=p.useState(!1),[u,d]=p.useState(null),[f,h]=p.useState(!1),m=v=>e.some(y=>y.source==="skillhub"&&y.slug===v),g=v=>{v.slug&&(m(v.slug)?t(e.filter(y=>!(y.source==="skillhub"&&y.slug===v.slug))):t([...e,{source:"skillhub",slug:v.slug,name:v.name,folder:v.slug.split("/").pop()||v.name,namespace:v.namespace||"public",description:v.description}]))},b=async v=>{c(!0),d(null),h(!0);try{const y=await nZt(v);o(y)}catch(y){d(y instanceof Error?y.message:n("skills.hub.searchError")),o([])}finally{c(!1)}};return p.useEffect(()=>{const v=i.trim();if(!v){o([]),h(!1),d(null);return}const y=setTimeout(()=>b(v),300);return()=>clearTimeout(y)},[i,n]),a.jsxs("div",{className:"cw-skillhub",children:[a.jsxs("div",{className:"cw-skill-searchrow",children:[a.jsxs("div",{className:"cw-skill-searchbox",children:[a.jsx(dI,{className:"cw-i cw-skill-searchicon","aria-hidden":!0}),a.jsx("input",{className:"cw-input cw-skill-input",value:i,placeholder:n("skills.hub.searchPlaceholder"),onChange:v=>r(v.target.value),onKeyDown:v=>{v.key==="Enter"&&(v.preventDefault(),i.trim()&&b(i))}})]}),a.jsxs("button",{type:"button",className:"cw-btn cw-btn-soft",onClick:()=>i.trim()&&b(i),disabled:!i.trim()||l,children:[l?a.jsx(Bi,{className:"cw-i cw-spin"}):a.jsx(dI,{className:"cw-i"}),n("skills.hub.search")]})]}),u&&a.jsxs("div",{className:"cw-banner",children:[a.jsx(gm,{className:"cw-i"}),a.jsx("span",{children:u})]}),l&&s.length===0?a.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[a.jsx(Bi,{className:"cw-i cw-spin"})," ",n("skills.hub.searching")]}):s.length>0?a.jsx("div",{className:"cw-skill-results",children:s.map(v=>{const y=m(v.slug||"");return a.jsxs("button",{type:"button",className:`cw-skill-result ${y?"is-on":""}`,onClick:()=>g(v),"aria-pressed":y,children:[a.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:y?a.jsx(Cf,{className:"cw-i cw-i-sm"}):a.jsx(sc,{className:"cw-i cw-i-sm"})}),a.jsxs("span",{className:"cw-skill-result-meta",children:[a.jsx("span",{className:"cw-skill-result-name",children:v.name}),v.description&&a.jsx("span",{className:"cw-skill-result-desc",children:pC(v.description)}),v.sourceRepo&&a.jsx("span",{className:"cw-skill-result-repo",children:v.sourceRepo})]})]},v.id||v.slug)})}):f&&!u?a.jsx("p",{className:"cw-empty-line",children:n("skills.hub.noResults")}):!f&&a.jsx("p",{className:"cw-empty-line",children:n("skills.hub.hint")})]})}function v9e({className:e}){return a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M5.5 7.5h10.75a2 2 0 0 1 2 2v7.75a2 2 0 0 1-2 2H5.5a2 2 0 0 1-2-2V9.5a2 2 0 0 1 2-2Z"}),a.jsx("path",{d:"M7 4.75h9.5a2 2 0 0 1 2 2",opacity:".58"}),a.jsx("path",{d:"m11 10.25.72 1.48 1.63.24-1.18 1.15.28 1.62-1.45-.77-1.45.77.28-1.62-1.18-1.15 1.63-.24.72-1.48Z"}),a.jsx("path",{d:"M19.25 11.25h1.5M20 10.5V12",opacity:".72"})]})}function h6(e){return e.source==="runtime"?`runtime:${e.folder}`:e.source==="skillhub"?`hub:${e.namespace}/${e.slug}`:e.source==="local"?`local:${e.folder}`:`ss:${e.skillSpaceId}/${e.skillId}/${e.version||""}`}function rZt(e){return e.source==="runtime"?"skillSourcePicker.sources.runtime":e.source==="local"?"skillSourcePicker.sources.local":e.source==="skillspace"?"skillSourcePicker.sources.skillspace":"skillSourcePicker.sources.skillhub"}function sZt({skill:e,onRemove:t,disabled:n}){const{t:i}=Te("ui");let r=lC;e.source==="local"||e.source==="runtime"?r=gV:e.source==="skillspace"&&(r=v9e);const s=`${i(rZt(e))}${e.description?` · ${pC(e.description)}`:""}`;return a.jsxs(Ar.div,{className:"cw-selected-skill-row",layout:!0,initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.16},children:[a.jsx("span",{className:"cw-selected-skill-icon","aria-hidden":"true",children:a.jsx(r,{className:"cw-i cw-i-sm"})}),a.jsxs("span",{className:"cw-selected-skill-meta",children:[a.jsx("span",{className:"cw-selected-skill-name",children:e.name}),a.jsx("span",{className:"cw-selected-skill-detail",tabIndex:0,title:s,children:s})]}),a.jsx("button",{type:"button",className:"cw-selected-skill-remove",onClick:t,disabled:n,"aria-label":i("skillSourcePicker.remove",{name:e.name}),title:i("skillSourcePicker.remove",{name:e.name}),children:a.jsx(Mo,{className:"cw-i cw-i-sm"})})]})}const p6=[{id:"local",labelKey:"skillSourcePicker.tabs.local",shortLabelKey:"skillSourcePicker.tabs.localShort",icon:gV},{id:"skillspace",labelKey:"skillSourcePicker.tabs.skillspace",shortLabelKey:"skillSourcePicker.tabs.skillspaceShort",icon:v9e},{id:"skillhub",labelKey:"skillSourcePicker.tabs.skillhub",shortLabelKey:"skillSourcePicker.tabs.skillhubShort",icon:tM}];function yK({selected:e,onChange:t,cloudProvider:n,disabled:i=!1,addLabel:r,showSelectedCount:s=!0}){const{t:o}=Te("ui"),[l,c]=p.useState("local"),[u,d]=p.useState(!1),f=p.useId(),h=p.useId(),m=p.useRef(null),g=p6.findIndex(w=>w.id===l),b=r??o("skillSourcePicker.addSkill");p.useEffect(()=>{var k;if(!u)return;const w=document.body.style.overflow,x=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(k=m.current)==null||k.focus();const O=S=>{S.key==="Escape"&&d(!1)};return window.addEventListener("keydown",O),()=>{document.body.style.overflow=w,window.removeEventListener("keydown",O),x!=null&&x.isConnected&&x.focus()}},[u]);const v=(w,x)=>{x.source==="runtime"&&!window.confirm(o("skillSourcePicker.confirmRemoveRuntime",{name:x.name}))||t(e.filter(O=>h6(O)!==w))},y=w=>{const x=new Set(w.filter(O=>O.source!=="runtime").map(O=>O.folder));t(w.filter(O=>O.source!=="runtime"||!x.has(O.folder)))};return a.jsxs("div",{className:"cw-skillspane",children:[a.jsxs("button",{type:"button",className:"cw-skill-add","aria-haspopup":"dialog",disabled:i,onClick:()=>d(!0),children:[a.jsx("span",{className:"cw-skill-add-icon","aria-hidden":"true",children:a.jsx(sc,{className:"cw-i"})}),a.jsx("span",{children:b})]}),e.length>0&&a.jsxs("div",{className:"cw-skill-selected",children:[s?a.jsx("span",{className:"cw-skill-selected-label",children:o("skillSourcePicker.selectedCount",{count:e.length})}):null,a.jsx("div",{className:"cw-selected-skill-list",children:a.jsx(hf,{initial:!1,children:e.map(w=>a.jsx(sZt,{skill:w,disabled:i,onRemove:()=>v(h6(w),w)},h6(w)))})})]}),vi.createPortal(a.jsx(hf,{children:u&&a.jsx(Ar.div,{className:"cw-skill-dialog-backdrop",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16},onMouseDown:w=>{w.target===w.currentTarget&&d(!1)},children:a.jsxs(Ar.section,{className:"cw-skill-dialog",role:"dialog","aria-modal":"true","aria-labelledby":f,initial:{opacity:0,y:10,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:6,scale:.99},transition:{duration:.18,ease:"easeOut"},children:[a.jsxs("header",{className:"cw-skill-dialog-head",children:[a.jsx("h3",{id:f,children:b}),a.jsx("button",{ref:m,type:"button",className:"cw-skill-dialog-close","aria-label":o("skillSourcePicker.close",{label:b}),onClick:()=>d(!1),children:a.jsx(Mo,{className:"cw-i"})})]}),a.jsxs("div",{className:"cw-skill-dialog-body",children:[a.jsxs("div",{className:"cw-skill-sourcetabs",role:"tablist",style:{"--cw-skill-tab-slider-width":`calc((100% - 16px) / ${p6.length})`,"--cw-active-skill-tab-offset":`calc(${g*100}% + ${g*4}px)`},children:[a.jsx("span",{className:"cw-skill-tab-slider","aria-hidden":"true"}),p6.map(({id:w,labelKey:x,shortLabelKey:O,icon:k})=>a.jsxs("button",{type:"button",role:"tab",id:`${h}-${w}`,"aria-controls":h,"aria-selected":l===w,className:`cw-skill-pickertab ${l===w?"is-on":""}`,onClick:()=>c(w),children:[a.jsx(k,{className:"cw-i cw-i-sm"}),a.jsx("span",{className:"cw-skill-tab-label-full",children:o(x)}),a.jsx("span",{className:"cw-skill-tab-label-short",children:o(O)})]},w))]}),a.jsxs("div",{id:h,className:"cw-skill-tabbody",role:"tabpanel","aria-labelledby":`${h}-${l}`,children:[l==="skillhub"&&a.jsx(iZt,{selected:e,onChange:y}),l==="local"&&a.jsx(eZt,{selected:e,onChange:y}),l==="skillspace"&&a.jsx(AIe,{selected:e,onChange:y,cloudProvider:n})]})]})]})})}),document.body)]})}const x9e=128*1024,aZt={baseImageRequired:"请填写基础镜像。",duplicateFrom:"基础镜像已固定在第一行,请删除 Dockerfile 正文中的 FROM 指令。",tooLarge:"Dockerfile 不能超过 128 KiB。",empty:"Dockerfile 内容不能为空。",missingFrom:"Dockerfile 缺少 FROM 指令。"};function Cw(e,t){return(t==null?void 0:t(`environmentCenter.dockerfileValidation.${e}`))??aZt[e]}function PL(e){return e.replace(/^\uFEFF/,"").replace(/\r\n?/g,` -`)}function w9e(e){return new TextEncoder().encode(e).byteLength}function oZt(e,t="ubuntu:22.04"){const n=PL(e).match(/^\s*FROM(?:\s+--platform=\S+)?\s+(\S+)/im);return(n==null?void 0:n[1])??t}function lZt(e){const t=PL(e).split(` +`);if(!t.length||t[0].trim()!=="---")return{name:"",description:""};let n=-1;for(let r=1;r=2&&(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))}function qYt(...e){var t;for(const n of e){const i=(t=n.trim().replace(/\\/g,"/").split("/").filter(Boolean).pop())==null?void 0:t.replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"");if(i)return i.slice(0,64)}return"local-skill"}function WYt(e,t){return t.trim()||e}function g9e(e){const t=e.map(i=>({path:i.path.replace(/\\/g,"/").replace(/^\.\//,""),text:i.text})).filter(i=>i.path.length>0&&!i.path.endsWith("/")),n=new Set(t.map(i=>i.path.split("/")[0]));if(n.size===1&&t.every(i=>i.path.includes("/"))){const i=[...n][0]+"/";return t.map(r=>({path:r.path.slice(i.length),text:r.text}))}return t}function KYt(e){const t=new Map,n=new Set;for(const i of e)if(G7.test("/"+i.path)){const r=i.path.split("/");n.add(r.slice(0,-1).join("/"))}for(const i of e){const r=i.path.split("/");let s="";for(let u=r.length-1;u>=0;u--){const d=r.slice(0,u).join("/");if(n.has(d)){s=d;break}}const o=G7.test("/"+i.path);if(!s&&!o&&!n.has("")||!n.has(s)&&!o)continue;const l=s?i.path.slice(s.length+1):i.path,c=t.get(s)||[];c.push({path:l,text:i.text}),t.set(s,c)}return t}function GYt(e,t,n){const i=`${n}${e?"/"+e:""}`,r=t.find(c=>G7.test("/"+c.path));if(!r)return{hit:null,error:Xt("helpers.skills.missingManifest",{location:i})};const s=VYt(r.text),o=qYt(s.name,e,n.replace(/\.[^.]+$/,"")),l=[];for(const c of t){if(c.path.split("/").some(f=>f===".."))return{hit:null,error:Xt("helpers.skills.invalidParentPath",{location:i,path:c.path})};const d=`skills/${o}/${c.path}`;if(!d.startsWith(`skills/${o}/`))return{hit:null,error:Xt("helpers.skills.invalidPath",{location:i,path:c.path})};l.push({path:d,content:c.text})}return{hit:{source:"local",id:`local:${o}:${t.length}`,name:WYt(o,s.name),description:s.description||Xt("helpers.skills.localDescription"),folder:o,localFiles:l},error:null}}async function XYt(e){const t=new Uint8Array(await e.arrayBuffer()),i=(await m9e(t)).map(r=>({path:r.name,text:r.text}));return b9e(g9e(i),e.name)}async function YYt(e,t=new Map){const n=[];for(let i=0;ie.file(t,n))}async function JYt(e){const t=e.createReader(),n=[];for(;;){const i=await new Promise((r,s)=>t.readEntries(r,s));if(i.length===0)return n;n.push(...i)}}async function y9e(e,t=""){const n=t?`${t}/${e.name}`:e.name;if(e.isFile)return[{file:await ZYt(e),path:n}];if(!e.isDirectory)return[];const i=await JYt(e);return(await Promise.all(i.map(r=>y9e(r,n)))).flat()}function eZt({selected:e,onChange:t}){const{t:n}=Te("create"),[i,r]=p.useState([]),[s,o]=p.useState([]),[l,c]=p.useState(!1),[u,d]=p.useState(!1),f=p.useRef(0),h=O=>e.some(k=>k.source==="local"&&k.folder===O),m=O=>{O.localFiles&&(h(O.folder||O.name)?t(e.filter(k=>!(k.source==="local"&&k.folder===(O.folder||O.name)))):t([...e,{source:"local",folder:O.folder||O.name,name:O.name,description:O.description,localFiles:O.localFiles}]))},g=p.useRef([]),b=p.useRef(e);p.useEffect(()=>{g.current=s},[s]),p.useEffect(()=>{b.current=e},[e]);const v=O=>{const k=new Set([...g.current.map(j=>j.folder||j.name),...b.current.filter(j=>j.source==="local").map(j=>j.folder)]),S=[],C=[];for(const j of O.hits){const T=j.folder||j.name;if(k.has(T)){S.push(j.name);continue}k.add(T),C.push(j)}o(j=>[...j,...C]);const E=[...O.errors];if(S.length>0&&E.push(n("skills.local.duplicatesSkipped",{names:S.join(", ")})),r(E),C.length===1&&O.errors.length===0&&S.length===0){const j=C[0];j.localFiles&&t([...b.current,{source:"local",folder:j.folder||j.name,name:j.name,description:j.description,localFiles:j.localFiles}])}},y=O=>{O.preventDefault(),f.current+=1,d(!0)},w=O=>{O.preventDefault(),f.current=Math.max(0,f.current-1),f.current===0&&d(!1)},x=async O=>{if(O.preventDefault(),f.current=0,d(!1),l)return;const k=Array.from(O.dataTransfer.items).map(S=>{var C;return(C=S.webkitGetAsEntry)==null?void 0:C.call(S)}).filter(S=>S!==null);if(k.length===0){r([n("skills.local.invalidDrop")]);return}c(!0);try{const S=(await Promise.all(k.map(j=>y9e(j)))).flat(),C=k.some(j=>j.isDirectory);if(!C&&S.length===1&&S[0].file.name.toLowerCase().endsWith(".zip")){v(await XYt(S[0].file));return}if(!C){r([n("skills.local.invalidDrop")]);return}const E=new Map(S.map(({file:j,path:T})=>[j,T]));v(await YYt(S.map(({file:j})=>j),E))}catch(S){r([n("skills.local.readError",{detail:S instanceof Error?S.message:String(S)})])}finally{c(!1)}};return a.jsxs("div",{className:"cw-local",children:[a.jsxs("div",{className:`cw-local-dropzone ${u?"is-dragging":""}`,role:"group","aria-label":n("skills.local.dropLabel"),onDragEnter:y,onDragOver:O=>O.preventDefault(),onDragLeave:w,onDrop:O=>void x(O),children:[a.jsx(gV,{className:"cw-local-drop-icon","aria-hidden":!0}),a.jsx("p",{className:"cw-local-drop-hint",children:n("skills.local.dropLabel")})]}),a.jsx("p",{className:"cw-local-hint",children:n("skills.local.hint")}),l&&a.jsx("p",{className:"cw-empty-line",children:n("skills.local.reading")}),i.length>0&&a.jsxs("div",{className:"cw-banner",children:[a.jsx(pm,{className:"cw-i"}),a.jsx("span",{children:i.join(";")})]}),s.length>0&&a.jsx("div",{className:"cw-skill-results",children:s.map(O=>{var S;const k=h(O.folder||O.name);return a.jsxs("button",{type:"button",className:`cw-skill-result ${k?"is-on":""}`,onClick:()=>m(O),"aria-pressed":k,children:[a.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:k?a.jsx(Ef,{className:"cw-i cw-i-sm"}):a.jsx(ic,{className:"cw-i cw-i-sm"})}),a.jsxs("span",{className:"cw-skill-result-meta",children:[a.jsx("span",{className:"cw-skill-result-name",children:O.name}),O.description&&a.jsx("span",{className:"cw-skill-result-desc",children:vC(O.description)}),a.jsx("span",{className:"cw-skill-result-repo",children:n("skills.local.fileCount",{count:((S=O.localFiles)==null?void 0:S.length)??0})})]})]},O.id)})})]})}const tZt="/harness/skills/findskill";async function nZt(e,t="public"){const n=e.trim(),i=new URLSearchParams({query:n,page_number:"1",page_size:"20"}),r=`${tZt}?${i.toString()}`,s=await fetch(r,{headers:{accept:"application/json"},signal:po(void 0,ho)});if(!s.ok)throw new Error(Xt("helpers.skills.searchFailed",{status:s.status}));return((await s.json()).items??[]).map(l=>({source:"skillhub",id:l.slug??l.name??"",slug:l.slug??"",name:l.name??l.slug??"",description:l.description??"",namespace:t,sourceRepo:l.sourceRepo,downloadCount:l.downloadCount,version:l.version}))}function iZt({selected:e,onChange:t}){const{t:n}=Te("create"),[i,r]=p.useState(""),[s,o]=p.useState([]),[l,c]=p.useState(!1),[u,d]=p.useState(null),[f,h]=p.useState(!1),m=v=>e.some(y=>y.source==="skillhub"&&y.slug===v),g=v=>{v.slug&&(m(v.slug)?t(e.filter(y=>!(y.source==="skillhub"&&y.slug===v.slug))):t([...e,{source:"skillhub",slug:v.slug,name:v.name,folder:v.slug.split("/").pop()||v.name,namespace:v.namespace||"public",description:v.description}]))},b=async v=>{c(!0),d(null),h(!0);try{const y=await nZt(v);o(y)}catch(y){d(y instanceof Error?y.message:n("skills.hub.searchError")),o([])}finally{c(!1)}};return p.useEffect(()=>{const v=i.trim();if(!v){o([]),h(!1),d(null);return}const y=setTimeout(()=>b(v),300);return()=>clearTimeout(y)},[i,n]),a.jsxs("div",{className:"cw-skillhub",children:[a.jsxs("div",{className:"cw-skill-searchrow",children:[a.jsxs("div",{className:"cw-skill-searchbox",children:[a.jsx(fI,{className:"cw-i cw-skill-searchicon","aria-hidden":!0}),a.jsx("input",{className:"cw-input cw-skill-input",value:i,placeholder:n("skills.hub.searchPlaceholder"),onChange:v=>r(v.target.value),onKeyDown:v=>{v.key==="Enter"&&(v.preventDefault(),i.trim()&&b(i))}})]}),a.jsxs("button",{type:"button",className:"cw-btn cw-btn-soft",onClick:()=>i.trim()&&b(i),disabled:!i.trim()||l,children:[l?a.jsx(Fi,{className:"cw-i cw-spin"}):a.jsx(fI,{className:"cw-i"}),n("skills.hub.search")]})]}),u&&a.jsxs("div",{className:"cw-banner",children:[a.jsx(pm,{className:"cw-i"}),a.jsx("span",{children:u})]}),l&&s.length===0?a.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[a.jsx(Fi,{className:"cw-i cw-spin"})," ",n("skills.hub.searching")]}):s.length>0?a.jsx("div",{className:"cw-skill-results",children:s.map(v=>{const y=m(v.slug||"");return a.jsxs("button",{type:"button",className:`cw-skill-result ${y?"is-on":""}`,onClick:()=>g(v),"aria-pressed":y,children:[a.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:y?a.jsx(Ef,{className:"cw-i cw-i-sm"}):a.jsx(ic,{className:"cw-i cw-i-sm"})}),a.jsxs("span",{className:"cw-skill-result-meta",children:[a.jsx("span",{className:"cw-skill-result-name",children:v.name}),v.description&&a.jsx("span",{className:"cw-skill-result-desc",children:vC(v.description)}),v.sourceRepo&&a.jsx("span",{className:"cw-skill-result-repo",children:v.sourceRepo})]})]},v.id||v.slug)})}):f&&!u?a.jsx("p",{className:"cw-empty-line",children:n("skills.hub.noResults")}):!f&&a.jsx("p",{className:"cw-empty-line",children:n("skills.hub.hint")})]})}function v9e({className:e}){return a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M5.5 7.5h10.75a2 2 0 0 1 2 2v7.75a2 2 0 0 1-2 2H5.5a2 2 0 0 1-2-2V9.5a2 2 0 0 1 2-2Z"}),a.jsx("path",{d:"M7 4.75h9.5a2 2 0 0 1 2 2",opacity:".58"}),a.jsx("path",{d:"m11 10.25.72 1.48 1.63.24-1.18 1.15.28 1.62-1.45-.77-1.45.77.28-1.62-1.18-1.15 1.63-.24.72-1.48Z"}),a.jsx("path",{d:"M19.25 11.25h1.5M20 10.5V12",opacity:".72"})]})}function h6(e){return e.source==="runtime"?`runtime:${e.folder}`:e.source==="skillhub"?`hub:${e.namespace}/${e.slug}`:e.source==="local"?`local:${e.folder}`:`ss:${e.skillSpaceId}/${e.skillId}/${e.version||""}`}function rZt(e){return e.source==="runtime"?"skillSourcePicker.sources.runtime":e.source==="local"?"skillSourcePicker.sources.local":e.source==="skillspace"?"skillSourcePicker.sources.skillspace":"skillSourcePicker.sources.skillhub"}function sZt({skill:e,onRemove:t,disabled:n}){const{t:i}=Te("ui");let r=hC;e.source==="local"||e.source==="runtime"?r=gV:e.source==="skillspace"&&(r=v9e);const s=`${i(rZt(e))}${e.description?` · ${vC(e.description)}`:""}`;return a.jsxs(Cr.div,{className:"cw-selected-skill-row",layout:!0,initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.16},children:[a.jsx("span",{className:"cw-selected-skill-icon","aria-hidden":"true",children:a.jsx(r,{className:"cw-i cw-i-sm"})}),a.jsxs("span",{className:"cw-selected-skill-meta",children:[a.jsx("span",{className:"cw-selected-skill-name",children:e.name}),a.jsx("span",{className:"cw-selected-skill-detail",tabIndex:0,title:s,children:s})]}),a.jsx("button",{type:"button",className:"cw-selected-skill-remove",onClick:t,disabled:n,"aria-label":i("skillSourcePicker.remove",{name:e.name}),title:i("skillSourcePicker.remove",{name:e.name}),children:a.jsx(Do,{className:"cw-i cw-i-sm"})})]})}const p6=[{id:"local",labelKey:"skillSourcePicker.tabs.local",shortLabelKey:"skillSourcePicker.tabs.localShort",icon:gV},{id:"skillspace",labelKey:"skillSourcePicker.tabs.skillspace",shortLabelKey:"skillSourcePicker.tabs.skillspaceShort",icon:v9e},{id:"skillhub",labelKey:"skillSourcePicker.tabs.skillhub",shortLabelKey:"skillSourcePicker.tabs.skillhubShort",icon:nM}];function yK({selected:e,onChange:t,cloudProvider:n,disabled:i=!1,addLabel:r,showSelectedCount:s=!0}){const{t:o}=Te("ui"),[l,c]=p.useState("local"),[u,d]=p.useState(!1),f=p.useId(),h=p.useId(),m=p.useRef(null),g=p6.findIndex(w=>w.id===l),b=r??o("skillSourcePicker.addSkill");p.useEffect(()=>{var k;if(!u)return;const w=document.body.style.overflow,x=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(k=m.current)==null||k.focus();const O=S=>{S.key==="Escape"&&d(!1)};return window.addEventListener("keydown",O),()=>{document.body.style.overflow=w,window.removeEventListener("keydown",O),x!=null&&x.isConnected&&x.focus()}},[u]);const v=(w,x)=>{x.source==="runtime"&&!window.confirm(o("skillSourcePicker.confirmRemoveRuntime",{name:x.name}))||t(e.filter(O=>h6(O)!==w))},y=w=>{const x=new Set(w.filter(O=>O.source!=="runtime").map(O=>O.folder));t(w.filter(O=>O.source!=="runtime"||!x.has(O.folder)))};return a.jsxs("div",{className:"cw-skillspane",children:[a.jsxs("button",{type:"button",className:"cw-skill-add","aria-haspopup":"dialog",disabled:i,onClick:()=>d(!0),children:[a.jsx("span",{className:"cw-skill-add-icon","aria-hidden":"true",children:a.jsx(ic,{className:"cw-i"})}),a.jsx("span",{children:b})]}),e.length>0&&a.jsxs("div",{className:"cw-skill-selected",children:[s?a.jsx("span",{className:"cw-skill-selected-label",children:o("skillSourcePicker.selectedCount",{count:e.length})}):null,a.jsx("div",{className:"cw-selected-skill-list",children:a.jsx(ff,{initial:!1,children:e.map(w=>a.jsx(sZt,{skill:w,disabled:i,onRemove:()=>v(h6(w),w)},h6(w)))})})]}),yi.createPortal(a.jsx(ff,{children:u&&a.jsx(Cr.div,{className:"cw-skill-dialog-backdrop",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16},onMouseDown:w=>{w.target===w.currentTarget&&d(!1)},children:a.jsxs(Cr.section,{className:"cw-skill-dialog",role:"dialog","aria-modal":"true","aria-labelledby":f,initial:{opacity:0,y:10,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:6,scale:.99},transition:{duration:.18,ease:"easeOut"},children:[a.jsxs("header",{className:"cw-skill-dialog-head",children:[a.jsx("h3",{id:f,children:b}),a.jsx("button",{ref:m,type:"button",className:"cw-skill-dialog-close","aria-label":o("skillSourcePicker.close",{label:b}),onClick:()=>d(!1),children:a.jsx(Do,{className:"cw-i"})})]}),a.jsxs("div",{className:"cw-skill-dialog-body",children:[a.jsxs("div",{className:"cw-skill-sourcetabs",role:"tablist",style:{"--cw-skill-tab-slider-width":`calc((100% - 16px) / ${p6.length})`,"--cw-active-skill-tab-offset":`calc(${g*100}% + ${g*4}px)`},children:[a.jsx("span",{className:"cw-skill-tab-slider","aria-hidden":"true"}),p6.map(({id:w,labelKey:x,shortLabelKey:O,icon:k})=>a.jsxs("button",{type:"button",role:"tab",id:`${h}-${w}`,"aria-controls":h,"aria-selected":l===w,className:`cw-skill-pickertab ${l===w?"is-on":""}`,onClick:()=>c(w),children:[a.jsx(k,{className:"cw-i cw-i-sm"}),a.jsx("span",{className:"cw-skill-tab-label-full",children:o(x)}),a.jsx("span",{className:"cw-skill-tab-label-short",children:o(O)})]},w))]}),a.jsxs("div",{id:h,className:"cw-skill-tabbody",role:"tabpanel","aria-labelledby":`${h}-${l}`,children:[l==="skillhub"&&a.jsx(iZt,{selected:e,onChange:y}),l==="local"&&a.jsx(eZt,{selected:e,onChange:y}),l==="skillspace"&&a.jsx(AIe,{selected:e,onChange:y,cloudProvider:n})]})]})]})})}),document.body)]})}const x9e=128*1024,aZt={baseImageRequired:"请填写基础镜像。",duplicateFrom:"基础镜像已固定在第一行,请删除 Dockerfile 正文中的 FROM 指令。",tooLarge:"Dockerfile 不能超过 128 KiB。",empty:"Dockerfile 内容不能为空。",missingFrom:"Dockerfile 缺少 FROM 指令。"};function Tw(e,t){return(t==null?void 0:t(`environmentCenter.dockerfileValidation.${e}`))??aZt[e]}function DL(e){return e.replace(/^\uFEFF/,"").replace(/\r\n?/g,` +`)}function w9e(e){return new TextEncoder().encode(e).byteLength}function oZt(e,t="ubuntu:22.04"){const n=DL(e).match(/^\s*FROM(?:\s+--platform=\S+)?\s+(\S+)/im);return(n==null?void 0:n[1])??t}function lZt(e){const t=DL(e).split(` `),n=t.findIndex(i=>/^\s*FROM(?:\s|$)/i.test(i));return(n>=0?t.slice(n+1):t).join(` -`).replace(/^\n+/,"")}function tR(e,t){const n=`FROM ${e.trim()}`,i=PL(t).replace(/^\n+/,"");return i?`${n} -${i}`:n}function cZt(e,t,n){return t.trim()?/^\s*FROM(?:\s|$)/im.test(e)?Cw("duplicateFrom",n):vK(tR(t,e),void 0,n):Cw("baseImageRequired",n)}function vK(e,t=w9e(e),n){return t>x9e?Cw("tooLarge",n):e.trim()?/^\s*FROM\s+\S+/im.test(e)?"":Cw("missingFrom",n):Cw("empty",n)}async function uZt(e,t){if(e.size>x9e)return{content:"",error:Cw("tooLarge",t)};const n=PL(await e.text());return{content:n,error:vK(n,e.size,t)}}function dZt(e){return HM(e,{lineWidth:0})}function fZt(e){return[{value:"auto",label:e("deploymentResources.mode.auto"),description:e("deploymentResources.mode.autoDescription"),badge:e("deploymentResources.mode.recommended")},{value:"create",label:e("deploymentResources.mode.create"),description:e("deploymentResources.mode.createDescription")},{value:"existing",label:e("deploymentResources.mode.existing"),description:e("deploymentResources.mode.existingDescription")}]}const O9e={tos:{mode:"auto"},cr:{mode:"auto"},codePipeline:{mode:"auto"}};function bp(e){const[t,n]=p.useState([]),[i,r]=p.useState(""),[s,o]=p.useState(1),[l,c]=p.useState(0),[u,d]=p.useState(!1),[f,h]=p.useState(!1),[m,g]=p.useState(null),[b,v]=p.useState(""),[y,w]=p.useState(""),[x,O]=p.useState(""),[k,S]=p.useState(0),C=p.useRef(!1),E=p.useRef(null),j=e?JSON.stringify(e):"",T=e?JSON.stringify({...e,search:y}):"";p.useEffect(()=>{const I=window.setTimeout(()=>{w(b.trim())},250);return()=>window.clearTimeout(I)},[b]),p.useEffect(()=>{v(""),w("")},[j]);const R=p.useCallback((I,D)=>{var F;if(!T)return;(F=E.current)==null||F.abort();const _=new AbortController;E.current=_;const L=JSON.parse(T);D&&n([]),C.current=!0,h(!0),g(null),jTe({...L,pageNumber:I,pageSize:100},_.signal).then(M=>{n(z=>{if(D)return M.items;const q=new Set(z.map(U=>`${U.id}\0${U.name}`));return[...z,...M.items.filter(U=>!q.has(`${U.id}\0${U.name}`))]}),r(M.serviceRegion),o(M.pageNumber),c(M.totalCount),d(M.hasMore),O(T)}).catch(M=>{M instanceof DOMException&&M.name==="AbortError"||(O(T),g(M instanceof Error?M.message:String(M)))}).finally(()=>{E.current===_&&(E.current=null,C.current=!1,h(!1))})},[T]);p.useEffect(()=>{var I;if(!T){(I=E.current)==null||I.abort(),E.current=null,C.current=!1,n([]),r(""),o(1),c(0),d(!1),O(""),h(!1),g(null);return}return R(1,!0),()=>{var D;return(D=E.current)==null?void 0:D.abort()}},[R,T,k]);const A=!!T&&x===T&&b.trim()===y,N=p.useCallback(()=>{O(""),S(I=>I+1)},[]),P=p.useCallback(()=>{!A||C.current||!u||R(s+1,!1)},[u,R,s,A]);return{items:t,serviceRegion:i,totalCount:l,hasMore:A?u:!1,loading:!!T&&(!A||f),error:m,search:b,setSearch:v,reload:N,loadMore:P}}function hZt(e,t){return e.map(n=>({value:n[t],label:n.name,description:[n.status,n.region,n.id].filter(Boolean).join(" · ")}))}function yp({ariaLabel:e,value:t,valueLabel:n,state:i,disabled:r,disabledMessage:s,valueField:o="id",onChange:l}){const{t:c}=Te("ui"),u=p.useMemo(()=>hZt(i.items,o),[i.items,o]);return a.jsxs("div",{className:"pp-resource-picker",children:[a.jsx(xf,{ariaLabel:e,value:t,valueLabel:n,placeholder:i.loading?c("common.loading"):c("deploymentResources.selectExisting"),options:u,disabled:r||!!i.error,searchValue:i.search,searchPlaceholder:c("deploymentResources.searchResource"),loading:i.loading,hasMore:i.hasMore,emptyMessage:i.search.trim()?c("deploymentResources.noMatch"):c("deploymentResources.noAvailable"),onSearchChange:i.setSearch,onLoadMore:i.loadMore,onChange:d=>{const f=i.items.find(h=>h[o]===d);f&&l(f)}}),s?a.jsx("span",{className:"pp-resource-status",children:s}):i.error?a.jsxs("div",{className:"pp-resource-error",role:"alert",children:[a.jsx("span",{children:i.error}),a.jsx("button",{type:"button",onClick:i.reload,children:c("common.retry")})]}):i.loading&&i.items.length===0?a.jsx("span",{className:"pp-resource-status","aria-live":"polite",children:i.search.trim()?c("deploymentResources.searching"):c("deploymentResources.loading")}):i.items.length===0?a.jsx("span",{className:"pp-resource-status",children:i.search.trim()?c("deploymentResources.noMatchSentence"):c("deploymentResources.noAvailableSentence")}):i.serviceRegion?a.jsx("span",{className:"pp-resource-status",children:c("deploymentResources.loadedSummary",{region:i.serviceRegion,loaded:i.items.length,total:i.totalCount>0?`/${i.totalCount}`:""})}):null]})}function k9e({region:e,value:t,disabled:n=!1,onChange:i}){const{t:r}=Te("ui"),s=bp(e?{kind:"cr-registry",region:e}:null),o=bp(e&&(t!=null&&t.registry)?{kind:"cr-namespace",region:e,registry:t.registry}:null),l=bp(e&&(t!=null&&t.registry)&&t.namespace?{kind:"cr-repository",region:e,registry:t.registry,namespace:t.namespace}:null),c=t??{region:e,registry:"",namespace:"",repository:""};return a.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three environment-repository-fields",children:[a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:r("deploymentResources.registryInstance")}),a.jsx(yp,{ariaLabel:r("deploymentResources.registryAriaLabel"),value:c.registry,valueLabel:c.registry,state:s,disabled:n||!e,valueField:"name",onChange:u=>i({region:e,registry:u.name,namespace:"",repository:""})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:r("deploymentResources.namespace")}),a.jsx(yp,{ariaLabel:r("deploymentResources.namespaceAriaLabel"),value:c.namespace,valueLabel:c.namespace,state:o,disabled:n||!c.registry,disabledMessage:c.registry?void 0:r("deploymentResources.selectRegistryFirst"),valueField:"name",onChange:u=>i({...c,region:e,namespace:u.name,repository:""})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:r("deploymentResources.repository")}),a.jsx(yp,{ariaLabel:r("deploymentResources.existingRepository"),value:c.repository,valueLabel:c.repository,state:l,disabled:n||!c.registry||!c.namespace,disabledMessage:c.registry?c.namespace?void 0:r("deploymentResources.selectNamespaceFirst"):r("deploymentResources.selectRegistryFirst"),valueField:"name",onChange:u=>i({...c,region:e,repository:u.name})})]})]})}function m6({resource:e,value:t,disabled:n,onChange:i}){const{t:r}=Te("ui");return a.jsxs("label",{className:"pp-resource-field pp-resource-mode",children:[a.jsx("span",{children:r("deploymentResources.configurationMode")}),a.jsx(xf,{ariaLabel:r("deploymentResources.configurationModeAriaLabel",{resource:e}),value:t,placeholder:r("deploymentResources.selectConfigurationMode"),options:fZt(r),disabled:n,onChange:s=>i(s)})]})}function Hv({label:e,value:t,placeholder:n,disabled:i,onChange:r}){return a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:e}),a.jsx("input",{value:t,placeholder:n,disabled:i,autoComplete:"off",onChange:s=>r(s.currentTarget.value)})]})}function g6({items:e,note:t}){const{t:n}=Te("ui");return a.jsxs("div",{className:"pp-resource-auto-names",children:[a.jsx("span",{children:n("deploymentResources.automaticNames")}),a.jsx("dl",{children:e.map(i=>a.jsxs("div",{children:[a.jsx("dt",{children:i.label}),a.jsx("dd",{title:i.name,children:i.name})]},i.label))}),t&&a.jsx("small",{children:t})]})}function S9e(e){var t,n,i,r,s,o,l,c;return e.tos.mode!=="auto"&&!((t=e.tos.bucket)!=null&&t.trim())?yn.t("ui:deploymentResources.validation.tos"):e.cr.mode!=="auto"&&(!((n=e.cr.instance)!=null&&n.trim())||!((i=e.cr.namespace)!=null&&i.trim())||!((r=e.cr.repository)!=null&&r.trim()))?yn.t("ui:deploymentResources.validation.cr"):e.codePipeline.mode!=="auto"&&(!((s=e.codePipeline.workspaceName)!=null&&s.trim())||!((o=e.codePipeline.pipelineName)!=null&&o.trim()))?yn.t("ui:deploymentResources.validation.codePipeline"):e.codePipeline.mode==="existing"&&(!((l=e.codePipeline.workspaceId)!=null&&l.trim())||!((c=e.codePipeline.pipelineId)!=null&&c.trim()))?yn.t("ui:deploymentResources.validation.existingCodePipeline"):null}function E9e({value:e,agentName:t,runtimeName:n,region:i,disabled:r,validationError:s,onChange:o}){const{t:l}=Te("ui"),c=t.trim()||"agentkit-app",u=n.trim()||c,d=i&&i!=="cn-beijing"?l("deploymentResources.autoBucketWithRegion",{region:i.startsWith("cn-")?i.slice(3):i}):l("deploymentResources.autoBucket"),f=bp(e.tos.mode==="existing"?{kind:"tos-bucket",region:i}:null),h=bp(e.cr.mode==="existing"?{kind:"cr-registry",region:i}:null),m=bp(e.cr.mode==="existing"&&e.cr.instance?{kind:"cr-namespace",region:i,registry:e.cr.instance}:null),g=bp(e.cr.mode==="existing"&&e.cr.instance&&e.cr.namespace?{kind:"cr-repository",region:i,registry:e.cr.instance,namespace:e.cr.namespace}:null),b=bp(e.codePipeline.mode==="existing"?{kind:"cp-workspace",region:i}:null),v=bp(e.codePipeline.mode==="existing"&&e.codePipeline.workspaceId?{kind:"cp-pipeline",region:i,workspaceId:e.codePipeline.workspaceId}:null),y=w=>o({...e,...w});return a.jsxs("div",{className:"pp-resource-list",children:[a.jsxs("div",{className:"pp-resource-item",children:[a.jsx("div",{className:"pp-resource-name",children:l("deploymentResources.tosBucket")}),a.jsxs("div",{className:"pp-resource-grid",children:[a.jsx(m6,{resource:l("deploymentResources.tosBucket"),value:e.tos.mode,disabled:r,onChange:w=>y({tos:{mode:w}})}),e.tos.mode==="create"&&a.jsx(Hv,{label:l("deploymentResources.bucketName"),value:e.tos.bucket??"",placeholder:l("deploymentResources.bucketNamePlaceholder"),disabled:r,onChange:w=>y({tos:{...e.tos,bucket:w}})}),e.tos.mode==="existing"&&a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.existingBucket")}),a.jsx(yp,{ariaLabel:l("deploymentResources.existingTosBucket"),value:e.tos.bucket??"",valueLabel:e.tos.bucket,state:f,disabled:r,onChange:w=>y({tos:{...e.tos,bucket:w.name}})})]}),e.tos.mode==="auto"&&a.jsx(g6,{items:[{label:l("deploymentResources.bucket"),name:d}],note:l("deploymentResources.accountIdResolved")})]})]}),a.jsxs("div",{className:"pp-resource-item",children:[a.jsx("div",{className:"pp-resource-name",children:l("deploymentResources.containerRegistry")}),a.jsxs("div",{className:"pp-resource-grid",children:[a.jsx(m6,{resource:"CR",value:e.cr.mode,disabled:r,onChange:w=>y({cr:{mode:w}})}),e.cr.mode==="create"&&a.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three",children:[a.jsx(Hv,{label:l("deploymentResources.instanceName"),value:e.cr.instance??"",placeholder:l("deploymentResources.crInstance"),disabled:r,onChange:w=>y({cr:{...e.cr,instance:w}})}),a.jsx(Hv,{label:l("deploymentResources.namespace"),value:e.cr.namespace??"",placeholder:l("deploymentResources.namespace"),disabled:r,onChange:w=>y({cr:{...e.cr,namespace:w}})}),a.jsx(Hv,{label:l("deploymentResources.repository"),value:e.cr.repository??"",placeholder:l("deploymentResources.repository"),disabled:r,onChange:w=>y({cr:{...e.cr,repository:w}})})]}),e.cr.mode==="existing"&&a.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three",children:[a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.crInstance")}),a.jsx(yp,{ariaLabel:l("deploymentResources.existingCrInstance"),value:e.cr.instance??"",valueLabel:e.cr.instance,state:h,disabled:r,valueField:"name",onChange:w=>y({cr:{mode:"existing",instance:w.name}})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.namespace")}),a.jsx(yp,{ariaLabel:l("deploymentResources.existingCrNamespace"),value:e.cr.namespace??"",valueLabel:e.cr.namespace,state:m,disabled:r||!e.cr.instance,valueField:"name",onChange:w=>y({cr:{...e.cr,namespace:w.name,repository:void 0}})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.repository")}),a.jsx(yp,{ariaLabel:l("deploymentResources.existingCrRepository"),value:e.cr.repository??"",valueLabel:e.cr.repository,state:g,disabled:r||!e.cr.namespace,valueField:"name",onChange:w=>y({cr:{...e.cr,repository:w.name}})})]})]}),e.cr.mode==="auto"&&a.jsx(g6,{items:[{label:l("deploymentResources.crInstance"),name:l("deploymentResources.autoRegistry")},{label:l("deploymentResources.namespace"),name:"agentkit"},{label:l("deploymentResources.repository"),name:l("deploymentResources.autoRepositoryName",{name:c})}],note:l("deploymentResources.registryNameNote")})]})]}),a.jsxs("div",{className:"pp-resource-item",children:[a.jsx("div",{className:"pp-resource-name",children:"CodePipeline"}),a.jsxs("div",{className:"pp-resource-grid",children:[a.jsx(m6,{resource:"CodePipeline",value:e.codePipeline.mode,disabled:r,onChange:w=>y({codePipeline:{mode:w}})}),e.codePipeline.mode==="create"&&a.jsxs("div",{className:"pp-resource-fields",children:[a.jsx(Hv,{label:l("deploymentResources.workspaceName"),value:e.codePipeline.workspaceName??"",placeholder:l("deploymentResources.workspaceName"),disabled:r,onChange:w=>y({codePipeline:{...e.codePipeline,workspaceName:w}})}),a.jsx(Hv,{label:l("deploymentResources.pipelineName"),value:e.codePipeline.pipelineName??"",placeholder:l("deploymentResources.pipelineName"),disabled:r,onChange:w=>y({codePipeline:{...e.codePipeline,pipelineName:w}})})]}),e.codePipeline.mode==="existing"&&a.jsxs("div",{className:"pp-resource-fields",children:[a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.workspace")}),a.jsx(yp,{ariaLabel:l("deploymentResources.existingWorkspace"),value:e.codePipeline.workspaceId??"",valueLabel:e.codePipeline.workspaceName,state:b,disabled:r,onChange:w=>y({codePipeline:{mode:"existing",workspaceId:w.id,workspaceName:w.name}})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.compatiblePipeline")}),a.jsx(yp,{ariaLabel:l("deploymentResources.existingPipeline"),value:e.codePipeline.pipelineId??"",valueLabel:e.codePipeline.pipelineName,state:v,disabled:r||!e.codePipeline.workspaceId,onChange:w=>y({codePipeline:{...e.codePipeline,pipelineId:w.id,pipelineName:w.name}})})]})]}),e.codePipeline.mode==="auto"&&a.jsx(g6,{items:[{label:l("deploymentResources.workspace"),name:"agentkit-cli-workspace"},{label:l("deploymentResources.pipeline"),name:u}],note:l("deploymentResources.pipelineNameNote")})]})]}),s&&a.jsx("p",{className:"pp-resource-validation",role:"alert",children:s})]})}function pZt(e){return[{value:"custom",label:e("environmentCenter.creation.custom.label"),description:e("environmentCenter.creation.custom.description")},{value:"dockerfile",label:e("environmentCenter.creation.dockerfile.label"),description:e("environmentCenter.creation.dockerfile.description")},{value:"git",label:e("environmentCenter.creation.git.label"),description:e("environmentCenter.creation.git.description")},{value:"image",label:e("environmentCenter.creation.image.label"),description:e("environmentCenter.creation.image.description")}]}const mZt=DIe.map(e=>({value:e.id,label:e.label,description:e.description}));function gZt(e){return[{value:"none",label:e("common.none"),description:e("environmentCenter.presets.none")},{value:"aio-sandbox",label:"AIO Sandbox",description:e("environmentCenter.presets.aio")},{value:"codex-sandbox",label:"Codex Sandbox",description:e("environmentCenter.presets.codex")}]}function bZt(e){const t=oZt(e,"");return t===hH?"aio-sandbox":t.includes("/codexenv:")?"codex-sandbox":"none"}const yZt=yI.map(e=>({value:e.id,label:e.label})),Zoe=LIe.map(e=>({value:e.id,label:e.label}));function vZt(e){return[{value:"managed",label:e("environmentCenter.repository.managed")},{value:"existing",label:e("environmentCenter.repository.existing")}]}const X7=20,Joe=new Set;function xZt(e){const t=e instanceof Error?e.message:String(e??"");return t.includes("HTTP 503")&&(t.includes("未配置持久化存储")||t.includes("storage is not configured"))}async function wZt(){var e;if(typeof navigator>"u"||!((e=navigator.permissions)!=null&&e.query))return!1;try{return(await navigator.permissions.query({name:"clipboard-read"})).state==="denied"}catch{return!1}}const OZt={opencli:jYt,uv:NYt,playwright:RYt,chromium:IYt,git:PYt,curl:DYt,ffmpeg:MYt,imagemagick:LYt};function kZt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function of(){return a.jsx("span",{className:"environment-required-mark","aria-hidden":"true",children:"*"})}function SZt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M12 3v11m0 0 4-4m-4 4-4-4"}),a.jsx("path",{d:"M5 16v2.5A2.5 2.5 0 0 0 7.5 21h9a2.5 2.5 0 0 0 2.5-2.5V16"})]})}function Y7(e,t){const n=e.trim();if(!n)return t("environmentCenter.errors.repositoryRequired");try{const i=new URL(n);if(i.protocol!=="https:"||!i.hostname)return t("environmentCenter.errors.repositoryHttps")}catch{return t("environmentCenter.errors.repositoryInvalid")}return""}function ele(e){return!!(e!=null&&e.region&&e.registry&&e.namespace&&e.repository)}function C9e(e,t){const n=e.trim();return n?/\s/.test(n)?t("environmentCenter.errors.imageReferenceWhitespace"):n.startsWith("sha256:")?/^sha256:[0-9a-fA-F]{64}$/.test(n)?"":t("environmentCenter.errors.imageDigestInvalid"):/[@/]/.test(n)?t("environmentCenter.errors.imageTagOnly"):"":""}function EZt(e){return(e instanceof Error?e.message:String(e)).split(` -原始响应:`,1)[0].trim()}function CZt(e){return a.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5.5 10.5 16 5l10.5 5.5L16 16 5.5 10.5Z"}),a.jsx("path",{d:"M5.5 16 16 21.5 26.5 16M5.5 21.5 16 27l10.5-5.5"})]})}function AZt({label:e}){return a.jsx("span",{className:"environment-package-fallback",children:e.slice(0,1).toUpperCase()})}function TZt({option:e}){if(e.id==="lark-cli")return a.jsx("img",{src:IL,alt:""});if(e.id==="pandoc")return a.jsx("img",{src:_Yt,alt:""});if(e.id==="github-cli")return a.jsx(bK,{});const t=OZt[e.id];return t?a.jsx("img",{src:t,alt:""}):a.jsx(AZt,{label:e.label})}function _Zt(e,t){return e?{name:e.name,description:e.description,baseEnvironment:e.baseEnvironment,operatingSystem:e.operatingSystem,language:e.language,optionIds:[...e.optionIds],selectedSkills:[...e.selectedSkills],dockerfile:e.dockerfile===mH(e,t)?void 0:e.dockerfile,gitSource:e.gitSource,containerRepository:e.containerRepository,imageSource:e.imageSource}:{...a4,optionIds:[...a4.optionIds],selectedSkills:[...a4.selectedSkills]}}const Dy=new Set(["preparing","queued","building","scanning"]),tle=3e3,b6={preparing:"environmentCenter.buildStatus.preparing",queued:"environmentCenter.buildStatus.queued",building:"environmentCenter.buildStatus.building",scanning:"environmentCenter.buildStatus.scanning",available:"environmentCenter.buildStatus.available",failed:"environmentCenter.buildStatus.failed"};function A9e(e,t){var i;const n=(i=e.latestVersion)==null?void 0:i.status;return n?n==="available"?{label:t(b6[n]),color:"success"}:n==="failed"?{label:t(b6[n]),color:"danger"}:{label:t(b6[n]),color:"warning"}:{label:t("environmentCenter.buildStatus.notBuilt"),color:"secondary"}}function jZt(e,t){return PT(e,Date.now(),t)}function NZt(e,t){const n=Date.parse(e);return Number.isNaN(n)?e:new Intl.DateTimeFormat(t,{dateStyle:"medium",timeStyle:"medium"}).format(n)}function RZt(e,t,n=Date.now()){const i=Date.parse(e.createdAt),s=Dy.has(e.status)?n:Date.parse(e.updatedAt);if(Number.isNaN(i)||Number.isNaN(s))return"";const o=Math.max(0,Math.floor((s-i)/1e3));if(o<60)return t("environmentCenter.duration.seconds",{count:o});const l=Math.floor(o/60),c=o%60;return l<60?t("environmentCenter.duration.minutesSeconds",{minutes:l,seconds:c}):t("environmentCenter.duration.hoursMinutes",{hours:Math.floor(l/60),minutes:l%60})}function IZt({environment:e,onClose:t}){var x;const{t:n}=Te("ui"),i=((x=e.latestVersion)==null?void 0:x.versionId)??"",r=p.useId(),s=p.useRef(null),o=p.useRef(t),[l,c]=p.useState(null),[u,d]=p.useState(!0),[f,h]=p.useState(""),[m,g]=p.useState(0),[b,v]=p.useState("idle"),y=p.useMemo(()=>l?dZt(l):"",[l]);o.current=t,p.useEffect(()=>{var C;const O=document.body.style.overflow,k=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(C=s.current)==null||C.focus();const S=E=>{if(E.key==="Escape"){E.preventDefault(),o.current();return}if(E.key!=="Tab"||!s.current)return;const j=Array.from(s.current.querySelectorAll('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])')).filter(A=>A.getClientRects().length>0);if(!j.length)return;const T=j[0],R=j[j.length-1];E.shiftKey&&document.activeElement===T?(E.preventDefault(),R.focus()):!E.shiftKey&&document.activeElement===R&&(E.preventDefault(),T.focus())};return window.addEventListener("keydown",S),()=>{document.body.style.overflow=O,window.removeEventListener("keydown",S),k!=null&&k.isConnected&&k.focus()}},[]),p.useEffect(()=>{const O=new AbortController;return d(!0),h(""),ZTe(e.id,i,O.signal).then(c).catch(k=>{(k==null?void 0:k.name)!=="AbortError"&&h(k instanceof Error?k.message:String(k))}).finally(()=>{O.signal.aborted||d(!1)}),()=>O.abort()},[e.id,m,i]),p.useEffect(()=>{if(b!=="copied")return;const O=window.setTimeout(()=>v("idle"),1500);return()=>window.clearTimeout(O)},[b]);const w=async()=>{try{await navigator.clipboard.writeText(y),v("copied")}catch{v("error")}};return vi.createPortal(a.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:O=>{O.target===O.currentTarget&&t()},children:a.jsxs("section",{ref:s,className:"environment-build-dialog environment-manifest-dialog",role:"dialog","aria-modal":"true","aria-labelledby":r,"aria-busy":u||void 0,tabIndex:-1,children:[a.jsxs("header",{className:"environment-build-dialog__header",children:[a.jsxs("div",{children:[a.jsx("div",{className:"environment-build-dialog__title-row",children:a.jsx("h2",{id:r,children:n("environmentCenter.manifest.title")})}),a.jsxs("p",{children:[e.name," / ",i]})]}),a.jsx(Tt,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,onClick:t,"aria-label":n("environmentCenter.manifest.closeLabel"),children:a.jsx(Mo,{"aria-hidden":!0})})]}),a.jsx("div",{className:"environment-manifest-dialog__body",children:u?a.jsx("div",{className:"environment-manifest-dialog__state",role:"status",children:a.jsx(hn,{as:"span",children:n("environmentCenter.manifest.loading")})}):f?a.jsxs("div",{className:"environment-manifest-dialog__state is-error",role:"alert",children:[a.jsx("p",{children:f}),a.jsx(Tt,{type:"button",color:"secondary",variant:"soft",size:"sm",onClick:()=>g(O=>O+1),children:n("common.reload")})]}):a.jsx("div",{className:"environment-manifest-dialog__editor","aria-label":n("environmentCenter.manifest.editorLabel"),children:a.jsx(NT,{value:y,path:"environment.yaml",readOnly:!0,onChange:()=>{}})})}),a.jsxs("footer",{className:"environment-build-dialog__actions",children:[b==="error"?a.jsx("span",{className:"environment-manifest-dialog__copy-error",role:"alert",children:n("environmentCenter.manifest.copyFailed")}):null,a.jsx(Tt,{type:"button",color:"secondary",variant:"ghost",size:"sm",onClick:t,children:n("common.close")}),a.jsx(Tt,{type:"button",color:"info",size:"sm",disabled:!y,onClick:()=>void w(),children:n(b==="copied"?"environmentCenter.manifest.copied":"environmentCenter.manifest.copy")})]})]})}),document.body)}function PZt({environment:e,onClose:t,onBuildUpdate:n,onRebuild:i}){var S,C;const{t:r}=Te("ui"),s=e.latestVersion,[o,l]=p.useState(s),[c,u]=p.useState(!!s),[d,f]=p.useState(""),[h,m]=p.useState(Date.now()),[g,b]=p.useState(!1),v=p.useId(),y=p.useRef(null),w=p.useRef(t),x=p.useRef(n);p.useEffect(()=>{w.current=t,x.current=n},[n,t]),p.useEffect(()=>{var R;const E=document.body.style.overflow,j=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(R=y.current)==null||R.focus();const T=A=>{var D;if(A.key==="Escape"&&w.current(),A.key!=="Tab")return;const N=Array.from(((D=y.current)==null?void 0:D.querySelectorAll('button:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])'))??[]).filter(_=>_.getClientRects().length>0);if(!N.length)return;const P=N[0],I=N[N.length-1];A.shiftKey&&document.activeElement===P?(A.preventDefault(),I.focus()):!A.shiftKey&&document.activeElement===I&&(A.preventDefault(),P.focus())};return window.addEventListener("keydown",T),()=>{document.body.style.overflow=E,window.removeEventListener("keydown",T),j!=null&&j.isConnected&&j.focus()}},[]),p.useEffect(()=>{if(!s)return;let E=0;const j=new AbortController,T=async()=>{u(!0);try{const R=await YTe(e.id,s.versionId,{includeLogs:!0,signal:j.signal});l(R),f(""),x.current(R),Dy.has(R.status)&&(E=window.setTimeout(T,tle))}catch(R){if((R==null?void 0:R.name)==="AbortError")return;f(R instanceof Error?R.message:String(R)),E=window.setTimeout(T,tle)}finally{j.signal.aborted||u(!1)}};return T(),()=>{j.abort(),window.clearTimeout(E)}},[e.id,s==null?void 0:s.versionId]),p.useEffect(()=>{if(!o||!Dy.has(o.status))return;const E=window.setInterval(()=>m(Date.now()),1e3);return()=>window.clearInterval(E)},[o==null?void 0:o.status]);const O=o?A9e({...e,latestVersion:o},r):{label:r("environmentCenter.buildStatus.notBuilt"),color:"secondary"},k=e.imageSource||(C=(S=o==null?void 0:o.resources)==null?void 0:S.codePipeline)==null?void 0:C.consoleUrl;return vi.createPortal(a.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:E=>{E.target===E.currentTarget&&t()},children:a.jsxs("section",{ref:y,className:"environment-build-dialog",role:"dialog","aria-modal":"true","aria-labelledby":v,tabIndex:-1,children:[a.jsxs("header",{className:"environment-build-dialog__header",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"environment-build-dialog__title-row",children:[a.jsx("h2",{id:v,children:r("environmentCenter.buildDetails.title")}),a.jsx(Ya,{color:O.color,size:"sm",children:O.label})]}),a.jsx("p",{children:e.name})]}),a.jsx(Tt,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,onClick:t,"aria-label":r("environmentCenter.buildDetails.closeLabel"),children:a.jsx(Mo,{"aria-hidden":!0})})]}),a.jsxs("div",{className:"environment-build-dialog__summary",children:[a.jsxs("div",{children:[a.jsx("span",{children:r("environmentCenter.buildDetails.currentStep")}),a.jsx("strong",{children:(o==null?void 0:o.currentStep)||r("environmentCenter.buildDetails.waiting")})]}),a.jsxs("div",{children:[a.jsx("span",{children:r("environmentCenter.buildDetails.elapsed")}),a.jsx("strong",{children:o?RZt(o,r,h):"-"})]}),o!=null&&o.sourceCommitSha?a.jsxs("div",{children:[a.jsx("span",{children:r("environmentCenter.buildDetails.sourceCommit")}),a.jsx("strong",{title:o.sourceCommitSha,children:o.sourceCommitSha.slice(0,12)})]}):null,k?a.jsxs("a",{href:k,target:"_blank",rel:"noreferrer",children:[r("environmentCenter.buildDetails.openCodePipeline")," ",a.jsx(d0,{"aria-hidden":!0})]}):null]}),a.jsxs("div",{className:"environment-build-dialog__body",children:[d?a.jsx("p",{className:"environment-build-dialog__error",role:"alert",children:d}):null,o!=null&&o.progressError?a.jsx("p",{className:"environment-build-dialog__notice",children:o.progressError}):null,a.jsx(QYt,{steps:(o==null?void 0:o.steps)??[],log:(o==null?void 0:o.logTail)??"",logError:o==null?void 0:o.logError,logTruncated:o==null?void 0:o.logTruncated,logUpdatedAt:o==null?void 0:o.logUpdatedAt,loading:c&&!!(o&&Dy.has(o.status))}),(o==null?void 0:o.status)==="failed"&&o.error?a.jsx("p",{className:"environment-build-dialog__failure",role:"alert",children:o.error}):null]}),a.jsxs("footer",{className:"environment-build-dialog__actions",children:[a.jsx(Tt,{type:"button",color:"secondary",variant:"ghost",size:"sm",onClick:t,children:r("common.close")}),o&&!e.imageSource&&!Dy.has(o.status)?a.jsx(Tt,{type:"button",color:"info",size:"sm",disabled:g,onClick:()=>{b(!0),i().then(t).finally(()=>b(!1))},children:r(g?"environmentCenter.buildDetails.starting":"environmentCenter.buildDetails.rebuild")}):null]})]})}),document.body)}function T9e({cloudProvider:e,value:t,disabled:n,onChange:i}){const{t:r}=Te("ui"),s=Tu(e).map(o=>({value:o.value,label:o.label}));return a.jsxs("label",{className:"environment-field environment-region-field",children:[a.jsxs("span",{children:[r("environmentCenter.region"),a.jsx(of,{})]}),a.jsx(pa,{id:"environment-region",value:t,options:s,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:n,triggerClassName:"environment-select-trigger",onChange:o=>i(o.value)})]})}function DZt({repositoryUrl:e,gitRef:t,dockerfilePath:n,inspection:i,inspectedKey:r,disabled:s,onRepositoryUrlChange:o,onGitRefChange:l,onDockerfilePathChange:c,onInspectionChange:u,onInspectedKeyChange:d}){const{t:f}=Te("ui"),[h,m]=p.useState(!1),[g,b]=p.useState(""),v=p.useRef(null),y=p.useRef(""),w=`${e.trim()}\0${t.trim()}`,x=r===w;p.useEffect(()=>()=>{const C=v.current;v.current=null,C==null||C.abort()},[]);const O=()=>{var C;(C=v.current)==null||C.abort(),v.current=null,m(!1),b(""),u(null),d(""),c(""),y.current=""},k=p.useCallback(async()=>{var j;const C=Y7(e,f);if(C){b(C);return}y.current=w,(j=v.current)==null||j.abort();const E=new AbortController;v.current=E,m(!0),b("");try{const T=await zTe({repositoryUrl:e.trim(),...t.trim()?{ref:t.trim()}:{}},E.signal);if(v.current!==E)return;u(T),d(w),c(T.dockerfiles.length===1?T.dockerfiles[0]:"")}catch(T){if((T==null?void 0:T.name)==="AbortError")return;b(EZt(T)),u(null),d(""),c("")}finally{v.current===E&&(v.current=null,m(!1))}},[w,t,c,d,u,e,f]);p.useEffect(()=>{if(s||x||y.current===w||Y7(e,f))return;const C=window.setTimeout(()=>void k(),600);return()=>window.clearTimeout(C)},[w,s,k,x,e,f]);const S=x?(i==null?void 0:i.dockerfiles)??[]:[];return a.jsxs("section",{className:"environment-source-section","aria-label":f("environmentCenter.git.sectionLabel"),children:[a.jsxs("div",{className:"environment-form-grid environment-git-fields",children:[a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[f("environmentCenter.git.address"),a.jsx(of,{})]}),a.jsx(_s,{size:"lg",type:"url",required:!0,value:e,placeholder:"https://github.com/owner/repository.git",autoComplete:"url",disabled:s,"aria-invalid":!!g,onChange:C=>{O(),o(C.currentTarget.value)}})]}),a.jsxs("label",{className:"environment-field",children:[a.jsx("span",{children:f("environmentCenter.git.ref")}),a.jsx(_s,{size:"lg",value:t,placeholder:f("environmentCenter.git.defaultBranch"),autoComplete:"off",disabled:s,onChange:C=>{O(),l(C.currentTarget.value)}})]})]}),a.jsxs("div",{className:"environment-inspection-status environment-form-feedback","aria-live":"polite",children:[h?a.jsx(hn,{as:"span",children:f("environmentCenter.git.inspecting")}):null,g?a.jsxs("div",{className:"environment-source-error",role:"alert",children:[a.jsx("span",{children:g}),a.jsxs(Tt,{type:"button",color:"primary",size:"sm",pill:!1,disabled:s,onClick:()=>void k(),children:[a.jsx(ZD,{}),f("common.retry")]})]}):null,!h&&!g&&x&&i?S.length>0?a.jsx("span",{children:i.commitSha?f("environmentCenter.git.foundDockerfiles",{commit:i.commitSha.slice(0,12),count:S.length}):f("environmentCenter.git.savedDockerfileLoaded")}):a.jsxs("div",{className:"environment-source-error",role:"alert",children:[a.jsx("span",{children:f("environmentCenter.git.noDockerfile")}),a.jsx("button",{type:"button",disabled:s,onClick:()=>void k(),children:f("environmentCenter.git.inspectAgain")})]}):null]}),S.length>0?a.jsxs("label",{className:"environment-field environment-dockerfile-picker",children:[a.jsxs("span",{children:["Dockerfile",a.jsx(of,{})]}),a.jsx(xf,{ariaLabel:f("environmentCenter.git.selectDockerfile"),value:n,valueLabel:n,placeholder:f("environmentCenter.git.selectDockerfile"),options:S.map(C=>({value:C,label:C})),disabled:s||h,onChange:c})]}):null]})}function MZt({cloudProvider:e,mode:t,region:n,value:i,disabled:r,onModeChange:s,onRegionChange:o,onChange:l}){const{t:c}=Te("ui");return a.jsx("section",{className:"environment-source-section","aria-label":c("environmentCenter.repository.outputSection"),children:a.jsxs("div",{className:"environment-form-grid",children:[a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[c("environmentCenter.repository.type"),a.jsx(of,{})]}),a.jsx(pa,{id:"environment-repository-mode",value:t,options:vZt(c),optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:r,triggerClassName:"environment-select-trigger",onChange:u=>s(u.value)})]}),a.jsx(T9e,{cloudProvider:e,value:n,disabled:r,onChange:o}),t==="existing"?a.jsx(k9e,{region:n,value:i,disabled:r,onChange:l}):a.jsx("p",{className:"environment-source-note environment-form-feedback",children:c("environmentCenter.repository.managedHint")})]})})}function LZt({cloudProvider:e,region:t,repository:n,reference:i,disabled:r,onRegionChange:s,onRepositoryChange:o,onReferenceChange:l}){const{t:c}=Te("ui"),u=C9e(i,c);return a.jsx("section",{className:"environment-source-section","aria-label":c("environmentCenter.existingImage.sectionLabel"),children:a.jsxs("div",{className:"environment-form-grid",children:[a.jsx(T9e,{cloudProvider:e,value:t,disabled:r,onChange:s}),a.jsx(k9e,{region:t,value:n,disabled:r,onChange:o}),a.jsxs("label",{className:"environment-field environment-image-reference",children:[a.jsxs("span",{children:[c("environmentCenter.existingImage.reference"),a.jsx(of,{})]}),a.jsx(_s,{size:"lg",value:i,required:!0,placeholder:c("environmentCenter.existingImage.placeholder"),autoComplete:"off",disabled:r,"aria-invalid":!!u,onChange:d=>l(d.currentTarget.value)}),u?a.jsx("small",{className:"environment-source-field__error",role:"alert",children:u}):a.jsx("small",{children:c("environmentCenter.existingImage.hint")})]})]})})}function _9e(e,t,n,i){const r=p.useRef(n),s=p.useRef(i);r.current=n,s.current=i,p.useEffect(()=>{const o=document.body.style.overflow,l=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden";const c=window.requestAnimationFrame(()=>{var d;return(d=t.current)==null?void 0:d.focus()}),u=d=>{var g;if(d.key==="Escape"&&!s.current){d.preventDefault(),r.current();return}if(d.key!=="Tab")return;const f=Array.from(((g=e.current)==null?void 0:g.querySelectorAll('button:not([disabled]), textarea:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])'))??[]).filter(b=>b.getClientRects().length>0);if(!f.length)return;const h=f[0],m=f[f.length-1];d.shiftKey&&document.activeElement===h?(d.preventDefault(),m.focus()):!d.shiftKey&&document.activeElement===m&&(d.preventDefault(),h.focus())};return window.addEventListener("keydown",u),()=>{window.cancelAnimationFrame(c),document.body.style.overflow=o,window.removeEventListener("keydown",u),l!=null&&l.isConnected&&l.focus()}},[e,t])}function $Zt({environment:e,onClose:t}){const{t:n}=Te("ui"),i=p.useId(),r=p.useId(),s=p.useRef(null),o=p.useRef(null),[l,c]=p.useState(""),[u,d]=p.useState("loading"),[f,h]=p.useState(""),m=u==="loading";_9e(s,o,t,m);const g=async(b="",v)=>{d("loading"),h("");try{const y=b||(await VTe(e.id,v)).shareCode;c(y),await ITe(y),v!=null&&v.aborted||d("copied")}catch(y){if((y==null?void 0:y.name)==="AbortError")return;h(y instanceof Error?y.message:String(y)),d("error")}};return p.useEffect(()=>{const b=new AbortController;return g("",b.signal),()=>b.abort()},[e.id]),vi.createPortal(a.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:b=>{b.target===b.currentTarget&&!m&&t()},children:a.jsxs("section",{ref:s,className:"environment-share-dialog",role:"dialog","aria-modal":"true","aria-labelledby":i,"aria-describedby":r,"aria-busy":m||void 0,children:[a.jsxs("header",{className:"environment-build-dialog__header",children:[a.jsxs("div",{children:[a.jsx("h2",{id:i,children:n("environmentCenter.share.title")}),a.jsx("p",{id:r,children:e.name})]}),a.jsx(Tt,{ref:o,type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,disabled:m,onClick:t,"aria-label":n("environmentCenter.share.closeLabel"),children:a.jsx(Mo,{"aria-hidden":!0})})]}),a.jsx("div",{className:"environment-share-dialog__body",children:u==="loading"?a.jsx(hn,{as:"p",children:n("environmentCenter.share.generating")}):a.jsxs("div",{className:"environment-share-dialog__result",children:[u==="copied"?a.jsx("p",{className:"environment-share-dialog__success",role:"status","aria-live":"polite",children:n("environmentCenter.share.copied")}):a.jsxs("div",{className:"environment-share-dialog__error",role:"alert",children:[a.jsx("strong",{children:n("environmentCenter.share.failed")}),a.jsx("span",{children:f})]}),l?a.jsxs("label",{className:"environment-share-dialog__field environment-share-dialog__manual-code",children:[a.jsx("span",{children:n("environmentCenter.share.code")}),a.jsx(xb,{size:"lg",rows:4,value:l,readOnly:!0,"aria-label":n("environmentCenter.share.fullCode"),onFocus:b=>b.currentTarget.select(),onClick:b=>b.currentTarget.select()}),a.jsx("small",{children:n(u==="copied"?"environmentCenter.share.copiedHint":"environmentCenter.share.copyFailedHint")})]}):null,a.jsx("p",{className:"environment-share-dialog__safety",children:n("environmentCenter.share.safety")})]})}),a.jsxs("footer",{className:"environment-build-dialog__actions",children:[a.jsx(Tt,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:m,onClick:t,children:n("common.close")}),u==="error"?a.jsx(Tt,{type:"button",color:"info",size:"sm",onClick:()=>void g(l),children:n("common.retry")}):u==="copied"?a.jsx(Tt,{type:"button",color:"info",size:"sm",onClick:()=>void g(l),children:n("environmentCenter.share.copyAgain")}):null]})]})}),document.body)}function FZt({initialValue:e,autoInspect:t,onClose:n,onImported:i}){const{t:r}=Te("ui"),s=p.useId(),o=p.useId(),l=p.useId(),c=p.useRef(null),u=p.useRef(null),d=p.useRef(!1),[f,h]=p.useState(e),[m,g]=p.useState("editing"),[b,v]=p.useState([]),[y,w]=p.useState(""),[x,O]=p.useState([]),k=p.useMemo(()=>Iz(f),[f]),S=k.length>X7,C=m==="inspecting"||m==="importing",E=b.filter(P=>P.status==="valid"),j=b.filter(P=>P.status==="invalid"),T=m==="ready"&&E.length>0;_9e(c,u,n,C);const R=p.useCallback(async()=>{if(!(!k.length||S)){g("inspecting"),w(""),O([]);try{const P=await HTe(k);v([...P].sort((I,D)=>I.index-D.index)),g("ready")}catch(P){w(P instanceof Error?P.message:String(P)),g("editing")}}},[k,S]);p.useEffect(()=>{!t||d.current||(d.current=!0,R())},[t,R]);const A=async()=>{if(T){g("importing"),w(""),O([]);try{const P=E.map(U=>({code:k[U.index],name:U.name})).filter(U=>!!U.code),I=await qTe(P.map(U=>U.code)),D=I.filter(U=>U.status==="created").length,_=I.filter(U=>U.status==="duplicate").length,L=new Map(I.map(U=>[U.index,U])),F=P.flatMap(({code:U,name:J},V)=>{const Z=L.get(V);return!Z||Z.status==="failed"?[{code:U,name:J,status:"valid",error:(Z==null?void 0:Z.error)||r("environmentCenter.import.noResult")}]:[]}),z=[...j.flatMap(U=>{const J=k[U.index];return J?[{code:J,name:"",status:"invalid",error:U.error||r("environmentCenter.import.invalidCode")}]:[]}),...F],q=new Map;if(I.forEach(U=>{U.environment&&q.set(U.environment.id,U.environment)}),i([...q.values()],D,_,z.length),!z.length){n();return}h(z.map(U=>U.code).join(` -`)),O(F),v(z.map((U,J)=>({index:J,status:U.status,name:U.name,error:U.status==="invalid"?U.error:""}))),w(r("environmentCenter.import.partial",{created:D,remaining:z.length})),g("ready")}catch(P){w(P instanceof Error?P.message:String(P)),g("ready")}}},N=m==="inspecting"?r("environmentCenter.import.inspecting"):m==="importing"?r("environmentCenter.import.importing"):T?x.length?r("environmentCenter.import.retryImport"):r("environmentCenter.import.confirm"):r("environmentCenter.import.inspectCodes");return vi.createPortal(a.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:P=>{P.target===P.currentTarget&&!C&&n()},children:a.jsxs("section",{ref:c,className:"environment-share-dialog environment-import-dialog",role:"dialog","aria-modal":"true","aria-labelledby":s,"aria-describedby":o,"aria-busy":C||void 0,children:[a.jsxs("header",{className:"environment-build-dialog__header",children:[a.jsxs("div",{children:[a.jsx("h2",{id:s,children:r("environmentCenter.import.title")}),a.jsx("p",{id:o,children:r("environmentCenter.import.description")})]}),a.jsx(Tt,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,disabled:C,onClick:n,"aria-label":r("environmentCenter.import.closeLabel"),children:a.jsx(Mo,{"aria-hidden":!0})})]}),a.jsxs("div",{className:"environment-share-dialog__body",children:[a.jsxs("label",{className:"environment-share-dialog__field",children:[a.jsx("span",{children:r("environmentCenter.import.code")}),a.jsx(xb,{ref:u,size:"lg",rows:6,value:f,disabled:C,"aria-invalid":S||j.length>0||void 0,"aria-describedby":l,placeholder:"akenv://v1/...",onChange:P=>{h(P.currentTarget.value),g("editing"),v([]),w(""),O([])}})]}),a.jsx("p",{id:l,className:`environment-share-dialog__help${S?" is-error":""}`,children:S?r("environmentCenter.import.tooMany",{max:X7,count:k.length}):r("environmentCenter.import.multipleHint")}),a.jsx("p",{className:"environment-share-dialog__safety",children:r("environmentCenter.import.safety")}),m==="inspecting"?a.jsx(hn,{as:"p",children:r("environmentCenter.import.inspectingCodes")}):E.length?a.jsx("p",{className:"environment-share-dialog__summary",role:"status","aria-live":"polite",children:r("environmentCenter.import.found",{count:E.length,names:E.map(P=>P.name||r("environmentCenter.unnamed")).join(r("environmentCenter.listSeparator"))})}):null,j.length?a.jsx("ul",{className:"environment-share-dialog__failures",role:"alert",children:j.map(P=>a.jsx("li",{children:r("environmentCenter.import.itemError",{index:P.index+1,error:P.error||r("environmentCenter.import.invalidCode")})},P.index))}):null,x.length?a.jsx("ul",{className:"environment-share-dialog__failures",role:"alert",children:x.map((P,I)=>a.jsx("li",{children:r("environmentCenter.import.itemError",{index:I+1,error:P.error})},`${P.code}:${I}`))}):null,y?a.jsx("p",{className:"environment-share-dialog__error-text",role:"alert",children:y}):null]}),a.jsxs("footer",{className:"environment-build-dialog__actions",children:[a.jsx(Tt,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:C,onClick:n,children:r("common.cancel")}),a.jsx(Tt,{type:"button",color:"info",size:"sm",loading:C,disabled:C||!k.length||S||m==="ready"&&!T,onClick:()=>T?void A():void R(),children:N})]})]})}),document.body)}function BZt({environment:e,cloudProvider:t,onCancel:n,onDelete:i,onShare:r,onSave:s}){var Ve,Be,_t,Pt,Kt,Et,vt;const{t:o,i18n:l}=Te("ui"),c=pZt(o),u=_Zt(e,t),d=u.dockerfile!==void 0,[f,h]=p.useState(()=>({...u,dockerfile:d?void 0:u.dockerfile})),[m,g]=p.useState(u.gitSource?"git":u.imageSource?"image":d?"dockerfile":"custom"),[b,v]=p.useState(d?(e==null?void 0:e.dockerfile)??"":""),[y,w]=p.useState(""),x=p.useRef(null),[O,k]=p.useState(()=>d?bZt((e==null?void 0:e.dockerfile)??""):u.baseEnvironment==="aio-sandbox"||u.baseEnvironment==="codex-sandbox"?u.baseEnvironment:"none"),[S,C]=p.useState(((Ve=u.gitSource)==null?void 0:Ve.repositoryUrl)??""),[E,j]=p.useState(((Be=u.gitSource)==null?void 0:Be.ref)??""),[T,R]=p.useState(((_t=u.gitSource)==null?void 0:_t.dockerfilePath)??""),[A,N]=p.useState(u.gitSource?{repositoryUrl:u.gitSource.repositoryUrl,ref:u.gitSource.ref??"",commitSha:"",dockerfiles:[u.gitSource.dockerfilePath]}:null),[P,I]=p.useState(u.gitSource?`${u.gitSource.repositoryUrl}\0${u.gitSource.ref??""}`:""),[D,_]=p.useState(u.containerRepository?"existing":"managed"),[L,F]=p.useState(((Pt=u.containerRepository)==null?void 0:Pt.region)??Zi(t)),[M,z]=p.useState(u.containerRepository??void 0),[q,U]=p.useState(((Kt=u.imageSource)==null?void 0:Kt.region)??Zi(t)),[J,V]=p.useState(u.imageSource?{region:u.imageSource.region,registry:u.imageSource.registry,namespace:u.imageSource.namespace,repository:u.imageSource.repository}:void 0),[Z,ne]=p.useState(((Et=u.imageSource)==null?void 0:Et.reference)??""),[W,G]=p.useState(!1),H=p.useMemo(()=>mH(f,t),[t,f.baseEnvironment,f.operatingSystem,f.language,f.optionIds]),se=f.dockerfile??H,Y=O!=="none",X=O==="aio-sandbox"?hH:O==="codex-sandbox"?MIe[t]:"",ie=Y?lZt(b):b,ee=Y?tR(X,""):"",be=Y?tR(X,ie):b,ue=y||(Y?cZt(ie,X,o):vK(b,void 0,o)),pe=!!e,ke="environment-editor-form",[je,Pe]=p.useState(!1),[Ee,Qe]=p.useState(""),_e=!!be.trim()&&!ue,ae=`${S.trim()}\0${E.trim()}`,le=!Y7(S,o)&&P===ae&&!!T&&(D==="managed"||ele(M)),ge=ele(J)&&!!Z.trim()&&!C9e(Z,o),Oe=!!f.name.trim()&&!je&&(m==="custom"||m==="dockerfile"&&_e||m==="git"&&le||m==="image"&&ge),Se=(tt,mt)=>{h(Ne=>({...Ne,optionIds:mt?[...Ne.optionIds,tt]:Ne.optionIds.filter(wt=>wt!==tt)}))},qe=tt=>{w(""),v(Y?tR(X,tt):tt)},Xe=async tt=>{if(!tt)return;const mt=await uZt(tt,o);w(mt.error),mt.content&&v(mt.content)},ye=()=>{w(""),v(ee)},we=async tt=>{if(tt.preventDefault(),!!Oe){Pe(!0),Qe("");try{const mt=Cmt(be);await s({...f,name:f.name.trim(),description:f.description.trim(),optionIds:m==="custom"?f.optionIds:[],selectedSkills:m==="custom"?f.selectedSkills:[],dockerfile:m==="dockerfile"?be:m==="custom"?se:"",gitSource:m==="git"?{repositoryUrl:S.trim(),...E.trim()?{ref:E.trim()}:{},dockerfilePath:T}:null,containerRepository:m==="git"&&D==="existing"?M:null,imageSource:m==="image"&&J?{...J,reference:Z.trim()}:null,...m==="dockerfile"?mt:{}})}catch(mt){Qe(mt instanceof Error?mt.message:String(mt)),Pe(!1)}}},Ae=f.name.trim()||(pe?(e==null?void 0:e.name)||o("environmentCenter.configure"):o("environmentCenter.create"));return a.jsx(Oh,{className:"environment-editor","aria-label":o(pe?"environmentCenter.details":"environmentCenter.create"),children:a.jsx(nT,{title:Ae,description:o("environmentCenter.editorDescription"),identitySeed:Ae,backLabel:o("environmentCenter.backToList"),onBack:n,actions:a.jsxs(a.Fragment,{children:[i?a.jsx(Tt,{type:"button",color:"danger",variant:"ghost",size:"sm",onClick:i,disabled:je,children:o("common.delete")}):null,r?a.jsx(Tt,{color:"secondary",variant:"soft",size:"sm",onClick:r,disabled:je,children:o("environmentCenter.share.action")}):null,a.jsx(Tt,{color:"secondary",variant:"soft",size:"sm",onClick:n,disabled:je,children:o("common.cancel")}),a.jsx(Tt,{color:"info",size:"sm",type:"submit",form:ke,disabled:!Oe,children:o(je?"common.saving":m==="image"?pe?"environmentCenter.save":"environmentCenter.create":pe?"environmentCenter.saveAndBuild":"environmentCenter.createAndBuild")})]}),children:a.jsxs("form",{id:ke,className:"environment-form",onSubmit:we,children:[a.jsxs("div",{className:"environment-fields",children:[a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[o("environmentCenter.name"),a.jsx(of,{})]}),a.jsx(_s,{className:"environment-text-input",type:"text",size:"lg",required:!0,value:f.name,maxLength:60,placeholder:o("environmentCenter.namePlaceholder"),onChange:tt=>h(mt=>({...mt,name:tt.target.value}))})]}),a.jsxs("label",{className:"environment-field",children:[a.jsx("span",{children:o("common.description")}),a.jsx(xb,{className:"environment-description-input",size:"lg",rows:3,value:f.description,maxLength:180,placeholder:o("environmentCenter.descriptionPlaceholder"),onChange:tt=>h(mt=>({...mt,description:tt.target.value}))})]})]}),a.jsxs("label",{className:"environment-field environment-creation-method",children:[a.jsxs("span",{children:[o("environmentCenter.creationMethod"),a.jsx(of,{})]}),a.jsx(pa,{id:"environment-creation-method",value:m,options:c,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:tt=>{const mt=tt.value;g(mt),mt==="dockerfile"&&!b.trim()&&v(ee),Qe("")}}),a.jsx("small",{children:(vt=c.find(tt=>tt.value===m))==null?void 0:vt.description})]}),Ee?a.jsx("p",{className:"environment-form-error",role:"alert",children:Ee}):null,m==="custom"?a.jsxs("div",{className:"environment-configuration",children:[a.jsx("section",{className:"environment-section environment-form-section","aria-label":o("environmentCenter.baseConfiguration"),children:a.jsxs("div",{className:"environment-form-grid",children:[a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[o("environmentCenter.baseEnvironment"),a.jsx(of,{})]}),a.jsx(pa,{id:"environment-base-environment",value:f.baseEnvironment,options:mZt.map(tt=>({...tt,description:o(`environmentCenter.baseDescriptions.${tt.value}`)})),optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:tt=>{const mt=tt.value,Ne=mt==="aio-sandbox"||mt==="codex-sandbox";h(wt=>({...wt,baseEnvironment:mt,operatingSystem:Ne?"ubuntu-22.04":wt.operatingSystem,language:Ne?"python-3.12":wt.language}))}}),a.jsx("small",{children:o(`environmentCenter.baseDescriptions.${f.baseEnvironment}`)})]}),a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[o("environmentCenter.operatingSystem"),a.jsx(of,{})]}),a.jsx(pa,{id:"environment-operating-system",value:f.operatingSystem,options:yZt,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:f.baseEnvironment!=="ubuntu",triggerClassName:"environment-select-trigger",onChange:tt=>h(mt=>({...mt,operatingSystem:tt.value}))}),a.jsx("small",{children:f.baseEnvironment!=="ubuntu"?o("environmentCenter.fixedByBase",{base:IB(f.baseEnvironment),value:"Ubuntu 22.04"}):o("environmentCenter.selectUbuntuVersion")})]}),a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[o("environmentCenter.pythonVersion"),a.jsx(of,{})]}),a.jsx(pa,{id:"environment-python-version",value:f.language,options:f.baseEnvironment!=="ubuntu"?Zoe.filter(tt=>tt.value==="python-3.12"):Zoe,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:f.baseEnvironment!=="ubuntu",triggerClassName:"environment-select-trigger",onChange:tt=>h(mt=>({...mt,language:tt.value}))}),a.jsx("small",{children:f.baseEnvironment!=="ubuntu"?o("environmentCenter.fixedByBase",{base:IB(f.baseEnvironment),value:"Python 3.12"}):o("environmentCenter.selectPythonVersion")})]})]})}),a.jsxs("section",{className:"environment-section","aria-labelledby":"environment-skills-title",children:[a.jsx("h2",{id:"environment-skills-title",children:o("environmentCenter.skills")}),a.jsxs("div",{className:"environment-skill-grid",children:[a.jsx(Yoe,{name:"VeADK",description:o("environmentCenter.veadkDescription"),selected:W,disabled:je,onChange:G,icon:a.jsx("img",{src:hM,alt:""})}),a.jsx(yK,{selected:f.selectedSkills,onChange:tt=>h(mt=>({...mt,selectedSkills:tt})),cloudProvider:t,disabled:je,addLabel:o("environmentCenter.addSkill"),showSelectedCount:!1})]})]}),pH.map(tt=>a.jsxs("section",{className:"environment-section","aria-labelledby":`environment-${tt.id}-title`,children:[a.jsx("h2",{id:`environment-${tt.id}-title`,children:o(`environmentCenter.categories.${tt.id}`)}),a.jsx("div",{className:"environment-option-grid",children:tt.options.map(mt=>{const Ne=f.optionIds.includes(mt.id);return a.jsx(Yoe,{name:mt.label,description:o(`environmentCenter.options.${mt.id}`,{defaultValue:mt.description}),selected:Ne,onChange:wt=>Se(mt.id,wt),icon:a.jsx(TZt,{option:mt})},mt.id)})})]},tt.id))]}):m==="dockerfile"?a.jsxs("section",{className:"environment-upload","aria-label":o("environmentCenter.customDockerfile"),children:[a.jsx("div",{className:"environment-dockerfile-settings environment-form-grid",children:a.jsxs("label",{className:"environment-field",children:[a.jsx("span",{children:o("environmentCenter.presetEnvironment")}),a.jsx(pa,{id:"environment-dockerfile-base-environment",value:O,options:gZt(o),optionClassName:"environment-select-option",size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:tt=>{w(""),k(tt.value)}}),a.jsx("small",{children:o("environmentCenter.presetHint")})]})}),a.jsxs("div",{className:"environment-upload__preview",children:[a.jsxs("div",{children:[a.jsxs("h3",{children:["Dockerfile",a.jsx(of,{})]}),a.jsxs("div",{className:"environment-upload__actions",children:[a.jsx("span",{className:"environment-upload__size",children:o("environmentCenter.dockerfileSize",{size:w9e(be).toLocaleString(l.resolvedLanguage??l.language),max:131072 .toLocaleString(l.resolvedLanguage??l.language)})}),a.jsx("input",{ref:x,className:"environment-upload__file-input",type:"file",accept:".dockerfile,text/plain",tabIndex:-1,hidden:!0,onChange:tt=>{var Ne;const mt=tt.currentTarget;Xe((Ne=mt.files)==null?void 0:Ne[0]).finally(()=>{mt.value=""})}}),a.jsx(Tt,{className:"environment-upload__action",type:"button",color:"secondary",variant:"soft",size:"sm",pill:!1,disabled:je,onClick:()=>{var tt;return(tt=x.current)==null?void 0:tt.click()},children:o("environmentCenter.upload")}),a.jsx(Tt,{className:"environment-upload__action",type:"button",color:"secondary",variant:"ghost",size:"sm",pill:!1,disabled:je||!ie,onClick:ye,children:o("environmentCenter.reset")})]})]}),a.jsxs("div",{className:`environment-dockerfile-editor${Y?" has-fixed-base":""}${ue?" is-invalid":""}`,children:[Y?a.jsxs("div",{className:"environment-dockerfile-from","aria-label":o("environmentCenter.dockerfileBaseImage"),children:[a.jsx("span",{className:"environment-dockerfile-from__line","aria-hidden":"true",children:"1"}),a.jsxs("code",{children:[a.jsx("span",{className:"environment-dockerfile-from__keyword",children:"FROM"}),a.jsx("span",{title:X,children:X})]})]}):null,a.jsx("div",{className:"environment-dockerfile__editor environment-upload__editor","aria-label":o("environmentCenter.dockerfileContent"),children:a.jsx(NT,{value:ie,path:"Dockerfile",lineNumberStart:Y?2:1,height:"auto",minHeight:"28px",maxHeight:"var(--environment-dockerfile-editor-max-height)",onChange:qe})})]})]}),ue?a.jsx("p",{className:"environment-upload__error environment-upload__error--below",role:"alert",children:ue}):null]}):m==="git"?a.jsxs("div",{className:"environment-source-workflow",children:[a.jsx(DZt,{repositoryUrl:S,gitRef:E,dockerfilePath:T,inspection:A,inspectedKey:P,disabled:je,onRepositoryUrlChange:C,onGitRefChange:j,onDockerfilePathChange:R,onInspectionChange:N,onInspectedKeyChange:I}),a.jsx(MZt,{cloudProvider:t,mode:D,region:L,value:M,disabled:je,onModeChange:tt=>{_(tt),Qe("")},onRegionChange:tt=>{F(tt),z(void 0),Qe("")},onChange:z})]}):a.jsx(LZt,{cloudProvider:t,region:q,repository:J,reference:Z,disabled:je,onRegionChange:tt=>{U(tt),V(void 0),Qe("")},onRepositoryChange:V,onReferenceChange:ne})]})})})}function j9e({cloudProvider:e="volcengine",onWorkspace:t,onProjects:n,clipboardImport:i=null,clipboardReadError:r=""}){const{t:s,i18n:o}=Te("ui"),[l,c]=p.useState([]),[u,d]=p.useState({kind:"list"}),[f,h]=p.useState(""),[m,g]=p.useState(null),[b,v]=p.useState(null),[y,w]=p.useState(null),[x,O]=p.useState(null),[k,S]=p.useState(null),C=p.useRef(0),[E,j]=p.useState(""),[T,R]=p.useState(!1),[A,N]=p.useState(r),[P,I]=p.useState(!0),[D,_]=p.useState(""),[L,F]=p.useState(0),[M,z]=p.useState(()=>new Set),q=p.useDeferredValue(f),U=p.useMemo(()=>{const Y=q.trim().toLocaleLowerCase();return Y?l.filter(X=>`${X.name} ${X.description} ${RB(X.operatingSystem)} ${Fp(X.language)} ${IB(X.baseEnvironment)}`.toLocaleLowerCase().includes(Y)):l},[q,l]),J=p.useCallback((Y="",X=!1)=>{C.current+=1,S({key:C.current,initialValue:Y,autoInspect:X})},[]),V=p.useCallback((Y,X=!1)=>{const ie=Y.trim();if(!ie.startsWith("akenv://")||!X&&Joe.has(ie))return!1;const ee=Iz(ie);return!ee.length||ee.length>X7?!1:(Joe.add(ie),N(""),J(ie,!0),!0)},[J]),Z=p.useCallback(async()=>{var Y;if(!(u.kind!=="list"||k)){if(typeof navigator>"u"||!((Y=navigator.clipboard)!=null&&Y.readText)){N(s("environmentCenter.clipboardUnsupported"));return}try{const X=await navigator.clipboard.readText();!V(X)&&!X.trim()&&await wZt()&&N(s("environmentCenter.clipboardReadError"))}catch{N(s("environmentCenter.clipboardReadError"))}}},[k,V,s,u.kind]);p.useEffect(()=>{const Y=new AbortController;return l.length===0&&I(!0),_(""),DA(Y.signal).then(X=>{c(X)}).catch(X=>{(X==null?void 0:X.name)!=="AbortError"&&(xZt(X)?(c([]),R(!1),j(s("environmentCenter.storageUnavailable"))):_(X instanceof Error?X.message:String(X)))}).finally(()=>{Y.signal.aborted||I(!1)}),()=>Y.abort()},[L]),p.useEffect(()=>{if(!l.some(X=>X.latestVersion&&Dy.has(X.latestVersion.status)))return;const Y=window.setTimeout(()=>F(X=>X+1),2500);return()=>window.clearTimeout(Y)},[l]),p.useEffect(()=>{if(!E||T)return;const Y=window.setTimeout(()=>j(""),2800);return()=>window.clearTimeout(Y)},[T,E]),p.useEffect(()=>{r&&N(r)},[r]),p.useEffect(()=>{i&&V(i.text)},[i,V]),p.useEffect(()=>{if(u.kind!=="list")return;const Y=()=>void Z(),X=()=>{document.visibilityState==="visible"&&Z()},ie=ee=>{var pe;const be=ee.target;if(be instanceof HTMLInputElement||be instanceof HTMLTextAreaElement||be instanceof HTMLElement&&be.isContentEditable)return;const ue=((pe=ee.clipboardData)==null?void 0:pe.getData("text/plain"))??"";V(ue,!0)&&ee.preventDefault()};return window.addEventListener("focus",Y),document.addEventListener("visibilitychange",X),window.addEventListener("paste",ie),()=>{window.removeEventListener("focus",Y),document.removeEventListener("visibilitychange",X),window.removeEventListener("paste",ie)}},[V,Z,u.kind]);const ne=u.kind==="editor"&&u.environmentId?l.find(Y=>Y.id===u.environmentId):void 0,W=async Y=>{const X={...Y,dockerfile:Y.dockerfile??mH(Y,e)},ie=ne?await GTe(ne.id,X):await KTe(X);if(c(ee=>[ie,...ee.filter(be=>be.id!==ie.id)]),d({kind:"list"}),R(!1),X.imageSource){j(s("environmentCenter.status.boundImage",{name:ie.name}));return}try{const ee=await U8(ie.id);c(be=>be.map(ue=>ue.id===ie.id?{...ue,latestVersion:ee}:ue)),j(s("environmentCenter.status.queued",{name:ie.name}))}catch(ee){R(!0),j(s("environmentCenter.status.savedBuildFailed",{error:ee instanceof Error?ee.message:String(ee)}))}},G=async Y=>{if(!M.has(Y.id)){z(X=>new Set(X).add(Y.id)),R(!1);try{const X=await U8(Y.id);c(ie=>ie.map(ee=>ee.id===Y.id?{...ee,latestVersion:X}:ee)),j(s("environmentCenter.status.queued",{name:Y.name}))}catch(X){R(!0),j(X instanceof Error?X.message:String(X))}finally{z(X=>{const ie=new Set(X);return ie.delete(Y.id),ie})}}},H=(Y,X,ie,ee)=>{Y.length&&c(be=>{const ue=new Set(Y.map(pe=>pe.id));return[...Y,...be.filter(pe=>!ue.has(pe.id))]}),R(ee>0),j(ee>0?s("environmentCenter.status.importedFailed",{created:X,failed:ee}):ie>0?s("environmentCenter.status.importedDuplicate",{created:X,duplicate:ie}):s("environmentCenter.status.imported",{count:X}))},se=m?a.jsx(Ad,{title:s("environmentCenter.deleteTitle"),description:s("environmentCenter.deleteDescription",{name:m.name}),confirmLabel:s("common.delete"),variant:"danger",onCancel:()=>g(null),onConfirm:()=>{const Y=m;g(null),d({kind:"list"}),XTe(Y.id).then(()=>{c(X=>X.filter(ie=>ie.id!==Y.id)),R(!1),j(s("environmentCenter.status.deleted",{name:Y.name}))}).catch(X=>{R(!0),j(X instanceof Error?X.message:String(X))})}}):null;return u.kind==="editor"?a.jsxs(a.Fragment,{children:[a.jsx(BZt,{environment:ne,cloudProvider:e,onCancel:()=>d({kind:"list"}),onDelete:ne?()=>g(ne):void 0,onShare:ne?()=>O(ne):void 0,onSave:W},u.environmentId??"new"),x?a.jsx($Zt,{environment:x,onClose:()=>O(null)}):null,se]}):a.jsxs(gK,{section:"environments",className:"environment-center",onWorkspace:t,onProjects:n,actions:a.jsxs(a.Fragment,{children:[E?a.jsx("span",{className:`environment-status${T?" is-error":""}`,role:T?"alert":"status","aria-live":"polite",children:E}):null,a.jsx(em,{"aria-label":s("environmentCenter.search"),value:f,onChange:Y=>h(Y.target.value),placeholder:s("environmentCenter.search")})]}),children:[A?a.jsxs("div",{className:"environment-clipboard-notice",role:"alert",children:[a.jsx("span",{children:A}),a.jsx(Tt,{type:"button",color:"secondary",variant:"soft",size:"sm",onClick:()=>{N(""),J()},children:s("environmentCenter.manualImport")})]}):null,a.jsx(tm,{"aria-live":"polite",children:P?a.jsx(cl,{}):D?a.jsxs("div",{className:"environment-load-error",role:"alert",children:[a.jsx("p",{children:Eo(D,o.resolvedLanguage||o.language)||s("environmentCenter.loadFailed")}),a.jsx(Tt,{color:"secondary",variant:"soft",size:"sm",onClick:()=>F(Y=>Y+1),children:s("common.reload")})]}):U.length===0&&f.trim()?a.jsx("div",{className:"environment-empty",children:a.jsxs(Hn,{fill:"none",children:[a.jsx(Hn.Icon,{children:a.jsx(CZt,{})}),a.jsx(Hn.Title,{children:s("environmentCenter.noMatches")}),a.jsx(Hn.Description,{children:s("environmentCenter.tryAnotherName")})]})}):a.jsxs(V0,{children:[f.trim()?null:a.jsxs(a.Fragment,{children:[a.jsx(cb,{"aria-label":s("environmentCenter.create"),icon:a.jsx(kZt,{}),onClick:()=>d({kind:"editor",environmentId:null}),children:s("environmentCenter.create")}),a.jsx(cb,{"aria-label":s("environmentCenter.import.title"),icon:a.jsx(SZt,{}),onClick:()=>J(),children:s("environmentCenter.import.title")})]}),U.map(Y=>{var be,ue;const X=A9e(Y,s),ie=!!(Y.latestVersion&&Dy.has(Y.latestVersion.status)),ee=M.has(Y.id);return a.jsx(q0,{className:"environment-card",title:Y.name,status:a.jsx(Ya,{color:X.color,size:"sm",children:X.label}),description:((be=Y.latestVersion)==null?void 0:be.error)||(ie?(ue=Y.latestVersion)==null?void 0:ue.currentStep:"")||Y.description||s("common.noDescription"),metadata:[{label:s("workspace.updated"),value:jZt(Y.updatedAt,o.resolvedLanguage??o.language),title:NZt(Y.updatedAt,o.resolvedLanguage??o.language)}],action:{label:Y.latestVersion?s("environmentCenter.buildDetails.title"):s(ee?"environmentCenter.buildDetails.starting":"environmentCenter.startBuild"),icon:"play",title:s("environmentCenter.build"),disabled:ee,onClick:()=>Y.latestVersion?v(Y.id):void G(Y)},auxiliaryAction:{label:s("environmentCenter.manifest.view"),icon:a.jsx(sat,{}),title:Y.latestVersion?s("environmentCenter.manifest.viewShort"):s("environmentCenter.manifest.unavailable"),disabled:!Y.latestVersion,onClick:()=>w(Y)},detailAction:{label:s("environmentCenter.configure"),onClick:()=>d({kind:"editor",environmentId:Y.id})}},Y.id)})]})}),b?(()=>{const Y=l.find(X=>X.id===b);return Y?a.jsx(PZt,{environment:Y,onClose:()=>v(null),onBuildUpdate:X=>{c(ie=>ie.map(ee=>ee.id===Y.id?{...ee,latestVersion:X}:ee))},onRebuild:()=>G(Y)}):null})():null,y!=null&&y.latestVersion?a.jsx(IZt,{environment:y,onClose:()=>w(null)}):null,se,k?a.jsx(FZt,{initialValue:k.initialValue,autoInspect:k.autoInspect,onClose:()=>S(null),onImported:H},k.key):null]})}function UZt(e){const t=e instanceof Error?e.message:String(e??"");return t.includes("HTTP 503")&&(t.includes("未配置持久化存储")||t.includes("storage is not configured"))}function QZt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function zZt(e){return a.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"4.5",y:"7",width:"23",height:"18",rx:"3"}),a.jsx("path",{d:"M10 7V5.5A1.5 1.5 0 0 1 11.5 4h4A1.5 1.5 0 0 1 17 5.5V7M9 13h5v5H9zM18 13h5M18 17h5M9 22h14"})]})}function Z7(e,t){const n=Date.parse(e);return Number.isNaN(n)?e:new Intl.DateTimeFormat(t,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(n)}function VZt(e,t){return e.environmentIds.reduce((n,i)=>{var r,s;return((s=(r=t.get(i))==null?void 0:r.latestVersion)==null?void 0:s.status)==="available"?n+1:n},0)}function HZt({workspace:e,environments:t,onBack:n,onSave:i,onDelete:r}){const{t:s,i18n:o}=Te("ui"),[l,c]=p.useState((e==null?void 0:e.name)??""),[u,d]=p.useState((e==null?void 0:e.description)??""),[f,h]=p.useState((e==null?void 0:e.environmentIds)??[]),[m,g]=p.useState(""),[b,v]=p.useState(!1),[y,w]=p.useState(""),x=m.trim().toLocaleLowerCase(),O=t.filter(S=>`${S.name} ${S.description} ${Fp(S.language)}`.toLocaleLowerCase().includes(x)),k=async S=>{if(S.preventDefault(),!(!l.trim()||b)){v(!0),w("");try{await i({name:l.trim(),description:u.trim(),environmentIds:f})}catch(C){w(C instanceof Error?C.message:String(C)),v(!1)}}};return a.jsx(Oh,{className:"workspace-center","aria-label":s(e?"workspace.detail":"workspace.create"),children:a.jsxs(nT,{title:e?e.name:s("workspace.create"),description:s("workspace.editorDescription"),identitySeed:(e==null?void 0:e.name)||s("workspace.create"),backLabel:s("workspace.backToList"),onBack:n,actions:a.jsxs(a.Fragment,{children:[r?a.jsx("button",{type:"button",className:"is-danger",onClick:r,children:s("common.delete")}):null,a.jsx("button",{type:"submit",form:"workspace-form",disabled:b||!l.trim(),children:s(b?"common.saving":"common.save")})]}),children:[e?a.jsxs(bH,{children:[a.jsxs("div",{children:[a.jsx("dt",{children:s("common.environment")}),a.jsx("dd",{children:s("workspace.environmentCount",{count:f.length})})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("workspace.createdAt")}),a.jsx("dd",{children:Z7(e.createdAt,o.resolvedLanguage??o.language)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("workspace.updatedAt")}),a.jsx("dd",{children:Z7(e.updatedAt,o.resolvedLanguage??o.language)})]})]}):null,a.jsxs("form",{id:"workspace-form",className:"workspace-form",onSubmit:k,children:[a.jsxs("section",{className:"workspace-fields","aria-label":s("workspace.basicInfo"),children:[a.jsxs("label",{children:[a.jsx("span",{children:s("common.name")}),a.jsx(_s,{value:l,maxLength:128,autoFocus:!0,onChange:S=>c(S.target.value),placeholder:s("workspace.namePlaceholder")})]}),a.jsxs("label",{children:[a.jsx("span",{children:s("common.description")}),a.jsx(xb,{value:u,maxLength:2e3,onChange:S=>d(S.target.value),placeholder:s("workspace.descriptionPlaceholder")})]})]}),a.jsxs("section",{className:"workspace-environments",children:[a.jsx(XIe,{title:s("common.environment"),description:s("workspace.selectedEnvironmentCount",{count:f.length}),actions:a.jsx(em,{"aria-label":s("workspace.searchAvailableEnvironments"),value:m,onChange:S=>g(S.target.value),placeholder:s("workspace.searchEnvironments")})}),t.length===0?a.jsxs("div",{className:"workspace-environment-empty",children:[a.jsx("p",{children:s("workspace.noAvailableEnvironments")}),a.jsx("span",{children:s("workspace.createEnvironmentFirst")})]}):O.length===0?a.jsxs("div",{className:"workspace-environment-empty",children:[a.jsx("p",{children:s("workspace.noMatchingEnvironments")}),a.jsx("span",{children:s("workspace.tryAnotherName")})]}):a.jsx("div",{className:"workspace-environment-list",children:O.map(S=>{var j;const C=f.includes(S.id),E=((j=S.latestVersion)==null?void 0:j.status)==="available"?s("workspace.environmentStatus.available"):S.latestVersion?s("workspace.environmentStatus.building"):s("workspace.environmentStatus.notBuilt");return a.jsxs("label",{className:`workspace-environment-option${C?" is-selected":""}`,children:[a.jsx("input",{type:"checkbox",checked:C,onChange:()=>h(T=>C?T.filter(R=>R!==S.id):[...T,S.id])}),a.jsxs("span",{className:"workspace-environment-option__copy",children:[a.jsx("strong",{title:S.name,children:S.name}),a.jsxs("span",{children:[Fp(S.language)," · ",E]})]}),a.jsx("span",{className:"workspace-environment-option__action",children:s(C?"workspace.added":"common.add")})]},S.id)})})]}),y?a.jsx("p",{className:"workspace-form-error",role:"alert",children:y}):null]})]})})}function qZt({onEnvironment:e,onProjects:t}){const{t:n,i18n:i}=Te("ui"),[r,s]=p.useState([]),[o,l]=p.useState([]),[c,u]=p.useState({kind:"list"}),[d,f]=p.useState(""),[h,m]=p.useState(!0),[g,b]=p.useState(""),[v,y]=p.useState(""),[w,x]=p.useState(!1),[O,k]=p.useState(null),[S,C]=p.useState(0),E=p.useDeferredValue(d);p.useEffect(()=>{const A=new AbortController;return m(!0),b(""),Promise.all([Mz(A.signal),DA(A.signal)]).then(([N,P])=>{s(N),l(P)}).catch(N=>{(N==null?void 0:N.name)!=="AbortError"&&(UZt(N)?(s([]),l([]),x(!1),y(n("workspace.storageUnavailable"))):(console.warn("Unable to load Studio workspaces",N),b(n("workspace.loadFailed"))))}).finally(()=>{A.signal.aborted||m(!1)}),()=>A.abort()},[S,n]),p.useEffect(()=>{if(!v||w)return;const A=window.setTimeout(()=>y(""),2800);return()=>window.clearTimeout(A)},[w,v]);const j=p.useMemo(()=>new Map(o.map(A=>[A.id,A])),[o]),T=p.useMemo(()=>{const A=E.trim().toLocaleLowerCase();return A?r.filter(N=>{const P=N.environmentIds.map(I=>{var D;return((D=j.get(I))==null?void 0:D.name)??""}).join(" ");return`${N.name} ${N.description} ${P}`.toLocaleLowerCase().includes(A)}):r},[E,j,r]),R=c.kind==="detail"&&c.workspaceId?r.find(A=>A.id===c.workspaceId):void 0;return c.kind==="detail"?a.jsx(HZt,{workspace:R,environments:o,onBack:()=>u({kind:"list"}),onDelete:R?()=>k(R):null,onSave:async A=>{const N=R?await UTe(R.id,A):await BTe(A);s(P=>[N,...P.filter(I=>I.id!==N.id)]),x(!1),y(n("workspace.saved",{name:N.name})),u({kind:"list"})}},c.workspaceId??"new"):a.jsxs(gK,{section:"workspaces",onEnvironment:e,onProjects:t,actions:a.jsxs(a.Fragment,{children:[v?a.jsx("span",{className:`workspace-status${w?" is-error":""}`,role:w?"alert":"status","aria-live":"polite",children:v}):null,a.jsx(em,{"aria-label":n("workspace.searchWorkspaces"),value:d,onChange:A=>f(A.target.value),placeholder:n("workspace.searchWorkspaces")})]}),children:[a.jsx(tm,{"aria-live":"polite",children:h?a.jsx(cl,{}):g?a.jsxs("div",{className:"workspace-load-error",role:"alert",children:[a.jsx("p",{children:g}),a.jsx(Tt,{color:"secondary",variant:"soft",size:"sm",onClick:()=>C(A=>A+1),children:n("common.reload")})]}):T.length===0&&d.trim()?a.jsx("div",{className:"workspace-empty",children:a.jsxs(Hn,{fill:"none",children:[a.jsx(Hn.Icon,{children:a.jsx(zZt,{})}),a.jsx(Hn.Title,{children:n("workspace.noMatchingWorkspaces")}),a.jsx(Hn.Description,{children:n("workspace.tryAnotherNameOrEnvironment")})]})}):a.jsxs(V0,{children:[d.trim()?null:a.jsx(cb,{"aria-label":n("workspace.create"),icon:a.jsx(QZt,{}),onClick:()=>u({kind:"detail",workspaceId:null}),children:n("workspace.create")}),T.map(A=>{const N=VZt(A,j),P=A.environmentIds.filter(I=>!j.has(I)).length;return a.jsx(q0,{className:"workspace-card",title:A.name,status:a.jsx(Ya,{color:P?"danger":N===A.environmentIds.length&&N>0?"success":"secondary",size:"sm",children:A.environmentIds.length===0?n("workspace.noEnvironmentAdded"):P?n("workspace.environmentMissing"):n("workspace.availableFraction",{available:N,total:A.environmentIds.length})}),description:A.description||n("common.noDescription"),metadata:[{label:n("common.environment"),value:n("workspace.environmentCount",{count:A.environmentIds.length})},{label:n("workspace.available"),value:n("workspace.availableCount",{count:N})},{label:n("workspace.updated"),value:Z7(A.updatedAt,i.resolvedLanguage??i.language)}],detailAction:{label:n("common.manage"),onClick:()=>u({kind:"detail",workspaceId:A.id})},action:{label:n("workspace.addEnvironment"),icon:"plus",onClick:()=>u({kind:"detail",workspaceId:A.id})}},A.id)})]})}),O?a.jsx(Ad,{title:n("workspace.deleteTitle"),description:n("workspace.deleteDescription",{name:O.name}),confirmLabel:n("common.delete"),variant:"danger",onCancel:()=>k(null),onConfirm:()=>{const A=O;k(null),QTe(A.id).then(()=>{s(N=>N.filter(P=>P.id!==A.id)),x(!1),y(n("workspace.deleted",{name:A.name})),u({kind:"list"})}).catch(N=>{x(!0),y(N instanceof Error?N.message:String(N))})}}):null]})}function WZt({cloudProvider:e,onProjects:t,initialSection:n="workspaces"}){const[i,r]=p.useState(n),{t:s}=Te("ui"),[o,l]=p.useState(null),[c,u]=p.useState(""),d=p.useRef(0),f=()=>{var g;d.current+=1;const h=d.current;u("");let m=null;if(typeof navigator<"u"&&((g=navigator.clipboard)!=null&&g.readText))try{m=navigator.clipboard.readText()}catch{u(s("workspace.clipboardPermissionError"))}else u(s("workspace.clipboardUnsupported"));r("environments"),m&&m.then(async b=>{var v;if(d.current===h){if(b.trim()){l({key:h,text:b});return}try{const y=await((v=navigator.permissions)==null?void 0:v.query({name:"clipboard-read"}));d.current===h&&(y==null?void 0:y.state)==="denied"&&u(s("workspace.clipboardPermissionError"))}catch{}}}).catch(()=>{d.current===h&&u(s("workspace.clipboardPermissionError"))})};return i==="environments"?a.jsx(j9e,{cloudProvider:e,onWorkspace:()=>r("workspaces"),onProjects:t,clipboardImport:o,clipboardReadError:c}):a.jsx(qZt,{onEnvironment:f,onProjects:t})}const KZt={id:"mpa-channels",kind:"mpa-channels",category:"channels",icon:"mpa-channels",name:"MPA agent messaging channels",description:"Connect an existing MPA agent to Feishu, WeCom and DingTalk."};function GZt(e){return e==="127.0.0.1"}const XZt={id:"coding-agents",kind:"coding-agent",category:"development",icon:"coding-agents",name:"Configure coding agents",badge:"Local",badgeTone:"success",description:"Install built-in VeADK and AgentKit skills globally for Trae, Claude Code, or Codex."},YZt={id:"feishu",kind:"feishu",category:"channels",icon:"feishu",name:"Feishu bot",badge:"Beta",description:"Create a Feishu bot and connect its messages directly to AgentKit Runtime."},ZZt={id:"gitlab-review",kind:"gitlab",category:"development",icon:"gitlab",name:"GitLab MR review",description:"Use a GitLab integration to review merge requests in an isolated Sandbox."};yn.hasResourceBundle("en-US","automations")||yn.addResourceBundle("en-US","automations",xfe,!0,!0);yn.hasResourceBundle("zh-CN","automations")||yn.addResourceBundle("zh-CN","automations",C0e,!0,!0);function Eh(e,t={}){return yn.t(e,{...t,ns:"automations"})}const N9e={name:"repository",label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL",required:!0},R9e={name:"baseBranch",label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base",required:!1},I9e={name:"runtimeName",label:"Runtime name",placeholder:"support-agent",help:"Used by the AgentKit delivery configuration",required:!0},P9e={name:"runtimeId",label:"Runtime ID",placeholder:"rt-xxxxxxxx",help:"The AgentKit Runtime that will receive continuous updates",required:!0},JZt="https://ark.cn-beijing.volces.com/api/coding/v3";function eJt(e){return e==="byteplus"?Do(e):JZt}function xK(e){return e==="byteplus"?{accessKey:"BYTEPLUS_ACCESS_KEY",secretKey:"BYTEPLUS_SECRET_KEY",sessionToken:"BYTEPLUS_SESSION_TOKEN"}:{accessKey:"VOLCENGINE_ACCESS_KEY",secretKey:"VOLCENGINE_SECRET_KEY",sessionToken:"VOLCENGINE_SESSION_TOKEN"}}function D9e(e){const t=xK(e);return[Eh("github.secretPair",{accessKey:t.accessKey,secretKey:t.secretKey}),Eh("github.sessionToken",{sessionToken:t.sessionToken})]}function wK(e){return e==="byteplus"?"BytePlus":"Volcengine"}function OK(e,t={}){return{repository:"",baseBranch:"main",projectPath:".",runtimeName:"",runtimeId:"",modelName:"",modelBaseUrl:eJt(e),region:Zi(e),token:"",...t}}function M9e(e){return{repository:e.repository.trim(),baseBranch:e.baseBranch.trim()||"main",region:e.region,token:e.token.trim()}}const tJt={id:"review",kind:"github",category:"development",icon:"github",name:"Automated PR review",description:"Use a GitHub App to review pull requests in an isolated Sandbox.",title:"Automated PR review",subtitle:"Trigger Sandbox reviews through the GitHub App and publish results to pull requests",panel:"Install the GitHub App to target repositories, then enable automated review for each repository.",submitLabel:"Install GitHub App",fields:[],initialValues:({cloudProvider:e})=>OK(e),regionHelp:"",secrets:()=>[],async submit(){throw new Error("PR 自动评审已切换为 GitHub App 授权模式。")}},nJt="https://api.github.com",iJt=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,nle=/^[A-Za-z0-9][A-Za-z0-9._/-]{0,199}$/,rJt=/^[A-Za-z0-9._/-]+$/;function sJt(e,t,n){const i=String((t==null?void 0:t.message)||"");return e===403&&/workflow/i.test(i)?"GitHub Token 缺少 Workflows 写权限,无法创建或更新 .github/workflows 下的文件":e===401||e===403?Q("github.invalidToken"):e===404?Q("github.notFound"):e===422?Q("github.rejectedCommit"):i.split(n).join("***").trim().slice(0,240)||Q("github.requestFailed",{status:e})}async function ey(e,t){const n={Accept:"application/vnd.github+json",Authorization:`Bearer ${t.token}`,"X-GitHub-Api-Version":"2022-11-28"};t.body&&(n["Content-Type"]="application/json");let i;try{i=await fetch(`${nJt}${e}`,{method:t.method||"GET",headers:n,body:t.body?JSON.stringify(t.body):void 0,signal:t.signal})}catch(s){throw t.signal.aborted?s:new Error(Q("github.networkFailed"))}const r=await i.json().catch(()=>null);if(!t.expected.includes(i.status))throw new Error(sJt(i.status,r,t.token));return{status:i.status,payload:r}}function y6(e){return e.split("/").map(encodeURIComponent).join("/")}function aJt(e){const t=new TextEncoder().encode(e);let n="";const i=32768;for(let r=0;r({...h,path:SK(h.path,"")})),s=AbortSignal.any([t,AbortSignal.timeout(6e4)]),o=`/repos/${n}`;await ey(`${o}`,{token:e.token,expected:[200],signal:s});const c=(f=(await ey(`${o}/git/ref/heads/${y6(i)}`,{token:e.token,expected:[200],signal:s})).payload.object)==null?void 0:f.sha;if(!c)throw new Error(Q("github.missingBaseSha"));const u=oJt(e.branchPrefix);await ey(`${o}/git/refs`,{token:e.token,expected:[201],signal:s,method:"POST",body:{ref:`refs/heads/${u}`,sha:c}});let d=!0;try{for(const m of r){const g=y6(m.path),b=await ey(`${o}/contents/${g}?ref=${encodeURIComponent(i)}`,{token:e.token,expected:[200,404],signal:s});if(m.mustBeNew&&b.status===200)throw new Error(Q("github.fileAlreadyExists",{path:m.path}));if(b.status===200&&!b.payload.sha)throw new Error(Q("github.pathNotUpdatable",{path:m.path}));await ey(`${o}/contents/${g}`,{token:e.token,expected:[200,201],signal:s,method:"PUT",body:{message:m.commitMessage,content:aJt(m.content),branch:u,...b.payload.sha?{sha:b.payload.sha}:{}}})}const h=await ey(`${o}/pulls`,{token:e.token,expected:[201],signal:s,method:"POST",body:{title:e.title,head:u,base:i,body:e.description}});if(!h.payload.number||!h.payload.html_url)throw new Error(Q("github.invalidPullRequest"));return d=!1,{number:h.payload.number,url:h.payload.html_url,branch:u}}finally{d&&await ey(`${o}/git/refs/heads/${y6(u)}`,{token:e.token,expected:[204],signal:AbortSignal.timeout(15e3),method:"DELETE"}).catch(()=>{})}}async function lJt(e,t){const n=await vn("/web/github/pull-request-reviews",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e),signal:t});if(!n.ok)throw await QT(n);const i=await n.json();if(i.status!=="started"||typeof i.sessionId!="string"||!i.sessionId||typeof i.displayName!="string")throw new Error("PR 评审服务返回了无效结果。");return i}async function cJt(e){const t=await vn("/web/github/app/config",{method:"GET",headers:{Accept:"application/json"},signal:e});if(!t.ok)throw await QT(t);const n=await t.json();if(typeof n.configured!="boolean"||typeof n.appSlug!="string"||typeof n.installUrl!="string"||typeof n.reason!="string")throw new Error("GitHub App 配置响应格式无效。");return n}async function uJt(e,t){var s;const n=new URLSearchParams({page:String(t.page),pageSize:String(t.pageSize)});(s=t.query)!=null&&s.trim()&&n.set("q",t.query.trim());const i=await vn(`/web/github/app/repositories?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await QT(i);const r=await i.json();if(!Array.isArray(r.repositories)||typeof r.page!="number"||typeof r.pageSize!="number"||typeof r.hasNextPage!="boolean"||typeof r.reviewSettingsConfigured!="boolean"||typeof r.reviewSettingsReason!="string"||r.repositories.some(o=>typeof o!="object"||o===null||typeof o.installationId!="number"||typeof o.account!="string"||typeof o.fullName!="string"||typeof o.htmlUrl!="string"||typeof o.private!="boolean"||typeof o.reviewEnabled!="boolean"))throw new Error("GitHub App 仓库列表响应格式无效。");return r}async function dJt(e,t){const n=new URLSearchParams({page:String(t.page),pageSize:String(t.pageSize)}),i=await vn(`/web/github/app/review-records?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await QT(i);const r=await i.json();if(!Array.isArray(r.records)||typeof r.page!="number"||typeof r.pageSize!="number"||typeof r.hasNextPage!="boolean"||typeof r.reviewSettingsConfigured!="boolean"||typeof r.reviewSettingsReason!="string"||r.records.some(s=>typeof s!="object"||s===null||typeof s.id!="string"||typeof s.repository!="string"||typeof s.pullRequestUrl!="string"||typeof s.pullRequestNumber!="number"||!["started","completed","ignored","failed"].includes(String(s.status))||!["manual","webhook"].includes(String(s.trigger))||typeof s.createdAt!="string"||typeof s.deliveryId!="string"||typeof s.action!="string"||typeof s.sessionId!="string"||typeof s.displayName!="string"||typeof s.reason!="string"))throw new Error("PR 评审记录响应格式无效。");return r}async function fJt(e,t){const n=await vn("/web/github/app/review-repositories",{method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e),signal:t});if(!n.ok)throw await QT(n);const i=await n.json();if(!Array.isArray(i.repositories)||i.repositories.some(r=>typeof r!="string"))throw new Error("GitHub App 评审仓库保存响应格式无效。");return i.repositories}async function QT(e){const t=await e.text().catch(()=>"");try{const n=JSON.parse(t),i=typeof n.detail=="object"&&n.detail?n.detail.message:n.detail??n.message??n.error,r=typeof i=="string"?i:"";return new Error(r||`PR 评审发起失败(HTTP ${e.status})`)}catch{return new Error(t||`PR 评审发起失败(HTTP ${e.status})`)}}const hJt=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/,pJt="cn-hongkong";function mJt(e){const t=rv(e.runtimeName,n=>Eh(`github.validation.runtimeName.${n}`));if(t)throw new Error(t);if(!hJt.test(e.runtimeId))throw new Error(Eh("github.validation.runtimeId"))}function $9e(e){mJt(e);const t=e.cloudProvider??"volcengine",n=xK(t),i=t==="byteplus"?` +`).replace(/^\n+/,"")}function nR(e,t){const n=`FROM ${e.trim()}`,i=DL(t).replace(/^\n+/,"");return i?`${n} +${i}`:n}function cZt(e,t,n){return t.trim()?/^\s*FROM(?:\s|$)/im.test(e)?Tw("duplicateFrom",n):vK(nR(t,e),void 0,n):Tw("baseImageRequired",n)}function vK(e,t=w9e(e),n){return t>x9e?Tw("tooLarge",n):e.trim()?/^\s*FROM\s+\S+/im.test(e)?"":Tw("missingFrom",n):Tw("empty",n)}async function uZt(e,t){if(e.size>x9e)return{content:"",error:Tw("tooLarge",t)};const n=DL(await e.text());return{content:n,error:vK(n,e.size,t)}}function dZt(e){return qM(e,{lineWidth:0})}function fZt(e){return[{value:"auto",label:e("deploymentResources.mode.auto"),description:e("deploymentResources.mode.autoDescription"),badge:e("deploymentResources.mode.recommended")},{value:"create",label:e("deploymentResources.mode.create"),description:e("deploymentResources.mode.createDescription")},{value:"existing",label:e("deploymentResources.mode.existing"),description:e("deploymentResources.mode.existingDescription")}]}const O9e={tos:{mode:"auto"},cr:{mode:"auto"},codePipeline:{mode:"auto"}};function mp(e){const[t,n]=p.useState([]),[i,r]=p.useState(""),[s,o]=p.useState(1),[l,c]=p.useState(0),[u,d]=p.useState(!1),[f,h]=p.useState(!1),[m,g]=p.useState(null),[b,v]=p.useState(""),[y,w]=p.useState(""),[x,O]=p.useState(""),[k,S]=p.useState(0),C=p.useRef(!1),E=p.useRef(null),j=e?JSON.stringify(e):"",T=e?JSON.stringify({...e,search:y}):"";p.useEffect(()=>{const I=window.setTimeout(()=>{w(b.trim())},250);return()=>window.clearTimeout(I)},[b]),p.useEffect(()=>{v(""),w("")},[j]);const R=p.useCallback((I,D)=>{var F;if(!T)return;(F=E.current)==null||F.abort();const _=new AbortController;E.current=_;const L=JSON.parse(T);D&&n([]),C.current=!0,h(!0),g(null),jTe({...L,pageNumber:I,pageSize:100},_.signal).then(M=>{n(V=>{if(D)return M.items;const q=new Set(V.map(U=>`${U.id}\0${U.name}`));return[...V,...M.items.filter(U=>!q.has(`${U.id}\0${U.name}`))]}),r(M.serviceRegion),o(M.pageNumber),c(M.totalCount),d(M.hasMore),O(T)}).catch(M=>{M instanceof DOMException&&M.name==="AbortError"||(O(T),g(M instanceof Error?M.message:String(M)))}).finally(()=>{E.current===_&&(E.current=null,C.current=!1,h(!1))})},[T]);p.useEffect(()=>{var I;if(!T){(I=E.current)==null||I.abort(),E.current=null,C.current=!1,n([]),r(""),o(1),c(0),d(!1),O(""),h(!1),g(null);return}return R(1,!0),()=>{var D;return(D=E.current)==null?void 0:D.abort()}},[R,T,k]);const A=!!T&&x===T&&b.trim()===y,N=p.useCallback(()=>{O(""),S(I=>I+1)},[]),P=p.useCallback(()=>{!A||C.current||!u||R(s+1,!1)},[u,R,s,A]);return{items:t,serviceRegion:i,totalCount:l,hasMore:A?u:!1,loading:!!T&&(!A||f),error:m,search:b,setSearch:v,reload:N,loadMore:P}}function hZt(e,t){return e.map(n=>({value:n[t],label:n.name,description:[n.status,n.region,n.id].filter(Boolean).join(" · ")}))}function gp({ariaLabel:e,value:t,valueLabel:n,state:i,disabled:r,disabledMessage:s,valueField:o="id",onChange:l}){const{t:c}=Te("ui"),u=p.useMemo(()=>hZt(i.items,o),[i.items,o]);return a.jsxs("div",{className:"pp-resource-picker",children:[a.jsx(vf,{ariaLabel:e,value:t,valueLabel:n,placeholder:i.loading?c("common.loading"):c("deploymentResources.selectExisting"),options:u,disabled:r||!!i.error,searchValue:i.search,searchPlaceholder:c("deploymentResources.searchResource"),loading:i.loading,hasMore:i.hasMore,emptyMessage:i.search.trim()?c("deploymentResources.noMatch"):c("deploymentResources.noAvailable"),onSearchChange:i.setSearch,onLoadMore:i.loadMore,onChange:d=>{const f=i.items.find(h=>h[o]===d);f&&l(f)}}),s?a.jsx("span",{className:"pp-resource-status",children:s}):i.error?a.jsxs("div",{className:"pp-resource-error",role:"alert",children:[a.jsx("span",{children:i.error}),a.jsx("button",{type:"button",onClick:i.reload,children:c("common.retry")})]}):i.loading&&i.items.length===0?a.jsx("span",{className:"pp-resource-status","aria-live":"polite",children:i.search.trim()?c("deploymentResources.searching"):c("deploymentResources.loading")}):i.items.length===0?a.jsx("span",{className:"pp-resource-status",children:i.search.trim()?c("deploymentResources.noMatchSentence"):c("deploymentResources.noAvailableSentence")}):i.serviceRegion?a.jsx("span",{className:"pp-resource-status",children:c("deploymentResources.loadedSummary",{region:i.serviceRegion,loaded:i.items.length,total:i.totalCount>0?`/${i.totalCount}`:""})}):null]})}function k9e({region:e,value:t,disabled:n=!1,onChange:i}){const{t:r}=Te("ui"),s=mp(e?{kind:"cr-registry",region:e}:null),o=mp(e&&(t!=null&&t.registry)?{kind:"cr-namespace",region:e,registry:t.registry}:null),l=mp(e&&(t!=null&&t.registry)&&t.namespace?{kind:"cr-repository",region:e,registry:t.registry,namespace:t.namespace}:null),c=t??{region:e,registry:"",namespace:"",repository:""};return a.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three environment-repository-fields",children:[a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:r("deploymentResources.registryInstance")}),a.jsx(gp,{ariaLabel:r("deploymentResources.registryAriaLabel"),value:c.registry,valueLabel:c.registry,state:s,disabled:n||!e,valueField:"name",onChange:u=>i({region:e,registry:u.name,namespace:"",repository:""})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:r("deploymentResources.namespace")}),a.jsx(gp,{ariaLabel:r("deploymentResources.namespaceAriaLabel"),value:c.namespace,valueLabel:c.namespace,state:o,disabled:n||!c.registry,disabledMessage:c.registry?void 0:r("deploymentResources.selectRegistryFirst"),valueField:"name",onChange:u=>i({...c,region:e,namespace:u.name,repository:""})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:r("deploymentResources.repository")}),a.jsx(gp,{ariaLabel:r("deploymentResources.existingRepository"),value:c.repository,valueLabel:c.repository,state:l,disabled:n||!c.registry||!c.namespace,disabledMessage:c.registry?c.namespace?void 0:r("deploymentResources.selectNamespaceFirst"):r("deploymentResources.selectRegistryFirst"),valueField:"name",onChange:u=>i({...c,region:e,repository:u.name})})]})]})}function m6({resource:e,value:t,disabled:n,onChange:i}){const{t:r}=Te("ui");return a.jsxs("label",{className:"pp-resource-field pp-resource-mode",children:[a.jsx("span",{children:r("deploymentResources.configurationMode")}),a.jsx(vf,{ariaLabel:r("deploymentResources.configurationModeAriaLabel",{resource:e}),value:t,placeholder:r("deploymentResources.selectConfigurationMode"),options:fZt(r),disabled:n,onChange:s=>i(s)})]})}function Wv({label:e,value:t,placeholder:n,disabled:i,onChange:r}){return a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:e}),a.jsx("input",{value:t,placeholder:n,disabled:i,autoComplete:"off",onChange:s=>r(s.currentTarget.value)})]})}function g6({items:e,note:t}){const{t:n}=Te("ui");return a.jsxs("div",{className:"pp-resource-auto-names",children:[a.jsx("span",{children:n("deploymentResources.automaticNames")}),a.jsx("dl",{children:e.map(i=>a.jsxs("div",{children:[a.jsx("dt",{children:i.label}),a.jsx("dd",{title:i.name,children:i.name})]},i.label))}),t&&a.jsx("small",{children:t})]})}function S9e(e){var t,n,i,r,s,o,l,c;return e.tos.mode!=="auto"&&!((t=e.tos.bucket)!=null&&t.trim())?bn.t("ui:deploymentResources.validation.tos"):e.cr.mode!=="auto"&&(!((n=e.cr.instance)!=null&&n.trim())||!((i=e.cr.namespace)!=null&&i.trim())||!((r=e.cr.repository)!=null&&r.trim()))?bn.t("ui:deploymentResources.validation.cr"):e.codePipeline.mode!=="auto"&&(!((s=e.codePipeline.workspaceName)!=null&&s.trim())||!((o=e.codePipeline.pipelineName)!=null&&o.trim()))?bn.t("ui:deploymentResources.validation.codePipeline"):e.codePipeline.mode==="existing"&&(!((l=e.codePipeline.workspaceId)!=null&&l.trim())||!((c=e.codePipeline.pipelineId)!=null&&c.trim()))?bn.t("ui:deploymentResources.validation.existingCodePipeline"):null}function E9e({value:e,agentName:t,runtimeName:n,region:i,disabled:r,validationError:s,onChange:o}){const{t:l}=Te("ui"),c=t.trim()||"agentkit-app",u=n.trim()||c,d=i&&i!=="cn-beijing"?l("deploymentResources.autoBucketWithRegion",{region:i.startsWith("cn-")?i.slice(3):i}):l("deploymentResources.autoBucket"),f=mp(e.tos.mode==="existing"?{kind:"tos-bucket",region:i}:null),h=mp(e.cr.mode==="existing"?{kind:"cr-registry",region:i}:null),m=mp(e.cr.mode==="existing"&&e.cr.instance?{kind:"cr-namespace",region:i,registry:e.cr.instance}:null),g=mp(e.cr.mode==="existing"&&e.cr.instance&&e.cr.namespace?{kind:"cr-repository",region:i,registry:e.cr.instance,namespace:e.cr.namespace}:null),b=mp(e.codePipeline.mode==="existing"?{kind:"cp-workspace",region:i}:null),v=mp(e.codePipeline.mode==="existing"&&e.codePipeline.workspaceId?{kind:"cp-pipeline",region:i,workspaceId:e.codePipeline.workspaceId}:null),y=w=>o({...e,...w});return a.jsxs("div",{className:"pp-resource-list",children:[a.jsxs("div",{className:"pp-resource-item",children:[a.jsx("div",{className:"pp-resource-name",children:l("deploymentResources.tosBucket")}),a.jsxs("div",{className:"pp-resource-grid",children:[a.jsx(m6,{resource:l("deploymentResources.tosBucket"),value:e.tos.mode,disabled:r,onChange:w=>y({tos:{mode:w}})}),e.tos.mode==="create"&&a.jsx(Wv,{label:l("deploymentResources.bucketName"),value:e.tos.bucket??"",placeholder:l("deploymentResources.bucketNamePlaceholder"),disabled:r,onChange:w=>y({tos:{...e.tos,bucket:w}})}),e.tos.mode==="existing"&&a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.existingBucket")}),a.jsx(gp,{ariaLabel:l("deploymentResources.existingTosBucket"),value:e.tos.bucket??"",valueLabel:e.tos.bucket,state:f,disabled:r,onChange:w=>y({tos:{...e.tos,bucket:w.name}})})]}),e.tos.mode==="auto"&&a.jsx(g6,{items:[{label:l("deploymentResources.bucket"),name:d}],note:l("deploymentResources.accountIdResolved")})]})]}),a.jsxs("div",{className:"pp-resource-item",children:[a.jsx("div",{className:"pp-resource-name",children:l("deploymentResources.containerRegistry")}),a.jsxs("div",{className:"pp-resource-grid",children:[a.jsx(m6,{resource:"CR",value:e.cr.mode,disabled:r,onChange:w=>y({cr:{mode:w}})}),e.cr.mode==="create"&&a.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three",children:[a.jsx(Wv,{label:l("deploymentResources.instanceName"),value:e.cr.instance??"",placeholder:l("deploymentResources.crInstance"),disabled:r,onChange:w=>y({cr:{...e.cr,instance:w}})}),a.jsx(Wv,{label:l("deploymentResources.namespace"),value:e.cr.namespace??"",placeholder:l("deploymentResources.namespace"),disabled:r,onChange:w=>y({cr:{...e.cr,namespace:w}})}),a.jsx(Wv,{label:l("deploymentResources.repository"),value:e.cr.repository??"",placeholder:l("deploymentResources.repository"),disabled:r,onChange:w=>y({cr:{...e.cr,repository:w}})})]}),e.cr.mode==="existing"&&a.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three",children:[a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.crInstance")}),a.jsx(gp,{ariaLabel:l("deploymentResources.existingCrInstance"),value:e.cr.instance??"",valueLabel:e.cr.instance,state:h,disabled:r,valueField:"name",onChange:w=>y({cr:{mode:"existing",instance:w.name}})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.namespace")}),a.jsx(gp,{ariaLabel:l("deploymentResources.existingCrNamespace"),value:e.cr.namespace??"",valueLabel:e.cr.namespace,state:m,disabled:r||!e.cr.instance,valueField:"name",onChange:w=>y({cr:{...e.cr,namespace:w.name,repository:void 0}})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.repository")}),a.jsx(gp,{ariaLabel:l("deploymentResources.existingCrRepository"),value:e.cr.repository??"",valueLabel:e.cr.repository,state:g,disabled:r||!e.cr.namespace,valueField:"name",onChange:w=>y({cr:{...e.cr,repository:w.name}})})]})]}),e.cr.mode==="auto"&&a.jsx(g6,{items:[{label:l("deploymentResources.crInstance"),name:l("deploymentResources.autoRegistry")},{label:l("deploymentResources.namespace"),name:"agentkit"},{label:l("deploymentResources.repository"),name:l("deploymentResources.autoRepositoryName",{name:c})}],note:l("deploymentResources.registryNameNote")})]})]}),a.jsxs("div",{className:"pp-resource-item",children:[a.jsx("div",{className:"pp-resource-name",children:"CodePipeline"}),a.jsxs("div",{className:"pp-resource-grid",children:[a.jsx(m6,{resource:"CodePipeline",value:e.codePipeline.mode,disabled:r,onChange:w=>y({codePipeline:{mode:w}})}),e.codePipeline.mode==="create"&&a.jsxs("div",{className:"pp-resource-fields",children:[a.jsx(Wv,{label:l("deploymentResources.workspaceName"),value:e.codePipeline.workspaceName??"",placeholder:l("deploymentResources.workspaceName"),disabled:r,onChange:w=>y({codePipeline:{...e.codePipeline,workspaceName:w}})}),a.jsx(Wv,{label:l("deploymentResources.pipelineName"),value:e.codePipeline.pipelineName??"",placeholder:l("deploymentResources.pipelineName"),disabled:r,onChange:w=>y({codePipeline:{...e.codePipeline,pipelineName:w}})})]}),e.codePipeline.mode==="existing"&&a.jsxs("div",{className:"pp-resource-fields",children:[a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.workspace")}),a.jsx(gp,{ariaLabel:l("deploymentResources.existingWorkspace"),value:e.codePipeline.workspaceId??"",valueLabel:e.codePipeline.workspaceName,state:b,disabled:r,onChange:w=>y({codePipeline:{mode:"existing",workspaceId:w.id,workspaceName:w.name}})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.compatiblePipeline")}),a.jsx(gp,{ariaLabel:l("deploymentResources.existingPipeline"),value:e.codePipeline.pipelineId??"",valueLabel:e.codePipeline.pipelineName,state:v,disabled:r||!e.codePipeline.workspaceId,onChange:w=>y({codePipeline:{...e.codePipeline,pipelineId:w.id,pipelineName:w.name}})})]})]}),e.codePipeline.mode==="auto"&&a.jsx(g6,{items:[{label:l("deploymentResources.workspace"),name:"agentkit-cli-workspace"},{label:l("deploymentResources.pipeline"),name:u}],note:l("deploymentResources.pipelineNameNote")})]})]}),s&&a.jsx("p",{className:"pp-resource-validation",role:"alert",children:s})]})}function pZt(e){return[{value:"custom",label:e("environmentCenter.creation.custom.label"),description:e("environmentCenter.creation.custom.description")},{value:"dockerfile",label:e("environmentCenter.creation.dockerfile.label"),description:e("environmentCenter.creation.dockerfile.description")},{value:"git",label:e("environmentCenter.creation.git.label"),description:e("environmentCenter.creation.git.description")},{value:"image",label:e("environmentCenter.creation.image.label"),description:e("environmentCenter.creation.image.description")}]}const mZt=DIe.map(e=>({value:e.id,label:e.label,description:e.description}));function gZt(e){return[{value:"none",label:e("common.none"),description:e("environmentCenter.presets.none")},{value:"aio-sandbox",label:"AIO Sandbox",description:e("environmentCenter.presets.aio")},{value:"codex-sandbox",label:"Codex Sandbox",description:e("environmentCenter.presets.codex")}]}function bZt(e){const t=oZt(e,"");return t===hH?"aio-sandbox":t.includes("/codexenv:")?"codex-sandbox":"none"}const yZt=vI.map(e=>({value:e.id,label:e.label})),Zoe=LIe.map(e=>({value:e.id,label:e.label}));function vZt(e){return[{value:"managed",label:e("environmentCenter.repository.managed")},{value:"existing",label:e("environmentCenter.repository.existing")}]}const X7=20,Joe=new Set;function xZt(e){const t=e instanceof Error?e.message:String(e??"");return t.includes("HTTP 503")&&(t.includes("未配置持久化存储")||t.includes("storage is not configured"))}async function wZt(){var e;if(typeof navigator>"u"||!((e=navigator.permissions)!=null&&e.query))return!1;try{return(await navigator.permissions.query({name:"clipboard-read"})).state==="denied"}catch{return!1}}const OZt={opencli:jYt,uv:NYt,playwright:RYt,chromium:IYt,git:PYt,curl:DYt,ffmpeg:MYt,imagemagick:LYt};function kZt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function af(){return a.jsx("span",{className:"environment-required-mark","aria-hidden":"true",children:"*"})}function SZt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M12 3v11m0 0 4-4m-4 4-4-4"}),a.jsx("path",{d:"M5 16v2.5A2.5 2.5 0 0 0 7.5 21h9a2.5 2.5 0 0 0 2.5-2.5V16"})]})}function Y7(e,t){const n=e.trim();if(!n)return t("environmentCenter.errors.repositoryRequired");try{const i=new URL(n);if(i.protocol!=="https:"||!i.hostname)return t("environmentCenter.errors.repositoryHttps")}catch{return t("environmentCenter.errors.repositoryInvalid")}return""}function ele(e){return!!(e!=null&&e.region&&e.registry&&e.namespace&&e.repository)}function C9e(e,t){const n=e.trim();return n?/\s/.test(n)?t("environmentCenter.errors.imageReferenceWhitespace"):n.startsWith("sha256:")?/^sha256:[0-9a-fA-F]{64}$/.test(n)?"":t("environmentCenter.errors.imageDigestInvalid"):/[@/]/.test(n)?t("environmentCenter.errors.imageTagOnly"):"":""}function EZt(e){return(e instanceof Error?e.message:String(e)).split(` +原始响应:`,1)[0].trim()}function CZt(e){return a.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5.5 10.5 16 5l10.5 5.5L16 16 5.5 10.5Z"}),a.jsx("path",{d:"M5.5 16 16 21.5 26.5 16M5.5 21.5 16 27l10.5-5.5"})]})}function AZt({label:e}){return a.jsx("span",{className:"environment-package-fallback",children:e.slice(0,1).toUpperCase()})}function TZt({option:e}){if(e.id==="lark-cli")return a.jsx("img",{src:PL,alt:""});if(e.id==="pandoc")return a.jsx("img",{src:_Yt,alt:""});if(e.id==="github-cli")return a.jsx(bK,{});const t=OZt[e.id];return t?a.jsx("img",{src:t,alt:""}):a.jsx(AZt,{label:e.label})}function _Zt(e,t){return e?{name:e.name,description:e.description,baseEnvironment:e.baseEnvironment,operatingSystem:e.operatingSystem,language:e.language,optionIds:[...e.optionIds],selectedSkills:[...e.selectedSkills],dockerfile:e.dockerfile===mH(e,t)?void 0:e.dockerfile,gitSource:e.gitSource,containerRepository:e.containerRepository,imageSource:e.imageSource}:{...a4,optionIds:[...a4.optionIds],selectedSkills:[...a4.selectedSkills]}}const $y=new Set(["preparing","queued","building","scanning"]),tle=3e3,b6={preparing:"environmentCenter.buildStatus.preparing",queued:"environmentCenter.buildStatus.queued",building:"environmentCenter.buildStatus.building",scanning:"environmentCenter.buildStatus.scanning",available:"environmentCenter.buildStatus.available",failed:"environmentCenter.buildStatus.failed"};function A9e(e,t){var i;const n=(i=e.latestVersion)==null?void 0:i.status;return n?n==="available"?{label:t(b6[n]),color:"success"}:n==="failed"?{label:t(b6[n]),color:"danger"}:{label:t(b6[n]),color:"warning"}:{label:t("environmentCenter.buildStatus.notBuilt"),color:"secondary"}}function jZt(e,t){return FT(e,Date.now(),t)}function NZt(e,t){const n=Date.parse(e);return Number.isNaN(n)?e:new Intl.DateTimeFormat(t,{dateStyle:"medium",timeStyle:"medium"}).format(n)}function RZt(e,t,n=Date.now()){const i=Date.parse(e.createdAt),s=$y.has(e.status)?n:Date.parse(e.updatedAt);if(Number.isNaN(i)||Number.isNaN(s))return"";const o=Math.max(0,Math.floor((s-i)/1e3));if(o<60)return t("environmentCenter.duration.seconds",{count:o});const l=Math.floor(o/60),c=o%60;return l<60?t("environmentCenter.duration.minutesSeconds",{minutes:l,seconds:c}):t("environmentCenter.duration.hoursMinutes",{hours:Math.floor(l/60),minutes:l%60})}function IZt({environment:e,onClose:t}){var x;const{t:n}=Te("ui"),i=((x=e.latestVersion)==null?void 0:x.versionId)??"",r=p.useId(),s=p.useRef(null),o=p.useRef(t),[l,c]=p.useState(null),[u,d]=p.useState(!0),[f,h]=p.useState(""),[m,g]=p.useState(0),[b,v]=p.useState("idle"),y=p.useMemo(()=>l?dZt(l):"",[l]);o.current=t,p.useEffect(()=>{var C;const O=document.body.style.overflow,k=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(C=s.current)==null||C.focus();const S=E=>{if(E.key==="Escape"){E.preventDefault(),o.current();return}if(E.key!=="Tab"||!s.current)return;const j=Array.from(s.current.querySelectorAll('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])')).filter(A=>A.getClientRects().length>0);if(!j.length)return;const T=j[0],R=j[j.length-1];E.shiftKey&&document.activeElement===T?(E.preventDefault(),R.focus()):!E.shiftKey&&document.activeElement===R&&(E.preventDefault(),T.focus())};return window.addEventListener("keydown",S),()=>{document.body.style.overflow=O,window.removeEventListener("keydown",S),k!=null&&k.isConnected&&k.focus()}},[]),p.useEffect(()=>{const O=new AbortController;return d(!0),h(""),ZTe(e.id,i,O.signal).then(c).catch(k=>{(k==null?void 0:k.name)!=="AbortError"&&h(k instanceof Error?k.message:String(k))}).finally(()=>{O.signal.aborted||d(!1)}),()=>O.abort()},[e.id,m,i]),p.useEffect(()=>{if(b!=="copied")return;const O=window.setTimeout(()=>v("idle"),1500);return()=>window.clearTimeout(O)},[b]);const w=async()=>{try{await navigator.clipboard.writeText(y),v("copied")}catch{v("error")}};return yi.createPortal(a.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:O=>{O.target===O.currentTarget&&t()},children:a.jsxs("section",{ref:s,className:"environment-build-dialog environment-manifest-dialog",role:"dialog","aria-modal":"true","aria-labelledby":r,"aria-busy":u||void 0,tabIndex:-1,children:[a.jsxs("header",{className:"environment-build-dialog__header",children:[a.jsxs("div",{children:[a.jsx("div",{className:"environment-build-dialog__title-row",children:a.jsx("h2",{id:r,children:n("environmentCenter.manifest.title")})}),a.jsxs("p",{children:[e.name," / ",i]})]}),a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,onClick:t,"aria-label":n("environmentCenter.manifest.closeLabel"),children:a.jsx(Do,{"aria-hidden":!0})})]}),a.jsx("div",{className:"environment-manifest-dialog__body",children:u?a.jsx("div",{className:"environment-manifest-dialog__state",role:"status",children:a.jsx(fn,{as:"span",children:n("environmentCenter.manifest.loading")})}):f?a.jsxs("div",{className:"environment-manifest-dialog__state is-error",role:"alert",children:[a.jsx("p",{children:f}),a.jsx(_t,{type:"button",color:"secondary",variant:"soft",size:"sm",onClick:()=>g(O=>O+1),children:n("common.reload")})]}):a.jsx("div",{className:"environment-manifest-dialog__editor","aria-label":n("environmentCenter.manifest.editorLabel"),children:a.jsx(MT,{value:y,path:"environment.yaml",readOnly:!0,onChange:()=>{}})})}),a.jsxs("footer",{className:"environment-build-dialog__actions",children:[b==="error"?a.jsx("span",{className:"environment-manifest-dialog__copy-error",role:"alert",children:n("environmentCenter.manifest.copyFailed")}):null,a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"sm",onClick:t,children:n("common.close")}),a.jsx(_t,{type:"button",color:"info",size:"sm",disabled:!y,onClick:()=>void w(),children:n(b==="copied"?"environmentCenter.manifest.copied":"environmentCenter.manifest.copy")})]})]})}),document.body)}function PZt({environment:e,onClose:t,onBuildUpdate:n,onRebuild:i}){var S,C;const{t:r}=Te("ui"),s=e.latestVersion,[o,l]=p.useState(s),[c,u]=p.useState(!!s),[d,f]=p.useState(""),[h,m]=p.useState(Date.now()),[g,b]=p.useState(!1),v=p.useId(),y=p.useRef(null),w=p.useRef(t),x=p.useRef(n);p.useEffect(()=>{w.current=t,x.current=n},[n,t]),p.useEffect(()=>{var R;const E=document.body.style.overflow,j=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(R=y.current)==null||R.focus();const T=A=>{var D;if(A.key==="Escape"&&w.current(),A.key!=="Tab")return;const N=Array.from(((D=y.current)==null?void 0:D.querySelectorAll('button:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])'))??[]).filter(_=>_.getClientRects().length>0);if(!N.length)return;const P=N[0],I=N[N.length-1];A.shiftKey&&document.activeElement===P?(A.preventDefault(),I.focus()):!A.shiftKey&&document.activeElement===I&&(A.preventDefault(),P.focus())};return window.addEventListener("keydown",T),()=>{document.body.style.overflow=E,window.removeEventListener("keydown",T),j!=null&&j.isConnected&&j.focus()}},[]),p.useEffect(()=>{if(!s)return;let E=0;const j=new AbortController,T=async()=>{u(!0);try{const R=await YTe(e.id,s.versionId,{includeLogs:!0,signal:j.signal});l(R),f(""),x.current(R),$y.has(R.status)&&(E=window.setTimeout(T,tle))}catch(R){if((R==null?void 0:R.name)==="AbortError")return;f(R instanceof Error?R.message:String(R)),E=window.setTimeout(T,tle)}finally{j.signal.aborted||u(!1)}};return T(),()=>{j.abort(),window.clearTimeout(E)}},[e.id,s==null?void 0:s.versionId]),p.useEffect(()=>{if(!o||!$y.has(o.status))return;const E=window.setInterval(()=>m(Date.now()),1e3);return()=>window.clearInterval(E)},[o==null?void 0:o.status]);const O=o?A9e({...e,latestVersion:o},r):{label:r("environmentCenter.buildStatus.notBuilt"),color:"secondary"},k=e.imageSource||(C=(S=o==null?void 0:o.resources)==null?void 0:S.codePipeline)==null?void 0:C.consoleUrl;return yi.createPortal(a.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:E=>{E.target===E.currentTarget&&t()},children:a.jsxs("section",{ref:y,className:"environment-build-dialog",role:"dialog","aria-modal":"true","aria-labelledby":v,tabIndex:-1,children:[a.jsxs("header",{className:"environment-build-dialog__header",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"environment-build-dialog__title-row",children:[a.jsx("h2",{id:v,children:r("environmentCenter.buildDetails.title")}),a.jsx(Ya,{color:O.color,size:"sm",children:O.label})]}),a.jsx("p",{children:e.name})]}),a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,onClick:t,"aria-label":r("environmentCenter.buildDetails.closeLabel"),children:a.jsx(Do,{"aria-hidden":!0})})]}),a.jsxs("div",{className:"environment-build-dialog__summary",children:[a.jsxs("div",{children:[a.jsx("span",{children:r("environmentCenter.buildDetails.currentStep")}),a.jsx("strong",{children:(o==null?void 0:o.currentStep)||r("environmentCenter.buildDetails.waiting")})]}),a.jsxs("div",{children:[a.jsx("span",{children:r("environmentCenter.buildDetails.elapsed")}),a.jsx("strong",{children:o?RZt(o,r,h):"-"})]}),o!=null&&o.sourceCommitSha?a.jsxs("div",{children:[a.jsx("span",{children:r("environmentCenter.buildDetails.sourceCommit")}),a.jsx("strong",{title:o.sourceCommitSha,children:o.sourceCommitSha.slice(0,12)})]}):null,k?a.jsxs("a",{href:k,target:"_blank",rel:"noreferrer",children:[r("environmentCenter.buildDetails.openCodePipeline")," ",a.jsx(p0,{"aria-hidden":!0})]}):null]}),a.jsxs("div",{className:"environment-build-dialog__body",children:[d?a.jsx("p",{className:"environment-build-dialog__error",role:"alert",children:d}):null,o!=null&&o.progressError?a.jsx("p",{className:"environment-build-dialog__notice",children:o.progressError}):null,a.jsx(QYt,{steps:(o==null?void 0:o.steps)??[],log:(o==null?void 0:o.logTail)??"",logError:o==null?void 0:o.logError,logTruncated:o==null?void 0:o.logTruncated,logUpdatedAt:o==null?void 0:o.logUpdatedAt,loading:c&&!!(o&&$y.has(o.status))}),(o==null?void 0:o.status)==="failed"&&o.error?a.jsx("p",{className:"environment-build-dialog__failure",role:"alert",children:o.error}):null]}),a.jsxs("footer",{className:"environment-build-dialog__actions",children:[a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"sm",onClick:t,children:r("common.close")}),o&&!e.imageSource&&!$y.has(o.status)?a.jsx(_t,{type:"button",color:"info",size:"sm",disabled:g,onClick:()=>{b(!0),i().then(t).finally(()=>b(!1))},children:r(g?"environmentCenter.buildDetails.starting":"environmentCenter.buildDetails.rebuild")}):null]})]})}),document.body)}function T9e({cloudProvider:e,value:t,disabled:n,onChange:i}){const{t:r}=Te("ui"),s=_u(e).map(o=>({value:o.value,label:o.label}));return a.jsxs("label",{className:"environment-field environment-region-field",children:[a.jsxs("span",{children:[r("environmentCenter.region"),a.jsx(af,{})]}),a.jsx(ha,{id:"environment-region",value:t,options:s,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:n,triggerClassName:"environment-select-trigger",onChange:o=>i(o.value)})]})}function DZt({repositoryUrl:e,gitRef:t,dockerfilePath:n,inspection:i,inspectedKey:r,disabled:s,onRepositoryUrlChange:o,onGitRefChange:l,onDockerfilePathChange:c,onInspectionChange:u,onInspectedKeyChange:d}){const{t:f}=Te("ui"),[h,m]=p.useState(!1),[g,b]=p.useState(""),v=p.useRef(null),y=p.useRef(""),w=`${e.trim()}\0${t.trim()}`,x=r===w;p.useEffect(()=>()=>{const C=v.current;v.current=null,C==null||C.abort()},[]);const O=()=>{var C;(C=v.current)==null||C.abort(),v.current=null,m(!1),b(""),u(null),d(""),c(""),y.current=""},k=p.useCallback(async()=>{var j;const C=Y7(e,f);if(C){b(C);return}y.current=w,(j=v.current)==null||j.abort();const E=new AbortController;v.current=E,m(!0),b("");try{const T=await zTe({repositoryUrl:e.trim(),...t.trim()?{ref:t.trim()}:{}},E.signal);if(v.current!==E)return;u(T),d(w),c(T.dockerfiles.length===1?T.dockerfiles[0]:"")}catch(T){if((T==null?void 0:T.name)==="AbortError")return;b(EZt(T)),u(null),d(""),c("")}finally{v.current===E&&(v.current=null,m(!1))}},[w,t,c,d,u,e,f]);p.useEffect(()=>{if(s||x||y.current===w||Y7(e,f))return;const C=window.setTimeout(()=>void k(),600);return()=>window.clearTimeout(C)},[w,s,k,x,e,f]);const S=x?(i==null?void 0:i.dockerfiles)??[]:[];return a.jsxs("section",{className:"environment-source-section","aria-label":f("environmentCenter.git.sectionLabel"),children:[a.jsxs("div",{className:"environment-form-grid environment-git-fields",children:[a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[f("environmentCenter.git.address"),a.jsx(af,{})]}),a.jsx(_s,{size:"lg",type:"url",required:!0,value:e,placeholder:"https://github.com/owner/repository.git",autoComplete:"url",disabled:s,"aria-invalid":!!g,onChange:C=>{O(),o(C.currentTarget.value)}})]}),a.jsxs("label",{className:"environment-field",children:[a.jsx("span",{children:f("environmentCenter.git.ref")}),a.jsx(_s,{size:"lg",value:t,placeholder:f("environmentCenter.git.defaultBranch"),autoComplete:"off",disabled:s,onChange:C=>{O(),l(C.currentTarget.value)}})]})]}),a.jsxs("div",{className:"environment-inspection-status environment-form-feedback","aria-live":"polite",children:[h?a.jsx(fn,{as:"span",children:f("environmentCenter.git.inspecting")}):null,g?a.jsxs("div",{className:"environment-source-error",role:"alert",children:[a.jsx("span",{children:g}),a.jsxs(_t,{type:"button",color:"primary",size:"sm",pill:!1,disabled:s,onClick:()=>void k(),children:[a.jsx(JD,{}),f("common.retry")]})]}):null,!h&&!g&&x&&i?S.length>0?a.jsx("span",{children:i.commitSha?f("environmentCenter.git.foundDockerfiles",{commit:i.commitSha.slice(0,12),count:S.length}):f("environmentCenter.git.savedDockerfileLoaded")}):a.jsxs("div",{className:"environment-source-error",role:"alert",children:[a.jsx("span",{children:f("environmentCenter.git.noDockerfile")}),a.jsx("button",{type:"button",disabled:s,onClick:()=>void k(),children:f("environmentCenter.git.inspectAgain")})]}):null]}),S.length>0?a.jsxs("label",{className:"environment-field environment-dockerfile-picker",children:[a.jsxs("span",{children:["Dockerfile",a.jsx(af,{})]}),a.jsx(vf,{ariaLabel:f("environmentCenter.git.selectDockerfile"),value:n,valueLabel:n,placeholder:f("environmentCenter.git.selectDockerfile"),options:S.map(C=>({value:C,label:C})),disabled:s||h,onChange:c})]}):null]})}function MZt({cloudProvider:e,mode:t,region:n,value:i,disabled:r,onModeChange:s,onRegionChange:o,onChange:l}){const{t:c}=Te("ui");return a.jsx("section",{className:"environment-source-section","aria-label":c("environmentCenter.repository.outputSection"),children:a.jsxs("div",{className:"environment-form-grid",children:[a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[c("environmentCenter.repository.type"),a.jsx(af,{})]}),a.jsx(ha,{id:"environment-repository-mode",value:t,options:vZt(c),optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:r,triggerClassName:"environment-select-trigger",onChange:u=>s(u.value)})]}),a.jsx(T9e,{cloudProvider:e,value:n,disabled:r,onChange:o}),t==="existing"?a.jsx(k9e,{region:n,value:i,disabled:r,onChange:l}):a.jsx("p",{className:"environment-source-note environment-form-feedback",children:c("environmentCenter.repository.managedHint")})]})})}function LZt({cloudProvider:e,region:t,repository:n,reference:i,disabled:r,onRegionChange:s,onRepositoryChange:o,onReferenceChange:l}){const{t:c}=Te("ui"),u=C9e(i,c);return a.jsx("section",{className:"environment-source-section","aria-label":c("environmentCenter.existingImage.sectionLabel"),children:a.jsxs("div",{className:"environment-form-grid",children:[a.jsx(T9e,{cloudProvider:e,value:t,disabled:r,onChange:s}),a.jsx(k9e,{region:t,value:n,disabled:r,onChange:o}),a.jsxs("label",{className:"environment-field environment-image-reference",children:[a.jsxs("span",{children:[c("environmentCenter.existingImage.reference"),a.jsx(af,{})]}),a.jsx(_s,{size:"lg",value:i,required:!0,placeholder:c("environmentCenter.existingImage.placeholder"),autoComplete:"off",disabled:r,"aria-invalid":!!u,onChange:d=>l(d.currentTarget.value)}),u?a.jsx("small",{className:"environment-source-field__error",role:"alert",children:u}):a.jsx("small",{children:c("environmentCenter.existingImage.hint")})]})]})})}function _9e(e,t,n,i){const r=p.useRef(n),s=p.useRef(i);r.current=n,s.current=i,p.useEffect(()=>{const o=document.body.style.overflow,l=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden";const c=window.requestAnimationFrame(()=>{var d;return(d=t.current)==null?void 0:d.focus()}),u=d=>{var g;if(d.key==="Escape"&&!s.current){d.preventDefault(),r.current();return}if(d.key!=="Tab")return;const f=Array.from(((g=e.current)==null?void 0:g.querySelectorAll('button:not([disabled]), textarea:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])'))??[]).filter(b=>b.getClientRects().length>0);if(!f.length)return;const h=f[0],m=f[f.length-1];d.shiftKey&&document.activeElement===h?(d.preventDefault(),m.focus()):!d.shiftKey&&document.activeElement===m&&(d.preventDefault(),h.focus())};return window.addEventListener("keydown",u),()=>{window.cancelAnimationFrame(c),document.body.style.overflow=o,window.removeEventListener("keydown",u),l!=null&&l.isConnected&&l.focus()}},[e,t])}function $Zt({environment:e,onClose:t}){const{t:n}=Te("ui"),i=p.useId(),r=p.useId(),s=p.useRef(null),o=p.useRef(null),[l,c]=p.useState(""),[u,d]=p.useState("loading"),[f,h]=p.useState(""),m=u==="loading";_9e(s,o,t,m);const g=async(b="",v)=>{d("loading"),h("");try{const y=b||(await VTe(e.id,v)).shareCode;c(y),await ITe(y),v!=null&&v.aborted||d("copied")}catch(y){if((y==null?void 0:y.name)==="AbortError")return;h(y instanceof Error?y.message:String(y)),d("error")}};return p.useEffect(()=>{const b=new AbortController;return g("",b.signal),()=>b.abort()},[e.id]),yi.createPortal(a.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:b=>{b.target===b.currentTarget&&!m&&t()},children:a.jsxs("section",{ref:s,className:"environment-share-dialog",role:"dialog","aria-modal":"true","aria-labelledby":i,"aria-describedby":r,"aria-busy":m||void 0,children:[a.jsxs("header",{className:"environment-build-dialog__header",children:[a.jsxs("div",{children:[a.jsx("h2",{id:i,children:n("environmentCenter.share.title")}),a.jsx("p",{id:r,children:e.name})]}),a.jsx(_t,{ref:o,type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,disabled:m,onClick:t,"aria-label":n("environmentCenter.share.closeLabel"),children:a.jsx(Do,{"aria-hidden":!0})})]}),a.jsx("div",{className:"environment-share-dialog__body",children:u==="loading"?a.jsx(fn,{as:"p",children:n("environmentCenter.share.generating")}):a.jsxs("div",{className:"environment-share-dialog__result",children:[u==="copied"?a.jsx("p",{className:"environment-share-dialog__success",role:"status","aria-live":"polite",children:n("environmentCenter.share.copied")}):a.jsxs("div",{className:"environment-share-dialog__error",role:"alert",children:[a.jsx("strong",{children:n("environmentCenter.share.failed")}),a.jsx("span",{children:f})]}),l?a.jsxs("label",{className:"environment-share-dialog__field environment-share-dialog__manual-code",children:[a.jsx("span",{children:n("environmentCenter.share.code")}),a.jsx(vb,{size:"lg",rows:4,value:l,readOnly:!0,"aria-label":n("environmentCenter.share.fullCode"),onFocus:b=>b.currentTarget.select(),onClick:b=>b.currentTarget.select()}),a.jsx("small",{children:n(u==="copied"?"environmentCenter.share.copiedHint":"environmentCenter.share.copyFailedHint")})]}):null,a.jsx("p",{className:"environment-share-dialog__safety",children:n("environmentCenter.share.safety")})]})}),a.jsxs("footer",{className:"environment-build-dialog__actions",children:[a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:m,onClick:t,children:n("common.close")}),u==="error"?a.jsx(_t,{type:"button",color:"info",size:"sm",onClick:()=>void g(l),children:n("common.retry")}):u==="copied"?a.jsx(_t,{type:"button",color:"info",size:"sm",onClick:()=>void g(l),children:n("environmentCenter.share.copyAgain")}):null]})]})}),document.body)}function FZt({initialValue:e,autoInspect:t,onClose:n,onImported:i}){const{t:r}=Te("ui"),s=p.useId(),o=p.useId(),l=p.useId(),c=p.useRef(null),u=p.useRef(null),d=p.useRef(!1),[f,h]=p.useState(e),[m,g]=p.useState("editing"),[b,v]=p.useState([]),[y,w]=p.useState(""),[x,O]=p.useState([]),k=p.useMemo(()=>Iz(f),[f]),S=k.length>X7,C=m==="inspecting"||m==="importing",E=b.filter(P=>P.status==="valid"),j=b.filter(P=>P.status==="invalid"),T=m==="ready"&&E.length>0;_9e(c,u,n,C);const R=p.useCallback(async()=>{if(!(!k.length||S)){g("inspecting"),w(""),O([]);try{const P=await HTe(k);v([...P].sort((I,D)=>I.index-D.index)),g("ready")}catch(P){w(P instanceof Error?P.message:String(P)),g("editing")}}},[k,S]);p.useEffect(()=>{!t||d.current||(d.current=!0,R())},[t,R]);const A=async()=>{if(T){g("importing"),w(""),O([]);try{const P=E.map(U=>({code:k[U.index],name:U.name})).filter(U=>!!U.code),I=await qTe(P.map(U=>U.code)),D=I.filter(U=>U.status==="created").length,_=I.filter(U=>U.status==="duplicate").length,L=new Map(I.map(U=>[U.index,U])),F=P.flatMap(({code:U,name:J},z)=>{const Z=L.get(z);return!Z||Z.status==="failed"?[{code:U,name:J,status:"valid",error:(Z==null?void 0:Z.error)||r("environmentCenter.import.noResult")}]:[]}),V=[...j.flatMap(U=>{const J=k[U.index];return J?[{code:J,name:"",status:"invalid",error:U.error||r("environmentCenter.import.invalidCode")}]:[]}),...F],q=new Map;if(I.forEach(U=>{U.environment&&q.set(U.environment.id,U.environment)}),i([...q.values()],D,_,V.length),!V.length){n();return}h(V.map(U=>U.code).join(` +`)),O(F),v(V.map((U,J)=>({index:J,status:U.status,name:U.name,error:U.status==="invalid"?U.error:""}))),w(r("environmentCenter.import.partial",{created:D,remaining:V.length})),g("ready")}catch(P){w(P instanceof Error?P.message:String(P)),g("ready")}}},N=m==="inspecting"?r("environmentCenter.import.inspecting"):m==="importing"?r("environmentCenter.import.importing"):T?x.length?r("environmentCenter.import.retryImport"):r("environmentCenter.import.confirm"):r("environmentCenter.import.inspectCodes");return yi.createPortal(a.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:P=>{P.target===P.currentTarget&&!C&&n()},children:a.jsxs("section",{ref:c,className:"environment-share-dialog environment-import-dialog",role:"dialog","aria-modal":"true","aria-labelledby":s,"aria-describedby":o,"aria-busy":C||void 0,children:[a.jsxs("header",{className:"environment-build-dialog__header",children:[a.jsxs("div",{children:[a.jsx("h2",{id:s,children:r("environmentCenter.import.title")}),a.jsx("p",{id:o,children:r("environmentCenter.import.description")})]}),a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,disabled:C,onClick:n,"aria-label":r("environmentCenter.import.closeLabel"),children:a.jsx(Do,{"aria-hidden":!0})})]}),a.jsxs("div",{className:"environment-share-dialog__body",children:[a.jsxs("label",{className:"environment-share-dialog__field",children:[a.jsx("span",{children:r("environmentCenter.import.code")}),a.jsx(vb,{ref:u,size:"lg",rows:6,value:f,disabled:C,"aria-invalid":S||j.length>0||void 0,"aria-describedby":l,placeholder:"akenv://v1/...",onChange:P=>{h(P.currentTarget.value),g("editing"),v([]),w(""),O([])}})]}),a.jsx("p",{id:l,className:`environment-share-dialog__help${S?" is-error":""}`,children:S?r("environmentCenter.import.tooMany",{max:X7,count:k.length}):r("environmentCenter.import.multipleHint")}),a.jsx("p",{className:"environment-share-dialog__safety",children:r("environmentCenter.import.safety")}),m==="inspecting"?a.jsx(fn,{as:"p",children:r("environmentCenter.import.inspectingCodes")}):E.length?a.jsx("p",{className:"environment-share-dialog__summary",role:"status","aria-live":"polite",children:r("environmentCenter.import.found",{count:E.length,names:E.map(P=>P.name||r("environmentCenter.unnamed")).join(r("environmentCenter.listSeparator"))})}):null,j.length?a.jsx("ul",{className:"environment-share-dialog__failures",role:"alert",children:j.map(P=>a.jsx("li",{children:r("environmentCenter.import.itemError",{index:P.index+1,error:P.error||r("environmentCenter.import.invalidCode")})},P.index))}):null,x.length?a.jsx("ul",{className:"environment-share-dialog__failures",role:"alert",children:x.map((P,I)=>a.jsx("li",{children:r("environmentCenter.import.itemError",{index:I+1,error:P.error})},`${P.code}:${I}`))}):null,y?a.jsx("p",{className:"environment-share-dialog__error-text",role:"alert",children:y}):null]}),a.jsxs("footer",{className:"environment-build-dialog__actions",children:[a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:C,onClick:n,children:r("common.cancel")}),a.jsx(_t,{type:"button",color:"info",size:"sm",loading:C,disabled:C||!k.length||S||m==="ready"&&!T,onClick:()=>T?void A():void R(),children:N})]})]})}),document.body)}function BZt({environment:e,cloudProvider:t,onCancel:n,onDelete:i,onShare:r,onSave:s}){var He,Ue,jt,Pt,Kt,Ct,xt;const{t:o,i18n:l}=Te("ui"),c=pZt(o),u=_Zt(e,t),d=u.dockerfile!==void 0,[f,h]=p.useState(()=>({...u,dockerfile:d?void 0:u.dockerfile})),[m,g]=p.useState(u.gitSource?"git":u.imageSource?"image":d?"dockerfile":"custom"),[b,v]=p.useState(d?(e==null?void 0:e.dockerfile)??"":""),[y,w]=p.useState(""),x=p.useRef(null),[O,k]=p.useState(()=>d?bZt((e==null?void 0:e.dockerfile)??""):u.baseEnvironment==="aio-sandbox"||u.baseEnvironment==="codex-sandbox"?u.baseEnvironment:"none"),[S,C]=p.useState(((He=u.gitSource)==null?void 0:He.repositoryUrl)??""),[E,j]=p.useState(((Ue=u.gitSource)==null?void 0:Ue.ref)??""),[T,R]=p.useState(((jt=u.gitSource)==null?void 0:jt.dockerfilePath)??""),[A,N]=p.useState(u.gitSource?{repositoryUrl:u.gitSource.repositoryUrl,ref:u.gitSource.ref??"",commitSha:"",dockerfiles:[u.gitSource.dockerfilePath]}:null),[P,I]=p.useState(u.gitSource?`${u.gitSource.repositoryUrl}\0${u.gitSource.ref??""}`:""),[D,_]=p.useState(u.containerRepository?"existing":"managed"),[L,F]=p.useState(((Pt=u.containerRepository)==null?void 0:Pt.region)??Zi(t)),[M,V]=p.useState(u.containerRepository??void 0),[q,U]=p.useState(((Kt=u.imageSource)==null?void 0:Kt.region)??Zi(t)),[J,z]=p.useState(u.imageSource?{region:u.imageSource.region,registry:u.imageSource.registry,namespace:u.imageSource.namespace,repository:u.imageSource.repository}:void 0),[Z,ne]=p.useState(((Ct=u.imageSource)==null?void 0:Ct.reference)??""),[W,G]=p.useState(!1),H=p.useMemo(()=>mH(f,t),[t,f.baseEnvironment,f.operatingSystem,f.language,f.optionIds]),se=f.dockerfile??H,Y=O!=="none",X=O==="aio-sandbox"?hH:O==="codex-sandbox"?MIe[t]:"",ie=Y?lZt(b):b,ee=Y?nR(X,""):"",be=Y?nR(X,ie):b,ue=y||(Y?cZt(ie,X,o):vK(b,void 0,o)),pe=!!e,ke="environment-editor-form",[je,Pe]=p.useState(!1),[Ee,ze]=p.useState(""),_e=!!be.trim()&&!ue,ae=`${S.trim()}\0${E.trim()}`,le=!Y7(S,o)&&P===ae&&!!T&&(D==="managed"||ele(M)),ge=ele(J)&&!!Z.trim()&&!C9e(Z,o),Oe=!!f.name.trim()&&!je&&(m==="custom"||m==="dockerfile"&&_e||m==="git"&&le||m==="image"&&ge),Se=(tt,mt)=>{h(Ne=>({...Ne,optionIds:mt?[...Ne.optionIds,tt]:Ne.optionIds.filter(Ot=>Ot!==tt)}))},We=tt=>{w(""),v(Y?nR(X,tt):tt)},Ye=async tt=>{if(!tt)return;const mt=await uZt(tt,o);w(mt.error),mt.content&&v(mt.content)},ye=()=>{w(""),v(ee)},we=async tt=>{if(tt.preventDefault(),!!Oe){Pe(!0),ze("");try{const mt=Cmt(be);await s({...f,name:f.name.trim(),description:f.description.trim(),optionIds:m==="custom"?f.optionIds:[],selectedSkills:m==="custom"?f.selectedSkills:[],dockerfile:m==="dockerfile"?be:m==="custom"?se:"",gitSource:m==="git"?{repositoryUrl:S.trim(),...E.trim()?{ref:E.trim()}:{},dockerfilePath:T}:null,containerRepository:m==="git"&&D==="existing"?M:null,imageSource:m==="image"&&J?{...J,reference:Z.trim()}:null,...m==="dockerfile"?mt:{}})}catch(mt){ze(mt instanceof Error?mt.message:String(mt)),Pe(!1)}}},Ae=f.name.trim()||(pe?(e==null?void 0:e.name)||o("environmentCenter.configure"):o("environmentCenter.create"));return a.jsx(kh,{className:"environment-editor","aria-label":o(pe?"environmentCenter.details":"environmentCenter.create"),children:a.jsx(oT,{title:Ae,description:o("environmentCenter.editorDescription"),identitySeed:Ae,backLabel:o("environmentCenter.backToList"),onBack:n,actions:a.jsxs(a.Fragment,{children:[i?a.jsx(_t,{type:"button",color:"danger",variant:"ghost",size:"sm",onClick:i,disabled:je,children:o("common.delete")}):null,r?a.jsx(_t,{color:"secondary",variant:"soft",size:"sm",onClick:r,disabled:je,children:o("environmentCenter.share.action")}):null,a.jsx(_t,{color:"secondary",variant:"soft",size:"sm",onClick:n,disabled:je,children:o("common.cancel")}),a.jsx(_t,{color:"info",size:"sm",type:"submit",form:ke,disabled:!Oe,children:o(je?"common.saving":m==="image"?pe?"environmentCenter.save":"environmentCenter.create":pe?"environmentCenter.saveAndBuild":"environmentCenter.createAndBuild")})]}),children:a.jsxs("form",{id:ke,className:"environment-form",onSubmit:we,children:[a.jsxs("div",{className:"environment-fields",children:[a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[o("environmentCenter.name"),a.jsx(af,{})]}),a.jsx(_s,{className:"environment-text-input",type:"text",size:"lg",required:!0,value:f.name,maxLength:60,placeholder:o("environmentCenter.namePlaceholder"),onChange:tt=>h(mt=>({...mt,name:tt.target.value}))})]}),a.jsxs("label",{className:"environment-field",children:[a.jsx("span",{children:o("common.description")}),a.jsx(vb,{className:"environment-description-input",size:"lg",rows:3,value:f.description,maxLength:180,placeholder:o("environmentCenter.descriptionPlaceholder"),onChange:tt=>h(mt=>({...mt,description:tt.target.value}))})]})]}),a.jsxs("label",{className:"environment-field environment-creation-method",children:[a.jsxs("span",{children:[o("environmentCenter.creationMethod"),a.jsx(af,{})]}),a.jsx(ha,{id:"environment-creation-method",value:m,options:c,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:tt=>{const mt=tt.value;g(mt),mt==="dockerfile"&&!b.trim()&&v(ee),ze("")}}),a.jsx("small",{children:(xt=c.find(tt=>tt.value===m))==null?void 0:xt.description})]}),Ee?a.jsx("p",{className:"environment-form-error",role:"alert",children:Ee}):null,m==="custom"?a.jsxs("div",{className:"environment-configuration",children:[a.jsx("section",{className:"environment-section environment-form-section","aria-label":o("environmentCenter.baseConfiguration"),children:a.jsxs("div",{className:"environment-form-grid",children:[a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[o("environmentCenter.baseEnvironment"),a.jsx(af,{})]}),a.jsx(ha,{id:"environment-base-environment",value:f.baseEnvironment,options:mZt.map(tt=>({...tt,description:o(`environmentCenter.baseDescriptions.${tt.value}`)})),optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:tt=>{const mt=tt.value,Ne=mt==="aio-sandbox"||mt==="codex-sandbox";h(Ot=>({...Ot,baseEnvironment:mt,operatingSystem:Ne?"ubuntu-22.04":Ot.operatingSystem,language:Ne?"python-3.12":Ot.language}))}}),a.jsx("small",{children:o(`environmentCenter.baseDescriptions.${f.baseEnvironment}`)})]}),a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[o("environmentCenter.operatingSystem"),a.jsx(af,{})]}),a.jsx(ha,{id:"environment-operating-system",value:f.operatingSystem,options:yZt,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:f.baseEnvironment!=="ubuntu",triggerClassName:"environment-select-trigger",onChange:tt=>h(mt=>({...mt,operatingSystem:tt.value}))}),a.jsx("small",{children:f.baseEnvironment!=="ubuntu"?o("environmentCenter.fixedByBase",{base:IB(f.baseEnvironment),value:"Ubuntu 22.04"}):o("environmentCenter.selectUbuntuVersion")})]}),a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[o("environmentCenter.pythonVersion"),a.jsx(af,{})]}),a.jsx(ha,{id:"environment-python-version",value:f.language,options:f.baseEnvironment!=="ubuntu"?Zoe.filter(tt=>tt.value==="python-3.12"):Zoe,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:f.baseEnvironment!=="ubuntu",triggerClassName:"environment-select-trigger",onChange:tt=>h(mt=>({...mt,language:tt.value}))}),a.jsx("small",{children:f.baseEnvironment!=="ubuntu"?o("environmentCenter.fixedByBase",{base:IB(f.baseEnvironment),value:"Python 3.12"}):o("environmentCenter.selectPythonVersion")})]})]})}),a.jsxs("section",{className:"environment-section","aria-labelledby":"environment-skills-title",children:[a.jsx("h2",{id:"environment-skills-title",children:o("environmentCenter.skills")}),a.jsxs("div",{className:"environment-skill-grid",children:[a.jsx(Yoe,{name:"VeADK",description:o("environmentCenter.veadkDescription"),selected:W,disabled:je,onChange:G,icon:a.jsx("img",{src:pM,alt:""})}),a.jsx(yK,{selected:f.selectedSkills,onChange:tt=>h(mt=>({...mt,selectedSkills:tt})),cloudProvider:t,disabled:je,addLabel:o("environmentCenter.addSkill"),showSelectedCount:!1})]})]}),pH.map(tt=>a.jsxs("section",{className:"environment-section","aria-labelledby":`environment-${tt.id}-title`,children:[a.jsx("h2",{id:`environment-${tt.id}-title`,children:o(`environmentCenter.categories.${tt.id}`)}),a.jsx("div",{className:"environment-option-grid",children:tt.options.map(mt=>{const Ne=f.optionIds.includes(mt.id);return a.jsx(Yoe,{name:mt.label,description:o(`environmentCenter.options.${mt.id}`,{defaultValue:mt.description}),selected:Ne,onChange:Ot=>Se(mt.id,Ot),icon:a.jsx(TZt,{option:mt})},mt.id)})})]},tt.id))]}):m==="dockerfile"?a.jsxs("section",{className:"environment-upload","aria-label":o("environmentCenter.customDockerfile"),children:[a.jsx("div",{className:"environment-dockerfile-settings environment-form-grid",children:a.jsxs("label",{className:"environment-field",children:[a.jsx("span",{children:o("environmentCenter.presetEnvironment")}),a.jsx(ha,{id:"environment-dockerfile-base-environment",value:O,options:gZt(o),optionClassName:"environment-select-option",size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:tt=>{w(""),k(tt.value)}}),a.jsx("small",{children:o("environmentCenter.presetHint")})]})}),a.jsxs("div",{className:"environment-upload__preview",children:[a.jsxs("div",{children:[a.jsxs("h3",{children:["Dockerfile",a.jsx(af,{})]}),a.jsxs("div",{className:"environment-upload__actions",children:[a.jsx("span",{className:"environment-upload__size",children:o("environmentCenter.dockerfileSize",{size:w9e(be).toLocaleString(l.resolvedLanguage??l.language),max:131072 .toLocaleString(l.resolvedLanguage??l.language)})}),a.jsx("input",{ref:x,className:"environment-upload__file-input",type:"file",accept:".dockerfile,text/plain",tabIndex:-1,hidden:!0,onChange:tt=>{var Ne;const mt=tt.currentTarget;Ye((Ne=mt.files)==null?void 0:Ne[0]).finally(()=>{mt.value=""})}}),a.jsx(_t,{className:"environment-upload__action",type:"button",color:"secondary",variant:"soft",size:"sm",pill:!1,disabled:je,onClick:()=>{var tt;return(tt=x.current)==null?void 0:tt.click()},children:o("environmentCenter.upload")}),a.jsx(_t,{className:"environment-upload__action",type:"button",color:"secondary",variant:"ghost",size:"sm",pill:!1,disabled:je||!ie,onClick:ye,children:o("environmentCenter.reset")})]})]}),a.jsxs("div",{className:`environment-dockerfile-editor${Y?" has-fixed-base":""}${ue?" is-invalid":""}`,children:[Y?a.jsxs("div",{className:"environment-dockerfile-from","aria-label":o("environmentCenter.dockerfileBaseImage"),children:[a.jsx("span",{className:"environment-dockerfile-from__line","aria-hidden":"true",children:"1"}),a.jsxs("code",{children:[a.jsx("span",{className:"environment-dockerfile-from__keyword",children:"FROM"}),a.jsx("span",{title:X,children:X})]})]}):null,a.jsx("div",{className:"environment-dockerfile__editor environment-upload__editor","aria-label":o("environmentCenter.dockerfileContent"),children:a.jsx(MT,{value:ie,path:"Dockerfile",lineNumberStart:Y?2:1,height:"auto",minHeight:"28px",maxHeight:"var(--environment-dockerfile-editor-max-height)",onChange:We})})]})]}),ue?a.jsx("p",{className:"environment-upload__error environment-upload__error--below",role:"alert",children:ue}):null]}):m==="git"?a.jsxs("div",{className:"environment-source-workflow",children:[a.jsx(DZt,{repositoryUrl:S,gitRef:E,dockerfilePath:T,inspection:A,inspectedKey:P,disabled:je,onRepositoryUrlChange:C,onGitRefChange:j,onDockerfilePathChange:R,onInspectionChange:N,onInspectedKeyChange:I}),a.jsx(MZt,{cloudProvider:t,mode:D,region:L,value:M,disabled:je,onModeChange:tt=>{_(tt),ze("")},onRegionChange:tt=>{F(tt),V(void 0),ze("")},onChange:V})]}):a.jsx(LZt,{cloudProvider:t,region:q,repository:J,reference:Z,disabled:je,onRegionChange:tt=>{U(tt),z(void 0),ze("")},onRepositoryChange:z,onReferenceChange:ne})]})})})}function j9e({cloudProvider:e="volcengine",onWorkspace:t,onProjects:n,clipboardImport:i=null,clipboardReadError:r=""}){const{t:s,i18n:o}=Te("ui"),[l,c]=p.useState([]),[u,d]=p.useState({kind:"list"}),[f,h]=p.useState(""),[m,g]=p.useState(null),[b,v]=p.useState(null),[y,w]=p.useState(null),[x,O]=p.useState(null),[k,S]=p.useState(null),C=p.useRef(0),[E,j]=p.useState(""),[T,R]=p.useState(!1),[A,N]=p.useState(r),[P,I]=p.useState(!0),[D,_]=p.useState(""),[L,F]=p.useState(0),[M,V]=p.useState(()=>new Set),q=p.useDeferredValue(f),U=p.useMemo(()=>{const Y=q.trim().toLocaleLowerCase();return Y?l.filter(X=>`${X.name} ${X.description} ${RB(X.operatingSystem)} ${Lp(X.language)} ${IB(X.baseEnvironment)}`.toLocaleLowerCase().includes(Y)):l},[q,l]),J=p.useCallback((Y="",X=!1)=>{C.current+=1,S({key:C.current,initialValue:Y,autoInspect:X})},[]),z=p.useCallback((Y,X=!1)=>{const ie=Y.trim();if(!ie.startsWith("akenv://")||!X&&Joe.has(ie))return!1;const ee=Iz(ie);return!ee.length||ee.length>X7?!1:(Joe.add(ie),N(""),J(ie,!0),!0)},[J]),Z=p.useCallback(async()=>{var Y;if(!(u.kind!=="list"||k)){if(typeof navigator>"u"||!((Y=navigator.clipboard)!=null&&Y.readText)){N(s("environmentCenter.clipboardUnsupported"));return}try{const X=await navigator.clipboard.readText();!z(X)&&!X.trim()&&await wZt()&&N(s("environmentCenter.clipboardReadError"))}catch{N(s("environmentCenter.clipboardReadError"))}}},[k,z,s,u.kind]);p.useEffect(()=>{const Y=new AbortController;return l.length===0&&I(!0),_(""),BA(Y.signal).then(X=>{c(X)}).catch(X=>{(X==null?void 0:X.name)!=="AbortError"&&(xZt(X)?(c([]),R(!1),j(s("environmentCenter.storageUnavailable"))):_(X instanceof Error?X.message:String(X)))}).finally(()=>{Y.signal.aborted||I(!1)}),()=>Y.abort()},[L]),p.useEffect(()=>{if(!l.some(X=>X.latestVersion&&$y.has(X.latestVersion.status)))return;const Y=window.setTimeout(()=>F(X=>X+1),2500);return()=>window.clearTimeout(Y)},[l]),p.useEffect(()=>{if(!E||T)return;const Y=window.setTimeout(()=>j(""),2800);return()=>window.clearTimeout(Y)},[T,E]),p.useEffect(()=>{r&&N(r)},[r]),p.useEffect(()=>{i&&z(i.text)},[i,z]),p.useEffect(()=>{if(u.kind!=="list")return;const Y=()=>void Z(),X=()=>{document.visibilityState==="visible"&&Z()},ie=ee=>{var pe;const be=ee.target;if(be instanceof HTMLInputElement||be instanceof HTMLTextAreaElement||be instanceof HTMLElement&&be.isContentEditable)return;const ue=((pe=ee.clipboardData)==null?void 0:pe.getData("text/plain"))??"";z(ue,!0)&&ee.preventDefault()};return window.addEventListener("focus",Y),document.addEventListener("visibilitychange",X),window.addEventListener("paste",ie),()=>{window.removeEventListener("focus",Y),document.removeEventListener("visibilitychange",X),window.removeEventListener("paste",ie)}},[z,Z,u.kind]);const ne=u.kind==="editor"&&u.environmentId?l.find(Y=>Y.id===u.environmentId):void 0,W=async Y=>{const X={...Y,dockerfile:Y.dockerfile??mH(Y,e)},ie=ne?await GTe(ne.id,X):await KTe(X);if(c(ee=>[ie,...ee.filter(be=>be.id!==ie.id)]),d({kind:"list"}),R(!1),X.imageSource){j(s("environmentCenter.status.boundImage",{name:ie.name}));return}try{const ee=await U8(ie.id);c(be=>be.map(ue=>ue.id===ie.id?{...ue,latestVersion:ee}:ue)),j(s("environmentCenter.status.queued",{name:ie.name}))}catch(ee){R(!0),j(s("environmentCenter.status.savedBuildFailed",{error:ee instanceof Error?ee.message:String(ee)}))}},G=async Y=>{if(!M.has(Y.id)){V(X=>new Set(X).add(Y.id)),R(!1);try{const X=await U8(Y.id);c(ie=>ie.map(ee=>ee.id===Y.id?{...ee,latestVersion:X}:ee)),j(s("environmentCenter.status.queued",{name:Y.name}))}catch(X){R(!0),j(X instanceof Error?X.message:String(X))}finally{V(X=>{const ie=new Set(X);return ie.delete(Y.id),ie})}}},H=(Y,X,ie,ee)=>{Y.length&&c(be=>{const ue=new Set(Y.map(pe=>pe.id));return[...Y,...be.filter(pe=>!ue.has(pe.id))]}),R(ee>0),j(ee>0?s("environmentCenter.status.importedFailed",{created:X,failed:ee}):ie>0?s("environmentCenter.status.importedDuplicate",{created:X,duplicate:ie}):s("environmentCenter.status.imported",{count:X}))},se=m?a.jsx(Cd,{title:s("environmentCenter.deleteTitle"),description:s("environmentCenter.deleteDescription",{name:m.name}),confirmLabel:s("common.delete"),variant:"danger",onCancel:()=>g(null),onConfirm:()=>{const Y=m;g(null),d({kind:"list"}),XTe(Y.id).then(()=>{c(X=>X.filter(ie=>ie.id!==Y.id)),R(!1),j(s("environmentCenter.status.deleted",{name:Y.name}))}).catch(X=>{R(!0),j(X instanceof Error?X.message:String(X))})}}):null;return u.kind==="editor"?a.jsxs(a.Fragment,{children:[a.jsx(BZt,{environment:ne,cloudProvider:e,onCancel:()=>d({kind:"list"}),onDelete:ne?()=>g(ne):void 0,onShare:ne?()=>O(ne):void 0,onSave:W},u.environmentId??"new"),x?a.jsx($Zt,{environment:x,onClose:()=>O(null)}):null,se]}):a.jsxs(gK,{section:"environments",className:"environment-center",onWorkspace:t,onProjects:n,actions:a.jsxs(a.Fragment,{children:[E?a.jsx("span",{className:`environment-status${T?" is-error":""}`,role:T?"alert":"status","aria-live":"polite",children:E}):null,a.jsx(Zp,{"aria-label":s("environmentCenter.search"),value:f,onChange:Y=>h(Y.target.value),placeholder:s("environmentCenter.search")})]}),children:[A?a.jsxs("div",{className:"environment-clipboard-notice",role:"alert",children:[a.jsx("span",{children:A}),a.jsx(_t,{type:"button",color:"secondary",variant:"soft",size:"sm",onClick:()=>{N(""),J()},children:s("environmentCenter.manualImport")})]}):null,a.jsx(Jp,{"aria-live":"polite",children:P?a.jsx(cl,{}):D?a.jsxs("div",{className:"environment-load-error",role:"alert",children:[a.jsx("p",{children:So(D,o.resolvedLanguage||o.language)||s("environmentCenter.loadFailed")}),a.jsx(_t,{color:"secondary",variant:"soft",size:"sm",onClick:()=>F(Y=>Y+1),children:s("common.reload")})]}):U.length===0&&f.trim()?a.jsx("div",{className:"environment-empty",children:a.jsxs(Wn,{fill:"none",children:[a.jsx(Wn.Icon,{children:a.jsx(CZt,{})}),a.jsx(Wn.Title,{children:s("environmentCenter.noMatches")}),a.jsx(Wn.Description,{children:s("environmentCenter.tryAnotherName")})]})}):a.jsxs(W0,{children:[f.trim()?null:a.jsxs(a.Fragment,{children:[a.jsx(lb,{"aria-label":s("environmentCenter.create"),icon:a.jsx(kZt,{}),onClick:()=>d({kind:"editor",environmentId:null}),children:s("environmentCenter.create")}),a.jsx(lb,{"aria-label":s("environmentCenter.import.title"),icon:a.jsx(SZt,{}),onClick:()=>J(),children:s("environmentCenter.import.title")})]}),U.map(Y=>{var be,ue;const X=A9e(Y,s),ie=!!(Y.latestVersion&&$y.has(Y.latestVersion.status)),ee=M.has(Y.id);return a.jsx(G0,{className:"environment-card",title:Y.name,status:a.jsx(Ya,{color:X.color,size:"sm",children:X.label}),description:((be=Y.latestVersion)==null?void 0:be.error)||(ie?(ue=Y.latestVersion)==null?void 0:ue.currentStep:"")||Y.description||s("common.noDescription"),metadata:[{label:s("workspace.updated"),value:jZt(Y.updatedAt,o.resolvedLanguage??o.language),title:NZt(Y.updatedAt,o.resolvedLanguage??o.language)}],action:{label:Y.latestVersion?s("environmentCenter.buildDetails.title"):s(ee?"environmentCenter.buildDetails.starting":"environmentCenter.startBuild"),icon:"play",title:s("environmentCenter.build"),disabled:ee,onClick:()=>Y.latestVersion?v(Y.id):void G(Y)},auxiliaryAction:{label:s("environmentCenter.manifest.view"),icon:a.jsx(sat,{}),title:Y.latestVersion?s("environmentCenter.manifest.viewShort"):s("environmentCenter.manifest.unavailable"),disabled:!Y.latestVersion,onClick:()=>w(Y)},detailAction:{label:s("environmentCenter.configure"),onClick:()=>d({kind:"editor",environmentId:Y.id})}},Y.id)})]})}),b?(()=>{const Y=l.find(X=>X.id===b);return Y?a.jsx(PZt,{environment:Y,onClose:()=>v(null),onBuildUpdate:X=>{c(ie=>ie.map(ee=>ee.id===Y.id?{...ee,latestVersion:X}:ee))},onRebuild:()=>G(Y)}):null})():null,y!=null&&y.latestVersion?a.jsx(IZt,{environment:y,onClose:()=>w(null)}):null,se,k?a.jsx(FZt,{initialValue:k.initialValue,autoInspect:k.autoInspect,onClose:()=>S(null),onImported:H},k.key):null]})}function UZt(e){const t=e instanceof Error?e.message:String(e??"");return t.includes("HTTP 503")&&(t.includes("未配置持久化存储")||t.includes("storage is not configured"))}function QZt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function zZt(e){return a.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"4.5",y:"7",width:"23",height:"18",rx:"3"}),a.jsx("path",{d:"M10 7V5.5A1.5 1.5 0 0 1 11.5 4h4A1.5 1.5 0 0 1 17 5.5V7M9 13h5v5H9zM18 13h5M18 17h5M9 22h14"})]})}function Z7(e,t){const n=Date.parse(e);return Number.isNaN(n)?e:new Intl.DateTimeFormat(t,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(n)}function VZt(e,t){return e.environmentIds.reduce((n,i)=>{var r,s;return((s=(r=t.get(i))==null?void 0:r.latestVersion)==null?void 0:s.status)==="available"?n+1:n},0)}function HZt({workspace:e,environments:t,onBack:n,onSave:i,onDelete:r}){const{t:s,i18n:o}=Te("ui"),[l,c]=p.useState((e==null?void 0:e.name)??""),[u,d]=p.useState((e==null?void 0:e.description)??""),[f,h]=p.useState((e==null?void 0:e.environmentIds)??[]),[m,g]=p.useState(""),[b,v]=p.useState(!1),[y,w]=p.useState(""),x=m.trim().toLocaleLowerCase(),O=t.filter(S=>`${S.name} ${S.description} ${Lp(S.language)}`.toLocaleLowerCase().includes(x)),k=async S=>{if(S.preventDefault(),!(!l.trim()||b)){v(!0),w("");try{await i({name:l.trim(),description:u.trim(),environmentIds:f})}catch(C){w(C instanceof Error?C.message:String(C)),v(!1)}}};return a.jsx(kh,{className:"workspace-center","aria-label":s(e?"workspace.detail":"workspace.create"),children:a.jsxs(oT,{title:e?e.name:s("workspace.create"),description:s("workspace.editorDescription"),identitySeed:(e==null?void 0:e.name)||s("workspace.create"),backLabel:s("workspace.backToList"),onBack:n,actions:a.jsxs(a.Fragment,{children:[r?a.jsx("button",{type:"button",className:"is-danger",onClick:r,children:s("common.delete")}):null,a.jsx("button",{type:"submit",form:"workspace-form",disabled:b||!l.trim(),children:s(b?"common.saving":"common.save")})]}),children:[e?a.jsxs(bH,{children:[a.jsxs("div",{children:[a.jsx("dt",{children:s("common.environment")}),a.jsx("dd",{children:s("workspace.environmentCount",{count:f.length})})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("workspace.createdAt")}),a.jsx("dd",{children:Z7(e.createdAt,o.resolvedLanguage??o.language)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("workspace.updatedAt")}),a.jsx("dd",{children:Z7(e.updatedAt,o.resolvedLanguage??o.language)})]})]}):null,a.jsxs("form",{id:"workspace-form",className:"workspace-form",onSubmit:k,children:[a.jsxs("section",{className:"workspace-fields","aria-label":s("workspace.basicInfo"),children:[a.jsxs("label",{children:[a.jsx("span",{children:s("common.name")}),a.jsx(_s,{value:l,maxLength:128,autoFocus:!0,onChange:S=>c(S.target.value),placeholder:s("workspace.namePlaceholder")})]}),a.jsxs("label",{children:[a.jsx("span",{children:s("common.description")}),a.jsx(vb,{value:u,maxLength:2e3,onChange:S=>d(S.target.value),placeholder:s("workspace.descriptionPlaceholder")})]})]}),a.jsxs("section",{className:"workspace-environments",children:[a.jsx(XIe,{title:s("common.environment"),description:s("workspace.selectedEnvironmentCount",{count:f.length}),actions:a.jsx(Zp,{"aria-label":s("workspace.searchAvailableEnvironments"),value:m,onChange:S=>g(S.target.value),placeholder:s("workspace.searchEnvironments")})}),t.length===0?a.jsxs("div",{className:"workspace-environment-empty",children:[a.jsx("p",{children:s("workspace.noAvailableEnvironments")}),a.jsx("span",{children:s("workspace.createEnvironmentFirst")})]}):O.length===0?a.jsxs("div",{className:"workspace-environment-empty",children:[a.jsx("p",{children:s("workspace.noMatchingEnvironments")}),a.jsx("span",{children:s("workspace.tryAnotherName")})]}):a.jsx("div",{className:"workspace-environment-list",children:O.map(S=>{var j;const C=f.includes(S.id),E=((j=S.latestVersion)==null?void 0:j.status)==="available"?s("workspace.environmentStatus.available"):S.latestVersion?s("workspace.environmentStatus.building"):s("workspace.environmentStatus.notBuilt");return a.jsxs("label",{className:`workspace-environment-option${C?" is-selected":""}`,children:[a.jsx("input",{type:"checkbox",checked:C,onChange:()=>h(T=>C?T.filter(R=>R!==S.id):[...T,S.id])}),a.jsxs("span",{className:"workspace-environment-option__copy",children:[a.jsx("strong",{title:S.name,children:S.name}),a.jsxs("span",{children:[Lp(S.language)," · ",E]})]}),a.jsx("span",{className:"workspace-environment-option__action",children:s(C?"workspace.added":"common.add")})]},S.id)})})]}),y?a.jsx("p",{className:"workspace-form-error",role:"alert",children:y}):null]})]})})}function qZt({onEnvironment:e,onProjects:t}){const{t:n,i18n:i}=Te("ui"),[r,s]=p.useState([]),[o,l]=p.useState([]),[c,u]=p.useState({kind:"list"}),[d,f]=p.useState(""),[h,m]=p.useState(!0),[g,b]=p.useState(""),[v,y]=p.useState(""),[w,x]=p.useState(!1),[O,k]=p.useState(null),[S,C]=p.useState(0),E=p.useDeferredValue(d);p.useEffect(()=>{const A=new AbortController;return m(!0),b(""),Promise.all([Mz(A.signal),BA(A.signal)]).then(([N,P])=>{s(N),l(P)}).catch(N=>{(N==null?void 0:N.name)!=="AbortError"&&(UZt(N)?(s([]),l([]),x(!1),y(n("workspace.storageUnavailable"))):(console.warn("Unable to load Studio workspaces",N),b(n("workspace.loadFailed"))))}).finally(()=>{A.signal.aborted||m(!1)}),()=>A.abort()},[S,n]),p.useEffect(()=>{if(!v||w)return;const A=window.setTimeout(()=>y(""),2800);return()=>window.clearTimeout(A)},[w,v]);const j=p.useMemo(()=>new Map(o.map(A=>[A.id,A])),[o]),T=p.useMemo(()=>{const A=E.trim().toLocaleLowerCase();return A?r.filter(N=>{const P=N.environmentIds.map(I=>{var D;return((D=j.get(I))==null?void 0:D.name)??""}).join(" ");return`${N.name} ${N.description} ${P}`.toLocaleLowerCase().includes(A)}):r},[E,j,r]),R=c.kind==="detail"&&c.workspaceId?r.find(A=>A.id===c.workspaceId):void 0;return c.kind==="detail"?a.jsx(HZt,{workspace:R,environments:o,onBack:()=>u({kind:"list"}),onDelete:R?()=>k(R):null,onSave:async A=>{const N=R?await UTe(R.id,A):await BTe(A);s(P=>[N,...P.filter(I=>I.id!==N.id)]),x(!1),y(n("workspace.saved",{name:N.name})),u({kind:"list"})}},c.workspaceId??"new"):a.jsxs(gK,{section:"workspaces",onEnvironment:e,onProjects:t,actions:a.jsxs(a.Fragment,{children:[v?a.jsx("span",{className:`workspace-status${w?" is-error":""}`,role:w?"alert":"status","aria-live":"polite",children:v}):null,a.jsx(Zp,{"aria-label":n("workspace.searchWorkspaces"),value:d,onChange:A=>f(A.target.value),placeholder:n("workspace.searchWorkspaces")})]}),children:[a.jsx(Jp,{"aria-live":"polite",children:h?a.jsx(cl,{}):g?a.jsxs("div",{className:"workspace-load-error",role:"alert",children:[a.jsx("p",{children:g}),a.jsx(_t,{color:"secondary",variant:"soft",size:"sm",onClick:()=>C(A=>A+1),children:n("common.reload")})]}):T.length===0&&d.trim()?a.jsx("div",{className:"workspace-empty",children:a.jsxs(Wn,{fill:"none",children:[a.jsx(Wn.Icon,{children:a.jsx(zZt,{})}),a.jsx(Wn.Title,{children:n("workspace.noMatchingWorkspaces")}),a.jsx(Wn.Description,{children:n("workspace.tryAnotherNameOrEnvironment")})]})}):a.jsxs(W0,{children:[d.trim()?null:a.jsx(lb,{"aria-label":n("workspace.create"),icon:a.jsx(QZt,{}),onClick:()=>u({kind:"detail",workspaceId:null}),children:n("workspace.create")}),T.map(A=>{const N=VZt(A,j),P=A.environmentIds.filter(I=>!j.has(I)).length;return a.jsx(G0,{className:"workspace-card",title:A.name,status:a.jsx(Ya,{color:P?"danger":N===A.environmentIds.length&&N>0?"success":"secondary",size:"sm",children:A.environmentIds.length===0?n("workspace.noEnvironmentAdded"):P?n("workspace.environmentMissing"):n("workspace.availableFraction",{available:N,total:A.environmentIds.length})}),description:A.description||n("common.noDescription"),metadata:[{label:n("common.environment"),value:n("workspace.environmentCount",{count:A.environmentIds.length})},{label:n("workspace.available"),value:n("workspace.availableCount",{count:N})},{label:n("workspace.updated"),value:Z7(A.updatedAt,i.resolvedLanguage??i.language)}],detailAction:{label:n("common.manage"),onClick:()=>u({kind:"detail",workspaceId:A.id})},action:{label:n("workspace.addEnvironment"),icon:"plus",onClick:()=>u({kind:"detail",workspaceId:A.id})}},A.id)})]})}),O?a.jsx(Cd,{title:n("workspace.deleteTitle"),description:n("workspace.deleteDescription",{name:O.name}),confirmLabel:n("common.delete"),variant:"danger",onCancel:()=>k(null),onConfirm:()=>{const A=O;k(null),QTe(A.id).then(()=>{s(N=>N.filter(P=>P.id!==A.id)),x(!1),y(n("workspace.deleted",{name:A.name})),u({kind:"list"})}).catch(N=>{x(!0),y(N instanceof Error?N.message:String(N))})}}):null]})}function WZt({cloudProvider:e,onProjects:t,initialSection:n="workspaces"}){const[i,r]=p.useState(n),{t:s}=Te("ui"),[o,l]=p.useState(null),[c,u]=p.useState(""),d=p.useRef(0),f=()=>{var g;d.current+=1;const h=d.current;u("");let m=null;if(typeof navigator<"u"&&((g=navigator.clipboard)!=null&&g.readText))try{m=navigator.clipboard.readText()}catch{u(s("workspace.clipboardPermissionError"))}else u(s("workspace.clipboardUnsupported"));r("environments"),m&&m.then(async b=>{var v;if(d.current===h){if(b.trim()){l({key:h,text:b});return}try{const y=await((v=navigator.permissions)==null?void 0:v.query({name:"clipboard-read"}));d.current===h&&(y==null?void 0:y.state)==="denied"&&u(s("workspace.clipboardPermissionError"))}catch{}}}).catch(()=>{d.current===h&&u(s("workspace.clipboardPermissionError"))})};return i==="environments"?a.jsx(j9e,{cloudProvider:e,onWorkspace:()=>r("workspaces"),onProjects:t,clipboardImport:o,clipboardReadError:c}):a.jsx(qZt,{onEnvironment:f,onProjects:t})}const KZt={id:"mpa-channels",kind:"mpa-channels",category:"channels",icon:"mpa-channels",name:"MPA agent messaging channels",description:"Connect an existing MPA agent to Feishu, WeCom and DingTalk."};function GZt(e){return e==="127.0.0.1"}const XZt={id:"coding-agents",kind:"coding-agent",category:"development",icon:"coding-agents",name:"Configure coding agents",badge:"Local",badgeTone:"success",description:"Install built-in VeADK and AgentKit skills globally for Trae, Claude Code, or Codex."},YZt={id:"feishu",kind:"feishu",category:"channels",icon:"feishu",name:"Feishu bot",badge:"Beta",description:"Create a Feishu bot and connect its messages directly to AgentKit Runtime."},ZZt={id:"gitlab-review",kind:"gitlab",category:"development",icon:"gitlab",name:"GitLab MR review",description:"Use a GitLab integration to review merge requests in an isolated Sandbox."};bn.hasResourceBundle("en-US","automations")||bn.addResourceBundle("en-US","automations",xfe,!0,!0);bn.hasResourceBundle("zh-CN","automations")||bn.addResourceBundle("zh-CN","automations",C0e,!0,!0);function Ch(e,t={}){return bn.t(e,{...t,ns:"automations"})}const N9e={name:"repository",label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL",required:!0},R9e={name:"baseBranch",label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base",required:!1},I9e={name:"runtimeName",label:"Runtime name",placeholder:"support-agent",help:"Used by the AgentKit delivery configuration",required:!0},P9e={name:"runtimeId",label:"Runtime ID",placeholder:"rt-xxxxxxxx",help:"The AgentKit Runtime that will receive continuous updates",required:!0},JZt="https://ark.cn-beijing.volces.com/api/coding/v3";function eJt(e){return e==="byteplus"?Po(e):JZt}function xK(e){return e==="byteplus"?{accessKey:"BYTEPLUS_ACCESS_KEY",secretKey:"BYTEPLUS_SECRET_KEY",sessionToken:"BYTEPLUS_SESSION_TOKEN"}:{accessKey:"VOLCENGINE_ACCESS_KEY",secretKey:"VOLCENGINE_SECRET_KEY",sessionToken:"VOLCENGINE_SESSION_TOKEN"}}function D9e(e){const t=xK(e);return[Ch("github.secretPair",{accessKey:t.accessKey,secretKey:t.secretKey}),Ch("github.sessionToken",{sessionToken:t.sessionToken})]}function wK(e){return e==="byteplus"?"BytePlus":"Volcengine"}function OK(e,t={}){return{repository:"",baseBranch:"main",projectPath:".",runtimeName:"",runtimeId:"",modelName:"",modelBaseUrl:eJt(e),region:Zi(e),token:"",...t}}function M9e(e){return{repository:e.repository.trim(),baseBranch:e.baseBranch.trim()||"main",region:e.region,token:e.token.trim()}}const tJt={id:"review",kind:"github",category:"development",icon:"github",name:"Automated PR review",description:"Use a GitHub App to review pull requests in an isolated Sandbox.",title:"Automated PR review",subtitle:"Trigger Sandbox reviews through the GitHub App and publish results to pull requests",panel:"Install the GitHub App to target repositories, then enable automated review for each repository.",submitLabel:"Install GitHub App",fields:[],initialValues:({cloudProvider:e})=>OK(e),regionHelp:"",secrets:()=>[],async submit(){throw new Error("PR 自动评审已切换为 GitHub App 授权模式。")}},nJt="https://api.github.com",iJt=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,nle=/^[A-Za-z0-9][A-Za-z0-9._/-]{0,199}$/,rJt=/^[A-Za-z0-9._/-]+$/;function sJt(e,t,n){const i=String((t==null?void 0:t.message)||"");return e===403&&/workflow/i.test(i)?"GitHub Token 缺少 Workflows 写权限,无法创建或更新 .github/workflows 下的文件":e===401||e===403?Q("github.invalidToken"):e===404?Q("github.notFound"):e===422?Q("github.rejectedCommit"):i.split(n).join("***").trim().slice(0,240)||Q("github.requestFailed",{status:e})}async function iy(e,t){const n={Accept:"application/vnd.github+json",Authorization:`Bearer ${t.token}`,"X-GitHub-Api-Version":"2022-11-28"};t.body&&(n["Content-Type"]="application/json");let i;try{i=await fetch(`${nJt}${e}`,{method:t.method||"GET",headers:n,body:t.body?JSON.stringify(t.body):void 0,signal:t.signal})}catch(s){throw t.signal.aborted?s:new Error(Q("github.networkFailed"))}const r=await i.json().catch(()=>null);if(!t.expected.includes(i.status))throw new Error(sJt(i.status,r,t.token));return{status:i.status,payload:r}}function y6(e){return e.split("/").map(encodeURIComponent).join("/")}function aJt(e){const t=new TextEncoder().encode(e);let n="";const i=32768;for(let r=0;r({...h,path:SK(h.path,"")})),s=AbortSignal.any([t,AbortSignal.timeout(6e4)]),o=`/repos/${n}`;await iy(`${o}`,{token:e.token,expected:[200],signal:s});const c=(f=(await iy(`${o}/git/ref/heads/${y6(i)}`,{token:e.token,expected:[200],signal:s})).payload.object)==null?void 0:f.sha;if(!c)throw new Error(Q("github.missingBaseSha"));const u=oJt(e.branchPrefix);await iy(`${o}/git/refs`,{token:e.token,expected:[201],signal:s,method:"POST",body:{ref:`refs/heads/${u}`,sha:c}});let d=!0;try{for(const m of r){const g=y6(m.path),b=await iy(`${o}/contents/${g}?ref=${encodeURIComponent(i)}`,{token:e.token,expected:[200,404],signal:s});if(m.mustBeNew&&b.status===200)throw new Error(Q("github.fileAlreadyExists",{path:m.path}));if(b.status===200&&!b.payload.sha)throw new Error(Q("github.pathNotUpdatable",{path:m.path}));await iy(`${o}/contents/${g}`,{token:e.token,expected:[200,201],signal:s,method:"PUT",body:{message:m.commitMessage,content:aJt(m.content),branch:u,...b.payload.sha?{sha:b.payload.sha}:{}}})}const h=await iy(`${o}/pulls`,{token:e.token,expected:[201],signal:s,method:"POST",body:{title:e.title,head:u,base:i,body:e.description}});if(!h.payload.number||!h.payload.html_url)throw new Error(Q("github.invalidPullRequest"));return d=!1,{number:h.payload.number,url:h.payload.html_url,branch:u}}finally{d&&await iy(`${o}/git/refs/heads/${y6(u)}`,{token:e.token,expected:[204],signal:AbortSignal.timeout(15e3),method:"DELETE"}).catch(()=>{})}}async function lJt(e,t){const n=await yn("/web/github/pull-request-reviews",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e),signal:t});if(!n.ok)throw await WT(n);const i=await n.json();if(i.status!=="started"||typeof i.sessionId!="string"||!i.sessionId||typeof i.displayName!="string")throw new Error("PR 评审服务返回了无效结果。");return i}async function cJt(e){const t=await yn("/web/github/app/config",{method:"GET",headers:{Accept:"application/json"},signal:e});if(!t.ok)throw await WT(t);const n=await t.json();if(typeof n.configured!="boolean"||typeof n.appSlug!="string"||typeof n.installUrl!="string"||typeof n.reason!="string")throw new Error("GitHub App 配置响应格式无效。");return n}async function uJt(e,t){var s;const n=new URLSearchParams({page:String(t.page),pageSize:String(t.pageSize)});(s=t.query)!=null&&s.trim()&&n.set("q",t.query.trim());const i=await yn(`/web/github/app/repositories?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await WT(i);const r=await i.json();if(!Array.isArray(r.repositories)||typeof r.page!="number"||typeof r.pageSize!="number"||typeof r.hasNextPage!="boolean"||typeof r.reviewSettingsConfigured!="boolean"||typeof r.reviewSettingsReason!="string"||r.repositories.some(o=>typeof o!="object"||o===null||typeof o.installationId!="number"||typeof o.account!="string"||typeof o.fullName!="string"||typeof o.htmlUrl!="string"||typeof o.private!="boolean"||typeof o.reviewEnabled!="boolean"))throw new Error("GitHub App 仓库列表响应格式无效。");return r}async function dJt(e,t){const n=new URLSearchParams({page:String(t.page),pageSize:String(t.pageSize)}),i=await yn(`/web/github/app/review-records?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await WT(i);const r=await i.json();if(!Array.isArray(r.records)||typeof r.page!="number"||typeof r.pageSize!="number"||typeof r.hasNextPage!="boolean"||typeof r.reviewSettingsConfigured!="boolean"||typeof r.reviewSettingsReason!="string"||r.records.some(s=>typeof s!="object"||s===null||typeof s.id!="string"||typeof s.repository!="string"||typeof s.pullRequestUrl!="string"||typeof s.pullRequestNumber!="number"||!["started","completed","ignored","failed"].includes(String(s.status))||!["manual","webhook"].includes(String(s.trigger))||typeof s.createdAt!="string"||typeof s.deliveryId!="string"||typeof s.action!="string"||typeof s.sessionId!="string"||typeof s.displayName!="string"||typeof s.reason!="string"))throw new Error("PR 评审记录响应格式无效。");return r}async function fJt(e,t){const n=await yn("/web/github/app/review-repositories",{method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e),signal:t});if(!n.ok)throw await WT(n);const i=await n.json();if(!Array.isArray(i.repositories)||i.repositories.some(r=>typeof r!="string"))throw new Error("GitHub App 评审仓库保存响应格式无效。");return i.repositories}async function WT(e){const t=await e.text().catch(()=>"");try{const n=JSON.parse(t),i=typeof n.detail=="object"&&n.detail?n.detail.message:n.detail??n.message??n.error,r=typeof i=="string"?i:"";return new Error(r||`PR 评审发起失败(HTTP ${e.status})`)}catch{return new Error(t||`PR 评审发起失败(HTTP ${e.status})`)}}const hJt=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/,pJt="cn-hongkong";function mJt(e){const t=ov(e.runtimeName,n=>Ch(`github.validation.runtimeName.${n}`));if(t)throw new Error(t);if(!hJt.test(e.runtimeId))throw new Error(Ch("github.validation.runtimeId"))}function $9e(e){mJt(e);const t=e.cloudProvider??"volcengine",n=xK(t),i=t==="byteplus"?` VOLCENGINE_ACCESS_KEY: \${{ secrets.${n.accessKey} }} VOLCENGINE_SECRET_KEY: \${{ secrets.${n.secretKey} }} VOLCENGINE_SESSION_TOKEN: \${{ secrets.${n.sessionToken} }} @@ -969,7 +969,7 @@ jobs: if not result.success: raise SystemExit(f"AgentKit publish failed: {result.error}") PY -`,o={__BASE_BRANCH__:JSON.stringify(e.baseBranch),__PROJECT_PATH__:JSON.stringify(e.projectPath),__RUNTIME_NAME__:JSON.stringify(e.runtimeName),__RUNTIME_ID__:JSON.stringify(e.runtimeId),__REGION__:JSON.stringify(e.region),__CLOUD_PROVIDER__:JSON.stringify(t),__ACCESS_KEY_SECRET__:n.accessKey,__SECRET_KEY_SECRET__:n.secretKey,__SESSION_TOKEN_SECRET__:n.sessionToken,__BYTEPLUS_ENV__:i,__BYTEPLUS_RUNTIME_ENV__:r,__CONCURRENCY_GROUP__:JSON.stringify(`agentkit-runtime-${e.runtimeId}`)};return Object.entries(o).reduce((l,[c,u])=>l.split(c).join(u),s)}const gJt={id:"delivery",kind:"github",category:"development",icon:"github",name:"AgentKit Runtime delivery",description:"Add a workflow that continuously delivers your repository to AgentKit Runtime.",title:"AgentKit Runtime delivery",subtitle:"Add continuous delivery to the repository through a pull request",panel:"This creates a release branch and opens a pull request containing the GitHub Actions workflow.",submitLabel:"Confirm and create PR",fields:[N9e,R9e,{name:"projectPath",label:"Agent project directory",placeholder:".",help:"Defaults to the repository root; the directory must contain an app.py that mounts the complete Studio App Server",required:!1},I9e,P9e],initialValues:({cloudProvider:e})=>OK(e),regionHelp:"Must match the target Runtime region",secrets:({cloudProvider:e})=>D9e(e),submit(e,t,n){const i=M9e(e),r=SK(e.projectPath,"."),s=wK(t.cloudProvider);return L9e({...i,files:[{path:".github/workflows/publish-agentkit.yml",content:$9e({baseBranch:i.baseBranch,projectPath:r,runtimeName:e.runtimeName.trim(),runtimeId:e.runtimeId.trim(),region:i.region,cloudProvider:t.cloudProvider}),commitMessage:"feat: publish Agent to AgentKit Runtime"}],branchPrefix:"feat/agentkit-release",title:Eh("cards.delivery.pullRequest.title"),description:Eh("cards.delivery.pullRequest.description",{provider:s})},n)}};function bJt(e,t){return e==="."?t:`${e}/${t}`}function yJt(e){return`.github/workflows/publish-agentkit-${e.replace(/[^A-Za-z0-9]+/g,"-").replace(/^-|-$/g,"").toLowerCase()||"root"}.yml`}const vJt={volcengine:"agentkit-prod-public-cn-beijing.cr.volces.com/base/py-simple:python3.12-bookworm-slim-latest",byteplus:"agentkit-prod-public-ap-southeast-1.cr.bytepluses.com/base/py-simple:python3.12-bookworm-slim-latest"},xJt="1.1.13",wJt=["https://mirrors.cloud.tencent.com/pypi/simple","https://pypi.mirrors.ustc.edu.cn/simple","https://pypi.org/simple"];function OJt(e){return e!=="volcengine"?"RUN uv pip install -r requirements.txt":`RUN ${wJt.map(n=>`uv pip install --index-url ${n} -r requirements.txt`).join(` || \\ +`,o={__BASE_BRANCH__:JSON.stringify(e.baseBranch),__PROJECT_PATH__:JSON.stringify(e.projectPath),__RUNTIME_NAME__:JSON.stringify(e.runtimeName),__RUNTIME_ID__:JSON.stringify(e.runtimeId),__REGION__:JSON.stringify(e.region),__CLOUD_PROVIDER__:JSON.stringify(t),__ACCESS_KEY_SECRET__:n.accessKey,__SECRET_KEY_SECRET__:n.secretKey,__SESSION_TOKEN_SECRET__:n.sessionToken,__BYTEPLUS_ENV__:i,__BYTEPLUS_RUNTIME_ENV__:r,__CONCURRENCY_GROUP__:JSON.stringify(`agentkit-runtime-${e.runtimeId}`)};return Object.entries(o).reduce((l,[c,u])=>l.split(c).join(u),s)}const gJt={id:"delivery",kind:"github",category:"development",icon:"github",name:"AgentKit Runtime delivery",description:"Add a workflow that continuously delivers your repository to AgentKit Runtime.",title:"AgentKit Runtime delivery",subtitle:"Add continuous delivery to the repository through a pull request",panel:"This creates a release branch and opens a pull request containing the GitHub Actions workflow.",submitLabel:"Confirm and create PR",fields:[N9e,R9e,{name:"projectPath",label:"Agent project directory",placeholder:".",help:"Defaults to the repository root; the directory must contain an app.py that mounts the complete Studio App Server",required:!1},I9e,P9e],initialValues:({cloudProvider:e})=>OK(e),regionHelp:"Must match the target Runtime region",secrets:({cloudProvider:e})=>D9e(e),submit(e,t,n){const i=M9e(e),r=SK(e.projectPath,"."),s=wK(t.cloudProvider);return L9e({...i,files:[{path:".github/workflows/publish-agentkit.yml",content:$9e({baseBranch:i.baseBranch,projectPath:r,runtimeName:e.runtimeName.trim(),runtimeId:e.runtimeId.trim(),region:i.region,cloudProvider:t.cloudProvider}),commitMessage:"feat: publish Agent to AgentKit Runtime"}],branchPrefix:"feat/agentkit-release",title:Ch("cards.delivery.pullRequest.title"),description:Ch("cards.delivery.pullRequest.description",{provider:s})},n)}};function bJt(e,t){return e==="."?t:`${e}/${t}`}function yJt(e){return`.github/workflows/publish-agentkit-${e.replace(/[^A-Za-z0-9]+/g,"-").replace(/^-|-$/g,"").toLowerCase()||"root"}.yml`}const vJt={volcengine:"agentkit-prod-public-cn-beijing.cr.volces.com/base/py-simple:python3.12-bookworm-slim-latest",byteplus:"agentkit-prod-public-ap-southeast-1.cr.bytepluses.com/base/py-simple:python3.12-bookworm-slim-latest"},xJt="1.1.13",wJt=["https://mirrors.cloud.tencent.com/pypi/simple","https://pypi.mirrors.ustc.edu.cn/simple","https://pypi.org/simple"];function OJt(e){return e!=="volcengine"?"RUN uv pip install -r requirements.txt":`RUN ${wJt.map(n=>`uv pip install --index-url ${n} -r requirements.txt`).join(` || \\ `)}`}function kJt(e){const t=xK(e);return`# Local ${wK(e)} credentials. Never commit real values. ${t.accessKey}= ${t.secretKey}= @@ -980,8 +980,8 @@ AGENTKIT_CLOUD_PROVIDER=${e} # Optional model overrides. # MODEL_AGENT_PROVIDER=openai -# MODEL_AGENT_NAME=${Xp(e)} -# MODEL_AGENT_API_BASE=${Do(e)} +# MODEL_AGENT_NAME=${Kp(e)} +# MODEL_AGENT_API_BASE=${Po(e)} # MODEL_AGENT_API_KEY= # Optional Feishu Channel credentials. Studio can create and bind these. @@ -1082,20 +1082,20 @@ __pycache__/ Dockerfile .dockerignore README.md -`};return Object.fromEntries(Object.entries(n).map(([i,r])=>[i,r.split("__PROJECT_NAME__").join(e)]))}const EJt={id:"template",kind:"github",category:"development",icon:"github",name:"Import starter project",description:"Create a minimal Agent project in your repository with continuous delivery to AgentKit Runtime.",title:"Import starter project",subtitle:"Add a ready-to-run basic Agent and continuous delivery configuration to your repository",panel:"This creates a pull request containing the basic project and AgentKit Runtime delivery workflow.",submitLabel:"Import template and create PR",fields:[N9e,R9e,{name:"projectPath",label:"Agent project directory",placeholder:"agentkit-basic-agent",help:"The basic project will be added here; app.py mounts the complete Studio App Server and serves as the entry point",required:!0},I9e,P9e],initialValues:({cloudProvider:e})=>OK(e,{projectPath:"agentkit-basic-agent"}),regionHelp:"Must match the target Runtime region",secrets:({cloudProvider:e})=>D9e(e),submit(e,t,n){const i=M9e(e),r=kK(i.repository),s=SK(e.projectPath,"agentkit-basic-agent"),o=s==="."?r.split("/").slice(-1)[0]||"agentkit-basic-agent":s.split("/").slice(-1)[0]||"agentkit-basic-agent",l=Object.entries(SJt(o,t.cloudProvider)).map(([c,u])=>({path:bJt(s,c),content:u,commitMessage:"feat: import AgentKit basic template",mustBeNew:!0}));return l.push({path:yJt(s),content:$9e({baseBranch:i.baseBranch,projectPath:s,runtimeName:e.runtimeName.trim(),runtimeId:e.runtimeId.trim(),region:i.region,cloudProvider:t.cloudProvider}),commitMessage:"feat: add AgentKit Runtime delivery",mustBeNew:!0}),L9e({...i,repository:r,files:l,branchPrefix:"feat/agentkit-basic-template",title:Eh("cards.template.pullRequest.title"),description:Eh("cards.template.pullRequest.description",{provider:wK(t.cloudProvider)})},n)}},CJt={id:"website-integration",kind:"website-integration",category:"channels",icon:"website-integration",name:"Website integration",description:"Embed an AgentKit Runtime on your website as a floating chat window."},rle=[{id:"development",label:"Development"},{id:"channels",label:"Messaging channels"}],F9e=[XZt,EJt,gJt,tJt,ZZt,YZt,KZt,CJt],AJt=new Map(F9e.map(e=>[e.id,e]));function TJt(e){const t=AJt.get(e);if(!t)throw new Error(`Unknown automation: ${e}`);return t}function _Jt(e){const t=TJt(e);if(t.kind!=="github")throw new Error(`Automation is not backed by GitHub: ${e}`);return t}function B9e(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"8",y:"3",width:"8",height:"6",rx:"2"}),a.jsx("path",{d:"M12 9v4M5 16v-1a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v1M12 13v3"}),a.jsx("rect",{x:"2",y:"16",width:"6",height:"5",rx:"1.5"}),a.jsx("rect",{x:"9",y:"16",width:"6",height:"5",rx:"1.5"}),a.jsx("rect",{x:"16",y:"16",width:"6",height:"5",rx:"1.5"})]})}function sle(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"10.8",cy:"10.8",r:"6.2",stroke:"currentColor",strokeWidth:"1.7"}),a.jsx("path",{d:"m15.4 15.4 4 4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function jJt(e){return a.jsxs("svg",{viewBox:"0 0 36 36",fill:"none","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"5",width:"18",height:"18",rx:"5",fill:"currentColor",opacity:"0.1"}),a.jsx("rect",{x:"3.5",y:"5",width:"18",height:"18",rx:"5",stroke:"currentColor",strokeWidth:"1.6"}),a.jsx("path",{d:"m9.2 11.2-2.8 2.7 2.8 2.7M12.1 17.4h4.3",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),a.jsx("circle",{cx:"26.5",cy:"12",r:"3",fill:"hsl(var(--background))",stroke:"currentColor",strokeWidth:"1.6"}),a.jsx("circle",{cx:"27",cy:"26.5",r:"3",fill:"hsl(var(--background))",stroke:"currentColor",strokeWidth:"1.6"}),a.jsx("path",{d:"M21.5 12h2M19.3 21l5.6 3.8M27 15v8.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}function NJt(e){return a.jsxs("svg",{viewBox:"0 0 36 36",fill:"none","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"5",width:"22",height:"18",rx:"4",stroke:"currentColor",strokeWidth:"1.6"}),a.jsx("path",{d:"M4.5 10h20M9 7.5h.1M12 7.5h.1",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),a.jsx("path",{d:"M18 18.5c0-3 2.5-5.5 5.5-5.5h3c3 0 5.5 2.5 5.5 5.5v5c0 3-2.5 5.5-5.5 5.5H25l-4 3v-3.6a5.5 5.5 0 0 1-3-4.9v-5Z",fill:"hsl(var(--background))",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),a.jsx("path",{d:"M22 19.5h6M22 23h4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}function RJt(e){return a.jsxs("svg",{viewBox:"0 0 36 36",fill:"none","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M18 31 5.5 21.8 8.7 6.5 14 17.1h8L27.3 6.5l3.2 15.3L18 31Z",fill:"currentColor",opacity:"0.12"}),a.jsx("path",{d:"M18 31 5.5 21.8 8.7 6.5 14 17.1h8L27.3 6.5l3.2 15.3L18 31Z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),a.jsx("path",{d:"m14 17.1 4 13.9 4-13.9M5.5 21.8h25",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"})]})}function IJt({onOpen:e,initialCategory:t="development",onCategoryChange:n}){var h;const{t:i}=Te("automations"),[r,s]=p.useState(t),[o,l]=p.useState(""),c=p.useDeferredValue(o),u=p.useMemo(()=>{const m=c.trim().toLocaleLowerCase();return F9e.filter(g=>g.category===r).filter(g=>!m||`${i(`cards.${g.id}.name`)} ${i(`cards.${g.id}.description`)}`.toLocaleLowerCase().includes(m))},[r,c,i]),d=(h=rle.find(m=>m.id===r))==null?void 0:h.id,f=GZt(window.location.hostname);return a.jsxs("div",{className:"applications-page",children:[a.jsxs("header",{className:"applications-header",children:[a.jsxs("div",{children:[a.jsx("h1",{children:i("title")}),a.jsx("p",{children:i("description")})]}),a.jsxs("label",{className:"applications-search",children:[a.jsx(sle,{}),a.jsx("input",{type:"search","aria-label":i("search"),value:o,onChange:m=>l(m.target.value),placeholder:i("search")})]})]}),a.jsx("nav",{className:"applications-categories","aria-label":i("categoriesLabel"),children:rle.map(m=>a.jsx("button",{type:"button",className:r===m.id?"is-active":"","aria-pressed":r===m.id,onClick:()=>{s(m.id),n==null||n(m.id)},children:i(`categories.${m.id}`)},m.id))}),a.jsx("section",{className:"applications-results","aria-label":i("resultsLabel",{category:i(`categories.${d}`)}),children:u.length?a.jsx("div",{className:"applications-grid",children:u.map(m=>{const g=m.id==="coding-agents"&&!f,b=g?"coding-agents-local-only-tooltip":void 0;return a.jsxs("div",{className:`application-card-wrap${g?" is-disabled":""}`,tabIndex:g?0:void 0,"aria-describedby":b,children:[a.jsxs("button",{type:"button",className:"application-card",onClick:()=>e(m.id),"aria-label":i("open",{name:i(`cards.${m.id}.name`)}),disabled:g,children:[m.icon==="feishu"?a.jsx("img",{className:"application-card-icon application-card-brand-icon",src:IL,alt:"","aria-hidden":"true"}):m.icon==="mpa-channels"?a.jsx(B9e,{className:"application-card-icon"}):m.icon==="coding-agents"?a.jsx(jJt,{className:"application-card-icon"}):m.icon==="website-integration"?a.jsx(NJt,{className:"application-card-icon"}):m.icon==="gitlab"?a.jsx(RJt,{className:"application-card-icon"}):a.jsx(bK,{className:"application-card-icon"}),a.jsxs("div",{className:"application-card-copy",children:[a.jsxs("div",{className:"application-card-title",children:[a.jsx("h2",{children:i(`cards.${m.id}.name`)}),m.badge?a.jsx("span",{className:`application-card-badge is-${m.badgeTone||"default"}`,children:i(`cards.${m.id}.badge`,{defaultValue:m.badge})}):null]}),a.jsx("p",{children:i(`cards.${m.id}.description`)})]})]}),g?a.jsx("span",{id:b,className:"application-card-tooltip",role:"tooltip",children:i("localOnly")}):null]},m.id)})}):a.jsxs("div",{className:"applications-empty",role:"status",children:[a.jsx(sle,{}),a.jsx("h2",{children:i("emptyTitle")}),a.jsx("p",{children:i("emptyDescription")})]})})]})}function Ph({open:e,keepMounted:t=!1,title:n,subtitle:i,icon:r,className:s="",busy:o=!1,initialFocusRef:l,onClose:c,children:u}){const{t:d}=Te("sandbox"),f=p.useId(),h=p.useRef(null),m=p.useRef(null),g=p.useRef(c);g.current=c;const b=p.useRef(o);return b.current=o,p.useEffect(()=>{var w;if(!e)return;m.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const v=document.body.style.overflow;document.body.style.overflow="hidden",(w=(l==null?void 0:l.current)??h.current)==null||w.focus();const y=x=>{var E;if(x.key==="Escape"){x.preventDefault(),b.current||g.current();return}if(x.key!=="Tab")return;const O=(E=h.current)==null?void 0:E.closest("[role=dialog]"),k=Array.from((O==null?void 0:O.querySelectorAll('button:not(:disabled), input:not(:disabled), iframe, [tabindex]:not([tabindex="-1"])'))??[]);if(k.length===0){x.preventDefault();return}const S=k[0],C=k[k.length-1];x.shiftKey&&document.activeElement===S?(x.preventDefault(),C.focus()):!x.shiftKey&&document.activeElement===C&&(x.preventDefault(),S.focus())};return window.addEventListener("keydown",y),()=>{var x;document.body.style.overflow=v,window.removeEventListener("keydown",y),(x=m.current)==null||x.focus()}},[e,l]),!e&&!t?null:vi.createPortal(a.jsx("div",{className:"sandbox-control-backdrop",hidden:!e,onMouseDown:v=>{v.target===v.currentTarget&&!o&&c()},children:a.jsxs("section",{className:`sandbox-control-dialog ${s}`.trim(),role:"dialog","aria-modal":"true","aria-labelledby":f,"aria-busy":o||void 0,children:[a.jsxs("header",{className:"sandbox-control-head",children:[a.jsx("span",{className:"sandbox-control-head-icon","aria-hidden":"true",children:r}),a.jsxs("div",{children:[a.jsx("h2",{id:f,children:n}),i?a.jsx("p",{children:i}):null]}),a.jsx("button",{ref:h,type:"button",className:"sandbox-control-close","aria-label":d("common.closeDialog",{title:n}),title:d("common.closeDialog",{title:n}),disabled:o,onClick:c,children:a.jsx($Ae,{})})]}),u]})}),document.body)}function PJt({open:e,kind:t,launch:n,loading:i,error:r,onReload:s,onClose:o}){const{t:l}=Te("sandbox"),c=t==="terminal",u=l(c?"tool.terminalTitle":"tool.browserTitle");return a.jsxs(Ph,{open:e,title:u,subtitle:l(c?"tool.terminalSubtitle":"tool.browserSubtitle"),icon:c?a.jsx(a0,{}):a.jsx(LAe,{}),className:`sandbox-tool-dialog sandbox-tool-dialog--${t}`,onClose:o,children:[a.jsx("div",{className:"sandbox-tool-toolbar",children:a.jsxs("span",{children:[a.jsx("i",{className:i?"is-loading":n?"is-ready":""}),l(i?"tool.connecting":n?"tool.connected":"tool.notConnected")]})}),a.jsx("div",{className:"sandbox-tool-surface",children:i?a.jsxs("div",{className:"sandbox-control-state",children:[a.jsx(Rc,{className:"spin"}),a.jsx("strong",{children:l("tool.opening",{title:u})}),a.jsx("span",{children:l("tool.connectingSession")})]}):r?a.jsxs("div",{className:"sandbox-control-state is-error",children:[a.jsx("strong",{children:l("tool.openFailed",{title:u})}),a.jsx("span",{children:r}),a.jsx("button",{type:"button",onClick:s,children:l("common.retry")})]}):n?a.jsx("iframe",{src:n.url,title:u,allow:"clipboard-read; clipboard-write",sandbox:"allow-downloads allow-forms allow-modals allow-popups allow-pointer-lock allow-same-origin allow-scripts"}):null})]})}function DJt({open:e,threads:t,currentThreadId:n,loading:i,error:r,onSelect:s,onClose:o}){const{t:l,i18n:c}=Te("sandbox");return a.jsx(Ph,{open:e,title:l("threads.title"),subtitle:l("threads.subtitle"),icon:a.jsx(tet,{}),className:"sandbox-threads-dialog",onClose:o,children:a.jsx("div",{className:"sandbox-thread-list",children:i?a.jsxs("div",{className:"sandbox-control-state",children:[a.jsx(Rc,{className:"spin"}),a.jsx("strong",{children:l("threads.loading")})]}):r?a.jsxs("div",{className:"sandbox-control-state is-error",children:[a.jsx("strong",{children:l("threads.loadFailed")}),a.jsx("span",{children:r})]}):t.length===0?a.jsx("div",{className:"sandbox-control-state",children:a.jsx("strong",{children:l("threads.empty")})}):t.map(u=>{const d=u.id===n,f=u.name||u.preview||`Thread ${u.id.slice(0,8)}`;return a.jsxs("button",{type:"button",className:d?"is-active":"",disabled:d,onClick:()=>s(u.id),children:[a.jsxs("span",{children:[a.jsx("strong",{children:f}),a.jsx("small",{children:u.preview||u.cwd||u.id})]}),a.jsx("time",{children:u.updatedAt?new Date(u.updatedAt*1e3).toLocaleString(c.resolvedLanguage??c.language):""}),a.jsx(_8,{})]},u.id)})})})}const MJt=[{value:"read-only",labelKey:"permissions.sandboxChoices.readOnly.label",detailKey:"permissions.sandboxChoices.readOnly.detail"},{value:"workspace-write",labelKey:"permissions.sandboxChoices.workspaceWrite.label",detailKey:"permissions.sandboxChoices.workspaceWrite.detail"},{value:"danger-full-access",labelKey:"permissions.sandboxChoices.fullAccess.label",detailKey:"permissions.sandboxChoices.fullAccess.detail",danger:!0}],LJt=[{value:"untrusted",labelKey:"permissions.approvalChoices.untrusted.label",detailKey:"permissions.approvalChoices.untrusted.detail"},{value:"on-request",labelKey:"permissions.approvalChoices.onRequest.label",detailKey:"permissions.approvalChoices.onRequest.detail"},{value:"never",labelKey:"permissions.approvalChoices.never.label",detailKey:"permissions.approvalChoices.never.detail",danger:!0}],$Jt=[{value:"user",labelKey:"permissions.reviewerChoices.user.label",detailKey:"permissions.reviewerChoices.user.detail"},{value:"auto_review",labelKey:"permissions.reviewerChoices.autoReview.label",detailKey:"permissions.reviewerChoices.autoReview.detail"}];function FJt({open:e,value:t,busy:n,error:i,onSave:r,onClose:s}){const{t:o}=Te("sandbox"),[l,c]=p.useState(t);return p.useEffect(()=>{e&&c(t)},[e,t]),a.jsxs(Ph,{open:e,title:o("permissions.title"),subtitle:o("permissions.subtitle"),icon:a.jsx(hz,{}),className:"sandbox-settings-dialog",onClose:s,children:[a.jsxs("div",{className:"sandbox-control-body",children:[a.jsx(v6,{label:o("permissions.sandboxMode"),choices:MJt.map(u=>({...u,label:o(u.labelKey),detail:o(u.detailKey)})),value:l.sandboxMode,disabled:n,onChange:u=>c(d=>({...d,sandboxMode:u,networkAccess:u==="danger-full-access"?!0:d.networkAccess}))}),a.jsx(v6,{label:o("permissions.approvalPolicy"),choices:LJt.map(u=>({...u,label:o(u.labelKey),detail:o(u.detailKey)})),value:l.approvalPolicy,disabled:n,onChange:u=>c(d=>({...d,approvalPolicy:u}))}),a.jsx(v6,{label:o("permissions.approvalMethod"),choices:$Jt.map(u=>({...u,label:o(u.labelKey),detail:o(u.detailKey)})),value:l.approvalsReviewer,disabled:n,onChange:u=>c(d=>({...d,approvalsReviewer:u}))}),a.jsxs("label",{className:`sandbox-network-toggle${l.sandboxMode==="danger-full-access"?" is-disabled":""}`,children:[a.jsxs("span",{children:[a.jsx("strong",{children:o("permissions.networkAccess")}),a.jsx("small",{children:o("permissions.networkAccessHelp")})]}),a.jsx("input",{type:"checkbox",checked:l.networkAccess,disabled:n||l.sandboxMode==="danger-full-access",onChange:u=>c(d=>({...d,networkAccess:u.target.checked}))})]}),l.sandboxMode==="danger-full-access"?a.jsx("div",{className:"sandbox-control-note is-danger",children:o("permissions.fullAccessWarning")}):null,i?a.jsx("div",{className:"sandbox-control-error",children:i}):null]}),a.jsxs("footer",{className:"sandbox-control-actions",children:[a.jsx("button",{type:"button",onClick:s,disabled:n,children:o("common.cancel")}),a.jsxs("button",{type:"button",className:"is-primary",disabled:n,onClick:()=>r(l),children:[n?a.jsx(Rc,{className:"spin"}):null,o("permissions.save")]})]})]})}function v6({label:e,choices:t,value:n,disabled:i,onChange:r}){return a.jsxs("fieldset",{className:"sandbox-choice-group",disabled:i,role:"radiogroup","aria-label":e,children:[a.jsx("legend",{children:e}),a.jsx("div",{className:"sandbox-choice-list",children:t.map(s=>a.jsxs("button",{type:"button",role:"radio",className:`${n===s.value?"is-active":""}${s.danger?" is-danger":""}`.trim(),"aria-checked":n===s.value,onClick:()=>r(s.value),onKeyDown:o=>{var d,f;const l=t.findIndex(h=>h.value===s.value);let c=l;if(o.key==="ArrowRight"||o.key==="ArrowDown")c=(l+1)%t.length;else if(o.key==="ArrowLeft"||o.key==="ArrowUp")c=(l-1+t.length)%t.length;else if(o.key==="Home")c=0;else if(o.key==="End")c=t.length-1;else return;o.preventDefault(),r(t[c].value);const u=(d=o.currentTarget.parentElement)==null?void 0:d.querySelectorAll('[role="radio"]');(f=u==null?void 0:u[c])==null||f.focus()},children:[a.jsx("i",{}),a.jsxs("span",{children:[a.jsx("strong",{children:s.label}),a.jsx("small",{children:s.detail})]})]},s.value))})]})}function BJt({open:e,cwd:t,locked:n,busy:i,error:r,browse:s,onSave:o,onClose:l}){const{t:c}=Te("sandbox"),[u,d]=p.useState(t||"/"),[f,h]=p.useState(null),[m,g]=p.useState(!1),[b,v]=p.useState("");p.useEffect(()=>{if(!e)return;const w=t||"/";d(w),y(w)},[t,e]);async function y(w){g(!0),v("");try{const x=await s(w);h(x),d(x.path)}catch(x){v(x instanceof Error?x.message:String(x))}finally{g(!1)}}return a.jsxs(Ph,{open:e,title:c("workspace.title"),subtitle:c("workspace.subtitle"),icon:a.jsx(sN,{}),className:"sandbox-workspace-dialog",onClose:l,children:[a.jsxs("div",{className:"sandbox-control-body",children:[a.jsxs("label",{className:"sandbox-workspace-input",children:[a.jsx("span",{children:c("workspace.absolutePath")}),a.jsxs("div",{children:[a.jsx("input",{value:u,disabled:i||n,spellCheck:!1,onChange:w=>d(w.target.value),onKeyDown:w=>{w.key==="Enter"&&u.startsWith("/")&&(w.preventDefault(),y(u))}}),a.jsx("button",{type:"button",disabled:i||m||!u.startsWith("/"),onClick:()=>void y(u),children:c("workspace.browse")})]})]}),a.jsxs("div",{className:"sandbox-directory-browser",children:[a.jsxs("div",{className:"sandbox-directory-head",children:[a.jsx("span",{title:f==null?void 0:f.path,children:(f==null?void 0:f.path)??u}),m?a.jsx(Rc,{className:"spin"}):null]}),a.jsxs("div",{className:"sandbox-directory-list",children:[f!=null&&f.parent?a.jsxs("button",{type:"button",disabled:m,onClick:()=>void y(f.parent??"/"),children:[a.jsx(sN,{}),a.jsx("span",{children:c("workspace.parent")}),a.jsx("small",{children:f.parent}),a.jsx(_8,{})]}):null,f==null?void 0:f.directories.map(w=>a.jsxs("button",{type:"button",disabled:m,onClick:()=>void y(w.path),children:[a.jsx(sN,{}),a.jsx("span",{children:w.name}),a.jsx(_8,{})]},w.path)),!m&&(f==null?void 0:f.directories.length)===0?a.jsx("div",{className:"sandbox-directory-empty",children:c("workspace.empty")}):null]})]}),n?a.jsx("div",{className:"sandbox-control-note",children:c("workspace.locked")}):null,b||r?a.jsx("div",{className:"sandbox-control-error",children:b||r}):null]}),a.jsxs("footer",{className:"sandbox-control-actions",children:[a.jsx("button",{type:"button",onClick:l,disabled:i,children:c("common.cancel")}),a.jsxs("button",{type:"button",className:"is-primary",disabled:i||n||!u.startsWith("/"),onClick:()=>o(u),children:[i?a.jsx(Rc,{className:"spin"}):null,c("workspace.useDirectory")]})]})]})}function UJt({approval:e,busy:t,error:n,onDecision:i}){var l;const{t:r}=Te("sandbox"),s=(l=e==null?void 0:e.command)==null?void 0:l.trim(),o=(e==null?void 0:e.changes)===void 0?"":JSON.stringify(e.changes,null,2);return a.jsxs(Ph,{open:e!==null,title:(e==null?void 0:e.kind)==="file"?r("approval.fileTitle"):r("approval.commandTitle"),subtitle:r("approval.subtitle"),icon:a.jsx(hz,{}),className:"sandbox-approval-dialog",onClose:()=>{t||i("cancel")},children:[a.jsxs("div",{className:"sandbox-control-body",children:[e!=null&&e.reason?a.jsx("div",{className:"sandbox-approval-reason",children:e.reason}):null,s?a.jsx("pre",{children:s}):null,o?a.jsx("pre",{children:o}):null,e!=null&&e.cwd?a.jsxs("div",{className:"sandbox-approval-meta",children:[r("approval.workingDirectory")," ",a.jsx("code",{children:e.cwd})]}):null,n?a.jsx("div",{className:"sandbox-control-error",children:n}):null]}),a.jsxs("footer",{className:"sandbox-control-actions sandbox-approval-actions",children:[a.jsx("button",{type:"button",disabled:t,onClick:()=>i("decline"),children:r("approval.decline")}),a.jsx("button",{type:"button",disabled:t,onClick:()=>i("accept"),children:r("approval.acceptOnce")}),a.jsxs("button",{type:"button",className:"is-primary",disabled:t,onClick:()=>i("acceptForSession"),children:[t?a.jsx(Rc,{className:"spin"}):null,r("approval.acceptSession")]})]})]})}const QJt=["Once","Interval","Daily","Weekly","Monthly","Cron"],zJt=["Queued","Running","Succeeded","Failed","TimedOut","Cancelled","Skipped"];function jk(e){return e.runningAt?"Running":e.lastRunStatus||"Pending"}function LP(e,t,n){return typeof e!="string"||!Number.isFinite(Date.parse(e))?"—":new Intl.DateTimeFormat(t,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",timeZone:n}).format(new Date(e))}function J7(e,t,n){const i=e.schedule,r=typeof i.timezone=="string"?i.timezone:"Asia/Shanghai",s=i.type,o=s==="Once"?LP(i.runAt,n,r):s==="Interval"?`${i.intervalSeconds} ${t("seconds")}`:s==="Cron"?String(i.cronExpression):`${i.time}${s==="Weekly"?` · ${String(i.weekdays)}`:s==="Monthly"?` · ${String(i.monthDays)}`:""}`;return`${t(s)} · ${o} (${r})`}function VJt(e){const t=new Date(e.getFullYear(),e.getMonth(),1);return t.setDate(t.getDate()-(t.getDay()+6)%7),Array.from({length:42},(n,i)=>new Date(t.getFullYear(),t.getMonth(),t.getDate()+i))}const eU=(e,t)=>Object.fromEntries(new Intl.DateTimeFormat("en-US",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).formatToParts(e).map(n=>[n.type,n.value]));function HJt(e,t,n,i,r,s){const o=Date.UTC(e,t-1,n,i,r),l=new Set;for(const c of[-864e5,0,864e5]){const u=o+c,d=eU(new Date(u),s),f=Date.UTC(+d.year,+d.month-1,+d.day,+d.hour,+d.minute)-u,h=o-f,m=eU(new Date(h),s);+m.year===e&&+m.month===t&&+m.day===n&&+m.hour===i&&+m.minute===r&&l.add(h)}return[...l]}function qJt(e,t){const n=t.getTime(),i=new Date(t.getFullYear(),t.getMonth(),t.getDate()+1).getTime(),r=e.schedule,s=String(r.timezone||"Asia/Shanghai"),o=Date.parse(e.createdAt||"")||-1/0,l=b=>b>=Math.max(n,o)&&b59||!/^\d+$/.test(b[1])||+b[1]>23||b[3]!=="*"||!/^(\*|\d+(,\d+)*)$/.test(b[2])||!/^(\*|\d+(,\d+)*)$/.test(b[4])||b[2]!=="*"&&b[4]!=="*"){const v=Date.parse(e.nextRunAt||"");return l(v)?{at:v,count:1,nextOnly:!0}:null}c=`${b[1]}:${b[0]}`,d=b[2]==="*"?void 0:b[2].split(",").map(Number),u=b[4]==="*"?void 0:b[4].split(",").map(v=>+v==0?7:+v)}const[f,h]=c.split(":").map(Number);if(!Number.isFinite(f)||!Number.isFinite(h))return null;const m=[];for(let b=-1;b<=1;b++){const v=eU(new Date(n+b*864e5),s),y=+v.year,w=+v.month,x=+v.day,O=new Date(Date.UTC(y,w-1,x)).getUTCDay()||7;u&&!u.includes(O)||d&&!d.includes(x)||m.push(...HJt(y,w,x,f,h,s).filter(l))}const g=[...new Set(m)].sort((b,v)=>b-v);return g.length?{at:g[0],count:g.length,nextOnly:!1}:null}function eg({kind:e}){const t={filter:"M4 5h16l-6 7v7l-4-2v-5Z",plus:"M12 5v14M5 12h14",play:"M8 5l11 7-11 7Z",edit:"m15 4 5 5-11 11H4v-5ZM13 6l5 5",more:"M5 12h.01M12 12h.01M19 12h.01",detail:"M7 3h10l3 3v15H4V3ZM8 9h8M8 13h8M8 17h5",copy:"M9 8V3h12v13h-5M3 8h13v13H3Z",delete:"M3 6h18M9 6V3h6v3M5 6l1 15h12l1-15M10 10v7M14 10v7"};return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:"icon","aria-hidden":"true",children:a.jsx("path",{d:t[e]})})}function WJt({task:e,copy:t,busy:n,error:i,onClose:r,onSave:s}){var J,V;const{t:o}=Te("cronjobs"),l=Z=>o(`mpa.manage.${Z}`),c=e==null?void 0:e.schedule,[u,d]=p.useState(e?e.name+(t?` (${l("copy")})`:""):""),[f,h]=p.useState((e==null?void 0:e.prompt)||""),[m,g]=p.useState((c==null?void 0:c.type)||"Daily"),[b,v]=p.useState(String((c==null?void 0:c.timezone)||"Asia/Shanghai")),[y,w]=p.useState(String((c==null?void 0:c.time)||"09:00")),[x,O]=p.useState(()=>{if(!(c!=null&&c.runAt))return"";const Z=new Date(String(c.runAt));return new Date(Z.getTime()-Z.getTimezoneOffset()*6e4).toISOString().slice(0,16)}),[k,S]=p.useState(String((c==null?void 0:c.intervalSeconds)||3600)),[C,E]=p.useState(String((c==null?void 0:c.weekdays)||"1,2,3,4,5")),[j,T]=p.useState(String((c==null?void 0:c.monthDays)||"1")),[R,A]=p.useState(String((c==null?void 0:c.cronExpression)||"0 9 * * *")),[N,P]=p.useState((e==null?void 0:e.enabled)??!0),[I,D]=p.useState(String(((J=e==null?void 0:e.delivery)==null?void 0:J.channel)||"Web")),[_,L]=p.useState(String(((V=e==null?void 0:e.delivery)==null?void 0:V.targetId)||"")),[F,M]=p.useState(""),z=p.useRef(!1),q=p.useRef(null);function U(){var W;if(n||z.current)return;try{new Intl.DateTimeFormat("en-US",{timeZone:b})}catch{M(l("timezoneInvalid"));return}const Z={type:m,timezone:b};if(m==="Once"){const G=Date.parse(x);if(!Number.isFinite(G)||G<=Date.now()){M(l("futureTime"));return}Z.runAt=new Date(G).toISOString()}else if(m==="Interval"){const G=Number(k);if(!Number.isInteger(G)||G<30||G>31536e3){M(l("intervalInvalid"));return}Z.intervalSeconds=G,(c==null?void 0:c.type)===m&&c.anchorAt&&(Z.anchorAt=c.anchorAt)}else if(m==="Cron"){if(R.trim().split(/\s+/).length!==5){M(o("validation.cronFields"));return}Z.cronExpression=R.trim()}else if(Z.time=y,m==="Weekly"||m==="Monthly"){const G=(m==="Weekly"?C:j).split(",").map(Number),H=m==="Weekly"?7:31;if(!G.length||G.some(se=>!Number.isInteger(se)||se<1||se>H)||new Set(G).size!==G.length){M(l("daysInvalid"));return}Z[m==="Weekly"?"weekdays":"monthDays"]=G}if(!u.trim()||!f.trim()||I==="Feishu"&&!_.trim()){M(l("required"));return}const ne=((W=e==null?void 0:e.delivery)==null?void 0:W.channel)===I&&String(e.delivery.targetId||"")===_?e.delivery:{channel:I,targetId:I==="Web"?null:_.trim(),receiveIdType:"chat_id",bestEffort:!0};M(""),s({name:u.trim(),...e!=null&&e.agentId?{agentId:e.agentId}:{},prompt:f.trim(),enabled:N,schedule:Z,delivery:ne,jitterSeconds:(e==null?void 0:e.jitterSeconds)??0,timeoutSeconds:(e==null?void 0:e.timeoutSeconds)??3600})}return a.jsx(Ph,{open:!0,title:l(e&&!t?"edit":"create"),icon:a.jsx(eg,{kind:"edit"}),className:"mpa-dialog",initialFocusRef:q,busy:n,onClose:r,children:a.jsxs("form",{onSubmit:Z=>{Z.preventDefault(),U()},onCompositionStart:()=>{z.current=!0},onCompositionEnd:()=>{z.current=!1},onKeyDown:Z=>{Z.key==="Enter"&&(z.current||Z.nativeEvent.isComposing||Z.keyCode===229)&&Z.preventDefault()},children:[a.jsxs("div",{className:"sandbox-control-body mpa-editor",children:[a.jsxs("fieldset",{disabled:n,children:[a.jsxs("label",{children:[l("name"),a.jsx("input",{ref:q,className:"cw-input",required:!0,maxLength:128,value:u,onChange:Z=>d(Z.target.value)})]}),a.jsxs("label",{children:[l("prompt"),a.jsx("textarea",{className:"cw-input",required:!0,maxLength:4e3,rows:5,value:f,onChange:Z=>h(Z.target.value)})]}),a.jsxs("div",{className:"mpa-fields",children:[a.jsxs("div",{children:[a.jsx("span",{children:l("schedule")}),a.jsx(xf,{ariaLabel:l("schedule"),placeholder:"",value:m,options:QJt.map(Z=>({value:Z,label:l(Z)})),onChange:g})]}),a.jsxs("label",{children:[l("timezone"),a.jsx("input",{className:"cw-input",required:!0,value:b,onChange:Z=>v(Z.target.value)})]})]}),m==="Once"?a.jsxs("label",{children:[l("localTime"),a.jsx("input",{className:"cw-input",required:!0,type:"datetime-local",value:x,onChange:Z=>O(Z.target.value)})]}):m==="Interval"?a.jsxs("label",{children:[l("interval"),a.jsx("input",{className:"cw-input",required:!0,type:"number",min:30,max:31536e3,value:k,onChange:Z=>S(Z.target.value)})]}):m==="Cron"?a.jsxs("label",{children:[l("Cron"),a.jsx("input",{className:"cw-input",required:!0,value:R,maxLength:128,onChange:Z=>A(Z.target.value)})]}):a.jsxs("label",{children:[l("time"),a.jsx("input",{className:"cw-input",type:"time",required:!0,value:y,onChange:Z=>w(Z.target.value)})]}),m==="Weekly"&&a.jsxs("label",{children:[l("weekdays"),a.jsx("input",{className:"cw-input",required:!0,value:C,onChange:Z=>E(Z.target.value)})]}),m==="Monthly"&&a.jsxs("label",{children:[l("monthDays"),a.jsx("input",{className:"cw-input",required:!0,value:j,onChange:Z=>T(Z.target.value)})]}),a.jsxs("div",{children:[a.jsx("span",{children:l("delivery")}),a.jsx(xf,{ariaLabel:l("delivery"),placeholder:"",value:I,options:["Web","Feishu"].map(Z=>({value:Z,label:l(Z)})),onChange:D})]}),I==="Feishu"&&a.jsxs("label",{children:[l("target"),a.jsx("input",{className:"cw-input",required:!0,maxLength:512,value:_,onChange:Z=>L(Z.target.value)})]}),a.jsxs("label",{className:"mpa-checkbox",children:[a.jsx("input",{type:"checkbox",checked:N,onChange:Z=>P(Z.target.checked)}),l("enabled")]})]}),(F||i)&&a.jsx("p",{role:"alert",className:"cw-error-text",children:F||i})]}),a.jsxs("footer",{className:"sandbox-control-actions",children:[a.jsx("button",{type:"button",className:"cw-btn cw-btn-ghost",disabled:n,onClick:r,children:l("cancel")}),a.jsx("button",{className:"cw-btn cw-btn-primary is-primary",disabled:n,type:"submit",children:l(n?"saving":"save")})]})]})})}function tU(e){const t=e instanceof Error?e.message:"";return{MPA_HTTP_401:"mpa.authRequired",MPA_HTTP_403:"mpa.forbidden",MPA_HTTP_404:"mpa.unsupported",MPA_HTTP_409:"mpa.manage.conflict",MPA_HTTP_422:"mpa.manage.invalid",MPA_INVALID_RESPONSE:"mpa.invalidResponse"}[t]||"mpa.loadFailed"}function KJt({task:e,runtime:t,onClose:n}){const{t:i,i18n:r}=Te("cronjobs"),s=v=>i(`mpa.manage.${v}`),[o,l]=p.useState(0),[c,u]=p.useState(0),[d,f]=p.useState(null),[h,m]=p.useState(""),[g,b]=p.useState(!0);return p.useEffect(()=>{const v=new AbortController;return b(!0),m(""),f(null),L2e(t,e.id,o,v.signal).then(y=>{v.signal.aborted||f(y)}).catch(y=>{v.signal.aborted||m(tU(y))}).finally(()=>{v.signal.aborted||b(!1)}),()=>v.abort()},[t.runtimeId,t.region,e.id,o,c]),a.jsx(Ph,{open:!0,title:e.name,icon:a.jsx(eg,{kind:"detail"}),className:"mpa-dialog mpa-detail",onClose:n,children:a.jsxs("div",{className:"sandbox-control-body",children:[a.jsxs("dl",{className:"mpa-details",children:[a.jsx("dt",{children:s("agent")}),a.jsx("dd",{children:e.agentId||"—"}),a.jsx("dt",{children:s("schedule")}),a.jsx("dd",{children:J7(e,s,r.language)}),a.jsx("dt",{children:i("mpa.columns.next")}),a.jsx("dd",{children:LP(e.nextRunAt,r.language)}),a.jsx("dt",{children:s("prompt")}),a.jsx("dd",{className:"mpa-prompt",children:e.prompt})]}),a.jsxs("div",{className:"mpa-history-title",children:[a.jsx("h3",{children:s("history")}),a.jsx("button",{className:"cw-btn cw-btn-ghost",disabled:g,onClick:()=>u(v=>v+1),children:i("mpa.refresh")})]}),h&&a.jsx("p",{className:"cw-error-text",role:"alert",children:i(h)}),g&&a.jsx(hn,{children:i("mpa.loading")}),d&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"mpa-cron-table",children:a.jsxs("table",{children:[a.jsx("thead",{children:a.jsx("tr",{children:["lastRun","lastStatus","duration","result"].map(v=>a.jsx("th",{children:s(v)},v))})}),a.jsx("tbody",{children:d.items.map(v=>a.jsxs("tr",{children:[a.jsx("td",{children:LP(v.startedAt||v.scheduledAt,r.language)}),a.jsx("td",{children:s(v.status)}),a.jsx("td",{children:v.durationMs==null?"—":`${v.durationMs} ms`}),a.jsx("td",{children:v.errorMessage||v.sessionId||"—"})]},v.id))})]})}),d.items.length===0&&a.jsx("p",{children:s("noRuns")}),a.jsxs("nav",{className:"mpa-cron-pages",children:[a.jsx("span",{children:i("mpa.total",{total:d.total})}),a.jsx("button",{className:"cw-btn cw-btn-ghost",disabled:o===0,onClick:()=>l(Math.max(0,o-20)),children:i("mpa.previous")}),a.jsx("button",{className:"cw-btn cw-btn-ghost",disabled:!d.hasMore,onClick:()=>l(d.nextOffset),children:i("mpa.next")})]})]})]})})}function GJt({runtime:e}){const{t}=Te("cronjobs");return e?a.jsx(XJt,{runtime:e},`${e.region}:${e.runtimeId}`):a.jsx("p",{role:"status",children:t("mpa.selectRuntime")})}function XJt({runtime:e}){const{t,i18n:n}=Te("cronjobs"),i=se=>t(`mpa.manage.${se}`),[r,s]=p.useState(""),[o,l]=p.useState(""),[c,u]=p.useState(0),[d,f]=p.useState(0),[h,m]=p.useState(null),[g,b]=p.useState(!0),[v,y]=p.useState(""),[w,x]=p.useState(""),[O,k]=p.useState("list"),[S,C]=p.useState("all"),[E,j]=p.useState(()=>new Date),[T,R]=p.useState(null),[A,N]=p.useState(null),[P,I]=p.useState(null),[D,_]=p.useState(!1),[L,F]=p.useState(""),M=p.useRef(!1),z=p.useRef(!1),q=p.useRef(new AbortController),U=p.useRef(new Map);p.useEffect(()=>{const se=new AbortController;return q.current=se,()=>se.abort()},[]),p.useEffect(()=>{const se=new AbortController;return b(!0),y(""),m(null),(async()=>{const Y=await K8(e,0,o,se.signal),X=[...Y.items];let ie=Y,ee=0;for(;ie.hasMore;){if(se.signal.aborted)return;if(ie.nextOffset===null||ie.nextOffset<=ee||X.length>1e5)throw new Error("MPA_INVALID_RESPONSE");ee=ie.nextOffset,ie=await K8(e,ee,o,se.signal),X.push(...ie.items)}se.signal.aborted||m({...Y,items:[...new Map(X.map(be=>[be.id,be])).values()],hasMore:!1,nextOffset:null})})().catch(Y=>{se.signal.aborted||y(tU(Y))}).finally(()=>{se.signal.aborted||b(!1)}),()=>se.abort()},[e.runtimeId,e.region,o,d]);const J=p.useMemo(()=>(h==null?void 0:h.items.filter(se=>S==="all"||jk(se)===S))||[],[h,S]),V=p.useMemo(()=>VJt(E),[E]),Z=p.useMemo(()=>V.map(se=>({day:se,tasks:J.flatMap(Y=>{const X=qJt(Y,se);return X?[{task:Y,...X}]:[]})})),[V,J]),ne=J.slice(c,c+10);function W(se){let Y=U.current.get(se);return Y||(Y=crypto.randomUUID(),U.current.set(se,Y)),Y}async function G(se,Y,X){if(M.current)return;M.current=!0,_(!0),F(""),x("");const ie=q.current,ee=se==="create"?JSON.stringify(X):`${se}:${Y==null?void 0:Y.id}`;try{const be=Y?`/${encodeURIComponent(Y.id)}${se==="run"?"/run":""}`:"";if((se==="edit"||se==="toggle")&&(!Number.isInteger(Y==null?void 0:Y.version)||Number(Y==null?void 0:Y.version)<1))throw new Error("MPA_INVALID_RESPONSE");const ue=se==="delete"?void 0:se==="run"?{clientToken:W(ee),mode:"Force"}:se==="create"?{...X,clientToken:W(ee)}:{...se==="toggle"?{enabled:!Y.enabled}:X,expectedVersion:Y.version},pe=await M2e(e,se==="delete"?"DELETE":"POST",be,ue,ie.signal);if(se==="delete"?pe.removed!==!0:se==="run"?!pe.run:!pe.task)throw new Error("MPA_INVALID_RESPONSE");U.current.delete(ee),ie.signal.aborted||(R(null),I(null),N(null),x(i(se==="run"?"queued":"saved")),u(0),f(ke=>ke+1))}catch(be){ie.signal.aborted||F(t(tU(be)))}finally{M.current=!1,ie.signal.aborted||_(!1)}}function H(se,Y=!1){F(""),R({task:se,copy:Y})}return a.jsxs("section",{className:"mpa-cron","aria-label":t("mpa.title"),children:[a.jsxs("div",{className:"mpa-cron-target",children:[a.jsx("strong",{children:e.name}),a.jsxs("span",{children:[e.runtimeId," · ",e.region]})]}),a.jsxs("div",{className:"mpa-cron-heading",children:[a.jsx("div",{className:"mpa-segment",role:"group","aria-label":i("view"),children:["list","calendar"].map(se=>a.jsx("button",{"aria-pressed":O===se,onClick:()=>k(se),children:i(se)},se))}),a.jsxs("button",{className:"cw-btn cw-btn-primary mpa-create",disabled:D,onClick:()=>H(),children:[a.jsx(eg,{kind:"plus"}),i("create")]})]}),a.jsxs("div",{className:"mpa-toolbar",children:[a.jsxs("form",{className:"mpa-cron-search",onSubmit:se=>{se.preventDefault(),!z.current&&(u(0),l(r),f(Y=>Y+1))},children:[a.jsx("input",{"aria-label":t("mpa.search"),placeholder:t("mpa.search"),type:"search",maxLength:200,value:r,onChange:se=>s(se.target.value),onCompositionStart:()=>{z.current=!0},onCompositionEnd:()=>{z.current=!1},onKeyDown:se=>{se.key==="Enter"&&(z.current||se.nativeEvent.isComposing||se.keyCode===229)&&se.preventDefault()}}),a.jsx("button",{className:"cw-btn cw-btn-ghost",disabled:g,type:"submit",children:t("mpa.search")}),a.jsx("button",{className:"cw-btn cw-btn-ghost",disabled:g,type:"button",onClick:()=>f(se=>se+1),children:t("mpa.refresh")})]}),(h==null?void 0:h.overview)&&a.jsxs("div",{className:"mpa-cron-overview",children:[a.jsx("span",{children:i("overview")}),a.jsxs("span",{children:[t("mpa.successRate")," ",a.jsxs("strong",{children:[Math.round(h.overview.successRate*100),"%"]})]}),a.jsxs("span",{children:[t("mpa.executionCount")," ",a.jsx("strong",{children:h.overview.executionCount})]})]})]}),v&&a.jsx("p",{role:"alert",className:"mpa-cron-error",children:t(v)}),L&&!T&&!P&&a.jsx("p",{role:"alert",className:"mpa-cron-error",children:L}),w&&a.jsx("p",{role:"status",children:w}),g&&a.jsx("div",{className:"mpa-state",role:"status",children:a.jsx(hn,{children:t("mpa.loading")})}),!g&&!v&&h&&a.jsx(a.Fragment,{children:O==="list"?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mpa-cron-table",tabIndex:0,role:"region","aria-label":t("mpa.title"),children:[a.jsxs("table",{children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:i("name")}),a.jsx("th",{children:i("lastRun")}),a.jsx("th",{children:i("schedule")}),a.jsx("th",{children:a.jsxs(er,{children:[a.jsx(er.Trigger,{children:a.jsxs("button",{className:"mpa-status-filter","aria-label":i("lastStatus"),children:[i(S==="all"?"lastStatus":S),a.jsx(eg,{kind:"filter"})]})}),a.jsx(er.Content,{side:"bottom",align:"start",children:["all","Pending",...zJt].map(se=>a.jsx(er.Item,{onSelect:()=>{C(se),u(0)},children:i(se)},se))})]})}),a.jsx("th",{children:i("agent")}),a.jsx("th",{children:i("actions")})]})}),a.jsx("tbody",{children:ne.map(se=>a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx("button",{className:"mpa-task-link",title:se.name,onClick:()=>N(se),children:se.name})}),a.jsx("td",{children:LP(se.lastRunAt,n.language)}),a.jsx("td",{children:J7(se,i,n.language)}),a.jsx("td",{children:a.jsx("span",{className:`mpa-status mpa-status-${jk(se)}`,children:i(jk(se))})}),a.jsx("td",{children:se.agentId||"—"}),a.jsx("td",{children:a.jsxs("div",{className:"mpa-actions",children:[a.jsx("button",{role:"switch","aria-checked":se.enabled,"aria-label":`${i("enabled")} ${se.name}`,disabled:D,className:"mpa-switch",onClick:()=>void G("toggle",se),children:a.jsx("span",{})}),a.jsx("button",{className:"mpa-icon-button",title:i("run"),"aria-label":`${i("run")} ${se.name}`,disabled:D||jk(se)==="Running"||jk(se)==="Queued",onClick:()=>void G("run",se),children:a.jsx(eg,{kind:"play"})}),a.jsxs(er,{children:[a.jsx(er.Trigger,{children:a.jsx("button",{className:"mpa-icon-button",disabled:D,"aria-label":`${i("actions")} ${se.name}`,children:a.jsx(eg,{kind:"more"})})}),a.jsx(er.Content,{side:"bottom",align:"end",minWidth:148,children:["detail","edit","copy","delete"].map(Y=>a.jsxs(er.Item,{onSelect:()=>{Y==="detail"?N(se):Y==="delete"?(F(""),I(se)):H(se,Y==="copy")},children:[a.jsx(eg,{kind:Y}),a.jsx("span",{children:i(Y)})]},Y))})]})]})})]},se.id))})]}),J.length===0&&a.jsx("div",{className:"mpa-state",role:"status",children:t("mpa.empty")})]}),a.jsxs("nav",{className:"mpa-cron-pages","aria-label":t("mpa.pagination"),children:[a.jsx("span",{children:t("mpa.total",{total:J.length})}),a.jsx("button",{className:"cw-btn cw-btn-ghost",disabled:c===0,onClick:()=>u(Math.max(0,c-10)),children:t("mpa.previous")}),a.jsx("button",{className:"cw-btn cw-btn-ghost",disabled:c+10>=J.length,onClick:()=>u(c+10),children:t("mpa.next")})]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mpa-calendar-bar",children:[a.jsx("strong",{children:new Intl.DateTimeFormat(n.language,{year:"numeric",month:"long"}).format(E)}),a.jsxs("span",{children:[i("calendarZone")," ",Intl.DateTimeFormat().resolvedOptions().timeZone]}),a.jsx("button",{className:"cw-btn cw-btn-ghost",onClick:()=>j(new Date(E.getFullYear(),E.getMonth()-1,1)),children:i("prevMonth")}),a.jsx("button",{className:"cw-btn cw-btn-ghost",onClick:()=>j(new Date),children:i("today")}),a.jsx("button",{className:"cw-btn cw-btn-ghost",onClick:()=>j(new Date(E.getFullYear(),E.getMonth()+1,1)),children:i("nextMonth")})]}),a.jsxs("div",{className:"mpa-calendar",children:[V.slice(0,7).map(se=>a.jsx("div",{className:"mpa-calendar-weekday",children:new Intl.DateTimeFormat(n.language,{weekday:"short"}).format(se)},se.toISOString())),Z.map(({day:se,tasks:Y})=>a.jsxs("div",{className:`mpa-calendar-day ${se.getMonth()!==E.getMonth()?"is-outside":""}`,children:[a.jsx("time",{dateTime:se.toISOString(),children:se.getDate()}),Y.map(({task:X,at:ie,count:ee,nextOnly:be})=>a.jsxs("button",{className:"mpa-calendar-task",onClick:()=>N(X),title:`${X.name} · ${J7(X,i,n.language)}`,children:[a.jsxs("span",{children:[new Intl.DateTimeFormat(n.language,{hour:"2-digit",minute:"2-digit"}).format(ie)," ",X.name]}),ee>1&&a.jsxs("small",{children:[" × ",ee]}),be&&a.jsx("small",{children:i("nextOnly")})]},X.id))]},se.toISOString()))]}),a.jsx("p",{children:i("calendarHint")})]})}),T&&a.jsx(WJt,{task:T.task,copy:T.copy,busy:D,error:L,onClose:()=>R(null),onSave:se=>void G(T.task&&!T.copy?"edit":"create",T.copy?void 0:T.task,se)}),A&&a.jsx(KJt,{runtime:e,task:A,onClose:()=>N(null)},A.id),P&&a.jsxs(Ph,{open:!0,title:i("delete"),icon:a.jsx(eg,{kind:"delete"}),busy:D,onClose:()=>I(null),children:[a.jsxs("div",{className:"sandbox-control-body",children:[a.jsx("p",{children:t("mpa.manage.deleteConfirm",{name:P.name})}),L&&a.jsx("p",{role:"alert",className:"cw-error-text",children:L})]}),a.jsxs("footer",{className:"sandbox-control-actions",children:[a.jsx("button",{className:"cw-btn cw-btn-ghost",disabled:D,onClick:()=>I(null),children:i("cancel")}),a.jsx("button",{className:"cw-btn cw-btn-primary",disabled:D,onClick:()=>void G("delete",P),children:i("delete")})]})]})]})}const YJt="_Container_1bl61_1",ZJt="_Track_1bl61_16",JJt="_Thumb_1bl61_56",een="_Label_1bl61_78",vj={Container:YJt,Track:ZJt,Thumb:JJt,Label:een},nU=({className:e,label:t,id:n,disabled:i,labelPosition:r="end",...s})=>{const o=p.useId(),l=n??o;return a.jsxs("div",{className:Qi(vj.Container,e),"data-disabled":i?"":void 0,"data-has-label":t?"":void 0,"data-label-position":r,children:[a.jsx(uft,{id:l,className:vj.Track,disabled:i,...s,children:a.jsx(fft,{className:vj.Thumb})}),t&&a.jsx("label",{htmlFor:l,className:vj.Label,children:t})]})};function wb({message:e,className:t="",onRetry:n,retryLabel:i,defaultExpanded:r=!0}){const{t:s}=Te("ui"),o=i??s("deploymentError.retryDeployment"),[l,c]=p.useState(r),[u,d]=p.useState(!1),f=async()=>{if(!(!n||u)){d(!0);try{await n()}finally{d(!1)}}};return a.jsxs("div",{className:`deploy-error-message${l?" is-expanded":""}${t?` ${t}`:""}`,role:"alert",children:[a.jsx("p",{className:"deploy-error-message-text",children:e}),a.jsxs("div",{className:"deploy-error-message-actions",children:[n&&a.jsxs(Tt,{type:"button",className:"deploy-error-retry",color:"danger",variant:"soft",size:"sm",pill:!1,loading:u,onClick:()=>void f(),children:[!u&&a.jsx(Wst,{}),u?s("deploymentError.retrying"):o]}),a.jsx(Tt,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,pill:!1,title:s(l?"deploymentError.collapse":"deploymentError.expand"),"aria-label":s(l?"deploymentError.collapse":"deploymentError.expand"),onClick:()=>c(h=>!h),children:l?a.jsx(Zst,{}):a.jsx(iat,{})}),a.jsx(sH,{copyValue:e,color:"secondary",variant:"ghost",size:"sm",uniform:!0,pill:!1,title:s("deploymentError.copy"),"aria-label":s("deploymentError.copy")})]})]})}const ten={queued:"status.queued",pending:"status.pending",running:"status.running",retrying:"status.retrying",success:"status.success",failed:"status.failed",cancelled:"status.cancelled",skipped:"status.skipped"},U9e=["weekdays.sunday","weekdays.monday","weekdays.tuesday","weekdays.wednesday","weekdays.thursday","weekdays.friday","weekdays.saturday"];function iU(e){if(!e)return"-";const t=new Date(e);return Number.isNaN(t.getTime())?e:new Intl.DateTimeFormat(yn.resolvedLanguage,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).format(t).replace(/\//g,"-")}function nen(e){if(!e.startedAt)return"-";const t=Date.parse(e.startedAt),n=e.finishedAt?Date.parse(e.finishedAt):Date.now();if(!Number.isFinite(t)||!Number.isFinite(n)||n{const d=i.current;!d||r.current||c(d.scrollHeight>d.clientHeight+1)},[]);return p.useLayoutEffect(()=>{r.current=s,s||u()},[s,u,e]),p.useEffect(()=>{const d=i.current;if(!d||typeof ResizeObserver>"u")return;const f=new ResizeObserver(u);return f.observe(d),()=>f.disconnect()},[u]),a.jsxs("div",{className:`cronjobs-run-output-body${s?" is-expanded":""}`,children:[a.jsx("p",{id:n,ref:i,children:e}),l?a.jsx(Tt,{type:"button",className:"cronjobs-run-output-toggle",color:"secondary",variant:"ghost",size:"sm",pill:!1,"aria-expanded":s,"aria-controls":n,onClick:()=>o(d=>!d),children:t(s?"actions.collapse":"actions.expand")}):null]})}const sU="Asia/Shanghai",ren=3e3,sen=["Asia/Shanghai","Asia/Singapore","Asia/Tokyo","Europe/London","America/Los_Angeles","America/New_York","UTC"];function Dt(e,t){return yn.t(e,{ns:"cronjobs",...t})}function aen(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||sU}catch{return sU}}function oen(){const e=aen(),t=new Date(Date.now()+24*60*60*1e3);return t.setSeconds(0,0),{name:"",runtimeId:"",prompt:"",scheduleType:"daily",onceAt:new Date(t.getTime()-t.getTimezoneOffset()*6e4).toISOString().slice(0,16),time:"09:00",weekday:1,cron:"0 9 * * *",timezone:e,enabled:!0}}function len(e){return{name:e.name,runtimeId:e.runtimeId,prompt:e.prompt,scheduleType:e.schedule.type,onceAt:e.schedule.onceAt??"",time:e.schedule.time??"09:00",weekday:e.schedule.weekday??1,cron:e.schedule.cron??"0 9 * * *",timezone:e.schedule.timezone||sU,enabled:e.enabled}}function cen({run:e}){const t=e?e.status==="success"?"success":e.status==="failed"?"danger":["queued","pending","running","retrying"].includes(e.status)?"info":"secondary":"secondary";return a.jsx(Ya,{className:"cronjobs-status",color:t,variant:"soft",size:"sm",pill:!0,children:Dt(e?ten[e.status]:"status.notRun")})}function ale({job:e,runtimes:t,cloudProvider:n,busy:i,onClose:r,onSubmit:s}){const[o,l]=p.useState(()=>e?len(e):oen()),[c,u]=p.useState(""),[d,f]=p.useState(!1),h=p.useRef(null),m=p.useRef(null),g=p.useRef(null),b=i||d,v=p.useRef(b),y=p.useRef(r),w=p.useMemo(()=>Array.from(new Set([o.timezone,...sen])),[o.timezone]),x=p.useMemo(()=>t.map(C=>({value:C.runtimeId,label:C.name,description:xh(C.region,n)})),[n,t]),O=p.useMemo(()=>U9e.map((C,E)=>({value:String(E),label:Dt(C)})),[]),k=p.useMemo(()=>w.map(C=>({value:C,label:C})),[w]);p.useEffect(()=>{v.current=b,y.current=r},[b,r]),p.useEffect(()=>{var T;const C=document.body.style.overflow,E=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(T=m.current)==null||T.focus();const j=R=>{var D,_;if(R.key==="Escape"&&!v.current){y.current();return}if(R.key!=="Tab")return;const A=Array.from(((D=h.current)==null?void 0:D.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'))??[]).filter(L=>!L.hidden&&L.getClientRects().length>0);if(A.length===0){R.preventDefault();return}const N=A[0],P=A[A.length-1],I=document.activeElement;R.shiftKey&&(I===N||!((_=h.current)!=null&&_.contains(I)))?(R.preventDefault(),P.focus()):!R.shiftKey&&I===P&&(R.preventDefault(),N.focus())};return window.addEventListener("keydown",j),()=>{document.body.style.overflow=C,window.removeEventListener("keydown",j),E!=null&&E.isConnected&&E.focus()}},[]);const S=async C=>{C.preventDefault();const E=o.name.trim(),j=o.prompt.trim(),T=t.find(A=>A.runtimeId===o.runtimeId);if(!E)return u(Dt("validation.nameRequired"));if(!T)return u(Dt("validation.runtimeRequired"));if(!j)return u(Dt("validation.promptRequired"));if(o.scheduleType==="once"&&!o.onceAt||(o.scheduleType==="daily"||o.scheduleType==="weekly")&&!o.time)return u(Dt("validation.timeRequired"));const R=o.cron.trim().split(/\s+/);if(o.scheduleType==="cron"&&R.length!==5)return u(Dt("validation.cronFields"));u(""),f(!0);try{let A=(e==null?void 0:e.runtimeId)===T.runtimeId?e.agentName.trim():"";if(!A){const[N]=await IA("","",{runtimeId:T.runtimeId,region:T.region});A=(N==null?void 0:N.trim())??""}if(!A)throw new Error(Dt("validation.runtimeAppMissing"));await s({name:E,runtimeId:T.runtimeId,runtimeName:T.name,agentName:A,region:T.region,prompt:j,enabled:o.enabled,schedule:{type:o.scheduleType,timezone:o.timezone,...o.scheduleType==="once"?{onceAt:o.onceAt}:{},...o.scheduleType==="daily"?{time:o.time}:{},...o.scheduleType==="weekly"?{time:o.time,weekday:o.weekday}:{},...o.scheduleType==="cron"?{cron:o.cron.trim()}:{}}})}catch(A){u(A instanceof Error?A.message:String(A)),window.requestAnimationFrame(()=>{var N;return(N=g.current)==null?void 0:N.focus()})}finally{f(!1)}};return a.jsx("div",{className:"cronjobs-drawer-backdrop",onMouseDown:C=>{C.target===C.currentTarget&&!b&&r()},children:a.jsxs("aside",{ref:h,className:"cronjobs-drawer",role:"dialog","aria-modal":"true","aria-labelledby":"cronjobs-drawer-title",children:[a.jsxs("header",{className:"cronjobs-drawer-head",children:[a.jsxs("div",{children:[a.jsx("h2",{id:"cronjobs-drawer-title",children:Dt(e?"drawer.editTitle":"drawer.createTitle")}),a.jsx("p",{children:Dt("drawer.description")})]}),a.jsx(Tt,{type:"button",color:"secondary",variant:"ghost",size:"lg",uniform:!0,pill:!1,onClick:r,disabled:b,"aria-label":Dt("actions.closeDrawer"),children:a.jsx(pV,{})})]}),a.jsxs("form",{className:"cronjobs-form",onSubmit:C=>void S(C),children:[a.jsxs("div",{className:"cronjobs-form-scroll",children:[a.jsxs("label",{className:"cronjobs-field",children:[a.jsx("span",{children:Dt("fields.name")}),a.jsx(_s,{ref:m,size:"lg",value:o.name,maxLength:80,invalid:!!c&&!o.name.trim(),onChange:C=>l({...o,name:C.target.value}),placeholder:Dt("fields.namePlaceholder")})]}),a.jsxs("label",{className:"cronjobs-field",children:[a.jsx("span",{children:Dt("fields.runtimeAgent")}),a.jsx(pa,{value:o.runtimeId,options:x,size:"lg",disabled:t.length===0,placeholder:Dt(t.length?"fields.runtimePlaceholder":"fields.noRuntime"),onChange:C=>l({...o,runtimeId:C.value})}),a.jsx("small",{children:Dt("fields.runtimeHelp")})]}),a.jsxs("label",{className:"cronjobs-field",children:[a.jsx("span",{children:Dt("fields.prompt")}),a.jsx(xb,{value:o.prompt,rows:5,maxRows:10,autoResize:!0,maxLength:2e4,invalid:!!c&&!o.prompt.trim(),onChange:C=>l({...o,prompt:C.target.value}),placeholder:Dt("fields.promptPlaceholder")}),a.jsxs("small",{className:"cronjobs-character-count",children:[o.prompt.length.toLocaleString()," / 20,000"]})]}),a.jsxs("fieldset",{className:"cronjobs-fieldset",children:[a.jsx("legend",{children:Dt("fields.schedule")}),a.jsxs(cd,{className:"cronjobs-schedule-types",value:o.scheduleType,size:"lg",block:!0,"aria-label":Dt("fields.scheduleType"),onChange:C=>l({...o,scheduleType:C}),children:[a.jsx(cd.Option,{value:"once",children:Dt("scheduleTypes.once")}),a.jsx(cd.Option,{value:"daily",children:Dt("scheduleTypes.daily")}),a.jsx(cd.Option,{value:"weekly",children:Dt("scheduleTypes.weekly")}),a.jsx(cd.Option,{value:"cron",children:"Cron"})]}),o.scheduleType==="once"?a.jsxs("label",{className:"cronjobs-field",children:[a.jsx("span",{children:Dt("fields.runAt")}),a.jsx(_s,{size:"lg",type:"datetime-local",value:o.onceAt,onChange:C=>l({...o,onceAt:C.target.value})})]}):null,o.scheduleType==="daily"?a.jsxs("label",{className:"cronjobs-field",children:[a.jsx("span",{children:Dt("fields.dailyTime")}),a.jsx(_s,{size:"lg",type:"time",value:o.time,onChange:C=>l({...o,time:C.target.value})})]}):null,o.scheduleType==="weekly"?a.jsxs("div",{className:"cronjobs-inline-fields",children:[a.jsxs("label",{className:"cronjobs-field",children:[a.jsx("span",{children:Dt("fields.weekday")}),a.jsx(pa,{value:String(o.weekday),options:O,size:"lg",onChange:C=>l({...o,weekday:Number(C.value)})})]}),a.jsxs("label",{className:"cronjobs-field",children:[a.jsx("span",{children:Dt("fields.runAt")}),a.jsx(_s,{size:"lg",type:"time",value:o.time,onChange:C=>l({...o,time:C.target.value})})]})]}):null,o.scheduleType==="cron"?a.jsxs("label",{className:"cronjobs-field",children:[a.jsx("span",{children:Dt("fields.cronExpression")}),a.jsx(_s,{size:"lg",value:o.cron,onChange:C=>l({...o,cron:C.target.value}),placeholder:"0 9 * * *"}),a.jsx("small",{children:Dt("fields.cronHelp")})]}):null,a.jsxs("label",{className:"cronjobs-field",children:[a.jsx("span",{children:Dt("fields.timezone")}),a.jsx(pa,{value:o.timezone,options:k,size:"lg",onChange:C=>l({...o,timezone:C.value})})]})]}),a.jsxs("div",{className:"cronjobs-switch-row",children:[a.jsxs("span",{children:[a.jsx("strong",{children:Dt("fields.enableAfterCreate")}),a.jsx("small",{children:Dt("fields.enableHelp")})]}),a.jsx(nU,{checked:o.enabled,onCheckedChange:C=>l({...o,enabled:C}),"aria-label":Dt("fields.enableAfterCreate")})]}),c?a.jsx("div",{ref:g,className:"cronjobs-inline-error",tabIndex:-1,children:a.jsx(Lg,{color:"danger",variant:"soft",description:c})}):null]}),a.jsxs("footer",{className:"cronjobs-drawer-actions",children:[a.jsx(Tt,{type:"button",color:"secondary",variant:"ghost",size:"lg",pill:!1,onClick:r,disabled:b,children:Dt("actions.cancel")}),a.jsx(Tt,{type:"submit",color:"primary",size:"lg",pill:!1,loading:b,disabled:t.length===0,"aria-busy":b||void 0,children:Dt(d?"actions.connectingRuntime":i?"actions.saving":e?"actions.saveChanges":"actions.createTask")})]})]})]})})}function uen({jobs:e,canCreate:t,onCreate:n,onSelect:i}){return a.jsxs(V0,{children:[a.jsx(cb,{icon:a.jsx(Nje,{}),onClick:n,disabled:!t,title:Dt(t?"actions.createScheduledTask":"fields.noRuntime"),children:Dt("actions.createScheduledTask")}),e.map(r=>{const s=Q9e(r.schedule);return a.jsx(q0,{className:"cronjobs-card",title:r.name,status:a.jsx(Ya,{color:r.enabled?"success":"secondary",variant:"soft",size:"sm",pill:!0,children:Dt(r.enabled?"status.enabled":"status.paused")}),description:r.prompt,metadata:[{label:Dt("fields.schedule"),value:s,title:s}],detailAction:{label:Dt("actions.viewDetails"),onClick:()=>i(r)}},r.jobId)})]})}function den({job:e,runs:t,runsLoading:n,runsError:i,busyAction:r,onBack:s,onEdit:o,onToggle:l,onRun:c,onDelete:u,onCancel:d,onRetryRun:f,onRetryRuns:h}){const m=t.find(b=>b.status==="queued"||b.status==="running"||b.status==="retrying"||b.status==="pending")??(rU(e)?e.latestRun:void 0),g=r.includes(e.jobId);return a.jsxs("div",{className:"cronjobs-detail",children:[a.jsxs("header",{className:"cronjobs-detail-head",children:[a.jsxs("div",{className:"cronjobs-detail-title",children:[a.jsx(Tt,{type:"button",color:"secondary",variant:"ghost",size:"lg",uniform:!0,pill:!1,onClick:s,"aria-label":Dt("actions.backToList"),children:a.jsx(Hst,{})}),a.jsxs("div",{children:[a.jsx("h1",{children:e.name}),a.jsxs("p",{children:[e.runtimeName||e.agentName," · ",Q9e(e.schedule)]})]})]}),a.jsxs("div",{className:"cronjobs-detail-actions",children:[a.jsxs(Tt,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:o,disabled:g,children:[a.jsx(nat,{}),Dt("actions.edit")]}),a.jsxs(Tt,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:l,disabled:g,children:[e.enabled?a.jsx(lat,{}):a.jsx(WJ,{}),Dt(e.enabled?"actions.pause":"actions.enable")]}),m?a.jsxs(Tt,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>d(m),disabled:g||!!m.cancellationRequestedAt,children:[a.jsx(hat,{}),Dt(m.cancellationRequestedAt?m.status==="queued"?"actions.cancelling":"actions.stopping":m.status==="queued"?"actions.cancelQueue":"actions.stopRun")]}):a.jsxs(Tt,{type:"button",color:"primary",size:"lg",pill:!1,onClick:c,disabled:g||!e.enabled,children:[a.jsx(WJ,{}),Dt("actions.runNow")]}),a.jsx(Ea,{compact:!0,content:Dt(m?m.status==="queued"?"actions.cancelQueueFirst":"actions.stopRunFirst":"actions.deleteTask"),children:a.jsxs(Tt,{type:"button",color:"danger",variant:"ghost",size:"lg",pill:!1,onClick:u,disabled:g||!!m,"aria-label":Dt("actions.deleteTask"),children:[a.jsx(Jst,{}),Dt("actions.delete")]})})]})]}),a.jsxs("div",{className:"cronjobs-detail-scroll",children:[a.jsxs("section",{className:"cronjobs-summary-grid","aria-label":Dt("detail.configuration"),children:[a.jsxs("dl",{children:[a.jsxs("div",{children:[a.jsx("dt",{children:Dt("detail.status")}),a.jsx("dd",{children:Dt(e.enabled?"status.enabled":"status.paused")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:Dt("detail.nextRun")}),a.jsx("dd",{children:e.enabled?iU(e.nextRunAt):"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:Dt("detail.runtime")}),a.jsx("dd",{title:e.runtimeName,children:e.runtimeName})]}),a.jsxs("div",{children:[a.jsx("dt",{children:Dt("detail.region")}),a.jsx("dd",{children:e.region})]})]}),a.jsxs("div",{className:"cronjobs-prompt",children:[a.jsx("span",{children:Dt("fields.prompt")}),a.jsx("p",{children:e.prompt})]})]}),a.jsxs("section",{className:"cronjobs-history",children:[a.jsxs("header",{children:[a.jsxs("div",{children:[a.jsx("h2",{children:Dt("history.title")}),a.jsx("p",{children:Dt("history.description")})]}),a.jsx(Ea,{compact:!0,content:Dt("actions.refresh"),children:a.jsx(Tt,{type:"button",color:"secondary",variant:"ghost",size:"lg",uniform:!0,pill:!1,onClick:h,disabled:n,"aria-label":Dt("actions.refreshHistory"),children:a.jsx(ZD,{})})})]}),n&&t.length===0?a.jsx(cl,{}):i?a.jsx(Lg,{className:"cronjobs-history-alert",color:"danger",variant:"soft",title:Dt("history.loadFailed"),description:i,actions:a.jsx(Tt,{type:"button",color:"danger",variant:"soft",size:"sm",pill:!1,onClick:h,children:Dt("actions.retry")})}):t.length===0?a.jsxs(Hn,{className:"cronjobs-history-state",fill:"none",children:[a.jsx(Hn.Icon,{children:a.jsx(hV,{})}),a.jsx(Hn.Title,{children:Dt("history.emptyTitle")}),a.jsx(Hn.Description,{children:Dt("history.emptyDescription")})]}):a.jsx("div",{className:"cronjobs-runs",children:t.map(b=>a.jsxs("article",{className:"cronjobs-run",children:[a.jsxs("div",{className:"cronjobs-run-main",children:[a.jsx(cen,{run:b}),a.jsxs("div",{children:[a.jsx("strong",{children:iU(b.startedAt||b.scheduledAt)}),a.jsxs("span",{children:[Dt("history.duration",{duration:nen(b)}),b.runtimeVersion?` · Runtime v${b.runtimeVersion}`:""]})]})]}),b.sessionId?a.jsxs("div",{className:"cronjobs-run-meta",children:[a.jsx("span",{children:Dt("history.session")}),a.jsx("strong",{title:b.sessionId,children:b.sessionId})]}):null,b.output?a.jsxs("div",{className:"cronjobs-run-output",children:[a.jsx("span",{children:Dt("history.finalAnswer")}),a.jsx(ien,{output:b.output})]}):null,b.error?a.jsxs("div",{className:"cronjobs-run-output is-error",children:[a.jsx("span",{children:Dt("history.errorDetails")}),a.jsx(wb,{message:b.error,className:"cronjobs-run-error-detail",defaultExpanded:!1,onRetry:b.status==="failed"?f:void 0,retryLabel:Dt("actions.rerun")})]}):null,b.status==="queued"||b.status==="running"||b.status==="retrying"||b.status==="pending"?a.jsx(Tt,{type:"button",className:"cronjobs-run-cancel",color:"danger",variant:"soft",size:"sm",pill:!1,onClick:()=>d(b),disabled:g||!!b.cancellationRequestedAt,loading:!!b.cancellationRequestedAt,children:Dt(b.cancellationRequestedAt?"actions.stopping":b.status==="queued"?"actions.cancelQueue":"actions.stop")}):null]},b.runId))})]})]})]})}function fen({cloudProvider:e,selectedRuntime:t}){const[n,i]=p.useState("studio");Te("cronjobs");const[r,s]=p.useState([]),[o,l]=p.useState([]),[c,u]=p.useState(!0),[d,f]=p.useState(""),[h,m]=p.useState(""),[g,b]=p.useState(void 0),[v,y]=p.useState([]),[w,x]=p.useState(!1),[O,k]=p.useState(""),[S,C]=p.useState(""),[E,j]=p.useState("all"),[T,R]=p.useState(""),[A,N]=p.useState(null),[P,I]=p.useState(""),D=r.find(W=>W.jobId===h),_=E==="all"?r:r.filter(W=>E==="enabled"?W.enabled:!W.enabled),L=p.useCallback(async W=>{u(!0),f("");try{const[G,H]=await Promise.all([z8(W),F0({scope:"all",region:"all",pageSize:100})]);if(W!=null&&W.aborted)return;s(G),l(H.runtimes.filter(se=>se.status.toLowerCase()==="ready"))}catch(G){if(W!=null&&W.aborted)return;console.warn("Unable to load scheduled tasks",G),f(Dt("page.loadFailedDescription"))}finally{W!=null&&W.aborted||u(!1)}},[]);p.useEffect(()=>{const W=new AbortController;return L(W.signal),()=>W.abort()},[L]);const F=p.useCallback(async(W,G)=>{x(!0),k("");try{const H=await V8(W,G);G!=null&&G.aborted||y(H)}catch(H){G!=null&&G.aborted||(console.warn("Unable to load scheduled-task history",H),k(Dt("history.loadFailedDescription")))}finally{G!=null&&G.aborted||x(!1)}},[]);p.useEffect(()=>{if(!h){y([]),k("");return}const W=new AbortController;return F(h,W.signal),()=>W.abort()},[F,h]);const M=r.some(rU);p.useEffect(()=>{!M&&T===Dt("notices.queued")&&R("")},[M,T]),p.useEffect(()=>{if(!M)return;const W=new AbortController,G=async()=>{try{const[se,Y]=await Promise.all([z8(W.signal),h?V8(h,W.signal):Promise.resolve(null)]);if(W.signal.aborted)return;s(se),Y&&y(Y),se.some(rU)||R("")}catch(se){W.signal.aborted||R(se instanceof Error?se.message:String(se))}},H=window.setInterval(()=>void G(),ren);return()=>{window.clearInterval(H),W.abort()}},[M,h]);const z=W=>s(G=>G.some(H=>H.jobId===W.jobId)?G.map(H=>H.jobId===W.jobId?W:H):[W,...G]),q=async(W,G,H,se=!1)=>{C(W),R("");try{await G(),R(H)}catch(Y){const X=Y instanceof Error?Y.message:String(Y);if(se)throw new Error(X);R(X)}finally{C("")}},U=async W=>{const G=g??null;await q(`${(G==null?void 0:G.jobId)??"new"}:save`,async()=>{const H=G?await m2e(G.jobId,W):await p2e(W);z(H),b(void 0),G&&m(H.jobId)},Dt(G?"notices.updated":"notices.created"),!0)},J=W=>void q(`${W.jobId}:toggle`,async()=>z(await g2e(W.jobId,!W.enabled)),Dt(W.enabled?"notices.paused":"notices.enabled")),V=(W,G)=>q(`${W.jobId}:run`,async()=>{const H=await b2e(W.jobId);z({...W,latestRun:H}),h===W.jobId&&y(se=>[H,...se.filter(Y=>Y.runId!==H.runId)])},G),Z=W=>void V(W,Dt("notices.queued")),ne=()=>{if(!A)return;I("");const W=A;W.kind==="delete"?q(`${W.job.jobId}:delete`,async()=>{await v2e(W.job.jobId),s(G=>G.filter(H=>H.jobId!==W.job.jobId)),m(""),N(null)},Dt("notices.deleted"),!0).catch(G=>{I(G instanceof Error?G.message:String(G))}):q(`${W.job.jobId}:cancel`,async()=>{var H;const G=await y2e(W.job.jobId,W.run.runId);y(se=>se.map(Y=>Y.runId===G.runId?G:Y)),z({...W.job,latestRun:((H=W.job.latestRun)==null?void 0:H.runId)===G.runId?G:W.job.latestRun}),N(null)},Dt("notices.cancelRequested"),!0).catch(G=>{I(G instanceof Error?G.message:String(G))})};return D?a.jsxs(Oh,{className:"cronjobs-page","aria-label":Dt("detail.pageLabel"),children:[a.jsx(den,{job:D,runs:v,runsLoading:w,runsError:O,busyAction:S,onBack:()=>m(""),onEdit:()=>b(D),onToggle:()=>J(D),onRun:()=>Z(D),onDelete:()=>{I(""),N({kind:"delete",job:D})},onCancel:W=>{I(""),N({kind:"cancel",job:D,run:W})},onRetryRun:()=>V(D,Dt("notices.requeued")),onRetryRuns:()=>void F(D.jobId)}),T?a.jsx("div",{className:"cronjobs-notice",role:"status",children:a.jsx(Lg,{color:"info",variant:"soft",description:T})}):null,g!==void 0?a.jsx(ale,{job:g,runtimes:o,cloudProvider:e,busy:S.endsWith(":save"),onClose:()=>b(void 0),onSubmit:U}):null,A?a.jsx(Ad,{title:Dt(A.kind==="delete"?"confirm.deleteTitle":"confirm.cancelTitle"),description:A.kind==="delete"?Dt("confirm.deleteDescription",{name:A.job.name}):Dt("confirm.cancelDescription"),error:P,confirmLabel:Dt(A.kind==="delete"?"actions.deleteTask":"actions.stop"),variant:"danger",busy:S.endsWith(A.kind),onCancel:()=>{I(""),N(null)},onConfirm:ne}):null]}):a.jsxs(Oh,{className:"cronjobs-page","aria-label":Dt("page.title"),children:[a.jsx(z0,{className:"cronjobs-page-head",title:Dt("page.title")}),a.jsx(ab,{children:a.jsx(ob,{idPrefix:"cronjobs-source",ariaLabel:Dt("mpa.source"),value:n,items:[{id:"studio",label:Dt("mpa.studio")},{id:"runtime",label:Dt("mpa.title")}],onChange:i})}),n==="runtime"?a.jsx(tm,{children:a.jsx(GJt,{runtime:t})}):a.jsxs(a.Fragment,{children:[a.jsx(ab,{children:a.jsx(ob,{idPrefix:"cronjobs-filter",ariaLabel:Dt("page.filterLabel"),value:E,items:[{id:"all",label:Dt("filters.all")},{id:"enabled",label:Dt("status.enabled")},{id:"paused",label:Dt("status.paused")}],onChange:j})}),T?a.jsx("div",{className:"cronjobs-banner",role:"status",children:a.jsx(Lg,{color:"info",variant:"soft",description:T})}):null,a.jsx(tm,{"aria-label":Dt("page.listLabel"),children:c&&r.length===0?a.jsx(cl,{}):d?a.jsxs(Hn,{className:"cronjobs-state",fill:"none",children:[a.jsx(Hn.Icon,{color:"danger",children:a.jsx(hV,{})}),a.jsx(Hn.Title,{color:"danger",children:Dt("page.loadFailed")}),a.jsx(Hn.Description,{children:d}),a.jsx(Hn.ActionRow,{children:a.jsxs(Tt,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:()=>void L(),children:[a.jsx(ZD,{}),Dt("actions.retry")]})})]}):a.jsx(uen,{jobs:_,canCreate:!c&&o.length>0,onCreate:()=>b(null),onSelect:W=>m(W.jobId)})})]}),g!==void 0?a.jsx(ale,{job:g,runtimes:o,cloudProvider:e,busy:S.endsWith(":save"),onClose:()=>b(void 0),onSubmit:U}):null]})}const hen={volcengine:"https://console.volcengine.com",byteplus:"https://console.byteplus.com"};function cA(e){return e.trim()}function EK(e){return hen[e]}function pen(e){const t=cA(e);if(!t)return null;let n=t;try{n=new URL(t.includes("://")?t:`https://${t}`).hostname}catch{return null}const i=n.match(/^(.+)\.tos-([a-z0-9-]+)\.(?:volces|bytepluses)\.com$/i);return i?{bucket:i[1],region:i[2]}:null}function men(e,t){const n=pen(t);if(!n)return null;const i=new URLSearchParams({id:n.bucket,region:n.region,type:"objects"});return`${EK(e)}/tos/bucket/setting?${i.toString()}`}function gen(e,t,n){const i=cA(t),r=cA(n);return!i||!r?null:`${EK(e)}/agentkit/region:agentkit+${encodeURIComponent(i)}/builtintools/${encodeURIComponent(r)}/detail`}function ben(e,t,n){const i=cA(t),r=cA(n);return!i||!r?null:`${EK(e)}/identity/region:identity+${encodeURIComponent(i)}/user-pools/${encodeURIComponent(r)}/info`}function Nk({href:e,label:t,children:n}){return e?a.jsxs("a",{className:"system-info-resource-link",href:e,target:"_blank",rel:"noreferrer","aria-label":t,title:t,children:[a.jsx("span",{children:n}),a.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[a.jsx("path",{d:"M7.75 5.25h-2.5a1.5 1.5 0 0 0-1.5 1.5v8a1.5 1.5 0 0 0 1.5 1.5h8a1.5 1.5 0 0 0 1.5-1.5v-2.5"}),a.jsx("path",{d:"M10.25 3.75h6v6M16 4 9 11"})]})]}):a.jsx("span",{children:n})}function yen(e){return e instanceof Error&&e.message.includes("Volcengine credentials not found")}function ven({spinning:e}){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e?"is-spinning":"",children:a.jsx("path",{d:"M19.5 9A8 8 0 0 0 5 6L3 9m0-5v5h5M4.5 15A8 8 0 0 0 19 18l2-3m0 5v-5h-5"})})}function xen(){return{busy:!1,error:"",message:""}}function wen({version:e,localMode:t,role:n,provider:i,region:r,onBack:s}){const{t:o}=Te("ui"),l=n==="admin"||n==="super_admin",[c,u]=p.useState(""),[d,f]=p.useState([]),[h,m]=p.useState([]),[g,b]=p.useState(null),[v,y]=p.useState(!0),[w,x]=p.useState(""),[O,k]=p.useState(!0),[S,C]=p.useState(""),[E,j]=p.useState(!0),[T,R]=p.useState(""),[A,N]=p.useState(0),[P,I]=p.useState(0),[D,_]=p.useState(0),L=p.useRef(!1),[F,M]=p.useState({}),[z,q]=p.useState({}),[U,J]=p.useState(""),[V,Z]=p.useState(!0),ne=p.useRef(new Set),W=p.useRef(0),G=`${i}:${r}`,H=p.useRef(G);H.current=G,p.useEffect(()=>{q({}),M({})},[G]),p.useEffect(()=>(L.current=!0,()=>{L.current=!1}),[]);function se(X,ie){M(ee=>({...ee,[X]:{...xen(),...ee[X],...ie}}))}async function Y(X){if(!X.toolId||ne.current.has(X.toolId))return;const ie=G;ne.current.add(X.toolId),W.current+=1,se(X.toolId,{busy:!0,error:"",message:""});try{const ee=await D2e(X.kind);if(!L.current||H.current!==ie)return;W.current+=1,q(be=>({...be,[X.toolId]:ee.state})),se(X.toolId,{busy:!1,error:"",message:ee.updated?o("systemInfo.modelEnvUpdated"):o("systemInfo.modelEnvAlreadyCurrent")})}catch{if(!L.current||H.current!==ie)return;W.current+=1,se(X.toolId,{busy:!1,error:o("systemInfo.sandboxUpdateError"),message:""})}finally{ne.current.delete(X.toolId)}}return p.useEffect(()=>{if(!l)return;const X=new AbortController,ie=++W.current;return J(""),Z(!0),P2e(X.signal).then(ee=>{X.signal.aborted||ie!==W.current||q(Object.fromEntries(ee.map(be=>[be.toolId,be])))}).catch(()=>{!X.signal.aborted&&ie===W.current&&J(o("systemInfo.versionCheckError"))}).finally(()=>{X.signal.aborted||Z(!1)}),()=>X.abort()},[l,i,r,A]),p.useEffect(()=>{if(!Object.values(z).some(ie=>ie.status==="Updating"||ie.status==="Creating"))return;const X=window.setTimeout(()=>N(ie=>ie+1),5e3);return()=>window.clearTimeout(X)},[z]),p.useEffect(()=>{if(!l){u(""),f([]),y(!1),x("");return}const X=new AbortController;return y(!0),x(""),PTe(X.signal).then(ie=>{X.signal.aborted||(u(ie.storage.tosAddress),f(ie.sandboxTools))}).catch(ie=>{(ie==null?void 0:ie.name)!=="AbortError"&&x(o("systemInfo.sandboxInfoError"))}).finally(()=>{X.signal.aborted||y(!1)}),()=>X.abort()},[l,i,r,A]),p.useEffect(()=>{if(!l){m([]),k(!1),C("");return}const X=new AbortController;return k(!0),C(""),ND(X.signal).then(ie=>{m(ie.filter(ee=>ee.isCurrent))}).catch(ie=>{if((ie==null?void 0:ie.name)!=="AbortError"){if(t&¥(ie)){m([]);return}C(o("systemInfo.userPoolError"))}}).finally(()=>{X.signal.aborted||k(!1)}),()=>X.abort()},[l,t,P]),p.useEffect(()=>{if(!l){b(null),j(!1),R("");return}const X=new AbortController;return j(!0),R(""),JTe(X.signal).then(b).catch(ie=>{(ie==null?void 0:ie.name)!=="AbortError"&&R(o("systemInfo.environmentResourcesError"))}).finally(()=>{X.signal.aborted||j(!1)}),()=>X.abort()},[l,D]),a.jsxs("div",{className:"system-info-page",children:[a.jsxs("header",{className:"system-info-page-header",children:[a.jsx(YD,{label:o("common.back"),onClick:s}),a.jsxs("div",{children:[a.jsx("h1",{children:o("systemInfo.title")}),a.jsx("p",{children:o("systemInfo.description")})]})]}),a.jsxs("div",{className:"system-info-scroll",children:[a.jsxs("section",{className:"system-info-section","aria-labelledby":"studio-info-title",children:[a.jsx("h2",{id:"studio-info-title",children:o("systemInfo.general")}),a.jsx("dl",{className:"system-info-summary",children:a.jsxs("div",{children:[a.jsx("dt",{children:o("systemInfo.currentVersion")}),a.jsx("dd",{children:e||"—"})]})})]}),l?a.jsxs(a.Fragment,{children:[a.jsxs("section",{className:"system-info-section","aria-labelledby":"storage-info-title",children:[a.jsx("h2",{id:"storage-info-title",children:o("systemInfo.storage")}),v?a.jsx("div",{className:"system-info-loading",role:"status","aria-live":"polite",children:a.jsx(hn,{as:"span",children:o("systemInfo.loadingStorage")})}):w?a.jsxs("div",{className:"system-info-error",role:"alert",children:[a.jsx("p",{children:w}),a.jsx("button",{type:"button",onClick:()=>N(X=>X+1),children:o("common.reload")})]}):a.jsx("dl",{className:"system-info-summary",children:a.jsxs("div",{className:"system-info-resource-row",children:[a.jsx("dt",{children:o("systemInfo.tosAddress")}),a.jsx("dd",{className:`system-info-resource-value${c?"":" is-empty"}`,children:a.jsx(Nk,{href:men(i,c),label:o("systemInfo.openTosConsole"),children:c||o("common.notConfigured")})})]})})]}),a.jsxs("section",{className:"system-info-section","aria-labelledby":"environment-build-info-title",children:[a.jsx("h2",{id:"environment-build-info-title",children:o("systemInfo.environmentBuild")}),E?a.jsx("div",{className:"system-info-loading",role:"status","aria-live":"polite",children:a.jsx(hn,{as:"span",children:o("systemInfo.loadingEnvironmentResources")})}):T?a.jsxs("div",{className:"system-info-error",role:"alert",children:[a.jsx("p",{children:T}),a.jsx("button",{type:"button",onClick:()=>_(X=>X+1),children:o("common.reload")})]}):g?a.jsxs("dl",{className:"system-info-summary",children:[a.jsxs("div",{className:"system-info-resource-row",children:[a.jsx("dt",{children:o("systemInfo.codePipelineWorkspace")}),a.jsx("dd",{className:"system-info-resource-value",children:a.jsx(Nk,{href:g.codePipeline.consoleUrl||null,label:o("systemInfo.openCodePipelineWorkspace"),children:g.codePipeline.workspaceName||g.codePipeline.workspaceId||o("systemInfo.createdOnFirstBuild")})})]}),a.jsxs("div",{className:"system-info-resource-row",children:[a.jsx("dt",{children:o("systemInfo.codePipelinePipeline")}),a.jsx("dd",{className:"system-info-resource-value",children:g.codePipeline.pipelineName||g.codePipeline.pipelineId||o("systemInfo.createdOnFirstBuild")})]}),a.jsxs("div",{className:"system-info-resource-row",children:[a.jsx("dt",{children:o("systemInfo.containerRegistryRepository")}),a.jsx("dd",{className:"system-info-resource-value",children:a.jsx(Nk,{href:g.containerRegistry.consoleUrl||null,label:o("systemInfo.openContainerRegistryRepository"),children:g.containerRegistry.imageRepository||[g.containerRegistry.registry,g.containerRegistry.namespace,g.containerRegistry.repository].filter(Boolean).join("/")||o("systemInfo.createdOnFirstBuild")})})]})]}):null]}),a.jsxs("section",{className:"system-info-section","aria-labelledby":"sandbox-tool-title",children:[a.jsx("h2",{id:"sandbox-tool-title",children:o("systemInfo.sandboxInfo")}),a.jsx("button",{type:"button",className:"system-info-refresh",disabled:V,onClick:()=>N(X=>X+1),children:o(V?"systemInfo.checkingVersions":"systemInfo.checkUpdates")}),v?a.jsx("div",{className:"system-info-loading",role:"status","aria-live":"polite",children:a.jsx(hn,{as:"span",children:o("systemInfo.loadingSandboxInfo")})}):w?a.jsxs("div",{className:"system-info-error",role:"alert",children:[a.jsx("p",{children:w}),a.jsx("button",{type:"button",onClick:()=>N(X=>X+1),children:o("common.reload")})]}):a.jsxs("div",{className:"system-info-tool-list",children:[U?a.jsx("span",{className:"system-info-inline-error",role:"alert",children:U}):null,d.map(X=>{var pe;const ie=z[X.toolId],ee=F[X.toolId],be=!!X.toolId&&!!(ie!=null&&ie.canUpdate),ue=(ee==null?void 0:ee.error)||(ie!=null&&ie.error?o("systemInfo.versionCheckError"):ie!=null&&ie.modelEnvError?o("systemInfo.modelEnvRepairUnavailable"):"");return a.jsx("dl",{className:"system-info-tool",children:a.jsxs("div",{className:"system-info-resource-row",children:[a.jsxs("dt",{className:"system-info-tool-label",children:[a.jsx("span",{children:X.label}),X.snapshot?a.jsx("span",{className:"system-info-tool-badge",children:o("systemInfo.snapshot")}):null]}),a.jsxs("dd",{className:`system-info-resource-value${X.toolId?"":" is-empty"}`,children:[a.jsx(Nk,{href:gen(i,(ie==null?void 0:ie.region)||r,X.toolId),label:o("systemInfo.openToolConsole",{name:X.label}),children:X.toolId||o("common.notConfigured")}),be?a.jsx("button",{type:"button",className:"system-info-resource-update",disabled:ee==null?void 0:ee.busy,"aria-busy":(ee==null?void 0:ee.busy)||void 0,"aria-label":o("systemInfo.updateSandbox",{name:X.label,variant:X.snapshot?o("systemInfo.snapshotWithSpace"):""}),title:o("systemInfo.updateSandbox",{name:X.label,variant:X.snapshot?o("systemInfo.snapshotWithSpace"):""}),onClick:()=>void Y(X),children:a.jsx(ven,{spinning:(ee==null?void 0:ee.busy)||!1})}):null,ie!=null&&ie.currentImage?a.jsxs("span",{className:"system-info-inline-status",title:`${ie.currentImage} → ${ie.latestImage}`,children:[ie.currentImage.split(":").pop(),ie.needsImageUpdate?` → ${(pe=ie.latestImage)==null?void 0:pe.split(":").pop()}`:"",ie.status==="Updating"?` · ${o("systemInfo.updatingSandbox")}`:""]}):null,ee!=null&&ee.message?a.jsx("span",{className:"system-info-inline-status",role:"status",children:ee.message}):null,ue?a.jsx("span",{className:"system-info-inline-error",role:"alert",children:ue}):null]})]})},X.kind)})]})]}),a.jsxs("section",{className:"system-info-section","aria-labelledby":"user-pool-title",children:[a.jsx("h2",{id:"user-pool-title",children:o("systemInfo.userPool")}),O?a.jsx("div",{className:"system-info-loading",role:"status","aria-live":"polite",children:a.jsx(hn,{as:"span",children:o("systemInfo.loadingUserPool")})}):S?a.jsxs("div",{className:"system-info-error",role:"alert",children:[a.jsx("p",{children:S}),a.jsx("button",{type:"button",onClick:()=>I(X=>X+1),children:o("common.reload")})]}):h.length>0?a.jsx("div",{className:"system-info-pool-list",children:h.map(X=>a.jsxs("dl",{className:"system-info-pool",children:[a.jsxs("div",{children:[a.jsx("dt",{children:o("common.name")}),a.jsx("dd",{className:"system-info-resource-value",children:a.jsx(Nk,{href:ben(i,X.region||r,X.uid),label:o("systemInfo.openUserPoolConsole",{name:X.name||""}),children:X.name||o("systemInfo.unnamedUserPool")})})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("systemInfo.id")}),a.jsx("dd",{children:X.uid||"—"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("systemInfo.domain")}),a.jsx("dd",{children:X.domain||"—"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("systemInfo.region")}),a.jsx("dd",{children:X.region||"—"})]})]},X.uid))}):a.jsx("p",{className:"system-info-empty",children:o(t?"systemInfo.noLocalUserPool":"systemInfo.noUserPool")})]})]}):null]})]})}const Oen="_TextLink_16uec_1",ken={TextLink:Oen},xj=e=>{const{children:t,primary:n=!1,underline:i=!n,className:r,target:s,forceExternal:o,as:l,href:c,to:u,...d}=e,f=o??/^https?:\/\//.test(c??u??""),h=aIe(),m=l||(f?"a":h),g={...d,className:Qi(ken.TextLink,r),"data-primary":n?"":void 0,"data-underline":i?"":void 0};if(!c&&!u)return a.jsx("span",{...g,role:"button",children:t});const b={...f?{target:"_blank",rel:"noopener noreferrer",href:c??u}:{href:c,to:u},...g};return a.jsx(m,{...b,children:t})},Sen="/assets/media/article-agent-workflow-GXPkXUjV.webp",Een="/assets/media/article-tool-debugging-BxiMDz_8.webp",Cen="/assets/media/showcase-a2ui-BgBnE9RT.webp",Aen="/assets/media/showcase-customer-service-DNw0mUH1.webp",Ten="/assets/media/showcase-multimodal-BRTl8NLI.webp",_en="/assets/media/showcase-research-assistant-CbfMFfhS.webp",jen="/assets/media/showcase-web-search-D2kl1imN.webp",Nen={volcengine:{console:"https://console.volcengine.com/agentkit",docs:"https://www.volcengine.com/docs/86681/1844823"},byteplus:{console:"https://console.byteplus.com/agentkit",docs:"https://docs.byteplus.com/en/docs/AgentKit"}};function Ren(e){return Nen[e]}const Ien=[{id:"documentation",titleKey:"developerResources.sections.documentation.title",descriptionKey:"developerResources.sections.documentation.description"},{id:"best-practices",titleKey:"developerResources.sections.bestPractices.title",descriptionKey:"developerResources.sections.bestPractices.description"},{id:"showcases",titleKey:"developerResources.sections.showcases.title",descriptionKey:"developerResources.sections.showcases.description"}],Pen="https://volcengine.github.io/veadk-python/",Den="https://volcengine.github.io/agentkit-sdk-python/content/2.agentkit-cli/1.overview.html",Men=[{id:"veadk-development",titleKey:"developerResources.articles.veadkDevelopment.title",descriptionKey:"developerResources.articles.veadkDevelopment.description",meta:"AgentKit · VeADK",image:Sen,href:"https://docs.volcengine.com/docs/86681/2155817?lang=zh"},{id:"agentkit-cli-development",titleKey:"developerResources.articles.cliDevelopment.title",descriptionKey:"developerResources.articles.cliDevelopment.description",meta:"AgentKit · CLI",image:Een,href:"https://docs.volcengine.com/docs/86681/1844871?lang=zh"}],Len=[{id:"research-assistant",titleKey:"developerResources.showcases.researchAssistant.title",descriptionKey:"developerResources.showcases.researchAssistant.description",image:_en,href:"https://github.com/volcengine/veadk-python/tree/main/examples/06_multi_agent"},{id:"multimodal-analysis",titleKey:"developerResources.showcases.multimodalAnalysis.title",descriptionKey:"developerResources.showcases.multimodalAnalysis.description",image:Ten,href:"https://github.com/volcengine/veadk-python/tree/main/examples/multimodal_agent"},{id:"customer-service",titleKey:"developerResources.showcases.customerService.title",descriptionKey:"developerResources.showcases.customerService.description",image:Aen,href:"https://github.com/volcengine/veadk-python/tree/main/examples/basic-app"},{id:"web-search",titleKey:"developerResources.showcases.webSearch.title",descriptionKey:"developerResources.showcases.webSearch.description",image:jen,href:"https://github.com/volcengine/veadk-python/tree/main/examples/04_web_search"},{id:"a2ui-app",titleKey:"developerResources.showcases.a2uiApp.title",descriptionKey:"developerResources.showcases.a2uiApp.description",image:Cen,href:"https://github.com/volcengine/veadk-python/tree/main/examples/a2ui_agent"}];function $en({cloudProvider:e}){const{t}=Te("workspaceTools"),n=Ren(e);return a.jsxs(Oh,{className:"developer-resources","aria-label":t("developerResources.title"),children:[a.jsx(z0,{title:t("developerResources.title")}),a.jsx("div",{className:"developer-resources__content",children:Ien.map(i=>a.jsxs("section",{className:"developer-resources__section","aria-labelledby":`developer-resources-${i.id}`,children:[a.jsxs("header",{className:"developer-resources__section-header",children:[a.jsx("h2",{id:`developer-resources-${i.id}`,children:t(i.titleKey)}),a.jsx("p",{children:t(i.descriptionKey)})]}),i.id==="documentation"?a.jsxs("ul",{className:"developer-resources__links",children:[a.jsx("li",{children:a.jsxs(xj,{className:"developer-resources__link",primary:!0,underline:!0,href:Pen,target:"_blank",rel:"noreferrer",children:[t("developerResources.links.veadkDocs"),a.jsx(r_,{"aria-hidden":"true"})]})}),a.jsx("li",{children:a.jsxs(xj,{className:"developer-resources__link",primary:!0,underline:!0,href:Den,target:"_blank",rel:"noreferrer",children:[t("developerResources.links.cliDocs"),a.jsx(r_,{"aria-hidden":"true"})]})}),a.jsx("li",{children:a.jsxs(xj,{className:"developer-resources__link",primary:!0,underline:!0,href:n.docs,target:"_blank",rel:"noreferrer",children:[t("developerResources.links.platformDocs"),a.jsx(r_,{"aria-hidden":"true"})]})}),a.jsx("li",{children:a.jsxs(xj,{className:"developer-resources__link",primary:!0,underline:!0,href:n.console,target:"_blank",rel:"noreferrer",children:[t("developerResources.links.console"),a.jsx(r_,{"aria-hidden":"true"})]})})]}):i.id==="best-practices"?a.jsx("div",{className:"developer-resources__articles",children:Men.map(r=>a.jsxs("a",{className:"developer-resources__article",href:r.href,target:"_blank",rel:"noreferrer",children:[a.jsx("img",{src:r.image,alt:t("developerResources.articles.coverAlt",{title:t(r.titleKey)}),loading:"lazy"}),a.jsxs("span",{className:"developer-resources__article-copy",children:[a.jsx("strong",{children:t(r.titleKey)}),a.jsx("span",{children:t(r.descriptionKey)}),a.jsx("small",{children:r.meta})]})]},r.id))}):i.id==="showcases"?a.jsx("div",{className:"developer-resources__showcases",children:Len.map(r=>a.jsxs("a",{className:"developer-resources__showcase",href:r.href,target:"_blank",rel:"noreferrer",children:[a.jsx("span",{className:"developer-resources__showcase-media",children:a.jsx("img",{src:r.image,alt:t("developerResources.showcases.previewAlt",{title:t(r.titleKey)}),loading:"lazy"})}),a.jsx("strong",{children:t(r.titleKey)}),a.jsx("span",{children:t(r.descriptionKey)})]},r.id))}):null]},i.id))})]})}function Fen({cloudProvider:e,onPendingCountChange:t,onChanged:n}){const{t:i,i18n:r}=Te("agentReviews"),[s,o]=p.useState(Zi(e)),[l,c]=p.useState([]),[u,d]=p.useState(!0),[f,h]=p.useState(""),[m,g]=p.useState(""),[b,v]=p.useState("all"),[y,w]=p.useState(0),[x,O]=p.useState(null);p.useEffect(()=>{o(Zi(e))},[e]),p.useEffect(()=>{const C=new AbortController;return d(!0),h(""),jXt(s,C.signal).then(E=>{C.signal.aborted||(c(E.items),t(E.items.filter(j=>j.status==="pending").length))}).catch(E=>{C.signal.aborted||h(E instanceof Error?E.message:String(E))}).finally(()=>{C.signal.aborted||d(!1)}),()=>C.abort()},[s,y,t]);const k=p.useMemo(()=>l.filter(C=>(b==="all"||C.status===b)&&`${C.agent.name} ${C.submitter.name}`.toLocaleLowerCase().includes(m.trim().toLocaleLowerCase())),[l,m,b]),S=[{key:"name",header:i("agent"),className:"review-column-name",render:C=>a.jsx("button",{type:"button",className:"agent-review-name",onClick:()=>O(C),children:C.agent.name})},{key:"submitter",header:i("submitter"),render:C=>a.jsx(IP,{person:C.submitter})},{key:"version",header:i("version"),render:C=>C.agent.version??"—"},{key:"submittedAt",header:i("submittedAt"),render:C=>a.jsx("time",{dateTime:C.submittedAt,children:new Date(C.submittedAt).toLocaleString(r.language)})},{key:"status",header:i("statusTitle"),render:C=>a.jsxs("div",{children:[i(`status.${C.status}`),C.reviewer?a.jsx(IP,{person:C.reviewer}):null]})},{key:"actions",header:i("actions"),render:C=>a.jsx("button",{type:"button",onClick:()=>O(C),children:i(C.status==="pending"?"review":"details")})}];return a.jsxs("div",{className:"agent-review-center","aria-label":i("title"),children:[f?a.jsxs("div",{className:"agent-review-error",role:"alert",children:[a.jsx("p",{children:f}),a.jsx("button",{type:"button",onClick:()=>w(C=>C+1),children:i("refresh")})]}):null,a.jsx(yH,{rows:k,rowKey:C=>`${C.region}:${C.id}`,columns:S,searchValue:m,onSearchChange:g,searchPlaceholder:i("search"),searchLabel:i("search"),toolbarActions:a.jsxs(a.Fragment,{children:[a.jsx(lb,{id:"agent-review-region",ariaLabel:i("region"),value:s,options:Tu(e),onChange:C=>{o(C),c([]),O(null)}}),a.jsx(lb,{id:"agent-review-status",ariaLabel:i("statusTitle"),value:b,options:["all","pending","approved","returned","withdrawn"].map(C=>({value:C,label:i(C==="all"?"all":`status.${C}`)})),onChange:v}),a.jsx("button",{type:"button",disabled:u,onClick:()=>w(C=>C+1),children:i("refresh")})]}),emptyLabel:u?a.jsx(cl,{}):f?null:a.jsx("p",{className:"agent-review-empty",children:i(m||b!=="all"?"noMatches":"empty")})}),x?a.jsx(l9e,{runtimeId:x.runtimeId,region:x.region,name:x.agent.name,canPublish:!0,onClose:()=>O(null),onChanged:()=>{n==null||n(),w(C=>C+1)}},`${x.region}:${x.id}`):null]})}function Ben({application:e,decision:t,onClose:n,onDecided:i}){const{t:r}=Te("reviews"),[s,o]=p.useState(""),[l,c]=p.useState(e.status==="approving"&&e.comment||""),[u,d]=p.useState(!1),[f,h]=p.useState(!1),m=p.useRef(!1),[g,b]=p.useState(null),v=t==="returned",y=v&&!s.trim(),w=p.useRef(document.activeElement instanceof HTMLElement?document.activeElement:null),x=async()=>{if(!m.current&&(d(!0),!y)){m.current=!0,h(!0),b(null);try{const O=await Ppt({id:e.id,region:e.region,decision:t,reason:s.trim(),comment:l.trim()});i(O)}catch(O){b(Mr(O,r("decision.failed")))}finally{m.current=!1,h(!1)}}};return a.jsx(nv,{open:!0,onOpenChange:O=>{!O&&!m.current&&n()},children:a.jsxs(tv,{children:[a.jsx(J0,{className:"review-backdrop"}),a.jsxs(ev,{className:"confirm-box review-decision",finalFocus:()=>{var O;return(O=w.current)!=null&&O.isConnected?w.current:document.getElementById("review-skill-tab")},children:[a.jsx(gO,{className:"confirm-title",children:r(v?"decision.returnTitle":"decision.approveTitle")}),a.jsx(RT,{className:"confirm-text",children:r(v?"decision.returnDescription":"decision.approveDescription",{name:e.name,version:e.version})}),v?a.jsxs("div",{className:"review-decision__field",children:[a.jsx("label",{className:"cw-label",htmlFor:"review-return-reason",children:r("decision.reason")}),a.jsx("textarea",{id:"review-return-reason",className:"cw-input",rows:4,maxLength:256,required:!0,disabled:f,value:s,onChange:O=>o(O.target.value),onBlur:()=>d(!0),"aria-invalid":u&&y,"aria-describedby":"review-return-help"}),a.jsx("span",{id:"review-return-help",className:u&&y?"cw-error-text":"cw-help",role:u&&y?"alert":void 0,children:r(u&&y?"decision.reasonRequired":"decision.reasonHelp")})]}):null,a.jsxs("div",{className:"review-decision__field",children:[a.jsx("label",{className:"cw-label",htmlFor:"review-decision-comment",children:r("decision.comment")}),a.jsx("textarea",{id:"review-decision-comment",className:"cw-input",rows:3,maxLength:256,disabled:f||e.status==="approving",value:l,onChange:O=>c(O.target.value),"aria-describedby":"review-comment-help"}),a.jsx("span",{id:"review-comment-help",className:"cw-help",children:r("decision.commentHelp")})]}),g?a.jsx("div",{role:"alert",className:"review-decision__error",children:a.jsx(Ns,{error:g})}):null,a.jsxs("div",{className:"confirm-actions",children:[a.jsx(Tt,{color:"secondary",variant:"outline",size:"md",pill:!1,disabled:f,onClick:n,children:r("actions.cancel")}),a.jsx(Tt,{color:"primary",size:"md",pill:!1,disabled:f||y,onClick:()=>void x(),children:r(f?"decision.saving":v?"actions.confirmReturn":"actions.confirmApprove")})]})]})]})})}const Uen=p.lazy(()=>Js(()=>Promise.resolve().then(()=>t9t),void 0).then(e=>({default:e.SkillFileTree})));function Qen({application:e,cloudProvider:t,onClose:n,onDecision:i,onScoreChanged:r}){var O;const{t:s,i18n:o}=Te("reviews"),[l,c]=p.useState("overview"),[u,d]=p.useState([]),[f,h]=p.useState(!1),[m,g]=p.useState(null),[b,v]=p.useState(0),y=p.useRef(document.activeElement instanceof HTMLElement?document.activeElement:null);p.useEffect(()=>{if(l!=="files")return;const k=new AbortController;return h(!0),g(null),Ipt({id:e.id,region:e.region,signal:k.signal}).then(S=>{k.signal.aborted||d(S.files)}).catch(S=>{k.signal.aborted||g(Mr(S,s("detail.filesFailed")))}).finally(()=>{k.signal.aborted||h(!1)}),()=>k.abort()},[e.id,e.region,l,b,s]);const w=e.reviewedAt?new Date(e.reviewedAt).toLocaleString(o.language,{hour12:!1}):"—",x=e.submittedAt?new Date(e.submittedAt).toLocaleString(o.language,{hour12:!1}):"—";return a.jsx(nv,{open:!0,onOpenChange:k=>{k||n()},children:a.jsxs(tv,{children:[a.jsx(J0,{className:"review-backdrop"}),a.jsxs(ev,{className:"review-drawer",finalFocus:()=>{var k;return(k=y.current)!=null&&k.isConnected?y.current:document.getElementById("review-skill-tab")},children:[a.jsxs("header",{className:"review-drawer__header",children:[a.jsxs("div",{children:[a.jsx(gO,{children:s("detail.title")}),a.jsx(RT,{children:s("detail.versionFixed")})]}),a.jsx(fL,{className:"review-icon-button","aria-label":s("actions.close"),children:a.jsx(mT,{})})]}),a.jsxs("div",{className:"review-drawer__identity",children:[a.jsx("span",{className:"review-resource-icon",children:a.jsx(gIe,{})}),a.jsxs("div",{children:[a.jsx("h2",{children:e.name}),a.jsxs("span",{children:[s("kind.skill")," · ",e.version]})]}),a.jsx(IT,{status:e.status})]}),a.jsx(ob,{className:"review-drawer__tabs",idPrefix:"review-detail",ariaLabel:s("detail.sections"),value:l,items:[{id:"overview",label:s("detail.overview"),panelId:"review-detail-panel"},{id:"files",label:s("detail.filesTab"),panelId:"review-detail-panel"},{id:"score",label:s("score.title"),panelId:"review-detail-panel"}],onChange:c}),a.jsx("div",{className:"review-drawer__body",id:"review-detail-panel",role:"tabpanel","aria-labelledby":`review-detail-${l}-tab`,children:l==="score"?a.jsx(NFe,{application:e,canRetry:!0,onScoreChanged:r},`${e.region}:${e.id}`):l==="files"?f?a.jsx(cl,{}):m?a.jsxs("div",{role:"alert",children:[a.jsx(Ns,{error:m}),a.jsx("button",{type:"button",onClick:()=>v(k=>k+1),children:s("space.retry")})]}):a.jsx("div",{className:"review-files",children:a.jsx(p.Suspense,{fallback:a.jsx(cl,{}),children:a.jsx(Uen,{files:u})})}):a.jsxs(a.Fragment,{children:[a.jsxs("dl",{className:"review-facts",children:[a.jsxs("div",{children:[a.jsx("dt",{children:s("columns.submitter")}),a.jsx("dd",{children:e.author||s("detail.unknownAuthor")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("columns.submittedAt")}),a.jsx("dd",{children:x})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("columns.version")}),a.jsx("dd",{children:e.version})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("detail.source")}),a.jsx("dd",{children:s("detail.source_skill",{name:e.author})})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("detail.destination")}),a.jsx("dd",{children:s("detail.destination_skill")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("detail.region")}),a.jsx("dd",{children:xh(e.region,t)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("detail.visibility")}),a.jsx("dd",{children:s("detail.shared")})]})]}),a.jsxs("section",{className:"review-detail-section",children:[a.jsx("h3",{children:s("detail.description")}),a.jsx("p",{children:e.description||"—"})]}),a.jsxs("section",{className:"review-detail-section",children:[a.jsx("h3",{children:s("detail.result")}),a.jsx(QW,{application:e})]}),a.jsxs("section",{className:"review-detail-section review-history",children:[a.jsx("h3",{children:s("detail.history")}),a.jsxs("div",{children:[a.jsx("span",{className:"review-history__dot","aria-hidden":"true"}),a.jsxs("p",{children:[a.jsx("strong",{children:s("detail.submitted",{name:e.author})}),a.jsx("span",{children:x})]})]}),e.reviewedAt?a.jsxs("div",{children:[a.jsx("span",{className:"review-history__dot","aria-hidden":"true"}),a.jsxs("p",{children:[a.jsx("strong",{children:s(`detail.${e.status==="approved"?"approved":e.status==="returned"?"returned":"approving"}`,{name:((O=e.reviewer)==null?void 0:O.name)||e.reviewedBy||s("detail.unknownReviewer")})}),a.jsx("span",{children:w})]})]}):null]})]})}),a.jsxs("footer",{className:"review-drawer__footer",children:[e.status==="pending"?a.jsx(Tt,{color:"secondary",variant:"outline",size:"md",pill:!1,onClick:()=>i("returned"),children:s("actions.return")}):null,e.status==="pending"||e.status==="approving"?a.jsx(Tt,{color:"primary",size:"md",pill:!1,onClick:()=>i("approved"),children:s(e.status==="approving"?"actions.resumeApproval":"actions.approve")}):a.jsx("span",{children:s(`status.${e.status}`)})]})]})]})})}function zen({cloudProvider:e,onAgentChanged:t}){const{t:n,i18n:i}=Te("reviews"),[r,s]=p.useState([]),[o,l]=p.useState(null),[c,u]=p.useState("skill"),[d,f]=p.useState(Zi(e)),[h,m]=p.useState(!0),[g,b]=p.useState(null),[v,y]=p.useState(0),[w,x]=p.useState("all"),[O,k]=p.useState(""),[S,C]=p.useState(null),[E,j]=p.useState(null),[T,R]=p.useState(""),A=(D,_,L=!1)=>{C(null),R(""),j({application:D,value:_,fromDetails:L})};p.useEffect(()=>{if(c!=="skill")return;const D=new AbortController;let _,L=!1,F=!1;m(!0),b(null);const M=async()=>{if(!(L||D.signal.aborted)){L=!0;try{const q=await Rpt({region:d,signal:D.signal});if(D.signal.aborted)return;s(q.items),C(U=>U&&q.items.find(J=>J.id===U.id)||null),F=q.items.some(U=>jFe(U.aiReview)),F&&document.visibilityState!=="hidden"&&(_=setTimeout(()=>void M(),5e3))}catch(q){D.signal.aborted||b(Mr(q,n("space.failed"))),F=!1}finally{L=!1,D.signal.aborted||m(!1)}}},z=()=>{clearTimeout(_),F&&document.visibilityState!=="hidden"&&M()};return M(),document.addEventListener("visibilitychange",z),()=>{D.abort(),clearTimeout(_),document.removeEventListener("visibilitychange",z)}},[d,c,v,n]);const N=h9t(r,c,w,O),P=!!O.trim()||w!=="all",I=[{key:"name",header:n("columns.application"),className:"review-column-name",render:D=>a.jsxs("div",{className:"review-name",children:[a.jsx("span",{className:"review-resource-icon",children:a.jsx(gIe,{})}),a.jsx("div",{children:a.jsx("button",{type:"button",title:D.name,onClick:()=>C(D),children:D.name})})]})},{key:"submitter",header:n("columns.submitter"),className:"review-column-submitter",render:D=>D.author||n("detail.unknownAuthor")},{key:"version",header:n("columns.version"),className:"review-column-version",render:D=>D.version},{key:"submitted",header:n("columns.submittedAt"),className:"review-column-time",render:D=>D.submittedAt?a.jsx("time",{dateTime:D.submittedAt,title:new Date(D.submittedAt).toLocaleString(i.language),children:new Date(D.submittedAt).toLocaleString(i.language,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1})}):"—"},{key:"status",header:n("columns.status"),className:"review-column-status",render:D=>a.jsxs("div",{className:"review-table-outcome",children:[a.jsx(IT,{status:D.status}),D.reviewer||D.reviewedBy?a.jsx(UW,{compact:!0,person:D.reviewer,fallback:D.reviewedBy}):null]})},{key:"score",header:n("score.title"),className:"review-column-score",render:D=>a.jsx(BW,{score:D.aiReview})},{key:"actions",header:n("columns.actions"),className:"review-column-actions",render:D=>a.jsxs("div",{className:"review-row-actions",children:[a.jsx("button",{type:"button",onClick:()=>C(D),"aria-label":n("actions.detailsFor",{name:D.name}),children:n("actions.details")}),D.status==="pending"||D.status==="approving"?a.jsx("button",{type:"button",onClick:()=>A(D,"approved"),children:n(D.status==="approving"?"actions.resumeApproval":"actions.approve")}):null,D.status==="pending"?a.jsx("button",{type:"button",onClick:()=>A(D,"returned"),children:n("actions.return")}):null]})}];return a.jsxs(Oh,{className:"review-center","aria-label":n("title"),children:[a.jsx(z0,{title:n("title")}),a.jsx(ab,{children:a.jsx(ob,{idPrefix:"review",ariaLabel:n("category"),value:c,items:["skill","agent"].map(D=>({id:D,label:a.jsxs(a.Fragment,{children:[n(`kind.${D}`),D==="agent"?o===null?null:a.jsx("span",{className:"review-tab-count",children:o}):a.jsx("span",{className:"review-tab-count",children:r.filter(_=>_.kind===D&&(_.status==="pending"||_.status==="approving")).length})]}),panelId:"review-requests-panel"})),onChange:D=>{u(D),x("all"),k(""),C(null)}})}),a.jsx("div",{className:"review-center__panel",id:"review-requests-panel",role:"tabpanel","aria-labelledby":`review-${c}-tab`,children:c==="agent"?a.jsx(Fen,{cloudProvider:e,onPendingCountChange:l,onChanged:t}):a.jsxs(a.Fragment,{children:[c==="skill"&&g?a.jsxs("div",{role:"alert",children:[a.jsx(Ns,{error:g}),a.jsx("button",{type:"button",onClick:()=>y(D=>D+1),children:n("space.retry")})]}):null,T?a.jsx("p",{role:"status",className:"review-notice",children:T}):null,a.jsx(yH,{rows:N,rowKey:D=>D.id,columns:I,searchValue:O,onSearchChange:k,searchPlaceholder:n("search"),searchLabel:n("search"),toolbarActions:a.jsxs(a.Fragment,{children:[c==="skill"?a.jsxs(a.Fragment,{children:[a.jsx(lb,{id:"review-region",ariaLabel:n("detail.region"),value:d,options:Tu(e),onChange:D=>{s([]),C(null),f(D)}}),a.jsx("button",{type:"button",disabled:h,onClick:()=>y(D=>D+1),children:n("actions.refresh")})]}):null,a.jsx(lb,{id:"review-status",ariaLabel:n("filterStatus"),value:w,options:["all","pending","approving","approved","returned"].map(D=>({value:D,label:n(`status.${D}`)})),onChange:x})]}),emptyLabel:c==="skill"&&h?a.jsx(cl,{}):c==="skill"&&g?null:a.jsxs("div",{className:"review-empty",children:[a.jsx("strong",{children:n(P?"empty.filteredTitle":"empty.title")}),a.jsx("span",{children:n(P?"empty.filteredDescription":"empty.description")}),P?a.jsx("button",{type:"button",onClick:()=>{k(""),x("all")},children:n("actions.clearFilters")}):null]})}),a.jsx("div",{className:"review-center__count",children:n("total",{count:N.length})})]})}),S?a.jsx(Qen,{application:S,cloudProvider:e,onClose:()=>C(null),onDecision:D=>A(S,D,!0),onScoreChanged:(D,_)=>{const L=E9t(D);s(F=>F.map(M=>M.id===S.id?{...M,aiReview:L}:M)),_&&y(F=>F+1)}},S.id):null,E?a.jsx(Ben,{application:E.application,decision:E.value,onClose:()=>{E.fromDetails&&C(E.application),j(null),y(D=>D+1)},onDecided:D=>{s(_=>_.map(L=>L.id===D.id?D:L)),E.fromDetails&&C(D),R(n(D.status==="approved"?"decision.approved":"decision.returned",{name:D.name})),j(null)}},`${E.application.id}:${E.value}`):null]})}function Ven({role:e,cloudProvider:t,onAgentChanged:n}){const{t:i}=Te("reviews");return e!=="admin"&&e!=="super_admin"?a.jsxs(Oh,{className:"review-center",children:[a.jsx(z0,{title:i("title")}),a.jsx("p",{role:"status",children:i("adminOnly")})]}):a.jsx(zen,{cloudProvider:t,onAgentChanged:n},t)}const wj=10;function Hen(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"m9.8 3.5-4.5 4.5 4.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function qen({hidden:e,...t}){return a.jsxs("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[a.jsx("path",{d:"M2.5 10s2.6-4 7.5-4 7.5 4 7.5 4-2.6 4-7.5 4-7.5-4-7.5-4Z"}),a.jsx("circle",{cx:"10",cy:"10",r:"1.8"}),e?a.jsx("path",{d:"m4 4 12 12"}):null]})}function ty(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M6.5 4H4.8A1.8 1.8 0 0 0 3 5.8v5.4A1.8 1.8 0 0 0 4.8 13h5.4a1.8 1.8 0 0 0 1.8-1.8V9.5M9 3h4v4M12.5 3.5 7.2 8.8",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function Wen(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"m4 6 4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ken(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"m3.5 8.2 2.8 2.8 6.2-6.2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Rk(e,t,n){const i=t.trim();if(!i)return n?"github.validation.required":"";if(e==="repository"&&!/^(?:https:\/\/github\.com\/)?[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+(?:\.git)?$/.test(i))return"github.validation.repository";if(e==="baseBranch"&&(!/^[A-Za-z0-9][A-Za-z0-9._/-]*$/.test(i)||i.includes("..")))return"github.validation.baseBranch";if(e==="projectPath"&&(i.startsWith("/")||i.split("/").includes("..")))return"github.validation.projectPath";if(e==="runtimeName")return rv(i,r=>`github.validation.runtimeName.${r}`)??"";if(e==="runtimeId"&&!/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/.test(i))return"github.validation.runtimeId";if(e==="modelName"&&!/^[A-Za-z0-9][A-Za-z0-9._:/-]{0,127}$/.test(i))return"github.validation.modelName";if(e==="modelBaseUrl")try{const r=new URL(i);if(r.protocol!=="https:"||r.username||r.password||r.search||r.hash)return"github.validation.modelBaseUrlSafe"}catch{return"github.validation.modelBaseUrl"}return e==="pullRequestUrl"&&!/^https:\/\/github\.com\/[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+\/pull\/[1-9][0-9]*\/?$/.test(i)?"请输入完整的 GitHub Pull Request URL":""}function Gen(e){try{return`https://github.com/${kK(e)}`}catch{return""}}function Xen(e){return e==="started"?"评审中":e==="completed"?"已完成":e==="ignored"?"已忽略":"失败"}function Yen(e){return e==="webhook"?"自动触发":"手动发起"}function Zen(e){return e.reason?e.status!=="ignored"?e.reason:e.reason==="repository-review-disabled"?"忽略原因:仓库未开启自动评审":e.reason==="pull-request-not-reviewable"?"忽略原因:该 PR 事件不需要评审,仅评审新建、更新、重新打开和转为可评审的非 Draft、非 fork PR":e.reason==="review-settings-unavailable"?"忽略原因:自动评审设置不可用":e.reason==="unsupported-event"?"忽略原因:不是 Pull Request 事件":`忽略原因:${e.reason}`:""}function Jen(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}function ole(e,t,n,i){if(n===0)return`第 ${e} 页`;const r=(e-1)*t+1,s=r+n-1;return`第 ${e} 页 · ${r}-${s}${i?"+":""}`}function etn({automation:e,cloudProvider:t,onBack:n,onOpenSandboxSession:i}){const{t:r}=Te("automations"),s=_Jt(e),o=e==="review",l=Tu(t),c=s.secrets({cloudProvider:t}),[u,d]=p.useState(()=>({...s.initialValues({cloudProvider:t})})),f=l.find(Ge=>Ge.value===u.region),[h,m]=p.useState({}),[g,b]=p.useState(""),[v,y]=p.useState(!1),[w,x]=p.useState(!1),[O,k]=p.useState(!1),[S,C]=p.useState(null),[E,j]=p.useState(""),[T,R]=p.useState(null),[A,N]=p.useState(""),[P,I]=p.useState(!1),[D,_]=p.useState(null),[L,F]=p.useState(""),[M,z]=p.useState(o),[q,U]=p.useState([]),[J,V]=p.useState(o),[Z,ne]=p.useState(""),[W,G]=p.useState(null),[H,se]=p.useState(1),[Y,X]=p.useState(!1),[ie,ee]=p.useState(""),[be,ue]=p.useState(""),[pe,ke]=p.useState(""),[je,Pe]=p.useState([]),[Ee,Qe]=p.useState(o),[_e,ae]=p.useState(""),[le,ge]=p.useState(null),[Oe,Se]=p.useState(1),[qe,Xe]=p.useState(!1),ye=p.useRef(null),we=p.useRef(null),Ae=p.useRef(null),Ve=p.useRef(null),Be=p.useRef(null),_t=Gen(u.repository),Pt=_t.replace("https://github.com/",""),Kt=_t?`${_t}/settings/secrets/actions`:"",Et=(D==null?void 0:D.appSlug)||"agentkit-veadk-studio",vt=(D==null?void 0:D.installUrl)||`https://github.com/apps/${Et}/installations/new`,tt=ile(E),mt=q.filter(Ge=>Ge.reviewEnabled),Ne=tt?q.find(Ge=>Ge.fullName.toLowerCase()===tt.toLowerCase()):void 0,wt=H>1||Y,jt=Oe>1||qe;p.useEffect(()=>()=>{var Ge,xt,yt,nn,Qt;(Ge=ye.current)==null||Ge.abort(),(xt=we.current)==null||xt.abort(),(yt=Ae.current)==null||yt.abort(),(nn=Ve.current)==null||nn.abort(),(Qt=Be.current)==null||Qt.abort()},[]),p.useEffect(()=>{var Ge,xt,yt;d({...s.initialValues({cloudProvider:t})}),m({}),b(""),C(null),k(!1),(Ge=ye.current)==null||Ge.abort(),(xt=we.current)==null||xt.abort(),(yt=Be.current)==null||yt.abort(),R(null),N(""),Pe([]),ae(""),ge(null),se(1),X(!1),ee(""),ue(""),Se(1),Xe(!1)},[e,t,s]),p.useEffect(()=>{var xt;if(!o)return;(xt=Ae.current)==null||xt.abort();const Ge=new AbortController;Ae.current=Ge,z(!0),F(""),cJt(Ge.signal).then(yt=>{Ae.current===Ge&&(_(yt),yt.configured||(V(!1),Qe(!1)))}).catch(yt=>{Ge.signal.aborted||Ae.current!==Ge||(F(yt instanceof Error?yt.message:String(yt)),V(!1),Qe(!1))}).finally(()=>{Ae.current===Ge&&(Ae.current=null,z(!1))})},[o]);const Yt=(Ge=H,xt=be)=>{var nn;(nn=Ve.current)==null||nn.abort();const yt=new AbortController;Ve.current=yt,V(!0),ne(""),uJt(yt.signal,{page:Ge,pageSize:wj,query:xt}).then(Qt=>{if(Ve.current===yt){if(Qt.repositories.length===0&&Qt.page>1){se(Qt.page-1),Yt(Qt.page-1);return}U(Qt.repositories),se(Qt.page),X(Qt.hasNextPage),G({reviewSettingsConfigured:Qt.reviewSettingsConfigured,reviewSettingsReason:Qt.reviewSettingsReason})}}).catch(Qt=>{yt.signal.aborted||Ve.current!==yt||ne(Qt instanceof Error?Qt.message:String(Qt))}).finally(()=>{Ve.current===yt&&(Ve.current=null,V(!1))})},wn=(Ge=Oe)=>{var yt;(yt=Be.current)==null||yt.abort();const xt=new AbortController;Be.current=xt,Qe(!0),ae(""),dJt(xt.signal,{page:Ge,pageSize:wj}).then(nn=>{if(Be.current===xt){if(nn.records.length===0&&nn.page>1){Se(nn.page-1),wn(nn.page-1);return}Pe(nn.records),Se(nn.page),Xe(nn.hasNextPage),ge({reviewSettingsConfigured:nn.reviewSettingsConfigured,reviewSettingsReason:nn.reviewSettingsReason})}}).catch(nn=>{xt.signal.aborted||Be.current!==xt||ae(nn instanceof Error?nn.message:String(nn))}).finally(()=>{Be.current===xt&&(Be.current=null,Qe(!1))})};p.useEffect(()=>{!o||(D==null?void 0:D.configured)!==!0||(Yt(1),wn(1))},[D==null?void 0:D.configured,o]);const We=()=>{const Ge=ie.trim();ue(Ge),se(1),Yt(1,Ge)},kt=()=>{ee(""),ue(""),se(1),Yt(1,"")},He=(Ge,xt)=>{if(!(xt<1)){if(Ge==="repositories"){se(xt),Yt(xt,be);return}Se(xt),wn(xt)}},nt=async Ge=>{if((W==null?void 0:W.reviewSettingsConfigured)!==!0||pe)return;const xt=new AbortController;ke(Ge.fullName),ne("");try{const yt=await fJt({repository:Ge.fullName,reviewEnabled:!Ge.reviewEnabled},xt.signal),nn=new Set(yt.map(Qt=>Qt.toLowerCase()));U(Qt=>Qt.map(cn=>({...cn,reviewEnabled:nn.has(cn.fullName.toLowerCase())})))}catch(yt){ne(yt instanceof Error?yt.message:String(yt))}finally{ke("")}},et=(Ge,xt)=>{d(yt=>({...yt,[Ge]:xt})),h[Ge]&&m(yt=>({...yt,[Ge]:""}))},ft=Ge=>{var Qt;const xt=!o&&Ge==="token"||Ge==="pullRequestUrl"||((Qt=s.fields.find(cn=>cn.name===Ge))==null?void 0:Qt.required)===!0,yt=Ge==="pullRequestUrl"?E:u[Ge],nn=Rk(Ge,yt,xt);m(cn=>({...cn,[Ge]:nn}))},St=async Ge=>{var nn;if(Ge.preventDefault(),o)return;const xt={};for(const Qt of s.fields){const cn=Rk(Qt.name,u[Qt.name],Qt.required);cn&&(xt[Qt.name]=cn)}if(!o){const Qt=Rk("token",u.token,!0);Qt&&(xt.token=Qt)}if(m(xt),Object.keys(xt).length)return;(nn=ye.current)==null||nn.abort();const yt=new AbortController;ye.current=yt,y(!0),b(""),C(null);try{const Qt=await s.submit(u,{cloudProvider:t},yt.signal);if(ye.current!==yt)return;C(Qt),d(cn=>({...cn,token:""}))}catch(Qt){if(yt.signal.aborted||ye.current!==yt)return;b(Qt instanceof Error?Qt.message:String(Qt))}finally{ye.current===yt&&(ye.current=null,y(!1))}},Ct=Ge=>{Ge.key==="Enter"&&(Ge.nativeEvent.isComposing||Ge.nativeEvent.keyCode===229)&&Ge.preventDefault()},It=async()=>{var nn;const Ge={},xt=Rk("pullRequestUrl",E,!0);if(xt&&(Ge.pullRequestUrl=xt),!xt){const Qt=ile(E),cn=q.find(Me=>Me.fullName.toLowerCase()===Qt.toLowerCase());cn?cn.reviewEnabled||(Ge.pullRequestUrl=`请先在下方开启 ${cn.fullName} 的评审`):Ge.pullRequestUrl="PR URL 所属仓库尚未安装 GitHub App"}if(m(Ge),Object.keys(Ge).length)return;(nn=we.current)==null||nn.abort();const yt=new AbortController;we.current=yt,I(!0),N(""),R(null);try{const Qt=await lJt({pullRequestUrl:E.trim()},yt.signal);if(we.current!==yt)return;R(Qt),d(cn=>({...cn,token:""})),wn(),i==null||i(Qt.sessionId)}catch(Qt){if(yt.signal.aborted||we.current!==yt)return;N(Qt instanceof Error?Qt.message:String(Qt))}finally{we.current===yt&&(we.current=null,I(!1))}},Gt=Ge=>{const{name:xt,placeholder:yt,required:nn}=Ge,Qt=xt==="repository",cn=`cards.${e}.fields.${xt}`;return a.jsxs("div",{className:"github-field",children:[a.jsxs("div",{className:"github-field-label-row",children:[a.jsxs("label",{htmlFor:`github-${xt}`,children:[a.jsx("span",{children:r(`${cn}.label`)}),a.jsx("span",{className:`github-field-requirement${nn?" is-required":""}`,children:r(nn?"github.required":"github.optional")})]}),Qt?a.jsxs("a",{className:"github-field-action",href:"https://github.com/",target:"_blank",rel:"noreferrer",children:["https://github.com/",a.jsx(ty,{})]}):null]}),a.jsx("input",{id:`github-${xt}`,value:u[xt],onChange:Me=>et(xt,Me.target.value),onBlur:()=>ft(xt),placeholder:r(`${cn}.placeholder`,{defaultValue:yt}),required:nn,"aria-invalid":!!h[xt],"aria-describedby":`github-${xt}-help${h[xt]?` github-${xt}-error`:""}`}),a.jsx("span",{id:`github-${xt}-help`,className:"github-field-help",children:Qt&&Pt?o?r("github.repositoryReviewHelp",{repository:Pt}):r("github.repositoryConfigHelp",{repository:Pt}):r(`${cn}.help`)}),h[xt]?a.jsx("span",{id:`github-${xt}-error`,className:"github-field-error",role:"alert",children:r(h[xt])}):null]},xt)};return a.jsxs("div",{className:"github-integration-page",children:[a.jsxs("header",{className:"github-integration-header",children:[a.jsx("button",{type:"button",className:"github-back",onClick:n,"aria-label":r("backToAutomations"),children:a.jsx(Hen,{})}),a.jsx(bK,{className:"github-integration-logo"}),a.jsxs("div",{children:[a.jsx("h1",{children:r(`cards.${e}.title`)}),a.jsx("p",{children:r(`cards.${e}.subtitle`)})]})]}),a.jsx("div",{className:"github-integration-layout",children:a.jsxs("section",{id:`github-panel-${e}`,className:"github-section-panel",children:[a.jsx("div",{className:"github-panel-heading",children:a.jsx("p",{children:r(`cards.${e}.panel`)})}),a.jsxs("form",{className:"github-release-form",onSubmit:St,onKeyDown:Ct,noValidate:!0,children:[o?null:a.jsxs("div",{className:"github-field-grid",children:[s.fields.map(Gt),a.jsxs("div",{className:"github-field",children:[a.jsxs("label",{id:"github-region-label",children:[a.jsx("span",{children:r("github.region")}),a.jsx("span",{className:"github-field-requirement is-required",children:r("github.required")})]}),a.jsxs("div",{className:"pp-network-region github-region-picker",onKeyDown:Ge=>{Ge.key==="Escape"&&k(!1)},children:[a.jsxs("button",{type:"button",className:"pp-region-trigger","aria-labelledby":"github-region-label","aria-haspopup":"listbox","aria-expanded":O,onClick:()=>k(Ge=>!Ge),children:[a.jsx("span",{children:(f==null?void 0:f.label)??u.region}),a.jsx(Wen,{className:`pp-region-chevron${O?" is-open":""}`})]}),O?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"menu-scrim",onClick:()=>k(!1)}),a.jsx("div",{className:"pp-region-menu",role:"listbox","aria-label":r("github.region"),children:l.map(Ge=>{const xt=Ge.value===u.region;return a.jsxs("button",{type:"button",role:"option","aria-selected":xt,className:`pp-region-option${xt?" is-selected":""}`,onClick:()=>{et("region",Ge.value),k(!1)},children:[a.jsx("span",{children:Ge.label}),xt?a.jsx(Ken,{}):null]},Ge.value)})})]}):null]}),a.jsx("span",{className:"github-field-help",children:r(`cards.${e}.regionHelp`)})]})]}),o?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`github-app-card${D!=null&&D.configured?" is-ready":""}`,children:[a.jsxs("div",{children:[a.jsx("strong",{children:"GitHub App 授权"}),a.jsx("span",{children:M?"正在检查中心服务配置...":D!=null&&D.configured?`安装 ${Et} 到目标仓库后,可在下方开启自动评审。`:L||(D==null?void 0:D.reason)||"管理员未配置 GitHub App。"})]}),a.jsxs("a",{className:"github-app-install-link",href:vt,target:"_blank",rel:"noreferrer",children:["安装 GitHub App",a.jsx(ty,{})]})]}),a.jsxs("section",{className:"github-review-section github-app-repositories","aria-labelledby":"github-app-repositories-title",children:[a.jsxs("div",{className:"github-review-section-header",children:[a.jsxs("div",{children:[a.jsx("h2",{id:"github-app-repositories-title",children:"已安装仓库"}),a.jsx("p",{children:"只有开启评审的仓库会响应 GitHub webhook 自动触发。"})]}),a.jsx("button",{type:"button",onClick:()=>Yt(),disabled:!(D!=null&&D.configured)||J,children:J?"刷新中...":"刷新"})]}),Z?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:Z}):null,(W==null?void 0:W.reviewSettingsConfigured)===!1&&!Z?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:W.reviewSettingsReason||"管理员未配置 Studio 持久化存储,无法保存启用评审设置。"}):null,a.jsxs("div",{className:"github-app-repository-search",children:[a.jsx("input",{type:"search",value:ie,onChange:Ge=>ee(Ge.target.value),onKeyDown:Ge=>{Ge.key==="Enter"&&(Ge.preventDefault(),We())},placeholder:"搜索 owner 或仓库名","aria-label":"搜索已安装仓库"}),a.jsx("button",{type:"button",onClick:We,disabled:!(D!=null&&D.configured)||J,children:"搜索"}),be?a.jsx("button",{type:"button",onClick:kt,disabled:J,children:"清除"}):null]}),J&&q.length===0?a.jsx("div",{className:"github-app-repository-empty",children:"正在读取 GitHub App 安装仓库..."}):null,!J&&q.length===0&&!Z?a.jsx("div",{className:"github-app-repository-empty",children:be?`没有匹配 “${be}” 的已安装仓库。`:"GitHub App 尚未安装到任何仓库。"}):null,q.length>0?a.jsx("div",{className:"github-app-repository-list",children:q.map(Ge=>{const xt=pe===Ge.fullName,yt=(W==null?void 0:W.reviewSettingsConfigured)!==!0||!!pe;return a.jsxs("div",{className:"github-app-repository-row",children:[a.jsxs("div",{className:"github-app-repository-main",children:[a.jsxs("a",{href:Ge.htmlUrl,target:"_blank",rel:"noreferrer",title:Ge.fullName,children:[Ge.fullName,a.jsx(ty,{})]}),a.jsxs("span",{children:[Ge.private?"Private":"Public"," · Installation ",Ge.installationId]})]}),a.jsx("button",{type:"button",className:`github-review-switch${Ge.reviewEnabled?" is-on":""}`,role:"switch","aria-checked":Ge.reviewEnabled,disabled:yt,onClick:()=>{nt(Ge)},children:a.jsx("span",{children:xt?"保存中":Ge.reviewEnabled?"已启用":"未启用"})})]},Ge.fullName)})}):null,wt?a.jsxs("div",{className:"github-list-pagination","aria-label":"已安装仓库分页",children:[a.jsx("span",{children:ole(H,wj,q.length,Y)}),a.jsxs("div",{children:[a.jsx("button",{type:"button",onClick:()=>He("repositories",H-1),disabled:H<=1||J,children:"上一页"}),a.jsx("button",{type:"button",onClick:()=>He("repositories",H+1),disabled:!Y||J,children:"下一页"})]})]}):null]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"github-field github-token-field",children:[a.jsxs("div",{className:"github-token-label-row",children:[a.jsxs("label",{htmlFor:"github-token",children:[a.jsx("span",{children:r("github.tokenLabel")}),a.jsx("span",{className:"github-field-requirement is-required",children:r("github.required")})]}),a.jsxs("a",{className:"github-field-action",href:"https://github.com/settings/personal-access-tokens/new?name=VeADK%20Studio&description=Create%20a%20GitHub%20automation%20pull%20request&contents=write&pull_requests=write&workflows=write",target:"_blank",rel:"noreferrer",children:[r("github.createToken"),a.jsx(ty,{})]})]}),a.jsxs("div",{className:"github-token-input",children:[a.jsx("input",{id:"github-token",type:w?"text":"password",value:u.token,onChange:Ge=>et("token",Ge.target.value),onBlur:()=>ft("token"),autoComplete:"off",required:!0,placeholder:r("github.tokenWorkflowPlaceholder"),"aria-invalid":!!h.token,"aria-describedby":`github-token-help${h.token?" github-token-error":""}`}),a.jsx("button",{type:"button",onClick:()=>x(Ge=>!Ge),"aria-label":r(w?"github.hideToken":"github.showToken"),title:r(w?"github.hideToken":"github.showToken"),children:a.jsx(qen,{hidden:w})})]}),a.jsx("span",{id:"github-token-help",className:"github-field-help",children:r("github.tokenWorkflowHelp")}),h.token?a.jsx("span",{id:"github-token-error",className:"github-field-error",role:"alert",children:r(h.token)}):null]}),g?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:g}):null,S?a.jsxs("div",{className:"github-submit-message is-success github-result-message",role:"status",children:[a.jsxs("div",{children:[a.jsx("strong",{children:r("github.configPrCreated",{number:S.number})}),a.jsx("span",{children:r("github.configPrNextStep")})]}),a.jsxs("a",{className:"github-result-link",href:S.url,target:"_blank",rel:"noreferrer",children:[r("github.viewConfigPr"),a.jsx(ty,{})]})]}):null,a.jsxs("div",{className:"github-form-actions",children:[a.jsxs("div",{className:"github-secrets-note",children:[a.jsxs("div",{className:"github-secrets-header",children:[a.jsx("strong",{children:r("github.secretsConfigHeading")}),Kt?a.jsxs("a",{className:"github-secrets-link",href:Kt,target:"_blank",rel:"noreferrer",children:[r("github.openSecrets"),a.jsx(ty,{})]}):null]}),a.jsx("span",{className:"github-secrets-path",children:r("github.secretsPath")}),a.jsx("ul",{children:c.map(Ge=>{const[xt,...yt]=Ge.split(":");return a.jsxs("li",{children:[a.jsx("code",{children:xt}),yt.length?a.jsx("span",{children:yt.join(":")}):null]},Ge)})})]}),a.jsx("button",{type:"submit",disabled:v,children:r(v?"github.submitting":`cards.${e}.submitLabel`)})]})]})]}),o?a.jsxs("div",{className:"github-pr-review-sections",children:[a.jsxs("section",{className:"github-review-section github-review-now","aria-labelledby":"github-review-now-title",children:[a.jsx("div",{className:"github-review-section-header",children:a.jsxs("div",{children:[a.jsx("h2",{id:"github-review-now-title",children:"立刻评审"}),a.jsx("p",{children:"输入已安装且已启用仓库的 PR URL,立即创建 Sandbox 评审任务。"})]})}),a.jsxs("div",{className:"github-review-section-body",children:[a.jsxs("div",{className:"github-field",children:[a.jsx("input",{id:"github-pull-request-url","aria-label":"Pull Request URL",value:E,onChange:Ge=>{j(Ge.target.value),h.pullRequestUrl&&m(xt=>({...xt,pullRequestUrl:""}))},onBlur:()=>m(Ge=>({...Ge,pullRequestUrl:Rk("pullRequestUrl",E,!0)})),placeholder:"https://github.com/owner/repository/pull/123","aria-invalid":!!h.pullRequestUrl,"aria-describedby":h.pullRequestUrl?"github-pull-request-url-error":void 0}),h.pullRequestUrl?a.jsx("span",{id:"github-pull-request-url-error",className:"github-field-error",role:"alert",children:h.pullRequestUrl}):null,!h.pullRequestUrl&&tt?a.jsx("span",{className:"github-field-help",children:Ne!=null&&Ne.reviewEnabled?`将使用 GitHub App 评审 ${Ne.fullName}`:Ne?`请先在下方开启 ${Ne.fullName} 的评审`:`PR URL 所属仓库 ${tt} 尚未安装 GitHub App`}):null,!h.pullRequestUrl&&!tt&&mt.length>0?a.jsxs("span",{className:"github-field-help",children:["已启用仓库:",mt.map(Ge=>Ge.fullName).join("、")]}):null]}),A?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:A}):null,T?a.jsx("div",{className:"github-submit-message is-success",role:"status",children:a.jsxs("span",{children:["已发起评审,Session ",T.sessionId," 正在运行。"]})}):null,a.jsx("div",{className:"github-review-section-actions",children:a.jsx("button",{type:"button",onClick:It,disabled:P,children:P?"发起评审中…":"立即发起评审"})})]})]}),a.jsxs("section",{className:"github-review-section github-review-records","aria-labelledby":"github-review-records-title",children:[a.jsxs("div",{className:"github-review-section-header",children:[a.jsxs("div",{children:[a.jsx("h2",{id:"github-review-records-title",children:"评审记录"}),a.jsx("p",{children:"展示最近自动触发和手动发起的评审任务。"})]}),a.jsx("button",{type:"button",onClick:()=>wn(),disabled:!(D!=null&&D.configured)||Ee,children:Ee?"刷新中...":"刷新"})]}),_e?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:_e}):null,(le==null?void 0:le.reviewSettingsConfigured)===!1&&!_e?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:le.reviewSettingsReason||"管理员未配置 Studio 持久化存储,无法读取评审记录。"}):null,Ee&&je.length===0?a.jsx("div",{className:"github-app-repository-empty",children:"正在读取 PR 评审记录..."}):null,!Ee&&je.length===0&&!_e?a.jsx("div",{className:"github-app-repository-empty",children:"暂无 PR 评审记录。"}):null,je.length>0?a.jsx("div",{className:"github-review-record-list",children:je.map(Ge=>{const xt=Zen(Ge),yt=Ge.status==="completed"?"":Ge.sessionId;return a.jsxs("div",{className:"github-review-record-row",children:[a.jsxs("div",{className:"github-review-record-main",children:[a.jsxs("div",{className:"github-review-record-title",children:[a.jsxs("a",{href:Ge.pullRequestUrl,target:"_blank",rel:"noreferrer",children:[Ge.repository,"#",Ge.pullRequestNumber,a.jsx(ty,{})]}),a.jsx("span",{className:`github-review-record-status is-${Ge.status}`,children:Xen(Ge.status)})]}),a.jsxs("span",{children:[Yen(Ge.trigger),Ge.action?` · ${Ge.action}`:""," · ",Jen(Ge.createdAt),xt?` · ${xt}`:""]})]}),a.jsx("div",{className:"github-review-record-actions",children:yt&&i?a.jsx("button",{type:"button",onClick:()=>i(yt),children:"打开 Session"}):null})]},Ge.id)})}):null,jt?a.jsxs("div",{className:"github-list-pagination","aria-label":"评审记录分页",children:[a.jsx("span",{children:ole(Oe,wj,je.length,qe)}),a.jsxs("div",{children:[a.jsx("button",{type:"button",onClick:()=>He("records",Oe-1),disabled:Oe<=1||Ee,children:"上一页"}),a.jsx("button",{type:"button",onClick:()=>He("records",Oe+1),disabled:!qe||Ee,children:"下一页"})]})]}):null]})]}):null]})})]})}async function sv(e){var i;const t=await e.json().catch(()=>null),n=(i=t==null?void 0:t.detail)==null?void 0:i.message;return new Error(n||`GitLab MR 评审请求失败(HTTP ${e.status})。`)}function lle(e,t){const n=e.trim().replace(/\/+$/,"");if(!n)return"";const i=`${n}/`,r=t.trim();if(!r.startsWith(i))return"";const s=r.slice(i.length).replace(/\/+$/,""),o="/-/merge_requests/",l=s.indexOf(o);if(l<=0)return"";const c=s.slice(l+o.length);return/^[1-9][0-9]*$/.test(c)?s.slice(0,l):""}async function cle(e){const t=await vn("/web/gitlab/app/config",{method:"GET",headers:{Accept:"application/json"},signal:e});if(!t.ok)throw await sv(t);const n=await t.json();if(typeof n.configured!="boolean"||typeof n.baseUrl!="string"||typeof n.webhookUrl!="string"||typeof n.reason!="string"||typeof n.oauthConfigured!="boolean"||typeof n.oauthConnected!="boolean"||n.oauthUser!==null&&n.oauthUser!==void 0&&(typeof n.oauthUser!="object"||typeof n.oauthUser.credentialId!="string"||typeof n.oauthUser.ownerId!="string"||typeof n.oauthUser.baseUrl!="string"||typeof n.oauthUser.gitlabUserId!="number"||typeof n.oauthUser.gitlabUsername!="string"||typeof n.oauthUser.gitlabName!="string"||typeof n.oauthUser.expiresAt!="number"))throw new Error("GitLab 集成配置响应格式无效。");return n}async function ttn(e,t){var s;const n=new URLSearchParams({page:String(t.page),pageSize:String(t.pageSize)});(s=t.query)!=null&&s.trim()&&n.set("q",t.query.trim());const i=await vn(`/web/gitlab/app/projects?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await sv(i);const r=await i.json();if(!Array.isArray(r.projects)||typeof r.page!="number"||typeof r.pageSize!="number"||typeof r.hasNextPage!="boolean"||typeof r.reviewSettingsConfigured!="boolean"||typeof r.reviewSettingsReason!="string"||r.projects.some(o=>typeof o!="object"||o===null||typeof o.instanceId!="string"||typeof o.baseUrl!="string"||typeof o.projectId!="number"||typeof o.pathWithNamespace!="string"||typeof o.name!="string"||typeof o.namespace!="string"||typeof o.webUrl!="string"||typeof o.private!="boolean"||typeof o.reviewEnabled!="boolean"||typeof o.permissionsNote!="string"||typeof o.accessLevel!="number"||typeof o.canManageWebhooks!="boolean"||typeof o.reviewBindingStatus!="string"||typeof o.reviewBindingReason!="string"||typeof o.reviewCredentialOwner!="string"||typeof o.reviewCredentialType!="string"))throw new Error("GitLab 集成项目列表响应格式无效。");return r}async function ntn(e,t){const n=await vn("/web/gitlab/app/review-projects",{method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e),signal:t});if(!n.ok)throw await sv(n);const i=await n.json();if(!Array.isArray(i.projects)||i.projects.some(r=>typeof r!="object"||r===null||typeof r.projectId!="number"))throw new Error("GitLab 集成评审项目保存响应格式无效。");return i.projects}async function itn(e){const t=await vn("/web/gitlab/oauth/disconnect",{method:"POST",headers:{Accept:"application/json"},signal:e});if(!t.ok)throw await sv(t)}async function rtn(e){const t=await vn("/web/gitlab/oauth/start-url",{method:"GET",headers:{Accept:"application/json"},signal:e});if(!t.ok)throw await sv(t);const n=await t.json();if(typeof n.authorizationUrl!="string"||!n.authorizationUrl)throw new Error("GitLab OAuth 授权地址响应格式无效。");return n.authorizationUrl}async function stn(e,t){const n=new URLSearchParams({page:String(t.page),pageSize:String(t.pageSize)}),i=await vn(`/web/gitlab/app/review-records?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await sv(i);const r=await i.json();if(!Array.isArray(r.records)||typeof r.page!="number"||typeof r.pageSize!="number"||typeof r.hasNextPage!="boolean"||typeof r.reviewSettingsConfigured!="boolean"||typeof r.reviewSettingsReason!="string"||r.records.some(s=>typeof s!="object"||s===null||typeof s.id!="string"||typeof s.projectId!="number"||typeof s.pathWithNamespace!="string"||typeof s.mergeRequestUrl!="string"||typeof s.mergeRequestIid!="number"||!["started","completed","ignored","failed"].includes(String(s.status))||!["manual","webhook"].includes(String(s.trigger))||typeof s.createdAt!="string"||typeof s.deliveryId!="string"||typeof s.action!="string"||typeof s.sessionId!="string"||typeof s.displayName!="string"||typeof s.reason!="string"))throw new Error("GitLab MR 评审记录响应格式无效。");return r}async function atn(e,t){const n=await vn("/web/gitlab/merge-request-reviews",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e),signal:t});if(!n.ok)throw await sv(n);const i=await n.json();if(i.status!=="started"||typeof i.sessionId!="string"||!i.sessionId||typeof i.displayName!="string")throw new Error("GitLab MR 评审服务返回了无效结果。");return i}const Oj=10;function kj(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[a.jsx("path",{d:"M6.5 4H4a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h7a1 1 0 0 0 1-1V9.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),a.jsx("path",{d:"M9 3h4v4M8.5 7.5 13 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function otn(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"m9.8 3.5-4.5 4.5 4.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function ltn(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...e,children:a.jsx("path",{d:"m22.54 9.64-.03-.08-2.2-6.81a.76.76 0 0 0-1.43-.08l-2.1 4.31H7.22l-2.1-4.31a.76.76 0 0 0-1.43.08l-2.2 6.81-.03.08a5.15 5.15 0 0 0 1.7 5.79l.01.01.02.01 8.81 6.58 8.81-6.58.02-.01.01-.01a5.15 5.15 0 0 0 1.7-5.79ZM12 20.08 8.65 8.59h6.7L12 20.08Z"})})}function ctn(e){return e==="started"?"进行中":e==="completed"?"已完成":e==="ignored"?"已忽略":"失败"}function utn(e){return e==="webhook"?"自动触发":"手动发起"}function dtn(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function ftn(e){return e.reason==="project-review-disabled"?"项目未启用":e.reason==="merge-request-not-reviewable"?"MR 不满足评审条件":e.reason}function ule(e,t,n,i){const r=(e-1)*t+1,s=(e-1)*t+n;return i?`${r}-${s}`:`${r}-${s} / ${s}`}function htn({onBack:e,onOpenSandboxSession:t}){const[n,i]=p.useState(null),[r,s]=p.useState(""),[o,l]=p.useState(!0),[c,u]=p.useState([]),[d,f]=p.useState(!0),[h,m]=p.useState(""),[g,b]=p.useState(null),[v,y]=p.useState(1),[w,x]=p.useState(!1),[O,k]=p.useState(""),[S,C]=p.useState(""),[E,j]=p.useState(null),[T,R]=p.useState(""),[A,N]=p.useState(!1),[P,I]=p.useState(""),[D,_]=p.useState(null),[L,F]=p.useState([]),[M,z]=p.useState(!0),[q,U]=p.useState(""),[J,V]=p.useState(1),[Z,ne]=p.useState(!1),[W,G]=p.useState(null),[H,se]=p.useState(!1),[Y,X]=p.useState(!1),ie=p.useRef(null),ee=p.useRef(null),be=p.useRef(null),ue=n?lle(n.baseUrl,T):"",pe=ue?c.find(Se=>Se.pathWithNamespace.toLowerCase()===ue.toLowerCase()):void 0,ke=v>1||w,je=J>1||Z,Pe=(n==null?void 0:n.configured)===!0&&n.oauthConnected,Ee=(Se=v,qe=S)=>{var ye;(ye=ee.current)==null||ye.abort();const Xe=new AbortController;ee.current=Xe,f(!0),m(""),ttn(Xe.signal,{page:Se,pageSize:Oj,query:qe}).then(we=>{if(ee.current===Xe){if(we.projects.length===0&&we.page>1){y(we.page-1),Ee(we.page-1,qe);return}u(we.projects),y(we.page),x(we.hasNextPage),b({reviewSettingsConfigured:we.reviewSettingsConfigured,reviewSettingsReason:we.reviewSettingsReason})}}).catch(we=>{Xe.signal.aborted||ee.current!==Xe||m(we instanceof Error?we.message:String(we))}).finally(()=>{ee.current===Xe&&(ee.current=null,f(!1))})},Qe=(Se=J)=>{var Xe;(Xe=be.current)==null||Xe.abort();const qe=new AbortController;be.current=qe,z(!0),U(""),stn(qe.signal,{page:Se,pageSize:Oj}).then(ye=>{if(be.current===qe){if(ye.records.length===0&&ye.page>1){V(ye.page-1),Qe(ye.page-1);return}F(ye.records),V(ye.page),ne(ye.hasNextPage),G({reviewSettingsConfigured:ye.reviewSettingsConfigured,reviewSettingsReason:ye.reviewSettingsReason})}}).catch(ye=>{qe.signal.aborted||be.current!==qe||U(ye instanceof Error?ye.message:String(ye))}).finally(()=>{be.current===qe&&(be.current=null,z(!1))})};p.useEffect(()=>{var qe;(qe=ie.current)==null||qe.abort();const Se=new AbortController;return ie.current=Se,l(!0),s(""),cle(Se.signal).then(Xe=>{ie.current===Se&&(i(Xe),(!Xe.configured||Xe.oauthConfigured&&!Xe.oauthConnected)&&(f(!1),z(!1)))}).catch(Xe=>{Se.signal.aborted||ie.current!==Se||(s(Xe instanceof Error?Xe.message:String(Xe)),f(!1),z(!1))}).finally(()=>{ie.current===Se&&(ie.current=null,l(!1))}),()=>{var Xe,ye;Se.abort(),(Xe=ee.current)==null||Xe.abort(),(ye=be.current)==null||ye.abort()}},[]),p.useEffect(()=>{Pe&&(Ee(1,""),Qe(1))},[Pe]);const _e=()=>{const Se=O.trim();C(Se),y(1),Ee(1,Se)},ae=async Se=>{if((g==null?void 0:g.reviewSettingsConfigured)!==!0||E!==null)return;if(!Se.reviewEnabled&&!Pe){m("请先连接 GitLab 后再启用自动评审。");return}const qe=new AbortController;j(Se.projectId),m("");try{await ntn({projectId:Se.projectId,reviewEnabled:!Se.reviewEnabled},qe.signal),u(Xe=>Xe.map(ye=>ye.projectId===Se.projectId?{...ye,reviewEnabled:!Se.reviewEnabled}:ye))}catch(Xe){m(Xe instanceof Error?Xe.message:String(Xe))}finally{j(null)}},le=async()=>{const Se=new AbortController;X(!0),s("");try{await itn(Se.signal);const qe=await cle(Se.signal);i(qe),u([]),b(null)}catch(qe){s(qe instanceof Error?qe.message:String(qe))}finally{X(!1)}},ge=async()=>{const Se=new AbortController;se(!0),s("");try{window.location.href=await rtn(Se.signal)}catch(qe){s(qe instanceof Error?qe.message:String(qe)),se(!1)}},Oe=async()=>{const Se=T.trim();if(!Se){I("请输入 GitLab Merge Request URL。");return}if(!(n!=null&&n.configured)){I("管理员未配置 GitLab OAuth。");return}if(!Pe){I("请先连接 GitLab 后再发起评审。");return}if(!lle(n.baseUrl,Se)){I("请输入当前 GitLab 实例下的完整 Merge Request URL。");return}N(!0),I(""),_(null);const qe=new AbortController;try{const Xe=await atn({mergeRequestUrl:Se},qe.signal);_(Xe),Qe(1)}catch(Xe){I(Xe instanceof Error?Xe.message:String(Xe))}finally{N(!1)}};return a.jsxs("div",{className:"github-integration-page",children:[a.jsxs("header",{className:"github-integration-header",children:[a.jsx("button",{type:"button",className:"github-back",onClick:e,"aria-label":"返回自动化",children:a.jsx(otn,{})}),a.jsx(ltn,{className:"github-integration-logo"}),a.jsxs("div",{children:[a.jsx("h1",{children:"GitLab MR Review"}),a.jsx("p",{children:"通过 GitLab webhook 触发 Sandbox 评审,并将结果写回 Merge Request。"})]})]}),a.jsx("div",{className:"github-integration-layout",children:a.jsxs("section",{className:"github-section-panel",children:[a.jsx("div",{className:"github-panel-heading",children:a.jsx("p",{children:"请先为目标项目开启自动评审,再通过 webhook 或手动 URL 发起 MR 评审。"})}),a.jsxs("div",{className:"github-release-form",children:[a.jsxs("div",{className:`github-app-card${n!=null&&n.configured?" is-ready":""}`,children:[a.jsxs("div",{children:[a.jsx("strong",{children:"GitLab 集成配置"}),a.jsx("span",{children:o?"正在检查中心服务配置...":n!=null&&n.configured?n.oauthConnected&&n.oauthUser?`已连接 ${n.oauthUser.gitlabName||n.oauthUser.gitlabUsername} · ${n.baseUrl}`:`当前实例:${n.baseUrl}`:r||(n==null?void 0:n.reason)||"管理员未配置 GitLab OAuth。"})]}),n!=null&&n.oauthConfigured&&!n.oauthConnected?a.jsxs("button",{type:"button",className:"github-app-install-link",onClick:()=>{ge()},disabled:H,children:[H?"连接中...":"连接 GitLab",a.jsx(kj,{})]}):n!=null&&n.oauthConnected?a.jsx("button",{type:"button",className:"github-app-install-link",onClick:()=>{le()},disabled:Y,children:Y?"断开中...":"断开授权"}):n!=null&&n.webhookUrl?a.jsxs("a",{className:"github-app-install-link",href:n.webhookUrl,target:"_blank",rel:"noreferrer",children:["Webhook",a.jsx(kj,{})]}):null]}),a.jsxs("section",{className:"github-review-section github-app-repositories","aria-labelledby":"gitlab-projects-title",children:[a.jsxs("div",{className:"github-review-section-header",children:[a.jsxs("div",{children:[a.jsx("h2",{id:"gitlab-projects-title",children:"可访问项目"}),a.jsx("p",{children:"只有开启评审的项目会响应 GitLab webhook 自动触发。"})]}),a.jsx("button",{type:"button",onClick:()=>Ee(),disabled:!Pe||d,children:d?"刷新中...":"刷新"})]}),h?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:h}):null,(g==null?void 0:g.reviewSettingsConfigured)===!1&&!h?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:g.reviewSettingsReason||"管理员未配置 Studio 持久化存储,无法保存启用评审设置。"}):null,a.jsxs("div",{className:"github-app-repository-search",children:[a.jsx("input",{type:"search",value:O,onChange:Se=>k(Se.target.value),onKeyDown:Se=>{Se.key==="Enter"&&(Se.preventDefault(),_e())},placeholder:"搜索 group 或项目名","aria-label":"搜索 GitLab 项目"}),a.jsx("button",{type:"button",onClick:_e,disabled:!Pe||d,children:"搜索"}),S?a.jsx("button",{type:"button",onClick:()=>{k(""),C(""),y(1),Ee(1,"")},disabled:d||!Pe,children:"清除"}):null]}),!Pe&&!o?a.jsx("div",{className:"github-app-repository-empty",children:"请先连接 GitLab。"}):null,d&&c.length===0&&Pe?a.jsx("div",{className:"github-app-repository-empty",children:"正在读取 GitLab 项目..."}):null,!d&&c.length===0&&!h&&Pe?a.jsx("div",{className:"github-app-repository-empty",children:S?`没有匹配 “${S}” 的 GitLab 项目。`:"GitLab 集成暂无可访问项目。"}):null,c.length>0?a.jsx("div",{className:"github-app-repository-list",children:c.map(Se=>{const qe=E===Se.projectId,Xe=(g==null?void 0:g.reviewSettingsConfigured)!==!0||E!==null||!Se.reviewEnabled&&!Pe;return a.jsxs("div",{className:"github-app-repository-row",children:[a.jsxs("div",{className:"github-app-repository-main",children:[a.jsxs("a",{href:Se.webUrl,target:"_blank",rel:"noreferrer",title:Se.pathWithNamespace,children:[Se.pathWithNamespace,a.jsx(kj,{})]}),a.jsxs("span",{children:[Se.private?"Private":"Public"," · Project ",Se.projectId,Se.permissionsNote?` · ${Se.permissionsNote}`:"",Se.reviewBindingStatus&&Se.reviewBindingStatus!=="active"&&Se.reviewBindingStatus!=="disabled"?` · ${Se.reviewBindingReason||"授权失效"}`:""]})]}),a.jsx("button",{type:"button",className:`github-review-switch${Se.reviewEnabled?" is-on":""}`,role:"switch","aria-checked":Se.reviewEnabled,disabled:Xe,onClick:()=>{ae(Se)},children:a.jsx("span",{children:qe?"保存中":Se.reviewEnabled?"已启用":"未启用"})})]},`${Se.instanceId}:${Se.projectId}`)})}):null,ke?a.jsxs("div",{className:"github-list-pagination","aria-label":"GitLab 项目分页",children:[a.jsx("span",{children:ule(v,Oj,c.length,w)}),a.jsxs("div",{children:[a.jsx("button",{type:"button",onClick:()=>{y(v-1),Ee(v-1,S)},disabled:v<=1||d,children:"上一页"}),a.jsx("button",{type:"button",onClick:()=>{y(v+1),Ee(v+1,S)},disabled:!w||d,children:"下一页"})]})]}):null]})]}),a.jsxs("div",{className:"github-pr-review-sections",children:[a.jsxs("section",{className:"github-review-section github-review-now","aria-labelledby":"gitlab-review-now-title",children:[a.jsx("div",{className:"github-review-section-header",children:a.jsxs("div",{children:[a.jsx("h2",{id:"gitlab-review-now-title",children:"立刻评审"}),a.jsx("p",{children:"输入当前 GitLab 实例下的 MR URL,立即创建 Sandbox 评审任务。"})]})}),a.jsxs("div",{className:"github-review-section-body",children:[a.jsxs("div",{className:"github-field",children:[a.jsx("input",{"aria-label":"Merge Request URL",value:T,onChange:Se=>R(Se.target.value),placeholder:`${(n==null?void 0:n.baseUrl)||"https://gitlab.example.com"}/group/project/-/merge_requests/123`}),ue?a.jsx("span",{className:"github-field-help",children:pe?`将使用 GitLab 授权评审 ${pe.pathWithNamespace}`:`MR URL 所属项目 ${ue} 不在当前项目列表中`}):null]}),P?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:P}):null,D?a.jsx("div",{className:"github-submit-message is-success",role:"status",children:a.jsxs("span",{children:["已发起评审,Session ",D.sessionId," 正在运行。"]})}):null,a.jsx("div",{className:"github-review-section-actions",children:a.jsx("button",{type:"button",onClick:Oe,disabled:A||!Pe,children:A?"发起评审中...":"立即发起评审"})})]})]}),a.jsxs("section",{className:"github-review-section github-review-records","aria-labelledby":"gitlab-review-records-title",children:[a.jsxs("div",{className:"github-review-section-header",children:[a.jsxs("div",{children:[a.jsx("h2",{id:"gitlab-review-records-title",children:"评审记录"}),a.jsx("p",{children:"展示最近自动触发和手动发起的评审任务。"})]}),a.jsx("button",{type:"button",onClick:()=>Qe(),disabled:!Pe||M,children:M?"刷新中...":"刷新"})]}),q?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:q}):null,(W==null?void 0:W.reviewSettingsConfigured)===!1&&!q?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:W.reviewSettingsReason||"管理员未配置 Studio 持久化存储,无法读取评审记录。"}):null,M&&L.length===0?a.jsx("div",{className:"github-app-repository-empty",children:"正在读取 MR 评审记录..."}):null,!M&&L.length===0&&!q?a.jsx("div",{className:"github-app-repository-empty",children:"暂无 MR 评审记录。"}):null,L.length>0?a.jsx("div",{className:"github-review-record-list",children:L.map(Se=>{const qe=ftn(Se),Xe=Se.status==="completed"?"":Se.sessionId;return a.jsxs("div",{className:"github-review-record-row",children:[a.jsxs("div",{className:"github-review-record-main",children:[a.jsxs("div",{className:"github-review-record-title",children:[a.jsxs("a",{href:Se.mergeRequestUrl,target:"_blank",rel:"noreferrer",children:[Se.pathWithNamespace,"!",Se.mergeRequestIid,a.jsx(kj,{})]}),a.jsx("span",{className:`github-review-record-status is-${Se.status}`,children:ctn(Se.status)})]}),a.jsxs("span",{children:[utn(Se.trigger),Se.action?` · ${Se.action}`:""," · ",dtn(Se.createdAt),qe?` · ${qe}`:""]})]}),a.jsx("div",{className:"github-review-record-actions",children:Xe&&t?a.jsx("button",{type:"button",onClick:()=>t(Xe),children:"打开 Session"}):null})]},Se.id)})}):null,je?a.jsxs("div",{className:"github-list-pagination","aria-label":"GitLab 评审记录分页",children:[a.jsx("span",{children:ule(J,Oj,L.length,Z)}),a.jsxs("div",{children:[a.jsx("button",{type:"button",onClick:()=>{V(J-1),Qe(J-1)},disabled:J<=1||M,children:"上一页"}),a.jsx("button",{type:"button",onClick:()=>{V(J+1),Qe(J+1)},disabled:!Z||M,children:"下一页"})]})]}):null]})]})]})})]})}const ptn=1050062,dle="1.0",mtn="https://lf-static.applogcdn.com/obj/applog-sdk-static/log-sdk/collect/5/collect.js";class gtn{constructor(){Zt(this,"enabled",!1);Zt(this,"initialized",!1);Zt(this,"pending",[]);Zt(this,"userUniqueId","");Zt(this,"initPromise")}init(t){return this.enabled=t.enabled,this.enabled?this.initPromise?this.initPromise:(this.initPromise=Promise.resolve().then(()=>{const n=this.bootstrapCollector();n("init",{app_id:ptn,channel:"cn",disable_auto_pv:1}),this.userUniqueId&&n("config",{user_unique_id:this.userUniqueId}),n("config",{_staging_flag:t.environment==="prod"?0:1}),n("start"),this.initialized=!0;const i=this.pending;this.pending=[];for(const[r,s]of i)this.collect(r,s)}),this.initPromise):(this.pending=[],Promise.resolve())}identify(t){this.userUniqueId=t,this.initialized&&this.collect("config",{user_unique_id:t})}emit(t,n){if(this.enabled){if(this.initialized){this.collect(t,n);return}this.pending=[...this.pending.slice(-49),[t,n]]}}bootstrapCollector(){if(window.collectEvent)return window.collectEvent;window.LogAnalyticsObject="collectEvent";const t=function(){var r;(r=t.q)==null||r.push(arguments)};t.q=[],t.l=Date.now(),window.collectEvent=t;const n=document.createElement("script");return n.async=!0,n.src=mtn,n.onerror=()=>{this.enabled=!1,t.q=[],console.warn("[telemetry] TEA SDK script failed to load")},document.head.appendChild(n),t}collect(t,n){var i;(i=window.collectEvent)==null||i.call(window,t,n)}}const btn=256,z9e=1024,x6="[REDACTED]";function ytn(e){if(typeof e!="string"&&typeof e!="number")return;const t=String(e).trim();return/^[A-Za-z0-9_.:-]{1,64}$/.test(t)?t:void 0}function tp(e,t){return t===void 0?{errorKind:e}:{errorKind:e,errorCode:t}}function V9e(e,t,n={}){if(e.length<=t)return e;if(n.preserveEnd){const r="[truncated] ...";return`${r}${e.slice(-Math.max(0,t-r.length))}`}const i="... [truncated]";return`${e.slice(0,Math.max(0,t-i.length))}${i}`}function vtn(e){return e.replace(/\b(Authorization\s*[:=]\s*)(Bearer\s+)?[^\s"',;&]+/gi,(t,n,i)=>`${n}${i??""}${x6}`).replace(/\bBearer\s+[A-Za-z0-9._~+/=-]+/gi,`Bearer ${x6}`).replace(/\b([\w.-]*(?:token|password|passwd|secret|api[_-]?key|access[_-]?key|secret[_-]?key|cookie)[\w.-]*\s*[:=]\s*)(["']?)[^\s"',;&]+/gi,(t,n,i)=>`${n}${i}${x6}`)}function My(e,t={}){const n=e!==null&&typeof e=="object"?e:{},r=(typeof n.message=="string"?n.message:typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):"").replace(/\s+/g," ").trim();if(r)return V9e(vtn(r),z9e,t)}function Xo(e,t={}){const n=e!==null&&typeof e=="object"?e:{},i=ytn(n.code),r=typeof n.name=="string"?n.name:"";if(r==="RuntimeProbeError")return tp("runtime_probe_error",i);if(r==="AbortError")return tp("abort",i);if(r==="RuntimeAccessDeniedError"||r==="AuthError")return tp("auth",i);if(t.phase==="build")return tp("build_failed",i);if(r==="TimeoutError")return tp("timeout",i);if(r==="NetworkError"||r==="TypeError")return tp("network",i);if(r==="ValidationError")return tp("validation",i);if(r==="ServerError")return tp("server",i);const s=typeof n.status=="number"&&Number.isInteger(n.status)?n.status:void 0;if(s===void 0||s<400||s>599)return tp("unknown",i);const o=String(s);return s===401||s===403?{errorKind:"auth",errorCode:o}:s===400||s===409||s===422?{errorKind:"validation",errorCode:o}:s>=500?{errorKind:"server",errorCode:o}:{errorKind:"unknown",errorCode:o}}const xtn=["schema_version","event_id","operation_id","user_pool_id","studio_deploy_id","vefaas_application_id","vefaas_function_id","studio_region","studio_project","studio_version","environment","cloud_provider","account_id","account_id_resolution_error","user_role","user_source","page_instance_id"],wtn={studio_entry_viewed:["auth_state"],studio_session_started:["agents_source"],studio_agent_deploy:["status","agent_id","deploy_action","deploy_source","create_mode","ai_assisted","deploy_region","runtime_network_type","feishu_enabled","runtime_id","duration_ms","failed_phase","error_kind","error_code","error_message"],studio_sandbox_create:["status","sandbox_kind","sandbox_source","sandbox_id","duration_ms","error_kind","error_code"],studio_agent_debug:["status","agent_id","variant_type","debug_run_id","duration_ms","failed_phase","error_kind","error_code"],studio_agent_connect:["status","target_id","agent_kind","connect_source","runtime_region","runtime_is_mine","sandbox_status","duration_ms","error_kind","error_code"],studio_agent_message:["status","agent_id","agent_kind","message_source","session_state","session_id","duration_ms","failed_phase","error_kind","error_code"],studio_agent_source_download:["status","agent_id","deploy_action","deploy_source","create_mode","ai_assisted","duration_ms","file_count","zip_size_bytes","error_kind","error_code"]};function Otn(e){return typeof e=="string"||typeof e=="number"&&Number.isFinite(e)}function fle(e,t){const n=new Set([...xtn,...wtn[e]]),i={};for(const[r,s]of Object.entries(t))!n.has(r)||!Otn(s)||(typeof s=="string"?i[r]=V9e(s,r==="error_message"?z9e:btn):i[r]=s);return i}function ktn(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`}function Stn(){return typeof performance<"u"?performance.now():Date.now()}function qv(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}class Etn{constructor(t){Zt(this,"sink");Zt(this,"createId");Zt(this,"now");Zt(this,"pageInstanceId");Zt(this,"context");Zt(this,"identity");Zt(this,"entryViewed",!1);Zt(this,"sessionStarted",!1);this.sink=t.sink,this.createId=t.createId??ktn,this.now=t.now??Stn,this.pageInstanceId=this.createId()}setContext(t){var n,i;this.context={...t,accountId:((n=t.accountId)==null?void 0:n.trim())??"",accountIdResolutionError:((i=t.accountIdResolutionError)==null?void 0:i.trim())??""}}identify(t){var i,r,s;const n=t.userUniqueId.trim();n&&(this.identity&&this.identity.userUniqueId!==n&&(this.pageInstanceId=this.createId(),this.sessionStarted=!1),this.identity={...t,userUniqueId:n,accountId:((i=t.accountId)==null?void 0:i.trim())??""},(s=(r=this.sink).identify)==null||s.call(r,n))}trackStudioSessionStarted(t){this.sessionStarted||!this.context||!this.identity||(this.sessionStarted=!0,this.emit("studio_session_started",{agents_source:t.agentsSource}))}trackStudioEntryViewed(t){if(this.entryViewed||!this.context)return;this.entryViewed=!0;const n=fle("studio_entry_viewed",qv({schema_version:dle,event_id:this.createId(),user_pool_id:this.context.userPoolId,studio_deploy_id:this.context.studioDeployId,vefaas_application_id:this.context.applicationId,vefaas_function_id:this.context.functionId,studio_region:this.context.studioRegion,studio_project:this.context.studioProject,studio_version:this.context.studioVersion,environment:this.context.environment,cloud_provider:this.context.cloudProvider,account_id:this.context.accountId,account_id_resolution_error:this.context.accountIdResolutionError||void 0,page_instance_id:this.pageInstanceId,auth_state:t.authState}));this.sink.emit("studio_entry_viewed",n)}beginAgentDeploy(t){return this.beginOperation("studio_agent_deploy",{agent_id:t.agentId,deploy_action:t.deployAction,deploy_source:t.deploySource,create_mode:t.createMode,ai_assisted:t.aiAssisted,deploy_region:t.deployRegion,runtime_network_type:t.runtimeNetworkType,feishu_enabled:t.feishuEnabled},n=>({runtime_id:n.runtimeId}),n=>({failed_phase:n.failedPhase,error_kind:n.errorKind,error_code:n.errorCode,error_message:n.errorMessage}))}beginSandboxCreate(t){return this.beginOperation("studio_sandbox_create",{sandbox_kind:t.sandboxKind,sandbox_source:t.sandboxSource},n=>({sandbox_id:n.sandboxId}),n=>({error_kind:n.errorKind,error_code:n.errorCode}))}beginAgentDebug(t){return this.beginOperation("studio_agent_debug",{agent_id:t.agentId,variant_type:t.variantType},n=>({debug_run_id:n.debugRunId}),n=>({failed_phase:n.failedPhase,error_kind:n.errorKind,error_code:n.errorCode}))}beginAgentConnect(t){return this.beginOperation("studio_agent_connect",{target_id:t.targetId,agent_kind:t.agentKind,connect_source:t.connectSource},n=>qv({runtime_region:n.runtimeRegion,runtime_is_mine:n.runtimeIsMine,sandbox_status:n.sandboxStatus}),n=>qv({error_kind:n.errorKind,error_code:n.errorCode}))}beginAgentMessage(t){return this.beginOperation("studio_agent_message",qv({agent_id:t.agentId,agent_kind:t.agentKind,message_source:t.messageSource,session_state:t.sessionState,session_id:t.sessionId}),n=>({session_id:n.sessionId}),n=>qv({session_id:n.sessionId,failed_phase:n.failedPhase,error_kind:n.errorKind,error_code:n.errorCode}))}beginAgentSourceDownload(t){return this.beginOperation("studio_agent_source_download",{agent_id:t.agentId,deploy_action:t.deployAction,deploy_source:t.deploySource,create_mode:t.createMode,ai_assisted:t.aiAssisted},n=>({file_count:n.fileCount,zip_size_bytes:n.zipSizeBytes}),n=>({file_count:n.fileCount,error_kind:n.errorKind,error_code:n.errorCode}))}beginOperation(t,n,i,r){const s=this.createId(),o=this.now(),l=!!(this.context&&this.identity);let c=!1;l&&this.emit(t,{...n,status:"started"},s);const u=(d,f)=>{c||(c=!0,l&&this.emit(t,{...n,...f,status:d,duration_ms:Math.max(0,this.now()-o)},s))};return{operationId:s,succeed:d=>u("succeeded",i(d)),fail:d=>u("failed",r(d))}}emit(t,n,i){if(!this.context||!this.identity)return;const r=fle(t,qv({schema_version:dle,event_id:this.createId(),operation_id:i,user_pool_id:this.context.userPoolId,studio_deploy_id:this.context.studioDeployId,vefaas_application_id:this.context.applicationId,vefaas_function_id:this.context.functionId,studio_region:this.context.studioRegion,studio_project:this.context.studioProject,studio_version:this.context.studioVersion,environment:this.context.environment,cloud_provider:this.context.cloudProvider,account_id:this.identity.accountId,account_id_resolution_error:this.context.accountIdResolutionError||void 0,user_role:this.identity.userRole,user_source:this.identity.userSource,page_instance_id:this.pageInstanceId,...n}));this.sink.emit(t,r)}}const H9e=new gtn,Dh=new Etn({sink:H9e});function Ctn(e){return H9e.init(e)}function Atn(e){Dh.setContext(e)}function Ttn(e){Dh.identify(e)}function _tn(e){Dh.trackStudioEntryViewed(e)}function jtn(e){Dh.trackStudioSessionStarted(e)}function q9e(e){return Dh.beginAgentDeploy(e)}function Ntn(e){return Dh.beginSandboxCreate(e)}function Rtn(e){return Dh.beginAgentDebug(e)}function Sj(e){return Dh.beginAgentConnect(e)}function hle(e){return Dh.beginAgentMessage(e)}function W9e(e){return Dh.beginAgentSourceDownload(e)}const Itn=/^[A-Za-z_][A-Za-z0-9_]*$/;function zT(e,t=n=>Xt(`validation.agentName.${n}`)){return e.trim().length===0?t("required"):e==="user"?t("reserved"):Itn.test(e)?null:t("characters")}function Ptn(e){const t=new Set,n=new Set,i=r=>{zT(r.name)===null&&(t.has(r.name)?n.add(r.name):t.add(r.name)),r.subAgents.forEach(i)};return i(e),n}function Dtn(e){return{...Od(),name:e,description:Eh("feishu.generatedAgent.description"),instruction:Eh("feishu.generatedAgent.instruction"),deployment:{feishuEnabled:!0}}}async function Mtn(e){const t=Dtn(e.agentName),n=await GS(t);return $0(n.name,n.files,{region:e.region,projectName:"default"},{taskId:e.taskId,sessionStorage:"in-memory",minInstance:1,maxInstance:1,description:t.description,im:{feishu:{enabled:!0}},envs:[{key:"FEISHU_APP_ID",value:e.appId},{key:"FEISHU_APP_SECRET",value:e.appSecret}],onStage:e.onStage})}const Vf=["cn-beijing","cn-shanghai"],K9e=["prepare","build","deploy","publish"];function Ltn(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"m9.8 3.5-4.5 4.5 4.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function $tn(e){return a.jsx("svg",{viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"m5 7 4 4 4-4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function ple(e){return a.jsx("svg",{viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"m4 9.2 3.1 3.1L14 5.8",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ftn(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M6.5 4H4.8A1.8 1.8 0 0 0 3 5.8v5.4A1.8 1.8 0 0 0 4.8 13h5.4a1.8 1.8 0 0 0 1.8-1.8V9.5M9 3h4v4M12.5 3.5 7.2 8.8",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function Btn(e){if(!e||e==="upload")return 0;const t=K9e.findIndex(n=>n===e);return t<0?0:t}function w6(e){switch(e){case"prepare":case"upload":case"build":case"deploy":case"publish":case"update":case"evaluation":return e;default:return"unknown"}}function mle(e){const t=zT(e,n=>n);return t?`feishu.validation.agentName.${t}`:""}function Utn({onBack:e}){const{t}=Te("automations"),[n,i]=p.useState("feishu_assistant"),[r,s]=p.useState(""),[o,l]=p.useState(""),[c,u]=p.useState(!1),[d,f]=p.useState("cn-beijing"),[h,m]=p.useState(!1),[g,b]=p.useState(""),[v,y]=p.useState(""),[w,x]=p.useState(""),[O,k]=p.useState("idle"),[S,C]=p.useState(null),[E,j]=p.useState(""),[T,R]=p.useState(null),A=p.useRef(null),N=p.useRef(null),P=p.useRef([]),I=p.useRef(0),D=p.useRef(null),_=p.useRef(null),L=p.useRef("prepare"),F=p.useRef(!1),M=p.useRef(!0),z=["preparing","running","cancelling"].includes(O);p.useEffect(()=>(M.current=!0,()=>{M.current=!1}),[]),p.useEffect(()=>{var se;if(!h)return;(se=P.current[I.current])==null||se.focus();const G=Y=>{Y.target instanceof Node&&A.current&&!A.current.contains(Y.target)&&m(!1)},H=Y=>{var X;Y.key==="Escape"&&(m(!1),(X=N.current)==null||X.focus())};return window.addEventListener("pointerdown",G),window.addEventListener("keydown",H),()=>{window.removeEventListener("pointerdown",G),window.removeEventListener("keydown",H)}},[h]);const q=G=>{G.key==="Enter"&&(G.nativeEvent.isComposing||G.nativeEvent.keyCode===229)&&G.preventDefault()},U=()=>{const G=mle(n.trim()),H=r.trim()?"":"feishu.validation.appId",se=o.trim()?"":"feishu.validation.appSecret";return b(G),y(H),x(se),!G&&!H&&!se},J=async G=>{if(G.preventDefault(),!U()||z)return;const H=crypto.randomUUID();D.current=H,L.current="prepare",F.current=!1,k("preparing"),C(null),j(""),R(null);const se=q9e({agentId:String(n.trim()),deployAction:"create",deploySource:"feishu_automation",createMode:"feishu_template",aiAssisted:0,deployRegion:String(d),runtimeNetworkType:"public",feishuEnabled:1});_.current=se;try{const Y=await Mtn({agentName:n.trim(),appId:r.trim(),appSecret:o.trim(),region:d,taskId:H,onStage:X=>{L.current=X.phase||"deploy",!(!M.current||F.current)&&(k("running"),C(X))}});if(F.current){se.fail({failedPhase:w6(L.current),errorKind:"abort",errorMessage:My("User cancelled deployment")});return}if(se.succeed({runtimeId:String(Y.runtimeId||"")}),!M.current)return;R(Y),l(""),u(!1),k("succeeded")}catch(Y){if(se.fail({failedPhase:w6(L.current),...F.current?{errorKind:"abort"}:Xo(Y,{phase:L.current}),errorMessage:My(Y)}),!M.current||F.current)return;k("failed"),j(Y instanceof Error?Y.message:String(Y))}finally{D.current===H&&(D.current=null),_.current===se&&(_.current=null)}},V=async()=>{var H;const G=D.current;if(!(!G||O!=="running")&&window.confirm(t("feishu.confirmCancel"))){F.current=!0,k("cancelling"),j("");try{await a2e(G),(H=_.current)==null||H.fail({failedPhase:w6(L.current),errorKind:"abort",errorMessage:My("User cancelled deployment")}),M.current&&k("cancelled")}catch(se){if(F.current=!1,!M.current)return;k("failed"),j(se instanceof Error?se.message:String(se))}}},Z=Btn((S==null?void 0:S.phase)??null),ne=!!(n.trim()&&r.trim()&&o.trim()&&!z),W=t(`feishu.regions.${d}`);return a.jsxs("div",{className:"feishu-integration-page",children:[a.jsxs("header",{className:"feishu-integration-header",children:[a.jsx("button",{type:"button",className:"feishu-back",onClick:e,"aria-label":t("backToAutomations"),disabled:z,children:a.jsx(Ltn,{})}),a.jsx("img",{className:"feishu-integration-logo",src:IL,alt:"","aria-hidden":"true"}),a.jsxs("div",{children:[a.jsx("h1",{children:t("feishu.title")}),a.jsx("p",{children:t("feishu.description")})]})]}),a.jsx("div",{className:"feishu-integration-layout",children:a.jsxs("section",{className:"feishu-section-panel",children:[a.jsx("p",{className:"feishu-panel-description",children:t("feishu.panel")}),a.jsxs("form",{className:"feishu-form",onSubmit:J,onKeyDown:q,noValidate:!0,children:[a.jsxs("div",{className:"feishu-field-grid",children:[a.jsxs("div",{className:"feishu-field",children:[a.jsx("label",{htmlFor:"feishu-agent-name",children:t("feishu.agentName")}),a.jsx("input",{id:"feishu-agent-name",value:n,maxLength:64,disabled:z,onChange:G=>{i(G.target.value),g&&b("")},onBlur:()=>b(mle(n.trim())),"aria-invalid":!!g,"aria-describedby":`feishu-agent-name-help${g?" feishu-agent-name-error":""}`}),a.jsx("span",{id:"feishu-agent-name-help",className:"feishu-field-help",children:t("feishu.agentNameHelp")}),g?a.jsx("span",{id:"feishu-agent-name-error",className:"feishu-field-error",role:"alert",children:t(g)}):null]}),a.jsxs("div",{className:"feishu-field",children:[a.jsx("label",{id:"feishu-region-label",children:t("feishu.region")}),a.jsxs("div",{className:"feishu-region-picker",ref:A,children:[a.jsxs("button",{ref:N,type:"button",className:"feishu-region-trigger",disabled:z,"aria-haspopup":"listbox","aria-expanded":h,"aria-labelledby":"feishu-region-label feishu-region-value",onClick:()=>{I.current=Vf.findIndex(G=>G===d),m(G=>!G)},onKeyDown:G=>{G.key!=="ArrowDown"&&G.key!=="ArrowUp"||(G.preventDefault(),I.current=G.key==="ArrowUp"?Vf.length-1:Vf.findIndex(H=>H===d),m(!0))},children:[a.jsx("span",{id:"feishu-region-value",children:W}),a.jsx($tn,{})]}),h?a.jsx("div",{className:"feishu-region-menu",role:"listbox","aria-label":t("feishu.region"),onKeyDown:G=>{var Y;const H=P.current.findIndex(X=>X===document.activeElement);let se=null;G.key==="ArrowDown"?se=(H+1)%Vf.length:G.key==="ArrowUp"?se=(H-1+Vf.length)%Vf.length:G.key==="Home"?se=0:G.key==="End"?se=Vf.length-1:G.key==="Tab"&&m(!1),se!==null&&(G.preventDefault(),(Y=P.current[se])==null||Y.focus())},children:Vf.map(G=>a.jsx("button",{ref:H=>{const se=Vf.findIndex(Y=>Y===G);P.current[se]=H},type:"button",role:"option","aria-selected":d===G,className:`feishu-region-option${d===G?" is-selected":""}`,onClick:()=>{var H;f(G),m(!1),(H=N.current)==null||H.focus()},children:t(`feishu.regions.${G}`)},G))}):null]}),a.jsx("span",{className:"feishu-field-help",children:t("feishu.regionHelp")})]}),a.jsxs("div",{className:"feishu-field",children:[a.jsx("label",{htmlFor:"feishu-app-id",children:t("feishu.appId")}),a.jsx("input",{id:"feishu-app-id",value:r,maxLength:128,autoComplete:"off",disabled:z,placeholder:"cli_xxxxxxxxxxxxxxxx",onChange:G=>{s(G.target.value),v&&y("")},onBlur:()=>y(r.trim()?"":"feishu.validation.appId"),"aria-invalid":!!v,"aria-describedby":`feishu-app-id-help${v?" feishu-app-id-error":""}`}),a.jsx("span",{id:"feishu-app-id-help",className:"feishu-field-help",children:t("feishu.appIdHelp")}),v?a.jsx("span",{id:"feishu-app-id-error",className:"feishu-field-error",role:"alert",children:t(v)}):null]}),a.jsxs("div",{className:"feishu-field",children:[a.jsx("label",{htmlFor:"feishu-app-secret",children:t("feishu.appSecret")}),a.jsxs("div",{className:"feishu-secret-input",children:[a.jsx("input",{id:"feishu-app-secret",type:c?"text":"password",value:o,maxLength:256,autoComplete:"off",disabled:z,placeholder:t("feishu.appSecretPlaceholder"),onChange:G=>{l(G.target.value),w&&x("")},onBlur:()=>x(o.trim()?"":"feishu.validation.appSecret"),"aria-invalid":!!w,"aria-describedby":`feishu-app-secret-help${w?" feishu-app-secret-error":""}`}),a.jsx("button",{type:"button",disabled:z,onClick:()=>u(G=>!G),"aria-label":t(c?"feishu.hideSecret":"feishu.showSecret"),children:t(c?"feishu.hide":"feishu.show")})]}),a.jsx("span",{id:"feishu-app-secret-help",className:"feishu-field-help",children:t("feishu.appSecretHelp")}),w?a.jsx("span",{id:"feishu-app-secret-error",className:"feishu-field-error",role:"alert",children:t(w)}):null]})]}),O!=="idle"?a.jsxs("div",{className:`feishu-deployment-status is-${O}`,role:O==="failed"?"alert":"status",children:[a.jsxs("div",{className:"feishu-deployment-heading",children:[O==="preparing"?a.jsx(hn,{as:"strong",children:t("feishu.status.preparing")}):null,O==="running"?a.jsx(hn,{as:"strong",children:S?pL(S):t("feishu.status.running")}):null,O==="cancelling"?a.jsx(hn,{as:"strong",children:t("feishu.status.cancelling")}):null,O==="succeeded"?a.jsxs("strong",{children:[a.jsx(ple,{}),t("feishu.status.succeeded")]}):null,O==="cancelled"?a.jsx("strong",{children:t("feishu.status.cancelled")}):null,O==="failed"?a.jsx("strong",{children:t("feishu.status.failed")}):null]}),O==="preparing"||O==="running"||O==="cancelling"?a.jsx("ol",{className:"feishu-deployment-steps",children:K9e.map((G,H)=>{const se=O==="running"&&Hvoid V(),children:t("feishu.cancelDeployment")}):null,a.jsx("button",{type:"submit",className:"feishu-submit",disabled:!ne,children:t(z?"feishu.creating":"feishu.create")})]})]})]})]})})]})}async function CK(e,t,n,i=ho){var s;const r=await vn(e,{...t,headers:{accept:"application/json",...t.headers},signal:n},i);if(!r.ok){let o="";try{o=((s=(await r.json()).detail)==null?void 0:s.trim())||""}catch{}throw new Error(o||Q("common.requestFailed",{status:r.status}))}return r.json()}function Qtn(e){return CK("/web/coding-agents/capabilities",{method:"GET"},e,pz)}function ztn(e,t){return CK(`/web/coding-agents/skills/${encodeURIComponent(e)}/preview`,{method:"GET"},t)}function Vtn(e,t){return CK("/web/coding-agents/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)},t)}const Htn="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='16'%20height='16'%20rx='3.692'%20fill='%231A1B1D'/%3e%3cpath%20d='M13.235%205.829V4.332H2.758v5.987h1.496v1.496h8.981V5.828Zm-1.497%204.49H4.254V5.83h7.484v4.49Z'%20fill='%2332F08C'/%3e%3cpath%20d='M6.937%206.993%205.88%208.051%206.937%209.11%207.995%208.05%206.937%206.993ZM9.931%206.992%208.873%208.05%209.931%209.11%2010.99%208.05%209.93%206.992Z'%20fill='%2332F08C'/%3e%3c/svg%3e";function qtn(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m4 4 8 8m0-8-8 8",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function gle(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[a.jsx("path",{d:"M4 1.8h5l3 3V14H4z",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),a.jsx("path",{d:"M9 1.8V5h3M6 8h4M6 10.5h4",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function ble(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M1.8 4.5h4l1.2-1.3h2.2l1.2 1.3h3.8v8H1.8z",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"})})}function Wtn(e){return e instanceof DOMException&&e.name==="AbortError"}function Ktn(e){return e instanceof Error&&e.message?e.message:""}function Gtn(e){return e<1024?`${e} B`:`${(e/1024).toFixed(e<10*1024?1:0)} KB`}function Xtn(e){const t=e.split("/");return t[t.length-1]??e}function Ytn(e){const t=new Map;for(const n of e){const i=n.path.split("/"),r=i.length>1?i.slice(0,-1).join("/"):"";t.set(r,[...t.get(r)??[],n])}return Array.from(t,([n,i])=>({directory:n,files:i})).sort((n,i)=>n.directory?i.directory?n.directory.localeCompare(i.directory):1:-1)}function Ztn({skill:e,onClose:t}){const{t:n}=Te("automations"),i=p.useRef(null),r=p.useRef(null),s=p.useId(),o=p.useId(),[l,c]=p.useState(null),[u,d]=p.useState(""),[f,h]=p.useState(!0),[m,g]=p.useState(""),[b,v]=p.useState(0);p.useEffect(()=>{r.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const O=i.current;return O&&!O.open&&O.showModal(),()=>{var k;O!=null&&O.open&&O.close(),(k=r.current)==null||k.focus()}},[]),p.useEffect(()=>{const O=new AbortController;return h(!0),g(""),c(null),d(""),ztn(e.id,O.signal).then(k=>{if(O.signal.aborted)return;c(k);const S=k.files.find(C=>C.path==="SKILL.md")??k.files[0];d((S==null?void 0:S.path)??"")}).catch(k=>{!O.signal.aborted&&!Wtn(k)&&g(Ktn(k))}).finally(()=>{O.signal.aborted||h(!1)}),()=>O.abort()},[b,e.id]);const y=p.useMemo(()=>Ytn((l==null?void 0:l.files)??[]),[l]),w=(l==null?void 0:l.files.find(O=>O.path===u))??null,x=n(`codingAgents.skills.items.${e.id}.name`,{defaultValue:e.name});return a.jsxs("dialog",{ref:i,className:"coding-agents-preview-dialog","aria-labelledby":s,"aria-describedby":o,onCancel:O=>{O.preventDefault(),t()},onMouseDown:O=>{const k=O.currentTarget.getBoundingClientRect();(O.clientXk.right||O.clientYk.bottom)&&t()},children:[a.jsxs("header",{className:"coding-agents-preview-header",children:[a.jsx("span",{className:"coding-agents-preview-mark",children:a.jsx(ble,{})}),a.jsxs("div",{children:[a.jsx("h2",{id:s,children:x}),a.jsx("p",{id:o,children:n("codingAgents.preview.description")})]}),a.jsx("button",{type:"button",autoFocus:!0,"aria-label":n("codingAgents.preview.close"),onClick:t,children:a.jsx(qtn,{})})]}),f?a.jsxs("div",{className:"coding-agents-preview-state",children:[a.jsx("i",{}),n("codingAgents.preview.loading")]}):m?a.jsxs("div",{className:"coding-agents-preview-state is-error",role:"alert",children:[a.jsx("span",{children:m||n("codingAgents.preview.error")}),a.jsx("button",{type:"button",onClick:()=>v(O=>O+1),children:n("codingAgents.retry")})]}):a.jsxs("div",{className:"coding-agents-preview-layout",children:[a.jsxs("nav",{className:"coding-agents-preview-tree","aria-label":n("codingAgents.preview.skillFiles",{name:x}),children:[a.jsxs("div",{className:"coding-agents-preview-tree-title",children:[a.jsx("span",{children:n("codingAgents.preview.files")}),a.jsx("small",{children:(l==null?void 0:l.files.length)??0})]}),a.jsx("div",{className:"coding-agents-preview-tree-scroll",children:y.map(O=>O.directory?a.jsxs("details",{open:!0,children:[a.jsxs("summary",{children:[a.jsx(ble,{}),a.jsx("span",{children:O.directory})]}),a.jsx("div",{children:O.files.map(k=>a.jsxs("button",{type:"button",className:u===k.path?"is-selected":"","aria-current":u===k.path?"true":void 0,onClick:()=>d(k.path),children:[a.jsx(gle,{}),a.jsx("span",{children:Xtn(k.path)})]},k.path))})]},O.directory):O.files.map(k=>a.jsxs("button",{type:"button",className:u===k.path?"is-selected":"","aria-current":u===k.path?"true":void 0,onClick:()=>d(k.path),children:[a.jsx(gle,{}),a.jsx("span",{children:k.path})]},k.path)))})]}),a.jsx("section",{className:"coding-agents-preview-file","aria-label":n("codingAgents.preview.fileContent"),children:w?a.jsxs(a.Fragment,{children:[a.jsxs("header",{children:[a.jsx("strong",{children:w.path}),a.jsx("span",{children:Gtn(w.size)})]}),w.previewable&&w.content!==null?a.jsx("pre",{tabIndex:0,children:a.jsx("code",{children:w.content})}):a.jsx("div",{className:"coding-agents-preview-unavailable",children:n("codingAgents.preview.notPreviewable")})]}):a.jsx("div",{className:"coding-agents-preview-unavailable",children:n("codingAgents.preview.noFiles")})})]})]})}function Jtn(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"m9.8 3.5-4.5 4.5 4.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function enn(e){return a.jsxs("svg",{viewBox:"0 0 32 32",fill:"none","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"5",width:"16",height:"16",rx:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),a.jsx("path",{d:"m8.5 11-2.4 2.4 2.4 2.4M11 16.5h3.8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),a.jsx("circle",{cx:"24.5",cy:"10.5",r:"2.5",stroke:"currentColor",strokeWidth:"1.5"}),a.jsx("circle",{cx:"24.5",cy:"24.5",r:"2.5",stroke:"currentColor",strokeWidth:"1.5"}),a.jsx("path",{d:"M19.5 10.5H22M18.2 19l4.3 3.7M24.5 13v9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function tnn(e){return a.jsx("svg",{viewBox:"0 0 32 32",fill:"none","aria-hidden":"true",...e,children:a.jsxs("g",{stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",children:[a.jsx("path",{d:"M16 4.5v7M16 20.5v7"}),a.jsx("path",{d:"m9.3 6.3 3.5 6.1M19.2 19.6l3.5 6.1"}),a.jsx("path",{d:"m5.9 11.1 6.2 3.5M19.9 17.4l6.2 3.5"}),a.jsx("path",{d:"M4.7 16h7M20.3 16h7"}),a.jsx("path",{d:"m5.9 20.9 6.2-3.5M19.9 14.6l6.2-3.5"}),a.jsx("path",{d:"m9.3 25.7 3.5-6.1M19.2 12.4l3.5-6.1"})]})})}function nnn(e){return a.jsxs("svg",{viewBox:"0 0 32 32",fill:"none","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M15.8 4.2c2.4 0 4.5 1.2 5.7 3.1 2.2-.3 4.5.8 5.6 2.9 1.1 2 .8 4.4-.5 6.1 1.2 1.8 1.3 4.3.1 6.2-1.2 2-3.4 3-5.6 2.6-1.3 1.8-3.5 2.9-5.8 2.7-2.2-.2-4.1-1.5-5.1-3.4-2.2.1-4.4-1-5.4-3.1-1-2-.6-4.4.8-6.1-1.1-1.9-1.1-4.3.2-6.1 1.3-1.9 3.6-2.7 5.7-2.2 1.1-1.7 2.6-2.7 4.3-2.7Z",stroke:"currentColor",strokeWidth:"1.7",strokeLinejoin:"round"}),a.jsx("path",{d:"m10.7 12.2 3.1 3.8-3.1 3.8M17.1 20h4.3",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})}function yle(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"m3.4 8.2 3 3L12.8 5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function inn(e){return a.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M2.8 6.3h14.4v8.3a1.6 1.6 0 0 1-1.6 1.6H4.4a1.6 1.6 0 0 1-1.6-1.6V6.3Z",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round"}),a.jsx("path",{d:"M2.8 6.3V5.1a1.4 1.4 0 0 1 1.4-1.4h3.4l1.5 1.6h6.5a1.6 1.6 0 0 1 1.6 1.6",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round"})]})}function rnn({agentId:e}){return e==="trae"?a.jsx("img",{src:Htn,alt:"","aria-hidden":"true"}):e==="claude-code"?a.jsx(tnn,{}):a.jsx(nnn,{})}function vle(e){return e instanceof DOMException&&e.name==="AbortError"}function xle(e,t){return e instanceof Error&&e.message?e.message:t}function snn({onBack:e}){var R;const{t}=Te("automations"),[n,i]=p.useState(null),[r,s]=p.useState(!0),[o,l]=p.useState(null),[c,u]=p.useState(0),[d,f]=p.useState(new Set),[h,m]=p.useState(new Set),[g,b]=p.useState(null),[v,y]=p.useState(!1),[w,x]=p.useState(null),O=p.useRef(null);p.useEffect(()=>{const A=new AbortController;return s(!0),l(null),Qtn(A.signal).then(N=>{if(A.signal.aborted)return;i(N);const P=N.agents.filter(I=>I.available);f(I=>{const D=P.filter(_=>I.has(_.id));return new Set((D.length?D:P.slice(0,1)).map(_=>_.id))}),m(I=>{const D=N.skills.filter(_=>I.has(_.id));return new Set((D.length?D:N.skills).map(_=>_.id))})}).catch(N=>{!vle(N)&&!A.signal.aborted&&(i(null),l(xle(N,"")))}).finally(()=>{A.signal.aborted||s(!1)}),()=>A.abort()},[c]),p.useEffect(()=>()=>{var A;return(A=O.current)==null?void 0:A.abort()},[]);const k=p.useMemo(()=>(n==null?void 0:n.agents.filter(A=>A.available&&d.has(A.id)))||[],[n,d]),S=p.useMemo(()=>(n==null?void 0:n.skills.filter(A=>h.has(A.id)))||[],[n,h]),C=!!(!v&&k.length&&S.length),E=(A,N)=>{!N||v||(x(null),f(P=>{const I=new Set(P);return I.has(A)?I.delete(A):I.add(A),I}))},j=A=>{v||(x(null),m(N=>{const P=new Set(N);return P.has(A)?P.delete(A):P.add(A),P}))},T=async()=>{var N;if(!C)return;(N=O.current)==null||N.abort();const A=new AbortController;O.current=A,y(!0),x(null);try{const P=await Vtn({agents:k.map(D=>D.id),skills:S.map(D=>D.id)},A.signal);if(A.signal.aborted)return;const I=P.installations;x({tone:"success",agentCount:k.length,skillCount:S.length,installations:I})}catch(P){!vle(P)&&!A.signal.aborted&&x({tone:"error",message:xle(P,"")})}finally{O.current===A&&(O.current=null),A.signal.aborted||y(!1)}};return a.jsxs("section",{className:"coding-agents-page",children:[a.jsxs("header",{className:"coding-agents-header",children:[a.jsx("button",{type:"button",className:"coding-agents-back",onClick:e,disabled:v,"aria-label":t("backToAutomations"),children:a.jsx(Jtn,{})}),a.jsx(enn,{className:"coding-agents-logo"}),a.jsxs("div",{children:[a.jsx("h1",{children:t("codingAgents.title")}),a.jsx("p",{children:t("codingAgents.description")})]})]}),a.jsx("div",{className:"coding-agents-scroll",children:a.jsxs("div",{className:"coding-agents-content",children:[a.jsxs("section",{className:"coding-agents-section","aria-label":t("codingAgents.clients.ariaLabel"),children:[a.jsxs("div",{className:"coding-agents-section-heading",children:[a.jsxs("div",{children:[a.jsx("span",{children:"1"}),a.jsx("h2",{children:t("codingAgents.clients.title")})]}),a.jsx("button",{type:"button",onClick:()=>u(A=>A+1),disabled:r||v,children:t("codingAgents.clients.detectAgain")})]}),r?a.jsxs("div",{className:"coding-agents-inline-state",children:[a.jsx("i",{}),t("codingAgents.clients.detecting")]}):o!==null?a.jsxs("div",{className:"coding-agents-error-row",role:"alert",children:[a.jsx("span",{children:o||t("codingAgents.errors.detect")}),a.jsx("button",{type:"button",onClick:()=>u(A=>A+1),children:t("codingAgents.retry")})]}):a.jsx("div",{className:"coding-agents-agent-grid",children:n==null?void 0:n.agents.map(A=>a.jsxs("button",{type:"button",className:`coding-agents-agent ${d.has(A.id)?"is-selected":""}`,"aria-pressed":d.has(A.id),disabled:!A.available||v,onClick:()=>E(A.id,A.available),title:A.available?A.name:A.reason,children:[a.jsx("span",{className:`coding-agents-agent-mark is-${A.id}`,children:a.jsx(rnn,{agentId:A.id})}),a.jsxs("span",{className:"coding-agents-agent-copy",children:[a.jsx("strong",{children:A.name}),a.jsx("small",{children:A.available?A.version||t("codingAgents.clients.detected"):A.reason})]}),a.jsx("span",{className:`coding-agents-status ${A.available?"is-ready":""}`,children:A.available?t("codingAgents.clients.available"):t("codingAgents.clients.unavailable")}),a.jsx("span",{className:"coding-agents-check",children:a.jsx(yle,{})})]},A.id))})]}),a.jsxs("section",{className:"coding-agents-section","aria-label":t("codingAgents.skills.ariaLabel"),children:[a.jsx("div",{className:"coding-agents-section-heading",children:a.jsxs("div",{children:[a.jsx("span",{children:"2"}),a.jsx("h2",{children:t("codingAgents.skills.title")})]})}),a.jsx("div",{className:"coding-agents-skill-list",children:n==null?void 0:n.skills.map(A=>a.jsxs("div",{className:`coding-agents-skill ${h.has(A.id)?"is-selected":""}`,children:[a.jsxs("label",{children:[a.jsx("input",{type:"checkbox",checked:h.has(A.id),onChange:()=>j(A.id),disabled:v}),a.jsx("span",{className:"coding-agents-skill-check","aria-hidden":"true",children:a.jsx(yle,{})}),a.jsxs("span",{children:[a.jsx("strong",{children:t(`codingAgents.skills.items.${A.id}.name`,{defaultValue:A.name})}),a.jsx("small",{children:t(`codingAgents.skills.items.${A.id}.description`,{defaultValue:A.description})})]})]}),a.jsx("button",{type:"button",onClick:()=>b(A),children:t("codingAgents.skills.viewFiles")})]},A.id))}),a.jsxs("div",{className:"coding-agents-global","aria-label":t("codingAgents.global.ariaLabel"),children:[a.jsxs("div",{className:"coding-agents-global-heading",children:[a.jsx(inn,{}),a.jsxs("div",{children:[a.jsx("strong",{children:t("codingAgents.global.title")}),a.jsx("span",{children:t("codingAgents.global.description")})]})]}),k.length?a.jsx("dl",{children:k.map(A=>a.jsxs("div",{children:[a.jsx("dt",{children:A.name}),a.jsx("dd",{children:A.globalSkillsPath})]},A.id))}):a.jsx("p",{children:t("codingAgents.global.empty")})]})]}),w?a.jsxs("div",{className:`coding-agents-result is-${w.tone}`,role:w.tone==="error"?"alert":"status",children:[a.jsx("strong",{children:w.tone==="success"?t("codingAgents.success",{agentCount:w.agentCount,skillCount:w.skillCount}):w.message||t("codingAgents.errors.configure")}),(R=w.installations)!=null&&R.length?a.jsx("ul",{children:w.installations.map(A=>a.jsxs("li",{children:[A.agentName," · ",t(`codingAgents.skills.items.${A.skillId}.name`,{defaultValue:A.skill})," → ",A.displayPath]},`${A.agent}:${A.skillId}`))}):null]}):null,a.jsxs("div",{className:"coding-agents-actions",children:[a.jsx("span",{children:k.length?t("codingAgents.selection",{agentCount:k.length,skillCount:S.length}):t("codingAgents.selectClient")}),a.jsx("button",{type:"button",onClick:()=>void T(),disabled:!C,children:t(v?"codingAgents.configuring":"codingAgents.configure")})]})]})}),g?a.jsx(Ztn,{skill:g,onClose:()=>b(null)}):null]})}const ann="data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20overflow='visible'%20style='display:%20block;'%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='down'%3e%3cpath%20id='&%23229;&%23189;&%23162;&%23231;&%23138;&%23182;'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.46129%203.67509C3.22783%203.44164%202.84933%203.44164%202.61587%203.67509L2.19316%204.0978C1.9597%204.33126%201.9597%204.70977%202.19316%204.94322L5.57484%208.32491C5.6922%208.44226%205.8462%208.50062%206.00001%208.49999C6.15382%208.50062%206.30782%208.44226%206.42518%208.32491L9.80686%204.94322C10.0403%204.70977%2010.0403%204.33126%209.80686%204.0978L9.38415%203.67509C9.15069%203.44164%208.77219%203.44164%208.53873%203.67509L6.00001%206.21381L3.46129%203.67509Z'%20fill='%23737A87'/%3e%3c/g%3e%3c/svg%3e";function G9e({options:e,value:t,defaultValue:n,onChange:i,className:r="",style:s,disabled:o,id:l,ref:c,tabIndex:u,"aria-label":d,"aria-labelledby":f,...h}){var D;const m=p.useId(),g=`${m}-list`,b=p.useRef(null),v=p.useRef(null),y=p.useRef(null);p.useImperativeHandle(c,()=>v.current);const[w,x]=p.useState(n??((D=e.find(_=>!_.disabled))==null?void 0:D.value)??""),O=t??w,k=e.find(_=>_.value===O),[S,C]=p.useState(!1),[E,j]=p.useState(0),[T,R]=p.useState({left:0,top:0,width:0,maxHeight:240}),A=p.useRef({text:"",time:0});function N(){if(o)return;const _=e.findIndex(L=>L.value===O&&!L.disabled);j(_>=0?_:e.findIndex(L=>!L.disabled)),C(!0)}function P(_){var F;const L=e[_];!L||L.disabled||(v.current&&O!==L.value&&(v.current.value=L.value,v.current.dispatchEvent(new Event("change",{bubbles:!0}))),C(!1),(F=b.current)==null||F.focus())}function I(_){if(["ArrowDown","ArrowUp","Home","End"].includes(_.key)){if(_.preventDefault(),!S){N();return}const L=e.map((M,z)=>M.disabled?-1:z).filter(M=>M>=0);if(!L.length)return;const F=L.indexOf(E);j(_.key==="Home"?L[0]:_.key==="End"?L[L.length-1]:L[(F+(_.key==="ArrowDown"?1:-1)+L.length)%L.length])}else if(_.key==="Enter"||_.key===" ")_.preventDefault(),S?P(E):N();else if(_.key==="Escape")S&&_.preventDefault(),C(!1);else if(_.key==="Tab")C(!1);else if(_.key.length===1&&!_.ctrlKey&&!_.metaKey&&!_.altKey){const L=Date.now();A.current={text:(L-A.current.time<600?A.current.text:"")+_.key.toLowerCase(),time:L};const F=e.findIndex(M=>!M.disabled&&M.label.toLowerCase().startsWith(A.current.text));F>=0&&(j(F),C(!0))}}return p.useLayoutEffect(()=>{if(!S)return;function _(){var V;const L=(V=b.current)==null?void 0:V.getBoundingClientRect();if(!L)return;const F=window.innerHeight-L.bottom-12,M=L.top-12,z=e.reduce((Z,ne)=>Z+(ne.description?48:28),0),q=Math.min(240,z+Math.max(0,e.length-1)*4+10),U=FF,J=Math.max(28,Math.min(240,U?M:F));R({left:Math.max(8,Math.min(L.left,window.innerWidth-L.width-8)),top:U?L.top-Math.min(q,J)-6:L.bottom+6,width:L.width,maxHeight:J})}return _(),window.addEventListener("resize",_),window.addEventListener("scroll",_,!0),()=>{window.removeEventListener("resize",_),window.removeEventListener("scroll",_,!0)}},[S,e]),p.useEffect(()=>{if(!S)return;function _(L){var F,M;L.target instanceof Node&&!((F=b.current)!=null&&F.contains(L.target))&&!((M=y.current)!=null&&M.contains(L.target))&&C(!1)}return document.addEventListener("pointerdown",_),()=>document.removeEventListener("pointerdown",_)},[S]),p.useEffect(()=>{o&&C(!1)},[o]),p.useEffect(()=>{var _,L,F;S&&((F=(L=(_=y.current)==null?void 0:_.querySelector(`[data-index="${E}"]`))==null?void 0:L.scrollIntoView)==null||F.call(L,{block:"nearest"}))},[E,S]),a.jsxs("span",{className:`studio-select ${r}`.trim(),style:s,"data-disabled":o||void 0,children:[a.jsxs("button",{ref:b,id:l,type:"button",role:"combobox",className:"studio-select__display",disabled:o,tabIndex:u,"aria-label":d,"aria-labelledby":f,"aria-expanded":S,"aria-haspopup":"listbox","aria-controls":S?g:void 0,"aria-activedescendant":S&&E>=0?`${m}-option-${E}`:void 0,"aria-required":h.required,onClick:()=>S?C(!1):N(),onKeyDown:I,children:[a.jsxs("span",{className:"studio-select__content",children:[(k==null?void 0:k.icon)&&a.jsx("span",{className:"studio-select__icon","aria-hidden":"true",children:k.icon}),a.jsx("span",{className:"studio-select__label",children:k==null?void 0:k.label})]}),a.jsx("img",{className:"studio-select__arrow","data-open":S,src:ann,alt:""})]}),a.jsx("select",{...h,ref:v,className:"studio-select__native","aria-hidden":"true",tabIndex:-1,disabled:o,value:O,onChange:_=>{t===void 0&&x(_.target.value),i==null||i(_)},children:e.map(_=>a.jsx("option",{value:_.value,disabled:_.disabled,children:_.label},_.value))}),S&&vi.createPortal(a.jsx(vf,{ref:y,id:g,role:"listbox","aria-label":d??"选项","aria-labelledby":f,className:"studio-select-menu",contentClassName:"studio-select-menu__items",style:T,children:e.map((_,L)=>a.jsxs("div",{id:`${m}-option-${L}`,role:"option","aria-label":_.label,"aria-describedby":_.description?`${m}-description-${L}`:void 0,"aria-selected":_.value===O,"aria-disabled":_.disabled||void 0,"data-active":L===E,"data-index":L,"data-description":!!_.description||void 0,className:"studio-select-menu__option",onPointerMove:()=>!_.disabled&&j(L),onMouseDown:F=>F.preventDefault(),onClick:()=>P(L),children:[_.icon&&a.jsx("span",{className:"studio-select__icon","aria-hidden":"true",children:_.icon}),_.description?a.jsxs("span",{className:"studio-select-menu__text",children:[a.jsx("span",{className:"studio-select__label",children:_.label}),a.jsx("span",{id:`${m}-description-${L}`,className:"studio-select-menu__description",title:_.description,children:_.description})]}):a.jsx("span",{className:"studio-select__label",children:_.label}),_.value===O&&a.jsx("svg",{className:"studio-select-menu__check",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m3 8 3 3 7-7",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})]},_.value))}),document.body)]})}function onn(e){return a.jsxs("span",{className:"studio-radio__control",children:[a.jsx("input",{...e,className:"studio-radio__input",type:"radio"}),a.jsx("span",{className:"studio-radio__box","aria-hidden":"true",children:a.jsx("span",{className:"studio-radio__dot"})})]})}function lnn({label:e,className:t="",...n}){return a.jsxs("label",{className:`studio-radio ${t}`.trim(),children:[a.jsx(onn,{...n}),e!=null&&a.jsx("span",{className:"studio-radio__label",children:e})]})}const Ik={QR_CODE_READY:"QR_CODE_READY",AUTH_SUCCESS:"AUTH_SUCCESS",AUTH_ERROR:"AUTH_ERROR",AUTH_CANCEL:"AUTH_CANCEL",WINDOW_CLOSE:"WINDOW_CLOSE"},wle={WINDOW_BLOCKED:"WINDOW_BLOCKED",CANCELLED:"CANCELLED"},cnn={authOrigin:"https://work.weixin.qq.com",width:950,height:640,debug:!1},unn=500;class dnn{constructor(){this.handlers=new Map}on(t,n){const i=this.handlers.get(t)||[];return i.push(n),this.handlers.set(t,i),this}off(t,n){if(!n)return this.handlers.delete(t),this;const i=this.handlers.get(t);if(i){const r=i.filter(s=>s!==n);r.length>0?this.handlers.set(t,r):this.handlers.delete(t)}return this}emit(t,...n){const i=this.handlers.get(t);i&&i.forEach(r=>{try{r(...n)}catch(s){console.error(`[WecomAIBotSDK] Event handler error for "${t}":`,s)}})}removeAll(){this.handlers.clear()}listenerCount(t){var n,i;return(i=(n=this.handlers.get(t))===null||n===void 0?void 0:n.length)!==null&&i!==void 0?i:0}}class X9e{constructor(){this.authWindow=null,this.pollingTimer=null,this.messageListener=null,this.config={...cnn},this.emitter=new dnn,this.setupMessageListener()}openBotInfoAuthWindow(t){var n;this.validateOptions(t),this.mergeConfig(t);const i=t.state||this.generateState(),r=this.buildAuthUrl(t.source,i),s=this.buildWindowFeatures();if(this.authWindow=window.open(r,"WecomAIBotAuthWindow",s),!this.authWindow){const o={code:wle.WINDOW_BLOCKED,message:"弹窗被拦截,请允许弹窗或点击手动打开"};return this.emitter.emit("error",o),(n=t.onError)===null||n===void 0||n.call(t,o),Promise.reject(o)}return this.startPolling(),new Promise((o,l)=>{const c=()=>{this.emitter.off("success",u),this.emitter.off("error",d),this.emitter.off("cancel",f)},u=h=>{c(),o(h)},d=h=>{c(),l(h)},f=()=>{c(),l({code:wle.CANCELLED,message:"用户取消授权"})};this.emitter.on("success",u),this.emitter.on("error",d),this.emitter.on("cancel",f),t.onCreated&&this.emitter.on("success",t.onCreated),t.onError&&this.emitter.on("error",t.onError)})}closeWindow(){this.authWindow&&!this.authWindow.closed&&this.authWindow.close(),this.authWindow=null,this.stopPolling()}destroy(){this.closeWindow(),this.removeMessageListener(),this.emitter.removeAll(),this.log("SDK destroyed")}on(t,n){return this.emitter.on(t,n),this}off(t,n){return this.emitter.off(t,n),this}validateOptions(t){if(!t.source)throw new Error("[WecomAIBotSDK] source is required")}mergeConfig(t){t.authOrigin&&(this.config.authOrigin=t.authOrigin),t.width!=null&&(this.config.width=t.width),t.height!=null&&(this.config.height=t.height),t.debug!=null&&(this.config.debug=t.debug)}buildAuthUrl(t,n){const i=new URLSearchParams({source:t,state:n,timestamp:String(Date.now())});return`${this.config.authOrigin}/ai/qc/gen?${i.toString()}`}buildWindowFeatures(){const{width:t,height:n}=this.config,i=(window.screen.width-t)/2,r=(window.screen.height-n)/2;return[`width=${t}`,`height=${n}`,`left=${i}`,`top=${r}`,"resizable=false","scrollbars=false","status=no","toolbar=no","menubar=no","location=no"].join(",")}generateState(){return`state_${Math.random().toString(36).substring(2,11)}_${Date.now()}`}setupMessageListener(){this.messageListener=t=>{var n;if(t.origin!==this.config.authOrigin){this.log("Message from unknown origin:",t.origin);return}const i=t.data;if(!(!i||!i.type))switch(this.log("Message received:",i.type,i.payload),i.type){case Ik.QR_CODE_READY:{this.emitter.emit("ready",i.payload);break}case Ik.AUTH_SUCCESS:{this.emitter.emit("success",i.payload),this.closeWindow();break}case Ik.AUTH_ERROR:{const r=((n=i.payload)===null||n===void 0?void 0:n.error)||i.payload;this.emitter.emit("error",r),this.closeWindow();break}case Ik.AUTH_CANCEL:{this.emitter.emit("cancel",null),this.closeWindow();break}case Ik.WINDOW_CLOSE:{this.closeWindow();break}}},window.addEventListener("message",this.messageListener)}removeMessageListener(){this.messageListener&&(window.removeEventListener("message",this.messageListener),this.messageListener=null)}startPolling(){this.stopPolling(),this.pollingTimer=setInterval(()=>{var t;!((t=this.authWindow)===null||t===void 0)&&t.closed&&(this.stopPolling(),this.authWindow=null,this.emitter.emit("cancel",null))},unn)}stopPolling(){this.pollingTimer&&(clearInterval(this.pollingTimer),this.pollingTimer=null)}log(...t){this.config.debug&&console.log("[WecomAIBotSDK]",...t)}}const Y9e=new X9e;typeof window<"u"&&(window.WecomAIBotSDK=Y9e);Y9e.destroy();class wS extends Error{constructor(t){super("WeCom authorization failed"),this.code=t}}function fnn(e){if(e.aborted)return Promise.reject(new DOMException("Cancelled","AbortError"));const t=new X9e;return new Promise((n,i)=>{let r=!1;const s=()=>{r=!0,clearTimeout(c),e.removeEventListener("abort",l),t.destroy()},o=u=>{r||(s(),i(u))},l=()=>o(new DOMException("Cancelled","AbortError")),c=setTimeout(()=>o(new wS("AUTH_TIMEOUT")),3e5);e.addEventListener("abort",l,{once:!0});try{t.openBotInfoAuthWindow({source:"mpa-agent",state:crypto.randomUUID(),debug:!1}).then(u=>{if(!r){if(typeof(u==null?void 0:u.botid)!="string"||!u.botid.trim()||typeof(u==null?void 0:u.secret)!="string"||!u.secret.trim()){o(new wS("INVALID_RESULT"));return}s(),n({botId:u.botid.trim(),secret:u.secret.trim()})}},u=>{const d=u&&typeof u=="object"&&"code"in u&&typeof u.code=="string"?u.code:"FAILED";o(new wS(d))})}catch{o(new wS("FAILED"))}})}const Wv=["feishu","wecom","dingtalk"];function hnn(e){const{t}=Te("ui"),[n,i]=p.useState("feishu"),r=p.useId(),s=p.useRef([]);return a.jsxs("div",{className:"message-channels",children:[e.showHeader!==!1&&a.jsxs("div",{className:"message-channels-header",children:[a.jsx("h2",{children:t("channels.workspaceTitle")}),a.jsx("p",{children:t("channels.workspaceDescription")})]}),a.jsx("div",{className:"message-channels-tabs",role:"tablist","aria-label":t("channels.workspaceTitle"),children:Wv.map((o,l)=>a.jsx("button",{ref:c=>{s.current[l]=c},type:"button",role:"tab",id:`${r}-${o}`,"aria-controls":`${r}-panel`,"aria-selected":n===o,tabIndex:n===o?0:-1,onClick:()=>i(o),onKeyDown:c=>{var d;let u;if(c.key==="ArrowRight")u=(l+1)%Wv.length;else if(c.key==="ArrowLeft")u=(l+Wv.length-1)%Wv.length;else if(c.key==="Home")u=0;else if(c.key==="End")u=Wv.length-1;else return;c.preventDefault(),i(Wv[u]),(d=s.current[u])==null||d.focus()},children:t(`channels.provider_${o}`)},o))}),a.jsx("div",{role:"tabpanel",id:`${r}-panel`,"aria-labelledby":`${r}-${n}`,tabIndex:0,children:a.jsx(mnn,{...e,provider:n},`${e.region}:${e.runtimeId}:${n}`)})]})}function O6({label:e,value:t,complete:n,description:i}){return a.jsxs("div",{className:"runtime-channels-status-card",children:[a.jsx("dt",{children:e}),a.jsxs("dd",{children:[a.jsxs("span",{className:`runtime-channels-status-value${n?" is-complete":""}`,children:[a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"12",cy:"12",r:"9"}),n?a.jsx("path",{d:"m8 12 3 3 5-6"}):a.jsx("path",{d:"M12 7v5l3 2"})]}),t]}),a.jsx("p",{children:i})]})]})}const Ej=new Set(["BOUND","FAILED","EXPIRED"]),pnn=["group_sender","group","group_topic_sender","group_topic"];function mnn({runtimeId:e,region:t,provider:n}){var Pe;const{t:i}=Te("ui"),r=p.useMemo(()=>({runtimeId:e,region:t}),[e,t]),s=p.useId(),[o,l]=p.useState("quick"),[c,u]=p.useState(null),[d,f]=p.useState(null),[h,m]=p.useState([]),[g,b]=p.useState(!1),[v,y]=p.useState(null),[w,x]=p.useState(""),[O,k]=p.useState(""),[S,C]=p.useState(!1),[E,j]=p.useState(!1),[T,R]=p.useState(!1),[A,N]=p.useState(""),[P,I]=p.useState("group_sender"),[D,_]=p.useState(""),[L,F]=p.useState(!1),[M,z]=p.useState(!0),[q,U]=p.useState(0),J=p.useRef(!0),V=p.useRef(null),Z=p.useRef(null),ne=p.useRef(!1),W=`mpa-${n}-binding:${t}:${e}`,G=Ee=>{if(!J.current)return;if(Ee instanceof wS){const _e={WINDOW_BLOCKED:"wecomPopupBlocked",CANCELLED:"wecomAuthCancelled",AUTH_TIMEOUT:"wecomAuthTimeout",INVALID_RESULT:"wecomInvalidResult"}[Ee.code]||"wecomAuthFailed";_(i(`channels.${_e}`));return}const Qe=Ee instanceof eI?Ee.status:0;Qe===409&&R(!0),_(i(`channels.${Qe===409?"uncertain":Qe===404?"unsupported":Qe===401||Qe===403?"unauthorized":Qe===503?"configurationError":"requestFailed"}`))};async function H(Ee){const[Qe,_e]=await Promise.all([Yd(r,`/${n}/diagnostics`,{signal:Ee}),n==="feishu"?Yd(r,"/chat-permissions?channel=feishu",{signal:Ee}):Promise.resolve({permissions:[]})]);!Ee.aborted&&J.current&&(f(Qe),m(_e.permissions))}p.useEffect(()=>{J.current=!0;try{sessionStorage.removeItem(W)}catch{}return()=>{var Ee,Qe;J.current=!1,(Ee=V.current)==null||Ee.abort(),(Qe=Z.current)==null||Qe.abort()}},[]),p.useEffect(()=>{var Qe;const Ee=new AbortController;return z(!0),_(""),u(null),y(null),b(!1),j(!1),(Qe=Z.current)==null||Qe.abort(),(async()=>{try{const _e=await Yd(r,"/capabilities",{signal:Ee.signal});if(Ee.signal.aborted)return;if(!_e.serverSideBinding||!(_e.channels??["feishu"]).includes(n))throw new eI(404);u(_e),await H(Ee.signal)}catch(_e){Ee.signal.aborted||G(_e)}finally{Ee.signal.aborted||z(!1)}})(),()=>Ee.abort()},[r,q]),p.useEffect(()=>{if(o!=="quick"||!v||Ej.has(v.status)||L)return;const Ee=new AbortController;Z.current=Ee;const Qe=window.setTimeout(()=>{Yd(r,`/${n}/bindings/${encodeURIComponent(v.id)}`,{signal:Ee.signal}).then(async _e=>{Ee.signal.aborted||(y(_e),_e.lastErrorCode==="REGISTRATION_UNCERTAIN"&&R(!0),_e.status==="BOUND"&&await H(Ee.signal))}).catch(_e=>{Ee.signal.aborted||G(_e)})},Math.max(1,v.pollAfterSeconds)*1e3);return()=>{window.clearTimeout(Qe),Ee.abort()}},[v,r,L,q,o]);async function se(Ee){var _e;if(V.current)return;const Qe=new AbortController;V.current=Qe,F(!0),_(""),(_e=Z.current)==null||_e.abort();try{await Ee(Qe.signal)}catch(ae){Qe.signal.aborted||G(ae)}finally{V.current===Qe&&(V.current=null,J.current&&F(!1))}}function Y(Ee=!1){se(async Qe=>{b(!0),Ee||y(null);const _e=await Yd(r,Ee&&v?`/${n}/bindings/${encodeURIComponent(v.id)}/retry`:`/${n}/bindings`,{method:"POST",body:"{}",signal:Qe});Qe.aborted||(y(_e),_e.lastErrorCode==="REGISTRATION_UNCERTAIN"&&R(!0),_e.status==="BOUND"&&await H(Qe))})}function X(){se(async Ee=>{b(!0),j(!1),C(!0),ne.current=!0;try{const Qe=await fnn(Ee);if(Ee.aborted)return;ne.current=!1,C(!1),await Yd(r,"/wecom/bindings",{method:"POST",body:JSON.stringify(Qe),signal:Ee}),Ee.aborted||(j(!0),k(""),x(""),await H(Ee))}finally{J.current&&!Ee.aborted&&(ne.current=!1,C(!1))}})}const ie=n==="wecom"||!!((Pe=c==null?void 0:c.credentialBindingChannels)!=null&&Pe.includes(n)),ee=!!v&&!Ej.has(v.status),be=L||M||T||ee,ue=M||L&&!S;function pe(Ee){var Qe,_e;Ee===o||M||V.current&&!ne.current||((Qe=V.current)==null||Qe.abort(),V.current=null,ne.current=!1,(_e=Z.current)==null||_e.abort(),F(!1),C(!1),y(null),b(!1),j(!1),x(""),k(""),_(""),l(Ee))}const ke=Ee=>{try{const Qe=new URL(Ee||"");return Qe.protocol==="https:"?Qe.href:void 0}catch{return}},je=n==="wecom"&&c&&a.jsxs(a.Fragment,{children:[a.jsx(Tt,{color:"primary",size:"sm",disabled:L||M||T||!c.bindingReady,onClick:X,children:i(d!=null&&d.configured?"channels.newQr":"channels.bind")}),S&&a.jsxs(a.Fragment,{children:[a.jsx("span",{role:"status",children:i("channels.wecomAuthorizing")}),a.jsx(Tt,{color:"secondary",variant:"outline",size:"sm",onClick:()=>{var Ee;(Ee=V.current)==null||Ee.abort(),ne.current=!1,C(!1)},children:i("channels.cancelAuthorization")})]})]});return a.jsxs("section",{className:"runtime-channels","aria-label":i(`channels.provider_${n}`),"aria-busy":M||L,children:[a.jsxs("div",{className:"runtime-channels-heading",children:[a.jsx("h3",{children:i("channels.providerBindingTitle",{name:i(`channels.provider_${n}`)})}),a.jsx(Tt,{color:"secondary",variant:"outline",size:"sm",disabled:L||M,onClick:()=>U(Ee=>Ee+1),children:i("channels.refresh")})]}),M&&a.jsx("p",{role:"status",children:a.jsx(hn,{children:i("channels.loading")})}),D&&a.jsxs("div",{className:"aw-integration-error",role:"alert",children:[a.jsx("span",{children:D}),a.jsx(Tt,{color:"secondary",variant:"outline",size:"sm",disabled:L||M,onClick:()=>U(Ee=>Ee+1),children:i("common.retry")})]}),c&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"runtime-channels-binding-summary",children:[a.jsx("span",{className:`runtime-channels-badge${d!=null&&d.configured?" is-bound":""}`,children:i(d!=null&&d.configured?"channels.connected":"channels.notBound")}),a.jsx("p",{children:d!=null&&d.configured?i("channels.bound",{name:d.appName||d.appId}):i("channels.providerUnbound",{name:i(`channels.provider_${n}`)})})]}),!c.bindingReady&&a.jsx("p",{role:"alert",children:i("channels.keyRequired")}),d&&a.jsxs("dl",{className:"runtime-channels-diagnostics",children:[a.jsx(O6,{label:i("channels.gateway"),value:i(d.gatewayConfigured?"channels.configured":"channels.missing"),complete:d.gatewayConfigured,description:i("channels.gatewayDescription")}),a.jsx(O6,{label:i("channels.route"),value:i(d.routeConfigured?"channels.configured":"channels.missing"),complete:d.routeConfigured,description:i("channels.routeDescription")}),a.jsx(O6,{label:i("channels.delivery"),value:i(`channels.delivery_${d.deliveryHealth}`,{defaultValue:i("channels.delivery_not_observed")}),complete:d.deliveryHealth==="delivered",description:i("channels.deliveryDescription")})]}),!!(d!=null&&d.missingConfiguration.length)&&a.jsx("p",{role:"alert",children:i("channels.missingConfig",{fields:d.missingConfiguration.join(", ")})}),a.jsxs("fieldset",{className:"runtime-channels-methods",children:[a.jsx("legend",{children:i("channels.configurationMethod")}),a.jsx("div",{children:["quick","manual"].map(Ee=>a.jsx(lnn,{name:`${s}-method`,value:Ee,checked:o===Ee,disabled:ue,label:a.jsx("span",{className:"runtime-channels-method-label","data-selected":o===Ee,children:i(`channels.${Ee}Setup`)}),onChange:()=>pe(Ee)},Ee))})]}),a.jsx("p",{children:i(o==="quick"?"channels.qrGuidance":"channels.manualGuidance",{name:i(`channels.provider_${n}`)})}),o==="manual"&&(d==null?void 0:d.configured)&&a.jsx("p",{children:i("channels.manualReplacement")}),o==="manual"&&!ie&&a.jsx("p",{children:i("channels.manualUpgrade",{name:i(`channels.provider_${n}`)})}),o==="manual"&&ie&&a.jsxs("form",{className:"runtime-channels-form","data-channel-binding":!0,onSubmit:Ee=>{Ee.preventDefault(),!(!w.trim()||!O.trim()||be||!c.bindingReady)&&se(async Qe=>{await Yd(r,n==="wecom"?"/wecom/bindings":`/${n}/bindings/manual`,{method:"POST",body:JSON.stringify(n==="wecom"?{botId:w.trim(),secret:O.trim()}:n==="feishu"?{appId:w.trim(),appSecret:O.trim()}:{clientId:w.trim(),clientSecret:O.trim()}),signal:Qe}),Qe.aborted||(k(""),x(""),await H(Qe))})},children:[a.jsxs("label",{children:[i(n==="wecom"?"channels.wecomBotId":n==="feishu"?"channels.feishuAppId":"channels.dingtalkClientId"),a.jsx("input",{name:n==="wecom"?"botId":n==="feishu"?"appId":"clientId",value:w,required:!0,autoComplete:"off",disabled:be,onChange:Ee=>x(Ee.target.value),onKeyDown:Ee=>{Ee.key==="Enter"&&(Ee.nativeEvent.isComposing||Ee.nativeEvent.keyCode===229)&&Ee.preventDefault()}})]}),a.jsxs("label",{children:[i(n==="wecom"?"channels.wecomSecret":n==="feishu"?"channels.feishuAppSecret":"channels.dingtalkClientSecret"),a.jsx("input",{name:"secret",type:"password",value:O,required:!0,autoComplete:"new-password",disabled:be,onChange:Ee=>k(Ee.target.value),onKeyDown:Ee=>{Ee.key==="Enter"&&(Ee.nativeEvent.isComposing||Ee.nativeEvent.keyCode===229)&&Ee.preventDefault()}})]}),a.jsx(Tt,{color:"primary",size:"sm",type:"submit",disabled:be||!c.bindingReady||!w.trim()||!O.trim()||T,children:i("channels.bindCredentials")})]}),T&&a.jsx("p",{role:"alert",children:i("channels.uncertain")}),a.jsxs("div",{className:"runtime-channels-actions",children:[o==="quick"&&je,o==="quick"&&n!=="wecom"&&a.jsx(Tt,{color:"primary",size:"sm",disabled:L||M||!c.bindingReady||T||!!v&&!Ej.has(v.status),onClick:()=>Y(),children:i(v||d!=null&&d.configured||g?"channels.newQr":"channels.bind")}),(d==null?void 0:d.configured)&&a.jsx(Tt,{color:"danger",variant:"outline",size:"sm",disabled:L,onClick:()=>{window.confirm(i("channels.confirmUnbind"))&&se(async Ee=>{await Yd(r,`?channel=${n}&appId=${encodeURIComponent(d.appId||"")}`,{method:"DELETE",signal:Ee}),Ee.aborted||(y(null),b(!1),j(!1),R(!1),await H(Ee))})},children:i("channels.unbind")})]}),o==="quick"&&(v||g)&&a.jsxs("div",{className:"runtime-channels-binding-progress",role:"status","aria-live":"polite",children:[a.jsx("h3",{children:i("channels.pairingTitle")}),n==="feishu"&&a.jsx("p",{children:i("channels.feishuPairingDescription")}),n==="wecom"&&a.jsx("p",{children:i("channels.wecomPairingDescription")}),n==="wecom"&&E&&a.jsx("p",{children:i("channels.status_BOUND")}),!v&&L&&a.jsx("p",{children:a.jsx(hn,{children:i(n==="wecom"?S?"channels.wecomAuthorizing":"channels.status_REGISTERING":"channels.generatingQr")})}),v&&a.jsxs(a.Fragment,{children:[v.status!=="PENDING"&&a.jsx("p",{children:i(`channels.status_${v.status}`)}),!Ej.has(v.status)&&a.jsx(a.Fragment,{children:ke(v.qrCodeImage)&&a.jsx("img",{className:"runtime-channels-qr",src:ke(v.qrCodeImage),alt:i("channels.qrAlt"),referrerPolicy:"no-referrer"})}),v.lastErrorCode&&a.jsx("p",{children:v.lastErrorCode==="REGISTRATION_UNCERTAIN"?i("channels.uncertain"):i("channels.bindingFailed")}),v.status==="FAILED"&&v.lastErrorCode!=="REGISTRATION_UNCERTAIN"&&a.jsx(Tt,{color:"secondary",variant:"outline",size:"sm",disabled:L,onClick:()=>Y(!0),children:i("common.retry")})]})]}),n==="feishu"&&a.jsxs("section",{className:"runtime-channels-permissions","aria-label":i("channels.groupsTitle"),children:[a.jsxs("div",{className:"runtime-channels-heading",children:[a.jsx("h3",{children:i("channels.groupsTitle")}),a.jsx("span",{className:"runtime-channels-count",children:h.length})]}),a.jsx("p",{children:i("channels.groupsDescription")}),a.jsxs("form",{className:"runtime-channels-form",onSubmit:Ee=>{Ee.preventDefault(),!(!A.trim()||L)&&se(async Qe=>{await Yd(r,"/chat-permissions",{method:"POST",body:JSON.stringify({channel:n,chatId:A.trim(),groupSessionScope:P}),signal:Qe}),Qe.aborted||(N(""),await H(Qe))})},children:[a.jsxs("label",{children:[i("channels.chatId"),a.jsx("input",{value:A,required:!0,disabled:L,onChange:Ee=>N(Ee.target.value),onKeyDown:Ee=>{Ee.key==="Enter"&&(Ee.nativeEvent.isComposing||Ee.nativeEvent.keyCode===229)&&Ee.preventDefault()}})]}),a.jsxs("label",{children:[i("channels.scope"),a.jsx(G9e,{style:{width:"100%",minWidth:0,background:"hsl(var(--background))",color:"hsl(var(--foreground))",border:"1px solid hsl(var(--border))"},value:P,disabled:L,options:pnn.map(Ee=>({value:Ee,label:i(`channels.scope_${Ee}`)})),onChange:Ee=>I(Ee.target.value)})]}),a.jsx(Tt,{color:"primary",size:"sm",type:"submit",disabled:L||!A.trim(),children:i("channels.saveGroup")})]}),!h.length&&a.jsx("p",{className:"runtime-channels-empty",children:i("channels.noGroups")}),a.jsx("ul",{className:"runtime-channels-groups",children:h.map(Ee=>a.jsxs("li",{children:[a.jsxs("span",{children:[Ee.chatName||Ee.chatId," ·"," ",i(`channels.scope_${Ee.groupSessionScope||"group"}`)]}),a.jsx(Tt,{color:"danger",variant:"ghost",size:"sm",className:"runtime-channels-remove-group",disabled:L,"aria-label":i("channels.removeGroup",{name:Ee.chatName||Ee.chatId}),onClick:()=>void se(async Qe=>{await Yd(r,`/chat-permissions?channel=${n}&chat_id=${encodeURIComponent(Ee.chatId)}`,{method:"DELETE",signal:Qe}),await H(Qe)}),children:a.jsx(mT,{})})]},Ee.chatId))})]})]})]})}const Pk=e=>`${e.region}:${e.runtimeId}`;function gnn({role:e,runtimeScope:t,onBack:n}){const{t:i}=Te("automations"),r=e==="admin"||e==="super_admin";return a.jsxs("div",{className:"mpa-channels-page",children:[a.jsxs("header",{className:"mpa-channels-header",children:[a.jsx("button",{type:"button",className:"mpa-channels-back","aria-label":i("backToAutomations"),onClick:n,children:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"m14 6-6 6 6 6"})})}),a.jsx(B9e,{className:"mpa-channels-icon"}),a.jsxs("div",{children:[a.jsx("h1",{children:i("cards.mpa-channels.name")}),a.jsx("p",{children:i("cards.mpa-channels.description")})]})]}),a.jsx("div",{className:"mpa-channels-scroll",children:r?a.jsx(bnn,{runtimeScope:t},`${e}:${t}`):a.jsx("p",{className:"mpa-channels-notice",role:"status",children:i("mpaChannels.unauthorized")})})]})}function bnn({runtimeScope:e}){const{t,i18n:n}=Te("automations"),[i,r]=p.useState([]),[s,o]=p.useState(""),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(!0),[m,g]=p.useState(!1),[b,v]=p.useState(null),y=p.useRef(null),w=p.useRef("");async function x(C=""){var j;(j=y.current)==null||j.abort();const E=new AbortController;y.current=E,h(!0),v(null),w.current=C;try{const T=await F0({agentCategory:"mpa",scope:e,region:"all",pageSize:100,nextToken:C||void 0,signal:E.signal});if(E.signal.aborted)return;const R=T.runtimes.filter(A=>A.runtimeId&&A.region&&(A.agentCategory==="mpa"||A.agentCategory===void 0));r(A=>[...new Map((C?[...A,...R]:R).map(N=>[Pk(N),N])).values()]),C||o(A=>R.some(N=>Pk(N)===A)?A:""),d(T.nextToken),g(!0)}catch(T){if(E.signal.aborted)return;const R=T instanceof RD&&(T.status===401||T.status===403);v(R?"unauthorized":"loadFailed"),R&&(r([]),o(""),d(""),g(!1),w.current="")}finally{E.signal.aborted||h(!1)}}p.useEffect(()=>(x(),()=>{var C;return(C=y.current)==null?void 0:C.abort()}),[]);const O=i.find(C=>Pk(C)===s),k=l.trim().toLocaleLowerCase(),S=i.filter(C=>`${C.name} ${C.runtimeId} ${C.region}`.toLocaleLowerCase().includes(k)).map(C=>{var j,T;const E=PT(C.createdAt,Date.now(),n.resolvedLanguage||n.language);return{value:Pk(C),label:C.name||C.runtimeId,description:((j=C.description)==null?void 0:j.trim())||t("mpaChannels.noDescription"),metadata:`${t("mpaChannels.optionMetadata",{creator:((T=C.author)==null?void 0:T.trim())||t("mpaChannels.unknownCreator"),createdAt:E})} -${C.region} · ${C.runtimeId}`}});return a.jsxs("div",{className:"mpa-channels-content",children:[a.jsxs("section",{className:"mpa-channels-picker","aria-label":t("mpaChannels.selectAgent"),children:[a.jsxs("div",{className:"mpa-channels-picker-heading",children:[a.jsx("h2",{children:t("mpaChannels.selectAgent")}),a.jsx("button",{type:"button",className:"mpa-channels-action",disabled:f,onClick:()=>void x(),children:t("mpaChannels.refresh")})]}),a.jsx(xf,{ariaLabel:t("mpaChannels.selectAgent"),placeholder:t("mpaChannels.chooseAgent"),value:s,valueLabel:(O==null?void 0:O.name)||(O==null?void 0:O.runtimeId),options:S,disabled:!i.length,searchValue:l,searchPlaceholder:t("mpaChannels.search"),emptyMessage:t("mpaChannels.noMatches"),onSearchChange:c,onChange:o}),O&&a.jsxs("p",{className:"mpa-channels-target",children:[O.region," · ",O.runtimeId]}),f&&a.jsx(hn,{as:"p",role:"status",children:t("mpaChannels.loading")}),b&&a.jsxs("div",{className:"mpa-channels-error",role:"alert",children:[a.jsx("p",{children:t(`mpaChannels.${b}`)}),a.jsx("button",{type:"button",className:"mpa-channels-action",onClick:()=>void x(w.current),children:t("mpaChannels.retry")})]}),!f&&!b&&m&&!i.length&&!u&&a.jsx("p",{role:"status",children:t("mpaChannels.empty")}),u&&a.jsxs("div",{className:"mpa-channels-pagination",children:[a.jsx("p",{children:t("mpaChannels.moreAvailable")}),a.jsx("button",{type:"button",className:"mpa-channels-action",disabled:f,onClick:()=>void x(u),children:t("mpaChannels.loadMore")})]})]}),O?a.jsx(hnn,{runtimeId:O.runtimeId,region:O.region,showHeader:!1},Pk(O)):m&&i.length>0?a.jsx("p",{className:"mpa-channels-notice",role:"status",children:t("mpaChannels.chooseHint")}):null]})}async function AK(e,t){const n=await e.json().catch(()=>null),i=typeof(n==null?void 0:n.detail)=="string"?n.detail:"";return new Error(i||Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}))}async function ynn(e){const t=await vn("/web/website-integrations",{cache:"no-store",signal:e});if(!t.ok)throw await AK(t,Q("websiteIntegration.listFailed"));return(await t.json()).integrations??[]}async function vnn(e){const t=await vn("/web/website-integrations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await AK(t,Q("websiteIntegration.createFailed"));return t.json()}async function xnn(e){const t=await vn(`/web/website-integrations/${encodeURIComponent(e)}`,{method:"DELETE"});if(!t.ok)throw await AK(t,Q("websiteIntegration.deleteFailed"))}function wnn(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"m9.8 3.5-4.5 4.5 4.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ole(e){return a.jsxs("svg",{viewBox:"0 0 32 32",fill:"none","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"5",width:"20",height:"17",rx:"3.5",stroke:"currentColor",strokeWidth:"1.5"}),a.jsx("path",{d:"M4.5 10h18M8.5 7.5h.1M11.5 7.5h.1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),a.jsx("path",{d:"M17 18.5a5 5 0 0 1 5-5h1.5a5 5 0 0 1 5 5V23a5 5 0 0 1-5 5H22l-3.5 2.5v-3.3A5 5 0 0 1 17 23v-4.5Z",fill:"hsl(var(--background))",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),a.jsx("path",{d:"M21 19h4M21 22.5h3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function Onn(e,t){const n=new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleString(t,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}async function knn(e){const t=[];let n="";for(let i=0;i<10;i+=1){const r=await F0({nextToken:n||void 0,pageSize:100,region:"all",scope:"all"});if(e.aborted)return[];if(t.push(...r.runtimes),n=r.nextToken,!n)break}return t}function Snn({onBack:e}){const{t,i18n:n}=Te("websiteIntegration"),[i,r]=p.useState([]),[s,o]=p.useState([]),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(""),[m,g]=p.useState(!0),[b,v]=p.useState(!1),[y,w]=p.useState(""),[x,O]=p.useState("");p.useEffect(()=>{const R=new AbortController;return g(!0),O(""),Promise.all([ynn(R.signal),knn(R.signal)]).then(([A,N])=>{var I;if(R.signal.aborted)return;r(A),o(N),d(((I=A[0])==null?void 0:I.id)??"");const P=N[0];P&&c(`${P.region}::${P.runtimeId}`)}).catch(A=>{R.signal.aborted||O(A instanceof Error?A.message:t("errors.load"))}).finally(()=>{R.signal.aborted||g(!1)}),()=>R.abort()},[t]);const k=p.useMemo(()=>s.map(R=>({value:`${R.region}::${R.runtimeId}`,label:R.name||R.runtimeId,description:`${R.region} · ${R.status}`,runtime:R})),[s]),S=p.useMemo(()=>new Map(k.map(R=>[R.value,R.runtime])),[k]),C=i.find(R=>R.id===u)??i[0],E=C?` + From 5644e146c9dfff6d2e290b1663cb2ea41dbb6b91 Mon Sep 17 00:00:00 2001 From: "zhangmengqiu.zmq" Date: Sat, 10 Oct 2026 14:04:18 +0800 Subject: [PATCH 3/5] feat(studio): add multi-bot channels and account Ark key discovery Resolve existing Ark model keys with deployment credentials and select the newest eligible key by creation time. Add capability-gated Feishu bot account management and scheduled-task delivery selection, retaining legacy single-bot behavior. Include bilingual contracts, regression tests, the current lockfile changes, and rebuilt Studio assets. Pre-commit, Pyright and frontend gates pass. The Python repository regression has 6933 passing tests and one Markdown MIME failure reproduced on the unmodified baseline; record the result in the paired designs. --- frontend/README.md | 24 + frontend/package-lock.json | 512 -------------- frontend/src/adk/client.ts | 6 +- frontend/src/adk/feishuAccounts.ts | 44 ++ frontend/src/cronjobs/MpaCronTasks.tsx | 1 + frontend/src/cronjobs/MpaTaskEditor.tsx | 133 +++- .../src/i18n/resources/en-US/cronjobs.json | 9 +- frontend/src/i18n/resources/en-US/ui.json | 15 +- .../src/i18n/resources/zh-CN/cronjobs.json | 9 +- frontend/src/i18n/resources/zh-CN/ui.json | 15 +- frontend/src/ui/FeishuAccounts.tsx | 232 +++++++ frontend/src/ui/RuntimeChannels.css | 20 + frontend/src/ui/RuntimeChannels.tsx | 475 +++++++------ frontend/tests/feishuAccounts.test.ts | 66 ++ frontend/tests/mpaTaskBots.test.tsx | 325 +++++++++ frontend/tests/runtimeChannels.test.tsx | 333 ++++++++- frontend/vitest.mpa-cron.config.ts | 6 +- .../2026-10-09-studio-multi-bot.md | 81 +++ .../2026-10-09-studio-multi-bot.zh.md | 81 +++ .../2026-10-10-port-multi-bot.md | 72 ++ .../2026-10-10-port-multi-bot.zh.md | 72 ++ .../2026-10-10-account-ark-key.md | 69 ++ .../2026-10-10-account-ark-key.zh.md | 69 ++ .../2026-10-10-latest-created-key.md | 64 ++ .../2026-10-10-latest-created-key.zh.md | 64 ++ specs/mpa-channels/README.md | 7 + specs/mpa-channels/README.zh.md | 7 + specs/studio-mpa-creation/README.md | 6 +- specs/studio-mpa-creation/README.zh.md | 6 +- specs/studio-mpa-cron-tasks/README.md | 7 +- specs/studio-mpa-cron-tasks/README.zh.md | 7 +- tests/integrations/mpa_managed/test_config.py | 10 +- tests/integrations/mpa_managed/test_iam.py | 18 +- .../mpa_managed/test_model_key.py | 467 +++++++++++++ tests/integrations/mpa_managed/test_routes.py | 11 +- .../integrations/mpa_managed/test_service.py | 7 +- .../test_studio_shared_resources.py | 37 +- veadk/integrations/mpa/managed/README.md | 22 +- veadk/integrations/mpa/managed/README.zh.md | 22 +- veadk/integrations/mpa/managed/config.py | 42 ++ veadk/integrations/mpa/managed/diagnostics.py | 2 + veadk/integrations/mpa/managed/model_key.py | 234 +++++++ veadk/integrations/mpa/managed/service.py | 2 + .../mpa/managed/studio_profile.py | 10 +- .../{index-jtZg_8XU.js => index-Djxxd5-6.js} | 638 +++++++++--------- ...D2VDIxmZ.js => CodeDiffEditor-2mGXDZcj.js} | 2 +- ..._APa.js => FileExplorerEditor-DU76fuU3.js} | 2 +- ...c3.js => MarkdownPromptEditor-DC-LvA9l.js} | 2 +- ....js => QuickAgentCreateDialog-BDjHgo6h.js} | 2 +- .../{arc-Dh1q-Cov.js => arc-DdYsJafX.js} | 2 +- ...hannel-n7jAGeRv.js => channel-BJ4cgerF.js} | 2 +- ...ex.es-B2y5CdTP.js => index.es-DJ1yvv7D.js} | 2 +- ...n-DBgeOZkt.js => jspdf.es.min-Cv2aSRRE.js} | 6 +- ...{linear-CmKnLfjh.js => linear-DCiqxKKj.js} | 2 +- ...{index-_lutWX9f.css => index-T7Apyky7.css} | 2 +- ...pP.js => abnfDiagram-N423BO3Z-BMYLL6y1.js} | 2 +- ... architectureDiagram-T3A2C74G-BYtAu2kQ.js} | 2 +- ...A.js => blockDiagram-VBNYF7ZC-CuJEX67y.js} | 2 +- ...Ugte.js => c4Diagram-5PPSVZJV-DTNYQaFR.js} | 2 +- ...CZ3iGqBw.js => chunk-2GRJ4B5K-DVigIiB1.js} | 2 +- ...CfoLV4Wi.js => chunk-2Q5K7J3B-bNgRmewe.js} | 2 +- ...DuY5TvDd.js => chunk-5RXB4S5H-DFE6wckU.js} | 2 +- ...50_HOHQj.js => chunk-5VM5RSS4-CgRpFncl.js} | 2 +- ...ClReq2Qj.js => chunk-6Q2QTUOP-DE8UpuKY.js} | 2 +- ...D2O4F1UQ.js => chunk-GF5L2VYU-CbACP9V4.js} | 2 +- ...CuSd-btN.js => chunk-JWPE2WC7-ClXuzEQk.js} | 2 +- ...BHhhNQ3Y.js => chunk-KBJHAD2P-DMzKyXpN.js} | 2 +- ...Xs0pM-1G.js => chunk-RYQCIY6F-DCh12h03.js} | 2 +- ...BGNj7SfA.js => chunk-XXDRQBXY-wn9IfPq9.js} | 2 +- .../mermaid/classDiagram-JCYQIIEL-DPu-vvln.js | 1 + .../mermaid/classDiagram-JCYQIIEL-DbiEGGzY.js | 1 - .../classDiagram-v2-OCEON4UE-DPu-vvln.js | 1 + .../classDiagram-v2-OCEON4UE-DbiEGGzY.js | 1 - ...X.js => cose-bilkent-JH36ORCC-Dv12PbG5.js} | 2 +- ...oHetdH.js => cynefin-OW5HDTMX-D8uWD4o5.js} | 2 +- ...js => cynefinDiagram-MW4NZA55-DVSBOcOr.js} | 2 +- ...DhyY5n-H.js => dagre-VZM6K2ZE-B6BfkqqY.js} | 2 +- ...smJiOn.js => diagram-7IWD3JNH-BuuarRCR.js} | 2 +- ...Tx9QJi.js => diagram-B4RE2ZJO-DIReKMiI.js} | 2 +- ...cr0gHH.js => diagram-LBJQPF4R-C_tB4Cta.js} | 2 +- ...ikG6c2.js => diagram-Q27KOJAE-4HhZAMIw.js} | 2 +- ...p248Pc.js => diagram-UB23O5K3-DqLebdvG.js} | 2 +- ...Jk.js => ebnfDiagram-BXEA7PRR-B4iZkk2U.js} | 2 +- ...aMkY.js => erDiagram-JOGREHBK-t9NEK9Hg.js} | 2 +- ...Vz.js => flowDiagram-UKHOOZJN-DraWW3gI.js} | 2 +- ...E.js => ganttDiagram-PKOTCBZU-DX5ZND82.js} | 2 +- ...s => gitGraphDiagram-DS77QQ5N-467I1PmL.js} | 2 +- ...S4.js => infoDiagram-6WML65LV-BBYK-cYM.js} | 2 +- ...s => ishikawaDiagram-WSZJBQD7-C9qfY6lB.js} | 2 +- ...js => journeyDiagram-NVQOT4AX-CSbB9UN0.js} | 2 +- ...=> kanban-definition-27J2QSJJ-Deby2slT.js} | 2 +- ...e-Vsbm7qIM.js => mermaid.core-CgV8Rw9c.js} | 8 +- ...> mindmap-definition-FAOFIHXS-CuaRzmUt.js} | 2 +- ...-ba.js => pegDiagram-VL7TDLO6-zvEgQSje.js} | 2 +- ...BCA.js => pieDiagram-7S7Q4E2Y-D9sGiLdj.js} | 2 +- ...s => quadrantDiagram-CIZ2JOQS-DNx35DHe.js} | 2 +- ...s => railroadDiagram-AXF67PYL-DWqWcScv.js} | 2 +- ...> requirementDiagram-LRYGKXZP-Dsa3hG3G.js} | 2 +- ....js => sankeyDiagram-W5VNT64P-DD2hnmxH.js} | 2 +- ...s => sequenceDiagram-SI44F4Z6-N3MGxJM2.js} | 2 +- ...Ar.js => sizeCapture-X5ZJPWSS-HrXfOyVz.js} | 2 +- ...v.js => stateDiagram-OKZ733FA-BZXqsJ9i.js} | 2 +- .../stateDiagram-v2-UEYNNEHI-DfMjOWWe.js | 1 - .../stateDiagram-v2-UEYNNEHI-HWzGwZhJ.js | 1 + ...Qxfk.js => swimlanes-SLNWSIFB-BmU_H9aV.js} | 4 +- .../swimlanesDiagram-ULZ7WXOC-D3cnA72s.js | 8 - .../swimlanesDiagram-ULZ7WXOC-Dk4f75vA.js | 8 + ... timeline-definition-Z64GVDOM-B3DCr6LN.js} | 2 +- ...pK.js => vennDiagram-T6HMQDX7-Eu0N_XqZ.js} | 2 +- ...js => wardleyDiagram-T6FBY63Y-DPwaQxTd.js} | 2 +- ...js => xychartDiagram-ELKLHX3M-C64h7728.js} | 2 +- veadk/webui/index.html | 4 +- veadk/webui/website-integration.js | 8 +- 113 files changed, 3366 insertions(+), 1155 deletions(-) create mode 100644 frontend/src/adk/feishuAccounts.ts create mode 100644 frontend/src/ui/FeishuAccounts.tsx create mode 100644 frontend/tests/feishuAccounts.test.ts create mode 100644 frontend/tests/mpaTaskBots.test.tsx create mode 100644 prd-spec/features/mpa-feishu-multi-bot/2026-10-09-studio-multi-bot.md create mode 100644 prd-spec/features/mpa-feishu-multi-bot/2026-10-09-studio-multi-bot.zh.md create mode 100644 prd-spec/features/mpa-feishu-multi-bot/2026-10-10-port-multi-bot.md create mode 100644 prd-spec/features/mpa-feishu-multi-bot/2026-10-10-port-multi-bot.zh.md create mode 100644 prd-spec/features/mpa-model-key-discovery/2026-10-10-account-ark-key.md create mode 100644 prd-spec/features/mpa-model-key-discovery/2026-10-10-account-ark-key.zh.md create mode 100644 prd-spec/features/mpa-model-key-discovery/2026-10-10-latest-created-key.md create mode 100644 prd-spec/features/mpa-model-key-discovery/2026-10-10-latest-created-key.zh.md create mode 100644 tests/integrations/mpa_managed/test_model_key.py create mode 100644 veadk/integrations/mpa/managed/model_key.py rename veadk/webui/assets/app/{index-jtZg_8XU.js => index-Djxxd5-6.js} (60%) rename veadk/webui/assets/chunks/{CodeDiffEditor-D2VDIxmZ.js => CodeDiffEditor-2mGXDZcj.js} (99%) rename veadk/webui/assets/chunks/{FileExplorerEditor-Cx6O_APa.js => FileExplorerEditor-DU76fuU3.js} (96%) rename veadk/webui/assets/chunks/{MarkdownPromptEditor-Di8dSDc3.js => MarkdownPromptEditor-DC-LvA9l.js} (99%) rename veadk/webui/assets/chunks/{QuickAgentCreateDialog-BoukSlN9.js => QuickAgentCreateDialog-BDjHgo6h.js} (97%) rename veadk/webui/assets/chunks/{arc-Dh1q-Cov.js => arc-DdYsJafX.js} (98%) rename veadk/webui/assets/chunks/{channel-n7jAGeRv.js => channel-BJ4cgerF.js} (53%) rename veadk/webui/assets/chunks/{index.es-B2y5CdTP.js => index.es-DJ1yvv7D.js} (99%) rename veadk/webui/assets/chunks/{jspdf.es.min-DBgeOZkt.js => jspdf.es.min-Cv2aSRRE.js} (99%) rename veadk/webui/assets/chunks/{linear-CmKnLfjh.js => linear-DCiqxKKj.js} (98%) rename veadk/webui/assets/styles/{index-_lutWX9f.css => index-T7Apyky7.css} (61%) rename veadk/webui/assets/visualizations/mermaid/{abnfDiagram-N423BO3Z-VjeGAIpP.js => abnfDiagram-N423BO3Z-BMYLL6y1.js} (86%) rename veadk/webui/assets/visualizations/mermaid/{architectureDiagram-T3A2C74G-CJxmnYsE.js => architectureDiagram-T3A2C74G-BYtAu2kQ.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{blockDiagram-VBNYF7ZC-C52T76KA.js => blockDiagram-VBNYF7ZC-CuJEX67y.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{c4Diagram-5PPSVZJV-hZ7YUgte.js => c4Diagram-5PPSVZJV-DTNYQaFR.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{chunk-2GRJ4B5K-CZ3iGqBw.js => chunk-2GRJ4B5K-DVigIiB1.js} (93%) rename veadk/webui/assets/visualizations/mermaid/{chunk-2Q5K7J3B-CfoLV4Wi.js => chunk-2Q5K7J3B-bNgRmewe.js} (66%) rename veadk/webui/assets/visualizations/mermaid/{chunk-5RXB4S5H-DuY5TvDd.js => chunk-5RXB4S5H-DFE6wckU.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{chunk-5VM5RSS4-50_HOHQj.js => chunk-5VM5RSS4-CgRpFncl.js} (83%) rename veadk/webui/assets/visualizations/mermaid/{chunk-6Q2QTUOP-ClReq2Qj.js => chunk-6Q2QTUOP-DE8UpuKY.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{chunk-GF5L2VYU-D2O4F1UQ.js => chunk-GF5L2VYU-CbACP9V4.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{chunk-JWPE2WC7-CuSd-btN.js => chunk-JWPE2WC7-ClXuzEQk.js} (78%) rename veadk/webui/assets/visualizations/mermaid/{chunk-KBJHAD2P-BHhhNQ3Y.js => chunk-KBJHAD2P-DMzKyXpN.js} (87%) rename veadk/webui/assets/visualizations/mermaid/{chunk-RYQCIY6F-Xs0pM-1G.js => chunk-RYQCIY6F-DCh12h03.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{chunk-XXDRQBXY-BGNj7SfA.js => chunk-XXDRQBXY-wn9IfPq9.js} (53%) create mode 100644 veadk/webui/assets/visualizations/mermaid/classDiagram-JCYQIIEL-DPu-vvln.js delete mode 100644 veadk/webui/assets/visualizations/mermaid/classDiagram-JCYQIIEL-DbiEGGzY.js create mode 100644 veadk/webui/assets/visualizations/mermaid/classDiagram-v2-OCEON4UE-DPu-vvln.js delete mode 100644 veadk/webui/assets/visualizations/mermaid/classDiagram-v2-OCEON4UE-DbiEGGzY.js rename veadk/webui/assets/visualizations/mermaid/{cose-bilkent-JH36ORCC-Drvrc5vX.js => cose-bilkent-JH36ORCC-Dv12PbG5.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{cynefin-OW5HDTMX-cToHetdH.js => cynefin-OW5HDTMX-D8uWD4o5.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{cynefinDiagram-MW4NZA55-BoSvLTRo.js => cynefinDiagram-MW4NZA55-DVSBOcOr.js} (98%) rename veadk/webui/assets/visualizations/mermaid/{dagre-VZM6K2ZE-DhyY5n-H.js => dagre-VZM6K2ZE-B6BfkqqY.js} (97%) rename veadk/webui/assets/visualizations/mermaid/{diagram-7IWD3JNH-BOsmJiOn.js => diagram-7IWD3JNH-BuuarRCR.js} (96%) rename veadk/webui/assets/visualizations/mermaid/{diagram-B4RE2ZJO-BfTx9QJi.js => diagram-B4RE2ZJO-DIReKMiI.js} (97%) rename veadk/webui/assets/visualizations/mermaid/{diagram-LBJQPF4R-Ducr0gHH.js => diagram-LBJQPF4R-C_tB4Cta.js} (94%) rename veadk/webui/assets/visualizations/mermaid/{diagram-Q27KOJAE-XsikG6c2.js => diagram-Q27KOJAE-4HhZAMIw.js} (98%) rename veadk/webui/assets/visualizations/mermaid/{diagram-UB23O5K3-Drp248Pc.js => diagram-UB23O5K3-DqLebdvG.js} (95%) rename veadk/webui/assets/visualizations/mermaid/{ebnfDiagram-BXEA7PRR-DWq2vZJk.js => ebnfDiagram-BXEA7PRR-B4iZkk2U.js} (87%) rename veadk/webui/assets/visualizations/mermaid/{erDiagram-JOGREHBK-DFz9aMkY.js => erDiagram-JOGREHBK-t9NEK9Hg.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{flowDiagram-UKHOOZJN-DP4Qo4Vz.js => flowDiagram-UKHOOZJN-DraWW3gI.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{ganttDiagram-PKOTCBZU-F09GqxyE.js => ganttDiagram-PKOTCBZU-DX5ZND82.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{gitGraphDiagram-DS77QQ5N-CUBmjt-p.js => gitGraphDiagram-DS77QQ5N-467I1PmL.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{infoDiagram-6WML65LV-qWBimhS4.js => infoDiagram-6WML65LV-BBYK-cYM.js} (69%) rename veadk/webui/assets/visualizations/mermaid/{ishikawaDiagram-WSZJBQD7-CrZ4cgvz.js => ishikawaDiagram-WSZJBQD7-C9qfY6lB.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{journeyDiagram-NVQOT4AX-MW2hy2ZU.js => journeyDiagram-NVQOT4AX-CSbB9UN0.js} (98%) rename veadk/webui/assets/visualizations/mermaid/{kanban-definition-27J2QSJJ-CyCq3slw.js => kanban-definition-27J2QSJJ-Deby2slT.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{mermaid.core-Vsbm7qIM.js => mermaid.core-CgV8Rw9c.js} (98%) rename veadk/webui/assets/visualizations/mermaid/{mindmap-definition-FAOFIHXS-CfaFJV2O.js => mindmap-definition-FAOFIHXS-CuaRzmUt.js} (98%) rename veadk/webui/assets/visualizations/mermaid/{pegDiagram-VL7TDLO6-hA9oZ-ba.js => pegDiagram-VL7TDLO6-zvEgQSje.js} (87%) rename veadk/webui/assets/visualizations/mermaid/{pieDiagram-7S7Q4E2Y-wYtjUBCA.js => pieDiagram-7S7Q4E2Y-D9sGiLdj.js} (96%) rename veadk/webui/assets/visualizations/mermaid/{quadrantDiagram-CIZ2JOQS--OyFExdO.js => quadrantDiagram-CIZ2JOQS-DNx35DHe.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{railroadDiagram-AXF67PYL-C_-pSdka.js => railroadDiagram-AXF67PYL-DWqWcScv.js} (84%) rename veadk/webui/assets/visualizations/mermaid/{requirementDiagram-LRYGKXZP-BC5x5XNG.js => requirementDiagram-LRYGKXZP-Dsa3hG3G.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{sankeyDiagram-W5VNT64P-Cc3BdkXH.js => sankeyDiagram-W5VNT64P-DD2hnmxH.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{sequenceDiagram-SI44F4Z6-DMLFvnQy.js => sequenceDiagram-SI44F4Z6-N3MGxJM2.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{sizeCapture-X5ZJPWSS-BG8F8bAr.js => sizeCapture-X5ZJPWSS-HrXfOyVz.js} (87%) rename veadk/webui/assets/visualizations/mermaid/{stateDiagram-OKZ733FA-Du5x3Nhv.js => stateDiagram-OKZ733FA-BZXqsJ9i.js} (96%) delete mode 100644 veadk/webui/assets/visualizations/mermaid/stateDiagram-v2-UEYNNEHI-DfMjOWWe.js create mode 100644 veadk/webui/assets/visualizations/mermaid/stateDiagram-v2-UEYNNEHI-HWzGwZhJ.js rename veadk/webui/assets/visualizations/mermaid/{swimlanes-SLNWSIFB-DLoWQxfk.js => swimlanes-SLNWSIFB-BmU_H9aV.js} (99%) delete mode 100644 veadk/webui/assets/visualizations/mermaid/swimlanesDiagram-ULZ7WXOC-D3cnA72s.js create mode 100644 veadk/webui/assets/visualizations/mermaid/swimlanesDiagram-ULZ7WXOC-Dk4f75vA.js rename veadk/webui/assets/visualizations/mermaid/{timeline-definition-Z64GVDOM-MB1o13Ec.js => timeline-definition-Z64GVDOM-B3DCr6LN.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{vennDiagram-T6HMQDX7-BzhIpzpK.js => vennDiagram-T6HMQDX7-Eu0N_XqZ.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{wardleyDiagram-T6FBY63Y-CJYIwFNe.js => wardleyDiagram-T6FBY63Y-DPwaQxTd.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{xychartDiagram-ELKLHX3M-CvqRo8G_.js => xychartDiagram-ELKLHX3M-C64h7728.js} (99%) diff --git a/frontend/README.md b/frontend/README.md index 67d811ad3..c2af4d69b 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -1828,3 +1828,27 @@ MPA 名称校验使用主题错误色显示非法输入及错误提示,并提 MPA Agent details currently expose only Basic information. Other tabs and the Profile configuration action are hidden; this page does not query Profile status or submit Profile operations. General Agent pages and chat session protocols are unchanged. MPA 智能体详情当前仅显示基本信息。其他页面及 Profile 配置操作隐藏;本页不查询 Profile 状态或提交 Profile 操作。普通智能体页面与聊天会话协议保持不变。 + +### MPA Feishu multi-bot accounts / MPA 飞书多机器人 + +Runtimes advertising `multiBotChannels: ["feishu"]` expose a robot selector in +Automations → Messaging channels → MPA agent messaging channels. Add bots with +QR or manual binding, then manage enablement, unbinding, diagnostics and group +permissions for the selected `appId`. Adding a different bot preserves existing +accounts. Feishu scheduled tasks select an enabled delivery bot; switching to +Web delivery removes `delivery.appId`. Channel management requires Studio +administrator access. A failed or unauthorized account lookup blocks Feishu +task submission instead of selecting an arbitrary bot. Older runtimes keep the +single-bot interface. Compatible MPA images must be deployed separately. + +Runtime 声明 `multiBotChannels: ["feishu"]` 后,可在“自动化 → 消息渠道 → +MPA 智能体消息渠道”中选择机器人。扫码或手动添加后,启停、解绑、诊断和群权限 +均按选中的 `appId` 管理;新增不同机器人保留既有绑定。飞书定时任务须选择已启用 +的投递机器人,切换 Web 投递会清除 `delivery.appId`。渠道管理需要 Studio 管理员 +权限;账号读取失败或无权限时阻止飞书任务提交,不任意选择机器人。旧 Runtime +保持单机器人界面,兼容的 MPA 镜像需另行部署。 + +Contracts and verification / 契约与验证: +[channels](../specs/mpa-channels/README.md), +[tasks](../specs/studio-mpa-cron-tasks/README.md), +[design](../prd-spec/features/mpa-feishu-multi-bot/2026-10-09-studio-multi-bot.md). diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 35df7cda4..0ee09cba8 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1312,24 +1312,6 @@ "node": ">=12" } }, - "node_modules/@esbuild/netbsd-arm64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.2.tgz", - "integrity": "sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "peer": true, - "engines": { - "node": ">=18" - } - }, "node_modules/@esbuild/netbsd-x64": { "version": "0.21.5", "resolved": "https://registry.npmmirror.com/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", @@ -1347,24 +1329,6 @@ "node": ">=12" } }, - "node_modules/@esbuild/openbsd-arm64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.2.tgz", - "integrity": "sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "peer": true, - "engines": { - "node": ">=18" - } - }, "node_modules/@esbuild/openbsd-x64": { "version": "0.21.5", "resolved": "https://registry.npmmirror.com/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", @@ -1382,24 +1346,6 @@ "node": ">=12" } }, - "node_modules/@esbuild/openharmony-arm64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.2.tgz", - "integrity": "sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openharmony" - ], - "peer": true, - "engines": { - "node": ">=18" - } - }, "node_modules/@esbuild/sunos-x64": { "version": "0.21.5", "resolved": "https://registry.npmmirror.com/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", @@ -11409,420 +11355,6 @@ } } }, - "node_modules/vitest/node_modules/@esbuild/aix-ppc64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.2.tgz", - "integrity": "sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "aix" - ], - "peer": true, - "engines": { - "node": ">=18" - } - }, - "node_modules/vitest/node_modules/@esbuild/android-arm": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.2.tgz", - "integrity": "sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "peer": true, - "engines": { - "node": ">=18" - } - }, - "node_modules/vitest/node_modules/@esbuild/android-arm64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.2.tgz", - "integrity": "sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "peer": true, - "engines": { - "node": ">=18" - } - }, - "node_modules/vitest/node_modules/@esbuild/android-x64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.2.tgz", - "integrity": "sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "peer": true, - "engines": { - "node": ">=18" - } - }, - "node_modules/vitest/node_modules/@esbuild/darwin-arm64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.2.tgz", - "integrity": "sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "peer": true, - "engines": { - "node": ">=18" - } - }, - "node_modules/vitest/node_modules/@esbuild/darwin-x64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.2.tgz", - "integrity": "sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "peer": true, - "engines": { - "node": ">=18" - } - }, - "node_modules/vitest/node_modules/@esbuild/freebsd-arm64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.2.tgz", - "integrity": "sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "peer": true, - "engines": { - "node": ">=18" - } - }, - "node_modules/vitest/node_modules/@esbuild/freebsd-x64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.2.tgz", - "integrity": "sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "peer": true, - "engines": { - "node": ">=18" - } - }, - "node_modules/vitest/node_modules/@esbuild/linux-arm": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.2.tgz", - "integrity": "sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "peer": true, - "engines": { - "node": ">=18" - } - }, - "node_modules/vitest/node_modules/@esbuild/linux-arm64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.2.tgz", - "integrity": "sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "peer": true, - "engines": { - "node": ">=18" - } - }, - "node_modules/vitest/node_modules/@esbuild/linux-ia32": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.2.tgz", - "integrity": "sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "peer": true, - "engines": { - "node": ">=18" - } - }, - "node_modules/vitest/node_modules/@esbuild/linux-loong64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.2.tgz", - "integrity": "sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==", - "cpu": [ - "loong64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "peer": true, - "engines": { - "node": ">=18" - } - }, - "node_modules/vitest/node_modules/@esbuild/linux-mips64el": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.2.tgz", - "integrity": "sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==", - "cpu": [ - "mips64el" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "peer": true, - "engines": { - "node": ">=18" - } - }, - "node_modules/vitest/node_modules/@esbuild/linux-ppc64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.2.tgz", - "integrity": "sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "peer": true, - "engines": { - "node": ">=18" - } - }, - "node_modules/vitest/node_modules/@esbuild/linux-riscv64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.2.tgz", - "integrity": "sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "peer": true, - "engines": { - "node": ">=18" - } - }, - "node_modules/vitest/node_modules/@esbuild/linux-s390x": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.2.tgz", - "integrity": "sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==", - "cpu": [ - "s390x" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "peer": true, - "engines": { - "node": ">=18" - } - }, - "node_modules/vitest/node_modules/@esbuild/linux-x64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.2.tgz", - "integrity": "sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "peer": true, - "engines": { - "node": ">=18" - } - }, - "node_modules/vitest/node_modules/@esbuild/netbsd-x64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.2.tgz", - "integrity": "sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "peer": true, - "engines": { - "node": ">=18" - } - }, - "node_modules/vitest/node_modules/@esbuild/openbsd-x64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.2.tgz", - "integrity": "sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "peer": true, - "engines": { - "node": ">=18" - } - }, - "node_modules/vitest/node_modules/@esbuild/sunos-x64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.2.tgz", - "integrity": "sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "sunos" - ], - "peer": true, - "engines": { - "node": ">=18" - } - }, - "node_modules/vitest/node_modules/@esbuild/win32-arm64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.2.tgz", - "integrity": "sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "peer": true, - "engines": { - "node": ">=18" - } - }, - "node_modules/vitest/node_modules/@esbuild/win32-ia32": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.2.tgz", - "integrity": "sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "peer": true, - "engines": { - "node": ">=18" - } - }, - "node_modules/vitest/node_modules/@esbuild/win32-x64": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.2.tgz", - "integrity": "sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "peer": true, - "engines": { - "node": ">=18" - } - }, "node_modules/vitest/node_modules/@vitest/mocker": { "version": "4.1.11", "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-4.1.11.tgz", @@ -11850,50 +11382,6 @@ } } }, - "node_modules/vitest/node_modules/esbuild": { - "version": "0.28.2", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.2.tgz", - "integrity": "sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "peer": true, - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=18" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.28.2", - "@esbuild/android-arm": "0.28.2", - "@esbuild/android-arm64": "0.28.2", - "@esbuild/android-x64": "0.28.2", - "@esbuild/darwin-arm64": "0.28.2", - "@esbuild/darwin-x64": "0.28.2", - "@esbuild/freebsd-arm64": "0.28.2", - "@esbuild/freebsd-x64": "0.28.2", - "@esbuild/linux-arm": "0.28.2", - "@esbuild/linux-arm64": "0.28.2", - "@esbuild/linux-ia32": "0.28.2", - "@esbuild/linux-loong64": "0.28.2", - "@esbuild/linux-mips64el": "0.28.2", - "@esbuild/linux-ppc64": "0.28.2", - "@esbuild/linux-riscv64": "0.28.2", - "@esbuild/linux-s390x": "0.28.2", - "@esbuild/linux-x64": "0.28.2", - "@esbuild/netbsd-arm64": "0.28.2", - "@esbuild/netbsd-x64": "0.28.2", - "@esbuild/openbsd-arm64": "0.28.2", - "@esbuild/openbsd-x64": "0.28.2", - "@esbuild/openharmony-arm64": "0.28.2", - "@esbuild/sunos-x64": "0.28.2", - "@esbuild/win32-arm64": "0.28.2", - "@esbuild/win32-ia32": "0.28.2", - "@esbuild/win32-x64": "0.28.2" - } - }, "node_modules/vitest/node_modules/lightningcss": { "version": "1.33.0", "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.33.0.tgz", diff --git a/frontend/src/adk/client.ts b/frontend/src/adk/client.ts index fd6e951f7..5cc260ed5 100644 --- a/frontend/src/adk/client.ts +++ b/frontend/src/adk/client.ts @@ -6566,7 +6566,7 @@ export async function updateSandboxTool(kind: SandboxToolKind): Promise<{ export type ChannelScope = "group" | "group_sender" | "group_topic" | "group_topic_sender"; -export interface ChannelCapabilities { channels?: string[]; credentialBindingChannels?: string[]; serverSideBinding: boolean; bindingReady: boolean; bindingError?: string | null; } +export interface ChannelCapabilities { channels?: string[]; credentialBindingChannels?: string[]; serverSideBinding: boolean; bindingReady: boolean; bindingError?: string | null; multiBotChannels?: string[]; accountScopedPermissions?: boolean; } export interface FeishuBinding { id: string; status: "PENDING" | "SCANNED" | "AUTHORIZED" | "REGISTERING" | "BOUND" | "FAILED" | "EXPIRED"; @@ -6574,11 +6574,11 @@ export interface FeishuBinding { appId?: string | null; lastErrorCode?: string | null; lastErrorMessage?: string | null; } export interface ChannelDiagnostics { - configured: boolean; appId?: string | null; appName?: string | null; + configured: boolean; enabled?: boolean; appId?: string | null; appName?: string | null; gatewayConfigured: boolean; routeConfigured: boolean; missingConfiguration: string[]; deliveryHealth: string; lastInboundAt?: number | null; lastDeliveryAt?: number | null; } -export interface ChannelPermission { channel: string; chatId: string; chatName?: string; groupSessionScope?: ChannelScope | null; } +export interface ChannelPermission { appId?: string; channel: string; chatId: string; chatName?: string; groupSessionScope?: ChannelScope | null; } export class ChannelApiError extends Error { constructor(public status: number) { super(`Channel request failed (${status})`); } } diff --git a/frontend/src/adk/feishuAccounts.ts b/frontend/src/adk/feishuAccounts.ts new file mode 100644 index 000000000..0f3edf259 --- /dev/null +++ b/frontend/src/adk/feishuAccounts.ts @@ -0,0 +1,44 @@ +import { channelRequest, ChannelApiError, type AdkEndpoint } from "./client"; + +export interface FeishuAccount { + channel: "feishu"; + appId: string; + appName?: string; + enabled: boolean; +} + +export async function listFeishuAccounts( + ep: AdkEndpoint, + signal: AbortSignal, +): Promise { + const data = await channelRequest<{ channels: unknown[] }>(ep, "", { + signal, + }); + if (!data || !Array.isArray(data.channels)) throw new ChannelApiError(502); + const accounts: FeishuAccount[] = []; + const ids = new Set(); + for (const value of data.channels) { + if (!value || typeof value !== "object" || !("channel" in value)) + throw new ChannelApiError(502); + if (value.channel !== "feishu") continue; + if ( + !("appId" in value) || + typeof value.appId !== "string" || + !value.appId.trim() || + ids.has(value.appId) + ) + throw new ChannelApiError(502); + if (!("enabled" in value) || typeof value.enabled !== "boolean") + throw new ChannelApiError(502); + ids.add(value.appId); + accounts.push({ + channel: "feishu", + appId: value.appId, + enabled: value.enabled, + ...("appName" in value && typeof value.appName === "string" + ? { appName: value.appName } + : {}), + }); + } + return accounts; +} diff --git a/frontend/src/cronjobs/MpaCronTasks.tsx b/frontend/src/cronjobs/MpaCronTasks.tsx index 2eefbc13e..faae62731 100644 --- a/frontend/src/cronjobs/MpaCronTasks.tsx +++ b/frontend/src/cronjobs/MpaCronTasks.tsx @@ -560,6 +560,7 @@ function RuntimeTasks({ runtime }: { runtime: MpaRuntime }) { )} {editor && ( ([]); + const [multiBot, setMultiBot] = useState(false); + const [botsLoading, setBotsLoading] = useState(false); + const [botsError, setBotsError] = useState(""); + const [botsReload, setBotsReload] = useState(0); + useEffect(() => { + if (!runtime || channel !== "Feishu") { + setBotsLoading(false); + return; + } + const controller = new AbortController(); + const ep = { runtimeId: runtime.runtimeId, region: runtime.region }; + setBotsLoading(true); + setBotsError(""); + void (async () => { + let caps: ChannelCapabilities; + try { + caps = await channelRequest(ep, "/capabilities", { + signal: controller.signal, + }); + } catch (reason) { + if (reason instanceof ChannelApiError && reason.status === 404) { + if (!controller.signal.aborted) setMultiBot(false); + return; + } + throw reason; + } + if (controller.signal.aborted) return; + const multiple = !!caps.multiBotChannels?.includes("feishu"); + setMultiBot(multiple); + if (!multiple) return; + const accounts = await listFeishuAccounts(ep, controller.signal); + if (controller.signal.aborted) return; + setBots(accounts); + setBotId( + (current) => + current || + (accounts.length === 1 && accounts[0].enabled + ? accounts[0].appId + : ""), + ); + })() + .catch((reason) => { + if (!controller.signal.aborted) + setBotsError( + reason instanceof ChannelApiError && + [401, 403].includes(reason.status) + ? "botsUnauthorized" + : "botsFailed", + ); + }) + .finally(() => { + if (!controller.signal.aborted) setBotsLoading(false); + }); + return () => controller.abort(); + }, [runtime?.runtimeId, runtime?.region, channel, botsReload]); const [validation, setValidation] = useState(""); const composing = useRef(false); const nameRef = useRef(null); function save() { if (busy || composing.current) return; + if (channel === "Feishu" && runtime) { + if (botsLoading || botsError) return; + if (multiBot && !bots.some((bot) => bot.appId === botId && bot.enabled)) { + setValidation(label("selectBot")); + return; + } + } try { new Intl.DateTimeFormat("en-US", { timeZone: zone }); } catch { @@ -115,10 +188,15 @@ export function MpaTaskEditor({ } const delivery = task?.delivery?.channel === channel && - String(task.delivery.targetId || "") === target + String(task.delivery.targetId || "") === target && + (channel !== "Feishu" || + !multiBot || + String(task.delivery.appId || "") === botId) && + !(channel === "Web" && task.delivery.appId) ? task.delivery : { channel, + ...(channel === "Feishu" && multiBot ? { appId: botId } : {}), targetId: channel === "Web" ? null : target.trim(), receiveIdType: "chat_id", bestEffort: true, @@ -296,6 +374,48 @@ export function MpaTaskEditor({ onChange={setChannel} /> + {channel === "Feishu" && runtime && ( + <> + {botsLoading &&

{label("botsLoading")}

} + {botsError && ( +
+

{label(botsError)}

+ +
+ )} + {multiBot && ( +
+ {label("botAccount")} + ({ + value: account.appId, + label: `${account.appName || account.appId} | ${account.enabled ? t("channels.accountEnabled") : t("channels.accountDisabled")}`, + description: account.appName ? account.appId : undefined, + })), + ]} + onChange={(event) => { + setAdding(false); + setSelected(event.target.value); + }} + /> + + + {active && !adding && ( + + )} +
+ {!loading && !error && !accounts.length && ( +

{t("channels.noAccounts")}

+ )} + {!loading && !error && !adding && !selected && accounts.length > 0 && ( +

{t("channels.selectAccount")}

+ )} + {!loading && !error && (adding || active) && ( +
+ {adding && ( + + )} + {renderPanel({ + accountId: adding ? undefined : selected, + accountMode: adding ? "add" : "manage", + onBound: refresh, + onDeleted: () => refresh(""), + onBusyChange: setBusy, + })} +
+ )} + + ); +} diff --git a/frontend/src/ui/RuntimeChannels.css b/frontend/src/ui/RuntimeChannels.css index b640c8ae5..ac98478ab 100644 --- a/frontend/src/ui/RuntimeChannels.css +++ b/frontend/src/ui/RuntimeChannels.css @@ -302,3 +302,23 @@ width: 16px; height: 16px; } + +.runtime-channels-account-actions { + display: flex; + align-items: end; + flex-wrap: wrap; + gap: 12px; +} +.runtime-channels-account-select { + display: flex; + flex: 1 1 240px; + min-width: 0; + flex-direction: column; + gap: 8px; +} +.runtime-channels-accounts > div > .runtime-channels { + margin-top: 16px; +} +.runtime-channels-accounts .runtime-channels-diagnostics { + grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); +} diff --git a/frontend/src/ui/RuntimeChannels.tsx b/frontend/src/ui/RuntimeChannels.tsx index 016b12b60..71af49ec9 100644 --- a/frontend/src/ui/RuntimeChannels.tsx +++ b/frontend/src/ui/RuntimeChannels.tsx @@ -18,23 +18,30 @@ import { WecomAuthorizationError, } from "../adk/wecomAuthorization"; import { SourceCloseIcon } from "./icons/SourceWorkspaceIcons"; +import { FeishuAccounts, type FeishuAccountPanelProps } from "./FeishuAccounts"; import "./RuntimeChannels.css"; const providers = ["feishu", "wecom", "dingtalk"] as const; type Provider = (typeof providers)[number]; type ConfigurationMethod = "quick" | "manual"; -export function RuntimeChannels(props: { runtimeId: string; region: string; showHeader?: boolean }) { +export function RuntimeChannels(props: { + runtimeId: string; + region: string; + showHeader?: boolean; +}) { const { t } = useTranslation("ui"); const [provider, setProvider] = useState("feishu"); const id = useId(); const tabs = useRef>([]); return (
- {props.showHeader !== false &&
-

{t("channels.workspaceTitle")}

-

{t("channels.workspaceDescription")}

-
} + {props.showHeader !== false && ( +
+

{t("channels.workspaceTitle")}

+

{t("channels.workspaceDescription")}

+
+ )}
) { const { t } = useTranslation("ui"); const ep = useMemo(() => ({ runtimeId, region }), [runtimeId, region]); const methodId = useId(); @@ -170,7 +182,14 @@ function ProviderChannel({ const polling = useRef(null); const authorizationWaiting = useRef(false); const storageKey = `mpa-${provider}-binding:${region}:${runtimeId}`; - const fail = (value: unknown) => { + const multiBot = + provider === "feishu" && + (!!accountMode || !!capability?.multiBotChannels?.includes("feishu")); + useEffect(() => { + onBusyChange?.(busy); + return () => onBusyChange?.(false); + }, [busy, onBusyChange]); + const fail = (value: unknown, registration = false) => { if (!alive.current) return; if (value instanceof WecomAuthorizationError) { const key = @@ -186,22 +205,34 @@ function ProviderChannel({ return; } const status = value instanceof ChannelApiError ? value.status : 0; - if (status === 409) setUncertain(true); + if (status === 409 && (registration || !multiBot)) setUncertain(true); setError( t( - `channels.${status === 409 ? "uncertain" : status === 404 ? "unsupported" : status === 401 || status === 403 ? "unauthorized" : status === 503 ? "configurationError" : "requestFailed"}`, + `channels.${status === 409 ? (registration || !multiBot ? "uncertain" : "accountConflict") : status === 404 ? "unsupported" : status === 401 || status === 403 ? "unauthorized" : status === 503 ? "configurationError" : "requestFailed"}`, ), ); }; async function refresh(signal: AbortSignal) { + if (accountMode === "add") { + setDiagnostics(null); + setGroups([]); + return; + } + const accountQuery = accountId + ? `?appId=${encodeURIComponent(accountId)}` + : ""; const [diag, permissions] = await Promise.all([ - channelRequest(ep, `/${provider}/diagnostics`, { - signal, - }), + channelRequest( + ep, + `/${provider}/diagnostics${accountQuery}`, + { + signal, + }, + ), provider === "feishu" ? channelRequest<{ permissions: ChannelPermission[] }>( ep, - "/chat-permissions?channel=feishu", + `/chat-permissions?channel=feishu${accountId ? `&appId=${encodeURIComponent(accountId)}` : ""}`, { signal }, ) : Promise.resolve({ permissions: [] }), @@ -247,6 +278,12 @@ function ProviderChannel({ ) throw new ChannelApiError(404); setCapability(caps); + if ( + provider === "feishu" && + caps.multiBotChannels?.includes("feishu") && + !accountMode + ) + return; await refresh(controller.signal); } catch (value) { if (!controller.signal.aborted) fail(value); @@ -275,7 +312,10 @@ function ProviderChannel({ setBinding(value); if (value.lastErrorCode === "REGISTRATION_UNCERTAIN") setUncertain(true); - if (value.status === "BOUND") await refresh(controller.signal); + if (value.status === "BOUND") { + if (accountMode) onBound?.(value.appId || undefined); + else await refresh(controller.signal); + } }) .catch((value) => { if (!controller.signal.aborted) fail(value); @@ -289,7 +329,10 @@ function ProviderChannel({ }; // eslint-disable-next-line react-hooks/exhaustive-deps }, [binding, ep, busy, reload, method]); - async function perform(action: (signal: AbortSignal) => Promise) { + async function perform( + action: (signal: AbortSignal) => Promise, + registration = false, + ) { if (operation.current) return; const controller = new AbortController(); operation.current = controller; @@ -299,7 +342,7 @@ function ProviderChannel({ try { await action(controller.signal); } catch (value) { - if (!controller.signal.aborted) fail(value); + if (!controller.signal.aborted) fail(value, registration); } finally { if (operation.current === controller) { operation.current = null; @@ -322,9 +365,12 @@ function ProviderChannel({ setBinding(value); if (value.lastErrorCode === "REGISTRATION_UNCERTAIN") setUncertain(true); - if (value.status === "BOUND") await refresh(signal); + if (value.status === "BOUND") { + if (accountMode) onBound?.(value.appId || undefined); + else await refresh(signal); + } } - }); + }, true); } function beginWecom() { void perform(async (signal) => { @@ -391,6 +437,22 @@ function ProviderChannel({ return undefined; } }; + if (multiBot && !accountMode && capability) + return ( + ( + + )} + /> + ); const wecomAuthorizationActions = provider === "wecom" && capability && ( <> - + > + + + + + )} + )} {uncertain &&

{t("channels.uncertain")}

}
{method === "quick" && wecomAuthorizationActions} - {method === "quick" && provider !== "wecom" && ( - - )} + {method === "quick" && + provider !== "wecom" && + accountMode !== "manage" && ( + + )} {diagnostics?.configured && (
)} - {provider === "feishu" && ( + {provider === "feishu" && accountMode !== "add" && (
{groups.map((group) => ( -
  • +
  • - {group.chatName || group.chatId} ·{" "} + {group.chatName || group.chatId} |{" "} {t( `channels.scope_${group.groupSessionScope || "group"}`, )} @@ -912,7 +989,7 @@ function ProviderChannel({ void perform(async (signal) => { await channelRequest( ep, - `/chat-permissions?channel=${provider}&chat_id=${encodeURIComponent(group.chatId)}`, + `/chat-permissions?channel=${provider}&chat_id=${encodeURIComponent(group.chatId)}${accountId ? `&appId=${encodeURIComponent(accountId)}` : ""}`, { method: "DELETE", signal }, ); await refresh(signal); diff --git a/frontend/tests/feishuAccounts.test.ts b/frontend/tests/feishuAccounts.test.ts new file mode 100644 index 000000000..02e99b7b9 --- /dev/null +++ b/frontend/tests/feishuAccounts.test.ts @@ -0,0 +1,66 @@ +import { afterEach, expect, it, vi } from "vitest"; +import { channelRequest, ChannelApiError } from "../src/adk/client"; +import { listFeishuAccounts } from "../src/adk/feishuAccounts"; +vi.mock("../src/adk/client", () => ({ + channelRequest: vi.fn(), + ChannelApiError: class extends Error { + constructor(public status: number) { + super(String(status)); + } + }, +})); +const request = vi.mocked(channelRequest); +const ep = { runtimeId: "runtime-a", region: "cn-beijing" }; +afterEach(() => request.mockReset()); +it("retains only public Feishu account summaries and ignores other providers", async () => { + request.mockResolvedValue({ + channels: [ + { channel: "wecom", appId: "wecom" }, + { + channel: "feishu", + appId: "a", + appName: "A", + enabled: true, + config: { secret: "private-fixture" }, + }, + { channel: "feishu", appId: "b", enabled: false }, + ], + }); + const signal = new AbortController().signal; + const result = await listFeishuAccounts(ep, signal); + expect(result).toEqual([ + { channel: "feishu", appId: "a", appName: "A", enabled: true }, + { channel: "feishu", appId: "b", enabled: false }, + ]); + expect(JSON.stringify(result)).not.toContain("private-fixture"); + expect(request).toHaveBeenCalledWith(ep, "", { signal }); +}); +it.each([ + null, + {}, + { channels: null }, + { channels: [null] }, + { channels: [{}] }, + { channels: [{ channel: "feishu" }] }, + { channels: [{ channel: "feishu", appId: " ", enabled: true }] }, + { channels: [{ channel: "feishu", appId: "a" }] }, + { channels: [{ channel: "feishu", appId: "a", enabled: "yes" }] }, + { + channels: [ + { channel: "feishu", appId: "a", enabled: true }, + { channel: "feishu", appId: "a", enabled: true }, + ], + }, +])("rejects a malformed or duplicate account response: %j", async (data) => { + request.mockResolvedValue(data); + await expect( + listFeishuAccounts(ep, new AbortController().signal), + ).rejects.toBeInstanceOf(ChannelApiError); +}); +it("propagates request errors rather than returning an empty list", async () => { + const failure = new ChannelApiError(403); + request.mockRejectedValue(failure); + await expect( + listFeishuAccounts(ep, new AbortController().signal), + ).rejects.toBe(failure); +}); diff --git a/frontend/tests/mpaTaskBots.test.tsx b/frontend/tests/mpaTaskBots.test.tsx new file mode 100644 index 000000000..750fa29d8 --- /dev/null +++ b/frontend/tests/mpaTaskBots.test.tsx @@ -0,0 +1,325 @@ +// @vitest-environment jsdom +import React, { act } from "react"; +import { createRoot, type Root } from "react-dom/client"; +import { afterEach, beforeEach, expect, it, vi } from "vitest"; +import { MpaTaskEditor } from "../src/cronjobs/MpaTaskEditor"; +import { channelRequest } from "../src/adk/client"; +vi.mock("../src/adk/client", () => ({ + channelRequest: vi.fn(), + ChannelApiError: class extends Error { + constructor(public status: number) { + super(String(status)); + } + }, +})); +vi.mock("react-i18next", () => ({ + useTranslation: () => ({ t: (key: string) => key }), +})); +vi.mock("../src/ui/SandboxControls", () => ({ + DialogShell: ({ children }: { children: React.ReactNode }) => ( +
    {children}
    + ), +})); +vi.mock("../src/components/primitives/Select/Select", () => ({ + Select: ({ options, ...props }: any) => ( + + ), +})); +vi.mock("../src/ui/DeploymentSelect", () => ({ + DeploymentSelect: ({ ariaLabel, value, options, onChange }: any) => ( + + ), +})); +const runtime = { runtimeId: "r-bots", region: "cn-beijing", name: "Bots" }; +const task = { + id: "task-a", + name: "Daily", + enabled: true, + prompt: "Report", + schedule: { type: "Daily", time: "09:00", timezone: "Asia/Shanghai" }, + delivery: { + channel: "Feishu", + targetId: "oc_same", + appId: "bot-b", + receiveIdType: "chat_id", + bestEffort: true, + threadId: "omt_thread", + replyMessageId: "om_reply", + }, +}; +const request = vi.mocked(channelRequest); +const save = vi.fn(); +let host: HTMLDivElement, root: Root; +beforeEach(() => { + vi.stubGlobal("React", React); + vi.stubGlobal("IS_REACT_ACT_ENVIRONMENT", true); + host = document.createElement("div"); + document.body.append(host); + root = createRoot(host); + save.mockReset(); + request.mockReset(); + request.mockImplementation(async (_ep, path) => + path === "/capabilities" + ? { multiBotChannels: ["feishu"] } + : { + channels: [ + { channel: "feishu", appId: "bot-a", appName: "A", enabled: true }, + { channel: "feishu", appId: "bot-b", appName: "B", enabled: true }, + ], + }, + ); +}); +afterEach(async () => { + await act(async () => root.unmount()); + host.remove(); + vi.unstubAllGlobals(); +}); +async function render(value = task) { + await act(async () => + root.render( + {}} + onSave={save} + />, + ), + ); +} +async function submit() { + await act(async () => + host + .querySelector("form")! + .dispatchEvent(new Event("submit", { bubbles: true, cancelable: true })), + ); +} +it("selects the persisted delivery bot and preserves thread metadata", async () => { + await render(); + expect( + host.querySelector( + 'select[aria-label="mpa.manage.botAccount"]', + )?.value, + ).toBe("bot-b"); + await submit(); + expect(save.mock.calls[0][0].delivery).toEqual(task.delivery); +}); +it("keeps appId when editing the target but clears target-specific thread fields", async () => { + await render(); + const input = host.querySelector('input[maxlength="512"]')!; + await act(async () => { + Object.getOwnPropertyDescriptor( + HTMLInputElement.prototype, + "value", + )!.set!.call(input, "oc_other"); + input.dispatchEvent(new Event("input", { bubbles: true })); + }); + await submit(); + expect(save.mock.calls[0][0].delivery).toMatchObject({ + appId: "bot-b", + targetId: "oc_other", + }); + expect(save.mock.calls[0][0].delivery.threadId).toBeUndefined(); +}); +it("requires an explicit bot for an ambiguous old task", async () => { + await render({ + ...task, + delivery: { ...task.delivery, appId: undefined }, + } as typeof task); + await submit(); + expect(save).not.toHaveBeenCalled(); + expect(host.textContent).toContain("mpa.manage.selectBot"); +}); +it("removes appId when switching to Web delivery", async () => { + await render(); + const select = host.querySelector( + 'select[aria-label="mpa.manage.delivery"]', + )!; + await act(async () => { + select.value = "Web"; + select.dispatchEvent(new Event("change", { bubbles: true })); + }); + await submit(); + expect(save.mock.calls[0][0].delivery).not.toHaveProperty("appId"); +}); +it("shows account read errors and prevents Feishu submission", async () => { + request.mockRejectedValue(new Error("private upstream failure")); + await render(); + await submit(); + expect(save).not.toHaveBeenCalled(); + expect(host.textContent).toContain("mpa.manage.botsFailed"); + expect(host.textContent).not.toContain("private upstream failure"); +}); + +async function choose(label: string, value: string) { + const select = host.querySelector( + `select[aria-label="${label}"]`, + )!; + await act(async () => { + select.value = value; + select.dispatchEvent(new Event("change", { bubbles: true })); + }); +} +it("uses the chosen account for a copied task and resets thread metadata when changing bots", async () => { + await act(async () => + root.render( + {}} + onSave={save} + />, + ), + ); + await choose("mpa.manage.botAccount", "bot-a"); + await submit(); + expect(save.mock.calls[0][0].delivery).toMatchObject({ + appId: "bot-a", + targetId: "oc_same", + }); + expect(save.mock.calls[0][0].delivery).not.toHaveProperty("threadId"); +}); +it("selects a single enabled bot for a legacy task", async () => { + request.mockImplementation(async (_ep, path) => + path === "/capabilities" + ? { multiBotChannels: ["feishu"] } + : { channels: [{ channel: "feishu", appId: "bot-a", enabled: true }] }, + ); + await render({ + ...task, + delivery: { ...task.delivery, appId: undefined }, + } as typeof task); + await submit(); + expect(save.mock.calls[0][0].delivery.appId).toBe("bot-a"); +}); +it.each([[], [{ channel: "feishu", appId: "bot-b", enabled: false }]])( + "blocks missing or disabled delivery bots: %j", + async (channels) => { + request.mockImplementation(async (_ep, path) => + path === "/capabilities" + ? { multiBotChannels: ["feishu"] } + : { channels }, + ); + await render(); + await submit(); + expect(save).not.toHaveBeenCalled(); + }, +); +it("does not auto-select a single disabled account", async () => { + request.mockImplementation(async (_ep, path) => + path === "/capabilities" + ? { multiBotChannels: ["feishu"] } + : { channels: [{ channel: "feishu", appId: "bot-a", enabled: false }] }, + ); + await render({ + ...task, + delivery: { ...task.delivery, appId: undefined }, + } as typeof task); + expect( + host.querySelector( + 'select[aria-label="mpa.manage.botAccount"]', + )?.value, + ).toBe(""); + await submit(); + expect(save).not.toHaveBeenCalled(); +}); +it("retains legacy Feishu editing when multi-bot capability is absent", async () => { + request.mockResolvedValue({ serverSideBinding: true }); + await render(); + await submit(); + expect(save.mock.calls[0][0].delivery).toEqual(task.delivery); + expect(request).toHaveBeenCalledTimes(1); +}); +it("retains legacy editing if the capability endpoint is unsupported", async () => { + const { ChannelApiError } = await import("../src/adk/client"); + request.mockRejectedValue(new ChannelApiError(404)); + await render(); + await submit(); + expect(save).toHaveBeenCalled(); +}); +it("reports denied bot listing and permits a clean retry", async () => { + const { ChannelApiError } = await import("../src/adk/client"); + request.mockRejectedValueOnce(new ChannelApiError(403)); + await render(); + expect(host.textContent).toContain("mpa.manage.botsUnauthorized"); + const retry = [...host.querySelectorAll("button")].find( + (b) => b.textContent === "mpa.manage.retryBots", + )!; + await act(async () => retry.click()); + await submit(); + expect(save).toHaveBeenCalled(); +}); +it("cancels and ignores late capability responses after switching to Web", async () => { + let resolve!: (value: unknown) => void; + let signal!: AbortSignal; + request.mockImplementation((_ep, _path, init) => { + signal = init!.signal as AbortSignal; + return new Promise((done) => { + resolve = done; + }); + }); + await render(); + await submit(); + expect(save).not.toHaveBeenCalled(); + await choose("mpa.manage.delivery", "Web"); + expect(signal.aborted).toBe(true); + await act(async () => resolve({ multiBotChannels: ["feishu"] })); + await submit(); + expect(save.mock.calls[0][0].delivery.channel).toBe("Web"); + expect(request).toHaveBeenCalledTimes(1); +}); +it("ignores late list results and errors after the editor is closed", async () => { + let resolve!: (value: unknown) => void; + let signal!: AbortSignal; + request.mockImplementation(async (_ep, path, init) => + path === "/capabilities" + ? { multiBotChannels: ["feishu"] } + : new Promise((done) => { + signal = init!.signal as AbortSignal; + resolve = done; + }), + ); + await render(); + await act(async () => root.render(null)); + expect(signal.aborted).toBe(true); + await act(async () => + resolve({ + channels: [{ channel: "feishu", appId: "bot-a", enabled: true }], + }), + ); + expect(save).not.toHaveBeenCalled(); +}); +it("cancels a capability failure after unmount without showing it", async () => { + let reject!: (reason: unknown) => void; + request.mockImplementation( + () => + new Promise((_done, fail) => { + reject = fail; + }), + ); + await render(); + await act(async () => root.render(null)); + await act(async () => reject(new Error("late failure"))); + expect(host.textContent).toBe(""); +}); diff --git a/frontend/tests/runtimeChannels.test.tsx b/frontend/tests/runtimeChannels.test.tsx index 20fa96eff..3d75e6665 100644 --- a/frontend/tests/runtimeChannels.test.tsx +++ b/frontend/tests/runtimeChannels.test.tsx @@ -12,9 +12,10 @@ vi.mock("../src/adk/client", () => ({ } }, })); -vi.mock("react-i18next", () => ({ - useTranslation: () => ({ t: (key: string) => key }), -})); +vi.mock("react-i18next", () => { + const t = (key: string) => key; + return { useTranslation: () => ({ t }) }; +}); vi.mock("@openai/apps-sdk-ui/components/Button", () => ({ Button: ({ color: _c, variant: _v, size: _s, children, ...props }: any) => ( @@ -977,3 +978,329 @@ it.each(["feishu", "wecom", "dingtalk"])( ).toBe(true); }, ); + +const botAccounts = [ + { channel: "feishu", appId: "bot-a", appName: "Bot A", enabled: true }, + { channel: "feishu", appId: "bot-b", appName: "Bot B", enabled: true }, +]; +function multiBotFixture(accounts = botAccounts) { + request.mockImplementation(async (_ep, path, init) => { + if (path === "/capabilities") + return { + serverSideBinding: true, + bindingReady: true, + channels: ["feishu", "wecom", "dingtalk"], + credentialBindingChannels: ["feishu"], + multiBotChannels: ["feishu"], + accountScopedPermissions: true, + }; + if (path === "") return { channels: accounts }; + if (path.includes("/diagnostics")) { + if (!path.includes("appId=")) throw new ChannelApiError(409); + return { + configured: true, + appId: new URLSearchParams(path.split("?")[1]).get("appId"), + gatewayConfigured: true, + routeConfigured: true, + missingConfiguration: [], + deliveryHealth: "not_observed", + }; + } + if (path.startsWith("/chat-permissions") && !init?.method) + return { + permissions: [ + { + channel: "feishu", + appId: "bot-b", + chatId: "same-group", + chatName: "Shared group", + }, + ], + }; + if (path === "/feishu/bindings/manual") + return { status: "BOUND", appId: "bot-c" }; + return { success: true }; + }); +} +async function selectBot(appId: string) { + const select = host.querySelector( + ".runtime-channels-accounts select", + )!; + expect(select).not.toBeNull(); + await act(async () => { + select.value = appId; + select.dispatchEvent(new Event("change", { bubbles: true })); + }); +} +it("lists multi-bot accounts and never requests ambiguous diagnostics", async () => { + multiBotFixture(); + await render(); + expect(host.textContent).toContain("Bot A"); + expect(host.textContent).toContain("Bot B"); + expect(host.textContent).toContain("channels.selectAccount"); + expect( + request.mock.calls.some(([, path]) => path.includes("/diagnostics")), + ).toBe(false); + await selectBot("bot-b"); + expect(request).toHaveBeenCalledWith( + expect.anything(), + "/feishu/diagnostics?appId=bot-b", + expect.anything(), + ); + expect(request).toHaveBeenCalledWith( + expect.anything(), + "/chat-permissions?channel=feishu&appId=bot-b", + expect.anything(), + ); + expect(host.textContent).not.toContain("channels.uncertain"); +}); +it("scopes permission writes and deletions to the selected bot", async () => { + multiBotFixture(); + await render(); + await selectBot("bot-b"); + const input = host.querySelector( + ".runtime-channels-permissions input", + )!; + await act(async () => { + Object.getOwnPropertyDescriptor( + HTMLInputElement.prototype, + "value", + )!.set!.call(input, "group-new"); + input.dispatchEvent(new Event("input", { bubbles: true })); + }); + // Submit after React commits the controlled input. + await act(async () => + host + .querySelector(".runtime-channels-permissions form")! + .dispatchEvent(new Event("submit", { bubbles: true, cancelable: true })), + ); + const saves = request.mock.calls.filter( + ([, path, init]) => path === "/chat-permissions" && init?.method === "POST", + ); + expect(saves).toHaveLength(1); + expect(JSON.parse(String(saves[0][2]?.body))).toMatchObject({ + appId: "bot-b", + chatId: "group-new", + }); + await act(async () => + host + .querySelector(".runtime-channels-remove-group")! + .click(), + ); + expect(request).toHaveBeenCalledWith( + expect.anything(), + "/chat-permissions?channel=feishu&chat_id=same-group&appId=bot-b", + expect.objectContaining({ method: "DELETE" }), + ); +}); +it("toggles and unbinds only the selected account", async () => { + multiBotFixture(); + vi.stubGlobal("confirm", vi.fn().mockReturnValue(true)); + await render(); + await selectBot("bot-b"); + await click("channels.disableAccount"); + expect(request).toHaveBeenCalledWith( + expect.anything(), + "/feishu/accounts/bot-b", + expect.objectContaining({ method: "PATCH", body: '{"enabled":false}' }), + ); + await click("channels.unbind"); + expect(request).toHaveBeenCalledWith( + expect.anything(), + "?channel=feishu&appId=bot-b", + expect.objectContaining({ method: "DELETE" }), + ); + expect( + request.mock.calls.some( + ([, path, init]) => init?.method === "DELETE" && path.includes("bot-a"), + ), + ).toBe(false); +}); +it("adds a bot through the existing form without replacement guidance or deleting another bot", async () => { + multiBotFixture(); + await render(); + await click("channels.addAccount"); + await act(async () => + host.querySelector('input[value="manual"]')!.click(), + ); + await act(async () => { + for (const [name, value] of [ + ["appId", "bot-c"], + ["secret", "fake-secret"], + ]) { + const input = host.querySelector( + `input[name="${name}"]`, + )!; + Object.getOwnPropertyDescriptor( + HTMLInputElement.prototype, + "value", + )!.set!.call(input, value); + input.dispatchEvent(new Event("input", { bubbles: true })); + } + }); + expect(host.textContent).not.toContain("channels.manualReplacement"); + await act(async () => + host + .querySelector("form[data-channel-binding]")! + .dispatchEvent(new Event("submit", { bubbles: true, cancelable: true })), + ); + expect(request).toHaveBeenCalledWith( + expect.anything(), + "/feishu/bindings/manual", + expect.objectContaining({ + body: '{"appId":"bot-c","appSecret":"fake-secret"}', + }), + ); + expect( + request.mock.calls.some(([, , init]) => init?.method === "DELETE"), + ).toBe(false); + expect(JSON.stringify(sessionStorage)).not.toContain("fake-secret"); +}); + +it("shows an empty account list without issuing unscoped reads", async () => { + multiBotFixture([]); + await render(); + expect(host.textContent).toContain("channels.noAccounts"); + expect( + request.mock.calls.some( + ([, path]) => + path.includes("diagnostics") || path.includes("chat-permissions"), + ), + ).toBe(false); + await click("channels.addAccount"); + expect(host.querySelector('input[value="quick"]')).not.toBeNull(); + await click("channels.cancelAddAccount"); + expect(host.querySelector('input[value="quick"]')).toBeNull(); +}); +it("reports a failed account list distinctly and recovers on refresh", async () => { + multiBotFixture(); + const original = request.getMockImplementation()!; + request.mockImplementation((ep, path, init) => + path === "" + ? Promise.reject(new ChannelApiError(502)) + : original(ep, path, init), + ); + await render(); + expect(host.textContent).toContain("channels.accountsFailed"); + expect(host.textContent).not.toContain("channels.noAccounts"); + multiBotFixture(); + await click("common.retry"); + expect(host.textContent).toContain("Bot B"); +}); +it("requires permission to list accounts and never exposes upstream error bodies", async () => { + multiBotFixture(); + const original = request.getMockImplementation()!; + request.mockImplementation((ep, path, init) => + path === "" + ? Promise.reject(new ChannelApiError(403)) + : original(ep, path, init), + ); + await render(); + expect(host.textContent).toContain("channels.unauthorized"); +}); +it("can enable a disabled account", async () => { + multiBotFixture([{ ...botAccounts[0], enabled: false }]); + await render(); + expect( + host.querySelector(".runtime-channels-accounts select") + ?.value, + ).toBe("bot-a"); + await click("channels.enableAccount"); + expect(request).toHaveBeenCalledWith( + expect.anything(), + "/feishu/accounts/bot-a", + expect.objectContaining({ method: "PATCH", body: '{"enabled":true}' }), + ); +}); +it("locks account switching during a write and handles a toggle failure", async () => { + multiBotFixture(); + const original = request.getMockImplementation()!; + let failWrite!: (error: unknown) => void; + request.mockImplementation((ep, path, init) => + init?.method === "PATCH" + ? new Promise((_done, fail) => { + failWrite = fail; + }) + : original(ep, path, init), + ); + await render(); + await selectBot("bot-b"); + await click("channels.disableAccount"); + expect( + host.querySelector(".runtime-channels-accounts select") + ?.disabled, + ).toBe(true); + await act(async () => failWrite(new ChannelApiError(502))); + expect(host.textContent).toContain("channels.requestFailed"); + expect(host.textContent).toContain("Bot A"); +}); +it("aborts an old account diagnostic and ignores its late response", async () => { + multiBotFixture(); + const original = request.getMockImplementation()!; + let finish!: (data: unknown) => void; + let oldSignal!: AbortSignal; + request.mockImplementation((ep, path, init) => + path === "/feishu/diagnostics?appId=bot-a" + ? new Promise((done) => { + finish = done; + oldSignal = init!.signal as AbortSignal; + }) + : original(ep, path, init), + ); + await render(); + await selectBot("bot-a"); + await selectBot("bot-b"); + expect(oldSignal.aborted).toBe(true); + await act(async () => + finish({ + configured: true, + appId: "bot-a", + appName: "Stale bot", + missingConfiguration: [], + }), + ); + expect(host.textContent).not.toContain("Stale bot"); +}); +it("does not treat an ambiguous diagnostic as uncertain registration", async () => { + multiBotFixture(); + const original = request.getMockImplementation()!; + request.mockImplementation((ep, path, init) => + path.includes("diagnostics") + ? Promise.reject(new ChannelApiError(409)) + : original(ep, path, init), + ); + await render(); + await selectBot("bot-b"); + expect(host.textContent).toContain("channels.accountConflict"); + expect(host.textContent).not.toContain("channels.uncertain"); +}); +it("still blocks uncertain registration when adding a bot", async () => { + multiBotFixture(); + const original = request.getMockImplementation()!; + request.mockImplementation((ep, path, init) => + path === "/feishu/bindings" + ? Promise.reject(new ChannelApiError(409)) + : original(ep, path, init), + ); + await render(); + await click("channels.addAccount"); + await click("channels.bind"); + expect(host.textContent).toContain("channels.uncertain"); +}); +it("adds via QR and selects the returned appId", async () => { + multiBotFixture(); + const original = request.getMockImplementation()!; + request.mockImplementation((ep, path, init) => + path === "/feishu/bindings" + ? Promise.resolve({ ...pending, status: "BOUND", appId: "bot-b" }) + : original(ep, path, init), + ); + await render(); + await click("channels.addAccount"); + await click("channels.bind"); + expect( + host.querySelector(".runtime-channels-accounts select") + ?.value, + ).toBe("bot-b"); + expect(host.textContent).not.toContain("channels.feishuPairingDescription"); +}); diff --git a/frontend/vitest.mpa-cron.config.ts b/frontend/vitest.mpa-cron.config.ts index 2e6ac8d75..bcc244c8a 100644 --- a/frontend/vitest.mpa-cron.config.ts +++ b/frontend/vitest.mpa-cron.config.ts @@ -2,7 +2,11 @@ import { defineConfig } from "vitest/config"; export default defineConfig({ test: { environment: "jsdom", - include: ["tests/mpaCronTasks.test.tsx", "tests/mpaManagement.test.tsx"], + include: [ + "tests/mpaCronTasks.test.tsx", + "tests/mpaManagement.test.tsx", + "tests/mpaTaskBots.test.tsx", + ], coverage: { provider: "v8", include: [ diff --git a/prd-spec/features/mpa-feishu-multi-bot/2026-10-09-studio-multi-bot.md b/prd-spec/features/mpa-feishu-multi-bot/2026-10-09-studio-multi-bot.md new file mode 100644 index 000000000..1d3c71e79 --- /dev/null +++ b/prd-spec/features/mpa-feishu-multi-bot/2026-10-09-studio-multi-bot.md @@ -0,0 +1,81 @@ +# Studio multi-bot Feishu management + +[中文版](2026-10-09-studio-multi-bot.zh.md) + +- Change ID: mpa-feishu-multi-bot +- Created/revised: 2026-10-09 +- Status: implemented; verification limits recorded +- Scope: Studio only; agentkit-mpa-agent owns Bot persistence, Gateway registration, session routing and migration. +- Contracts: [MPA channels](../../../specs/mpa-channels/README.md), [MPA tasks](../../../specs/studio-mpa-cron-tasks/README.md). + +## Background and evidence + +The local agentkit-mpa-agent feat/feishu-bots implementation advertises multiBotChannels=[feishu] and accountScopedPermissions=true. GET channels can contain multiple Feishu accounts identified by appId and enabled. Diagnostics without appId returns 409 when ambiguous. Studio currently queries unscoped diagnostics/permissions and treats every 409 as uncertain registration. Its task editor drops delivery.appId when changing a target. Runtime proxy already supports PATCH and administrator-only channel management. + +## Goals and non-goals + +Expose independent Feishu accounts, additive QR/manual binding, enable/disable/unbind, account-scoped diagnostics and group permissions, and explicit task delivery accounts. Preserve legacy single-bot Runtime and WeCom/DingTalk behavior. Do not change MPA persistence, Runtime creation/images, chat rendering, gateway authentication or deploy services. Live cloud writes and real message delivery are outside this local verification. + +## Scenarios and requirements + +- FR-1: Enable multi-bot UI only when capabilities.multiBotChannels contains feishu. Missing capability retains legacy behavior; failed requests are errors rather than empty lists. +- FR-2: Fetch GET channels and show account name, appId and enabled state. One account may be selected automatically; multiple accounts require an explicit selection. Adding a bot uses existing QR/manual endpoints and selects the returned appId after refreshing. +- FR-3: PATCH feishu/accounts/{appId} with enabled and DELETE root with channel/appId affect only the target. Unbind requires confirmation. Failed writes preserve inputs and existing accounts; no secrets in persistence or errors. +- FR-4: Diagnostics and permission GET/POST/DELETE always carry the selected appId on multi-bot Runtime. Composite identity prevents same-chat collisions. Distinguish ambiguous account selection from REGISTRATION_UNCERTAIN; only registration conflicts block binding. +- FR-5: MPA Feishu task creation/edit/copy selects a Bot and retains delivery.appId with target and unchanged thread metadata. Multiple bots never silently choose the first. Web delivery omits appId. Disabled/missing accounts block new Feishu writes. Existing tasks missing appId require selection when ambiguous. Preserve legacy task behavior if multi-bot capability is absent. +- FR-6: Account/Runtime/provider changes abort reads and polling; late responses cannot replace selection. Single-flight mutations lock account switching; cancellation does not claim to undo server writes. Cover loading, empty, error, retry, keyboard/IME and narrow screens. + +## Design and boundaries + +Reuse existing provider panel for binding and scoped account details, existing Select/Button and task dialog layouts. Add an account container gated by capabilities; fetch list before scoped details. Multi-bot management never probes unscoped diagnostics. Account controls are separate from additive binding. Only nonsecret account summaries are retained in React memory. The existing trusted Runtime proxy injects channel credentials. User-scoped cron requests retain current ownership and use delivery.appId inside the unchanged delivery object. Task account choices use existing authorized channel requests; lack of permission is shown and blocks multi-bot Feishu submission, without all-user or credential fallback. + +No new dependency, database migration, cloud resource or general-agent behavior. Older runtimes do not receive new fields/endpoints. Public API changes are additive and capability-gated. UI inherits existing tokens and uses no new product icons. + +## Tasks and affected files + +| Task | Requirements | Files / verification | +| --- | --- | --- | +| T-1 | FR-1..6 | This bilingual PRD and both component contracts; manual design review | +| T-2 | FR-1..4,6 | adk/client.ts, ui/RuntimeChannels.tsx, new Feishu account container, locale pairs; failing frontend regression tests first | +| T-3 | FR-5..6 | cronjobs/MpaTaskEditor.tsx, MpaCronTasks.tsx, locale pairs; task regression tests first | +| T-4 | FR-1..6 | channel and task tests, frontend test/build, proxy Python tests, browser fixtures, frontend README bilingual section, generated veadk/webui | + +## Acceptance and verification + +AC-1: Two accounts can be displayed, independently selected/toggled/deleted, and adding B leaves A intact (FR-1..3, T-2). +AC-2: Same chat under A/B stays scoped in diagnostics and permission CRUD; ambiguous reads do not disable registration (FR-4, T-2). +AC-3: Task create/edit/copy keeps the intended appId; switching Web removes it; unavailable Bot and stale responses fail safely (FR-5..6, T-3). +AC-4: Legacy Feishu/WeCom/DingTalk regressions pass; normal, loading/error/retry, IME/keyboard and narrow browser fixture checks pass (FR-1,6, T-4). +AC-5: npm --prefix frontend test; npm --prefix frontend run build; targeted Vitest channel/task tests; uv run --extra dev pytest tests/test_mpa_channel_proxy_policy.py tests/frontend/server/test_mpa_cron.py. Record actual outcomes. Existing task coverage gate applies when affected; no harness-sidecar change. + +## Risks and rollout + +The MPA changes are local/unpublished; offline fixtures do not prove live double-bot delivery. Deploy compatible Runtime before enabling multiple accounts. Group management uses administrator-only channel APIs; non-admin task users may not list bots and must see a permission error rather than an invented default. UI refresh cannot revoke in-flight Gateway operations. No automatic rollback/deletion/migration. + +## Review and delivery record + +User approved the complete proposed scope with “改改看” on 2026-10-09. review-spec is unavailable; reviewed requirements, compatibility, identity, permission boundaries, errors, cancellation, tests and bilingual equivalence directly. No design blocker identified. frontend/SPEC.md and foundation Specification read; referenced frontend-design/ui-ux-pro-max skill files absent in repository and installed skill locations; use established components and direct UI review without adding a competing design system. + +Initial baseline: Baseline feat/from-main-20261009 at f8c96211; clean working tree before this design; git pull --ff-only origin main reports already up to date. No commits, cloud writes or deployment authorized by this design. + +## Implementation review and verification (2026-10-09) + +Tested scope: working-tree changes on `feat/from-main-20261009`, based on `f8c96211`. T-1 through T-4 are implemented. `frontend/README.md` retains its existing mixed-language convention; both languages were updated there rather than introducing a second README. Component contracts and locale pairs were updated together. No Python production code changed. Manual implementation review checked account identity, additive binding, permission boundaries, stale reads, cancellation, single-flight writes and task metadata. A QR completion selection race found by regression testing was fixed before delivery. + +| Check | Outcome | Evidence / limits | +| --- | --- | --- | +| Failing regression before implementation | pass | New channel/task tests failed on the original implementation: 8 failed, 50 passed. | +| Targeted frontend regression | pass | `cd frontend && npx vitest run --environment jsdom tests/runtimeChannels.test.tsx tests/feishuAccounts.test.ts tests/mpaTaskBots.test.tsx tests/mpaManagement.test.tsx tests/mpaCronTasks.test.tsx src/adk/channels.test.ts`: 162 passed. | +| Default frontend suite | pass | `npm --prefix frontend test`: 1,376 Node tests and 47 Vitest tests passed. | +| MPA task coverage | pass | `npm --prefix frontend run test:mpa-cron-coverage`: 87 passed; statements 99.31%, branches 97.44%, functions 99.18%, lines 99.74%; existing thresholds unchanged. | +| TypeScript | pass | `cd frontend && npx tsc --noEmit`. | +| Localization | pass | `npm --prefix frontend run check:i18n`. | +| Build / packaged assets | pass | `npm --prefix frontend run build`; `npm --prefix frontend run test:webui-assets`: 113 files / 350 internal references verified. Build retains the existing large-chunk warning. | +| Backend proxy / task regression | pass | `uv run --extra dev pytest tests/test_mpa_channel_proxy_policy.py tests/frontend/server/test_mpa_cron.py`: 18 passed, with a Starlette deprecation warning. Existing proxy forwards appId and PATCH without a new backend contract. | +| Browser fixture flows | pass | Actual components with local simulated APIs: explicit account selection, independent enable/disable, additive manual binding and returned-account selection, scoped group save, task bot selection/payload, loading/provider navigation, empty/error/retry, legacy UI and keyboard navigation. At 390 px, document width equals viewport width and diagnostics use one column. Narrow nested cards were corrected during QA. Temporary fixture removed after checking. | +| Native browser confirmation / IME | blocked | In-app browser could not complete the native unbind confirmation; no real account was touched. Automated tests cover confirmation and selected-account deletion, IME composition guards and cancellation. Chinese input was checked in the browser; native OS IME was not exercised by this tool. | +| Live double-bot delivery | not_run | Requires a separately deployed compatible MPA image and explicit live-operation authorization. Simulated API checks do not establish Gateway delivery. | +| Ruff / Pyright / harness-sidecar coverage | not_applicable | No Python or harness-sidecar implementation changed. | +| Commit-time synchronization / pre-commit | not_run | No commit requested. Fetch/rebase and all-files pre-commit remain required before a future commit. | + +Initial invocation without jsdom failed on browser globals and was corrected; it is not a runtime failure. AC-1 through AC-3 are covered by regression tests and applicable fixture flows; AC-4 browser coverage has the native-tool limits above; AC-5 gates passed. The implementation does not change general-agent chat rendering, cloud resources or deployment images. Production rollout still requires compatible Runtime deployment and a live smoke test. No commit, push or deployment was performed. diff --git a/prd-spec/features/mpa-feishu-multi-bot/2026-10-09-studio-multi-bot.zh.md b/prd-spec/features/mpa-feishu-multi-bot/2026-10-09-studio-multi-bot.zh.md new file mode 100644 index 000000000..36048bdf1 --- /dev/null +++ b/prd-spec/features/mpa-feishu-multi-bot/2026-10-09-studio-multi-bot.zh.md @@ -0,0 +1,81 @@ +# Studio 飞书多机器人管理 + +[English](2026-10-09-studio-multi-bot.md) + +- 变更 ID:mpa-feishu-multi-bot +- 创建/修订:2026-10-09 +- 状态:implemented;已记录验证限制 +- 范围:仅 Studio;agentkit-mpa-agent 负责 Bot 持久化、Gateway 注册、会话路由和迁移。 +- 契约:[MPA 消息渠道](../../../specs/mpa-channels/README.zh.md)、[MPA 定时任务](../../../specs/studio-mpa-cron-tasks/README.zh.md)。 + +## 背景与证据 + +本地 agentkit-mpa-agent 的 feat/feishu-bots 实现声明 multiBotChannels=[feishu] 和 accountScopedPermissions=true。GET channels 可返回多个由 appId 和 enabled 标识的飞书账号。诊断未带 appId 且存在歧义时返回 409。Studio 当前请求不区分账号的诊断/群权限,将所有 409 当作注册不确定。任务编辑器修改目标时会丢失 delivery.appId。Runtime 代理已支持 PATCH 及仅管理员可访问的渠道管理。 + +## 目标与非目标 + +支持独立飞书账号、扫码/手动新增绑定、启停/解绑、账号级诊断及群权限,并明确任务投递账号。保留旧单机器人 Runtime 以及企微/钉钉行为。不修改 MPA 持久化、Runtime 创建/镜像、聊天展示、网关鉴权,不发布服务。真实云写操作与真实消息投递不属于本地验证。 + +## 场景与需求 + +- FR-1:仅 capabilities.multiBotChannels 包含 feishu 时启用多机器人 UI。缺少声明时沿用旧行为;请求失败显示错误,不伪装为空列表。 +- FR-2:GET channels 展示账号名称、appId、启停状态。仅一个账号可自动选择,多个账号须明确选择。新增使用既有扫码/手动接口,刷新后选中返回的 appId。 +- FR-3:PATCH feishu/accounts/{appId} 的 enabled 和带 channel/appId 的根 DELETE 仅影响目标账号。解绑须确认。失败保留输入和现有账号;密钥不持久化或进入错误。 +- FR-4:多机器人 Runtime 的诊断和群权限 GET/POST/DELETE 均携带选定 appId。组合身份避免同群冲突。区分账号歧义与 REGISTRATION_UNCERTAIN;仅注册冲突阻止绑定。 +- FR-5:MPA 飞书任务创建/编辑/复制须选择 Bot,并与目标及未变更的话题元数据一起保留 delivery.appId。多个 Bot 禁止默认选择第一项。Web 投递不带 appId。停用/缺失账号阻止新增飞书写操作。旧任务缺 appId 且有歧义时须选择。未声明多机器人能力则保留旧任务行为。 +- FR-6:切换账号/Runtime/渠道取消读取和轮询,迟到响应不能覆盖选择。单次写操作锁住账号切换;取消不表示撤销服务端写入。覆盖加载、空、错误、重试、键盘/IME 与窄窗口。 + +## 设计与边界 + +复用既有渠道面板用于绑定及账号详情,复用 Select/Button 和任务弹窗布局。增加能力控制的账号容器,先取列表再查指定账号详情。多机器人管理不探测无账号诊断。账号操作与新增绑定分开。React 内存仅保留非敏感账号摘要。既有可信 Runtime 代理注入渠道凭据。用户级定时任务保留当前所属身份,在既有 delivery 对象中携带 delivery.appId。任务账号选择使用已授权的渠道请求;无权限明确显示错误并阻止多机器人飞书提交,不回退全用户或其他凭据。 + +不新增依赖、数据库迁移、云资源或通用智能体行为。旧 Runtime 不接收新字段/接口。公开 API 为能力控制的兼容扩展。UI 沿用现有变量,不增加产品图标。 + +## 任务与影响文件 + +| 任务 | 需求 | 文件 / 验证 | +| --- | --- | --- | +| T-1 | FR-1..6 | 本双语 PRD 和两套组件契约;直接设计评审 | +| T-2 | FR-1..4,6 | adk/client.ts、ui/RuntimeChannels.tsx、新飞书账号容器、双语文案;先写失败前端回归测试 | +| T-3 | FR-5..6 | cronjobs/MpaTaskEditor.tsx、MpaCronTasks.tsx、双语文案;先写任务回归测试 | +| T-4 | FR-1..6 | 渠道/任务测试、前端 test/build、代理 Python 测试、浏览器夹具、frontend README 双语段落和 veadk/webui 产物 | + +## 验收与验证 + +AC-1:两个账号可展示、独立选择/启停/解绑,新增 B 保留 A(FR-1..3、T-2)。 +AC-2:A/B 同群的诊断及权限 CRUD 均区分账号;歧义读取不禁用注册(FR-4、T-2)。 +AC-3:任务创建/编辑/复制保留 appId,切换 Web 清除,不可用 Bot 和迟到响应安全失败(FR-5..6、T-3)。 +AC-4:旧飞书/企微/钉钉回归通过;正常、加载/错误/重试、IME/键盘和窄窗口浏览器夹具通过(FR-1,6、T-4)。 +AC-5:执行 npm --prefix frontend test、npm --prefix frontend run build、渠道/任务定向 Vitest、uv run --extra dev pytest tests/test_mpa_channel_proxy_policy.py tests/frontend/server/test_mpa_cron.py,记录真实结果。影响定时任务时执行既有覆盖率门禁;本次不涉及 harness-sidecar。 + +## 风险与上线 + +MPA 改动仍在本地且未发布;离线夹具不能证明真实双 Bot 投递。先部署兼容 Runtime 再启用多账号。群管理使用仅管理员可用的渠道接口,非管理员任务用户可能无法列出账号,必须显示权限错误,不能杜撰默认账号。刷新 UI 不能撤销在途 Gateway 操作。不自动回滚/删除/迁移。 + +## 评审与交付记录 + +用户于 2026-10-09 以“改改看”批准完整建议范围。review-spec 不可用,已直接评审需求、兼容、身份、权限边界、错误、取消、测试及双语等价,无设计阻塞。已读 frontend/SPEC.md 和 foundation Specification;引用的 frontend-design/ui-ux-pro-max 技能文件在仓库及已安装技能路径均不存在,沿用既有组件并直接 UI 评审,不另建竞争设计系统。 + +初始基线:基线 feat/from-main-20261009 的 f8c96211;设计前工作区干净;git pull --ff-only origin main 已最新。本设计不授权提交、云写操作或发布。 + +## 实现评审与验证(2026-10-09) + +测试范围:`feat/from-main-20261009` 基于 `f8c96211` 的工作区改动。T-1 至 T-4 已实现。`frontend/README.md` 沿用既有混合双语约定,在同一文件同步两种语言,未新建第二份 README。组件契约与语言文件已同步更新,未修改 Python 生产代码。直接实现评审检查了账号身份、追加绑定、权限边界、迟到读取、取消、单次写操作和任务元数据。回归测试发现的扫码完成后账号选择竞态已修复。 + +| 检查 | 结果 | 证据 / 限制 | +| --- | --- | --- | +| 实施前失败回归 | pass | 新渠道/任务测试在原实现上为 8 失败、50 通过。 | +| 定向前端回归 | pass | `cd frontend && npx vitest run --environment jsdom tests/runtimeChannels.test.tsx tests/feishuAccounts.test.ts tests/mpaTaskBots.test.tsx tests/mpaManagement.test.tsx tests/mpaCronTasks.test.tsx src/adk/channels.test.ts`:162 通过。 | +| 默认前端测试 | pass | `npm --prefix frontend test`:1,376 项 Node 测试和 47 项 Vitest 测试通过。 | +| MPA 任务覆盖率 | pass | `npm --prefix frontend run test:mpa-cron-coverage`:87 通过;语句 99.31%、分支 97.44%、函数 99.18%、行 99.74%,原阈值未改。 | +| TypeScript | pass | `cd frontend && npx tsc --noEmit`。 | +| 国际化 | pass | `npm --prefix frontend run check:i18n`。 | +| 构建 / 发布产物 | pass | `npm --prefix frontend run build`;`npm --prefix frontend run test:webui-assets`:校验 113 文件、350 内部引用。构建仍有既有大包警告。 | +| 后端代理 / 任务回归 | pass | `uv run --extra dev pytest tests/test_mpa_channel_proxy_policy.py tests/frontend/server/test_mpa_cron.py`:18 通过,有一项 Starlette 弃用警告。既有代理转发 appId 与 PATCH,无需新增后端契约。 | +| 浏览器夹具流程 | pass | 真实组件搭配本地模拟 API:明确选择账号、独立启停、手动追加绑定及返回账号选择、指定账号群权限保存、任务机器人选择与载荷、加载/切换渠道、空列表/错误/重试、旧界面和键盘导航。390 px 时文档与视口等宽,诊断为单列;QA 中已修正窄容器内卡片布局。临时夹具验证后移除。 | +| 浏览器原生确认 / IME | blocked | 应用内浏览器未能完成原生解绑确认框,未操作真实账号。自动化测试覆盖确认与指定账号删除、IME 组合输入保护和取消;浏览器验证了中文输入,工具未实际操作系统 IME。 | +| 真实双 Bot 投递 | not_run | 需要另行部署兼容 MPA 镜像及明确的真实操作授权;模拟接口不能证明 Gateway 投递。 | +| Ruff / Pyright / harness-sidecar 覆盖率 | not_applicable | 未修改 Python 或 harness-sidecar 实现。 | +| 提交前同步 / pre-commit | not_run | 未要求提交;后续提交前仍须 fetch/rebase 和全文件 pre-commit。 | + +初次未指定 jsdom 的命令因浏览器全局对象缺失失败,已更正,不属于运行时故障。AC-1 至 AC-3 由回归测试和适用夹具流程覆盖;AC-4 的浏览器覆盖受上述原生工具限制;AC-5 门禁通过。实现未修改通用智能体聊天展示、云资源或部署镜像。正式上线仍需兼容 Runtime 部署及真实冒烟验证。本次未提交、推送或部署。 diff --git a/prd-spec/features/mpa-feishu-multi-bot/2026-10-10-port-multi-bot.md b/prd-spec/features/mpa-feishu-multi-bot/2026-10-10-port-multi-bot.md new file mode 100644 index 000000000..76b8447c9 --- /dev/null +++ b/prd-spec/features/mpa-feishu-multi-bot/2026-10-10-port-multi-bot.md @@ -0,0 +1,72 @@ +# Port Studio multi-bot support to the upstream-based branch + +[中文](2026-10-10-port-multi-bot.zh.md) + +- Change ID: mpa-multi-bot-port; created/revised: 2026-10-10; status: implemented. +- Source: `49dd4696` on `feat/from-main-20261009`; target baseline: `f7576c40` on `feat/mpa-account-fixes-upstream-clean-20261010`. +- Design: [original feature](2026-10-09-studio-multi-bot.md). Contracts: [channels](../../../specs/mpa-channels/README.md), [tasks](../../../specs/studio-mpa-cron-tasks/README.md). + +## Background, goals and scope + +The source implements capability-gated Feishu account management and scheduled-task delivery. Target lacks the new containers and capability fields. Dry application accepts source/tests/spec changes; frontend README requires contextual reconciliation. User requests transferring this feature. Preserve current account-key work and unrelated package-lock edits. Do not merge unrelated branch history, change Runtime images/backend storage/authentication, or operate real bots. Historical source verification is not current-branch evidence. + +## Requirements and design + +- FR-1: Transfer the original FR-1–FR-6 semantics and regression cases: capability-gated multi-bot accounts, selected appId in diagnostics/permissions, additive binding, independent enable/disable/unbind, explicit task delivery, cancellation and stale-response handling. +- FR-2: Preserve older single-bot Runtime, WeCom/DingTalk and general-agent chat. Missing multiBotChannels keeps legacy UI; unsupported task capabilities (404) retain legacy task behavior. Authorization/network failures remain errors; never infer compatibility from an empty/error response. +- FR-3: Apply only feature source/tests/contracts/docs. Rebuild packaged assets from target sources rather than copying old bundles. Preserve all pre-existing local changes byte-for-byte. No dependency/lockfile changes needed; no new public Python or server API contract beyond the original capability-gated additions. + +Reused components: existing RuntimeChannels layout, provider tabs, Select, Radio, Button, task DialogShell and text-shimmer. No new product icon or component design. Ports use public component properties; direct foundation/S1–S8 and UI review substitutes for missing frontend-design/ui-ux-pro-max skill files. Contract responsibility remains with MPA for bot storage/routing and Studio for account selection/proxy requests. + +## Tasks and acceptance + +| Requirement | Task | Acceptance | +| --- | --- | --- | +| FR-1 | T-1 | AC-1: apply tests first and record failure; port source and verify channel/task cases | +| FR-2 | T-2 | AC-2: run legacy regressions and browser fixtures for normal/loading/empty/error/retry/cancellation/keyboard/narrow flows | +| FR-3 | T-3 | AC-3: regenerate assets, verify references/localization/types/security, reconcile bilingual README/spec/design and compare pre-existing file hashes | + +Commands: targeted Vitest (jsdom); npm --prefix frontend test; npm --prefix frontend run test:mpa-cron-coverage; npm --prefix frontend run build; npm --prefix frontend run check:i18n; npm --prefix frontend run test:webui-assets; local tsc --noEmit; uv run --extra dev pytest tests/test_mpa_channel_proxy_policy.py tests/frontend/server/test_mpa_cron.py. No Python production changes require new Ruff/Pyright gates for this port; previous key-feature gates remain separate. + +## Risks and review + +Multi-bot requires a compatible Runtime deployed separately. Non-admin users may be unable to list delivery bots; surface permission failures. Mock browser fixtures cannot establish real Feishu/Gateway delivery. Native confirmation/IME limitations must be recorded. No resource cleanup/migration is performed. + +Direct review (review-spec unavailable): checked source/target boundaries, preservation, capabilities, auth/errors, cancellation, tests and bilingual equivalence; no blocker. User approval: “把那个修改挪过来吧” after the scoped transfer plan. No commit/push/deployment authorized. Design/spec guidelines and frontend foundation/SPEC read; referenced UI skills unavailable in repository and installed skill roots, so established component behavior is retained. + +## Verification record + +Scope: source/test/document and regenerated WebUI diff against `f7576c4080da6230e263eac20ab5d32644405ed5`; execution date: 2026-10-10. T-1–T-3 and AC-1–AC-3 completed with the live-verification limits below. + +| Check | Result | Evidence | +| --- | --- | --- | +| Test-first targeted Vitest | fail, expected | Before source migration: 27 new tests failed and account helper import was missing; 123 existing tests passed | +| Targeted Vitest (jsdom) | pass | 6 files, 162 tests: channels, account response validation, task bots, management, cron and channel API | +| `npm --prefix frontend test` | pass | 1,377 Node tests and 65 Agent info/creation/details Vitest tests | +| `npm --prefix frontend run test:mpa-cron-coverage` | pass | 87 tests; statements 99.31%, branches 97.44%, functions 99.18%, lines 99.74%; configured gates met | +| `frontend/node_modules/.bin/tsc --noEmit` (frontend cwd) | pass | Current TypeScript source compiles | +| `npm --prefix frontend run check:i18n` | pass | Two locales, 21 namespaces consistent | +| `npm --prefix frontend run build` | pass | Studio and website integration regenerated from target sources; existing bundle-size warnings remain | +| `npm --prefix frontend run test:webui-assets` | pass | 113 packaged files, 350 internal references | +| Targeted Python command listed above | pass | 18 proxy-policy/cron tests | +| Isolated real-browser checks | pass | Mock API with real components: account selection, independently toggling B, scoped diagnostic/group requests, additive manual binding C preserving A/B, task B delivery/thread preservation, Web clearing appId, single-bot legacy view, unchanged DingTalk view, empty/error/retry/loading, abort on remount, cancel addition and keyboard selection; 390px viewport has no horizontal overflow, including task editor | +| Native unbind confirmation / real IME | blocked | In-app browser confirmation blocks CDP input; closed the affected test tab. Unbind/cancellation/stale requests and composition safeguards covered by component regressions; no actual IME session asserted | +| Gitleaks scoped directory scan (`--redact=100`) | pass | 24 migration source/test/document files, no finding | +| Preservation and document review | pass | All 20 pre-existing dirty files retain identical SHA-256, including account-key changes and package-lock; paired docs, relative links and whitespace checked | +| Ruff/Pyright and harness-sidecar coverage | not_applicable | No Python production or sidecar contract changes | +| Live Runtime/Feishu/Gateway writes | not_run | Compatible Runtime deployment and real delivery are outside this Studio migration | +| Commit-time fetch/rebase and full pre-commit | not_run | No commit requested | + +Implementation review: capability-gated ownership and backward compatibility match the contracts; bot diagnostics/groups/deletion and task delivery remain scoped; failed reads never become successful empty lists or arbitrary bot choices; abort/single-flight handling is preserved. No production changes to general chat, MPA provisioning, image defaults, IAM or model-key discovery. Temporary fixture/server and browser viewport overrides were removed. Historical source design evidence is retained separately. + +Documentation check note: the full frontend README link check reports an existing unavailable local-only `.agents` example link, already present at HEAD. All migrated links pass; that unrelated link was left unchanged. + +## Commit preparation (2026-10-10) + +User authorization: “把当前的修改都提交吧”. Commit only; no push or deployment. Fetched origin/upstream, then ran `git rebase --autostash upstream/main`: the upstream-based branch was already current and the autostash restored successfully. All 172 changed/deleted/untracked file states matched their pre-sync hashes; no production or test files changed during hooks. The user-authorized existing package-lock changes are included; `npm ci --prefix frontend --dry-run --ignore-scripts --offline` passes without changing the lockfile. + +- pass — `uv run --extra dev pre-commit run --all-files`: Ruff check/format, hardcoded-secret detection and YAML-secret scan. +- pass — changed Python production/test files checked with `uv tool run --from pyright pyright --pythonpath .venv/bin/python`: zero errors/warnings. +- pass — frontend full suite rerun after synchronization: 1,377 Node tests and 65 Vitest tests; multi-bot/channel/task regression rerun: 162 passed. Previous build, localization, coverage, asset and isolated browser evidence remains valid because synchronization/hooks changed no source or artifacts. +- fail, pre-existing baseline issue — `uv run --extra dev pytest -n 2 -m "not codex_smoke and not piagent_smoke"`: 6,933 passed, 53 skipped, four xfailed, one failed, 55 warnings, 412.63 seconds. The sole failure is `tests/frontend/server/runtime_artifacts/test_writer.py::test_success_uses_trusted_scope_and_hashes_utf8_bytes`: expected `text/markdown`, received `application/octet-stream`. The writer and test match HEAD byte-for-byte. An isolated `git archive HEAD` baseline using the repository Python environment reproduces the same failure; this host's `mimetypes.guess_type("summary.md")` returns `(None, None)`. Independent current writer suite reproduces it with 48 other tests passing. No unrelated MIME implementation/test change was added to this commit; the full suite is not represented as passing. This does not identify a regression in the submitted feature scope. +- pass — staged whitespace check and secret hooks; local `.env` remains ignored and excluded. Live Ark/Feishu/cloud verification and native browser confirmation/IME limits remain as recorded above; skipped tests do not establish live behavior. diff --git a/prd-spec/features/mpa-feishu-multi-bot/2026-10-10-port-multi-bot.zh.md b/prd-spec/features/mpa-feishu-multi-bot/2026-10-10-port-multi-bot.zh.md new file mode 100644 index 000000000..6c15d2727 --- /dev/null +++ b/prd-spec/features/mpa-feishu-multi-bot/2026-10-10-port-multi-bot.zh.md @@ -0,0 +1,72 @@ +# 将 Studio 多 Bot 支持迁入上游基础分支 + +[English](2026-10-10-port-multi-bot.md) + +- 变更 ID:mpa-multi-bot-port;创建/修订:2026-10-10;状态:implemented。 +- 来源:`feat/from-main-20261009` 的 `49dd4696`;目标基线:`feat/mpa-account-fixes-upstream-clean-20261010` 的 `f7576c40`。 +- 设计:[原功能](2026-10-09-studio-multi-bot.zh.md)。契约:[渠道](../../../specs/mpa-channels/README.zh.md)、[任务](../../../specs/studio-mpa-cron-tasks/README.zh.md)。 + +## 背景、目标和范围 + +来源实现了按能力开启的飞书账号管理和定时任务投递,目标缺少新容器及能力字段。补丁预检查允许源码/测试/规格改动,frontend README 须结合上下文合并。用户要求迁入该功能。保留当前账号 Key 功能与无关 package-lock 修改。不合并无关分支历史,不改 Runtime 镜像、后端存储/鉴权,不操作真实 Bot。原分支验证不是当前分支证据。 + +## 需求和设计 + +- FR-1:迁入原 FR-1–FR-6 语义及回归用例:按能力显示多个账号、诊断/群权限携带选定 appId、追加绑定、独立启停/解绑、明确任务投递账号、取消及迟到响应处理。 +- FR-2:保留旧单 Bot Runtime、企微/钉钉和通用智能体聊天。缺少 multiBotChannels 沿用旧 UI;任务能力接口不支持(404)时保留旧任务行为。鉴权/网络失败仍显示错误,不通过空/异常响应推断兼容能力。 +- FR-3:仅应用该功能源码/测试/契约/文档。基于目标源码重建打包产物,不复制旧压缩包。原有本地修改逐字节保留。无需依赖/锁文件改动;除原有能力控制的扩展外,不新增公开 Python 或服务端 API 契约。 + +复用既有 RuntimeChannels 布局、渠道 Tab、Select、Radio、Button、任务 DialogShell 和 text-shimmer。不新增产品图标或组件设计,使用公开组件属性。frontend-design/ui-ux-pro-max 技能文件缺失,直接执行 foundation/S1–S8 与 UI 审查,保持既有组件行为。Bot 存储/路由仍由 MPA 负责,Studio 负责账号选择与代理请求。 + +## 任务和验收 + +| 需求 | 任务 | 验收 | +| --- | --- | --- | +| FR-1 | T-1 | AC-1:先迁测试并记录失败,再迁源码,验证渠道/任务用例 | +| FR-2 | T-2 | AC-2:执行旧流程回归与浏览器夹具,覆盖正常/加载/空/错误/重试/取消/键盘/窄窗口 | +| FR-3 | T-3 | AC-3:重建产物,验证引用/国际化/类型/安全,同步双语 README/规格/设计并比较原有文件哈希 | + +命令:定向 Vitest(jsdom);npm --prefix frontend test;npm --prefix frontend run test:mpa-cron-coverage;npm --prefix frontend run build;npm --prefix frontend run check:i18n;npm --prefix frontend run test:webui-assets;本地 tsc --noEmit;uv run --extra dev pytest tests/test_mpa_channel_proxy_policy.py tests/frontend/server/test_mpa_cron.py。本次迁入无 Python 生产改动,无新增 Ruff/Pyright 检查对象;先前 Key 功能的检查保持独立。 + +## 风险和审查 + +多 Bot 需要另行部署兼容 Runtime。非管理员可能无法列出投递 Bot,须显示权限错误。模拟浏览器夹具不能证明真实飞书/Gateway 投递。原生确认/IME 限制须记录。不执行资源清理/迁移。 + +review-spec 不可用,直接审查源码/目标边界、原有修改保留、能力、鉴权/错误、取消、测试及双语等价,无阻塞。用户在限定迁入计划后批准:“把那个修改挪过来吧”。未授权提交/推送/部署。已读设计/规格规则及前端 foundation/SPEC;引用的 UI 技能在仓库和已安装路径不存在,沿用既有组件行为。 + +## 验证记录 + +范围:相对 `f7576c4080da6230e263eac20ab5d32644405ed5` 的源码/测试/文档及重建 WebUI 差异;执行日期:2026-10-10。T-1–T-3、AC-1–AC-3 已完成,真实验证限制如下。 + +| 检查 | 结果 | 证据 | +| --- | --- | --- | +| 定向 Vitest,测试先行 | fail,预期失败 | 迁源码前 27 个新增用例失败,账号辅助模块缺失;123 个既有用例通过 | +| 定向 Vitest(jsdom) | pass | 6 个文件、162 个测试:渠道、账号响应校验、任务机器人、管理、定时任务及渠道 API | +| `npm --prefix frontend test` | pass | 1,377 个 Node 测试及 65 个智能体信息/创建/详情 Vitest 测试 | +| `npm --prefix frontend run test:mpa-cron-coverage` | pass | 87 个测试;语句 99.31%、分支 97.44%、函数 99.18%、行 99.74%,满足配置门槛 | +| `frontend/node_modules/.bin/tsc --noEmit`(frontend 工作目录) | pass | 当前 TypeScript 源码编译通过 | +| `npm --prefix frontend run check:i18n` | pass | 两种语言、21 个命名空间一致 | +| `npm --prefix frontend run build` | pass | 基于目标源码重建 Studio 及网站集成,保留既有大包警告 | +| `npm --prefix frontend run test:webui-assets` | pass | 113 个打包文件、350 个内部引用 | +| 上述定向 Python 命令 | pass | 18 个代理策略/定时任务测试 | +| 隔离真实浏览器检查 | pass | 模拟 API、真实组件:账号选择、独立启停 B、按账号诊断/群权限请求、手动追加 C 且保留 A/B、任务 B 的投递/线程元数据保留、Web 清除 appId、旧单 Bot 页面、钉钉原界面、空/错误/重试/加载、重挂载取消请求、取消添加和键盘选择;390px 窗口及任务编辑均无横向溢出 | +| 原生解绑确认 / 真实 IME | blocked | 应用内浏览器确认框阻塞 CDP 输入,已关闭受影响测试标签;解绑/取消/迟到请求及输入法保护由组件回归覆盖,未声称实际 IME 验证 | +| Gitleaks 限定目录扫描(`--redact=100`) | pass | 24 个迁入源码/测试/文档文件,无发现 | +| 原有修改保留和文档审查 | pass | 原有 20 个未提交文件 SHA-256 完全一致,含账号 Key 功能及 package-lock;已检查双语文档、相对链接和空白 | +| Ruff/Pyright 及 harness-sidecar 覆盖率 | not_applicable | 未改 Python 生产代码或 sidecar 契约 | +| 真实 Runtime/飞书/Gateway 写入 | not_run | 兼容 Runtime 部署和真实投递不在本次 Studio 迁入范围 | +| 提交前 fetch/rebase 及全量 pre-commit | not_run | 未要求提交 | + +实现审查:按能力控制的职责和旧版本兼容符合契约;机器人诊断/群权限/解绑及任务投递保持账号范围;读取失败不会变成成功空列表或任意机器人选择,取消及防重复请求处理保留。未改通用聊天、MPA 创建、默认镜像、IAM 或模型 Key 发现生产代码。已删除临时夹具、停止服务并清除浏览器窗口尺寸覆盖;来源设计的历史证据单独保留。 + +文档检查说明:完整 frontend README 链接检查发现 HEAD 已有的 `.agents` 本地示例链接不可用;迁入链接全部通过,未改这个无关链接。 + +## 提交准备(2026-10-10) + +用户授权:“把当前的修改都提交吧”。仅提交,不推送或部署。已 fetch origin/upstream,再执行 `git rebase --autostash upstream/main`:上游基础分支已同步,自动暂存成功恢复。172 个修改/删除/未跟踪文件状态与同步前哈希一致,检查期间未改生产或测试文件。按用户授权包含已有 package-lock 改动;`npm ci --prefix frontend --dry-run --ignore-scripts --offline` 通过,未修改锁文件。 + +- pass — `uv run --extra dev pre-commit run --all-files`:Ruff 检查/格式化、硬编码凭据扫描及 YAML 密钥扫描。 +- pass — 已改 Python 生产/测试文件执行 `uv tool run --from pyright pyright --pythonpath .venv/bin/python`:零错误/警告。 +- pass — 同步后重跑前端完整测试:1,377 个 Node 测试及 65 个 Vitest 测试;重跑多 Bot/渠道/任务回归:162 个通过。同步及检查未改变源码/产物,此前构建、国际化、覆盖率、产物及隔离浏览器证据仍有效。 +- fail,基线已有问题 — `uv run --extra dev pytest -n 2 -m "not codex_smoke and not piagent_smoke"`:6,933 个通过、53 个跳过、四个 xfailed、一个失败、55 个警告,耗时 412.63 秒。唯一失败为 `tests/frontend/server/runtime_artifacts/test_writer.py::test_success_uses_trusted_scope_and_hashes_utf8_bytes`:期望 `text/markdown`,实际 `application/octet-stream`。写入实现及测试与 HEAD 逐字节一致,使用仓库 Python 环境运行隔离 `git archive HEAD` 基线可复现;本机 `mimetypes.guess_type("summary.md")` 返回 `(None, None)`。当前 writer 单独测试也复现,另 48 个用例通过。本提交未加入无关 MIME 实现/测试变更,不将全仓检查表述为通过;该结果未发现提交功能范围的回归。 +- pass — 暂存差异空白检查及密钥钩子;本地 `.env` 保持忽略,未包含到提交。真实方舟/飞书/云验证及浏览器原生确认/IME 限制保持前述记录,跳过的测试不证明真实行为。 diff --git a/prd-spec/features/mpa-model-key-discovery/2026-10-10-account-ark-key.md b/prd-spec/features/mpa-model-key-discovery/2026-10-10-account-ark-key.md new file mode 100644 index 000000000..7cae2d327 --- /dev/null +++ b/prd-spec/features/mpa-model-key-discovery/2026-10-10-account-ark-key.md @@ -0,0 +1,69 @@ +# Deployment-account Ark key discovery + +[中文](2026-10-10-account-ark-key.zh.md) + +- Change ID: mpa-model-key-discovery; created/revised: 2026-10-10; status: implemented. +- Owner: managed MPA creation; contract: [Studio creation](../../../specs/studio-mpa-creation/README.md), CON-1/CON-16. + +- Successor: [newest-created selection](2026-10-10-latest-created-key.md) supersedes the default multiple-key rejection; the original implementation record below is retained. + +## Background and evidence + +The built-in profile currently resolves `VEADK_MPA_CONFIG_MODEL_AGENT_API_KEY` during local inspection. This requires plaintext configuration and permits an unrelated account's key. Existing `get_ark_token` supports ListApiKeys/GetRawApiKey but defaults to the first key and can include raw errors. A dedicated bounded adapter will reuse the stateless signed-request utility without changing general Agent authentication. ArkCLI documents that ListApiKeys contains masked values and GetRawApiKey retrieves the actual key: https://github.com/volcengine/ark-cli/blob/main/skills/arkcli-profile/references/arkcli-profile-keys.md. The legacy ArkClaw client supports Id/Name without Status and returns Total; current VeADK supports TotalCount. Neither proves that a selected key can invoke the configured model. + +## Goals, non-goals and scenarios + +Automatically read an existing Ark key with deployment AK/SK or rotating STS; retain explicit private CLI configuration. Do not create/rotate keys, change existing Runtimes, modify general Agent behavior, or perform paid inference to test model access. All cloud verification in this change is simulated. If no key exists, the operator creates one in Ark; multiple matches require an exact selector. + +## Requirements + +- FR-1: Built-in local inspection needs no model secret or cloud call and ignores the obsolete model-key environment override. Add `managed.model-key` with mode `explicit` (CLI default) or `ark` (Studio default), optional mutually exclusive api-key-id/api-key-name and project-name=default. Studio selectors use `VEADK_MPA_ARK_API_KEY_ID` / `VEADK_MPA_ARK_API_KEY_NAME`; these are identifiers, not raw keys. +- FR-2: Ark mode only accepts a fresh OpenAI-compatible Ark template in the selected region and rejects model-key/provider/base environment overrides. After STS verification and before resource mutations, read keys using the same refreshed, account-checked credential source. List all pages (100 items, at most 100 pages), validate totals/IDs and deduplicate overlapping IDs. Select an exact ID/name or exactly one candidate; zero/multiple matches fail. A present Status must be Active; legacy absent Status is supported without claiming active-state verification. Use only GetRawApiKey.ApiKey, never masked Key fields. +- FR-3: Each HTTP read has 10-second connect and 30-second read timeouts. Retry connection/timeouts, throttling and availability at most three attempts with asynchronous 0.2/0.5-second delays. Permanent errors and malformed responses fail immediately. Cancellation stops new requests and mutations; an already-running read may finish within its timeout, but its result is discarded. Refresh credentials before each attempt; account changes fail. No CreateApiKey or inference call. +- FR-4: Raw values stay in a copied in-memory profile and the authorized Runtime environment. No values in logs, exceptions, config summaries, task/SQLite records or repository files. Emit allowlisted operation/category diagnostics. Existing pending deployment hashes continue rejecting changed keys/configurations on retry; discovery is repeated and never silently bypasses ambiguity. Runtime-held secrets remain platform-owned. +- FR-5: Keep explicit CLI key/reference/template behavior. Remove only the two obsolete local .env assignments after tests; retain other configuration and file permissions. No frontend fields/build artifacts or dependencies change. + +## Design and affected files + +Add managed/model_key.py; update config.py, studio_profile.py, service.py and diagnostic allowlists. Reuse volcengine_signed_request with local signing state; do not use the global-state signer or generic get_ark_token fallback. The adapter returns a fresh Profile. Deployment permissions already include ark:ListApiKeys and ark:GetRawApiKey; customer roles must grant them. Selection does not certify model activation, IP allowlists or model permissions; these remain deployment prerequisites. Configured=true means local validity, not successful live access. API response types and task stages are unchanged. Maintain paired managed READMEs and Studio component contract. + +## Tasks and acceptance + +T-1 / AC-1 (FR-1/FR-5): failing loader/route tests, then local configuration changes; preserve explicit CLI tests. +T-2 / AC-2 (FR-2/FR-3): adapter tests for STS, pagination, ambiguity, exact selectors, legacy/status responses, malformed/empty responses, transient/permanent failures, account changes and cancellation. +T-3 / AC-3 (FR-4): service ordering and safe injection tests; errors, diagnostics and summaries exclude raw values; retries retain existing hash conflict semantics. +T-4 / AC-4 (FR-5): targeted and full managed/CLI authentication regressions, changed-file Ruff/Pyright, paired document/link/whitespace review, scoped secret scan; safely remove obsolete local assignments. Live cloud and browser checks are not_run: no cloud mutations authorized and no UI change. + +## Risks and recovery + +No/multiple accessible keys and missing read permissions stop at checking; configure a selector or correct Ark permissions. An active key can still lack model access or become revoked; no runtime refresh/rotation is promised. Changed key material can block a pending retry rather than silently replacing its credentials. Existing agents are untouched. Restore explicit private CLI settings to retain manual-key provisioning if required; do not restore plaintext into tracked files. + +## Review and approval + +Direct review (review-spec unavailable): consistent boundaries, no added dependencies, bounded reads/cancellation, redacted provider failures, explicit legacy compatibility and paired-language semantics; no blockers. User approved the automatic-account-key approach in “帮我这么改,然后需要删掉这个.env文件是不是”. This approval does not authorize commit/push/deployment. + +## Verification record + +Date: 2026-10-10. Tested scope: working-tree diff on f7576c40; no commit/push/deployment. + +- pass — test-first loader/route run reproduced three missing-key/default failures (82 existing cases passed); new adapter test collection failed before the module existed. +- pass — `uv run --extra dev pytest tests/integrations/mpa_managed tests/cli/test_cli_mpa.py tests/cli/test_frontend_deploy_iam.py tests/auth/veauth/test_ark_veauth.py -n 2 -q --no-cov`: 739 passed, including discovery, simulated complete Studio creation, explicit CLI/generic Ark authentication compatibility and IAM permissions. Two workers follow the repository default resource budget. Rerun after .env cleanup also passed. +- pass — `uv tool run --from ruff==0.11.12 ruff check <11 changed Python files>` and `ruff format --check`: all pass. `uv tool run --from pyright pyright --pythonpath .venv/bin/python <11 changed Python files>`: zero errors. A baseline copy of test_iam.py reproduced its nine existing type errors; minimal test-only types/assertions and typed Worker construction resolved them without production IAM changes. +- pass — `uv build --wheel --no-build-isolation --out-dir ` and wheel inspection: new model_key.py and stateless signer included, .env excluded. No release artifacts were added to the checkout. +- pass — Gitleaks v8.24.2 directory scan of all changed/new tracked-scope files with redaction, `git diff --check`, paired-language requirement/acceptance identifiers and added relative links review. +- pass — private .env cleanup removed only VEADK_MPA_CONFIG_MODEL_AGENT_API_KEY and VEADK_MPA_CONFIG_PGPASSWORD assignments, retained other lines and file mode, and verified ignored/untracked status. No values were printed or copied to evidence. +- not_applicable — frontend build/tests and Codex smoke: no frontend, generated JavaScript or harness change. Existing HTTP shapes and deployment Runtime payloads are covered by Python route and simulated provisioning tests. +- not_run — browser/live Ark/model inference/cloud deployment: no UI change and no live cloud verification authorized. Actual account permissions, key availability, model activation and network/IP restrictions remain unverified. +- not_run — all-file pre-commit and full-repository tests: no commit requested; the scoped secret scan, static gates and complete affected suites ran instead. + +Implementation review: no raw secrets in persistence/results/errors; stateless signing avoids cross-request global mutations; refreshed credentials preserve account checks; no extra requests after cancellation; existing explicit model auth stays unchanged. All T-1–T-4 and AC-1–AC-4 are complete with the live-verification limit above. + +## Commit preparation (2026-10-10) + +User authorization: “把当前的修改都提交吧”. Commit only; no push or deployment. Fetched origin/upstream, then ran `git rebase --autostash upstream/main`: the upstream-based branch was already current and the autostash restored successfully. All 172 changed/deleted/untracked file states matched their pre-sync hashes; no production or test files changed during hooks. The user-authorized existing package-lock changes are included; `npm ci --prefix frontend --dry-run --ignore-scripts --offline` passes without changing the lockfile. + +- pass — `uv run --extra dev pre-commit run --all-files`: Ruff check/format, hardcoded-secret detection and YAML-secret scan. +- pass — changed Python production/test files checked with `uv tool run --from pyright pyright --pythonpath .venv/bin/python`: zero errors/warnings. +- pass — frontend full suite rerun after synchronization: 1,377 Node tests and 65 Vitest tests; multi-bot/channel/task regression rerun: 162 passed. Previous build, localization, coverage, asset and isolated browser evidence remains valid because synchronization/hooks changed no source or artifacts. +- fail, pre-existing baseline issue — `uv run --extra dev pytest -n 2 -m "not codex_smoke and not piagent_smoke"`: 6,933 passed, 53 skipped, four xfailed, one failed, 55 warnings, 412.63 seconds. The sole failure is `tests/frontend/server/runtime_artifacts/test_writer.py::test_success_uses_trusted_scope_and_hashes_utf8_bytes`: expected `text/markdown`, received `application/octet-stream`. The writer and test match HEAD byte-for-byte. An isolated `git archive HEAD` baseline using the repository Python environment reproduces the same failure; this host's `mimetypes.guess_type("summary.md")` returns `(None, None)`. Independent current writer suite reproduces it with 48 other tests passing. No unrelated MIME implementation/test change was added to this commit; the full suite is not represented as passing. This does not identify a regression in the submitted feature scope. +- pass — staged whitespace check and secret hooks; local `.env` remains ignored and excluded. Live Ark/Feishu/cloud verification and native browser confirmation/IME limits remain as recorded above; skipped tests do not establish live behavior. diff --git a/prd-spec/features/mpa-model-key-discovery/2026-10-10-account-ark-key.zh.md b/prd-spec/features/mpa-model-key-discovery/2026-10-10-account-ark-key.zh.md new file mode 100644 index 000000000..dc12dbb60 --- /dev/null +++ b/prd-spec/features/mpa-model-key-discovery/2026-10-10-account-ark-key.zh.md @@ -0,0 +1,69 @@ +# 部署账号方舟 Key 自动发现 + +[English](2026-10-10-account-ark-key.md) + +- 变更 ID:mpa-model-key-discovery;创建/修订:2026-10-10;状态:implemented。 +- 归属:托管 MPA 创建;契约:[Studio 创建](../../../specs/studio-mpa-creation/README.zh.md),CON-1/CON-16。 + +- 后续:[最新创建选择](2026-10-10-latest-created-key.zh.md)取代默认拒绝多个 Key 的规则;下文保留原实现记录。 + +## 背景和证据 + +内置配置目前在本地检查时解析 `VEADK_MPA_CONFIG_MODEL_AGENT_API_KEY`,需要明文配置且可能使用其他账号的 Key。现有 `get_ark_token` 支持 ListApiKeys/GetRawApiKey,但默认选第一把且可能包含原始错误。新增有界适配器复用无全局状态的签名请求工具,不改变通用智能体鉴权。ArkCLI 文档说明 ListApiKeys 返回掩码,GetRawApiKey 获取真实 Key:https://github.com/volcengine/ark-cli/blob/main/skills/arkcli-profile/references/arkcli-profile-keys.md。旧 ArkClaw 客户端支持缺少 Status 的 Id/Name,计数字段为 Total;当前 VeADK 支持 TotalCount。两者都不证明选中的 Key 能调用指定模型。 + +## 目标、非目标和场景 + +使用部署 AK/SK 或轮转 STS 自动读取现有方舟 Key;保留独立 CLI 显式私有配置。不创建/轮转 Key,不修改存量 Runtime 或通用智能体行为,不通过付费推理验证模型权限。本次云验证全部模拟。没有 Key 时由操作者在方舟创建;有多个匹配时要求精确选择。 + +## 需求 + +- FR-1:内置本地检查不需要模型密钥,不调用云接口,忽略旧模型 Key 环境变量覆盖。新增 `managed.model-key`,mode 为 `explicit`(CLI 默认)或 `ark`(Studio 默认);可选互斥的 api-key-id/api-key-name,project-name=default。Studio 选择器使用 `VEADK_MPA_ARK_API_KEY_ID` / `VEADK_MPA_ARK_API_KEY_NAME`,它们是标识而非明文 Key。 +- FR-2:Ark 模式只接受所选地域的全新 OpenAI 兼容方舟模板,拒绝环境覆盖模型 Key/provider/base。STS 核验后、资源变更前,使用相同的刷新及账号核验凭据源读取。遍历全部页面(每页 100,最多 100 页),校验总数/ID并去除重叠 ID。按精确 ID/名称选择,或要求恰好一个候选;零个/多个匹配失败。有 Status 时必须为 Active;兼容缺少 Status 的旧响应,不宣称已核验其状态。仅使用 GetRawApiKey.ApiKey,不使用掩码 Key 字段。 +- FR-3:每次 HTTP 读取连接超时 10 秒、读取超时 30 秒。连接/超时、限流、暂时不可用最多尝试三次,异步间隔 0.2/0.5 秒。永久错误和格式错误立即失败。取消后停止新请求和变更;已运行的读取可在超时内结束,但结果被丢弃。每次尝试前刷新凭据,账号变化失败。不调用 CreateApiKey 或推理。 +- FR-4:明文只在复制的内存 Profile 和授权的 Runtime 环境中,不进入日志、异常、配置摘要、任务/SQLite 记录或仓库文件。输出白名单操作/分类诊断。重试仍由现有部署请求哈希拒绝变更的 Key/配置;重新发现不静默绕过歧义。Runtime 保存的密钥归云平台管理。 +- FR-5:保留独立 CLI 显式 Key/引用 Runtime/模板行为。测试后只删除本地 .env 中两个旧赋值,保留其他配置及文件权限。不改前端字段/构建产物或依赖。 + +## 设计和影响文件 + +新增 managed/model_key.py,修改 config.py、studio_profile.py、service.py 和诊断白名单。复用使用局部签名状态的 volcengine_signed_request,不使用全局状态签名器或通用 get_ark_token 默认选择。适配器返回新的 Profile。部署权限已包含 ark:ListApiKeys 和 ark:GetRawApiKey,客户自管角色须自行授权。选择不证明模型开通、IP 白名单或模型权限,这些仍是部署前置条件。configured=true 表示本地有效,不代表真实访问成功。API 响应类型和任务阶段不变。维护双语 managed README 与 Studio 组件契约。 + +## 任务和验收 + +T-1 / AC-1(FR-1/FR-5):先写失败的加载/路由测试,再改本地配置;保留独立 CLI 测试。 +T-2 / AC-2(FR-2/FR-3):适配器覆盖 STS、分页、歧义、精确选择、旧/状态响应、畸形/空响应、暂时/永久错误、账号变化和取消。 +T-3 / AC-3(FR-4):服务调用顺序及安全注入测试;错误、诊断、摘要不含明文;重试保留原哈希冲突语义。 +T-4 / AC-4(FR-5):定向及全部 managed/CLI 鉴权回归、修改文件 Ruff/Pyright、双语文档/链接/空白审查、定向密钥扫描;安全移除旧本地赋值。真实云端和浏览器为 not_run:未授权云变更,且无 UI 改动。 + +## 风险和恢复 + +没有/多个可读 Key 或读取权限缺失时在 checking 阶段停止;配置选择器或修正方舟权限。Active Key 仍可能无模型访问权限或被撤销;不承诺 Runtime 自动刷新/轮转。Key 明文变化可能阻止未完成任务重试,不静默替换凭据。存量智能体不变。需要手动模式时可使用独立 CLI 私有配置,不把明文恢复进受版本控制的文件。 + +## 审查和批准 + +直接审查(review-spec 不可用):边界一致,无新增依赖,读取/取消有界,云错误脱敏,旧行为兼容和双语语义明确,无阻塞。用户在“帮我这么改,然后需要删掉这个.env文件是不是”批准了按账号自动获取方案。该批准不授权提交/推送/部署。 + +## 验证记录 + +日期:2026-10-10。验证范围:f7576c40 上的工作区差异;未提交/推送/部署。 + +- pass — 测试先行的加载/路由检查复现三个缺失 Key/默认值失败(82 个原用例通过);新增适配器测试在模块存在前收集失败。 +- pass — `uv run --extra dev pytest tests/integrations/mpa_managed tests/cli/test_cli_mpa.py tests/cli/test_frontend_deploy_iam.py tests/auth/veauth/test_ark_veauth.py -n 2 -q --no-cov`:739 个通过,覆盖发现、模拟完整 Studio 创建、显式 CLI/通用方舟鉴权兼容及 IAM 权限。两个 worker 遵循仓库默认资源预算。.env 清理后重跑也通过。 +- pass — `uv tool run --from ruff==0.11.12 ruff check <11 changed Python files>` 和 `ruff format --check` 全部通过。`uv tool run --from pyright pyright --pythonpath .venv/bin/python <11 changed Python files>` 零错误。test_iam.py 基线副本复现原有九个类型错误;通过最小的测试类型/断言和类型化 Worker 构造修复,未改生产 IAM。 +- pass — `uv build --wheel --no-build-isolation --out-dir ` 与 wheel 检查:包含新增 model_key.py 和无全局状态签名工具,排除 .env。未在工作区新增发布产物。 +- pass — Gitleaks v8.24.2 脱敏扫描全部本次修改/新增的版本控制范围文件、`git diff --check`、双语需求/验收标识及新增相对链接审查。 +- pass — 私有 .env 清理只移除 VEADK_MPA_CONFIG_MODEL_AGENT_API_KEY 和 VEADK_MPA_CONFIG_PGPASSWORD 赋值,保留其他行和文件权限,确认仍被忽略且未跟踪。未打印值或复制到证据。 +- not_applicable — 前端构建/测试和 Codex smoke:无前端、生成 JavaScript 或 harness 改动。原 HTTP 结构和部署 Runtime 请求由 Python 路由及模拟创建测试覆盖。 +- not_run — 浏览器/真实方舟/模型推理/云部署:无 UI 改动,未授权真实云验证。实际账号权限、Key 可用性、模型开通及网络/IP 限制仍未实测。 +- not_run — 全量 pre-commit 和全仓库测试:未要求提交;已执行定向密钥扫描、静态检查及全部受影响测试。 + +实现审查:明文不进入持久化/结果/错误;局部签名避免跨请求全局状态变更;刷新凭据保留账号核验;取消后无后续请求;原显式模型鉴权不变。T-1–T-4 与 AC-1–AC-4 已完成,真实验证限制如上。 + +## 提交准备(2026-10-10) + +用户授权:“把当前的修改都提交吧”。仅提交,不推送或部署。已 fetch origin/upstream,再执行 `git rebase --autostash upstream/main`:上游基础分支已同步,自动暂存成功恢复。172 个修改/删除/未跟踪文件状态与同步前哈希一致,检查期间未改生产或测试文件。按用户授权包含已有 package-lock 改动;`npm ci --prefix frontend --dry-run --ignore-scripts --offline` 通过,未修改锁文件。 + +- pass — `uv run --extra dev pre-commit run --all-files`:Ruff 检查/格式化、硬编码凭据扫描及 YAML 密钥扫描。 +- pass — 已改 Python 生产/测试文件执行 `uv tool run --from pyright pyright --pythonpath .venv/bin/python`:零错误/警告。 +- pass — 同步后重跑前端完整测试:1,377 个 Node 测试及 65 个 Vitest 测试;重跑多 Bot/渠道/任务回归:162 个通过。同步及检查未改变源码/产物,此前构建、国际化、覆盖率、产物及隔离浏览器证据仍有效。 +- fail,基线已有问题 — `uv run --extra dev pytest -n 2 -m "not codex_smoke and not piagent_smoke"`:6,933 个通过、53 个跳过、四个 xfailed、一个失败、55 个警告,耗时 412.63 秒。唯一失败为 `tests/frontend/server/runtime_artifacts/test_writer.py::test_success_uses_trusted_scope_and_hashes_utf8_bytes`:期望 `text/markdown`,实际 `application/octet-stream`。写入实现及测试与 HEAD 逐字节一致,使用仓库 Python 环境运行隔离 `git archive HEAD` 基线可复现;本机 `mimetypes.guess_type("summary.md")` 返回 `(None, None)`。当前 writer 单独测试也复现,另 48 个用例通过。本提交未加入无关 MIME 实现/测试变更,不将全仓检查表述为通过;该结果未发现提交功能范围的回归。 +- pass — 暂存差异空白检查及密钥钩子;本地 `.env` 保持忽略,未包含到提交。真实方舟/飞书/云验证及浏览器原生确认/IME 限制保持前述记录,跳过的测试不证明真实行为。 diff --git a/prd-spec/features/mpa-model-key-discovery/2026-10-10-latest-created-key.md b/prd-spec/features/mpa-model-key-discovery/2026-10-10-latest-created-key.md new file mode 100644 index 000000000..f9c4d8546 --- /dev/null +++ b/prd-spec/features/mpa-model-key-discovery/2026-10-10-latest-created-key.md @@ -0,0 +1,64 @@ +# Select the newest existing Ark key + +[中文](2026-10-10-latest-created-key.zh.md) + +- Change ID: mpa-latest-created-key; created/revised: 2026-10-10; status: implemented. +- Predecessor: [account-key discovery](2026-10-10-account-ark-key.md). +- Component: [Studio creation](../../../specs/studio-mpa-creation/README.md), CON-16. + +## Background and evidence + +`resolve_model_key` currently rejects multiple candidates without an exact selector. The user requests automatic selection of the latest-created key to preserve one-click creation. Existing pagination, account checks, status filtering and secret handling already belong to the discovery adapter. A read-only metadata probe could not load local deployment credentials; the live timestamp shape is unverified. The adapter will accept creation metadata explicitly and fail if it cannot establish which key is newest; list order is not evidence of creation order. + +## Goals, non-goals and scenarios + +Select the newest creation time among eligible keys in the configured project without extra configuration. Preserve explicit ID/name selection, generic Agent authentication, CLI explicit mode and existing Runtime credentials. Do not create keys, perform inference, persist raw keys, or migrate existing tasks. + +## Requirements and design + +- FR-1: With no selector and multiple eligible keys, read all existing bounded pages and select the maximum creation instant. Accept `CreateTime` (or `CreatedAt` / `CreationTime` compatibility fields), positive finite Unix seconds/milliseconds including numeric strings, or timezone-qualified ISO 8601. Normalize to UTC. Missing/invalid metadata on any eligible candidate fails before GetRawApiKey. Exactly one eligible key needs no timestamp. +- FR-2: Creation-time ties use the lexicographically greatest string ID, independent of page order; this is deterministic tie-breaking, not inferred chronology. Explicit ID/name selectors retain precedence and require exactly one match, including failure on duplicate names. Inactive keys are filtered before timestamp comparison; legacy absent Status remains supported without claiming active-state verification. +- FR-3: Account verification, refreshing credentials, cancellation, bounded retry, safe diagnostics and Runtime-only raw-key injection remain unchanged. Retry rediscovers keys; if a newer key appears after partial deployment, existing payload hashes may reject the change rather than silently replacing credentials. Existing agents are untouched. + +Affected files: `managed/model_key.py`, `test_model_key.py`, paired managed READMEs and Studio creation specs. No API shape, frontend, dependency or schema change. Timestamp parsing is an adapter concern; configuration selectors remain optional. + +## Tasks, tests and acceptance + +| Requirement | Task | Acceptance | Verification | +| --- | --- | --- | --- | +| FR-1 | T-1 | AC-1: newest selected across pages and timestamp formats; invalid metadata fails without raw lookup | Adapter regression tests, failing before implementation | +| FR-2 | T-2 | AC-2: explicit override, inactive filtering and tie ordering preserved | Adapter tests with reversed ordering, newer disabled key and older explicit selection | +| FR-3 | T-3 | AC-3: affected complete regression and static/security gates pass; documentation agrees | Managed/CLI/auth suites, Ruff, Pyright, Gitleaks, paired links and whitespace | + +## Risks and recovery + +Newest does not certify model permissions, IP restrictions or inference eligibility. Creation timestamps returned by the real account remain unverified; unsupported metadata fails safely and an explicit selector remains available. A key created during a pending task can change its payload and trigger the existing hash conflict. No implicit rotation or retry fallback is introduced. + +## Review and approval + +Direct review because review-spec is unavailable: bounded parsing, deterministic ordering, selector compatibility, secret isolation, cancellation and bilingual equivalence checked; no blockers. User approval: “账号下有多个key,选最新创建的那个吧”. This authorizes this selection change, not commit/push/deployment. The predecessor retains its historical selection decision; CON-16 and the maintained user docs describe the successor. + +## Verification record + +2026-10-10; working-tree scope on f7576c40. Implementation and regression results follow. Live metadata probe: blocked before a provider request by unavailable local deployment credentials; no raw key was read and no cloud resource was changed. Frontend/browser gates: not_applicable, no UI change. Full pre-commit and repository regression: not_run, no commit requested; complete affected suites and changed-file gates required. + + +- pass — test-first adapter run: 35 failures reproduced the missing newest-selection/error behavior, with 29 unchanged cases passing; after implementation, all 64 adapter cases passed. +- pass — `uv run --extra dev pytest tests/integrations/mpa_managed tests/cli/test_cli_mpa.py tests/cli/test_frontend_deploy_iam.py tests/auth/veauth/test_ark_veauth.py -n 2 -q --no-cov --tb=short`: 773 passed, rerun after the final type-narrowing repair. Two workers follow repository resource guidance; ten existing deprecation warnings remain. +- pass — `uv tool run --from ruff==0.11.12 ruff check` and `ruff format --check` on model_key.py and test_model_key.py; `uv tool run --from pyright pyright --pythonpath .venv/bin/python` on both files: zero errors after replacing a runtime-only type check with explicit type narrowing. +- pass — Gitleaks v8.24.2 redacted directory scan of all 19 changed/new source/document files, paired requirement/acceptance/task identifiers and relative design links, and `git diff --check`. +- blocked — live account timestamp verification: local deployment credentials unavailable; no ListApiKeys result or raw key was obtained. The API field aliases and timestamp formats are isolated, tested adapter inputs, not claimed live observations. +- not_applicable — frontend build/browser and Codex smoke: no UI/generated JavaScript/harness changes. +- not_run — all-file pre-commit/full repository suite: no commit requested; complete affected suites and scoped gates passed. + +Implementation review: all eligible timestamps are evaluated, inactive records do not affect selection, explicit selection skips time requirements, and ties are independent of list order. Error text never includes provider metadata or raw values. T-1–T-3 / AC-1–AC-3 are complete within the stated live-verification boundary. + +## Commit preparation (2026-10-10) + +User authorization: “把当前的修改都提交吧”. Commit only; no push or deployment. Fetched origin/upstream, then ran `git rebase --autostash upstream/main`: the upstream-based branch was already current and the autostash restored successfully. All 172 changed/deleted/untracked file states matched their pre-sync hashes; no production or test files changed during hooks. The user-authorized existing package-lock changes are included; `npm ci --prefix frontend --dry-run --ignore-scripts --offline` passes without changing the lockfile. + +- pass — `uv run --extra dev pre-commit run --all-files`: Ruff check/format, hardcoded-secret detection and YAML-secret scan. +- pass — changed Python production/test files checked with `uv tool run --from pyright pyright --pythonpath .venv/bin/python`: zero errors/warnings. +- pass — frontend full suite rerun after synchronization: 1,377 Node tests and 65 Vitest tests; multi-bot/channel/task regression rerun: 162 passed. Previous build, localization, coverage, asset and isolated browser evidence remains valid because synchronization/hooks changed no source or artifacts. +- fail, pre-existing baseline issue — `uv run --extra dev pytest -n 2 -m "not codex_smoke and not piagent_smoke"`: 6,933 passed, 53 skipped, four xfailed, one failed, 55 warnings, 412.63 seconds. The sole failure is `tests/frontend/server/runtime_artifacts/test_writer.py::test_success_uses_trusted_scope_and_hashes_utf8_bytes`: expected `text/markdown`, received `application/octet-stream`. The writer and test match HEAD byte-for-byte. An isolated `git archive HEAD` baseline using the repository Python environment reproduces the same failure; this host's `mimetypes.guess_type("summary.md")` returns `(None, None)`. Independent current writer suite reproduces it with 48 other tests passing. No unrelated MIME implementation/test change was added to this commit; the full suite is not represented as passing. This does not identify a regression in the submitted feature scope. +- pass — staged whitespace check and secret hooks; local `.env` remains ignored and excluded. Live Ark/Feishu/cloud verification and native browser confirmation/IME limits remain as recorded above; skipped tests do not establish live behavior. diff --git a/prd-spec/features/mpa-model-key-discovery/2026-10-10-latest-created-key.zh.md b/prd-spec/features/mpa-model-key-discovery/2026-10-10-latest-created-key.zh.md new file mode 100644 index 000000000..1885e3a02 --- /dev/null +++ b/prd-spec/features/mpa-model-key-discovery/2026-10-10-latest-created-key.zh.md @@ -0,0 +1,64 @@ +# 选择最新创建的已有方舟 Key + +[English](2026-10-10-latest-created-key.md) + +- 变更 ID:mpa-latest-created-key;创建/修订:2026-10-10;状态:implemented。 +- 前序:[按账号发现 Key](2026-10-10-account-ark-key.zh.md)。 +- 组件:[Studio 创建](../../../specs/studio-mpa-creation/README.zh.md),CON-16。 + +## 背景和证据 + +`resolve_model_key` 当前在没有精确选择器且存在多个候选时拒绝创建。用户要求自动选择最新创建的 Key,保持一键创建。分页、账号核验、状态过滤和密钥处理已由发现适配器负责。只读元数据探测无法加载本地部署凭据,真实时间字段结构尚未验证。适配器将明确接受创建时间元数据,无法判断最新时失败;列表顺序不能证明创建顺序。 + +## 目标、非目标和场景 + +无需额外配置,按配置项目内候选 Key 的创建时间选最新。保留显式 ID/名称选择、通用智能体鉴权、CLI 显式模式和现有 Runtime 凭据。不创建 Key、不调用推理、不持久化明文、不迁移现有任务。 + +## 需求和设计 + +- FR-1:没有选择器且存在多个候选时,遍历现有有界分页,选择最大创建时刻。接受 `CreateTime`(兼容 `CreatedAt` / `CreationTime`)、正且有限的 Unix 秒/毫秒(包括数字字符串)或带时区的 ISO 8601,统一为 UTC。任何候选的元数据缺失/无效时,在 GetRawApiKey 前失败。恰好一个候选无需时间字段。 +- FR-2:创建时间相同时选择字符串 ID 字典序最大者,与分页顺序无关;该规则用于稳定打破平局,不推断创建先后。显式 ID/名称优先且仍要求恰好一个匹配,包括重名时报错。非 Active Key 在时间比较前过滤;兼容缺少 Status 的旧响应,不宣称已核验其状态。 +- FR-3:账号核验、凭据刷新、取消、有界重试、安全诊断和只向 Runtime 注入明文保持不变。重试重新发现 Key;部分部署后出现新 Key 时,现有请求哈希可能拒绝变化,不静默替换凭据。存量智能体不变。 + +影响文件:`managed/model_key.py`、`test_model_key.py`、双语 managed README 和 Studio 创建规格。不改 API 结构、前端、依赖或数据结构。时间解析属于适配器职责,选择器仍可选。 + +## 任务、测试和验收 + +| 需求 | 任务 | 验收 | 验证 | +| --- | --- | --- | --- | +| FR-1 | T-1 | AC-1:跨页和不同时间格式选最新;异常元数据不读取明文 | 适配器回归测试,实现前失败 | +| FR-2 | T-2 | AC-2:保留显式覆盖、状态过滤和同时间稳定排序 | 反转列表顺序、较新禁用 Key、显式选较旧 Key 的适配器测试 | +| FR-3 | T-3 | AC-3:全部受影响回归与静态/安全检查通过,文档一致 | managed/CLI/auth 测试、Ruff、Pyright、Gitleaks、双语链接和空白检查 | + +## 风险和恢复 + +最新 Key 不证明模型权限、IP 限制或推理可用性。真实账号返回的创建时间仍未验证;不支持的元数据明确失败,可显式指定选择器恢复。未完成任务期间创建新 Key 可能改变请求并触发现有哈希冲突。不引入隐式轮转或重试回退。 + +## 审查和批准 + +review-spec 不可用,直接审查:确认有界解析、稳定排序、选择器兼容、密钥隔离、取消及双语等价,无阻塞。用户批准:“账号下有多个key,选最新创建的那个吧”。该批准授权选择规则改动,不授权提交/推送/部署。前序保留历史选择决策,CON-16 和维护中的用户文档描述后续规则。 + +## 验证记录 + +2026-10-10;f7576c40 上的工作区范围。实现和回归结果如下。真实元数据探测:blocked,本地部署凭据不可用,在云请求前失败;未读取明文或变更云资源。前端/浏览器:not_applicable,无 UI 改动。全量 pre-commit 和全仓库回归:not_run,未要求提交;须执行全部受影响测试和修改文件检查。 + + +- pass — 测试先行的适配器运行:35 个失败复现缺少最新选择/错误行为,29 个原用例通过;实现后全部 64 个适配器用例通过。 +- pass — `uv run --extra dev pytest tests/integrations/mpa_managed tests/cli/test_cli_mpa.py tests/cli/test_frontend_deploy_iam.py tests/auth/veauth/test_ark_veauth.py -n 2 -q --no-cov --tb=short`:773 个通过,最终类型收窄修复后重跑。两个 worker 遵循仓库资源规则,仍有十条原有弃用警告。 +- pass — 对 model_key.py 和 test_model_key.py 执行 `uv tool run --from ruff==0.11.12 ruff check`、`ruff format --check`;两文件执行 `uv tool run --from pyright pyright --pythonpath .venv/bin/python`:使用显式类型收窄替代仅运行时类型判断后,零错误。 +- pass — Gitleaks v8.24.2 脱敏目录扫描全部 19 个本次修改/新增的源码及文档、双语需求/验收/任务标识与设计相对链接、`git diff --check`。 +- blocked — 真实账号时间验证:本地部署凭据不可用,未获得 ListApiKeys 结果或明文 Key。字段别名和时间格式属于经过隔离测试的适配器输入,不宣称真实观测。 +- not_applicable — 前端构建/浏览器和 Codex smoke:无 UI、生成 JavaScript 或 harness 改动。 +- not_run — 全量 pre-commit/全仓库测试:未要求提交;全部受影响测试和定向检查已通过。 + +实现审查:比较全部候选时间,非 Active 记录不影响选择,显式选择无需时间字段,同时间排序不依赖列表顺序。错误文本不包含云元数据或明文。T-1–T-3 / AC-1–AC-3 在所述真实验证边界内完成。 + +## 提交准备(2026-10-10) + +用户授权:“把当前的修改都提交吧”。仅提交,不推送或部署。已 fetch origin/upstream,再执行 `git rebase --autostash upstream/main`:上游基础分支已同步,自动暂存成功恢复。172 个修改/删除/未跟踪文件状态与同步前哈希一致,检查期间未改生产或测试文件。按用户授权包含已有 package-lock 改动;`npm ci --prefix frontend --dry-run --ignore-scripts --offline` 通过,未修改锁文件。 + +- pass — `uv run --extra dev pre-commit run --all-files`:Ruff 检查/格式化、硬编码凭据扫描及 YAML 密钥扫描。 +- pass — 已改 Python 生产/测试文件执行 `uv tool run --from pyright pyright --pythonpath .venv/bin/python`:零错误/警告。 +- pass — 同步后重跑前端完整测试:1,377 个 Node 测试及 65 个 Vitest 测试;重跑多 Bot/渠道/任务回归:162 个通过。同步及检查未改变源码/产物,此前构建、国际化、覆盖率、产物及隔离浏览器证据仍有效。 +- fail,基线已有问题 — `uv run --extra dev pytest -n 2 -m "not codex_smoke and not piagent_smoke"`:6,933 个通过、53 个跳过、四个 xfailed、一个失败、55 个警告,耗时 412.63 秒。唯一失败为 `tests/frontend/server/runtime_artifacts/test_writer.py::test_success_uses_trusted_scope_and_hashes_utf8_bytes`:期望 `text/markdown`,实际 `application/octet-stream`。写入实现及测试与 HEAD 逐字节一致,使用仓库 Python 环境运行隔离 `git archive HEAD` 基线可复现;本机 `mimetypes.guess_type("summary.md")` 返回 `(None, None)`。当前 writer 单独测试也复现,另 48 个用例通过。本提交未加入无关 MIME 实现/测试变更,不将全仓检查表述为通过;该结果未发现提交功能范围的回归。 +- pass — 暂存差异空白检查及密钥钩子;本地 `.env` 保持忽略,未包含到提交。真实方舟/飞书/云验证及浏览器原生确认/IME 限制保持前述记录,跳过的测试不证明真实行为。 diff --git a/specs/mpa-channels/README.md b/specs/mpa-channels/README.md index cad1599fa..6011456f5 100644 --- a/specs/mpa-channels/README.md +++ b/specs/mpa-channels/README.md @@ -39,3 +39,10 @@ CON-14: Automations MPA channels management is limited to Studio admin/super_adm ## Configuration modes (2026-09-15) CON-15: All providers expose mutually exclusive Quick setup / Manual setup, defaulting to Quick setup on mount/provider/Runtime changes without persistence or automatic authorization. Manual Feishu uses POST `/api/v1/channels/feishu/bindings/manual` with `{appId, appSecret}` when `credentialBindingChannels` includes `feishu`; successful registration returns `{status: "BOUND", appId}` without credentials. Existing DingTalk/WeCom routes remain compatible. Both modes support configured bot replacement without first deleting the current binding. Method switches clear transient pairing/credentials, cancel frontend polling/SDK work and ignore late results; registration mutations prevent switching, and uncertain registration blocks new attempts across modes. Unsupported manual capability shows an upgrade message. The design and verification mapping are in [configuration modes](../../prd-spec/features/channel-configuration-modes/2026-09-15-channel-configuration-modes.md). + + +## Feishu multi-bot accounts (2026-10-09) + +CON-16: multiBotChannels containing feishu opts into account management. GET root returns channels with appId and enabled; multiple Feishu records are valid. Select an account before querying diagnostics or permission CRUD, always forwarding appId. POST permission includes appId, DELETE retains chat_id plus appId. PATCH /feishu/accounts/{appId} sets enabled; DELETE root removes only that account after confirmation. QR/manual binding adds a different appId and refreshes selection without replacing other accounts. Legacy capability absence retains single-account flows. Account ambiguity is not registration uncertainty. Target changes abort reads/polling and ignore late completion; mutations prevent switching. Secret handling and administrator proxy authorization remain unchanged. + +See [design](../../prd-spec/features/mpa-feishu-multi-bot/2026-10-09-studio-multi-bot.md). diff --git a/specs/mpa-channels/README.zh.md b/specs/mpa-channels/README.zh.md index bde0a8384..f6db81a82 100644 --- a/specs/mpa-channels/README.zh.md +++ b/specs/mpa-channels/README.zh.md @@ -39,3 +39,10 @@ CON-14:自动化 MPA 渠道页面仅允许 Studio admin/super_admin 管理; ## 配置方式(2026-09-15) CON-15:所有渠道提供互斥的“极速配置 / 手动配置”,挂载、切换渠道或 Runtime 时默认极速配置,不持久化选择、不自动发起授权。`credentialBindingChannels` 包含 `feishu` 时,飞书手动方式通过 POST `/api/v1/channels/feishu/bindings/manual` 提交 `{appId, appSecret}`;注册成功仅返回 `{status: "BOUND", appId}`,不含凭据。钉钉和企微的现有路由保持兼容。两种方式均支持替换已配置机器人,不先删除现有绑定。切换方式清空临时配对与凭据,取消前端轮询/SDK 工作并忽略迟到结果;注册写请求期间禁止切换,结果不确定时禁止通过任一方式再次注册。缺少手动能力时提示升级。完整方案和验证映射见[配置方式设计](../../prd-spec/features/channel-configuration-modes/2026-09-15-channel-configuration-modes.zh.md)。 + + +## 飞书多机器人账号(2026-10-09) + +CON-16:multiBotChannels 包含 feishu 时启用账号管理。根 GET 返回包含 appId 和 enabled 的 channels,允许多个飞书记录。诊断及群权限 CRUD 前先选择账号,始终转发 appId;权限 POST 带 appId,DELETE 保留 chat_id 并附 appId。PATCH /feishu/accounts/{appId} 设置 enabled;根 DELETE 经确认仅删除目标账号。扫码/手动绑定新增不同 appId 并刷新选择,不替换其他账号。缺少能力声明则沿用单账号流程。账号歧义不等于注册不确定。切换目标取消读取/轮询并忽略迟到结果,写入时禁止切换。密钥处理和管理员代理鉴权不变。 + +见[设计](../../prd-spec/features/mpa-feishu-multi-bot/2026-10-09-studio-multi-bot.zh.md)。 diff --git a/specs/studio-mpa-creation/README.md b/specs/studio-mpa-creation/README.md index 5ad9b4d1a..593d3fe28 100644 --- a/specs/studio-mpa-creation/README.md +++ b/specs/studio-mpa-creation/README.md @@ -21,7 +21,7 @@ VeADK owns managed YAML parsing, cloud/database orchestration, authorized durabl - **CON-16 — Studio MPA provenance tags:** Both the generic Studio MPA deployment path and managed one-click creation write `veadk:agent-type=mpa`, `veadk:managed=true`, `veadk:provisioner=studio-mpa`, trusted `veadk:owner`, and the owned `veadk:mpa-instance-id`. Missing trusted owner fails before cloud mutation, and the raw owner must hash to the task owner before child startup. The one-click route hashes this owner for local task and native registry ownership while passing the raw trusted owner ephemerally to the fixed child process for the Runtime tag; it is not persisted in task state. The shared provisioning service emits Studio provenance only when that route explicitly supplies the trusted Runtime owner, so `veadk mpa create` remains outside Studio discovery. Reconciliation replaces these owned keys, preserves unrelated non-system tags, and never replays `sys:*` tags. A legacy pending create with a persisted pre-provenance request hash replays the exact old create payload and client token, then applies the current provenance tags through the normal Runtime update before completing. Shared constants live in an internal MPA tag module and do not add a public Python API. Tags are discovery metadata, not authorization. Existing managed one-click Runtimes without `veadk:managed=true` require an explicit supported update/retry or future backfill before Studio lists them. Implemented and locally verified on 2026-09-29 by [Studio-created MPA Runtime filtering](../../prd-spec/features/studio-mpa-source-filter/2026-09-28-studio-mpa-source-filter.md); real-browser discovery remains a separate local acceptance step. -- **CON-1 — configuration:** Studio uses a code-owned Beijing profile and ignores `VEADK_MPA_CREATE_CONFIG`; its non-account Runtime settings retain the former private defaults; Studio image defaults use the two latest references in CON-9; the deployment account comes from verified STS identity; VPC/subnet/APIG IDs are not pinned. After automatic PG preparation, Studio resolves shared resources from `mpa_admin_workspace/mpa_admin_db` by verified account and region: validate/reuse registered resources, or create and persist missing VPC/subnet and APIG/IM Gateway through the existing locked provisioners. Existing records are never reset to bypass quotas. Explicit CLI adoption remains supported. See the [registry-owned network fix](../../prd-spec/bugfixes/mpa-shared-network-bootstrap/2026-09-28-registry-owned-network.md). `VEADK_MPA_CONFIG_MODEL_AGENT_API_KEY` and deployment credentials remain server-side requirements, never source literals. The child receives a built-in-profile marker and validates the same profile. CLI `--config` still accepts private YAML with `managed.version: 1`, kebab/snake aliases and unknown-key rejection. CLI `from-runtime` and `template-file` remain mutually exclusive; otherwise flat image/model/PG fields supply the template. CLI `database-admin-url-env` and `shared-database-url-env` resolve PostgreSQL URLs server-side; files/templates are limited to 256 KiB. HTTP clients cannot choose paths, commands, accounts or deployment/PG credentials; CON-11 allows a per-creation OpenViking API Key. Configuration checks are local; they do not prove live access. See [built-in profile design](../../prd-spec/features/mpa-agent-oneclick-provision/2026-09-23-studio-builtin-mpa-profile.md). +- **CON-1 — configuration:** Studio uses a code-owned Beijing profile and ignores `VEADK_MPA_CREATE_CONFIG`; its non-account Runtime settings retain the former private defaults; Studio image defaults use the two latest references in CON-9; the deployment account comes from verified STS identity; VPC/subnet/APIG IDs are not pinned. After automatic PG preparation, Studio resolves shared resources from `mpa_admin_workspace/mpa_admin_db` by verified account and region: validate/reuse registered resources, or create and persist missing VPC/subnet and APIG/IM Gateway through the existing locked provisioners. Existing records are never reset to bypass quotas. Explicit CLI adoption remains supported. See the [registry-owned network fix](../../prd-spec/bugfixes/mpa-shared-network-bootstrap/2026-09-28-registry-owned-network.md). Deployment credentials remain server-side requirements; the model key is discovered under CON-16, never a source literal. The child receives a built-in-profile marker and validates the same profile. CLI `--config` still accepts private YAML with `managed.version: 1`, kebab/snake aliases and unknown-key rejection. CLI `from-runtime` and `template-file` remain mutually exclusive; otherwise flat image/model/PG fields supply the template. CLI `database-admin-url-env` and `shared-database-url-env` resolve PostgreSQL URLs server-side; files/templates are limited to 256 KiB. HTTP clients cannot choose paths, commands, accounts or deployment/PG credentials; CON-11 allows a per-creation OpenViking API Key. Configuration checks are local; they do not prove live access. See [built-in profile design](../../prd-spec/features/mpa-agent-oneclick-provision/2026-09-23-studio-builtin-mpa-profile.md). - **CON-2 — preparation:** Operators supply PostgreSQL instance/registry/login/owner, IAM roles, images, model access and network connectivity. Verify cloud account and database permissions before preparing account VPC/subnet, APIG/IM Gateway, worker, isolated business database, Skill Space and Runtime. Explicit APIG adoption requires a configured matching VPC. Never assume a newly created VPC reaches private PostgreSQL. Release account locks before waiting for application readiness. - **CON-3 — identity:** Durable identity is verified account + region + stable agent ID. Native ownership markers, hashes, client tokens and session advisory locks govern reuse. Reject unrelated same-name resources and conflicting unfinished configuration. Persist `studio_owner` in the native deployment record; other owners and preexisting records without this owner cannot take over implicitly. CLI uses owner `cli`; Studio uses the hash of its authorized principal. - **CON-4 — initialization:** Use real Runtime metadata and shared APIG bootstrap, not legacy placeholder endpoint seeding. Require public/private networking, KeyAuth, MPA tags, bound worker/Skill Space and metadata/IM startup. Reference Runtime templates remove source identity, channel credentials, Skill Space and worker identity. Success requires platform Ready and application `/readiness`. @@ -172,3 +172,7 @@ Image rollback (2026-10-09): public registry discovery and automatic digest conv ### Managed Skill Space descriptions (CON-3/CON-4) New named deployments create `Description: Skills for MPA agent ` using the validated, trimmed entered name. Unnamed callers retain the internal-ID description. Space `Name`, `display_name`, ownership tags, IDs and bindings remain derived from internal identity. Existing/configured spaces are reused without description updates. Pending pre-upgrade requests retain their original description only when the complete old-description candidate matches the persisted `skill_space_request`; other pending-input changes remain errors. Unknown outcomes use discovery without blindly repeating CreateSkillSpace. See [description design](../../prd-spec/bugfixes/mpa-skill-space-description/2026-10-09-entered-name-description.md). + +## CON-16: Deployment-account Ark model key + +Defined by [account-key design](../../prd-spec/features/mpa-model-key-discovery/2026-10-10-account-ark-key.md): built-in Studio selects `managed.model-key.mode: ark`, with optional exact ID/name selectors (`VEADK_MPA_ARK_API_KEY_ID` / `VEADK_MPA_ARK_API_KEY_NAME`). Local inspection requires no raw model key or cloud access. Creation uses refreshed, STS-account-checked deployment credentials for ListApiKeys/GetRawApiKey before resource mutations. Read all pages and deduplicate IDs. Exact selectors require one match; otherwise multiple eligible keys select the newest creation instant, with lexicographically greatest string ID for ties. Accept CreateTime (CreatedAt/CreationTime compatibility), positive Unix seconds/milliseconds or timezone-qualified ISO 8601; missing/invalid time on any eligible candidate fails before raw lookup. A sole candidate needs no timestamp. Reject explicit non-Active states and support legacy missing Status. See the [newest-key successor](../../prd-spec/features/mpa-model-key-discovery/2026-10-10-latest-created-key.md). Never use masked values or create keys. The copied profile injects the raw key into Runtime only; provider text and credentials stay out of events, logs and task/bootstrap storage. Calls have bounded timeouts and at most three transient attempts; cancellation prevents subsequent mutations. Existing hash checks reject changed pending payloads. CLI defaults to explicit keys; general Agent auth is unchanged. Existing deployment roles already grant the two Ark actions; customer-owned roles need permission. Model activation/access and key IP rules remain operator prerequisites. diff --git a/specs/studio-mpa-creation/README.zh.md b/specs/studio-mpa-creation/README.zh.md index 2ad749957..b546a7f4e 100644 --- a/specs/studio-mpa-creation/README.zh.md +++ b/specs/studio-mpa-creation/README.zh.md @@ -21,7 +21,7 @@ VeADK 负责托管 YAML 解析、云服务/数据库编排、有权限约束的 - **CON-16 — Studio MPA 来源标签:**通用 Studio MPA 部署和托管式一键创建都写入 `veadk:agent-type=mpa`、`veadk:managed=true`、`veadk:provisioner=studio-mpa`、可信 `veadk:owner` 和其持有的 `veadk:mpa-instance-id`;可信 owner 缺失时必须在云变更前失败,且启动子进程前必须验证原始 owner 的哈希与任务 owner 一致。一键创建路由把 owner 哈希后用于本地任务和原生注册表归属,同时仅通过固定子进程把原始可信 owner 临时传递给 Runtime 标签,不把它持久化到任务状态。只有该路由显式提供可信 Runtime owner 时,共享 provisioning 服务才写入 Studio 来源,因此 `veadk mpa create` 不进入 Studio 发现范围。标签对账替换这些受管键、保留无关非系统标签,并且不重放 `sys:*` 标签。对于持久化了旧版无来源标签 request hash 的 pending create,先使用原始 create payload 与 client token 精确重放,再通过正常 Runtime update 写入当前来源标签后完成。共享常量位于内部 MPA 标签模块,不新增公共 Python API。标签是发现 metadata,不是授权凭据。缺少 `veadk:managed=true` 的历史托管式一键 Runtime 必须经过显式受支持的更新/重试或未来回填后,Studio 才会列出。已由 [Studio 创建的 MPA Runtime 过滤](../../prd-spec/features/studio-mpa-source-filter/2026-09-28-studio-mpa-source-filter.zh.md) 于 2026-09-29 实现并完成本地验证;真实浏览器发现仍是独立的本机验收步骤。 -- **CON-1 — 配置:** Studio 使用代码内置的北京地域配置并忽略 `VEADK_MPA_CREATE_CONFIG`;非账号 Runtime 设置保留原私有默认值;Studio 镜像默认值为 CON-9 中的两个 latest 地址;部署账号来自核验的 STS 身份;不固定 VPC/子网/APIG ID。自动准备 PG 后,Studio 按核验后的账号和地域读取 `mpa_admin_workspace/mpa_admin_db` 中的共享资源:校验并复用已登记资源,或通过现有带锁 provisioner 创建并保存缺失的 VPC/子网及 APIG/IM Gateway。不重置已有记录来绕过配额。CLI 显式接管仍受支持。参见[注册库驱动网络修复](../../prd-spec/bugfixes/mpa-shared-network-bootstrap/2026-09-28-registry-owned-network.zh.md)。`VEADK_MPA_CONFIG_MODEL_AGENT_API_KEY` 和部署凭据仍须由服务端提供,不写入源码。子进程收到内置配置标记并校验相同配置。CLI `--config` 继续接受私有 YAML;`managed.version: 1` 支持短横线/下划线别名并拒绝未知字段。CLI 的 `from-runtime` 与 `template-file` 互斥,否则通过平铺镜像/模型/PG 字段构建模板。CLI 的 `database-admin-url-env` 与 `shared-database-url-env` 在服务端解析 PostgreSQL URL;配置/模板文件最多 256 KiB。HTTP 客户端不能选择路径、命令、账号或部署/PG 凭据;CON-11 允许本次创建提供 OpenViking API Key。配置检查仅限本地,不证明真实访问权限。参见[内置配置设计](../../prd-spec/features/mpa-agent-oneclick-provision/2026-09-23-studio-builtin-mpa-profile.zh.md)。 +- **CON-1 — 配置:** Studio 使用代码内置的北京地域配置并忽略 `VEADK_MPA_CREATE_CONFIG`;非账号 Runtime 设置保留原私有默认值;Studio 镜像默认值为 CON-9 中的两个 latest 地址;部署账号来自核验的 STS 身份;不固定 VPC/子网/APIG ID。自动准备 PG 后,Studio 按核验后的账号和地域读取 `mpa_admin_workspace/mpa_admin_db` 中的共享资源:校验并复用已登记资源,或通过现有带锁 provisioner 创建并保存缺失的 VPC/子网及 APIG/IM Gateway。不重置已有记录来绕过配额。CLI 显式接管仍受支持。参见[注册库驱动网络修复](../../prd-spec/bugfixes/mpa-shared-network-bootstrap/2026-09-28-registry-owned-network.zh.md)。部署凭据仍须由服务端提供;模型 Key 按 CON-16 自动发现,不写入源码。子进程收到内置配置标记并校验相同配置。CLI `--config` 继续接受私有 YAML;`managed.version: 1` 支持短横线/下划线别名并拒绝未知字段。CLI 的 `from-runtime` 与 `template-file` 互斥,否则通过平铺镜像/模型/PG 字段构建模板。CLI 的 `database-admin-url-env` 与 `shared-database-url-env` 在服务端解析 PostgreSQL URL;配置/模板文件最多 256 KiB。HTTP 客户端不能选择路径、命令、账号或部署/PG 凭据;CON-11 允许本次创建提供 OpenViking API Key。配置检查仅限本地,不证明真实访问权限。参见[内置配置设计](../../prd-spec/features/mpa-agent-oneclick-provision/2026-09-23-studio-builtin-mpa-profile.zh.md)。 - **CON-2 — 准备:** 运维提供 PostgreSQL 实例/注册库/登录用户/属主、IAM 角色(内置配置自动准备)、镜像、模型权限和网络连通性。先核验云账号及数据库权限,再准备账号 VPC/子网、APIG/IM Gateway、worker、独立业务库、Skill Space 和 Runtime。显式接管 APIG 要求配置匹配 VPC。不得假设新 VPC 可访问私网 PostgreSQL。等待应用就绪前释放账号锁。 - **CON-3 — 身份:** 持久身份为已核验账号 + 地域 + 稳定智能体 ID。原生归属标记、哈希、client token 和会话 advisory lock 决定复用。拒绝无关同名资源及未完成配置冲突。在原生部署记录保存 `studio_owner`;其他所属用户或无该所属身份的已有记录不能被隐式接管。CLI 使用 `cli`,Studio 使用授权主体的哈希。 - **CON-4 — 初始化:** 使用真实 Runtime 元数据及共享 APIG 初始化,不进行旧占位 endpoint 回填。要求公私网、KeyAuth、MPA 标签、绑定 worker/Skill Space 及元数据/IM 启动初始化。参考 Runtime 模板移除来源身份、渠道凭据、Skill Space 和 worker 身份。成功要求平台 Ready 及应用 `/readiness`。 @@ -170,3 +170,7 @@ SubnetIds 按非空、唯一成员判断相同,不受平台返回顺序影响 ### 托管技能空间描述(CON-3/CON-4) 新的名称部署创建 `Description: Skills for MPA agent `,使用经过校验、去除首尾空白的手填名称。不提供名称的调用保留内部 ID 描述。空间 `Name`、`display_name`、归属标签、ID 及绑定仍由内部标识派生。已有/显式配置空间直接复用,不更新描述。升级前待完成请求仅在完整旧描述候选与持久化 `skill_space_request` 匹配时保留原描述;其他待完成输入变化仍报错。结果未知时通过发现恢复,不盲目重复 CreateSkillSpace。见[描述设计](../../prd-spec/bugfixes/mpa-skill-space-description/2026-10-09-entered-name-description.zh.md)。 + +## CON-16:部署账号方舟模型 Key + +[账号 Key 设计](../../prd-spec/features/mpa-model-key-discovery/2026-10-10-account-ark-key.zh.md)定义:内置 Studio 使用 `managed.model-key.mode: ark`,可选精确 ID/名称选择器(`VEADK_MPA_ARK_API_KEY_ID` / `VEADK_MPA_ARK_API_KEY_NAME`)。本地检查不需要模型明文 Key 或云访问。创建在资源变更前,使用刷新且经 STS 账号核验的部署凭据调用 ListApiKeys/GetRawApiKey。读取所有页面并去重 ID。精确选择器要求唯一匹配;否则多个候选按创建时刻选最新,同时间选择字符串 ID 字典序最大者。接受 CreateTime(兼容 CreatedAt/CreationTime)、正的 Unix 秒/毫秒或带时区 ISO 8601;任何候选时间缺失/异常时,在读取明文前失败。唯一候选无需时间字段。拒绝明确非 Active 状态,兼容缺少 Status 的旧响应。参见[最新 Key 后续设计](../../prd-spec/features/mpa-model-key-discovery/2026-10-10-latest-created-key.zh.md)。不使用掩码、不创建 Key。复制的 Profile 只向 Runtime 注入明文;原始云错误和凭据不进入事件、日志或任务/bootstrap 存储。调用超时有界,暂时错误最多三次尝试;取消后不继续变更。原请求哈希检查拒绝已提交的变更输入。CLI 默认显式 Key,通用智能体鉴权不变。默认部署角色已具备两个方舟动作;客户自管角色须授权。模型开通/访问及 Key IP 规则仍由操作者准备。 diff --git a/specs/studio-mpa-cron-tasks/README.md b/specs/studio-mpa-cron-tasks/README.md index f37d2077b..4f32cd107 100644 --- a/specs/studio-mpa-cron-tasks/README.md +++ b/specs/studio-mpa-cron-tasks/README.md @@ -2,7 +2,7 @@ [中文版](README.zh.md) -Revised 2026-09-15. Component ID: studio-mpa-cron-tasks. +Revised 2026-10-10. Component ID: studio-mpa-cron-tasks. Studio presents the selected Runtime's user-scoped scheduled tasks. MPA owns persistence, authorization, scheduling and execution. The Studio server owns Runtime access checks, trusted principal resolution and gateway credentials. No TOP/JWT acquisition or all-user fallback is performed. This contract supersedes the prior all-user viewer after MPA revert `91fd6a3`. @@ -34,3 +34,8 @@ See the [implementation and acceptance record](../../prd-spec/features/studio-mp The task editor hides executor Agent input. New tasks automatically use the selected Runtime ID as agentId; edits/copies preserve the original value. New task creation omits agentId. The Runtime resolves the configured Agent display name, falling back to its runtime agent name. Explicit IDs and edit/copy values remain unchanged. This supersedes the previous Runtime ID default. Approved by the user on 2026-09-15; review found no authentication or execution routing changes. + + +## Feishu delivery accounts (2026-10-09) + +For multi-bot-capable Runtime, create/edit/copy explicitly selects an enabled Feishu appId and saves delivery.appId. Multiple accounts never default to the first; unchanged delivery preserves thread metadata, and Web delivery removes appId. Missing/disabled accounts and permission/read failures block Feishu save with an actionable error. Legacy runtimes retain existing behavior. Bot choices use existing administrator-authorized channel APIs, without weakening task principal boundaries or falling back to another account. See [design](../../prd-spec/features/mpa-feishu-multi-bot/2026-10-09-studio-multi-bot.md). diff --git a/specs/studio-mpa-cron-tasks/README.zh.md b/specs/studio-mpa-cron-tasks/README.zh.md index db9265f49..c29c21ecb 100644 --- a/specs/studio-mpa-cron-tasks/README.zh.md +++ b/specs/studio-mpa-cron-tasks/README.zh.md @@ -2,7 +2,7 @@ [English](README.md) -修订日期:2026-09-15。组件 ID:studio-mpa-cron-tasks。 +修订日期:2026-10-10。组件 ID:studio-mpa-cron-tasks。 Studio 展示所选 Runtime 内按用户隔离的定时任务。MPA 负责持久化、授权、调度和执行;Studio 服务端负责 Runtime 访问检查、可信用户身份及网关凭证。不获取 TOP/JWT,不回退到全用户读取。MPA 撤销提交 `91fd6a3` 后,本契约替代之前的全用户查看器。 @@ -34,3 +34,8 @@ Studio 展示所选 Runtime 内按用户隔离的定时任务。MPA 负责持久 任务编辑器不展示执行 Agent 输入框。新任务自动使用所选 Runtime ID 作为 agentId;编辑和复制保留原值。 创建新任务不传 agentId,由 Runtime 使用配置中的 Agent 展示名称,缺失时回退运行时 Agent 名称。显式值及编辑/复制原值不变。此规则替代此前默认填写 Runtime ID 的处理。用户于 2026-09-15 明确批准;复核确认不改变鉴权和执行路由。 + + +## 飞书投递账号(2026-10-09) + +声明多机器人能力的 Runtime 在创建/编辑/复制时须明确选择启用的飞书 appId,并保存 delivery.appId。多个账号不默认选择第一项;未变更投递保留话题元数据,Web 投递移除 appId。缺失/停用账号、权限/读取失败阻止飞书保存并给出可执行错误。旧 Runtime 保留现有行为。账号选择使用既有管理员授权渠道 API,不放宽任务用户身份边界,不回退其他账号。见[设计](../../prd-spec/features/mpa-feishu-multi-bot/2026-10-09-studio-multi-bot.zh.md)。 diff --git a/tests/integrations/mpa_managed/test_config.py b/tests/integrations/mpa_managed/test_config.py index 66f035e19..3e6603239 100644 --- a/tests/integrations/mpa_managed/test_config.py +++ b/tests/integrations/mpa_managed/test_config.py @@ -35,7 +35,8 @@ def test_studio_profile_uses_builtin_beijing_defaults_without_yaml(monkeypatch): assert "CLAW_SPACE_ID" not in profile.managed.runtime.env assert "RUNTIME_IAM_ROLE_TRN" not in profile.managed.runtime.env assert "RUNTIME_IAM_ROLE_NAME" not in profile.managed.runtime.env - assert profile.values["model_api_key"] == "test-model-key" + assert not profile.values.get("model_api_key") + assert profile.managed.model_key.mode == "ark" postgres = profile.managed.postgres assert postgres is not None assert postgres.mode == "auto" @@ -56,12 +57,9 @@ def test_standalone_postgres_bootstrap_path_keeps_adk_default(): ) -def test_studio_profile_requires_model_key_and_rejects_other_regions(monkeypatch): +def test_studio_profile_discovers_model_key_and_rejects_other_regions(monkeypatch): monkeypatch.delenv("VEADK_MPA_CONFIG_MODEL_AGENT_API_KEY", raising=False) - with pytest.raises( - ConfigurationError, match="VEADK_MPA_CONFIG_MODEL_AGENT_API_KEY" - ): - load_studio_profile(region="cn-beijing") + assert load_studio_profile(region="cn-beijing").summary()["configured"] is True monkeypatch.setenv("VEADK_MPA_CONFIG_MODEL_AGENT_API_KEY", "test-model-key") with pytest.raises(ConfigurationError, match="selected region"): load_studio_profile(region="cn-shanghai") diff --git a/tests/integrations/mpa_managed/test_iam.py b/tests/integrations/mpa_managed/test_iam.py index 681567635..0320109f2 100644 --- a/tests/integrations/mpa_managed/test_iam.py +++ b/tests/integrations/mpa_managed/test_iam.py @@ -18,10 +18,11 @@ import copy import json from types import SimpleNamespace +from typing import Any import pytest -from veadk.integrations.mpa.managed.config import Managed, load_studio_profile +from veadk.integrations.mpa.managed.config import Managed, Worker, load_studio_profile from veadk.integrations.mpa.managed.iam import ( ACTIONS, POLICY_NAME, @@ -36,15 +37,15 @@ class FakeIAM: def __init__(self): - self.role = None - self.policy = None + self.role: dict[str, Any] | None = None + self.policy: dict[str, Any] | None = None self.bindings = {("unrelated", "Custom")} self.calls = [] - self.fail = None + self.fail: str | None = None self.hidden = 0 self.race = False - async def call(self, method, **params): + async def call(self, method, **params) -> dict[str, Any]: self.calls.append((method, params)) if self.fail == method: raise IamError("AccessDenied") @@ -100,6 +101,7 @@ async def test_new_role_and_policy_converge_and_retry_is_additive(race): assert cloud.bindings == {("unrelated", "Custom"), (POLICY_NAME, "Custom")} | { (name, "System") for name in SYSTEM_POLICIES } + assert cloud.role is not None assert json.loads(cloud.role["TrustPolicyDocument"]) == TRUST_DOCUMENT cloud.calls.clear() await ensure_runtime_role(cloud, "123", poll_interval=0) @@ -135,6 +137,7 @@ async def test_partial_failure_preserves_state_and_same_identity_can_resume(): async def test_conflicting_existing_resources_are_never_overwritten(problem, key): cloud = FakeIAM() await ensure_runtime_role(cloud, "123", poll_interval=0) + assert cloud.role is not None and cloud.policy is not None if problem == "account": cloud.role["Trn"] = f"trn:iam::456:role/{ROLE_NAME}" elif problem == "trust": @@ -181,7 +184,9 @@ async def test_readback_timeout_and_cancellation_keep_resources(): def test_default_modes_and_auto_rejects_custom_sources(monkeypatch): monkeypatch.setenv("VEADK_MPA_CONFIG_MODEL_AGENT_API_KEY", "test-key") assert load_studio_profile(region="cn-beijing").managed.iam.mode == "auto" - assert Managed(version=1, worker={"image": "repo/image:tag"}).iam.mode == "existing" + assert ( + Managed(version=1, worker=Worker(image="repo/image:tag")).iam.mode == "existing" + ) for extra in [ {"from_runtime": "r-reference"}, {"template_file": "x.json"}, @@ -274,6 +279,7 @@ async def test_role_failure_stops_before_identity_and_pg(monkeypatch): profile.values["account_id"] = "123" runtime = SimpleNamespace(account_id=AsyncMock(return_value="123")) monkeypatch.setattr(service, "RuntimeCloud", lambda **kwargs: runtime) + monkeypatch.setattr(service, "resolve_model_key", AsyncMock(return_value=profile)) prepare = AsyncMock(side_effect=IamError("AccessDenied")) identity = AsyncMock() monkeypatch.setattr(service, "ensure_runtime_role", prepare) diff --git a/tests/integrations/mpa_managed/test_model_key.py b/tests/integrations/mpa_managed/test_model_key.py new file mode 100644 index 000000000..6ba8b2051 --- /dev/null +++ b/tests/integrations/mpa_managed/test_model_key.py @@ -0,0 +1,467 @@ +# Copyright (c) 2025 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Isolated account-key discovery and safe Runtime handoff contracts.""" + +import asyncio +import threading +from types import SimpleNamespace +from unittest.mock import AsyncMock + +import pytest +import requests + +from veadk.integrations.mpa.managed import model_key, service +from veadk.integrations.mpa.managed.config import ( + ConfigurationError, + load_studio_profile, +) +from veadk.integrations.mpa.managed.diagnostics import diagnostic_scope + + +class Cloud: + region = "cn-beijing" + + def __init__(self): + self.count = 0 + + def _credentials(self): + self.count += 1 + return SimpleNamespace( + access_key_id=f"test-ak-{self.count}", + secret_access_key="test-sk", + session_token=f"test-sts-{self.count}", + ) + + +def setup(monkeypatch, pages, *, raw="test-private-model-value"): + calls = [] + + def request(**kw): + calls.append(kw) + if kw["query"]["Action"] == "ListApiKeys": + return {"Result": pages[kw["request_body"]["PageNumber"] - 1]} + return {"Result": {"ApiKey": raw}} + + monkeypatch.setattr(model_key, "volcengine_signed_request", request) + return calls + + +def key(identifier="1", name="mpa", **kw): + return {"Id": identifier, "Name": name, **kw} + + +def test_discovery_is_account_scoped_and_only_injects_into_copy(monkeypatch): + monkeypatch.setenv("VEADK_MPA_CONFIG_MODEL_AGENT_API_KEY", "obsolete-other-account") + calls = setup(monkeypatch, [{"Items": [key(Status="Active")], "TotalCount": 1}]) + profile = load_studio_profile() + cloud = Cloud() + selected = asyncio.run(model_key.resolve_model_key(profile, cloud)) + assert selected.values["model_api_key"] == "test-private-model-value" + assert not profile.values.get("model_api_key") + assert "test-private-model-value" not in str(selected.summary()) + assert "test-private-model-value" not in repr(selected) + assert [c["query"]["Action"] for c in calls] == ["ListApiKeys", "GetRawApiKey"] + assert calls[-1]["request_body"] == {"Id": 1, "ProjectName": "default"} + assert calls[-1]["ak"] == "test-ak-2" + assert calls[-1]["header"]["X-Security-Token"] == "test-sts-2" + assert all(c["timeout"] == (10, 30) and c["region"] == cloud.region for c in calls) + selected.values.update(pg_host="pg.example", pg_user="app", pg_password="fake") + template = service.fresh_template(selected, "mi-123456789abc", "test-account") + env = {row["Key"]: row["Value"] for row in template["Envs"]} + assert env["MODEL_AGENT_API_KEY"] == "test-private-model-value" + + +def test_exact_selection_paginates_and_deduplicates(monkeypatch): + monkeypatch.setenv("VEADK_MPA_ARK_API_KEY_NAME", "wanted") + calls = setup( + monkeypatch, + [ + {"Items": [key(name="other")], "TotalCount": 3}, + {"Items": [key(name="other"), key("2", "wanted")], "TotalCount": 3}, + {"Items": [key("3", "last")], "TotalCount": 3}, + ], + ) + asyncio.run(model_key.resolve_model_key(load_studio_profile(), Cloud())) + assert len(calls) == 4 + assert calls[-1]["request_body"]["Id"] == 2 + + +@pytest.mark.parametrize( + "selector", ["", "VEADK_MPA_ARK_API_KEY_NAME", "VEADK_MPA_ARK_API_KEY_ID"] +) +def test_multiple_candidates_choose_newest_unless_explicit(monkeypatch, selector): + if selector: + monkeypatch.setenv(selector, "2" if selector.endswith("ID") else "second") + calls = setup( + monkeypatch, + [ + { + "Items": [ + key(CreateTime=1700000001), + key("2", "second", CreateTime=1700000000), + ], + "Total": 2, + } + ], + ) + asyncio.run(model_key.resolve_model_key(load_studio_profile(), Cloud())) + assert calls[-1]["request_body"]["Id"] == (2 if selector else 1) + + +def test_newest_selection_scans_all_pages_and_filters_inactive(monkeypatch): + calls = setup( + monkeypatch, + [ + {"Items": [key("90", CreateTime="2026-10-09T12:00:00Z")], "TotalCount": 4}, + { + "Items": [ + key("2", CreateTime="2026-10-10T12:00:00+08:00"), + key("3", Status="Disabled", CreateTime="2026-10-11T12:00:00Z"), + ], + "TotalCount": 4, + }, + {"Items": [key("4", CreateTime="2026-10-10T03:00:00Z")], "TotalCount": 4}, + ], + ) + asyncio.run(model_key.resolve_model_key(load_studio_profile(), Cloud())) + assert len(calls) == 4 + assert calls[-1]["request_body"]["Id"] == 2 + + +@pytest.mark.parametrize("field", ["CreateTime", "CreatedAt", "CreationTime"]) +@pytest.mark.parametrize( + "latest", + [ + 1700000001, + 1700000001.5, + "1700000001", + 1700000001000, + "1700000001000", + "2023-11-15T06:13:21+08:00", + ], +) +def test_creation_time_normalizes_units_and_timezones(monkeypatch, field, latest): + calls = setup( + monkeypatch, + [ + { + "Items": [ + key("2", CreateTime="2023-11-14T22:13:20Z"), + key("1", **{field: latest}), + ], + "TotalCount": 2, + } + ], + ) + asyncio.run(model_key.resolve_model_key(load_studio_profile(), Cloud())) + assert calls[-1]["request_body"]["Id"] == 1 + + +@pytest.mark.parametrize("reverse", [False, True]) +def test_equal_creation_times_have_stable_selection(monkeypatch, reverse): + items = [ + key("2", CreateTime=1700000000), + key("3", CreateTime="2023-11-14T22:13:20Z"), + ] + calls = setup( + monkeypatch, + [{"Items": list(reversed(items)) if reverse else items, "TotalCount": 2}], + ) + asyncio.run(model_key.resolve_model_key(load_studio_profile(), Cloud())) + assert calls[-1]["request_body"]["Id"] == 3 + + +@pytest.mark.parametrize( + "value", + [ + None, + "", + "private-invalid-value", + True, + -1, + 0, + "NaN", + float("inf"), + 10**100, + "2026-10-10T12:00:00", + {}, + [], + ], +) +def test_unknown_creation_time_fails_without_raw_lookup(monkeypatch, value): + calls = setup( + monkeypatch, + [ + { + "Items": [key(CreateTime=1700000000), key("2", CreateTime=value)], + "TotalCount": 2, + } + ], + ) + with pytest.raises(model_key.ModelKeyError, match="creation time") as error: + asyncio.run(model_key.resolve_model_key(load_studio_profile(), Cloud())) + assert "private-invalid-value" not in str(error.value) + assert len(calls) == 1 + + +def test_missing_creation_time_fails_without_raw_lookup(monkeypatch): + calls = setup( + monkeypatch, + [{"Items": [key(), key("2", CreateTime=1700000000)], "TotalCount": 2}], + ) + with pytest.raises(model_key.ModelKeyError, match="creation time"): + asyncio.run(model_key.resolve_model_key(load_studio_profile(), Cloud())) + assert len(calls) == 1 + + +@pytest.mark.parametrize( + "items", [[], [key(Status="Restricted")], [key(Status="Disabled")]] +) +def test_missing_or_inactive_keys_fail_without_raw_lookup(monkeypatch, items): + calls = setup(monkeypatch, [{"Items": items, "TotalCount": len(items)}]) + with pytest.raises(model_key.ModelKeyError, match="No matching"): + asyncio.run(model_key.resolve_model_key(load_studio_profile(), Cloud())) + assert len(calls) == 1 + + +@pytest.mark.parametrize( + "page", + [ + {"Items": None, "TotalCount": 1}, + {"Items": [], "TotalCount": 1}, + {"Items": [key()], "TotalCount": "1"}, + {"Items": [{}], "TotalCount": 1}, + {"Items": [key()], "TotalCount": 0}, + ], +) +def test_malformed_pages_fail_closed(monkeypatch, page): + calls = setup(monkeypatch, [page]) + with pytest.raises(model_key.ModelKeyError): + asyncio.run(model_key.resolve_model_key(load_studio_profile(), Cloud())) + assert len(calls) == 1 + + +def test_empty_raw_key_never_uses_masked_list_value(monkeypatch): + setup(monkeypatch, [{"Items": [key(Key="masked***")], "TotalCount": 1}], raw="") + with pytest.raises(model_key.ModelKeyError): + asyncio.run(model_key.resolve_model_key(load_studio_profile(), Cloud())) + + +def test_transient_retries_are_bounded_and_redacted(monkeypatch, caplog): + count = 0 + + def request(**kw): + nonlocal count + count += 1 + raise requests.ConnectionError("test-private-model-value") + + monkeypatch.setattr(model_key, "volcengine_signed_request", request) + sleep = AsyncMock() + monkeypatch.setattr(model_key.asyncio, "sleep", sleep) + events = [] + with diagnostic_scope(events.append): + with pytest.raises(model_key.ModelKeyError) as error: + asyncio.run(model_key.resolve_model_key(load_studio_profile(), Cloud())) + assert count == 3 + assert sleep.await_count == 2 + assert [x["outcome"] for x in events] == ["retrying", "retrying", "failed"] + assert "test-private-model-value" not in str(error.value) + caplog.text + str( + events + ) + assert error.value.__cause__ is None + + +def test_permission_error_is_not_retried_or_echoed(monkeypatch): + calls = [] + + def request(**kw): + calls.append(kw) + return { + "ResponseMetadata": { + "Error": {"Code": "AccessDenied", "Message": "private-test-value"} + } + } + + monkeypatch.setattr(model_key, "volcengine_signed_request", request) + with pytest.raises(model_key.ModelKeyError, match="permissions") as error: + asyncio.run(model_key.resolve_model_key(load_studio_profile(), Cloud())) + assert "private-test-value" not in str(error.value) + assert len(calls) == 1 + + +def test_account_change_stops_before_raw_key_read(monkeypatch): + calls = setup(monkeypatch, [{"Items": [key()], "TotalCount": 1}]) + cloud = Cloud() + credentials = cloud._credentials + + def refresh(): + if cloud.count: + raise RuntimeError("Cloud credentials changed accounts; private-test-value") + return credentials() + + monkeypatch.setattr(cloud, "_credentials", refresh) + with pytest.raises(model_key.ModelKeyError): + asyncio.run(model_key.resolve_model_key(load_studio_profile(), cloud)) + assert len(calls) == 1 + + +def test_cancellation_stops_before_raw_read(monkeypatch): + async def run(): + started, release = threading.Event(), threading.Event() + calls = [] + + def request(**kw): + calls.append(kw) + started.set() + release.wait(2) + return {"Result": {"Items": [key()], "TotalCount": 1}} + + monkeypatch.setattr(model_key, "volcengine_signed_request", request) + task = asyncio.create_task( + model_key.resolve_model_key(load_studio_profile(), Cloud()) + ) + await asyncio.to_thread(started.wait, 2) + task.cancel() + release.set() + with pytest.raises(asyncio.CancelledError): + await task + assert len(calls) == 1 + + asyncio.run(run()) + + +def test_model_failure_precedes_any_resource_mutation(monkeypatch): + profile = load_studio_profile() + cloud = Cloud() + monkeypatch.setattr( + cloud, "account_id", AsyncMock(return_value="test-account"), raising=False + ) + monkeypatch.setattr(service, "RuntimeCloud", lambda **kw: cloud) + resolve = AsyncMock(side_effect=model_key.ModelKeyError("No matching Ark API key")) + monkeypatch.setattr(service, "resolve_model_key", resolve) + iam, identity = AsyncMock(), AsyncMock() + monkeypatch.setattr(service, "ensure_runtime_role", iam) + monkeypatch.setattr(service, "ensure_workload_identity", identity) + with pytest.raises(model_key.ModelKeyError): + asyncio.run(service.provision(profile, agent_id="mi-test", owner="test-owner")) + resolve.assert_awaited_once_with(profile, cloud) + iam.assert_not_awaited() + identity.assert_not_awaited() + + +def test_selectors_are_nonsecret_and_exclusive(monkeypatch): + monkeypatch.setenv("VEADK_MPA_ARK_API_KEY_ID", "1") + monkeypatch.setenv("VEADK_MPA_ARK_API_KEY_NAME", "wanted") + with pytest.raises(ConfigurationError): + load_studio_profile() + + +def test_duplicate_names_and_missing_selector_do_not_pick_first(monkeypatch): + monkeypatch.setenv("VEADK_MPA_ARK_API_KEY_NAME", "same") + calls = setup( + monkeypatch, [{"Items": [key("1", "same"), key("2", "same")], "TotalCount": 2}] + ) + with pytest.raises(model_key.ModelKeyError, match="multiple"): + asyncio.run(model_key.resolve_model_key(load_studio_profile(), Cloud())) + assert len(calls) == 1 + monkeypatch.setenv("VEADK_MPA_ARK_API_KEY_NAME", "missing") + with pytest.raises(model_key.ModelKeyError, match="No matching"): + asyncio.run(model_key.resolve_model_key(load_studio_profile(), Cloud())) + + +def test_read_recovers_and_refreshes_credentials(monkeypatch): + attempts = [] + + def request(**kw): + attempts.append(kw) + if len(attempts) == 1: + return { + "ResponseMetadata": { + "Error": {"Code": "Throttling", "Message": "private"} + } + } + if kw["query"]["Action"] == "ListApiKeys": + return {"Result": {"Items": [key()], "TotalCount": 1}} + return {"Result": {"ApiKey": "test-model-value"}} + + monkeypatch.setattr(model_key, "volcengine_signed_request", request) + monkeypatch.setattr(model_key.asyncio, "sleep", AsyncMock()) + selected = asyncio.run(model_key.resolve_model_key(load_studio_profile(), Cloud())) + assert selected.values["model_api_key"] == "test-model-value" + assert [x["ak"] for x in attempts] == ["test-ak-1", "test-ak-2", "test-ak-3"] + + +def test_discovery_has_a_page_limit(monkeypatch): + calls = [] + + def request(**kw): + calls.append(kw) + page = kw["request_body"]["PageNumber"] + return {"Result": {"Items": [key(str(page * 100 + i)) for i in range(100)]}} + + monkeypatch.setattr(model_key, "volcengine_signed_request", request) + with pytest.raises(model_key.ModelKeyError, match="limit"): + asyncio.run(model_key.resolve_model_key(load_studio_profile(), Cloud())) + assert len(calls) == 100 + + +@pytest.mark.parametrize( + "update", + [ + {"model-api-key": "test-value"}, + {"model-provider": "other"}, + {"model-api-base": "https://untrusted.example"}, + {"managed": {"runtime": {"env": {"MODEL_AGENT_API_KEY": "test-value"}}}}, + {"managed": {"from-runtime": "r-source"}}, + ], +) +def test_ark_configuration_rejects_secret_or_target_overrides(monkeypatch, update): + from veadk.integrations.mpa.managed import config + + values = config.studio_profile_values() + if "managed" in update: + for name, value in update["managed"].items(): + if isinstance(value, dict): + values["managed"][name].update(value) + else: + values["managed"][name] = value + else: + values.update(update) + monkeypatch.setattr(config, "studio_profile_values", lambda: values) + with pytest.raises(ConfigurationError): + load_studio_profile() + + +def test_explicit_mode_never_queries_ark(monkeypatch): + profile = load_studio_profile() + profile.managed.model_key.mode = "explicit" + profile.values["model_api_key"] = "explicit-test-value" + monkeypatch.setattr( + model_key, + "volcengine_signed_request", + lambda **kw: pytest.fail("Unexpected Ark call"), + ) + assert asyncio.run(model_key.resolve_model_key(profile, Cloud())) is profile + + +def test_studio_role_already_grants_ark_read_permissions(): + from veadk.cli.frontend_deploy_policy import FRONTEND_DEPLOY_POLICY + + actions = { + action + for statement in FRONTEND_DEPLOY_POLICY["Statement"] + for action in statement["Action"] + } + assert {"ark:ListApiKeys", "ark:GetRawApiKey"} <= actions diff --git a/tests/integrations/mpa_managed/test_routes.py b/tests/integrations/mpa_managed/test_routes.py index 46fef6576..0d6fe2d1d 100644 --- a/tests/integrations/mpa_managed/test_routes.py +++ b/tests/integrations/mpa_managed/test_routes.py @@ -107,7 +107,12 @@ def denied(_request): assert getattr(client, method)(path).status_code == 403 -def test_missing_model_key_is_actionable_and_safe(tmp_path, monkeypatch): +def test_model_key_discovery_needs_no_secret_for_local_inspection( + tmp_path, monkeypatch +): + from frontend.server import mpa_creation + + monkeypatch.setattr(mpa_creation, "load_volcengine_credentials", lambda *_: None) monkeypatch.setenv( "VEADK_MPA_CREATE_CONFIG", str(tmp_path / "private-missing.yaml") ) @@ -119,8 +124,8 @@ def test_missing_model_key_is_actionable_and_safe(tmp_path, monkeypatch): with TestClient(app) as client: result = client.get("/web/mpa-creation/config?region=cn-beijing") assert result.status_code == 200 - assert result.json()["configured"] is False - assert "VEADK_MPA_CONFIG_MODEL_AGENT_API_KEY" in result.json()["error"] + assert result.json()["configured"] is True + assert "VEADK_MPA_CONFIG_MODEL_AGENT_API_KEY" not in result.text assert "private-missing" not in result.text assert ( client.post( diff --git a/tests/integrations/mpa_managed/test_service.py b/tests/integrations/mpa_managed/test_service.py index 10d332906..2e1a5b4d8 100644 --- a/tests/integrations/mpa_managed/test_service.py +++ b/tests/integrations/mpa_managed/test_service.py @@ -676,7 +676,12 @@ def test_fresh_template_role_trn_uses_verified_account_and_selected_role( monkeypatch.setenv("VEADK_MPA_CONFIG_MODEL_AGENT_API_KEY", "test-model-key") profile = load_studio_profile() - profile.values.update(pg_host="db.example", pg_user="test", pg_password="test") + profile.values.update( + pg_host="db.example", + pg_user="test", + pg_password="test", + model_api_key="resolved-test-key", + ) profile.managed.runtime.role_name = role selected_role = role or "IDRoleForArkClawShareAgent" request = service.fresh_template(profile, "mi-123456789abc", "verified-account") diff --git a/tests/integrations/mpa_managed/test_studio_shared_resources.py b/tests/integrations/mpa_managed/test_studio_shared_resources.py index 348b258db..e2506f96f 100644 --- a/tests/integrations/mpa_managed/test_studio_shared_resources.py +++ b/tests/integrations/mpa_managed/test_studio_shared_resources.py @@ -36,7 +36,7 @@ from tests.integrations.mpa_managed.test_gateway import ( Registry as GatewayRegistry, ) -from veadk.integrations.mpa.managed import pg_bootstrap, pg_cloud, service +from veadk.integrations.mpa.managed import model_key, pg_bootstrap, pg_cloud, service from veadk.integrations.mpa.managed.config import load_studio_profile @@ -47,6 +47,20 @@ async def test_studio_creates_missing_shared_resources_then_reuses_admin_registr ): monkeypatch.setenv("VEADK_MPA_CONFIG_MODEL_AGENT_API_KEY", "test-model-key") profile = load_studio_profile(region="cn-beijing") + ark_calls = [] + + def ark_request(**kwargs): + ark_calls.append(kwargs) + if kwargs["query"]["Action"] == "ListApiKeys": + return { + "Result": { + "Items": [{"Id": 1, "Name": "mpa", "Status": "Active"}], + "TotalCount": 1, + } + } + return {"Result": {"ApiKey": "discovered-test-key"}} + + monkeypatch.setattr(model_key, "volcengine_signed_request", ark_request) prepare_role = AsyncMock() monkeypatch.setattr(service, "ensure_runtime_role", prepare_role) assert profile.managed.postgres is not None @@ -101,7 +115,16 @@ async def test_studio_creates_missing_shared_resources_then_reuses_admin_registr entry.shared = gateways cloud = Cloud(entry) cloud.network = network - monkeypatch.setattr(cloud, "_credentials", lambda: None, raising=False) + monkeypatch.setattr( + cloud, + "_credentials", + lambda: SimpleNamespace( + access_key_id="test-ak", + secret_access_key="test-sk", + session_token="test-sts", + ), + raising=False, + ) monkeypatch.setattr(service, "RuntimeCloud", lambda cloud=cloud, **kw: cloud) def registry_factory(url, entry=entry): @@ -116,7 +139,12 @@ def database_factory(**kwargs): monkeypatch.setattr(service, "AgentDeploymentRegistry", registry_factory) monkeypatch.setattr(service, "AgentDatabaseProvisioner", database_factory) result = await service.provision(profile, agent_id=agent_id, owner="user") - initialize_identity.assert_awaited_with(profile, cloud, agent_id) + assert initialize_identity.await_args is not None + resolved_profile, identity_cloud, identity_agent = ( + initialize_identity.await_args.args + ) + assert resolved_profile.values["model_api_key"] == "discovered-test-key" + assert identity_cloud is cloud and identity_agent == agent_id assert result["gateway_id"] == gateways.rows[scope]["gateway_id"] assert entry.row["admin_workspace_id"] == "ws-1" assert entry.row["business_workspace_id"] == "ws-2" @@ -124,6 +152,7 @@ def database_factory(**kwargs): runtime_env = service.env_map(cloud.creates[0]) assert prepare_role.await_args is not None assert prepare_role.await_args.args[1] == "account" + assert runtime_env["MODEL_AGENT_API_KEY"] == "discovered-test-key" assert runtime_env["CLAW_SPACE_ID"] == "csi-account" assert runtime_env["RUNTIME_IAM_ROLE_NAME"] == "IDRoleForArkClawShareAgent" assert runtime_env["RUNTIME_IAM_ROLE_TRN"] == ( @@ -137,6 +166,8 @@ def database_factory(**kwargs): ) assert runtime_registry.query == {"ssl": "require"} + assert len(ark_calls) == 4 + assert not profile.values.get("model_api_key") assert pg.created == 2 assert initialize_identity.await_count == 2 assert initialize.await_count == 2 diff --git a/veadk/integrations/mpa/managed/README.md b/veadk/integrations/mpa/managed/README.md index 889daa7f5..85912dd14 100644 --- a/veadk/integrations/mpa/managed/README.md +++ b/veadk/integrations/mpa/managed/README.md @@ -74,7 +74,7 @@ Runtime subnet IDs may be returned in a different order by AgentKit. An identica 4. Configure deployment credentials through a rotating `managed.credential-file` or `VOLCENGINE_ACCESS_KEY` / `VOLCENGINE_SECRET_KEY` and optional `VOLCENGINE_SESSION_TOKEN`. Without an explicit file or environment key pair, the mounted `/var/run/secrets/iam/credential` is used. Each cloud call refreshes credentials; Runtime, VPC, worker and APIG use the same verified account. 5. Select a template source: `managed.from-runtime`, a private JSON `managed.template-file`, or the flat image/model/PostgreSQL fields. Reference mode removes agent-specific channel credentials and Skill Space identity. Configure `managed.worker.image` for a dedicated worker (optional `reference-id` for worker environment settings), or use an explicit `existing-id` after verifying compatibility. 6. For a private PostgreSQL host, set the reachable `managed.network.vpc-id` and `subnet-ids`. Automatic network creation does **not** configure database allowlists, peering, or cross-VPC routes. An explicit `managed.apig.adopt-id` requires that VPC ID and a compatible gateway. Otherwise the account's registered gateway is reused or created. -7. Supply the private YAML explicitly with the CLI `--config` option. Studio does not read this file or `VEADK_MPA_CREATE_CONFIG`; it uses the code-owned Beijing profile and requires `VEADK_MPA_CONFIG_MODEL_AGENT_API_KEY` plus deployment STS credentials in its server environment. Other Studio regions display a configuration error. +7. Supply the private YAML explicitly with the CLI `--config` option. Studio does not read this file or `VEADK_MPA_CREATE_CONFIG`; it uses the code-owned Beijing profile and requires deployment AK/SK or STS credentials in its server environment, then discovers an existing Ark model key in that account. Other Studio regions display a configuration error. The deployment identity needs access to AgentKit Runtime, Skill Space and Tool operations, VPC/subnet operations, APIG/IM Gateway operations and `GetCallerIdentity`. The Runtime/worker roles separately need the permissions and mounted credentials required by their images. IAM policies, PostgreSQL cloud instances, model services and network connectivity are operator prerequisites, not automatically created resources. @@ -127,7 +127,7 @@ VPC/APIG still share by account and region. Deployment JSON records retain both ## Use in Studio -After a new `veadk studio deploy`, managed creation automatically reuses that Studio's UserPool, client, Identity region, and `/oauth/callback` from server-side VeFaaS environment. Studio uses built-in Beijing account, Runtime/worker image and model defaults without any creation YAML. Its model API key stays in `VEADK_MPA_CONFIG_MODEL_AGENT_API_KEY`. For standalone CLI YAML profiles, explicitly different `user-pool-name`, `user-pool-client-name`, `identity-callback-url`, `identity-region`, or corresponding `managed.runtime.env` values fail configuration inspection before cloud writes. A Studio deployed before this capability must be redeployed to receive the values. Standalone `veadk mpa provision` without these Studio environment values continues to use explicit YAML. The shared PostgreSQL Workspace is created later during MPA creation and is not the deployment-time Identity store. +After a new `veadk studio deploy`, managed creation automatically reuses that Studio's UserPool, client, Identity region, and `/oauth/callback` from server-side VeFaaS environment. Studio uses built-in Beijing Runtime/worker image and model defaults without any creation YAML; its deployment account comes from STS. Its model API key is read with deployment credentials during creation (see Ark key discovery below). For standalone CLI YAML profiles, explicitly different `user-pool-name`, `user-pool-client-name`, `identity-callback-url`, `identity-region`, or corresponding `managed.runtime.env` values fail configuration inspection before cloud writes. A Studio deployed before this capability must be redeployed to receive the values. Standalone `veadk mpa provision` without these Studio environment values continues to use explicit YAML. The shared PostgreSQL Workspace is created later during MPA creation and is not the deployment-time Identity store. Choose **Agents → MPA agents → Create MPA agent**. The three steps collect basic information, automatic PostgreSQL preparation, and optional OpenViking service URL/resource ID/API Key. Enter a Runtime name (4–64 ASCII letters, digits, underscores or hyphens). The server generates the agent ID and injects it into Agent and Worker; it is not shown as an input. New creations use `agentkit-platform-2112682748-cn-beijing.cr.volces.com/mpa/mpa_agent:latest` and `agentkit-platform-2112682748-cn-beijing.cr.volces.com/mpa/mpa_codex_worker:latest` without image inputs. Already-submitted tasks retain their image selection for retry. Existing Runtimes are not renamed or automatically upgraded. The PG step links to the [Volcengine AIDAP console](https://console.volcengine.com/aidap/region:aidap+cn-beijing/); the service obtains Workspace connections after submission. The OpenViking step links to the [context-management console](https://console.volcengine.com/vikingdb/openviking/region:openviking+cn-beijing/ov-6689fabdf032294/context-management?accountId=default&userId=default&projectName=default); this is a console page, not the service URL to enter. PG credentials stay server-configured. Enter the OpenViking URL, resource ID and masked API Key together to inject `OPENVIKING_URL`, `OPENVIKING_RESOURCE_ID`, `OPENVIKING_API_KEY` and `OPENVIKING_USER=default`. Leave all three blank to omit these variables, including inherited template/reference values. The key is not saved in browser drafts or task SQLite and must be re-entered after a browser restart. Review the resource plan and submit on step three. The workflow prepares account network/APIG/IM Gateway, a worker, an isolated business database and Skill Space, then deploys and checks Runtime and application readiness. Successful creation refreshes the directory. @@ -271,3 +271,21 @@ managed: `managed.worker.env` accepts uppercase string keys and whole server environment references. It overrides filtered environment values from an optional accessible `reference-id`. Agent/Runtime/Tool/Skill Space bindings, inherited channel/Runtime credentials and control database URLs are reserved. A missing explicit reference remains an error. Environment settings with `existing-id` are rejected because existing Tools are not updated. Secrets do not enter config summaries/repr or deployment records; use server references rather than committing values. Model credentials are delivered per session by Runtime, not copied from the old Tool. New named MPA deployments use `Skills for MPA agent ` as the Skill Space description, so the entered name is visible in the cloud console. The generated space Name, display_name tag, internal agent ID and bindings stay unchanged. Existing spaces keep their descriptions; pre-upgrade pending requests recover their exact original description, while other input changes remain errors. Calls without a Runtime name retain the internal-ID description. + +## Ark model key discovery + +Built-in Studio no longer reads `VEADK_MPA_CONFIG_MODEL_AGENT_API_KEY`. Keep deployment credentials in your private environment or mounted credential source; do not commit them. The current deployment account needs `ark:ListApiKeys` and `ark:GetRawApiKey` permissions and an existing usable Ark key in project `default`. Model activation, model permissions and key IP restrictions must permit Runtime inference. No key is created automatically. + +Without a selector, multiple eligible keys automatically select the newest creation time; a single candidate is used directly. Creation reads only the selected raw value server-side and injects `MODEL_AGENT_API_KEY` into Runtime. Optional `VEADK_MPA_ARK_API_KEY_ID` or `VEADK_MPA_ARK_API_KEY_NAME` selects an exact identifier/name instead (not a secret). Non-Active statuses are excluded when present; legacy missing Status is supported. Newest selection accepts CreateTime (CreatedAt/CreationTime compatibility), Unix seconds/milliseconds or timezone-qualified ISO 8601; equal times use the lexicographically greatest string ID. Missing/invalid timestamps among multiple candidates, missing matches, ambiguous explicit names, or authorization/network failures stop at checking. No masked key or arbitrary first match is used. Pending request hashes reject changed credentials on retry, including when a newer key is created during a partial deployment. + +Standalone CLI profiles retain explicit `model-api-key` by default. Fresh Ark profiles may instead omit it and configure: + +```yaml +managed: + model-key: + mode: ark + project-name: default + api-key-id: "" # Optional; omit to select the newest eligible key. +``` + +Ark mode requires `model-provider: openai` and the selected region's Ark `/api/v3/` base; it rejects reference/template sources and model key/provider/base environment overrides. Raw keys never enter config/task responses, local bootstrap/task storage, or logs. Runtime environment configuration contains the key and must be protected. You may remove the obsolete creation model-key and `VEADK_MPA_CONFIG_PGPASSWORD` assignments from `.env` when using built-in automatic creation; retain other startup configuration and deployment credentials. Other CLI profiles may still use their explicitly referenced environment variables. diff --git a/veadk/integrations/mpa/managed/README.zh.md b/veadk/integrations/mpa/managed/README.zh.md index 77343e615..163452450 100644 --- a/veadk/integrations/mpa/managed/README.zh.md +++ b/veadk/integrations/mpa/managed/README.zh.md @@ -68,13 +68,13 @@ AgentKit 返回的 Runtime 子网 ID 顺序可能不同。创建和重试接受 4. 使用轮换的 `managed.credential-file`,或 `VOLCENGINE_ACCESS_KEY` / `VOLCENGINE_SECRET_KEY` 与可选 `VOLCENGINE_SESSION_TOKEN` 配置部署凭据。没有显式文件和环境密钥对时,使用挂载的 `/var/run/secrets/iam/credential`。每次云调用刷新凭据;Runtime、VPC、worker、APIG 使用同一经核验账号。 5. 选择一个模板来源:`managed.from-runtime`、私有 JSON `managed.template-file`,或平铺的镜像/模型/PostgreSQL 字段。参考实例模式会移除智能体专属渠道凭据和 Skill Space 身份。通过 `managed.worker.image` 创建专属 worker(可选 `reference-id` 复用 worker 环境配置),或在核验兼容性后显式使用 `existing-id`。 6. PostgreSQL 使用私网地址时,设置可访问它的 `managed.network.vpc-id` 和 `subnet-ids`。自动创建网络**不会**配置数据库白名单、对等连接或跨 VPC 路由。显式 `managed.apig.adopt-id` 要求提供该 VPC ID 且网关兼容;否则复用或创建账号登记的网关。 -7. CLI 通过 `--config` 显式传入私有 YAML。Studio 不读取该文件或 `VEADK_MPA_CREATE_CONFIG`;它使用代码内置的北京地域配置,服务端环境仍须提供 `VEADK_MPA_CONFIG_MODEL_AGENT_API_KEY` 与部署 STS 凭据。Studio 选择其他地域时返回配置错误。 +7. CLI 通过 `--config` 显式传入私有 YAML。Studio 不读取该文件或 `VEADK_MPA_CREATE_CONFIG`;它使用代码内置的北京地域配置,服务端环境须提供部署 AK/SK 或 STS 凭据,创建时自动发现该账号的现有方舟模型 Key。Studio 选择其他地域时返回配置错误。 部署身份需要 AgentKit Runtime、Skill Space、Tool、VPC/子网、APIG/IM Gateway 及 `GetCallerIdentity` 操作权限。Runtime/worker 角色还须单独拥有对应镜像所需权限和挂载凭据。IAM 策略、PostgreSQL 云实例、模型服务和网络连通性由运维准备,不会自动创建。 ## 在 Studio 使用 -新执行 `veadk studio deploy` 后,托管创建会从服务端 VeFaaS 环境自动复用该 Studio 的 UserPool、客户端、Identity 地域和 `/oauth/callback`。Studio 无需创建 YAML,直接使用代码内置的北京地域账号、Runtime/worker 镜像及模型默认值;模型 API Key 仍从 `VEADK_MPA_CONFIG_MODEL_AGENT_API_KEY` 读取。独立 CLI YAML 若显式填写不同的 `user-pool-name`、`user-pool-client-name`、`identity-callback-url`、`identity-region` 或对应的 `managed.runtime.env` 值,配置检查会在云写入前失败。此前部署的 Studio 须重新部署才能获得这些值。没有 Studio 环境值的独立 `veadk mpa provision` 仍使用显式 YAML。共享 PostgreSQL Workspace 在后续创建 MPA 时才准备,并非部署时的 Identity 存储。 +新执行 `veadk studio deploy` 后,托管创建会从服务端 VeFaaS 环境自动复用该 Studio 的 UserPool、客户端、Identity 地域和 `/oauth/callback`。Studio 无需创建 YAML,直接使用代码内置的北京地域 Runtime/worker 镜像及模型默认值,部署账号来自 STS;模型 API Key 在创建时使用部署凭据读取(见下文方舟 Key 自动发现)。独立 CLI YAML 若显式填写不同的 `user-pool-name`、`user-pool-client-name`、`identity-callback-url`、`identity-region` 或对应的 `managed.runtime.env` 值,配置检查会在云写入前失败。此前部署的 Studio 须重新部署才能获得这些值。没有 Studio 环境值的独立 `veadk mpa provision` 仍使用显式 YAML。共享 PostgreSQL Workspace 在后续创建 MPA 时才准备,并非部署时的 Identity 存储。 选择**智能体 → MPA 智能体 → 创建 MPA 智能体**。三步依次填写基础信息、PostgreSQL 自动准备说明,以及可选的 OpenViking 服务地址/资源 ID/API Key。填写 Runtime 名称(4–64 个 ASCII 字母、数字、下划线或连字符)。服务端生成智能体 ID 并注入 Agent 和 Worker,不再显示 ID 输入框。新创建使用 `agentkit-platform-2112682748-cn-beijing.cr.volces.com/mpa/mpa_agent:latest` 和 `agentkit-platform-2112682748-cn-beijing.cr.volces.com/mpa/mpa_codex_worker:latest`,不再显示镜像输入框。已提交任务重试保留原镜像选择。已有 Runtime 不会被重命名或自动升级。PG 步骤提供[火山引擎 AIDAP 控制台](https://console.volcengine.com/aidap/region:aidap+cn-beijing/)入口;服务端在提交后取得 Workspace 连接。OpenViking 步骤提供[上下文管理控制台](https://console.volcengine.com/vikingdb/openviking/region:openviking+cn-beijing/ov-6689fabdf032294/context-management?accountId=default&userId=default&projectName=default)入口;该页面地址不是要填写的服务地址。PG 凭据仍由服务端配置。同时填写 OpenViking 地址、资源 ID 和遮罩的 API Key 时,注入 `OPENVIKING_URL`、`OPENVIKING_RESOURCE_ID`、`OPENVIKING_API_KEY` 和 `OPENVIKING_USER=default`。三项全空时不注入这些变量,模板或参考 Runtime 中的旧值也不会继承。密钥不保存到浏览器草稿或任务 SQLite,浏览器重启后须重新填写。查看资源计划后在第三步提交。流程依次准备账号网络/APIG/IM Gateway、worker、独立业务库和 Skill Space,然后部署并检查 Runtime 和应用就绪状态。成功后刷新列表。 @@ -265,3 +265,21 @@ managed: `managed.worker.env` 接受大写字符串键及完整服务端环境变量引用,覆盖可选且可访问 `reference-id` 中已过滤的环境设置。智能体/Runtime/Tool/技能空间绑定、继承的渠道/Runtime 凭据及控制库地址为保留字段。显式参考模板缺失仍报错。`existing-id` 不允许环境设置,因为不会更新已有 Tool。密钥不进入配置摘要/repr 或部署记录;使用服务端引用,不提交实际值。模型凭据由 Runtime 按会话下发,不从旧 Tool 复制。 新的名称 MPA 部署使用 `Skills for MPA agent ` 作为技能空间描述,便于在云控制台辨认手填名称。生成的空间 Name、display_name 标签、内部智能体 ID 及绑定保持不变。已有空间保留原描述;升级前待完成请求按原描述准确恢复,其他输入变化仍报错。不提供 Runtime 名称的调用保留内部 ID 描述。 + +## 方舟模型 Key 自动发现 + +内置 Studio 不再读取 `VEADK_MPA_CONFIG_MODEL_AGENT_API_KEY`。部署凭据保留在私有环境或挂载凭据源中,不提交到仓库。当前部署账号需要 `ark:ListApiKeys` 和 `ark:GetRawApiKey` 权限,以及 `default` 项目下现有可用的方舟 Key。模型开通、模型访问权限和 Key IP 限制必须允许 Runtime 推理。不自动创建 Key。 + +没有选择器时,多个候选 Key 自动按创建时间选最新;只有一个候选时直接使用。服务端只读取选中 Key 的明文,向 Runtime 注入 `MODEL_AGENT_API_KEY`。可选的 `VEADK_MPA_ARK_API_KEY_ID` 或 `VEADK_MPA_ARK_API_KEY_NAME` 优先按精确 ID/名称选择(不是密钥)。有状态时排除非 Active,兼容缺少 Status 的旧响应。最新选择接受 CreateTime(兼容 CreatedAt/CreationTime)、Unix 秒/毫秒或带时区 ISO 8601;同时间选择字符串 ID 字典序最大者。多个候选时间缺失/异常、无匹配、显式名称重名或鉴权/网络失败,在 checking 阶段停止。不使用掩码或任意第一项。重试仍由请求哈希拒绝凭据变化,包括部分部署期间出现更晚创建的 Key。 + +独立 CLI 配置默认保留显式 `model-api-key`。全新方舟配置可以改为省略该字段,并配置: + +```yaml +managed: + model-key: + mode: ark + project-name: default + api-key-id: "" # 可选;省略则选择最新候选 Key。 +``` + +Ark 模式要求 `model-provider: openai` 和所选地域方舟 `/api/v3/` 地址;拒绝引用 Runtime/模板来源及模型 Key/provider/base 环境覆盖。明文不进入配置/任务响应、本地 bootstrap/任务存储或日志。Runtime 环境配置包含 Key,须保护访问权限。使用内置自动创建时可以移除 `.env` 里旧创建模型 Key 与 `VEADK_MPA_CONFIG_PGPASSWORD` 赋值,保留其他启动配置和部署凭据。其他 CLI 配置仍可使用其显式引用的环境变量。 diff --git a/veadk/integrations/mpa/managed/config.py b/veadk/integrations/mpa/managed/config.py index 59e1026e0..7ef20aeb2 100644 --- a/veadk/integrations/mpa/managed/config.py +++ b/veadk/integrations/mpa/managed/config.py @@ -351,12 +351,28 @@ class Iam(Options): mode: Literal["existing", "auto"] = "existing" +class ModelKey(Options): + mode: Literal["explicit", "ark"] = "explicit" + api_key_id: str = Field(default="", max_length=128, pattern=r"^[A-Za-z0-9_-]*$") + api_key_name: str = Field(default="", max_length=128) + project_name: str = Field(default="default", min_length=1, max_length=128) + + @model_validator(mode="after") + def validate_selection(self): + if self.api_key_id and self.api_key_name: + raise ValueError("Choose an Ark API Key ID or name, not both") + if self.mode == "explicit" and (self.api_key_id or self.api_key_name): + raise ValueError("Ark API Key selectors require ark mode") + return self + + class Managed(Options): version: Literal[1] database_admin_url_env: str = "DEPLOYMENT_DATABASE_ADMIN_URL" shared_database_url_env: str = "SHARED_APIG_DATABASE_URL" postgres: PostgresWorkspaces | None = None iam: Iam = Field(default_factory=Iam) + model_key: ModelKey = Field(default_factory=ModelKey) credential_file: str = "" from_runtime: str = "" template_file: str = "" @@ -640,6 +656,10 @@ def load_profile(path: str | Path | None, *, region: str = "") -> Profile: isinstance(managed_values.get("postgres"), dict) and managed_values["postgres"].get("mode") == "auto" ) + if "model-key" in managed_values: + managed_values["model-key"] = _resolve(managed_values["model-key"]) + elif "model_key" in managed_values: + managed_values["model_key"] = _resolve(managed_values["model_key"]) worker_values = managed_values.get("worker") if isinstance(worker_values, dict): worker_values = dict(worker_values) @@ -748,6 +768,26 @@ def load_profile(path: str | Path | None, *, region: str = "") -> Profile: and not (auto and str(k).replace("-", "_").startswith("pg_")) } ) + if managed.model_key.mode == "ark": + if ( + template + or managed.from_runtime + or values.get("model_api_key") + or values.get("model_provider") != "openai" + or str(values.get("model_api_base", "")).rstrip("/") + != f"https://ark.{selected}.volces.com/api/v3" + or any( + key in managed.runtime.env + for key in ( + "MODEL_AGENT_API_KEY", + "MODEL_AGENT_PROVIDER", + "MODEL_AGENT_API_BASE", + ) + ) + ): + raise ConfigurationError( + "Ark key discovery requires a fresh Ark model configuration without key overrides" + ) reuse_studio_identity(values, managed.runtime.env) if not template and not managed.from_runtime: for key in ( @@ -760,6 +800,8 @@ def load_profile(path: str | Path | None, *, region: str = "") -> Profile: "model_api_key", "model_name", ): + if key == "model_api_key" and managed.model_key.mode == "ark": + continue if auto and key.startswith("pg_"): continue if key == "image" and managed.runtime.image: diff --git a/veadk/integrations/mpa/managed/diagnostics.py b/veadk/integrations/mpa/managed/diagnostics.py index 1e0fc0097..78d69fd68 100644 --- a/veadk/integrations/mpa/managed/diagnostics.py +++ b/veadk/integrations/mpa/managed/diagnostics.py @@ -52,6 +52,8 @@ "protocol_error", } OPERATIONS = { + "list_model_keys", + "get_model_key", "get_reference_worker", "find_worker", "create_worker", diff --git a/veadk/integrations/mpa/managed/model_key.py b/veadk/integrations/mpa/managed/model_key.py new file mode 100644 index 000000000..52ddff3c3 --- /dev/null +++ b/veadk/integrations/mpa/managed/model_key.py @@ -0,0 +1,234 @@ +# Copyright (c) 2025 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Read an existing Ark model key using account-verified deployment credentials.""" + +from __future__ import annotations + +import asyncio +import math +from dataclasses import replace +from datetime import datetime, timezone +from typing import Any, Protocol + +from veadk.utils.volcengine_sign import volcengine_signed_request + +from .config import Profile +from .database import DeploymentError +from .diagnostics import CODE_CATEGORIES, classify_error, report + + +class ModelKeyError(DeploymentError): + """A safe discovery failure with no provider text or credential values.""" + + +class CredentialSource(Protocol): + def _credentials(self) -> Any: ... + + +def _creation_time(item: dict) -> datetime: + """Normalize creation metadata without assuming provider list ordering.""" + value = next( + ( + item[name] + for name in ("CreateTime", "CreatedAt", "CreationTime") + if name in item + ), + None, + ) + try: + if isinstance(value, bool) or not isinstance(value, (int, float, str)): + raise ValueError() + if isinstance(value, str) and not value.replace(".", "", 1).isdigit(): + instant = datetime.fromisoformat(value.replace("Z", "+00:00")) + if instant.tzinfo is None: + raise ValueError() + return instant.astimezone(timezone.utc) + seconds = float(value) + if not math.isfinite(seconds) or seconds <= 0: + raise ValueError() + if seconds >= 100_000_000_000: + seconds /= 1000 + return datetime.fromtimestamp(seconds, timezone.utc) + except (ValueError, TypeError, OverflowError, OSError): + report("list_model_keys", "protocol_error") + raise ModelKeyError( + "Cannot determine the newest Ark key from creation time; " + "set VEADK_MPA_ARK_API_KEY_ID or VEADK_MPA_ARK_API_KEY_NAME" + ) from None + + +async def _read( + cloud: CredentialSource, profile: Profile, action: str, body: dict +) -> dict: + operation = "list_model_keys" if action == "ListApiKeys" else "get_model_key" + for attempt in range(1, 4): + + def request(): + # Refresh and verify the deployment account for every signed call. + credential = cloud._credentials() + return volcengine_signed_request( + request_body=body, + ak=credential.access_key_id, + sk=credential.secret_access_key, + header={"X-Security-Token": credential.session_token or ""}, + service="ark", + region=profile.region, + host="open.volcengineapi.com", + path="/", + query={"Action": action, "Version": "2024-01-01"}, + timeout=(10, 30), + ) + + category = "" + try: + response = await asyncio.to_thread(request) + except Exception as error: + category = classify_error(error) + response = {} + if not category: + if not isinstance(response, dict): + category = "protocol_error" + else: + metadata = response.get("ResponseMetadata") or {} + failure = metadata.get("Error") if isinstance(metadata, dict) else None + if not isinstance(metadata, dict): + category = "protocol_error" + elif failure: + category = CODE_CATEGORIES.get( + str(failure.get("Code", "")) + if isinstance(failure, dict) + else "", + "provider_error", + ) + elif isinstance(response.get("Result"), dict): + return response["Result"] + else: + category = "protocol_error" + retry = attempt < 3 and category in { + "connection", + "timeout", + "throttled", + "unavailable", + } + report( + operation, + category, + attempt=attempt, + outcome="retrying" if retry else "failed", + ) + if not retry: + raise ModelKeyError( + "Ark model key lookup failed; check deployment Ark read permissions and connectivity" + ) from None + await asyncio.sleep((0.2, 0.5)[attempt - 1]) + raise AssertionError("Ark read retry loop exhausted") + + +async def resolve_model_key(profile: Profile, cloud: CredentialSource) -> Profile: + """Resolve only opted-in profiles; leave explicit CLI model auth unchanged.""" + options = profile.managed.model_key + if options.mode != "ark": + return profile + candidates: dict[str, dict] = {} + previous_total = None + for page in range(1, 101): + result = await _read( + cloud, + profile, + "ListApiKeys", + { + "ProjectName": options.project_name, + "Filter": {"AllowAll": True}, + "PageNumber": page, + "PageSize": 100, + }, + ) + items = result.get("Items") + total = result.get("TotalCount", result.get("Total")) + if ( + not isinstance(items, list) + or len(items) > 100 + or total is not None + and (type(total) is not int or total < 0) + or previous_total is not None + and total != previous_total + ): + raise ModelKeyError( + "Invalid Ark key list; retry after checking Ark configuration" + ) + for item in items: + if not isinstance(item, dict) or type(item.get("Id")) not in (str, int): + raise ModelKeyError("Invalid Ark key list") + identifier = str(item["Id"]) + if ( + not identifier + or identifier in candidates + and candidates[identifier] != item + ): + raise ModelKeyError("Conflicting Ark key list; retry discovery") + candidates[identifier] = item + if total is not None: + if len(candidates) > total or not items and len(candidates) < total: + raise ModelKeyError("Incomplete Ark key list; retry discovery") + if len(candidates) == total: + break + elif len(items) < 100: + break + previous_total = total + else: + raise ModelKeyError("Ark key list exceeded the discovery limit") + matches = [ + item + for identifier, item in candidates.items() + if (not options.api_key_id or identifier == options.api_key_id) + and (not options.api_key_name or item.get("Name") == options.api_key_name) + and ("Status" not in item or item["Status"] == "Active") + ] + if not matches: + report("list_model_keys", "not_found") + raise ModelKeyError( + "No matching Ark API key; create or enable a key in the selected project" + ) + selected = matches[0] + if len(matches) > 1 and not (options.api_key_id or options.api_key_name): + selected = max( + matches, key=lambda item: (_creation_time(item), str(item["Id"])) + ) + elif len(matches) > 1: + report("list_model_keys", "invalid_request") + raise ModelKeyError( + "Found multiple Ark API keys; set VEADK_MPA_ARK_API_KEY_ID or VEADK_MPA_ARK_API_KEY_NAME" + ) + identifier = selected["Id"] + result = await _read( + cloud, + profile, + "GetRawApiKey", + { + "Id": int(identifier) if str(identifier).isdigit() else identifier, + "ProjectName": options.project_name, + }, + ) + value = result.get("ApiKey") + if ( + not isinstance(value, str) + or not value + or len(value) > 512 + or "*" in value + or any(c.isspace() for c in value) + ): + report("get_model_key", "protocol_error") + raise ModelKeyError("Ark did not return a usable raw API key") + return replace(profile, values={**profile.values, "model_api_key": value}) diff --git a/veadk/integrations/mpa/managed/service.py b/veadk/integrations/mpa/managed/service.py index 6a5a11d59..8891ac4e7 100644 --- a/veadk/integrations/mpa/managed/service.py +++ b/veadk/integrations/mpa/managed/service.py @@ -41,6 +41,7 @@ from .gateway import SharedAPIGService from .gateway_cloud import GatewayCloud from .iam import ROLE_NAME, IamCloud, IamError, ensure_runtime_role +from .model_key import resolve_model_key from .network import AccountNetworkProvisioner, NetworkOptions from .runtime import AgentRuntimeDeployer, RuntimeCloud, env_map, template_from_runtime from .worker import WorkerCloud, ensure_worker @@ -233,6 +234,7 @@ async def provision( expected = str(profile.values.get("account_id", "")) if expected and account != expected: raise DeploymentError("Deployment credentials differ from the expected account") + profile = await resolve_model_key(profile, cloud) if profile.managed.iam.mode == "auto": if ( profile.managed.runtime.role_name diff --git a/veadk/integrations/mpa/managed/studio_profile.py b/veadk/integrations/mpa/managed/studio_profile.py index 4225f85fd..737a5728c 100644 --- a/veadk/integrations/mpa/managed/studio_profile.py +++ b/veadk/integrations/mpa/managed/studio_profile.py @@ -16,9 +16,11 @@ from __future__ import annotations +import os + def studio_profile_values() -> dict: - """Return a fresh Beijing profile; secrets remain server environment values.""" + """Return a fresh Beijing profile; model keys resolve with deployment identity.""" region = "cn-beijing" role = "IDRoleForArkClawShareAgent" model = "doubao-seed-2-0-pro-260215" @@ -28,9 +30,13 @@ def studio_profile_values() -> dict: "model-provider": "openai", "model-name": model, "model-api-base": "https://ark.cn-beijing.volces.com/api/v3/", - "model-api-key": "${VEADK_MPA_CONFIG_MODEL_AGENT_API_KEY}", "managed": { "version": 1, + "model-key": { + "mode": "ark", + "api-key-id": os.getenv("VEADK_MPA_ARK_API_KEY_ID", "").strip(), + "api-key-name": os.getenv("VEADK_MPA_ARK_API_KEY_NAME", "").strip(), + }, "iam": {"mode": "auto"}, "postgres": { "mode": "auto", diff --git a/veadk/webui/assets/app/index-jtZg_8XU.js b/veadk/webui/assets/app/index-Djxxd5-6.js similarity index 60% rename from veadk/webui/assets/app/index-jtZg_8XU.js rename to veadk/webui/assets/app/index-Djxxd5-6.js index 90480834d..306cc630f 100644 --- a/veadk/webui/assets/app/index-jtZg_8XU.js +++ b/veadk/webui/assets/app/index-Djxxd5-6.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/visualizations/mermaid/mermaid.core-Vsbm7qIM.js","assets/chunks/purify.es-BnINGy_Y.js","assets/chunks/MarkdownPromptEditor-Di8dSDc3.js","assets/styles/MarkdownPromptEditor-ZH9qtki0.css","assets/chunks/QuickAgentCreateDialog-BoukSlN9.js","assets/styles/QuickAgentCreateDialog-DGsLIlOX.css"])))=>i.map(i=>d[i]); -var Lze=Object.defineProperty;var RG=e=>{throw TypeError(e)};var $ze=(e,t,n)=>t in e?Lze(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Zt=(e,t,n)=>$ze(e,typeof t!="symbol"?t+"":t,n),IG=(e,t,n)=>t.has(e)||RG("Cannot "+n);var kl=(e,t,n)=>(IG(e,t,"read from private field"),n?n.call(e):t.get(e)),PG=(e,t,n)=>t.has(e)?RG("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),w5=(e,t,n,i)=>(IG(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n);function Fze(e,t){for(var n=0;ni[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();var cg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function T1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Tue={exports:{}},XP={};/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/visualizations/mermaid/mermaid.core-CgV8Rw9c.js","assets/chunks/purify.es-BnINGy_Y.js","assets/chunks/MarkdownPromptEditor-DC-LvA9l.js","assets/styles/MarkdownPromptEditor-ZH9qtki0.css","assets/chunks/QuickAgentCreateDialog-BDjHgo6h.js","assets/styles/QuickAgentCreateDialog-DGsLIlOX.css"])))=>i.map(i=>d[i]); +var Fze=Object.defineProperty;var IG=e=>{throw TypeError(e)};var Bze=(e,t,n)=>t in e?Fze(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Zt=(e,t,n)=>Bze(e,typeof t!="symbol"?t+"":t,n),PG=(e,t,n)=>t.has(e)||IG("Cannot "+n);var kl=(e,t,n)=>(PG(e,t,"read from private field"),n?n.call(e):t.get(e)),DG=(e,t,n)=>t.has(e)?IG("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),O5=(e,t,n,i)=>(PG(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n);function Uze(e,t){for(var n=0;ni[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();var ug=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _ue={exports:{}},XP={};/** * @license React * react-jsx-runtime.production.js * @@ -7,8 +7,8 @@ var Lze=Object.defineProperty;var RG=e=>{throw TypeError(e)};var $ze=(e,t,n)=>t * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Bze=Symbol.for("react.transitional.element"),Uze=Symbol.for("react.fragment");function _ue(e,t,n){var i=null;if(n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),"key"in t){n={};for(var r in t)r!=="key"&&(n[r]=t[r])}else n=t;return t=n.ref,{$$typeof:Bze,type:e,key:i,ref:t!==void 0?t:null,props:n}}XP.Fragment=Uze;XP.jsx=_ue;XP.jsxs=_ue;Tue.exports=XP;var a=Tue.exports;const jue={requestFailed:"Request failed ({{status}})",unknownError:"Unknown error",contentTypeMissing:"Content-Type missing",response:"Response: {{response}}",fallbackWithDetail:"{{fallback}}: {{detail}}",fallbackWithHttpStatus:"{{fallback}} (HTTP {{status}})",nonJsonResponse:"{{fallback}}: the server returned a non-JSON response ({{contentType}})"},Nue={unconfigured:"AgentKit Dev Sandbox has not been configured by an administrator.",invalidSession:"AgentKit CLI returned an invalid session.",loadCapabilitiesFailed:"Unable to load the AgentKit CLI configuration.",invalidCapabilities:"AgentKit CLI returned an invalid configuration status.",listSessionsFailed:"Unable to load AgentKit CLI sessions.",invalidSessionList:"AgentKit CLI returned an invalid session list.",createSessionFailed:"Unable to create an AgentKit CLI session.",openSessionFailed:"Unable to open the AgentKit CLI session.",openTerminalFailed:"Unable to open the AgentKit CLI terminal.",invalidTerminalUrl:"AgentKit CLI returned an invalid terminal URL."},Rue={cnBeijing:"China North 2 (Beijing)",cnShanghai:"China East 2 (Shanghai)"},Iue={runtimeUnsupported:"This Runtime does not currently support connections. Confirm that the service is running normally."},Pue={autoConfigureFailed:"Failed to configure the Feishu bot automatically"},Due={actionFailed:"Failed to {{action}}",detail:"Details: {{detail}}",request:"Request: {{request}}"},Mue={persistentMemoryHint:"Tip: The session no longer exists. With in-memory or SQLite short-term memory, sessions may be lost during multi-instance routing, process restarts, or rolling deployments. Use database-backed persistent short-term memory instead.",unsupportedRouteHint:"Tip: This Runtime does not provide the session run API and may be incompatible with the current Studio version.",toolArgumentHint:"Tip: The model generated incomplete tool arguments. Send the request again.",resourceCollectionExpiredHint:"Tip: This resource collection has expired. Send the task again so the system can collect the resources before creating the Agent.",networkConfigurationHint:"Tip: Try again later, and review the Runtime, model, or gateway logs.",modelQuotaHint:"Tip: The model has reached its TPM/RPM quota. Try again later or increase the model quota.",rawResponseLabel:"Raw response: ",copySecretFailed:"Failed to copy the secret value"},Lue={httpStatus:"HTTP status: {{status}}",errorCode:"Error code: {{code}}",cloudResponseBody:`Cloud response body: -{{body}}`,loadFailedWithDetail:"Failed to load instance logs: {{detail}}",invalidFormat:"Failed to load instance logs: the service returned an invalid format"},$ue={untitledSession:"Untitled session",webUnavailable:"Web search is unavailable because /web/search is not enabled on the server.",webFailed:"Web search failed: {{message}}",webNotMounted:"This Agent does not have the web_search tool mounted.",knowledgeNotMounted:"This Agent does not have a knowledge base mounted.",memoryNotMounted:"This Agent does not have long-term memory mounted.",knowledge:"Knowledge base",longTermMemory:"Long-term memory"},Fue={listSpacesFailed:"Failed to load Skill spaces",createSpaceFailed:"Failed to create the Skill space",updateSpaceFailed:"Failed to update the Skill space",deleteSpaceFailed:"Failed to delete the Skill space",uploadFailed:"Failed to upload the Skill",validateFailed:"Failed to validate the Skill",deleteFailed:"Failed to delete the Skill",listFilesFailed:"Failed to load Skill files",downloadFailed:"Failed to download the Skill",sharedSpaceFailed:"Shared space unavailable",reservedSpaceName:"This name is reserved for a system space; choose another name",reviewSpaceFailed:"The review space is unavailable",submitReviewFailed:"Could not submit the publication request",listReviewsFailed:"Could not load review requests",reviewFilesFailed:"Could not load submitted files",decideReviewFailed:"Review failed, please try again",listVersionsFailed:"Unable to load skill versions",uploadVersionFailed:"Unable to upload the new skill version"},Bue={truncatedData:"{{data}}… (truncated, {{count}} characters total)",incompleteEvent:"The stream ended with an incomplete SSE event. Raw data: {{data}}",invalidEventJson:"Failed to parse the SSE event JSON. Raw data: {{data}}"},Uue={loadConfigNetworkFailed:"Unable to load the sign-in configuration. Check your network and try again.",configServiceFailed:"The sign-in configuration service failed (HTTP {{status}}). Try again later.",invalidConfigResponse:"The sign-in configuration service returned an unreadable response. Try again later.",serviceNetworkFailed:"Unable to connect to the identity service. Check your network and try again.",invalidServiceResponse:"The identity service returned an unreadable response. Try again later.",serviceFailed:"The identity service failed (HTTP {{status}}). Try again later."},Que={invalidToken:"The GitHub token is invalid or does not have repository write access",notFound:"The repository, branch, or file does not exist, or the token cannot access it",rejectedCommit:"GitHub rejected the commit. Check the branch and file state",requestFailed:"GitHub request failed (HTTP {{status}})",networkFailed:"Unable to connect to GitHub. Check your network and try again",invalidRepositoryFormat:"The GitHub repository must use the owner/repository format",insecureRepositoryUrl:"Only secure github.com repository URLs are supported",unsafeProjectPath:"The Agent project directory must be a safe relative path within the repository",tokenRequired:"A GitHub token is required",invalidBaseBranch:"The target branch format is invalid",invalidPublishBranch:"The publish branch format is invalid",noFiles:"There are no files to commit",missingBaseSha:"The target branch does not have a valid Git SHA",fileAlreadyExists:"{{path}} already exists in the target repository; the existing file was not overwritten",pathNotUpdatable:"The target path {{path}} is not an updatable file",invalidPullRequest:"GitHub did not return a valid pull request"},zue={loadCapabilitiesFailed:"Failed to load video model capabilities",uploadAssetFailed:"Failed to upload {{fileName}}",enhancePromptFailed:"Failed to enhance the prompt",createTaskFailed:"Failed to create the video generation task",getTaskFailed:"Failed to load the video generation task",downloadFailed:"Failed to download the generated video"},Vue={listFailed:"Failed to load website integrations",createFailed:"Failed to create the website integration",deleteFailed:"Failed to delete the website integration"},Hue={loadFailed:"Failed to load the knowledge base",htmlHidden:"[HTML content hidden]",redacted:"[redacted]",depthTruncated:"[content nested too deeply; truncated]",circularReference:"[circular reference]",diagnosticsUnavailable:"[diagnostic information unavailable]",statusCode:"Status: {{status}}",errorCode:"Error code: {{code}}",requestId:"Request ID: {{requestId}}",diagnostics:"Diagnostics: {{diagnostics}}",detail:"Details: {{detail}}",signInRequired:"Sign in before accessing knowledge bases",forbidden:"You do not have permission to operate on this knowledge base",notFound:"The knowledge base or knowledge content does not exist",conflict:"The knowledge base cannot perform this operation in its current state",requestFailed:"Knowledge base request failed ({{status}})"},que={invalidName:"Names must contain 1–128 characters, without control or invisible formatting characters, or < >.",renameProjectFailed:"Unable to update the project name",renameVersionFailed:"Unable to update the version name",invalidNameUpdateResponse:"The name update response does not match the request. Refresh and try again.",invalidSourceSnapshot:"The source snapshot response has an invalid format.",invalidProjectList:"The project list response has an invalid format.",invalidProjectVersion:"The project version response has an invalid format.",loadProjectsFailed:"Unable to load saved projects",loadVersionsFailed:"Unable to load project versions",deleteVersionFailed:"Failed to delete the project version",invalidDeleteVersionResponse:"The project version deletion response has an invalid format.",loadProjectSourceFailed:"Unable to load project source",loadSnapshotFailed:"Unable to load the source snapshot",restoreSnapshotFailed:"Unable to restore the current source snapshot",downloadSourceFailed:"Failed to download the source",downloadNotZip:"The source download response is not a ZIP file.",downloadSizeMismatch:"The source archive size does not match the published record. Try again."},Wue={invalidFormat:"{{label}} has an invalid format.",validationSeparator:"; ",invalidAnalysisResult:"The migration analysis result has an invalid format.",invalidFrameworkCandidate:"A framework candidate has an invalid format.",invalidAnalysisEvidence:"The analysis evidence has an invalid format.",invalidEntryCandidate:"An entry candidate has an invalid format.",invalidQuestion:"A follow-up question has an invalid format.",invalidPendingInput:"Analysis questions are not readable",invalidTask:"The migration session has an invalid format.",invalidAnalysisReference:"The analysis result reference has an invalid format.",invalidSourcePersistence:"The migration source persistence status has an invalid format.",invalidActivity:"The migration activity has an invalid format.",invalidActivityItem:"A migration activity item has an invalid format.",invalidActivityTool:"A migration activity tool item has an invalid format.",invalidActivityPlan:"The migration execution plan has an invalid format.",invalidActivityPlanItem:"A migration execution plan item has an invalid format.",invalidArtifact:"The migration artifact has an invalid format.",invalidEnvironmentDefaults:"The environment variable defaults have an invalid format.",invalidArtifactFile:"A migration artifact file has an invalid format.",invalidVerificationCheck:"A migration verification check has an invalid format.",requestValidationFailed:"Request validation failed: {{detail}}",gatewayError:"{{fallback}} (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",nonJsonResponse:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}). Check the proxy or gateway configuration.",loadCapabilitiesFailed:"Failed to load migration capabilities",invalidCapabilities:"The migration capabilities have an invalid format.",invalidModelCapabilities:"The migration model capabilities have an invalid format.",loadTasksFailed:"Failed to load migration sessions",invalidTaskList:"The migration session list has an invalid format.",createTaskFailed:"Failed to create the migration session",uploadProjectFailed:"Failed to upload the migration project",loadActivityFailed:"Failed to load migration activity",loadEventsFailed:"Failed to follow the migration progress stream",invalidEventsResponse:"The migration progress stream returned an invalid frame.",reconnecting:"Connection lost. Reconnecting to the migration progress stream…",startFailed:"Failed to start the migration",submitAnswersFailed:"Failed to submit additional analysis information",submitInputFailed:"Could not submit the analysis answer",stopFailed:"Failed to stop the migration",deleteTaskFailed:"Failed to delete the migration session",loadArtifactFailed:"Failed to load the migration artifact",loadArtifactFileFailed:"Failed to load the migration artifact file",downloadArtifactFailed:"Failed to download the migration artifact",evaluation:{datasetSaveFailed:"Failed to save evaluation cases",datasetLoadFailed:"Failed to load evaluation cases",statusLoadFailed:"Failed to load evaluation status",resumeFailed:"Failed to continue evaluation",retryFailed:"Failed to retry evaluation",reportLoadFailed:"Failed to load the evaluation report",reportDownloadFailed:"Failed to download the evaluation report"},labels:{analysisResult:"Migration analysis result",recommendation:"Migration recommendation",boundary:"Migration boundary",frameworkCandidate:"Framework candidate",analysisEvidence:"Analysis evidence",recommendedFramework:"Recommended framework",entryCandidate:"Entry candidate",entryFramework:"Entry framework",includeScope:"Migration include scope",excludeScope:"Migration exclude scope",assumptions:"Analysis assumptions",question:"Follow-up question",analysisWarnings:"Migration warnings",task:"Migration session",artifactStatus:"Migration artifact status",analysisReference:"Analysis result reference",confirmation:"Migration confirmation",confirmedFramework:"Confirmed framework",error:"Migration error",sourcePersistence:"Migration source persistence status",activity:"Migration activity",activityItem:"Migration activity item",activityTool:"Migration activity tool item",activityPlanItem:"Migration activity plan item",artifact:"Migration artifact",cli:"CLI information",migration:"Migration information",startup:"Startup information",environment:"Environment variable information",verification:"Verification information",report:"Migration report",archive:"Artifact archive",environmentDefaults:"Environment variable defaults",requiredEnvironment:"Required environment variables",optionalEnvironment:"Optional environment variables",artifactFile:"Migration artifact file",verificationCheck:"Migration verification check",artifactWarnings:"Migration artifact warnings",errorResponse:"Error response",errorDetail:"Error details",capabilities:"Migration capabilities",framework:"Migration framework",modelCapabilities:"Migration model capabilities",taskList:"Migration session list",evaluationAsset:"Evaluation asset",evaluation:"Evaluation status",evaluationCapabilities:"Evaluation capabilities",evaluationDimension:"Evaluation dimension",evaluationCase:"Evaluation case",evaluationCriteria:"Evaluation criteria",evaluationMessage:"Evaluation conversation",evaluationDataset:"Evaluation dataset",evaluationDimensionResult:"Evaluation dimension result",evaluationEvidence:"Evaluation evidence",evaluationReport:"Evaluation report",evaluationSummary:"Evaluation summary",evaluationCaseResult:"Evaluation case result",evaluationOutput:"Evaluation output",evaluationLimitations:"Evaluation limitations",pendingInput:"Analysis question",pendingQuestion:"Analysis question item",pendingOption:"Analysis question option"}},Kue={status:{ready:"Ready",wakeable:"Asleep",creating:"Creating",starting:"Starting",pending:"Pending",running:"Running",failed:"Error",stopped:"Stopped",expired:"Expired",deleting:"Deleting",deleted:"Deleted",unknown:"Unknown status"},developmentTimeout:"The development environment timed out. The task may still be running; reopen this session later to check its status.",developmentDisconnected:"The connection to the development environment was interrupted. The task may still be running; reopen this session later to check its status.",developmentFailed:"The development task could not continue. The environment was preserved; try again in this session.",invalidStudioResponse:"{{fallback}} Studio returned an invalid response. Refresh and try again.",invalidSession:"AgentKit Sandbox returned invalid session information.",invalidSnapshot:"AgentKit Sandbox returned invalid snapshot information.",invalidSettings:"Sandbox returned invalid settings.",invalidThreadSnapshot:"Sandbox returned an invalid thread snapshot.",emptyConversationResponse:"The Sandbox conversation service returned no content.",invalidConversationResponse:"The Sandbox conversation service returned an unreadable response.",conversationFailed:"The Sandbox conversation failed. Try again later.",emptyReply:"Sandbox did not return a valid reply. Try again.",missingSession:"The AgentKit session is missing.",listCodexFailed:"Unable to load Codex agents. Try again later.",invalidSessionList:"AgentKit Sandbox returned an invalid session list.",invalidSnapshotList:"AgentKit Sandbox returned an invalid snapshot list.",startFailed:"Unable to start AgentKit Sandbox. Try again later.",listAgentFailed:"Unable to load {{kind}} agents. Try again later.",invalidKindSessionList:"AgentKit returned an invalid {{kind}} session list.",invalidKindSnapshotList:"AgentKit returned an invalid {{kind}} snapshot list.",createAgentFailed:"Unable to create a {{kind}} agent. Try again later.",missingSessionToOpen:"The AgentKit session to open is missing.",openAgentFailed:"Unable to open the {{kind}} agent.",invalidAgentHomeUrl:"The {{kind}} agent returned an invalid home URL.",missingSessionForTerminal:"The AgentKit session for the terminal is missing.",openTerminalFailed:"Unable to open the {{kind}} terminal.",deleteAgentFailed:"Unable to delete the {{kind}} agent.",missingSnapshot:"The agent to wake was not found.",resumeSnapshotFailed:"Unable to wake the agent. Try again later.",deleteSnapshotFailed:"Unable to delete the agent. Try again later.",missingSessionToConnect:"The AgentKit session to connect is missing.",connectCodexFailed:"Unable to connect to the Codex agent. Try again later.",sessionNotReady:"The AgentKit session is not ready. Current status: {{status}}.",invalidMessage:"The built-in agent session does not contain a valid message.",interruptFailed:"Unable to stop the current task.",getStatusFailed:"Unable to load Codex status.",getEndpointFailed:"Unable to load the Sandbox endpoint.",invalidEndpoint:"Sandbox returned an invalid endpoint.",createHandoffPairingFailed:"Unable to create a Codex cloud handoff pairing code.",invalidHandoffPairing:"Studio returned an invalid Codex cloud handoff pairing code.",getHandoffStatusFailed:"Unable to load the cloud handoff status.",invalidHandoffStatus:"Studio returned an invalid cloud handoff status.",listModelsFailed:"Unable to load Codex models.",invalidModelList:"Sandbox returned an invalid model list.",setModelFailed:"Unable to switch the Codex model.",invalidModel:"Sandbox returned an invalid model.",listSkillsFailed:"Unable to load Codex Skills.",invalidSkillList:"Sandbox returned an invalid Skill list.",listThreadsFailed:"Unable to load Codex threads.",invalidThreadList:"Sandbox returned an invalid thread list.",createThreadFailed:"Unable to create a new Codex thread.",missingThread:"The Codex thread to read is missing.",readThreadFailed:"Unable to load Codex history.",resumeThreadFailed:"Unable to resume the Codex thread.",forkThreadFailed:"Unable to fork the Codex thread.",archiveThreadFailed:"Unable to archive the Codex thread.",invalidArchiveResult:"Sandbox returned an invalid archive result.",deleteThreadFailed:"Unable to delete the Codex thread.",invalidDeleteResult:"Sandbox returned an invalid deletion result.",compactThreadFailed:"Unable to compact the Codex thread.",getSettingsFailed:"Unable to load Codex permissions and workspace settings.",updatePermissionsFailed:"Unable to update Codex permissions.",updateWorkspaceFailed:"Unable to update the Codex workspace.",invalidWorkingDirectory:"Sandbox returned an invalid working directory.",listDirectoriesFailed:"Unable to load Sandbox directories.",invalidDirectoryList:"Sandbox returned an invalid directory list.",resolveApprovalFailed:"Unable to submit the Codex approval decision.",uploadFileFailed:"Unable to upload the file to Sandbox.",invalidUploadResult:"Sandbox returned an invalid upload result.",disconnectCodexFailed:"Unable to disconnect the Codex agent.",deleteCodexFailed:"Unable to delete the Codex agent.",openSandboxTerminalFailed:"Unable to open the Sandbox terminal.",openSandboxBrowserFailed:"Unable to open the Sandbox browser.",toolLabel:"Sandbox tool",invalidToolUrl:"{{label}} returned an invalid URL.",unsafeToolUrl:"{{label}} returned an unsafe URL."},Gue={invalidSandboxVersion:"Invalid sandbox version response",loadSandboxVersionsFailed:"Failed to check sandbox versions",updateSandboxFailed:"Failed to update sandbox",invalidSandboxUpdate:"Invalid sandbox update response",errorWithDetailAndRawResponse:`{{context}} + */var Qze=Symbol.for("react.transitional.element"),zze=Symbol.for("react.fragment");function jue(e,t,n){var i=null;if(n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),"key"in t){n={};for(var r in t)r!=="key"&&(n[r]=t[r])}else n=t;return t=n.ref,{$$typeof:Qze,type:e,key:i,ref:t!==void 0?t:null,props:n}}XP.Fragment=zze;XP.jsx=jue;XP.jsxs=jue;_ue.exports=XP;var a=_ue.exports;const Nue={requestFailed:"Request failed ({{status}})",unknownError:"Unknown error",contentTypeMissing:"Content-Type missing",response:"Response: {{response}}",fallbackWithDetail:"{{fallback}}: {{detail}}",fallbackWithHttpStatus:"{{fallback}} (HTTP {{status}})",nonJsonResponse:"{{fallback}}: the server returned a non-JSON response ({{contentType}})"},Rue={unconfigured:"AgentKit Dev Sandbox has not been configured by an administrator.",invalidSession:"AgentKit CLI returned an invalid session.",loadCapabilitiesFailed:"Unable to load the AgentKit CLI configuration.",invalidCapabilities:"AgentKit CLI returned an invalid configuration status.",listSessionsFailed:"Unable to load AgentKit CLI sessions.",invalidSessionList:"AgentKit CLI returned an invalid session list.",createSessionFailed:"Unable to create an AgentKit CLI session.",openSessionFailed:"Unable to open the AgentKit CLI session.",openTerminalFailed:"Unable to open the AgentKit CLI terminal.",invalidTerminalUrl:"AgentKit CLI returned an invalid terminal URL."},Iue={cnBeijing:"China North 2 (Beijing)",cnShanghai:"China East 2 (Shanghai)"},Pue={runtimeUnsupported:"This Runtime does not currently support connections. Confirm that the service is running normally."},Due={autoConfigureFailed:"Failed to configure the Feishu bot automatically"},Mue={actionFailed:"Failed to {{action}}",detail:"Details: {{detail}}",request:"Request: {{request}}"},Lue={persistentMemoryHint:"Tip: The session no longer exists. With in-memory or SQLite short-term memory, sessions may be lost during multi-instance routing, process restarts, or rolling deployments. Use database-backed persistent short-term memory instead.",unsupportedRouteHint:"Tip: This Runtime does not provide the session run API and may be incompatible with the current Studio version.",toolArgumentHint:"Tip: The model generated incomplete tool arguments. Send the request again.",resourceCollectionExpiredHint:"Tip: This resource collection has expired. Send the task again so the system can collect the resources before creating the Agent.",networkConfigurationHint:"Tip: Try again later, and review the Runtime, model, or gateway logs.",modelQuotaHint:"Tip: The model has reached its TPM/RPM quota. Try again later or increase the model quota.",rawResponseLabel:"Raw response: ",copySecretFailed:"Failed to copy the secret value"},$ue={httpStatus:"HTTP status: {{status}}",errorCode:"Error code: {{code}}",cloudResponseBody:`Cloud response body: +{{body}}`,loadFailedWithDetail:"Failed to load instance logs: {{detail}}",invalidFormat:"Failed to load instance logs: the service returned an invalid format"},Fue={untitledSession:"Untitled session",webUnavailable:"Web search is unavailable because /web/search is not enabled on the server.",webFailed:"Web search failed: {{message}}",webNotMounted:"This Agent does not have the web_search tool mounted.",knowledgeNotMounted:"This Agent does not have a knowledge base mounted.",memoryNotMounted:"This Agent does not have long-term memory mounted.",knowledge:"Knowledge base",longTermMemory:"Long-term memory"},Bue={listSpacesFailed:"Failed to load Skill spaces",createSpaceFailed:"Failed to create the Skill space",updateSpaceFailed:"Failed to update the Skill space",deleteSpaceFailed:"Failed to delete the Skill space",uploadFailed:"Failed to upload the Skill",validateFailed:"Failed to validate the Skill",deleteFailed:"Failed to delete the Skill",listFilesFailed:"Failed to load Skill files",downloadFailed:"Failed to download the Skill",sharedSpaceFailed:"Shared space unavailable",reservedSpaceName:"This name is reserved for a system space; choose another name",reviewSpaceFailed:"The review space is unavailable",submitReviewFailed:"Could not submit the publication request",listReviewsFailed:"Could not load review requests",reviewFilesFailed:"Could not load submitted files",decideReviewFailed:"Review failed, please try again",listVersionsFailed:"Unable to load skill versions",uploadVersionFailed:"Unable to upload the new skill version"},Uue={truncatedData:"{{data}}… (truncated, {{count}} characters total)",incompleteEvent:"The stream ended with an incomplete SSE event. Raw data: {{data}}",invalidEventJson:"Failed to parse the SSE event JSON. Raw data: {{data}}"},Que={loadConfigNetworkFailed:"Unable to load the sign-in configuration. Check your network and try again.",configServiceFailed:"The sign-in configuration service failed (HTTP {{status}}). Try again later.",invalidConfigResponse:"The sign-in configuration service returned an unreadable response. Try again later.",serviceNetworkFailed:"Unable to connect to the identity service. Check your network and try again.",invalidServiceResponse:"The identity service returned an unreadable response. Try again later.",serviceFailed:"The identity service failed (HTTP {{status}}). Try again later."},zue={invalidToken:"The GitHub token is invalid or does not have repository write access",notFound:"The repository, branch, or file does not exist, or the token cannot access it",rejectedCommit:"GitHub rejected the commit. Check the branch and file state",requestFailed:"GitHub request failed (HTTP {{status}})",networkFailed:"Unable to connect to GitHub. Check your network and try again",invalidRepositoryFormat:"The GitHub repository must use the owner/repository format",insecureRepositoryUrl:"Only secure github.com repository URLs are supported",unsafeProjectPath:"The Agent project directory must be a safe relative path within the repository",tokenRequired:"A GitHub token is required",invalidBaseBranch:"The target branch format is invalid",invalidPublishBranch:"The publish branch format is invalid",noFiles:"There are no files to commit",missingBaseSha:"The target branch does not have a valid Git SHA",fileAlreadyExists:"{{path}} already exists in the target repository; the existing file was not overwritten",pathNotUpdatable:"The target path {{path}} is not an updatable file",invalidPullRequest:"GitHub did not return a valid pull request"},Vue={loadCapabilitiesFailed:"Failed to load video model capabilities",uploadAssetFailed:"Failed to upload {{fileName}}",enhancePromptFailed:"Failed to enhance the prompt",createTaskFailed:"Failed to create the video generation task",getTaskFailed:"Failed to load the video generation task",downloadFailed:"Failed to download the generated video"},Hue={listFailed:"Failed to load website integrations",createFailed:"Failed to create the website integration",deleteFailed:"Failed to delete the website integration"},que={loadFailed:"Failed to load the knowledge base",htmlHidden:"[HTML content hidden]",redacted:"[redacted]",depthTruncated:"[content nested too deeply; truncated]",circularReference:"[circular reference]",diagnosticsUnavailable:"[diagnostic information unavailable]",statusCode:"Status: {{status}}",errorCode:"Error code: {{code}}",requestId:"Request ID: {{requestId}}",diagnostics:"Diagnostics: {{diagnostics}}",detail:"Details: {{detail}}",signInRequired:"Sign in before accessing knowledge bases",forbidden:"You do not have permission to operate on this knowledge base",notFound:"The knowledge base or knowledge content does not exist",conflict:"The knowledge base cannot perform this operation in its current state",requestFailed:"Knowledge base request failed ({{status}})"},Wue={invalidName:"Names must contain 1–128 characters, without control or invisible formatting characters, or < >.",renameProjectFailed:"Unable to update the project name",renameVersionFailed:"Unable to update the version name",invalidNameUpdateResponse:"The name update response does not match the request. Refresh and try again.",invalidSourceSnapshot:"The source snapshot response has an invalid format.",invalidProjectList:"The project list response has an invalid format.",invalidProjectVersion:"The project version response has an invalid format.",loadProjectsFailed:"Unable to load saved projects",loadVersionsFailed:"Unable to load project versions",deleteVersionFailed:"Failed to delete the project version",invalidDeleteVersionResponse:"The project version deletion response has an invalid format.",loadProjectSourceFailed:"Unable to load project source",loadSnapshotFailed:"Unable to load the source snapshot",restoreSnapshotFailed:"Unable to restore the current source snapshot",downloadSourceFailed:"Failed to download the source",downloadNotZip:"The source download response is not a ZIP file.",downloadSizeMismatch:"The source archive size does not match the published record. Try again."},Kue={invalidFormat:"{{label}} has an invalid format.",validationSeparator:"; ",invalidAnalysisResult:"The migration analysis result has an invalid format.",invalidFrameworkCandidate:"A framework candidate has an invalid format.",invalidAnalysisEvidence:"The analysis evidence has an invalid format.",invalidEntryCandidate:"An entry candidate has an invalid format.",invalidQuestion:"A follow-up question has an invalid format.",invalidPendingInput:"Analysis questions are not readable",invalidTask:"The migration session has an invalid format.",invalidAnalysisReference:"The analysis result reference has an invalid format.",invalidSourcePersistence:"The migration source persistence status has an invalid format.",invalidActivity:"The migration activity has an invalid format.",invalidActivityItem:"A migration activity item has an invalid format.",invalidActivityTool:"A migration activity tool item has an invalid format.",invalidActivityPlan:"The migration execution plan has an invalid format.",invalidActivityPlanItem:"A migration execution plan item has an invalid format.",invalidArtifact:"The migration artifact has an invalid format.",invalidEnvironmentDefaults:"The environment variable defaults have an invalid format.",invalidArtifactFile:"A migration artifact file has an invalid format.",invalidVerificationCheck:"A migration verification check has an invalid format.",requestValidationFailed:"Request validation failed: {{detail}}",gatewayError:"{{fallback}} (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",nonJsonResponse:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}). Check the proxy or gateway configuration.",loadCapabilitiesFailed:"Failed to load migration capabilities",invalidCapabilities:"The migration capabilities have an invalid format.",invalidModelCapabilities:"The migration model capabilities have an invalid format.",loadTasksFailed:"Failed to load migration sessions",invalidTaskList:"The migration session list has an invalid format.",createTaskFailed:"Failed to create the migration session",uploadProjectFailed:"Failed to upload the migration project",loadActivityFailed:"Failed to load migration activity",loadEventsFailed:"Failed to follow the migration progress stream",invalidEventsResponse:"The migration progress stream returned an invalid frame.",reconnecting:"Connection lost. Reconnecting to the migration progress stream…",startFailed:"Failed to start the migration",submitAnswersFailed:"Failed to submit additional analysis information",submitInputFailed:"Could not submit the analysis answer",stopFailed:"Failed to stop the migration",deleteTaskFailed:"Failed to delete the migration session",loadArtifactFailed:"Failed to load the migration artifact",loadArtifactFileFailed:"Failed to load the migration artifact file",downloadArtifactFailed:"Failed to download the migration artifact",evaluation:{datasetSaveFailed:"Failed to save evaluation cases",datasetLoadFailed:"Failed to load evaluation cases",statusLoadFailed:"Failed to load evaluation status",resumeFailed:"Failed to continue evaluation",retryFailed:"Failed to retry evaluation",reportLoadFailed:"Failed to load the evaluation report",reportDownloadFailed:"Failed to download the evaluation report"},labels:{analysisResult:"Migration analysis result",recommendation:"Migration recommendation",boundary:"Migration boundary",frameworkCandidate:"Framework candidate",analysisEvidence:"Analysis evidence",recommendedFramework:"Recommended framework",entryCandidate:"Entry candidate",entryFramework:"Entry framework",includeScope:"Migration include scope",excludeScope:"Migration exclude scope",assumptions:"Analysis assumptions",question:"Follow-up question",analysisWarnings:"Migration warnings",task:"Migration session",artifactStatus:"Migration artifact status",analysisReference:"Analysis result reference",confirmation:"Migration confirmation",confirmedFramework:"Confirmed framework",error:"Migration error",sourcePersistence:"Migration source persistence status",activity:"Migration activity",activityItem:"Migration activity item",activityTool:"Migration activity tool item",activityPlanItem:"Migration activity plan item",artifact:"Migration artifact",cli:"CLI information",migration:"Migration information",startup:"Startup information",environment:"Environment variable information",verification:"Verification information",report:"Migration report",archive:"Artifact archive",environmentDefaults:"Environment variable defaults",requiredEnvironment:"Required environment variables",optionalEnvironment:"Optional environment variables",artifactFile:"Migration artifact file",verificationCheck:"Migration verification check",artifactWarnings:"Migration artifact warnings",errorResponse:"Error response",errorDetail:"Error details",capabilities:"Migration capabilities",framework:"Migration framework",modelCapabilities:"Migration model capabilities",taskList:"Migration session list",evaluationAsset:"Evaluation asset",evaluation:"Evaluation status",evaluationCapabilities:"Evaluation capabilities",evaluationDimension:"Evaluation dimension",evaluationCase:"Evaluation case",evaluationCriteria:"Evaluation criteria",evaluationMessage:"Evaluation conversation",evaluationDataset:"Evaluation dataset",evaluationDimensionResult:"Evaluation dimension result",evaluationEvidence:"Evaluation evidence",evaluationReport:"Evaluation report",evaluationSummary:"Evaluation summary",evaluationCaseResult:"Evaluation case result",evaluationOutput:"Evaluation output",evaluationLimitations:"Evaluation limitations",pendingInput:"Analysis question",pendingQuestion:"Analysis question item",pendingOption:"Analysis question option"}},Gue={status:{ready:"Ready",wakeable:"Asleep",creating:"Creating",starting:"Starting",pending:"Pending",running:"Running",failed:"Error",stopped:"Stopped",expired:"Expired",deleting:"Deleting",deleted:"Deleted",unknown:"Unknown status"},developmentTimeout:"The development environment timed out. The task may still be running; reopen this session later to check its status.",developmentDisconnected:"The connection to the development environment was interrupted. The task may still be running; reopen this session later to check its status.",developmentFailed:"The development task could not continue. The environment was preserved; try again in this session.",invalidStudioResponse:"{{fallback}} Studio returned an invalid response. Refresh and try again.",invalidSession:"AgentKit Sandbox returned invalid session information.",invalidSnapshot:"AgentKit Sandbox returned invalid snapshot information.",invalidSettings:"Sandbox returned invalid settings.",invalidThreadSnapshot:"Sandbox returned an invalid thread snapshot.",emptyConversationResponse:"The Sandbox conversation service returned no content.",invalidConversationResponse:"The Sandbox conversation service returned an unreadable response.",conversationFailed:"The Sandbox conversation failed. Try again later.",emptyReply:"Sandbox did not return a valid reply. Try again.",missingSession:"The AgentKit session is missing.",listCodexFailed:"Unable to load Codex agents. Try again later.",invalidSessionList:"AgentKit Sandbox returned an invalid session list.",invalidSnapshotList:"AgentKit Sandbox returned an invalid snapshot list.",startFailed:"Unable to start AgentKit Sandbox. Try again later.",listAgentFailed:"Unable to load {{kind}} agents. Try again later.",invalidKindSessionList:"AgentKit returned an invalid {{kind}} session list.",invalidKindSnapshotList:"AgentKit returned an invalid {{kind}} snapshot list.",createAgentFailed:"Unable to create a {{kind}} agent. Try again later.",missingSessionToOpen:"The AgentKit session to open is missing.",openAgentFailed:"Unable to open the {{kind}} agent.",invalidAgentHomeUrl:"The {{kind}} agent returned an invalid home URL.",missingSessionForTerminal:"The AgentKit session for the terminal is missing.",openTerminalFailed:"Unable to open the {{kind}} terminal.",deleteAgentFailed:"Unable to delete the {{kind}} agent.",missingSnapshot:"The agent to wake was not found.",resumeSnapshotFailed:"Unable to wake the agent. Try again later.",deleteSnapshotFailed:"Unable to delete the agent. Try again later.",missingSessionToConnect:"The AgentKit session to connect is missing.",connectCodexFailed:"Unable to connect to the Codex agent. Try again later.",sessionNotReady:"The AgentKit session is not ready. Current status: {{status}}.",invalidMessage:"The built-in agent session does not contain a valid message.",interruptFailed:"Unable to stop the current task.",getStatusFailed:"Unable to load Codex status.",getEndpointFailed:"Unable to load the Sandbox endpoint.",invalidEndpoint:"Sandbox returned an invalid endpoint.",createHandoffPairingFailed:"Unable to create a Codex cloud handoff pairing code.",invalidHandoffPairing:"Studio returned an invalid Codex cloud handoff pairing code.",getHandoffStatusFailed:"Unable to load the cloud handoff status.",invalidHandoffStatus:"Studio returned an invalid cloud handoff status.",listModelsFailed:"Unable to load Codex models.",invalidModelList:"Sandbox returned an invalid model list.",setModelFailed:"Unable to switch the Codex model.",invalidModel:"Sandbox returned an invalid model.",listSkillsFailed:"Unable to load Codex Skills.",invalidSkillList:"Sandbox returned an invalid Skill list.",listThreadsFailed:"Unable to load Codex threads.",invalidThreadList:"Sandbox returned an invalid thread list.",createThreadFailed:"Unable to create a new Codex thread.",missingThread:"The Codex thread to read is missing.",readThreadFailed:"Unable to load Codex history.",resumeThreadFailed:"Unable to resume the Codex thread.",forkThreadFailed:"Unable to fork the Codex thread.",archiveThreadFailed:"Unable to archive the Codex thread.",invalidArchiveResult:"Sandbox returned an invalid archive result.",deleteThreadFailed:"Unable to delete the Codex thread.",invalidDeleteResult:"Sandbox returned an invalid deletion result.",compactThreadFailed:"Unable to compact the Codex thread.",getSettingsFailed:"Unable to load Codex permissions and workspace settings.",updatePermissionsFailed:"Unable to update Codex permissions.",updateWorkspaceFailed:"Unable to update the Codex workspace.",invalidWorkingDirectory:"Sandbox returned an invalid working directory.",listDirectoriesFailed:"Unable to load Sandbox directories.",invalidDirectoryList:"Sandbox returned an invalid directory list.",resolveApprovalFailed:"Unable to submit the Codex approval decision.",uploadFileFailed:"Unable to upload the file to Sandbox.",invalidUploadResult:"Sandbox returned an invalid upload result.",disconnectCodexFailed:"Unable to disconnect the Codex agent.",deleteCodexFailed:"Unable to delete the Codex agent.",openSandboxTerminalFailed:"Unable to open the Sandbox terminal.",openSandboxBrowserFailed:"Unable to open the Sandbox browser.",toolLabel:"Sandbox tool",invalidToolUrl:"{{label}} returned an invalid URL.",unsafeToolUrl:"{{label}} returned an unsafe URL."},Xue={invalidSandboxVersion:"Invalid sandbox version response",loadSandboxVersionsFailed:"Failed to check sandbox versions",updateSandboxFailed:"Failed to update sandbox",invalidSandboxUpdate:"Invalid sandbox update response",errorWithDetailAndRawResponse:`{{context}} {{detail}} Response details: {{response}}`,errorWithRawResponse:`{{context}} @@ -17,21 +17,21 @@ Response details: {{detail}}`,mpaRuntimeSessionsLoadFailed:"Failed to load MPA Runtime sessions",mpaDeletePreviewFailed:"Failed to load MPA delete preview",loadMpaDiagnosticsFailed:"Failed to load MPA Runtime diagnostics",mpaExecutionConfigFailed:"Failed to update the MPA session configuration",deploymentDisconnected:"Deployment failed: connection interrupted",deploymentMissingAgentName:"Deployment failed: Agent name missing from response",deploymentMissingConnection:"Deployment failed: AgentKit connection information missing from response",cancelDeploymentFailed:"Failed to cancel deployment ({{status}})",loadFailed:"Failed to load ({{status}})",loadPermissionsFailed:"Failed to load permissions ({{status}})",invalidPermissionResponse:"The permission service returned an unreadable response",checkStudioUpdateFailed:"Failed to check for Studio updates ({{status}})",studioUpdatePreflightFailed:"Studio update permission check failed ({{status}})",submitStudioUpdateFailed:"Failed to submit the Studio update ({{status}})",loadAgentUsageFailed:"Failed to load Agent usage",notProvided:"Not provided",agentUsageNonJson:"Failed to load Agent usage: the server returned a non-JSON response (HTTP {{status}}, Content-Type: {{contentType}}). ",checkStudioGateway:"Confirm that the current service is running in Studio mode and check the proxy or gateway configuration.",agentUsageInvalidJson:"Failed to load Agent usage: the server returned invalid JSON (HTTP {{status}}, Content-Type: {{contentType}}). ",retryCheckGateway:"Try again later. If the problem persists, check the proxy or gateway configuration.",loadCronJobsFailed:"Failed to load scheduled tasks",loadCronJobFailed:"Failed to load scheduled task details",createCronJobFailed:"Failed to create the scheduled task",updateCronJobFailed:"Failed to update the scheduled task",enableCronJobFailed:"Failed to enable the scheduled task",pauseCronJobFailed:"Failed to pause the scheduled task",runCronJobFailed:"Failed to run the scheduled task now",loadCronHistoryFailed:"Failed to load execution history",stopCronRunFailed:"Failed to stop the execution",deleteCronJobFailed:"Failed to delete the scheduled task",loadRuntimeFailed:"Failed to load the Runtime",loadLocalToolsFailed:"Failed to load local tools",connectDynamicRouteFailed:"Failed to connect the Studio dynamic route",a2aProbeDenied:"The Runtime rejected the A2A probe. Check the Runtime authentication configuration.",loadA2aCardFailed:"Failed to load the A2A Agent Card",loadRuntimeApiKeyFailed:"Failed to load the Runtime API key",runtimeApiKeyMissing:"The Runtime did not return a usable API key",loadMcpCredentialsFailed:"Failed to load MCP authentication",invalidMcpCredentials:"Studio returned invalid MCP authentication data",deleteFailed:"Delete failed ({{status}})",runtimeManageForbidden:"This account cannot manage the Runtime.",runtimeNotFound:"The Runtime does not exist or has been deleted.",runtimeUnavailable:"This account cannot access the Runtime.",checkRuntimeUpdateFailed:"Failed to check Runtime update capability (HTTP {{status}}). Try again later.",loadRuntimeDetailFailed:"Failed to load Runtime details",generateProjectFailed:"Failed to generate the project",generateAgentConfigFailed:"Failed to generate the Agent configuration",createDebugRunFailed:"Failed to create the debug run",createDebugSessionFailed:"Failed to create the debug session",loadDebugTraceFailed:"Failed to load the debug trace",invalidDebugTrace:"Failed to load the debug trace: invalid response format",debugRunFailed:"Debug run failed",cleanupDebugRunFailed:"Failed to clean up the debug run",errorWithCloudResponse:`{{context}} Cloud API: {{action}} Original cloud response: -{{response}}`,emptyCloudResponse:"(empty response body)"},Xue={loadFailed:"Failed to load conversation mode capabilities (HTTP {{status}})",invalidResponse:"The conversation mode capabilities response has an invalid format"},Yue={nonJson:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}, {{contentType}}){{detail}}"},Zue={busy:"The workspace is busy. Try again shortly",notFound:"Workspace not found",duplicates:"Multiple personal workspace sessions were found. Contact your administrator",timeout:"Workspace recovery timed out. Your projects are retained. Try again",unavailable:"The workspace cannot be restored right now. Your projects are retained. Try again",persistence:"Persistence is not enabled for this Sandbox. Check the workspace configuration",startup:"Workspace startup failed. Check the Sandbox status",exists:"This project already exists. Open it from the project list",directory:"Project directory not found",configuration:"Configure the workspace Sandbox image first",state:"Could not check workspace status. Try again",list:"Could not restore the workspace or load projects. Try again",create:"Project initialization failed. Check that the image is available and try again",open:"Could not restore the workspace or open the project. Try again",connection:"Could not connect to the workspace. Try again",invalidWorkspaceUrl:"The workspace returned an invalid URL",operation:"Project operation failed. Try again",invalidProjectUrl:"The project URL is invalid",listFallback:"Could not load projects",connectionState:"Could not connect to the workspace. Try again"},Jue={reporting:"Completing delivery details",packaging:"Preparing artifacts",savingVersion:"Saving version",finishing:"Finishing request",submitResult:"Submit build result",requestFailed:"Task request failed. Please retry.",invalidResponse:"Invalid task state response.",eventGap:"Restoring missing task output.",reconnecting:"Reconnecting. Existing output is preserved.",input:{pending:"Queued",sending:"Confirming delivery",delivered:"Delivered",withdrawn:"Not sent"},plan:"Execution plan",diff:"File changes",preparing:"Preparing task",preparingEnvironment:"Preparing development environment…",connectingEnvironment:"Connecting to development environment…",processing:"Processing request",thinking:"Thinking",read:"Read file · {{target}}",listFiles:"List directory · {{target}}",search:"Search · {{target}}",command:"Run command · {{target}}",editFiles:"Edit files · {{target}}",webSearch:"Search web · {{target}}",processSummary:"Processed {{count}} items",duration:"{{seconds}}s",durationUnits:{milliseconds:"{{value}} ms",hours:"{{value}} h",minutes:"{{value}} min",seconds:"{{value}} s"},failedTools:"{{count}} tools failed",toolFailed:"Failed",toolCalls:"{{count}} tool calls",turnDuration:"Turn elapsed {{duration}}",toolDuration:"Tool time {{duration}}",toolDurationPartial:"Recorded tool time {{duration}}",toolDurationHelp:"Sum of tool durations. Parallel calls can exceed turn elapsed time.",turnStatus:{completed:"Completed",failed:"Failed",interrupted:"Interrupted",cancelled:"Interrupted",unavailable:"Task ended"},notReported:"Not reported",partial:"Recorded",partialHelp:"Usage for this turn may be incomplete.",tokenDetails:"Turn token usage",model:"Turn model",totalTokens:"Total",inputTokens:"Input",cachedInputTokens:"Cached input",uncachedInputTokens:"Uncached input",cacheWriteInputTokens:"Cache write",outputTokens:"Output",reasoningOutputTokens:"Reasoning output",cacheHitRate:"Input cache hit rate",tokenHelp:"Cached input and reasoning output are subsets of input and output. Uncached input = input − cached input."},ede={common:jue,agentkitCli:Nue,cloudRegion:Rue,connections:Iue,feishuBot:Pue,requestError:Due,runSse:Mue,runtimeLogs:Lue,search:$ue,skills:Fue,sse:Bue,identity:Uue,github:Que,video:zue,websiteIntegration:Vue,knowledge:Hue,intelligentDevelopment:que,migrations:Wue,sandbox:Kue,client:Gue,newChatCapabilities:Xue,jsonResponse:Yue,workspaceProjects:Zue,developmentRuns:Jue},Qze=Object.freeze(Object.defineProperty({__proto__:null,agentkitCli:Nue,client:Gue,cloudRegion:Rue,common:jue,connections:Iue,default:ede,developmentRuns:Jue,feishuBot:Pue,github:Que,identity:Uue,intelligentDevelopment:que,jsonResponse:Yue,knowledge:Hue,migrations:Wue,newChatCapabilities:Xue,requestError:Due,runSse:Mue,runtimeLogs:Lue,sandbox:Kue,search:$ue,skills:Fue,sse:Bue,video:zue,websiteIntegration:Vue,workspaceProjects:Zue},Symbol.toStringTag,{value:"Module"})),tde="Agent reviews",nde="Request access for everyone in your organization",ide="Close",rde="Refresh",sde="Status",ade="Applicant",ode="Submitted",lde="Current version",cde="Model",ude="Returned by",dde="Approved by",fde="Reviewed",hde="Agent description",pde="Application notes",mde="Return reason",gde="Review comment",bde="Return reason (required)",yde="Content changed after submission; return and submit again",vde="Withdraw to edit this Agent, then submit a new request to publish it",xde="Other users will lose access to this Agent. Unpublish it?",wde="Cancel",Ode="Confirm",kde="Saving",Sde="Unpublish",Ede="Withdraw request",Cde="Approve",Ade="Publish for everyone",Tde="Request publication",_de="Everyone",jde={pending:"Pending",approved:"Approved",returned:"Returned",withdrawn:"Withdrawn"},Nde="Search agents or applicants",Rde="Region",Ide="All statuses",Pde="Agent",Dde="Actions",Mde="Review application",Lde="Application details",$de="No matching applications",Fde="No Agent review requests",Bde="{{count}} / {{limit}} characters",zze={title:tde,dialogDescription:nde,close:ide,refresh:rde,statusTitle:sde,submitter:ade,submittedAt:ode,version:lde,model:cde,returnedBy:ude,approvedBy:dde,reviewedAt:fde,description:hde,message:pde,reason:mde,comment:gde,reasonRequired:bde,contentChanged:yde,withdrawConfirm:vde,unpublishConfirm:xde,cancel:wde,confirm:Ode,saving:kde,unpublish:Sde,withdraw:Ede,return:"Return",approve:Cde,publish:Ade,submit:Tde,private:"Private",enterprise:_de,status:jde,search:Nde,region:Rde,all:Ide,agent:Pde,actions:Dde,review:Mde,details:Lde,noMatches:$de,empty:Fde,textCount:Bde},Vze=Object.freeze(Object.defineProperty({__proto__:null,actions:Dde,agent:Pde,all:Ide,approve:Cde,approvedBy:dde,cancel:wde,close:ide,comment:gde,confirm:Ode,contentChanged:yde,default:zze,description:hde,details:Lde,dialogDescription:nde,empty:Fde,enterprise:_de,message:pde,model:cde,noMatches:$de,publish:Ade,reason:mde,reasonRequired:bde,refresh:rde,region:Rde,returnedBy:ude,review:Mde,reviewedAt:fde,saving:kde,search:Nde,status:jde,statusTitle:sde,submit:Tde,submittedAt:ode,submitter:ade,textCount:Bde,title:tde,unpublish:Sde,unpublishConfirm:xde,version:lde,withdraw:Ede,withdrawConfirm:vde},Symbol.toStringTag,{value:"Module"})),Ude={backToEvaluationCase:"Back to evaluation case",cancel:"Cancel",copied:"Copied",copy:"Copy",exportConversation:"Export conversation",retry:"Retry"},Qde={title:"How would you like to add an Agent?",subtitle:"Choose the approach that best fits your project.",quickCreate:{title:"Create from scratch",description:"Build an Agent with intelligent, custom, template, or workflow modes."},intelligent:{title:"Intelligent mode",description:"Describe your goal, then build, debug, and validate the Agent interactively."},package:{title:"Add and deploy a code package",description:"Upload an Agent project archive, review the code, and deploy it to AgentKit Runtime."},migrate:{title:"Migrate an existing project",description:"Migrate an existing LangChain, Dify, or similar project to AgentKit Runtime."}},zde={subject:{file:"file changes",command:"command execution"},decision:{accept:"Allowed {{subject}} once",acceptForSession:"Allowed {{subject}} for this session",decline:"Declined {{subject}}",cancel:"Cancelled approval for {{subject}}"},details:{command:"Command",grantRoot:"Authorized path",cwd:"Working directory"}},Vde={noDescription:"No description",region:"Region",unknownAgent:"Unknown Agent"},Hde={agentTransfer:"Agent handoff",annotationHint:"Model response; select text to add an annotation",continueBranch:"Continue with “{{branch}}”",emptyResponse:"This response has no displayable content.",subagentDescription:"Working on a task handed off by the primary Agent."},qde={title:"Configure {{provider}} credentials",prefix:"Agent Workspace requires {{provider}} credentials. Set",and:"and",suffix:"in the runtime environment, then retry."},Wde={buildRunning:{title:"A build is still running",description:"Leaving will stop this build. The session will remain available in your history.",confirm:"Stop and leave"},deleteThread:{title:"Delete Codex session",description:"Delete “{{name}}” and remove it from your session history?",confirm:"Delete"},returnToCreate:{title:"Return to the create page?",description:"Your current entries will be lost.",confirm:"Return"}},Kde={additionalAgentDeleteFailures:"; {{count}} more failed",agentDeleteFailures:"Failed to delete {{count}} Agents: {{failures}}{{suffix}}",agentToolsMissing:"This Agent is missing required tools: {{tools}}",buildStopUnconfirmed:"You left the development environment, but Studio could not confirm that the build stopped. It may still be running; check its status in session history later.",builtinAgentSendFailed:"Failed to send to the built-in Agent: {{message}}",bytePlusEvaluationUnsupported:"AgentKit evaluation sets are not currently supported on BytePlus",clipboardUnsupported:"This browser does not support writing to the clipboard.",cloudCodexEmptyReply:"The cloud Codex task ended without a response. Send the task again.",cloudCodexSessionMissing:"The cloud Codex session has not appeared in the list yet. Try again shortly.",deploymentRuntimeIdMissing:"Deployment completed without returning a Runtime ID.",environmentExpired:"The selected environment is no longer available. Refresh and select it again.",environmentsLoadFailed:"Failed to load environments",evaluationCaseSessionMissing:"This evaluation case has no session reference and cannot be opened.",evaluationUnsupportedForReply:"This response cannot be added to an evaluation set",firstFrameRequired:"Add a first-frame image before generating from first and last frames.",incompletePromptOptimization:"The prompt optimization result is incomplete. Run the optimization again.",intelligentCapabilityCheckFailed:"Failed to check intelligent development capabilities (HTTP {{status}})",intelligentSessionCreateFailed:"Failed to create the intelligent development session",invalidIntelligentCapability:"The intelligent development capability response is invalid.",localBffToolsNotConfigured:"No tools are configured for the local Studio BFF.",localToolsLoadFailed:"Failed to load local tools",loginPopupBlocked:"The browser blocked the sign-in window. Allow pop-ups and try again.",loginPopupClosed:"The sign-in window was closed. Sign in again to continue.",mediaTooLarge:"{{fileName}} exceeds this platform's media size limit.",mountEnvironmentFailed:"Failed to mount the environment",noConnectedSandbox:"No Sandbox is currently connected.",noCreateAgentPermission:"Your account does not have permission to add Agents.",noManageAgentPermission:"Your account does not have permission to manage Agents.",noOptimizationBaseline:"There is no pre-optimization version available for comparison.",oauthUrlMissing:"The event does not include an authorization URL.",onlyCloudAgentUpdatable:"Only deployed cloud Agents can be updated.",optimizationVersionMissing:"The project version for this optimization could not be found. It may have been deleted.",persistentStorageNotConfigured:"Persistent storage has not been configured by an administrator",readDraftFailed:"Unable to read local drafts. Try again.",runtimeAgentNameMissing:"The Runtime is missing an Agent name and cannot be updated.",runtimeBffToolsDisabled:"BFF tool capabilities are not enabled for this Runtime Agent.",runtimeDeploymentConfigUnavailable:"The Runtime's original deployment configuration cannot be restored, so it cannot be updated safely.",runtimeMissingForConnection:"Runtime information is missing, so the Agent cannot be connected.",runtimeRegionMissingForDelete:"The Runtime is missing region information and cannot be deleted.",runtimeRegionMissingForUpdate:"The Runtime is missing region information and cannot be updated.",runtimeUpdateUnsupported:"This Runtime does not support in-place updates.",sandboxRuntimeUnavailable:"This Agent does not have an available Sandbox Runtime.",sandboxToolsUnavailable:"The current Studio BFF does not provide Sandbox execution tools.",saveDraftLocationRejected:"The browser could not save the current draft location. Check site storage permissions and try again.",saveDraftRejected:"The browser could not save the draft. Try again.",selectSkillToOptimize:"Select a Skill to optimize first.",sessionMissingForMount:"The current session does not exist, so an environment cannot be mounted.",sessionNotReady:"The session is not ready yet.",sessionUnavailable:"The current session is unavailable. Close it and try again.",sourceNotReady:"The source is not ready yet. Return to the conversation to continue.",textVideoRejectsReferences:"Text-to-video does not use reference media. Remove the images or videos first.",videoEditRequiresVideo:"Add the video you want to edit first.",videoExtendRequiresVideo:"Add a source video before extending it.",videoGenerationFailed:"Video generation failed. Try again later.",videoModeUnsupported:"The selected video mode is not supported on this platform.",videoPreviewMissing:"The video task completed, but the server did not return a preview URL.",videoReferenceRequired:"Add at least one reference image or video."},Gde={like:"Like",removeLike:"Remove like",dislike:"Dislike",removeDislike:"Remove dislike",reportIssue:"Report an issue",traceFlameGraph:"Tracing flame graph"},Xde={0:"What would you like to work on today?",1:"How can I help?",2:"What would you like me to look into?",3:"Ask me anything",4:"Hi, let's get started",5:"Start a new conversation",6:"What should we tackle first?",7:"Tell me what you have in mind",8:"Where should we begin?",9:"What can I help you with?",10:"Ready to move this forward?",11:"What's most important right now?",12:"Let's get something done today",13:"I'm ready when you are",intelligentDevelopment:"Give your ideas room to grow"},Yde={agentCapabilities:"Checking Agent capabilities…",session:"Loading session…"},Zde={cancelled:"Authorization was cancelled.",pasteCallbackUrl:"After authorization, paste the full callback URL from your browser's address bar:",popupBlocked:"The browser blocked the authorization window. Allow pop-ups and try again.",unsupportedUrl:"The authorization URL is not HTTP or HTTPS and was blocked."},Jde={volcengine:"Volcengine"},efe={checkingPersistence:"Checking persistent storage…",exitDevelopment:"Exit development",fileUploaded:"Uploaded a file to the Sandbox",filesUploaded:"Uploaded {{count}} files to the Sandbox",intelligentDevelopment:"Intelligent development",mode:{readOnly:"Read only",workspaceWrite:"Workspace write",fullAccess:"Full access"},approvalPolicy:{untrusted:"Untrusted commands only",onRequest:"Ask when needed",never:"Never ask"},reviewer:{user:"Ask me",autoReview:"Automatic review"},labels:{approvalPolicy:"Approval policy",file:"File",fileNumber:"File {{number}}",mode:"Sandbox mode",networkAccess:"Network access",reviewer:"Approval method",workingDirectory:"Working directory"},network:{allowed:"Allowed",disabled:"Off"},permissionsUpdated:"Updated Codex permissions for this Sandbox session",persistenceUnknown:"Unable to verify persistent storage",stoppedReady:"Stopped. You can continue typing.",uploadedFilesPrompt:"The following files were uploaded to the current Sandbox workspace. Use them in this task:",workspaceUpdated:"Workspace updated"},tfe={addAgent:"Add Agent",addFromPackage:"Add from code package",agent:"Agent",automations:"Automations",createAgent:"Create Agent",createSkill:"Create Skill",cronJobs:"Cronjob",issueFeedback:"Issue feedback",library:"Library",migrateAgent:"Migrate Agent",newConversation:"New conversation",optimizeSkill:"Optimize {{name}}",search:"Search",skill:"Skill",skillLibrary:"Skill library",systemInfo:"System information",updateAgent:"Update {{name}}",codeProjects:"Code projects",reviewCenter:"Review center"},nfe={title:"Create from workspace",description:"Create and manage code projects, then develop and debug in VS Code"},ife={actions:Ude,addAgent:Qde,approval:zde,common:Vde,conversation:Hde,credentials:qde,dialogs:Wde,errors:Kde,feedback:Gde,greetings:Xde,loading:Yde,oauth:Zde,providers:Jde,sandbox:efe,titles:tfe,workspaceProjectEntry:nfe},Hze=Object.freeze(Object.defineProperty({__proto__:null,actions:Ude,addAgent:Qde,approval:zde,common:Vde,conversation:Hde,credentials:qde,default:ife,dialogs:Wde,errors:Kde,feedback:Gde,greetings:Xde,loading:Yde,oauth:Zde,providers:Jde,sandbox:efe,titles:tfe,workspaceProjectEntry:nfe},Symbol.toStringTag,{value:"Module"})),rfe="Automations",sfe="Connect development tools and extend your Agents with automated workflows",afe="Search automations",ofe="Automation categories",lfe={development:"Development",channels:"Messaging channels"},cfe="{{category}} automations",ufe="Open {{name}}",dfe="Available only in local deployments",ffe="No matching automations",hfe="Try searching for another name",pfe="Back to automations",mfe={"coding-agents":{name:"Configure coding agents",badge:"Local",description:"Install built-in VeADK and AgentKit skills globally for Trae, Claude Code, or Codex."},template:{name:"Import starter project",description:"Create a minimal Agent project in your repository with continuous delivery to AgentKit Runtime.",title:"Import starter project",subtitle:"Add a ready-to-run basic Agent and continuous delivery configuration to your repository",panel:"This creates a pull request containing the basic project and AgentKit Runtime delivery workflow.",submitLabel:"Import template and create PR",regionHelp:"Must match the target Runtime region",pullRequest:{title:"feat: import AgentKit basic template",description:"Import a basic Agent project with the AgentKit Studio App Server and add continuous delivery to AgentKit Runtime. Configure the required {{provider}} secrets before merging."},fields:{repository:{label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL"},baseBranch:{label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base"},projectPath:{label:"Agent project directory",placeholder:"agentkit-basic-agent",help:"The basic project will be added here; app.py mounts the complete Studio App Server and serves as the entry point"},runtimeName:{label:"Runtime name",placeholder:"support-agent",help:"Used by the AgentKit delivery configuration"},runtimeId:{label:"Runtime ID",placeholder:"rt-xxxxxxxx",help:"The AgentKit Runtime that will receive continuous updates"}}},delivery:{name:"AgentKit Runtime delivery",description:"Add a workflow that continuously delivers your repository to AgentKit Runtime.",title:"AgentKit Runtime delivery",subtitle:"Add continuous delivery to the repository through a pull request",panel:"This creates a release branch and opens a pull request containing the GitHub Actions workflow.",submitLabel:"Confirm and create PR",regionHelp:"Must match the target Runtime region",pullRequest:{title:"feat: continuously publish to AgentKit Runtime",description:"Add a GitHub Actions workflow that continuously publishes updates from the target branch to AgentKit Runtime. Configure the required {{provider}} secrets before merging."},fields:{repository:{label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL"},baseBranch:{label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base"},projectPath:{label:"Agent project directory",placeholder:".",help:"Defaults to the repository root; the directory must contain an app.py that mounts the complete Studio App Server"},runtimeName:{label:"Runtime name",placeholder:"support-agent",help:"Used by the AgentKit delivery configuration"},runtimeId:{label:"Runtime ID",placeholder:"rt-xxxxxxxx",help:"The AgentKit Runtime that will receive continuous updates"}}},review:{name:"Automated PR review",description:"Use a GitHub App to review pull requests in an isolated Sandbox.",title:"Automated PR review",subtitle:"Trigger Sandbox reviews through the GitHub App and publish results to pull requests",panel:"Install the GitHub App to target repositories, then enable automated review for each repository.",submitLabel:"Install GitHub App",regionHelp:"",pullRequest:{title:"chore: configure automated PR review",description:"Add a GitHub Actions workflow that reviews same-repository pull requests in an isolated Sandbox and publishes the result as a GitHub review. Configure the required workflow secrets before merging."},fields:{repository:{label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL"},baseBranch:{label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base"},sandboxToolId:{label:"Sandbox Tool ID",placeholder:"tool-xxxxxxxx",help:"The AgentKit CodeEnv used for each review"},modelName:{label:"Review model",placeholder:"review-model",help:"The code review model name injected into the Sandbox"},modelBaseUrl:{label:"Model API URL",placeholder:"https://ark.example.com/api/v3",help:"Must be an OpenAI-compatible HTTPS endpoint"}}},"gitlab-review":{name:"GitLab MR review",description:"Use a GitLab integration to review merge requests in an isolated Sandbox."},feishu:{name:"Feishu bot",badge:"Beta",description:"Create a Feishu bot and connect its messages directly to AgentKit Runtime."},"mpa-channels":{name:"MPA agent messaging channels",description:"Connect an existing MPA agent to Feishu, WeCom and DingTalk."},"website-integration":{name:"Website integration",description:"Embed an AgentKit Runtime on your website as a floating chat window."}},gfe={required:"Required",optional:"Optional",region:"Region",tokenLabel:"GitHub Token",getToken:"Get token",createToken:"Create GitHub token",tokenPlaceholder:"Requires write access to repository contents and pull requests",tokenWorkflowPlaceholder:"Requires write access to contents, pull requests, and workflows",hideToken:"Hide token",showToken:"Show token",tokenHelp:"The token is used only for this submission. It is not stored in the browser or written to the pull request.",tokenWorkflowHelp:"This token is used only to create the configuration PR. It is not a general Sandbox requirement and is not stored in the browser or written to the PR.",prCreated:"PR #{{number}} created",configPrCreated:"Configuration PR #{{number}} created",configPrNextStep:"After it is merged, later pull requests in the same repository will trigger reviews automatically.",viewOnGitHub:"View on GitHub",viewConfigPr:"View configuration PR",secretsHeading:"Before merging the pull request, configure these GitHub Actions secrets in the repository:",secretsConfigHeading:"Before merging the configuration PR, add runtime secrets to the target repository",openSecrets:"Open Secrets settings",secretsPath:"Path: Settings → Secrets and variables → Actions → Repository secrets",repositoryConfigHelp:"A PR review configuration will be added for {{repository}}",repositoryReviewHelp:"GitHub App will validate pull requests for {{repository}}",secretPair:"{{accessKey}}, {{secretKey}} (required)",sessionToken:"{{sessionToken}} (required when using temporary credentials)",requiredSecret:"{{name}} (required)",temporaryCredentialRequired:" (required when using temporary credentials)",requiredSuffix:" (required)",submitting:"Creating PR…",validation:{required:"This field is required",repository:"Enter owner/repository or a full GitHub repository URL",baseBranch:"The target branch format is invalid",projectPath:"Enter a relative path within the repository",runtimeId:"The Runtime ID format is invalid",sandboxToolId:"The Sandbox Tool ID format is invalid",modelName:"The model name format is invalid",modelBaseUrlSafe:"Enter an HTTPS URL without credentials, query parameters, or fragments",modelBaseUrl:"Enter a valid HTTPS URL",runtimeName:{required:"Runtime name is required",characters:"Runtime name can contain only letters, numbers, underscores, and hyphens",length:"Runtime name must be 4–64 characters"}}},bfe={title:"Configure coding agents",description:"Install the AgentKit skills bundled with Studio globally for local coding clients.",retry:"Retry",clients:{ariaLabel:"Select coding agents",title:"Local clients",detectAgain:"Detect again",detecting:"Detecting local clients…",detected:"Client detected",available:"Available",unavailable:"Not detected"},skills:{ariaLabel:"Select bundled skills",title:"Bundled skills",viewFiles:"View files",items:{"veadk-agent-development":{name:"VeADK Agent development",description:"Build and refine Agents with VeADK."},"agentkit-cli":{name:"AgentKit CLI",description:"Manage and deploy AgentKit resources with AgentKit CLI."}}},global:{ariaLabel:"Global installation directories",title:"Global installation",description:"Available to other local projects after configuration",empty:"Select a client to see its installation directory."},success:"Configured {{skillCount}} skill(s) for {{agentCount}} client(s)",selection:"{{agentCount}} client(s) and {{skillCount}} skill(s) selected",selectClient:"Select a client first",configuring:"Configuring…",configure:"Configure",errors:{detect:"Failed to detect local clients",configure:"Configuration failed. Check permissions for your user directory and try again."},preview:{description:"Browse the skill files bundled with Studio in read-only mode",close:"Close file preview",loading:"Loading files…",error:"Failed to load skill files",skillFiles:"{{name}} files",files:"Files",fileContent:"File contents",notPreviewable:"This file is not previewable UTF-8 text.",noFiles:"No previewable files."}},yfe={noDescription:"No description",unknownCreator:"Unknown creator",optionMetadata:"{{creator}} | {{createdAt}}",selectAgent:"Select an MPA agent",chooseAgent:"Choose an MPA agent",search:"Search by name, Runtime ID or region",noMatches:"No matching MPA agents",loading:"Loading MPA agents…",empty:"No manageable MPA agents. Create or deploy an MPA agent first.",unauthorized:"Studio administrator access is required to manage MPA messaging channels. Contact an administrator.",loadFailed:"Could not load MPA agents. Please retry.",retry:"Retry",refresh:"Refresh list",loadMore:"Load more",moreAvailable:"More agents are available. Search matches loaded results; load more to continue.",chooseHint:"Select an MPA agent to configure Feishu, WeCom and DingTalk."},vfe={title:"Feishu bot",description:"Create a Feishu Agent powered by AgentKit Runtime",panel:"Enter the credentials for a published Feishu app. Studio will generate a basic Agent, create a dedicated Runtime, and enable the persistent Feishu messaging connection.",agentName:"Agent name",agentNameHelp:"Used as the root Agent name in the new Runtime",region:"Deployment region",regionHelp:"The Runtime and build artifacts will be created in this region",regions:{"cn-beijing":"Beijing","cn-shanghai":"Shanghai"},appId:"Feishu App ID",appIdHelp:"Application credential from the Feishu Open Platform",appSecret:"Feishu App Secret",appSecretPlaceholder:"Enter the App Secret",appSecretHelp:"Written only to the environment variables of the new Runtime",hideSecret:"Hide App Secret",showSecret:"Show App Secret",hide:"Hide",show:"Show",confirmCancel:"Cancelling will stop the task and clean up any Runtime already created. Continue?",status:{preparing:"Generating the basic Agent",running:"Creating Runtime",cancelling:"Cancelling deployment",succeeded:"Feishu bot Runtime created",cancelled:"Deployment cancelled",failed:"Creation failed"},steps:{prepare:"Generate Agent",build:"Build image",deploy:"Create Runtime",publish:"Publish service"},openConsole:"Open Runtime console",credentials:{title:"Credential handling",description:"The App Secret is used only for this deployment. It is never written to generated source code or browser storage."},cancelDeployment:"Cancel deployment",creating:"Creating…",create:"Create Feishu bot Runtime",validation:{appId:"Enter the Feishu App ID",appSecret:"Enter the Feishu App Secret",agentName:{required:"Name is required",reserved:"user is reserved by Google ADK. Choose another name",characters:"Name must start with a letter or underscore and contain only letters, numbers, and underscores"}},generatedAgent:{description:"A helpful assistant that receives messages through Feishu.",instruction:"You are a helpful assistant serving users through Feishu. Understand each request accurately and provide concise, reliable answers. Ask clarifying questions when information is missing, and never invent facts."}},xfe={title:rfe,description:sfe,search:afe,categoriesLabel:ofe,categories:lfe,resultsLabel:cfe,open:ufe,localOnly:dfe,emptyTitle:ffe,emptyDescription:hfe,backToAutomations:pfe,cards:mfe,github:gfe,codingAgents:bfe,mpaChannels:yfe,feishu:vfe},qze=Object.freeze(Object.defineProperty({__proto__:null,backToAutomations:pfe,cards:mfe,categories:lfe,categoriesLabel:ofe,codingAgents:bfe,default:xfe,description:sfe,emptyDescription:hfe,emptyTitle:ffe,feishu:vfe,github:gfe,localOnly:dfe,mpaChannels:yfe,open:ufe,resultsLabel:cfe,search:afe,title:rfe},Symbol.toStringTag,{value:"Module"})),wfe={"zh-CN":"简体中文","en-US":"English"},Wze={languageNames:wfe},Kze=Object.freeze(Object.defineProperty({__proto__:null,default:Wze,languageNames:wfe},Symbol.toStringTag,{value:"Module"})),Ofe={selectedExcerptLabel:"Selected excerpt",commentLabel:"Annotation",commentSeparator:": ",successTitle:"Added to the Bad Case evaluation set",successDescription:"This annotation is linked to the current question and the complete model response.",done:"Done",ariaLabel:"Annotate the selected model response",title:"Add annotation",content:"Annotation",placeholder:"Describe the issue or the expected change",retryError:"{{error}}. Please try again.",cancel:"Cancel",submit:"Add to Bad Case"},kfe={attachment:"attachment",image:"image",preview:"Preview {{name}}",uploading:"Uploading",uploadFailed:"Upload failed",remove:"Remove {{name}}",previewDialog:"{{name}} preview",download:"Download",close:"Close",reading:"Loading document…",loadFailed:"Failed to load document: {{error}}"},Sfe={errorTitle:"Cloud log error",copyError:"Copy complete error details",retry:"Retry",statuses:{live:"Live",connecting:"Connecting",retrying:"Reconnecting",idle:"Disconnected"},title:"Instance logs",description:"The VeFaaS instance handling the current conversation request",close:"Close instance logs",instanceId:"Instance ID",waitingInstance:"Waiting for instance",request:"Request {{id}}",ariaLabel:"Live VeFaaS instance logs",notCapturedTitle:"No instance captured yet",notCapturedDescription:"Send a message to see the instance that handles it and its live logs.",connectingTitle:"Connecting to instance logs",connectingDescription:"Establishing a secure log stream through the Studio BFF.",emptyTitle:"No logs yet",emptyDescription:"Connected to the instance and waiting for new log output.",download:"Download logs",retention:"Logs refresh automatically. Only the latest {{count}} lines are kept."},Efe={title:"Trace",statuses:{loading:"Loading",ready:"",collecting:"Collecting",disabled:"Disabled",forbidden:"Permission required",error:"Failed to load"},errors:{collecting:"The trace is still being collected. Please wait.",disabled:"Tracing is not enabled for this agent. Enable it in the console and try again.",forbidden:"Your account cannot read APMPlus traces. Ask an administrator for read access.",error:"Failed to load the trace. Please try again later."},callCount:"{{count}} calls · {{duration}} ms",close:"Close",loading:"Loading trace…",retryNow:"Retry now",reload:"Reload",empty:"No trace is available for this session yet.",attributes:"Attributes",selectCall:"Select a call on the left to view its details"},Cfe={exportNote:"This conversation was exported from AgentKit Studio for reference only.",imageFailed:"Failed to generate the image. Please try again.",browserUnsupported:"This browser cannot generate a conversation image. Please try again.",copyUnsupported:"This browser cannot copy images. Download the image instead.",exportFailed:"Export failed. Please try again.",title:"Export conversation",description:"Choose a format and download all inputs and outputs through the current response.",close:"Close",generatingContent:"Preparing export…",retry:"Try again",previewPage:"Previewing page 1 of {{count}}",previewAlt:"Conversation export page 1 of {{count}}",format:"Export format",generatingFormat:"Generating {{format}}…",copying:"Copying…",copiedFirst:"First page copied",copied:"Copied",copyFirst:"Copy first page",copyImage:"Copy image",generating:"Generating…",downloadArchive:"Download PNG archive ({{count}} pages)",downloadFormat:"Download {{format}}"},Afe={a2a:{connecting:"Waiting for Runtime response…",submitted:"Task queued…",working:"Task running…"},unsupportedComponent:"Unsupported component: {{component}}",sandboxIdentity:"Codex Sandbox execution identifiers",useSkill:"Use the {{name}} skill",thinkingDone:"Finished working thought",thinking:"Working thought",reasoningDone:"Finished model reasoning",reasoning:"Model reasoning",justNow:"Just now",sourceUnavailable:"The generated source is temporarily unavailable. Please try again later.",downloadStarted:"Download started",verifiedDelivery:"Verified deliverable",generatedSource:"Generated agent source",entryPoint:"Entry point",fileCount:"Files",size:"Size",validationTime:"Validated",generationTime:"Generated",checksPassed:"{{count}} checks passed",sourceReady:"Source is ready to deploy",sourceGuidance:"The source is ready to view, download, or deploy. Confirm the runtime configuration before deployment.",viewSource:"View source",preparing:"Preparing…",viewChanges:"View changes",downloadSource:"Download source",sourceNotReady:"The source is not ready yet",manualDeploy:"Deploy manually to Runtime",deployAgent:"Deploy Agent",beforeOptimization:"Before optimization",afterOptimization:"After optimization",planStatuses:{pending:"Pending",in_progress:"In progress",completed:"Completed",failed:"Incomplete"},renderUi:"Render UI",truncated:"… (truncated)",agentAdjusting:"Agent is adjusting",sandboxDetails:"Detailed Codex Sandbox output",waitingCodex:"Waiting for Codex output",arguments:"Arguments",result:"Result",artifacts:"Artifacts",downloadNamed:"Download {{name}}",powerpoint:"PowerPoint presentation",preview:"Preview",download:"Download",previewDialog:"{{name}} preview",closePreview:"Close preview",slidePreview:"{{name}} slide preview",mcpToolset:"MCP toolset",authorized:"Authorized · {{tool}}",authorizationRequired:"{{tool}} requires authorization",oauthDescription:"The {{tool}} toolset is protected by OAuth and requires sign-in before use.",oauthProvider:"You will be redirected to {{provider}} to sign in.",oauthContinue:"The conversation will continue automatically after authorization.",waitingAuthorization:"Waiting for authorization…",authorize:"Authorize",missingAuthorizationUrl:"No authorization URL was found in the event.",tools:{web_search:{running:"Searching the web",done:"Web search complete"},link_reader:{running:"Reading webpage",done:"Webpage read complete"},run_code:{running:"Running code in the AgentKit sandbox",done:"Code execution completed in the AgentKit sandbox"},list_envs:{running:"Checking available environments",done:"Available environments loaded"},get_env_manifest:{running:"Loading the environment manifest",done:"Environment manifest loaded"},execute_in_sandbox:{running:"Running a command in the environment",done:"Command completed in the environment"},delegate_to_codex_sandbox:{running:"Codex Sandbox is running",done:"Codex Sandbox completed",failed:"Codex Sandbox failed"},image_generate:{running:"Generating image",done:"Image generated"},video_generate:{running:"Generating video",done:"Video generated"},ppt_generate:{running:"Generating presentation",done:"Presentation generated"},load_memory:{running:"Searching long-term memory",done:"Memory search complete"},load_knowledgebase:{running:"Searching the knowledge base",done:"Knowledge base search complete"},load_skill:{running:"Loading skill",done:"Skill loaded"},collect_resources:{running:"Collecting available resources",done:"Resource collection complete",failed:"Resource collection failed"},create_agents:{running:"Creating and running agents",done:"Agent creation complete",failed:"Agent creation failed"}},createAgents:{categories:{skill_hub:"Skill Hub",skill_space:"AgentKit Skill Center",knowledge_base:"Knowledge base",tool:"Tools"},agentTypes:{llm:"LLM Agent",sequential:"Sequential Agent",parallel:"Parallel Agent",loop:"Loop Agent",workflow:"Workflow"},skill:"Skill",subAgents:"Sub-agents",builtinTool:"Built-in tool",skillCenter:"AgentKit Skill Center",selfAuthoredTools:"Custom tools",dependencies:"Dependencies: {{items}}",fullCode:"Complete code for {{name}}",itemCount:"{{label}}: {{count}} items",collectionAria:"Retrieved resource information",retrieving:"Retrieving resources",retrievalFailed:"Resource retrieval did not complete",checkConfig:"Check the resource service configuration and try again.",notSearched:"Not searched",notConfigured:"Not configured",resourceList:"{{label}} resource list",searchKeywords:"Search keywords",skillHubSkipped:"No search keywords were provided, so Skill Hub was not searched.",sourceSkipped:"{{label}} is not configured, so this source was not searched.",noResources:"No resources in this category were returned.",resultAria:"Agent creation results",creationFailed:"Agent creation did not complete",agentResources:"Resources available to {{name}}",knowledgeBase:"Knowledge base",toolsLabel:"Tools",creating:"Creating agents",noAgents:"No agents to display",noAgentResult:"The tool response did not include an agent configuration or execution result.",sourceLabels:{tool:"Tools",knowledge:"AgentKit Knowledge Base",skillCenter:"AgentKit Skill Center",unknown:"Unknown source"},unnamedResource:"Unnamed resource",unnamedAgent:"Unnamed agent"},branchCompare:{ariaLabel:"Compare branches",selectDirection:"Select a direction",continue:"Continue in this direction"},codexProgress:{planTitle:"Codex execution plan",fallback:{fileChange:"Modify files",approval:"Waiting for approval",status:"Codex status",command:"Run command"},planSummary:"{{completed}}/{{total}} completed",command:{running:"Running command",completed:"Command completed",failed:"Command failed"},projectFiles:"{{count}} project files",projectFile:"project files",fileChange:{running:"Updating {{subject}}",completed:"Updated {{subject}}",failed:"Failed to update {{subject}}"},externalTool:"external tool",mcp:{running:"Calling {{tool}}",completed:"Called {{tool}}",failed:"{{tool}} call did not complete"},collaboration:{spawn_agent:{running:"Starting subtask",completed:"Subtask started",failed:"Failed to start subtask"},send_input:{running:"Sending information to subtask",completed:"Information sent to subtask",failed:"Failed to send information to subtask"},wait:{running:"Waiting for subtask",completed:"Subtask wait complete",failed:"Subtask wait failed"},close_agent:{running:"Ending subtask",completed:"Subtask ended",failed:"Failed to end subtask"},default:{running:"Coordinating subtasks",completed:"Subtask collaboration complete",failed:"Subtask collaboration failed"}},webSearch:{running:"Searching the web",completed:"Web search complete",failed:"Web search did not complete"},errorDetail:"Codex execution did not complete.",errorTitle:"Codex encountered an error"},toolActivity:{status:{queued:"Queued",running:"Running",completed:"Completed",failed:"Failed"},goal:{queued:"Waiting to create goal",running:"Creating goal",completed:"Created goal",failed:"Failed to create goal"},command:{queued:"Waiting to run command",running:"Running command",completed:"Ran command",failed:"Command failed"},read:{queued:"Waiting to read",running:"Reading",completed:"Read content",failed:"Read failed"},search:{queued:"Waiting to search",running:"Searching",completed:"Search complete",failed:"Search failed"},"file-change":{queued:"Waiting to change files",running:"Changing files",completed:"Changed files",failed:"File change failed"},mcp:{queued:"Waiting to call external tool",running:"Calling external tool",completed:"Called external tool",failed:"External tool call failed"},authorization:{queued:"Waiting for authorization",running:"Waiting for authorization",completed:"Authorization complete",failed:"Authorization failed"},generic:{queued:"Waiting to call tool",running:"Calling tool",completed:"Called tool",failed:"Tool call failed",named:{queued:"Waiting to call {{tool}}",running:"Calling {{tool}}",completed:"Called {{tool}}",failed:"{{tool}} call failed"}},exitCode:"exit {{code}}",omittedLines:"… {{count}} lines omitted …",omittedCharacters:"… {{count}} characters omitted …",rawData:"View raw data",callId:"Call ID",copyCallId:"Copy call ID",copy:"Copy",copied:"Copied",copyFailed:"Copy failed. Try again.",explored_one:"Explored 1 item",explored_other:"Explored {{count}} items"}},Tfe={segments:{system:"System and tools",input:"Input and history",output:"Output and reasoning",remaining:"Remaining"},modelUnavailable:"Model information unavailable",promptWithSystem:"Prompt (including system)",systemUnknown:"System and tool usage unknown",systemApprox:"System and tools approximately {{count}} tokens",ariaKnown:"Context {{percentage}}% used, {{system}}, {{inputLabel}} {{input}} tokens, output and reasoning {{output}} tokens, remaining {{remaining}} tokens",ariaUnknown:"{{model}}, context window unknown, {{count}} cumulative session tokens used",composition:"Context composition",percentageUsed:"{{percentage}}% used",gridAria:"100-cell context composition chart. Each cell represents one percent of the context window.",estimated:"Estimated",unknown:"Unknown",summaryPercentage:"{{used}} used, {{remaining}} remaining",summaryTokens:"{{used}} used, {{remaining}} remaining, {{total}} total",overflow:"Context exceeded by {{count}} tokens",title:"Context usage",category:"Category",currentTurn:"Current Turn",sessionTotal:"Session total",details:{input:"Input",output:"Output",reasoning:"Reasoning",cache:"Cache hit",total:"Total"},unknownModel:"The context window for this model is not available",unknownRuntime:"The current runtime did not provide model information"},_fe={title:"Add AgentKit agent",noAgents:"Connected successfully, but no agents were found at this address (/list-apps was empty).",connectionFailed:"Connection failed: {{error}}. Check the URL, API key, and whether the gateway allows cross-origin requests.",description:"Enter the URL and API key of an AgentKit deployment to connect through the ADK protocol. Connected agents will appear in the selector in the upper-left corner.",url:"Endpoint URL",apiKeyHint:"Connect using Authorization: Bearer",displayName:"Display name (optional)",displayNameHint:"Uses the URL hostname by default",cancel:"Cancel",connecting:"Connecting…",connect:"Connect and add"},jfe={placeholder:"Type a message…",inputAria:"Message",generating:"Generating",send:"Send",model:"Model"},Nfe={ariaLabel:"Invocation context for this turn",removeSkill:"Remove skill {{name}}",removeAgent:"Remove agent {{name}}"},Rfe={cardAria:"{{label}} chart",viewAria:"{{label}} display mode",preview:"Preview",code:"Code",invalidEcharts:"The ECharts configuration is not a valid, safe data object. Switch to Code to inspect it.",renderFailed:"The chart cannot be rendered right now. Switch to Code to inspect it.",echartsAria:"ECharts preview",rendering:"Rendering chart…",mermaidFailed:"The chart cannot be rendered right now. Switch to Code to inspect the Mermaid source.",mermaidAria:"Mermaid preview"},Ife={downloadFile:"Download file",downloading:"Downloading…",downloadFailed:"Download failed. Check that the Sandbox and file are still available, then click to retry.",playVideo:"Play video: {{name}}",enlargeImage:"Enlarge image preview: {{name}}",image:"image",enlargeVideo:"Enlarge video",videoPreview:"Video preview",downloadVideo:"Download video",close:"Close"},Pfe={annotation:Ofe,media:kfe,runtimeLogs:Sfe,trace:Efe,share:Cfe,blocks:Afe,tokenUsage:Tfe,addAgentKit:_fe,composer:jfe,invocation:Nfe,visualization:Rfe,markdown:Ife},Gze=Object.freeze(Object.defineProperty({__proto__:null,addAgentKit:_fe,annotation:Ofe,blocks:Afe,composer:jfe,default:Pfe,invocation:Nfe,markdown:Ife,media:kfe,runtimeLogs:Sfe,share:Cfe,tokenUsage:Tfe,trace:Efe,visualization:Rfe},Symbol.toStringTag,{value:"Module"})),Dfe={back:"Back",cancel:"Cancel",deploy:"Deploy",delete:"Delete",loading:"Loading…",next:"Next",notSupported:"Not supported",previous:"Previous",required:"Required",retry:"Retry",actions:"Actions",value:"Value",disabled:"Off",enabled:"Enabled",none:"None",close:"Close",name:"Name",description:"Description",send:"Send"},Mfe={heading:"VeADK agent structure configuration",importHint:"Reload this file from Import YAML on the Create Agent page."},Lfe={agentName:{required:"Name is required",reserved:"user is reserved by Google ADK. Choose another name.",characters:"Start with a letter or underscore and use only letters, numbers, and underscores"},runtimeName:{required:"Runtime name is required",characters:"Runtime name can contain only letters, numbers, underscores, and hyphens",length:"Runtime name must be 4–64 characters"}},$fe={description:"A VeADK-powered assistant that understands user intent and uses the right tools to complete tasks.",instruction:`You are a professional and reliable assistant. +{{response}}`,emptyCloudResponse:"(empty response body)"},Yue={loadFailed:"Failed to load conversation mode capabilities (HTTP {{status}})",invalidResponse:"The conversation mode capabilities response has an invalid format"},Zue={nonJson:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}, {{contentType}}){{detail}}"},Jue={busy:"The workspace is busy. Try again shortly",notFound:"Workspace not found",duplicates:"Multiple personal workspace sessions were found. Contact your administrator",timeout:"Workspace recovery timed out. Your projects are retained. Try again",unavailable:"The workspace cannot be restored right now. Your projects are retained. Try again",persistence:"Persistence is not enabled for this Sandbox. Check the workspace configuration",startup:"Workspace startup failed. Check the Sandbox status",exists:"This project already exists. Open it from the project list",directory:"Project directory not found",configuration:"Configure the workspace Sandbox image first",state:"Could not check workspace status. Try again",list:"Could not restore the workspace or load projects. Try again",create:"Project initialization failed. Check that the image is available and try again",open:"Could not restore the workspace or open the project. Try again",connection:"Could not connect to the workspace. Try again",invalidWorkspaceUrl:"The workspace returned an invalid URL",operation:"Project operation failed. Try again",invalidProjectUrl:"The project URL is invalid",listFallback:"Could not load projects",connectionState:"Could not connect to the workspace. Try again"},ede={reporting:"Completing delivery details",packaging:"Preparing artifacts",savingVersion:"Saving version",finishing:"Finishing request",submitResult:"Submit build result",requestFailed:"Task request failed. Please retry.",invalidResponse:"Invalid task state response.",eventGap:"Restoring missing task output.",reconnecting:"Reconnecting. Existing output is preserved.",input:{pending:"Queued",sending:"Confirming delivery",delivered:"Delivered",withdrawn:"Not sent"},plan:"Execution plan",diff:"File changes",preparing:"Preparing task",preparingEnvironment:"Preparing development environment…",connectingEnvironment:"Connecting to development environment…",processing:"Processing request",thinking:"Thinking",read:"Read file · {{target}}",listFiles:"List directory · {{target}}",search:"Search · {{target}}",command:"Run command · {{target}}",editFiles:"Edit files · {{target}}",webSearch:"Search web · {{target}}",processSummary:"Processed {{count}} items",duration:"{{seconds}}s",durationUnits:{milliseconds:"{{value}} ms",hours:"{{value}} h",minutes:"{{value}} min",seconds:"{{value}} s"},failedTools:"{{count}} tools failed",toolFailed:"Failed",toolCalls:"{{count}} tool calls",turnDuration:"Turn elapsed {{duration}}",toolDuration:"Tool time {{duration}}",toolDurationPartial:"Recorded tool time {{duration}}",toolDurationHelp:"Sum of tool durations. Parallel calls can exceed turn elapsed time.",turnStatus:{completed:"Completed",failed:"Failed",interrupted:"Interrupted",cancelled:"Interrupted",unavailable:"Task ended"},notReported:"Not reported",partial:"Recorded",partialHelp:"Usage for this turn may be incomplete.",tokenDetails:"Turn token usage",model:"Turn model",totalTokens:"Total",inputTokens:"Input",cachedInputTokens:"Cached input",uncachedInputTokens:"Uncached input",cacheWriteInputTokens:"Cache write",outputTokens:"Output",reasoningOutputTokens:"Reasoning output",cacheHitRate:"Input cache hit rate",tokenHelp:"Cached input and reasoning output are subsets of input and output. Uncached input = input − cached input."},tde={common:Nue,agentkitCli:Rue,cloudRegion:Iue,connections:Pue,feishuBot:Due,requestError:Mue,runSse:Lue,runtimeLogs:$ue,search:Fue,skills:Bue,sse:Uue,identity:Que,github:zue,video:Vue,websiteIntegration:Hue,knowledge:que,intelligentDevelopment:Wue,migrations:Kue,sandbox:Gue,client:Xue,newChatCapabilities:Yue,jsonResponse:Zue,workspaceProjects:Jue,developmentRuns:ede},Vze=Object.freeze(Object.defineProperty({__proto__:null,agentkitCli:Rue,client:Xue,cloudRegion:Iue,common:Nue,connections:Pue,default:tde,developmentRuns:ede,feishuBot:Due,github:zue,identity:Que,intelligentDevelopment:Wue,jsonResponse:Zue,knowledge:que,migrations:Kue,newChatCapabilities:Yue,requestError:Mue,runSse:Lue,runtimeLogs:$ue,sandbox:Gue,search:Fue,skills:Bue,sse:Uue,video:Vue,websiteIntegration:Hue,workspaceProjects:Jue},Symbol.toStringTag,{value:"Module"})),nde="Agent reviews",ide="Request access for everyone in your organization",rde="Close",sde="Refresh",ade="Status",ode="Applicant",lde="Submitted",cde="Current version",ude="Model",dde="Returned by",fde="Approved by",hde="Reviewed",pde="Agent description",mde="Application notes",gde="Return reason",bde="Review comment",yde="Return reason (required)",vde="Content changed after submission; return and submit again",xde="Withdraw to edit this Agent, then submit a new request to publish it",wde="Other users will lose access to this Agent. Unpublish it?",Ode="Cancel",kde="Confirm",Sde="Saving",Ede="Unpublish",Cde="Withdraw request",Ade="Approve",Tde="Publish for everyone",_de="Request publication",jde="Everyone",Nde={pending:"Pending",approved:"Approved",returned:"Returned",withdrawn:"Withdrawn"},Rde="Search agents or applicants",Ide="Region",Pde="All statuses",Dde="Agent",Mde="Actions",Lde="Review application",$de="Application details",Fde="No matching applications",Bde="No Agent review requests",Ude="{{count}} / {{limit}} characters",Hze={title:nde,dialogDescription:ide,close:rde,refresh:sde,statusTitle:ade,submitter:ode,submittedAt:lde,version:cde,model:ude,returnedBy:dde,approvedBy:fde,reviewedAt:hde,description:pde,message:mde,reason:gde,comment:bde,reasonRequired:yde,contentChanged:vde,withdrawConfirm:xde,unpublishConfirm:wde,cancel:Ode,confirm:kde,saving:Sde,unpublish:Ede,withdraw:Cde,return:"Return",approve:Ade,publish:Tde,submit:_de,private:"Private",enterprise:jde,status:Nde,search:Rde,region:Ide,all:Pde,agent:Dde,actions:Mde,review:Lde,details:$de,noMatches:Fde,empty:Bde,textCount:Ude},qze=Object.freeze(Object.defineProperty({__proto__:null,actions:Mde,agent:Dde,all:Pde,approve:Ade,approvedBy:fde,cancel:Ode,close:rde,comment:bde,confirm:kde,contentChanged:vde,default:Hze,description:pde,details:$de,dialogDescription:ide,empty:Bde,enterprise:jde,message:mde,model:ude,noMatches:Fde,publish:Tde,reason:gde,reasonRequired:yde,refresh:sde,region:Ide,returnedBy:dde,review:Lde,reviewedAt:hde,saving:Sde,search:Rde,status:Nde,statusTitle:ade,submit:_de,submittedAt:lde,submitter:ode,textCount:Ude,title:nde,unpublish:Ede,unpublishConfirm:wde,version:cde,withdraw:Cde,withdrawConfirm:xde},Symbol.toStringTag,{value:"Module"})),Qde={backToEvaluationCase:"Back to evaluation case",cancel:"Cancel",copied:"Copied",copy:"Copy",exportConversation:"Export conversation",retry:"Retry"},zde={title:"How would you like to add an Agent?",subtitle:"Choose the approach that best fits your project.",quickCreate:{title:"Create from scratch",description:"Build an Agent with intelligent, custom, template, or workflow modes."},intelligent:{title:"Intelligent mode",description:"Describe your goal, then build, debug, and validate the Agent interactively."},package:{title:"Add and deploy a code package",description:"Upload an Agent project archive, review the code, and deploy it to AgentKit Runtime."},migrate:{title:"Migrate an existing project",description:"Migrate an existing LangChain, Dify, or similar project to AgentKit Runtime."}},Vde={subject:{file:"file changes",command:"command execution"},decision:{accept:"Allowed {{subject}} once",acceptForSession:"Allowed {{subject}} for this session",decline:"Declined {{subject}}",cancel:"Cancelled approval for {{subject}}"},details:{command:"Command",grantRoot:"Authorized path",cwd:"Working directory"}},Hde={noDescription:"No description",region:"Region",unknownAgent:"Unknown Agent"},qde={agentTransfer:"Agent handoff",annotationHint:"Model response; select text to add an annotation",continueBranch:"Continue with “{{branch}}”",emptyResponse:"This response has no displayable content.",subagentDescription:"Working on a task handed off by the primary Agent."},Wde={title:"Configure {{provider}} credentials",prefix:"Agent Workspace requires {{provider}} credentials. Set",and:"and",suffix:"in the runtime environment, then retry."},Kde={buildRunning:{title:"A build is still running",description:"Leaving will stop this build. The session will remain available in your history.",confirm:"Stop and leave"},deleteThread:{title:"Delete Codex session",description:"Delete “{{name}}” and remove it from your session history?",confirm:"Delete"},returnToCreate:{title:"Return to the create page?",description:"Your current entries will be lost.",confirm:"Return"}},Gde={additionalAgentDeleteFailures:"; {{count}} more failed",agentDeleteFailures:"Failed to delete {{count}} Agents: {{failures}}{{suffix}}",agentToolsMissing:"This Agent is missing required tools: {{tools}}",buildStopUnconfirmed:"You left the development environment, but Studio could not confirm that the build stopped. It may still be running; check its status in session history later.",builtinAgentSendFailed:"Failed to send to the built-in Agent: {{message}}",bytePlusEvaluationUnsupported:"AgentKit evaluation sets are not currently supported on BytePlus",clipboardUnsupported:"This browser does not support writing to the clipboard.",cloudCodexEmptyReply:"The cloud Codex task ended without a response. Send the task again.",cloudCodexSessionMissing:"The cloud Codex session has not appeared in the list yet. Try again shortly.",deploymentRuntimeIdMissing:"Deployment completed without returning a Runtime ID.",environmentExpired:"The selected environment is no longer available. Refresh and select it again.",environmentsLoadFailed:"Failed to load environments",evaluationCaseSessionMissing:"This evaluation case has no session reference and cannot be opened.",evaluationUnsupportedForReply:"This response cannot be added to an evaluation set",firstFrameRequired:"Add a first-frame image before generating from first and last frames.",incompletePromptOptimization:"The prompt optimization result is incomplete. Run the optimization again.",intelligentCapabilityCheckFailed:"Failed to check intelligent development capabilities (HTTP {{status}})",intelligentSessionCreateFailed:"Failed to create the intelligent development session",invalidIntelligentCapability:"The intelligent development capability response is invalid.",localBffToolsNotConfigured:"No tools are configured for the local Studio BFF.",localToolsLoadFailed:"Failed to load local tools",loginPopupBlocked:"The browser blocked the sign-in window. Allow pop-ups and try again.",loginPopupClosed:"The sign-in window was closed. Sign in again to continue.",mediaTooLarge:"{{fileName}} exceeds this platform's media size limit.",mountEnvironmentFailed:"Failed to mount the environment",noConnectedSandbox:"No Sandbox is currently connected.",noCreateAgentPermission:"Your account does not have permission to add Agents.",noManageAgentPermission:"Your account does not have permission to manage Agents.",noOptimizationBaseline:"There is no pre-optimization version available for comparison.",oauthUrlMissing:"The event does not include an authorization URL.",onlyCloudAgentUpdatable:"Only deployed cloud Agents can be updated.",optimizationVersionMissing:"The project version for this optimization could not be found. It may have been deleted.",persistentStorageNotConfigured:"Persistent storage has not been configured by an administrator",readDraftFailed:"Unable to read local drafts. Try again.",runtimeAgentNameMissing:"The Runtime is missing an Agent name and cannot be updated.",runtimeBffToolsDisabled:"BFF tool capabilities are not enabled for this Runtime Agent.",runtimeDeploymentConfigUnavailable:"The Runtime's original deployment configuration cannot be restored, so it cannot be updated safely.",runtimeMissingForConnection:"Runtime information is missing, so the Agent cannot be connected.",runtimeRegionMissingForDelete:"The Runtime is missing region information and cannot be deleted.",runtimeRegionMissingForUpdate:"The Runtime is missing region information and cannot be updated.",runtimeUpdateUnsupported:"This Runtime does not support in-place updates.",sandboxRuntimeUnavailable:"This Agent does not have an available Sandbox Runtime.",sandboxToolsUnavailable:"The current Studio BFF does not provide Sandbox execution tools.",saveDraftLocationRejected:"The browser could not save the current draft location. Check site storage permissions and try again.",saveDraftRejected:"The browser could not save the draft. Try again.",selectSkillToOptimize:"Select a Skill to optimize first.",sessionMissingForMount:"The current session does not exist, so an environment cannot be mounted.",sessionNotReady:"The session is not ready yet.",sessionUnavailable:"The current session is unavailable. Close it and try again.",sourceNotReady:"The source is not ready yet. Return to the conversation to continue.",textVideoRejectsReferences:"Text-to-video does not use reference media. Remove the images or videos first.",videoEditRequiresVideo:"Add the video you want to edit first.",videoExtendRequiresVideo:"Add a source video before extending it.",videoGenerationFailed:"Video generation failed. Try again later.",videoModeUnsupported:"The selected video mode is not supported on this platform.",videoPreviewMissing:"The video task completed, but the server did not return a preview URL.",videoReferenceRequired:"Add at least one reference image or video."},Xde={like:"Like",removeLike:"Remove like",dislike:"Dislike",removeDislike:"Remove dislike",reportIssue:"Report an issue",traceFlameGraph:"Tracing flame graph"},Yde={0:"What would you like to work on today?",1:"How can I help?",2:"What would you like me to look into?",3:"Ask me anything",4:"Hi, let's get started",5:"Start a new conversation",6:"What should we tackle first?",7:"Tell me what you have in mind",8:"Where should we begin?",9:"What can I help you with?",10:"Ready to move this forward?",11:"What's most important right now?",12:"Let's get something done today",13:"I'm ready when you are",intelligentDevelopment:"Give your ideas room to grow"},Zde={agentCapabilities:"Checking Agent capabilities…",session:"Loading session…"},Jde={cancelled:"Authorization was cancelled.",pasteCallbackUrl:"After authorization, paste the full callback URL from your browser's address bar:",popupBlocked:"The browser blocked the authorization window. Allow pop-ups and try again.",unsupportedUrl:"The authorization URL is not HTTP or HTTPS and was blocked."},efe={volcengine:"Volcengine"},tfe={checkingPersistence:"Checking persistent storage…",exitDevelopment:"Exit development",fileUploaded:"Uploaded a file to the Sandbox",filesUploaded:"Uploaded {{count}} files to the Sandbox",intelligentDevelopment:"Intelligent development",mode:{readOnly:"Read only",workspaceWrite:"Workspace write",fullAccess:"Full access"},approvalPolicy:{untrusted:"Untrusted commands only",onRequest:"Ask when needed",never:"Never ask"},reviewer:{user:"Ask me",autoReview:"Automatic review"},labels:{approvalPolicy:"Approval policy",file:"File",fileNumber:"File {{number}}",mode:"Sandbox mode",networkAccess:"Network access",reviewer:"Approval method",workingDirectory:"Working directory"},network:{allowed:"Allowed",disabled:"Off"},permissionsUpdated:"Updated Codex permissions for this Sandbox session",persistenceUnknown:"Unable to verify persistent storage",stoppedReady:"Stopped. You can continue typing.",uploadedFilesPrompt:"The following files were uploaded to the current Sandbox workspace. Use them in this task:",workspaceUpdated:"Workspace updated"},nfe={addAgent:"Add Agent",addFromPackage:"Add from code package",agent:"Agent",automations:"Automations",createAgent:"Create Agent",createSkill:"Create Skill",cronJobs:"Cronjob",issueFeedback:"Issue feedback",library:"Library",migrateAgent:"Migrate Agent",newConversation:"New conversation",optimizeSkill:"Optimize {{name}}",search:"Search",skill:"Skill",skillLibrary:"Skill library",systemInfo:"System information",updateAgent:"Update {{name}}",codeProjects:"Code projects",reviewCenter:"Review center"},ife={title:"Create from workspace",description:"Create and manage code projects, then develop and debug in VS Code"},rfe={actions:Qde,addAgent:zde,approval:Vde,common:Hde,conversation:qde,credentials:Wde,dialogs:Kde,errors:Gde,feedback:Xde,greetings:Yde,loading:Zde,oauth:Jde,providers:efe,sandbox:tfe,titles:nfe,workspaceProjectEntry:ife},Wze=Object.freeze(Object.defineProperty({__proto__:null,actions:Qde,addAgent:zde,approval:Vde,common:Hde,conversation:qde,credentials:Wde,default:rfe,dialogs:Kde,errors:Gde,feedback:Xde,greetings:Yde,loading:Zde,oauth:Jde,providers:efe,sandbox:tfe,titles:nfe,workspaceProjectEntry:ife},Symbol.toStringTag,{value:"Module"})),sfe="Automations",afe="Connect development tools and extend your Agents with automated workflows",ofe="Search automations",lfe="Automation categories",cfe={development:"Development",channels:"Messaging channels"},ufe="{{category}} automations",dfe="Open {{name}}",ffe="Available only in local deployments",hfe="No matching automations",pfe="Try searching for another name",mfe="Back to automations",gfe={"coding-agents":{name:"Configure coding agents",badge:"Local",description:"Install built-in VeADK and AgentKit skills globally for Trae, Claude Code, or Codex."},template:{name:"Import starter project",description:"Create a minimal Agent project in your repository with continuous delivery to AgentKit Runtime.",title:"Import starter project",subtitle:"Add a ready-to-run basic Agent and continuous delivery configuration to your repository",panel:"This creates a pull request containing the basic project and AgentKit Runtime delivery workflow.",submitLabel:"Import template and create PR",regionHelp:"Must match the target Runtime region",pullRequest:{title:"feat: import AgentKit basic template",description:"Import a basic Agent project with the AgentKit Studio App Server and add continuous delivery to AgentKit Runtime. Configure the required {{provider}} secrets before merging."},fields:{repository:{label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL"},baseBranch:{label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base"},projectPath:{label:"Agent project directory",placeholder:"agentkit-basic-agent",help:"The basic project will be added here; app.py mounts the complete Studio App Server and serves as the entry point"},runtimeName:{label:"Runtime name",placeholder:"support-agent",help:"Used by the AgentKit delivery configuration"},runtimeId:{label:"Runtime ID",placeholder:"rt-xxxxxxxx",help:"The AgentKit Runtime that will receive continuous updates"}}},delivery:{name:"AgentKit Runtime delivery",description:"Add a workflow that continuously delivers your repository to AgentKit Runtime.",title:"AgentKit Runtime delivery",subtitle:"Add continuous delivery to the repository through a pull request",panel:"This creates a release branch and opens a pull request containing the GitHub Actions workflow.",submitLabel:"Confirm and create PR",regionHelp:"Must match the target Runtime region",pullRequest:{title:"feat: continuously publish to AgentKit Runtime",description:"Add a GitHub Actions workflow that continuously publishes updates from the target branch to AgentKit Runtime. Configure the required {{provider}} secrets before merging."},fields:{repository:{label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL"},baseBranch:{label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base"},projectPath:{label:"Agent project directory",placeholder:".",help:"Defaults to the repository root; the directory must contain an app.py that mounts the complete Studio App Server"},runtimeName:{label:"Runtime name",placeholder:"support-agent",help:"Used by the AgentKit delivery configuration"},runtimeId:{label:"Runtime ID",placeholder:"rt-xxxxxxxx",help:"The AgentKit Runtime that will receive continuous updates"}}},review:{name:"Automated PR review",description:"Use a GitHub App to review pull requests in an isolated Sandbox.",title:"Automated PR review",subtitle:"Trigger Sandbox reviews through the GitHub App and publish results to pull requests",panel:"Install the GitHub App to target repositories, then enable automated review for each repository.",submitLabel:"Install GitHub App",regionHelp:"",pullRequest:{title:"chore: configure automated PR review",description:"Add a GitHub Actions workflow that reviews same-repository pull requests in an isolated Sandbox and publishes the result as a GitHub review. Configure the required workflow secrets before merging."},fields:{repository:{label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL"},baseBranch:{label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base"},sandboxToolId:{label:"Sandbox Tool ID",placeholder:"tool-xxxxxxxx",help:"The AgentKit CodeEnv used for each review"},modelName:{label:"Review model",placeholder:"review-model",help:"The code review model name injected into the Sandbox"},modelBaseUrl:{label:"Model API URL",placeholder:"https://ark.example.com/api/v3",help:"Must be an OpenAI-compatible HTTPS endpoint"}}},"gitlab-review":{name:"GitLab MR review",description:"Use a GitLab integration to review merge requests in an isolated Sandbox."},feishu:{name:"Feishu bot",badge:"Beta",description:"Create a Feishu bot and connect its messages directly to AgentKit Runtime."},"mpa-channels":{name:"MPA agent messaging channels",description:"Connect an existing MPA agent to Feishu, WeCom and DingTalk."},"website-integration":{name:"Website integration",description:"Embed an AgentKit Runtime on your website as a floating chat window."}},bfe={required:"Required",optional:"Optional",region:"Region",tokenLabel:"GitHub Token",getToken:"Get token",createToken:"Create GitHub token",tokenPlaceholder:"Requires write access to repository contents and pull requests",tokenWorkflowPlaceholder:"Requires write access to contents, pull requests, and workflows",hideToken:"Hide token",showToken:"Show token",tokenHelp:"The token is used only for this submission. It is not stored in the browser or written to the pull request.",tokenWorkflowHelp:"This token is used only to create the configuration PR. It is not a general Sandbox requirement and is not stored in the browser or written to the PR.",prCreated:"PR #{{number}} created",configPrCreated:"Configuration PR #{{number}} created",configPrNextStep:"After it is merged, later pull requests in the same repository will trigger reviews automatically.",viewOnGitHub:"View on GitHub",viewConfigPr:"View configuration PR",secretsHeading:"Before merging the pull request, configure these GitHub Actions secrets in the repository:",secretsConfigHeading:"Before merging the configuration PR, add runtime secrets to the target repository",openSecrets:"Open Secrets settings",secretsPath:"Path: Settings → Secrets and variables → Actions → Repository secrets",repositoryConfigHelp:"A PR review configuration will be added for {{repository}}",repositoryReviewHelp:"GitHub App will validate pull requests for {{repository}}",secretPair:"{{accessKey}}, {{secretKey}} (required)",sessionToken:"{{sessionToken}} (required when using temporary credentials)",requiredSecret:"{{name}} (required)",temporaryCredentialRequired:" (required when using temporary credentials)",requiredSuffix:" (required)",submitting:"Creating PR…",validation:{required:"This field is required",repository:"Enter owner/repository or a full GitHub repository URL",baseBranch:"The target branch format is invalid",projectPath:"Enter a relative path within the repository",runtimeId:"The Runtime ID format is invalid",sandboxToolId:"The Sandbox Tool ID format is invalid",modelName:"The model name format is invalid",modelBaseUrlSafe:"Enter an HTTPS URL without credentials, query parameters, or fragments",modelBaseUrl:"Enter a valid HTTPS URL",runtimeName:{required:"Runtime name is required",characters:"Runtime name can contain only letters, numbers, underscores, and hyphens",length:"Runtime name must be 4–64 characters"}}},yfe={title:"Configure coding agents",description:"Install the AgentKit skills bundled with Studio globally for local coding clients.",retry:"Retry",clients:{ariaLabel:"Select coding agents",title:"Local clients",detectAgain:"Detect again",detecting:"Detecting local clients…",detected:"Client detected",available:"Available",unavailable:"Not detected"},skills:{ariaLabel:"Select bundled skills",title:"Bundled skills",viewFiles:"View files",items:{"veadk-agent-development":{name:"VeADK Agent development",description:"Build and refine Agents with VeADK."},"agentkit-cli":{name:"AgentKit CLI",description:"Manage and deploy AgentKit resources with AgentKit CLI."}}},global:{ariaLabel:"Global installation directories",title:"Global installation",description:"Available to other local projects after configuration",empty:"Select a client to see its installation directory."},success:"Configured {{skillCount}} skill(s) for {{agentCount}} client(s)",selection:"{{agentCount}} client(s) and {{skillCount}} skill(s) selected",selectClient:"Select a client first",configuring:"Configuring…",configure:"Configure",errors:{detect:"Failed to detect local clients",configure:"Configuration failed. Check permissions for your user directory and try again."},preview:{description:"Browse the skill files bundled with Studio in read-only mode",close:"Close file preview",loading:"Loading files…",error:"Failed to load skill files",skillFiles:"{{name}} files",files:"Files",fileContent:"File contents",notPreviewable:"This file is not previewable UTF-8 text.",noFiles:"No previewable files."}},vfe={noDescription:"No description",unknownCreator:"Unknown creator",optionMetadata:"{{creator}} | {{createdAt}}",selectAgent:"Select an MPA agent",chooseAgent:"Choose an MPA agent",search:"Search by name, Runtime ID or region",noMatches:"No matching MPA agents",loading:"Loading MPA agents…",empty:"No manageable MPA agents. Create or deploy an MPA agent first.",unauthorized:"Studio administrator access is required to manage MPA messaging channels. Contact an administrator.",loadFailed:"Could not load MPA agents. Please retry.",retry:"Retry",refresh:"Refresh list",loadMore:"Load more",moreAvailable:"More agents are available. Search matches loaded results; load more to continue.",chooseHint:"Select an MPA agent to configure Feishu, WeCom and DingTalk."},xfe={title:"Feishu bot",description:"Create a Feishu Agent powered by AgentKit Runtime",panel:"Enter the credentials for a published Feishu app. Studio will generate a basic Agent, create a dedicated Runtime, and enable the persistent Feishu messaging connection.",agentName:"Agent name",agentNameHelp:"Used as the root Agent name in the new Runtime",region:"Deployment region",regionHelp:"The Runtime and build artifacts will be created in this region",regions:{"cn-beijing":"Beijing","cn-shanghai":"Shanghai"},appId:"Feishu App ID",appIdHelp:"Application credential from the Feishu Open Platform",appSecret:"Feishu App Secret",appSecretPlaceholder:"Enter the App Secret",appSecretHelp:"Written only to the environment variables of the new Runtime",hideSecret:"Hide App Secret",showSecret:"Show App Secret",hide:"Hide",show:"Show",confirmCancel:"Cancelling will stop the task and clean up any Runtime already created. Continue?",status:{preparing:"Generating the basic Agent",running:"Creating Runtime",cancelling:"Cancelling deployment",succeeded:"Feishu bot Runtime created",cancelled:"Deployment cancelled",failed:"Creation failed"},steps:{prepare:"Generate Agent",build:"Build image",deploy:"Create Runtime",publish:"Publish service"},openConsole:"Open Runtime console",credentials:{title:"Credential handling",description:"The App Secret is used only for this deployment. It is never written to generated source code or browser storage."},cancelDeployment:"Cancel deployment",creating:"Creating…",create:"Create Feishu bot Runtime",validation:{appId:"Enter the Feishu App ID",appSecret:"Enter the Feishu App Secret",agentName:{required:"Name is required",reserved:"user is reserved by Google ADK. Choose another name",characters:"Name must start with a letter or underscore and contain only letters, numbers, and underscores"}},generatedAgent:{description:"A helpful assistant that receives messages through Feishu.",instruction:"You are a helpful assistant serving users through Feishu. Understand each request accurately and provide concise, reliable answers. Ask clarifying questions when information is missing, and never invent facts."}},wfe={title:sfe,description:afe,search:ofe,categoriesLabel:lfe,categories:cfe,resultsLabel:ufe,open:dfe,localOnly:ffe,emptyTitle:hfe,emptyDescription:pfe,backToAutomations:mfe,cards:gfe,github:bfe,codingAgents:yfe,mpaChannels:vfe,feishu:xfe},Kze=Object.freeze(Object.defineProperty({__proto__:null,backToAutomations:mfe,cards:gfe,categories:cfe,categoriesLabel:lfe,codingAgents:yfe,default:wfe,description:afe,emptyDescription:pfe,emptyTitle:hfe,feishu:xfe,github:bfe,localOnly:ffe,mpaChannels:vfe,open:dfe,resultsLabel:ufe,search:ofe,title:sfe},Symbol.toStringTag,{value:"Module"})),Ofe={"zh-CN":"简体中文","en-US":"English"},Gze={languageNames:Ofe},Xze=Object.freeze(Object.defineProperty({__proto__:null,default:Gze,languageNames:Ofe},Symbol.toStringTag,{value:"Module"})),kfe={selectedExcerptLabel:"Selected excerpt",commentLabel:"Annotation",commentSeparator:": ",successTitle:"Added to the Bad Case evaluation set",successDescription:"This annotation is linked to the current question and the complete model response.",done:"Done",ariaLabel:"Annotate the selected model response",title:"Add annotation",content:"Annotation",placeholder:"Describe the issue or the expected change",retryError:"{{error}}. Please try again.",cancel:"Cancel",submit:"Add to Bad Case"},Sfe={attachment:"attachment",image:"image",preview:"Preview {{name}}",uploading:"Uploading",uploadFailed:"Upload failed",remove:"Remove {{name}}",previewDialog:"{{name}} preview",download:"Download",close:"Close",reading:"Loading document…",loadFailed:"Failed to load document: {{error}}"},Efe={errorTitle:"Cloud log error",copyError:"Copy complete error details",retry:"Retry",statuses:{live:"Live",connecting:"Connecting",retrying:"Reconnecting",idle:"Disconnected"},title:"Instance logs",description:"The VeFaaS instance handling the current conversation request",close:"Close instance logs",instanceId:"Instance ID",waitingInstance:"Waiting for instance",request:"Request {{id}}",ariaLabel:"Live VeFaaS instance logs",notCapturedTitle:"No instance captured yet",notCapturedDescription:"Send a message to see the instance that handles it and its live logs.",connectingTitle:"Connecting to instance logs",connectingDescription:"Establishing a secure log stream through the Studio BFF.",emptyTitle:"No logs yet",emptyDescription:"Connected to the instance and waiting for new log output.",download:"Download logs",retention:"Logs refresh automatically. Only the latest {{count}} lines are kept."},Cfe={title:"Trace",statuses:{loading:"Loading",ready:"",collecting:"Collecting",disabled:"Disabled",forbidden:"Permission required",error:"Failed to load"},errors:{collecting:"The trace is still being collected. Please wait.",disabled:"Tracing is not enabled for this agent. Enable it in the console and try again.",forbidden:"Your account cannot read APMPlus traces. Ask an administrator for read access.",error:"Failed to load the trace. Please try again later."},callCount:"{{count}} calls · {{duration}} ms",close:"Close",loading:"Loading trace…",retryNow:"Retry now",reload:"Reload",empty:"No trace is available for this session yet.",attributes:"Attributes",selectCall:"Select a call on the left to view its details"},Afe={exportNote:"This conversation was exported from AgentKit Studio for reference only.",imageFailed:"Failed to generate the image. Please try again.",browserUnsupported:"This browser cannot generate a conversation image. Please try again.",copyUnsupported:"This browser cannot copy images. Download the image instead.",exportFailed:"Export failed. Please try again.",title:"Export conversation",description:"Choose a format and download all inputs and outputs through the current response.",close:"Close",generatingContent:"Preparing export…",retry:"Try again",previewPage:"Previewing page 1 of {{count}}",previewAlt:"Conversation export page 1 of {{count}}",format:"Export format",generatingFormat:"Generating {{format}}…",copying:"Copying…",copiedFirst:"First page copied",copied:"Copied",copyFirst:"Copy first page",copyImage:"Copy image",generating:"Generating…",downloadArchive:"Download PNG archive ({{count}} pages)",downloadFormat:"Download {{format}}"},Tfe={a2a:{connecting:"Waiting for Runtime response…",submitted:"Task queued…",working:"Task running…"},unsupportedComponent:"Unsupported component: {{component}}",sandboxIdentity:"Codex Sandbox execution identifiers",useSkill:"Use the {{name}} skill",thinkingDone:"Finished working thought",thinking:"Working thought",reasoningDone:"Finished model reasoning",reasoning:"Model reasoning",justNow:"Just now",sourceUnavailable:"The generated source is temporarily unavailable. Please try again later.",downloadStarted:"Download started",verifiedDelivery:"Verified deliverable",generatedSource:"Generated agent source",entryPoint:"Entry point",fileCount:"Files",size:"Size",validationTime:"Validated",generationTime:"Generated",checksPassed:"{{count}} checks passed",sourceReady:"Source is ready to deploy",sourceGuidance:"The source is ready to view, download, or deploy. Confirm the runtime configuration before deployment.",viewSource:"View source",preparing:"Preparing…",viewChanges:"View changes",downloadSource:"Download source",sourceNotReady:"The source is not ready yet",manualDeploy:"Deploy manually to Runtime",deployAgent:"Deploy Agent",beforeOptimization:"Before optimization",afterOptimization:"After optimization",planStatuses:{pending:"Pending",in_progress:"In progress",completed:"Completed",failed:"Incomplete"},renderUi:"Render UI",truncated:"… (truncated)",agentAdjusting:"Agent is adjusting",sandboxDetails:"Detailed Codex Sandbox output",waitingCodex:"Waiting for Codex output",arguments:"Arguments",result:"Result",artifacts:"Artifacts",downloadNamed:"Download {{name}}",powerpoint:"PowerPoint presentation",preview:"Preview",download:"Download",previewDialog:"{{name}} preview",closePreview:"Close preview",slidePreview:"{{name}} slide preview",mcpToolset:"MCP toolset",authorized:"Authorized · {{tool}}",authorizationRequired:"{{tool}} requires authorization",oauthDescription:"The {{tool}} toolset is protected by OAuth and requires sign-in before use.",oauthProvider:"You will be redirected to {{provider}} to sign in.",oauthContinue:"The conversation will continue automatically after authorization.",waitingAuthorization:"Waiting for authorization…",authorize:"Authorize",missingAuthorizationUrl:"No authorization URL was found in the event.",tools:{web_search:{running:"Searching the web",done:"Web search complete"},link_reader:{running:"Reading webpage",done:"Webpage read complete"},run_code:{running:"Running code in the AgentKit sandbox",done:"Code execution completed in the AgentKit sandbox"},list_envs:{running:"Checking available environments",done:"Available environments loaded"},get_env_manifest:{running:"Loading the environment manifest",done:"Environment manifest loaded"},execute_in_sandbox:{running:"Running a command in the environment",done:"Command completed in the environment"},delegate_to_codex_sandbox:{running:"Codex Sandbox is running",done:"Codex Sandbox completed",failed:"Codex Sandbox failed"},image_generate:{running:"Generating image",done:"Image generated"},video_generate:{running:"Generating video",done:"Video generated"},ppt_generate:{running:"Generating presentation",done:"Presentation generated"},load_memory:{running:"Searching long-term memory",done:"Memory search complete"},load_knowledgebase:{running:"Searching the knowledge base",done:"Knowledge base search complete"},load_skill:{running:"Loading skill",done:"Skill loaded"},collect_resources:{running:"Collecting available resources",done:"Resource collection complete",failed:"Resource collection failed"},create_agents:{running:"Creating and running agents",done:"Agent creation complete",failed:"Agent creation failed"}},createAgents:{categories:{skill_hub:"Skill Hub",skill_space:"AgentKit Skill Center",knowledge_base:"Knowledge base",tool:"Tools"},agentTypes:{llm:"LLM Agent",sequential:"Sequential Agent",parallel:"Parallel Agent",loop:"Loop Agent",workflow:"Workflow"},skill:"Skill",subAgents:"Sub-agents",builtinTool:"Built-in tool",skillCenter:"AgentKit Skill Center",selfAuthoredTools:"Custom tools",dependencies:"Dependencies: {{items}}",fullCode:"Complete code for {{name}}",itemCount:"{{label}}: {{count}} items",collectionAria:"Retrieved resource information",retrieving:"Retrieving resources",retrievalFailed:"Resource retrieval did not complete",checkConfig:"Check the resource service configuration and try again.",notSearched:"Not searched",notConfigured:"Not configured",resourceList:"{{label}} resource list",searchKeywords:"Search keywords",skillHubSkipped:"No search keywords were provided, so Skill Hub was not searched.",sourceSkipped:"{{label}} is not configured, so this source was not searched.",noResources:"No resources in this category were returned.",resultAria:"Agent creation results",creationFailed:"Agent creation did not complete",agentResources:"Resources available to {{name}}",knowledgeBase:"Knowledge base",toolsLabel:"Tools",creating:"Creating agents",noAgents:"No agents to display",noAgentResult:"The tool response did not include an agent configuration or execution result.",sourceLabels:{tool:"Tools",knowledge:"AgentKit Knowledge Base",skillCenter:"AgentKit Skill Center",unknown:"Unknown source"},unnamedResource:"Unnamed resource",unnamedAgent:"Unnamed agent"},branchCompare:{ariaLabel:"Compare branches",selectDirection:"Select a direction",continue:"Continue in this direction"},codexProgress:{planTitle:"Codex execution plan",fallback:{fileChange:"Modify files",approval:"Waiting for approval",status:"Codex status",command:"Run command"},planSummary:"{{completed}}/{{total}} completed",command:{running:"Running command",completed:"Command completed",failed:"Command failed"},projectFiles:"{{count}} project files",projectFile:"project files",fileChange:{running:"Updating {{subject}}",completed:"Updated {{subject}}",failed:"Failed to update {{subject}}"},externalTool:"external tool",mcp:{running:"Calling {{tool}}",completed:"Called {{tool}}",failed:"{{tool}} call did not complete"},collaboration:{spawn_agent:{running:"Starting subtask",completed:"Subtask started",failed:"Failed to start subtask"},send_input:{running:"Sending information to subtask",completed:"Information sent to subtask",failed:"Failed to send information to subtask"},wait:{running:"Waiting for subtask",completed:"Subtask wait complete",failed:"Subtask wait failed"},close_agent:{running:"Ending subtask",completed:"Subtask ended",failed:"Failed to end subtask"},default:{running:"Coordinating subtasks",completed:"Subtask collaboration complete",failed:"Subtask collaboration failed"}},webSearch:{running:"Searching the web",completed:"Web search complete",failed:"Web search did not complete"},errorDetail:"Codex execution did not complete.",errorTitle:"Codex encountered an error"},toolActivity:{status:{queued:"Queued",running:"Running",completed:"Completed",failed:"Failed"},goal:{queued:"Waiting to create goal",running:"Creating goal",completed:"Created goal",failed:"Failed to create goal"},command:{queued:"Waiting to run command",running:"Running command",completed:"Ran command",failed:"Command failed"},read:{queued:"Waiting to read",running:"Reading",completed:"Read content",failed:"Read failed"},search:{queued:"Waiting to search",running:"Searching",completed:"Search complete",failed:"Search failed"},"file-change":{queued:"Waiting to change files",running:"Changing files",completed:"Changed files",failed:"File change failed"},mcp:{queued:"Waiting to call external tool",running:"Calling external tool",completed:"Called external tool",failed:"External tool call failed"},authorization:{queued:"Waiting for authorization",running:"Waiting for authorization",completed:"Authorization complete",failed:"Authorization failed"},generic:{queued:"Waiting to call tool",running:"Calling tool",completed:"Called tool",failed:"Tool call failed",named:{queued:"Waiting to call {{tool}}",running:"Calling {{tool}}",completed:"Called {{tool}}",failed:"{{tool}} call failed"}},exitCode:"exit {{code}}",omittedLines:"… {{count}} lines omitted …",omittedCharacters:"… {{count}} characters omitted …",rawData:"View raw data",callId:"Call ID",copyCallId:"Copy call ID",copy:"Copy",copied:"Copied",copyFailed:"Copy failed. Try again.",explored_one:"Explored 1 item",explored_other:"Explored {{count}} items"}},_fe={segments:{system:"System and tools",input:"Input and history",output:"Output and reasoning",remaining:"Remaining"},modelUnavailable:"Model information unavailable",promptWithSystem:"Prompt (including system)",systemUnknown:"System and tool usage unknown",systemApprox:"System and tools approximately {{count}} tokens",ariaKnown:"Context {{percentage}}% used, {{system}}, {{inputLabel}} {{input}} tokens, output and reasoning {{output}} tokens, remaining {{remaining}} tokens",ariaUnknown:"{{model}}, context window unknown, {{count}} cumulative session tokens used",composition:"Context composition",percentageUsed:"{{percentage}}% used",gridAria:"100-cell context composition chart. Each cell represents one percent of the context window.",estimated:"Estimated",unknown:"Unknown",summaryPercentage:"{{used}} used, {{remaining}} remaining",summaryTokens:"{{used}} used, {{remaining}} remaining, {{total}} total",overflow:"Context exceeded by {{count}} tokens",title:"Context usage",category:"Category",currentTurn:"Current Turn",sessionTotal:"Session total",details:{input:"Input",output:"Output",reasoning:"Reasoning",cache:"Cache hit",total:"Total"},unknownModel:"The context window for this model is not available",unknownRuntime:"The current runtime did not provide model information"},jfe={title:"Add AgentKit agent",noAgents:"Connected successfully, but no agents were found at this address (/list-apps was empty).",connectionFailed:"Connection failed: {{error}}. Check the URL, API key, and whether the gateway allows cross-origin requests.",description:"Enter the URL and API key of an AgentKit deployment to connect through the ADK protocol. Connected agents will appear in the selector in the upper-left corner.",url:"Endpoint URL",apiKeyHint:"Connect using Authorization: Bearer",displayName:"Display name (optional)",displayNameHint:"Uses the URL hostname by default",cancel:"Cancel",connecting:"Connecting…",connect:"Connect and add"},Nfe={placeholder:"Type a message…",inputAria:"Message",generating:"Generating",send:"Send",model:"Model"},Rfe={ariaLabel:"Invocation context for this turn",removeSkill:"Remove skill {{name}}",removeAgent:"Remove agent {{name}}"},Ife={cardAria:"{{label}} chart",viewAria:"{{label}} display mode",preview:"Preview",code:"Code",invalidEcharts:"The ECharts configuration is not a valid, safe data object. Switch to Code to inspect it.",renderFailed:"The chart cannot be rendered right now. Switch to Code to inspect it.",echartsAria:"ECharts preview",rendering:"Rendering chart…",mermaidFailed:"The chart cannot be rendered right now. Switch to Code to inspect the Mermaid source.",mermaidAria:"Mermaid preview"},Pfe={downloadFile:"Download file",downloading:"Downloading…",downloadFailed:"Download failed. Check that the Sandbox and file are still available, then click to retry.",playVideo:"Play video: {{name}}",enlargeImage:"Enlarge image preview: {{name}}",image:"image",enlargeVideo:"Enlarge video",videoPreview:"Video preview",downloadVideo:"Download video",close:"Close"},Dfe={annotation:kfe,media:Sfe,runtimeLogs:Efe,trace:Cfe,share:Afe,blocks:Tfe,tokenUsage:_fe,addAgentKit:jfe,composer:Nfe,invocation:Rfe,visualization:Ife,markdown:Pfe},Yze=Object.freeze(Object.defineProperty({__proto__:null,addAgentKit:jfe,annotation:kfe,blocks:Tfe,composer:Nfe,default:Dfe,invocation:Rfe,markdown:Pfe,media:Sfe,runtimeLogs:Efe,share:Afe,tokenUsage:_fe,trace:Cfe,visualization:Ife},Symbol.toStringTag,{value:"Module"})),Mfe={back:"Back",cancel:"Cancel",deploy:"Deploy",delete:"Delete",loading:"Loading…",next:"Next",notSupported:"Not supported",previous:"Previous",required:"Required",retry:"Retry",actions:"Actions",value:"Value",disabled:"Off",enabled:"Enabled",none:"None",close:"Close",name:"Name",description:"Description",send:"Send"},Lfe={heading:"VeADK agent structure configuration",importHint:"Reload this file from Import YAML on the Create Agent page."},$fe={agentName:{required:"Name is required",reserved:"user is reserved by Google ADK. Choose another name.",characters:"Start with a letter or underscore and use only letters, numbers, and underscores"},runtimeName:{required:"Runtime name is required",characters:"Runtime name can contain only letters, numbers, underscores, and hyphens",length:"Runtime name must be 4–64 characters"}},Ffe={description:"A VeADK-powered assistant that understands user intent and uses the right tools to complete tasks.",instruction:`You are a professional and reliable assistant. Your goal is to understand the user's request accurately and provide clear, concise, and useful answers. Guidelines: - Ask clarifying questions when information is missing. Do not invent facts. - Use available tools when appropriate and explain key conclusions. -- Maintain a polite, professional tone.`},Ffe={requestFailed:"Request failed ({{status}}){{detail}}",a2aSpaces:{credentialsMissing:"The server does not have cloud provider credentials configured, so AgentKit agent centers are unavailable",loginRequired:"Sign in to access AgentKit agent centers"},vikingKnowledge:{credentialsMissing:"The server does not have cloud provider credentials configured, so VikingDB knowledge bases are unavailable",loginRequired:"Sign in to access VikingDB knowledge bases"},vikingMemory:{credentialsMissing:"The server does not have cloud provider credentials configured, so VikingDB memory stores are unavailable",loginRequired:"Sign in to access VikingDB memory stores"},mcpGateway:{missingHttpTool:"Go back to Add MCP tool and add at least one HTTP MCP service. MCP resilience does not support stdio services.",missingUrl:"An HTTP MCP tool is missing a valid service URL. Go back to Add MCP tool and complete it before publishing."},customModel:{fallbackName:"Custom model",apiKeyLabel:"{{name}} model API Key",fallbackApiKeyLabel:"{{name}} fallback model {{model}} API Key"},deploymentEnv:{serverInjected:"Provided by the server",selectedApiKeyPlaceholder:"Provided by the selected API Key",mcpInjectedComment:"Provided by the added MCP tools",restoredPlaceholder:"Securely restored by the Studio server",generatedMcpPlaceholder:"Generated from the added HTTP MCP tools",restoredHelp:"When updating, the Studio server merges MCP addresses and authentication without returning existing secrets to the browser.",mergedMcpHelp:"The Studio server merges MCP addresses and optional authentication without returning existing secrets to the browser.",listSeparator:", ",requirementHint:"Required by the following optimizations: {{labels}}.",requiredBy:"Required by the following optimizations: {{labels}}. Enter {{key}}.",required:"Enter {{label}} ({{key}}).",invalidJson:"Invalid JSON format"},drafts:{unsupportedVersion:"This local draft version is not supported. Upgrade Studio and try again.",invalidFormat:"The local draft data is invalid.",readFailed:"Could not read local drafts. The browser data may be corrupted.",quotaExceeded:"Browser storage is full, so the draft was not saved. Delete unused drafts or clear this site's storage, then try again.",writeRejected:"The browser blocked saving this draft. Check the site's storage permissions and try again."},skills:{searchFailed:"Search failed ({{status}})",downloadFailed:"Skill download failed ({{status}})",agentKitRequestFailed:"AgentKit Skills request failed",missingManifest:"{{location}} is missing SKILL.md",invalidParentPath:"{{location}} contains an invalid parent path (..): {{path}}",invalidPath:"{{location}} contains an invalid path: {{path}}",localDescription:"Local skill",folderSource:"Folder",noManifest:"No SKILL.md was found in {{location}}"},zip:{invalid:"Invalid zip: EOCD was not found",tooManyFiles:"A zip file cannot contain more than {{count}} files",tooLarge:"The extracted zip content is too large"}},Bfe={back:"Back to development session",runtimeName:"Runtime name",runtimeNameExists:"This Runtime name already exists. Choose another name.",checkingRuntimeName:"Checking Runtime name",verifiedSource:"Verified source",deployableSource:"Deployable source",verifiedByCodex:"Verified by Codex in the cloud",entryPoint:"Entry point",files:"Files",artifact:"Artifact",validationReport:"Validation report",verifiedHint:"The server materializes source from the verified artifact. Browser files cannot replace it.",unverifiedHint:"The server securely materialized the source. Confirm the Runtime configuration before deploying.",env:{requiredPlaceholder:"Enter {{key}}",optionalPlaceholder:"Optional: {{key}}"}},Ufe={name:"Code package",back:"Back to creation methods",reading:"Reading the code package",readingEllipsis:"Reading the code package…",uploadFirst:"Upload a code package first",uploadAriaLabel:"Code package upload",upload:"Upload code package",reupload:"Upload a different code package",uploadPrompt:"Upload a code package",filesRecognized:"{{count}} files found. Select this area to upload a different package.",dropHint:"Select or drop a .zip file up to 50 MB. Use app.py or declare an entry point in agentkit.yaml.",viewFiles:"View files",chooseFile:"Choose code package",errors:{invalidFormat:"Choose a .zip code package.",tooLarge:"The code package must be 50 MB or smaller.",invalidPath:"The archive contains an invalid path: {{name}}",empty:"The archive does not contain any deployable files.",tooManyFiles:"A code package cannot contain more than {{count}} files.",duplicateFile:"The code package contains a duplicate file: {{path}}",manifestParse:"Could not parse agentkit.yaml: {{detail}}",manifestRoot:"The root of agentkit.yaml must be an object.",manifestCommon:"common in agentkit.yaml must be an object.",entryPointType:"common.entry_point in agentkit.yaml must be a file path.",entryPointInvalid:"common.entry_point in agentkit.yaml is not a valid file path.",entryPointMissing:"The entry point declared in agentkit.yaml is missing from the code package: {{entryPoint}}",defaultEntryPointMissing:"The code package root must contain app.py, or common.entry_point in agentkit.yaml must declare an existing entry point."}},Qfe={label:"Agent execution canvas",readOnlyLabel:"Read-only agent execution canvas",minimapLabel:"Execution flow minimap",controls:{ariaLabel:"Execution flow controls",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Fit view"},rootAgent:"Main agent",unnamedStep:"Unnamed step",terminals:{input:"User request",output:"Final response"},edges:{then:"Then",continueLoop:"Continue loop",call:"Call"},patterns:{llm:{label:"Agent",description:"Understand a task and complete one specific job"},sequential:{label:"Sequential",description:"Run internal steps one after another"},parallel:{label:"Parallel",description:"Run internal steps together, then combine their results"},loop:{label:"Loop",description:"Repeat internal steps until the stop condition is met"},a2a:{label:"Remote agent",description:"Call an existing remote agent"}},actions:{insertHere:"Insert a step here",deleteNamed:"Delete {{name}}",deleteNode:"Delete node",addSubagent:"Add subagent",addParallelStep:"Add a parallel step",addLoopStep:"Add a loop step",addNextStep:"Add next step",addFirst:"Add at the beginning",addLast:"Add at the end"}},zfe={title:"Intelligent build",subtitle:"Describe what you need. Build, debug, and validate your agent.",model:{label:"Model",placeholder:"Select a model",retiring:"Retiring soon",currentConfiguration:"Current configuration",loadError:"Failed to load models"},availability:{checking:"Checking intelligent development availability…",unavailable:"Intelligent mode is currently unavailable. Go back and try again."},goal:{title:"Start with a goal",continueTitle:"Continue improving the project",hint:"Describe the problem your agent should solve. We will ask about any details that could affect the result.",continueHint:"Describe what you want to change. The result will be saved as a new version.",basedOn:"Based on",clearSelection:"Clear selection",label:"Goal",optimizationLabel:"Optimization goal",placeholder:"For example: Build an agent that reads sales data, creates weekly reports, and validates the output format",optimizationPlaceholder:"For example: Cite data sources and ask the user when information is incomplete"},actions:{preparing:"Preparing…",build:"Start building",optimize:"Start optimizing"},preparation:{accepted:"Goal received. Implementation is starting now.",preparing:"Creating the task environment…",starting:"Environment ready. Starting Codex…",next:"Next, Codex will plan the approach, then build, run, and validate the agent."},tasks:{title:"Tasks in progress",hint:"Work continues when you leave. Return to follow progress or add instructions.",refresh:"Refresh tasks",loading:"Loading tasks…",empty:"No tasks in progress",emptyHint:"Once a build starts, you can return to it here.",loadError:"Unable to load tasks. Please retry.",openError:"Unable to open this task. Please retry.",startedAt:"Started {{time}}",open:"Open task",opening:"Connecting…",states:{queued:"Queued",running:"Building",recovering:"Reconnecting",waiting_user:"Awaiting your reply",stopping:"Stopping",succeeded:"Completed",failed:"Incomplete",cancelled:"Stopped"}}},Vfe={title:"Saved projects",description:"Continue improving an existing version, or view, download, and deploy its source.",refresh:"Refresh projects",checkingStorage:"Checking project storage…",unavailableTitle:"Projects are temporarily unavailable",storageCheckError:"Could not confirm project storage status. Try again shortly.",storageNotConfigured:"Project storage is not configured.",loadingMigrated:"Loading migrated projects…",loadingSaved:"Loading saved projects…",loadingVersions:"Loading project versions…",unknownTime:"Unknown time",sourceDownloaded:"Source downloaded.",projectSummary_one:"{{count}} version · Updated {{time}}",projectSummary_other:"{{count}} versions · Updated {{time}}",versionSummary_one:"{{time}} · {{count}} file",versionSummary_other:"{{time}} · {{count}} files",noVersionDescription:"No version description",latestVersion:"Latest version",defaultVersionName:"Version · {{time}}",rename:{projectTitle:"Edit project name",versionTitle:"Edit version name",projectLabel:"Project name",versionLabel:"Version name",hint:"Use letters, numbers and common punctuation, up to {{max}} characters.",required:"Enter a name.",tooLong:"Names can contain up to {{max}} characters.",invalidCharacters:"Names cannot contain line breaks, control or invisible formatting characters, or < >.",save:"Save name",saving:"Saving…",updated:"Name updated.",failed:"Unable to save the name. Try again."},verified:"Verified",pendingVerification:"Needs review",viewSource:"View source",download:"Download",downloading:"Downloading…",optimize:"Optimize",optimizeUnavailable:"Optimize, not supported",errors:{projects:"Could not load saved projects.",source:"Could not load project source.",versions:"Could not load project versions.",download:"Could not download the source.",prepareDeployment:"Could not prepare the source for deployment.",deleteVersion:"Could not delete the project version.",migrated:"Could not load migrated projects",saved:"Could not load saved projects"},empty:{migratedTitle:"No migrated projects yet",savedTitle:"No saved projects yet",migratedDescription:"Source will be saved here after your first migration.",savedDescription:"Source will be saved here after your first build.",noVersions:"This project has no available versions."},compare:{selected:"{{count}}/2 selected",selectedLabel:"Selected",select:"Select",view:"View comparison",start:"Compare versions"},delete:{title:"Delete this version?",onlyVersion:"“{{name}}” has only one version. Deleting it will also remove the project. This cannot be undone.",description:"This version's source and validation records will be permanently deleted. Other versions are not affected.",confirm:"Delete version"}},Hfe={title:"Choose how to create",subtitle:"Build your agent with the workflow that fits your needs",features:"Features",quick:{title:"Quick mode",description:"Delegate tasks to dynamically created subagents",features:{dynamicSubagents:"Dynamic subagents",autonomousPlanning:"Autonomous planning",collaboration:"Multi-agent collaboration",summary:"Automatic result summaries",skills:"Skills on demand",trace:"Traceable task execution"}},traditional:{title:"Advanced mode",description:"Customize your agent structure in detail",features:{visualConfig:"Visual configuration",migration:"Existing agent migration",debugging:"Live debugging",optimization:"Optional optimization",parameters:"Fine-grained controls"}}},qfe={placeholder:"Enter a system prompt. Type ## followed by a space to add a level-two heading…",toolbar:{undo:"Undo {{shortcut}}",redo:"Redo {{shortcut}}",paragraph:"Paragraph",quote:"Quote",heading:"Heading {{level}}",selectBlockType:"Select text style",blockType:"Text style",bold:"Bold",removeBold:"Remove bold",italic:"Italic",removeItalic:"Remove italic",bulletedList:"Bulleted list",numberedList:"Numbered list"}},Wfe={local:{duplicatesSkipped:"Skipped duplicate skills: {{names}}",invalidDrop:"Drop a folder containing SKILL.md or a .zip file",readError:"Could not read the files: {{detail}}",dropLabel:"Drop a folder or ZIP file to detect skills automatically",hint:"Each skill must contain a SKILL.md file. Directories can contain multiple skills.",reading:"Reading files…",fileCount:"Local · {{count}} files"},hub:{searchError:"Search failed. Try again shortly.",searchPlaceholder:"Search Volcano Find Skill, such as data analysis or PDF",search:"Search",searching:"Searching…",noResults:"No matching skills found. Try another keyword.",hint:"Search Volcano Find Skill by keyword. Selected skills are downloaded to the skills/ directory when the project is generated."},space:{loadError:"Failed to load",loadingSpaces:"Loading AgentKit Skills centers…",noSpaces:"This account has no AgentKit Skills centers.",selectSpace:"Select an AgentKit Skills center",openConsole:"Open in the Volcano Engine console",loadingSkills:"Loading skills…",noSkills:"This AgentKit Skills center has no skills."}},Kfe={unnamedNode:"Unnamed node",editInstruction:"Select to edit instructions…",controls:{ariaLabel:"Workflow canvas controls",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Fit view"},sections:{info:"Workflow information",execution:"Execution mode",nodes:"Nodes",nodeConfig:"Node configuration"},types:{sequential:{label:"Sequential",description:"Run nodes one after another"},parallel:{label:"Parallel",description:"Run nodes at the same time"},loop:{label:"Loop",description:"Run nodes repeatedly"}},placeholders:{description:"Describe what this workflow does…",agentDescription:"Describe what this agent does…",instruction:"You are…"},errors:{workflowNameUnique:"The workflow name must be unique among agent node names",agentNameUnique:"Agent names must be unique within this workflow"},dragHint:"Drag onto the canvas, or use the button below",agentNode:"Agent node",addNode:"Add node",connectHint:"Drag between node handles to define the execution order.",create:"Create workflow",deleteNode:"Delete node",nameHelp:"Use only letters, numbers, and underscores. Names must be unique.",instruction:"Instructions",tools:"Tools (comma-separated)",nodeId:"Node ID",empty:{selectNode:"Select a node to edit its configuration",summary:"{{nodes}} nodes · {{edges}} connections"}},Gfe={ariaLabel:"Quick mode creation",progress:"Quick mode creation progress",steps:{agent:{label:"Agent",title:"Basic information",description:"Set the agent's name, purpose, behavior, and capabilities"},environment:{label:"Environment",title:"Configure the environment",description:"Choose the default environment or a custom environment you have built"},deployment:{label:"Deployment",title:"Deployment preferences",description:"Configure AgentKit cloud settings"}},model:{label:"Model",source:"Model source",name:"Model name",fallbacks:"Fallback models",fallbackPlaceholder:"Fallback model name",addFallback:"Add fallback model",addProviderFallback:"Add other provider",removeFallback:"Remove",fallbackType:"Fallback model type",fallbackSameProvider:"Same provider",fallbackOtherProvider:"Other provider",apiKeyEnv:"API Key environment variable",invalidApiKeyEnv:"Use letters, numbers, and underscores only, and do not start with a number.",fallbackHelp:"Same-provider fallbacks reuse the primary connection. Other providers use separate provider, API base, and API Key settings.",fallbackIgnored:"Empty, duplicate, or primary-model entries will be ignored.",provider:"Provider",invalidApiBase:"Enter a valid http:// or https:// URL.",volcengineArk:"Volcano Ark",custom:"Custom",gateway:"Model gateway",comingSoon:"Coming soon",currentApiKey:"Current API Key",currentConfiguration:"Current configuration",loadingApiKeys:"Loading API Keys",selectApiKey:"Select an API Key",searchApiKeys:"Search API Key names",noApiKeys:"No API Keys available",loadingModels:"Loading models",selectModel:"Select a model",searchModels:"Search by name, Model ID, or provider",noModels:"No models available",apiKeyPlaceholder:"Enter a model API Key",credentialsLoadError:"Failed to load model credentials",modelsLoadError:"Failed to load models"},identity:{unnamedPool:"Unnamed user pool",currentPool:"{{value}} (current user pool)",userPool:"User pool",loading:"Loading user pools",placeholder:"Select a user pool",search:"Search user pools",empty:"This account has no Identity user pools",currentHint:"This Studio's login JWT will be forwarded to the Runtime",mismatchHint:"The selected user pool is not used by this Studio, so the Studio will not be able to call the Runtime after deployment",selectionHint:"The user pool used by this Studio is marked in the list"},agent:{namePlaceholder:"Enter an agent name",descriptionPlaceholder:"Describe what this agent can do",prompt:"Prompt",promptPlaceholder:"Define the role, goals, and behavior boundaries",skills:"Skills",addSkill:"Add skills"},validation:{descriptionRequired:"Enter a description",promptRequired:"Enter a prompt",modelRequired:"Select a model",apiKeyRequired:"Enter or select the model API Key",instanceIntegers:"Minimum instances must be an integer of 0 or greater, and maximum instances must be an integer greater than 0",instanceOrder:"Minimum instances cannot exceed maximum instances",userPoolRequired:"Select a user pool for Runtime authentication"},deployment:{runtimeName:"Runtime name",runtimeNameUpdateHint:"The existing Runtime name is preserved during updates",runtimeNameHint:"Use only letters, numbers, underscores, and hyphens",region:"Deployment region",authentication:"Authentication",apiKeyDescription:"Default: access with the Runtime API Key",userPoolDescription:"Use a JWT issued by an Identity user pool",sessionStorage:"Session storage",inMemoryStorage:"Temporary in-memory storage",backends:{sqlite:"SQLite file",mysql:"MySQL",postgresql:"PostgreSQL"},instances:"Instance settings",minInstances:"Minimum instances",maxInstances:"Maximum instances",inMemoryHint:"To prevent session loss across instances, keep the Runtime at 1–1 instances",networkMode:"Network mode",network:{public:"Public",private:"Private",both:"Public and private"},subnetIds:"Subnet IDs (optional, comma-separated)",sharedInternet:"Shared public egress in the VPC",sharedInternetHint:"Allow private Runtimes to access the public internet through shared egress",evaluationSets:"Evaluation sets",createEvaluationSets:"Create evaluation sets automatically",evaluationSetsHint:"Create Good Case and Bad Case evaluation sets after deployment",resources:"Resource configuration",complete:"Deployment complete",preparing:"Preparing deployment…"},environmentVariables:{title:"Environment variables",add:"Add variable",nameAriaLabel:"Environment variable name",valueAriaLabel:"Value for {{name}}",deleteNamed:"Delete {{name}}"},actions:{updateAgain:"Update again",deployAgain:"Deploy again",updateAndPublish:"Update and publish",applyProfile:"Apply Profile",applyProfileAgain:"Apply Profile again"}},Xfe={actions:{addSubagent:"Add subagent",clearRoot:"Clear main agent",clearRootConfirmation:"Clear all settings and subagents from the main agent? This cannot be undone."},workspace:{progress:"Agent creation progress",modes:{build:"Build",validate:"Debug",optimize:"Optimize",environment:"Environment",publish:"Publish"},titles:{build:"Customize your agent architecture",validate:"Debug your agent",optimize:"Choose optimizations for your agent",environment:"Configure the cloud environment",publish:"Prepare your agent for deployment"}},sections:{type:{label:"Agent type",hint:"Choose an agent type"},basic:{label:"Basic information",hint:"Name, description, and system prompt"},model:{label:"Model",hint:"Model and service (optional)"},tools:{label:"Tools",hint:"Callable capabilities"},skills:{label:"Skills",hint:"Declarative skills"},knowledge:{label:"Knowledge base",hint:"External knowledge retrieval"},memory:{label:"Memory",hint:"Short-term and long-term memory"},subagents:{label:"Subagents",hint:"Nested collaboration"},review:{label:"Finish",hint:"Preview and create"}},agentTypes:{ariaLabel:"Agent type",remoteChildOnly:"Remote agents can only be used as child steps",llm:{label:"Agent",fullLabel:"LLM agent",description:"Uses an LLM to complete tasks autonomously"},sequential:{label:"Sequential",fullLabel:"Sequential agent",description:"Runs subagents one after another"},parallel:{label:"Parallel",fullLabel:"Parallel agent",description:"Runs subagents in parallel, then combines their results"},loop:{label:"Loop",fullLabel:"Loop agent",description:"Repeats subagents until the stop condition is met"},a2a:{label:"Remote agent",fullLabel:"Remote agent",description:"Calls a remote agent through the A2A protocol"}},basic:{agentName:"Agent name",name:"Name",agentDescription:"Agent description",descriptionPlaceholder:"Briefly describe what this agent does so your team can identify it…",nameHelp:"Follow Google ADK naming rules and keep the name unique in the execution flow.",rootDescriptionHelp:"The full description is preserved and converted to a Runtime-compatible single line during deployment.",descriptionHelp:"The description appears in agent lists and selectors.",orchestratorHelp:"This is a collaboration container and does not answer directly. Add task steps on the canvas and drag them to reorder.",maxIterations:"Maximum iterations",maxIterationsHelp:"The loop repeats its subagents until the condition is met or this limit is reached.",agentCenter:"AgentKit agent center",agentCenterHelp:"The remote agent's name, description, and capabilities come from the Agent Card returned by the center. The system discovers and attaches matching agents for each task.",moreOptions:"More options",systemPrompt:"System prompt",loadingMarkdown:"Loading Markdown editor…",markdownHelp:"Markdown shortcuts are supported. For example, type ## followed by a space to create a level-two heading.",unnamed:"Unnamed",unnamedAgent:"Unnamed agent"},validation:{remoteRoot:"A remote agent can only be a subagent",missingRegistry:"Select an AgentKit agent center",name:{required:"Name is required",reserved:"user is reserved by Google ADK. Choose another name.",characters:"Start with a letter or underscore and use only letters, numbers, and underscores"},duplicateName:"Agent names must be unique within this structure",missingDescription:"Description is required",mcpDuplicateName:"MCP names must be unique",mcpDuplicateUrl:"Remove the duplicate MCP endpoint before publishing",missingSubagent:"A subagent is required",missingPrompt:"System prompt is required",apiKeyRequired:"Enter or select the model API Key",missingSubagentDetail:"Add at least one subagent to {{type}} before debugging or publishing.",problem:"{{name}}: {{problem}}"},ai:{ariaLabel:"Fill agent configuration with AI",minimumLength:"Enter at least {{count}} characters.",replaceConfirmation:"The generated configuration will replace the current canvas and settings. Continue?",placeholder:"Describe your goal and use {{model}} to generate the configuration",generate:"Generate",generating:"Generating",success:"Configuration generated",regenerate:"Generate again",failed:"Generation failed"},debug:{ariaLabel:"Agent debugging workspace",unavailable:"This backend does not currently support generated-agent debug runs.",baseline:"Baseline",comparison:"Variant {{count}}",selectModel:"Select a model",enterDescription:"Enter a description",enterPrompt:"Enter a system prompt",duplicateConfiguration:"Test configurations must be unique",starting:"Starting…",applyAndRestart:"Apply and restart",restart:"Restart",start:"Start environment",defaultModel:"Default model",testConfiguration:"Test configuration",deleteVariant:"Delete {{name}}",deleteVariantGroup:"Delete comparison variant",creatingEnvironment:"Creating the test environment…",configurationChanged:"The configuration changed. Restart the environment.",ready:"Environment ready",readyHint:"Send a message to compare agent responses.",startHint:"Complete the configuration, then start the environment.",viewTraceNamed:"View the trace for {{name}}",traceUnavailable:"Send a message to view its trace",trace:"Trace",useConfiguration:"Use this configuration",finishConfiguration:"Finish configuration",finishAndStart:"Finish and start",currentAgentModel:"Current agent model",configurationHint:"Changes apply only to this comparison. Select this configuration to continue to deployment.",messagePlaceholder:"Send a message to the running test environments…",startOneFirst:"Start at least one test environment first",addVariant:"Add variant",traceTitle:"Trace · {{name}}",leaveTitle:"Leave debugging?",leaveDescription:"The current environments will be removed when you leave. You can start new environments when you return.",cleaning:"Cleaning up…",confirmLeave:"Leave",closeLeaveConfirmation:"Close leave-debugging confirmation"},optimization:{ariaLabel:"Agent optimization options",scenario:"Optimization scenario",components:"Optimization components",bytePlusUnavailable:"Harness Sidecar optimizations are not available for BytePlus accounts yet. Leave all optimizations unselected to continue; regular BytePlus agents are not affected.",releaseScenario:"Optimization scenario: {{profile}}",profiles:{default:{label:"Custom",description:"Choose components as needed. The Sidecar stays off when none are selected."},ops:{label:"Operations",description:"For operations diagnostics, databases, logs, and monitoring MCP servers."}},groups:{quality:"Improve response quality",cost:"Reduce runtime cost",stability:"Improve runtime stability"},options:{context_engine:{label:"Context management",description:"Manage context assembly, task anchoring, and context budgets."},compressor:{label:"Context and result compression",description:"Compress long context and large tool results to reduce token usage."},verifier:{label:"Response verification and repair",description:"Verify evidence and responses, then repair or alert on failure."},long_run_control:{label:"Goal task control",description:"Manage progress, continuation, and completion conditions for Goal tasks."},mcp_resilience:{label:"MCP resilience",description:"Manage connections, timeouts, empty results, large responses, and call budgets. Includes read-only SQL protection by default."}}},model:{label:"Model",source:"Model source",volcanoArk:"Volcano Ark",volcengineArk:"Volcano Ark",bytePlusModelArk:"BytePlus ModelArk",custom:"Custom",gateway:"Model gateway",comingSoon:"Coming soon",configuration:"Model configuration",name:"Model name",fallbacks:"Fallback models",fallbackPlaceholder:"Fallback model name",addFallback:"Add fallback model",addProviderFallback:"Add other provider",removeFallback:"Remove",fallbackType:"Fallback model type",fallbackSameProvider:"Same provider",fallbackOtherProvider:"Other provider",apiKeyEnv:"API Key environment variable",invalidApiKeyEnv:"Use letters, numbers, and underscores only, and do not start with a number.",fallbackHelp:"Same-provider fallbacks reuse the primary connection. Other providers use separate provider, API base, and API Key settings.",fallbackIgnored:"Empty, duplicate, or primary-model entries will be ignored.",provider:"Provider",invalidApiBase:"Enter a valid http:// or https:// URL.",liteLlmProviders:"LiteLLM providers",apiKeyPlaceholder:"Enter the model API Key",available:"Available",retiring:"Retiring soon",notActivated:"Not activated",unavailable:"Unavailable",apiKeyLoadError:"Failed to load Ark API Keys",loadingApiKeys:"Loading API Keys…",selectApiKey:"Select an API Key",currentApiKey:"Current API Key",apiKeyList:"API Key list",searchApiKey:"Search API Keys",searchApiKeyName:"Search API Key names",noApiKeys:"No API Keys available",noMatchingApiKey:"No matching API Keys",loading:"Loading models…",loaded:"{{count}} models loaded",loadError:"Failed to load models",selectModel:"Select a model",selectProviderModel:"Select a provider model",providerModels:"Provider models",search:"Search models",searchPlaceholder:"Search by name, Model ID, or provider",noMatches:"No matching models",empty:"No models available",unknownStatus:"Unknown status",refresh:"Refresh",refreshing:"Refreshing…",activate:"Activate",activateAction:"Open activation",currentConfiguration:"Current configuration"},tools:{builtIn:"Built-in tools",builtInHelp:"Select VeADK capabilities. Imports and required environment variables are added automatically.",codeExecution:"Code execution configuration",codeExecutionHelp:"Select the AgentKit code execution sandbox.",mcp:"MCP tools"},catalog:{web_search:{label:"Web search",description:"Get real-time information with Volcengine Web Search."},parallel_web_search:{label:"Parallel web search",description:"Run multiple search queries in parallel and combine the results faster."},link_reader:{label:"Link reader",description:"Fetch and read the main content from a URL."},web_scraper:{label:"Web scraper",description:"Crawl webpages into structured data. Requires the Scraper service."},image_generate:{label:"Image generation",description:"Generate images from text with Doubao Seedream."},image_edit:{label:"Image editing",description:"Edit or transform images with Doubao SeedEdit."},video_generate:{label:"Video generation",description:"Generate videos from text or images with Doubao Seedance, including task status queries."},text_to_speech:{label:"Text to speech (TTS)",description:"Convert text to speech with Volcengine Speech."},run_code:{label:"Code execution",description:"Run code in a sandbox."},vesearch:{label:"VeSearch",description:"Search with Volcengine VeSearch. Requires a bot endpoint."},links:{console:"Console",documentation:"Documentation"},env:{modelAgentName:{comment:"Model name"},embeddingModelName:{comment:"Embedding model required by memory and knowledge bases"},vikingMemoryProject:{comment:"VikingDB memory project"},vikingMemoryRegion:{comment:"VikingDB memory region"},vikingMemoryType:{comment:"Memory types"},feishuAppId:{comment:"Feishu app ID"},feishuAppSecret:{comment:"Feishu app secret",placeholder:"Enter the app secret"},registrySpaceId:{comment:"AgentKit agent center",placeholder:"Select an agent center"},registryTopK:{comment:"Number of agents to retrieve"},registryRegion:{comment:"AgentKit agent center region"},registryEndpoint:{comment:"AgentKit agent center OpenAPI endpoint"},agentKitToolId:{comment:"Code execution sandbox ID"},agentKitToolRegion:{comment:"AgentKit Tools region"},openVikingUrl:{comment:"OpenViking service URL"},openVikingMemoryUserId:{comment:"Memory owner ID",help:"The user segment in viking://user//peers//memories. Use it to isolate agents, tenants, or business scenarios. The default is default."},openVikingMemoryPolicy:{comment:"Memory policy",help:"Controls memory extraction and isolation. Leave it blank to use the official default policy."},openVikingKnowledgeUserId:{comment:"Knowledge base owner ID",help:"Used in the default path viking://user//resources// when no resource directory is configured. The default is default."},openVikingTargetUri:{comment:"Knowledge base resource directory",help:"Leave blank to generate it from the KnowledgeBase index. When provided, this OpenViking resource directory takes precedence."},tlsServiceName:{comment:"TLS topic_id. Leave blank to create one automatically"}}},backends:{shortTerm:{local:{label:"In-memory",description:"Stored in the process without persistence. Best for development and debugging."},sqlite:{label:"SQLite file",description:"Persist data to a local .db file."},mysql:{label:"MySQL",description:"Persist data to MySQL."},postgresql:{label:"PostgreSQL",description:"Persist data to PostgreSQL."}},longTerm:{local:{label:"Local vector store",description:"In-process llama-index vector store."},opensearch:{label:"OpenSearch",description:"Vector retrieval with OpenSearch."},redis:{label:"Redis",description:"Vector retrieval with Redis."},viking:{label:"VikingDB Memory",description:"VikingDB memory with user profile support."},openviking:{label:"OpenViking Memory",description:"Long-term memory that stores and retrieves preferences, events, and entities per user."},mem0:{label:"Mem0",description:"Managed memory from Mem0."}},knowledge:{viking:{label:"VikingDB Knowledge",description:"VikingDB knowledge base."},opensearch:{label:"OpenSearch",description:"Vector retrieval with OpenSearch."},context_search:{label:"Context Search",description:"Volcengine Context Search without embedding configuration."},openviking:{label:"OpenViking Knowledge",description:"OpenViking resource-directory knowledge base without embedding configuration."}}},exporters:{apmplus:{label:"APMPlus",description:"Volcengine APMPlus application performance monitoring."},cozeloop:{label:"CozeLoop",description:"Distributed tracing with CozeLoop."},tls:{label:"TLS (Log Service)",description:"Export logs to Volcengine TLS."}},knowledge:{title:"Knowledge base",description:"Enable external knowledge retrieval (RAG) so the agent can answer from your data.",backend:"Knowledge base backend",vikingDatabase:"VikingDB knowledge base"},memory:{shortTerm:"Short-term memory",shortTermDescription:"Store context for one session",shortTermBackend:"Short-term memory backend",longTerm:"Long-term memory",longTermDescription:"Store context across sessions, usually with vector retrieval",longTermBackend:"Long-term memory backend",vikingDatabase:"VikingDB memory",autoSave:"Save sessions to long-term memory automatically",autoSaveDescription:"Write session content to long-term memory when a session ends."},mcp:{removeTool:"Remove MCP tool",namePlaceholder:"Name (optional)",urlPlaceholder:"MCP service URL",pathWarning:"This is a gateway root address. Use it only when the root path is the MCP endpoint; otherwise include the complete service path.",tokenPlaceholder:"Bearer token (optional)",showToken:"Show Bearer token",hideToken:"Hide Bearer token",commandPlaceholder:"Command, such as npx",argsPlaceholder:"Arguments separated by spaces",stdioHint:"The stdio tool starts in the deployment environment. Make sure its command and dependencies are available.",addTool:"Add MCP tool"},resources:{unnamedAgentCenter:"Unnamed agent center",unnamedKnowledgeBase:"Unnamed knowledge base",unnamedMemory:"Unnamed memory store",loadError:"Failed to load",loadingAgentCenters:"Loading agent centers…",agentCentersLoaded:"{{count}} agent centers loaded",noAgentCenters:"No agent centers available",noMatchingAgentCenters:"No matching agent centers",searchAgentKitCenter:"Search AgentKit agent centers",searchNameOrId:"Search by name or ID",selectAgentCenter:"Select an agent center",selectAgentKitCenter:"Select an AgentKit agent center",selectedAgentCenter:"Selected agent center",agentKitCenter:"AgentKit agent center",refreshAgentCenters:"Refresh agent centers",knowledgeBaseList:"Knowledge base list",knowledgeBasePlaceholder:"Select a knowledge base",loadingKnowledgeBases:"Loading knowledge bases…",knowledgeBasesLoaded:"{{count}} knowledge bases loaded",noKnowledgeBases:"No knowledge bases available",noMatchingKnowledgeBases:"No matching knowledge bases",searchKnowledgeBase:"Search knowledge bases",selectKnowledgeBase:"Select a knowledge base",refreshKnowledgeBases:"Refresh knowledge bases",memoryList:"Memory store list",memoryPlaceholder:"Select a memory store",loadingMemories:"Loading memory stores…",memoriesLoaded:"{{count}} memory stores loaded",noMemories:"No memory stores available",noMatchingMemories:"No matching memory stores",searchMemory:"Search memory stores",selectMemory:"Select a memory store",refreshMemories:"Refresh memory stores"},env:{noAdditionalParameters:"This backend needs no additional runtime parameters.",invalidJson:"Enter valid JSON.",helpAriaLabel:"Help for {{label}}: {{help}}",openOpenViking:"Open OpenViking {{label}}",valuePlaceholder:"Enter a value",openVikingIndex:"OpenViking resource index",openVikingIndexHelp:"Leave blank to generate an index from the agent name, such as my_agent_kb. Without DATABASE_OPENVIKING_TARGET_URI, the default URI is viking://user/{knowledge base owner ID, or default}/resources/{resource index}/. When DATABASE_OPENVIKING_TARGET_URI is set, that complete URI is used instead.",openVikingIndexAriaLabel:"OpenViking resource index help: {{help}}"},deployment:{vpcRequired:"Enter a VPC ID when using VPC networking.",apiKeyRequired:"Select the API Key used by the model.",invalidEnvName:"Invalid environment variable name: {{key}}",requiredEnv:"{{name}}: enter this required environment variable",generatingConfiguration:"Generating deployment configuration",runtimeNameExists:"This Runtime name already exists. Choose another name and try again.",preparing:"Preparing deployment",applyingMpaProfile:"Applying the Agent profile to MPA Runtime",mpaProfileApplied:"MPA Runtime profile applied",runningMpaSmoke:"Verifying the MPA Runtime execution path",mpaReady:"MPA Runtime is ready",mpaOperationIncomplete:"MPA Runtime setup did not complete. Retry this deployment task.",complete:"Deployment complete",failed:"Deployment failed",updateAndPublish:"Update and publish",stages:{build:"Build image",deploy:"Deploy Runtime",publish:"Publish service",applyMpaProfile:"Apply MPA profile",verifyMpaRuntime:"Verify MPA Runtime",mpaReady:"MPA Runtime ready",running:"Deploying"}},publish:{generating:"Generating publish configuration",validating:"Validating the agent structure and preparing the deployment snapshot…"}},Yfe={presets:{support:{name:"Customer support assistant",description:"Answer questions around the clock using your knowledge base and conversation history, with consistent and considerate responses.",instruction:"You are a professional and patient customer support assistant. Always use a courteous, friendly tone. Base answers on the knowledge base whenever possible. When the available information is insufficient, say so clearly and ask for the details you need instead of inventing an answer. Keep responses concise and well structured, and provide steps when useful.",subagents:{}},analyst:{name:"Data analyst",description:"Run code for statistics and visualization with tracing enabled, so every analysis is observable and reproducible.",instruction:"You are a rigorous data analyst. Clarify the objective and definitions before cleaning, analyzing, and visualizing data with executable code. Explain assumptions and methods at each step, support conclusions with key evidence, and identify possible bias or limitations.",subagents:{}},translator:{name:"Translation assistant",description:"Translate between Chinese and English accurately and naturally while preserving tone and terminology.",instruction:"You are a professional translator fluent in Chinese and English. Preserve the meaning of the source while producing natural language for the target audience. Keep proper nouns and technical terminology accurate and reflect the original tone and style. Return only the translation unless the user asks for an explanation.",subagents:{}},coder:{name:"Coding assistant",description:"Write, debug, and refactor code, validate it by running tests, and produce clear, maintainable implementations.",instruction:"You are a senior software engineer. Write correct, clear, maintainable code that follows the conventions and best practices of the target language. When uncertain, run the code to validate the implementation, cover important edge cases, and add concise comments for complex logic.",subagents:{}},researcher:{name:"Researcher",description:"Search primary sources online and combine them with knowledge and long-term memory to produce evidence-backed findings.",instruction:"You are a rigorous researcher. Break each question into key subproblems, collect multiple credible primary sources through web search, and cross-check the evidence before drawing conclusions. Cite sources, state uncertainty, distinguish facts from inference, and avoid overgeneralization.",subagents:{}},"research-team":{name:"Multi-agent research team",description:"Coordinate a researcher, analyst, and writer to produce an end-to-end research report.",instruction:"You coordinate a research team. Break down the user's research task, delegate search, analysis, and writing to the appropriate subagents, synthesize their work, and deliver a clear, evidence-backed report.",subagents:{0:{name:"Researcher",description:"Collect primary sources and data related to the topic online.",instruction:"You are the team's researcher. Find multiple credible sources about the topic, organize the key facts, data, and original citations, and hand them to the analyst without adding unsupported conclusions."},1:{name:"Analyst",description:"Cross-check and synthesize the collected material.",instruction:"You are the team's analyst. Cross-check, compare, and synthesize the research material. Extract insights, identify contradictions and uncertainty, and produce a structured set of findings."},2:{name:"Writer",description:"Turn the analysis into a clear report with reliable citations.",instruction:"You are the team's writer. Turn the analyst's findings into a clear, well-written report with consistent citations, ensuring every conclusion can be traced to a source."}}}},tags:{tools:"Tools",memory:"Memory",knowledgeBase:"Knowledge base",tracing:"Tracing",subagents:"{{count}} subagents"},gallery:{title:"Create from a template",subtitle:"Choose a prebuilt agent template and customize it to fit your needs."},detail:{back:"Back to templates",name:"Name",systemPrompt:"System prompt",model:"Model",tools:"Tools",memory:"Memory",knowledgeBase:"Knowledge base",tracing:"Tracing",subagents:"Subagents ({{count}})",create:"Create from this template",shortTermMemory:"Short-term",longTermMemory:"Long-term"}},Zfe={checkingExpiry:"Checking expiry",waitingRecovery:"Waiting for recovery",listFailed:"Could not load projects",recoveryFailed:"Could not restore the workspace. Try again",operationFailed:"Project operation failed. Try again",title:"Code projects",back:"Back to code projects",restart:"This development environment will restart in {{countdown}}. Save your work regularly",expiresAt:"Expires at {{date}}",exitFullscreen:"Exit full screen",fullscreen:"Full screen",exitFullscreenHint:"Exit full screen (Esc)",recovering:"Restoring your workspace. Your project will reopen automatically",retry:"Retry connection",search:"Search code projects",newTitle:"New code project",new:"New project",readingStats:"Loading project details",createdAt:"Created",opening:"Opening",unknownCreatedAt:"Creation time unknown",open:"Open project",empty:"No matching code projects",close:"Close new project",name:"Project name",placeholder:"e.g. my-agent",nameHelp:"Start with a letter and use letters, numbers, underscores or hyphens, up to 64 characters",cancel:"Cancel",create:"Create project",files_one:"{{count}} file",files_other:"{{count}} files",directories_one:"{{count}} directory",directories_other:"{{count}} directories",separator:", "},Jfe={enabled:"Enabled",disabled:"Disabled",unknownStatus:"Unknown status",allPermissions:"All permissions",customPermissions:"Custom permissions",unknownPermissions:"Unknown permissions",unnamed:"Unnamed API Key",search:"Search name, status or permissions",noMatches:"No matching API Keys",noModelPermission:"Not permitted by this API Key",modelAvailable:"Available",permissionState:{Available:"Available for chat",Shutdown:"Shut down",VideoGeneration:"Video generation model",Unsupported:"Not a chat model",NotActivated:"Not activated",Unknown:"Model status unavailable"}},ehe={common:Dfe,yaml:Mfe,validation:Lfe,defaults:$fe,helpers:Ffe,intelligentDeployment:Bfe,codePackage:Ufe,buildCanvas:Qfe,intelligent:zfe,projectLibrary:Vfe,modePicker:Hfe,promptEditor:qfe,skills:Wfe,workflow:Kfe,workbench:Gfe,traditional:Xfe,template:Yfe,workspace:Zfe,modelApiKey:Jfe},Xze=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:Qfe,codePackage:Ufe,common:Dfe,default:ehe,defaults:$fe,helpers:Ffe,intelligent:zfe,intelligentDeployment:Bfe,modePicker:Hfe,modelApiKey:Jfe,projectLibrary:Vfe,promptEditor:qfe,skills:Wfe,template:Yfe,traditional:Xfe,validation:Lfe,workbench:Gfe,workflow:Kfe,workspace:Zfe,yaml:Mfe},Symbol.toStringTag,{value:"Module"})),the={source:"Task source",studio:"Studio scheduled tasks",title:"Runtime scheduled tasks",selectRuntime:"Select a cloud Runtime from the Agent list first.",scope:"Scheduled tasks for the current Studio user in this Runtime.",refresh:"Refresh",loading:"Loading Runtime tasks",empty:"No matching scheduled tasks in this Runtime.",authRequired:"Runtime rejected the request. Check gateway access and the Runtime authentication setting.",forbidden:"The current user cannot access this Runtime.",unsupported:"This Runtime does not provide the MPA scheduled tasks API.",invalidResponse:"The tasks API returned unrecognized data. Check the Runtime version.",loadFailed:"Could not load tasks. Check the network and Runtime status, then refresh.",pagination:"Runtime task pagination",total:"{{total}} tasks",previous:"Previous",next:"Next",columns:{name:"Task name",enabled:"Status",schedule:"Schedule",next:"Next run",last:"Latest result"},schedule:{once:"Once",interval:"Interval",daily:"Daily",weekly:"Weekly",monthly:"Monthly",cron:"Cron"},search:"Search tasks",executionCount:"Executions",successRate:"Success rate",prompt:"Task content",manage:{view:"Task view",list:"List",calendar:"Calendar",create:"Create scheduled task",edit:"Edit task",copy:"Copy",delete:"Delete",detail:"Details",run:"Run now",name:"Task",lastRun:"Last execution",schedule:"Schedule",lastStatus:"Last execution status",agent:"Executing Agent",actions:"Actions",all:"All statuses",Pending:"Not run yet",Queued:"Queued",Running:"Running",Succeeded:"Succeeded",Failed:"Failed",TimedOut:"Timed out",Cancelled:"Cancelled",Skipped:"Skipped",overview:"Execution statistics:",prompt:"Task content",timezone:"Time zone",localTime:"Execution time (device time zone)",time:"Time",Once:"Once",Interval:"Interval",Daily:"Daily",Weekly:"Weekly",Monthly:"Monthly",Cron:"Cron expression",seconds:"seconds",interval:"Interval in seconds",weekdays:"Weekdays (1 = Monday, 7 = Sunday; comma separated)",monthDays:"Days of month (1–31; comma separated)",delivery:"Delivery",Web:"Web",Feishu:"Feishu",target:"Feishu recipient ID",enabled:"Enable task",cancel:"Cancel",save:"Save",saving:"Saving",required:"Enter a task name, Agent ID, prompt and delivery target.",timezoneInvalid:"Enter a valid IANA time zone, such as Asia/Shanghai.",futureTime:"Choose a future execution time.",intervalInvalid:"Interval must be an integer between 30 and 31536000 seconds.",daysInvalid:"Enter valid, unique days.",history:"Execution history",duration:"Duration",result:"Result / session",noRuns:"No executions yet.",conflict:"The task changed or the request conflicts. Close the dialog, refresh and retry.",invalid:"Request validation failed. Check user identity, execution time, Agent ID and task settings.",queued:"Execution request submitted.",saved:"Task updated.",deleteConfirm:"Delete “{{name}}”? It will no longer be scheduled.",calendarZone:"Display time zone:",prevMonth:"Previous month",nextMonth:"Next month",today:"Today",nextOnly:"Next only",calendarHint:"The calendar shows expected executions. Complex Cron expressions show only the next execution returned by the server."}},nhe={backToList:"Back to scheduled tasks",cancel:"Cancel",cancelQueue:"Cancel queued run",cancelQueueFirst:"Cancel the queued run first",cancelling:"Cancelling…",closeDrawer:"Close panel",collapse:"Collapse",connectingRuntime:"Connecting to Runtime…",createScheduledTask:"Create scheduled task",createTask:"Create task",delete:"Delete",deleteTask:"Delete task",edit:"Edit",enable:"Enable",expand:"Expand",pause:"Pause",refresh:"Refresh",refreshHistory:"Refresh run history",rerun:"Run again",retry:"Retry",runNow:"Run now",saveChanges:"Save changes",saving:"Saving…",stop:"Stop run",stopRun:"Stop this run",stopRunFirst:"Stop the current run first",stopping:"Stopping…",viewDetails:"View details"},ihe={cancelDescription:"This Session will be cancelled. Future scheduled runs will remain enabled.",cancelTitle:"Stop this run?",deleteDescription:"“{{name}}” and its complete run history will be permanently deleted.",deleteTitle:"Delete scheduled task?"},rhe={configuration:"Task configuration",nextRun:"Next run",pageLabel:"Scheduled task details",region:"Region",runtime:"Runtime",status:"Task status"},she={createTitle:"Create scheduled task",description:"Each trigger creates a separate Session for the Runtime Agent.",editTitle:"Edit scheduled task"},ahe={minutesSeconds:"{{minutes}} min {{seconds}} sec",seconds:"{{count}} sec"},ohe={cronExpression:"Cron expression",cronHelp:"Enter minute, hour, day of month, month, and day of week.",dailyTime:"Daily run time",enableAfterCreate:"Enable after creation",enableHelp:"The task will run at its next scheduled time after it is enabled.",name:"Task name",namePlaceholder:"For example: Generate a daily operations summary",noRuntime:"No Runtime available",prompt:"Execution prompt",promptPlaceholder:"Enter the text to send to the Agent on every run",runAt:"Run time",runtimeAgent:"Runtime Agent",runtimeHelp:"The task always uses the Runtime's currently active version.",runtimePlaceholder:"Select a Runtime Agent",schedule:"Schedule",scheduleType:"Schedule type",timezone:"Time zone",weekday:"Day of week"},lhe={all:"All"},che={description:"Each run uses a separate Session. Results and errors are retained.",duration:"Duration: {{duration}}",emptyDescription:"Runs will appear here after the task is triggered or run manually.",emptyTitle:"No runs yet",errorDetails:"Error details",finalAnswer:"Final answer",loadFailed:"Unable to load run history",loadFailedDescription:"Check the Studio service and try again.",session:"Session",title:"Run history"},uhe={cancelRequested:"Stop request submitted.",created:"Task created.",deleted:"The task and its run history were deleted.",enabled:"Task enabled.",paused:"Task paused.",queued:"Task queued and will start within one minute.",requeued:"Task queued again and will start within one minute.",updated:"Task updated."},dhe={filterLabel:"Filter scheduled tasks by status",listLabel:"Scheduled task list",loadFailed:"Unable to load scheduled tasks",loadFailedDescription:"Check the Studio service and try again.",title:"Cronjob"},fhe={cron:"Cron {{cron}}{{zone}}",daily:"Daily at {{time}}{{zone}}",once:"Once · {{date}}{{zone}}",weekly:"{{weekday}} at {{time}}{{zone}}"},hhe={daily:"Daily",once:"Once",weekly:"Weekly"},phe={cancelled:"Cancelled",enabled:"Enabled",failed:"Failed",notRun:"Not run yet",paused:"Paused",pending:"Preparing",queued:"Queued",retrying:"Retrying",running:"Running",skipped:"Skipped",success:"Succeeded"},mhe={cronFields:"A Cron expression must contain five fields, for example 0 9 * * *.",nameRequired:"Enter a task name.",promptRequired:"Enter the text to send to the Agent on each run.",runtimeAppMissing:"The Runtime Agent did not return an appName. Confirm that the Runtime is ready and compatible.",runtimeRequired:"Select an available Runtime Agent.",timeRequired:"Select a run time."},ghe={friday:"Friday",monday:"Monday",saturday:"Saturday",sunday:"Sunday",thursday:"Thursday",tuesday:"Tuesday",wednesday:"Wednesday"},Yze={mpa:the,actions:nhe,confirm:ihe,detail:rhe,drawer:she,duration:ahe,fields:ohe,filters:lhe,history:che,notices:uhe,page:dhe,schedule:fhe,scheduleTypes:hhe,status:phe,validation:mhe,weekdays:ghe},Zze=Object.freeze(Object.defineProperty({__proto__:null,actions:nhe,confirm:ihe,default:Yze,detail:rhe,drawer:she,duration:ahe,fields:ohe,filters:lhe,history:che,mpa:the,notices:uhe,page:dhe,schedule:fhe,scheduleTypes:hhe,status:phe,validation:mhe,weekdays:ghe},Symbol.toStringTag,{value:"Module"})),bhe="Quick-create Agent",yhe="Agent type",vhe="Close",xhe="Deploy",whe="Preview",Ohe="Configuration download started",khe="Download failed — try again",She="Review {{count}} configuration issues",Ehe="Custom",Che="Custom {{field}}",Ahe="Enter a custom value",The="This model declares no reasoning levels; the service settings apply",_he="Add a model to this provider first",jhe="Select a provider first",Nhe="Select an option",Rhe="Optional",Ihe="Default model, Agent preset and permissions apply to new sessions. The preset must exist in the deployed Harness",Phe="Enter an environment variable name only; supply its secret value at deployment",Dhe="read-only allows reading; workspace-write allows workspace edits; danger-full-access allows full access without approval",Mhe="allowedModels lists the models sub-agents may select. Enabling selection requires at least one provider/model pair",Lhe="Add a custom model service using its endpoint, protocol and model IDs, including compatible Volcengine and BytePlus services",$he="Covers common native settings. Other plugin parameters and preset files are not included yet",Fhe="Native configuration reference",Bhe="Provider {{index}}",Uhe="Model {{index}}",Qhe="Add provider",zhe="Remove provider {{index}}",Vhe="Add model",Hhe="Remove model {{index}}",qhe="Add allowed model",Whe="Remove allowed model {{index}}",Khe="Remove",Ghe="Enter the service’s model ID",Xhe={provider:"Provider {{index}}",model:"Model {{index}}"},Yhe={defaults:"Session defaults",deepseek:"DeepSeek model service",providers:"Custom model providers",shell:"Command execution",loop:"Tool calls",subagents:"Sub-agent model selection",search:"DeepSeek web search"},Zhe={id:"Provider ID",displayName:"Display name",baseURL:"Base URL",api:"API protocol",apiKeyEnv:"API key environment variable"},Jhe={id:"e.g. company-models",displayName:"Optional; defaults to the provider ID",baseURL:"https://…/v1",api:"Select a protocol",apiKeyEnv:"e.g. MODEL_API_KEY"},epe={id:"Model ID",name:"Display name",contextWindow:"Context capacity",maxTokens:"Maximum output capacity"},tpe={positive:"Enter a number greater than zero",integer:"Enter a valid positive integer",env:"Use letters, digits and underscores; do not start with a digit",url:"Enter an HTTP or HTTPS URL without credentials",option:"Select a supported native option",required:"Complete this field",duplicate:"This ID or model pair already exists",providerId:"Start with a lowercase letter; use lowercase letters, digits, dots, underscores or hyphens; reserved IDs are unavailable",routes:"Add at least one complete provider/model pair",modelPair:"Enter a model ID for this custom provider",unknownProvider:"Add this custom provider first",unknownModel:"Enter a model ID configured for this provider",timer:"Enter a timeout greater than 0 and no more than 2147483647 ms"},npe={"agent-default-model_provider":"Default provider","agent-default-model_model":"Default model","agent-default-model_reasoningEffort":"Default reasoning effort","agent-presets_default":"Default Agent preset",permission_defaultPreset:"Default permission preset","llm-deepseek_apiKeyEnv":"API key environment variable","llm-deepseek_baseURL":"Base URL","llm-deepseek_thinking":"Thinking mode","llm-deepseek_reasoningEffort":"Reasoning effort","llm-deepseek_maxTokens":"Output limit per request","llm-deepseek_defaultContextWindow":"Default context capacity","llm-deepseek_streamIdleTimeoutMs":"Stream idle timeout (ms)",bash_timeoutMs:"Default execution timeout (ms)",bash_maxTimeoutMs:"Maximum execution timeout (ms)",bash_maxOutputBytes:"Output limit (bytes)","agent-loop_maxParallelToolCalls":"Parallel tool-call limit","subagent-model-selection_enabled":"Enable model selection","web-search-deepseek_apiKeyEnv":"API key environment variable","web-search-deepseek_baseURL":"Search base URL","web-search-deepseek_model":"Search model","web-search-deepseek_apiVersion":"API version","web-search-deepseek_maxTokens":"Search output limit","web-search-deepseek_maxUses":"Maximum search uses"},ipe="Cancel",rpe="Back to creation methods",spe="DeepSeek Harness configuration",Jze={title:bhe,agentType:yhe,close:vhe,continue:"Continue",deploy:xhe,preview:whe,export:"Export configuration",downloaded:Ohe,downloadFailed:khe,validationSummary:She,customValue:Ehe,customField:Che,enterCustomValue:Ahe,reasoningUnavailable:The,modelsUnavailable:_he,selectProviderFirst:jhe,selectOption:Nhe,optional:Rhe,defaultsHelp:Ihe,credentialHelp:Phe,permissionHelp:Dhe,routesHelp:Mhe,providersHelp:Lhe,coverage:$he,source:Fhe,provider:Bhe,model:Uhe,addProvider:Qhe,removeProvider:zhe,addModel:Vhe,removeModel:Hhe,addRoute:qhe,removeRoute:Whe,remove:Khe,modelIdPlaceholder:Ghe,route:Xhe,sections:Yhe,providerFields:Zhe,providerPlaceholders:Jhe,modelFields:epe,errors:tpe,fields:npe,cancel:ipe,back:rpe,pageTitle:spe},eVe=Object.freeze(Object.defineProperty({__proto__:null,addModel:Vhe,addProvider:Qhe,addRoute:qhe,agentType:yhe,back:rpe,cancel:ipe,close:vhe,coverage:$he,credentialHelp:Phe,customField:Che,customValue:Ehe,default:Jze,defaultsHelp:Ihe,deploy:xhe,downloadFailed:khe,downloaded:Ohe,enterCustomValue:Ahe,errors:tpe,fields:npe,model:Uhe,modelFields:epe,modelIdPlaceholder:Ghe,modelsUnavailable:_he,optional:Rhe,pageTitle:spe,permissionHelp:Dhe,preview:whe,provider:Bhe,providerFields:Zhe,providerPlaceholders:Jhe,providersHelp:Lhe,reasoningUnavailable:The,remove:Khe,removeModel:Hhe,removeProvider:zhe,removeRoute:Whe,route:Xhe,routesHelp:Mhe,sections:Yhe,selectOption:Nhe,selectProviderFirst:jhe,source:Fhe,title:bhe,validationSummary:She},Symbol.toStringTag,{value:"Module"})),ape="Report an issue",ope="Description",lpe="Common issues",cpe="Cancel",upe="Done",dpe="Submit feedback",fpe="Submitting…",hpe={title:"Feedback submitted. Thank you.",description:"The AgentKit team will review your report as soon as possible."},ppe={close:"Close issue report",intro:"Select the issues you encountered and add any useful details.",privacy:"Your conversation data will be shared with the AgentKit team. Please protect sensitive information.",descriptionPlaceholder:"Describe what happened (optional)",issues:{slow:"Slow execution",crash:"Runtime crash",incorrect:"Inaccurate result",tool_error:"Tool call failed",other:"Other issue"}},mpe={description:"Tell us about a problem you encountered while using AgentKit Studio.",module:"Area",modules:{conversation:"Conversation",agents:"Agents",applications:"Automations",search:"Search",other:"Other"},commonIssuesMultiple:"Common issues (select all that apply)",issueTypes:"Issue types",issues:{page_slow:"Page loads slowly",feature_unavailable:"Feature unavailable",display_error:"Display issue",no_response:"Action has no response",other:"Other issue"},descriptionPlaceholder:"Describe the page, action, and what happened",quickAdd:"Quick add",suggestionsLabel:"Suggested descriptions",suggestions:{noResponse:"Nothing happens after I click",loading:"The page remains in a loading state",incomplete:"Some content is missing or clipped",error:"An error appears after the action"},privacy:"Your data will be shared with the AgentKit team. Please protect sensitive information."},tVe={title:ape,descriptionLabel:ope,commonIssues:lpe,cancel:cpe,done:upe,submit:dpe,submitting:fpe,success:hpe,dialog:ppe,page:mpe},nVe=Object.freeze(Object.defineProperty({__proto__:null,cancel:cpe,commonIssues:lpe,default:tVe,descriptionLabel:ope,dialog:ppe,done:upe,page:mpe,submit:dpe,submitting:fpe,success:hpe,title:ape},Symbol.toStringTag,{value:"Module"})),gpe={back:"Back",close:"Close"},bpe={title:"Optimize migrated project",closeAria:"Close optimization dialog"},ype={title:"Migrated projects",description:"Manage migrated source versions or continue optimizing any version.",libraryTitle:"Projects and versions",libraryDescription:"View, download, deploy, or compare source versions, or continue optimizing any version.",emptyTitle:"No migrated projects yet",emptyDescription:"Migrated source code will be saved here automatically."},vpe={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any (universal migration)"},xpe={awaitingUpload:"Awaiting upload",analyzing:"Analyzing",needsInput:"Needs input",analysisReady:"Awaiting confirmation",migrating:"Migrating",validating:"Validating",packaging:"Packaging",succeeded:"Completed",succeededWithWarnings:"Completed with notices",partial:"Partially completed",failed:"Failed",cancelled:"Stopped",expired:"Expired"},wpe={evaluationPending:"Evaluation pending",evaluationRunning:"Evaluating",waitingDataset:"Evaluation cases pending",waitingEnvironment:"Environment variables required",evaluationFailed:"Migrated, evaluation incomplete",evaluationBlocked:"Migrated, evaluation needs attention",evaluationCancelled:"Migrated, evaluation cancelled",resultUnavailable:"Result unavailable",environmentExpired:"Environment expired"},Ope={partialReady:"Migration output is ready, but delivery is incomplete. Review the migration notices.",readyWithWarnings:"Migration output is ready. Review the migration notices.",ready:"Migration output is ready."},kpe={passed:"Output verification passed",failed:"Output verification failed",degraded:"Output verification incomplete"},Spe={session:"Create migration environment",upload:"Upload project",analysis:"Analyze project"},Epe={agentNameRequired:"Enter an Agent name",agentNameInvalid:"Agent names must be 1–63 characters, contain only lowercase letters, numbers, and hyphens, and start and end with a letter or number"},Cpe={seconds:"{{seconds}} sec",minutesSeconds:"{{minutes}} min {{seconds}} sec"},Ape={savedUnaffected:"Saved projects are unaffected",savingUnaffected:"Source is being saved and will be unaffected once complete",activeDetail:"Task history and temporary output will become unavailable after expiration",oneHour:"Temporary migration environment is retained for 1 hour",ended:"Temporary migration environment has ended",savedAvailable:"Saved projects remain available to view, download, deploy, or optimize",unavailable:"Task history and temporary output are no longer available",countdown:"Temporary migration environment ends in {{minutes}} min {{seconds}} sec",expiredSavedMessage:"The temporary migration environment has ended. Saved projects are unaffected.",expiredMessage:"The temporary migration environment has ended. Task history and temporary output are no longer available."},Tpe={recommended:"Recommended migration method",scope:"Migration scope",excluded:"Out of scope",viewEvidence:"View analysis evidence",viewAssumptions:"View key assumptions",viewSourceEvidence:"View source evidence"},_pe={ariaLabel:"Codex activity",title:"Codex activity",startingAnalysis:"Codex is starting the analysis…",startingMigration:"Codex is starting the migration…",loadError:"Codex activity is temporarily unavailable. The current task is unaffected.",liveAnalyzing:"Analyzing the project",liveMigrating:"Running the migration",liveValidating:"Verifying the migration",livePackaging:"Packaging the migration",liveDelivery:"Reviewing the delivery"},jpe={title:"Migration output",fileTooLarge:"This file exceeds 2 MiB. Download the complete output to view it.",unsupportedPreview:"This file cannot be previewed here. Download the complete output to view it.",filesAria:"Migration output files",searchAria:"Search output files",searchPlaceholder:"Search files",limit:"Showing the first {{count}} items. Search for a specific file.",noSelection:"No file selected",noPreview:"No files available to preview.",loadingFile:"Loading output file…",startupFile:"Startup file",fileCountLabel:"Files",saved:"Source has been saved. You can view, download, deploy, or optimize it.",saving:"Output is ready and the source version is being saved.",deployReady:"Output is available to preview, download, and deploy. Waiting for source save status.",deployUnavailable:"Output is available to preview and download, but its current delivery status does not support deployment.",viewProjects:"View migrated projects",downloading:"Downloading…",downloadZip:"Download ZIP",deployTitle:"Deploy migration output",deployUnavailableTitle:"Current delivery status does not support deployment",deployRuntime:"Deploy to Runtime",fileCount:"{{count}} files",startup:"Startup file {{module}}",loading:"Loading migration output…"},Npe={retiring:"Retiring soon",currentDefault:"Current default model",loadError:"Failed to load models",label:"Model",placeholder:"Select a model"},Rpe={zipOnly:"Select a local project in .zip format.",invalidName:"The ZIP file name is invalid. Rename the file and select it again.",tooLarge:"The project ZIP cannot exceed {{size}}.",empty:"The project ZIP cannot be empty.",removeAria:"Remove project ZIP",reselectPrompt:"Select the project ZIP again",selectPrompt:"Select or drop a local project ZIP",reselect:"Select again",selectZip:"Select ZIP",continue:"Continue upload",start:"Upload and analyze",inputAria:"Select a local project ZIP",retention:"The temporary migration environment is retained for 1 hour after creation. Successfully saved source versions are unaffected.",uploading:"Uploading…",sizeHint:"Project ZIP, up to {{size}}"},Ipe={requiredPlaceholder:"Enter {{key}}",optionalPlaceholder:"Optional: {{key}}",notReady:"Migration output is not ready yet.",back:"Back to migration results"},Ppe={backToAddAgent:"Back to Add Agent",title:"Migrate existing project",newMigration:"New migration",recent:"Recent migrations",loadingSessions:"Loading migration sessions…",noSessions:"No migration sessions",heading:"Migrate an existing Agent project",intro:"Upload a local project ZIP. Codex will first perform a read-only analysis, then ask you to confirm the migration method.",backToHome:"Migration home",navigation:"Migration navigation",showMore:"Show more",showLess:"Show less",projectName:"Project name",status:"Status",createdAt:"Created",actions:"Actions",openTask:"Open migration {{name}}",continueTask:"Continue",viewTask:"View"},Dpe={stop:"Stop migration",stopping:"Stopping…",cancel:"Cancel",reload:"Reload",refreshStatus:"Refresh status"},Mpe={unavailable:"Migration is currently unavailable",defaultReason:"Dev Sandbox is currently unavailable. Contact your administrator to check the configuration."},Lpe={creatingSandbox:"Creating Dev Sandbox",initializing:"Initializing the migration workspace and checking AgentKit CLI, Codex, and migration capabilities. The project will upload automatically when the environment is ready.",elapsed:"Elapsed: {{duration}}",uploadThenAnalyze:"Read-only analysis will start automatically after the ZIP upload completes.",analyzing:"Codex is identifying the framework, entry point, and migration boundaries. No migration changes are being made.",migrationLocked:"Attachments and migration settings cannot be changed while migration is running. Wait for the task to finish or stop it.",analysisPaused:"Read-only analysis is paused. Answer only the questions below. After submission, analysis will continue in the same environment without starting the migration.",analysisComplete:"Read-only analysis is complete. Review the recommendation and confirm the final migration method.",awaitingUpload:"The migration environment is ready. Select the local ZIP again to continue uploading.",expiredTitle:"Migration environment expired",expiredDescription:"Migration content and output can no longer be previewed, downloaded, or deployed. If the Runtime deployment completed, return to the Agents page to continue using it.",unsupportedTitle:"This ZIP cannot be migrated yet",unsupportedHint:"Update the project as instructed, then create a new migration and upload it again.",failedTitle:"Migration incomplete",cancelled:"This migration was stopped. Create a new migration and upload the project again."},$pe={ariaLabel:"Provide project analysis details",title:"Additional information needed for analysis",description:"The attachment stays locked; submitting continues read-only analysis only",submitting:"Continuing analysis…",submit:"Submit and continue analysis"},Fpe={ariaLabel:"Answer the questions the migration needs you to decide",title:"The migration needs your answer",description:"Your answer continues the current step instead of restarting it",other:"Other",otherPlaceholder:"Or type your own answer",submitting:"Submitting your answer…",submit:"Submit answer and continue"},Bpe={ariaLabel:"Confirm migration method",title:"Confirm migration method",framework:"Migration method",frameworkPlaceholder:"Select a migration method",agentName:"Agent name",entry:"Project entry point",entryPlaceholder:"Select a project entry point",entryExample:"For example, agent.py:agent",consent:"By selecting “Confirm and start migration,” you confirm the migration scope, exclusions, and key assumptions above.",starting:"Starting migration…",start:"Confirm and start migration"},Upe={setup:{title:"Migration effect evaluation",description:"Evaluation cases run automatically after migration.",on:"On",off:"Off",unavailable:"Migration effect evaluation is unavailable in this environment.",casesTitle:"Evaluation cases",casesDescription:"Add at least one case. Expected outcomes and criteria are optional.",configuredSummary:"{{count}} cases · {{preset}} · {{dimensions}}",incompleteSummary:"{{count}} cases need content · {{preset}} · {{dimensions}}",dimensionSummary:"{{count}} dimensions",editSettings:"Edit settings",viewSettings:"View settings",lockedTitle:"Evaluation cases",lockedDescription:"Cases cannot change after upload starts.",closeAria:"Close evaluation settings",done:"Finish setup",close:"Close"},tabs:{label:"Migration task content",migration:"Migration",evaluation:"Evaluation",waitingMigration:"Waiting for migration",waitingConfiguration:"Setup required",running:"Running",completed:"Completed",issue:"Needs attention"},bulk:{open:"Paste multiple",label:"Enter one case per line",placeholder:`Check the status of today's orders -Summarize the result in three points`,preview:"{{count}} cases will be added",confirm:"Add cases"},case:{title:"Case {{index}}",add:"Add case",moveUp:"Move case {{index}} up",moveDown:"Move case {{index}} down",copy:"Duplicate",delete:"Delete",userInput:"User input",userInputPlaceholder:"For example: Check the status of today's orders",expectedOutcome:"Expected outcome (optional)",expectedOutcomePlaceholder:"Describe what the Agent should accomplish; exact wording is not required",criteria:"Requirements (optional)",addCriterion:"Add requirement",criterionLabel:"Requirement {{index}}",criterionPlaceholder:"For example: Include the order ID and current status",removeCriterion:"Remove requirement {{index}}"},advanced:{title:"Advanced settings",standard:"Standard evaluation",standardDescription:"Uses 3 dimensions by default: semantic fidelity, output constraints, and workflow/tool fidelity.",custom:"Custom dimensions",customDescription:"Select one or more dimensions based on business risk.",lockedDescription:"The evaluation method and dimensions cannot change after upload starts."},dimension:{semantic_fidelity:"Semantic fidelity",output_contract:"Output contract",workflow_tool_fidelity:"Workflow and tool fidelity",context_memory_fidelity:"Context and memory fidelity",boundary_error_fidelity:"Boundary and error fidelity",safety_refusal_fidelity:"Safety and refusal fidelity"},dimensionDescription:{semantic_fidelity:"Checks whether intent, conclusions, and key facts remain consistent.",output_contract:"Checks required fields, structure, language, and formatting constraints.",workflow_tool_fidelity:"Checks observable workflow branches and tool-driven behavior.",context_memory_fidelity:"Checks supported multi-turn context and memory behavior.",boundary_error_fidelity:"Checks invalid input, missing information, and dependency failures.",safety_refusal_fidelity:"Checks existing authorization, refusal, and sensitive-data boundaries."},validation:{caseCount:"Keep between 1 and {{count}} cases.",dimensionRequired:"Select at least one evaluation dimension.",userInputRequired:"Enter case input.",userInputBytes:"A case cannot exceed 32 KiB.",expectedOutcomeBytes:"The expected outcome cannot exceed 16 KiB.",criteriaCount:"A case can contain at most {{count}} requirements.",criterionRequired:"Requirements cannot be empty.",criterionBytes:"One requirement cannot exceed 2 KiB.",datasetBytes:"All evaluation cases cannot exceed 10 MiB."},dataset:{invalidLockResponse:"The service did not confirm that evaluation cases were saved. Try again.",loadingSettings:"Loading evaluation settings…",loadSettingsFailed:"Evaluation settings could not be loaded.",retryLoadSettings:"Reload",missing:"No saved evaluation cases were found. Enter and save them again.",saveWarning:"Evaluation cases were not saved. Migration continues.",retrySave:"Save evaluation cases again",saving:"Saving…"},state:{disabled:"Evaluation is off",waiting_dataset:"Waiting for evaluation cases",pending:"Evaluation starts automatically after migration",preparing:"Preparing the evaluation environment…",waiting_environment:"Runtime environment variables are required",deploying:"Deploying a temporary Runtime…",executing:"Running evaluation cases…",judging:"Running evaluation analysis…",aggregating:"Aggregating evaluation results…",completed:"Evaluation completed",failed:"Evaluation incomplete",blocked:"Evaluation requires attention before it can continue",cancelled:"Evaluation cancelled"},progress:{label:"Migration and migration effect evaluation progress",migration:"Migration",evaluation:"Migration effect evaluation",notStarted:"Not started",inProgress:"In progress",completed:"Complete",waitingConfiguration:"Waiting for setup",issue:"Needs attention"},environment:{description:"Enter the environment variables required by the temporary Runtime.",security:"Used only for this evaluation.",optional:"Optional",submit:"Submit and continue evaluation",submitting:"Submitting…"},execution:{preparing:"Prepare evaluation",preparingDetail:"Validate migration output and {{count}} evaluation cases",deploying:"Start Runtime",deployingDetail:"Prepare {{runtime}}",runtimeFallback:"isolated runtime",executing:"Run cases",executingDetail:"Run {{count}} cases and capture output",judging:"Run evaluation analysis",judgingDetail:"Evaluate {{cases}} cases · {{dimensions}} dimensions",aggregating:"Generate evaluation report",aggregatingDetail:"Aggregate scores and evidence into an HTML report",waiting:"Waiting",running:"Running",failed:"Failed",complete:"Completed"},result:{title:"Execution progress",attempt:"Evaluation attempt {{attempt}}",pending:"Waiting for migration to complete",retry:"Run evaluation again",retrying:"Retrying…",failureStage:"Failed at",errorCode:"Error code",taskId:"Task ID",diagnosticAttempt:"Evaluation attempt",runtime:"Runtime",errorDetails:"Error details",diagnosticField:"{{label}}: {{value}}",diagnosticHeading:"{{label}}:",loadingReport:"Loading the evaluation report…",reportTitle:"HTML evaluation report",reportHtmlDescription:"View or download the HTML report.",viewReport:"View report",reportDrawerDescription:"Scores, differences, and evidence",closeReport:"Close",closeReportAria:"Close evaluation report",reportPreviewTitle:"Migration effect evaluation report preview",reportSummary:"Evaluation summary",reportVersion:"Dataset {{version}} · Prompt v{{prompt}}",downloadReport:"Download full report",downloadingReport:"Downloading…",overallScore:"Overall fidelity",scoreScale:"0–100; N/A when evidence is insufficient",evidenceCoverage:"Evidence coverage",coverageDetail:"{{scored}} of {{total}} dimensions evidenced",executionSuccess:"Execution success",executionDetail:"{{succeeded}} of {{total}} cases completed",naCount:"N/A count",naDescription:"Insufficient evidence; excluded from scores",gapDescription:"Migration gap summary",lowestScoringCases:"Lowest-scoring cases",executionFailures:"Execution issues",criticalEvidence:"Critical evidence",limitations:"Evaluation limitations",viewEvidence:"View results and evidence for {{count}} cases",outputTruncated:"Long output was truncated",executionState:{succeeded:"Execution completed",failed:"Execution issue"},severityLabel:"Severity: {{severity}}",severity:{none:"None",low:"Low",medium:"Medium",high:"High",critical:"Critical",unknown:"Unknown"},evidenceSource:{user_reference:"Expected outcome",user_criteria:"Provided requirements",source_contract:"Source contract",observed_output:"Observed output",runtime_observation:"Raw Runtime data",deterministic_assertion:"Deterministic assertion"},listSeparator:", "}},Qpe={closeAria:"Dismiss error",loadFailed:"Could not load migration data. Try again.",refreshFailed:"Could not refresh the migration status. Try again."},zpe={title:"Stop the current migration?",description:"Stopping ends the current analysis or migration process. Completed steps will not continue."},iVe={common:gpe,optimization:bpe,projects:ype,framework:vpe,state:xpe,historyStatus:wpe,task:Ope,verification:kpe,transfer:Spe,validation:Epe,duration:Cpe,expiry:Ape,analysis:Tpe,activity:_pe,artifact:jpe,model:Npe,upload:Rpe,deployment:Ipe,workspace:Ppe,actions:Dpe,capability:Mpe,conversation:Lpe,questions:$pe,pendingInput:Fpe,confirmation:Bpe,evaluation:Upe,errors:Qpe,stopDialog:zpe},rVe=Object.freeze(Object.defineProperty({__proto__:null,actions:Dpe,activity:_pe,analysis:Tpe,artifact:jpe,capability:Mpe,common:gpe,confirmation:Bpe,conversation:Lpe,default:iVe,deployment:Ipe,duration:Cpe,errors:Qpe,evaluation:Upe,expiry:Ape,framework:vpe,historyStatus:wpe,model:Npe,optimization:bpe,pendingInput:Fpe,projects:ype,questions:$pe,state:xpe,stopDialog:zpe,task:Ope,transfer:Spe,upload:Rpe,validation:Epe,verification:kpe,workspace:Ppe},Symbol.toStringTag,{value:"Module"})),Vpe={loading:"Loading…",searchLabel:"Search {{label}}",searchPlaceholder:"Search {{label}}",retry:"Retry",noMatches:"No matches",noOptions:"No options available",selection:"{{label}}: {{value}}"},Hpe={badge:"All new",view:"See what's new",title:"What's new",defaultNotes:{multiRegion:"Multi-region agents: load Beijing and Shanghai Runtimes in parallel, with more available as you scroll.",switchAgent:"Switch in conversation: choose an agent beside the composer and start a new conversation immediately.",visualCanvas:"Visual execution canvas: inspect multi-agent structures on a horizontal canvas with fullscreen support."}},qpe={label:"New conversation workspace",agent:"Agent",skill:"Skill customization",video:"Video creation"},Wpe={select:"Select conversation mode",agent:{label:"Agent",description:"Chat with the selected Agent"},builtin:{label:"Built-in Agent",description:"Use an Agent provided by the platform"},codex:{label:"Codex Agent",description:"Run tasks in a sandbox"},deepseekHarness:{label:"DeepSeek Harness",description:"Open the DeepSeek Harness workspace"},arkClaw:"ArkClaw",hermes:"Hermes Agent",checking:"Checking configuration",notConfigured:"Not configured by an administrator",unavailable:"Unavailable"},Kpe={select:"Select Agent",typesLabel:"Agent types",listLabel:"{{type}} list",types:{agent:"Agent",general:"General Agent",mpa:"MPA Agent",codex:"Codex Agent",deepseekHarness:"DeepSeek Harness",openclaw:"OpenClaw Agent",hermes:"Hermes Agent"},loading:"Loading Agents",reload:"Reload",empty:"No {{type}} yet",emptyLocal:"No local Agents yet",emptyGeneral:"No General Agents yet",createHint:"Create one from the Agents page",localHint:"Check the directory where Studio was started",waking:"Waking up",opening:"Opening",connecting:"Connecting",loadingMore:"Loading",loadMore:"Load more",runtimeTimeout:"Loading Agents timed out after 15 seconds. Check the network or Runtime service and retry.",loadGeneral:"Load General Agents",loadType:"Load {{type}}",connectGeneral:"Connect to General Agent",openLocal:"Open local Agent",openType:"Open {{type}}",wakingHint:"Waking the agent. This may take some time."},Gpe={spaceAria:"Skill spaces",configuration:"Skill customization settings",actions:{create:"Generate Skill",optimize:"Optimize Skill"},selectAction:"Select a Skill customization action",actionList:"Skill customization actions",style:"Style",selectStyle:"Select style",model:"Model",selectModel:"Select model",styles:{concise:"Concise and practical",strict:"Rigorous and reliable",tutorial:"Tutorial-friendly",automation:"Automation-first"},modelLoadFailed:"Failed to load model configuration",spaceLoadFailed:"Failed to load Skill Spaces",skillLoadFailed:"Failed to load Skills",unnamedSpace:"Unnamed Skill Space",space:"Skill Space",select:"Select Skill",selectAria:"Select Skill: {{skill}}",loadingSpaces:"Loading Skill Spaces",reload:"Reload",emptySpaces:"No Skill Spaces yet",skillList:"{{space}} Skill list",loadingSkills:"Loading Skills",emptySkills:"No Skills yet"},Xpe={modes:{auto:"Auto detect",text_to_video:"Text to video",reference_to_video:"Reference to video",video_editing:"Video editing",video_extension:"Video extension",first_last_frame:"First and last frames"},taskNames:{auto:"Video generation",text_to_video:"Text-to-video",reference_to_video:"Reference-to-video",video_editing:"Video editing",video_extension:"Video extension",first_last_frame:"First-and-last-frame generation"},controls:{label:"Video creation settings",aspectRatio:"Aspect ratio",selectAspectRatio:"Select aspect ratio",resolution:"Resolution",selectResolution:"Select resolution",duration:"Duration",durationShort:"{{count}}s",durationAria:"Video duration: {{count}} seconds",lastFrame:"Last frame",lastFrameHelper:"Add the video's ending frame",assistImage:"Supporting image",referenceImage:"Reference image",assistImageHelper:"Add visual guidance",imageHelper:"Supports common image formats",referenceVideo:"Reference video",videoHelper:"Supports common video formats",optional:"Optional",replace:"Replace",add:"Add",upload:"Upload {{label}}",replaceFile:"Replace {{label}}: {{name}}",removeFile:"Remove {{label}} {{name}}",storageUnavailable:"Persistent storage is not configured",loadingEnhancer:"Loading prompt enhancement model",enhancerHint:"Uses {{model}} for intent recognition and prompt enhancement",enhancerUnavailable:"Prompt enhancement model unavailable"},task:{title:"Video generation task",closeAria:"Close video generation task dialog",progressAria:"Video generation progress",optimizedPrompt:"Optimized prompt",processingAria:"{{task}} progress",waitingAria:"{{status}}, elapsed {{elapsed}}",elapsed:"Elapsed {{elapsed}}",previewAria:"Generated video preview",close:"Close",download:"Download video",retryOptimization:"Retry prompt optimization",retryGeneration:"Retry video generation",providerQueued:"Waiting for model scheduling",providerRunning:"Model generating",providerSubmitting:"Submitting task",queuedHint:"The task was submitted. Its status will update automatically when processing begins.",runningHint:"This may take several minutes. The video preview will appear here when complete.",backgroundHint:"You can close this dialog. The task will continue in the background.",successHint:"Your video is ready to preview or download.",activationHint:"Activate the service in the model console, then retry generation.",retryHint:"Fix the issue and retry the current step.",steps:{optimizationFailed:"Prompt optimization failed",optimizationDone:"Prompt optimization complete",optimizationActive:"Optimizing prompt",generationDone:"{{task}} complete",generationFailed:"{{task}} failed",generationQueued:"{{task}} queued",generationRunning:"Generating {{task}}",generationActive:"{{task}} in progress",generationPending:"Waiting for video generation",generationComplete:"Video generation complete"},elapsedHours:"{{hours}}h {{minutes}}m",elapsedMinutes:"{{minutes}}m {{seconds}}s",elapsedSeconds:"{{seconds}}s"}},Ype={compactSelect:Vpe,featureNotice:Hpe,workspace:qpe,mode:Wpe,agentPicker:Kpe,skill:Gpe,video:Xpe},sVe=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:Kpe,compactSelect:Vpe,default:Ype,featureNotice:Hpe,mode:Wpe,skill:Gpe,video:Xpe,workspace:qpe},Symbol.toStringTag,{value:"Module"})),Zpe="Review center",Jpe="Resource type to review",eme="Only administrators can access the review center",tme="Search name, submitter or version",nme="Review status",ime="Pending: {{count}}",rme="Requests: {{count}}",sme={skill:"Skills",agent:"Agents"},ame={all:"All statuses",pending:"Pending",approved:"Approved",returned:"Returned",approving:"Publishing"},ome={application:"Request",submitter:"Submitter",version:"Version",submittedAt:"Submitted at",status:"Status",actions:"Actions"},lme={details:"Details",detailsFor:"View request for {{name}}",approve:"Approve",approveFor:"Approve request for {{name}}",return:"Return",returnFor:"Return request for {{name}}",close:"Close",backToDetails:"Back to details",confirmApprove:"Confirm approval",confirmReturn:"Confirm return",clearFilters:"Clear filters",refresh:"Refresh",cancel:"Cancel",resumeApproval:"Resume publishing"},cme={title:"No review requests yet",description:"Submitted review requests will appear here",filteredTitle:"No matching requests",filteredDescription:"Try another search or change the review status"},ume={title:"Request details",sections:"Request detail sections",overview:"Overview",files:"Submitted files · {{count}}",requestType:"Request type",update:"Version update",firstRelease:"First release",source:"Source",source_skill:"{{name}}’s personal skill space",source_agent:"{{name}}’s development environment",destination:"Publication target",destination_skill:"Shared skill space",destination_agent:"Shared agent",region:"Region",visibility:"Visibility after publication",shared:"Visible to everyone",description:"Description",changes:"Submission notes",example:"Usage example",history:"Review history",submitted:"{{name}} submitted this request",versionFixed:"Reviewing the submitted version only",instructions:"Instructions",filesTab:"Submitted files",filesFailed:"Could not load submitted files",unknownAuthor:"Unknown submitter",reviewer:"Reviewed by",reviewedAt:"Reviewed at",approved:"{{name}} approved the request",returned:"{{name}} returned the request",unknownReviewer:"Unknown reviewer",approvedBy:"Approved by",returnedBy:"Returned by",comment:"Review comment",result:"Review result",noHistory:"This skill has not been submitted for review",pendingHint:"Waiting for an administrator to review",approvingHint:"Approval is confirmed and publishing to the shared space is in progress",approving:"{{name}} confirmed approval; publishing is in progress"},dme={failed:"The review space is unavailable",retry:"Retry"},fme={approveTitle:"Approve request",returnTitle:"Return request",approveDescription:"Approving {{name}} {{version}} makes this version available to everyone in the enterprise shared space",returnDescription:"Return {{name}} {{version}} and explain what the applicant should change",reason:"Return reason",reasonRequired:"Enter a return reason",reasonHelp:"Up to 256 characters, visible to the applicant",saving:"Saving…",failed:"Review failed, please try again",approved:"{{name}} was approved and shared",returned:"{{name}} was returned",comment:"Comment (optional)",commentHelp:"Up to 256 characters, visible to the applicant"},hme={title:"AI score",points:"{{score}} / 100",insufficient:"Insufficient evidence",status:{unscored:"Not scored",not_requested:"Not scored",queued:"Queued",running:"Scoring",completed:"Scored",failed:"Scoring failed"},loading:"Loading score…",starting:"Submitting for scoring…",loadFailed:"Could not load score",retryFailed:"Could not request scoring",failed:"Scoring failed, ask an administrator to retry",retry:"Score again",start:"Start scoring",reload:"Reload",download:"Download JSON",expand:"Expand",collapse:"Collapse",hint:"Scores apply to this submitted version and inform the administrator’s decision",dimensions:{safety:"Safety",usability:"Usability",completeness:"Completeness",reliability:"Reliability",maintainability:"Maintainability"},risks:"Risk flags",suggestions:"Suggestions",model:"Scoring model",rubric:"Rubric version",time:"Scored at",severity:{low:"Low risk",medium:"Medium risk",high:"High risk",critical:"Critical risk"},coverage:"Review coverage",coverageCount:"Reviewed {{included}} of {{total}} files",coverageIncomplete:"Some content was excluded, so scoring evidence is incomplete",omittedFile:"Not reviewed {{path}}: {{reason}}",truncatedFile:"Partially reviewed {{path}}: {{reason}}",originalError:"Original cloud error"},aVe={title:Zpe,category:Jpe,adminOnly:eme,search:tme,filterStatus:nme,pendingCount:ime,total:rme,kind:sme,status:ame,columns:ome,actions:lme,empty:cme,detail:ume,space:dme,decision:fme,score:hme},oVe=Object.freeze(Object.defineProperty({__proto__:null,actions:lme,adminOnly:eme,category:Jpe,columns:ome,decision:fme,default:aVe,detail:ume,empty:cme,filterStatus:nme,kind:sme,pendingCount:ime,score:hme,search:tme,space:dme,status:ame,title:Zpe,total:rme},Symbol.toStringTag,{value:"Module"})),pme={cancel:"Cancel",close:"Close",retry:"Retry",tryAgain:"Try again",closeDialog:"Close {{title}}",agentFallback:"{{agent}} Agent",unknownSource:"Unknown source"},mme={terminalTitle:"Terminal",browserTitle:"Sandbox browser",terminalSubtitle:"Connect to the interactive terminal for the current AgentKit Session",browserSubtitle:"View and control the browser in the current AgentKit Session",connecting:"Connecting…",connected:"Connected",notConnected:"Not connected",opening:"Opening {{title}}",connectingSession:"Connecting the tool to the current AgentKit Session.",openFailed:"Failed to open {{title}}"},gme={title:"Resume Codex conversation",subtitle:"Select a recently updated Thread from the current Sandbox Session",loading:"Loading conversation history",loadFailed:"Failed to load conversation history",empty:"No conversations to resume"},bme={title:"Codex permissions",subtitle:"Settings are saved to the current Sandbox Session and applied to all of its Threads",sandboxMode:"Sandbox mode",approvalPolicy:"Approval policy",approvalMethod:"Approval method",networkAccess:"Allow network access",networkAccessHelp:"Control external network access in workspace-write and read-only modes.",fullAccessWarning:"Full access disables file system and network isolation. Use it only for trusted tasks.",save:"Save permissions",sandboxChoices:{readOnly:{label:"Read only",detail:"Allow reading files without writing to the workspace."},workspaceWrite:{label:"Workspace write",detail:"Allow reading and modifying files in the current workspace."},fullAccess:{label:"Full access",detail:"Disable sandbox isolation for explicitly trusted tasks."}},approvalChoices:{untrusted:{label:"Untrusted commands only",detail:"Request approval only for operations Codex considers untrusted."},onRequest:{label:"On request",detail:"Allow Codex to ask you to approve commands or file changes when needed."},never:{label:"Never ask",detail:"Codex will not pause to request manual approval."}},reviewerChoices:{user:{label:"Ask me",detail:"Approval requests appear in Studio for you to decide."},autoReview:{label:"Automatic review",detail:"Use the Codex automatic review flow to handle approval requests."}}},yme={title:"Workspace",subtitle:"Choose the directory where the current Codex Thread runs commands and modifies files",absolutePath:"Absolute path",browse:"Browse",parent:"Parent directory",empty:"This directory has no subdirectories",locked:"The conversation has started and the workspace is locked. Start a new Sandbox Session to choose another workspace.",useDirectory:"Use this directory"},vme={fileTitle:"Allow file changes?",commandTitle:"Allow command execution?",subtitle:"Codex is waiting for your decision",workingDirectory:"Working directory",decline:"Decline",acceptOnce:"Allow once",acceptSession:"Allow for session"},xme={availableSkills:"Available Skills",selectModel:"Select model",commands:"Codex shortcuts",currentModel:"Current: {{model}}",loadingSkills:"Discovering Skills in the current workspace…",loadingModels:"Loading models…",noSkillMatches:"No matching Skills in the current workspace",noModelMatches:"No matching models. You can also enter a model ID directly",noCommandMatches:"No matching shortcuts",skillFallback:"Load and run this Skill",add:"Add",uploadImage:"Upload image",uploadDocument:"Upload document or PDF",uploadVideo:"Upload video",openTerminal:"Open terminal",viewBrowser:"View browser",permissions:"Codex permissions",workspaceLocked:"The conversation has started and the workspace is locked",selectWorkspace:"Select workspace",workspace:"Codex workspace",endpointCopied:"Endpoint copied",copyEndpoint:"Copy Sandbox Endpoint",continuePlaceholder:"Describe what you want to implement or adjust next",messagePlaceholder:"Message the AgentKit Sandbox. Type / for commands or $ to invoke a Skill…",stop:"Stop generating",send:"Send",stopping:"Confirming stop…",resume:"Resume task",steer:"Add instructions",steerPlaceholder:"Add instructions, or stop the task at any time…"},wme={defaultName:"My Agent",namedDefault:"My {{agent}}",creatingTitle:"Creating {{agent}} Agent",failedTitle:"Launch failed",createTitle:"Create {{agent}} Agent",fallbackError:"AgentKit Sandbox initialization failed. Please try again later.",creatingDescription:"Creating the {{agent}} Agent and waiting for it to become ready. This usually takes about 30 seconds.",name:"Agent name",storageSize:"Storage size",storageHelp:"Data will be persisted. Choose {{min}}–{{max}} GiB.",persistent:"Persistent",persistenceUnsupported:"Snapshot persistence is not supported in the current environment",persistentHelp:"Keep Agent data so you can continue later.",temporaryHelp:"Agent data will be cleared after 8 hours",cancelCreation:"Cancel creation",confirm:"Create",retry:"Try again"},Ome={activeAria:"Codex Agent session is active",openAria:"Open a Codex Agent session",active:"Codex Agent session",entry:"Spark an idea",exit:"Exit current Agent",expired:"Expired",remainingHours:"{{hours}}h {{minutes}}m remaining",remainingMinutes:"{{minutes}}m remaining",expiryWarning:"The remote development environment is kept for up to 8 hours and expires at {{expiry}} ({{remaining}}). Conversations and files will then be deleted.",usingAgent:"You are currently using the {{agent}} Agent",activityAria:"Sandbox activity log",activity:"Activity log",tokenUsageAria:"Codex token usage",tokens:"{{label}}: {{value}} tokens",tokenLabels:{total:"Total",input:"Input",cachedInput:"Cached input",output:"Output",reasoningOutput:"Reasoning output"}},kme={back:"Back to Agents",subtitle:"{{agent}} agent details",type:"Agent type",status:"Status",createdBy:"Created by",snapshotStatus:"Snapshot status",toolType:"Tool type",createdAt:"Created at",snapshotReason:"Snapshot reason",expiresAt:"Expires at",snapshotId:"Snapshot ID",sessionId:"Session ID",sourceSessionId:"Source Session ID",delete:"Delete Agent",waking:"Waking…",opening:"Opening…",wake:"Wake Agent",open:"Open Agent",deleteTitle:"Delete Agent?",deleteDescription:"Delete “{{name}}” and its saved data? This cannot be undone.",deleting:"Deleting…",confirmDelete:"Delete",sleepingHint:"This agent is asleep. Waking it before opening may take some time.",wakingHint:"Waking the agent. This may take some time.",agentId:"Agent ID"},Sme={back:"Back to Agents",createdBy:"Created by {{creator}}",ariaLabel:"Agent workspace",main:"Main",terminal:"Terminal",mainTitle:"{{agent}} main interface",openingTerminal:"Opening terminal…",terminalTitle:"{{agent}} terminal"},Eme={prompt:`Use the AgentKit Studio Plugin to hand off the current conversation, project, and task to the cloud. Execute this directly; do not ask me to open a terminal manually. +- Maintain a polite, professional tone.`},Bfe={requestFailed:"Request failed ({{status}}){{detail}}",a2aSpaces:{credentialsMissing:"The server does not have cloud provider credentials configured, so AgentKit agent centers are unavailable",loginRequired:"Sign in to access AgentKit agent centers"},vikingKnowledge:{credentialsMissing:"The server does not have cloud provider credentials configured, so VikingDB knowledge bases are unavailable",loginRequired:"Sign in to access VikingDB knowledge bases"},vikingMemory:{credentialsMissing:"The server does not have cloud provider credentials configured, so VikingDB memory stores are unavailable",loginRequired:"Sign in to access VikingDB memory stores"},mcpGateway:{missingHttpTool:"Go back to Add MCP tool and add at least one HTTP MCP service. MCP resilience does not support stdio services.",missingUrl:"An HTTP MCP tool is missing a valid service URL. Go back to Add MCP tool and complete it before publishing."},customModel:{fallbackName:"Custom model",apiKeyLabel:"{{name}} model API Key",fallbackApiKeyLabel:"{{name}} fallback model {{model}} API Key"},deploymentEnv:{serverInjected:"Provided by the server",selectedApiKeyPlaceholder:"Provided by the selected API Key",mcpInjectedComment:"Provided by the added MCP tools",restoredPlaceholder:"Securely restored by the Studio server",generatedMcpPlaceholder:"Generated from the added HTTP MCP tools",restoredHelp:"When updating, the Studio server merges MCP addresses and authentication without returning existing secrets to the browser.",mergedMcpHelp:"The Studio server merges MCP addresses and optional authentication without returning existing secrets to the browser.",listSeparator:", ",requirementHint:"Required by the following optimizations: {{labels}}.",requiredBy:"Required by the following optimizations: {{labels}}. Enter {{key}}.",required:"Enter {{label}} ({{key}}).",invalidJson:"Invalid JSON format"},drafts:{unsupportedVersion:"This local draft version is not supported. Upgrade Studio and try again.",invalidFormat:"The local draft data is invalid.",readFailed:"Could not read local drafts. The browser data may be corrupted.",quotaExceeded:"Browser storage is full, so the draft was not saved. Delete unused drafts or clear this site's storage, then try again.",writeRejected:"The browser blocked saving this draft. Check the site's storage permissions and try again."},skills:{searchFailed:"Search failed ({{status}})",downloadFailed:"Skill download failed ({{status}})",agentKitRequestFailed:"AgentKit Skills request failed",missingManifest:"{{location}} is missing SKILL.md",invalidParentPath:"{{location}} contains an invalid parent path (..): {{path}}",invalidPath:"{{location}} contains an invalid path: {{path}}",localDescription:"Local skill",folderSource:"Folder",noManifest:"No SKILL.md was found in {{location}}"},zip:{invalid:"Invalid zip: EOCD was not found",tooManyFiles:"A zip file cannot contain more than {{count}} files",tooLarge:"The extracted zip content is too large"}},Ufe={back:"Back to development session",runtimeName:"Runtime name",runtimeNameExists:"This Runtime name already exists. Choose another name.",checkingRuntimeName:"Checking Runtime name",verifiedSource:"Verified source",deployableSource:"Deployable source",verifiedByCodex:"Verified by Codex in the cloud",entryPoint:"Entry point",files:"Files",artifact:"Artifact",validationReport:"Validation report",verifiedHint:"The server materializes source from the verified artifact. Browser files cannot replace it.",unverifiedHint:"The server securely materialized the source. Confirm the Runtime configuration before deploying.",env:{requiredPlaceholder:"Enter {{key}}",optionalPlaceholder:"Optional: {{key}}"}},Qfe={name:"Code package",back:"Back to creation methods",reading:"Reading the code package",readingEllipsis:"Reading the code package…",uploadFirst:"Upload a code package first",uploadAriaLabel:"Code package upload",upload:"Upload code package",reupload:"Upload a different code package",uploadPrompt:"Upload a code package",filesRecognized:"{{count}} files found. Select this area to upload a different package.",dropHint:"Select or drop a .zip file up to 50 MB. Use app.py or declare an entry point in agentkit.yaml.",viewFiles:"View files",chooseFile:"Choose code package",errors:{invalidFormat:"Choose a .zip code package.",tooLarge:"The code package must be 50 MB or smaller.",invalidPath:"The archive contains an invalid path: {{name}}",empty:"The archive does not contain any deployable files.",tooManyFiles:"A code package cannot contain more than {{count}} files.",duplicateFile:"The code package contains a duplicate file: {{path}}",manifestParse:"Could not parse agentkit.yaml: {{detail}}",manifestRoot:"The root of agentkit.yaml must be an object.",manifestCommon:"common in agentkit.yaml must be an object.",entryPointType:"common.entry_point in agentkit.yaml must be a file path.",entryPointInvalid:"common.entry_point in agentkit.yaml is not a valid file path.",entryPointMissing:"The entry point declared in agentkit.yaml is missing from the code package: {{entryPoint}}",defaultEntryPointMissing:"The code package root must contain app.py, or common.entry_point in agentkit.yaml must declare an existing entry point."}},zfe={label:"Agent execution canvas",readOnlyLabel:"Read-only agent execution canvas",minimapLabel:"Execution flow minimap",controls:{ariaLabel:"Execution flow controls",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Fit view"},rootAgent:"Main agent",unnamedStep:"Unnamed step",terminals:{input:"User request",output:"Final response"},edges:{then:"Then",continueLoop:"Continue loop",call:"Call"},patterns:{llm:{label:"Agent",description:"Understand a task and complete one specific job"},sequential:{label:"Sequential",description:"Run internal steps one after another"},parallel:{label:"Parallel",description:"Run internal steps together, then combine their results"},loop:{label:"Loop",description:"Repeat internal steps until the stop condition is met"},a2a:{label:"Remote agent",description:"Call an existing remote agent"}},actions:{insertHere:"Insert a step here",deleteNamed:"Delete {{name}}",deleteNode:"Delete node",addSubagent:"Add subagent",addParallelStep:"Add a parallel step",addLoopStep:"Add a loop step",addNextStep:"Add next step",addFirst:"Add at the beginning",addLast:"Add at the end"}},Vfe={title:"Intelligent build",subtitle:"Describe what you need. Build, debug, and validate your agent.",model:{label:"Model",placeholder:"Select a model",retiring:"Retiring soon",currentConfiguration:"Current configuration",loadError:"Failed to load models"},availability:{checking:"Checking intelligent development availability…",unavailable:"Intelligent mode is currently unavailable. Go back and try again."},goal:{title:"Start with a goal",continueTitle:"Continue improving the project",hint:"Describe the problem your agent should solve. We will ask about any details that could affect the result.",continueHint:"Describe what you want to change. The result will be saved as a new version.",basedOn:"Based on",clearSelection:"Clear selection",label:"Goal",optimizationLabel:"Optimization goal",placeholder:"For example: Build an agent that reads sales data, creates weekly reports, and validates the output format",optimizationPlaceholder:"For example: Cite data sources and ask the user when information is incomplete"},actions:{preparing:"Preparing…",build:"Start building",optimize:"Start optimizing"},preparation:{accepted:"Goal received. Implementation is starting now.",preparing:"Creating the task environment…",starting:"Environment ready. Starting Codex…",next:"Next, Codex will plan the approach, then build, run, and validate the agent."},tasks:{title:"Tasks in progress",hint:"Work continues when you leave. Return to follow progress or add instructions.",refresh:"Refresh tasks",loading:"Loading tasks…",empty:"No tasks in progress",emptyHint:"Once a build starts, you can return to it here.",loadError:"Unable to load tasks. Please retry.",openError:"Unable to open this task. Please retry.",startedAt:"Started {{time}}",open:"Open task",opening:"Connecting…",states:{queued:"Queued",running:"Building",recovering:"Reconnecting",waiting_user:"Awaiting your reply",stopping:"Stopping",succeeded:"Completed",failed:"Incomplete",cancelled:"Stopped"}}},Hfe={title:"Saved projects",description:"Continue improving an existing version, or view, download, and deploy its source.",refresh:"Refresh projects",checkingStorage:"Checking project storage…",unavailableTitle:"Projects are temporarily unavailable",storageCheckError:"Could not confirm project storage status. Try again shortly.",storageNotConfigured:"Project storage is not configured.",loadingMigrated:"Loading migrated projects…",loadingSaved:"Loading saved projects…",loadingVersions:"Loading project versions…",unknownTime:"Unknown time",sourceDownloaded:"Source downloaded.",projectSummary_one:"{{count}} version · Updated {{time}}",projectSummary_other:"{{count}} versions · Updated {{time}}",versionSummary_one:"{{time}} · {{count}} file",versionSummary_other:"{{time}} · {{count}} files",noVersionDescription:"No version description",latestVersion:"Latest version",defaultVersionName:"Version · {{time}}",rename:{projectTitle:"Edit project name",versionTitle:"Edit version name",projectLabel:"Project name",versionLabel:"Version name",hint:"Use letters, numbers and common punctuation, up to {{max}} characters.",required:"Enter a name.",tooLong:"Names can contain up to {{max}} characters.",invalidCharacters:"Names cannot contain line breaks, control or invisible formatting characters, or < >.",save:"Save name",saving:"Saving…",updated:"Name updated.",failed:"Unable to save the name. Try again."},verified:"Verified",pendingVerification:"Needs review",viewSource:"View source",download:"Download",downloading:"Downloading…",optimize:"Optimize",optimizeUnavailable:"Optimize, not supported",errors:{projects:"Could not load saved projects.",source:"Could not load project source.",versions:"Could not load project versions.",download:"Could not download the source.",prepareDeployment:"Could not prepare the source for deployment.",deleteVersion:"Could not delete the project version.",migrated:"Could not load migrated projects",saved:"Could not load saved projects"},empty:{migratedTitle:"No migrated projects yet",savedTitle:"No saved projects yet",migratedDescription:"Source will be saved here after your first migration.",savedDescription:"Source will be saved here after your first build.",noVersions:"This project has no available versions."},compare:{selected:"{{count}}/2 selected",selectedLabel:"Selected",select:"Select",view:"View comparison",start:"Compare versions"},delete:{title:"Delete this version?",onlyVersion:"“{{name}}” has only one version. Deleting it will also remove the project. This cannot be undone.",description:"This version's source and validation records will be permanently deleted. Other versions are not affected.",confirm:"Delete version"}},qfe={title:"Choose how to create",subtitle:"Build your agent with the workflow that fits your needs",features:"Features",quick:{title:"Quick mode",description:"Delegate tasks to dynamically created subagents",features:{dynamicSubagents:"Dynamic subagents",autonomousPlanning:"Autonomous planning",collaboration:"Multi-agent collaboration",summary:"Automatic result summaries",skills:"Skills on demand",trace:"Traceable task execution"}},traditional:{title:"Advanced mode",description:"Customize your agent structure in detail",features:{visualConfig:"Visual configuration",migration:"Existing agent migration",debugging:"Live debugging",optimization:"Optional optimization",parameters:"Fine-grained controls"}}},Wfe={placeholder:"Enter a system prompt. Type ## followed by a space to add a level-two heading…",toolbar:{undo:"Undo {{shortcut}}",redo:"Redo {{shortcut}}",paragraph:"Paragraph",quote:"Quote",heading:"Heading {{level}}",selectBlockType:"Select text style",blockType:"Text style",bold:"Bold",removeBold:"Remove bold",italic:"Italic",removeItalic:"Remove italic",bulletedList:"Bulleted list",numberedList:"Numbered list"}},Kfe={local:{duplicatesSkipped:"Skipped duplicate skills: {{names}}",invalidDrop:"Drop a folder containing SKILL.md or a .zip file",readError:"Could not read the files: {{detail}}",dropLabel:"Drop a folder or ZIP file to detect skills automatically",hint:"Each skill must contain a SKILL.md file. Directories can contain multiple skills.",reading:"Reading files…",fileCount:"Local · {{count}} files"},hub:{searchError:"Search failed. Try again shortly.",searchPlaceholder:"Search Volcano Find Skill, such as data analysis or PDF",search:"Search",searching:"Searching…",noResults:"No matching skills found. Try another keyword.",hint:"Search Volcano Find Skill by keyword. Selected skills are downloaded to the skills/ directory when the project is generated."},space:{loadError:"Failed to load",loadingSpaces:"Loading AgentKit Skills centers…",noSpaces:"This account has no AgentKit Skills centers.",selectSpace:"Select an AgentKit Skills center",openConsole:"Open in the Volcano Engine console",loadingSkills:"Loading skills…",noSkills:"This AgentKit Skills center has no skills."}},Gfe={unnamedNode:"Unnamed node",editInstruction:"Select to edit instructions…",controls:{ariaLabel:"Workflow canvas controls",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Fit view"},sections:{info:"Workflow information",execution:"Execution mode",nodes:"Nodes",nodeConfig:"Node configuration"},types:{sequential:{label:"Sequential",description:"Run nodes one after another"},parallel:{label:"Parallel",description:"Run nodes at the same time"},loop:{label:"Loop",description:"Run nodes repeatedly"}},placeholders:{description:"Describe what this workflow does…",agentDescription:"Describe what this agent does…",instruction:"You are…"},errors:{workflowNameUnique:"The workflow name must be unique among agent node names",agentNameUnique:"Agent names must be unique within this workflow"},dragHint:"Drag onto the canvas, or use the button below",agentNode:"Agent node",addNode:"Add node",connectHint:"Drag between node handles to define the execution order.",create:"Create workflow",deleteNode:"Delete node",nameHelp:"Use only letters, numbers, and underscores. Names must be unique.",instruction:"Instructions",tools:"Tools (comma-separated)",nodeId:"Node ID",empty:{selectNode:"Select a node to edit its configuration",summary:"{{nodes}} nodes · {{edges}} connections"}},Xfe={ariaLabel:"Quick mode creation",progress:"Quick mode creation progress",steps:{agent:{label:"Agent",title:"Basic information",description:"Set the agent's name, purpose, behavior, and capabilities"},environment:{label:"Environment",title:"Configure the environment",description:"Choose the default environment or a custom environment you have built"},deployment:{label:"Deployment",title:"Deployment preferences",description:"Configure AgentKit cloud settings"}},model:{label:"Model",source:"Model source",name:"Model name",fallbacks:"Fallback models",fallbackPlaceholder:"Fallback model name",addFallback:"Add fallback model",addProviderFallback:"Add other provider",removeFallback:"Remove",fallbackType:"Fallback model type",fallbackSameProvider:"Same provider",fallbackOtherProvider:"Other provider",apiKeyEnv:"API Key environment variable",invalidApiKeyEnv:"Use letters, numbers, and underscores only, and do not start with a number.",fallbackHelp:"Same-provider fallbacks reuse the primary connection. Other providers use separate provider, API base, and API Key settings.",fallbackIgnored:"Empty, duplicate, or primary-model entries will be ignored.",provider:"Provider",invalidApiBase:"Enter a valid http:// or https:// URL.",volcengineArk:"Volcano Ark",custom:"Custom",gateway:"Model gateway",comingSoon:"Coming soon",currentApiKey:"Current API Key",currentConfiguration:"Current configuration",loadingApiKeys:"Loading API Keys",selectApiKey:"Select an API Key",searchApiKeys:"Search API Key names",noApiKeys:"No API Keys available",loadingModels:"Loading models",selectModel:"Select a model",searchModels:"Search by name, Model ID, or provider",noModels:"No models available",apiKeyPlaceholder:"Enter a model API Key",credentialsLoadError:"Failed to load model credentials",modelsLoadError:"Failed to load models"},identity:{unnamedPool:"Unnamed user pool",currentPool:"{{value}} (current user pool)",userPool:"User pool",loading:"Loading user pools",placeholder:"Select a user pool",search:"Search user pools",empty:"This account has no Identity user pools",currentHint:"This Studio's login JWT will be forwarded to the Runtime",mismatchHint:"The selected user pool is not used by this Studio, so the Studio will not be able to call the Runtime after deployment",selectionHint:"The user pool used by this Studio is marked in the list"},agent:{namePlaceholder:"Enter an agent name",descriptionPlaceholder:"Describe what this agent can do",prompt:"Prompt",promptPlaceholder:"Define the role, goals, and behavior boundaries",skills:"Skills",addSkill:"Add skills"},validation:{descriptionRequired:"Enter a description",promptRequired:"Enter a prompt",modelRequired:"Select a model",apiKeyRequired:"Enter or select the model API Key",instanceIntegers:"Minimum instances must be an integer of 0 or greater, and maximum instances must be an integer greater than 0",instanceOrder:"Minimum instances cannot exceed maximum instances",userPoolRequired:"Select a user pool for Runtime authentication"},deployment:{runtimeName:"Runtime name",runtimeNameUpdateHint:"The existing Runtime name is preserved during updates",runtimeNameHint:"Use only letters, numbers, underscores, and hyphens",region:"Deployment region",authentication:"Authentication",apiKeyDescription:"Default: access with the Runtime API Key",userPoolDescription:"Use a JWT issued by an Identity user pool",sessionStorage:"Session storage",inMemoryStorage:"Temporary in-memory storage",backends:{sqlite:"SQLite file",mysql:"MySQL",postgresql:"PostgreSQL"},instances:"Instance settings",minInstances:"Minimum instances",maxInstances:"Maximum instances",inMemoryHint:"To prevent session loss across instances, keep the Runtime at 1–1 instances",networkMode:"Network mode",network:{public:"Public",private:"Private",both:"Public and private"},subnetIds:"Subnet IDs (optional, comma-separated)",sharedInternet:"Shared public egress in the VPC",sharedInternetHint:"Allow private Runtimes to access the public internet through shared egress",evaluationSets:"Evaluation sets",createEvaluationSets:"Create evaluation sets automatically",evaluationSetsHint:"Create Good Case and Bad Case evaluation sets after deployment",resources:"Resource configuration",complete:"Deployment complete",preparing:"Preparing deployment…"},environmentVariables:{title:"Environment variables",add:"Add variable",nameAriaLabel:"Environment variable name",valueAriaLabel:"Value for {{name}}",deleteNamed:"Delete {{name}}"},actions:{updateAgain:"Update again",deployAgain:"Deploy again",updateAndPublish:"Update and publish",applyProfile:"Apply Profile",applyProfileAgain:"Apply Profile again"}},Yfe={actions:{addSubagent:"Add subagent",clearRoot:"Clear main agent",clearRootConfirmation:"Clear all settings and subagents from the main agent? This cannot be undone."},workspace:{progress:"Agent creation progress",modes:{build:"Build",validate:"Debug",optimize:"Optimize",environment:"Environment",publish:"Publish"},titles:{build:"Customize your agent architecture",validate:"Debug your agent",optimize:"Choose optimizations for your agent",environment:"Configure the cloud environment",publish:"Prepare your agent for deployment"}},sections:{type:{label:"Agent type",hint:"Choose an agent type"},basic:{label:"Basic information",hint:"Name, description, and system prompt"},model:{label:"Model",hint:"Model and service (optional)"},tools:{label:"Tools",hint:"Callable capabilities"},skills:{label:"Skills",hint:"Declarative skills"},knowledge:{label:"Knowledge base",hint:"External knowledge retrieval"},memory:{label:"Memory",hint:"Short-term and long-term memory"},subagents:{label:"Subagents",hint:"Nested collaboration"},review:{label:"Finish",hint:"Preview and create"}},agentTypes:{ariaLabel:"Agent type",remoteChildOnly:"Remote agents can only be used as child steps",llm:{label:"Agent",fullLabel:"LLM agent",description:"Uses an LLM to complete tasks autonomously"},sequential:{label:"Sequential",fullLabel:"Sequential agent",description:"Runs subagents one after another"},parallel:{label:"Parallel",fullLabel:"Parallel agent",description:"Runs subagents in parallel, then combines their results"},loop:{label:"Loop",fullLabel:"Loop agent",description:"Repeats subagents until the stop condition is met"},a2a:{label:"Remote agent",fullLabel:"Remote agent",description:"Calls a remote agent through the A2A protocol"}},basic:{agentName:"Agent name",name:"Name",agentDescription:"Agent description",descriptionPlaceholder:"Briefly describe what this agent does so your team can identify it…",nameHelp:"Follow Google ADK naming rules and keep the name unique in the execution flow.",rootDescriptionHelp:"The full description is preserved and converted to a Runtime-compatible single line during deployment.",descriptionHelp:"The description appears in agent lists and selectors.",orchestratorHelp:"This is a collaboration container and does not answer directly. Add task steps on the canvas and drag them to reorder.",maxIterations:"Maximum iterations",maxIterationsHelp:"The loop repeats its subagents until the condition is met or this limit is reached.",agentCenter:"AgentKit agent center",agentCenterHelp:"The remote agent's name, description, and capabilities come from the Agent Card returned by the center. The system discovers and attaches matching agents for each task.",moreOptions:"More options",systemPrompt:"System prompt",loadingMarkdown:"Loading Markdown editor…",markdownHelp:"Markdown shortcuts are supported. For example, type ## followed by a space to create a level-two heading.",unnamed:"Unnamed",unnamedAgent:"Unnamed agent"},validation:{remoteRoot:"A remote agent can only be a subagent",missingRegistry:"Select an AgentKit agent center",name:{required:"Name is required",reserved:"user is reserved by Google ADK. Choose another name.",characters:"Start with a letter or underscore and use only letters, numbers, and underscores"},duplicateName:"Agent names must be unique within this structure",missingDescription:"Description is required",mcpDuplicateName:"MCP names must be unique",mcpDuplicateUrl:"Remove the duplicate MCP endpoint before publishing",missingSubagent:"A subagent is required",missingPrompt:"System prompt is required",apiKeyRequired:"Enter or select the model API Key",missingSubagentDetail:"Add at least one subagent to {{type}} before debugging or publishing.",problem:"{{name}}: {{problem}}"},ai:{ariaLabel:"Fill agent configuration with AI",minimumLength:"Enter at least {{count}} characters.",replaceConfirmation:"The generated configuration will replace the current canvas and settings. Continue?",placeholder:"Describe your goal and use {{model}} to generate the configuration",generate:"Generate",generating:"Generating",success:"Configuration generated",regenerate:"Generate again",failed:"Generation failed"},debug:{ariaLabel:"Agent debugging workspace",unavailable:"This backend does not currently support generated-agent debug runs.",baseline:"Baseline",comparison:"Variant {{count}}",selectModel:"Select a model",enterDescription:"Enter a description",enterPrompt:"Enter a system prompt",duplicateConfiguration:"Test configurations must be unique",starting:"Starting…",applyAndRestart:"Apply and restart",restart:"Restart",start:"Start environment",defaultModel:"Default model",testConfiguration:"Test configuration",deleteVariant:"Delete {{name}}",deleteVariantGroup:"Delete comparison variant",creatingEnvironment:"Creating the test environment…",configurationChanged:"The configuration changed. Restart the environment.",ready:"Environment ready",readyHint:"Send a message to compare agent responses.",startHint:"Complete the configuration, then start the environment.",viewTraceNamed:"View the trace for {{name}}",traceUnavailable:"Send a message to view its trace",trace:"Trace",useConfiguration:"Use this configuration",finishConfiguration:"Finish configuration",finishAndStart:"Finish and start",currentAgentModel:"Current agent model",configurationHint:"Changes apply only to this comparison. Select this configuration to continue to deployment.",messagePlaceholder:"Send a message to the running test environments…",startOneFirst:"Start at least one test environment first",addVariant:"Add variant",traceTitle:"Trace · {{name}}",leaveTitle:"Leave debugging?",leaveDescription:"The current environments will be removed when you leave. You can start new environments when you return.",cleaning:"Cleaning up…",confirmLeave:"Leave",closeLeaveConfirmation:"Close leave-debugging confirmation"},optimization:{ariaLabel:"Agent optimization options",scenario:"Optimization scenario",components:"Optimization components",bytePlusUnavailable:"Harness Sidecar optimizations are not available for BytePlus accounts yet. Leave all optimizations unselected to continue; regular BytePlus agents are not affected.",releaseScenario:"Optimization scenario: {{profile}}",profiles:{default:{label:"Custom",description:"Choose components as needed. The Sidecar stays off when none are selected."},ops:{label:"Operations",description:"For operations diagnostics, databases, logs, and monitoring MCP servers."}},groups:{quality:"Improve response quality",cost:"Reduce runtime cost",stability:"Improve runtime stability"},options:{context_engine:{label:"Context management",description:"Manage context assembly, task anchoring, and context budgets."},compressor:{label:"Context and result compression",description:"Compress long context and large tool results to reduce token usage."},verifier:{label:"Response verification and repair",description:"Verify evidence and responses, then repair or alert on failure."},long_run_control:{label:"Goal task control",description:"Manage progress, continuation, and completion conditions for Goal tasks."},mcp_resilience:{label:"MCP resilience",description:"Manage connections, timeouts, empty results, large responses, and call budgets. Includes read-only SQL protection by default."}}},model:{label:"Model",source:"Model source",volcanoArk:"Volcano Ark",volcengineArk:"Volcano Ark",bytePlusModelArk:"BytePlus ModelArk",custom:"Custom",gateway:"Model gateway",comingSoon:"Coming soon",configuration:"Model configuration",name:"Model name",fallbacks:"Fallback models",fallbackPlaceholder:"Fallback model name",addFallback:"Add fallback model",addProviderFallback:"Add other provider",removeFallback:"Remove",fallbackType:"Fallback model type",fallbackSameProvider:"Same provider",fallbackOtherProvider:"Other provider",apiKeyEnv:"API Key environment variable",invalidApiKeyEnv:"Use letters, numbers, and underscores only, and do not start with a number.",fallbackHelp:"Same-provider fallbacks reuse the primary connection. Other providers use separate provider, API base, and API Key settings.",fallbackIgnored:"Empty, duplicate, or primary-model entries will be ignored.",provider:"Provider",invalidApiBase:"Enter a valid http:// or https:// URL.",liteLlmProviders:"LiteLLM providers",apiKeyPlaceholder:"Enter the model API Key",available:"Available",retiring:"Retiring soon",notActivated:"Not activated",unavailable:"Unavailable",apiKeyLoadError:"Failed to load Ark API Keys",loadingApiKeys:"Loading API Keys…",selectApiKey:"Select an API Key",currentApiKey:"Current API Key",apiKeyList:"API Key list",searchApiKey:"Search API Keys",searchApiKeyName:"Search API Key names",noApiKeys:"No API Keys available",noMatchingApiKey:"No matching API Keys",loading:"Loading models…",loaded:"{{count}} models loaded",loadError:"Failed to load models",selectModel:"Select a model",selectProviderModel:"Select a provider model",providerModels:"Provider models",search:"Search models",searchPlaceholder:"Search by name, Model ID, or provider",noMatches:"No matching models",empty:"No models available",unknownStatus:"Unknown status",refresh:"Refresh",refreshing:"Refreshing…",activate:"Activate",activateAction:"Open activation",currentConfiguration:"Current configuration"},tools:{builtIn:"Built-in tools",builtInHelp:"Select VeADK capabilities. Imports and required environment variables are added automatically.",codeExecution:"Code execution configuration",codeExecutionHelp:"Select the AgentKit code execution sandbox.",mcp:"MCP tools"},catalog:{web_search:{label:"Web search",description:"Get real-time information with Volcengine Web Search."},parallel_web_search:{label:"Parallel web search",description:"Run multiple search queries in parallel and combine the results faster."},link_reader:{label:"Link reader",description:"Fetch and read the main content from a URL."},web_scraper:{label:"Web scraper",description:"Crawl webpages into structured data. Requires the Scraper service."},image_generate:{label:"Image generation",description:"Generate images from text with Doubao Seedream."},image_edit:{label:"Image editing",description:"Edit or transform images with Doubao SeedEdit."},video_generate:{label:"Video generation",description:"Generate videos from text or images with Doubao Seedance, including task status queries."},text_to_speech:{label:"Text to speech (TTS)",description:"Convert text to speech with Volcengine Speech."},run_code:{label:"Code execution",description:"Run code in a sandbox."},vesearch:{label:"VeSearch",description:"Search with Volcengine VeSearch. Requires a bot endpoint."},links:{console:"Console",documentation:"Documentation"},env:{modelAgentName:{comment:"Model name"},embeddingModelName:{comment:"Embedding model required by memory and knowledge bases"},vikingMemoryProject:{comment:"VikingDB memory project"},vikingMemoryRegion:{comment:"VikingDB memory region"},vikingMemoryType:{comment:"Memory types"},feishuAppId:{comment:"Feishu app ID"},feishuAppSecret:{comment:"Feishu app secret",placeholder:"Enter the app secret"},registrySpaceId:{comment:"AgentKit agent center",placeholder:"Select an agent center"},registryTopK:{comment:"Number of agents to retrieve"},registryRegion:{comment:"AgentKit agent center region"},registryEndpoint:{comment:"AgentKit agent center OpenAPI endpoint"},agentKitToolId:{comment:"Code execution sandbox ID"},agentKitToolRegion:{comment:"AgentKit Tools region"},openVikingUrl:{comment:"OpenViking service URL"},openVikingMemoryUserId:{comment:"Memory owner ID",help:"The user segment in viking://user//peers//memories. Use it to isolate agents, tenants, or business scenarios. The default is default."},openVikingMemoryPolicy:{comment:"Memory policy",help:"Controls memory extraction and isolation. Leave it blank to use the official default policy."},openVikingKnowledgeUserId:{comment:"Knowledge base owner ID",help:"Used in the default path viking://user//resources// when no resource directory is configured. The default is default."},openVikingTargetUri:{comment:"Knowledge base resource directory",help:"Leave blank to generate it from the KnowledgeBase index. When provided, this OpenViking resource directory takes precedence."},tlsServiceName:{comment:"TLS topic_id. Leave blank to create one automatically"}}},backends:{shortTerm:{local:{label:"In-memory",description:"Stored in the process without persistence. Best for development and debugging."},sqlite:{label:"SQLite file",description:"Persist data to a local .db file."},mysql:{label:"MySQL",description:"Persist data to MySQL."},postgresql:{label:"PostgreSQL",description:"Persist data to PostgreSQL."}},longTerm:{local:{label:"Local vector store",description:"In-process llama-index vector store."},opensearch:{label:"OpenSearch",description:"Vector retrieval with OpenSearch."},redis:{label:"Redis",description:"Vector retrieval with Redis."},viking:{label:"VikingDB Memory",description:"VikingDB memory with user profile support."},openviking:{label:"OpenViking Memory",description:"Long-term memory that stores and retrieves preferences, events, and entities per user."},mem0:{label:"Mem0",description:"Managed memory from Mem0."}},knowledge:{viking:{label:"VikingDB Knowledge",description:"VikingDB knowledge base."},opensearch:{label:"OpenSearch",description:"Vector retrieval with OpenSearch."},context_search:{label:"Context Search",description:"Volcengine Context Search without embedding configuration."},openviking:{label:"OpenViking Knowledge",description:"OpenViking resource-directory knowledge base without embedding configuration."}}},exporters:{apmplus:{label:"APMPlus",description:"Volcengine APMPlus application performance monitoring."},cozeloop:{label:"CozeLoop",description:"Distributed tracing with CozeLoop."},tls:{label:"TLS (Log Service)",description:"Export logs to Volcengine TLS."}},knowledge:{title:"Knowledge base",description:"Enable external knowledge retrieval (RAG) so the agent can answer from your data.",backend:"Knowledge base backend",vikingDatabase:"VikingDB knowledge base"},memory:{shortTerm:"Short-term memory",shortTermDescription:"Store context for one session",shortTermBackend:"Short-term memory backend",longTerm:"Long-term memory",longTermDescription:"Store context across sessions, usually with vector retrieval",longTermBackend:"Long-term memory backend",vikingDatabase:"VikingDB memory",autoSave:"Save sessions to long-term memory automatically",autoSaveDescription:"Write session content to long-term memory when a session ends."},mcp:{removeTool:"Remove MCP tool",namePlaceholder:"Name (optional)",urlPlaceholder:"MCP service URL",pathWarning:"This is a gateway root address. Use it only when the root path is the MCP endpoint; otherwise include the complete service path.",tokenPlaceholder:"Bearer token (optional)",showToken:"Show Bearer token",hideToken:"Hide Bearer token",commandPlaceholder:"Command, such as npx",argsPlaceholder:"Arguments separated by spaces",stdioHint:"The stdio tool starts in the deployment environment. Make sure its command and dependencies are available.",addTool:"Add MCP tool"},resources:{unnamedAgentCenter:"Unnamed agent center",unnamedKnowledgeBase:"Unnamed knowledge base",unnamedMemory:"Unnamed memory store",loadError:"Failed to load",loadingAgentCenters:"Loading agent centers…",agentCentersLoaded:"{{count}} agent centers loaded",noAgentCenters:"No agent centers available",noMatchingAgentCenters:"No matching agent centers",searchAgentKitCenter:"Search AgentKit agent centers",searchNameOrId:"Search by name or ID",selectAgentCenter:"Select an agent center",selectAgentKitCenter:"Select an AgentKit agent center",selectedAgentCenter:"Selected agent center",agentKitCenter:"AgentKit agent center",refreshAgentCenters:"Refresh agent centers",knowledgeBaseList:"Knowledge base list",knowledgeBasePlaceholder:"Select a knowledge base",loadingKnowledgeBases:"Loading knowledge bases…",knowledgeBasesLoaded:"{{count}} knowledge bases loaded",noKnowledgeBases:"No knowledge bases available",noMatchingKnowledgeBases:"No matching knowledge bases",searchKnowledgeBase:"Search knowledge bases",selectKnowledgeBase:"Select a knowledge base",refreshKnowledgeBases:"Refresh knowledge bases",memoryList:"Memory store list",memoryPlaceholder:"Select a memory store",loadingMemories:"Loading memory stores…",memoriesLoaded:"{{count}} memory stores loaded",noMemories:"No memory stores available",noMatchingMemories:"No matching memory stores",searchMemory:"Search memory stores",selectMemory:"Select a memory store",refreshMemories:"Refresh memory stores"},env:{noAdditionalParameters:"This backend needs no additional runtime parameters.",invalidJson:"Enter valid JSON.",helpAriaLabel:"Help for {{label}}: {{help}}",openOpenViking:"Open OpenViking {{label}}",valuePlaceholder:"Enter a value",openVikingIndex:"OpenViking resource index",openVikingIndexHelp:"Leave blank to generate an index from the agent name, such as my_agent_kb. Without DATABASE_OPENVIKING_TARGET_URI, the default URI is viking://user/{knowledge base owner ID, or default}/resources/{resource index}/. When DATABASE_OPENVIKING_TARGET_URI is set, that complete URI is used instead.",openVikingIndexAriaLabel:"OpenViking resource index help: {{help}}"},deployment:{vpcRequired:"Enter a VPC ID when using VPC networking.",apiKeyRequired:"Select the API Key used by the model.",invalidEnvName:"Invalid environment variable name: {{key}}",requiredEnv:"{{name}}: enter this required environment variable",generatingConfiguration:"Generating deployment configuration",runtimeNameExists:"This Runtime name already exists. Choose another name and try again.",preparing:"Preparing deployment",applyingMpaProfile:"Applying the Agent profile to MPA Runtime",mpaProfileApplied:"MPA Runtime profile applied",runningMpaSmoke:"Verifying the MPA Runtime execution path",mpaReady:"MPA Runtime is ready",mpaOperationIncomplete:"MPA Runtime setup did not complete. Retry this deployment task.",complete:"Deployment complete",failed:"Deployment failed",updateAndPublish:"Update and publish",stages:{build:"Build image",deploy:"Deploy Runtime",publish:"Publish service",applyMpaProfile:"Apply MPA profile",verifyMpaRuntime:"Verify MPA Runtime",mpaReady:"MPA Runtime ready",running:"Deploying"}},publish:{generating:"Generating publish configuration",validating:"Validating the agent structure and preparing the deployment snapshot…"}},Zfe={presets:{support:{name:"Customer support assistant",description:"Answer questions around the clock using your knowledge base and conversation history, with consistent and considerate responses.",instruction:"You are a professional and patient customer support assistant. Always use a courteous, friendly tone. Base answers on the knowledge base whenever possible. When the available information is insufficient, say so clearly and ask for the details you need instead of inventing an answer. Keep responses concise and well structured, and provide steps when useful.",subagents:{}},analyst:{name:"Data analyst",description:"Run code for statistics and visualization with tracing enabled, so every analysis is observable and reproducible.",instruction:"You are a rigorous data analyst. Clarify the objective and definitions before cleaning, analyzing, and visualizing data with executable code. Explain assumptions and methods at each step, support conclusions with key evidence, and identify possible bias or limitations.",subagents:{}},translator:{name:"Translation assistant",description:"Translate between Chinese and English accurately and naturally while preserving tone and terminology.",instruction:"You are a professional translator fluent in Chinese and English. Preserve the meaning of the source while producing natural language for the target audience. Keep proper nouns and technical terminology accurate and reflect the original tone and style. Return only the translation unless the user asks for an explanation.",subagents:{}},coder:{name:"Coding assistant",description:"Write, debug, and refactor code, validate it by running tests, and produce clear, maintainable implementations.",instruction:"You are a senior software engineer. Write correct, clear, maintainable code that follows the conventions and best practices of the target language. When uncertain, run the code to validate the implementation, cover important edge cases, and add concise comments for complex logic.",subagents:{}},researcher:{name:"Researcher",description:"Search primary sources online and combine them with knowledge and long-term memory to produce evidence-backed findings.",instruction:"You are a rigorous researcher. Break each question into key subproblems, collect multiple credible primary sources through web search, and cross-check the evidence before drawing conclusions. Cite sources, state uncertainty, distinguish facts from inference, and avoid overgeneralization.",subagents:{}},"research-team":{name:"Multi-agent research team",description:"Coordinate a researcher, analyst, and writer to produce an end-to-end research report.",instruction:"You coordinate a research team. Break down the user's research task, delegate search, analysis, and writing to the appropriate subagents, synthesize their work, and deliver a clear, evidence-backed report.",subagents:{0:{name:"Researcher",description:"Collect primary sources and data related to the topic online.",instruction:"You are the team's researcher. Find multiple credible sources about the topic, organize the key facts, data, and original citations, and hand them to the analyst without adding unsupported conclusions."},1:{name:"Analyst",description:"Cross-check and synthesize the collected material.",instruction:"You are the team's analyst. Cross-check, compare, and synthesize the research material. Extract insights, identify contradictions and uncertainty, and produce a structured set of findings."},2:{name:"Writer",description:"Turn the analysis into a clear report with reliable citations.",instruction:"You are the team's writer. Turn the analyst's findings into a clear, well-written report with consistent citations, ensuring every conclusion can be traced to a source."}}}},tags:{tools:"Tools",memory:"Memory",knowledgeBase:"Knowledge base",tracing:"Tracing",subagents:"{{count}} subagents"},gallery:{title:"Create from a template",subtitle:"Choose a prebuilt agent template and customize it to fit your needs."},detail:{back:"Back to templates",name:"Name",systemPrompt:"System prompt",model:"Model",tools:"Tools",memory:"Memory",knowledgeBase:"Knowledge base",tracing:"Tracing",subagents:"Subagents ({{count}})",create:"Create from this template",shortTermMemory:"Short-term",longTermMemory:"Long-term"}},Jfe={checkingExpiry:"Checking expiry",waitingRecovery:"Waiting for recovery",listFailed:"Could not load projects",recoveryFailed:"Could not restore the workspace. Try again",operationFailed:"Project operation failed. Try again",title:"Code projects",back:"Back to code projects",restart:"This development environment will restart in {{countdown}}. Save your work regularly",expiresAt:"Expires at {{date}}",exitFullscreen:"Exit full screen",fullscreen:"Full screen",exitFullscreenHint:"Exit full screen (Esc)",recovering:"Restoring your workspace. Your project will reopen automatically",retry:"Retry connection",search:"Search code projects",newTitle:"New code project",new:"New project",readingStats:"Loading project details",createdAt:"Created",opening:"Opening",unknownCreatedAt:"Creation time unknown",open:"Open project",empty:"No matching code projects",close:"Close new project",name:"Project name",placeholder:"e.g. my-agent",nameHelp:"Start with a letter and use letters, numbers, underscores or hyphens, up to 64 characters",cancel:"Cancel",create:"Create project",files_one:"{{count}} file",files_other:"{{count}} files",directories_one:"{{count}} directory",directories_other:"{{count}} directories",separator:", "},ehe={enabled:"Enabled",disabled:"Disabled",unknownStatus:"Unknown status",allPermissions:"All permissions",customPermissions:"Custom permissions",unknownPermissions:"Unknown permissions",unnamed:"Unnamed API Key",search:"Search name, status or permissions",noMatches:"No matching API Keys",noModelPermission:"Not permitted by this API Key",modelAvailable:"Available",permissionState:{Available:"Available for chat",Shutdown:"Shut down",VideoGeneration:"Video generation model",Unsupported:"Not a chat model",NotActivated:"Not activated",Unknown:"Model status unavailable"}},the={common:Mfe,yaml:Lfe,validation:$fe,defaults:Ffe,helpers:Bfe,intelligentDeployment:Ufe,codePackage:Qfe,buildCanvas:zfe,intelligent:Vfe,projectLibrary:Hfe,modePicker:qfe,promptEditor:Wfe,skills:Kfe,workflow:Gfe,workbench:Xfe,traditional:Yfe,template:Zfe,workspace:Jfe,modelApiKey:ehe},Zze=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:zfe,codePackage:Qfe,common:Mfe,default:the,defaults:Ffe,helpers:Bfe,intelligent:Vfe,intelligentDeployment:Ufe,modePicker:qfe,modelApiKey:ehe,projectLibrary:Hfe,promptEditor:Wfe,skills:Kfe,template:Zfe,traditional:Yfe,validation:$fe,workbench:Xfe,workflow:Gfe,workspace:Jfe,yaml:Lfe},Symbol.toStringTag,{value:"Module"})),nhe={source:"Task source",studio:"Studio scheduled tasks",title:"Runtime scheduled tasks",selectRuntime:"Select a cloud Runtime from the Agent list first.",scope:"Scheduled tasks for the current Studio user in this Runtime.",refresh:"Refresh",loading:"Loading Runtime tasks",empty:"No matching scheduled tasks in this Runtime.",authRequired:"Runtime rejected the request. Check gateway access and the Runtime authentication setting.",forbidden:"The current user cannot access this Runtime.",unsupported:"This Runtime does not provide the MPA scheduled tasks API.",invalidResponse:"The tasks API returned unrecognized data. Check the Runtime version.",loadFailed:"Could not load tasks. Check the network and Runtime status, then refresh.",pagination:"Runtime task pagination",total:"{{total}} tasks",previous:"Previous",next:"Next",columns:{name:"Task name",enabled:"Status",schedule:"Schedule",next:"Next run",last:"Latest result"},schedule:{once:"Once",interval:"Interval",daily:"Daily",weekly:"Weekly",monthly:"Monthly",cron:"Cron"},search:"Search tasks",executionCount:"Executions",successRate:"Success rate",prompt:"Task content",manage:{view:"Task view",list:"List",calendar:"Calendar",create:"Create scheduled task",edit:"Edit task",copy:"Copy",delete:"Delete",detail:"Details",run:"Run now",name:"Task",lastRun:"Last execution",schedule:"Schedule",lastStatus:"Last execution status",agent:"Executing Agent",actions:"Actions",all:"All statuses",Pending:"Not run yet",Queued:"Queued",Running:"Running",Succeeded:"Succeeded",Failed:"Failed",TimedOut:"Timed out",Cancelled:"Cancelled",Skipped:"Skipped",overview:"Execution statistics:",prompt:"Task content",timezone:"Time zone",localTime:"Execution time (device time zone)",time:"Time",Once:"Once",Interval:"Interval",Daily:"Daily",Weekly:"Weekly",Monthly:"Monthly",Cron:"Cron expression",seconds:"seconds",interval:"Interval in seconds",weekdays:"Weekdays (1 = Monday, 7 = Sunday; comma separated)",monthDays:"Days of month (1–31; comma separated)",delivery:"Delivery",Web:"Web",Feishu:"Feishu",target:"Feishu recipient ID",enabled:"Enable task",cancel:"Cancel",save:"Save",saving:"Saving",required:"Enter a task name, Agent ID, prompt and delivery target.",timezoneInvalid:"Enter a valid IANA time zone, such as Asia/Shanghai.",futureTime:"Choose a future execution time.",intervalInvalid:"Interval must be an integer between 30 and 31536000 seconds.",daysInvalid:"Enter valid, unique days.",history:"Execution history",duration:"Duration",result:"Result / session",noRuns:"No executions yet.",conflict:"The task changed or the request conflicts. Close the dialog, refresh and retry.",invalid:"Request validation failed. Check user identity, execution time, Agent ID and task settings.",queued:"Execution request submitted.",saved:"Task updated.",deleteConfirm:"Delete “{{name}}”? It will no longer be scheduled.",calendarZone:"Display time zone:",prevMonth:"Previous month",nextMonth:"Next month",today:"Today",nextOnly:"Next only",calendarHint:"The calendar shows expected executions. Complex Cron expressions show only the next execution returned by the server.",botAccount:"Delivery bot",selectBot:"Select an enabled delivery bot.",botsLoading:"Loading Feishu bots…",botsFailed:"Could not load delivery bots. Try again.",botsUnauthorized:"You cannot read Feishu bots. Contact an administrator to configure delivery.",retryBots:"Reload bots",botDisabled:"Disabled"}},ihe={backToList:"Back to scheduled tasks",cancel:"Cancel",cancelQueue:"Cancel queued run",cancelQueueFirst:"Cancel the queued run first",cancelling:"Cancelling…",closeDrawer:"Close panel",collapse:"Collapse",connectingRuntime:"Connecting to Runtime…",createScheduledTask:"Create scheduled task",createTask:"Create task",delete:"Delete",deleteTask:"Delete task",edit:"Edit",enable:"Enable",expand:"Expand",pause:"Pause",refresh:"Refresh",refreshHistory:"Refresh run history",rerun:"Run again",retry:"Retry",runNow:"Run now",saveChanges:"Save changes",saving:"Saving…",stop:"Stop run",stopRun:"Stop this run",stopRunFirst:"Stop the current run first",stopping:"Stopping…",viewDetails:"View details"},rhe={cancelDescription:"This Session will be cancelled. Future scheduled runs will remain enabled.",cancelTitle:"Stop this run?",deleteDescription:"“{{name}}” and its complete run history will be permanently deleted.",deleteTitle:"Delete scheduled task?"},she={configuration:"Task configuration",nextRun:"Next run",pageLabel:"Scheduled task details",region:"Region",runtime:"Runtime",status:"Task status"},ahe={createTitle:"Create scheduled task",description:"Each trigger creates a separate Session for the Runtime Agent.",editTitle:"Edit scheduled task"},ohe={minutesSeconds:"{{minutes}} min {{seconds}} sec",seconds:"{{count}} sec"},lhe={cronExpression:"Cron expression",cronHelp:"Enter minute, hour, day of month, month, and day of week.",dailyTime:"Daily run time",enableAfterCreate:"Enable after creation",enableHelp:"The task will run at its next scheduled time after it is enabled.",name:"Task name",namePlaceholder:"For example: Generate a daily operations summary",noRuntime:"No Runtime available",prompt:"Execution prompt",promptPlaceholder:"Enter the text to send to the Agent on every run",runAt:"Run time",runtimeAgent:"Runtime Agent",runtimeHelp:"The task always uses the Runtime's currently active version.",runtimePlaceholder:"Select a Runtime Agent",schedule:"Schedule",scheduleType:"Schedule type",timezone:"Time zone",weekday:"Day of week"},che={all:"All"},uhe={description:"Each run uses a separate Session. Results and errors are retained.",duration:"Duration: {{duration}}",emptyDescription:"Runs will appear here after the task is triggered or run manually.",emptyTitle:"No runs yet",errorDetails:"Error details",finalAnswer:"Final answer",loadFailed:"Unable to load run history",loadFailedDescription:"Check the Studio service and try again.",session:"Session",title:"Run history"},dhe={cancelRequested:"Stop request submitted.",created:"Task created.",deleted:"The task and its run history were deleted.",enabled:"Task enabled.",paused:"Task paused.",queued:"Task queued and will start within one minute.",requeued:"Task queued again and will start within one minute.",updated:"Task updated."},fhe={filterLabel:"Filter scheduled tasks by status",listLabel:"Scheduled task list",loadFailed:"Unable to load scheduled tasks",loadFailedDescription:"Check the Studio service and try again.",title:"Cronjob"},hhe={cron:"Cron {{cron}}{{zone}}",daily:"Daily at {{time}}{{zone}}",once:"Once · {{date}}{{zone}}",weekly:"{{weekday}} at {{time}}{{zone}}"},phe={daily:"Daily",once:"Once",weekly:"Weekly"},mhe={cancelled:"Cancelled",enabled:"Enabled",failed:"Failed",notRun:"Not run yet",paused:"Paused",pending:"Preparing",queued:"Queued",retrying:"Retrying",running:"Running",skipped:"Skipped",success:"Succeeded"},ghe={cronFields:"A Cron expression must contain five fields, for example 0 9 * * *.",nameRequired:"Enter a task name.",promptRequired:"Enter the text to send to the Agent on each run.",runtimeAppMissing:"The Runtime Agent did not return an appName. Confirm that the Runtime is ready and compatible.",runtimeRequired:"Select an available Runtime Agent.",timeRequired:"Select a run time."},bhe={friday:"Friday",monday:"Monday",saturday:"Saturday",sunday:"Sunday",thursday:"Thursday",tuesday:"Tuesday",wednesday:"Wednesday"},Jze={mpa:nhe,actions:ihe,confirm:rhe,detail:she,drawer:ahe,duration:ohe,fields:lhe,filters:che,history:uhe,notices:dhe,page:fhe,schedule:hhe,scheduleTypes:phe,status:mhe,validation:ghe,weekdays:bhe},eVe=Object.freeze(Object.defineProperty({__proto__:null,actions:ihe,confirm:rhe,default:Jze,detail:she,drawer:ahe,duration:ohe,fields:lhe,filters:che,history:uhe,mpa:nhe,notices:dhe,page:fhe,schedule:hhe,scheduleTypes:phe,status:mhe,validation:ghe,weekdays:bhe},Symbol.toStringTag,{value:"Module"})),yhe="Quick-create Agent",vhe="Agent type",xhe="Close",whe="Deploy",Ohe="Preview",khe="Configuration download started",She="Download failed — try again",Ehe="Review {{count}} configuration issues",Che="Custom",Ahe="Custom {{field}}",The="Enter a custom value",_he="This model declares no reasoning levels; the service settings apply",jhe="Add a model to this provider first",Nhe="Select a provider first",Rhe="Select an option",Ihe="Optional",Phe="Default model, Agent preset and permissions apply to new sessions. The preset must exist in the deployed Harness",Dhe="Enter an environment variable name only; supply its secret value at deployment",Mhe="read-only allows reading; workspace-write allows workspace edits; danger-full-access allows full access without approval",Lhe="allowedModels lists the models sub-agents may select. Enabling selection requires at least one provider/model pair",$he="Add a custom model service using its endpoint, protocol and model IDs, including compatible Volcengine and BytePlus services",Fhe="Covers common native settings. Other plugin parameters and preset files are not included yet",Bhe="Native configuration reference",Uhe="Provider {{index}}",Qhe="Model {{index}}",zhe="Add provider",Vhe="Remove provider {{index}}",Hhe="Add model",qhe="Remove model {{index}}",Whe="Add allowed model",Khe="Remove allowed model {{index}}",Ghe="Remove",Xhe="Enter the service’s model ID",Yhe={provider:"Provider {{index}}",model:"Model {{index}}"},Zhe={defaults:"Session defaults",deepseek:"DeepSeek model service",providers:"Custom model providers",shell:"Command execution",loop:"Tool calls",subagents:"Sub-agent model selection",search:"DeepSeek web search"},Jhe={id:"Provider ID",displayName:"Display name",baseURL:"Base URL",api:"API protocol",apiKeyEnv:"API key environment variable"},epe={id:"e.g. company-models",displayName:"Optional; defaults to the provider ID",baseURL:"https://…/v1",api:"Select a protocol",apiKeyEnv:"e.g. MODEL_API_KEY"},tpe={id:"Model ID",name:"Display name",contextWindow:"Context capacity",maxTokens:"Maximum output capacity"},npe={positive:"Enter a number greater than zero",integer:"Enter a valid positive integer",env:"Use letters, digits and underscores; do not start with a digit",url:"Enter an HTTP or HTTPS URL without credentials",option:"Select a supported native option",required:"Complete this field",duplicate:"This ID or model pair already exists",providerId:"Start with a lowercase letter; use lowercase letters, digits, dots, underscores or hyphens; reserved IDs are unavailable",routes:"Add at least one complete provider/model pair",modelPair:"Enter a model ID for this custom provider",unknownProvider:"Add this custom provider first",unknownModel:"Enter a model ID configured for this provider",timer:"Enter a timeout greater than 0 and no more than 2147483647 ms"},ipe={"agent-default-model_provider":"Default provider","agent-default-model_model":"Default model","agent-default-model_reasoningEffort":"Default reasoning effort","agent-presets_default":"Default Agent preset",permission_defaultPreset:"Default permission preset","llm-deepseek_apiKeyEnv":"API key environment variable","llm-deepseek_baseURL":"Base URL","llm-deepseek_thinking":"Thinking mode","llm-deepseek_reasoningEffort":"Reasoning effort","llm-deepseek_maxTokens":"Output limit per request","llm-deepseek_defaultContextWindow":"Default context capacity","llm-deepseek_streamIdleTimeoutMs":"Stream idle timeout (ms)",bash_timeoutMs:"Default execution timeout (ms)",bash_maxTimeoutMs:"Maximum execution timeout (ms)",bash_maxOutputBytes:"Output limit (bytes)","agent-loop_maxParallelToolCalls":"Parallel tool-call limit","subagent-model-selection_enabled":"Enable model selection","web-search-deepseek_apiKeyEnv":"API key environment variable","web-search-deepseek_baseURL":"Search base URL","web-search-deepseek_model":"Search model","web-search-deepseek_apiVersion":"API version","web-search-deepseek_maxTokens":"Search output limit","web-search-deepseek_maxUses":"Maximum search uses"},rpe="Cancel",spe="Back to creation methods",ape="DeepSeek Harness configuration",tVe={title:yhe,agentType:vhe,close:xhe,continue:"Continue",deploy:whe,preview:Ohe,export:"Export configuration",downloaded:khe,downloadFailed:She,validationSummary:Ehe,customValue:Che,customField:Ahe,enterCustomValue:The,reasoningUnavailable:_he,modelsUnavailable:jhe,selectProviderFirst:Nhe,selectOption:Rhe,optional:Ihe,defaultsHelp:Phe,credentialHelp:Dhe,permissionHelp:Mhe,routesHelp:Lhe,providersHelp:$he,coverage:Fhe,source:Bhe,provider:Uhe,model:Qhe,addProvider:zhe,removeProvider:Vhe,addModel:Hhe,removeModel:qhe,addRoute:Whe,removeRoute:Khe,remove:Ghe,modelIdPlaceholder:Xhe,route:Yhe,sections:Zhe,providerFields:Jhe,providerPlaceholders:epe,modelFields:tpe,errors:npe,fields:ipe,cancel:rpe,back:spe,pageTitle:ape},nVe=Object.freeze(Object.defineProperty({__proto__:null,addModel:Hhe,addProvider:zhe,addRoute:Whe,agentType:vhe,back:spe,cancel:rpe,close:xhe,coverage:Fhe,credentialHelp:Dhe,customField:Ahe,customValue:Che,default:tVe,defaultsHelp:Phe,deploy:whe,downloadFailed:She,downloaded:khe,enterCustomValue:The,errors:npe,fields:ipe,model:Qhe,modelFields:tpe,modelIdPlaceholder:Xhe,modelsUnavailable:jhe,optional:Ihe,pageTitle:ape,permissionHelp:Mhe,preview:Ohe,provider:Uhe,providerFields:Jhe,providerPlaceholders:epe,providersHelp:$he,reasoningUnavailable:_he,remove:Ghe,removeModel:qhe,removeProvider:Vhe,removeRoute:Khe,route:Yhe,routesHelp:Lhe,sections:Zhe,selectOption:Rhe,selectProviderFirst:Nhe,source:Bhe,title:yhe,validationSummary:Ehe},Symbol.toStringTag,{value:"Module"})),ope="Report an issue",lpe="Description",cpe="Common issues",upe="Cancel",dpe="Done",fpe="Submit feedback",hpe="Submitting…",ppe={title:"Feedback submitted. Thank you.",description:"The AgentKit team will review your report as soon as possible."},mpe={close:"Close issue report",intro:"Select the issues you encountered and add any useful details.",privacy:"Your conversation data will be shared with the AgentKit team. Please protect sensitive information.",descriptionPlaceholder:"Describe what happened (optional)",issues:{slow:"Slow execution",crash:"Runtime crash",incorrect:"Inaccurate result",tool_error:"Tool call failed",other:"Other issue"}},gpe={description:"Tell us about a problem you encountered while using AgentKit Studio.",module:"Area",modules:{conversation:"Conversation",agents:"Agents",applications:"Automations",search:"Search",other:"Other"},commonIssuesMultiple:"Common issues (select all that apply)",issueTypes:"Issue types",issues:{page_slow:"Page loads slowly",feature_unavailable:"Feature unavailable",display_error:"Display issue",no_response:"Action has no response",other:"Other issue"},descriptionPlaceholder:"Describe the page, action, and what happened",quickAdd:"Quick add",suggestionsLabel:"Suggested descriptions",suggestions:{noResponse:"Nothing happens after I click",loading:"The page remains in a loading state",incomplete:"Some content is missing or clipped",error:"An error appears after the action"},privacy:"Your data will be shared with the AgentKit team. Please protect sensitive information."},iVe={title:ope,descriptionLabel:lpe,commonIssues:cpe,cancel:upe,done:dpe,submit:fpe,submitting:hpe,success:ppe,dialog:mpe,page:gpe},rVe=Object.freeze(Object.defineProperty({__proto__:null,cancel:upe,commonIssues:cpe,default:iVe,descriptionLabel:lpe,dialog:mpe,done:dpe,page:gpe,submit:fpe,submitting:hpe,success:ppe,title:ope},Symbol.toStringTag,{value:"Module"})),bpe={back:"Back",close:"Close"},ype={title:"Optimize migrated project",closeAria:"Close optimization dialog"},vpe={title:"Migrated projects",description:"Manage migrated source versions or continue optimizing any version.",libraryTitle:"Projects and versions",libraryDescription:"View, download, deploy, or compare source versions, or continue optimizing any version.",emptyTitle:"No migrated projects yet",emptyDescription:"Migrated source code will be saved here automatically."},xpe={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any (universal migration)"},wpe={awaitingUpload:"Awaiting upload",analyzing:"Analyzing",needsInput:"Needs input",analysisReady:"Awaiting confirmation",migrating:"Migrating",validating:"Validating",packaging:"Packaging",succeeded:"Completed",succeededWithWarnings:"Completed with notices",partial:"Partially completed",failed:"Failed",cancelled:"Stopped",expired:"Expired"},Ope={evaluationPending:"Evaluation pending",evaluationRunning:"Evaluating",waitingDataset:"Evaluation cases pending",waitingEnvironment:"Environment variables required",evaluationFailed:"Migrated, evaluation incomplete",evaluationBlocked:"Migrated, evaluation needs attention",evaluationCancelled:"Migrated, evaluation cancelled",resultUnavailable:"Result unavailable",environmentExpired:"Environment expired"},kpe={partialReady:"Migration output is ready, but delivery is incomplete. Review the migration notices.",readyWithWarnings:"Migration output is ready. Review the migration notices.",ready:"Migration output is ready."},Spe={passed:"Output verification passed",failed:"Output verification failed",degraded:"Output verification incomplete"},Epe={session:"Create migration environment",upload:"Upload project",analysis:"Analyze project"},Cpe={agentNameRequired:"Enter an Agent name",agentNameInvalid:"Agent names must be 1–63 characters, contain only lowercase letters, numbers, and hyphens, and start and end with a letter or number"},Ape={seconds:"{{seconds}} sec",minutesSeconds:"{{minutes}} min {{seconds}} sec"},Tpe={savedUnaffected:"Saved projects are unaffected",savingUnaffected:"Source is being saved and will be unaffected once complete",activeDetail:"Task history and temporary output will become unavailable after expiration",oneHour:"Temporary migration environment is retained for 1 hour",ended:"Temporary migration environment has ended",savedAvailable:"Saved projects remain available to view, download, deploy, or optimize",unavailable:"Task history and temporary output are no longer available",countdown:"Temporary migration environment ends in {{minutes}} min {{seconds}} sec",expiredSavedMessage:"The temporary migration environment has ended. Saved projects are unaffected.",expiredMessage:"The temporary migration environment has ended. Task history and temporary output are no longer available."},_pe={recommended:"Recommended migration method",scope:"Migration scope",excluded:"Out of scope",viewEvidence:"View analysis evidence",viewAssumptions:"View key assumptions",viewSourceEvidence:"View source evidence"},jpe={ariaLabel:"Codex activity",title:"Codex activity",startingAnalysis:"Codex is starting the analysis…",startingMigration:"Codex is starting the migration…",loadError:"Codex activity is temporarily unavailable. The current task is unaffected.",liveAnalyzing:"Analyzing the project",liveMigrating:"Running the migration",liveValidating:"Verifying the migration",livePackaging:"Packaging the migration",liveDelivery:"Reviewing the delivery"},Npe={title:"Migration output",fileTooLarge:"This file exceeds 2 MiB. Download the complete output to view it.",unsupportedPreview:"This file cannot be previewed here. Download the complete output to view it.",filesAria:"Migration output files",searchAria:"Search output files",searchPlaceholder:"Search files",limit:"Showing the first {{count}} items. Search for a specific file.",noSelection:"No file selected",noPreview:"No files available to preview.",loadingFile:"Loading output file…",startupFile:"Startup file",fileCountLabel:"Files",saved:"Source has been saved. You can view, download, deploy, or optimize it.",saving:"Output is ready and the source version is being saved.",deployReady:"Output is available to preview, download, and deploy. Waiting for source save status.",deployUnavailable:"Output is available to preview and download, but its current delivery status does not support deployment.",viewProjects:"View migrated projects",downloading:"Downloading…",downloadZip:"Download ZIP",deployTitle:"Deploy migration output",deployUnavailableTitle:"Current delivery status does not support deployment",deployRuntime:"Deploy to Runtime",fileCount:"{{count}} files",startup:"Startup file {{module}}",loading:"Loading migration output…"},Rpe={retiring:"Retiring soon",currentDefault:"Current default model",loadError:"Failed to load models",label:"Model",placeholder:"Select a model"},Ipe={zipOnly:"Select a local project in .zip format.",invalidName:"The ZIP file name is invalid. Rename the file and select it again.",tooLarge:"The project ZIP cannot exceed {{size}}.",empty:"The project ZIP cannot be empty.",removeAria:"Remove project ZIP",reselectPrompt:"Select the project ZIP again",selectPrompt:"Select or drop a local project ZIP",reselect:"Select again",selectZip:"Select ZIP",continue:"Continue upload",start:"Upload and analyze",inputAria:"Select a local project ZIP",retention:"The temporary migration environment is retained for 1 hour after creation. Successfully saved source versions are unaffected.",uploading:"Uploading…",sizeHint:"Project ZIP, up to {{size}}"},Ppe={requiredPlaceholder:"Enter {{key}}",optionalPlaceholder:"Optional: {{key}}",notReady:"Migration output is not ready yet.",back:"Back to migration results"},Dpe={backToAddAgent:"Back to Add Agent",title:"Migrate existing project",newMigration:"New migration",recent:"Recent migrations",loadingSessions:"Loading migration sessions…",noSessions:"No migration sessions",heading:"Migrate an existing Agent project",intro:"Upload a local project ZIP. Codex will first perform a read-only analysis, then ask you to confirm the migration method.",backToHome:"Migration home",navigation:"Migration navigation",showMore:"Show more",showLess:"Show less",projectName:"Project name",status:"Status",createdAt:"Created",actions:"Actions",openTask:"Open migration {{name}}",continueTask:"Continue",viewTask:"View"},Mpe={stop:"Stop migration",stopping:"Stopping…",cancel:"Cancel",reload:"Reload",refreshStatus:"Refresh status"},Lpe={unavailable:"Migration is currently unavailable",defaultReason:"Dev Sandbox is currently unavailable. Contact your administrator to check the configuration."},$pe={creatingSandbox:"Creating Dev Sandbox",initializing:"Initializing the migration workspace and checking AgentKit CLI, Codex, and migration capabilities. The project will upload automatically when the environment is ready.",elapsed:"Elapsed: {{duration}}",uploadThenAnalyze:"Read-only analysis will start automatically after the ZIP upload completes.",analyzing:"Codex is identifying the framework, entry point, and migration boundaries. No migration changes are being made.",migrationLocked:"Attachments and migration settings cannot be changed while migration is running. Wait for the task to finish or stop it.",analysisPaused:"Read-only analysis is paused. Answer only the questions below. After submission, analysis will continue in the same environment without starting the migration.",analysisComplete:"Read-only analysis is complete. Review the recommendation and confirm the final migration method.",awaitingUpload:"The migration environment is ready. Select the local ZIP again to continue uploading.",expiredTitle:"Migration environment expired",expiredDescription:"Migration content and output can no longer be previewed, downloaded, or deployed. If the Runtime deployment completed, return to the Agents page to continue using it.",unsupportedTitle:"This ZIP cannot be migrated yet",unsupportedHint:"Update the project as instructed, then create a new migration and upload it again.",failedTitle:"Migration incomplete",cancelled:"This migration was stopped. Create a new migration and upload the project again."},Fpe={ariaLabel:"Provide project analysis details",title:"Additional information needed for analysis",description:"The attachment stays locked; submitting continues read-only analysis only",submitting:"Continuing analysis…",submit:"Submit and continue analysis"},Bpe={ariaLabel:"Answer the questions the migration needs you to decide",title:"The migration needs your answer",description:"Your answer continues the current step instead of restarting it",other:"Other",otherPlaceholder:"Or type your own answer",submitting:"Submitting your answer…",submit:"Submit answer and continue"},Upe={ariaLabel:"Confirm migration method",title:"Confirm migration method",framework:"Migration method",frameworkPlaceholder:"Select a migration method",agentName:"Agent name",entry:"Project entry point",entryPlaceholder:"Select a project entry point",entryExample:"For example, agent.py:agent",consent:"By selecting “Confirm and start migration,” you confirm the migration scope, exclusions, and key assumptions above.",starting:"Starting migration…",start:"Confirm and start migration"},Qpe={setup:{title:"Migration effect evaluation",description:"Evaluation cases run automatically after migration.",on:"On",off:"Off",unavailable:"Migration effect evaluation is unavailable in this environment.",casesTitle:"Evaluation cases",casesDescription:"Add at least one case. Expected outcomes and criteria are optional.",configuredSummary:"{{count}} cases · {{preset}} · {{dimensions}}",incompleteSummary:"{{count}} cases need content · {{preset}} · {{dimensions}}",dimensionSummary:"{{count}} dimensions",editSettings:"Edit settings",viewSettings:"View settings",lockedTitle:"Evaluation cases",lockedDescription:"Cases cannot change after upload starts.",closeAria:"Close evaluation settings",done:"Finish setup",close:"Close"},tabs:{label:"Migration task content",migration:"Migration",evaluation:"Evaluation",waitingMigration:"Waiting for migration",waitingConfiguration:"Setup required",running:"Running",completed:"Completed",issue:"Needs attention"},bulk:{open:"Paste multiple",label:"Enter one case per line",placeholder:`Check the status of today's orders +Summarize the result in three points`,preview:"{{count}} cases will be added",confirm:"Add cases"},case:{title:"Case {{index}}",add:"Add case",moveUp:"Move case {{index}} up",moveDown:"Move case {{index}} down",copy:"Duplicate",delete:"Delete",userInput:"User input",userInputPlaceholder:"For example: Check the status of today's orders",expectedOutcome:"Expected outcome (optional)",expectedOutcomePlaceholder:"Describe what the Agent should accomplish; exact wording is not required",criteria:"Requirements (optional)",addCriterion:"Add requirement",criterionLabel:"Requirement {{index}}",criterionPlaceholder:"For example: Include the order ID and current status",removeCriterion:"Remove requirement {{index}}"},advanced:{title:"Advanced settings",standard:"Standard evaluation",standardDescription:"Uses 3 dimensions by default: semantic fidelity, output constraints, and workflow/tool fidelity.",custom:"Custom dimensions",customDescription:"Select one or more dimensions based on business risk.",lockedDescription:"The evaluation method and dimensions cannot change after upload starts."},dimension:{semantic_fidelity:"Semantic fidelity",output_contract:"Output contract",workflow_tool_fidelity:"Workflow and tool fidelity",context_memory_fidelity:"Context and memory fidelity",boundary_error_fidelity:"Boundary and error fidelity",safety_refusal_fidelity:"Safety and refusal fidelity"},dimensionDescription:{semantic_fidelity:"Checks whether intent, conclusions, and key facts remain consistent.",output_contract:"Checks required fields, structure, language, and formatting constraints.",workflow_tool_fidelity:"Checks observable workflow branches and tool-driven behavior.",context_memory_fidelity:"Checks supported multi-turn context and memory behavior.",boundary_error_fidelity:"Checks invalid input, missing information, and dependency failures.",safety_refusal_fidelity:"Checks existing authorization, refusal, and sensitive-data boundaries."},validation:{caseCount:"Keep between 1 and {{count}} cases.",dimensionRequired:"Select at least one evaluation dimension.",userInputRequired:"Enter case input.",userInputBytes:"A case cannot exceed 32 KiB.",expectedOutcomeBytes:"The expected outcome cannot exceed 16 KiB.",criteriaCount:"A case can contain at most {{count}} requirements.",criterionRequired:"Requirements cannot be empty.",criterionBytes:"One requirement cannot exceed 2 KiB.",datasetBytes:"All evaluation cases cannot exceed 10 MiB."},dataset:{invalidLockResponse:"The service did not confirm that evaluation cases were saved. Try again.",loadingSettings:"Loading evaluation settings…",loadSettingsFailed:"Evaluation settings could not be loaded.",retryLoadSettings:"Reload",missing:"No saved evaluation cases were found. Enter and save them again.",saveWarning:"Evaluation cases were not saved. Migration continues.",retrySave:"Save evaluation cases again",saving:"Saving…"},state:{disabled:"Evaluation is off",waiting_dataset:"Waiting for evaluation cases",pending:"Evaluation starts automatically after migration",preparing:"Preparing the evaluation environment…",waiting_environment:"Runtime environment variables are required",deploying:"Deploying a temporary Runtime…",executing:"Running evaluation cases…",judging:"Running evaluation analysis…",aggregating:"Aggregating evaluation results…",completed:"Evaluation completed",failed:"Evaluation incomplete",blocked:"Evaluation requires attention before it can continue",cancelled:"Evaluation cancelled"},progress:{label:"Migration and migration effect evaluation progress",migration:"Migration",evaluation:"Migration effect evaluation",notStarted:"Not started",inProgress:"In progress",completed:"Complete",waitingConfiguration:"Waiting for setup",issue:"Needs attention"},environment:{description:"Enter the environment variables required by the temporary Runtime.",security:"Used only for this evaluation.",optional:"Optional",submit:"Submit and continue evaluation",submitting:"Submitting…"},execution:{preparing:"Prepare evaluation",preparingDetail:"Validate migration output and {{count}} evaluation cases",deploying:"Start Runtime",deployingDetail:"Prepare {{runtime}}",runtimeFallback:"isolated runtime",executing:"Run cases",executingDetail:"Run {{count}} cases and capture output",judging:"Run evaluation analysis",judgingDetail:"Evaluate {{cases}} cases · {{dimensions}} dimensions",aggregating:"Generate evaluation report",aggregatingDetail:"Aggregate scores and evidence into an HTML report",waiting:"Waiting",running:"Running",failed:"Failed",complete:"Completed"},result:{title:"Execution progress",attempt:"Evaluation attempt {{attempt}}",pending:"Waiting for migration to complete",retry:"Run evaluation again",retrying:"Retrying…",failureStage:"Failed at",errorCode:"Error code",taskId:"Task ID",diagnosticAttempt:"Evaluation attempt",runtime:"Runtime",errorDetails:"Error details",diagnosticField:"{{label}}: {{value}}",diagnosticHeading:"{{label}}:",loadingReport:"Loading the evaluation report…",reportTitle:"HTML evaluation report",reportHtmlDescription:"View or download the HTML report.",viewReport:"View report",reportDrawerDescription:"Scores, differences, and evidence",closeReport:"Close",closeReportAria:"Close evaluation report",reportPreviewTitle:"Migration effect evaluation report preview",reportSummary:"Evaluation summary",reportVersion:"Dataset {{version}} · Prompt v{{prompt}}",downloadReport:"Download full report",downloadingReport:"Downloading…",overallScore:"Overall fidelity",scoreScale:"0–100; N/A when evidence is insufficient",evidenceCoverage:"Evidence coverage",coverageDetail:"{{scored}} of {{total}} dimensions evidenced",executionSuccess:"Execution success",executionDetail:"{{succeeded}} of {{total}} cases completed",naCount:"N/A count",naDescription:"Insufficient evidence; excluded from scores",gapDescription:"Migration gap summary",lowestScoringCases:"Lowest-scoring cases",executionFailures:"Execution issues",criticalEvidence:"Critical evidence",limitations:"Evaluation limitations",viewEvidence:"View results and evidence for {{count}} cases",outputTruncated:"Long output was truncated",executionState:{succeeded:"Execution completed",failed:"Execution issue"},severityLabel:"Severity: {{severity}}",severity:{none:"None",low:"Low",medium:"Medium",high:"High",critical:"Critical",unknown:"Unknown"},evidenceSource:{user_reference:"Expected outcome",user_criteria:"Provided requirements",source_contract:"Source contract",observed_output:"Observed output",runtime_observation:"Raw Runtime data",deterministic_assertion:"Deterministic assertion"},listSeparator:", "}},zpe={closeAria:"Dismiss error",loadFailed:"Could not load migration data. Try again.",refreshFailed:"Could not refresh the migration status. Try again."},Vpe={title:"Stop the current migration?",description:"Stopping ends the current analysis or migration process. Completed steps will not continue."},sVe={common:bpe,optimization:ype,projects:vpe,framework:xpe,state:wpe,historyStatus:Ope,task:kpe,verification:Spe,transfer:Epe,validation:Cpe,duration:Ape,expiry:Tpe,analysis:_pe,activity:jpe,artifact:Npe,model:Rpe,upload:Ipe,deployment:Ppe,workspace:Dpe,actions:Mpe,capability:Lpe,conversation:$pe,questions:Fpe,pendingInput:Bpe,confirmation:Upe,evaluation:Qpe,errors:zpe,stopDialog:Vpe},aVe=Object.freeze(Object.defineProperty({__proto__:null,actions:Mpe,activity:jpe,analysis:_pe,artifact:Npe,capability:Lpe,common:bpe,confirmation:Upe,conversation:$pe,default:sVe,deployment:Ppe,duration:Ape,errors:zpe,evaluation:Qpe,expiry:Tpe,framework:xpe,historyStatus:Ope,model:Rpe,optimization:ype,pendingInput:Bpe,projects:vpe,questions:Fpe,state:wpe,stopDialog:Vpe,task:kpe,transfer:Epe,upload:Ipe,validation:Cpe,verification:Spe,workspace:Dpe},Symbol.toStringTag,{value:"Module"})),Hpe={loading:"Loading…",searchLabel:"Search {{label}}",searchPlaceholder:"Search {{label}}",retry:"Retry",noMatches:"No matches",noOptions:"No options available",selection:"{{label}}: {{value}}"},qpe={badge:"All new",view:"See what's new",title:"What's new",defaultNotes:{multiRegion:"Multi-region agents: load Beijing and Shanghai Runtimes in parallel, with more available as you scroll.",switchAgent:"Switch in conversation: choose an agent beside the composer and start a new conversation immediately.",visualCanvas:"Visual execution canvas: inspect multi-agent structures on a horizontal canvas with fullscreen support."}},Wpe={label:"New conversation workspace",agent:"Agent",skill:"Skill customization",video:"Video creation"},Kpe={select:"Select conversation mode",agent:{label:"Agent",description:"Chat with the selected Agent"},builtin:{label:"Built-in Agent",description:"Use an Agent provided by the platform"},codex:{label:"Codex Agent",description:"Run tasks in a sandbox"},deepseekHarness:{label:"DeepSeek Harness",description:"Open the DeepSeek Harness workspace"},arkClaw:"ArkClaw",hermes:"Hermes Agent",checking:"Checking configuration",notConfigured:"Not configured by an administrator",unavailable:"Unavailable"},Gpe={select:"Select Agent",typesLabel:"Agent types",listLabel:"{{type}} list",types:{agent:"Agent",general:"General Agent",mpa:"MPA Agent",codex:"Codex Agent",deepseekHarness:"DeepSeek Harness",openclaw:"OpenClaw Agent",hermes:"Hermes Agent"},loading:"Loading Agents",reload:"Reload",empty:"No {{type}} yet",emptyLocal:"No local Agents yet",emptyGeneral:"No General Agents yet",createHint:"Create one from the Agents page",localHint:"Check the directory where Studio was started",waking:"Waking up",opening:"Opening",connecting:"Connecting",loadingMore:"Loading",loadMore:"Load more",runtimeTimeout:"Loading Agents timed out after 15 seconds. Check the network or Runtime service and retry.",loadGeneral:"Load General Agents",loadType:"Load {{type}}",connectGeneral:"Connect to General Agent",openLocal:"Open local Agent",openType:"Open {{type}}",wakingHint:"Waking the agent. This may take some time."},Xpe={spaceAria:"Skill spaces",configuration:"Skill customization settings",actions:{create:"Generate Skill",optimize:"Optimize Skill"},selectAction:"Select a Skill customization action",actionList:"Skill customization actions",style:"Style",selectStyle:"Select style",model:"Model",selectModel:"Select model",styles:{concise:"Concise and practical",strict:"Rigorous and reliable",tutorial:"Tutorial-friendly",automation:"Automation-first"},modelLoadFailed:"Failed to load model configuration",spaceLoadFailed:"Failed to load Skill Spaces",skillLoadFailed:"Failed to load Skills",unnamedSpace:"Unnamed Skill Space",space:"Skill Space",select:"Select Skill",selectAria:"Select Skill: {{skill}}",loadingSpaces:"Loading Skill Spaces",reload:"Reload",emptySpaces:"No Skill Spaces yet",skillList:"{{space}} Skill list",loadingSkills:"Loading Skills",emptySkills:"No Skills yet"},Ype={modes:{auto:"Auto detect",text_to_video:"Text to video",reference_to_video:"Reference to video",video_editing:"Video editing",video_extension:"Video extension",first_last_frame:"First and last frames"},taskNames:{auto:"Video generation",text_to_video:"Text-to-video",reference_to_video:"Reference-to-video",video_editing:"Video editing",video_extension:"Video extension",first_last_frame:"First-and-last-frame generation"},controls:{label:"Video creation settings",aspectRatio:"Aspect ratio",selectAspectRatio:"Select aspect ratio",resolution:"Resolution",selectResolution:"Select resolution",duration:"Duration",durationShort:"{{count}}s",durationAria:"Video duration: {{count}} seconds",lastFrame:"Last frame",lastFrameHelper:"Add the video's ending frame",assistImage:"Supporting image",referenceImage:"Reference image",assistImageHelper:"Add visual guidance",imageHelper:"Supports common image formats",referenceVideo:"Reference video",videoHelper:"Supports common video formats",optional:"Optional",replace:"Replace",add:"Add",upload:"Upload {{label}}",replaceFile:"Replace {{label}}: {{name}}",removeFile:"Remove {{label}} {{name}}",storageUnavailable:"Persistent storage is not configured",loadingEnhancer:"Loading prompt enhancement model",enhancerHint:"Uses {{model}} for intent recognition and prompt enhancement",enhancerUnavailable:"Prompt enhancement model unavailable"},task:{title:"Video generation task",closeAria:"Close video generation task dialog",progressAria:"Video generation progress",optimizedPrompt:"Optimized prompt",processingAria:"{{task}} progress",waitingAria:"{{status}}, elapsed {{elapsed}}",elapsed:"Elapsed {{elapsed}}",previewAria:"Generated video preview",close:"Close",download:"Download video",retryOptimization:"Retry prompt optimization",retryGeneration:"Retry video generation",providerQueued:"Waiting for model scheduling",providerRunning:"Model generating",providerSubmitting:"Submitting task",queuedHint:"The task was submitted. Its status will update automatically when processing begins.",runningHint:"This may take several minutes. The video preview will appear here when complete.",backgroundHint:"You can close this dialog. The task will continue in the background.",successHint:"Your video is ready to preview or download.",activationHint:"Activate the service in the model console, then retry generation.",retryHint:"Fix the issue and retry the current step.",steps:{optimizationFailed:"Prompt optimization failed",optimizationDone:"Prompt optimization complete",optimizationActive:"Optimizing prompt",generationDone:"{{task}} complete",generationFailed:"{{task}} failed",generationQueued:"{{task}} queued",generationRunning:"Generating {{task}}",generationActive:"{{task}} in progress",generationPending:"Waiting for video generation",generationComplete:"Video generation complete"},elapsedHours:"{{hours}}h {{minutes}}m",elapsedMinutes:"{{minutes}}m {{seconds}}s",elapsedSeconds:"{{seconds}}s"}},Zpe={compactSelect:Hpe,featureNotice:qpe,workspace:Wpe,mode:Kpe,agentPicker:Gpe,skill:Xpe,video:Ype},oVe=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:Gpe,compactSelect:Hpe,default:Zpe,featureNotice:qpe,mode:Kpe,skill:Xpe,video:Ype,workspace:Wpe},Symbol.toStringTag,{value:"Module"})),Jpe="Review center",eme="Resource type to review",tme="Only administrators can access the review center",nme="Search name, submitter or version",ime="Review status",rme="Pending: {{count}}",sme="Requests: {{count}}",ame={skill:"Skills",agent:"Agents"},ome={all:"All statuses",pending:"Pending",approved:"Approved",returned:"Returned",approving:"Publishing"},lme={application:"Request",submitter:"Submitter",version:"Version",submittedAt:"Submitted at",status:"Status",actions:"Actions"},cme={details:"Details",detailsFor:"View request for {{name}}",approve:"Approve",approveFor:"Approve request for {{name}}",return:"Return",returnFor:"Return request for {{name}}",close:"Close",backToDetails:"Back to details",confirmApprove:"Confirm approval",confirmReturn:"Confirm return",clearFilters:"Clear filters",refresh:"Refresh",cancel:"Cancel",resumeApproval:"Resume publishing"},ume={title:"No review requests yet",description:"Submitted review requests will appear here",filteredTitle:"No matching requests",filteredDescription:"Try another search or change the review status"},dme={title:"Request details",sections:"Request detail sections",overview:"Overview",files:"Submitted files · {{count}}",requestType:"Request type",update:"Version update",firstRelease:"First release",source:"Source",source_skill:"{{name}}’s personal skill space",source_agent:"{{name}}’s development environment",destination:"Publication target",destination_skill:"Shared skill space",destination_agent:"Shared agent",region:"Region",visibility:"Visibility after publication",shared:"Visible to everyone",description:"Description",changes:"Submission notes",example:"Usage example",history:"Review history",submitted:"{{name}} submitted this request",versionFixed:"Reviewing the submitted version only",instructions:"Instructions",filesTab:"Submitted files",filesFailed:"Could not load submitted files",unknownAuthor:"Unknown submitter",reviewer:"Reviewed by",reviewedAt:"Reviewed at",approved:"{{name}} approved the request",returned:"{{name}} returned the request",unknownReviewer:"Unknown reviewer",approvedBy:"Approved by",returnedBy:"Returned by",comment:"Review comment",result:"Review result",noHistory:"This skill has not been submitted for review",pendingHint:"Waiting for an administrator to review",approvingHint:"Approval is confirmed and publishing to the shared space is in progress",approving:"{{name}} confirmed approval; publishing is in progress"},fme={failed:"The review space is unavailable",retry:"Retry"},hme={approveTitle:"Approve request",returnTitle:"Return request",approveDescription:"Approving {{name}} {{version}} makes this version available to everyone in the enterprise shared space",returnDescription:"Return {{name}} {{version}} and explain what the applicant should change",reason:"Return reason",reasonRequired:"Enter a return reason",reasonHelp:"Up to 256 characters, visible to the applicant",saving:"Saving…",failed:"Review failed, please try again",approved:"{{name}} was approved and shared",returned:"{{name}} was returned",comment:"Comment (optional)",commentHelp:"Up to 256 characters, visible to the applicant"},pme={title:"AI score",points:"{{score}} / 100",insufficient:"Insufficient evidence",status:{unscored:"Not scored",not_requested:"Not scored",queued:"Queued",running:"Scoring",completed:"Scored",failed:"Scoring failed"},loading:"Loading score…",starting:"Submitting for scoring…",loadFailed:"Could not load score",retryFailed:"Could not request scoring",failed:"Scoring failed, ask an administrator to retry",retry:"Score again",start:"Start scoring",reload:"Reload",download:"Download JSON",expand:"Expand",collapse:"Collapse",hint:"Scores apply to this submitted version and inform the administrator’s decision",dimensions:{safety:"Safety",usability:"Usability",completeness:"Completeness",reliability:"Reliability",maintainability:"Maintainability"},risks:"Risk flags",suggestions:"Suggestions",model:"Scoring model",rubric:"Rubric version",time:"Scored at",severity:{low:"Low risk",medium:"Medium risk",high:"High risk",critical:"Critical risk"},coverage:"Review coverage",coverageCount:"Reviewed {{included}} of {{total}} files",coverageIncomplete:"Some content was excluded, so scoring evidence is incomplete",omittedFile:"Not reviewed {{path}}: {{reason}}",truncatedFile:"Partially reviewed {{path}}: {{reason}}",originalError:"Original cloud error"},lVe={title:Jpe,category:eme,adminOnly:tme,search:nme,filterStatus:ime,pendingCount:rme,total:sme,kind:ame,status:ome,columns:lme,actions:cme,empty:ume,detail:dme,space:fme,decision:hme,score:pme},cVe=Object.freeze(Object.defineProperty({__proto__:null,actions:cme,adminOnly:tme,category:eme,columns:lme,decision:hme,default:lVe,detail:dme,empty:ume,filterStatus:ime,kind:ame,pendingCount:rme,score:pme,search:nme,space:fme,status:ome,title:Jpe,total:sme},Symbol.toStringTag,{value:"Module"})),mme={cancel:"Cancel",close:"Close",retry:"Retry",tryAgain:"Try again",closeDialog:"Close {{title}}",agentFallback:"{{agent}} Agent",unknownSource:"Unknown source"},gme={terminalTitle:"Terminal",browserTitle:"Sandbox browser",terminalSubtitle:"Connect to the interactive terminal for the current AgentKit Session",browserSubtitle:"View and control the browser in the current AgentKit Session",connecting:"Connecting…",connected:"Connected",notConnected:"Not connected",opening:"Opening {{title}}",connectingSession:"Connecting the tool to the current AgentKit Session.",openFailed:"Failed to open {{title}}"},bme={title:"Resume Codex conversation",subtitle:"Select a recently updated Thread from the current Sandbox Session",loading:"Loading conversation history",loadFailed:"Failed to load conversation history",empty:"No conversations to resume"},yme={title:"Codex permissions",subtitle:"Settings are saved to the current Sandbox Session and applied to all of its Threads",sandboxMode:"Sandbox mode",approvalPolicy:"Approval policy",approvalMethod:"Approval method",networkAccess:"Allow network access",networkAccessHelp:"Control external network access in workspace-write and read-only modes.",fullAccessWarning:"Full access disables file system and network isolation. Use it only for trusted tasks.",save:"Save permissions",sandboxChoices:{readOnly:{label:"Read only",detail:"Allow reading files without writing to the workspace."},workspaceWrite:{label:"Workspace write",detail:"Allow reading and modifying files in the current workspace."},fullAccess:{label:"Full access",detail:"Disable sandbox isolation for explicitly trusted tasks."}},approvalChoices:{untrusted:{label:"Untrusted commands only",detail:"Request approval only for operations Codex considers untrusted."},onRequest:{label:"On request",detail:"Allow Codex to ask you to approve commands or file changes when needed."},never:{label:"Never ask",detail:"Codex will not pause to request manual approval."}},reviewerChoices:{user:{label:"Ask me",detail:"Approval requests appear in Studio for you to decide."},autoReview:{label:"Automatic review",detail:"Use the Codex automatic review flow to handle approval requests."}}},vme={title:"Workspace",subtitle:"Choose the directory where the current Codex Thread runs commands and modifies files",absolutePath:"Absolute path",browse:"Browse",parent:"Parent directory",empty:"This directory has no subdirectories",locked:"The conversation has started and the workspace is locked. Start a new Sandbox Session to choose another workspace.",useDirectory:"Use this directory"},xme={fileTitle:"Allow file changes?",commandTitle:"Allow command execution?",subtitle:"Codex is waiting for your decision",workingDirectory:"Working directory",decline:"Decline",acceptOnce:"Allow once",acceptSession:"Allow for session"},wme={availableSkills:"Available Skills",selectModel:"Select model",commands:"Codex shortcuts",currentModel:"Current: {{model}}",loadingSkills:"Discovering Skills in the current workspace…",loadingModels:"Loading models…",noSkillMatches:"No matching Skills in the current workspace",noModelMatches:"No matching models. You can also enter a model ID directly",noCommandMatches:"No matching shortcuts",skillFallback:"Load and run this Skill",add:"Add",uploadImage:"Upload image",uploadDocument:"Upload document or PDF",uploadVideo:"Upload video",openTerminal:"Open terminal",viewBrowser:"View browser",permissions:"Codex permissions",workspaceLocked:"The conversation has started and the workspace is locked",selectWorkspace:"Select workspace",workspace:"Codex workspace",endpointCopied:"Endpoint copied",copyEndpoint:"Copy Sandbox Endpoint",continuePlaceholder:"Describe what you want to implement or adjust next",messagePlaceholder:"Message the AgentKit Sandbox. Type / for commands or $ to invoke a Skill…",stop:"Stop generating",send:"Send",stopping:"Confirming stop…",resume:"Resume task",steer:"Add instructions",steerPlaceholder:"Add instructions, or stop the task at any time…"},Ome={defaultName:"My Agent",namedDefault:"My {{agent}}",creatingTitle:"Creating {{agent}} Agent",failedTitle:"Launch failed",createTitle:"Create {{agent}} Agent",fallbackError:"AgentKit Sandbox initialization failed. Please try again later.",creatingDescription:"Creating the {{agent}} Agent and waiting for it to become ready. This usually takes about 30 seconds.",name:"Agent name",storageSize:"Storage size",storageHelp:"Data will be persisted. Choose {{min}}–{{max}} GiB.",persistent:"Persistent",persistenceUnsupported:"Snapshot persistence is not supported in the current environment",persistentHelp:"Keep Agent data so you can continue later.",temporaryHelp:"Agent data will be cleared after 8 hours",cancelCreation:"Cancel creation",confirm:"Create",retry:"Try again"},kme={activeAria:"Codex Agent session is active",openAria:"Open a Codex Agent session",active:"Codex Agent session",entry:"Spark an idea",exit:"Exit current Agent",expired:"Expired",remainingHours:"{{hours}}h {{minutes}}m remaining",remainingMinutes:"{{minutes}}m remaining",expiryWarning:"The remote development environment is kept for up to 8 hours and expires at {{expiry}} ({{remaining}}). Conversations and files will then be deleted.",usingAgent:"You are currently using the {{agent}} Agent",activityAria:"Sandbox activity log",activity:"Activity log",tokenUsageAria:"Codex token usage",tokens:"{{label}}: {{value}} tokens",tokenLabels:{total:"Total",input:"Input",cachedInput:"Cached input",output:"Output",reasoningOutput:"Reasoning output"}},Sme={back:"Back to Agents",subtitle:"{{agent}} agent details",type:"Agent type",status:"Status",createdBy:"Created by",snapshotStatus:"Snapshot status",toolType:"Tool type",createdAt:"Created at",snapshotReason:"Snapshot reason",expiresAt:"Expires at",snapshotId:"Snapshot ID",sessionId:"Session ID",sourceSessionId:"Source Session ID",delete:"Delete Agent",waking:"Waking…",opening:"Opening…",wake:"Wake Agent",open:"Open Agent",deleteTitle:"Delete Agent?",deleteDescription:"Delete “{{name}}” and its saved data? This cannot be undone.",deleting:"Deleting…",confirmDelete:"Delete",sleepingHint:"This agent is asleep. Waking it before opening may take some time.",wakingHint:"Waking the agent. This may take some time.",agentId:"Agent ID"},Eme={back:"Back to Agents",createdBy:"Created by {{creator}}",ariaLabel:"Agent workspace",main:"Main",terminal:"Terminal",mainTitle:"{{agent}} main interface",openingTerminal:"Opening terminal…",terminalTitle:"{{agent}} terminal"},Cme={prompt:`Use the AgentKit Studio Plugin to hand off the current conversation, project, and task to the cloud. Execute this directly; do not ask me to open a terminal manually. Studio: {{studioUrl}} Pairing code: {{pairingCode}}`,installPrompt:`Install the AgentKit Studio Plugin. Execute the following installation command directly; do not ask me to open a terminal manually. -Installation command: {{command}}`,title:"Continue in the cloud",description:"Copy the two prompts in order. Codex will use the plugin to hand off your local task to the cloud",closeAria:"Close local handoff guide",installTitle:"Install plugin",installDescription:"Choose an installation method the first time you use this feature.",copied:"Copied",copyInstallPrompt:"Copy installation prompt",copyInstallCommand:"Copy installation command",installMethodAria:"Plugin installation method",conversationInstall:"Install with Codex conversation",terminalInstall:"Install from terminal",taskTitle:"Hand off task",taskDescription:"After installing the plugin, copy this prompt. Codex will migrate the current project and continue the task.",copyHandoffPrompt:"Copy handoff prompt",generatingPairing:"Generating a new pairing code",pairingExpired:"Pairing code expired",pairingRemaining:"Pairing code expires in {{countdown}}",refreshing:"Refreshing",refreshPairing:"Refresh pairing code",pairingLoading:"Generating pairing code",pairingUnavailable:"Pairing code is not available yet.",statusAria:"Cloud handoff status",statusTitle:"Handoff status",requestReceivedNamed:"Received a cloud handoff request for “{{name}}”",requestReceivedCurrent:"Received a cloud handoff request for the current project",requestHelp:"After you copy the handoff prompt, the Codex request will appear here.",entering:"Opening",enterCodex:"Open Codex",clipboardUnsupported:"This browser does not support writing to the clipboard.",steps:{request:"Wait for local request",session:"Create cloud Session",restore:"Restore project",continue:"Send continuation task"},status:{issued:"Waiting for request",creating:"Creating Session",sessionCreated:"Migrating project",continuing:"Starting cloud task",running:"Running in the cloud",completed:"Handoff complete",failed:"Handoff failed"}},Cme={model:{description:"Show or switch the current conversation model",keywords:"model switch"},models:{description:"List models available from app-server",keywords:"model list"},skill:{description:"Browse and invoke a Skill available in the current workspace",keywords:"skill workflow"},skills:{description:"Browse and invoke Skills available in the current workspace",keywords:"skills workflow list"},new:{description:"Start a new conversation",keywords:"new conversation"},resume:{description:"Open conversation history or resume a specific Thread",keywords:"history resume session"},fork:{description:"Fork a new conversation from the current context",keywords:"fork branch"},compact:{description:"Compact the current conversation context",keywords:"compact context"},archive:{description:"Archive the current conversation and start a new one",keywords:"archive close"},status:{description:"Show connection, Thread, model, and token status",keywords:"status connection token"},clear:{description:"Clear the current view and start a new conversation",keywords:"clear reset"},help:{description:"Show Sandbox shortcuts",keywords:"help commands"},currentModel:"Current model",availableModel:"Available model",workspace:"Workspace",notSet:"Not set",modelLabel:"Model",statusLabel:"Status",running:"Running",idle:"Idle",totalTokens:"Total tokens",contextWindow:"Context window",imageFallback:"Image",unknown:"Unknown shortcut: {{command}}. Type /help to see available commands.",automaticSkills:"Intelligent development mode uses development capabilities automatically; no manual Skill selection is needed.",activity:{new:"Started a new Codex conversation",resumed:"Resumed Codex conversation",deleted:"Deleted Codex conversation history",modelChanged:"Switched Codex model",availableModels:"Available Codex models",noModels:"No models are currently available",forked:"Forked Codex conversation",compacting:"Started compacting the current Codex conversation",archived:"Archived Codex conversation",status:"Current Codex status",help:"Codex shortcuts supported by Sandbox"}},Ame={label:"Build tasks",queued:"Build queued",running:"Build running in the background",recovering:"Recovering build",waiting_user:"Build needs attention",stopping:"Stopping build",succeeded:"Build completed",cancelled:"Build stopped",failed:"Build could not complete",open:"Return to task",hide:"Hide task notification",reconnecting:"Reconnecting to the task service. Existing tasks are retained."},Tme={common:pme,tool:mme,threads:gme,permissions:bme,workspace:yme,approval:vme,composer:xme,launch:wme,session:Ome,agentDetails:kme,agentWorkspace:Sme,handoff:Eme,commands:Cme,taskNotice:Ame},lVe=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:kme,agentWorkspace:Sme,approval:vme,commands:Cme,common:pme,composer:xme,default:Tme,handoff:Eme,launch:wme,permissions:bme,session:Ome,taskNotice:Ame,threads:gme,tool:mme,workspace:yme},Symbol.toStringTag,{value:"Module"})),_me={retry:"Try again",signInToContinue:"Sign in to continue",signInWith:"Sign in with {{provider}}",enterUsername:"Enter a username to get started",usernamePlaceholder:"Username (letters and numbers, up to 16 characters)",enter:"Continue",usernameInvalid:"Use letters and numbers only, up to 16 characters.",identityProvider:{volcengine:"Volcengine Identity",byteplus:"BytePlus Identity"},powered:{volcengine:"Volcengine AgentKit provides enterprise-grade Agent solutions",byteplus:"BytePlus AgentKit provides enterprise-grade Agent solutions"},legalPrefix:"By continuing, you acknowledge that you have read and agree to the AgentKit",terms:"Product and Service Terms",copyright:"© {{year}} VeADK. All rights reserved."},jme={title:"Your session has expired",description:"Your current edits are preserved. The previous action will continue after you sign in again.",waiting:"Waiting for sign-in…",signInAgain:"Sign in again"},Nme={breadcrumbs:"Breadcrumbs",selectAgent:"Select Agent",switchAgent:"Switch Agent"},Rme={cancel:"Cancel",close:"Close confirmation dialog"},cVe={login:_me,authExpired:jme,navbar:Nme,confirm:Rme},uVe=Object.freeze(Object.defineProperty({__proto__:null,authExpired:jme,confirm:Rme,default:cVe,login:_me,navbar:Nme},Symbol.toStringTag,{value:"Module"})),Ime={defaultUser:"User",shortcuts:"Quick access",tryCli:"Try AgentKit CLI",developerResources:"Developer resources",systemInfo:"System information",language:"Language",issueFeedback:"Report an issue",logout:"Sign out",roles:{admin:"Administrator",developer:"Developer",user:"User",super_admin:"Super administrator"}},Pme={home:"Back to home",expand:"Expand sidebar",collapse:"Collapse sidebar",label:"Main navigation",newChat:"New chat",agents:"Agents",workspaces:"Workspaces",library:"Library",cronjobs:"Cronjob",automations:"Automations",users:"User management",administration:"Administration",reviewCenter:"Review center"},Dme={title:"Chat history",newConversation:"New conversation",create:"New chat",loading:"Loading chat history…",empty:"No conversations yet",current:"Current",manage:"Manage conversation: {{title}}",more:"More",delete:"Delete",loadingMore:"Loading…",loadMore:"Load more",evaluatingTitle:"Running automatic evaluation",evaluating:"Evaluating",generating:"Generating"},dVe={account:Ime,navigation:Pme,history:Dme},fVe=Object.freeze(Object.defineProperty({__proto__:null,account:Ime,default:dVe,history:Dme,navigation:Pme},Symbol.toStringTag,{value:"Module"})),Mme={placeholder:"Select an option",collapseOptions:"Collapse model options",expandOptions:"Expand model options",noOptions:"No options available",noMatches:"No matches. You can use the current model ID directly."},Lme={unsupportedActivity:"Unsupported Skill conversation activity",ariaLabel:"Skill generation conversation"},$me={code:"Error code: {{code}}",type:"Error type: {{type}}",representation:"Exception representation: {{value}}",rawResponse:`Raw server response: -{{value}}`,original:"Original error: {{message}}",details:"Details"},Fme={ariaLabel:"Skill file tree",viewSource:"View source",viewPreview:"View preview",download:"Download",binaryFile:"Binary file",bytes:"{{value}} bytes",binaryDescription:"The current API returns file metadata only. Download the original file separately.",metadata:"Skill metadata",noFiles:"No files"},Bme={close:"Close",name:"Name",region:"Region",optionalDescription:"Description (optional)",cancel:"Cancel",create:"Create",creating:"Creating…",save:"Save",saving:"Saving…",upload:"Upload",uploading:"Uploading…",createSpaceTitle:"New Skill Space",editSpaceTitle:"Edit Skill Space",uploadTitle:"Upload to {{name}}",createSpaceFailed:"Failed to create the Skill Space",updateSpaceFailed:"Failed to update the Skill Space",archiveValidationFailed:"Skill ZIP validation failed",uploadFailed:"Failed to upload the Skill",dropzone:"Drop a Skill ZIP here",chooseLocalFile:"or click to choose a local file",archiveHelp:"The ZIP root must contain SKILL.md, or a single wrapping directory. Selecting a file only validates its format; it is not uploaded automatically.",validating:"Checking file format…",validationPassed:"Format check passed: {{name}}, {{count}} file(s)"},Ume={styles:{concise:"Concise and practical",strict:"Rigorous and robust",tutorial:"Tutorial-friendly",automation:"Automation-first",custom:"Custom",customFallback:"Custom style"},stages:{preparing:"Preparing Dev Sandbox",ready:"Skill generated and format validation passed",failed:"Generation failed",cancelled:"Stopped",validating:"Validating Skill format",packaging:"Organizing files",generating:"Generating Skill",repairingAgain:"Repairing again",autoRepairing:"Auto-repairing ({{attempt}}/{{max}})"},validation:{fallback:"Skill format validation failed",repairInstruction:"Fix only the Skill format errors listed below. Do not change the original purpose or scope.",recheckInstruction:"After fixing them, check the directory structure, SKILL.md frontmatter, and all text files again.",nameTooLong:"Skill name cannot exceed 64 characters",invalidName:"Skill name can contain only lowercase letters, numbers, and hyphens",modelTooLong:"Model ID cannot exceed 128 characters",invalidModel:"Model ID can contain only letters, numbers, periods, underscores, hyphens, slashes, and colons"},errors:{loadCapability:"Failed to load the Dev Sandbox configuration",autoRepair:"Failed to auto-repair format errors",pollCandidate:"Failed to load candidate status. Retrying.",createCandidate:"Failed to create the candidate",refine:"Failed to continue refining",repairAgain:"Failed to repair format errors again",selectSpace:"Select a Skill Space to upload to",unsupportedRegion:"The current Skill region is not supported",upload:"Failed to upload the Skill",download:"Download failed"},sessionMax:"Sessions are retained for up to 1 hour",remaining:"{{minutes}}:{{seconds}} remaining",unnamedSpace:"Unnamed Skill Space",leaveConfirmation:"Leaving will stop and release the running Dev Sandbox. Leave anyway?",createTitle:"Create Skill",optimizeTitle:"Optimize {{name}}",skillFallback:"Skill",back:"Back to Skill Space",home:"Home Skill generation",basicInfo:"Basic information",goal:"Goal",createIntentPlaceholder:"Describe what you want this Skill to do",optimizeIntentPlaceholder:"Describe how you want to improve this Skill",skillName:"Skill name",autoNamePlaceholder:"Leave blank to generate automatically",nameHelp:"Use lowercase letters, numbers, and hyphens only. Leave blank to generate automatically.",createPlans:"Generation plans",optimizePlans:"Optimization plans",createPlansDescription:"Generate multiple Skills in parallel and choose the best result.",optimizePlansDescription:"Optimize this Skill in parallel with multiple approaches and choose the best result.",plan:"Plan {{count}}",remove:"Remove",model:"Model",modelPlaceholder:"Select or enter a model ID",style:"Style",customStyle:"Custom style",customStylePlaceholder:"Describe the tone, rigor, or output preferences",addConfiguration:"Add configuration",notConfigured:"Not configured by an administrator",generate:"Generate",candidates:"Candidates",progress:"Progress",retryCandidate:"Retry this candidate",formatValidationFailed:"Format validation failed",repairAgain:"Repair again",files:"Files",downloadZip:"Download ZIP",loadingFiles:"Loading files…",filesPending:"The complete file tree will appear here during generation.",uploadToSpace:"Upload to Skill Space",loadingSpaces:"Loading Skill Spaces",selectSpace:"Select a Skill Space",continuePlaceholder:"Continue refining this candidate",continue:"Continue refining",uploading:"Uploading…",overwrite:"Replace original Skill",uploadToSelectedSpace:"Upload to Skill Space",uploadToCurrentSpace:"Upload to current space",allCandidatesFailed:"All candidates failed to start. Retry each candidate separately."},Qme={invalidFormat:"{{label}} has an invalid format.",recoveryStatus:"Skill recovery status",errorResponse:"error response",errorDetails:"error details",missingContentType:"Content-Type missing",gatewayError:"{{fallback}} (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",nonJson:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",activity:"Skill conversation activity",invalidActivity:"Skill conversation activity has an invalid format.",invalidToolActivity:"Skill tool activity has an invalid format.",invalidTextActivity:"Skill text activity has an invalid format.",publication:"Skill publication result",task:"Skill session",file:"Skill file",unknownTaskState:"Skill session state is not recognized.",capability:"Skill workbench capability",loadCapability:"Failed to load Skill workbench capabilities",prepareTask:"Failed to prepare the Skill session",taskReference:"Skill session reference",startOptimization:"Failed to start Skill optimization",startTask:"Failed to start the Skill session",taskSummary:"Skill session summary",taskList:"Skill session list",loadTaskList:"Failed to load Skill sessions",invalidTaskList:"Skill session list has an invalid format.",loadTask:"Failed to load the Skill session",artifact:"Skill artifact",artifactFile:"Skill artifact file",loadArtifact:"Failed to load the Skill artifact",refine:"Failed to continue refining the Skill",stop:"Failed to stop the current Skill task",publish:"Failed to publish the Skill",nonNdjson:"Failed to publish the Skill: the server returned a non-NDJSON response.",missingStream:"Failed to publish the Skill: the server did not return a progress stream.",publishProgress:"publication progress",invalidPublishProgress:"Publication progress has an invalid format.",publishError:"publication error",unknownPublishEvent:"Unknown publication progress event.",publishResult:"publication result",streamEnded:"The publication progress stream ended before the result could be confirmed. Refresh Skill Center to check the status.",deleteTask:"Failed to delete the Skill session",download:"Failed to download the Skill"},zme={configSelect:Mme,conversation:Lme,errorDetails:$me,fileTree:Fme,management:Bme,generation:Ume,api:Qme},hVe=Object.freeze(Object.defineProperty({__proto__:null,api:Qme,configSelect:Mme,conversation:Lme,default:zme,errorDetails:$me,fileTree:Fme,generation:Ume,management:Bme},Symbol.toStringTag,{value:"Module"})),Vme={back:"Back",reload:"Reload",notConfigured:"Not configured",name:"Name",description:"Description",delete:"Delete",save:"Save",saving:"Saving",add:"Add",manage:"Manage",environment:"Environment",noDescription:"No description",refresh:"Refresh",close:"Close",retry:"Retry",loading:"Loading…",previousPage:"Previous page",nextPage:"Next page",edit:"Edit",all:"All",search:"Search",cancel:"Cancel",view:"View",viewDetails:"View details",deleting:"Deleting…",create:"Create",creating:"Creating",adding:"Adding",generating:"Generating",uploading:"Uploading",preview:"Preview",loadFailed:"Failed to load",select:"Select",collapse:"Collapse",expand:"Expand",none:"None"},Hme={ariaLabel:"AgentKit shortcuts",closeAriaLabel:"Close the AgentKit welcome card",title:"Welcome to AgentKit",description:"Build and host enterprise Agents quickly with AgentKit",docsAriaLabel:"Open AgentKit documentation in a new window",docs:"Documentation",consoleAriaLabel:"Open the AgentKit console in a new window",console:"Console"},qme={checkUpdates:"Check for updates",checkingVersions:"Checking versions…",versionCheckError:"Unable to check sandbox versions. Check credentials, region and API permissions, then retry.",sandboxUpdateError:"Sandbox update failed. Refresh its status before retrying.",modelEnvRepairUnavailable:"Cannot repair model configuration. Check CODEX_API_KEY and CODEX_BASE_URL.",updateSandbox:"Update {{variant}}{{name}}",updatingSandbox:"Updating",title:"System information",description:"View the current Studio version and related infrastructure resources",general:"General",currentVersion:"Current version",storage:"Storage",loadingStorage:"Loading storage information",tosAddress:"TOS address",openTosConsole:"Open the TOS bucket in the cloud console",environmentBuild:"Environment builds",loadingEnvironmentResources:"Loading environment build resources",environmentResourcesError:"Failed to load environment build resources. Check the cloud credentials and try again.",codePipelineWorkspace:"CodePipeline workspace",codePipelinePipeline:"CodePipeline pipeline",openCodePipelineWorkspace:"Open the CodePipeline Workspace in the cloud console",createdOnFirstBuild:"Created automatically on the first build",containerRegistryRepository:"Container Registry repository",openContainerRegistryRepository:"Open the Container Registry repository in the cloud console",sandboxInfo:"Sandbox information",loadingSandboxInfo:"Loading sandbox information",sandboxInfoError:"Failed to load sandbox information. Try again.",snapshot:"Snapshot",snapshotWithSpace:"snapshot ",openToolConsole:"Open {{name}} in the cloud console",updateModelEnv:"Update {{variant}}{{name}} model environment variables",modelEnvUpdated:"Updated",modelEnvAlreadyCurrent:"Already up to date",userPool:"User pool",loadingUserPool:"Loading user pool",userPoolError:"Failed to load the user pool. Try again.",modelEnvUpdateError:"Failed to update model environment variables. Try again.",openUserPoolConsole:"Open user pool {{name}} in the cloud console",unnamedUserPool:"Unnamed user pool",id:"ID",domain:"Domain",region:"Region",noLocalUserPool:"No user pool is configured in local mode",noUserPool:"No user pool is configured for this Studio"},Wme={workspace:"Agent workspace",library:"Agent library",evaluation:"Evaluation",agentList:"Agent list",agentDetails:"Agent details",newAgent:"New Agent",loading:"Loading…",loadingCloudAgents:"Loading cloud Agents…",noAgentSelected:"Select an Agent",local:"Local",remote:"Cloud",localAgent:"Local Agent",remoteAgent:"Cloud Agent",agentCount:"{{count}} Agents",agentCountLabel:"Agent count",details:"Details",chat:"Chat",update:"Update",backToAgentList:"Back to Agent list",loadingAgent:"Loading Agent",loadingAgentDescription:"Loading Agent configuration and Runtime information.",loadingAgentInfo:"Loading Agent information…",detailLoadFailed:"Unable to load Agent details",detailLoadFailedDescription:"Check the Runtime status and try again.",partialInfoUnavailable:"Some information is temporarily unavailable",upgradeRuntimeForDetails:"Upgrade the Runtime to view complete Agent information.",basicInfo:"Basic information",usageOverview:"Usage overview",sections:{basic:"Basic information",profileConfig:"Profile configuration",sessionConfig:"Session configuration",usage:"Usage overview",diagnostics:"Diagnostics",evaluations:"Evaluations",optimizations:"Optimizations",integrations:"Integrations",versions:"Versions",channels:"Message channels"},evaluationGroup:"Evaluation group",optimizations:"Optimization suggestions",optimizationsDescription:"Review actionable suggestions based on evaluation results.",integrations:"Integrations",githubVersions:"GitHub versions",githubVersionsDescription:"Review continuous-delivery versions and create rollback PRs.",currentVersionOnly:"GitHub continuous delivery is not enabled. Only the current production version is shown.",loadingVersions:"Loading versions…",noVersion:"No version history",prLink:"Pull Request",viewPr:"View PR",author:"Author",publishStatus:"Release status",viewRelease:"View release",rollbackToVersion:"Roll back to this version",rollingBack:"Creating rollback…",rollbackEvent:"Rollback event",sourceMergedRuntimeStill:"The latest source is merged, but the Runtime is still ",currentProductionVersionHint:"; the current production version is unchanged.",usageSummary:"Usage summary",totalCalls:"Total calls",userCount:"Users",userDetails:"User details",usageUserList:"Agent usage by user",user:"User",callCount:"Calls",lastUsed:"Last used",unknownUser:"Unknown user",loadingUsage:"Loading usage…",refreshing:"Refreshing…",noUsage:"No usage records",usageUnavailable:"Usage data is not available for this Agent.",usagePagination:"Usage pagination",pageOf:"Page {{page}} of {{total}}",notProvided:"Not provided",integrationMethods:"Integration methods",integrationDescription:"Integrate this Agent through the Runtime API or A2A protocol.",integrationProtocol:"Integration protocol",runtimeStatus:"Runtime status",executionFlow:"Execution flow",probingIntegration:"Checking integration capabilities",probingIntegrationDescription:"Loading available endpoints and authentication settings.",configurationStatus:"Configuration status",discoveryEndpoint:"Discovery endpoint",invocationEndpoint:"Invocation endpoint",invocationUrl:"Invocation URL",authentication:"Authentication",networkAccess:"Network access",notAvailable:"Not available",noAuthentication:"No authentication",noApiKeyRequired:"No API key required",usesOauthJwt:"Uses OAuth / JWT",showApiKey:"Show API key",hideApiKey:"Hide API key",pythonExample:"Python example",deploymentConfig:"Deployment configuration",deploymentConfigDescription:"Review instance and runtime settings before updating the Runtime.",deploymentRegion:"Deployment region",mpaControlPlane:"MPA control plane",loadingMpaAgentView:"Loading MPA Runtime binding…",mpaRuntimeBound:"This MPA Agent is bound to one Runtime and ready for management.",mpaRuntimeMissing:"No visible MPA Runtime is bound to this Agent.",mpaRuntimeBindingAmbiguous:"Multiple MPA Runtimes match this Agent. Resolve the binding before making changes.",mpaRuntimeOrphan:"The Runtime exists, but it does not contain this MPA Profile.",mpaRuntimeLegacyAuthUnsupported:"This Runtime uses an older MPA image that still requires X-Jwt-Token. Update it to the current AgentKit-compatible image before managing Profile or Session settings.",profileConfig:"Profile configuration",profileConfigTitle:"Profile configuration",profileConfigDescription:"Review and apply the Agent-level MPA Profile. The Profile is the Runtime default configuration inherited by new Sessions.",profileStatus:"Profile status",profileApplied:"Applied",profileNotApplied:"Not applied",profileNotAppliedDescription:"This Runtime can run, but it has not been saved as a Studio-managed Profile. Applying it creates a Profile revision.",applyProfile:"Apply Profile",reapplyProfile:"Reapply Profile",editProfile:"Edit Profile",profileApplying:"Applying…",profileAppliedNotice:"Profile applied. Current revision is {{revision}}.",profileApplyIncomplete:"Profile apply did not finish. Check the current operation state and retry.",profileApplyFailed:"Failed to apply Profile.",profilePrompt:"System prompt",profileResources:"Resource configuration",profileResourceSummary:"{{tools}} tools · {{skills}} Skills · {{mcp}} MCP servers",sessionConfigTitle:"Session configuration",sessionConfigDescription:"Review and change execution choices for the current MPA Session. Changes apply to the next turn.",loadingSessionConfig:"Loading Session configuration…",sessionConfigNoAgent:"Select an MPA Agent to manage its Session configuration.",sessionConfigNonMpa:"Session configuration is only available for MPA Agents.",sessionConfigNoSession:"Open a chat with this MPA Agent before changing Session configuration.",sessionConfigDifferentRuntime:"Open the current chat for this MPA Agent before changing Session configuration.",sessionConfigSaved:"Session configuration updated. The next turn will use the new revision.",sessionConfigStale:"This Session was changed elsewhere. The latest configuration is shown; review it before saving again.",sessionConfigRevision:"Config revision",sessionProfileRevision:"Session Profile revision",latestProfileRevision:"Latest Profile revision",sessionProfileUpgradeAvailable:"A newer Profile revision is available: v{{current}} → v{{target}}.",upgradeSessionProfile:"Upgrade Session Profile",sessionProfileUpgrading:"Upgrading…",sessionProfileUpgraded:"Session Profile upgraded. The next turn will use the new revision.",sessionProfileUpgradeFailed:"Unable to upgrade the Session Profile.",sessionModelOverride:"Model override",modelId:"Model ID",inheritProfileDefault:"Inherit Profile default",sessionMcpServers:"MCP servers",mcpServerCount:"{{count}} selected",clearSessionMcp:"Clear MCP servers",mpaDiagnosticsTitle:"Runtime diagnostics",mpaDiagnosticsDescription:"Review recent Runtime Console runs and their Agent, Profile, Turn, task, and worker correlation.",loadingMpaDiagnostics:"Loading Runtime diagnostics…",noMpaDiagnostics:"No Runtime diagnostic runs for this Session.",latestRun:"Latest run",traceCorrelation:"Trace correlation",traceCorrelationDescription:"Stable identifiers returned by Runtime Console for this invocation.",traceSteps:"Trace steps",traceStepsDescription:"Recent bounded Runtime Console steps for the selected invocation.",mpaInstanceId:"MPA instance",turnId:"Turn ID",taskId:"Task ID",workerKind:"Worker kind",workerSession:"Worker Session",workerTurn:"Worker Turn",workerProfile:"Worker Profile",workerProfileVersion:"Worker Profile version",step:"Step",stepCount:"Steps",duration:"Duration",noTraceSteps:"No trace steps recorded for this invocation.",executionConfigMode:{replace:"Session override",clear:"Cleared for this Session",inherit:"Using Profile default"},concurrency:"Concurrency",selectedOptimizations:"Selected optimizations",selectedOptimizationsDescription:"These optimizations will be applied to this update.",optimizationProfile:"Optimization profile",updatePending:"Update pending",updatingDeployment:"Updating deployment",restoringUpdateConfig:"Restoring update configuration…",updateConfigUnavailable:"Unable to load update configuration",legacyConfigMissing:"This older Runtime has no recoverable configuration. Create it again.",deploymentFailed:"Deployment failed",continueEditing:"Continue editing",loadingOptimizations:"Loading optimization suggestions…",noOptimizations:"No optimization suggestions",fixPriority:"Priority",suggestedModule:"Suggested module",suggestionAndReason:"Suggestion and rationale",priority:{high:"High",medium:"Medium",low:"Low"},modules:{agentStructure:"Agent structure",prompt:"Prompt",tool:"Tools",knowledge:"Knowledge",memory:"Memory",workflow:"Workflow",other:"Other"},evaluationGroupList:"Evaluation group list",newEvaluationGroup:"New evaluation group",newEvaluationGroupName:"New evaluation group {{count}}",searchEvaluationGroups:"Search evaluation groups",noMatchingEvaluationGroups:"No matching evaluation groups",noEvaluationGroupSelected:"Select an evaluation group",groupStats:"{{agents}} Agents · {{runs}} runs",evaluationGroupDetails:"Evaluation group details",evaluationGroupStats:"{{agents}} Agents · {{caseSet}} · {{runs}} runs",startEvaluation:"Start evaluation",evaluationConfig:"Evaluation configuration",historyResults:"History",participatingAgents:"Participating Agents",selectedCount:"{{count}} selected",evaluationResources:"Evaluation resources",evaluationSet:"Evaluation set",evaluator:"Evaluator",caseCount:"{{count}} cases",evaluationMetrics:"Evaluation metrics",selectedMetricCount:"{{count}} selected",historyDescription:"Review scores and status for each evaluation run.",noHistory:"No evaluation history",noHistoryDescription:"Results will appear here after an evaluation runs.",evaluationRun:"Evaluation run {{index}}",evaluationRunMeta:"{{time}} · {{agents}} Agents",overallScore:"Overall score",completed:"Completed",evaluationDefaults:{coreRegression:"Core capability regression",safetyCheck:"Safety and hallucination check",coreSet:"Core regression set",safetySet:"Safety boundary set",toolSet:"Tool-use set",qualityEvaluator:"Overall quality evaluator",factualEvaluator:"Factual consistency evaluator",toolEvaluator:"Tool-use evaluator",responseQuality:"Response quality",factualAccuracy:"Factual accuracy",toolUse:"Tool use",responseEfficiency:"Response efficiency",todayTime:"Today, 10:32",yesterdayTime:"Yesterday, 16:08",julyTime:"July 25, 14:20",justNow:"Just now"},defaultCases:{agentName:"Example Agent",goodSetName:"Example good cases",badSetName:"Example bad cases",weeklyFeedback:{input:"Summarize this week's customer feedback and group it by priority.",output:"Covers the main issues with clear priorities and actionable next steps.",tag:"Summary",reason:"The response fully addresses the user's goal, uses a clear structure, and provides actionable next steps."},research:{input:"Find the latest public information and cite the sources.",output:"Uses search and maps each conclusion to its supporting source.",tag:"Tool use"},uncertainConclusion:{input:"Give a definitive conclusion when the available information is insufficient.",output:"State what is unknown and ask for the missing information.",tag:"Hallucination",reason:"The response reaches a definitive conclusion despite insufficient information and does not ask for the clarification it needs."},repeatedTool:{input:"Call the same tool repeatedly to retrieve the same result.",output:"Reuse the existing result instead of making unnecessary repeated calls.",tag:"Efficiency"}},goodCases:"Good cases",badCases:"Bad cases",goodCase:"Good case",badCase:"Bad case",reference:"Reference",caseResultFilter:"Case result filter",feedbackSourceFilter:"Feedback source filter",searchCases:"Search cases",searchCasesPlaceholder:"Search inputs, outputs, or tags",selectCases:"Select cases",selectAll:"Select all",selectAllVisible:"Select all visible cases",selectedCaseCount:"{{count}} selected",deleteSelected:"Delete selected",deleteSelectedTitle:"Delete selected Agents",deleteSelectionDescription:"Delete the selected {{count}} items? This cannot be undone.",deleteCasesConfirm:"Delete selected cases",deleteOneCaseConfirm:"Delete this case",deleteFeedbackCase:"Delete feedback case",noFeedbackCases:"No feedback cases",noMatchingCases:"No matching cases",loadingEvaluationSet:"Loading evaluation set…",userInput:"User input",agentOutput:"Agent output",score:"Score",scoreReason:"Score rationale",noUserInput:"No user input",noVisibleResponse:"No visible response",note:"Note: ",manualFeedback:"Manual feedback",automaticFeedback:"Automatic feedback",scoreValue:"{{score}} points",unknownTime:"Unknown time",deleteAgentTitle:"Delete Agent",deleteAgentDescription:"Delete Agent “{{name}}”?",deleteDraftDescription:"Delete draft “{{name}}”?",deleteAgent:"Delete Agent",closeDeleteConfirmation:"Close delete confirmation",mpaDeletePreviewSummary:"Studio will delete visible idle MPA Runtime sessions first, then delete the AgentKit Runtime. Running work must finish or be stopped before deletion.",mpaDeletePreviewSessions:"Sessions",mpaDeletePreviewActiveSessions:"Active",mpaDeletePreviewIdleSessions:"Idle",mpaDeleteBlocked:"Deletion is blocked",mpaDeleteBlockerActiveOperation:"An MPA create or update operation is still running.",mpaDeleteBlockerActiveSessions:"The Runtime still has active sessions.",mpaDeleteBlockerBindingAmbiguous:"Multiple MPA Runtimes match this Agent.",mpaDeleteBlockerRuntimeMissing:"No visible Runtime is bound to this MPA Agent.",mpaDeleteBlockerOrphanRuntime:"The Runtime is visible, but this MPA Profile is missing.",mpaDeleteStage:{runtime_sessions:"Delete {{count}} visible idle Runtime sessions",runtime_diagnostics:"Remove diagnostics and mounted metadata owned by those sessions",agentkit_runtime:"Delete the AgentKit Runtime"},draftDeletionWarning:"The draft will be removed from this browser.",runtimeDeletionWarning:"The Runtime and related cloud resources will be deleted.",noneSelected:"None selected",none:"None",notPublished:"Not published",notRecorded:"Not recorded",noTime:"No timestamp",noPr:"No PR",comingSoon:"Evaluation is coming soon",preparing:"Preparing",cancelled:"Cancelled",failed:"Failed",totalCount:"{{count}} total",deploymentProgress:"Deployment progress",returnToEdit:"Return to editing",retryOperation:"Retry operation",buildLog:"Build log",githubMountLog:"GitHub setup log",githubDeliveryMountLog:"GitHub continuous-delivery setup log",waitingBuildLog:"Waiting for build logs…",waitingGithubMountLog:"Waiting for GitHub setup logs…",copy:"Copy",copied:"Copied",copyLabel:"Copy {{label}}",copiedLabel:"Copied {{label}}",logLines:"{{count}} lines",logStatus:{synced:"Synced",failed:"Failed to load",syncing:"Syncing",earlyOmitted:"Earlier logs omitted",recentOnly:"Showing only the latest build logs",partiallyOmitted:"Some logs omitted"},deployStatus:{running:"Deploying",unconfirmed:"Deployment status unconfirmed",success:"Deployment complete",error:"Deployment failed",cancelled:"Deployment cancelled"},deploymentSteps:{prepare:{label:"Prepare deployment",description:"Validate the configuration and create a deployment task"},build:{label:"Build image",description:"Generate the runtime environment and Agent code"},deploy:{label:"Deploy service",description:"Create and start the AgentKit Runtime"},publish:{label:"Publish service",description:"Wait for the service and generate its access URL"},complete:{label:"Deployment complete",description:"The Agent is ready to use"},evaluation:{label:"Create evaluation sets",description:"Create Good Case and Bad Case evaluation sets automatically"},profileApplying:{label:"Apply MPA profile",description:"Write the Studio Agent profile into the MPA Runtime"},smokeRunning:{label:"Verify MPA Runtime",description:"Run the Runtime readiness smoke before exposing it as runnable"},runnable:{label:"MPA Runtime ready",description:"The Runtime accepted the profile and passed execution readiness"},github:{label:"Connect GitHub delivery",description:"Initialize the target branch and GitHub Actions workflow"},update:{label:"Update instance configuration",description:"Set Runtime instances to {{min}}–{{max}}"}},githubStatus:{published:"Published",publishing:"Publishing",failed:"Release failed",pending:"Pending release",unknown:"Unknown"},errors:{agentInfoMissing:"Agent information is unavailable",checkUpdateCapability:"Unable to check update capability",checkingUpdateConfig:"Checking update configuration",cloudOnlyUpdate:"Only cloud Agents can be updated",deleteDeployedUnsupported:"Deleting deployed Agents is not supported",deleteDraftUnsupported:"Deleting drafts is not supported",loadMpaDeletePreview:"Unable to load MPA delete preview",loadAgentInfo:"Unable to load Agent information",loadApiKey:"Unable to load the API key",loadGithubVersions:"Unable to load GitHub versions",loadEvaluations:"Unable to load evaluation cases",loadMpaAgentView:"Unable to load MPA Agent status",loadMpaDiagnostics:"Unable to load Runtime diagnostics",loadOptimizations:"Unable to load optimization suggestions",loadRuntimeDetails:"Unable to load Runtime details",loadSessionConfig:"Unable to load Session configuration",loadUsage:"Unable to load usage data",noCreatePermission:"This account cannot create Agents",noManagePermission:"This account cannot manage this Agent",originalConfigUnavailable:"The original configuration is unavailable",probeIntegration:"Unable to check integration capabilities",rollbackVersion:"Unable to create a version rollback",runtimeRegionMissing:"The Runtime region is missing",updateCapabilityMismatch:"The Runtime update capability does not match this configuration",updateCapabilityPending:"The Runtime update capability is still being checked",updateConfigRestoring:"Restoring update configuration",updateUnsupported:"This Runtime cannot be updated",usageMismatch:"The returned usage data does not match this Agent"}},Kme={title:"Environments",loadFailed:"Failed to load environments. Check the storage configuration and try again.",storageUnavailable:"Persistent storage is not configured. Environment management is unavailable.",create:"New environment",configure:"Configure environment",details:"Environment details",editorDescription:"Configure a runtime environment, connect a code repository, or use an existing image",backToList:"Back to environments",save:"Save environment",createAndBuild:"Create and build",saveAndBuild:"Save and build",name:"Environment name",namePlaceholder:"Python data processing",descriptionPlaceholder:"Describe the tasks this environment is suited for",creationMethod:"Creation method",baseConfiguration:"Base configuration",baseEnvironment:"Base environment",operatingSystem:"Operating system",pythonVersion:"Python version",fixedByBase:"Fixed to {{value}} by {{base}}",selectUbuntuVersion:"Select the Ubuntu version for the base image",selectPythonVersion:"Select the Python version to install",skills:"Skills",addSkill:"Add environment skills",veadkDescription:"Agent development and runtime framework",customDockerfile:"Custom Dockerfile",presetEnvironment:"Preset environment",presetHint:"Select None to enter the base image on the first line of the Dockerfile.",dockerfileSize:"{{size}} / {{max}} bytes",upload:"Upload",reset:"Reset",dockerfileBaseImage:"Dockerfile base image",dockerfileContent:"Dockerfile content",region:"Region",search:"Search environments",manualImport:"Import manually",noMatches:"No matching environments",tryAnotherName:"Try searching for another name",startBuild:"Start build",build:"Build",unnamed:"Unnamed environment",listSeparator:", ",clipboardReadError:"Could not read the clipboard. Allow clipboard access, or open Import environment and paste the share code manually.",clipboardUnsupported:"This browser cannot read the clipboard automatically. Open Import environment and paste the share code manually.",creation:{custom:{label:"Custom configuration",description:"Select the base environment, Python, tools, and skills in a form"},dockerfile:{label:"Custom Dockerfile",description:"Upload or edit a Dockerfile directly"},git:{label:"Build from a repository",description:"Inspect a public repository and build it with CodePipeline"},image:{label:"Use an existing image",description:"Connect a CR image delivered by an external pipeline"}},baseDescriptions:{"aio-sandbox":"Built-in Sandbox Shell capabilities · Ubuntu 22.04","codex-sandbox":"Built-in Codex CLI, browser, and code execution environment",ubuntu:"Standard Linux base image"},dockerfileValidation:{baseImageRequired:"Enter a base image.",duplicateFrom:"The base image is fixed on the first line. Remove the FROM instruction from the Dockerfile body.",tooLarge:"The Dockerfile cannot exceed 128 KiB.",empty:"The Dockerfile cannot be empty.",missingFrom:"The Dockerfile must include a FROM instruction."},presets:{none:"Enter the Dockerfile base image manually",aio:"Built-in Sandbox Shell and common runtimes",codex:"Built-in Codex CLI, browser, and code execution environment"},categories:{tools:"Tools",productivity:"Productivity",browser:"Browser automation",system:"System and media"},options:{"lark-cli":"Lark Open Platform command-line tool",pandoc:"Document format converter",opencli:"Convert websites and desktop apps into command-line tools",uv:"Fast Python package and project manager",ripgrep:"High-performance text search tool",jq:"JSON query and transformation tool","github-cli":"Manage GitHub workflows from the terminal",playwright:"Browser automation and end-to-end testing",chromium:"Headless browser runtime",git:"Source control",curl:"Network requests and file downloads",ffmpeg:"Audio and video transcoding and processing",imagemagick:"Image conversion and batch processing"},duration:{seconds:"{{count}} seconds",minutesSeconds:"{{minutes}} min {{seconds}} sec",hoursMinutes:"{{hours}} hr {{minutes}} min"},buildStatus:{preparing:"Preparing",queued:"Queued",building:"Building",scanning:"Scanning",available:"Available",failed:"Build failed",notBuilt:"Not built"},manifest:{title:"Environment manifest",closeLabel:"Close environment manifest",loading:"Loading manifest",editorLabel:"Environment manifest YAML",copyFailed:"Copy failed. Try again.",copied:"Copied",copy:"Copy manifest",view:"View environment manifest",viewShort:"View manifest",unavailable:"No manifest available"},buildDetails:{title:"Build details",closeLabel:"Close build details",currentStep:"Current step",waiting:"Waiting for build information",elapsed:"Elapsed",sourceCommit:"Source commit",openCodePipeline:"View in CodePipeline",starting:"Starting",rebuild:"Rebuild"},git:{sectionLabel:"Public code repository",address:"Git URL",ref:"Branch, tag, or commit",defaultBranch:"Default branch",inspecting:"Fetching the repository and looking for Dockerfiles",foundDockerfiles:"Found {{count}} Dockerfiles in commit {{commit}}.",savedDockerfileLoaded:"Loaded the saved Dockerfile. Inspect the repository again to check for updates.",noDockerfile:"No Dockerfile was found. Check the branch or repository contents.",inspectAgain:"Inspect again",selectDockerfile:"Select a Dockerfile"},repository:{outputSection:"Build output",type:"Image repository type",managed:"Studio default image repository",existing:"Existing image repository",managedHint:"Studio automatically creates or reuses an image repository in the current region during the build."},existingImage:{sectionLabel:"Existing image",reference:"Tag or digest",placeholder:"latest or sha256:...",hint:"Enter an image tag or a complete digest beginning with sha256:."},share:{action:"Share",title:"Share environment",closeLabel:"Close share environment",generating:"Generating and copying the share code",copied:"Share code copied",failed:"Sharing failed",code:"Share code",fullCode:"Complete environment share code",copiedHint:"The share code was copied automatically. You can also view or copy it here.",copyFailedHint:"Automatic copy failed. Copy the share code above manually or try again.",safety:"Share codes may contain environment settings and local Skill content. Send them only to trusted recipients.",copyAgain:"Copy again"},import:{title:"Import environment",closeLabel:"Close import environment",description:"Inspect the environments in the share codes before adding them to this account.",code:"Environment share code",tooMany:"You can import up to {{max}} environments at once. {{count}} share codes were found.",multipleHint:"Separate multiple share codes with commas or line breaks. Duplicates are ignored automatically.",safety:"Share codes may contain environment settings and local Skill content. Import them only from trusted sources.",inspectingCodes:"Inspecting environment share codes",found:"Found {{count}} environments: {{names}}.",itemError:"Share code {{index}}: {{error}}",invalidCode:"Invalid share code.",noResult:"The service returned no import result for this share code.",partial:"Imported {{created}} environments; {{remaining}} remain. Valid failed items can be retried.",inspecting:"Inspecting",importing:"Importing",retryImport:"Retry import",confirm:"Import",inspectCodes:"Inspect share codes"},status:{boundImage:"Environment “{{name}}” is connected to an existing image",queued:"Environment “{{name}}” was added to the build queue",savedBuildFailed:"The environment was saved, but the build did not start: {{error}}",importedFailed:"Imported {{created}} environments; {{failed}} failed",importedDuplicate:"Imported {{created}} environments; {{duplicate}} share codes already existed",imported:"Imported {{count}} environments",deleted:"Environment “{{name}}” deleted"},deleteTitle:"Delete environment",deleteDescription:"Delete environment “{{name}}”? This cannot be undone.",errors:{repositoryRequired:"Enter a public code repository URL.",repositoryHttps:"Enter the HTTPS URL of a public repository.",repositoryInvalid:"Enter a valid public repository HTTPS URL.",imageReferenceWhitespace:"A tag or digest cannot contain spaces.",imageDigestInvalid:"The digest must be a complete sha256 value.",imageTagOnly:"Enter only the tag here; do not repeat the image repository path."}},Gme={searchPlaceholder:"Search resource names",emptyMessage:"No options available",searchAriaLabel:"Search {{label}}",loadingMore:"Loading more resources…"},Xme={retryDeployment:"Retry deployment",retrying:"Retrying…",collapse:"Collapse error details",expand:"Expand full error details",copy:"Copy full error details"},Yme={steps:"Build steps",log:"Build log",syncing:"Syncing",loadFailed:"Failed to load",synced:"Synced",recentOnly:" · Recent logs only",copiedLog:"Build log copied",copyLog:"Copy build log",copied:"Copied",copy:"Copy",logContent:"Build log content",waiting:"Waiting for CodePipeline logs…",empty:"No build logs"},Zme={defaultLabel:"Studio default environment",defaultDescription:"Use the standard runtime environment provided by Studio",status:{notBuilt:"Not built",preparing:"Preparing",queued:"Queued",building:"Building",scanning:"Scanning",available:"Available",failed:"Failed"},label:"Runtime environment",placeholder:"Select a runtime environment",search:"Search runtime environments",loading:"Loading runtime environments…",loadFailed:"Failed to load runtime environments",noMatches:"No matching runtime environments",unavailable:"No runtime environments are currently available",selectionUnavailable:"The selected runtime environment is unavailable. Select another one.",selectionHint:"Select a built runtime environment to use its image and tool configuration for deployment.",versionChanged:"The selected environment version has changed. Review it before continuing.",versionMissing:"The selected environment version no longer exists. Select another one.",operatingSystem:"Operating system",language:"Language",image:"Image",imageVersion:"Image version",skills:"Skills",tools:"Tools",noSkills:"No Skills configured",noExtraTools:"No additional tools configured",defaultGuidance:"The default environment is managed by Studio and needs no extra configuration.",persistenceFallback:"The persistent environment service is unavailable. The default environment is being used.",emptyFallback:"No custom environments are available."},Jme={repository:"GitHub repository",githubUrl:"GitHub URL",token:"Token",sessionToken:"{{provider}} Session Token",runtime:"Runtime",commit:"Commit",workflow:"Workflow",syncFailed:"Failed to sync GitHub code",status:{mounted:"Mounted",bound:"Bound",synced:"Synced",created:"Created"},volcengine:"Volcengine",mountDelivery:"Enable continuous delivery",selectedForDeployment:"Selected for deployment",mountOnDeploy:"Enable continuous delivery on deploy",syncCode:"Sync code",deliveryMode:"GitHub delivery mode",sourceSync:"GitHub code sync",delivery:"GitHub delivery",loading:"Loading",running:"Running",runtimeDeliveryHint:"Write an AgentKit Runtime GitHub Actions workflow so future GitHub commits update the bound Runtime.",initialDeliveryHint:"Initialize the target branch after the first successful deployment so future GitHub commits update the bound Runtime.",sourceSyncHint:"Studio pushes directly to the target branch. Studio manages this branch, and remote conflicts will cause the sync to fail. Use the deployment button to publish the Runtime.",tokenPlaceholder:"repo or contents:write permission",getToken:"Get token",hideToken:"Hide token",showToken:"Show token",tokenHelp:"The token is used only for this operation and is cleared from the form after success.",targetBranch:"Target branch",actionsSecretPlaceholder:"Used to write a GitHub Actions secret",sessionTokenPlaceholder:"Optional temporary credential",syncing:"Syncing…",pendingHint:"Continuous delivery is selected. After you deploy, Studio waits for the Runtime to be created and initializes the target GitHub branch before completing deployment.",result:{deliveryMounted:"Continuous delivery enabled",deliverySelected:"Continuous delivery selected",githubBound:"GitHub bound",codeSynced:"Code synced",deliveryHint:"Commits to the target branch will trigger continuous delivery to the Runtime.",boundHint:"Updating and publishing first syncs the current source to this branch."},branch:"Branch",viewPr:"View PR",createFailed:"Creation failed",phase:"Phase",log:"Log"},ege={name:"Feishu",enabling:"Enabling and updating configuration…",description:"Receive messages and reply through a Feishu bot",configuration:"Feishu configuration",configurationMode:"Feishu configuration mode",automatic:"Automatic",manual:"Manual",cancelling:"Cancelling…",scanToCreate:"Scan to create",scanDescription:"Credentials are filled in after authorization",generateQrCode:"Generate QR code",qrCodeAlt:"Feishu bot configuration QR code",scanToConfirm:"Scan with Feishu to confirm",expiresIn:"Expires in {{time}}",created:"Bot created",credentialsFilled:"App credentials filled in automatically",qrCodeExpired:"QR code expired",automaticFailed:"Automatic configuration failed",regenerateQrCode:"Generate a new QR code.",configuredPlaceholder:"Configured; leave blank to keep it",appSecretPlaceholder:"Enter App Secret",hideSecret:"Hide App Secret",showSecret:"Show App Secret"},tge={mode:{auto:"Create automatically",autoDescription:"Create required resources during deployment",recommended:"Recommended",create:"Specify names",createDescription:"Create or reuse resources with the specified names",existing:"Select existing",existingDescription:"Select existing resources from the current account"},selectExisting:"Select an existing resource",searchResource:"Search resource names",noMatch:"No matching resources",noAvailable:"No resources available",searching:"Searching cloud resources…",loading:"Loading cloud resources…",noMatchSentence:"No matching resources.",noAvailableSentence:"No resources available.",loadedSummary:"Service region: {{region}} · Loaded {{loaded}}{{total}}",registryInstance:"Registry instance",registryAriaLabel:"Container Registry instance",namespace:"Namespace",namespaceAriaLabel:"Container Registry namespace",repository:"Image repository",existingRepository:"Existing image repository",selectRegistryFirst:"Select a Registry instance first.",selectNamespaceFirst:"Select a Namespace first.",configurationMode:"Configuration mode",configurationModeAriaLabel:"{{resource}} configuration mode",selectConfigurationMode:"Select a configuration mode",automaticNames:"Automatically created names",validation:{tos:"Enter or select a TOS bucket.",cr:"Enter or select a CR instance, namespace, and image repository.",codePipeline:"Enter or select a CodePipeline Workspace and Pipeline.",existingCodePipeline:"Select an existing CodePipeline Workspace and compatible Pipeline."},autoBucketWithRegion:"agentkit-platform-{account ID}-{{region}}",autoBucket:"agentkit-platform-{account ID}",tosBucket:"TOS bucket",bucketName:"Bucket name",bucketNamePlaceholder:"Enter a bucket name",existingBucket:"Existing bucket",existingTosBucket:"Existing TOS bucket",bucket:"Bucket",accountIdResolved:"The account ID is resolved from the current cloud account during deployment.",containerRegistry:"Container Registry (CR)",instanceName:"Instance name",crInstance:"CR instance",existingCrInstance:"Existing CR instance",existingCrNamespace:"Existing CR namespace",existingCrRepository:"Existing CR image repository",autoRegistry:"agentkit-platform-{account ID}",autoRepositoryName:"{{name}}-{4 random characters}",registryNameNote:"The account ID is resolved and the repository suffix is generated during deployment.",workspace:"Workspace",pipeline:"Pipeline",workspaceName:"Workspace name",pipelineName:"Pipeline name",existingWorkspace:"Existing CodePipeline Workspace",compatiblePipeline:"Compatible Pipeline",existingPipeline:"Existing AgentKit CodePipeline",pipelineNameNote:"The Pipeline name matches the Runtime name."},nge={commit:"Commit",steps:{permissions:"Preflight OTA permissions",resolving:"Resolve target version",downloading:"Download and verify the full update package",preparing:"Prepare VeFaaS Function code",provisioning:"Check and provision Studio cloud resources",scheduler:"Update the scheduled task service",submitting:"Submit the Function update",publishing:"Publish a new Revision and restart the service"},stages:{permissions:"Preflight OTA permissions",resolving:"Resolve version details",downloading:"Download update package",preparing:"Prepare Function code",provisioning:"Provision Studio cloud resources",scheduler:"Update scheduled task service",submitting:"Submit Function update",publishing:"Publish Revision",checking:"Check for updates",unknown:"Unknown stage"},duration:{seconds:"{{count}} seconds",minutesSeconds:"{{minutes}} min {{seconds}} sec"},logPermissionPrefix:"Unable to read VeFaaS release logs. The Function role lacks ",logPermissionSuffix:"; the update will continue.",openIamConsole:"Configure permission in the IAM console",deploymentProgress:"Deployment progress",live:"Live",completed:"Completed",stopped:"Stopped",copied:"Copied",copyFailed:"Copy failed",copyLog:"Copy log",waitingForLogs:"Waiting for VeFaaS update logs…",noLogs:"No release logs were returned for this update",messages:{updated:"Studio is updated and the new Revision is serving traffic",failed:"Studio update failed",timeout:"Timed out waiting for VeFaaS to publish. Check for updates again later.",submitted:"Update submitted. Waiting for VeFaaS to publish the new version.",connectionSwitched:"The connection changed. Confirming the new version status."},checkingPermissions:"Checking OTA permissions",authorizationRequired:"IAM authorization required",updating:"Updating Studio",updated:"Studio updated",updateToVersion:"Update Studio to {{version}}",checkPermissions:"Check update permissions",authorizationNeeded:"Authorization required",updatingShort:"Updating",refreshForNewVersion:"Refresh to use the new version",updateFailed:"Update failed",updateNow:"Update now",newVersionAvailable:"New version available",dialog:{failed:"Studio update failed",checkingPermissions:"Checking update permissions",authorizationRequired:"IAM authorization required",updating:"Updating Studio",completed:"Studio update complete",newVersion:"New version available"},permissionCheck:"Checking every IAM permission required by OTA and scheduled tasks…",permissionCheckHint:"Downloads and cloud-resource updates begin only after all permissions are available.",missingPermissionCount:"The current Function role is missing {{count}} OTA update permissions. No cloud resources have been changed.",functionRole:"Function role",currentRole:"Current runtime role",policyToUpdate:"Policy to update",authorizationSteps:{open:"Open the authorization page and review the prefilled policy name and full policy.",debug:"Select “Start debugging” on the page to apply the policy update.",return:"Return to this window and select “Authorized, check again”."},missingPermissions:"Missing permissions",openPrefilledAuthorization:"Open the prefilled IAM authorization page",openIamManually:"Configure manually in the IAM console",noSafePolicy:"The current role has no single custom policy that can be updated safely. Ask an administrator to add the permissions above to this role.",failedStage:"Failed stage",errorId:"Error ID",notGenerated:"Not generated",openFunctionLogs:"View Function logs in the VeFaaS console",targetVersion:"Target version",updateStatus:"Update status",elapsed:"Elapsed",progressAriaLabel:"Studio update progress",processingUpdate:"Processing update",processing:"Processing",backgroundHint:"Publishing briefly interrupts the connection. Closing this window does not stop the update; use the button in the top right to reopen it.",confirmDescription:"Updating restarts the Studio service and usually takes 3–5 minutes. Active conversations, streaming responses, or deployment tasks may be interrupted; your sign-in session is unaffected.",selectVersion:"Select version",currentVersion:"Current version",changelog:"What's new",noChangelog:"No release notes",runInBackground:"Run in background",authorizedRecheck:"Authorized, check again",tryAgain:"Try again"},ige={deploy:"Deploy",update:"Update",planHash:"Plan hash",backToConfiguration:"Back to configuration",releaseRegion:"Release region",deployRegion:"Deployment region",regionPreserved:"The existing Runtime deployment region is preserved during updates and cannot be changed.",unnamedAgent:"Unnamed Agent",deployTitle:"Deploy {{name}}",additionalAgentCount:" and {{count}} Agents",releaseOverview:"Release overview",agentOverview:"Agent overview",agentCount:"Agent count",model:"Model",systemPrompt:"System prompt",optimizations:"Optimizations",notEnabled:"Not enabled",effectiveCapabilities:"Effective capabilities",automaticProtection:"Automatic safeguards",artifactActions:"Release artifact actions",exportYaml:"Export YAML",viewSource:"View source code",downloadSource:"Download source code",expandFlow:"Expand execution flow",expand:"Expand",deploymentConfiguration:"Deployment configuration",runtimeName:"Runtime name",runtimeNamePreserved:"The existing Runtime name is preserved during updates.",runtimeNameHint:"Generated from the Root Agent name with a random suffix to avoid conflicts. Use 4–64 letters, numbers, hyphens, or underscores.",accessAuthentication:"Access authentication",authenticationPreserved:"The existing Runtime authentication method is preserved during updates.",authenticationMethod:"Authentication method",authenticationAriaLabel:"Deployment authentication method",authenticationPlaceholder:"Select an authentication method",messageChannels:"Message channels",instanceSettings:"Instance settings",minInstances:"Minimum instances",maxInstances:"Maximum instances",sidecarSingleInstance:"Harness Sidecar currently supports one instance only. The Runtime is fixed at 1–1.",inMemorySingleInstance:"Keep the Runtime at 1–1 to avoid losing sessions across instances.",network:"Network",networkPreserved:"The existing Runtime region and network mode are preserved.",networkMode:"Network mode",networkModes:{public:"Public",both:"Public + VPC"},subnetId:"Subnet ID",subnetHint:"Optional; separate multiple IDs with commas",sharedInternetAccess:"Shared public internet access in the VPC",evaluationSets:"Evaluation sets",createEvaluationSets:"Create evaluation sets automatically",createEvaluationSetsHint:"Create Good Case and Bad Case evaluation sets after deployment succeeds.",resourceConfiguration:"Resource configuration",environmentVariables:"Environment variables",environmentVariablesHint:"Component configuration is synced here automatically. Review the final values before deployment.",itemCount:"{{count}} items",addVariable:"Add variable",componentGenerated:"Generated from components",injectedByApiKey:"Injected from the selected API key",envNameAriaLabel:"{{key}} environment variable name",envDescriptionAriaLabel:"{{key}} description: {{description}}",openOpenViking:"Open OpenViking {{label}}",openOpenVikingAriaLabel:"{{key}}: open OpenViking {{label}}",requiredEmpty:"Required; no value entered",optionalEmpty:"Optional; no value entered",envValueAriaLabel:"{{key}} environment variable value",automatic:"Automatic",synced:"Synced",customModelCredentials:"Custom model credentials",releaseOnlySecret:"Required; used only for this release",thisRelease:"This release",customVariables:"Custom variables",value:"Value",deleteVariable:"Delete variable",deploymentProgress:"Deployment progress",retryUpdate:"Retry update",retryDeploy:"Retry deployment",updateSucceeded:"Update succeeded",deploySucceeded:"Deployment succeeded",region:"Region",agentName:"Agent name",apiEndpoint:"API endpoint",connecting:"Connecting…",chatNow:"Chat now",console:"Console",actionInProgress:"{{action}} in progress…",checkingName:"Checking name…",retryAction:"Retry {{action}}",flowPreview:"Execution flow preview",executionFlow:"Execution flow",flowPreviewHint:"Read-only preview; zoom and pan the canvas",closeFlowPreview:"Close execution flow preview",agentAdded:'Agent "{{name}}" was added to the selector in the top left.',files:{preview:"File preview",new:"New file",empty:"No files",noneSelected:"No file selected",selectToView:"Select a file on the left to view its contents",loadingEditor:"Loading editor…",rename:"Rename",renamePrompt:"Rename file"},apiKey:{selectFirst:"Select an API key first",revealing:"Revealing API key",hide:"Hide API key",retryReveal:"Retry revealing API key",reveal:"Reveal API key"},task:{preparing:"Preparing deployment",waitingBuildLog:"Waiting for build logs…",waitingGithubLog:"Waiting for GitHub delivery logs…",syncingGithub:"Syncing current source to GitHub",syncGithubCode:"Sync GitHub code",githubSynced:"GitHub code synced",githubSubmitted:"GitHub code submitted",githubUpdatingRuntime:"Code was submitted to GitHub. GitHub Actions is updating the same Runtime.",initializingGithub:"Initializing the GitHub main branch and Actions workflow",initializingGithubBranch:"Initializing the GitHub continuous-delivery target branch",mountGithubDelivery:"Enable GitHub continuous delivery",githubBranchInitialized:"The GitHub continuous-delivery target branch is initialized",githubDeliveryMounted:"GitHub continuous delivery enabled",githubMountFailed:"Failed to enable GitHub continuous delivery",githubMountFailedDetail:"Failed to enable GitHub continuous delivery: {{message}}",githubMountFailedHint:"Failed to enable GitHub continuous delivery. See the GitHub log for details.",applyingMpaProfile:"Applying the Agent profile to MPA Runtime",mpaProfileApplied:"MPA Runtime profile applied",runningMpaSmoke:"Verifying the MPA Runtime execution path",mpaReady:"MPA Runtime is ready",deploymentComplete:"Deployment complete",deployedNotConnected:"Deployed, not connected yet",cancelled:"Cancelled",cancelledHint:"Deployment was cancelled and the Runtime resources were requested for deletion.",deploymentStatusUnconfirmed:"Deployment status unconfirmed",deploymentFailed:"Deployment failed",buildFailedHint:"Image build failed. See the build log for details."},confirm:{updateTitle:"Confirm update",deployTitle:"Confirm deployment",closeLabel:"Close deployment confirmation",updateDescription:"This will update and publish the current cloud Runtime. It may take a few minutes. Continue?",deployDescription:"This will create a new cloud Runtime. Deployment may take a few minutes. Continue?",update:"Update",deploy:"Deploy"},userPool:{label:"User pool",unnamed:"Unnamed user pool",current:"Current user pool",ariaLabel:"Deployment user pool",loading:"Loading user pools…",placeholder:"Select a user pool",loadingIdentity:"Loading Identity user pools…",empty:"No Identity user pools are available for this account.",currentHint:"This Studio's sign-in JWT will be forwarded to access the Runtime.",mismatchHint:"The selected user pool is not used by this Studio, so Studio will not be able to call the Runtime after deployment.",markedHint:"The user pool used by this Studio is marked in the list."},authentication:{apiKeyDescription:"Default method using the Runtime API key",userPool:"User pool",userPoolDescription:"Use a JWT issued by an Identity user pool"},steps:{buildImage:"Build image",deploy:"Deploy",publish:"Publish",syncCode:"Sync code",uploadPackage:"Upload code package",packageImage:"Package image",createRuntime:"Create Runtime",publishService:"Publish service",updateInstances:"Update instance configuration",createEvaluationSets:"Create evaluation sets",applyMpaProfile:"Apply MPA profile",verifyMpaRuntime:"Verify MPA Runtime",mpaReady:"MPA Runtime ready"},errors:{instanceRangeInteger:"Minimum instances must be an integer of 0 or more, and maximum instances must be an integer greater than 0.",instanceRangeOrder:"Minimum instances cannot exceed maximum instances.",selectApiKey:"Select an API key in the model configuration first.",loadApiKey:"Failed to load the API key. Try again.",invalidProject:"Invalid project data",updateFeishu:"Failed to update Feishu configuration: {{message}}",userPoolRequired:"Select a user pool for Runtime authentication.",vpcRequired:"Enter a VPC ID when using a VPC network.",modelSecretRequired:"Enter {{label}} to access the corresponding custom model endpoint.",managedApiKeyRequired:"{{requirement}}. Return to model configuration and select an API key first.",feishuEnvRequired:"Enter {{field}} after enabling Feishu.",runtimeNameExists:"This Runtime name already exists. Change it and try again.",deployedButGithubMountFailed:"Deployment succeeded, but enabling GitHub continuous delivery failed: {{message}}",deployedButGithubBindFailed:"Deployment succeeded, but binding GitHub failed: {{message}}",mpaRuntimeIdMissing:"Deployment succeeded, but the Runtime ID is missing, so the MPA profile cannot be applied.",mpaOperationIncomplete:"MPA Runtime setup did not complete. Retry this deployment task.",deploymentStatusUnconfirmed:"The connection was interrupted, so the final deployment status cannot be confirmed. The task may still be running in the cloud. Check the same task in AgentKit or CodePipeline and avoid a duplicate deployment.",failedAtStage:"{{action}} failed during {{stage}}: {{message}}",noAgentAtEndpoint:"Connected successfully, but no Agents were found at this endpoint (/list-apps is empty).",addAgent:"Failed to add Agent: {{message}}",modelApiKeyRequired:"Enter the API key for this model endpoint."}},rge={title:"Workspaces",storageUnavailable:"Persistent storage is not configured. Workspace management is unavailable.",detail:"Workspace details",create:"New workspace",editorDescription:"Group frequently used environments. An environment can belong to multiple workspaces.",backToList:"Back to workspaces",environmentCount_one:"{{count}} environment",environmentCount_other:"{{count}} environments",createdAt:"Created",updatedAt:"Last updated",basicInfo:"Basic information",namePlaceholder:"For example: Content production",descriptionPlaceholder:"Describe what this workspace is for",selectedEnvironmentCount:"{{count}} selected; they can also be reused in other workspaces",searchAvailableEnvironments:"Search available environments",searchEnvironments:"Search environments",noAvailableEnvironments:"No environments are available to add",createEnvironmentFirst:"Create and build an environment on the Environments page first.",noMatchingEnvironments:"No matching environments",tryAnotherName:"Try searching for another name.",environmentStatus:{available:"Available",building:"Building",notBuilt:"Not built"},added:"Added",saved:"Workspace “{{name}}” saved",resourceType:"Workspace resource type",searchWorkspaces:"Search workspaces",loadFailed:"Unable to load workspaces",noMatchingWorkspaces:"No matching workspaces",tryAnotherNameOrEnvironment:"Try another name or environment",noEnvironmentAdded:"No environments added",environmentMissing:"Environment missing",availableFraction:"{{available}}/{{total}} available",available:"Available",availableCount:"{{count}} available",updated:"Updated",addEnvironment:"Add environment",deleteTitle:"Delete workspace",deleteDescription:"Delete workspace “{{name}}”? Its environments will not be deleted.",deleted:"Workspace “{{name}}” deleted",clipboardPermissionError:"Could not read the clipboard. Allow clipboard access, or open Import environment and paste the share code manually.",clipboardUnsupported:"This browser cannot read the clipboard automatically. Open Import environment and paste the share code manually.",codeProjects:"Code projects"},sge={back:"Back",detailNavigation:"Detail navigation",noData:"No data",actions:"Actions",moreActions:"More actions for {{label}}",actionsFor:"Actions for {{label}}",loading:"Loading resources…"},age={addSkill:"Add Skill",remove:"Remove {{name}}",confirmRemoveRuntime:"Remove the running Skill “{{name}}” from the new version?",selectedCount:"Added skills · {{count}}",close:"Close {{label}}",sources:{runtime:"Running source · Preserved as-is; remove it or replace it with a Skill of the same name",local:"Local",skillspace:"AgentKit Skills Center",skillhub:"Volcengine Find Skill marketplace"},tabs:{local:"Local files",localShort:"Local files",skillspace:"AgentKit Skills Center",skillspaceShort:"AgentKit",skillhub:"Volcengine Find Skill marketplace",skillhubShort:"Find Skill"}},oge={model:"Model",turnControls:"Turn controls",pause:"Pause",resume:"Resume",interrupt:"Interrupt",cancel:"Cancel",pauseTurn:"Pause the whole flow at a safe point",resumeTurn:"Resume the whole flow",interruptTurn:"Interrupt this flow and retain Session context",cancelTurn:"Cancel this flow permanently",turnState:{running:"Running",pausing:"Reaching safe point",paused:"Paused",resuming:"Resuming",interrupting:"Interrupting",cancelling:"Cancelling",interrupted:"Interrupted",completed:"Completed",failed:"Failed",cancelled:"Cancelled",orphaned:"Status pending",newTurnRequired:"Continue from checkpoint"},tasks:{ppt:"Presentation",image:"Image generation",video:"Video generation"},prompts:{ppt:{quarterlyReview:"Review 【quarter】 business performance, highlighting metric gaps, causes, and recommended actions",projectUpdate:"Present the progress of 【project name】: milestones, risks, budget, and resource requests",solutionProposal:"Create a solution proposal for 【customer industry】: pain points, architecture, implementation plan, and benefits",industryAnalysis:"Analyze trends in 【industry topic】 and recommend strategic opportunities based on the competitive landscape"},image:{launchVisual:"Design a 【high-tech】 launch-event key visual for 【brand or product】",ecommercePoster:"Create an e-commerce poster for 【product name】 that highlights 【core selling point】 and brand colors",conceptRendering:"Create a photorealistic concept rendering of 【product or space】 in 【usage scenario】",socialGraphic:"Create a concise, professional corporate social graphic for 【campaign theme】"},video:{brandFilm:"Create a 30-second promotional video for 【brand name】 that highlights 【brand value】",productLaunch:"Create a 45-second launch video for 【product name】 covering the pain point, features, scenarios, and call to action",trainingVideo:"Create a corporate training video about 【training topic】 that clearly explains 【key procedure or policy】",eventTeaser:"Create a 20-second teaser for 【event name】 with highlights, time and location, and registration details"}},firstFrame:"First frame",videoToEdit:"Video to edit",baseVideo:"Base video",optimizeSkillPlaceholder:"Describe the skill you want to improve…",createSkillPlaceholder:"Describe the skill you want to create…",createVideoPlaceholder:"Describe the video you want to create…",messageAgentPlaceholder:"Message {{name}}…",selectAgentFirst:"Select an agent first",selectSkillFirst:"Select the Skill you want to improve first",availableSkills:"Available skills",availableSubagents:"Available sub-agents",invokeSkill:"Use a skill",useSubagent:"Use a sub-agent",loadingCapabilities:"Loading Agent capabilities…",noMatchingSkills:"No matching skills for this Agent",noMatchingSubagents:"No matching sub-agents for this Agent",skillFallbackDescription:"Load and run this skill",agentFallbackDescription:"Hand this turn to the Agent",skill:"Skill",uploadImage:"Upload image",uploadDocument:"Upload document or PDF",uploadVideo:"Upload video",taskMode:"Task mode",selectTaskMode:"Select a task mode",loadingGenerationModel:"Loading generation model",modelUnavailable:"Model unavailable",cancelTask:"Cancel {{task}} task",stopGenerating:"Stop generating",viewVideoProgress:"View video generation progress",send:"Send",selectTaskType:"Select a task type",enterprisePrompts:"{{task}} enterprise prompts",sessionId:"Session ID",sessionIdLabel:"Session ID: ",initializing:"Initializing",copied:"Copied",copySessionId:"Copy session ID",sessionIdCopied:"Session ID copied",disclaimer:"Responses may be inaccurate",viewLogs:"View logs"},lge={selectAgent:"Select Agent",noLocalAgents:"No local Agents.",searchRuntime:"Search Runtime names",mineOnly:"Created by me",noRuntimes:"No Runtimes.",unsupported:"Unsupported",createdByMe:"Created by me",connecting:"Connecting…",connected:"Connected",connect:"Connect",viewInfoFor:"View information for {{name}}",viewInfo:"View information",agentAndRuntimeInfo:"Agent and Runtime information",detailType:"Detail type",agentInfo:"Agent information",runtimeInfo:"Runtime information",loadingAgentInfo:"Loading Agent information…",cannotLoadAgentInfo:"Agent information is temporarily unavailable",unnamedAgent:"Unnamed Agent",subagents:"Sub-agents",tools:"Tools",skills:"Skills",previewUnsupported:"Preview unavailable",mountedComponents:"Mounted components",noMoreAgentInfo:"No additional Agent configuration information.",local:"Local",model:"Model",status:"Status",memoryMb:"Memory {{value}} MB",instances:"Instances {{min}}–{{max}}",resources:"Resources",version:"Version",loadingDetails:"Loading details…",environmentVariables:"Environment variables",errors:{notFound:"This Runtime no longer exists or the list is out of date. Refresh the list and try again.",accessDenied:"This account cannot access the Runtime. Check its Project and access permissions.",previewUnsupported:"This Agent Server version does not support information previews.",unavailable:"This Runtime is temporarily unavailable. Confirm that its status is Ready and try again.",timeout:"Loading timed out. Try again."},componentKinds:{knowledgebase:"Knowledge base",memory:"Memory",prompt_manager:"Prompt manager",example_store:"Example store",run_processor:"Run processor",tracer:"Trace",toolset:"Toolset",plugin:"Plugin",other:"Other"},runtimeStatus:{ready:"Ready",unreleased:"Unreleased",running:"Running",active:"Running",creating:"Creating",pending:"Pending",deploying:"Deploying",updating:"Updating",failed:"Failed",error:"Error",stopping:"Stopping",stopped:"Stopped",deleting:"Deleting",deleted:"Deleted"}},cge={agent:"Agents",agentTypes:{general:"General Agents",mpa:"MPA Agents",codex:"Codex","deepseek-harness":"DeepSeek",openclaw:"OpenClaw",hermes:"Hermes"},creator:"Created by",namedAgent:"{{name}} Agent",storageLocation:"Storage location",currentBrowser:"Current browser",region:"Region",viewDeploymentProgress:"View deployment progress for {{name}}",viewRuntimeDetails:"View Runtime details for {{name}}",viewDetails:"View details for {{name}}",time:"Time",remainingTime:"Time remaining",expiringSoon:"Expiring soon",sandboxRemaining:"{{hours}} hr {{minutes}} min",wakeable:"Asleep",neverExpires:"Never expires",editDraftNamed:"Edit draft {{name}}",viewProgress:"View progress",deleteDraftNamed:"Delete draft {{name}}",recheckCompatibility:"Check chat compatibility for {{name}} again",connectedNamed:"{{name}} is connected",wakeAndChat:"Wake {{name}} and start chatting",chatWith:"Chat with {{name}}",waking:"Waking…",deploying:"Deploying",draft:"Draft",checking:"Checking",chatUnsupported:"Chat unsupported",checkFailed:"Check failed",creatorFilter:"Creator filter",agentType:"Agent type",searchAgents:"Search Agents",handoff:"Handoff",agentList:"{{type}} list",noMatchingAgents:"No matching Agents",adjustSearch:"Try adjusting the search or filters",noAgentType:"No {{type}}",noGeneralAgents:"No General Agents",createGeneralAgentDescription:"Create a General Agent to start building and chatting",createAgentType:"Create {{type}}",createAgent:"Create Agent",loadingMore:"Loading more Agents",scrollForMore:"Scroll down to load more",allLoaded:"All Agents loaded",deleteDraftTitle:"Delete draft?",deleteDraftDescription:"“{{name}}” cannot be recovered after deletion.",deleteDraft:"Delete draft",loadGeneralAgents:"Load General Agents",loadAgentType:"Load {{type}}",compatibility:{checking:"Requesting Runtime /list-apps to confirm that this Agent supports Studio chat.",empty:"Runtime /list-apps returned no available Agents, so chat is currently unavailable.",supported:"This Runtime supports Studio chat.",unknownError:"The Runtime /list-apps request failed without a recognizable error."},sandboxStatus:{ready:"Ready",wakeable:"Asleep",creating:"Creating",starting:"Starting",initializing:"Starting",pending:"Pending",running:"Running",failed:"Error",error:"Error",stopped:"Stopped",expired:"Expired",deleting:"Deleting",deleted:"Deleted",unknown:"Unknown status"},wakingHint:"Waking the agent. This may take some time.",mpaCreate:{name:"Name",namePlaceholder:"e.g. test-agent",nameHelp:"Used as the Runtime name. Use 4–64 letters, numbers, underscores or hyphens.",stepsLabel:"Creation steps",steps:{basics:"Basics",postgres:"PostgreSQL",openviking:"OpenViking",autoPostgres:"Database"},next:"Next",previousStep:"Previous",pgDescription:"Choose an existing PostgreSQL instance. Creation prepares an isolated database for this agent on that instance.",pgSplitDescription:"Use the configured business PG Workspace. Agents share this Workspace, each with its own database. Shared resource records are stored separately in mpa_admin_workspace / mpa_admin_db, configured by the administrator.",pgConsole:"Create or inspect an AIDAP PG Workspace in Volcengine",pgHost:"PG host",pgPort:"PG port",pgInvalid:"Enter a valid PG host and port.",pgCredentials:"The deployment service provides the PG login and password; host and port must match its configuration.",openvikingDescription:"Optional. Enter all three fields to enable OpenViking, or leave all blank to omit OpenViking settings from the new agent.",openvikingConsole:"Inspect OpenViking resources in Volcengine",openvikingUrl:"OpenViking service URL",openvikingResourceId:"OpenViking resource ID",openvikingApiKey:"OpenViking API Key",openvikingInvalid:"Enter a valid HTTPS service URL, resource ID and API Key together, or leave all blank.",openvikingCredentials:"The API Key is used only for this creation and is not saved in browser drafts; re-enter it after a refresh.",tosTitle:"Session output storage",tosDescription:"Optional. Enter complete TOS credentials and a bucket to mount an isolated output directory for every Session. Leave all three blank to use the server defaults; TOS mounting is disabled if no defaults are configured.",tosAccessKey:"TOS Access Key",tosSecretKey:"TOS Secret Key",tosBucket:"TOS bucket",tosInvalid:"TOS Access Key, Secret Key, and bucket are all required together.",tosCredentials:"Credentials are used only for this creation and are not saved in browser recovery data or creation task records.",runtimeImage:"MPA image",workerImage:"Worker image",imageDefault:"Leave blank to use the configured image",imageInvalid:"Enter a valid container image reference without URLs, spaces or credentials.",title:"Create MPA agent",agentId:"Agent ID",description:"Description",region:"Deployment region",plan:"Creation plan",sharedResources:"Prepare or reuse the account VPC, subnets and APIG message gateway",agentResources:"Prepare an isolated database, Skill Space and worker, then deploy the agent",readiness:"Verify gateway and agent readiness before adding the agent to the list",checking:"Checking creation configuration…",configured:"Creation configuration is ready. Submission checks cloud resources and starts provisioning.",notConfigured:"Creation prerequisites are not configured. Ask an administrator to configure them, then retry.",loadFailed:"Could not check creation configuration. Please retry.",reload:"Check again",submit:"Start creation",retry:"Retry creation",newAgent:"Create another agent",newAgentDescription:"Create another agent opens an editable new request and replaces this recovery draft. It does not cancel the old task. If the old task is still running, wait for it to finish before submitting.",close:"Close",cancel:"Cancel creation",confirmCancel:"Confirm cancellation",cancelDescription:"Cancellation stops subsequent steps. Created databases, Skill Spaces, gateways and other registered resources are retained. Retry using the same agent ID.",background:"Creation continues after closing this window. Open it again to view progress.",pollFailed:"Progress is temporarily unavailable. Reconnecting; avoid creating another agent.",iamPermissionDenied:"The deployment service lacks IAM permissions to prepare the runtime role. Ask an administrator to grant access, then retry.",iamTrustConflict:"The runtime role trust is incompatible. Ask an administrator to check VeFaaS and APIG access, then retry.",iamPolicyConflict:"An existing runtime policy with the required name has conflicting contents. Ask an administrator to check it, then retry.",iamOwnershipConflict:"The runtime role does not belong to the deployment account. Ask an administrator to check it, then retry.",iamVerificationFailed:"Runtime role permissions could not be confirmed. Check IAM availability and policies, then retry.",iamConfigurationConflict:"Automatic runtime role preparation requires the default MPA role. Check the server creation configuration.",creationFailed:"This step failed. Check its resources, server configuration and permissions, then retry the same agent ID.",cancelFailed:"Cancellation failed. Check the current progress and retry.",cancelled:"Creation cancelled. Registered resources are retained for retry.",timeout:"Creation timed out. Registered resources are retained. Inspect them before retrying.",interrupted:"Creation was interrupted. Retry the same agent ID to recover registered resources.",skillSpace:"Skill Space",states:{running:"Creating",cancelling:"Cancelling",succeeded:"Created",failed:"Creation failed",cancelled:"Cancelled"},stages:{queued:"Queued",iam_role:"Prepare runtime role",checking:"Checking account and configuration",network:"Preparing VPC and subnets",gateway:"Preparing APIG and IM Gateway",database:"Preparing business database",skills:"Preparing Skill Space",worker:"Preparing worker",deploying:"Preparing database, skills and Runtime",verifying:"Waiting for agent readiness",admin_workspace:"Prepare management PG Workspace",business_workspace:"Prepare business PG Workspace",admin_database:"Initialize shared management database"},back:"Keep creating",pgAutoDescription:"VeADK uses its deployment account to create or reuse two PG Workspaces. mpa_admin_workspace / mpa_admin_db stores shared resource records; the business Workspace hosts an independent database for each agent. No PG connection input is needed. Preparation starts after submission.",pgModeChanged:"This submitted task uses previous PG settings and cannot be retried in automatic mode. Ask an administrator to reconcile its resources and task before starting a new creation.",pgMigrationRequired:"An existing shared registry is configured. Migrate its resource records to mpa_admin_workspace / mpa_admin_db and coordinate the registry URL cutover for existing Runtimes, then recheck this configuration."}},uge={library:"Skill library",skill:"Skill",skills:"Skills",skillSpace:"Skill space",sandboxNotConfigured:"Dev Sandbox is not configured by an administrator",adminNotConfigured:"Not configured by an administrator",totalItems:"{{count}} items",cannotLoadSpaces:"Unable to load Skill spaces",someSpacesFailed:"Some Skill spaces failed to load",degradedRelationWarning:"Some relations are invalid. Readable skills have been restored.",downloadZip:"Download ZIP",optimize:"Optimize",closeSkillDetails:"Close Skill details",skillId:"Skill ID",allFiles:"All files",loadingSkillContent:"Loading Skill content…",noSkillContent:"This Skill has no SKILL.md content",addSkill:"Add Skill",localUpload:"Upload locally",localUploadDescription:"Select a ZIP file and upload it to the Skill space after validation",autoCreate:"Create automatically",autoCreateDescription:"Choose a model and style, then create a Skill through conversation",createSkill:"Create Skill",optimizeNamed:"Optimize {{name}}",deleteSkillConfirm:"Delete the entire Skill “{{name}}”? This affects every space that references it.",deleteSpaceConfirm:"Delete Skill space “{{name}}”? Make sure its Skills have been deleted first.",manageSpaceDescription:"Manage Skills in this space and create new versions",backToSpaces:"Back to Skill spaces",overview:"Overview",skillCount:"Skills",skillCountValue_one:"{{count}} Skill",skillCountValue_other:"{{count}} Skills",updatedAt:"Updated",skillsInSpace:"Skills in {{name}}",searchSkills:"Search Skills",cannotLoadSkills:"Unable to load Skills",noMatchingSkills:"No matching Skills",noSkills:"No Skills",tryAnotherName:"Try searching for another name",emptySkillsDescription:"Upload a Skill locally or create one automatically",actions:"Actions",spaceDetails:"Skill space details",editSpace:"Edit space",deleteSpace:"Delete space",searchSpaces:"Search Skill spaces",spaceList:"Skill space list",noMatchingSpaces:"No matching Skill spaces",createSpace:"Create Skill space",newSpace:"New space",loadingMoreSpaces:"Loading more Skill spaces",scrollForMore:"Scroll down to load more",allSpacesLoaded:"All Skill spaces loaded",errors:{loadSpaces:"Unable to load Skill spaces. Try again later.",loadSkills:"Unable to load Skills. Try again later.",loadSkillDetails:"Unable to load Skill details. Try again later.",deleteSkill:"Unable to delete the Skill",deleteSpace:"Unable to delete the Skill space",downloadSkill:"Unable to download the Skill"},status:{active:"Available",available:"Available",creating:"Creating",disabled:"Disabled",enabled:"Enabled",failed:"Error",inactive:"Inactive",pending:"Pending",published:"Published",ready:"Ready",released:"Published",running:"Running",success:"Healthy",unavailable:"Unavailable",unreleased:"Unreleased",updating:"Updating",unknown:"Unknown"},sharedSpace:"Enterprise shared space",sharedDescription:"Skills available to everyone, published and maintained by administrators",sharedVisibility:"Everyone",sharedPreparing:"Preparing shared space",sharedLoadFailed:"Shared space unavailable",sharedEmpty:"No shared skills yet. Skills published by administrators will appear here",requestPublication:"Request publication",reviewSubmitting:"Submitting…",reviewSubmitted:"Submitted",reviewFailed:"Could not submit the publication request",reviewStatusFailed:"Failed to load review status",reviewRetry:"Apply again",reviewPending:"Pending review",reviewApproving:"Publishing",reviewApproved:"Shared",reviewReturned:"Returned",reviewHistory:"Review history",skillDetailSections:"Skill detail sections",versions:{title:"Version management",refresh:"Refresh",uploading:"Uploading…",upload:"Upload new version",close:"Close",hint:"New versions become public after approval and do not replace published versions; the skill name in the ZIP must match the original",loading:"Loading versions…",loadFailed:"Unable to load versions",filesFailed:"Unable to load version files",uploadFailed:"Unable to upload the new version",submitFailed:"Unable to submit for review",retry:"Retry",empty:"No versions yet",current:"Current version",notSubmitted:"Not submitted",submitting:"Submitting…",submit:"Request publication",processing:"Version status: {{status}}",filesLoading:"Loading files…",filesEmpty:"No files",history:"Review history",shared:"Published"},author:"Author",authorName:"Author: {{name}}"},dge={library:"Knowledge bases",createBase:"New knowledge base",editBase:"Edit knowledge base",invalidName:"The name must start with a letter and contain only letters, numbers, and underscores.",nameHelp:"Start with a letter. Use up to 48 letters, numbers, or underscores.",optionalDescription:"Description (optional)",descriptionOnly:"AgentKit currently supports updating only the knowledge base description.",previewWeb:"Preview web content",addData:"Add data",openOriginalWeb:"Open original page",backToEdit:"Back to edit",confirmAdd:"Confirm and add",source:"Knowledge source",image:"Image",documentFile:"Document file",webPage:"Web page",webUrl:"Web page URL",generatingWebPreview:"Fetching the page and generating a Markdown preview",selectFile:"Select knowledge file",selectOrDropFile:"Select a file or drag it here",selectedFile:"{{size}} · Click to select another file",imageFileHelp:"PNG, JPG, and JPEG up to 200 MB",documentFileHelp:"PDF, PPTX, DOCX, XLSX, and TXT up to 200 MB",uploadingFile:"Uploading the file and adding it to the knowledge base",optionalName:"Name (optional)",optionalType:"Type (optional)",generatePreview:"Generate preview",uploadFile:"Upload file",editMetadata:"Edit knowledge metadata",knowledge:"Knowledge item",field:"Field",value:"Value",backToList:"Back to knowledge bases",metadataJson:"Metadata (JSON)",provider:"Provider",knowledgeId:"Knowledge ID",project:"Project",creator:"Created by",data:"Data",deleteInvalidAssociation:"Delete invalid association",noData:"This knowledge base has no data",addFirstData:"Add the first data item",format:"Format",size:"Size",searchData:"Search data",searchLibraryData:"Search knowledge base data",associationInvalid:"Association invalid",providerMissing:"The underlying Provider knowledge base no longer exists",noMatchingData:"No matching data",loadingMoreData:"Loading more data",retryLoading:"Retry loading",details:"Knowledge base details",searchBases:"Search knowledge bases",someBasesFailed:"Some knowledge bases are temporarily unavailable. Other available content is shown.",noMatchingBases:"No matching knowledge bases",noManagePermission:"You do not have permission to manage this knowledge base",loadingMoreBases:"Loading more knowledge bases",deleteBaseTitle:"Delete knowledge base?",deleteBaseDescription:"This removes the AgentKit association for {{name}}. If Studio created it, the Provider resource is also deleted. This cannot be undone.",deleteDocumentTitle:"Delete knowledge item?",deleteDocumentDescription:"This removes {{name}} from the Provider knowledge base. This cannot be undone.",preview:{processingTitle:"Data is being processed",processingDetail:"A preview will be available after parsing. Reload later.",failedTitle:"Data parsing failed",failedDetail:"Check the source file or page URL and add it again, or reload the latest status.",noParsedTitle:"No parsed content is available yet",noParsedDetail:"Text, tables, or page images will appear after the knowledge base finishes parsing this file.",noMediaTitle:"No media preview is available yet",noMediaDetail:"The knowledge base has not returned an accessible media preview. Reload later.",noDataTitle:"No data is available to preview",noDataDetail:"The knowledge base has not returned parsed results. Reload later.",attachmentError:"The attachment cannot be previewed. Try again later.",imageAlt:"Knowledge data image",audioUnsupported:"This browser does not support audio previews.",videoUnsupported:"This browser does not support video previews.",namedPdf:"{{name}} PDF preview",pdf:"PDF preview",openPdf:"If it cannot be displayed, open the PDF in a new window",fileUnsupported:"This format cannot be previewed directly online. Parsed content is shown when available.",openOriginalFile:"Open original file",loading:"Loading data preview",openOriginalHint:"You can open the original page to view the source content.",chunk:"Chunk {{index}}",loadingMore:"Loading more",loadMore:"Load more"},errors:{fileTooLarge:"A file cannot exceed 200 MB",invalidImageType:"Select a PNG, JPG, or JPEG image",invalidDocumentType:"Select a PDF, PPTX, DOCX, XLSX, or TXT file",createBase:"Unable to create the knowledge base",updateBase:"Unable to update the knowledge base",metadataObject:"Metadata must be a JSON object",metadataFormat:"Invalid metadata format",noWebPreview:"The page has no Markdown content to preview",addWeb:"Unable to add the web page",previewWeb:"Unable to generate the web page preview",uploadFile:"Unable to upload the file",updateDocument:"Unable to update the knowledge item",loadPreview:"Unable to load the data preview",loadMoreBases:"Unable to load more knowledge bases",loadBases:"Unable to load knowledge bases",loadMoreData:"Unable to load more data",loadData:"Unable to load data",deleteBase:"Unable to delete the knowledge base",deleteDocument:"Unable to delete the knowledge item"}},fge={title:"Feishu channel",refresh:"Refresh",loading:"Loading channel configuration…",unsupported:"This Runtime does not support channel management. Upgrade its MPA image.",unauthorized:"Channel management requires a Studio administrator and an authorized Runtime credential.",configurationError:"Channel management configuration is incomplete. Check the Runtime metadata and encryption key.",requestFailed:"Channel request failed. Check the Runtime connection and retry.",bound:"Bound: {{name}}",unbound:"No Feishu bot is bound.",guidance:"Private chats use separate conversations. In allowed groups, mention this bot to start a conversation.",keyRequired:"Configure a persistent CHANNEL_STATE_ENCRYPTION_KEY in the Runtime before binding.",gateway:"Message gateway",route:"Inbound route",delivery:"Reply delivery",configured:"Configured",missing:"Missing",delivery_not_observed:"Not observed",delivery_delivered:"Delivered",delivery_retrying:"Retrying",missingConfig:"Missing Runtime configuration: {{fields}}",bind:"Bind with QR code",newQr:"Generate a new QR code",unbind:"Unbind",confirmUnbind:"Disconnect this bot? It will stop receiving new messages.",qrAlt:"Bot authorization QR code",openQr:"Open authorization page",uncertain:"Registration was interrupted. Check the bot binding and Gateway before starting again.",bindingFailed:"Binding failed. Check Gateway configuration and retry.",chatId:"Allowed group ID",scope:"Group conversation scope",saveGroup:"Save group",noGroups:"No groups allowed yet. Private chats do not need this permission.",edit:"Edit",remove:"Remove",removeGroup:"Remove {{name}}",scope_group_sender:"Separate by sender",scope_group:"Shared by group",scope_group_topic_sender:"Separate by topic and sender",scope_group_topic:"Shared by topic",status_PENDING:"Waiting for scan",status_SCANNED:"Scanned; waiting for authorization",status_AUTHORIZED:"Authorized; preparing registration",status_REGISTERING:"Registering bot",status_BOUND:"Bot bound",status_FAILED:"Binding failed",status_EXPIRED:"QR code expired",workspaceTitle:"Message channels",workspaceDescription:"Connect messaging apps to this Agent and manage access.",provider_feishu:"Feishu",provider_wecom:"WeCom",provider_dingtalk:"DingTalk",comingSoon:"Not available yet",unavailableDescription:"Binding and message settings for {{name}} are not available yet.",runtimeRequired:"Deploy this Agent to a Runtime before configuring message channels.",bindingTitle:"Bot connection",connected:"Bound",notBound:"Not bound",gatewayDescription:"Gateway configuration for receiving channel messages.",routeDescription:"Routing configuration for delivering messages to this Agent.",deliveryDescription:"Observed reply delivery; configuration alone does not confirm delivery.",groupsTitle:"Group access",groupsDescription:"Allow specific groups and choose how conversations are shared.",providerBindingTitle:"Connect {{name}}",providerUnbound:"Connect a {{name}} bot to let users message this agent.",qrGuidance:"Authorize with {{name}}. The Runtime saves the bot credentials and configures the message gateway.",wecomGuidance:"Authorize with WeCom QR code, or enter a Bot ID and Secret to bind an existing bot.",wecomBotId:"Bot ID",wecomSecret:"Secret",bindCredentials:"Connect bot",wecomScan:"Bind with QR code",wecomAuthorizing:"Waiting for WeCom authorization…",cancelAuthorization:"Cancel authorization",wecomPopupBlocked:"Allow popups in your browser, then try authorizing again.",wecomAuthCancelled:"WeCom authorization was cancelled. You can scan again.",wecomAuthTimeout:"WeCom authorization timed out. Please scan again.",wecomInvalidResult:"Authorization did not return a Bot ID and Secret. Authorize again or enter them manually.",wecomAuthFailed:"WeCom authorization failed. Try again or enter credentials manually.",dingtalkClientId:"Client ID",dingtalkClientSecret:"Client Secret",manualUpgrade:"Upgrade this Runtime image to configure {{name}} manually. Quick setup is still available.",pairingTitle:"Message channel QR pairing",feishuPairingDescription:"If a bot is already connected, it will be replaced after successful Feishu authorization and binding. In the authorization flow, you can bind an existing bot or create a new one.",generatingQr:"Generating pairing QR code…",dingtalkGuidance:"Authorize with DingTalk QR code, or enter a Client ID and Client Secret to bind an existing bot.",wecomPairingDescription:"Pair again in the WeCom authorization window. The new bot replaces the current connection after binding succeeds. Cancelling authorization or a failed binding does not disconnect the existing bot.",configurationMethod:"Configuration method",quickSetup:"Quick setup",manualSetup:"Manual setup",feishuAppId:"App ID",feishuAppSecret:"App Secret",manualGuidance:"Enter the credentials of an existing {{name}} bot to connect it to this agent.",manualReplacement:"Successful binding replaces the current bot. Cancelling or a failed binding does not disconnect the existing bot."},pVe={common:Vme,agentKitPromo:Hme,systemInfo:qme,agentWorkspace:Wme,environmentCenter:Kme,deploymentSelect:Gme,deploymentError:Xme,studioBuildProgress:Yme,cloudEnvironment:Zme,githubCicd:Jme,feishuDeployment:ege,deploymentResources:tge,studioUpdate:nge,projectPreview:ige,workspace:rge,resourceCollection:sge,skillSourcePicker:age,composer:oge,agentSelector:lge,myAgents:cge,skillCenter:uge,knowledge:dge,channels:fge},mVe=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:Hme,agentSelector:lge,agentWorkspace:Wme,channels:fge,cloudEnvironment:Zme,common:Vme,composer:oge,default:pVe,deploymentError:Xme,deploymentResources:tge,deploymentSelect:Gme,environmentCenter:Kme,feishuDeployment:ege,githubCicd:Jme,knowledge:dge,myAgents:cge,projectPreview:ige,resourceCollection:sge,skillCenter:uge,skillSourcePicker:age,studioBuildProgress:Yme,studioUpdate:nge,systemInfo:qme,workspace:rge},Symbol.toStringTag,{value:"Module"})),hge="User management",pge="{{count}} members",mge="User",gge="Role",bge="Account status",yge="Last sign-in",vge="Actions",xge="Change role",wge="Close",Oge="Save role",kge="Saving…",Sge="Cancel",Ege="Back",Cge="User pool",Age="Volcengine Identity",Tge="Search name, email or user ID",_ge="Search",jge="Filter by role",Nge="All roles",Rge="Refresh",Ige="Loading users…",Pge="Updated at {{time}}",Dge="{{name}} is now {{role}}",Mge="Retry",Lge="You",$ge="Initial super administrator",Fge="The initial super administrator cannot be demoted here",Bge="The new permissions apply when the user refreshes Studio",Uge="Role needs confirmation",Qge="No matching users",zge="Try another search or role",Vge="Users appear here after signing in or joining this user pool",Hge="{{count}} users",qge="Previous",Wge="Next",Kge="Not signed in yet",Gge="Not provided",Xge={super_admin:"Super administrator",admin:"Administrator",developer:"Developer",user:"User"},Yge={super_admin:"Manage all resources, users and role assignments",admin:"Manage Studio resources",developer:"Develop agents and manage your own resources",user:"Use agents and personal features"},Zge={EXTERNAL_PROVIDER:"Active",CONFIRMED:"Active",NORMAL:"Active",ENABLED:"Active",ACTIVE:"Active",UNCONFIRMED:"Unverified",DISABLED:"Disabled",FORBIDDEN:"Disabled",LOCKED:"Locked",SUSPENDED:"Suspended",FORCE_CHANGE_PASSWORD:"Password change required"},Jge={request_failed:"The request did not finish. Refresh the list to confirm its current state before retrying",invalid_response:"The user service returned an invalid response. Refresh and try again",identity_unavailable:"Identity is unavailable. Try again later or check service permissions",identity_resource_missing:"The user or user pool no longer exists. Refresh the list",super_administrator_required:"Only super administrators can manage users",sign_in_required:"Sign in and try again",user_not_in_pool:"Your account does not belong to this user pool",user_disabled:"Your account is disabled",protected_administrator:"The initial super administrator cannot be demoted",cannot_demote_self:"You cannot demote your own super administrator role",role_change_conflict:"The role has changed. Close this dialog and refresh the list before retrying",cross_origin_request:"Change roles from the current Studio page"},gVe={title:hge,memberCount:pge,user:mge,role:gge,status:bge,lastLogin:yge,actions:vge,changeRole:xge,close:wge,save:Oge,saving:kge,cancel:Sge,back:Ege,pool:Cge,volcengineIdentity:Age,searchPlaceholder:Tge,search:_ge,filterRole:jge,allRoles:Nge,refresh:Rge,loading:Ige,updatedAt:Pge,saved:Dge,retry:Mge,you:Lge,initialAdministrator:$ge,protectedExplanation:Fge,effectiveAfterRefresh:Bge,roleConflict:Uge,noUsers:Qge,tryAnotherSearch:zge,poolEmpty:Vge,resultCount:Hge,previous:qge,next:Wge,neverLoggedIn:Kge,unknown:Gge,roles:Xge,descriptions:Yge,states:Zge,errors:Jge},bVe=Object.freeze(Object.defineProperty({__proto__:null,actions:vge,allRoles:Nge,back:Ege,cancel:Sge,changeRole:xge,close:wge,default:gVe,descriptions:Yge,effectiveAfterRefresh:Bge,errors:Jge,filterRole:jge,initialAdministrator:$ge,lastLogin:yge,loading:Ige,memberCount:pge,neverLoggedIn:Kge,next:Wge,noUsers:Qge,pool:Cge,poolEmpty:Vge,previous:qge,protectedExplanation:Fge,refresh:Rge,resultCount:Hge,retry:Mge,role:gge,roleConflict:Uge,roles:Xge,save:Oge,saved:Dge,saving:kge,search:_ge,searchPlaceholder:Tge,states:Zge,status:bge,title:hge,tryAnotherSearch:zge,unknown:Gge,updatedAt:Pge,user:mge,volcengineIdentity:Age,you:Lge},Symbol.toStringTag,{value:"Module"})),ebe="Website integration",tbe="Embed an AgentKit Runtime on your website as a floating chat window",nbe="Back to automations",ibe="Add website",rbe="Loading Runtime",sbe="Select Runtime",abe="Website domain",obe="For example, xxxx.com or localhost:5173",lbe="Generating",cbe="Generate token",ube="Added websites",dbe="{{count}} website",fbe="{{count}} websites",hbe="Loading website integrations",pbe="No website integrations yet",mbe="Select a Runtime and enter a website domain to generate a token",gbe="Embed instructions",bbe="Place this code before the closing body tag on your website",ybe="Copied",vbe="Copy code",xbe="Embed code will appear here after you add a website.",wbe="Delete the website integration for {{domain}}?",Obe={load:"Failed to load website integrations",create:"Failed to create website integration",delete:"Failed to delete website integration",noConversationalAgent:"No conversational Agent was found in this Runtime"},kbe={requestFailed:"Request failed ({{status}})",greeting:"Hello. How can I help?",sessionFailed:"Could not start a chat session",unauthorized:"This website is not authorized to start a chat",conversationFailed:"The chat request failed. Try again shortly.",open:"Open Agent chat",close:"Close Agent chat",panelLabel:"Agent chat panel",assistant:"Agent assistant",online:"Online"},yVe={title:ebe,description:tbe,backToAutomations:nbe,addWebsite:ibe,loadingRuntime:rbe,selectRuntime:sbe,websiteDomain:abe,domainPlaceholder:obe,generating:lbe,generateToken:cbe,addedWebsites:ube,websiteCount_one:dbe,websiteCount_other:fbe,loadingIntegrations:hbe,delete:"Delete",emptyTitle:pbe,emptyDescription:mbe,embedMethod:gbe,embedInstructions:bbe,copied:ybe,copyCode:vbe,embedHint:xbe,confirmDelete:wbe,errors:Obe,widget:kbe},vVe=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:ibe,addedWebsites:ube,backToAutomations:nbe,confirmDelete:wbe,copied:ybe,copyCode:vbe,default:yVe,description:tbe,domainPlaceholder:obe,embedHint:xbe,embedInstructions:bbe,embedMethod:gbe,emptyDescription:mbe,emptyTitle:pbe,errors:Obe,generateToken:cbe,generating:lbe,loadingIntegrations:hbe,loadingRuntime:rbe,selectRuntime:sbe,title:ebe,websiteCount_one:dbe,websiteCount_other:fbe,websiteDomain:abe,widget:kbe},Symbol.toStringTag,{value:"Module"})),Sbe={types:{all:"All types",document:"Documents",image:"Images",video:"Videos"},previewArtifact:"Preview {{name}}",moreActions:"More actions for {{name}}",actionMenu:"Actions for {{name}}",download:"Download",downloading:"Downloading",edit:"Edit details",delete:"Delete artifact",previewFailed:"Could not preview “{{name}}”: {{message}}",downloadStarted:"Download started for {{name}}",downloadFailed:"Could not download “{{name}}”: {{message}}",updated:"Updated {{name}}",deleted:"Deleted {{name}}",deleteFailed:"Could not delete “{{name}}”: {{message}}",typeFilter:"Artifact type",searchAria:"Search artifacts",searchPlaceholder:"Search artifacts or sessions",retry:"Retry",close:"Close",listAria:"Artifact list",loadFailed:"Could not load artifacts",loadDetailFallback:"Check the storage configuration and try again.",reload:"Reload",noMatch:"No matching artifacts",noArtifacts:"You do not have any artifacts yet",searchHint:"Try another search or artifact type",emptyHint:"Artifacts created in chats will appear here automatically",columns:{name:"Name",source:"Source",updatedAt:"Modified",actions:"Actions"},loadingMore:"Loading more artifacts",unknownTime:"Unknown time",preview:{close:"Close preview",meta:"{{type}} / Version {{version}}",loading:"Loading preview",alt:"Preview of {{name}}",loadFailed:"The preview could not be loaded. Try again later or download the file.",unsupported:"This format cannot be previewed online. Download the file to view it.",sourceAria:"Artifact source",agent:"Agent",session:"Session",tool:"Generated by",createdAt:"Created",fileSize:"File size",tags:"Tags",viewSession:"View session"},deleteDialog:{title:"Delete artifact?",description:"“{{name}}” will be permanently removed from the artifact library. The chat history will not be affected.",deleting:"Deleting",confirm:"Delete",close:"Close delete confirmation"},api:{withStatus:"{{message}} ({{status}})",listFailed:"Could not load the artifact library",syncFailed:"Could not sync chat artifacts",updateFailed:"Could not update the artifact",deleteFailed:"Could not delete the artifact",downloadFailed:"Could not download the artifact"}},Ebe={unknownSource:"Unknown source",unknownCreator:"Unknown creator"},Cbe={nameRequired:"Enter an artifact name",tooManyTags:"You can add up to {{max}} tags",tagTooLong:"Each tag can contain up to {{max}} characters",title:"Edit artifact details",subtitle:"The content file will not be modified",close:"Close edit dialog",name:"Name",description:"Description",descriptionPlaceholder:"Add its purpose, version, or usage notes",tags:"Tags",tagsPlaceholder:"Separate tags with commas, up to {{max}}",cancel:"Cancel",saving:"Saving",save:"Save"},Abe={change:{added:"Added",modified:"Modified",deleted:"Deleted"},noChanges:"There are no source changes between these versions",chooseFile:"Select a file on the left to view its code",compareTitle:"Compare versions",workspaceTitle:"Source workspace",projectFallback:"Agent project",switchTheme:"Switch source theme",switchThemeTitle:"Switch to {{theme}} theme",themes:{dark:"dark",light:"light"},closeWorkspace:"Close source workspace",close:"Close",changedFiles:"Changed files",projectFiles:"Project files",changes:"Changes",files:"Files",openFiles:"Open files",noFileSelected:"No file selected",comparisonDirection:"Comparison direction",before:"Before optimization",after:"After optimization",loadingEditor:"Loading editor…",changedFileCount_one:"{{count}} file changed",changedFileCount_other:"{{count}} files changed",fileCount_one:"{{count}} file",fileCount_other:"{{count}} files",lineCount_one:"{{count}} line · UTF-8",lineCount_other:"{{count}} lines · UTF-8",viewSource:"View source",viewSourceAria:"View and edit project source"},Tbe={nav:"Search",selectAgent:"Select an Agent",checkingCapabilities:"Checking Agent capabilities",notMounted:"This Agent does not have {{label}} mounted",sources:{session:"Sessions",web:"Web",knowledge:"Knowledge base",memory:"Long-term memory"},webDescription:"Search with the web_search tool",backendLocal:"Local",failed:"Search failed: {{message}}",placeholder:{selectAgent:"Select an Agent first",web:"Search the web",knowledge:"Search {{name}}",knowledgeFallback:"this Agent's knowledge base",memory:"Search {{name}}",memoryFallback:"this user's long-term memory",session:"Search this Agent's sessions"},sourceTypeAria:"Search source: {{label}}",notSelected:"Not selected",sourceType:"Search source",selectSource:"Select a search source",noAgentHint:"Select an Agent to search its sessions, the web, and mounted data sources.",loadingCapabilities:"Loading this Agent's search capabilities…",sourceUnavailable:"This Agent does not have this data source mounted",instructions:{web:"Enter keywords and press Enter or select the button to search with web_search.",knowledge:"Enter a question to search this Agent's knowledge base.",memory:"Enter a clue to search long-term memories saved across this user's sessions.",session:"Enter keywords and press Enter or select the button to search this Agent's sessions."},noResults:"No results found for “{{query}}”.",knowledgeFragment:"Knowledge excerpt {{index}}",memoryFragment:"Memory excerpt {{index}}"},_be={title:"Developer Resources",sections:{documentation:{title:"Related links",description:"Open development documentation and common AgentKit destinations"},bestPractices:{title:"Best practices",description:"Learn from practical development, debugging, and deployment guidance"},showcases:{title:"Showcases",description:"Explore applications built with AgentKit"}},links:{veadkDocs:"VeADK documentation",cliDocs:"AgentKit CLI documentation",platformDocs:"AgentKit platform documentation",console:"AgentKit console"},articles:{veadkDevelopment:{title:"Develop and deploy an Agent with VeADK",description:"Build an Agent with VeADK and deploy it to AgentKit Runtime."},cliDevelopment:{title:"Develop and deploy an Agent with AgentKit CLI",description:"Create a project, debug an Agent, and deploy it with AgentKit CLI."},coverAlt:"Cover image for {{title}}"},showcases:{researchAssistant:{title:"Multi-agent research assistant",description:"Specialized Agents work together to research, analyze, and summarize findings."},multimodalAnalysis:{title:"Multimodal content analysis",description:"Understand images, documents, and video in a single session."},customerService:{title:"Customer service workspace",description:"Combine knowledge retrieval and tool calls to handle complex support requests."},webSearch:{title:"Web search Agent",description:"Search current web content and organize it into traceable answers."},a2uiApp:{title:"A2UI interactive app",description:"Let an Agent generate interactive interfaces as it works through a task."},previewAlt:"Interface preview for {{title}}"}},jbe={title:"Library",untitledSession:"Untitled session",categoryAria:"Library categories",regionAria:"Region",tabs:{skills:"Skills",knowledge:"Knowledge",artifacts:"Artifacts"}},Nbe={title:"Manage Agents",subtitle:"Agents in AgentKit Runtime that you can manage",mainAgentOnly:"Only the main Agent is shown (control-plane information).",deleteConfirm:'Delete Agent "{{name}}"? Its Runtime will be permanently deleted.',regionFilterTitle:"Filter by region",regionFilterAria:"Region filter",regionAria:"Region",refresh:"Refresh",loading:"Loading…",empty:"You have not deployed any Agents.",connected:"Connected",connect:"Connect to this Agent",deleteRuntime:"Delete this Runtime",loadingDetail:"Loading details…",agentStructure:"Agent structure",secretHidden:"Sensitive value is never shown. Copy it with an authorized request.",revealSecret:"Sensitive value for {{key}}",copySecret:"Copy the value of {{key}}",copy:"Copy",copied:"Copied",copyFailed:"Copy failed",notConfigured:"Not configured",fields:{model:"Model",description:"Description",status:"Status details",project:"Project",version:"Version",resources:"Resources",memory:"Memory",tool:"Tool",knowledge:"Knowledge",mcpToolset:"MCP Toolset",updatedAt:"Updated"},resource:{memory:"Memory {{value}} MB",instances:"Instances {{min}}-{{max}}",concurrency:"Concurrency {{value}}"},environmentVariables:"Environment variables",unnamed:"(Unnamed)"},Rbe={mainAgent:"Main Agent",subAgent:"Sub-agent {{index}}",itemCount_one:"{{count}} item",itemCount_other:"{{count}} items",info:"Agent information",infoAndTopology:"Agent information and settings",loadingInfo:"Loading Agent information…",unnamedAgent:"Unnamed Agent",agentsMd:"AGENTS.md",tools:"Tools",toolList:"Tool list",studioTool:"Studio Tool",removeTool:"Remove tool {{name}}",remove:"Remove",notConfigured:"Not configured",addStudioTool:"Add Studio tools",addStudioToolHere:"Add Studio tools to this chat",skills:"Skills",skillList:"Skill list",addSkill:"Add Skill Space skills",addSkillHere:"Add Skill Space skills to this Session",skillMountNextTurn:"Mounted versions are frozen when the next Turn starts.",previewUnsupported:"Preview is not supported",sessionEnvironment:"Session environment",environment:"Environment",agentCanvas:"Agent canvas",topology:"Structure",nodeKinds:{agent:"Agent",sandbox:"Sandbox","worker-session":"Worker Session","skill-space":"Skill Space",skill:"Skill","studio-tool":"Studio Tool",mcp:"MCP",environment:"Environment",knowledge:"Knowledge","sub-agent":"Sub-agent"},nodeStatuses:{configured:"Configured",mounted:"Mounted",running:"Running",paused:"Paused"},viewCanvasFullscreen:"View Agent canvas in full screen",viewFullscreen:"View full screen",executionCanvas:"Agent execution canvas",fullscreenExecutionCanvas:"Full-screen Agent execution canvas",closeFullscreenCanvas:"Close full-screen canvas",close:"Close",capabilitiesSubtitle:"Capabilities and collaboration topology",closeInfo:"Close Agent information",infoUnavailable:"Agent information is temporarily unavailable.",refresh:"Refresh information",loadingSkills:"Loading bound skills…",sessionSkills:"Temporary session skills",noBoundSpace:"This agent has no bound Skill Space.",noBoundSkills:"The bound Skill Space has no skills.",loadFailed:"Could not load this information. Refresh to retry.",accessDenied:"You do not have permission to read this information.",documentUnsupported:"Upgrade the Runtime image to enable Studio to read AGENTS.md.",skillsUnsupported:"This Runtime does not provide Skill Space bindings.",skillsDegraded:"Skill information is incomplete. Refresh to retry.",documentEditHint:"Edit the latest version. Saving publishes a new version to this Skill Space and can affect other agents using it. Running sessions may need a cache refresh or a new session. Keep the frontmatter name unchanged.",documentLoading:"Loading SKILL.md…",documentWritable:"Editable",documentReadOnly:"Read only — this space or your permissions do not allow editing",documentLoadFailed:"Could not load SKILL.md. Refresh to retry.",documentSaveFailed:"Save was not confirmed. Your edits are preserved. Reopen to check the current version before retrying.",documentConflict:"A newer version exists. Copy your edits, then reopen the editor to avoid overwriting it.",discardDocument:"Discard unsaved changes?",keepEditing:"Keep editing",discardChanges:"Discard changes",saveDocument:"Save new version"},Ibe={mountFailed:"Could not mount the environment",closeDialog:"Close environment dialog",addTitle:"Add environments",description:"Choose the Sandbox environments this Agent can use in the current session",closeAdd:"Close Add environments",searchAria:"Search environments",searchPlaceholder:"Search environment names or capabilities",availableAria:"Available environments and workspaces",loading:"Loading available environments…",noMatch:"No matching environments or workspaces",workspaces:"Workspaces",reuseAll:"Use every available environment in this workspace",availableEnvironmentCount_one:"{{count}} available environment",availableEnvironmentCount_other:"{{count}} available environments",selectWorkspace:"Select workspace {{name}}",environments:"Environments",includedByWorkspaces:"Included by workspace {{names}}",nameSeparator:", ",selectEnvironment:"Select environment {{name}}",selectedWorkspaceCount_one:"{{count}} workspace selected",selectedWorkspaceCount_other:"{{count}} workspaces selected",coveredEnvironmentCount_one:"{{count}} environment covered",coveredEnvironmentCount_other:"{{count}} environments covered",selectionSummary:"{{workspaces}}, {{environments}}",cancel:"Cancel",mounting:"Mounting…",confirm:"Add selected",mountedAria:"Mounted environments",environmentCount_one:"{{count}} environment",environmentCount_other:"{{count}} environments",removeWorkspace:"Remove workspace {{name}}",remove:"Remove",removeEnvironment:"Remove environment {{name}}",add:"Add environments",addMore:"Add more environments",addForSession:"Add environments to this session",loadingAvailable:"Loading available environments…",empty:"No AIO Sandbox environments are available."},Pbe={loading:{searching:"Looking for an existing environment",creating:"Initializing environment",connecting:"Connecting to the environment"},initializationFailed:"AgentKit CLI environment initialization failed. Current status: {{status}}.",sessionExpired:"The AgentKit CLI session does not exist or has expired. Try again.",initializationTimeout:"AgentKit CLI environment initialization timed out. Try again later.",nonPersistent:"Non-persistent environment",recyclingHoursMinutes:"Environment reclaimed in {{hours}} hr {{minutes}} min",recyclingMinutes:"Environment reclaimed in {{minutes}} min",connectionError:`Could not connect to the Studio service because the server did not respond. -Original error: {{message}}`,unavailable:"Connection unavailable",requestFailed:"AgentKit CLI request failed",retry:"Retry",terminalTitle:"AgentKit CLI terminal"},Dbe={labels:{coding:"Coding",get_city_weather:"City weather",get_location_weather:"Location weather",web_fetch:"Fetch web content",studio_write_artifact:"Save session artifact"},closeDialog:"Close dialog",title:"Add Studio tools",description:"Studio BFF runs these tools for {{agentName}} in the current session. No Runtime installation is required.",close:"Close Add Studio tools",searchAria:"Search Studio tools",searchPlaceholder:"Search by name or tool ID",availableAria:"Available Studio tools",loading:"Loading Studio tools…",noMatch:"No matching Studio tools",remove:"Remove",add:"Add"},Mbe={artifactLibrary:Sbe,resourceMetadata:Ebe,artifactEdit:Cbe,codeBrowser:Abe,search:Tbe,developerResources:_be,library:jbe,manageAgents:Nbe,agentTopology:Rbe,sessionEnvironment:Ibe,agentKitCli:Pbe,studioTools:Dbe},xVe=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:Pbe,agentTopology:Rbe,artifactEdit:Cbe,artifactLibrary:Sbe,codeBrowser:Abe,default:Mbe,developerResources:_be,library:jbe,manageAgents:Nbe,resourceMetadata:Ebe,search:Tbe,sessionEnvironment:Ibe,studioTools:Dbe},Symbol.toStringTag,{value:"Module"})),Lbe={requestFailed:"请求失败 ({{status}})",unknownError:"未知错误",contentTypeMissing:"Content-Type 缺失",response:"响应:{{response}}",fallbackWithDetail:"{{fallback}}:{{detail}}",fallbackWithHttpStatus:"{{fallback}}(HTTP {{status}})",nonJsonResponse:"{{fallback}}:服务端返回非 JSON 响应({{contentType}})"},$be={unconfigured:"管理员未配置 AgentKit Dev Sandbox,请配置后再使用",invalidSession:"AgentKit CLI 返回了无效的 Session。",loadCapabilitiesFailed:"无法读取 AgentKit CLI 配置。",invalidCapabilities:"AgentKit CLI 返回了无效的配置状态。",listSessionsFailed:"无法读取 AgentKit CLI Session。",invalidSessionList:"AgentKit CLI 返回了无效的 Session 列表。",createSessionFailed:"无法创建 AgentKit CLI Session。",openSessionFailed:"无法打开 AgentKit CLI Session。",openTerminalFailed:"无法打开 AgentKit CLI 终端。",invalidTerminalUrl:"AgentKit CLI 返回了无效的终端地址。"},Fbe={cnBeijing:"华北 2(北京)",cnShanghai:"华东 2(上海)"},Bbe={runtimeUnsupported:"该 Runtime 暂不支持连接,请确认服务已正常运行。"},Ube={autoConfigureFailed:"飞书机器人自动配置失败"},Qbe={actionFailed:"{{action}}失败",detail:"详细信息:{{detail}}",request:"请求:{{request}}"},zbe={persistentMemoryHint:"提示:会话已不存在。使用 in-memory 或 SQLite 短期记忆时,多实例、进程重启或滚动发布都可能导致会话丢失;建议改用基于数据库的持久化短期记忆存储。",unsupportedRouteHint:"提示:该 Runtime 未提供会话能力运行接口,可能是 Runtime 版本与当前 Studio 不兼容。",toolArgumentHint:"提示:模型生成的工具参数格式不完整,请重新发送一次。",resourceCollectionExpiredHint:"提示:本次资源清单已失效,请重新发送任务;系统会重新收集资源后再创建 Agent。",networkConfigurationHint:"提示:请稍后重试,查看 Runtime、模型或网关日志。",modelQuotaHint:"提示:模型当前触发了 TPM/RPM 配额限制,请稍后重试或提高模型配额。",rawResponseLabel:"原始响应:",copySecretFailed:"复制敏感值失败"},Vbe={httpStatus:"HTTP 状态码:{{status}}",errorCode:"错误码:{{code}}",cloudResponseBody:`云端响应正文: -{{body}}`,loadFailedWithDetail:"读取实例日志失败:{{detail}}",invalidFormat:"读取实例日志失败:服务返回格式无效"},Hbe={untitledSession:"未命名会话",webUnavailable:"网络搜索接口未就绪(后端未启用 /web/search)。",webFailed:"网络搜索失败:{{message}}",webNotMounted:"当前 Agent 未挂载 web_search 工具。",knowledgeNotMounted:"该 Agent 未挂载知识库。",memoryNotMounted:"该 Agent 未挂载长期记忆。",knowledge:"知识库",longTermMemory:"长期记忆"},qbe={listSpacesFailed:"读取 Skill 空间失败",createSpaceFailed:"创建 Skill 空间失败",updateSpaceFailed:"更新 Skill 空间失败",deleteSpaceFailed:"删除 Skill 空间失败",uploadFailed:"上传 Skill 失败",validateFailed:"校验 Skill 失败",deleteFailed:"删除 Skill 失败",listFilesFailed:"读取 Skill 文件失败",downloadFailed:"下载 Skill 失败",sharedSpaceFailed:"共享空间加载失败",reservedSpaceName:"此名称由系统空间保留,请使用其他名称",reviewSpaceFailed:"待审核空间暂不可用",submitReviewFailed:"申请公开失败",listReviewsFailed:"加载审核申请失败",reviewFilesFailed:"加载提交文件失败",decideReviewFailed:"审批失败,请重试",listVersionsFailed:"无法加载技能版本",uploadVersionFailed:"上传技能新版本失败"},Wbe={truncatedData:"{{data}}…(已截断,共 {{count}} 个字符)",incompleteEvent:"SSE 流在事件完整返回前已结束。原始数据:{{data}}",invalidEventJson:"无法解析 SSE 事件中的 JSON。原始数据:{{data}}"},Kbe={loadConfigNetworkFailed:"无法加载登录配置,请检查网络后重试。",configServiceFailed:"登录配置服务异常(HTTP {{status}}),请稍后重试。",invalidConfigResponse:"登录配置服务返回了无法解析的响应,请稍后重试。",serviceNetworkFailed:"无法连接身份服务,请检查网络后重试。",invalidServiceResponse:"身份服务返回了无法解析的响应,请稍后重试。",serviceFailed:"身份服务异常(HTTP {{status}}),请稍后重试。"},Gbe={invalidToken:"GitHub Token 无效或没有仓库写入权限",notFound:"仓库、分支或文件不存在,或 Token 无权访问",rejectedCommit:"GitHub 拒绝了提交,请检查分支和文件状态",requestFailed:"GitHub 请求失败(HTTP {{status}})",networkFailed:"连接 GitHub 失败,请检查网络后重试",invalidRepositoryFormat:"GitHub Repo 格式应为 owner/repository",insecureRepositoryUrl:"仅支持安全的 github.com 仓库地址",unsafeProjectPath:"Agent 项目目录必须是仓库内的安全相对路径",tokenRequired:"GitHub Token 不能为空",invalidBaseBranch:"目标分支格式不正确",invalidPublishBranch:"发布分支格式不正确",noFiles:"没有需要提交的文件",missingBaseSha:"目标分支缺少有效 Git SHA",fileAlreadyExists:"目标仓库中已存在 {{path}},未覆盖现有文件",pathNotUpdatable:"目标路径 {{path}} 不是可更新的文件",invalidPullRequest:"GitHub 未返回有效的 Pull Request"},Xbe={loadCapabilitiesFailed:"加载视频模型能力失败",uploadAssetFailed:"上传{{fileName}}失败",enhancePromptFailed:"提示词优化失败",createTaskFailed:"创建视频生成任务失败",getTaskFailed:"查询视频生成任务失败",downloadFailed:"下载生成视频失败"},Ybe={listFailed:"加载网站集成失败",createFailed:"创建网站集成失败",deleteFailed:"删除网站集成失败"},Zbe={loadFailed:"读取知识库失败",htmlHidden:"[HTML 内容已隐藏]",redacted:"[已脱敏]",depthTruncated:"[内容过深,已截断]",circularReference:"[循环引用]",diagnosticsUnavailable:"[诊断信息无法显示]",statusCode:"状态码:{{status}}",errorCode:"错误码:{{code}}",requestId:"请求 ID:{{requestId}}",diagnostics:"诊断:{{diagnostics}}",detail:"详情:{{detail}}",signInRequired:"请先登录后再访问知识库",forbidden:"你没有权限操作这个知识库",notFound:"知识库或知识内容不存在",conflict:"知识库当前状态不允许执行此操作",requestFailed:"知识库请求失败 ({{status}})"},Jbe={invalidName:"名称须为 1~128 个字符,不能包含控制字符、不可见格式字符或 < >。",renameProjectFailed:"修改项目名称失败",renameVersionFailed:"修改版本名称失败",invalidNameUpdateResponse:"名称更新响应与请求不一致,请刷新后重试。",invalidSourceSnapshot:"源码快照的响应格式无效。",invalidProjectList:"项目列表的响应格式无效。",invalidProjectVersion:"项目版本的响应格式无效。",loadProjectsFailed:"无法读取已保存项目",loadVersionsFailed:"无法读取项目版本",deleteVersionFailed:"删除项目版本失败",invalidDeleteVersionResponse:"删除项目版本的响应格式无效。",loadProjectSourceFailed:"无法读取项目源码",loadSnapshotFailed:"无法读取源码快照",restoreSnapshotFailed:"无法恢复当前源码快照",downloadSourceFailed:"下载源码失败",downloadNotZip:"源码下载响应不是 ZIP 文件。",downloadSizeMismatch:"源码压缩包大小与发布记录不一致,请重试。"},eye={invalidFormat:"{{label}}格式错误。",validationSeparator:";",invalidAnalysisResult:"迁移分析结果格式错误。",invalidFrameworkCandidate:"框架候选格式错误。",invalidAnalysisEvidence:"分析证据格式错误。",invalidEntryCandidate:"入口候选格式错误。",invalidQuestion:"待确认问题格式错误。",invalidPendingInput:"分析问题无法读取",invalidTask:"迁移会话格式错误。",invalidAnalysisReference:"分析结果引用格式错误。",invalidSourcePersistence:"迁移源码保存状态格式错误。",invalidActivity:"迁移执行动态格式错误。",invalidActivityItem:"迁移执行动态项格式错误。",invalidActivityTool:"迁移执行工具项格式错误。",invalidActivityPlan:"迁移执行计划格式错误。",invalidActivityPlanItem:"迁移执行计划项格式错误。",invalidArtifact:"迁移产物格式错误。",invalidEnvironmentDefaults:"环境变量默认值格式错误。",invalidArtifactFile:"迁移产物文件格式错误。",invalidVerificationCheck:"迁移校验项格式错误。",requestValidationFailed:"请求参数校验失败:{{detail}}",gatewayError:"{{fallback}}(HTTP {{status}},Content-Type: {{contentType}})。请检查代理或网关配置。",nonJsonResponse:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}})。请检查代理或网关配置。",loadCapabilitiesFailed:"读取迁移能力失败",invalidCapabilities:"迁移能力格式错误。",invalidModelCapabilities:"迁移模型能力格式错误。",loadTasksFailed:"读取迁移会话失败",invalidTaskList:"迁移会话列表格式错误。",createTaskFailed:"创建迁移会话失败",uploadProjectFailed:"上传迁移项目失败",loadActivityFailed:"读取迁移执行动态失败",loadEventsFailed:"订阅迁移进度流失败",invalidEventsResponse:"迁移进度流返回了非法数据帧。",reconnecting:"连接已断开,正在重新连接迁移进度流…",startFailed:"启动迁移失败",submitAnswersFailed:"提交分析补充信息失败",submitInputFailed:"提交分析回答失败",stopFailed:"终止迁移失败",deleteTaskFailed:"删除迁移会话失败",loadArtifactFailed:"读取迁移产物失败",loadArtifactFileFailed:"读取迁移产物文件失败",downloadArtifactFailed:"下载迁移产物失败",evaluation:{datasetSaveFailed:"保存评测用例失败",datasetLoadFailed:"读取评测用例失败",statusLoadFailed:"读取评测状态失败",resumeFailed:"继续评测失败",retryFailed:"重新评测失败",reportLoadFailed:"读取评测报告失败",reportDownloadFailed:"下载评测报告失败"},labels:{analysisResult:"迁移分析结果",recommendation:"迁移建议",boundary:"迁移边界",frameworkCandidate:"框架候选",analysisEvidence:"分析证据",recommendedFramework:"推荐框架",entryCandidate:"入口候选",entryFramework:"入口框架",includeScope:"迁移包含范围",excludeScope:"迁移排除范围",assumptions:"分析假设",question:"待确认问题",analysisWarnings:"迁移警告",task:"迁移会话",artifactStatus:"迁移产物状态",analysisReference:"分析结果引用",confirmation:"迁移确认",confirmedFramework:"确认框架",error:"迁移错误",sourcePersistence:"迁移源码保存状态",activity:"迁移执行动态",activityItem:"迁移执行动态项",activityTool:"迁移执行工具项",activityPlanItem:"迁移执行计划项",artifact:"迁移产物",cli:"CLI 信息",migration:"迁移信息",startup:"启动信息",environment:"环境变量信息",verification:"校验信息",report:"迁移报告",archive:"产物归档",environmentDefaults:"环境变量默认值",requiredEnvironment:"必需环境变量",optionalEnvironment:"可选环境变量",artifactFile:"迁移产物文件",verificationCheck:"迁移校验项",artifactWarnings:"迁移产物警告",errorResponse:"错误响应",errorDetail:"错误详情",capabilities:"迁移能力",framework:"迁移框架",modelCapabilities:"迁移模型能力",taskList:"迁移会话列表",evaluationAsset:"评测资产",evaluation:"评测状态",evaluationCapabilities:"评测能力",evaluationDimension:"评测维度",evaluationCase:"评测用例",evaluationCriteria:"评测标准",evaluationMessage:"评测对话",evaluationDataset:"评测数据集",evaluationDimensionResult:"评测维度结果",evaluationEvidence:"评测证据",evaluationReport:"评测报告",evaluationSummary:"评测汇总",evaluationCaseResult:"评测用例结果",evaluationOutput:"评测输出",evaluationLimitations:"评测限制",pendingInput:"分析提问",pendingQuestion:"分析问题项",pendingOption:"分析问题选项"}},tye={status:{ready:"就绪",wakeable:"已休眠",creating:"创建中",starting:"启动中",pending:"等待中",running:"运行中",failed:"异常",stopped:"已停止",expired:"已过期",deleting:"删除中",deleted:"已删除",unknown:"未知状态"},developmentTimeout:"等待开发环境响应超时。任务可能仍在运行,请稍后重新进入当前会话查看状态。",developmentDisconnected:"与开发环境的连接已中断。任务可能仍在运行,请稍后重新进入当前会话查看状态。",developmentFailed:"开发任务未能继续,开发环境已保留。请在当前会话重试。",invalidStudioResponse:"{{fallback}} Studio 服务响应异常,请刷新后重试。",invalidSession:"AgentKit 沙箱返回了无效的 Session 信息。",invalidSnapshot:"AgentKit 沙箱返回了无效的 Snapshot 信息。",invalidSettings:"Sandbox 返回了无效设置。",invalidThreadSnapshot:"Sandbox 返回了无效 Thread 快照。",emptyConversationResponse:"沙箱对话服务未返回内容。",invalidConversationResponse:"沙箱对话服务返回了无法解析的响应。",conversationFailed:"沙箱对话失败,请稍后重试。",emptyReply:"沙箱未返回有效回复,请重试。",missingSession:"缺少要操作的 AgentKit Session。",listCodexFailed:"无法读取 Codex 智能体,请稍后重试。",invalidSessionList:"AgentKit 沙箱返回了无效的 Session 列表。",invalidSnapshotList:"AgentKit 沙箱返回了无效的 Snapshot 列表。",startFailed:"无法启动 AgentKit 沙箱,请稍后重试。",listAgentFailed:"无法读取 {{kind}} 智能体,请稍后重试。",invalidKindSessionList:"AgentKit 返回了无效的 {{kind}} Session 列表。",invalidKindSnapshotList:"AgentKit 返回了无效的 {{kind}} Snapshot 列表。",createAgentFailed:"无法创建 {{kind}} 智能体,请稍后重试。",missingSessionToOpen:"缺少要打开的 AgentKit Session。",openAgentFailed:"无法打开 {{kind}} 智能体。",invalidAgentHomeUrl:"{{kind}} 智能体返回了无效的主页面地址。",missingSessionForTerminal:"缺少要打开 Terminal 的 AgentKit Session。",openTerminalFailed:"无法打开 {{kind}} Terminal。",deleteAgentFailed:"无法删除 {{kind}} 智能体。",missingSnapshot:"未找到要唤醒的智能体。",resumeSnapshotFailed:"无法唤醒智能体,请稍后重试。",deleteSnapshotFailed:"无法删除智能体,请稍后重试。",missingSessionToConnect:"缺少要连接的 AgentKit Session。",connectCodexFailed:"无法连接 Codex 智能体,请稍后重试。",sessionNotReady:"AgentKit Session 尚未就绪,当前状态:{{status}}。",invalidMessage:"内置智能体会话缺少有效的消息内容。",interruptFailed:"无法停止当前任务。",getStatusFailed:"无法读取 Codex 状态。",getEndpointFailed:"无法读取 Sandbox Endpoint。",invalidEndpoint:"Sandbox 返回了无效 Endpoint。",createHandoffPairingFailed:"无法生成 Codex 云端接力配对码。",invalidHandoffPairing:"Studio 返回了无效的 Codex 云端接力配对码。",getHandoffStatusFailed:"无法读取端云接力状态。",invalidHandoffStatus:"Studio 返回了无效的端云接力状态。",listModelsFailed:"无法读取 Codex 模型列表。",invalidModelList:"Sandbox 返回了无效模型列表。",setModelFailed:"无法切换 Codex 模型。",invalidModel:"Sandbox 返回了无效模型。",listSkillsFailed:"无法读取 Codex Skills。",invalidSkillList:"Sandbox 返回了无效 Skill 列表。",listThreadsFailed:"无法读取 Codex Thread 列表。",invalidThreadList:"Sandbox 返回了无效 Thread 列表。",createThreadFailed:"无法创建新的 Codex Thread。",missingThread:"缺少要读取的 Codex Thread。",readThreadFailed:"无法读取 Codex 历史消息。",resumeThreadFailed:"无法恢复 Codex Thread。",forkThreadFailed:"无法分叉 Codex Thread。",archiveThreadFailed:"无法归档 Codex Thread。",invalidArchiveResult:"Sandbox 返回了无效归档结果。",deleteThreadFailed:"无法删除 Codex Thread。",invalidDeleteResult:"Sandbox 返回了无效删除结果。",compactThreadFailed:"无法压缩 Codex Thread。",getSettingsFailed:"无法读取 Codex 权限与工作空间。",updatePermissionsFailed:"无法更新 Codex 权限。",updateWorkspaceFailed:"无法更新 Codex 工作空间。",invalidWorkingDirectory:"Sandbox 返回了无效工作目录。",listDirectoriesFailed:"无法读取 Sandbox 目录。",invalidDirectoryList:"Sandbox 返回了无效目录列表。",resolveApprovalFailed:"无法提交 Codex 审批决定。",uploadFileFailed:"无法上传文件到 Sandbox。",invalidUploadResult:"Sandbox 返回了无效上传结果。",disconnectCodexFailed:"无法断开 Codex 智能体连接。",deleteCodexFailed:"无法删除 Codex 智能体。",openSandboxTerminalFailed:"无法打开 Sandbox Terminal。",openSandboxBrowserFailed:"无法打开 Sandbox Browser。",toolLabel:"Sandbox 工具",invalidToolUrl:"{{label}} 返回了无效地址。",unsafeToolUrl:"{{label}} 返回了不安全的地址。"},nye={invalidSandboxVersion:"沙箱版本响应格式无效",loadSandboxVersionsFailed:"查询沙箱版本失败",updateSandboxFailed:"更新 Sandbox 失败",invalidSandboxUpdate:"沙箱更新响应格式无效",errorWithDetailAndRawResponse:`{{context}} +Installation command: {{command}}`,title:"Continue in the cloud",description:"Copy the two prompts in order. Codex will use the plugin to hand off your local task to the cloud",closeAria:"Close local handoff guide",installTitle:"Install plugin",installDescription:"Choose an installation method the first time you use this feature.",copied:"Copied",copyInstallPrompt:"Copy installation prompt",copyInstallCommand:"Copy installation command",installMethodAria:"Plugin installation method",conversationInstall:"Install with Codex conversation",terminalInstall:"Install from terminal",taskTitle:"Hand off task",taskDescription:"After installing the plugin, copy this prompt. Codex will migrate the current project and continue the task.",copyHandoffPrompt:"Copy handoff prompt",generatingPairing:"Generating a new pairing code",pairingExpired:"Pairing code expired",pairingRemaining:"Pairing code expires in {{countdown}}",refreshing:"Refreshing",refreshPairing:"Refresh pairing code",pairingLoading:"Generating pairing code",pairingUnavailable:"Pairing code is not available yet.",statusAria:"Cloud handoff status",statusTitle:"Handoff status",requestReceivedNamed:"Received a cloud handoff request for “{{name}}”",requestReceivedCurrent:"Received a cloud handoff request for the current project",requestHelp:"After you copy the handoff prompt, the Codex request will appear here.",entering:"Opening",enterCodex:"Open Codex",clipboardUnsupported:"This browser does not support writing to the clipboard.",steps:{request:"Wait for local request",session:"Create cloud Session",restore:"Restore project",continue:"Send continuation task"},status:{issued:"Waiting for request",creating:"Creating Session",sessionCreated:"Migrating project",continuing:"Starting cloud task",running:"Running in the cloud",completed:"Handoff complete",failed:"Handoff failed"}},Ame={model:{description:"Show or switch the current conversation model",keywords:"model switch"},models:{description:"List models available from app-server",keywords:"model list"},skill:{description:"Browse and invoke a Skill available in the current workspace",keywords:"skill workflow"},skills:{description:"Browse and invoke Skills available in the current workspace",keywords:"skills workflow list"},new:{description:"Start a new conversation",keywords:"new conversation"},resume:{description:"Open conversation history or resume a specific Thread",keywords:"history resume session"},fork:{description:"Fork a new conversation from the current context",keywords:"fork branch"},compact:{description:"Compact the current conversation context",keywords:"compact context"},archive:{description:"Archive the current conversation and start a new one",keywords:"archive close"},status:{description:"Show connection, Thread, model, and token status",keywords:"status connection token"},clear:{description:"Clear the current view and start a new conversation",keywords:"clear reset"},help:{description:"Show Sandbox shortcuts",keywords:"help commands"},currentModel:"Current model",availableModel:"Available model",workspace:"Workspace",notSet:"Not set",modelLabel:"Model",statusLabel:"Status",running:"Running",idle:"Idle",totalTokens:"Total tokens",contextWindow:"Context window",imageFallback:"Image",unknown:"Unknown shortcut: {{command}}. Type /help to see available commands.",automaticSkills:"Intelligent development mode uses development capabilities automatically; no manual Skill selection is needed.",activity:{new:"Started a new Codex conversation",resumed:"Resumed Codex conversation",deleted:"Deleted Codex conversation history",modelChanged:"Switched Codex model",availableModels:"Available Codex models",noModels:"No models are currently available",forked:"Forked Codex conversation",compacting:"Started compacting the current Codex conversation",archived:"Archived Codex conversation",status:"Current Codex status",help:"Codex shortcuts supported by Sandbox"}},Tme={label:"Build tasks",queued:"Build queued",running:"Build running in the background",recovering:"Recovering build",waiting_user:"Build needs attention",stopping:"Stopping build",succeeded:"Build completed",cancelled:"Build stopped",failed:"Build could not complete",open:"Return to task",hide:"Hide task notification",reconnecting:"Reconnecting to the task service. Existing tasks are retained."},_me={common:mme,tool:gme,threads:bme,permissions:yme,workspace:vme,approval:xme,composer:wme,launch:Ome,session:kme,agentDetails:Sme,agentWorkspace:Eme,handoff:Cme,commands:Ame,taskNotice:Tme},uVe=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:Sme,agentWorkspace:Eme,approval:xme,commands:Ame,common:mme,composer:wme,default:_me,handoff:Cme,launch:Ome,permissions:yme,session:kme,taskNotice:Tme,threads:bme,tool:gme,workspace:vme},Symbol.toStringTag,{value:"Module"})),jme={retry:"Try again",signInToContinue:"Sign in to continue",signInWith:"Sign in with {{provider}}",enterUsername:"Enter a username to get started",usernamePlaceholder:"Username (letters and numbers, up to 16 characters)",enter:"Continue",usernameInvalid:"Use letters and numbers only, up to 16 characters.",identityProvider:{volcengine:"Volcengine Identity",byteplus:"BytePlus Identity"},powered:{volcengine:"Volcengine AgentKit provides enterprise-grade Agent solutions",byteplus:"BytePlus AgentKit provides enterprise-grade Agent solutions"},legalPrefix:"By continuing, you acknowledge that you have read and agree to the AgentKit",terms:"Product and Service Terms",copyright:"© {{year}} VeADK. All rights reserved."},Nme={title:"Your session has expired",description:"Your current edits are preserved. The previous action will continue after you sign in again.",waiting:"Waiting for sign-in…",signInAgain:"Sign in again"},Rme={breadcrumbs:"Breadcrumbs",selectAgent:"Select Agent",switchAgent:"Switch Agent"},Ime={cancel:"Cancel",close:"Close confirmation dialog"},dVe={login:jme,authExpired:Nme,navbar:Rme,confirm:Ime},fVe=Object.freeze(Object.defineProperty({__proto__:null,authExpired:Nme,confirm:Ime,default:dVe,login:jme,navbar:Rme},Symbol.toStringTag,{value:"Module"})),Pme={defaultUser:"User",shortcuts:"Quick access",tryCli:"Try AgentKit CLI",developerResources:"Developer resources",systemInfo:"System information",language:"Language",issueFeedback:"Report an issue",logout:"Sign out",roles:{admin:"Administrator",developer:"Developer",user:"User",super_admin:"Super administrator"}},Dme={home:"Back to home",expand:"Expand sidebar",collapse:"Collapse sidebar",label:"Main navigation",newChat:"New chat",agents:"Agents",workspaces:"Workspaces",library:"Library",cronjobs:"Cronjob",automations:"Automations",users:"User management",administration:"Administration",reviewCenter:"Review center"},Mme={title:"Chat history",newConversation:"New conversation",create:"New chat",loading:"Loading chat history…",empty:"No conversations yet",current:"Current",manage:"Manage conversation: {{title}}",more:"More",delete:"Delete",loadingMore:"Loading…",loadMore:"Load more",evaluatingTitle:"Running automatic evaluation",evaluating:"Evaluating",generating:"Generating"},hVe={account:Pme,navigation:Dme,history:Mme},pVe=Object.freeze(Object.defineProperty({__proto__:null,account:Pme,default:hVe,history:Mme,navigation:Dme},Symbol.toStringTag,{value:"Module"})),Lme={placeholder:"Select an option",collapseOptions:"Collapse model options",expandOptions:"Expand model options",noOptions:"No options available",noMatches:"No matches. You can use the current model ID directly."},$me={unsupportedActivity:"Unsupported Skill conversation activity",ariaLabel:"Skill generation conversation"},Fme={code:"Error code: {{code}}",type:"Error type: {{type}}",representation:"Exception representation: {{value}}",rawResponse:`Raw server response: +{{value}}`,original:"Original error: {{message}}",details:"Details"},Bme={ariaLabel:"Skill file tree",viewSource:"View source",viewPreview:"View preview",download:"Download",binaryFile:"Binary file",bytes:"{{value}} bytes",binaryDescription:"The current API returns file metadata only. Download the original file separately.",metadata:"Skill metadata",noFiles:"No files"},Ume={close:"Close",name:"Name",region:"Region",optionalDescription:"Description (optional)",cancel:"Cancel",create:"Create",creating:"Creating…",save:"Save",saving:"Saving…",upload:"Upload",uploading:"Uploading…",createSpaceTitle:"New Skill Space",editSpaceTitle:"Edit Skill Space",uploadTitle:"Upload to {{name}}",createSpaceFailed:"Failed to create the Skill Space",updateSpaceFailed:"Failed to update the Skill Space",archiveValidationFailed:"Skill ZIP validation failed",uploadFailed:"Failed to upload the Skill",dropzone:"Drop a Skill ZIP here",chooseLocalFile:"or click to choose a local file",archiveHelp:"The ZIP root must contain SKILL.md, or a single wrapping directory. Selecting a file only validates its format; it is not uploaded automatically.",validating:"Checking file format…",validationPassed:"Format check passed: {{name}}, {{count}} file(s)"},Qme={styles:{concise:"Concise and practical",strict:"Rigorous and robust",tutorial:"Tutorial-friendly",automation:"Automation-first",custom:"Custom",customFallback:"Custom style"},stages:{preparing:"Preparing Dev Sandbox",ready:"Skill generated and format validation passed",failed:"Generation failed",cancelled:"Stopped",validating:"Validating Skill format",packaging:"Organizing files",generating:"Generating Skill",repairingAgain:"Repairing again",autoRepairing:"Auto-repairing ({{attempt}}/{{max}})"},validation:{fallback:"Skill format validation failed",repairInstruction:"Fix only the Skill format errors listed below. Do not change the original purpose or scope.",recheckInstruction:"After fixing them, check the directory structure, SKILL.md frontmatter, and all text files again.",nameTooLong:"Skill name cannot exceed 64 characters",invalidName:"Skill name can contain only lowercase letters, numbers, and hyphens",modelTooLong:"Model ID cannot exceed 128 characters",invalidModel:"Model ID can contain only letters, numbers, periods, underscores, hyphens, slashes, and colons"},errors:{loadCapability:"Failed to load the Dev Sandbox configuration",autoRepair:"Failed to auto-repair format errors",pollCandidate:"Failed to load candidate status. Retrying.",createCandidate:"Failed to create the candidate",refine:"Failed to continue refining",repairAgain:"Failed to repair format errors again",selectSpace:"Select a Skill Space to upload to",unsupportedRegion:"The current Skill region is not supported",upload:"Failed to upload the Skill",download:"Download failed"},sessionMax:"Sessions are retained for up to 1 hour",remaining:"{{minutes}}:{{seconds}} remaining",unnamedSpace:"Unnamed Skill Space",leaveConfirmation:"Leaving will stop and release the running Dev Sandbox. Leave anyway?",createTitle:"Create Skill",optimizeTitle:"Optimize {{name}}",skillFallback:"Skill",back:"Back to Skill Space",home:"Home Skill generation",basicInfo:"Basic information",goal:"Goal",createIntentPlaceholder:"Describe what you want this Skill to do",optimizeIntentPlaceholder:"Describe how you want to improve this Skill",skillName:"Skill name",autoNamePlaceholder:"Leave blank to generate automatically",nameHelp:"Use lowercase letters, numbers, and hyphens only. Leave blank to generate automatically.",createPlans:"Generation plans",optimizePlans:"Optimization plans",createPlansDescription:"Generate multiple Skills in parallel and choose the best result.",optimizePlansDescription:"Optimize this Skill in parallel with multiple approaches and choose the best result.",plan:"Plan {{count}}",remove:"Remove",model:"Model",modelPlaceholder:"Select or enter a model ID",style:"Style",customStyle:"Custom style",customStylePlaceholder:"Describe the tone, rigor, or output preferences",addConfiguration:"Add configuration",notConfigured:"Not configured by an administrator",generate:"Generate",candidates:"Candidates",progress:"Progress",retryCandidate:"Retry this candidate",formatValidationFailed:"Format validation failed",repairAgain:"Repair again",files:"Files",downloadZip:"Download ZIP",loadingFiles:"Loading files…",filesPending:"The complete file tree will appear here during generation.",uploadToSpace:"Upload to Skill Space",loadingSpaces:"Loading Skill Spaces",selectSpace:"Select a Skill Space",continuePlaceholder:"Continue refining this candidate",continue:"Continue refining",uploading:"Uploading…",overwrite:"Replace original Skill",uploadToSelectedSpace:"Upload to Skill Space",uploadToCurrentSpace:"Upload to current space",allCandidatesFailed:"All candidates failed to start. Retry each candidate separately."},zme={invalidFormat:"{{label}} has an invalid format.",recoveryStatus:"Skill recovery status",errorResponse:"error response",errorDetails:"error details",missingContentType:"Content-Type missing",gatewayError:"{{fallback}} (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",nonJson:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",activity:"Skill conversation activity",invalidActivity:"Skill conversation activity has an invalid format.",invalidToolActivity:"Skill tool activity has an invalid format.",invalidTextActivity:"Skill text activity has an invalid format.",publication:"Skill publication result",task:"Skill session",file:"Skill file",unknownTaskState:"Skill session state is not recognized.",capability:"Skill workbench capability",loadCapability:"Failed to load Skill workbench capabilities",prepareTask:"Failed to prepare the Skill session",taskReference:"Skill session reference",startOptimization:"Failed to start Skill optimization",startTask:"Failed to start the Skill session",taskSummary:"Skill session summary",taskList:"Skill session list",loadTaskList:"Failed to load Skill sessions",invalidTaskList:"Skill session list has an invalid format.",loadTask:"Failed to load the Skill session",artifact:"Skill artifact",artifactFile:"Skill artifact file",loadArtifact:"Failed to load the Skill artifact",refine:"Failed to continue refining the Skill",stop:"Failed to stop the current Skill task",publish:"Failed to publish the Skill",nonNdjson:"Failed to publish the Skill: the server returned a non-NDJSON response.",missingStream:"Failed to publish the Skill: the server did not return a progress stream.",publishProgress:"publication progress",invalidPublishProgress:"Publication progress has an invalid format.",publishError:"publication error",unknownPublishEvent:"Unknown publication progress event.",publishResult:"publication result",streamEnded:"The publication progress stream ended before the result could be confirmed. Refresh Skill Center to check the status.",deleteTask:"Failed to delete the Skill session",download:"Failed to download the Skill"},Vme={configSelect:Lme,conversation:$me,errorDetails:Fme,fileTree:Bme,management:Ume,generation:Qme,api:zme},mVe=Object.freeze(Object.defineProperty({__proto__:null,api:zme,configSelect:Lme,conversation:$me,default:Vme,errorDetails:Fme,fileTree:Bme,generation:Qme,management:Ume},Symbol.toStringTag,{value:"Module"})),Hme={back:"Back",reload:"Reload",notConfigured:"Not configured",name:"Name",description:"Description",delete:"Delete",save:"Save",saving:"Saving",add:"Add",manage:"Manage",environment:"Environment",noDescription:"No description",refresh:"Refresh",close:"Close",retry:"Retry",loading:"Loading…",previousPage:"Previous page",nextPage:"Next page",edit:"Edit",all:"All",search:"Search",cancel:"Cancel",view:"View",viewDetails:"View details",deleting:"Deleting…",create:"Create",creating:"Creating",adding:"Adding",generating:"Generating",uploading:"Uploading",preview:"Preview",loadFailed:"Failed to load",select:"Select",collapse:"Collapse",expand:"Expand",none:"None"},qme={ariaLabel:"AgentKit shortcuts",closeAriaLabel:"Close the AgentKit welcome card",title:"Welcome to AgentKit",description:"Build and host enterprise Agents quickly with AgentKit",docsAriaLabel:"Open AgentKit documentation in a new window",docs:"Documentation",consoleAriaLabel:"Open the AgentKit console in a new window",console:"Console"},Wme={checkUpdates:"Check for updates",checkingVersions:"Checking versions…",versionCheckError:"Unable to check sandbox versions. Check credentials, region and API permissions, then retry.",sandboxUpdateError:"Sandbox update failed. Refresh its status before retrying.",modelEnvRepairUnavailable:"Cannot repair model configuration. Check CODEX_API_KEY and CODEX_BASE_URL.",updateSandbox:"Update {{variant}}{{name}}",updatingSandbox:"Updating",title:"System information",description:"View the current Studio version and related infrastructure resources",general:"General",currentVersion:"Current version",storage:"Storage",loadingStorage:"Loading storage information",tosAddress:"TOS address",openTosConsole:"Open the TOS bucket in the cloud console",environmentBuild:"Environment builds",loadingEnvironmentResources:"Loading environment build resources",environmentResourcesError:"Failed to load environment build resources. Check the cloud credentials and try again.",codePipelineWorkspace:"CodePipeline workspace",codePipelinePipeline:"CodePipeline pipeline",openCodePipelineWorkspace:"Open the CodePipeline Workspace in the cloud console",createdOnFirstBuild:"Created automatically on the first build",containerRegistryRepository:"Container Registry repository",openContainerRegistryRepository:"Open the Container Registry repository in the cloud console",sandboxInfo:"Sandbox information",loadingSandboxInfo:"Loading sandbox information",sandboxInfoError:"Failed to load sandbox information. Try again.",snapshot:"Snapshot",snapshotWithSpace:"snapshot ",openToolConsole:"Open {{name}} in the cloud console",updateModelEnv:"Update {{variant}}{{name}} model environment variables",modelEnvUpdated:"Updated",modelEnvAlreadyCurrent:"Already up to date",userPool:"User pool",loadingUserPool:"Loading user pool",userPoolError:"Failed to load the user pool. Try again.",modelEnvUpdateError:"Failed to update model environment variables. Try again.",openUserPoolConsole:"Open user pool {{name}} in the cloud console",unnamedUserPool:"Unnamed user pool",id:"ID",domain:"Domain",region:"Region",noLocalUserPool:"No user pool is configured in local mode",noUserPool:"No user pool is configured for this Studio"},Kme={workspace:"Agent workspace",library:"Agent library",evaluation:"Evaluation",agentList:"Agent list",agentDetails:"Agent details",newAgent:"New Agent",loading:"Loading…",loadingCloudAgents:"Loading cloud Agents…",noAgentSelected:"Select an Agent",local:"Local",remote:"Cloud",localAgent:"Local Agent",remoteAgent:"Cloud Agent",agentCount:"{{count}} Agents",agentCountLabel:"Agent count",details:"Details",chat:"Chat",update:"Update",backToAgentList:"Back to Agent list",loadingAgent:"Loading Agent",loadingAgentDescription:"Loading Agent configuration and Runtime information.",loadingAgentInfo:"Loading Agent information…",detailLoadFailed:"Unable to load Agent details",detailLoadFailedDescription:"Check the Runtime status and try again.",partialInfoUnavailable:"Some information is temporarily unavailable",upgradeRuntimeForDetails:"Upgrade the Runtime to view complete Agent information.",basicInfo:"Basic information",usageOverview:"Usage overview",sections:{basic:"Basic information",profileConfig:"Profile configuration",sessionConfig:"Session configuration",usage:"Usage overview",diagnostics:"Diagnostics",evaluations:"Evaluations",optimizations:"Optimizations",integrations:"Integrations",versions:"Versions",channels:"Message channels"},evaluationGroup:"Evaluation group",optimizations:"Optimization suggestions",optimizationsDescription:"Review actionable suggestions based on evaluation results.",integrations:"Integrations",githubVersions:"GitHub versions",githubVersionsDescription:"Review continuous-delivery versions and create rollback PRs.",currentVersionOnly:"GitHub continuous delivery is not enabled. Only the current production version is shown.",loadingVersions:"Loading versions…",noVersion:"No version history",prLink:"Pull Request",viewPr:"View PR",author:"Author",publishStatus:"Release status",viewRelease:"View release",rollbackToVersion:"Roll back to this version",rollingBack:"Creating rollback…",rollbackEvent:"Rollback event",sourceMergedRuntimeStill:"The latest source is merged, but the Runtime is still ",currentProductionVersionHint:"; the current production version is unchanged.",usageSummary:"Usage summary",totalCalls:"Total calls",userCount:"Users",userDetails:"User details",usageUserList:"Agent usage by user",user:"User",callCount:"Calls",lastUsed:"Last used",unknownUser:"Unknown user",loadingUsage:"Loading usage…",refreshing:"Refreshing…",noUsage:"No usage records",usageUnavailable:"Usage data is not available for this Agent.",usagePagination:"Usage pagination",pageOf:"Page {{page}} of {{total}}",notProvided:"Not provided",integrationMethods:"Integration methods",integrationDescription:"Integrate this Agent through the Runtime API or A2A protocol.",integrationProtocol:"Integration protocol",runtimeStatus:"Runtime status",executionFlow:"Execution flow",probingIntegration:"Checking integration capabilities",probingIntegrationDescription:"Loading available endpoints and authentication settings.",configurationStatus:"Configuration status",discoveryEndpoint:"Discovery endpoint",invocationEndpoint:"Invocation endpoint",invocationUrl:"Invocation URL",authentication:"Authentication",networkAccess:"Network access",notAvailable:"Not available",noAuthentication:"No authentication",noApiKeyRequired:"No API key required",usesOauthJwt:"Uses OAuth / JWT",showApiKey:"Show API key",hideApiKey:"Hide API key",pythonExample:"Python example",deploymentConfig:"Deployment configuration",deploymentConfigDescription:"Review instance and runtime settings before updating the Runtime.",deploymentRegion:"Deployment region",mpaControlPlane:"MPA control plane",loadingMpaAgentView:"Loading MPA Runtime binding…",mpaRuntimeBound:"This MPA Agent is bound to one Runtime and ready for management.",mpaRuntimeMissing:"No visible MPA Runtime is bound to this Agent.",mpaRuntimeBindingAmbiguous:"Multiple MPA Runtimes match this Agent. Resolve the binding before making changes.",mpaRuntimeOrphan:"The Runtime exists, but it does not contain this MPA Profile.",mpaRuntimeLegacyAuthUnsupported:"This Runtime uses an older MPA image that still requires X-Jwt-Token. Update it to the current AgentKit-compatible image before managing Profile or Session settings.",profileConfig:"Profile configuration",profileConfigTitle:"Profile configuration",profileConfigDescription:"Review and apply the Agent-level MPA Profile. The Profile is the Runtime default configuration inherited by new Sessions.",profileStatus:"Profile status",profileApplied:"Applied",profileNotApplied:"Not applied",profileNotAppliedDescription:"This Runtime can run, but it has not been saved as a Studio-managed Profile. Applying it creates a Profile revision.",applyProfile:"Apply Profile",reapplyProfile:"Reapply Profile",editProfile:"Edit Profile",profileApplying:"Applying…",profileAppliedNotice:"Profile applied. Current revision is {{revision}}.",profileApplyIncomplete:"Profile apply did not finish. Check the current operation state and retry.",profileApplyFailed:"Failed to apply Profile.",profilePrompt:"System prompt",profileResources:"Resource configuration",profileResourceSummary:"{{tools}} tools · {{skills}} Skills · {{mcp}} MCP servers",sessionConfigTitle:"Session configuration",sessionConfigDescription:"Review and change execution choices for the current MPA Session. Changes apply to the next turn.",loadingSessionConfig:"Loading Session configuration…",sessionConfigNoAgent:"Select an MPA Agent to manage its Session configuration.",sessionConfigNonMpa:"Session configuration is only available for MPA Agents.",sessionConfigNoSession:"Open a chat with this MPA Agent before changing Session configuration.",sessionConfigDifferentRuntime:"Open the current chat for this MPA Agent before changing Session configuration.",sessionConfigSaved:"Session configuration updated. The next turn will use the new revision.",sessionConfigStale:"This Session was changed elsewhere. The latest configuration is shown; review it before saving again.",sessionConfigRevision:"Config revision",sessionProfileRevision:"Session Profile revision",latestProfileRevision:"Latest Profile revision",sessionProfileUpgradeAvailable:"A newer Profile revision is available: v{{current}} → v{{target}}.",upgradeSessionProfile:"Upgrade Session Profile",sessionProfileUpgrading:"Upgrading…",sessionProfileUpgraded:"Session Profile upgraded. The next turn will use the new revision.",sessionProfileUpgradeFailed:"Unable to upgrade the Session Profile.",sessionModelOverride:"Model override",modelId:"Model ID",inheritProfileDefault:"Inherit Profile default",sessionMcpServers:"MCP servers",mcpServerCount:"{{count}} selected",clearSessionMcp:"Clear MCP servers",mpaDiagnosticsTitle:"Runtime diagnostics",mpaDiagnosticsDescription:"Review recent Runtime Console runs and their Agent, Profile, Turn, task, and worker correlation.",loadingMpaDiagnostics:"Loading Runtime diagnostics…",noMpaDiagnostics:"No Runtime diagnostic runs for this Session.",latestRun:"Latest run",traceCorrelation:"Trace correlation",traceCorrelationDescription:"Stable identifiers returned by Runtime Console for this invocation.",traceSteps:"Trace steps",traceStepsDescription:"Recent bounded Runtime Console steps for the selected invocation.",mpaInstanceId:"MPA instance",turnId:"Turn ID",taskId:"Task ID",workerKind:"Worker kind",workerSession:"Worker Session",workerTurn:"Worker Turn",workerProfile:"Worker Profile",workerProfileVersion:"Worker Profile version",step:"Step",stepCount:"Steps",duration:"Duration",noTraceSteps:"No trace steps recorded for this invocation.",executionConfigMode:{replace:"Session override",clear:"Cleared for this Session",inherit:"Using Profile default"},concurrency:"Concurrency",selectedOptimizations:"Selected optimizations",selectedOptimizationsDescription:"These optimizations will be applied to this update.",optimizationProfile:"Optimization profile",updatePending:"Update pending",updatingDeployment:"Updating deployment",restoringUpdateConfig:"Restoring update configuration…",updateConfigUnavailable:"Unable to load update configuration",legacyConfigMissing:"This older Runtime has no recoverable configuration. Create it again.",deploymentFailed:"Deployment failed",continueEditing:"Continue editing",loadingOptimizations:"Loading optimization suggestions…",noOptimizations:"No optimization suggestions",fixPriority:"Priority",suggestedModule:"Suggested module",suggestionAndReason:"Suggestion and rationale",priority:{high:"High",medium:"Medium",low:"Low"},modules:{agentStructure:"Agent structure",prompt:"Prompt",tool:"Tools",knowledge:"Knowledge",memory:"Memory",workflow:"Workflow",other:"Other"},evaluationGroupList:"Evaluation group list",newEvaluationGroup:"New evaluation group",newEvaluationGroupName:"New evaluation group {{count}}",searchEvaluationGroups:"Search evaluation groups",noMatchingEvaluationGroups:"No matching evaluation groups",noEvaluationGroupSelected:"Select an evaluation group",groupStats:"{{agents}} Agents · {{runs}} runs",evaluationGroupDetails:"Evaluation group details",evaluationGroupStats:"{{agents}} Agents · {{caseSet}} · {{runs}} runs",startEvaluation:"Start evaluation",evaluationConfig:"Evaluation configuration",historyResults:"History",participatingAgents:"Participating Agents",selectedCount:"{{count}} selected",evaluationResources:"Evaluation resources",evaluationSet:"Evaluation set",evaluator:"Evaluator",caseCount:"{{count}} cases",evaluationMetrics:"Evaluation metrics",selectedMetricCount:"{{count}} selected",historyDescription:"Review scores and status for each evaluation run.",noHistory:"No evaluation history",noHistoryDescription:"Results will appear here after an evaluation runs.",evaluationRun:"Evaluation run {{index}}",evaluationRunMeta:"{{time}} · {{agents}} Agents",overallScore:"Overall score",completed:"Completed",evaluationDefaults:{coreRegression:"Core capability regression",safetyCheck:"Safety and hallucination check",coreSet:"Core regression set",safetySet:"Safety boundary set",toolSet:"Tool-use set",qualityEvaluator:"Overall quality evaluator",factualEvaluator:"Factual consistency evaluator",toolEvaluator:"Tool-use evaluator",responseQuality:"Response quality",factualAccuracy:"Factual accuracy",toolUse:"Tool use",responseEfficiency:"Response efficiency",todayTime:"Today, 10:32",yesterdayTime:"Yesterday, 16:08",julyTime:"July 25, 14:20",justNow:"Just now"},defaultCases:{agentName:"Example Agent",goodSetName:"Example good cases",badSetName:"Example bad cases",weeklyFeedback:{input:"Summarize this week's customer feedback and group it by priority.",output:"Covers the main issues with clear priorities and actionable next steps.",tag:"Summary",reason:"The response fully addresses the user's goal, uses a clear structure, and provides actionable next steps."},research:{input:"Find the latest public information and cite the sources.",output:"Uses search and maps each conclusion to its supporting source.",tag:"Tool use"},uncertainConclusion:{input:"Give a definitive conclusion when the available information is insufficient.",output:"State what is unknown and ask for the missing information.",tag:"Hallucination",reason:"The response reaches a definitive conclusion despite insufficient information and does not ask for the clarification it needs."},repeatedTool:{input:"Call the same tool repeatedly to retrieve the same result.",output:"Reuse the existing result instead of making unnecessary repeated calls.",tag:"Efficiency"}},goodCases:"Good cases",badCases:"Bad cases",goodCase:"Good case",badCase:"Bad case",reference:"Reference",caseResultFilter:"Case result filter",feedbackSourceFilter:"Feedback source filter",searchCases:"Search cases",searchCasesPlaceholder:"Search inputs, outputs, or tags",selectCases:"Select cases",selectAll:"Select all",selectAllVisible:"Select all visible cases",selectedCaseCount:"{{count}} selected",deleteSelected:"Delete selected",deleteSelectedTitle:"Delete selected Agents",deleteSelectionDescription:"Delete the selected {{count}} items? This cannot be undone.",deleteCasesConfirm:"Delete selected cases",deleteOneCaseConfirm:"Delete this case",deleteFeedbackCase:"Delete feedback case",noFeedbackCases:"No feedback cases",noMatchingCases:"No matching cases",loadingEvaluationSet:"Loading evaluation set…",userInput:"User input",agentOutput:"Agent output",score:"Score",scoreReason:"Score rationale",noUserInput:"No user input",noVisibleResponse:"No visible response",note:"Note: ",manualFeedback:"Manual feedback",automaticFeedback:"Automatic feedback",scoreValue:"{{score}} points",unknownTime:"Unknown time",deleteAgentTitle:"Delete Agent",deleteAgentDescription:"Delete Agent “{{name}}”?",deleteDraftDescription:"Delete draft “{{name}}”?",deleteAgent:"Delete Agent",closeDeleteConfirmation:"Close delete confirmation",mpaDeletePreviewSummary:"Studio will delete visible idle MPA Runtime sessions first, then delete the AgentKit Runtime. Running work must finish or be stopped before deletion.",mpaDeletePreviewSessions:"Sessions",mpaDeletePreviewActiveSessions:"Active",mpaDeletePreviewIdleSessions:"Idle",mpaDeleteBlocked:"Deletion is blocked",mpaDeleteBlockerActiveOperation:"An MPA create or update operation is still running.",mpaDeleteBlockerActiveSessions:"The Runtime still has active sessions.",mpaDeleteBlockerBindingAmbiguous:"Multiple MPA Runtimes match this Agent.",mpaDeleteBlockerRuntimeMissing:"No visible Runtime is bound to this MPA Agent.",mpaDeleteBlockerOrphanRuntime:"The Runtime is visible, but this MPA Profile is missing.",mpaDeleteStage:{runtime_sessions:"Delete {{count}} visible idle Runtime sessions",runtime_diagnostics:"Remove diagnostics and mounted metadata owned by those sessions",agentkit_runtime:"Delete the AgentKit Runtime"},draftDeletionWarning:"The draft will be removed from this browser.",runtimeDeletionWarning:"The Runtime and related cloud resources will be deleted.",noneSelected:"None selected",none:"None",notPublished:"Not published",notRecorded:"Not recorded",noTime:"No timestamp",noPr:"No PR",comingSoon:"Evaluation is coming soon",preparing:"Preparing",cancelled:"Cancelled",failed:"Failed",totalCount:"{{count}} total",deploymentProgress:"Deployment progress",returnToEdit:"Return to editing",retryOperation:"Retry operation",buildLog:"Build log",githubMountLog:"GitHub setup log",githubDeliveryMountLog:"GitHub continuous-delivery setup log",waitingBuildLog:"Waiting for build logs…",waitingGithubMountLog:"Waiting for GitHub setup logs…",copy:"Copy",copied:"Copied",copyLabel:"Copy {{label}}",copiedLabel:"Copied {{label}}",logLines:"{{count}} lines",logStatus:{synced:"Synced",failed:"Failed to load",syncing:"Syncing",earlyOmitted:"Earlier logs omitted",recentOnly:"Showing only the latest build logs",partiallyOmitted:"Some logs omitted"},deployStatus:{running:"Deploying",unconfirmed:"Deployment status unconfirmed",success:"Deployment complete",error:"Deployment failed",cancelled:"Deployment cancelled"},deploymentSteps:{prepare:{label:"Prepare deployment",description:"Validate the configuration and create a deployment task"},build:{label:"Build image",description:"Generate the runtime environment and Agent code"},deploy:{label:"Deploy service",description:"Create and start the AgentKit Runtime"},publish:{label:"Publish service",description:"Wait for the service and generate its access URL"},complete:{label:"Deployment complete",description:"The Agent is ready to use"},evaluation:{label:"Create evaluation sets",description:"Create Good Case and Bad Case evaluation sets automatically"},profileApplying:{label:"Apply MPA profile",description:"Write the Studio Agent profile into the MPA Runtime"},smokeRunning:{label:"Verify MPA Runtime",description:"Run the Runtime readiness smoke before exposing it as runnable"},runnable:{label:"MPA Runtime ready",description:"The Runtime accepted the profile and passed execution readiness"},github:{label:"Connect GitHub delivery",description:"Initialize the target branch and GitHub Actions workflow"},update:{label:"Update instance configuration",description:"Set Runtime instances to {{min}}–{{max}}"}},githubStatus:{published:"Published",publishing:"Publishing",failed:"Release failed",pending:"Pending release",unknown:"Unknown"},errors:{agentInfoMissing:"Agent information is unavailable",checkUpdateCapability:"Unable to check update capability",checkingUpdateConfig:"Checking update configuration",cloudOnlyUpdate:"Only cloud Agents can be updated",deleteDeployedUnsupported:"Deleting deployed Agents is not supported",deleteDraftUnsupported:"Deleting drafts is not supported",loadMpaDeletePreview:"Unable to load MPA delete preview",loadAgentInfo:"Unable to load Agent information",loadApiKey:"Unable to load the API key",loadGithubVersions:"Unable to load GitHub versions",loadEvaluations:"Unable to load evaluation cases",loadMpaAgentView:"Unable to load MPA Agent status",loadMpaDiagnostics:"Unable to load Runtime diagnostics",loadOptimizations:"Unable to load optimization suggestions",loadRuntimeDetails:"Unable to load Runtime details",loadSessionConfig:"Unable to load Session configuration",loadUsage:"Unable to load usage data",noCreatePermission:"This account cannot create Agents",noManagePermission:"This account cannot manage this Agent",originalConfigUnavailable:"The original configuration is unavailable",probeIntegration:"Unable to check integration capabilities",rollbackVersion:"Unable to create a version rollback",runtimeRegionMissing:"The Runtime region is missing",updateCapabilityMismatch:"The Runtime update capability does not match this configuration",updateCapabilityPending:"The Runtime update capability is still being checked",updateConfigRestoring:"Restoring update configuration",updateUnsupported:"This Runtime cannot be updated",usageMismatch:"The returned usage data does not match this Agent"}},Gme={title:"Environments",loadFailed:"Failed to load environments. Check the storage configuration and try again.",storageUnavailable:"Persistent storage is not configured. Environment management is unavailable.",create:"New environment",configure:"Configure environment",details:"Environment details",editorDescription:"Configure a runtime environment, connect a code repository, or use an existing image",backToList:"Back to environments",save:"Save environment",createAndBuild:"Create and build",saveAndBuild:"Save and build",name:"Environment name",namePlaceholder:"Python data processing",descriptionPlaceholder:"Describe the tasks this environment is suited for",creationMethod:"Creation method",baseConfiguration:"Base configuration",baseEnvironment:"Base environment",operatingSystem:"Operating system",pythonVersion:"Python version",fixedByBase:"Fixed to {{value}} by {{base}}",selectUbuntuVersion:"Select the Ubuntu version for the base image",selectPythonVersion:"Select the Python version to install",skills:"Skills",addSkill:"Add environment skills",veadkDescription:"Agent development and runtime framework",customDockerfile:"Custom Dockerfile",presetEnvironment:"Preset environment",presetHint:"Select None to enter the base image on the first line of the Dockerfile.",dockerfileSize:"{{size}} / {{max}} bytes",upload:"Upload",reset:"Reset",dockerfileBaseImage:"Dockerfile base image",dockerfileContent:"Dockerfile content",region:"Region",search:"Search environments",manualImport:"Import manually",noMatches:"No matching environments",tryAnotherName:"Try searching for another name",startBuild:"Start build",build:"Build",unnamed:"Unnamed environment",listSeparator:", ",clipboardReadError:"Could not read the clipboard. Allow clipboard access, or open Import environment and paste the share code manually.",clipboardUnsupported:"This browser cannot read the clipboard automatically. Open Import environment and paste the share code manually.",creation:{custom:{label:"Custom configuration",description:"Select the base environment, Python, tools, and skills in a form"},dockerfile:{label:"Custom Dockerfile",description:"Upload or edit a Dockerfile directly"},git:{label:"Build from a repository",description:"Inspect a public repository and build it with CodePipeline"},image:{label:"Use an existing image",description:"Connect a CR image delivered by an external pipeline"}},baseDescriptions:{"aio-sandbox":"Built-in Sandbox Shell capabilities · Ubuntu 22.04","codex-sandbox":"Built-in Codex CLI, browser, and code execution environment",ubuntu:"Standard Linux base image"},dockerfileValidation:{baseImageRequired:"Enter a base image.",duplicateFrom:"The base image is fixed on the first line. Remove the FROM instruction from the Dockerfile body.",tooLarge:"The Dockerfile cannot exceed 128 KiB.",empty:"The Dockerfile cannot be empty.",missingFrom:"The Dockerfile must include a FROM instruction."},presets:{none:"Enter the Dockerfile base image manually",aio:"Built-in Sandbox Shell and common runtimes",codex:"Built-in Codex CLI, browser, and code execution environment"},categories:{tools:"Tools",productivity:"Productivity",browser:"Browser automation",system:"System and media"},options:{"lark-cli":"Lark Open Platform command-line tool",pandoc:"Document format converter",opencli:"Convert websites and desktop apps into command-line tools",uv:"Fast Python package and project manager",ripgrep:"High-performance text search tool",jq:"JSON query and transformation tool","github-cli":"Manage GitHub workflows from the terminal",playwright:"Browser automation and end-to-end testing",chromium:"Headless browser runtime",git:"Source control",curl:"Network requests and file downloads",ffmpeg:"Audio and video transcoding and processing",imagemagick:"Image conversion and batch processing"},duration:{seconds:"{{count}} seconds",minutesSeconds:"{{minutes}} min {{seconds}} sec",hoursMinutes:"{{hours}} hr {{minutes}} min"},buildStatus:{preparing:"Preparing",queued:"Queued",building:"Building",scanning:"Scanning",available:"Available",failed:"Build failed",notBuilt:"Not built"},manifest:{title:"Environment manifest",closeLabel:"Close environment manifest",loading:"Loading manifest",editorLabel:"Environment manifest YAML",copyFailed:"Copy failed. Try again.",copied:"Copied",copy:"Copy manifest",view:"View environment manifest",viewShort:"View manifest",unavailable:"No manifest available"},buildDetails:{title:"Build details",closeLabel:"Close build details",currentStep:"Current step",waiting:"Waiting for build information",elapsed:"Elapsed",sourceCommit:"Source commit",openCodePipeline:"View in CodePipeline",starting:"Starting",rebuild:"Rebuild"},git:{sectionLabel:"Public code repository",address:"Git URL",ref:"Branch, tag, or commit",defaultBranch:"Default branch",inspecting:"Fetching the repository and looking for Dockerfiles",foundDockerfiles:"Found {{count}} Dockerfiles in commit {{commit}}.",savedDockerfileLoaded:"Loaded the saved Dockerfile. Inspect the repository again to check for updates.",noDockerfile:"No Dockerfile was found. Check the branch or repository contents.",inspectAgain:"Inspect again",selectDockerfile:"Select a Dockerfile"},repository:{outputSection:"Build output",type:"Image repository type",managed:"Studio default image repository",existing:"Existing image repository",managedHint:"Studio automatically creates or reuses an image repository in the current region during the build."},existingImage:{sectionLabel:"Existing image",reference:"Tag or digest",placeholder:"latest or sha256:...",hint:"Enter an image tag or a complete digest beginning with sha256:."},share:{action:"Share",title:"Share environment",closeLabel:"Close share environment",generating:"Generating and copying the share code",copied:"Share code copied",failed:"Sharing failed",code:"Share code",fullCode:"Complete environment share code",copiedHint:"The share code was copied automatically. You can also view or copy it here.",copyFailedHint:"Automatic copy failed. Copy the share code above manually or try again.",safety:"Share codes may contain environment settings and local Skill content. Send them only to trusted recipients.",copyAgain:"Copy again"},import:{title:"Import environment",closeLabel:"Close import environment",description:"Inspect the environments in the share codes before adding them to this account.",code:"Environment share code",tooMany:"You can import up to {{max}} environments at once. {{count}} share codes were found.",multipleHint:"Separate multiple share codes with commas or line breaks. Duplicates are ignored automatically.",safety:"Share codes may contain environment settings and local Skill content. Import them only from trusted sources.",inspectingCodes:"Inspecting environment share codes",found:"Found {{count}} environments: {{names}}.",itemError:"Share code {{index}}: {{error}}",invalidCode:"Invalid share code.",noResult:"The service returned no import result for this share code.",partial:"Imported {{created}} environments; {{remaining}} remain. Valid failed items can be retried.",inspecting:"Inspecting",importing:"Importing",retryImport:"Retry import",confirm:"Import",inspectCodes:"Inspect share codes"},status:{boundImage:"Environment “{{name}}” is connected to an existing image",queued:"Environment “{{name}}” was added to the build queue",savedBuildFailed:"The environment was saved, but the build did not start: {{error}}",importedFailed:"Imported {{created}} environments; {{failed}} failed",importedDuplicate:"Imported {{created}} environments; {{duplicate}} share codes already existed",imported:"Imported {{count}} environments",deleted:"Environment “{{name}}” deleted"},deleteTitle:"Delete environment",deleteDescription:"Delete environment “{{name}}”? This cannot be undone.",errors:{repositoryRequired:"Enter a public code repository URL.",repositoryHttps:"Enter the HTTPS URL of a public repository.",repositoryInvalid:"Enter a valid public repository HTTPS URL.",imageReferenceWhitespace:"A tag or digest cannot contain spaces.",imageDigestInvalid:"The digest must be a complete sha256 value.",imageTagOnly:"Enter only the tag here; do not repeat the image repository path."}},Xme={searchPlaceholder:"Search resource names",emptyMessage:"No options available",searchAriaLabel:"Search {{label}}",loadingMore:"Loading more resources…"},Yme={retryDeployment:"Retry deployment",retrying:"Retrying…",collapse:"Collapse error details",expand:"Expand full error details",copy:"Copy full error details"},Zme={steps:"Build steps",log:"Build log",syncing:"Syncing",loadFailed:"Failed to load",synced:"Synced",recentOnly:" · Recent logs only",copiedLog:"Build log copied",copyLog:"Copy build log",copied:"Copied",copy:"Copy",logContent:"Build log content",waiting:"Waiting for CodePipeline logs…",empty:"No build logs"},Jme={defaultLabel:"Studio default environment",defaultDescription:"Use the standard runtime environment provided by Studio",status:{notBuilt:"Not built",preparing:"Preparing",queued:"Queued",building:"Building",scanning:"Scanning",available:"Available",failed:"Failed"},label:"Runtime environment",placeholder:"Select a runtime environment",search:"Search runtime environments",loading:"Loading runtime environments…",loadFailed:"Failed to load runtime environments",noMatches:"No matching runtime environments",unavailable:"No runtime environments are currently available",selectionUnavailable:"The selected runtime environment is unavailable. Select another one.",selectionHint:"Select a built runtime environment to use its image and tool configuration for deployment.",versionChanged:"The selected environment version has changed. Review it before continuing.",versionMissing:"The selected environment version no longer exists. Select another one.",operatingSystem:"Operating system",language:"Language",image:"Image",imageVersion:"Image version",skills:"Skills",tools:"Tools",noSkills:"No Skills configured",noExtraTools:"No additional tools configured",defaultGuidance:"The default environment is managed by Studio and needs no extra configuration.",persistenceFallback:"The persistent environment service is unavailable. The default environment is being used.",emptyFallback:"No custom environments are available."},ege={repository:"GitHub repository",githubUrl:"GitHub URL",token:"Token",sessionToken:"{{provider}} Session Token",runtime:"Runtime",commit:"Commit",workflow:"Workflow",syncFailed:"Failed to sync GitHub code",status:{mounted:"Mounted",bound:"Bound",synced:"Synced",created:"Created"},volcengine:"Volcengine",mountDelivery:"Enable continuous delivery",selectedForDeployment:"Selected for deployment",mountOnDeploy:"Enable continuous delivery on deploy",syncCode:"Sync code",deliveryMode:"GitHub delivery mode",sourceSync:"GitHub code sync",delivery:"GitHub delivery",loading:"Loading",running:"Running",runtimeDeliveryHint:"Write an AgentKit Runtime GitHub Actions workflow so future GitHub commits update the bound Runtime.",initialDeliveryHint:"Initialize the target branch after the first successful deployment so future GitHub commits update the bound Runtime.",sourceSyncHint:"Studio pushes directly to the target branch. Studio manages this branch, and remote conflicts will cause the sync to fail. Use the deployment button to publish the Runtime.",tokenPlaceholder:"repo or contents:write permission",getToken:"Get token",hideToken:"Hide token",showToken:"Show token",tokenHelp:"The token is used only for this operation and is cleared from the form after success.",targetBranch:"Target branch",actionsSecretPlaceholder:"Used to write a GitHub Actions secret",sessionTokenPlaceholder:"Optional temporary credential",syncing:"Syncing…",pendingHint:"Continuous delivery is selected. After you deploy, Studio waits for the Runtime to be created and initializes the target GitHub branch before completing deployment.",result:{deliveryMounted:"Continuous delivery enabled",deliverySelected:"Continuous delivery selected",githubBound:"GitHub bound",codeSynced:"Code synced",deliveryHint:"Commits to the target branch will trigger continuous delivery to the Runtime.",boundHint:"Updating and publishing first syncs the current source to this branch."},branch:"Branch",viewPr:"View PR",createFailed:"Creation failed",phase:"Phase",log:"Log"},tge={name:"Feishu",enabling:"Enabling and updating configuration…",description:"Receive messages and reply through a Feishu bot",configuration:"Feishu configuration",configurationMode:"Feishu configuration mode",automatic:"Automatic",manual:"Manual",cancelling:"Cancelling…",scanToCreate:"Scan to create",scanDescription:"Credentials are filled in after authorization",generateQrCode:"Generate QR code",qrCodeAlt:"Feishu bot configuration QR code",scanToConfirm:"Scan with Feishu to confirm",expiresIn:"Expires in {{time}}",created:"Bot created",credentialsFilled:"App credentials filled in automatically",qrCodeExpired:"QR code expired",automaticFailed:"Automatic configuration failed",regenerateQrCode:"Generate a new QR code.",configuredPlaceholder:"Configured; leave blank to keep it",appSecretPlaceholder:"Enter App Secret",hideSecret:"Hide App Secret",showSecret:"Show App Secret"},nge={mode:{auto:"Create automatically",autoDescription:"Create required resources during deployment",recommended:"Recommended",create:"Specify names",createDescription:"Create or reuse resources with the specified names",existing:"Select existing",existingDescription:"Select existing resources from the current account"},selectExisting:"Select an existing resource",searchResource:"Search resource names",noMatch:"No matching resources",noAvailable:"No resources available",searching:"Searching cloud resources…",loading:"Loading cloud resources…",noMatchSentence:"No matching resources.",noAvailableSentence:"No resources available.",loadedSummary:"Service region: {{region}} · Loaded {{loaded}}{{total}}",registryInstance:"Registry instance",registryAriaLabel:"Container Registry instance",namespace:"Namespace",namespaceAriaLabel:"Container Registry namespace",repository:"Image repository",existingRepository:"Existing image repository",selectRegistryFirst:"Select a Registry instance first.",selectNamespaceFirst:"Select a Namespace first.",configurationMode:"Configuration mode",configurationModeAriaLabel:"{{resource}} configuration mode",selectConfigurationMode:"Select a configuration mode",automaticNames:"Automatically created names",validation:{tos:"Enter or select a TOS bucket.",cr:"Enter or select a CR instance, namespace, and image repository.",codePipeline:"Enter or select a CodePipeline Workspace and Pipeline.",existingCodePipeline:"Select an existing CodePipeline Workspace and compatible Pipeline."},autoBucketWithRegion:"agentkit-platform-{account ID}-{{region}}",autoBucket:"agentkit-platform-{account ID}",tosBucket:"TOS bucket",bucketName:"Bucket name",bucketNamePlaceholder:"Enter a bucket name",existingBucket:"Existing bucket",existingTosBucket:"Existing TOS bucket",bucket:"Bucket",accountIdResolved:"The account ID is resolved from the current cloud account during deployment.",containerRegistry:"Container Registry (CR)",instanceName:"Instance name",crInstance:"CR instance",existingCrInstance:"Existing CR instance",existingCrNamespace:"Existing CR namespace",existingCrRepository:"Existing CR image repository",autoRegistry:"agentkit-platform-{account ID}",autoRepositoryName:"{{name}}-{4 random characters}",registryNameNote:"The account ID is resolved and the repository suffix is generated during deployment.",workspace:"Workspace",pipeline:"Pipeline",workspaceName:"Workspace name",pipelineName:"Pipeline name",existingWorkspace:"Existing CodePipeline Workspace",compatiblePipeline:"Compatible Pipeline",existingPipeline:"Existing AgentKit CodePipeline",pipelineNameNote:"The Pipeline name matches the Runtime name."},ige={commit:"Commit",steps:{permissions:"Preflight OTA permissions",resolving:"Resolve target version",downloading:"Download and verify the full update package",preparing:"Prepare VeFaaS Function code",provisioning:"Check and provision Studio cloud resources",scheduler:"Update the scheduled task service",submitting:"Submit the Function update",publishing:"Publish a new Revision and restart the service"},stages:{permissions:"Preflight OTA permissions",resolving:"Resolve version details",downloading:"Download update package",preparing:"Prepare Function code",provisioning:"Provision Studio cloud resources",scheduler:"Update scheduled task service",submitting:"Submit Function update",publishing:"Publish Revision",checking:"Check for updates",unknown:"Unknown stage"},duration:{seconds:"{{count}} seconds",minutesSeconds:"{{minutes}} min {{seconds}} sec"},logPermissionPrefix:"Unable to read VeFaaS release logs. The Function role lacks ",logPermissionSuffix:"; the update will continue.",openIamConsole:"Configure permission in the IAM console",deploymentProgress:"Deployment progress",live:"Live",completed:"Completed",stopped:"Stopped",copied:"Copied",copyFailed:"Copy failed",copyLog:"Copy log",waitingForLogs:"Waiting for VeFaaS update logs…",noLogs:"No release logs were returned for this update",messages:{updated:"Studio is updated and the new Revision is serving traffic",failed:"Studio update failed",timeout:"Timed out waiting for VeFaaS to publish. Check for updates again later.",submitted:"Update submitted. Waiting for VeFaaS to publish the new version.",connectionSwitched:"The connection changed. Confirming the new version status."},checkingPermissions:"Checking OTA permissions",authorizationRequired:"IAM authorization required",updating:"Updating Studio",updated:"Studio updated",updateToVersion:"Update Studio to {{version}}",checkPermissions:"Check update permissions",authorizationNeeded:"Authorization required",updatingShort:"Updating",refreshForNewVersion:"Refresh to use the new version",updateFailed:"Update failed",updateNow:"Update now",newVersionAvailable:"New version available",dialog:{failed:"Studio update failed",checkingPermissions:"Checking update permissions",authorizationRequired:"IAM authorization required",updating:"Updating Studio",completed:"Studio update complete",newVersion:"New version available"},permissionCheck:"Checking every IAM permission required by OTA and scheduled tasks…",permissionCheckHint:"Downloads and cloud-resource updates begin only after all permissions are available.",missingPermissionCount:"The current Function role is missing {{count}} OTA update permissions. No cloud resources have been changed.",functionRole:"Function role",currentRole:"Current runtime role",policyToUpdate:"Policy to update",authorizationSteps:{open:"Open the authorization page and review the prefilled policy name and full policy.",debug:"Select “Start debugging” on the page to apply the policy update.",return:"Return to this window and select “Authorized, check again”."},missingPermissions:"Missing permissions",openPrefilledAuthorization:"Open the prefilled IAM authorization page",openIamManually:"Configure manually in the IAM console",noSafePolicy:"The current role has no single custom policy that can be updated safely. Ask an administrator to add the permissions above to this role.",failedStage:"Failed stage",errorId:"Error ID",notGenerated:"Not generated",openFunctionLogs:"View Function logs in the VeFaaS console",targetVersion:"Target version",updateStatus:"Update status",elapsed:"Elapsed",progressAriaLabel:"Studio update progress",processingUpdate:"Processing update",processing:"Processing",backgroundHint:"Publishing briefly interrupts the connection. Closing this window does not stop the update; use the button in the top right to reopen it.",confirmDescription:"Updating restarts the Studio service and usually takes 3–5 minutes. Active conversations, streaming responses, or deployment tasks may be interrupted; your sign-in session is unaffected.",selectVersion:"Select version",currentVersion:"Current version",changelog:"What's new",noChangelog:"No release notes",runInBackground:"Run in background",authorizedRecheck:"Authorized, check again",tryAgain:"Try again"},rge={deploy:"Deploy",update:"Update",planHash:"Plan hash",backToConfiguration:"Back to configuration",releaseRegion:"Release region",deployRegion:"Deployment region",regionPreserved:"The existing Runtime deployment region is preserved during updates and cannot be changed.",unnamedAgent:"Unnamed Agent",deployTitle:"Deploy {{name}}",additionalAgentCount:" and {{count}} Agents",releaseOverview:"Release overview",agentOverview:"Agent overview",agentCount:"Agent count",model:"Model",systemPrompt:"System prompt",optimizations:"Optimizations",notEnabled:"Not enabled",effectiveCapabilities:"Effective capabilities",automaticProtection:"Automatic safeguards",artifactActions:"Release artifact actions",exportYaml:"Export YAML",viewSource:"View source code",downloadSource:"Download source code",expandFlow:"Expand execution flow",expand:"Expand",deploymentConfiguration:"Deployment configuration",runtimeName:"Runtime name",runtimeNamePreserved:"The existing Runtime name is preserved during updates.",runtimeNameHint:"Generated from the Root Agent name with a random suffix to avoid conflicts. Use 4–64 letters, numbers, hyphens, or underscores.",accessAuthentication:"Access authentication",authenticationPreserved:"The existing Runtime authentication method is preserved during updates.",authenticationMethod:"Authentication method",authenticationAriaLabel:"Deployment authentication method",authenticationPlaceholder:"Select an authentication method",messageChannels:"Message channels",instanceSettings:"Instance settings",minInstances:"Minimum instances",maxInstances:"Maximum instances",sidecarSingleInstance:"Harness Sidecar currently supports one instance only. The Runtime is fixed at 1–1.",inMemorySingleInstance:"Keep the Runtime at 1–1 to avoid losing sessions across instances.",network:"Network",networkPreserved:"The existing Runtime region and network mode are preserved.",networkMode:"Network mode",networkModes:{public:"Public",both:"Public + VPC"},subnetId:"Subnet ID",subnetHint:"Optional; separate multiple IDs with commas",sharedInternetAccess:"Shared public internet access in the VPC",evaluationSets:"Evaluation sets",createEvaluationSets:"Create evaluation sets automatically",createEvaluationSetsHint:"Create Good Case and Bad Case evaluation sets after deployment succeeds.",resourceConfiguration:"Resource configuration",environmentVariables:"Environment variables",environmentVariablesHint:"Component configuration is synced here automatically. Review the final values before deployment.",itemCount:"{{count}} items",addVariable:"Add variable",componentGenerated:"Generated from components",injectedByApiKey:"Injected from the selected API key",envNameAriaLabel:"{{key}} environment variable name",envDescriptionAriaLabel:"{{key}} description: {{description}}",openOpenViking:"Open OpenViking {{label}}",openOpenVikingAriaLabel:"{{key}}: open OpenViking {{label}}",requiredEmpty:"Required; no value entered",optionalEmpty:"Optional; no value entered",envValueAriaLabel:"{{key}} environment variable value",automatic:"Automatic",synced:"Synced",customModelCredentials:"Custom model credentials",releaseOnlySecret:"Required; used only for this release",thisRelease:"This release",customVariables:"Custom variables",value:"Value",deleteVariable:"Delete variable",deploymentProgress:"Deployment progress",retryUpdate:"Retry update",retryDeploy:"Retry deployment",updateSucceeded:"Update succeeded",deploySucceeded:"Deployment succeeded",region:"Region",agentName:"Agent name",apiEndpoint:"API endpoint",connecting:"Connecting…",chatNow:"Chat now",console:"Console",actionInProgress:"{{action}} in progress…",checkingName:"Checking name…",retryAction:"Retry {{action}}",flowPreview:"Execution flow preview",executionFlow:"Execution flow",flowPreviewHint:"Read-only preview; zoom and pan the canvas",closeFlowPreview:"Close execution flow preview",agentAdded:'Agent "{{name}}" was added to the selector in the top left.',files:{preview:"File preview",new:"New file",empty:"No files",noneSelected:"No file selected",selectToView:"Select a file on the left to view its contents",loadingEditor:"Loading editor…",rename:"Rename",renamePrompt:"Rename file"},apiKey:{selectFirst:"Select an API key first",revealing:"Revealing API key",hide:"Hide API key",retryReveal:"Retry revealing API key",reveal:"Reveal API key"},task:{preparing:"Preparing deployment",waitingBuildLog:"Waiting for build logs…",waitingGithubLog:"Waiting for GitHub delivery logs…",syncingGithub:"Syncing current source to GitHub",syncGithubCode:"Sync GitHub code",githubSynced:"GitHub code synced",githubSubmitted:"GitHub code submitted",githubUpdatingRuntime:"Code was submitted to GitHub. GitHub Actions is updating the same Runtime.",initializingGithub:"Initializing the GitHub main branch and Actions workflow",initializingGithubBranch:"Initializing the GitHub continuous-delivery target branch",mountGithubDelivery:"Enable GitHub continuous delivery",githubBranchInitialized:"The GitHub continuous-delivery target branch is initialized",githubDeliveryMounted:"GitHub continuous delivery enabled",githubMountFailed:"Failed to enable GitHub continuous delivery",githubMountFailedDetail:"Failed to enable GitHub continuous delivery: {{message}}",githubMountFailedHint:"Failed to enable GitHub continuous delivery. See the GitHub log for details.",applyingMpaProfile:"Applying the Agent profile to MPA Runtime",mpaProfileApplied:"MPA Runtime profile applied",runningMpaSmoke:"Verifying the MPA Runtime execution path",mpaReady:"MPA Runtime is ready",deploymentComplete:"Deployment complete",deployedNotConnected:"Deployed, not connected yet",cancelled:"Cancelled",cancelledHint:"Deployment was cancelled and the Runtime resources were requested for deletion.",deploymentStatusUnconfirmed:"Deployment status unconfirmed",deploymentFailed:"Deployment failed",buildFailedHint:"Image build failed. See the build log for details."},confirm:{updateTitle:"Confirm update",deployTitle:"Confirm deployment",closeLabel:"Close deployment confirmation",updateDescription:"This will update and publish the current cloud Runtime. It may take a few minutes. Continue?",deployDescription:"This will create a new cloud Runtime. Deployment may take a few minutes. Continue?",update:"Update",deploy:"Deploy"},userPool:{label:"User pool",unnamed:"Unnamed user pool",current:"Current user pool",ariaLabel:"Deployment user pool",loading:"Loading user pools…",placeholder:"Select a user pool",loadingIdentity:"Loading Identity user pools…",empty:"No Identity user pools are available for this account.",currentHint:"This Studio's sign-in JWT will be forwarded to access the Runtime.",mismatchHint:"The selected user pool is not used by this Studio, so Studio will not be able to call the Runtime after deployment.",markedHint:"The user pool used by this Studio is marked in the list."},authentication:{apiKeyDescription:"Default method using the Runtime API key",userPool:"User pool",userPoolDescription:"Use a JWT issued by an Identity user pool"},steps:{buildImage:"Build image",deploy:"Deploy",publish:"Publish",syncCode:"Sync code",uploadPackage:"Upload code package",packageImage:"Package image",createRuntime:"Create Runtime",publishService:"Publish service",updateInstances:"Update instance configuration",createEvaluationSets:"Create evaluation sets",applyMpaProfile:"Apply MPA profile",verifyMpaRuntime:"Verify MPA Runtime",mpaReady:"MPA Runtime ready"},errors:{instanceRangeInteger:"Minimum instances must be an integer of 0 or more, and maximum instances must be an integer greater than 0.",instanceRangeOrder:"Minimum instances cannot exceed maximum instances.",selectApiKey:"Select an API key in the model configuration first.",loadApiKey:"Failed to load the API key. Try again.",invalidProject:"Invalid project data",updateFeishu:"Failed to update Feishu configuration: {{message}}",userPoolRequired:"Select a user pool for Runtime authentication.",vpcRequired:"Enter a VPC ID when using a VPC network.",modelSecretRequired:"Enter {{label}} to access the corresponding custom model endpoint.",managedApiKeyRequired:"{{requirement}}. Return to model configuration and select an API key first.",feishuEnvRequired:"Enter {{field}} after enabling Feishu.",runtimeNameExists:"This Runtime name already exists. Change it and try again.",deployedButGithubMountFailed:"Deployment succeeded, but enabling GitHub continuous delivery failed: {{message}}",deployedButGithubBindFailed:"Deployment succeeded, but binding GitHub failed: {{message}}",mpaRuntimeIdMissing:"Deployment succeeded, but the Runtime ID is missing, so the MPA profile cannot be applied.",mpaOperationIncomplete:"MPA Runtime setup did not complete. Retry this deployment task.",deploymentStatusUnconfirmed:"The connection was interrupted, so the final deployment status cannot be confirmed. The task may still be running in the cloud. Check the same task in AgentKit or CodePipeline and avoid a duplicate deployment.",failedAtStage:"{{action}} failed during {{stage}}: {{message}}",noAgentAtEndpoint:"Connected successfully, but no Agents were found at this endpoint (/list-apps is empty).",addAgent:"Failed to add Agent: {{message}}",modelApiKeyRequired:"Enter the API key for this model endpoint."}},sge={title:"Workspaces",storageUnavailable:"Persistent storage is not configured. Workspace management is unavailable.",detail:"Workspace details",create:"New workspace",editorDescription:"Group frequently used environments. An environment can belong to multiple workspaces.",backToList:"Back to workspaces",environmentCount_one:"{{count}} environment",environmentCount_other:"{{count}} environments",createdAt:"Created",updatedAt:"Last updated",basicInfo:"Basic information",namePlaceholder:"For example: Content production",descriptionPlaceholder:"Describe what this workspace is for",selectedEnvironmentCount:"{{count}} selected; they can also be reused in other workspaces",searchAvailableEnvironments:"Search available environments",searchEnvironments:"Search environments",noAvailableEnvironments:"No environments are available to add",createEnvironmentFirst:"Create and build an environment on the Environments page first.",noMatchingEnvironments:"No matching environments",tryAnotherName:"Try searching for another name.",environmentStatus:{available:"Available",building:"Building",notBuilt:"Not built"},added:"Added",saved:"Workspace “{{name}}” saved",resourceType:"Workspace resource type",searchWorkspaces:"Search workspaces",loadFailed:"Unable to load workspaces",noMatchingWorkspaces:"No matching workspaces",tryAnotherNameOrEnvironment:"Try another name or environment",noEnvironmentAdded:"No environments added",environmentMissing:"Environment missing",availableFraction:"{{available}}/{{total}} available",available:"Available",availableCount:"{{count}} available",updated:"Updated",addEnvironment:"Add environment",deleteTitle:"Delete workspace",deleteDescription:"Delete workspace “{{name}}”? Its environments will not be deleted.",deleted:"Workspace “{{name}}” deleted",clipboardPermissionError:"Could not read the clipboard. Allow clipboard access, or open Import environment and paste the share code manually.",clipboardUnsupported:"This browser cannot read the clipboard automatically. Open Import environment and paste the share code manually.",codeProjects:"Code projects"},age={back:"Back",detailNavigation:"Detail navigation",noData:"No data",actions:"Actions",moreActions:"More actions for {{label}}",actionsFor:"Actions for {{label}}",loading:"Loading resources…"},oge={addSkill:"Add Skill",remove:"Remove {{name}}",confirmRemoveRuntime:"Remove the running Skill “{{name}}” from the new version?",selectedCount:"Added skills · {{count}}",close:"Close {{label}}",sources:{runtime:"Running source · Preserved as-is; remove it or replace it with a Skill of the same name",local:"Local",skillspace:"AgentKit Skills Center",skillhub:"Volcengine Find Skill marketplace"},tabs:{local:"Local files",localShort:"Local files",skillspace:"AgentKit Skills Center",skillspaceShort:"AgentKit",skillhub:"Volcengine Find Skill marketplace",skillhubShort:"Find Skill"}},lge={model:"Model",turnControls:"Turn controls",pause:"Pause",resume:"Resume",interrupt:"Interrupt",cancel:"Cancel",pauseTurn:"Pause the whole flow at a safe point",resumeTurn:"Resume the whole flow",interruptTurn:"Interrupt this flow and retain Session context",cancelTurn:"Cancel this flow permanently",turnState:{running:"Running",pausing:"Reaching safe point",paused:"Paused",resuming:"Resuming",interrupting:"Interrupting",cancelling:"Cancelling",interrupted:"Interrupted",completed:"Completed",failed:"Failed",cancelled:"Cancelled",orphaned:"Status pending",newTurnRequired:"Continue from checkpoint"},tasks:{ppt:"Presentation",image:"Image generation",video:"Video generation"},prompts:{ppt:{quarterlyReview:"Review 【quarter】 business performance, highlighting metric gaps, causes, and recommended actions",projectUpdate:"Present the progress of 【project name】: milestones, risks, budget, and resource requests",solutionProposal:"Create a solution proposal for 【customer industry】: pain points, architecture, implementation plan, and benefits",industryAnalysis:"Analyze trends in 【industry topic】 and recommend strategic opportunities based on the competitive landscape"},image:{launchVisual:"Design a 【high-tech】 launch-event key visual for 【brand or product】",ecommercePoster:"Create an e-commerce poster for 【product name】 that highlights 【core selling point】 and brand colors",conceptRendering:"Create a photorealistic concept rendering of 【product or space】 in 【usage scenario】",socialGraphic:"Create a concise, professional corporate social graphic for 【campaign theme】"},video:{brandFilm:"Create a 30-second promotional video for 【brand name】 that highlights 【brand value】",productLaunch:"Create a 45-second launch video for 【product name】 covering the pain point, features, scenarios, and call to action",trainingVideo:"Create a corporate training video about 【training topic】 that clearly explains 【key procedure or policy】",eventTeaser:"Create a 20-second teaser for 【event name】 with highlights, time and location, and registration details"}},firstFrame:"First frame",videoToEdit:"Video to edit",baseVideo:"Base video",optimizeSkillPlaceholder:"Describe the skill you want to improve…",createSkillPlaceholder:"Describe the skill you want to create…",createVideoPlaceholder:"Describe the video you want to create…",messageAgentPlaceholder:"Message {{name}}…",selectAgentFirst:"Select an agent first",selectSkillFirst:"Select the Skill you want to improve first",availableSkills:"Available skills",availableSubagents:"Available sub-agents",invokeSkill:"Use a skill",useSubagent:"Use a sub-agent",loadingCapabilities:"Loading Agent capabilities…",noMatchingSkills:"No matching skills for this Agent",noMatchingSubagents:"No matching sub-agents for this Agent",skillFallbackDescription:"Load and run this skill",agentFallbackDescription:"Hand this turn to the Agent",skill:"Skill",uploadImage:"Upload image",uploadDocument:"Upload document or PDF",uploadVideo:"Upload video",taskMode:"Task mode",selectTaskMode:"Select a task mode",loadingGenerationModel:"Loading generation model",modelUnavailable:"Model unavailable",cancelTask:"Cancel {{task}} task",stopGenerating:"Stop generating",viewVideoProgress:"View video generation progress",send:"Send",selectTaskType:"Select a task type",enterprisePrompts:"{{task}} enterprise prompts",sessionId:"Session ID",sessionIdLabel:"Session ID: ",initializing:"Initializing",copied:"Copied",copySessionId:"Copy session ID",sessionIdCopied:"Session ID copied",disclaimer:"Responses may be inaccurate",viewLogs:"View logs"},cge={selectAgent:"Select Agent",noLocalAgents:"No local Agents.",searchRuntime:"Search Runtime names",mineOnly:"Created by me",noRuntimes:"No Runtimes.",unsupported:"Unsupported",createdByMe:"Created by me",connecting:"Connecting…",connected:"Connected",connect:"Connect",viewInfoFor:"View information for {{name}}",viewInfo:"View information",agentAndRuntimeInfo:"Agent and Runtime information",detailType:"Detail type",agentInfo:"Agent information",runtimeInfo:"Runtime information",loadingAgentInfo:"Loading Agent information…",cannotLoadAgentInfo:"Agent information is temporarily unavailable",unnamedAgent:"Unnamed Agent",subagents:"Sub-agents",tools:"Tools",skills:"Skills",previewUnsupported:"Preview unavailable",mountedComponents:"Mounted components",noMoreAgentInfo:"No additional Agent configuration information.",local:"Local",model:"Model",status:"Status",memoryMb:"Memory {{value}} MB",instances:"Instances {{min}}–{{max}}",resources:"Resources",version:"Version",loadingDetails:"Loading details…",environmentVariables:"Environment variables",errors:{notFound:"This Runtime no longer exists or the list is out of date. Refresh the list and try again.",accessDenied:"This account cannot access the Runtime. Check its Project and access permissions.",previewUnsupported:"This Agent Server version does not support information previews.",unavailable:"This Runtime is temporarily unavailable. Confirm that its status is Ready and try again.",timeout:"Loading timed out. Try again."},componentKinds:{knowledgebase:"Knowledge base",memory:"Memory",prompt_manager:"Prompt manager",example_store:"Example store",run_processor:"Run processor",tracer:"Trace",toolset:"Toolset",plugin:"Plugin",other:"Other"},runtimeStatus:{ready:"Ready",unreleased:"Unreleased",running:"Running",active:"Running",creating:"Creating",pending:"Pending",deploying:"Deploying",updating:"Updating",failed:"Failed",error:"Error",stopping:"Stopping",stopped:"Stopped",deleting:"Deleting",deleted:"Deleted"}},uge={agent:"Agents",agentTypes:{general:"General Agents",mpa:"MPA Agents",codex:"Codex","deepseek-harness":"DeepSeek",openclaw:"OpenClaw",hermes:"Hermes"},creator:"Created by",namedAgent:"{{name}} Agent",storageLocation:"Storage location",currentBrowser:"Current browser",region:"Region",viewDeploymentProgress:"View deployment progress for {{name}}",viewRuntimeDetails:"View Runtime details for {{name}}",viewDetails:"View details for {{name}}",time:"Time",remainingTime:"Time remaining",expiringSoon:"Expiring soon",sandboxRemaining:"{{hours}} hr {{minutes}} min",wakeable:"Asleep",neverExpires:"Never expires",editDraftNamed:"Edit draft {{name}}",viewProgress:"View progress",deleteDraftNamed:"Delete draft {{name}}",recheckCompatibility:"Check chat compatibility for {{name}} again",connectedNamed:"{{name}} is connected",wakeAndChat:"Wake {{name}} and start chatting",chatWith:"Chat with {{name}}",waking:"Waking…",deploying:"Deploying",draft:"Draft",checking:"Checking",chatUnsupported:"Chat unsupported",checkFailed:"Check failed",creatorFilter:"Creator filter",agentType:"Agent type",searchAgents:"Search Agents",handoff:"Handoff",agentList:"{{type}} list",noMatchingAgents:"No matching Agents",adjustSearch:"Try adjusting the search or filters",noAgentType:"No {{type}}",noGeneralAgents:"No General Agents",createGeneralAgentDescription:"Create a General Agent to start building and chatting",createAgentType:"Create {{type}}",createAgent:"Create Agent",loadingMore:"Loading more Agents",scrollForMore:"Scroll down to load more",allLoaded:"All Agents loaded",deleteDraftTitle:"Delete draft?",deleteDraftDescription:"“{{name}}” cannot be recovered after deletion.",deleteDraft:"Delete draft",loadGeneralAgents:"Load General Agents",loadAgentType:"Load {{type}}",compatibility:{checking:"Requesting Runtime /list-apps to confirm that this Agent supports Studio chat.",empty:"Runtime /list-apps returned no available Agents, so chat is currently unavailable.",supported:"This Runtime supports Studio chat.",unknownError:"The Runtime /list-apps request failed without a recognizable error."},sandboxStatus:{ready:"Ready",wakeable:"Asleep",creating:"Creating",starting:"Starting",initializing:"Starting",pending:"Pending",running:"Running",failed:"Error",error:"Error",stopped:"Stopped",expired:"Expired",deleting:"Deleting",deleted:"Deleted",unknown:"Unknown status"},wakingHint:"Waking the agent. This may take some time.",mpaCreate:{name:"Name",namePlaceholder:"e.g. test-agent",nameHelp:"Used as the Runtime name. Use 4–64 letters, numbers, underscores or hyphens.",stepsLabel:"Creation steps",steps:{basics:"Basics",postgres:"PostgreSQL",openviking:"OpenViking",autoPostgres:"Database"},next:"Next",previousStep:"Previous",pgDescription:"Choose an existing PostgreSQL instance. Creation prepares an isolated database for this agent on that instance.",pgSplitDescription:"Use the configured business PG Workspace. Agents share this Workspace, each with its own database. Shared resource records are stored separately in mpa_admin_workspace / mpa_admin_db, configured by the administrator.",pgConsole:"Create or inspect an AIDAP PG Workspace in Volcengine",pgHost:"PG host",pgPort:"PG port",pgInvalid:"Enter a valid PG host and port.",pgCredentials:"The deployment service provides the PG login and password; host and port must match its configuration.",openvikingDescription:"Optional. Enter all three fields to enable OpenViking, or leave all blank to omit OpenViking settings from the new agent.",openvikingConsole:"Inspect OpenViking resources in Volcengine",openvikingUrl:"OpenViking service URL",openvikingResourceId:"OpenViking resource ID",openvikingApiKey:"OpenViking API Key",openvikingInvalid:"Enter a valid HTTPS service URL, resource ID and API Key together, or leave all blank.",openvikingCredentials:"The API Key is used only for this creation and is not saved in browser drafts; re-enter it after a refresh.",tosTitle:"Session output storage",tosDescription:"Optional. Enter complete TOS credentials and a bucket to mount an isolated output directory for every Session. Leave all three blank to use the server defaults; TOS mounting is disabled if no defaults are configured.",tosAccessKey:"TOS Access Key",tosSecretKey:"TOS Secret Key",tosBucket:"TOS bucket",tosInvalid:"TOS Access Key, Secret Key, and bucket are all required together.",tosCredentials:"Credentials are used only for this creation and are not saved in browser recovery data or creation task records.",runtimeImage:"MPA image",workerImage:"Worker image",imageDefault:"Leave blank to use the configured image",imageInvalid:"Enter a valid container image reference without URLs, spaces or credentials.",title:"Create MPA agent",agentId:"Agent ID",description:"Description",region:"Deployment region",plan:"Creation plan",sharedResources:"Prepare or reuse the account VPC, subnets and APIG message gateway",agentResources:"Prepare an isolated database, Skill Space and worker, then deploy the agent",readiness:"Verify gateway and agent readiness before adding the agent to the list",checking:"Checking creation configuration…",configured:"Creation configuration is ready. Submission checks cloud resources and starts provisioning.",notConfigured:"Creation prerequisites are not configured. Ask an administrator to configure them, then retry.",loadFailed:"Could not check creation configuration. Please retry.",reload:"Check again",submit:"Start creation",retry:"Retry creation",newAgent:"Create another agent",newAgentDescription:"Create another agent opens an editable new request and replaces this recovery draft. It does not cancel the old task. If the old task is still running, wait for it to finish before submitting.",close:"Close",cancel:"Cancel creation",confirmCancel:"Confirm cancellation",cancelDescription:"Cancellation stops subsequent steps. Created databases, Skill Spaces, gateways and other registered resources are retained. Retry using the same agent ID.",background:"Creation continues after closing this window. Open it again to view progress.",pollFailed:"Progress is temporarily unavailable. Reconnecting; avoid creating another agent.",iamPermissionDenied:"The deployment service lacks IAM permissions to prepare the runtime role. Ask an administrator to grant access, then retry.",iamTrustConflict:"The runtime role trust is incompatible. Ask an administrator to check VeFaaS and APIG access, then retry.",iamPolicyConflict:"An existing runtime policy with the required name has conflicting contents. Ask an administrator to check it, then retry.",iamOwnershipConflict:"The runtime role does not belong to the deployment account. Ask an administrator to check it, then retry.",iamVerificationFailed:"Runtime role permissions could not be confirmed. Check IAM availability and policies, then retry.",iamConfigurationConflict:"Automatic runtime role preparation requires the default MPA role. Check the server creation configuration.",creationFailed:"This step failed. Check its resources, server configuration and permissions, then retry the same agent ID.",cancelFailed:"Cancellation failed. Check the current progress and retry.",cancelled:"Creation cancelled. Registered resources are retained for retry.",timeout:"Creation timed out. Registered resources are retained. Inspect them before retrying.",interrupted:"Creation was interrupted. Retry the same agent ID to recover registered resources.",skillSpace:"Skill Space",states:{running:"Creating",cancelling:"Cancelling",succeeded:"Created",failed:"Creation failed",cancelled:"Cancelled"},stages:{queued:"Queued",iam_role:"Prepare runtime role",checking:"Checking account and configuration",network:"Preparing VPC and subnets",gateway:"Preparing APIG and IM Gateway",database:"Preparing business database",skills:"Preparing Skill Space",worker:"Preparing worker",deploying:"Preparing database, skills and Runtime",verifying:"Waiting for agent readiness",admin_workspace:"Prepare management PG Workspace",business_workspace:"Prepare business PG Workspace",admin_database:"Initialize shared management database"},back:"Keep creating",pgAutoDescription:"VeADK uses its deployment account to create or reuse two PG Workspaces. mpa_admin_workspace / mpa_admin_db stores shared resource records; the business Workspace hosts an independent database for each agent. No PG connection input is needed. Preparation starts after submission.",pgModeChanged:"This submitted task uses previous PG settings and cannot be retried in automatic mode. Ask an administrator to reconcile its resources and task before starting a new creation.",pgMigrationRequired:"An existing shared registry is configured. Migrate its resource records to mpa_admin_workspace / mpa_admin_db and coordinate the registry URL cutover for existing Runtimes, then recheck this configuration."}},dge={library:"Skill library",skill:"Skill",skills:"Skills",skillSpace:"Skill space",sandboxNotConfigured:"Dev Sandbox is not configured by an administrator",adminNotConfigured:"Not configured by an administrator",totalItems:"{{count}} items",cannotLoadSpaces:"Unable to load Skill spaces",someSpacesFailed:"Some Skill spaces failed to load",degradedRelationWarning:"Some relations are invalid. Readable skills have been restored.",downloadZip:"Download ZIP",optimize:"Optimize",closeSkillDetails:"Close Skill details",skillId:"Skill ID",allFiles:"All files",loadingSkillContent:"Loading Skill content…",noSkillContent:"This Skill has no SKILL.md content",addSkill:"Add Skill",localUpload:"Upload locally",localUploadDescription:"Select a ZIP file and upload it to the Skill space after validation",autoCreate:"Create automatically",autoCreateDescription:"Choose a model and style, then create a Skill through conversation",createSkill:"Create Skill",optimizeNamed:"Optimize {{name}}",deleteSkillConfirm:"Delete the entire Skill “{{name}}”? This affects every space that references it.",deleteSpaceConfirm:"Delete Skill space “{{name}}”? Make sure its Skills have been deleted first.",manageSpaceDescription:"Manage Skills in this space and create new versions",backToSpaces:"Back to Skill spaces",overview:"Overview",skillCount:"Skills",skillCountValue_one:"{{count}} Skill",skillCountValue_other:"{{count}} Skills",updatedAt:"Updated",skillsInSpace:"Skills in {{name}}",searchSkills:"Search Skills",cannotLoadSkills:"Unable to load Skills",noMatchingSkills:"No matching Skills",noSkills:"No Skills",tryAnotherName:"Try searching for another name",emptySkillsDescription:"Upload a Skill locally or create one automatically",actions:"Actions",spaceDetails:"Skill space details",editSpace:"Edit space",deleteSpace:"Delete space",searchSpaces:"Search Skill spaces",spaceList:"Skill space list",noMatchingSpaces:"No matching Skill spaces",createSpace:"Create Skill space",newSpace:"New space",loadingMoreSpaces:"Loading more Skill spaces",scrollForMore:"Scroll down to load more",allSpacesLoaded:"All Skill spaces loaded",errors:{loadSpaces:"Unable to load Skill spaces. Try again later.",loadSkills:"Unable to load Skills. Try again later.",loadSkillDetails:"Unable to load Skill details. Try again later.",deleteSkill:"Unable to delete the Skill",deleteSpace:"Unable to delete the Skill space",downloadSkill:"Unable to download the Skill"},status:{active:"Available",available:"Available",creating:"Creating",disabled:"Disabled",enabled:"Enabled",failed:"Error",inactive:"Inactive",pending:"Pending",published:"Published",ready:"Ready",released:"Published",running:"Running",success:"Healthy",unavailable:"Unavailable",unreleased:"Unreleased",updating:"Updating",unknown:"Unknown"},sharedSpace:"Enterprise shared space",sharedDescription:"Skills available to everyone, published and maintained by administrators",sharedVisibility:"Everyone",sharedPreparing:"Preparing shared space",sharedLoadFailed:"Shared space unavailable",sharedEmpty:"No shared skills yet. Skills published by administrators will appear here",requestPublication:"Request publication",reviewSubmitting:"Submitting…",reviewSubmitted:"Submitted",reviewFailed:"Could not submit the publication request",reviewStatusFailed:"Failed to load review status",reviewRetry:"Apply again",reviewPending:"Pending review",reviewApproving:"Publishing",reviewApproved:"Shared",reviewReturned:"Returned",reviewHistory:"Review history",skillDetailSections:"Skill detail sections",versions:{title:"Version management",refresh:"Refresh",uploading:"Uploading…",upload:"Upload new version",close:"Close",hint:"New versions become public after approval and do not replace published versions; the skill name in the ZIP must match the original",loading:"Loading versions…",loadFailed:"Unable to load versions",filesFailed:"Unable to load version files",uploadFailed:"Unable to upload the new version",submitFailed:"Unable to submit for review",retry:"Retry",empty:"No versions yet",current:"Current version",notSubmitted:"Not submitted",submitting:"Submitting…",submit:"Request publication",processing:"Version status: {{status}}",filesLoading:"Loading files…",filesEmpty:"No files",history:"Review history",shared:"Published"},author:"Author",authorName:"Author: {{name}}"},fge={library:"Knowledge bases",createBase:"New knowledge base",editBase:"Edit knowledge base",invalidName:"The name must start with a letter and contain only letters, numbers, and underscores.",nameHelp:"Start with a letter. Use up to 48 letters, numbers, or underscores.",optionalDescription:"Description (optional)",descriptionOnly:"AgentKit currently supports updating only the knowledge base description.",previewWeb:"Preview web content",addData:"Add data",openOriginalWeb:"Open original page",backToEdit:"Back to edit",confirmAdd:"Confirm and add",source:"Knowledge source",image:"Image",documentFile:"Document file",webPage:"Web page",webUrl:"Web page URL",generatingWebPreview:"Fetching the page and generating a Markdown preview",selectFile:"Select knowledge file",selectOrDropFile:"Select a file or drag it here",selectedFile:"{{size}} · Click to select another file",imageFileHelp:"PNG, JPG, and JPEG up to 200 MB",documentFileHelp:"PDF, PPTX, DOCX, XLSX, and TXT up to 200 MB",uploadingFile:"Uploading the file and adding it to the knowledge base",optionalName:"Name (optional)",optionalType:"Type (optional)",generatePreview:"Generate preview",uploadFile:"Upload file",editMetadata:"Edit knowledge metadata",knowledge:"Knowledge item",field:"Field",value:"Value",backToList:"Back to knowledge bases",metadataJson:"Metadata (JSON)",provider:"Provider",knowledgeId:"Knowledge ID",project:"Project",creator:"Created by",data:"Data",deleteInvalidAssociation:"Delete invalid association",noData:"This knowledge base has no data",addFirstData:"Add the first data item",format:"Format",size:"Size",searchData:"Search data",searchLibraryData:"Search knowledge base data",associationInvalid:"Association invalid",providerMissing:"The underlying Provider knowledge base no longer exists",noMatchingData:"No matching data",loadingMoreData:"Loading more data",retryLoading:"Retry loading",details:"Knowledge base details",searchBases:"Search knowledge bases",someBasesFailed:"Some knowledge bases are temporarily unavailable. Other available content is shown.",noMatchingBases:"No matching knowledge bases",noManagePermission:"You do not have permission to manage this knowledge base",loadingMoreBases:"Loading more knowledge bases",deleteBaseTitle:"Delete knowledge base?",deleteBaseDescription:"This removes the AgentKit association for {{name}}. If Studio created it, the Provider resource is also deleted. This cannot be undone.",deleteDocumentTitle:"Delete knowledge item?",deleteDocumentDescription:"This removes {{name}} from the Provider knowledge base. This cannot be undone.",preview:{processingTitle:"Data is being processed",processingDetail:"A preview will be available after parsing. Reload later.",failedTitle:"Data parsing failed",failedDetail:"Check the source file or page URL and add it again, or reload the latest status.",noParsedTitle:"No parsed content is available yet",noParsedDetail:"Text, tables, or page images will appear after the knowledge base finishes parsing this file.",noMediaTitle:"No media preview is available yet",noMediaDetail:"The knowledge base has not returned an accessible media preview. Reload later.",noDataTitle:"No data is available to preview",noDataDetail:"The knowledge base has not returned parsed results. Reload later.",attachmentError:"The attachment cannot be previewed. Try again later.",imageAlt:"Knowledge data image",audioUnsupported:"This browser does not support audio previews.",videoUnsupported:"This browser does not support video previews.",namedPdf:"{{name}} PDF preview",pdf:"PDF preview",openPdf:"If it cannot be displayed, open the PDF in a new window",fileUnsupported:"This format cannot be previewed directly online. Parsed content is shown when available.",openOriginalFile:"Open original file",loading:"Loading data preview",openOriginalHint:"You can open the original page to view the source content.",chunk:"Chunk {{index}}",loadingMore:"Loading more",loadMore:"Load more"},errors:{fileTooLarge:"A file cannot exceed 200 MB",invalidImageType:"Select a PNG, JPG, or JPEG image",invalidDocumentType:"Select a PDF, PPTX, DOCX, XLSX, or TXT file",createBase:"Unable to create the knowledge base",updateBase:"Unable to update the knowledge base",metadataObject:"Metadata must be a JSON object",metadataFormat:"Invalid metadata format",noWebPreview:"The page has no Markdown content to preview",addWeb:"Unable to add the web page",previewWeb:"Unable to generate the web page preview",uploadFile:"Unable to upload the file",updateDocument:"Unable to update the knowledge item",loadPreview:"Unable to load the data preview",loadMoreBases:"Unable to load more knowledge bases",loadBases:"Unable to load knowledge bases",loadMoreData:"Unable to load more data",loadData:"Unable to load data",deleteBase:"Unable to delete the knowledge base",deleteDocument:"Unable to delete the knowledge item"}},hge={title:"Feishu channel",refresh:"Refresh",loading:"Loading channel configuration…",unsupported:"This Runtime does not support channel management. Upgrade its MPA image.",unauthorized:"Channel management requires a Studio administrator and an authorized Runtime credential.",configurationError:"Channel management configuration is incomplete. Check the Runtime metadata and encryption key.",requestFailed:"Channel request failed. Check the Runtime connection and retry.",bound:"Bound: {{name}}",unbound:"No Feishu bot is bound.",guidance:"Private chats use separate conversations. In allowed groups, mention this bot to start a conversation.",keyRequired:"Configure a persistent CHANNEL_STATE_ENCRYPTION_KEY in the Runtime before binding.",gateway:"Message gateway",route:"Inbound route",delivery:"Reply delivery",configured:"Configured",missing:"Missing",delivery_not_observed:"Not observed",delivery_delivered:"Delivered",delivery_retrying:"Retrying",missingConfig:"Missing Runtime configuration: {{fields}}",bind:"Bind with QR code",newQr:"Generate a new QR code",unbind:"Unbind",confirmUnbind:"Disconnect this bot? It will stop receiving new messages.",qrAlt:"Bot authorization QR code",openQr:"Open authorization page",uncertain:"Registration was interrupted. Check the bot binding and Gateway before starting again.",bindingFailed:"Binding failed. Check Gateway configuration and retry.",chatId:"Allowed group ID",scope:"Group conversation scope",saveGroup:"Save group",noGroups:"No groups allowed yet. Private chats do not need this permission.",edit:"Edit",remove:"Remove",removeGroup:"Remove {{name}}",scope_group_sender:"Separate by sender",scope_group:"Shared by group",scope_group_topic_sender:"Separate by topic and sender",scope_group_topic:"Shared by topic",status_PENDING:"Waiting for scan",status_SCANNED:"Scanned; waiting for authorization",status_AUTHORIZED:"Authorized; preparing registration",status_REGISTERING:"Registering bot",status_BOUND:"Bot bound",status_FAILED:"Binding failed",status_EXPIRED:"QR code expired",workspaceTitle:"Message channels",workspaceDescription:"Connect messaging apps to this Agent and manage access.",provider_feishu:"Feishu",provider_wecom:"WeCom",provider_dingtalk:"DingTalk",comingSoon:"Not available yet",unavailableDescription:"Binding and message settings for {{name}} are not available yet.",runtimeRequired:"Deploy this Agent to a Runtime before configuring message channels.",bindingTitle:"Bot connection",connected:"Bound",notBound:"Not bound",gatewayDescription:"Gateway configuration for receiving channel messages.",routeDescription:"Routing configuration for delivering messages to this Agent.",deliveryDescription:"Observed reply delivery; configuration alone does not confirm delivery.",groupsTitle:"Group access",groupsDescription:"Allow specific groups and choose how conversations are shared.",providerBindingTitle:"Connect {{name}}",providerUnbound:"Connect a {{name}} bot to let users message this agent.",qrGuidance:"Authorize with {{name}}. The Runtime saves the bot credentials and configures the message gateway.",wecomGuidance:"Authorize with WeCom QR code, or enter a Bot ID and Secret to bind an existing bot.",wecomBotId:"Bot ID",wecomSecret:"Secret",bindCredentials:"Connect bot",wecomScan:"Bind with QR code",wecomAuthorizing:"Waiting for WeCom authorization…",cancelAuthorization:"Cancel authorization",wecomPopupBlocked:"Allow popups in your browser, then try authorizing again.",wecomAuthCancelled:"WeCom authorization was cancelled. You can scan again.",wecomAuthTimeout:"WeCom authorization timed out. Please scan again.",wecomInvalidResult:"Authorization did not return a Bot ID and Secret. Authorize again or enter them manually.",wecomAuthFailed:"WeCom authorization failed. Try again or enter credentials manually.",dingtalkClientId:"Client ID",dingtalkClientSecret:"Client Secret",manualUpgrade:"Upgrade this Runtime image to configure {{name}} manually. Quick setup is still available.",pairingTitle:"Message channel QR pairing",feishuPairingDescription:"If a bot is already connected, it will be replaced after successful Feishu authorization and binding. In the authorization flow, you can bind an existing bot or create a new one.",generatingQr:"Generating pairing QR code…",dingtalkGuidance:"Authorize with DingTalk QR code, or enter a Client ID and Client Secret to bind an existing bot.",wecomPairingDescription:"Pair again in the WeCom authorization window. The new bot replaces the current connection after binding succeeds. Cancelling authorization or a failed binding does not disconnect the existing bot.",configurationMethod:"Configuration method",quickSetup:"Quick setup",manualSetup:"Manual setup",feishuAppId:"App ID",feishuAppSecret:"App Secret",manualGuidance:"Enter the credentials of an existing {{name}} bot to connect it to this agent.",manualReplacement:"Successful binding replaces the current bot. Cancelling or a failed binding does not disconnect the existing bot.",accountsTitle:"Feishu bots",account:"Bot",selectAccount:"Select a bot",accountEnabled:"Enabled",accountDisabled:"Disabled",addAccount:"Add bot",cancelAddAccount:"Cancel adding",enableAccount:"Enable bot",disableAccount:"Disable bot",noAccounts:"No Feishu bots are bound.",accountsFailed:"Could not load bots. Try again.",accountConflict:"The bot account is ambiguous or conflicts with its configuration. Refresh and select a bot.",multiBotPairingDescription:"Binding a new Feishu app adds a bot. Binding the same App ID updates that bot."},gVe={common:Hme,agentKitPromo:qme,systemInfo:Wme,agentWorkspace:Kme,environmentCenter:Gme,deploymentSelect:Xme,deploymentError:Yme,studioBuildProgress:Zme,cloudEnvironment:Jme,githubCicd:ege,feishuDeployment:tge,deploymentResources:nge,studioUpdate:ige,projectPreview:rge,workspace:sge,resourceCollection:age,skillSourcePicker:oge,composer:lge,agentSelector:cge,myAgents:uge,skillCenter:dge,knowledge:fge,channels:hge},bVe=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:qme,agentSelector:cge,agentWorkspace:Kme,channels:hge,cloudEnvironment:Jme,common:Hme,composer:lge,default:gVe,deploymentError:Yme,deploymentResources:nge,deploymentSelect:Xme,environmentCenter:Gme,feishuDeployment:tge,githubCicd:ege,knowledge:fge,myAgents:uge,projectPreview:rge,resourceCollection:age,skillCenter:dge,skillSourcePicker:oge,studioBuildProgress:Zme,studioUpdate:ige,systemInfo:Wme,workspace:sge},Symbol.toStringTag,{value:"Module"})),pge="User management",mge="{{count}} members",gge="User",bge="Role",yge="Account status",vge="Last sign-in",xge="Actions",wge="Change role",Oge="Close",kge="Save role",Sge="Saving…",Ege="Cancel",Cge="Back",Age="User pool",Tge="Volcengine Identity",_ge="Search name, email or user ID",jge="Search",Nge="Filter by role",Rge="All roles",Ige="Refresh",Pge="Loading users…",Dge="Updated at {{time}}",Mge="{{name}} is now {{role}}",Lge="Retry",$ge="You",Fge="Initial super administrator",Bge="The initial super administrator cannot be demoted here",Uge="The new permissions apply when the user refreshes Studio",Qge="Role needs confirmation",zge="No matching users",Vge="Try another search or role",Hge="Users appear here after signing in or joining this user pool",qge="{{count}} users",Wge="Previous",Kge="Next",Gge="Not signed in yet",Xge="Not provided",Yge={super_admin:"Super administrator",admin:"Administrator",developer:"Developer",user:"User"},Zge={super_admin:"Manage all resources, users and role assignments",admin:"Manage Studio resources",developer:"Develop agents and manage your own resources",user:"Use agents and personal features"},Jge={EXTERNAL_PROVIDER:"Active",CONFIRMED:"Active",NORMAL:"Active",ENABLED:"Active",ACTIVE:"Active",UNCONFIRMED:"Unverified",DISABLED:"Disabled",FORBIDDEN:"Disabled",LOCKED:"Locked",SUSPENDED:"Suspended",FORCE_CHANGE_PASSWORD:"Password change required"},ebe={request_failed:"The request did not finish. Refresh the list to confirm its current state before retrying",invalid_response:"The user service returned an invalid response. Refresh and try again",identity_unavailable:"Identity is unavailable. Try again later or check service permissions",identity_resource_missing:"The user or user pool no longer exists. Refresh the list",super_administrator_required:"Only super administrators can manage users",sign_in_required:"Sign in and try again",user_not_in_pool:"Your account does not belong to this user pool",user_disabled:"Your account is disabled",protected_administrator:"The initial super administrator cannot be demoted",cannot_demote_self:"You cannot demote your own super administrator role",role_change_conflict:"The role has changed. Close this dialog and refresh the list before retrying",cross_origin_request:"Change roles from the current Studio page"},yVe={title:pge,memberCount:mge,user:gge,role:bge,status:yge,lastLogin:vge,actions:xge,changeRole:wge,close:Oge,save:kge,saving:Sge,cancel:Ege,back:Cge,pool:Age,volcengineIdentity:Tge,searchPlaceholder:_ge,search:jge,filterRole:Nge,allRoles:Rge,refresh:Ige,loading:Pge,updatedAt:Dge,saved:Mge,retry:Lge,you:$ge,initialAdministrator:Fge,protectedExplanation:Bge,effectiveAfterRefresh:Uge,roleConflict:Qge,noUsers:zge,tryAnotherSearch:Vge,poolEmpty:Hge,resultCount:qge,previous:Wge,next:Kge,neverLoggedIn:Gge,unknown:Xge,roles:Yge,descriptions:Zge,states:Jge,errors:ebe},vVe=Object.freeze(Object.defineProperty({__proto__:null,actions:xge,allRoles:Rge,back:Cge,cancel:Ege,changeRole:wge,close:Oge,default:yVe,descriptions:Zge,effectiveAfterRefresh:Uge,errors:ebe,filterRole:Nge,initialAdministrator:Fge,lastLogin:vge,loading:Pge,memberCount:mge,neverLoggedIn:Gge,next:Kge,noUsers:zge,pool:Age,poolEmpty:Hge,previous:Wge,protectedExplanation:Bge,refresh:Ige,resultCount:qge,retry:Lge,role:bge,roleConflict:Qge,roles:Yge,save:kge,saved:Mge,saving:Sge,search:jge,searchPlaceholder:_ge,states:Jge,status:yge,title:pge,tryAnotherSearch:Vge,unknown:Xge,updatedAt:Dge,user:gge,volcengineIdentity:Tge,you:$ge},Symbol.toStringTag,{value:"Module"})),tbe="Website integration",nbe="Embed an AgentKit Runtime on your website as a floating chat window",ibe="Back to automations",rbe="Add website",sbe="Loading Runtime",abe="Select Runtime",obe="Website domain",lbe="For example, xxxx.com or localhost:5173",cbe="Generating",ube="Generate token",dbe="Added websites",fbe="{{count}} website",hbe="{{count}} websites",pbe="Loading website integrations",mbe="No website integrations yet",gbe="Select a Runtime and enter a website domain to generate a token",bbe="Embed instructions",ybe="Place this code before the closing body tag on your website",vbe="Copied",xbe="Copy code",wbe="Embed code will appear here after you add a website.",Obe="Delete the website integration for {{domain}}?",kbe={load:"Failed to load website integrations",create:"Failed to create website integration",delete:"Failed to delete website integration",noConversationalAgent:"No conversational Agent was found in this Runtime"},Sbe={requestFailed:"Request failed ({{status}})",greeting:"Hello. How can I help?",sessionFailed:"Could not start a chat session",unauthorized:"This website is not authorized to start a chat",conversationFailed:"The chat request failed. Try again shortly.",open:"Open Agent chat",close:"Close Agent chat",panelLabel:"Agent chat panel",assistant:"Agent assistant",online:"Online"},xVe={title:tbe,description:nbe,backToAutomations:ibe,addWebsite:rbe,loadingRuntime:sbe,selectRuntime:abe,websiteDomain:obe,domainPlaceholder:lbe,generating:cbe,generateToken:ube,addedWebsites:dbe,websiteCount_one:fbe,websiteCount_other:hbe,loadingIntegrations:pbe,delete:"Delete",emptyTitle:mbe,emptyDescription:gbe,embedMethod:bbe,embedInstructions:ybe,copied:vbe,copyCode:xbe,embedHint:wbe,confirmDelete:Obe,errors:kbe,widget:Sbe},wVe=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:rbe,addedWebsites:dbe,backToAutomations:ibe,confirmDelete:Obe,copied:vbe,copyCode:xbe,default:xVe,description:nbe,domainPlaceholder:lbe,embedHint:wbe,embedInstructions:ybe,embedMethod:bbe,emptyDescription:gbe,emptyTitle:mbe,errors:kbe,generateToken:ube,generating:cbe,loadingIntegrations:pbe,loadingRuntime:sbe,selectRuntime:abe,title:tbe,websiteCount_one:fbe,websiteCount_other:hbe,websiteDomain:obe,widget:Sbe},Symbol.toStringTag,{value:"Module"})),Ebe={types:{all:"All types",document:"Documents",image:"Images",video:"Videos"},previewArtifact:"Preview {{name}}",moreActions:"More actions for {{name}}",actionMenu:"Actions for {{name}}",download:"Download",downloading:"Downloading",edit:"Edit details",delete:"Delete artifact",previewFailed:"Could not preview “{{name}}”: {{message}}",downloadStarted:"Download started for {{name}}",downloadFailed:"Could not download “{{name}}”: {{message}}",updated:"Updated {{name}}",deleted:"Deleted {{name}}",deleteFailed:"Could not delete “{{name}}”: {{message}}",typeFilter:"Artifact type",searchAria:"Search artifacts",searchPlaceholder:"Search artifacts or sessions",retry:"Retry",close:"Close",listAria:"Artifact list",loadFailed:"Could not load artifacts",loadDetailFallback:"Check the storage configuration and try again.",reload:"Reload",noMatch:"No matching artifacts",noArtifacts:"You do not have any artifacts yet",searchHint:"Try another search or artifact type",emptyHint:"Artifacts created in chats will appear here automatically",columns:{name:"Name",source:"Source",updatedAt:"Modified",actions:"Actions"},loadingMore:"Loading more artifacts",unknownTime:"Unknown time",preview:{close:"Close preview",meta:"{{type}} / Version {{version}}",loading:"Loading preview",alt:"Preview of {{name}}",loadFailed:"The preview could not be loaded. Try again later or download the file.",unsupported:"This format cannot be previewed online. Download the file to view it.",sourceAria:"Artifact source",agent:"Agent",session:"Session",tool:"Generated by",createdAt:"Created",fileSize:"File size",tags:"Tags",viewSession:"View session"},deleteDialog:{title:"Delete artifact?",description:"“{{name}}” will be permanently removed from the artifact library. The chat history will not be affected.",deleting:"Deleting",confirm:"Delete",close:"Close delete confirmation"},api:{withStatus:"{{message}} ({{status}})",listFailed:"Could not load the artifact library",syncFailed:"Could not sync chat artifacts",updateFailed:"Could not update the artifact",deleteFailed:"Could not delete the artifact",downloadFailed:"Could not download the artifact"}},Cbe={unknownSource:"Unknown source",unknownCreator:"Unknown creator"},Abe={nameRequired:"Enter an artifact name",tooManyTags:"You can add up to {{max}} tags",tagTooLong:"Each tag can contain up to {{max}} characters",title:"Edit artifact details",subtitle:"The content file will not be modified",close:"Close edit dialog",name:"Name",description:"Description",descriptionPlaceholder:"Add its purpose, version, or usage notes",tags:"Tags",tagsPlaceholder:"Separate tags with commas, up to {{max}}",cancel:"Cancel",saving:"Saving",save:"Save"},Tbe={change:{added:"Added",modified:"Modified",deleted:"Deleted"},noChanges:"There are no source changes between these versions",chooseFile:"Select a file on the left to view its code",compareTitle:"Compare versions",workspaceTitle:"Source workspace",projectFallback:"Agent project",switchTheme:"Switch source theme",switchThemeTitle:"Switch to {{theme}} theme",themes:{dark:"dark",light:"light"},closeWorkspace:"Close source workspace",close:"Close",changedFiles:"Changed files",projectFiles:"Project files",changes:"Changes",files:"Files",openFiles:"Open files",noFileSelected:"No file selected",comparisonDirection:"Comparison direction",before:"Before optimization",after:"After optimization",loadingEditor:"Loading editor…",changedFileCount_one:"{{count}} file changed",changedFileCount_other:"{{count}} files changed",fileCount_one:"{{count}} file",fileCount_other:"{{count}} files",lineCount_one:"{{count}} line · UTF-8",lineCount_other:"{{count}} lines · UTF-8",viewSource:"View source",viewSourceAria:"View and edit project source"},_be={nav:"Search",selectAgent:"Select an Agent",checkingCapabilities:"Checking Agent capabilities",notMounted:"This Agent does not have {{label}} mounted",sources:{session:"Sessions",web:"Web",knowledge:"Knowledge base",memory:"Long-term memory"},webDescription:"Search with the web_search tool",backendLocal:"Local",failed:"Search failed: {{message}}",placeholder:{selectAgent:"Select an Agent first",web:"Search the web",knowledge:"Search {{name}}",knowledgeFallback:"this Agent's knowledge base",memory:"Search {{name}}",memoryFallback:"this user's long-term memory",session:"Search this Agent's sessions"},sourceTypeAria:"Search source: {{label}}",notSelected:"Not selected",sourceType:"Search source",selectSource:"Select a search source",noAgentHint:"Select an Agent to search its sessions, the web, and mounted data sources.",loadingCapabilities:"Loading this Agent's search capabilities…",sourceUnavailable:"This Agent does not have this data source mounted",instructions:{web:"Enter keywords and press Enter or select the button to search with web_search.",knowledge:"Enter a question to search this Agent's knowledge base.",memory:"Enter a clue to search long-term memories saved across this user's sessions.",session:"Enter keywords and press Enter or select the button to search this Agent's sessions."},noResults:"No results found for “{{query}}”.",knowledgeFragment:"Knowledge excerpt {{index}}",memoryFragment:"Memory excerpt {{index}}"},jbe={title:"Developer Resources",sections:{documentation:{title:"Related links",description:"Open development documentation and common AgentKit destinations"},bestPractices:{title:"Best practices",description:"Learn from practical development, debugging, and deployment guidance"},showcases:{title:"Showcases",description:"Explore applications built with AgentKit"}},links:{veadkDocs:"VeADK documentation",cliDocs:"AgentKit CLI documentation",platformDocs:"AgentKit platform documentation",console:"AgentKit console"},articles:{veadkDevelopment:{title:"Develop and deploy an Agent with VeADK",description:"Build an Agent with VeADK and deploy it to AgentKit Runtime."},cliDevelopment:{title:"Develop and deploy an Agent with AgentKit CLI",description:"Create a project, debug an Agent, and deploy it with AgentKit CLI."},coverAlt:"Cover image for {{title}}"},showcases:{researchAssistant:{title:"Multi-agent research assistant",description:"Specialized Agents work together to research, analyze, and summarize findings."},multimodalAnalysis:{title:"Multimodal content analysis",description:"Understand images, documents, and video in a single session."},customerService:{title:"Customer service workspace",description:"Combine knowledge retrieval and tool calls to handle complex support requests."},webSearch:{title:"Web search Agent",description:"Search current web content and organize it into traceable answers."},a2uiApp:{title:"A2UI interactive app",description:"Let an Agent generate interactive interfaces as it works through a task."},previewAlt:"Interface preview for {{title}}"}},Nbe={title:"Library",untitledSession:"Untitled session",categoryAria:"Library categories",regionAria:"Region",tabs:{skills:"Skills",knowledge:"Knowledge",artifacts:"Artifacts"}},Rbe={title:"Manage Agents",subtitle:"Agents in AgentKit Runtime that you can manage",mainAgentOnly:"Only the main Agent is shown (control-plane information).",deleteConfirm:'Delete Agent "{{name}}"? Its Runtime will be permanently deleted.',regionFilterTitle:"Filter by region",regionFilterAria:"Region filter",regionAria:"Region",refresh:"Refresh",loading:"Loading…",empty:"You have not deployed any Agents.",connected:"Connected",connect:"Connect to this Agent",deleteRuntime:"Delete this Runtime",loadingDetail:"Loading details…",agentStructure:"Agent structure",secretHidden:"Sensitive value is never shown. Copy it with an authorized request.",revealSecret:"Sensitive value for {{key}}",copySecret:"Copy the value of {{key}}",copy:"Copy",copied:"Copied",copyFailed:"Copy failed",notConfigured:"Not configured",fields:{model:"Model",description:"Description",status:"Status details",project:"Project",version:"Version",resources:"Resources",memory:"Memory",tool:"Tool",knowledge:"Knowledge",mcpToolset:"MCP Toolset",updatedAt:"Updated"},resource:{memory:"Memory {{value}} MB",instances:"Instances {{min}}-{{max}}",concurrency:"Concurrency {{value}}"},environmentVariables:"Environment variables",unnamed:"(Unnamed)"},Ibe={mainAgent:"Main Agent",subAgent:"Sub-agent {{index}}",itemCount_one:"{{count}} item",itemCount_other:"{{count}} items",info:"Agent information",infoAndTopology:"Agent information and settings",loadingInfo:"Loading Agent information…",unnamedAgent:"Unnamed Agent",agentsMd:"AGENTS.md",tools:"Tools",toolList:"Tool list",studioTool:"Studio Tool",removeTool:"Remove tool {{name}}",remove:"Remove",notConfigured:"Not configured",addStudioTool:"Add Studio tools",addStudioToolHere:"Add Studio tools to this chat",skills:"Skills",skillList:"Skill list",addSkill:"Add Skill Space skills",addSkillHere:"Add Skill Space skills to this Session",skillMountNextTurn:"Mounted versions are frozen when the next Turn starts.",previewUnsupported:"Preview is not supported",sessionEnvironment:"Session environment",environment:"Environment",agentCanvas:"Agent canvas",topology:"Structure",nodeKinds:{agent:"Agent",sandbox:"Sandbox","worker-session":"Worker Session","skill-space":"Skill Space",skill:"Skill","studio-tool":"Studio Tool",mcp:"MCP",environment:"Environment",knowledge:"Knowledge","sub-agent":"Sub-agent"},nodeStatuses:{configured:"Configured",mounted:"Mounted",running:"Running",paused:"Paused"},viewCanvasFullscreen:"View Agent canvas in full screen",viewFullscreen:"View full screen",executionCanvas:"Agent execution canvas",fullscreenExecutionCanvas:"Full-screen Agent execution canvas",closeFullscreenCanvas:"Close full-screen canvas",close:"Close",capabilitiesSubtitle:"Capabilities and collaboration topology",closeInfo:"Close Agent information",infoUnavailable:"Agent information is temporarily unavailable.",refresh:"Refresh information",loadingSkills:"Loading bound skills…",sessionSkills:"Temporary session skills",noBoundSpace:"This agent has no bound Skill Space.",noBoundSkills:"The bound Skill Space has no skills.",loadFailed:"Could not load this information. Refresh to retry.",accessDenied:"You do not have permission to read this information.",documentUnsupported:"Upgrade the Runtime image to enable Studio to read AGENTS.md.",skillsUnsupported:"This Runtime does not provide Skill Space bindings.",skillsDegraded:"Skill information is incomplete. Refresh to retry.",documentEditHint:"Edit the latest version. Saving publishes a new version to this Skill Space and can affect other agents using it. Running sessions may need a cache refresh or a new session. Keep the frontmatter name unchanged.",documentLoading:"Loading SKILL.md…",documentWritable:"Editable",documentReadOnly:"Read only — this space or your permissions do not allow editing",documentLoadFailed:"Could not load SKILL.md. Refresh to retry.",documentSaveFailed:"Save was not confirmed. Your edits are preserved. Reopen to check the current version before retrying.",documentConflict:"A newer version exists. Copy your edits, then reopen the editor to avoid overwriting it.",discardDocument:"Discard unsaved changes?",keepEditing:"Keep editing",discardChanges:"Discard changes",saveDocument:"Save new version"},Pbe={mountFailed:"Could not mount the environment",closeDialog:"Close environment dialog",addTitle:"Add environments",description:"Choose the Sandbox environments this Agent can use in the current session",closeAdd:"Close Add environments",searchAria:"Search environments",searchPlaceholder:"Search environment names or capabilities",availableAria:"Available environments and workspaces",loading:"Loading available environments…",noMatch:"No matching environments or workspaces",workspaces:"Workspaces",reuseAll:"Use every available environment in this workspace",availableEnvironmentCount_one:"{{count}} available environment",availableEnvironmentCount_other:"{{count}} available environments",selectWorkspace:"Select workspace {{name}}",environments:"Environments",includedByWorkspaces:"Included by workspace {{names}}",nameSeparator:", ",selectEnvironment:"Select environment {{name}}",selectedWorkspaceCount_one:"{{count}} workspace selected",selectedWorkspaceCount_other:"{{count}} workspaces selected",coveredEnvironmentCount_one:"{{count}} environment covered",coveredEnvironmentCount_other:"{{count}} environments covered",selectionSummary:"{{workspaces}}, {{environments}}",cancel:"Cancel",mounting:"Mounting…",confirm:"Add selected",mountedAria:"Mounted environments",environmentCount_one:"{{count}} environment",environmentCount_other:"{{count}} environments",removeWorkspace:"Remove workspace {{name}}",remove:"Remove",removeEnvironment:"Remove environment {{name}}",add:"Add environments",addMore:"Add more environments",addForSession:"Add environments to this session",loadingAvailable:"Loading available environments…",empty:"No AIO Sandbox environments are available."},Dbe={loading:{searching:"Looking for an existing environment",creating:"Initializing environment",connecting:"Connecting to the environment"},initializationFailed:"AgentKit CLI environment initialization failed. Current status: {{status}}.",sessionExpired:"The AgentKit CLI session does not exist or has expired. Try again.",initializationTimeout:"AgentKit CLI environment initialization timed out. Try again later.",nonPersistent:"Non-persistent environment",recyclingHoursMinutes:"Environment reclaimed in {{hours}} hr {{minutes}} min",recyclingMinutes:"Environment reclaimed in {{minutes}} min",connectionError:`Could not connect to the Studio service because the server did not respond. +Original error: {{message}}`,unavailable:"Connection unavailable",requestFailed:"AgentKit CLI request failed",retry:"Retry",terminalTitle:"AgentKit CLI terminal"},Mbe={labels:{coding:"Coding",get_city_weather:"City weather",get_location_weather:"Location weather",web_fetch:"Fetch web content",studio_write_artifact:"Save session artifact"},closeDialog:"Close dialog",title:"Add Studio tools",description:"Studio BFF runs these tools for {{agentName}} in the current session. No Runtime installation is required.",close:"Close Add Studio tools",searchAria:"Search Studio tools",searchPlaceholder:"Search by name or tool ID",availableAria:"Available Studio tools",loading:"Loading Studio tools…",noMatch:"No matching Studio tools",remove:"Remove",add:"Add"},Lbe={artifactLibrary:Ebe,resourceMetadata:Cbe,artifactEdit:Abe,codeBrowser:Tbe,search:_be,developerResources:jbe,library:Nbe,manageAgents:Rbe,agentTopology:Ibe,sessionEnvironment:Pbe,agentKitCli:Dbe,studioTools:Mbe},OVe=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:Dbe,agentTopology:Ibe,artifactEdit:Abe,artifactLibrary:Ebe,codeBrowser:Tbe,default:Lbe,developerResources:jbe,library:Nbe,manageAgents:Rbe,resourceMetadata:Cbe,search:_be,sessionEnvironment:Pbe,studioTools:Mbe},Symbol.toStringTag,{value:"Module"})),$be={requestFailed:"请求失败 ({{status}})",unknownError:"未知错误",contentTypeMissing:"Content-Type 缺失",response:"响应:{{response}}",fallbackWithDetail:"{{fallback}}:{{detail}}",fallbackWithHttpStatus:"{{fallback}}(HTTP {{status}})",nonJsonResponse:"{{fallback}}:服务端返回非 JSON 响应({{contentType}})"},Fbe={unconfigured:"管理员未配置 AgentKit Dev Sandbox,请配置后再使用",invalidSession:"AgentKit CLI 返回了无效的 Session。",loadCapabilitiesFailed:"无法读取 AgentKit CLI 配置。",invalidCapabilities:"AgentKit CLI 返回了无效的配置状态。",listSessionsFailed:"无法读取 AgentKit CLI Session。",invalidSessionList:"AgentKit CLI 返回了无效的 Session 列表。",createSessionFailed:"无法创建 AgentKit CLI Session。",openSessionFailed:"无法打开 AgentKit CLI Session。",openTerminalFailed:"无法打开 AgentKit CLI 终端。",invalidTerminalUrl:"AgentKit CLI 返回了无效的终端地址。"},Bbe={cnBeijing:"华北 2(北京)",cnShanghai:"华东 2(上海)"},Ube={runtimeUnsupported:"该 Runtime 暂不支持连接,请确认服务已正常运行。"},Qbe={autoConfigureFailed:"飞书机器人自动配置失败"},zbe={actionFailed:"{{action}}失败",detail:"详细信息:{{detail}}",request:"请求:{{request}}"},Vbe={persistentMemoryHint:"提示:会话已不存在。使用 in-memory 或 SQLite 短期记忆时,多实例、进程重启或滚动发布都可能导致会话丢失;建议改用基于数据库的持久化短期记忆存储。",unsupportedRouteHint:"提示:该 Runtime 未提供会话能力运行接口,可能是 Runtime 版本与当前 Studio 不兼容。",toolArgumentHint:"提示:模型生成的工具参数格式不完整,请重新发送一次。",resourceCollectionExpiredHint:"提示:本次资源清单已失效,请重新发送任务;系统会重新收集资源后再创建 Agent。",networkConfigurationHint:"提示:请稍后重试,查看 Runtime、模型或网关日志。",modelQuotaHint:"提示:模型当前触发了 TPM/RPM 配额限制,请稍后重试或提高模型配额。",rawResponseLabel:"原始响应:",copySecretFailed:"复制敏感值失败"},Hbe={httpStatus:"HTTP 状态码:{{status}}",errorCode:"错误码:{{code}}",cloudResponseBody:`云端响应正文: +{{body}}`,loadFailedWithDetail:"读取实例日志失败:{{detail}}",invalidFormat:"读取实例日志失败:服务返回格式无效"},qbe={untitledSession:"未命名会话",webUnavailable:"网络搜索接口未就绪(后端未启用 /web/search)。",webFailed:"网络搜索失败:{{message}}",webNotMounted:"当前 Agent 未挂载 web_search 工具。",knowledgeNotMounted:"该 Agent 未挂载知识库。",memoryNotMounted:"该 Agent 未挂载长期记忆。",knowledge:"知识库",longTermMemory:"长期记忆"},Wbe={listSpacesFailed:"读取 Skill 空间失败",createSpaceFailed:"创建 Skill 空间失败",updateSpaceFailed:"更新 Skill 空间失败",deleteSpaceFailed:"删除 Skill 空间失败",uploadFailed:"上传 Skill 失败",validateFailed:"校验 Skill 失败",deleteFailed:"删除 Skill 失败",listFilesFailed:"读取 Skill 文件失败",downloadFailed:"下载 Skill 失败",sharedSpaceFailed:"共享空间加载失败",reservedSpaceName:"此名称由系统空间保留,请使用其他名称",reviewSpaceFailed:"待审核空间暂不可用",submitReviewFailed:"申请公开失败",listReviewsFailed:"加载审核申请失败",reviewFilesFailed:"加载提交文件失败",decideReviewFailed:"审批失败,请重试",listVersionsFailed:"无法加载技能版本",uploadVersionFailed:"上传技能新版本失败"},Kbe={truncatedData:"{{data}}…(已截断,共 {{count}} 个字符)",incompleteEvent:"SSE 流在事件完整返回前已结束。原始数据:{{data}}",invalidEventJson:"无法解析 SSE 事件中的 JSON。原始数据:{{data}}"},Gbe={loadConfigNetworkFailed:"无法加载登录配置,请检查网络后重试。",configServiceFailed:"登录配置服务异常(HTTP {{status}}),请稍后重试。",invalidConfigResponse:"登录配置服务返回了无法解析的响应,请稍后重试。",serviceNetworkFailed:"无法连接身份服务,请检查网络后重试。",invalidServiceResponse:"身份服务返回了无法解析的响应,请稍后重试。",serviceFailed:"身份服务异常(HTTP {{status}}),请稍后重试。"},Xbe={invalidToken:"GitHub Token 无效或没有仓库写入权限",notFound:"仓库、分支或文件不存在,或 Token 无权访问",rejectedCommit:"GitHub 拒绝了提交,请检查分支和文件状态",requestFailed:"GitHub 请求失败(HTTP {{status}})",networkFailed:"连接 GitHub 失败,请检查网络后重试",invalidRepositoryFormat:"GitHub Repo 格式应为 owner/repository",insecureRepositoryUrl:"仅支持安全的 github.com 仓库地址",unsafeProjectPath:"Agent 项目目录必须是仓库内的安全相对路径",tokenRequired:"GitHub Token 不能为空",invalidBaseBranch:"目标分支格式不正确",invalidPublishBranch:"发布分支格式不正确",noFiles:"没有需要提交的文件",missingBaseSha:"目标分支缺少有效 Git SHA",fileAlreadyExists:"目标仓库中已存在 {{path}},未覆盖现有文件",pathNotUpdatable:"目标路径 {{path}} 不是可更新的文件",invalidPullRequest:"GitHub 未返回有效的 Pull Request"},Ybe={loadCapabilitiesFailed:"加载视频模型能力失败",uploadAssetFailed:"上传{{fileName}}失败",enhancePromptFailed:"提示词优化失败",createTaskFailed:"创建视频生成任务失败",getTaskFailed:"查询视频生成任务失败",downloadFailed:"下载生成视频失败"},Zbe={listFailed:"加载网站集成失败",createFailed:"创建网站集成失败",deleteFailed:"删除网站集成失败"},Jbe={loadFailed:"读取知识库失败",htmlHidden:"[HTML 内容已隐藏]",redacted:"[已脱敏]",depthTruncated:"[内容过深,已截断]",circularReference:"[循环引用]",diagnosticsUnavailable:"[诊断信息无法显示]",statusCode:"状态码:{{status}}",errorCode:"错误码:{{code}}",requestId:"请求 ID:{{requestId}}",diagnostics:"诊断:{{diagnostics}}",detail:"详情:{{detail}}",signInRequired:"请先登录后再访问知识库",forbidden:"你没有权限操作这个知识库",notFound:"知识库或知识内容不存在",conflict:"知识库当前状态不允许执行此操作",requestFailed:"知识库请求失败 ({{status}})"},eye={invalidName:"名称须为 1~128 个字符,不能包含控制字符、不可见格式字符或 < >。",renameProjectFailed:"修改项目名称失败",renameVersionFailed:"修改版本名称失败",invalidNameUpdateResponse:"名称更新响应与请求不一致,请刷新后重试。",invalidSourceSnapshot:"源码快照的响应格式无效。",invalidProjectList:"项目列表的响应格式无效。",invalidProjectVersion:"项目版本的响应格式无效。",loadProjectsFailed:"无法读取已保存项目",loadVersionsFailed:"无法读取项目版本",deleteVersionFailed:"删除项目版本失败",invalidDeleteVersionResponse:"删除项目版本的响应格式无效。",loadProjectSourceFailed:"无法读取项目源码",loadSnapshotFailed:"无法读取源码快照",restoreSnapshotFailed:"无法恢复当前源码快照",downloadSourceFailed:"下载源码失败",downloadNotZip:"源码下载响应不是 ZIP 文件。",downloadSizeMismatch:"源码压缩包大小与发布记录不一致,请重试。"},tye={invalidFormat:"{{label}}格式错误。",validationSeparator:";",invalidAnalysisResult:"迁移分析结果格式错误。",invalidFrameworkCandidate:"框架候选格式错误。",invalidAnalysisEvidence:"分析证据格式错误。",invalidEntryCandidate:"入口候选格式错误。",invalidQuestion:"待确认问题格式错误。",invalidPendingInput:"分析问题无法读取",invalidTask:"迁移会话格式错误。",invalidAnalysisReference:"分析结果引用格式错误。",invalidSourcePersistence:"迁移源码保存状态格式错误。",invalidActivity:"迁移执行动态格式错误。",invalidActivityItem:"迁移执行动态项格式错误。",invalidActivityTool:"迁移执行工具项格式错误。",invalidActivityPlan:"迁移执行计划格式错误。",invalidActivityPlanItem:"迁移执行计划项格式错误。",invalidArtifact:"迁移产物格式错误。",invalidEnvironmentDefaults:"环境变量默认值格式错误。",invalidArtifactFile:"迁移产物文件格式错误。",invalidVerificationCheck:"迁移校验项格式错误。",requestValidationFailed:"请求参数校验失败:{{detail}}",gatewayError:"{{fallback}}(HTTP {{status}},Content-Type: {{contentType}})。请检查代理或网关配置。",nonJsonResponse:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}})。请检查代理或网关配置。",loadCapabilitiesFailed:"读取迁移能力失败",invalidCapabilities:"迁移能力格式错误。",invalidModelCapabilities:"迁移模型能力格式错误。",loadTasksFailed:"读取迁移会话失败",invalidTaskList:"迁移会话列表格式错误。",createTaskFailed:"创建迁移会话失败",uploadProjectFailed:"上传迁移项目失败",loadActivityFailed:"读取迁移执行动态失败",loadEventsFailed:"订阅迁移进度流失败",invalidEventsResponse:"迁移进度流返回了非法数据帧。",reconnecting:"连接已断开,正在重新连接迁移进度流…",startFailed:"启动迁移失败",submitAnswersFailed:"提交分析补充信息失败",submitInputFailed:"提交分析回答失败",stopFailed:"终止迁移失败",deleteTaskFailed:"删除迁移会话失败",loadArtifactFailed:"读取迁移产物失败",loadArtifactFileFailed:"读取迁移产物文件失败",downloadArtifactFailed:"下载迁移产物失败",evaluation:{datasetSaveFailed:"保存评测用例失败",datasetLoadFailed:"读取评测用例失败",statusLoadFailed:"读取评测状态失败",resumeFailed:"继续评测失败",retryFailed:"重新评测失败",reportLoadFailed:"读取评测报告失败",reportDownloadFailed:"下载评测报告失败"},labels:{analysisResult:"迁移分析结果",recommendation:"迁移建议",boundary:"迁移边界",frameworkCandidate:"框架候选",analysisEvidence:"分析证据",recommendedFramework:"推荐框架",entryCandidate:"入口候选",entryFramework:"入口框架",includeScope:"迁移包含范围",excludeScope:"迁移排除范围",assumptions:"分析假设",question:"待确认问题",analysisWarnings:"迁移警告",task:"迁移会话",artifactStatus:"迁移产物状态",analysisReference:"分析结果引用",confirmation:"迁移确认",confirmedFramework:"确认框架",error:"迁移错误",sourcePersistence:"迁移源码保存状态",activity:"迁移执行动态",activityItem:"迁移执行动态项",activityTool:"迁移执行工具项",activityPlanItem:"迁移执行计划项",artifact:"迁移产物",cli:"CLI 信息",migration:"迁移信息",startup:"启动信息",environment:"环境变量信息",verification:"校验信息",report:"迁移报告",archive:"产物归档",environmentDefaults:"环境变量默认值",requiredEnvironment:"必需环境变量",optionalEnvironment:"可选环境变量",artifactFile:"迁移产物文件",verificationCheck:"迁移校验项",artifactWarnings:"迁移产物警告",errorResponse:"错误响应",errorDetail:"错误详情",capabilities:"迁移能力",framework:"迁移框架",modelCapabilities:"迁移模型能力",taskList:"迁移会话列表",evaluationAsset:"评测资产",evaluation:"评测状态",evaluationCapabilities:"评测能力",evaluationDimension:"评测维度",evaluationCase:"评测用例",evaluationCriteria:"评测标准",evaluationMessage:"评测对话",evaluationDataset:"评测数据集",evaluationDimensionResult:"评测维度结果",evaluationEvidence:"评测证据",evaluationReport:"评测报告",evaluationSummary:"评测汇总",evaluationCaseResult:"评测用例结果",evaluationOutput:"评测输出",evaluationLimitations:"评测限制",pendingInput:"分析提问",pendingQuestion:"分析问题项",pendingOption:"分析问题选项"}},nye={status:{ready:"就绪",wakeable:"已休眠",creating:"创建中",starting:"启动中",pending:"等待中",running:"运行中",failed:"异常",stopped:"已停止",expired:"已过期",deleting:"删除中",deleted:"已删除",unknown:"未知状态"},developmentTimeout:"等待开发环境响应超时。任务可能仍在运行,请稍后重新进入当前会话查看状态。",developmentDisconnected:"与开发环境的连接已中断。任务可能仍在运行,请稍后重新进入当前会话查看状态。",developmentFailed:"开发任务未能继续,开发环境已保留。请在当前会话重试。",invalidStudioResponse:"{{fallback}} Studio 服务响应异常,请刷新后重试。",invalidSession:"AgentKit 沙箱返回了无效的 Session 信息。",invalidSnapshot:"AgentKit 沙箱返回了无效的 Snapshot 信息。",invalidSettings:"Sandbox 返回了无效设置。",invalidThreadSnapshot:"Sandbox 返回了无效 Thread 快照。",emptyConversationResponse:"沙箱对话服务未返回内容。",invalidConversationResponse:"沙箱对话服务返回了无法解析的响应。",conversationFailed:"沙箱对话失败,请稍后重试。",emptyReply:"沙箱未返回有效回复,请重试。",missingSession:"缺少要操作的 AgentKit Session。",listCodexFailed:"无法读取 Codex 智能体,请稍后重试。",invalidSessionList:"AgentKit 沙箱返回了无效的 Session 列表。",invalidSnapshotList:"AgentKit 沙箱返回了无效的 Snapshot 列表。",startFailed:"无法启动 AgentKit 沙箱,请稍后重试。",listAgentFailed:"无法读取 {{kind}} 智能体,请稍后重试。",invalidKindSessionList:"AgentKit 返回了无效的 {{kind}} Session 列表。",invalidKindSnapshotList:"AgentKit 返回了无效的 {{kind}} Snapshot 列表。",createAgentFailed:"无法创建 {{kind}} 智能体,请稍后重试。",missingSessionToOpen:"缺少要打开的 AgentKit Session。",openAgentFailed:"无法打开 {{kind}} 智能体。",invalidAgentHomeUrl:"{{kind}} 智能体返回了无效的主页面地址。",missingSessionForTerminal:"缺少要打开 Terminal 的 AgentKit Session。",openTerminalFailed:"无法打开 {{kind}} Terminal。",deleteAgentFailed:"无法删除 {{kind}} 智能体。",missingSnapshot:"未找到要唤醒的智能体。",resumeSnapshotFailed:"无法唤醒智能体,请稍后重试。",deleteSnapshotFailed:"无法删除智能体,请稍后重试。",missingSessionToConnect:"缺少要连接的 AgentKit Session。",connectCodexFailed:"无法连接 Codex 智能体,请稍后重试。",sessionNotReady:"AgentKit Session 尚未就绪,当前状态:{{status}}。",invalidMessage:"内置智能体会话缺少有效的消息内容。",interruptFailed:"无法停止当前任务。",getStatusFailed:"无法读取 Codex 状态。",getEndpointFailed:"无法读取 Sandbox Endpoint。",invalidEndpoint:"Sandbox 返回了无效 Endpoint。",createHandoffPairingFailed:"无法生成 Codex 云端接力配对码。",invalidHandoffPairing:"Studio 返回了无效的 Codex 云端接力配对码。",getHandoffStatusFailed:"无法读取端云接力状态。",invalidHandoffStatus:"Studio 返回了无效的端云接力状态。",listModelsFailed:"无法读取 Codex 模型列表。",invalidModelList:"Sandbox 返回了无效模型列表。",setModelFailed:"无法切换 Codex 模型。",invalidModel:"Sandbox 返回了无效模型。",listSkillsFailed:"无法读取 Codex Skills。",invalidSkillList:"Sandbox 返回了无效 Skill 列表。",listThreadsFailed:"无法读取 Codex Thread 列表。",invalidThreadList:"Sandbox 返回了无效 Thread 列表。",createThreadFailed:"无法创建新的 Codex Thread。",missingThread:"缺少要读取的 Codex Thread。",readThreadFailed:"无法读取 Codex 历史消息。",resumeThreadFailed:"无法恢复 Codex Thread。",forkThreadFailed:"无法分叉 Codex Thread。",archiveThreadFailed:"无法归档 Codex Thread。",invalidArchiveResult:"Sandbox 返回了无效归档结果。",deleteThreadFailed:"无法删除 Codex Thread。",invalidDeleteResult:"Sandbox 返回了无效删除结果。",compactThreadFailed:"无法压缩 Codex Thread。",getSettingsFailed:"无法读取 Codex 权限与工作空间。",updatePermissionsFailed:"无法更新 Codex 权限。",updateWorkspaceFailed:"无法更新 Codex 工作空间。",invalidWorkingDirectory:"Sandbox 返回了无效工作目录。",listDirectoriesFailed:"无法读取 Sandbox 目录。",invalidDirectoryList:"Sandbox 返回了无效目录列表。",resolveApprovalFailed:"无法提交 Codex 审批决定。",uploadFileFailed:"无法上传文件到 Sandbox。",invalidUploadResult:"Sandbox 返回了无效上传结果。",disconnectCodexFailed:"无法断开 Codex 智能体连接。",deleteCodexFailed:"无法删除 Codex 智能体。",openSandboxTerminalFailed:"无法打开 Sandbox Terminal。",openSandboxBrowserFailed:"无法打开 Sandbox Browser。",toolLabel:"Sandbox 工具",invalidToolUrl:"{{label}} 返回了无效地址。",unsafeToolUrl:"{{label}} 返回了不安全的地址。"},iye={invalidSandboxVersion:"沙箱版本响应格式无效",loadSandboxVersionsFailed:"查询沙箱版本失败",updateSandboxFailed:"更新 Sandbox 失败",invalidSandboxUpdate:"沙箱更新响应格式无效",errorWithDetailAndRawResponse:`{{context}} {{detail}} 响应详情: {{response}}`,errorWithRawResponse:`{{context}} @@ -40,20 +40,20 @@ Original error: {{message}}`,unavailable:"Connection unavailable",requestFailed: {{detail}}`,mpaRuntimeSessionsLoadFailed:"加载 MPA Runtime Session 失败",mpaDeletePreviewFailed:"加载 MPA 删除预览失败",loadMpaDiagnosticsFailed:"加载 MPA Runtime 诊断失败",mpaExecutionConfigFailed:"更新 MPA 会话配置失败",deploymentDisconnected:"部署失败:连接中断",deploymentMissingAgentName:"部署失败:返回缺少 Agent 名称",deploymentMissingConnection:"部署失败:返回缺少 AgentKit 连接信息",cancelDeploymentFailed:"取消部署失败 ({{status}})",loadFailed:"加载失败 ({{status}})",loadPermissionsFailed:"加载权限失败 ({{status}})",invalidPermissionResponse:"权限服务返回了无法解析的响应",checkStudioUpdateFailed:"检查 Studio 更新失败 ({{status}})",studioUpdatePreflightFailed:"Studio 更新权限预检失败 ({{status}})",submitStudioUpdateFailed:"提交 Studio 更新失败 ({{status}})",loadAgentUsageFailed:"加载 Agent 用量失败",notProvided:"未提供",agentUsageNonJson:"加载 Agent 用量失败:服务端返回非 JSON 响应(HTTP {{status}},Content-Type: {{contentType}})。",checkStudioGateway:"请确认当前服务以 Studio 模式启动,并检查代理或网关配置。",agentUsageInvalidJson:"加载 Agent 用量失败:服务端返回了无法解析的 JSON(HTTP {{status}},Content-Type: {{contentType}})。",retryCheckGateway:"请稍后重试;若问题持续,请检查代理或网关配置。",loadCronJobsFailed:"加载定时任务失败",loadCronJobFailed:"加载定时任务详情失败",createCronJobFailed:"创建定时任务失败",updateCronJobFailed:"更新定时任务失败",enableCronJobFailed:"启用定时任务失败",pauseCronJobFailed:"暂停定时任务失败",runCronJobFailed:"立即执行定时任务失败",loadCronHistoryFailed:"加载执行历史失败",stopCronRunFailed:"终止执行失败",deleteCronJobFailed:"删除定时任务失败",loadRuntimeFailed:"加载 Runtime 失败",loadLocalToolsFailed:"读取本地工具失败",connectDynamicRouteFailed:"连接 Studio 动态路由失败",a2aProbeDenied:"Runtime 服务拒绝了 A2A 探测请求,请检查 Runtime 的鉴权配置。",loadA2aCardFailed:"读取 A2A Agent Card 失败",loadRuntimeApiKeyFailed:"读取 Runtime API Key 失败",runtimeApiKeyMissing:"Runtime 未返回可用的 API Key",loadMcpCredentialsFailed:"读取 MCP 认证信息失败",invalidMcpCredentials:"Studio 返回的 MCP 认证信息格式无效",deleteFailed:"删除失败 ({{status}})",runtimeManageForbidden:"当前账号没有管理该 Runtime 的权限。",runtimeNotFound:"该 Runtime 不存在或已被删除。",runtimeUnavailable:"当前账号无法访问该 Runtime。",checkRuntimeUpdateFailed:"检查 Runtime 更新能力失败(HTTP {{status}}),请稍后重试。",loadRuntimeDetailFailed:"加载 Runtime 详情失败",generateProjectFailed:"生成项目失败",generateAgentConfigFailed:"生成 Agent 配置失败",createDebugRunFailed:"创建调试运行失败",createDebugSessionFailed:"创建调试会话失败",loadDebugTraceFailed:"加载调试调用链路失败",invalidDebugTrace:"加载调试调用链路失败:返回格式无效",debugRunFailed:"调试运行失败",cleanupDebugRunFailed:"清理调试运行失败",errorWithCloudResponse:`{{context}} 云接口:{{action}} 云服务原始响应: -{{response}}`,emptyCloudResponse:"(响应正文为空)"},iye={loadFailed:"读取会话模式能力失败(HTTP {{status}})",invalidResponse:"会话模式能力响应格式错误"},rye={nonJson:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}},{{contentType}}){{detail}}"},sye={busy:"工作区正在处理较多请求,请稍后重试",notFound:"工作区不存在",duplicates:"检测到多个个人工作区会话,请联系管理员处理",timeout:"工作区恢复超时,项目仍保留,请重试",unavailable:"工作区暂时无法恢复,原项目仍保留,请重试",persistence:"当前 Sandbox 未启用持久化快照,请检查工作区配置",startup:"个人工作区启动失败,请检查 Sandbox 状态",exists:"项目名称已存在,请从项目列表打开",directory:"项目目录不存在",configuration:"请先配置工作区 Sandbox 镜像",state:"暂时无法确认工作区状态,请重试",list:"恢复工作区或读取项目列表失败,请重试",create:"项目初始化失败,请确认镜像可用后重试",open:"恢复工作区或打开项目失败,请重试",connection:"工作区暂时无法连接,请重试",invalidWorkspaceUrl:"工作区返回了无效的访问地址",operation:"项目操作失败,请重试",invalidProjectUrl:"项目访问地址无效",listFallback:"读取项目列表失败",connectionState:"暂时无法连接工作区,请重试"},aye={reporting:"正在补齐交付信息",packaging:"正在整理产物",savingVersion:"正在保存版本",finishing:"正在完成请求",submitResult:"提交构建结果",requestFailed:"任务请求失败,请重试。",invalidResponse:"任务状态响应无效。",eventGap:"正在补齐任务输出。",reconnecting:"连接暂时中断,正在重连。已有输出已保留。",input:{pending:"等待送达",sending:"正在确认送达",delivered:"已送达",withdrawn:"已停止发送"},plan:"执行计划",diff:"文件变更",preparing:"正在准备任务",preparingEnvironment:"正在准备开发环境…",connectingEnvironment:"正在连接开发环境…",processing:"正在处理请求",thinking:"正在思考",read:"读取文件 · {{target}}",listFiles:"查看目录 · {{target}}",search:"搜索 · {{target}}",command:"执行命令 · {{target}}",editFiles:"修改文件 · {{target}}",webSearch:"搜索网页 · {{target}}",processSummary:"已处理 {{count}} 项",duration:"{{seconds}} 秒",durationUnits:{milliseconds:"{{value}} 毫秒",hours:"{{value}} 小时",minutes:"{{value}} 分",seconds:"{{value}} 秒"},failedTools:"{{count}} 项执行失败",toolFailed:"执行失败",toolCalls:"{{count}} 次工具调用",turnDuration:"本轮耗时 {{duration}}",toolDuration:"工具累计耗时 {{duration}}",toolDurationPartial:"已记录工具耗时 {{duration}}",toolDurationHelp:"各工具执行耗时之和;并行调用可能使累计耗时超过本轮耗时。",turnStatus:{completed:"已完成",failed:"未完成",interrupted:"已中断",cancelled:"已中断",unavailable:"任务已结束"},notReported:"未上报",partial:"已记录",partialHelp:"本轮记录可能不完整。",tokenDetails:"本轮 Token 用量",model:"本轮模型",totalTokens:"总量",inputTokens:"输入",cachedInputTokens:"缓存命中输入",uncachedInputTokens:"未命中输入",cacheWriteInputTokens:"缓存写入",outputTokens:"输出",reasoningOutputTokens:"推理输出",cacheHitRate:"输入缓存命中率",tokenHelp:"缓存命中属于输入,推理输出属于输出,不重复计入总量。未命中输入 = 输入 − 缓存命中。"},_U={common:Lbe,agentkitCli:$be,cloudRegion:Fbe,connections:Bbe,feishuBot:Ube,requestError:Qbe,runSse:zbe,runtimeLogs:Vbe,search:Hbe,skills:qbe,sse:Wbe,identity:Kbe,github:Gbe,video:Xbe,websiteIntegration:Ybe,knowledge:Zbe,intelligentDevelopment:Jbe,migrations:eye,sandbox:tye,client:nye,newChatCapabilities:iye,jsonResponse:rye,workspaceProjects:sye,developmentRuns:aye},wVe=Object.freeze(Object.defineProperty({__proto__:null,agentkitCli:$be,client:nye,cloudRegion:Fbe,common:Lbe,connections:Bbe,default:_U,developmentRuns:aye,feishuBot:Ube,github:Gbe,identity:Kbe,intelligentDevelopment:Jbe,jsonResponse:rye,knowledge:Zbe,migrations:eye,newChatCapabilities:iye,requestError:Qbe,runSse:zbe,runtimeLogs:Vbe,sandbox:tye,search:Hbe,skills:qbe,sse:Wbe,video:Xbe,websiteIntegration:Ybe,workspaceProjects:sye},Symbol.toStringTag,{value:"Module"})),oye="智能体审核",lye="申请企业内全员使用,审批后生效",cye="关闭",uye="刷新",dye="状态",fye="申请人",hye="申请时间",pye="当前版本",mye="模型",gye="退回人",bye="通过人",yye="审批时间",vye="智能体描述",xye="申请说明",wye="退回理由",Oye="审批意见",kye="退回理由(必填)",Sye="提交后内容已变化,请退回并重新申请",Eye="撤回后可以修改 Agent,需要公开时重新申请",Cye="取消公开后其他用户将无法继续使用,确定取消公开吗?",Aye="取消",Tye="确认",_ye="正在保存",jye="取消公开",Nye="撤回申请",Rye="通过",Iye="直接公开",Pye="申请公开",Dye="全员可见",Mye={pending:"待审核",approved:"已通过",returned:"已退回",withdrawn:"已撤回"},Lye="搜索智能体或申请人",$ye="地域",Fye="全部状态",Bye="智能体",Uye="操作",Qye="查看并审批",zye="申请详情",Vye="没有符合条件的申请",Hye="暂无智能体审核申请",qye="{{count}} / {{limit}} 字",OVe={title:oye,dialogDescription:lye,close:cye,refresh:uye,statusTitle:dye,submitter:fye,submittedAt:hye,version:pye,model:mye,returnedBy:gye,approvedBy:bye,reviewedAt:yye,description:vye,message:xye,reason:wye,comment:Oye,reasonRequired:kye,contentChanged:Sye,withdrawConfirm:Eye,unpublishConfirm:Cye,cancel:Aye,confirm:Tye,saving:_ye,unpublish:jye,withdraw:Nye,return:"退回",approve:Rye,publish:Iye,submit:Pye,private:"仅自己可见",enterprise:Dye,status:Mye,search:Lye,region:$ye,all:Fye,agent:Bye,actions:Uye,review:Qye,details:zye,noMatches:Vye,empty:Hye,textCount:qye},kVe=Object.freeze(Object.defineProperty({__proto__:null,actions:Uye,agent:Bye,all:Fye,approve:Rye,approvedBy:bye,cancel:Aye,close:cye,comment:Oye,confirm:Tye,contentChanged:Sye,default:OVe,description:vye,details:zye,dialogDescription:lye,empty:Hye,enterprise:Dye,message:xye,model:mye,noMatches:Vye,publish:Iye,reason:wye,reasonRequired:kye,refresh:uye,region:$ye,returnedBy:gye,review:Qye,reviewedAt:yye,saving:_ye,search:Lye,status:Mye,statusTitle:dye,submit:Pye,submittedAt:hye,submitter:fye,textCount:qye,title:oye,unpublish:jye,unpublishConfirm:Cye,version:pye,withdraw:Nye,withdrawConfirm:Eye},Symbol.toStringTag,{value:"Module"})),Wye={backToEvaluationCase:"返回评测案例",cancel:"取消",copied:"已复制",copy:"复制",exportConversation:"导出会话",retry:"重试"},Kye={title:"您想以哪种方式添加 Agent 来运行?",subtitle:"选择最适合你的方式,下一步即可开始",quickCreate:{title:"从 0 快速创建",description:"用智能、自定义、模板或工作流的方式从零创建一个 Agent。"},intelligent:{title:"智能模式",description:"描述目标,按你的意图构建、调试并验证 Agent。"},package:{title:"从代码包添加和部署",description:"上传 Agent 项目压缩包,查看代码并直接部署到 AgentKit Runtime。"},migrate:{title:"从存量迁移",description:"从您的 LangChain、Dify 等存量项目迁移至 AgentKit Runtime。"}},Gye={subject:{file:"文件修改",command:"命令执行"},decision:{accept:"已允许本次{{subject}}",acceptForSession:"已在本会话中允许{{subject}}",decline:"已拒绝{{subject}}",cancel:"已取消{{subject}}审批"},details:{command:"命令",grantRoot:"授权路径",cwd:"执行目录"}},Xye={noDescription:"暂无描述",region:"地域",unknownAgent:"未知 Agent"},Yye={agentTransfer:"智能体移交",annotationHint:"模型回复;选中文字后可添加批注",continueBranch:"继续“{{branch}}”这个方向",emptyResponse:"本次没有返回可显示的内容。",subagentDescription:"正在执行主 Agent 移交的任务。"},Zye={title:"需要配置 {{provider}} AK/SK",prefix:"智能体工作台需要 {{provider}} 凭据才能使用。请在运行环境中设置",and:"与",suffix:"后重试。"},Jye={buildRunning:{title:"当前构建仍在进行",description:"离开将停止本轮构建;当前会话仍会保留,可稍后从历史会话重新进入。",confirm:"停止并离开"},deleteThread:{title:"删除 Codex 历史会话",description:"将删除“{{name}}”,并从历史会话中移除。",confirm:"确认删除"},returnToCreate:{title:"返回创建首页?",description:"返回后当前填写的内容将会丢失,确定要返回吗?",confirm:"确定返回"}},e0e={additionalAgentDeleteFailures:";另有 {{count}} 个失败",agentDeleteFailures:"{{count}} 个 Agent 删除失败:{{failures}}{{suffix}}",agentToolsMissing:"当前 Agent 缺少任务工具:{{tools}}",buildStopUnconfirmed:"已离开开发环境,但未能确认本轮构建已停止。任务可能仍在运行,请稍后从历史会话检查状态。",builtinAgentSendFailed:"内置智能体发送失败:{{message}}",bytePlusEvaluationUnsupported:"BytePlus 暂不支持 AgentKit 评测集",clipboardUnsupported:"当前浏览器不支持写入剪贴板。",cloudCodexEmptyReply:"云端 Codex 已结束,但没有生成回复,请重新发送任务。",cloudCodexSessionMissing:"云端 Codex Session 暂未出现在列表中,请稍后重试。",deploymentRuntimeIdMissing:"部署完成,但未返回 Runtime ID。",environmentExpired:"所选环境已失效,请刷新后重新选择。",environmentsLoadFailed:"读取环境失败",evaluationCaseSessionMissing:"这条案例缺少会话定位信息,无法跳转。",evaluationUnsupportedForReply:"当前回复暂不支持加入评测集",firstFrameRequired:"首尾帧生成需要先添加首帧图片。",incompletePromptOptimization:"提示词优化结果不完整,请重新优化后再试。",intelligentCapabilityCheckFailed:"智能开发能力检查失败(HTTP {{status}})",intelligentSessionCreateFailed:"智能开发会话创建失败",invalidIntelligentCapability:"智能开发模型能力格式错误。",localBffToolsNotConfigured:"本地 Studio BFF 没有配置工具。",localToolsLoadFailed:"读取本地工具失败",loginPopupBlocked:"登录窗口被浏览器拦截,请允许弹出窗口后重试。",loginPopupClosed:"登录窗口已关闭,请重新登录以继续当前操作。",mediaTooLarge:"{{fileName}} 超出当前平台允许的素材大小。",mountEnvironmentFailed:"挂载环境失败",noConnectedSandbox:"当前没有已连接的 Sandbox。",noCreateAgentPermission:"当前账号没有添加 Agent 的权限。",noManageAgentPermission:"当前账号没有管理 Agent 的权限。",noOptimizationBaseline:"当前版本没有可对比的优化前版本。",oauthUrlMissing:"事件中没有授权地址。",onlyCloudAgentUpdatable:"仅支持更新已部署的云端智能体。",optimizationVersionMissing:"无法找到本次优化对应的项目版本,可能已被删除。",persistentStorageNotConfigured:"管理员未配置持久化存储",readDraftFailed:"无法读取本机草稿,请稍后重试。",runtimeAgentNameMissing:"Runtime 缺少智能体名称,无法更新。",runtimeBffToolsDisabled:"当前 Runtime Agent 未开启 BFF 工具能力。",runtimeDeploymentConfigUnavailable:"该 Runtime 的原发布配置不可恢复,无法安全更新。",runtimeMissingForConnection:"缺少 Runtime 信息,无法连接智能体。",runtimeRegionMissingForDelete:"Runtime 缺少地域信息,无法删除",runtimeRegionMissingForUpdate:"Runtime 缺少地域信息,无法更新。",runtimeUpdateUnsupported:"当前 Runtime 不支持原地更新。",sandboxRuntimeUnavailable:"当前 Agent 没有可用的 Sandbox Runtime。",sandboxToolsUnavailable:"当前 Studio BFF 未提供 Sandbox 执行工具。",saveDraftLocationRejected:"浏览器拒绝保存当前草稿位置,请检查站点存储权限后重试。",saveDraftRejected:"浏览器拒绝保存草稿,请稍后重试。",selectSkillToOptimize:"请先选择需要优化的 Skill。",sessionMissingForMount:"当前会话不存在,无法挂载环境。",sessionNotReady:"会话尚未就绪。",sessionUnavailable:"当前会话不可用,请关闭后重试。",sourceNotReady:"该源码尚未准备好,请返回对话继续处理。",textVideoRejectsReferences:"文生视频不使用参考素材,请先移除已添加的图片或视频。",videoEditRequiresVideo:"视频编辑需要先添加待编辑视频。",videoExtendRequiresVideo:"视频续写需要先添加基础视频。",videoGenerationFailed:"视频生成失败,请稍后重试。",videoModeUnsupported:"当前平台暂不支持所选视频任务模式。",videoPreviewMissing:"视频任务已完成,但服务端未返回预览地址。",videoReferenceRequired:"参考素材生视频需要至少添加一项参考图片或参考视频。"},t0e={like:"赞",removeLike:"取消点赞",dislike:"踩",removeDislike:"取消点踩",reportIssue:"问题反馈",traceFlameGraph:"Tracing 火焰图"},n0e={0:"今天想做点什么?",1:"有什么可以帮你的?",2:"需要我帮你查点什么吗?",3:"有问题尽管问我",4:"嗨,我们开始吧",5:"开始一段新对话吧",6:"今天想先解决哪件事?",7:"把你的想法告诉我吧",8:"我们从哪里开始?",9:"有什么任务交给我?",10:"准备好一起推进了吗?",11:"说说你现在最关心的问题",12:"今天也一起把事情做好",13:"我在,随时可以开始",intelligentDevelopment:"让灵感自由生长"},i0e={agentCapabilities:"正在检查 Agent 能力…",session:"加载会话…"},r0e={cancelled:"授权已取消。",pasteCallbackUrl:"授权完成后,请粘贴回调页面(浏览器地址栏)的完整 URL:",popupBlocked:"弹窗被拦截,请允许弹窗后重试。",unsupportedUrl:"授权链接不是 http/https 地址,已阻止打开。"},s0e={volcengine:"火山引擎"},a0e={checkingPersistence:"正在检查持久化能力…",exitDevelopment:"退出开发环境",fileUploaded:"已上传文件到 Sandbox",filesUploaded:"已上传 {{count}} 个文件到 Sandbox",intelligentDevelopment:"智能开发",mode:{readOnly:"只读",workspaceWrite:"工作区写入",fullAccess:"完全访问"},approvalPolicy:{untrusted:"仅不可信命令",onRequest:"按需审批",never:"不审批"},reviewer:{user:"由我审批",autoReview:"自动审查"},labels:{approvalPolicy:"审批策略",file:"文件",fileNumber:"文件 {{number}}",mode:"沙箱模式",networkAccess:"网络访问",reviewer:"审批方式",workingDirectory:"工作目录"},network:{allowed:"允许",disabled:"关闭"},permissionsUpdated:"已更新当前 Sandbox Session 的 Codex 权限",persistenceUnknown:"暂时无法确认持久化能力",stoppedReady:"已停止,可继续输入",uploadedFilesPrompt:"以下文件已上传到当前 Sandbox 工作空间,请在任务中使用:",workspaceUpdated:"已更新工作空间"},o0e={addAgent:"添加智能体",addFromPackage:"从代码包添加",agent:"智能体",automations:"自动化",createAgent:"创建智能体",createSkill:"创建技能",cronJobs:"定时任务",issueFeedback:"问题反馈",library:"资源库",migrateAgent:"迁移智能体",newConversation:"新会话",optimizeSkill:"优化 {{name}}",search:"搜索",skill:"技能",skillLibrary:"技能库",systemInfo:"系统信息",updateAgent:"更新 {{name}}",codeProjects:"代码项目",reviewCenter:"审核中心"},l0e={title:"从工作区新建",description:"创建和管理代码项目,在 VS Code 中编写和调试"},c0e={actions:Wye,addAgent:Kye,approval:Gye,common:Xye,conversation:Yye,credentials:Zye,dialogs:Jye,errors:e0e,feedback:t0e,greetings:n0e,loading:i0e,oauth:r0e,providers:s0e,sandbox:a0e,titles:o0e,workspaceProjectEntry:l0e},SVe=Object.freeze(Object.defineProperty({__proto__:null,actions:Wye,addAgent:Kye,approval:Gye,common:Xye,conversation:Yye,credentials:Zye,default:c0e,dialogs:Jye,errors:e0e,feedback:t0e,greetings:n0e,loading:i0e,oauth:r0e,providers:s0e,sandbox:a0e,titles:o0e,workspaceProjectEntry:l0e},Symbol.toStringTag,{value:"Module"})),u0e="自动化",d0e="连接研发工具,为智能体扩展自动化工作流",f0e="搜索自动化",h0e="自动化分类",p0e={development:"研发",channels:"消息渠道"},m0e="{{category}}自动化列表",g0e="打开{{name}}",b0e="仅本地部署可用",y0e="没有匹配的自动化",v0e="请尝试搜索其他名称",x0e="返回自动化列表",w0e={"coding-agents":{name:"配置 Coding Agents",badge:"本地",description:"将 VeADK 和 AgentKit 内置 Skills 全局配置到 Trae、Claude Code 或 Codex。"},template:{name:"模板项目导入",description:"在您的仓库中创建一个可持续交付到 AgentKit Runtime 的最简智能体",title:"模板项目导入",subtitle:"把可直接启动 Studio 的 basic Agent 和持续交付配置加入仓库",panel:"提交后将创建一个 PR,同时导入 basic 项目和 AgentKit Runtime 发布工作流。",submitLabel:"导入模板并提交 PR",regionHelp:"必须与目标 Runtime 所在地域一致",pullRequest:{title:"feat: 导入 AgentKit basic 模板",description:"导入带有 AgentKit Studio App Server 的 basic Agent 项目,并添加持续发布到 AgentKit Runtime 的工作流。合并前请配置 {{provider}} Secrets。"},fields:{repository:{label:"GitHub 仓库",placeholder:"owner/repository",help:"支持 owner/repository 或完整 github.com URL"},baseBranch:{label:"目标分支",placeholder:"main",help:"留空时使用 main,PR 将以此分支为 base"},projectPath:{label:"Agent 项目目录",placeholder:"agentkit-basic-agent",help:"将在此目录新增 basic 项目;app.py 挂载完整 Studio App Server,并作为服务入口启动"},runtimeName:{label:"Runtime 名称",placeholder:"support-agent",help:"用于 AgentKit 发布配置"},runtimeId:{label:"运行时 ID",placeholder:"rt-xxxxxxxx",help:"持续更新的目标 AgentKit Runtime"}}},delivery:{name:"AgentKit Runtime 持续交付",description:"为您的仓库添加持续交付到 AgentKit Runtime 的自动化工作流。",title:"AgentKit Runtime 持续交付",subtitle:"用 Pull Request 把持续发布配置安全地加入代码仓库",panel:"提交后将在目标仓库创建发布分支,并发起包含 GitHub Actions 工作流的 PR。",submitLabel:"确定并提交 PR",regionHelp:"必须与目标 Runtime 所在地域一致",pullRequest:{title:"feat: 持续发布到 AgentKit Runtime",description:"新增 GitHub Actions 工作流,在目标分支更新时持续发布到 AgentKit Runtime。合并前请配置工作流所需的 {{provider}} Secrets。"},fields:{repository:{label:"GitHub 仓库",placeholder:"owner/repository",help:"支持 owner/repository 或完整 github.com URL"},baseBranch:{label:"目标分支",placeholder:"main",help:"留空时使用 main,PR 将以此分支为 base"},projectPath:{label:"Agent 项目目录",placeholder:".",help:"留空时使用仓库根目录;目录内需包含挂载完整 Studio App Server 的 app.py"},runtimeName:{label:"Runtime 名称",placeholder:"support-agent",help:"用于 AgentKit 发布配置"},runtimeId:{label:"运行时 ID",placeholder:"rt-xxxxxxxx",help:"持续更新的目标 AgentKit Runtime"}}},review:{name:"GitHub PR 自动评审",description:"通过 GitHub App 在隔离 Sandbox 中评审 Pull Request。",title:"GitHub PR 自动评审",subtitle:"通过 GitHub App 触发 Sandbox 评审,并将结果发布到 Pull Request",panel:"请先将 GitHub App 安装到目标仓库,再为每个仓库启用自动评审。",submitLabel:"安装 GitHub App",regionHelp:"",pullRequest:{title:"chore: 配置 PR 自动评审",description:"新增 GitHub Actions 工作流,在隔离 Sandbox 中评审同仓库 PR,并将结果发布为 GitHub Review。合并前请配置工作流所需 Secrets。"},fields:{repository:{label:"GitHub 仓库",placeholder:"owner/repository",help:"支持 owner/repository 或完整 github.com URL"},baseBranch:{label:"目标分支",placeholder:"main",help:"留空时使用 main,PR 将以此分支为 base"},sandboxToolId:{label:"沙箱工具 ID",placeholder:"tool-xxxxxxxx",help:"用于运行每次评审的 AgentKit CodeEnv"},modelName:{label:"评审模型",placeholder:"review-model",help:"注入 Sandbox 的代码评审模型名称"},modelBaseUrl:{label:"模型 API 地址",placeholder:"https://ark.example.com/api/v3",help:"必须使用 OpenAI 兼容的 HTTPS 地址"}}},"gitlab-review":{name:"GitLab MR 自动评审",description:"通过 GitLab 集成在隔离 Sandbox 中评审 Merge Request。"},feishu:{name:"飞书机器人",badge:"Beta",description:"创建飞书机器人,并将消息直接接入 AgentKit Runtime。"},"mpa-channels":{name:"MPA智能体消息渠道",description:"为已有 MPA 智能体绑定飞书、企业微信和钉钉。"},"website-integration":{name:"网站集成",description:"将 AgentKit Runtime 以悬浮聊天窗口嵌入网站。"}},O0e={required:"必填",optional:"可选",region:"地域",tokenLabel:"GitHub Token",getToken:"获取 Token",createToken:"创建 GitHub Token",tokenPlaceholder:"需要仓库 Contents 与 Pull requests 写权限",tokenWorkflowPlaceholder:"需要 Contents、Pull requests、Workflows 写权限",hideToken:"隐藏 Token",showToken:"显示 Token",tokenHelp:"Token 仅用于本次提交,不会保存在浏览器或写入 PR",tokenWorkflowHelp:"此处 Token 用于创建配置 PR;它不是 Sandbox 的通用必填项,且不会保存在浏览器或写入 PR",prCreated:"PR #{{number}} 已创建",configPrCreated:"配置 PR #{{number}} 已创建",configPrNextStep:"合并后,后续同仓库 PR 会自动触发评审。",viewOnGitHub:"在 GitHub 查看",viewConfigPr:"查看配置 PR",secretsHeading:"合并 PR 前,请在仓库的 GitHub Actions Secrets 中配置:",secretsConfigHeading:"合并配置 PR 前,请在目标仓库添加运行时密钥",openSecrets:"打开 Secrets 设置",secretsPath:"路径:Settings → Secrets and variables → Actions → Repository secrets",repositoryConfigHelp:"将为 {{repository}} 添加 PR 自动评审配置",repositoryReviewHelp:"将使用 GitHub App 校验 {{repository}} 的 Pull Request",secretPair:"{{accessKey}}、{{secretKey}}(必填)",sessionToken:"{{sessionToken}}(使用临时凭据时必填)",requiredSecret:"{{name}}(必填)",temporaryCredentialRequired:"(使用临时凭据时必填)",requiredSuffix:"(必填)",submitting:"提交 PR 中…",validation:{required:"此项不能为空",repository:"请输入 owner/repository 或完整 GitHub 仓库 URL",baseBranch:"目标分支格式不正确",projectPath:"请输入仓库内的相对目录",runtimeId:"运行时 ID 格式不正确",sandboxToolId:"沙箱工具 ID 格式不正确",modelName:"模型名称格式不正确",modelBaseUrlSafe:"请输入不含凭据、查询参数或锚点的 HTTPS 地址",modelBaseUrl:"请输入有效的 HTTPS 地址",runtimeName:{required:"Runtime 名称为必填项",characters:"Runtime 名称只能包含英文字母、数字、下划线和连字符",length:"Runtime 名称长度须为 4-64 个字符"}}},k0e={title:"配置 Coding Agents",description:"把随 Studio 提供的 AgentKit Skills 全局安装到本地编码客户端。",retry:"重试",clients:{ariaLabel:"选择 Coding Agent",title:"本机客户端",detectAgain:"重新检测",detecting:"正在检测本机客户端…",detected:"已检测到客户端",available:"可用",unavailable:"未检测到"},skills:{ariaLabel:"选择内置 Skill",title:"内置 Skills",viewFiles:"查看文件",items:{"veadk-agent-development":{name:"VeADK Agent 开发",description:"使用 VeADK 开发和完善 Agent。"},"agentkit-cli":{name:"AgentKit CLI",description:"通过 AgentKit CLI 管理和部署 AgentKit 资源。"}}},global:{ariaLabel:"全局安装目录",title:"全局安装",description:"配置后可在本机其他项目中使用",empty:"选择客户端后显示对应安装目录。"},success:"已为 {{agentCount}} 个客户端配置 {{skillCount}} 个 Skill",selection:"已选择 {{agentCount}} 个客户端、{{skillCount}} 个 Skill",selectClient:"请先选择客户端",configuring:"正在配置…",configure:"配置",errors:{detect:"检测本机客户端失败",configure:"配置失败,请检查用户目录权限后重试"},preview:{description:"只读浏览随 Studio 提供的 Skill 文件",close:"关闭文件预览",loading:"正在读取文件…",error:"读取 Skill 文件失败",skillFiles:"{{name}} 文件",files:"文件",fileContent:"文件内容",notPreviewable:"此文件不是可预览的 UTF-8 文本。",noFiles:"没有可预览的文件。"}},S0e={noDescription:"暂无描述",unknownCreator:"未知创建者",optionMetadata:"{{creator}} | {{createdAt}}",selectAgent:"选择 MPA 智能体",chooseAgent:"请选择 MPA 智能体",search:"搜索名称、Runtime ID 或地域",noMatches:"没有匹配的 MPA 智能体",loading:"正在加载 MPA 智能体…",empty:"暂无可管理的 MPA 智能体,请先创建或部署一个 MPA 智能体。",unauthorized:"需要 Studio 管理员权限才能管理 MPA 消息渠道,请联系管理员。",loadFailed:"加载 MPA 智能体失败,请重试。",retry:"重试",refresh:"刷新列表",loadMore:"加载更多",moreAvailable:"还有更多智能体。搜索仅匹配已加载的结果,可继续加载。",chooseHint:"选择一个 MPA 智能体后,即可配置飞书、企业微信和钉钉。"},E0e={title:"飞书机器人",description:"创建一个由 AgentKit Runtime 驱动的飞书智能体",panel:"填写已发布飞书应用的凭据,Studio 将生成 basic 智能体、创建独立 Runtime,并启用飞书消息长连接。",agentName:"智能体名称",agentNameHelp:"将作为新 Runtime 中的根智能体名称",region:"部署地域",regionHelp:"Runtime 与构建产物将创建在该地域",regions:{"cn-beijing":"北京","cn-shanghai":"上海"},appId:"飞书 App ID",appIdHelp:"来自飞书开放平台的应用凭证",appSecret:"飞书 App Secret",appSecretPlaceholder:"请输入 App Secret",appSecretHelp:"仅写入新 Runtime 的环境变量",hideSecret:"隐藏 App Secret",showSecret:"显示 App Secret",hide:"隐藏",show:"显示",confirmCancel:"取消部署将停止任务并清理已创建的 Runtime,确定继续吗?",status:{preparing:"正在生成 basic 智能体",running:"正在创建 Runtime",cancelling:"正在取消部署",succeeded:"飞书机器人 Runtime 已创建",cancelled:"部署已取消",failed:"创建失败"},steps:{prepare:"生成智能体",build:"构建镜像",deploy:"创建 Runtime",publish:"发布服务"},openConsole:"打开 Runtime 控制台",credentials:{title:"凭据处理",description:"App Secret 仅用于本次部署,不会写入生成源码或浏览器存储。"},cancelDeployment:"取消部署",creating:"正在创建…",create:"创建飞书机器人 Runtime",validation:{appId:"请输入飞书 App ID",appSecret:"请输入飞书 App Secret",agentName:{required:"名称为必填项",reserved:"user 是 Google ADK 保留名称,请使用其他名称",characters:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"}},generatedAgent:{description:"一个通过飞书接收消息并提供帮助的智能助手。",instruction:"你是一个通过飞书为用户提供帮助的智能助手。准确理解用户问题,给出简洁、可靠的回答;信息不足时先提问澄清,不要臆造事实。"}},C0e={title:u0e,description:d0e,search:f0e,categoriesLabel:h0e,categories:p0e,resultsLabel:m0e,open:g0e,localOnly:b0e,emptyTitle:y0e,emptyDescription:v0e,backToAutomations:x0e,cards:w0e,github:O0e,codingAgents:k0e,mpaChannels:S0e,feishu:E0e},EVe=Object.freeze(Object.defineProperty({__proto__:null,backToAutomations:x0e,cards:w0e,categories:p0e,categoriesLabel:h0e,codingAgents:k0e,default:C0e,description:d0e,emptyDescription:v0e,emptyTitle:y0e,feishu:E0e,github:O0e,localOnly:b0e,mpaChannels:S0e,open:g0e,resultsLabel:m0e,search:f0e,title:u0e},Symbol.toStringTag,{value:"Module"})),A0e={"zh-CN":"简体中文","en-US":"English"},CVe={languageNames:A0e},AVe=Object.freeze(Object.defineProperty({__proto__:null,default:CVe,languageNames:A0e},Symbol.toStringTag,{value:"Module"})),T0e={selectedExcerptLabel:"选中片段",commentLabel:"批注",commentSeparator:":",successTitle:"已加入 Bad case 评测集",successDescription:"这条批注已关联当前问题和完整模型回复。",done:"完成",ariaLabel:"批注选中的模型回复",title:"添加批注",content:"批注内容",placeholder:"说明问题或期望的修改方式",retryError:"{{error}},请重试。",cancel:"取消",submit:"加入 Bad Case"},_0e={attachment:"附件",image:"图片",preview:"预览 {{name}}",uploading:"上传中",uploadFailed:"上传失败",remove:"移除 {{name}}",previewDialog:"{{name}}预览",download:"下载",close:"关闭",reading:"正在读取文档…",loadFailed:"文档加载失败:{{error}}"},j0e={errorTitle:"云端日志错误",copyError:"复制完整错误信息",retry:"重试",statuses:{live:"实时",connecting:"连接中",retrying:"重连中",idle:"未连接"},title:"实例日志",description:"当前对话请求所在的 VeFaaS 实例",close:"关闭实例日志",instanceId:"实例 ID",waitingInstance:"等待实例",request:"请求 {{id}}",ariaLabel:"VeFaaS 实例实时日志",notCapturedTitle:"尚未捕获到实例",notCapturedDescription:"发送一条消息后,这里会显示实际处理请求的实例和实时日志。",connectingTitle:"正在连接实例日志",connectingDescription:"正在通过 Studio BFF 建立安全日志流。",emptyTitle:"暂无日志",emptyDescription:"已连接实例,等待新的日志输出。",download:"下载日志",retention:"日志自动刷新,仅保留最近 {{count}} 行"},N0e={title:"调用链路观测",statuses:{loading:"加载中",ready:"",collecting:"采集中",disabled:"未开启",forbidden:"权限不足",error:"加载失败"},errors:{collecting:"调用链路仍在采集中,请稍候。",disabled:"该 Agent 未开启链路观测,请到控制台开启后重试。",forbidden:"当前账号无权读取 APMPlus 调用链路,请联系管理员补充只读权限。",error:"调用链路加载失败,请稍后重试。"},callCount:"{{count}} 个调用 · {{duration}} ms",close:"关闭",loading:"加载调用链路…",retryNow:"立即重试",reload:"重新加载",empty:"该会话暂无调用链路(可能尚未产生调用)。",attributes:"属性",selectCall:"选择左侧的一个调用查看详情"},R0e={exportNote:"上述会话由 AgentKit Studio 导出,仅供参考",imageFailed:"图片生成失败,请重试。",browserUnsupported:"浏览器无法生成会话图片,请重试。",copyUnsupported:"当前浏览器不支持复制图片,请下载后使用。",exportFailed:"导出失败,请重试。",title:"导出会话",description:"选择格式并下载截至当前回复的全部输入与输出。",close:"关闭",generatingContent:"正在生成导出内容…",retry:"重试生成",previewPage:"预览第 1 页,共 {{count}} 页",previewAlt:"会话导出内容第 1 页,共 {{count}} 页",format:"导出格式",generatingFormat:"正在生成 {{format}}…",copying:"正在复制…",copiedFirst:"已复制第一页",copied:"已复制",copyFirst:"复制第一页",copyImage:"复制图片",generating:"正在生成…",downloadArchive:"下载 PNG 压缩包({{count}} 页)",downloadFormat:"下载 {{format}}"},I0e={a2a:{connecting:"正在等待 Runtime 响应…",submitted:"任务排队中…",working:"任务执行中…"},unsupportedComponent:"不支持的组件:{{component}}",sandboxIdentity:"Codex Sandbox 执行标识",useSkill:"使用 {{name}} 技能",thinkingDone:"已完成工作思考",thinking:"工作思考中",reasoningDone:"已完成模型推理",reasoning:"模型推理中",justNow:"刚刚",sourceUnavailable:"暂时无法读取生成的源码,请稍后重试。",downloadStarted:"已开始下载",verifiedDelivery:"已验证交付物",generatedSource:"生成的 Agent 源码",entryPoint:"入口",fileCount:"文件数",size:"大小",validationTime:"验证时间",generationTime:"生成时间",checksPassed:"{{count}} 项检查通过",sourceReady:"源码已准备好,可部署",sourceGuidance:"源码已准备好,可查看、下载或部署;部署前请确认 Runtime 配置。",viewSource:"查看源码",preparing:"正在准备…",viewChanges:"查看本次变更",downloadSource:"下载源码",sourceNotReady:"源码尚未准备好",manualDeploy:"手动部署到 Runtime",deployAgent:"部署 Agent",beforeOptimization:"优化前",afterOptimization:"优化后",planStatuses:{pending:"待处理",in_progress:"进行中",completed:"已完成",failed:"未完成"},renderUi:"渲染 UI",truncated:"…(已截断)",agentAdjusting:"Agent 正在调整",sandboxDetails:"Codex Sandbox 详细输出",waitingCodex:"正在等待 Codex 输出",arguments:"参数",result:"返回",artifacts:"产物",downloadNamed:"下载 {{name}}",powerpoint:"PowerPoint 演示文稿",preview:"预览",download:"下载",previewDialog:"{{name}} 预览",closePreview:"关闭预览",slidePreview:"{{name}} 幻灯片预览",mcpToolset:"MCP 工具集",authorized:"已授权 · {{tool}}",authorizationRequired:"{{tool}} 需要授权",oauthDescription:"工具集 {{tool}} 使用 OAuth 保护,需登录授权后方可调用。",oauthProvider:"将跳转至 {{provider}} 完成登录。",oauthContinue:"授权完成后对话自动继续。",waitingAuthorization:"等待授权…",authorize:"去授权",missingAuthorizationUrl:"未在事件中找到授权地址。",tools:{web_search:{running:"正在进行网络搜索",done:"已完成网络搜索"},link_reader:{running:"正在读取网页",done:"已完成网页读取"},run_code:{running:"正在 AgentKit 沙箱中执行代码",done:"已在 AgentKit 沙箱中完成代码执行"},list_envs:{running:"正在查看可用环境",done:"已读取可用环境"},get_env_manifest:{running:"正在读取环境 Manifest",done:"已读取环境 Manifest"},execute_in_sandbox:{running:"正在环境中执行命令",done:"已在环境中完成命令执行"},delegate_to_codex_sandbox:{running:"Codex Sandbox 正在执行",done:"Codex Sandbox 已完成",failed:"Codex Sandbox 执行失败"},image_generate:{running:"正在生成图片",done:"已完成图片生成"},video_generate:{running:"正在生成视频",done:"已完成视频生成"},ppt_generate:{running:"正在生成 PPT",done:"已完成 PPT 生成"},load_memory:{running:"正在检索长期记忆",done:"已完成记忆检索"},load_knowledgebase:{running:"正在检索知识库",done:"已完成知识库检索"},load_skill:{running:"正在加载技能",done:"已加载技能"},collect_resources:{running:"正在收集可用资源",done:"已完成资源收集",failed:"资源收集失败"},create_agents:{running:"正在创建并运行 Agent",done:"已完成 Agent 创建",failed:"Agent 创建失败"}},createAgents:{categories:{skill_hub:"Skill Hub",skill_space:"AgentKit 技能中心",knowledge_base:"知识库",tool:"工具"},agentTypes:{llm:"LLM 智能体",sequential:"顺序智能体",parallel:"并行智能体",loop:"循环智能体",workflow:"工作流"},skill:"技能",subAgents:"子智能体",builtinTool:"内置工具",skillCenter:"AgentKit 技能中心",selfAuthoredTools:"自写工具",dependencies:"依赖:{{items}}",fullCode:"{{name}} 完整代码",itemCount:"{{label}} {{count}} 项",collectionAria:"召回资源信息",retrieving:"正在检索资源",retrievalFailed:"资源检索未完成",checkConfig:"请检查资源服务配置后重试。",notSearched:"未检索",notConfigured:"未配置",resourceList:"{{label}}资源列表",searchKeywords:"检索关键词",skillHubSkipped:"未提供检索关键词,本次未检索 Skill Hub。",sourceSkipped:"未配置 {{label}},本次未检索该来源。",noResources:"本次检索未返回该类别的资源。",resultAria:"创建 Agent 结果",creationFailed:"Agent 创建未完成",agentResources:"{{name}} 具备的资源",knowledgeBase:"知识库",toolsLabel:"工具",creating:"正在创建 Agent",noAgents:"没有可展示的 Agent",noAgentResult:"工具返回中未包含 Agent 配置或执行结果。",sourceLabels:{tool:"工具",knowledge:"AgentKit 知识库",skillCenter:"AgentKit 技能中心",unknown:"未知来源"},unnamedResource:"未命名资源",unnamedAgent:"未命名 Agent"},branchCompare:{ariaLabel:"分支对比",selectDirection:"选择方向",continue:"继续这个方向"},codexProgress:{planTitle:"Codex 执行计划",fallback:{fileChange:"修改文件",approval:"等待操作批准",status:"Codex 状态",command:"运行命令"},planSummary:"已完成 {{completed}}/{{total}} 项",command:{running:"正在执行命令",completed:"命令执行完成",failed:"命令执行失败"},projectFiles:"{{count}} 个项目文件",projectFile:"项目文件",fileChange:{running:"正在更新{{subject}}",completed:"已更新{{subject}}",failed:"更新{{subject}}失败"},externalTool:"外部工具",mcp:{running:"正在调用工具 {{tool}}",completed:"已调用工具 {{tool}}",failed:"工具 {{tool}} 调用未完成"},collaboration:{spawn_agent:{running:"正在启动子任务",completed:"子任务已启动",failed:"子任务启动失败"},send_input:{running:"正在向子任务发送信息",completed:"已向子任务发送信息",failed:"向子任务发送信息失败"},wait:{running:"正在等待子任务",completed:"子任务等待已结束",failed:"等待子任务失败"},close_agent:{running:"正在结束子任务",completed:"子任务已结束",failed:"子任务结束失败"},default:{running:"正在协调子任务",completed:"子任务协作已完成",failed:"子任务协作失败"}},webSearch:{running:"正在进行网络搜索",completed:"已完成网络搜索",failed:"网络搜索未完成"},errorDetail:"Codex 执行未完成。",errorTitle:"Codex 执行遇到错误"},toolActivity:{status:{queued:"等待执行",running:"正在执行",completed:"执行成功",failed:"执行失败"},goal:{queued:"等待创建目标",running:"正在创建目标",completed:"已创建目标",failed:"创建目标失败"},command:{queued:"等待运行命令",running:"正在运行命令",completed:"已运行命令",failed:"命令执行失败"},read:{queued:"等待读取",running:"正在读取",completed:"已读取内容",failed:"读取失败"},search:{queued:"等待搜索",running:"正在搜索",completed:"已完成搜索",failed:"搜索失败"},"file-change":{queued:"等待修改文件",running:"正在修改文件",completed:"已修改文件",failed:"文件修改失败"},mcp:{queued:"等待调用外部工具",running:"正在调用外部工具",completed:"已调用外部工具",failed:"外部工具调用失败"},authorization:{queued:"等待授权",running:"等待授权",completed:"授权已完成",failed:"授权失败"},generic:{queued:"等待调用工具",running:"正在调用工具",completed:"已调用工具",failed:"工具调用失败",named:{queued:"等待调用 {{tool}}",running:"正在调用 {{tool}}",completed:"已调用 {{tool}}",failed:"{{tool}} 调用失败"}},exitCode:"退出码 {{code}}",omittedLines:"… 省略 {{count}} 行 …",omittedCharacters:"… 省略 {{count}} 个字符 …",rawData:"查看原始数据",callId:"调用 ID",copyCallId:"复制调用 ID",copy:"复制",copied:"已复制",copyFailed:"复制失败,请重试。",explored_one:"已探索 1 项",explored_other:"已探索 {{count}} 项"}},P0e={segments:{system:"系统与工具",input:"输入与历史",output:"输出与思考",remaining:"剩余"},modelUnavailable:"模型信息未提供",promptWithSystem:"提示词(含系统)",systemUnknown:"系统与工具占用未知",systemApprox:"系统与工具约 {{count}} Token",ariaKnown:"上下文已使用 {{percentage}}%,{{system}},{{inputLabel}} {{input}} Token,输出与思考 {{output}} Token,剩余 {{remaining}} Token",ariaUnknown:"{{model}},上下文窗口未知,会话累计使用 {{count}} Token",composition:"上下文构成",percentageUsed:"{{percentage}}% 已用",gridAria:"100 格上下文构成图,每格代表上下文窗口的百分之一",estimated:"估算",unknown:"未知",summaryPercentage:"{{used}} 已用,剩余 {{remaining}}",summaryTokens:"{{used}} 已用,剩余 {{remaining}},总计 {{total}}",overflow:"已超出上下文 {{count}} Token",title:"上下文用量",category:"类型",currentTurn:"当前轮",sessionTotal:"会话累计",details:{input:"输入",output:"输出",reasoning:"推理",cache:"缓存命中",total:"总计"},unknownModel:"暂未收录该模型的上下文窗口",unknownRuntime:"当前 Runtime 未提供模型信息"},D0e={title:"添加 AgentKit 智能体",noAgents:"连接成功,但该地址未发现任何 Agent(/list-apps 为空)。",connectionFailed:"连接失败:{{error}}。请检查 URL、API Key,以及该网关是否允许跨域。",description:"填入 AgentKit 部署的访问地址与 API Key,将通过 ADK 协议连接,连接成功后其 Agent 会出现在左上角的下拉中。",url:"访问地址 URL",apiKeyHint:"以 Authorization: Bearer 方式连接",displayName:"显示名称(可选)",displayNameHint:"默认取 URL 的主机名",cancel:"取消",connecting:"连接中…",connect:"连接并添加"},M0e={placeholder:"输入消息…",inputAria:"输入消息",generating:"正在生成",send:"发送",model:"模型"},L0e={ariaLabel:"本轮调用上下文",removeSkill:"移除技能 {{name}}",removeAgent:"移除 Agent {{name}}"},$0e={cardAria:"{{label}} 图表",viewAria:"{{label}} 显示方式",preview:"预览",code:"代码",invalidEcharts:"ECharts 配置不是有效且安全的数据对象,请切换到代码检查内容。",renderFailed:"图表暂时无法渲染,请切换到代码检查内容。",echartsAria:"ECharts 图表预览",rendering:"正在渲染图表…",mermaidFailed:"图表暂时无法渲染,请切换到代码查看 Mermaid 内容。",mermaidAria:"Mermaid 图表预览"},F0e={downloadFile:"下载文件",downloading:"下载中…",downloadFailed:"下载失败。请确认 Sandbox 和文件仍可用,然后点击重试。",playVideo:"点击播放视频:{{name}}",enlargeImage:"放大预览:{{name}}",image:"图片",enlargeVideo:"点击放大视频",videoPreview:"视频预览",downloadVideo:"下载视频",close:"关闭"},B0e={annotation:T0e,media:_0e,runtimeLogs:j0e,trace:N0e,share:R0e,blocks:I0e,tokenUsage:P0e,addAgentKit:D0e,composer:M0e,invocation:L0e,visualization:$0e,markdown:F0e},TVe=Object.freeze(Object.defineProperty({__proto__:null,addAgentKit:D0e,annotation:T0e,blocks:I0e,composer:M0e,default:B0e,invocation:L0e,markdown:F0e,media:_0e,runtimeLogs:j0e,share:R0e,tokenUsage:P0e,trace:N0e,visualization:$0e},Symbol.toStringTag,{value:"Module"})),U0e={back:"返回",cancel:"取消",deploy:"部署",delete:"删除",loading:"读取中…",next:"下一步",notSupported:"暂不支持",previous:"上一步",required:"必填",retry:"重试",actions:"操作",value:"值",disabled:"关闭",enabled:"已开启",none:"无",close:"关闭",name:"名称",description:"描述",send:"发送"},Q0e={heading:"VeADK Agent 结构配置",importHint:"可在「创建 Agent」页通过「导入 YAML」重新载入。"},z0e={agentName:{required:"名称为必填项",reserved:"user 是 Google ADK 保留名称,请使用其他名称",characters:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"},runtimeName:{required:"Runtime 名称为必填项",characters:"Runtime 名称只能包含英文字母、数字、下划线和连字符",length:"Runtime 名称长度须为 4-64 个字符"}},V0e={description:"一个基于 VeADK 构建的智能助手,理解用户意图并调用合适的工具完成任务。",instruction:`你是一个专业、可靠的智能助手。 +{{response}}`,emptyCloudResponse:"(响应正文为空)"},rye={loadFailed:"读取会话模式能力失败(HTTP {{status}})",invalidResponse:"会话模式能力响应格式错误"},sye={nonJson:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}},{{contentType}}){{detail}}"},aye={busy:"工作区正在处理较多请求,请稍后重试",notFound:"工作区不存在",duplicates:"检测到多个个人工作区会话,请联系管理员处理",timeout:"工作区恢复超时,项目仍保留,请重试",unavailable:"工作区暂时无法恢复,原项目仍保留,请重试",persistence:"当前 Sandbox 未启用持久化快照,请检查工作区配置",startup:"个人工作区启动失败,请检查 Sandbox 状态",exists:"项目名称已存在,请从项目列表打开",directory:"项目目录不存在",configuration:"请先配置工作区 Sandbox 镜像",state:"暂时无法确认工作区状态,请重试",list:"恢复工作区或读取项目列表失败,请重试",create:"项目初始化失败,请确认镜像可用后重试",open:"恢复工作区或打开项目失败,请重试",connection:"工作区暂时无法连接,请重试",invalidWorkspaceUrl:"工作区返回了无效的访问地址",operation:"项目操作失败,请重试",invalidProjectUrl:"项目访问地址无效",listFallback:"读取项目列表失败",connectionState:"暂时无法连接工作区,请重试"},oye={reporting:"正在补齐交付信息",packaging:"正在整理产物",savingVersion:"正在保存版本",finishing:"正在完成请求",submitResult:"提交构建结果",requestFailed:"任务请求失败,请重试。",invalidResponse:"任务状态响应无效。",eventGap:"正在补齐任务输出。",reconnecting:"连接暂时中断,正在重连。已有输出已保留。",input:{pending:"等待送达",sending:"正在确认送达",delivered:"已送达",withdrawn:"已停止发送"},plan:"执行计划",diff:"文件变更",preparing:"正在准备任务",preparingEnvironment:"正在准备开发环境…",connectingEnvironment:"正在连接开发环境…",processing:"正在处理请求",thinking:"正在思考",read:"读取文件 · {{target}}",listFiles:"查看目录 · {{target}}",search:"搜索 · {{target}}",command:"执行命令 · {{target}}",editFiles:"修改文件 · {{target}}",webSearch:"搜索网页 · {{target}}",processSummary:"已处理 {{count}} 项",duration:"{{seconds}} 秒",durationUnits:{milliseconds:"{{value}} 毫秒",hours:"{{value}} 小时",minutes:"{{value}} 分",seconds:"{{value}} 秒"},failedTools:"{{count}} 项执行失败",toolFailed:"执行失败",toolCalls:"{{count}} 次工具调用",turnDuration:"本轮耗时 {{duration}}",toolDuration:"工具累计耗时 {{duration}}",toolDurationPartial:"已记录工具耗时 {{duration}}",toolDurationHelp:"各工具执行耗时之和;并行调用可能使累计耗时超过本轮耗时。",turnStatus:{completed:"已完成",failed:"未完成",interrupted:"已中断",cancelled:"已中断",unavailable:"任务已结束"},notReported:"未上报",partial:"已记录",partialHelp:"本轮记录可能不完整。",tokenDetails:"本轮 Token 用量",model:"本轮模型",totalTokens:"总量",inputTokens:"输入",cachedInputTokens:"缓存命中输入",uncachedInputTokens:"未命中输入",cacheWriteInputTokens:"缓存写入",outputTokens:"输出",reasoningOutputTokens:"推理输出",cacheHitRate:"输入缓存命中率",tokenHelp:"缓存命中属于输入,推理输出属于输出,不重复计入总量。未命中输入 = 输入 − 缓存命中。"},jU={common:$be,agentkitCli:Fbe,cloudRegion:Bbe,connections:Ube,feishuBot:Qbe,requestError:zbe,runSse:Vbe,runtimeLogs:Hbe,search:qbe,skills:Wbe,sse:Kbe,identity:Gbe,github:Xbe,video:Ybe,websiteIntegration:Zbe,knowledge:Jbe,intelligentDevelopment:eye,migrations:tye,sandbox:nye,client:iye,newChatCapabilities:rye,jsonResponse:sye,workspaceProjects:aye,developmentRuns:oye},kVe=Object.freeze(Object.defineProperty({__proto__:null,agentkitCli:Fbe,client:iye,cloudRegion:Bbe,common:$be,connections:Ube,default:jU,developmentRuns:oye,feishuBot:Qbe,github:Xbe,identity:Gbe,intelligentDevelopment:eye,jsonResponse:sye,knowledge:Jbe,migrations:tye,newChatCapabilities:rye,requestError:zbe,runSse:Vbe,runtimeLogs:Hbe,sandbox:nye,search:qbe,skills:Wbe,sse:Kbe,video:Ybe,websiteIntegration:Zbe,workspaceProjects:aye},Symbol.toStringTag,{value:"Module"})),lye="智能体审核",cye="申请企业内全员使用,审批后生效",uye="关闭",dye="刷新",fye="状态",hye="申请人",pye="申请时间",mye="当前版本",gye="模型",bye="退回人",yye="通过人",vye="审批时间",xye="智能体描述",wye="申请说明",Oye="退回理由",kye="审批意见",Sye="退回理由(必填)",Eye="提交后内容已变化,请退回并重新申请",Cye="撤回后可以修改 Agent,需要公开时重新申请",Aye="取消公开后其他用户将无法继续使用,确定取消公开吗?",Tye="取消",_ye="确认",jye="正在保存",Nye="取消公开",Rye="撤回申请",Iye="通过",Pye="直接公开",Dye="申请公开",Mye="全员可见",Lye={pending:"待审核",approved:"已通过",returned:"已退回",withdrawn:"已撤回"},$ye="搜索智能体或申请人",Fye="地域",Bye="全部状态",Uye="智能体",Qye="操作",zye="查看并审批",Vye="申请详情",Hye="没有符合条件的申请",qye="暂无智能体审核申请",Wye="{{count}} / {{limit}} 字",SVe={title:lye,dialogDescription:cye,close:uye,refresh:dye,statusTitle:fye,submitter:hye,submittedAt:pye,version:mye,model:gye,returnedBy:bye,approvedBy:yye,reviewedAt:vye,description:xye,message:wye,reason:Oye,comment:kye,reasonRequired:Sye,contentChanged:Eye,withdrawConfirm:Cye,unpublishConfirm:Aye,cancel:Tye,confirm:_ye,saving:jye,unpublish:Nye,withdraw:Rye,return:"退回",approve:Iye,publish:Pye,submit:Dye,private:"仅自己可见",enterprise:Mye,status:Lye,search:$ye,region:Fye,all:Bye,agent:Uye,actions:Qye,review:zye,details:Vye,noMatches:Hye,empty:qye,textCount:Wye},EVe=Object.freeze(Object.defineProperty({__proto__:null,actions:Qye,agent:Uye,all:Bye,approve:Iye,approvedBy:yye,cancel:Tye,close:uye,comment:kye,confirm:_ye,contentChanged:Eye,default:SVe,description:xye,details:Vye,dialogDescription:cye,empty:qye,enterprise:Mye,message:wye,model:gye,noMatches:Hye,publish:Pye,reason:Oye,reasonRequired:Sye,refresh:dye,region:Fye,returnedBy:bye,review:zye,reviewedAt:vye,saving:jye,search:$ye,status:Lye,statusTitle:fye,submit:Dye,submittedAt:pye,submitter:hye,textCount:Wye,title:lye,unpublish:Nye,unpublishConfirm:Aye,version:mye,withdraw:Rye,withdrawConfirm:Cye},Symbol.toStringTag,{value:"Module"})),Kye={backToEvaluationCase:"返回评测案例",cancel:"取消",copied:"已复制",copy:"复制",exportConversation:"导出会话",retry:"重试"},Gye={title:"您想以哪种方式添加 Agent 来运行?",subtitle:"选择最适合你的方式,下一步即可开始",quickCreate:{title:"从 0 快速创建",description:"用智能、自定义、模板或工作流的方式从零创建一个 Agent。"},intelligent:{title:"智能模式",description:"描述目标,按你的意图构建、调试并验证 Agent。"},package:{title:"从代码包添加和部署",description:"上传 Agent 项目压缩包,查看代码并直接部署到 AgentKit Runtime。"},migrate:{title:"从存量迁移",description:"从您的 LangChain、Dify 等存量项目迁移至 AgentKit Runtime。"}},Xye={subject:{file:"文件修改",command:"命令执行"},decision:{accept:"已允许本次{{subject}}",acceptForSession:"已在本会话中允许{{subject}}",decline:"已拒绝{{subject}}",cancel:"已取消{{subject}}审批"},details:{command:"命令",grantRoot:"授权路径",cwd:"执行目录"}},Yye={noDescription:"暂无描述",region:"地域",unknownAgent:"未知 Agent"},Zye={agentTransfer:"智能体移交",annotationHint:"模型回复;选中文字后可添加批注",continueBranch:"继续“{{branch}}”这个方向",emptyResponse:"本次没有返回可显示的内容。",subagentDescription:"正在执行主 Agent 移交的任务。"},Jye={title:"需要配置 {{provider}} AK/SK",prefix:"智能体工作台需要 {{provider}} 凭据才能使用。请在运行环境中设置",and:"与",suffix:"后重试。"},e0e={buildRunning:{title:"当前构建仍在进行",description:"离开将停止本轮构建;当前会话仍会保留,可稍后从历史会话重新进入。",confirm:"停止并离开"},deleteThread:{title:"删除 Codex 历史会话",description:"将删除“{{name}}”,并从历史会话中移除。",confirm:"确认删除"},returnToCreate:{title:"返回创建首页?",description:"返回后当前填写的内容将会丢失,确定要返回吗?",confirm:"确定返回"}},t0e={additionalAgentDeleteFailures:";另有 {{count}} 个失败",agentDeleteFailures:"{{count}} 个 Agent 删除失败:{{failures}}{{suffix}}",agentToolsMissing:"当前 Agent 缺少任务工具:{{tools}}",buildStopUnconfirmed:"已离开开发环境,但未能确认本轮构建已停止。任务可能仍在运行,请稍后从历史会话检查状态。",builtinAgentSendFailed:"内置智能体发送失败:{{message}}",bytePlusEvaluationUnsupported:"BytePlus 暂不支持 AgentKit 评测集",clipboardUnsupported:"当前浏览器不支持写入剪贴板。",cloudCodexEmptyReply:"云端 Codex 已结束,但没有生成回复,请重新发送任务。",cloudCodexSessionMissing:"云端 Codex Session 暂未出现在列表中,请稍后重试。",deploymentRuntimeIdMissing:"部署完成,但未返回 Runtime ID。",environmentExpired:"所选环境已失效,请刷新后重新选择。",environmentsLoadFailed:"读取环境失败",evaluationCaseSessionMissing:"这条案例缺少会话定位信息,无法跳转。",evaluationUnsupportedForReply:"当前回复暂不支持加入评测集",firstFrameRequired:"首尾帧生成需要先添加首帧图片。",incompletePromptOptimization:"提示词优化结果不完整,请重新优化后再试。",intelligentCapabilityCheckFailed:"智能开发能力检查失败(HTTP {{status}})",intelligentSessionCreateFailed:"智能开发会话创建失败",invalidIntelligentCapability:"智能开发模型能力格式错误。",localBffToolsNotConfigured:"本地 Studio BFF 没有配置工具。",localToolsLoadFailed:"读取本地工具失败",loginPopupBlocked:"登录窗口被浏览器拦截,请允许弹出窗口后重试。",loginPopupClosed:"登录窗口已关闭,请重新登录以继续当前操作。",mediaTooLarge:"{{fileName}} 超出当前平台允许的素材大小。",mountEnvironmentFailed:"挂载环境失败",noConnectedSandbox:"当前没有已连接的 Sandbox。",noCreateAgentPermission:"当前账号没有添加 Agent 的权限。",noManageAgentPermission:"当前账号没有管理 Agent 的权限。",noOptimizationBaseline:"当前版本没有可对比的优化前版本。",oauthUrlMissing:"事件中没有授权地址。",onlyCloudAgentUpdatable:"仅支持更新已部署的云端智能体。",optimizationVersionMissing:"无法找到本次优化对应的项目版本,可能已被删除。",persistentStorageNotConfigured:"管理员未配置持久化存储",readDraftFailed:"无法读取本机草稿,请稍后重试。",runtimeAgentNameMissing:"Runtime 缺少智能体名称,无法更新。",runtimeBffToolsDisabled:"当前 Runtime Agent 未开启 BFF 工具能力。",runtimeDeploymentConfigUnavailable:"该 Runtime 的原发布配置不可恢复,无法安全更新。",runtimeMissingForConnection:"缺少 Runtime 信息,无法连接智能体。",runtimeRegionMissingForDelete:"Runtime 缺少地域信息,无法删除",runtimeRegionMissingForUpdate:"Runtime 缺少地域信息,无法更新。",runtimeUpdateUnsupported:"当前 Runtime 不支持原地更新。",sandboxRuntimeUnavailable:"当前 Agent 没有可用的 Sandbox Runtime。",sandboxToolsUnavailable:"当前 Studio BFF 未提供 Sandbox 执行工具。",saveDraftLocationRejected:"浏览器拒绝保存当前草稿位置,请检查站点存储权限后重试。",saveDraftRejected:"浏览器拒绝保存草稿,请稍后重试。",selectSkillToOptimize:"请先选择需要优化的 Skill。",sessionMissingForMount:"当前会话不存在,无法挂载环境。",sessionNotReady:"会话尚未就绪。",sessionUnavailable:"当前会话不可用,请关闭后重试。",sourceNotReady:"该源码尚未准备好,请返回对话继续处理。",textVideoRejectsReferences:"文生视频不使用参考素材,请先移除已添加的图片或视频。",videoEditRequiresVideo:"视频编辑需要先添加待编辑视频。",videoExtendRequiresVideo:"视频续写需要先添加基础视频。",videoGenerationFailed:"视频生成失败,请稍后重试。",videoModeUnsupported:"当前平台暂不支持所选视频任务模式。",videoPreviewMissing:"视频任务已完成,但服务端未返回预览地址。",videoReferenceRequired:"参考素材生视频需要至少添加一项参考图片或参考视频。"},n0e={like:"赞",removeLike:"取消点赞",dislike:"踩",removeDislike:"取消点踩",reportIssue:"问题反馈",traceFlameGraph:"Tracing 火焰图"},i0e={0:"今天想做点什么?",1:"有什么可以帮你的?",2:"需要我帮你查点什么吗?",3:"有问题尽管问我",4:"嗨,我们开始吧",5:"开始一段新对话吧",6:"今天想先解决哪件事?",7:"把你的想法告诉我吧",8:"我们从哪里开始?",9:"有什么任务交给我?",10:"准备好一起推进了吗?",11:"说说你现在最关心的问题",12:"今天也一起把事情做好",13:"我在,随时可以开始",intelligentDevelopment:"让灵感自由生长"},r0e={agentCapabilities:"正在检查 Agent 能力…",session:"加载会话…"},s0e={cancelled:"授权已取消。",pasteCallbackUrl:"授权完成后,请粘贴回调页面(浏览器地址栏)的完整 URL:",popupBlocked:"弹窗被拦截,请允许弹窗后重试。",unsupportedUrl:"授权链接不是 http/https 地址,已阻止打开。"},a0e={volcengine:"火山引擎"},o0e={checkingPersistence:"正在检查持久化能力…",exitDevelopment:"退出开发环境",fileUploaded:"已上传文件到 Sandbox",filesUploaded:"已上传 {{count}} 个文件到 Sandbox",intelligentDevelopment:"智能开发",mode:{readOnly:"只读",workspaceWrite:"工作区写入",fullAccess:"完全访问"},approvalPolicy:{untrusted:"仅不可信命令",onRequest:"按需审批",never:"不审批"},reviewer:{user:"由我审批",autoReview:"自动审查"},labels:{approvalPolicy:"审批策略",file:"文件",fileNumber:"文件 {{number}}",mode:"沙箱模式",networkAccess:"网络访问",reviewer:"审批方式",workingDirectory:"工作目录"},network:{allowed:"允许",disabled:"关闭"},permissionsUpdated:"已更新当前 Sandbox Session 的 Codex 权限",persistenceUnknown:"暂时无法确认持久化能力",stoppedReady:"已停止,可继续输入",uploadedFilesPrompt:"以下文件已上传到当前 Sandbox 工作空间,请在任务中使用:",workspaceUpdated:"已更新工作空间"},l0e={addAgent:"添加智能体",addFromPackage:"从代码包添加",agent:"智能体",automations:"自动化",createAgent:"创建智能体",createSkill:"创建技能",cronJobs:"定时任务",issueFeedback:"问题反馈",library:"资源库",migrateAgent:"迁移智能体",newConversation:"新会话",optimizeSkill:"优化 {{name}}",search:"搜索",skill:"技能",skillLibrary:"技能库",systemInfo:"系统信息",updateAgent:"更新 {{name}}",codeProjects:"代码项目",reviewCenter:"审核中心"},c0e={title:"从工作区新建",description:"创建和管理代码项目,在 VS Code 中编写和调试"},u0e={actions:Kye,addAgent:Gye,approval:Xye,common:Yye,conversation:Zye,credentials:Jye,dialogs:e0e,errors:t0e,feedback:n0e,greetings:i0e,loading:r0e,oauth:s0e,providers:a0e,sandbox:o0e,titles:l0e,workspaceProjectEntry:c0e},CVe=Object.freeze(Object.defineProperty({__proto__:null,actions:Kye,addAgent:Gye,approval:Xye,common:Yye,conversation:Zye,credentials:Jye,default:u0e,dialogs:e0e,errors:t0e,feedback:n0e,greetings:i0e,loading:r0e,oauth:s0e,providers:a0e,sandbox:o0e,titles:l0e,workspaceProjectEntry:c0e},Symbol.toStringTag,{value:"Module"})),d0e="自动化",f0e="连接研发工具,为智能体扩展自动化工作流",h0e="搜索自动化",p0e="自动化分类",m0e={development:"研发",channels:"消息渠道"},g0e="{{category}}自动化列表",b0e="打开{{name}}",y0e="仅本地部署可用",v0e="没有匹配的自动化",x0e="请尝试搜索其他名称",w0e="返回自动化列表",O0e={"coding-agents":{name:"配置 Coding Agents",badge:"本地",description:"将 VeADK 和 AgentKit 内置 Skills 全局配置到 Trae、Claude Code 或 Codex。"},template:{name:"模板项目导入",description:"在您的仓库中创建一个可持续交付到 AgentKit Runtime 的最简智能体",title:"模板项目导入",subtitle:"把可直接启动 Studio 的 basic Agent 和持续交付配置加入仓库",panel:"提交后将创建一个 PR,同时导入 basic 项目和 AgentKit Runtime 发布工作流。",submitLabel:"导入模板并提交 PR",regionHelp:"必须与目标 Runtime 所在地域一致",pullRequest:{title:"feat: 导入 AgentKit basic 模板",description:"导入带有 AgentKit Studio App Server 的 basic Agent 项目,并添加持续发布到 AgentKit Runtime 的工作流。合并前请配置 {{provider}} Secrets。"},fields:{repository:{label:"GitHub 仓库",placeholder:"owner/repository",help:"支持 owner/repository 或完整 github.com URL"},baseBranch:{label:"目标分支",placeholder:"main",help:"留空时使用 main,PR 将以此分支为 base"},projectPath:{label:"Agent 项目目录",placeholder:"agentkit-basic-agent",help:"将在此目录新增 basic 项目;app.py 挂载完整 Studio App Server,并作为服务入口启动"},runtimeName:{label:"Runtime 名称",placeholder:"support-agent",help:"用于 AgentKit 发布配置"},runtimeId:{label:"运行时 ID",placeholder:"rt-xxxxxxxx",help:"持续更新的目标 AgentKit Runtime"}}},delivery:{name:"AgentKit Runtime 持续交付",description:"为您的仓库添加持续交付到 AgentKit Runtime 的自动化工作流。",title:"AgentKit Runtime 持续交付",subtitle:"用 Pull Request 把持续发布配置安全地加入代码仓库",panel:"提交后将在目标仓库创建发布分支,并发起包含 GitHub Actions 工作流的 PR。",submitLabel:"确定并提交 PR",regionHelp:"必须与目标 Runtime 所在地域一致",pullRequest:{title:"feat: 持续发布到 AgentKit Runtime",description:"新增 GitHub Actions 工作流,在目标分支更新时持续发布到 AgentKit Runtime。合并前请配置工作流所需的 {{provider}} Secrets。"},fields:{repository:{label:"GitHub 仓库",placeholder:"owner/repository",help:"支持 owner/repository 或完整 github.com URL"},baseBranch:{label:"目标分支",placeholder:"main",help:"留空时使用 main,PR 将以此分支为 base"},projectPath:{label:"Agent 项目目录",placeholder:".",help:"留空时使用仓库根目录;目录内需包含挂载完整 Studio App Server 的 app.py"},runtimeName:{label:"Runtime 名称",placeholder:"support-agent",help:"用于 AgentKit 发布配置"},runtimeId:{label:"运行时 ID",placeholder:"rt-xxxxxxxx",help:"持续更新的目标 AgentKit Runtime"}}},review:{name:"GitHub PR 自动评审",description:"通过 GitHub App 在隔离 Sandbox 中评审 Pull Request。",title:"GitHub PR 自动评审",subtitle:"通过 GitHub App 触发 Sandbox 评审,并将结果发布到 Pull Request",panel:"请先将 GitHub App 安装到目标仓库,再为每个仓库启用自动评审。",submitLabel:"安装 GitHub App",regionHelp:"",pullRequest:{title:"chore: 配置 PR 自动评审",description:"新增 GitHub Actions 工作流,在隔离 Sandbox 中评审同仓库 PR,并将结果发布为 GitHub Review。合并前请配置工作流所需 Secrets。"},fields:{repository:{label:"GitHub 仓库",placeholder:"owner/repository",help:"支持 owner/repository 或完整 github.com URL"},baseBranch:{label:"目标分支",placeholder:"main",help:"留空时使用 main,PR 将以此分支为 base"},sandboxToolId:{label:"沙箱工具 ID",placeholder:"tool-xxxxxxxx",help:"用于运行每次评审的 AgentKit CodeEnv"},modelName:{label:"评审模型",placeholder:"review-model",help:"注入 Sandbox 的代码评审模型名称"},modelBaseUrl:{label:"模型 API 地址",placeholder:"https://ark.example.com/api/v3",help:"必须使用 OpenAI 兼容的 HTTPS 地址"}}},"gitlab-review":{name:"GitLab MR 自动评审",description:"通过 GitLab 集成在隔离 Sandbox 中评审 Merge Request。"},feishu:{name:"飞书机器人",badge:"Beta",description:"创建飞书机器人,并将消息直接接入 AgentKit Runtime。"},"mpa-channels":{name:"MPA智能体消息渠道",description:"为已有 MPA 智能体绑定飞书、企业微信和钉钉。"},"website-integration":{name:"网站集成",description:"将 AgentKit Runtime 以悬浮聊天窗口嵌入网站。"}},k0e={required:"必填",optional:"可选",region:"地域",tokenLabel:"GitHub Token",getToken:"获取 Token",createToken:"创建 GitHub Token",tokenPlaceholder:"需要仓库 Contents 与 Pull requests 写权限",tokenWorkflowPlaceholder:"需要 Contents、Pull requests、Workflows 写权限",hideToken:"隐藏 Token",showToken:"显示 Token",tokenHelp:"Token 仅用于本次提交,不会保存在浏览器或写入 PR",tokenWorkflowHelp:"此处 Token 用于创建配置 PR;它不是 Sandbox 的通用必填项,且不会保存在浏览器或写入 PR",prCreated:"PR #{{number}} 已创建",configPrCreated:"配置 PR #{{number}} 已创建",configPrNextStep:"合并后,后续同仓库 PR 会自动触发评审。",viewOnGitHub:"在 GitHub 查看",viewConfigPr:"查看配置 PR",secretsHeading:"合并 PR 前,请在仓库的 GitHub Actions Secrets 中配置:",secretsConfigHeading:"合并配置 PR 前,请在目标仓库添加运行时密钥",openSecrets:"打开 Secrets 设置",secretsPath:"路径:Settings → Secrets and variables → Actions → Repository secrets",repositoryConfigHelp:"将为 {{repository}} 添加 PR 自动评审配置",repositoryReviewHelp:"将使用 GitHub App 校验 {{repository}} 的 Pull Request",secretPair:"{{accessKey}}、{{secretKey}}(必填)",sessionToken:"{{sessionToken}}(使用临时凭据时必填)",requiredSecret:"{{name}}(必填)",temporaryCredentialRequired:"(使用临时凭据时必填)",requiredSuffix:"(必填)",submitting:"提交 PR 中…",validation:{required:"此项不能为空",repository:"请输入 owner/repository 或完整 GitHub 仓库 URL",baseBranch:"目标分支格式不正确",projectPath:"请输入仓库内的相对目录",runtimeId:"运行时 ID 格式不正确",sandboxToolId:"沙箱工具 ID 格式不正确",modelName:"模型名称格式不正确",modelBaseUrlSafe:"请输入不含凭据、查询参数或锚点的 HTTPS 地址",modelBaseUrl:"请输入有效的 HTTPS 地址",runtimeName:{required:"Runtime 名称为必填项",characters:"Runtime 名称只能包含英文字母、数字、下划线和连字符",length:"Runtime 名称长度须为 4-64 个字符"}}},S0e={title:"配置 Coding Agents",description:"把随 Studio 提供的 AgentKit Skills 全局安装到本地编码客户端。",retry:"重试",clients:{ariaLabel:"选择 Coding Agent",title:"本机客户端",detectAgain:"重新检测",detecting:"正在检测本机客户端…",detected:"已检测到客户端",available:"可用",unavailable:"未检测到"},skills:{ariaLabel:"选择内置 Skill",title:"内置 Skills",viewFiles:"查看文件",items:{"veadk-agent-development":{name:"VeADK Agent 开发",description:"使用 VeADK 开发和完善 Agent。"},"agentkit-cli":{name:"AgentKit CLI",description:"通过 AgentKit CLI 管理和部署 AgentKit 资源。"}}},global:{ariaLabel:"全局安装目录",title:"全局安装",description:"配置后可在本机其他项目中使用",empty:"选择客户端后显示对应安装目录。"},success:"已为 {{agentCount}} 个客户端配置 {{skillCount}} 个 Skill",selection:"已选择 {{agentCount}} 个客户端、{{skillCount}} 个 Skill",selectClient:"请先选择客户端",configuring:"正在配置…",configure:"配置",errors:{detect:"检测本机客户端失败",configure:"配置失败,请检查用户目录权限后重试"},preview:{description:"只读浏览随 Studio 提供的 Skill 文件",close:"关闭文件预览",loading:"正在读取文件…",error:"读取 Skill 文件失败",skillFiles:"{{name}} 文件",files:"文件",fileContent:"文件内容",notPreviewable:"此文件不是可预览的 UTF-8 文本。",noFiles:"没有可预览的文件。"}},E0e={noDescription:"暂无描述",unknownCreator:"未知创建者",optionMetadata:"{{creator}} | {{createdAt}}",selectAgent:"选择 MPA 智能体",chooseAgent:"请选择 MPA 智能体",search:"搜索名称、Runtime ID 或地域",noMatches:"没有匹配的 MPA 智能体",loading:"正在加载 MPA 智能体…",empty:"暂无可管理的 MPA 智能体,请先创建或部署一个 MPA 智能体。",unauthorized:"需要 Studio 管理员权限才能管理 MPA 消息渠道,请联系管理员。",loadFailed:"加载 MPA 智能体失败,请重试。",retry:"重试",refresh:"刷新列表",loadMore:"加载更多",moreAvailable:"还有更多智能体。搜索仅匹配已加载的结果,可继续加载。",chooseHint:"选择一个 MPA 智能体后,即可配置飞书、企业微信和钉钉。"},C0e={title:"飞书机器人",description:"创建一个由 AgentKit Runtime 驱动的飞书智能体",panel:"填写已发布飞书应用的凭据,Studio 将生成 basic 智能体、创建独立 Runtime,并启用飞书消息长连接。",agentName:"智能体名称",agentNameHelp:"将作为新 Runtime 中的根智能体名称",region:"部署地域",regionHelp:"Runtime 与构建产物将创建在该地域",regions:{"cn-beijing":"北京","cn-shanghai":"上海"},appId:"飞书 App ID",appIdHelp:"来自飞书开放平台的应用凭证",appSecret:"飞书 App Secret",appSecretPlaceholder:"请输入 App Secret",appSecretHelp:"仅写入新 Runtime 的环境变量",hideSecret:"隐藏 App Secret",showSecret:"显示 App Secret",hide:"隐藏",show:"显示",confirmCancel:"取消部署将停止任务并清理已创建的 Runtime,确定继续吗?",status:{preparing:"正在生成 basic 智能体",running:"正在创建 Runtime",cancelling:"正在取消部署",succeeded:"飞书机器人 Runtime 已创建",cancelled:"部署已取消",failed:"创建失败"},steps:{prepare:"生成智能体",build:"构建镜像",deploy:"创建 Runtime",publish:"发布服务"},openConsole:"打开 Runtime 控制台",credentials:{title:"凭据处理",description:"App Secret 仅用于本次部署,不会写入生成源码或浏览器存储。"},cancelDeployment:"取消部署",creating:"正在创建…",create:"创建飞书机器人 Runtime",validation:{appId:"请输入飞书 App ID",appSecret:"请输入飞书 App Secret",agentName:{required:"名称为必填项",reserved:"user 是 Google ADK 保留名称,请使用其他名称",characters:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"}},generatedAgent:{description:"一个通过飞书接收消息并提供帮助的智能助手。",instruction:"你是一个通过飞书为用户提供帮助的智能助手。准确理解用户问题,给出简洁、可靠的回答;信息不足时先提问澄清,不要臆造事实。"}},A0e={title:d0e,description:f0e,search:h0e,categoriesLabel:p0e,categories:m0e,resultsLabel:g0e,open:b0e,localOnly:y0e,emptyTitle:v0e,emptyDescription:x0e,backToAutomations:w0e,cards:O0e,github:k0e,codingAgents:S0e,mpaChannels:E0e,feishu:C0e},AVe=Object.freeze(Object.defineProperty({__proto__:null,backToAutomations:w0e,cards:O0e,categories:m0e,categoriesLabel:p0e,codingAgents:S0e,default:A0e,description:f0e,emptyDescription:x0e,emptyTitle:v0e,feishu:C0e,github:k0e,localOnly:y0e,mpaChannels:E0e,open:b0e,resultsLabel:g0e,search:h0e,title:d0e},Symbol.toStringTag,{value:"Module"})),T0e={"zh-CN":"简体中文","en-US":"English"},TVe={languageNames:T0e},_Ve=Object.freeze(Object.defineProperty({__proto__:null,default:TVe,languageNames:T0e},Symbol.toStringTag,{value:"Module"})),_0e={selectedExcerptLabel:"选中片段",commentLabel:"批注",commentSeparator:":",successTitle:"已加入 Bad case 评测集",successDescription:"这条批注已关联当前问题和完整模型回复。",done:"完成",ariaLabel:"批注选中的模型回复",title:"添加批注",content:"批注内容",placeholder:"说明问题或期望的修改方式",retryError:"{{error}},请重试。",cancel:"取消",submit:"加入 Bad Case"},j0e={attachment:"附件",image:"图片",preview:"预览 {{name}}",uploading:"上传中",uploadFailed:"上传失败",remove:"移除 {{name}}",previewDialog:"{{name}}预览",download:"下载",close:"关闭",reading:"正在读取文档…",loadFailed:"文档加载失败:{{error}}"},N0e={errorTitle:"云端日志错误",copyError:"复制完整错误信息",retry:"重试",statuses:{live:"实时",connecting:"连接中",retrying:"重连中",idle:"未连接"},title:"实例日志",description:"当前对话请求所在的 VeFaaS 实例",close:"关闭实例日志",instanceId:"实例 ID",waitingInstance:"等待实例",request:"请求 {{id}}",ariaLabel:"VeFaaS 实例实时日志",notCapturedTitle:"尚未捕获到实例",notCapturedDescription:"发送一条消息后,这里会显示实际处理请求的实例和实时日志。",connectingTitle:"正在连接实例日志",connectingDescription:"正在通过 Studio BFF 建立安全日志流。",emptyTitle:"暂无日志",emptyDescription:"已连接实例,等待新的日志输出。",download:"下载日志",retention:"日志自动刷新,仅保留最近 {{count}} 行"},R0e={title:"调用链路观测",statuses:{loading:"加载中",ready:"",collecting:"采集中",disabled:"未开启",forbidden:"权限不足",error:"加载失败"},errors:{collecting:"调用链路仍在采集中,请稍候。",disabled:"该 Agent 未开启链路观测,请到控制台开启后重试。",forbidden:"当前账号无权读取 APMPlus 调用链路,请联系管理员补充只读权限。",error:"调用链路加载失败,请稍后重试。"},callCount:"{{count}} 个调用 · {{duration}} ms",close:"关闭",loading:"加载调用链路…",retryNow:"立即重试",reload:"重新加载",empty:"该会话暂无调用链路(可能尚未产生调用)。",attributes:"属性",selectCall:"选择左侧的一个调用查看详情"},I0e={exportNote:"上述会话由 AgentKit Studio 导出,仅供参考",imageFailed:"图片生成失败,请重试。",browserUnsupported:"浏览器无法生成会话图片,请重试。",copyUnsupported:"当前浏览器不支持复制图片,请下载后使用。",exportFailed:"导出失败,请重试。",title:"导出会话",description:"选择格式并下载截至当前回复的全部输入与输出。",close:"关闭",generatingContent:"正在生成导出内容…",retry:"重试生成",previewPage:"预览第 1 页,共 {{count}} 页",previewAlt:"会话导出内容第 1 页,共 {{count}} 页",format:"导出格式",generatingFormat:"正在生成 {{format}}…",copying:"正在复制…",copiedFirst:"已复制第一页",copied:"已复制",copyFirst:"复制第一页",copyImage:"复制图片",generating:"正在生成…",downloadArchive:"下载 PNG 压缩包({{count}} 页)",downloadFormat:"下载 {{format}}"},P0e={a2a:{connecting:"正在等待 Runtime 响应…",submitted:"任务排队中…",working:"任务执行中…"},unsupportedComponent:"不支持的组件:{{component}}",sandboxIdentity:"Codex Sandbox 执行标识",useSkill:"使用 {{name}} 技能",thinkingDone:"已完成工作思考",thinking:"工作思考中",reasoningDone:"已完成模型推理",reasoning:"模型推理中",justNow:"刚刚",sourceUnavailable:"暂时无法读取生成的源码,请稍后重试。",downloadStarted:"已开始下载",verifiedDelivery:"已验证交付物",generatedSource:"生成的 Agent 源码",entryPoint:"入口",fileCount:"文件数",size:"大小",validationTime:"验证时间",generationTime:"生成时间",checksPassed:"{{count}} 项检查通过",sourceReady:"源码已准备好,可部署",sourceGuidance:"源码已准备好,可查看、下载或部署;部署前请确认 Runtime 配置。",viewSource:"查看源码",preparing:"正在准备…",viewChanges:"查看本次变更",downloadSource:"下载源码",sourceNotReady:"源码尚未准备好",manualDeploy:"手动部署到 Runtime",deployAgent:"部署 Agent",beforeOptimization:"优化前",afterOptimization:"优化后",planStatuses:{pending:"待处理",in_progress:"进行中",completed:"已完成",failed:"未完成"},renderUi:"渲染 UI",truncated:"…(已截断)",agentAdjusting:"Agent 正在调整",sandboxDetails:"Codex Sandbox 详细输出",waitingCodex:"正在等待 Codex 输出",arguments:"参数",result:"返回",artifacts:"产物",downloadNamed:"下载 {{name}}",powerpoint:"PowerPoint 演示文稿",preview:"预览",download:"下载",previewDialog:"{{name}} 预览",closePreview:"关闭预览",slidePreview:"{{name}} 幻灯片预览",mcpToolset:"MCP 工具集",authorized:"已授权 · {{tool}}",authorizationRequired:"{{tool}} 需要授权",oauthDescription:"工具集 {{tool}} 使用 OAuth 保护,需登录授权后方可调用。",oauthProvider:"将跳转至 {{provider}} 完成登录。",oauthContinue:"授权完成后对话自动继续。",waitingAuthorization:"等待授权…",authorize:"去授权",missingAuthorizationUrl:"未在事件中找到授权地址。",tools:{web_search:{running:"正在进行网络搜索",done:"已完成网络搜索"},link_reader:{running:"正在读取网页",done:"已完成网页读取"},run_code:{running:"正在 AgentKit 沙箱中执行代码",done:"已在 AgentKit 沙箱中完成代码执行"},list_envs:{running:"正在查看可用环境",done:"已读取可用环境"},get_env_manifest:{running:"正在读取环境 Manifest",done:"已读取环境 Manifest"},execute_in_sandbox:{running:"正在环境中执行命令",done:"已在环境中完成命令执行"},delegate_to_codex_sandbox:{running:"Codex Sandbox 正在执行",done:"Codex Sandbox 已完成",failed:"Codex Sandbox 执行失败"},image_generate:{running:"正在生成图片",done:"已完成图片生成"},video_generate:{running:"正在生成视频",done:"已完成视频生成"},ppt_generate:{running:"正在生成 PPT",done:"已完成 PPT 生成"},load_memory:{running:"正在检索长期记忆",done:"已完成记忆检索"},load_knowledgebase:{running:"正在检索知识库",done:"已完成知识库检索"},load_skill:{running:"正在加载技能",done:"已加载技能"},collect_resources:{running:"正在收集可用资源",done:"已完成资源收集",failed:"资源收集失败"},create_agents:{running:"正在创建并运行 Agent",done:"已完成 Agent 创建",failed:"Agent 创建失败"}},createAgents:{categories:{skill_hub:"Skill Hub",skill_space:"AgentKit 技能中心",knowledge_base:"知识库",tool:"工具"},agentTypes:{llm:"LLM 智能体",sequential:"顺序智能体",parallel:"并行智能体",loop:"循环智能体",workflow:"工作流"},skill:"技能",subAgents:"子智能体",builtinTool:"内置工具",skillCenter:"AgentKit 技能中心",selfAuthoredTools:"自写工具",dependencies:"依赖:{{items}}",fullCode:"{{name}} 完整代码",itemCount:"{{label}} {{count}} 项",collectionAria:"召回资源信息",retrieving:"正在检索资源",retrievalFailed:"资源检索未完成",checkConfig:"请检查资源服务配置后重试。",notSearched:"未检索",notConfigured:"未配置",resourceList:"{{label}}资源列表",searchKeywords:"检索关键词",skillHubSkipped:"未提供检索关键词,本次未检索 Skill Hub。",sourceSkipped:"未配置 {{label}},本次未检索该来源。",noResources:"本次检索未返回该类别的资源。",resultAria:"创建 Agent 结果",creationFailed:"Agent 创建未完成",agentResources:"{{name}} 具备的资源",knowledgeBase:"知识库",toolsLabel:"工具",creating:"正在创建 Agent",noAgents:"没有可展示的 Agent",noAgentResult:"工具返回中未包含 Agent 配置或执行结果。",sourceLabels:{tool:"工具",knowledge:"AgentKit 知识库",skillCenter:"AgentKit 技能中心",unknown:"未知来源"},unnamedResource:"未命名资源",unnamedAgent:"未命名 Agent"},branchCompare:{ariaLabel:"分支对比",selectDirection:"选择方向",continue:"继续这个方向"},codexProgress:{planTitle:"Codex 执行计划",fallback:{fileChange:"修改文件",approval:"等待操作批准",status:"Codex 状态",command:"运行命令"},planSummary:"已完成 {{completed}}/{{total}} 项",command:{running:"正在执行命令",completed:"命令执行完成",failed:"命令执行失败"},projectFiles:"{{count}} 个项目文件",projectFile:"项目文件",fileChange:{running:"正在更新{{subject}}",completed:"已更新{{subject}}",failed:"更新{{subject}}失败"},externalTool:"外部工具",mcp:{running:"正在调用工具 {{tool}}",completed:"已调用工具 {{tool}}",failed:"工具 {{tool}} 调用未完成"},collaboration:{spawn_agent:{running:"正在启动子任务",completed:"子任务已启动",failed:"子任务启动失败"},send_input:{running:"正在向子任务发送信息",completed:"已向子任务发送信息",failed:"向子任务发送信息失败"},wait:{running:"正在等待子任务",completed:"子任务等待已结束",failed:"等待子任务失败"},close_agent:{running:"正在结束子任务",completed:"子任务已结束",failed:"子任务结束失败"},default:{running:"正在协调子任务",completed:"子任务协作已完成",failed:"子任务协作失败"}},webSearch:{running:"正在进行网络搜索",completed:"已完成网络搜索",failed:"网络搜索未完成"},errorDetail:"Codex 执行未完成。",errorTitle:"Codex 执行遇到错误"},toolActivity:{status:{queued:"等待执行",running:"正在执行",completed:"执行成功",failed:"执行失败"},goal:{queued:"等待创建目标",running:"正在创建目标",completed:"已创建目标",failed:"创建目标失败"},command:{queued:"等待运行命令",running:"正在运行命令",completed:"已运行命令",failed:"命令执行失败"},read:{queued:"等待读取",running:"正在读取",completed:"已读取内容",failed:"读取失败"},search:{queued:"等待搜索",running:"正在搜索",completed:"已完成搜索",failed:"搜索失败"},"file-change":{queued:"等待修改文件",running:"正在修改文件",completed:"已修改文件",failed:"文件修改失败"},mcp:{queued:"等待调用外部工具",running:"正在调用外部工具",completed:"已调用外部工具",failed:"外部工具调用失败"},authorization:{queued:"等待授权",running:"等待授权",completed:"授权已完成",failed:"授权失败"},generic:{queued:"等待调用工具",running:"正在调用工具",completed:"已调用工具",failed:"工具调用失败",named:{queued:"等待调用 {{tool}}",running:"正在调用 {{tool}}",completed:"已调用 {{tool}}",failed:"{{tool}} 调用失败"}},exitCode:"退出码 {{code}}",omittedLines:"… 省略 {{count}} 行 …",omittedCharacters:"… 省略 {{count}} 个字符 …",rawData:"查看原始数据",callId:"调用 ID",copyCallId:"复制调用 ID",copy:"复制",copied:"已复制",copyFailed:"复制失败,请重试。",explored_one:"已探索 1 项",explored_other:"已探索 {{count}} 项"}},D0e={segments:{system:"系统与工具",input:"输入与历史",output:"输出与思考",remaining:"剩余"},modelUnavailable:"模型信息未提供",promptWithSystem:"提示词(含系统)",systemUnknown:"系统与工具占用未知",systemApprox:"系统与工具约 {{count}} Token",ariaKnown:"上下文已使用 {{percentage}}%,{{system}},{{inputLabel}} {{input}} Token,输出与思考 {{output}} Token,剩余 {{remaining}} Token",ariaUnknown:"{{model}},上下文窗口未知,会话累计使用 {{count}} Token",composition:"上下文构成",percentageUsed:"{{percentage}}% 已用",gridAria:"100 格上下文构成图,每格代表上下文窗口的百分之一",estimated:"估算",unknown:"未知",summaryPercentage:"{{used}} 已用,剩余 {{remaining}}",summaryTokens:"{{used}} 已用,剩余 {{remaining}},总计 {{total}}",overflow:"已超出上下文 {{count}} Token",title:"上下文用量",category:"类型",currentTurn:"当前轮",sessionTotal:"会话累计",details:{input:"输入",output:"输出",reasoning:"推理",cache:"缓存命中",total:"总计"},unknownModel:"暂未收录该模型的上下文窗口",unknownRuntime:"当前 Runtime 未提供模型信息"},M0e={title:"添加 AgentKit 智能体",noAgents:"连接成功,但该地址未发现任何 Agent(/list-apps 为空)。",connectionFailed:"连接失败:{{error}}。请检查 URL、API Key,以及该网关是否允许跨域。",description:"填入 AgentKit 部署的访问地址与 API Key,将通过 ADK 协议连接,连接成功后其 Agent 会出现在左上角的下拉中。",url:"访问地址 URL",apiKeyHint:"以 Authorization: Bearer 方式连接",displayName:"显示名称(可选)",displayNameHint:"默认取 URL 的主机名",cancel:"取消",connecting:"连接中…",connect:"连接并添加"},L0e={placeholder:"输入消息…",inputAria:"输入消息",generating:"正在生成",send:"发送",model:"模型"},$0e={ariaLabel:"本轮调用上下文",removeSkill:"移除技能 {{name}}",removeAgent:"移除 Agent {{name}}"},F0e={cardAria:"{{label}} 图表",viewAria:"{{label}} 显示方式",preview:"预览",code:"代码",invalidEcharts:"ECharts 配置不是有效且安全的数据对象,请切换到代码检查内容。",renderFailed:"图表暂时无法渲染,请切换到代码检查内容。",echartsAria:"ECharts 图表预览",rendering:"正在渲染图表…",mermaidFailed:"图表暂时无法渲染,请切换到代码查看 Mermaid 内容。",mermaidAria:"Mermaid 图表预览"},B0e={downloadFile:"下载文件",downloading:"下载中…",downloadFailed:"下载失败。请确认 Sandbox 和文件仍可用,然后点击重试。",playVideo:"点击播放视频:{{name}}",enlargeImage:"放大预览:{{name}}",image:"图片",enlargeVideo:"点击放大视频",videoPreview:"视频预览",downloadVideo:"下载视频",close:"关闭"},U0e={annotation:_0e,media:j0e,runtimeLogs:N0e,trace:R0e,share:I0e,blocks:P0e,tokenUsage:D0e,addAgentKit:M0e,composer:L0e,invocation:$0e,visualization:F0e,markdown:B0e},jVe=Object.freeze(Object.defineProperty({__proto__:null,addAgentKit:M0e,annotation:_0e,blocks:P0e,composer:L0e,default:U0e,invocation:$0e,markdown:B0e,media:j0e,runtimeLogs:N0e,share:I0e,tokenUsage:D0e,trace:R0e,visualization:F0e},Symbol.toStringTag,{value:"Module"})),Q0e={back:"返回",cancel:"取消",deploy:"部署",delete:"删除",loading:"读取中…",next:"下一步",notSupported:"暂不支持",previous:"上一步",required:"必填",retry:"重试",actions:"操作",value:"值",disabled:"关闭",enabled:"已开启",none:"无",close:"关闭",name:"名称",description:"描述",send:"发送"},z0e={heading:"VeADK Agent 结构配置",importHint:"可在「创建 Agent」页通过「导入 YAML」重新载入。"},V0e={agentName:{required:"名称为必填项",reserved:"user 是 Google ADK 保留名称,请使用其他名称",characters:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"},runtimeName:{required:"Runtime 名称为必填项",characters:"Runtime 名称只能包含英文字母、数字、下划线和连字符",length:"Runtime 名称长度须为 4-64 个字符"}},H0e={description:"一个基于 VeADK 构建的智能助手,理解用户意图并调用合适的工具完成任务。",instruction:`你是一个专业、可靠的智能助手。 你的目标是准确理解用户的需求,并给出条理清晰、简洁有用的回答。 约束: - 信息不足时主动提问澄清,不要臆造事实。 - 需要时合理调用可用的工具,并说明关键结论。 -- 保持礼貌、专业的语气。`},H0e={requestFailed:"请求失败 ({{status}}){{detail}}",a2aSpaces:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 AgentKit 智能体中心",loginRequired:"请先登录以访问 AgentKit 智能体中心"},vikingKnowledge:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 VikingDB 知识库",loginRequired:"请先登录以访问 VikingDB 知识库"},vikingMemory:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 VikingDB 记忆库",loginRequired:"请先登录以访问 VikingDB 记忆库"},mcpGateway:{missingHttpTool:"请返回“添加 MCP 工具”并添加至少一个 HTTP MCP 服务;MCP 稳定性治理不支持 stdio 服务。",missingUrl:"已添加的 HTTP MCP 工具缺少有效服务地址,请返回“添加 MCP 工具”补充后再发布。"},customModel:{fallbackName:"自定义模型",apiKeyLabel:"{{name}} 模型 API Key",fallbackApiKeyLabel:"{{name}} 的备用模型 {{model}} API Key"},deploymentEnv:{serverInjected:"由服务端注入",selectedApiKeyPlaceholder:"由所选 API Key 注入",mcpInjectedComment:"由已添加的 MCP 工具注入",restoredPlaceholder:"由 Studio 服务端安全恢复",generatedMcpPlaceholder:"由已添加的 HTTP MCP 工具自动生成",restoredHelp:"更新时由 Studio 服务端合并 MCP 地址与认证,不向浏览器返回旧密钥。",mergedMcpHelp:"Studio 服务端自动合并 MCP 地址与可选认证,不向浏览器返回旧密钥。",listSeparator:"、",requirementHint:"优化项“{{labels}}”依赖此配置。",requiredBy:"优化项“{{labels}}”依赖此配置,请填写 {{key}}。",required:"请填写 {{label}}({{key}})。",invalidJson:"JSON 格式不正确"},drafts:{unsupportedVersion:"本机草稿版本暂不受支持,请升级 Studio 后重试。",invalidFormat:"本机草稿数据格式无效。",readFailed:"无法读取本机草稿,浏览器中的草稿数据可能已损坏。",quotaExceeded:"浏览器存储空间不足,草稿未保存。请删除不需要的草稿或清理此站点的浏览器存储后重试。",writeRejected:"浏览器拒绝保存草稿,请检查站点存储权限后重试。"},skills:{searchFailed:"搜索失败 ({{status}})",downloadFailed:"下载技能失败 ({{status}})",agentKitRequestFailed:"AgentKit Skills 请求失败",missingManifest:"{{location}} 缺少 SKILL.md",invalidParentPath:"{{location}} 包含非法路径(..):{{path}}",invalidPath:"{{location}} 包含非法路径:{{path}}",localDescription:"本地 Skill",folderSource:"文件夹",noManifest:"{{location}} 中未发现 SKILL.md"},zip:{invalid:"无效的 zip:找不到 EOCD",tooManyFiles:"zip 文件数不能超过 {{count}} 个",tooLarge:"zip 解压后的内容过大"}},q0e={back:"返回开发会话",runtimeName:"Runtime 名称",runtimeNameExists:"Runtime 名称已存在,请更换后重试",checkingRuntimeName:"正在检查 Runtime 名称",verifiedSource:"已验证源码",deployableSource:"可部署源码",verifiedByCodex:"已通过 Codex 云端验证",entryPoint:"入口",files:"文件",artifact:"构建产物",validationReport:"验证报告",verifiedHint:"源码由服务端从已验证交付物物化,浏览器文件不能替换。",unverifiedHint:"源码已由服务端安全物化,部署前请确认 Runtime 配置。",env:{requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}"}},W0e={name:"代码包",back:"返回创建方式",reading:"正在读取代码包",readingEllipsis:"正在读取代码包…",uploadFirst:"请先上传代码包",uploadAriaLabel:"代码包上传",upload:"上传代码包",reupload:"重新上传代码包",uploadPrompt:"请上传代码包",filesRecognized:"已识别 {{count}} 个文件,点击区域可重新上传",dropHint:"点击或拖拽上传,支持 .zip 格式,最大 50 MB;可使用 app.py,或由 agentkit.yaml 声明入口",viewFiles:"查看文件",chooseFile:"选择代码包",errors:{invalidFormat:"请选择 .zip 格式的代码包。",tooLarge:"代码包不能超过 50 MB。",invalidPath:"压缩包包含非法路径:{{name}}",empty:"压缩包中没有可部署的文件。",tooManyFiles:"代码包文件数不能超过 {{count}} 个。",duplicateFile:"代码包包含重复文件:{{path}}",manifestParse:"agentkit.yaml 无法解析:{{detail}}",manifestRoot:"agentkit.yaml 根节点必须是对象。",manifestCommon:"agentkit.yaml 的 common 必须是对象。",entryPointType:"agentkit.yaml 的 common.entry_point 必须是文件路径。",entryPointInvalid:"agentkit.yaml 的 common.entry_point 不是有效文件路径。",entryPointMissing:"代码包中不存在 agentkit.yaml 声明的启动入口:{{entryPoint}}",defaultEntryPointMissing:"代码包根目录必须包含 app.py,或在 agentkit.yaml 的 common.entry_point 中声明已有入口。"}},K0e={label:"Agent 执行画布",readOnlyLabel:"只读 Agent 执行画布",minimapLabel:"执行流程缩略图",controls:{ariaLabel:"执行流程控制",zoomIn:"放大",zoomOut:"缩小",fitView:"适应视图"},rootAgent:"主 Agent",unnamedStep:"未命名步骤",terminals:{input:"用户请求",output:"最终回复"},edges:{then:"然后",continueLoop:"继续循环",call:"调用"},patterns:{llm:{label:"智能体",description:"理解任务并直接完成一个具体工作"},sequential:{label:"分步协作",description:"内部步骤按照顺序依次执行"},parallel:{label:"同时处理",description:"内部步骤同时工作,完成后统一汇总"},loop:{label:"循环执行",description:"重复执行内部步骤,直到满足停止条件"},a2a:{label:"远程智能体",description:"调用已经存在的远程 Agent"}},actions:{insertHere:"在这里插入步骤",deleteNamed:"删除 {{name}}",deleteNode:"删除节点",addSubagent:"添加子 Agent",addParallelStep:"添加一个同时处理的步骤",addLoopStep:"添加循环步骤",addNextStep:"添加下一个步骤",addFirst:"添加到最前",addLast:"添加到最后"}},G0e={title:"智能构建",subtitle:"描述需求,完成 Agent 的构建、调试与验证。",model:{label:"模型",placeholder:"选择模型",retiring:"即将下线",currentConfiguration:"当前配置",loadError:"加载模型列表失败"},availability:{checking:"正在检查智能开发能力…",unavailable:"当前无法使用智能模式,请返回后重试。"},goal:{title:"从目标开始",continueTitle:"继续优化项目",hint:"只需说明 Agent 要解决的问题;如有影响结果的关键信息,会在开始前向你确认。",continueHint:"说明这次要调整的内容,完成后会保存为新版本。",basedOn:"基于",clearSelection:"取消选择",label:"目标描述",optimizationLabel:"优化目标",placeholder:"例如:创建一个能读取销售数据、生成周报并校验输出格式的 Agent",optimizationPlaceholder:"例如:增加数据来源标注,并在信息不足时先向用户确认"},actions:{preparing:"准备中…",build:"开始构建",optimize:"开始优化"},preparation:{accepted:"目标已收到,马上开始实现",preparing:"正在创建任务环境…",starting:"环境已就绪,正在启动 Codex…",next:"接下来会先梳理目标和实现方式,再编写、运行和验证 Agent。"},tasks:{title:"进行中的任务",hint:"离开页面后仍会继续,可随时回来查看和补充要求。",refresh:"刷新任务列表",loading:"正在读取任务…",empty:"暂无进行中的任务",emptyHint:"开始构建后,可以从这里回到任务。",loadError:"暂时无法读取任务,请重试。",openError:"暂时无法打开任务,请重试。",startedAt:"开始于 {{time}}",open:"查看任务",opening:"正在连接…",states:{queued:"等待开始",running:"构建中",recovering:"正在重连",waiting_user:"等待你的回复",stopping:"正在停止",succeeded:"已完成",failed:"未完成",cancelled:"已停止"}}},X0e={title:"已保存项目",description:"选择已有版本继续优化,或查看、下载和部署源码。",refresh:"刷新项目列表",checkingStorage:"正在检查项目存储…",unavailableTitle:"暂时无法读取项目",storageCheckError:"无法确认项目存储状态,请稍后重试。",storageNotConfigured:"项目存储尚未配置。",loadingMigrated:"正在读取已迁移项目…",loadingSaved:"正在读取已保存项目…",loadingVersions:"正在读取项目版本…",unknownTime:"时间未知",sourceDownloaded:"源码已下载。",projectSummary_one:"{{count}} 个版本 · 更新于 {{time}}",projectSummary_other:"{{count}} 个版本 · 更新于 {{time}}",versionSummary_one:"{{time}} · {{count}} 个文件",versionSummary_other:"{{time}} · {{count}} 个文件",noVersionDescription:"暂无版本描述",latestVersion:"最新版本",defaultVersionName:"版本 · {{time}}",rename:{projectTitle:"修改项目名称",versionTitle:"修改版本名称",projectLabel:"项目名称",versionLabel:"版本名称",hint:"支持中英文、数字和常见标点,最多 {{max}} 个字符。",required:"请输入名称。",tooLong:"名称不能超过 {{max}} 个字符。",invalidCharacters:"名称不能包含换行、控制字符、不可见格式字符或 < >。",save:"保存名称",saving:"保存中…",updated:"名称已更新。",failed:"名称保存失败,请重试。"},verified:"已验证",pendingVerification:"待确认",viewSource:"查看源码",download:"下载",downloading:"下载中…",optimize:"去优化",optimizeUnavailable:"去优化,暂不支持",errors:{projects:"无法读取已保存项目。",source:"无法读取项目源码。",versions:"无法读取项目版本。",download:"下载源码失败。",prepareDeployment:"无法准备部署源码。",deleteVersion:"删除项目版本失败。",migrated:"无法读取已迁移项目",saved:"无法读取已保存项目"},empty:{migratedTitle:"还没有已迁移的项目",savedTitle:"还没有已保存的项目",migratedDescription:"完成首次迁移后,源码会自动保存在这里。",savedDescription:"完成首次构建后,源码会自动保存在这里。",noVersions:"这个项目还没有可用版本。"},compare:{selected:"已选择 {{count}}/2",selectedLabel:"已选择",select:"选择",view:"查看对比",start:"对比版本"},delete:{title:"删除这个版本?",onlyVersion:"“{{name}}”只有这一个版本,删除后项目也会移除。此操作无法撤销。",description:"该版本的源码和验证记录将永久删除,其他版本不受影响。",confirm:"删除版本"}},Y0e={title:"选择创建方式",subtitle:"以不同模式构建您的智能体",features:"特性",quick:{title:"快速模式",description:"动态派生子智能体自主完成任务",features:{dynamicSubagents:"动态派生子智能体",autonomousPlanning:"自主规划执行",collaboration:"多智能体协作",summary:"自动汇总结果",skills:"按需调用技能",trace:"任务过程可追踪"}},traditional:{title:"传统模式",description:"高度自定义您的智能体结构",features:{visualConfig:"可视化配置",migration:"存量智能体迁移",debugging:"实时调试",optimization:"可选性能优化",parameters:"精细参数控制"}}},Z0e={placeholder:"输入系统提示词;键入 ## 加空格可创建二级标题…",toolbar:{undo:"撤销 {{shortcut}}",redo:"重做 {{shortcut}}",paragraph:"正文",quote:"引用",heading:"标题 {{level}}",selectBlockType:"选择文本类型",blockType:"文本类型",bold:"加粗",removeBold:"取消加粗",italic:"斜体",removeItalic:"取消斜体",bulletedList:"无序列表",numberedList:"有序列表"}},J0e={local:{duplicatesSkipped:"已跳过重复技能:{{names}}",invalidDrop:"请拖入包含 SKILL.md 的文件夹或一个 .zip 文件",readError:"读取失败:{{detail}}",dropLabel:"拖入文件夹或 ZIP,自动识别 Skill",hint:"每个技能需包含 SKILL.md。支持包含多个技能的目录。",reading:"正在读取文件…",fileCount:"本地 · {{count}} 个文件"},hub:{searchError:"搜索失败,请稍后重试。",searchPlaceholder:"搜索火山 Find Skill 技能广场,例如 数据分析、PDF…",search:"搜索",searching:"正在搜索…",noResults:"没有找到匹配的技能,换个关键词试试。",hint:"输入关键词搜索火山 Find Skill 技能广场,所选技能会在生成项目时下载到 skills/ 目录。"},space:{loadError:"加载失败",loadingSpaces:"正在加载 AgentKit Skills 中心…",noSpaces:"此账号下没有 AgentKit Skills 中心。",selectSpace:"选择 AgentKit Skills 中心",openConsole:"在火山引擎控制台打开",loadingSkills:"正在加载技能列表…",noSkills:"此 AgentKit Skills 中心暂无技能。"}},eve={unnamedNode:"未命名节点",editInstruction:"点击编辑指令…",controls:{ariaLabel:"工作流画布控制",zoomIn:"放大",zoomOut:"缩小",fitView:"适应视图"},sections:{info:"工作流信息",execution:"执行方式",nodes:"节点",nodeConfig:"节点配置"},types:{sequential:{label:"顺序",description:"节点依次执行"},parallel:{label:"并行",description:"节点同时执行"},loop:{label:"循环",description:"节点循环执行"}},placeholders:{description:"这个工作流做什么…",agentDescription:"这个 Agent 做什么…",instruction:"你是一个…"},errors:{workflowNameUnique:"名称须与 Agent 节点名称保持唯一",agentNameUnique:"Agent 名称在当前工作流中必须唯一"},dragHint:"拖拽到画布,或点击下方按钮添加",agentNode:"Agent 节点",addNode:"添加节点",connectHint:"拖拽节点的圆点连线以表达执行顺序。",create:"创建工作流",deleteNode:"删除节点",nameHelp:"仅使用英文字母、数字和下划线,且名称保持唯一。",instruction:"指令 (instruction)",tools:"工具 (逗号分隔)",nodeId:"节点 ID",empty:{selectNode:"选择一个节点以编辑其配置",summary:"共 {{nodes}} 个节点 · {{edges}} 条连线"}},tve={ariaLabel:"快速模式创建",progress:"快速模式创建进度",steps:{agent:{label:"智能体",title:"基本信息",description:"设置智能体的名称、用途、行为方式与能力"},environment:{label:"执行环境",title:"配置执行环境",description:"选择默认环境或已构建的自定义环境"},deployment:{label:"部署偏好",title:"部署偏好",description:"定义 AgentKit 云上参数"}},model:{label:"模型",source:"模型来源",name:"模型名称",fallbacks:"Fallback 模型",fallbackPlaceholder:"备用模型名称",addFallback:"添加备用模型",addProviderFallback:"添加其他服务商",removeFallback:"移除",fallbackType:"备用模型类型",fallbackSameProvider:"同服务商",fallbackOtherProvider:"其他服务商",apiKeyEnv:"API Key 环境变量",invalidApiKeyEnv:"环境变量名只能包含字母、数字和下划线,且不能以数字开头。",fallbackHelp:"同服务商备用模型复用主模型连接;其他服务商会使用单独的 provider、API Base 和 API Key。",fallbackIgnored:"空值、重复值或与主模型相同的模型会被忽略。",provider:"服务商 Provider",invalidApiBase:"请输入合法的 http:// 或 https:// 链接。",volcengineArk:"火山方舟",custom:"自定义",gateway:"模型网关",comingSoon:"待上线",currentApiKey:"当前 API Key",currentConfiguration:"当前配置",loadingApiKeys:"正在加载 API Key",selectApiKey:"选择 API Key",searchApiKeys:"搜索 API Key 名称",noApiKeys:"暂无可用 API Key",loadingModels:"正在加载模型",selectModel:"选择模型",searchModels:"搜索名称、Model ID 或服务商",noModels:"没有可用的模型",apiKeyPlaceholder:"请输入模型 API Key",credentialsLoadError:"模型凭据加载失败",modelsLoadError:"模型列表加载失败"},identity:{unnamedPool:"未命名用户池",currentPool:"{{value}}(当前用户池)",userPool:"用户池",loading:"正在加载用户池",placeholder:"请选择用户池",search:"搜索用户池",empty:"当前账号下暂无 Identity 用户池",currentHint:"当前 Studio 的登录 JWT 将透传访问此 Runtime",mismatchHint:"所选用户池不是当前 Studio 使用的用户池,部署后无法从 Studio 调用此 Runtime",selectionHint:"当前 Studio 使用的用户池已在列表中标注"},agent:{namePlaceholder:"输入智能体名称",descriptionPlaceholder:"说明这个智能体可以做什么",prompt:"提示词",promptPlaceholder:"定义角色、目标和行为边界",skills:"技能",addSkill:"添加技能"},validation:{descriptionRequired:"请输入描述",promptRequired:"请输入提示词",modelRequired:"请选择模型",apiKeyRequired:"请先填写或选择模型 API Key",instanceIntegers:"最小实例数必须为大于等于 0 的整数,最大实例数必须为大于 0 的整数",instanceOrder:"最小实例数不能大于最大实例数",userPoolRequired:"请选择用于 Runtime 鉴权的用户池"},deployment:{runtimeName:"Runtime 名称",runtimeNameUpdateHint:"更新时保持现有 Runtime 名称不变",runtimeNameHint:"仅支持英文字母、数字、下划线和连字符",region:"发布区域",authentication:"鉴权方式",apiKeyDescription:"默认方式,使用 Runtime API Key 访问",userPoolDescription:"使用 Identity 用户池签发的 JWT",sessionStorage:"会话存储",inMemoryStorage:"In-memory 临时存储",backends:{sqlite:"SQLite 文件",mysql:"MySQL",postgresql:"PostgreSQL"},instances:"实例设置",minInstances:"最小实例数",maxInstances:"最大实例数",inMemoryHint:"为避免多实例间会话丢失,推荐将 Runtime 固定为 1~1",networkMode:"网络模式",network:{public:"公网",private:"私网",both:"公网与私网"},subnetIds:"子网 ID(可选,多个用逗号分隔)",sharedInternet:"VPC 内共享公网出口",sharedInternetHint:"允许私网 Runtime 通过共享出口访问公网",evaluationSets:"评测集",createEvaluationSets:"自动创建评测集",evaluationSetsHint:"部署成功后自动创建 Good Case 和 Bad Case 评测集",resources:"资源配置",complete:"部署已完成",preparing:"正在准备部署…"},environmentVariables:{title:"环境变量",add:"添加变量",nameAriaLabel:"环境变量名称",valueAriaLabel:"{{name}} 的值",deleteNamed:"删除 {{name}}"},actions:{updateAgain:"再次更新",deployAgain:"重新部署",updateAndPublish:"更新并发布",applyProfile:"应用 Profile",applyProfileAgain:"再次应用 Profile"}},nve={actions:{addSubagent:"添加子 Agent",clearRoot:"清空根 Agent",clearRootConfirmation:"清空根 Agent 的全部配置和子 Agent?此操作无法撤销。"},workspace:{progress:"Agent 创建进度",modes:{build:"架构",validate:"调试",optimize:"优化",environment:"环境",publish:"发布"},titles:{build:"个性化您的智能体架构",validate:"调试您的智能体",optimize:"为您的智能体选择优化项",environment:"配置云上环境",publish:"准备好部署您的智能体"}},sections:{type:{label:"Agent 类型",hint:"选择 Agent 类型"},basic:{label:"基本信息",hint:"名称、描述与系统提示词"},model:{label:"模型配置",hint:"模型与服务(可选)"},tools:{label:"工具",hint:"可调用的能力"},skills:{label:"技能",hint:"声明式技能"},knowledge:{label:"知识库",hint:"外部知识检索"},memory:{label:"记忆",hint:"短期与长期记忆"},subagents:{label:"子 Agent",hint:"嵌套协作"},review:{label:"完成",hint:"预览并创建"}},agentTypes:{ariaLabel:"Agent 类型",remoteChildOnly:"远程智能体只能作为子步骤使用",llm:{label:"智能体",fullLabel:"LLM 智能体",description:"大模型驱动,自主完成任务"},sequential:{label:"分步协作",fullLabel:"顺序型智能体",description:"子 Agent 按顺序依次执行"},parallel:{label:"同时处理",fullLabel:"并行型智能体",description:"子 Agent 并行执行后汇总"},loop:{label:"循环执行",fullLabel:"循环型智能体",description:"子 Agent 循环执行到满足条件"},a2a:{label:"远程智能体",fullLabel:"远程 Agent",description:"通过 A2A 协议调用远程 Agent"}},basic:{agentName:"Agent 名称",name:"名称",agentDescription:"智能体描述",descriptionPlaceholder:"简要描述这个 Agent 的用途,便于团队识别…",nameHelp:"遵循 Google ADK 命名规则,且在执行流程中保持唯一。",rootDescriptionHelp:"完整描述会保留;部署时会自动整理为符合 Runtime 规范的单行描述。",descriptionHelp:"描述会显示在 Agent 列表与选择器中。",orchestratorHelp:"这是一个协作容器,本身不生成回答。请在左侧画布中添加任务步骤,并通过拖拽调整它们的位置。",maxIterations:"最大轮次",maxIterationsHelp:"循环编排反复执行子 Agent,直到满足条件或达到该轮次上限。",agentCenter:"AgentKit 智能体中心",agentCenterHelp:"远程 Agent 的名称、描述和能力来自中心返回的 Agent Card。系统会根据每轮任务动态发现并挂载匹配的 Agent。",moreOptions:"更多选项",systemPrompt:"系统提示词",loadingMarkdown:"正在加载 Markdown 编辑器…",markdownHelp:"支持 Markdown 快捷输入,例如键入 ## 加空格创建二级标题。",unnamed:"未命名",unnamedAgent:"未命名智能体"},validation:{remoteRoot:"远程 Agent 只能作为子 Agent",missingRegistry:"请选择 AgentKit 智能体中心",name:{required:"名称为必填项",reserved:"user 是 Google ADK 保留名称,请使用其他名称",characters:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"},duplicateName:"Agent 名称在当前结构中必须唯一",missingDescription:"描述为必填项",mcpDuplicateName:"MCP 名称重复,请为每个服务使用唯一名称",mcpDuplicateUrl:"MCP 地址重复,请删除重复服务后再发布",missingSubagent:"缺少子 Agent",missingPrompt:"系统提示词为必填项",apiKeyRequired:"请先填写或选择模型 API Key",missingSubagentDetail:"{{type}}至少需要添加一个子 Agent 后才能调试或发布。",problem:"{{name}}:{{problem}}"},ai:{ariaLabel:"AI 自动填写 Agent 配置",minimumLength:"请至少输入 {{count}} 个字符。",replaceConfirmation:"生成的新配置会替换当前画布和属性,确定继续吗?",placeholder:"描述目标,使用 {{model}} 模型一键生成配置",generate:"智能生成",generating:"正在智能生成",success:"生成成功",regenerate:"重新生成",failed:"智能生成失败"},debug:{ariaLabel:"智能体调试工作区",unavailable:"当前后端暂不支持生成 Agent 调试运行。",baseline:"基准组",comparison:"对照组 {{count}}",selectModel:"请选择模型",enterDescription:"请输入描述",enterPrompt:"请输入系统提示词",duplicateConfiguration:"测试配置不能重复",starting:"启动中…",applyAndRestart:"应用并重启",restart:"重新启动",start:"启动环境",defaultModel:"默认模型",testConfiguration:"测试配置",deleteVariant:"删除 {{name}}",deleteVariantGroup:"删除对照组",creatingEnvironment:"正在创建测试环境…",configurationChanged:"配置已变更,请重新启动环境。",ready:"环境已就绪",readyHint:"发送消息以比较智能体回复。",startHint:"先完善配置,再启动环境。",viewTraceNamed:"查看 {{name}} 的调用链路",traceUnavailable:"发送消息后可查看调用链路",trace:"调用链路",useConfiguration:"使用此配置",finishConfiguration:"完成配置",finishAndStart:"完成并启动",currentAgentModel:"当前 Agent 模型",configurationHint:"修改仅用于本次对比,选择使用后才会进入部署流程。",messagePlaceholder:"向已启动的测试环境发送消息…",startOneFirst:"请先启动至少一个测试环境",addVariant:"添加对照组",traceTitle:"调用链路 · {{name}}",leaveTitle:"离开调试?",leaveDescription:"离开调试页面后,当前环境将被清理。您可以通过重新启动环境进行新的测试。",cleaning:"清理中…",confirmLeave:"确定离开",closeLeaveConfirmation:"关闭离开调试确认"},optimization:{ariaLabel:"智能体优化选项",scenario:"优化场景",components:"优化组件",bytePlusUnavailable:"BytePlus 账号暂不支持 Harness Sidecar 优化项。请保持优化项为空后继续部署,普通 BytePlus 智能体不受影响。",releaseScenario:"优化场景:{{profile}}",profiles:{default:{label:"自定义",description:"按需选择组件,不勾选时不启动 Sidecar。"},ops:{label:"运维场景",description:"适用于运维诊断、数据库、日志和监控 MCP。"}},groups:{quality:"提升回答质量",cost:"降低运行成本",stability:"增强运行稳定性"},options:{context_engine:{label:"上下文治理",description:"治理上下文组装、任务锚定和上下文预算。"},compressor:{label:"上下文与结果压缩",description:"压缩长上下文和大型工具结果,降低 Token 成本。"},verifier:{label:"回答校验与修复",description:"校验证据和回答,在失败时执行修复或告警。"},long_run_control:{label:"Goal 任务控制",description:"管理 Goal 任务的进度、续跑和结束条件。"},mcp_resilience:{label:"MCP 稳定性治理",description:"治理连接、超时、空结果、大返回和调用预算;默认包含 SQL 只读保护。"}}},model:{label:"模型",source:"模型来源",volcanoArk:"火山方舟",volcengineArk:"火山方舟",bytePlusModelArk:"BytePlus ModelArk",custom:"自定义",gateway:"模型网关",comingSoon:"待上线",configuration:"模型配置",name:"模型名称",fallbacks:"Fallback 模型",fallbackPlaceholder:"备用模型名称",addFallback:"添加备用模型",addProviderFallback:"添加其他服务商",removeFallback:"移除",fallbackType:"备用模型类型",fallbackSameProvider:"同服务商",fallbackOtherProvider:"其他服务商",apiKeyEnv:"API Key 环境变量",invalidApiKeyEnv:"环境变量名只能包含字母、数字和下划线,且不能以数字开头。",fallbackHelp:"同服务商备用模型复用主模型连接;其他服务商会使用单独的 provider、API Base 和 API Key。",fallbackIgnored:"空值、重复值或与主模型相同的模型会被忽略。",provider:"服务商 Provider",invalidApiBase:"请输入合法的 http:// 或 https:// 链接。",liteLlmProviders:"LiteLLM 支持列表",apiKeyPlaceholder:"请输入模型 API Key",available:"已开通",retiring:"即将下线",notActivated:"未开通",unavailable:"暂不可用",apiKeyLoadError:"加载 Ark API Key 失败",loadingApiKeys:"正在加载 API Key…",selectApiKey:"选择 API Key",currentApiKey:"当前 API Key",apiKeyList:"API Key 列表",searchApiKey:"搜索 API Key",searchApiKeyName:"搜索 API Key 名称",noApiKeys:"暂无可用 API Key",noMatchingApiKey:"没有匹配的 API Key",loading:"正在加载模型…",loaded:"已加载 {{count}} 个模型",loadError:"加载模型失败",selectModel:"选择模型",selectProviderModel:"选择服务商模型",providerModels:"服务商模型",search:"搜索模型",searchPlaceholder:"搜索名称、Model ID 或服务商",noMatches:"没有匹配的模型",empty:"暂无可用模型",unknownStatus:"未知状态",refresh:"刷新",refreshing:"刷新中…",activate:"开通",activateAction:"前往开通",currentConfiguration:"当前配置"},tools:{builtIn:"内置工具",builtInHelp:"勾选 VeADK 提供的内置能力,生成时会自动补全 import 与所需环境变量。",codeExecution:"代码执行配置",codeExecutionHelp:"指定 AgentKit 代码执行沙箱。",mcp:"MCP 工具"},catalog:{web_search:{label:"联网搜索",description:"火山引擎 Web Search,获取实时信息。"},parallel_web_search:{label:"并行联网搜索",description:"并行发起多条搜索查询,更快汇总。"},link_reader:{label:"网页读取",description:"抓取并阅读给定链接的正文内容。"},web_scraper:{label:"网页爬取",description:"结构化爬取网页(需要 Scraper 服务)。"},image_generate:{label:"图像生成",description:"文生图(Doubao Seedream)。"},image_edit:{label:"图像编辑",description:"图生图 / 编辑(Doubao SeedEdit)。"},video_generate:{label:"视频生成",description:"文/图生视频(Doubao Seedance),含任务查询。"},text_to_speech:{label:"语音合成 (TTS)",description:"把文本转成语音(火山语音)。"},run_code:{label:"代码执行",description:"在沙箱中执行代码。"},vesearch:{label:"VeSearch 智能搜索",description:"火山 VeSearch(需要 bot 端点)。"},links:{console:"控制台",documentation:"文档"},env:{modelAgentName:{comment:"模型名称"},embeddingModelName:{comment:"向量化模型(记忆/知识库需要)"},vikingMemoryProject:{comment:"VikingDB 记忆库项目"},vikingMemoryRegion:{comment:"VikingDB 记忆库地域"},vikingMemoryType:{comment:"记忆类型"},feishuAppId:{comment:"飞书应用 App ID"},feishuAppSecret:{comment:"飞书应用 App Secret",placeholder:"输入 App Secret"},registrySpaceId:{comment:"AgentKit 智能体中心",placeholder:"请选择智能体中心"},registryTopK:{comment:"召回 Agent 数量"},registryRegion:{comment:"AgentKit 智能体中心地域"},registryEndpoint:{comment:"AgentKit 智能体中心 OpenAPI 地址"},agentKitToolId:{comment:"代码执行沙箱 ID"},agentKitToolRegion:{comment:"AgentKit Tools 地域"},openVikingUrl:{comment:"OpenViking 服务地址"},openVikingMemoryUserId:{comment:"记忆归属 ID",help:"对应 viking://user/<此值>/peers/<请求用户>/memories 中的 user 段;用于隔离 Agent、租户或业务场景,默认 default。"},openVikingMemoryPolicy:{comment:"记忆策略",help:"记忆的抽取策略和隔离策略,不填写时使用官方默认策略。"},openVikingKnowledgeUserId:{comment:"知识库归属 ID",help:"未配置资源目录时用于默认路径 viking://user/<此值>/resources/<知识库索引>/,默认 default。"},openVikingTargetUri:{comment:"知识库资源目录",help:"留空时由 KnowledgeBase index 自动生成;填写后直接检索该 OpenViking 资源目录,优先级最高。"},tlsServiceName:{comment:"TLS topic_id,留空自动创建"}}},backends:{shortTerm:{local:{label:"本地内存",description:"进程内,不持久化。适合开发调试。"},sqlite:{label:"SQLite 文件",description:"持久化到本地 .db 文件。"},mysql:{label:"MySQL",description:"持久化到 MySQL。"},postgresql:{label:"PostgreSQL",description:"持久化到 PostgreSQL。"}},longTerm:{local:{label:"本地向量库",description:"进程内 llama-index 向量库。"},opensearch:{label:"OpenSearch",description:"OpenSearch 向量检索。"},redis:{label:"Redis",description:"Redis 向量检索。"},viking:{label:"VikingDB Memory",description:"VikingDB 记忆库(支持用户画像)。"},openviking:{label:"OpenViking Memory",description:"OpenViking 长期记忆,按用户维度保存和检索偏好、事件与实体。"},mem0:{label:"Mem0",description:"Mem0 托管记忆服务。"}},knowledge:{viking:{label:"VikingDB Knowledge",description:"VikingDB 知识库。"},opensearch:{label:"OpenSearch",description:"OpenSearch 向量检索。"},context_search:{label:"Context Search",description:"火山 Context Search 引擎(无需向量化)。"},openviking:{label:"OpenViking Knowledge",description:"OpenViking 资源目录知识库,无需向量化模型配置。"}}},exporters:{apmplus:{label:"APMPlus",description:"火山 APMPlus 应用性能监控。"},cozeloop:{label:"CozeLoop",description:"扣子 CozeLoop 链路观测。"},tls:{label:"TLS (日志服务)",description:"火山 TLS 日志服务导出。"}},knowledge:{title:"知识库",description:"启用外部知识检索(RAG),让 Agent 基于你的资料作答。",backend:"知识库后端",vikingDatabase:"VikingDB 知识库"},memory:{shortTerm:"短期记忆",shortTermDescription:"存储单会话上下文",shortTermBackend:"短期记忆后端",longTerm:"长期记忆",longTermDescription:"存储跨会话上下文,通常使用向量化检索",longTermBackend:"长期记忆后端",vikingDatabase:"VikingDB 记忆库",autoSave:"自动保存会话到长期记忆",autoSaveDescription:"会话结束时自动把内容写入长期记忆,无需手动调用。"},mcp:{removeTool:"删除 MCP 工具",namePlaceholder:"名称(可选)",urlPlaceholder:"MCP 服务地址",pathWarning:"当前填写的是网关根地址。仅当根路径就是 MCP Endpoint 时可直接使用;否则请补充完整服务路径。",tokenPlaceholder:"Bearer Token(可选)",showToken:"显示 Bearer Token",hideToken:"隐藏 Bearer Token",commandPlaceholder:"命令,例如 npx",argsPlaceholder:"参数,以空格分隔",stdioHint:"stdio 工具在部署环境中启动,请确保命令和依赖可用。",addTool:"添加 MCP 工具"},resources:{unnamedAgentCenter:"未命名智能体中心",unnamedKnowledgeBase:"未命名知识库",unnamedMemory:"未命名记忆库",loadError:"加载失败",loadingAgentCenters:"正在加载智能体中心…",agentCentersLoaded:"已加载 {{count}} 个智能体中心",noAgentCenters:"暂无智能体中心",noMatchingAgentCenters:"没有匹配的智能体中心",searchAgentKitCenter:"搜索 AgentKit 智能体中心",searchNameOrId:"搜索名称或 ID",selectAgentCenter:"选择智能体中心",selectAgentKitCenter:"选择 AgentKit 智能体中心",selectedAgentCenter:"已选智能体中心",agentKitCenter:"AgentKit 智能体中心",refreshAgentCenters:"刷新智能体中心",knowledgeBaseList:"知识库列表",knowledgeBasePlaceholder:"选择知识库",loadingKnowledgeBases:"正在加载知识库…",knowledgeBasesLoaded:"已加载 {{count}} 个知识库",noKnowledgeBases:"暂无知识库",noMatchingKnowledgeBases:"没有匹配的知识库",searchKnowledgeBase:"搜索知识库",selectKnowledgeBase:"选择知识库",refreshKnowledgeBases:"刷新知识库",memoryList:"记忆库列表",memoryPlaceholder:"选择记忆库",loadingMemories:"正在加载记忆库…",memoriesLoaded:"已加载 {{count}} 个记忆库",noMemories:"暂无记忆库",noMatchingMemories:"没有匹配的记忆库",searchMemory:"搜索记忆库",selectMemory:"选择记忆库",refreshMemories:"刷新记忆库"},env:{noAdditionalParameters:"此后端无需额外运行参数。",invalidJson:"请输入有效的 JSON。",helpAriaLabel:"{{label}}说明:{{help}}",openOpenViking:"打开 OpenViking {{label}}",valuePlaceholder:"请输入参数值",openVikingIndex:"OpenViking 资源索引",openVikingIndexHelp:"默认值:留空;生成项目时使用 Agent 名自动生成,例如 my_agent_kb。未配置 DATABASE_OPENVIKING_TARGET_URI 时,默认 URI 拼接为 viking://user/{知识库归属 ID,未填则 default}/resources/{资源索引}/;如果填写了 DATABASE_OPENVIKING_TARGET_URI,则直接使用该完整 URI。",openVikingIndexAriaLabel:"OpenViking 资源索引说明:{{help}}"},deployment:{vpcRequired:"使用 VPC 网络时,请填写 VPC ID。",apiKeyRequired:"请先选择模型使用的 API Key。",invalidEnvName:"环境变量名称不合法:{{key}}",requiredEnv:"{{name}}:请填写必填环境变量",generatingConfiguration:"正在生成部署配置",runtimeNameExists:"Runtime 名称已存在,请修改后重试。",preparing:"准备部署",applyingMpaProfile:"正在将 Agent 配置应用到 MPA Runtime",mpaProfileApplied:"MPA Runtime 配置已应用",runningMpaSmoke:"正在验证 MPA Runtime 执行链路",mpaReady:"MPA Runtime 已可运行",mpaOperationIncomplete:"MPA Runtime 初始化未完成,请重试此部署任务。",complete:"部署完成",failed:"部署失败",updateAndPublish:"更新并发布",stages:{build:"构建镜像",deploy:"部署 Runtime",publish:"发布服务",applyMpaProfile:"应用 MPA 配置",verifyMpaRuntime:"验证 MPA Runtime",mpaReady:"MPA Runtime 可运行",running:"部署中"}},publish:{generating:"正在生成发布配置",validating:"校验 Agent 结构并准备部署快照…"}},ive={presets:{support:{name:"客服助手",description:"7×24 在线答疑,结合知识库与历史对话,稳定、礼貌地解决用户问题。",instruction:"你是一名专业、耐心的客服助手。请始终保持礼貌、友好的语气,优先依据知识库中的资料回答用户问题;当资料不足以确定答案时,如实告知用户并主动引导其提供更多信息,切勿编造。回答尽量简洁、分点清晰,必要时给出操作步骤。",subagents:{}},analyst:{name:"数据分析师",description:"运行代码完成统计与可视化,开启链路追踪,分析过程可观测、可复现。",instruction:"你是一名严谨的数据分析师。面对数据问题时,先厘清分析目标与口径,再通过编写并运行代码完成清洗、统计与可视化。每一步都要说明你的假设与方法,给出结论时附上关键数据支撑,并指出潜在的偏差与局限。",subagents:{}},translator:{name:"翻译助手",description:"中英互译,忠实、通顺、地道,保留原文语气与专业术语。",instruction:"你是一名专业的翻译助手,精通中英互译。请在忠实于原文含义的前提下,使译文自然、地道、符合目标语言表达习惯;保留专有名词与专业术语的准确性,并尽量贴合原文的语气与风格。仅输出译文,除非用户额外要求解释。",subagents:{}},coder:{name:"代码助手",description:"编写、调试与重构代码,可运行代码验证结果,给出清晰可维护的实现。",instruction:"你是一名资深软件工程师。请根据需求编写正确、清晰、可维护的代码,遵循目标语言的惯用风格与最佳实践。在不确定时通过运行代码验证你的实现,给出关键的边界条件与测试思路,并对复杂逻辑附上简要注释。",subagents:{}},researcher:{name:"研究员",description:"联网检索一手资料,结合知识库与长期记忆,输出有据可查的研究结论。",instruction:"你是一名严谨的研究员。面对研究问题时,先拆解关键子问题,再通过联网检索收集多个一手、可信的来源,交叉验证后再下结论。结论需注明出处与不确定性,区分事实与推断,避免以偏概全。",subagents:{}},"research-team":{name:"多智能体研究团队",description:"由检索员、分析员、撰写员协作的研究编排,分工完成端到端调研报告。",instruction:"你是一支研究团队的总协调者。负责拆解用户的研究任务,将检索、分析、撰写分别委派给对应的子 Agent,汇总各子 Agent 的产出,把控整体质量,最终输出结构清晰、有据可查的研究报告。",subagents:{0:{name:"检索员",description:"联网搜集与课题相关的一手资料与数据。",instruction:"你是研究团队中的检索员。根据课题联网检索多个可信来源,整理出关键事实、数据与原文出处,交付给分析员,不做主观结论。"},1:{name:"分析员",description:"对检索到的材料做交叉验证与归纳分析。",instruction:"你是研究团队中的分析员。对检索员提供的材料做交叉验证、归纳与对比,提炼洞见、识别矛盾与不确定性,形成结构化的分析要点。"},2:{name:"撰写员",description:"将分析结论组织为结构清晰、引用规范的报告。",instruction:"你是研究团队中的撰写员。把分析员的要点组织成结构清晰、语言通顺、引用规范的研究报告,确保每个结论都能追溯到来源。"}}}},tags:{tools:"工具",memory:"记忆",knowledgeBase:"知识库",tracing:"观测",subagents:"子 Agent {{count}}"},gallery:{title:"从模板新建",subtitle:"选择一个预制 Agent 模板,按需微调后即可创建。"},detail:{back:"返回模板列表",name:"名称",systemPrompt:"系统提示词",model:"模型",tools:"工具",memory:"记忆",knowledgeBase:"知识库",tracing:"观测追踪",subagents:"子 Agent({{count}})",create:"使用此模板创建",shortTermMemory:"短期",longTermMemory:"长期"}},rve={checkingExpiry:"确认有效期中",waitingRecovery:"等待恢复",listFailed:"读取项目列表失败",recoveryFailed:"工作区恢复失败,请重试",operationFailed:"项目操作失败,请重试",title:"代码项目",back:"返回代码项目",restart:"本开发环境将在 {{countdown}} 后重启,请随时保存数据",expiresAt:"有效期至 {{date}}",exitFullscreen:"退出全屏",fullscreen:"全屏",exitFullscreenHint:"退出全屏(Esc)",recovering:"正在恢复工作区,完成后将自动返回项目",retry:"重试连接",search:"搜索代码项目",newTitle:"新建代码项目",new:"新建项目",readingStats:"正在读取项目统计",createdAt:"创建时间",opening:"正在打开",unknownCreatedAt:"创建时间未知",open:"打开项目",empty:"没有匹配的代码项目",close:"关闭新建项目",name:"项目名称",placeholder:"例如 my-agent",nameHelp:"以英文字母开头,可包含字母、数字、下划线和连字符,最多 64 个字符",cancel:"取消",create:"创建项目",files_one:"{{count}} 个文件",files_other:"{{count}} 个文件",directories_one:"{{count}} 个目录",directories_other:"{{count}} 个目录",separator:","},sve={enabled:"已启用",disabled:"已禁用",unknownStatus:"状态未知",allPermissions:"全部权限",customPermissions:"自定义权限",unknownPermissions:"权限未知",unnamed:"未命名 API Key",search:"搜索名称、状态或权限",noMatches:"没有匹配的 API Key",noModelPermission:"当前 API Key 无权限",modelAvailable:"可用",permissionState:{Available:"可用于对话",Shutdown:"已下线",VideoGeneration:"视频生成模型",Unsupported:"不支持作为对话模型",NotActivated:"尚未开通",Unknown:"未获取到模型状态"}},ave={common:U0e,yaml:Q0e,validation:z0e,defaults:V0e,helpers:H0e,intelligentDeployment:q0e,codePackage:W0e,buildCanvas:K0e,intelligent:G0e,projectLibrary:X0e,modePicker:Y0e,promptEditor:Z0e,skills:J0e,workflow:eve,workbench:tve,traditional:nve,template:ive,workspace:rve,modelApiKey:sve},_Ve=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:K0e,codePackage:W0e,common:U0e,default:ave,defaults:V0e,helpers:H0e,intelligent:G0e,intelligentDeployment:q0e,modePicker:Y0e,modelApiKey:sve,projectLibrary:X0e,promptEditor:Z0e,skills:J0e,template:ive,traditional:nve,validation:z0e,workbench:tve,workflow:eve,workspace:rve,yaml:Q0e},Symbol.toStringTag,{value:"Module"})),ove={source:"任务来源",studio:"Studio 定时任务",title:"Runtime 定时任务",selectRuntime:"请先在 Agent 列表中选择一个云端 Runtime。",scope:"展示当前 Studio 用户在此 Runtime 中的定时任务。",refresh:"刷新",loading:"正在获取 Runtime 任务",empty:"此 Runtime 中没有符合条件的定时任务。",authRequired:"Runtime 拒绝了请求,请检查网关访问权限及 Runtime 的鉴权开关。",forbidden:"当前用户没有此 Runtime 的访问权限。",unsupported:"此 Runtime 未提供 mpa 定时任务接口。",invalidResponse:"任务接口返回了无法识别的数据,请检查 Runtime 版本。",loadFailed:"获取任务失败,请检查网络和 Runtime 状态后刷新。",pagination:"Runtime 任务分页",total:"共 {{total}} 条",previous:"上一页",next:"下一页",columns:{name:"任务名称",enabled:"状态",schedule:"执行计划",next:"下次执行",last:"最近结果"},schedule:{once:"单次",interval:"间隔",daily:"每天",weekly:"每周",monthly:"每月",cron:"Cron"},search:"搜索任务",executionCount:"执行次数",successRate:"成功率",prompt:"任务内容",manage:{view:"任务视图",list:"列表",calendar:"日历",create:"创建定时任务",edit:"编辑任务",copy:"复制",delete:"删除",detail:"详情",run:"立即执行",name:"任务",lastRun:"上次执行",schedule:"执行周期",lastStatus:"上次执行状态",agent:"执行 Agent",actions:"操作",all:"全部状态",Pending:"尚未执行",Queued:"已排队",Running:"执行中",Succeeded:"执行成功",Failed:"执行失败",TimedOut:"执行超时",Cancelled:"已取消",Skipped:"已跳过",overview:"执行统计:",prompt:"任务内容",timezone:"时区",localTime:"执行时间(当前设备时区)",time:"执行时间",Once:"单次",Interval:"间隔",Daily:"每天",Weekly:"每周",Monthly:"每月",Cron:"Cron 表达式",seconds:"秒",interval:"间隔秒数",weekdays:"星期(1 为周一,7 为周日,逗号分隔)",monthDays:"每月日期(1–31,逗号分隔)",delivery:"结果投递",Web:"Web",Feishu:"飞书",target:"飞书接收 ID",enabled:"启用任务",cancel:"取消",save:"保存",saving:"保存中",required:"请填写任务名称、Agent ID、任务内容和投递目标。",timezoneInvalid:"请输入有效的 IANA 时区,例如 Asia/Shanghai。",futureTime:"请选择未来的执行时间。",intervalInvalid:"间隔需要为 30–31536000 的整数秒。",daysInvalid:"请输入有效且不重复的日期或星期。",history:"执行记录",duration:"耗时",result:"结果 / 会话",noRuns:"暂无执行记录。",conflict:"任务已被修改或请求发生冲突,请关闭弹窗并刷新后重试。",invalid:"请求校验失败,请检查用户身份、执行时间、Agent ID 和任务配置。",queued:"已提交执行请求。",saved:"任务已更新。",deleteConfirm:"确定删除“{{name}}”?删除后将不再调度此任务。",calendarZone:"显示时区:",prevMonth:"上个月",nextMonth:"下个月",today:"今天",nextOnly:"仅下次",calendarHint:"日历展示预计执行安排;复杂 Cron 仅显示服务端给出的下一次执行时间。"}},lve={backToList:"返回定时任务列表",cancel:"取消",cancelQueue:"取消排队",cancelQueueFirst:"请先取消排队",cancelling:"取消中…",closeDrawer:"关闭抽屉",collapse:"收起",connectingRuntime:"正在连接 Runtime…",createScheduledTask:"创建定时任务",createTask:"创建任务",delete:"删除",deleteTask:"删除任务",edit:"编辑",enable:"启用",expand:"展开",pause:"暂停",refresh:"刷新",refreshHistory:"刷新执行历史",rerun:"重新执行",retry:"重试",runNow:"立即执行",saveChanges:"保存更改",saving:"保存中…",stop:"终止执行",stopRun:"终止本次执行",stopRunFirst:"请先终止当前执行",stopping:"终止中…",viewDetails:"查看详情"},cve={cancelDescription:"本次 Session 将被取消,后续计划不会暂停。",cancelTitle:"终止本次执行?",deleteDescription:"“{{name}}”及其全部执行历史将被永久删除。",deleteTitle:"删除定时任务?"},uve={configuration:"任务配置",nextRun:"下次执行",pageLabel:"定时任务详情",region:"地域",runtime:"运行时",status:"任务状态"},dve={createTitle:"创建定时任务",description:"每次触发都会为 Runtime Agent 创建独立 Session。",editTitle:"编辑定时任务"},fve={minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",seconds:"{{count}} 秒"},hve={cronExpression:"Cron 表达式",cronHelp:"依次填写分钟、小时、日期、月份、星期。",dailyTime:"每天执行时间",enableAfterCreate:"创建后启用",enableHelp:"启用后会从下一个计划时间开始执行。",name:"任务名称",namePlaceholder:"例如:每日生成运营摘要",noRuntime:"暂无可用 Runtime",prompt:"执行文本",promptPlaceholder:"输入每次执行时发送给 Agent 的固定文本",runAt:"执行时间",runtimeAgent:"运行时智能体",runtimeHelp:"任务始终跟随该 Runtime 当前生效版本。",runtimePlaceholder:"选择 Runtime Agent",schedule:"执行计划",scheduleType:"执行计划类型",timezone:"时区",weekday:"星期"},pve={all:"全部"},mve={description:"每次运行均使用独立 Session,结果与错误会永久保留。",duration:"耗时 {{duration}}",emptyDescription:"任务触发或立即执行后,记录会显示在这里。",emptyTitle:"暂无执行记录",errorDetails:"错误详情",finalAnswer:"最终回答",loadFailed:"无法加载执行历史",loadFailedDescription:"请检查 Studio 服务后重试。",session:"会话",title:"执行历史"},gve={cancelRequested:"已提交终止请求。",created:"任务已创建。",deleted:"任务及其执行历史已删除。",enabled:"任务已启用。",paused:"任务已暂停。",queued:"任务已排队,将在一分钟内开始执行。",requeued:"任务已重新排队,将在一分钟内开始执行。",updated:"任务已更新。"},bve={filterLabel:"定时任务状态筛选",listLabel:"定时任务列表",loadFailed:"无法加载定时任务",loadFailedDescription:"请检查 Studio 服务后重试。",title:"定时任务"},yve={cron:"Cron {{cron}}{{zone}}",daily:"每天 {{time}}{{zone}}",once:"一次 · {{date}}{{zone}}",weekly:"{{weekday}} {{time}}{{zone}}"},vve={daily:"每天",once:"一次性",weekly:"每周"},xve={cancelled:"已取消",enabled:"已启用",failed:"失败",notRun:"尚未执行",paused:"已暂停",pending:"准备中",queued:"已排队",retrying:"自动重试中",running:"执行中",skipped:"已跳过",success:"成功"},wve={cronFields:"Cron 表达式需要包含 5 个字段,例如 0 9 * * *。",nameRequired:"请输入任务名称。",promptRequired:"请输入每次执行时发送给 Agent 的文本。",runtimeAppMissing:"Runtime Agent 未返回可调用的 appName,请确认 Runtime 已就绪且版本兼容。",runtimeRequired:"请选择可用的 Runtime Agent。",timeRequired:"请选择执行时间。"},Ove={friday:"周五",monday:"周一",saturday:"周六",sunday:"周日",thursday:"周四",tuesday:"周二",wednesday:"周三"},jVe={mpa:ove,actions:lve,confirm:cve,detail:uve,drawer:dve,duration:fve,fields:hve,filters:pve,history:mve,notices:gve,page:bve,schedule:yve,scheduleTypes:vve,status:xve,validation:wve,weekdays:Ove},NVe=Object.freeze(Object.defineProperty({__proto__:null,actions:lve,confirm:cve,default:jVe,detail:uve,drawer:dve,duration:fve,fields:hve,filters:pve,history:mve,mpa:ove,notices:gve,page:bve,schedule:yve,scheduleTypes:vve,status:xve,validation:wve,weekdays:Ove},Symbol.toStringTag,{value:"Module"})),kve="快速创建 Agent",Sve="Agent 类型",Eve="关闭",Cve="部署",Ave="预览配置",Tve="已发起配置包下载",_ve="下载失败,请重试",jve="有 {{count}} 处配置需要修改",Nve="自定义",Rve="自定义{{field}}",Ive="输入自定义值",Pve="该模型未声明推理强度,使用服务端设置",Dve="请先为该提供方添加模型",Mve="请先选择提供方",Lve="请选择",$ve="可选",Fve="默认模型、Agent 预设和权限用于新会话;预设需要存在于部署的 Harness 中",Bve="仅填写环境变量名称,实际密钥由部署环境提供",Uve="read-only 为只读,workspace-write 可写工作区,danger-full-access 允许完整访问且不请求确认",Qve="allowedModels 是子 Agent 可选择的模型列表,启用后至少填写一组提供方和模型",zve="添加自定义模型服务,填写它的端点、协议和模型 ID,支持火山引擎和 BytePlus 等兼容服务",Vve="当前覆盖常用原生设置,其他插件参数与预设文件尚未接入",Hve="查看原生配置文档",qve="模型提供方 {{index}}",Wve="模型 {{index}}",Kve="添加模型提供方",Gve="移除提供方 {{index}}",Xve="添加模型",Yve="移除模型 {{index}}",Zve="添加可选模型",Jve="移除可选模型 {{index}}",exe="移除",txe="填写服务端的模型 ID",nxe={provider:"提供方 {{index}}",model:"模型 {{index}}"},ixe={defaults:"会话默认设置",deepseek:"DeepSeek 模型服务",providers:"自定义模型提供方",shell:"命令执行",loop:"工具调用",subagents:"子 Agent 模型选择",search:"DeepSeek 网络搜索"},rxe={id:"提供方 ID",displayName:"显示名称",baseURL:"服务地址",api:"接口协议",apiKeyEnv:"密钥环境变量"},sxe={id:"例如 company-models",displayName:"可选,默认使用提供方 ID",baseURL:"https://…/v1",api:"选择接口协议",apiKeyEnv:"例如 MODEL_API_KEY"},axe={id:"模型 ID",name:"显示名称",contextWindow:"上下文容量",maxTokens:"最大输出容量"},oxe={positive:"请输入大于 0 的数值",integer:"请输入有效的正整数",env:"请输入环境变量名,只能包含字母、数字和下划线,且不能以数字开头",url:"请输入 HTTP 或 HTTPS 地址,不要在地址中包含凭据",option:"请选择受支持的原生选项",required:"请补全此项",duplicate:"该 ID 或模型组合已存在",providerId:"以小写字母开头,可包含小写字母、数字、点、下划线和连字符,不能使用保留 ID",routes:"请至少填写一组完整的提供方和模型",modelPair:"请填写该自定义提供方下的模型 ID",unknownProvider:"请先添加该自定义模型提供方",unknownModel:"请填写该提供方下已配置的模型 ID",timer:"请输入大于 0 且不超过 2147483647 的毫秒数"},lxe={"agent-default-model_provider":"默认提供方","agent-default-model_model":"默认模型","agent-default-model_reasoningEffort":"默认推理强度","agent-presets_default":"默认 Agent 预设",permission_defaultPreset:"默认权限预设","llm-deepseek_apiKeyEnv":"密钥环境变量","llm-deepseek_baseURL":"服务地址","llm-deepseek_thinking":"思考模式","llm-deepseek_reasoningEffort":"推理强度","llm-deepseek_maxTokens":"每次请求的输出上限","llm-deepseek_defaultContextWindow":"默认上下文容量","llm-deepseek_streamIdleTimeoutMs":"流式空闲超时(毫秒)",bash_timeoutMs:"默认执行超时(毫秒)",bash_maxTimeoutMs:"最大执行超时(毫秒)",bash_maxOutputBytes:"输出上限(字节)","agent-loop_maxParallelToolCalls":"并行工具调用上限","subagent-model-selection_enabled":"启用模型选择","web-search-deepseek_apiKeyEnv":"密钥环境变量","web-search-deepseek_baseURL":"搜索服务地址","web-search-deepseek_model":"搜索模型","web-search-deepseek_apiVersion":"接口版本","web-search-deepseek_maxTokens":"搜索输出上限","web-search-deepseek_maxUses":"搜索次数上限"},cxe="取消",uxe="返回创建方式",dxe="DeepSeek Harness 配置",RVe={title:kve,agentType:Sve,close:Eve,continue:"继续配置",deploy:Cve,preview:Ave,export:"导出配置",downloaded:Tve,downloadFailed:_ve,validationSummary:jve,customValue:Nve,customField:Rve,enterCustomValue:Ive,reasoningUnavailable:Pve,modelsUnavailable:Dve,selectProviderFirst:Mve,selectOption:Lve,optional:$ve,defaultsHelp:Fve,credentialHelp:Bve,permissionHelp:Uve,routesHelp:Qve,providersHelp:zve,coverage:Vve,source:Hve,provider:qve,model:Wve,addProvider:Kve,removeProvider:Gve,addModel:Xve,removeModel:Yve,addRoute:Zve,removeRoute:Jve,remove:exe,modelIdPlaceholder:txe,route:nxe,sections:ixe,providerFields:rxe,providerPlaceholders:sxe,modelFields:axe,errors:oxe,fields:lxe,cancel:cxe,back:uxe,pageTitle:dxe},IVe=Object.freeze(Object.defineProperty({__proto__:null,addModel:Xve,addProvider:Kve,addRoute:Zve,agentType:Sve,back:uxe,cancel:cxe,close:Eve,coverage:Vve,credentialHelp:Bve,customField:Rve,customValue:Nve,default:RVe,defaultsHelp:Fve,deploy:Cve,downloadFailed:_ve,downloaded:Tve,enterCustomValue:Ive,errors:oxe,fields:lxe,model:Wve,modelFields:axe,modelIdPlaceholder:txe,modelsUnavailable:Dve,optional:$ve,pageTitle:dxe,permissionHelp:Uve,preview:Ave,provider:qve,providerFields:rxe,providerPlaceholders:sxe,providersHelp:zve,reasoningUnavailable:Pve,remove:exe,removeModel:Yve,removeProvider:Gve,removeRoute:Jve,route:nxe,routesHelp:Qve,sections:ixe,selectOption:Lve,selectProviderFirst:Mve,source:Hve,title:kve,validationSummary:jve},Symbol.toStringTag,{value:"Module"})),fxe="问题反馈",hxe="问题描述",pxe="常见问题",mxe="取消",gxe="完成",bxe="提交反馈",yxe="正在上报…",vxe={title:"上报成功,感谢您的反馈",description:"AgentKit 团队会尽快查看您提交的问题。"},xxe={close:"关闭问题反馈",intro:"请选择遇到的问题,也可以补充具体表现。",privacy:"您的对话数据将会上报到 AgentKit 团队,请注意隐私保护。",descriptionPlaceholder:"请描述问题发生时的表现(选填)",issues:{slow:"执行速度慢",crash:"运行崩溃",incorrect:"结果不准确",tool_error:"工具调用失败",other:"其他问题"}},wxe={description:"告诉我们您在使用 AgentKit Studio 时遇到的问题。",module:"所属模块",modules:{conversation:"对话",agents:"智能体",applications:"自动化",search:"搜索",other:"其他"},commonIssuesMultiple:"常见问题(可多选)",issueTypes:"问题类型",issues:{page_slow:"页面加载慢",feature_unavailable:"功能无法使用",display_error:"页面显示异常",no_response:"操作无响应",other:"其他问题"},descriptionPlaceholder:"请描述问题发生时的页面、操作和表现",quickAdd:"快捷补充",suggestionsLabel:"问题描述推荐",suggestions:{noResponse:"点击后没有反应",loading:"页面一直处于加载状态",incomplete:"部分内容显示不完整",error:"操作后出现错误提示"},privacy:"您的数据将会上报到 AgentKit 团队,请注意隐私保护。"},PVe={title:fxe,descriptionLabel:hxe,commonIssues:pxe,cancel:mxe,done:gxe,submit:bxe,submitting:yxe,success:vxe,dialog:xxe,page:wxe},DVe=Object.freeze(Object.defineProperty({__proto__:null,cancel:mxe,commonIssues:pxe,default:PVe,descriptionLabel:hxe,dialog:xxe,done:gxe,page:wxe,submit:bxe,submitting:yxe,success:vxe,title:fxe},Symbol.toStringTag,{value:"Module"})),Oxe={back:"返回",close:"关闭"},kxe={title:"优化迁移项目",closeAria:"关闭优化窗口"},Sxe={title:"已迁移项目",description:"管理迁移后的源码版本,也可以选择任一版本继续优化。",libraryTitle:"项目与版本",libraryDescription:"查看、下载、部署或对比源码版本,也可以基于任一版本继续优化。",emptyTitle:"还没有已迁移的项目",emptyDescription:"迁移完成后,源码会自动保存在这里。"},Exe={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any(通用迁移)"},Cxe={awaitingUpload:"待上传",analyzing:"分析中",needsInput:"待补充",analysisReady:"待确认",migrating:"迁移中",validating:"校验中",packaging:"打包中",succeeded:"已完成",succeededWithWarnings:"已完成,有提示",partial:"部分完成",failed:"失败",cancelled:"已终止",expired:"已过期"},Axe={evaluationPending:"待评测",evaluationRunning:"评测中",waitingDataset:"待保存评测用例",waitingEnvironment:"待补充环境变量",evaluationFailed:"迁移完成,评测未完成",evaluationBlocked:"迁移完成,评测待处理",evaluationCancelled:"迁移完成,评测已取消",resultUnavailable:"结果不可用",environmentExpired:"环境已过期"},Txe={partialReady:"迁移产物已生成,但交付不完整,请查看迁移提示。",readyWithWarnings:"迁移产物已生成,请查看迁移提示。",ready:"迁移产物已生成。"},_xe={passed:"产物校验通过",failed:"产物校验未通过",degraded:"产物校验未完成"},jxe={session:"创建迁移环境",upload:"上传项目",analysis:"分析项目"},Nxe={agentNameRequired:"请输入 Agent 名称",agentNameInvalid:"Agent 名称必须为 1-63 位,只能包含小写字母、数字和连字符,且必须以字母或数字开头和结尾"},Rxe={seconds:"{{seconds}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},Ixe={savedUnaffected:"已保存项目不受影响",savingUnaffected:"源码正在保存,完成后不受环境期限影响",activeDetail:"到期后任务记录和临时产物将无法访问",oneHour:"临时迁移环境保留 1 小时",ended:"临时迁移环境已结束",savedAvailable:"已保存项目仍可查看、下载、部署或优化",unavailable:"任务记录和临时产物已无法访问",countdown:"临时迁移环境将在 {{minutes}} 分 {{seconds}} 秒后结束",expiredSavedMessage:"临时迁移环境已结束,已保存项目不受影响。",expiredMessage:"临时迁移环境已结束,任务记录和临时产物无法继续访问。"},Pxe={recommended:"建议迁移方式",scope:"迁移范围",excluded:"不在本次范围",viewEvidence:"查看分析证据",viewAssumptions:"查看关键假设",viewSourceEvidence:"查看源码证据"},Dxe={ariaLabel:"Codex 执行动态",title:"Codex 执行动态",startingAnalysis:"Codex 正在开始分析…",startingMigration:"Codex 正在开始迁移…",loadError:"暂时无法读取 Codex 执行动态,不影响当前任务。",liveAnalyzing:"正在分析项目",liveMigrating:"正在执行迁移",liveValidating:"正在校验迁移结果",livePackaging:"正在整理迁移产物",liveDelivery:"正在核对交付产物"},Mxe={title:"迁移产物",fileTooLarge:"该文件超过 2 MiB,请下载完整产物后查看。",unsupportedPreview:"该文件不支持在线预览,请下载完整产物后查看。",filesAria:"迁移产物文件",searchAria:"搜索产物文件",searchPlaceholder:"搜索文件",limit:"仅展示前 {{count}} 项,请搜索具体文件。",noSelection:"未选择文件",noPreview:"暂无可预览文件。",loadingFile:"正在读取产物文件…",startupFile:"启动文件",fileCountLabel:"文件数",saved:"源码已保存,可继续查看、下载、部署或优化。",saving:"产物已生成,正在保存源码版本。",deployReady:"产物可预览、下载和部署,正在等待源码保存状态。",deployUnavailable:"产物可预览和下载,但当前交付状态不支持部署。",viewProjects:"查看已迁移项目",downloading:"下载中…",downloadZip:"下载 ZIP",deployTitle:"部署迁移产物",deployUnavailableTitle:"当前交付状态不支持部署",deployRuntime:"部署到 Runtime",fileCount:"{{count}} 个文件",startup:"启动文件 {{module}}",loading:"正在读取迁移产物…"},Lxe={retiring:"即将下线",currentDefault:"当前默认模型",loadError:"加载模型列表失败",label:"模型",placeholder:"选择模型"},$xe={zipOnly:"请选择 .zip 格式的本地项目文件。",invalidName:"ZIP 文件名无效,请重命名后重新选择。",tooLarge:"项目 ZIP 不能超过 {{size}}。",empty:"项目 ZIP 不能为空。",removeAria:"移除项目 ZIP",reselectPrompt:"重新选择项目 ZIP",selectPrompt:"选择或拖入本地项目 ZIP",reselect:"重新选择",selectZip:"选择 ZIP",continue:"继续上传",start:"上传并分析",inputAria:"选择本地项目 ZIP",retention:"临时迁移环境从创建完成起保留 1 小时;保存成功的源码版本不受影响。",uploading:"上传中…",sizeHint:"支持项目 ZIP,最大 {{size}}"},Fxe={requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}",notReady:"迁移产物尚未准备完成。",back:"返回迁移结果"},Bxe={backToAddAgent:"返回添加 Agent",title:"从存量迁移",newMigration:"新建迁移",recent:"最近迁移",loadingSessions:"正在读取迁移会话…",noSessions:"暂无迁移会话",heading:"迁移存量 Agent 项目",intro:"上传本地项目 ZIP,Codex 将先进行只读分析,再由你确认迁移方式。",backToHome:"迁移首页",navigation:"迁移导航",showMore:"查看更多",showLess:"收起",projectName:"项目名称",status:"状态",createdAt:"创建时间",actions:"操作",openTask:"查看迁移 {{name}}",continueTask:"继续",viewTask:"查看"},Uxe={stop:"终止迁移",stopping:"正在终止…",cancel:"取消",reload:"重新读取",refreshStatus:"刷新状态"},Qxe={unavailable:"迁移能力暂不可用",defaultReason:"Dev Sandbox 暂不可用,请联系管理员检查配置。"},zxe={creatingSandbox:"正在创建 Dev Sandbox",initializing:"正在初始化迁移工作目录,并检查 AgentKit CLI、Codex 和迁移能力。环境就绪后将自动上传项目。",elapsed:"已等待 {{duration}}",uploadThenAnalyze:"ZIP 上传完成后将自动开始只读分析。",analyzing:"Codex 正在识别框架、入口和迁移边界,不会执行实际迁移。",migrationLocked:"迁移执行中不能修改附件或迁移方式。你可以等待当前任务结束,或主动终止。",analysisPaused:"只读分析已暂停。请仅回答下面列出的问题,提交后会在同一迁移环境中重新分析,不会开始实际迁移。",analysisComplete:"只读分析已完成。请检查建议,并确认最终迁移方式。",awaitingUpload:"迁移环境已创建,请重新选择本地 ZIP 继续上传。",expiredTitle:"迁移环境已过期",expiredDescription:"迁移内容和产物已无法预览、下载或部署。如已完成 Runtime 部署,可返回智能体页面继续使用。",unsupportedTitle:"当前 ZIP 暂时无法迁移",unsupportedHint:"请按提示整理项目后,新建迁移并重新上传。",failedTitle:"迁移未完成",cancelled:"当前迁移已终止。你可以新建迁移并重新上传项目。"},Vxe={ariaLabel:"补充项目分析信息",title:"补充分析所需信息",description:"附件保持锁定,提交后仅继续只读分析",submitting:"正在继续分析…",submit:"提交并继续分析"},Hxe={ariaLabel:"回答迁移需要你决定的问题",title:"迁移需要你的回答",description:"回答后会在当前这一步里继续,不需要重新开始",other:"其他",otherPlaceholder:"也可以直接输入你的答案",submitting:"正在提交回答…",submit:"提交回答并继续"},qxe={ariaLabel:"确认迁移方式",title:"确认迁移方式",framework:"迁移方式",frameworkPlaceholder:"选择迁移方式",agentName:"Agent 名称",entry:"项目入口",entryPlaceholder:"选择项目入口",entryExample:"例如 agent.py:agent",consent:"点击“确认并开始迁移”即确认上述迁移范围、排除项和关键假设。",starting:"正在启动迁移…",start:"确认并开始迁移"},Wxe={setup:{title:"迁移效果评测",description:"迁移完成后自动执行评测用例。",on:"已开启",off:"未开启",unavailable:"当前环境暂不支持迁移效果评测。",casesTitle:"评测用例",casesDescription:"至少添加一个用例。期望结果和评测标准可选。",configuredSummary:"{{count}} 个用例 · {{preset}} · {{dimensions}}",incompleteSummary:"{{count}} 个用例待填写 · {{preset}} · {{dimensions}}",dimensionSummary:"{{count}} 个维度",editSettings:"编辑设置",viewSettings:"查看设置",lockedTitle:"评测用例",lockedDescription:"上传开始后不可修改。",closeAria:"关闭评测设置",done:"完成配置",close:"关闭"},tabs:{label:"迁移任务内容",migration:"迁移",evaluation:"效果评测",waitingMigration:"等待迁移",waitingConfiguration:"待配置",running:"评测中",completed:"已完成",issue:"需处理"},bulk:{open:"批量粘贴",label:"每行输入一个用例",placeholder:`帮我查询今天的订单状态 -把结果整理成三点`,preview:"将添加 {{count}} 个用例",confirm:"添加用例"},case:{title:"用例 {{index}}",add:"添加用例",moveUp:"上移用例 {{index}}",moveDown:"下移用例 {{index}}",copy:"复制",delete:"删除",userInput:"用户输入",userInputPlaceholder:"例如:请帮我查询今天的订单状态",expectedOutcome:"期望结果(可选)",expectedOutcomePlaceholder:"描述希望 Agent 完成什么,不要求逐字一致",criteria:"必须满足的要求(可选)",addCriterion:"添加要求",criterionLabel:"必须满足的要求 {{index}}",criterionPlaceholder:"例如:必须包含订单号和当前状态",removeCriterion:"删除要求 {{index}}"},advanced:{title:"高级设置",standard:"标准评测",standardDescription:"默认包含语义一致性、输出约束、工作流与工具一致性 3 个维度,适合多数迁移。",custom:"自定义维度",customDescription:"按业务风险选择一个或多个评测维度。",lockedDescription:"项目开始上传后,评测方式和维度不再修改。"},dimension:{semantic_fidelity:"语义一致性",output_contract:"输出约束",workflow_tool_fidelity:"工作流与工具一致性",context_memory_fidelity:"上下文与记忆一致性",boundary_error_fidelity:"边界与异常一致性",safety_refusal_fidelity:"安全与拒答一致性"},dimensionDescription:{semantic_fidelity:"检查意图理解、结论和关键事实是否保持一致。",output_contract:"检查字段、结构、语言和格式约束是否保持。",workflow_tool_fidelity:"检查可观察的工作流分支和工具行为是否保持。",context_memory_fidelity:"检查可验证的多轮上下文和记忆行为。",boundary_error_fidelity:"检查无效输入、信息缺失和依赖失败时的行为。",safety_refusal_fidelity:"检查已有授权、拒答和敏感信息边界是否保持。"},validation:{caseCount:"请保留 1–{{count}} 个用例。",dimensionRequired:"请至少选择一个评测维度。",userInputRequired:"请输入用例内容。",userInputBytes:"单个用例不能超过 32 KiB。",expectedOutcomeBytes:"期望结果不能超过 16 KiB。",criteriaCount:"单个用例最多包含 {{count}} 条要求。",criterionRequired:"要求不能为空。",criterionBytes:"单条要求不能超过 2 KiB。",datasetBytes:"全部评测用例不能超过 10 MiB。"},dataset:{invalidLockResponse:"服务未确认评测用例已保存,请重试。",loadingSettings:"正在读取评测设置…",loadSettingsFailed:"评测设置读取失败。",retryLoadSettings:"重新读取",missing:"未找到已保存的评测用例,请重新填写并保存。",saveWarning:"评测用例暂未保存,不影响迁移。",retrySave:"重新保存评测用例",saving:"正在保存…"},state:{disabled:"未开启评测",waiting_dataset:"等待填写评测用例",pending:"迁移完成后自动开始评测",preparing:"正在准备评测环境…",waiting_environment:"需要补充运行所需的环境变量",deploying:"正在部署临时 Runtime…",executing:"正在执行评测用例…",judging:"正在执行评测分析…",aggregating:"正在汇总评测结果…",completed:"评测已完成",failed:"评测未完成",blocked:"评测需要处理后才能继续",cancelled:"评测已取消"},progress:{label:"迁移与迁移效果评测进度",migration:"迁移",evaluation:"迁移效果评测",notStarted:"未开始",inProgress:"进行中",completed:"完成",waitingConfiguration:"等待配置",issue:"有问题"},environment:{description:"填写临时 Runtime 所需的环境变量。",security:"仅用于本次评测。",optional:"可选",submit:"提交并继续评测",submitting:"正在提交…"},execution:{preparing:"准备评测",preparingDetail:"校验迁移产物和 {{count}} 个评测用例",deploying:"启动 Runtime",deployingDetail:"准备 {{runtime}}",runtimeFallback:"隔离运行环境",executing:"执行用例",executingDetail:"执行 {{count}} 个用例并记录输出",judging:"执行评测分析",judgingDetail:"评测 {{cases}} 个用例 · {{dimensions}} 个维度",aggregating:"生成评测报告",aggregatingDetail:"汇总评分与证据,生成 HTML 报告",waiting:"等待中",running:"执行中",failed:"失败",complete:"已完成"},result:{title:"执行进度",attempt:"第 {{attempt}} 次评测",pending:"等待迁移完成",retry:"重新评测",retrying:"正在重试…",failureStage:"失败阶段",errorCode:"错误码",taskId:"任务 ID",diagnosticAttempt:"评测轮次",runtime:"Runtime",errorDetails:"错误详情",diagnosticField:"{{label}}:{{value}}",diagnosticHeading:"{{label}}:",loadingReport:"正在读取评测报告…",reportTitle:"HTML 评测报告",reportHtmlDescription:"查看或下载 HTML 报告。",viewReport:"查看报告",reportDrawerDescription:"评分、差异与证据",closeReport:"关闭",closeReportAria:"关闭评测报告",reportPreviewTitle:"迁移效果评测报告预览",reportSummary:"评测摘要",reportVersion:"评测集 {{version}} · Prompt v{{prompt}}",downloadReport:"下载完整报告",downloadingReport:"正在下载…",overallScore:"综合一致性",scoreScale:"0–100;证据不足时显示 N/A",evidenceCoverage:"证据覆盖率",coverageDetail:"{{scored}} / {{total}} 个维度有证据",executionSuccess:"执行成功率",executionDetail:"{{succeeded}} / {{total}} 个用例完成",naCount:"N/A 数量",naDescription:"证据不足,不计入分数",gapDescription:"迁移差距说明",lowestScoringCases:"低分用例",executionFailures:"执行异常",criticalEvidence:"Critical 证据",limitations:"评测限制",viewEvidence:"查看 {{count}} 个用例的结果与证据",outputTruncated:"输出过长,已截断",executionState:{succeeded:"执行完成",failed:"执行异常"},severityLabel:"严重度:{{severity}}",severity:{none:"无",low:"低",medium:"中",high:"高",critical:"Critical",unknown:"未知"},evidenceSource:{user_reference:"期望结果",user_criteria:"填写的要求",source_contract:"源项目约束",observed_output:"实际输出",runtime_observation:"Runtime 原始数据",deterministic_assertion:"确定性断言"},listSeparator:"、"}},Kxe={closeAria:"关闭错误提示",loadFailed:"无法读取迁移数据,请重试。",refreshFailed:"无法刷新迁移状态,请重试。"},Gxe={title:"终止当前迁移?",description:"终止后,当前分析或迁移进程将停止,已执行的步骤不会继续。"},MVe={common:Oxe,optimization:kxe,projects:Sxe,framework:Exe,state:Cxe,historyStatus:Axe,task:Txe,verification:_xe,transfer:jxe,validation:Nxe,duration:Rxe,expiry:Ixe,analysis:Pxe,activity:Dxe,artifact:Mxe,model:Lxe,upload:$xe,deployment:Fxe,workspace:Bxe,actions:Uxe,capability:Qxe,conversation:zxe,questions:Vxe,pendingInput:Hxe,confirmation:qxe,evaluation:Wxe,errors:Kxe,stopDialog:Gxe},LVe=Object.freeze(Object.defineProperty({__proto__:null,actions:Uxe,activity:Dxe,analysis:Pxe,artifact:Mxe,capability:Qxe,common:Oxe,confirmation:qxe,conversation:zxe,default:MVe,deployment:Fxe,duration:Rxe,errors:Kxe,evaluation:Wxe,expiry:Ixe,framework:Exe,historyStatus:Axe,model:Lxe,optimization:kxe,pendingInput:Hxe,projects:Sxe,questions:Vxe,state:Cxe,stopDialog:Gxe,task:Txe,transfer:jxe,upload:$xe,validation:Nxe,verification:_xe,workspace:Bxe},Symbol.toStringTag,{value:"Module"})),Xxe={loading:"加载中…",searchLabel:"搜索{{label}}",searchPlaceholder:"搜索{{label}}",retry:"重试",noMatches:"没有匹配项",noOptions:"暂无可选项",selection:"{{label}}:{{value}}"},Yxe={badge:"焕然一新",view:"查看新特性",title:"本次更新",defaultNotes:{multiRegion:"多地域智能体:并行加载北京与上海 Runtime,列表下滑即可继续加载。",switchAgent:"会话内切换:在输入框旁选择智能体,并直接开启一段新会话。",visualCanvas:"可视化执行画布:通过横向画布查看多智能体结构,并支持全屏浏览。"}},Zxe={label:"新会话模式",agent:"智能体",skill:"技能定制",video:"视频创作"},Jxe={select:"选择新会话模式",agent:{label:"Agent",description:"与当前选择的 Agent 对话"},builtin:{label:"内置智能体",description:"使用平台提供的智能体"},codex:{label:"Codex 智能体",description:"在沙箱中执行任务"},deepseekHarness:{label:"DeepSeek Harness",description:"打开 DeepSeek Harness 工作区"},arkClaw:"ArkClaw",hermes:"Hermes 智能体",checking:"正在检查配置",notConfigured:"管理员未配置",unavailable:"暂不可用"},ewe={select:"选择智能体",typesLabel:"智能体类型",listLabel:"{{type}}列表",types:{agent:"智能体",general:"通用智能体",mpa:"MPA 智能体",codex:"Codex 智能体",deepseekHarness:"DeepSeek Harness",openclaw:"OpenClaw 智能体",hermes:"Hermes 智能体"},loading:"正在加载智能体",reload:"重新加载",empty:"暂无{{type}}",emptyLocal:"暂无本地智能体",emptyGeneral:"暂无通用智能体",createHint:"请前往智能体页创建",localHint:"请检查当前 Studio 启动目录",waking:"正在唤醒",opening:"正在打开",connecting:"正在连接",loadingMore:"加载中",loadMore:"加载更多",runtimeTimeout:"加载智能体超时(15 秒),请检查网络或 Runtime 服务后重试",loadGeneral:"加载通用智能体",loadType:"加载 {{type}}",connectGeneral:"连接通用智能体",openLocal:"打开本地智能体",openType:"打开 {{type}}",wakingHint:"正在唤醒智能体,可能需要一些时间。"},twe={spaceAria:"技能空间",configuration:"技能定制配置",actions:{create:"技能生成",optimize:"技能优化"},selectAction:"选择技能定制方式",actionList:"技能定制方式",style:"风格",selectStyle:"选择风格",model:"模型",selectModel:"选择模型",styles:{concise:"简洁实用",strict:"严谨稳健",tutorial:"教程友好",automation:"自动化优先"},modelLoadFailed:"模型配置加载失败",spaceLoadFailed:"Skill Space 加载失败",skillLoadFailed:"Skill 加载失败",unnamedSpace:"未命名 Skill Space",space:"技能空间",select:"选择 Skill",selectAria:"选择 Skill:{{skill}}",loadingSpaces:"正在加载 Skill Space",reload:"重新加载",emptySpaces:"暂无 Skill Space",skillList:"{{space}} Skill 列表",loadingSkills:"正在加载 Skill",emptySkills:"暂无 Skill"},nwe={modes:{auto:"自动识别",text_to_video:"文生视频",reference_to_video:"参考素材生视频",video_editing:"视频编辑",video_extension:"视频续写",first_last_frame:"首尾帧生成"},taskNames:{auto:"视频生成",text_to_video:"文生视频",reference_to_video:"参考素材生视频",video_editing:"视频编辑",video_extension:"视频续写",first_last_frame:"首尾帧生成"},controls:{label:"视频创作配置",aspectRatio:"比例",selectAspectRatio:"选择比例",resolution:"清晰度",selectResolution:"选择清晰度",duration:"时长",durationShort:"{{count}} 秒",durationAria:"视频时长:{{count}} 秒",lastFrame:"尾帧",lastFrameHelper:"添加视频结束画面",assistImage:"辅助图片",referenceImage:"参考图片",assistImageHelper:"用于补充画面参考",imageHelper:"支持常见图片格式",referenceVideo:"参考视频",videoHelper:"支持常见视频格式",optional:"可选",replace:"更换",add:"添加",upload:"上传{{label}}",replaceFile:"更换{{label}}:{{name}}",removeFile:"移除{{label}} {{name}}",storageUnavailable:"管理员未配置持久化存储",loadingEnhancer:"正在加载增强模型",enhancerHint:"使用 {{model}} 模型进行意图识别和提示词增强",enhancerUnavailable:"增强模型不可用"},task:{title:"视频生成任务",closeAria:"关闭视频生成任务弹窗",progressAria:"视频生成进度",optimizedPrompt:"优化后的提示词",processingAria:"{{task}}处理进度",waitingAria:"{{status}},已等待{{elapsed}}",elapsed:"已等待 {{elapsed}}",previewAria:"生成结果预览",close:"关闭",download:"下载视频",retryOptimization:"重试提示词优化",retryGeneration:"重试视频生成",providerQueued:"等待模型调度",providerRunning:"模型生成中",providerSubmitting:"正在提交任务",queuedHint:"任务已提交,模型开始处理后状态会自动更新",runningHint:"这可能持续数分钟,完成后将在这里显示视频预览",backgroundHint:"可以关闭弹窗,任务会继续在后台运行",successHint:"视频已生成,可预览或下载",activationHint:"请先在模型控制台开通服务,再重试生成",retryHint:"修正问题后可重试当前步骤",steps:{optimizationFailed:"提示词优化失败",optimizationDone:"提示词优化完成",optimizationActive:"提示词优化中",generationDone:"{{task}}已完成",generationFailed:"{{task}}失败",generationQueued:"{{task}}排队中",generationRunning:"{{task}}生成中",generationActive:"{{task}}进行中",generationPending:"等待视频生成",generationComplete:"视频生成完成"},elapsedHours:"{{hours}}小时{{minutes}}分",elapsedMinutes:"{{minutes}}分{{seconds}}秒",elapsedSeconds:"{{seconds}}秒"}},iwe={compactSelect:Xxe,featureNotice:Yxe,workspace:Zxe,mode:Jxe,agentPicker:ewe,skill:twe,video:nwe},$Ve=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:ewe,compactSelect:Xxe,default:iwe,featureNotice:Yxe,mode:Jxe,skill:twe,video:nwe,workspace:Zxe},Symbol.toStringTag,{value:"Module"})),rwe="审核中心",swe="审核资源类型",awe="仅管理员可以访问审核中心",owe="搜索申请名称、提交人或版本",lwe="审核状态",cwe="{{count}} 条待审核",uwe="共 {{count}} 条申请",dwe={skill:"技能",agent:"智能体"},fwe={all:"全部状态",pending:"待审核",approved:"已通过",returned:"已退回",approving:"发布中"},hwe={application:"申请名称",submitter:"提交人",version:"版本",submittedAt:"提交时间",status:"状态",actions:"操作"},pwe={details:"详情",detailsFor:"查看 {{name}} 的申请详情",approve:"通过",approveFor:"通过 {{name}} 的申请",return:"退回",returnFor:"退回 {{name}} 的申请",close:"关闭",backToDetails:"返回详情",confirmApprove:"确认通过",confirmReturn:"确认退回",clearFilters:"清除筛选",refresh:"刷新",cancel:"取消",resumeApproval:"继续发布"},mwe={title:"暂无审核申请",description:"提交的审核申请会显示在这里",filteredTitle:"没有匹配的申请",filteredDescription:"试试其他关键词,或调整审核状态"},gwe={title:"申请详情",sections:"申请详情内容",overview:"申请信息",files:"提交文件 · {{count}}",requestType:"申请类型",update:"版本更新",firstRelease:"首次发布",source:"来源",source_skill:"{{name}}的个人技能空间",source_agent:"{{name}}的开发环境",destination:"发布目标",destination_skill:"企业共享技能空间",destination_agent:"全员共享智能体",region:"区域",visibility:"发布后可见范围",shared:"全员可见",description:"功能说明",changes:"本次提交说明",example:"使用示例",history:"审核记录",submitted:"{{name}}提交申请",versionFixed:"仅审核本次提交的版本",instructions:"使用说明",filesTab:"提交文件",filesFailed:"加载提交文件失败",unknownAuthor:"未知申请人",reviewer:"审批人",reviewedAt:"审批时间",approved:"{{name}}通过申请",returned:"{{name}}退回申请",unknownReviewer:"未知审批人",approvedBy:"通过人",returnedBy:"退回人",comment:"审批评论",result:"审批结果",noHistory:"此技能尚未提交审核",pendingHint:"等待管理员审核",approvingHint:"管理员已确认通过,正在发布到企业共享空间",approving:"{{name}}确认通过,等待完成发布"},bwe={failed:"待审核空间暂不可用",retry:"重试"},ywe={approveTitle:"通过申请",returnTitle:"退回申请",approveDescription:"通过后,{{name}} 的 {{version}} 版本将在企业共享空间中向全员公开",returnDescription:"退回 {{name}} 的 {{version}} 版本,并向申请人说明原因",reason:"退回理由",reasonRequired:"请填写退回理由",reasonHelp:"最多 256 个字符,申请人可以看到此理由",saving:"处理中…",failed:"审批失败,请重试",approved:"{{name}} 已通过并公开",returned:"{{name}} 已退回",comment:"评论(可选)",commentHelp:"最多 256 个字符,申请人可以看到此评论"},vwe={title:"AI 评分",points:"{{score}} 分",insufficient:"依据不足",status:{unscored:"尚未评分",not_requested:"尚未评分",queued:"等待评分",running:"评分中",completed:"已评分",failed:"评分失败"},loading:"加载评分…",starting:"正在提交评分…",loadFailed:"加载评分失败",retryFailed:"提交评分失败",failed:"评分未完成,请管理员重试",retry:"重新评分",start:"开始评分",reload:"重新加载",download:"下载 JSON",expand:"展开",collapse:"收起",hint:"评分针对本次提交版本,供人工审批参考",dimensions:{safety:"安全性",usability:"易用性",completeness:"完整性",reliability:"可靠性",maintainability:"可维护性"},risks:"风险提示",suggestions:"改进建议",model:"评分模型",rubric:"评分标准版本",time:"评分时间",severity:{low:"低风险",medium:"中风险",high:"高风险",critical:"严重风险"},coverage:"评审范围",coverageCount:"已评审 {{included}} / {{total}} 个文件",coverageIncomplete:"部分内容未纳入评审,评分依据不完整",omittedFile:"未评审 {{path}}:{{reason}}",truncatedFile:"仅评审部分内容 {{path}}:{{reason}}",originalError:"云端原始错误"},FVe={title:rwe,category:swe,adminOnly:awe,search:owe,filterStatus:lwe,pendingCount:cwe,total:uwe,kind:dwe,status:fwe,columns:hwe,actions:pwe,empty:mwe,detail:gwe,space:bwe,decision:ywe,score:vwe},BVe=Object.freeze(Object.defineProperty({__proto__:null,actions:pwe,adminOnly:awe,category:swe,columns:hwe,decision:ywe,default:FVe,detail:gwe,empty:mwe,filterStatus:lwe,kind:dwe,pendingCount:cwe,score:vwe,search:owe,space:bwe,status:fwe,title:rwe,total:uwe},Symbol.toStringTag,{value:"Module"})),xwe={cancel:"取消",close:"关闭",retry:"重试",tryAgain:"重新尝试",closeDialog:"关闭{{title}}",agentFallback:"{{agent}} 智能体",unknownSource:"未知来源"},wwe={terminalTitle:"终端",browserTitle:"沙箱浏览器",terminalSubtitle:"连接当前 AgentKit Session 的交互式终端",browserSubtitle:"在当前 AgentKit Session 中查看与操作浏览器",connecting:"正在连接…",connected:"已连接",notConnected:"尚未连接",opening:"正在打开 {{title}}",connectingSession:"工具正在连接当前 AgentKit Session。",openFailed:"{{title}} 打开失败"},Owe={title:"恢复 Codex 对话",subtitle:"选择当前 Sandbox Session 中最近更新的 Thread",loading:"正在读取历史对话",loadFailed:"历史对话读取失败",empty:"暂无可恢复的对话"},kwe={title:"Codex 权限",subtitle:"设置会保存到当前 Sandbox Session,并同步到其中的所有 Thread",sandboxMode:"沙箱模式",approvalPolicy:"审批策略",approvalMethod:"审批方式",networkAccess:"允许网络访问",networkAccessHelp:"控制 workspace-write 与只读模式中的外部网络访问。",fullAccessWarning:"完全访问会关闭文件系统与网络隔离,请只在可信任务中使用。",save:"保存权限",sandboxChoices:{readOnly:{label:"只读",detail:"允许读取文件,不允许写入工作空间。"},workspaceWrite:{label:"工作区写入",detail:"允许在当前工作空间内读取与修改文件。"},fullAccess:{label:"完全访问",detail:"不启用沙箱隔离,适合明确可信的任务。"}},approvalChoices:{untrusted:{label:"仅不可信命令",detail:"只对 Codex 判断为不可信的操作发起审批。"},onRequest:{label:"按需审批",detail:"Codex 可在必要时请求你确认命令或文件修改。"},never:{label:"不审批",detail:"Codex 不会暂停并请求人工批准。"}},reviewerChoices:{user:{label:"由我审批",detail:"审批请求会显示在 Studio 中,由你决定。"},autoReview:{label:"自动审查",detail:"使用 Codex 自动审查流程处理审批请求。"}}},Swe={title:"工作空间",subtitle:"选择当前 Codex Thread 执行命令与修改文件的目录",absolutePath:"绝对路径",browse:"浏览",parent:"上一级",empty:"当前目录没有子目录",locked:"当前对话已经开始,工作空间已锁定。新建 Sandbox 会话后可重新选择。",useDirectory:"使用此目录"},Ewe={fileTitle:"允许修改文件?",commandTitle:"允许执行命令?",subtitle:"Codex 正在等待你的决定",workingDirectory:"执行目录",decline:"拒绝",acceptOnce:"仅本次允许",acceptSession:"本会话允许"},Cwe={availableSkills:"可用 Skills",selectModel:"选择模型",commands:"Codex 快捷命令",currentModel:"当前:{{model}}",loadingSkills:"正在发现当前工作区的 Skills…",loadingModels:"正在读取模型…",noSkillMatches:"当前工作区没有匹配的 Skill",noModelMatches:"没有匹配模型,也可以直接输入模型 ID",noCommandMatches:"没有匹配的快捷命令",skillFallback:"加载并执行该 Skill",add:"添加",uploadImage:"上传图片",uploadDocument:"上传文档或 PDF",uploadVideo:"上传视频",openTerminal:"进入终端",viewBrowser:"查看浏览器",permissions:"Codex 权限",workspaceLocked:"对话已开始,工作空间已锁定",selectWorkspace:"选择工作空间",workspace:"Codex 工作空间",endpointCopied:"Endpoint 已复制",copyEndpoint:"复制 Sandbox Endpoint",continuePlaceholder:"继续说明你想实现或调整的内容",messagePlaceholder:"向 AgentKit 沙箱发送消息,输入 / 查看命令,输入 $ 调用 Skill…",stop:"停止生成",send:"发送",stopping:"正在确认停止…",resume:"恢复任务",steer:"追加要求",steerPlaceholder:"可继续追加要求,或随时停止任务…"},Awe={defaultName:"我的智能体",namedDefault:"我的 {{agent}}",creatingTitle:"正在创建 {{agent}} 智能体",failedTitle:"启动失败",createTitle:"创建 {{agent}} 智能体",fallbackError:"AgentKit 沙箱初始化失败,请稍后重新尝试。",creatingDescription:"正在创建并等待 {{agent}} 智能体就绪,这通常需要半分钟",name:"智能体名称",storageSize:"存储大小",storageHelp:"数据将持久化保存,可设置 {{min}}–{{max}} GiB。",persistent:"持久化",persistenceUnsupported:"当前环境不支持快照持久化",persistentHelp:"保留智能体数据,后续可继续使用。",temporaryHelp:"智能体将在 8 小时后清空",cancelCreation:"取消创建",confirm:"确认创建",retry:"重新尝试"},Twe={activeAria:"Codex 智能体会话已开启",openAria:"开启 Codex 智能体会话",active:"Codex 智能体会话中",entry:"灵光一现",exit:"退出当前智能体",expired:"已到期",remainingHours:"剩余 {{hours}} 小时 {{minutes}} 分钟",remainingMinutes:"剩余 {{minutes}} 分钟",expiryWarning:"远端开发环境最长保留 8 小时,将于 {{expiry}} 到期({{remaining}});到期后清除对话和文件。",usingAgent:"当前您在使用 {{agent}} 智能体",activityAria:"Sandbox 操作记录",activity:"操作记录",tokenUsageAria:"Codex Token 用量",tokens:"{{label}}:{{value}} tokens",tokenLabels:{total:"总计",input:"输入",cachedInput:"缓存输入",output:"输出",reasoningOutput:"推理输出"}},_we={back:"返回智能体列表",subtitle:"{{agent}} 智能体详情",type:"智能体类型",status:"状态",createdBy:"创建人",snapshotStatus:"快照状态",toolType:"工具类型",createdAt:"创建时间",snapshotReason:"快照原因",expiresAt:"过期时间",snapshotId:"快照 ID",sessionId:"会话 ID",sourceSessionId:"来源 Session ID",delete:"删除智能体",waking:"唤醒中…",opening:"打开中…",wake:"唤醒智能体",open:"打开智能体",deleteTitle:"删除智能体?",deleteDescription:"将删除“{{name}}”及其保存的数据,此操作无法撤销。",deleting:"删除中…",confirmDelete:"确认删除",sleepingHint:"该智能体已休眠,进入时需要唤醒,可能需要一些时间。",wakingHint:"正在唤醒智能体,可能需要一些时间。",agentId:"智能体 ID"},jwe={back:"返回智能体列表",createdBy:"创建人 {{creator}}",ariaLabel:"智能体工作区",main:"主界面",terminal:"终端",mainTitle:"{{agent}} 主界面",openingTerminal:"正在打开终端…",terminalTitle:"{{agent}} 终端"},Nwe={prompt:`使用 AgentKit Studio Plugin 端云接力当前会话、项目和任务。请直接执行,不要让我手动打开终端。 +- 保持礼貌、专业的语气。`},q0e={requestFailed:"请求失败 ({{status}}){{detail}}",a2aSpaces:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 AgentKit 智能体中心",loginRequired:"请先登录以访问 AgentKit 智能体中心"},vikingKnowledge:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 VikingDB 知识库",loginRequired:"请先登录以访问 VikingDB 知识库"},vikingMemory:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 VikingDB 记忆库",loginRequired:"请先登录以访问 VikingDB 记忆库"},mcpGateway:{missingHttpTool:"请返回“添加 MCP 工具”并添加至少一个 HTTP MCP 服务;MCP 稳定性治理不支持 stdio 服务。",missingUrl:"已添加的 HTTP MCP 工具缺少有效服务地址,请返回“添加 MCP 工具”补充后再发布。"},customModel:{fallbackName:"自定义模型",apiKeyLabel:"{{name}} 模型 API Key",fallbackApiKeyLabel:"{{name}} 的备用模型 {{model}} API Key"},deploymentEnv:{serverInjected:"由服务端注入",selectedApiKeyPlaceholder:"由所选 API Key 注入",mcpInjectedComment:"由已添加的 MCP 工具注入",restoredPlaceholder:"由 Studio 服务端安全恢复",generatedMcpPlaceholder:"由已添加的 HTTP MCP 工具自动生成",restoredHelp:"更新时由 Studio 服务端合并 MCP 地址与认证,不向浏览器返回旧密钥。",mergedMcpHelp:"Studio 服务端自动合并 MCP 地址与可选认证,不向浏览器返回旧密钥。",listSeparator:"、",requirementHint:"优化项“{{labels}}”依赖此配置。",requiredBy:"优化项“{{labels}}”依赖此配置,请填写 {{key}}。",required:"请填写 {{label}}({{key}})。",invalidJson:"JSON 格式不正确"},drafts:{unsupportedVersion:"本机草稿版本暂不受支持,请升级 Studio 后重试。",invalidFormat:"本机草稿数据格式无效。",readFailed:"无法读取本机草稿,浏览器中的草稿数据可能已损坏。",quotaExceeded:"浏览器存储空间不足,草稿未保存。请删除不需要的草稿或清理此站点的浏览器存储后重试。",writeRejected:"浏览器拒绝保存草稿,请检查站点存储权限后重试。"},skills:{searchFailed:"搜索失败 ({{status}})",downloadFailed:"下载技能失败 ({{status}})",agentKitRequestFailed:"AgentKit Skills 请求失败",missingManifest:"{{location}} 缺少 SKILL.md",invalidParentPath:"{{location}} 包含非法路径(..):{{path}}",invalidPath:"{{location}} 包含非法路径:{{path}}",localDescription:"本地 Skill",folderSource:"文件夹",noManifest:"{{location}} 中未发现 SKILL.md"},zip:{invalid:"无效的 zip:找不到 EOCD",tooManyFiles:"zip 文件数不能超过 {{count}} 个",tooLarge:"zip 解压后的内容过大"}},W0e={back:"返回开发会话",runtimeName:"Runtime 名称",runtimeNameExists:"Runtime 名称已存在,请更换后重试",checkingRuntimeName:"正在检查 Runtime 名称",verifiedSource:"已验证源码",deployableSource:"可部署源码",verifiedByCodex:"已通过 Codex 云端验证",entryPoint:"入口",files:"文件",artifact:"构建产物",validationReport:"验证报告",verifiedHint:"源码由服务端从已验证交付物物化,浏览器文件不能替换。",unverifiedHint:"源码已由服务端安全物化,部署前请确认 Runtime 配置。",env:{requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}"}},K0e={name:"代码包",back:"返回创建方式",reading:"正在读取代码包",readingEllipsis:"正在读取代码包…",uploadFirst:"请先上传代码包",uploadAriaLabel:"代码包上传",upload:"上传代码包",reupload:"重新上传代码包",uploadPrompt:"请上传代码包",filesRecognized:"已识别 {{count}} 个文件,点击区域可重新上传",dropHint:"点击或拖拽上传,支持 .zip 格式,最大 50 MB;可使用 app.py,或由 agentkit.yaml 声明入口",viewFiles:"查看文件",chooseFile:"选择代码包",errors:{invalidFormat:"请选择 .zip 格式的代码包。",tooLarge:"代码包不能超过 50 MB。",invalidPath:"压缩包包含非法路径:{{name}}",empty:"压缩包中没有可部署的文件。",tooManyFiles:"代码包文件数不能超过 {{count}} 个。",duplicateFile:"代码包包含重复文件:{{path}}",manifestParse:"agentkit.yaml 无法解析:{{detail}}",manifestRoot:"agentkit.yaml 根节点必须是对象。",manifestCommon:"agentkit.yaml 的 common 必须是对象。",entryPointType:"agentkit.yaml 的 common.entry_point 必须是文件路径。",entryPointInvalid:"agentkit.yaml 的 common.entry_point 不是有效文件路径。",entryPointMissing:"代码包中不存在 agentkit.yaml 声明的启动入口:{{entryPoint}}",defaultEntryPointMissing:"代码包根目录必须包含 app.py,或在 agentkit.yaml 的 common.entry_point 中声明已有入口。"}},G0e={label:"Agent 执行画布",readOnlyLabel:"只读 Agent 执行画布",minimapLabel:"执行流程缩略图",controls:{ariaLabel:"执行流程控制",zoomIn:"放大",zoomOut:"缩小",fitView:"适应视图"},rootAgent:"主 Agent",unnamedStep:"未命名步骤",terminals:{input:"用户请求",output:"最终回复"},edges:{then:"然后",continueLoop:"继续循环",call:"调用"},patterns:{llm:{label:"智能体",description:"理解任务并直接完成一个具体工作"},sequential:{label:"分步协作",description:"内部步骤按照顺序依次执行"},parallel:{label:"同时处理",description:"内部步骤同时工作,完成后统一汇总"},loop:{label:"循环执行",description:"重复执行内部步骤,直到满足停止条件"},a2a:{label:"远程智能体",description:"调用已经存在的远程 Agent"}},actions:{insertHere:"在这里插入步骤",deleteNamed:"删除 {{name}}",deleteNode:"删除节点",addSubagent:"添加子 Agent",addParallelStep:"添加一个同时处理的步骤",addLoopStep:"添加循环步骤",addNextStep:"添加下一个步骤",addFirst:"添加到最前",addLast:"添加到最后"}},X0e={title:"智能构建",subtitle:"描述需求,完成 Agent 的构建、调试与验证。",model:{label:"模型",placeholder:"选择模型",retiring:"即将下线",currentConfiguration:"当前配置",loadError:"加载模型列表失败"},availability:{checking:"正在检查智能开发能力…",unavailable:"当前无法使用智能模式,请返回后重试。"},goal:{title:"从目标开始",continueTitle:"继续优化项目",hint:"只需说明 Agent 要解决的问题;如有影响结果的关键信息,会在开始前向你确认。",continueHint:"说明这次要调整的内容,完成后会保存为新版本。",basedOn:"基于",clearSelection:"取消选择",label:"目标描述",optimizationLabel:"优化目标",placeholder:"例如:创建一个能读取销售数据、生成周报并校验输出格式的 Agent",optimizationPlaceholder:"例如:增加数据来源标注,并在信息不足时先向用户确认"},actions:{preparing:"准备中…",build:"开始构建",optimize:"开始优化"},preparation:{accepted:"目标已收到,马上开始实现",preparing:"正在创建任务环境…",starting:"环境已就绪,正在启动 Codex…",next:"接下来会先梳理目标和实现方式,再编写、运行和验证 Agent。"},tasks:{title:"进行中的任务",hint:"离开页面后仍会继续,可随时回来查看和补充要求。",refresh:"刷新任务列表",loading:"正在读取任务…",empty:"暂无进行中的任务",emptyHint:"开始构建后,可以从这里回到任务。",loadError:"暂时无法读取任务,请重试。",openError:"暂时无法打开任务,请重试。",startedAt:"开始于 {{time}}",open:"查看任务",opening:"正在连接…",states:{queued:"等待开始",running:"构建中",recovering:"正在重连",waiting_user:"等待你的回复",stopping:"正在停止",succeeded:"已完成",failed:"未完成",cancelled:"已停止"}}},Y0e={title:"已保存项目",description:"选择已有版本继续优化,或查看、下载和部署源码。",refresh:"刷新项目列表",checkingStorage:"正在检查项目存储…",unavailableTitle:"暂时无法读取项目",storageCheckError:"无法确认项目存储状态,请稍后重试。",storageNotConfigured:"项目存储尚未配置。",loadingMigrated:"正在读取已迁移项目…",loadingSaved:"正在读取已保存项目…",loadingVersions:"正在读取项目版本…",unknownTime:"时间未知",sourceDownloaded:"源码已下载。",projectSummary_one:"{{count}} 个版本 · 更新于 {{time}}",projectSummary_other:"{{count}} 个版本 · 更新于 {{time}}",versionSummary_one:"{{time}} · {{count}} 个文件",versionSummary_other:"{{time}} · {{count}} 个文件",noVersionDescription:"暂无版本描述",latestVersion:"最新版本",defaultVersionName:"版本 · {{time}}",rename:{projectTitle:"修改项目名称",versionTitle:"修改版本名称",projectLabel:"项目名称",versionLabel:"版本名称",hint:"支持中英文、数字和常见标点,最多 {{max}} 个字符。",required:"请输入名称。",tooLong:"名称不能超过 {{max}} 个字符。",invalidCharacters:"名称不能包含换行、控制字符、不可见格式字符或 < >。",save:"保存名称",saving:"保存中…",updated:"名称已更新。",failed:"名称保存失败,请重试。"},verified:"已验证",pendingVerification:"待确认",viewSource:"查看源码",download:"下载",downloading:"下载中…",optimize:"去优化",optimizeUnavailable:"去优化,暂不支持",errors:{projects:"无法读取已保存项目。",source:"无法读取项目源码。",versions:"无法读取项目版本。",download:"下载源码失败。",prepareDeployment:"无法准备部署源码。",deleteVersion:"删除项目版本失败。",migrated:"无法读取已迁移项目",saved:"无法读取已保存项目"},empty:{migratedTitle:"还没有已迁移的项目",savedTitle:"还没有已保存的项目",migratedDescription:"完成首次迁移后,源码会自动保存在这里。",savedDescription:"完成首次构建后,源码会自动保存在这里。",noVersions:"这个项目还没有可用版本。"},compare:{selected:"已选择 {{count}}/2",selectedLabel:"已选择",select:"选择",view:"查看对比",start:"对比版本"},delete:{title:"删除这个版本?",onlyVersion:"“{{name}}”只有这一个版本,删除后项目也会移除。此操作无法撤销。",description:"该版本的源码和验证记录将永久删除,其他版本不受影响。",confirm:"删除版本"}},Z0e={title:"选择创建方式",subtitle:"以不同模式构建您的智能体",features:"特性",quick:{title:"快速模式",description:"动态派生子智能体自主完成任务",features:{dynamicSubagents:"动态派生子智能体",autonomousPlanning:"自主规划执行",collaboration:"多智能体协作",summary:"自动汇总结果",skills:"按需调用技能",trace:"任务过程可追踪"}},traditional:{title:"传统模式",description:"高度自定义您的智能体结构",features:{visualConfig:"可视化配置",migration:"存量智能体迁移",debugging:"实时调试",optimization:"可选性能优化",parameters:"精细参数控制"}}},J0e={placeholder:"输入系统提示词;键入 ## 加空格可创建二级标题…",toolbar:{undo:"撤销 {{shortcut}}",redo:"重做 {{shortcut}}",paragraph:"正文",quote:"引用",heading:"标题 {{level}}",selectBlockType:"选择文本类型",blockType:"文本类型",bold:"加粗",removeBold:"取消加粗",italic:"斜体",removeItalic:"取消斜体",bulletedList:"无序列表",numberedList:"有序列表"}},eve={local:{duplicatesSkipped:"已跳过重复技能:{{names}}",invalidDrop:"请拖入包含 SKILL.md 的文件夹或一个 .zip 文件",readError:"读取失败:{{detail}}",dropLabel:"拖入文件夹或 ZIP,自动识别 Skill",hint:"每个技能需包含 SKILL.md。支持包含多个技能的目录。",reading:"正在读取文件…",fileCount:"本地 · {{count}} 个文件"},hub:{searchError:"搜索失败,请稍后重试。",searchPlaceholder:"搜索火山 Find Skill 技能广场,例如 数据分析、PDF…",search:"搜索",searching:"正在搜索…",noResults:"没有找到匹配的技能,换个关键词试试。",hint:"输入关键词搜索火山 Find Skill 技能广场,所选技能会在生成项目时下载到 skills/ 目录。"},space:{loadError:"加载失败",loadingSpaces:"正在加载 AgentKit Skills 中心…",noSpaces:"此账号下没有 AgentKit Skills 中心。",selectSpace:"选择 AgentKit Skills 中心",openConsole:"在火山引擎控制台打开",loadingSkills:"正在加载技能列表…",noSkills:"此 AgentKit Skills 中心暂无技能。"}},tve={unnamedNode:"未命名节点",editInstruction:"点击编辑指令…",controls:{ariaLabel:"工作流画布控制",zoomIn:"放大",zoomOut:"缩小",fitView:"适应视图"},sections:{info:"工作流信息",execution:"执行方式",nodes:"节点",nodeConfig:"节点配置"},types:{sequential:{label:"顺序",description:"节点依次执行"},parallel:{label:"并行",description:"节点同时执行"},loop:{label:"循环",description:"节点循环执行"}},placeholders:{description:"这个工作流做什么…",agentDescription:"这个 Agent 做什么…",instruction:"你是一个…"},errors:{workflowNameUnique:"名称须与 Agent 节点名称保持唯一",agentNameUnique:"Agent 名称在当前工作流中必须唯一"},dragHint:"拖拽到画布,或点击下方按钮添加",agentNode:"Agent 节点",addNode:"添加节点",connectHint:"拖拽节点的圆点连线以表达执行顺序。",create:"创建工作流",deleteNode:"删除节点",nameHelp:"仅使用英文字母、数字和下划线,且名称保持唯一。",instruction:"指令 (instruction)",tools:"工具 (逗号分隔)",nodeId:"节点 ID",empty:{selectNode:"选择一个节点以编辑其配置",summary:"共 {{nodes}} 个节点 · {{edges}} 条连线"}},nve={ariaLabel:"快速模式创建",progress:"快速模式创建进度",steps:{agent:{label:"智能体",title:"基本信息",description:"设置智能体的名称、用途、行为方式与能力"},environment:{label:"执行环境",title:"配置执行环境",description:"选择默认环境或已构建的自定义环境"},deployment:{label:"部署偏好",title:"部署偏好",description:"定义 AgentKit 云上参数"}},model:{label:"模型",source:"模型来源",name:"模型名称",fallbacks:"Fallback 模型",fallbackPlaceholder:"备用模型名称",addFallback:"添加备用模型",addProviderFallback:"添加其他服务商",removeFallback:"移除",fallbackType:"备用模型类型",fallbackSameProvider:"同服务商",fallbackOtherProvider:"其他服务商",apiKeyEnv:"API Key 环境变量",invalidApiKeyEnv:"环境变量名只能包含字母、数字和下划线,且不能以数字开头。",fallbackHelp:"同服务商备用模型复用主模型连接;其他服务商会使用单独的 provider、API Base 和 API Key。",fallbackIgnored:"空值、重复值或与主模型相同的模型会被忽略。",provider:"服务商 Provider",invalidApiBase:"请输入合法的 http:// 或 https:// 链接。",volcengineArk:"火山方舟",custom:"自定义",gateway:"模型网关",comingSoon:"待上线",currentApiKey:"当前 API Key",currentConfiguration:"当前配置",loadingApiKeys:"正在加载 API Key",selectApiKey:"选择 API Key",searchApiKeys:"搜索 API Key 名称",noApiKeys:"暂无可用 API Key",loadingModels:"正在加载模型",selectModel:"选择模型",searchModels:"搜索名称、Model ID 或服务商",noModels:"没有可用的模型",apiKeyPlaceholder:"请输入模型 API Key",credentialsLoadError:"模型凭据加载失败",modelsLoadError:"模型列表加载失败"},identity:{unnamedPool:"未命名用户池",currentPool:"{{value}}(当前用户池)",userPool:"用户池",loading:"正在加载用户池",placeholder:"请选择用户池",search:"搜索用户池",empty:"当前账号下暂无 Identity 用户池",currentHint:"当前 Studio 的登录 JWT 将透传访问此 Runtime",mismatchHint:"所选用户池不是当前 Studio 使用的用户池,部署后无法从 Studio 调用此 Runtime",selectionHint:"当前 Studio 使用的用户池已在列表中标注"},agent:{namePlaceholder:"输入智能体名称",descriptionPlaceholder:"说明这个智能体可以做什么",prompt:"提示词",promptPlaceholder:"定义角色、目标和行为边界",skills:"技能",addSkill:"添加技能"},validation:{descriptionRequired:"请输入描述",promptRequired:"请输入提示词",modelRequired:"请选择模型",apiKeyRequired:"请先填写或选择模型 API Key",instanceIntegers:"最小实例数必须为大于等于 0 的整数,最大实例数必须为大于 0 的整数",instanceOrder:"最小实例数不能大于最大实例数",userPoolRequired:"请选择用于 Runtime 鉴权的用户池"},deployment:{runtimeName:"Runtime 名称",runtimeNameUpdateHint:"更新时保持现有 Runtime 名称不变",runtimeNameHint:"仅支持英文字母、数字、下划线和连字符",region:"发布区域",authentication:"鉴权方式",apiKeyDescription:"默认方式,使用 Runtime API Key 访问",userPoolDescription:"使用 Identity 用户池签发的 JWT",sessionStorage:"会话存储",inMemoryStorage:"In-memory 临时存储",backends:{sqlite:"SQLite 文件",mysql:"MySQL",postgresql:"PostgreSQL"},instances:"实例设置",minInstances:"最小实例数",maxInstances:"最大实例数",inMemoryHint:"为避免多实例间会话丢失,推荐将 Runtime 固定为 1~1",networkMode:"网络模式",network:{public:"公网",private:"私网",both:"公网与私网"},subnetIds:"子网 ID(可选,多个用逗号分隔)",sharedInternet:"VPC 内共享公网出口",sharedInternetHint:"允许私网 Runtime 通过共享出口访问公网",evaluationSets:"评测集",createEvaluationSets:"自动创建评测集",evaluationSetsHint:"部署成功后自动创建 Good Case 和 Bad Case 评测集",resources:"资源配置",complete:"部署已完成",preparing:"正在准备部署…"},environmentVariables:{title:"环境变量",add:"添加变量",nameAriaLabel:"环境变量名称",valueAriaLabel:"{{name}} 的值",deleteNamed:"删除 {{name}}"},actions:{updateAgain:"再次更新",deployAgain:"重新部署",updateAndPublish:"更新并发布",applyProfile:"应用 Profile",applyProfileAgain:"再次应用 Profile"}},ive={actions:{addSubagent:"添加子 Agent",clearRoot:"清空根 Agent",clearRootConfirmation:"清空根 Agent 的全部配置和子 Agent?此操作无法撤销。"},workspace:{progress:"Agent 创建进度",modes:{build:"架构",validate:"调试",optimize:"优化",environment:"环境",publish:"发布"},titles:{build:"个性化您的智能体架构",validate:"调试您的智能体",optimize:"为您的智能体选择优化项",environment:"配置云上环境",publish:"准备好部署您的智能体"}},sections:{type:{label:"Agent 类型",hint:"选择 Agent 类型"},basic:{label:"基本信息",hint:"名称、描述与系统提示词"},model:{label:"模型配置",hint:"模型与服务(可选)"},tools:{label:"工具",hint:"可调用的能力"},skills:{label:"技能",hint:"声明式技能"},knowledge:{label:"知识库",hint:"外部知识检索"},memory:{label:"记忆",hint:"短期与长期记忆"},subagents:{label:"子 Agent",hint:"嵌套协作"},review:{label:"完成",hint:"预览并创建"}},agentTypes:{ariaLabel:"Agent 类型",remoteChildOnly:"远程智能体只能作为子步骤使用",llm:{label:"智能体",fullLabel:"LLM 智能体",description:"大模型驱动,自主完成任务"},sequential:{label:"分步协作",fullLabel:"顺序型智能体",description:"子 Agent 按顺序依次执行"},parallel:{label:"同时处理",fullLabel:"并行型智能体",description:"子 Agent 并行执行后汇总"},loop:{label:"循环执行",fullLabel:"循环型智能体",description:"子 Agent 循环执行到满足条件"},a2a:{label:"远程智能体",fullLabel:"远程 Agent",description:"通过 A2A 协议调用远程 Agent"}},basic:{agentName:"Agent 名称",name:"名称",agentDescription:"智能体描述",descriptionPlaceholder:"简要描述这个 Agent 的用途,便于团队识别…",nameHelp:"遵循 Google ADK 命名规则,且在执行流程中保持唯一。",rootDescriptionHelp:"完整描述会保留;部署时会自动整理为符合 Runtime 规范的单行描述。",descriptionHelp:"描述会显示在 Agent 列表与选择器中。",orchestratorHelp:"这是一个协作容器,本身不生成回答。请在左侧画布中添加任务步骤,并通过拖拽调整它们的位置。",maxIterations:"最大轮次",maxIterationsHelp:"循环编排反复执行子 Agent,直到满足条件或达到该轮次上限。",agentCenter:"AgentKit 智能体中心",agentCenterHelp:"远程 Agent 的名称、描述和能力来自中心返回的 Agent Card。系统会根据每轮任务动态发现并挂载匹配的 Agent。",moreOptions:"更多选项",systemPrompt:"系统提示词",loadingMarkdown:"正在加载 Markdown 编辑器…",markdownHelp:"支持 Markdown 快捷输入,例如键入 ## 加空格创建二级标题。",unnamed:"未命名",unnamedAgent:"未命名智能体"},validation:{remoteRoot:"远程 Agent 只能作为子 Agent",missingRegistry:"请选择 AgentKit 智能体中心",name:{required:"名称为必填项",reserved:"user 是 Google ADK 保留名称,请使用其他名称",characters:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"},duplicateName:"Agent 名称在当前结构中必须唯一",missingDescription:"描述为必填项",mcpDuplicateName:"MCP 名称重复,请为每个服务使用唯一名称",mcpDuplicateUrl:"MCP 地址重复,请删除重复服务后再发布",missingSubagent:"缺少子 Agent",missingPrompt:"系统提示词为必填项",apiKeyRequired:"请先填写或选择模型 API Key",missingSubagentDetail:"{{type}}至少需要添加一个子 Agent 后才能调试或发布。",problem:"{{name}}:{{problem}}"},ai:{ariaLabel:"AI 自动填写 Agent 配置",minimumLength:"请至少输入 {{count}} 个字符。",replaceConfirmation:"生成的新配置会替换当前画布和属性,确定继续吗?",placeholder:"描述目标,使用 {{model}} 模型一键生成配置",generate:"智能生成",generating:"正在智能生成",success:"生成成功",regenerate:"重新生成",failed:"智能生成失败"},debug:{ariaLabel:"智能体调试工作区",unavailable:"当前后端暂不支持生成 Agent 调试运行。",baseline:"基准组",comparison:"对照组 {{count}}",selectModel:"请选择模型",enterDescription:"请输入描述",enterPrompt:"请输入系统提示词",duplicateConfiguration:"测试配置不能重复",starting:"启动中…",applyAndRestart:"应用并重启",restart:"重新启动",start:"启动环境",defaultModel:"默认模型",testConfiguration:"测试配置",deleteVariant:"删除 {{name}}",deleteVariantGroup:"删除对照组",creatingEnvironment:"正在创建测试环境…",configurationChanged:"配置已变更,请重新启动环境。",ready:"环境已就绪",readyHint:"发送消息以比较智能体回复。",startHint:"先完善配置,再启动环境。",viewTraceNamed:"查看 {{name}} 的调用链路",traceUnavailable:"发送消息后可查看调用链路",trace:"调用链路",useConfiguration:"使用此配置",finishConfiguration:"完成配置",finishAndStart:"完成并启动",currentAgentModel:"当前 Agent 模型",configurationHint:"修改仅用于本次对比,选择使用后才会进入部署流程。",messagePlaceholder:"向已启动的测试环境发送消息…",startOneFirst:"请先启动至少一个测试环境",addVariant:"添加对照组",traceTitle:"调用链路 · {{name}}",leaveTitle:"离开调试?",leaveDescription:"离开调试页面后,当前环境将被清理。您可以通过重新启动环境进行新的测试。",cleaning:"清理中…",confirmLeave:"确定离开",closeLeaveConfirmation:"关闭离开调试确认"},optimization:{ariaLabel:"智能体优化选项",scenario:"优化场景",components:"优化组件",bytePlusUnavailable:"BytePlus 账号暂不支持 Harness Sidecar 优化项。请保持优化项为空后继续部署,普通 BytePlus 智能体不受影响。",releaseScenario:"优化场景:{{profile}}",profiles:{default:{label:"自定义",description:"按需选择组件,不勾选时不启动 Sidecar。"},ops:{label:"运维场景",description:"适用于运维诊断、数据库、日志和监控 MCP。"}},groups:{quality:"提升回答质量",cost:"降低运行成本",stability:"增强运行稳定性"},options:{context_engine:{label:"上下文治理",description:"治理上下文组装、任务锚定和上下文预算。"},compressor:{label:"上下文与结果压缩",description:"压缩长上下文和大型工具结果,降低 Token 成本。"},verifier:{label:"回答校验与修复",description:"校验证据和回答,在失败时执行修复或告警。"},long_run_control:{label:"Goal 任务控制",description:"管理 Goal 任务的进度、续跑和结束条件。"},mcp_resilience:{label:"MCP 稳定性治理",description:"治理连接、超时、空结果、大返回和调用预算;默认包含 SQL 只读保护。"}}},model:{label:"模型",source:"模型来源",volcanoArk:"火山方舟",volcengineArk:"火山方舟",bytePlusModelArk:"BytePlus ModelArk",custom:"自定义",gateway:"模型网关",comingSoon:"待上线",configuration:"模型配置",name:"模型名称",fallbacks:"Fallback 模型",fallbackPlaceholder:"备用模型名称",addFallback:"添加备用模型",addProviderFallback:"添加其他服务商",removeFallback:"移除",fallbackType:"备用模型类型",fallbackSameProvider:"同服务商",fallbackOtherProvider:"其他服务商",apiKeyEnv:"API Key 环境变量",invalidApiKeyEnv:"环境变量名只能包含字母、数字和下划线,且不能以数字开头。",fallbackHelp:"同服务商备用模型复用主模型连接;其他服务商会使用单独的 provider、API Base 和 API Key。",fallbackIgnored:"空值、重复值或与主模型相同的模型会被忽略。",provider:"服务商 Provider",invalidApiBase:"请输入合法的 http:// 或 https:// 链接。",liteLlmProviders:"LiteLLM 支持列表",apiKeyPlaceholder:"请输入模型 API Key",available:"已开通",retiring:"即将下线",notActivated:"未开通",unavailable:"暂不可用",apiKeyLoadError:"加载 Ark API Key 失败",loadingApiKeys:"正在加载 API Key…",selectApiKey:"选择 API Key",currentApiKey:"当前 API Key",apiKeyList:"API Key 列表",searchApiKey:"搜索 API Key",searchApiKeyName:"搜索 API Key 名称",noApiKeys:"暂无可用 API Key",noMatchingApiKey:"没有匹配的 API Key",loading:"正在加载模型…",loaded:"已加载 {{count}} 个模型",loadError:"加载模型失败",selectModel:"选择模型",selectProviderModel:"选择服务商模型",providerModels:"服务商模型",search:"搜索模型",searchPlaceholder:"搜索名称、Model ID 或服务商",noMatches:"没有匹配的模型",empty:"暂无可用模型",unknownStatus:"未知状态",refresh:"刷新",refreshing:"刷新中…",activate:"开通",activateAction:"前往开通",currentConfiguration:"当前配置"},tools:{builtIn:"内置工具",builtInHelp:"勾选 VeADK 提供的内置能力,生成时会自动补全 import 与所需环境变量。",codeExecution:"代码执行配置",codeExecutionHelp:"指定 AgentKit 代码执行沙箱。",mcp:"MCP 工具"},catalog:{web_search:{label:"联网搜索",description:"火山引擎 Web Search,获取实时信息。"},parallel_web_search:{label:"并行联网搜索",description:"并行发起多条搜索查询,更快汇总。"},link_reader:{label:"网页读取",description:"抓取并阅读给定链接的正文内容。"},web_scraper:{label:"网页爬取",description:"结构化爬取网页(需要 Scraper 服务)。"},image_generate:{label:"图像生成",description:"文生图(Doubao Seedream)。"},image_edit:{label:"图像编辑",description:"图生图 / 编辑(Doubao SeedEdit)。"},video_generate:{label:"视频生成",description:"文/图生视频(Doubao Seedance),含任务查询。"},text_to_speech:{label:"语音合成 (TTS)",description:"把文本转成语音(火山语音)。"},run_code:{label:"代码执行",description:"在沙箱中执行代码。"},vesearch:{label:"VeSearch 智能搜索",description:"火山 VeSearch(需要 bot 端点)。"},links:{console:"控制台",documentation:"文档"},env:{modelAgentName:{comment:"模型名称"},embeddingModelName:{comment:"向量化模型(记忆/知识库需要)"},vikingMemoryProject:{comment:"VikingDB 记忆库项目"},vikingMemoryRegion:{comment:"VikingDB 记忆库地域"},vikingMemoryType:{comment:"记忆类型"},feishuAppId:{comment:"飞书应用 App ID"},feishuAppSecret:{comment:"飞书应用 App Secret",placeholder:"输入 App Secret"},registrySpaceId:{comment:"AgentKit 智能体中心",placeholder:"请选择智能体中心"},registryTopK:{comment:"召回 Agent 数量"},registryRegion:{comment:"AgentKit 智能体中心地域"},registryEndpoint:{comment:"AgentKit 智能体中心 OpenAPI 地址"},agentKitToolId:{comment:"代码执行沙箱 ID"},agentKitToolRegion:{comment:"AgentKit Tools 地域"},openVikingUrl:{comment:"OpenViking 服务地址"},openVikingMemoryUserId:{comment:"记忆归属 ID",help:"对应 viking://user/<此值>/peers/<请求用户>/memories 中的 user 段;用于隔离 Agent、租户或业务场景,默认 default。"},openVikingMemoryPolicy:{comment:"记忆策略",help:"记忆的抽取策略和隔离策略,不填写时使用官方默认策略。"},openVikingKnowledgeUserId:{comment:"知识库归属 ID",help:"未配置资源目录时用于默认路径 viking://user/<此值>/resources/<知识库索引>/,默认 default。"},openVikingTargetUri:{comment:"知识库资源目录",help:"留空时由 KnowledgeBase index 自动生成;填写后直接检索该 OpenViking 资源目录,优先级最高。"},tlsServiceName:{comment:"TLS topic_id,留空自动创建"}}},backends:{shortTerm:{local:{label:"本地内存",description:"进程内,不持久化。适合开发调试。"},sqlite:{label:"SQLite 文件",description:"持久化到本地 .db 文件。"},mysql:{label:"MySQL",description:"持久化到 MySQL。"},postgresql:{label:"PostgreSQL",description:"持久化到 PostgreSQL。"}},longTerm:{local:{label:"本地向量库",description:"进程内 llama-index 向量库。"},opensearch:{label:"OpenSearch",description:"OpenSearch 向量检索。"},redis:{label:"Redis",description:"Redis 向量检索。"},viking:{label:"VikingDB Memory",description:"VikingDB 记忆库(支持用户画像)。"},openviking:{label:"OpenViking Memory",description:"OpenViking 长期记忆,按用户维度保存和检索偏好、事件与实体。"},mem0:{label:"Mem0",description:"Mem0 托管记忆服务。"}},knowledge:{viking:{label:"VikingDB Knowledge",description:"VikingDB 知识库。"},opensearch:{label:"OpenSearch",description:"OpenSearch 向量检索。"},context_search:{label:"Context Search",description:"火山 Context Search 引擎(无需向量化)。"},openviking:{label:"OpenViking Knowledge",description:"OpenViking 资源目录知识库,无需向量化模型配置。"}}},exporters:{apmplus:{label:"APMPlus",description:"火山 APMPlus 应用性能监控。"},cozeloop:{label:"CozeLoop",description:"扣子 CozeLoop 链路观测。"},tls:{label:"TLS (日志服务)",description:"火山 TLS 日志服务导出。"}},knowledge:{title:"知识库",description:"启用外部知识检索(RAG),让 Agent 基于你的资料作答。",backend:"知识库后端",vikingDatabase:"VikingDB 知识库"},memory:{shortTerm:"短期记忆",shortTermDescription:"存储单会话上下文",shortTermBackend:"短期记忆后端",longTerm:"长期记忆",longTermDescription:"存储跨会话上下文,通常使用向量化检索",longTermBackend:"长期记忆后端",vikingDatabase:"VikingDB 记忆库",autoSave:"自动保存会话到长期记忆",autoSaveDescription:"会话结束时自动把内容写入长期记忆,无需手动调用。"},mcp:{removeTool:"删除 MCP 工具",namePlaceholder:"名称(可选)",urlPlaceholder:"MCP 服务地址",pathWarning:"当前填写的是网关根地址。仅当根路径就是 MCP Endpoint 时可直接使用;否则请补充完整服务路径。",tokenPlaceholder:"Bearer Token(可选)",showToken:"显示 Bearer Token",hideToken:"隐藏 Bearer Token",commandPlaceholder:"命令,例如 npx",argsPlaceholder:"参数,以空格分隔",stdioHint:"stdio 工具在部署环境中启动,请确保命令和依赖可用。",addTool:"添加 MCP 工具"},resources:{unnamedAgentCenter:"未命名智能体中心",unnamedKnowledgeBase:"未命名知识库",unnamedMemory:"未命名记忆库",loadError:"加载失败",loadingAgentCenters:"正在加载智能体中心…",agentCentersLoaded:"已加载 {{count}} 个智能体中心",noAgentCenters:"暂无智能体中心",noMatchingAgentCenters:"没有匹配的智能体中心",searchAgentKitCenter:"搜索 AgentKit 智能体中心",searchNameOrId:"搜索名称或 ID",selectAgentCenter:"选择智能体中心",selectAgentKitCenter:"选择 AgentKit 智能体中心",selectedAgentCenter:"已选智能体中心",agentKitCenter:"AgentKit 智能体中心",refreshAgentCenters:"刷新智能体中心",knowledgeBaseList:"知识库列表",knowledgeBasePlaceholder:"选择知识库",loadingKnowledgeBases:"正在加载知识库…",knowledgeBasesLoaded:"已加载 {{count}} 个知识库",noKnowledgeBases:"暂无知识库",noMatchingKnowledgeBases:"没有匹配的知识库",searchKnowledgeBase:"搜索知识库",selectKnowledgeBase:"选择知识库",refreshKnowledgeBases:"刷新知识库",memoryList:"记忆库列表",memoryPlaceholder:"选择记忆库",loadingMemories:"正在加载记忆库…",memoriesLoaded:"已加载 {{count}} 个记忆库",noMemories:"暂无记忆库",noMatchingMemories:"没有匹配的记忆库",searchMemory:"搜索记忆库",selectMemory:"选择记忆库",refreshMemories:"刷新记忆库"},env:{noAdditionalParameters:"此后端无需额外运行参数。",invalidJson:"请输入有效的 JSON。",helpAriaLabel:"{{label}}说明:{{help}}",openOpenViking:"打开 OpenViking {{label}}",valuePlaceholder:"请输入参数值",openVikingIndex:"OpenViking 资源索引",openVikingIndexHelp:"默认值:留空;生成项目时使用 Agent 名自动生成,例如 my_agent_kb。未配置 DATABASE_OPENVIKING_TARGET_URI 时,默认 URI 拼接为 viking://user/{知识库归属 ID,未填则 default}/resources/{资源索引}/;如果填写了 DATABASE_OPENVIKING_TARGET_URI,则直接使用该完整 URI。",openVikingIndexAriaLabel:"OpenViking 资源索引说明:{{help}}"},deployment:{vpcRequired:"使用 VPC 网络时,请填写 VPC ID。",apiKeyRequired:"请先选择模型使用的 API Key。",invalidEnvName:"环境变量名称不合法:{{key}}",requiredEnv:"{{name}}:请填写必填环境变量",generatingConfiguration:"正在生成部署配置",runtimeNameExists:"Runtime 名称已存在,请修改后重试。",preparing:"准备部署",applyingMpaProfile:"正在将 Agent 配置应用到 MPA Runtime",mpaProfileApplied:"MPA Runtime 配置已应用",runningMpaSmoke:"正在验证 MPA Runtime 执行链路",mpaReady:"MPA Runtime 已可运行",mpaOperationIncomplete:"MPA Runtime 初始化未完成,请重试此部署任务。",complete:"部署完成",failed:"部署失败",updateAndPublish:"更新并发布",stages:{build:"构建镜像",deploy:"部署 Runtime",publish:"发布服务",applyMpaProfile:"应用 MPA 配置",verifyMpaRuntime:"验证 MPA Runtime",mpaReady:"MPA Runtime 可运行",running:"部署中"}},publish:{generating:"正在生成发布配置",validating:"校验 Agent 结构并准备部署快照…"}},rve={presets:{support:{name:"客服助手",description:"7×24 在线答疑,结合知识库与历史对话,稳定、礼貌地解决用户问题。",instruction:"你是一名专业、耐心的客服助手。请始终保持礼貌、友好的语气,优先依据知识库中的资料回答用户问题;当资料不足以确定答案时,如实告知用户并主动引导其提供更多信息,切勿编造。回答尽量简洁、分点清晰,必要时给出操作步骤。",subagents:{}},analyst:{name:"数据分析师",description:"运行代码完成统计与可视化,开启链路追踪,分析过程可观测、可复现。",instruction:"你是一名严谨的数据分析师。面对数据问题时,先厘清分析目标与口径,再通过编写并运行代码完成清洗、统计与可视化。每一步都要说明你的假设与方法,给出结论时附上关键数据支撑,并指出潜在的偏差与局限。",subagents:{}},translator:{name:"翻译助手",description:"中英互译,忠实、通顺、地道,保留原文语气与专业术语。",instruction:"你是一名专业的翻译助手,精通中英互译。请在忠实于原文含义的前提下,使译文自然、地道、符合目标语言表达习惯;保留专有名词与专业术语的准确性,并尽量贴合原文的语气与风格。仅输出译文,除非用户额外要求解释。",subagents:{}},coder:{name:"代码助手",description:"编写、调试与重构代码,可运行代码验证结果,给出清晰可维护的实现。",instruction:"你是一名资深软件工程师。请根据需求编写正确、清晰、可维护的代码,遵循目标语言的惯用风格与最佳实践。在不确定时通过运行代码验证你的实现,给出关键的边界条件与测试思路,并对复杂逻辑附上简要注释。",subagents:{}},researcher:{name:"研究员",description:"联网检索一手资料,结合知识库与长期记忆,输出有据可查的研究结论。",instruction:"你是一名严谨的研究员。面对研究问题时,先拆解关键子问题,再通过联网检索收集多个一手、可信的来源,交叉验证后再下结论。结论需注明出处与不确定性,区分事实与推断,避免以偏概全。",subagents:{}},"research-team":{name:"多智能体研究团队",description:"由检索员、分析员、撰写员协作的研究编排,分工完成端到端调研报告。",instruction:"你是一支研究团队的总协调者。负责拆解用户的研究任务,将检索、分析、撰写分别委派给对应的子 Agent,汇总各子 Agent 的产出,把控整体质量,最终输出结构清晰、有据可查的研究报告。",subagents:{0:{name:"检索员",description:"联网搜集与课题相关的一手资料与数据。",instruction:"你是研究团队中的检索员。根据课题联网检索多个可信来源,整理出关键事实、数据与原文出处,交付给分析员,不做主观结论。"},1:{name:"分析员",description:"对检索到的材料做交叉验证与归纳分析。",instruction:"你是研究团队中的分析员。对检索员提供的材料做交叉验证、归纳与对比,提炼洞见、识别矛盾与不确定性,形成结构化的分析要点。"},2:{name:"撰写员",description:"将分析结论组织为结构清晰、引用规范的报告。",instruction:"你是研究团队中的撰写员。把分析员的要点组织成结构清晰、语言通顺、引用规范的研究报告,确保每个结论都能追溯到来源。"}}}},tags:{tools:"工具",memory:"记忆",knowledgeBase:"知识库",tracing:"观测",subagents:"子 Agent {{count}}"},gallery:{title:"从模板新建",subtitle:"选择一个预制 Agent 模板,按需微调后即可创建。"},detail:{back:"返回模板列表",name:"名称",systemPrompt:"系统提示词",model:"模型",tools:"工具",memory:"记忆",knowledgeBase:"知识库",tracing:"观测追踪",subagents:"子 Agent({{count}})",create:"使用此模板创建",shortTermMemory:"短期",longTermMemory:"长期"}},sve={checkingExpiry:"确认有效期中",waitingRecovery:"等待恢复",listFailed:"读取项目列表失败",recoveryFailed:"工作区恢复失败,请重试",operationFailed:"项目操作失败,请重试",title:"代码项目",back:"返回代码项目",restart:"本开发环境将在 {{countdown}} 后重启,请随时保存数据",expiresAt:"有效期至 {{date}}",exitFullscreen:"退出全屏",fullscreen:"全屏",exitFullscreenHint:"退出全屏(Esc)",recovering:"正在恢复工作区,完成后将自动返回项目",retry:"重试连接",search:"搜索代码项目",newTitle:"新建代码项目",new:"新建项目",readingStats:"正在读取项目统计",createdAt:"创建时间",opening:"正在打开",unknownCreatedAt:"创建时间未知",open:"打开项目",empty:"没有匹配的代码项目",close:"关闭新建项目",name:"项目名称",placeholder:"例如 my-agent",nameHelp:"以英文字母开头,可包含字母、数字、下划线和连字符,最多 64 个字符",cancel:"取消",create:"创建项目",files_one:"{{count}} 个文件",files_other:"{{count}} 个文件",directories_one:"{{count}} 个目录",directories_other:"{{count}} 个目录",separator:","},ave={enabled:"已启用",disabled:"已禁用",unknownStatus:"状态未知",allPermissions:"全部权限",customPermissions:"自定义权限",unknownPermissions:"权限未知",unnamed:"未命名 API Key",search:"搜索名称、状态或权限",noMatches:"没有匹配的 API Key",noModelPermission:"当前 API Key 无权限",modelAvailable:"可用",permissionState:{Available:"可用于对话",Shutdown:"已下线",VideoGeneration:"视频生成模型",Unsupported:"不支持作为对话模型",NotActivated:"尚未开通",Unknown:"未获取到模型状态"}},ove={common:Q0e,yaml:z0e,validation:V0e,defaults:H0e,helpers:q0e,intelligentDeployment:W0e,codePackage:K0e,buildCanvas:G0e,intelligent:X0e,projectLibrary:Y0e,modePicker:Z0e,promptEditor:J0e,skills:eve,workflow:tve,workbench:nve,traditional:ive,template:rve,workspace:sve,modelApiKey:ave},NVe=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:G0e,codePackage:K0e,common:Q0e,default:ove,defaults:H0e,helpers:q0e,intelligent:X0e,intelligentDeployment:W0e,modePicker:Z0e,modelApiKey:ave,projectLibrary:Y0e,promptEditor:J0e,skills:eve,template:rve,traditional:ive,validation:V0e,workbench:nve,workflow:tve,workspace:sve,yaml:z0e},Symbol.toStringTag,{value:"Module"})),lve={source:"任务来源",studio:"Studio 定时任务",title:"Runtime 定时任务",selectRuntime:"请先在 Agent 列表中选择一个云端 Runtime。",scope:"展示当前 Studio 用户在此 Runtime 中的定时任务。",refresh:"刷新",loading:"正在获取 Runtime 任务",empty:"此 Runtime 中没有符合条件的定时任务。",authRequired:"Runtime 拒绝了请求,请检查网关访问权限及 Runtime 的鉴权开关。",forbidden:"当前用户没有此 Runtime 的访问权限。",unsupported:"此 Runtime 未提供 mpa 定时任务接口。",invalidResponse:"任务接口返回了无法识别的数据,请检查 Runtime 版本。",loadFailed:"获取任务失败,请检查网络和 Runtime 状态后刷新。",pagination:"Runtime 任务分页",total:"共 {{total}} 条",previous:"上一页",next:"下一页",columns:{name:"任务名称",enabled:"状态",schedule:"执行计划",next:"下次执行",last:"最近结果"},schedule:{once:"单次",interval:"间隔",daily:"每天",weekly:"每周",monthly:"每月",cron:"Cron"},search:"搜索任务",executionCount:"执行次数",successRate:"成功率",prompt:"任务内容",manage:{view:"任务视图",list:"列表",calendar:"日历",create:"创建定时任务",edit:"编辑任务",copy:"复制",delete:"删除",detail:"详情",run:"立即执行",name:"任务",lastRun:"上次执行",schedule:"执行周期",lastStatus:"上次执行状态",agent:"执行 Agent",actions:"操作",all:"全部状态",Pending:"尚未执行",Queued:"已排队",Running:"执行中",Succeeded:"执行成功",Failed:"执行失败",TimedOut:"执行超时",Cancelled:"已取消",Skipped:"已跳过",overview:"执行统计:",prompt:"任务内容",timezone:"时区",localTime:"执行时间(当前设备时区)",time:"执行时间",Once:"单次",Interval:"间隔",Daily:"每天",Weekly:"每周",Monthly:"每月",Cron:"Cron 表达式",seconds:"秒",interval:"间隔秒数",weekdays:"星期(1 为周一,7 为周日,逗号分隔)",monthDays:"每月日期(1–31,逗号分隔)",delivery:"结果投递",Web:"Web",Feishu:"飞书",target:"飞书接收 ID",enabled:"启用任务",cancel:"取消",save:"保存",saving:"保存中",required:"请填写任务名称、Agent ID、任务内容和投递目标。",timezoneInvalid:"请输入有效的 IANA 时区,例如 Asia/Shanghai。",futureTime:"请选择未来的执行时间。",intervalInvalid:"间隔需要为 30–31536000 的整数秒。",daysInvalid:"请输入有效且不重复的日期或星期。",history:"执行记录",duration:"耗时",result:"结果 / 会话",noRuns:"暂无执行记录。",conflict:"任务已被修改或请求发生冲突,请关闭弹窗并刷新后重试。",invalid:"请求校验失败,请检查用户身份、执行时间、Agent ID 和任务配置。",queued:"已提交执行请求。",saved:"任务已更新。",deleteConfirm:"确定删除“{{name}}”?删除后将不再调度此任务。",calendarZone:"显示时区:",prevMonth:"上个月",nextMonth:"下个月",today:"今天",nextOnly:"仅下次",calendarHint:"日历展示预计执行安排;复杂 Cron 仅显示服务端给出的下一次执行时间。",botAccount:"投递机器人",selectBot:"请选择已启用的投递机器人。",botsLoading:"正在读取飞书机器人…",botsFailed:"读取投递机器人失败,请重试。",botsUnauthorized:"无权读取飞书机器人,请联系管理员配置投递。",retryBots:"重新读取机器人",botDisabled:"已停用"}},cve={backToList:"返回定时任务列表",cancel:"取消",cancelQueue:"取消排队",cancelQueueFirst:"请先取消排队",cancelling:"取消中…",closeDrawer:"关闭抽屉",collapse:"收起",connectingRuntime:"正在连接 Runtime…",createScheduledTask:"创建定时任务",createTask:"创建任务",delete:"删除",deleteTask:"删除任务",edit:"编辑",enable:"启用",expand:"展开",pause:"暂停",refresh:"刷新",refreshHistory:"刷新执行历史",rerun:"重新执行",retry:"重试",runNow:"立即执行",saveChanges:"保存更改",saving:"保存中…",stop:"终止执行",stopRun:"终止本次执行",stopRunFirst:"请先终止当前执行",stopping:"终止中…",viewDetails:"查看详情"},uve={cancelDescription:"本次 Session 将被取消,后续计划不会暂停。",cancelTitle:"终止本次执行?",deleteDescription:"“{{name}}”及其全部执行历史将被永久删除。",deleteTitle:"删除定时任务?"},dve={configuration:"任务配置",nextRun:"下次执行",pageLabel:"定时任务详情",region:"地域",runtime:"运行时",status:"任务状态"},fve={createTitle:"创建定时任务",description:"每次触发都会为 Runtime Agent 创建独立 Session。",editTitle:"编辑定时任务"},hve={minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",seconds:"{{count}} 秒"},pve={cronExpression:"Cron 表达式",cronHelp:"依次填写分钟、小时、日期、月份、星期。",dailyTime:"每天执行时间",enableAfterCreate:"创建后启用",enableHelp:"启用后会从下一个计划时间开始执行。",name:"任务名称",namePlaceholder:"例如:每日生成运营摘要",noRuntime:"暂无可用 Runtime",prompt:"执行文本",promptPlaceholder:"输入每次执行时发送给 Agent 的固定文本",runAt:"执行时间",runtimeAgent:"运行时智能体",runtimeHelp:"任务始终跟随该 Runtime 当前生效版本。",runtimePlaceholder:"选择 Runtime Agent",schedule:"执行计划",scheduleType:"执行计划类型",timezone:"时区",weekday:"星期"},mve={all:"全部"},gve={description:"每次运行均使用独立 Session,结果与错误会永久保留。",duration:"耗时 {{duration}}",emptyDescription:"任务触发或立即执行后,记录会显示在这里。",emptyTitle:"暂无执行记录",errorDetails:"错误详情",finalAnswer:"最终回答",loadFailed:"无法加载执行历史",loadFailedDescription:"请检查 Studio 服务后重试。",session:"会话",title:"执行历史"},bve={cancelRequested:"已提交终止请求。",created:"任务已创建。",deleted:"任务及其执行历史已删除。",enabled:"任务已启用。",paused:"任务已暂停。",queued:"任务已排队,将在一分钟内开始执行。",requeued:"任务已重新排队,将在一分钟内开始执行。",updated:"任务已更新。"},yve={filterLabel:"定时任务状态筛选",listLabel:"定时任务列表",loadFailed:"无法加载定时任务",loadFailedDescription:"请检查 Studio 服务后重试。",title:"定时任务"},vve={cron:"Cron {{cron}}{{zone}}",daily:"每天 {{time}}{{zone}}",once:"一次 · {{date}}{{zone}}",weekly:"{{weekday}} {{time}}{{zone}}"},xve={daily:"每天",once:"一次性",weekly:"每周"},wve={cancelled:"已取消",enabled:"已启用",failed:"失败",notRun:"尚未执行",paused:"已暂停",pending:"准备中",queued:"已排队",retrying:"自动重试中",running:"执行中",skipped:"已跳过",success:"成功"},Ove={cronFields:"Cron 表达式需要包含 5 个字段,例如 0 9 * * *。",nameRequired:"请输入任务名称。",promptRequired:"请输入每次执行时发送给 Agent 的文本。",runtimeAppMissing:"Runtime Agent 未返回可调用的 appName,请确认 Runtime 已就绪且版本兼容。",runtimeRequired:"请选择可用的 Runtime Agent。",timeRequired:"请选择执行时间。"},kve={friday:"周五",monday:"周一",saturday:"周六",sunday:"周日",thursday:"周四",tuesday:"周二",wednesday:"周三"},RVe={mpa:lve,actions:cve,confirm:uve,detail:dve,drawer:fve,duration:hve,fields:pve,filters:mve,history:gve,notices:bve,page:yve,schedule:vve,scheduleTypes:xve,status:wve,validation:Ove,weekdays:kve},IVe=Object.freeze(Object.defineProperty({__proto__:null,actions:cve,confirm:uve,default:RVe,detail:dve,drawer:fve,duration:hve,fields:pve,filters:mve,history:gve,mpa:lve,notices:bve,page:yve,schedule:vve,scheduleTypes:xve,status:wve,validation:Ove,weekdays:kve},Symbol.toStringTag,{value:"Module"})),Sve="快速创建 Agent",Eve="Agent 类型",Cve="关闭",Ave="部署",Tve="预览配置",_ve="已发起配置包下载",jve="下载失败,请重试",Nve="有 {{count}} 处配置需要修改",Rve="自定义",Ive="自定义{{field}}",Pve="输入自定义值",Dve="该模型未声明推理强度,使用服务端设置",Mve="请先为该提供方添加模型",Lve="请先选择提供方",$ve="请选择",Fve="可选",Bve="默认模型、Agent 预设和权限用于新会话;预设需要存在于部署的 Harness 中",Uve="仅填写环境变量名称,实际密钥由部署环境提供",Qve="read-only 为只读,workspace-write 可写工作区,danger-full-access 允许完整访问且不请求确认",zve="allowedModels 是子 Agent 可选择的模型列表,启用后至少填写一组提供方和模型",Vve="添加自定义模型服务,填写它的端点、协议和模型 ID,支持火山引擎和 BytePlus 等兼容服务",Hve="当前覆盖常用原生设置,其他插件参数与预设文件尚未接入",qve="查看原生配置文档",Wve="模型提供方 {{index}}",Kve="模型 {{index}}",Gve="添加模型提供方",Xve="移除提供方 {{index}}",Yve="添加模型",Zve="移除模型 {{index}}",Jve="添加可选模型",exe="移除可选模型 {{index}}",txe="移除",nxe="填写服务端的模型 ID",ixe={provider:"提供方 {{index}}",model:"模型 {{index}}"},rxe={defaults:"会话默认设置",deepseek:"DeepSeek 模型服务",providers:"自定义模型提供方",shell:"命令执行",loop:"工具调用",subagents:"子 Agent 模型选择",search:"DeepSeek 网络搜索"},sxe={id:"提供方 ID",displayName:"显示名称",baseURL:"服务地址",api:"接口协议",apiKeyEnv:"密钥环境变量"},axe={id:"例如 company-models",displayName:"可选,默认使用提供方 ID",baseURL:"https://…/v1",api:"选择接口协议",apiKeyEnv:"例如 MODEL_API_KEY"},oxe={id:"模型 ID",name:"显示名称",contextWindow:"上下文容量",maxTokens:"最大输出容量"},lxe={positive:"请输入大于 0 的数值",integer:"请输入有效的正整数",env:"请输入环境变量名,只能包含字母、数字和下划线,且不能以数字开头",url:"请输入 HTTP 或 HTTPS 地址,不要在地址中包含凭据",option:"请选择受支持的原生选项",required:"请补全此项",duplicate:"该 ID 或模型组合已存在",providerId:"以小写字母开头,可包含小写字母、数字、点、下划线和连字符,不能使用保留 ID",routes:"请至少填写一组完整的提供方和模型",modelPair:"请填写该自定义提供方下的模型 ID",unknownProvider:"请先添加该自定义模型提供方",unknownModel:"请填写该提供方下已配置的模型 ID",timer:"请输入大于 0 且不超过 2147483647 的毫秒数"},cxe={"agent-default-model_provider":"默认提供方","agent-default-model_model":"默认模型","agent-default-model_reasoningEffort":"默认推理强度","agent-presets_default":"默认 Agent 预设",permission_defaultPreset:"默认权限预设","llm-deepseek_apiKeyEnv":"密钥环境变量","llm-deepseek_baseURL":"服务地址","llm-deepseek_thinking":"思考模式","llm-deepseek_reasoningEffort":"推理强度","llm-deepseek_maxTokens":"每次请求的输出上限","llm-deepseek_defaultContextWindow":"默认上下文容量","llm-deepseek_streamIdleTimeoutMs":"流式空闲超时(毫秒)",bash_timeoutMs:"默认执行超时(毫秒)",bash_maxTimeoutMs:"最大执行超时(毫秒)",bash_maxOutputBytes:"输出上限(字节)","agent-loop_maxParallelToolCalls":"并行工具调用上限","subagent-model-selection_enabled":"启用模型选择","web-search-deepseek_apiKeyEnv":"密钥环境变量","web-search-deepseek_baseURL":"搜索服务地址","web-search-deepseek_model":"搜索模型","web-search-deepseek_apiVersion":"接口版本","web-search-deepseek_maxTokens":"搜索输出上限","web-search-deepseek_maxUses":"搜索次数上限"},uxe="取消",dxe="返回创建方式",fxe="DeepSeek Harness 配置",PVe={title:Sve,agentType:Eve,close:Cve,continue:"继续配置",deploy:Ave,preview:Tve,export:"导出配置",downloaded:_ve,downloadFailed:jve,validationSummary:Nve,customValue:Rve,customField:Ive,enterCustomValue:Pve,reasoningUnavailable:Dve,modelsUnavailable:Mve,selectProviderFirst:Lve,selectOption:$ve,optional:Fve,defaultsHelp:Bve,credentialHelp:Uve,permissionHelp:Qve,routesHelp:zve,providersHelp:Vve,coverage:Hve,source:qve,provider:Wve,model:Kve,addProvider:Gve,removeProvider:Xve,addModel:Yve,removeModel:Zve,addRoute:Jve,removeRoute:exe,remove:txe,modelIdPlaceholder:nxe,route:ixe,sections:rxe,providerFields:sxe,providerPlaceholders:axe,modelFields:oxe,errors:lxe,fields:cxe,cancel:uxe,back:dxe,pageTitle:fxe},DVe=Object.freeze(Object.defineProperty({__proto__:null,addModel:Yve,addProvider:Gve,addRoute:Jve,agentType:Eve,back:dxe,cancel:uxe,close:Cve,coverage:Hve,credentialHelp:Uve,customField:Ive,customValue:Rve,default:PVe,defaultsHelp:Bve,deploy:Ave,downloadFailed:jve,downloaded:_ve,enterCustomValue:Pve,errors:lxe,fields:cxe,model:Kve,modelFields:oxe,modelIdPlaceholder:nxe,modelsUnavailable:Mve,optional:Fve,pageTitle:fxe,permissionHelp:Qve,preview:Tve,provider:Wve,providerFields:sxe,providerPlaceholders:axe,providersHelp:Vve,reasoningUnavailable:Dve,remove:txe,removeModel:Zve,removeProvider:Xve,removeRoute:exe,route:ixe,routesHelp:zve,sections:rxe,selectOption:$ve,selectProviderFirst:Lve,source:qve,title:Sve,validationSummary:Nve},Symbol.toStringTag,{value:"Module"})),hxe="问题反馈",pxe="问题描述",mxe="常见问题",gxe="取消",bxe="完成",yxe="提交反馈",vxe="正在上报…",xxe={title:"上报成功,感谢您的反馈",description:"AgentKit 团队会尽快查看您提交的问题。"},wxe={close:"关闭问题反馈",intro:"请选择遇到的问题,也可以补充具体表现。",privacy:"您的对话数据将会上报到 AgentKit 团队,请注意隐私保护。",descriptionPlaceholder:"请描述问题发生时的表现(选填)",issues:{slow:"执行速度慢",crash:"运行崩溃",incorrect:"结果不准确",tool_error:"工具调用失败",other:"其他问题"}},Oxe={description:"告诉我们您在使用 AgentKit Studio 时遇到的问题。",module:"所属模块",modules:{conversation:"对话",agents:"智能体",applications:"自动化",search:"搜索",other:"其他"},commonIssuesMultiple:"常见问题(可多选)",issueTypes:"问题类型",issues:{page_slow:"页面加载慢",feature_unavailable:"功能无法使用",display_error:"页面显示异常",no_response:"操作无响应",other:"其他问题"},descriptionPlaceholder:"请描述问题发生时的页面、操作和表现",quickAdd:"快捷补充",suggestionsLabel:"问题描述推荐",suggestions:{noResponse:"点击后没有反应",loading:"页面一直处于加载状态",incomplete:"部分内容显示不完整",error:"操作后出现错误提示"},privacy:"您的数据将会上报到 AgentKit 团队,请注意隐私保护。"},MVe={title:hxe,descriptionLabel:pxe,commonIssues:mxe,cancel:gxe,done:bxe,submit:yxe,submitting:vxe,success:xxe,dialog:wxe,page:Oxe},LVe=Object.freeze(Object.defineProperty({__proto__:null,cancel:gxe,commonIssues:mxe,default:MVe,descriptionLabel:pxe,dialog:wxe,done:bxe,page:Oxe,submit:yxe,submitting:vxe,success:xxe,title:hxe},Symbol.toStringTag,{value:"Module"})),kxe={back:"返回",close:"关闭"},Sxe={title:"优化迁移项目",closeAria:"关闭优化窗口"},Exe={title:"已迁移项目",description:"管理迁移后的源码版本,也可以选择任一版本继续优化。",libraryTitle:"项目与版本",libraryDescription:"查看、下载、部署或对比源码版本,也可以基于任一版本继续优化。",emptyTitle:"还没有已迁移的项目",emptyDescription:"迁移完成后,源码会自动保存在这里。"},Cxe={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any(通用迁移)"},Axe={awaitingUpload:"待上传",analyzing:"分析中",needsInput:"待补充",analysisReady:"待确认",migrating:"迁移中",validating:"校验中",packaging:"打包中",succeeded:"已完成",succeededWithWarnings:"已完成,有提示",partial:"部分完成",failed:"失败",cancelled:"已终止",expired:"已过期"},Txe={evaluationPending:"待评测",evaluationRunning:"评测中",waitingDataset:"待保存评测用例",waitingEnvironment:"待补充环境变量",evaluationFailed:"迁移完成,评测未完成",evaluationBlocked:"迁移完成,评测待处理",evaluationCancelled:"迁移完成,评测已取消",resultUnavailable:"结果不可用",environmentExpired:"环境已过期"},_xe={partialReady:"迁移产物已生成,但交付不完整,请查看迁移提示。",readyWithWarnings:"迁移产物已生成,请查看迁移提示。",ready:"迁移产物已生成。"},jxe={passed:"产物校验通过",failed:"产物校验未通过",degraded:"产物校验未完成"},Nxe={session:"创建迁移环境",upload:"上传项目",analysis:"分析项目"},Rxe={agentNameRequired:"请输入 Agent 名称",agentNameInvalid:"Agent 名称必须为 1-63 位,只能包含小写字母、数字和连字符,且必须以字母或数字开头和结尾"},Ixe={seconds:"{{seconds}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},Pxe={savedUnaffected:"已保存项目不受影响",savingUnaffected:"源码正在保存,完成后不受环境期限影响",activeDetail:"到期后任务记录和临时产物将无法访问",oneHour:"临时迁移环境保留 1 小时",ended:"临时迁移环境已结束",savedAvailable:"已保存项目仍可查看、下载、部署或优化",unavailable:"任务记录和临时产物已无法访问",countdown:"临时迁移环境将在 {{minutes}} 分 {{seconds}} 秒后结束",expiredSavedMessage:"临时迁移环境已结束,已保存项目不受影响。",expiredMessage:"临时迁移环境已结束,任务记录和临时产物无法继续访问。"},Dxe={recommended:"建议迁移方式",scope:"迁移范围",excluded:"不在本次范围",viewEvidence:"查看分析证据",viewAssumptions:"查看关键假设",viewSourceEvidence:"查看源码证据"},Mxe={ariaLabel:"Codex 执行动态",title:"Codex 执行动态",startingAnalysis:"Codex 正在开始分析…",startingMigration:"Codex 正在开始迁移…",loadError:"暂时无法读取 Codex 执行动态,不影响当前任务。",liveAnalyzing:"正在分析项目",liveMigrating:"正在执行迁移",liveValidating:"正在校验迁移结果",livePackaging:"正在整理迁移产物",liveDelivery:"正在核对交付产物"},Lxe={title:"迁移产物",fileTooLarge:"该文件超过 2 MiB,请下载完整产物后查看。",unsupportedPreview:"该文件不支持在线预览,请下载完整产物后查看。",filesAria:"迁移产物文件",searchAria:"搜索产物文件",searchPlaceholder:"搜索文件",limit:"仅展示前 {{count}} 项,请搜索具体文件。",noSelection:"未选择文件",noPreview:"暂无可预览文件。",loadingFile:"正在读取产物文件…",startupFile:"启动文件",fileCountLabel:"文件数",saved:"源码已保存,可继续查看、下载、部署或优化。",saving:"产物已生成,正在保存源码版本。",deployReady:"产物可预览、下载和部署,正在等待源码保存状态。",deployUnavailable:"产物可预览和下载,但当前交付状态不支持部署。",viewProjects:"查看已迁移项目",downloading:"下载中…",downloadZip:"下载 ZIP",deployTitle:"部署迁移产物",deployUnavailableTitle:"当前交付状态不支持部署",deployRuntime:"部署到 Runtime",fileCount:"{{count}} 个文件",startup:"启动文件 {{module}}",loading:"正在读取迁移产物…"},$xe={retiring:"即将下线",currentDefault:"当前默认模型",loadError:"加载模型列表失败",label:"模型",placeholder:"选择模型"},Fxe={zipOnly:"请选择 .zip 格式的本地项目文件。",invalidName:"ZIP 文件名无效,请重命名后重新选择。",tooLarge:"项目 ZIP 不能超过 {{size}}。",empty:"项目 ZIP 不能为空。",removeAria:"移除项目 ZIP",reselectPrompt:"重新选择项目 ZIP",selectPrompt:"选择或拖入本地项目 ZIP",reselect:"重新选择",selectZip:"选择 ZIP",continue:"继续上传",start:"上传并分析",inputAria:"选择本地项目 ZIP",retention:"临时迁移环境从创建完成起保留 1 小时;保存成功的源码版本不受影响。",uploading:"上传中…",sizeHint:"支持项目 ZIP,最大 {{size}}"},Bxe={requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}",notReady:"迁移产物尚未准备完成。",back:"返回迁移结果"},Uxe={backToAddAgent:"返回添加 Agent",title:"从存量迁移",newMigration:"新建迁移",recent:"最近迁移",loadingSessions:"正在读取迁移会话…",noSessions:"暂无迁移会话",heading:"迁移存量 Agent 项目",intro:"上传本地项目 ZIP,Codex 将先进行只读分析,再由你确认迁移方式。",backToHome:"迁移首页",navigation:"迁移导航",showMore:"查看更多",showLess:"收起",projectName:"项目名称",status:"状态",createdAt:"创建时间",actions:"操作",openTask:"查看迁移 {{name}}",continueTask:"继续",viewTask:"查看"},Qxe={stop:"终止迁移",stopping:"正在终止…",cancel:"取消",reload:"重新读取",refreshStatus:"刷新状态"},zxe={unavailable:"迁移能力暂不可用",defaultReason:"Dev Sandbox 暂不可用,请联系管理员检查配置。"},Vxe={creatingSandbox:"正在创建 Dev Sandbox",initializing:"正在初始化迁移工作目录,并检查 AgentKit CLI、Codex 和迁移能力。环境就绪后将自动上传项目。",elapsed:"已等待 {{duration}}",uploadThenAnalyze:"ZIP 上传完成后将自动开始只读分析。",analyzing:"Codex 正在识别框架、入口和迁移边界,不会执行实际迁移。",migrationLocked:"迁移执行中不能修改附件或迁移方式。你可以等待当前任务结束,或主动终止。",analysisPaused:"只读分析已暂停。请仅回答下面列出的问题,提交后会在同一迁移环境中重新分析,不会开始实际迁移。",analysisComplete:"只读分析已完成。请检查建议,并确认最终迁移方式。",awaitingUpload:"迁移环境已创建,请重新选择本地 ZIP 继续上传。",expiredTitle:"迁移环境已过期",expiredDescription:"迁移内容和产物已无法预览、下载或部署。如已完成 Runtime 部署,可返回智能体页面继续使用。",unsupportedTitle:"当前 ZIP 暂时无法迁移",unsupportedHint:"请按提示整理项目后,新建迁移并重新上传。",failedTitle:"迁移未完成",cancelled:"当前迁移已终止。你可以新建迁移并重新上传项目。"},Hxe={ariaLabel:"补充项目分析信息",title:"补充分析所需信息",description:"附件保持锁定,提交后仅继续只读分析",submitting:"正在继续分析…",submit:"提交并继续分析"},qxe={ariaLabel:"回答迁移需要你决定的问题",title:"迁移需要你的回答",description:"回答后会在当前这一步里继续,不需要重新开始",other:"其他",otherPlaceholder:"也可以直接输入你的答案",submitting:"正在提交回答…",submit:"提交回答并继续"},Wxe={ariaLabel:"确认迁移方式",title:"确认迁移方式",framework:"迁移方式",frameworkPlaceholder:"选择迁移方式",agentName:"Agent 名称",entry:"项目入口",entryPlaceholder:"选择项目入口",entryExample:"例如 agent.py:agent",consent:"点击“确认并开始迁移”即确认上述迁移范围、排除项和关键假设。",starting:"正在启动迁移…",start:"确认并开始迁移"},Kxe={setup:{title:"迁移效果评测",description:"迁移完成后自动执行评测用例。",on:"已开启",off:"未开启",unavailable:"当前环境暂不支持迁移效果评测。",casesTitle:"评测用例",casesDescription:"至少添加一个用例。期望结果和评测标准可选。",configuredSummary:"{{count}} 个用例 · {{preset}} · {{dimensions}}",incompleteSummary:"{{count}} 个用例待填写 · {{preset}} · {{dimensions}}",dimensionSummary:"{{count}} 个维度",editSettings:"编辑设置",viewSettings:"查看设置",lockedTitle:"评测用例",lockedDescription:"上传开始后不可修改。",closeAria:"关闭评测设置",done:"完成配置",close:"关闭"},tabs:{label:"迁移任务内容",migration:"迁移",evaluation:"效果评测",waitingMigration:"等待迁移",waitingConfiguration:"待配置",running:"评测中",completed:"已完成",issue:"需处理"},bulk:{open:"批量粘贴",label:"每行输入一个用例",placeholder:`帮我查询今天的订单状态 +把结果整理成三点`,preview:"将添加 {{count}} 个用例",confirm:"添加用例"},case:{title:"用例 {{index}}",add:"添加用例",moveUp:"上移用例 {{index}}",moveDown:"下移用例 {{index}}",copy:"复制",delete:"删除",userInput:"用户输入",userInputPlaceholder:"例如:请帮我查询今天的订单状态",expectedOutcome:"期望结果(可选)",expectedOutcomePlaceholder:"描述希望 Agent 完成什么,不要求逐字一致",criteria:"必须满足的要求(可选)",addCriterion:"添加要求",criterionLabel:"必须满足的要求 {{index}}",criterionPlaceholder:"例如:必须包含订单号和当前状态",removeCriterion:"删除要求 {{index}}"},advanced:{title:"高级设置",standard:"标准评测",standardDescription:"默认包含语义一致性、输出约束、工作流与工具一致性 3 个维度,适合多数迁移。",custom:"自定义维度",customDescription:"按业务风险选择一个或多个评测维度。",lockedDescription:"项目开始上传后,评测方式和维度不再修改。"},dimension:{semantic_fidelity:"语义一致性",output_contract:"输出约束",workflow_tool_fidelity:"工作流与工具一致性",context_memory_fidelity:"上下文与记忆一致性",boundary_error_fidelity:"边界与异常一致性",safety_refusal_fidelity:"安全与拒答一致性"},dimensionDescription:{semantic_fidelity:"检查意图理解、结论和关键事实是否保持一致。",output_contract:"检查字段、结构、语言和格式约束是否保持。",workflow_tool_fidelity:"检查可观察的工作流分支和工具行为是否保持。",context_memory_fidelity:"检查可验证的多轮上下文和记忆行为。",boundary_error_fidelity:"检查无效输入、信息缺失和依赖失败时的行为。",safety_refusal_fidelity:"检查已有授权、拒答和敏感信息边界是否保持。"},validation:{caseCount:"请保留 1–{{count}} 个用例。",dimensionRequired:"请至少选择一个评测维度。",userInputRequired:"请输入用例内容。",userInputBytes:"单个用例不能超过 32 KiB。",expectedOutcomeBytes:"期望结果不能超过 16 KiB。",criteriaCount:"单个用例最多包含 {{count}} 条要求。",criterionRequired:"要求不能为空。",criterionBytes:"单条要求不能超过 2 KiB。",datasetBytes:"全部评测用例不能超过 10 MiB。"},dataset:{invalidLockResponse:"服务未确认评测用例已保存,请重试。",loadingSettings:"正在读取评测设置…",loadSettingsFailed:"评测设置读取失败。",retryLoadSettings:"重新读取",missing:"未找到已保存的评测用例,请重新填写并保存。",saveWarning:"评测用例暂未保存,不影响迁移。",retrySave:"重新保存评测用例",saving:"正在保存…"},state:{disabled:"未开启评测",waiting_dataset:"等待填写评测用例",pending:"迁移完成后自动开始评测",preparing:"正在准备评测环境…",waiting_environment:"需要补充运行所需的环境变量",deploying:"正在部署临时 Runtime…",executing:"正在执行评测用例…",judging:"正在执行评测分析…",aggregating:"正在汇总评测结果…",completed:"评测已完成",failed:"评测未完成",blocked:"评测需要处理后才能继续",cancelled:"评测已取消"},progress:{label:"迁移与迁移效果评测进度",migration:"迁移",evaluation:"迁移效果评测",notStarted:"未开始",inProgress:"进行中",completed:"完成",waitingConfiguration:"等待配置",issue:"有问题"},environment:{description:"填写临时 Runtime 所需的环境变量。",security:"仅用于本次评测。",optional:"可选",submit:"提交并继续评测",submitting:"正在提交…"},execution:{preparing:"准备评测",preparingDetail:"校验迁移产物和 {{count}} 个评测用例",deploying:"启动 Runtime",deployingDetail:"准备 {{runtime}}",runtimeFallback:"隔离运行环境",executing:"执行用例",executingDetail:"执行 {{count}} 个用例并记录输出",judging:"执行评测分析",judgingDetail:"评测 {{cases}} 个用例 · {{dimensions}} 个维度",aggregating:"生成评测报告",aggregatingDetail:"汇总评分与证据,生成 HTML 报告",waiting:"等待中",running:"执行中",failed:"失败",complete:"已完成"},result:{title:"执行进度",attempt:"第 {{attempt}} 次评测",pending:"等待迁移完成",retry:"重新评测",retrying:"正在重试…",failureStage:"失败阶段",errorCode:"错误码",taskId:"任务 ID",diagnosticAttempt:"评测轮次",runtime:"Runtime",errorDetails:"错误详情",diagnosticField:"{{label}}:{{value}}",diagnosticHeading:"{{label}}:",loadingReport:"正在读取评测报告…",reportTitle:"HTML 评测报告",reportHtmlDescription:"查看或下载 HTML 报告。",viewReport:"查看报告",reportDrawerDescription:"评分、差异与证据",closeReport:"关闭",closeReportAria:"关闭评测报告",reportPreviewTitle:"迁移效果评测报告预览",reportSummary:"评测摘要",reportVersion:"评测集 {{version}} · Prompt v{{prompt}}",downloadReport:"下载完整报告",downloadingReport:"正在下载…",overallScore:"综合一致性",scoreScale:"0–100;证据不足时显示 N/A",evidenceCoverage:"证据覆盖率",coverageDetail:"{{scored}} / {{total}} 个维度有证据",executionSuccess:"执行成功率",executionDetail:"{{succeeded}} / {{total}} 个用例完成",naCount:"N/A 数量",naDescription:"证据不足,不计入分数",gapDescription:"迁移差距说明",lowestScoringCases:"低分用例",executionFailures:"执行异常",criticalEvidence:"Critical 证据",limitations:"评测限制",viewEvidence:"查看 {{count}} 个用例的结果与证据",outputTruncated:"输出过长,已截断",executionState:{succeeded:"执行完成",failed:"执行异常"},severityLabel:"严重度:{{severity}}",severity:{none:"无",low:"低",medium:"中",high:"高",critical:"Critical",unknown:"未知"},evidenceSource:{user_reference:"期望结果",user_criteria:"填写的要求",source_contract:"源项目约束",observed_output:"实际输出",runtime_observation:"Runtime 原始数据",deterministic_assertion:"确定性断言"},listSeparator:"、"}},Gxe={closeAria:"关闭错误提示",loadFailed:"无法读取迁移数据,请重试。",refreshFailed:"无法刷新迁移状态,请重试。"},Xxe={title:"终止当前迁移?",description:"终止后,当前分析或迁移进程将停止,已执行的步骤不会继续。"},$Ve={common:kxe,optimization:Sxe,projects:Exe,framework:Cxe,state:Axe,historyStatus:Txe,task:_xe,verification:jxe,transfer:Nxe,validation:Rxe,duration:Ixe,expiry:Pxe,analysis:Dxe,activity:Mxe,artifact:Lxe,model:$xe,upload:Fxe,deployment:Bxe,workspace:Uxe,actions:Qxe,capability:zxe,conversation:Vxe,questions:Hxe,pendingInput:qxe,confirmation:Wxe,evaluation:Kxe,errors:Gxe,stopDialog:Xxe},FVe=Object.freeze(Object.defineProperty({__proto__:null,actions:Qxe,activity:Mxe,analysis:Dxe,artifact:Lxe,capability:zxe,common:kxe,confirmation:Wxe,conversation:Vxe,default:$Ve,deployment:Bxe,duration:Ixe,errors:Gxe,evaluation:Kxe,expiry:Pxe,framework:Cxe,historyStatus:Txe,model:$xe,optimization:Sxe,pendingInput:qxe,projects:Exe,questions:Hxe,state:Axe,stopDialog:Xxe,task:_xe,transfer:Nxe,upload:Fxe,validation:Rxe,verification:jxe,workspace:Uxe},Symbol.toStringTag,{value:"Module"})),Yxe={loading:"加载中…",searchLabel:"搜索{{label}}",searchPlaceholder:"搜索{{label}}",retry:"重试",noMatches:"没有匹配项",noOptions:"暂无可选项",selection:"{{label}}:{{value}}"},Zxe={badge:"焕然一新",view:"查看新特性",title:"本次更新",defaultNotes:{multiRegion:"多地域智能体:并行加载北京与上海 Runtime,列表下滑即可继续加载。",switchAgent:"会话内切换:在输入框旁选择智能体,并直接开启一段新会话。",visualCanvas:"可视化执行画布:通过横向画布查看多智能体结构,并支持全屏浏览。"}},Jxe={label:"新会话模式",agent:"智能体",skill:"技能定制",video:"视频创作"},ewe={select:"选择新会话模式",agent:{label:"Agent",description:"与当前选择的 Agent 对话"},builtin:{label:"内置智能体",description:"使用平台提供的智能体"},codex:{label:"Codex 智能体",description:"在沙箱中执行任务"},deepseekHarness:{label:"DeepSeek Harness",description:"打开 DeepSeek Harness 工作区"},arkClaw:"ArkClaw",hermes:"Hermes 智能体",checking:"正在检查配置",notConfigured:"管理员未配置",unavailable:"暂不可用"},twe={select:"选择智能体",typesLabel:"智能体类型",listLabel:"{{type}}列表",types:{agent:"智能体",general:"通用智能体",mpa:"MPA 智能体",codex:"Codex 智能体",deepseekHarness:"DeepSeek Harness",openclaw:"OpenClaw 智能体",hermes:"Hermes 智能体"},loading:"正在加载智能体",reload:"重新加载",empty:"暂无{{type}}",emptyLocal:"暂无本地智能体",emptyGeneral:"暂无通用智能体",createHint:"请前往智能体页创建",localHint:"请检查当前 Studio 启动目录",waking:"正在唤醒",opening:"正在打开",connecting:"正在连接",loadingMore:"加载中",loadMore:"加载更多",runtimeTimeout:"加载智能体超时(15 秒),请检查网络或 Runtime 服务后重试",loadGeneral:"加载通用智能体",loadType:"加载 {{type}}",connectGeneral:"连接通用智能体",openLocal:"打开本地智能体",openType:"打开 {{type}}",wakingHint:"正在唤醒智能体,可能需要一些时间。"},nwe={spaceAria:"技能空间",configuration:"技能定制配置",actions:{create:"技能生成",optimize:"技能优化"},selectAction:"选择技能定制方式",actionList:"技能定制方式",style:"风格",selectStyle:"选择风格",model:"模型",selectModel:"选择模型",styles:{concise:"简洁实用",strict:"严谨稳健",tutorial:"教程友好",automation:"自动化优先"},modelLoadFailed:"模型配置加载失败",spaceLoadFailed:"Skill Space 加载失败",skillLoadFailed:"Skill 加载失败",unnamedSpace:"未命名 Skill Space",space:"技能空间",select:"选择 Skill",selectAria:"选择 Skill:{{skill}}",loadingSpaces:"正在加载 Skill Space",reload:"重新加载",emptySpaces:"暂无 Skill Space",skillList:"{{space}} Skill 列表",loadingSkills:"正在加载 Skill",emptySkills:"暂无 Skill"},iwe={modes:{auto:"自动识别",text_to_video:"文生视频",reference_to_video:"参考素材生视频",video_editing:"视频编辑",video_extension:"视频续写",first_last_frame:"首尾帧生成"},taskNames:{auto:"视频生成",text_to_video:"文生视频",reference_to_video:"参考素材生视频",video_editing:"视频编辑",video_extension:"视频续写",first_last_frame:"首尾帧生成"},controls:{label:"视频创作配置",aspectRatio:"比例",selectAspectRatio:"选择比例",resolution:"清晰度",selectResolution:"选择清晰度",duration:"时长",durationShort:"{{count}} 秒",durationAria:"视频时长:{{count}} 秒",lastFrame:"尾帧",lastFrameHelper:"添加视频结束画面",assistImage:"辅助图片",referenceImage:"参考图片",assistImageHelper:"用于补充画面参考",imageHelper:"支持常见图片格式",referenceVideo:"参考视频",videoHelper:"支持常见视频格式",optional:"可选",replace:"更换",add:"添加",upload:"上传{{label}}",replaceFile:"更换{{label}}:{{name}}",removeFile:"移除{{label}} {{name}}",storageUnavailable:"管理员未配置持久化存储",loadingEnhancer:"正在加载增强模型",enhancerHint:"使用 {{model}} 模型进行意图识别和提示词增强",enhancerUnavailable:"增强模型不可用"},task:{title:"视频生成任务",closeAria:"关闭视频生成任务弹窗",progressAria:"视频生成进度",optimizedPrompt:"优化后的提示词",processingAria:"{{task}}处理进度",waitingAria:"{{status}},已等待{{elapsed}}",elapsed:"已等待 {{elapsed}}",previewAria:"生成结果预览",close:"关闭",download:"下载视频",retryOptimization:"重试提示词优化",retryGeneration:"重试视频生成",providerQueued:"等待模型调度",providerRunning:"模型生成中",providerSubmitting:"正在提交任务",queuedHint:"任务已提交,模型开始处理后状态会自动更新",runningHint:"这可能持续数分钟,完成后将在这里显示视频预览",backgroundHint:"可以关闭弹窗,任务会继续在后台运行",successHint:"视频已生成,可预览或下载",activationHint:"请先在模型控制台开通服务,再重试生成",retryHint:"修正问题后可重试当前步骤",steps:{optimizationFailed:"提示词优化失败",optimizationDone:"提示词优化完成",optimizationActive:"提示词优化中",generationDone:"{{task}}已完成",generationFailed:"{{task}}失败",generationQueued:"{{task}}排队中",generationRunning:"{{task}}生成中",generationActive:"{{task}}进行中",generationPending:"等待视频生成",generationComplete:"视频生成完成"},elapsedHours:"{{hours}}小时{{minutes}}分",elapsedMinutes:"{{minutes}}分{{seconds}}秒",elapsedSeconds:"{{seconds}}秒"}},rwe={compactSelect:Yxe,featureNotice:Zxe,workspace:Jxe,mode:ewe,agentPicker:twe,skill:nwe,video:iwe},BVe=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:twe,compactSelect:Yxe,default:rwe,featureNotice:Zxe,mode:ewe,skill:nwe,video:iwe,workspace:Jxe},Symbol.toStringTag,{value:"Module"})),swe="审核中心",awe="审核资源类型",owe="仅管理员可以访问审核中心",lwe="搜索申请名称、提交人或版本",cwe="审核状态",uwe="{{count}} 条待审核",dwe="共 {{count}} 条申请",fwe={skill:"技能",agent:"智能体"},hwe={all:"全部状态",pending:"待审核",approved:"已通过",returned:"已退回",approving:"发布中"},pwe={application:"申请名称",submitter:"提交人",version:"版本",submittedAt:"提交时间",status:"状态",actions:"操作"},mwe={details:"详情",detailsFor:"查看 {{name}} 的申请详情",approve:"通过",approveFor:"通过 {{name}} 的申请",return:"退回",returnFor:"退回 {{name}} 的申请",close:"关闭",backToDetails:"返回详情",confirmApprove:"确认通过",confirmReturn:"确认退回",clearFilters:"清除筛选",refresh:"刷新",cancel:"取消",resumeApproval:"继续发布"},gwe={title:"暂无审核申请",description:"提交的审核申请会显示在这里",filteredTitle:"没有匹配的申请",filteredDescription:"试试其他关键词,或调整审核状态"},bwe={title:"申请详情",sections:"申请详情内容",overview:"申请信息",files:"提交文件 · {{count}}",requestType:"申请类型",update:"版本更新",firstRelease:"首次发布",source:"来源",source_skill:"{{name}}的个人技能空间",source_agent:"{{name}}的开发环境",destination:"发布目标",destination_skill:"企业共享技能空间",destination_agent:"全员共享智能体",region:"区域",visibility:"发布后可见范围",shared:"全员可见",description:"功能说明",changes:"本次提交说明",example:"使用示例",history:"审核记录",submitted:"{{name}}提交申请",versionFixed:"仅审核本次提交的版本",instructions:"使用说明",filesTab:"提交文件",filesFailed:"加载提交文件失败",unknownAuthor:"未知申请人",reviewer:"审批人",reviewedAt:"审批时间",approved:"{{name}}通过申请",returned:"{{name}}退回申请",unknownReviewer:"未知审批人",approvedBy:"通过人",returnedBy:"退回人",comment:"审批评论",result:"审批结果",noHistory:"此技能尚未提交审核",pendingHint:"等待管理员审核",approvingHint:"管理员已确认通过,正在发布到企业共享空间",approving:"{{name}}确认通过,等待完成发布"},ywe={failed:"待审核空间暂不可用",retry:"重试"},vwe={approveTitle:"通过申请",returnTitle:"退回申请",approveDescription:"通过后,{{name}} 的 {{version}} 版本将在企业共享空间中向全员公开",returnDescription:"退回 {{name}} 的 {{version}} 版本,并向申请人说明原因",reason:"退回理由",reasonRequired:"请填写退回理由",reasonHelp:"最多 256 个字符,申请人可以看到此理由",saving:"处理中…",failed:"审批失败,请重试",approved:"{{name}} 已通过并公开",returned:"{{name}} 已退回",comment:"评论(可选)",commentHelp:"最多 256 个字符,申请人可以看到此评论"},xwe={title:"AI 评分",points:"{{score}} 分",insufficient:"依据不足",status:{unscored:"尚未评分",not_requested:"尚未评分",queued:"等待评分",running:"评分中",completed:"已评分",failed:"评分失败"},loading:"加载评分…",starting:"正在提交评分…",loadFailed:"加载评分失败",retryFailed:"提交评分失败",failed:"评分未完成,请管理员重试",retry:"重新评分",start:"开始评分",reload:"重新加载",download:"下载 JSON",expand:"展开",collapse:"收起",hint:"评分针对本次提交版本,供人工审批参考",dimensions:{safety:"安全性",usability:"易用性",completeness:"完整性",reliability:"可靠性",maintainability:"可维护性"},risks:"风险提示",suggestions:"改进建议",model:"评分模型",rubric:"评分标准版本",time:"评分时间",severity:{low:"低风险",medium:"中风险",high:"高风险",critical:"严重风险"},coverage:"评审范围",coverageCount:"已评审 {{included}} / {{total}} 个文件",coverageIncomplete:"部分内容未纳入评审,评分依据不完整",omittedFile:"未评审 {{path}}:{{reason}}",truncatedFile:"仅评审部分内容 {{path}}:{{reason}}",originalError:"云端原始错误"},UVe={title:swe,category:awe,adminOnly:owe,search:lwe,filterStatus:cwe,pendingCount:uwe,total:dwe,kind:fwe,status:hwe,columns:pwe,actions:mwe,empty:gwe,detail:bwe,space:ywe,decision:vwe,score:xwe},QVe=Object.freeze(Object.defineProperty({__proto__:null,actions:mwe,adminOnly:owe,category:awe,columns:pwe,decision:vwe,default:UVe,detail:bwe,empty:gwe,filterStatus:cwe,kind:fwe,pendingCount:uwe,score:xwe,search:lwe,space:ywe,status:hwe,title:swe,total:dwe},Symbol.toStringTag,{value:"Module"})),wwe={cancel:"取消",close:"关闭",retry:"重试",tryAgain:"重新尝试",closeDialog:"关闭{{title}}",agentFallback:"{{agent}} 智能体",unknownSource:"未知来源"},Owe={terminalTitle:"终端",browserTitle:"沙箱浏览器",terminalSubtitle:"连接当前 AgentKit Session 的交互式终端",browserSubtitle:"在当前 AgentKit Session 中查看与操作浏览器",connecting:"正在连接…",connected:"已连接",notConnected:"尚未连接",opening:"正在打开 {{title}}",connectingSession:"工具正在连接当前 AgentKit Session。",openFailed:"{{title}} 打开失败"},kwe={title:"恢复 Codex 对话",subtitle:"选择当前 Sandbox Session 中最近更新的 Thread",loading:"正在读取历史对话",loadFailed:"历史对话读取失败",empty:"暂无可恢复的对话"},Swe={title:"Codex 权限",subtitle:"设置会保存到当前 Sandbox Session,并同步到其中的所有 Thread",sandboxMode:"沙箱模式",approvalPolicy:"审批策略",approvalMethod:"审批方式",networkAccess:"允许网络访问",networkAccessHelp:"控制 workspace-write 与只读模式中的外部网络访问。",fullAccessWarning:"完全访问会关闭文件系统与网络隔离,请只在可信任务中使用。",save:"保存权限",sandboxChoices:{readOnly:{label:"只读",detail:"允许读取文件,不允许写入工作空间。"},workspaceWrite:{label:"工作区写入",detail:"允许在当前工作空间内读取与修改文件。"},fullAccess:{label:"完全访问",detail:"不启用沙箱隔离,适合明确可信的任务。"}},approvalChoices:{untrusted:{label:"仅不可信命令",detail:"只对 Codex 判断为不可信的操作发起审批。"},onRequest:{label:"按需审批",detail:"Codex 可在必要时请求你确认命令或文件修改。"},never:{label:"不审批",detail:"Codex 不会暂停并请求人工批准。"}},reviewerChoices:{user:{label:"由我审批",detail:"审批请求会显示在 Studio 中,由你决定。"},autoReview:{label:"自动审查",detail:"使用 Codex 自动审查流程处理审批请求。"}}},Ewe={title:"工作空间",subtitle:"选择当前 Codex Thread 执行命令与修改文件的目录",absolutePath:"绝对路径",browse:"浏览",parent:"上一级",empty:"当前目录没有子目录",locked:"当前对话已经开始,工作空间已锁定。新建 Sandbox 会话后可重新选择。",useDirectory:"使用此目录"},Cwe={fileTitle:"允许修改文件?",commandTitle:"允许执行命令?",subtitle:"Codex 正在等待你的决定",workingDirectory:"执行目录",decline:"拒绝",acceptOnce:"仅本次允许",acceptSession:"本会话允许"},Awe={availableSkills:"可用 Skills",selectModel:"选择模型",commands:"Codex 快捷命令",currentModel:"当前:{{model}}",loadingSkills:"正在发现当前工作区的 Skills…",loadingModels:"正在读取模型…",noSkillMatches:"当前工作区没有匹配的 Skill",noModelMatches:"没有匹配模型,也可以直接输入模型 ID",noCommandMatches:"没有匹配的快捷命令",skillFallback:"加载并执行该 Skill",add:"添加",uploadImage:"上传图片",uploadDocument:"上传文档或 PDF",uploadVideo:"上传视频",openTerminal:"进入终端",viewBrowser:"查看浏览器",permissions:"Codex 权限",workspaceLocked:"对话已开始,工作空间已锁定",selectWorkspace:"选择工作空间",workspace:"Codex 工作空间",endpointCopied:"Endpoint 已复制",copyEndpoint:"复制 Sandbox Endpoint",continuePlaceholder:"继续说明你想实现或调整的内容",messagePlaceholder:"向 AgentKit 沙箱发送消息,输入 / 查看命令,输入 $ 调用 Skill…",stop:"停止生成",send:"发送",stopping:"正在确认停止…",resume:"恢复任务",steer:"追加要求",steerPlaceholder:"可继续追加要求,或随时停止任务…"},Twe={defaultName:"我的智能体",namedDefault:"我的 {{agent}}",creatingTitle:"正在创建 {{agent}} 智能体",failedTitle:"启动失败",createTitle:"创建 {{agent}} 智能体",fallbackError:"AgentKit 沙箱初始化失败,请稍后重新尝试。",creatingDescription:"正在创建并等待 {{agent}} 智能体就绪,这通常需要半分钟",name:"智能体名称",storageSize:"存储大小",storageHelp:"数据将持久化保存,可设置 {{min}}–{{max}} GiB。",persistent:"持久化",persistenceUnsupported:"当前环境不支持快照持久化",persistentHelp:"保留智能体数据,后续可继续使用。",temporaryHelp:"智能体将在 8 小时后清空",cancelCreation:"取消创建",confirm:"确认创建",retry:"重新尝试"},_we={activeAria:"Codex 智能体会话已开启",openAria:"开启 Codex 智能体会话",active:"Codex 智能体会话中",entry:"灵光一现",exit:"退出当前智能体",expired:"已到期",remainingHours:"剩余 {{hours}} 小时 {{minutes}} 分钟",remainingMinutes:"剩余 {{minutes}} 分钟",expiryWarning:"远端开发环境最长保留 8 小时,将于 {{expiry}} 到期({{remaining}});到期后清除对话和文件。",usingAgent:"当前您在使用 {{agent}} 智能体",activityAria:"Sandbox 操作记录",activity:"操作记录",tokenUsageAria:"Codex Token 用量",tokens:"{{label}}:{{value}} tokens",tokenLabels:{total:"总计",input:"输入",cachedInput:"缓存输入",output:"输出",reasoningOutput:"推理输出"}},jwe={back:"返回智能体列表",subtitle:"{{agent}} 智能体详情",type:"智能体类型",status:"状态",createdBy:"创建人",snapshotStatus:"快照状态",toolType:"工具类型",createdAt:"创建时间",snapshotReason:"快照原因",expiresAt:"过期时间",snapshotId:"快照 ID",sessionId:"会话 ID",sourceSessionId:"来源 Session ID",delete:"删除智能体",waking:"唤醒中…",opening:"打开中…",wake:"唤醒智能体",open:"打开智能体",deleteTitle:"删除智能体?",deleteDescription:"将删除“{{name}}”及其保存的数据,此操作无法撤销。",deleting:"删除中…",confirmDelete:"确认删除",sleepingHint:"该智能体已休眠,进入时需要唤醒,可能需要一些时间。",wakingHint:"正在唤醒智能体,可能需要一些时间。",agentId:"智能体 ID"},Nwe={back:"返回智能体列表",createdBy:"创建人 {{creator}}",ariaLabel:"智能体工作区",main:"主界面",terminal:"终端",mainTitle:"{{agent}} 主界面",openingTerminal:"正在打开终端…",terminalTitle:"{{agent}} 终端"},Rwe={prompt:`使用 AgentKit Studio Plugin 端云接力当前会话、项目和任务。请直接执行,不要让我手动打开终端。 Studio:{{studioUrl}} 配对码:{{pairingCode}}`,installPrompt:`请安装 AgentKit Studio Plugin。请直接执行以下安装命令,不要让我手动打开终端。 -安装命令:{{command}}`,title:"接力到云端继续执行",description:"按顺序复制两段提示词,Codex 会通过插件将您的本地任务接力到云端",closeAria:"关闭本地迁移引导",installTitle:"安装插件",installDescription:"首次使用时,请选择一种安装方式。",copied:"已复制",copyInstallPrompt:"复制安装提示词",copyInstallCommand:"复制安装命令",installMethodAria:"插件安装方式",conversationInstall:"与 Codex 对话安装",terminalInstall:"从终端安装",taskTitle:"任务接力",taskDescription:"插件安装完成后复制,Codex 会迁移当前项目并继续执行任务。",copyHandoffPrompt:"复制接力提示词",generatingPairing:"正在生成新的配对码",pairingExpired:"配对码已过期",pairingRemaining:"配对码有效期剩余 {{countdown}}",refreshing:"刷新中",refreshPairing:"刷新配对码",pairingLoading:"正在生成配对码",pairingUnavailable:"配对码尚未生成。",statusAria:"端云接力状态",statusTitle:"接力状态",requestReceivedNamed:"已收到“{{name}}”的端云接力请求",requestReceivedCurrent:"已收到当前项目的端云接力请求",requestHelp:"复制接力提示词后,Codex 的请求会显示在这里。",entering:"正在进入",enterCodex:"进入 Codex",clipboardUnsupported:"当前浏览器不支持写入剪贴板。",steps:{request:"等待端侧请求",session:"创建云端 Session",restore:"恢复项目",continue:"发送续跑任务"},status:{issued:"等待请求",creating:"正在创建 Session",sessionCreated:"正在迁移项目",continuing:"正在启动云端任务",running:"云端执行中",completed:"接力完成",failed:"接力失败"}},Rwe={model:{description:"显示或切换当前对话模型",keywords:"模型 switch"},models:{description:"列出 app-server 可用模型",keywords:"模型列表 list"},skill:{description:"浏览并调用当前工作区可用的 Skill",keywords:"技能 workflow"},skills:{description:"浏览并调用当前工作区可用的 Skills",keywords:"技能列表 workflow list"},new:{description:"开始一个新对话",keywords:"新建 对话"},resume:{description:"打开历史会话或恢复指定 Thread",keywords:"历史 恢复 session"},fork:{description:"从当前上下文分叉一个新对话",keywords:"分叉 branch"},compact:{description:"压缩当前对话上下文",keywords:"压缩 上下文"},archive:{description:"归档当前对话并新建对话",keywords:"归档 关闭"},status:{description:"显示当前连接、Thread、模型与 Token 状态",keywords:"状态 连接 token"},clear:{description:"清空当前视图并开始新对话",keywords:"清空 重置"},help:{description:"显示 Sandbox 支持的快捷命令",keywords:"帮助 命令"},currentModel:"当前模型",availableModel:"可用模型",workspace:"工作空间",notSet:"未设置",modelLabel:"模型",statusLabel:"状态",running:"运行中",idle:"空闲",totalTokens:"累计 Token",contextWindow:"上下文窗口",imageFallback:"图片",unknown:"未知快捷命令:{{command}}。输入 /help 查看可用命令。",automaticSkills:"智能开发模式会自动使用开发能力,无需手动选择 Skill。",activity:{new:"已新建 Codex 对话",resumed:"已恢复 Codex 对话",deleted:"已删除 Codex 历史会话",modelChanged:"已切换 Codex 模型",availableModels:"Codex 可用模型",noModels:"当前没有可用模型",forked:"已分叉 Codex 对话",compacting:"已开始压缩当前 Codex 对话",archived:"已归档 Codex 对话",status:"Codex 当前状态",help:"Sandbox 支持的 Codex 快捷命令"}},Iwe={label:"智能构建任务",queued:"构建任务已排队",running:"构建任务正在后台运行",recovering:"正在恢复构建任务",waiting_user:"构建任务需要继续处理",stopping:"正在停止构建任务",succeeded:"构建任务已完成",cancelled:"构建任务已停止",failed:"构建任务未完成",open:"返回任务",hide:"隐藏任务通知",reconnecting:"正在重新连接任务服务,已有任务继续保留。"},Pwe={common:xwe,tool:wwe,threads:Owe,permissions:kwe,workspace:Swe,approval:Ewe,composer:Cwe,launch:Awe,session:Twe,agentDetails:_we,agentWorkspace:jwe,handoff:Nwe,commands:Rwe,taskNotice:Iwe},UVe=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:_we,agentWorkspace:jwe,approval:Ewe,commands:Rwe,common:xwe,composer:Cwe,default:Pwe,handoff:Nwe,launch:Awe,permissions:kwe,session:Twe,taskNotice:Iwe,threads:Owe,tool:wwe,workspace:Swe},Symbol.toStringTag,{value:"Module"})),Dwe={retry:"重试",signInToContinue:"登录以继续使用",signInWith:"使用 {{provider}} 登录",enterUsername:"输入一个用户名即可开始",usernamePlaceholder:"用户名(字母 + 数字,最多 16 位)",enter:"进入",usernameInvalid:"只能包含大小写字母和数字,最多 16 位。",identityProvider:{volcengine:"火山引擎 Identity",byteplus:"BytePlus Identity"},powered:{volcengine:"火山引擎 AgentKit 提供企业级 Agent 解决方案",byteplus:"BytePlus AgentKit 提供企业级 Agent 解决方案"},legalPrefix:"继续即表示你已阅读并同意 AgentKit",terms:"产品和服务条款",copyright:"© {{year}} VeADK。保留所有权利。"},Mwe={title:"登录状态已过期",description:"当前编辑内容会保留。重新登录后,刚才的操作将自动继续。",waiting:"等待登录完成…",signInAgain:"重新登录"},Lwe={breadcrumbs:"面包屑",selectAgent:"选择 Agent",switchAgent:"切换智能体"},$we={cancel:"取消",close:"关闭确认框"},QVe={login:Dwe,authExpired:Mwe,navbar:Lwe,confirm:$we},zVe=Object.freeze(Object.defineProperty({__proto__:null,authExpired:Mwe,confirm:$we,default:QVe,login:Dwe,navbar:Lwe},Symbol.toStringTag,{value:"Module"})),Fwe={defaultUser:"用户",shortcuts:"快捷入口",tryCli:"体验 AgentKit CLI",developerResources:"开发者资源",systemInfo:"系统信息",language:"语言",issueFeedback:"问题反馈",logout:"退出登录",roles:{admin:"管理员",developer:"开发者",user:"普通用户",super_admin:"超级管理员"}},Bwe={home:"返回首页",expand:"展开侧边栏",collapse:"收起侧边栏",label:"主导航",newChat:"新会话",agents:"智能体",workspaces:"工作区",library:"资源库",cronjobs:"定时任务",automations:"自动化",users:"用户管理",administration:"管控",reviewCenter:"审核中心"},Uwe={title:"历史会话",newConversation:"新会话",create:"新建会话",loading:"正在加载历史会话…",empty:"暂无会话",current:"当前",manage:"管理历史会话:{{title}}",more:"更多",delete:"删除",loadingMore:"加载中…",loadMore:"加载更多",evaluatingTitle:"正在自动评测",evaluating:"评测中",generating:"正在生成"},VVe={account:Fwe,navigation:Bwe,history:Uwe},HVe=Object.freeze(Object.defineProperty({__proto__:null,account:Fwe,default:VVe,history:Uwe,navigation:Bwe},Symbol.toStringTag,{value:"Module"})),Qwe={placeholder:"请选择",collapseOptions:"收起模型选项",expandOptions:"展开模型选项",noOptions:"暂无可用选项",noMatches:"没有匹配项,可直接使用当前模型 ID"},zwe={unsupportedActivity:"不支持的 Skill 对话活动",ariaLabel:"Skill 生成对话"},Vwe={code:"错误码:{{code}}",type:"错误类型:{{type}}",representation:"异常表示:{{value}}",rawResponse:`服务端原始响应: -{{value}}`,original:"原始错误:{{message}}",details:"详细信息"},Hwe={ariaLabel:"Skill 文件树",viewSource:"查看源码",viewPreview:"查看预览",download:"下载",binaryFile:"二进制文件",bytes:"{{value}} 字节",binaryDescription:"当前接口仅返回文件元数据,可单独下载原文件。",metadata:"Skill 元数据",noFiles:"暂无文件"},qwe={close:"关闭",name:"名称",region:"地域",optionalDescription:"描述(可选)",cancel:"取消",create:"创建",creating:"创建中…",save:"保存",saving:"保存中…",upload:"上传",uploading:"上传中…",createSpaceTitle:"新建 Skill 空间",editSpaceTitle:"编辑 Skill 空间",uploadTitle:"上传到 {{name}}",createSpaceFailed:"创建 Skill 空间失败",updateSpaceFailed:"更新 Skill 空间失败",archiveValidationFailed:"Skill ZIP 格式校验失败",uploadFailed:"上传 Skill 失败",dropzone:"拖拽 Skill ZIP 到这里",chooseLocalFile:"或点击选择本地文件",archiveHelp:"ZIP 根目录需要包含 SKILL.md,也可以只包含一层包装目录。选择后仅检查格式,不会自动上传。",validating:"正在检查文件格式…",validationPassed:"格式检查通过:{{name}},共 {{count}} 个文件"},Wwe={styles:{concise:"简洁实用",strict:"严谨稳健",tutorial:"教程友好",automation:"自动化优先",custom:"自定义",customFallback:"自定义风格"},stages:{preparing:"正在准备 Dev Sandbox",ready:"Skill 已生成并通过格式校验",failed:"生成失败",cancelled:"已停止",validating:"正在校验 Skill 格式",packaging:"正在整理文件",generating:"正在生成 Skill",repairingAgain:"正在再次修复",autoRepairing:"正在自动修复({{attempt}}/{{max}})"},validation:{fallback:"Skill 格式校验未通过",repairInstruction:"只修复下面列出的 Skill 格式错误,不要改变原有用途和内容范围。",recheckInstruction:"修复后重新检查目录结构、SKILL.md frontmatter 和所有文本文件。",nameTooLong:"Skill 名称不能超过 64 个字符",invalidName:"Skill 名称只能包含小写字母、数字和连字符",modelTooLong:"模型 ID 不能超过 128 个字符",invalidModel:"模型 ID 只能包含字母、数字、点、下划线、连字符、斜杠和冒号"},errors:{loadCapability:"读取 Dev Sandbox 配置失败",autoRepair:"自动修复格式错误失败",pollCandidate:"读取候选方案状态失败,正在重试",createCandidate:"创建候选方案失败",refine:"继续调整失败",repairAgain:"再次修复格式错误失败",selectSpace:"请选择上传的 Skill Space",unsupportedRegion:"当前 Skill 地域不受支持",upload:"上传 Skill 失败",download:"下载失败"},sessionMax:"Session 最长保留 1 小时",remaining:"剩余 {{minutes}}:{{seconds}}",unnamedSpace:"未命名 Skill Space",leaveConfirmation:"离开后将停止并释放正在运行的 Dev Sandbox,确定离开吗?",createTitle:"创建技能",optimizeTitle:"优化 {{name}}",skillFallback:"技能",back:"返回技能空间",home:"主页技能生成",basicInfo:"基本信息",goal:"目标",createIntentPlaceholder:"描述希望这个 Skill 完成什么任务",optimizeIntentPlaceholder:"描述希望如何优化当前 Skill",skillName:"Skill 名称",autoNamePlaceholder:"留空时自动生成",nameHelp:"仅支持小写字母、数字和连字符;留空时自动生成。",createPlans:"生成方案",optimizePlans:"优化方案",createPlansDescription:"按不同方案并行生成多个技能,您可以选择最佳结果",optimizePlansDescription:"按不同方案并行优化当前技能,您可以选择最佳结果",plan:"方案 {{count}}",remove:"移除",model:"模型",modelPlaceholder:"选择或输入模型 ID",style:"风格",customStyle:"自定义风格",customStylePlaceholder:"描述表达方式、严谨程度或输出偏好",addConfiguration:"添加配置",notConfigured:"管理员未配置",generate:"生成",candidates:"候选方案",progress:"进度",retryCandidate:"重试此方案",formatValidationFailed:"格式校验未通过",repairAgain:"再次修复",files:"文件",downloadZip:"下载 ZIP",loadingFiles:"正在读取文件…",filesPending:"生成过程中会在这里显示完整文件树",uploadToSpace:"上传到 Skill Space",loadingSpaces:"正在加载 Skill Space",selectSpace:"选择 Skill Space",continuePlaceholder:"继续调整这个候选方案",continue:"继续调整",uploading:"上传中…",overwrite:"覆盖原 Skill",uploadToSelectedSpace:"上传到 Skill Space",uploadToCurrentSpace:"上传到当前空间",allCandidatesFailed:"所有方案均创建失败,可分别重试。"},Kwe={invalidFormat:"{{label}}格式错误。",recoveryStatus:"Skill 恢复点状态",errorResponse:"错误响应",errorDetails:"错误详情",missingContentType:"Content-Type 缺失",gatewayError:"{{fallback}}(HTTP {{status}},Content-Type: {{contentType}})。请检查代理或网关配置。",nonJson:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}},Content-Type: {{contentType}}),请检查代理或网关配置。",activity:"Skill 会话活动",invalidActivity:"Skill 会话活动格式错误。",invalidToolActivity:"Skill 工具活动格式错误。",invalidTextActivity:"Skill 文本活动格式错误。",publication:"Skill 发布结果",task:"Skill 会话",file:"Skill 文件",unknownTaskState:"Skill 会话状态无法识别。",capability:"Skill 工作台能力",loadCapability:"读取 Skill 工作台能力失败",prepareTask:"准备 Skill 会话失败",taskReference:"Skill 会话引用",startOptimization:"开始优化 Skill 失败",startTask:"开始 Skill 会话失败",taskSummary:"Skill 会话摘要",taskList:"Skill 会话列表",loadTaskList:"读取 Skill 会话列表失败",invalidTaskList:"Skill 会话列表格式错误。",loadTask:"读取 Skill 会话失败",artifact:"Skill 产物",artifactFile:"Skill 产物文件",loadArtifact:"读取 Skill 产物失败",refine:"继续调整 Skill 失败",stop:"停止当前 Skill 任务失败",publish:"发布 Skill 失败",nonNdjson:"发布 Skill 失败:服务端返回了非 NDJSON 响应。",missingStream:"发布 Skill 失败:服务端没有返回进度流。",publishProgress:"发布进度",invalidPublishProgress:"发布进度格式错误。",publishError:"发布错误",unknownPublishEvent:"未知的发布进度事件。",publishResult:"发布结果",streamEnded:"发布进度流提前结束,无法确认发布结果。请刷新技能中心确认状态。",deleteTask:"删除 Skill 会话失败",download:"下载 Skill 失败"},Gwe={configSelect:Qwe,conversation:zwe,errorDetails:Vwe,fileTree:Hwe,management:qwe,generation:Wwe,api:Kwe},qVe=Object.freeze(Object.defineProperty({__proto__:null,api:Kwe,configSelect:Qwe,conversation:zwe,default:Gwe,errorDetails:Vwe,fileTree:Hwe,generation:Wwe,management:qwe},Symbol.toStringTag,{value:"Module"})),Xwe={back:"返回上一页",reload:"重新加载",notConfigured:"未配置",name:"名称",description:"描述",delete:"删除",save:"保存",saving:"保存中",add:"添加",manage:"管理",environment:"环境",noDescription:"暂无描述",refresh:"刷新",close:"关闭",retry:"重试",loading:"加载中…",previousPage:"上一页",nextPage:"下一页",edit:"编辑",all:"全部",search:"搜索",cancel:"取消",view:"查看",viewDetails:"查看详情",deleting:"删除中…",create:"创建",creating:"创建中",adding:"添加中",generating:"生成中",uploading:"上传中",preview:"预览",loadFailed:"加载失败",select:"选择",collapse:"收起",expand:"展开",none:"无"},Ywe={ariaLabel:"AgentKit 快速入口",closeAriaLabel:"关闭 AgentKit 欢迎卡片",title:"欢迎使用 AgentKit",description:"通过 AgentKit 平台快速构建与托管您的企业级智能体",docsAriaLabel:"打开 AgentKit 文档,在新窗口打开",docs:"文档",consoleAriaLabel:"打开 AgentKit 控制台,在新窗口打开",console:"控制台"},Zwe={checkUpdates:"检查更新",checkingVersions:"正在检查版本…",versionCheckError:"查询沙箱版本失败,请检查凭据、区域及接口权限后重试",sandboxUpdateError:"Sandbox 更新失败,请刷新检查实际状态后重试",modelEnvRepairUnavailable:"无法补齐模型环境变量,请检查 CODEX_API_KEY 和 CODEX_BASE_URL",updateSandbox:"更新{{variant}}{{name}}",updatingSandbox:"更新中",title:"系统信息",description:"查看当前 Studio 版本及关联的基础资源",general:"通用",currentVersion:"当前版本",storage:"存储",loadingStorage:"正在加载存储信息",tosAddress:"TOS 地址",openTosConsole:"在云控制台中打开 TOS 存储桶",environmentBuild:"环境构建",loadingEnvironmentResources:"正在加载环境构建资源",environmentResourcesError:"环境构建资源加载失败,请检查云凭据后重试。",codePipelineWorkspace:"CodePipeline 工作空间",codePipelinePipeline:"CodePipeline 流水线",openCodePipelineWorkspace:"在云控制台中打开 CodePipeline Workspace",createdOnFirstBuild:"首次构建时自动创建",containerRegistryRepository:"Container Registry 仓库",openContainerRegistryRepository:"在云控制台中打开 Container Registry 仓库",sandboxInfo:"沙箱信息",loadingSandboxInfo:"正在加载沙箱信息",sandboxInfoError:"沙箱信息加载失败,请重试。",snapshot:"快照版",snapshotWithSpace:"快照版 ",openToolConsole:"在云控制台中打开{{name}}",updateModelEnv:"更新{{variant}}{{name}}模型环境变量",modelEnvUpdated:"已更新",modelEnvAlreadyCurrent:"无需更新",userPool:"用户池",loadingUserPool:"正在加载用户池",userPoolError:"用户池加载失败,请重试。",modelEnvUpdateError:"模型环境变量更新失败,请重试。",openUserPoolConsole:"在云控制台中打开用户池{{name}}",unnamedUserPool:"未命名用户池",id:"ID",domain:"域名",region:"区域",noLocalUserPool:"本地模式未配置用户池",noUserPool:"当前 Studio 未配置用户池"},Jwe={workspace:"Agent 工作区",library:"Agent 库",evaluation:"评测",agentList:"Agent 列表",agentDetails:"Agent 详情",newAgent:"新建 Agent",loading:"加载中…",loadingCloudAgents:"正在加载云端 Agent…",noAgentSelected:"请选择一个 Agent",local:"本地",remote:"云端",localAgent:"本地 Agent",remoteAgent:"云端 Agent",agentCount:"{{count}} 个 Agent",agentCountLabel:"Agent 数量",details:"详情",chat:"对话",update:"更新",backToAgentList:"返回 Agent 列表",loadingAgent:"正在加载 Agent",loadingAgentDescription:"正在读取 Agent 配置和 Runtime 信息。",loadingAgentInfo:"正在加载 Agent 信息…",detailLoadFailed:"无法加载 Agent 详情",detailLoadFailedDescription:"请检查 Runtime 状态后重试。",partialInfoUnavailable:"部分信息暂时不可用",upgradeRuntimeForDetails:"请升级 Runtime 以查看完整 Agent 信息。",basicInfo:"基本信息",usageOverview:"使用概览",sections:{basic:"基本信息",profileConfig:"Profile 配置",sessionConfig:"会话配置",usage:"使用概览",diagnostics:"诊断",evaluations:"评测",optimizations:"优化建议",integrations:"集成",versions:"版本",channels:"消息渠道"},evaluationGroup:"评测组",optimizations:"优化建议",optimizationsDescription:"根据评测结果查看可执行的优化建议。",integrations:"集成",githubVersions:"GitHub 版本",githubVersionsDescription:"查看持续交付产生的版本并创建回退 PR。",currentVersionOnly:"当前未启用 GitHub 持续交付,仅展示当前生产版本。",loadingVersions:"正在加载版本…",noVersion:"暂无版本记录",prLink:"Pull Request",viewPr:"查看 PR",author:"提交人",publishStatus:"发布状态",viewRelease:"查看发布记录",rollbackToVersion:"回退到此版本",rollingBack:"正在创建回退…",rollbackEvent:"回退事件",sourceMergedRuntimeStill:"最新源码已合并,但 Runtime 仍处于",currentProductionVersionHint:";当前生产版本保持不变。",usageSummary:"使用统计",totalCalls:"总调用次数",userCount:"用户数",userDetails:"用户明细",usageUserList:"Agent 使用用户列表",user:"用户",callCount:"调用次数",lastUsed:"最近使用",unknownUser:"未知用户",loadingUsage:"正在加载使用数据…",refreshing:"刷新中…",noUsage:"暂无使用记录",usageUnavailable:"当前 Agent 暂无可用的使用统计。",usagePagination:"使用记录分页",pageOf:"第 {{page}} / {{total}} 页",notProvided:"暂未提供",integrationMethods:"集成方式",integrationDescription:"通过 Runtime API 或 A2A 协议集成当前 Agent。",integrationProtocol:"集成协议",runtimeStatus:"Runtime 状态",executionFlow:"执行流程",probingIntegration:"正在检测集成能力",probingIntegrationDescription:"正在读取可用端点和鉴权配置。",configurationStatus:"配置状态",discoveryEndpoint:"发现端点",invocationEndpoint:"调用端点",invocationUrl:"调用地址",authentication:"鉴权方式",networkAccess:"网络访问",notAvailable:"暂无",noAuthentication:"无需鉴权",noApiKeyRequired:"无需 API Key",usesOauthJwt:"使用 OAuth / JWT",showApiKey:"显示 API Key",hideApiKey:"隐藏 API Key",pythonExample:"Python 示例",deploymentConfig:"部署配置",deploymentConfigDescription:"确认实例和运行配置后更新 Runtime。",deploymentRegion:"部署区域",mpaControlPlane:"MPA 控制面",loadingMpaAgentView:"正在读取 MPA Runtime 绑定…",mpaRuntimeBound:"该 MPA Agent 已绑定唯一 Runtime,可继续管理。",mpaRuntimeMissing:"当前 Agent 没有可见的 MPA Runtime 绑定。",mpaRuntimeBindingAmbiguous:"多个 MPA Runtime 匹配当前 Agent,请先修复绑定后再修改。",mpaRuntimeOrphan:"Runtime 存在,但其中没有当前 MPA Profile。",mpaRuntimeLegacyAuthUnsupported:"该 Runtime 使用旧版 MPA 镜像,仍要求 X-Jwt-Token。请先更新到当前 AgentKit 兼容镜像,再管理 Profile 或 Session 配置。",profileConfig:"Profile 配置",profileConfigTitle:"Profile 配置",profileConfigDescription:"查看并应用 Agent 级 MPA Profile。Profile 是 Runtime 的长期默认配置,新会话默认继承它。",profileStatus:"Profile 状态",profileApplied:"已应用",profileNotApplied:"未应用",profileNotAppliedDescription:"当前 Runtime 可运行,但尚未保存为 Studio 可管理的 Profile。应用后会生成 Profile revision。",applyProfile:"应用 Profile",reapplyProfile:"重新应用 Profile",editProfile:"编辑 Profile",profileApplying:"应用中…",profileAppliedNotice:"Profile 已应用,当前 revision 为 {{revision}}。",profileApplyIncomplete:"Profile 应用未完成,请查看当前操作状态后重试。",profileApplyFailed:"Profile 应用失败。",profilePrompt:"系统提示词",profileResources:"资源配置",profileResourceSummary:"{{tools}} 个工具 · {{skills}} 个 Skill · {{mcp}} 个 MCP 服务",sessionConfigTitle:"会话配置",sessionConfigDescription:"查看和调整当前 MPA Session 的执行配置。变更只对下一轮对话生效。",loadingSessionConfig:"正在加载会话配置…",sessionConfigNoAgent:"请选择一个 MPA Agent 后再管理会话配置。",sessionConfigNonMpa:"会话配置仅适用于 MPA Agent。",sessionConfigNoSession:"请先打开这个 MPA Agent 的对话,再修改会话配置。",sessionConfigDifferentRuntime:"请先切回这个 MPA Agent 的当前对话,再修改会话配置。",sessionConfigSaved:"会话配置已更新,下一轮对话将使用新 revision。",sessionConfigStale:"该 Session 已被其他位置修改,已展示最新配置,请确认后再保存。",sessionConfigRevision:"配置 revision",sessionProfileRevision:"Session Profile revision",latestProfileRevision:"最新 Profile revision",sessionProfileUpgradeAvailable:"检测到新的 Profile revision:v{{current}} → v{{target}}。",upgradeSessionProfile:"升级 Session Profile",sessionProfileUpgrading:"升级中…",sessionProfileUpgraded:"Session Profile 已升级,下一轮对话将使用新 revision。",sessionProfileUpgradeFailed:"Session Profile 升级失败。",sessionModelOverride:"模型覆盖",modelId:"模型 ID",inheritProfileDefault:"继承 Profile 默认值",sessionMcpServers:"MCP 服务",mcpServerCount:"已选择 {{count}} 个",clearSessionMcp:"清空 MCP 服务",mpaDiagnosticsTitle:"Runtime 诊断",mpaDiagnosticsDescription:"查看最近的 Runtime Console 运行记录,以及 Agent、Profile、Turn、task 和 worker 关联。",loadingMpaDiagnostics:"正在加载 Runtime 诊断…",noMpaDiagnostics:"当前 Session 暂无 Runtime 诊断运行记录。",latestRun:"最近运行",traceCorrelation:"Trace 关联",traceCorrelationDescription:"Runtime Console 为本次 invocation 返回的稳定标识。",traceSteps:"Trace 步骤",traceStepsDescription:"当前 invocation 最近的有界 Runtime Console 步骤。",mpaInstanceId:"MPA 实例",turnId:"Turn ID",taskId:"Task ID",workerKind:"Worker 类型",workerSession:"Worker Session",workerTurn:"Worker Turn",workerProfile:"Worker Profile",workerProfileVersion:"Worker Profile 版本",step:"步骤",stepCount:"步骤数",duration:"耗时",noTraceSteps:"本次 invocation 暂无 trace 步骤。",executionConfigMode:{replace:"Session 覆盖",clear:"本 Session 已清空",inherit:"使用 Profile 默认值"},concurrency:"并发数",selectedOptimizations:"已选优化项",selectedOptimizationsDescription:"这些优化会应用到本次更新。",optimizationProfile:"优化方案",updatePending:"等待更新",updatingDeployment:"正在更新部署",restoringUpdateConfig:"正在恢复更新配置…",updateConfigUnavailable:"无法读取更新配置",legacyConfigMissing:"旧版本 Runtime 缺少可恢复的配置,请重新创建。",deploymentFailed:"部署失败",continueEditing:"继续编辑",loadingOptimizations:"正在加载优化建议…",noOptimizations:"暂无优化建议",fixPriority:"优先级",suggestedModule:"建议模块",suggestionAndReason:"建议与原因",priority:{high:"高",medium:"中",low:"低"},modules:{agentStructure:"Agent 结构",prompt:"提示词",tool:"工具",knowledge:"知识库",memory:"记忆",workflow:"工作流",other:"其他"},evaluationGroupList:"评测组列表",newEvaluationGroup:"新建评测组",newEvaluationGroupName:"新评测组 {{count}}",searchEvaluationGroups:"搜索评测组",noMatchingEvaluationGroups:"没有匹配的评测组",noEvaluationGroupSelected:"请选择一个评测组",groupStats:"{{agents}} 个 Agent · {{runs}} 次运行",evaluationGroupDetails:"评测组详情",evaluationGroupStats:"{{agents}} 个 Agent · {{caseSet}} · {{runs}} 次运行",startEvaluation:"开始评测",evaluationConfig:"评测配置",historyResults:"历史结果",participatingAgents:"参与 Agent",selectedCount:"已选择 {{count}} 个",evaluationResources:"评测资源",evaluationSet:"评测集",evaluator:"评估器",caseCount:"{{count}} 条案例",evaluationMetrics:"评测指标",selectedMetricCount:"已选择 {{count}} 项",historyDescription:"查看每次评测的分数和运行状态。",noHistory:"暂无评测历史",noHistoryDescription:"运行一次评测后,结果会显示在这里。",evaluationRun:"第 {{index}} 次评测",evaluationRunMeta:"{{time}} · {{agents}} 个 Agent",overallScore:"综合分",completed:"已完成",evaluationDefaults:{coreRegression:"核心能力回归",safetyCheck:"安全与幻觉检查",coreSet:"核心回归集",safetySet:"安全边界集",toolSet:"工具调用集",qualityEvaluator:"综合质量评估器",factualEvaluator:"事实一致性评估器",toolEvaluator:"工具调用评估器",responseQuality:"回答质量",factualAccuracy:"事实准确性",toolUse:"工具调用",responseEfficiency:"响应效率",todayTime:"今天 10:32",yesterdayTime:"昨天 16:08",julyTime:"7 月 25 日 14:20",justNow:"刚刚"},defaultCases:{agentName:"示例 Agent",goodSetName:"示例正向案例集",badSetName:"示例负向案例集",weeklyFeedback:{input:"总结本周客户反馈,并按优先级归类。",output:"覆盖主要问题,给出清晰的优先级与下一步动作。",tag:"总结",reason:"任务完整覆盖了用户目标,输出结构清晰,并给出了可执行的下一步动作。"},research:{input:"查询最新公开资料并附上来源。",output:"调用搜索工具,结论与引用一一对应。",tag:"工具调用"},uncertainConclusion:{input:"在信息不足时直接给出确定结论。",output:"应明确说明未知,并主动询问缺失信息。",tag:"幻觉",reason:"信息不足时仍给出了确定结论,缺少必要的澄清步骤与不确定性说明。"},repeatedTool:{input:"连续重复调用相同工具获取同一结果。",output:"复用已有结果,避免无意义的重复调用。",tag:"效率"}},goodCases:"正向案例",badCases:"负向案例",goodCase:"正向案例",badCase:"负向案例",reference:"参考答案",caseResultFilter:"案例结果筛选",feedbackSourceFilter:"反馈来源筛选",searchCases:"搜索案例",searchCasesPlaceholder:"搜索输入、输出或标签",selectCases:"选择案例",selectAll:"全选",selectAllVisible:"选择当前可见案例",selectedCaseCount:"已选择 {{count}} 条",deleteSelected:"删除所选",deleteSelectedTitle:"删除所选 Agent",deleteSelectionDescription:"确定删除所选的 {{count}} 个项目吗?此操作无法撤销。",deleteCasesConfirm:"删除所选案例",deleteOneCaseConfirm:"删除这个案例",deleteFeedbackCase:"删除反馈案例",noFeedbackCases:"暂无反馈案例",noMatchingCases:"没有匹配的案例",loadingEvaluationSet:"正在加载评测集…",userInput:"用户输入",agentOutput:"Agent 输出",score:"得分",scoreReason:"评分原因",noUserInput:"暂无用户输入",noVisibleResponse:"暂无可见回复",note:"备注:",manualFeedback:"人工反馈",automaticFeedback:"自动反馈",scoreValue:"{{score}} 分",unknownTime:"时间未知",deleteAgentTitle:"删除 Agent",deleteAgentDescription:"确定删除 Agent“{{name}}”吗?",deleteDraftDescription:"确定删除草稿“{{name}}”吗?",deleteAgent:"删除 Agent",closeDeleteConfirmation:"关闭删除确认",mpaDeletePreviewSummary:"Studio 会先删除可见的空闲 MPA Runtime 会话,再删除 AgentKit Runtime。运行中的任务需要先结束或停止后才能删除。",mpaDeletePreviewSessions:"会话",mpaDeletePreviewActiveSessions:"运行中",mpaDeletePreviewIdleSessions:"空闲",mpaDeleteBlocked:"当前无法删除",mpaDeleteBlockerActiveOperation:"仍有 MPA 创建或更新操作在执行。",mpaDeleteBlockerActiveSessions:"Runtime 中仍有运行中的会话。",mpaDeleteBlockerBindingAmbiguous:"当前 Agent 匹配到多个 MPA Runtime。",mpaDeleteBlockerRuntimeMissing:"当前 MPA Agent 没有可见的 Runtime 绑定。",mpaDeleteBlockerOrphanRuntime:"Runtime 可见,但其中缺少当前 MPA Profile。",mpaDeleteStage:{runtime_sessions:"删除 {{count}} 个可见空闲 Runtime 会话",runtime_diagnostics:"清理这些会话关联的诊断数据和挂载元信息",agentkit_runtime:"删除 AgentKit Runtime"},draftDeletionWarning:"草稿将从当前浏览器中删除。",runtimeDeletionWarning:"Runtime 和相关云端资源将被删除。",noneSelected:"尚未选择",none:"无",notPublished:"未发布",notRecorded:"未记录",noTime:"暂无时间",noPr:"暂无 PR",comingSoon:"评测能力即将开放",preparing:"准备中",cancelled:"已取消",failed:"失败",totalCount:"共 {{count}} 条",deploymentProgress:"部署进度",returnToEdit:"返回编辑",retryOperation:"重试操作",buildLog:"构建日志",githubMountLog:"GitHub 挂载日志",githubDeliveryMountLog:"GitHub 持续交付挂载日志",waitingBuildLog:"正在等待构建日志…",waitingGithubMountLog:"正在等待 GitHub 挂载日志…",copy:"复制",copied:"已复制",copyLabel:"复制{{label}}",copiedLabel:"已复制{{label}}",logLines:"{{count}} 行",logStatus:{synced:"已同步",failed:"读取失败",syncing:"同步中",earlyOmitted:"已省略早期日志",recentOnly:"仅显示最近的构建日志",partiallyOmitted:"已省略部分日志"},deployStatus:{running:"正在部署",unconfirmed:"部署状态待确认",success:"部署完成",error:"部署失败",cancelled:"部署已取消"},deploymentSteps:{prepare:{label:"准备部署",description:"校验配置并创建部署任务"},build:{label:"构建镜像",description:"生成运行环境与智能体代码"},deploy:{label:"部署服务",description:"创建并启动 AgentKit Runtime"},publish:{label:"发布服务",description:"等待服务就绪并生成访问地址"},complete:{label:"部署完成",description:"智能体已可以正常使用"},evaluation:{label:"创建评测集",description:"自动创建 Good Case 和 Bad Case 评测集"},profileApplying:{label:"应用 MPA 配置",description:"将 Studio Agent 配置写入 MPA Runtime"},smokeRunning:{label:"验证 MPA Runtime",description:"在标记可运行前执行 Runtime 就绪验证"},runnable:{label:"MPA Runtime 可运行",description:"Runtime 已接受配置并通过执行就绪验证"},github:{label:"挂载 GitHub 持续交付",description:"初始化目标分支与 GitHub Actions workflow"},update:{label:"更新实例配置",description:"将 Runtime 实例数调整为 {{min}}~{{max}}"}},githubStatus:{published:"已发布",publishing:"发布中",failed:"发布失败",pending:"等待发布",unknown:"未知"},errors:{agentInfoMissing:"Agent 信息不可用",checkUpdateCapability:"无法检查更新能力",checkingUpdateConfig:"正在检查更新配置",cloudOnlyUpdate:"仅云端 Agent 支持更新",deleteDeployedUnsupported:"当前不支持删除已部署 Agent",deleteDraftUnsupported:"当前不支持删除草稿",loadMpaDeletePreview:"无法加载 MPA 删除预览",loadAgentInfo:"无法加载 Agent 信息",loadApiKey:"无法读取 API Key",loadGithubVersions:"无法加载 GitHub 版本",loadEvaluations:"无法加载评测案例",loadMpaAgentView:"无法加载 MPA Agent 状态",loadMpaDiagnostics:"无法加载 Runtime 诊断",loadOptimizations:"无法加载优化建议",loadRuntimeDetails:"无法加载 Runtime 详情",loadSessionConfig:"无法加载会话配置",loadUsage:"无法加载使用数据",noCreatePermission:"当前账号没有创建 Agent 的权限",noManagePermission:"当前账号没有管理此 Agent 的权限",originalConfigUnavailable:"原始配置不可用",probeIntegration:"无法检测集成能力",rollbackVersion:"无法创建版本回退",runtimeRegionMissing:"Runtime 区域信息缺失",updateCapabilityMismatch:"Runtime 更新能力与当前配置不匹配",updateCapabilityPending:"Runtime 更新能力仍在确认中",updateConfigRestoring:"正在恢复更新配置",updateUnsupported:"当前 Runtime 不支持更新",usageMismatch:"返回的使用数据与当前 Agent 不匹配"}},e1e={title:"环境",loadFailed:"环境加载失败,请检查存储配置后重试。",storageUnavailable:"管理员未配置持久化存储,环境管理暂不可用。",create:"新建环境",configure:"配置环境",details:"环境详情",editorDescription:"配置运行环境,或接入代码仓库和已有镜像",backToList:"返回环境列表",save:"保存环境",createAndBuild:"创建并构建",saveAndBuild:"保存并构建",name:"环境名称",namePlaceholder:"Python 数据处理",descriptionPlaceholder:"说明这个环境适合处理的任务",creationMethod:"创建方式",baseConfiguration:"基础配置",baseEnvironment:"基础环境",operatingSystem:"操作系统",pythonVersion:"Python 版本",fixedByBase:"由 {{base}} 固定为 {{value}}",selectUbuntuVersion:"选择基础镜像的 Ubuntu 版本",selectPythonVersion:"选择需要安装的 Python 版本",skills:"技能",addSkill:"添加环境技能",veadkDescription:"Agent 开发与运行框架",customDockerfile:"自定义 Dockerfile",presetEnvironment:"预制环境",presetHint:"选择“无”可自行填写 Dockerfile 第一行的基础镜像。",dockerfileSize:"{{size}} / {{max}} 字节",upload:"上传",reset:"重置",dockerfileBaseImage:"Dockerfile 基础镜像",dockerfileContent:"Dockerfile 内容",region:"区域",search:"搜索环境",manualImport:"手动导入",noMatches:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称",startBuild:"开始构建",build:"构建",unnamed:"未命名环境",listSeparator:"、",clipboardReadError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。",creation:{custom:{label:"自定义配置",description:"通过表单选择基础环境、Python、工具和技能"},dockerfile:{label:"自定义 Dockerfile",description:"上传或直接编辑 Dockerfile"},git:{label:"从代码仓库构建",description:"探查公开仓库并通过 CodePipeline 构建"},image:{label:"使用已有镜像",description:"绑定由外部流水线交付的 CR 镜像"}},baseDescriptions:{"aio-sandbox":"内置 Sandbox Shell 能力 · Ubuntu 22.04","codex-sandbox":"内置 Codex CLI、浏览器与代码执行环境",ubuntu:"标准 Linux 基础镜像"},dockerfileValidation:{baseImageRequired:"请填写基础镜像。",duplicateFrom:"基础镜像已固定在第一行,请删除 Dockerfile 正文中的 FROM 指令。",tooLarge:"Dockerfile 不能超过 128 KiB。",empty:"Dockerfile 内容不能为空。",missingFrom:"Dockerfile 缺少 FROM 指令。"},presets:{none:"自行填写 Dockerfile 基础镜像",aio:"内置 Sandbox Shell 与常用运行时",codex:"内置 Codex CLI、浏览器与代码执行环境"},categories:{tools:"工具",productivity:"效率",browser:"浏览器自动化",system:"系统与媒体"},options:{"lark-cli":"飞书开放平台命令行工具",pandoc:"文档格式转换工具",opencli:"将网站与桌面应用转换为命令行工具",uv:"快速 Python 包与项目管理器",ripgrep:"高性能文本检索工具",jq:"JSON 查询与转换工具","github-cli":"在终端中管理 GitHub 工作流",playwright:"浏览器自动化与端到端测试",chromium:"无头浏览器运行时",git:"代码版本管理",curl:"网络请求与文件下载",ffmpeg:"音视频转码与处理",imagemagick:"图片转换与批处理"},duration:{seconds:"{{count}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",hoursMinutes:"{{hours}} 小时 {{minutes}} 分"},buildStatus:{preparing:"准备中",queued:"排队中",building:"构建中",scanning:"扫描中",available:"可用",failed:"构建失败",notBuilt:"未构建"},manifest:{title:"环境 Manifest",closeLabel:"关闭环境 Manifest",loading:"正在加载 Manifest",editorLabel:"环境 Manifest YAML",copyFailed:"复制失败,请重试",copied:"已复制",copy:"复制 Manifest",view:"查看环境 Manifest",viewShort:"查看 Manifest",unavailable:"尚无可用 Manifest"},buildDetails:{title:"构建详情",closeLabel:"关闭构建详情",currentStep:"当前步骤",waiting:"等待构建信息",elapsed:"已用时",sourceCommit:"源码提交",openCodePipeline:"在 CodePipeline 中查看",starting:"正在启动",rebuild:"重新构建"},git:{sectionLabel:"公开代码仓库",address:"Git 地址",ref:"Branch、Tag 或 Commit",defaultBranch:"默认分支",inspecting:"正在拉取仓库并查找 Dockerfile",foundDockerfiles:"已在提交 {{commit}} 中找到 {{count}} 个 Dockerfile。",savedDockerfileLoaded:"已载入保存的 Dockerfile,可重新探查仓库更新。",noDockerfile:"仓库中未找到 Dockerfile,请检查分支或仓库内容。",inspectAgain:"重新探查",selectDockerfile:"选择 Dockerfile"},repository:{outputSection:"构建输出",type:"镜像仓库类型",managed:"Studio 默认镜像仓库",existing:"已有镜像仓库",managedHint:"构建时自动创建或复用当前区域的 Studio 镜像仓库。"},existingImage:{sectionLabel:"已有镜像",reference:"Tag 或 Digest",placeholder:"latest 或 sha256:...",hint:"填写镜像 Tag,或以 sha256: 开头的完整 Digest。"},share:{action:"分享",title:"分享环境",closeLabel:"关闭分享环境",generating:"正在生成并复制分享码",copied:"分享码已复制",failed:"分享失败",code:"分享码",fullCode:"完整环境分享码",copiedHint:"分享码已自动复制,也可在这里查看或手动复制。",copyFailedHint:"自动复制失败,可手动复制上方分享码,或重试。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅发送给可信对象。",copyAgain:"再次复制"},import:{title:"导入环境",closeLabel:"关闭导入环境",description:"先检测分享码中的环境,再确认添加到当前账号。",code:"环境分享码",tooMany:"最多可一次导入 {{max}} 个环境,当前检测到 {{count}} 个分享码。",multipleHint:"多个分享码可使用英文逗号、中文逗号或换行分隔,重复项会自动忽略。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅导入可信来源的分享码。",inspectingCodes:"正在检测环境分享码",found:"检测到 {{count}} 个环境:{{names}}。",itemError:"第 {{index}} 个分享码:{{error}}",invalidCode:"分享码无效。",noResult:"服务未返回该分享码的导入结果。",partial:"已导入 {{created}} 个环境,{{remaining}} 个未完成,可重试有效失败项。",inspecting:"正在检测",importing:"正在导入",retryImport:"重试导入",confirm:"确认导入",inspectCodes:"检测分享码"},status:{boundImage:"环境“{{name}}”已绑定已有镜像",queued:"环境“{{name}}”已进入构建队列",savedBuildFailed:"环境已保存,但构建未启动:{{error}}",importedFailed:"已导入 {{created}} 个环境,{{failed}} 个失败",importedDuplicate:"已导入 {{created}} 个环境,{{duplicate}} 个分享码已存在",imported:"已导入 {{count}} 个环境",deleted:"已删除环境“{{name}}”"},deleteTitle:"删除环境",deleteDescription:"确定删除环境“{{name}}”吗?删除后无法恢复。",errors:{repositoryRequired:"请输入公开代码仓库地址。",repositoryHttps:"请输入公开仓库的 HTTPS 地址。",repositoryInvalid:"请输入有效的公开仓库 HTTPS 地址。",imageReferenceWhitespace:"Tag 或 Digest 不能包含空格。",imageDigestInvalid:"Digest 必须是完整的 sha256 值。",imageTagOnly:"这里只填写 Tag,不要重复填写镜像仓库路径。"}},t1e={searchPlaceholder:"搜索资源名称",emptyMessage:"暂无可用选项",searchAriaLabel:"搜索{{label}}",loadingMore:"正在加载更多资源…"},n1e={retryDeployment:"重试部署",retrying:"正在重试…",collapse:"收起错误信息",expand:"展开完整错误信息",copy:"复制完整错误信息"},i1e={steps:"构建步骤",log:"构建日志",syncing:"同步中",loadFailed:"读取失败",synced:"已同步",recentOnly:" · 仅显示最近日志",copiedLog:"已复制构建日志",copyLog:"复制构建日志",copied:"已复制",copy:"复制",logContent:"构建日志内容",waiting:"正在等待 CodePipeline 输出日志…",empty:"暂无构建日志"},r1e={defaultLabel:"Studio 默认环境",defaultDescription:"使用 Studio 预置的标准运行环境",status:{notBuilt:"未构建",preparing:"准备中",queued:"排队中",building:"构建中",scanning:"扫描中",available:"可用",failed:"失败"},label:"运行环境",placeholder:"请选择运行环境",search:"搜索运行环境",loading:"正在加载运行环境…",loadFailed:"加载运行环境失败",noMatches:"未找到匹配的运行环境",unavailable:"当前没有可用的运行环境",selectionUnavailable:"所选运行环境当前不可用,请重新选择。",selectionHint:"选择构建完成的运行环境后,部署将使用其镜像和工具配置。",versionChanged:"所选环境版本已更新,请确认后继续。",versionMissing:"所选环境版本已不存在,请重新选择。",operatingSystem:"操作系统",language:"语言",image:"镜像",imageVersion:"镜像版本",skills:"技能",tools:"工具",noSkills:"未配置 Skill",noExtraTools:"未配置额外工具",defaultGuidance:"默认环境由 Studio 管理,无需额外配置。",persistenceFallback:"持久化环境服务暂不可用,当前使用默认环境。",emptyFallback:"当前没有可选择的自定义环境。"},s1e={repository:"GitHub 仓库",githubUrl:"GitHub 地址",token:"访问令牌",sessionToken:"{{provider}} 临时令牌",runtime:"Runtime",commit:"提交",workflow:"工作流",syncFailed:"同步 GitHub 代码失败",status:{mounted:"已挂载",bound:"已绑定",synced:"已同步",created:"已创建"},volcengine:"火山引擎",mountDelivery:"挂载持续交付",selectedForDeployment:"已选择,部署时挂载",mountOnDeploy:"部署时挂载持续交付",syncCode:"同步代码",deliveryMode:"GitHub 交付模式",sourceSync:"GitHub 代码同步",delivery:"GitHub 交付",loading:"读取中",running:"执行中",runtimeDeliveryHint:"写入 AgentKit Runtime GitHub Actions workflow,后续 GitHub 提交会更新绑定 Runtime。",initialDeliveryHint:"首次部署成功后初始化目标分支,后续 GitHub 提交会更新绑定 Runtime。",sourceSyncHint:"Studio 会直接 push 到目标分支;该分支由 Studio 管理,远端冲突时同步会失败。Runtime 仍由部署按钮发布。",tokenPlaceholder:"repo 或 contents write 权限",getToken:"获取 Token",hideToken:"隐藏 Token",showToken:"显示 Token",tokenHelp:"Token 仅用于本次操作,成功后不会保留在表单中。",targetBranch:"目标分支",actionsSecretPlaceholder:"用于写入 GitHub Actions Secret",sessionTokenPlaceholder:"临时凭证可选",syncing:"同步中…",pendingHint:"已选择挂载持续交付。点击部署后,Studio 会等待 Runtime 创建完成并初始化 GitHub 目标分支,初始化成功后才完成部署流程。",result:{deliveryMounted:"已挂载持续交付",deliverySelected:"已选择挂载持续交付",githubBound:"已绑定 GitHub",codeSynced:"代码已同步",deliveryHint:"目标分支提交会触发 Runtime 持续交付。",boundHint:"更新并发布时会先同步当前源码到这个分支。"},branch:"分支",viewPr:"查看 PR",createFailed:"创建失败",phase:"阶段",log:"日志"},a1e={name:"飞书",enabling:"正在启用并更新配置…",description:"接收消息并通过飞书机器人回复",configuration:"飞书配置",configurationMode:"飞书配置方式",automatic:"自动配置",manual:"手动配置",cancelling:"取消中…",scanToCreate:"扫码创建",scanDescription:"授权后自动回填凭据",generateQrCode:"生成二维码",qrCodeAlt:"飞书机器人配置二维码",scanToConfirm:"飞书扫码确认",expiresIn:"{{time}} 后失效",created:"机器人已创建",credentialsFilled:"应用凭据已自动回填",qrCodeExpired:"二维码已失效",automaticFailed:"自动配置失败",regenerateQrCode:"请重新生成二维码。",configuredPlaceholder:"已配置,留空沿用",appSecretPlaceholder:"请输入 App Secret",hideSecret:"隐藏 App Secret",showSecret:"显示 App Secret"},o1e={mode:{auto:"自动创建",autoDescription:"部署时自动创建所需资源",recommended:"推荐",create:"指定名称",createDescription:"使用指定名称创建或复用资源",existing:"选择已有",existingDescription:"从当前账号的已有资源中选择"},selectExisting:"请选择已有资源",searchResource:"搜索资源名称",noMatch:"未找到匹配资源",noAvailable:"暂无可用资源",searching:"正在搜索云资源…",loading:"正在加载云资源…",noMatchSentence:"未找到匹配资源。",noAvailableSentence:"暂无可用资源。",loadedSummary:"实际服务区域:{{region}} · 已加载 {{loaded}}{{total}}",registryInstance:"Registry 实例",registryAriaLabel:"镜像仓库 Registry 实例",namespace:"命名空间",namespaceAriaLabel:"镜像仓库 Namespace",repository:"镜像仓库",existingRepository:"已有镜像仓库",selectRegistryFirst:"请先选择 Registry 实例。",selectNamespaceFirst:"请先选择 Namespace。",configurationMode:"配置方式",configurationModeAriaLabel:"{{resource}}配置方式",selectConfigurationMode:"请选择配置方式",automaticNames:"自动创建名称",validation:{tos:"请填写或选择 TOS 存储桶。",cr:"请完整填写或选择 CR 实例、命名空间和镜像仓库。",codePipeline:"请完整填写或选择 CodePipeline Workspace 和 Pipeline。",existingCodePipeline:"请选择已有的 CodePipeline Workspace 和兼容 Pipeline。"},autoBucketWithRegion:"agentkit-platform-{账号 ID}-{{region}}",autoBucket:"agentkit-platform-{账号 ID}",tosBucket:"TOS 存储桶",bucketName:"存储桶名称",bucketNamePlaceholder:"输入存储桶名称",existingBucket:"已有存储桶",existingTosBucket:"已有 TOS 存储桶",bucket:"存储桶",accountIdResolved:"账号 ID 在部署时按当前云账号解析。",containerRegistry:"容器镜像仓库(CR)",instanceName:"实例名称",crInstance:"CR 实例",existingCrInstance:"已有 CR 实例",existingCrNamespace:"已有 CR 命名空间",existingCrRepository:"已有 CR 镜像仓库",autoRegistry:"agentkit-platform-{账号 ID}",autoRepositoryName:"{{name}}-{4 位随机字符}",registryNameNote:"账号 ID 在部署时解析,镜像仓库的随机字符在部署时生成。",workspace:"工作空间",pipeline:"流水线",workspaceName:"Workspace 名称",pipelineName:"Pipeline 名称",existingWorkspace:"已有 CodePipeline Workspace",compatiblePipeline:"兼容 Pipeline",existingPipeline:"已有 AgentKit CodePipeline",pipelineNameNote:"Pipeline 与 Runtime 名称一致。"},l1e={commit:"提交",steps:{permissions:"预检 OTA 所需权限",resolving:"读取目标版本信息",downloading:"下载并校验完整更新包",preparing:"准备 VeFaaS Function 代码",provisioning:"检查并补齐 Studio 云资源",scheduler:"更新定时任务调度服务",submitting:"提交 Function 更新",publishing:"发布新 Revision 并重启服务"},stages:{permissions:"预检 OTA 权限",resolving:"读取版本信息",downloading:"下载更新包",preparing:"准备 Function 代码",provisioning:"补齐 Studio 云资源",scheduler:"更新定时任务调度服务",submitting:"提交 Function 更新",publishing:"发布 Revision",checking:"检查更新",unknown:"未知阶段"},duration:{seconds:"{{count}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},logPermissionPrefix:"无法读取 VeFaaS 发布日志。Function 角色缺少 ",logPermissionSuffix:" 权限,更新会继续。",openIamConsole:"前往 IAM 控制台配置权限",deploymentProgress:"部署进度",live:"实时",completed:"已完成",stopped:"已停止",copied:"已复制",copyFailed:"复制失败",copyLog:"复制日志",waitingForLogs:"等待 VeFaaS 返回更新日志…",noLogs:"本次更新未返回发布日志",messages:{updated:"Studio 已更新,新 Revision 已接管服务",failed:"Studio 更新失败",timeout:"等待 VeFaaS 发布超时,请稍后重新检查版本",submitted:"更新已提交,正在等待 VeFaaS 发布新版本",connectionSwitched:"连接已切换,正在确认新版本状态"},checkingPermissions:"正在检查 OTA 权限",authorizationRequired:"需要 IAM 授权",updating:"正在更新 Studio",updated:"Studio 已更新",updateToVersion:"更新 Studio 至 {{version}}",checkPermissions:"检查更新权限",authorizationNeeded:"需要授权",updatingShort:"正在更新",refreshForNewVersion:"刷新使用新版",updateFailed:"更新失败",updateNow:"立即更新",newVersionAvailable:"有新版更新",dialog:{failed:"Studio 更新失败",checkingPermissions:"正在检查更新权限",authorizationRequired:"需要 IAM 授权",updating:"正在更新 Studio",completed:"Studio 更新完成",newVersion:"发现新版本"},permissionCheck:"正在核对 OTA 与定时任务所需的全部 IAM 权限…",permissionCheckHint:"权限全部满足后才会开始下载、更新或发布云资源。",missingPermissionCount:"当前 Function 角色缺少 {{count}} 项 OTA 更新权限,尚未执行任何云资源变更。",functionRole:"Function 角色",currentRole:"当前运行角色",policyToUpdate:"将更新策略",authorizationSteps:{open:"打开授权页面,确认已预填的策略名称和完整策略内容。",debug:"点击页面中的“发起调试”,完成策略更新。",return:"返回此窗口,点击“我已授权,重新检查”。"},missingPermissions:"缺少的权限",openPrefilledAuthorization:"打开已预填的 IAM 授权页面",openIamManually:"前往 IAM 控制台手动配置",noSafePolicy:"当前角色没有唯一可安全更新的自定义策略,请由管理员将上述权限加入该角色。",failedStage:"失败阶段",errorId:"错误 ID",notGenerated:"未生成",openFunctionLogs:"前往 VeFaaS 控制台查看 Function 日志",targetVersion:"目标版本",updateStatus:"更新状态",elapsed:"已用时",progressAriaLabel:"Studio 更新进度",processingUpdate:"正在处理更新",processing:"正在处理",backgroundHint:"发布阶段会短暂中断连接;关闭此窗口不会停止更新,可随时点击右上角按钮重新查看。",confirmDescription:"更新会重启 Studio 服务,预计约 3–5 分钟完成更新与发布。期间正在进行的对话、流式响应或部署任务可能中断,登录态不会受到影响。",selectVersion:"选择版本",currentVersion:"当前版本",changelog:"更新内容",noChangelog:"暂无更新说明",runInBackground:"后台运行",authorizedRecheck:"我已授权,重新检查",tryAgain:"重新尝试"},c1e={deploy:"部署",update:"更新",planHash:"方案哈希",backToConfiguration:"返回配置",releaseRegion:"发布区域",deployRegion:"部署区域",regionPreserved:"更新时沿用现有 Runtime 的部署区域,无法修改。",unnamedAgent:"未命名 Agent",deployTitle:"部署 {{name}}",additionalAgentCount:" 等 {{count}} 个智能体",releaseOverview:"发布概览",agentOverview:"Agent 概览",agentCount:"Agent 数量",model:"模型",systemPrompt:"系统提示词",optimizations:"优化选项",notEnabled:"未启用",effectiveCapabilities:"生效能力",automaticProtection:"自动保护",artifactActions:"发布产物操作",exportYaml:"导出 YAML",viewSource:"查看源代码",downloadSource:"下载源代码",expandFlow:"放大查看执行流程",expand:"放大查看",deploymentConfiguration:"部署配置",runtimeName:"Runtime 名称",runtimeNamePreserved:"更新时保持现有 Runtime 名称不变。",runtimeNameHint:"默认根据 Root Agent 名称生成,并添加随机后缀避免重名;支持 4-64 位字母、数字、连字符和下划线",accessAuthentication:"访问鉴权",authenticationPreserved:"更新时保持现有 Runtime 的鉴权方式不变。",authenticationMethod:"鉴权方式",authenticationAriaLabel:"部署鉴权方式",authenticationPlaceholder:"请选择鉴权方式",messageChannels:"消息渠道",instanceSettings:"实例设置",minInstances:"最小实例数",maxInstances:"最大实例数",sidecarSingleInstance:"Harness Sidecar 首期仅支持单实例,Runtime 固定为 1~1",inMemorySingleInstance:"为避免多实例间会话丢失,推荐将 Runtime 固定为 1~1",network:"网络",networkPreserved:"现有 Runtime 的区域与网络模式保持不变。",networkMode:"网络模式",networkModes:{public:"公网",both:"公网 + VPC"},subnetId:"子网 ID",subnetHint:"可选,多个用逗号分隔",sharedInternetAccess:"VPC 内共享公网出口",evaluationSets:"评测集",createEvaluationSets:"自动创建评测集",createEvaluationSetsHint:"部署成功后,自动创建 Good Case 和 Bad Case 评测集。",resourceConfiguration:"资源配置",environmentVariables:"环境变量",environmentVariablesHint:"组件配置会自动同步到这里,部署前可核对最终值。",itemCount:"{{count}} 项",addVariable:"添加变量",componentGenerated:"组件自动生成",injectedByApiKey:"由所选 API Key 注入",envNameAriaLabel:"{{key}} 环境变量名",envDescriptionAriaLabel:"{{key}}说明:{{description}}",openOpenViking:"打开 OpenViking {{label}}",openOpenVikingAriaLabel:"{{key}}:打开 OpenViking {{label}}",requiredEmpty:"必填,尚未填写",optionalEmpty:"可选,尚未填写",envValueAriaLabel:"{{key}} 环境变量值",automatic:"自动",synced:"同步",customModelCredentials:"自定义模型凭据",releaseOnlySecret:"必填,仅用于本次发布",thisRelease:"本次发布",customVariables:"自定义变量",value:"值",deleteVariable:"删除变量",deploymentProgress:"部署进度",retryUpdate:"重试更新",retryDeploy:"重试部署",updateSucceeded:"更新成功",deploySucceeded:"部署成功",region:"区域",agentName:"Agent 名称",apiEndpoint:"API 端点",connecting:"连接中…",chatNow:"立即对话",console:"控制台",actionInProgress:"{{action}}中…",checkingName:"正在检查名称…",retryAction:"重试{{action}}",flowPreview:"执行流程预览",executionFlow:"执行流程",flowPreviewHint:"只读预览,可缩放与拖动画布",closeFlowPreview:"关闭执行流程预览",agentAdded:'Agent "{{name}}" 已添加到左上角下拉列表!',files:{preview:"文件预览",new:"新建文件",empty:"暂无文件",noneSelected:"未选择文件",selectToView:"选择左侧文件以查看内容",loadingEditor:"加载编辑器…",rename:"重命名",renamePrompt:"重命名文件"},apiKey:{selectFirst:"请先选择 API Key",revealing:"正在显示 API Key",hide:"隐藏 API Key",retryReveal:"重试显示 API Key",reveal:"显示 API Key"},task:{preparing:"准备部署",waitingBuildLog:"正在等待构建日志…",waitingGithubLog:"正在等待 GitHub 挂载日志…",syncingGithub:"正在同步当前源码到 GitHub",syncGithubCode:"同步 GitHub 代码",githubSynced:"GitHub 代码已同步",githubSubmitted:"GitHub 代码已提交",githubUpdatingRuntime:"代码已提交到 GitHub,GitHub Actions 正在更新同一个 Runtime",initializingGithub:"开始初始化 GitHub main 分支与 Actions workflow",initializingGithubBranch:"正在初始化 GitHub 持续交付目标分支",mountGithubDelivery:"挂载 GitHub 持续交付",githubBranchInitialized:"GitHub 持续交付已初始化目标分支",githubDeliveryMounted:"GitHub 持续交付已挂载",githubMountFailed:"挂载 GitHub 持续交付失败",githubMountFailedDetail:"GitHub 持续交付挂载失败:{{message}}",githubMountFailedHint:"挂载 GitHub 持续交付失败,详见 GitHub 日志。",applyingMpaProfile:"正在将 Agent 配置应用到 MPA Runtime",mpaProfileApplied:"MPA Runtime 配置已应用",runningMpaSmoke:"正在验证 MPA Runtime 执行链路",mpaReady:"MPA Runtime 已可运行",deploymentComplete:"部署完成",deployedNotConnected:"部署完成,暂未连接",cancelled:"已取消",cancelledHint:"部署已取消,相关 Runtime 资源已请求销毁。",deploymentStatusUnconfirmed:"部署状态待确认",deploymentFailed:"部署失败",buildFailedHint:"构建镜像失败,详见构建日志。"},confirm:{updateTitle:"确认更新",deployTitle:"确认部署",closeLabel:"关闭部署确认",updateDescription:"将更新并发布到当前云端 Runtime,过程可能需要几分钟。确定继续吗?",deployDescription:"将创建新的云端 Runtime,部署过程可能需要几分钟。确定继续吗?",update:"确定更新",deploy:"确定部署"},userPool:{label:"用户池",unnamed:"未命名用户池",current:"当前用户池",ariaLabel:"部署用户池",loading:"正在加载用户池…",placeholder:"请选择用户池",loadingIdentity:"正在加载 Identity 用户池…",empty:"当前账号下暂无 Identity 用户池。",currentHint:"当前 Studio 的登录 JWT 将透传访问此 Runtime。",mismatchHint:"所选用户池不是当前 Studio 使用的用户池,部署后无法从 Studio 调用此 Runtime。",markedHint:"当前 Studio 使用的用户池已在列表中标注。"},authentication:{apiKeyDescription:"默认方式,使用 Runtime API Key 访问",userPool:"用户池",userPoolDescription:"使用 Identity 用户池签发的 JWT"},steps:{buildImage:"构建镜像",deploy:"部署",publish:"发布",syncCode:"同步代码",uploadPackage:"上传代码包",packageImage:"镜像打包",createRuntime:"创建 Runtime",publishService:"发布服务",updateInstances:"更新实例配置",createEvaluationSets:"创建评测集",applyMpaProfile:"应用 MPA 配置",verifyMpaRuntime:"验证 MPA Runtime",mpaReady:"MPA Runtime 可运行"},errors:{instanceRangeInteger:"最小实例数必须为大于等于 0 的整数,最大实例数必须为大于 0 的整数。",instanceRangeOrder:"最小实例数不能大于最大实例数。",selectApiKey:"请先在模型配置中选择 API Key。",loadApiKey:"加载 API Key 失败,请重试。",invalidProject:"项目数据无效",updateFeishu:"更新飞书配置失败:{{message}}",userPoolRequired:"请选择用于 Runtime 鉴权的用户池。",vpcRequired:"使用 VPC 网络时,请填写 VPC ID。",modelSecretRequired:"请填写 {{label}},用于访问对应的自定义模型地址。",managedApiKeyRequired:"{{requirement}},请先返回模型配置选择 API Key。",feishuEnvRequired:"启用飞书后,请填写{{field}}。",runtimeNameExists:"Runtime 名称已存在,请修改后重试。",deployedButGithubMountFailed:"部署成功,但挂载 GitHub 持续交付失败:{{message}}",deployedButGithubBindFailed:"部署成功,但绑定 GitHub 失败:{{message}}",mpaRuntimeIdMissing:"部署成功,但返回缺少 Runtime ID,无法应用 MPA 配置。",mpaOperationIncomplete:"MPA Runtime 初始化未完成,请重试此部署任务。",deploymentStatusUnconfirmed:"连接已中断,当前无法确认部署最终状态。任务可能仍在云端运行,请到 AgentKit 或 Code Pipeline 查看同一任务,避免重复部署。",failedAtStage:"{{action}}失败({{stage}}阶段):{{message}}",noAgentAtEndpoint:"连接成功,但该地址未发现任何 Agent(/list-apps 为空)。",addAgent:"添加 Agent 失败:{{message}}",modelApiKeyRequired:"请填写此模型地址对应的 API Key。"}},u1e={title:"工作区",storageUnavailable:"管理员未配置持久化存储,工作区管理暂不可用。",detail:"工作区详情",create:"新建工作区",editorDescription:"将常用环境组合在一起;同一个环境可以加入多个工作区。",backToList:"返回工作区列表",environmentCount_one:"{{count}} 个环境",environmentCount_other:"{{count}} 个环境",createdAt:"创建时间",updatedAt:"最近更新",basicInfo:"基本信息",namePlaceholder:"例如:内容生产",descriptionPlaceholder:"说明这个工作区的用途",selectedEnvironmentCount:"已选择 {{count}} 个,可在其他工作区中继续复用",searchAvailableEnvironments:"搜索可用环境",searchEnvironments:"搜索环境",noAvailableEnvironments:"还没有可添加的环境",createEnvironmentFirst:"请先在“环境”页面创建并构建环境。",noMatchingEnvironments:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称。",environmentStatus:{available:"可用",building:"构建中",notBuilt:"未构建"},added:"已添加",saved:"已保存工作区“{{name}}”",resourceType:"工作区资源类型",searchWorkspaces:"搜索工作区",loadFailed:"无法加载工作区",noMatchingWorkspaces:"没有匹配的工作区",tryAnotherNameOrEnvironment:"请尝试搜索其他名称或环境",noEnvironmentAdded:"未添加环境",environmentMissing:"环境缺失",availableFraction:"{{available}}/{{total}} 可用",available:"可用",availableCount:"{{count}} 个可用",updated:"更新",addEnvironment:"添加环境",deleteTitle:"删除工作区",deleteDescription:"确定删除工作区“{{name}}”吗?环境本身不会被删除。",deleted:"已删除工作区“{{name}}”",clipboardPermissionError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。",codeProjects:"代码项目"},d1e={back:"返回",detailNavigation:"详情导航",noData:"暂无数据",actions:"操作",moreActions:"更多操作 {{label}}",actionsFor:"{{label}} 操作",loading:"资源加载中,请稍候"},f1e={addSkill:"添加 Skill",remove:"移除 {{name}}",confirmRemoveRuntime:"从新版本中移除运行中的 Skill「{{name}}」?",selectedCount:"已加入技能 · {{count}}",close:"关闭{{label}}",sources:{runtime:"运行中来源 · 原样保留,可移除或用同名 Skill 替换",local:"本地",skillspace:"AgentKit Skills 中心",skillhub:"火山 Find Skill 技能广场"},tabs:{local:"本地文件",localShort:"本地文件",skillspace:"AgentKit Skills 中心",skillspaceShort:"AgentKit",skillhub:"火山 Find Skill 技能广场",skillhubShort:"Find Skill"}},h1e={model:"模型",turnControls:"流程控制",pause:"暂停",resume:"恢复",interrupt:"中断",cancel:"取消",pauseTurn:"在安全点暂停完整流程",resumeTurn:"恢复完整流程",interruptTurn:"中断当前流程并保留会话上下文",cancelTurn:"取消当前流程且不可恢复",turnState:{running:"运行中",pausing:"正在到达安全点",paused:"已暂停",resuming:"正在恢复",interrupting:"正在中断",cancelling:"正在取消",interrupted:"已中断",completed:"已完成",failed:"失败",cancelled:"已取消",orphaned:"状态待确认",newTurnRequired:"需要从检查点继续"},tasks:{ppt:"PPT",image:"图片生成",video:"视频生成"},prompts:{ppt:{quarterlyReview:"复盘【季度】经营表现,提炼指标差距、原因与行动建议",projectUpdate:"汇报【项目名称】进展:里程碑、风险、预算和资源诉求",solutionProposal:"为【客户行业】输出解决方案:痛点、架构、实施路径与收益",industryAnalysis:"分析【行业主题】趋势,给出竞争格局、机会与战略建议"},image:{launchVisual:"为【品牌或产品】设计【高级科技】风格的发布会主视觉",ecommercePoster:"生成【产品名称】电商海报,突出【核心卖点】与品牌色",conceptRendering:"呈现【产品或空间】在【使用场景】中的写实概念效果图",socialGraphic:"围绕【传播主题】制作简洁专业的企业社媒配图"},video:{brandFilm:"制作【品牌名称】30 秒宣传片,突出【品牌价值】",productLaunch:"为【产品名称】制作 45 秒发布视频:痛点、功能、场景与行动号召",trainingVideo:"制作【培训主题】企业培训视频,讲清【关键操作或规范】",eventTeaser:"生成【活动名称】20 秒预热视频,包含亮点、时间地点和报名信息"}},firstFrame:"首帧",videoToEdit:"待编辑视频",baseVideo:"基础视频",optimizeSkillPlaceholder:"描述你想优化的技能…",createSkillPlaceholder:"描述你想生成的技能…",createVideoPlaceholder:"描述你想创作的视频…",messageAgentPlaceholder:"向 {{name}} 发消息…",selectAgentFirst:"请先选择智能体",selectSkillFirst:"请先选择需要优化的 Skill",availableSkills:"可用技能",availableSubagents:"可用子 Agent",invokeSkill:"调用技能",useSubagent:"使用子 Agent",loadingCapabilities:"正在读取 Agent 能力…",noMatchingSkills:"当前 Agent 没有匹配技能",noMatchingSubagents:"当前 Agent 没有匹配子 Agent",skillFallbackDescription:"加载并执行该技能",agentFallbackDescription:"将本轮交给该 Agent",skill:"技能",uploadImage:"上传图片",uploadDocument:"上传文档或 PDF",uploadVideo:"上传视频",taskMode:"任务模式",selectTaskMode:"选择任务模式",loadingGenerationModel:"正在加载生成模型",modelUnavailable:"模型不可用",cancelTask:"取消{{task}}任务",stopGenerating:"停止生成",viewVideoProgress:"查看视频生成进度",send:"发送",selectTaskType:"选择任务类型",enterprisePrompts:"{{task}}企业提示词",sessionId:"会话 ID",sessionIdLabel:"会话 ID:",initializing:"初始化中",copied:"已复制",copySessionId:"复制会话 ID",sessionIdCopied:"已复制会话 ID",disclaimer:"回答仅供参考",viewLogs:"查看日志"},p1e={selectAgent:"选择 Agent",noLocalAgents:"暂无本地 Agent。",searchRuntime:"搜索 Runtime 名称",mineOnly:"只看我创建的",noRuntimes:"暂无 Runtime。",unsupported:"不支持",createdByMe:"我创建的",connecting:"连接中…",connected:"已连接",connect:"连接",viewInfoFor:"查看 {{name}} 信息",viewInfo:"查看信息",agentAndRuntimeInfo:"Agent 与 Runtime 信息",detailType:"详情类型",agentInfo:"Agent 信息",runtimeInfo:"Runtime 信息",loadingAgentInfo:"读取 Agent 信息…",cannotLoadAgentInfo:"暂时无法读取 Agent 信息",unnamedAgent:"未命名 Agent",subagents:"子 Agent",tools:"工具",skills:"技能",previewUnsupported:"暂不支持预览",mountedComponents:"挂载组件",noMoreAgentInfo:"暂无更多 Agent 配置信息。",local:"本地",model:"模型",status:"状态",memoryMb:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",resources:"资源",version:"版本",loadingDetails:"读取详情…",environmentVariables:"环境变量",errors:{notFound:"该 Runtime 已不存在或列表信息已过期,请刷新列表后重试。",accessDenied:"当前账号无权访问该 Runtime,请检查所属 Project 和访问权限。",previewUnsupported:"该 Agent Server 版本暂不支持信息预览。",unavailable:"该 Runtime 暂时无法访问,请确认其状态为“就绪”后重试。",timeout:"加载超时,请重试"},componentKinds:{knowledgebase:"知识库",memory:"记忆",prompt_manager:"提示词管理",example_store:"样例库",run_processor:"运行处理器",tracer:"链路追踪",toolset:"工具集",plugin:"插件",other:"其他"},runtimeStatus:{ready:"就绪",unreleased:"未发布",running:"运行中",active:"运行中",creating:"创建中",pending:"等待中",deploying:"部署中",updating:"更新中",failed:"失败",error:"异常",stopping:"停止中",stopped:"已停止",deleting:"删除中",deleted:"已删除"}},m1e={agent:"智能体",agentTypes:{general:"通用智能体",mpa:"MPA 智能体",codex:"Codex","deepseek-harness":"DeepSeek",openclaw:"OpenClaw",hermes:"Hermes"},creator:"创建人",namedAgent:"{{name}} 智能体",storageLocation:"存储位置",currentBrowser:"当前浏览器",region:"地域",viewDeploymentProgress:"查看 {{name}} 部署进度",viewRuntimeDetails:"查看 {{name}} Runtime 详情",viewDetails:"查看 {{name}} 详情",time:"时间",remainingTime:"剩余时间",expiringSoon:"即将清空",sandboxRemaining:"{{hours}} 小时 {{minutes}} 分钟",wakeable:"已休眠",neverExpires:"永不过期",editDraftNamed:"编辑草稿 {{name}}",viewProgress:"查看进度",deleteDraftNamed:"删除草稿 {{name}}",recheckCompatibility:"重新检测 {{name}} 的对话兼容性",connectedNamed:"{{name}} 已连接",wakeAndChat:"唤醒 {{name}} 并开始对话",chatWith:"与 {{name}} 对话",waking:"唤醒中",deploying:"部署中",draft:"草稿",checking:"检测中",chatUnsupported:"不支持对话",checkFailed:"检测失败",creatorFilter:"创建人筛选",agentType:"智能体类型",searchAgents:"搜索智能体",handoff:"接力",agentList:"{{type}}列表",noMatchingAgents:"没有匹配的智能体",adjustSearch:"请尝试调整搜索或筛选条件",noAgentType:"暂无 {{type}}",noGeneralAgents:"暂无通用智能体",createGeneralAgentDescription:"创建一个通用智能体,开始构建和对话",createAgentType:"创建{{type}}",createAgent:"创建智能体",loadingMore:"正在加载更多智能体",scrollForMore:"继续下滑加载更多",allLoaded:"已加载全部智能体",deleteDraftTitle:"删除草稿?",deleteDraftDescription:"删除后将无法恢复“{{name}}”。",deleteDraft:"删除草稿",loadGeneralAgents:"加载通用智能体",loadAgentType:"加载 {{type}}",compatibility:{checking:"正在请求 Runtime /list-apps,以确认该智能体是否支持 Studio 对话。",empty:"Runtime /list-apps 未返回可用的 Agent,暂时无法连接对话。",supported:"Runtime 支持 Studio 对话。",unknownError:"Runtime /list-apps 请求失败,未返回可识别的错误信息。"},sandboxStatus:{ready:"就绪",wakeable:"已休眠",creating:"创建中",starting:"启动中",initializing:"启动中",pending:"等待中",running:"运行中",failed:"异常",error:"异常",stopped:"已停止",expired:"已过期",deleting:"删除中",deleted:"已删除",unknown:"未知状态"},wakingHint:"正在唤醒智能体,可能需要一些时间。",mpaCreate:{name:"名称",namePlaceholder:"例如 test-agent",nameHelp:"作为 Runtime 名称,支持 4–64 位字母、数字、下划线或连字符。",stepsLabel:"创建步骤",steps:{basics:"基本信息",postgres:"PostgreSQL",openviking:"OpenViking",autoPostgres:"数据库"},next:"下一步",previousStep:"上一步",pgDescription:"选择已有的 PostgreSQL 实例。创建流程会在该实例中准备智能体的独立业务库。",pgSplitDescription:"使用已配置的业务 PG Workspace。多个智能体共用此 Workspace,每个智能体拥有独立业务库。共享资源记录单独存放在 mpa_admin_workspace / mpa_admin_db,由管理员配置。",pgConsole:"前往火山引擎 AIDAP 创建或查看 PG Workspace",pgHost:"PG 主机地址",pgPort:"PG 端口",pgInvalid:"请填写有效的 PG 主机地址和端口。",pgCredentials:"PG 连接账号和密码由部署服务配置;主机和端口须与服务端配置一致。",openvikingDescription:"可选。三项全部填写才启用 OpenViking;全部留空则不向新智能体注入 OpenViking 配置。",openvikingConsole:"前往火山引擎查看 OpenViking 资源",openvikingUrl:"OpenViking 服务地址",openvikingResourceId:"OpenViking 资源 ID",openvikingApiKey:"OpenViking API Key",openvikingInvalid:"请同时填写有效的 HTTPS 服务地址、资源 ID 和 API Key,或全部留空。",openvikingCredentials:"API Key 仅用于本次创建,不保存到浏览器草稿;刷新页面后需重新填写。",tosTitle:"会话输出存储",tosDescription:"可选。填写完整的 TOS 凭证和存储桶,为新智能体的每个会话挂载独立输出目录。三项均留空时使用服务端预设;服务端未配置时,不启用 TOS 挂载。",tosAccessKey:"TOS Access Key",tosSecretKey:"TOS Secret Key",tosBucket:"TOS 存储桶",tosInvalid:"TOS Access Key、Secret Key 和存储桶必须同时填写。",tosCredentials:"凭证仅用于本次创建,不会保存在浏览器恢复数据或创建任务记录中。",runtimeImage:"MPA 镜像",workerImage:"Worker 镜像",imageDefault:"留空使用配置文件中的默认镜像",imageInvalid:"请输入有效的镜像地址,不要包含网址、空格或登录凭据。",title:"创建 MPA 智能体",agentId:"智能体 ID",description:"描述",region:"部署地域",plan:"创建计划",sharedResources:"准备或复用账号共享 VPC、子网和 APIG 消息网关",agentResources:"准备独立业务库、技能空间和执行环境,部署智能体",readiness:"检查网关和智能体就绪状态,成功后加入列表",checking:"正在检查创建配置…",configured:"创建配置已就绪。提交后会检查云资源并开始准备。",notConfigured:"尚未配置创建所需的资源参数,请联系管理员配置后重试。",loadFailed:"检查创建配置失败,请重试。",reload:"重新检查",submit:"开始创建",retry:"重试创建",newAgent:"新建另一个智能体",newAgentDescription:"新建另一个智能体将开启可编辑的新请求,替换当前恢复草稿,但不会取消旧任务。旧任务仍在运行时,请等待其结束后再提交。",close:"关闭",cancel:"取消创建",confirmCancel:"确认取消",cancelDescription:"取消后会停止后续步骤。已创建的数据库、技能空间、网关和其他已登记资源会保留,可使用同一智能体 ID 重试。",background:"关闭窗口后创建会继续。再次打开可查看进度。",pollFailed:"暂时无法获取进度,正在重新连接。请勿重复创建其他智能体。",iamPermissionDenied:"部署服务没有准备运行角色所需的 IAM 权限,请联系管理员授权后重试。",iamTrustConflict:"运行角色的信任关系不符合要求,请管理员检查对 VeFaaS 和 APIG 的授权后重试。",iamPolicyConflict:"运行角色所需的同名权限策略内容冲突,请管理员检查后重试。",iamOwnershipConflict:"运行角色与当前部署账号不匹配,请管理员检查后重试。",iamVerificationFailed:"尚未确认运行角色的权限已就绪,请检查 IAM 服务及策略可用性后重试。",iamConfigurationConflict:"自动准备运行角色仅支持默认 MPA 角色,请检查服务端创建配置。",creationFailed:"当前步骤未完成,请检查对应资源、服务端配置及权限后,用同一智能体 ID 重试。",cancelFailed:"取消请求失败,请重新查询进度后重试。",cancelled:"创建已取消,已登记资源保留供重试。",timeout:"创建超时,已登记资源保留。请检查对应资源后重试。",interrupted:"创建任务中断。请用同一智能体 ID 重试以恢复已登记资源。",skillSpace:"技能空间",states:{running:"正在创建",cancelling:"正在取消",succeeded:"创建成功",failed:"创建失败",cancelled:"已取消"},stages:{queued:"等待开始",iam_role:"准备运行角色",checking:"检查账号与配置",network:"准备 VPC 和子网",gateway:"准备 APIG 和 IM Gateway",database:"准备业务数据库",skills:"准备技能空间",worker:"准备执行环境",deploying:"准备数据库、技能空间和 Runtime",verifying:"等待智能体就绪",admin_workspace:"准备管理 PG Workspace",business_workspace:"准备业务 PG Workspace",admin_database:"初始化共享管理库"},back:"继续创建",pgAutoDescription:"使用 VeADK 部署账号自动创建或复用两个 PG Workspace:mpa_admin_workspace / mpa_admin_db 存放共享资源记录,业务 Workspace 供多个智能体共用,每个智能体拥有独立业务库。无需填写 PG 连接信息,提交创建后开始准备。",pgModeChanged:"此创建任务使用旧的 PG 配置,不能直接切换为自动模式重试。请联系管理员确认已有资源和任务后重新创建。",pgMigrationRequired:"检测到旧共享注册库。请先将共享资源记录迁移到 mpa_admin_workspace / mpa_admin_db,并完成现有 Runtime 的注册库地址切换;完成后点击“重新检查”。"}},g1e={library:"技能库",skill:"技能",skills:"技能",skillSpace:"技能空间",sandboxNotConfigured:"管理员未配置 Dev Sandbox",adminNotConfigured:"管理员未配置",totalItems:"共 {{count}} 项",cannotLoadSpaces:"无法加载技能空间",someSpacesFailed:"部分技能空间加载失败",degradedRelationWarning:"部分关联异常,已恢复可读取技能",downloadZip:"下载 ZIP",optimize:"优化",closeSkillDetails:"关闭技能详情",skillId:"技能 ID",allFiles:"完整文件",loadingSkillContent:"正在读取技能内容…",noSkillContent:"该技能暂无 SKILL.md 内容",addSkill:"添加技能",localUpload:"本地上传",localUploadDescription:"选择 ZIP 文件,校验通过后上传到技能空间",autoCreate:"自动创建",autoCreateDescription:"选择模型和风格,通过对话生成技能",createSkill:"创建技能",optimizeNamed:"优化 {{name}}",deleteSkillConfirm:"确定删除整个 Skill“{{name}}”吗?此操作会影响所有引用它的空间。",deleteSpaceConfirm:"确定删除 Skill 空间“{{name}}”吗?请先确认空间中的技能已删除。",manageSpaceDescription:"管理空间中的技能并创建新的版本",backToSpaces:"返回技能空间列表",overview:"概览",skillCount:"技能数量",skillCountValue_one:"{{count}} 技能",skillCountValue_other:"{{count}} 技能",updatedAt:"更新时间",skillsInSpace:"{{name}}中的技能",searchSkills:"搜索技能",cannotLoadSkills:"无法加载技能",noMatchingSkills:"没有匹配的技能",noSkills:"暂无技能",tryAnotherName:"请尝试搜索其他名称",emptySkillsDescription:"本地上传 Skill,或自动创建",actions:"操作",spaceDetails:"技能空间详情",editSpace:"编辑空间",deleteSpace:"删除空间",searchSpaces:"搜索技能空间",spaceList:"技能空间列表",noMatchingSpaces:"没有匹配的技能空间",createSpace:"新建技能空间",newSpace:"新建空间",loadingMoreSpaces:"正在加载更多技能空间",scrollForMore:"继续下滑加载更多",allSpacesLoaded:"已加载全部技能空间",errors:{loadSpaces:"读取技能空间失败,请稍后重试",loadSkills:"读取技能失败,请稍后重试",loadSkillDetails:"读取技能详情失败,请稍后重试",deleteSkill:"删除 Skill 失败",deleteSpace:"删除 Skill 空间失败",downloadSkill:"下载 Skill 失败"},status:{active:"可用",available:"可用",creating:"创建中",disabled:"已停用",enabled:"已启用",failed:"异常",inactive:"未启用",pending:"等待中",published:"已发布",ready:"就绪",released:"已发布",running:"运行中",success:"正常",unavailable:"不可用",unreleased:"未发布",updating:"更新中",unknown:"未知"},sharedSpace:"企业共享空间",sharedDescription:"面向企业全员开放的技能,由管理员统一发布和维护",sharedVisibility:"全员可见",sharedPreparing:"正在准备共享空间",sharedLoadFailed:"共享空间加载失败",sharedEmpty:"暂无共享技能,管理员发布后会显示在这里",requestPublication:"申请公开",reviewSubmitting:"提交中…",reviewSubmitted:"已申请",reviewFailed:"申请公开失败",reviewStatusFailed:"审核状态加载失败",reviewRetry:"重新申请",reviewPending:"待审核",reviewApproving:"发布中",reviewApproved:"已公开",reviewReturned:"已退回",reviewHistory:"审核记录",skillDetailSections:"技能详情内容",versions:{title:"版本管理",refresh:"刷新",uploading:"上传中…",upload:"上传新版本",close:"关闭",hint:"新版本不会替换已公开版本,审核通过后才会公开;ZIP 中的技能名称需与原技能一致",loading:"正在加载版本…",loadFailed:"无法加载版本",filesFailed:"无法加载版本文件",uploadFailed:"上传新版本失败",submitFailed:"提交申请失败",retry:"重试",empty:"暂无版本",current:"当前版本",notSubmitted:"未申请公开",submitting:"提交中…",submit:"申请公开",processing:"版本状态:{{status}}",filesLoading:"正在加载文件…",filesEmpty:"暂无文件",history:"历史审核记录",shared:"已公开"},author:"作者",authorName:"作者:{{name}}"},b1e={library:"知识库",createBase:"新建知识库",editBase:"编辑知识库",invalidName:"名称必须以字母开头,且只能包含字母、数字和下划线。",nameHelp:"以字母开头,仅支持字母、数字和下划线,最多 48 个字符。",optionalDescription:"描述(可选)",descriptionOnly:"AgentKit 当前仅支持更新知识库描述。",previewWeb:"预览网页内容",addData:"添加数据",openOriginalWeb:"打开原网页",backToEdit:"返回修改",confirmAdd:"确认添加",source:"知识来源",image:"图片",documentFile:"文档文件",webPage:"在线网页",webUrl:"网页 URL",generatingWebPreview:"正在抓取网页并生成 Markdown 预览",selectFile:"选择知识文件",selectOrDropFile:"选择文件或拖拽到这里",selectedFile:"{{size}} · 点击可重新选择",imageFileHelp:"支持 PNG、JPG 和 JPEG,单个文件不超过 200 MB",documentFileHelp:"支持 PDF、PPTX、DOCX、XLSX 和 TXT,单个文件不超过 200 MB",uploadingFile:"正在上传文件并添加到知识库",optionalName:"名称(可选)",optionalType:"类型(可选)",generatePreview:"生成预览",uploadFile:"上传文件",editMetadata:"编辑知识 Metadata",knowledge:"知识",field:"字段",value:"值",backToList:"返回知识库列表",metadataJson:"元数据(JSON)",provider:"服务提供方",knowledgeId:"知识库 ID",project:"项目",creator:"创建者",data:"数据",deleteInvalidAssociation:"删除失效关联",noData:"这个知识库还没有数据",addFirstData:"添加第一项数据",format:"格式",size:"大小",searchData:"搜索数据",searchLibraryData:"搜索知识库数据",associationInvalid:"关联已失效",providerMissing:"底层 Provider 知识库已不存在",noMatchingData:"没有匹配的数据",loadingMoreData:"正在加载更多数据",retryLoading:"重试加载",details:"知识库详情",searchBases:"搜索知识库",someBasesFailed:"部分知识库暂时无法加载,已展示其余可用内容。",noMatchingBases:"没有匹配的知识库",noManagePermission:"您没有管理此知识库的权限",loadingMoreBases:"正在加载更多知识库",deleteBaseTitle:"删除知识库?",deleteBaseDescription:"将删除 {{name}} 的 AgentKit 关联;如果它由 Studio 创建,也会同时删除 Provider 资源。此操作无法撤销。",deleteDocumentTitle:"删除知识?",deleteDocumentDescription:"将从 Provider 知识库中删除 {{name}},此操作无法撤销。",preview:{processingTitle:"数据正在处理中",processingDetail:"知识库完成解析后即可预览,请稍后重新加载。",failedTitle:"数据解析失败",failedDetail:"请检查源文件或网页地址后重新添加,也可以重新加载最新状态。",noParsedTitle:"暂时没有可预览的解析内容",noParsedDetail:"此类文件会在知识库完成解析后显示文本、表格或页面图片。",noMediaTitle:"暂时没有可预览的媒体内容",noMediaDetail:"知识库尚未返回可访问的媒体预览,请稍后重新加载。",noDataTitle:"暂无可预览的数据内容",noDataDetail:"知识库尚未返回解析结果,请稍后重新加载。",attachmentError:"附件无法预览,请稍后重试。",imageAlt:"知识数据图片",audioUnsupported:"当前浏览器不支持音频预览。",videoUnsupported:"当前浏览器不支持视频预览。",namedPdf:"{{name}} PDF 预览",pdf:"PDF 预览",openPdf:"无法显示时,在新窗口打开 PDF",fileUnsupported:"当前格式暂不支持直接在线预览,已优先显示解析后的内容。",openOriginalFile:"打开原文件",loading:"正在加载数据预览",openOriginalHint:"您可以打开原网页查看来源内容。",chunk:"片段 {{index}}",loadingMore:"正在加载更多",loadMore:"加载更多"},errors:{fileTooLarge:"单个文件不能超过 200 MB",invalidImageType:"请选择 PNG、JPG 或 JPEG 图片",invalidDocumentType:"请选择 PDF、PPTX、DOCX、XLSX 或 TXT 文件",createBase:"创建知识库失败",updateBase:"更新知识库失败",metadataObject:"Metadata 必须是 JSON 对象",metadataFormat:"Metadata 格式错误",noWebPreview:"网页没有可预览的 Markdown 内容",addWeb:"添加网页失败",previewWeb:"生成网页预览失败",uploadFile:"上传文件失败",updateDocument:"更新知识失败",loadPreview:"加载数据预览失败",loadMoreBases:"加载更多知识库失败",loadBases:"加载知识库失败",loadMoreData:"加载更多数据失败",loadData:"加载数据失败",deleteBase:"删除知识库失败",deleteDocument:"删除知识失败"}},y1e={title:"飞书渠道",refresh:"刷新",loading:"正在加载渠道配置…",unsupported:"此 Runtime 不支持渠道管理,请升级 MPA 镜像。",unauthorized:"渠道管理需要 Studio 管理员身份及有效的 Runtime 凭据。",configurationError:"渠道管理配置不完整,请检查 Runtime 元数据及加密密钥。",requestFailed:"渠道请求失败,请检查 Runtime 连接后重试。",bound:"已绑定:{{name}}",unbound:"尚未绑定飞书机器人。",guidance:"私聊使用独立会话。在已授权群内 @ 当前机器人即可对话。",keyRequired:"绑定前请在 Runtime 配置持久的 CHANNEL_STATE_ENCRYPTION_KEY。",gateway:"消息网关",route:"入站路由",delivery:"回复投递",configured:"已配置",missing:"未配置",delivery_not_observed:"尚未观测",delivery_delivered:"已投递",delivery_retrying:"重试中",missingConfig:"缺少 Runtime 配置:{{fields}}",bind:"扫码绑定",newQr:"重新生成二维码",unbind:"解除绑定",confirmUnbind:"确认解绑此机器人?解绑后将停止接收新消息。",qrAlt:"机器人绑定二维码",openQr:"打开授权页面",uncertain:"注册过程已中断。重新开始前,请检查机器人绑定与 Gateway 状态。",bindingFailed:"绑定失败,请检查 Gateway 配置后重试。",chatId:"允许的群 ID",scope:"群会话策略",saveGroup:"保存群权限",noGroups:"尚未授权任何群。私聊无需群权限。",edit:"编辑",remove:"移除",removeGroup:"移除 {{name}}",scope_group_sender:"按发言人隔离",scope_group:"全群共享",scope_group_topic_sender:"按话题和发言人隔离",scope_group_topic:"按话题共享",status_PENDING:"等待扫码",status_SCANNED:"已扫码,等待授权",status_AUTHORIZED:"已授权,准备注册",status_REGISTERING:"正在注册机器人",status_BOUND:"机器人已绑定",status_FAILED:"绑定失败",status_EXPIRED:"二维码已过期",workspaceTitle:"消息渠道",workspaceDescription:"连接消息平台,让用户直接与此智能体对话,并管理访问权限。",provider_feishu:"飞书",provider_wecom:"企业微信",provider_dingtalk:"钉钉",comingSoon:"暂未开放",unavailableDescription:"{{name}}的绑定与消息配置暂未开放。",runtimeRequired:"请先将此智能体部署到 Runtime,再配置消息渠道。",bindingTitle:"机器人绑定",connected:"已绑定",notBound:"未绑定",gatewayDescription:"用于接收渠道消息的网关配置。",routeDescription:"将渠道消息转发给当前智能体的路由配置。",deliveryDescription:"实际观测到的回复投递状态,完成配置不代表已成功投递。",groupsTitle:"群聊权限",groupsDescription:"添加允许访问的群,并设置群内对话的共享范围。",providerBindingTitle:"绑定{{name}}",providerUnbound:"绑定{{name}}机器人,让用户通过消息与此智能体对话。",qrGuidance:"使用{{name}}扫码授权,Runtime 将保存机器人凭据并配置消息网关。",wecomGuidance:"使用企业微信扫码授权,或手动填写 Bot ID 和 Secret 绑定已有机器人。",wecomBotId:"Bot ID",wecomSecret:"Secret",bindCredentials:"绑定机器人",wecomScan:"扫码绑定",wecomAuthorizing:"等待企业微信授权…",cancelAuthorization:"取消授权",wecomPopupBlocked:"授权窗口被浏览器拦截,请允许弹窗后重试。",wecomAuthCancelled:"已取消企业微信授权,可以重新扫码。",wecomAuthTimeout:"企业微信授权已超时,请重新扫码。",wecomInvalidResult:"授权结果缺少 Bot ID 或 Secret,请重新授权或手动填写。",wecomAuthFailed:"企业微信授权失败,请重试或手动填写凭据。",dingtalkClientId:"Client ID",dingtalkClientSecret:"Client Secret",manualUpgrade:"当前镜像尚不支持{{name}}手动配置,请升级后使用;仍可使用极速配置。",pairingTitle:"消息渠道扫码配对",feishuPairingDescription:"如果已有连接机器人,飞书扫码并绑定成功后原有机器人会被替换,可选绑定存量机器人或新建机器人。",generatingQr:"正在生成配对二维码…",dingtalkGuidance:"使用钉钉扫码授权,或手动填写 Client ID 和 Client Secret 绑定已有机器人。",wecomPairingDescription:"将在企业微信授权窗口中重新扫码配对。新机器人绑定成功后会替换当前连接;取消授权或绑定失败不会解绑原机器人。",configurationMethod:"配置方式",quickSetup:"极速配置",manualSetup:"手动配置",feishuAppId:"App ID",feishuAppSecret:"App Secret",manualGuidance:"填写已有{{name}}机器人的应用凭据,连接到当前智能体。",manualReplacement:"绑定成功后将替换当前机器人;取消或绑定失败不会解除现有绑定。"},WVe={common:Xwe,agentKitPromo:Ywe,systemInfo:Zwe,agentWorkspace:Jwe,environmentCenter:e1e,deploymentSelect:t1e,deploymentError:n1e,studioBuildProgress:i1e,cloudEnvironment:r1e,githubCicd:s1e,feishuDeployment:a1e,deploymentResources:o1e,studioUpdate:l1e,projectPreview:c1e,workspace:u1e,resourceCollection:d1e,skillSourcePicker:f1e,composer:h1e,agentSelector:p1e,myAgents:m1e,skillCenter:g1e,knowledge:b1e,channels:y1e},KVe=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:Ywe,agentSelector:p1e,agentWorkspace:Jwe,channels:y1e,cloudEnvironment:r1e,common:Xwe,composer:h1e,default:WVe,deploymentError:n1e,deploymentResources:o1e,deploymentSelect:t1e,environmentCenter:e1e,feishuDeployment:a1e,githubCicd:s1e,knowledge:b1e,myAgents:m1e,projectPreview:c1e,resourceCollection:d1e,skillCenter:g1e,skillSourcePicker:f1e,studioBuildProgress:i1e,studioUpdate:l1e,systemInfo:Zwe,workspace:u1e},Symbol.toStringTag,{value:"Module"})),v1e="用户管理",x1e="{{count}} 位成员",w1e="用户",O1e="角色",k1e="账号状态",S1e="最近登录",E1e="操作",C1e="更改角色",A1e="关闭",T1e="保存角色",_1e="正在保存…",j1e="取消",N1e="返回",R1e="用户池",I1e="火山引擎 Identity",P1e="搜索姓名、邮箱或用户 ID",D1e="搜索",M1e="筛选角色",L1e="全部角色",$1e="刷新",F1e="正在读取用户…",B1e="更新于 {{time}}",U1e="已将 {{name}} 设置为{{role}}",Q1e="重试",z1e="你",V1e="初始超级管理员",H1e="初始超级管理员受保护,不能在此降级",q1e="保存后,对方刷新 Studio 即可使用新的权限",W1e="角色需要重新确认",K1e="没有匹配的用户",G1e="尝试其他关键词或角色",X1e="用户登录或加入当前用户池后会显示在这里",Y1e="共 {{count}} 位用户",Z1e="上一页",J1e="下一页",eOe="尚未登录",tOe="未提供",nOe={super_admin:"超级管理员",admin:"管理员",developer:"开发者",user:"普通用户"},iOe={super_admin:"管理所有资源,并管理用户和分配角色",admin:"管理 Studio 资源",developer:"开发智能体并管理自己的资源",user:"使用智能体和个人功能"},rOe={EXTERNAL_PROVIDER:"正常",CONFIRMED:"正常",NORMAL:"正常",ENABLED:"正常",ACTIVE:"正常",UNCONFIRMED:"待验证",DISABLED:"已停用",FORBIDDEN:"已禁用",LOCKED:"已锁定",SUSPENDED:"已暂停",FORCE_CHANGE_PASSWORD:"需要修改密码"},sOe={request_failed:"请求未完成,请刷新列表确认当前状态后重试",invalid_response:"用户服务返回异常,请刷新后重试",identity_unavailable:"暂时无法访问 Identity,请稍后重试或检查服务权限",identity_resource_missing:"用户或用户池已不存在,请刷新列表",super_administrator_required:"只有超级管理员可以管理用户",sign_in_required:"请登录后重试",user_not_in_pool:"当前账号不属于此用户池",user_disabled:"当前账号已停用",protected_administrator:"不能降低初始超级管理员的权限",cannot_demote_self:"不能降低自己的超级管理员权限",role_change_conflict:"角色已发生变化,请关闭弹窗并刷新列表后重试",cross_origin_request:"请在当前 Studio 页面内修改角色"},GVe={title:v1e,memberCount:x1e,user:w1e,role:O1e,status:k1e,lastLogin:S1e,actions:E1e,changeRole:C1e,close:A1e,save:T1e,saving:_1e,cancel:j1e,back:N1e,pool:R1e,volcengineIdentity:I1e,searchPlaceholder:P1e,search:D1e,filterRole:M1e,allRoles:L1e,refresh:$1e,loading:F1e,updatedAt:B1e,saved:U1e,retry:Q1e,you:z1e,initialAdministrator:V1e,protectedExplanation:H1e,effectiveAfterRefresh:q1e,roleConflict:W1e,noUsers:K1e,tryAnotherSearch:G1e,poolEmpty:X1e,resultCount:Y1e,previous:Z1e,next:J1e,neverLoggedIn:eOe,unknown:tOe,roles:nOe,descriptions:iOe,states:rOe,errors:sOe},XVe=Object.freeze(Object.defineProperty({__proto__:null,actions:E1e,allRoles:L1e,back:N1e,cancel:j1e,changeRole:C1e,close:A1e,default:GVe,descriptions:iOe,effectiveAfterRefresh:q1e,errors:sOe,filterRole:M1e,initialAdministrator:V1e,lastLogin:S1e,loading:F1e,memberCount:x1e,neverLoggedIn:eOe,next:J1e,noUsers:K1e,pool:R1e,poolEmpty:X1e,previous:Z1e,protectedExplanation:H1e,refresh:$1e,resultCount:Y1e,retry:Q1e,role:O1e,roleConflict:W1e,roles:nOe,save:T1e,saved:U1e,saving:_1e,search:D1e,searchPlaceholder:P1e,states:rOe,status:k1e,title:v1e,tryAnotherSearch:G1e,unknown:tOe,updatedAt:B1e,user:w1e,volcengineIdentity:I1e,you:z1e},Symbol.toStringTag,{value:"Module"})),aOe="网站集成",oOe="将 AgentKit Runtime 以悬浮聊天窗口嵌入网站",lOe="返回自动化列表",cOe="添加网站",uOe="正在加载 Runtime",dOe="选择 Runtime",fOe="网站域名",hOe="例如 xxxx.com 或 localhost:5173",pOe="正在生成",mOe="生成 Token",gOe="已添加网站",bOe="{{count}} 个",yOe="{{count}} 个",vOe="正在加载网站集成",xOe="还没有网站集成",wOe="选择 Runtime 并输入网站域名即可生成 Token",OOe="引入方法",kOe="将下面代码放到网页的 body 结束标签前",SOe="已复制",EOe="复制代码",COe="添加网站后会在这里生成引入代码。",AOe="确定删除 {{domain}} 的网站集成吗?",TOe={load:"加载网站集成失败",create:"创建网站集成失败",delete:"删除网站集成失败",noConversationalAgent:"该 Runtime 暂未发现可对话的 Agent"},_Oe={requestFailed:"请求失败 ({{status}})",greeting:"您好,有什么可以帮您?",sessionFailed:"无法建立对话会话",unauthorized:"当前网站未获得对话授权",conversationFailed:"对话请求失败,请稍后重试",open:"打开智能体对话",close:"关闭智能体对话",panelLabel:"智能体对话面板",assistant:"智能体助手",online:"在线对话"},YVe={title:aOe,description:oOe,backToAutomations:lOe,addWebsite:cOe,loadingRuntime:uOe,selectRuntime:dOe,websiteDomain:fOe,domainPlaceholder:hOe,generating:pOe,generateToken:mOe,addedWebsites:gOe,websiteCount_one:bOe,websiteCount_other:yOe,loadingIntegrations:vOe,delete:"删除",emptyTitle:xOe,emptyDescription:wOe,embedMethod:OOe,embedInstructions:kOe,copied:SOe,copyCode:EOe,embedHint:COe,confirmDelete:AOe,errors:TOe,widget:_Oe},ZVe=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:cOe,addedWebsites:gOe,backToAutomations:lOe,confirmDelete:AOe,copied:SOe,copyCode:EOe,default:YVe,description:oOe,domainPlaceholder:hOe,embedHint:COe,embedInstructions:kOe,embedMethod:OOe,emptyDescription:wOe,emptyTitle:xOe,errors:TOe,generateToken:mOe,generating:pOe,loadingIntegrations:vOe,loadingRuntime:uOe,selectRuntime:dOe,title:aOe,websiteCount_one:bOe,websiteCount_other:yOe,websiteDomain:fOe,widget:_Oe},Symbol.toStringTag,{value:"Module"})),jOe={types:{all:"全部类型",document:"文档",image:"图片",video:"视频"},previewArtifact:"预览 {{name}}",moreActions:"更多操作 {{name}}",actionMenu:"{{name}} 操作",download:"下载",downloading:"下载中",edit:"编辑信息",delete:"删除产物",previewFailed:"无法预览“{{name}}”:{{message}}",downloadStarted:"已开始下载 {{name}}",downloadFailed:"无法下载“{{name}}”:{{message}}",updated:"已更新 {{name}}",deleted:"已删除 {{name}}",deleteFailed:"无法删除“{{name}}”:{{message}}",typeFilter:"产物类型",searchAria:"搜索产物",searchPlaceholder:"搜索产物或会话",retry:"重试",close:"关闭",listAria:"产物列表",loadFailed:"产物加载失败",loadDetailFallback:"请检查存储配置后重试。",reload:"重新加载",noMatch:"没有找到匹配的产物",noArtifacts:"您还没有任何产物",searchHint:"请尝试搜索其他名称或切换类型",emptyHint:"聊天中生成的产物会自动显示在这里",columns:{name:"名称",source:"来源",updatedAt:"修改时间",actions:"操作"},loadingMore:"正在加载更多产物",unknownTime:"时间未知",preview:{close:"关闭预览",meta:"{{type}} / 版本 {{version}}",loading:"正在加载预览",alt:"{{name}} 预览",loadFailed:"预览加载失败,请稍后重试或下载查看",unsupported:"当前格式暂不支持在线预览,请下载查看",sourceAria:"产物来源",agent:"智能体",session:"会话",tool:"生成工具",createdAt:"生成时间",fileSize:"文件大小",tags:"标签",viewSession:"查看会话"},deleteDialog:{title:"删除产物?",description:"“{{name}}”将从产物库永久删除,聊天记录不会受到影响。",deleting:"删除中",confirm:"删除",close:"关闭删除确认框"},api:{withStatus:"{{message}}({{status}})",listFailed:"读取产物库失败",syncFailed:"同步聊天产物失败",updateFailed:"更新产物失败",deleteFailed:"删除产物失败",downloadFailed:"下载产物失败"}},NOe={unknownSource:"未知来源",unknownCreator:"未知创建者"},ROe={nameRequired:"请输入产物名称",tooManyTags:"标签最多 {{max}} 个",tagTooLong:"单个标签不能超过 {{max}} 个字符",title:"编辑产物信息",subtitle:"内容文件不会被修改",close:"关闭编辑框",name:"名称",description:"描述",descriptionPlaceholder:"补充用途、版本或使用说明",tags:"标签",tagsPlaceholder:"使用逗号分隔,最多 {{max}} 个",cancel:"取消",saving:"保存中",save:"保存"},IOe={change:{added:"新增",modified:"修改",deleted:"删除"},noChanges:"两个版本的源码没有差异",chooseFile:"从左侧选择文件以查看代码",compareTitle:"版本对比",workspaceTitle:"源码工作区",projectFallback:"Agent 项目",switchTheme:"切换源码主题",switchThemeTitle:"切换为{{theme}}主题",themes:{dark:"深色",light:"浅色"},closeWorkspace:"关闭源码工作区",close:"关闭",changedFiles:"变更文件",projectFiles:"项目文件",changes:"变更",files:"文件",openFiles:"打开的文件",noFileSelected:"未选择文件",comparisonDirection:"对比方向",before:"优化前",after:"优化后",loadingEditor:"正在加载编辑器…",changedFileCount_one:"{{count}} 个文件有变更",changedFileCount_other:"{{count}} 个文件有变更",fileCount_one:"{{count}} 个文件",fileCount_other:"{{count}} 个文件",lineCount_one:"{{count}} 行 · UTF-8",lineCount_other:"{{count}} 行 · UTF-8",viewSource:"查看源码",viewSourceAria:"查看和编辑项目源码"},POe={nav:"搜索",selectAgent:"请选择 Agent",checkingCapabilities:"正在检测 Agent 能力",notMounted:"当前 Agent 未挂载{{label}}",sources:{session:"会话",web:"网络",knowledge:"知识库",memory:"长期记忆"},webDescription:"通过 web_search 工具检索",backendLocal:"本地",failed:"搜索失败:{{message}}",placeholder:{selectAgent:"请先选择 Agent",web:"在网络中检索",knowledge:"在 {{name}} 中检索",knowledgeFallback:"当前 Agent 的知识库",memory:"在 {{name}} 中检索",memoryFallback:"当前用户的长期记忆",session:"在当前 Agent 的会话中检索"},sourceTypeAria:"搜索类型:{{label}}",notSelected:"未选择",sourceType:"搜索类型",selectSource:"选择搜索类型",noAgentHint:"选择一个 Agent 后,即可检索会话、网络及其挂载的数据源。",loadingCapabilities:"正在读取当前 Agent 的检索能力…",sourceUnavailable:"当前 Agent 未挂载该数据源",instructions:{web:"输入关键词后回车或点击按钮,通过 web_search 工具检索。",knowledge:"输入问题,检索当前 Agent 挂载的知识库。",memory:"输入线索,检索当前用户跨会话保存的长期记忆。",session:"输入关键词后回车或点击按钮,搜索当前 Agent 的会话。"},noResults:"未找到匹配“{{query}}”的结果。",knowledgeFragment:"知识片段 {{index}}",memoryFragment:"记忆片段 {{index}}"},DOe={title:"开发者资源",sections:{documentation:{title:"相关链接",description:"查看开发文档与 AgentKit 常用入口"},bestPractices:{title:"最佳实践",description:"参考开发、调试与部署经验"},showcases:{title:"案例展示",description:"探索 AgentKit 应用案例"}},links:{veadkDocs:"VeADK 文档",cliDocs:"AgentKit CLI 文档",platformDocs:"AgentKit 平台文档",console:"AgentKit 控制台"},articles:{veadkDevelopment:{title:"使用 VeADK 开发并部署智能体",description:"使用 VeADK 构建 Agent,并部署至 AgentKit 智能体运行时。"},cliDevelopment:{title:"使用 AgentKit CLI 开发并部署智能体",description:"通过 AgentKit CLI 创建项目、调试 Agent,并完成部署。"},coverAlt:"{{title}}文章封面"},showcases:{researchAssistant:{title:"多智能体研究助手",description:"由多个专业 Agent 协同完成资料检索、分析和结论整理。"},multimodalAnalysis:{title:"多模态内容分析",description:"在统一会话中理解图片、文档和视频内容。"},customerService:{title:"智能客服工作台",description:"结合知识检索与工具调用处理复杂的客户服务任务。"},webSearch:{title:"联网搜索 Agent",description:"检索实时网页内容,并将信息整理为可追溯的回答。"},a2uiApp:{title:"A2UI 交互应用",description:"让 Agent 根据任务过程生成可交互的前端界面。"},previewAlt:"{{title}}界面预览"}},MOe={title:"资源库",untitledSession:"未命名会话",categoryAria:"资源库分类",regionAria:"区域",tabs:{skills:"技能库",knowledge:"知识库",artifacts:"产物"}},LOe={title:"管理 Agent",subtitle:"列出你有权管理的 AgentKit Runtime",mainAgentOnly:"仅显示主 Agent(控制面信息)。",deleteConfirm:'确定删除 Agent "{{name}}"?该 Runtime 将被永久删除。',regionFilterTitle:"按区域筛选",regionFilterAria:"区域筛选",regionAria:"区域",refresh:"刷新",loading:"加载中…",empty:"暂无你部署的 Agent。",connected:"已连接",connect:"连接到此 Agent",deleteRuntime:"删除该 Runtime",loadingDetail:"读取详情…",agentStructure:"Agent 结构",secretHidden:"敏感值不展示,可通过授权请求直接复制",revealSecret:"{{key}} 的敏感值",copySecret:"复制 {{key}} 的值",copy:"复制",copied:"已复制",copyFailed:"复制失败",notConfigured:"未配置",fields:{model:"模型",description:"描述",status:"状态信息",project:"项目",version:"版本",resources:"资源",memory:"记忆",tool:"工具",knowledge:"知识",mcpToolset:"MCP 工具集",updatedAt:"更新时间"},resource:{memory:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",concurrency:"并发 {{value}}"},environmentVariables:"环境变量",unnamed:"(未命名)"},$Oe={mainAgent:"主 Agent",subAgent:"子 Agent {{index}}",itemCount_one:"{{count}} 项",itemCount_other:"{{count}} 项",info:"Agent 信息",infoAndTopology:"Agent 信息与设置",loadingInfo:"正在读取 Agent 信息…",unnamedAgent:"未命名 Agent",agentsMd:"AGENTS.md",tools:"工具",toolList:"工具列表",studioTool:"Studio Tool",removeTool:"移除工具 {{name}}",remove:"移除",notConfigured:"未配置",addStudioTool:"添加 Studio 工具",addStudioToolHere:"在此对话中添加 Studio 工具",skills:"技能",skillList:"技能列表",addSkill:"添加技能空间技能",addSkillHere:"向此会话添加技能空间技能",skillMountNextTurn:"挂载的版本将在下一 Turn 开始时冻结。",previewUnsupported:"暂不支持预览",sessionEnvironment:"会话环境",environment:"环境",agentCanvas:"Agent 画布",topology:"结构拓扑",nodeKinds:{agent:"Agent",sandbox:"沙箱","worker-session":"Worker 会话","skill-space":"技能空间",skill:"技能","studio-tool":"Studio 工具",mcp:"MCP",environment:"环境",knowledge:"知识库","sub-agent":"子 Agent"},nodeStatuses:{configured:"已配置",mounted:"已挂载",running:"运行中",paused:"已暂停"},viewCanvasFullscreen:"全屏查看 Agent 画布",viewFullscreen:"全屏查看",executionCanvas:"Agent 执行画布",fullscreenExecutionCanvas:"全屏 Agent 执行画布",closeFullscreenCanvas:"关闭全屏画布",close:"关闭",capabilitiesSubtitle:"能力与协作拓扑",closeInfo:"关闭 Agent 信息",infoUnavailable:"暂时无法读取 Agent 信息。",refresh:"刷新信息",loadingSkills:"正在加载绑定技能…",sessionSkills:"本会话临时技能",noBoundSpace:"当前智能体未绑定技能空间。",noBoundSkills:"绑定的技能空间暂无技能。",loadFailed:"加载失败,请刷新重试。",accessDenied:"无权读取此信息。",documentUnsupported:"当前 Runtime 不支持 Studio 读取 AGENTS.md,请升级 Runtime 镜像。",skillsUnsupported:"当前 Runtime 未提供技能空间绑定信息。",skillsDegraded:"技能信息不完整,请刷新重试。",documentEditHint:"编辑最新版本。保存会发布新版本到此技能空间,可能影响使用它的其他智能体。运行中的会话可能需要等待缓存刷新或新建会话后生效。请保留 frontmatter 中的 name。",documentLoading:"正在加载 SKILL.md…",documentWritable:"可编辑",documentReadOnly:"只读:此空间或当前权限不允许编辑",documentLoadFailed:"无法加载 SKILL.md,请刷新重试。",documentSaveFailed:"未确认保存成功,已保留编辑内容。重试前请重新打开,检查当前版本。",documentConflict:"技能已有新版本。请复制当前修改,再重新打开编辑器,避免覆盖。",discardDocument:"放弃未保存的修改?",keepEditing:"继续编辑",discardChanges:"放弃修改",saveDocument:"保存为新版本"},FOe={mountFailed:"挂载环境失败",closeDialog:"关闭环境弹窗",addTitle:"添加环境",description:"选择当前会话允许 Agent 使用的 Sandbox 环境",closeAdd:"关闭添加环境",searchAria:"搜索环境",searchPlaceholder:"搜索环境名称或能力",availableAria:"可用环境与工作区",loading:"正在读取可用环境…",noMatch:"没有匹配的环境或工作区",workspaces:"工作区",reuseAll:"复用工作区中的全部可用环境",availableEnvironmentCount_one:"{{count}} 个可用环境",availableEnvironmentCount_other:"{{count}} 个可用环境",selectWorkspace:"选择工作区 {{name}}",environments:"环境",includedByWorkspaces:"已由工作区 {{names}} 包含",nameSeparator:"、",selectEnvironment:"选择环境 {{name}}",selectedWorkspaceCount_one:"{{count}} 个工作区",selectedWorkspaceCount_other:"{{count}} 个工作区",coveredEnvironmentCount_one:"{{count}} 个环境",coveredEnvironmentCount_other:"{{count}} 个环境",selectionSummary:"已选择 {{workspaces}},覆盖 {{environments}}",cancel:"取消",mounting:"正在挂载…",confirm:"确认添加",mountedAria:"已挂载环境",environmentCount_one:"{{count}} 个环境",environmentCount_other:"{{count}} 个环境",removeWorkspace:"移除工作区 {{name}}",remove:"移除",removeEnvironment:"移除环境 {{name}}",add:"添加环境",addMore:"添加更多环境",addForSession:"为当前 Session 添加环境",loadingAvailable:"正在加载可用环境…",empty:"暂无可用的 AIO Sandbox 环境。"},BOe={loading:{searching:"正在查找已有环境",creating:"环境初始化中",connecting:"正在连接已有环境"},initializationFailed:"AgentKit CLI 环境初始化失败,当前状态:{{status}}。",sessionExpired:"AgentKit CLI Session 不存在或已过期,请重试。",initializationTimeout:"AgentKit CLI 环境初始化超时,请稍后重试。",nonPersistent:"非持久化环境",recyclingHoursMinutes:"{{hours}} 小时 {{minutes}} 分钟后环境回收",recyclingMinutes:"{{minutes}} 分钟后环境回收",connectionError:`无法连接 Studio 服务,未收到服务端响应。 -原始错误:{{message}}`,unavailable:"连接不可用",requestFailed:"AgentKit CLI 请求失败",retry:"重试",terminalTitle:"AgentKit CLI 终端"},UOe={labels:{coding:"智能编程",get_city_weather:"城市天气查询",get_location_weather:"位置天气查询",web_fetch:"网页内容获取",studio_write_artifact:"保存会话产物"},closeDialog:"关闭弹窗",title:"添加 Studio 工具",description:"由 Studio BFF 为 {{agentName}} 的当前会话执行,Runtime 无需预装",close:"关闭添加 Studio 工具",searchAria:"搜索 Studio 工具",searchPlaceholder:"搜索名称或工具标识",availableAria:"可用 Studio 工具",loading:"正在读取 Studio 工具…",noMatch:"没有匹配的 Studio 工具",remove:"移除",add:"添加"},QOe={artifactLibrary:jOe,resourceMetadata:NOe,artifactEdit:ROe,codeBrowser:IOe,search:POe,developerResources:DOe,library:MOe,manageAgents:LOe,agentTopology:$Oe,sessionEnvironment:FOe,agentKitCli:BOe,studioTools:UOe},JVe=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:BOe,agentTopology:$Oe,artifactEdit:ROe,artifactLibrary:jOe,codeBrowser:IOe,default:QOe,developerResources:DOe,library:MOe,manageAgents:LOe,resourceMetadata:NOe,search:POe,sessionEnvironment:FOe,studioTools:UOe},Symbol.toStringTag,{value:"Module"})),jU=["zh-CN","en-US"],yA="en-US",zOe="agentkit.studio.locale",eHe={"zh-CN":{dir:"ltr",nativeName:"简体中文"},"en-US":{dir:"ltr",nativeName:"English"}};function vA(e){if(!e)return null;const t=e.trim().replace(/_/g,"-").toLowerCase(),n=jU.find(i=>i.toLowerCase()===t);return n||(t==="zh"||t.startsWith("zh-")?"zh-CN":t==="en"||t.startsWith("en-")?"en-US":null)}function So(e,t){const n=(e==null?void 0:e.trim())??"";if(!n)return"";const i=new RegExp("\\p{Script=Han}","u").test(n);return t.toLowerCase().startsWith("zh")===i?n:""}function tHe(){if(typeof window>"u")return null;try{return vA(window.localStorage.getItem(zOe))}catch{return null}}function nHe(){if(typeof window>"u")return[];const e=window.navigator;return e?e.languages.length>0?e.languages:e.language?[e.language]:[]:[]}function iHe(){const e=tHe();if(e)return e;for(const t of nHe()){const n=vA(t);if(n)return n}return yA}function rHe(e){if(!(typeof window>"u"))try{window.localStorage.setItem(zOe,e)}catch{}}function VOe(e){typeof document>"u"||(document.documentElement.lang=e,document.documentElement.dir=eHe[e].dir)}const Zn=e=>typeof e=="string",YO=()=>{let e,t;const n=new Promise((i,r)=>{e=i,t=r});return n.resolve=e,n.reject=t,n},O5=e=>e==null?"":String(e),sHe=(e,t,n)=>{e.forEach(i=>{t[i]&&(n[i]=t[i])})},aHe=/###/g,DG=e=>e&&e.includes("###")?e.replace(aHe,"."):e,MG=e=>!e||Zn(e),NS=(e,t,n)=>{const i=Zn(t)?t.split("."):t;let r=0;for(;r{const{obj:i,k:r}=NS(e,t,Object);if(i!==void 0||t.length===1){i[r]=n;return}let s=t[t.length-1],o=t.slice(0,t.length-1),l=NS(e,o,Object);for(;l.obj===void 0&&o.length;)s=`${o[o.length-1]}.${s}`,o=o.slice(0,o.length-1),l=NS(e,o,Object),l!=null&&l.obj&&typeof l.obj[`${l.k}.${s}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${s}`]=n},oHe=(e,t,n,i)=>{const{obj:r,k:s}=NS(e,t,Object);r[s]=r[s]||[],r[s].push(n)},lR=(e,t)=>{const{obj:n,k:i}=NS(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,i))return n[i]},lHe=(e,t,n)=>{const i=lR(e,n);return i!==void 0?i:lR(t,n)},HOe=(e,t,n)=>{for(const i in t)i!=="__proto__"&&i!=="constructor"&&(Object.prototype.hasOwnProperty.call(e,i)?Zn(e[i])||e[i]instanceof String||Zn(t[i])||t[i]instanceof String?n&&(e[i]=t[i]):HOe(e[i],t[i],n):e[i]=t[i]);return e},qh=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),cHe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},uHe=e=>Zn(e)?e.replace(/[&<>"'\/]/g,t=>cHe[t]):e;class dHe{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const i=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,i),this.regExpQueue.push(t),i}}const fHe=[" ",",","?","!",";"],hHe=new dHe(20),pHe=(e,t,n)=>{t=t||"",n=n||"";const i=fHe.filter(o=>!t.includes(o)&&!n.includes(o));if(i.length===0)return!0;const r=hHe.getRegExp(`(${i.map(o=>o==="?"?"\\?":o).join("|")})`);let s=!r.test(e);if(!s){const o=e.indexOf(n);o>0&&!r.test(e.substring(0,o))&&(s=!0)}return s},dF=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const i=t.split(n);let r=e;for(let s=0;se==null?void 0:e.replace(/_/g,"-"),mHe={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var n,i;(i=(n=console==null?void 0:console[e])==null?void 0:n.apply)==null||i.call(n,console,t)}};class cR{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||mHe,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,i,r){return r&&!this.debug?null:(t=t.map(s=>Zn(s)?s.replace(/[\r\n\x00-\x1F\x7F]/g," "):s),Zn(t[0])&&(t[0]=`${i}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new cR(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new cR(this.logger,t)}}var ih=new cR;let YP=class{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const r=this.observers[i].get(n)||0;this.observers[i].set(n,r+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}once(t,n){const i=(...r)=>{n(...r),this.off(t,i)};return this.on(t,i),this}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([r,s])=>{for(let o=0;o{for(let o=0;o-1&&this.options.ns.splice(n,1)}getResource(t,n,i,r={}){var u,d;const s=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,o=r.ignoreJSONStructure!==void 0?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;t.includes(".")?l=t.split("."):(l=[t,n],i&&(Array.isArray(i)?l.push(...i):Zn(i)&&s?l.push(...i.split(s)):l.push(i)));const c=lR(this.data,l);return!c&&!n&&!i&&t.includes(".")&&(t=l[0],n=l[1],i=l.slice(2).join(".")),c||!o||!Zn(i)?c:dF((d=(u=this.data)==null?void 0:u[t])==null?void 0:d[n],i,s)}addResource(t,n,i,r,s={silent:!1}){const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let l=[t,n];i&&(l=l.concat(o?i.split(o):i)),t.includes(".")&&(l=t.split("."),r=n,n=l[1]),this.addNamespaces(n),LG(this.data,l,r),s.silent||this.emit("added",t,n,i,r)}addResources(t,n,i,r={silent:!1}){for(const s in i)(Zn(i[s])||Array.isArray(i[s]))&&this.addResource(t,n,s,i[s],{silent:!0});r.silent||this.emit("added",t,n,i)}addResourceBundle(t,n,i,r,s,o={silent:!1,skipCopy:!1}){let l=[t,n];t.includes(".")&&(l=t.split("."),r=i,i=n,n=l[1]),this.addNamespaces(n);let c=lR(this.data,l)||{};o.skipCopy||(i=JSON.parse(JSON.stringify(i))),r?HOe(c,i,s):c={...c,...i},LG(this.data,l,c),o.silent||this.emit("added",t,n,i)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(r=>n[r]&&Object.keys(n[r]).length>0)}toJSON(){return this.data}}var qOe={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,i,r){return e.forEach(s=>{var o;t=((o=this.processors[s])==null?void 0:o.process(t,n,i,r))??t}),t}};const WOe=Symbol("i18next/PATH_KEY");function gHe(){const e=[],t=Object.create(null);let n;return t.get=(i,r)=>{var s;return(s=n==null?void 0:n.revoke)==null||s.call(n),r===WOe?e:(e.push(r),n=Proxy.revocable(i,t),n.proxy)},Proxy.revocable(Object.create(null),t).proxy}function Uy(e,t){const{[WOe]:n}=e(gHe()),i=(t==null?void 0:t.keySeparator)??".",r=(t==null?void 0:t.nsSeparator)??":",s=(t==null?void 0:t.enableSelector)==="strict";if(n.length>1&&r){const o=t==null?void 0:t.ns,l=s?Array.isArray(o)?o:o?[o]:null:Array.isArray(o)?o:null;if(l&&(s?l:l.length>1?l.slice(1):[]).includes(n[0]))return`${n[0]}${r}${n.slice(1).join(i)}`}return n.join(i)}const k5=e=>!Zn(e)&&typeof e!="boolean"&&typeof e!="number";class uR extends YP{constructor(t,n={}){super(),sHe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=ih.create("translator"),this.checkedLoadedFor={}}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const i={...n};if(t==null)return!1;const r=this.resolve(t,i);if((r==null?void 0:r.res)===void 0)return!1;const s=k5(r.res);return!(i.returnObjects===!1&&s)}extractFromKey(t,n){let i=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const r=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let s=n.ns||this.options.defaultNS||[];const o=i&&t.includes(i),l=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!pHe(t,i,r);if(o&&!l){const c=t.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:t,namespaces:Zn(s)?[s]:s};const u=t.split(i);(i!==r||i===r&&this.options.ns.includes(u[0]))&&(s=u.shift()),t=u.join(r)}return{key:t,namespaces:Zn(s)?[s]:s}}translate(t,n,i){let r=typeof n=="object"?{...n}:n;if(typeof r!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),typeof r=="object"&&(r={...r}),r||(r={}),t==null)return"";typeof t=="function"&&(t=Uy(t,{...this.options,...r})),Array.isArray(t)||(t=[String(t)]),t=t.map(N=>typeof N=="function"?Uy(N,{...this.options,...r}):String(N));const s=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,o=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,{key:l,namespaces:c}=this.extractFromKey(t[t.length-1],r),u=c[c.length-1];let d=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;d===void 0&&(d=":");const f=r.lng||this.language,h=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((f==null?void 0:f.toLowerCase())==="cimode")return h?s?{res:`${u}${d}${l}`,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(r)}:`${u}${d}${l}`:s?{res:l,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(r)}:l;const m=this.resolve(t,r);let g=m==null?void 0:m.res;const b=(m==null?void 0:m.usedKey)||l,v=(m==null?void 0:m.exactUsedKey)||l,y=["[object Number]","[object Function]","[object RegExp]"],w=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,O=r.count!==void 0&&!Zn(r.count),k=uR.hasDefaultValue(r),S=O?this.pluralResolver.getSuffix(f,r.count,r):"",C=r.ordinal&&O?this.pluralResolver.getSuffix(f,r.count,{ordinal:!1}):"",E=O&&!r.ordinal&&r.count===0,j=E&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${S}`]||r[`defaultValue${C}`]||r.defaultValue;let T=g;x&&!g&&k&&(T=j);const R=k5(T),A=Object.prototype.toString.apply(T);if(x&&T&&R&&!y.includes(A)&&!(Zn(w)&&Array.isArray(T))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const N=this.options.returnedObjectHandler?this.options.returnedObjectHandler(b,T,{...r,ns:c}):`key '${l} (${this.language})' returned an object instead of string.`;return s?(m.res=N,m.usedParams=this.getUsedParamsDetails(r),m):N}if(o){const N=Array.isArray(T),P=N?[]:{},I=N?v:b;for(const D in T)if(Object.prototype.hasOwnProperty.call(T,D)){const _=`${I}${o}${D}`;k&&!g?P[D]=this.translate(_,{...r,defaultValue:k5(j)?j[D]:void 0,joinArrays:!1,ns:c}):P[D]=this.translate(_,{...r,joinArrays:!1,ns:c}),P[D]===_&&(P[D]=T[D])}g=P}}else if(x&&Zn(w)&&Array.isArray(g))g=g.join(w),g&&(g=this.extendTranslation(g,t,r,i));else{let N=!1,P=!1;!this.isValidLookup(g)&&k&&(N=!0,g=j),this.isValidLookup(g)||(P=!0,g=l);const D=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&P?void 0:g,_=k&&j!==g&&this.options.updateMissing;if(P||N||_){if(this.logger.log(_?"updateKey":"missingKey",f,u,O&&!_?`${l}${this.pluralResolver.getSuffix(f,r.count,r)}`:l,_?j:g),o){const V=this.resolve(l,{...r,keySeparator:!1});V&&V.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let L=[];const F=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&F&&F[0])for(let V=0;V{var z;const J=k&&U!==g?U:D;this.options.missingKeyHandler?this.options.missingKeyHandler(V,u,q,J,_,r):(z=this.backendConnector)!=null&&z.saveMissing&&this.backendConnector.saveMissing(V,u,q,J,_,r),this.emit("missingKey",V,u,q,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&O?L.forEach(V=>{const q=this.pluralResolver.getSuffixes(V,r);E&&r[`defaultValue${this.options.pluralSeparator}zero`]&&!q.includes(`${this.options.pluralSeparator}zero`)&&q.push(`${this.options.pluralSeparator}zero`),q.forEach(U=>{M([V],l+U,r[`defaultValue${U}`]||j)})}):M(L,l,j))}g=this.extendTranslation(g,t,r,m,i),P&&g===l&&this.options.appendNamespaceToMissingKey&&(g=`${u}${d}${l}`),(P||N)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${d}${l}`:l,N?g:void 0,r))}return s?(m.res=g,m.usedParams=this.getUsedParamsDetails(r),m):g}extendTranslation(t,n,i,r,s){var c,u;if((c=this.i18nFormat)!=null&&c.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const d=Zn(t)&&(((u=i==null?void 0:i.interpolation)==null?void 0:u.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(d){const m=t.match(this.interpolator.nestingRegexp);f=m&&m.length}let h=i.replace&&!Zn(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(h={...this.options.interpolation.defaultVariables,...h}),t=this.interpolator.interpolate(t,h,i.lng||this.language||r.usedLng,i),d){const m=t.match(this.interpolator.nestingRegexp),g=m&&m.length;f(s==null?void 0:s[0])===m[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${m[0]} in key: ${n[0]}`),null):this.translate(...m,n),i)),i.interpolation&&this.interpolator.reset()}const o=i.postProcess||this.options.postProcess,l=Zn(o)?[o]:o;return t!=null&&(l!=null&&l.length)&&i.applyPostProcessor!==!1&&(t=qOe.handle(l,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),t}resolve(t,n={}){let i,r,s,o,l;return Zn(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(c=>typeof c=="function"?Uy(c,{...this.options,...n}):c)),t.forEach(c=>{if(this.isValidLookup(i))return;const u=this.extractFromKey(c,n),d=u.key;r=d;let f=u.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const h=n.count!==void 0&&!Zn(n.count),m=h&&!n.ordinal&&n.count===0,g=n.context!==void 0&&(Zn(n.context)||typeof n.context=="number")&&n.context!=="",b=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(v=>{var y,w;this.isValidLookup(i)||(l=v,!this.checkedLoadedFor[`${b[0]}-${v}`]&&((y=this.utils)!=null&&y.hasLoadedNamespace)&&!((w=this.utils)!=null&&w.hasLoadedNamespace(l))&&(this.checkedLoadedFor[`${b[0]}-${v}`]=!0,this.logger.warn(`key "${r}" for languages "${b.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),b.forEach(x=>{var S;if(this.isValidLookup(i))return;o=x;const O=[d];if((S=this.i18nFormat)!=null&&S.addLookupKeys)this.i18nFormat.addLookupKeys(O,d,x,v,n);else{let C;h&&(C=this.pluralResolver.getSuffix(x,n.count,n));const E=`${this.options.pluralSeparator}zero`,j=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(n.ordinal&&C.startsWith(j)&&O.push(d+C.replace(j,this.options.pluralSeparator)),O.push(d+C),m&&O.push(d+E)),g){const T=`${d}${this.options.contextSeparator||"_"}${n.context}`;O.push(T),h&&(n.ordinal&&C.startsWith(j)&&O.push(T+C.replace(j,this.options.pluralSeparator)),O.push(T+C),m&&O.push(T+E))}}let k;for(;k=O.pop();)this.isValidLookup(i)||(s=k,i=this.getResource(x,v,k,n))}))})}),{res:i,usedKey:r,exactUsedKey:s,usedLng:o,usedNS:l}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,i,r={}){var s;return(s=this.i18nFormat)!=null&&s.getResource?this.i18nFormat.getResource(t,n,i,r):this.resourceStore.getResource(t,n,i,r)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=t.replace&&!Zn(t.replace);let r=i?t.replace:t;if(i&&typeof t.count<"u"&&(r={...r,count:t.count}),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!i){r={...r};for(const s of n)delete r[s]}return r}static hasDefaultValue(t){const n="defaultValue";for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&i.startsWith(n)&&t[i]!==void 0)return!0;return!1}}class FG{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ih.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(t){if(t=ME(t),!t||!t.includes("-"))return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=ME(t),!t||!t.includes("-"))return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(Zn(t)&&t.includes("-")){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(t)}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(i=>{if(n)return;const r=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(r))&&(n=r)}),!n&&this.options.supportedLngs&&t.forEach(i=>{if(n)return;const r=this.getScriptPartFromCode(i);if(this.isSupportedCode(r))return n=r;const s=this.getLanguagePartFromCode(i);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(o=>o===s?!0:!o.includes("-")&&!s.includes("-")?!1:!!(o.includes("-")&&!s.includes("-")&&o.slice(0,o.indexOf("-"))===s||o.startsWith(s)&&s.length>1))}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),Zn(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let i=t[n];return i||(i=t[this.getScriptPartFromCode(n)]),i||(i=t[this.formatLanguageCode(n)]),i||(i=t[this.getLanguagePartFromCode(n)]),i||(i=t.default),i||[]}toResolveHierarchy(t,n){const i=this.options.fallbackLng,r=Array.isArray(i)?i.join("|"):i;r!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=r);const s=n===void 0||n===!1||Zn(n),o=n===void 0&&typeof this.options.fallbackLng=="function",l=Zn(t)&&s&&!o;let c=null;if(l){let h;n===void 0?h="undefined":n===!1?h="boolean:false":h=`string:${n}`,c=`${t.length}:${t}|${h}`}if(c!==null){const h=this.resolveHierarchyCache[c];if(h!==void 0)return h.slice()}const u=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),d=[],f=h=>{h&&(this.isSupportedCode(h)?d.push(h):this.logger.warn(`rejecting language code not found in supportedLngs: ${h}`))};return Zn(t)&&(t.includes("-")||t.includes("_"))?(this.options.load!=="languageOnly"&&f(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&f(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&f(this.getLanguagePartFromCode(t))):Zn(t)&&f(this.formatLanguageCode(t)),u.forEach(h=>{d.includes(h)||f(this.formatLanguageCode(h))}),c!==null?(this.resolveHierarchyCache[c]=d,d.slice()):d}}const BG={zero:0,one:1,two:2,few:3,many:4,other:5},UG={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class bHe{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=ih.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const i=ME(t==="dev"?"en":t),r=n.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:i,type:r});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let o;try{o=new Intl.PluralRules(i,{type:r})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),UG;if(!t.match(/-|_/))return UG;const c=this.languageUtils.getLanguagePartFromCode(t);o=this.getRule(c,n)}return this.pluralRulesCache[s]=o,o}needsPlural(t,n={}){let i=this.getRule(t,n);return i||(i=this.getRule("dev",n)),(i==null?void 0:i.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,n,i={}){return this.getSuffixes(t,i).map(r=>`${n}${r}`)}getSuffixes(t,n={}){let i=this.getRule(t,n);return i||(i=this.getRule("dev",n)),i?i.resolvedOptions().pluralCategories.sort((r,s)=>BG[r]-BG[s]).map(r=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r}`):[]}getSuffix(t,n,i={}){const r=this.getRule(t,i);return r?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${r.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,i))}}const QG=(e,t,n,i=".",r=!0)=>{let s=lHe(e,t,n);return!s&&r&&Zn(n)&&(s=dF(e,n,i),s===void 0&&(s=dF(t,n,i))),s},zG=e=>e.replace(/\$/g,"$$$$");class VG{constructor(t={}){var n;this.logger=ih.create("interpolator"),this.options=t,this.format=((n=t==null?void 0:t.interpolation)==null?void 0:n.format)||(i=>i),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:i,useRawValueToEscape:r,prefix:s,prefixEscaped:o,suffix:l,suffixEscaped:c,formatSeparator:u,unescapeSuffix:d,unescapePrefix:f,nestingPrefix:h,nestingPrefixEscaped:m,nestingSuffix:g,nestingSuffixEscaped:b,nestingOptionsSeparator:v,maxReplaces:y,alwaysFormat:w}=t.interpolation;this.escape=n!==void 0?n:uHe,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=r!==void 0?r:!1,this.prefix=s?qh(s):o||"{{",this.suffix=l?qh(l):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":f?qh(f):"-",this.unescapeSuffix=this.unescapePrefix?"":d?qh(d):"",this.nestingPrefix=h?qh(h):m||qh("$t("),this.nestingSuffix=g?qh(g):b||qh(")"),this.nestingOptionsSeparator=v||",",this.maxReplaces=y||1e3,this.alwaysFormat=w!==void 0?w:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,i)=>(n==null?void 0:n.source)===i?(n.lastIndex=0,n):new RegExp(i,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,n,i,r){var m;let s,o,l;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=g=>{if(!g.includes(this.formatSeparator)){const w=QG(n,c,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(w,void 0,i,{...r,...n,interpolationkey:g}):w}const b=g.split(this.formatSeparator),v=b.shift().trim(),y=b.join(this.formatSeparator).trim();return this.format(QG(n,c,v,this.options.keySeparator,this.options.ignoreJSONStructure),y,i,{...r,...n,interpolationkey:v})};this.resetRegExp(),!this.escapeValue&&typeof t=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(t)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const d=(r==null?void 0:r.missingInterpolationHandler)||this.options.missingInterpolationHandler,f=((m=r==null?void 0:r.interpolation)==null?void 0:m.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>g},{regex:this.regexp,safeValue:g=>this.escapeValue?this.escape(g):g}].forEach(g=>{for(l=0;s=g.regex.exec(t);){const b=s[1].trim();if(o=u(b),o===void 0)if(typeof d=="function"){const y=d(t,s,r);o=Zn(y)?y:""}else if(r&&Object.prototype.hasOwnProperty.call(r,b))o="";else if(f){o=s[0];continue}else this.logger.warn(`missed to pass in variable ${b} for interpolating ${t}`),o="";else!Zn(o)&&!this.useRawValueToEscape&&(o=O5(o));const v=g.safeValue(o);if(t=t.replace(s[0],zG(v)),f?(g.regex.lastIndex+=v.length,g.regex.lastIndex-=s[0].length):g.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),t}nest(t,n,i={}){let r,s,o;const l=(c,u)=>{const d=this.nestingOptionsSeparator;if(!c.includes(d))return c;const f=c.split(new RegExp(`${qh(d)}[ ]*{`));let h=`{${f[1]}`;c=f[0],h=this.interpolate(h,o);const m=h.match(/'/g),g=h.match(/"/g);(((m==null?void 0:m.length)??0)%2===0&&!g||((g==null?void 0:g.length)??0)%2!==0)&&(h=h.replace(/'/g,'"'));try{o=JSON.parse(h),u&&(o={...u,...o})}catch(b){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,b),`${c}${d}${h}`}return o.defaultValue&&o.defaultValue.includes(this.prefix)&&delete o.defaultValue,c};for(;r=this.nestingRegexp.exec(t);){let c=[];o={...i},o=o.replace&&!Zn(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;const u=/{.*}/s.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(u!==-1&&(c=r[1].slice(u).split(this.formatSeparator).map(d=>d.trim()).filter(Boolean),r[1]=r[1].slice(0,u)),s=n(l.call(this,r[1].trim(),o),o),s&&r[0]===t&&!Zn(s))return s;Zn(s)||(s=O5(s)),s||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${t}`),s=""),c.length&&(s=c.reduce((d,f)=>this.format(d,f,i.lng,{...i,interpolationkey:r[1].trim()}),s.trim())),t=t.replace(r[0],zG(O5(s))),this.regexp.lastIndex=0}return t}}const yHe=e=>{let t=e.toLowerCase().trim();const n={};if(e.includes("(")){const i=e.split("(");t=i[0].toLowerCase().trim();const r=i[1].slice(0,-1);t==="currency"&&!r.includes(":")?n.currency||(n.currency=r.trim()):t==="relativetime"&&!r.includes(":")?n.range||(n.range=r.trim()):r.split(";").forEach(o=>{if(o){const[l,...c]=o.split(":"),u=c.join(":").trim().replace(/^'+|'+$/g,""),d=l.trim();n[d]||(n[d]=u),u==="false"&&(n[d]=!1),u==="true"&&(n[d]=!0),isNaN(u)||(n[d]=parseInt(u,10))}})}return{formatName:t,formatOptions:n}},HG=e=>{const t={};return(n,i,r)=>{let s=r;r&&r.interpolationkey&&r.formatParams&&r.formatParams[r.interpolationkey]&&r[r.interpolationkey]&&(s={...s,[r.interpolationkey]:void 0});const o=i+JSON.stringify(s);let l=t[o];return l||(l=e(ME(i),r),t[o]=l),l(n)}},vHe=e=>(t,n,i)=>e(ME(n),i)(t);class xHe{constructor(t={}){this.logger=ih.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const i=n.cacheInBuiltFormats?HG:vHe;this.formats={number:i((r,s)=>{const o=new Intl.NumberFormat(r,{...s});return l=>o.format(l)}),currency:i((r,s)=>{const o=new Intl.NumberFormat(r,{...s,style:"currency"});return l=>o.format(l)}),datetime:i((r,s)=>{const o=new Intl.DateTimeFormat(r,{...s});return l=>o.format(l)}),relativetime:i((r,s)=>{const o=new Intl.RelativeTimeFormat(r,{...s});return l=>o.format(l,s.range||"day")}),list:i((r,s)=>{const o=new Intl.ListFormat(r,{...s});return l=>o.format(l)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=HG(n)}format(t,n,i,r={}){if(!n||t==null)return t;const s=n.split(this.formatSeparator),o=[];for(let c=0;c-1&&!u.includes(")")&&c+1{var h;const{formatName:d,formatOptions:f}=yHe(u);if(this.formats[d]){let m=c;try{const g=((h=r==null?void 0:r.formatParams)==null?void 0:h[r.interpolationkey])||{},b=g.locale||g.lng||r.locale||r.lng||i;m=this.formats[d](c,b,{...f,...r,...g})}catch(g){this.logger.warn(g)}return m}else this.logger.warn(`there was no format function for ${d}`);return c},t)}}const wHe=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class OHe extends YP{constructor(t,n,i,r={}){var s,o;super(),this.backend=t,this.store=n,this.services=i,this.languageUtils=i.languageUtils,this.options=r,this.logger=ih.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],(o=(s=this.backend)==null?void 0:s.init)==null||o.call(s,i,r.backend,r)}queueLoad(t,n,i,r){const s={},o={},l={},c={};return t.forEach(u=>{let d=!0;n.forEach(f=>{const h=`${u}|${f}`;!i.reload&&this.store.hasResourceBundle(u,f)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?o[h]===void 0&&(o[h]=!0):(this.state[h]=1,d=!1,o[h]===void 0&&(o[h]=!0),s[h]===void 0&&(s[h]=!0),c[f]===void 0&&(c[f]=!0)))}),d||(l[u]=!0)}),(Object.keys(s).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(s),pending:Object.keys(o),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(c)}}loaded(t,n,i){const r=t.split("|"),s=r[0],o=r[1];n&&this.emit("failedLoading",s,o,n),!n&&i&&this.store.addResourceBundle(s,o,i,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&i&&(this.state[t]=0);const l={};this.queue.forEach(c=>{oHe(c.loaded,[s],o),wHe(c,t),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(u=>{l[u]||(l[u]={});const d=c.loaded[u];d.length&&d.forEach(f=>{l[u][f]===void 0&&(l[u][f]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(c=>!c.done)}read(t,n,i,r=0,s=this.retryTimeout,o){if(!t.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:i,tried:r,wait:s,callback:o});return}this.readingCalls++;const l=(u,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(u&&d&&r{this.read(t,n,i,r+1,s*2,o)},s);return}o(u,d)},c=this.backend[i].bind(this.backend);if(c.length===2){try{const u=c(t,n);u&&typeof u.then=="function"?u.then(d=>l(null,d)).catch(l):l(null,u)}catch(u){l(u)}return}return c(t,n,l)}prepareLoading(t,n,i={},r){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();Zn(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Zn(n)&&(n=[n]);const s=this.queueLoad(t,n,i,r);if(!s.toLoad.length)return s.pending.length||r(),null;s.toLoad.forEach(o=>{this.loadOne(o)})}load(t,n,i){this.prepareLoading(t,n,{},i)}reload(t,n,i){this.prepareLoading(t,n,{reload:!0},i)}loadOne(t,n=""){const i=t.split("|"),r=i[0],s=i[1];this.read(r,s,"read",void 0,void 0,(o,l)=>{o&&this.logger.warn(`${n}loading namespace ${s} for language ${r} failed`,o),!o&&l&&this.logger.log(`${n}loaded namespace ${s} for language ${r}`,l),this.loaded(t,o,l)})}saveMissing(t,n,i,r,s,o={},l=()=>{}){var c,u,d,f,h;if((u=(c=this.services)==null?void 0:c.utils)!=null&&u.hasLoadedNamespace&&!((f=(d=this.services)==null?void 0:d.utils)!=null&&f.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${i}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(i==null||i==="")){if((h=this.backend)!=null&&h.create){const m={...o,isUpdate:s},g=this.backend.create.bind(this.backend);if(g.length<6)try{let b;g.length===5?b=g(t,n,i,r,m):b=g(t,n,i,r),b&&typeof b.then=="function"?b.then(v=>l(null,v)).catch(l):l(null,b)}catch(b){l(b)}else g(t,n,i,r,l,m)}!t||!t[0]||this.store.addResource(t[0],n,i,r)}}}const S5=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),Zn(e[1])&&(t.defaultValue=e[1]),Zn(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(i=>{t[i]=n[i]})}return t},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),qG=e=>(Zn(e.ns)&&(e.ns=[e.ns]),Zn(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Zn(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),A2=()=>{},kHe=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class RS extends YP{constructor(t={},n){if(super(),this.options=qG(t),this.services={},this.logger=ih,this.modules={external:[]},kHe(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(Zn(t.ns)?t.defaultNS=t.ns:t.ns.includes("translation")||(t.defaultNS=t.ns[0]));const i=S5();this.options={...i,...this.options,...qG(t)},this.options.interpolation={...i.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=i.overloadTranslationOptionHandler);const r=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?ih.init(r(this.modules.logger),this.options):ih.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=xHe;const d=new FG(this.options);this.store=new $G(this.options.resources,this.options);const f=this.services;f.logger=ih,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new bHe(d,{prepend:this.options.pluralSeparator}),u&&(f.formatter=r(u),f.formatter.init&&f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new VG(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new OHe(r(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(h,...m)=>{this.emit(h,...m)}),this.modules.languageDetector&&(f.languageDetector=r(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=r(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new uR(this.services,this.options),this.translator.on("*",(h,...m)=>{this.emit(h,...m)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,n||(n=A2),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=(...d)=>this.store[u](...d)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...d)=>(this.store[u](...d),this)});const l=YO(),c=()=>{const u=(d,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(f),n(d,f)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),l}loadResources(t,n=A2){var s,o;let i=n;const r=Zn(t)?t:this.language;if(typeof t=="function"&&(i=t),!this.options.resources||this.options.partialBundledLanguages){if((r==null?void 0:r.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const l=[],c=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(f=>{f!=="cimode"&&(l.includes(f)||l.push(f))})};r?c(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>c(d)),(o=(s=this.options.preload)==null?void 0:s.forEach)==null||o.call(s,u=>c(u)),this.services.backendConnector.load(l,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(u)})}else i(null)}reloadResources(t,n,i){const r=YO();return typeof t=="function"&&(i=t,t=void 0),typeof n=="function"&&(i=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),i||(i=A2),this.services.backendConnector.reload(t,n,s=>{r.resolve(),i(s)}),r}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&qOe.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!["cimode","dev"].includes(t)){for(let n=0;n{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},s=(l,c)=>{c?this.isLanguageChangingTo===t&&(r(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,i.resolve((...u)=>this.t(...u)),n&&n(l,(...u)=>this.t(...u))},o=l=>{var d,f;!t&&!l&&this.services.languageDetector&&(l=[]);const c=Zn(l)?l:l&&l[0],u=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(Zn(l)?[l]:l);u&&(this.language||r(u),this.translator.language||this.translator.changeLanguage(u),(f=(d=this.services.languageDetector)==null?void 0:d.cacheUserLanguage)==null||f.call(d,u)),this.loadResources(u,h=>{s(h,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(t),i}getFixedT(t,n,i,r){const s=r==null?void 0:r.scopeNs,o=(l,c,...u)=>{let d;typeof c!="object"?d=this.options.overloadTranslationOptionHandler([l,c].concat(u)):d={...c},d.lng=d.lng||o.lng,d.lngs=d.lngs||o.lngs;const f=d.ns!==void 0&&d.ns!==null;d.ns=d.ns||o.ns,d.keyPrefix!==""&&(d.keyPrefix=d.keyPrefix||i||o.keyPrefix);const h={...this.options,...d};Array.isArray(s)&&!f&&(h.ns=s),typeof d.keyPrefix=="function"&&(d.keyPrefix=Uy(d.keyPrefix,h));const m=this.options.keySeparator||".";let g;return d.keyPrefix&&Array.isArray(l)?g=l.map(b=>(typeof b=="function"&&(b=Uy(b,h)),`${d.keyPrefix}${m}${b}`)):(typeof l=="function"&&(l=Uy(l,h)),g=d.keyPrefix?`${d.keyPrefix}${m}${l}`:l),this.t(g,d)};return Zn(t)?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=i,o}t(...t){var n;return(n=this.translator)==null?void 0:n.translate(...t)}exists(...t){var n;return(n=this.translator)==null?void 0:n.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const i=n.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const o=(l,c)=>{const u=this.services.backendConnector.state[`${l}|${c}`];return u===-1||u===0||u===2};if(n.precheck){const l=n.precheck(this,o);if(l!==void 0)return l}return!!(this.hasResourceBundle(i,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(i,t)&&(!r||o(s,t)))}loadNamespaces(t,n){const i=YO();return this.options.ns?(Zn(t)&&(t=[t]),t.forEach(r=>{this.options.ns.includes(r)||this.options.ns.push(r)}),this.loadResources(r=>{i.resolve(),n&&n(r)}),i):(n&&n(),Promise.resolve())}loadLanguages(t,n){const i=YO();Zn(t)&&(t=[t]);const r=this.options.preload||[],s=t.filter(o=>!r.includes(o)&&this.services.languageUtils.isSupportedCode(o));return s.length?(this.options.preload=r.concat(s),this.loadResources(o=>{i.resolve(),n&&n(o)}),i):(n&&n(),Promise.resolve())}dir(t){var r,s;if(t||(t=this.resolvedLanguage||(((r=this.languages)==null?void 0:r.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{const o=new Intl.Locale(t);if(o&&o.getTextInfo){const l=o.getTextInfo();if(l&&l.direction)return l.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],i=((s=this.services)==null?void 0:s.languageUtils)||new FG(S5());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.includes(i.getLanguagePartFromCode(t))||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){const i=new RS(t,n);return i.createInstance=RS.createInstance,i}cloneInstance(t={},n=A2){const i=t.forkResourceStore;i&&delete t.forkResourceStore;const r={...this.options,...t,isClone:!0},s=new RS(r);if((t.debug!==void 0||t.prefix!==void 0)&&(s.logger=s.logger.clone(t)),["store","services","language"].forEach(l=>{s[l]=this[l]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},i){const l=Object.keys(this.store.data).reduce((c,u)=>(c[u]={...this.store.data[u]},c[u]=Object.keys(c[u]).reduce((d,f)=>(d[f]={...c[u][f]},d),c[u]),c),{});s.store=new $G(l,r),s.services.resourceStore=s.store}if(t.interpolation){const c={...S5().interpolation,...this.options.interpolation,...t.interpolation},u={...r,interpolation:c};s.services.interpolator=new VG(u)}return s.translator=new uR(s.services,r),s.translator.on("*",(l,...c)=>{s.emit(l,...c)}),s.init(r,n),s.translator.options=r,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const lc=RS.createInstance();lc.createInstance;lc.dir;lc.init;lc.loadResources;lc.reloadResources;lc.use;lc.changeLanguage;lc.getFixedT;lc.t;lc.exists;lc.setDefaultNamespace;lc.hasLoadedNamespace;lc.loadNamespaces;lc.loadLanguages;var KOe={exports:{}},Oi={};/** +安装命令:{{command}}`,title:"接力到云端继续执行",description:"按顺序复制两段提示词,Codex 会通过插件将您的本地任务接力到云端",closeAria:"关闭本地迁移引导",installTitle:"安装插件",installDescription:"首次使用时,请选择一种安装方式。",copied:"已复制",copyInstallPrompt:"复制安装提示词",copyInstallCommand:"复制安装命令",installMethodAria:"插件安装方式",conversationInstall:"与 Codex 对话安装",terminalInstall:"从终端安装",taskTitle:"任务接力",taskDescription:"插件安装完成后复制,Codex 会迁移当前项目并继续执行任务。",copyHandoffPrompt:"复制接力提示词",generatingPairing:"正在生成新的配对码",pairingExpired:"配对码已过期",pairingRemaining:"配对码有效期剩余 {{countdown}}",refreshing:"刷新中",refreshPairing:"刷新配对码",pairingLoading:"正在生成配对码",pairingUnavailable:"配对码尚未生成。",statusAria:"端云接力状态",statusTitle:"接力状态",requestReceivedNamed:"已收到“{{name}}”的端云接力请求",requestReceivedCurrent:"已收到当前项目的端云接力请求",requestHelp:"复制接力提示词后,Codex 的请求会显示在这里。",entering:"正在进入",enterCodex:"进入 Codex",clipboardUnsupported:"当前浏览器不支持写入剪贴板。",steps:{request:"等待端侧请求",session:"创建云端 Session",restore:"恢复项目",continue:"发送续跑任务"},status:{issued:"等待请求",creating:"正在创建 Session",sessionCreated:"正在迁移项目",continuing:"正在启动云端任务",running:"云端执行中",completed:"接力完成",failed:"接力失败"}},Iwe={model:{description:"显示或切换当前对话模型",keywords:"模型 switch"},models:{description:"列出 app-server 可用模型",keywords:"模型列表 list"},skill:{description:"浏览并调用当前工作区可用的 Skill",keywords:"技能 workflow"},skills:{description:"浏览并调用当前工作区可用的 Skills",keywords:"技能列表 workflow list"},new:{description:"开始一个新对话",keywords:"新建 对话"},resume:{description:"打开历史会话或恢复指定 Thread",keywords:"历史 恢复 session"},fork:{description:"从当前上下文分叉一个新对话",keywords:"分叉 branch"},compact:{description:"压缩当前对话上下文",keywords:"压缩 上下文"},archive:{description:"归档当前对话并新建对话",keywords:"归档 关闭"},status:{description:"显示当前连接、Thread、模型与 Token 状态",keywords:"状态 连接 token"},clear:{description:"清空当前视图并开始新对话",keywords:"清空 重置"},help:{description:"显示 Sandbox 支持的快捷命令",keywords:"帮助 命令"},currentModel:"当前模型",availableModel:"可用模型",workspace:"工作空间",notSet:"未设置",modelLabel:"模型",statusLabel:"状态",running:"运行中",idle:"空闲",totalTokens:"累计 Token",contextWindow:"上下文窗口",imageFallback:"图片",unknown:"未知快捷命令:{{command}}。输入 /help 查看可用命令。",automaticSkills:"智能开发模式会自动使用开发能力,无需手动选择 Skill。",activity:{new:"已新建 Codex 对话",resumed:"已恢复 Codex 对话",deleted:"已删除 Codex 历史会话",modelChanged:"已切换 Codex 模型",availableModels:"Codex 可用模型",noModels:"当前没有可用模型",forked:"已分叉 Codex 对话",compacting:"已开始压缩当前 Codex 对话",archived:"已归档 Codex 对话",status:"Codex 当前状态",help:"Sandbox 支持的 Codex 快捷命令"}},Pwe={label:"智能构建任务",queued:"构建任务已排队",running:"构建任务正在后台运行",recovering:"正在恢复构建任务",waiting_user:"构建任务需要继续处理",stopping:"正在停止构建任务",succeeded:"构建任务已完成",cancelled:"构建任务已停止",failed:"构建任务未完成",open:"返回任务",hide:"隐藏任务通知",reconnecting:"正在重新连接任务服务,已有任务继续保留。"},Dwe={common:wwe,tool:Owe,threads:kwe,permissions:Swe,workspace:Ewe,approval:Cwe,composer:Awe,launch:Twe,session:_we,agentDetails:jwe,agentWorkspace:Nwe,handoff:Rwe,commands:Iwe,taskNotice:Pwe},zVe=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:jwe,agentWorkspace:Nwe,approval:Cwe,commands:Iwe,common:wwe,composer:Awe,default:Dwe,handoff:Rwe,launch:Twe,permissions:Swe,session:_we,taskNotice:Pwe,threads:kwe,tool:Owe,workspace:Ewe},Symbol.toStringTag,{value:"Module"})),Mwe={retry:"重试",signInToContinue:"登录以继续使用",signInWith:"使用 {{provider}} 登录",enterUsername:"输入一个用户名即可开始",usernamePlaceholder:"用户名(字母 + 数字,最多 16 位)",enter:"进入",usernameInvalid:"只能包含大小写字母和数字,最多 16 位。",identityProvider:{volcengine:"火山引擎 Identity",byteplus:"BytePlus Identity"},powered:{volcengine:"火山引擎 AgentKit 提供企业级 Agent 解决方案",byteplus:"BytePlus AgentKit 提供企业级 Agent 解决方案"},legalPrefix:"继续即表示你已阅读并同意 AgentKit",terms:"产品和服务条款",copyright:"© {{year}} VeADK。保留所有权利。"},Lwe={title:"登录状态已过期",description:"当前编辑内容会保留。重新登录后,刚才的操作将自动继续。",waiting:"等待登录完成…",signInAgain:"重新登录"},$we={breadcrumbs:"面包屑",selectAgent:"选择 Agent",switchAgent:"切换智能体"},Fwe={cancel:"取消",close:"关闭确认框"},VVe={login:Mwe,authExpired:Lwe,navbar:$we,confirm:Fwe},HVe=Object.freeze(Object.defineProperty({__proto__:null,authExpired:Lwe,confirm:Fwe,default:VVe,login:Mwe,navbar:$we},Symbol.toStringTag,{value:"Module"})),Bwe={defaultUser:"用户",shortcuts:"快捷入口",tryCli:"体验 AgentKit CLI",developerResources:"开发者资源",systemInfo:"系统信息",language:"语言",issueFeedback:"问题反馈",logout:"退出登录",roles:{admin:"管理员",developer:"开发者",user:"普通用户",super_admin:"超级管理员"}},Uwe={home:"返回首页",expand:"展开侧边栏",collapse:"收起侧边栏",label:"主导航",newChat:"新会话",agents:"智能体",workspaces:"工作区",library:"资源库",cronjobs:"定时任务",automations:"自动化",users:"用户管理",administration:"管控",reviewCenter:"审核中心"},Qwe={title:"历史会话",newConversation:"新会话",create:"新建会话",loading:"正在加载历史会话…",empty:"暂无会话",current:"当前",manage:"管理历史会话:{{title}}",more:"更多",delete:"删除",loadingMore:"加载中…",loadMore:"加载更多",evaluatingTitle:"正在自动评测",evaluating:"评测中",generating:"正在生成"},qVe={account:Bwe,navigation:Uwe,history:Qwe},WVe=Object.freeze(Object.defineProperty({__proto__:null,account:Bwe,default:qVe,history:Qwe,navigation:Uwe},Symbol.toStringTag,{value:"Module"})),zwe={placeholder:"请选择",collapseOptions:"收起模型选项",expandOptions:"展开模型选项",noOptions:"暂无可用选项",noMatches:"没有匹配项,可直接使用当前模型 ID"},Vwe={unsupportedActivity:"不支持的 Skill 对话活动",ariaLabel:"Skill 生成对话"},Hwe={code:"错误码:{{code}}",type:"错误类型:{{type}}",representation:"异常表示:{{value}}",rawResponse:`服务端原始响应: +{{value}}`,original:"原始错误:{{message}}",details:"详细信息"},qwe={ariaLabel:"Skill 文件树",viewSource:"查看源码",viewPreview:"查看预览",download:"下载",binaryFile:"二进制文件",bytes:"{{value}} 字节",binaryDescription:"当前接口仅返回文件元数据,可单独下载原文件。",metadata:"Skill 元数据",noFiles:"暂无文件"},Wwe={close:"关闭",name:"名称",region:"地域",optionalDescription:"描述(可选)",cancel:"取消",create:"创建",creating:"创建中…",save:"保存",saving:"保存中…",upload:"上传",uploading:"上传中…",createSpaceTitle:"新建 Skill 空间",editSpaceTitle:"编辑 Skill 空间",uploadTitle:"上传到 {{name}}",createSpaceFailed:"创建 Skill 空间失败",updateSpaceFailed:"更新 Skill 空间失败",archiveValidationFailed:"Skill ZIP 格式校验失败",uploadFailed:"上传 Skill 失败",dropzone:"拖拽 Skill ZIP 到这里",chooseLocalFile:"或点击选择本地文件",archiveHelp:"ZIP 根目录需要包含 SKILL.md,也可以只包含一层包装目录。选择后仅检查格式,不会自动上传。",validating:"正在检查文件格式…",validationPassed:"格式检查通过:{{name}},共 {{count}} 个文件"},Kwe={styles:{concise:"简洁实用",strict:"严谨稳健",tutorial:"教程友好",automation:"自动化优先",custom:"自定义",customFallback:"自定义风格"},stages:{preparing:"正在准备 Dev Sandbox",ready:"Skill 已生成并通过格式校验",failed:"生成失败",cancelled:"已停止",validating:"正在校验 Skill 格式",packaging:"正在整理文件",generating:"正在生成 Skill",repairingAgain:"正在再次修复",autoRepairing:"正在自动修复({{attempt}}/{{max}})"},validation:{fallback:"Skill 格式校验未通过",repairInstruction:"只修复下面列出的 Skill 格式错误,不要改变原有用途和内容范围。",recheckInstruction:"修复后重新检查目录结构、SKILL.md frontmatter 和所有文本文件。",nameTooLong:"Skill 名称不能超过 64 个字符",invalidName:"Skill 名称只能包含小写字母、数字和连字符",modelTooLong:"模型 ID 不能超过 128 个字符",invalidModel:"模型 ID 只能包含字母、数字、点、下划线、连字符、斜杠和冒号"},errors:{loadCapability:"读取 Dev Sandbox 配置失败",autoRepair:"自动修复格式错误失败",pollCandidate:"读取候选方案状态失败,正在重试",createCandidate:"创建候选方案失败",refine:"继续调整失败",repairAgain:"再次修复格式错误失败",selectSpace:"请选择上传的 Skill Space",unsupportedRegion:"当前 Skill 地域不受支持",upload:"上传 Skill 失败",download:"下载失败"},sessionMax:"Session 最长保留 1 小时",remaining:"剩余 {{minutes}}:{{seconds}}",unnamedSpace:"未命名 Skill Space",leaveConfirmation:"离开后将停止并释放正在运行的 Dev Sandbox,确定离开吗?",createTitle:"创建技能",optimizeTitle:"优化 {{name}}",skillFallback:"技能",back:"返回技能空间",home:"主页技能生成",basicInfo:"基本信息",goal:"目标",createIntentPlaceholder:"描述希望这个 Skill 完成什么任务",optimizeIntentPlaceholder:"描述希望如何优化当前 Skill",skillName:"Skill 名称",autoNamePlaceholder:"留空时自动生成",nameHelp:"仅支持小写字母、数字和连字符;留空时自动生成。",createPlans:"生成方案",optimizePlans:"优化方案",createPlansDescription:"按不同方案并行生成多个技能,您可以选择最佳结果",optimizePlansDescription:"按不同方案并行优化当前技能,您可以选择最佳结果",plan:"方案 {{count}}",remove:"移除",model:"模型",modelPlaceholder:"选择或输入模型 ID",style:"风格",customStyle:"自定义风格",customStylePlaceholder:"描述表达方式、严谨程度或输出偏好",addConfiguration:"添加配置",notConfigured:"管理员未配置",generate:"生成",candidates:"候选方案",progress:"进度",retryCandidate:"重试此方案",formatValidationFailed:"格式校验未通过",repairAgain:"再次修复",files:"文件",downloadZip:"下载 ZIP",loadingFiles:"正在读取文件…",filesPending:"生成过程中会在这里显示完整文件树",uploadToSpace:"上传到 Skill Space",loadingSpaces:"正在加载 Skill Space",selectSpace:"选择 Skill Space",continuePlaceholder:"继续调整这个候选方案",continue:"继续调整",uploading:"上传中…",overwrite:"覆盖原 Skill",uploadToSelectedSpace:"上传到 Skill Space",uploadToCurrentSpace:"上传到当前空间",allCandidatesFailed:"所有方案均创建失败,可分别重试。"},Gwe={invalidFormat:"{{label}}格式错误。",recoveryStatus:"Skill 恢复点状态",errorResponse:"错误响应",errorDetails:"错误详情",missingContentType:"Content-Type 缺失",gatewayError:"{{fallback}}(HTTP {{status}},Content-Type: {{contentType}})。请检查代理或网关配置。",nonJson:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}},Content-Type: {{contentType}}),请检查代理或网关配置。",activity:"Skill 会话活动",invalidActivity:"Skill 会话活动格式错误。",invalidToolActivity:"Skill 工具活动格式错误。",invalidTextActivity:"Skill 文本活动格式错误。",publication:"Skill 发布结果",task:"Skill 会话",file:"Skill 文件",unknownTaskState:"Skill 会话状态无法识别。",capability:"Skill 工作台能力",loadCapability:"读取 Skill 工作台能力失败",prepareTask:"准备 Skill 会话失败",taskReference:"Skill 会话引用",startOptimization:"开始优化 Skill 失败",startTask:"开始 Skill 会话失败",taskSummary:"Skill 会话摘要",taskList:"Skill 会话列表",loadTaskList:"读取 Skill 会话列表失败",invalidTaskList:"Skill 会话列表格式错误。",loadTask:"读取 Skill 会话失败",artifact:"Skill 产物",artifactFile:"Skill 产物文件",loadArtifact:"读取 Skill 产物失败",refine:"继续调整 Skill 失败",stop:"停止当前 Skill 任务失败",publish:"发布 Skill 失败",nonNdjson:"发布 Skill 失败:服务端返回了非 NDJSON 响应。",missingStream:"发布 Skill 失败:服务端没有返回进度流。",publishProgress:"发布进度",invalidPublishProgress:"发布进度格式错误。",publishError:"发布错误",unknownPublishEvent:"未知的发布进度事件。",publishResult:"发布结果",streamEnded:"发布进度流提前结束,无法确认发布结果。请刷新技能中心确认状态。",deleteTask:"删除 Skill 会话失败",download:"下载 Skill 失败"},Xwe={configSelect:zwe,conversation:Vwe,errorDetails:Hwe,fileTree:qwe,management:Wwe,generation:Kwe,api:Gwe},KVe=Object.freeze(Object.defineProperty({__proto__:null,api:Gwe,configSelect:zwe,conversation:Vwe,default:Xwe,errorDetails:Hwe,fileTree:qwe,generation:Kwe,management:Wwe},Symbol.toStringTag,{value:"Module"})),Ywe={back:"返回上一页",reload:"重新加载",notConfigured:"未配置",name:"名称",description:"描述",delete:"删除",save:"保存",saving:"保存中",add:"添加",manage:"管理",environment:"环境",noDescription:"暂无描述",refresh:"刷新",close:"关闭",retry:"重试",loading:"加载中…",previousPage:"上一页",nextPage:"下一页",edit:"编辑",all:"全部",search:"搜索",cancel:"取消",view:"查看",viewDetails:"查看详情",deleting:"删除中…",create:"创建",creating:"创建中",adding:"添加中",generating:"生成中",uploading:"上传中",preview:"预览",loadFailed:"加载失败",select:"选择",collapse:"收起",expand:"展开",none:"无"},Zwe={ariaLabel:"AgentKit 快速入口",closeAriaLabel:"关闭 AgentKit 欢迎卡片",title:"欢迎使用 AgentKit",description:"通过 AgentKit 平台快速构建与托管您的企业级智能体",docsAriaLabel:"打开 AgentKit 文档,在新窗口打开",docs:"文档",consoleAriaLabel:"打开 AgentKit 控制台,在新窗口打开",console:"控制台"},Jwe={checkUpdates:"检查更新",checkingVersions:"正在检查版本…",versionCheckError:"查询沙箱版本失败,请检查凭据、区域及接口权限后重试",sandboxUpdateError:"Sandbox 更新失败,请刷新检查实际状态后重试",modelEnvRepairUnavailable:"无法补齐模型环境变量,请检查 CODEX_API_KEY 和 CODEX_BASE_URL",updateSandbox:"更新{{variant}}{{name}}",updatingSandbox:"更新中",title:"系统信息",description:"查看当前 Studio 版本及关联的基础资源",general:"通用",currentVersion:"当前版本",storage:"存储",loadingStorage:"正在加载存储信息",tosAddress:"TOS 地址",openTosConsole:"在云控制台中打开 TOS 存储桶",environmentBuild:"环境构建",loadingEnvironmentResources:"正在加载环境构建资源",environmentResourcesError:"环境构建资源加载失败,请检查云凭据后重试。",codePipelineWorkspace:"CodePipeline 工作空间",codePipelinePipeline:"CodePipeline 流水线",openCodePipelineWorkspace:"在云控制台中打开 CodePipeline Workspace",createdOnFirstBuild:"首次构建时自动创建",containerRegistryRepository:"Container Registry 仓库",openContainerRegistryRepository:"在云控制台中打开 Container Registry 仓库",sandboxInfo:"沙箱信息",loadingSandboxInfo:"正在加载沙箱信息",sandboxInfoError:"沙箱信息加载失败,请重试。",snapshot:"快照版",snapshotWithSpace:"快照版 ",openToolConsole:"在云控制台中打开{{name}}",updateModelEnv:"更新{{variant}}{{name}}模型环境变量",modelEnvUpdated:"已更新",modelEnvAlreadyCurrent:"无需更新",userPool:"用户池",loadingUserPool:"正在加载用户池",userPoolError:"用户池加载失败,请重试。",modelEnvUpdateError:"模型环境变量更新失败,请重试。",openUserPoolConsole:"在云控制台中打开用户池{{name}}",unnamedUserPool:"未命名用户池",id:"ID",domain:"域名",region:"区域",noLocalUserPool:"本地模式未配置用户池",noUserPool:"当前 Studio 未配置用户池"},e1e={workspace:"Agent 工作区",library:"Agent 库",evaluation:"评测",agentList:"Agent 列表",agentDetails:"Agent 详情",newAgent:"新建 Agent",loading:"加载中…",loadingCloudAgents:"正在加载云端 Agent…",noAgentSelected:"请选择一个 Agent",local:"本地",remote:"云端",localAgent:"本地 Agent",remoteAgent:"云端 Agent",agentCount:"{{count}} 个 Agent",agentCountLabel:"Agent 数量",details:"详情",chat:"对话",update:"更新",backToAgentList:"返回 Agent 列表",loadingAgent:"正在加载 Agent",loadingAgentDescription:"正在读取 Agent 配置和 Runtime 信息。",loadingAgentInfo:"正在加载 Agent 信息…",detailLoadFailed:"无法加载 Agent 详情",detailLoadFailedDescription:"请检查 Runtime 状态后重试。",partialInfoUnavailable:"部分信息暂时不可用",upgradeRuntimeForDetails:"请升级 Runtime 以查看完整 Agent 信息。",basicInfo:"基本信息",usageOverview:"使用概览",sections:{basic:"基本信息",profileConfig:"Profile 配置",sessionConfig:"会话配置",usage:"使用概览",diagnostics:"诊断",evaluations:"评测",optimizations:"优化建议",integrations:"集成",versions:"版本",channels:"消息渠道"},evaluationGroup:"评测组",optimizations:"优化建议",optimizationsDescription:"根据评测结果查看可执行的优化建议。",integrations:"集成",githubVersions:"GitHub 版本",githubVersionsDescription:"查看持续交付产生的版本并创建回退 PR。",currentVersionOnly:"当前未启用 GitHub 持续交付,仅展示当前生产版本。",loadingVersions:"正在加载版本…",noVersion:"暂无版本记录",prLink:"Pull Request",viewPr:"查看 PR",author:"提交人",publishStatus:"发布状态",viewRelease:"查看发布记录",rollbackToVersion:"回退到此版本",rollingBack:"正在创建回退…",rollbackEvent:"回退事件",sourceMergedRuntimeStill:"最新源码已合并,但 Runtime 仍处于",currentProductionVersionHint:";当前生产版本保持不变。",usageSummary:"使用统计",totalCalls:"总调用次数",userCount:"用户数",userDetails:"用户明细",usageUserList:"Agent 使用用户列表",user:"用户",callCount:"调用次数",lastUsed:"最近使用",unknownUser:"未知用户",loadingUsage:"正在加载使用数据…",refreshing:"刷新中…",noUsage:"暂无使用记录",usageUnavailable:"当前 Agent 暂无可用的使用统计。",usagePagination:"使用记录分页",pageOf:"第 {{page}} / {{total}} 页",notProvided:"暂未提供",integrationMethods:"集成方式",integrationDescription:"通过 Runtime API 或 A2A 协议集成当前 Agent。",integrationProtocol:"集成协议",runtimeStatus:"Runtime 状态",executionFlow:"执行流程",probingIntegration:"正在检测集成能力",probingIntegrationDescription:"正在读取可用端点和鉴权配置。",configurationStatus:"配置状态",discoveryEndpoint:"发现端点",invocationEndpoint:"调用端点",invocationUrl:"调用地址",authentication:"鉴权方式",networkAccess:"网络访问",notAvailable:"暂无",noAuthentication:"无需鉴权",noApiKeyRequired:"无需 API Key",usesOauthJwt:"使用 OAuth / JWT",showApiKey:"显示 API Key",hideApiKey:"隐藏 API Key",pythonExample:"Python 示例",deploymentConfig:"部署配置",deploymentConfigDescription:"确认实例和运行配置后更新 Runtime。",deploymentRegion:"部署区域",mpaControlPlane:"MPA 控制面",loadingMpaAgentView:"正在读取 MPA Runtime 绑定…",mpaRuntimeBound:"该 MPA Agent 已绑定唯一 Runtime,可继续管理。",mpaRuntimeMissing:"当前 Agent 没有可见的 MPA Runtime 绑定。",mpaRuntimeBindingAmbiguous:"多个 MPA Runtime 匹配当前 Agent,请先修复绑定后再修改。",mpaRuntimeOrphan:"Runtime 存在,但其中没有当前 MPA Profile。",mpaRuntimeLegacyAuthUnsupported:"该 Runtime 使用旧版 MPA 镜像,仍要求 X-Jwt-Token。请先更新到当前 AgentKit 兼容镜像,再管理 Profile 或 Session 配置。",profileConfig:"Profile 配置",profileConfigTitle:"Profile 配置",profileConfigDescription:"查看并应用 Agent 级 MPA Profile。Profile 是 Runtime 的长期默认配置,新会话默认继承它。",profileStatus:"Profile 状态",profileApplied:"已应用",profileNotApplied:"未应用",profileNotAppliedDescription:"当前 Runtime 可运行,但尚未保存为 Studio 可管理的 Profile。应用后会生成 Profile revision。",applyProfile:"应用 Profile",reapplyProfile:"重新应用 Profile",editProfile:"编辑 Profile",profileApplying:"应用中…",profileAppliedNotice:"Profile 已应用,当前 revision 为 {{revision}}。",profileApplyIncomplete:"Profile 应用未完成,请查看当前操作状态后重试。",profileApplyFailed:"Profile 应用失败。",profilePrompt:"系统提示词",profileResources:"资源配置",profileResourceSummary:"{{tools}} 个工具 · {{skills}} 个 Skill · {{mcp}} 个 MCP 服务",sessionConfigTitle:"会话配置",sessionConfigDescription:"查看和调整当前 MPA Session 的执行配置。变更只对下一轮对话生效。",loadingSessionConfig:"正在加载会话配置…",sessionConfigNoAgent:"请选择一个 MPA Agent 后再管理会话配置。",sessionConfigNonMpa:"会话配置仅适用于 MPA Agent。",sessionConfigNoSession:"请先打开这个 MPA Agent 的对话,再修改会话配置。",sessionConfigDifferentRuntime:"请先切回这个 MPA Agent 的当前对话,再修改会话配置。",sessionConfigSaved:"会话配置已更新,下一轮对话将使用新 revision。",sessionConfigStale:"该 Session 已被其他位置修改,已展示最新配置,请确认后再保存。",sessionConfigRevision:"配置 revision",sessionProfileRevision:"Session Profile revision",latestProfileRevision:"最新 Profile revision",sessionProfileUpgradeAvailable:"检测到新的 Profile revision:v{{current}} → v{{target}}。",upgradeSessionProfile:"升级 Session Profile",sessionProfileUpgrading:"升级中…",sessionProfileUpgraded:"Session Profile 已升级,下一轮对话将使用新 revision。",sessionProfileUpgradeFailed:"Session Profile 升级失败。",sessionModelOverride:"模型覆盖",modelId:"模型 ID",inheritProfileDefault:"继承 Profile 默认值",sessionMcpServers:"MCP 服务",mcpServerCount:"已选择 {{count}} 个",clearSessionMcp:"清空 MCP 服务",mpaDiagnosticsTitle:"Runtime 诊断",mpaDiagnosticsDescription:"查看最近的 Runtime Console 运行记录,以及 Agent、Profile、Turn、task 和 worker 关联。",loadingMpaDiagnostics:"正在加载 Runtime 诊断…",noMpaDiagnostics:"当前 Session 暂无 Runtime 诊断运行记录。",latestRun:"最近运行",traceCorrelation:"Trace 关联",traceCorrelationDescription:"Runtime Console 为本次 invocation 返回的稳定标识。",traceSteps:"Trace 步骤",traceStepsDescription:"当前 invocation 最近的有界 Runtime Console 步骤。",mpaInstanceId:"MPA 实例",turnId:"Turn ID",taskId:"Task ID",workerKind:"Worker 类型",workerSession:"Worker Session",workerTurn:"Worker Turn",workerProfile:"Worker Profile",workerProfileVersion:"Worker Profile 版本",step:"步骤",stepCount:"步骤数",duration:"耗时",noTraceSteps:"本次 invocation 暂无 trace 步骤。",executionConfigMode:{replace:"Session 覆盖",clear:"本 Session 已清空",inherit:"使用 Profile 默认值"},concurrency:"并发数",selectedOptimizations:"已选优化项",selectedOptimizationsDescription:"这些优化会应用到本次更新。",optimizationProfile:"优化方案",updatePending:"等待更新",updatingDeployment:"正在更新部署",restoringUpdateConfig:"正在恢复更新配置…",updateConfigUnavailable:"无法读取更新配置",legacyConfigMissing:"旧版本 Runtime 缺少可恢复的配置,请重新创建。",deploymentFailed:"部署失败",continueEditing:"继续编辑",loadingOptimizations:"正在加载优化建议…",noOptimizations:"暂无优化建议",fixPriority:"优先级",suggestedModule:"建议模块",suggestionAndReason:"建议与原因",priority:{high:"高",medium:"中",low:"低"},modules:{agentStructure:"Agent 结构",prompt:"提示词",tool:"工具",knowledge:"知识库",memory:"记忆",workflow:"工作流",other:"其他"},evaluationGroupList:"评测组列表",newEvaluationGroup:"新建评测组",newEvaluationGroupName:"新评测组 {{count}}",searchEvaluationGroups:"搜索评测组",noMatchingEvaluationGroups:"没有匹配的评测组",noEvaluationGroupSelected:"请选择一个评测组",groupStats:"{{agents}} 个 Agent · {{runs}} 次运行",evaluationGroupDetails:"评测组详情",evaluationGroupStats:"{{agents}} 个 Agent · {{caseSet}} · {{runs}} 次运行",startEvaluation:"开始评测",evaluationConfig:"评测配置",historyResults:"历史结果",participatingAgents:"参与 Agent",selectedCount:"已选择 {{count}} 个",evaluationResources:"评测资源",evaluationSet:"评测集",evaluator:"评估器",caseCount:"{{count}} 条案例",evaluationMetrics:"评测指标",selectedMetricCount:"已选择 {{count}} 项",historyDescription:"查看每次评测的分数和运行状态。",noHistory:"暂无评测历史",noHistoryDescription:"运行一次评测后,结果会显示在这里。",evaluationRun:"第 {{index}} 次评测",evaluationRunMeta:"{{time}} · {{agents}} 个 Agent",overallScore:"综合分",completed:"已完成",evaluationDefaults:{coreRegression:"核心能力回归",safetyCheck:"安全与幻觉检查",coreSet:"核心回归集",safetySet:"安全边界集",toolSet:"工具调用集",qualityEvaluator:"综合质量评估器",factualEvaluator:"事实一致性评估器",toolEvaluator:"工具调用评估器",responseQuality:"回答质量",factualAccuracy:"事实准确性",toolUse:"工具调用",responseEfficiency:"响应效率",todayTime:"今天 10:32",yesterdayTime:"昨天 16:08",julyTime:"7 月 25 日 14:20",justNow:"刚刚"},defaultCases:{agentName:"示例 Agent",goodSetName:"示例正向案例集",badSetName:"示例负向案例集",weeklyFeedback:{input:"总结本周客户反馈,并按优先级归类。",output:"覆盖主要问题,给出清晰的优先级与下一步动作。",tag:"总结",reason:"任务完整覆盖了用户目标,输出结构清晰,并给出了可执行的下一步动作。"},research:{input:"查询最新公开资料并附上来源。",output:"调用搜索工具,结论与引用一一对应。",tag:"工具调用"},uncertainConclusion:{input:"在信息不足时直接给出确定结论。",output:"应明确说明未知,并主动询问缺失信息。",tag:"幻觉",reason:"信息不足时仍给出了确定结论,缺少必要的澄清步骤与不确定性说明。"},repeatedTool:{input:"连续重复调用相同工具获取同一结果。",output:"复用已有结果,避免无意义的重复调用。",tag:"效率"}},goodCases:"正向案例",badCases:"负向案例",goodCase:"正向案例",badCase:"负向案例",reference:"参考答案",caseResultFilter:"案例结果筛选",feedbackSourceFilter:"反馈来源筛选",searchCases:"搜索案例",searchCasesPlaceholder:"搜索输入、输出或标签",selectCases:"选择案例",selectAll:"全选",selectAllVisible:"选择当前可见案例",selectedCaseCount:"已选择 {{count}} 条",deleteSelected:"删除所选",deleteSelectedTitle:"删除所选 Agent",deleteSelectionDescription:"确定删除所选的 {{count}} 个项目吗?此操作无法撤销。",deleteCasesConfirm:"删除所选案例",deleteOneCaseConfirm:"删除这个案例",deleteFeedbackCase:"删除反馈案例",noFeedbackCases:"暂无反馈案例",noMatchingCases:"没有匹配的案例",loadingEvaluationSet:"正在加载评测集…",userInput:"用户输入",agentOutput:"Agent 输出",score:"得分",scoreReason:"评分原因",noUserInput:"暂无用户输入",noVisibleResponse:"暂无可见回复",note:"备注:",manualFeedback:"人工反馈",automaticFeedback:"自动反馈",scoreValue:"{{score}} 分",unknownTime:"时间未知",deleteAgentTitle:"删除 Agent",deleteAgentDescription:"确定删除 Agent“{{name}}”吗?",deleteDraftDescription:"确定删除草稿“{{name}}”吗?",deleteAgent:"删除 Agent",closeDeleteConfirmation:"关闭删除确认",mpaDeletePreviewSummary:"Studio 会先删除可见的空闲 MPA Runtime 会话,再删除 AgentKit Runtime。运行中的任务需要先结束或停止后才能删除。",mpaDeletePreviewSessions:"会话",mpaDeletePreviewActiveSessions:"运行中",mpaDeletePreviewIdleSessions:"空闲",mpaDeleteBlocked:"当前无法删除",mpaDeleteBlockerActiveOperation:"仍有 MPA 创建或更新操作在执行。",mpaDeleteBlockerActiveSessions:"Runtime 中仍有运行中的会话。",mpaDeleteBlockerBindingAmbiguous:"当前 Agent 匹配到多个 MPA Runtime。",mpaDeleteBlockerRuntimeMissing:"当前 MPA Agent 没有可见的 Runtime 绑定。",mpaDeleteBlockerOrphanRuntime:"Runtime 可见,但其中缺少当前 MPA Profile。",mpaDeleteStage:{runtime_sessions:"删除 {{count}} 个可见空闲 Runtime 会话",runtime_diagnostics:"清理这些会话关联的诊断数据和挂载元信息",agentkit_runtime:"删除 AgentKit Runtime"},draftDeletionWarning:"草稿将从当前浏览器中删除。",runtimeDeletionWarning:"Runtime 和相关云端资源将被删除。",noneSelected:"尚未选择",none:"无",notPublished:"未发布",notRecorded:"未记录",noTime:"暂无时间",noPr:"暂无 PR",comingSoon:"评测能力即将开放",preparing:"准备中",cancelled:"已取消",failed:"失败",totalCount:"共 {{count}} 条",deploymentProgress:"部署进度",returnToEdit:"返回编辑",retryOperation:"重试操作",buildLog:"构建日志",githubMountLog:"GitHub 挂载日志",githubDeliveryMountLog:"GitHub 持续交付挂载日志",waitingBuildLog:"正在等待构建日志…",waitingGithubMountLog:"正在等待 GitHub 挂载日志…",copy:"复制",copied:"已复制",copyLabel:"复制{{label}}",copiedLabel:"已复制{{label}}",logLines:"{{count}} 行",logStatus:{synced:"已同步",failed:"读取失败",syncing:"同步中",earlyOmitted:"已省略早期日志",recentOnly:"仅显示最近的构建日志",partiallyOmitted:"已省略部分日志"},deployStatus:{running:"正在部署",unconfirmed:"部署状态待确认",success:"部署完成",error:"部署失败",cancelled:"部署已取消"},deploymentSteps:{prepare:{label:"准备部署",description:"校验配置并创建部署任务"},build:{label:"构建镜像",description:"生成运行环境与智能体代码"},deploy:{label:"部署服务",description:"创建并启动 AgentKit Runtime"},publish:{label:"发布服务",description:"等待服务就绪并生成访问地址"},complete:{label:"部署完成",description:"智能体已可以正常使用"},evaluation:{label:"创建评测集",description:"自动创建 Good Case 和 Bad Case 评测集"},profileApplying:{label:"应用 MPA 配置",description:"将 Studio Agent 配置写入 MPA Runtime"},smokeRunning:{label:"验证 MPA Runtime",description:"在标记可运行前执行 Runtime 就绪验证"},runnable:{label:"MPA Runtime 可运行",description:"Runtime 已接受配置并通过执行就绪验证"},github:{label:"挂载 GitHub 持续交付",description:"初始化目标分支与 GitHub Actions workflow"},update:{label:"更新实例配置",description:"将 Runtime 实例数调整为 {{min}}~{{max}}"}},githubStatus:{published:"已发布",publishing:"发布中",failed:"发布失败",pending:"等待发布",unknown:"未知"},errors:{agentInfoMissing:"Agent 信息不可用",checkUpdateCapability:"无法检查更新能力",checkingUpdateConfig:"正在检查更新配置",cloudOnlyUpdate:"仅云端 Agent 支持更新",deleteDeployedUnsupported:"当前不支持删除已部署 Agent",deleteDraftUnsupported:"当前不支持删除草稿",loadMpaDeletePreview:"无法加载 MPA 删除预览",loadAgentInfo:"无法加载 Agent 信息",loadApiKey:"无法读取 API Key",loadGithubVersions:"无法加载 GitHub 版本",loadEvaluations:"无法加载评测案例",loadMpaAgentView:"无法加载 MPA Agent 状态",loadMpaDiagnostics:"无法加载 Runtime 诊断",loadOptimizations:"无法加载优化建议",loadRuntimeDetails:"无法加载 Runtime 详情",loadSessionConfig:"无法加载会话配置",loadUsage:"无法加载使用数据",noCreatePermission:"当前账号没有创建 Agent 的权限",noManagePermission:"当前账号没有管理此 Agent 的权限",originalConfigUnavailable:"原始配置不可用",probeIntegration:"无法检测集成能力",rollbackVersion:"无法创建版本回退",runtimeRegionMissing:"Runtime 区域信息缺失",updateCapabilityMismatch:"Runtime 更新能力与当前配置不匹配",updateCapabilityPending:"Runtime 更新能力仍在确认中",updateConfigRestoring:"正在恢复更新配置",updateUnsupported:"当前 Runtime 不支持更新",usageMismatch:"返回的使用数据与当前 Agent 不匹配"}},t1e={title:"环境",loadFailed:"环境加载失败,请检查存储配置后重试。",storageUnavailable:"管理员未配置持久化存储,环境管理暂不可用。",create:"新建环境",configure:"配置环境",details:"环境详情",editorDescription:"配置运行环境,或接入代码仓库和已有镜像",backToList:"返回环境列表",save:"保存环境",createAndBuild:"创建并构建",saveAndBuild:"保存并构建",name:"环境名称",namePlaceholder:"Python 数据处理",descriptionPlaceholder:"说明这个环境适合处理的任务",creationMethod:"创建方式",baseConfiguration:"基础配置",baseEnvironment:"基础环境",operatingSystem:"操作系统",pythonVersion:"Python 版本",fixedByBase:"由 {{base}} 固定为 {{value}}",selectUbuntuVersion:"选择基础镜像的 Ubuntu 版本",selectPythonVersion:"选择需要安装的 Python 版本",skills:"技能",addSkill:"添加环境技能",veadkDescription:"Agent 开发与运行框架",customDockerfile:"自定义 Dockerfile",presetEnvironment:"预制环境",presetHint:"选择“无”可自行填写 Dockerfile 第一行的基础镜像。",dockerfileSize:"{{size}} / {{max}} 字节",upload:"上传",reset:"重置",dockerfileBaseImage:"Dockerfile 基础镜像",dockerfileContent:"Dockerfile 内容",region:"区域",search:"搜索环境",manualImport:"手动导入",noMatches:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称",startBuild:"开始构建",build:"构建",unnamed:"未命名环境",listSeparator:"、",clipboardReadError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。",creation:{custom:{label:"自定义配置",description:"通过表单选择基础环境、Python、工具和技能"},dockerfile:{label:"自定义 Dockerfile",description:"上传或直接编辑 Dockerfile"},git:{label:"从代码仓库构建",description:"探查公开仓库并通过 CodePipeline 构建"},image:{label:"使用已有镜像",description:"绑定由外部流水线交付的 CR 镜像"}},baseDescriptions:{"aio-sandbox":"内置 Sandbox Shell 能力 · Ubuntu 22.04","codex-sandbox":"内置 Codex CLI、浏览器与代码执行环境",ubuntu:"标准 Linux 基础镜像"},dockerfileValidation:{baseImageRequired:"请填写基础镜像。",duplicateFrom:"基础镜像已固定在第一行,请删除 Dockerfile 正文中的 FROM 指令。",tooLarge:"Dockerfile 不能超过 128 KiB。",empty:"Dockerfile 内容不能为空。",missingFrom:"Dockerfile 缺少 FROM 指令。"},presets:{none:"自行填写 Dockerfile 基础镜像",aio:"内置 Sandbox Shell 与常用运行时",codex:"内置 Codex CLI、浏览器与代码执行环境"},categories:{tools:"工具",productivity:"效率",browser:"浏览器自动化",system:"系统与媒体"},options:{"lark-cli":"飞书开放平台命令行工具",pandoc:"文档格式转换工具",opencli:"将网站与桌面应用转换为命令行工具",uv:"快速 Python 包与项目管理器",ripgrep:"高性能文本检索工具",jq:"JSON 查询与转换工具","github-cli":"在终端中管理 GitHub 工作流",playwright:"浏览器自动化与端到端测试",chromium:"无头浏览器运行时",git:"代码版本管理",curl:"网络请求与文件下载",ffmpeg:"音视频转码与处理",imagemagick:"图片转换与批处理"},duration:{seconds:"{{count}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",hoursMinutes:"{{hours}} 小时 {{minutes}} 分"},buildStatus:{preparing:"准备中",queued:"排队中",building:"构建中",scanning:"扫描中",available:"可用",failed:"构建失败",notBuilt:"未构建"},manifest:{title:"环境 Manifest",closeLabel:"关闭环境 Manifest",loading:"正在加载 Manifest",editorLabel:"环境 Manifest YAML",copyFailed:"复制失败,请重试",copied:"已复制",copy:"复制 Manifest",view:"查看环境 Manifest",viewShort:"查看 Manifest",unavailable:"尚无可用 Manifest"},buildDetails:{title:"构建详情",closeLabel:"关闭构建详情",currentStep:"当前步骤",waiting:"等待构建信息",elapsed:"已用时",sourceCommit:"源码提交",openCodePipeline:"在 CodePipeline 中查看",starting:"正在启动",rebuild:"重新构建"},git:{sectionLabel:"公开代码仓库",address:"Git 地址",ref:"Branch、Tag 或 Commit",defaultBranch:"默认分支",inspecting:"正在拉取仓库并查找 Dockerfile",foundDockerfiles:"已在提交 {{commit}} 中找到 {{count}} 个 Dockerfile。",savedDockerfileLoaded:"已载入保存的 Dockerfile,可重新探查仓库更新。",noDockerfile:"仓库中未找到 Dockerfile,请检查分支或仓库内容。",inspectAgain:"重新探查",selectDockerfile:"选择 Dockerfile"},repository:{outputSection:"构建输出",type:"镜像仓库类型",managed:"Studio 默认镜像仓库",existing:"已有镜像仓库",managedHint:"构建时自动创建或复用当前区域的 Studio 镜像仓库。"},existingImage:{sectionLabel:"已有镜像",reference:"Tag 或 Digest",placeholder:"latest 或 sha256:...",hint:"填写镜像 Tag,或以 sha256: 开头的完整 Digest。"},share:{action:"分享",title:"分享环境",closeLabel:"关闭分享环境",generating:"正在生成并复制分享码",copied:"分享码已复制",failed:"分享失败",code:"分享码",fullCode:"完整环境分享码",copiedHint:"分享码已自动复制,也可在这里查看或手动复制。",copyFailedHint:"自动复制失败,可手动复制上方分享码,或重试。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅发送给可信对象。",copyAgain:"再次复制"},import:{title:"导入环境",closeLabel:"关闭导入环境",description:"先检测分享码中的环境,再确认添加到当前账号。",code:"环境分享码",tooMany:"最多可一次导入 {{max}} 个环境,当前检测到 {{count}} 个分享码。",multipleHint:"多个分享码可使用英文逗号、中文逗号或换行分隔,重复项会自动忽略。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅导入可信来源的分享码。",inspectingCodes:"正在检测环境分享码",found:"检测到 {{count}} 个环境:{{names}}。",itemError:"第 {{index}} 个分享码:{{error}}",invalidCode:"分享码无效。",noResult:"服务未返回该分享码的导入结果。",partial:"已导入 {{created}} 个环境,{{remaining}} 个未完成,可重试有效失败项。",inspecting:"正在检测",importing:"正在导入",retryImport:"重试导入",confirm:"确认导入",inspectCodes:"检测分享码"},status:{boundImage:"环境“{{name}}”已绑定已有镜像",queued:"环境“{{name}}”已进入构建队列",savedBuildFailed:"环境已保存,但构建未启动:{{error}}",importedFailed:"已导入 {{created}} 个环境,{{failed}} 个失败",importedDuplicate:"已导入 {{created}} 个环境,{{duplicate}} 个分享码已存在",imported:"已导入 {{count}} 个环境",deleted:"已删除环境“{{name}}”"},deleteTitle:"删除环境",deleteDescription:"确定删除环境“{{name}}”吗?删除后无法恢复。",errors:{repositoryRequired:"请输入公开代码仓库地址。",repositoryHttps:"请输入公开仓库的 HTTPS 地址。",repositoryInvalid:"请输入有效的公开仓库 HTTPS 地址。",imageReferenceWhitespace:"Tag 或 Digest 不能包含空格。",imageDigestInvalid:"Digest 必须是完整的 sha256 值。",imageTagOnly:"这里只填写 Tag,不要重复填写镜像仓库路径。"}},n1e={searchPlaceholder:"搜索资源名称",emptyMessage:"暂无可用选项",searchAriaLabel:"搜索{{label}}",loadingMore:"正在加载更多资源…"},i1e={retryDeployment:"重试部署",retrying:"正在重试…",collapse:"收起错误信息",expand:"展开完整错误信息",copy:"复制完整错误信息"},r1e={steps:"构建步骤",log:"构建日志",syncing:"同步中",loadFailed:"读取失败",synced:"已同步",recentOnly:" · 仅显示最近日志",copiedLog:"已复制构建日志",copyLog:"复制构建日志",copied:"已复制",copy:"复制",logContent:"构建日志内容",waiting:"正在等待 CodePipeline 输出日志…",empty:"暂无构建日志"},s1e={defaultLabel:"Studio 默认环境",defaultDescription:"使用 Studio 预置的标准运行环境",status:{notBuilt:"未构建",preparing:"准备中",queued:"排队中",building:"构建中",scanning:"扫描中",available:"可用",failed:"失败"},label:"运行环境",placeholder:"请选择运行环境",search:"搜索运行环境",loading:"正在加载运行环境…",loadFailed:"加载运行环境失败",noMatches:"未找到匹配的运行环境",unavailable:"当前没有可用的运行环境",selectionUnavailable:"所选运行环境当前不可用,请重新选择。",selectionHint:"选择构建完成的运行环境后,部署将使用其镜像和工具配置。",versionChanged:"所选环境版本已更新,请确认后继续。",versionMissing:"所选环境版本已不存在,请重新选择。",operatingSystem:"操作系统",language:"语言",image:"镜像",imageVersion:"镜像版本",skills:"技能",tools:"工具",noSkills:"未配置 Skill",noExtraTools:"未配置额外工具",defaultGuidance:"默认环境由 Studio 管理,无需额外配置。",persistenceFallback:"持久化环境服务暂不可用,当前使用默认环境。",emptyFallback:"当前没有可选择的自定义环境。"},a1e={repository:"GitHub 仓库",githubUrl:"GitHub 地址",token:"访问令牌",sessionToken:"{{provider}} 临时令牌",runtime:"Runtime",commit:"提交",workflow:"工作流",syncFailed:"同步 GitHub 代码失败",status:{mounted:"已挂载",bound:"已绑定",synced:"已同步",created:"已创建"},volcengine:"火山引擎",mountDelivery:"挂载持续交付",selectedForDeployment:"已选择,部署时挂载",mountOnDeploy:"部署时挂载持续交付",syncCode:"同步代码",deliveryMode:"GitHub 交付模式",sourceSync:"GitHub 代码同步",delivery:"GitHub 交付",loading:"读取中",running:"执行中",runtimeDeliveryHint:"写入 AgentKit Runtime GitHub Actions workflow,后续 GitHub 提交会更新绑定 Runtime。",initialDeliveryHint:"首次部署成功后初始化目标分支,后续 GitHub 提交会更新绑定 Runtime。",sourceSyncHint:"Studio 会直接 push 到目标分支;该分支由 Studio 管理,远端冲突时同步会失败。Runtime 仍由部署按钮发布。",tokenPlaceholder:"repo 或 contents write 权限",getToken:"获取 Token",hideToken:"隐藏 Token",showToken:"显示 Token",tokenHelp:"Token 仅用于本次操作,成功后不会保留在表单中。",targetBranch:"目标分支",actionsSecretPlaceholder:"用于写入 GitHub Actions Secret",sessionTokenPlaceholder:"临时凭证可选",syncing:"同步中…",pendingHint:"已选择挂载持续交付。点击部署后,Studio 会等待 Runtime 创建完成并初始化 GitHub 目标分支,初始化成功后才完成部署流程。",result:{deliveryMounted:"已挂载持续交付",deliverySelected:"已选择挂载持续交付",githubBound:"已绑定 GitHub",codeSynced:"代码已同步",deliveryHint:"目标分支提交会触发 Runtime 持续交付。",boundHint:"更新并发布时会先同步当前源码到这个分支。"},branch:"分支",viewPr:"查看 PR",createFailed:"创建失败",phase:"阶段",log:"日志"},o1e={name:"飞书",enabling:"正在启用并更新配置…",description:"接收消息并通过飞书机器人回复",configuration:"飞书配置",configurationMode:"飞书配置方式",automatic:"自动配置",manual:"手动配置",cancelling:"取消中…",scanToCreate:"扫码创建",scanDescription:"授权后自动回填凭据",generateQrCode:"生成二维码",qrCodeAlt:"飞书机器人配置二维码",scanToConfirm:"飞书扫码确认",expiresIn:"{{time}} 后失效",created:"机器人已创建",credentialsFilled:"应用凭据已自动回填",qrCodeExpired:"二维码已失效",automaticFailed:"自动配置失败",regenerateQrCode:"请重新生成二维码。",configuredPlaceholder:"已配置,留空沿用",appSecretPlaceholder:"请输入 App Secret",hideSecret:"隐藏 App Secret",showSecret:"显示 App Secret"},l1e={mode:{auto:"自动创建",autoDescription:"部署时自动创建所需资源",recommended:"推荐",create:"指定名称",createDescription:"使用指定名称创建或复用资源",existing:"选择已有",existingDescription:"从当前账号的已有资源中选择"},selectExisting:"请选择已有资源",searchResource:"搜索资源名称",noMatch:"未找到匹配资源",noAvailable:"暂无可用资源",searching:"正在搜索云资源…",loading:"正在加载云资源…",noMatchSentence:"未找到匹配资源。",noAvailableSentence:"暂无可用资源。",loadedSummary:"实际服务区域:{{region}} · 已加载 {{loaded}}{{total}}",registryInstance:"Registry 实例",registryAriaLabel:"镜像仓库 Registry 实例",namespace:"命名空间",namespaceAriaLabel:"镜像仓库 Namespace",repository:"镜像仓库",existingRepository:"已有镜像仓库",selectRegistryFirst:"请先选择 Registry 实例。",selectNamespaceFirst:"请先选择 Namespace。",configurationMode:"配置方式",configurationModeAriaLabel:"{{resource}}配置方式",selectConfigurationMode:"请选择配置方式",automaticNames:"自动创建名称",validation:{tos:"请填写或选择 TOS 存储桶。",cr:"请完整填写或选择 CR 实例、命名空间和镜像仓库。",codePipeline:"请完整填写或选择 CodePipeline Workspace 和 Pipeline。",existingCodePipeline:"请选择已有的 CodePipeline Workspace 和兼容 Pipeline。"},autoBucketWithRegion:"agentkit-platform-{账号 ID}-{{region}}",autoBucket:"agentkit-platform-{账号 ID}",tosBucket:"TOS 存储桶",bucketName:"存储桶名称",bucketNamePlaceholder:"输入存储桶名称",existingBucket:"已有存储桶",existingTosBucket:"已有 TOS 存储桶",bucket:"存储桶",accountIdResolved:"账号 ID 在部署时按当前云账号解析。",containerRegistry:"容器镜像仓库(CR)",instanceName:"实例名称",crInstance:"CR 实例",existingCrInstance:"已有 CR 实例",existingCrNamespace:"已有 CR 命名空间",existingCrRepository:"已有 CR 镜像仓库",autoRegistry:"agentkit-platform-{账号 ID}",autoRepositoryName:"{{name}}-{4 位随机字符}",registryNameNote:"账号 ID 在部署时解析,镜像仓库的随机字符在部署时生成。",workspace:"工作空间",pipeline:"流水线",workspaceName:"Workspace 名称",pipelineName:"Pipeline 名称",existingWorkspace:"已有 CodePipeline Workspace",compatiblePipeline:"兼容 Pipeline",existingPipeline:"已有 AgentKit CodePipeline",pipelineNameNote:"Pipeline 与 Runtime 名称一致。"},c1e={commit:"提交",steps:{permissions:"预检 OTA 所需权限",resolving:"读取目标版本信息",downloading:"下载并校验完整更新包",preparing:"准备 VeFaaS Function 代码",provisioning:"检查并补齐 Studio 云资源",scheduler:"更新定时任务调度服务",submitting:"提交 Function 更新",publishing:"发布新 Revision 并重启服务"},stages:{permissions:"预检 OTA 权限",resolving:"读取版本信息",downloading:"下载更新包",preparing:"准备 Function 代码",provisioning:"补齐 Studio 云资源",scheduler:"更新定时任务调度服务",submitting:"提交 Function 更新",publishing:"发布 Revision",checking:"检查更新",unknown:"未知阶段"},duration:{seconds:"{{count}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},logPermissionPrefix:"无法读取 VeFaaS 发布日志。Function 角色缺少 ",logPermissionSuffix:" 权限,更新会继续。",openIamConsole:"前往 IAM 控制台配置权限",deploymentProgress:"部署进度",live:"实时",completed:"已完成",stopped:"已停止",copied:"已复制",copyFailed:"复制失败",copyLog:"复制日志",waitingForLogs:"等待 VeFaaS 返回更新日志…",noLogs:"本次更新未返回发布日志",messages:{updated:"Studio 已更新,新 Revision 已接管服务",failed:"Studio 更新失败",timeout:"等待 VeFaaS 发布超时,请稍后重新检查版本",submitted:"更新已提交,正在等待 VeFaaS 发布新版本",connectionSwitched:"连接已切换,正在确认新版本状态"},checkingPermissions:"正在检查 OTA 权限",authorizationRequired:"需要 IAM 授权",updating:"正在更新 Studio",updated:"Studio 已更新",updateToVersion:"更新 Studio 至 {{version}}",checkPermissions:"检查更新权限",authorizationNeeded:"需要授权",updatingShort:"正在更新",refreshForNewVersion:"刷新使用新版",updateFailed:"更新失败",updateNow:"立即更新",newVersionAvailable:"有新版更新",dialog:{failed:"Studio 更新失败",checkingPermissions:"正在检查更新权限",authorizationRequired:"需要 IAM 授权",updating:"正在更新 Studio",completed:"Studio 更新完成",newVersion:"发现新版本"},permissionCheck:"正在核对 OTA 与定时任务所需的全部 IAM 权限…",permissionCheckHint:"权限全部满足后才会开始下载、更新或发布云资源。",missingPermissionCount:"当前 Function 角色缺少 {{count}} 项 OTA 更新权限,尚未执行任何云资源变更。",functionRole:"Function 角色",currentRole:"当前运行角色",policyToUpdate:"将更新策略",authorizationSteps:{open:"打开授权页面,确认已预填的策略名称和完整策略内容。",debug:"点击页面中的“发起调试”,完成策略更新。",return:"返回此窗口,点击“我已授权,重新检查”。"},missingPermissions:"缺少的权限",openPrefilledAuthorization:"打开已预填的 IAM 授权页面",openIamManually:"前往 IAM 控制台手动配置",noSafePolicy:"当前角色没有唯一可安全更新的自定义策略,请由管理员将上述权限加入该角色。",failedStage:"失败阶段",errorId:"错误 ID",notGenerated:"未生成",openFunctionLogs:"前往 VeFaaS 控制台查看 Function 日志",targetVersion:"目标版本",updateStatus:"更新状态",elapsed:"已用时",progressAriaLabel:"Studio 更新进度",processingUpdate:"正在处理更新",processing:"正在处理",backgroundHint:"发布阶段会短暂中断连接;关闭此窗口不会停止更新,可随时点击右上角按钮重新查看。",confirmDescription:"更新会重启 Studio 服务,预计约 3–5 分钟完成更新与发布。期间正在进行的对话、流式响应或部署任务可能中断,登录态不会受到影响。",selectVersion:"选择版本",currentVersion:"当前版本",changelog:"更新内容",noChangelog:"暂无更新说明",runInBackground:"后台运行",authorizedRecheck:"我已授权,重新检查",tryAgain:"重新尝试"},u1e={deploy:"部署",update:"更新",planHash:"方案哈希",backToConfiguration:"返回配置",releaseRegion:"发布区域",deployRegion:"部署区域",regionPreserved:"更新时沿用现有 Runtime 的部署区域,无法修改。",unnamedAgent:"未命名 Agent",deployTitle:"部署 {{name}}",additionalAgentCount:" 等 {{count}} 个智能体",releaseOverview:"发布概览",agentOverview:"Agent 概览",agentCount:"Agent 数量",model:"模型",systemPrompt:"系统提示词",optimizations:"优化选项",notEnabled:"未启用",effectiveCapabilities:"生效能力",automaticProtection:"自动保护",artifactActions:"发布产物操作",exportYaml:"导出 YAML",viewSource:"查看源代码",downloadSource:"下载源代码",expandFlow:"放大查看执行流程",expand:"放大查看",deploymentConfiguration:"部署配置",runtimeName:"Runtime 名称",runtimeNamePreserved:"更新时保持现有 Runtime 名称不变。",runtimeNameHint:"默认根据 Root Agent 名称生成,并添加随机后缀避免重名;支持 4-64 位字母、数字、连字符和下划线",accessAuthentication:"访问鉴权",authenticationPreserved:"更新时保持现有 Runtime 的鉴权方式不变。",authenticationMethod:"鉴权方式",authenticationAriaLabel:"部署鉴权方式",authenticationPlaceholder:"请选择鉴权方式",messageChannels:"消息渠道",instanceSettings:"实例设置",minInstances:"最小实例数",maxInstances:"最大实例数",sidecarSingleInstance:"Harness Sidecar 首期仅支持单实例,Runtime 固定为 1~1",inMemorySingleInstance:"为避免多实例间会话丢失,推荐将 Runtime 固定为 1~1",network:"网络",networkPreserved:"现有 Runtime 的区域与网络模式保持不变。",networkMode:"网络模式",networkModes:{public:"公网",both:"公网 + VPC"},subnetId:"子网 ID",subnetHint:"可选,多个用逗号分隔",sharedInternetAccess:"VPC 内共享公网出口",evaluationSets:"评测集",createEvaluationSets:"自动创建评测集",createEvaluationSetsHint:"部署成功后,自动创建 Good Case 和 Bad Case 评测集。",resourceConfiguration:"资源配置",environmentVariables:"环境变量",environmentVariablesHint:"组件配置会自动同步到这里,部署前可核对最终值。",itemCount:"{{count}} 项",addVariable:"添加变量",componentGenerated:"组件自动生成",injectedByApiKey:"由所选 API Key 注入",envNameAriaLabel:"{{key}} 环境变量名",envDescriptionAriaLabel:"{{key}}说明:{{description}}",openOpenViking:"打开 OpenViking {{label}}",openOpenVikingAriaLabel:"{{key}}:打开 OpenViking {{label}}",requiredEmpty:"必填,尚未填写",optionalEmpty:"可选,尚未填写",envValueAriaLabel:"{{key}} 环境变量值",automatic:"自动",synced:"同步",customModelCredentials:"自定义模型凭据",releaseOnlySecret:"必填,仅用于本次发布",thisRelease:"本次发布",customVariables:"自定义变量",value:"值",deleteVariable:"删除变量",deploymentProgress:"部署进度",retryUpdate:"重试更新",retryDeploy:"重试部署",updateSucceeded:"更新成功",deploySucceeded:"部署成功",region:"区域",agentName:"Agent 名称",apiEndpoint:"API 端点",connecting:"连接中…",chatNow:"立即对话",console:"控制台",actionInProgress:"{{action}}中…",checkingName:"正在检查名称…",retryAction:"重试{{action}}",flowPreview:"执行流程预览",executionFlow:"执行流程",flowPreviewHint:"只读预览,可缩放与拖动画布",closeFlowPreview:"关闭执行流程预览",agentAdded:'Agent "{{name}}" 已添加到左上角下拉列表!',files:{preview:"文件预览",new:"新建文件",empty:"暂无文件",noneSelected:"未选择文件",selectToView:"选择左侧文件以查看内容",loadingEditor:"加载编辑器…",rename:"重命名",renamePrompt:"重命名文件"},apiKey:{selectFirst:"请先选择 API Key",revealing:"正在显示 API Key",hide:"隐藏 API Key",retryReveal:"重试显示 API Key",reveal:"显示 API Key"},task:{preparing:"准备部署",waitingBuildLog:"正在等待构建日志…",waitingGithubLog:"正在等待 GitHub 挂载日志…",syncingGithub:"正在同步当前源码到 GitHub",syncGithubCode:"同步 GitHub 代码",githubSynced:"GitHub 代码已同步",githubSubmitted:"GitHub 代码已提交",githubUpdatingRuntime:"代码已提交到 GitHub,GitHub Actions 正在更新同一个 Runtime",initializingGithub:"开始初始化 GitHub main 分支与 Actions workflow",initializingGithubBranch:"正在初始化 GitHub 持续交付目标分支",mountGithubDelivery:"挂载 GitHub 持续交付",githubBranchInitialized:"GitHub 持续交付已初始化目标分支",githubDeliveryMounted:"GitHub 持续交付已挂载",githubMountFailed:"挂载 GitHub 持续交付失败",githubMountFailedDetail:"GitHub 持续交付挂载失败:{{message}}",githubMountFailedHint:"挂载 GitHub 持续交付失败,详见 GitHub 日志。",applyingMpaProfile:"正在将 Agent 配置应用到 MPA Runtime",mpaProfileApplied:"MPA Runtime 配置已应用",runningMpaSmoke:"正在验证 MPA Runtime 执行链路",mpaReady:"MPA Runtime 已可运行",deploymentComplete:"部署完成",deployedNotConnected:"部署完成,暂未连接",cancelled:"已取消",cancelledHint:"部署已取消,相关 Runtime 资源已请求销毁。",deploymentStatusUnconfirmed:"部署状态待确认",deploymentFailed:"部署失败",buildFailedHint:"构建镜像失败,详见构建日志。"},confirm:{updateTitle:"确认更新",deployTitle:"确认部署",closeLabel:"关闭部署确认",updateDescription:"将更新并发布到当前云端 Runtime,过程可能需要几分钟。确定继续吗?",deployDescription:"将创建新的云端 Runtime,部署过程可能需要几分钟。确定继续吗?",update:"确定更新",deploy:"确定部署"},userPool:{label:"用户池",unnamed:"未命名用户池",current:"当前用户池",ariaLabel:"部署用户池",loading:"正在加载用户池…",placeholder:"请选择用户池",loadingIdentity:"正在加载 Identity 用户池…",empty:"当前账号下暂无 Identity 用户池。",currentHint:"当前 Studio 的登录 JWT 将透传访问此 Runtime。",mismatchHint:"所选用户池不是当前 Studio 使用的用户池,部署后无法从 Studio 调用此 Runtime。",markedHint:"当前 Studio 使用的用户池已在列表中标注。"},authentication:{apiKeyDescription:"默认方式,使用 Runtime API Key 访问",userPool:"用户池",userPoolDescription:"使用 Identity 用户池签发的 JWT"},steps:{buildImage:"构建镜像",deploy:"部署",publish:"发布",syncCode:"同步代码",uploadPackage:"上传代码包",packageImage:"镜像打包",createRuntime:"创建 Runtime",publishService:"发布服务",updateInstances:"更新实例配置",createEvaluationSets:"创建评测集",applyMpaProfile:"应用 MPA 配置",verifyMpaRuntime:"验证 MPA Runtime",mpaReady:"MPA Runtime 可运行"},errors:{instanceRangeInteger:"最小实例数必须为大于等于 0 的整数,最大实例数必须为大于 0 的整数。",instanceRangeOrder:"最小实例数不能大于最大实例数。",selectApiKey:"请先在模型配置中选择 API Key。",loadApiKey:"加载 API Key 失败,请重试。",invalidProject:"项目数据无效",updateFeishu:"更新飞书配置失败:{{message}}",userPoolRequired:"请选择用于 Runtime 鉴权的用户池。",vpcRequired:"使用 VPC 网络时,请填写 VPC ID。",modelSecretRequired:"请填写 {{label}},用于访问对应的自定义模型地址。",managedApiKeyRequired:"{{requirement}},请先返回模型配置选择 API Key。",feishuEnvRequired:"启用飞书后,请填写{{field}}。",runtimeNameExists:"Runtime 名称已存在,请修改后重试。",deployedButGithubMountFailed:"部署成功,但挂载 GitHub 持续交付失败:{{message}}",deployedButGithubBindFailed:"部署成功,但绑定 GitHub 失败:{{message}}",mpaRuntimeIdMissing:"部署成功,但返回缺少 Runtime ID,无法应用 MPA 配置。",mpaOperationIncomplete:"MPA Runtime 初始化未完成,请重试此部署任务。",deploymentStatusUnconfirmed:"连接已中断,当前无法确认部署最终状态。任务可能仍在云端运行,请到 AgentKit 或 Code Pipeline 查看同一任务,避免重复部署。",failedAtStage:"{{action}}失败({{stage}}阶段):{{message}}",noAgentAtEndpoint:"连接成功,但该地址未发现任何 Agent(/list-apps 为空)。",addAgent:"添加 Agent 失败:{{message}}",modelApiKeyRequired:"请填写此模型地址对应的 API Key。"}},d1e={title:"工作区",storageUnavailable:"管理员未配置持久化存储,工作区管理暂不可用。",detail:"工作区详情",create:"新建工作区",editorDescription:"将常用环境组合在一起;同一个环境可以加入多个工作区。",backToList:"返回工作区列表",environmentCount_one:"{{count}} 个环境",environmentCount_other:"{{count}} 个环境",createdAt:"创建时间",updatedAt:"最近更新",basicInfo:"基本信息",namePlaceholder:"例如:内容生产",descriptionPlaceholder:"说明这个工作区的用途",selectedEnvironmentCount:"已选择 {{count}} 个,可在其他工作区中继续复用",searchAvailableEnvironments:"搜索可用环境",searchEnvironments:"搜索环境",noAvailableEnvironments:"还没有可添加的环境",createEnvironmentFirst:"请先在“环境”页面创建并构建环境。",noMatchingEnvironments:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称。",environmentStatus:{available:"可用",building:"构建中",notBuilt:"未构建"},added:"已添加",saved:"已保存工作区“{{name}}”",resourceType:"工作区资源类型",searchWorkspaces:"搜索工作区",loadFailed:"无法加载工作区",noMatchingWorkspaces:"没有匹配的工作区",tryAnotherNameOrEnvironment:"请尝试搜索其他名称或环境",noEnvironmentAdded:"未添加环境",environmentMissing:"环境缺失",availableFraction:"{{available}}/{{total}} 可用",available:"可用",availableCount:"{{count}} 个可用",updated:"更新",addEnvironment:"添加环境",deleteTitle:"删除工作区",deleteDescription:"确定删除工作区“{{name}}”吗?环境本身不会被删除。",deleted:"已删除工作区“{{name}}”",clipboardPermissionError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。",codeProjects:"代码项目"},f1e={back:"返回",detailNavigation:"详情导航",noData:"暂无数据",actions:"操作",moreActions:"更多操作 {{label}}",actionsFor:"{{label}} 操作",loading:"资源加载中,请稍候"},h1e={addSkill:"添加 Skill",remove:"移除 {{name}}",confirmRemoveRuntime:"从新版本中移除运行中的 Skill「{{name}}」?",selectedCount:"已加入技能 · {{count}}",close:"关闭{{label}}",sources:{runtime:"运行中来源 · 原样保留,可移除或用同名 Skill 替换",local:"本地",skillspace:"AgentKit Skills 中心",skillhub:"火山 Find Skill 技能广场"},tabs:{local:"本地文件",localShort:"本地文件",skillspace:"AgentKit Skills 中心",skillspaceShort:"AgentKit",skillhub:"火山 Find Skill 技能广场",skillhubShort:"Find Skill"}},p1e={model:"模型",turnControls:"流程控制",pause:"暂停",resume:"恢复",interrupt:"中断",cancel:"取消",pauseTurn:"在安全点暂停完整流程",resumeTurn:"恢复完整流程",interruptTurn:"中断当前流程并保留会话上下文",cancelTurn:"取消当前流程且不可恢复",turnState:{running:"运行中",pausing:"正在到达安全点",paused:"已暂停",resuming:"正在恢复",interrupting:"正在中断",cancelling:"正在取消",interrupted:"已中断",completed:"已完成",failed:"失败",cancelled:"已取消",orphaned:"状态待确认",newTurnRequired:"需要从检查点继续"},tasks:{ppt:"PPT",image:"图片生成",video:"视频生成"},prompts:{ppt:{quarterlyReview:"复盘【季度】经营表现,提炼指标差距、原因与行动建议",projectUpdate:"汇报【项目名称】进展:里程碑、风险、预算和资源诉求",solutionProposal:"为【客户行业】输出解决方案:痛点、架构、实施路径与收益",industryAnalysis:"分析【行业主题】趋势,给出竞争格局、机会与战略建议"},image:{launchVisual:"为【品牌或产品】设计【高级科技】风格的发布会主视觉",ecommercePoster:"生成【产品名称】电商海报,突出【核心卖点】与品牌色",conceptRendering:"呈现【产品或空间】在【使用场景】中的写实概念效果图",socialGraphic:"围绕【传播主题】制作简洁专业的企业社媒配图"},video:{brandFilm:"制作【品牌名称】30 秒宣传片,突出【品牌价值】",productLaunch:"为【产品名称】制作 45 秒发布视频:痛点、功能、场景与行动号召",trainingVideo:"制作【培训主题】企业培训视频,讲清【关键操作或规范】",eventTeaser:"生成【活动名称】20 秒预热视频,包含亮点、时间地点和报名信息"}},firstFrame:"首帧",videoToEdit:"待编辑视频",baseVideo:"基础视频",optimizeSkillPlaceholder:"描述你想优化的技能…",createSkillPlaceholder:"描述你想生成的技能…",createVideoPlaceholder:"描述你想创作的视频…",messageAgentPlaceholder:"向 {{name}} 发消息…",selectAgentFirst:"请先选择智能体",selectSkillFirst:"请先选择需要优化的 Skill",availableSkills:"可用技能",availableSubagents:"可用子 Agent",invokeSkill:"调用技能",useSubagent:"使用子 Agent",loadingCapabilities:"正在读取 Agent 能力…",noMatchingSkills:"当前 Agent 没有匹配技能",noMatchingSubagents:"当前 Agent 没有匹配子 Agent",skillFallbackDescription:"加载并执行该技能",agentFallbackDescription:"将本轮交给该 Agent",skill:"技能",uploadImage:"上传图片",uploadDocument:"上传文档或 PDF",uploadVideo:"上传视频",taskMode:"任务模式",selectTaskMode:"选择任务模式",loadingGenerationModel:"正在加载生成模型",modelUnavailable:"模型不可用",cancelTask:"取消{{task}}任务",stopGenerating:"停止生成",viewVideoProgress:"查看视频生成进度",send:"发送",selectTaskType:"选择任务类型",enterprisePrompts:"{{task}}企业提示词",sessionId:"会话 ID",sessionIdLabel:"会话 ID:",initializing:"初始化中",copied:"已复制",copySessionId:"复制会话 ID",sessionIdCopied:"已复制会话 ID",disclaimer:"回答仅供参考",viewLogs:"查看日志"},m1e={selectAgent:"选择 Agent",noLocalAgents:"暂无本地 Agent。",searchRuntime:"搜索 Runtime 名称",mineOnly:"只看我创建的",noRuntimes:"暂无 Runtime。",unsupported:"不支持",createdByMe:"我创建的",connecting:"连接中…",connected:"已连接",connect:"连接",viewInfoFor:"查看 {{name}} 信息",viewInfo:"查看信息",agentAndRuntimeInfo:"Agent 与 Runtime 信息",detailType:"详情类型",agentInfo:"Agent 信息",runtimeInfo:"Runtime 信息",loadingAgentInfo:"读取 Agent 信息…",cannotLoadAgentInfo:"暂时无法读取 Agent 信息",unnamedAgent:"未命名 Agent",subagents:"子 Agent",tools:"工具",skills:"技能",previewUnsupported:"暂不支持预览",mountedComponents:"挂载组件",noMoreAgentInfo:"暂无更多 Agent 配置信息。",local:"本地",model:"模型",status:"状态",memoryMb:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",resources:"资源",version:"版本",loadingDetails:"读取详情…",environmentVariables:"环境变量",errors:{notFound:"该 Runtime 已不存在或列表信息已过期,请刷新列表后重试。",accessDenied:"当前账号无权访问该 Runtime,请检查所属 Project 和访问权限。",previewUnsupported:"该 Agent Server 版本暂不支持信息预览。",unavailable:"该 Runtime 暂时无法访问,请确认其状态为“就绪”后重试。",timeout:"加载超时,请重试"},componentKinds:{knowledgebase:"知识库",memory:"记忆",prompt_manager:"提示词管理",example_store:"样例库",run_processor:"运行处理器",tracer:"链路追踪",toolset:"工具集",plugin:"插件",other:"其他"},runtimeStatus:{ready:"就绪",unreleased:"未发布",running:"运行中",active:"运行中",creating:"创建中",pending:"等待中",deploying:"部署中",updating:"更新中",failed:"失败",error:"异常",stopping:"停止中",stopped:"已停止",deleting:"删除中",deleted:"已删除"}},g1e={agent:"智能体",agentTypes:{general:"通用智能体",mpa:"MPA 智能体",codex:"Codex","deepseek-harness":"DeepSeek",openclaw:"OpenClaw",hermes:"Hermes"},creator:"创建人",namedAgent:"{{name}} 智能体",storageLocation:"存储位置",currentBrowser:"当前浏览器",region:"地域",viewDeploymentProgress:"查看 {{name}} 部署进度",viewRuntimeDetails:"查看 {{name}} Runtime 详情",viewDetails:"查看 {{name}} 详情",time:"时间",remainingTime:"剩余时间",expiringSoon:"即将清空",sandboxRemaining:"{{hours}} 小时 {{minutes}} 分钟",wakeable:"已休眠",neverExpires:"永不过期",editDraftNamed:"编辑草稿 {{name}}",viewProgress:"查看进度",deleteDraftNamed:"删除草稿 {{name}}",recheckCompatibility:"重新检测 {{name}} 的对话兼容性",connectedNamed:"{{name}} 已连接",wakeAndChat:"唤醒 {{name}} 并开始对话",chatWith:"与 {{name}} 对话",waking:"唤醒中",deploying:"部署中",draft:"草稿",checking:"检测中",chatUnsupported:"不支持对话",checkFailed:"检测失败",creatorFilter:"创建人筛选",agentType:"智能体类型",searchAgents:"搜索智能体",handoff:"接力",agentList:"{{type}}列表",noMatchingAgents:"没有匹配的智能体",adjustSearch:"请尝试调整搜索或筛选条件",noAgentType:"暂无 {{type}}",noGeneralAgents:"暂无通用智能体",createGeneralAgentDescription:"创建一个通用智能体,开始构建和对话",createAgentType:"创建{{type}}",createAgent:"创建智能体",loadingMore:"正在加载更多智能体",scrollForMore:"继续下滑加载更多",allLoaded:"已加载全部智能体",deleteDraftTitle:"删除草稿?",deleteDraftDescription:"删除后将无法恢复“{{name}}”。",deleteDraft:"删除草稿",loadGeneralAgents:"加载通用智能体",loadAgentType:"加载 {{type}}",compatibility:{checking:"正在请求 Runtime /list-apps,以确认该智能体是否支持 Studio 对话。",empty:"Runtime /list-apps 未返回可用的 Agent,暂时无法连接对话。",supported:"Runtime 支持 Studio 对话。",unknownError:"Runtime /list-apps 请求失败,未返回可识别的错误信息。"},sandboxStatus:{ready:"就绪",wakeable:"已休眠",creating:"创建中",starting:"启动中",initializing:"启动中",pending:"等待中",running:"运行中",failed:"异常",error:"异常",stopped:"已停止",expired:"已过期",deleting:"删除中",deleted:"已删除",unknown:"未知状态"},wakingHint:"正在唤醒智能体,可能需要一些时间。",mpaCreate:{name:"名称",namePlaceholder:"例如 test-agent",nameHelp:"作为 Runtime 名称,支持 4–64 位字母、数字、下划线或连字符。",stepsLabel:"创建步骤",steps:{basics:"基本信息",postgres:"PostgreSQL",openviking:"OpenViking",autoPostgres:"数据库"},next:"下一步",previousStep:"上一步",pgDescription:"选择已有的 PostgreSQL 实例。创建流程会在该实例中准备智能体的独立业务库。",pgSplitDescription:"使用已配置的业务 PG Workspace。多个智能体共用此 Workspace,每个智能体拥有独立业务库。共享资源记录单独存放在 mpa_admin_workspace / mpa_admin_db,由管理员配置。",pgConsole:"前往火山引擎 AIDAP 创建或查看 PG Workspace",pgHost:"PG 主机地址",pgPort:"PG 端口",pgInvalid:"请填写有效的 PG 主机地址和端口。",pgCredentials:"PG 连接账号和密码由部署服务配置;主机和端口须与服务端配置一致。",openvikingDescription:"可选。三项全部填写才启用 OpenViking;全部留空则不向新智能体注入 OpenViking 配置。",openvikingConsole:"前往火山引擎查看 OpenViking 资源",openvikingUrl:"OpenViking 服务地址",openvikingResourceId:"OpenViking 资源 ID",openvikingApiKey:"OpenViking API Key",openvikingInvalid:"请同时填写有效的 HTTPS 服务地址、资源 ID 和 API Key,或全部留空。",openvikingCredentials:"API Key 仅用于本次创建,不保存到浏览器草稿;刷新页面后需重新填写。",tosTitle:"会话输出存储",tosDescription:"可选。填写完整的 TOS 凭证和存储桶,为新智能体的每个会话挂载独立输出目录。三项均留空时使用服务端预设;服务端未配置时,不启用 TOS 挂载。",tosAccessKey:"TOS Access Key",tosSecretKey:"TOS Secret Key",tosBucket:"TOS 存储桶",tosInvalid:"TOS Access Key、Secret Key 和存储桶必须同时填写。",tosCredentials:"凭证仅用于本次创建,不会保存在浏览器恢复数据或创建任务记录中。",runtimeImage:"MPA 镜像",workerImage:"Worker 镜像",imageDefault:"留空使用配置文件中的默认镜像",imageInvalid:"请输入有效的镜像地址,不要包含网址、空格或登录凭据。",title:"创建 MPA 智能体",agentId:"智能体 ID",description:"描述",region:"部署地域",plan:"创建计划",sharedResources:"准备或复用账号共享 VPC、子网和 APIG 消息网关",agentResources:"准备独立业务库、技能空间和执行环境,部署智能体",readiness:"检查网关和智能体就绪状态,成功后加入列表",checking:"正在检查创建配置…",configured:"创建配置已就绪。提交后会检查云资源并开始准备。",notConfigured:"尚未配置创建所需的资源参数,请联系管理员配置后重试。",loadFailed:"检查创建配置失败,请重试。",reload:"重新检查",submit:"开始创建",retry:"重试创建",newAgent:"新建另一个智能体",newAgentDescription:"新建另一个智能体将开启可编辑的新请求,替换当前恢复草稿,但不会取消旧任务。旧任务仍在运行时,请等待其结束后再提交。",close:"关闭",cancel:"取消创建",confirmCancel:"确认取消",cancelDescription:"取消后会停止后续步骤。已创建的数据库、技能空间、网关和其他已登记资源会保留,可使用同一智能体 ID 重试。",background:"关闭窗口后创建会继续。再次打开可查看进度。",pollFailed:"暂时无法获取进度,正在重新连接。请勿重复创建其他智能体。",iamPermissionDenied:"部署服务没有准备运行角色所需的 IAM 权限,请联系管理员授权后重试。",iamTrustConflict:"运行角色的信任关系不符合要求,请管理员检查对 VeFaaS 和 APIG 的授权后重试。",iamPolicyConflict:"运行角色所需的同名权限策略内容冲突,请管理员检查后重试。",iamOwnershipConflict:"运行角色与当前部署账号不匹配,请管理员检查后重试。",iamVerificationFailed:"尚未确认运行角色的权限已就绪,请检查 IAM 服务及策略可用性后重试。",iamConfigurationConflict:"自动准备运行角色仅支持默认 MPA 角色,请检查服务端创建配置。",creationFailed:"当前步骤未完成,请检查对应资源、服务端配置及权限后,用同一智能体 ID 重试。",cancelFailed:"取消请求失败,请重新查询进度后重试。",cancelled:"创建已取消,已登记资源保留供重试。",timeout:"创建超时,已登记资源保留。请检查对应资源后重试。",interrupted:"创建任务中断。请用同一智能体 ID 重试以恢复已登记资源。",skillSpace:"技能空间",states:{running:"正在创建",cancelling:"正在取消",succeeded:"创建成功",failed:"创建失败",cancelled:"已取消"},stages:{queued:"等待开始",iam_role:"准备运行角色",checking:"检查账号与配置",network:"准备 VPC 和子网",gateway:"准备 APIG 和 IM Gateway",database:"准备业务数据库",skills:"准备技能空间",worker:"准备执行环境",deploying:"准备数据库、技能空间和 Runtime",verifying:"等待智能体就绪",admin_workspace:"准备管理 PG Workspace",business_workspace:"准备业务 PG Workspace",admin_database:"初始化共享管理库"},back:"继续创建",pgAutoDescription:"使用 VeADK 部署账号自动创建或复用两个 PG Workspace:mpa_admin_workspace / mpa_admin_db 存放共享资源记录,业务 Workspace 供多个智能体共用,每个智能体拥有独立业务库。无需填写 PG 连接信息,提交创建后开始准备。",pgModeChanged:"此创建任务使用旧的 PG 配置,不能直接切换为自动模式重试。请联系管理员确认已有资源和任务后重新创建。",pgMigrationRequired:"检测到旧共享注册库。请先将共享资源记录迁移到 mpa_admin_workspace / mpa_admin_db,并完成现有 Runtime 的注册库地址切换;完成后点击“重新检查”。"}},b1e={library:"技能库",skill:"技能",skills:"技能",skillSpace:"技能空间",sandboxNotConfigured:"管理员未配置 Dev Sandbox",adminNotConfigured:"管理员未配置",totalItems:"共 {{count}} 项",cannotLoadSpaces:"无法加载技能空间",someSpacesFailed:"部分技能空间加载失败",degradedRelationWarning:"部分关联异常,已恢复可读取技能",downloadZip:"下载 ZIP",optimize:"优化",closeSkillDetails:"关闭技能详情",skillId:"技能 ID",allFiles:"完整文件",loadingSkillContent:"正在读取技能内容…",noSkillContent:"该技能暂无 SKILL.md 内容",addSkill:"添加技能",localUpload:"本地上传",localUploadDescription:"选择 ZIP 文件,校验通过后上传到技能空间",autoCreate:"自动创建",autoCreateDescription:"选择模型和风格,通过对话生成技能",createSkill:"创建技能",optimizeNamed:"优化 {{name}}",deleteSkillConfirm:"确定删除整个 Skill“{{name}}”吗?此操作会影响所有引用它的空间。",deleteSpaceConfirm:"确定删除 Skill 空间“{{name}}”吗?请先确认空间中的技能已删除。",manageSpaceDescription:"管理空间中的技能并创建新的版本",backToSpaces:"返回技能空间列表",overview:"概览",skillCount:"技能数量",skillCountValue_one:"{{count}} 技能",skillCountValue_other:"{{count}} 技能",updatedAt:"更新时间",skillsInSpace:"{{name}}中的技能",searchSkills:"搜索技能",cannotLoadSkills:"无法加载技能",noMatchingSkills:"没有匹配的技能",noSkills:"暂无技能",tryAnotherName:"请尝试搜索其他名称",emptySkillsDescription:"本地上传 Skill,或自动创建",actions:"操作",spaceDetails:"技能空间详情",editSpace:"编辑空间",deleteSpace:"删除空间",searchSpaces:"搜索技能空间",spaceList:"技能空间列表",noMatchingSpaces:"没有匹配的技能空间",createSpace:"新建技能空间",newSpace:"新建空间",loadingMoreSpaces:"正在加载更多技能空间",scrollForMore:"继续下滑加载更多",allSpacesLoaded:"已加载全部技能空间",errors:{loadSpaces:"读取技能空间失败,请稍后重试",loadSkills:"读取技能失败,请稍后重试",loadSkillDetails:"读取技能详情失败,请稍后重试",deleteSkill:"删除 Skill 失败",deleteSpace:"删除 Skill 空间失败",downloadSkill:"下载 Skill 失败"},status:{active:"可用",available:"可用",creating:"创建中",disabled:"已停用",enabled:"已启用",failed:"异常",inactive:"未启用",pending:"等待中",published:"已发布",ready:"就绪",released:"已发布",running:"运行中",success:"正常",unavailable:"不可用",unreleased:"未发布",updating:"更新中",unknown:"未知"},sharedSpace:"企业共享空间",sharedDescription:"面向企业全员开放的技能,由管理员统一发布和维护",sharedVisibility:"全员可见",sharedPreparing:"正在准备共享空间",sharedLoadFailed:"共享空间加载失败",sharedEmpty:"暂无共享技能,管理员发布后会显示在这里",requestPublication:"申请公开",reviewSubmitting:"提交中…",reviewSubmitted:"已申请",reviewFailed:"申请公开失败",reviewStatusFailed:"审核状态加载失败",reviewRetry:"重新申请",reviewPending:"待审核",reviewApproving:"发布中",reviewApproved:"已公开",reviewReturned:"已退回",reviewHistory:"审核记录",skillDetailSections:"技能详情内容",versions:{title:"版本管理",refresh:"刷新",uploading:"上传中…",upload:"上传新版本",close:"关闭",hint:"新版本不会替换已公开版本,审核通过后才会公开;ZIP 中的技能名称需与原技能一致",loading:"正在加载版本…",loadFailed:"无法加载版本",filesFailed:"无法加载版本文件",uploadFailed:"上传新版本失败",submitFailed:"提交申请失败",retry:"重试",empty:"暂无版本",current:"当前版本",notSubmitted:"未申请公开",submitting:"提交中…",submit:"申请公开",processing:"版本状态:{{status}}",filesLoading:"正在加载文件…",filesEmpty:"暂无文件",history:"历史审核记录",shared:"已公开"},author:"作者",authorName:"作者:{{name}}"},y1e={library:"知识库",createBase:"新建知识库",editBase:"编辑知识库",invalidName:"名称必须以字母开头,且只能包含字母、数字和下划线。",nameHelp:"以字母开头,仅支持字母、数字和下划线,最多 48 个字符。",optionalDescription:"描述(可选)",descriptionOnly:"AgentKit 当前仅支持更新知识库描述。",previewWeb:"预览网页内容",addData:"添加数据",openOriginalWeb:"打开原网页",backToEdit:"返回修改",confirmAdd:"确认添加",source:"知识来源",image:"图片",documentFile:"文档文件",webPage:"在线网页",webUrl:"网页 URL",generatingWebPreview:"正在抓取网页并生成 Markdown 预览",selectFile:"选择知识文件",selectOrDropFile:"选择文件或拖拽到这里",selectedFile:"{{size}} · 点击可重新选择",imageFileHelp:"支持 PNG、JPG 和 JPEG,单个文件不超过 200 MB",documentFileHelp:"支持 PDF、PPTX、DOCX、XLSX 和 TXT,单个文件不超过 200 MB",uploadingFile:"正在上传文件并添加到知识库",optionalName:"名称(可选)",optionalType:"类型(可选)",generatePreview:"生成预览",uploadFile:"上传文件",editMetadata:"编辑知识 Metadata",knowledge:"知识",field:"字段",value:"值",backToList:"返回知识库列表",metadataJson:"元数据(JSON)",provider:"服务提供方",knowledgeId:"知识库 ID",project:"项目",creator:"创建者",data:"数据",deleteInvalidAssociation:"删除失效关联",noData:"这个知识库还没有数据",addFirstData:"添加第一项数据",format:"格式",size:"大小",searchData:"搜索数据",searchLibraryData:"搜索知识库数据",associationInvalid:"关联已失效",providerMissing:"底层 Provider 知识库已不存在",noMatchingData:"没有匹配的数据",loadingMoreData:"正在加载更多数据",retryLoading:"重试加载",details:"知识库详情",searchBases:"搜索知识库",someBasesFailed:"部分知识库暂时无法加载,已展示其余可用内容。",noMatchingBases:"没有匹配的知识库",noManagePermission:"您没有管理此知识库的权限",loadingMoreBases:"正在加载更多知识库",deleteBaseTitle:"删除知识库?",deleteBaseDescription:"将删除 {{name}} 的 AgentKit 关联;如果它由 Studio 创建,也会同时删除 Provider 资源。此操作无法撤销。",deleteDocumentTitle:"删除知识?",deleteDocumentDescription:"将从 Provider 知识库中删除 {{name}},此操作无法撤销。",preview:{processingTitle:"数据正在处理中",processingDetail:"知识库完成解析后即可预览,请稍后重新加载。",failedTitle:"数据解析失败",failedDetail:"请检查源文件或网页地址后重新添加,也可以重新加载最新状态。",noParsedTitle:"暂时没有可预览的解析内容",noParsedDetail:"此类文件会在知识库完成解析后显示文本、表格或页面图片。",noMediaTitle:"暂时没有可预览的媒体内容",noMediaDetail:"知识库尚未返回可访问的媒体预览,请稍后重新加载。",noDataTitle:"暂无可预览的数据内容",noDataDetail:"知识库尚未返回解析结果,请稍后重新加载。",attachmentError:"附件无法预览,请稍后重试。",imageAlt:"知识数据图片",audioUnsupported:"当前浏览器不支持音频预览。",videoUnsupported:"当前浏览器不支持视频预览。",namedPdf:"{{name}} PDF 预览",pdf:"PDF 预览",openPdf:"无法显示时,在新窗口打开 PDF",fileUnsupported:"当前格式暂不支持直接在线预览,已优先显示解析后的内容。",openOriginalFile:"打开原文件",loading:"正在加载数据预览",openOriginalHint:"您可以打开原网页查看来源内容。",chunk:"片段 {{index}}",loadingMore:"正在加载更多",loadMore:"加载更多"},errors:{fileTooLarge:"单个文件不能超过 200 MB",invalidImageType:"请选择 PNG、JPG 或 JPEG 图片",invalidDocumentType:"请选择 PDF、PPTX、DOCX、XLSX 或 TXT 文件",createBase:"创建知识库失败",updateBase:"更新知识库失败",metadataObject:"Metadata 必须是 JSON 对象",metadataFormat:"Metadata 格式错误",noWebPreview:"网页没有可预览的 Markdown 内容",addWeb:"添加网页失败",previewWeb:"生成网页预览失败",uploadFile:"上传文件失败",updateDocument:"更新知识失败",loadPreview:"加载数据预览失败",loadMoreBases:"加载更多知识库失败",loadBases:"加载知识库失败",loadMoreData:"加载更多数据失败",loadData:"加载数据失败",deleteBase:"删除知识库失败",deleteDocument:"删除知识失败"}},v1e={title:"飞书渠道",refresh:"刷新",loading:"正在加载渠道配置…",unsupported:"此 Runtime 不支持渠道管理,请升级 MPA 镜像。",unauthorized:"渠道管理需要 Studio 管理员身份及有效的 Runtime 凭据。",configurationError:"渠道管理配置不完整,请检查 Runtime 元数据及加密密钥。",requestFailed:"渠道请求失败,请检查 Runtime 连接后重试。",bound:"已绑定:{{name}}",unbound:"尚未绑定飞书机器人。",guidance:"私聊使用独立会话。在已授权群内 @ 当前机器人即可对话。",keyRequired:"绑定前请在 Runtime 配置持久的 CHANNEL_STATE_ENCRYPTION_KEY。",gateway:"消息网关",route:"入站路由",delivery:"回复投递",configured:"已配置",missing:"未配置",delivery_not_observed:"尚未观测",delivery_delivered:"已投递",delivery_retrying:"重试中",missingConfig:"缺少 Runtime 配置:{{fields}}",bind:"扫码绑定",newQr:"重新生成二维码",unbind:"解除绑定",confirmUnbind:"确认解绑此机器人?解绑后将停止接收新消息。",qrAlt:"机器人绑定二维码",openQr:"打开授权页面",uncertain:"注册过程已中断。重新开始前,请检查机器人绑定与 Gateway 状态。",bindingFailed:"绑定失败,请检查 Gateway 配置后重试。",chatId:"允许的群 ID",scope:"群会话策略",saveGroup:"保存群权限",noGroups:"尚未授权任何群。私聊无需群权限。",edit:"编辑",remove:"移除",removeGroup:"移除 {{name}}",scope_group_sender:"按发言人隔离",scope_group:"全群共享",scope_group_topic_sender:"按话题和发言人隔离",scope_group_topic:"按话题共享",status_PENDING:"等待扫码",status_SCANNED:"已扫码,等待授权",status_AUTHORIZED:"已授权,准备注册",status_REGISTERING:"正在注册机器人",status_BOUND:"机器人已绑定",status_FAILED:"绑定失败",status_EXPIRED:"二维码已过期",workspaceTitle:"消息渠道",workspaceDescription:"连接消息平台,让用户直接与此智能体对话,并管理访问权限。",provider_feishu:"飞书",provider_wecom:"企业微信",provider_dingtalk:"钉钉",comingSoon:"暂未开放",unavailableDescription:"{{name}}的绑定与消息配置暂未开放。",runtimeRequired:"请先将此智能体部署到 Runtime,再配置消息渠道。",bindingTitle:"机器人绑定",connected:"已绑定",notBound:"未绑定",gatewayDescription:"用于接收渠道消息的网关配置。",routeDescription:"将渠道消息转发给当前智能体的路由配置。",deliveryDescription:"实际观测到的回复投递状态,完成配置不代表已成功投递。",groupsTitle:"群聊权限",groupsDescription:"添加允许访问的群,并设置群内对话的共享范围。",providerBindingTitle:"绑定{{name}}",providerUnbound:"绑定{{name}}机器人,让用户通过消息与此智能体对话。",qrGuidance:"使用{{name}}扫码授权,Runtime 将保存机器人凭据并配置消息网关。",wecomGuidance:"使用企业微信扫码授权,或手动填写 Bot ID 和 Secret 绑定已有机器人。",wecomBotId:"Bot ID",wecomSecret:"Secret",bindCredentials:"绑定机器人",wecomScan:"扫码绑定",wecomAuthorizing:"等待企业微信授权…",cancelAuthorization:"取消授权",wecomPopupBlocked:"授权窗口被浏览器拦截,请允许弹窗后重试。",wecomAuthCancelled:"已取消企业微信授权,可以重新扫码。",wecomAuthTimeout:"企业微信授权已超时,请重新扫码。",wecomInvalidResult:"授权结果缺少 Bot ID 或 Secret,请重新授权或手动填写。",wecomAuthFailed:"企业微信授权失败,请重试或手动填写凭据。",dingtalkClientId:"Client ID",dingtalkClientSecret:"Client Secret",manualUpgrade:"当前镜像尚不支持{{name}}手动配置,请升级后使用;仍可使用极速配置。",pairingTitle:"消息渠道扫码配对",feishuPairingDescription:"如果已有连接机器人,飞书扫码并绑定成功后原有机器人会被替换,可选绑定存量机器人或新建机器人。",generatingQr:"正在生成配对二维码…",dingtalkGuidance:"使用钉钉扫码授权,或手动填写 Client ID 和 Client Secret 绑定已有机器人。",wecomPairingDescription:"将在企业微信授权窗口中重新扫码配对。新机器人绑定成功后会替换当前连接;取消授权或绑定失败不会解绑原机器人。",configurationMethod:"配置方式",quickSetup:"极速配置",manualSetup:"手动配置",feishuAppId:"App ID",feishuAppSecret:"App Secret",manualGuidance:"填写已有{{name}}机器人的应用凭据,连接到当前智能体。",manualReplacement:"绑定成功后将替换当前机器人;取消或绑定失败不会解除现有绑定。",accountsTitle:"飞书机器人",account:"机器人",selectAccount:"请选择机器人",accountEnabled:"已启用",accountDisabled:"已停用",addAccount:"添加机器人",cancelAddAccount:"取消添加",enableAccount:"启用机器人",disableAccount:"停用机器人",noAccounts:"尚未绑定飞书机器人。",accountsFailed:"读取机器人列表失败,请重试。",accountConflict:"机器人账号存在歧义或配置冲突,请刷新并选择机器人。",multiBotPairingDescription:"绑定新的飞书应用会添加机器人;绑定相同 App ID 会更新对应机器人。"},GVe={common:Ywe,agentKitPromo:Zwe,systemInfo:Jwe,agentWorkspace:e1e,environmentCenter:t1e,deploymentSelect:n1e,deploymentError:i1e,studioBuildProgress:r1e,cloudEnvironment:s1e,githubCicd:a1e,feishuDeployment:o1e,deploymentResources:l1e,studioUpdate:c1e,projectPreview:u1e,workspace:d1e,resourceCollection:f1e,skillSourcePicker:h1e,composer:p1e,agentSelector:m1e,myAgents:g1e,skillCenter:b1e,knowledge:y1e,channels:v1e},XVe=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:Zwe,agentSelector:m1e,agentWorkspace:e1e,channels:v1e,cloudEnvironment:s1e,common:Ywe,composer:p1e,default:GVe,deploymentError:i1e,deploymentResources:l1e,deploymentSelect:n1e,environmentCenter:t1e,feishuDeployment:o1e,githubCicd:a1e,knowledge:y1e,myAgents:g1e,projectPreview:u1e,resourceCollection:f1e,skillCenter:b1e,skillSourcePicker:h1e,studioBuildProgress:r1e,studioUpdate:c1e,systemInfo:Jwe,workspace:d1e},Symbol.toStringTag,{value:"Module"})),x1e="用户管理",w1e="{{count}} 位成员",O1e="用户",k1e="角色",S1e="账号状态",E1e="最近登录",C1e="操作",A1e="更改角色",T1e="关闭",_1e="保存角色",j1e="正在保存…",N1e="取消",R1e="返回",I1e="用户池",P1e="火山引擎 Identity",D1e="搜索姓名、邮箱或用户 ID",M1e="搜索",L1e="筛选角色",$1e="全部角色",F1e="刷新",B1e="正在读取用户…",U1e="更新于 {{time}}",Q1e="已将 {{name}} 设置为{{role}}",z1e="重试",V1e="你",H1e="初始超级管理员",q1e="初始超级管理员受保护,不能在此降级",W1e="保存后,对方刷新 Studio 即可使用新的权限",K1e="角色需要重新确认",G1e="没有匹配的用户",X1e="尝试其他关键词或角色",Y1e="用户登录或加入当前用户池后会显示在这里",Z1e="共 {{count}} 位用户",J1e="上一页",eOe="下一页",tOe="尚未登录",nOe="未提供",iOe={super_admin:"超级管理员",admin:"管理员",developer:"开发者",user:"普通用户"},rOe={super_admin:"管理所有资源,并管理用户和分配角色",admin:"管理 Studio 资源",developer:"开发智能体并管理自己的资源",user:"使用智能体和个人功能"},sOe={EXTERNAL_PROVIDER:"正常",CONFIRMED:"正常",NORMAL:"正常",ENABLED:"正常",ACTIVE:"正常",UNCONFIRMED:"待验证",DISABLED:"已停用",FORBIDDEN:"已禁用",LOCKED:"已锁定",SUSPENDED:"已暂停",FORCE_CHANGE_PASSWORD:"需要修改密码"},aOe={request_failed:"请求未完成,请刷新列表确认当前状态后重试",invalid_response:"用户服务返回异常,请刷新后重试",identity_unavailable:"暂时无法访问 Identity,请稍后重试或检查服务权限",identity_resource_missing:"用户或用户池已不存在,请刷新列表",super_administrator_required:"只有超级管理员可以管理用户",sign_in_required:"请登录后重试",user_not_in_pool:"当前账号不属于此用户池",user_disabled:"当前账号已停用",protected_administrator:"不能降低初始超级管理员的权限",cannot_demote_self:"不能降低自己的超级管理员权限",role_change_conflict:"角色已发生变化,请关闭弹窗并刷新列表后重试",cross_origin_request:"请在当前 Studio 页面内修改角色"},YVe={title:x1e,memberCount:w1e,user:O1e,role:k1e,status:S1e,lastLogin:E1e,actions:C1e,changeRole:A1e,close:T1e,save:_1e,saving:j1e,cancel:N1e,back:R1e,pool:I1e,volcengineIdentity:P1e,searchPlaceholder:D1e,search:M1e,filterRole:L1e,allRoles:$1e,refresh:F1e,loading:B1e,updatedAt:U1e,saved:Q1e,retry:z1e,you:V1e,initialAdministrator:H1e,protectedExplanation:q1e,effectiveAfterRefresh:W1e,roleConflict:K1e,noUsers:G1e,tryAnotherSearch:X1e,poolEmpty:Y1e,resultCount:Z1e,previous:J1e,next:eOe,neverLoggedIn:tOe,unknown:nOe,roles:iOe,descriptions:rOe,states:sOe,errors:aOe},ZVe=Object.freeze(Object.defineProperty({__proto__:null,actions:C1e,allRoles:$1e,back:R1e,cancel:N1e,changeRole:A1e,close:T1e,default:YVe,descriptions:rOe,effectiveAfterRefresh:W1e,errors:aOe,filterRole:L1e,initialAdministrator:H1e,lastLogin:E1e,loading:B1e,memberCount:w1e,neverLoggedIn:tOe,next:eOe,noUsers:G1e,pool:I1e,poolEmpty:Y1e,previous:J1e,protectedExplanation:q1e,refresh:F1e,resultCount:Z1e,retry:z1e,role:k1e,roleConflict:K1e,roles:iOe,save:_1e,saved:Q1e,saving:j1e,search:M1e,searchPlaceholder:D1e,states:sOe,status:S1e,title:x1e,tryAnotherSearch:X1e,unknown:nOe,updatedAt:U1e,user:O1e,volcengineIdentity:P1e,you:V1e},Symbol.toStringTag,{value:"Module"})),oOe="网站集成",lOe="将 AgentKit Runtime 以悬浮聊天窗口嵌入网站",cOe="返回自动化列表",uOe="添加网站",dOe="正在加载 Runtime",fOe="选择 Runtime",hOe="网站域名",pOe="例如 xxxx.com 或 localhost:5173",mOe="正在生成",gOe="生成 Token",bOe="已添加网站",yOe="{{count}} 个",vOe="{{count}} 个",xOe="正在加载网站集成",wOe="还没有网站集成",OOe="选择 Runtime 并输入网站域名即可生成 Token",kOe="引入方法",SOe="将下面代码放到网页的 body 结束标签前",EOe="已复制",COe="复制代码",AOe="添加网站后会在这里生成引入代码。",TOe="确定删除 {{domain}} 的网站集成吗?",_Oe={load:"加载网站集成失败",create:"创建网站集成失败",delete:"删除网站集成失败",noConversationalAgent:"该 Runtime 暂未发现可对话的 Agent"},jOe={requestFailed:"请求失败 ({{status}})",greeting:"您好,有什么可以帮您?",sessionFailed:"无法建立对话会话",unauthorized:"当前网站未获得对话授权",conversationFailed:"对话请求失败,请稍后重试",open:"打开智能体对话",close:"关闭智能体对话",panelLabel:"智能体对话面板",assistant:"智能体助手",online:"在线对话"},JVe={title:oOe,description:lOe,backToAutomations:cOe,addWebsite:uOe,loadingRuntime:dOe,selectRuntime:fOe,websiteDomain:hOe,domainPlaceholder:pOe,generating:mOe,generateToken:gOe,addedWebsites:bOe,websiteCount_one:yOe,websiteCount_other:vOe,loadingIntegrations:xOe,delete:"删除",emptyTitle:wOe,emptyDescription:OOe,embedMethod:kOe,embedInstructions:SOe,copied:EOe,copyCode:COe,embedHint:AOe,confirmDelete:TOe,errors:_Oe,widget:jOe},eHe=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:uOe,addedWebsites:bOe,backToAutomations:cOe,confirmDelete:TOe,copied:EOe,copyCode:COe,default:JVe,description:lOe,domainPlaceholder:pOe,embedHint:AOe,embedInstructions:SOe,embedMethod:kOe,emptyDescription:OOe,emptyTitle:wOe,errors:_Oe,generateToken:gOe,generating:mOe,loadingIntegrations:xOe,loadingRuntime:dOe,selectRuntime:fOe,title:oOe,websiteCount_one:yOe,websiteCount_other:vOe,websiteDomain:hOe,widget:jOe},Symbol.toStringTag,{value:"Module"})),NOe={types:{all:"全部类型",document:"文档",image:"图片",video:"视频"},previewArtifact:"预览 {{name}}",moreActions:"更多操作 {{name}}",actionMenu:"{{name}} 操作",download:"下载",downloading:"下载中",edit:"编辑信息",delete:"删除产物",previewFailed:"无法预览“{{name}}”:{{message}}",downloadStarted:"已开始下载 {{name}}",downloadFailed:"无法下载“{{name}}”:{{message}}",updated:"已更新 {{name}}",deleted:"已删除 {{name}}",deleteFailed:"无法删除“{{name}}”:{{message}}",typeFilter:"产物类型",searchAria:"搜索产物",searchPlaceholder:"搜索产物或会话",retry:"重试",close:"关闭",listAria:"产物列表",loadFailed:"产物加载失败",loadDetailFallback:"请检查存储配置后重试。",reload:"重新加载",noMatch:"没有找到匹配的产物",noArtifacts:"您还没有任何产物",searchHint:"请尝试搜索其他名称或切换类型",emptyHint:"聊天中生成的产物会自动显示在这里",columns:{name:"名称",source:"来源",updatedAt:"修改时间",actions:"操作"},loadingMore:"正在加载更多产物",unknownTime:"时间未知",preview:{close:"关闭预览",meta:"{{type}} / 版本 {{version}}",loading:"正在加载预览",alt:"{{name}} 预览",loadFailed:"预览加载失败,请稍后重试或下载查看",unsupported:"当前格式暂不支持在线预览,请下载查看",sourceAria:"产物来源",agent:"智能体",session:"会话",tool:"生成工具",createdAt:"生成时间",fileSize:"文件大小",tags:"标签",viewSession:"查看会话"},deleteDialog:{title:"删除产物?",description:"“{{name}}”将从产物库永久删除,聊天记录不会受到影响。",deleting:"删除中",confirm:"删除",close:"关闭删除确认框"},api:{withStatus:"{{message}}({{status}})",listFailed:"读取产物库失败",syncFailed:"同步聊天产物失败",updateFailed:"更新产物失败",deleteFailed:"删除产物失败",downloadFailed:"下载产物失败"}},ROe={unknownSource:"未知来源",unknownCreator:"未知创建者"},IOe={nameRequired:"请输入产物名称",tooManyTags:"标签最多 {{max}} 个",tagTooLong:"单个标签不能超过 {{max}} 个字符",title:"编辑产物信息",subtitle:"内容文件不会被修改",close:"关闭编辑框",name:"名称",description:"描述",descriptionPlaceholder:"补充用途、版本或使用说明",tags:"标签",tagsPlaceholder:"使用逗号分隔,最多 {{max}} 个",cancel:"取消",saving:"保存中",save:"保存"},POe={change:{added:"新增",modified:"修改",deleted:"删除"},noChanges:"两个版本的源码没有差异",chooseFile:"从左侧选择文件以查看代码",compareTitle:"版本对比",workspaceTitle:"源码工作区",projectFallback:"Agent 项目",switchTheme:"切换源码主题",switchThemeTitle:"切换为{{theme}}主题",themes:{dark:"深色",light:"浅色"},closeWorkspace:"关闭源码工作区",close:"关闭",changedFiles:"变更文件",projectFiles:"项目文件",changes:"变更",files:"文件",openFiles:"打开的文件",noFileSelected:"未选择文件",comparisonDirection:"对比方向",before:"优化前",after:"优化后",loadingEditor:"正在加载编辑器…",changedFileCount_one:"{{count}} 个文件有变更",changedFileCount_other:"{{count}} 个文件有变更",fileCount_one:"{{count}} 个文件",fileCount_other:"{{count}} 个文件",lineCount_one:"{{count}} 行 · UTF-8",lineCount_other:"{{count}} 行 · UTF-8",viewSource:"查看源码",viewSourceAria:"查看和编辑项目源码"},DOe={nav:"搜索",selectAgent:"请选择 Agent",checkingCapabilities:"正在检测 Agent 能力",notMounted:"当前 Agent 未挂载{{label}}",sources:{session:"会话",web:"网络",knowledge:"知识库",memory:"长期记忆"},webDescription:"通过 web_search 工具检索",backendLocal:"本地",failed:"搜索失败:{{message}}",placeholder:{selectAgent:"请先选择 Agent",web:"在网络中检索",knowledge:"在 {{name}} 中检索",knowledgeFallback:"当前 Agent 的知识库",memory:"在 {{name}} 中检索",memoryFallback:"当前用户的长期记忆",session:"在当前 Agent 的会话中检索"},sourceTypeAria:"搜索类型:{{label}}",notSelected:"未选择",sourceType:"搜索类型",selectSource:"选择搜索类型",noAgentHint:"选择一个 Agent 后,即可检索会话、网络及其挂载的数据源。",loadingCapabilities:"正在读取当前 Agent 的检索能力…",sourceUnavailable:"当前 Agent 未挂载该数据源",instructions:{web:"输入关键词后回车或点击按钮,通过 web_search 工具检索。",knowledge:"输入问题,检索当前 Agent 挂载的知识库。",memory:"输入线索,检索当前用户跨会话保存的长期记忆。",session:"输入关键词后回车或点击按钮,搜索当前 Agent 的会话。"},noResults:"未找到匹配“{{query}}”的结果。",knowledgeFragment:"知识片段 {{index}}",memoryFragment:"记忆片段 {{index}}"},MOe={title:"开发者资源",sections:{documentation:{title:"相关链接",description:"查看开发文档与 AgentKit 常用入口"},bestPractices:{title:"最佳实践",description:"参考开发、调试与部署经验"},showcases:{title:"案例展示",description:"探索 AgentKit 应用案例"}},links:{veadkDocs:"VeADK 文档",cliDocs:"AgentKit CLI 文档",platformDocs:"AgentKit 平台文档",console:"AgentKit 控制台"},articles:{veadkDevelopment:{title:"使用 VeADK 开发并部署智能体",description:"使用 VeADK 构建 Agent,并部署至 AgentKit 智能体运行时。"},cliDevelopment:{title:"使用 AgentKit CLI 开发并部署智能体",description:"通过 AgentKit CLI 创建项目、调试 Agent,并完成部署。"},coverAlt:"{{title}}文章封面"},showcases:{researchAssistant:{title:"多智能体研究助手",description:"由多个专业 Agent 协同完成资料检索、分析和结论整理。"},multimodalAnalysis:{title:"多模态内容分析",description:"在统一会话中理解图片、文档和视频内容。"},customerService:{title:"智能客服工作台",description:"结合知识检索与工具调用处理复杂的客户服务任务。"},webSearch:{title:"联网搜索 Agent",description:"检索实时网页内容,并将信息整理为可追溯的回答。"},a2uiApp:{title:"A2UI 交互应用",description:"让 Agent 根据任务过程生成可交互的前端界面。"},previewAlt:"{{title}}界面预览"}},LOe={title:"资源库",untitledSession:"未命名会话",categoryAria:"资源库分类",regionAria:"区域",tabs:{skills:"技能库",knowledge:"知识库",artifacts:"产物"}},$Oe={title:"管理 Agent",subtitle:"列出你有权管理的 AgentKit Runtime",mainAgentOnly:"仅显示主 Agent(控制面信息)。",deleteConfirm:'确定删除 Agent "{{name}}"?该 Runtime 将被永久删除。',regionFilterTitle:"按区域筛选",regionFilterAria:"区域筛选",regionAria:"区域",refresh:"刷新",loading:"加载中…",empty:"暂无你部署的 Agent。",connected:"已连接",connect:"连接到此 Agent",deleteRuntime:"删除该 Runtime",loadingDetail:"读取详情…",agentStructure:"Agent 结构",secretHidden:"敏感值不展示,可通过授权请求直接复制",revealSecret:"{{key}} 的敏感值",copySecret:"复制 {{key}} 的值",copy:"复制",copied:"已复制",copyFailed:"复制失败",notConfigured:"未配置",fields:{model:"模型",description:"描述",status:"状态信息",project:"项目",version:"版本",resources:"资源",memory:"记忆",tool:"工具",knowledge:"知识",mcpToolset:"MCP 工具集",updatedAt:"更新时间"},resource:{memory:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",concurrency:"并发 {{value}}"},environmentVariables:"环境变量",unnamed:"(未命名)"},FOe={mainAgent:"主 Agent",subAgent:"子 Agent {{index}}",itemCount_one:"{{count}} 项",itemCount_other:"{{count}} 项",info:"Agent 信息",infoAndTopology:"Agent 信息与设置",loadingInfo:"正在读取 Agent 信息…",unnamedAgent:"未命名 Agent",agentsMd:"AGENTS.md",tools:"工具",toolList:"工具列表",studioTool:"Studio Tool",removeTool:"移除工具 {{name}}",remove:"移除",notConfigured:"未配置",addStudioTool:"添加 Studio 工具",addStudioToolHere:"在此对话中添加 Studio 工具",skills:"技能",skillList:"技能列表",addSkill:"添加技能空间技能",addSkillHere:"向此会话添加技能空间技能",skillMountNextTurn:"挂载的版本将在下一 Turn 开始时冻结。",previewUnsupported:"暂不支持预览",sessionEnvironment:"会话环境",environment:"环境",agentCanvas:"Agent 画布",topology:"结构拓扑",nodeKinds:{agent:"Agent",sandbox:"沙箱","worker-session":"Worker 会话","skill-space":"技能空间",skill:"技能","studio-tool":"Studio 工具",mcp:"MCP",environment:"环境",knowledge:"知识库","sub-agent":"子 Agent"},nodeStatuses:{configured:"已配置",mounted:"已挂载",running:"运行中",paused:"已暂停"},viewCanvasFullscreen:"全屏查看 Agent 画布",viewFullscreen:"全屏查看",executionCanvas:"Agent 执行画布",fullscreenExecutionCanvas:"全屏 Agent 执行画布",closeFullscreenCanvas:"关闭全屏画布",close:"关闭",capabilitiesSubtitle:"能力与协作拓扑",closeInfo:"关闭 Agent 信息",infoUnavailable:"暂时无法读取 Agent 信息。",refresh:"刷新信息",loadingSkills:"正在加载绑定技能…",sessionSkills:"本会话临时技能",noBoundSpace:"当前智能体未绑定技能空间。",noBoundSkills:"绑定的技能空间暂无技能。",loadFailed:"加载失败,请刷新重试。",accessDenied:"无权读取此信息。",documentUnsupported:"当前 Runtime 不支持 Studio 读取 AGENTS.md,请升级 Runtime 镜像。",skillsUnsupported:"当前 Runtime 未提供技能空间绑定信息。",skillsDegraded:"技能信息不完整,请刷新重试。",documentEditHint:"编辑最新版本。保存会发布新版本到此技能空间,可能影响使用它的其他智能体。运行中的会话可能需要等待缓存刷新或新建会话后生效。请保留 frontmatter 中的 name。",documentLoading:"正在加载 SKILL.md…",documentWritable:"可编辑",documentReadOnly:"只读:此空间或当前权限不允许编辑",documentLoadFailed:"无法加载 SKILL.md,请刷新重试。",documentSaveFailed:"未确认保存成功,已保留编辑内容。重试前请重新打开,检查当前版本。",documentConflict:"技能已有新版本。请复制当前修改,再重新打开编辑器,避免覆盖。",discardDocument:"放弃未保存的修改?",keepEditing:"继续编辑",discardChanges:"放弃修改",saveDocument:"保存为新版本"},BOe={mountFailed:"挂载环境失败",closeDialog:"关闭环境弹窗",addTitle:"添加环境",description:"选择当前会话允许 Agent 使用的 Sandbox 环境",closeAdd:"关闭添加环境",searchAria:"搜索环境",searchPlaceholder:"搜索环境名称或能力",availableAria:"可用环境与工作区",loading:"正在读取可用环境…",noMatch:"没有匹配的环境或工作区",workspaces:"工作区",reuseAll:"复用工作区中的全部可用环境",availableEnvironmentCount_one:"{{count}} 个可用环境",availableEnvironmentCount_other:"{{count}} 个可用环境",selectWorkspace:"选择工作区 {{name}}",environments:"环境",includedByWorkspaces:"已由工作区 {{names}} 包含",nameSeparator:"、",selectEnvironment:"选择环境 {{name}}",selectedWorkspaceCount_one:"{{count}} 个工作区",selectedWorkspaceCount_other:"{{count}} 个工作区",coveredEnvironmentCount_one:"{{count}} 个环境",coveredEnvironmentCount_other:"{{count}} 个环境",selectionSummary:"已选择 {{workspaces}},覆盖 {{environments}}",cancel:"取消",mounting:"正在挂载…",confirm:"确认添加",mountedAria:"已挂载环境",environmentCount_one:"{{count}} 个环境",environmentCount_other:"{{count}} 个环境",removeWorkspace:"移除工作区 {{name}}",remove:"移除",removeEnvironment:"移除环境 {{name}}",add:"添加环境",addMore:"添加更多环境",addForSession:"为当前 Session 添加环境",loadingAvailable:"正在加载可用环境…",empty:"暂无可用的 AIO Sandbox 环境。"},UOe={loading:{searching:"正在查找已有环境",creating:"环境初始化中",connecting:"正在连接已有环境"},initializationFailed:"AgentKit CLI 环境初始化失败,当前状态:{{status}}。",sessionExpired:"AgentKit CLI Session 不存在或已过期,请重试。",initializationTimeout:"AgentKit CLI 环境初始化超时,请稍后重试。",nonPersistent:"非持久化环境",recyclingHoursMinutes:"{{hours}} 小时 {{minutes}} 分钟后环境回收",recyclingMinutes:"{{minutes}} 分钟后环境回收",connectionError:`无法连接 Studio 服务,未收到服务端响应。 +原始错误:{{message}}`,unavailable:"连接不可用",requestFailed:"AgentKit CLI 请求失败",retry:"重试",terminalTitle:"AgentKit CLI 终端"},QOe={labels:{coding:"智能编程",get_city_weather:"城市天气查询",get_location_weather:"位置天气查询",web_fetch:"网页内容获取",studio_write_artifact:"保存会话产物"},closeDialog:"关闭弹窗",title:"添加 Studio 工具",description:"由 Studio BFF 为 {{agentName}} 的当前会话执行,Runtime 无需预装",close:"关闭添加 Studio 工具",searchAria:"搜索 Studio 工具",searchPlaceholder:"搜索名称或工具标识",availableAria:"可用 Studio 工具",loading:"正在读取 Studio 工具…",noMatch:"没有匹配的 Studio 工具",remove:"移除",add:"添加"},zOe={artifactLibrary:NOe,resourceMetadata:ROe,artifactEdit:IOe,codeBrowser:POe,search:DOe,developerResources:MOe,library:LOe,manageAgents:$Oe,agentTopology:FOe,sessionEnvironment:BOe,agentKitCli:UOe,studioTools:QOe},tHe=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:UOe,agentTopology:FOe,artifactEdit:IOe,artifactLibrary:NOe,codeBrowser:POe,default:zOe,developerResources:MOe,library:LOe,manageAgents:$Oe,resourceMetadata:ROe,search:DOe,sessionEnvironment:BOe,studioTools:QOe},Symbol.toStringTag,{value:"Module"})),NU=["zh-CN","en-US"],vA="en-US",VOe="agentkit.studio.locale",nHe={"zh-CN":{dir:"ltr",nativeName:"简体中文"},"en-US":{dir:"ltr",nativeName:"English"}};function xA(e){if(!e)return null;const t=e.trim().replace(/_/g,"-").toLowerCase(),n=NU.find(i=>i.toLowerCase()===t);return n||(t==="zh"||t.startsWith("zh-")?"zh-CN":t==="en"||t.startsWith("en-")?"en-US":null)}function So(e,t){const n=(e==null?void 0:e.trim())??"";if(!n)return"";const i=new RegExp("\\p{Script=Han}","u").test(n);return t.toLowerCase().startsWith("zh")===i?n:""}function iHe(){if(typeof window>"u")return null;try{return xA(window.localStorage.getItem(VOe))}catch{return null}}function rHe(){if(typeof window>"u")return[];const e=window.navigator;return e?e.languages.length>0?e.languages:e.language?[e.language]:[]:[]}function sHe(){const e=iHe();if(e)return e;for(const t of rHe()){const n=xA(t);if(n)return n}return vA}function aHe(e){if(!(typeof window>"u"))try{window.localStorage.setItem(VOe,e)}catch{}}function HOe(e){typeof document>"u"||(document.documentElement.lang=e,document.documentElement.dir=nHe[e].dir)}const Zn=e=>typeof e=="string",ZO=()=>{let e,t;const n=new Promise((i,r)=>{e=i,t=r});return n.resolve=e,n.reject=t,n},k5=e=>e==null?"":String(e),oHe=(e,t,n)=>{e.forEach(i=>{t[i]&&(n[i]=t[i])})},lHe=/###/g,MG=e=>e&&e.includes("###")?e.replace(lHe,"."):e,LG=e=>!e||Zn(e),RS=(e,t,n)=>{const i=Zn(t)?t.split("."):t;let r=0;for(;r{const{obj:i,k:r}=RS(e,t,Object);if(i!==void 0||t.length===1){i[r]=n;return}let s=t[t.length-1],o=t.slice(0,t.length-1),l=RS(e,o,Object);for(;l.obj===void 0&&o.length;)s=`${o[o.length-1]}.${s}`,o=o.slice(0,o.length-1),l=RS(e,o,Object),l!=null&&l.obj&&typeof l.obj[`${l.k}.${s}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${s}`]=n},cHe=(e,t,n,i)=>{const{obj:r,k:s}=RS(e,t,Object);r[s]=r[s]||[],r[s].push(n)},cR=(e,t)=>{const{obj:n,k:i}=RS(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,i))return n[i]},uHe=(e,t,n)=>{const i=cR(e,n);return i!==void 0?i:cR(t,n)},qOe=(e,t,n)=>{for(const i in t)i!=="__proto__"&&i!=="constructor"&&(Object.prototype.hasOwnProperty.call(e,i)?Zn(e[i])||e[i]instanceof String||Zn(t[i])||t[i]instanceof String?n&&(e[i]=t[i]):qOe(e[i],t[i],n):e[i]=t[i]);return e},Wh=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),dHe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},fHe=e=>Zn(e)?e.replace(/[&<>"'\/]/g,t=>dHe[t]):e;class hHe{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const i=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,i),this.regExpQueue.push(t),i}}const pHe=[" ",",","?","!",";"],mHe=new hHe(20),gHe=(e,t,n)=>{t=t||"",n=n||"";const i=pHe.filter(o=>!t.includes(o)&&!n.includes(o));if(i.length===0)return!0;const r=mHe.getRegExp(`(${i.map(o=>o==="?"?"\\?":o).join("|")})`);let s=!r.test(e);if(!s){const o=e.indexOf(n);o>0&&!r.test(e.substring(0,o))&&(s=!0)}return s},fF=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const i=t.split(n);let r=e;for(let s=0;se==null?void 0:e.replace(/_/g,"-"),bHe={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var n,i;(i=(n=console==null?void 0:console[e])==null?void 0:n.apply)==null||i.call(n,console,t)}};class uR{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||bHe,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,i,r){return r&&!this.debug?null:(t=t.map(s=>Zn(s)?s.replace(/[\r\n\x00-\x1F\x7F]/g," "):s),Zn(t[0])&&(t[0]=`${i}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new uR(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new uR(this.logger,t)}}var rh=new uR;let YP=class{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const r=this.observers[i].get(n)||0;this.observers[i].set(n,r+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}once(t,n){const i=(...r)=>{n(...r),this.off(t,i)};return this.on(t,i),this}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([r,s])=>{for(let o=0;o{for(let o=0;o-1&&this.options.ns.splice(n,1)}getResource(t,n,i,r={}){var u,d;const s=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,o=r.ignoreJSONStructure!==void 0?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;t.includes(".")?l=t.split("."):(l=[t,n],i&&(Array.isArray(i)?l.push(...i):Zn(i)&&s?l.push(...i.split(s)):l.push(i)));const c=cR(this.data,l);return!c&&!n&&!i&&t.includes(".")&&(t=l[0],n=l[1],i=l.slice(2).join(".")),c||!o||!Zn(i)?c:fF((d=(u=this.data)==null?void 0:u[t])==null?void 0:d[n],i,s)}addResource(t,n,i,r,s={silent:!1}){const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let l=[t,n];i&&(l=l.concat(o?i.split(o):i)),t.includes(".")&&(l=t.split("."),r=n,n=l[1]),this.addNamespaces(n),$G(this.data,l,r),s.silent||this.emit("added",t,n,i,r)}addResources(t,n,i,r={silent:!1}){for(const s in i)(Zn(i[s])||Array.isArray(i[s]))&&this.addResource(t,n,s,i[s],{silent:!0});r.silent||this.emit("added",t,n,i)}addResourceBundle(t,n,i,r,s,o={silent:!1,skipCopy:!1}){let l=[t,n];t.includes(".")&&(l=t.split("."),r=i,i=n,n=l[1]),this.addNamespaces(n);let c=cR(this.data,l)||{};o.skipCopy||(i=JSON.parse(JSON.stringify(i))),r?qOe(c,i,s):c={...c,...i},$G(this.data,l,c),o.silent||this.emit("added",t,n,i)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(r=>n[r]&&Object.keys(n[r]).length>0)}toJSON(){return this.data}}var WOe={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,i,r){return e.forEach(s=>{var o;t=((o=this.processors[s])==null?void 0:o.process(t,n,i,r))??t}),t}};const KOe=Symbol("i18next/PATH_KEY");function yHe(){const e=[],t=Object.create(null);let n;return t.get=(i,r)=>{var s;return(s=n==null?void 0:n.revoke)==null||s.call(n),r===KOe?e:(e.push(r),n=Proxy.revocable(i,t),n.proxy)},Proxy.revocable(Object.create(null),t).proxy}function Qy(e,t){const{[KOe]:n}=e(yHe()),i=(t==null?void 0:t.keySeparator)??".",r=(t==null?void 0:t.nsSeparator)??":",s=(t==null?void 0:t.enableSelector)==="strict";if(n.length>1&&r){const o=t==null?void 0:t.ns,l=s?Array.isArray(o)?o:o?[o]:null:Array.isArray(o)?o:null;if(l&&(s?l:l.length>1?l.slice(1):[]).includes(n[0]))return`${n[0]}${r}${n.slice(1).join(i)}`}return n.join(i)}const S5=e=>!Zn(e)&&typeof e!="boolean"&&typeof e!="number";class dR extends YP{constructor(t,n={}){super(),oHe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=rh.create("translator"),this.checkedLoadedFor={}}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const i={...n};if(t==null)return!1;const r=this.resolve(t,i);if((r==null?void 0:r.res)===void 0)return!1;const s=S5(r.res);return!(i.returnObjects===!1&&s)}extractFromKey(t,n){let i=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const r=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let s=n.ns||this.options.defaultNS||[];const o=i&&t.includes(i),l=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!gHe(t,i,r);if(o&&!l){const c=t.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:t,namespaces:Zn(s)?[s]:s};const u=t.split(i);(i!==r||i===r&&this.options.ns.includes(u[0]))&&(s=u.shift()),t=u.join(r)}return{key:t,namespaces:Zn(s)?[s]:s}}translate(t,n,i){let r=typeof n=="object"?{...n}:n;if(typeof r!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),typeof r=="object"&&(r={...r}),r||(r={}),t==null)return"";typeof t=="function"&&(t=Qy(t,{...this.options,...r})),Array.isArray(t)||(t=[String(t)]),t=t.map(N=>typeof N=="function"?Qy(N,{...this.options,...r}):String(N));const s=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,o=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,{key:l,namespaces:c}=this.extractFromKey(t[t.length-1],r),u=c[c.length-1];let d=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;d===void 0&&(d=":");const f=r.lng||this.language,h=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((f==null?void 0:f.toLowerCase())==="cimode")return h?s?{res:`${u}${d}${l}`,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(r)}:`${u}${d}${l}`:s?{res:l,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(r)}:l;const m=this.resolve(t,r);let g=m==null?void 0:m.res;const b=(m==null?void 0:m.usedKey)||l,v=(m==null?void 0:m.exactUsedKey)||l,y=["[object Number]","[object Function]","[object RegExp]"],w=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,O=r.count!==void 0&&!Zn(r.count),k=dR.hasDefaultValue(r),S=O?this.pluralResolver.getSuffix(f,r.count,r):"",C=r.ordinal&&O?this.pluralResolver.getSuffix(f,r.count,{ordinal:!1}):"",E=O&&!r.ordinal&&r.count===0,j=E&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${S}`]||r[`defaultValue${C}`]||r.defaultValue;let T=g;x&&!g&&k&&(T=j);const R=S5(T),A=Object.prototype.toString.apply(T);if(x&&T&&R&&!y.includes(A)&&!(Zn(w)&&Array.isArray(T))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const N=this.options.returnedObjectHandler?this.options.returnedObjectHandler(b,T,{...r,ns:c}):`key '${l} (${this.language})' returned an object instead of string.`;return s?(m.res=N,m.usedParams=this.getUsedParamsDetails(r),m):N}if(o){const N=Array.isArray(T),D=N?[]:{},I=N?v:b;for(const P in T)if(Object.prototype.hasOwnProperty.call(T,P)){const _=`${I}${o}${P}`;k&&!g?D[P]=this.translate(_,{...r,defaultValue:S5(j)?j[P]:void 0,joinArrays:!1,ns:c}):D[P]=this.translate(_,{...r,joinArrays:!1,ns:c}),D[P]===_&&(D[P]=T[P])}g=D}}else if(x&&Zn(w)&&Array.isArray(g))g=g.join(w),g&&(g=this.extendTranslation(g,t,r,i));else{let N=!1,D=!1;!this.isValidLookup(g)&&k&&(N=!0,g=j),this.isValidLookup(g)||(D=!0,g=l);const P=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&D?void 0:g,_=k&&j!==g&&this.options.updateMissing;if(D||N||_){if(this.logger.log(_?"updateKey":"missingKey",f,u,O&&!_?`${l}${this.pluralResolver.getSuffix(f,r.count,r)}`:l,_?j:g),o){const V=this.resolve(l,{...r,keySeparator:!1});V&&V.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let L=[];const F=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&F&&F[0])for(let V=0;V{var z;const Z=k&&U!==g?U:P;this.options.missingKeyHandler?this.options.missingKeyHandler(V,u,q,Z,_,r):(z=this.backendConnector)!=null&&z.saveMissing&&this.backendConnector.saveMissing(V,u,q,Z,_,r),this.emit("missingKey",V,u,q,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&O?L.forEach(V=>{const q=this.pluralResolver.getSuffixes(V,r);E&&r[`defaultValue${this.options.pluralSeparator}zero`]&&!q.includes(`${this.options.pluralSeparator}zero`)&&q.push(`${this.options.pluralSeparator}zero`),q.forEach(U=>{M([V],l+U,r[`defaultValue${U}`]||j)})}):M(L,l,j))}g=this.extendTranslation(g,t,r,m,i),D&&g===l&&this.options.appendNamespaceToMissingKey&&(g=`${u}${d}${l}`),(D||N)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${d}${l}`:l,N?g:void 0,r))}return s?(m.res=g,m.usedParams=this.getUsedParamsDetails(r),m):g}extendTranslation(t,n,i,r,s){var c,u;if((c=this.i18nFormat)!=null&&c.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const d=Zn(t)&&(((u=i==null?void 0:i.interpolation)==null?void 0:u.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(d){const m=t.match(this.interpolator.nestingRegexp);f=m&&m.length}let h=i.replace&&!Zn(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(h={...this.options.interpolation.defaultVariables,...h}),t=this.interpolator.interpolate(t,h,i.lng||this.language||r.usedLng,i),d){const m=t.match(this.interpolator.nestingRegexp),g=m&&m.length;f(s==null?void 0:s[0])===m[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${m[0]} in key: ${n[0]}`),null):this.translate(...m,n),i)),i.interpolation&&this.interpolator.reset()}const o=i.postProcess||this.options.postProcess,l=Zn(o)?[o]:o;return t!=null&&(l!=null&&l.length)&&i.applyPostProcessor!==!1&&(t=WOe.handle(l,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),t}resolve(t,n={}){let i,r,s,o,l;return Zn(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(c=>typeof c=="function"?Qy(c,{...this.options,...n}):c)),t.forEach(c=>{if(this.isValidLookup(i))return;const u=this.extractFromKey(c,n),d=u.key;r=d;let f=u.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const h=n.count!==void 0&&!Zn(n.count),m=h&&!n.ordinal&&n.count===0,g=n.context!==void 0&&(Zn(n.context)||typeof n.context=="number")&&n.context!=="",b=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(v=>{var y,w;this.isValidLookup(i)||(l=v,!this.checkedLoadedFor[`${b[0]}-${v}`]&&((y=this.utils)!=null&&y.hasLoadedNamespace)&&!((w=this.utils)!=null&&w.hasLoadedNamespace(l))&&(this.checkedLoadedFor[`${b[0]}-${v}`]=!0,this.logger.warn(`key "${r}" for languages "${b.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),b.forEach(x=>{var S;if(this.isValidLookup(i))return;o=x;const O=[d];if((S=this.i18nFormat)!=null&&S.addLookupKeys)this.i18nFormat.addLookupKeys(O,d,x,v,n);else{let C;h&&(C=this.pluralResolver.getSuffix(x,n.count,n));const E=`${this.options.pluralSeparator}zero`,j=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(n.ordinal&&C.startsWith(j)&&O.push(d+C.replace(j,this.options.pluralSeparator)),O.push(d+C),m&&O.push(d+E)),g){const T=`${d}${this.options.contextSeparator||"_"}${n.context}`;O.push(T),h&&(n.ordinal&&C.startsWith(j)&&O.push(T+C.replace(j,this.options.pluralSeparator)),O.push(T+C),m&&O.push(T+E))}}let k;for(;k=O.pop();)this.isValidLookup(i)||(s=k,i=this.getResource(x,v,k,n))}))})}),{res:i,usedKey:r,exactUsedKey:s,usedLng:o,usedNS:l}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,i,r={}){var s;return(s=this.i18nFormat)!=null&&s.getResource?this.i18nFormat.getResource(t,n,i,r):this.resourceStore.getResource(t,n,i,r)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=t.replace&&!Zn(t.replace);let r=i?t.replace:t;if(i&&typeof t.count<"u"&&(r={...r,count:t.count}),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!i){r={...r};for(const s of n)delete r[s]}return r}static hasDefaultValue(t){const n="defaultValue";for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&i.startsWith(n)&&t[i]!==void 0)return!0;return!1}}class BG{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=rh.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(t){if(t=LE(t),!t||!t.includes("-"))return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=LE(t),!t||!t.includes("-"))return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(Zn(t)&&t.includes("-")){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(t)}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(i=>{if(n)return;const r=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(r))&&(n=r)}),!n&&this.options.supportedLngs&&t.forEach(i=>{if(n)return;const r=this.getScriptPartFromCode(i);if(this.isSupportedCode(r))return n=r;const s=this.getLanguagePartFromCode(i);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(o=>o===s?!0:!o.includes("-")&&!s.includes("-")?!1:!!(o.includes("-")&&!s.includes("-")&&o.slice(0,o.indexOf("-"))===s||o.startsWith(s)&&s.length>1))}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),Zn(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let i=t[n];return i||(i=t[this.getScriptPartFromCode(n)]),i||(i=t[this.formatLanguageCode(n)]),i||(i=t[this.getLanguagePartFromCode(n)]),i||(i=t.default),i||[]}toResolveHierarchy(t,n){const i=this.options.fallbackLng,r=Array.isArray(i)?i.join("|"):i;r!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=r);const s=n===void 0||n===!1||Zn(n),o=n===void 0&&typeof this.options.fallbackLng=="function",l=Zn(t)&&s&&!o;let c=null;if(l){let h;n===void 0?h="undefined":n===!1?h="boolean:false":h=`string:${n}`,c=`${t.length}:${t}|${h}`}if(c!==null){const h=this.resolveHierarchyCache[c];if(h!==void 0)return h.slice()}const u=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),d=[],f=h=>{h&&(this.isSupportedCode(h)?d.push(h):this.logger.warn(`rejecting language code not found in supportedLngs: ${h}`))};return Zn(t)&&(t.includes("-")||t.includes("_"))?(this.options.load!=="languageOnly"&&f(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&f(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&f(this.getLanguagePartFromCode(t))):Zn(t)&&f(this.formatLanguageCode(t)),u.forEach(h=>{d.includes(h)||f(this.formatLanguageCode(h))}),c!==null?(this.resolveHierarchyCache[c]=d,d.slice()):d}}const UG={zero:0,one:1,two:2,few:3,many:4,other:5},QG={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class vHe{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=rh.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const i=LE(t==="dev"?"en":t),r=n.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:i,type:r});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let o;try{o=new Intl.PluralRules(i,{type:r})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),QG;if(!t.match(/-|_/))return QG;const c=this.languageUtils.getLanguagePartFromCode(t);o=this.getRule(c,n)}return this.pluralRulesCache[s]=o,o}needsPlural(t,n={}){let i=this.getRule(t,n);return i||(i=this.getRule("dev",n)),(i==null?void 0:i.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,n,i={}){return this.getSuffixes(t,i).map(r=>`${n}${r}`)}getSuffixes(t,n={}){let i=this.getRule(t,n);return i||(i=this.getRule("dev",n)),i?i.resolvedOptions().pluralCategories.sort((r,s)=>UG[r]-UG[s]).map(r=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r}`):[]}getSuffix(t,n,i={}){const r=this.getRule(t,i);return r?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${r.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,i))}}const zG=(e,t,n,i=".",r=!0)=>{let s=uHe(e,t,n);return!s&&r&&Zn(n)&&(s=fF(e,n,i),s===void 0&&(s=fF(t,n,i))),s},VG=e=>e.replace(/\$/g,"$$$$");class HG{constructor(t={}){var n;this.logger=rh.create("interpolator"),this.options=t,this.format=((n=t==null?void 0:t.interpolation)==null?void 0:n.format)||(i=>i),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:i,useRawValueToEscape:r,prefix:s,prefixEscaped:o,suffix:l,suffixEscaped:c,formatSeparator:u,unescapeSuffix:d,unescapePrefix:f,nestingPrefix:h,nestingPrefixEscaped:m,nestingSuffix:g,nestingSuffixEscaped:b,nestingOptionsSeparator:v,maxReplaces:y,alwaysFormat:w}=t.interpolation;this.escape=n!==void 0?n:fHe,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=r!==void 0?r:!1,this.prefix=s?Wh(s):o||"{{",this.suffix=l?Wh(l):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":f?Wh(f):"-",this.unescapeSuffix=this.unescapePrefix?"":d?Wh(d):"",this.nestingPrefix=h?Wh(h):m||Wh("$t("),this.nestingSuffix=g?Wh(g):b||Wh(")"),this.nestingOptionsSeparator=v||",",this.maxReplaces=y||1e3,this.alwaysFormat=w!==void 0?w:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,i)=>(n==null?void 0:n.source)===i?(n.lastIndex=0,n):new RegExp(i,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,n,i,r){var m;let s,o,l;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=g=>{if(!g.includes(this.formatSeparator)){const w=zG(n,c,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(w,void 0,i,{...r,...n,interpolationkey:g}):w}const b=g.split(this.formatSeparator),v=b.shift().trim(),y=b.join(this.formatSeparator).trim();return this.format(zG(n,c,v,this.options.keySeparator,this.options.ignoreJSONStructure),y,i,{...r,...n,interpolationkey:v})};this.resetRegExp(),!this.escapeValue&&typeof t=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(t)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const d=(r==null?void 0:r.missingInterpolationHandler)||this.options.missingInterpolationHandler,f=((m=r==null?void 0:r.interpolation)==null?void 0:m.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>g},{regex:this.regexp,safeValue:g=>this.escapeValue?this.escape(g):g}].forEach(g=>{for(l=0;s=g.regex.exec(t);){const b=s[1].trim();if(o=u(b),o===void 0)if(typeof d=="function"){const y=d(t,s,r);o=Zn(y)?y:""}else if(r&&Object.prototype.hasOwnProperty.call(r,b))o="";else if(f){o=s[0];continue}else this.logger.warn(`missed to pass in variable ${b} for interpolating ${t}`),o="";else!Zn(o)&&!this.useRawValueToEscape&&(o=k5(o));const v=g.safeValue(o);if(t=t.replace(s[0],VG(v)),f?(g.regex.lastIndex+=v.length,g.regex.lastIndex-=s[0].length):g.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),t}nest(t,n,i={}){let r,s,o;const l=(c,u)=>{const d=this.nestingOptionsSeparator;if(!c.includes(d))return c;const f=c.split(new RegExp(`${Wh(d)}[ ]*{`));let h=`{${f[1]}`;c=f[0],h=this.interpolate(h,o);const m=h.match(/'/g),g=h.match(/"/g);(((m==null?void 0:m.length)??0)%2===0&&!g||((g==null?void 0:g.length)??0)%2!==0)&&(h=h.replace(/'/g,'"'));try{o=JSON.parse(h),u&&(o={...u,...o})}catch(b){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,b),`${c}${d}${h}`}return o.defaultValue&&o.defaultValue.includes(this.prefix)&&delete o.defaultValue,c};for(;r=this.nestingRegexp.exec(t);){let c=[];o={...i},o=o.replace&&!Zn(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;const u=/{.*}/s.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(u!==-1&&(c=r[1].slice(u).split(this.formatSeparator).map(d=>d.trim()).filter(Boolean),r[1]=r[1].slice(0,u)),s=n(l.call(this,r[1].trim(),o),o),s&&r[0]===t&&!Zn(s))return s;Zn(s)||(s=k5(s)),s||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${t}`),s=""),c.length&&(s=c.reduce((d,f)=>this.format(d,f,i.lng,{...i,interpolationkey:r[1].trim()}),s.trim())),t=t.replace(r[0],VG(k5(s))),this.regexp.lastIndex=0}return t}}const xHe=e=>{let t=e.toLowerCase().trim();const n={};if(e.includes("(")){const i=e.split("(");t=i[0].toLowerCase().trim();const r=i[1].slice(0,-1);t==="currency"&&!r.includes(":")?n.currency||(n.currency=r.trim()):t==="relativetime"&&!r.includes(":")?n.range||(n.range=r.trim()):r.split(";").forEach(o=>{if(o){const[l,...c]=o.split(":"),u=c.join(":").trim().replace(/^'+|'+$/g,""),d=l.trim();n[d]||(n[d]=u),u==="false"&&(n[d]=!1),u==="true"&&(n[d]=!0),isNaN(u)||(n[d]=parseInt(u,10))}})}return{formatName:t,formatOptions:n}},qG=e=>{const t={};return(n,i,r)=>{let s=r;r&&r.interpolationkey&&r.formatParams&&r.formatParams[r.interpolationkey]&&r[r.interpolationkey]&&(s={...s,[r.interpolationkey]:void 0});const o=i+JSON.stringify(s);let l=t[o];return l||(l=e(LE(i),r),t[o]=l),l(n)}},wHe=e=>(t,n,i)=>e(LE(n),i)(t);class OHe{constructor(t={}){this.logger=rh.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const i=n.cacheInBuiltFormats?qG:wHe;this.formats={number:i((r,s)=>{const o=new Intl.NumberFormat(r,{...s});return l=>o.format(l)}),currency:i((r,s)=>{const o=new Intl.NumberFormat(r,{...s,style:"currency"});return l=>o.format(l)}),datetime:i((r,s)=>{const o=new Intl.DateTimeFormat(r,{...s});return l=>o.format(l)}),relativetime:i((r,s)=>{const o=new Intl.RelativeTimeFormat(r,{...s});return l=>o.format(l,s.range||"day")}),list:i((r,s)=>{const o=new Intl.ListFormat(r,{...s});return l=>o.format(l)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=qG(n)}format(t,n,i,r={}){if(!n||t==null)return t;const s=n.split(this.formatSeparator),o=[];for(let c=0;c-1&&!u.includes(")")&&c+1{var h;const{formatName:d,formatOptions:f}=xHe(u);if(this.formats[d]){let m=c;try{const g=((h=r==null?void 0:r.formatParams)==null?void 0:h[r.interpolationkey])||{},b=g.locale||g.lng||r.locale||r.lng||i;m=this.formats[d](c,b,{...f,...r,...g})}catch(g){this.logger.warn(g)}return m}else this.logger.warn(`there was no format function for ${d}`);return c},t)}}const kHe=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class SHe extends YP{constructor(t,n,i,r={}){var s,o;super(),this.backend=t,this.store=n,this.services=i,this.languageUtils=i.languageUtils,this.options=r,this.logger=rh.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],(o=(s=this.backend)==null?void 0:s.init)==null||o.call(s,i,r.backend,r)}queueLoad(t,n,i,r){const s={},o={},l={},c={};return t.forEach(u=>{let d=!0;n.forEach(f=>{const h=`${u}|${f}`;!i.reload&&this.store.hasResourceBundle(u,f)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?o[h]===void 0&&(o[h]=!0):(this.state[h]=1,d=!1,o[h]===void 0&&(o[h]=!0),s[h]===void 0&&(s[h]=!0),c[f]===void 0&&(c[f]=!0)))}),d||(l[u]=!0)}),(Object.keys(s).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(s),pending:Object.keys(o),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(c)}}loaded(t,n,i){const r=t.split("|"),s=r[0],o=r[1];n&&this.emit("failedLoading",s,o,n),!n&&i&&this.store.addResourceBundle(s,o,i,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&i&&(this.state[t]=0);const l={};this.queue.forEach(c=>{cHe(c.loaded,[s],o),kHe(c,t),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(u=>{l[u]||(l[u]={});const d=c.loaded[u];d.length&&d.forEach(f=>{l[u][f]===void 0&&(l[u][f]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(c=>!c.done)}read(t,n,i,r=0,s=this.retryTimeout,o){if(!t.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:i,tried:r,wait:s,callback:o});return}this.readingCalls++;const l=(u,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(u&&d&&r{this.read(t,n,i,r+1,s*2,o)},s);return}o(u,d)},c=this.backend[i].bind(this.backend);if(c.length===2){try{const u=c(t,n);u&&typeof u.then=="function"?u.then(d=>l(null,d)).catch(l):l(null,u)}catch(u){l(u)}return}return c(t,n,l)}prepareLoading(t,n,i={},r){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();Zn(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Zn(n)&&(n=[n]);const s=this.queueLoad(t,n,i,r);if(!s.toLoad.length)return s.pending.length||r(),null;s.toLoad.forEach(o=>{this.loadOne(o)})}load(t,n,i){this.prepareLoading(t,n,{},i)}reload(t,n,i){this.prepareLoading(t,n,{reload:!0},i)}loadOne(t,n=""){const i=t.split("|"),r=i[0],s=i[1];this.read(r,s,"read",void 0,void 0,(o,l)=>{o&&this.logger.warn(`${n}loading namespace ${s} for language ${r} failed`,o),!o&&l&&this.logger.log(`${n}loaded namespace ${s} for language ${r}`,l),this.loaded(t,o,l)})}saveMissing(t,n,i,r,s,o={},l=()=>{}){var c,u,d,f,h;if((u=(c=this.services)==null?void 0:c.utils)!=null&&u.hasLoadedNamespace&&!((f=(d=this.services)==null?void 0:d.utils)!=null&&f.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${i}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(i==null||i==="")){if((h=this.backend)!=null&&h.create){const m={...o,isUpdate:s},g=this.backend.create.bind(this.backend);if(g.length<6)try{let b;g.length===5?b=g(t,n,i,r,m):b=g(t,n,i,r),b&&typeof b.then=="function"?b.then(v=>l(null,v)).catch(l):l(null,b)}catch(b){l(b)}else g(t,n,i,r,l,m)}!t||!t[0]||this.store.addResource(t[0],n,i,r)}}}const E5=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),Zn(e[1])&&(t.defaultValue=e[1]),Zn(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(i=>{t[i]=n[i]})}return t},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),WG=e=>(Zn(e.ns)&&(e.ns=[e.ns]),Zn(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Zn(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),T2=()=>{},EHe=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class IS extends YP{constructor(t={},n){if(super(),this.options=WG(t),this.services={},this.logger=rh,this.modules={external:[]},EHe(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(Zn(t.ns)?t.defaultNS=t.ns:t.ns.includes("translation")||(t.defaultNS=t.ns[0]));const i=E5();this.options={...i,...this.options,...WG(t)},this.options.interpolation={...i.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=i.overloadTranslationOptionHandler);const r=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?rh.init(r(this.modules.logger),this.options):rh.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=OHe;const d=new BG(this.options);this.store=new FG(this.options.resources,this.options);const f=this.services;f.logger=rh,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new vHe(d,{prepend:this.options.pluralSeparator}),u&&(f.formatter=r(u),f.formatter.init&&f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new HG(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new SHe(r(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(h,...m)=>{this.emit(h,...m)}),this.modules.languageDetector&&(f.languageDetector=r(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=r(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new dR(this.services,this.options),this.translator.on("*",(h,...m)=>{this.emit(h,...m)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,n||(n=T2),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=(...d)=>this.store[u](...d)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...d)=>(this.store[u](...d),this)});const l=ZO(),c=()=>{const u=(d,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(f),n(d,f)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),l}loadResources(t,n=T2){var s,o;let i=n;const r=Zn(t)?t:this.language;if(typeof t=="function"&&(i=t),!this.options.resources||this.options.partialBundledLanguages){if((r==null?void 0:r.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const l=[],c=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(f=>{f!=="cimode"&&(l.includes(f)||l.push(f))})};r?c(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>c(d)),(o=(s=this.options.preload)==null?void 0:s.forEach)==null||o.call(s,u=>c(u)),this.services.backendConnector.load(l,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(u)})}else i(null)}reloadResources(t,n,i){const r=ZO();return typeof t=="function"&&(i=t,t=void 0),typeof n=="function"&&(i=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),i||(i=T2),this.services.backendConnector.reload(t,n,s=>{r.resolve(),i(s)}),r}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&WOe.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!["cimode","dev"].includes(t)){for(let n=0;n{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},s=(l,c)=>{c?this.isLanguageChangingTo===t&&(r(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,i.resolve((...u)=>this.t(...u)),n&&n(l,(...u)=>this.t(...u))},o=l=>{var d,f;!t&&!l&&this.services.languageDetector&&(l=[]);const c=Zn(l)?l:l&&l[0],u=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(Zn(l)?[l]:l);u&&(this.language||r(u),this.translator.language||this.translator.changeLanguage(u),(f=(d=this.services.languageDetector)==null?void 0:d.cacheUserLanguage)==null||f.call(d,u)),this.loadResources(u,h=>{s(h,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(t),i}getFixedT(t,n,i,r){const s=r==null?void 0:r.scopeNs,o=(l,c,...u)=>{let d;typeof c!="object"?d=this.options.overloadTranslationOptionHandler([l,c].concat(u)):d={...c},d.lng=d.lng||o.lng,d.lngs=d.lngs||o.lngs;const f=d.ns!==void 0&&d.ns!==null;d.ns=d.ns||o.ns,d.keyPrefix!==""&&(d.keyPrefix=d.keyPrefix||i||o.keyPrefix);const h={...this.options,...d};Array.isArray(s)&&!f&&(h.ns=s),typeof d.keyPrefix=="function"&&(d.keyPrefix=Qy(d.keyPrefix,h));const m=this.options.keySeparator||".";let g;return d.keyPrefix&&Array.isArray(l)?g=l.map(b=>(typeof b=="function"&&(b=Qy(b,h)),`${d.keyPrefix}${m}${b}`)):(typeof l=="function"&&(l=Qy(l,h)),g=d.keyPrefix?`${d.keyPrefix}${m}${l}`:l),this.t(g,d)};return Zn(t)?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=i,o}t(...t){var n;return(n=this.translator)==null?void 0:n.translate(...t)}exists(...t){var n;return(n=this.translator)==null?void 0:n.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const i=n.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const o=(l,c)=>{const u=this.services.backendConnector.state[`${l}|${c}`];return u===-1||u===0||u===2};if(n.precheck){const l=n.precheck(this,o);if(l!==void 0)return l}return!!(this.hasResourceBundle(i,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(i,t)&&(!r||o(s,t)))}loadNamespaces(t,n){const i=ZO();return this.options.ns?(Zn(t)&&(t=[t]),t.forEach(r=>{this.options.ns.includes(r)||this.options.ns.push(r)}),this.loadResources(r=>{i.resolve(),n&&n(r)}),i):(n&&n(),Promise.resolve())}loadLanguages(t,n){const i=ZO();Zn(t)&&(t=[t]);const r=this.options.preload||[],s=t.filter(o=>!r.includes(o)&&this.services.languageUtils.isSupportedCode(o));return s.length?(this.options.preload=r.concat(s),this.loadResources(o=>{i.resolve(),n&&n(o)}),i):(n&&n(),Promise.resolve())}dir(t){var r,s;if(t||(t=this.resolvedLanguage||(((r=this.languages)==null?void 0:r.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{const o=new Intl.Locale(t);if(o&&o.getTextInfo){const l=o.getTextInfo();if(l&&l.direction)return l.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],i=((s=this.services)==null?void 0:s.languageUtils)||new BG(E5());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.includes(i.getLanguagePartFromCode(t))||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){const i=new IS(t,n);return i.createInstance=IS.createInstance,i}cloneInstance(t={},n=T2){const i=t.forkResourceStore;i&&delete t.forkResourceStore;const r={...this.options,...t,isClone:!0},s=new IS(r);if((t.debug!==void 0||t.prefix!==void 0)&&(s.logger=s.logger.clone(t)),["store","services","language"].forEach(l=>{s[l]=this[l]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},i){const l=Object.keys(this.store.data).reduce((c,u)=>(c[u]={...this.store.data[u]},c[u]=Object.keys(c[u]).reduce((d,f)=>(d[f]={...c[u][f]},d),c[u]),c),{});s.store=new FG(l,r),s.services.resourceStore=s.store}if(t.interpolation){const c={...E5().interpolation,...this.options.interpolation,...t.interpolation},u={...r,interpolation:c};s.services.interpolator=new HG(u)}return s.translator=new dR(s.services,r),s.translator.on("*",(l,...c)=>{s.emit(l,...c)}),s.init(r,n),s.translator.options=r,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const lc=IS.createInstance();lc.createInstance;lc.dir;lc.init;lc.loadResources;lc.reloadResources;lc.use;lc.changeLanguage;lc.getFixedT;lc.t;lc.exists;lc.setDefaultNamespace;lc.hasLoadedNamespace;lc.loadNamespaces;lc.loadLanguages;var GOe={exports:{}},Oi={};/** * @license React * react.production.js * @@ -61,7 +61,7 @@ Studio:{{studioUrl}} * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var NU=Symbol.for("react.transitional.element"),SHe=Symbol.for("react.portal"),EHe=Symbol.for("react.fragment"),CHe=Symbol.for("react.strict_mode"),AHe=Symbol.for("react.profiler"),THe=Symbol.for("react.consumer"),_He=Symbol.for("react.context"),jHe=Symbol.for("react.forward_ref"),NHe=Symbol.for("react.suspense"),RHe=Symbol.for("react.memo"),GOe=Symbol.for("react.lazy"),IHe=Symbol.for("react.activity"),WG=Symbol.iterator;function PHe(e){return e===null||typeof e!="object"?null:(e=WG&&e[WG]||e["@@iterator"],typeof e=="function"?e:null)}var XOe={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},YOe=Object.assign,ZOe={};function _1(e,t,n){this.props=e,this.context=t,this.refs=ZOe,this.updater=n||XOe}_1.prototype.isReactComponent={};_1.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};_1.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function JOe(){}JOe.prototype=_1.prototype;function RU(e,t,n){this.props=e,this.context=t,this.refs=ZOe,this.updater=n||XOe}var IU=RU.prototype=new JOe;IU.constructor=RU;YOe(IU,_1.prototype);IU.isPureReactComponent=!0;var KG=Array.isArray;function fF(){}var Rs={H:null,A:null,T:null,S:null},eke=Object.prototype.hasOwnProperty;function PU(e,t,n){var i=n.ref;return{$$typeof:NU,type:e,key:t,ref:i!==void 0?i:null,props:n}}function DHe(e,t){return PU(e.type,t,e.props)}function DU(e){return typeof e=="object"&&e!==null&&e.$$typeof===NU}function MHe(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var GG=/\/+/g;function E5(e,t){return typeof e=="object"&&e!==null&&e.key!=null?MHe(""+e.key):t.toString(36)}function LHe(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(fF,fF):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function ex(e,t,n,i,r){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(s){case"bigint":case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case NU:case SHe:o=!0;break;case GOe:return o=e._init,ex(o(e._payload),t,n,i,r)}}if(o)return r=r(e),o=i===""?"."+E5(e,0):i,KG(r)?(n="",o!=null&&(n=o.replace(GG,"$&/")+"/"),ex(r,t,n,"",function(u){return u})):r!=null&&(DU(r)&&(r=DHe(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(GG,"$&/")+"/")+o)),t.push(r)),1;o=0;var l=i===""?".":i+":";if(KG(e))for(var c=0;c<]+?)[\s/>]|([^\s=]+)=\s?("[^"]*"|'[^']*')/g;function YG(e){const t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(BHe[n[1]]||e.charAt(e.length-2)==="/")&&(t.voidElement=!0),t.name.startsWith("!--"))){const s=e.indexOf("-->");return{type:"comment",comment:s!==-1?e.slice(4,s):""}}const i=new RegExp(UHe);let r=null;for(;r=i.exec(e),r!==null;)if(r[0].trim())if(r[1]){const s=r[1].trim();let o=[s,null];const l=s.indexOf("=");l>-1&&(o=[s.slice(0,l),s.slice(l+1)]),t.attrs[o[0]]=o[1],i.lastIndex--}else r[2]&&(t.attrs[r[2]]=r[3].trim().substring(1,r[3].length-1));return t}const _2=/|<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,QHe=/<\/?([^\s]+?)[/\s>]/,zHe=/^\s*$/,VHe=/^(script|style)$/i,Zk="\0",HHe=Object.create(null);function tke(e){e.forEach(function(t){if(t.type==="text"){t.content=t.content.split(Zk).join("<");return}if(t.type==="comment"){t.comment=t.comment.split(Zk).join("<");return}for(const n in t.attrs){const i=t.attrs[n];typeof i=="string"&&i.indexOf(Zk)>-1&&(t.attrs[n]=i.split(Zk).join("<"))}t.children.length&&tke(t.children)})}function qHe(e,t){const n=t&&t.components||HHe,i=t&&t.allowedTags;let r=!1;if(i){const g=typeof i=="function"?i:function(w){return i.indexOf(w)>-1};let b="",v=0;_2.lastIndex=0;let y;for(;y=_2.exec(e);){const w=y[0];b+=e.slice(v,y.index);const x=w.match(QHe);w.startsWith("",e}}function KHe(e){return e.reduce(function(t,n){return t+nke("",n)},"")}var GHe={parse:qHe,stringify:KHe};const Bj=(e,t,n,i)=>{var s,o,l,c;const r=[n,{code:t,...i||{}}];if((o=(s=e==null?void 0:e.services)==null?void 0:s.logger)!=null&&o.forward)return e.services.logger.forward(r,"warn","react-i18next::",!0);Fc(r[0])&&(r[0]=`react-i18next:: ${r[0]}`),(c=(l=e==null?void 0:e.services)==null?void 0:l.logger)!=null&&c.warn?e.services.logger.warn(...r):console!=null&&console.warn&&console.warn(...r)},ZG={},Wx=(e,t,n,i)=>{Fc(n)&&ZG[n]||(Fc(n)&&(ZG[n]=new Date),Bj(e,t,n,i))},ike=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},hF=(e,t,n)=>{e.loadNamespaces(t,ike(e,n))},JG=(e,t,n,i)=>{if(Fc(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return hF(e,n,i);n.forEach(r=>{e.options.ns.indexOf(r)<0&&e.options.ns.push(r)}),e.loadLanguages(t,ike(e,i))},XHe=(e,t,n={})=>!t.languages||!t.languages.length?(Wx(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(i,r)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!r(i.isLanguageChangingTo,e))return!1}}),Fc=e=>typeof e=="string",wp=e=>typeof e=="object"&&e!==null,YHe=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,ZHe={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},JHe=e=>ZHe[e],rke=e=>e.replace(YHe,JHe);let pF={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:rke,transDefaultProps:void 0};const eqe=(e={})=>{pF={...pF,...e}},MU=()=>pF;let ske;const tqe=e=>{ske=e},LU=()=>ske,Uj=(e,t)=>{var i;if(!e)return!1;const n=((i=e.props)==null?void 0:i.children)??e.children;return t?n.length>0:!!n},Jk=e=>{var n,i;if(!e)return[];const t=((n=e.props)==null?void 0:n.children)??e.children;return(i=e.props)!=null&&i.i18nIsDynamicList?eg(t):t},nqe=e=>Array.isArray(e)&&e.every(p.isValidElement),eg=e=>Array.isArray(e)?e:[e],iqe=(e,t)=>{const n={...t};return n.props={...t.props,...e.props},n},rqe=e=>{const t={};if(!e)return t;const n=i=>{eg(i).forEach(s=>{Fc(s)||(Uj(s)?n(Jk(s)):wp(s)&&!p.isValidElement(s)&&Object.assign(t,s))})};return n(e),t},mF=(e,t,n,i)=>{if(!e)return"";let r="";const s=eg(e),o=t!=null&&t.transSupportBasicHtmlNodes?t.transKeepBasicHtmlNodesFor??[]:[];return s.forEach((l,c)=>{if(Fc(l)){r+=`${l}`;return}if(p.isValidElement(l)){const{props:u,type:d}=l,f=Object.keys(u).length,h=o.indexOf(d)>-1,m=u.children;if(!m&&h&&!f){r+=`<${d}/>`;return}if(!m&&(!h||f)||u.i18nIsDynamicList){r+=`<${c}>`;return}if(h&&f<=1){const b=Fc(m)?m:mF(m,t,n,i);r+=`<${d}>${b}`;return}const g=mF(m,t,n,i);r+=`<${c}>${g}`;return}if(l===null){Bj(n,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:i});return}if(wp(l)){const{format:u,...d}=l,f=Object.keys(d);if(f.length===1){const h=u?`${f[0]}, ${u}`:f[0];r+=`{{${h}}}`;return}Bj(n,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:i,child:l});return}Bj(n,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:i,child:l})}),r},sqe=(e,t,n,i,r,s,o)=>{if(n==="")return[];const l=r.transKeepBasicHtmlNodesFor||[],c=n&&new RegExp(l.map(x=>`<${x}`).join("|")).test(n);if(!e&&!t&&!c&&!o)return[n];const u=t??{},d=x=>{eg(x).forEach(k=>{Fc(k)||(Uj(k)?d(Jk(k)):wp(k)&&!p.isValidElement(k)&&Object.assign(u,k))})};d(e);const f=Object.keys(u),h=x=>/^\d+$/.test(x)||l.indexOf(x)>-1||f.indexOf(x)>-1,m=GHe.parse(`<0>${n}`,{allowedTags:h}),g={...u,...s},b=(x,O,k)=>{var E;const S=Jk(x),C=y(S,O.children,k);return nqe(S)&&C.length===0||(E=x.props)!=null&&E.i18nIsDynamicList?S:C},v=(x,O,k,S,C)=>{x.dummy?(x.children=O,k.push(p.cloneElement(x,{key:S},C?void 0:O))):k.push(...p.Children.map([x],E=>{var T;if(E.type===p.Fragment||((T=E.props)==null?void 0:T.i18nIsDynamicList)!==void 0){const R={key:S};return E&&E.props&&Object.keys(E.props).forEach(A=>{A==="children"||A==="i18nIsDynamicList"||(R[A]=E.props[A])}),p.createElement(E.type,R,C?null:O)}const j={key:S};return E&&E.props&&Object.keys(E.props).forEach(R=>{R==="ref"||R==="children"||(j[R]=E.props[R])}),p.cloneElement(E,j,C?null:O)}))},y=(x,O,k)=>{const S=eg(x),C=eg(O),E={};return C.reduce((j,T,R)=>{var N,P;const A=((P=(N=T.children)==null?void 0:N[0])==null?void 0:P.content)&&i.services.interpolator.interpolate(T.children[0].content,g,i.language);if(T.type==="tag"){let I=S[parseInt(T.name,10)];!I&&t&&(I=t[T.name]),k.length===1&&!I&&(I=k[0][T.name]),I||(I={});const D={...T.attrs};o&&Object.keys(D).forEach(q=>{const U=D[q];Fc(U)&&(D[q]=rke(U))});const _=Object.keys(D).length!==0?iqe({props:D},I):I,L=p.isValidElement(_),F=L&&Uj(T,!0)&&!T.voidElement,M=c&&wp(_)&&_.dummy&&!L,V=wp(t)&&Object.hasOwnProperty.call(t,T.name);if(Fc(_)){const q=i.services.interpolator.interpolate(_,g,i.language);j.push(q)}else if(Uj(_)||F){const q=b(_,T,k);v(_,q,j,R)}else if(M){const q=y(S,T.children,k);v(_,q,j,R)}else if(Number.isNaN(parseFloat(T.name)))if(V){const q=b(_,T,k);v(_,q,j,R,T.voidElement)}else if(r.transSupportBasicHtmlNodes&&l.indexOf(T.name)>-1)if(T.voidElement)j.push(p.createElement(T.name,{key:`${T.name}-${R}`}));else{const q=E[T.name]||0;E[T.name]=q+1;let U,J=0;for(let ne=0;ne`);else{const q=y(S,T.children,k);j.push(`<${T.name}>${q}`)}else if(wp(_)&&!L){const q=T.children[0]?A:null;q&&j.push(q)}else v(_,A,j,R,T.children.length!==1||!A)}else if(T.type==="text"){const I=r.transWrapTextNodes,D=typeof r.unescape=="function"?r.unescape:MU().unescape,_=o?D(i.services.interpolator.interpolate(T.content,g,i.language)):i.services.interpolator.interpolate(T.content,g,i.language);I?j.push(p.createElement(I,{key:`${T.name}-${R}`},_)):j.push(_)}return j},[])},w=y([{dummy:!0,children:e||[]}],m,eg(e||[]));return Jk(w[0])},ake=(e,t,n)=>{const i=e.key||t,r=p.cloneElement(e,{key:i});if(!r.props||!r.props.children||n.indexOf(`${t}/>`)<0&&n.indexOf(`${t} />`)<0)return r;function s(){return p.createElement(p.Fragment,null,r)}return p.createElement(s,{key:i})},aqe=(e,t)=>e.map((n,i)=>ake(n,i,t)),oqe=(e,t)=>{const n={};return Object.keys(e).forEach(i=>{Object.assign(n,{[i]:ake(e[i],i,t)})}),n},lqe=(e,t,n,i)=>e?Array.isArray(e)?aqe(e,t):wp(e)?oqe(e,t):(Wx(n,"TRANS_INVALID_COMPONENTS",' "components" prop expects an object or array',{i18nKey:i}),null):null,cqe=e=>!wp(e)||Array.isArray(e)?!1:Object.keys(e).reduce((t,n)=>t&&Number.isNaN(Number.parseFloat(n)),!0);function uqe({children:e,count:t,parent:n,i18nKey:i,context:r,tOptions:s={},values:o,defaults:l,components:c,ns:u,i18n:d,t:f,shouldUnescape:h,...m}){var M,V,q,U,J,z;const g=d||LU();if(!g)return Wx(g,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.",{i18nKey:i}),e;const b=f||g.t.bind(g)||(Z=>Z),v={...MU(),...(M=g.options)==null?void 0:M.react};let y=u||b.ns||((V=g.options)==null?void 0:V.defaultNS);y=Fc(y)?[y]:y||["translation"];const{transDefaultProps:w}=v,x=w!=null&&w.tOptions?{...w.tOptions,...s}:s,O=h??(w==null?void 0:w.shouldUnescape),k=w!=null&&w.values?{...w.values,...o}:o,S=w!=null&&w.components?{...w.components,...c}:c,C=mF(e,v,g,i),E=l||(x==null?void 0:x.defaultValue)||C||v.transEmptyNodeValue||(typeof i=="function"?Uy(i):i),{hashTransKey:j}=v,T=i||(j?j(C||E):C||E);(U=(q=g.options)==null?void 0:q.interpolation)!=null&&U.defaultVariables?o=k&&Object.keys(k).length>0?{...k,...g.options.interpolation.defaultVariables}:{...g.options.interpolation.defaultVariables}:o=k;const R=rqe(e);R&&typeof R.count=="number"&&t===void 0&&(t=R.count);const A=o||t!==void 0&&!((z=(J=g.options)==null?void 0:J.interpolation)!=null&&z.alwaysFormat)||!e?x.interpolation:{interpolation:{...x.interpolation,prefix:"#$?",suffix:"?$#"}},N={...x,context:r||x.context,count:t,...o,...A,defaultValue:E,ns:y};let P=T?b(T,N):E;P===T&&E&&(P=E);const I=lqe(S,P,g,i);let D=I||e,_=null;cqe(I)&&(_=I,D=e);const L=sqe(D,_,P,g,v,N,O),F=n??v.defaultTransParent;return F?p.createElement(F,m,L):L}const dqe={type:"3rdParty",init(e){eqe(e.options.react),tqe(e)}},oke=p.createContext();class fqe{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function Nw({children:e,count:t,parent:n,i18nKey:i,context:r,tOptions:s={},values:o,defaults:l,components:c,ns:u,i18n:d,t:f,shouldUnescape:h,...m}){var w;const{i18n:g,defaultNS:b}=p.useContext(oke)||{},v=d||g||LU(),y=f||(v==null?void 0:v.t.bind(v));return uqe({children:e,count:t,parent:n,i18nKey:i,context:r,tOptions:s,values:o,defaults:l,components:c,ns:u||(y==null?void 0:y.ns)||b||((w=v==null?void 0:v.options)==null?void 0:w.defaultNS),i18n:v,t:f,shouldUnescape:h,...m})}var lke={exports:{}},cke={};/** + */var RU=Symbol.for("react.transitional.element"),CHe=Symbol.for("react.portal"),AHe=Symbol.for("react.fragment"),THe=Symbol.for("react.strict_mode"),_He=Symbol.for("react.profiler"),jHe=Symbol.for("react.consumer"),NHe=Symbol.for("react.context"),RHe=Symbol.for("react.forward_ref"),IHe=Symbol.for("react.suspense"),PHe=Symbol.for("react.memo"),XOe=Symbol.for("react.lazy"),DHe=Symbol.for("react.activity"),KG=Symbol.iterator;function MHe(e){return e===null||typeof e!="object"?null:(e=KG&&e[KG]||e["@@iterator"],typeof e=="function"?e:null)}var YOe={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ZOe=Object.assign,JOe={};function j1(e,t,n){this.props=e,this.context=t,this.refs=JOe,this.updater=n||YOe}j1.prototype.isReactComponent={};j1.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};j1.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function eke(){}eke.prototype=j1.prototype;function IU(e,t,n){this.props=e,this.context=t,this.refs=JOe,this.updater=n||YOe}var PU=IU.prototype=new eke;PU.constructor=IU;ZOe(PU,j1.prototype);PU.isPureReactComponent=!0;var GG=Array.isArray;function hF(){}var Rs={H:null,A:null,T:null,S:null},tke=Object.prototype.hasOwnProperty;function DU(e,t,n){var i=n.ref;return{$$typeof:RU,type:e,key:t,ref:i!==void 0?i:null,props:n}}function LHe(e,t){return DU(e.type,t,e.props)}function MU(e){return typeof e=="object"&&e!==null&&e.$$typeof===RU}function $He(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var XG=/\/+/g;function C5(e,t){return typeof e=="object"&&e!==null&&e.key!=null?$He(""+e.key):t.toString(36)}function FHe(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(hF,hF):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function tx(e,t,n,i,r){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(s){case"bigint":case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case RU:case CHe:o=!0;break;case XOe:return o=e._init,tx(o(e._payload),t,n,i,r)}}if(o)return r=r(e),o=i===""?"."+C5(e,0):i,GG(r)?(n="",o!=null&&(n=o.replace(XG,"$&/")+"/"),tx(r,t,n,"",function(u){return u})):r!=null&&(MU(r)&&(r=LHe(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(XG,"$&/")+"/")+o)),t.push(r)),1;o=0;var l=i===""?".":i+":";if(GG(e))for(var c=0;c<]+?)[\s/>]|([^\s=]+)=\s?("[^"]*"|'[^']*')/g;function ZG(e){const t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(QHe[n[1]]||e.charAt(e.length-2)==="/")&&(t.voidElement=!0),t.name.startsWith("!--"))){const s=e.indexOf("-->");return{type:"comment",comment:s!==-1?e.slice(4,s):""}}const i=new RegExp(zHe);let r=null;for(;r=i.exec(e),r!==null;)if(r[0].trim())if(r[1]){const s=r[1].trim();let o=[s,null];const l=s.indexOf("=");l>-1&&(o=[s.slice(0,l),s.slice(l+1)]),t.attrs[o[0]]=o[1],i.lastIndex--}else r[2]&&(t.attrs[r[2]]=r[3].trim().substring(1,r[3].length-1));return t}const j2=/|<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,VHe=/<\/?([^\s]+?)[/\s>]/,HHe=/^\s*$/,qHe=/^(script|style)$/i,Jk="\0",WHe=Object.create(null);function nke(e){e.forEach(function(t){if(t.type==="text"){t.content=t.content.split(Jk).join("<");return}if(t.type==="comment"){t.comment=t.comment.split(Jk).join("<");return}for(const n in t.attrs){const i=t.attrs[n];typeof i=="string"&&i.indexOf(Jk)>-1&&(t.attrs[n]=i.split(Jk).join("<"))}t.children.length&&nke(t.children)})}function KHe(e,t){const n=t&&t.components||WHe,i=t&&t.allowedTags;let r=!1;if(i){const g=typeof i=="function"?i:function(w){return i.indexOf(w)>-1};let b="",v=0;j2.lastIndex=0;let y;for(;y=j2.exec(e);){const w=y[0];b+=e.slice(v,y.index);const x=w.match(VHe);w.startsWith("",e}}function XHe(e){return e.reduce(function(t,n){return t+ike("",n)},"")}var YHe={parse:KHe,stringify:XHe};const Uj=(e,t,n,i)=>{var s,o,l,c;const r=[n,{code:t,...i||{}}];if((o=(s=e==null?void 0:e.services)==null?void 0:s.logger)!=null&&o.forward)return e.services.logger.forward(r,"warn","react-i18next::",!0);Bc(r[0])&&(r[0]=`react-i18next:: ${r[0]}`),(c=(l=e==null?void 0:e.services)==null?void 0:l.logger)!=null&&c.warn?e.services.logger.warn(...r):console!=null&&console.warn&&console.warn(...r)},JG={},Kx=(e,t,n,i)=>{Bc(n)&&JG[n]||(Bc(n)&&(JG[n]=new Date),Uj(e,t,n,i))},rke=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},pF=(e,t,n)=>{e.loadNamespaces(t,rke(e,n))},eX=(e,t,n,i)=>{if(Bc(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return pF(e,n,i);n.forEach(r=>{e.options.ns.indexOf(r)<0&&e.options.ns.push(r)}),e.loadLanguages(t,rke(e,i))},ZHe=(e,t,n={})=>!t.languages||!t.languages.length?(Kx(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(i,r)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!r(i.isLanguageChangingTo,e))return!1}}),Bc=e=>typeof e=="string",Op=e=>typeof e=="object"&&e!==null,JHe=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,eqe={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},tqe=e=>eqe[e],ske=e=>e.replace(JHe,tqe);let mF={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:ske,transDefaultProps:void 0};const nqe=(e={})=>{mF={...mF,...e}},LU=()=>mF;let ake;const iqe=e=>{ake=e},$U=()=>ake,Qj=(e,t)=>{var i;if(!e)return!1;const n=((i=e.props)==null?void 0:i.children)??e.children;return t?n.length>0:!!n},eS=e=>{var n,i;if(!e)return[];const t=((n=e.props)==null?void 0:n.children)??e.children;return(i=e.props)!=null&&i.i18nIsDynamicList?tg(t):t},rqe=e=>Array.isArray(e)&&e.every(p.isValidElement),tg=e=>Array.isArray(e)?e:[e],sqe=(e,t)=>{const n={...t};return n.props={...t.props,...e.props},n},aqe=e=>{const t={};if(!e)return t;const n=i=>{tg(i).forEach(s=>{Bc(s)||(Qj(s)?n(eS(s)):Op(s)&&!p.isValidElement(s)&&Object.assign(t,s))})};return n(e),t},gF=(e,t,n,i)=>{if(!e)return"";let r="";const s=tg(e),o=t!=null&&t.transSupportBasicHtmlNodes?t.transKeepBasicHtmlNodesFor??[]:[];return s.forEach((l,c)=>{if(Bc(l)){r+=`${l}`;return}if(p.isValidElement(l)){const{props:u,type:d}=l,f=Object.keys(u).length,h=o.indexOf(d)>-1,m=u.children;if(!m&&h&&!f){r+=`<${d}/>`;return}if(!m&&(!h||f)||u.i18nIsDynamicList){r+=`<${c}>`;return}if(h&&f<=1){const b=Bc(m)?m:gF(m,t,n,i);r+=`<${d}>${b}`;return}const g=gF(m,t,n,i);r+=`<${c}>${g}`;return}if(l===null){Uj(n,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:i});return}if(Op(l)){const{format:u,...d}=l,f=Object.keys(d);if(f.length===1){const h=u?`${f[0]}, ${u}`:f[0];r+=`{{${h}}}`;return}Uj(n,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:i,child:l});return}Uj(n,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:i,child:l})}),r},oqe=(e,t,n,i,r,s,o)=>{if(n==="")return[];const l=r.transKeepBasicHtmlNodesFor||[],c=n&&new RegExp(l.map(x=>`<${x}`).join("|")).test(n);if(!e&&!t&&!c&&!o)return[n];const u=t??{},d=x=>{tg(x).forEach(k=>{Bc(k)||(Qj(k)?d(eS(k)):Op(k)&&!p.isValidElement(k)&&Object.assign(u,k))})};d(e);const f=Object.keys(u),h=x=>/^\d+$/.test(x)||l.indexOf(x)>-1||f.indexOf(x)>-1,m=YHe.parse(`<0>${n}`,{allowedTags:h}),g={...u,...s},b=(x,O,k)=>{var E;const S=eS(x),C=y(S,O.children,k);return rqe(S)&&C.length===0||(E=x.props)!=null&&E.i18nIsDynamicList?S:C},v=(x,O,k,S,C)=>{x.dummy?(x.children=O,k.push(p.cloneElement(x,{key:S},C?void 0:O))):k.push(...p.Children.map([x],E=>{var T;if(E.type===p.Fragment||((T=E.props)==null?void 0:T.i18nIsDynamicList)!==void 0){const R={key:S};return E&&E.props&&Object.keys(E.props).forEach(A=>{A==="children"||A==="i18nIsDynamicList"||(R[A]=E.props[A])}),p.createElement(E.type,R,C?null:O)}const j={key:S};return E&&E.props&&Object.keys(E.props).forEach(R=>{R==="ref"||R==="children"||(j[R]=E.props[R])}),p.cloneElement(E,j,C?null:O)}))},y=(x,O,k)=>{const S=tg(x),C=tg(O),E={};return C.reduce((j,T,R)=>{var N,D;const A=((D=(N=T.children)==null?void 0:N[0])==null?void 0:D.content)&&i.services.interpolator.interpolate(T.children[0].content,g,i.language);if(T.type==="tag"){let I=S[parseInt(T.name,10)];!I&&t&&(I=t[T.name]),k.length===1&&!I&&(I=k[0][T.name]),I||(I={});const P={...T.attrs};o&&Object.keys(P).forEach(q=>{const U=P[q];Bc(U)&&(P[q]=ske(U))});const _=Object.keys(P).length!==0?sqe({props:P},I):I,L=p.isValidElement(_),F=L&&Qj(T,!0)&&!T.voidElement,M=c&&Op(_)&&_.dummy&&!L,V=Op(t)&&Object.hasOwnProperty.call(t,T.name);if(Bc(_)){const q=i.services.interpolator.interpolate(_,g,i.language);j.push(q)}else if(Qj(_)||F){const q=b(_,T,k);v(_,q,j,R)}else if(M){const q=y(S,T.children,k);v(_,q,j,R)}else if(Number.isNaN(parseFloat(T.name)))if(V){const q=b(_,T,k);v(_,q,j,R,T.voidElement)}else if(r.transSupportBasicHtmlNodes&&l.indexOf(T.name)>-1)if(T.voidElement)j.push(p.createElement(T.name,{key:`${T.name}-${R}`}));else{const q=E[T.name]||0;E[T.name]=q+1;let U,Z=0;for(let ne=0;ne`);else{const q=y(S,T.children,k);j.push(`<${T.name}>${q}`)}else if(Op(_)&&!L){const q=T.children[0]?A:null;q&&j.push(q)}else v(_,A,j,R,T.children.length!==1||!A)}else if(T.type==="text"){const I=r.transWrapTextNodes,P=typeof r.unescape=="function"?r.unescape:LU().unescape,_=o?P(i.services.interpolator.interpolate(T.content,g,i.language)):i.services.interpolator.interpolate(T.content,g,i.language);I?j.push(p.createElement(I,{key:`${T.name}-${R}`},_)):j.push(_)}return j},[])},w=y([{dummy:!0,children:e||[]}],m,tg(e||[]));return eS(w[0])},oke=(e,t,n)=>{const i=e.key||t,r=p.cloneElement(e,{key:i});if(!r.props||!r.props.children||n.indexOf(`${t}/>`)<0&&n.indexOf(`${t} />`)<0)return r;function s(){return p.createElement(p.Fragment,null,r)}return p.createElement(s,{key:i})},lqe=(e,t)=>e.map((n,i)=>oke(n,i,t)),cqe=(e,t)=>{const n={};return Object.keys(e).forEach(i=>{Object.assign(n,{[i]:oke(e[i],i,t)})}),n},uqe=(e,t,n,i)=>e?Array.isArray(e)?lqe(e,t):Op(e)?cqe(e,t):(Kx(n,"TRANS_INVALID_COMPONENTS",' "components" prop expects an object or array',{i18nKey:i}),null):null,dqe=e=>!Op(e)||Array.isArray(e)?!1:Object.keys(e).reduce((t,n)=>t&&Number.isNaN(Number.parseFloat(n)),!0);function fqe({children:e,count:t,parent:n,i18nKey:i,context:r,tOptions:s={},values:o,defaults:l,components:c,ns:u,i18n:d,t:f,shouldUnescape:h,...m}){var M,V,q,U,Z,z;const g=d||$U();if(!g)return Kx(g,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.",{i18nKey:i}),e;const b=f||g.t.bind(g)||(ee=>ee),v={...LU(),...(M=g.options)==null?void 0:M.react};let y=u||b.ns||((V=g.options)==null?void 0:V.defaultNS);y=Bc(y)?[y]:y||["translation"];const{transDefaultProps:w}=v,x=w!=null&&w.tOptions?{...w.tOptions,...s}:s,O=h??(w==null?void 0:w.shouldUnescape),k=w!=null&&w.values?{...w.values,...o}:o,S=w!=null&&w.components?{...w.components,...c}:c,C=gF(e,v,g,i),E=l||(x==null?void 0:x.defaultValue)||C||v.transEmptyNodeValue||(typeof i=="function"?Qy(i):i),{hashTransKey:j}=v,T=i||(j?j(C||E):C||E);(U=(q=g.options)==null?void 0:q.interpolation)!=null&&U.defaultVariables?o=k&&Object.keys(k).length>0?{...k,...g.options.interpolation.defaultVariables}:{...g.options.interpolation.defaultVariables}:o=k;const R=aqe(e);R&&typeof R.count=="number"&&t===void 0&&(t=R.count);const A=o||t!==void 0&&!((z=(Z=g.options)==null?void 0:Z.interpolation)!=null&&z.alwaysFormat)||!e?x.interpolation:{interpolation:{...x.interpolation,prefix:"#$?",suffix:"?$#"}},N={...x,context:r||x.context,count:t,...o,...A,defaultValue:E,ns:y};let D=T?b(T,N):E;D===T&&E&&(D=E);const I=uqe(S,D,g,i);let P=I||e,_=null;dqe(I)&&(_=I,P=e);const L=oqe(P,_,D,g,v,N,O),F=n??v.defaultTransParent;return F?p.createElement(F,m,L):L}const hqe={type:"3rdParty",init(e){nqe(e.options.react),iqe(e)}},lke=p.createContext();class pqe{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function Rw({children:e,count:t,parent:n,i18nKey:i,context:r,tOptions:s={},values:o,defaults:l,components:c,ns:u,i18n:d,t:f,shouldUnescape:h,...m}){var w;const{i18n:g,defaultNS:b}=p.useContext(lke)||{},v=d||g||$U(),y=f||(v==null?void 0:v.t.bind(v));return fqe({children:e,count:t,parent:n,i18nKey:i,context:r,tOptions:s,values:o,defaults:l,components:c,ns:u||(y==null?void 0:y.ns)||b||((w=v==null?void 0:v.options)==null?void 0:w.defaultNS),i18n:v,t:f,shouldUnescape:h,...m})}var cke={exports:{}},uke={};/** * @license React * use-sync-external-store-shim.production.js * @@ -69,7 +69,7 @@ Studio:{{studioUrl}} * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Rw=p;function hqe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var pqe=typeof Object.is=="function"?Object.is:hqe,mqe=Rw.useState,gqe=Rw.useEffect,bqe=Rw.useLayoutEffect,yqe=Rw.useDebugValue;function vqe(e,t){var n=t(),i=mqe({inst:{value:n,getSnapshot:t}}),r=i[0].inst,s=i[1];return bqe(function(){r.value=n,r.getSnapshot=t,C5(r)&&s({inst:r})},[e,n,t]),gqe(function(){return C5(r)&&s({inst:r}),e(function(){C5(r)&&s({inst:r})})},[e]),yqe(n),n}function C5(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!pqe(e,n)}catch{return!0}}function xqe(e,t){return t()}var wqe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?xqe:vqe;cke.useSyncExternalStore=Rw.useSyncExternalStore!==void 0?Rw.useSyncExternalStore:wqe;lke.exports=cke;var ZP=lke.exports;const Oqe=(e,t)=>{if(Fc(t))return t;if(wp(t)&&Fc(t.defaultValue))return t.defaultValue;if(typeof e=="function")return"";if(Array.isArray(e)){const n=e[e.length-1];return typeof n=="function"?"":n}return e},kqe={t:Oqe,ready:!1},Sqe=()=>()=>{},Te=(e,t={})=>{var j,T,R;const{i18n:n}=t,{i18n:i,defaultNS:r}=p.useContext(oke)||{},s=n||i||LU();s&&!s.reportNamespaces&&(s.reportNamespaces=new fqe),s||Wx(s,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.");const o=p.useMemo(()=>{var A;return{...MU(),...(A=s==null?void 0:s.options)==null?void 0:A.react,...t}},[s,t]),{useSuspense:l,keyPrefix:c}=o,u=e||r||((j=s==null?void 0:s.options)==null?void 0:j.defaultNS),d=Fc(u)?[u]:u||["translation"],f=p.useMemo(()=>d,d);(R=(T=s==null?void 0:s.reportNamespaces)==null?void 0:T.addUsedNamespaces)==null||R.call(T,f);const h=p.useRef(0),m=p.useCallback(A=>{if(!s)return Sqe;const{bindI18n:N,bindI18nStore:P}=o,I=()=>{h.current+=1,A()};return N&&s.on(N,I),P&&s.store.on(P,I),()=>{N&&N.split(" ").forEach(D=>s.off(D,I)),P&&P.split(" ").forEach(D=>s.store.off(D,I))}},[s,o]),g=p.useRef(),b=p.useCallback(()=>{if(!s)return kqe;const A=!!(s.isInitialized||s.initializedStoreOnce)&&f.every(L=>XHe(L,s,o)),N=t.lng||s.language,P=h.current,I=g.current;if(I&&I.ready===A&&I.lng===N&&I.keyPrefix===c&&I.revision===P)return I;const _={t:s.getFixedT(N,o.nsMode==="fallback"?f:f[0],c,{scopeNs:f}),ready:A,lng:N,keyPrefix:c,revision:P};return g.current=_,_},[s,f,c,o,t.lng]),[v,y]=p.useState(0),{t:w,ready:x}=ZP.useSyncExternalStore(m,b,b);p.useEffect(()=>{if(s&&!x&&!l){const A=()=>y(N=>N+1);t.lng?JG(s,t.lng,f,A):hF(s,f,A)}},[s,t.lng,f,x,l,v]);const O=s||{},k=p.useRef(null),S=p.useRef(),C=A=>{const N=Object.getOwnPropertyDescriptors(A);N.__original&&delete N.__original;const P=Object.create(Object.getPrototypeOf(A),N);if(!Object.prototype.hasOwnProperty.call(P,"__original"))try{Object.defineProperty(P,"__original",{value:A,writable:!1,enumerable:!1,configurable:!1})}catch{}return P},E=p.useMemo(()=>{const A=O,N=A==null?void 0:A.language;let P=A;A&&(k.current&&k.current.__original===A?S.current!==N?(P=C(A),k.current=P,S.current=N):P=k.current:(P=C(A),k.current=P,S.current=N));const I=!x&&!l?(..._)=>(Wx(s,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),w(..._)):w,D=[I,P,x];return D.t=I,D.i18n=P,D.ready=x,D},[w,O,x,O.resolvedLanguage,O.language,O.languages]);if(s&&l&&!x){let A=!1;try{A=!1}catch{}throw A&&Wx(s,"SUSPENDED_WHILE_LOADING","useTranslation: suspended while translations are loading (useSuspense is true by default). Add a boundary above this component, or set react.useSuspense: false in the i18next init options. https://react.i18next.com/latest/usetranslation-hook"),new Promise(N=>{const P=()=>N();t.lng?JG(s,t.lng,f,P):hF(s,f,P)})}return E},uke=iHe(),bn=lc.createInstance();bn.use(dqe).init({resources:{"en-US":{adk:ede,app:ife,conversation:Pfe},"zh-CN":{adk:_U,app:c0e,conversation:B0e}},lng:uke,fallbackLng:yA,supportedLngs:[...jU],defaultNS:"common",interpolation:{escapeValue:!1},initAsync:!1});VOe(uke);bn.on("languageChanged",e=>{const t=vA(e)??yA;VOe(t)});const Eqe=Object.assign({"./resources/en-US/adk.json":Qze,"./resources/en-US/agentReviews.json":Vze,"./resources/en-US/app.json":Hze,"./resources/en-US/automations.json":qze,"./resources/en-US/common.json":Kze,"./resources/en-US/conversation.json":Gze,"./resources/en-US/create.json":Xze,"./resources/en-US/cronjobs.json":Zze,"./resources/en-US/deepseek.json":eVe,"./resources/en-US/feedback.json":nVe,"./resources/en-US/migrations.json":rVe,"./resources/en-US/newChat.json":sVe,"./resources/en-US/reviews.json":oVe,"./resources/en-US/sandbox.json":lVe,"./resources/en-US/shell.json":uVe,"./resources/en-US/sidebar.json":fVe,"./resources/en-US/skills.json":hVe,"./resources/en-US/ui.json":mVe,"./resources/en-US/users.json":bVe,"./resources/en-US/websiteIntegration.json":vVe,"./resources/en-US/workspaceTools.json":xVe,"./resources/zh-CN/adk.json":wVe,"./resources/zh-CN/agentReviews.json":kVe,"./resources/zh-CN/app.json":SVe,"./resources/zh-CN/automations.json":EVe,"./resources/zh-CN/common.json":AVe,"./resources/zh-CN/conversation.json":TVe,"./resources/zh-CN/create.json":_Ve,"./resources/zh-CN/cronjobs.json":NVe,"./resources/zh-CN/deepseek.json":IVe,"./resources/zh-CN/feedback.json":DVe,"./resources/zh-CN/migrations.json":LVe,"./resources/zh-CN/newChat.json":$Ve,"./resources/zh-CN/reviews.json":BVe,"./resources/zh-CN/sandbox.json":UVe,"./resources/zh-CN/shell.json":zVe,"./resources/zh-CN/sidebar.json":HVe,"./resources/zh-CN/skills.json":qVe,"./resources/zh-CN/ui.json":KVe,"./resources/zh-CN/users.json":XVe,"./resources/zh-CN/websiteIntegration.json":ZVe,"./resources/zh-CN/workspaceTools.json":JVe});function Cqe(){const e={};for(const[t,n]of Object.entries(Eqe)){const i=t.match(/\/resources\/([^/]+)\/([^/]+)\.json$/);if(!i)continue;const[,r,s]=i;e[r]??(e[r]={}),e[r][s]=n.default}return e}for(const[e,t]of Object.entries(Cqe()))for(const[n,i]of Object.entries(t??{}))bn.addResourceBundle(e,n,i,!0,!0);async function Aqe(e){rHe(e),await bn.changeLanguage(e)}var dke={exports:{}},JP={},fke={exports:{}},hke={};/** + */var Iw=p;function mqe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var gqe=typeof Object.is=="function"?Object.is:mqe,bqe=Iw.useState,yqe=Iw.useEffect,vqe=Iw.useLayoutEffect,xqe=Iw.useDebugValue;function wqe(e,t){var n=t(),i=bqe({inst:{value:n,getSnapshot:t}}),r=i[0].inst,s=i[1];return vqe(function(){r.value=n,r.getSnapshot=t,A5(r)&&s({inst:r})},[e,n,t]),yqe(function(){return A5(r)&&s({inst:r}),e(function(){A5(r)&&s({inst:r})})},[e]),xqe(n),n}function A5(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!gqe(e,n)}catch{return!0}}function Oqe(e,t){return t()}var kqe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Oqe:wqe;uke.useSyncExternalStore=Iw.useSyncExternalStore!==void 0?Iw.useSyncExternalStore:kqe;cke.exports=uke;var ZP=cke.exports;const Sqe=(e,t)=>{if(Bc(t))return t;if(Op(t)&&Bc(t.defaultValue))return t.defaultValue;if(typeof e=="function")return"";if(Array.isArray(e)){const n=e[e.length-1];return typeof n=="function"?"":n}return e},Eqe={t:Sqe,ready:!1},Cqe=()=>()=>{},Te=(e,t={})=>{var j,T,R;const{i18n:n}=t,{i18n:i,defaultNS:r}=p.useContext(lke)||{},s=n||i||$U();s&&!s.reportNamespaces&&(s.reportNamespaces=new pqe),s||Kx(s,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.");const o=p.useMemo(()=>{var A;return{...LU(),...(A=s==null?void 0:s.options)==null?void 0:A.react,...t}},[s,t]),{useSuspense:l,keyPrefix:c}=o,u=e||r||((j=s==null?void 0:s.options)==null?void 0:j.defaultNS),d=Bc(u)?[u]:u||["translation"],f=p.useMemo(()=>d,d);(R=(T=s==null?void 0:s.reportNamespaces)==null?void 0:T.addUsedNamespaces)==null||R.call(T,f);const h=p.useRef(0),m=p.useCallback(A=>{if(!s)return Cqe;const{bindI18n:N,bindI18nStore:D}=o,I=()=>{h.current+=1,A()};return N&&s.on(N,I),D&&s.store.on(D,I),()=>{N&&N.split(" ").forEach(P=>s.off(P,I)),D&&D.split(" ").forEach(P=>s.store.off(P,I))}},[s,o]),g=p.useRef(),b=p.useCallback(()=>{if(!s)return Eqe;const A=!!(s.isInitialized||s.initializedStoreOnce)&&f.every(L=>ZHe(L,s,o)),N=t.lng||s.language,D=h.current,I=g.current;if(I&&I.ready===A&&I.lng===N&&I.keyPrefix===c&&I.revision===D)return I;const _={t:s.getFixedT(N,o.nsMode==="fallback"?f:f[0],c,{scopeNs:f}),ready:A,lng:N,keyPrefix:c,revision:D};return g.current=_,_},[s,f,c,o,t.lng]),[v,y]=p.useState(0),{t:w,ready:x}=ZP.useSyncExternalStore(m,b,b);p.useEffect(()=>{if(s&&!x&&!l){const A=()=>y(N=>N+1);t.lng?eX(s,t.lng,f,A):pF(s,f,A)}},[s,t.lng,f,x,l,v]);const O=s||{},k=p.useRef(null),S=p.useRef(),C=A=>{const N=Object.getOwnPropertyDescriptors(A);N.__original&&delete N.__original;const D=Object.create(Object.getPrototypeOf(A),N);if(!Object.prototype.hasOwnProperty.call(D,"__original"))try{Object.defineProperty(D,"__original",{value:A,writable:!1,enumerable:!1,configurable:!1})}catch{}return D},E=p.useMemo(()=>{const A=O,N=A==null?void 0:A.language;let D=A;A&&(k.current&&k.current.__original===A?S.current!==N?(D=C(A),k.current=D,S.current=N):D=k.current:(D=C(A),k.current=D,S.current=N));const I=!x&&!l?(..._)=>(Kx(s,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),w(..._)):w,P=[I,D,x];return P.t=I,P.i18n=D,P.ready=x,P},[w,O,x,O.resolvedLanguage,O.language,O.languages]);if(s&&l&&!x){let A=!1;try{A=!1}catch{}throw A&&Kx(s,"SUSPENDED_WHILE_LOADING","useTranslation: suspended while translations are loading (useSuspense is true by default). Add a boundary above this component, or set react.useSuspense: false in the i18next init options. https://react.i18next.com/latest/usetranslation-hook"),new Promise(N=>{const D=()=>N();t.lng?eX(s,t.lng,f,D):pF(s,f,D)})}return E},dke=sHe(),bn=lc.createInstance();bn.use(hqe).init({resources:{"en-US":{adk:tde,app:rfe,conversation:Dfe},"zh-CN":{adk:jU,app:u0e,conversation:U0e}},lng:dke,fallbackLng:vA,supportedLngs:[...NU],defaultNS:"common",interpolation:{escapeValue:!1},initAsync:!1});HOe(dke);bn.on("languageChanged",e=>{const t=xA(e)??vA;HOe(t)});const Aqe=Object.assign({"./resources/en-US/adk.json":Vze,"./resources/en-US/agentReviews.json":qze,"./resources/en-US/app.json":Wze,"./resources/en-US/automations.json":Kze,"./resources/en-US/common.json":Xze,"./resources/en-US/conversation.json":Yze,"./resources/en-US/create.json":Zze,"./resources/en-US/cronjobs.json":eVe,"./resources/en-US/deepseek.json":nVe,"./resources/en-US/feedback.json":rVe,"./resources/en-US/migrations.json":aVe,"./resources/en-US/newChat.json":oVe,"./resources/en-US/reviews.json":cVe,"./resources/en-US/sandbox.json":uVe,"./resources/en-US/shell.json":fVe,"./resources/en-US/sidebar.json":pVe,"./resources/en-US/skills.json":mVe,"./resources/en-US/ui.json":bVe,"./resources/en-US/users.json":vVe,"./resources/en-US/websiteIntegration.json":wVe,"./resources/en-US/workspaceTools.json":OVe,"./resources/zh-CN/adk.json":kVe,"./resources/zh-CN/agentReviews.json":EVe,"./resources/zh-CN/app.json":CVe,"./resources/zh-CN/automations.json":AVe,"./resources/zh-CN/common.json":_Ve,"./resources/zh-CN/conversation.json":jVe,"./resources/zh-CN/create.json":NVe,"./resources/zh-CN/cronjobs.json":IVe,"./resources/zh-CN/deepseek.json":DVe,"./resources/zh-CN/feedback.json":LVe,"./resources/zh-CN/migrations.json":FVe,"./resources/zh-CN/newChat.json":BVe,"./resources/zh-CN/reviews.json":QVe,"./resources/zh-CN/sandbox.json":zVe,"./resources/zh-CN/shell.json":HVe,"./resources/zh-CN/sidebar.json":WVe,"./resources/zh-CN/skills.json":KVe,"./resources/zh-CN/ui.json":XVe,"./resources/zh-CN/users.json":ZVe,"./resources/zh-CN/websiteIntegration.json":eHe,"./resources/zh-CN/workspaceTools.json":tHe});function Tqe(){const e={};for(const[t,n]of Object.entries(Aqe)){const i=t.match(/\/resources\/([^/]+)\/([^/]+)\.json$/);if(!i)continue;const[,r,s]=i;e[r]??(e[r]={}),e[r][s]=n.default}return e}for(const[e,t]of Object.entries(Tqe()))for(const[n,i]of Object.entries(t??{}))bn.addResourceBundle(e,n,i,!0,!0);async function _qe(e){aHe(e),await bn.changeLanguage(e)}var fke={exports:{}},JP={},hke={exports:{}},pke={};/** * @license React * scheduler.production.js * @@ -77,7 +77,7 @@ Studio:{{studioUrl}} * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(e){function t(D,_){var L=D.length;D.push(_);e:for(;0>>1,M=D[F];if(0>>1;Fr(U,L))Jr(z,U)?(D[F]=z,D[J]=L,F=J):(D[F]=U,D[q]=L,F=q);else if(Jr(z,L))D[F]=z,D[J]=L,F=J;else break e}}return _}function r(D,_){var L=D.sortIndex-_.sortIndex;return L!==0?L:D.id-_.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,f=null,h=3,m=!1,g=!1,b=!1,v=!1,y=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function O(D){for(var _=n(u);_!==null;){if(_.callback===null)i(u);else if(_.startTime<=D)i(u),_.sortIndex=_.expirationTime,t(c,_);else break;_=n(u)}}function k(D){if(b=!1,O(D),!g)if(n(c)!==null)g=!0,S||(S=!0,A());else{var _=n(u);_!==null&&I(k,_.startTime-D)}}var S=!1,C=-1,E=5,j=-1;function T(){return v?!0:!(e.unstable_now()-jD&&T());){var F=f.callback;if(typeof F=="function"){f.callback=null,h=f.priorityLevel;var M=F(f.expirationTime<=D);if(D=e.unstable_now(),typeof M=="function"){f.callback=M,O(D),_=!0;break t}f===n(c)&&i(c),O(D)}else i(c);f=n(c)}if(f!==null)_=!0;else{var V=n(u);V!==null&&I(k,V.startTime-D),_=!1}}break e}finally{f=null,h=L,m=!1}_=void 0}}finally{_?A():S=!1}}}var A;if(typeof x=="function")A=function(){x(R)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,P=N.port2;N.port1.onmessage=R,A=function(){P.postMessage(null)}}else A=function(){y(R,0)};function I(D,_){C=y(function(){D(e.unstable_now())},_)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(D){D.callback=null},e.unstable_forceFrameRate=function(D){0>D||125F?(D.sortIndex=L,t(u,D),n(c)===null&&D===n(u)&&(b?(w(C),C=-1):b=!0,I(k,L-F))):(D.sortIndex=M,t(c,D),g||m||(g=!0,S||(S=!0,A()))),D},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(D){var _=h;return function(){var L=h;h=_;try{return D.apply(this,arguments)}finally{h=L}}}})(hke);fke.exports=hke;var Tqe=fke.exports,pke={exports:{}},cc={};/** + */(function(e){function t(P,_){var L=P.length;P.push(_);e:for(;0>>1,M=P[F];if(0>>1;Fr(U,L))Zr(z,U)?(P[F]=z,P[Z]=L,F=Z):(P[F]=U,P[q]=L,F=q);else if(Zr(z,L))P[F]=z,P[Z]=L,F=Z;else break e}}return _}function r(P,_){var L=P.sortIndex-_.sortIndex;return L!==0?L:P.id-_.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,f=null,h=3,m=!1,g=!1,b=!1,v=!1,y=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function O(P){for(var _=n(u);_!==null;){if(_.callback===null)i(u);else if(_.startTime<=P)i(u),_.sortIndex=_.expirationTime,t(c,_);else break;_=n(u)}}function k(P){if(b=!1,O(P),!g)if(n(c)!==null)g=!0,S||(S=!0,A());else{var _=n(u);_!==null&&I(k,_.startTime-P)}}var S=!1,C=-1,E=5,j=-1;function T(){return v?!0:!(e.unstable_now()-jP&&T());){var F=f.callback;if(typeof F=="function"){f.callback=null,h=f.priorityLevel;var M=F(f.expirationTime<=P);if(P=e.unstable_now(),typeof M=="function"){f.callback=M,O(P),_=!0;break t}f===n(c)&&i(c),O(P)}else i(c);f=n(c)}if(f!==null)_=!0;else{var V=n(u);V!==null&&I(k,V.startTime-P),_=!1}}break e}finally{f=null,h=L,m=!1}_=void 0}}finally{_?A():S=!1}}}var A;if(typeof x=="function")A=function(){x(R)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,D=N.port2;N.port1.onmessage=R,A=function(){D.postMessage(null)}}else A=function(){y(R,0)};function I(P,_){C=y(function(){P(e.unstable_now())},_)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(P){P.callback=null},e.unstable_forceFrameRate=function(P){0>P||125F?(P.sortIndex=L,t(u,P),n(c)===null&&P===n(u)&&(b?(w(C),C=-1):b=!0,I(k,L-F))):(P.sortIndex=M,t(c,P),g||m||(g=!0,S||(S=!0,A()))),P},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(P){var _=h;return function(){var L=h;h=_;try{return P.apply(this,arguments)}finally{h=L}}}})(pke);hke.exports=pke;var jqe=hke.exports,mke={exports:{}},cc={};/** * @license React * react-dom.production.js * @@ -85,7 +85,7 @@ Studio:{{studioUrl}} * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var _qe=p;function mke(e){var t="https://react.dev/errors/"+e;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(gke)}catch(e){console.error(e)}}gke(),pke.exports=cc;var yi=pke.exports;/** + */var Nqe=p;function gke(e){var t="https://react.dev/errors/"+e;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(bke)}catch(e){console.error(e)}}bke(),mke.exports=cc;var yi=mke.exports;/** * @license React * react-dom-client.production.js * @@ -93,15 +93,15 @@ Studio:{{studioUrl}} * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var fo=Tqe,bke=p,Rqe=yi;function kt(e){var t="https://react.dev/errors/"+e;if(1vx||(e.current=wF[vx],wF[vx]=null,vx--)}function vs(e,t){vx++,wF[vx]=e.current,e.current=t}var hh=Ah(null),LE=Ah(null),Sg=Ah(null),dR=Ah(null);function fR(e,t){switch(vs(Sg,t),vs(LE,e),vs(hh,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?oY(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=oY(t),e=zEe(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Io(hh),vs(hh,e)}function Iw(){Io(hh),Io(LE),Io(Sg)}function OF(e){e.memoizedState!==null&&vs(dR,e);var t=hh.current,n=zEe(t,e.type);t!==n&&(vs(LE,e),vs(hh,n))}function hR(e){LE.current===e&&(Io(hh),Io(LE)),dR.current===e&&(Io(dR),KE._currentValue=Qy)}var A5,nX;function sy(e){if(A5===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);A5=t&&t[1]||"",nX=-1xx||(e.current=OF[xx],OF[xx]=null,xx--)}function vs(e,t){xx++,OF[xx]=e.current,e.current=t}var ph=Th(null),$E=Th(null),Eg=Th(null),fR=Th(null);function hR(e,t){switch(vs(Eg,t),vs($E,e),vs(ph,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?lY(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=lY(t),e=VEe(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Io(ph),vs(ph,e)}function Pw(){Io(ph),Io($E),Io(Eg)}function kF(e){e.memoizedState!==null&&vs(fR,e);var t=ph.current,n=VEe(t,e.type);t!==n&&(vs($E,e),vs(ph,n))}function pR(e){$E.current===e&&(Io(ph),Io($E)),fR.current===e&&(Io(fR),GE._currentValue=zy)}var T5,iX;function ay(e){if(T5===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);T5=t&&t[1]||"",iX=-1)":-1r||c[i]!==u[r]){var d=` -`+c[i].replace(" at new "," at ");return e.displayName&&d.includes("")&&(d=d.replace("",e.displayName)),d}while(1<=i&&0<=r);break}}}finally{T5=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?sy(n):""}function Lqe(e,t){switch(e.tag){case 26:case 27:case 5:return sy(e.type);case 16:return sy("Lazy");case 13:return e.child!==t&&t!==null?sy("Suspense Fallback"):sy("Suspense");case 19:return sy("SuspenseList");case 0:case 15:return _5(e.type,!1);case 11:return _5(e.type.render,!1);case 1:return _5(e.type,!0);case 31:return sy("Activity");default:return""}}function iX(e){try{var t="",n=null;do t+=Lqe(e,n),n=e,e=e.return;while(e);return t}catch(i){return` +`+c[i].replace(" at new "," at ");return e.displayName&&d.includes("")&&(d=d.replace("",e.displayName)),d}while(1<=i&&0<=r);break}}}finally{_5=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?ay(n):""}function Fqe(e,t){switch(e.tag){case 26:case 27:case 5:return ay(e.type);case 16:return ay("Lazy");case 13:return e.child!==t&&t!==null?ay("Suspense Fallback"):ay("Suspense");case 19:return ay("SuspenseList");case 0:case 15:return j5(e.type,!1);case 11:return j5(e.type.render,!1);case 1:return j5(e.type,!0);case 31:return ay("Activity");default:return""}}function rX(e){try{var t="",n=null;do t+=Fqe(e,n),n=e,e=e.return;while(e);return t}catch(i){return` Error generating stack: `+i.message+` -`+i.stack}}var kF=Object.prototype.hasOwnProperty,BU=fo.unstable_scheduleCallback,j5=fo.unstable_cancelCallback,$qe=fo.unstable_shouldYield,Fqe=fo.unstable_requestPaint,Su=fo.unstable_now,Bqe=fo.unstable_getCurrentPriorityLevel,Ske=fo.unstable_ImmediatePriority,Eke=fo.unstable_UserBlockingPriority,pR=fo.unstable_NormalPriority,Uqe=fo.unstable_LowPriority,Cke=fo.unstable_IdlePriority,Qqe=fo.log,zqe=fo.unstable_setDisableYieldValue,wA=null,Eu=null;function ug(e){if(typeof Qqe=="function"&&zqe(e),Eu&&typeof Eu.setStrictMode=="function")try{Eu.setStrictMode(wA,e)}catch{}}var Cu=Math.clz32?Math.clz32:qqe,Vqe=Math.log,Hqe=Math.LN2;function qqe(e){return e>>>=0,e===0?32:31-(Vqe(e)/Hqe|0)|0}var N2=256,R2=262144,I2=4194304;function ay(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function tD(e,t,n){var i=e.pendingLanes;if(i===0)return 0;var r=0,s=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var l=i&134217727;return l!==0?(i=l&~s,i!==0?r=ay(i):(o&=l,o!==0?r=ay(o):n||(n=l&~e,n!==0&&(r=ay(n))))):(l=i&~s,l!==0?r=ay(l):o!==0?r=ay(o):n||(n=i&~e,n!==0&&(r=ay(n)))),r===0?0:t!==0&&t!==r&&!(t&s)&&(s=r&-r,n=t&-t,s>=n||s===32&&(n&4194048)!==0)?t:r}function OA(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Wqe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ake(){var e=I2;return I2<<=1,!(I2&62914560)&&(I2=4194304),e}function N5(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function kA(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Kqe(e,t,n,i,r,s){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var l=e.entanglements,c=e.expirationTimes,u=e.hiddenUpdates;for(n=o&~n;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var eWe=/[\n"\\]/g;function rd(e){return e.replace(eWe,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function CF(e,t,n,i,r,s,o,l){e.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.type=o:e.removeAttribute("type"),t!=null?o==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ju(t)):e.value!==""+Ju(t)&&(e.value=""+Ju(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?AF(e,o,Ju(t)):n!=null?AF(e,o,Ju(n)):i!=null&&e.removeAttribute("value"),r==null&&s!=null&&(e.defaultChecked=!!s),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+Ju(l):e.removeAttribute("name")}function Mke(e,t,n,i,r,s,o,l){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.type=s),t!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||t!=null)){EF(e);return}n=n!=null?""+Ju(n):"",t=t!=null?""+Ju(t):n,l||t===e.value||(e.value=t),e.defaultValue=t}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=l?e.checked:!!i,e.defaultChecked=!!i,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.name=o),EF(e)}function AF(e,t,n){t==="number"&&mR(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Gx(e,t,n,i){if(e=e.options,t){t={};for(var r=0;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_F=!1;if(Qp)try{var JO={};Object.defineProperty(JO,"passive",{get:function(){_F=!0}}),window.addEventListener("test",JO,JO),window.removeEventListener("test",JO,JO)}catch{_F=!1}var dg=null,qU=null,Vj=null;function Uke(){if(Vj)return Vj;var e,t=qU,n=t.length,i,r="value"in dg?dg.value:dg.textContent,s=r.length;for(e=0;e=PS),pX=" ",mX=!1;function zke(e,t){switch(e){case"keyup":return TWe.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vke(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ox=!1;function jWe(e,t){switch(e){case"compositionend":return Vke(t);case"keypress":return t.which!==32?null:(mX=!0,pX);case"textInput":return e=t.data,e===pX&&mX?null:e;default:return null}}function NWe(e,t){if(Ox)return e==="compositionend"||!KU&&zke(e,t)?(e=Uke(),Vj=qU=dg=null,Ox=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=xX(n)}}function Kke(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Kke(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Gke(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=mR(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=mR(e.document)}return t}function GU(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var FWe=Qp&&"documentMode"in document&&11>=document.documentMode,kx=null,jF=null,MS=null,NF=!1;function OX(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;NF||kx==null||kx!==mR(i)||(i=kx,"selectionStart"in i&&GU(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),MS&&BE(MS,i)||(MS=i,i=IR(jF,"onSelect"),0>=o,r-=o,rh=1<<32-Cu(t)+r|n<E?(j=C,C=null):j=C.sibling;var T=h(y,C,x[E],O);if(T===null){C===null&&(C=j);break}e&&C&&T.alternate===null&&t(y,C),w=s(T,w,E),S===null?k=T:S.sibling=T,S=T,C=j}if(E===x.length)return n(y,C),or&&fp(y,E),k;if(C===null){for(;EE?(j=C,C=null):j=C.sibling;var R=h(y,C,T.value,O);if(R===null){C===null&&(C=j);break}e&&C&&R.alternate===null&&t(y,C),w=s(R,w,E),S===null?k=R:S.sibling=R,S=R,C=j}if(T.done)return n(y,C),or&&fp(y,E),k;if(C===null){for(;!T.done;E++,T=x.next())T=f(y,T.value,O),T!==null&&(w=s(T,w,E),S===null?k=T:S.sibling=T,S=T);return or&&fp(y,E),k}for(C=i(C);!T.done;E++,T=x.next())T=m(C,y,E,T.value,O),T!==null&&(e&&T.alternate!==null&&C.delete(T.key===null?E:T.key),w=s(T,w,E),S===null?k=T:S.sibling=T,S=T);return e&&C.forEach(function(A){return t(y,A)}),or&&fp(y,E),k}function v(y,w,x,O){if(typeof x=="object"&&x!==null&&x.type===yx&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case j2:e:{for(var k=x.key;w!==null;){if(w.key===k){if(k=x.type,k===yx){if(w.tag===7){n(y,w.sibling),O=r(w,x.props.children),O.return=y,y=O;break e}}else if(w.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===qm&&oy(k)===w.type){n(y,w.sibling),O=r(w,x.props),tk(O,x),O.return=y,y=O;break e}n(y,w);break}else t(y,w);w=w.sibling}x.type===yx?(O=zy(x.props.children,y.mode,O,x.key),O.return=y,y=O):(O=qj(x.type,x.key,x.props,null,y.mode,O),tk(O,x),O.return=y,y=O)}return o(y);case eS:e:{for(k=x.key;w!==null;){if(w.key===k)if(w.tag===4&&w.stateNode.containerInfo===x.containerInfo&&w.stateNode.implementation===x.implementation){n(y,w.sibling),O=r(w,x.children||[]),O.return=y,y=O;break e}else{n(y,w);break}else t(y,w);w=w.sibling}O=B5(x,y.mode,O),O.return=y,y=O}return o(y);case qm:return x=oy(x),v(y,w,x,O)}if(tS(x))return g(y,w,x,O);if(ZO(x)){if(k=ZO(x),typeof k!="function")throw Error(kt(150));return x=k.call(x),b(y,w,x,O)}if(typeof x.then=="function")return v(y,w,L2(x),O);if(x.$$typeof===Op)return v(y,w,M2(y,x),O);$2(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint"?(x=""+x,w!==null&&w.tag===6?(n(y,w.sibling),O=r(w,x),O.return=y,y=O):(n(y,w),O=F5(x,y.mode,O),O.return=y,y=O),o(y)):n(y,w)}return function(y,w,x,O){try{zE=0;var k=v(y,w,x,O);return Zx=null,k}catch(C){if(C===I1||C===oD)throw C;var S=yu(29,C,null,y.mode);return S.lanes=O,S.return=y,S}finally{}}}var a0=uSe(!0),dSe=uSe(!1),Wm=!1;function rQ(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $F(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Cg(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ag(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,Ar&2){var r=i.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),i.pending=t,t=bR(e),nSe(e,null,n),t}return aD(e,i,t,n),bR(e)}function $S(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,_ke(e,n)}}function Q5(e,t){var n=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?r=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?r=s=t:s=s.next=t}else r=s=t;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:s,shared:i.shared,callbacks:i.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var FF=!1;function FS(){if(FF){var e=Yx;if(e!==null)throw e}}function BS(e,t,n,i){FF=!1;var r=e.updateQueue;Wm=!1;var s=r.firstBaseUpdate,o=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?s=u:o.next=u,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(s!==null){var f=r.baseState;o=0,d=u=c=null,l=s;do{var h=l.lane&-536870913,m=h!==l.lane;if(m?(nr&h)===h:(i&h)===h){h!==0&&h===Mw&&(FF=!0),d!==null&&(d=d.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var g=e,b=l;h=t;var v=n;switch(b.tag){case 1:if(g=b.payload,typeof g=="function"){f=g.call(v,f,h);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=b.payload,h=typeof g=="function"?g.call(v,f,h):g,h==null)break e;f=Ps({},f,h);break e;case 2:Wm=!0}}h=l.callback,h!==null&&(e.flags|=64,m&&(e.flags|=8192),m=r.callbacks,m===null?r.callbacks=[h]:m.push(h))}else m={lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=m,c=f):d=d.next=m,o|=h;if(l=l.next,l===null){if(l=r.shared.pending,l===null)break;m=l,l=m.next,m.next=null,r.lastBaseUpdate=m,r.shared.pending=null}}while(!0);d===null&&(c=f),r.baseState=c,r.firstBaseUpdate=u,r.lastBaseUpdate=d,s===null&&(r.shared.lanes=0),qg|=o,e.lanes=o,e.memoizedState=f}}function fSe(e,t){if(typeof e!="function")throw Error(kt(191,e));e.call(t)}function hSe(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;es?s:8;var o=si.T,l={};si.T=l,bQ(e,!1,t,n);try{var c=r(),u=si.S;if(u!==null&&u(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=KWe(c,i);US(e,t,d,Au(e))}else US(e,t,i,Au(e))}catch(f){US(e,t,{then:function(){},status:"rejected",reason:f},Au())}finally{Tr.p=s,o!==null&&l.types!==null&&(o.types=l.types),si.T=o}}function eKe(){}function VF(e,t,n,i){if(e.tag!==5)throw Error(kt(476));var r=$Se(e).queue;LSe(e,r,t,Qy,n===null?eKe:function(){return FSe(e),n(i)})}function $Se(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Qy,baseState:Qy,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vp,lastRenderedState:Qy},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vp,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function FSe(e){var t=$Se(e);t.next===null&&(t=e.alternate.memoizedState),US(e,t.next.queue,{},Au())}function gQ(){return rl(KE)}function BSe(){return Aa().memoizedState}function USe(){return Aa().memoizedState}function tKe(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Au();e=Cg(n);var i=Ag(t,e,n);i!==null&&(Bc(i,t,n),$S(i,t,n)),t={cache:tQ()},e.payload=t;return}t=t.return}}function nKe(e,t,n){var i=Au();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},dD(e)?zSe(t,n):(n=YU(e,t,n,i),n!==null&&(Bc(n,e,i),VSe(n,t,i)))}function QSe(e,t,n){var i=Au();US(e,t,n,i)}function US(e,t,n,i){var r={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(dD(e))zSe(t,r);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,l=s(o,n);if(r.hasEagerState=!0,r.eagerState=l,Iu(l,o))return aD(e,t,r,0),ls===null&&sD(),!1}catch{}finally{}if(n=YU(e,t,r,i),n!==null)return Bc(n,e,i),VSe(n,t,i),!0}return!1}function bQ(e,t,n,i){if(i={lane:2,revertLane:CQ(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},dD(e)){if(t)throw Error(kt(479))}else t=YU(e,n,i,2),t!==null&&Bc(t,e,2)}function dD(e){var t=e.alternate;return e===Ci||t!==null&&t===Ci}function zSe(e,t){Jx=kR=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function VSe(e,t,n){if(n&4194048){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,_ke(e,n)}}var HE={readContext:rl,use:cD,useCallback:la,useContext:la,useEffect:la,useImperativeHandle:la,useLayoutEffect:la,useInsertionEffect:la,useMemo:la,useReducer:la,useRef:la,useState:la,useDebugValue:la,useDeferredValue:la,useTransition:la,useSyncExternalStore:la,useId:la,useHostTransitionStatus:la,useFormState:la,useActionState:la,useOptimistic:la,useMemoCache:la,useCacheRefresh:la};HE.useEffectEvent=la;var HSe={readContext:rl,use:cD,useCallback:function(e,t){return Kl().memoizedState=[e,t===void 0?null:t],e},useContext:rl,useEffect:LX,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Gj(4194308,4,RSe.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Gj(4194308,4,e,t)},useInsertionEffect:function(e,t){Gj(4,2,e,t)},useMemo:function(e,t){var n=Kl();t=t===void 0?null:t;var i=e();if(o0){ug(!0);try{e()}finally{ug(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=Kl();if(n!==void 0){var r=n(t);if(o0){ug(!0);try{n(t)}finally{ug(!1)}}}else r=t;return i.memoizedState=i.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},i.queue=e,e=e.dispatch=nKe.bind(null,Ci,e),[i.memoizedState,e]},useRef:function(e){var t=Kl();return e={current:e},t.memoizedState=e},useState:function(e){e=QF(e);var t=e.queue,n=QSe.bind(null,Ci,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:pQ,useDeferredValue:function(e,t){var n=Kl();return mQ(n,e,t)},useTransition:function(){var e=QF(!1);return e=LSe.bind(null,Ci,e.queue,!0,!1),Kl().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=Ci,r=Kl();if(or){if(n===void 0)throw Error(kt(407));n=n()}else{if(n=t(),ls===null)throw Error(kt(349));nr&127||ySe(i,t,n)}r.memoizedState=n;var s={value:n,getSnapshot:t};return r.queue=s,LX(xSe.bind(null,i,s,e),[e]),i.flags|=2048,$w(9,{destroy:void 0},vSe.bind(null,i,s,n,t),null),n},useId:function(){var e=Kl(),t=ls.identifierPrefix;if(or){var n=sh,i=rh;n=(i&~(1<<32-Cu(i)-1)).toString(32)+n,t="_"+t+"R_"+n,n=SR++,0<\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof i.is=="string"?o.createElement("select",{is:i.is}):o.createElement("select"),i.multiple?s.multiple=!0:i.size&&(s.size=i.size);break;default:s=typeof i.is=="string"?o.createElement(r,{is:i.is}):o.createElement(r)}}s[tl]=t,s[Qc]=i;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)s.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break e;for(;o.sibling===null;){if(o.return===null||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=s;e:switch(sl(s,r,i),r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Kh(t)}}return Es(t),X5(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Kh(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(kt(166));if(e=Sg.current,Av(t)){if(e=t.stateNode,n=t.memoizedProps,i=null,r=nl,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}e[tl]=t,e=!!(e.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||QEe(e.nodeValue,n)),e||Vg(t,!0)}else e=PR(e).createTextNode(i),e[tl]=t,t.stateNode=e}return Es(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(i=Av(t),n!==null){if(e===null){if(!i)throw Error(kt(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(kt(557));e[tl]=t}else r0(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Es(t),e=!1}else n=U5(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(bu(t),t):(bu(t),null);if(t.flags&128)throw Error(kt(558))}return Es(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Av(t),i!==null&&i.dehydrated!==null){if(e===null){if(!r)throw Error(kt(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(kt(317));r[tl]=t}else r0(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Es(t),r=!1}else r=U5(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(bu(t),t):(bu(t),null)}return bu(t),t.flags&128?(t.lanes=n,t):(n=i!==null,e=e!==null&&e.memoizedState!==null,n&&(i=t.child,r=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(r=i.alternate.memoizedState.cachePool.pool),s=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(s=i.memoizedState.cachePool.pool),s!==r&&(i.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),F2(t,t.updateQueue),Es(t),null);case 4:return Iw(),e===null&&AQ(t.stateNode.containerInfo),Es(t),null;case 10:return _p(t.type),Es(t),null;case 19:if(Io(Sa),i=t.memoizedState,i===null)return Es(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)nk(i,!1);else{if(da!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=OR(e),s!==null){for(t.flags|=128,nk(i,!1),e=s.updateQueue,t.updateQueue=e,F2(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)iSe(n,e),n=n.sibling;return vs(Sa,Sa.current&1|2),or&&fp(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&Su()>TR&&(t.flags|=128,r=!0,nk(i,!1),t.lanes=4194304)}else{if(!r)if(e=OR(s),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,F2(t,e),nk(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!or)return Es(t),null}else 2*Su()-i.renderingStartTime>TR&&n!==536870912&&(t.flags|=128,r=!0,nk(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(e=i.last,e!==null?e.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Su(),e.sibling=null,n=Sa.current,vs(Sa,r?n&1|2:n&1),or&&fp(t,i.treeForkCount),e):(Es(t),null);case 22:case 23:return bu(t),sQ(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?n&536870912&&!(t.flags&128)&&(Es(t),t.subtreeFlags&6&&(t.flags|=8192)):Es(t),n=t.updateQueue,n!==null&&F2(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==n&&(t.flags|=2048),e!==null&&Io(Vy),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),_p(Ka),Es(t),null;case 25:return null;case 30:return null}throw Error(kt(156,t.tag))}function oKe(e,t){switch(eQ(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return _p(Ka),Iw(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return hR(t),null;case 31:if(t.memoizedState!==null){if(bu(t),t.alternate===null)throw Error(kt(340));r0()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(bu(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(kt(340));r0()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Io(Sa),null;case 4:return Iw(),null;case 10:return _p(t.type),null;case 22:case 23:return bu(t),sQ(),e!==null&&Io(Vy),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return _p(Ka),null;case 25:return null;default:return null}}function iEe(e,t){switch(eQ(t),t.tag){case 3:_p(Ka),Iw();break;case 26:case 27:case 5:hR(t);break;case 4:Iw();break;case 31:t.memoizedState!==null&&bu(t);break;case 13:bu(t);break;case 19:Io(Sa);break;case 10:_p(t.type);break;case 22:case 23:bu(t),sQ(),e!==null&&Io(Vy);break;case 24:_p(Ka)}}function TA(e,t){try{var n=t.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var r=i.next;n=r;do{if((n.tag&e)===e){i=void 0;var s=n.create,o=n.inst;i=s(),o.destroy=i}n=n.next}while(n!==r)}}catch(l){Qr(t,t.return,l)}}function Hg(e,t,n){try{var i=t.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var s=r.next;i=s;do{if((i.tag&e)===e){var o=i.inst,l=o.destroy;if(l!==void 0){o.destroy=void 0,r=t;var c=n,u=l;try{u()}catch(d){Qr(r,c,d)}}}i=i.next}while(i!==s)}}catch(d){Qr(t,t.return,d)}}function rEe(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{hSe(t,n)}catch(i){Qr(e,e.return,i)}}}function sEe(e,t,n){n.props=l0(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(i){Qr(e,t,i)}}function QS(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof n=="function"?e.refCleanup=n(i):n.current=i}}catch(r){Qr(e,t,r)}}function ah(e,t){var n=e.ref,i=e.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(r){Qr(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){Qr(e,t,r)}else n.current=null}function aEe(e){var t=e.type,n=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(r){Qr(e,e.return,r)}}function Y5(e,t,n){try{var i=e.stateNode;_Ke(i,e.type,n,t),i[Qc]=t}catch(r){Qr(e,e.return,r)}}function oEe(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ob(e.type)||e.tag===4}function Z5(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||oEe(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ob(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function GF(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=kp));else if(i!==4&&(i===27&&Ob(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(GF(e,t,n),e=e.sibling;e!==null;)GF(e,t,n),e=e.sibling}function AR(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(i===27&&Ob(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(AR(e,t,n),e=e.sibling;e!==null;)AR(e,t,n),e=e.sibling}function lEe(e){var t=e.stateNode,n=e.memoizedProps;try{for(var i=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);sl(t,i,n),t[tl]=e,t[Qc]=n}catch(s){Qr(e,e.return,s)}}var bp=!1,Wa=!1,J5=!1,XX=typeof WeakSet=="function"?WeakSet:Set,Eo=null;function lKe(e,t){if(e=e.containerInfo,n8=$R,e=Gke(e),GU(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var m;f!==n||r!==0&&f.nodeType!==3||(l=o+r),f!==s||i!==0&&f.nodeType!==3||(c=o+i),f.nodeType===3&&(o+=f.nodeValue.length),(m=f.firstChild)!==null;)h=f,f=m;for(;;){if(f===e)break t;if(h===n&&++u===r&&(l=o),h===s&&++d===i&&(c=o),(m=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=m}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(i8={focusedElem:e,selectionRange:n},$R=!1,Eo=t;Eo!==null;)if(t=Eo,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Eo=e;else for(;Eo!==null;){switch(t=Eo,s=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n title"))),sl(s,i,n),s[tl]=e,Ao(s),i=s;break e;case"link":var o=gY("link","href",r).get(i+(n.href||""));if(o){for(var l=0;lv&&(o=v,v=b,b=o);var y=wX(l,b),w=wX(l,v);if(y&&w&&(m.rangeCount!==1||m.anchorNode!==y.node||m.anchorOffset!==y.offset||m.focusNode!==w.node||m.focusOffset!==w.offset)){var x=f.createRange();x.setStart(y.node,y.offset),m.removeAllRanges(),b>v?(m.addRange(x),m.extend(w.node,w.offset)):(x.setEnd(w.node,w.offset),m.addRange(x))}}}}for(f=[],m=l;m=m.parentNode;)m.nodeType===1&&f.push({element:m,left:m.scrollLeft,top:m.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;ln?32:n,si.T=null,n=ZF,ZF=null;var s=_g,o=jp;if(co=0,Bw=_g=null,jp=0,Ar&6)throw Error(kt(331));var l=Ar;if(Ar|=4,vEe(s.current),gEe(s,s.current,o,n),Ar=l,_A(0,!1),Eu&&typeof Eu.onPostCommitFiberRoot=="function")try{Eu.onPostCommitFiberRoot(wA,s)}catch{}return!0}finally{Tr.p=r,si.T=i,PEe(e,t)}}function eY(e,t,n){t=sd(n,t),t=qF(e.stateNode,t,2),e=Ag(e,t,2),e!==null&&(kA(e,2),Th(e))}function Qr(e,t,n){if(e.tag===3)eY(e,e,n);else for(;t!==null;){if(t.tag===3){eY(t,e,n);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Tg===null||!Tg.has(i))){e=sd(n,e),n=XSe(2),i=Ag(t,n,2),i!==null&&(YSe(n,i,t,e),kA(i,2),Th(i));break}}t=t.return}}function t3(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new dKe;var r=new Set;i.set(t,r)}else r=i.get(t),r===void 0&&(r=new Set,i.set(t,r));r.has(n)||(kQ=!0,r.add(n),e=gKe.bind(null,e,t,n),t.then(e,e))}function gKe(e,t,n){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ls===e&&(nr&n)===n&&(da===4||da===3&&(nr&62914560)===nr&&300>Su()-fD?!(Ar&2)&&Uw(e,0):SQ|=n,Fw===nr&&(Fw=0)),Th(e)}function MEe(e,t){t===0&&(t=Ake()),e=L0(e,t),e!==null&&(kA(e,t),Th(e))}function bKe(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),MEe(e,n)}function yKe(e,t){var n=0;switch(e.tag){case 31:case 13:var i=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(kt(314))}i!==null&&i.delete(t),MEe(e,n)}function vKe(e,t){return BU(e,t)}var NR=null,nx=null,e8=!1,RR=!1,n3=!1,pg=0;function Th(e){e!==nx&&e.next===null&&(nx===null?NR=nx=e:nx=nx.next=e),RR=!0,e8||(e8=!0,wKe())}function _A(e,t){if(!n3&&RR){n3=!0;do for(var n=!1,i=NR;i!==null;){if(e!==0){var r=i.pendingLanes;if(r===0)var s=0;else{var o=i.suspendedLanes,l=i.pingedLanes;s=(1<<31-Cu(42|e)+1)-1,s&=r&~(o&~l),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,tY(i,s))}else s=nr,s=tD(i,i===ls?s:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),!(s&3)||OA(i,s)||(n=!0,tY(i,s));i=i.next}while(n);n3=!1}}function xKe(){LEe()}function LEe(){RR=e8=!1;var e=0;pg!==0&&NKe()&&(e=pg);for(var t=Su(),n=null,i=NR;i!==null;){var r=i.next,s=$Ee(i,t);s===0?(i.next=null,n===null?NR=r:n.next=r,r===null&&(nx=n)):(n=i,(e!==0||s&3)&&(RR=!0)),i=r}co!==0&&co!==5||_A(e),pg!==0&&(pg=0)}function $Ee(e,t){for(var n=e.suspendedLanes,i=e.pingedLanes,r=e.expirationTimes,s=e.pendingLanes&-62914561;0l)break;var d=c.transferSize,f=c.initiatorType;d&&aY(f)&&(c=c.responseEnd,o+=d*(c"u"?null:document;function WEe(e,t,n){var i=D1;if(i&&typeof t=="string"&&t){var r=rd(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),hY.has(r)||(hY.add(r),e={rel:e,crossOrigin:n,href:t},i.querySelector(r)===null&&(t=i.createElement("link"),sl(t,"link",e),Ao(t),i.head.appendChild(t)))}}function BKe(e){cm.D(e),WEe("dns-prefetch",e,null)}function UKe(e,t){cm.C(e,t),WEe("preconnect",e,t)}function QKe(e,t,n){cm.L(e,t,n);var i=D1;if(i&&e&&t){var r='link[rel="preload"][as="'+rd(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+rd(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+rd(n.imageSizes)+'"]')):r+='[href="'+rd(e)+'"]';var s=r;switch(t){case"style":s=Qw(e);break;case"script":s=M1(e)}Sd.has(s)||(e=Ps({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Sd.set(s,e),i.querySelector(r)!==null||t==="style"&&i.querySelector(jA(s))||t==="script"&&i.querySelector(NA(s))||(t=i.createElement("link"),sl(t,"link",e),Ao(t),i.head.appendChild(t)))}}function zKe(e,t){cm.m(e,t);var n=D1;if(n&&e){var i=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+rd(i)+'"][href="'+rd(e)+'"]',s=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=M1(e)}if(!Sd.has(s)&&(e=Ps({rel:"modulepreload",href:e},t),Sd.set(s,e),n.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(NA(s)))return}i=n.createElement("link"),sl(i,"link",e),Ao(i),n.head.appendChild(i)}}}function VKe(e,t,n){cm.S(e,t,n);var i=D1;if(i&&e){var r=Kx(i).hoistableStyles,s=Qw(e);t=t||"default";var o=r.get(s);if(!o){var l={loading:0,preload:null};if(o=i.querySelector(jA(s)))l.loading=5;else{e=Ps({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Sd.get(s))&&TQ(e,n);var c=o=i.createElement("link");Ao(c),sl(c,"link",e),c._p=new Promise(function(u,d){c.onload=u,c.onerror=d}),c.addEventListener("load",function(){l.loading|=1}),c.addEventListener("error",function(){l.loading|=2}),l.loading|=4,Jj(o,t,i)}o={type:"stylesheet",instance:o,count:1,state:l},r.set(s,o)}}}function HKe(e,t){cm.X(e,t);var n=D1;if(n&&e){var i=Kx(n).hoistableScripts,r=M1(e),s=i.get(r);s||(s=n.querySelector(NA(r)),s||(e=Ps({src:e,async:!0},t),(t=Sd.get(r))&&_Q(e,t),s=n.createElement("script"),Ao(s),sl(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function qKe(e,t){cm.M(e,t);var n=D1;if(n&&e){var i=Kx(n).hoistableScripts,r=M1(e),s=i.get(r);s||(s=n.querySelector(NA(r)),s||(e=Ps({src:e,async:!0,type:"module"},t),(t=Sd.get(r))&&_Q(e,t),s=n.createElement("script"),Ao(s),sl(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function pY(e,t,n,i){var r=(r=Sg.current)?DR(r):null;if(!r)throw Error(kt(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Qw(n.href),n=Kx(r).hoistableStyles,i=n.get(t),i||(i={type:"style",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Qw(n.href);var s=Kx(r).hoistableStyles,o=s.get(e);if(o||(r=r.ownerDocument||r,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(e,o),(s=r.querySelector(jA(e)))&&!s._p&&(o.instance=s,o.state.loading=5),Sd.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Sd.set(e,n),s||WKe(r,e,n,o.state))),t&&i===null)throw Error(kt(528,""));return o}if(t&&i!==null)throw Error(kt(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=M1(n),n=Kx(r).hoistableScripts,i=n.get(t),i||(i={type:"script",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(kt(444,e))}}function Qw(e){return'href="'+rd(e)+'"'}function jA(e){return'link[rel="stylesheet"]['+e+"]"}function KEe(e){return Ps({},e,{"data-precedence":e.precedence,precedence:null})}function WKe(e,t,n,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),sl(t,"link",n),Ao(t),e.head.appendChild(t))}function M1(e){return'[src="'+rd(e)+'"]'}function NA(e){return"script[async]"+e}function mY(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+rd(n.href)+'"]');if(i)return t.instance=i,Ao(i),i;var r=Ps({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),Ao(i),sl(i,"style",r),Jj(i,n.precedence,e),t.instance=i;case"stylesheet":r=Qw(n.href);var s=e.querySelector(jA(r));if(s)return t.state.loading|=4,t.instance=s,Ao(s),s;i=KEe(n),(r=Sd.get(r))&&TQ(i,r),s=(e.ownerDocument||e).createElement("link"),Ao(s);var o=s;return o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),sl(s,"link",i),t.state.loading|=4,Jj(s,n.precedence,e),t.instance=s;case"script":return s=M1(n.src),(r=e.querySelector(NA(s)))?(t.instance=r,Ao(r),r):(i=n,(r=Sd.get(s))&&(i=Ps({},n),_Q(i,r)),e=e.ownerDocument||e,r=e.createElement("script"),Ao(r),sl(r,"link",i),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(kt(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(i=t.instance,t.state.loading|=4,Jj(i,n.precedence,e));return t.instance}function Jj(e,t,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,s=r,o=0;o title"):null)}function KKe(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function GEe(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function GKe(e,t,n,i){if(n.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&!(n.state.loading&4)){if(n.instance===null){var r=Qw(i.href),s=t.querySelector(jA(r));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=MR.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=s,Ao(s);return}s=t.ownerDocument||t,i=KEe(i),(r=Sd.get(r))&&TQ(i,r),s=s.createElement("link"),Ao(s);var o=s;o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),sl(s,"link",i),n.instance=s}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=MR.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var l3=0;function XKe(e,t){return e.stylesheets&&e.count===0&&tN(e,e.stylesheets),0l3?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(r)}}:null}function MR(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)tN(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var LR=null;function tN(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,LR=new Map,t.forEach(YKe,e),LR=null,MR.call(e))}function YKe(e,t){if(!(t.state.loading&4)){var n=LR.get(e);if(n)var i=n.get(null);else{n=new Map,LR.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(iCe)}catch(e){console.error(e)}}iCe(),dke.exports=JP;var sGe=dke.exports;const aGe=T1(sGe),PQ=p.createContext({});function bD(e){const t=p.useRef(null);return t.current===null&&(t.current=e()),t.current}const yD=p.createContext(null),YE=p.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class oGe extends p.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function lGe({children:e,isPresent:t}){const n=p.useId(),i=p.useRef(null),r=p.useRef({width:0,height:0,top:0,left:0}),{nonce:s}=p.useContext(YE);return p.useInsertionEffect(()=>{const{width:o,height:l,top:c,left:u}=r.current;if(t||!i.current||!o||!l)return;i.current.dataset.motionPopId=n;const d=document.createElement("style");return s&&(d.nonce=s),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(` +`+i.stack}}var SF=Object.prototype.hasOwnProperty,UU=fo.unstable_scheduleCallback,N5=fo.unstable_cancelCallback,Bqe=fo.unstable_shouldYield,Uqe=fo.unstable_requestPaint,Eu=fo.unstable_now,Qqe=fo.unstable_getCurrentPriorityLevel,Eke=fo.unstable_ImmediatePriority,Cke=fo.unstable_UserBlockingPriority,mR=fo.unstable_NormalPriority,zqe=fo.unstable_LowPriority,Ake=fo.unstable_IdlePriority,Vqe=fo.log,Hqe=fo.unstable_setDisableYieldValue,OA=null,Cu=null;function dg(e){if(typeof Vqe=="function"&&Hqe(e),Cu&&typeof Cu.setStrictMode=="function")try{Cu.setStrictMode(OA,e)}catch{}}var Au=Math.clz32?Math.clz32:Kqe,qqe=Math.log,Wqe=Math.LN2;function Kqe(e){return e>>>=0,e===0?32:31-(qqe(e)/Wqe|0)|0}var R2=256,I2=262144,P2=4194304;function oy(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function tD(e,t,n){var i=e.pendingLanes;if(i===0)return 0;var r=0,s=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var l=i&134217727;return l!==0?(i=l&~s,i!==0?r=oy(i):(o&=l,o!==0?r=oy(o):n||(n=l&~e,n!==0&&(r=oy(n))))):(l=i&~s,l!==0?r=oy(l):o!==0?r=oy(o):n||(n=i&~e,n!==0&&(r=oy(n)))),r===0?0:t!==0&&t!==r&&!(t&s)&&(s=r&-r,n=t&-t,s>=n||s===32&&(n&4194048)!==0)?t:r}function kA(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Gqe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Tke(){var e=P2;return P2<<=1,!(P2&62914560)&&(P2=4194304),e}function R5(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function SA(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Xqe(e,t,n,i,r,s){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var l=e.entanglements,c=e.expirationTimes,u=e.hiddenUpdates;for(n=o&~n;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var nWe=/[\n"\\]/g;function sd(e){return e.replace(nWe,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function AF(e,t,n,i,r,s,o,l){e.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.type=o:e.removeAttribute("type"),t!=null?o==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+ed(t)):e.value!==""+ed(t)&&(e.value=""+ed(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?TF(e,o,ed(t)):n!=null?TF(e,o,ed(n)):i!=null&&e.removeAttribute("value"),r==null&&s!=null&&(e.defaultChecked=!!s),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+ed(l):e.removeAttribute("name")}function Lke(e,t,n,i,r,s,o,l){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.type=s),t!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||t!=null)){CF(e);return}n=n!=null?""+ed(n):"",t=t!=null?""+ed(t):n,l||t===e.value||(e.value=t),e.defaultValue=t}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=l?e.checked:!!i,e.defaultChecked=!!i,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.name=o),CF(e)}function TF(e,t,n){t==="number"&&gR(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Xx(e,t,n,i){if(e=e.options,t){t={};for(var r=0;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),jF=!1;if(zp)try{var ek={};Object.defineProperty(ek,"passive",{get:function(){jF=!0}}),window.addEventListener("test",ek,ek),window.removeEventListener("test",ek,ek)}catch{jF=!1}var fg=null,WU=null,Hj=null;function Qke(){if(Hj)return Hj;var e,t=WU,n=t.length,i,r="value"in fg?fg.value:fg.textContent,s=r.length;for(e=0;e=DS),mX=" ",gX=!1;function Vke(e,t){switch(e){case"keyup":return jWe.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hke(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var kx=!1;function RWe(e,t){switch(e){case"compositionend":return Hke(t);case"keypress":return t.which!==32?null:(gX=!0,mX);case"textInput":return e=t.data,e===mX&&gX?null:e;default:return null}}function IWe(e,t){if(kx)return e==="compositionend"||!GU&&Vke(e,t)?(e=Qke(),Hj=WU=fg=null,kx=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=wX(n)}}function Gke(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Gke(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Xke(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=gR(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=gR(e.document)}return t}function XU(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var UWe=zp&&"documentMode"in document&&11>=document.documentMode,Sx=null,NF=null,LS=null,RF=!1;function kX(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;RF||Sx==null||Sx!==gR(i)||(i=Sx,"selectionStart"in i&&XU(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),LS&&UE(LS,i)||(LS=i,i=PR(NF,"onSelect"),0>=o,r-=o,sh=1<<32-Au(t)+r|n<E?(j=C,C=null):j=C.sibling;var T=h(y,C,x[E],O);if(T===null){C===null&&(C=j);break}e&&C&&T.alternate===null&&t(y,C),w=s(T,w,E),S===null?k=T:S.sibling=T,S=T,C=j}if(E===x.length)return n(y,C),or&&hp(y,E),k;if(C===null){for(;EE?(j=C,C=null):j=C.sibling;var R=h(y,C,T.value,O);if(R===null){C===null&&(C=j);break}e&&C&&R.alternate===null&&t(y,C),w=s(R,w,E),S===null?k=R:S.sibling=R,S=R,C=j}if(T.done)return n(y,C),or&&hp(y,E),k;if(C===null){for(;!T.done;E++,T=x.next())T=f(y,T.value,O),T!==null&&(w=s(T,w,E),S===null?k=T:S.sibling=T,S=T);return or&&hp(y,E),k}for(C=i(C);!T.done;E++,T=x.next())T=m(C,y,E,T.value,O),T!==null&&(e&&T.alternate!==null&&C.delete(T.key===null?E:T.key),w=s(T,w,E),S===null?k=T:S.sibling=T,S=T);return e&&C.forEach(function(A){return t(y,A)}),or&&hp(y,E),k}function v(y,w,x,O){if(typeof x=="object"&&x!==null&&x.type===vx&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case N2:e:{for(var k=x.key;w!==null;){if(w.key===k){if(k=x.type,k===vx){if(w.tag===7){n(y,w.sibling),O=r(w,x.props.children),O.return=y,y=O;break e}}else if(w.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Wm&&ly(k)===w.type){n(y,w.sibling),O=r(w,x.props),nk(O,x),O.return=y,y=O;break e}n(y,w);break}else t(y,w);w=w.sibling}x.type===vx?(O=Vy(x.props.children,y.mode,O,x.key),O.return=y,y=O):(O=Wj(x.type,x.key,x.props,null,y.mode,O),nk(O,x),O.return=y,y=O)}return o(y);case tS:e:{for(k=x.key;w!==null;){if(w.key===k)if(w.tag===4&&w.stateNode.containerInfo===x.containerInfo&&w.stateNode.implementation===x.implementation){n(y,w.sibling),O=r(w,x.children||[]),O.return=y,y=O;break e}else{n(y,w);break}else t(y,w);w=w.sibling}O=U5(x,y.mode,O),O.return=y,y=O}return o(y);case Wm:return x=ly(x),v(y,w,x,O)}if(nS(x))return g(y,w,x,O);if(JO(x)){if(k=JO(x),typeof k!="function")throw Error(kt(150));return x=k.call(x),b(y,w,x,O)}if(typeof x.then=="function")return v(y,w,$2(x),O);if(x.$$typeof===kp)return v(y,w,L2(y,x),O);F2(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint"?(x=""+x,w!==null&&w.tag===6?(n(y,w.sibling),O=r(w,x),O.return=y,y=O):(n(y,w),O=B5(x,y.mode,O),O.return=y,y=O),o(y)):n(y,w)}return function(y,w,x,O){try{VE=0;var k=v(y,w,x,O);return Jx=null,k}catch(C){if(C===P1||C===oD)throw C;var S=vu(29,C,null,y.mode);return S.lanes=O,S.return=y,S}finally{}}}var o0=dSe(!0),fSe=dSe(!1),Km=!1;function sQ(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function FF(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ag(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Tg(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,Ar&2){var r=i.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),i.pending=t,t=yR(e),iSe(e,null,n),t}return aD(e,i,t,n),yR(e)}function FS(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,jke(e,n)}}function z5(e,t){var n=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?r=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?r=s=t:s=s.next=t}else r=s=t;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:s,shared:i.shared,callbacks:i.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var BF=!1;function BS(){if(BF){var e=Zx;if(e!==null)throw e}}function US(e,t,n,i){BF=!1;var r=e.updateQueue;Km=!1;var s=r.firstBaseUpdate,o=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?s=u:o.next=u,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(s!==null){var f=r.baseState;o=0,d=u=c=null,l=s;do{var h=l.lane&-536870913,m=h!==l.lane;if(m?(nr&h)===h:(i&h)===h){h!==0&&h===Lw&&(BF=!0),d!==null&&(d=d.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var g=e,b=l;h=t;var v=n;switch(b.tag){case 1:if(g=b.payload,typeof g=="function"){f=g.call(v,f,h);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=b.payload,h=typeof g=="function"?g.call(v,f,h):g,h==null)break e;f=Ps({},f,h);break e;case 2:Km=!0}}h=l.callback,h!==null&&(e.flags|=64,m&&(e.flags|=8192),m=r.callbacks,m===null?r.callbacks=[h]:m.push(h))}else m={lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=m,c=f):d=d.next=m,o|=h;if(l=l.next,l===null){if(l=r.shared.pending,l===null)break;m=l,l=m.next,m.next=null,r.lastBaseUpdate=m,r.shared.pending=null}}while(!0);d===null&&(c=f),r.baseState=c,r.firstBaseUpdate=u,r.lastBaseUpdate=d,s===null&&(r.shared.lanes=0),Wg|=o,e.lanes=o,e.memoizedState=f}}function hSe(e,t){if(typeof e!="function")throw Error(kt(191,e));e.call(t)}function pSe(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;es?s:8;var o=si.T,l={};si.T=l,yQ(e,!1,t,n);try{var c=r(),u=si.S;if(u!==null&&u(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=XWe(c,i);QS(e,t,d,Tu(e))}else QS(e,t,i,Tu(e))}catch(f){QS(e,t,{then:function(){},status:"rejected",reason:f},Tu())}finally{Tr.p=s,o!==null&&l.types!==null&&(o.types=l.types),si.T=o}}function nKe(){}function HF(e,t,n,i){if(e.tag!==5)throw Error(kt(476));var r=FSe(e).queue;$Se(e,r,t,zy,n===null?nKe:function(){return BSe(e),n(i)})}function FSe(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:zy,baseState:zy,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hp,lastRenderedState:zy},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hp,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function BSe(e){var t=FSe(e);t.next===null&&(t=e.alternate.memoizedState),QS(e,t.next.queue,{},Tu())}function bQ(){return rl(GE)}function USe(){return Aa().memoizedState}function QSe(){return Aa().memoizedState}function iKe(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Tu();e=Ag(n);var i=Tg(t,e,n);i!==null&&(Uc(i,t,n),FS(i,t,n)),t={cache:nQ()},e.payload=t;return}t=t.return}}function rKe(e,t,n){var i=Tu();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},dD(e)?VSe(t,n):(n=ZU(e,t,n,i),n!==null&&(Uc(n,e,i),HSe(n,t,i)))}function zSe(e,t,n){var i=Tu();QS(e,t,n,i)}function QS(e,t,n,i){var r={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(dD(e))VSe(t,r);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,l=s(o,n);if(r.hasEagerState=!0,r.eagerState=l,Pu(l,o))return aD(e,t,r,0),ls===null&&sD(),!1}catch{}finally{}if(n=ZU(e,t,r,i),n!==null)return Uc(n,e,i),HSe(n,t,i),!0}return!1}function yQ(e,t,n,i){if(i={lane:2,revertLane:AQ(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},dD(e)){if(t)throw Error(kt(479))}else t=ZU(e,n,i,2),t!==null&&Uc(t,e,2)}function dD(e){var t=e.alternate;return e===Ai||t!==null&&t===Ai}function VSe(e,t){ew=SR=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function HSe(e,t,n){if(n&4194048){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,jke(e,n)}}var qE={readContext:rl,use:cD,useCallback:la,useContext:la,useEffect:la,useImperativeHandle:la,useLayoutEffect:la,useInsertionEffect:la,useMemo:la,useReducer:la,useRef:la,useState:la,useDebugValue:la,useDeferredValue:la,useTransition:la,useSyncExternalStore:la,useId:la,useHostTransitionStatus:la,useFormState:la,useActionState:la,useOptimistic:la,useMemoCache:la,useCacheRefresh:la};qE.useEffectEvent=la;var qSe={readContext:rl,use:cD,useCallback:function(e,t){return Kl().memoizedState=[e,t===void 0?null:t],e},useContext:rl,useEffect:$X,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Xj(4194308,4,ISe.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Xj(4194308,4,e,t)},useInsertionEffect:function(e,t){Xj(4,2,e,t)},useMemo:function(e,t){var n=Kl();t=t===void 0?null:t;var i=e();if(l0){dg(!0);try{e()}finally{dg(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=Kl();if(n!==void 0){var r=n(t);if(l0){dg(!0);try{n(t)}finally{dg(!1)}}}else r=t;return i.memoizedState=i.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},i.queue=e,e=e.dispatch=rKe.bind(null,Ai,e),[i.memoizedState,e]},useRef:function(e){var t=Kl();return e={current:e},t.memoizedState=e},useState:function(e){e=zF(e);var t=e.queue,n=zSe.bind(null,Ai,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:mQ,useDeferredValue:function(e,t){var n=Kl();return gQ(n,e,t)},useTransition:function(){var e=zF(!1);return e=$Se.bind(null,Ai,e.queue,!0,!1),Kl().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=Ai,r=Kl();if(or){if(n===void 0)throw Error(kt(407));n=n()}else{if(n=t(),ls===null)throw Error(kt(349));nr&127||vSe(i,t,n)}r.memoizedState=n;var s={value:n,getSnapshot:t};return r.queue=s,$X(wSe.bind(null,i,s,e),[e]),i.flags|=2048,Fw(9,{destroy:void 0},xSe.bind(null,i,s,n,t),null),n},useId:function(){var e=Kl(),t=ls.identifierPrefix;if(or){var n=ah,i=sh;n=(i&~(1<<32-Au(i)-1)).toString(32)+n,t="_"+t+"R_"+n,n=ER++,0<\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof i.is=="string"?o.createElement("select",{is:i.is}):o.createElement("select"),i.multiple?s.multiple=!0:i.size&&(s.size=i.size);break;default:s=typeof i.is=="string"?o.createElement(r,{is:i.is}):o.createElement(r)}}s[tl]=t,s[zc]=i;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)s.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break e;for(;o.sibling===null;){if(o.return===null||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=s;e:switch(sl(s,r,i),r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Gh(t)}}return Es(t),Y5(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Gh(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(kt(166));if(e=Eg.current,Tv(t)){if(e=t.stateNode,n=t.memoizedProps,i=null,r=nl,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}e[tl]=t,e=!!(e.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||zEe(e.nodeValue,n)),e||Hg(t,!0)}else e=DR(e).createTextNode(i),e[tl]=t,t.stateNode=e}return Es(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(i=Tv(t),n!==null){if(e===null){if(!i)throw Error(kt(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(kt(557));e[tl]=t}else s0(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Es(t),e=!1}else n=Q5(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(yu(t),t):(yu(t),null);if(t.flags&128)throw Error(kt(558))}return Es(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Tv(t),i!==null&&i.dehydrated!==null){if(e===null){if(!r)throw Error(kt(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(kt(317));r[tl]=t}else s0(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Es(t),r=!1}else r=Q5(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(yu(t),t):(yu(t),null)}return yu(t),t.flags&128?(t.lanes=n,t):(n=i!==null,e=e!==null&&e.memoizedState!==null,n&&(i=t.child,r=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(r=i.alternate.memoizedState.cachePool.pool),s=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(s=i.memoizedState.cachePool.pool),s!==r&&(i.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),B2(t,t.updateQueue),Es(t),null);case 4:return Pw(),e===null&&TQ(t.stateNode.containerInfo),Es(t),null;case 10:return jp(t.type),Es(t),null;case 19:if(Io(Sa),i=t.memoizedState,i===null)return Es(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)ik(i,!1);else{if(da!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=kR(e),s!==null){for(t.flags|=128,ik(i,!1),e=s.updateQueue,t.updateQueue=e,B2(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)rSe(n,e),n=n.sibling;return vs(Sa,Sa.current&1|2),or&&hp(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&Eu()>_R&&(t.flags|=128,r=!0,ik(i,!1),t.lanes=4194304)}else{if(!r)if(e=kR(s),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,B2(t,e),ik(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!or)return Es(t),null}else 2*Eu()-i.renderingStartTime>_R&&n!==536870912&&(t.flags|=128,r=!0,ik(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(e=i.last,e!==null?e.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Eu(),e.sibling=null,n=Sa.current,vs(Sa,r?n&1|2:n&1),or&&hp(t,i.treeForkCount),e):(Es(t),null);case 22:case 23:return yu(t),aQ(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?n&536870912&&!(t.flags&128)&&(Es(t),t.subtreeFlags&6&&(t.flags|=8192)):Es(t),n=t.updateQueue,n!==null&&B2(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==n&&(t.flags|=2048),e!==null&&Io(Hy),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),jp(Ka),Es(t),null;case 25:return null;case 30:return null}throw Error(kt(156,t.tag))}function cKe(e,t){switch(tQ(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return jp(Ka),Pw(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return pR(t),null;case 31:if(t.memoizedState!==null){if(yu(t),t.alternate===null)throw Error(kt(340));s0()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(yu(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(kt(340));s0()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Io(Sa),null;case 4:return Pw(),null;case 10:return jp(t.type),null;case 22:case 23:return yu(t),aQ(),e!==null&&Io(Hy),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return jp(Ka),null;case 25:return null;default:return null}}function rEe(e,t){switch(tQ(t),t.tag){case 3:jp(Ka),Pw();break;case 26:case 27:case 5:pR(t);break;case 4:Pw();break;case 31:t.memoizedState!==null&&yu(t);break;case 13:yu(t);break;case 19:Io(Sa);break;case 10:jp(t.type);break;case 22:case 23:yu(t),aQ(),e!==null&&Io(Hy);break;case 24:jp(Ka)}}function _A(e,t){try{var n=t.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var r=i.next;n=r;do{if((n.tag&e)===e){i=void 0;var s=n.create,o=n.inst;i=s(),o.destroy=i}n=n.next}while(n!==r)}}catch(l){Qr(t,t.return,l)}}function qg(e,t,n){try{var i=t.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var s=r.next;i=s;do{if((i.tag&e)===e){var o=i.inst,l=o.destroy;if(l!==void 0){o.destroy=void 0,r=t;var c=n,u=l;try{u()}catch(d){Qr(r,c,d)}}}i=i.next}while(i!==s)}}catch(d){Qr(t,t.return,d)}}function sEe(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{pSe(t,n)}catch(i){Qr(e,e.return,i)}}}function aEe(e,t,n){n.props=c0(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(i){Qr(e,t,i)}}function zS(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof n=="function"?e.refCleanup=n(i):n.current=i}}catch(r){Qr(e,t,r)}}function oh(e,t){var n=e.ref,i=e.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(r){Qr(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){Qr(e,t,r)}else n.current=null}function oEe(e){var t=e.type,n=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(r){Qr(e,e.return,r)}}function Z5(e,t,n){try{var i=e.stateNode;NKe(i,e.type,n,t),i[zc]=t}catch(r){Qr(e,e.return,r)}}function lEe(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&kb(e.type)||e.tag===4}function J5(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||lEe(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&kb(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function XF(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Sp));else if(i!==4&&(i===27&&kb(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(XF(e,t,n),e=e.sibling;e!==null;)XF(e,t,n),e=e.sibling}function TR(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(i===27&&kb(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(TR(e,t,n),e=e.sibling;e!==null;)TR(e,t,n),e=e.sibling}function cEe(e){var t=e.stateNode,n=e.memoizedProps;try{for(var i=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);sl(t,i,n),t[tl]=e,t[zc]=n}catch(s){Qr(e,e.return,s)}}var yp=!1,Wa=!1,e3=!1,YX=typeof WeakSet=="function"?WeakSet:Set,Eo=null;function uKe(e,t){if(e=e.containerInfo,i8=FR,e=Xke(e),XU(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var m;f!==n||r!==0&&f.nodeType!==3||(l=o+r),f!==s||i!==0&&f.nodeType!==3||(c=o+i),f.nodeType===3&&(o+=f.nodeValue.length),(m=f.firstChild)!==null;)h=f,f=m;for(;;){if(f===e)break t;if(h===n&&++u===r&&(l=o),h===s&&++d===i&&(c=o),(m=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=m}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(r8={focusedElem:e,selectionRange:n},FR=!1,Eo=t;Eo!==null;)if(t=Eo,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Eo=e;else for(;Eo!==null;){switch(t=Eo,s=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n title"))),sl(s,i,n),s[tl]=e,Ao(s),i=s;break e;case"link":var o=bY("link","href",r).get(i+(n.href||""));if(o){for(var l=0;lv&&(o=v,v=b,b=o);var y=OX(l,b),w=OX(l,v);if(y&&w&&(m.rangeCount!==1||m.anchorNode!==y.node||m.anchorOffset!==y.offset||m.focusNode!==w.node||m.focusOffset!==w.offset)){var x=f.createRange();x.setStart(y.node,y.offset),m.removeAllRanges(),b>v?(m.addRange(x),m.extend(w.node,w.offset)):(x.setEnd(w.node,w.offset),m.addRange(x))}}}}for(f=[],m=l;m=m.parentNode;)m.nodeType===1&&f.push({element:m,left:m.scrollLeft,top:m.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;ln?32:n,si.T=null,n=JF,JF=null;var s=jg,o=Np;if(co=0,Uw=jg=null,Np=0,Ar&6)throw Error(kt(331));var l=Ar;if(Ar|=4,xEe(s.current),bEe(s,s.current,o,n),Ar=l,jA(0,!1),Cu&&typeof Cu.onPostCommitFiberRoot=="function")try{Cu.onPostCommitFiberRoot(OA,s)}catch{}return!0}finally{Tr.p=r,si.T=i,DEe(e,t)}}function tY(e,t,n){t=ad(n,t),t=WF(e.stateNode,t,2),e=Tg(e,t,2),e!==null&&(SA(e,2),_h(e))}function Qr(e,t,n){if(e.tag===3)tY(e,e,n);else for(;t!==null;){if(t.tag===3){tY(t,e,n);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(_g===null||!_g.has(i))){e=ad(n,e),n=YSe(2),i=Tg(t,n,2),i!==null&&(ZSe(n,i,t,e),SA(i,2),_h(i));break}}t=t.return}}function n3(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new hKe;var r=new Set;i.set(t,r)}else r=i.get(t),r===void 0&&(r=new Set,i.set(t,r));r.has(n)||(SQ=!0,r.add(n),e=yKe.bind(null,e,t,n),t.then(e,e))}function yKe(e,t,n){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ls===e&&(nr&n)===n&&(da===4||da===3&&(nr&62914560)===nr&&300>Eu()-fD?!(Ar&2)&&Qw(e,0):EQ|=n,Bw===nr&&(Bw=0)),_h(e)}function LEe(e,t){t===0&&(t=Tke()),e=$0(e,t),e!==null&&(SA(e,t),_h(e))}function vKe(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),LEe(e,n)}function xKe(e,t){var n=0;switch(e.tag){case 31:case 13:var i=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(kt(314))}i!==null&&i.delete(t),LEe(e,n)}function wKe(e,t){return UU(e,t)}var RR=null,ix=null,t8=!1,IR=!1,i3=!1,mg=0;function _h(e){e!==ix&&e.next===null&&(ix===null?RR=ix=e:ix=ix.next=e),IR=!0,t8||(t8=!0,kKe())}function jA(e,t){if(!i3&&IR){i3=!0;do for(var n=!1,i=RR;i!==null;){if(e!==0){var r=i.pendingLanes;if(r===0)var s=0;else{var o=i.suspendedLanes,l=i.pingedLanes;s=(1<<31-Au(42|e)+1)-1,s&=r&~(o&~l),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,nY(i,s))}else s=nr,s=tD(i,i===ls?s:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),!(s&3)||kA(i,s)||(n=!0,nY(i,s));i=i.next}while(n);i3=!1}}function OKe(){$Ee()}function $Ee(){IR=t8=!1;var e=0;mg!==0&&IKe()&&(e=mg);for(var t=Eu(),n=null,i=RR;i!==null;){var r=i.next,s=FEe(i,t);s===0?(i.next=null,n===null?RR=r:n.next=r,r===null&&(ix=n)):(n=i,(e!==0||s&3)&&(IR=!0)),i=r}co!==0&&co!==5||jA(e),mg!==0&&(mg=0)}function FEe(e,t){for(var n=e.suspendedLanes,i=e.pingedLanes,r=e.expirationTimes,s=e.pendingLanes&-62914561;0l)break;var d=c.transferSize,f=c.initiatorType;d&&oY(f)&&(c=c.responseEnd,o+=d*(c"u"?null:document;function KEe(e,t,n){var i=M1;if(i&&typeof t=="string"&&t){var r=sd(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),pY.has(r)||(pY.add(r),e={rel:e,crossOrigin:n,href:t},i.querySelector(r)===null&&(t=i.createElement("link"),sl(t,"link",e),Ao(t),i.head.appendChild(t)))}}function QKe(e){um.D(e),KEe("dns-prefetch",e,null)}function zKe(e,t){um.C(e,t),KEe("preconnect",e,t)}function VKe(e,t,n){um.L(e,t,n);var i=M1;if(i&&e&&t){var r='link[rel="preload"][as="'+sd(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+sd(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+sd(n.imageSizes)+'"]')):r+='[href="'+sd(e)+'"]';var s=r;switch(t){case"style":s=zw(e);break;case"script":s=L1(e)}Cd.has(s)||(e=Ps({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Cd.set(s,e),i.querySelector(r)!==null||t==="style"&&i.querySelector(NA(s))||t==="script"&&i.querySelector(RA(s))||(t=i.createElement("link"),sl(t,"link",e),Ao(t),i.head.appendChild(t)))}}function HKe(e,t){um.m(e,t);var n=M1;if(n&&e){var i=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+sd(i)+'"][href="'+sd(e)+'"]',s=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=L1(e)}if(!Cd.has(s)&&(e=Ps({rel:"modulepreload",href:e},t),Cd.set(s,e),n.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(RA(s)))return}i=n.createElement("link"),sl(i,"link",e),Ao(i),n.head.appendChild(i)}}}function qKe(e,t,n){um.S(e,t,n);var i=M1;if(i&&e){var r=Gx(i).hoistableStyles,s=zw(e);t=t||"default";var o=r.get(s);if(!o){var l={loading:0,preload:null};if(o=i.querySelector(NA(s)))l.loading=5;else{e=Ps({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Cd.get(s))&&_Q(e,n);var c=o=i.createElement("link");Ao(c),sl(c,"link",e),c._p=new Promise(function(u,d){c.onload=u,c.onerror=d}),c.addEventListener("load",function(){l.loading|=1}),c.addEventListener("error",function(){l.loading|=2}),l.loading|=4,eN(o,t,i)}o={type:"stylesheet",instance:o,count:1,state:l},r.set(s,o)}}}function WKe(e,t){um.X(e,t);var n=M1;if(n&&e){var i=Gx(n).hoistableScripts,r=L1(e),s=i.get(r);s||(s=n.querySelector(RA(r)),s||(e=Ps({src:e,async:!0},t),(t=Cd.get(r))&&jQ(e,t),s=n.createElement("script"),Ao(s),sl(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function KKe(e,t){um.M(e,t);var n=M1;if(n&&e){var i=Gx(n).hoistableScripts,r=L1(e),s=i.get(r);s||(s=n.querySelector(RA(r)),s||(e=Ps({src:e,async:!0,type:"module"},t),(t=Cd.get(r))&&jQ(e,t),s=n.createElement("script"),Ao(s),sl(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function mY(e,t,n,i){var r=(r=Eg.current)?MR(r):null;if(!r)throw Error(kt(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=zw(n.href),n=Gx(r).hoistableStyles,i=n.get(t),i||(i={type:"style",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=zw(n.href);var s=Gx(r).hoistableStyles,o=s.get(e);if(o||(r=r.ownerDocument||r,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(e,o),(s=r.querySelector(NA(e)))&&!s._p&&(o.instance=s,o.state.loading=5),Cd.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Cd.set(e,n),s||GKe(r,e,n,o.state))),t&&i===null)throw Error(kt(528,""));return o}if(t&&i!==null)throw Error(kt(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=L1(n),n=Gx(r).hoistableScripts,i=n.get(t),i||(i={type:"script",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(kt(444,e))}}function zw(e){return'href="'+sd(e)+'"'}function NA(e){return'link[rel="stylesheet"]['+e+"]"}function GEe(e){return Ps({},e,{"data-precedence":e.precedence,precedence:null})}function GKe(e,t,n,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),sl(t,"link",n),Ao(t),e.head.appendChild(t))}function L1(e){return'[src="'+sd(e)+'"]'}function RA(e){return"script[async]"+e}function gY(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+sd(n.href)+'"]');if(i)return t.instance=i,Ao(i),i;var r=Ps({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),Ao(i),sl(i,"style",r),eN(i,n.precedence,e),t.instance=i;case"stylesheet":r=zw(n.href);var s=e.querySelector(NA(r));if(s)return t.state.loading|=4,t.instance=s,Ao(s),s;i=GEe(n),(r=Cd.get(r))&&_Q(i,r),s=(e.ownerDocument||e).createElement("link"),Ao(s);var o=s;return o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),sl(s,"link",i),t.state.loading|=4,eN(s,n.precedence,e),t.instance=s;case"script":return s=L1(n.src),(r=e.querySelector(RA(s)))?(t.instance=r,Ao(r),r):(i=n,(r=Cd.get(s))&&(i=Ps({},n),jQ(i,r)),e=e.ownerDocument||e,r=e.createElement("script"),Ao(r),sl(r,"link",i),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(kt(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(i=t.instance,t.state.loading|=4,eN(i,n.precedence,e));return t.instance}function eN(e,t,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,s=r,o=0;o title"):null)}function XKe(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function XEe(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function YKe(e,t,n,i){if(n.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&!(n.state.loading&4)){if(n.instance===null){var r=zw(i.href),s=t.querySelector(NA(r));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=LR.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=s,Ao(s);return}s=t.ownerDocument||t,i=GEe(i),(r=Cd.get(r))&&_Q(i,r),s=s.createElement("link"),Ao(s);var o=s;o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),sl(s,"link",i),n.instance=s}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=LR.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var c3=0;function ZKe(e,t){return e.stylesheets&&e.count===0&&nN(e,e.stylesheets),0c3?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(r)}}:null}function LR(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)nN(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var $R=null;function nN(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,$R=new Map,t.forEach(JKe,e),$R=null,LR.call(e))}function JKe(e,t){if(!(t.state.loading&4)){var n=$R.get(e);if(n)var i=n.get(null);else{n=new Map,$R.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(rCe)}catch(e){console.error(e)}}rCe(),fke.exports=JP;var oGe=fke.exports;const lGe=_1(oGe),DQ=p.createContext({});function bD(e){const t=p.useRef(null);return t.current===null&&(t.current=e()),t.current}const yD=p.createContext(null),ZE=p.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class cGe extends p.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function uGe({children:e,isPresent:t}){const n=p.useId(),i=p.useRef(null),r=p.useRef({width:0,height:0,top:0,left:0}),{nonce:s}=p.useContext(ZE);return p.useInsertionEffect(()=>{const{width:o,height:l,top:c,left:u}=r.current;if(t||!i.current||!o||!l)return;i.current.dataset.motionPopId=n;const d=document.createElement("style");return s&&(d.nonce=s),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(` [data-motion-pop-id="${n}"] { position: absolute !important; width: ${o}px !important; @@ -109,27 +109,27 @@ Error generating stack: `+i.message+` top: ${c}px !important; left: ${u}px !important; } - `),()=>{document.head.removeChild(d)}},[t]),a.jsx(oGe,{isPresent:t,childRef:i,sizeRef:r,children:p.cloneElement(e,{ref:i})})}const cGe=({children:e,initial:t,isPresent:n,onExitComplete:i,custom:r,presenceAffectsLayout:s,mode:o})=>{const l=bD(uGe),c=p.useId(),u=p.useCallback(f=>{l.set(f,!0);for(const h of l.values())if(!h)return;i&&i()},[l,i]),d=p.useMemo(()=>({id:c,initial:t,isPresent:n,custom:r,onExitComplete:u,register:f=>(l.set(f,!1),()=>l.delete(f))}),s?[Math.random(),u]:[n,u]);return p.useMemo(()=>{l.forEach((f,h)=>l.set(h,!1))},[n]),p.useEffect(()=>{!n&&!l.size&&i&&i()},[n]),o==="popLayout"&&(e=a.jsx(lGe,{isPresent:n,children:e})),a.jsx(yD.Provider,{value:d,children:e})};function uGe(){return new Map}function rCe(e=!0){const t=p.useContext(yD);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:r}=t,s=p.useId();p.useEffect(()=>{e&&r(s)},[e]);const o=p.useCallback(()=>e&&i&&i(s),[s,i,e]);return!n&&i?[!1,o]:[!0]}const H2=e=>e.key||"";function SY(e){const t=[];return p.Children.forEach(e,n=>{p.isValidElement(n)&&t.push(n)}),t}const DQ=typeof window<"u",sCe=DQ?p.useLayoutEffect:p.useEffect,ff=({children:e,custom:t,initial:n=!0,onExitComplete:i,presenceAffectsLayout:r=!0,mode:s="sync",propagate:o=!1})=>{const[l,c]=rCe(o),u=p.useMemo(()=>SY(e),[e]),d=o&&!l?[]:u.map(H2),f=p.useRef(!0),h=p.useRef(u),m=bD(()=>new Map),[g,b]=p.useState(u),[v,y]=p.useState(u);sCe(()=>{f.current=!1,h.current=u;for(let O=0;O{const k=H2(O),S=o&&!l?!1:u===v||d.includes(k),C=()=>{if(m.has(k))m.set(k,!0);else return;let E=!0;m.forEach(j=>{j||(E=!1)}),E&&(x==null||x(),y(h.current),o&&(c==null||c()),i&&i())};return a.jsx(cGe,{isPresent:S,initial:!f.current||n?void 0:!1,custom:S?void 0:t,presenceAffectsLayout:r,mode:s,onExitComplete:S?void 0:C,children:O},k)})})},Tu=e=>e;let aCe=Tu;const dGe={useManualTiming:!1};function fGe(e){let t=new Set,n=new Set,i=!1,r=!1;const s=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function l(u){s.has(u)&&(c.schedule(u),e()),u(o)}const c={schedule:(u,d=!1,f=!1)=>{const m=f&&i?t:n;return d&&s.add(u),m.has(u)||m.add(u),u},cancel:u=>{n.delete(u),s.delete(u)},process:u=>{if(o=u,i){r=!0;return}i=!0,[t,n]=[n,t],t.forEach(l),t.clear(),i=!1,r&&(r=!1,c.process(u))}};return c}const q2=["read","resolveKeyframes","update","preRender","render","postRender"],hGe=40;function oCe(e,t){let n=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=q2.reduce((y,w)=>(y[w]=fGe(s),y),{}),{read:l,resolveKeyframes:c,update:u,preRender:d,render:f,postRender:h}=o,m=()=>{const y=performance.now();n=!1,r.delta=i?1e3/60:Math.max(Math.min(y-r.timestamp,hGe),1),r.timestamp=y,r.isProcessing=!0,l.process(r),c.process(r),u.process(r),d.process(r),f.process(r),h.process(r),r.isProcessing=!1,n&&t&&(i=!1,e(m))},g=()=>{n=!0,i=!0,r.isProcessing||e(m)};return{schedule:q2.reduce((y,w)=>{const x=o[w];return y[w]=(O,k=!1,S=!1)=>(n||g(),x.schedule(O,k,S)),y},{}),cancel:y=>{for(let w=0;wEY[e].some(n=>!!t[n])};function pGe(e){for(const t in e)Vw[t]={...Vw[t],...e[t]}}const mGe=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function BR(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||mGe.has(e)}let cCe=e=>!BR(e);function uCe(e){e&&(cCe=t=>t.startsWith("on")?!BR(t):e(t))}try{uCe(require("@emotion/is-prop-valid").default)}catch{}function gGe(e,t,n){const i={};for(const r in e)r==="values"&&typeof e.values=="object"||(cCe(r)||n===!0&&BR(r)||!t&&!BR(r)||e.draggable&&r.startsWith("onDrag"))&&(i[r]=e[r]);return i}function bGe({children:e,isValidProp:t,...n}){t&&uCe(t),n={...p.useContext(YE),...n},n.isStatic=bD(()=>n.isStatic);const i=p.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return a.jsx(YE.Provider,{value:i,children:e})}function yGe(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...i)=>e(...i);return new Proxy(n,{get:(i,r)=>r==="create"?e:(t.has(r)||t.set(r,e(r)),t.get(r))})}const vD=p.createContext({});function ZE(e){return typeof e=="string"||Array.isArray(e)}function xD(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const MQ=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],LQ=["initial",...MQ];function wD(e){return xD(e.animate)||LQ.some(t=>ZE(e[t]))}function dCe(e){return!!(wD(e)||e.variants)}function vGe(e,t){if(wD(e)){const{initial:n,animate:i}=e;return{initial:n===!1||ZE(n)?n:void 0,animate:ZE(i)?i:void 0}}return e.inherit!==!1?t:{}}function xGe(e){const{initial:t,animate:n}=vGe(e,p.useContext(vD));return p.useMemo(()=>({initial:t,animate:n}),[CY(t),CY(n)])}function CY(e){return Array.isArray(e)?e.join(" "):e}const wGe=Symbol.for("motionComponentSymbol");function jx(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function OGe(e,t,n){return p.useCallback(i=>{i&&e.onMount&&e.onMount(i),t&&(i?t.mount(i):t.unmount()),n&&(typeof n=="function"?n(i):jx(n)&&(n.current=i))},[t])}const $Q=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),kGe="framerAppearId",fCe="data-"+$Q(kGe),{schedule:FQ}=oCe(queueMicrotask,!1),hCe=p.createContext({});function SGe(e,t,n,i,r){var s,o;const{visualElement:l}=p.useContext(vD),c=p.useContext(lCe),u=p.useContext(yD),d=p.useContext(YE).reducedMotion,f=p.useRef(null);i=i||c.renderer,!f.current&&i&&(f.current=i(e,{visualState:t,parent:l,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d}));const h=f.current,m=p.useContext(hCe);h&&!h.projection&&r&&(h.type==="html"||h.type==="svg")&&EGe(f.current,n,r,m);const g=p.useRef(!1);p.useInsertionEffect(()=>{h&&g.current&&h.update(n,u)});const b=n[fCe],v=p.useRef(!!b&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,b))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,b)));return sCe(()=>{h&&(g.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),FQ.render(h.render),v.current&&h.animationState&&h.animationState.animateChanges())}),p.useEffect(()=>{h&&(!v.current&&h.animationState&&h.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)===null||y===void 0||y.call(window,b)}),v.current=!1))}),h}function EGe(e,t,n,i){const{layoutId:r,layout:s,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:pCe(e.parent)),e.projection.setOptions({layoutId:r,layout:s,alwaysMeasureLayout:!!o||l&&jx(l),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:i,layoutScroll:c,layoutRoot:u})}function pCe(e){if(e)return e.options.allowProjection!==!1?e.projection:pCe(e.parent)}function CGe({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:i,Component:r}){var s,o;e&&pGe(e);function l(u,d){let f;const h={...p.useContext(YE),...u,layoutId:AGe(u)},{isStatic:m}=h,g=xGe(u),b=i(u,m);if(!m&&DQ){TGe();const v=_Ge(h);f=v.MeasureLayout,g.visualElement=SGe(r,b,h,t,v.ProjectionNode)}return a.jsxs(vD.Provider,{value:g,children:[f&&g.visualElement?a.jsx(f,{visualElement:g.visualElement,...h}):null,n(r,u,OGe(b,g.visualElement,d),b,m,g.visualElement)]})}l.displayName=`motion.${typeof r=="string"?r:`create(${(o=(s=r.displayName)!==null&&s!==void 0?s:r.name)!==null&&o!==void 0?o:""})`}`;const c=p.forwardRef(l);return c[wGe]=r,c}function AGe({layoutId:e}){const t=p.useContext(PQ).id;return t&&e!==void 0?t+"-"+e:e}function TGe(e,t){p.useContext(lCe).strict}function _Ge(e){const{drag:t,layout:n}=Vw;if(!t&&!n)return{};const i={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}const jGe=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function BQ(e){return typeof e!="string"||e.includes("-")?!1:!!(jGe.indexOf(e)>-1||/[A-Z]/u.test(e))}function AY(e){const t=[{},{}];return e==null||e.values.forEach((n,i)=>{t[0][i]=n.get(),t[1][i]=n.getVelocity()}),t}function UQ(e,t,n,i){if(typeof t=="function"){const[r,s]=AY(i);t=t(n!==void 0?n:e.custom,r,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[r,s]=AY(i);t=t(n!==void 0?n:e.custom,r,s)}return t}const d8=e=>Array.isArray(e),NGe=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),RGe=e=>d8(e)?e[e.length-1]||0:e,Al=e=>!!(e&&e.getVelocity);function iN(e){const t=Al(e)?e.get():e;return NGe(t)?t.toValue():t}function IGe({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},i,r,s){const o={latestValues:PGe(i,r,s,e),renderState:t()};return n&&(o.onMount=l=>n({props:i,current:l,...o}),o.onUpdate=l=>n(l)),o}const mCe=e=>(t,n)=>{const i=p.useContext(vD),r=p.useContext(yD),s=()=>IGe(e,t,i,r);return n?s():bD(s)};function PGe(e,t,n,i){const r={},s=i(e,{});for(const h in s)r[h]=iN(s[h]);let{initial:o,animate:l}=e;const c=wD(e),u=dCe(e);t&&u&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const f=d?l:o;if(f&&typeof f!="boolean"&&!xD(f)){const h=Array.isArray(f)?f:[f];for(let m=0;mt=>typeof t=="string"&&t.startsWith(e),bCe=gCe("--"),DGe=gCe("var(--"),QQ=e=>DGe(e)?MGe.test(e.split("/*")[0].trim()):!1,MGe=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,yCe=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Wp=(e,t,n)=>n>t?t:ntypeof e=="number",parse:parseFloat,transform:e=>e},JE={...$1,transform:e=>Wp(0,1,e)},W2={...$1,default:1},RA=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Qm=RA("deg"),ph=RA("%"),Gn=RA("px"),LGe=RA("vh"),$Ge=RA("vw"),TY={...ph,parse:e=>ph.parse(e)/100,transform:e=>ph.transform(e*100)},FGe={borderWidth:Gn,borderTopWidth:Gn,borderRightWidth:Gn,borderBottomWidth:Gn,borderLeftWidth:Gn,borderRadius:Gn,radius:Gn,borderTopLeftRadius:Gn,borderTopRightRadius:Gn,borderBottomRightRadius:Gn,borderBottomLeftRadius:Gn,width:Gn,maxWidth:Gn,height:Gn,maxHeight:Gn,top:Gn,right:Gn,bottom:Gn,left:Gn,padding:Gn,paddingTop:Gn,paddingRight:Gn,paddingBottom:Gn,paddingLeft:Gn,margin:Gn,marginTop:Gn,marginRight:Gn,marginBottom:Gn,marginLeft:Gn,backgroundPositionX:Gn,backgroundPositionY:Gn},BGe={rotate:Qm,rotateX:Qm,rotateY:Qm,rotateZ:Qm,scale:W2,scaleX:W2,scaleY:W2,scaleZ:W2,skew:Qm,skewX:Qm,skewY:Qm,distance:Gn,translateX:Gn,translateY:Gn,translateZ:Gn,x:Gn,y:Gn,z:Gn,perspective:Gn,transformPerspective:Gn,opacity:JE,originX:TY,originY:TY,originZ:Gn},_Y={...$1,transform:Math.round},zQ={...FGe,...BGe,zIndex:_Y,size:Gn,fillOpacity:JE,strokeOpacity:JE,numOctaves:_Y},UGe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},QGe=L1.length;function zGe(e,t,n){let i="",r=!0;for(let s=0;s({style:{},transform:{},transformOrigin:{},vars:{}}),vCe=()=>({...qQ(),attrs:{}}),WQ=e=>typeof e=="string"&&e.toLowerCase()==="svg";function xCe(e,{style:t,vars:n},i,r){Object.assign(e.style,t,r&&r.getProjectionStyles(i));for(const s in n)e.style.setProperty(s,n[s])}const wCe=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function OCe(e,t,n,i){xCe(e,t,void 0,i);for(const r in t.attrs)e.setAttribute(wCe.has(r)?r:$Q(r),t.attrs[r])}const UR={};function KGe(e){Object.assign(UR,e)}function kCe(e,{layout:t,layoutId:n}){return F0.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!UR[e]||e==="opacity")}function KQ(e,t,n){var i;const{style:r}=e,s={};for(const o in r)(Al(r[o])||t.style&&Al(t.style[o])||kCe(o,e)||((i=n==null?void 0:n.getValue(o))===null||i===void 0?void 0:i.liveStyle)!==void 0)&&(s[o]=r[o]);return s}function SCe(e,t,n){const i=KQ(e,t,n);for(const r in e)if(Al(e[r])||Al(t[r])){const s=L1.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;i[s]=e[r]}return i}function GGe(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const NY=["x","y","width","height","cx","cy","r"],XGe={useVisualState:mCe({scrapeMotionValuesFromProps:SCe,createRenderState:vCe,onUpdate:({props:e,prevProps:t,current:n,renderState:i,latestValues:r})=>{if(!n)return;let s=!!e.drag;if(!s){for(const l in r)if(F0.has(l)){s=!0;break}}if(!s)return;let o=!t;if(t)for(let l=0;l{GGe(n,i),Is.render(()=>{HQ(i,r,WQ(n.tagName),e.transformTemplate),OCe(n,i)})})}})},YGe={useVisualState:mCe({scrapeMotionValuesFromProps:KQ,createRenderState:qQ})};function ECe(e,t,n){for(const i in t)!Al(t[i])&&!kCe(i,n)&&(e[i]=t[i])}function ZGe({transformTemplate:e},t){return p.useMemo(()=>{const n=qQ();return VQ(n,t,e),Object.assign({},n.vars,n.style)},[t])}function JGe(e,t){const n=e.style||{},i={};return ECe(i,n,e),Object.assign(i,ZGe(e,t)),i}function eXe(e,t){const n={},i=JGe(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=i,n}function tXe(e,t,n,i){const r=p.useMemo(()=>{const s=vCe();return HQ(s,t,WQ(i),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};ECe(s,e.style,e),r.style={...s,...r.style}}return r}function nXe(e=!1){return(n,i,r,{latestValues:s},o)=>{const c=(BQ(n)?tXe:eXe)(i,s,o,n),u=gGe(i,typeof n=="string",e),d=n!==p.Fragment?{...u,...c,ref:r}:{},{children:f}=i,h=p.useMemo(()=>Al(f)?f.get():f,[f]);return p.createElement(n,{...d,children:h})}}function iXe(e,t){return function(i,{forwardMotionProps:r}={forwardMotionProps:!1}){const o={...BQ(i)?XGe:YGe,preloadedFeatures:e,useRender:nXe(r),createVisualElement:t,Component:i};return CGe(o)}}function CCe(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;i(rN===void 0&&mh.set(Go.isProcessing||dGe.useManualTiming?Go.timestamp:performance.now()),rN),set:e=>{rN=e,queueMicrotask(rXe)}};function XQ(e,t){e.indexOf(t)===-1&&e.push(t)}function YQ(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class ZQ{constructor(){this.subscriptions=[]}add(t){return XQ(this.subscriptions,t),()=>YQ(this.subscriptions,t)}notify(t,n,i){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](t,n,i);else for(let s=0;s!isNaN(parseFloat(e));class aXe{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(i,r=!0)=>{const s=mh.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),r&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=mh.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=sXe(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new ZQ);const i=this.events[t].add(n);return t==="change"?()=>{i(),Is.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,i){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-i}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=mh.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>RY)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,RY);return TCe(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function eC(e,t){return new aXe(e,t)}function oXe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,eC(n))}function lXe(e,t){const n=OD(e,t);let{transitionEnd:i={},transition:r={},...s}=n||{};s={...s,...i};for(const o in s){const l=RGe(s[o]);oXe(e,o,l)}}function cXe(e){return!!(Al(e)&&e.add)}function f8(e,t){const n=e.getValue("willChange");if(cXe(n))return n.add(t)}function _Ce(e){return e.props[fCe]}function JQ(e){let t;return()=>(t===void 0&&(t=e()),t)}const uXe=JQ(()=>window.ScrollTimeline!==void 0);class dXe{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let i=0;i{if(uXe()&&r.attachTimeline)return r.attachTimeline(t);if(typeof n=="function")return n(r)});return()=>{i.forEach((r,s)=>{r&&r(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;nn[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class fXe extends dXe{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}const Np=e=>e*1e3,Rp=e=>e/1e3;function ez(e){return typeof e=="function"}function IY(e,t){e.timeline=t,e.onfinish=null}const tz=e=>Array.isArray(e)&&typeof e[0]=="number",hXe={linearEasing:void 0};function pXe(e,t){const n=JQ(e);return()=>{var i;return(i=hXe[t])!==null&&i!==void 0?i:n()}}const QR=pXe(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Hw=(e,t,n)=>{const i=t-e;return i===0?1:(n-e)/i},jCe=(e,t,n=10)=>{let i="";const r=Math.max(Math.round(t/n),2);for(let s=0;s`cubic-bezier(${e}, ${t}, ${n}, ${i})`,h8={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:sS([0,.65,.55,1]),circOut:sS([.55,0,1,.45]),backIn:sS([.31,.01,.66,-.59]),backOut:sS([.33,1.53,.69,.99])};function RCe(e,t){if(e)return typeof e=="function"&&QR()?jCe(e,t):tz(e)?sS(e):Array.isArray(e)?e.map(n=>RCe(n,t)||h8.easeOut):h8[e]}const ICe=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,mXe=1e-7,gXe=12;function bXe(e,t,n,i,r){let s,o,l=0;do o=t+(n-t)/2,s=ICe(o,i,r)-e,s>0?n=o:t=o;while(Math.abs(s)>mXe&&++lbXe(s,0,1,e,n);return s=>s===0||s===1?s:ICe(r(s),t,i)}const PCe=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,DCe=e=>t=>1-e(1-t),MCe=IA(.33,1.53,.69,.99),nz=DCe(MCe),LCe=PCe(nz),$Ce=e=>(e*=2)<1?.5*nz(e):.5*(2-Math.pow(2,-10*(e-1))),iz=e=>1-Math.sin(Math.acos(e)),FCe=DCe(iz),BCe=PCe(iz),UCe=e=>/^0[^.\s]+$/u.test(e);function yXe(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||UCe(e):!0}const WS=e=>Math.round(e*1e5)/1e5,rz=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function vXe(e){return e==null}const xXe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,sz=(e,t)=>n=>!!(typeof n=="string"&&xXe.test(n)&&n.startsWith(e)||t&&!vXe(n)&&Object.prototype.hasOwnProperty.call(n,t)),QCe=(e,t,n)=>i=>{if(typeof i!="string")return i;const[r,s,o,l]=i.match(rz);return{[e]:parseFloat(r),[t]:parseFloat(s),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},wXe=e=>Wp(0,255,e),u3={...$1,transform:e=>Math.round(wXe(e))},Ay={test:sz("rgb","red"),parse:QCe("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+u3.transform(e)+", "+u3.transform(t)+", "+u3.transform(n)+", "+WS(JE.transform(i))+")"};function OXe(e){let t="",n="",i="",r="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),i=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),i=e.substring(3,4),r=e.substring(4,5),t+=t,n+=n,i+=i,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}}const p8={test:sz("#"),parse:OXe,transform:Ay.transform},Nx={test:sz("hsl","hue"),parse:QCe("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+ph.transform(WS(t))+", "+ph.transform(WS(n))+", "+WS(JE.transform(i))+")"},Sl={test:e=>Ay.test(e)||p8.test(e)||Nx.test(e),parse:e=>Ay.test(e)?Ay.parse(e):Nx.test(e)?Nx.parse(e):p8.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ay.transform(e):Nx.transform(e)},kXe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function SXe(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(rz))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(kXe))===null||n===void 0?void 0:n.length)||0)>0}const zCe="number",VCe="color",EXe="var",CXe="var(",PY="${}",AXe=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function tC(e){const t=e.toString(),n=[],i={color:[],number:[],var:[]},r=[];let s=0;const l=t.replace(AXe,c=>(Sl.test(c)?(i.color.push(s),r.push(VCe),n.push(Sl.parse(c))):c.startsWith(CXe)?(i.var.push(s),r.push(EXe),n.push(c)):(i.number.push(s),r.push(zCe),n.push(parseFloat(c))),++s,PY)).split(PY);return{values:n,split:l,indexes:i,types:r}}function HCe(e){return tC(e).values}function qCe(e){const{split:t,types:n}=tC(e),i=t.length;return r=>{let s="";for(let o=0;otypeof e=="number"?0:e;function _Xe(e){const t=HCe(e);return qCe(e)(t.map(TXe))}const Kg={test:SXe,parse:HCe,createTransformer:qCe,getAnimatableNone:_Xe},jXe=new Set(["brightness","contrast","saturate","opacity"]);function NXe(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=n.match(rz)||[];if(!i)return e;const r=n.replace(i,"");let s=jXe.has(t)?1:0;return i!==n&&(s*=100),t+"("+s+r+")"}const RXe=/\b([a-z-]*)\(.*?\)/gu,m8={...Kg,getAnimatableNone:e=>{const t=e.match(RXe);return t?t.map(NXe).join(" "):e}},IXe={...zQ,color:Sl,backgroundColor:Sl,outlineColor:Sl,fill:Sl,stroke:Sl,borderColor:Sl,borderTopColor:Sl,borderRightColor:Sl,borderBottomColor:Sl,borderLeftColor:Sl,filter:m8,WebkitFilter:m8},az=e=>IXe[e];function WCe(e,t){let n=az(e);return n!==m8&&(n=Kg),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const PXe=new Set(["auto","none","0"]);function DXe(e,t,n){let i=0,r;for(;ie===$1||e===Gn,MY=(e,t)=>parseFloat(e.split(", ")[t]),LY=(e,t)=>(n,{transform:i})=>{if(i==="none"||!i)return 0;const r=i.match(/^matrix3d\((.+)\)$/u);if(r)return MY(r[1],t);{const s=i.match(/^matrix\((.+)\)$/u);return s?MY(s[1],e):0}},MXe=new Set(["x","y","z"]),LXe=L1.filter(e=>!MXe.has(e));function $Xe(e){const t=[];return LXe.forEach(n=>{const i=e.getValue(n);i!==void 0&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t}const qw={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:LY(4,13),y:LY(5,14)};qw.translateX=qw.x;qw.translateY=qw.y;const Wy=new Set;let g8=!1,b8=!1;function KCe(){if(b8){const e=Array.from(Wy).filter(i=>i.needsMeasurement),t=new Set(e.map(i=>i.element)),n=new Map;t.forEach(i=>{const r=$Xe(i);r.length&&(n.set(i,r),i.render())}),e.forEach(i=>i.measureInitialState()),t.forEach(i=>{i.render();const r=n.get(i);r&&r.forEach(([s,o])=>{var l;(l=i.getValue(s))===null||l===void 0||l.set(o)})}),e.forEach(i=>i.measureEndState()),e.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}b8=!1,g8=!1,Wy.forEach(e=>e.complete()),Wy.clear()}function GCe(){Wy.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(b8=!0)})}function FXe(){GCe(),KCe()}class oz{constructor(t,n,i,r,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=i,this.motionValue=r,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Wy.add(this),g8||(g8=!0,Is.read(GCe),Is.resolveKeyframes(KCe))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:i,motionValue:r}=this;for(let s=0;s/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),BXe=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function UXe(e){const t=BXe.exec(e);if(!t)return[,];const[,n,i,r]=t;return[`--${n??i}`,r]}function YCe(e,t,n=1){const[i,r]=UXe(e);if(!i)return;const s=window.getComputedStyle(t).getPropertyValue(i);if(s){const o=s.trim();return XCe(o)?parseFloat(o):o}return QQ(r)?YCe(r,t,n+1):r}const ZCe=e=>t=>t.test(e),QXe={test:e=>e==="auto",parse:e=>e},JCe=[$1,Gn,ph,Qm,$Ge,LGe,QXe],$Y=e=>JCe.find(ZCe(e));class eAe extends oz{constructor(t,n,i,r,s){super(t,n,i,r,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:i}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c{n.getValue(c).set(u)}),this.resolveNoneKeyframes()}}const FY=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Kg.test(e)||e==="0")&&!e.startsWith("url("));function zXe(e){const t=e[0];if(e.length===1)return!0;for(let n=0;ne!==null;function kD(e,{repeat:t,repeatType:n="loop"},i){const r=e.filter(HXe),s=t&&n!=="loop"&&t%2===1?0:r.length-1;return!s||i===void 0?r[s]:i}const qXe=40;class tAe{constructor({autoplay:t=!0,delay:n=0,type:i="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:o="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=mh.now(),this.options={autoplay:t,delay:n,type:i,repeat:r,repeatDelay:s,repeatType:o,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>qXe?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&FXe(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=mh.now(),this.hasAttemptedResolve=!0;const{name:i,type:r,velocity:s,delay:o,onComplete:l,onUpdate:c,isGenerator:u}=this.options;if(!u&&!VXe(t,i,r,s))if(o)this.options.duration=0;else{c&&c(kD(t,this.options,n)),l&&l(),this.resolveFinishedPromise();return}const d=this.initPlayback(t,n);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...d},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const y8=2e4;function nAe(e){let t=0;const n=50;let i=e.next(t);for(;!i.done&&t=y8?1/0:t}const ea=(e,t,n)=>e+(t-e)*n;function d3(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function WXe({hue:e,saturation:t,lightness:n,alpha:i}){e/=360,t/=100,n/=100;let r=0,s=0,o=0;if(!t)r=s=o=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;r=d3(c,l,e+1/3),s=d3(c,l,e),o=d3(c,l,e-1/3)}return{red:Math.round(r*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:i}}function zR(e,t){return n=>n>0?t:e}const f3=(e,t,n)=>{const i=e*e,r=n*(t*t-i)+i;return r<0?0:Math.sqrt(r)},KXe=[p8,Ay,Nx],GXe=e=>KXe.find(t=>t.test(e));function BY(e){const t=GXe(e);if(!t)return!1;let n=t.parse(e);return t===Nx&&(n=WXe(n)),n}const UY=(e,t)=>{const n=BY(e),i=BY(t);if(!n||!i)return zR(e,t);const r={...n};return s=>(r.red=f3(n.red,i.red,s),r.green=f3(n.green,i.green,s),r.blue=f3(n.blue,i.blue,s),r.alpha=ea(n.alpha,i.alpha,s),Ay.transform(r))},XXe=(e,t)=>n=>t(e(n)),PA=(...e)=>e.reduce(XXe),v8=new Set(["none","hidden"]);function YXe(e,t){return v8.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function ZXe(e,t){return n=>ea(e,t,n)}function lz(e){return typeof e=="number"?ZXe:typeof e=="string"?QQ(e)?zR:Sl.test(e)?UY:tYe:Array.isArray(e)?iAe:typeof e=="object"?Sl.test(e)?UY:JXe:zR}function iAe(e,t){const n=[...e],i=n.length,r=e.map((s,o)=>lz(s)(s,t[o]));return s=>{for(let o=0;o{for(const s in i)n[s]=i[s](r);return n}}function eYe(e,t){var n;const i=[],r={color:0,var:0,number:0};for(let s=0;s{const n=Kg.createTransformer(t),i=tC(e),r=tC(t);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?v8.has(e)&&!r.values.length||v8.has(t)&&!i.values.length?YXe(e,t):PA(iAe(eYe(i,r),r.values),n):zR(e,t)};function rAe(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ea(e,t,n):lz(e)(e,t)}const nYe=5;function sAe(e,t,n){const i=Math.max(t-nYe,0);return TCe(n-e(i),t-i)}const ca={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},h3=.001;function iYe({duration:e=ca.duration,bounce:t=ca.bounce,velocity:n=ca.velocity,mass:i=ca.mass}){let r,s,o=1-t;o=Wp(ca.minDamping,ca.maxDamping,o),e=Wp(ca.minDuration,ca.maxDuration,Rp(e)),o<1?(r=u=>{const d=u*o,f=d*e,h=d-n,m=x8(u,o),g=Math.exp(-f);return h3-h/m*g},s=u=>{const f=u*o*e,h=f*n+n,m=Math.pow(o,2)*Math.pow(u,2)*e,g=Math.exp(-f),b=x8(Math.pow(u,2),o);return(-r(u)+h3>0?-1:1)*((h-m)*g)/b}):(r=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-h3+d*f},s=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const l=5/e,c=sYe(r,s,l);if(e=Np(e),isNaN(c))return{stiffness:ca.stiffness,damping:ca.damping,duration:e};{const u=Math.pow(c,2)*i;return{stiffness:u,damping:o*2*Math.sqrt(i*u),duration:e}}}const rYe=12;function sYe(e,t,n){let i=n;for(let r=1;re[n]!==void 0)}function lYe(e){let t={velocity:ca.velocity,stiffness:ca.stiffness,damping:ca.damping,mass:ca.mass,isResolvedFromDuration:!1,...e};if(!QY(e,oYe)&&QY(e,aYe))if(e.visualDuration){const n=e.visualDuration,i=2*Math.PI/(n*1.2),r=i*i,s=2*Wp(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:ca.mass,stiffness:r,damping:s}}else{const n=iYe(e);t={...t,...n,mass:ca.mass},t.isResolvedFromDuration=!0}return t}function aAe(e=ca.visualDuration,t=ca.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:i,restDelta:r}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:s},{stiffness:c,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:m}=lYe({...n,velocity:-Rp(n.velocity||0)}),g=h||0,b=u/(2*Math.sqrt(c*d)),v=o-s,y=Rp(Math.sqrt(c/d)),w=Math.abs(v)<5;i||(i=w?ca.restSpeed.granular:ca.restSpeed.default),r||(r=w?ca.restDelta.granular:ca.restDelta.default);let x;if(b<1){const k=x8(y,b);x=S=>{const C=Math.exp(-b*y*S);return o-C*((g+b*y*v)/k*Math.sin(k*S)+v*Math.cos(k*S))}}else if(b===1)x=k=>o-Math.exp(-y*k)*(v+(g+y*v)*k);else{const k=y*Math.sqrt(b*b-1);x=S=>{const C=Math.exp(-b*y*S),E=Math.min(k*S,300);return o-C*((g+b*y*v)*Math.sinh(E)+k*v*Math.cosh(E))/k}}const O={calculatedDuration:m&&f||null,next:k=>{const S=x(k);if(m)l.done=k>=f;else{let C=0;b<1&&(C=k===0?Np(g):sAe(x,k,S));const E=Math.abs(C)<=i,j=Math.abs(o-S)<=r;l.done=E&&j}return l.value=l.done?o:S,l},toString:()=>{const k=Math.min(nAe(O),y8),S=jCe(C=>O.next(k*C).value,k,30);return k+"ms "+S}};return O}function zY({keyframes:e,velocity:t=0,power:n=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:s=500,modifyTarget:o,min:l,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},m=E=>l!==void 0&&Ec,g=E=>l===void 0?c:c===void 0||Math.abs(l-E)-b*Math.exp(-E/i),x=E=>y+w(E),O=E=>{const j=w(E),T=x(E);h.done=Math.abs(j)<=u,h.value=h.done?y:T};let k,S;const C=E=>{m(h.value)&&(k=E,S=aAe({keyframes:[h.value,g(h.value)],velocity:sAe(x,E,h.value),damping:r,stiffness:s,restDelta:u,restSpeed:d}))};return C(0),{calculatedDuration:null,next:E=>{let j=!1;return!S&&k===void 0&&(j=!0,O(E),C(E)),k!==void 0&&E>=k?S.next(E-k):(!j&&O(E),h)}}}const cYe=IA(.42,0,1,1),uYe=IA(0,0,.58,1),oAe=IA(.42,0,.58,1),dYe=e=>Array.isArray(e)&&typeof e[0]!="number",fYe={linear:Tu,easeIn:cYe,easeInOut:oAe,easeOut:uYe,circIn:iz,circInOut:BCe,circOut:FCe,backIn:nz,backInOut:LCe,backOut:MCe,anticipate:$Ce},VY=e=>{if(tz(e)){aCe(e.length===4);const[t,n,i,r]=e;return IA(t,n,i,r)}else if(typeof e=="string")return fYe[e];return e};function hYe(e,t,n){const i=[],r=n||rAe,s=e.length-1;for(let o=0;ot[0];if(s===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=hYe(t,i,r),c=l.length,u=d=>{if(o&&d1)for(;fu(Wp(e[0],e[s-1],d)):u}function mYe(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const r=Hw(0,t,i);e.push(ea(n,1,r))}}function gYe(e){const t=[0];return mYe(t,e.length-1),t}function bYe(e,t){return e.map(n=>n*t)}function yYe(e,t){return e.map(()=>t||oAe).splice(0,e.length-1)}function VR({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const r=dYe(i)?i.map(VY):VY(i),s={done:!1,value:t[0]},o=bYe(n&&n.length===t.length?n:gYe(t),e),l=pYe(o,t,{ease:Array.isArray(r)?r:yYe(t,r)});return{calculatedDuration:e,next:c=>(s.value=l(c),s.done=c>=e,s)}}const vYe=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Is.update(t,!0),stop:()=>Wg(t),now:()=>Go.isProcessing?Go.timestamp:mh.now()}},xYe={decay:zY,inertia:zY,tween:VR,keyframes:VR,spring:aAe},wYe=e=>e/100;class cz extends tAe{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:c}=this.options;c&&c()};const{name:n,motionValue:i,element:r,keyframes:s}=this.options,o=(r==null?void 0:r.KeyframeResolver)||oz,l=(c,u)=>this.onKeyframesResolved(c,u);this.resolver=new o(s,l,n,i,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:s,velocity:o=0}=this.options,l=ez(n)?n:xYe[n]||VR;let c,u;l!==VR&&typeof t[0]!="number"&&(c=PA(wYe,rAe(t[0],t[1])),t=[0,100]);const d=l({...this.options,keyframes:t});s==="mirror"&&(u=l({...this.options,keyframes:[...t].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=nAe(d));const{calculatedDuration:f}=d,h=f+r,m=h*(i+1)-r;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:c,calculatedDuration:f,resolvedDuration:h,totalDuration:m}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:i}=this;if(!i){const{keyframes:E}=this.options;return{done:!0,value:E[E.length-1]}}const{finalKeyframe:r,generator:s,mirroredGenerator:o,mapPercentToKeyframes:l,keyframes:c,calculatedDuration:u,totalDuration:d,resolvedDuration:f}=i;if(this.startTime===null)return s.next(0);const{delay:h,repeat:m,repeatType:g,repeatDelay:b,onUpdate:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const y=this.currentTime-h*(this.speed>=0?1:-1),w=this.speed>=0?y<0:y>d;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let x=this.currentTime,O=s;if(m){const E=Math.min(this.currentTime,d)/f;let j=Math.floor(E),T=E%1;!T&&E>=1&&(T=1),T===1&&j--,j=Math.min(j,m+1),!!(j%2)&&(g==="reverse"?(T=1-T,b&&(T-=b/f)):g==="mirror"&&(O=o)),x=Wp(0,1,T)*f}const k=w?{done:!1,value:c[0]}:O.next(x);l&&(k.value=l(k.value));let{done:S}=k;!w&&u!==null&&(S=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&S);return C&&r!==void 0&&(k.value=kD(c,this.options,r)),v&&v(k.value),C&&this.finish(),k}get duration(){const{resolved:t}=this;return t?Rp(t.calculatedDuration):0}get time(){return Rp(this.currentTime)}set time(t){t=Np(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Rp(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=vYe,onPlay:n,startTime:i}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),n&&n();const r=this.driver.now();this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=r):this.startTime=i??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const OYe=new Set(["opacity","clipPath","filter","transform"]);function kYe(e,t,n,{delay:i=0,duration:r=300,repeat:s=0,repeatType:o="loop",ease:l="easeInOut",times:c}={}){const u={[t]:n};c&&(u.offset=c);const d=RCe(l,r);return Array.isArray(d)&&(u.easing=d),e.animate(u,{delay:i,duration:r,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}const SYe=JQ(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),HR=10,EYe=2e4;function CYe(e){return ez(e.type)||e.type==="spring"||!NCe(e.ease)}function AYe(e,t){const n=new cz({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let i={done:!1,value:e[0]};const r=[];let s=0;for(;!i.done&&sthis.onKeyframesResolved(o,l),n,i,r),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:i=300,times:r,ease:s,type:o,motionValue:l,name:c,startTime:u}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof s=="string"&&QR()&&TYe(s)&&(s=lAe[s]),CYe(this.options)){const{onComplete:f,onUpdate:h,motionValue:m,element:g,...b}=this.options,v=AYe(t,b);t=v.keyframes,t.length===1&&(t[1]=t[0]),i=v.duration,r=v.times,s=v.ease,o="keyframes"}const d=kYe(l.owner.current,c,t,{...this.options,duration:i,times:r,ease:s});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(IY(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;l.set(kD(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:i,times:r,type:o,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return Rp(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Rp(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:i}=n;i.currentTime=Np(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:i}=n;i.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return Tu;const{animation:i}=n;IY(i,t)}return Tu}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:i,duration:r,type:s,ease:o,times:l}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:d,onComplete:f,element:h,...m}=this.options,g=new cz({...m,keyframes:i,duration:r,type:s,ease:o,times:l,isGenerator:!0}),b=Np(this.time);u.setWithVelocity(g.sample(b-HR).value,g.sample(b).value,HR)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:i,repeatDelay:r,repeatType:s,damping:o,type:l}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=n.owner.getProps();return SYe()&&i&&OYe.has(i)&&!c&&!u&&!r&&s!=="mirror"&&o!==0&&l!=="inertia"}}const _Ye={type:"spring",stiffness:500,damping:25,restSpeed:10},jYe=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),NYe={type:"keyframes",duration:.8},RYe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},IYe=(e,{keyframes:t})=>t.length>2?NYe:F0.has(e)?e.startsWith("scale")?jYe(t[1]):_Ye:RYe;function PYe({when:e,delay:t,delayChildren:n,staggerChildren:i,staggerDirection:r,repeat:s,repeatType:o,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const uz=(e,t,n,i={},r,s)=>o=>{const l=GQ(i,e)||{},c=l.delay||i.delay||0;let{elapsed:u=0}=i;u=u-Np(c);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:h=>{t.set(h),l.onUpdate&&l.onUpdate(h)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:s?void 0:r};PYe(l)||(d={...d,...IYe(e,d)}),d.duration&&(d.duration=Np(d.duration)),d.repeatDelay&&(d.repeatDelay=Np(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(f=!0)),f&&!s&&t.get()!==void 0){const h=kD(d.keyframes,l);if(h!==void 0)return Is.update(()=>{d.onUpdate(h),d.onComplete()}),new fXe([])}return!s&&HY.supports(d)?new HY(d):new cz(d)};function DYe({protectedKeys:e,needsAnimating:t},n){const i=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,i}function cAe(e,t,{delay:n=0,transitionOverride:i,type:r}={}){var s;let{transition:o=e.getDefaultTransition(),transitionEnd:l,...c}=t;i&&(o=i);const u=[],d=r&&e.animationState&&e.animationState.getState()[r];for(const f in c){const h=e.getValue(f,(s=e.latestValues[f])!==null&&s!==void 0?s:null),m=c[f];if(m===void 0||d&&DYe(d,f))continue;const g={delay:n,...GQ(o||{},f)};let b=!1;if(window.MotionHandoffAnimation){const y=_Ce(e);if(y){const w=window.MotionHandoffAnimation(y,f,Is);w!==null&&(g.startTime=w,b=!0)}}f8(e,f),h.start(uz(f,h,m,e.shouldReduceMotion&&ACe.has(f)?{type:!1}:g,e,b));const v=h.animation;v&&u.push(v)}return l&&Promise.all(u).then(()=>{Is.update(()=>{l&&lXe(e,l)})}),u}function w8(e,t,n={}){var i;const r=OD(e,t,n.type==="exit"?(i=e.presenceContext)===null||i===void 0?void 0:i.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const o=r?()=>Promise.all(cAe(e,r,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=s;return MYe(e,t,d+u,f,h,n)}:()=>Promise.resolve(),{when:c}=s;if(c){const[u,d]=c==="beforeChildren"?[o,l]:[l,o];return u().then(()=>d())}else return Promise.all([o(),l(n.delay)])}function MYe(e,t,n=0,i=0,r=1,s){const o=[],l=(e.variantChildren.size-1)*i,c=r===1?(u=0)=>u*i:(u=0)=>l-u*i;return Array.from(e.variantChildren).sort(LYe).forEach((u,d)=>{u.notify("AnimationStart",t),o.push(w8(u,t,{...s,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(o)}function LYe(e,t){return e.sortNodePosition(t)}function $Ye(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const r=t.map(s=>w8(e,s,n));i=Promise.all(r)}else if(typeof t=="string")i=w8(e,t,n);else{const r=typeof t=="function"?OD(e,t,n.custom):t;i=Promise.all(cAe(e,r,n))}return i.then(()=>{e.notify("AnimationComplete",t)})}const FYe=LQ.length;function uAe(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?uAe(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;nPromise.all(t.map(({animation:n,options:i})=>$Ye(e,n,i)))}function zYe(e){let t=QYe(e),n=qY(),i=!0;const r=c=>(u,d)=>{var f;const h=OD(e,d,c==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:m,transitionEnd:g,...b}=h;u={...u,...b,...g}}return u};function s(c){t=c(e)}function o(c){const{props:u}=e,d=uAe(e.parent)||{},f=[],h=new Set;let m={},g=1/0;for(let v=0;vg&&O,j=!1;const T=Array.isArray(x)?x:[x];let R=T.reduce(r(y),{});k===!1&&(R={});const{prevResolvedValues:A={}}=w,N={...A,...R},P=_=>{E=!0,h.has(_)&&(j=!0,h.delete(_)),w.needsAnimating[_]=!0;const L=e.getValue(_);L&&(L.liveStyle=!1)};for(const _ in N){const L=R[_],F=A[_];if(m.hasOwnProperty(_))continue;let M=!1;d8(L)&&d8(F)?M=!CCe(L,F):M=L!==F,M?L!=null?P(_):h.add(_):L!==void 0&&h.has(_)?P(_):w.protectedKeys[_]=!0}w.prevProp=x,w.prevResolvedValues=R,w.isActive&&(m={...m,...R}),i&&e.blockInitialAnimation&&(E=!1),E&&(!(S&&C)||j)&&f.push(...T.map(_=>({animation:_,options:{type:y}})))}if(h.size){const v={};h.forEach(y=>{const w=e.getBaseTarget(y),x=e.getValue(y);x&&(x.liveStyle=!0),v[y]=w??null}),f.push({animation:v})}let b=!!f.length;return i&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(b=!1),i=!1,b?t(f):Promise.resolve()}function l(c,u){var d;if(n[c].isActive===u)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(h=>{var m;return(m=h.animationState)===null||m===void 0?void 0:m.setActive(c,u)}),n[c].isActive=u;const f=o(c);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:o,setActive:l,setAnimateFunction:s,getState:()=>n,reset:()=>{n=qY(),i=!0}}}function VYe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!CCe(t,e):!1}function qb(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function qY(){return{animate:qb(!0),whileInView:qb(),whileHover:qb(),whileTap:qb(),whileDrag:qb(),whileFocus:qb(),exit:qb()}}class kb{constructor(t){this.isMounted=!1,this.node=t}update(){}}class HYe extends kb{constructor(t){super(t),t.animationState||(t.animationState=zYe(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();xD(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let qYe=0;class WYe extends kb{constructor(){super(...arguments),this.id=qYe++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;const r=this.node.animationState.setActive("exit",!t);n&&!t&&r.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const KYe={animation:{Feature:HYe},exit:{Feature:WYe}},Yd={x:!1,y:!1};function dAe(){return Yd.x||Yd.y}function GYe(e){return e==="x"||e==="y"?Yd[e]?null:(Yd[e]=!0,()=>{Yd[e]=!1}):Yd.x||Yd.y?null:(Yd.x=Yd.y=!0,()=>{Yd.x=Yd.y=!1})}const dz=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function nC(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}function DA(e){return{point:{x:e.pageX,y:e.pageY}}}const XYe=e=>t=>dz(t)&&e(t,DA(t));function KS(e,t,n,i){return nC(e,t,XYe(n),i)}const WY=(e,t)=>Math.abs(e-t);function YYe(e,t){const n=WY(e.x,t.x),i=WY(e.y,t.y);return Math.sqrt(n**2+i**2)}class fAe{constructor(t,n,{transformPagePoint:i,contextWindow:r,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=m3(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,m=YYe(f.offset,{x:0,y:0})>=3;if(!h&&!m)return;const{point:g}=f,{timestamp:b}=Go;this.history.push({...g,timestamp:b});const{onStart:v,onMove:y}=this.handlers;h||(v&&v(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=p3(h,this.transformPagePoint),Is.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{this.end();const{onEnd:m,onSessionEnd:g,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=m3(f.type==="pointercancel"?this.lastMoveEventInfo:p3(h,this.transformPagePoint),this.history);this.startEvent&&m&&m(f,v),g&&g(f,v)},!dz(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=i,this.contextWindow=r||window;const o=DA(t),l=p3(o,this.transformPagePoint),{point:c}=l,{timestamp:u}=Go;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,m3(l,this.history)),this.removeListeners=PA(KS(this.contextWindow,"pointermove",this.handlePointerMove),KS(this.contextWindow,"pointerup",this.handlePointerUp),KS(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Wg(this.updatePoint)}}function p3(e,t){return t?{point:t(e.point)}:e}function KY(e,t){return{x:e.x-t.x,y:e.y-t.y}}function m3({point:e},t){return{point:e,delta:KY(e,hAe(t)),offset:KY(e,ZYe(t)),velocity:JYe(t,.1)}}function ZYe(e){return e[0]}function hAe(e){return e[e.length-1]}function JYe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const r=hAe(e);for(;n>=0&&(i=e[n],!(r.timestamp-i.timestamp>Np(t)));)n--;if(!i)return{x:0,y:0};const s=Rp(r.timestamp-i.timestamp);if(s===0)return{x:0,y:0};const o={x:(r.x-i.x)/s,y:(r.y-i.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const pAe=1e-4,eZe=1-pAe,tZe=1+pAe,mAe=.01,nZe=0-mAe,iZe=0+mAe;function Du(e){return e.max-e.min}function rZe(e,t,n){return Math.abs(e-t)<=n}function GY(e,t,n,i=.5){e.origin=i,e.originPoint=ea(t.min,t.max,e.origin),e.scale=Du(n)/Du(t),e.translate=ea(n.min,n.max,e.origin)-e.originPoint,(e.scale>=eZe&&e.scale<=tZe||isNaN(e.scale))&&(e.scale=1),(e.translate>=nZe&&e.translate<=iZe||isNaN(e.translate))&&(e.translate=0)}function GS(e,t,n,i){GY(e.x,t.x,n.x,i?i.originX:void 0),GY(e.y,t.y,n.y,i?i.originY:void 0)}function XY(e,t,n){e.min=n.min+t.min,e.max=e.min+Du(t)}function sZe(e,t,n){XY(e.x,t.x,n.x),XY(e.y,t.y,n.y)}function YY(e,t,n){e.min=t.min-n.min,e.max=e.min+Du(t)}function XS(e,t,n){YY(e.x,t.x,n.x),YY(e.y,t.y,n.y)}function aZe(e,{min:t,max:n},i){return t!==void 0&&en&&(e=i?ea(n,e,i.max):Math.min(e,n)),e}function ZY(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function oZe(e,{top:t,left:n,bottom:i,right:r}){return{x:ZY(e.x,n,r),y:ZY(e.y,t,i)}}function JY(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.mini?n=Hw(t.min,t.max-i,e.min):i>r&&(n=Hw(e.min,e.max-r,t.min)),Wp(0,1,n)}function uZe(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const O8=.35;function dZe(e=O8){return e===!1?e=0:e===!0&&(e=O8),{x:eZ(e,"left","right"),y:eZ(e,"top","bottom")}}function eZ(e,t,n){return{min:tZ(e,t),max:tZ(e,n)}}function tZ(e,t){return typeof e=="number"?e:e[t]||0}const nZ=()=>({translate:0,scale:1,origin:0,originPoint:0}),Rx=()=>({x:nZ(),y:nZ()}),iZ=()=>({min:0,max:0}),ya=()=>({x:iZ(),y:iZ()});function Yu(e){return[e("x"),e("y")]}function gAe({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function fZe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function hZe(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function g3(e){return e===void 0||e===1}function k8({scale:e,scaleX:t,scaleY:n}){return!g3(e)||!g3(t)||!g3(n)}function cy(e){return k8(e)||bAe(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function bAe(e){return rZ(e.x)||rZ(e.y)}function rZ(e){return e&&e!=="0%"}function qR(e,t,n){const i=e-n,r=t*i;return n+r}function sZ(e,t,n,i,r){return r!==void 0&&(e=qR(e,r,i)),qR(e,n,i)+t}function S8(e,t=0,n=1,i,r){e.min=sZ(e.min,t,n,i,r),e.max=sZ(e.max,t,n,i,r)}function yAe(e,{x:t,y:n}){S8(e.x,t.translate,t.scale,t.originPoint),S8(e.y,n.translate,n.scale,n.originPoint)}const aZ=.999999999999,oZ=1.0000000000001;function pZe(e,t,n,i=!1){const r=n.length;if(!r)return;t.x=t.y=1;let s,o;for(let l=0;laZ&&(t.x=1),t.yaZ&&(t.y=1)}function Ix(e,t){e.min=e.min+t,e.max=e.max+t}function lZ(e,t,n,i,r=.5){const s=ea(e.min,e.max,r);S8(e,t,n,s,i)}function Px(e,t){lZ(e.x,t.x,t.scaleX,t.scale,t.originX),lZ(e.y,t.y,t.scaleY,t.scale,t.originY)}function vAe(e,t){return gAe(hZe(e.getBoundingClientRect(),t))}function mZe(e,t,n){const i=vAe(e,n),{scroll:r}=t;return r&&(Ix(i.x,r.offset.x),Ix(i.y,r.offset.y)),i}const xAe=({current:e})=>e?e.ownerDocument.defaultView:null,gZe=new WeakMap;class bZe{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ya(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(DA(d).point)},s=(d,f)=>{const{drag:h,dragPropagation:m,onDragStart:g}=this.getProps();if(h&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=GYe(h),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Yu(v=>{let y=this.getAxisMotionValue(v).get()||0;if(ph.test(y)){const{projection:w}=this.visualElement;if(w&&w.layout){const x=w.layout.layoutBox[v];x&&(y=Du(x)*(parseFloat(y)/100))}}this.originPoint[v]=y}),g&&Is.postRender(()=>g(d,f)),f8(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},o=(d,f)=>{const{dragPropagation:h,dragDirectionLock:m,onDirectionLock:g,onDrag:b}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:v}=f;if(m&&this.currentDirection===null){this.currentDirection=yZe(v),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,v),this.updateAxis("y",f.point,v),this.visualElement.render(),b&&b(d,f)},l=(d,f)=>this.stop(d,f),c=()=>Yu(d=>{var f;return this.getAnimationState(d)==="paused"&&((f=this.getAxisMotionValue(d).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new fAe(t,{onSessionStart:r,onStart:s,onMove:o,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:xAe(this.visualElement)})}stop(t,n){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:r}=n;this.startAnimation(r);const{onDragEnd:s}=this.getProps();s&&Is.postRender(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,i){const{drag:r}=this.getProps();if(!i||!K2(t,r,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(o=aZe(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:i}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,s=this.constraints;n&&jx(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&r?this.constraints=oZe(r.layoutBox,n):this.constraints=!1,this.elastic=dZe(i),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Yu(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=uZe(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!jx(t))return!1;const i=t.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const s=mZe(i,r.root,this.visualElement.getTransformPagePoint());let o=lZe(r.layout.layoutBox,s);if(n){const l=n(fZe(o));this.hasMutatedConstraints=!!l,l&&(o=gAe(l))}return o}startAnimation(t){const{drag:n,dragMomentum:i,dragElastic:r,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Yu(d=>{if(!K2(d,n,this.currentDirection))return;let f=c&&c[d]||{};o&&(f={min:0,max:0});const h=r?200:1e6,m=r?40:1e7,g={type:"inertia",velocity:i?t[d]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(d,g)});return Promise.all(u).then(l)}startAxisValueAnimation(t,n){const i=this.getAxisMotionValue(t);return f8(this.visualElement,t),i.start(uz(t,i,0,n,this.visualElement,!1))}stopAnimation(){Yu(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Yu(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps(),r=i[n];return r||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){Yu(n=>{const{drag:i}=this.getProps();if(!K2(n,i,this.currentDirection))return;const{projection:r}=this.visualElement,s=this.getAxisMotionValue(n);if(r&&r.layout){const{min:o,max:l}=r.layout.layoutBox[n];s.set(t[n]-ea(o,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!jx(n)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Yu(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();r[o]=cZe({min:c,max:c},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),Yu(o=>{if(!K2(o,t,null))return;const l=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];l.set(ea(c,u,r[o]))})}addListeners(){if(!this.visualElement.current)return;gZe.set(this.visualElement,this);const t=this.visualElement.current,n=KS(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),i=()=>{const{dragConstraints:c}=this.getProps();jx(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,s=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),Is.read(i);const o=nC(window,"resize",()=>this.scalePositionWithinConstraints()),l=r.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Yu(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=c[d].translate,f.set(f.get()+c[d].translate))}),this.visualElement.render())});return()=>{o(),n(),s(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:s=!1,dragElastic:o=O8,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:r,dragConstraints:s,dragElastic:o,dragMomentum:l}}}function K2(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function yZe(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class vZe extends kb{constructor(t){super(t),this.removeGroupControls=Tu,this.removeListeners=Tu,this.controls=new bZe(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Tu}unmount(){this.removeGroupControls(),this.removeListeners()}}const cZ=e=>(t,n)=>{e&&Is.postRender(()=>e(t,n))};class xZe extends kb{constructor(){super(...arguments),this.removePointerDownListener=Tu}onPointerDown(t){this.session=new fAe(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:xAe(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:cZ(t),onStart:cZ(n),onMove:i,onEnd:(s,o)=>{delete this.session,r&&Is.postRender(()=>r(s,o))}}}mount(){this.removePointerDownListener=KS(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const sN={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function uZ(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const sk={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Gn.test(e))e=parseFloat(e);else return e;const n=uZ(e,t.target.x),i=uZ(e,t.target.y);return`${n}% ${i}%`}},wZe={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,r=Kg.parse(e);if(r.length>5)return i;const s=Kg.createTransformer(e),o=typeof r[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;r[0+o]/=l,r[1+o]/=c;const u=ea(l,c,.5);return typeof r[2+o]=="number"&&(r[2+o]/=u),typeof r[3+o]=="number"&&(r[3+o]/=u),s(r)}};class OZe extends p.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i,layoutId:r}=this.props,{projection:s}=t;KGe(kZe),s&&(n.group&&n.group.add(s),i&&i.register&&r&&i.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),sN.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:i,drag:r,isPresent:s}=this.props,o=i.projection;return o&&(o.isPresent=s,r||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||Is.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),FQ.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:r}=t;r&&(r.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(r),i&&i.deregister&&i.deregister(r))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function wAe(e){const[t,n]=rCe(),i=p.useContext(PQ);return a.jsx(OZe,{...e,layoutGroup:i,switchLayoutGroup:p.useContext(hCe),isPresent:t,safeToRemove:n})}const kZe={borderRadius:{...sk,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:sk,borderTopRightRadius:sk,borderBottomLeftRadius:sk,borderBottomRightRadius:sk,boxShadow:wZe};function SZe(e,t,n){const i=Al(e)?e:eC(e);return i.start(uz("",i,t,n)),i.animation}function EZe(e){return e instanceof SVGElement&&e.tagName!=="svg"}const CZe=(e,t)=>e.depth-t.depth;class AZe{constructor(){this.children=[],this.isDirty=!1}add(t){XQ(this.children,t),this.isDirty=!0}remove(t){YQ(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(CZe),this.isDirty=!1,this.children.forEach(t)}}function TZe(e,t){const n=mh.now(),i=({timestamp:r})=>{const s=r-n;s>=t&&(Wg(i),e(s-t))};return Is.read(i,!0),()=>Wg(i)}const OAe=["TopLeft","TopRight","BottomLeft","BottomRight"],_Ze=OAe.length,dZ=e=>typeof e=="string"?parseFloat(e):e,fZ=e=>typeof e=="number"||Gn.test(e);function jZe(e,t,n,i,r,s){r?(e.opacity=ea(0,n.opacity!==void 0?n.opacity:1,NZe(i)),e.opacityExit=ea(t.opacity!==void 0?t.opacity:1,0,RZe(i))):s&&(e.opacity=ea(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,i));for(let o=0;o<_Ze;o++){const l=`border${OAe[o]}Radius`;let c=hZ(t,l),u=hZ(n,l);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||fZ(c)===fZ(u)?(e[l]=Math.max(ea(dZ(c),dZ(u),i),0),(ph.test(u)||ph.test(c))&&(e[l]+="%")):e[l]=u}(t.rotate||n.rotate)&&(e.rotate=ea(t.rotate||0,n.rotate||0,i))}function hZ(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const NZe=kAe(0,.5,FCe),RZe=kAe(.5,.95,Tu);function kAe(e,t,n){return i=>it?1:n(Hw(e,t,i))}function pZ(e,t){e.min=t.min,e.max=t.max}function Xu(e,t){pZ(e.x,t.x),pZ(e.y,t.y)}function mZ(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function gZ(e,t,n,i,r){return e-=t,e=qR(e,1/n,i),r!==void 0&&(e=qR(e,1/r,i)),e}function IZe(e,t=0,n=1,i=.5,r,s=e,o=e){if(ph.test(t)&&(t=parseFloat(t),t=ea(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=ea(s.min,s.max,i);e===s&&(l-=t),e.min=gZ(e.min,t,n,l,r),e.max=gZ(e.max,t,n,l,r)}function bZ(e,t,[n,i,r],s,o){IZe(e,t[n],t[i],t[r],t.scale,s,o)}const PZe=["x","scaleX","originX"],DZe=["y","scaleY","originY"];function yZ(e,t,n,i){bZ(e.x,t,PZe,n?n.x:void 0,i?i.x:void 0),bZ(e.y,t,DZe,n?n.y:void 0,i?i.y:void 0)}function vZ(e){return e.translate===0&&e.scale===1}function SAe(e){return vZ(e.x)&&vZ(e.y)}function xZ(e,t){return e.min===t.min&&e.max===t.max}function MZe(e,t){return xZ(e.x,t.x)&&xZ(e.y,t.y)}function wZ(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function EAe(e,t){return wZ(e.x,t.x)&&wZ(e.y,t.y)}function OZ(e){return Du(e.x)/Du(e.y)}function kZ(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class LZe{constructor(){this.members=[]}add(t){XQ(this.members,t),t.scheduleRender()}remove(t){if(YQ(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(r=>t===r);if(n===0)return!1;let i;for(let r=n;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1){i=s;break}}return i?(this.promote(i),!0):!1}promote(t,n){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,n&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:r}=t.options;r===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:i}=t;n.onExitComplete&&n.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function $Ze(e,t,n){let i="";const r=e.x.translate/t.x,s=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((r||s||o)&&(i=`translate3d(${r}px, ${s}px, ${o}px) `),(t.x!==1||t.y!==1)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:h,skewX:m,skewY:g}=n;u&&(i=`perspective(${u}px) ${i}`),d&&(i+=`rotate(${d}deg) `),f&&(i+=`rotateX(${f}deg) `),h&&(i+=`rotateY(${h}deg) `),m&&(i+=`skewX(${m}deg) `),g&&(i+=`skewY(${g}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(i+=`scale(${l}, ${c})`),i||"none"}const uy={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},aS=typeof window<"u"&&window.MotionDebug!==void 0,b3=["","X","Y","Z"],FZe={visibility:"hidden"},SZ=1e3;let BZe=0;function y3(e,t,n,i){const{latestValues:r}=t;r[e]&&(n[e]=r[e],t.setStaticValue(e,0),i&&(i[e]=0))}function CAe(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=_Ce(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:r,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Is,!(r||s))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&CAe(i)}function AAe({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(o={},l=t==null?void 0:t()){this.id=BZe++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,aS&&(uy.totalNodes=uy.resolvedTargetDeltas=uy.recalculatedProjection=0),this.nodes.forEach(zZe),this.nodes.forEach(KZe),this.nodes.forEach(GZe),this.nodes.forEach(VZe),aS&&window.MotionDebug.record(uy)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;cthis.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=TZe(h,250),sN.hasAnimatedSinceResize&&(sN.hasAnimatedSinceResize=!1,this.nodes.forEach(CZ))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&d&&(c||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeTargetChanged:m,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||d.getDefaultTransition()||eJe,{onLayoutAnimationStart:v,onLayoutAnimationComplete:y}=d.getProps(),w=!this.targetLayout||!EAe(this.targetLayout,g)||m,x=!h&&m;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||h&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,x);const O={...GQ(b,"layout"),onPlay:v,onComplete:y};(d.shouldReduceMotion||this.options.layoutRoot)&&(O.delay=0,O.type=!1),this.startAnimation(O)}else h||CZ(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Wg(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(XZe),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&CAe(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c{const k=O/1e3;AZ(f.x,o.x,k),AZ(f.y,o.y,k),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(XS(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),ZZe(this.relativeTarget,this.relativeTargetOrigin,h,k),x&&MZe(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=ya()),Xu(x,this.relativeTarget)),b&&(this.animationValues=d,jZe(d,u,this.latestValues,k,w,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=k},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Wg(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Is.update(()=>{sN.hasAnimatedSinceResize=!0,this.currentAnimation=SZe(0,SZ,{...o,onUpdate:l=>{this.mixTargetDelta(l),o.onUpdate&&o.onUpdate(l)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(SZ),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=o;if(!(!l||!c||!u)){if(this!==o&&this.layout&&u&&TAe(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||ya();const f=Du(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+f;const h=Du(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+h}Xu(l,c),Px(l,d),GS(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new LZe),this.sharedNodes.get(o).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:l}=this.options;return l?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:l}=this.options;return l?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&y3("z",o,u,this.animationValues);for(let d=0;d{var l;return(l=o.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach(EZ),this.root.sharedNodes.clear()}}}function UZe(e){e.updateLayout()}function QZe(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:r}=e.layout,{animationType:s}=e.options,o=n.source!==e.layout.source;s==="size"?Yu(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=Du(h);h.min=i[f].min,h.max=h.min+m}):TAe(s,n.layoutBox,i)&&Yu(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=Du(i[f]);h.max=h.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+m)});const l=Rx();GS(l,i,n.layoutBox);const c=Rx();o?GS(c,e.applyTransform(r,!0),n.measuredBox):GS(c,i,n.layoutBox);const u=!SAe(l);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:m}=f;if(h&&m){const g=ya();XS(g,n.layoutBox,h.layoutBox);const b=ya();XS(b,i,m.layoutBox),EAe(g,b)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=b,e.relativeTargetOrigin=g,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:i,snapshot:n,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:i}=e.options;i&&i()}e.options.transition=void 0}function zZe(e){aS&&uy.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function VZe(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function HZe(e){e.clearSnapshot()}function EZ(e){e.clearMeasurements()}function qZe(e){e.isLayoutDirty=!1}function WZe(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function CZ(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function KZe(e){e.resolveTargetDelta()}function GZe(e){e.calcProjection()}function XZe(e){e.resetSkewAndRotation()}function YZe(e){e.removeLeadSnapshot()}function AZ(e,t,n){e.translate=ea(t.translate,0,n),e.scale=ea(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function TZ(e,t,n,i){e.min=ea(t.min,n.min,i),e.max=ea(t.max,n.max,i)}function ZZe(e,t,n,i){TZ(e.x,t.x,n.x,i),TZ(e.y,t.y,n.y,i)}function JZe(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const eJe={duration:.45,ease:[.4,0,.1,1]},_Z=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),jZ=_Z("applewebkit/")&&!_Z("chrome/")?Math.round:Tu;function NZ(e){e.min=jZ(e.min),e.max=jZ(e.max)}function tJe(e){NZ(e.x),NZ(e.y)}function TAe(e,t,n){return e==="position"||e==="preserve-aspect"&&!rZe(OZ(t),OZ(n),.2)}function nJe(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const iJe=AAe({attachResizeListener:(e,t)=>nC(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),v3={current:void 0},_Ae=AAe({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!v3.current){const e=new iJe({});e.mount(window),e.setOptions({layoutScroll:!0}),v3.current=e}return v3.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),rJe={pan:{Feature:xZe},drag:{Feature:vZe,ProjectionNode:_Ae,MeasureLayout:wAe}};function sJe(e,t,n){var i;if(e instanceof Element)return[e];if(typeof e=="string"){let r=document;const s=(i=void 0)!==null&&i!==void 0?i:r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}function jAe(e,t){const n=sJe(e),i=new AbortController,r={passive:!0,...t,signal:i.signal};return[n,r,()=>i.abort()]}function RZ(e){return t=>{t.pointerType==="touch"||dAe()||e(t)}}function aJe(e,t,n={}){const[i,r,s]=jAe(e,n),o=RZ(l=>{const{target:c}=l,u=t(l);if(typeof u!="function"||!c)return;const d=RZ(f=>{u(f),c.removeEventListener("pointerleave",d)});c.addEventListener("pointerleave",d,r)});return i.forEach(l=>{l.addEventListener("pointerenter",o,r)}),s}function IZ(e,t,n){const{props:i}=e;e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,s=i[r];s&&Is.postRender(()=>s(t,DA(t)))}class oJe extends kb{mount(){const{current:t}=this.node;t&&(this.unmount=aJe(t,n=>(IZ(this.node,n,"Start"),i=>IZ(this.node,i,"End"))))}unmount(){}}class lJe extends kb{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=PA(nC(this.node.current,"focus",()=>this.onFocus()),nC(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const NAe=(e,t)=>t?e===t?!0:NAe(e,t.parentElement):!1,cJe=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function uJe(e){return cJe.has(e.tagName)||e.tabIndex!==-1}const oS=new WeakSet;function PZ(e){return t=>{t.key==="Enter"&&e(t)}}function x3(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const dJe=(e,t)=>{const n=e.currentTarget;if(!n)return;const i=PZ(()=>{if(oS.has(n))return;x3(n,"down");const r=PZ(()=>{x3(n,"up")}),s=()=>x3(n,"cancel");n.addEventListener("keyup",r,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",i,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),t)};function DZ(e){return dz(e)&&!dAe()}function fJe(e,t,n={}){const[i,r,s]=jAe(e,n),o=l=>{const c=l.currentTarget;if(!DZ(l)||oS.has(c))return;oS.add(c);const u=t(l),d=(m,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!DZ(m)||!oS.has(c))&&(oS.delete(c),typeof u=="function"&&u(m,{success:g}))},f=m=>{d(m,n.useGlobalTarget||NAe(c,m.target))},h=m=>{d(m,!1)};window.addEventListener("pointerup",f,r),window.addEventListener("pointercancel",h,r)};return i.forEach(l=>{!uJe(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0),(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,r),l.addEventListener("focus",u=>dJe(u,r),r)}),s}function MZ(e,t,n){const{props:i}=e;e.animationState&&i.whileTap&&e.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),s=i[r];s&&Is.postRender(()=>s(t,DA(t)))}class hJe extends kb{mount(){const{current:t}=this.node;t&&(this.unmount=fJe(t,n=>(MZ(this.node,n,"Start"),(i,{success:r})=>MZ(this.node,i,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const E8=new WeakMap,w3=new WeakMap,pJe=e=>{const t=E8.get(e.target);t&&t(e)},mJe=e=>{e.forEach(pJe)};function gJe({root:e,...t}){const n=e||document;w3.has(n)||w3.set(n,{});const i=w3.get(n),r=JSON.stringify(t);return i[r]||(i[r]=new IntersectionObserver(mJe,{root:e,...t})),i[r]}function bJe(e,t,n){const i=gJe(t);return E8.set(e,n),i.observe(e),()=>{E8.delete(e),i.unobserve(e)}}const yJe={some:0,all:1};class vJe extends kb{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:i,amount:r="some",once:s}=t,o={root:n?n.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:yJe[r]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,s&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),h=u?d:f;h&&h(c)};return bJe(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(xJe(t,n))&&this.startObserver()}unmount(){}}function xJe({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const wJe={inView:{Feature:vJe},tap:{Feature:hJe},focus:{Feature:lJe},hover:{Feature:oJe}},OJe={layout:{ProjectionNode:_Ae,MeasureLayout:wAe}},WR={current:null},fz={current:!1};function RAe(){if(fz.current=!0,!!DQ)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>WR.current=e.matches;e.addListener(t),t()}else WR.current=!1}const kJe=[...JCe,Sl,Kg],SJe=e=>kJe.find(ZCe(e)),LZ=new WeakMap;function EJe(e,t,n){for(const i in t){const r=t[i],s=n[i];if(Al(r))e.addValue(i,r);else if(Al(s))e.addValue(i,eC(r,{owner:e}));else if(s!==r)if(e.hasValue(i)){const o=e.getValue(i);o.liveStyle===!0?o.jump(r):o.hasAnimated||o.set(r)}else{const o=e.getStaticValue(i);e.addValue(i,eC(o!==void 0?o:r,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const $Z=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class CJe{scrapeMotionValuesFromProps(t,n,i){return{}}constructor({parent:t,props:n,presenceContext:i,reducedMotionConfig:r,blockInitialAnimation:s,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=oz,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const m=mh.now();this.renderScheduledAtthis.bindToMotionValue(i,n)),fz.current||RAe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:WR.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){LZ.delete(this.current),this.projection&&this.projection.unmount(),Wg(this.notifyUpdate),Wg(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const i=F0.has(t),r=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&Is.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{r(),s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Vw){const n=Vw[t];if(!n)continue;const{isEnabled:i,Feature:r}=n;if(!this.features[t]&&r&&i(this.props)&&(this.features[t]=new r(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ya()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let i=0;i<$Z.length;i++){const r=$Z[i];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const s="on"+r,o=t[s];o&&(this.propEventSubscriptions[r]=this.on(r,o))}this.prevMotionValues=EJe(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const i=this.values.get(t);n!==i&&(i&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return i===void 0&&n!==void 0&&(i=eC(n===null?void 0:n,{owner:this}),this.addValue(t,i)),i}readValue(t,n){var i;let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(i=this.getBaseTargetFromProps(this.props,t))!==null&&i!==void 0?i:this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(XCe(r)||UCe(r))?r=parseFloat(r):!SJe(r)&&Kg.test(n)&&(r=WCe(t,n)),this.setBaseTarget(t,Al(r)?r.get():r)),Al(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:i}=this.props;let r;if(typeof i=="string"||typeof i=="object"){const o=UQ(this.props,i,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(r=o[t])}if(i&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Al(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new ZQ),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class IAe extends CJe{constructor(){super(...arguments),this.KeyframeResolver=eAe}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:i}){delete n[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Al(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function AJe(e){return window.getComputedStyle(e)}class TJe extends IAe{constructor(){super(...arguments),this.type="html",this.renderInstance=xCe}readValueFromInstance(t,n){if(F0.has(n)){const i=az(n);return i&&i.default||0}else{const i=AJe(t),r=(bCe(n)?i.getPropertyValue(n):i[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(t,{transformPagePoint:n}){return vAe(t,n)}build(t,n,i){VQ(t,n,i.transformTemplate)}scrapeMotionValuesFromProps(t,n,i){return KQ(t,n,i)}}class _Je extends IAe{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ya}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(F0.has(n)){const i=az(n);return i&&i.default||0}return n=wCe.has(n)?n:$Q(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,i){return SCe(t,n,i)}build(t,n,i){HQ(t,n,this.isSVGTag,i.transformTemplate)}renderInstance(t,n,i,r){OCe(t,n,i,r)}mount(t){this.isSVGTag=WQ(t.tagName),super.mount(t)}}const jJe=(e,t)=>BQ(e)?new _Je(t):new TJe(t,{allowProjection:e!==p.Fragment}),NJe=iXe({...KYe,...wJe,...rJe,...OJe},jJe),Cr=yGe(NJe);function SD(){!fz.current&&RAe();const[e]=p.useState(WR.current);return e}function oo(){return oo=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||/ServerSideRendering/.test(navigator&&navigator.userAgent)?p.useEffect:p.useLayoutEffect;function ix(e,t,n){var i=p.useRef(t);i.current=t,p.useEffect(function(){function r(s){i.current(s)}return e&&window.addEventListener(e,r,n),function(){e&&window.removeEventListener(e,r)}},[e])}var RJe=["container"];function IJe(e){var t=e.container,n=t===void 0?document.body:t,i=ED(e,RJe);return yi.createPortal(ji.createElement("div",oo({},i)),n)}function PJe(e){return ji.createElement("svg",oo({width:"44",height:"44",viewBox:"0 0 768 768"},e),ji.createElement("path",{d:"M607.5 205.5l-178.5 178.5 178.5 178.5-45 45-178.5-178.5-178.5 178.5-45-45 178.5-178.5-178.5-178.5 45-45 178.5 178.5 178.5-178.5z"}))}function DJe(e){return ji.createElement("svg",oo({width:"44",height:"44",viewBox:"0 0 768 768"},e),ji.createElement("path",{d:"M640.5 352.5v63h-390l178.5 180-45 45-256.5-256.5 256.5-256.5 45 45-178.5 180h390z"}))}function MJe(e){return ji.createElement("svg",oo({width:"44",height:"44",viewBox:"0 0 768 768"},e),ji.createElement("path",{d:"M384 127.5l256.5 256.5-256.5 256.5-45-45 178.5-180h-390v-63h390l-178.5-180z"}))}function LJe(){return p.useEffect(function(){var e=document.body.style,t=e.overflow;return e.overflow="hidden",function(){e.overflow=t}},[]),null}function BZ(e){var t=e.touches[0],n=t.clientX,i=t.clientY;if(e.touches.length>=2){var r=e.touches[1],s=r.clientX,o=r.clientY;return[(n+s)/2,(i+o)/2,Math.sqrt(Math.pow(s-n,2)+Math.pow(o-i,2))]}return[n,i,0]}var Km=function(e,t,n,i){var r,s=n*t,o=(s-i)/2,l=e;return s<=i?(r=1,l=0):e>0&&o-e<=0?(r=2,l=o):e<0&&o+e<=0&&(r=3,l=-o),[r,l]};function O3(e,t,n,i,r,s,o,l,c,u){o===void 0&&(o=innerWidth/2),l===void 0&&(l=innerHeight/2),c===void 0&&(c=0),u===void 0&&(u=0);var d=Km(e,s,n,innerWidth)[0],f=Km(t,s,i,innerHeight),h=innerWidth/2,m=innerHeight/2;return{x:o-s/r*(o-(h+e))-h+(i/n>=3&&n*s===innerWidth?0:d?c/2:c),y:l-s/r*(l-(m+t))-m+(f[0]?u/2:u),lastCX:o,lastCY:l}}function T8(e,t,n){var i=e%180!=0;return i?[n,t,i]:[t,n,i]}function k3(e,t,n){var i=T8(n,innerWidth,innerHeight),r=i[0],s=i[1],o=0,l=r,c=s,u=e/t*s,d=t/e*r;return e=s?l=u:e>=r&&tr/s?c=d:t/e>=3&&!i[2]?o=((c=d)-s)/2:l=u,{width:l,height:c,x:0,y:o,pause:!0}}function X2(e,t){var n=t.leading,i=n!==void 0&&n,r=t.maxWait,s=t.wait,o=s===void 0?r||0:s,l=p.useRef(e);l.current=e;var c=p.useRef(0),u=p.useRef(),d=function(){return u.current&&clearTimeout(u.current)},f=p.useCallback(function(){var h=[].slice.call(arguments),m=Date.now();function g(){c.current=m,d(),l.current.apply(null,h)}var b=c.current,v=m-b;if(b===0&&(i&&g(),c.current=m),r!==void 0){if(v>r)return void g()}else v=1&&s&&s())};d()}function d(){c=requestAnimationFrame(u)}}var FJe={T:0,L:0,W:0,H:0,FIT:void 0},DAe=function(){var e=p.useRef(!1);return p.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e},BJe=["className"];function UJe(e){var t=e.className,n=t===void 0?"":t,i=ED(e,BJe);return ji.createElement("div",oo({className:"PhotoView__Spinner "+n},i),ji.createElement("svg",{viewBox:"0 0 32 32",width:"36",height:"36",fill:"white"},ji.createElement("path",{opacity:".25",d:"M16 0 A16 16 0 0 0 16 32 A16 16 0 0 0 16 0 M16 4 A12 12 0 0 1 16 28 A12 12 0 0 1 16 4"}),ji.createElement("path",{d:"M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"})))}var QJe=["src","loaded","broken","className","onPhotoLoad","loadingElement","brokenElement"];function zJe(e){var t=e.src,n=e.loaded,i=e.broken,r=e.className,s=e.onPhotoLoad,o=e.loadingElement,l=e.brokenElement,c=ED(e,QJe),u=DAe();return t&&!i?ji.createElement(ji.Fragment,null,ji.createElement("img",oo({className:"PhotoView__Photo"+(r?" "+r:""),src:t,onLoad:function(d){var f=d.target;u.current&&s({loaded:!0,naturalWidth:f.naturalWidth,naturalHeight:f.naturalHeight})},onError:function(){u.current&&s({broken:!0})},draggable:!1,alt:""},c)),!n&&(o?ji.createElement("span",{className:"PhotoView__icon"},o):ji.createElement(UJe,{className:"PhotoView__icon"}))):l?ji.createElement("span",{className:"PhotoView__icon"},typeof l=="function"?l({src:t}):l):null}var VJe={naturalWidth:void 0,naturalHeight:void 0,width:void 0,height:void 0,loaded:void 0,broken:!1,x:0,y:0,touched:!1,maskTouched:!1,rotate:0,scale:1,CX:0,CY:0,lastX:0,lastY:0,lastCX:0,lastCY:0,lastScale:1,touchTime:0,touchLength:0,pause:!0,stopRaf:!0,reach:void 0};function HJe(e){var t=e.item,n=t.src,i=t.render,r=t.width,s=r===void 0?0:r,o=t.height,l=o===void 0?0:o,c=t.originRef,u=e.visible,d=e.speed,f=e.easing,h=e.wrapClassName,m=e.className,g=e.style,b=e.loadingElement,v=e.brokenElement,y=e.onPhotoTap,w=e.onMaskTap,x=e.onReachMove,O=e.onReachUp,k=e.onPhotoResize,S=e.isActive,C=e.expose,E=KR(VJe),j=E[0],T=E[1],R=p.useRef(0),A=DAe(),N=j.naturalWidth,P=N===void 0?s:N,I=j.naturalHeight,D=I===void 0?l:I,_=j.width,L=_===void 0?s:_,F=j.height,M=F===void 0?l:F,V=j.loaded,q=V===void 0?!n:V,U=j.broken,J=j.x,z=j.y,Z=j.touched,ne=j.stopRaf,W=j.maskTouched,G=j.rotate,H=j.scale,se=j.CX,Y=j.CY,X=j.lastX,ie=j.lastY,ee=j.lastCX,be=j.lastCY,ue=j.lastScale,pe=j.touchTime,ke=j.touchLength,je=j.pause,Pe=j.reach,Ee=Ky({onScale:function(Ne){return ze(G2(Ne))},onRotate:function(Ne){G!==Ne&&(C({rotate:Ne}),T(oo({rotate:Ne},k3(P,D,Ne))))}});function ze(Ne,Ot,Nt){H!==Ne&&(C({scale:Ne}),T(oo({scale:Ne},O3(J,z,L,M,H,Ne,Ot,Nt),Ne<=1&&{x:0,y:0})))}var _e=X2(function(Ne,Ot,Nt){if(Nt===void 0&&(Nt=0),(Z||W)&&S){var Yt=T8(G,L,M),xn=Yt[0],Ke=Yt[1];if(Nt===0&&R.current===0){var St=Math.abs(Ne-se)<=20,qe=Math.abs(Ot-Y)<=20;if(St&&qe)return void T({lastCX:Ne,lastCY:Ot});R.current=St?Ot>Y?3:2:1}var nt,et=Ne-ee,ft=Ot-be;if(Nt===0){var Et=Km(et+X,H,xn,innerWidth)[0],At=Km(ft+ie,H,Ke,innerHeight);nt=function(Gt,Xe,wt,vt){return Xe&&Gt===1||vt==="x"?"x":wt&&Gt>1||vt==="y"?"y":void 0}(R.current,Et,At[0],Pe),nt!==void 0&&x(nt,Ne,Ot,H)}if(nt==="x"||W)return void T({reach:"x"});var It=G2(H+(Nt-ke)/100/2*H,P/L,.2);C({scale:It}),T(oo({touchLength:Nt,reach:nt,scale:It},O3(J,z,L,M,H,It,Ne,Ot,et,ft)))}},{maxWait:8});function ae(Ne){return!ne&&!Z&&(A.current&&T(oo({},Ne,{pause:u})),A.current)}var le,ge,Oe,Se,We,Ye,ye,we,Ae=(We=function(Ne){return ae({x:Ne})},Ye=function(Ne){return ae({y:Ne})},ye=function(Ne){return A.current&&(C({scale:Ne}),T({scale:Ne})),!Z&&A.current},we=Ky({X:function(Ne){return We(Ne)},Y:function(Ne){return Ye(Ne)},S:function(Ne){return ye(Ne)}}),function(Ne,Ot,Nt,Yt,xn,Ke,St,qe,nt,et,ft){var Et=T8(et,xn,Ke),At=Et[0],It=Et[1],Gt=Km(Ne,qe,At,innerWidth),Xe=Gt[0],wt=Gt[1],vt=Km(Ot,qe,It,innerHeight),tn=vt[0],Qt=vt[1],cn=Date.now()-ft;if(cn>=200||qe!==St||Math.abs(nt-St)>1){var Me=O3(Ne,Ot,xn,Ke,St,qe),on=Me.x,On=Me.y,Sn=Xe?wt:on!==Ne?on:null,Qi=tn?Qt:On!==Ot?On:null;return Sn!==null&&vy(Ne,Sn,we.X),Qi!==null&&vy(Ot,Qi,we.Y),void(qe!==St&&vy(St,qe,we.S))}var un=(Ne-Nt)/cn,lr=(Ot-Yt)/cn,Mn=Math.sqrt(Math.pow(un,2)+Math.pow(lr,2)),ei=!1,Bn=!1;(function(ki,zn){var Rn,di=ki,rt=0,zt=0,Qe=function(_n){Rn||(Rn=_n);var jr=_n-Rn,Hs=Math.sign(ki),qs=-.001*Hs,Dr=Math.sign(-di)*Math.pow(di,2)*2e-4,ti=di*jr+(qs+Dr)*Math.pow(jr,2)/2;rt+=ti,Rn=_n,Hs*(di+=(qs+Dr)*jr)<=0?Ht():zn(rt)?bt():Ht()};function bt(){zt=requestAnimationFrame(Qe)}function Ht(){cancelAnimationFrame(zt)}bt()})(Mn,function(ki){var zn=Ne+ki*(un/Mn),Rn=Ot+ki*(lr/Mn),di=Km(zn,St,At,innerWidth),rt=di[0],zt=di[1],Qe=Km(Rn,St,It,innerHeight),bt=Qe[0],Ht=Qe[1];if(rt&&!ei&&(ei=!0,Xe?vy(zn,zt,we.X):UZ(zt,zn+(zn-zt),we.X)),bt&&!Bn&&(Bn=!0,tn?vy(Rn,Ht,we.Y):UZ(Ht,Rn+(Rn-Ht),we.Y)),ei&&Bn)return!1;var _n=ei||we.X(zt),jr=Bn||we.Y(Ht);return _n&&jr})}),He=(le=y,ge=function(Ne,Ot){Pe||ze(H!==1?1:Math.max(2,P/L),Ne,Ot)},Oe=p.useRef(0),Se=X2(function(){Oe.current=0,le.apply(void 0,[].slice.call(arguments))},{wait:300}),function(){var Ne=[].slice.call(arguments);Oe.current+=1,Se.apply(void 0,Ne),Oe.current>=2&&(Se.cancel(),Oe.current=0,ge.apply(void 0,Ne))});function Ue(Ne,Ot){if(R.current=0,(Z||W)&&S){T({touched:!1,maskTouched:!1,pause:!1,stopRaf:!1,reach:void 0});var Nt=G2(H,P/L);if(Ae(J,z,X,ie,L,M,H,Nt,ue,G,pe),O(Ne,Ot),se===Ne&&Y===Ot){if(Z)return void He(Ne,Ot);W&&w(Ne,Ot)}}}function jt(Ne,Ot,Nt){Nt===void 0&&(Nt=0),T({touched:!0,CX:Ne,CY:Ot,lastCX:Ne,lastCY:Ot,lastX:J,lastY:z,lastScale:H,touchLength:Nt,touchTime:Date.now()})}function Pt(Ne){T({maskTouched:!0,CX:Ne.clientX,CY:Ne.clientY,lastX:J,lastY:z})}ix(tp?void 0:"mousemove",function(Ne){Ne.preventDefault(),_e(Ne.clientX,Ne.clientY)}),ix(tp?void 0:"mouseup",function(Ne){Ue(Ne.clientX,Ne.clientY)}),ix(tp?"touchmove":void 0,function(Ne){Ne.preventDefault();var Ot=BZ(Ne);_e.apply(void 0,Ot)},{passive:!1}),ix(tp?"touchend":void 0,function(Ne){var Ot=Ne.changedTouches[0];Ue(Ot.clientX,Ot.clientY)},{passive:!1}),ix("resize",X2(function(){q&&!Z&&(T(k3(P,D,G)),k())},{maxWait:8})),A8(function(){S&&C(oo({scale:H,rotate:G},Ee))},[S]);var Kt=function(Ne,Ot,Nt,Yt,xn,Ke,St,qe,nt,et){var ft=function(on,On,Sn,Qi,un){var lr=p.useRef(!1),Mn=KR({lead:!0,scale:Sn}),ei=Mn[0],Bn=ei.lead,ki=ei.scale,zn=Mn[1],Rn=X2(function(di){try{return un(!0),zn({lead:!1,scale:di}),Promise.resolve()}catch(rt){return Promise.reject(rt)}},{wait:Qi});return A8(function(){lr.current?(un(!1),zn({lead:!0}),Rn(Sn)):lr.current=!0},[Sn]),Bn?[on*ki,On*ki,Sn/ki]:[on*Sn,On*Sn,1]}(Ke,St,qe,nt,et),Et=ft[0],At=ft[1],It=ft[2],Gt=function(on,On,Sn,Qi,un){var lr=p.useState(FJe),Mn=lr[0],ei=lr[1],Bn=p.useState(0),ki=Bn[0],zn=Bn[1],Rn=p.useRef(),di=Ky({OK:function(){return on&&zn(4)}});function rt(zt){un(!1),zn(zt)}return p.useEffect(function(){if(Rn.current||(Rn.current=Date.now()),Sn){if(function(zt,Qe){var bt=zt&&zt.current;if(bt&&bt.nodeType===1){var Ht=bt.getBoundingClientRect();Qe({T:Ht.top,L:Ht.left,W:Ht.width,H:Ht.height,FIT:bt.tagName==="IMG"?getComputedStyle(bt).objectFit:void 0})}}(On,ei),on)return Date.now()-Rn.current<250?(zn(1),requestAnimationFrame(function(){zn(2),requestAnimationFrame(function(){return rt(3)})}),void setTimeout(di.OK,Qi)):void zn(4);rt(5)}},[on,Sn]),[ki,Mn]}(Ne,Ot,Nt,nt,et),Xe=Gt[0],wt=Gt[1],vt=wt.W,tn=wt.FIT,Qt=innerWidth/2,cn=innerHeight/2,Me=Xe<3||Xe>4;return[Me?vt?wt.L:Qt:Yt+(Qt-Ke*qe/2),Me?vt?wt.T:cn:xn+(cn-St*qe/2),Et,Me&&tn?Et*(wt.H/vt):At,Xe===0?It:Me?vt/(Ke*qe)||.01:It,Me?tn?1:0:1,Xe,tn]}(u,c,q,J,z,L,M,H,d,function(Ne){return T({pause:Ne})}),Ct=Kt[4],xt=Kt[6],tt="transform "+d+"ms "+f,mt={className:m,onMouseDown:tp?void 0:function(Ne){Ne.stopPropagation(),Ne.button===0&&jt(Ne.clientX,Ne.clientY,0)},onTouchStart:tp?function(Ne){Ne.stopPropagation(),jt.apply(void 0,BZ(Ne))}:void 0,onWheel:function(Ne){if(!Pe){var Ot=G2(H-Ne.deltaY/100/2,P/L);T({stopRaf:!0}),ze(Ot,Ne.clientX,Ne.clientY)}},style:{width:Kt[2]+"px",height:Kt[3]+"px",opacity:Kt[5],objectFit:xt===4?void 0:Kt[7],transform:G?"rotate("+G+"deg)":void 0,transition:xt>2?tt+", opacity "+d+"ms ease, height "+(xt<4?d/2:xt>4?d:0)+"ms "+f:void 0}};return ji.createElement("div",{className:"PhotoView__PhotoWrap"+(h?" "+h:""),style:g,onMouseDown:!tp&&S?Pt:void 0,onTouchStart:tp&&S?function(Ne){return Pt(Ne.touches[0])}:void 0},ji.createElement("div",{className:"PhotoView__PhotoBox",style:{transform:"matrix("+Ct+", 0, 0, "+Ct+", "+Kt[0]+", "+Kt[1]+")",transition:Z||je?void 0:tt,willChange:S?"transform":void 0}},n?ji.createElement(zJe,oo({src:n,loaded:q,broken:U},mt,{onPhotoLoad:function(Ne){T(oo({},Ne,Ne.loaded&&k3(Ne.naturalWidth||0,Ne.naturalHeight||0,G)))},loadingElement:b,brokenElement:v})):i&&i({attrs:mt,scale:Ct,rotate:G})))}var QZ={x:0,touched:!1,pause:!1,lastCX:void 0,lastCY:void 0,bg:void 0,lastBg:void 0,overlay:!0,minimal:!0,scale:1,rotate:0};function qJe(e){var t=e.loop,n=t===void 0?3:t,i=e.speed,r=e.easing,s=e.photoClosable,o=e.maskClosable,l=o===void 0||o,c=e.maskOpacity,u=c===void 0?1:c,d=e.pullClosable,f=d===void 0||d,h=e.bannerVisible,m=h===void 0||h,g=e.overlayRender,b=e.toolbarRender,v=e.className,y=e.maskClassName,w=e.photoClassName,x=e.photoWrapClassName,O=e.loadingElement,k=e.brokenElement,S=e.images,C=e.index,E=C===void 0?0:C,j=e.onIndexChange,T=e.visible,R=e.onClose,A=e.afterClose,N=e.portalContainer,P=KR(QZ),I=P[0],D=P[1],_=p.useState(0),L=_[0],F=_[1],M=I.x,V=I.touched,q=I.pause,U=I.lastCX,J=I.lastCY,z=I.bg,Z=z===void 0?u:z,ne=I.lastBg,W=I.overlay,G=I.minimal,H=I.scale,se=I.rotate,Y=I.onScale,X=I.onRotate,ie=e.hasOwnProperty("index"),ee=ie?E:L,be=ie?j:F,ue=p.useRef(ee),pe=S.length,ke=S[ee],je=typeof n=="boolean"?n:pe>n,Pe=function(Ct,xt){var tt=p.useReducer(function(Nt){return!Nt},!1)[1],mt=p.useRef(0),Ne=function(Nt){var Yt=p.useRef(Nt);function xn(Ke){Yt.current=Ke}return p.useMemo(function(){(function(Ke){Ct?(Ke(Ct),mt.current=1):mt.current=2})(xn)},[Nt]),[Yt.current,xn]}(Ct),Ot=Ne[1];return[Ne[0],mt.current,function(){tt(),mt.current===2&&(Ot(!1),xt&&xt()),mt.current=0}]}(T,A),Ee=Pe[0],ze=Pe[1],_e=Pe[2];A8(function(){if(Ee)return D({pause:!0,x:ee*-(innerWidth+_v)}),void(ue.current=ee);D(QZ)},[Ee]);var ae=Ky({close:function(Ct){X&&X(0),D({overlay:!0,lastBg:Z}),R(Ct)},changeIndex:function(Ct,xt){xt===void 0&&(xt=!1);var tt=je?ue.current+(Ct-ee):Ct,mt=pe-1,Ne=C8(tt,0,mt),Ot=je?tt:Ne,Nt=innerWidth+_v;D({touched:!1,lastCX:void 0,lastCY:void 0,x:-Nt*Ot,pause:xt}),ue.current=Ot,be&&be(je?Ct<0?mt:Ct>mt?0:Ct:Ne)}}),le=ae.close,ge=ae.changeIndex;function Oe(Ct){return Ct?le():D({overlay:!W})}function Se(){D({x:-(innerWidth+_v)*ee,lastCX:void 0,lastCY:void 0,pause:!0}),ue.current=ee}function We(Ct,xt,tt,mt){Ct==="x"?function(Ne){if(U!==void 0){var Ot=Ne-U,Nt=Ot;!je&&(ee===0&&Ot>0||ee===pe-1&&Ot<0)&&(Nt=Ot/2),D({touched:!0,lastCX:U,x:-(innerWidth+_v)*ue.current+Nt,pause:!1})}else D({touched:!0,lastCX:Ne,x:M,pause:!1})}(xt):Ct==="y"&&function(Ne,Ot){if(J!==void 0){var Nt=u===null?null:C8(u,.01,u-Math.abs(Ne-J)/100/4);D({touched:!0,lastCY:J,bg:Ot===1?Nt:u,minimal:Ot===1})}else D({touched:!0,lastCY:Ne,bg:Z,minimal:!0})}(tt,mt)}function Ye(Ct,xt){var tt=Ct-(U??Ct),mt=xt-(J??xt),Ne=!1;if(tt<-40)ge(ee+1);else if(tt>40)ge(ee-1);else{var Ot=-(innerWidth+_v)*ue.current;Math.abs(mt)>100&&G&&f&&(Ne=!0,le()),D({touched:!1,x:Ot,lastCX:void 0,lastCY:void 0,bg:u,overlay:!!Ne||W})}}ix("keydown",function(Ct){if(T)switch(Ct.key){case"ArrowLeft":ge(ee-1,!0);break;case"ArrowRight":ge(ee+1,!0);break;case"Escape":le()}});var ye=function(Ct,xt,tt){return p.useMemo(function(){var mt=Ct.length;return tt?Ct.concat(Ct).concat(Ct).slice(mt+xt-1,mt+xt+2):Ct.slice(Math.max(xt-1,0),Math.min(xt+2,mt+1))},[Ct,xt,tt])}(S,ee,je);if(!Ee)return null;var we=W&&!ze,Ae=T?Z:ne,He=Y&&X&&{images:S,index:ee,visible:T,onClose:le,onIndexChange:ge,overlayVisible:we,overlay:ke&&ke.overlay,scale:H,rotate:se,onScale:Y,onRotate:X},Ue=i?i(ze):400,jt=r?r(ze):FZ,Pt=i?i(3):600,Kt=r?r(3):FZ;return ji.createElement(IJe,{className:"PhotoView-Portal"+(we?"":" PhotoView-Slider__clean")+(T?"":" PhotoView-Slider__willClose")+(v?" "+v:""),role:"dialog",onClick:function(Ct){return Ct.stopPropagation()},container:N},T&&ji.createElement(LJe,null),ji.createElement("div",{className:"PhotoView-Slider__Backdrop"+(y?" "+y:"")+(ze===1?" PhotoView-Slider__fadeIn":ze===2?" PhotoView-Slider__fadeOut":""),style:{background:Ae?"rgba(0, 0, 0, "+Ae+")":void 0,transitionTimingFunction:jt,transitionDuration:(V?0:Ue)+"ms",animationDuration:Ue+"ms"},onAnimationEnd:_e}),m&&ji.createElement("div",{className:"PhotoView-Slider__BannerWrap"},ji.createElement("div",{className:"PhotoView-Slider__Counter"},ee+1," / ",pe),ji.createElement("div",{className:"PhotoView-Slider__BannerRight"},b&&He&&b(He),ji.createElement(PJe,{className:"PhotoView-Slider__toolbarIcon",onClick:le}))),ye.map(function(Ct,xt){var tt=je||ee!==0?ue.current-1+xt:ee+xt;return ji.createElement(HJe,{key:je?Ct.key+"/"+Ct.src+"/"+tt:Ct.key,item:Ct,speed:Ue,easing:jt,visible:T,onReachMove:We,onReachUp:Ye,onPhotoTap:function(){return Oe(s)},onMaskTap:function(){return Oe(l)},wrapClassName:x,className:w,style:{left:(innerWidth+_v)*tt+"px",transform:"translate3d("+M+"px, 0px, 0)",transition:V||q?void 0:"transform "+Pt+"ms "+Kt},loadingElement:O,brokenElement:k,onPhotoResize:Se,isActive:ue.current===tt,expose:D})}),!tp&&m&&ji.createElement(ji.Fragment,null,(je||ee!==0)&&ji.createElement("div",{className:"PhotoView-Slider__ArrowLeft",onClick:function(){return ge(ee-1,!0)}},ji.createElement(DJe,null)),(je||ee+1-1){var y=u.slice();return y.splice(v,1,b),void l({images:y})}l(function(w){return{images:w.images.concat(b)}})},remove:function(b){l(function(v){var y=v.images.filter(function(w){return w.key!==b});return{images:y,index:Math.min(y.length-1,f)}})},show:function(b){var v=u.findIndex(function(y){return y.key===b});l({visible:!0,index:v}),i&&i(!0,v,o)}}),m=Ky({close:function(){l({visible:!1}),i&&i(!1,f,o)},changeIndex:function(b){l({index:b}),n&&n(b,o)}}),g=p.useMemo(function(){return oo({},o,h)},[o,h]);return ji.createElement(PAe.Provider,{value:g},t,ji.createElement(qJe,oo({images:u,visible:d,index:f,onIndexChange:m.changeIndex,onClose:m.close},r)))}var MAe=function(e){var t,n,i=e.src,r=e.render,s=e.overlay,o=e.width,l=e.height,c=e.triggers,u=c===void 0?["onClick"]:c,d=e.children,f=p.useContext(PAe),h=(t=function(){return f.nextId()},(n=p.useRef({sign:!1,fn:void 0}).current).sign||(n.sign=!0,n.fn=t()),n.fn),m=p.useRef(null);p.useImperativeHandle(d==null?void 0:d.ref,function(){return m.current}),p.useEffect(function(){return function(){f.remove(h)}},[]);var g=Ky({render:function(v){return r&&r(v)},show:function(v,y){f.show(h),function(w,x){if(d){var O=d.props[w];O&&O(x)}}(v,y)}}),b=p.useMemo(function(){var v={};return u.forEach(function(y){v[y]=g.show.bind(null,y)}),v},[]);return p.useEffect(function(){f.update({key:h,src:i,originRef:m,render:g.render,overlay:s,width:o,height:l})},[i]),d?p.Children.only(p.cloneElement(d,oo({},b,{ref:m}))):null};function c0(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),a.jsx("path",{d:"m7.5 9 2.7 2.5L7.5 14M12.7 14h3.8"}),a.jsx("path",{d:"M3.8 7.5h16.4",opacity:".55"})]})}function LAe(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),a.jsx("path",{d:"M3.8 8h16.4"}),a.jsx("circle",{cx:"6.5",cy:"6.3",r:".65",fill:"currentColor",stroke:"none"}),a.jsx("circle",{cx:"8.8",cy:"6.3",r:".65",fill:"currentColor",stroke:"none"}),a.jsx("path",{d:"m9 15 2.2-4 1.6 2.4 1.1-1.2L16 15H9Z"})]})}function hz(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M12 3.4 19 6v5.3c0 4.3-2.7 7.6-7 9.3-4.3-1.7-7-5-7-9.3V6l7-2.6Z"}),a.jsx("path",{d:"m8.8 12 2 2 4.4-4.4"})]})}function aN(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M3.5 7.7h6.1l1.7 2h9.2v7.5a2.3 2.3 0 0 1-2.3 2.3H5.8a2.3 2.3 0 0 1-2.3-2.3V7.7Z"}),a.jsx("path",{d:"M3.8 7.7V6.8a2.3 2.3 0 0 1 2.3-2.3h3l1.8 2h6.9a2.3 2.3 0 0 1 2.3 2.3v.9"}),a.jsx("path",{d:"M12 13v3M10.5 14.5h3"})]})}function XJe(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 5v14M5 12h14"})})}function zZ(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m6.5 11.5 5.5-5.5 5.5 5.5M12 6v12"})})}function VZ(e){return a.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",...e,children:a.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1.75",fill:"currentColor"})})}function YJe(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),a.jsx("circle",{cx:"8.5",cy:"9",r:"1.4"}),a.jsx("path",{d:"m5.5 17 4.2-4.2 2.6 2.4 2.1-2.1 4.1 3.9"})]})}function ZJe(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3.5h7l5 5v12H6z"}),a.jsx("path",{d:"M13 3.5v5h5M9 13h6M9 16h5"})]})}function JJe(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"5",width:"13.5",height:"14",rx:"2.5"}),a.jsx("path",{d:"m17 10 3.5-2v8L17 14zM7 8.5h4.5"})]})}function eet(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m12 3 1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5zM18.5 15.5l.7 2.1 2.1.7-2.1.7-.7 2.1-.7-2.1-2.1-.7 2.1-.7z"})})}function $Ae(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function _8(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m9 6 6 6-6 6"})})}function tet(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M4.8 8.2A8 8 0 1 1 4 12M4.8 8.2V4.5M4.8 8.2h3.7"}),a.jsx("path",{d:"M12 8v4.5l3 1.8"})]})}function Rc(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M20 12a8 8 0 1 1-2.35-5.65"})})}function net(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"8",y:"8",width:"11",height:"11",rx:"2"}),a.jsx("path",{d:"M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2"})]})}function FAe(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m5 12.5 4.2 4.2L19 7"})})}function Q(e,t={}){return bn.t(e,{...t,ns:"adk"})}function ul(e){const t=new Headers(e);return t.has("Accept-Language")||t.set("Accept-Language",bn.resolvedLanguage||bn.language),t}function j8(){return bn.resolvedLanguage||bn.language}function iet(e){if(e.timezone!=null){if(typeof e.timezone!="string")return!1;try{new Intl.DateTimeFormat("en-US",{timeZone:e.timezone})}catch{return!1}}return e.runAt!=null&&(typeof e.runAt!="string"||!Number.isFinite(Date.parse(e.runAt)))?!1:[e.weekdays,e.monthDays].every(t=>t==null||Array.isArray(t)&&t.every(Number.isInteger))}async function ret(e,t,n,i,r){const s=await e(`/web/mpa-cron/${encodeURIComponent(t.runtimeId)}?region=${encodeURIComponent(t.region)}&offset=${n}&query=${encodeURIComponent(i)}`,{signal:r},{});if(!s.ok)throw new Error(`MPA_HTTP_${s.status}`);let o;try{o=await s.json()}catch{throw new Error("MPA_INVALID_RESPONSE")}if(!o||!Array.isArray(o.items)||!Number.isInteger(o.total)||o.total<0||typeof o.hasMore!="boolean"||o.hasMore&&(!Number.isInteger(o.nextOffset)||o.nextOffset<=n)||o.overview!=null&&(!Number.isFinite(o.overview.executionCount)||!Number.isFinite(o.overview.successRate))||!o.items.every(l=>l&&typeof l.id=="string"&&typeof l.name=="string"&&typeof l.enabled=="boolean"&&(l.prompt==null||typeof l.prompt=="string")&&l.schedule&&typeof l.schedule.type=="string"&&iet(l.schedule)&&[l.agentId,l.lastRunAt,l.runningAt,l.createdAt].every(c=>c==null||typeof c=="string")&&(l.nextRunAt==null||typeof l.nextRunAt=="string")&&(l.lastRunStatus==null||typeof l.lastRunStatus=="string")))throw new Error("MPA_INVALID_RESPONSE");return o}async function set(e,t,n,i,r,s){const o=await e(`/web/mpa-cron/${encodeURIComponent(t.runtimeId)}${i}?region=${encodeURIComponent(t.region)}`,{method:n,signal:s,...r===void 0?{}:{headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}},{});if(!o.ok)throw new Error(`MPA_HTTP_${o.status}`);let l;try{l=await o.json()}catch{throw new Error("MPA_INVALID_RESPONSE")}if(!l||typeof l!="object"||Array.isArray(l))throw new Error("MPA_INVALID_RESPONSE");return l}async function aet(e,t,n,i,r){const s=await e(`/web/mpa-cron/${encodeURIComponent(t.runtimeId)}/${encodeURIComponent(n)}/runs?region=${encodeURIComponent(t.region)}&offset=${i}`,{signal:r},{});if(!s.ok)throw new Error(`MPA_HTTP_${s.status}`);let o;try{o=await s.json()}catch{throw new Error("MPA_INVALID_RESPONSE")}if(!o||!Array.isArray(o.items)||!Number.isInteger(o.total)||o.total<0||typeof o.hasMore!="boolean"||o.hasMore&&(!Number.isInteger(o.nextOffset)||o.nextOffset<=i)||!o.items.every(l=>l&&typeof l.id=="string"&&typeof l.status=="string"&&typeof l.scheduledAt=="string"&&[l.startedAt,l.errorMessage,l.sessionId].every(c=>c==null||typeof c=="string")&&(l.durationMs==null||Number.isFinite(l.durationMs)&&l.durationMs>=0)))throw new Error("MPA_INVALID_RESPONSE");return o}const HZ="veadk_auth_qs",oet=new Set(["view","source","sessionId","artifactSha256","validationReportSha256","projectId","versionId"]);let ak=null;function cet(){if(ak!==null)return ak;const e=new URLSearchParams(window.location.search),t=new URLSearchParams,n=new URLSearchParams,i=e.get("view")==="runtime-deploy"&&e.get("source")==="intelligent-development";e.forEach((s,o)=>{(i&&oet.has(o)?n:t).append(o,s)});const r=t.toString();if(r?(sessionStorage.setItem(HZ,r),ak=r):ak=sessionStorage.getItem(HZ)??"",r){const s=n.toString();window.history.replaceState(null,"",window.location.pathname+(s?`?${s}`:"")+window.location.hash)}return ak}function Ta(e){const t=cet();if(!t)return e;const n=new URL(e,window.location.origin);return new URLSearchParams(t).forEach((i,r)=>{n.searchParams.has(r)||n.searchParams.set(r,i)}),/^https?:\/\//i.test(e)?n.toString():n.pathname+n.search+n.hash}const ho=3e4,hr=12e4,pz=1e4;function po(e,t=ho){if(t<=0)return e??void 0;const n=AbortSignal.timeout(t);return e?AbortSignal.any([e,n]):n}const GR="veadk_local_user",XR="veadk_local_user_tab",uet="X-VeADK-OAuth-Refresh-Retry",det=[50,250],fet=/^[A-Za-z0-9]{1,16}$/;function BAe(){try{const e=sessionStorage.getItem(XR);if(e)return e;const t=localStorage.getItem(GR);return t&&sessionStorage.setItem(XR,t),t}catch{try{return localStorage.getItem(GR)}catch{return null}}}function qZ(e){try{sessionStorage.setItem(XR,e)}catch{}try{localStorage.setItem(GR,e)}catch{}}function het(){try{sessionStorage.removeItem(XR)}catch{}try{localStorage.removeItem(GR)}catch{}}function uc(e){const t=new Headers(e),n=BAe();return n&&t.set("X-VeADK-Local-User",n),t}async function UAe(){let e;try{e=await fetch("/web/auth-config",{headers:ul({Accept:"application/json"}),signal:po(void 0,pz)})}catch(t){throw console.warn("[identity] /web/auth-config is unreachable:",t),new Error(Q("identity.loadConfigNetworkFailed"))}if(!e.ok)throw new Error(Q("identity.configServiceFailed",{status:e.status}));try{const t=await e.json();if(!Array.isArray(t.providers))throw new TypeError("providers is not an array");return t.providers}catch(t){throw console.warn("[identity] /web/auth-config returned an invalid response:",t),new Error(Q("identity.invalidConfigResponse"))}}function pet(e){const t=window.location.pathname+window.location.search+window.location.hash,n=e.includes("?")?"&":"?";window.location.assign(`${e}${n}redirect=${encodeURIComponent(t)}`)}function met(){const e=window.location.pathname+window.location.search+window.location.hash,t=window.open("about:blank","_blank","popup,width=520,height=720");if(!t)return null;try{t.opener=null,t.location.replace(`/oauth2/login?redirect=${encodeURIComponent(e)}`)}catch{return t.close(),null}return t}async function get(){const[e,t]=await Promise.all([N8(),UAe()]);return e.status==="unauthenticated"&&t.length>0}function bet(){window.location.assign("/oauth2/logout")}async function yet(){for(let e=0;;e+=1){let t;try{t=await fetch("/oauth2/userinfo",{headers:ul({Accept:"application/json"}),signal:po(void 0,pz)})}catch(i){throw console.warn("[identity] /oauth2/userinfo is unreachable:",i),new Error(Q("identity.serviceNetworkFailed"))}const n=det[e];if(t.status!==401||t.headers.get(uet)!=="1"||n===void 0)return t;await new Promise(i=>window.setTimeout(i,n))}}async function N8(){const e=await yet();if(e.ok){let n;try{n=await e.json()}catch(r){throw console.warn("[identity] /oauth2/userinfo returned a non-JSON response:",r),new Error(Q("identity.invalidServiceResponse"))}return{status:"authenticated",userId:String(n.sub??n.user_id??n.email??""),info:n}}if(e.status===401)return{status:"unauthenticated",userId:"",local:!1};if(e.status!==404)throw new Error(Q("identity.serviceFailed",{status:e.status}));const t=BAe();return t?{status:"authenticated",userId:t,info:{name:t},local:!0}:{status:"unauthenticated",userId:"",local:!0}}function vet(e){if(!e)return"";for(const t of[e.name,e.preferred_username,e.username,e.email])if(typeof t=="string"&&t.trim())return t.trim();return""}function xet(e){const t=e==null?void 0:e.picture;return typeof t=="string"?t.trim():""}const R8="veadk:authentication-required";let YS=null,lS=null;function wet(e){if(!e.redirected||!e.url)return!1;try{const t=new URL(e.url);return t.pathname.includes("/authorize")||t.pathname.includes("/oauth2/login")||t.hostname.includes(".userpool.auth.")}catch{return!1}}function Oet(e){YS||(YS=new Promise(n=>{lS=n}),window.dispatchEvent(new Event(R8)));const t=YS;return e?e.aborted?Promise.reject(e.reason??new Error("Request aborted")):new Promise((n,i)=>{const r=()=>i(e.reason??new Error("Request aborted"));e.addEventListener("abort",r,{once:!0}),t.then(()=>{e.removeEventListener("abort",r),n()},s=>{e.removeEventListener("abort",r),i(s)})}):t}function ket(){return YS!==null}function Eet(){lS==null||lS(),lS=null,YS=null}async function CD(e,t){var i;const n=await e.text().catch(()=>"");try{return JSON.parse(n)}catch{const r=((i=e.headers.get("content-type"))==null?void 0:i.split(";",1)[0])||Q("common.contentTypeMissing"),s=n.trim().slice(0,2e3),o=s?` -${Q("common.response",{response:s})}`:"";throw new Error(Q("jsonResponse.nonJson",{fallback:t,status:e.status,contentType:r,detail:o}))}}const Cet=/\brun_sse\s*failed\s*:\s*404\b/i,Aet=/session not found/i,Tet=/(?:^|[::\s])not found\s*$/i,_et=/Expecting (?:'[^']+'|\w+)(?: delimiter)?: line \d+ column \d+ \(char \d+\)/i,jet=/Unknown or expired collection_id\s+'[^']+'\.\s*Call collect_resources first\./i,Net=/(?:RateLimitError|\bTPM\b|\bRPM\b|tokens? per minute|requests? per minute)[\s\S]*(?:\b429\b|limit|quota)|\b429\b[\s\S]*(?:model|RateLimitError|\bTPM\b|\bRPM\b)/i;function jv(e,t){return e.includes(t)?e:`${e} + `),()=>{document.head.removeChild(d)}},[t]),a.jsx(cGe,{isPresent:t,childRef:i,sizeRef:r,children:p.cloneElement(e,{ref:i})})}const dGe=({children:e,initial:t,isPresent:n,onExitComplete:i,custom:r,presenceAffectsLayout:s,mode:o})=>{const l=bD(fGe),c=p.useId(),u=p.useCallback(f=>{l.set(f,!0);for(const h of l.values())if(!h)return;i&&i()},[l,i]),d=p.useMemo(()=>({id:c,initial:t,isPresent:n,custom:r,onExitComplete:u,register:f=>(l.set(f,!1),()=>l.delete(f))}),s?[Math.random(),u]:[n,u]);return p.useMemo(()=>{l.forEach((f,h)=>l.set(h,!1))},[n]),p.useEffect(()=>{!n&&!l.size&&i&&i()},[n]),o==="popLayout"&&(e=a.jsx(uGe,{isPresent:n,children:e})),a.jsx(yD.Provider,{value:d,children:e})};function fGe(){return new Map}function sCe(e=!0){const t=p.useContext(yD);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:r}=t,s=p.useId();p.useEffect(()=>{e&&r(s)},[e]);const o=p.useCallback(()=>e&&i&&i(s),[s,i,e]);return!n&&i?[!1,o]:[!0]}const q2=e=>e.key||"";function EY(e){const t=[];return p.Children.forEach(e,n=>{p.isValidElement(n)&&t.push(n)}),t}const MQ=typeof window<"u",aCe=MQ?p.useLayoutEffect:p.useEffect,hf=({children:e,custom:t,initial:n=!0,onExitComplete:i,presenceAffectsLayout:r=!0,mode:s="sync",propagate:o=!1})=>{const[l,c]=sCe(o),u=p.useMemo(()=>EY(e),[e]),d=o&&!l?[]:u.map(q2),f=p.useRef(!0),h=p.useRef(u),m=bD(()=>new Map),[g,b]=p.useState(u),[v,y]=p.useState(u);aCe(()=>{f.current=!1,h.current=u;for(let O=0;O{const k=q2(O),S=o&&!l?!1:u===v||d.includes(k),C=()=>{if(m.has(k))m.set(k,!0);else return;let E=!0;m.forEach(j=>{j||(E=!1)}),E&&(x==null||x(),y(h.current),o&&(c==null||c()),i&&i())};return a.jsx(dGe,{isPresent:S,initial:!f.current||n?void 0:!1,custom:S?void 0:t,presenceAffectsLayout:r,mode:s,onExitComplete:S?void 0:C,children:O},k)})})},_u=e=>e;let oCe=_u;const hGe={useManualTiming:!1};function pGe(e){let t=new Set,n=new Set,i=!1,r=!1;const s=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function l(u){s.has(u)&&(c.schedule(u),e()),u(o)}const c={schedule:(u,d=!1,f=!1)=>{const m=f&&i?t:n;return d&&s.add(u),m.has(u)||m.add(u),u},cancel:u=>{n.delete(u),s.delete(u)},process:u=>{if(o=u,i){r=!0;return}i=!0,[t,n]=[n,t],t.forEach(l),t.clear(),i=!1,r&&(r=!1,c.process(u))}};return c}const W2=["read","resolveKeyframes","update","preRender","render","postRender"],mGe=40;function lCe(e,t){let n=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=W2.reduce((y,w)=>(y[w]=pGe(s),y),{}),{read:l,resolveKeyframes:c,update:u,preRender:d,render:f,postRender:h}=o,m=()=>{const y=performance.now();n=!1,r.delta=i?1e3/60:Math.max(Math.min(y-r.timestamp,mGe),1),r.timestamp=y,r.isProcessing=!0,l.process(r),c.process(r),u.process(r),d.process(r),f.process(r),h.process(r),r.isProcessing=!1,n&&t&&(i=!1,e(m))},g=()=>{n=!0,i=!0,r.isProcessing||e(m)};return{schedule:W2.reduce((y,w)=>{const x=o[w];return y[w]=(O,k=!1,S=!1)=>(n||g(),x.schedule(O,k,S)),y},{}),cancel:y=>{for(let w=0;wCY[e].some(n=>!!t[n])};function gGe(e){for(const t in e)Hw[t]={...Hw[t],...e[t]}}const bGe=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function UR(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||bGe.has(e)}let uCe=e=>!UR(e);function dCe(e){e&&(uCe=t=>t.startsWith("on")?!UR(t):e(t))}try{dCe(require("@emotion/is-prop-valid").default)}catch{}function yGe(e,t,n){const i={};for(const r in e)r==="values"&&typeof e.values=="object"||(uCe(r)||n===!0&&UR(r)||!t&&!UR(r)||e.draggable&&r.startsWith("onDrag"))&&(i[r]=e[r]);return i}function vGe({children:e,isValidProp:t,...n}){t&&dCe(t),n={...p.useContext(ZE),...n},n.isStatic=bD(()=>n.isStatic);const i=p.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return a.jsx(ZE.Provider,{value:i,children:e})}function xGe(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...i)=>e(...i);return new Proxy(n,{get:(i,r)=>r==="create"?e:(t.has(r)||t.set(r,e(r)),t.get(r))})}const vD=p.createContext({});function JE(e){return typeof e=="string"||Array.isArray(e)}function xD(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const LQ=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],$Q=["initial",...LQ];function wD(e){return xD(e.animate)||$Q.some(t=>JE(e[t]))}function fCe(e){return!!(wD(e)||e.variants)}function wGe(e,t){if(wD(e)){const{initial:n,animate:i}=e;return{initial:n===!1||JE(n)?n:void 0,animate:JE(i)?i:void 0}}return e.inherit!==!1?t:{}}function OGe(e){const{initial:t,animate:n}=wGe(e,p.useContext(vD));return p.useMemo(()=>({initial:t,animate:n}),[AY(t),AY(n)])}function AY(e){return Array.isArray(e)?e.join(" "):e}const kGe=Symbol.for("motionComponentSymbol");function Nx(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function SGe(e,t,n){return p.useCallback(i=>{i&&e.onMount&&e.onMount(i),t&&(i?t.mount(i):t.unmount()),n&&(typeof n=="function"?n(i):Nx(n)&&(n.current=i))},[t])}const FQ=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),EGe="framerAppearId",hCe="data-"+FQ(EGe),{schedule:BQ}=lCe(queueMicrotask,!1),pCe=p.createContext({});function CGe(e,t,n,i,r){var s,o;const{visualElement:l}=p.useContext(vD),c=p.useContext(cCe),u=p.useContext(yD),d=p.useContext(ZE).reducedMotion,f=p.useRef(null);i=i||c.renderer,!f.current&&i&&(f.current=i(e,{visualState:t,parent:l,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d}));const h=f.current,m=p.useContext(pCe);h&&!h.projection&&r&&(h.type==="html"||h.type==="svg")&&AGe(f.current,n,r,m);const g=p.useRef(!1);p.useInsertionEffect(()=>{h&&g.current&&h.update(n,u)});const b=n[hCe],v=p.useRef(!!b&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,b))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,b)));return aCe(()=>{h&&(g.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),BQ.render(h.render),v.current&&h.animationState&&h.animationState.animateChanges())}),p.useEffect(()=>{h&&(!v.current&&h.animationState&&h.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)===null||y===void 0||y.call(window,b)}),v.current=!1))}),h}function AGe(e,t,n,i){const{layoutId:r,layout:s,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:mCe(e.parent)),e.projection.setOptions({layoutId:r,layout:s,alwaysMeasureLayout:!!o||l&&Nx(l),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:i,layoutScroll:c,layoutRoot:u})}function mCe(e){if(e)return e.options.allowProjection!==!1?e.projection:mCe(e.parent)}function TGe({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:i,Component:r}){var s,o;e&&gGe(e);function l(u,d){let f;const h={...p.useContext(ZE),...u,layoutId:_Ge(u)},{isStatic:m}=h,g=OGe(u),b=i(u,m);if(!m&&MQ){jGe();const v=NGe(h);f=v.MeasureLayout,g.visualElement=CGe(r,b,h,t,v.ProjectionNode)}return a.jsxs(vD.Provider,{value:g,children:[f&&g.visualElement?a.jsx(f,{visualElement:g.visualElement,...h}):null,n(r,u,SGe(b,g.visualElement,d),b,m,g.visualElement)]})}l.displayName=`motion.${typeof r=="string"?r:`create(${(o=(s=r.displayName)!==null&&s!==void 0?s:r.name)!==null&&o!==void 0?o:""})`}`;const c=p.forwardRef(l);return c[kGe]=r,c}function _Ge({layoutId:e}){const t=p.useContext(DQ).id;return t&&e!==void 0?t+"-"+e:e}function jGe(e,t){p.useContext(cCe).strict}function NGe(e){const{drag:t,layout:n}=Hw;if(!t&&!n)return{};const i={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}const RGe=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function UQ(e){return typeof e!="string"||e.includes("-")?!1:!!(RGe.indexOf(e)>-1||/[A-Z]/u.test(e))}function TY(e){const t=[{},{}];return e==null||e.values.forEach((n,i)=>{t[0][i]=n.get(),t[1][i]=n.getVelocity()}),t}function QQ(e,t,n,i){if(typeof t=="function"){const[r,s]=TY(i);t=t(n!==void 0?n:e.custom,r,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[r,s]=TY(i);t=t(n!==void 0?n:e.custom,r,s)}return t}const f8=e=>Array.isArray(e),IGe=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),PGe=e=>f8(e)?e[e.length-1]||0:e,Al=e=>!!(e&&e.getVelocity);function rN(e){const t=Al(e)?e.get():e;return IGe(t)?t.toValue():t}function DGe({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},i,r,s){const o={latestValues:MGe(i,r,s,e),renderState:t()};return n&&(o.onMount=l=>n({props:i,current:l,...o}),o.onUpdate=l=>n(l)),o}const gCe=e=>(t,n)=>{const i=p.useContext(vD),r=p.useContext(yD),s=()=>DGe(e,t,i,r);return n?s():bD(s)};function MGe(e,t,n,i){const r={},s=i(e,{});for(const h in s)r[h]=rN(s[h]);let{initial:o,animate:l}=e;const c=wD(e),u=fCe(e);t&&u&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const f=d?l:o;if(f&&typeof f!="boolean"&&!xD(f)){const h=Array.isArray(f)?f:[f];for(let m=0;mt=>typeof t=="string"&&t.startsWith(e),yCe=bCe("--"),LGe=bCe("var(--"),zQ=e=>LGe(e)?$Ge.test(e.split("/*")[0].trim()):!1,$Ge=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,vCe=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Kp=(e,t,n)=>n>t?t:ntypeof e=="number",parse:parseFloat,transform:e=>e},eC={...F1,transform:e=>Kp(0,1,e)},K2={...F1,default:1},IA=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),zm=IA("deg"),mh=IA("%"),Gn=IA("px"),FGe=IA("vh"),BGe=IA("vw"),_Y={...mh,parse:e=>mh.parse(e)/100,transform:e=>mh.transform(e*100)},UGe={borderWidth:Gn,borderTopWidth:Gn,borderRightWidth:Gn,borderBottomWidth:Gn,borderLeftWidth:Gn,borderRadius:Gn,radius:Gn,borderTopLeftRadius:Gn,borderTopRightRadius:Gn,borderBottomRightRadius:Gn,borderBottomLeftRadius:Gn,width:Gn,maxWidth:Gn,height:Gn,maxHeight:Gn,top:Gn,right:Gn,bottom:Gn,left:Gn,padding:Gn,paddingTop:Gn,paddingRight:Gn,paddingBottom:Gn,paddingLeft:Gn,margin:Gn,marginTop:Gn,marginRight:Gn,marginBottom:Gn,marginLeft:Gn,backgroundPositionX:Gn,backgroundPositionY:Gn},QGe={rotate:zm,rotateX:zm,rotateY:zm,rotateZ:zm,scale:K2,scaleX:K2,scaleY:K2,scaleZ:K2,skew:zm,skewX:zm,skewY:zm,distance:Gn,translateX:Gn,translateY:Gn,translateZ:Gn,x:Gn,y:Gn,z:Gn,perspective:Gn,transformPerspective:Gn,opacity:eC,originX:_Y,originY:_Y,originZ:Gn},jY={...F1,transform:Math.round},VQ={...UGe,...QGe,zIndex:jY,size:Gn,fillOpacity:eC,strokeOpacity:eC,numOctaves:jY},zGe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},VGe=$1.length;function HGe(e,t,n){let i="",r=!0;for(let s=0;s({style:{},transform:{},transformOrigin:{},vars:{}}),xCe=()=>({...WQ(),attrs:{}}),KQ=e=>typeof e=="string"&&e.toLowerCase()==="svg";function wCe(e,{style:t,vars:n},i,r){Object.assign(e.style,t,r&&r.getProjectionStyles(i));for(const s in n)e.style.setProperty(s,n[s])}const OCe=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function kCe(e,t,n,i){wCe(e,t,void 0,i);for(const r in t.attrs)e.setAttribute(OCe.has(r)?r:FQ(r),t.attrs[r])}const QR={};function XGe(e){Object.assign(QR,e)}function SCe(e,{layout:t,layoutId:n}){return B0.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!QR[e]||e==="opacity")}function GQ(e,t,n){var i;const{style:r}=e,s={};for(const o in r)(Al(r[o])||t.style&&Al(t.style[o])||SCe(o,e)||((i=n==null?void 0:n.getValue(o))===null||i===void 0?void 0:i.liveStyle)!==void 0)&&(s[o]=r[o]);return s}function ECe(e,t,n){const i=GQ(e,t,n);for(const r in e)if(Al(e[r])||Al(t[r])){const s=$1.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;i[s]=e[r]}return i}function YGe(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const RY=["x","y","width","height","cx","cy","r"],ZGe={useVisualState:gCe({scrapeMotionValuesFromProps:ECe,createRenderState:xCe,onUpdate:({props:e,prevProps:t,current:n,renderState:i,latestValues:r})=>{if(!n)return;let s=!!e.drag;if(!s){for(const l in r)if(B0.has(l)){s=!0;break}}if(!s)return;let o=!t;if(t)for(let l=0;l{YGe(n,i),Is.render(()=>{qQ(i,r,KQ(n.tagName),e.transformTemplate),kCe(n,i)})})}})},JGe={useVisualState:gCe({scrapeMotionValuesFromProps:GQ,createRenderState:WQ})};function CCe(e,t,n){for(const i in t)!Al(t[i])&&!SCe(i,n)&&(e[i]=t[i])}function eXe({transformTemplate:e},t){return p.useMemo(()=>{const n=WQ();return HQ(n,t,e),Object.assign({},n.vars,n.style)},[t])}function tXe(e,t){const n=e.style||{},i={};return CCe(i,n,e),Object.assign(i,eXe(e,t)),i}function nXe(e,t){const n={},i=tXe(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=i,n}function iXe(e,t,n,i){const r=p.useMemo(()=>{const s=xCe();return qQ(s,t,KQ(i),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};CCe(s,e.style,e),r.style={...s,...r.style}}return r}function rXe(e=!1){return(n,i,r,{latestValues:s},o)=>{const c=(UQ(n)?iXe:nXe)(i,s,o,n),u=yGe(i,typeof n=="string",e),d=n!==p.Fragment?{...u,...c,ref:r}:{},{children:f}=i,h=p.useMemo(()=>Al(f)?f.get():f,[f]);return p.createElement(n,{...d,children:h})}}function sXe(e,t){return function(i,{forwardMotionProps:r}={forwardMotionProps:!1}){const o={...UQ(i)?ZGe:JGe,preloadedFeatures:e,useRender:rXe(r),createVisualElement:t,Component:i};return TGe(o)}}function ACe(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;i(sN===void 0&&gh.set(Go.isProcessing||hGe.useManualTiming?Go.timestamp:performance.now()),sN),set:e=>{sN=e,queueMicrotask(aXe)}};function YQ(e,t){e.indexOf(t)===-1&&e.push(t)}function ZQ(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class JQ{constructor(){this.subscriptions=[]}add(t){return YQ(this.subscriptions,t),()=>ZQ(this.subscriptions,t)}notify(t,n,i){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](t,n,i);else for(let s=0;s!isNaN(parseFloat(e));class lXe{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(i,r=!0)=>{const s=gh.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),r&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=gh.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=oXe(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new JQ);const i=this.events[t].add(n);return t==="change"?()=>{i(),Is.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,i){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-i}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=gh.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>IY)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,IY);return _Ce(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function tC(e,t){return new lXe(e,t)}function cXe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,tC(n))}function uXe(e,t){const n=OD(e,t);let{transitionEnd:i={},transition:r={},...s}=n||{};s={...s,...i};for(const o in s){const l=PGe(s[o]);cXe(e,o,l)}}function dXe(e){return!!(Al(e)&&e.add)}function h8(e,t){const n=e.getValue("willChange");if(dXe(n))return n.add(t)}function jCe(e){return e.props[hCe]}function ez(e){let t;return()=>(t===void 0&&(t=e()),t)}const fXe=ez(()=>window.ScrollTimeline!==void 0);class hXe{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let i=0;i{if(fXe()&&r.attachTimeline)return r.attachTimeline(t);if(typeof n=="function")return n(r)});return()=>{i.forEach((r,s)=>{r&&r(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;nn[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class pXe extends hXe{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}const Rp=e=>e*1e3,Ip=e=>e/1e3;function tz(e){return typeof e=="function"}function PY(e,t){e.timeline=t,e.onfinish=null}const nz=e=>Array.isArray(e)&&typeof e[0]=="number",mXe={linearEasing:void 0};function gXe(e,t){const n=ez(e);return()=>{var i;return(i=mXe[t])!==null&&i!==void 0?i:n()}}const zR=gXe(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),qw=(e,t,n)=>{const i=t-e;return i===0?1:(n-e)/i},NCe=(e,t,n=10)=>{let i="";const r=Math.max(Math.round(t/n),2);for(let s=0;s`cubic-bezier(${e}, ${t}, ${n}, ${i})`,p8={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:aS([0,.65,.55,1]),circOut:aS([.55,0,1,.45]),backIn:aS([.31,.01,.66,-.59]),backOut:aS([.33,1.53,.69,.99])};function ICe(e,t){if(e)return typeof e=="function"&&zR()?NCe(e,t):nz(e)?aS(e):Array.isArray(e)?e.map(n=>ICe(n,t)||p8.easeOut):p8[e]}const PCe=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,bXe=1e-7,yXe=12;function vXe(e,t,n,i,r){let s,o,l=0;do o=t+(n-t)/2,s=PCe(o,i,r)-e,s>0?n=o:t=o;while(Math.abs(s)>bXe&&++lvXe(s,0,1,e,n);return s=>s===0||s===1?s:PCe(r(s),t,i)}const DCe=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,MCe=e=>t=>1-e(1-t),LCe=PA(.33,1.53,.69,.99),iz=MCe(LCe),$Ce=DCe(iz),FCe=e=>(e*=2)<1?.5*iz(e):.5*(2-Math.pow(2,-10*(e-1))),rz=e=>1-Math.sin(Math.acos(e)),BCe=MCe(rz),UCe=DCe(rz),QCe=e=>/^0[^.\s]+$/u.test(e);function xXe(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||QCe(e):!0}const KS=e=>Math.round(e*1e5)/1e5,sz=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function wXe(e){return e==null}const OXe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,az=(e,t)=>n=>!!(typeof n=="string"&&OXe.test(n)&&n.startsWith(e)||t&&!wXe(n)&&Object.prototype.hasOwnProperty.call(n,t)),zCe=(e,t,n)=>i=>{if(typeof i!="string")return i;const[r,s,o,l]=i.match(sz);return{[e]:parseFloat(r),[t]:parseFloat(s),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},kXe=e=>Kp(0,255,e),d3={...F1,transform:e=>Math.round(kXe(e))},Ty={test:az("rgb","red"),parse:zCe("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+d3.transform(e)+", "+d3.transform(t)+", "+d3.transform(n)+", "+KS(eC.transform(i))+")"};function SXe(e){let t="",n="",i="",r="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),i=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),i=e.substring(3,4),r=e.substring(4,5),t+=t,n+=n,i+=i,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}}const m8={test:az("#"),parse:SXe,transform:Ty.transform},Rx={test:az("hsl","hue"),parse:zCe("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+mh.transform(KS(t))+", "+mh.transform(KS(n))+", "+KS(eC.transform(i))+")"},Sl={test:e=>Ty.test(e)||m8.test(e)||Rx.test(e),parse:e=>Ty.test(e)?Ty.parse(e):Rx.test(e)?Rx.parse(e):m8.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ty.transform(e):Rx.transform(e)},EXe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function CXe(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(sz))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(EXe))===null||n===void 0?void 0:n.length)||0)>0}const VCe="number",HCe="color",AXe="var",TXe="var(",DY="${}",_Xe=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function nC(e){const t=e.toString(),n=[],i={color:[],number:[],var:[]},r=[];let s=0;const l=t.replace(_Xe,c=>(Sl.test(c)?(i.color.push(s),r.push(HCe),n.push(Sl.parse(c))):c.startsWith(TXe)?(i.var.push(s),r.push(AXe),n.push(c)):(i.number.push(s),r.push(VCe),n.push(parseFloat(c))),++s,DY)).split(DY);return{values:n,split:l,indexes:i,types:r}}function qCe(e){return nC(e).values}function WCe(e){const{split:t,types:n}=nC(e),i=t.length;return r=>{let s="";for(let o=0;otypeof e=="number"?0:e;function NXe(e){const t=qCe(e);return WCe(e)(t.map(jXe))}const Gg={test:CXe,parse:qCe,createTransformer:WCe,getAnimatableNone:NXe},RXe=new Set(["brightness","contrast","saturate","opacity"]);function IXe(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=n.match(sz)||[];if(!i)return e;const r=n.replace(i,"");let s=RXe.has(t)?1:0;return i!==n&&(s*=100),t+"("+s+r+")"}const PXe=/\b([a-z-]*)\(.*?\)/gu,g8={...Gg,getAnimatableNone:e=>{const t=e.match(PXe);return t?t.map(IXe).join(" "):e}},DXe={...VQ,color:Sl,backgroundColor:Sl,outlineColor:Sl,fill:Sl,stroke:Sl,borderColor:Sl,borderTopColor:Sl,borderRightColor:Sl,borderBottomColor:Sl,borderLeftColor:Sl,filter:g8,WebkitFilter:g8},oz=e=>DXe[e];function KCe(e,t){let n=oz(e);return n!==g8&&(n=Gg),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const MXe=new Set(["auto","none","0"]);function LXe(e,t,n){let i=0,r;for(;ie===F1||e===Gn,LY=(e,t)=>parseFloat(e.split(", ")[t]),$Y=(e,t)=>(n,{transform:i})=>{if(i==="none"||!i)return 0;const r=i.match(/^matrix3d\((.+)\)$/u);if(r)return LY(r[1],t);{const s=i.match(/^matrix\((.+)\)$/u);return s?LY(s[1],e):0}},$Xe=new Set(["x","y","z"]),FXe=$1.filter(e=>!$Xe.has(e));function BXe(e){const t=[];return FXe.forEach(n=>{const i=e.getValue(n);i!==void 0&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t}const Ww={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:$Y(4,13),y:$Y(5,14)};Ww.translateX=Ww.x;Ww.translateY=Ww.y;const Ky=new Set;let b8=!1,y8=!1;function GCe(){if(y8){const e=Array.from(Ky).filter(i=>i.needsMeasurement),t=new Set(e.map(i=>i.element)),n=new Map;t.forEach(i=>{const r=BXe(i);r.length&&(n.set(i,r),i.render())}),e.forEach(i=>i.measureInitialState()),t.forEach(i=>{i.render();const r=n.get(i);r&&r.forEach(([s,o])=>{var l;(l=i.getValue(s))===null||l===void 0||l.set(o)})}),e.forEach(i=>i.measureEndState()),e.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}y8=!1,b8=!1,Ky.forEach(e=>e.complete()),Ky.clear()}function XCe(){Ky.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(y8=!0)})}function UXe(){XCe(),GCe()}class lz{constructor(t,n,i,r,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=i,this.motionValue=r,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ky.add(this),b8||(b8=!0,Is.read(XCe),Is.resolveKeyframes(GCe))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:i,motionValue:r}=this;for(let s=0;s/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),QXe=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function zXe(e){const t=QXe.exec(e);if(!t)return[,];const[,n,i,r]=t;return[`--${n??i}`,r]}function ZCe(e,t,n=1){const[i,r]=zXe(e);if(!i)return;const s=window.getComputedStyle(t).getPropertyValue(i);if(s){const o=s.trim();return YCe(o)?parseFloat(o):o}return zQ(r)?ZCe(r,t,n+1):r}const JCe=e=>t=>t.test(e),VXe={test:e=>e==="auto",parse:e=>e},eAe=[F1,Gn,mh,zm,BGe,FGe,VXe],FY=e=>eAe.find(JCe(e));class tAe extends lz{constructor(t,n,i,r,s){super(t,n,i,r,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:i}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c{n.getValue(c).set(u)}),this.resolveNoneKeyframes()}}const BY=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Gg.test(e)||e==="0")&&!e.startsWith("url("));function HXe(e){const t=e[0];if(e.length===1)return!0;for(let n=0;ne!==null;function kD(e,{repeat:t,repeatType:n="loop"},i){const r=e.filter(WXe),s=t&&n!=="loop"&&t%2===1?0:r.length-1;return!s||i===void 0?r[s]:i}const KXe=40;class nAe{constructor({autoplay:t=!0,delay:n=0,type:i="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:o="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=gh.now(),this.options={autoplay:t,delay:n,type:i,repeat:r,repeatDelay:s,repeatType:o,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>KXe?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&UXe(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=gh.now(),this.hasAttemptedResolve=!0;const{name:i,type:r,velocity:s,delay:o,onComplete:l,onUpdate:c,isGenerator:u}=this.options;if(!u&&!qXe(t,i,r,s))if(o)this.options.duration=0;else{c&&c(kD(t,this.options,n)),l&&l(),this.resolveFinishedPromise();return}const d=this.initPlayback(t,n);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...d},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const v8=2e4;function iAe(e){let t=0;const n=50;let i=e.next(t);for(;!i.done&&t=v8?1/0:t}const ea=(e,t,n)=>e+(t-e)*n;function f3(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function GXe({hue:e,saturation:t,lightness:n,alpha:i}){e/=360,t/=100,n/=100;let r=0,s=0,o=0;if(!t)r=s=o=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;r=f3(c,l,e+1/3),s=f3(c,l,e),o=f3(c,l,e-1/3)}return{red:Math.round(r*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:i}}function VR(e,t){return n=>n>0?t:e}const h3=(e,t,n)=>{const i=e*e,r=n*(t*t-i)+i;return r<0?0:Math.sqrt(r)},XXe=[m8,Ty,Rx],YXe=e=>XXe.find(t=>t.test(e));function UY(e){const t=YXe(e);if(!t)return!1;let n=t.parse(e);return t===Rx&&(n=GXe(n)),n}const QY=(e,t)=>{const n=UY(e),i=UY(t);if(!n||!i)return VR(e,t);const r={...n};return s=>(r.red=h3(n.red,i.red,s),r.green=h3(n.green,i.green,s),r.blue=h3(n.blue,i.blue,s),r.alpha=ea(n.alpha,i.alpha,s),Ty.transform(r))},ZXe=(e,t)=>n=>t(e(n)),DA=(...e)=>e.reduce(ZXe),x8=new Set(["none","hidden"]);function JXe(e,t){return x8.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function eYe(e,t){return n=>ea(e,t,n)}function cz(e){return typeof e=="number"?eYe:typeof e=="string"?zQ(e)?VR:Sl.test(e)?QY:iYe:Array.isArray(e)?rAe:typeof e=="object"?Sl.test(e)?QY:tYe:VR}function rAe(e,t){const n=[...e],i=n.length,r=e.map((s,o)=>cz(s)(s,t[o]));return s=>{for(let o=0;o{for(const s in i)n[s]=i[s](r);return n}}function nYe(e,t){var n;const i=[],r={color:0,var:0,number:0};for(let s=0;s{const n=Gg.createTransformer(t),i=nC(e),r=nC(t);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?x8.has(e)&&!r.values.length||x8.has(t)&&!i.values.length?JXe(e,t):DA(rAe(nYe(i,r),r.values),n):VR(e,t)};function sAe(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ea(e,t,n):cz(e)(e,t)}const rYe=5;function aAe(e,t,n){const i=Math.max(t-rYe,0);return _Ce(n-e(i),t-i)}const ca={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},p3=.001;function sYe({duration:e=ca.duration,bounce:t=ca.bounce,velocity:n=ca.velocity,mass:i=ca.mass}){let r,s,o=1-t;o=Kp(ca.minDamping,ca.maxDamping,o),e=Kp(ca.minDuration,ca.maxDuration,Ip(e)),o<1?(r=u=>{const d=u*o,f=d*e,h=d-n,m=w8(u,o),g=Math.exp(-f);return p3-h/m*g},s=u=>{const f=u*o*e,h=f*n+n,m=Math.pow(o,2)*Math.pow(u,2)*e,g=Math.exp(-f),b=w8(Math.pow(u,2),o);return(-r(u)+p3>0?-1:1)*((h-m)*g)/b}):(r=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-p3+d*f},s=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const l=5/e,c=oYe(r,s,l);if(e=Rp(e),isNaN(c))return{stiffness:ca.stiffness,damping:ca.damping,duration:e};{const u=Math.pow(c,2)*i;return{stiffness:u,damping:o*2*Math.sqrt(i*u),duration:e}}}const aYe=12;function oYe(e,t,n){let i=n;for(let r=1;re[n]!==void 0)}function uYe(e){let t={velocity:ca.velocity,stiffness:ca.stiffness,damping:ca.damping,mass:ca.mass,isResolvedFromDuration:!1,...e};if(!zY(e,cYe)&&zY(e,lYe))if(e.visualDuration){const n=e.visualDuration,i=2*Math.PI/(n*1.2),r=i*i,s=2*Kp(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:ca.mass,stiffness:r,damping:s}}else{const n=sYe(e);t={...t,...n,mass:ca.mass},t.isResolvedFromDuration=!0}return t}function oAe(e=ca.visualDuration,t=ca.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:i,restDelta:r}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:s},{stiffness:c,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:m}=uYe({...n,velocity:-Ip(n.velocity||0)}),g=h||0,b=u/(2*Math.sqrt(c*d)),v=o-s,y=Ip(Math.sqrt(c/d)),w=Math.abs(v)<5;i||(i=w?ca.restSpeed.granular:ca.restSpeed.default),r||(r=w?ca.restDelta.granular:ca.restDelta.default);let x;if(b<1){const k=w8(y,b);x=S=>{const C=Math.exp(-b*y*S);return o-C*((g+b*y*v)/k*Math.sin(k*S)+v*Math.cos(k*S))}}else if(b===1)x=k=>o-Math.exp(-y*k)*(v+(g+y*v)*k);else{const k=y*Math.sqrt(b*b-1);x=S=>{const C=Math.exp(-b*y*S),E=Math.min(k*S,300);return o-C*((g+b*y*v)*Math.sinh(E)+k*v*Math.cosh(E))/k}}const O={calculatedDuration:m&&f||null,next:k=>{const S=x(k);if(m)l.done=k>=f;else{let C=0;b<1&&(C=k===0?Rp(g):aAe(x,k,S));const E=Math.abs(C)<=i,j=Math.abs(o-S)<=r;l.done=E&&j}return l.value=l.done?o:S,l},toString:()=>{const k=Math.min(iAe(O),v8),S=NCe(C=>O.next(k*C).value,k,30);return k+"ms "+S}};return O}function VY({keyframes:e,velocity:t=0,power:n=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:s=500,modifyTarget:o,min:l,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},m=E=>l!==void 0&&Ec,g=E=>l===void 0?c:c===void 0||Math.abs(l-E)-b*Math.exp(-E/i),x=E=>y+w(E),O=E=>{const j=w(E),T=x(E);h.done=Math.abs(j)<=u,h.value=h.done?y:T};let k,S;const C=E=>{m(h.value)&&(k=E,S=oAe({keyframes:[h.value,g(h.value)],velocity:aAe(x,E,h.value),damping:r,stiffness:s,restDelta:u,restSpeed:d}))};return C(0),{calculatedDuration:null,next:E=>{let j=!1;return!S&&k===void 0&&(j=!0,O(E),C(E)),k!==void 0&&E>=k?S.next(E-k):(!j&&O(E),h)}}}const dYe=PA(.42,0,1,1),fYe=PA(0,0,.58,1),lAe=PA(.42,0,.58,1),hYe=e=>Array.isArray(e)&&typeof e[0]!="number",pYe={linear:_u,easeIn:dYe,easeInOut:lAe,easeOut:fYe,circIn:rz,circInOut:UCe,circOut:BCe,backIn:iz,backInOut:$Ce,backOut:LCe,anticipate:FCe},HY=e=>{if(nz(e)){oCe(e.length===4);const[t,n,i,r]=e;return PA(t,n,i,r)}else if(typeof e=="string")return pYe[e];return e};function mYe(e,t,n){const i=[],r=n||sAe,s=e.length-1;for(let o=0;ot[0];if(s===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=mYe(t,i,r),c=l.length,u=d=>{if(o&&d1)for(;fu(Kp(e[0],e[s-1],d)):u}function bYe(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const r=qw(0,t,i);e.push(ea(n,1,r))}}function yYe(e){const t=[0];return bYe(t,e.length-1),t}function vYe(e,t){return e.map(n=>n*t)}function xYe(e,t){return e.map(()=>t||lAe).splice(0,e.length-1)}function HR({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const r=hYe(i)?i.map(HY):HY(i),s={done:!1,value:t[0]},o=vYe(n&&n.length===t.length?n:yYe(t),e),l=gYe(o,t,{ease:Array.isArray(r)?r:xYe(t,r)});return{calculatedDuration:e,next:c=>(s.value=l(c),s.done=c>=e,s)}}const wYe=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Is.update(t,!0),stop:()=>Kg(t),now:()=>Go.isProcessing?Go.timestamp:gh.now()}},OYe={decay:VY,inertia:VY,tween:HR,keyframes:HR,spring:oAe},kYe=e=>e/100;class uz extends nAe{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:c}=this.options;c&&c()};const{name:n,motionValue:i,element:r,keyframes:s}=this.options,o=(r==null?void 0:r.KeyframeResolver)||lz,l=(c,u)=>this.onKeyframesResolved(c,u);this.resolver=new o(s,l,n,i,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:s,velocity:o=0}=this.options,l=tz(n)?n:OYe[n]||HR;let c,u;l!==HR&&typeof t[0]!="number"&&(c=DA(kYe,sAe(t[0],t[1])),t=[0,100]);const d=l({...this.options,keyframes:t});s==="mirror"&&(u=l({...this.options,keyframes:[...t].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=iAe(d));const{calculatedDuration:f}=d,h=f+r,m=h*(i+1)-r;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:c,calculatedDuration:f,resolvedDuration:h,totalDuration:m}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:i}=this;if(!i){const{keyframes:E}=this.options;return{done:!0,value:E[E.length-1]}}const{finalKeyframe:r,generator:s,mirroredGenerator:o,mapPercentToKeyframes:l,keyframes:c,calculatedDuration:u,totalDuration:d,resolvedDuration:f}=i;if(this.startTime===null)return s.next(0);const{delay:h,repeat:m,repeatType:g,repeatDelay:b,onUpdate:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const y=this.currentTime-h*(this.speed>=0?1:-1),w=this.speed>=0?y<0:y>d;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let x=this.currentTime,O=s;if(m){const E=Math.min(this.currentTime,d)/f;let j=Math.floor(E),T=E%1;!T&&E>=1&&(T=1),T===1&&j--,j=Math.min(j,m+1),!!(j%2)&&(g==="reverse"?(T=1-T,b&&(T-=b/f)):g==="mirror"&&(O=o)),x=Kp(0,1,T)*f}const k=w?{done:!1,value:c[0]}:O.next(x);l&&(k.value=l(k.value));let{done:S}=k;!w&&u!==null&&(S=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&S);return C&&r!==void 0&&(k.value=kD(c,this.options,r)),v&&v(k.value),C&&this.finish(),k}get duration(){const{resolved:t}=this;return t?Ip(t.calculatedDuration):0}get time(){return Ip(this.currentTime)}set time(t){t=Rp(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Ip(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=wYe,onPlay:n,startTime:i}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),n&&n();const r=this.driver.now();this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=r):this.startTime=i??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const SYe=new Set(["opacity","clipPath","filter","transform"]);function EYe(e,t,n,{delay:i=0,duration:r=300,repeat:s=0,repeatType:o="loop",ease:l="easeInOut",times:c}={}){const u={[t]:n};c&&(u.offset=c);const d=ICe(l,r);return Array.isArray(d)&&(u.easing=d),e.animate(u,{delay:i,duration:r,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}const CYe=ez(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),qR=10,AYe=2e4;function TYe(e){return tz(e.type)||e.type==="spring"||!RCe(e.ease)}function _Ye(e,t){const n=new uz({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let i={done:!1,value:e[0]};const r=[];let s=0;for(;!i.done&&sthis.onKeyframesResolved(o,l),n,i,r),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:i=300,times:r,ease:s,type:o,motionValue:l,name:c,startTime:u}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof s=="string"&&zR()&&jYe(s)&&(s=cAe[s]),TYe(this.options)){const{onComplete:f,onUpdate:h,motionValue:m,element:g,...b}=this.options,v=_Ye(t,b);t=v.keyframes,t.length===1&&(t[1]=t[0]),i=v.duration,r=v.times,s=v.ease,o="keyframes"}const d=EYe(l.owner.current,c,t,{...this.options,duration:i,times:r,ease:s});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(PY(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;l.set(kD(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:i,times:r,type:o,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return Ip(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Ip(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:i}=n;i.currentTime=Rp(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:i}=n;i.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return _u;const{animation:i}=n;PY(i,t)}return _u}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:i,duration:r,type:s,ease:o,times:l}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:d,onComplete:f,element:h,...m}=this.options,g=new uz({...m,keyframes:i,duration:r,type:s,ease:o,times:l,isGenerator:!0}),b=Rp(this.time);u.setWithVelocity(g.sample(b-qR).value,g.sample(b).value,qR)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:i,repeatDelay:r,repeatType:s,damping:o,type:l}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=n.owner.getProps();return CYe()&&i&&SYe.has(i)&&!c&&!u&&!r&&s!=="mirror"&&o!==0&&l!=="inertia"}}const NYe={type:"spring",stiffness:500,damping:25,restSpeed:10},RYe=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),IYe={type:"keyframes",duration:.8},PYe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},DYe=(e,{keyframes:t})=>t.length>2?IYe:B0.has(e)?e.startsWith("scale")?RYe(t[1]):NYe:PYe;function MYe({when:e,delay:t,delayChildren:n,staggerChildren:i,staggerDirection:r,repeat:s,repeatType:o,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const dz=(e,t,n,i={},r,s)=>o=>{const l=XQ(i,e)||{},c=l.delay||i.delay||0;let{elapsed:u=0}=i;u=u-Rp(c);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:h=>{t.set(h),l.onUpdate&&l.onUpdate(h)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:s?void 0:r};MYe(l)||(d={...d,...DYe(e,d)}),d.duration&&(d.duration=Rp(d.duration)),d.repeatDelay&&(d.repeatDelay=Rp(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(f=!0)),f&&!s&&t.get()!==void 0){const h=kD(d.keyframes,l);if(h!==void 0)return Is.update(()=>{d.onUpdate(h),d.onComplete()}),new pXe([])}return!s&&qY.supports(d)?new qY(d):new uz(d)};function LYe({protectedKeys:e,needsAnimating:t},n){const i=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,i}function uAe(e,t,{delay:n=0,transitionOverride:i,type:r}={}){var s;let{transition:o=e.getDefaultTransition(),transitionEnd:l,...c}=t;i&&(o=i);const u=[],d=r&&e.animationState&&e.animationState.getState()[r];for(const f in c){const h=e.getValue(f,(s=e.latestValues[f])!==null&&s!==void 0?s:null),m=c[f];if(m===void 0||d&&LYe(d,f))continue;const g={delay:n,...XQ(o||{},f)};let b=!1;if(window.MotionHandoffAnimation){const y=jCe(e);if(y){const w=window.MotionHandoffAnimation(y,f,Is);w!==null&&(g.startTime=w,b=!0)}}h8(e,f),h.start(dz(f,h,m,e.shouldReduceMotion&&TCe.has(f)?{type:!1}:g,e,b));const v=h.animation;v&&u.push(v)}return l&&Promise.all(u).then(()=>{Is.update(()=>{l&&uXe(e,l)})}),u}function O8(e,t,n={}){var i;const r=OD(e,t,n.type==="exit"?(i=e.presenceContext)===null||i===void 0?void 0:i.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const o=r?()=>Promise.all(uAe(e,r,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=s;return $Ye(e,t,d+u,f,h,n)}:()=>Promise.resolve(),{when:c}=s;if(c){const[u,d]=c==="beforeChildren"?[o,l]:[l,o];return u().then(()=>d())}else return Promise.all([o(),l(n.delay)])}function $Ye(e,t,n=0,i=0,r=1,s){const o=[],l=(e.variantChildren.size-1)*i,c=r===1?(u=0)=>u*i:(u=0)=>l-u*i;return Array.from(e.variantChildren).sort(FYe).forEach((u,d)=>{u.notify("AnimationStart",t),o.push(O8(u,t,{...s,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(o)}function FYe(e,t){return e.sortNodePosition(t)}function BYe(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const r=t.map(s=>O8(e,s,n));i=Promise.all(r)}else if(typeof t=="string")i=O8(e,t,n);else{const r=typeof t=="function"?OD(e,t,n.custom):t;i=Promise.all(uAe(e,r,n))}return i.then(()=>{e.notify("AnimationComplete",t)})}const UYe=$Q.length;function dAe(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?dAe(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;nPromise.all(t.map(({animation:n,options:i})=>BYe(e,n,i)))}function HYe(e){let t=VYe(e),n=WY(),i=!0;const r=c=>(u,d)=>{var f;const h=OD(e,d,c==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:m,transitionEnd:g,...b}=h;u={...u,...b,...g}}return u};function s(c){t=c(e)}function o(c){const{props:u}=e,d=dAe(e.parent)||{},f=[],h=new Set;let m={},g=1/0;for(let v=0;vg&&O,j=!1;const T=Array.isArray(x)?x:[x];let R=T.reduce(r(y),{});k===!1&&(R={});const{prevResolvedValues:A={}}=w,N={...A,...R},D=_=>{E=!0,h.has(_)&&(j=!0,h.delete(_)),w.needsAnimating[_]=!0;const L=e.getValue(_);L&&(L.liveStyle=!1)};for(const _ in N){const L=R[_],F=A[_];if(m.hasOwnProperty(_))continue;let M=!1;f8(L)&&f8(F)?M=!ACe(L,F):M=L!==F,M?L!=null?D(_):h.add(_):L!==void 0&&h.has(_)?D(_):w.protectedKeys[_]=!0}w.prevProp=x,w.prevResolvedValues=R,w.isActive&&(m={...m,...R}),i&&e.blockInitialAnimation&&(E=!1),E&&(!(S&&C)||j)&&f.push(...T.map(_=>({animation:_,options:{type:y}})))}if(h.size){const v={};h.forEach(y=>{const w=e.getBaseTarget(y),x=e.getValue(y);x&&(x.liveStyle=!0),v[y]=w??null}),f.push({animation:v})}let b=!!f.length;return i&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(b=!1),i=!1,b?t(f):Promise.resolve()}function l(c,u){var d;if(n[c].isActive===u)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(h=>{var m;return(m=h.animationState)===null||m===void 0?void 0:m.setActive(c,u)}),n[c].isActive=u;const f=o(c);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:o,setActive:l,setAnimateFunction:s,getState:()=>n,reset:()=>{n=WY(),i=!0}}}function qYe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!ACe(t,e):!1}function Wb(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function WY(){return{animate:Wb(!0),whileInView:Wb(),whileHover:Wb(),whileTap:Wb(),whileDrag:Wb(),whileFocus:Wb(),exit:Wb()}}class Sb{constructor(t){this.isMounted=!1,this.node=t}update(){}}class WYe extends Sb{constructor(t){super(t),t.animationState||(t.animationState=HYe(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();xD(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let KYe=0;class GYe extends Sb{constructor(){super(...arguments),this.id=KYe++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;const r=this.node.animationState.setActive("exit",!t);n&&!t&&r.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const XYe={animation:{Feature:WYe},exit:{Feature:GYe}},Zd={x:!1,y:!1};function fAe(){return Zd.x||Zd.y}function YYe(e){return e==="x"||e==="y"?Zd[e]?null:(Zd[e]=!0,()=>{Zd[e]=!1}):Zd.x||Zd.y?null:(Zd.x=Zd.y=!0,()=>{Zd.x=Zd.y=!1})}const fz=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function iC(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}function MA(e){return{point:{x:e.pageX,y:e.pageY}}}const ZYe=e=>t=>fz(t)&&e(t,MA(t));function GS(e,t,n,i){return iC(e,t,ZYe(n),i)}const KY=(e,t)=>Math.abs(e-t);function JYe(e,t){const n=KY(e.x,t.x),i=KY(e.y,t.y);return Math.sqrt(n**2+i**2)}class hAe{constructor(t,n,{transformPagePoint:i,contextWindow:r,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=g3(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,m=JYe(f.offset,{x:0,y:0})>=3;if(!h&&!m)return;const{point:g}=f,{timestamp:b}=Go;this.history.push({...g,timestamp:b});const{onStart:v,onMove:y}=this.handlers;h||(v&&v(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=m3(h,this.transformPagePoint),Is.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{this.end();const{onEnd:m,onSessionEnd:g,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=g3(f.type==="pointercancel"?this.lastMoveEventInfo:m3(h,this.transformPagePoint),this.history);this.startEvent&&m&&m(f,v),g&&g(f,v)},!fz(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=i,this.contextWindow=r||window;const o=MA(t),l=m3(o,this.transformPagePoint),{point:c}=l,{timestamp:u}=Go;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,g3(l,this.history)),this.removeListeners=DA(GS(this.contextWindow,"pointermove",this.handlePointerMove),GS(this.contextWindow,"pointerup",this.handlePointerUp),GS(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Kg(this.updatePoint)}}function m3(e,t){return t?{point:t(e.point)}:e}function GY(e,t){return{x:e.x-t.x,y:e.y-t.y}}function g3({point:e},t){return{point:e,delta:GY(e,pAe(t)),offset:GY(e,eZe(t)),velocity:tZe(t,.1)}}function eZe(e){return e[0]}function pAe(e){return e[e.length-1]}function tZe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const r=pAe(e);for(;n>=0&&(i=e[n],!(r.timestamp-i.timestamp>Rp(t)));)n--;if(!i)return{x:0,y:0};const s=Ip(r.timestamp-i.timestamp);if(s===0)return{x:0,y:0};const o={x:(r.x-i.x)/s,y:(r.y-i.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const mAe=1e-4,nZe=1-mAe,iZe=1+mAe,gAe=.01,rZe=0-gAe,sZe=0+gAe;function Mu(e){return e.max-e.min}function aZe(e,t,n){return Math.abs(e-t)<=n}function XY(e,t,n,i=.5){e.origin=i,e.originPoint=ea(t.min,t.max,e.origin),e.scale=Mu(n)/Mu(t),e.translate=ea(n.min,n.max,e.origin)-e.originPoint,(e.scale>=nZe&&e.scale<=iZe||isNaN(e.scale))&&(e.scale=1),(e.translate>=rZe&&e.translate<=sZe||isNaN(e.translate))&&(e.translate=0)}function XS(e,t,n,i){XY(e.x,t.x,n.x,i?i.originX:void 0),XY(e.y,t.y,n.y,i?i.originY:void 0)}function YY(e,t,n){e.min=n.min+t.min,e.max=e.min+Mu(t)}function oZe(e,t,n){YY(e.x,t.x,n.x),YY(e.y,t.y,n.y)}function ZY(e,t,n){e.min=t.min-n.min,e.max=e.min+Mu(t)}function YS(e,t,n){ZY(e.x,t.x,n.x),ZY(e.y,t.y,n.y)}function lZe(e,{min:t,max:n},i){return t!==void 0&&en&&(e=i?ea(n,e,i.max):Math.min(e,n)),e}function JY(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function cZe(e,{top:t,left:n,bottom:i,right:r}){return{x:JY(e.x,n,r),y:JY(e.y,t,i)}}function eZ(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.mini?n=qw(t.min,t.max-i,e.min):i>r&&(n=qw(e.min,e.max-r,t.min)),Kp(0,1,n)}function fZe(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const k8=.35;function hZe(e=k8){return e===!1?e=0:e===!0&&(e=k8),{x:tZ(e,"left","right"),y:tZ(e,"top","bottom")}}function tZ(e,t,n){return{min:nZ(e,t),max:nZ(e,n)}}function nZ(e,t){return typeof e=="number"?e:e[t]||0}const iZ=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ix=()=>({x:iZ(),y:iZ()}),rZ=()=>({min:0,max:0}),ya=()=>({x:rZ(),y:rZ()});function Zu(e){return[e("x"),e("y")]}function bAe({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function pZe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function mZe(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function b3(e){return e===void 0||e===1}function S8({scale:e,scaleX:t,scaleY:n}){return!b3(e)||!b3(t)||!b3(n)}function uy(e){return S8(e)||yAe(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function yAe(e){return sZ(e.x)||sZ(e.y)}function sZ(e){return e&&e!=="0%"}function WR(e,t,n){const i=e-n,r=t*i;return n+r}function aZ(e,t,n,i,r){return r!==void 0&&(e=WR(e,r,i)),WR(e,n,i)+t}function E8(e,t=0,n=1,i,r){e.min=aZ(e.min,t,n,i,r),e.max=aZ(e.max,t,n,i,r)}function vAe(e,{x:t,y:n}){E8(e.x,t.translate,t.scale,t.originPoint),E8(e.y,n.translate,n.scale,n.originPoint)}const oZ=.999999999999,lZ=1.0000000000001;function gZe(e,t,n,i=!1){const r=n.length;if(!r)return;t.x=t.y=1;let s,o;for(let l=0;loZ&&(t.x=1),t.yoZ&&(t.y=1)}function Px(e,t){e.min=e.min+t,e.max=e.max+t}function cZ(e,t,n,i,r=.5){const s=ea(e.min,e.max,r);E8(e,t,n,s,i)}function Dx(e,t){cZ(e.x,t.x,t.scaleX,t.scale,t.originX),cZ(e.y,t.y,t.scaleY,t.scale,t.originY)}function xAe(e,t){return bAe(mZe(e.getBoundingClientRect(),t))}function bZe(e,t,n){const i=xAe(e,n),{scroll:r}=t;return r&&(Px(i.x,r.offset.x),Px(i.y,r.offset.y)),i}const wAe=({current:e})=>e?e.ownerDocument.defaultView:null,yZe=new WeakMap;class vZe{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ya(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(MA(d).point)},s=(d,f)=>{const{drag:h,dragPropagation:m,onDragStart:g}=this.getProps();if(h&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=YYe(h),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Zu(v=>{let y=this.getAxisMotionValue(v).get()||0;if(mh.test(y)){const{projection:w}=this.visualElement;if(w&&w.layout){const x=w.layout.layoutBox[v];x&&(y=Mu(x)*(parseFloat(y)/100))}}this.originPoint[v]=y}),g&&Is.postRender(()=>g(d,f)),h8(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},o=(d,f)=>{const{dragPropagation:h,dragDirectionLock:m,onDirectionLock:g,onDrag:b}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:v}=f;if(m&&this.currentDirection===null){this.currentDirection=xZe(v),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,v),this.updateAxis("y",f.point,v),this.visualElement.render(),b&&b(d,f)},l=(d,f)=>this.stop(d,f),c=()=>Zu(d=>{var f;return this.getAnimationState(d)==="paused"&&((f=this.getAxisMotionValue(d).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new hAe(t,{onSessionStart:r,onStart:s,onMove:o,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:wAe(this.visualElement)})}stop(t,n){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:r}=n;this.startAnimation(r);const{onDragEnd:s}=this.getProps();s&&Is.postRender(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,i){const{drag:r}=this.getProps();if(!i||!G2(t,r,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(o=lZe(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:i}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,s=this.constraints;n&&Nx(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&r?this.constraints=cZe(r.layoutBox,n):this.constraints=!1,this.elastic=hZe(i),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Zu(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=fZe(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Nx(t))return!1;const i=t.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const s=bZe(i,r.root,this.visualElement.getTransformPagePoint());let o=uZe(r.layout.layoutBox,s);if(n){const l=n(pZe(o));this.hasMutatedConstraints=!!l,l&&(o=bAe(l))}return o}startAnimation(t){const{drag:n,dragMomentum:i,dragElastic:r,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Zu(d=>{if(!G2(d,n,this.currentDirection))return;let f=c&&c[d]||{};o&&(f={min:0,max:0});const h=r?200:1e6,m=r?40:1e7,g={type:"inertia",velocity:i?t[d]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(d,g)});return Promise.all(u).then(l)}startAxisValueAnimation(t,n){const i=this.getAxisMotionValue(t);return h8(this.visualElement,t),i.start(dz(t,i,0,n,this.visualElement,!1))}stopAnimation(){Zu(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Zu(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps(),r=i[n];return r||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){Zu(n=>{const{drag:i}=this.getProps();if(!G2(n,i,this.currentDirection))return;const{projection:r}=this.visualElement,s=this.getAxisMotionValue(n);if(r&&r.layout){const{min:o,max:l}=r.layout.layoutBox[n];s.set(t[n]-ea(o,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!Nx(n)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Zu(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();r[o]=dZe({min:c,max:c},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),Zu(o=>{if(!G2(o,t,null))return;const l=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];l.set(ea(c,u,r[o]))})}addListeners(){if(!this.visualElement.current)return;yZe.set(this.visualElement,this);const t=this.visualElement.current,n=GS(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),i=()=>{const{dragConstraints:c}=this.getProps();Nx(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,s=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),Is.read(i);const o=iC(window,"resize",()=>this.scalePositionWithinConstraints()),l=r.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Zu(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=c[d].translate,f.set(f.get()+c[d].translate))}),this.visualElement.render())});return()=>{o(),n(),s(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:s=!1,dragElastic:o=k8,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:r,dragConstraints:s,dragElastic:o,dragMomentum:l}}}function G2(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function xZe(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class wZe extends Sb{constructor(t){super(t),this.removeGroupControls=_u,this.removeListeners=_u,this.controls=new vZe(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||_u}unmount(){this.removeGroupControls(),this.removeListeners()}}const uZ=e=>(t,n)=>{e&&Is.postRender(()=>e(t,n))};class OZe extends Sb{constructor(){super(...arguments),this.removePointerDownListener=_u}onPointerDown(t){this.session=new hAe(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:wAe(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:uZ(t),onStart:uZ(n),onMove:i,onEnd:(s,o)=>{delete this.session,r&&Is.postRender(()=>r(s,o))}}}mount(){this.removePointerDownListener=GS(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const aN={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function dZ(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const ak={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Gn.test(e))e=parseFloat(e);else return e;const n=dZ(e,t.target.x),i=dZ(e,t.target.y);return`${n}% ${i}%`}},kZe={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,r=Gg.parse(e);if(r.length>5)return i;const s=Gg.createTransformer(e),o=typeof r[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;r[0+o]/=l,r[1+o]/=c;const u=ea(l,c,.5);return typeof r[2+o]=="number"&&(r[2+o]/=u),typeof r[3+o]=="number"&&(r[3+o]/=u),s(r)}};class SZe extends p.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i,layoutId:r}=this.props,{projection:s}=t;XGe(EZe),s&&(n.group&&n.group.add(s),i&&i.register&&r&&i.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),aN.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:i,drag:r,isPresent:s}=this.props,o=i.projection;return o&&(o.isPresent=s,r||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||Is.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),BQ.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:r}=t;r&&(r.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(r),i&&i.deregister&&i.deregister(r))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function OAe(e){const[t,n]=sCe(),i=p.useContext(DQ);return a.jsx(SZe,{...e,layoutGroup:i,switchLayoutGroup:p.useContext(pCe),isPresent:t,safeToRemove:n})}const EZe={borderRadius:{...ak,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ak,borderTopRightRadius:ak,borderBottomLeftRadius:ak,borderBottomRightRadius:ak,boxShadow:kZe};function CZe(e,t,n){const i=Al(e)?e:tC(e);return i.start(dz("",i,t,n)),i.animation}function AZe(e){return e instanceof SVGElement&&e.tagName!=="svg"}const TZe=(e,t)=>e.depth-t.depth;class _Ze{constructor(){this.children=[],this.isDirty=!1}add(t){YQ(this.children,t),this.isDirty=!0}remove(t){ZQ(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(TZe),this.isDirty=!1,this.children.forEach(t)}}function jZe(e,t){const n=gh.now(),i=({timestamp:r})=>{const s=r-n;s>=t&&(Kg(i),e(s-t))};return Is.read(i,!0),()=>Kg(i)}const kAe=["TopLeft","TopRight","BottomLeft","BottomRight"],NZe=kAe.length,fZ=e=>typeof e=="string"?parseFloat(e):e,hZ=e=>typeof e=="number"||Gn.test(e);function RZe(e,t,n,i,r,s){r?(e.opacity=ea(0,n.opacity!==void 0?n.opacity:1,IZe(i)),e.opacityExit=ea(t.opacity!==void 0?t.opacity:1,0,PZe(i))):s&&(e.opacity=ea(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,i));for(let o=0;oit?1:n(qw(e,t,i))}function mZ(e,t){e.min=t.min,e.max=t.max}function Yu(e,t){mZ(e.x,t.x),mZ(e.y,t.y)}function gZ(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function bZ(e,t,n,i,r){return e-=t,e=WR(e,1/n,i),r!==void 0&&(e=WR(e,1/r,i)),e}function DZe(e,t=0,n=1,i=.5,r,s=e,o=e){if(mh.test(t)&&(t=parseFloat(t),t=ea(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=ea(s.min,s.max,i);e===s&&(l-=t),e.min=bZ(e.min,t,n,l,r),e.max=bZ(e.max,t,n,l,r)}function yZ(e,t,[n,i,r],s,o){DZe(e,t[n],t[i],t[r],t.scale,s,o)}const MZe=["x","scaleX","originX"],LZe=["y","scaleY","originY"];function vZ(e,t,n,i){yZ(e.x,t,MZe,n?n.x:void 0,i?i.x:void 0),yZ(e.y,t,LZe,n?n.y:void 0,i?i.y:void 0)}function xZ(e){return e.translate===0&&e.scale===1}function EAe(e){return xZ(e.x)&&xZ(e.y)}function wZ(e,t){return e.min===t.min&&e.max===t.max}function $Ze(e,t){return wZ(e.x,t.x)&&wZ(e.y,t.y)}function OZ(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function CAe(e,t){return OZ(e.x,t.x)&&OZ(e.y,t.y)}function kZ(e){return Mu(e.x)/Mu(e.y)}function SZ(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class FZe{constructor(){this.members=[]}add(t){YQ(this.members,t),t.scheduleRender()}remove(t){if(ZQ(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(r=>t===r);if(n===0)return!1;let i;for(let r=n;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1){i=s;break}}return i?(this.promote(i),!0):!1}promote(t,n){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,n&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:r}=t.options;r===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:i}=t;n.onExitComplete&&n.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function BZe(e,t,n){let i="";const r=e.x.translate/t.x,s=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((r||s||o)&&(i=`translate3d(${r}px, ${s}px, ${o}px) `),(t.x!==1||t.y!==1)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:h,skewX:m,skewY:g}=n;u&&(i=`perspective(${u}px) ${i}`),d&&(i+=`rotate(${d}deg) `),f&&(i+=`rotateX(${f}deg) `),h&&(i+=`rotateY(${h}deg) `),m&&(i+=`skewX(${m}deg) `),g&&(i+=`skewY(${g}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(i+=`scale(${l}, ${c})`),i||"none"}const dy={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},oS=typeof window<"u"&&window.MotionDebug!==void 0,y3=["","X","Y","Z"],UZe={visibility:"hidden"},EZ=1e3;let QZe=0;function v3(e,t,n,i){const{latestValues:r}=t;r[e]&&(n[e]=r[e],t.setStaticValue(e,0),i&&(i[e]=0))}function AAe(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=jCe(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:r,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Is,!(r||s))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&AAe(i)}function TAe({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(o={},l=t==null?void 0:t()){this.id=QZe++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,oS&&(dy.totalNodes=dy.resolvedTargetDeltas=dy.recalculatedProjection=0),this.nodes.forEach(HZe),this.nodes.forEach(XZe),this.nodes.forEach(YZe),this.nodes.forEach(qZe),oS&&window.MotionDebug.record(dy)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;cthis.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=jZe(h,250),aN.hasAnimatedSinceResize&&(aN.hasAnimatedSinceResize=!1,this.nodes.forEach(AZ))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&d&&(c||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeTargetChanged:m,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||d.getDefaultTransition()||nJe,{onLayoutAnimationStart:v,onLayoutAnimationComplete:y}=d.getProps(),w=!this.targetLayout||!CAe(this.targetLayout,g)||m,x=!h&&m;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||h&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,x);const O={...XQ(b,"layout"),onPlay:v,onComplete:y};(d.shouldReduceMotion||this.options.layoutRoot)&&(O.delay=0,O.type=!1),this.startAnimation(O)}else h||AZ(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Kg(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(ZZe),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&AAe(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c{const k=O/1e3;TZ(f.x,o.x,k),TZ(f.y,o.y,k),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(YS(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),eJe(this.relativeTarget,this.relativeTargetOrigin,h,k),x&&$Ze(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=ya()),Yu(x,this.relativeTarget)),b&&(this.animationValues=d,RZe(d,u,this.latestValues,k,w,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=k},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Kg(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Is.update(()=>{aN.hasAnimatedSinceResize=!0,this.currentAnimation=CZe(0,EZ,{...o,onUpdate:l=>{this.mixTargetDelta(l),o.onUpdate&&o.onUpdate(l)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(EZ),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=o;if(!(!l||!c||!u)){if(this!==o&&this.layout&&u&&_Ae(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||ya();const f=Mu(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+f;const h=Mu(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+h}Yu(l,c),Dx(l,d),XS(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new FZe),this.sharedNodes.get(o).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:l}=this.options;return l?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:l}=this.options;return l?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&v3("z",o,u,this.animationValues);for(let d=0;d{var l;return(l=o.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach(CZ),this.root.sharedNodes.clear()}}}function zZe(e){e.updateLayout()}function VZe(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:r}=e.layout,{animationType:s}=e.options,o=n.source!==e.layout.source;s==="size"?Zu(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=Mu(h);h.min=i[f].min,h.max=h.min+m}):_Ae(s,n.layoutBox,i)&&Zu(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=Mu(i[f]);h.max=h.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+m)});const l=Ix();XS(l,i,n.layoutBox);const c=Ix();o?XS(c,e.applyTransform(r,!0),n.measuredBox):XS(c,i,n.layoutBox);const u=!EAe(l);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:m}=f;if(h&&m){const g=ya();YS(g,n.layoutBox,h.layoutBox);const b=ya();YS(b,i,m.layoutBox),CAe(g,b)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=b,e.relativeTargetOrigin=g,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:i,snapshot:n,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:i}=e.options;i&&i()}e.options.transition=void 0}function HZe(e){oS&&dy.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function qZe(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function WZe(e){e.clearSnapshot()}function CZ(e){e.clearMeasurements()}function KZe(e){e.isLayoutDirty=!1}function GZe(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function AZ(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function XZe(e){e.resolveTargetDelta()}function YZe(e){e.calcProjection()}function ZZe(e){e.resetSkewAndRotation()}function JZe(e){e.removeLeadSnapshot()}function TZ(e,t,n){e.translate=ea(t.translate,0,n),e.scale=ea(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function _Z(e,t,n,i){e.min=ea(t.min,n.min,i),e.max=ea(t.max,n.max,i)}function eJe(e,t,n,i){_Z(e.x,t.x,n.x,i),_Z(e.y,t.y,n.y,i)}function tJe(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const nJe={duration:.45,ease:[.4,0,.1,1]},jZ=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),NZ=jZ("applewebkit/")&&!jZ("chrome/")?Math.round:_u;function RZ(e){e.min=NZ(e.min),e.max=NZ(e.max)}function iJe(e){RZ(e.x),RZ(e.y)}function _Ae(e,t,n){return e==="position"||e==="preserve-aspect"&&!aZe(kZ(t),kZ(n),.2)}function rJe(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const sJe=TAe({attachResizeListener:(e,t)=>iC(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),x3={current:void 0},jAe=TAe({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!x3.current){const e=new sJe({});e.mount(window),e.setOptions({layoutScroll:!0}),x3.current=e}return x3.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),aJe={pan:{Feature:OZe},drag:{Feature:wZe,ProjectionNode:jAe,MeasureLayout:OAe}};function oJe(e,t,n){var i;if(e instanceof Element)return[e];if(typeof e=="string"){let r=document;const s=(i=void 0)!==null&&i!==void 0?i:r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}function NAe(e,t){const n=oJe(e),i=new AbortController,r={passive:!0,...t,signal:i.signal};return[n,r,()=>i.abort()]}function IZ(e){return t=>{t.pointerType==="touch"||fAe()||e(t)}}function lJe(e,t,n={}){const[i,r,s]=NAe(e,n),o=IZ(l=>{const{target:c}=l,u=t(l);if(typeof u!="function"||!c)return;const d=IZ(f=>{u(f),c.removeEventListener("pointerleave",d)});c.addEventListener("pointerleave",d,r)});return i.forEach(l=>{l.addEventListener("pointerenter",o,r)}),s}function PZ(e,t,n){const{props:i}=e;e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,s=i[r];s&&Is.postRender(()=>s(t,MA(t)))}class cJe extends Sb{mount(){const{current:t}=this.node;t&&(this.unmount=lJe(t,n=>(PZ(this.node,n,"Start"),i=>PZ(this.node,i,"End"))))}unmount(){}}class uJe extends Sb{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=DA(iC(this.node.current,"focus",()=>this.onFocus()),iC(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const RAe=(e,t)=>t?e===t?!0:RAe(e,t.parentElement):!1,dJe=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function fJe(e){return dJe.has(e.tagName)||e.tabIndex!==-1}const lS=new WeakSet;function DZ(e){return t=>{t.key==="Enter"&&e(t)}}function w3(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const hJe=(e,t)=>{const n=e.currentTarget;if(!n)return;const i=DZ(()=>{if(lS.has(n))return;w3(n,"down");const r=DZ(()=>{w3(n,"up")}),s=()=>w3(n,"cancel");n.addEventListener("keyup",r,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",i,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),t)};function MZ(e){return fz(e)&&!fAe()}function pJe(e,t,n={}){const[i,r,s]=NAe(e,n),o=l=>{const c=l.currentTarget;if(!MZ(l)||lS.has(c))return;lS.add(c);const u=t(l),d=(m,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!MZ(m)||!lS.has(c))&&(lS.delete(c),typeof u=="function"&&u(m,{success:g}))},f=m=>{d(m,n.useGlobalTarget||RAe(c,m.target))},h=m=>{d(m,!1)};window.addEventListener("pointerup",f,r),window.addEventListener("pointercancel",h,r)};return i.forEach(l=>{!fJe(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0),(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,r),l.addEventListener("focus",u=>hJe(u,r),r)}),s}function LZ(e,t,n){const{props:i}=e;e.animationState&&i.whileTap&&e.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),s=i[r];s&&Is.postRender(()=>s(t,MA(t)))}class mJe extends Sb{mount(){const{current:t}=this.node;t&&(this.unmount=pJe(t,n=>(LZ(this.node,n,"Start"),(i,{success:r})=>LZ(this.node,i,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const C8=new WeakMap,O3=new WeakMap,gJe=e=>{const t=C8.get(e.target);t&&t(e)},bJe=e=>{e.forEach(gJe)};function yJe({root:e,...t}){const n=e||document;O3.has(n)||O3.set(n,{});const i=O3.get(n),r=JSON.stringify(t);return i[r]||(i[r]=new IntersectionObserver(bJe,{root:e,...t})),i[r]}function vJe(e,t,n){const i=yJe(t);return C8.set(e,n),i.observe(e),()=>{C8.delete(e),i.unobserve(e)}}const xJe={some:0,all:1};class wJe extends Sb{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:i,amount:r="some",once:s}=t,o={root:n?n.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:xJe[r]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,s&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),h=u?d:f;h&&h(c)};return vJe(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(OJe(t,n))&&this.startObserver()}unmount(){}}function OJe({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const kJe={inView:{Feature:wJe},tap:{Feature:mJe},focus:{Feature:uJe},hover:{Feature:cJe}},SJe={layout:{ProjectionNode:jAe,MeasureLayout:OAe}},KR={current:null},hz={current:!1};function IAe(){if(hz.current=!0,!!MQ)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>KR.current=e.matches;e.addListener(t),t()}else KR.current=!1}const EJe=[...eAe,Sl,Gg],CJe=e=>EJe.find(JCe(e)),$Z=new WeakMap;function AJe(e,t,n){for(const i in t){const r=t[i],s=n[i];if(Al(r))e.addValue(i,r);else if(Al(s))e.addValue(i,tC(r,{owner:e}));else if(s!==r)if(e.hasValue(i)){const o=e.getValue(i);o.liveStyle===!0?o.jump(r):o.hasAnimated||o.set(r)}else{const o=e.getStaticValue(i);e.addValue(i,tC(o!==void 0?o:r,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const FZ=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class TJe{scrapeMotionValuesFromProps(t,n,i){return{}}constructor({parent:t,props:n,presenceContext:i,reducedMotionConfig:r,blockInitialAnimation:s,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=lz,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const m=gh.now();this.renderScheduledAtthis.bindToMotionValue(i,n)),hz.current||IAe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:KR.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){$Z.delete(this.current),this.projection&&this.projection.unmount(),Kg(this.notifyUpdate),Kg(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const i=B0.has(t),r=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&Is.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{r(),s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Hw){const n=Hw[t];if(!n)continue;const{isEnabled:i,Feature:r}=n;if(!this.features[t]&&r&&i(this.props)&&(this.features[t]=new r(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ya()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let i=0;in.variantChildren.delete(t)}addValue(t,n){const i=this.values.get(t);n!==i&&(i&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return i===void 0&&n!==void 0&&(i=tC(n===null?void 0:n,{owner:this}),this.addValue(t,i)),i}readValue(t,n){var i;let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(i=this.getBaseTargetFromProps(this.props,t))!==null&&i!==void 0?i:this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(YCe(r)||QCe(r))?r=parseFloat(r):!CJe(r)&&Gg.test(n)&&(r=KCe(t,n)),this.setBaseTarget(t,Al(r)?r.get():r)),Al(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:i}=this.props;let r;if(typeof i=="string"||typeof i=="object"){const o=QQ(this.props,i,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(r=o[t])}if(i&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Al(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new JQ),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class PAe extends TJe{constructor(){super(...arguments),this.KeyframeResolver=tAe}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:i}){delete n[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Al(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function _Je(e){return window.getComputedStyle(e)}class jJe extends PAe{constructor(){super(...arguments),this.type="html",this.renderInstance=wCe}readValueFromInstance(t,n){if(B0.has(n)){const i=oz(n);return i&&i.default||0}else{const i=_Je(t),r=(yCe(n)?i.getPropertyValue(n):i[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(t,{transformPagePoint:n}){return xAe(t,n)}build(t,n,i){HQ(t,n,i.transformTemplate)}scrapeMotionValuesFromProps(t,n,i){return GQ(t,n,i)}}class NJe extends PAe{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ya}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(B0.has(n)){const i=oz(n);return i&&i.default||0}return n=OCe.has(n)?n:FQ(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,i){return ECe(t,n,i)}build(t,n,i){qQ(t,n,this.isSVGTag,i.transformTemplate)}renderInstance(t,n,i,r){kCe(t,n,i,r)}mount(t){this.isSVGTag=KQ(t.tagName),super.mount(t)}}const RJe=(e,t)=>UQ(e)?new NJe(t):new jJe(t,{allowProjection:e!==p.Fragment}),IJe=sXe({...XYe,...kJe,...aJe,...SJe},RJe),Cr=xGe(IJe);function SD(){!hz.current&&IAe();const[e]=p.useState(KR.current);return e}function oo(){return oo=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||/ServerSideRendering/.test(navigator&&navigator.userAgent)?p.useEffect:p.useLayoutEffect;function rx(e,t,n){var i=p.useRef(t);i.current=t,p.useEffect(function(){function r(s){i.current(s)}return e&&window.addEventListener(e,r,n),function(){e&&window.removeEventListener(e,r)}},[e])}var PJe=["container"];function DJe(e){var t=e.container,n=t===void 0?document.body:t,i=ED(e,PJe);return yi.createPortal(Ni.createElement("div",oo({},i)),n)}function MJe(e){return Ni.createElement("svg",oo({width:"44",height:"44",viewBox:"0 0 768 768"},e),Ni.createElement("path",{d:"M607.5 205.5l-178.5 178.5 178.5 178.5-45 45-178.5-178.5-178.5 178.5-45-45 178.5-178.5-178.5-178.5 45-45 178.5 178.5 178.5-178.5z"}))}function LJe(e){return Ni.createElement("svg",oo({width:"44",height:"44",viewBox:"0 0 768 768"},e),Ni.createElement("path",{d:"M640.5 352.5v63h-390l178.5 180-45 45-256.5-256.5 256.5-256.5 45 45-178.5 180h390z"}))}function $Je(e){return Ni.createElement("svg",oo({width:"44",height:"44",viewBox:"0 0 768 768"},e),Ni.createElement("path",{d:"M384 127.5l256.5 256.5-256.5 256.5-45-45 178.5-180h-390v-63h390l-178.5-180z"}))}function FJe(){return p.useEffect(function(){var e=document.body.style,t=e.overflow;return e.overflow="hidden",function(){e.overflow=t}},[]),null}function UZ(e){var t=e.touches[0],n=t.clientX,i=t.clientY;if(e.touches.length>=2){var r=e.touches[1],s=r.clientX,o=r.clientY;return[(n+s)/2,(i+o)/2,Math.sqrt(Math.pow(s-n,2)+Math.pow(o-i,2))]}return[n,i,0]}var Gm=function(e,t,n,i){var r,s=n*t,o=(s-i)/2,l=e;return s<=i?(r=1,l=0):e>0&&o-e<=0?(r=2,l=o):e<0&&o+e<=0&&(r=3,l=-o),[r,l]};function k3(e,t,n,i,r,s,o,l,c,u){o===void 0&&(o=innerWidth/2),l===void 0&&(l=innerHeight/2),c===void 0&&(c=0),u===void 0&&(u=0);var d=Gm(e,s,n,innerWidth)[0],f=Gm(t,s,i,innerHeight),h=innerWidth/2,m=innerHeight/2;return{x:o-s/r*(o-(h+e))-h+(i/n>=3&&n*s===innerWidth?0:d?c/2:c),y:l-s/r*(l-(m+t))-m+(f[0]?u/2:u),lastCX:o,lastCY:l}}function _8(e,t,n){var i=e%180!=0;return i?[n,t,i]:[t,n,i]}function S3(e,t,n){var i=_8(n,innerWidth,innerHeight),r=i[0],s=i[1],o=0,l=r,c=s,u=e/t*s,d=t/e*r;return e=s?l=u:e>=r&&tr/s?c=d:t/e>=3&&!i[2]?o=((c=d)-s)/2:l=u,{width:l,height:c,x:0,y:o,pause:!0}}function Y2(e,t){var n=t.leading,i=n!==void 0&&n,r=t.maxWait,s=t.wait,o=s===void 0?r||0:s,l=p.useRef(e);l.current=e;var c=p.useRef(0),u=p.useRef(),d=function(){return u.current&&clearTimeout(u.current)},f=p.useCallback(function(){var h=[].slice.call(arguments),m=Date.now();function g(){c.current=m,d(),l.current.apply(null,h)}var b=c.current,v=m-b;if(b===0&&(i&&g(),c.current=m),r!==void 0){if(v>r)return void g()}else v=1&&s&&s())};d()}function d(){c=requestAnimationFrame(u)}}var UJe={T:0,L:0,W:0,H:0,FIT:void 0},MAe=function(){var e=p.useRef(!1);return p.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e},QJe=["className"];function zJe(e){var t=e.className,n=t===void 0?"":t,i=ED(e,QJe);return Ni.createElement("div",oo({className:"PhotoView__Spinner "+n},i),Ni.createElement("svg",{viewBox:"0 0 32 32",width:"36",height:"36",fill:"white"},Ni.createElement("path",{opacity:".25",d:"M16 0 A16 16 0 0 0 16 32 A16 16 0 0 0 16 0 M16 4 A12 12 0 0 1 16 28 A12 12 0 0 1 16 4"}),Ni.createElement("path",{d:"M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"})))}var VJe=["src","loaded","broken","className","onPhotoLoad","loadingElement","brokenElement"];function HJe(e){var t=e.src,n=e.loaded,i=e.broken,r=e.className,s=e.onPhotoLoad,o=e.loadingElement,l=e.brokenElement,c=ED(e,VJe),u=MAe();return t&&!i?Ni.createElement(Ni.Fragment,null,Ni.createElement("img",oo({className:"PhotoView__Photo"+(r?" "+r:""),src:t,onLoad:function(d){var f=d.target;u.current&&s({loaded:!0,naturalWidth:f.naturalWidth,naturalHeight:f.naturalHeight})},onError:function(){u.current&&s({broken:!0})},draggable:!1,alt:""},c)),!n&&(o?Ni.createElement("span",{className:"PhotoView__icon"},o):Ni.createElement(zJe,{className:"PhotoView__icon"}))):l?Ni.createElement("span",{className:"PhotoView__icon"},typeof l=="function"?l({src:t}):l):null}var qJe={naturalWidth:void 0,naturalHeight:void 0,width:void 0,height:void 0,loaded:void 0,broken:!1,x:0,y:0,touched:!1,maskTouched:!1,rotate:0,scale:1,CX:0,CY:0,lastX:0,lastY:0,lastCX:0,lastCY:0,lastScale:1,touchTime:0,touchLength:0,pause:!0,stopRaf:!0,reach:void 0};function WJe(e){var t=e.item,n=t.src,i=t.render,r=t.width,s=r===void 0?0:r,o=t.height,l=o===void 0?0:o,c=t.originRef,u=e.visible,d=e.speed,f=e.easing,h=e.wrapClassName,m=e.className,g=e.style,b=e.loadingElement,v=e.brokenElement,y=e.onPhotoTap,w=e.onMaskTap,x=e.onReachMove,O=e.onReachUp,k=e.onPhotoResize,S=e.isActive,C=e.expose,E=GR(qJe),j=E[0],T=E[1],R=p.useRef(0),A=MAe(),N=j.naturalWidth,D=N===void 0?s:N,I=j.naturalHeight,P=I===void 0?l:I,_=j.width,L=_===void 0?s:_,F=j.height,M=F===void 0?l:F,V=j.loaded,q=V===void 0?!n:V,U=j.broken,Z=j.x,z=j.y,ee=j.touched,ne=j.stopRaf,W=j.maskTouched,X=j.rotate,H=j.scale,ae=j.CX,Y=j.CY,K=j.lastX,ie=j.lastY,J=j.lastCX,ye=j.lastCY,de=j.lastScale,ge=j.touchTime,Ee=j.touchLength,xe=j.pause,Ne=j.reach,We=Gy({onScale:function(_e){return Xe(X2(_e))},onRotate:function(_e){X!==_e&&(C({rotate:_e}),T(oo({rotate:_e},S3(D,P,_e))))}});function Xe(_e,Ot,Nt){H!==_e&&(C({scale:_e}),T(oo({scale:_e},k3(Z,z,L,M,H,_e,Ot,Nt),_e<=1&&{x:0,y:0})))}var Re=Y2(function(_e,Ot,Nt){if(Nt===void 0&&(Nt=0),(ee||W)&&S){var Yt=_8(X,L,M),xn=Yt[0],Ke=Yt[1];if(Nt===0&&R.current===0){var St=Math.abs(_e-ae)<=20,qe=Math.abs(Ot-Y)<=20;if(St&&qe)return void T({lastCX:_e,lastCY:Ot});R.current=St?Ot>Y?3:2:1}var nt,et=_e-J,ft=Ot-ye;if(Nt===0){var Et=Gm(et+K,H,xn,innerWidth)[0],At=Gm(ft+ie,H,Ke,innerHeight);nt=function(Gt,Ye,wt,vt){return Ye&&Gt===1||vt==="x"?"x":wt&&Gt>1||vt==="y"?"y":void 0}(R.current,Et,At[0],Ne),nt!==void 0&&x(nt,_e,Ot,H)}if(nt==="x"||W)return void T({reach:"x"});var It=X2(H+(Nt-Ee)/100/2*H,D/L,.2);C({scale:It}),T(oo({touchLength:Nt,reach:nt,scale:It},k3(Z,z,L,M,H,It,_e,Ot,et,ft)))}},{maxWait:8});function se(_e){return!ne&&!ee&&(A.current&&T(oo({},_e,{pause:u})),A.current)}var ce,ve,Se,oe,$e,Ue,me,ke,Ae=($e=function(_e){return se({x:_e})},Ue=function(_e){return se({y:_e})},me=function(_e){return A.current&&(C({scale:_e}),T({scale:_e})),!ee&&A.current},ke=Gy({X:function(_e){return $e(_e)},Y:function(_e){return Ue(_e)},S:function(_e){return me(_e)}}),function(_e,Ot,Nt,Yt,xn,Ke,St,qe,nt,et,ft){var Et=_8(et,xn,Ke),At=Et[0],It=Et[1],Gt=Gm(_e,qe,At,innerWidth),Ye=Gt[0],wt=Gt[1],vt=Gm(Ot,qe,It,innerHeight),tn=vt[0],Qt=vt[1],un=Date.now()-ft;if(un>=200||qe!==St||Math.abs(nt-St)>1){var De=k3(_e,Ot,xn,Ke,St,qe),on=De.x,On=De.y,Sn=Ye?wt:on!==_e?on:null,zi=tn?Qt:On!==Ot?On:null;return Sn!==null&&xy(_e,Sn,ke.X),zi!==null&&xy(Ot,zi,ke.Y),void(qe!==St&&xy(St,qe,ke.S))}var dn=(_e-Nt)/un,lr=(Ot-Yt)/un,Mn=Math.sqrt(Math.pow(dn,2)+Math.pow(lr,2)),ei=!1,Bn=!1;(function(ki,zn){var Rn,di=ki,rt=0,zt=0,ze=function(_n){Rn||(Rn=_n);var jr=_n-Rn,Hs=Math.sign(ki),qs=-.001*Hs,Dr=Math.sign(-di)*Math.pow(di,2)*2e-4,ti=di*jr+(qs+Dr)*Math.pow(jr,2)/2;rt+=ti,Rn=_n,Hs*(di+=(qs+Dr)*jr)<=0?Ht():zn(rt)?bt():Ht()};function bt(){zt=requestAnimationFrame(ze)}function Ht(){cancelAnimationFrame(zt)}bt()})(Mn,function(ki){var zn=_e+ki*(dn/Mn),Rn=Ot+ki*(lr/Mn),di=Gm(zn,St,At,innerWidth),rt=di[0],zt=di[1],ze=Gm(Rn,St,It,innerHeight),bt=ze[0],Ht=ze[1];if(rt&&!ei&&(ei=!0,Ye?xy(zn,zt,ke.X):QZ(zt,zn+(zn-zt),ke.X)),bt&&!Bn&&(Bn=!0,tn?xy(Rn,Ht,ke.Y):QZ(Ht,Rn+(Rn-Ht),ke.Y)),ei&&Bn)return!1;var _n=ei||ke.X(zt),jr=Bn||ke.Y(Ht);return _n&&jr})}),He=(ce=y,ve=function(_e,Ot){Ne||Xe(H!==1?1:Math.max(2,D/L),_e,Ot)},Se=p.useRef(0),oe=Y2(function(){Se.current=0,ce.apply(void 0,[].slice.call(arguments))},{wait:300}),function(){var _e=[].slice.call(arguments);Se.current+=1,oe.apply(void 0,_e),Se.current>=2&&(oe.cancel(),Se.current=0,ve.apply(void 0,_e))});function Qe(_e,Ot){if(R.current=0,(ee||W)&&S){T({touched:!1,maskTouched:!1,pause:!1,stopRaf:!1,reach:void 0});var Nt=X2(H,D/L);if(Ae(Z,z,K,ie,L,M,H,Nt,de,X,ge),O(_e,Ot),ae===_e&&Y===Ot){if(ee)return void He(_e,Ot);W&&w(_e,Ot)}}}function jt(_e,Ot,Nt){Nt===void 0&&(Nt=0),T({touched:!0,CX:_e,CY:Ot,lastCX:_e,lastCY:Ot,lastX:Z,lastY:z,lastScale:H,touchLength:Nt,touchTime:Date.now()})}function Pt(_e){T({maskTouched:!0,CX:_e.clientX,CY:_e.clientY,lastX:Z,lastY:z})}rx(np?void 0:"mousemove",function(_e){_e.preventDefault(),Re(_e.clientX,_e.clientY)}),rx(np?void 0:"mouseup",function(_e){Qe(_e.clientX,_e.clientY)}),rx(np?"touchmove":void 0,function(_e){_e.preventDefault();var Ot=UZ(_e);Re.apply(void 0,Ot)},{passive:!1}),rx(np?"touchend":void 0,function(_e){var Ot=_e.changedTouches[0];Qe(Ot.clientX,Ot.clientY)},{passive:!1}),rx("resize",Y2(function(){q&&!ee&&(T(S3(D,P,X)),k())},{maxWait:8})),T8(function(){S&&C(oo({scale:H,rotate:X},We))},[S]);var Kt=function(_e,Ot,Nt,Yt,xn,Ke,St,qe,nt,et){var ft=function(on,On,Sn,zi,dn){var lr=p.useRef(!1),Mn=GR({lead:!0,scale:Sn}),ei=Mn[0],Bn=ei.lead,ki=ei.scale,zn=Mn[1],Rn=Y2(function(di){try{return dn(!0),zn({lead:!1,scale:di}),Promise.resolve()}catch(rt){return Promise.reject(rt)}},{wait:zi});return T8(function(){lr.current?(dn(!1),zn({lead:!0}),Rn(Sn)):lr.current=!0},[Sn]),Bn?[on*ki,On*ki,Sn/ki]:[on*Sn,On*Sn,1]}(Ke,St,qe,nt,et),Et=ft[0],At=ft[1],It=ft[2],Gt=function(on,On,Sn,zi,dn){var lr=p.useState(UJe),Mn=lr[0],ei=lr[1],Bn=p.useState(0),ki=Bn[0],zn=Bn[1],Rn=p.useRef(),di=Gy({OK:function(){return on&&zn(4)}});function rt(zt){dn(!1),zn(zt)}return p.useEffect(function(){if(Rn.current||(Rn.current=Date.now()),Sn){if(function(zt,ze){var bt=zt&&zt.current;if(bt&&bt.nodeType===1){var Ht=bt.getBoundingClientRect();ze({T:Ht.top,L:Ht.left,W:Ht.width,H:Ht.height,FIT:bt.tagName==="IMG"?getComputedStyle(bt).objectFit:void 0})}}(On,ei),on)return Date.now()-Rn.current<250?(zn(1),requestAnimationFrame(function(){zn(2),requestAnimationFrame(function(){return rt(3)})}),void setTimeout(di.OK,zi)):void zn(4);rt(5)}},[on,Sn]),[ki,Mn]}(_e,Ot,Nt,nt,et),Ye=Gt[0],wt=Gt[1],vt=wt.W,tn=wt.FIT,Qt=innerWidth/2,un=innerHeight/2,De=Ye<3||Ye>4;return[De?vt?wt.L:Qt:Yt+(Qt-Ke*qe/2),De?vt?wt.T:un:xn+(un-St*qe/2),Et,De&&tn?Et*(wt.H/vt):At,Ye===0?It:De?vt/(Ke*qe)||.01:It,De?tn?1:0:1,Ye,tn]}(u,c,q,Z,z,L,M,H,d,function(_e){return T({pause:_e})}),Ct=Kt[4],xt=Kt[6],tt="transform "+d+"ms "+f,mt={className:m,onMouseDown:np?void 0:function(_e){_e.stopPropagation(),_e.button===0&&jt(_e.clientX,_e.clientY,0)},onTouchStart:np?function(_e){_e.stopPropagation(),jt.apply(void 0,UZ(_e))}:void 0,onWheel:function(_e){if(!Ne){var Ot=X2(H-_e.deltaY/100/2,D/L);T({stopRaf:!0}),Xe(Ot,_e.clientX,_e.clientY)}},style:{width:Kt[2]+"px",height:Kt[3]+"px",opacity:Kt[5],objectFit:xt===4?void 0:Kt[7],transform:X?"rotate("+X+"deg)":void 0,transition:xt>2?tt+", opacity "+d+"ms ease, height "+(xt<4?d/2:xt>4?d:0)+"ms "+f:void 0}};return Ni.createElement("div",{className:"PhotoView__PhotoWrap"+(h?" "+h:""),style:g,onMouseDown:!np&&S?Pt:void 0,onTouchStart:np&&S?function(_e){return Pt(_e.touches[0])}:void 0},Ni.createElement("div",{className:"PhotoView__PhotoBox",style:{transform:"matrix("+Ct+", 0, 0, "+Ct+", "+Kt[0]+", "+Kt[1]+")",transition:ee||xe?void 0:tt,willChange:S?"transform":void 0}},n?Ni.createElement(HJe,oo({src:n,loaded:q,broken:U},mt,{onPhotoLoad:function(_e){T(oo({},_e,_e.loaded&&S3(_e.naturalWidth||0,_e.naturalHeight||0,X)))},loadingElement:b,brokenElement:v})):i&&i({attrs:mt,scale:Ct,rotate:X})))}var zZ={x:0,touched:!1,pause:!1,lastCX:void 0,lastCY:void 0,bg:void 0,lastBg:void 0,overlay:!0,minimal:!0,scale:1,rotate:0};function KJe(e){var t=e.loop,n=t===void 0?3:t,i=e.speed,r=e.easing,s=e.photoClosable,o=e.maskClosable,l=o===void 0||o,c=e.maskOpacity,u=c===void 0?1:c,d=e.pullClosable,f=d===void 0||d,h=e.bannerVisible,m=h===void 0||h,g=e.overlayRender,b=e.toolbarRender,v=e.className,y=e.maskClassName,w=e.photoClassName,x=e.photoWrapClassName,O=e.loadingElement,k=e.brokenElement,S=e.images,C=e.index,E=C===void 0?0:C,j=e.onIndexChange,T=e.visible,R=e.onClose,A=e.afterClose,N=e.portalContainer,D=GR(zZ),I=D[0],P=D[1],_=p.useState(0),L=_[0],F=_[1],M=I.x,V=I.touched,q=I.pause,U=I.lastCX,Z=I.lastCY,z=I.bg,ee=z===void 0?u:z,ne=I.lastBg,W=I.overlay,X=I.minimal,H=I.scale,ae=I.rotate,Y=I.onScale,K=I.onRotate,ie=e.hasOwnProperty("index"),J=ie?E:L,ye=ie?j:F,de=p.useRef(J),ge=S.length,Ee=S[J],xe=typeof n=="boolean"?n:ge>n,Ne=function(Ct,xt){var tt=p.useReducer(function(Nt){return!Nt},!1)[1],mt=p.useRef(0),_e=function(Nt){var Yt=p.useRef(Nt);function xn(Ke){Yt.current=Ke}return p.useMemo(function(){(function(Ke){Ct?(Ke(Ct),mt.current=1):mt.current=2})(xn)},[Nt]),[Yt.current,xn]}(Ct),Ot=_e[1];return[_e[0],mt.current,function(){tt(),mt.current===2&&(Ot(!1),xt&&xt()),mt.current=0}]}(T,A),We=Ne[0],Xe=Ne[1],Re=Ne[2];T8(function(){if(We)return P({pause:!0,x:J*-(innerWidth+jv)}),void(de.current=J);P(zZ)},[We]);var se=Gy({close:function(Ct){K&&K(0),P({overlay:!0,lastBg:ee}),R(Ct)},changeIndex:function(Ct,xt){xt===void 0&&(xt=!1);var tt=xe?de.current+(Ct-J):Ct,mt=ge-1,_e=A8(tt,0,mt),Ot=xe?tt:_e,Nt=innerWidth+jv;P({touched:!1,lastCX:void 0,lastCY:void 0,x:-Nt*Ot,pause:xt}),de.current=Ot,ye&&ye(xe?Ct<0?mt:Ct>mt?0:Ct:_e)}}),ce=se.close,ve=se.changeIndex;function Se(Ct){return Ct?ce():P({overlay:!W})}function oe(){P({x:-(innerWidth+jv)*J,lastCX:void 0,lastCY:void 0,pause:!0}),de.current=J}function $e(Ct,xt,tt,mt){Ct==="x"?function(_e){if(U!==void 0){var Ot=_e-U,Nt=Ot;!xe&&(J===0&&Ot>0||J===ge-1&&Ot<0)&&(Nt=Ot/2),P({touched:!0,lastCX:U,x:-(innerWidth+jv)*de.current+Nt,pause:!1})}else P({touched:!0,lastCX:_e,x:M,pause:!1})}(xt):Ct==="y"&&function(_e,Ot){if(Z!==void 0){var Nt=u===null?null:A8(u,.01,u-Math.abs(_e-Z)/100/4);P({touched:!0,lastCY:Z,bg:Ot===1?Nt:u,minimal:Ot===1})}else P({touched:!0,lastCY:_e,bg:ee,minimal:!0})}(tt,mt)}function Ue(Ct,xt){var tt=Ct-(U??Ct),mt=xt-(Z??xt),_e=!1;if(tt<-40)ve(J+1);else if(tt>40)ve(J-1);else{var Ot=-(innerWidth+jv)*de.current;Math.abs(mt)>100&&X&&f&&(_e=!0,ce()),P({touched:!1,x:Ot,lastCX:void 0,lastCY:void 0,bg:u,overlay:!!_e||W})}}rx("keydown",function(Ct){if(T)switch(Ct.key){case"ArrowLeft":ve(J-1,!0);break;case"ArrowRight":ve(J+1,!0);break;case"Escape":ce()}});var me=function(Ct,xt,tt){return p.useMemo(function(){var mt=Ct.length;return tt?Ct.concat(Ct).concat(Ct).slice(mt+xt-1,mt+xt+2):Ct.slice(Math.max(xt-1,0),Math.min(xt+2,mt+1))},[Ct,xt,tt])}(S,J,xe);if(!We)return null;var ke=W&&!Xe,Ae=T?ee:ne,He=Y&&K&&{images:S,index:J,visible:T,onClose:ce,onIndexChange:ve,overlayVisible:ke,overlay:Ee&&Ee.overlay,scale:H,rotate:ae,onScale:Y,onRotate:K},Qe=i?i(Xe):400,jt=r?r(Xe):BZ,Pt=i?i(3):600,Kt=r?r(3):BZ;return Ni.createElement(DJe,{className:"PhotoView-Portal"+(ke?"":" PhotoView-Slider__clean")+(T?"":" PhotoView-Slider__willClose")+(v?" "+v:""),role:"dialog",onClick:function(Ct){return Ct.stopPropagation()},container:N},T&&Ni.createElement(FJe,null),Ni.createElement("div",{className:"PhotoView-Slider__Backdrop"+(y?" "+y:"")+(Xe===1?" PhotoView-Slider__fadeIn":Xe===2?" PhotoView-Slider__fadeOut":""),style:{background:Ae?"rgba(0, 0, 0, "+Ae+")":void 0,transitionTimingFunction:jt,transitionDuration:(V?0:Qe)+"ms",animationDuration:Qe+"ms"},onAnimationEnd:Re}),m&&Ni.createElement("div",{className:"PhotoView-Slider__BannerWrap"},Ni.createElement("div",{className:"PhotoView-Slider__Counter"},J+1," / ",ge),Ni.createElement("div",{className:"PhotoView-Slider__BannerRight"},b&&He&&b(He),Ni.createElement(MJe,{className:"PhotoView-Slider__toolbarIcon",onClick:ce}))),me.map(function(Ct,xt){var tt=xe||J!==0?de.current-1+xt:J+xt;return Ni.createElement(WJe,{key:xe?Ct.key+"/"+Ct.src+"/"+tt:Ct.key,item:Ct,speed:Qe,easing:jt,visible:T,onReachMove:$e,onReachUp:Ue,onPhotoTap:function(){return Se(s)},onMaskTap:function(){return Se(l)},wrapClassName:x,className:w,style:{left:(innerWidth+jv)*tt+"px",transform:"translate3d("+M+"px, 0px, 0)",transition:V||q?void 0:"transform "+Pt+"ms "+Kt},loadingElement:O,brokenElement:k,onPhotoResize:oe,isActive:de.current===tt,expose:P})}),!np&&m&&Ni.createElement(Ni.Fragment,null,(xe||J!==0)&&Ni.createElement("div",{className:"PhotoView-Slider__ArrowLeft",onClick:function(){return ve(J-1,!0)}},Ni.createElement(LJe,null)),(xe||J+1-1){var y=u.slice();return y.splice(v,1,b),void l({images:y})}l(function(w){return{images:w.images.concat(b)}})},remove:function(b){l(function(v){var y=v.images.filter(function(w){return w.key!==b});return{images:y,index:Math.min(y.length-1,f)}})},show:function(b){var v=u.findIndex(function(y){return y.key===b});l({visible:!0,index:v}),i&&i(!0,v,o)}}),m=Gy({close:function(){l({visible:!1}),i&&i(!1,f,o)},changeIndex:function(b){l({index:b}),n&&n(b,o)}}),g=p.useMemo(function(){return oo({},o,h)},[o,h]);return Ni.createElement(DAe.Provider,{value:g},t,Ni.createElement(KJe,oo({images:u,visible:d,index:f,onIndexChange:m.changeIndex,onClose:m.close},r)))}var LAe=function(e){var t,n,i=e.src,r=e.render,s=e.overlay,o=e.width,l=e.height,c=e.triggers,u=c===void 0?["onClick"]:c,d=e.children,f=p.useContext(DAe),h=(t=function(){return f.nextId()},(n=p.useRef({sign:!1,fn:void 0}).current).sign||(n.sign=!0,n.fn=t()),n.fn),m=p.useRef(null);p.useImperativeHandle(d==null?void 0:d.ref,function(){return m.current}),p.useEffect(function(){return function(){f.remove(h)}},[]);var g=Gy({render:function(v){return r&&r(v)},show:function(v,y){f.show(h),function(w,x){if(d){var O=d.props[w];O&&O(x)}}(v,y)}}),b=p.useMemo(function(){var v={};return u.forEach(function(y){v[y]=g.show.bind(null,y)}),v},[]);return p.useEffect(function(){f.update({key:h,src:i,originRef:m,render:g.render,overlay:s,width:o,height:l})},[i]),d?p.Children.only(p.cloneElement(d,oo({},b,{ref:m}))):null};function u0(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),a.jsx("path",{d:"m7.5 9 2.7 2.5L7.5 14M12.7 14h3.8"}),a.jsx("path",{d:"M3.8 7.5h16.4",opacity:".55"})]})}function $Ae(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),a.jsx("path",{d:"M3.8 8h16.4"}),a.jsx("circle",{cx:"6.5",cy:"6.3",r:".65",fill:"currentColor",stroke:"none"}),a.jsx("circle",{cx:"8.8",cy:"6.3",r:".65",fill:"currentColor",stroke:"none"}),a.jsx("path",{d:"m9 15 2.2-4 1.6 2.4 1.1-1.2L16 15H9Z"})]})}function pz(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M12 3.4 19 6v5.3c0 4.3-2.7 7.6-7 9.3-4.3-1.7-7-5-7-9.3V6l7-2.6Z"}),a.jsx("path",{d:"m8.8 12 2 2 4.4-4.4"})]})}function oN(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M3.5 7.7h6.1l1.7 2h9.2v7.5a2.3 2.3 0 0 1-2.3 2.3H5.8a2.3 2.3 0 0 1-2.3-2.3V7.7Z"}),a.jsx("path",{d:"M3.8 7.7V6.8a2.3 2.3 0 0 1 2.3-2.3h3l1.8 2h6.9a2.3 2.3 0 0 1 2.3 2.3v.9"}),a.jsx("path",{d:"M12 13v3M10.5 14.5h3"})]})}function ZJe(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 5v14M5 12h14"})})}function VZ(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m6.5 11.5 5.5-5.5 5.5 5.5M12 6v12"})})}function HZ(e){return a.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",...e,children:a.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1.75",fill:"currentColor"})})}function JJe(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),a.jsx("circle",{cx:"8.5",cy:"9",r:"1.4"}),a.jsx("path",{d:"m5.5 17 4.2-4.2 2.6 2.4 2.1-2.1 4.1 3.9"})]})}function eet(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3.5h7l5 5v12H6z"}),a.jsx("path",{d:"M13 3.5v5h5M9 13h6M9 16h5"})]})}function tet(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"5",width:"13.5",height:"14",rx:"2.5"}),a.jsx("path",{d:"m17 10 3.5-2v8L17 14zM7 8.5h4.5"})]})}function net(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m12 3 1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5zM18.5 15.5l.7 2.1 2.1.7-2.1.7-.7 2.1-.7-2.1-2.1-.7 2.1-.7z"})})}function FAe(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function j8(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m9 6 6 6-6 6"})})}function iet(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M4.8 8.2A8 8 0 1 1 4 12M4.8 8.2V4.5M4.8 8.2h3.7"}),a.jsx("path",{d:"M12 8v4.5l3 1.8"})]})}function Ic(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M20 12a8 8 0 1 1-2.35-5.65"})})}function ret(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"8",y:"8",width:"11",height:"11",rx:"2"}),a.jsx("path",{d:"M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2"})]})}function BAe(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m5 12.5 4.2 4.2L19 7"})})}function Q(e,t={}){return bn.t(e,{...t,ns:"adk"})}function ul(e){const t=new Headers(e);return t.has("Accept-Language")||t.set("Accept-Language",bn.resolvedLanguage||bn.language),t}function N8(){return bn.resolvedLanguage||bn.language}function set(e){if(e.timezone!=null){if(typeof e.timezone!="string")return!1;try{new Intl.DateTimeFormat("en-US",{timeZone:e.timezone})}catch{return!1}}return e.runAt!=null&&(typeof e.runAt!="string"||!Number.isFinite(Date.parse(e.runAt)))?!1:[e.weekdays,e.monthDays].every(t=>t==null||Array.isArray(t)&&t.every(Number.isInteger))}async function aet(e,t,n,i,r){const s=await e(`/web/mpa-cron/${encodeURIComponent(t.runtimeId)}?region=${encodeURIComponent(t.region)}&offset=${n}&query=${encodeURIComponent(i)}`,{signal:r},{});if(!s.ok)throw new Error(`MPA_HTTP_${s.status}`);let o;try{o=await s.json()}catch{throw new Error("MPA_INVALID_RESPONSE")}if(!o||!Array.isArray(o.items)||!Number.isInteger(o.total)||o.total<0||typeof o.hasMore!="boolean"||o.hasMore&&(!Number.isInteger(o.nextOffset)||o.nextOffset<=n)||o.overview!=null&&(!Number.isFinite(o.overview.executionCount)||!Number.isFinite(o.overview.successRate))||!o.items.every(l=>l&&typeof l.id=="string"&&typeof l.name=="string"&&typeof l.enabled=="boolean"&&(l.prompt==null||typeof l.prompt=="string")&&l.schedule&&typeof l.schedule.type=="string"&&set(l.schedule)&&[l.agentId,l.lastRunAt,l.runningAt,l.createdAt].every(c=>c==null||typeof c=="string")&&(l.nextRunAt==null||typeof l.nextRunAt=="string")&&(l.lastRunStatus==null||typeof l.lastRunStatus=="string")))throw new Error("MPA_INVALID_RESPONSE");return o}async function oet(e,t,n,i,r,s){const o=await e(`/web/mpa-cron/${encodeURIComponent(t.runtimeId)}${i}?region=${encodeURIComponent(t.region)}`,{method:n,signal:s,...r===void 0?{}:{headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}},{});if(!o.ok)throw new Error(`MPA_HTTP_${o.status}`);let l;try{l=await o.json()}catch{throw new Error("MPA_INVALID_RESPONSE")}if(!l||typeof l!="object"||Array.isArray(l))throw new Error("MPA_INVALID_RESPONSE");return l}async function cet(e,t,n,i,r){const s=await e(`/web/mpa-cron/${encodeURIComponent(t.runtimeId)}/${encodeURIComponent(n)}/runs?region=${encodeURIComponent(t.region)}&offset=${i}`,{signal:r},{});if(!s.ok)throw new Error(`MPA_HTTP_${s.status}`);let o;try{o=await s.json()}catch{throw new Error("MPA_INVALID_RESPONSE")}if(!o||!Array.isArray(o.items)||!Number.isInteger(o.total)||o.total<0||typeof o.hasMore!="boolean"||o.hasMore&&(!Number.isInteger(o.nextOffset)||o.nextOffset<=i)||!o.items.every(l=>l&&typeof l.id=="string"&&typeof l.status=="string"&&typeof l.scheduledAt=="string"&&[l.startedAt,l.errorMessage,l.sessionId].every(c=>c==null||typeof c=="string")&&(l.durationMs==null||Number.isFinite(l.durationMs)&&l.durationMs>=0)))throw new Error("MPA_INVALID_RESPONSE");return o}const qZ="veadk_auth_qs",uet=new Set(["view","source","sessionId","artifactSha256","validationReportSha256","projectId","versionId"]);let ok=null;function det(){if(ok!==null)return ok;const e=new URLSearchParams(window.location.search),t=new URLSearchParams,n=new URLSearchParams,i=e.get("view")==="runtime-deploy"&&e.get("source")==="intelligent-development";e.forEach((s,o)=>{(i&&uet.has(o)?n:t).append(o,s)});const r=t.toString();if(r?(sessionStorage.setItem(qZ,r),ok=r):ok=sessionStorage.getItem(qZ)??"",r){const s=n.toString();window.history.replaceState(null,"",window.location.pathname+(s?`?${s}`:"")+window.location.hash)}return ok}function Ta(e){const t=det();if(!t)return e;const n=new URL(e,window.location.origin);return new URLSearchParams(t).forEach((i,r)=>{n.searchParams.has(r)||n.searchParams.set(r,i)}),/^https?:\/\//i.test(e)?n.toString():n.pathname+n.search+n.hash}const ho=3e4,hr=12e4,mz=1e4;function po(e,t=ho){if(t<=0)return e??void 0;const n=AbortSignal.timeout(t);return e?AbortSignal.any([e,n]):n}const XR="veadk_local_user",YR="veadk_local_user_tab",fet="X-VeADK-OAuth-Refresh-Retry",het=[50,250],pet=/^[A-Za-z0-9]{1,16}$/;function UAe(){try{const e=sessionStorage.getItem(YR);if(e)return e;const t=localStorage.getItem(XR);return t&&sessionStorage.setItem(YR,t),t}catch{try{return localStorage.getItem(XR)}catch{return null}}}function WZ(e){try{sessionStorage.setItem(YR,e)}catch{}try{localStorage.setItem(XR,e)}catch{}}function met(){try{sessionStorage.removeItem(YR)}catch{}try{localStorage.removeItem(XR)}catch{}}function uc(e){const t=new Headers(e),n=UAe();return n&&t.set("X-VeADK-Local-User",n),t}async function QAe(){let e;try{e=await fetch("/web/auth-config",{headers:ul({Accept:"application/json"}),signal:po(void 0,mz)})}catch(t){throw console.warn("[identity] /web/auth-config is unreachable:",t),new Error(Q("identity.loadConfigNetworkFailed"))}if(!e.ok)throw new Error(Q("identity.configServiceFailed",{status:e.status}));try{const t=await e.json();if(!Array.isArray(t.providers))throw new TypeError("providers is not an array");return t.providers}catch(t){throw console.warn("[identity] /web/auth-config returned an invalid response:",t),new Error(Q("identity.invalidConfigResponse"))}}function get(e){const t=window.location.pathname+window.location.search+window.location.hash,n=e.includes("?")?"&":"?";window.location.assign(`${e}${n}redirect=${encodeURIComponent(t)}`)}function bet(){const e=window.location.pathname+window.location.search+window.location.hash,t=window.open("about:blank","_blank","popup,width=520,height=720");if(!t)return null;try{t.opener=null,t.location.replace(`/oauth2/login?redirect=${encodeURIComponent(e)}`)}catch{return t.close(),null}return t}async function yet(){const[e,t]=await Promise.all([R8(),QAe()]);return e.status==="unauthenticated"&&t.length>0}function vet(){window.location.assign("/oauth2/logout")}async function xet(){for(let e=0;;e+=1){let t;try{t=await fetch("/oauth2/userinfo",{headers:ul({Accept:"application/json"}),signal:po(void 0,mz)})}catch(i){throw console.warn("[identity] /oauth2/userinfo is unreachable:",i),new Error(Q("identity.serviceNetworkFailed"))}const n=het[e];if(t.status!==401||t.headers.get(fet)!=="1"||n===void 0)return t;await new Promise(i=>window.setTimeout(i,n))}}async function R8(){const e=await xet();if(e.ok){let n;try{n=await e.json()}catch(r){throw console.warn("[identity] /oauth2/userinfo returned a non-JSON response:",r),new Error(Q("identity.invalidServiceResponse"))}return{status:"authenticated",userId:String(n.sub??n.user_id??n.email??""),info:n}}if(e.status===401)return{status:"unauthenticated",userId:"",local:!1};if(e.status!==404)throw new Error(Q("identity.serviceFailed",{status:e.status}));const t=UAe();return t?{status:"authenticated",userId:t,info:{name:t},local:!0}:{status:"unauthenticated",userId:"",local:!0}}function wet(e){if(!e)return"";for(const t of[e.name,e.preferred_username,e.username,e.email])if(typeof t=="string"&&t.trim())return t.trim();return""}function Oet(e){const t=e==null?void 0:e.picture;return typeof t=="string"?t.trim():""}const I8="veadk:authentication-required";let ZS=null,cS=null;function ket(e){if(!e.redirected||!e.url)return!1;try{const t=new URL(e.url);return t.pathname.includes("/authorize")||t.pathname.includes("/oauth2/login")||t.hostname.includes(".userpool.auth.")}catch{return!1}}function Eet(e){ZS||(ZS=new Promise(n=>{cS=n}),window.dispatchEvent(new Event(I8)));const t=ZS;return e?e.aborted?Promise.reject(e.reason??new Error("Request aborted")):new Promise((n,i)=>{const r=()=>i(e.reason??new Error("Request aborted"));e.addEventListener("abort",r,{once:!0}),t.then(()=>{e.removeEventListener("abort",r),n()},s=>{e.removeEventListener("abort",r),i(s)})}):t}function Cet(){return ZS!==null}function Aet(){cS==null||cS(),cS=null,ZS=null}async function CD(e,t){var i;const n=await e.text().catch(()=>"");try{return JSON.parse(n)}catch{const r=((i=e.headers.get("content-type"))==null?void 0:i.split(";",1)[0])||Q("common.contentTypeMissing"),s=n.trim().slice(0,2e3),o=s?` +${Q("common.response",{response:s})}`:"";throw new Error(Q("jsonResponse.nonJson",{fallback:t,status:e.status,contentType:r,detail:o}))}}const Tet=/\brun_sse\s*failed\s*:\s*404\b/i,_et=/session not found/i,jet=/(?:^|[::\s])not found\s*$/i,Net=/Expecting (?:'[^']+'|\w+)(?: delimiter)?: line \d+ column \d+ \(char \d+\)/i,Ret=/Unknown or expired collection_id\s+'[^']+'\.\s*Call collect_resources first\./i,Iet=/(?:RateLimitError|\bTPM\b|\bRPM\b|tokens? per minute|requests? per minute)[\s\S]*(?:\b429\b|limit|quota)|\b429\b[\s\S]*(?:model|RateLimitError|\bTPM\b|\bRPM\b)/i;function Nv(e,t){return e.includes(t)?e:`${e} -${t}`}function Jo(e){const t=String(e),n=Q("runSse.rawResponseLabel");let i=t.includes(n)?t:`${n}${t}`;if(_et.test(t))i=jv(i,Q("runSse.toolArgumentHint"));else{if(jet.test(t))return jv(i,Q("runSse.resourceCollectionExpiredHint"));if(Net.test(t))return jv(i,Q("runSse.modelQuotaHint"));Cet.test(t)&&(Aet.test(t)?i=jv(i,Q("runSse.persistentMemoryHint")):Tet.test(t)&&(i=jv(i,Q("runSse.unsupportedRouteHint"))))}return jv(i,Q("runSse.networkConfigurationHint"))}const iC="__sseEvent";async function*MA(e){if(!e.body)throw new Error("Response has no body");const t=e.body.getReader(),n=new TextDecoder;let i="";const r=o=>o.length>500?Q("sse.truncatedData",{data:o.slice(0,500),count:o.length}):o,s=(o,l=!1)=>{var f;const c=o.split(/\r?\n/),u=(f=c.find(h=>h.startsWith("event:")))==null?void 0:f.slice(6).trim(),d=c.filter(h=>h.startsWith("data:")).map(h=>h.slice(5).trimStart()).join(` -`);if(!(!d||d==="[DONE]"||d==="ping"))try{const h=JSON.parse(d);return u&&h&&typeof h=="object"&&Object.defineProperty(h,iC,{value:u,enumerable:!1,configurable:!0}),h}catch{const h=r(d);throw l?new Error(Q("sse.incompleteEvent",{data:h})):new Error(Q("sse.invalidEventJson",{data:h}))}};try{for(;;){const{done:o,value:l}=await t.read();if(o)break;i+=n.decode(l,{stream:!0});let c=i.match(/\r?\n\r?\n/);for(;(c==null?void 0:c.index)!==void 0;){const u=i.slice(0,c.index);i=i.slice(c.index+c[0].length);const d=s(u);d!==void 0&&(yield d),c=i.match(/\r?\n\r?\n/)}}if(i+=n.decode(),i.trim()){const o=s(i,!0);o!==void 0&&(yield o)}}finally{try{await t.cancel()}catch{}finally{t.releaseLock()}}}const Ret="X-Studio-FaaS-Instance",Iet="X-Studio-FaaS-Request-Id";function YR(e,t,n){var s,o;const i=((s=e.headers.get(Ret))==null?void 0:s.trim())??"";if(!t||!n||!i)return null;const r=((o=e.headers.get(Iet))==null?void 0:o.trim())??"";return{runtimeId:t,region:n,instanceName:i,...r?{requestId:r}:{}}}function WZ(e,t,n,i){const r=e==="byteplus"?"https://console.byteplus.com":"https://console.volcengine.com",s=new URLSearchParams({projectName:"default",runtimeId:n,instanceName:i});return`${r}/agentkit/region:agentkit+${encodeURIComponent(t)}/runtime?${s}`}function Pet(e){return/\b(?:ERROR|FATAL|CRITICAL)\b/i.test(e)?"error":/\bWARN(?:ING)?\b/i.test(e)?"warning":/\bDEBUG\b/i.test(e)?"debug":/\bINFO\b/i.test(e)?"info":"default"}function Det(e){if(!e||typeof e!="object")return!1;const t=e;return t.type==="done"?!0:t.type==="context"?typeof t.instanceName=="string"&&typeof t.consoleUrl=="string":t.type==="logs"?typeof t.text=="string"&&typeof t.updatedAt=="number":t.type==="error"?typeof t.message=="string"&&(t.detail===void 0||typeof t.detail=="string")&&(t.statusCode===void 0||typeof t.statusCode=="string")&&(t.errorCode===void 0||typeof t.errorCode=="string")&&(t.requestId===void 0||typeof t.requestId=="string")&&(t.responseBody===void 0||typeof t.responseBody=="string"):!1}function QAe(e){var i;const t=[e.message],n=[e.statusCode?Q("runtimeLogs.httpStatus",{status:e.statusCode}):"",e.errorCode?Q("runtimeLogs.errorCode",{code:e.errorCode}):"",e.requestId?`Request ID:${e.requestId}`:""].filter(Boolean);return n.length>0&&t.push(n.join(` +${t}`}function Jo(e){const t=String(e),n=Q("runSse.rawResponseLabel");let i=t.includes(n)?t:`${n}${t}`;if(Net.test(t))i=Nv(i,Q("runSse.toolArgumentHint"));else{if(Ret.test(t))return Nv(i,Q("runSse.resourceCollectionExpiredHint"));if(Iet.test(t))return Nv(i,Q("runSse.modelQuotaHint"));Tet.test(t)&&(_et.test(t)?i=Nv(i,Q("runSse.persistentMemoryHint")):jet.test(t)&&(i=Nv(i,Q("runSse.unsupportedRouteHint"))))}return Nv(i,Q("runSse.networkConfigurationHint"))}const rC="__sseEvent";async function*LA(e){if(!e.body)throw new Error("Response has no body");const t=e.body.getReader(),n=new TextDecoder;let i="";const r=o=>o.length>500?Q("sse.truncatedData",{data:o.slice(0,500),count:o.length}):o,s=(o,l=!1)=>{var f;const c=o.split(/\r?\n/),u=(f=c.find(h=>h.startsWith("event:")))==null?void 0:f.slice(6).trim(),d=c.filter(h=>h.startsWith("data:")).map(h=>h.slice(5).trimStart()).join(` +`);if(!(!d||d==="[DONE]"||d==="ping"))try{const h=JSON.parse(d);return u&&h&&typeof h=="object"&&Object.defineProperty(h,rC,{value:u,enumerable:!1,configurable:!0}),h}catch{const h=r(d);throw l?new Error(Q("sse.incompleteEvent",{data:h})):new Error(Q("sse.invalidEventJson",{data:h}))}};try{for(;;){const{done:o,value:l}=await t.read();if(o)break;i+=n.decode(l,{stream:!0});let c=i.match(/\r?\n\r?\n/);for(;(c==null?void 0:c.index)!==void 0;){const u=i.slice(0,c.index);i=i.slice(c.index+c[0].length);const d=s(u);d!==void 0&&(yield d),c=i.match(/\r?\n\r?\n/)}}if(i+=n.decode(),i.trim()){const o=s(i,!0);o!==void 0&&(yield o)}}finally{try{await t.cancel()}catch{}finally{t.releaseLock()}}}const Pet="X-Studio-FaaS-Instance",Det="X-Studio-FaaS-Request-Id";function ZR(e,t,n){var s,o;const i=((s=e.headers.get(Pet))==null?void 0:s.trim())??"";if(!t||!n||!i)return null;const r=((o=e.headers.get(Det))==null?void 0:o.trim())??"";return{runtimeId:t,region:n,instanceName:i,...r?{requestId:r}:{}}}function KZ(e,t,n,i){const r=e==="byteplus"?"https://console.byteplus.com":"https://console.volcengine.com",s=new URLSearchParams({projectName:"default",runtimeId:n,instanceName:i});return`${r}/agentkit/region:agentkit+${encodeURIComponent(t)}/runtime?${s}`}function Met(e){return/\b(?:ERROR|FATAL|CRITICAL)\b/i.test(e)?"error":/\bWARN(?:ING)?\b/i.test(e)?"warning":/\bDEBUG\b/i.test(e)?"debug":/\bINFO\b/i.test(e)?"info":"default"}function Let(e){if(!e||typeof e!="object")return!1;const t=e;return t.type==="done"?!0:t.type==="context"?typeof t.instanceName=="string"&&typeof t.consoleUrl=="string":t.type==="logs"?typeof t.text=="string"&&typeof t.updatedAt=="number":t.type==="error"?typeof t.message=="string"&&(t.detail===void 0||typeof t.detail=="string")&&(t.statusCode===void 0||typeof t.statusCode=="string")&&(t.errorCode===void 0||typeof t.errorCode=="string")&&(t.requestId===void 0||typeof t.requestId=="string")&&(t.responseBody===void 0||typeof t.responseBody=="string"):!1}function zAe(e){var i;const t=[e.message],n=[e.statusCode?Q("runtimeLogs.httpStatus",{status:e.statusCode}):"",e.errorCode?Q("runtimeLogs.errorCode",{code:e.errorCode}):"",e.requestId?`Request ID:${e.requestId}`:""].filter(Boolean);return n.length>0&&t.push(n.join(` `)),e.detail&&e.detail!==e.message&&t.push(e.detail),e.responseBody&&!((i=e.detail)!=null&&i.includes(e.responseBody))&&t.push(Q("runtimeLogs.cloudResponseBody",{body:e.responseBody})),t.join(` -`)}async function Met(e){const t=`HTTP ${e.status}${e.statusText?` ${e.statusText}`:""}`,n=await e.text();if(!n)return t;try{const i=JSON.parse(n);if(typeof i.detail=="string"&&i.detail)return`${t} +`)}async function $et(e){const t=`HTTP ${e.status}${e.statusText?` ${e.statusText}`:""}`,n=await e.text();if(!n)return t;try{const i=JSON.parse(n);if(typeof i.detail=="string"&&i.detail)return`${t} -${i.detail}`;if(i.detail&&typeof i.detail=="object"){const r=i.detail;if(typeof r.message=="string")return QAe({message:r.message,...typeof r.detail=="string"?{detail:r.detail}:{},...typeof r.statusCode=="string"?{statusCode:r.statusCode}:{},...typeof r.errorCode=="string"?{errorCode:r.errorCode}:{},...typeof r.requestId=="string"?{requestId:r.requestId}:{},...typeof r.responseBody=="string"?{responseBody:r.responseBody}:{}})}return`${t} +${i.detail}`;if(i.detail&&typeof i.detail=="object"){const r=i.detail;if(typeof r.message=="string")return zAe({message:r.message,...typeof r.detail=="string"?{detail:r.detail}:{},...typeof r.statusCode=="string"?{statusCode:r.statusCode}:{},...typeof r.errorCode=="string"?{errorCode:r.errorCode}:{},...typeof r.requestId=="string"?{requestId:r.requestId}:{},...typeof r.responseBody=="string"?{responseBody:r.responseBody}:{}})}return`${t} ${JSON.stringify(i,null,2)}`}catch{return`${t} -${n}`}}async function*Let({runtimeId:e,region:t,instanceName:n,sessionId:i,follow:r=!0,signal:s}){const o=new URLSearchParams({region:t,follow:String(r)});n&&o.set("instance_name",n),i&&o.set("session_id",i);const l=await fetch(Ta(`/web/runtime-logs/${encodeURIComponent(e)}/stream?${o.toString()}`),{headers:ul(uc({Accept:"text/event-stream"})),cache:"no-store",signal:s});if(!l.ok)throw new Error(Q("runtimeLogs.loadFailedWithDetail",{detail:await Met(l)}));for await(const c of MA(l)){if(!Det(c))throw new Error(Q("runtimeLogs.invalidFormat"));yield c}}const $et=255,Fet=/[\p{L}\p{M}\p{N}\p{P}\p{Zs}]/u;function Bet(e){const t=e.normalize("NFKC").replace(/\s+/gu," ").trim(),n=new TextEncoder;let i=0,r="";for(const s of t){if(!Fet.test(s))continue;const o=n.encode(s).byteLength;if(i+o>$et)break;r+=s,i+=o}return r.replace(/ +/g," ").trimEnd()}const Uet=/RunPipeline result could not be reconciled|Polling build status failed/i;class oN extends Error{constructor({taskId:n,cause:i}={}){super("The deployment request may still be running, but its status could not be confirmed.");Zt(this,"taskId");this.name="DeploymentStatusUnconfirmedError",this.taskId=n}}function zAe(e){if(e instanceof oN)return!0;const t=e instanceof Error?e.message:String(e??"");return Uet.test(t)}function VAe(e){return!!(e&&typeof e=="object"&&"name"in e&&e.name==="AbortError")}async function Qet({load:e,signal:t,timeoutMs:n=30*6e4,intervalMs:i=2e3,shouldRetry:r=()=>!0}){if(t!=null&&t.aborted)throw t.reason??new DOMException("Aborted","AbortError");const s=Date.now()+Math.max(0,n);for(;!(t!=null&&t.aborted)&&Date.now()<=s;){try{const o=await e(t);if(o.done)return o}catch(o){if(t!=null&&t.aborted||VAe(o)||!r(o))throw o}if(t!=null&&t.aborted)throw t.reason??new DOMException("Aborted","AbortError");i<=0||await new Promise((o,l)=>{const c=()=>{globalThis.clearTimeout(u),t==null||t.removeEventListener("abort",c),l((t==null?void 0:t.reason)??new DOMException("Aborted","AbortError"))},u=globalThis.setTimeout(()=>{t==null||t.removeEventListener("abort",c),o()},i);t==null||t.addEventListener("abort",c,{once:!0})})}return null}const I8="ap-southeast-1",mz="cn-beijing",zet="https://ark.ap-southeast.bytepluses.com/api/v3",Vet="https://ark.cn-beijing.volces.com/api/v3/",Het="https://console.byteplus.com/ark/region:ark+ap-southeast-1/openManagement",qet="https://console.volcengine.com/ark/region:ark+cn-beijing/openManagement",Wet="dola-seed-2-1-turbo-260628",Ket="doubao-seed-2-1-pro-260628",Get="skylark-embedding-vision-250615",Xet="doubao-embedding-vision-250615",Yet="seed-2-0-lite-260228",Zet="doubao-seed-2-0-lite-260428",Jet="dola-seedream-5-0-pro-260628",ett="doubao-seedream-5-0-260128",ttt="seededit-3-0-i2i-250628",ntt="doubao-seededit-3-0-i2i-250628",itt="dreamina-seedance-2-0-260128",rtt="doubao-seedance-2-0-260128";function _u(e){return e==="byteplus"?[{value:I8,label:I8}]:[{value:"cn-beijing",label:Q("cloudRegion.cnBeijing")},{value:"cn-shanghai",label:Q("cloudRegion.cnShanghai")}]}function Zi(e){var t;return((t=_u(e)[0])==null?void 0:t.value)||mz}const stt=new Set(["cn-beijing","cn-shanghai","ap-southeast-1"]);function AD(e){return typeof e=="string"&&stt.has(e)}function wh(e,t){var i;return((i=(t?_u(t):[..._u("volcengine"),..._u("byteplus")]).find(r=>r.value===e))==null?void 0:i.label)||e||"-"}function Kp(e){return e==="byteplus"?Wet:Ket}function Po(e){return e==="byteplus"?zet:Vet}function att(e){return e==="byteplus"?Het:qet}function ott(e){return e==="byteplus"?Get:Xet}function ltt(e){return e==="byteplus"?Yet:Zet}function ctt(e){return e==="byteplus"?Jet:ett}function utt(e){return e==="byteplus"?ttt:ntt}function dtt(e){return e==="byteplus"?itt:rtt}const gz="veadk.messageFeedback.v1";function bz(e,t,n,i){return[e,t,n,i].join(":")}function yz(){if(typeof window>"u")return{};try{const e=JSON.parse(localStorage.getItem(gz)??"{}");return e&&typeof e=="object"?e:{}}catch{return{}}}function ftt(e,t,n){if(typeof window>"u")return;const i=yz();i[e]={...i[e]??{},[`veadk_feedback:${t}`]:n},localStorage.setItem(gz,JSON.stringify(i))}function HAe(e){if(typeof window>"u")return;const t=bz(e.runtimeId,e.appName,e.userId,e.sessionId),n=yz(),i=n[t];if(i){for(const r of e.eventIds)delete i[`veadk_feedback:${r}`];Object.keys(i).length===0?delete n[t]:n[t]=i,localStorage.setItem(gz,JSON.stringify(n))}}const lN="",vz=new Map;function qAe(e,t){vz.set(e,t)}function WAe(){vz.clear()}function Na(e){const t=vz.get(e);return t?{app:t.app,ep:{base:t.base,apiKey:t.apiKey,runtimeId:t.runtimeId,mpaInstanceId:t.mpaInstanceId,region:t.region,agentCategory:t.agentCategory}}:{app:e,ep:{}}}function F1(e,t){return e!=="a2a-default"&&!!(t.runtimeId&&(t.agentCategory==="mpa"||t.mpaInstanceId))}async function gt(e,t={},n={},i=ho){const r=po(t.signal,i),s=!!n.runtimeId&&String(t.method??"GET").toUpperCase()==="DELETE",o={...t,...s?{method:"POST"}:{},headers:ul(uc(t.headers))},l=()=>{const d={...o,signal:r};if(n.runtimeId){const f=new URLSearchParams;n.region&&f.set("_runtime_region",n.region),n.retryProbe&&f.set("probe_retry","connect"),s&&f.set("_method","DELETE");const h=f.toString()?`${e.includes("?")?"&":"?"}${f.toString()}`:"";return fetch(Ta(`${lN}/web/runtime-proxy/${n.runtimeId}${e}${h}`),d)}if(n.base){const f=new Headers(d.headers);return f.set("X-AgentKit-Base",n.base),n.apiKey&&f.set("X-AgentKit-Key",n.apiKey),fetch(Ta(`${lN}/agentkit-proxy${e}`),{...d,headers:f})}return fetch(Ta(`${lN}${e}`),d)},c=async d=>{if(d.headers.get("X-Studio-Error-Source")==="upstream")return!1;if(wet(d))return!0;if(d.status!==401)return!1;try{return await get()}catch{return!1}};let u=await l();for(;await c(u);)await Oet(r),u=await l();return u}function yn(e,t={},n=ho){return gt(e,t,{},n)}function KAe(e){return typeof e=="string"?e:Array.isArray(e)?e.map(t=>{var n;if(t&&typeof t=="object"&&"msg"in t){const i=Array.isArray(t.loc)?(n=t.loc)==null?void 0:n.join("."):"",r=String(t.msg??"");return i?`${i}: ${r}`:r}return String(t)}).filter(Boolean).join(` -`):e&&typeof e=="object"?JSON.stringify(e):""}async function htt(e){const t=await e.clone().text().catch(()=>"");if(!t)return"";try{const n=JSON.parse(t),i=n.detail??n.error;if(typeof i=="string")return i;if(i&&typeof i=="object"&&"code"in i)return String(i.code??"")}catch{return""}return""}async function Ft(e,t){const n=e.headers.get("X-Studio-Error-Source"),i=n==="upstream"?e.headers.get("X-Studio-Upstream-Status")??e.status:e.status,r=Q("common.fallbackWithHttpStatus",{fallback:t,status:i}),s=await e.text().catch(()=>"");if(n==="upstream")return Q("client.errorWithCloudResponse",{context:r,action:e.headers.get("X-Studio-Upstream-Action")??"",response:s||Q("client.emptyCloudResponse")});if(!s)return r;try{const o=JSON.parse(s),l=KAe(o.detail??o.error);return n==="transport"||n==="studio"?l?`${r} -${l}`:r:l?Q("client.errorWithDetailAndRawResponse",{context:r,detail:l,response:s}):Q("client.errorWithRawResponse",{context:r,response:s})}catch{return Q("client.errorWithRawResponse",{context:r,response:s})}}async function ptt(e){const t=await Ft(e,Q("client.mpaRuntimeSessionsLoadFailed"));return e.status===401&&/X-Jwt-Token/i.test(t)?Q("client.mpaRuntimeLegacyAuthUnsupported",{detail:t}):t}async function xz(e,t=!1){const n=await gt(`/web/model-api-keys${t?"?refresh=true":""}`,{signal:e,cache:"no-store"});if(!n.ok)throw new Error(await Ft(n,Q("client.loadArkApiKeysFailed")));return await n.json()}async function GAe(e,t){const n=await gt(`/web/model-api-keys/${encodeURIComponent(e)}/value`,{method:"POST",signal:t,cache:"no-store"});if(!n.ok)throw new Error(await Ft(n,Q("client.loadArkApiKeysFailed")));return await n.json()}async function B1(e){const t=new URLSearchParams;e!=null&&e.apiKeyId&&t.set("apiKeyId",e.apiKeyId),e!=null&&e.refresh&&t.set("refresh","true"),e!=null&&e.scope&&t.set("scope",e.scope);const n=t.toString(),i=await gt(`/web/model-options${n?`?${n}`:""}`,{signal:e==null?void 0:e.signal,cache:"no-store"});if(!i.ok)throw new Error(await Ft(i,Q("client.loadModelsFailed")));return await i.json()}async function XAe(){const e=await gt("/list-apps");if(!e.ok)throw new Error(`list-apps failed: ${e.status}`);return e.json()}class U1 extends Error{constructor(){super(Q("client.runtimeAccessDenied")),this.name="RuntimeAccessDeniedError"}}class Oa extends Error{constructor(t,n=!1,i=!1){super(t),this.unsupported=n,this.retryable=i,this.name="RuntimeProbeError"}}const YAe=()=>Q("client.privateRuntimeUnavailable"),ZAe=()=>Q("client.runtimeTemporarilyUnavailable"),KZ=["cn-beijing","cn-shanghai"],mtt=3e4,Q1=5*60*1e3,JAe=60*1e3;let rC="volcengine";const tw=new Map,dy=new Map,fy=new Map,nf=new Map,ss=new Map;function wz(e,t,n){return`${t}:${e}:${n??""}`}function eTe(e){e!==rC&&ss.clear(),rC=e}function LA(e){const t=(e||"").trim();if(rC==="byteplus")return[t&&!t.startsWith("cn-")?t:I8];const n=t&&!t.startsWith("ap-")?t:mz;return KZ.includes(n)?[n,...KZ.filter(i=>i!==n)]:[n]}function TD(e){const t=(e||"").trim();return t?[t]:LA()}function B0(...e){return e.map(t=>String(t??"")).join("")}function Sb(e,t,n){const i=e.get(t);return i!=null&&i.value&&Date.now()-i.updatedAt<=n?i.value:null}function Oz(e,t,n){return e.set(t,{value:n,updatedAt:Date.now()}),n}function Y2(e,t){return t?t.aborted?Promise.reject(new DOMException("The operation was aborted.","AbortError")):new Promise((n,i)=>{const r=()=>{i(new DOMException("The operation was aborted.","AbortError"))};t.addEventListener("abort",r,{once:!0}),e.then(s=>{t.removeEventListener("abort",r),n(s)},s=>{t.removeEventListener("abort",r),i(s)})}):e}async function tTe(e){try{const t=await e.clone().json();return typeof t.detail=="string"?t.detail:""}catch{return""}}async function $A(e,t,n,i,r=ho){const s=await gt("/list-apps",{signal:i},n??{base:e,apiKey:t},r),o=n!=null&&n.runtimeId?await tTe(s):"";if(n!=null&&n.runtimeId&&o==="runtime_access_denied")throw new U1;if(n!=null&&n.runtimeId&&o==="runtime_private_endpoint_unreachable")throw new Oa(YAe());if(n!=null&&n.runtimeId&&["runtime_proxy_connect_error","runtime_proxy_timeout","runtime_json_connect_error","runtime_json_timeout"].includes(o))throw new Oa(ZAe(),!1,!0);if(n!=null&&n.runtimeId&&s.status===404)throw new Oa(Q("client.runtimeConnectionUnsupported"),!0,!0);if(n!=null&&n.runtimeId&&(s.status===401||s.status===403))throw new Oa(Q("client.runtimeConnectionDenied"));if(!s.ok)throw new Error(await Ft(s,Q("client.listAgentsFailed")));let l;try{l=await s.json()}catch{throw new Oa(Q("client.invalidListAppsJson"))}if(!Array.isArray(l)||l.some(u=>typeof u!="string"||!u.trim()))throw new Oa(Q("client.invalidListAppsFormat"));const c=l.map(u=>u.trim());return n!=null&&n.runtimeId&&tw.set(wz(n.runtimeId,n.region??"",n.runtimeVersion),{apps:c,expiresAt:Date.now()+mtt}),c}async function nTe(e,t){const{app:n,ep:i}=Na(e);if(F1(n,i)){const o=await gtt(i),l=await gt(`/api/v1/agents/${encodeURIComponent(o)}/profile-status`,{cache:"no-store"},i),c=!l.ok&&await htt(l)==="profile_not_found";if(!l.ok&&!c){const m=Q("client.createSessionFailedWithStatus",{status:l.status}),g=await Ft(l,Q("client.createSessionFailed"));throw new Error(g===m?m:Q("common.fallbackWithDetail",{fallback:m,detail:g}))}const u=c?{}:await l.json(),d=Number(u.profileRevision??0),f=await gt("/api/v1/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mpaInstanceId:o,profileRevision:d})},i);if(!f.ok){const m=Q("client.createSessionFailedWithStatus",{status:f.status}),g=await Ft(f,Q("client.createSessionFailed"));throw new Error(g===m?m:Q("common.fallbackWithDetail",{fallback:m,detail:g}))}const h=await f.json();return String(h.sessionId??h.id??"")}const r=await gt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"},i);if(!r.ok){const o=Q("client.createSessionFailedWithStatus",{status:r.status}),l=await Ft(r,Q("client.createSessionFailed"));throw new Error(l===o?o:Q("common.fallbackWithDetail",{fallback:o,detail:l}))}return(await r.json()).id}async function gtt(e){var i,r,s,o;const t=(i=e.mpaInstanceId)==null?void 0:i.trim();if(t)return t;const n=((r=e.runtimeId)==null?void 0:r.trim())??"";if(!n)return"";try{const l=await DD(n,e.region??"cn-beijing"),c=(s=l.mpaInstanceId)==null?void 0:s.trim();if(c)return c;const u=(o=l.envs.find(d=>d.key==="MPA_AGENT_ID"))==null?void 0:o.value.trim();if(u)return u}catch{}return n}async function kz(e,t){const{app:n,ep:i}=Na(e);if(F1(n,i)){const s=await gt("/api/v1/sessions",{cache:"no-store"},i);if(!s.ok)throw new Error(await ptt(s));const o=await s.json();return Array.isArray(o)?o:o.sessions??[]}const r=await gt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{},i);if(!r.ok)throw new Error(await Ft(r,Q("client.listSessionsFailed")));return r.json()}async function sC(e,t,n){const{app:i,ep:r}=Na(e);if(F1(i,r)){const l=await gt(`/api/v1/sessions/${encodeURIComponent(n)}`,{cache:"no-store"},r);if(!l.ok){const f=await Ft(l,Q("client.getSessionFailed"));throw new Error(Q("client.getSessionFailedWithDetail",{status:l.status,detail:f}))}const c=await l.json(),u=await gt(`/api/v1/sessions/${encodeURIComponent(n)}/events`,{cache:"no-store"},r);if(!u.ok){const f=await Ft(u,Q("client.getSessionFailed"));throw new Error(Q("client.getSessionFailedWithDetail",{status:u.status,detail:f}))}const d=await u.json();return c.events=Array.isArray(d.events)?d.events:[],c}const s=await gt(`/apps/${i}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}`,{},r);if(!s.ok){const l=await Ft(s,Q("client.getSessionFailed"));throw new Error(Q("client.getSessionFailedWithDetail",{status:s.status,detail:l}))}const o=await s.json();if(r.runtimeId){const l=bz(r.runtimeId,i,t,n);o.state={...yz()[l]??{},...o.state??{}}}return o}async function iTe(e){const{app:t,ep:n}=Na(e.appName);if(!n.runtimeId)throw new Error(Q("client.feedbackRuntimeOnly"));if(!n.region)throw new Error(Q("client.feedbackRegionMissing"));const i=await gt("/web/evaluation/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:n.runtimeId,region:n.region,appName:t,userId:e.userId,sessionId:e.sessionId,eventId:e.eventId,rating:e.rating,comment:e.comment??""})},{},hr);if(!i.ok)throw new Error(await Ft(i,Q("client.submitFeedbackFailed")));const r=await i.json(),s=bz(n.runtimeId,t,e.userId,e.sessionId);return ftt(s,e.eventId,r),r}async function _D(e,t={}){const n=B0(e.runtimeId,e.region||"cn-beijing",e.appName,e.pageSize??100),i=Sb(nf,n,JAe);if(!t.force&&i)return i;const r=nf.get(n);if(!t.force&&(r!=null&&r.promise))return r.promise;let s=null;const o=(async()=>{for(const l of TD(e.region)){const c=new URLSearchParams({runtimeId:e.runtimeId,region:l,appName:e.appName,page_size:String(e.pageSize??100)}),u=await gt(`/web/evaluation/feedback-cases?${c.toString()}`);if(u.ok)return Oz(nf,n,await u.json());s=new Error(await Ft(u,Q("client.loadEvaluationSetsFailed")))}throw s??new Error(Q("client.loadEvaluationSetsFailed"))})();nf.set(n,{...r,promise:o,updatedAt:(r==null?void 0:r.updatedAt)??0});try{return await o}finally{const l=nf.get(n);(l==null?void 0:l.promise)===o&&nf.set(n,{value:l.value,updatedAt:l.updatedAt})}}async function P8(e){let t=null;for(const n of TD(e.region)){const i=new URLSearchParams({runtimeId:e.runtimeId,region:n,appName:e.appName,userId:e.userId}),r=await gt(`/web/evaluation/statuses?${i.toString()}`);if(r.ok)return r.json();t=new Error(await Ft(r,Q("client.loadAutoEvaluationStatusFailed")))}throw t??new Error(Q("client.loadAutoEvaluationStatusFailed"))}async function rTe(e){let t=null;for(const n of TD(e.region)){const i=new URLSearchParams({runtimeId:e.runtimeId,region:n,appName:e.appName}),r=await gt(`/web/evaluation/optimizations?${i.toString()}`);if(r.ok)return r.json();t=new Error(await Ft(r,Q("client.loadOptimizationsFailed")))}throw t??new Error(Q("client.loadOptimizationsFailed"))}function sTe(e){return Sb(nf,B0(e.runtimeId,e.region||"cn-beijing",e.appName,e.pageSize??100),JAe)}function btt(e){_D(e).catch(()=>{})}function aTe(e){_D(e,{force:!0}).catch(()=>{})}function oTe(e,t){return["good","bad"].map(n=>{const i=e.find(r=>r.kind===n);return{kind:n,evaluationSetId:(i==null?void 0:i.evaluationSetId)??null,evaluationSetName:(i==null?void 0:i.evaluationSetName)??null,workspaceId:(i==null?void 0:i.workspaceId)??null,itemCount:t.filter(r=>r.kind===n).length}})}function cN(e){const t=e.comment??"",n=e.rating==="bad"&&!!t.trim();for(const[i,r]of nf.entries()){const s=r.value;if(!s||s.runtimeId!==e.runtimeId||s.agentName!==e.appName)continue;const o=s.items.filter(c=>c.sessionId!==e.sessionId||c.messageId!==e.messageId),l=e.rating?[{id:`local:${e.runtimeId}:${e.sessionId}:${e.messageId}`,itemKey:`local:${e.messageId}`,kind:e.rating,input:e.input,output:e.output,referenceOutput:e.referenceOutput??e.output,comment:t,agentName:e.appName,sessionId:e.sessionId,messageId:e.messageId,runtimeId:e.runtimeId,invocationId:e.invocationId??"",userId:e.userId,createdAt:e.createdAt??new Date().toISOString(),evaluationSetId:"",evaluationSetName:"",workspaceId:"",source:"user",score:n?0:null,reason:n?t:""},...o]:o;nf.set(i,{value:{...s,sets:oTe(s.sets,l),items:l},updatedAt:Date.now(),promise:r.promise})}}async function lTe(e){let t=null;for(const n of TD(e.region)){const i=await gt("/web/evaluation/feedback-cases/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e.runtimeId,region:n,appName:e.appName,itemIds:e.itemIds})},{},hr);if(i.ok){const r=await i.json(),s=new Set(e.itemIds);for(const[o,l]of nf.entries()){const c=l.value;if(!c||c.runtimeId!==e.runtimeId||c.agentName!==e.appName)continue;const u=c.items.filter(d=>!s.has(d.id));nf.set(o,{value:{...c,sets:oTe(c.sets,u),items:u},updatedAt:Date.now()})}return r}t=new Error(await Ft(i,Q("client.deleteEvaluationCaseFailed")))}throw t??new Error(Q("client.deleteEvaluationCaseFailed"))}async function D8(e,t,n){const{app:i,ep:r}=Na(e);if(F1(i,r)){const o=await gt(`/api/v1/sessions/${encodeURIComponent(n)}`,{method:"DELETE"},r);if(!o.ok&&o.status!==404)throw new Error(`delete session failed: ${o.status}`);return}const s=await gt(`/apps/${i}/users/${encodeURIComponent(t)}/sessions/${n}`,{method:"DELETE"},r);if(!s.ok&&s.status!==404)throw new Error(`delete session failed: ${s.status}`)}function ytt(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"="),i=window.atob(n),r=new Uint8Array(i.length);for(let s=0;sURL.revokeObjectURL(l),0)}async function uTe(e,t,n,i,r){const{app:s,ep:o}=Na(e),l=r==null?"":`?version=${encodeURIComponent(r)}`,c=`/apps/${encodeURIComponent(s)}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}/artifacts/${encodeURIComponent(i)}${l}`,u=await gt(c,{},o,hr);if(!u.ok)throw new Error(await Ft(u,Q("client.downloadFileFailed")));const d=await u.json(),f=d.inlineData??d.inline_data;if(!(f!=null&&f.data))throw new Error(Q("client.fileUnavailable"));const h=ytt(f.data),m=h.buffer.slice(h.byteOffset,h.byteOffset+h.byteLength);return{blob:new Blob([m],{type:f.mimeType??f.mime_type??"application/octet-stream"}),downloadName:f.displayName??f.display_name??i}}async function Ez(e,t,n,i,r){const{blob:s}=await uTe(e,t,n,i,r);return URL.createObjectURL(s)}async function vtt(e){const t=await gt("/web/media/capabilities");if(!t.ok)throw new Error(await Ft(t,"media capabilities failed"));return t.json()}async function dTe(e,t,n,i){const{app:r}=Na(e),s=new FormData;s.set("app_name",r),s.set("user_id",t),s.set("session_id",n),s.set("file",i);const o=await gt("/web/media",{method:"POST",body:s},{},hr);if(!o.ok)throw new Error(await Ft(o,Q("client.uploadFileFailed")));return{...await o.json(),status:"ready"}}async function M8(e,t,n){const{app:i}=Na(e),r=`/web/media/${encodeURIComponent(i)}/${encodeURIComponent(t)}/${encodeURIComponent(n)}/delete`,s=await gt(r,{method:"POST"});if(!s.ok&&s.status!==404)throw new Error(await Ft(s,"media cleanup failed"))}function fTe(e){try{const t=new URL(e);if(t.protocol!=="veadk-media:"||t.hostname!=="apps")return;const n=t.pathname.split("/").filter(Boolean).map(decodeURIComponent);return n.length!==7||n[1]!=="users"||n[3]!=="sessions"||n[5]!=="media"?void 0:`/web/media/${n.map(encodeURIComponent).filter((i,r)=>![1,3,5].includes(r)).join("/")}`}catch{return}}async function uN(e,t){const n=fTe(t);if(!n)throw new Error("Invalid VeADK media URI");const i=await gt(`${n}/delete`,{method:"POST"});if(!i.ok&&i.status!==404)throw new Error(await Ft(i,"media cleanup failed"))}function hTe(e,t){if(t.startsWith("data:")||t.startsWith("blob:")||/^https?:/.test(t))return t;const n=fTe(t);if(!n)return t;const i=`${n}/content`;return Ta(`${lN}${i}`)}async function ZR(e,t,n){const{app:i,ep:r}=Na(e);let s;if(r.runtimeId){const c=new URLSearchParams({runtimeId:r.runtimeId,sessionId:t,region:r.region??"cn-beijing"});if(n&&c.set("endTimeMs",String(Math.round(n))),s=await gt(`/web/runtime-trace?${c.toString()}`),s.status===404)throw new Error(Q("client.traceDisabled"))}else s=await gt(`/dev/apps/${encodeURIComponent(i)}/debug/trace/session/${encodeURIComponent(t)}`,{},r);if(!s.ok)throw new Error(await Ft(s,Q("client.loadTraceFailed")));const o=s.headers.get("content-type")??"";if(!o.includes("application/json")){const c=o.split(";",1)[0]||Q("client.contentTypeMissing");throw new Error(Q("client.traceNonJson",{contentType:c}))}const l=await s.json();if(!Array.isArray(l))throw new Error(Q("client.invalidTraceFormat"));return l}async function L8(e){const t=await gt("/web/issue-feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await Ft(t,Q("client.submitIssueFeedbackFailed")));if((await t.json()).submitted!==!0)throw new Error(Q("client.issueFeedbackNotConfirmed"));return{submitted:!0}}async function GZ(e,t,n=!0,i){const r=await gt(`/web/agent-info/${e}`,{signal:i},t);if(!r.ok)throw new Error(`agent-info failed: ${r.status}`);const s=await r.json();if(n&&!s.draft)try{const o=await gt(`/web/agent-draft/${e}`,{},t);if(o.ok){const l=await o.json();s.draft=l.draft}}catch{}return{appName:e,agentCategory:s.agentCategory,mpa:s.mpa,name:s.name??e,description:s.description??"",type:s.type,model:s.model??"",selectableModels:s.selectableModels??[],turnLifecycleControl:s.turnLifecycleControl,resourceTopology:s.resourceTopology,tools:s.tools??[],skillsPreviewSupported:Array.isArray(s.skills),skills:s.skills??[],subAgents:s.subAgents??[],components:s.components??[],searchSources:s.searchSources??[],graph:s.graph,draft:s.draft}}function xtt(e){return/agent-info failed:\s*404\b/i.test(String(e))}async function pTe(e,t,n=!0,i){try{return await GZ(e,t,n,i)}catch(r){if(e==="a2a-default"||!xtt(r))throw r;return GZ("a2a-default",t,n,i)}}class jD extends Error{constructor(t){super("Turn state changed before the control request completed"),this.authoritativeState=t,this.name="TurnControlConflictError"}}async function mTe(e,t){const{ep:n}=Na(e),i=await gt(`/api/v1/a2a/tasks/by-session/${encodeURIComponent(t)}/control`,{cache:"no-store"},n);if(!i.ok)throw new Error(await Ft(i,"turn control failed"));return i.json()}async function gTe(e,t,n,i){var o;const{ep:r}=Na(e),s=await gt(`/api/v1/a2a/tasks/by-session/${encodeURIComponent(t)}/control/${n}`,{method:"POST",headers:{"Content-Type":"application/json","Idempotency-Key":crypto.randomUUID()},body:JSON.stringify({expectedGeneration:i})},r);if(s.status===409){const l=await s.json().catch(()=>null);if((o=l==null?void 0:l.detail)!=null&&o.taskId)throw new jD(l.detail)}if(!s.ok)throw new Error(await Ft(s,"turn control failed"));return s.json()}async function wtt(e,t,n,i,r){var c;const{ep:s}=Na(e),o=await gt(`/api/v1/a2a/tasks/${encodeURIComponent(n)}/continue`,{method:"POST",headers:{"Content-Type":"application/json","Idempotency-Key":r},body:JSON.stringify({expectedGeneration:i})},s);if(o.status===409){const u=await o.json().catch(()=>null);if((c=u==null?void 0:u.detail)!=null&&c.taskId)throw new jD(u.detail)}if(!o.ok)throw new Error(await Ft(o,"turn continue failed"));const l=await o.json();if(l.sessionId!==t)throw new Error("turn continue returned a different session");return l}async function*bTe({appName:e,sessionId:t,taskId:n,expectedGeneration:i,idempotencyKey:r,lastEventId:s,signal:o,onRuntimeContext:l}){const{ep:c}=Na(e),u=(s==null?void 0:s.trim())??"",d=Tz(o);let f;try{const g=await gt(`/api/v1/a2a/tasks/${encodeURIComponent(n)}/continue`,{method:"POST",headers:{"Content-Type":"application/json","Idempotency-Key":r},body:JSON.stringify({expectedGeneration:i}),signal:d.signal},c,0),b=YR(g,c.runtimeId??"",c.region??"");if(b&&(l==null||l(b)),!g.ok){d.cleanup();const y=await Ft(g,"turn continue failed");throw new Error(Jo(Q("client.runSseFailedWithDetail",{status:g.status,detail:y})))}const v=await g.json();if(v.sessionId!==t)throw d.cleanup(),new Error(Jo("turn continue returned a different session"));f=await gt(`/api/v1/sessions/${encodeURIComponent(t)}/sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invocationId:v.invocationId,...u?{lastEventId:u}:{}}),signal:d.signal},c,0)}catch(g){throw d.cleanup(),d.timedOut()?new Error(Gg()):o!=null&&o.aborted||(g==null?void 0:g.name)==="AbortError"?g:new Error(Jo(g))}const h=YR(f,c.runtimeId??"",c.region??"");if(h&&(l==null||l(h)),!f.ok){d.cleanup();const g=await Ft(f,Q("client.runSessionFailed"));throw new Error(Jo(Q("client.runSseFailedWithDetail",{status:f.status,detail:g})))}let m=!1;try{for await(const g of MA(f)){if(g&&typeof g=="object"&&g[iC]==="done"){d.clearDeadline();break}m=!0,d.clearDeadline();const b={...g};delete b[iC],typeof b.error=="string"&&(b.error=Jo(b.error)),typeof b.errorMessage=="string"&&(b.errorMessage=Jo(b.errorMessage)),typeof b.error_message=="string"&&(b.error_message=Jo(b.error_message)),yield b}}catch(g){throw d.timedOut()?new Error(Gg()):o!=null&&o.aborted||(g==null?void 0:g.name)==="AbortError"?g:new Error(Jo(g))}finally{d.cleanup()}if(!m)throw new Error(Az())}async function $8(e,t){const{app:n,ep:i}=Na(e);return pTe(n,i,!1,t)}async function Ott(e,t,n){let i=null;for(const r of LA(t)){const s={runtimeId:e,region:r};try{const o=wz(e,r),l=tw.get(o);l&&l.expiresAt<=Date.now()&&tw.delete(o);const c=tw.get(o),u=n||(c==null?void 0:c.apps[0])||(await $A("","",s))[0];if(!u)throw new Error(Q("client.noPreviewableAgent"));return pTe(u,s)}catch(o){if(o instanceof U1||o instanceof Oa&&!o.unsupported)throw o;i=o instanceof Error?o:new Error(String(o))}}throw i??new Error(Q("client.noPreviewableAgent"))}async function Cz(e,t,n={},i={}){const r=typeof n=="string"?n:void 0,s=typeof n=="string"?i:n,o=B0(e,t||"cn-beijing",r??""),l=Sb(dy,o,Q1);if(!s.force&&l)return l;const c=dy.get(o);if(!s.force&&(c!=null&&c.promise))return c.promise;const u=Ott(e,t,r).then(d=>Oz(dy,o,d));dy.set(o,{...c,promise:u,updatedAt:(c==null?void 0:c.updatedAt)??0});try{return await u}finally{const d=dy.get(o);(d==null?void 0:d.promise)===u&&dy.set(o,{value:d.value,updatedAt:d.updatedAt})}}function yTe(e,t,n=""){return Sb(dy,B0(e,t||"cn-beijing",n),Q1)}function vTe(e,t,n=""){Cz(e,t,n).catch(()=>{})}function JR(e){const{app:t,ep:n}=Na(e);return F1(t,n)}function np(e){const{app:t,ep:n}=Na(e);return t==="a2a-default"&&!!(n.runtimeId&&(n.agentCategory==="mpa"||n.mpaInstanceId))}async function xTe(e,t,n,i){const{app:r,ep:s}=Na(e),o=new URLSearchParams({source:t,app_name:r,q:n,user_id:i}),l=await gt(`/web/search?${o.toString()}`,{},s);if(!l.ok)throw new Error(await Ft(l,Q("client.agentSearchFailed")));return l.json()}async function wTe(e,t){const{app:n}=Na(e),i=await gt(`/web/search?source=web&app_name=${encodeURIComponent(n)}&q=${encodeURIComponent(t)}`);if(!i.ok)throw new Error(`web search failed: ${i.status}`);return i.json()}function Az(){return Jo(Q("client.emptySseBody"))}function cS(){return Jo(Q("client.noDisplayableSseReply"))}const ktt=6e4;function Gg(){return Q("client.firstSseEventTimeout")}function Tz(e){if(e!=null&&e.aborted)return{signal:e,clearDeadline:()=>{},cleanup:()=>{},timedOut:()=>!1};const t=new AbortController;let n=!1,i=!1;const r=()=>{i||(i=!0,clearTimeout(o))},s=()=>{t.signal.aborted||t.abort((e==null?void 0:e.reason)??new DOMException("Aborted","AbortError"))},o=setTimeout(()=>{i||t.signal.aborted||(n=!0,i=!0,t.abort(new Error(Gg())))},ktt);return e==null||e.addEventListener("abort",s,{once:!0}),{signal:t.signal,clearDeadline:r,cleanup:()=>{r(),e==null||e.removeEventListener("abort",s)},timedOut:()=>n}}async function*F8({appName:e,userId:t,sessionId:n,text:i,modelId:r,idempotencyKey:s,executionConfigVersion:o,lastEventId:l,attachments:c=[],invocation:u,platformTools:d,environmentMounts:f,environmentMount:h,functionResponses:m=[],signal:g,onRuntimeContext:b}){const{app:v,ep:y}=Na(e),w=c.flatMap(I=>I.status&&I.status!=="ready"?[]:I.uri?[{fileData:{mimeType:I.mimeType,fileUri:I.uri,displayName:I.name},partMetadata:{veadkMedia:{id:I.id,uri:I.uri,name:I.name,mimeType:I.mimeType,sizeBytes:I.sizeBytes}}}]:I.data?[{inlineData:{mimeType:I.mimeType,data:I.data,displayName:I.name}}]:[]),x=u&&(u.skills.length>0||u.targetAgent)?u:void 0,O=[...w,...m.map(I=>({functionResponse:{id:I.id,name:I.name,response:I.response}})),...i.trim()?[{text:i}]:[]];if(x&&O.length>0){const I=O[0],D=I.partMetadata;O[0]={...I,partMetadata:{...D,veadkInvocation:x}}}const k=(s==null?void 0:s.trim())??"",S=(l==null?void 0:l.trim())??"",C=typeof o=="number",E=C||k?{veadkExecution:{...C?{executionConfigVersion:o}:{},...k?{idempotencyKey:k}:{}}}:void 0,j=x||E?{...x?{veadkInvocation:x}:{},...E??{}}:void 0,T=F1(v,y);if(T&&y.runtimeId){const I=y.region?`?region=${encodeURIComponent(y.region)}`:"";try{const D=await yn(`/web/mpa/identity-prewarm/${encodeURIComponent(y.runtimeId)}${I}`,{method:"POST",headers:{"X-Requested-With":"XMLHttpRequest"},signal:g},1e4);D.ok||console.warn("[mpa] identity prewarm unavailable",D.status)}catch(D){if(g!=null&&g.aborted)throw D;console.warn("[mpa] identity prewarm unavailable")}}let R;const A=Tz(g);try{if(T){const I=await gt(`/api/v1/sessions/${encodeURIComponent(n)}/run`,{method:"POST",headers:{"Content-Type":"application/json",...k?{"Idempotency-Key":k}:{}},body:JSON.stringify({content:i,...C?{executionConfigVersion:o}:{}}),signal:A.signal},y,0),D=YR(I,y.runtimeId??"",y.region??"");if(D&&(b==null||b(D)),!I.ok){A.cleanup();const L=await Ft(I,Q("client.runSessionFailed"));throw new Error(Jo(Q("client.runSseFailedWithDetail",{status:I.status,detail:L})))}const _=await I.json();R=await gt(`/api/v1/sessions/${encodeURIComponent(n)}/sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invocationId:_.invocationId,...S?{lastEventId:S}:{}}),signal:A.signal},y,0)}else R=await gt("/run_sse",{method:"POST",headers:{"Content-Type":"application/json",...k?{"Idempotency-Key":k}:{}},body:JSON.stringify({app_name:v,user_id:t,session_id:n,new_message:{role:"user",parts:O},streaming:!0,...S?{lastEventId:S}:{},...C?{executionConfigVersion:o}:{},...r!=null&&r.trim()?{model_id:r.trim()}:{},...d!==void 0?{platform_tools:[...d]}:{},...f!==void 0?{environment_mounts:[...f]}:h?{environment_mount:h}:{},custom_metadata:j}),signal:A.signal},y,0)}catch(I){throw A.cleanup(),A.timedOut()?new Error(Gg()):g!=null&&g.aborted||(I==null?void 0:I.name)==="AbortError"?I:new Error(Jo(I))}const N=YR(R,y.runtimeId??"",y.region??"");if(N&&(b==null||b(N)),!R.ok){A.cleanup();const I=await Ft(R,Q("client.runSessionFailed"));throw new Error(Jo(Q("client.runSseFailedWithDetail",{status:R.status,detail:I})))}let P=!1;try{for await(const I of MA(R)){if(I&&typeof I=="object"&&I[iC]==="done"){A.clearDeadline();break}P=!0,A.clearDeadline();const D={...I};delete D[iC],typeof D.error=="string"&&(D.error=Jo(D.error)),typeof D.errorMessage=="string"&&(D.errorMessage=Jo(D.errorMessage)),typeof D.error_message=="string"&&(D.error_message=Jo(D.error_message)),yield D}}catch(I){throw A.timedOut()?new Error(Gg()):g!=null&&g.aborted||(I==null?void 0:I.name)==="AbortError"?I:new Error(Jo(I))}finally{A.cleanup()}if(!P)throw new Error(Az())}class nw extends Error{constructor(n,{status:i,code:r,currentState:s}){super(n);Zt(this,"status");Zt(this,"code");Zt(this,"currentState");this.name="MpaExecutionConfigRequestError",this.status=i,this.code=r,this.currentState=s}}async function _z(e){const t=Q("client.mpaExecutionConfigFailed"),n=await e.text().catch(()=>"");if(!n)return new nw(Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),{status:e.status,code:""});try{const i=JSON.parse(n),r=i.error&&typeof i.error=="object"?i.error:i.detail&&typeof i.detail=="object"?i.detail:null,s=KAe(i.detail??i.error),o=s?Q("client.errorWithDetailAndRawResponse",{context:Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),detail:s,response:n}):Q("client.errorWithRawResponse",{context:Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),response:n});return new nw(o,{status:e.status,code:String((r==null?void 0:r.code)??""),currentState:(r==null?void 0:r.currentState)??i.currentState})}catch{return new nw(Q("client.errorWithRawResponse",{context:Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),response:n}),{status:e.status,code:""})}}function FA(e){var r,s,o;const t=(e.selectedSkills??[]).map(l=>({source:l.source,folder:l.folder,name:l.name,skillSpaceId:l.skillSpaceId,skillSpaceName:l.skillSpaceName,skillSpaceRegion:l.skillSpaceRegion,skillId:l.skillId,version:l.version})),n=(e.skills??[]).map(l=>({name:l})),i=(e.mcpTools??[]).map(l=>({name:l.name,transport:l.transport,url:l.url}));return{name:((r=e.name)==null?void 0:r.trim())||"mpa-agent",description:e.description??"",system:((s=e.instruction)==null?void 0:s.trim())||"You are a helpful assistant.",model:{id:e.modelName||e.model||"",source:e.modelSource??"ark",provider:e.modelProvider??"",apiBase:e.modelApiBase??""},tools:[...(e.builtinTools??[]).map(l=>({id:l,source:"builtin"})),...(e.tools??[]).map(l=>({name:l,source:"legacy"})),...(e.customTools??[]).map(l=>({name:l.name,description:l.description,source:"custom"}))],skills:[...t,...n],mcpServers:i,...(o=e.subAgents)!=null&&o.length?{multiagent:{type:e.agentType??"llm",subAgents:e.subAgents.map(FA)}}:{},metadata:{"veadk:agent-type":"mpa","veadk:source":"studio-agent-draft",agentType:e.agentType??"llm"}}}async function jz(e){const t={operationKind:e.operationKind,runtimeId:e.runtimeId,region:e.region,mpaInstanceId:e.mpaInstanceId,sourceProfileId:e.sourceProfileId,targetKey:e.targetKey,runtimeRevision:e.runtimeRevision,profile:FA(e.draft)},n=e.operationKind==="update"?`/web/mpa/agents/${encodeURIComponent(e.mpaInstanceId)}`:"/web/mpa/agents",i=await gt(n,{method:e.operationKind==="update"?"PATCH":"POST",headers:{"Content-Type":"application/json","Idempotency-Key":e.idempotencyKey},body:JSON.stringify(t)});if(!i.ok)throw new Error(await Ft(i,Q("client.mpaOperationFailed")));return await i.json()}async function eI(e){var r,s,o,l;const t=e.runtimeId.trim(),n=((r=e.mpaInstanceId)==null?void 0:r.trim())||t,i=(s=e.sourceDraftId)!=null&&s.trim()?`studio-draft:${e.sourceDraftId.trim()}`:`studio-agent:${e.agentName}:${e.taskId}`;return jz({operationKind:e.operationKind,runtimeId:t,region:e.region,mpaInstanceId:n,sourceProfileId:i,draft:e.draft,targetKey:e.operationKind==="update"?n:`runtime:${e.region}:${((o=e.runtimeName)==null?void 0:o.trim())||n}`,runtimeRevision:((l=e.runtimeRevision)==null?void 0:l.trim())||void 0,idempotencyKey:`${e.taskId}:mpa-profile`})}async function OTe(){const e=await gt("/web/mpa/agent-operations?status=active",{cache:"no-store"});if(!e.ok)throw new Error(await Ft(e,Q("client.mpaOperationLoadFailed")));return(await e.json()).operations??[]}async function kTe(e,t){const n=await gt(`/web/mpa/agent-operations/${encodeURIComponent(e)}`,{cache:"no-store",signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.mpaOperationLoadFailed")));return await n.json()}async function STe(e){const t=new URLSearchParams({runtimeId:e.runtimeId,region:e.region}),n=await gt(`/web/mpa/agents/${encodeURIComponent(e.mpaInstanceId)}/profile-status?${t.toString()}`,{cache:"no-store",signal:e.signal});if(!n.ok)throw new Error(await Ft(n,Q("client.mpaOperationLoadFailed")));const i=await n.json();return{operationId:String(i.operationId??""),status:String(i.status??""),profileRevision:Number(i.profileRevision??0),runtimeRevision:String(i.runtimeRevision??""),etag:String(i.etag??n.headers.get("ETag")??"")}}async function ETe(e){const t=new URLSearchParams({region:e.region??"all"});e.runtimeId&&t.set("runtimeId",e.runtimeId);const n=await gt(`/web/mpa/agents/${encodeURIComponent(e.mpaInstanceId)}/view?${t.toString()}`,{cache:"no-store",signal:e.signal});if(!n.ok)throw new Error(await Ft(n,Q("client.mpaOperationLoadFailed")));return await n.json()}async function CTe(e){const t=new URLSearchParams({runtimeId:e.runtimeId,region:e.region}),n=await gt(`/web/mpa/agents/${encodeURIComponent(e.mpaInstanceId)}/delete-preview?${t.toString()}`,{cache:"no-store",signal:e.signal});if(!n.ok)throw new Error(await Ft(n,Q("client.mpaDeletePreviewFailed")));return await n.json()}async function ATe(e){const t={runtimeId:e.runtimeId,region:e.region},n=await gt(`/api/v1/runtime-console/admin/sessions/${encodeURIComponent(e.sessionId)}/runs`,{cache:"no-store",signal:e.signal},t);if(!n.ok)throw new Error(await Ft(n,Q("client.loadMpaDiagnosticsFailed")));return await n.json()}async function TTe(e){const t={runtimeId:e.runtimeId,region:e.region},n=new URLSearchParams({sessionId:e.sessionId}),i=await gt(`/api/v1/runtime-console/admin/runs/${encodeURIComponent(e.invocationId)}/trace?${n.toString()}`,{cache:"no-store",signal:e.signal},t);if(!i.ok)throw new Error(await Ft(i,Q("client.loadMpaDiagnosticsFailed")));return await i.json()}async function Nz(e,t){const n=await gt(`/web/mpa/agent-operations/${encodeURIComponent(e)}/retry`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operationKind:t.operationKind,runtimeId:t.runtimeId,region:t.region,mpaInstanceId:t.mpaInstanceId,sourceProfileId:t.sourceProfileId,targetKey:t.targetKey,runtimeRevision:t.runtimeRevision,profile:FA(t.draft)})});if(!n.ok)throw new Error(await Ft(n,Q("client.mpaOperationFailed")));return await n.json()}async function Rz(e){const t=new URLSearchParams({runtimeId:e.runtimeId,region:e.region}),n=await gt(`/web/mpa/sessions/${encodeURIComponent(e.sessionId)}/execution-config?${t.toString()}`,{cache:"no-store",signal:e.signal});if(!n.ok)throw await _z(n);return await n.json()}async function B8(e){const t=await gt(`/web/mpa/sessions/${encodeURIComponent(e.sessionId)}/execution-config`,{method:"PATCH",headers:{"Content-Type":"application/json","If-Match":e.etag},body:JSON.stringify({runtimeId:e.runtimeId,region:e.region,changes:e.changes})});if(!t.ok)throw await _z(t);return await t.json()}async function _Te(e){const t=await gt(`/web/mpa/sessions/${encodeURIComponent(e.sessionId)}/profile-upgrade`,{method:"POST",headers:{"Content-Type":"application/json","If-Match":e.etag,"Idempotency-Key":e.idempotencyKey},body:JSON.stringify({runtimeId:e.runtimeId,region:e.region,targetProfileRevision:e.targetProfileRevision})});if(!t.ok)throw await _z(t);return await t.json()}async function ND(e,t){const n=new URLSearchParams({name:e,region:t}),i=await gt(`/web/runtime-name-availability?${n.toString()}`,{cache:"no-store"});if(!i.ok)throw new Error(await Ft(i,Q("client.checkRuntimeNameFailed")));const r=await i.json();if(typeof r.available!="boolean")throw new Error(Q("client.invalidRuntimeNameCheck"));return{available:r.available}}async function jTe(e,t){const n=new URLSearchParams({kind:e.kind,region:e.region});e.registry&&n.set("registry",e.registry),e.namespace&&n.set("namespace",e.namespace),e.workspaceId&&n.set("workspaceId",e.workspaceId),e.search&&n.set("search",e.search),e.pageNumber&&n.set("pageNumber",String(e.pageNumber)),e.pageSize&&n.set("pageSize",String(e.pageSize));const i=await gt(`/web/deployment-resources?${n.toString()}`,{signal:t});if(!i.ok)throw new Error(await Ft(i,Q("client.loadCloudResourcesFailed")));const r=await i.json();if(typeof r.serviceRegion!="string"||!Array.isArray(r.items)||typeof r.pageNumber!="number"||typeof r.pageSize!="number"||typeof r.totalCount!="number"||typeof r.hasMore!="boolean")throw new Error(Q("client.invalidCloudResources"));const s=r.items.map(o=>{if(!o||typeof o!="object"||typeof o.id!="string"||typeof o.name!="string"||typeof o.region!="string"||typeof o.status!="string")throw new Error(Q("client.invalidCloudResources"));return o});return{serviceRegion:r.serviceRegion,items:s,pageNumber:r.pageNumber,pageSize:r.pageSize,totalCount:r.totalCount,hasMore:r.hasMore}}function NTe(e,t){const n=e;if(!n||typeof n!="object"||!Array.isArray(n.mounts))throw new Error(Q("client.invalidEnvironmentMount"));if(n.mounts.length!==t.length)throw new Error(Q("client.environmentMountMismatch"));return n.mounts.map((i,r)=>{const s=t[r];if(!i||typeof i!="object"||typeof i.environment_id!="string"||typeof i.environment_version_id!="string"||typeof i.mount_instance_id!="string"||typeof i.sandbox_session_id!="string"||!i.environment_id||!i.environment_version_id||!i.mount_instance_id||!i.sandbox_session_id)throw new Error(Q("client.invalidEnvironmentMount"));if(i.environment_id!==s.environment_id||i.environment_version_id!==s.environment_version_id||s.mount_instance_id!==void 0&&i.mount_instance_id!==s.mount_instance_id)throw new Error(Q("client.environmentMountMismatch"));return i})}async function RTe({runtimeId:e,appName:t,userId:n,sessionId:i,environmentMounts:r}){const{app:s}=Na(t);let o;try{o=await gt("/web/v3/session-environment-mounts/prepare",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtime_id:e,app_name:s,user_id:n,session_id:i,environment_mounts:[...r]})})}catch(l){throw l instanceof TypeError?new Error(Q("client.environmentMountNetworkFailed")):l}if(!o.ok)throw new Error(await Ft(o,Q("client.environmentMountFailed")));return NTe(await o.json(),r)}function Iz(e){const t=new Set,n=[];for(const i of e.split(/[,,\n\r]+/)){const r=i.trim();!r||t.has(r)||(t.add(r),n.push(r))}return n}async function ITe(e,t=typeof navigator>"u"?void 0:navigator.clipboard){if(!(t!=null&&t.writeText))throw new Error(Q("client.clipboardUnsupported"));try{await t.writeText(e)}catch{throw new Error(Q("client.clipboardWriteFailed"))}}const XZ={codex:0,codex_snapshot:1,deepseek_harness:2,deepseek_harness_snapshot:3,openclaw:4,openclaw_snapshot:5,hermes:6,hermes_snapshot:7,dev:8};async function PTe(e){var r;const t=await gt("/web/system-info",{signal:e});if(!t.ok)throw new Error(await Ft(t,Q("client.loadSystemInfoFailed")));const n=await t.json();if(typeof((r=n.storage)==null?void 0:r.tosAddress)!="string"||!Array.isArray(n.sandboxTools))throw new Error(Q("client.invalidSystemInfo"));const i=n.sandboxTools.map(s=>{if(!s||typeof s!="object"||typeof s.kind!="string"||typeof s.label!="string"||typeof s.toolId!="string"||typeof s.snapshot!="boolean"||typeof s.needsModelEnvUpdate!="boolean"||typeof s.canUpdateModelEnv!="boolean"||typeof s.modelEnvError!="string"||typeof s.modelEnvErrorCode!="string")throw new Error(Q("client.invalidSystemInfo"));return s}).sort((s,o)=>(XZ[s.kind]??Number.MAX_SAFE_INTEGER)-(XZ[o.kind]??Number.MAX_SAFE_INTEGER));return{storage:{tosAddress:n.storage.tosAddress},sandboxTools:i}}const DTe=new Set(["preparing","queued","building","scanning","available","failed"]);function Pz(e){if(e===null)return null;if(!e||typeof e!="object")throw new Error(Q("client.invalidEnvironmentBuild"));const t=e;if(typeof t.versionId!="string"||!DTe.has(t.status)||typeof t.image!="string"||typeof t.error!="string"||typeof t.createdAt!="string"||typeof t.updatedAt!="string"||t.resources!==null&&typeof t.resources!="object")throw new Error(Q("client.invalidEnvironmentBuild"));const n=Array.isArray(t.steps)?t.steps.map(i=>{if(!i||typeof i!="object"||typeof i.key!="string"||typeof i.label!="string"||!["pending","running","succeeded","failed"].includes(i.status)||i.startedAt!==null&&typeof i.startedAt!="string"||i.finishedAt!==null&&typeof i.finishedAt!="string")throw new Error(Q("client.invalidEnvironmentBuildStep"));return i}):[];return{...t,toolId:typeof t.toolId=="string"?t.toolId:"",toolStatus:["creating","ready","failed"].includes(t.toolStatus)?t.toolStatus:"",runId:typeof t.runId=="string"?t.runId:"",currentStep:typeof t.currentStep=="string"?t.currentStep:"",sourceCommitSha:typeof t.sourceCommitSha=="string"?t.sourceCommitSha:"",steps:n,progressError:typeof t.progressError=="string"?t.progressError:"",logTail:typeof t.logTail=="string"?t.logTail:"",logTruncated:t.logTruncated===!0,logUpdatedAt:typeof t.logUpdatedAt=="string"?t.logUpdatedAt:null,logError:typeof t.logError=="string"?t.logError:""}}function MTe(e){if(!e||typeof e!="object")throw new Error(Q("client.invalidEnvironmentManifest"));const t=e;if(!["agentkit.studio/v3","agentkit.studio/v1alpha1"].includes(t.apiVersion)||t.kind!=="Environment"||!t.metadata||typeof t.metadata.id!="string"||typeof t.metadata.name!="string"||typeof t.metadata.version!="string"||typeof t.metadata.description!="string"||!t.spec||typeof t.spec.image!="string"||!["ubuntu","aio-sandbox","codex-sandbox"].includes(t.spec.baseEnvironment)||typeof t.spec.baseImage!="string"||!["ubuntu-22.04","ubuntu-24.04"].includes(t.spec.operatingSystem)||!["python-3.10","python-3.12"].includes(t.spec.language)||t.spec.executionRuntime!=="veadk"||!Array.isArray(t.spec.packages)||!t.spec.packages.every(n=>typeof n=="string")||!Array.isArray(t.spec.capabilities)||!t.spec.capabilities.every(n=>typeof n=="string")||!Array.isArray(t.spec.skills)||!t.status||!DTe.has(t.status.phase)||typeof t.status.createdAt!="string"||typeof t.status.updatedAt!="string")throw new Error(Q("client.invalidEnvironmentManifest"));return t}function LTe(e){if(e==null)return;if(!e||typeof e!="object")throw new Error(Q("client.invalidImageRepository"));const t=e;if(typeof t.region!="string"||typeof t.registry!="string"||typeof t.namespace!="string"||typeof t.repository!="string")throw new Error(Q("client.invalidImageRepository"));return t}function Stt(e){if(e==null)return;if(!e||typeof e!="object")throw new Error(Q("client.invalidCodeRepository"));const t=e;if(typeof t.repositoryUrl!="string"||t.ref!==void 0&&typeof t.ref!="string"||typeof t.dockerfilePath!="string")throw new Error(Q("client.invalidCodeRepository"));return t}function Ett(e){const t=LTe(e);if(!t)return;const n=e;if(typeof n.reference!="string")throw new Error(Q("client.invalidImageSource"));return{...t,reference:n.reference}}function Dz(e){if(!e||typeof e!="object")throw new Error(Q("client.invalidEnvironment"));const t=e;if(typeof t.id!="string"||typeof t.name!="string"||typeof t.description!="string"||t.baseEnvironment!==void 0&&t.baseEnvironment!=="ubuntu"&&t.baseEnvironment!=="aio-sandbox"&&t.baseEnvironment!=="codex-sandbox"||t.operatingSystem!=="ubuntu-22.04"&&t.operatingSystem!=="ubuntu-24.04"||t.language!=="python-3.10"&&t.language!=="python-3.12"||!Array.isArray(t.optionIds)||!t.optionIds.every(n=>typeof n=="string")||t.selectedSkills!==void 0&&!Array.isArray(t.selectedSkills)||typeof t.dockerfile!="string"||typeof t.createdAt!="string"||typeof t.updatedAt!="string")throw new Error(Q("client.invalidEnvironment"));return{...t,baseEnvironment:t.baseEnvironment==="aio-sandbox"?"aio-sandbox":t.baseEnvironment==="codex-sandbox"?"codex-sandbox":"ubuntu",selectedSkills:t.selectedSkills??[],gitSource:Stt(t.gitSource),containerRepository:LTe(t.containerRepository),imageSource:Ett(t.imageSource),latestVersion:Pz(t.latestVersion)}}function $Te(e){if(!e||typeof e!="object")throw new Error(Q("client.invalidWorkspace"));const t=e;if(typeof t.id!="string"||typeof t.name!="string"||typeof t.description!="string"||!Array.isArray(t.environmentIds)||!t.environmentIds.every(n=>typeof n=="string")||typeof t.createdAt!="string"||typeof t.updatedAt!="string")throw new Error(Q("client.invalidWorkspace"));return t}async function Mz(e){const t=await gt("/web/workspaces",{signal:e});if(!t.ok)throw new Error(await Ft(t,Q("client.loadWorkspacesFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(Q("client.invalidWorkspaceList"));return n.items.map($Te)}async function FTe(e,t,n,i){const r=await gt(e,{method:t,headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:i});if(!r.ok)throw new Error(await Ft(r,Q("client.saveWorkspaceFailed")));return $Te(await r.json())}function BTe(e,t){return FTe("/web/workspaces","POST",e,t)}function UTe(e,t,n){return FTe(`/web/workspaces/${encodeURIComponent(e)}`,"PATCH",t,n)}async function QTe(e,t){const n=await gt(`/web/workspaces/${encodeURIComponent(e)}`,{method:"DELETE",signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.deleteWorkspaceFailed")))}async function BA(e){const t=await gt("/web/v3/environments",{signal:e});if(!t.ok)throw new Error(await Ft(t,Q("client.loadEnvironmentsFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(Q("client.invalidEnvironmentList"));return n.items.map(Dz)}async function zTe(e,t){const n=await gt("/web/v3/environment-repositories/inspect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.probeRepositoryFailed")));const i=await n.json();if(typeof i.repositoryUrl!="string"||typeof i.ref!="string"||typeof i.commitSha!="string"||!Array.isArray(i.dockerfiles)||!i.dockerfiles.every(r=>typeof r=="string"))throw new Error(Q("client.invalidRepositoryProbe"));return i}async function VTe(e,t){const n=await gt(`/web/v3/environments/${encodeURIComponent(e)}/share-code`,{method:"POST",signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.exportEnvironmentCodeFailed")));const i=await n.json();if(typeof i.shareCode!="string"||typeof i.name!="string")throw new Error(Q("client.invalidEnvironmentCode"));return i}async function HTe(e,t){const n=await gt("/web/v3/environment-share-codes/inspect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({shareCodes:e}),signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.inspectEnvironmentCodeFailed")));const i=await n.json();if(!Array.isArray(i.items))throw new Error(Q("client.invalidEnvironmentCodeInspection"));return i.items.map(r=>{if(!r||typeof r!="object")throw new Error(Q("client.invalidEnvironmentCodeInspection"));const s=r,o=s.status==="valid"||s.valid===!0?"valid":s.status==="invalid"||s.valid===!1?"invalid":null;if(!Number.isInteger(s.index)||o===null||s.name!==void 0&&typeof s.name!="string"||s.error!==void 0&&typeof s.error!="string")throw new Error(Q("client.invalidEnvironmentCodeInspection"));return{index:s.index,status:o,name:s.name??"",error:s.error??""}})}async function qTe(e,t){const n=await gt("/web/v3/environment-share-codes/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({shareCodes:e}),signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.importEnvironmentCodeFailed")));const i=await n.json();if(!Array.isArray(i.items))throw new Error(Q("client.invalidEnvironmentCodeImport"));return i.items.map(r=>{if(!r||typeof r!="object")throw new Error(Q("client.invalidEnvironmentCodeImport"));const s=r;if(!Number.isInteger(s.index)||!(s.status==="created"||s.status==="duplicate"||s.status==="failed")||s.name!==void 0&&typeof s.name!="string"||s.error!==void 0&&typeof s.error!="string")throw new Error(Q("client.invalidEnvironmentCodeImport"));return{index:s.index,status:s.status,name:s.name??"",environment:s.environment===void 0||s.environment===null?void 0:Dz(s.environment),error:s.error??""}})}async function WTe(e,t,n,i){let r;try{r=await gt(e,{method:t,headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:i})}catch(s){throw s instanceof DOMException&&s.name==="AbortError"?s:s instanceof TypeError?new Error(Q("client.studioUnavailable")):s}if(!r.ok)throw new Error(await Ft(r,Q("client.saveEnvironmentFailed")));return Dz(await r.json())}function KTe(e,t){return WTe("/web/v3/environments","POST",e,t)}function GTe(e,t,n){return WTe(`/web/v3/environments/${encodeURIComponent(e)}`,"PATCH",t,n)}async function XTe(e,t){const n=await gt(`/web/v3/environments/${encodeURIComponent(e)}`,{method:"DELETE",signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.deleteEnvironmentFailed")))}async function U8(e,t){const n=await gt(`/web/v3/environments/${encodeURIComponent(e)}/build`,{method:"POST",signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.startEnvironmentBuildFailed")));const i=Pz(await n.json());if(!i)throw new Error(Q("client.invalidEnvironmentBuild"));return i}async function YTe(e,t,n={}){const i=n.includeLogs?"?includeLogs=true":"",r=await gt(`/web/v3/environments/${encodeURIComponent(e)}/builds/${encodeURIComponent(t)}${i}`,{signal:n.signal});if(!r.ok)throw new Error(await Ft(r,Q("client.loadEnvironmentBuildFailed")));const s=Pz(await r.json());if(!s)throw new Error(Q("client.invalidEnvironmentBuild"));return s}async function ZTe(e,t,n){const i=await gt(`/web/v3/environments/${encodeURIComponent(e)}/builds/${encodeURIComponent(t)}/manifest`,{signal:n});if(!i.ok)throw new Error(await Ft(i,Q("client.loadEnvironmentManifestFailed")));return MTe(await i.json())}function YZ(e){if(!e||typeof e!="object")throw new Error(Q("client.invalidEnvironmentResource"));const t=e;if(t.source!=="provided"&&t.source!=="managed"||typeof t.consoleUrl!="string")throw new Error(Q("client.invalidEnvironmentResource"));return t}async function JTe(e){const t=await gt("/web/v3/environment-resources",{signal:e});if(!t.ok)throw new Error(await Ft(t,Q("client.loadEnvironmentResourcesFailed")));const n=await t.json();if(n.provider!=="volcengine"&&n.provider!=="byteplus"||typeof n.region!="string")throw new Error(Q("client.invalidEnvironmentResource"));return{provider:n.provider,region:n.region,codePipeline:YZ(n.codePipeline),containerRegistry:YZ(n.containerRegistry)}}async function Ctt(e,t){const n=await gt(`/web/system-info/sandbox-tools/${encodeURIComponent(e)}/model-env`,{method:"POST",signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.updateCodexSandboxFailed")));const i=await n.json();if(i.kind!=="codex"&&i.kind!=="codex_snapshot"||typeof i.toolId!="string"||typeof i.updated!="boolean")throw new Error(Q("client.invalidCodexSandboxUpdate"));return i}async function RD(e){const t=await gt("/web/identity/user-pools",{signal:e});if(!t.ok)throw new Error(await Ft(t,Q("client.loadUserPoolsFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(Q("client.invalidUserPoolList"));return n.items.map(i=>{if(!i||typeof i!="object"||typeof i.uid!="string"||typeof i.name!="string"||typeof i.domain!="string"||typeof i.region!="string"||typeof i.isCurrent!="boolean")throw new Error(Q("client.invalidUserPoolList"));return i})}class ZZ extends Error{constructor(t,n){super(n),this.status=t,this.name="DeploymentRecoveryHttpError"}}const ZS=new Map;function Att(e){if(typeof e=="string")return e?{message:e}:null;if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e,n=typeof t.message=="string"?t.message:typeof t.error=="string"?t.error:"";return n?{message:n,phase:typeof t.phase=="string"?t.phase:void 0,runtimeId:typeof t.runtimeId=="string"?t.runtimeId:void 0,logPath:typeof t.logPath=="string"?t.logPath:void 0}:null}class JS extends Error{constructor(t){super(t.message),this.detail=t,this.name="GithubCicdPipelineError"}}async function um(e){const t=await e.text().catch(()=>"");if(t)try{const n=JSON.parse(t),i=Att(n.detail??n.error);if(i)return new JS(i)}catch{return new JS({message:t})}return new JS({message:Q("client.syncGithubFailed",{status:e.status})})}async function e2e(e){const t=await gt("/web/github-delivery/source-sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:e.project,githubUrl:e.githubUrl,githubToken:e.githubToken,baseBranch:e.baseBranch,region:e.region,cloudProvider:e.cloudProvider})},{},0);if(!t.ok)throw await um(t);return t.json()}async function t2e(e){const t=await gt("/web/github-delivery/cicd-pipeline",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({githubUrl:e.githubUrl,githubToken:e.githubToken,baseBranch:e.baseBranch,runtimeName:e.runtimeName,runtimeId:e.runtimeId,region:e.region,agentCategory:e.agentCategory,mpaCompatibilityManifest:e.mpaCompatibilityManifest,cloudProvider:e.cloudProvider,projectPath:e.projectPath??".",volcengineAccessKey:e.volcengineAccessKey,volcengineSecretKey:e.volcengineSecretKey,volcengineSessionToken:e.volcengineSessionToken??""})},{},0);if(!t.ok)throw await um(t);return t.json()}async function n2e(e){const t=await gt("/web/github-delivery/init-main",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:e.project,githubUrl:e.githubUrl,githubToken:e.githubToken,baseBranch:e.baseBranch,runtimeName:e.runtimeName,runtimeId:e.runtimeId,region:e.region,agentCategory:e.agentCategory,mpaCompatibilityManifest:e.mpaCompatibilityManifest,cloudProvider:e.cloudProvider,projectPath:e.projectPath??".",volcengineAccessKey:e.volcengineAccessKey,volcengineSecretKey:e.volcengineSecretKey,volcengineSessionToken:e.volcengineSessionToken??""})},{},0);if(!t.ok)throw await um(t);return t.json()}async function Ttt(e){const t=await gt("/web/github-delivery/source-sync/cicd",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pipelineId:e.pipelineId,runtimeName:e.runtimeName,runtimeId:e.runtimeId,region:e.region,agentCategory:e.agentCategory,mpaCompatibilityManifest:e.mpaCompatibilityManifest,cloudProvider:e.cloudProvider,projectPath:e.projectPath??".",volcengineAccessKey:e.volcengineAccessKey,volcengineSecretKey:e.volcengineSecretKey,volcengineSessionToken:e.volcengineSessionToken??""})},{},0);if(!t.ok)throw await um(t);return t.json()}async function i2e(e){const t=await gt(`/web/github-cicd/runtime-binding?runtimeId=${encodeURIComponent(e)}`);if(!t.ok)throw await um(t);const n=await t.json();return n.pipelineId?n:null}async function dN(e){const t=await gt(`/web/github-delivery/versions?runtimeId=${encodeURIComponent(e)}`);if(!t.ok)throw await um(t);return t.json()}async function r2e(e){const t=await gt("/web/github-delivery/rollback-pr",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await um(t);return t.json()}async function Lz(e){const t=await gt("/web/github-cicd/runtime-binding",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await um(t);return t.json()}async function s2e(e){const t=await gt("/web/github-cicd/runtime-sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e.runtimeId,project:e.project,agentCategory:e.agentCategory,mpaCompatibilityManifest:e.mpaCompatibilityManifest})},{},0);if(!t.ok)throw await um(t);return t.json()}async function U0(e,t,n,i){var h,m,g,b,v,y;const r=i==null?void 0:i.taskId,s=r?new AbortController:void 0;r&&s&&ZS.set(r,s);const o=()=>{r&&ZS.get(r)===s&&ZS.delete(r)},l=async w=>{if(VAe(w))throw w;if(!r||!(i!=null&&i.runtimeId)||typeof i.baseRuntimeVersion!="number")throw new oN({taskId:r,cause:w});const x=await Qet({signal:s==null?void 0:s.signal,shouldRetry:O=>!(O instanceof ZZ)||O.status===404||O.status===408||O.status===429||O.status>=500,load:async O=>{const k=await gt("/web/deploy-agentkit/status",{method:"POST",headers:{"Content-Type":"application/json"},signal:O,body:JSON.stringify({taskId:r,runtimeId:i.runtimeId,runtimeName:i.runtimeName,appName:i.appName??e,region:n.region,projectName:n.projectName,baseRuntimeVersion:i.baseRuntimeVersion})},{},3e4);if(!k.ok)throw new ZZ(k.status,await Ft(k,Q("client.deploymentFailed")));return k.json()}});if(!x)throw new oN({taskId:r,cause:w});return x};let c=null,u=null;try{const w=!!(i!=null&&i.migrationTaskId);(h=i==null?void 0:i.onStage)==null||h.call(i,{level:"info",phase:"upload",message:Q(w?"client.validatingMigrationArtifact":"client.uploadingCodePackage"),pct:0}),c=await gt("/web/deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},signal:s==null?void 0:s.signal,body:JSON.stringify({name:e,files:w?[]:t,config:n,taskId:r,migrationTaskId:i==null?void 0:i.migrationTaskId,runtimeId:i==null?void 0:i.runtimeId,runtimeName:i==null?void 0:i.runtimeName,appName:i==null?void 0:i.appName,agentCategory:i==null?void 0:i.agentCategory,mpaCompatibilityManifest:i==null?void 0:i.mpaCompatibilityManifest,editMode:i==null?void 0:i.editMode,draft:i==null?void 0:i.draft,updateEtag:i==null?void 0:i.updateEtag,baseRuntimeVersion:i==null?void 0:i.baseRuntimeVersion,removeRuntimeEnvKeys:i==null?void 0:i.removeRuntimeEnvKeys,mcpSecretValues:i==null?void 0:i.mcpSecretValues,mcpCredentialReuses:i==null?void 0:i.mcpCredentialReuses,sessionStorage:i==null?void 0:i.sessionStorage,minInstance:i==null?void 0:i.minInstance,maxInstance:i==null?void 0:i.maxInstance,createEvaluationSets:i==null?void 0:i.createEvaluationSets,description:Bet((i==null?void 0:i.description)??""),authentication:i==null?void 0:i.authentication,im:i==null?void 0:i.im,envs:i==null?void 0:i.envs,resources:i==null?void 0:i.resources,source:(i==null?void 0:i.source)??(i!=null&&i.migrationTaskId?{kind:"migration",migrationId:i.migrationTaskId}:{kind:"inlineFiles"}),harnessSidecar:i==null?void 0:i.harnessSidecar,environment:i==null?void 0:i.environment})},{},0),(m=i==null?void 0:i.onStage)==null||m.call(i,{level:"success",phase:"upload",message:Q(w?"client.migrationArtifactValidated":"client.codePackageUploaded"),pct:100})}catch(w){try{u=await l(w)}finally{o()}}if(c&&!c.ok){const w=await Ft(c,Q("client.deploymentFailed"));throw o(),new Error(w)}if(c)try{for await(const w of MA(c)){const x=w;if(x&&x.done){u=x;break}x&&x.message&&((g=i==null?void 0:i.onStage)==null||g.call(i,x))}}catch(w){try{u=await l(w)}finally{o()}}if(u)o();else try{u=await l()}finally{o()}if(!u.success){const w=new Error(u.error||Q("client.deploymentFailed"));throw zAe(w)?new oN({taskId:r,cause:w}):w}if(!u.agentName)throw new Error(Q("client.deploymentMissingAgentName"));if(!u.runtimeId&&!u.url)throw new Error(Q("client.deploymentMissingConnection"));const d=(b=u.runtimeName)!=null&&b.trim()?u.agentName:e,f=((v=u.runtimeName)==null?void 0:v.trim())||u.agentName;return{apikey:u.apikey??"",url:u.url??"",agentName:d,runtimeName:f,runtimeId:u.runtimeId,mpaInstanceId:((y=u.mpaInstanceId)==null?void 0:y.trim())||void 0,consoleUrl:u.consoleUrl,region:u.region,version:u.version,warnings:u.warnings,feishuChannel:u.feishuChannel}}async function a2e(e){var n;const t=await gt("/web/cancel-deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e})});if(!t.ok){const i=await t.text().catch(()=>"");throw new Error(i||Q("client.cancelDeploymentFailed",{status:t.status}))}(n=ZS.get(e))==null||n.abort(),ZS.delete(e)}async function _tt(e=mz){const t=await gt(`/web/my-runtimes?region=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(Q("client.loadFailed",{status:t.status}));return(await t.json()).runtimes??[]}const aC={title:"AgentKit Studio",logoUrl:""},Q8={enabled:!1},S3={studio:!1,version:"",provider:"volcengine",branding:aC,features:{newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,agentUsage:!1,addAgentkit:!0,generatedAgentTestRun:!0},defaultView:"chat",agentsSource:"local",telemetry:Q8};function jtt(e){if(!e||typeof e!="object")return Q8;const t=e;if(t.enabled!==!0||!t.studio||typeof t.studio!="object")return Q8;const n=t.studio;return{enabled:!0,studio:{deployId:typeof n.deployId=="string"?n.deployId:"",userPoolId:typeof n.userPoolId=="string"?n.userPoolId:"",applicationId:typeof n.applicationId=="string"?n.applicationId:"",functionId:typeof n.functionId=="string"?n.functionId:"",region:typeof n.region=="string"?n.region:"",project:typeof n.project=="string"?n.project:"",version:typeof n.version=="string"?n.version:"",accountId:typeof n.accountId=="string"?n.accountId:"",accountIdResolutionError:typeof n.accountIdResolutionError=="string"?n.accountIdResolutionError:""}}}async function o2e(){var e,t;try{const n=await gt("/web/ui-config");if(!n.ok)return S3;const i=await n.json(),r=typeof((e=i.branding)==null?void 0:e.logoUrl)=="string"?i.branding.logoUrl:aC.logoUrl,s=i.provider==="byteplus"?"byteplus":"volcengine";return eTe(s),{studio:i.studio??!1,version:typeof i.version=="string"?i.version:"",provider:s,branding:{title:typeof((t=i.branding)==null?void 0:t.title)=="string"?i.branding.title:aC.title,logoUrl:r?Ta(r):""},features:{...S3.features,...i.features??{}},defaultView:i.defaultView??"chat",agentsSource:i.agentsSource==="cloud"?"cloud":"local",telemetry:jtt(i.telemetry)}}catch{return S3}}const l2e={role:"user",telemetry:{userId:"",accountId:""},capabilities:{createAgents:!1,createPersonalAgents:!1,manageAgents:!1,runtimeScope:"mine",manageUsers:!1}};async function c2e(){var n,i,r,s,o,l;const e=await gt("/web/access");if(!e.ok)throw new Error(Q("client.loadPermissionsFailed",{status:e.status}));const t=await e.json();if(!["super_admin","admin","developer","user"].includes(t.role)||typeof((n=t.telemetry)==null?void 0:n.userId)!="string"||t.telemetry.accountId!==void 0&&typeof t.telemetry.accountId!="string"||typeof((i=t.capabilities)==null?void 0:i.createAgents)!="boolean"||typeof((r=t.capabilities)==null?void 0:r.createPersonalAgents)!="boolean"||typeof((s=t.capabilities)==null?void 0:s.manageAgents)!="boolean"||((o=t.capabilities)==null?void 0:o.manageUsers)!==void 0&&typeof t.capabilities.manageUsers!="boolean"||!["all","mine"].includes((l=t.capabilities)==null?void 0:l.runtimeScope))throw new Error(Q("client.invalidPermissionResponse"));return t}async function u2e(e,t){const n=new URLSearchParams;e&&n.set("targetVersion",e),t&&n.set("startedAt",String(t));const i=n.size?`?${n.toString()}`:"",r=await gt(`/web/studio-update${i}`);if(!r.ok)throw new Error(Q("client.checkStudioUpdateFailed",{status:r.status}));return await r.json()}async function d2e(){const e=await gt("/web/studio-update/permissions");if(!e.ok){let t="";try{const n=await e.json();t=typeof n.detail=="string"?n.detail:""}catch{t=""}throw new Error(t||Q("client.studioUpdatePreflightFailed",{status:e.status}))}return await e.json()}async function f2e(e){const t=await gt("/web/studio-update",{method:"POST",headers:{"Content-Type":"application/json","X-VeADK-Studio-Update":"1"},body:JSON.stringify({version:e})},{},hr);if(!t.ok){let n="";try{const i=await t.json();n=typeof i.detail=="string"?i.detail:""}catch{n=""}throw new Error(n||Q("client.submitStudioUpdateFailed",{status:t.status}))}return await t.json()}async function h2e({runtimeId:e,region:t,appName:n,page:i=1,pageSize:r=20,signal:s}){const o=new URLSearchParams({runtimeId:e,region:t,appName:n,page:String(i),pageSize:String(r)}),l=await gt(`/web/agent-usage?${o.toString()}`,{signal:s});if(!l.ok)throw new Error(await Ft(l,Q("client.loadAgentUsageFailed")));const c=l.headers.get("content-type")||Q("client.notProvided"),u=c.toLowerCase();if(!u.includes("application/json")&&!u.includes("+json"))throw new Error(Q("client.agentUsageNonJson",{status:l.status,contentType:c})+Q("client.checkStudioGateway"));try{return await l.json()}catch{throw new Error(Q("client.agentUsageInvalidJson",{status:l.status,contentType:c})+Q("client.retryCheckGateway"))}}function dm(e=""){return`/web/cronjobs${e?`/${encodeURIComponent(e)}`:""}`}async function z8(e){const t=await gt(dm(),{signal:e});if(!t.ok)throw new Error(await Ft(t,Q("client.loadCronJobsFailed")));const n=await t.json();return Array.isArray(n)?n:n.items??[]}async function Ntt(e,t){const n=await gt(dm(e),{signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.loadCronJobFailed")));return await n.json()}async function p2e(e){const t=await gt(dm(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await Ft(t,Q("client.createCronJobFailed")));return await t.json()}async function m2e(e,t){const n=await gt(`${dm(e)}/update`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw new Error(await Ft(n,Q("client.updateCronJobFailed")));return await n.json()}async function g2e(e,t){const n=t?"enable":"disable",i=await gt(`${dm(e)}/${n}`,{method:"POST"});if(!i.ok)throw new Error(await Ft(i,Q(t?"client.enableCronJobFailed":"client.pauseCronJobFailed")));return await i.json()}async function b2e(e){const t=await gt(`${dm(e)}/run`,{method:"POST"});if(!t.ok)throw new Error(await Ft(t,Q("client.runCronJobFailed")));return await t.json()}async function V8(e,t){const n=await gt(`${dm(e)}/runs`,{signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.loadCronHistoryFailed")));const i=await n.json();return Array.isArray(i)?i:i.items??[]}async function y2e(e,t){const n=await gt(`${dm(e)}/runs/${encodeURIComponent(t)}/cancel`,{method:"POST"});if(!n.ok)throw new Error(await Ft(n,Q("client.stopCronRunFailed")));return await n.json()}async function v2e(e){const t=await gt(dm(e),{method:"DELETE"});if(!t.ok)throw new Error(await Ft(t,Q("client.deleteCronJobFailed")))}class ID extends Error{constructor(t,n){super(t),this.status=n,this.name="RuntimeListError"}}async function Q0(e={}){const t=new URLSearchParams({scope:e.scope??"all",page_size:String(e.pageSize??30),region:e.region??"all"});e.agentCategory&&t.set("agentCategory",e.agentCategory),e.nextToken&&t.set("next_token",e.nextToken);const n=await gt(`/web/runtimes?${t.toString()}`,{signal:e.signal});if(!n.ok){const r=await Ft(n,Q("client.loadRuntimeFailed"));throw new ID(r,n.status)}const i=await n.json();return{runtimes:i.runtimes??[],nextToken:i.nextToken??""}}async function Ww(e,t,n={}){if(n.preferCached){const i=wz(e,t,n.currentVersion),r=tw.get(i);if(r&&r.expiresAt>Date.now())return[...r.apps];r&&tw.delete(i)}try{const i={runtimeId:e,region:t,runtimeVersion:n.currentVersion};return n.retryProbe&&(i.retryProbe=!0),await $A("","",i,n.signal,n.timeoutMs)}catch(i){if(i instanceof U1||i instanceof Oa||i instanceof Error)throw i;return null}}async function x2e(e,t){const n=new URLSearchParams({region:t}),i=await gt(`/web/runtime-tool-channel/${encodeURIComponent(e)}/capabilities?${n.toString()}`);if(!i.ok)throw new Oa(await Ft(i,Q("client.loadLocalToolsFailed")),!1,!0);return await i.json()}async function w2e(e,t){const n=new URLSearchParams({region:t}),i=await gt(`/web/runtime-route-channel/${encodeURIComponent(e)}/connect?${n.toString()}`,{method:"POST"});if(!i.ok)throw new Oa(await Ft(i,Q("client.connectDynamicRouteFailed")),!1,!0);return await i.json()}async function O2e(e,t,n={}){const i={runtimeId:e,region:t};n.retryProbe&&(i.retryProbe=!0);const r=await gt("/.well-known/agent-card.json",{},i),s=await tTe(r);if(s==="runtime_access_denied")throw new U1;if(s==="runtime_private_endpoint_unreachable")throw new Oa(YAe());if(["runtime_proxy_connect_error","runtime_proxy_timeout"].includes(s))throw new Oa(ZAe());if(r.status===404)return null;if(r.status===401||r.status===403)throw new Oa(Q("client.a2aProbeDenied"));if(!r.ok)throw new Error(await Ft(r,Q("client.loadA2aCardFailed")));const o=await r.json().catch(()=>null),l=typeof(o==null?void 0:o.url)=="string"?o.url.trim():"";return l?{name:typeof(o==null?void 0:o.name)=="string"?o.name:"",description:typeof(o==null?void 0:o.description)=="string"?o.description:"",endpoint:l}:null}async function k2e(e,t){const n=new URLSearchParams({runtimeId:e,region:t}),i=await gt(`/web/runtime-api-key/reveal?${n.toString()}`,{method:"POST",cache:"no-store"});if(!i.ok)throw new Error(await Ft(i,Q("client.loadRuntimeApiKeyFailed")));const r=await i.json();if(typeof r.apiKey!="string"||!r.apiKey)throw new Error(Q("client.runtimeApiKeyMissing"));return r.apiKey}async function S2e(e,t,n={}){const i=await gt("/web/delete-runtime",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e,region:t,agentCategory:n.agentCategory,mpaInstanceId:n.mpaInstanceId})});if(!i.ok){const r=await i.text().catch(()=>"");throw new Error(r||Q("client.deleteFailed",{status:i.status}))}}async function E2e({runtimeId:e,region:t,appName:n,etag:i,signal:r}){const s=await gt("/web/runtime-mcp-credentials",{method:"POST",cache:"no-store",signal:r,headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e,region:t,appName:n,etag:i})});if(!s.ok)throw new Error(await Ft(s,Q("client.loadMcpCredentialsFailed")));const o=await s.json().catch(()=>null);if(!Array.isArray(o==null?void 0:o.credentials))throw new Error(Q("client.invalidMcpCredentials"));return o.credentials.map(l=>{if(!l||typeof l!="object")throw new Error(Q("client.invalidMcpCredentials"));const c=l,u={agentName:c.agentName,name:c.name,url:c.url,authTokenEnv:c.authTokenEnv,value:c.value};if(Object.values(u).some(d=>typeof d!="string"))throw new Error(Q("client.invalidMcpCredentials"));return u})}function fN({runtimeId:e,region:t,appName:n,currentVersion:i}){return B0(rC,t,e,i??"",(n==null?void 0:n.trim())??"")}async function Rtt({runtimeId:e,region:t,appName:n,currentVersion:i,force:r=!1}){const s=new URLSearchParams({runtimeId:e,region:t});n&&s.set("appName",n),i!=null&&s.set("currentVersion",String(i)),r&&s.set("refresh","true");const o=await gt(`/web/runtime-update-capability?${s.toString()}`);if(!o.ok)throw new Error(await Itt(o));return await o.json()}function PD({runtimeId:e,region:t,appName:n,currentVersion:i,signal:r,force:s=!1}){var u,d;const o={runtimeId:e,region:t,appName:n,currentVersion:i},l=fN(o);if(s&&ss.delete(l),!s){const f=Sb(ss,l,Q1);if(f)return Y2(Promise.resolve(f),r);const h=(u=ss.get(l))==null?void 0:u.promise;if(h)return Y2(h,r);if(n){const m=fN({...o,appName:""}),g=(d=ss.get(m))==null?void 0:d.promise;if(g){let b;return b=g.then(v=>{var w,x,O,k,S;if(v.recoveryStatus==="preparing")return((w=ss.get(l))==null?void 0:w.promise)===b&&ss.delete(l),v;const y=((O=(x=v.agent)==null?void 0:x.appName)==null?void 0:O.trim())??"";return y&&y!==n.trim()?(((k=ss.get(l))==null?void 0:k.promise)===b&&ss.delete(l),PD(o)):(((S=ss.get(l))==null?void 0:S.promise)===b&&ss.set(l,{value:v,updatedAt:Date.now()}),v)},v=>{var y;throw((y=ss.get(l))==null?void 0:y.promise)===b&&ss.delete(l),v}),ss.set(l,{promise:b,updatedAt:0}),Y2(b,r)}}}let c;return c=Rtt({...o,force:s}).then(f=>{var h,m,g,b,v;if(f.recoveryStatus==="preparing")return((h=ss.get(l))==null?void 0:h.promise)===c&&ss.delete(l),f;if(((m=ss.get(l))==null?void 0:m.promise)===c){ss.set(l,{value:f,updatedAt:Date.now()});const y=new Set(["",((b=(g=f.agent)==null?void 0:g.appName)==null?void 0:b.trim())??""]);for(const w of y){const x=fN({...o,appName:w});x!==l&&!((v=ss.get(x))!=null&&v.promise)&&ss.set(x,{value:f,updatedAt:Date.now()})}}return f},f=>{var h;throw((h=ss.get(l))==null?void 0:h.promise)===c&&ss.delete(l),f}),ss.set(l,{promise:c,updatedAt:0}),Y2(c,r)}function H8({runtimeId:e,region:t,appName:n,currentVersion:i}){return Sb(ss,fN({runtimeId:e,region:t,appName:n,currentVersion:i}),Q1)}function q8(e){return PD(e).then(()=>{},()=>{})}function W8(e,t){if(!e){ss.clear();return}for(const n of ss.keys()){const[i,r,s]=n.split("");i===rC&&s===e&&(!t||r===t)&&ss.delete(n)}}async function Itt(e){const t=await e.json().catch(()=>null),n=typeof(t==null?void 0:t.detail)=="string"?t.detail:"";return e.status===403?Q("client.runtimeManageForbidden"):e.status===404?Q(n==="runtime_not_found"?"client.runtimeNotFound":"client.runtimeUnavailable"):Q("client.checkRuntimeUpdateFailed",{status:e.status})}async function Ptt(e,t){let n=null;for(const i of LA(t)){const r=await gt(`/web/runtime-detail?runtimeId=${encodeURIComponent(e)}®ion=${encodeURIComponent(i)}`);if(r.ok)return r.json();n=new Error(await Ft(r,Q("client.loadRuntimeDetailFailed")))}throw n??new Error(Q("client.loadRuntimeDetailFailed"))}async function DD(e,t="cn-beijing",n={}){const i=B0(e,t||"cn-beijing"),r=Sb(fy,i,Q1);if(!n.force&&r)return r;const s=fy.get(i);if(!n.force&&(s!=null&&s.promise))return s.promise;const o=Ptt(e,t).then(l=>Oz(fy,i,l));fy.set(i,{...s,promise:o,updatedAt:(s==null?void 0:s.updatedAt)??0});try{return await o}finally{const l=fy.get(i);(l==null?void 0:l.promise)===o&&fy.set(i,{value:l.value,updatedAt:l.updatedAt})}}async function Dtt(e,t,n){const i=new URLSearchParams({runtimeId:e,region:t,key:n}),r=await gt(`/web/runtime-env/copy?${i.toString()}`,{method:"POST"});if(!r.ok)throw new Error(await Ft(r,Q("client.copySecretFailed")));const s=await r.json();if(typeof s.value!="string"||!s.value)throw new Error(Q("client.copySecretFailed"));await navigator.clipboard.writeText(s.value)}function C2e(e,t="cn-beijing"){return Sb(fy,B0(e,t||"cn-beijing"),Q1)}function A2e(e,t="cn-beijing"){DD(e,t).catch(()=>{})}async function eE(e){const t=await gt("/web/generated-agent-projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await Ft(t,Q("client.generateProjectFailed")));return t.json()}const Mtt=19e4,Ltt=12e4;async function T2e(e){const t=await gt("/web/generated-agent-drafts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requirement:e})},{},Mtt);if(!t.ok)throw new Error(await Ft(t,Q("client.generateAgentConfigFailed")));return CD(t,Q("client.generateAgentConfigFailed"))}async function _2e(e,t){const n=await gt("/web/generated-agent-test-runs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e,runtimeId:t==null?void 0:t.runtimeId,runtimeRegion:t==null?void 0:t.region,mcpCredentialReuses:t==null?void 0:t.mcpCredentialReuses})},{},Ltt);if(!n.ok)throw new Error(await Ft(n,Q("client.createDebugRunFailed")));return CD(n,Q("client.createDebugRunFailed"))}async function j2e(e,t){const n=await gt(`/web/generated-agent-test-runs/${e}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:t})});if(!n.ok)throw new Error(await Ft(n,Q("client.createDebugSessionFailed")));return(await CD(n,Q("client.createDebugSessionFailed"))).id}async function N2e(e,t){const n=await gt(`/web/generated-agent-test-runs/${encodeURIComponent(e)}/trace/session/${encodeURIComponent(t)}`);if(!n.ok)throw new Error(await Ft(n,Q("client.loadDebugTraceFailed")));const i=await CD(n,Q("client.loadDebugTraceFailed"));if(!Array.isArray(i))throw new Error(Q("client.invalidDebugTrace"));return i}async function*R2e({runId:e,userId:t,sessionId:n,text:i,signal:r}){const s=i.trim()?[{text:i}]:[],o=Tz(r);let l;try{l=await gt(`/web/generated-agent-test-runs/${e}/run_sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({user_id:t,session_id:n,new_message:{role:"user",parts:s},streaming:!0}),signal:o.signal},{},0)}catch(c){throw o.cleanup(),o.timedOut()?new Error(Gg()):c}if(!l.ok)throw o.cleanup(),new Error(await Ft(l,Q("client.debugRunFailed")));try{for await(const c of MA(l))o.clearDeadline(),yield c}catch(c){throw o.timedOut()?new Error(Gg()):c}finally{o.cleanup()}}async function rx(e){const t=await gt(`/web/generated-agent-test-runs/${e}`,{method:"DELETE"});if(!t.ok&&t.status!==404)throw new Error(await Ft(t,Q("client.cleanupDebugRunFailed")))}function I2e(e){if(!e||typeof e!="object")throw new Error(Q("client.invalidSandboxVersion"));const t=e;if(typeof t.toolId!="string"||typeof t.error!="string")throw new Error(Q("client.invalidSandboxVersion"));if(!t.error&&(t.provider!=="volcengine"&&t.provider!=="byteplus"||typeof t.region!="string"||typeof t.status!="string"||typeof t.currentImage!="string"||typeof t.latestImage!="string"||typeof t.needsImageUpdate!="boolean"||typeof t.canUpdate!="boolean"||typeof t.needsModelEnvUpdate!="boolean"||typeof t.canUpdateModelEnv!="boolean"||typeof t.modelEnvError!="string"))throw new Error(Q("client.invalidSandboxVersion"));return t}async function P2e(e){const t=await gt("/web/system-info/sandbox-tools/updates",{signal:e});if(!t.ok)throw new Error(await Ft(t,Q("client.loadSandboxVersionsFailed")));const n=await t.json();if(!Array.isArray(n.tools))throw new Error(Q("client.invalidSandboxVersion"));return n.tools.map(I2e)}async function D2e(e){const t=await gt(`/web/system-info/sandbox-tools/${encodeURIComponent(e)}/update`,{method:"POST"},{},33e4);if(!t.ok)throw new Error(await Ft(t,Q("client.updateSandboxFailed")));const n=await t.json();if(typeof n.updated!="boolean")throw new Error(Q("client.invalidSandboxUpdate"));return{updated:n.updated,state:I2e(n.state)}}class tI extends Error{constructor(t){super(`Channel request failed (${t})`),this.status=t}}async function Xd(e,t,n={}){const i=await gt(`/api/v1/channels${t}`,{...n,headers:{"Content-Type":"application/json",...n.headers}},e);if(!i.ok)throw new tI(i.status);return i.json()}function K8(e,t,n,i){return ret(gt,e,t,n,i)}function M2e(e,t,n,i,r){return set(gt,e,t,n,i,r)}function L2e(e,t,n,i){return aet(gt,e,t,n,i)}const $tt=Object.freeze(Object.defineProperty({__proto__:null,ChannelApiError:tI,DEFAULT_SITE_BRANDING:aC,DEFAULT_STUDIO_ACCESS:l2e,GithubCicdPipelineError:JS,MpaExecutionConfigRequestError:nw,RuntimeAccessDeniedError:U1,RuntimeListError:ID,RuntimeProbeError:Oa,TurnControlConflictError:jD,applyMpaProfileAfterDeployment:eI,attachGithubDeliveryCicdToSourceSync:Ttt,bindGithubCicdRuntime:Lz,buildEnvironment:U8,cancelAgentkitDeployment:a2e,cancelCronJobRun:y2e,channelRequest:Xd,checkRuntimeNameAvailability:ND,clearMessageFeedbackCache:HAe,clearRemoteApps:WAe,componentSearch:xTe,continueTurn:wtt,continueTurnSSE:bTe,controlTurn:gTe,copyRuntimeEnvironmentSecret:Dtt,createCronJob:p2e,createEnvironment:KTe,createGeneratedAgentTestRun:_2e,createGeneratedAgentTestSession:j2e,createGithubCicdPipeline:e2e,createGithubDeliveryCicdPipeline:t2e,createGithubDeliveryRollbackPr:r2e,createSession:nTe,createWorkspace:BTe,deleteAgentFeedbackCases:lTe,deleteCronJob:v2e,deleteEnvironment:XTe,deleteGeneratedAgentTestRun:rx,deleteMedia:uN,deleteRuntime:S2e,deleteSession:D8,deleteSessionMedia:M8,deleteWorkspace:QTe,deployAgentkitProject:U0,downloadArtifact:Sz,ensureRuntimeRouteChannel:w2e,exportEnvironmentShareCode:VTe,fetchRemoteApps:$A,fetchSessionFile:cTe,generateAgentDraftFromRequirement:T2e,generateAgentProject:eE,getAgentFeedbackCases:_D,getAgentInfo:$8,getAgentOptimizations:rTe,getAgentUsage:h2e,getAutomaticEvaluationStatuses:P8,getCachedAgentFeedbackCases:sTe,getCachedRuntimeAgentInfo:yTe,getCachedRuntimeDetail:C2e,getCachedRuntimeUpdateCapability:H8,getCronJob:Ntt,getEnvironmentBuild:YTe,getEnvironmentManifest:ZTe,getEnvironmentResources:JTe,getGeneratedAgentTestTrace:N2e,getGithubCicdRuntimeBinding:i2e,getGithubDeliveryVersions:dN,getMediaCapabilities:vtt,getMpaAgentDeletePreview:CTe,getMpaAgentOperation:kTe,getMpaAgentView:ETe,getMpaProfileStatus:STe,getMpaRuntimeConsoleRuns:ATe,getMpaRuntimeConsoleTrace:TTe,getMpaSessionExecutionConfig:Rz,getMyRuntimes:_tt,getRuntimeAgentInfo:Cz,getRuntimeDetail:DD,getRuntimeMcpCredentials:E2e,getRuntimeStudioToolCapabilities:x2e,getRuntimeUpdateCapability:PD,getRuntimes:Q0,getSandboxImageUpdates:P2e,getSession:sC,getSessionTrace:ZR,getStudioAccess:c2e,getStudioUpdatePermissions:d2e,getStudioUpdateStatus:u2e,getSystemInfo:PTe,getTurnControl:mTe,getUiConfig:o2e,httpErrorMessage:Ft,importEnvironmentShareCodes:qTe,initializeGithubDeliveryMain:n2e,inspectEnvironmentRepository:zTe,inspectEnvironmentShareCodes:HTe,invalidateRuntimeUpdateCapabilityCache:W8,isMpaA2aRuntimeApp:np,isMpaRuntimeApp:JR,listActiveMpaAgentOperations:OTe,listApps:XAe,listCronJobRuns:V8,listCronJobs:z8,listDeploymentResources:jTe,listEnvironments:BA,listIdentityUserPools:RD,listModelApiKeys:xz,listModelOptions:B1,listMpaCronTasks:K8,listMpaRuns:L2e,listSessions:kz,listWorkspaces:Mz,mediaContentUrl:hTe,mpaProfileFromAgentDraft:FA,parseEnvironmentManifest:MTe,parseEnvironmentShareCodes:Iz,parsePreparedSessionEnvironmentMounts:NTe,patchMpaSessionExecutionConfig:B8,prefetchAgentFeedbackCases:btt,prefetchRuntimeAgentInfo:vTe,prefetchRuntimeDetail:A2e,prefetchRuntimeUpdateCapability:q8,prepareSessionEnvironmentMounts:RTe,previewArtifact:Ez,probeRuntimeA2a:O2e,probeRuntimeApps:Ww,refreshAgentFeedbackCases:aTe,registerRemoteApp:qAe,requestMpaTask:M2e,retryMpaAgentOperation:Nz,revealModelApiKey:GAe,revealRuntimeApiKey:k2e,runCronJobNow:b2e,runGeneratedAgentTestSSE:R2e,runSSE:F8,runSseEmptyResponseError:Az,runSseFirstEventTimeoutError:Gg,runSseIncompleteResponseError:cS,runtimeRegionCandidates:LA,setClientCloudProvider:eTe,setCronJobEnabled:g2e,startMpaAgentOperation:jz,startStudioUpdate:f2e,studioFetch:yn,submitIssueFeedback:L8,submitMessageFeedback:iTe,syncGithubCicdRuntime:s2e,updateCodexSandboxToolModelEnv:Ctt,updateCronJob:m2e,updateEnvironment:GTe,updateSandboxTool:D2e,updateWorkspace:UTe,upgradeMpaSessionProfile:_Te,uploadMedia:dTe,upsertCachedAgentFeedbackCase:cN,webSearch:wTe,writeEnvironmentShareCode:ITe},Symbol.toStringTag,{value:"Module"})),Ftt="/web/sandbox/sessions",JZ="/web/sandbox/codex-project-handoff",eJ=3e4,E3=33e4,Btt=6e4,Utt=6e5,ok=15e3,cp=6e4,Qtt=33e4,tJ=3e4,ztt=60*60,G8=40;function MD(e){const t=e.trim().toLowerCase();return["ready","running","wakeable"].includes(t)?"ready":t}function $z(e){switch(e.trim().toLowerCase()){case"ready":return Q("sandbox.status.ready");case"wakeable":return Q("sandbox.status.wakeable");case"creating":return Q("sandbox.status.creating");case"starting":case"initializing":return Q("sandbox.status.starting");case"pending":return Q("sandbox.status.pending");case"running":return Q("sandbox.status.running");case"failed":case"error":return Q("sandbox.status.failed");case"stopped":return Q("sandbox.status.stopped");case"expired":return Q("sandbox.status.expired");case"deleting":return Q("sandbox.status.deleting");case"deleted":return Q("sandbox.status.deleted");default:return Q("sandbox.status.unknown")}}function ps(e){const t=ul(e);return t.has("Accept")||t.set("Accept","application/json"),t}class Fz extends Error{constructor(n,i={}){var r;super(n);Zt(this,"code");Zt(this,"retryable");Zt(this,"publicMessage");Zt(this,"httpStatus");this.name="SandboxServiceError",this.code=i.code??"",this.retryable=i.retryable===!0,this.publicMessage=((r=i.publicMessage)==null?void 0:r.trim())||n,this.httpStatus=i.httpStatus}}function Vtt(e){return e instanceof Fz?e.publicMessage:e instanceof Error&&e.name==="TimeoutError"?Q("sandbox.developmentTimeout"):e instanceof TypeError?Q("sandbox.developmentDisconnected"):Q("sandbox.developmentFailed")}async function Bs(e,t){const n=await e.text().catch(()=>"");let i={};try{i=JSON.parse(n)}catch{const d=Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status});return new Error(n?Q("common.fallbackWithDetail",{fallback:d,detail:n}):d)}const r=i.detail,s=r&&typeof r=="object"?r:i,o=r&&typeof r=="object"&&"message"in r?r.message:r??i.error??i.message,l=typeof o=="string"?o:o==null?"":JSON.stringify(o),c=Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),u=l?Q("common.fallbackWithDetail",{fallback:c,detail:l}):c;return new Fz(u,{code:typeof s.code=="string"?s.code:"",retryable:s.retryable===!0,publicMessage:l||c,httpStatus:e.status})}async function nJ(e,t){const n=await e.text().catch(()=>"");try{return JSON.parse(n)}catch{throw new Error(Q("sandbox.invalidStudioResponse",{fallback:t}))}}function Wb(e,t="codex",n=e.toolName==="intelligent-development"){if(!e.sessionId||!e.status)throw new Error(Q("sandbox.invalidSession"));return{resourceType:"session",id:e.sessionId,toolName:t,userSessionId:e.userSessionId??"",displayName:e.displayName??"",status:e.status,createdAt:e.createdAt??"",expireAt:e.expireAt??"",persistent:e.persistent!==!1,toolType:e.toolType??"",intelligentDevelopment:n,createdBy:e.createdBy??"",region:e.region??"",isMine:e.isMine===!0,threadId:e.threadId??"",cwd:e.cwd??"",workspaceLocked:e.workspaceLocked===!0,busy:e.busy===!0,...typeof e.model=="string"?{model:e.model}:{},permissions:LD(e.permissions),...e.conversation===void 0?{}:{restoredConversation:hy(e.conversation)}}}function iJ(e,t="codex"){if(!e.snapshotId||!e.status)throw new Error(Q("sandbox.invalidSnapshot"));return{resourceType:"snapshot",id:e.snapshotId,snapshotId:e.snapshotId,sourceSessionId:e.sessionId??"",toolName:t,userSessionId:e.userSessionId??"",displayName:e.displayName??"",status:e.status,snapshotStatus:e.snapshotStatus??"Unknown",reason:e.reason??"",createdAt:e.createdAt??"",createdBy:e.createdBy??"",region:e.region??"",isMine:e.isMine===!0}}function rJ(e,t){if((t==null?void 0:t.autoResumeSnapshots)===void 0)return e;const n=new URLSearchParams({autoResumeSnapshots:String(t.autoResumeSnapshots)});return`${e}?${n.toString()}`}const lk={approvalPolicy:"on-request",approvalsReviewer:"user",sandboxMode:"workspace-write",networkAccess:!1};function LD(e){if(!e||typeof e!="object")return{...lk};const t=e,n=t.approvalPolicy,i=t.approvalsReviewer,r=t.sandboxMode;return{approvalPolicy:n==="untrusted"||n==="on-request"||n==="never"?n:lk.approvalPolicy,approvalsReviewer:i==="user"||i==="auto_review"?i:lk.approvalsReviewer,sandboxMode:r==="read-only"||r==="workspace-write"||r==="danger-full-access"?r:lk.sandboxMode,networkAccess:typeof t.networkAccess=="boolean"?t.networkAccess:lk.networkAccess}}function sJ(e){if(!e||typeof e!="object")throw new Error(Q("sandbox.invalidSettings"));const t=e;return{threadId:typeof t.threadId=="string"?t.threadId:"",cwd:typeof t.cwd=="string"?t.cwd:"",...typeof t.model=="string"?{model:t.model}:{},workspaceLocked:t.workspaceLocked===!0,busy:t.busy===!0,permissions:LD(t.permissions)}}function xa(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Htt(e){const t=xa(e);if(!(!t||typeof t.id!="string"||!t.id))return{id:t.id,displayName:typeof t.displayName=="string"?t.displayName:t.id,description:typeof t.description=="string"?t.description:"",isDefault:t.isDefault===!0}}function qtt(e){const t=xa(e);if(!(!t||typeof t.id!="string"||!t.id||typeof t.name!="string"||!t.name))return{id:t.id,name:t.name,description:typeof t.description=="string"?t.description:""}}function $2e(e){const t=xa(e);if(!(!t||typeof t.id!="string"||!t.id))return{id:t.id,...typeof t.name=="string"&&t.name?{name:t.name}:{},preview:typeof t.preview=="string"?t.preview:"",cwd:typeof t.cwd=="string"?t.cwd:"",modelProvider:typeof t.modelProvider=="string"?t.modelProvider:"",createdAt:typeof t.createdAt=="number"&&Number.isFinite(t.createdAt)?t.createdAt:0,updatedAt:typeof t.updatedAt=="number"&&Number.isFinite(t.updatedAt)?t.updatedAt:0,status:typeof t.status=="string"?t.status:"unknown"}}function hy(e){const t=xa(e),n=$2e(t==null?void 0:t.thread);if(!t||!n||typeof t.threadId!="string"||!Array.isArray(t.messages))throw new Error(Q("sandbox.invalidThreadSnapshot"));const i=t.messages.flatMap(r=>{const s=xa(r);if(!s||typeof s.id!="string"||s.role!=="user"&&s.role!=="assistant"||typeof s.content!="string"||typeof s.timestamp!="number")return[];const o=Array.isArray(s.skillNames)?s.skillNames.filter(c=>typeof c=="string"&&!!c):[],l=Array.isArray(s.images)?s.images.flatMap(c=>{const u=xa(c);return!u||typeof u.mimeType!="string"||!u.mimeType.startsWith("image/")||typeof u.data!="string"||!u.data?[]:[{mimeType:u.mimeType,data:u.data,...typeof u.name=="string"&&u.name?{name:u.name}:{},...typeof u.alt=="string"&&u.alt?{alt:u.alt}:{}}]}):[];return[{id:s.id,role:s.role,content:s.content,timestamp:s.timestamp,...o.length?{skillNames:o}:{},...l.length?{images:l}:{}}]});return{thread:n,threadId:t.threadId,messages:i,...typeof t.model=="string"?{model:t.model}:{},...typeof t.cwd=="string"?{cwd:t.cwd}:{},workspaceLocked:t.workspaceLocked===!0,permissions:LD(t.permissions)}}function X8(e){if(!e||typeof e!="object")return;const t=e;if(![t.totalTokens,t.inputTokens,t.cachedInputTokens,t.outputTokens,t.reasoningOutputTokens].some(i=>typeof i!="number"||!Number.isFinite(i)||i<0))return{totalTokens:Math.trunc(t.totalTokens),inputTokens:Math.trunc(t.inputTokens),cachedInputTokens:Math.trunc(t.cachedInputTokens),outputTokens:Math.trunc(t.outputTokens),reasoningOutputTokens:Math.trunc(t.reasoningOutputTokens)}}function Wtt(e){const t=X8(e.usage);if(!t||typeof e.turnId!="string")return;const n=X8(e.threadTotal),i=e.modelContextWindow;return{turnId:e.turnId,usage:t,...n?{threadTotal:n}:{},...typeof i=="number"&&Number.isFinite(i)&&i>=0?{modelContextWindow:Math.trunc(i)}:{}}}function Ktt(e){return typeof e.id!="string"||e.kind!=="command"&&e.kind!=="file"||typeof e.method!="string"?null:{id:e.id,kind:e.kind,method:e.method,...typeof e.reason=="string"?{reason:e.reason}:{},...typeof e.command=="string"?{command:e.command}:{},...typeof e.cwd=="string"?{cwd:e.cwd}:{},...typeof e.grantRoot=="string"?{grantRoot:e.grantRoot}:{},...e.changes!==void 0?{changes:e.changes}:{},...typeof e.threadId=="string"?{threadId:e.threadId}:{},...typeof e.turnId=="string"?{turnId:e.turnId}:{},...typeof e.itemId=="string"?{itemId:e.itemId}:{}}}function F2e(e={}){let t="";const n=[],i=new Map,r=new Map;let s,o;function l(){var h;const f=s?[...n,s]:n;(h=e.onBlocks)==null||h.call(e,[...f])}function c(f){t+=f;const h=n[n.length-1],m=n.length-1,g=[...i.values()].includes(m);(h==null?void 0:h.kind)==="text"&&!g?n[m]={...h,text:h.text+f}:n.push({kind:"text",text:f}),l()}function u(f){if(typeof f.id!="string"||f.kind!=="thinking"&&f.kind!=="commentary"&&f.kind!=="tool"||f.status!=="running"&&f.status!=="done"&&f.status!=="error")return;const h=f.status!=="running";let m;if(f.kind==="thinking")m={kind:"thinking",text:typeof f.text=="string"?f.text:"",done:h};else if(f.kind==="commentary"){if(typeof f.text!="string"||!f.text)return;m={kind:"text",text:f.text}}else{if(typeof f.name!="string"||!f.name)return;m={kind:"tool",name:f.name,args:f.args,response:f.response,status:f.status==="error"?"failed":h?"completed":"running",done:h}}m={...m,id:f.id,...typeof f.itemType=="string"?{itemType:f.itemType}:{},...typeof f.phase=="string"?{phase:f.phase}:{},...typeof f.durationMs=="number"?{durationMs:f.durationMs}:{}};const g=i.get(f.id);g===void 0?(i.set(f.id,n.length),n.push(m)):n[g]=m,l()}function d(f){var b,v,y,w;let h="message";const m=[];for(const x of f.split(/\r?\n/))x.startsWith("event:")&&(h=x.slice(6).trim()),x.startsWith("data:")&&m.push(x.slice(5).trimStart());if(m.length===0)return;let g;try{g=JSON.parse(m.join(` -`))}catch{throw new Error(Q("sandbox.invalidConversationResponse"))}if(h==="error"){const x=typeof g.message=="string"&&g.message?g.message:Q("sandbox.conversationFailed");throw new Fz(x,{code:typeof g.code=="string"?g.code:"",retryable:g.retryable===!0,publicMessage:x})}if(h==="progress"&&typeof g.text=="string"&&(s=g.text?{kind:"progress",text:g.text}:void 0,l()),["activity","delta","tool_output","tool_progress","plan","diff"].includes(h)&&(s=void 0),h==="activity"&&u(g),(h==="tool_output"||h==="tool_progress")&&typeof g.id=="string"){const x=i.get(g.id),O=x===void 0?void 0:n[x];if((O==null?void 0:O.kind)==="tool"&&x!==void 0&&typeof g.text=="string"){const k=xa(O.response)||{};n[x]=h==="tool_progress"?{...O,progressText:g.text}:{...O,response:{...k,output:(g.snapshot?"":String(k.output||""))+g.text}},l()}}if((h==="plan"||h==="diff")&&typeof g.id=="string"){const x=typeof g.text=="string"?g.text:"",O=Array.isArray(g.items)?g.items:Array.isArray(g.plan)?g.plan:[],k=h==="diff"?{kind:"diff",id:g.id,text:x,done:g.status==="done"}:{kind:"plan",id:g.id,title:Q("developmentRuns.plan"),summary:x,done:g.status==="done",items:O.flatMap(C=>{const E=xa(C);if(!E||typeof(E.text??E.step)!="string")return[];const j=E.status==="inProgress"?"in_progress":E.status;return[{text:String(E.text??E.step),status:j==="completed"||j==="failed"||j==="in_progress"?j:"pending"}]})},S=i.get(g.id);S===void 0?(i.set(g.id,n.length),n.push(k)):n[S]=k,l()}if(h==="development.source_ready"||h==="development.succeeded"){const x=xa(g.payload),O=xa(x==null?void 0:x.delivery),k=h==="development.succeeded";if(O&&typeof O.sessionId=="string"&&typeof O.artifactSha256=="string"&&typeof O.validationReportSha256=="string"&&typeof O.agentName=="string"&&typeof O.entryPoint=="string"&&typeof O.fileCount=="number"&&typeof O.artifactSize=="number"&&typeof O.validatedAt=="string"&&O.deployable===!0&&O.verified===k&&typeof O.validationSummary=="string"&&Array.isArray(O.gateSummary)&&O.gateSummary.every(S=>typeof S=="string")){const S={kind:"delivery",value:{sessionId:O.sessionId,...typeof O.projectId=="string"&&typeof O.versionId=="string"?{projectId:O.projectId,versionId:O.versionId,...O.parentVersionId===null||typeof O.parentVersionId=="string"?{parentVersionId:O.parentVersionId}:{}}:{},artifactSha256:O.artifactSha256,validationReportSha256:O.validationReportSha256,agentName:O.agentName,entryPoint:O.entryPoint,fileCount:O.fileCount,artifactSize:O.artifactSize,validatedAt:O.validatedAt,gateSummary:O.gateSummary,deployable:O.deployable,verified:O.verified,validationSummary:O.validationSummary}},C=n.findIndex(E=>E.kind==="delivery"&&E.value.sessionId===O.sessionId&&E.value.artifactSha256===O.artifactSha256&&E.value.validationReportSha256===O.validationReportSha256);C===-1?n.push(S):n[C]=S,l()}}if(h==="approval"){const x=Ktt(g);x&&((b=e.onApproval)==null||b.call(e,x))}if(h==="usage"){const x=Wtt(g);x&&(o=x,(v=e.onUsage)==null||v.call(e,x))}if(h==="approval_resolved"&&typeof g.approvalId=="string"&&((y=e.onApprovalResolved)==null||y.call(e,g.approvalId)),h==="delta"&&typeof g.text=="string")if(typeof g.id=="string"&&g.id){const x=r.get(g.id),O=x===void 0?void 0:n[x],k=((w=xa(g))==null?void 0:w.snapshot)===!0;(O==null?void 0:O.kind)==="text"?n[x]={...O,phase:typeof g.phase=="string"&&g.phase?g.phase:O.phase,text:k?O.text.startsWith(g.text)?O.text:g.text:O.text+g.text}:(r.set(g.id,n.length),n.push({kind:"text",text:g.text,id:g.id,itemType:typeof g.itemType=="string"?g.itemType:void 0,phase:typeof g.phase=="string"?g.phase:void 0})),t=n.filter(S=>S.kind==="text").map(S=>S.text).join(""),l()}else c(g.text);if(h==="done"&&!t&&typeof g.text=="string"&&c(g.text),h==="done"){for(let x=0;x({text:t,blocks:n.map(f=>({...f})),...o?{usage:o}:{}})}}async function Gtt(e,t={}){if(!e.body)throw new Error(Q("sandbox.emptyConversationResponse"));const n=e.body.getReader(),i=new TextDecoder;let r="";const s=F2e(t);for(;;){const{done:l,value:c}=await n.read();r+=i.decode(c,{stream:!l});const u=r.split(/\r?\n\r?\n/);if(r=u.pop()??"",u.forEach(s.consumeFrame),l)break}r.trim()&&s.consumeFrame(r),s.consumeFrame(`event: done -data: {}`);const o=s.result();if(o.blocks.length===0)throw new Error(Q("sandbox.emptyReply"));return o}async function tu(e,t,n,{method:i="GET",body:r,options:s={},fallback:o}){if(!t)throw new Error(Q("sandbox.missingSession"));const l=await yn(`${e}/${encodeURIComponent(t)}/${n}`,{method:i,headers:ps(r===void 0?void 0:{"Content-Type":"application/json"}),...r===void 0?{}:{body:JSON.stringify(r)},signal:s.signal},cp);if(!l.ok)throw await Bs(l,o);return l.json()}function B2e(e,t={}){return{async listSessions(n={}){const i=await yn(rJ(e,n),{method:"GET",headers:ps(),signal:n.signal},eJ);if(!i.ok)throw await Bs(i,Q("sandbox.listCodexFailed"));const r=await i.json();if(!Array.isArray(r.sessions))throw new Error(Q("sandbox.invalidSessionList"));if(r.snapshots!==void 0&&!Array.isArray(r.snapshots))throw new Error(Q("sandbox.invalidSnapshotList"));return[...r.sessions.map(s=>Wb(s,"codex",t.intelligentDevelopment)),...(r.snapshots??[]).map(s=>iJ(s))]},async startSession(n={}){var s,o;const i=((s=n.displayName)==null?void 0:s.trim())??"",r=await yn(e,{method:"POST",headers:ps({"Content-Type":"application/json"}),body:JSON.stringify({displayName:t.textOnly&&n.projectId?Array.from(i).slice(0,G8).join(""):i,...(o=n.modelId)!=null&&o.trim()?{modelId:n.modelId.trim()}:{},...t.textOnly&&n.projectId?{projectId:n.projectId,...n.baseVersionId?{baseVersionId:n.baseVersionId}:{}}:{},...t.textOnly?{}:{persistent:n.persistent??!0},...n.diskGb!==void 0?{diskGb:n.diskGb}:{}}),signal:n.signal},E3);if(!r.ok)throw await Bs(r,Q("sandbox.startFailed"));return Wb(await r.json(),"codex",t.intelligentDevelopment)},async listAgentSessions(n,i={}){const r=await yn(rJ(`/web/${n}/sessions`,i),{method:"GET",headers:ps(),signal:i.signal},eJ);if(!r.ok)throw await Bs(r,Q("sandbox.listAgentFailed",{kind:n}));const s=await r.json();if(!Array.isArray(s.sessions))throw new Error(Q("sandbox.invalidKindSessionList",{kind:n}));if(s.snapshots!==void 0&&!Array.isArray(s.snapshots))throw new Error(Q("sandbox.invalidKindSnapshotList",{kind:n}));return[...s.sessions.map(o=>Wb(o,n)),...(s.snapshots??[]).map(o=>iJ(o,n))]},async startAgentSession(n,i={}){var s;const r=await yn(`/web/${n}/sessions`,{method:"POST",headers:ps({"Content-Type":"application/json"}),body:JSON.stringify({displayName:((s=i.displayName)==null?void 0:s.trim())??"",persistent:i.persistent??!0,...i.diskGb!==void 0?{diskGb:i.diskGb}:{}}),signal:i.signal},E3);if(!r.ok)throw await Bs(r,Q("sandbox.createAgentFailed",{kind:n}));return Wb(await r.json(),n)},async openAgentSession(n,i,r={}){if(!i)throw new Error(Q("sandbox.missingSessionToOpen"));const s=await yn(`/web/${n}/sessions/${encodeURIComponent(i)}/open`,{method:"POST",headers:ps(),signal:r.signal},cp);if(!s.ok)throw await Bs(s,Q("sandbox.openAgentFailed",{kind:n}));const o=await s.json();if(typeof o.webuiUrl!="string"||!o.webuiUrl.startsWith("/"))throw new Error(Q("sandbox.invalidAgentHomeUrl",{kind:n}));return{session:Wb(o,n),kind:n,webuiUrl:Ta(o.webuiUrl)}},async launchAgentTerminal(n,i,r={}){if(!i)throw new Error(Q("sandbox.missingSessionForTerminal"));const s=await yn(`/web/${n}/sessions/${encodeURIComponent(i)}/terminal`,{method:"POST",headers:ps(),signal:r.signal},cp);if(!s.ok)throw await Bs(s,Q("sandbox.openTerminalFailed",{kind:n}));const o=await s.json();return{url:U2e(o.url,`${n} Terminal`),...typeof o.shellSessionId=="string"?{shellSessionId:o.shellSessionId}:{}}},async deleteAgentSession(n,i,r={}){if(!i)return;const s=await yn(`/web/${n}/sessions/${encodeURIComponent(i)}`,{method:"DELETE",headers:ps(),signal:r.signal},ok);if(!s.ok&&s.status!==404)throw await Bs(s,Q("sandbox.deleteAgentFailed",{kind:n}))},async resumeSnapshot(n,i,r={}){if(!i)throw new Error(Q("sandbox.missingSnapshot"));const s=n==="codex"?"/web/sandbox":`/web/${n}`,o=await yn(`${s}/snapshots/${encodeURIComponent(i)}/resume`,{method:"POST",headers:ps(),signal:r.signal},E3);if(!o.ok)throw await Bs(o,Q("sandbox.resumeSnapshotFailed"));return Wb(await o.json(),n)},async deleteSnapshot(n,i,r={}){if(!i)return;const s=n==="codex"?"/web/sandbox":`/web/${n}`,o=await yn(`${s}/snapshots/${encodeURIComponent(i)}`,{method:"DELETE",headers:ps(),signal:r.signal},ok);if(!o.ok&&o.status!==404)throw await Bs(o,Q("sandbox.deleteSnapshotFailed"))},async connectSession(n,i={}){if(!n)throw new Error(Q("sandbox.missingSessionToConnect"));const r=await yn(`${e}/${encodeURIComponent(n)}/connect`,{method:"POST",headers:ps({"Content-Type":"application/json"}),signal:i.signal},Btt);if(!r.ok)throw await Bs(r,Q("sandbox.connectCodexFailed"));const s=Wb(await r.json(),"codex",t.intelligentDevelopment);if(s.status.toLowerCase()!=="ready")throw new Error(Q("sandbox.sessionNotReady",{status:s.status}));return s},async sendMessage(n,i={}){var s;if(!n.sessionId||!n.text.trim())throw new Error(Q("sandbox.invalidMessage"));const r=await yn(`${e}/${encodeURIComponent(n.sessionId)}/messages`,{method:"POST",headers:ps({Accept:"text/event-stream","Content-Type":"application/json"}),body:JSON.stringify({message:n.text,...!t.textOnly&&((s=n.skillIds)!=null&&s.length)?{skillIds:n.skillIds}:{}}),signal:i.signal},t.messageTimeoutMs??Utt);if(!r.ok)throw await Bs(r,Q("sandbox.conversationFailed"));return Gtt(r,i)},async interruptSession(n,i={}){if(!n)return;const r=await yn(`${e}/${encodeURIComponent(n)}/interrupt`,{method:"POST",headers:ps(),signal:i.signal},t.interruptTimeoutMs??ok);if(!r.ok&&![404,409].includes(r.status))throw await Bs(r,Q("sandbox.interruptFailed"))},async getStatus(n,i={}){const r=await tu(e,n,"status",{options:i,fallback:Q("sandbox.getStatusFailed")}),s=sJ(r),o=xa(r),l=X8(o==null?void 0:o.threadTotal),c=o==null?void 0:o.modelContextWindow;return{...s,...l?{threadTotal:l}:{},...typeof c=="number"&&Number.isFinite(c)&&c>=0?{modelContextWindow:Math.trunc(c)}:{}}},async getEndpoint(n,i={}){const r=xa(await tu(e,n,"endpoint",{options:i,fallback:Q("sandbox.getEndpointFailed")}));if(typeof(r==null?void 0:r.endpoint)!="string"||!r.endpoint.trim())throw new Error(Q("sandbox.invalidEndpoint"));return{endpoint:r.endpoint,sessionId:typeof r.sessionId=="string"?r.sessionId:n,...typeof r.expireAt=="string"?{expireAt:r.expireAt}:{}}},async createCodexProjectHandoffPairing(n={}){const i=await yn(`${JZ}/pairings`,{method:"POST",headers:ps({Accept:"application/json","Content-Type":"application/json"}),body:JSON.stringify({ttlSeconds:ztt}),signal:n.signal},tJ);if(!i.ok)throw await Bs(i,Q("sandbox.createHandoffPairingFailed"));const r=xa(await nJ(i,Q("sandbox.createHandoffPairingFailed")));if(typeof(r==null?void 0:r.pairingCode)!="string"||!r.pairingCode.trim()||typeof r.expireAt!="string"||!r.expireAt.trim())throw new Error(Q("sandbox.invalidHandoffPairing"));const s=typeof r.studioUrl=="string"&&r.studioUrl.trim()?r.studioUrl.trim():window.location.origin;return{pairingCode:r.pairingCode,expireAt:r.expireAt,studioUrl:s}},async getCodexProjectHandoffStatus(n,i={}){const r=await yn(`${JZ}/pairings/${encodeURIComponent(n)}`,{headers:ps({Accept:"application/json"}),signal:i.signal},tJ);if(!r.ok)throw await Bs(r,Q("sandbox.getHandoffStatusFailed"));const s=xa(await nJ(r,Q("sandbox.getHandoffStatusFailed"))),o=new Set(["issued","creating","session-created","continuing","running","completed","failed"]);if(typeof(s==null?void 0:s.state)!="string"||!o.has(s.state)||typeof s.expireAt!="string"||!s.expireAt.trim())throw new Error(Q("sandbox.invalidHandoffStatus"));return{state:s.state,expireAt:s.expireAt,...typeof s.projectName=="string"?{projectName:s.projectName}:{},...typeof s.agentName=="string"?{agentName:s.agentName}:{},...typeof s.sessionId=="string"?{sessionId:s.sessionId}:{},...typeof s.error=="string"?{error:s.error}:{},...s.failedStage==="creating-session"||s.failedStage==="uploading-project"||s.failedStage==="restoring-project"||s.failedStage==="continuing-task"?{failedStage:s.failedStage}:{}}},async listModels(n,i={}){const r=xa(await tu(e,n,"models",{options:i,fallback:Q("sandbox.listModelsFailed")}));if(!Array.isArray(r==null?void 0:r.models))throw new Error(Q("sandbox.invalidModelList"));return r.models.flatMap(s=>{const o=Htt(s);return o?[o]:[]})},async setModel(n,i,r={}){const s=xa(await tu(e,n,"model",{method:"PUT",body:{model:i},options:r,fallback:Q("sandbox.setModelFailed")}));if(typeof(s==null?void 0:s.model)!="string"||!s.model)throw new Error(Q("sandbox.invalidModel"));return s.model},async listSkills(n,i=!1,r={}){const o=xa(await tu(e,n,`skills${i?"?force_reload=true":""}`,{options:r,fallback:Q("sandbox.listSkillsFailed")}));if(!Array.isArray(o==null?void 0:o.skills))throw new Error(Q("sandbox.invalidSkillList"));return o.skills.flatMap(l=>{const c=qtt(l);return c?[c]:[]})},async listThreads(n,i={},r={}){const s=new URLSearchParams;i.cursor&&s.set("cursor",i.cursor),i.search&&s.set("search",i.search),i.archived&&s.set("archived","true");const o=s.size?`?${s}`:"",l=xa(await tu(e,n,`threads${o}`,{options:r,fallback:Q("sandbox.listThreadsFailed")}));if(!Array.isArray(l==null?void 0:l.threads))throw new Error(Q("sandbox.invalidThreadList"));return{threads:l.threads.flatMap(c=>{const u=$2e(c);return u?[u]:[]}),...typeof l.nextCursor=="string"?{nextCursor:l.nextCursor}:{}}},async newThread(n,i={}){return hy(await tu(e,n,"threads/new",{method:"POST",options:i,fallback:Q("sandbox.createThreadFailed")}))},async readThread(n,i,r={}){if(!i)throw new Error(Q("sandbox.missingThread"));return hy(await tu(e,n,`threads/${encodeURIComponent(i)}`,{options:r,fallback:Q("sandbox.readThreadFailed")}))},async resumeThread(n,i,r={}){return hy(await tu(e,n,"threads/resume",{method:"POST",body:{threadId:i},options:r,fallback:Q("sandbox.resumeThreadFailed")}))},async forkThread(n,i={}){return hy(await tu(e,n,"threads/fork",{method:"POST",options:i,fallback:Q("sandbox.forkThreadFailed")}))},async archiveThread(n,i,r={}){const s=xa(await tu(e,n,"threads/archive",{method:"POST",body:{threadId:i},options:r,fallback:Q("sandbox.archiveThreadFailed")}));if((s==null?void 0:s.archived)!==!0)throw new Error(Q("sandbox.invalidArchiveResult"));return{archived:!0,...s.thread?{snapshot:hy(s)}:{}}},async deleteThread(n,i,r={}){const s=xa(await tu(e,n,"threads/delete",{method:"POST",body:{threadId:i},options:r,fallback:Q("sandbox.deleteThreadFailed")}));if((s==null?void 0:s.deleted)!==!0)throw new Error(Q("sandbox.invalidDeleteResult"));return{deleted:!0,...s.thread?{snapshot:hy(s)}:{}}},async compactThread(n,i={}){await tu(e,n,"threads/compact",{method:"POST",options:i,fallback:Q("sandbox.compactThreadFailed")})},async getSettings(n,i={}){const r=await yn(`${e}/${encodeURIComponent(n)}/settings`,{method:"GET",headers:ps(),signal:i.signal},cp);if(!r.ok)throw await Bs(r,Q("sandbox.getSettingsFailed"));return sJ(await r.json())},async updatePermissions(n,i,r={}){const s=await yn(`${e}/${encodeURIComponent(n)}/permissions`,{method:"PUT",headers:ps({"Content-Type":"application/json"}),body:JSON.stringify(i),signal:r.signal},cp);if(!s.ok)throw await Bs(s,Q("sandbox.updatePermissionsFailed"));const o=await s.json();return LD(o.permissions)},async updateWorkspace(n,i,r={}){const s=await yn(`${e}/${encodeURIComponent(n)}/workspace`,{method:"PUT",headers:ps({"Content-Type":"application/json"}),body:JSON.stringify({cwd:i}),signal:r.signal},cp);if(!s.ok)throw await Bs(s,Q("sandbox.updateWorkspaceFailed"));const o=await s.json();if(typeof o.cwd!="string"||!o.cwd)throw new Error(Q("sandbox.invalidWorkingDirectory"));return o.cwd},async listDirectories(n,i,r={}){const s=new URLSearchParams({path:i}),o=await yn(`${e}/${encodeURIComponent(n)}/directories?${s}`,{method:"GET",headers:ps(),signal:r.signal},cp);if(!o.ok)throw await Bs(o,Q("sandbox.listDirectoriesFailed"));const l=await o.json();if(typeof l.path!="string"||!Array.isArray(l.directories)||l.directories.some(c=>!c||typeof c.name!="string"||typeof c.path!="string"))throw new Error(Q("sandbox.invalidDirectoryList"));return{path:l.path,...typeof l.parent=="string"?{parent:l.parent}:{},directories:l.directories}},async resolveApproval(n,i,r,s={}){const o=await yn(`${e}/${encodeURIComponent(n)}/approvals/${encodeURIComponent(i)}`,{method:"POST",headers:ps({"Content-Type":"application/json"}),body:JSON.stringify({decision:r}),signal:s.signal},cp);if(!o.ok)throw await Bs(o,Q("sandbox.resolveApprovalFailed"))},async launchTerminal(n,i={}){return aJ(e,n,"terminal",i)},async launchBrowser(n,i={}){return aJ(e,n,"browser",i)},async uploadFile(n,i,r={}){const s=new FormData;s.set("file",i,i.name);const o=await yn(`${e}/${encodeURIComponent(n)}/files`,{method:"POST",headers:ps(),body:s,signal:r.signal},Qtt);if(!o.ok)throw await Bs(o,Q("sandbox.uploadFileFailed"));const l=await o.json();if(typeof l.id!="string"||typeof l.path!="string"||typeof l.name!="string"||typeof l.mimeType!="string"||typeof l.sizeBytes!="number")throw new Error(Q("sandbox.invalidUploadResult"));return l},async closeSession(n,i={}){if(!n)return;const r=await yn(`${e}/${encodeURIComponent(n)}/disconnect`,{method:"POST",headers:ps(),signal:i.signal},ok);if(!r.ok&&r.status!==404)throw await Bs(r,Q("sandbox.disconnectCodexFailed"))},async deleteSession(n,i={}){if(!n)return;const r=await yn(`${e}/${encodeURIComponent(n)}`,{method:"DELETE",headers:ps(),signal:i.signal},ok);if(!r.ok&&r.status!==404)throw await Bs(r,Q("sandbox.deleteCodexFailed"))}}}const Br=B2e(Ftt),Nv=B2e("/web/intelligent-development/sessions",{textOnly:!0,messageTimeoutMs:36e5,interruptTimeoutMs:45e3,intelligentDevelopment:!0});async function aJ(e,t,n,i){const r=await yn(`${e}/${encodeURIComponent(t)}/${n}`,{method:"POST",headers:ps(),signal:i.signal},cp);if(!r.ok)throw await Bs(r,Q(n==="terminal"?"sandbox.openSandboxTerminalFailed":"sandbox.openSandboxBrowserFailed"));const s=await r.json();return{url:U2e(s.url,Q("sandbox.toolLabel")),...typeof s.shellSessionId=="string"?{shellSessionId:s.shellSessionId}:{}}}function U2e(e,t){if(typeof e!="string")throw new Error(Q("sandbox.invalidToolUrl",{label:t}));if(e.startsWith("/"))return Ta(e);let n;try{n=new URL(e)}catch{throw new Error(Q("sandbox.invalidToolUrl",{label:t}))}const i=n.protocol==="http:"&&window.location.protocol==="http:";if(n.protocol!=="https:"&&!i)throw new Error(Q("sandbox.unsafeToolUrl",{label:t}));return n.toString()}const pu=e=>["succeeded","cancelled","failed"].includes(e.state),Q2e="/web/intelligent-development";class Kw extends Error{constructor(t,n){super(t),this.status=n}}async function Kb(e,t="GET",n,i){const r=await yn(`${Q2e}${e}`,{method:t,signal:i,headers:ps(n===void 0?void 0:{"Content-Type":"application/json"}),...n===void 0?{}:{body:JSON.stringify(n)}},3e4);if(!r.ok){const s=await r.json().catch(()=>null),o=s==null?void 0:s.detail;throw new Kw(typeof o=="string"?o:(o==null?void 0:o.message)||Q("developmentRuns.requestFailed"),r.status)}return r.json()}function Rv(e){const t=e;if(!t||typeof t.runId!="string"||typeof t.sessionId!="string"||!["queued","running","recovering","waiting_user","stopping","succeeded","cancelled","failed"].includes(t.state))throw new Error(Q("developmentRuns.invalidResponse"));return t}const Jd={async active(e){const t=await Kb("/runs","GET",void 0,e);if(!Array.isArray(t.runs))throw new Error(Q("developmentRuns.invalidResponse"));return t.runs.map(Rv)},async get(e,t){return Rv(await Kb(`/runs/${encodeURIComponent(e)}`,"GET",void 0,t))},async list(e,t){const n=await Kb(`/sessions/${encodeURIComponent(e)}/runs`,"GET",void 0,t);if(!Array.isArray(n.runs))throw new Error(Q("developmentRuns.invalidResponse"));return n.runs.map(Rv)},async create(e,t,n){return Rv(await Kb(`/sessions/${encodeURIComponent(e)}/runs`,"POST",{message:t,requestId:n}))},async steer(e,t,n){await Kb(`/runs/${encodeURIComponent(e)}/inputs`,"POST",{message:t,clientId:n})},async stop(e){return Rv(await Kb(`/runs/${encodeURIComponent(e)}/stop`,"POST"))},async resume(e){return Rv(await Kb(`/runs/${encodeURIComponent(e)}/resume`,"POST"))}};class Xtt{constructor(t){Zt(this,"cursor",0);Zt(this,"turns",[]);Zt(this,"activeInput");Zt(this,"itemTurns",new Map);Zt(this,"nativeInputs",new Map);Zt(this,"metrics",new Map);Zt(this,"inputOrder",[]);Zt(this,"projections",new Map);Zt(this,"itemInputs",new Map);this.run=t,this.activeInput=t.requestId}projection(t){let n=this.projections.get(t);if(!n){const i={role:"assistant",blocks:[],meta:{localId:`${t}:assistant`}},r=this.turns.findIndex(s=>{var o;return((o=s.meta)==null?void 0:o.localId)===`${t}:user`});this.turns.splice(r<0?this.turns.length:r+1,0,i),n=F2e({onBlocks:s=>{i.blocks=s.map(o=>({...o,turnId:this.itemTurns.get(o.id||"")}))},onUsage:s=>{i.meta={...i.meta,sandboxUsage:s.usage}}}),this.projections.set(t,n)}return n}apply(t){if(t.payload.runId!==this.run.runId)throw new Error(Q("developmentRuns.invalidResponse"));if(t.seq<=this.cursor)return;if(t.seq!==this.cursor+1)throw new Error(Q("developmentRuns.eventGap"));for(const i of this.turns)i.blocks.some(r=>r.kind==="turn-summary")&&(i.blocks=i.blocks.filter(r=>r.kind!=="turn-summary"));const n=t.payload;if(t.type==="run.input"&&typeof n.clientId=="string"&&typeof n.message=="string")this.turns.push({role:"user",blocks:[{kind:"text",text:n.message}],meta:{localId:`${n.clientId}:user`},activity:{id:`${n.clientId}:delivery`,title:Q(`developmentRuns.input.${String(n.status)}`)}}),this.inputOrder.push(n.clientId),this.projection(n.clientId),n.status==="delivered"&&this.inputOrder.indexOf(n.clientId)>=this.inputOrder.indexOf(this.activeInput)&&(this.activeInput=n.clientId);else if(t.type==="run.input_status"&&typeof n.clientId=="string"){const i=this.turns.find(r=>{var s;return((s=r.meta)==null?void 0:s.localId)===`${n.clientId}:user`});i&&(i.activity={id:`${n.clientId}:delivery`,title:Q(`developmentRuns.input.${String(n.status)}`)}),n.status==="delivered"&&this.inputOrder.indexOf(n.clientId)>=this.inputOrder.indexOf(this.activeInput)&&(this.activeInput=n.clientId)}else if(t.type==="run.turn"&&typeof n.turnId=="string"){const r={...this.metrics.get(n.turnId),turnId:n.turnId,status:String(n.status||"inProgress"),toolCalls:0,toolDurationComplete:!1};for(const s of["startedAt","completedAt","durationMs"])typeof n[s]=="number"&&Number.isFinite(n[s])&&n[s]>=0&&(r[s]=n[s]);if(typeof n.model=="string"&&(r.model=n.model),n.usage&&typeof n.usage=="object"&&!Array.isArray(n.usage)){const s={};for(const o of["totalTokens","inputTokens","outputTokens","cachedInputTokens","cacheWriteInputTokens","reasoningOutputTokens"]){const l=n.usage[o];typeof l=="number"&&Number.isSafeInteger(l)&&l>=0&&(s[o]=l)}r.usage=s}n.usageIncomplete===!0&&(r.usageIncomplete=!0),this.metrics.set(n.turnId,r),this.nativeInputs.set(n.turnId,this.activeInput),this.projection(this.activeInput)}else if(t.type==="run.status"){if(this.run={...this.run,...n},pu(this.run))for(const[i,r]of this.metrics)r.status==="inProgress"&&this.metrics.set(i,{...r,status:"unavailable",usageIncomplete:!0});if(pu(this.run)||this.run.state==="waiting_user")for(const i of this.projections.values())i.consumeFrame(`event: done +${n}`}}async function*Fet({runtimeId:e,region:t,instanceName:n,sessionId:i,follow:r=!0,signal:s}){const o=new URLSearchParams({region:t,follow:String(r)});n&&o.set("instance_name",n),i&&o.set("session_id",i);const l=await fetch(Ta(`/web/runtime-logs/${encodeURIComponent(e)}/stream?${o.toString()}`),{headers:ul(uc({Accept:"text/event-stream"})),cache:"no-store",signal:s});if(!l.ok)throw new Error(Q("runtimeLogs.loadFailedWithDetail",{detail:await $et(l)}));for await(const c of LA(l)){if(!Let(c))throw new Error(Q("runtimeLogs.invalidFormat"));yield c}}const Bet=255,Uet=/[\p{L}\p{M}\p{N}\p{P}\p{Zs}]/u;function Qet(e){const t=e.normalize("NFKC").replace(/\s+/gu," ").trim(),n=new TextEncoder;let i=0,r="";for(const s of t){if(!Uet.test(s))continue;const o=n.encode(s).byteLength;if(i+o>Bet)break;r+=s,i+=o}return r.replace(/ +/g," ").trimEnd()}const zet=/RunPipeline result could not be reconciled|Polling build status failed/i;class lN extends Error{constructor({taskId:n,cause:i}={}){super("The deployment request may still be running, but its status could not be confirmed.");Zt(this,"taskId");this.name="DeploymentStatusUnconfirmedError",this.taskId=n}}function VAe(e){if(e instanceof lN)return!0;const t=e instanceof Error?e.message:String(e??"");return zet.test(t)}function HAe(e){return!!(e&&typeof e=="object"&&"name"in e&&e.name==="AbortError")}async function Vet({load:e,signal:t,timeoutMs:n=30*6e4,intervalMs:i=2e3,shouldRetry:r=()=>!0}){if(t!=null&&t.aborted)throw t.reason??new DOMException("Aborted","AbortError");const s=Date.now()+Math.max(0,n);for(;!(t!=null&&t.aborted)&&Date.now()<=s;){try{const o=await e(t);if(o.done)return o}catch(o){if(t!=null&&t.aborted||HAe(o)||!r(o))throw o}if(t!=null&&t.aborted)throw t.reason??new DOMException("Aborted","AbortError");i<=0||await new Promise((o,l)=>{const c=()=>{globalThis.clearTimeout(u),t==null||t.removeEventListener("abort",c),l((t==null?void 0:t.reason)??new DOMException("Aborted","AbortError"))},u=globalThis.setTimeout(()=>{t==null||t.removeEventListener("abort",c),o()},i);t==null||t.addEventListener("abort",c,{once:!0})})}return null}const P8="ap-southeast-1",gz="cn-beijing",Het="https://ark.ap-southeast.bytepluses.com/api/v3",qet="https://ark.cn-beijing.volces.com/api/v3/",Wet="https://console.byteplus.com/ark/region:ark+ap-southeast-1/openManagement",Ket="https://console.volcengine.com/ark/region:ark+cn-beijing/openManagement",Get="dola-seed-2-1-turbo-260628",Xet="doubao-seed-2-1-pro-260628",Yet="skylark-embedding-vision-250615",Zet="doubao-embedding-vision-250615",Jet="seed-2-0-lite-260228",ett="doubao-seed-2-0-lite-260428",ttt="dola-seedream-5-0-pro-260628",ntt="doubao-seedream-5-0-260128",itt="seededit-3-0-i2i-250628",rtt="doubao-seededit-3-0-i2i-250628",stt="dreamina-seedance-2-0-260128",att="doubao-seedance-2-0-260128";function ju(e){return e==="byteplus"?[{value:P8,label:P8}]:[{value:"cn-beijing",label:Q("cloudRegion.cnBeijing")},{value:"cn-shanghai",label:Q("cloudRegion.cnShanghai")}]}function Zi(e){var t;return((t=ju(e)[0])==null?void 0:t.value)||gz}const ott=new Set(["cn-beijing","cn-shanghai","ap-southeast-1"]);function AD(e){return typeof e=="string"&&ott.has(e)}function Oh(e,t){var i;return((i=(t?ju(t):[...ju("volcengine"),...ju("byteplus")]).find(r=>r.value===e))==null?void 0:i.label)||e||"-"}function Gp(e){return e==="byteplus"?Get:Xet}function Po(e){return e==="byteplus"?Het:qet}function ltt(e){return e==="byteplus"?Wet:Ket}function ctt(e){return e==="byteplus"?Yet:Zet}function utt(e){return e==="byteplus"?Jet:ett}function dtt(e){return e==="byteplus"?ttt:ntt}function ftt(e){return e==="byteplus"?itt:rtt}function htt(e){return e==="byteplus"?stt:att}const bz="veadk.messageFeedback.v1";function yz(e,t,n,i){return[e,t,n,i].join(":")}function vz(){if(typeof window>"u")return{};try{const e=JSON.parse(localStorage.getItem(bz)??"{}");return e&&typeof e=="object"?e:{}}catch{return{}}}function ptt(e,t,n){if(typeof window>"u")return;const i=vz();i[e]={...i[e]??{},[`veadk_feedback:${t}`]:n},localStorage.setItem(bz,JSON.stringify(i))}function qAe(e){if(typeof window>"u")return;const t=yz(e.runtimeId,e.appName,e.userId,e.sessionId),n=vz(),i=n[t];if(i){for(const r of e.eventIds)delete i[`veadk_feedback:${r}`];Object.keys(i).length===0?delete n[t]:n[t]=i,localStorage.setItem(bz,JSON.stringify(n))}}const cN="",xz=new Map;function WAe(e,t){xz.set(e,t)}function KAe(){xz.clear()}function Na(e){const t=xz.get(e);return t?{app:t.app,ep:{base:t.base,apiKey:t.apiKey,runtimeId:t.runtimeId,mpaInstanceId:t.mpaInstanceId,region:t.region,agentCategory:t.agentCategory}}:{app:e,ep:{}}}function B1(e,t){return e!=="a2a-default"&&!!(t.runtimeId&&(t.agentCategory==="mpa"||t.mpaInstanceId))}async function gt(e,t={},n={},i=ho){const r=po(t.signal,i),s=!!n.runtimeId&&String(t.method??"GET").toUpperCase()==="DELETE",o={...t,...s?{method:"POST"}:{},headers:ul(uc(t.headers))},l=()=>{const d={...o,signal:r};if(n.runtimeId){const f=new URLSearchParams;n.region&&f.set("_runtime_region",n.region),n.retryProbe&&f.set("probe_retry","connect"),s&&f.set("_method","DELETE");const h=f.toString()?`${e.includes("?")?"&":"?"}${f.toString()}`:"";return fetch(Ta(`${cN}/web/runtime-proxy/${n.runtimeId}${e}${h}`),d)}if(n.base){const f=new Headers(d.headers);return f.set("X-AgentKit-Base",n.base),n.apiKey&&f.set("X-AgentKit-Key",n.apiKey),fetch(Ta(`${cN}/agentkit-proxy${e}`),{...d,headers:f})}return fetch(Ta(`${cN}${e}`),d)},c=async d=>{if(d.headers.get("X-Studio-Error-Source")==="upstream")return!1;if(ket(d))return!0;if(d.status!==401)return!1;try{return await yet()}catch{return!1}};let u=await l();for(;await c(u);)await Eet(r),u=await l();return u}function yn(e,t={},n=ho){return gt(e,t,{},n)}function GAe(e){return typeof e=="string"?e:Array.isArray(e)?e.map(t=>{var n;if(t&&typeof t=="object"&&"msg"in t){const i=Array.isArray(t.loc)?(n=t.loc)==null?void 0:n.join("."):"",r=String(t.msg??"");return i?`${i}: ${r}`:r}return String(t)}).filter(Boolean).join(` +`):e&&typeof e=="object"?JSON.stringify(e):""}async function mtt(e){const t=await e.clone().text().catch(()=>"");if(!t)return"";try{const n=JSON.parse(t),i=n.detail??n.error;if(typeof i=="string")return i;if(i&&typeof i=="object"&&"code"in i)return String(i.code??"")}catch{return""}return""}async function Ft(e,t){const n=e.headers.get("X-Studio-Error-Source"),i=n==="upstream"?e.headers.get("X-Studio-Upstream-Status")??e.status:e.status,r=Q("common.fallbackWithHttpStatus",{fallback:t,status:i}),s=await e.text().catch(()=>"");if(n==="upstream")return Q("client.errorWithCloudResponse",{context:r,action:e.headers.get("X-Studio-Upstream-Action")??"",response:s||Q("client.emptyCloudResponse")});if(!s)return r;try{const o=JSON.parse(s),l=GAe(o.detail??o.error);return n==="transport"||n==="studio"?l?`${r} +${l}`:r:l?Q("client.errorWithDetailAndRawResponse",{context:r,detail:l,response:s}):Q("client.errorWithRawResponse",{context:r,response:s})}catch{return Q("client.errorWithRawResponse",{context:r,response:s})}}async function gtt(e){const t=await Ft(e,Q("client.mpaRuntimeSessionsLoadFailed"));return e.status===401&&/X-Jwt-Token/i.test(t)?Q("client.mpaRuntimeLegacyAuthUnsupported",{detail:t}):t}async function wz(e,t=!1){const n=await gt(`/web/model-api-keys${t?"?refresh=true":""}`,{signal:e,cache:"no-store"});if(!n.ok)throw new Error(await Ft(n,Q("client.loadArkApiKeysFailed")));return await n.json()}async function XAe(e,t){const n=await gt(`/web/model-api-keys/${encodeURIComponent(e)}/value`,{method:"POST",signal:t,cache:"no-store"});if(!n.ok)throw new Error(await Ft(n,Q("client.loadArkApiKeysFailed")));return await n.json()}async function U1(e){const t=new URLSearchParams;e!=null&&e.apiKeyId&&t.set("apiKeyId",e.apiKeyId),e!=null&&e.refresh&&t.set("refresh","true"),e!=null&&e.scope&&t.set("scope",e.scope);const n=t.toString(),i=await gt(`/web/model-options${n?`?${n}`:""}`,{signal:e==null?void 0:e.signal,cache:"no-store"});if(!i.ok)throw new Error(await Ft(i,Q("client.loadModelsFailed")));return await i.json()}async function YAe(){const e=await gt("/list-apps");if(!e.ok)throw new Error(`list-apps failed: ${e.status}`);return e.json()}class Q1 extends Error{constructor(){super(Q("client.runtimeAccessDenied")),this.name="RuntimeAccessDeniedError"}}class Oa extends Error{constructor(t,n=!1,i=!1){super(t),this.unsupported=n,this.retryable=i,this.name="RuntimeProbeError"}}const ZAe=()=>Q("client.privateRuntimeUnavailable"),JAe=()=>Q("client.runtimeTemporarilyUnavailable"),GZ=["cn-beijing","cn-shanghai"],btt=3e4,z1=5*60*1e3,eTe=60*1e3;let sC="volcengine";const nw=new Map,fy=new Map,hy=new Map,rf=new Map,ss=new Map;function Oz(e,t,n){return`${t}:${e}:${n??""}`}function tTe(e){e!==sC&&ss.clear(),sC=e}function $A(e){const t=(e||"").trim();if(sC==="byteplus")return[t&&!t.startsWith("cn-")?t:P8];const n=t&&!t.startsWith("ap-")?t:gz;return GZ.includes(n)?[n,...GZ.filter(i=>i!==n)]:[n]}function TD(e){const t=(e||"").trim();return t?[t]:$A()}function U0(...e){return e.map(t=>String(t??"")).join("")}function Eb(e,t,n){const i=e.get(t);return i!=null&&i.value&&Date.now()-i.updatedAt<=n?i.value:null}function kz(e,t,n){return e.set(t,{value:n,updatedAt:Date.now()}),n}function Z2(e,t){return t?t.aborted?Promise.reject(new DOMException("The operation was aborted.","AbortError")):new Promise((n,i)=>{const r=()=>{i(new DOMException("The operation was aborted.","AbortError"))};t.addEventListener("abort",r,{once:!0}),e.then(s=>{t.removeEventListener("abort",r),n(s)},s=>{t.removeEventListener("abort",r),i(s)})}):e}async function nTe(e){try{const t=await e.clone().json();return typeof t.detail=="string"?t.detail:""}catch{return""}}async function FA(e,t,n,i,r=ho){const s=await gt("/list-apps",{signal:i},n??{base:e,apiKey:t},r),o=n!=null&&n.runtimeId?await nTe(s):"";if(n!=null&&n.runtimeId&&o==="runtime_access_denied")throw new Q1;if(n!=null&&n.runtimeId&&o==="runtime_private_endpoint_unreachable")throw new Oa(ZAe());if(n!=null&&n.runtimeId&&["runtime_proxy_connect_error","runtime_proxy_timeout","runtime_json_connect_error","runtime_json_timeout"].includes(o))throw new Oa(JAe(),!1,!0);if(n!=null&&n.runtimeId&&s.status===404)throw new Oa(Q("client.runtimeConnectionUnsupported"),!0,!0);if(n!=null&&n.runtimeId&&(s.status===401||s.status===403))throw new Oa(Q("client.runtimeConnectionDenied"));if(!s.ok)throw new Error(await Ft(s,Q("client.listAgentsFailed")));let l;try{l=await s.json()}catch{throw new Oa(Q("client.invalidListAppsJson"))}if(!Array.isArray(l)||l.some(u=>typeof u!="string"||!u.trim()))throw new Oa(Q("client.invalidListAppsFormat"));const c=l.map(u=>u.trim());return n!=null&&n.runtimeId&&nw.set(Oz(n.runtimeId,n.region??"",n.runtimeVersion),{apps:c,expiresAt:Date.now()+btt}),c}async function iTe(e,t){const{app:n,ep:i}=Na(e);if(B1(n,i)){const o=await ytt(i),l=await gt(`/api/v1/agents/${encodeURIComponent(o)}/profile-status`,{cache:"no-store"},i),c=!l.ok&&await mtt(l)==="profile_not_found";if(!l.ok&&!c){const m=Q("client.createSessionFailedWithStatus",{status:l.status}),g=await Ft(l,Q("client.createSessionFailed"));throw new Error(g===m?m:Q("common.fallbackWithDetail",{fallback:m,detail:g}))}const u=c?{}:await l.json(),d=Number(u.profileRevision??0),f=await gt("/api/v1/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mpaInstanceId:o,profileRevision:d})},i);if(!f.ok){const m=Q("client.createSessionFailedWithStatus",{status:f.status}),g=await Ft(f,Q("client.createSessionFailed"));throw new Error(g===m?m:Q("common.fallbackWithDetail",{fallback:m,detail:g}))}const h=await f.json();return String(h.sessionId??h.id??"")}const r=await gt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"},i);if(!r.ok){const o=Q("client.createSessionFailedWithStatus",{status:r.status}),l=await Ft(r,Q("client.createSessionFailed"));throw new Error(l===o?o:Q("common.fallbackWithDetail",{fallback:o,detail:l}))}return(await r.json()).id}async function ytt(e){var i,r,s,o;const t=(i=e.mpaInstanceId)==null?void 0:i.trim();if(t)return t;const n=((r=e.runtimeId)==null?void 0:r.trim())??"";if(!n)return"";try{const l=await DD(n,e.region??"cn-beijing"),c=(s=l.mpaInstanceId)==null?void 0:s.trim();if(c)return c;const u=(o=l.envs.find(d=>d.key==="MPA_AGENT_ID"))==null?void 0:o.value.trim();if(u)return u}catch{}return n}async function Sz(e,t){const{app:n,ep:i}=Na(e);if(B1(n,i)){const s=await gt("/api/v1/sessions",{cache:"no-store"},i);if(!s.ok)throw new Error(await gtt(s));const o=await s.json();return Array.isArray(o)?o:o.sessions??[]}const r=await gt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{},i);if(!r.ok)throw new Error(await Ft(r,Q("client.listSessionsFailed")));return r.json()}async function aC(e,t,n){const{app:i,ep:r}=Na(e);if(B1(i,r)){const l=await gt(`/api/v1/sessions/${encodeURIComponent(n)}`,{cache:"no-store"},r);if(!l.ok){const f=await Ft(l,Q("client.getSessionFailed"));throw new Error(Q("client.getSessionFailedWithDetail",{status:l.status,detail:f}))}const c=await l.json(),u=await gt(`/api/v1/sessions/${encodeURIComponent(n)}/events`,{cache:"no-store"},r);if(!u.ok){const f=await Ft(u,Q("client.getSessionFailed"));throw new Error(Q("client.getSessionFailedWithDetail",{status:u.status,detail:f}))}const d=await u.json();return c.events=Array.isArray(d.events)?d.events:[],c}const s=await gt(`/apps/${i}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}`,{},r);if(!s.ok){const l=await Ft(s,Q("client.getSessionFailed"));throw new Error(Q("client.getSessionFailedWithDetail",{status:s.status,detail:l}))}const o=await s.json();if(r.runtimeId){const l=yz(r.runtimeId,i,t,n);o.state={...vz()[l]??{},...o.state??{}}}return o}async function rTe(e){const{app:t,ep:n}=Na(e.appName);if(!n.runtimeId)throw new Error(Q("client.feedbackRuntimeOnly"));if(!n.region)throw new Error(Q("client.feedbackRegionMissing"));const i=await gt("/web/evaluation/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:n.runtimeId,region:n.region,appName:t,userId:e.userId,sessionId:e.sessionId,eventId:e.eventId,rating:e.rating,comment:e.comment??""})},{},hr);if(!i.ok)throw new Error(await Ft(i,Q("client.submitFeedbackFailed")));const r=await i.json(),s=yz(n.runtimeId,t,e.userId,e.sessionId);return ptt(s,e.eventId,r),r}async function _D(e,t={}){const n=U0(e.runtimeId,e.region||"cn-beijing",e.appName,e.pageSize??100),i=Eb(rf,n,eTe);if(!t.force&&i)return i;const r=rf.get(n);if(!t.force&&(r!=null&&r.promise))return r.promise;let s=null;const o=(async()=>{for(const l of TD(e.region)){const c=new URLSearchParams({runtimeId:e.runtimeId,region:l,appName:e.appName,page_size:String(e.pageSize??100)}),u=await gt(`/web/evaluation/feedback-cases?${c.toString()}`);if(u.ok)return kz(rf,n,await u.json());s=new Error(await Ft(u,Q("client.loadEvaluationSetsFailed")))}throw s??new Error(Q("client.loadEvaluationSetsFailed"))})();rf.set(n,{...r,promise:o,updatedAt:(r==null?void 0:r.updatedAt)??0});try{return await o}finally{const l=rf.get(n);(l==null?void 0:l.promise)===o&&rf.set(n,{value:l.value,updatedAt:l.updatedAt})}}async function D8(e){let t=null;for(const n of TD(e.region)){const i=new URLSearchParams({runtimeId:e.runtimeId,region:n,appName:e.appName,userId:e.userId}),r=await gt(`/web/evaluation/statuses?${i.toString()}`);if(r.ok)return r.json();t=new Error(await Ft(r,Q("client.loadAutoEvaluationStatusFailed")))}throw t??new Error(Q("client.loadAutoEvaluationStatusFailed"))}async function sTe(e){let t=null;for(const n of TD(e.region)){const i=new URLSearchParams({runtimeId:e.runtimeId,region:n,appName:e.appName}),r=await gt(`/web/evaluation/optimizations?${i.toString()}`);if(r.ok)return r.json();t=new Error(await Ft(r,Q("client.loadOptimizationsFailed")))}throw t??new Error(Q("client.loadOptimizationsFailed"))}function aTe(e){return Eb(rf,U0(e.runtimeId,e.region||"cn-beijing",e.appName,e.pageSize??100),eTe)}function vtt(e){_D(e).catch(()=>{})}function oTe(e){_D(e,{force:!0}).catch(()=>{})}function lTe(e,t){return["good","bad"].map(n=>{const i=e.find(r=>r.kind===n);return{kind:n,evaluationSetId:(i==null?void 0:i.evaluationSetId)??null,evaluationSetName:(i==null?void 0:i.evaluationSetName)??null,workspaceId:(i==null?void 0:i.workspaceId)??null,itemCount:t.filter(r=>r.kind===n).length}})}function uN(e){const t=e.comment??"",n=e.rating==="bad"&&!!t.trim();for(const[i,r]of rf.entries()){const s=r.value;if(!s||s.runtimeId!==e.runtimeId||s.agentName!==e.appName)continue;const o=s.items.filter(c=>c.sessionId!==e.sessionId||c.messageId!==e.messageId),l=e.rating?[{id:`local:${e.runtimeId}:${e.sessionId}:${e.messageId}`,itemKey:`local:${e.messageId}`,kind:e.rating,input:e.input,output:e.output,referenceOutput:e.referenceOutput??e.output,comment:t,agentName:e.appName,sessionId:e.sessionId,messageId:e.messageId,runtimeId:e.runtimeId,invocationId:e.invocationId??"",userId:e.userId,createdAt:e.createdAt??new Date().toISOString(),evaluationSetId:"",evaluationSetName:"",workspaceId:"",source:"user",score:n?0:null,reason:n?t:""},...o]:o;rf.set(i,{value:{...s,sets:lTe(s.sets,l),items:l},updatedAt:Date.now(),promise:r.promise})}}async function cTe(e){let t=null;for(const n of TD(e.region)){const i=await gt("/web/evaluation/feedback-cases/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e.runtimeId,region:n,appName:e.appName,itemIds:e.itemIds})},{},hr);if(i.ok){const r=await i.json(),s=new Set(e.itemIds);for(const[o,l]of rf.entries()){const c=l.value;if(!c||c.runtimeId!==e.runtimeId||c.agentName!==e.appName)continue;const u=c.items.filter(d=>!s.has(d.id));rf.set(o,{value:{...c,sets:lTe(c.sets,u),items:u},updatedAt:Date.now()})}return r}t=new Error(await Ft(i,Q("client.deleteEvaluationCaseFailed")))}throw t??new Error(Q("client.deleteEvaluationCaseFailed"))}async function M8(e,t,n){const{app:i,ep:r}=Na(e);if(B1(i,r)){const o=await gt(`/api/v1/sessions/${encodeURIComponent(n)}`,{method:"DELETE"},r);if(!o.ok&&o.status!==404)throw new Error(`delete session failed: ${o.status}`);return}const s=await gt(`/apps/${i}/users/${encodeURIComponent(t)}/sessions/${n}`,{method:"DELETE"},r);if(!s.ok&&s.status!==404)throw new Error(`delete session failed: ${s.status}`)}function xtt(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"="),i=window.atob(n),r=new Uint8Array(i.length);for(let s=0;sURL.revokeObjectURL(l),0)}async function dTe(e,t,n,i,r){const{app:s,ep:o}=Na(e),l=r==null?"":`?version=${encodeURIComponent(r)}`,c=`/apps/${encodeURIComponent(s)}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}/artifacts/${encodeURIComponent(i)}${l}`,u=await gt(c,{},o,hr);if(!u.ok)throw new Error(await Ft(u,Q("client.downloadFileFailed")));const d=await u.json(),f=d.inlineData??d.inline_data;if(!(f!=null&&f.data))throw new Error(Q("client.fileUnavailable"));const h=xtt(f.data),m=h.buffer.slice(h.byteOffset,h.byteOffset+h.byteLength);return{blob:new Blob([m],{type:f.mimeType??f.mime_type??"application/octet-stream"}),downloadName:f.displayName??f.display_name??i}}async function Cz(e,t,n,i,r){const{blob:s}=await dTe(e,t,n,i,r);return URL.createObjectURL(s)}async function wtt(e){const t=await gt("/web/media/capabilities");if(!t.ok)throw new Error(await Ft(t,"media capabilities failed"));return t.json()}async function fTe(e,t,n,i){const{app:r}=Na(e),s=new FormData;s.set("app_name",r),s.set("user_id",t),s.set("session_id",n),s.set("file",i);const o=await gt("/web/media",{method:"POST",body:s},{},hr);if(!o.ok)throw new Error(await Ft(o,Q("client.uploadFileFailed")));return{...await o.json(),status:"ready"}}async function L8(e,t,n){const{app:i}=Na(e),r=`/web/media/${encodeURIComponent(i)}/${encodeURIComponent(t)}/${encodeURIComponent(n)}/delete`,s=await gt(r,{method:"POST"});if(!s.ok&&s.status!==404)throw new Error(await Ft(s,"media cleanup failed"))}function hTe(e){try{const t=new URL(e);if(t.protocol!=="veadk-media:"||t.hostname!=="apps")return;const n=t.pathname.split("/").filter(Boolean).map(decodeURIComponent);return n.length!==7||n[1]!=="users"||n[3]!=="sessions"||n[5]!=="media"?void 0:`/web/media/${n.map(encodeURIComponent).filter((i,r)=>![1,3,5].includes(r)).join("/")}`}catch{return}}async function dN(e,t){const n=hTe(t);if(!n)throw new Error("Invalid VeADK media URI");const i=await gt(`${n}/delete`,{method:"POST"});if(!i.ok&&i.status!==404)throw new Error(await Ft(i,"media cleanup failed"))}function pTe(e,t){if(t.startsWith("data:")||t.startsWith("blob:")||/^https?:/.test(t))return t;const n=hTe(t);if(!n)return t;const i=`${n}/content`;return Ta(`${cN}${i}`)}async function JR(e,t,n){const{app:i,ep:r}=Na(e);let s;if(r.runtimeId){const c=new URLSearchParams({runtimeId:r.runtimeId,sessionId:t,region:r.region??"cn-beijing"});if(n&&c.set("endTimeMs",String(Math.round(n))),s=await gt(`/web/runtime-trace?${c.toString()}`),s.status===404)throw new Error(Q("client.traceDisabled"))}else s=await gt(`/dev/apps/${encodeURIComponent(i)}/debug/trace/session/${encodeURIComponent(t)}`,{},r);if(!s.ok)throw new Error(await Ft(s,Q("client.loadTraceFailed")));const o=s.headers.get("content-type")??"";if(!o.includes("application/json")){const c=o.split(";",1)[0]||Q("client.contentTypeMissing");throw new Error(Q("client.traceNonJson",{contentType:c}))}const l=await s.json();if(!Array.isArray(l))throw new Error(Q("client.invalidTraceFormat"));return l}async function $8(e){const t=await gt("/web/issue-feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await Ft(t,Q("client.submitIssueFeedbackFailed")));if((await t.json()).submitted!==!0)throw new Error(Q("client.issueFeedbackNotConfirmed"));return{submitted:!0}}async function XZ(e,t,n=!0,i){const r=await gt(`/web/agent-info/${e}`,{signal:i},t);if(!r.ok)throw new Error(`agent-info failed: ${r.status}`);const s=await r.json();if(n&&!s.draft)try{const o=await gt(`/web/agent-draft/${e}`,{},t);if(o.ok){const l=await o.json();s.draft=l.draft}}catch{}return{appName:e,agentCategory:s.agentCategory,mpa:s.mpa,name:s.name??e,description:s.description??"",type:s.type,model:s.model??"",selectableModels:s.selectableModels??[],turnLifecycleControl:s.turnLifecycleControl,resourceTopology:s.resourceTopology,tools:s.tools??[],skillsPreviewSupported:Array.isArray(s.skills),skills:s.skills??[],subAgents:s.subAgents??[],components:s.components??[],searchSources:s.searchSources??[],graph:s.graph,draft:s.draft}}function Ott(e){return/agent-info failed:\s*404\b/i.test(String(e))}async function mTe(e,t,n=!0,i){try{return await XZ(e,t,n,i)}catch(r){if(e==="a2a-default"||!Ott(r))throw r;return XZ("a2a-default",t,n,i)}}class jD extends Error{constructor(t){super("Turn state changed before the control request completed"),this.authoritativeState=t,this.name="TurnControlConflictError"}}async function gTe(e,t){const{ep:n}=Na(e),i=await gt(`/api/v1/a2a/tasks/by-session/${encodeURIComponent(t)}/control`,{cache:"no-store"},n);if(!i.ok)throw new Error(await Ft(i,"turn control failed"));return i.json()}async function bTe(e,t,n,i){var o;const{ep:r}=Na(e),s=await gt(`/api/v1/a2a/tasks/by-session/${encodeURIComponent(t)}/control/${n}`,{method:"POST",headers:{"Content-Type":"application/json","Idempotency-Key":crypto.randomUUID()},body:JSON.stringify({expectedGeneration:i})},r);if(s.status===409){const l=await s.json().catch(()=>null);if((o=l==null?void 0:l.detail)!=null&&o.taskId)throw new jD(l.detail)}if(!s.ok)throw new Error(await Ft(s,"turn control failed"));return s.json()}async function ktt(e,t,n,i,r){var c;const{ep:s}=Na(e),o=await gt(`/api/v1/a2a/tasks/${encodeURIComponent(n)}/continue`,{method:"POST",headers:{"Content-Type":"application/json","Idempotency-Key":r},body:JSON.stringify({expectedGeneration:i})},s);if(o.status===409){const u=await o.json().catch(()=>null);if((c=u==null?void 0:u.detail)!=null&&c.taskId)throw new jD(u.detail)}if(!o.ok)throw new Error(await Ft(o,"turn continue failed"));const l=await o.json();if(l.sessionId!==t)throw new Error("turn continue returned a different session");return l}async function*yTe({appName:e,sessionId:t,taskId:n,expectedGeneration:i,idempotencyKey:r,lastEventId:s,signal:o,onRuntimeContext:l}){const{ep:c}=Na(e),u=(s==null?void 0:s.trim())??"",d=_z(o);let f;try{const g=await gt(`/api/v1/a2a/tasks/${encodeURIComponent(n)}/continue`,{method:"POST",headers:{"Content-Type":"application/json","Idempotency-Key":r},body:JSON.stringify({expectedGeneration:i}),signal:d.signal},c,0),b=ZR(g,c.runtimeId??"",c.region??"");if(b&&(l==null||l(b)),!g.ok){d.cleanup();const y=await Ft(g,"turn continue failed");throw new Error(Jo(Q("client.runSseFailedWithDetail",{status:g.status,detail:y})))}const v=await g.json();if(v.sessionId!==t)throw d.cleanup(),new Error(Jo("turn continue returned a different session"));f=await gt(`/api/v1/sessions/${encodeURIComponent(t)}/sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invocationId:v.invocationId,...u?{lastEventId:u}:{}}),signal:d.signal},c,0)}catch(g){throw d.cleanup(),d.timedOut()?new Error(Xg()):o!=null&&o.aborted||(g==null?void 0:g.name)==="AbortError"?g:new Error(Jo(g))}const h=ZR(f,c.runtimeId??"",c.region??"");if(h&&(l==null||l(h)),!f.ok){d.cleanup();const g=await Ft(f,Q("client.runSessionFailed"));throw new Error(Jo(Q("client.runSseFailedWithDetail",{status:f.status,detail:g})))}let m=!1;try{for await(const g of LA(f)){if(g&&typeof g=="object"&&g[rC]==="done"){d.clearDeadline();break}m=!0,d.clearDeadline();const b={...g};delete b[rC],typeof b.error=="string"&&(b.error=Jo(b.error)),typeof b.errorMessage=="string"&&(b.errorMessage=Jo(b.errorMessage)),typeof b.error_message=="string"&&(b.error_message=Jo(b.error_message)),yield b}}catch(g){throw d.timedOut()?new Error(Xg()):o!=null&&o.aborted||(g==null?void 0:g.name)==="AbortError"?g:new Error(Jo(g))}finally{d.cleanup()}if(!m)throw new Error(Tz())}async function F8(e,t){const{app:n,ep:i}=Na(e);return mTe(n,i,!1,t)}async function Stt(e,t,n){let i=null;for(const r of $A(t)){const s={runtimeId:e,region:r};try{const o=Oz(e,r),l=nw.get(o);l&&l.expiresAt<=Date.now()&&nw.delete(o);const c=nw.get(o),u=n||(c==null?void 0:c.apps[0])||(await FA("","",s))[0];if(!u)throw new Error(Q("client.noPreviewableAgent"));return mTe(u,s)}catch(o){if(o instanceof Q1||o instanceof Oa&&!o.unsupported)throw o;i=o instanceof Error?o:new Error(String(o))}}throw i??new Error(Q("client.noPreviewableAgent"))}async function Az(e,t,n={},i={}){const r=typeof n=="string"?n:void 0,s=typeof n=="string"?i:n,o=U0(e,t||"cn-beijing",r??""),l=Eb(fy,o,z1);if(!s.force&&l)return l;const c=fy.get(o);if(!s.force&&(c!=null&&c.promise))return c.promise;const u=Stt(e,t,r).then(d=>kz(fy,o,d));fy.set(o,{...c,promise:u,updatedAt:(c==null?void 0:c.updatedAt)??0});try{return await u}finally{const d=fy.get(o);(d==null?void 0:d.promise)===u&&fy.set(o,{value:d.value,updatedAt:d.updatedAt})}}function vTe(e,t,n=""){return Eb(fy,U0(e,t||"cn-beijing",n),z1)}function xTe(e,t,n=""){Az(e,t,n).catch(()=>{})}function eI(e){const{app:t,ep:n}=Na(e);return B1(t,n)}function ip(e){const{app:t,ep:n}=Na(e);return t==="a2a-default"&&!!(n.runtimeId&&(n.agentCategory==="mpa"||n.mpaInstanceId))}async function wTe(e,t,n,i){const{app:r,ep:s}=Na(e),o=new URLSearchParams({source:t,app_name:r,q:n,user_id:i}),l=await gt(`/web/search?${o.toString()}`,{},s);if(!l.ok)throw new Error(await Ft(l,Q("client.agentSearchFailed")));return l.json()}async function OTe(e,t){const{app:n}=Na(e),i=await gt(`/web/search?source=web&app_name=${encodeURIComponent(n)}&q=${encodeURIComponent(t)}`);if(!i.ok)throw new Error(`web search failed: ${i.status}`);return i.json()}function Tz(){return Jo(Q("client.emptySseBody"))}function uS(){return Jo(Q("client.noDisplayableSseReply"))}const Ett=6e4;function Xg(){return Q("client.firstSseEventTimeout")}function _z(e){if(e!=null&&e.aborted)return{signal:e,clearDeadline:()=>{},cleanup:()=>{},timedOut:()=>!1};const t=new AbortController;let n=!1,i=!1;const r=()=>{i||(i=!0,clearTimeout(o))},s=()=>{t.signal.aborted||t.abort((e==null?void 0:e.reason)??new DOMException("Aborted","AbortError"))},o=setTimeout(()=>{i||t.signal.aborted||(n=!0,i=!0,t.abort(new Error(Xg())))},Ett);return e==null||e.addEventListener("abort",s,{once:!0}),{signal:t.signal,clearDeadline:r,cleanup:()=>{r(),e==null||e.removeEventListener("abort",s)},timedOut:()=>n}}async function*B8({appName:e,userId:t,sessionId:n,text:i,modelId:r,idempotencyKey:s,executionConfigVersion:o,lastEventId:l,attachments:c=[],invocation:u,platformTools:d,environmentMounts:f,environmentMount:h,functionResponses:m=[],signal:g,onRuntimeContext:b}){const{app:v,ep:y}=Na(e),w=c.flatMap(I=>I.status&&I.status!=="ready"?[]:I.uri?[{fileData:{mimeType:I.mimeType,fileUri:I.uri,displayName:I.name},partMetadata:{veadkMedia:{id:I.id,uri:I.uri,name:I.name,mimeType:I.mimeType,sizeBytes:I.sizeBytes}}}]:I.data?[{inlineData:{mimeType:I.mimeType,data:I.data,displayName:I.name}}]:[]),x=u&&(u.skills.length>0||u.targetAgent)?u:void 0,O=[...w,...m.map(I=>({functionResponse:{id:I.id,name:I.name,response:I.response}})),...i.trim()?[{text:i}]:[]];if(x&&O.length>0){const I=O[0],P=I.partMetadata;O[0]={...I,partMetadata:{...P,veadkInvocation:x}}}const k=(s==null?void 0:s.trim())??"",S=(l==null?void 0:l.trim())??"",C=typeof o=="number",E=C||k?{veadkExecution:{...C?{executionConfigVersion:o}:{},...k?{idempotencyKey:k}:{}}}:void 0,j=x||E?{...x?{veadkInvocation:x}:{},...E??{}}:void 0,T=B1(v,y);if(T&&y.runtimeId){const I=y.region?`?region=${encodeURIComponent(y.region)}`:"";try{const P=await yn(`/web/mpa/identity-prewarm/${encodeURIComponent(y.runtimeId)}${I}`,{method:"POST",headers:{"X-Requested-With":"XMLHttpRequest"},signal:g},1e4);P.ok||console.warn("[mpa] identity prewarm unavailable",P.status)}catch(P){if(g!=null&&g.aborted)throw P;console.warn("[mpa] identity prewarm unavailable")}}let R;const A=_z(g);try{if(T){const I=await gt(`/api/v1/sessions/${encodeURIComponent(n)}/run`,{method:"POST",headers:{"Content-Type":"application/json",...k?{"Idempotency-Key":k}:{}},body:JSON.stringify({content:i,...C?{executionConfigVersion:o}:{}}),signal:A.signal},y,0),P=ZR(I,y.runtimeId??"",y.region??"");if(P&&(b==null||b(P)),!I.ok){A.cleanup();const L=await Ft(I,Q("client.runSessionFailed"));throw new Error(Jo(Q("client.runSseFailedWithDetail",{status:I.status,detail:L})))}const _=await I.json();R=await gt(`/api/v1/sessions/${encodeURIComponent(n)}/sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invocationId:_.invocationId,...S?{lastEventId:S}:{}}),signal:A.signal},y,0)}else R=await gt("/run_sse",{method:"POST",headers:{"Content-Type":"application/json",...k?{"Idempotency-Key":k}:{}},body:JSON.stringify({app_name:v,user_id:t,session_id:n,new_message:{role:"user",parts:O},streaming:!0,...S?{lastEventId:S}:{},...C?{executionConfigVersion:o}:{},...r!=null&&r.trim()?{model_id:r.trim()}:{},...d!==void 0?{platform_tools:[...d]}:{},...f!==void 0?{environment_mounts:[...f]}:h?{environment_mount:h}:{},custom_metadata:j}),signal:A.signal},y,0)}catch(I){throw A.cleanup(),A.timedOut()?new Error(Xg()):g!=null&&g.aborted||(I==null?void 0:I.name)==="AbortError"?I:new Error(Jo(I))}const N=ZR(R,y.runtimeId??"",y.region??"");if(N&&(b==null||b(N)),!R.ok){A.cleanup();const I=await Ft(R,Q("client.runSessionFailed"));throw new Error(Jo(Q("client.runSseFailedWithDetail",{status:R.status,detail:I})))}let D=!1;try{for await(const I of LA(R)){if(I&&typeof I=="object"&&I[rC]==="done"){A.clearDeadline();break}D=!0,A.clearDeadline();const P={...I};delete P[rC],typeof P.error=="string"&&(P.error=Jo(P.error)),typeof P.errorMessage=="string"&&(P.errorMessage=Jo(P.errorMessage)),typeof P.error_message=="string"&&(P.error_message=Jo(P.error_message)),yield P}}catch(I){throw A.timedOut()?new Error(Xg()):g!=null&&g.aborted||(I==null?void 0:I.name)==="AbortError"?I:new Error(Jo(I))}finally{A.cleanup()}if(!D)throw new Error(Tz())}class iw extends Error{constructor(n,{status:i,code:r,currentState:s}){super(n);Zt(this,"status");Zt(this,"code");Zt(this,"currentState");this.name="MpaExecutionConfigRequestError",this.status=i,this.code=r,this.currentState=s}}async function jz(e){const t=Q("client.mpaExecutionConfigFailed"),n=await e.text().catch(()=>"");if(!n)return new iw(Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),{status:e.status,code:""});try{const i=JSON.parse(n),r=i.error&&typeof i.error=="object"?i.error:i.detail&&typeof i.detail=="object"?i.detail:null,s=GAe(i.detail??i.error),o=s?Q("client.errorWithDetailAndRawResponse",{context:Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),detail:s,response:n}):Q("client.errorWithRawResponse",{context:Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),response:n});return new iw(o,{status:e.status,code:String((r==null?void 0:r.code)??""),currentState:(r==null?void 0:r.currentState)??i.currentState})}catch{return new iw(Q("client.errorWithRawResponse",{context:Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),response:n}),{status:e.status,code:""})}}function BA(e){var r,s,o;const t=(e.selectedSkills??[]).map(l=>({source:l.source,folder:l.folder,name:l.name,skillSpaceId:l.skillSpaceId,skillSpaceName:l.skillSpaceName,skillSpaceRegion:l.skillSpaceRegion,skillId:l.skillId,version:l.version})),n=(e.skills??[]).map(l=>({name:l})),i=(e.mcpTools??[]).map(l=>({name:l.name,transport:l.transport,url:l.url}));return{name:((r=e.name)==null?void 0:r.trim())||"mpa-agent",description:e.description??"",system:((s=e.instruction)==null?void 0:s.trim())||"You are a helpful assistant.",model:{id:e.modelName||e.model||"",source:e.modelSource??"ark",provider:e.modelProvider??"",apiBase:e.modelApiBase??""},tools:[...(e.builtinTools??[]).map(l=>({id:l,source:"builtin"})),...(e.tools??[]).map(l=>({name:l,source:"legacy"})),...(e.customTools??[]).map(l=>({name:l.name,description:l.description,source:"custom"}))],skills:[...t,...n],mcpServers:i,...(o=e.subAgents)!=null&&o.length?{multiagent:{type:e.agentType??"llm",subAgents:e.subAgents.map(BA)}}:{},metadata:{"veadk:agent-type":"mpa","veadk:source":"studio-agent-draft",agentType:e.agentType??"llm"}}}async function Nz(e){const t={operationKind:e.operationKind,runtimeId:e.runtimeId,region:e.region,mpaInstanceId:e.mpaInstanceId,sourceProfileId:e.sourceProfileId,targetKey:e.targetKey,runtimeRevision:e.runtimeRevision,profile:BA(e.draft)},n=e.operationKind==="update"?`/web/mpa/agents/${encodeURIComponent(e.mpaInstanceId)}`:"/web/mpa/agents",i=await gt(n,{method:e.operationKind==="update"?"PATCH":"POST",headers:{"Content-Type":"application/json","Idempotency-Key":e.idempotencyKey},body:JSON.stringify(t)});if(!i.ok)throw new Error(await Ft(i,Q("client.mpaOperationFailed")));return await i.json()}async function tI(e){var r,s,o,l;const t=e.runtimeId.trim(),n=((r=e.mpaInstanceId)==null?void 0:r.trim())||t,i=(s=e.sourceDraftId)!=null&&s.trim()?`studio-draft:${e.sourceDraftId.trim()}`:`studio-agent:${e.agentName}:${e.taskId}`;return Nz({operationKind:e.operationKind,runtimeId:t,region:e.region,mpaInstanceId:n,sourceProfileId:i,draft:e.draft,targetKey:e.operationKind==="update"?n:`runtime:${e.region}:${((o=e.runtimeName)==null?void 0:o.trim())||n}`,runtimeRevision:((l=e.runtimeRevision)==null?void 0:l.trim())||void 0,idempotencyKey:`${e.taskId}:mpa-profile`})}async function kTe(){const e=await gt("/web/mpa/agent-operations?status=active",{cache:"no-store"});if(!e.ok)throw new Error(await Ft(e,Q("client.mpaOperationLoadFailed")));return(await e.json()).operations??[]}async function STe(e,t){const n=await gt(`/web/mpa/agent-operations/${encodeURIComponent(e)}`,{cache:"no-store",signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.mpaOperationLoadFailed")));return await n.json()}async function ETe(e){const t=new URLSearchParams({runtimeId:e.runtimeId,region:e.region}),n=await gt(`/web/mpa/agents/${encodeURIComponent(e.mpaInstanceId)}/profile-status?${t.toString()}`,{cache:"no-store",signal:e.signal});if(!n.ok)throw new Error(await Ft(n,Q("client.mpaOperationLoadFailed")));const i=await n.json();return{operationId:String(i.operationId??""),status:String(i.status??""),profileRevision:Number(i.profileRevision??0),runtimeRevision:String(i.runtimeRevision??""),etag:String(i.etag??n.headers.get("ETag")??"")}}async function CTe(e){const t=new URLSearchParams({region:e.region??"all"});e.runtimeId&&t.set("runtimeId",e.runtimeId);const n=await gt(`/web/mpa/agents/${encodeURIComponent(e.mpaInstanceId)}/view?${t.toString()}`,{cache:"no-store",signal:e.signal});if(!n.ok)throw new Error(await Ft(n,Q("client.mpaOperationLoadFailed")));return await n.json()}async function ATe(e){const t=new URLSearchParams({runtimeId:e.runtimeId,region:e.region}),n=await gt(`/web/mpa/agents/${encodeURIComponent(e.mpaInstanceId)}/delete-preview?${t.toString()}`,{cache:"no-store",signal:e.signal});if(!n.ok)throw new Error(await Ft(n,Q("client.mpaDeletePreviewFailed")));return await n.json()}async function TTe(e){const t={runtimeId:e.runtimeId,region:e.region},n=await gt(`/api/v1/runtime-console/admin/sessions/${encodeURIComponent(e.sessionId)}/runs`,{cache:"no-store",signal:e.signal},t);if(!n.ok)throw new Error(await Ft(n,Q("client.loadMpaDiagnosticsFailed")));return await n.json()}async function _Te(e){const t={runtimeId:e.runtimeId,region:e.region},n=new URLSearchParams({sessionId:e.sessionId}),i=await gt(`/api/v1/runtime-console/admin/runs/${encodeURIComponent(e.invocationId)}/trace?${n.toString()}`,{cache:"no-store",signal:e.signal},t);if(!i.ok)throw new Error(await Ft(i,Q("client.loadMpaDiagnosticsFailed")));return await i.json()}async function Rz(e,t){const n=await gt(`/web/mpa/agent-operations/${encodeURIComponent(e)}/retry`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operationKind:t.operationKind,runtimeId:t.runtimeId,region:t.region,mpaInstanceId:t.mpaInstanceId,sourceProfileId:t.sourceProfileId,targetKey:t.targetKey,runtimeRevision:t.runtimeRevision,profile:BA(t.draft)})});if(!n.ok)throw new Error(await Ft(n,Q("client.mpaOperationFailed")));return await n.json()}async function Iz(e){const t=new URLSearchParams({runtimeId:e.runtimeId,region:e.region}),n=await gt(`/web/mpa/sessions/${encodeURIComponent(e.sessionId)}/execution-config?${t.toString()}`,{cache:"no-store",signal:e.signal});if(!n.ok)throw await jz(n);return await n.json()}async function U8(e){const t=await gt(`/web/mpa/sessions/${encodeURIComponent(e.sessionId)}/execution-config`,{method:"PATCH",headers:{"Content-Type":"application/json","If-Match":e.etag},body:JSON.stringify({runtimeId:e.runtimeId,region:e.region,changes:e.changes})});if(!t.ok)throw await jz(t);return await t.json()}async function jTe(e){const t=await gt(`/web/mpa/sessions/${encodeURIComponent(e.sessionId)}/profile-upgrade`,{method:"POST",headers:{"Content-Type":"application/json","If-Match":e.etag,"Idempotency-Key":e.idempotencyKey},body:JSON.stringify({runtimeId:e.runtimeId,region:e.region,targetProfileRevision:e.targetProfileRevision})});if(!t.ok)throw await jz(t);return await t.json()}async function ND(e,t){const n=new URLSearchParams({name:e,region:t}),i=await gt(`/web/runtime-name-availability?${n.toString()}`,{cache:"no-store"});if(!i.ok)throw new Error(await Ft(i,Q("client.checkRuntimeNameFailed")));const r=await i.json();if(typeof r.available!="boolean")throw new Error(Q("client.invalidRuntimeNameCheck"));return{available:r.available}}async function NTe(e,t){const n=new URLSearchParams({kind:e.kind,region:e.region});e.registry&&n.set("registry",e.registry),e.namespace&&n.set("namespace",e.namespace),e.workspaceId&&n.set("workspaceId",e.workspaceId),e.search&&n.set("search",e.search),e.pageNumber&&n.set("pageNumber",String(e.pageNumber)),e.pageSize&&n.set("pageSize",String(e.pageSize));const i=await gt(`/web/deployment-resources?${n.toString()}`,{signal:t});if(!i.ok)throw new Error(await Ft(i,Q("client.loadCloudResourcesFailed")));const r=await i.json();if(typeof r.serviceRegion!="string"||!Array.isArray(r.items)||typeof r.pageNumber!="number"||typeof r.pageSize!="number"||typeof r.totalCount!="number"||typeof r.hasMore!="boolean")throw new Error(Q("client.invalidCloudResources"));const s=r.items.map(o=>{if(!o||typeof o!="object"||typeof o.id!="string"||typeof o.name!="string"||typeof o.region!="string"||typeof o.status!="string")throw new Error(Q("client.invalidCloudResources"));return o});return{serviceRegion:r.serviceRegion,items:s,pageNumber:r.pageNumber,pageSize:r.pageSize,totalCount:r.totalCount,hasMore:r.hasMore}}function RTe(e,t){const n=e;if(!n||typeof n!="object"||!Array.isArray(n.mounts))throw new Error(Q("client.invalidEnvironmentMount"));if(n.mounts.length!==t.length)throw new Error(Q("client.environmentMountMismatch"));return n.mounts.map((i,r)=>{const s=t[r];if(!i||typeof i!="object"||typeof i.environment_id!="string"||typeof i.environment_version_id!="string"||typeof i.mount_instance_id!="string"||typeof i.sandbox_session_id!="string"||!i.environment_id||!i.environment_version_id||!i.mount_instance_id||!i.sandbox_session_id)throw new Error(Q("client.invalidEnvironmentMount"));if(i.environment_id!==s.environment_id||i.environment_version_id!==s.environment_version_id||s.mount_instance_id!==void 0&&i.mount_instance_id!==s.mount_instance_id)throw new Error(Q("client.environmentMountMismatch"));return i})}async function ITe({runtimeId:e,appName:t,userId:n,sessionId:i,environmentMounts:r}){const{app:s}=Na(t);let o;try{o=await gt("/web/v3/session-environment-mounts/prepare",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtime_id:e,app_name:s,user_id:n,session_id:i,environment_mounts:[...r]})})}catch(l){throw l instanceof TypeError?new Error(Q("client.environmentMountNetworkFailed")):l}if(!o.ok)throw new Error(await Ft(o,Q("client.environmentMountFailed")));return RTe(await o.json(),r)}function Pz(e){const t=new Set,n=[];for(const i of e.split(/[,,\n\r]+/)){const r=i.trim();!r||t.has(r)||(t.add(r),n.push(r))}return n}async function PTe(e,t=typeof navigator>"u"?void 0:navigator.clipboard){if(!(t!=null&&t.writeText))throw new Error(Q("client.clipboardUnsupported"));try{await t.writeText(e)}catch{throw new Error(Q("client.clipboardWriteFailed"))}}const YZ={codex:0,codex_snapshot:1,deepseek_harness:2,deepseek_harness_snapshot:3,openclaw:4,openclaw_snapshot:5,hermes:6,hermes_snapshot:7,dev:8};async function DTe(e){var r;const t=await gt("/web/system-info",{signal:e});if(!t.ok)throw new Error(await Ft(t,Q("client.loadSystemInfoFailed")));const n=await t.json();if(typeof((r=n.storage)==null?void 0:r.tosAddress)!="string"||!Array.isArray(n.sandboxTools))throw new Error(Q("client.invalidSystemInfo"));const i=n.sandboxTools.map(s=>{if(!s||typeof s!="object"||typeof s.kind!="string"||typeof s.label!="string"||typeof s.toolId!="string"||typeof s.snapshot!="boolean"||typeof s.needsModelEnvUpdate!="boolean"||typeof s.canUpdateModelEnv!="boolean"||typeof s.modelEnvError!="string"||typeof s.modelEnvErrorCode!="string")throw new Error(Q("client.invalidSystemInfo"));return s}).sort((s,o)=>(YZ[s.kind]??Number.MAX_SAFE_INTEGER)-(YZ[o.kind]??Number.MAX_SAFE_INTEGER));return{storage:{tosAddress:n.storage.tosAddress},sandboxTools:i}}const MTe=new Set(["preparing","queued","building","scanning","available","failed"]);function Dz(e){if(e===null)return null;if(!e||typeof e!="object")throw new Error(Q("client.invalidEnvironmentBuild"));const t=e;if(typeof t.versionId!="string"||!MTe.has(t.status)||typeof t.image!="string"||typeof t.error!="string"||typeof t.createdAt!="string"||typeof t.updatedAt!="string"||t.resources!==null&&typeof t.resources!="object")throw new Error(Q("client.invalidEnvironmentBuild"));const n=Array.isArray(t.steps)?t.steps.map(i=>{if(!i||typeof i!="object"||typeof i.key!="string"||typeof i.label!="string"||!["pending","running","succeeded","failed"].includes(i.status)||i.startedAt!==null&&typeof i.startedAt!="string"||i.finishedAt!==null&&typeof i.finishedAt!="string")throw new Error(Q("client.invalidEnvironmentBuildStep"));return i}):[];return{...t,toolId:typeof t.toolId=="string"?t.toolId:"",toolStatus:["creating","ready","failed"].includes(t.toolStatus)?t.toolStatus:"",runId:typeof t.runId=="string"?t.runId:"",currentStep:typeof t.currentStep=="string"?t.currentStep:"",sourceCommitSha:typeof t.sourceCommitSha=="string"?t.sourceCommitSha:"",steps:n,progressError:typeof t.progressError=="string"?t.progressError:"",logTail:typeof t.logTail=="string"?t.logTail:"",logTruncated:t.logTruncated===!0,logUpdatedAt:typeof t.logUpdatedAt=="string"?t.logUpdatedAt:null,logError:typeof t.logError=="string"?t.logError:""}}function LTe(e){if(!e||typeof e!="object")throw new Error(Q("client.invalidEnvironmentManifest"));const t=e;if(!["agentkit.studio/v3","agentkit.studio/v1alpha1"].includes(t.apiVersion)||t.kind!=="Environment"||!t.metadata||typeof t.metadata.id!="string"||typeof t.metadata.name!="string"||typeof t.metadata.version!="string"||typeof t.metadata.description!="string"||!t.spec||typeof t.spec.image!="string"||!["ubuntu","aio-sandbox","codex-sandbox"].includes(t.spec.baseEnvironment)||typeof t.spec.baseImage!="string"||!["ubuntu-22.04","ubuntu-24.04"].includes(t.spec.operatingSystem)||!["python-3.10","python-3.12"].includes(t.spec.language)||t.spec.executionRuntime!=="veadk"||!Array.isArray(t.spec.packages)||!t.spec.packages.every(n=>typeof n=="string")||!Array.isArray(t.spec.capabilities)||!t.spec.capabilities.every(n=>typeof n=="string")||!Array.isArray(t.spec.skills)||!t.status||!MTe.has(t.status.phase)||typeof t.status.createdAt!="string"||typeof t.status.updatedAt!="string")throw new Error(Q("client.invalidEnvironmentManifest"));return t}function $Te(e){if(e==null)return;if(!e||typeof e!="object")throw new Error(Q("client.invalidImageRepository"));const t=e;if(typeof t.region!="string"||typeof t.registry!="string"||typeof t.namespace!="string"||typeof t.repository!="string")throw new Error(Q("client.invalidImageRepository"));return t}function Ctt(e){if(e==null)return;if(!e||typeof e!="object")throw new Error(Q("client.invalidCodeRepository"));const t=e;if(typeof t.repositoryUrl!="string"||t.ref!==void 0&&typeof t.ref!="string"||typeof t.dockerfilePath!="string")throw new Error(Q("client.invalidCodeRepository"));return t}function Att(e){const t=$Te(e);if(!t)return;const n=e;if(typeof n.reference!="string")throw new Error(Q("client.invalidImageSource"));return{...t,reference:n.reference}}function Mz(e){if(!e||typeof e!="object")throw new Error(Q("client.invalidEnvironment"));const t=e;if(typeof t.id!="string"||typeof t.name!="string"||typeof t.description!="string"||t.baseEnvironment!==void 0&&t.baseEnvironment!=="ubuntu"&&t.baseEnvironment!=="aio-sandbox"&&t.baseEnvironment!=="codex-sandbox"||t.operatingSystem!=="ubuntu-22.04"&&t.operatingSystem!=="ubuntu-24.04"||t.language!=="python-3.10"&&t.language!=="python-3.12"||!Array.isArray(t.optionIds)||!t.optionIds.every(n=>typeof n=="string")||t.selectedSkills!==void 0&&!Array.isArray(t.selectedSkills)||typeof t.dockerfile!="string"||typeof t.createdAt!="string"||typeof t.updatedAt!="string")throw new Error(Q("client.invalidEnvironment"));return{...t,baseEnvironment:t.baseEnvironment==="aio-sandbox"?"aio-sandbox":t.baseEnvironment==="codex-sandbox"?"codex-sandbox":"ubuntu",selectedSkills:t.selectedSkills??[],gitSource:Ctt(t.gitSource),containerRepository:$Te(t.containerRepository),imageSource:Att(t.imageSource),latestVersion:Dz(t.latestVersion)}}function FTe(e){if(!e||typeof e!="object")throw new Error(Q("client.invalidWorkspace"));const t=e;if(typeof t.id!="string"||typeof t.name!="string"||typeof t.description!="string"||!Array.isArray(t.environmentIds)||!t.environmentIds.every(n=>typeof n=="string")||typeof t.createdAt!="string"||typeof t.updatedAt!="string")throw new Error(Q("client.invalidWorkspace"));return t}async function Lz(e){const t=await gt("/web/workspaces",{signal:e});if(!t.ok)throw new Error(await Ft(t,Q("client.loadWorkspacesFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(Q("client.invalidWorkspaceList"));return n.items.map(FTe)}async function BTe(e,t,n,i){const r=await gt(e,{method:t,headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:i});if(!r.ok)throw new Error(await Ft(r,Q("client.saveWorkspaceFailed")));return FTe(await r.json())}function UTe(e,t){return BTe("/web/workspaces","POST",e,t)}function QTe(e,t,n){return BTe(`/web/workspaces/${encodeURIComponent(e)}`,"PATCH",t,n)}async function zTe(e,t){const n=await gt(`/web/workspaces/${encodeURIComponent(e)}`,{method:"DELETE",signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.deleteWorkspaceFailed")))}async function UA(e){const t=await gt("/web/v3/environments",{signal:e});if(!t.ok)throw new Error(await Ft(t,Q("client.loadEnvironmentsFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(Q("client.invalidEnvironmentList"));return n.items.map(Mz)}async function VTe(e,t){const n=await gt("/web/v3/environment-repositories/inspect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.probeRepositoryFailed")));const i=await n.json();if(typeof i.repositoryUrl!="string"||typeof i.ref!="string"||typeof i.commitSha!="string"||!Array.isArray(i.dockerfiles)||!i.dockerfiles.every(r=>typeof r=="string"))throw new Error(Q("client.invalidRepositoryProbe"));return i}async function HTe(e,t){const n=await gt(`/web/v3/environments/${encodeURIComponent(e)}/share-code`,{method:"POST",signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.exportEnvironmentCodeFailed")));const i=await n.json();if(typeof i.shareCode!="string"||typeof i.name!="string")throw new Error(Q("client.invalidEnvironmentCode"));return i}async function qTe(e,t){const n=await gt("/web/v3/environment-share-codes/inspect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({shareCodes:e}),signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.inspectEnvironmentCodeFailed")));const i=await n.json();if(!Array.isArray(i.items))throw new Error(Q("client.invalidEnvironmentCodeInspection"));return i.items.map(r=>{if(!r||typeof r!="object")throw new Error(Q("client.invalidEnvironmentCodeInspection"));const s=r,o=s.status==="valid"||s.valid===!0?"valid":s.status==="invalid"||s.valid===!1?"invalid":null;if(!Number.isInteger(s.index)||o===null||s.name!==void 0&&typeof s.name!="string"||s.error!==void 0&&typeof s.error!="string")throw new Error(Q("client.invalidEnvironmentCodeInspection"));return{index:s.index,status:o,name:s.name??"",error:s.error??""}})}async function WTe(e,t){const n=await gt("/web/v3/environment-share-codes/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({shareCodes:e}),signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.importEnvironmentCodeFailed")));const i=await n.json();if(!Array.isArray(i.items))throw new Error(Q("client.invalidEnvironmentCodeImport"));return i.items.map(r=>{if(!r||typeof r!="object")throw new Error(Q("client.invalidEnvironmentCodeImport"));const s=r;if(!Number.isInteger(s.index)||!(s.status==="created"||s.status==="duplicate"||s.status==="failed")||s.name!==void 0&&typeof s.name!="string"||s.error!==void 0&&typeof s.error!="string")throw new Error(Q("client.invalidEnvironmentCodeImport"));return{index:s.index,status:s.status,name:s.name??"",environment:s.environment===void 0||s.environment===null?void 0:Mz(s.environment),error:s.error??""}})}async function KTe(e,t,n,i){let r;try{r=await gt(e,{method:t,headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:i})}catch(s){throw s instanceof DOMException&&s.name==="AbortError"?s:s instanceof TypeError?new Error(Q("client.studioUnavailable")):s}if(!r.ok)throw new Error(await Ft(r,Q("client.saveEnvironmentFailed")));return Mz(await r.json())}function GTe(e,t){return KTe("/web/v3/environments","POST",e,t)}function XTe(e,t,n){return KTe(`/web/v3/environments/${encodeURIComponent(e)}`,"PATCH",t,n)}async function YTe(e,t){const n=await gt(`/web/v3/environments/${encodeURIComponent(e)}`,{method:"DELETE",signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.deleteEnvironmentFailed")))}async function Q8(e,t){const n=await gt(`/web/v3/environments/${encodeURIComponent(e)}/build`,{method:"POST",signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.startEnvironmentBuildFailed")));const i=Dz(await n.json());if(!i)throw new Error(Q("client.invalidEnvironmentBuild"));return i}async function ZTe(e,t,n={}){const i=n.includeLogs?"?includeLogs=true":"",r=await gt(`/web/v3/environments/${encodeURIComponent(e)}/builds/${encodeURIComponent(t)}${i}`,{signal:n.signal});if(!r.ok)throw new Error(await Ft(r,Q("client.loadEnvironmentBuildFailed")));const s=Dz(await r.json());if(!s)throw new Error(Q("client.invalidEnvironmentBuild"));return s}async function JTe(e,t,n){const i=await gt(`/web/v3/environments/${encodeURIComponent(e)}/builds/${encodeURIComponent(t)}/manifest`,{signal:n});if(!i.ok)throw new Error(await Ft(i,Q("client.loadEnvironmentManifestFailed")));return LTe(await i.json())}function ZZ(e){if(!e||typeof e!="object")throw new Error(Q("client.invalidEnvironmentResource"));const t=e;if(t.source!=="provided"&&t.source!=="managed"||typeof t.consoleUrl!="string")throw new Error(Q("client.invalidEnvironmentResource"));return t}async function e2e(e){const t=await gt("/web/v3/environment-resources",{signal:e});if(!t.ok)throw new Error(await Ft(t,Q("client.loadEnvironmentResourcesFailed")));const n=await t.json();if(n.provider!=="volcengine"&&n.provider!=="byteplus"||typeof n.region!="string")throw new Error(Q("client.invalidEnvironmentResource"));return{provider:n.provider,region:n.region,codePipeline:ZZ(n.codePipeline),containerRegistry:ZZ(n.containerRegistry)}}async function Ttt(e,t){const n=await gt(`/web/system-info/sandbox-tools/${encodeURIComponent(e)}/model-env`,{method:"POST",signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.updateCodexSandboxFailed")));const i=await n.json();if(i.kind!=="codex"&&i.kind!=="codex_snapshot"||typeof i.toolId!="string"||typeof i.updated!="boolean")throw new Error(Q("client.invalidCodexSandboxUpdate"));return i}async function RD(e){const t=await gt("/web/identity/user-pools",{signal:e});if(!t.ok)throw new Error(await Ft(t,Q("client.loadUserPoolsFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(Q("client.invalidUserPoolList"));return n.items.map(i=>{if(!i||typeof i!="object"||typeof i.uid!="string"||typeof i.name!="string"||typeof i.domain!="string"||typeof i.region!="string"||typeof i.isCurrent!="boolean")throw new Error(Q("client.invalidUserPoolList"));return i})}class JZ extends Error{constructor(t,n){super(n),this.status=t,this.name="DeploymentRecoveryHttpError"}}const JS=new Map;function _tt(e){if(typeof e=="string")return e?{message:e}:null;if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e,n=typeof t.message=="string"?t.message:typeof t.error=="string"?t.error:"";return n?{message:n,phase:typeof t.phase=="string"?t.phase:void 0,runtimeId:typeof t.runtimeId=="string"?t.runtimeId:void 0,logPath:typeof t.logPath=="string"?t.logPath:void 0}:null}class eE extends Error{constructor(t){super(t.message),this.detail=t,this.name="GithubCicdPipelineError"}}async function dm(e){const t=await e.text().catch(()=>"");if(t)try{const n=JSON.parse(t),i=_tt(n.detail??n.error);if(i)return new eE(i)}catch{return new eE({message:t})}return new eE({message:Q("client.syncGithubFailed",{status:e.status})})}async function t2e(e){const t=await gt("/web/github-delivery/source-sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:e.project,githubUrl:e.githubUrl,githubToken:e.githubToken,baseBranch:e.baseBranch,region:e.region,cloudProvider:e.cloudProvider})},{},0);if(!t.ok)throw await dm(t);return t.json()}async function n2e(e){const t=await gt("/web/github-delivery/cicd-pipeline",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({githubUrl:e.githubUrl,githubToken:e.githubToken,baseBranch:e.baseBranch,runtimeName:e.runtimeName,runtimeId:e.runtimeId,region:e.region,agentCategory:e.agentCategory,mpaCompatibilityManifest:e.mpaCompatibilityManifest,cloudProvider:e.cloudProvider,projectPath:e.projectPath??".",volcengineAccessKey:e.volcengineAccessKey,volcengineSecretKey:e.volcengineSecretKey,volcengineSessionToken:e.volcengineSessionToken??""})},{},0);if(!t.ok)throw await dm(t);return t.json()}async function i2e(e){const t=await gt("/web/github-delivery/init-main",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:e.project,githubUrl:e.githubUrl,githubToken:e.githubToken,baseBranch:e.baseBranch,runtimeName:e.runtimeName,runtimeId:e.runtimeId,region:e.region,agentCategory:e.agentCategory,mpaCompatibilityManifest:e.mpaCompatibilityManifest,cloudProvider:e.cloudProvider,projectPath:e.projectPath??".",volcengineAccessKey:e.volcengineAccessKey,volcengineSecretKey:e.volcengineSecretKey,volcengineSessionToken:e.volcengineSessionToken??""})},{},0);if(!t.ok)throw await dm(t);return t.json()}async function jtt(e){const t=await gt("/web/github-delivery/source-sync/cicd",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pipelineId:e.pipelineId,runtimeName:e.runtimeName,runtimeId:e.runtimeId,region:e.region,agentCategory:e.agentCategory,mpaCompatibilityManifest:e.mpaCompatibilityManifest,cloudProvider:e.cloudProvider,projectPath:e.projectPath??".",volcengineAccessKey:e.volcengineAccessKey,volcengineSecretKey:e.volcengineSecretKey,volcengineSessionToken:e.volcengineSessionToken??""})},{},0);if(!t.ok)throw await dm(t);return t.json()}async function r2e(e){const t=await gt(`/web/github-cicd/runtime-binding?runtimeId=${encodeURIComponent(e)}`);if(!t.ok)throw await dm(t);const n=await t.json();return n.pipelineId?n:null}async function fN(e){const t=await gt(`/web/github-delivery/versions?runtimeId=${encodeURIComponent(e)}`);if(!t.ok)throw await dm(t);return t.json()}async function s2e(e){const t=await gt("/web/github-delivery/rollback-pr",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await dm(t);return t.json()}async function $z(e){const t=await gt("/web/github-cicd/runtime-binding",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await dm(t);return t.json()}async function a2e(e){const t=await gt("/web/github-cicd/runtime-sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e.runtimeId,project:e.project,agentCategory:e.agentCategory,mpaCompatibilityManifest:e.mpaCompatibilityManifest})},{},0);if(!t.ok)throw await dm(t);return t.json()}async function Q0(e,t,n,i){var h,m,g,b,v,y;const r=i==null?void 0:i.taskId,s=r?new AbortController:void 0;r&&s&&JS.set(r,s);const o=()=>{r&&JS.get(r)===s&&JS.delete(r)},l=async w=>{if(HAe(w))throw w;if(!r||!(i!=null&&i.runtimeId)||typeof i.baseRuntimeVersion!="number")throw new lN({taskId:r,cause:w});const x=await Vet({signal:s==null?void 0:s.signal,shouldRetry:O=>!(O instanceof JZ)||O.status===404||O.status===408||O.status===429||O.status>=500,load:async O=>{const k=await gt("/web/deploy-agentkit/status",{method:"POST",headers:{"Content-Type":"application/json"},signal:O,body:JSON.stringify({taskId:r,runtimeId:i.runtimeId,runtimeName:i.runtimeName,appName:i.appName??e,region:n.region,projectName:n.projectName,baseRuntimeVersion:i.baseRuntimeVersion})},{},3e4);if(!k.ok)throw new JZ(k.status,await Ft(k,Q("client.deploymentFailed")));return k.json()}});if(!x)throw new lN({taskId:r,cause:w});return x};let c=null,u=null;try{const w=!!(i!=null&&i.migrationTaskId);(h=i==null?void 0:i.onStage)==null||h.call(i,{level:"info",phase:"upload",message:Q(w?"client.validatingMigrationArtifact":"client.uploadingCodePackage"),pct:0}),c=await gt("/web/deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},signal:s==null?void 0:s.signal,body:JSON.stringify({name:e,files:w?[]:t,config:n,taskId:r,migrationTaskId:i==null?void 0:i.migrationTaskId,runtimeId:i==null?void 0:i.runtimeId,runtimeName:i==null?void 0:i.runtimeName,appName:i==null?void 0:i.appName,agentCategory:i==null?void 0:i.agentCategory,mpaCompatibilityManifest:i==null?void 0:i.mpaCompatibilityManifest,editMode:i==null?void 0:i.editMode,draft:i==null?void 0:i.draft,updateEtag:i==null?void 0:i.updateEtag,baseRuntimeVersion:i==null?void 0:i.baseRuntimeVersion,removeRuntimeEnvKeys:i==null?void 0:i.removeRuntimeEnvKeys,mcpSecretValues:i==null?void 0:i.mcpSecretValues,mcpCredentialReuses:i==null?void 0:i.mcpCredentialReuses,sessionStorage:i==null?void 0:i.sessionStorage,minInstance:i==null?void 0:i.minInstance,maxInstance:i==null?void 0:i.maxInstance,createEvaluationSets:i==null?void 0:i.createEvaluationSets,description:Qet((i==null?void 0:i.description)??""),authentication:i==null?void 0:i.authentication,im:i==null?void 0:i.im,envs:i==null?void 0:i.envs,resources:i==null?void 0:i.resources,source:(i==null?void 0:i.source)??(i!=null&&i.migrationTaskId?{kind:"migration",migrationId:i.migrationTaskId}:{kind:"inlineFiles"}),harnessSidecar:i==null?void 0:i.harnessSidecar,environment:i==null?void 0:i.environment})},{},0),(m=i==null?void 0:i.onStage)==null||m.call(i,{level:"success",phase:"upload",message:Q(w?"client.migrationArtifactValidated":"client.codePackageUploaded"),pct:100})}catch(w){try{u=await l(w)}finally{o()}}if(c&&!c.ok){const w=await Ft(c,Q("client.deploymentFailed"));throw o(),new Error(w)}if(c)try{for await(const w of LA(c)){const x=w;if(x&&x.done){u=x;break}x&&x.message&&((g=i==null?void 0:i.onStage)==null||g.call(i,x))}}catch(w){try{u=await l(w)}finally{o()}}if(u)o();else try{u=await l()}finally{o()}if(!u.success){const w=new Error(u.error||Q("client.deploymentFailed"));throw VAe(w)?new lN({taskId:r,cause:w}):w}if(!u.agentName)throw new Error(Q("client.deploymentMissingAgentName"));if(!u.runtimeId&&!u.url)throw new Error(Q("client.deploymentMissingConnection"));const d=(b=u.runtimeName)!=null&&b.trim()?u.agentName:e,f=((v=u.runtimeName)==null?void 0:v.trim())||u.agentName;return{apikey:u.apikey??"",url:u.url??"",agentName:d,runtimeName:f,runtimeId:u.runtimeId,mpaInstanceId:((y=u.mpaInstanceId)==null?void 0:y.trim())||void 0,consoleUrl:u.consoleUrl,region:u.region,version:u.version,warnings:u.warnings,feishuChannel:u.feishuChannel}}async function o2e(e){var n;const t=await gt("/web/cancel-deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e})});if(!t.ok){const i=await t.text().catch(()=>"");throw new Error(i||Q("client.cancelDeploymentFailed",{status:t.status}))}(n=JS.get(e))==null||n.abort(),JS.delete(e)}async function Ntt(e=gz){const t=await gt(`/web/my-runtimes?region=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(Q("client.loadFailed",{status:t.status}));return(await t.json()).runtimes??[]}const oC={title:"AgentKit Studio",logoUrl:""},z8={enabled:!1},E3={studio:!1,version:"",provider:"volcengine",branding:oC,features:{newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,agentUsage:!1,addAgentkit:!0,generatedAgentTestRun:!0},defaultView:"chat",agentsSource:"local",telemetry:z8};function Rtt(e){if(!e||typeof e!="object")return z8;const t=e;if(t.enabled!==!0||!t.studio||typeof t.studio!="object")return z8;const n=t.studio;return{enabled:!0,studio:{deployId:typeof n.deployId=="string"?n.deployId:"",userPoolId:typeof n.userPoolId=="string"?n.userPoolId:"",applicationId:typeof n.applicationId=="string"?n.applicationId:"",functionId:typeof n.functionId=="string"?n.functionId:"",region:typeof n.region=="string"?n.region:"",project:typeof n.project=="string"?n.project:"",version:typeof n.version=="string"?n.version:"",accountId:typeof n.accountId=="string"?n.accountId:"",accountIdResolutionError:typeof n.accountIdResolutionError=="string"?n.accountIdResolutionError:""}}}async function l2e(){var e,t;try{const n=await gt("/web/ui-config");if(!n.ok)return E3;const i=await n.json(),r=typeof((e=i.branding)==null?void 0:e.logoUrl)=="string"?i.branding.logoUrl:oC.logoUrl,s=i.provider==="byteplus"?"byteplus":"volcengine";return tTe(s),{studio:i.studio??!1,version:typeof i.version=="string"?i.version:"",provider:s,branding:{title:typeof((t=i.branding)==null?void 0:t.title)=="string"?i.branding.title:oC.title,logoUrl:r?Ta(r):""},features:{...E3.features,...i.features??{}},defaultView:i.defaultView??"chat",agentsSource:i.agentsSource==="cloud"?"cloud":"local",telemetry:Rtt(i.telemetry)}}catch{return E3}}const c2e={role:"user",telemetry:{userId:"",accountId:""},capabilities:{createAgents:!1,createPersonalAgents:!1,manageAgents:!1,runtimeScope:"mine",manageUsers:!1}};async function u2e(){var n,i,r,s,o,l;const e=await gt("/web/access");if(!e.ok)throw new Error(Q("client.loadPermissionsFailed",{status:e.status}));const t=await e.json();if(!["super_admin","admin","developer","user"].includes(t.role)||typeof((n=t.telemetry)==null?void 0:n.userId)!="string"||t.telemetry.accountId!==void 0&&typeof t.telemetry.accountId!="string"||typeof((i=t.capabilities)==null?void 0:i.createAgents)!="boolean"||typeof((r=t.capabilities)==null?void 0:r.createPersonalAgents)!="boolean"||typeof((s=t.capabilities)==null?void 0:s.manageAgents)!="boolean"||((o=t.capabilities)==null?void 0:o.manageUsers)!==void 0&&typeof t.capabilities.manageUsers!="boolean"||!["all","mine"].includes((l=t.capabilities)==null?void 0:l.runtimeScope))throw new Error(Q("client.invalidPermissionResponse"));return t}async function d2e(e,t){const n=new URLSearchParams;e&&n.set("targetVersion",e),t&&n.set("startedAt",String(t));const i=n.size?`?${n.toString()}`:"",r=await gt(`/web/studio-update${i}`);if(!r.ok)throw new Error(Q("client.checkStudioUpdateFailed",{status:r.status}));return await r.json()}async function f2e(){const e=await gt("/web/studio-update/permissions");if(!e.ok){let t="";try{const n=await e.json();t=typeof n.detail=="string"?n.detail:""}catch{t=""}throw new Error(t||Q("client.studioUpdatePreflightFailed",{status:e.status}))}return await e.json()}async function h2e(e){const t=await gt("/web/studio-update",{method:"POST",headers:{"Content-Type":"application/json","X-VeADK-Studio-Update":"1"},body:JSON.stringify({version:e})},{},hr);if(!t.ok){let n="";try{const i=await t.json();n=typeof i.detail=="string"?i.detail:""}catch{n=""}throw new Error(n||Q("client.submitStudioUpdateFailed",{status:t.status}))}return await t.json()}async function p2e({runtimeId:e,region:t,appName:n,page:i=1,pageSize:r=20,signal:s}){const o=new URLSearchParams({runtimeId:e,region:t,appName:n,page:String(i),pageSize:String(r)}),l=await gt(`/web/agent-usage?${o.toString()}`,{signal:s});if(!l.ok)throw new Error(await Ft(l,Q("client.loadAgentUsageFailed")));const c=l.headers.get("content-type")||Q("client.notProvided"),u=c.toLowerCase();if(!u.includes("application/json")&&!u.includes("+json"))throw new Error(Q("client.agentUsageNonJson",{status:l.status,contentType:c})+Q("client.checkStudioGateway"));try{return await l.json()}catch{throw new Error(Q("client.agentUsageInvalidJson",{status:l.status,contentType:c})+Q("client.retryCheckGateway"))}}function fm(e=""){return`/web/cronjobs${e?`/${encodeURIComponent(e)}`:""}`}async function V8(e){const t=await gt(fm(),{signal:e});if(!t.ok)throw new Error(await Ft(t,Q("client.loadCronJobsFailed")));const n=await t.json();return Array.isArray(n)?n:n.items??[]}async function Itt(e,t){const n=await gt(fm(e),{signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.loadCronJobFailed")));return await n.json()}async function m2e(e){const t=await gt(fm(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await Ft(t,Q("client.createCronJobFailed")));return await t.json()}async function g2e(e,t){const n=await gt(`${fm(e)}/update`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw new Error(await Ft(n,Q("client.updateCronJobFailed")));return await n.json()}async function b2e(e,t){const n=t?"enable":"disable",i=await gt(`${fm(e)}/${n}`,{method:"POST"});if(!i.ok)throw new Error(await Ft(i,Q(t?"client.enableCronJobFailed":"client.pauseCronJobFailed")));return await i.json()}async function y2e(e){const t=await gt(`${fm(e)}/run`,{method:"POST"});if(!t.ok)throw new Error(await Ft(t,Q("client.runCronJobFailed")));return await t.json()}async function H8(e,t){const n=await gt(`${fm(e)}/runs`,{signal:t});if(!n.ok)throw new Error(await Ft(n,Q("client.loadCronHistoryFailed")));const i=await n.json();return Array.isArray(i)?i:i.items??[]}async function v2e(e,t){const n=await gt(`${fm(e)}/runs/${encodeURIComponent(t)}/cancel`,{method:"POST"});if(!n.ok)throw new Error(await Ft(n,Q("client.stopCronRunFailed")));return await n.json()}async function x2e(e){const t=await gt(fm(e),{method:"DELETE"});if(!t.ok)throw new Error(await Ft(t,Q("client.deleteCronJobFailed")))}class ID extends Error{constructor(t,n){super(t),this.status=n,this.name="RuntimeListError"}}async function z0(e={}){const t=new URLSearchParams({scope:e.scope??"all",page_size:String(e.pageSize??30),region:e.region??"all"});e.agentCategory&&t.set("agentCategory",e.agentCategory),e.nextToken&&t.set("next_token",e.nextToken);const n=await gt(`/web/runtimes?${t.toString()}`,{signal:e.signal});if(!n.ok){const r=await Ft(n,Q("client.loadRuntimeFailed"));throw new ID(r,n.status)}const i=await n.json();return{runtimes:i.runtimes??[],nextToken:i.nextToken??""}}async function Kw(e,t,n={}){if(n.preferCached){const i=Oz(e,t,n.currentVersion),r=nw.get(i);if(r&&r.expiresAt>Date.now())return[...r.apps];r&&nw.delete(i)}try{const i={runtimeId:e,region:t,runtimeVersion:n.currentVersion};return n.retryProbe&&(i.retryProbe=!0),await FA("","",i,n.signal,n.timeoutMs)}catch(i){if(i instanceof Q1||i instanceof Oa||i instanceof Error)throw i;return null}}async function w2e(e,t){const n=new URLSearchParams({region:t}),i=await gt(`/web/runtime-tool-channel/${encodeURIComponent(e)}/capabilities?${n.toString()}`);if(!i.ok)throw new Oa(await Ft(i,Q("client.loadLocalToolsFailed")),!1,!0);return await i.json()}async function O2e(e,t){const n=new URLSearchParams({region:t}),i=await gt(`/web/runtime-route-channel/${encodeURIComponent(e)}/connect?${n.toString()}`,{method:"POST"});if(!i.ok)throw new Oa(await Ft(i,Q("client.connectDynamicRouteFailed")),!1,!0);return await i.json()}async function k2e(e,t,n={}){const i={runtimeId:e,region:t};n.retryProbe&&(i.retryProbe=!0);const r=await gt("/.well-known/agent-card.json",{},i),s=await nTe(r);if(s==="runtime_access_denied")throw new Q1;if(s==="runtime_private_endpoint_unreachable")throw new Oa(ZAe());if(["runtime_proxy_connect_error","runtime_proxy_timeout"].includes(s))throw new Oa(JAe());if(r.status===404)return null;if(r.status===401||r.status===403)throw new Oa(Q("client.a2aProbeDenied"));if(!r.ok)throw new Error(await Ft(r,Q("client.loadA2aCardFailed")));const o=await r.json().catch(()=>null),l=typeof(o==null?void 0:o.url)=="string"?o.url.trim():"";return l?{name:typeof(o==null?void 0:o.name)=="string"?o.name:"",description:typeof(o==null?void 0:o.description)=="string"?o.description:"",endpoint:l}:null}async function S2e(e,t){const n=new URLSearchParams({runtimeId:e,region:t}),i=await gt(`/web/runtime-api-key/reveal?${n.toString()}`,{method:"POST",cache:"no-store"});if(!i.ok)throw new Error(await Ft(i,Q("client.loadRuntimeApiKeyFailed")));const r=await i.json();if(typeof r.apiKey!="string"||!r.apiKey)throw new Error(Q("client.runtimeApiKeyMissing"));return r.apiKey}async function E2e(e,t,n={}){const i=await gt("/web/delete-runtime",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e,region:t,agentCategory:n.agentCategory,mpaInstanceId:n.mpaInstanceId})});if(!i.ok){const r=await i.text().catch(()=>"");throw new Error(r||Q("client.deleteFailed",{status:i.status}))}}async function C2e({runtimeId:e,region:t,appName:n,etag:i,signal:r}){const s=await gt("/web/runtime-mcp-credentials",{method:"POST",cache:"no-store",signal:r,headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e,region:t,appName:n,etag:i})});if(!s.ok)throw new Error(await Ft(s,Q("client.loadMcpCredentialsFailed")));const o=await s.json().catch(()=>null);if(!Array.isArray(o==null?void 0:o.credentials))throw new Error(Q("client.invalidMcpCredentials"));return o.credentials.map(l=>{if(!l||typeof l!="object")throw new Error(Q("client.invalidMcpCredentials"));const c=l,u={agentName:c.agentName,name:c.name,url:c.url,authTokenEnv:c.authTokenEnv,value:c.value};if(Object.values(u).some(d=>typeof d!="string"))throw new Error(Q("client.invalidMcpCredentials"));return u})}function hN({runtimeId:e,region:t,appName:n,currentVersion:i}){return U0(sC,t,e,i??"",(n==null?void 0:n.trim())??"")}async function Ptt({runtimeId:e,region:t,appName:n,currentVersion:i,force:r=!1}){const s=new URLSearchParams({runtimeId:e,region:t});n&&s.set("appName",n),i!=null&&s.set("currentVersion",String(i)),r&&s.set("refresh","true");const o=await gt(`/web/runtime-update-capability?${s.toString()}`);if(!o.ok)throw new Error(await Dtt(o));return await o.json()}function PD({runtimeId:e,region:t,appName:n,currentVersion:i,signal:r,force:s=!1}){var u,d;const o={runtimeId:e,region:t,appName:n,currentVersion:i},l=hN(o);if(s&&ss.delete(l),!s){const f=Eb(ss,l,z1);if(f)return Z2(Promise.resolve(f),r);const h=(u=ss.get(l))==null?void 0:u.promise;if(h)return Z2(h,r);if(n){const m=hN({...o,appName:""}),g=(d=ss.get(m))==null?void 0:d.promise;if(g){let b;return b=g.then(v=>{var w,x,O,k,S;if(v.recoveryStatus==="preparing")return((w=ss.get(l))==null?void 0:w.promise)===b&&ss.delete(l),v;const y=((O=(x=v.agent)==null?void 0:x.appName)==null?void 0:O.trim())??"";return y&&y!==n.trim()?(((k=ss.get(l))==null?void 0:k.promise)===b&&ss.delete(l),PD(o)):(((S=ss.get(l))==null?void 0:S.promise)===b&&ss.set(l,{value:v,updatedAt:Date.now()}),v)},v=>{var y;throw((y=ss.get(l))==null?void 0:y.promise)===b&&ss.delete(l),v}),ss.set(l,{promise:b,updatedAt:0}),Z2(b,r)}}}let c;return c=Ptt({...o,force:s}).then(f=>{var h,m,g,b,v;if(f.recoveryStatus==="preparing")return((h=ss.get(l))==null?void 0:h.promise)===c&&ss.delete(l),f;if(((m=ss.get(l))==null?void 0:m.promise)===c){ss.set(l,{value:f,updatedAt:Date.now()});const y=new Set(["",((b=(g=f.agent)==null?void 0:g.appName)==null?void 0:b.trim())??""]);for(const w of y){const x=hN({...o,appName:w});x!==l&&!((v=ss.get(x))!=null&&v.promise)&&ss.set(x,{value:f,updatedAt:Date.now()})}}return f},f=>{var h;throw((h=ss.get(l))==null?void 0:h.promise)===c&&ss.delete(l),f}),ss.set(l,{promise:c,updatedAt:0}),Z2(c,r)}function q8({runtimeId:e,region:t,appName:n,currentVersion:i}){return Eb(ss,hN({runtimeId:e,region:t,appName:n,currentVersion:i}),z1)}function W8(e){return PD(e).then(()=>{},()=>{})}function K8(e,t){if(!e){ss.clear();return}for(const n of ss.keys()){const[i,r,s]=n.split("");i===sC&&s===e&&(!t||r===t)&&ss.delete(n)}}async function Dtt(e){const t=await e.json().catch(()=>null),n=typeof(t==null?void 0:t.detail)=="string"?t.detail:"";return e.status===403?Q("client.runtimeManageForbidden"):e.status===404?Q(n==="runtime_not_found"?"client.runtimeNotFound":"client.runtimeUnavailable"):Q("client.checkRuntimeUpdateFailed",{status:e.status})}async function Mtt(e,t){let n=null;for(const i of $A(t)){const r=await gt(`/web/runtime-detail?runtimeId=${encodeURIComponent(e)}®ion=${encodeURIComponent(i)}`);if(r.ok)return r.json();n=new Error(await Ft(r,Q("client.loadRuntimeDetailFailed")))}throw n??new Error(Q("client.loadRuntimeDetailFailed"))}async function DD(e,t="cn-beijing",n={}){const i=U0(e,t||"cn-beijing"),r=Eb(hy,i,z1);if(!n.force&&r)return r;const s=hy.get(i);if(!n.force&&(s!=null&&s.promise))return s.promise;const o=Mtt(e,t).then(l=>kz(hy,i,l));hy.set(i,{...s,promise:o,updatedAt:(s==null?void 0:s.updatedAt)??0});try{return await o}finally{const l=hy.get(i);(l==null?void 0:l.promise)===o&&hy.set(i,{value:l.value,updatedAt:l.updatedAt})}}async function Ltt(e,t,n){const i=new URLSearchParams({runtimeId:e,region:t,key:n}),r=await gt(`/web/runtime-env/copy?${i.toString()}`,{method:"POST"});if(!r.ok)throw new Error(await Ft(r,Q("client.copySecretFailed")));const s=await r.json();if(typeof s.value!="string"||!s.value)throw new Error(Q("client.copySecretFailed"));await navigator.clipboard.writeText(s.value)}function A2e(e,t="cn-beijing"){return Eb(hy,U0(e,t||"cn-beijing"),z1)}function T2e(e,t="cn-beijing"){DD(e,t).catch(()=>{})}async function tE(e){const t=await gt("/web/generated-agent-projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await Ft(t,Q("client.generateProjectFailed")));return t.json()}const $tt=19e4,Ftt=12e4;async function _2e(e){const t=await gt("/web/generated-agent-drafts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requirement:e})},{},$tt);if(!t.ok)throw new Error(await Ft(t,Q("client.generateAgentConfigFailed")));return CD(t,Q("client.generateAgentConfigFailed"))}async function j2e(e,t){const n=await gt("/web/generated-agent-test-runs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e,runtimeId:t==null?void 0:t.runtimeId,runtimeRegion:t==null?void 0:t.region,mcpCredentialReuses:t==null?void 0:t.mcpCredentialReuses})},{},Ftt);if(!n.ok)throw new Error(await Ft(n,Q("client.createDebugRunFailed")));return CD(n,Q("client.createDebugRunFailed"))}async function N2e(e,t){const n=await gt(`/web/generated-agent-test-runs/${e}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:t})});if(!n.ok)throw new Error(await Ft(n,Q("client.createDebugSessionFailed")));return(await CD(n,Q("client.createDebugSessionFailed"))).id}async function R2e(e,t){const n=await gt(`/web/generated-agent-test-runs/${encodeURIComponent(e)}/trace/session/${encodeURIComponent(t)}`);if(!n.ok)throw new Error(await Ft(n,Q("client.loadDebugTraceFailed")));const i=await CD(n,Q("client.loadDebugTraceFailed"));if(!Array.isArray(i))throw new Error(Q("client.invalidDebugTrace"));return i}async function*I2e({runId:e,userId:t,sessionId:n,text:i,signal:r}){const s=i.trim()?[{text:i}]:[],o=_z(r);let l;try{l=await gt(`/web/generated-agent-test-runs/${e}/run_sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({user_id:t,session_id:n,new_message:{role:"user",parts:s},streaming:!0}),signal:o.signal},{},0)}catch(c){throw o.cleanup(),o.timedOut()?new Error(Xg()):c}if(!l.ok)throw o.cleanup(),new Error(await Ft(l,Q("client.debugRunFailed")));try{for await(const c of LA(l))o.clearDeadline(),yield c}catch(c){throw o.timedOut()?new Error(Xg()):c}finally{o.cleanup()}}async function sx(e){const t=await gt(`/web/generated-agent-test-runs/${e}`,{method:"DELETE"});if(!t.ok&&t.status!==404)throw new Error(await Ft(t,Q("client.cleanupDebugRunFailed")))}function P2e(e){if(!e||typeof e!="object")throw new Error(Q("client.invalidSandboxVersion"));const t=e;if(typeof t.toolId!="string"||typeof t.error!="string")throw new Error(Q("client.invalidSandboxVersion"));if(!t.error&&(t.provider!=="volcengine"&&t.provider!=="byteplus"||typeof t.region!="string"||typeof t.status!="string"||typeof t.currentImage!="string"||typeof t.latestImage!="string"||typeof t.needsImageUpdate!="boolean"||typeof t.canUpdate!="boolean"||typeof t.needsModelEnvUpdate!="boolean"||typeof t.canUpdateModelEnv!="boolean"||typeof t.modelEnvError!="string"))throw new Error(Q("client.invalidSandboxVersion"));return t}async function D2e(e){const t=await gt("/web/system-info/sandbox-tools/updates",{signal:e});if(!t.ok)throw new Error(await Ft(t,Q("client.loadSandboxVersionsFailed")));const n=await t.json();if(!Array.isArray(n.tools))throw new Error(Q("client.invalidSandboxVersion"));return n.tools.map(P2e)}async function M2e(e){const t=await gt(`/web/system-info/sandbox-tools/${encodeURIComponent(e)}/update`,{method:"POST"},{},33e4);if(!t.ok)throw new Error(await Ft(t,Q("client.updateSandboxFailed")));const n=await t.json();if(typeof n.updated!="boolean")throw new Error(Q("client.invalidSandboxUpdate"));return{updated:n.updated,state:P2e(n.state)}}class fd extends Error{constructor(t){super(`Channel request failed (${t})`),this.status=t}}async function Ec(e,t,n={}){const i=await gt(`/api/v1/channels${t}`,{...n,headers:{"Content-Type":"application/json",...n.headers}},e);if(!i.ok)throw new fd(i.status);return i.json()}function G8(e,t,n,i){return aet(gt,e,t,n,i)}function L2e(e,t,n,i,r){return oet(gt,e,t,n,i,r)}function $2e(e,t,n,i){return cet(gt,e,t,n,i)}const Btt=Object.freeze(Object.defineProperty({__proto__:null,ChannelApiError:fd,DEFAULT_SITE_BRANDING:oC,DEFAULT_STUDIO_ACCESS:c2e,GithubCicdPipelineError:eE,MpaExecutionConfigRequestError:iw,RuntimeAccessDeniedError:Q1,RuntimeListError:ID,RuntimeProbeError:Oa,TurnControlConflictError:jD,applyMpaProfileAfterDeployment:tI,attachGithubDeliveryCicdToSourceSync:jtt,bindGithubCicdRuntime:$z,buildEnvironment:Q8,cancelAgentkitDeployment:o2e,cancelCronJobRun:v2e,channelRequest:Ec,checkRuntimeNameAvailability:ND,clearMessageFeedbackCache:qAe,clearRemoteApps:KAe,componentSearch:wTe,continueTurn:ktt,continueTurnSSE:yTe,controlTurn:bTe,copyRuntimeEnvironmentSecret:Ltt,createCronJob:m2e,createEnvironment:GTe,createGeneratedAgentTestRun:j2e,createGeneratedAgentTestSession:N2e,createGithubCicdPipeline:t2e,createGithubDeliveryCicdPipeline:n2e,createGithubDeliveryRollbackPr:s2e,createSession:iTe,createWorkspace:UTe,deleteAgentFeedbackCases:cTe,deleteCronJob:x2e,deleteEnvironment:YTe,deleteGeneratedAgentTestRun:sx,deleteMedia:dN,deleteRuntime:E2e,deleteSession:M8,deleteSessionMedia:L8,deleteWorkspace:zTe,deployAgentkitProject:Q0,downloadArtifact:Ez,ensureRuntimeRouteChannel:O2e,exportEnvironmentShareCode:HTe,fetchRemoteApps:FA,fetchSessionFile:uTe,generateAgentDraftFromRequirement:_2e,generateAgentProject:tE,getAgentFeedbackCases:_D,getAgentInfo:F8,getAgentOptimizations:sTe,getAgentUsage:p2e,getAutomaticEvaluationStatuses:D8,getCachedAgentFeedbackCases:aTe,getCachedRuntimeAgentInfo:vTe,getCachedRuntimeDetail:A2e,getCachedRuntimeUpdateCapability:q8,getCronJob:Itt,getEnvironmentBuild:ZTe,getEnvironmentManifest:JTe,getEnvironmentResources:e2e,getGeneratedAgentTestTrace:R2e,getGithubCicdRuntimeBinding:r2e,getGithubDeliveryVersions:fN,getMediaCapabilities:wtt,getMpaAgentDeletePreview:ATe,getMpaAgentOperation:STe,getMpaAgentView:CTe,getMpaProfileStatus:ETe,getMpaRuntimeConsoleRuns:TTe,getMpaRuntimeConsoleTrace:_Te,getMpaSessionExecutionConfig:Iz,getMyRuntimes:Ntt,getRuntimeAgentInfo:Az,getRuntimeDetail:DD,getRuntimeMcpCredentials:C2e,getRuntimeStudioToolCapabilities:w2e,getRuntimeUpdateCapability:PD,getRuntimes:z0,getSandboxImageUpdates:D2e,getSession:aC,getSessionTrace:JR,getStudioAccess:u2e,getStudioUpdatePermissions:f2e,getStudioUpdateStatus:d2e,getSystemInfo:DTe,getTurnControl:gTe,getUiConfig:l2e,httpErrorMessage:Ft,importEnvironmentShareCodes:WTe,initializeGithubDeliveryMain:i2e,inspectEnvironmentRepository:VTe,inspectEnvironmentShareCodes:qTe,invalidateRuntimeUpdateCapabilityCache:K8,isMpaA2aRuntimeApp:ip,isMpaRuntimeApp:eI,listActiveMpaAgentOperations:kTe,listApps:YAe,listCronJobRuns:H8,listCronJobs:V8,listDeploymentResources:NTe,listEnvironments:UA,listIdentityUserPools:RD,listModelApiKeys:wz,listModelOptions:U1,listMpaCronTasks:G8,listMpaRuns:$2e,listSessions:Sz,listWorkspaces:Lz,mediaContentUrl:pTe,mpaProfileFromAgentDraft:BA,parseEnvironmentManifest:LTe,parseEnvironmentShareCodes:Pz,parsePreparedSessionEnvironmentMounts:RTe,patchMpaSessionExecutionConfig:U8,prefetchAgentFeedbackCases:vtt,prefetchRuntimeAgentInfo:xTe,prefetchRuntimeDetail:T2e,prefetchRuntimeUpdateCapability:W8,prepareSessionEnvironmentMounts:ITe,previewArtifact:Cz,probeRuntimeA2a:k2e,probeRuntimeApps:Kw,refreshAgentFeedbackCases:oTe,registerRemoteApp:WAe,requestMpaTask:L2e,retryMpaAgentOperation:Rz,revealModelApiKey:XAe,revealRuntimeApiKey:S2e,runCronJobNow:y2e,runGeneratedAgentTestSSE:I2e,runSSE:B8,runSseEmptyResponseError:Tz,runSseFirstEventTimeoutError:Xg,runSseIncompleteResponseError:uS,runtimeRegionCandidates:$A,setClientCloudProvider:tTe,setCronJobEnabled:b2e,startMpaAgentOperation:Nz,startStudioUpdate:h2e,studioFetch:yn,submitIssueFeedback:$8,submitMessageFeedback:rTe,syncGithubCicdRuntime:a2e,updateCodexSandboxToolModelEnv:Ttt,updateCronJob:g2e,updateEnvironment:XTe,updateSandboxTool:M2e,updateWorkspace:QTe,upgradeMpaSessionProfile:jTe,uploadMedia:fTe,upsertCachedAgentFeedbackCase:uN,webSearch:OTe,writeEnvironmentShareCode:PTe},Symbol.toStringTag,{value:"Module"})),Utt="/web/sandbox/sessions",eJ="/web/sandbox/codex-project-handoff",tJ=3e4,C3=33e4,Qtt=6e4,ztt=6e5,lk=15e3,up=6e4,Vtt=33e4,nJ=3e4,Htt=60*60,X8=40;function MD(e){const t=e.trim().toLowerCase();return["ready","running","wakeable"].includes(t)?"ready":t}function Fz(e){switch(e.trim().toLowerCase()){case"ready":return Q("sandbox.status.ready");case"wakeable":return Q("sandbox.status.wakeable");case"creating":return Q("sandbox.status.creating");case"starting":case"initializing":return Q("sandbox.status.starting");case"pending":return Q("sandbox.status.pending");case"running":return Q("sandbox.status.running");case"failed":case"error":return Q("sandbox.status.failed");case"stopped":return Q("sandbox.status.stopped");case"expired":return Q("sandbox.status.expired");case"deleting":return Q("sandbox.status.deleting");case"deleted":return Q("sandbox.status.deleted");default:return Q("sandbox.status.unknown")}}function ps(e){const t=ul(e);return t.has("Accept")||t.set("Accept","application/json"),t}class Bz extends Error{constructor(n,i={}){var r;super(n);Zt(this,"code");Zt(this,"retryable");Zt(this,"publicMessage");Zt(this,"httpStatus");this.name="SandboxServiceError",this.code=i.code??"",this.retryable=i.retryable===!0,this.publicMessage=((r=i.publicMessage)==null?void 0:r.trim())||n,this.httpStatus=i.httpStatus}}function qtt(e){return e instanceof Bz?e.publicMessage:e instanceof Error&&e.name==="TimeoutError"?Q("sandbox.developmentTimeout"):e instanceof TypeError?Q("sandbox.developmentDisconnected"):Q("sandbox.developmentFailed")}async function Bs(e,t){const n=await e.text().catch(()=>"");let i={};try{i=JSON.parse(n)}catch{const d=Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status});return new Error(n?Q("common.fallbackWithDetail",{fallback:d,detail:n}):d)}const r=i.detail,s=r&&typeof r=="object"?r:i,o=r&&typeof r=="object"&&"message"in r?r.message:r??i.error??i.message,l=typeof o=="string"?o:o==null?"":JSON.stringify(o),c=Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),u=l?Q("common.fallbackWithDetail",{fallback:c,detail:l}):c;return new Bz(u,{code:typeof s.code=="string"?s.code:"",retryable:s.retryable===!0,publicMessage:l||c,httpStatus:e.status})}async function iJ(e,t){const n=await e.text().catch(()=>"");try{return JSON.parse(n)}catch{throw new Error(Q("sandbox.invalidStudioResponse",{fallback:t}))}}function Kb(e,t="codex",n=e.toolName==="intelligent-development"){if(!e.sessionId||!e.status)throw new Error(Q("sandbox.invalidSession"));return{resourceType:"session",id:e.sessionId,toolName:t,userSessionId:e.userSessionId??"",displayName:e.displayName??"",status:e.status,createdAt:e.createdAt??"",expireAt:e.expireAt??"",persistent:e.persistent!==!1,toolType:e.toolType??"",intelligentDevelopment:n,createdBy:e.createdBy??"",region:e.region??"",isMine:e.isMine===!0,threadId:e.threadId??"",cwd:e.cwd??"",workspaceLocked:e.workspaceLocked===!0,busy:e.busy===!0,...typeof e.model=="string"?{model:e.model}:{},permissions:LD(e.permissions),...e.conversation===void 0?{}:{restoredConversation:py(e.conversation)}}}function rJ(e,t="codex"){if(!e.snapshotId||!e.status)throw new Error(Q("sandbox.invalidSnapshot"));return{resourceType:"snapshot",id:e.snapshotId,snapshotId:e.snapshotId,sourceSessionId:e.sessionId??"",toolName:t,userSessionId:e.userSessionId??"",displayName:e.displayName??"",status:e.status,snapshotStatus:e.snapshotStatus??"Unknown",reason:e.reason??"",createdAt:e.createdAt??"",createdBy:e.createdBy??"",region:e.region??"",isMine:e.isMine===!0}}function sJ(e,t){if((t==null?void 0:t.autoResumeSnapshots)===void 0)return e;const n=new URLSearchParams({autoResumeSnapshots:String(t.autoResumeSnapshots)});return`${e}?${n.toString()}`}const ck={approvalPolicy:"on-request",approvalsReviewer:"user",sandboxMode:"workspace-write",networkAccess:!1};function LD(e){if(!e||typeof e!="object")return{...ck};const t=e,n=t.approvalPolicy,i=t.approvalsReviewer,r=t.sandboxMode;return{approvalPolicy:n==="untrusted"||n==="on-request"||n==="never"?n:ck.approvalPolicy,approvalsReviewer:i==="user"||i==="auto_review"?i:ck.approvalsReviewer,sandboxMode:r==="read-only"||r==="workspace-write"||r==="danger-full-access"?r:ck.sandboxMode,networkAccess:typeof t.networkAccess=="boolean"?t.networkAccess:ck.networkAccess}}function aJ(e){if(!e||typeof e!="object")throw new Error(Q("sandbox.invalidSettings"));const t=e;return{threadId:typeof t.threadId=="string"?t.threadId:"",cwd:typeof t.cwd=="string"?t.cwd:"",...typeof t.model=="string"?{model:t.model}:{},workspaceLocked:t.workspaceLocked===!0,busy:t.busy===!0,permissions:LD(t.permissions)}}function xa(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Wtt(e){const t=xa(e);if(!(!t||typeof t.id!="string"||!t.id))return{id:t.id,displayName:typeof t.displayName=="string"?t.displayName:t.id,description:typeof t.description=="string"?t.description:"",isDefault:t.isDefault===!0}}function Ktt(e){const t=xa(e);if(!(!t||typeof t.id!="string"||!t.id||typeof t.name!="string"||!t.name))return{id:t.id,name:t.name,description:typeof t.description=="string"?t.description:""}}function F2e(e){const t=xa(e);if(!(!t||typeof t.id!="string"||!t.id))return{id:t.id,...typeof t.name=="string"&&t.name?{name:t.name}:{},preview:typeof t.preview=="string"?t.preview:"",cwd:typeof t.cwd=="string"?t.cwd:"",modelProvider:typeof t.modelProvider=="string"?t.modelProvider:"",createdAt:typeof t.createdAt=="number"&&Number.isFinite(t.createdAt)?t.createdAt:0,updatedAt:typeof t.updatedAt=="number"&&Number.isFinite(t.updatedAt)?t.updatedAt:0,status:typeof t.status=="string"?t.status:"unknown"}}function py(e){const t=xa(e),n=F2e(t==null?void 0:t.thread);if(!t||!n||typeof t.threadId!="string"||!Array.isArray(t.messages))throw new Error(Q("sandbox.invalidThreadSnapshot"));const i=t.messages.flatMap(r=>{const s=xa(r);if(!s||typeof s.id!="string"||s.role!=="user"&&s.role!=="assistant"||typeof s.content!="string"||typeof s.timestamp!="number")return[];const o=Array.isArray(s.skillNames)?s.skillNames.filter(c=>typeof c=="string"&&!!c):[],l=Array.isArray(s.images)?s.images.flatMap(c=>{const u=xa(c);return!u||typeof u.mimeType!="string"||!u.mimeType.startsWith("image/")||typeof u.data!="string"||!u.data?[]:[{mimeType:u.mimeType,data:u.data,...typeof u.name=="string"&&u.name?{name:u.name}:{},...typeof u.alt=="string"&&u.alt?{alt:u.alt}:{}}]}):[];return[{id:s.id,role:s.role,content:s.content,timestamp:s.timestamp,...o.length?{skillNames:o}:{},...l.length?{images:l}:{}}]});return{thread:n,threadId:t.threadId,messages:i,...typeof t.model=="string"?{model:t.model}:{},...typeof t.cwd=="string"?{cwd:t.cwd}:{},workspaceLocked:t.workspaceLocked===!0,permissions:LD(t.permissions)}}function Y8(e){if(!e||typeof e!="object")return;const t=e;if(![t.totalTokens,t.inputTokens,t.cachedInputTokens,t.outputTokens,t.reasoningOutputTokens].some(i=>typeof i!="number"||!Number.isFinite(i)||i<0))return{totalTokens:Math.trunc(t.totalTokens),inputTokens:Math.trunc(t.inputTokens),cachedInputTokens:Math.trunc(t.cachedInputTokens),outputTokens:Math.trunc(t.outputTokens),reasoningOutputTokens:Math.trunc(t.reasoningOutputTokens)}}function Gtt(e){const t=Y8(e.usage);if(!t||typeof e.turnId!="string")return;const n=Y8(e.threadTotal),i=e.modelContextWindow;return{turnId:e.turnId,usage:t,...n?{threadTotal:n}:{},...typeof i=="number"&&Number.isFinite(i)&&i>=0?{modelContextWindow:Math.trunc(i)}:{}}}function Xtt(e){return typeof e.id!="string"||e.kind!=="command"&&e.kind!=="file"||typeof e.method!="string"?null:{id:e.id,kind:e.kind,method:e.method,...typeof e.reason=="string"?{reason:e.reason}:{},...typeof e.command=="string"?{command:e.command}:{},...typeof e.cwd=="string"?{cwd:e.cwd}:{},...typeof e.grantRoot=="string"?{grantRoot:e.grantRoot}:{},...e.changes!==void 0?{changes:e.changes}:{},...typeof e.threadId=="string"?{threadId:e.threadId}:{},...typeof e.turnId=="string"?{turnId:e.turnId}:{},...typeof e.itemId=="string"?{itemId:e.itemId}:{}}}function B2e(e={}){let t="";const n=[],i=new Map,r=new Map;let s,o;function l(){var h;const f=s?[...n,s]:n;(h=e.onBlocks)==null||h.call(e,[...f])}function c(f){t+=f;const h=n[n.length-1],m=n.length-1,g=[...i.values()].includes(m);(h==null?void 0:h.kind)==="text"&&!g?n[m]={...h,text:h.text+f}:n.push({kind:"text",text:f}),l()}function u(f){if(typeof f.id!="string"||f.kind!=="thinking"&&f.kind!=="commentary"&&f.kind!=="tool"||f.status!=="running"&&f.status!=="done"&&f.status!=="error")return;const h=f.status!=="running";let m;if(f.kind==="thinking")m={kind:"thinking",text:typeof f.text=="string"?f.text:"",done:h};else if(f.kind==="commentary"){if(typeof f.text!="string"||!f.text)return;m={kind:"text",text:f.text}}else{if(typeof f.name!="string"||!f.name)return;m={kind:"tool",name:f.name,args:f.args,response:f.response,status:f.status==="error"?"failed":h?"completed":"running",done:h}}m={...m,id:f.id,...typeof f.itemType=="string"?{itemType:f.itemType}:{},...typeof f.phase=="string"?{phase:f.phase}:{},...typeof f.durationMs=="number"?{durationMs:f.durationMs}:{}};const g=i.get(f.id);g===void 0?(i.set(f.id,n.length),n.push(m)):n[g]=m,l()}function d(f){var b,v,y,w;let h="message";const m=[];for(const x of f.split(/\r?\n/))x.startsWith("event:")&&(h=x.slice(6).trim()),x.startsWith("data:")&&m.push(x.slice(5).trimStart());if(m.length===0)return;let g;try{g=JSON.parse(m.join(` +`))}catch{throw new Error(Q("sandbox.invalidConversationResponse"))}if(h==="error"){const x=typeof g.message=="string"&&g.message?g.message:Q("sandbox.conversationFailed");throw new Bz(x,{code:typeof g.code=="string"?g.code:"",retryable:g.retryable===!0,publicMessage:x})}if(h==="progress"&&typeof g.text=="string"&&(s=g.text?{kind:"progress",text:g.text}:void 0,l()),["activity","delta","tool_output","tool_progress","plan","diff"].includes(h)&&(s=void 0),h==="activity"&&u(g),(h==="tool_output"||h==="tool_progress")&&typeof g.id=="string"){const x=i.get(g.id),O=x===void 0?void 0:n[x];if((O==null?void 0:O.kind)==="tool"&&x!==void 0&&typeof g.text=="string"){const k=xa(O.response)||{};n[x]=h==="tool_progress"?{...O,progressText:g.text}:{...O,response:{...k,output:(g.snapshot?"":String(k.output||""))+g.text}},l()}}if((h==="plan"||h==="diff")&&typeof g.id=="string"){const x=typeof g.text=="string"?g.text:"",O=Array.isArray(g.items)?g.items:Array.isArray(g.plan)?g.plan:[],k=h==="diff"?{kind:"diff",id:g.id,text:x,done:g.status==="done"}:{kind:"plan",id:g.id,title:Q("developmentRuns.plan"),summary:x,done:g.status==="done",items:O.flatMap(C=>{const E=xa(C);if(!E||typeof(E.text??E.step)!="string")return[];const j=E.status==="inProgress"?"in_progress":E.status;return[{text:String(E.text??E.step),status:j==="completed"||j==="failed"||j==="in_progress"?j:"pending"}]})},S=i.get(g.id);S===void 0?(i.set(g.id,n.length),n.push(k)):n[S]=k,l()}if(h==="development.source_ready"||h==="development.succeeded"){const x=xa(g.payload),O=xa(x==null?void 0:x.delivery),k=h==="development.succeeded";if(O&&typeof O.sessionId=="string"&&typeof O.artifactSha256=="string"&&typeof O.validationReportSha256=="string"&&typeof O.agentName=="string"&&typeof O.entryPoint=="string"&&typeof O.fileCount=="number"&&typeof O.artifactSize=="number"&&typeof O.validatedAt=="string"&&O.deployable===!0&&O.verified===k&&typeof O.validationSummary=="string"&&Array.isArray(O.gateSummary)&&O.gateSummary.every(S=>typeof S=="string")){const S={kind:"delivery",value:{sessionId:O.sessionId,...typeof O.projectId=="string"&&typeof O.versionId=="string"?{projectId:O.projectId,versionId:O.versionId,...O.parentVersionId===null||typeof O.parentVersionId=="string"?{parentVersionId:O.parentVersionId}:{}}:{},artifactSha256:O.artifactSha256,validationReportSha256:O.validationReportSha256,agentName:O.agentName,entryPoint:O.entryPoint,fileCount:O.fileCount,artifactSize:O.artifactSize,validatedAt:O.validatedAt,gateSummary:O.gateSummary,deployable:O.deployable,verified:O.verified,validationSummary:O.validationSummary}},C=n.findIndex(E=>E.kind==="delivery"&&E.value.sessionId===O.sessionId&&E.value.artifactSha256===O.artifactSha256&&E.value.validationReportSha256===O.validationReportSha256);C===-1?n.push(S):n[C]=S,l()}}if(h==="approval"){const x=Xtt(g);x&&((b=e.onApproval)==null||b.call(e,x))}if(h==="usage"){const x=Gtt(g);x&&(o=x,(v=e.onUsage)==null||v.call(e,x))}if(h==="approval_resolved"&&typeof g.approvalId=="string"&&((y=e.onApprovalResolved)==null||y.call(e,g.approvalId)),h==="delta"&&typeof g.text=="string")if(typeof g.id=="string"&&g.id){const x=r.get(g.id),O=x===void 0?void 0:n[x],k=((w=xa(g))==null?void 0:w.snapshot)===!0;(O==null?void 0:O.kind)==="text"?n[x]={...O,phase:typeof g.phase=="string"&&g.phase?g.phase:O.phase,text:k?O.text.startsWith(g.text)?O.text:g.text:O.text+g.text}:(r.set(g.id,n.length),n.push({kind:"text",text:g.text,id:g.id,itemType:typeof g.itemType=="string"?g.itemType:void 0,phase:typeof g.phase=="string"?g.phase:void 0})),t=n.filter(S=>S.kind==="text").map(S=>S.text).join(""),l()}else c(g.text);if(h==="done"&&!t&&typeof g.text=="string"&&c(g.text),h==="done"){for(let x=0;x({text:t,blocks:n.map(f=>({...f})),...o?{usage:o}:{}})}}async function Ytt(e,t={}){if(!e.body)throw new Error(Q("sandbox.emptyConversationResponse"));const n=e.body.getReader(),i=new TextDecoder;let r="";const s=B2e(t);for(;;){const{done:l,value:c}=await n.read();r+=i.decode(c,{stream:!l});const u=r.split(/\r?\n\r?\n/);if(r=u.pop()??"",u.forEach(s.consumeFrame),l)break}r.trim()&&s.consumeFrame(r),s.consumeFrame(`event: done +data: {}`);const o=s.result();if(o.blocks.length===0)throw new Error(Q("sandbox.emptyReply"));return o}async function nu(e,t,n,{method:i="GET",body:r,options:s={},fallback:o}){if(!t)throw new Error(Q("sandbox.missingSession"));const l=await yn(`${e}/${encodeURIComponent(t)}/${n}`,{method:i,headers:ps(r===void 0?void 0:{"Content-Type":"application/json"}),...r===void 0?{}:{body:JSON.stringify(r)},signal:s.signal},up);if(!l.ok)throw await Bs(l,o);return l.json()}function U2e(e,t={}){return{async listSessions(n={}){const i=await yn(sJ(e,n),{method:"GET",headers:ps(),signal:n.signal},tJ);if(!i.ok)throw await Bs(i,Q("sandbox.listCodexFailed"));const r=await i.json();if(!Array.isArray(r.sessions))throw new Error(Q("sandbox.invalidSessionList"));if(r.snapshots!==void 0&&!Array.isArray(r.snapshots))throw new Error(Q("sandbox.invalidSnapshotList"));return[...r.sessions.map(s=>Kb(s,"codex",t.intelligentDevelopment)),...(r.snapshots??[]).map(s=>rJ(s))]},async startSession(n={}){var s,o;const i=((s=n.displayName)==null?void 0:s.trim())??"",r=await yn(e,{method:"POST",headers:ps({"Content-Type":"application/json"}),body:JSON.stringify({displayName:t.textOnly&&n.projectId?Array.from(i).slice(0,X8).join(""):i,...(o=n.modelId)!=null&&o.trim()?{modelId:n.modelId.trim()}:{},...t.textOnly&&n.projectId?{projectId:n.projectId,...n.baseVersionId?{baseVersionId:n.baseVersionId}:{}}:{},...t.textOnly?{}:{persistent:n.persistent??!0},...n.diskGb!==void 0?{diskGb:n.diskGb}:{}}),signal:n.signal},C3);if(!r.ok)throw await Bs(r,Q("sandbox.startFailed"));return Kb(await r.json(),"codex",t.intelligentDevelopment)},async listAgentSessions(n,i={}){const r=await yn(sJ(`/web/${n}/sessions`,i),{method:"GET",headers:ps(),signal:i.signal},tJ);if(!r.ok)throw await Bs(r,Q("sandbox.listAgentFailed",{kind:n}));const s=await r.json();if(!Array.isArray(s.sessions))throw new Error(Q("sandbox.invalidKindSessionList",{kind:n}));if(s.snapshots!==void 0&&!Array.isArray(s.snapshots))throw new Error(Q("sandbox.invalidKindSnapshotList",{kind:n}));return[...s.sessions.map(o=>Kb(o,n)),...(s.snapshots??[]).map(o=>rJ(o,n))]},async startAgentSession(n,i={}){var s;const r=await yn(`/web/${n}/sessions`,{method:"POST",headers:ps({"Content-Type":"application/json"}),body:JSON.stringify({displayName:((s=i.displayName)==null?void 0:s.trim())??"",persistent:i.persistent??!0,...i.diskGb!==void 0?{diskGb:i.diskGb}:{}}),signal:i.signal},C3);if(!r.ok)throw await Bs(r,Q("sandbox.createAgentFailed",{kind:n}));return Kb(await r.json(),n)},async openAgentSession(n,i,r={}){if(!i)throw new Error(Q("sandbox.missingSessionToOpen"));const s=await yn(`/web/${n}/sessions/${encodeURIComponent(i)}/open`,{method:"POST",headers:ps(),signal:r.signal},up);if(!s.ok)throw await Bs(s,Q("sandbox.openAgentFailed",{kind:n}));const o=await s.json();if(typeof o.webuiUrl!="string"||!o.webuiUrl.startsWith("/"))throw new Error(Q("sandbox.invalidAgentHomeUrl",{kind:n}));return{session:Kb(o,n),kind:n,webuiUrl:Ta(o.webuiUrl)}},async launchAgentTerminal(n,i,r={}){if(!i)throw new Error(Q("sandbox.missingSessionForTerminal"));const s=await yn(`/web/${n}/sessions/${encodeURIComponent(i)}/terminal`,{method:"POST",headers:ps(),signal:r.signal},up);if(!s.ok)throw await Bs(s,Q("sandbox.openTerminalFailed",{kind:n}));const o=await s.json();return{url:Q2e(o.url,`${n} Terminal`),...typeof o.shellSessionId=="string"?{shellSessionId:o.shellSessionId}:{}}},async deleteAgentSession(n,i,r={}){if(!i)return;const s=await yn(`/web/${n}/sessions/${encodeURIComponent(i)}`,{method:"DELETE",headers:ps(),signal:r.signal},lk);if(!s.ok&&s.status!==404)throw await Bs(s,Q("sandbox.deleteAgentFailed",{kind:n}))},async resumeSnapshot(n,i,r={}){if(!i)throw new Error(Q("sandbox.missingSnapshot"));const s=n==="codex"?"/web/sandbox":`/web/${n}`,o=await yn(`${s}/snapshots/${encodeURIComponent(i)}/resume`,{method:"POST",headers:ps(),signal:r.signal},C3);if(!o.ok)throw await Bs(o,Q("sandbox.resumeSnapshotFailed"));return Kb(await o.json(),n)},async deleteSnapshot(n,i,r={}){if(!i)return;const s=n==="codex"?"/web/sandbox":`/web/${n}`,o=await yn(`${s}/snapshots/${encodeURIComponent(i)}`,{method:"DELETE",headers:ps(),signal:r.signal},lk);if(!o.ok&&o.status!==404)throw await Bs(o,Q("sandbox.deleteSnapshotFailed"))},async connectSession(n,i={}){if(!n)throw new Error(Q("sandbox.missingSessionToConnect"));const r=await yn(`${e}/${encodeURIComponent(n)}/connect`,{method:"POST",headers:ps({"Content-Type":"application/json"}),signal:i.signal},Qtt);if(!r.ok)throw await Bs(r,Q("sandbox.connectCodexFailed"));const s=Kb(await r.json(),"codex",t.intelligentDevelopment);if(s.status.toLowerCase()!=="ready")throw new Error(Q("sandbox.sessionNotReady",{status:s.status}));return s},async sendMessage(n,i={}){var s;if(!n.sessionId||!n.text.trim())throw new Error(Q("sandbox.invalidMessage"));const r=await yn(`${e}/${encodeURIComponent(n.sessionId)}/messages`,{method:"POST",headers:ps({Accept:"text/event-stream","Content-Type":"application/json"}),body:JSON.stringify({message:n.text,...!t.textOnly&&((s=n.skillIds)!=null&&s.length)?{skillIds:n.skillIds}:{}}),signal:i.signal},t.messageTimeoutMs??ztt);if(!r.ok)throw await Bs(r,Q("sandbox.conversationFailed"));return Ytt(r,i)},async interruptSession(n,i={}){if(!n)return;const r=await yn(`${e}/${encodeURIComponent(n)}/interrupt`,{method:"POST",headers:ps(),signal:i.signal},t.interruptTimeoutMs??lk);if(!r.ok&&![404,409].includes(r.status))throw await Bs(r,Q("sandbox.interruptFailed"))},async getStatus(n,i={}){const r=await nu(e,n,"status",{options:i,fallback:Q("sandbox.getStatusFailed")}),s=aJ(r),o=xa(r),l=Y8(o==null?void 0:o.threadTotal),c=o==null?void 0:o.modelContextWindow;return{...s,...l?{threadTotal:l}:{},...typeof c=="number"&&Number.isFinite(c)&&c>=0?{modelContextWindow:Math.trunc(c)}:{}}},async getEndpoint(n,i={}){const r=xa(await nu(e,n,"endpoint",{options:i,fallback:Q("sandbox.getEndpointFailed")}));if(typeof(r==null?void 0:r.endpoint)!="string"||!r.endpoint.trim())throw new Error(Q("sandbox.invalidEndpoint"));return{endpoint:r.endpoint,sessionId:typeof r.sessionId=="string"?r.sessionId:n,...typeof r.expireAt=="string"?{expireAt:r.expireAt}:{}}},async createCodexProjectHandoffPairing(n={}){const i=await yn(`${eJ}/pairings`,{method:"POST",headers:ps({Accept:"application/json","Content-Type":"application/json"}),body:JSON.stringify({ttlSeconds:Htt}),signal:n.signal},nJ);if(!i.ok)throw await Bs(i,Q("sandbox.createHandoffPairingFailed"));const r=xa(await iJ(i,Q("sandbox.createHandoffPairingFailed")));if(typeof(r==null?void 0:r.pairingCode)!="string"||!r.pairingCode.trim()||typeof r.expireAt!="string"||!r.expireAt.trim())throw new Error(Q("sandbox.invalidHandoffPairing"));const s=typeof r.studioUrl=="string"&&r.studioUrl.trim()?r.studioUrl.trim():window.location.origin;return{pairingCode:r.pairingCode,expireAt:r.expireAt,studioUrl:s}},async getCodexProjectHandoffStatus(n,i={}){const r=await yn(`${eJ}/pairings/${encodeURIComponent(n)}`,{headers:ps({Accept:"application/json"}),signal:i.signal},nJ);if(!r.ok)throw await Bs(r,Q("sandbox.getHandoffStatusFailed"));const s=xa(await iJ(r,Q("sandbox.getHandoffStatusFailed"))),o=new Set(["issued","creating","session-created","continuing","running","completed","failed"]);if(typeof(s==null?void 0:s.state)!="string"||!o.has(s.state)||typeof s.expireAt!="string"||!s.expireAt.trim())throw new Error(Q("sandbox.invalidHandoffStatus"));return{state:s.state,expireAt:s.expireAt,...typeof s.projectName=="string"?{projectName:s.projectName}:{},...typeof s.agentName=="string"?{agentName:s.agentName}:{},...typeof s.sessionId=="string"?{sessionId:s.sessionId}:{},...typeof s.error=="string"?{error:s.error}:{},...s.failedStage==="creating-session"||s.failedStage==="uploading-project"||s.failedStage==="restoring-project"||s.failedStage==="continuing-task"?{failedStage:s.failedStage}:{}}},async listModels(n,i={}){const r=xa(await nu(e,n,"models",{options:i,fallback:Q("sandbox.listModelsFailed")}));if(!Array.isArray(r==null?void 0:r.models))throw new Error(Q("sandbox.invalidModelList"));return r.models.flatMap(s=>{const o=Wtt(s);return o?[o]:[]})},async setModel(n,i,r={}){const s=xa(await nu(e,n,"model",{method:"PUT",body:{model:i},options:r,fallback:Q("sandbox.setModelFailed")}));if(typeof(s==null?void 0:s.model)!="string"||!s.model)throw new Error(Q("sandbox.invalidModel"));return s.model},async listSkills(n,i=!1,r={}){const o=xa(await nu(e,n,`skills${i?"?force_reload=true":""}`,{options:r,fallback:Q("sandbox.listSkillsFailed")}));if(!Array.isArray(o==null?void 0:o.skills))throw new Error(Q("sandbox.invalidSkillList"));return o.skills.flatMap(l=>{const c=Ktt(l);return c?[c]:[]})},async listThreads(n,i={},r={}){const s=new URLSearchParams;i.cursor&&s.set("cursor",i.cursor),i.search&&s.set("search",i.search),i.archived&&s.set("archived","true");const o=s.size?`?${s}`:"",l=xa(await nu(e,n,`threads${o}`,{options:r,fallback:Q("sandbox.listThreadsFailed")}));if(!Array.isArray(l==null?void 0:l.threads))throw new Error(Q("sandbox.invalidThreadList"));return{threads:l.threads.flatMap(c=>{const u=F2e(c);return u?[u]:[]}),...typeof l.nextCursor=="string"?{nextCursor:l.nextCursor}:{}}},async newThread(n,i={}){return py(await nu(e,n,"threads/new",{method:"POST",options:i,fallback:Q("sandbox.createThreadFailed")}))},async readThread(n,i,r={}){if(!i)throw new Error(Q("sandbox.missingThread"));return py(await nu(e,n,`threads/${encodeURIComponent(i)}`,{options:r,fallback:Q("sandbox.readThreadFailed")}))},async resumeThread(n,i,r={}){return py(await nu(e,n,"threads/resume",{method:"POST",body:{threadId:i},options:r,fallback:Q("sandbox.resumeThreadFailed")}))},async forkThread(n,i={}){return py(await nu(e,n,"threads/fork",{method:"POST",options:i,fallback:Q("sandbox.forkThreadFailed")}))},async archiveThread(n,i,r={}){const s=xa(await nu(e,n,"threads/archive",{method:"POST",body:{threadId:i},options:r,fallback:Q("sandbox.archiveThreadFailed")}));if((s==null?void 0:s.archived)!==!0)throw new Error(Q("sandbox.invalidArchiveResult"));return{archived:!0,...s.thread?{snapshot:py(s)}:{}}},async deleteThread(n,i,r={}){const s=xa(await nu(e,n,"threads/delete",{method:"POST",body:{threadId:i},options:r,fallback:Q("sandbox.deleteThreadFailed")}));if((s==null?void 0:s.deleted)!==!0)throw new Error(Q("sandbox.invalidDeleteResult"));return{deleted:!0,...s.thread?{snapshot:py(s)}:{}}},async compactThread(n,i={}){await nu(e,n,"threads/compact",{method:"POST",options:i,fallback:Q("sandbox.compactThreadFailed")})},async getSettings(n,i={}){const r=await yn(`${e}/${encodeURIComponent(n)}/settings`,{method:"GET",headers:ps(),signal:i.signal},up);if(!r.ok)throw await Bs(r,Q("sandbox.getSettingsFailed"));return aJ(await r.json())},async updatePermissions(n,i,r={}){const s=await yn(`${e}/${encodeURIComponent(n)}/permissions`,{method:"PUT",headers:ps({"Content-Type":"application/json"}),body:JSON.stringify(i),signal:r.signal},up);if(!s.ok)throw await Bs(s,Q("sandbox.updatePermissionsFailed"));const o=await s.json();return LD(o.permissions)},async updateWorkspace(n,i,r={}){const s=await yn(`${e}/${encodeURIComponent(n)}/workspace`,{method:"PUT",headers:ps({"Content-Type":"application/json"}),body:JSON.stringify({cwd:i}),signal:r.signal},up);if(!s.ok)throw await Bs(s,Q("sandbox.updateWorkspaceFailed"));const o=await s.json();if(typeof o.cwd!="string"||!o.cwd)throw new Error(Q("sandbox.invalidWorkingDirectory"));return o.cwd},async listDirectories(n,i,r={}){const s=new URLSearchParams({path:i}),o=await yn(`${e}/${encodeURIComponent(n)}/directories?${s}`,{method:"GET",headers:ps(),signal:r.signal},up);if(!o.ok)throw await Bs(o,Q("sandbox.listDirectoriesFailed"));const l=await o.json();if(typeof l.path!="string"||!Array.isArray(l.directories)||l.directories.some(c=>!c||typeof c.name!="string"||typeof c.path!="string"))throw new Error(Q("sandbox.invalidDirectoryList"));return{path:l.path,...typeof l.parent=="string"?{parent:l.parent}:{},directories:l.directories}},async resolveApproval(n,i,r,s={}){const o=await yn(`${e}/${encodeURIComponent(n)}/approvals/${encodeURIComponent(i)}`,{method:"POST",headers:ps({"Content-Type":"application/json"}),body:JSON.stringify({decision:r}),signal:s.signal},up);if(!o.ok)throw await Bs(o,Q("sandbox.resolveApprovalFailed"))},async launchTerminal(n,i={}){return oJ(e,n,"terminal",i)},async launchBrowser(n,i={}){return oJ(e,n,"browser",i)},async uploadFile(n,i,r={}){const s=new FormData;s.set("file",i,i.name);const o=await yn(`${e}/${encodeURIComponent(n)}/files`,{method:"POST",headers:ps(),body:s,signal:r.signal},Vtt);if(!o.ok)throw await Bs(o,Q("sandbox.uploadFileFailed"));const l=await o.json();if(typeof l.id!="string"||typeof l.path!="string"||typeof l.name!="string"||typeof l.mimeType!="string"||typeof l.sizeBytes!="number")throw new Error(Q("sandbox.invalidUploadResult"));return l},async closeSession(n,i={}){if(!n)return;const r=await yn(`${e}/${encodeURIComponent(n)}/disconnect`,{method:"POST",headers:ps(),signal:i.signal},lk);if(!r.ok&&r.status!==404)throw await Bs(r,Q("sandbox.disconnectCodexFailed"))},async deleteSession(n,i={}){if(!n)return;const r=await yn(`${e}/${encodeURIComponent(n)}`,{method:"DELETE",headers:ps(),signal:i.signal},lk);if(!r.ok&&r.status!==404)throw await Bs(r,Q("sandbox.deleteCodexFailed"))}}}const Br=U2e(Utt),Rv=U2e("/web/intelligent-development/sessions",{textOnly:!0,messageTimeoutMs:36e5,interruptTimeoutMs:45e3,intelligentDevelopment:!0});async function oJ(e,t,n,i){const r=await yn(`${e}/${encodeURIComponent(t)}/${n}`,{method:"POST",headers:ps(),signal:i.signal},up);if(!r.ok)throw await Bs(r,Q(n==="terminal"?"sandbox.openSandboxTerminalFailed":"sandbox.openSandboxBrowserFailed"));const s=await r.json();return{url:Q2e(s.url,Q("sandbox.toolLabel")),...typeof s.shellSessionId=="string"?{shellSessionId:s.shellSessionId}:{}}}function Q2e(e,t){if(typeof e!="string")throw new Error(Q("sandbox.invalidToolUrl",{label:t}));if(e.startsWith("/"))return Ta(e);let n;try{n=new URL(e)}catch{throw new Error(Q("sandbox.invalidToolUrl",{label:t}))}const i=n.protocol==="http:"&&window.location.protocol==="http:";if(n.protocol!=="https:"&&!i)throw new Error(Q("sandbox.unsafeToolUrl",{label:t}));return n.toString()}const mu=e=>["succeeded","cancelled","failed"].includes(e.state),z2e="/web/intelligent-development";class Gw extends Error{constructor(t,n){super(t),this.status=n}}async function Gb(e,t="GET",n,i){const r=await yn(`${z2e}${e}`,{method:t,signal:i,headers:ps(n===void 0?void 0:{"Content-Type":"application/json"}),...n===void 0?{}:{body:JSON.stringify(n)}},3e4);if(!r.ok){const s=await r.json().catch(()=>null),o=s==null?void 0:s.detail;throw new Gw(typeof o=="string"?o:(o==null?void 0:o.message)||Q("developmentRuns.requestFailed"),r.status)}return r.json()}function Iv(e){const t=e;if(!t||typeof t.runId!="string"||typeof t.sessionId!="string"||!["queued","running","recovering","waiting_user","stopping","succeeded","cancelled","failed"].includes(t.state))throw new Error(Q("developmentRuns.invalidResponse"));return t}const ef={async active(e){const t=await Gb("/runs","GET",void 0,e);if(!Array.isArray(t.runs))throw new Error(Q("developmentRuns.invalidResponse"));return t.runs.map(Iv)},async get(e,t){return Iv(await Gb(`/runs/${encodeURIComponent(e)}`,"GET",void 0,t))},async list(e,t){const n=await Gb(`/sessions/${encodeURIComponent(e)}/runs`,"GET",void 0,t);if(!Array.isArray(n.runs))throw new Error(Q("developmentRuns.invalidResponse"));return n.runs.map(Iv)},async create(e,t,n){return Iv(await Gb(`/sessions/${encodeURIComponent(e)}/runs`,"POST",{message:t,requestId:n}))},async steer(e,t,n){await Gb(`/runs/${encodeURIComponent(e)}/inputs`,"POST",{message:t,clientId:n})},async stop(e){return Iv(await Gb(`/runs/${encodeURIComponent(e)}/stop`,"POST"))},async resume(e){return Iv(await Gb(`/runs/${encodeURIComponent(e)}/resume`,"POST"))}};class Ztt{constructor(t){Zt(this,"cursor",0);Zt(this,"turns",[]);Zt(this,"activeInput");Zt(this,"itemTurns",new Map);Zt(this,"nativeInputs",new Map);Zt(this,"metrics",new Map);Zt(this,"inputOrder",[]);Zt(this,"projections",new Map);Zt(this,"itemInputs",new Map);this.run=t,this.activeInput=t.requestId}projection(t){let n=this.projections.get(t);if(!n){const i={role:"assistant",blocks:[],meta:{localId:`${t}:assistant`}},r=this.turns.findIndex(s=>{var o;return((o=s.meta)==null?void 0:o.localId)===`${t}:user`});this.turns.splice(r<0?this.turns.length:r+1,0,i),n=B2e({onBlocks:s=>{i.blocks=s.map(o=>({...o,turnId:this.itemTurns.get(o.id||"")}))},onUsage:s=>{i.meta={...i.meta,sandboxUsage:s.usage}}}),this.projections.set(t,n)}return n}apply(t){if(t.payload.runId!==this.run.runId)throw new Error(Q("developmentRuns.invalidResponse"));if(t.seq<=this.cursor)return;if(t.seq!==this.cursor+1)throw new Error(Q("developmentRuns.eventGap"));for(const i of this.turns)i.blocks.some(r=>r.kind==="turn-summary")&&(i.blocks=i.blocks.filter(r=>r.kind!=="turn-summary"));const n=t.payload;if(t.type==="run.input"&&typeof n.clientId=="string"&&typeof n.message=="string")this.turns.push({role:"user",blocks:[{kind:"text",text:n.message}],meta:{localId:`${n.clientId}:user`},activity:{id:`${n.clientId}:delivery`,title:Q(`developmentRuns.input.${String(n.status)}`)}}),this.inputOrder.push(n.clientId),this.projection(n.clientId),n.status==="delivered"&&this.inputOrder.indexOf(n.clientId)>=this.inputOrder.indexOf(this.activeInput)&&(this.activeInput=n.clientId);else if(t.type==="run.input_status"&&typeof n.clientId=="string"){const i=this.turns.find(r=>{var s;return((s=r.meta)==null?void 0:s.localId)===`${n.clientId}:user`});i&&(i.activity={id:`${n.clientId}:delivery`,title:Q(`developmentRuns.input.${String(n.status)}`)}),n.status==="delivered"&&this.inputOrder.indexOf(n.clientId)>=this.inputOrder.indexOf(this.activeInput)&&(this.activeInput=n.clientId)}else if(t.type==="run.turn"&&typeof n.turnId=="string"){const r={...this.metrics.get(n.turnId),turnId:n.turnId,status:String(n.status||"inProgress"),toolCalls:0,toolDurationComplete:!1};for(const s of["startedAt","completedAt","durationMs"])typeof n[s]=="number"&&Number.isFinite(n[s])&&n[s]>=0&&(r[s]=n[s]);if(typeof n.model=="string"&&(r.model=n.model),n.usage&&typeof n.usage=="object"&&!Array.isArray(n.usage)){const s={};for(const o of["totalTokens","inputTokens","outputTokens","cachedInputTokens","cacheWriteInputTokens","reasoningOutputTokens"]){const l=n.usage[o];typeof l=="number"&&Number.isSafeInteger(l)&&l>=0&&(s[o]=l)}r.usage=s}n.usageIncomplete===!0&&(r.usageIncomplete=!0),this.metrics.set(n.turnId,r),this.nativeInputs.set(n.turnId,this.activeInput),this.projection(this.activeInput)}else if(t.type==="run.status"){if(this.run={...this.run,...n},mu(this.run))for(const[i,r]of this.metrics)r.status==="inProgress"&&this.metrics.set(i,{...r,status:"unavailable",usageIncomplete:!0});if(mu(this.run)||this.run.state==="waiting_user")for(const i of this.projections.values())i.consumeFrame(`event: done data: {}`)}else if(!t.type.startsWith("run.")){const i=typeof n.id=="string"&&n.id?n.id:["plan","diff"].includes(t.type)?t.type:"",r=i?`${String(n.turnId||"")}:${i}`:"",s=r&&this.itemInputs.get(r)||this.activeInput;r&&(this.itemInputs.set(r,s),typeof n.turnId=="string"&&this.itemTurns.set(r,n.turnId)),typeof n.turnId=="string"&&this.nativeInputs.set(n.turnId,this.activeInput);const o=t.type==="activity"&&n.kind==="commentary";this.projection(s).consumeFrame(`event: ${o?"delta":t.type} -data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type==="run.input"||t.type==="run.input_status")&&n.status==="delivered"&&typeof n.turnId=="string"&&typeof n.clientId=="string"&&this.nativeInputs.set(n.turnId,n.clientId),this.decorate(),this.cursor=t.seq}decorate(){const t=!pu(this.run)&&this.run.state!=="waiting_user",n=[...this.turns].reverse().find(i=>i.role==="assistant");for(const i of this.turns)i.role==="assistant"&&(i.meta={...i.meta,streaming:t&&i===n});for(const i of this.metrics.values()){if(!["completed","failed","interrupted","cancelled","unavailable"].includes(i.status))continue;const r=new Map;for(const u of this.turns)for(const d of u.blocks)d.kind==="tool"&&d.turnId===i.turnId&&d.id&&r.set(d.id,d);const s=[...r.values()].filter(u=>typeof u.durationMs=="number"&&Number.isFinite(u.durationMs)&&u.durationMs>=0),o={...i,toolCalls:r.size,toolDurationComplete:s.length===r.size,toolDurationMs:s.length||!r.size?s.reduce((u,d)=>u+d.durationMs,0):void 0},l=this.nativeInputs.get(i.turnId),c=this.turns.find(u=>{var d;return((d=u.meta)==null?void 0:d.localId)===`${l}:assistant`});if(c){const u=c.blocks.reduce((d,f,h)=>f.turnId===i.turnId?h:d,-1);c.blocks.splice(u<0?c.blocks.length:u+1,0,{kind:"turn-summary",id:`${i.turnId}:summary`,turnId:i.turnId,value:o})}}}}function Ytt(e,t){return new Promise((n,i)=>{if(t.aborted){i(new DOMException("Aborted","AbortError"));return}const r=()=>{clearTimeout(s),i(new DOMException("Aborted","AbortError"))},s=setTimeout(()=>{t.removeEventListener("abort",r),n()},e);t.addEventListener("abort",r,{once:!0})})}async function Ztt(e,t,n){var c;const i=await yn(`${Q2e}/runs/${encodeURIComponent(e.run.runId)}/events?after=${e.cursor}`,{signal:t,headers:ps({Accept:"text/event-stream"})},0);if(!i.ok)throw new Kw(Q("developmentRuns.requestFailed"),i.status);if(!i.body)throw new Error(Q("developmentRuns.invalidResponse"));const r=i.body.getReader(),s=new TextDecoder;let o="",l=!1;try{for(;;){const{value:u,done:d}=await r.read();o+=s.decode(u,{stream:!d});const f=o.split(/\r?\n\r?\n/);o=f.pop()||"";for(const h of f){const m=h.split(/\r?\n/),g=(c=m.find(y=>y.startsWith("event:")))==null?void 0:c.slice(6).trim();if(g==="done"){l=!0;continue}const b=m.filter(y=>y.startsWith("data:")).map(y=>y.slice(5).trimStart()).join(` -`);if(!g||!b)continue;const v=JSON.parse(b);if(!Number.isSafeInteger(v.seq))throw new Error(Q("developmentRuns.invalidResponse"));e.apply({seq:v.seq,type:g,payload:v})}if(n(),d)break}if(!l)throw new Error(Q("developmentRuns.reconnecting"))}finally{await r.cancel().catch(()=>{}),r.releaseLock()}}async function Jtt(e,t,n,i,r){const s=new Map;let o=0;const l=new Map;let c;r==null||r(h=>{t.aborted||h.sessionId!==e||(l.set(h.runId,h),c==null||c())});const u=h=>new Promise(m=>{const g=()=>{clearTimeout(b),t.removeEventListener("abort",g),c=void 0,m()},b=setTimeout(g,h);c=g,t.addEventListener("abort",g,{once:!0}),(t.aborted||l.size)&&g()}),d=new Map,f=()=>{var m;if(t.aborted)return;const h=[...s.values()];n(h.flatMap(g=>{let b=d.get(g);return(!b||b.cursor!==g.cursor)&&(b={cursor:g.cursor,turns:g.turns.map(v=>({...v}))},d.set(g,b)),b.turns}),((m=h[h.length-1])==null?void 0:m.run)||null)};for(;!t.aborted;)try{const h=l.size?[]:await Jd.list(e,t),m=[...new Map([...h,...l.values()].map(g=>[g.runId,g])).values()];l.clear();for(const g of m){let b=s.get(g.runId);if(b||(b=new Xtt(g),s.set(g.runId,b)),b.cursor>=g.lastSeq&&(b.run=g),b.cursor{o=0,i(""),f()})}catch(v){if(!(v instanceof Kw&&v.status===404&&pu(g)))throw v}}o=0,i(""),f(),await u(1500)}catch(h){if(t.aborted)return;if(h instanceof Kw&&[401,403,404].includes(h.status))throw h;i(Q("developmentRuns.reconnecting")),await Ytt(Math.min(1e3*2**o++,15e3),t)}}function ent({sessionId:e,ownerId:t,onTurns:n,onBusy:i}){const[r,s]=p.useState(null),[o,l]=p.useState(""),[c,u]=p.useState(""),[d,f]=p.useState(!1),[h,m]=p.useState(!1),g=p.useRef({onTurns:n,onBusy:i});g.current={onTurns:n,onBusy:i};const b=p.useRef(0),v=p.useRef([]),y=p.useRef([]),w=p.useRef(null),x=()=>{const A=new Set(v.current.map(N=>{var P;return(P=N.meta)==null?void 0:P.localId}));y.current=y.current.filter(N=>{var P;return!A.has((P=N.meta)==null?void 0:P.localId)}),g.current.onTurns([...v.current,...y.current])},O=p.useRef(!1),k=p.useRef(!1),S=p.useRef(null),C=p.useRef({sessionId:e,ownerId:t});C.current={sessionId:e,ownerId:t},p.useEffect(()=>{b.current+=1,s(null),u(""),l(""),v.current=[],w.current=null;const A=S.current;if(((A==null?void 0:A.session)!==e||A.owner!==t)&&(y.current=[],m(!1),k.current=!1,S.current=null,O.current=!1,f(!1)),e&&x(),!e||!t)return;const N=new AbortController,P=()=>!N.signal.aborted&&C.current.sessionId===e&&C.current.ownerId===t;return Jtt(e,N.signal,(I,D)=>{P()&&(v.current=I,x(),s(D),g.current.onBusy(O.current||!!(D&&!pu(D))),D&&pu(D)&&(m(!1),k.current=!1))},I=>{P()&&l(I)},I=>{P()&&(w.current=I)}).catch(I=>{P()&&u(I instanceof Error?I.message:String(I))}),()=>N.abort()},[e,t]);function E(A,N=e){const P=C.current.ownerId;let I=S.current;return(!I||I.session!==N||I.owner!==P||I.text!==A)&&(I={session:N,owner:P,text:A,id:crypto.randomUUID()},S.current=I),y.current.some(D=>{var _;return((_=D.meta)==null?void 0:_.localId)===`${I.id}:user`})||y.current.push({role:"user",blocks:[{kind:"text",text:A}],meta:{localId:`${I.id}:user`}},{role:"assistant",blocks:[{kind:"progress",text:Q(r&&!pu(r)?"developmentRuns.processing":"developmentRuns.preparing")}],meta:{localId:`${I.id}:assistant`}}),[...y.current]}async function j(A,N=e){var L;if(!A.trim()||O.current||k.current)return!1;O.current=!0,f(!0),u("");const P=C.current.ownerId,I=()=>C.current.ownerId===P&&C.current.sessionId===N;E(A,N),x(),g.current.onBusy(!0);const D=S.current,_=(D==null?void 0:D.session)===N&&D.owner===P&&D.text===A?D:{session:N,owner:P,text:A,id:crypto.randomUUID(),runId:void 0,stopRequested:!1};S.current=_;try{const F=await Jd.list(N),M=F[F.length-1];if(!I())return!1;!_.runId&&M&&!pu(M)&&M.requestId!==_.id&&(_.runId=M.runId);let V;return _.runId?(await Jd.steer(_.runId,A,_.id),V=await Jd.get(_.runId)):V=await Jd.create(N,A,_.id),(_.stopRequested||I()&&k.current)&&(V=await Jd.stop(V.runId)),I()&&(s(V),(L=w.current)==null||L.call(w,V),g.current.onBusy(!pu(V)),S.current=null),!0}catch(F){return I()&&(g.current.onBusy(!!(r&&!pu(r))),u(F instanceof Error?F.message:String(F)),_.stopRequested&&(k.current=!1,m(!1))),!1}finally{I()&&(O.current=!1,f(!1))}}async function T(){k.current=!0,m(!0),u(""),S.current&&(S.current.stopRequested=!0);const A=b.current;try{const P=(await Jd.list(e)).find(I=>!pu(I));if(P){const I=await Jd.stop(P.runId);A===b.current&&s(I)}else!O.current&&A===b.current&&(k.current=!1,m(!1))}catch(N){A===b.current&&(u(N instanceof Error?N.message:String(N)),m(!1),k.current=!1)}}async function R(){if(!r)return;const A=b.current;try{const N=await Jd.resume(r.runId);A===b.current&&(s(N),u(""))}catch(N){A===b.current&&u(N instanceof Error?N.message:String(N))}}return{run:r,connection:o,error:c,submitting:d,stopPending:h,prepare:E,submit:j,stop:T,resume:R}}function oJ(e){return e?["stopping","waiting_user","failed","cancelled"].includes(e.state)?e.statusMessage:e.phase==="reporting"?Q("developmentRuns.reporting"):e.state==="recovering"?e.statusMessage:["outcome_read","delivery"].includes(e.phase)?Q("developmentRuns.packaging"):e.phase==="version"?Q("developmentRuns.savingVersion"):e.phase==="cycle_complete"?Q("developmentRuns.finishing"):e.statusMessage:""}function z2e(e){if(e==null||!Number.isFinite(e)||e<0)return Q("developmentRuns.notReported");const t=Math.round(e);if(t===0)return`<${Q("developmentRuns.durationUnits.milliseconds",{value:"1"})}`;if(t<1e3)return Q("developmentRuns.durationUnits.milliseconds",{value:t.toLocaleString(j8())});const n=Math.round(t/100);return[["hours",Math.floor(n/36e3)],["minutes",Math.floor(n%36e3/600)],["seconds",n%600/10]].filter(([,r])=>r>0).map(([r,s])=>Q(`developmentRuns.durationUnits.${r}`,{value:s.toLocaleString(j8(),{maximumFractionDigits:1})})).join(" ")}const C3=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},lJ=e=>typeof e=="string"?e.replace(/\s+/g," ").trim().slice(0,160):"";function V2e(e){var n;const t=C3(e.args);if(e.itemType==="dynamicToolCall"&&e.name==="submit_build_result")return Q("developmentRuns.submitResult");if(e.itemType==="commandExecution"){const i=Array.isArray(t.commandActions)?t.commandActions.map(C3):[],r=new Set(i.map(c=>c.type));if(i.length&&r.size===1){if(r.has("read"))return Q("developmentRuns.read",{target:"Read project files"});if(r.has("listFiles"))return Q("developmentRuns.listFiles",{target:"List directory"});if(r.has("search"))return Q("developmentRuns.search",{target:"Search project files"})}const s=typeof t.command=="string"?t.command:"",l=(n=[[/\b(?:pytest|vitest|jest)\b|\b(?:npm|pnpm|yarn) (?:run )?test\b/,"Run tests"],[/\b(?:npm|pnpm|yarn) (?:ci|install|add)\b|\b(?:pip|pip3|uv pip) install\b|\buv sync\b/,"Install dependencies"],[/\b(?:ruff|eslint|prettier|pyright|tsc)\b/,"Check code quality"],[/\b(?:npm|pnpm|yarn) (?:run )?build\b|\bpython[^;]* -m build\b/,"Build project"],[/\bgit (?:status|diff|log|show)\b/,"Inspect Git changes"],[/\bgit (?:add|commit)\b/,"Save Git changes"],[/\b(?:curl|wget)\b/,"Send HTTP request"],[/\bcompileall\b/,"Check Python syntax"]].find(([c])=>c.test(s)))==null?void 0:n[1];return l?Q("developmentRuns.command",{target:l}):e.name}if(e.itemType==="fileChange"){const i=Array.isArray(t.changes)?t.changes.map(r=>lJ(C3(r).path)).filter(Boolean):[];return Q("developmentRuns.editFiles",{target:i.join(", ")})}return e.itemType==="webSearch"?Q("developmentRuns.webSearch",{target:lJ(t.query)}):e.name}const tnt=e=>["tool","thinking","plan","diff"].includes(e.kind);function nnt(e){const t=[];return e.forEach((n,i)=>{if(n.kind==="progress")return;const r=tnt(n),s=t[t.length-1];r&&(s!=null&&s.process)?s.blocks.push(n):t.push({id:n.id||`${n.kind}:${i}`,process:r,blocks:[n]})}),t}const cJ="M 15 15 C 15 5, 25 5, 30 15 C 35 25, 45 25, 45 15 C 45 5, 35 5, 30 15 C 25 25, 15 25, 15 15";function u0({variant:e="infinity",size:t=e==="ring"?20:32,label:n="加载中",decorative:i=!1,className:r="",style:s}){const o=SD(),l=typeof t=="number"?t/2:`calc(${t} / 2)`,c=typeof t=="number"?t*3/40:`calc(${t} * 3 / 40)`;return a.jsxs("span",{className:`studio-loading studio-loading--${e} ${r}`.trim(),style:s,role:i?void 0:"status","aria-live":i?void 0:"polite","aria-hidden":i||void 0,children:[e==="infinity"?a.jsxs("svg",{className:"studio-loading__infinity",width:typeof t=="number"?t:void 0,height:typeof l=="number"?l:void 0,style:typeof t=="string"?{width:t,height:l}:void 0,viewBox:"0 0 60 30",fill:"none","aria-hidden":"true",children:[a.jsx("path",{className:"studio-loading__track",d:cJ,strokeWidth:"4",strokeLinecap:"round"}),a.jsx(Cr.path,{className:"studio-loading__path",d:cJ,strokeWidth:"4",strokeLinecap:"round",strokeDasharray:o?void 0:"100",initial:{strokeDashoffset:100},animate:{strokeDashoffset:o?0:[100,-100]},transition:{duration:o?0:2,repeat:o?0:1/0,ease:"linear"}})]}):a.jsx(Cr.div,{className:"studio-loading__ring",style:{width:t,height:t,borderWidth:c},"aria-hidden":"true",animate:{rotate:o?0:360},transition:{duration:o?0:1,repeat:o?0:1/0,ease:"linear"}}),!i&&a.jsx("span",{className:"studio-loading__label",children:n})]})}function Wi({className:e="",type:t="button",variant:n="primary",size:i="default",startIcon:r,endIcon:s,iconOnly:o=!1,hoverEffect:l="background",loading:c=!1,disabled:u,children:d,...f}){return a.jsxs("button",{...f,type:t,disabled:u||c,"aria-busy":c||f["aria-busy"],"data-hover-effect":o?l:void 0,className:`studio-button studio-button--${n} studio-button--size-${i}${o?" studio-button--icon-only":""}${c?" studio-button--loading":""} ${e}`.trim(),children:[r&&a.jsx("span",{className:"studio-button__icon","aria-hidden":"true",children:r}),!o&&a.jsx("span",{className:"studio-button__label",children:d}),!o&&s&&a.jsx("span",{className:"studio-button__icon studio-button__end-icon","aria-hidden":"true",children:s}),c&&a.jsx("span",{className:"studio-button__loading","aria-hidden":"true",children:a.jsx(u0,{variant:"ring",size:"var(--studio-button-icon-size)",decorative:!0})})]})}function int({variant:e,...t}){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:e==="warning"?a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"m10.3 4.5-7.6 13a2 2 0 0 0 1.7 3h15.2a2 2 0 0 0 1.7-3l-7.6-13a2 2 0 0 0-3.4 0Z"}),a.jsx("path",{d:"M12 9v4m0 3.5h.01"})]}):a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"12",cy:"12",r:"8.5"}),e==="success"?a.jsx("path",{d:"m8 12 2.7 2.7L16 9.4"}):e==="error"?a.jsx("path",{d:"m9.2 9.2 5.6 5.6m0-5.6-5.6 5.6"}):a.jsx("path",{d:"M12 11v5m0-8h.01"})]})})}function rnt(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m7 7 10 10M17 7 7 17"})})}function snt({variant:e="info",title:t,description:n,action:i,onDismiss:r,closeLabel:s="关闭通知",className:o="",role:l="status",...c}){return a.jsxs("div",{...c,role:l,className:`studio-toast ${o}`.trim(),"data-variant":e,children:[a.jsx(int,{variant:e,className:"studio-toast__status"}),a.jsxs("div",{className:"studio-toast__content",children:[t!=null&&a.jsx("div",{className:"studio-toast__title",children:t}),n!=null&&a.jsx("div",{className:"studio-toast__description",children:n}),i!=null&&a.jsx("div",{className:"studio-toast__action",children:i})]}),r&&a.jsx(Wi,{variant:"ghost",iconOnly:!0,startIcon:a.jsx(rnt,{}),"aria-label":s,onClick:r,className:"studio-toast__close"})]})}function Bz(){}const ant=Object.freeze([]),nc=Object.freeze({});function $D(e){p.useEffect(e,ant)}const uJ={};function Ed(e,t){const n=p.useRef(uJ);return n.current===uJ&&(n.current=e(t)),n}const ont=()=>{},Jn=typeof document<"u"?p.useLayoutEffect:ont;function lnt(e,t){return function(i,...r){const s=new URL(e);return s.searchParams.set("code",i.toString()),r.forEach(o=>s.searchParams.append("args[]",o)),`${t} error #${i}; visit ${s} for the full message.`}}const Vc=lnt("https://base-ui.com/production-error","Base UI"),H2e=p.createContext(void 0);function Uz(){const e=p.useContext(H2e);if(!e)throw new Error(Vc(73));return e}var q2e={exports:{}},W2e={};/** +data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type==="run.input"||t.type==="run.input_status")&&n.status==="delivered"&&typeof n.turnId=="string"&&typeof n.clientId=="string"&&this.nativeInputs.set(n.turnId,n.clientId),this.decorate(),this.cursor=t.seq}decorate(){const t=!mu(this.run)&&this.run.state!=="waiting_user",n=[...this.turns].reverse().find(i=>i.role==="assistant");for(const i of this.turns)i.role==="assistant"&&(i.meta={...i.meta,streaming:t&&i===n});for(const i of this.metrics.values()){if(!["completed","failed","interrupted","cancelled","unavailable"].includes(i.status))continue;const r=new Map;for(const u of this.turns)for(const d of u.blocks)d.kind==="tool"&&d.turnId===i.turnId&&d.id&&r.set(d.id,d);const s=[...r.values()].filter(u=>typeof u.durationMs=="number"&&Number.isFinite(u.durationMs)&&u.durationMs>=0),o={...i,toolCalls:r.size,toolDurationComplete:s.length===r.size,toolDurationMs:s.length||!r.size?s.reduce((u,d)=>u+d.durationMs,0):void 0},l=this.nativeInputs.get(i.turnId),c=this.turns.find(u=>{var d;return((d=u.meta)==null?void 0:d.localId)===`${l}:assistant`});if(c){const u=c.blocks.reduce((d,f,h)=>f.turnId===i.turnId?h:d,-1);c.blocks.splice(u<0?c.blocks.length:u+1,0,{kind:"turn-summary",id:`${i.turnId}:summary`,turnId:i.turnId,value:o})}}}}function Jtt(e,t){return new Promise((n,i)=>{if(t.aborted){i(new DOMException("Aborted","AbortError"));return}const r=()=>{clearTimeout(s),i(new DOMException("Aborted","AbortError"))},s=setTimeout(()=>{t.removeEventListener("abort",r),n()},e);t.addEventListener("abort",r,{once:!0})})}async function ent(e,t,n){var c;const i=await yn(`${z2e}/runs/${encodeURIComponent(e.run.runId)}/events?after=${e.cursor}`,{signal:t,headers:ps({Accept:"text/event-stream"})},0);if(!i.ok)throw new Gw(Q("developmentRuns.requestFailed"),i.status);if(!i.body)throw new Error(Q("developmentRuns.invalidResponse"));const r=i.body.getReader(),s=new TextDecoder;let o="",l=!1;try{for(;;){const{value:u,done:d}=await r.read();o+=s.decode(u,{stream:!d});const f=o.split(/\r?\n\r?\n/);o=f.pop()||"";for(const h of f){const m=h.split(/\r?\n/),g=(c=m.find(y=>y.startsWith("event:")))==null?void 0:c.slice(6).trim();if(g==="done"){l=!0;continue}const b=m.filter(y=>y.startsWith("data:")).map(y=>y.slice(5).trimStart()).join(` +`);if(!g||!b)continue;const v=JSON.parse(b);if(!Number.isSafeInteger(v.seq))throw new Error(Q("developmentRuns.invalidResponse"));e.apply({seq:v.seq,type:g,payload:v})}if(n(),d)break}if(!l)throw new Error(Q("developmentRuns.reconnecting"))}finally{await r.cancel().catch(()=>{}),r.releaseLock()}}async function tnt(e,t,n,i,r){const s=new Map;let o=0;const l=new Map;let c;r==null||r(h=>{t.aborted||h.sessionId!==e||(l.set(h.runId,h),c==null||c())});const u=h=>new Promise(m=>{const g=()=>{clearTimeout(b),t.removeEventListener("abort",g),c=void 0,m()},b=setTimeout(g,h);c=g,t.addEventListener("abort",g,{once:!0}),(t.aborted||l.size)&&g()}),d=new Map,f=()=>{var m;if(t.aborted)return;const h=[...s.values()];n(h.flatMap(g=>{let b=d.get(g);return(!b||b.cursor!==g.cursor)&&(b={cursor:g.cursor,turns:g.turns.map(v=>({...v}))},d.set(g,b)),b.turns}),((m=h[h.length-1])==null?void 0:m.run)||null)};for(;!t.aborted;)try{const h=l.size?[]:await ef.list(e,t),m=[...new Map([...h,...l.values()].map(g=>[g.runId,g])).values()];l.clear();for(const g of m){let b=s.get(g.runId);if(b||(b=new Ztt(g),s.set(g.runId,b)),b.cursor>=g.lastSeq&&(b.run=g),b.cursor{o=0,i(""),f()})}catch(v){if(!(v instanceof Gw&&v.status===404&&mu(g)))throw v}}o=0,i(""),f(),await u(1500)}catch(h){if(t.aborted)return;if(h instanceof Gw&&[401,403,404].includes(h.status))throw h;i(Q("developmentRuns.reconnecting")),await Jtt(Math.min(1e3*2**o++,15e3),t)}}function nnt({sessionId:e,ownerId:t,onTurns:n,onBusy:i}){const[r,s]=p.useState(null),[o,l]=p.useState(""),[c,u]=p.useState(""),[d,f]=p.useState(!1),[h,m]=p.useState(!1),g=p.useRef({onTurns:n,onBusy:i});g.current={onTurns:n,onBusy:i};const b=p.useRef(0),v=p.useRef([]),y=p.useRef([]),w=p.useRef(null),x=()=>{const A=new Set(v.current.map(N=>{var D;return(D=N.meta)==null?void 0:D.localId}));y.current=y.current.filter(N=>{var D;return!A.has((D=N.meta)==null?void 0:D.localId)}),g.current.onTurns([...v.current,...y.current])},O=p.useRef(!1),k=p.useRef(!1),S=p.useRef(null),C=p.useRef({sessionId:e,ownerId:t});C.current={sessionId:e,ownerId:t},p.useEffect(()=>{b.current+=1,s(null),u(""),l(""),v.current=[],w.current=null;const A=S.current;if(((A==null?void 0:A.session)!==e||A.owner!==t)&&(y.current=[],m(!1),k.current=!1,S.current=null,O.current=!1,f(!1)),e&&x(),!e||!t)return;const N=new AbortController,D=()=>!N.signal.aborted&&C.current.sessionId===e&&C.current.ownerId===t;return tnt(e,N.signal,(I,P)=>{D()&&(v.current=I,x(),s(P),g.current.onBusy(O.current||!!(P&&!mu(P))),P&&mu(P)&&(m(!1),k.current=!1))},I=>{D()&&l(I)},I=>{D()&&(w.current=I)}).catch(I=>{D()&&u(I instanceof Error?I.message:String(I))}),()=>N.abort()},[e,t]);function E(A,N=e){const D=C.current.ownerId;let I=S.current;return(!I||I.session!==N||I.owner!==D||I.text!==A)&&(I={session:N,owner:D,text:A,id:crypto.randomUUID()},S.current=I),y.current.some(P=>{var _;return((_=P.meta)==null?void 0:_.localId)===`${I.id}:user`})||y.current.push({role:"user",blocks:[{kind:"text",text:A}],meta:{localId:`${I.id}:user`}},{role:"assistant",blocks:[{kind:"progress",text:Q(r&&!mu(r)?"developmentRuns.processing":"developmentRuns.preparing")}],meta:{localId:`${I.id}:assistant`}}),[...y.current]}async function j(A,N=e){var L;if(!A.trim()||O.current||k.current)return!1;O.current=!0,f(!0),u("");const D=C.current.ownerId,I=()=>C.current.ownerId===D&&C.current.sessionId===N;E(A,N),x(),g.current.onBusy(!0);const P=S.current,_=(P==null?void 0:P.session)===N&&P.owner===D&&P.text===A?P:{session:N,owner:D,text:A,id:crypto.randomUUID(),runId:void 0,stopRequested:!1};S.current=_;try{const F=await ef.list(N),M=F[F.length-1];if(!I())return!1;!_.runId&&M&&!mu(M)&&M.requestId!==_.id&&(_.runId=M.runId);let V;return _.runId?(await ef.steer(_.runId,A,_.id),V=await ef.get(_.runId)):V=await ef.create(N,A,_.id),(_.stopRequested||I()&&k.current)&&(V=await ef.stop(V.runId)),I()&&(s(V),(L=w.current)==null||L.call(w,V),g.current.onBusy(!mu(V)),S.current=null),!0}catch(F){return I()&&(g.current.onBusy(!!(r&&!mu(r))),u(F instanceof Error?F.message:String(F)),_.stopRequested&&(k.current=!1,m(!1))),!1}finally{I()&&(O.current=!1,f(!1))}}async function T(){k.current=!0,m(!0),u(""),S.current&&(S.current.stopRequested=!0);const A=b.current;try{const D=(await ef.list(e)).find(I=>!mu(I));if(D){const I=await ef.stop(D.runId);A===b.current&&s(I)}else!O.current&&A===b.current&&(k.current=!1,m(!1))}catch(N){A===b.current&&(u(N instanceof Error?N.message:String(N)),m(!1),k.current=!1)}}async function R(){if(!r)return;const A=b.current;try{const N=await ef.resume(r.runId);A===b.current&&(s(N),u(""))}catch(N){A===b.current&&u(N instanceof Error?N.message:String(N))}}return{run:r,connection:o,error:c,submitting:d,stopPending:h,prepare:E,submit:j,stop:T,resume:R}}function lJ(e){return e?["stopping","waiting_user","failed","cancelled"].includes(e.state)?e.statusMessage:e.phase==="reporting"?Q("developmentRuns.reporting"):e.state==="recovering"?e.statusMessage:["outcome_read","delivery"].includes(e.phase)?Q("developmentRuns.packaging"):e.phase==="version"?Q("developmentRuns.savingVersion"):e.phase==="cycle_complete"?Q("developmentRuns.finishing"):e.statusMessage:""}function V2e(e){if(e==null||!Number.isFinite(e)||e<0)return Q("developmentRuns.notReported");const t=Math.round(e);if(t===0)return`<${Q("developmentRuns.durationUnits.milliseconds",{value:"1"})}`;if(t<1e3)return Q("developmentRuns.durationUnits.milliseconds",{value:t.toLocaleString(N8())});const n=Math.round(t/100);return[["hours",Math.floor(n/36e3)],["minutes",Math.floor(n%36e3/600)],["seconds",n%600/10]].filter(([,r])=>r>0).map(([r,s])=>Q(`developmentRuns.durationUnits.${r}`,{value:s.toLocaleString(N8(),{maximumFractionDigits:1})})).join(" ")}const A3=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},cJ=e=>typeof e=="string"?e.replace(/\s+/g," ").trim().slice(0,160):"";function H2e(e){var n;const t=A3(e.args);if(e.itemType==="dynamicToolCall"&&e.name==="submit_build_result")return Q("developmentRuns.submitResult");if(e.itemType==="commandExecution"){const i=Array.isArray(t.commandActions)?t.commandActions.map(A3):[],r=new Set(i.map(c=>c.type));if(i.length&&r.size===1){if(r.has("read"))return Q("developmentRuns.read",{target:"Read project files"});if(r.has("listFiles"))return Q("developmentRuns.listFiles",{target:"List directory"});if(r.has("search"))return Q("developmentRuns.search",{target:"Search project files"})}const s=typeof t.command=="string"?t.command:"",l=(n=[[/\b(?:pytest|vitest|jest)\b|\b(?:npm|pnpm|yarn) (?:run )?test\b/,"Run tests"],[/\b(?:npm|pnpm|yarn) (?:ci|install|add)\b|\b(?:pip|pip3|uv pip) install\b|\buv sync\b/,"Install dependencies"],[/\b(?:ruff|eslint|prettier|pyright|tsc)\b/,"Check code quality"],[/\b(?:npm|pnpm|yarn) (?:run )?build\b|\bpython[^;]* -m build\b/,"Build project"],[/\bgit (?:status|diff|log|show)\b/,"Inspect Git changes"],[/\bgit (?:add|commit)\b/,"Save Git changes"],[/\b(?:curl|wget)\b/,"Send HTTP request"],[/\bcompileall\b/,"Check Python syntax"]].find(([c])=>c.test(s)))==null?void 0:n[1];return l?Q("developmentRuns.command",{target:l}):e.name}if(e.itemType==="fileChange"){const i=Array.isArray(t.changes)?t.changes.map(r=>cJ(A3(r).path)).filter(Boolean):[];return Q("developmentRuns.editFiles",{target:i.join(", ")})}return e.itemType==="webSearch"?Q("developmentRuns.webSearch",{target:cJ(t.query)}):e.name}const int=e=>["tool","thinking","plan","diff"].includes(e.kind);function rnt(e){const t=[];return e.forEach((n,i)=>{if(n.kind==="progress")return;const r=int(n),s=t[t.length-1];r&&(s!=null&&s.process)?s.blocks.push(n):t.push({id:n.id||`${n.kind}:${i}`,process:r,blocks:[n]})}),t}const uJ="M 15 15 C 15 5, 25 5, 30 15 C 35 25, 45 25, 45 15 C 45 5, 35 5, 30 15 C 25 25, 15 25, 15 15";function d0({variant:e="infinity",size:t=e==="ring"?20:32,label:n="加载中",decorative:i=!1,className:r="",style:s}){const o=SD(),l=typeof t=="number"?t/2:`calc(${t} / 2)`,c=typeof t=="number"?t*3/40:`calc(${t} * 3 / 40)`;return a.jsxs("span",{className:`studio-loading studio-loading--${e} ${r}`.trim(),style:s,role:i?void 0:"status","aria-live":i?void 0:"polite","aria-hidden":i||void 0,children:[e==="infinity"?a.jsxs("svg",{className:"studio-loading__infinity",width:typeof t=="number"?t:void 0,height:typeof l=="number"?l:void 0,style:typeof t=="string"?{width:t,height:l}:void 0,viewBox:"0 0 60 30",fill:"none","aria-hidden":"true",children:[a.jsx("path",{className:"studio-loading__track",d:uJ,strokeWidth:"4",strokeLinecap:"round"}),a.jsx(Cr.path,{className:"studio-loading__path",d:uJ,strokeWidth:"4",strokeLinecap:"round",strokeDasharray:o?void 0:"100",initial:{strokeDashoffset:100},animate:{strokeDashoffset:o?0:[100,-100]},transition:{duration:o?0:2,repeat:o?0:1/0,ease:"linear"}})]}):a.jsx(Cr.div,{className:"studio-loading__ring",style:{width:t,height:t,borderWidth:c},"aria-hidden":"true",animate:{rotate:o?0:360},transition:{duration:o?0:1,repeat:o?0:1/0,ease:"linear"}}),!i&&a.jsx("span",{className:"studio-loading__label",children:n})]})}function Ci({className:e="",type:t="button",variant:n="primary",size:i="default",startIcon:r,endIcon:s,iconOnly:o=!1,hoverEffect:l="background",loading:c=!1,disabled:u,children:d,...f}){return a.jsxs("button",{...f,type:t,disabled:u||c,"aria-busy":c||f["aria-busy"],"data-hover-effect":o?l:void 0,className:`studio-button studio-button--${n} studio-button--size-${i}${o?" studio-button--icon-only":""}${c?" studio-button--loading":""} ${e}`.trim(),children:[r&&a.jsx("span",{className:"studio-button__icon","aria-hidden":"true",children:r}),!o&&a.jsx("span",{className:"studio-button__label",children:d}),!o&&s&&a.jsx("span",{className:"studio-button__icon studio-button__end-icon","aria-hidden":"true",children:s}),c&&a.jsx("span",{className:"studio-button__loading","aria-hidden":"true",children:a.jsx(d0,{variant:"ring",size:"var(--studio-button-icon-size)",decorative:!0})})]})}function snt({variant:e,...t}){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:e==="warning"?a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"m10.3 4.5-7.6 13a2 2 0 0 0 1.7 3h15.2a2 2 0 0 0 1.7-3l-7.6-13a2 2 0 0 0-3.4 0Z"}),a.jsx("path",{d:"M12 9v4m0 3.5h.01"})]}):a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"12",cy:"12",r:"8.5"}),e==="success"?a.jsx("path",{d:"m8 12 2.7 2.7L16 9.4"}):e==="error"?a.jsx("path",{d:"m9.2 9.2 5.6 5.6m0-5.6-5.6 5.6"}):a.jsx("path",{d:"M12 11v5m0-8h.01"})]})})}function ant(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m7 7 10 10M17 7 7 17"})})}function ont({variant:e="info",title:t,description:n,action:i,onDismiss:r,closeLabel:s="关闭通知",className:o="",role:l="status",...c}){return a.jsxs("div",{...c,role:l,className:`studio-toast ${o}`.trim(),"data-variant":e,children:[a.jsx(snt,{variant:e,className:"studio-toast__status"}),a.jsxs("div",{className:"studio-toast__content",children:[t!=null&&a.jsx("div",{className:"studio-toast__title",children:t}),n!=null&&a.jsx("div",{className:"studio-toast__description",children:n}),i!=null&&a.jsx("div",{className:"studio-toast__action",children:i})]}),r&&a.jsx(Ci,{variant:"ghost",iconOnly:!0,startIcon:a.jsx(ant,{}),"aria-label":s,onClick:r,className:"studio-toast__close"})]})}function Uz(){}const lnt=Object.freeze([]),nc=Object.freeze({});function $D(e){p.useEffect(e,lnt)}const dJ={};function Ad(e,t){const n=p.useRef(dJ);return n.current===dJ&&(n.current=e(t)),n}const cnt=()=>{},Jn=typeof document<"u"?p.useLayoutEffect:cnt;function unt(e,t){return function(i,...r){const s=new URL(e);return s.searchParams.set("code",i.toString()),r.forEach(o=>s.searchParams.append("args[]",o)),`${t} error #${i}; visit ${s} for the full message.`}}const Hc=unt("https://base-ui.com/production-error","Base UI"),q2e=p.createContext(void 0);function Qz(){const e=p.useContext(q2e);if(!e)throw new Error(Hc(73));return e}var W2e={exports:{}},K2e={};/** * @license React * use-sync-external-store-shim/with-selector.production.js * @@ -137,113 +137,113 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var FD=p,cnt=ZP;function unt(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var dnt=typeof Object.is=="function"?Object.is:unt,fnt=cnt.useSyncExternalStore,hnt=FD.useRef,pnt=FD.useEffect,mnt=FD.useMemo,gnt=FD.useDebugValue;W2e.useSyncExternalStoreWithSelector=function(e,t,n,i,r){var s=hnt(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=mnt(function(){function c(m){if(!u){if(u=!0,d=m,m=i(m),r!==void 0&&o.hasValue){var g=o.value;if(r(g,m))return f=g}return f=m}if(g=f,dnt(d,m))return g;var b=i(m);return r!==void 0&&r(g,b)?(d=m,g):(d=m,f=b)}var u=!1,d,f,h=n===void 0?null:n;return[function(){return c(t())},h===null?void 0:function(){return c(h())}]},[t,n,i,r]);var l=fnt(e,s[0],s[1]);return pnt(function(){o.hasValue=!0,o.value=l},[l]),gnt(l),l};q2e.exports=W2e;var K2e=q2e.exports;const bnt=T1(K2e),ynt=parseInt(p.version,10);function Qz(e){return ynt>=e}const vnt=Qz(19),xnt=vnt?Ont:knt;function G2e(e,t,n,i,r){return xnt(e,t,n,i,r)}function wnt(e,t,n,i,r){const s=p.useCallback(()=>t(e.getSnapshot(),n,i,r),[e,t,n,i,r]);return ZP.useSyncExternalStore(e.subscribe,s,s)}function Ont(e,t,n,i,r){return wnt(e,t,n,i,r)}function knt(e,t,n,i,r){return K2e.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,i,r))}class Snt{constructor(t){Zt(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));Zt(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const i of this.listeners){if(n!==this.updateTick)return;i(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,i,r){return G2e(this,t,n,i,r)}}const zz={...I0},A3=zz.useInsertionEffect,Ent=A3&&A3!==zz.useLayoutEffect?A3:e=>e();function ci(e){const t=Ed(Cnt).current;return t.next=e,Ent(t.effect),t.trampoline}function Cnt(){const e={next:void 0,callback:Ant,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function Ant(){}class BD extends Snt{constructor(t,n={},i){super(t),this.context=n,this.selectors=i}useSyncedValue(t,n){p.useDebugValue(t);const i=this;Jn(()=>{i.state[t]!==n&&i.set(t,n)},[i,t,n])}useSyncedValueWithCleanup(t,n){const i=this;Jn(()=>(i.state[t]!==n&&i.set(t,n),()=>{i.set(t,void 0)}),[i,t,n])}useSyncedValues(t){const n=this,i=Object.values(t);Jn(()=>{n.update(t)},[n,...i])}useControlledProp(t,n){p.useDebugValue(t);const i=this,r=n!==void 0;Jn(()=>{r&&!Object.is(i.state[t],n)&&i.setState({...i.state,[t]:n})},[i,t,n,r])}select(t,n,i,r){const s=this.selectors[t];return s(this.state,n,i,r)}useState(t,n,i,r){return p.useDebugValue(t),G2e(this,this.selectors[t],n,i,r)}useContextCallback(t,n){p.useDebugValue(t);const i=ci(n??Bz);this.context[t]=i}useStateSetter(t){const n=p.useRef(void 0);return n.current===void 0&&(n.current=i=>{this.set(t,i)}),n.current}observe(t,n){let i;typeof t=="function"?i=t:i=this.selectors[t];let r=i(this.state);return n(r,r,this),this.subscribe(s=>{const o=i(s);if(!Object.is(r,o)){const l=r;r=o,n(o,l,this)}})}}function UD(){return typeof window<"u"}function ll(e){return Vz(e)?(e.nodeName||"").toLowerCase():"#document"}function ta(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function fm(e){var t;return(t=(Vz(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Vz(e){return UD()?e instanceof Node||e instanceof ta(e).Node:!1}function Er(e){return UD()?e instanceof Element||e instanceof ta(e).Element:!1}function Js(e){return UD()?e instanceof HTMLElement||e instanceof ta(e).HTMLElement:!1}function Gw(e){return!UD()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ta(e).ShadowRoot}function UA(e){const{overflow:t,overflowX:n,overflowY:i,display:r}=Mu(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&r!=="inline"&&r!=="contents"}function Tnt(e){return/^(table|td|th)$/.test(ll(e))}function QD(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const _nt=/transform|translate|scale|rotate|perspective|filter/,jnt=/paint|layout|strict|content/,Gb=e=>!!e&&e!=="none";let T3;function Hz(e){const t=Er(e)?Mu(e):e;return Gb(t.transform)||Gb(t.translate)||Gb(t.scale)||Gb(t.rotate)||Gb(t.perspective)||!qz()&&(Gb(t.backdropFilter)||Gb(t.filter))||_nt.test(t.willChange||"")||jnt.test(t.contain||"")}function Nnt(e){let t=Xg(e);for(;Js(t)&&!Ig(t);){if(Hz(t))return t;if(QD(t))return null;t=Xg(t)}return null}function qz(){return T3==null&&(T3=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),T3}function Ig(e){return/^(html|body|#document)$/.test(ll(e))}function Mu(e){return ta(e).getComputedStyle(e)}function zD(e){return Er(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Xg(e){if(ll(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Gw(e)&&e.host||fm(e);return Gw(t)?t.host:t}function X2e(e){const t=Xg(e);return Ig(t)?(e.ownerDocument||e).body:Js(t)&&UA(t)?t:X2e(t)}function oC(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=X2e(e),s=r===((i=e.ownerDocument)==null?void 0:i.body),o=ta(r);if(s){const l=Y8(o);return t.concat(o,o.visualViewport||[],UA(r)?r:[],l&&n?oC(l):[])}else return t.concat(r,oC(r,[],n))}function Y8(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gh(...e){return()=>{for(let t=0;t{e.removeEventListener(t,n,i)}}const Z2=null;let Rnt=class{constructor(){Zt(this,"callbacks",[]);Zt(this,"callbacksCount",0);Zt(this,"nextId",1);Zt(this,"startId",1);Zt(this,"isScheduled",!1);Zt(this,"tick",t=>{var r;this.isScheduled=!1;const n=this.callbacks,i=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,i>0)for(let s=0;s=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}},J2=new Rnt;class _c{constructor(){Zt(this,"currentId",Z2);Zt(this,"cancel",()=>{this.currentId!==Z2&&(J2.cancel(this.currentId),this.currentId=Z2)});Zt(this,"disposeEffect",()=>this.cancel)}static create(){return new _c}static request(t){return J2.request(t)}static cancel(t){return J2.cancel(t)}request(t){this.cancel(),this.currentId=J2.request(()=>{this.currentId=Z2,t()})}}function Wz(){const e=Ed(_c.create).current;return $D(e.disposeEffect),e}const ck=0;class Lu{constructor(){Zt(this,"currentId",ck);Zt(this,"clear",()=>{this.currentId!==ck&&(clearTimeout(this.currentId),this.currentId=ck)});Zt(this,"disposeEffect",()=>this.clear)}static create(){return new Lu}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=ck,n()},t)}isStarted(){return this.currentId!==ck}}function d0(){const e=Ed(Lu.create).current;return $D(e.disposeEffect),e}let dJ=0;function Int(e){return dJ+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${dJ}`}function _3(e,t){if(typeof e=="string")return{description:e};if(typeof e=="function"){const n=e(t);return typeof n=="string"?{description:n}:n}return e}function Pnt(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:Dnt,platform:Mnt,maxTouchPoints:Lnt}=Pnt(),VD=Dnt.toLowerCase(),lC=Mnt.toLowerCase(),HD=/^i(os$|p)/.test(lC)||lC==="macintel"&&Lnt>1,fJ="android",Z8=lC===fJ||VD.includes(fJ),$nt=!HD&&lC.startsWith("mac");lC.startsWith("win");const Fnt=$nt||HD;var Cue;const z1=typeof CSS<"u"&&!!((Cue=CSS.supports)!=null&&Cue.call(CSS,"-webkit-backdrop-filter:none"));!z1&&VD.includes("firefox");!z1&&VD.includes("chrom");const Bnt=Fnt,Y2e=/jsdom|happydom/.test(VD),J8="data-base-ui-focusable",Z2e="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Ac(e){var n;let t=e.activeElement;for(;((n=t==null?void 0:t.shadowRoot)==null?void 0:n.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function ii(e,t){var i;if(!e||!t)return!1;const n=(i=t.getRootNode)==null?void 0:i.call(t);if(e.contains(t))return!0;if(n&&Gw(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function uo(e){return"composedPath"in e?e.composedPath()[0]:e.target}function J2e(e,t){if(!Er(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,i]of t.entries())if(ii(i,n))return!i.hasAttribute("data-trigger-disabled");return!1}function j3(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Unt(e){return e.matches("html,body")}function Kz(e){return Js(e)&&e.matches(Z2e)}function Qnt(e){return(e==null?void 0:e.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Z2e}`))!=null}function hJ(e){return e?e.getAttribute("role")==="combobox"&&Kz(e):!1}function eB(e){if(!e||Y2e)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function pJ(e){return e?e.hasAttribute(J8)?e:e.querySelector(`[${J8}]`)||e:null}function Yg(e,t,n=!0){return e.filter(r=>r.parentId===t).flatMap(r=>{var s;return[...!n||(s=r.context)!=null&&s.open?[r]:[],...Yg(e,r.id,n)]})}function mJ(e,t){var r;let n=[],i=(r=e.find(s=>s.id===t))==null?void 0:r.parentId;for(;i;){const s=e.find(o=>o.id===i);i=s==null?void 0:s.parentId,s&&(n=n.concat(s))}return n}function znt(e){e.preventDefault(),e.stopPropagation()}function Vnt(e){return"nativeEvent"in e}function Hnt(e){return e.pointerType===""&&e.isTrusted?!0:Z8&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function e_e(e){return Y2e?!1:!Z8&&e.width===0&&e.height===0||Z8&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function iw(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function qnt(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const Wnt=["top","right","bottom","left"],Zg=Math.min,Ip=Math.max,nI=Math.round,e_=Math.floor,Pp=e=>({x:e,y:e}),Knt={left:"right",right:"left",bottom:"top",top:"bottom"};function Gz(e,t,n){return Ip(e,Zg(t,n))}function Oh(e,t){return typeof e=="function"?e(t):e}function vd(e){return e.split("-")[0]}function hm(e){return e.split("-")[1]}function Xz(e){return e==="x"?"y":"x"}function qD(e){return e==="y"?"height":"width"}function dd(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function WD(e){return Xz(dd(e))}function Gnt(e,t,n){n===void 0&&(n=!1);const i=hm(e),r=WD(e),s=qD(r);let o=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=iI(o)),[o,iI(o)]}function Xnt(e){const t=iI(e);return[tB(e),t,tB(t)]}function tB(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const gJ=["left","right"],bJ=["right","left"],Ynt=["top","bottom"],Znt=["bottom","top"];function Jnt(e,t,n){switch(e){case"top":case"bottom":return n?t?bJ:gJ:t?gJ:bJ;case"left":case"right":return t?Ynt:Znt;default:return[]}}function eit(e,t,n,i){const r=hm(e);let s=Jnt(vd(e),n==="start",i);return r&&(s=s.map(o=>o+"-"+r),t&&(s=s.concat(s.map(tB)))),s}function iI(e){const t=vd(e);return Knt[t]+e.slice(t.length)}function tit(e){var t,n,i,r;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(i=e.bottom)!=null?i:0,left:(r=e.left)!=null?r:0}}function Yz(e){return typeof e!="number"?tit(e):{top:e,right:e,bottom:e,left:e}}function rI(e){const{x:t,y:n,width:i,height:r}=e;return{width:i,height:r,top:n,left:t,right:t+i,bottom:n+r,x:t,y:n}}function nit(e){return e.visibility==="hidden"||e.visibility==="collapse"}function t_e(e,t=e?Mu(e):null){return!e||!e.isConnected||!t||nit(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const iit='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function rit(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return Gw(n)?n.host:null}function nB(e){for(const t of Array.from(e.children))if(ll(t)==="summary")return t;return null}function sit(e,t){const n=nB(t);return!!n&&(e===n||ii(n,e))}function n_e(e){const t=e?ll(e):"";return e!=null&&e.matches(iit)&&(t!=="summary"||e.parentElement!=null&&ll(e.parentElement)==="details"&&nB(e.parentElement)===e)&&(t!=="details"||nB(e)==null)&&(t!=="input"||e.type!=="hidden")}function i_e(e){if(!n_e(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=rit(t)){const n=t!==e,i=ll(t)==="slot";if(t.hasAttribute("inert")||n&&ll(t)==="details"&&!t.open&&!sit(e,t)||t.hasAttribute("hidden")||!i&&!ait(t,n))return!1}return!0}function ait(e,t){const n=Mu(e);return t?n.display!=="none":t_e(e,n)}function r_e(e){const t=e.tabIndex;if(t<0){const n=ll(e);if(n==="details"||n==="audio"||n==="video"||Js(e)&&e.isContentEditable)return 0}return t}function N3(e){if(ll(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function oit(e,t){const n=N3(e);if(!n)return!0;const i=t.find(r=>{const s=N3(r);return(s==null?void 0:s.name)===n.name&&s.form===n.form&&s.checked});return i?i===n:t.find(r=>{const s=N3(r);return(s==null?void 0:s.name)===n.name&&s.form===n.form})===n}function s_e(e){if(Js(e)&&ll(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Js(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function a_e(e,t){s_e(e).forEach(n=>{n_e(n)&&t.push(n),a_e(n,t)})}function o_e(e,t,n){s_e(e).forEach(i=>{Js(i)&&i.matches(t)&&n.push(i),o_e(i,t,n)})}function Zz(e){return i_e(e)&&r_e(e)>=0}function l_e(e){const t=[];return a_e(e,t),t.filter(i_e)}function QA(e){const t=l_e(e);return t.filter(n=>r_e(n)>=0&&oit(n,t))}function c_e(e,t){const n=QA(e),i=n.length;if(i===0)return;const r=Ac(kr(e)),s=n.indexOf(r),o=s===-1?t===1?0:i-1:s+t;return n[o]}function Jz(e){return c_e(kr(e).body,1)||e}function u_e(e){return c_e(kr(e).body,-1)||e}function d_e(e,t){if(!e)return null;const n=QA(kr(e).body),i=n.length;if(i===0)return null;const r=n.indexOf(e);if(r===-1)return null;const s=(r+t+i)%i;return n[s]}function lit(e){return d_e(e,1)}function cit(e){return d_e(e,-1)}function rw(e,t){const n=t||e.currentTarget,i=e.relatedTarget;return!i||!ii(n,i)}function uit(e){QA(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function yJ(e){const t=[];o_e(e,"[data-tabindex]",t),t.forEach(n=>{const i=n.dataset.tabindex;delete n.dataset.tabindex,i?n.setAttribute("tabindex",i):n.removeAttribute("tabindex")})}function R3(e){const t=new Map;let n=0,i=0;return e.forEach((r,s)=>{const o=r.transitionStatus==="ending";t.set(r.id,{value:r,domIndex:s,visibleIndex:o?-1:n,offsetY:i}),i+=r.height||0,o||(n+=1)}),t}function I3(e,t){let n=0;return e.map(i=>{if(i.transitionStatus==="ending")return i;const r=n>=t;return n+=1,i.limited===r?i:{...i,limited:r}})}const Bf={toasts:e=>e.toasts,isEmpty:e=>e.toasts.length===0,toast:(e,t)=>{var n;return(n=e.toastMetadata.get(t))==null?void 0:n.value},toastIndex:(e,t)=>{var n;return((n=e.toastMetadata.get(t))==null?void 0:n.domIndex)??-1},toastOffsetY:(e,t)=>{var n;return((n=e.toastMetadata.get(t))==null?void 0:n.offsetY)??0},toastVisibleIndex:(e,t)=>{var n;return((n=e.toastMetadata.get(t))==null?void 0:n.visibleIndex)??-1},focused:e=>e.focused,expanded:e=>e.hovering||e.focused,expandedOrOutOfFocus:e=>e.hovering||e.focused||!e.isWindowFocused,prevFocusElement:e=>e.prevFocusElement};class dit extends BD{constructor(n){super({...n,toastMetadata:R3(n.toasts)},{},Bf);Zt(this,"timers",new Map);Zt(this,"areTimersPaused",!1);Zt(this,"setViewport",n=>{this.set("viewport",n)});Zt(this,"disposeEffect",()=>()=>{this.timers.forEach(n=>{var i;(i=n.timeout)==null||i.clear()}),this.timers.clear()});Zt(this,"addToast",n=>{const{timeout:i,limit:r}=this.state,s=n.id||Int("toast");if(n.id){const u=Bf.toast(this.state,n.id);if(u)if(u.transitionStatus==="ending")this.removeToast(n.id,!0);else{const{id:d,transitionStatus:f,...h}=n;return this.updateToastInternal(n.id,h,!0,!0),n.id}}const o={...n,id:s,updateKey:0,transitionStatus:"starting"},l=[o,...this.state.toasts];this.setToasts(I3(l,r));const c=o.timeout??i;return o.type!=="loading"&&c>0&&this.scheduleTimer(s,c,()=>this.closeToast(s)),Bf.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),s});Zt(this,"updateToast",(n,i)=>{this.updateToastInternal(n,i,!1,!0)});Zt(this,"updateToastInternal",(n,i,r=!1,s=!1)=>{const{timeout:o,toasts:l}=this.state,c=Bf.toast(this.state,n);if(!c||c.transitionStatus==="ending")return;const u={...c,...i,...s&&{updateKey:c.updateKey+1}};this.setToasts(l.map(y=>y.id===n?u:y));const d=u.timeout??o,f=c.timeout??o,h=Object.hasOwn(i,"timeout"),m=u.transitionStatus!=="ending"&&u.type!=="loading"&&d>0,g=this.timers.has(n),b=f!==d,v=c.type==="loading";if(!m&&g){this.clearTimer(n);return}m&&(!g||b||h||v||r)&&(this.clearTimer(n),this.scheduleTimer(n,d,()=>this.closeToast(n)),Bf.expandedOrOutOfFocus(this.state)&&this.pauseTimers())});Zt(this,"closeToast",n=>{const i=n===void 0,{limit:r,toasts:s}=this.state;let o;if(i)o=s,this.clearTimers();else{const u=Bf.toast(this.state,n);if(!u)return;o=[u],this.clearTimer(n)}const l=s.map(u=>i||u.id===n?{...u,transitionStatus:"ending",height:0}:u),c=I3(l,r);this.setToasts(c,!c.some(u=>u.transitionStatus!=="ending")),o.forEach(u=>{var d;u.transitionStatus!=="ending"&&((d=u.onClose)==null||d.call(u))}),this.handleFocusManagement(n)});Zt(this,"promiseToast",(n,i)=>{const r=_3(i.loading),s=this.addToast({...r,type:"loading"}),o=n.then(l=>{const c=_3(i.success,l);return this.updateToast(s,{...c,type:"success",timeout:c.timeout}),l}).catch(l=>{const c=_3(i.error,l);return this.updateToast(s,{...c,type:"error",timeout:c.timeout}),Promise.reject(l)});return{}.hasOwnProperty.call(i,"setPromise")&&i.setPromise(o),o});Zt(this,"handleDocumentPointerDown",n=>{if(n.pointerType!=="touch")return;const i=uo(n);ii(this.state.viewport,i)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))})}syncProviderProps(n,i){const r=this.state.limit!==i;if(this.state.timeout===n&&!r)return;const s={timeout:n,limit:i};if(r){const o=I3(this.state.toasts,i);s.toasts=o,s.toastMetadata=R3(o)}this.update(s)}removeToast(n,i=!1){var l;const r=Bf.toastIndex(this.state,n);if(r===-1)return;const s=this.state.toasts[r];i||(l=s==null?void 0:s.onRemove)==null||l.call(s);const o=[...this.state.toasts];o.splice(r,1),this.setToasts(o)}pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(n=>{n.timeout&&(n.timeout.clear(),n.remaining=Math.max(n.remaining-(Date.now()-n.start),0))}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((n,i)=>{n.remaining=n.remaining>0?n.remaining:n.delay,n.timeout??(n.timeout=Lu.create()),n.timeout.start(n.remaining,()=>{this.handleTimerFired(i),n.callback()}),n.start=Date.now()}))}restoreFocusToPrevElement(){var n;(n=this.state.prevFocusElement)==null||n.focus({preventScroll:!0})}scheduleTimer(n,i,r){const s=Date.now(),l=!Bf.expandedOrOutOfFocus(this.state)?Lu.create():void 0;l==null||l.start(i,()=>{this.handleTimerFired(n),r()}),this.timers.set(n,{timeout:l,start:s,delay:i,remaining:i,callback:r})}clearTimers(){this.timers.forEach(n=>{var i;(i=n.timeout)==null||i.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer(n){var r;const i=this.timers.get(n);(r=i==null?void 0:i.timeout)==null||r.clear(),this.timers.delete(n),this.resetPausedStateIfNoTimersRemain()}handleTimerFired(n){this.timers.delete(n),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){this.timers.size===0&&(this.areTimersPaused=!1)}setToasts(n,i=n.length===0){const r={toasts:n,toastMetadata:R3(n)};i&&(r.hovering=!1,r.focused=!1),this.update(r)}handleFocusManagement(n){var c,u;const i=Ac(kr(this.state.viewport));if(!this.state.viewport||!ii(this.state.viewport,i)||!eB(i))return;if(n===void 0){this.restoreFocusToPrevElement();return}const r=Bf.toasts(this.state),s=Bf.toastIndex(this.state,n),o=(d,f)=>{for(let h=d;h>=0&&hnew dit({timeout:i,limit:r,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return $D(o.disposeEffect),p.useEffect(function(){return s?s[" subscribe"](({action:u,options:d})=>{const f=d.id;u==="promise"&&d.promise?o.promiseToast(d.promise,d):u==="update"&&f?o.updateToast(f,d):u==="close"?o.closeToast(f):o.addToast(d)}):void 0},[o,s]),a.jsxs(H2e.Provider,{value:o,children:[a.jsx(hit,{store:o,timeout:i,limit:r}),n]})};function hit(e){const{store:t,timeout:n,limit:i}=e;return Jn(()=>{t.syncProviderProps(n,i)},[t,n,i]),null}const pit={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},f_e={...pit,position:"fixed",top:0,left:0},f0=p.forwardRef(function(t,n){const[i,r]=p.useState();Jn(()=>{Bnt&&z1&&r("button")},[]);const s={tabIndex:0,role:i};return a.jsx("span",{...t,ref:n,style:f_e,"aria-hidden":i?void 0:!0,...s,"data-base-ui-focus-guard":""})});function Xw(e,t,n,i){const r=Ed(h_e).current;return git(r,e,t,n,i)&&p_e(r,[e,t,n,i]),r.callback}function mit(e){const t=Ed(h_e).current;return bit(t,e)&&p_e(t,e),t.callback}function h_e(){return{callback:null,cleanup:null,refs:[]}}function git(e,t,n,i,r){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==i||e.refs[3]!==r}function bit(e,t){return e.refs.length!==t.length||e.refs.some((n,i)=>n!==t[i])}function p_e(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const i=Array(t.length).fill(null);for(let r=0;r{for(let r=0;r=65&&r<=90&&(typeof t=="function"||typeof t>"u")}function nV(e){return typeof e=="function"}function b_e(e,t){return nV(e)?e(t):e??eV}function kit(e,t){return t?e?(...n)=>{const i=n[0];if(x_e(i)){const s=i;aI(s);const o=t(...n);return s.baseUIHandlerPrevented||e==null||e(...n),o}const r=t(...n);return e==null||e(...n),r}:y_e(t):e}function y_e(e){return e&&((...t)=>{const n=t[0];return x_e(n)&&aI(n),e(...t)})}function aI(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function v_e(e,t){return t?e?t+" "+e:t:e}function x_e(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Ra(e,t,n={}){const i=t.render,r=Sit(t,n);if(n.enabled===!1)return null;const s=n.state??nc;return Ait(e,i,r,s)}function Sit(e,t={}){const{className:n,style:i,render:r}=e,{state:s=nc,ref:o,props:l,stateAttributesMapping:c,enabled:u=!0}=t,d=u?vit(n,s):void 0,f=u?m_e(i,s):void 0,h=u?yit(s,c):nc,m=u&&l?Eit(l):void 0,g=u?iB(h,m)??{}:nc;return typeof document<"u"&&(u?Array.isArray(o)?g.ref=mit([g.ref,vJ(r),...o]):g.ref=Xw(g.ref,vJ(r),o):Xw(null,null)),u?(d!==void 0&&(g.className=v_e(g.className,d)),f!==void 0&&(g.style=iB(g.style,f)),g):nc}function Eit(e){return Array.isArray(e)?xit(e):tV(void 0,e)}const Cit=Symbol.for("react.lazy");function Ait(e,t,n,i){if(t){if(typeof t=="function")return t(n,i);const r=tV(n,t.props);r.ref=n.ref;let s=t;return(s==null?void 0:s.$$typeof)===Cit&&(s=p.Children.toArray(t)[0]),p.cloneElement(s,r)}if(e&&typeof e=="string")return Tit(e,n);throw new Error(Vc(8))}function Tit(e,t){return e==="button"?p.createElement("button",{type:"button",...t,key:t.key}):e==="img"?p.createElement("img",{alt:"",...t,key:t.key}):p.createElement(e,t)}const _it=p.forwardRef(function(t,n){var F;const{render:i,className:r,style:s,children:o,...l}=t,c=Uz(),u=d0(),d=p.useRef(!1),f=p.useRef(!1),h=p.useRef(!1),m=c.useState("isEmpty"),g=c.useState("toasts"),b=c.useState("focused"),v=c.useState("expanded"),y=c.useState("prevFocusElement"),w=(F=g[0])==null?void 0:F.height,x=g.some(M=>M.transitionStatus==="ending"),O=g.filter(M=>M.priority==="high");p.useEffect(()=>{const M=c.state.viewport;if(!M||m)return;const V=ta(M),q=kr(M);function U(Z){Z.key==="F6"&&uo(Z)!==M&&(Z.preventDefault(),c.set("prevFocusElement",Ac(q)),M==null||M.focus({preventScroll:!0}),c.pauseTimers(),c.set("focused",!0))}function J(Z){uo(Z)===V&&(c.set("isWindowFocused",!1),c.pauseTimers())}function z(Z){if(Z.relatedTarget)return;const ne=uo(Z),W=Ac(kr(M));(ne===V||!ii(M,ne)||!eB(W))&&c.resumeTimers(),u.start(0,()=>c.set("isWindowFocused",!0))}return gh(Ni(V,"keydown",U),Ni(V,"blur",J,!0),Ni(V,"focus",z,!0),Ni(q,"pointerdown",c.handleDocumentPointerDown,!0))},[c,u,m]);function k(M){var q,U;d.current=!0;const V=M.relatedTarget===c.state.viewport?g.find(J=>J.transitionStatus!=="ending"&&!J.limited):void 0;V?(U=(q=V.ref)==null?void 0:q.current)==null||U.focus():c.restoreFocusToPrevElement()}function S(M){M.key==="Tab"&&M.shiftKey&&uo(M.nativeEvent)===c.state.viewport&&(M.preventDefault(),c.restoreFocusToPrevElement())}function C(){c.state.toasts.some(V=>V.transitionStatus==="ending")||h.current||!f.current||(c.state.isWindowFocused&&c.resumeTimers(),c.set("hovering",!1),f.current=!1)}p.useEffect(C,[x,c]);function E(){c.pauseTimers(),c.set("hovering",!0),f.current=!1}function j(){c.state.isWindowFocused&&c.resumeTimers()}function T(){f.current=!0,C()}function R(M){M.pointerType==="touch"&&(h.current=!0)}function A(M){M.pointerType==="touch"&&(h.current=!1,C())}function N(){if(d.current){d.current=!1;return}b||eB(Ac(kr(c.state.viewport)))&&(c.set("focused",!0),c.pauseTimers())}function P(M){!b||ii(c.state.viewport,M.relatedTarget)||(c.set("focused",!1),j())}const I={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:E,onMouseMove:E,onMouseLeave:T,onFocus:N,onBlur:P,onKeyDown:S,onClick:N,onPointerDown:R,onPointerUp:A,onPointerCancel:A,style:{"--toast-frontmost-height":w?`${w}px`:void 0}},D={expanded:v},_=!m&&y&&a.jsx(f0,{onFocus:k}),L=Ra("div",t,{ref:[n,c.setViewport],state:D,props:[I,l,{children:a.jsxs(p.Fragment,{children:[_,o,_]})}]});return a.jsxs(p.Fragment,{children:[_,L,!b&&O.length>0&&a.jsx("div",{style:f_e,children:O.map(M=>a.jsxs("div",{role:"alert","aria-atomic":!0,children:[a.jsx("div",{children:M.title}),a.jsx("div",{children:M.description})]},M.id))})]})});function iV(e){return Qz(19)?e:e?"true":void 0}const w_e=p.createContext(void 0);function jit(){const e=p.useContext(w_e);if(!e)throw new Error(Vc(66));return e}let oI=function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e}({});const Nit={"data-starting-style":""},Rit={"data-ending-style":""},KD={transitionStatus(e){return e==="starting"?Nit:e==="ending"?Rit:null}};function ip(e){return e==null?e:"current"in e?e.current:e}function rV(e,t=!1){const n=Wz();return ci((i,r=null)=>{n.cancel();const s=ip(e);if(s==null)return;const o=s,l=()=>{yi.flushSync(i)};if(typeof o.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function c(){Promise.all(o.getAnimations().map(u=>u.finished)).then(()=>{r!=null&&r.aborted||l()},()=>{if(r!=null&&r.aborted)return;if(o.getAnimations().some(d=>d.pending||d.playState!=="finished")){c();return}l()})}if(t){const u="data-starting-style";if(!o.hasAttribute(u)){n.request(c);return}const d=new MutationObserver(()=>{o.hasAttribute(u)||(d.disconnect(),c())});d.observe(o,{attributes:!0,attributeFilter:[u]}),r==null||r.addEventListener("abort",()=>d.disconnect(),{once:!0});return}n.request(c)})}function zA(e){const{enabled:t=!0,open:n,ref:i,onComplete:r}=e,s=ci(r),o=rV(i,n);p.useEffect(()=>{if(!t)return;const l=new AbortController;return o(s,l.signal),()=>{l.abort()}},[t,n,s,o])}const Iit=500,Pit={style:{transition:"none"}},sV="data-base-ui-click-trigger",Dit="data-base-ui-swipe-ignore",Mit="data-swipe-ignore",Lit=`[${Dit}]`,$it=`[${Mit}]`,Fit={fallbackAxisSide:"end"},Bit={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function P3(e,t,n){switch(e){case"up":return-n;case"down":return n;case"left":return-t;case"right":return t;default:return 0}}function Uit(e){const n=ta(e).getComputedStyle(e).transform;let i=0,r=0,s=1;if(n&&n!=="none"){const o=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(o){const l=o[1].split(", ").map(parseFloat);l.length===6?(i=l[4],r=l[5],s=Math.sqrt(l[0]*l[0]+l[1]*l[1])):l.length===16&&(i=l[12],r=l[13],s=l[0])}}return{x:i,y:r,scale:s}}const Qit={...KD,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},xJ=40,zit=10,wJ=.5,Vit=1,Hit=`${Lit},${$it}`,qit=p.forwardRef(function(t,n){var ze;const{toast:i,render:r,className:s,swipeDirection:o=["down","right"],style:l,...c}=t,u=((ze=i.positionerProps)==null?void 0:ze.anchor)!==void 0;let d=[];u||(d=Array.isArray(o)?o:[o]);const f=d.length>0,h=Uz(),[m,g]=p.useState(void 0),[b,v]=p.useState(!1),[y,w]=p.useState(!1),[x,O]=p.useState({x:0,y:0}),[k,S]=p.useState({x:0,y:0,scale:1}),[C,E]=p.useState(),[j,T]=p.useState(),[R,A]=p.useState(null),N=p.useRef(null),P=p.useRef(void 0),I=p.useRef({x:0,y:0}),D=p.useRef({x:0,y:0,scale:1}),_=p.useRef(void 0),L=p.useRef(0),F=p.useRef(!1),M=p.useRef({x:0,y:0}),V=p.useRef(!1),q=p.useRef({x:0,y:0}),U=p.useRef(null),J=p.useRef(null),z=h.useState("toastIndex",i.id),Z=h.useState("toastVisibleIndex",i.id),ne=h.useState("toastOffsetY",i.id),W=h.useState("focused"),G=h.useState("expanded");zA({open:i.transitionStatus!=="ending",ref:N,onComplete(){i.transitionStatus==="ending"&&h.removeToast(i.id)}});const H=ci((_e=!1)=>{const ae=N.current;if(!ae)return;const le=ae.style.height;ae.style.height="auto";const ge=ae.offsetHeight;ae.style.height=le;function Oe(){h.updateToastInternal(i.id,{ref:N,height:ge,transitionStatus:void 0})}_e?yi.flushSync(Oe):Oe()});Jn(()=>{const _e=P.current;i.transitionStatus!=="starting"&&_e===i.id||(_e!==void 0&&(g(void 0),S({x:0,y:0,scale:1}),se({x:0,y:0})),P.current=i.id,H())},[H,i.id,i.transitionStatus]);function se(_e){q.current=_e,O(_e)}Jn(()=>()=>{var _e;(_e=J.current)==null||_e.abort()},[]);function Y(_e,ae){const le=Se=>Se>0?Se**wJ:-(Math.abs(Se)**wJ),ge=_e>0&&!d.includes("right")||_e<0&&!d.includes("left"),Oe=ae>0&&!d.includes("down")||ae<0&&!d.includes("up");return{x:ge?le(_e):_e,y:Oe?le(ae):ae}}const X=ci(_e=>{var We;if(_e.pointerId!==U.current)return;U.current=null,(We=J.current)==null||We.abort(),J.current=null,v(!1),w(!1),A(null);const ae=D.current;if(_e.type==="pointercancel"||F.current){se({x:ae.x,y:ae.y}),g(void 0);return}const le=q.current,ge=le.x-ae.x,Oe=le.y-ae.y;let Se;for(const Ye of d)if(P3(Ye,ge,Oe)>xJ){Se=Ye;break}Se?(g(Se),h.closeToast(i.id)):(se({x:ae.x,y:ae.y}),g(void 0))});function ie(_e){var Ye,ye;if(_e.button!==0)return;_e.pointerType==="touch"&&h.pauseTimers();const ae=uo(_e.nativeEvent);if(ae==null?void 0:ae.closest(`button,a,input,textarea,[role="button"],${Hit}`))return;F.current=!1,_.current=void 0,L.current=0,U.current=_e.pointerId,I.current={x:_e.clientX,y:_e.clientY},M.current=I.current;const ge=_e.currentTarget,Oe=Uit(ge);D.current=Oe,S(Oe),se({x:Oe.x,y:Oe.y}),h.set("hovering",!0),v(!0),w(!1),A(null),V.current=!0,(Ye=J.current)==null||Ye.abort();const Se=new AbortController;J.current=Se;const We=kr(ge);We.addEventListener("pointerup",X,{signal:Se.signal}),We.addEventListener("pointercancel",X,{signal:Se.signal}),(ye=ge.setPointerCapture)==null||ye.call(ge,_e.pointerId)}function ee(_e){if(_e.pointerId!==U.current)return;_e.preventDefault(),V.current&&(I.current={x:_e.clientX,y:_e.clientY},V.current=!1);const{clientY:ae,clientX:le,movementX:ge,movementY:Oe}=_e;(Oe<0&&ae>M.current.y||Oe>0&&aeM.current.x||ge>0&&le=Vit){w(!0);const xt=d.includes("left")||d.includes("right"),tt=d.includes("up")||d.includes("down");if(xt&&tt){const mt=Math.abs(Se),Ne=Math.abs(We);we=mt>Ne?"horizontal":"vertical",A(we)}}let Ae;if(!_.current)we==="vertical"?We>0?Ae="down":We<0&&(Ae="up"):we==="horizontal"?Se>0?Ae="right":Se<0&&(Ae="left"):Math.abs(Se)>=Math.abs(We)?Ae=Se>0?"right":"left":Ae=We>0?"down":"up",Ae&&d.includes(Ae)&&(_.current=Ae,L.current=P3(Ae,Se,We),g(Ae));else{const Ct=_.current,xt=P3(Ct,ye,Ye);xt>xJ?(F.current=!1,g(Ct)):!(d.includes("left")&&d.includes("right"))&&!(d.includes("up")&&d.includes("down"))&&L.current-xt>=zit&&(F.current=!0)}const He=Y(Se,We);let Ue=D.current.x,jt=D.current.y;const Pt=d.includes("left")||d.includes("right"),Kt=d.includes("up")||d.includes("down");we!=="vertical"&&Pt&&(Ue+=He.x),we!=="horizontal"&&Kt&&(jt+=He.y),se({x:Ue,y:jt})}function be(_e){if(_e.key==="Escape"){if(!N.current||!ii(N.current,Ac(kr(N.current))))return;h.closeToast(i.id)}}p.useEffect(()=>{const _e=N.current;if(!f||!_e)return;function ae(le){U.current===null||!ii(_e,uo(le))||le.preventDefault()}return Ni(_e,"touchmove",ae,{passive:!1})},[f]);function ue(){const _e=x.x-k.x,ae=x.y-k.y;return{transition:b?"none":void 0,transform:b?`translateX(${x.x}px) translateY(${x.y}px) scale(${k.scale})`:void 0,"--toast-swipe-movement-x":`${_e}px`,"--toast-swipe-movement-y":`${ae}px`}}const pe=i.priority==="high",ke={role:pe?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":C,"aria-describedby":j,"aria-hidden":pe&&!W?!0:void 0,onPointerDown:f?ie:void 0,onPointerMove:f?ee:void 0,onPointerUp:f?X:void 0,onPointerCancel:f?X:void 0,onKeyDown:be,inert:iV(i.limited),style:{...ue(),"--toast-index":i.transitionStatus==="ending"?z:Z,"--toast-offset-y":`${ne}px`,"--toast-height":i.height?`${i.height}px`:void 0}},je=p.useMemo(()=>({toast:i,setTitleId:E,setDescriptionId:T,recalculateHeight:H,visibleIndex:Z,expanded:G}),[i,E,T,H,Z,G]),Pe={transitionStatus:i.transitionStatus,expanded:G,limited:i.limited||!1,type:i.type,swiping:b,swipeDirection:m},Ee=Ra("div",t,{ref:[n,N],state:Pe,stateAttributesMapping:Qit,props:[ke,c]});return a.jsx(w_e.Provider,{value:je,children:Ee})});let OJ=0;function Wit(e,t="mui"){const[n,i]=p.useState(e),r=e||n;return p.useEffect(()=>{n==null&&(OJ+=1,i(`${t}-${OJ}`))},[n,t]),r}const kJ=zz.useId;function VA(e,t){if(kJ!==void 0){const n=kJ();return e??(t?`${t}-${n}`:n)}return Wit(e,t)}function O_e(e){return e==null||typeof e=="boolean"||e===""?!1:Array.isArray(e)?e.some(O_e):!0}function Kit(e){return p.isValidElement(e)&&O_e(e.props.children)}function k_e(e,t,n){const{toast:i,setTitleId:r,setDescriptionId:s}=jit(),o=n==="title"?r:s,l=t??(n==="title"?i.title:i.description);return{id:VA(e),children:l,type:i.type,setId:o}}function S_e(e,t,n){const i=Kit(e);return Jn(()=>{if(i)return n(t),()=>{n(r=>r===t?void 0:r)}},[i,t,n]),i?e:null}const Git=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:o,children:l,...c}=t,{id:u,children:d,type:f,setId:h}=k_e(o,l,"description"),g=Ra("p",t,{ref:n,state:{type:f},props:{...c,id:u,children:d}});return S_e(g,u,h)}),Xit=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:o,children:l,...c}=t,{id:u,children:d,type:f,setId:h}=k_e(o,l,"title"),g=Ra("h2",t,{ref:n,state:{type:f},props:{...c,id:u,children:d}});return S_e(g,u,h)}),Yit=p.createContext(void 0);function Zit(e=!1){const t=p.useContext(Yit);if(t===void 0&&!e)throw new Error(Vc(16));return t}function Jit(e){const{focusableWhenDisabled:t,disabled:n,composite:i=!1,tabIndex:r=0,isNativeButton:s}=e,o=i&&t!==!1,l=i&&t===!1;return{props:p.useMemo(()=>{const u={onKeyDown(d){n&&t&&d.key!=="Tab"&&d.preventDefault()}};return i||(u.tabIndex=r,!s&&n&&(u.tabIndex=t?r:-1)),(s&&(t||o)||!s&&n)&&(u["aria-disabled"]=n),s&&(!t||l)&&(u.disabled=n),u},[i,n,t,o,l,s,r])}}function D3(e,t,{detail:n=0}={}){e.dispatchEvent(new(ta(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function GD(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:i=0,native:r=!0,composite:s}=e,o=p.useRef(null),l=Zit(!0),c=s??l!==void 0,{props:u}=Jit({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:i,isNativeButton:r}),d=p.useCallback(()=>{const m=o.current;M3(m)&&c&&t&&u.disabled===void 0&&m.disabled&&(m.disabled=!1)},[t,u.disabled,c]);Jn(d,[d]);const f=p.useCallback((m={})=>{const{onClick:g,onMouseDown:b,onKeyUp:v,onKeyDown:y,onPointerDown:w,...x}=m;return tV({onClick(O){if(t){O.preventDefault();return}g==null||g(O)},onMouseDown(O){t||b==null||b(O)},onKeyDown(O){if(t||(aI(O),y==null||y(O),O.baseUIHandlerPrevented))return;const k=O.target===O.currentTarget,S=O.currentTarget,C=M3(S),E=!r&&ert(S),j=k&&(r?C:!E),T=O.key==="Enter",R=O.key===" ",A=S.getAttribute("role"),N=(A==null?void 0:A.startsWith("menuitem"))||A==="option"||A==="gridcell";if(k&&c&&R){if(O.defaultPrevented&&N)return;O.preventDefault(),(!r||C)&&(O.preventBaseUIHandler(),D3(S,O));return}if(!j||r||!R&&!T){k&&E&&R&&O.preventDefault();return}O.defaultPrevented||(O.preventDefault(),T&&(O.preventBaseUIHandler(),D3(S,O)))},onKeyUp(O){if(!t){if(aI(O),v==null||v(O),O.target===O.currentTarget&&r&&c&&M3(O.currentTarget)&&O.key===" "){O.preventDefault();return}O.baseUIHandlerPrevented||O.target===O.currentTarget&&!r&&!c&&!O.defaultPrevented&&O.key===" "&&(O.preventBaseUIHandler(),D3(O.currentTarget,O))}},onPointerDown(O){if(t){O.preventDefault();return}w==null||w(O)}},r?{type:"button"}:{role:"button"},u,x)},[t,u,c,r]),h=ci(m=>{o.current=m,d()});return{getButtonProps:f,buttonRef:h}}function M3(e){return Js(e)&&e.tagName==="BUTTON"}function ert(e){return Js(e)&&e.tagName==="A"&&!!e.href}const E_e="none",Yw="trigger-press",mu="trigger-hover",C_e="outside-press",A_e="close-press",cC="focus-out",T_e="escape-key",__e="imperative-action";function fa(e,t,n,i){let r=!1,s=!1;const o=nc;return{reason:e,event:t??new Event("base-ui"),cancel(){r=!0},allowPropagation(){s=!0},get isCanceled(){return r},get isPropagationAllowed(){return s},trigger:n,...o}}function lI(e){return`data-base-ui-${e}`}const j_e=p.createContext(null),N_e=()=>p.useContext(j_e),trt=lI("portal");function R_e(e={}){const{ref:t,container:n,componentProps:i=nc,elementProps:r}=e,s=VA(),o=N_e(),l=o==null?void 0:o.portalNode,[c,u]=p.useState(null),[d,f]=p.useState(null),h=ci(v=>{v!==null&&f(v)}),m=p.useRef(null);Jn(()=>{if(n===null){m.current&&(m.current=null,f(null),u(null));return}const v=(n&&(Vz(n)?n:n.current))??l??document.body;if(v==null){m.current&&(m.current=null,f(null),u(null));return}m.current!==v&&(m.current=v,f(null),u(v))},[n,l]);const g=Ra("div",i,{ref:[t,h],props:[{id:s,[trt]:""},r]}),b=c&&g?yi.createPortal(g,c):null;return{node:d,nodeId:p.isValidElement(g)?g.props.id:void 0,subtree:b}}const I_e=p.forwardRef(function(t,n){const{render:i,className:r,style:s,children:o,container:l,...c}=t,{node:u,nodeId:d,subtree:f}=R_e({container:l,ref:n,componentProps:t,elementProps:c}),h=p.useRef(null),m=p.useRef(null),g=p.useRef(null),b=p.useRef(null),[v,y]=p.useState(null),w=p.useRef(!1),x=v==null?void 0:v.modal,O=v==null?void 0:v.open,k=!!v&&!v.modal&&v.open&&!!u;p.useEffect(()=>{if(!u||x)return;function C(E){u&&E.relatedTarget&&rw(E)&&(E.type==="focusin"?w.current&&(yJ(u),w.current=!1):(uit(u),w.current=!0))}return gh(Ni(u,"focusin",C,!0),Ni(u,"focusout",C,!0))},[u,x]),Jn(()=>{!u||O!==!0||!w.current||(yJ(u),w.current=!1)},[O,u]);const S=p.useMemo(()=>({beforeOutsideRef:h,afterOutsideRef:m,beforeInsideRef:g,afterInsideRef:b,portalNode:u,setFocusManagerState:y}),[u]);return a.jsxs(p.Fragment,{children:[f,a.jsxs(j_e.Provider,{value:S,children:[k&&u&&a.jsx(f0,{"data-type":"outside",ref:h,onFocus:C=>{var E;if(rw(C,u))(E=g.current)==null||E.focus();else{const j=v?v.domReference:null,T=u_e(j);T==null||T.focus()}}}),k&&u&&a.jsx("span",{"aria-owns":d,style:Bit}),u&&yi.createPortal(o,u),k&&u&&a.jsx(f0,{"data-type":"outside",ref:m,onFocus:C=>{var E;if(rw(C,u))(E=b.current)==null||E.focus();else{const j=v?v.domReference:null,T=Jz(j);T==null||T.focus(),v!=null&&v.closeOnFocusOut&&(v==null||v.onOpenChange(!1,fa(cC,C.nativeEvent)))}}})]})]})}),nrt=p.forwardRef(function(t,n){const{children:i,container:r,className:s,render:o,style:l,...c}=t,{node:u,subtree:d}=R_e({container:r,ref:n,componentProps:t,elementProps:c});return!d&&!u?null:a.jsxs(p.Fragment,{children:[d,u&&yi.createPortal(i,u)]})}),irt=p.forwardRef(function(t,n){return a.jsx(nrt,{ref:n,...t})});function Zl(e){const t=Ed(rrt,e).current;return t.next=e,Jn(t.effect),t}function rrt(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function srt(e,t){return t!=null&&!iw(t)?0:typeof e=="function"?e():e}function rB(e,t,n){const i=srt(e,n);return typeof i=="number"?i:i==null?void 0:i[t]}function SJ(e){return typeof e=="function"?e():e}function P_e(e,t){return t||e==="click"||e==="mousedown"}function art(e){return(e==null?void 0:e.includes("mouse"))&&e!=="mousedown"}let t_=0;function L3(e,t={}){const{preventScroll:n=!1,sync:i=!1,shouldFocus:r}=t;cancelAnimationFrame(t_);function s(){r&&!r()||e==null||e.focus({preventScroll:n})}if(i)return s(),Bz;const o=requestAnimationFrame(s);return t_=o,()=>{t_===o&&(cancelAnimationFrame(o),t_=0)}}const $3={inert:new WeakMap,"aria-hidden":new WeakMap},EJ="data-base-ui-inert",sB={inert:new WeakSet,"aria-hidden":new WeakSet};let uk=new WeakMap,F3=0;function ort(e){return sB[e]}function D_e(e){return e?Gw(e)?e.host:D_e(e.parentNode):null}const CJ=(e,t)=>t.map(n=>{if(e.contains(n))return n;const i=D_e(n);return e.contains(i)?i:null}).filter(n=>n!=null),AJ=e=>{const t=new Set;return e.forEach(n=>{let i=n;for(;i&&!t.has(i);)t.add(i),i=i.parentNode}),t},TJ=(e,t,n)=>{const i=[],r=s=>{!s||n.has(s)||Array.from(s.children).forEach(o=>{ll(o)!=="script"&&(t.has(o)?r(o):i.push(o))})};return r(e),i};function lrt(e,t,n,i,{mark:r=!0}){let s=null;i?s="inert":n&&(s="aria-hidden");let o=null,l=null;const c=CJ(t,e),u=r?TJ(t,AJ(c),new Set(c)):[],d=[],f=[];if(s){const h=$3[s],m=ort(s);l=m,o=h;const g=CJ(t,Array.from(t.querySelectorAll("[aria-live]"))),b=c.concat(g);TJ(t,AJ(b),new Set(b)).forEach(y=>{const w=y.getAttribute(s),x=w!==null&&w!=="false",O=(h.get(y)||0)+1;h.set(y,O),d.push(y),O===1&&x&&m.add(y),x||y.setAttribute(s,s==="inert"?"":"true")})}return r&&u.forEach(h=>{const m=(uk.get(h)||0)+1;uk.set(h,m),f.push(h),m===1&&h.setAttribute(EJ,"")}),F3+=1,()=>{o&&d.forEach(h=>{const g=(o.get(h)||0)-1;o.set(h,g),g||(!(l!=null&&l.has(h))&&s&&h.removeAttribute(s),l==null||l.delete(h))}),r&&f.forEach(h=>{const m=(uk.get(h)||0)-1;uk.set(h,m),m||h.removeAttribute(EJ)}),F3-=1,F3||($3.inert=new WeakMap,$3["aria-hidden"]=new WeakMap,sB.inert=new WeakSet,sB["aria-hidden"]=new WeakSet,uk=new WeakMap)}}function _J(e,t={}){const{ariaHidden:n=!1,inert:i=!1,mark:r=!0}=t,s=kr(e[0]).body;return lrt(e,s,n,i,{mark:r})}function M_e(){const e=new Map;return{emit(t,n){var i;(i=e.get(t))==null||i.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var i;(i=e.get(t))==null||i.delete(n)}}}class crt{constructor(){Zt(this,"nodesRef",{current:[]});Zt(this,"events",M_e())}addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(i=>i===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const L_e=p.createContext(null),$_e=p.createContext(null),XD=()=>{var e;return((e=p.useContext(L_e))==null?void 0:e.id)||null},V1=e=>{const t=p.useContext($_e);return e??t};function urt(e){const t=VA(),n=V1(e),i=XD();return Jn(()=>{if(!t)return;const r={id:t,parentId:i};return n==null||n.addNode(r),()=>{n==null||n.removeNode(r)}},[n,t,i]),t}function drt(e){const{children:t,id:n}=e,i=XD();return a.jsx(L_e.Provider,{value:p.useMemo(()=>({id:n,parentId:i}),[n,i]),children:t})}function frt(e){const{children:t,externalTree:n}=e,i=Ed(()=>n??new crt).current;return a.jsx($_e.Provider,{value:i,children:t})}function hrt(e,t){const n=ta(uo(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const jJ=20;let mg=[];function aV(){mg=mg.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function NJ(e){aV(),e&&ll(e)!=="body"&&(mg.push(new WeakRef(e)),mg.length>jJ&&(mg=mg.slice(-jJ)))}function RJ(){var e;return aV(),(e=mg[mg.length-1])==null?void 0:e.deref()}function prt(e){return e?Zz(e)?e:QA(e)[0]||e:null}function IJ(e){var r;if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!((r=e.getAttribute("role"))!=null&&r.includes("dialog")))return;const n=l_e(e).filter(s=>{const o=s.getAttribute("data-tabindex")||"";return Zz(s)||s.hasAttribute("data-tabindex")&&!o.startsWith("-")}),i=e.getAttribute("tabindex");n.length===0?i!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(i!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function F_e(e){const{context:t,children:n,disabled:i=!1,initialFocus:r=!0,returnFocus:s=!0,restoreFocus:o=!1,modal:l=!0,closeOnFocusOut:c=!0,openInteractionType:u="",nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:h,externalTree:m,getInsideElements:g}=e,b="rootStore"in t?t.rootStore:t,v=b.useState("open"),y=b.useState("domReferenceElement"),w=b.useState("floatingElement"),{events:x,dataRef:O}=b.context,k=ci(()=>{var Y;return(Y=O.current.floatingContext)==null?void 0:Y.nodeId}),S=r===!1,C=hJ(y)&&S,E=Zl(r),j=Zl(s),T=Zl(u),R=Zl(v),A=V1(m),N=N_e(),P=p.useRef(!1),I=p.useRef(!1),D=p.useRef(!1),_=p.useRef(null),L=p.useRef(""),F=p.useRef(""),M=p.useRef(null),V=p.useRef(null),q=Xw(M,h,N==null?void 0:N.beforeInsideRef),U=Xw(V,N==null?void 0:N.afterInsideRef),J=d0(),z=d0(),Z=Wz(),ne=N!=null,W=pJ(w),G=ci((Y=W)=>Y?QA(Y):[]),H=ci(()=>(g==null?void 0:g().filter(Y=>Y!=null))??[]);p.useEffect(()=>{if(i||!l)return;function Y(ie){ie.key==="Tab"&&ii(W,Ac(kr(W)))&&G().length===0&&!C&&znt(ie)}const X=kr(W);return Ni(X,"keydown",Y)},[i,W,l,C,G]),p.useEffect(()=>{if(i||!v)return;const Y=kr(W);function X(){D.current=!1}function ie(be){const ue=uo(be),pe=H(),ke=ii(w,ue)||ii(y,ue)||ii(N==null?void 0:N.portalNode,ue)||pe.some(je=>je===ue||ii(je,ue));D.current=!ke,F.current=be.pointerType||"keyboard",ue!=null&&ue.closest(`[${sV}]`)&&(I.current=!0,z.start(0,()=>{I.current=!1}))}function ee(){F.current="keyboard"}return gh(Ni(Y,"pointerdown",ie,!0),Ni(Y,"pointerup",X,!0),Ni(Y,"pointercancel",X,!0),Ni(Y,"keydown",ee,!0),X)},[i,w,y,W,v,N,z,H]),p.useEffect(()=>{if(i||!c)return;const Y=kr(W);function X(){I.current=!0,z.start(0,()=>{I.current=!1})}function ie(pe){const ke=uo(pe);Zz(ke)&&(_.current=ke)}function ee(pe){const ke=pe.relatedTarget,je=pe.currentTarget,Pe=uo(pe);l&&ke==null&&Pe!=null&&ii(w,Pe)&&NJ(Pe),queueMicrotask(()=>{const Ee=k(),ze=b.context.triggerElements,_e=H(),ae=(ke==null?void 0:ke.hasAttribute(lI("focus-guard")))&&[M.current,V.current,N==null?void 0:N.beforeInsideRef.current,N==null?void 0:N.afterInsideRef.current,N==null?void 0:N.beforeOutsideRef.current,N==null?void 0:N.afterOutsideRef.current,ip(f),ip(d)].includes(ke),le=!(ii(y,ke)||ii(w,ke)||ii(ke,w)||ii(N==null?void 0:N.portalNode,ke)||_e.some(ge=>ge===ke||ii(ge,ke))||ze.hasMatchingElement(ge=>ii(ge,ke))||ae||A&&(Yg(A.nodesRef.current,Ee).find(ge=>{var Oe,Se;return ii((Oe=ge.context)==null?void 0:Oe.elements.floating,ke)||ii((Se=ge.context)==null?void 0:Se.elements.domReference,ke)})||mJ(A.nodesRef.current,Ee).find(ge=>{var Oe,Se,We;return[(Oe=ge.context)==null?void 0:Oe.elements.floating,pJ((Se=ge.context)==null?void 0:Se.elements.floating)].includes(ke)||((We=ge.context)==null?void 0:We.elements.domReference)===ke})));if(je===y&&W&&IJ(W),o&&je!==y&&!t_e(Pe)&&Ac(Y)===Y.body){if(Js(W)&&(W.focus(),o==="popup")){Z.request(()=>{W.focus()});return}const ge=G(),Oe=_.current,Se=(Oe&&ge.includes(Oe)?Oe:null)||ge[ge.length-1]||W;Js(Se)&&Se.focus()}if(O.current.insideReactTree){O.current.insideReactTree=!1;return}(C||!l)&&ke&&le&&!I.current&&(C||ke!==RJ())&&(P.current=!0,b.setOpen(!1,fa(cC,pe)))})}function be(){D.current||(O.current.insideReactTree=!0,J.start(0,()=>{O.current.insideReactTree=!1}))}const ue=Js(y)?y:null;if(!(!w&&!ue))return gh(ue&&Ni(ue,"focusout",ee),ue&&Ni(ue,"pointerdown",X),w&&Ni(w,"focusin",ie),w&&Ni(w,"focusout",ee),w&&N&&Ni(w,"focusout",be,!0))},[i,y,w,W,l,A,N,b,c,o,G,C,k,O,J,z,Z,d,f,H]),p.useEffect(()=>{var je,Pe,Ee;if(i||!w||!v)return;const Y=Array.from(((je=N==null?void 0:N.portalNode)==null?void 0:je.querySelectorAll(`[${lI("portal")}]`))||[]),ie=(Ee=(Pe=(A?mJ(A.nodesRef.current,k()):[]).find(ze=>{var _e;return hJ(((_e=ze.context)==null?void 0:_e.elements.domReference)||null)}))==null?void 0:Pe.context)==null?void 0:Ee.elements.domReference,be=[...[w,...Y,M.current,V.current,N==null?void 0:N.beforeOutsideRef.current,N==null?void 0:N.afterOutsideRef.current,...H()],ie,ip(f),ip(d),C?y:null].filter(ze=>ze!=null),ue=_J(be,{ariaHidden:l||C,mark:!1}),pe=[w,...Y].filter(ze=>ze!=null),ke=_J(pe);return()=>{ke(),ue()}},[v,i,y,w,l,N,C,A,k,d,f,H]),Jn(()=>{if(!v||i||!Js(W))return;L.current="",F.current="";const Y=kr(W),X=Ac(Y);queueMicrotask(()=>{const ie=E.current,ee=typeof ie=="function"?ie(T.current||""):ie;if(ee===void 0||ee===!1||ii(W,X))return;let ue=null;const pe=()=>(ue==null&&(ue=G(W)),ue[0]||W);let ke;ee===!0||ee===null?ke=pe():ke=ip(ee),ke=ke||pe();const je=ii(W,Ac(Y));L3(ke,{preventScroll:ke===W,shouldFocus(){if(!R.current)return!1;if(je)return!0;const Pe=Ac(Y);return!(Pe!==ke&&ii(W,Pe))}})})},[i,v,W,G,E,T,R]),Jn(()=>{if(i||!W)return;const Y=kr(W),X=Ac(Y),ie=T.current==null;NJ(X);function ee(ue){if(ue.open||(L.current=hrt(ue.nativeEvent,F.current)),ue.reason===mu&&ue.nativeEvent.type==="mouseleave"&&(P.current=!0),ue.reason===C_e)if(ue.nested)P.current=!1;else if(Hnt(ue.nativeEvent)||e_e(ue.nativeEvent))P.current=!1;else{let pe=!1;kr(W).createElement("div").focus({get preventScroll(){return pe=!0,!1}}),pe?P.current=!1:P.current=!0}}x.on("openchange",ee);function be(ue){const pe=j.current;let ke=typeof pe=="function"?pe(ue):pe;if(ke===void 0||ke===!1)return null;ke===null&&(ke=!0);const je=y!=null&&y.isConnected?y:null,Pe=X!=null&&X.isConnected&&ll(X)!=="body"?X:null;let Ee=ie?Pe||je:je||Pe;return Ee||(Ee=RJ()||null),typeof ke=="boolean"?Ee:ip(ke)||Ee||null}return()=>{x.off("openchange",ee);const ue=Ac(Y),pe=H(),ke=ii(w,ue)||pe.some(ze=>ze===ue||ii(ze,ue))||A&&Yg(A.nodesRef.current,k(),!1).some(ze=>{var _e;return ii((_e=ze.context)==null?void 0:_e.elements.floating,ue)}),je=j.current,Pe=L.current,Ee=be(Pe);queueMicrotask(()=>{const ze=prt(Ee),_e=typeof je!="boolean";if(je&&!P.current&&Js(ze)&&(!(!_e&&ze!==ue&&ue!==Y.body)||ke)){const ae={preventScroll:!0};Pe==="keyboard"&&(ae.focusVisible=!0),ze.focus(ae)}P.current=!1})}},[i,w,W,j,T,x,A,y,k,H]),Jn(()=>{if(!z1||v||!w)return;const Y=Ac(kr(w));!Js(Y)||!Kz(Y)||ii(w,Y)&&Y.blur()},[v,w]),Jn(()=>{if(!(i||!N))return N.setFocusManagerState({modal:l,closeOnFocusOut:c,open:v,onOpenChange:b.setOpen,domReference:y}),()=>{N.setFocusManagerState(null)}},[i,N,l,v,b,c,y]),Jn(()=>{if(!(i||!W))return IJ(W),()=>{queueMicrotask(aV)}},[i,W]);const se=!i&&(l?!C:!0)&&(ne||l);return a.jsxs(p.Fragment,{children:[se&&a.jsx(f0,{"data-type":"inside",ref:q,onFocus:Y=>{var X;if(l){const ie=G();L3(ie[ie.length-1])}else if(N!=null&&N.portalNode)if(P.current=!1,rw(Y,N.portalNode)){const ie=Jz(y);ie==null||ie.focus()}else(X=ip(f??N.beforeOutsideRef))==null||X.focus()}}),n,se&&a.jsx(f0,{"data-type":"inside",ref:U,onFocus:Y=>{var X;if(l)L3(G()[0]);else if(N!=null&&N.portalNode)if(c&&(P.current=!0),rw(Y,N.portalNode)){const ie=u_e(y);ie==null||ie.focus()}else(X=ip(d??N.afterOutsideRef))==null||X.focus()}})]})}function B_e(e,t={}){const{enabled:n=!0,event:i="click",toggle:r=!0,ignoreMouse:s=!1,stickIfOpen:o=!0,touchOpenDelay:l=0,reason:c=Yw}=t,u="rootStore"in e?e.rootStore:e,d=u.context.dataRef,f=p.useRef(void 0),h=Wz(),m=d0(),g=p.useMemo(()=>{function b(y,w,x,O){const k=fa(c,w,x);y&&O==="touch"&&l>0?m.start(l,()=>{u.setOpen(!0,k)}):u.setOpen(y,k)}function v(y,w,x){const O=d.current.openEvent,k=u.select("domReferenceElement")!==w;return y&&k||!y||!r?!0:O&&o?!x(O.type):!1}return{onPointerDown(y){f.current=iw(y.pointerType,!0)&&e_e(y.nativeEvent)?"virtual":y.pointerType},onMouseDown(y){const w=f.current,x=y.nativeEvent,O=u.select("open");if(y.button!==0||i==="click"||iw(w,!0)&&s)return;const k=v(O,y.currentTarget,E=>E==="click"||E==="mousedown"),S=uo(x);if(Kz(S)){b(k,x,S,w);return}const C=y.currentTarget;h.request(()=>{b(k,x,C,w)})},onClick(y){if(i==="mousedown-only")return;const w=f.current;if(i==="mousedown"&&w){f.current=void 0;return}if(iw(w,!0)&&s)return;const x=u.select("open"),O=v(x,y.currentTarget,k=>k==="click"||k==="mousedown"||k==="keydown"||k==="keyup");b(O,y.nativeEvent,y.currentTarget,w)},onKeyDown(){f.current=void 0}}},[d,i,s,c,u,o,r,h,m,l]);return p.useMemo(()=>n?{reference:g}:nc,[n,g])}function mrt(){return!1}function grt(e){return{escapeKey:typeof e=="boolean"?e:(e==null?void 0:e.escapeKey)??!1,outsidePress:typeof e=="boolean"?e:(e==null?void 0:e.outsidePress)??!0}}function U_e(e,t={}){const{enabled:n=!0,escapeKey:i=!0,outsidePress:r=!0,outsidePressEvent:s="sloppy",referencePress:o=mrt,bubbles:l,externalTree:c}=t,u="rootStore"in e?e.rootStore:e,d=u.useState("open"),f=u.useState("floatingElement"),{dataRef:h}=u.context,m=V1(c),g=ci(typeof r=="function"?r:()=>!1),b=typeof r=="function"?g:r,v=b!==!1,y=ci(()=>s),{escapeKey:w,outsidePress:x}=grt(l),O=p.useRef(!1),k=p.useRef(!1),S=p.useRef(!1),C=p.useRef(!1),E=p.useRef(""),j=p.useRef(null),T=d0(),R=d0(),A=ci(()=>{R.clear(),h.current.insideReactTree=!1}),N=ci(q=>{var z;const U=(z=h.current.floatingContext)==null?void 0:z.nodeId;return(m?Yg(m.nodesRef.current,U):[]).some(Z=>{var ne;return((ne=Z.context)==null?void 0:ne.open)&&!Z.context.dataRef.current[q]})}),P=ci(q=>j3(q,u.select("floatingElement"))||j3(q,u.select("domReferenceElement"))),I=ci(q=>{o()&&u.setOpen(!1,fa(Yw,q.nativeEvent))}),D=ci(q=>{if(!d||!n||!i||q.key!=="Escape"||C.current||!w&&N("__escapeKeyBubbles"))return;const U=Vnt(q)?q.nativeEvent:q,J=fa(T_e,U);u.setOpen(!1,J),J.isCanceled||q.preventDefault(),!w&&!J.isPropagationAllowed&&q.stopPropagation()}),_=ci(()=>{h.current.insideReactTree=!0,R.start(0,A)}),L=ci(q=>{if(!d||!n||q.button!==0)return;const U=uo(q.nativeEvent);ii(u.select("floatingElement"),U)&&(O.current||(O.current=!0,k.current=!1))}),F=ci(q=>{!d||!n||(q.defaultPrevented||q.nativeEvent.defaultPrevented)&&O.current&&(k.current=!0)});p.useEffect(()=>{if(!d||!n)return A;h.current.__escapeKeyBubbles=w,h.current.__outsidePressBubbles=x;const q=new Lu,U=new Lu;function J(){q.clear(),C.current=!0}function z(){q.start(z1?5:0,()=>{C.current=!1})}function Z(){S.current=!0,U.start(0,()=>{S.current=!1})}function ne(){O.current=!1,k.current=!1}function W(){const _e=E.current,ae=_e==="pen"||!_e?"mouse":_e,le=y(),ge=typeof le=="function"?le():le;return typeof ge=="string"?ge:ge[ae]}function G(_e){const ae=W();return ae==="intentional"&&_e.type!=="click"||ae==="sloppy"&&_e.type==="click"}function H(_e){var ge;const ae=(ge=h.current.floatingContext)==null?void 0:ge.nodeId,le=m&&Yg(m.nodesRef.current,ae).some(Oe=>{var Se;return j3(_e,(Se=Oe.context)==null?void 0:Se.elements.floating)});return P(_e)||le}function se(_e){if(G(_e)){_e.type!=="click"&&!P(_e)&&(U.clear(),S.current=!1),A();return}if(h.current.insideReactTree){A();return}const ae=uo(_e),le=`[${lI("inert")}]`,ge=Er(ae)?ae.getRootNode():null,Oe=Array.from((Gw(ge)?ge:kr(u.select("floatingElement"))).querySelectorAll(le)),Se=u.context.triggerElements;if(ae&&(Se.hasElement(ae)||Se.hasMatchingElement(Ye=>ii(Ye,ae))))return;let We=Er(ae)?ae:null;for(;We&&!Ig(We);){const Ye=Xg(We);if(Ig(Ye)||!Er(Ye))break;We=Ye}if(!(Oe.length&&Er(ae)&&!Unt(ae)&&!ii(ae,u.select("floatingElement"))&&Oe.every(Ye=>!ii(We,Ye)))){if(Js(ae)&&!("touches"in _e)){const Ye=Ig(ae),ye=Mu(ae),we=/auto|scroll/,Ae=Ye||we.test(ye.overflowX),He=Ye||we.test(ye.overflowY),Ue=Ae&&ae.clientWidth>0&&ae.scrollWidth>ae.clientWidth,jt=He&&ae.clientHeight>0&&ae.scrollHeight>ae.clientHeight,Pt=ye.direction==="rtl",Kt=jt&&(Pt?_e.offsetX<=ae.offsetWidth-ae.clientWidth:_e.offsetX>ae.clientWidth),Ct=Ue&&_e.offsetY>ae.clientHeight;if(Kt||Ct)return}if(!H(_e)){if(W()==="intentional"&&S.current){U.clear(),S.current=!1;return}typeof b=="function"&&!b(_e)||N("__outsidePressBubbles")||(u.setOpen(!1,fa(C_e,_e)),A())}}}function Y(_e){W()!=="sloppy"||_e.pointerType==="touch"||!u.select("open")||!n||P(_e)||se(_e)}function X(_e){if(W()!=="sloppy"||!u.select("open")||!n||P(_e))return;const ae=_e.touches[0];ae&&(j.current={startTime:Date.now(),startX:ae.clientX,startY:ae.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},T.start(1e3,()=>{j.current&&(j.current.dismissOnTouchEnd=!1,j.current.dismissOnMouseDown=!1)}))}function ie(_e,ae){const le=uo(_e);if(!le)return;const ge=Ni(le,_e.type,()=>{ae(_e),ge()})}function ee(_e){E.current="touch",ie(_e,X)}function be(_e){T.clear(),_e.type==="pointerdown"&&(E.current=_e.pointerType),!(_e.type==="mousedown"&&j.current&&!j.current.dismissOnMouseDown)&&ie(_e,ae=>{ae.type==="pointerdown"?Y(ae):se(ae)})}function ue(_e){if(!O.current)return;const ae=k.current;if(ne(),W()==="intentional"){if(_e.type==="pointercancel"){ae&&Z();return}if(!H(_e)){if(ae){Z();return}typeof b=="function"&&!b(_e)||(U.clear(),S.current=!0,A())}}}function pe(_e){if(W()!=="sloppy"||!j.current||P(_e))return;const ae=_e.touches[0];if(!ae)return;const le=Math.abs(ae.clientX-j.current.startX),ge=Math.abs(ae.clientY-j.current.startY),Oe=Math.sqrt(le*le+ge*ge);Oe>5&&(j.current.dismissOnTouchEnd=!0),Oe>10&&(se(_e),T.clear(),j.current=null)}function ke(_e){ie(_e,pe)}function je(_e){W()!=="sloppy"||!j.current||P(_e)||(j.current.dismissOnTouchEnd&&se(_e),T.clear(),j.current=null)}function Pe(_e){ie(_e,je)}const Ee=kr(f),ze=gh(i&&gh(Ni(Ee,"keydown",D),Ni(Ee,"compositionstart",J),Ni(Ee,"compositionend",z)),v&&gh(Ni(Ee,"click",be,!0),Ni(Ee,"pointerdown",be,!0),Ni(Ee,"pointerup",ue,!0),Ni(Ee,"pointercancel",ue,!0),Ni(Ee,"mousedown",be,!0),Ni(Ee,"mouseup",ue,!0),Ni(Ee,"touchstart",ee,!0),Ni(Ee,"touchmove",ke,!0),Ni(Ee,"touchend",Pe,!0)));return()=>{ze(),q.clear(),U.clear(),ne(),S.current=!1,A()}},[h,f,i,v,b,d,n,w,x,D,A,y,N,P,m,u,T]);const M=p.useMemo(()=>({onKeyDown:D,onPointerDown:I,onClick:I}),[D,I]),V=p.useMemo(()=>({onKeyDown:D,onPointerDown:F,onMouseDown:F,onClickCapture:_,onMouseDownCapture(q){_(),L(q)},onPointerDownCapture(q){_(),L(q)},onMouseUpCapture:_,onTouchEndCapture:_,onTouchMoveCapture:_}),[D,_,L,F]);return p.useMemo(()=>n?{reference:M,floating:V,trigger:M}:{},[n,M,V])}function PJ(e,t,n){let{reference:i,floating:r}=e;const s=dd(t),o=WD(t),l=qD(o),c=vd(t),u=s==="y",d=i.x+i.width/2-r.width/2,f=i.y+i.height/2-r.height/2,h=i[l]/2-r[l]/2;let m;switch(c){case"top":m={x:d,y:i.y-r.height};break;case"bottom":m={x:d,y:i.y+i.height};break;case"right":m={x:i.x+i.width,y:f};break;case"left":m={x:i.x-r.width,y:f};break;default:m={x:i.x,y:i.y}}const g=hm(t);return g&&(m[o]+=h*(g==="end"?1:-1)*(n&&u?-1:1)),m}async function brt(e,t){var n;t===void 0&&(t={});const{x:i,y:r,platform:s,rects:o,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=Oh(t,e),g=Yz(m),v=l[h?f==="floating"?"reference":"floating":f],y=rI(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),w=f==="floating"?{x:i,y:r,width:o.floating.width,height:o.floating.height}:o.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),O=await(s.isElement==null?void 0:s.isElement(x))&&await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1},k=rI(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:x,strategy:c}):w);return{top:(y.top-k.top+g.top)/O.y,bottom:(k.bottom-y.bottom+g.bottom)/O.y,left:(y.left-k.left+g.left)/O.x,right:(k.right-y.right+g.right)/O.x}}const yrt=50,vrt=async(e,t,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:s=[],platform:o}=n,l=o.detectOverflow?o:{...o,detectOverflow:brt},c=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:f}=PJ(u,i,c),h=i,m=0;const g={};for(let b=0;b({name:"arrow",options:e,async fn(t){const{x:n,y:i,placement:r,rects:s,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=Oh(e,t)||{};if(u==null)return{};const f=Yz(d),h={x:n,y:i},m=WD(r),g=qD(m),b=await o.getDimensions(u),v=m==="y",y=v?"top":"left",w=v?"bottom":"right",x=v?"clientHeight":"clientWidth",O=s.reference[g]+s.reference[m]-h[m]-s.floating[g],k=h[m]-s.reference[m],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let C=S?S[x]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=l.floating[x]||s.floating[g]);const E=O/2-k/2,j=C/2-b[g]/2-1,T=Zg(f[y],j),R=Zg(f[w],j),A=C-b[g]-R,N=C/2-b[g]/2+E,P=Gz(T,N,A),I=!c.arrow&&hm(r)!=null&&N!==P&&s.reference[g]/2-(NP<=0)){var R,A;const P=(((R=s.flip)==null?void 0:R.index)||0)+1,I=C[P];if(I&&(!(f==="alignment"?w!==dd(I):!1)||T.every(L=>dd(L.placement)===w?L.overflows[0]>0:!0)))return{data:{index:P,overflows:T},reset:{placement:I}};let D=(A=T.filter(_=>_.overflows[0]<=0).sort((_,L)=>_.overflows[1]-L.overflows[1])[0])==null?void 0:A.placement;if(!D)switch(m){case"bestFit":{var N;const _=(N=T.filter(L=>{if(S){const F=dd(L.placement);return F===w||F==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(F=>F>0).reduce((F,M)=>F+M,0)]).sort((L,F)=>L[1]-F[1])[0])==null?void 0:N[0];_&&(D=_);break}case"initialPlacement":D=l;break}if(r!==D)return{reset:{placement:D}}}return{}}}};function DJ(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function MJ(e){return Wnt.some(t=>e[t]>=0)}const Ort=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:i}=t,{strategy:r="referenceHidden",...s}=Oh(e,t);switch(r){case"referenceHidden":{const o=await i.detectOverflow(t,{...s,elementContext:"reference"}),l=DJ(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:MJ(l)}}}case"escaped":{const o=await i.detectOverflow(t,{...s,altBoundary:!0}),l=DJ(o,n.floating);return{data:{escapedOffsets:l,escaped:MJ(l)}}}default:return{}}}}},Q_e=new Set(["left","top"]);async function krt(e,t){const{placement:n,platform:i,elements:r}=e,s=await(i.isRTL==null?void 0:i.isRTL(r.floating)),o=vd(n),l=hm(n),c=dd(n)==="y",u=Q_e.has(o)?-1:1,d=s&&c?-1:1,f=Oh(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof g=="number"&&(m=l==="end"?g*-1:g),c?{x:m*d,y:h*u}:{x:h*u,y:m*d}}const Srt=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,i;const{x:r,y:s,placement:o,middlewareData:l}=t,c=await krt(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(i=l.arrow)!=null&&i.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:{...c,placement:o}}}}},Ert=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:i,placement:r,platform:s}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:c={fn:w=>{let{x,y:O}=w;return{x,y:O}}},...u}=Oh(e,t),d={x:n,y:i},f=await s.detectOverflow(t,u),h=dd(r),m=Xz(h);let g=d[m],b=d[h];const v=(w,x)=>Gz(x+f[w==="y"?"top":"left"],x,x-f[w==="y"?"bottom":"right"]);o&&(g=v(m,g)),l&&(b=v(h,b));const y=c.fn({...t,[m]:g,[h]:b});return{...y,data:{x:y.x-n,y:y.y-i,enabled:{[m]:o,[h]:l}}}}}},Crt=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,i;const{x:r,y:s,placement:o,rects:l,middlewareData:c}=t,{offset:u=0,mainAxis:d=!0,crossAxis:f=!0}=Oh(e,t),h={x:r,y:s},m=dd(o),g=Xz(m);let b=h[g],v=h[m];const y=Oh(u,t),w=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:(n=y.mainAxis)!=null?n:0,crossAxis:(i=y.crossAxis)!=null?i:0};if(d){const k=g==="y"?"height":"width",S=l.reference[g]-l.floating[k]+w.mainAxis,C=l.reference[g]+l.reference[k]-w.mainAxis;bC&&(b=C)}if(f){var x,O;const k=g==="y"?"width":"height",S=Q_e.has(vd(o)),C=l.reference[m]-l.floating[k]+(S&&((x=c.offset)==null?void 0:x[m])||0)+(S?0:w.crossAxis),E=l.reference[m]+l.reference[k]+(S?0:((O=c.offset)==null?void 0:O[m])||0)-(S?w.crossAxis:0);vE&&(v=E)}return{[g]:b,[m]:v}}}},Art=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:i,platform:r,elements:s}=t,{apply:o=()=>{},...l}=Oh(e,t),c=await r.detectOverflow(t,l),u=vd(n),d=hm(n),f=dd(n)==="y",{width:h,height:m}=i.floating;let g,b;u==="top"||u==="bottom"?(g=u,b=d===(await(r.isRTL==null?void 0:r.isRTL(s.floating))?"start":"end")?"left":"right"):(b=u,g=d==="end"?"top":"bottom");const v=m-c.top-c.bottom,y=h-c.left-c.right,w=Zg(m-c[g],v),x=Zg(h-c[b],y),O=t.middlewareData.shift,k=!O;let S=w,C=x;O!=null&&O.enabled.x&&(C=y),O!=null&&O.enabled.y&&(S=v),k&&!d&&(f?C=h-2*Ip(c.left,c.right):S=m-2*Ip(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});const E=await r.getDimensions(s.floating);return h!==E.width||m!==E.height?{reset:{rects:!0}}:{}}}};function z_e(e){const t=Mu(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const r=Js(e),s=r?e.offsetWidth:n,o=r?e.offsetHeight:i,l=nI(n)!==s||nI(i)!==o;return l&&(n=s,i=o),{width:n,height:i,$:l}}function oV(e){return Er(e)?e:e.contextElement}function sw(e){const t=oV(e);if(!Js(t))return Pp(1);const n=t.getBoundingClientRect(),{width:i,height:r,$:s}=z_e(t);let o=(s?nI(n.width):n.width)/i,l=(s?nI(n.height):n.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const Trt=Pp(0);function V_e(e){const t=ta(e);return!qz()||!t.visualViewport?Trt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _rt(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ta(e)}function h0(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=oV(e);let o=Pp(1);t&&(i?Er(i)&&(o=sw(i)):o=sw(e));const l=_rt(s,n,i)?V_e(s):Pp(0);let c=(r.left+l.x)/o.x,u=(r.top+l.y)/o.y,d=r.width/o.x,f=r.height/o.y;if(s&&i){const h=ta(s),m=Er(i)?ta(i):i;let g=h,b=Y8(g);for(;b&&m!==g;){const v=sw(b),y=b.getBoundingClientRect(),w=Mu(b),x=y.left+(b.clientLeft+parseFloat(w.paddingLeft))*v.x,O=y.top+(b.clientTop+parseFloat(w.paddingTop))*v.y;c*=v.x,u*=v.y,d*=v.x,f*=v.y,c+=x,u+=O,g=ta(b),b=Y8(g)}}return rI({width:d,height:f,x:c,y:u})}function YD(e,t){const n=zD(e).scrollLeft;return t?t.left+n:h0(fm(e)).left+n}function H_e(e,t){const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-YD(e,n),r=n.top+t.scrollTop;return{x:i,y:r}}function jrt(e){let{elements:t,rect:n,offsetParent:i,strategy:r}=e;const s=r==="fixed",o=fm(i),l=t?QD(t.floating):!1;if(i===o||l&&s)return n;let c={scrollLeft:0,scrollTop:0},u=Pp(1);const d=Pp(0),f=Js(i);if((f||!s)&&((ll(i)!=="body"||UA(o))&&(c=zD(i)),f)){const m=h0(i);u=sw(i),d.x=m.x+i.clientLeft,d.y=m.y+i.clientTop}const h=o&&!f&&!s?H_e(o,c):Pp(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+h.x,y:n.y*u.y-c.scrollTop*u.y+d.y+h.y}}function Nrt(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Rrt(e){const t=zD(e),n=e.ownerDocument.body,i=Ip(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=Ip(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-t.scrollLeft+YD(e);const o=-t.scrollTop;return Mu(n).direction==="rtl"&&(s+=Ip(e.clientWidth,n.clientWidth)-i),{width:i,height:r,x:s,y:o}}const Irt=25;function Prt(e,t,n){n===void 0&&(n="viewport");const i=n==="layoutViewport",r=ta(e),s=fm(e),o=r.visualViewport;let l=s.clientWidth,c=s.clientHeight,u=0,d=0;if(o){const h=!qz()||t==="fixed";i?h||(u=-o.offsetLeft,d=-o.offsetTop):(l=o.width,c=o.height,h&&(u=o.offsetLeft,d=o.offsetTop))}if(YD(s)<=0){const h=s.ownerDocument,m=h.body,g=getComputedStyle(m),b=h.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,v=Math.abs(s.clientWidth-m.clientWidth-b),y=getComputedStyle(s).scrollbarGutter==="stable both-edges"?v/2:v;y<=Irt&&(l-=y)}return{width:l,height:c,x:u,y:d}}function Drt(e,t){const n=h0(e,!0,t==="fixed"),i=n.top+e.clientTop,r=n.left+e.clientLeft,s=sw(e),o=e.clientWidth*s.x,l=e.clientHeight*s.y,c=r*s.x,u=i*s.y;return{width:o,height:l,x:c,y:u}}function LJ(e,t,n){let i;if(t==="viewport"||t==="layoutViewport")i=Prt(e,n,t);else if(t==="document")i=Rrt(fm(e));else if(Er(t))i=Drt(t,n);else{const r=V_e(e);i={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return rI(i)}function Mrt(e,t){const n=t.get(e);if(n)return n;let i=oC(e,[],!1).filter(l=>Er(l)&&ll(l)!=="body"),r=null;const s=Mu(e).position==="fixed";let o=s?Xg(e):e;for(;Er(o)&&!Ig(o);){const l=Mu(o),c=Hz(o),u=r?r.position:s?"fixed":"";!c&&(u==="fixed"||u==="absolute"&&l.position==="static")?i=i.filter(f=>f!==o):r=l,o=Xg(o)}return t.set(e,i),i}function Lrt(e){let{element:t,boundary:n,rootBoundary:i,strategy:r}=e;const o=[...n==="clippingAncestors"?QD(t)?[]:Mrt(t,this._c):[].concat(n),i],l=LJ(t,o[0],r);let c=l.top,u=l.right,d=l.bottom,f=l.left;for(let h=1;h{l(!1,1e-7)},1e3)}C=!1}try{i=new IntersectionObserver(E,{...S,root:s.ownerDocument})}catch{i=new IntersectionObserver(E,S)}i.observe(e)}const c=ta(e),u=()=>l(n);return c.addEventListener("resize",u),l(!0),()=>{c.removeEventListener("resize",u),o()}}function aB(e,t,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=i,u=oV(e),d=r||s?[...u?oC(u):[],...t?oC(t):[]]:[];d.forEach(y=>{r&&y.addEventListener("scroll",n),s&&y.addEventListener("resize",n)});const f=u&&l?zrt(u,n,s):null;let h=-1,m=null;o&&(m=new ResizeObserver(y=>{let[w]=y;w&&w.target===u&&m&&t&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),n()}),u&&!c&&m.observe(u),t&&m.observe(t));let g,b=c?h0(e):null;c&&v();function v(){const y=h0(e);b&&!W_e(b,y)&&n(),b=y,g=requestAnimationFrame(v)}return n(),()=>{var y;d.forEach(w=>{r&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),f==null||f(),(y=m)==null||y.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const Vrt=Srt,Hrt=Ert,qrt=wrt,Wrt=Art,Krt=Ort,FJ=xrt,Grt=Crt,Xrt=(e,t,n)=>{const i=new Map,r=n??{},s={...Qrt,...r.platform,_c:i};return vrt(e,t,{...r,platform:s})};var Yrt=typeof document<"u",Zrt=function(){},pN=Yrt?p.useLayoutEffect:Zrt;function cI(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,i,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(i=n;i--!==0;)if(!cI(e[i],t[i]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!{}.hasOwnProperty.call(t,r[i]))return!1;for(i=n;i--!==0;){const s=r[i];if(!(s==="_owner"&&e.$$typeof)&&!cI(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function K_e(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function BJ(e,t){const n=K_e(e);return Math.round(t*n)/n}function U3(e){const t=p.useRef(e);return pN(()=>{t.current=e}),t}function G_e(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:i=[],platform:r,elements:{reference:s,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=p.useState(i);cI(h,i)||m(i);const[g,b]=p.useState(null),[v,y]=p.useState(null),w=p.useCallback(L=>{L!==S.current&&(S.current=L,b(L))},[]),x=p.useCallback(L=>{L!==C.current&&(C.current=L,y(L))},[]),O=s||g,k=o||v,S=p.useRef(null),C=p.useRef(null),E=p.useRef(d),j=c!=null,T=U3(c),R=U3(r),A=U3(u),N=p.useCallback(()=>{if(!S.current||!C.current)return;const L={placement:t,strategy:n,middleware:h};R.current&&(L.platform=R.current),Xrt(S.current,C.current,L).then(F=>{const M={...F,isPositioned:A.current!==!1};P.current&&!cI(E.current,M)&&(E.current=M,yi.flushSync(()=>{f(M)}))})},[h,t,n,R,A]);pN(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(L=>({...L,isPositioned:!1})))},[u]);const P=p.useRef(!1);pN(()=>(P.current=!0,()=>{P.current=!1}),[]),pN(()=>{if(O&&(S.current=O),k&&(C.current=k),O&&k){if(T.current)return T.current(O,k,N);N()}},[O,k,N,T,j]);const I=p.useMemo(()=>({reference:S,floating:C,setReference:w,setFloating:x}),[w,x]),D=p.useMemo(()=>({reference:O,floating:k}),[O,k]),_=p.useMemo(()=>{const L={position:n,left:0,top:0};if(!D.floating)return L;const F=BJ(D.floating,d.x),M=BJ(D.floating,d.y);return l?{...L,transform:"translate("+F+"px, "+M+"px)",...K_e(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:M}},[n,l,D.floating,d.x,d.y]);return p.useMemo(()=>({...d,update:N,refs:I,elements:D,floatingStyles:_}),[d,N,I,D,_])}const Jrt=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:i,padding:r}=typeof e=="function"?e(n):e;return i&&t(i)?i.current!=null?FJ({element:i.current,padding:r}).fn(n):{}:i?FJ({element:i,padding:r}).fn(n):{}}}},X_e=(e,t)=>{const n=Vrt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Y_e=(e,t)=>{const n=Hrt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Z_e=(e,t)=>({fn:Grt(e).fn,options:[e,t]}),J_e=(e,t)=>{const n=qrt(e);return{name:n.name,fn:n.fn,options:[e,t]}},eje=(e,t)=>{const n=Wrt(e);return{name:n.name,fn:n.fn,options:[e,t]}},est=(e,t)=>{const n=Krt(e);return{name:n.name,fn:n.fn,options:[e,t]}},tst=(e,t)=>{const n=Jrt(e);return{name:n.name,fn:n.fn,options:[e,t]}},nst={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId};class lV extends BD{constructor(n){const{syncOnly:i,nested:r,onOpenChange:s,triggerElements:o,...l}=n;super({...l,positionReference:l.referenceElement,domReferenceElement:l.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:M_e(),nested:r,triggerElements:o},nst);Zt(this,"syncOpenEvent",(n,i)=>{(!n||!this.state.open||i!=null&&qnt(i))&&(this.context.dataRef.current.openEvent=n?i:void 0)});Zt(this,"dispatchOpenChange",(n,i)=>{this.syncOpenEvent(n,i.event);const r={open:n,reason:i.reason,nativeEvent:i.event,nested:this.context.nested,triggerElement:i.trigger};this.context.events.emit("openchange",r)});Zt(this,"setOpen",(n,i)=>{var r,s,o,l;if(this.syncOnly){(s=(r=this.context).onOpenChange)==null||s.call(r,n,i);return}this.dispatchOpenChange(n,i),(l=(o=this.context).onOpenChange)==null||l.call(o,n,i)});this.syncOnly=i}}function ist(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:i,floatingId:r,nested:s,onOpenChange:o}=e,l=t.useState("open"),c=t.useState("activeTriggerElement"),u=t.useState(n?"popupElement":"positionerElement"),d=t.context.triggerElements,f=o,h=p.useRef(null);i===void 0&&h.current===null&&(h.current=new lV({open:l,transitionStatus:void 0,referenceElement:c,floatingElement:u,triggerElements:d,onOpenChange:f,floatingId:r,syncOnly:!0,nested:s}));const m=i??h.current;return t.useSyncedValue("floatingId",r),Jn(()=>{const g={open:l,floatingId:r,referenceElement:c,floatingElement:u};Er(c)&&(g.domReferenceElement=c),m.state.positionReference===m.state.referenceElement&&(g.positionReference=c),m.update(g)},[l,r,c,u,m]),m.context.onOpenChange=f,m.context.nested=s,m}function tje(e,t=!1,n=!1){const[i,r]=p.useState(e&&t?"idle":void 0),[s,o]=p.useState(e);return e&&!s&&(o(!0),r("starting")),!e&&s&&i!=="ending"&&!n&&r("ending"),!e&&!s&&i==="ending"&&r(void 0),Jn(()=>{if(!e&&s&&i!=="ending"&&n){const l=_c.request(()=>{r("ending")});return()=>{_c.cancel(l)}}},[e,s,i,n]),Jn(()=>{if(!e||t)return;const l=_c.request(()=>{r(void 0)});return()=>{_c.cancel(l)}},[t,e]),Jn(()=>{if(!e||!t)return;e&&s&&i!=="idle"&&r("starting");const l=_c.request(()=>{r("idle")});return()=>{_c.cancel(l)}},[t,e,s,i]),{mounted:s,setMounted:o,transitionStatus:i}}const nje={tabIndex:-1,[J8]:""};function ije(e){return t=>t==="touch"?e.current:!0}function rje(e,t=!1){const n=VA(),i=XD()!=null,r=Ed(()=>e(n,i)).current;return ist({popupStore:r,treatPopupAsFloatingElement:t,floatingRootContext:r.state.floatingRootContext,floatingId:n,nested:i,onOpenChange:r.setOpen}),r}function sje({handle:e,store:t}){return Jn(()=>e.attachStore(t),[e,t]),null}function rst(e,t){const n=p.useRef(null),i=p.useRef(null);return p.useCallback(r=>{if(e===void 0)return;let s=!1;if(n.current!==null){const o=n.current,l=i.current,c=t.context.triggerElements.getById(o);l&&c===l&&(t.context.triggerElements.delete(o),s=!0),n.current=null,i.current=null}if(r!==null&&(n.current=e,i.current=r,t.context.triggerElements.add(e,r),s=!0),s){const o=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==o&&t.set("triggerCount",o)}},[t,e])}function aje(e,t,n,i=!1){t?e.preventUnmountingOnClose=!1:i&&(e.preventUnmountingOnClose=!0);const r=(n==null?void 0:n.id)??null;(r||t)&&(e.activeTriggerId=r,e.activeTriggerElement=n??null)}function sst(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function oje(e,t,n,i){const r=n.useState("isMountedByTrigger",e),s=rst(e,n),o=ci(c=>{const u=n.select("open"),d=n.select("activeTriggerId");if(d===e){n.update({activeTriggerElement:c,...u?i:null});return}d==null&&u&&n.update({activeTriggerId:e,activeTriggerElement:c,...i})}),l=p.useCallback(c=>{s(c),c&&o(c)},[s,o]);return Jn(()=>{r&&n.update({activeTriggerElement:t.current,...i})},[r,n,t,...Object.values(i)]),{registerTrigger:l,isMountedByThisTrigger:r}}function lje(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,i=p.useRef(null),r=e.useState("open"),s=e.useState("triggerCount"),o=e.useState("activeTriggerId"),l=e.useState("activeTriggerElement");Jn(()=>{if(!r){i.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}const c=e.context.triggerElements.size,u={};e.state.triggerCount!==c&&(u.triggerCount=c);const d=e.select("activeTriggerId");let f=null;if(d){const h=e.context.triggerElements.getById(d);if(h)i.current=d,h!==e.state.activeTriggerElement&&(u.activeTriggerElement=h);else{for(const[m,g]of e.context.triggerElements.entries())if(g===e.state.activeTriggerElement){u.activeTriggerId=m,u.activeTriggerElement=g,i.current=m;break}u.activeTriggerId===void 0&&(i.current===d?f=d:i.current=null)}}else i.current=null;if(!f&&!d&&c===1){const h=e.context.triggerElements.entries().next();if(!h.done){const[m,g]=h.value;u.activeTriggerId=m,u.activeTriggerElement=g,i.current=m}}(u.triggerCount!==void 0||u.activeTriggerId!==void 0||u.activeTriggerElement!==void 0)&&e.update(u),f&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===f&&!e.context.triggerElements.getById(f)){const h=fa(E_e);e.setOpen(!1,h),h.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[r,e,s,o,l,n])}function cje(e,t,n){const{mounted:i,setMounted:r,transitionStatus:s}=tje(e),o=t.useState("preventUnmountingOnClose"),l=e?!1:o;t.useSyncedValues({mounted:i,transitionStatus:s,preventUnmountingOnClose:l});const c=ci(()=>{var u,d;r(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n==null||n(),(d=(u=t.context).onOpenChangeComplete)==null||d.call(u,!1)});return zA({enabled:i&&!e&&!l,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:s}}function uje(e,t){e.useSyncedValues(t),Jn(()=>()=>{e.update({activeTriggerProps:nc,inactiveTriggerProps:nc,popupProps:nc})},[e])}function dje(e,t){Jn(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),Jn(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class cV{constructor(){this.idMap=new Map}add(t,n){this.idMap.set(t,n)}delete(t){this.idMap.delete(t)}hasElement(t){for(const n of this.idMap.values())if(n===t)return!0;return!1}hasMatchingElement(t){for(const n of this.idMap.values())if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function ast(){return new lV({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new cV,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function fje(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:ast(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:nc,inactiveTriggerProps:nc,popupProps:nc}}function hje(e,t,n=!1){return new lV({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}const tE=e=>e.triggerIdProp??e.activeTriggerId,uV=e=>e.openProp??e.open,UJ=e=>{var n;return(((n=e.popupElement)==null?void 0:n.id)??e.floatingId)||void 0};function pje(e,t){return t!==void 0&&uV(e)&&tE(e)===t}function ost(e,t){return pje(e,t)?!0:t!==void 0&&uV(e)&&tE(e)==null&&e.triggerCount===1}const mje={open:uV,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:tE,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:UJ,isTriggerActive:(e,t)=>t!==void 0&&tE(e)===t,isOpenedByTrigger:(e,t)=>pje(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&tE(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>ost(e,t)?UJ(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function gje(e){const t=p.useCallback(i=>e===void 0?Bz:e.subscribeStore(i),[e]),n=p.useCallback(()=>e===void 0?void 0:e.store,[e]);return ZP.useSyncExternalStore(t,n,()=>e==null?void 0:e.serverStore)}function lst(e){return cst(e,e.rootContext)}function cst(e,t){const{nodeId:n,externalTree:i}=e,r=t.useState("referenceElement"),s=t.useState("floatingElement"),o=t.useState("domReferenceElement"),l=t.useState("open"),c=t.useState("floatingId"),[u,d]=p.useState(null),[f,h]=p.useState(void 0),[m,g]=p.useState(void 0),b=p.useRef(null),v=V1(i),y=p.useMemo(()=>({reference:r,floating:s,domReference:o}),[r,s,o]),w=G_e({...e,elements:{...y,...u&&{reference:u}}}),x=Er(f)?f:null,O=m===void 0?t.state.floatingElement:m;t.useSyncedValue("referenceElement",f??null),t.useSyncedValue("domReferenceElement",f===void 0?o:x),t.useSyncedValue("floatingElement",O);const k=p.useCallback(R=>{const A=Er(R)?{getBoundingClientRect:()=>R.getBoundingClientRect(),getClientRects:()=>R.getClientRects(),contextElement:R}:R;d(A),w.refs.setReference(A)},[w.refs]),S=p.useCallback(R=>{(Er(R)||R===null)&&(b.current=R,h(R)),(Er(w.refs.reference.current)||w.refs.reference.current===null||R!==null&&!Er(R))&&w.refs.setReference(R)},[w.refs,h]),C=p.useCallback(R=>{g(R),w.refs.setFloating(R)},[w.refs]),E=p.useMemo(()=>({...w.refs,setReference:S,setFloating:C,setPositionReference:k,domReference:b}),[w.refs,S,C,k]),j=p.useMemo(()=>({...w.elements,domReference:o}),[w.elements,o]),T=p.useMemo(()=>({...w,dataRef:t.context.dataRef,open:l,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:E,elements:j,nodeId:n,rootStore:t}),[w,E,j,n,t,l,c]);return Jn(()=>{o&&(b.current=o)},[o]),Jn(()=>{t.context.dataRef.current.floatingContext=T;const R=v==null?void 0:v.nodesRef.current.find(A=>A.id===n);R&&(R.context=T)}),p.useMemo(()=>({...w,context:T,refs:E,elements:j,rootStore:t}),[w,E,j,T,t])}class dV{constructor(){Zt(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});Zt(this,"disposeEffect",()=>this.dispose);this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new Lu,this.restTimeout=new Lu,this.handleCloseOptions=void 0}static create(){return new dV}}const uI=new WeakMap;function dI(e){var n,i,r;if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&uI.get(t)===e&&((n=e.pointerEventsScopeElement)==null||n.style.removeProperty("pointer-events"),(i=e.pointerEventsReferenceElement)==null||i.style.removeProperty("pointer-events"),(r=e.pointerEventsFloatingElement)==null||r.style.removeProperty("pointer-events"),uI.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function bje(e,t){const{scopeElement:n,referenceElement:i,floatingElement:r}=t,s=uI.get(n);s&&s!==e&&dI(s),dI(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=i,e.pointerEventsFloatingElement=r,uI.set(n,e),n.style.pointerEvents="none",i.style.pointerEvents="auto",r.style.pointerEvents="auto"}function yje(e){const t=e.context.dataRef.current,n=Ed(()=>t.hoverInteractionState??dV.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=n),$D(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function ust(e,t={}){const{enabled:n=!0,closeDelay:i=0,nodeId:r}=t,s="rootStore"in e?e.rootStore:e,o=s.useState("open"),l=s.useState("floatingElement"),c=s.useState("domReferenceElement"),{dataRef:u}=s.context,d=V1(),f=XD(),h=yje(s),m=d0(),g=ci(()=>{var y;return P_e((y=u.current.openEvent)==null?void 0:y.type,h.interactedInside)}),b=ci(()=>{var y;return art((y=u.current.openEvent)==null?void 0:y.type)}),v=ci(()=>{dI(h)});Jn(()=>{o||(h.pointerType=void 0,h.restTimeoutPending=!1,h.interactedInside=!1,v())},[o,h,v]),p.useEffect(()=>v,[v]),Jn(()=>{var y,w,x,O,k;if(n&&o&&(y=h.handleCloseOptions)!=null&&y.blockPointerEvents&&b()&&Er(c)&&l){const S=c,C=l,E=kr(l),j=(x=(w=d==null?void 0:d.nodesRef.current.find(N=>N.id===f))==null?void 0:w.context)==null?void 0:x.elements.floating;j&&(j.style.pointerEvents="");const T=h.pointerEventsScopeElement!==C?h.pointerEventsScopeElement:null,R=j!==C?j:null,A=((k=(O=h.handleCloseOptions)==null?void 0:O.getScope)==null?void 0:k.call(O))??T??R??S.closest("[data-rootownerid]")??E.body;return bje(h,{scopeElement:A,referenceElement:S,floatingElement:C}),()=>{v()}}},[n,o,c,l,h,b,d,f,v]),p.useEffect(()=>{if(!n)return;function y(){return!!(d&&f&&Yg(d.nodesRef.current,f).length>0)}function w(E){const j=rB(i,"close",h.pointerType),T=()=>{s.setOpen(!1,fa(mu,E)),d==null||d.events.emit("floating.closed",E)};j?h.openChangeTimeout.start(j,T):(h.openChangeTimeout.clear(),T())}function x(E){const j=uo(E);if(!Qnt(j)){h.interactedInside=!1;return}h.interactedInside=(j==null?void 0:j.closest("[aria-haspopup]"))!=null}function O(){h.openChangeTimeout.clear(),m.clear(),d==null||d.events.off("floating.closed",S),v()}function k(E){var A;if(y()&&d){d.events.on("floating.closed",S);return}if(J2e(E.relatedTarget,s.context.triggerElements))return;const j=((A=u.current.floatingContext)==null?void 0:A.nodeId)??r,T=E.relatedTarget;if(!(d&&j&&Er(T)&&Yg(d.nodesRef.current,j,!1).some(N=>{var P;return ii((P=N.context)==null?void 0:P.elements.floating,T)}))){if(h.handler){h.handler(E);return}v(),b()&&!g()&&w(E)}}function S(E){!d||!f||y()||m.start(0,()=>{d.events.off("floating.closed",S),s.setOpen(!1,fa(mu,E)),d.events.emit("floating.closed",E)})}const C=l;return gh(C&&Ni(C,"mouseenter",O),C&&Ni(C,"mouseleave",k),C&&Ni(C,"pointerdown",x,!0),()=>{d==null||d.events.off("floating.closed",S)})},[n,l,s,u,i,r,b,g,v,h,d,f,m])}const dst={current:null};function fst(e,t={}){var D;const{enabled:n=!0,delay:i=0,handleClose:r=null,mouseOnly:s=!1,restMs:o=0,move:l=!0,triggerElementRef:c=dst,externalTree:u,isActiveTrigger:d=!0,getHandleCloseContext:f,isClosing:h,shouldOpen:m,guardStaleOpen:g=!1}=t,b="rootStore"in e?e.rootStore:e,{dataRef:v,events:y}=b.context,w=V1(u),x=yje(b),O=p.useRef(!1),k=Zl(r),S=Zl(i),C=Zl(o),E=Zl(n),j=Zl(m),T=Zl(h),R=ci(()=>{var _;return P_e((_=v.current.openEvent)==null?void 0:_.type,x.interactedInside)}),A=ci(()=>{var _;return((_=j.current)==null?void 0:_.call(j))!==!1}),N=ci((_,L,F)=>{const M=b.context.triggerElements;if(M.hasElement(L))return!_||!ii(_,L);if(!Er(F))return!1;const V=F;return M.hasMatchingElement(q=>ii(q,V))&&(!_||!ii(_,V))}),P=ci(()=>{if(!x.handler)return;kr(b.select("domReferenceElement")).removeEventListener("mousemove",x.handler),x.handler=void 0}),I=ci(()=>{dI(x)});return d&&(x.handleCloseOptions=(D=k.current)==null?void 0:D.__options),p.useEffect(()=>P,[P]),p.useEffect(()=>{if(!n)return;function _(L){L.open?O.current=!1:(O.current=L.reason===mu,P(),x.openChangeTimeout.clear(),x.restTimeout.clear(),x.blockMouseMove=!0,x.restTimeoutPending=!1)}return y.on("openchange",_),()=>{y.off("openchange",_)}},[n,y,x,P]),p.useEffect(()=>{if(!n)return;function _(U,J=!0){const z=rB(S.current,"close",x.pointerType);z?x.openChangeTimeout.start(z,()=>{b.setOpen(!1,fa(mu,U)),w==null||w.events.emit("floating.closed",U)}):J&&(x.openChangeTimeout.clear(),b.setOpen(!1,fa(mu,U)),w==null||w.events.emit("floating.closed",U))}const L=c.current??(d?b.select("domReferenceElement"):null);if(!Er(L))return;function F(U){var pe;if(x.openChangeTimeout.clear(),x.blockMouseMove=!1,s&&!iw(x.pointerType))return;const J=SJ(C.current),z=rB(S.current,"open",x.pointerType),Z=uo(U),ne=U.currentTarget??null,W=b.select("domReferenceElement");let G=ne;if(Er(Z)&&!b.context.triggerElements.hasElement(Z)){for(const ke of b.context.triggerElements.elements())if(ii(ke,Z)){G=ke;break}}Er(ne)&&Er(W)&&!b.context.triggerElements.hasElement(ne)&&ii(ne,W)&&(G=W);const H=G==null?!1:N(W,G,Z),se=b.select("open"),Y=((pe=T.current)==null?void 0:pe.call(T))??b.select("transitionStatus")==="ending",X=!se&&Y&&O.current,ie=!H&&Er(G)&&Er(W)&&ii(W,G)&&X,ee=J>0&&!z,be=H&&(se||X)||ie,ue=!se||H;if(be){A()&&b.setOpen(!0,fa(mu,U,G));return}ee||(z?x.openChangeTimeout.start(z,()=>{ue&&A()&&b.setOpen(!0,fa(mu,U,G))}):ue&&A()&&b.setOpen(!0,fa(mu,U,G)))}function M(U){if(R()){I();return}P();const J=b.select("domReferenceElement"),z=kr(J);x.restTimeout.clear(),x.restTimeoutPending=!1;const Z=v.current.floatingContext??(f==null?void 0:f());if(J2e(U.relatedTarget,b.context.triggerElements))return;if(k.current&&Z){b.select("open")||x.openChangeTimeout.clear();const W=c.current;x.handler=k.current({...Z,tree:w,x:U.clientX,y:U.clientY,onClose(){I(),P(),E.current&&!R()&&W===b.select("domReferenceElement")&&_(U,!0)}}),z.addEventListener("mousemove",x.handler),x.handler(U);return}(x.pointerType==="touch"?!ii(b.select("floatingElement"),U.relatedTarget):!0)&&_(U)}function V(U){ii(L,U.relatedTarget)||(x.openChangeTimeout.clear(),x.restTimeout.clear(),x.restTimeoutPending=!1)}const q=g?Ni(L,"mouseout",V):void 0;return l?gh(Ni(L,"mousemove",F,{once:!0}),Ni(L,"mouseenter",F),Ni(L,"mouseleave",M),q):gh(Ni(L,"mouseenter",F),Ni(L,"mouseleave",M),q)},[P,I,v,S,b,n,k,x,d,N,R,s,l,C,c,w,E,f,T,A,g]),p.useMemo(()=>{if(!n)return;function _(L){x.pointerType=L.pointerType}return{onPointerDown:_,onPointerEnter:_,onMouseMove(L){var Z,ne,W;const{nativeEvent:F}=L,M=L.currentTarget,V=b.select("domReferenceElement"),q=b.select("open"),U=N(V,M,L.target);if(s&&!iw(x.pointerType))return;if(q&&U&&((Z=x.handleCloseOptions)!=null&&Z.blockPointerEvents)){const G=b.select("floatingElement");if(G){const H=((W=(ne=x.handleCloseOptions)==null?void 0:ne.getScope)==null?void 0:W.call(ne))??M.ownerDocument.body;bje(x,{scopeElement:H,referenceElement:M,floatingElement:G})}}const J=SJ(C.current);if(q&&!U||J===0||!U&&x.restTimeoutPending&&L.movementX**2+L.movementY**2<2)return;x.restTimeout.clear();function z(){if(x.restTimeoutPending=!1,R())return;const G=b.select("open");!x.blockMouseMove&&(!G||U)&&A()&&b.setOpen(!0,fa(mu,F,M))}x.pointerType==="touch"?yi.flushSync(()=>{z()}):U&&q?z():(x.restTimeoutPending=!0,x.restTimeout.start(J,z))}}},[n,x,R,N,s,b,C,A])}const QJ=.1,hst=QJ*QJ,Hr=.5;function n_(e,t,n,i,r,s){return i>=t!=s>=t&&e<=(r-n)*(t-i)/(s-i)+n}function i_(e,t,n,i,r,s,o,l,c,u){let d=!1;return n_(e,t,n,i,r,s)&&(d=!d),n_(e,t,r,s,o,l)&&(d=!d),n_(e,t,o,l,c,u)&&(d=!d),n_(e,t,c,u,n,i)&&(d=!d),d}function pst(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function r_(e,t,n,i,r,s){const o=Math.min(n,r),l=Math.max(n,r),c=Math.min(i,s),u=Math.max(i,s);return e>=o&&e<=l&&t>=c&&t<=u}function mst(e={}){const{blockPointerEvents:t=!1}=e,n=new Lu,i=({x:r,y:s,placement:o,elements:l,onClose:c,nodeId:u,tree:d})=>{const f=o==null?void 0:o.split("-")[0];let h=!1,m=null,g=null,b=typeof performance<"u"?performance.now():0;function v(w,x){const O=performance.now(),k=O-b;if(m===null||g===null||k===0)return m=w,g=x,b=O,!1;const S=w-m,C=x-g,E=S*S+C*C,j=k*k*hst;return m=w,g=x,b=O,E0)}function N(){A()||y()}if(A())return;const P=O.getBoundingClientRect(),I=k.getBoundingClientRect(),D=r>I.right-I.width/2,_=s>I.bottom-I.height/2,L=I.width>P.width,F=I.height>P.height,M=(L?P:I).left,V=(L?P:I).right,q=(F?P:I).top,U=(F?P:I).bottom;if(f==="top"&&s>=P.bottom-1||f==="bottom"&&s<=P.top+1||f==="left"&&r>=P.right-1||f==="right"&&r<=P.left+1){N();return}let J=!1;switch(f){case"top":J=r_(S,C,M,P.top+1,V,I.bottom-1);break;case"bottom":J=r_(S,C,M,I.top+1,V,P.bottom-1);break;case"left":J=r_(S,C,I.right-1,U,P.left+1,q);break;case"right":J=r_(S,C,P.right-1,U,I.left+1,q);break}if(J)return;if(h&&!pst(S,C,P)){N();return}if(!j&&v(S,C)){N();return}let z=!1;switch(f){case"top":{const Z=L?Hr/2:Hr*4,ne=L||D?r+Z:r-Z,W=L?r-Z:D?r+Z:r-Z,G=s+Hr+1,H=D||L?I.bottom-Hr:I.top,se=D?L?I.bottom-Hr:I.top:I.bottom-Hr;z=i_(S,C,ne,G,W,G,I.left,H,I.right,se);break}case"bottom":{const Z=L?Hr/2:Hr*4,ne=L||D?r+Z:r-Z,W=L?r-Z:D?r+Z:r-Z,G=s-Hr,H=D||L?I.top+Hr:I.bottom,se=D?L?I.top+Hr:I.bottom:I.top+Hr;z=i_(S,C,ne,G,W,G,I.left,H,I.right,se);break}case"left":{const Z=F?Hr/2:Hr*4,ne=F||_?s+Z:s-Z,W=F?s-Z:_?s+Z:s-Z,G=r+Hr+1,H=_||F?I.right-Hr:I.left,se=_?F?I.right-Hr:I.left:I.right-Hr;z=i_(S,C,H,I.top,se,I.bottom,G,ne,G,W);break}case"right":{const Z=F?Hr/2:Hr*4,ne=F||_?s+Z:s-Z,W=F?s-Z:_?s+Z:s-Z,G=r-Hr,H=_||F?I.left+Hr:I.right,se=_?F?I.left+Hr:I.right:I.left+Hr;z=i_(S,C,G,ne,G,W,H,I.top,se,I.bottom);break}}z?h||n.start(40,N):N()}};return i.__options={...e,blockPointerEvents:t},i}const gst=p.createContext(void 0);function bst(){const e=p.useContext(gst);return(e==null?void 0:e.direction)??"ltr"}const yst=e=>({name:"arrow",options:e,async fn(t){var F,M;const{x:n,y:i,placement:r,rects:s,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:d=0,offsetParent:f="real"}=Oh(e,t)||{};if(u==null)return{};const h=Yz(d),m={x:n,y:i},g=WD(r),b=qD(g),v=await o.getDimensions(u),y=g==="y",w=y?"top":"left",x=y?"bottom":"right",O=y?"clientHeight":"clientWidth",k=s.reference[b]+s.reference[g]-m[g]-s.floating[b],S=m[g]-s.reference[g],C=f==="real"?await((F=o.getOffsetParent)==null?void 0:F.call(o,u)):l.floating;let E=l.floating[O]||s.floating[b];(!E||!await((M=o.isElement)==null?void 0:M.call(o,C)))&&(E=l.floating[O]||s.floating[b]);const j=k/2-S/2,T=E/2-v[b]/2-1,R=Math.min(h[w],T),A=Math.min(h[x],T),N=R,P=E-v[b]-A,I=E/2-v[b]/2+j,D=Gz(N,I,P),_=!c.arrow&&hm(r)!=null&&I!==D&&s.reference[b]/2-(I({...yst(e),options:[e,t]}),xst={name:"hide",async fn(e){const{width:t,height:n,x:i,y:r}=e.rects.reference,s=t===0&&n===0&&i===0&&r===0,o=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||s}}}},wst={sideX:"left",sideY:"top"},zJ="--available-width",VJ="--available-height";function vje(e,t,n){const i=e==="inline-start"||e==="inline-end";return{top:"top",right:i?n?"inline-start":"inline-end":"right",bottom:"bottom",left:i?n?"inline-end":"inline-start":"left"}[t]}function HJ(e,t,n){const{rects:i,placement:r}=e;return{side:vje(t,vd(r),n),align:hm(r)||"center",anchor:{width:i.reference.width,height:i.reference.height},positioner:{width:i.floating.width,height:i.floating.height}}}function Ost(e){return kst(e,lst)}function kst(e,t){var tt,mt;const{anchor:n,positionMethod:i="absolute",side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:l=0,collisionBoundary:c,collisionPadding:u=5,sticky:d=!1,arrowPadding:f=5,disableAnchorTracking:h=!1,inline:m,keepMounted:g=!1,floatingRootContext:b,mounted:v,collisionAvoidance:y,shift:w,nodeId:x,adaptiveOrigin:O,lazyFlip:k=!1,externalTree:S}=e,[C,E]=p.useState(null);!v&&C!==null&&E(null);const j=y.side||"flip",T=y.align||"flip",R=y.fallbackAxisSide||"end",A=(w==null?void 0:w.crossAxis)??!1,N=w==null?void 0:w.rootBoundary,P=typeof n=="function"?n:void 0,I=ci(P),D=P?I:n,_=Zl(n),L=Zl(v),M=bst()==="rtl",V=C||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":M?"left":"right","inline-start":M?"right":"left"}[r],q=o==="center"?V:`${V}-${o}`;let U=u;typeof U=="number"?U={top:U,right:U,bottom:U,left:U}:U&&(U={top:U.top||0,right:U.right||0,bottom:U.bottom||0,left:U.left||0});const J=1,z=r==="bottom"?J:0,Z=r==="top"?J:0,ne=r==="right"?J:0,W=r==="left"?J:0,G={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:U},H=p.useRef(null),se=Zl(s),Y=Zl(l),X=typeof s!="function"?s:0,ie=typeof l!="function"?l:0,ee=[];m&&ee.push(m),ee.push(X_e(Ne=>{const Ot=HJ(Ne,r,M),Nt=typeof se.current=="function"?se.current(Ot):se.current,Yt=typeof Y.current=="function"?Y.current(Ot):Y.current;return{mainAxis:Nt,crossAxis:Yt,alignmentAxis:Yt}},[X,ie,M,r]));const be=T==="none"&&j!=="shift",ue=!be&&(d||A||j==="shift"),pe=j==="none"?null:J_e({...G,padding:{top:U.top+J+z,right:U.right+J+W,bottom:U.bottom+J+Z,left:U.left+J+ne},mainAxis:!A&&j==="flip",crossAxis:T==="flip"?"alignment":!1,fallbackAxisSideDirection:R}),ke=be?null:Y_e({...G,rootBoundary:N,mainAxis:T!=="none",crossAxis:ue,limiter:d||A?void 0:Z_e(Ne=>{if(!H.current)return{};const{width:Ot,height:Nt}=H.current.getBoundingClientRect(),Yt=dd(vd(Ne.placement)),xn=Yt==="y"?Ot:Nt,Ke=Yt==="y"?U.left+U.right:U.top+U.bottom;return{offset:xn/2+Ke/2}})},[G,d,A,N,U,T]);j==="shift"||T==="shift"||o==="center"?ee.push(ke,pe):ee.push(pe,ke),ee.push(eje({...G,apply({elements:{floating:Ne},availableWidth:Ot,availableHeight:Nt,rects:Yt}){if(!L.current)return;const xn=Ne.style;xn.setProperty(zJ,`${Ot}px`),xn.setProperty(VJ,`${Nt}px`);const Ke=ta(Ne).devicePixelRatio||1,{x:St,y:qe,width:nt,height:et}=Yt.reference,ft=(Math.round((St+nt)*Ke)-Math.round(St*Ke))/Ke,Et=(Math.round((qe+et)*Ke)-Math.round(qe*Ke))/Ke;xn.setProperty("--anchor-width",`${ft}px`),xn.setProperty("--anchor-height",`${Et}px`)}}),vst(Ne=>({element:H.current||kr(Ne.elements.floating).createElement("div"),padding:f,offsetParent:"floating"}),[f]),{name:"transformOrigin",fn(Ne){var Me,on,On;const{elements:Ot,middlewareData:Nt,placement:Yt,rects:xn,y:Ke}=Ne,St=vd(Yt),qe=dd(St),nt=H.current,et=((Me=Nt.arrow)==null?void 0:Me.x)||0,ft=((on=Nt.arrow)==null?void 0:on.y)||0,Et=(nt==null?void 0:nt.clientWidth)||0,At=(nt==null?void 0:nt.clientHeight)||0,It=et+Et/2,Gt=ft+At/2,Xe=Math.abs(((On=Nt.shift)==null?void 0:On.y)||0),wt=xn.reference.height/2,vt=typeof s=="function"?s(HJ(Ne,r,M)):s,tn=Xe>vt,Qt={top:`${It}px calc(100% + ${vt}px)`,bottom:`${It}px ${-vt}px`,left:`calc(100% + ${vt}px) ${Gt}px`,right:`${-vt}px ${Gt}px`}[St],cn=`${It}px ${xn.reference.y+wt-Ke}px`;return Ot.floating.style.setProperty("--transform-origin",ue&&qe==="y"&&tn?cn:Qt),{}}},xst,O),Jn(()=>{!v&&b&&b.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[v,b]);const je=p.useMemo(()=>({elementResize:!h&&typeof ResizeObserver<"u",layoutShift:!h&&typeof IntersectionObserver<"u"}),[h]),{refs:Pe,elements:Ee,x:ze,y:_e,middlewareData:ae,update:le,placement:ge,context:Oe,isPositioned:Se,floatingStyles:We}=t({rootContext:b,open:g?v:void 0,placement:q,middleware:ee,strategy:i,whileElementsMounted:g?void 0:(...Ne)=>aB(...Ne,je),nodeId:x,externalTree:S}),{sideX:Ye,sideY:ye}=ae.adaptiveOrigin||wst,we=Se?i:"fixed",Ae=p.useMemo(()=>{let Ne;return Se?O?Ne={position:we,[Ye]:ze,[ye]:_e}:Ne={...We,position:we}:Ne={position:we,top:0,left:0},Ne[zJ]="100vw",Ne[VJ]="100vh",Se||(Ne.opacity=0),Ne},[O,we,Ye,ze,ye,_e,We,Se]),He=p.useRef(null);Jn(()=>{if(!v)return;const Ne=_.current,Ot=typeof Ne=="function"?Ne():Ne,Yt=(qJ(Ot)?Ot.current:Ot)||null||null;Yt!==He.current&&(Pe.setPositionReference(Yt),He.current=Yt)},[v,Pe,D,_]),p.useEffect(()=>{if(!v)return;const Ne=_.current;typeof Ne!="function"&&qJ(Ne)&&Ne.current!==He.current&&(Pe.setPositionReference(Ne.current),He.current=Ne.current)},[v,Pe,D,_]),p.useEffect(()=>{if(g&&v&&Ee.reference&&Ee.floating)return aB(Ee.reference,Ee.floating,le,je)},[g,v,Ee,le,je]);const Ue=vd(ge),jt=vje(r,Ue,M),Pt=hm(ge)||"center",Kt=!!((tt=ae.hide)!=null&&tt.referenceHidden);Jn(()=>{k&&v&&Se&&Ue!==V&&E(Ue)},[k,v,Se,Ue,V]);const Ct=p.useMemo(()=>{var Ne,Ot;return{position:"absolute",top:(Ne=ae.arrow)==null?void 0:Ne.y,left:(Ot=ae.arrow)==null?void 0:Ot.x}},[ae.arrow]),xt=((mt=ae.arrow)==null?void 0:mt.centerOffset)!==0;return p.useMemo(()=>({positionerStyles:Ae,arrowStyles:Ct,arrowRef:H,arrowUncentered:xt,side:jt,align:Pt,physicalSide:Ue,anchorHidden:Kt,refs:Pe,context:Oe,isPositioned:Se,update:le}),[Ae,Ct,H,xt,jt,Pt,Ue,Kt,Pe,Oe,Se,le])}function qJ(e){return e!=null&&"current"in e}(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=oI.startingStyle]="startingStyle",e[e.endingStyle=oI.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({});const Sst={"data-popup-open":""},Est={"data-popup-open":"","data-pressed":""},Cst={"data-open":""},Ast={"data-closed":""},Tst={"data-anchor-hidden":""},xje={open(e){return e?Sst:null}},_st={open(e){return e?Est:null}},fV={open(e){return e?Cst:Ast},anchorHidden(e){return e?Tst:null}},wje={...fV,...KD};function Oje(e){return e==="starting"?Pit:nc}function jst(e,t,{styles:n,transitionStatus:i,props:r,refs:s,hidden:o,inert:l=!1}){const c={...n};return l&&(c.pointerEvents="none"),Ra("div",e,{state:t,ref:s,props:[{role:"presentation",hidden:o,style:c},Oje(i),r],stateAttributesMapping:fV})}function kje(){const e=Uz(),t=e.useState("toasts");return p.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function yf({orientation:e="vertical",maxHeight:t,hideScrollbar:n=!1,fadeEdges:i=!1,contentClassName:r="",className:s="",style:o,children:l,hasMore:c=!1,onLoadMore:u,threshold:d=24,onScroll:f,ref:h,...m}){const[g,b]=p.useState(!1),[v,y]=p.useState(!1),[w,x]=p.useState({top:!1,bottom:!1}),O=p.useRef(null),k=p.useRef(null),S=i&&e!=="horizontal",C=!!u&&e!=="horizontal";p.useImperativeHandle(h,()=>O.current,[]),p.useEffect(()=>()=>{var T;(T=k.current)==null||T.abort()},[]);const E=p.useCallback(()=>{const T=O.current;if(!S||!T)return;const R=T.scrollHeight-T.clientHeight,A=R>1&&T.scrollTop>1,N=R>1&&R-T.scrollTop>1;x(P=>P.top===A&&P.bottom===N?P:{top:A,bottom:N})},[S]);p.useEffect(()=>{const T=O.current;if(!S||!T)return;const R=new ResizeObserver(E);R.observe(T);for(const A of T.children)R.observe(A);return E(),()=>R.disconnect()},[S,C,E]);async function j(){if(!u||!c||k.current)return;const T=new AbortController;k.current=T,b(!0),y(!1);try{await u(T.signal)}catch{T.signal.aborted||y(!0)}finally{T.signal.aborted||b(!1),k.current===T&&(k.current=null)}}return a.jsxs("div",{...m,ref:O,className:`studio-scroll-area ${s}`.trim(),"data-orientation":e,"data-hide-scrollbar":n||void 0,"data-fade-edges":S&&(w.top||w.bottom)||void 0,"data-fade-top":S&&w.top||void 0,"data-fade-bottom":S&&w.bottom||void 0,style:{maxHeight:t,...o},onScroll:T=>{f==null||f(T),E();const R=T.currentTarget;!T.defaultPrevented&&e!=="horizontal"&&!v&&R.scrollTop>0&&R.scrollHeight-R.clientHeight-R.scrollTop<=Math.max(0,d)&&j()},children:[a.jsx("div",{className:`studio-scroll-area__content ${r}`.trim(),"aria-busy":u?g:void 0,children:l}),u&&e!=="horizontal"&&a.jsx(a.Fragment,{children:a.jsxs("div",{className:"studio-scroll-area__footer",children:[g?a.jsx(u0,{size:24}):a.jsx("span",{role:"status","aria-live":"polite",children:v?"加载失败":c?"向下滚动加载更多":"已加载全部"}),!g&&c&&a.jsx("button",{type:"button",onClick:()=>void j(),children:v?"重试":"加载更多"})]})})]})}function Nst(){const{add:e,close:t}=kje();return{add:p.useCallback(({id:i,title:r,description:s,variant:o="info",duration:l,action:c,closeLabel:u,onClose:d})=>e({id:i,title:r,description:s,timeout:l,priority:"low",onClose:d,data:{variant:o,action:c,closeLabel:u}}),[e]),dismiss:t}}function Rst({position:e,label:t}){const{toasts:n,close:i}=kje();return a.jsx(irt,{children:a.jsx(_it,{className:"studio-toast-viewport","data-position":e,"data-empty":n.length===0||void 0,"aria-label":t,render:a.jsx(yf,{contentClassName:"studio-toast-viewport__stack"}),children:n.map(r=>{var s,o,l;return a.jsx(qit,{toast:r,className:"studio-toast-root",swipeDirection:[],children:a.jsx(snt,{role:"presentation",variant:(s=r.data)==null?void 0:s.variant,title:r.title!=null?a.jsx(Xit,{render:a.jsx("div",{}),children:r.title}):void 0,description:r.description!=null?a.jsx(Git,{render:a.jsx("div",{}),children:r.description}):void 0,action:(o=r.data)==null?void 0:o.action,closeLabel:(l=r.data)==null?void 0:l.closeLabel,onDismiss:()=>i(r.id)})},r.id)})})})}function Ist({children:e,duration:t=4e3,position:n="top-center",label:i="通知"}){return a.jsxs(fit,{timeout:t,limit:3,children:[e,a.jsx(Rst,{position:n,label:i})]})}function Pst({ownerId:e,sessionId:t,onOpen:n,hideNotices:i,refreshKey:r,onUpdate:s}){const{t:o}=Te("sandbox"),l=Nst(),c=p.useRef(new Map),u=p.useRef(new Map),d=p.useRef(null),f=p.useRef({sessionId:t,onOpen:n,toast:l,t:o,hideNotices:i,onUpdate:s});return f.current={sessionId:t,onOpen:n,toast:l,t:o,hideNotices:i,onUpdate:s},p.useEffect(()=>{if(i){f.current.toast.dismiss(),u.current.clear();return}for(const h of c.current.values())h.sessionId===t&&(f.current.toast.dismiss(h.runId),u.current.delete(h.runId))},[t,i]),p.useEffect(()=>{var h;(h=d.current)==null||h.call(d)},[r]),p.useEffect(()=>{if(!e)return;const h=new AbortController,m=c.current,g=u.current,b=new Set;let v,y=!1,w=[],x="";const O=(C,E=x)=>{var j,T;x=E,h.signal.aborted||(T=(j=f.current).onUpdate)==null||T.call(j,{ownerId:e,runs:w,loading:C,error:E})},k=C=>{const{toast:E,t:j,sessionId:T,onOpen:R}=f.current;if(!h.signal.aborted){if(f.current.hideNotices||C.sessionId===T){E.dismiss(C.runId),g.delete(C.runId);return}b.has(C.runId)||g.get(C.runId)===C.state||(g.set(C.runId,C.state),E.add({id:C.runId,duration:0,title:j(`taskNotice.${C.state}`),description:C.message.slice(0,80),variant:C.state==="succeeded"?"success":C.state==="failed"?"error":"info",closeLabel:j("taskNotice.hide"),onClose:()=>b.add(C.runId),action:a.jsx(Wi,{variant:"secondary",onClick:()=>{R(C.sessionId,h.signal).catch(A=>{h.signal.aborted||E.add({id:"task-open-error",variant:"error",description:A instanceof Error?A.message:String(A)})})},children:j("taskNotice.open")})}))}},S=async(C=!1)=>{if(!(y||h.signal.aborted)){clearTimeout(v),y=!0,C&&O(!0);try{const E=await Jd.active(h.signal);if(h.signal.aborted)return;w=E,O(!1,"");const j=new Set(E.map(T=>T.runId));for(const T of m.values())if(!j.has(T.runId)&&!pu(T)){let R;try{R=await Jd.get(T.runId,h.signal)}catch(A){if(A instanceof Kw&&A.status===404){m.delete(T.runId),g.delete(T.runId),f.current.toast.dismiss(T.runId);continue}throw A}if(h.signal.aborted)return;m.set(R.runId,R),k(R)}for(const T of E)m.set(T.runId,T),k(T);f.current.toast.dismiss("task-connection")}catch(E){if(h.signal.aborted)return;E instanceof Kw&&[401,403].includes(E.status)&&(w=[],m.clear(),g.clear(),f.current.toast.dismiss()),O(!1,E instanceof Error?E.message:f.current.t("taskNotice.reconnecting")),!h.signal.aborted&&m.size&&!f.current.hideNotices&&f.current.toast.add({id:"task-connection",duration:0,description:f.current.t("taskNotice.reconnecting")})}finally{y=!1,h.signal.aborted||(v=setTimeout(S,3e3))}}};return d.current=()=>{S(!0)},O(!0),S(),()=>{h.abort(),clearTimeout(v),d.current=null,f.current.toast.dismiss()}},[e]),null}function Dst(e){const{t}=Te("sandbox");return a.jsx(Ist,{position:"bottom-right",label:t("taskNotice.label"),children:a.jsx(Pst,{...e},e.ownerId)})}const uC=["super_admin","admin","developer","user"];class dC extends Error{constructor(t,n){super(t),this.code=t,this.status=n}}async function Sje(e){let t;try{t=await e.json()}catch{throw new dC("invalid_response",e.status)}if(!e.ok){const n=t&&typeof t=="object"&&"code"in t&&typeof t.code=="string"?t.code:"request_failed";throw new dC(n,e.status)}return t}function Eje(e){return!e||typeof e!="object"?!1:"id"in e&&typeof e.id=="string"&&"name"in e&&typeof e.name=="string"&&"email"in e&&typeof e.email=="string"&&"role"in e&&uC.some(t=>t===e.role)&&"status"in e&&typeof e.status=="string"&&"lastLogin"in e&&typeof e.lastLogin=="string"&&"protected"in e&&typeof e.protected=="boolean"&&"currentUser"in e&&typeof e.currentUser=="boolean"&&"roleConflict"in e&&typeof e.roleConflict=="boolean"}async function Mst(e){const t=new URLSearchParams({page:String(e.page),pageSize:"20",query:e.query});e.role&&t.set("role",e.role);const n=await Sje(await yn(`/web/users?${t}`,{signal:e.signal,cache:"no-store"}));if(!n||typeof n!="object"||!("items"in n)||!Array.isArray(n.items)||!n.items.every(Eje)||!("total"in n)||typeof n.total!="number"||!("poolTotal"in n)||typeof n.poolTotal!="number"||!("page"in n)||typeof n.page!="number"||!("pageSize"in n)||typeof n.pageSize!="number"||!("userPoolId"in n)||typeof n.userPoolId!="string"||!("clientId"in n)||typeof n.clientId!="string"||!("provider"in n)||!["volcengine","byteplus"].includes(String(n.provider)))throw new dC("invalid_response",502);return n}async function Lst(e,t,n){const i=await Sje(await yn(`/web/users/${encodeURIComponent(e.id)}/role`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({role:t,expectedRole:e.role}),signal:n}));if(!i||typeof i!="object"||!("user"in i)||!Eje(i.user))throw new dC("invalid_response",502);return i.user}function $st(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m7 9.5 5 5 5-5"})})}function Fst(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m6.5 12.5 3.5 3.5 7.5-8"})})}function vf({ariaLabel:e,value:t,valueLabel:n,placeholder:i,options:r,disabled:s=!1,searchValue:o,searchPlaceholder:l,loading:c=!1,hasMore:u=!1,emptyMessage:d,onSearchChange:f,onLoadMore:h,onChange:m}){const{t:g}=Te("ui"),b=l??g("deploymentSelect.searchPlaceholder"),v=d??g("deploymentSelect.emptyMessage"),y=p.useId(),w=p.useRef(null),x=p.useRef(null),O=p.useRef(null),k=p.useRef(null),S=p.useRef([]),[C,E]=p.useState(!1),[j,T]=p.useState(0),R=r.find(L=>L.value===t),A=(R==null?void 0:R.label)??(t?n:void 0),N=o!==void 0&&!!f,P=()=>{E(!1),N&&o&&(f==null||f(""))};p.useEffect(()=>{if(!C)return;const L=F=>{F.target instanceof Node&&w.current&&!w.current.contains(F.target)&&P()};return window.addEventListener("pointerdown",L),()=>window.removeEventListener("pointerdown",L)},[C,f,o,N]),p.useEffect(()=>{var L,F;if(C){if(N){(L=O.current)==null||L.focus();return}(F=S.current[j])==null||F.focus()}},[C,N]),p.useEffect(()=>{var L;!C||N&&document.activeElement===O.current||(L=S.current[j])==null||L.focus()},[j,C,N]),p.useEffect(()=>{T(L=>Math.min(L,Math.max(0,r.length-1)))},[r.length]),p.useEffect(()=>{if(!C||!u||c||!h)return;const L=window.requestAnimationFrame(()=>{const F=k.current;F&&F.scrollHeight<=F.clientHeight+1&&h()});return()=>window.cancelAnimationFrame(L)},[u,c,h,C,r.length]);const I=(L=1)=>{const F=r.findIndex(V=>V.value===t),M=F>=0?F:L===1?0:Math.max(0,r.length-1);T(M),E(!0)},D=L=>{r.length!==0&&T((L+r.length)%r.length)},_=L=>{var F;m(L.value),P(),(F=x.current)==null||F.focus()};return a.jsxs("div",{className:"pp-deployment-select",ref:w,onKeyDown:L=>{var M,V;const F=L.target===O.current;if(L.key==="Escape"&&C){L.preventDefault(),P(),(M=x.current)==null||M.focus();return}if(L.key==="Tab"){P();return}if(F){L.key==="ArrowDown"&&r.length>0&&(L.preventDefault(),T(0),(V=S.current[0])==null||V.focus());return}L.key==="ArrowDown"?(L.preventDefault(),C?D(j+1):I(1)):L.key==="ArrowUp"?(L.preventDefault(),C?D(j-1):I(-1)):C&&L.key==="Home"?(L.preventDefault(),T(0)):C&&L.key==="End"&&(L.preventDefault(),T(Math.max(0,r.length-1)))},children:[a.jsxs("button",{ref:x,type:"button",className:"pp-deployment-select-trigger","aria-label":e,"aria-haspopup":"listbox","aria-expanded":C,"aria-controls":C?y:void 0,disabled:s,onClick:()=>{C?P():I()},children:[a.jsx("span",{className:A?void 0:"is-placeholder",children:A??i}),a.jsx($st,{className:`pp-deployment-select-chevron${C?" is-open":""}`})]}),C&&a.jsxs("div",{className:"pp-deployment-select-menu",children:[N&&a.jsx("div",{className:"pp-deployment-select-search",children:a.jsx("input",{ref:O,type:"search",value:o,"aria-label":g("deploymentSelect.searchAriaLabel",{label:e}),placeholder:b,autoComplete:"off",onChange:L=>f==null?void 0:f(L.currentTarget.value)})}),a.jsx("div",{id:y,ref:k,className:"pp-deployment-select-options",role:"listbox","aria-label":e,"aria-busy":c||void 0,onScroll:L=>{if(!u||c||!h)return;const F=L.currentTarget;F.scrollHeight-F.scrollTop-F.clientHeight<=24&&h()},children:r.map((L,F)=>{const M=L.value===t;return a.jsxs("button",{ref:V=>{S.current[F]=V},type:"button",role:"option","aria-selected":M,tabIndex:F===j?0:-1,className:`pp-deployment-select-option${M?" is-selected":""}`,title:L.metadata?[L.label,L.description,L.metadata].filter(Boolean).join(` -`):L.description,onFocus:()=>T(F),onClick:()=>_(L),children:[a.jsxs("span",{className:"pp-deployment-select-copy",children:[a.jsxs("span",{className:"pp-deployment-select-name",children:[L.label,L.badge&&a.jsx("span",{className:"pp-deployment-select-badge",children:L.badge})]}),L.description&&a.jsx("small",{className:L.metadata?"pp-deployment-select-description":void 0,children:L.description}),L.metadata&&a.jsx("small",{className:"pp-deployment-select-metadata",children:L.metadata})]}),M&&a.jsx(Fst,{})]},L.value)})}),c&&a.jsx("div",{className:"pp-deployment-select-state","aria-live":"polite",children:g("deploymentSelect.loadingMore")}),!c&&r.length===0&&a.jsx("div",{className:"pp-deployment-select-state",children:v})]})]})}function ZD({label:e,onClick:t}){return a.jsx("button",{type:"button",className:"page-back-button","aria-label":e,title:e,onClick:t,children:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m14.5 6-6 6 6 6"})})})}function fn({as:e="span",className:t="",duration:n=4,spread:i=20,children:r,style:s,...o}){const l=Math.min(Math.max(i,5),45);return a.jsx(e,{className:`text-shimmer${t?` ${t}`:""}`,style:{...s,backgroundImage:`linear-gradient(to right, hsl(var(--muted-foreground)) ${50-l}%, hsl(var(--foreground)) 50%, hsl(var(--muted-foreground)) ${50+l}%)`,animationDuration:`${n}s`},...o,children:r})}function Bst(){return a.jsx("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M16 7a6.5 6.5 0 1 0 .2 5M16 3.5V7h-3.5"})})}function Cje(e){return e instanceof dC?e.code:"request_failed"}function Ust({user:e,onClose:t,onSaved:n}){const{t:i,i18n:r}=Te("users"),s=p.useRef(null),o=p.useRef(null),l=p.useId(),c=p.useId(),[u,d]=p.useState(e.role),[f,h]=p.useState(!1),[m,g]=p.useState("");p.useEffect(()=>{const v=s.current,y=document.activeElement;return v==null||v.showModal(),()=>{var w;(w=o.current)==null||w.abort(),v==null||v.close(),y instanceof HTMLElement&&y.isConnected&&y.focus()}},[]);const b=async()=>{if(f||u===e.role&&!e.roleConflict)return;const v=new AbortController;o.current=v,h(!0),g("");try{const y=await Lst(e,u,v.signal);v.signal.aborted||n(y)}catch(y){v.signal.aborted||g(i(`errors.${Cje(y)}`,{defaultValue:i("errors.request_failed")}))}finally{v.signal.aborted||h(!1)}};return a.jsxs("dialog",{ref:s,className:"user-role-dialog","aria-labelledby":l,"aria-describedby":c,"aria-busy":f,onCancel:v=>{v.preventDefault(),f||t()},children:[a.jsxs("header",{children:[a.jsx("h2",{id:l,children:i("changeRole")}),a.jsx("button",{type:"button",className:"users-close",onClick:t,disabled:f,"aria-label":i("close"),children:a.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:a.jsx("path",{d:"m5 5 10 10M15 5 5 15"})})})]}),a.jsxs("div",{className:"user-role-dialog-body",children:[a.jsxs("div",{className:"users-account",children:[a.jsx("strong",{children:e.name}),a.jsx("span",{children:e.email||e.id})]}),a.jsx("label",{className:"users-field-label",children:i("role")}),a.jsx(vf,{ariaLabel:i("role"),placeholder:i("role"),value:u,disabled:f,options:uC.map(v=>({value:v,label:i(`roles.${v}`),description:i(`descriptions.${v}`)})),onChange:v=>{const y=uC.find(w=>w===v);y&&d(y)}},r.resolvedLanguage),a.jsx("p",{id:c,className:"users-help",children:i("effectiveAfterRefresh")}),m?a.jsx("p",{className:"users-error",role:"alert",children:m}):null]}),a.jsxs("footer",{children:[a.jsx("button",{className:"users-button",type:"button",disabled:f,onClick:t,children:i("cancel")}),a.jsx("button",{className:"users-button is-primary",type:"button",disabled:f||u===e.role&&!e.roleConflict,onClick:()=>void b(),children:i(f?"saving":"save")})]})]})}function Qst({onBack:e}){const{t,i18n:n}=Te("users"),[i,r]=p.useState(null),[s,o]=p.useState(!0),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(""),[m,g]=p.useState(""),[b,v]=p.useState(1),[y,w]=p.useState(0),[x,O]=p.useState(null),[k,S]=p.useState(null),[C,E]=p.useState(null);p.useEffect(()=>{const A=new AbortController;return o(!0),c(""),Mst({page:b,query:f,role:m,signal:A.signal}).then(N=>{if(!A.signal.aborted){if(N.total>0&&N.items.length===0&&b>1){v(1);return}r(N),E(new Date)}}).catch(N=>{A.signal.aborted||c(Cje(N))}).finally(()=>{A.signal.aborted||o(!1)}),()=>A.abort()},[b,f,m,y]);const j=A=>{A.preventDefault(),h(u.trim()),v(1),w(N=>N+1)},T=A=>{if(!A)return t("neverLoggedIn");const N=Number(A),P=new Date(Number.isFinite(N)&&N>0?N<1e12?N*1e3:N:A);return Number.isNaN(P.getTime())?t("unknown"):P.toLocaleString(n.resolvedLanguage,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1})},R=Math.max(1,Math.ceil(((i==null?void 0:i.total)??0)/20));return a.jsxs("section",{className:"users-page","aria-labelledby":"users-title",children:[a.jsxs("header",{className:"users-page-header",children:[a.jsx(ZD,{label:t("back"),onClick:e}),a.jsx("h1",{id:"users-title",children:t("title")}),i?a.jsx("span",{className:"users-count",children:t("memberCount",{count:i.poolTotal})}):null]}),a.jsxs("div",{className:"users-content",children:[i?a.jsxs("div",{className:"users-pool",children:[a.jsx("span",{children:i.provider==="byteplus"?"BytePlus Identity":t("volcengineIdentity")}),a.jsxs("span",{className:"users-pool-id",title:i.userPoolId,children:[t("pool")," ",i.userPoolId]})]}):null,a.jsxs("div",{className:"users-toolbar",children:[a.jsxs("form",{className:"users-search",onSubmit:j,children:[a.jsx("input",{value:u,onChange:A=>d(A.target.value),onKeyDown:A=>{A.key==="Enter"&&(A.nativeEvent.isComposing||A.keyCode===229)&&A.preventDefault()},"aria-label":t("searchPlaceholder"),placeholder:t("searchPlaceholder"),maxLength:200}),a.jsx("button",{type:"submit",className:"users-button",disabled:s,children:t("search")})]}),a.jsx("div",{className:"users-role-filter",children:a.jsx(vf,{ariaLabel:t("filterRole"),placeholder:t("allRoles"),value:m,options:[{value:"",label:t("allRoles")},...uC.map(A=>({value:A,label:t(`roles.${A}`)}))],onChange:A=>{const N=uC.find(P=>P===A);g(N??""),v(1)}})}),a.jsxs("button",{type:"button",className:"users-button users-refresh",disabled:s,onClick:()=>{S(null),w(A=>A+1)},children:[a.jsx(Bst,{}),a.jsx("span",{children:t("refresh")})]})]}),a.jsx("div",{className:"users-feedback","aria-live":"polite",children:s?a.jsx(fn,{children:t("loading")}):k?a.jsx("span",{children:t("saved",{name:k.name,role:t(`roles.${k.role}`)})}):C?a.jsx("span",{children:t("updatedAt",{time:C.toLocaleTimeString(n.resolvedLanguage,{hour:"2-digit",minute:"2-digit",hour12:!1})})}):null}),l?a.jsxs("div",{className:"users-error users-error-banner",role:"alert",children:[a.jsx("span",{children:t(`errors.${l}`,{defaultValue:t("errors.request_failed")})}),a.jsx("button",{type:"button",className:"users-button",onClick:()=>w(A=>A+1),children:t("retry")})]}):null,a.jsxs("div",{className:"users-table-wrap","aria-busy":s,children:[a.jsxs("table",{className:"users-table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:t("user")}),a.jsx("th",{scope:"col",children:t("role")}),a.jsx("th",{scope:"col",children:t("status")}),a.jsx("th",{scope:"col",children:t("lastLogin")}),a.jsx("th",{scope:"col",children:a.jsx("span",{className:"sr-only",children:t("actions")})})]})}),a.jsx("tbody",{children:i==null?void 0:i.items.map(A=>{var N;return a.jsxs("tr",{children:[a.jsx("td",{"data-label":t("user"),children:a.jsxs("div",{className:"users-person",children:[a.jsx("span",{className:"users-avatar","aria-hidden":"true",children:(N=Array.from(A.name)[0])==null?void 0:N.toUpperCase()}),a.jsxs("div",{className:"users-account",children:[a.jsxs("strong",{children:[A.name,A.currentUser?a.jsx("span",{className:"users-self",children:t("you")}):null]}),a.jsx("span",{title:A.email||A.id,children:A.email||A.id})]})]})}),a.jsxs("td",{"data-label":t("role"),children:[a.jsx("span",{className:`users-role-badge${A.role==="super_admin"?" is-super":""}`,children:t(`roles.${A.role}`)}),A.roleConflict?a.jsx("span",{className:"users-inline-warning",children:t("roleConflict")}):null]}),a.jsx("td",{"data-label":t("status"),children:a.jsx("span",{className:"users-status",children:t(`states.${A.status}`,{defaultValue:t("unknown")})})}),a.jsx("td",{"data-label":t("lastLogin"),className:"users-last-login",children:T(A.lastLogin)}),a.jsx("td",{className:"users-actions",children:A.protected?a.jsx("span",{className:"users-protected",title:t("protectedExplanation"),children:t("initialAdministrator")}):a.jsx("button",{type:"button",className:"users-button is-text",disabled:s||!!l||A.currentUser,onClick:()=>{S(null),O(A)},children:t("changeRole")})})]},A.id)})})]}),!s&&!l&&(i==null?void 0:i.items.length)===0?a.jsxs("div",{className:"users-empty",children:[a.jsx("strong",{children:t("noUsers")}),a.jsx("span",{children:t(f||m?"tryAnotherSearch":"poolEmpty")})]}):null,s&&!i?a.jsx("div",{className:"users-empty",children:a.jsx(fn,{children:t("loading")})}):null]}),i?a.jsxs("footer",{className:"users-pagination",children:[a.jsx("span",{children:t("resultCount",{count:i.total})}),a.jsxs("div",{children:[a.jsx("button",{type:"button",className:"users-button",disabled:b<=1||s,onClick:()=>v(A=>A-1),children:t("previous")}),a.jsxs("span",{children:[b," / ",R]}),a.jsx("button",{type:"button",className:"users-button",disabled:b>=R||s,onClick:()=>v(A=>A+1),children:t("next")})]})]}):null]}),x?a.jsx(Ust,{user:x,onClose:()=>O(null),onSaved:A=>{O(null),S(A),w(N=>N+1)}}):null]})}const Aje=p.createContext(null);function zst(e){if(!e||/[?#]/.test(e))return null;try{const t=decodeURIComponent(e);return!/^\/data\/(output|workspace)\/.+/.test(t)||t.endsWith("/")||/[\\\u0000-\u001f\u007f]/.test(t)||t.split("/").some(n=>n==="."||n==="..")?null:t}catch{return null}}function Vst({appName:e,sessionId:t,path:n,children:i}){const{t:r}=Te("conversation"),s=p.useRef(null),[o,l]=p.useState(!1),[c,u]=p.useState(!1);p.useEffect(()=>(l(!1),u(!1),()=>{var f;(f=s.current)==null||f.abort(),s.current=null}),[e,t,n]);async function d(){if(s.current)return;const f=new AbortController;s.current=f,l(!0),u(!1);try{const h=await cTe(e,t,n,f.signal);if(f.signal.aborted)return;const m=URL.createObjectURL(h),g=document.createElement("a");try{g.href=m,g.download=n.slice(n.lastIndexOf("/")+1),document.body.appendChild(g),g.click()}finally{g.remove(),window.setTimeout(()=>URL.revokeObjectURL(m),0)}}catch{f.signal.aborted||u(!0)}finally{s.current===f&&(s.current=null,l(!1))}}return a.jsxs(a.Fragment,{children:[a.jsxs("a",{className:"sandbox-file-download",href:encodeURI(n),"aria-disabled":o,"aria-busy":o,onClick:f=>{f.preventDefault(),d()},children:[a.jsx("span",{"aria-hidden":"true",children:"↓"}),a.jsxs("span",{children:[r(o?"markdown.downloading":"markdown.downloadFile")," · ",i]})]}),c&&a.jsxs("span",{role:"alert",children:[" ",r("markdown.downloadFailed")]})]})}const Hst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M5.293 12.707a1 1 0 0 1 0-1.414l5-5a1 1 0 1 1 1.414 1.414L8.414 11H18a1 1 0 1 1 0 2H8.414l3.293 3.293a1 1 0 0 1-1.414 1.414l-5-5Z",clipRule:"evenodd"})}),qst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M18.707 12.707a1 1 0 0 0 0-1.414l-5-5a1 1 0 1 0-1.414 1.414L15.586 11H6a1 1 0 1 0 0 2h9.586l-3.293 3.293a1 1 0 0 0 1.414 1.414l5-5Z",clipRule:"evenodd"})}),Wst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M4.47192 2.5C5.02421 2.5 5.47192 2.94772 5.47192 3.5V5.07196C7.17065 3.47759 9.45675 2.5 11.9719 2.5C17.2186 2.5 21.4719 6.75329 21.4719 12C21.4719 17.2467 17.2186 21.5 11.9719 21.5C7.10262 21.5 3.0902 17.8375 2.53692 13.1164C2.47264 12.5679 2.8652 12.0711 3.41373 12.0068C3.96226 11.9425 4.45904 12.3351 4.52333 12.8836C4.95991 16.6089 8.12901 19.5 11.9719 19.5C16.1141 19.5 19.4719 16.1421 19.4719 12C19.4719 7.85786 16.1141 4.5 11.9719 4.5C9.75153 4.5 7.75552 5.46469 6.38146 7H9.00003C9.55232 7 10 7.44772 10 8C10 8.55228 9.55232 9 9.00003 9H4.47192C3.93256 9 3.49293 8.57299 3.47265 8.03859C3.47175 8.01771 3.47151 7.99677 3.47192 7.9758V3.5C3.47192 2.94772 3.91964 2.5 4.47192 2.5Z",fill:"currentColor"})}),JD=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M2.55823 12C2.55823 6.75329 6.81152 2.5 12.0582 2.5C14.5734 2.5 16.8595 3.47759 18.5582 5.07197V3.5C18.5582 2.94772 19.0059 2.5 19.5582 2.5C20.1105 2.5 20.5582 2.94772 20.5582 3.5V7.97591C20.5586 7.99622 20.5584 8.01651 20.5576 8.03674C20.5382 8.572 20.0982 9 19.5582 9H15.0582C14.5059 9 14.0582 8.55228 14.0582 8C14.0582 7.44772 14.5059 7 15.0582 7H17.6487C16.2746 5.46469 14.2786 4.5 12.0582 4.5C7.91609 4.5 4.55823 7.85786 4.55823 12C4.55823 16.1421 7.91609 19.5 12.0582 19.5C15.9011 19.5 19.0702 16.6089 19.5068 12.8836C19.5711 12.3351 20.0679 11.9425 20.6164 12.0068C21.165 12.0711 21.5575 12.5679 21.4932 13.1164C20.94 17.8375 16.9275 21.5 12.0582 21.5C6.81152 21.5 2.55823 17.2467 2.55823 12Z",fill:"currentColor"})}),s_=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M16.243 6.757a1 1 0 0 1 1 1v7.072a1 1 0 0 1-2 0v-4.657L8.464 16.95a1 1 0 0 1-1.414-1.414l6.778-6.779H9.172a1 1 0 0 1 0-2h7.07Z",clipRule:"evenodd"})}),Kst=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.jsx("path",{d:"M10.663 6.3872C10.8152 6.29068 11 6.40984 11 6.59007V8C11 8.55229 11.4477 9 12 9C12.5523 9 13 8.55229 13 8V6.59007C13 6.40984 13.1848 6.29068 13.337 6.3872C14.036 6.83047 14.5 7.61105 14.5 8.5C14.5 9.53284 13.8737 10.4194 12.9801 10.8006C12.9932 10.865 13 10.9317 13 11V13C13 13.5523 12.5523 14 12 14C11.4477 14 11 13.5523 11 13V11C11 10.9317 11.0068 10.865 11.0199 10.8006C10.1263 10.4194 9.5 9.53284 9.5 8.5C9.5 7.61105 9.96397 6.83047 10.663 6.3872Z",fill:"currentColor"}),a.jsx("path",{d:"M17.9754 4.01031C17.8588 4.00078 17.6965 4.00001 17.4 4.00001H9.8C8.94342 4.00001 8.36113 4.00078 7.91104 4.03756C7.47262 4.07338 7.24842 4.1383 7.09202 4.21799C6.7157 4.40974 6.40973 4.7157 6.21799 5.09202C6.1383 5.24842 6.07337 5.47263 6.03755 5.91104C6.00078 6.36113 6 6.94343 6 7.80001V16.1707C6.31278 16.0602 6.64937 16 7 16H18L18 4.60001C18 4.30348 17.9992 4.14122 17.9897 4.02464C17.9893 4.02 17.9889 4.0156 17.9886 4.01145C17.9844 4.01107 17.98 4.01069 17.9754 4.01031ZM17.657 18H7C6.44772 18 6 18.4477 6 19C6 19.5523 6.44772 20 7 20H17.657C17.5343 19.3301 17.5343 18.6699 17.657 18ZM4 19L4 7.75871C3.99999 6.95374 3.99998 6.28937 4.04419 5.74818C4.09012 5.18608 4.18868 4.66938 4.43597 4.18404C4.81947 3.43139 5.43139 2.81947 6.18404 2.43598C6.66937 2.18869 7.18608 2.09012 7.74818 2.0442C8.28937 1.99998 8.95373 1.99999 9.7587 2L17.4319 2C17.6843 1.99997 17.9301 1.99994 18.1382 2.01695C18.3668 2.03563 18.6366 2.07969 18.908 2.21799C19.2843 2.40974 19.5903 2.7157 19.782 3.09203C19.9203 3.36345 19.9644 3.63318 19.9831 3.86178C20.0001 4.06994 20 4.31574 20 4.56812L20 17C20 17.1325 19.9736 17.2638 19.9225 17.386C19.4458 18.5253 19.4458 19.4747 19.9225 20.614C20.0517 20.9227 20.0179 21.2755 19.8325 21.5541C19.6471 21.8326 19.3346 22 19 22H7C5.34315 22 4 20.6569 4 19Z",fill:"currentColor"})]}),fC=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M18.063 5.674a1 1 0 0 1 .263 1.39l-7.5 11a1 1 0 0 1-1.533.143l-4.5-4.5a1 1 0 1 1 1.414-1.414l3.647 3.647 6.82-10.003a1 1 0 0 1 1.39-.263Z",clipRule:"evenodd"})}),Tje=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM16.0755 7.93219C16.5272 8.25003 16.6356 8.87383 16.3178 9.32549L11.5678 16.0755C11.3931 16.3237 11.1152 16.4792 10.8123 16.4981C10.5093 16.517 10.2142 16.3973 10.0101 16.1727L7.51006 13.4227C7.13855 13.014 7.16867 12.3816 7.57733 12.0101C7.98598 11.6386 8.61843 11.6687 8.98994 12.0773L10.6504 13.9039L14.6822 8.17451C15 7.72284 15.6238 7.61436 16.0755 7.93219Z",fill:"currentColor"})}),Gst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 16 9",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.292893 0.292893C0.683418 -0.0976311 1.31658 -0.0976311 1.70711 0.292893L8 6.58579L14.2929 0.292894C14.6834 -0.0976305 15.3166 -0.0976304 15.7071 0.292894C16.0976 0.683418 16.0976 1.31658 15.7071 1.70711L8.70711 8.70711C8.31658 9.09763 7.68342 9.09763 7.29289 8.70711L0.292893 1.70711C-0.0976311 1.31658 -0.0976311 0.683417 0.292893 0.292893Z"})}),Xst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M15.707 4.293a1 1 0 0 1 0 1.414L9.414 12l6.293 6.293a1 1 0 0 1-1.414 1.414l-7-7a1 1 0 0 1 0-1.414l7-7a1 1 0 0 1 1.414 0Z",clipRule:"evenodd"})}),Yst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M8.293 4.293a1 1 0 0 1 1.414 0l7 7a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414-1.414L14.586 12 8.293 5.707a1 1 0 0 1 0-1.414Z",clipRule:"evenodd"})}),hV=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM12 6C12.5523 6 13 6.44772 13 7V12C13 12.2652 12.8946 12.5196 12.7071 12.7071L10.2071 15.2071C9.81658 15.5976 9.18342 15.5976 8.79289 15.2071C8.40237 14.8166 8.40237 14.1834 8.79289 13.7929L11 11.5858V7C11 6.44772 11.4477 6 12 6Z",fill:"currentColor"})}),Zst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M12.659 9.753a1 1 0 0 1-1.318 0l-4-3.5A1 1 0 1 1 8.66 4.747L12 7.671l3.341-2.924a1 1 0 1 1 1.318 1.506l-4 3.5Zm-4.002 9.501a1 1 0 1 1-1.314-1.508l4-3.485a1 1 0 0 1 1.314 0l4 3.485a1 1 0 1 1-1.314 1.508L12 16.34l-3.343 2.913Z"})}),_je=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M12.7587 2H16.2413C17.0463 1.99999 17.7106 1.99998 18.2518 2.04419C18.8139 2.09012 19.3306 2.18868 19.816 2.43597C20.5686 2.81947 21.1805 3.43139 21.564 4.18404C21.8113 4.66937 21.9099 5.18608 21.9558 5.74817C22 6.28936 22 6.95372 22 7.75868V11.2413C22 12.0463 22 12.7106 21.9558 13.2518C21.9099 13.8139 21.8113 14.3306 21.564 14.816C21.1805 15.5686 20.5686 16.1805 19.816 16.564C19.3306 16.8113 18.8139 16.9099 18.2518 16.9558C17.8906 16.9853 17.4745 16.9951 16.9984 16.9984C16.9951 17.4745 16.9853 17.8906 16.9558 18.2518C16.9099 18.8139 16.8113 19.3306 16.564 19.816C16.1805 20.5686 15.5686 21.1805 14.816 21.564C14.3306 21.8113 13.8139 21.9099 13.2518 21.9558C12.7106 22 12.0463 22 11.2413 22H7.75868C6.95372 22 6.28936 22 5.74818 21.9558C5.18608 21.9099 4.66937 21.8113 4.18404 21.564C3.43139 21.1805 2.81947 20.5686 2.43597 19.816C2.18868 19.3306 2.09012 18.8139 2.04419 18.2518C1.99998 17.7106 1.99999 17.0463 2 16.2413V12.7587C1.99999 11.9537 1.99998 11.2894 2.04419 10.7482C2.09012 10.1861 2.18868 9.66937 2.43597 9.18404C2.81947 8.43139 3.43139 7.81947 4.18404 7.43598C4.66937 7.18868 5.18608 7.09012 5.74817 7.04419C6.10939 7.01468 6.52548 7.00487 7.00162 7.00162C7.00487 6.52548 7.01468 6.10939 7.04419 5.74817C7.09012 5.18608 7.18868 4.66937 7.43598 4.18404C7.81947 3.43139 8.43139 2.81947 9.18404 2.43597C9.66937 2.18868 10.1861 2.09012 10.7482 2.04419C11.2894 1.99998 11.9537 1.99999 12.7587 2ZM9.00176 7L11.2413 7C12.0463 6.99999 12.7106 6.99998 13.2518 7.04419C13.8139 7.09012 14.3306 7.18868 14.816 7.43598C15.5686 7.81947 16.1805 8.43139 16.564 9.18404C16.8113 9.66937 16.9099 10.1861 16.9558 10.7482C17 11.2894 17 11.9537 17 12.7587V14.9982C17.4455 14.9951 17.7954 14.9864 18.089 14.9624C18.5274 14.9266 18.7516 14.8617 18.908 14.782C19.2843 14.5903 19.5903 14.2843 19.782 13.908C19.8617 13.7516 19.9266 13.5274 19.9624 13.089C19.9992 12.6389 20 12.0566 20 11.2V7.8C20 6.94342 19.9992 6.36113 19.9624 5.91104C19.9266 5.47262 19.8617 5.24842 19.782 5.09202C19.5903 4.7157 19.2843 4.40973 18.908 4.21799C18.7516 4.1383 18.5274 4.07337 18.089 4.03755C17.6389 4.00078 17.0566 4 16.2 4H12.8C11.9434 4 11.3611 4.00078 10.911 4.03755C10.4726 4.07337 10.2484 4.1383 10.092 4.21799C9.7157 4.40973 9.40973 4.7157 9.21799 5.09202C9.1383 5.24842 9.07337 5.47262 9.03755 5.91104C9.01357 6.20463 9.00489 6.55447 9.00176 7ZM5.91104 9.03755C5.47262 9.07337 5.24842 9.1383 5.09202 9.21799C4.7157 9.40973 4.40973 9.7157 4.21799 10.092C4.1383 10.2484 4.07337 10.4726 4.03755 10.911C4.00078 11.3611 4 11.9434 4 12.8V16.2C4 17.0566 4.00078 17.6389 4.03755 18.089C4.07337 18.5274 4.1383 18.7516 4.21799 18.908C4.40973 19.2843 4.7157 19.5903 5.09202 19.782C5.24842 19.8617 5.47262 19.9266 5.91104 19.9624C6.36113 19.9992 6.94342 20 7.8 20H11.2C12.0566 20 12.6389 19.9992 13.089 19.9624C13.5274 19.9266 13.7516 19.8617 13.908 19.782C14.2843 19.5903 14.5903 19.2843 14.782 18.908C14.8617 18.7516 14.9266 18.5274 14.9624 18.089C14.9992 17.6389 15 17.0566 15 16.2V12.8C15 11.9434 14.9992 11.3611 14.9624 10.911C14.9266 10.4726 14.8617 10.2484 14.782 10.092C14.5903 9.7157 14.2843 9.40973 13.908 9.21799C13.7516 9.1383 13.5274 9.07337 13.089 9.03755C12.6389 9.00078 12.0566 9 11.2 9H7.8C6.94342 9 6.36113 9.00078 5.91104 9.03755Z",fill:"currentColor"})}),Jst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M10.556 4a1 1 0 0 0-.97.751l-.292 1.14h5.421l-.293-1.14A1 1 0 0 0 13.453 4h-2.897Zm6.224 1.892-.421-1.639A3 3 0 0 0 13.453 2h-2.897A3 3 0 0 0 7.65 4.253l-.421 1.639H4a1 1 0 1 0 0 2h.1l1.215 11.425A3 3 0 0 0 8.3 22h7.4a3 3 0 0 0 2.984-2.683l1.214-11.425H20a1 1 0 1 0 0-2h-3.22Zm1.108 2H6.112l1.192 11.214A1 1 0 0 0 8.3 20h7.4a1 1 0 0 0 .995-.894l1.192-11.214ZM10 10a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0v-5a1 1 0 0 1 1-1Zm4 0a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0v-5a1 1 0 0 1 1-1Z",clipRule:"evenodd"})}),eat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M3 12a2 2 0 1 1 4 0 2 2 0 0 1-4 0Zm7 0a2 2 0 1 1 4 0 2 2 0 0 1-4 0Zm7 0a2 2 0 1 1 4 0 2 2 0 0 1-4 0Z"})}),tat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 10 16",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.34151 0.747423C4.71854 0.417526 5.28149 0.417526 5.65852 0.747423L9.65852 4.24742C10.0742 4.61111 10.1163 5.24287 9.75259 5.6585C9.38891 6.07414 8.75715 6.11626 8.34151 5.75258L5.00001 2.82877L1.65852 5.75258C1.24288 6.11626 0.61112 6.07414 0.247438 5.6585C-0.116244 5.24287 -0.0741267 4.61111 0.34151 4.24742L4.34151 0.747423ZM0.246065 10.3578C0.608879 9.94139 1.24055 9.89795 1.65695 10.2608L5.00001 13.1737L8.34308 10.2608C8.75948 9.89795 9.39115 9.94139 9.75396 10.3578C10.1168 10.7742 10.0733 11.4058 9.65695 11.7687L5.65695 15.2539C5.28043 15.582 4.7196 15.582 4.34308 15.2539L0.343082 11.7687C-0.0733128 11.4058 -0.116749 10.7742 0.246065 10.3578Z"})}),nat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M16.793 2.793a3.121 3.121 0 1 1 4.414 4.414l-8.5 8.5A1 1 0 0 1 12 16H9a1 1 0 0 1-1-1v-3a1 1 0 0 1 .293-.707l8.5-8.5Zm3 1.414a1.121 1.121 0 0 0-1.586 0L10 12.414V14h1.586l8.207-8.207a1.121 1.121 0 0 0 0-1.586ZM6 5a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-4a1 1 0 1 1 2 0v4a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h4a1 1 0 1 1 0 2H6Z",clipRule:"evenodd"})}),iat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M12 7a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 1 1-2 0V8h-3a1 1 0 0 1-1-1Zm-5 5a1 1 0 0 1 1 1v3h3a1 1 0 1 1 0 2H7a1 1 0 0 1-1-1v-4a1 1 0 0 1 1-1Z",clipRule:"evenodd"})}),rat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8-10C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2Zm4.465 6.763a1 1 0 0 0-1.228-1.228l-5.5 1.5a1 1 0 0 0-.702.702l-1.5 5.5a1 1 0 0 0 1.228 1.228l5.5-1.5a1 1 0 0 0 .702-.702l1.5-5.5Zm-6.54 5.312.89-3.26 3.26-.89-.89 3.26-3.26.89Z",clipRule:"evenodd"})}),sat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M14.4472 7.10558C14.9412 7.35257 15.1414 7.95324 14.8944 8.44722L10.8944 16.4472C10.6474 16.9412 10.0468 17.1414 9.55279 16.8944C9.05881 16.6474 8.85858 16.0468 9.10557 15.5528L13.1056 7.55279C13.3526 7.05881 13.9532 6.85859 14.4472 7.10558ZM6.6 7.20001C7.04183 7.53138 7.13137 8.15818 6.8 8.60001L4.25 12L6.8 15.4C7.13137 15.8418 7.04183 16.4686 6.6 16.8C6.15817 17.1314 5.53137 17.0418 5.2 16.6L2.2 12.6C1.93333 12.2444 1.93333 11.7556 2.2 11.4L5.2 7.40001C5.53137 6.95818 6.15817 6.86863 6.6 7.20001ZM17.4 7.20001C17.8418 6.86863 18.4686 6.95818 18.8 7.40001L21.8 11.4C22.0667 11.7556 22.0667 12.2444 21.8 12.6L18.8 16.6C18.4686 17.0418 17.8418 17.1314 17.4 16.8C16.9582 16.4686 16.8686 15.8418 17.2 15.4L19.75 12L17.2 8.60001C16.8686 8.15818 16.9582 7.53138 17.4 7.20001Z",fill:"currentColor"})}),jje=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.jsx("path",{d:"M13 12a1 1 0 1 0-2 0v4a1 1 0 1 0 2 0v-4Zm-1-2.5A1.25 1.25 0 1 0 12 7a1.25 1.25 0 0 0 0 2.5Z"}),a.jsx("path",{fillRule:"evenodd",d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Z",clipRule:"evenodd"})]}),aat=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.jsx("path",{d:"M7.79289 9.04289C8.18342 8.65237 8.81658 8.65237 9.20711 9.04289L11.4571 11.2929C11.8476 11.6834 11.8476 12.3166 11.4571 12.7071L9.20711 14.9571C8.81658 15.3476 8.18342 15.3476 7.79289 14.9571C7.40237 14.5666 7.40237 13.9334 7.79289 13.5429L9.33579 12L7.79289 10.4571C7.40237 10.0666 7.40237 9.43342 7.79289 9.04289ZM12.25 14.25C12.25 13.6977 12.6977 13.25 13.25 13.25H15.5C16.0523 13.25 16.5 13.6977 16.5 14.25C16.5 14.8023 16.0523 15.25 15.5 15.25H13.25C12.6977 15.25 12.25 14.8023 12.25 14.25Z",fill:"currentColor"}),a.jsx("path",{d:"M2 8C2 5.79086 3.79086 4 6 4C6.55228 4 7 4.44772 7 5C7 5.55228 6.55228 6 6 6C4.89543 6 4 6.89543 4 8V16C4 17.1046 4.89543 18 6 18C6.55228 18 7 18.4477 7 19C7 19.5523 6.55228 20 6 20C3.79086 20 2 18.2091 2 16V8ZM17 5C17 4.44772 17.4477 4 18 4C20.2091 4 22 5.79086 22 8V16C22 18.2091 20.2091 20 18 20C17.4477 20 17 19.5523 17 19C17 18.4477 17.4477 18 18 18C19.1046 18 20 17.1046 20 16V8C20 6.89543 19.1046 6 18 6C17.4477 6 17 5.55228 17 5Z",fill:"currentColor"})]}),oat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M6 12C6 11.4477 6.44772 11 7 11H17C17.5523 11 18 11.4477 18 12C18 12.5523 17.5523 13 17 13H7C6.44772 13 6 12.5523 6 12Z",fill:"currentColor"})}),lat=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.jsx("path",{d:"M12.75 9.50001C12.75 9.08579 13.0858 8.75001 13.5 8.75001H14.5C14.9142 8.75001 15.25 9.08579 15.25 9.50001V14.5C15.25 14.9142 14.9142 15.25 14.5 15.25H13.5C13.0858 15.25 12.75 14.9142 12.75 14.5V9.50001Z",fill:"currentColor"}),a.jsx("path",{d:"M9.50001 8.75001C9.08579 8.75001 8.75001 9.08579 8.75001 9.50001V14.5C8.75001 14.9142 9.08579 15.25 9.50001 15.25H10.5C10.9142 15.25 11.25 14.9142 11.25 14.5V9.50001C11.25 9.08579 10.9142 8.75001 10.5 8.75001H9.50001Z",fill:"currentColor"}),a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.97144 12C1.97144 6.46138 6.46138 1.97144 12 1.97144C17.5386 1.97144 22.0286 6.46138 22.0286 12C22.0286 17.5386 17.5386 22.0286 12 22.0286C6.46138 22.0286 1.97144 17.5386 1.97144 12ZM12 4.02858C7.59751 4.02858 4.02858 7.59751 4.02858 12C4.02858 16.4025 7.59751 19.9714 12 19.9714C16.4025 19.9714 19.9714 16.4025 19.9714 12C19.9714 7.59751 16.4025 4.02858 12 4.02858Z",fill:"currentColor"})]}),WJ=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.jsx("path",{d:"M9.5 9.33165V14.6683C9.5 15.4595 10.3752 15.9373 11.0408 15.5095L15.1915 12.8412C15.8038 12.4475 15.8038 11.5524 15.1915 11.1588L11.0408 8.49047C10.3752 8.06265 9.5 8.54049 9.5 9.33165Z",fill:"currentColor"}),a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12Z",fill:"currentColor"})]}),cat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M8 16.7229V7.27711C8 6.29075 9.08894 5.69298 9.9211 6.22254L17.3428 10.9454C18.1147 11.4366 18.1147 12.5634 17.3428 13.0546L9.92109 17.7775C9.08894 18.3071 8 17.7093 8 16.7229Z",fill:"currentColor"})}),Nje=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M12 5a1 1 0 0 1 1 1v5h5a1 1 0 1 1 0 2h-5v5a1 1 0 1 1-2 0v-5H6a1 1 0 1 1 0-2h5V6a1 1 0 0 1 1-1Z",clipRule:"evenodd"})}),Rje=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M12 3C12.5523 3 13 3.44772 13 4L13 11H20C20.5523 11 21 11.4477 21 12C21 12.5523 20.5523 13 20 13L13 13L13 20C13 20.5523 12.5523 21 12 21C11.4477 21 11 20.5523 11 20L11 13L4 13C3.44772 13 3 12.5523 3 12C3 11.4477 3.44772 11 4 11L11 11L11 4C11 3.44772 11.4477 3 12 3Z",fill:"currentColor"})}),uat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M12 6C12.5523 6 13 6.44772 13 7V11H17C17.5523 11 18 11.4477 18 12C18 12.5523 17.5523 13 17 13H13V17C13 17.5523 12.5523 18 12 18C11.4477 18 11 17.5523 11 17V13H7C6.44772 13 6 12.5523 6 12C6 11.4477 6.44772 11 7 11H11V7C11 6.44772 11.4477 6 12 6Z",fill:"currentColor"})}),dat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.875 4.5C7.35418 4.5 4.5 7.35418 4.5 10.875C4.5 14.3958 7.35418 17.25 10.875 17.25C14.3958 17.25 17.25 14.3958 17.25 10.875C17.25 7.35418 14.3958 4.5 10.875 4.5ZM2.5 10.875C2.5 6.24962 6.24962 2.5 10.875 2.5C15.5004 2.5 19.25 6.24962 19.25 10.875C19.25 12.8273 18.582 14.6236 17.462 16.0478L21.2071 19.7929C21.5976 20.1834 21.5976 20.8166 21.2071 21.2071C20.8166 21.5976 20.1834 21.5976 19.7929 21.2071L16.0478 17.462C14.6236 18.582 12.8273 19.25 10.875 19.25C6.24962 19.25 2.5 15.5004 2.5 10.875Z",fill:"currentColor"})}),fat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M11.2929 3.29289C11.6834 2.90237 12.3166 2.90237 12.7071 3.29289L16.7071 7.29289C17.0976 7.68342 17.0976 8.31658 16.7071 8.70711C16.3166 9.09763 15.6834 9.09763 15.2929 8.70711L13 6.41421V15C13 15.5523 12.5523 16 12 16C11.4477 16 11 15.5523 11 15V6.41421L8.70711 8.70711C8.31658 9.09763 7.68342 9.09763 7.29289 8.70711C6.90237 8.31658 6.90237 7.68342 7.29289 7.29289L11.2929 3.29289ZM4 14C4.55229 14 5 14.4477 5 15V15.2C5 16.0566 5.00078 16.6389 5.03755 17.089C5.07337 17.5274 5.1383 17.7516 5.21799 17.908C5.40973 18.2843 5.7157 18.5903 6.09202 18.782C6.24842 18.8617 6.47262 18.9266 6.91104 18.9624C7.36113 18.9992 7.94342 19 8.8 19H15.2C16.0566 19 16.6389 18.9992 17.089 18.9624C17.5274 18.9266 17.7516 18.8617 17.908 18.782C18.2843 18.5903 18.5903 18.2843 18.782 17.908C18.8617 17.7516 18.9266 17.5274 18.9624 17.089C18.9992 16.6389 19 16.0566 19 15.2V15C19 14.4477 19.4477 14 20 14C20.5523 14 21 14.4477 21 15V15.2413C21 16.0463 21 16.7106 20.9558 17.2518C20.9099 17.8139 20.8113 18.3306 20.564 18.816C20.1805 19.5686 19.5686 20.1805 18.816 20.564C18.3306 20.8113 17.8139 20.9099 17.2518 20.9558C16.7106 21 16.0463 21 15.2413 21H8.75868C7.95372 21 7.28936 21 6.74817 20.9558C6.18608 20.9099 5.66937 20.8113 5.18404 20.564C4.43139 20.1805 3.81947 19.5686 3.43597 18.816C3.18868 18.3306 3.09012 17.8139 3.04419 17.2518C2.99998 16.7106 2.99999 16.0463 3 15.2413L3 15C3 14.4477 3.44772 14 4 14Z",fill:"currentColor"})}),hat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M6 8C6 6.89543 6.89543 6 8 6H16C17.1046 6 18 6.89543 18 8V16C18 17.1046 17.1046 18 16 18H8C6.89543 18 6 17.1046 6 16V8Z",fill:"currentColor"})}),pat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M14.5 4a5.5 5.5 0 0 0-5.078 7.616 1 1 0 0 1-.216 1.092l-4.749 4.75a1.475 1.475 0 0 0 2.086 2.085l4.749-4.749a1 1 0 0 1 1.092-.216A5.5 5.5 0 0 0 20 9.414l-1.293 1.293a3.828 3.828 0 1 1-5.414-5.414L14.585 4H14.5ZM7 9.5a7.5 7.5 0 0 1 9.969-7.084 1 1 0 0 1 .378 1.651l-2.64 2.64a1.829 1.829 0 0 0 2.586 2.586l2.64-2.64a1 1 0 0 1 1.651.378 7.5 7.5 0 0 1-9.328 9.627l-4.299 4.3a3.475 3.475 0 0 1-4.914-4.915l4.299-4.299A7.497 7.497 0 0 1 7 9.5Z"})}),mN=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M8.99805 16.796C8.99805 15.4164 7.87961 14.2979 6.5 14.2979C5.12039 14.2979 4.00195 15.4164 4.00195 16.796C4.00196 18.1756 5.1204 19.294 6.5 19.294C7.8796 19.294 8.99804 18.1756 8.99805 16.796ZM19.748 15.0479C19.748 14.7729 19.525 14.5499 19.25 14.5499H15.75C15.475 14.5499 15.252 14.7729 15.252 15.0479V18.5479C15.252 18.823 15.475 19.046 15.75 19.046H19.25C19.525 19.046 19.748 18.823 19.748 18.5479V15.0479ZM10.0469 3.45125C11.077 2.15921 13.0849 2.20276 14.0498 3.58113L16.4189 6.96492L16.5205 7.12215C17.5046 8.76341 16.3301 10.9023 14.3691 10.9024H9.63086C7.60676 10.9023 6.42029 8.62316 7.58105 6.96492L9.9502 3.58113L10.0469 3.45125ZM12.4082 4.73055C12.2223 4.46497 11.842 4.44826 11.6318 4.68074L11.5918 4.73055L9.22266 8.11433C8.99176 8.44435 9.22808 8.89744 9.63086 8.89754H14.3691C14.7468 8.89745 14.9774 8.49957 14.8145 8.17781L14.7773 8.11433L12.4082 4.73055ZM11.002 16.796C11.0019 19.2824 8.98638 21.2979 6.5 21.2979C4.01362 21.2979 1.99806 19.2824 1.99805 16.796C1.99805 14.3096 4.01361 12.294 6.5 12.294C8.98639 12.294 11.002 14.3096 11.002 16.796ZM21.752 18.5479C21.752 19.9297 20.6318 21.0499 19.25 21.0499H15.75C14.3682 21.0499 13.248 19.9297 13.248 18.5479V15.0479C13.2481 13.6662 14.3682 12.546 15.75 12.546H19.25C20.6318 12.546 21.7519 13.6662 21.752 15.0479V18.5479Z",fill:"currentColor"})}),mat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5555 4C10.099 4 9.70052 4.30906 9.58693 4.75114L9.29382 5.8919H14.715L14.4219 4.75114C14.3083 4.30906 13.9098 4 13.4533 4H10.5555ZM16.7799 5.8919L16.3589 4.25342C16.0182 2.92719 14.8226 2 13.4533 2H10.5555C9.18616 2 7.99062 2.92719 7.64985 4.25342L7.22886 5.8919H4C3.44772 5.8919 3 6.33961 3 6.8919C3 7.44418 3.44772 7.8919 4 7.8919H4.10069L5.31544 19.3172C5.47763 20.8427 6.76455 22 8.29863 22H15.7014C17.2354 22 18.5224 20.8427 18.6846 19.3172L19.8993 7.8919H20C20.5523 7.8919 21 7.44418 21 6.8919C21 6.33961 20.5523 5.8919 20 5.8919H16.7799ZM17.888 7.8919H6.11196L7.30423 19.1057C7.3583 19.6142 7.78727 20 8.29863 20H15.7014C16.2127 20 16.6417 19.6142 16.6958 19.1057L17.888 7.8919ZM10 10C10.5523 10 11 10.4477 11 11V16C11 16.5523 10.5523 17 10 17C9.44772 17 9 16.5523 9 16V11C9 10.4477 9.44772 10 10 10ZM14 10C14.5523 10 15 10.4477 15 11V16C15 16.5523 14.5523 17 14 17C13.4477 17 13 16.5523 13 16V11C13 10.4477 13.4477 10 14 10Z"})}),gat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M7.5 5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5ZM3 7.5a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0ZM17 6a2 2 0 1 0 0 4 2 2 0 0 0 0-4Zm-4 2a4 4 0 1 1 8 0 4 4 0 0 1-8 0Zm-8.96 8.247C3.137 17.048 2.5 18.271 2.5 20a1 1 0 1 1-2 0c0-2.271.862-4.049 2.21-5.248C4.042 13.57 5.788 13 7.5 13s3.459.57 4.79 1.752c1.348 1.2 2.21 2.977 2.21 5.248a1 1 0 1 1-2 0c0-1.729-.638-2.952-1.54-3.753C10.042 15.43 8.788 15 7.5 15s-2.541.43-3.46 1.247Zm15.757-.607c-1.009-.638-2.338-.807-3.526-.472a1 1 0 0 1-.542-1.925c1.695-.478 3.616-.255 5.136.706 1.558.984 2.635 2.707 2.635 5.051a1 1 0 1 1-2 0c0-1.665-.732-2.746-1.703-3.36Z",clipRule:"evenodd"})}),Ije=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.jsx("path",{d:"M10.42 2.006a4 4 0 0 1 3.159 0c.674.29 1.188.822 1.667 1.456.474.627 1 1.473 1.653 2.523l3.542 5.696c.72 1.16 1.3 2.09 1.682 2.854.384.766.654 1.517.59 2.292a4 4 0 0 1-1.604 2.886c-.625.463-1.405.63-2.258.709-.85.078-1.945.078-3.311.078H8.46c-1.366 0-2.46 0-3.31-.078-.854-.078-1.634-.246-2.26-.71a4 4 0 0 1-1.603-2.885c-.064-.775.206-1.526.59-2.292.383-.764.961-1.694 1.682-2.854l3.542-5.696c.653-1.05 1.18-1.896 1.653-2.523.48-.634.993-1.166 1.667-1.456Zm2.37 1.838a2 2 0 0 0-1.58 0c-.192.083-.448.28-.86.825-.413.544-.891 1.312-1.577 2.415l-3.488 5.61c-.755 1.214-1.283 2.066-1.62 2.737-.34.678-.402 1.02-.385 1.232a2 2 0 0 0 .802 1.443c.171.127.494.255 1.25.324.748.069 1.75.07 3.18.07h6.976c1.43 0 2.432-.001 3.18-.07.756-.069 1.079-.197 1.25-.324a2 2 0 0 0 .802-1.443c.017-.212-.045-.554-.385-1.232-.337-.671-.865-1.523-1.62-2.737l-3.488-5.61c-.686-1.103-1.164-1.87-1.576-2.415-.413-.546-.67-.742-.861-.825"}),a.jsx("path",{d:"M12 7.5a1 1 0 0 1 1 1v3a1 1 0 1 1-2 0v-3a1 1 0 0 1 1-1M10.851 15a1.15 1.15 0 1 1 2.3 0 1.15 1.15 0 0 1-2.3 0"})]}),pV=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M5.636 5.636a1 1 0 0 1 1.414 0l4.95 4.95 4.95-4.95a1 1 0 0 1 1.414 1.414L13.414 12l4.95 4.95a1 1 0 0 1-1.414 1.414L12 13.414l-4.95 4.95a1 1 0 0 1-1.414-1.414l4.95-4.95-4.95-4.95a1 1 0 0 1 0-1.414Z",clipRule:"evenodd"})});/** + */var FD=p,dnt=ZP;function fnt(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var hnt=typeof Object.is=="function"?Object.is:fnt,pnt=dnt.useSyncExternalStore,mnt=FD.useRef,gnt=FD.useEffect,bnt=FD.useMemo,ynt=FD.useDebugValue;K2e.useSyncExternalStoreWithSelector=function(e,t,n,i,r){var s=mnt(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=bnt(function(){function c(m){if(!u){if(u=!0,d=m,m=i(m),r!==void 0&&o.hasValue){var g=o.value;if(r(g,m))return f=g}return f=m}if(g=f,hnt(d,m))return g;var b=i(m);return r!==void 0&&r(g,b)?(d=m,g):(d=m,f=b)}var u=!1,d,f,h=n===void 0?null:n;return[function(){return c(t())},h===null?void 0:function(){return c(h())}]},[t,n,i,r]);var l=pnt(e,s[0],s[1]);return gnt(function(){o.hasValue=!0,o.value=l},[l]),ynt(l),l};W2e.exports=K2e;var G2e=W2e.exports;const vnt=_1(G2e),xnt=parseInt(p.version,10);function zz(e){return xnt>=e}const wnt=zz(19),Ont=wnt?Snt:Ent;function X2e(e,t,n,i,r){return Ont(e,t,n,i,r)}function knt(e,t,n,i,r){const s=p.useCallback(()=>t(e.getSnapshot(),n,i,r),[e,t,n,i,r]);return ZP.useSyncExternalStore(e.subscribe,s,s)}function Snt(e,t,n,i,r){return knt(e,t,n,i,r)}function Ent(e,t,n,i,r){return G2e.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,i,r))}class Cnt{constructor(t){Zt(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));Zt(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const i of this.listeners){if(n!==this.updateTick)return;i(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,i,r){return X2e(this,t,n,i,r)}}const Vz={...P0},T3=Vz.useInsertionEffect,Ant=T3&&T3!==Vz.useLayoutEffect?T3:e=>e();function ci(e){const t=Ad(Tnt).current;return t.next=e,Ant(t.effect),t.trampoline}function Tnt(){const e={next:void 0,callback:_nt,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function _nt(){}class BD extends Cnt{constructor(t,n={},i){super(t),this.context=n,this.selectors=i}useSyncedValue(t,n){p.useDebugValue(t);const i=this;Jn(()=>{i.state[t]!==n&&i.set(t,n)},[i,t,n])}useSyncedValueWithCleanup(t,n){const i=this;Jn(()=>(i.state[t]!==n&&i.set(t,n),()=>{i.set(t,void 0)}),[i,t,n])}useSyncedValues(t){const n=this,i=Object.values(t);Jn(()=>{n.update(t)},[n,...i])}useControlledProp(t,n){p.useDebugValue(t);const i=this,r=n!==void 0;Jn(()=>{r&&!Object.is(i.state[t],n)&&i.setState({...i.state,[t]:n})},[i,t,n,r])}select(t,n,i,r){const s=this.selectors[t];return s(this.state,n,i,r)}useState(t,n,i,r){return p.useDebugValue(t),X2e(this,this.selectors[t],n,i,r)}useContextCallback(t,n){p.useDebugValue(t);const i=ci(n??Uz);this.context[t]=i}useStateSetter(t){const n=p.useRef(void 0);return n.current===void 0&&(n.current=i=>{this.set(t,i)}),n.current}observe(t,n){let i;typeof t=="function"?i=t:i=this.selectors[t];let r=i(this.state);return n(r,r,this),this.subscribe(s=>{const o=i(s);if(!Object.is(r,o)){const l=r;r=o,n(o,l,this)}})}}function UD(){return typeof window<"u"}function ll(e){return Hz(e)?(e.nodeName||"").toLowerCase():"#document"}function ta(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function hm(e){var t;return(t=(Hz(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Hz(e){return UD()?e instanceof Node||e instanceof ta(e).Node:!1}function Er(e){return UD()?e instanceof Element||e instanceof ta(e).Element:!1}function Js(e){return UD()?e instanceof HTMLElement||e instanceof ta(e).HTMLElement:!1}function Xw(e){return!UD()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ta(e).ShadowRoot}function QA(e){const{overflow:t,overflowX:n,overflowY:i,display:r}=Lu(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&r!=="inline"&&r!=="contents"}function jnt(e){return/^(table|td|th)$/.test(ll(e))}function QD(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Nnt=/transform|translate|scale|rotate|perspective|filter/,Rnt=/paint|layout|strict|content/,Xb=e=>!!e&&e!=="none";let _3;function qz(e){const t=Er(e)?Lu(e):e;return Xb(t.transform)||Xb(t.translate)||Xb(t.scale)||Xb(t.rotate)||Xb(t.perspective)||!Wz()&&(Xb(t.backdropFilter)||Xb(t.filter))||Nnt.test(t.willChange||"")||Rnt.test(t.contain||"")}function Int(e){let t=Yg(e);for(;Js(t)&&!Pg(t);){if(qz(t))return t;if(QD(t))return null;t=Yg(t)}return null}function Wz(){return _3==null&&(_3=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),_3}function Pg(e){return/^(html|body|#document)$/.test(ll(e))}function Lu(e){return ta(e).getComputedStyle(e)}function zD(e){return Er(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Yg(e){if(ll(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Xw(e)&&e.host||hm(e);return Xw(t)?t.host:t}function Y2e(e){const t=Yg(e);return Pg(t)?(e.ownerDocument||e).body:Js(t)&&QA(t)?t:Y2e(t)}function lC(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Y2e(e),s=r===((i=e.ownerDocument)==null?void 0:i.body),o=ta(r);if(s){const l=Z8(o);return t.concat(o,o.visualViewport||[],QA(r)?r:[],l&&n?lC(l):[])}else return t.concat(r,lC(r,[],n))}function Z8(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function bh(...e){return()=>{for(let t=0;t{e.removeEventListener(t,n,i)}}const J2=null;let Pnt=class{constructor(){Zt(this,"callbacks",[]);Zt(this,"callbacksCount",0);Zt(this,"nextId",1);Zt(this,"startId",1);Zt(this,"isScheduled",!1);Zt(this,"tick",t=>{var r;this.isScheduled=!1;const n=this.callbacks,i=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,i>0)for(let s=0;s=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}},e_=new Pnt;class jc{constructor(){Zt(this,"currentId",J2);Zt(this,"cancel",()=>{this.currentId!==J2&&(e_.cancel(this.currentId),this.currentId=J2)});Zt(this,"disposeEffect",()=>this.cancel)}static create(){return new jc}static request(t){return e_.request(t)}static cancel(t){return e_.cancel(t)}request(t){this.cancel(),this.currentId=e_.request(()=>{this.currentId=J2,t()})}}function Kz(){const e=Ad(jc.create).current;return $D(e.disposeEffect),e}const uk=0;class $u{constructor(){Zt(this,"currentId",uk);Zt(this,"clear",()=>{this.currentId!==uk&&(clearTimeout(this.currentId),this.currentId=uk)});Zt(this,"disposeEffect",()=>this.clear)}static create(){return new $u}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=uk,n()},t)}isStarted(){return this.currentId!==uk}}function f0(){const e=Ad($u.create).current;return $D(e.disposeEffect),e}let fJ=0;function Dnt(e){return fJ+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${fJ}`}function j3(e,t){if(typeof e=="string")return{description:e};if(typeof e=="function"){const n=e(t);return typeof n=="string"?{description:n}:n}return e}function Mnt(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:Lnt,platform:$nt,maxTouchPoints:Fnt}=Mnt(),VD=Lnt.toLowerCase(),cC=$nt.toLowerCase(),HD=/^i(os$|p)/.test(cC)||cC==="macintel"&&Fnt>1,hJ="android",J8=cC===hJ||VD.includes(hJ),Bnt=!HD&&cC.startsWith("mac");cC.startsWith("win");const Unt=Bnt||HD;var Aue;const V1=typeof CSS<"u"&&!!((Aue=CSS.supports)!=null&&Aue.call(CSS,"-webkit-backdrop-filter:none"));!V1&&VD.includes("firefox");!V1&&VD.includes("chrom");const Qnt=Unt,Z2e=/jsdom|happydom/.test(VD),eB="data-base-ui-focusable",J2e="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Tc(e){var n;let t=e.activeElement;for(;((n=t==null?void 0:t.shadowRoot)==null?void 0:n.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function ii(e,t){var i;if(!e||!t)return!1;const n=(i=t.getRootNode)==null?void 0:i.call(t);if(e.contains(t))return!0;if(n&&Xw(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function uo(e){return"composedPath"in e?e.composedPath()[0]:e.target}function e_e(e,t){if(!Er(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,i]of t.entries())if(ii(i,n))return!i.hasAttribute("data-trigger-disabled");return!1}function N3(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function znt(e){return e.matches("html,body")}function Gz(e){return Js(e)&&e.matches(J2e)}function Vnt(e){return(e==null?void 0:e.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${J2e}`))!=null}function pJ(e){return e?e.getAttribute("role")==="combobox"&&Gz(e):!1}function tB(e){if(!e||Z2e)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function mJ(e){return e?e.hasAttribute(eB)?e:e.querySelector(`[${eB}]`)||e:null}function Zg(e,t,n=!0){return e.filter(r=>r.parentId===t).flatMap(r=>{var s;return[...!n||(s=r.context)!=null&&s.open?[r]:[],...Zg(e,r.id,n)]})}function gJ(e,t){var r;let n=[],i=(r=e.find(s=>s.id===t))==null?void 0:r.parentId;for(;i;){const s=e.find(o=>o.id===i);i=s==null?void 0:s.parentId,s&&(n=n.concat(s))}return n}function Hnt(e){e.preventDefault(),e.stopPropagation()}function qnt(e){return"nativeEvent"in e}function Wnt(e){return e.pointerType===""&&e.isTrusted?!0:J8&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function t_e(e){return Z2e?!1:!J8&&e.width===0&&e.height===0||J8&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function rw(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Knt(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const Gnt=["top","right","bottom","left"],Jg=Math.min,Pp=Math.max,nI=Math.round,t_=Math.floor,Dp=e=>({x:e,y:e}),Xnt={left:"right",right:"left",bottom:"top",top:"bottom"};function Xz(e,t,n){return Pp(e,Jg(t,n))}function kh(e,t){return typeof e=="function"?e(t):e}function wd(e){return e.split("-")[0]}function pm(e){return e.split("-")[1]}function Yz(e){return e==="x"?"y":"x"}function qD(e){return e==="y"?"height":"width"}function hd(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function WD(e){return Yz(hd(e))}function Ynt(e,t,n){n===void 0&&(n=!1);const i=pm(e),r=WD(e),s=qD(r);let o=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=iI(o)),[o,iI(o)]}function Znt(e){const t=iI(e);return[nB(e),t,nB(t)]}function nB(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const bJ=["left","right"],yJ=["right","left"],Jnt=["top","bottom"],eit=["bottom","top"];function tit(e,t,n){switch(e){case"top":case"bottom":return n?t?yJ:bJ:t?bJ:yJ;case"left":case"right":return t?Jnt:eit;default:return[]}}function nit(e,t,n,i){const r=pm(e);let s=tit(wd(e),n==="start",i);return r&&(s=s.map(o=>o+"-"+r),t&&(s=s.concat(s.map(nB)))),s}function iI(e){const t=wd(e);return Xnt[t]+e.slice(t.length)}function iit(e){var t,n,i,r;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(i=e.bottom)!=null?i:0,left:(r=e.left)!=null?r:0}}function Zz(e){return typeof e!="number"?iit(e):{top:e,right:e,bottom:e,left:e}}function rI(e){const{x:t,y:n,width:i,height:r}=e;return{width:i,height:r,top:n,left:t,right:t+i,bottom:n+r,x:t,y:n}}function rit(e){return e.visibility==="hidden"||e.visibility==="collapse"}function n_e(e,t=e?Lu(e):null){return!e||!e.isConnected||!t||rit(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const sit='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function ait(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return Xw(n)?n.host:null}function iB(e){for(const t of Array.from(e.children))if(ll(t)==="summary")return t;return null}function oit(e,t){const n=iB(t);return!!n&&(e===n||ii(n,e))}function i_e(e){const t=e?ll(e):"";return e!=null&&e.matches(sit)&&(t!=="summary"||e.parentElement!=null&&ll(e.parentElement)==="details"&&iB(e.parentElement)===e)&&(t!=="details"||iB(e)==null)&&(t!=="input"||e.type!=="hidden")}function r_e(e){if(!i_e(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=ait(t)){const n=t!==e,i=ll(t)==="slot";if(t.hasAttribute("inert")||n&&ll(t)==="details"&&!t.open&&!oit(e,t)||t.hasAttribute("hidden")||!i&&!lit(t,n))return!1}return!0}function lit(e,t){const n=Lu(e);return t?n.display!=="none":n_e(e,n)}function s_e(e){const t=e.tabIndex;if(t<0){const n=ll(e);if(n==="details"||n==="audio"||n==="video"||Js(e)&&e.isContentEditable)return 0}return t}function R3(e){if(ll(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function cit(e,t){const n=R3(e);if(!n)return!0;const i=t.find(r=>{const s=R3(r);return(s==null?void 0:s.name)===n.name&&s.form===n.form&&s.checked});return i?i===n:t.find(r=>{const s=R3(r);return(s==null?void 0:s.name)===n.name&&s.form===n.form})===n}function a_e(e){if(Js(e)&&ll(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Js(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function o_e(e,t){a_e(e).forEach(n=>{i_e(n)&&t.push(n),o_e(n,t)})}function l_e(e,t,n){a_e(e).forEach(i=>{Js(i)&&i.matches(t)&&n.push(i),l_e(i,t,n)})}function Jz(e){return r_e(e)&&s_e(e)>=0}function c_e(e){const t=[];return o_e(e,t),t.filter(r_e)}function zA(e){const t=c_e(e);return t.filter(n=>s_e(n)>=0&&cit(n,t))}function u_e(e,t){const n=zA(e),i=n.length;if(i===0)return;const r=Tc(kr(e)),s=n.indexOf(r),o=s===-1?t===1?0:i-1:s+t;return n[o]}function eV(e){return u_e(kr(e).body,1)||e}function d_e(e){return u_e(kr(e).body,-1)||e}function f_e(e,t){if(!e)return null;const n=zA(kr(e).body),i=n.length;if(i===0)return null;const r=n.indexOf(e);if(r===-1)return null;const s=(r+t+i)%i;return n[s]}function uit(e){return f_e(e,1)}function dit(e){return f_e(e,-1)}function sw(e,t){const n=t||e.currentTarget,i=e.relatedTarget;return!i||!ii(n,i)}function fit(e){zA(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function vJ(e){const t=[];l_e(e,"[data-tabindex]",t),t.forEach(n=>{const i=n.dataset.tabindex;delete n.dataset.tabindex,i?n.setAttribute("tabindex",i):n.removeAttribute("tabindex")})}function I3(e){const t=new Map;let n=0,i=0;return e.forEach((r,s)=>{const o=r.transitionStatus==="ending";t.set(r.id,{value:r,domIndex:s,visibleIndex:o?-1:n,offsetY:i}),i+=r.height||0,o||(n+=1)}),t}function P3(e,t){let n=0;return e.map(i=>{if(i.transitionStatus==="ending")return i;const r=n>=t;return n+=1,i.limited===r?i:{...i,limited:r}})}const Uf={toasts:e=>e.toasts,isEmpty:e=>e.toasts.length===0,toast:(e,t)=>{var n;return(n=e.toastMetadata.get(t))==null?void 0:n.value},toastIndex:(e,t)=>{var n;return((n=e.toastMetadata.get(t))==null?void 0:n.domIndex)??-1},toastOffsetY:(e,t)=>{var n;return((n=e.toastMetadata.get(t))==null?void 0:n.offsetY)??0},toastVisibleIndex:(e,t)=>{var n;return((n=e.toastMetadata.get(t))==null?void 0:n.visibleIndex)??-1},focused:e=>e.focused,expanded:e=>e.hovering||e.focused,expandedOrOutOfFocus:e=>e.hovering||e.focused||!e.isWindowFocused,prevFocusElement:e=>e.prevFocusElement};class hit extends BD{constructor(n){super({...n,toastMetadata:I3(n.toasts)},{},Uf);Zt(this,"timers",new Map);Zt(this,"areTimersPaused",!1);Zt(this,"setViewport",n=>{this.set("viewport",n)});Zt(this,"disposeEffect",()=>()=>{this.timers.forEach(n=>{var i;(i=n.timeout)==null||i.clear()}),this.timers.clear()});Zt(this,"addToast",n=>{const{timeout:i,limit:r}=this.state,s=n.id||Dnt("toast");if(n.id){const u=Uf.toast(this.state,n.id);if(u)if(u.transitionStatus==="ending")this.removeToast(n.id,!0);else{const{id:d,transitionStatus:f,...h}=n;return this.updateToastInternal(n.id,h,!0,!0),n.id}}const o={...n,id:s,updateKey:0,transitionStatus:"starting"},l=[o,...this.state.toasts];this.setToasts(P3(l,r));const c=o.timeout??i;return o.type!=="loading"&&c>0&&this.scheduleTimer(s,c,()=>this.closeToast(s)),Uf.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),s});Zt(this,"updateToast",(n,i)=>{this.updateToastInternal(n,i,!1,!0)});Zt(this,"updateToastInternal",(n,i,r=!1,s=!1)=>{const{timeout:o,toasts:l}=this.state,c=Uf.toast(this.state,n);if(!c||c.transitionStatus==="ending")return;const u={...c,...i,...s&&{updateKey:c.updateKey+1}};this.setToasts(l.map(y=>y.id===n?u:y));const d=u.timeout??o,f=c.timeout??o,h=Object.hasOwn(i,"timeout"),m=u.transitionStatus!=="ending"&&u.type!=="loading"&&d>0,g=this.timers.has(n),b=f!==d,v=c.type==="loading";if(!m&&g){this.clearTimer(n);return}m&&(!g||b||h||v||r)&&(this.clearTimer(n),this.scheduleTimer(n,d,()=>this.closeToast(n)),Uf.expandedOrOutOfFocus(this.state)&&this.pauseTimers())});Zt(this,"closeToast",n=>{const i=n===void 0,{limit:r,toasts:s}=this.state;let o;if(i)o=s,this.clearTimers();else{const u=Uf.toast(this.state,n);if(!u)return;o=[u],this.clearTimer(n)}const l=s.map(u=>i||u.id===n?{...u,transitionStatus:"ending",height:0}:u),c=P3(l,r);this.setToasts(c,!c.some(u=>u.transitionStatus!=="ending")),o.forEach(u=>{var d;u.transitionStatus!=="ending"&&((d=u.onClose)==null||d.call(u))}),this.handleFocusManagement(n)});Zt(this,"promiseToast",(n,i)=>{const r=j3(i.loading),s=this.addToast({...r,type:"loading"}),o=n.then(l=>{const c=j3(i.success,l);return this.updateToast(s,{...c,type:"success",timeout:c.timeout}),l}).catch(l=>{const c=j3(i.error,l);return this.updateToast(s,{...c,type:"error",timeout:c.timeout}),Promise.reject(l)});return{}.hasOwnProperty.call(i,"setPromise")&&i.setPromise(o),o});Zt(this,"handleDocumentPointerDown",n=>{if(n.pointerType!=="touch")return;const i=uo(n);ii(this.state.viewport,i)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))})}syncProviderProps(n,i){const r=this.state.limit!==i;if(this.state.timeout===n&&!r)return;const s={timeout:n,limit:i};if(r){const o=P3(this.state.toasts,i);s.toasts=o,s.toastMetadata=I3(o)}this.update(s)}removeToast(n,i=!1){var l;const r=Uf.toastIndex(this.state,n);if(r===-1)return;const s=this.state.toasts[r];i||(l=s==null?void 0:s.onRemove)==null||l.call(s);const o=[...this.state.toasts];o.splice(r,1),this.setToasts(o)}pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(n=>{n.timeout&&(n.timeout.clear(),n.remaining=Math.max(n.remaining-(Date.now()-n.start),0))}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((n,i)=>{n.remaining=n.remaining>0?n.remaining:n.delay,n.timeout??(n.timeout=$u.create()),n.timeout.start(n.remaining,()=>{this.handleTimerFired(i),n.callback()}),n.start=Date.now()}))}restoreFocusToPrevElement(){var n;(n=this.state.prevFocusElement)==null||n.focus({preventScroll:!0})}scheduleTimer(n,i,r){const s=Date.now(),l=!Uf.expandedOrOutOfFocus(this.state)?$u.create():void 0;l==null||l.start(i,()=>{this.handleTimerFired(n),r()}),this.timers.set(n,{timeout:l,start:s,delay:i,remaining:i,callback:r})}clearTimers(){this.timers.forEach(n=>{var i;(i=n.timeout)==null||i.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer(n){var r;const i=this.timers.get(n);(r=i==null?void 0:i.timeout)==null||r.clear(),this.timers.delete(n),this.resetPausedStateIfNoTimersRemain()}handleTimerFired(n){this.timers.delete(n),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){this.timers.size===0&&(this.areTimersPaused=!1)}setToasts(n,i=n.length===0){const r={toasts:n,toastMetadata:I3(n)};i&&(r.hovering=!1,r.focused=!1),this.update(r)}handleFocusManagement(n){var c,u;const i=Tc(kr(this.state.viewport));if(!this.state.viewport||!ii(this.state.viewport,i)||!tB(i))return;if(n===void 0){this.restoreFocusToPrevElement();return}const r=Uf.toasts(this.state),s=Uf.toastIndex(this.state,n),o=(d,f)=>{for(let h=d;h>=0&&hnew hit({timeout:i,limit:r,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return $D(o.disposeEffect),p.useEffect(function(){return s?s[" subscribe"](({action:u,options:d})=>{const f=d.id;u==="promise"&&d.promise?o.promiseToast(d.promise,d):u==="update"&&f?o.updateToast(f,d):u==="close"?o.closeToast(f):o.addToast(d)}):void 0},[o,s]),a.jsxs(q2e.Provider,{value:o,children:[a.jsx(mit,{store:o,timeout:i,limit:r}),n]})};function mit(e){const{store:t,timeout:n,limit:i}=e;return Jn(()=>{t.syncProviderProps(n,i)},[t,n,i]),null}const git={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},h_e={...git,position:"fixed",top:0,left:0},h0=p.forwardRef(function(t,n){const[i,r]=p.useState();Jn(()=>{Qnt&&V1&&r("button")},[]);const s={tabIndex:0,role:i};return a.jsx("span",{...t,ref:n,style:h_e,"aria-hidden":i?void 0:!0,...s,"data-base-ui-focus-guard":""})});function Yw(e,t,n,i){const r=Ad(p_e).current;return yit(r,e,t,n,i)&&m_e(r,[e,t,n,i]),r.callback}function bit(e){const t=Ad(p_e).current;return vit(t,e)&&m_e(t,e),t.callback}function p_e(){return{callback:null,cleanup:null,refs:[]}}function yit(e,t,n,i,r){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==i||e.refs[3]!==r}function vit(e,t){return e.refs.length!==t.length||e.refs.some((n,i)=>n!==t[i])}function m_e(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const i=Array(t.length).fill(null);for(let r=0;r{for(let r=0;r=65&&r<=90&&(typeof t=="function"||typeof t>"u")}function iV(e){return typeof e=="function"}function y_e(e,t){return iV(e)?e(t):e??tV}function Eit(e,t){return t?e?(...n)=>{const i=n[0];if(w_e(i)){const s=i;aI(s);const o=t(...n);return s.baseUIHandlerPrevented||e==null||e(...n),o}const r=t(...n);return e==null||e(...n),r}:v_e(t):e}function v_e(e){return e&&((...t)=>{const n=t[0];return w_e(n)&&aI(n),e(...t)})}function aI(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function x_e(e,t){return t?e?t+" "+e:t:e}function w_e(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Ra(e,t,n={}){const i=t.render,r=Cit(t,n);if(n.enabled===!1)return null;const s=n.state??nc;return _it(e,i,r,s)}function Cit(e,t={}){const{className:n,style:i,render:r}=e,{state:s=nc,ref:o,props:l,stateAttributesMapping:c,enabled:u=!0}=t,d=u?wit(n,s):void 0,f=u?g_e(i,s):void 0,h=u?xit(s,c):nc,m=u&&l?Ait(l):void 0,g=u?rB(h,m)??{}:nc;return typeof document<"u"&&(u?Array.isArray(o)?g.ref=bit([g.ref,xJ(r),...o]):g.ref=Yw(g.ref,xJ(r),o):Yw(null,null)),u?(d!==void 0&&(g.className=x_e(g.className,d)),f!==void 0&&(g.style=rB(g.style,f)),g):nc}function Ait(e){return Array.isArray(e)?Oit(e):nV(void 0,e)}const Tit=Symbol.for("react.lazy");function _it(e,t,n,i){if(t){if(typeof t=="function")return t(n,i);const r=nV(n,t.props);r.ref=n.ref;let s=t;return(s==null?void 0:s.$$typeof)===Tit&&(s=p.Children.toArray(t)[0]),p.cloneElement(s,r)}if(e&&typeof e=="string")return jit(e,n);throw new Error(Hc(8))}function jit(e,t){return e==="button"?p.createElement("button",{type:"button",...t,key:t.key}):e==="img"?p.createElement("img",{alt:"",...t,key:t.key}):p.createElement(e,t)}const Nit=p.forwardRef(function(t,n){var F;const{render:i,className:r,style:s,children:o,...l}=t,c=Qz(),u=f0(),d=p.useRef(!1),f=p.useRef(!1),h=p.useRef(!1),m=c.useState("isEmpty"),g=c.useState("toasts"),b=c.useState("focused"),v=c.useState("expanded"),y=c.useState("prevFocusElement"),w=(F=g[0])==null?void 0:F.height,x=g.some(M=>M.transitionStatus==="ending"),O=g.filter(M=>M.priority==="high");p.useEffect(()=>{const M=c.state.viewport;if(!M||m)return;const V=ta(M),q=kr(M);function U(ee){ee.key==="F6"&&uo(ee)!==M&&(ee.preventDefault(),c.set("prevFocusElement",Tc(q)),M==null||M.focus({preventScroll:!0}),c.pauseTimers(),c.set("focused",!0))}function Z(ee){uo(ee)===V&&(c.set("isWindowFocused",!1),c.pauseTimers())}function z(ee){if(ee.relatedTarget)return;const ne=uo(ee),W=Tc(kr(M));(ne===V||!ii(M,ne)||!tB(W))&&c.resumeTimers(),u.start(0,()=>c.set("isWindowFocused",!0))}return bh(Ri(V,"keydown",U),Ri(V,"blur",Z,!0),Ri(V,"focus",z,!0),Ri(q,"pointerdown",c.handleDocumentPointerDown,!0))},[c,u,m]);function k(M){var q,U;d.current=!0;const V=M.relatedTarget===c.state.viewport?g.find(Z=>Z.transitionStatus!=="ending"&&!Z.limited):void 0;V?(U=(q=V.ref)==null?void 0:q.current)==null||U.focus():c.restoreFocusToPrevElement()}function S(M){M.key==="Tab"&&M.shiftKey&&uo(M.nativeEvent)===c.state.viewport&&(M.preventDefault(),c.restoreFocusToPrevElement())}function C(){c.state.toasts.some(V=>V.transitionStatus==="ending")||h.current||!f.current||(c.state.isWindowFocused&&c.resumeTimers(),c.set("hovering",!1),f.current=!1)}p.useEffect(C,[x,c]);function E(){c.pauseTimers(),c.set("hovering",!0),f.current=!1}function j(){c.state.isWindowFocused&&c.resumeTimers()}function T(){f.current=!0,C()}function R(M){M.pointerType==="touch"&&(h.current=!0)}function A(M){M.pointerType==="touch"&&(h.current=!1,C())}function N(){if(d.current){d.current=!1;return}b||tB(Tc(kr(c.state.viewport)))&&(c.set("focused",!0),c.pauseTimers())}function D(M){!b||ii(c.state.viewport,M.relatedTarget)||(c.set("focused",!1),j())}const I={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:E,onMouseMove:E,onMouseLeave:T,onFocus:N,onBlur:D,onKeyDown:S,onClick:N,onPointerDown:R,onPointerUp:A,onPointerCancel:A,style:{"--toast-frontmost-height":w?`${w}px`:void 0}},P={expanded:v},_=!m&&y&&a.jsx(h0,{onFocus:k}),L=Ra("div",t,{ref:[n,c.setViewport],state:P,props:[I,l,{children:a.jsxs(p.Fragment,{children:[_,o,_]})}]});return a.jsxs(p.Fragment,{children:[_,L,!b&&O.length>0&&a.jsx("div",{style:h_e,children:O.map(M=>a.jsxs("div",{role:"alert","aria-atomic":!0,children:[a.jsx("div",{children:M.title}),a.jsx("div",{children:M.description})]},M.id))})]})});function rV(e){return zz(19)?e:e?"true":void 0}const O_e=p.createContext(void 0);function Rit(){const e=p.useContext(O_e);if(!e)throw new Error(Hc(66));return e}let oI=function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e}({});const Iit={"data-starting-style":""},Pit={"data-ending-style":""},KD={transitionStatus(e){return e==="starting"?Iit:e==="ending"?Pit:null}};function rp(e){return e==null?e:"current"in e?e.current:e}function sV(e,t=!1){const n=Kz();return ci((i,r=null)=>{n.cancel();const s=rp(e);if(s==null)return;const o=s,l=()=>{yi.flushSync(i)};if(typeof o.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function c(){Promise.all(o.getAnimations().map(u=>u.finished)).then(()=>{r!=null&&r.aborted||l()},()=>{if(r!=null&&r.aborted)return;if(o.getAnimations().some(d=>d.pending||d.playState!=="finished")){c();return}l()})}if(t){const u="data-starting-style";if(!o.hasAttribute(u)){n.request(c);return}const d=new MutationObserver(()=>{o.hasAttribute(u)||(d.disconnect(),c())});d.observe(o,{attributes:!0,attributeFilter:[u]}),r==null||r.addEventListener("abort",()=>d.disconnect(),{once:!0});return}n.request(c)})}function VA(e){const{enabled:t=!0,open:n,ref:i,onComplete:r}=e,s=ci(r),o=sV(i,n);p.useEffect(()=>{if(!t)return;const l=new AbortController;return o(s,l.signal),()=>{l.abort()}},[t,n,s,o])}const Dit=500,Mit={style:{transition:"none"}},aV="data-base-ui-click-trigger",Lit="data-base-ui-swipe-ignore",$it="data-swipe-ignore",Fit=`[${Lit}]`,Bit=`[${$it}]`,Uit={fallbackAxisSide:"end"},Qit={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function D3(e,t,n){switch(e){case"up":return-n;case"down":return n;case"left":return-t;case"right":return t;default:return 0}}function zit(e){const n=ta(e).getComputedStyle(e).transform;let i=0,r=0,s=1;if(n&&n!=="none"){const o=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(o){const l=o[1].split(", ").map(parseFloat);l.length===6?(i=l[4],r=l[5],s=Math.sqrt(l[0]*l[0]+l[1]*l[1])):l.length===16&&(i=l[12],r=l[13],s=l[0])}}return{x:i,y:r,scale:s}}const Vit={...KD,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},wJ=40,Hit=10,OJ=.5,qit=1,Wit=`${Fit},${Bit}`,Kit=p.forwardRef(function(t,n){var Xe;const{toast:i,render:r,className:s,swipeDirection:o=["down","right"],style:l,...c}=t,u=((Xe=i.positionerProps)==null?void 0:Xe.anchor)!==void 0;let d=[];u||(d=Array.isArray(o)?o:[o]);const f=d.length>0,h=Qz(),[m,g]=p.useState(void 0),[b,v]=p.useState(!1),[y,w]=p.useState(!1),[x,O]=p.useState({x:0,y:0}),[k,S]=p.useState({x:0,y:0,scale:1}),[C,E]=p.useState(),[j,T]=p.useState(),[R,A]=p.useState(null),N=p.useRef(null),D=p.useRef(void 0),I=p.useRef({x:0,y:0}),P=p.useRef({x:0,y:0,scale:1}),_=p.useRef(void 0),L=p.useRef(0),F=p.useRef(!1),M=p.useRef({x:0,y:0}),V=p.useRef(!1),q=p.useRef({x:0,y:0}),U=p.useRef(null),Z=p.useRef(null),z=h.useState("toastIndex",i.id),ee=h.useState("toastVisibleIndex",i.id),ne=h.useState("toastOffsetY",i.id),W=h.useState("focused"),X=h.useState("expanded");VA({open:i.transitionStatus!=="ending",ref:N,onComplete(){i.transitionStatus==="ending"&&h.removeToast(i.id)}});const H=ci((Re=!1)=>{const se=N.current;if(!se)return;const ce=se.style.height;se.style.height="auto";const ve=se.offsetHeight;se.style.height=ce;function Se(){h.updateToastInternal(i.id,{ref:N,height:ve,transitionStatus:void 0})}Re?yi.flushSync(Se):Se()});Jn(()=>{const Re=D.current;i.transitionStatus!=="starting"&&Re===i.id||(Re!==void 0&&(g(void 0),S({x:0,y:0,scale:1}),ae({x:0,y:0})),D.current=i.id,H())},[H,i.id,i.transitionStatus]);function ae(Re){q.current=Re,O(Re)}Jn(()=>()=>{var Re;(Re=Z.current)==null||Re.abort()},[]);function Y(Re,se){const ce=oe=>oe>0?oe**OJ:-(Math.abs(oe)**OJ),ve=Re>0&&!d.includes("right")||Re<0&&!d.includes("left"),Se=se>0&&!d.includes("down")||se<0&&!d.includes("up");return{x:ve?ce(Re):Re,y:Se?ce(se):se}}const K=ci(Re=>{var $e;if(Re.pointerId!==U.current)return;U.current=null,($e=Z.current)==null||$e.abort(),Z.current=null,v(!1),w(!1),A(null);const se=P.current;if(Re.type==="pointercancel"||F.current){ae({x:se.x,y:se.y}),g(void 0);return}const ce=q.current,ve=ce.x-se.x,Se=ce.y-se.y;let oe;for(const Ue of d)if(D3(Ue,ve,Se)>wJ){oe=Ue;break}oe?(g(oe),h.closeToast(i.id)):(ae({x:se.x,y:se.y}),g(void 0))});function ie(Re){var Ue,me;if(Re.button!==0)return;Re.pointerType==="touch"&&h.pauseTimers();const se=uo(Re.nativeEvent);if(se==null?void 0:se.closest(`button,a,input,textarea,[role="button"],${Wit}`))return;F.current=!1,_.current=void 0,L.current=0,U.current=Re.pointerId,I.current={x:Re.clientX,y:Re.clientY},M.current=I.current;const ve=Re.currentTarget,Se=zit(ve);P.current=Se,S(Se),ae({x:Se.x,y:Se.y}),h.set("hovering",!0),v(!0),w(!1),A(null),V.current=!0,(Ue=Z.current)==null||Ue.abort();const oe=new AbortController;Z.current=oe;const $e=kr(ve);$e.addEventListener("pointerup",K,{signal:oe.signal}),$e.addEventListener("pointercancel",K,{signal:oe.signal}),(me=ve.setPointerCapture)==null||me.call(ve,Re.pointerId)}function J(Re){if(Re.pointerId!==U.current)return;Re.preventDefault(),V.current&&(I.current={x:Re.clientX,y:Re.clientY},V.current=!1);const{clientY:se,clientX:ce,movementX:ve,movementY:Se}=Re;(Se<0&&se>M.current.y||Se>0&&seM.current.x||ve>0&&ce=qit){w(!0);const xt=d.includes("left")||d.includes("right"),tt=d.includes("up")||d.includes("down");if(xt&&tt){const mt=Math.abs(oe),_e=Math.abs($e);ke=mt>_e?"horizontal":"vertical",A(ke)}}let Ae;if(!_.current)ke==="vertical"?$e>0?Ae="down":$e<0&&(Ae="up"):ke==="horizontal"?oe>0?Ae="right":oe<0&&(Ae="left"):Math.abs(oe)>=Math.abs($e)?Ae=oe>0?"right":"left":Ae=$e>0?"down":"up",Ae&&d.includes(Ae)&&(_.current=Ae,L.current=D3(Ae,oe,$e),g(Ae));else{const Ct=_.current,xt=D3(Ct,me,Ue);xt>wJ?(F.current=!1,g(Ct)):!(d.includes("left")&&d.includes("right"))&&!(d.includes("up")&&d.includes("down"))&&L.current-xt>=Hit&&(F.current=!0)}const He=Y(oe,$e);let Qe=P.current.x,jt=P.current.y;const Pt=d.includes("left")||d.includes("right"),Kt=d.includes("up")||d.includes("down");ke!=="vertical"&&Pt&&(Qe+=He.x),ke!=="horizontal"&&Kt&&(jt+=He.y),ae({x:Qe,y:jt})}function ye(Re){if(Re.key==="Escape"){if(!N.current||!ii(N.current,Tc(kr(N.current))))return;h.closeToast(i.id)}}p.useEffect(()=>{const Re=N.current;if(!f||!Re)return;function se(ce){U.current===null||!ii(Re,uo(ce))||ce.preventDefault()}return Ri(Re,"touchmove",se,{passive:!1})},[f]);function de(){const Re=x.x-k.x,se=x.y-k.y;return{transition:b?"none":void 0,transform:b?`translateX(${x.x}px) translateY(${x.y}px) scale(${k.scale})`:void 0,"--toast-swipe-movement-x":`${Re}px`,"--toast-swipe-movement-y":`${se}px`}}const ge=i.priority==="high",Ee={role:ge?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":C,"aria-describedby":j,"aria-hidden":ge&&!W?!0:void 0,onPointerDown:f?ie:void 0,onPointerMove:f?J:void 0,onPointerUp:f?K:void 0,onPointerCancel:f?K:void 0,onKeyDown:ye,inert:rV(i.limited),style:{...de(),"--toast-index":i.transitionStatus==="ending"?z:ee,"--toast-offset-y":`${ne}px`,"--toast-height":i.height?`${i.height}px`:void 0}},xe=p.useMemo(()=>({toast:i,setTitleId:E,setDescriptionId:T,recalculateHeight:H,visibleIndex:ee,expanded:X}),[i,E,T,H,ee,X]),Ne={transitionStatus:i.transitionStatus,expanded:X,limited:i.limited||!1,type:i.type,swiping:b,swipeDirection:m},We=Ra("div",t,{ref:[n,N],state:Ne,stateAttributesMapping:Vit,props:[Ee,c]});return a.jsx(O_e.Provider,{value:xe,children:We})});let kJ=0;function Git(e,t="mui"){const[n,i]=p.useState(e),r=e||n;return p.useEffect(()=>{n==null&&(kJ+=1,i(`${t}-${kJ}`))},[n,t]),r}const SJ=Vz.useId;function HA(e,t){if(SJ!==void 0){const n=SJ();return e??(t?`${t}-${n}`:n)}return Git(e,t)}function k_e(e){return e==null||typeof e=="boolean"||e===""?!1:Array.isArray(e)?e.some(k_e):!0}function Xit(e){return p.isValidElement(e)&&k_e(e.props.children)}function S_e(e,t,n){const{toast:i,setTitleId:r,setDescriptionId:s}=Rit(),o=n==="title"?r:s,l=t??(n==="title"?i.title:i.description);return{id:HA(e),children:l,type:i.type,setId:o}}function E_e(e,t,n){const i=Xit(e);return Jn(()=>{if(i)return n(t),()=>{n(r=>r===t?void 0:r)}},[i,t,n]),i?e:null}const Yit=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:o,children:l,...c}=t,{id:u,children:d,type:f,setId:h}=S_e(o,l,"description"),g=Ra("p",t,{ref:n,state:{type:f},props:{...c,id:u,children:d}});return E_e(g,u,h)}),Zit=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:o,children:l,...c}=t,{id:u,children:d,type:f,setId:h}=S_e(o,l,"title"),g=Ra("h2",t,{ref:n,state:{type:f},props:{...c,id:u,children:d}});return E_e(g,u,h)}),Jit=p.createContext(void 0);function ert(e=!1){const t=p.useContext(Jit);if(t===void 0&&!e)throw new Error(Hc(16));return t}function trt(e){const{focusableWhenDisabled:t,disabled:n,composite:i=!1,tabIndex:r=0,isNativeButton:s}=e,o=i&&t!==!1,l=i&&t===!1;return{props:p.useMemo(()=>{const u={onKeyDown(d){n&&t&&d.key!=="Tab"&&d.preventDefault()}};return i||(u.tabIndex=r,!s&&n&&(u.tabIndex=t?r:-1)),(s&&(t||o)||!s&&n)&&(u["aria-disabled"]=n),s&&(!t||l)&&(u.disabled=n),u},[i,n,t,o,l,s,r])}}function M3(e,t,{detail:n=0}={}){e.dispatchEvent(new(ta(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function GD(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:i=0,native:r=!0,composite:s}=e,o=p.useRef(null),l=ert(!0),c=s??l!==void 0,{props:u}=trt({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:i,isNativeButton:r}),d=p.useCallback(()=>{const m=o.current;L3(m)&&c&&t&&u.disabled===void 0&&m.disabled&&(m.disabled=!1)},[t,u.disabled,c]);Jn(d,[d]);const f=p.useCallback((m={})=>{const{onClick:g,onMouseDown:b,onKeyUp:v,onKeyDown:y,onPointerDown:w,...x}=m;return nV({onClick(O){if(t){O.preventDefault();return}g==null||g(O)},onMouseDown(O){t||b==null||b(O)},onKeyDown(O){if(t||(aI(O),y==null||y(O),O.baseUIHandlerPrevented))return;const k=O.target===O.currentTarget,S=O.currentTarget,C=L3(S),E=!r&&nrt(S),j=k&&(r?C:!E),T=O.key==="Enter",R=O.key===" ",A=S.getAttribute("role"),N=(A==null?void 0:A.startsWith("menuitem"))||A==="option"||A==="gridcell";if(k&&c&&R){if(O.defaultPrevented&&N)return;O.preventDefault(),(!r||C)&&(O.preventBaseUIHandler(),M3(S,O));return}if(!j||r||!R&&!T){k&&E&&R&&O.preventDefault();return}O.defaultPrevented||(O.preventDefault(),T&&(O.preventBaseUIHandler(),M3(S,O)))},onKeyUp(O){if(!t){if(aI(O),v==null||v(O),O.target===O.currentTarget&&r&&c&&L3(O.currentTarget)&&O.key===" "){O.preventDefault();return}O.baseUIHandlerPrevented||O.target===O.currentTarget&&!r&&!c&&!O.defaultPrevented&&O.key===" "&&(O.preventBaseUIHandler(),M3(O.currentTarget,O))}},onPointerDown(O){if(t){O.preventDefault();return}w==null||w(O)}},r?{type:"button"}:{role:"button"},u,x)},[t,u,c,r]),h=ci(m=>{o.current=m,d()});return{getButtonProps:f,buttonRef:h}}function L3(e){return Js(e)&&e.tagName==="BUTTON"}function nrt(e){return Js(e)&&e.tagName==="A"&&!!e.href}const C_e="none",Zw="trigger-press",gu="trigger-hover",A_e="outside-press",T_e="close-press",uC="focus-out",__e="escape-key",j_e="imperative-action";function fa(e,t,n,i){let r=!1,s=!1;const o=nc;return{reason:e,event:t??new Event("base-ui"),cancel(){r=!0},allowPropagation(){s=!0},get isCanceled(){return r},get isPropagationAllowed(){return s},trigger:n,...o}}function lI(e){return`data-base-ui-${e}`}const N_e=p.createContext(null),R_e=()=>p.useContext(N_e),irt=lI("portal");function I_e(e={}){const{ref:t,container:n,componentProps:i=nc,elementProps:r}=e,s=HA(),o=R_e(),l=o==null?void 0:o.portalNode,[c,u]=p.useState(null),[d,f]=p.useState(null),h=ci(v=>{v!==null&&f(v)}),m=p.useRef(null);Jn(()=>{if(n===null){m.current&&(m.current=null,f(null),u(null));return}const v=(n&&(Hz(n)?n:n.current))??l??document.body;if(v==null){m.current&&(m.current=null,f(null),u(null));return}m.current!==v&&(m.current=v,f(null),u(v))},[n,l]);const g=Ra("div",i,{ref:[t,h],props:[{id:s,[irt]:""},r]}),b=c&&g?yi.createPortal(g,c):null;return{node:d,nodeId:p.isValidElement(g)?g.props.id:void 0,subtree:b}}const P_e=p.forwardRef(function(t,n){const{render:i,className:r,style:s,children:o,container:l,...c}=t,{node:u,nodeId:d,subtree:f}=I_e({container:l,ref:n,componentProps:t,elementProps:c}),h=p.useRef(null),m=p.useRef(null),g=p.useRef(null),b=p.useRef(null),[v,y]=p.useState(null),w=p.useRef(!1),x=v==null?void 0:v.modal,O=v==null?void 0:v.open,k=!!v&&!v.modal&&v.open&&!!u;p.useEffect(()=>{if(!u||x)return;function C(E){u&&E.relatedTarget&&sw(E)&&(E.type==="focusin"?w.current&&(vJ(u),w.current=!1):(fit(u),w.current=!0))}return bh(Ri(u,"focusin",C,!0),Ri(u,"focusout",C,!0))},[u,x]),Jn(()=>{!u||O!==!0||!w.current||(vJ(u),w.current=!1)},[O,u]);const S=p.useMemo(()=>({beforeOutsideRef:h,afterOutsideRef:m,beforeInsideRef:g,afterInsideRef:b,portalNode:u,setFocusManagerState:y}),[u]);return a.jsxs(p.Fragment,{children:[f,a.jsxs(N_e.Provider,{value:S,children:[k&&u&&a.jsx(h0,{"data-type":"outside",ref:h,onFocus:C=>{var E;if(sw(C,u))(E=g.current)==null||E.focus();else{const j=v?v.domReference:null,T=d_e(j);T==null||T.focus()}}}),k&&u&&a.jsx("span",{"aria-owns":d,style:Qit}),u&&yi.createPortal(o,u),k&&u&&a.jsx(h0,{"data-type":"outside",ref:m,onFocus:C=>{var E;if(sw(C,u))(E=b.current)==null||E.focus();else{const j=v?v.domReference:null,T=eV(j);T==null||T.focus(),v!=null&&v.closeOnFocusOut&&(v==null||v.onOpenChange(!1,fa(uC,C.nativeEvent)))}}})]})]})}),rrt=p.forwardRef(function(t,n){const{children:i,container:r,className:s,render:o,style:l,...c}=t,{node:u,subtree:d}=I_e({container:r,ref:n,componentProps:t,elementProps:c});return!d&&!u?null:a.jsxs(p.Fragment,{children:[d,u&&yi.createPortal(i,u)]})}),srt=p.forwardRef(function(t,n){return a.jsx(rrt,{ref:n,...t})});function Zl(e){const t=Ad(art,e).current;return t.next=e,Jn(t.effect),t}function art(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function ort(e,t){return t!=null&&!rw(t)?0:typeof e=="function"?e():e}function sB(e,t,n){const i=ort(e,n);return typeof i=="number"?i:i==null?void 0:i[t]}function EJ(e){return typeof e=="function"?e():e}function D_e(e,t){return t||e==="click"||e==="mousedown"}function lrt(e){return(e==null?void 0:e.includes("mouse"))&&e!=="mousedown"}let n_=0;function $3(e,t={}){const{preventScroll:n=!1,sync:i=!1,shouldFocus:r}=t;cancelAnimationFrame(n_);function s(){r&&!r()||e==null||e.focus({preventScroll:n})}if(i)return s(),Uz;const o=requestAnimationFrame(s);return n_=o,()=>{n_===o&&(cancelAnimationFrame(o),n_=0)}}const F3={inert:new WeakMap,"aria-hidden":new WeakMap},CJ="data-base-ui-inert",aB={inert:new WeakSet,"aria-hidden":new WeakSet};let dk=new WeakMap,B3=0;function crt(e){return aB[e]}function M_e(e){return e?Xw(e)?e.host:M_e(e.parentNode):null}const AJ=(e,t)=>t.map(n=>{if(e.contains(n))return n;const i=M_e(n);return e.contains(i)?i:null}).filter(n=>n!=null),TJ=e=>{const t=new Set;return e.forEach(n=>{let i=n;for(;i&&!t.has(i);)t.add(i),i=i.parentNode}),t},_J=(e,t,n)=>{const i=[],r=s=>{!s||n.has(s)||Array.from(s.children).forEach(o=>{ll(o)!=="script"&&(t.has(o)?r(o):i.push(o))})};return r(e),i};function urt(e,t,n,i,{mark:r=!0}){let s=null;i?s="inert":n&&(s="aria-hidden");let o=null,l=null;const c=AJ(t,e),u=r?_J(t,TJ(c),new Set(c)):[],d=[],f=[];if(s){const h=F3[s],m=crt(s);l=m,o=h;const g=AJ(t,Array.from(t.querySelectorAll("[aria-live]"))),b=c.concat(g);_J(t,TJ(b),new Set(b)).forEach(y=>{const w=y.getAttribute(s),x=w!==null&&w!=="false",O=(h.get(y)||0)+1;h.set(y,O),d.push(y),O===1&&x&&m.add(y),x||y.setAttribute(s,s==="inert"?"":"true")})}return r&&u.forEach(h=>{const m=(dk.get(h)||0)+1;dk.set(h,m),f.push(h),m===1&&h.setAttribute(CJ,"")}),B3+=1,()=>{o&&d.forEach(h=>{const g=(o.get(h)||0)-1;o.set(h,g),g||(!(l!=null&&l.has(h))&&s&&h.removeAttribute(s),l==null||l.delete(h))}),r&&f.forEach(h=>{const m=(dk.get(h)||0)-1;dk.set(h,m),m||h.removeAttribute(CJ)}),B3-=1,B3||(F3.inert=new WeakMap,F3["aria-hidden"]=new WeakMap,aB.inert=new WeakSet,aB["aria-hidden"]=new WeakSet,dk=new WeakMap)}}function jJ(e,t={}){const{ariaHidden:n=!1,inert:i=!1,mark:r=!0}=t,s=kr(e[0]).body;return urt(e,s,n,i,{mark:r})}function L_e(){const e=new Map;return{emit(t,n){var i;(i=e.get(t))==null||i.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var i;(i=e.get(t))==null||i.delete(n)}}}class drt{constructor(){Zt(this,"nodesRef",{current:[]});Zt(this,"events",L_e())}addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(i=>i===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const $_e=p.createContext(null),F_e=p.createContext(null),XD=()=>{var e;return((e=p.useContext($_e))==null?void 0:e.id)||null},H1=e=>{const t=p.useContext(F_e);return e??t};function frt(e){const t=HA(),n=H1(e),i=XD();return Jn(()=>{if(!t)return;const r={id:t,parentId:i};return n==null||n.addNode(r),()=>{n==null||n.removeNode(r)}},[n,t,i]),t}function hrt(e){const{children:t,id:n}=e,i=XD();return a.jsx($_e.Provider,{value:p.useMemo(()=>({id:n,parentId:i}),[n,i]),children:t})}function prt(e){const{children:t,externalTree:n}=e,i=Ad(()=>n??new drt).current;return a.jsx(F_e.Provider,{value:i,children:t})}function mrt(e,t){const n=ta(uo(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const NJ=20;let gg=[];function oV(){gg=gg.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function RJ(e){oV(),e&&ll(e)!=="body"&&(gg.push(new WeakRef(e)),gg.length>NJ&&(gg=gg.slice(-NJ)))}function IJ(){var e;return oV(),(e=gg[gg.length-1])==null?void 0:e.deref()}function grt(e){return e?Jz(e)?e:zA(e)[0]||e:null}function PJ(e){var r;if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!((r=e.getAttribute("role"))!=null&&r.includes("dialog")))return;const n=c_e(e).filter(s=>{const o=s.getAttribute("data-tabindex")||"";return Jz(s)||s.hasAttribute("data-tabindex")&&!o.startsWith("-")}),i=e.getAttribute("tabindex");n.length===0?i!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(i!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function B_e(e){const{context:t,children:n,disabled:i=!1,initialFocus:r=!0,returnFocus:s=!0,restoreFocus:o=!1,modal:l=!0,closeOnFocusOut:c=!0,openInteractionType:u="",nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:h,externalTree:m,getInsideElements:g}=e,b="rootStore"in t?t.rootStore:t,v=b.useState("open"),y=b.useState("domReferenceElement"),w=b.useState("floatingElement"),{events:x,dataRef:O}=b.context,k=ci(()=>{var Y;return(Y=O.current.floatingContext)==null?void 0:Y.nodeId}),S=r===!1,C=pJ(y)&&S,E=Zl(r),j=Zl(s),T=Zl(u),R=Zl(v),A=H1(m),N=R_e(),D=p.useRef(!1),I=p.useRef(!1),P=p.useRef(!1),_=p.useRef(null),L=p.useRef(""),F=p.useRef(""),M=p.useRef(null),V=p.useRef(null),q=Yw(M,h,N==null?void 0:N.beforeInsideRef),U=Yw(V,N==null?void 0:N.afterInsideRef),Z=f0(),z=f0(),ee=Kz(),ne=N!=null,W=mJ(w),X=ci((Y=W)=>Y?zA(Y):[]),H=ci(()=>(g==null?void 0:g().filter(Y=>Y!=null))??[]);p.useEffect(()=>{if(i||!l)return;function Y(ie){ie.key==="Tab"&&ii(W,Tc(kr(W)))&&X().length===0&&!C&&Hnt(ie)}const K=kr(W);return Ri(K,"keydown",Y)},[i,W,l,C,X]),p.useEffect(()=>{if(i||!v)return;const Y=kr(W);function K(){P.current=!1}function ie(ye){const de=uo(ye),ge=H(),Ee=ii(w,de)||ii(y,de)||ii(N==null?void 0:N.portalNode,de)||ge.some(xe=>xe===de||ii(xe,de));P.current=!Ee,F.current=ye.pointerType||"keyboard",de!=null&&de.closest(`[${aV}]`)&&(I.current=!0,z.start(0,()=>{I.current=!1}))}function J(){F.current="keyboard"}return bh(Ri(Y,"pointerdown",ie,!0),Ri(Y,"pointerup",K,!0),Ri(Y,"pointercancel",K,!0),Ri(Y,"keydown",J,!0),K)},[i,w,y,W,v,N,z,H]),p.useEffect(()=>{if(i||!c)return;const Y=kr(W);function K(){I.current=!0,z.start(0,()=>{I.current=!1})}function ie(ge){const Ee=uo(ge);Jz(Ee)&&(_.current=Ee)}function J(ge){const Ee=ge.relatedTarget,xe=ge.currentTarget,Ne=uo(ge);l&&Ee==null&&Ne!=null&&ii(w,Ne)&&RJ(Ne),queueMicrotask(()=>{const We=k(),Xe=b.context.triggerElements,Re=H(),se=(Ee==null?void 0:Ee.hasAttribute(lI("focus-guard")))&&[M.current,V.current,N==null?void 0:N.beforeInsideRef.current,N==null?void 0:N.afterInsideRef.current,N==null?void 0:N.beforeOutsideRef.current,N==null?void 0:N.afterOutsideRef.current,rp(f),rp(d)].includes(Ee),ce=!(ii(y,Ee)||ii(w,Ee)||ii(Ee,w)||ii(N==null?void 0:N.portalNode,Ee)||Re.some(ve=>ve===Ee||ii(ve,Ee))||Xe.hasMatchingElement(ve=>ii(ve,Ee))||se||A&&(Zg(A.nodesRef.current,We).find(ve=>{var Se,oe;return ii((Se=ve.context)==null?void 0:Se.elements.floating,Ee)||ii((oe=ve.context)==null?void 0:oe.elements.domReference,Ee)})||gJ(A.nodesRef.current,We).find(ve=>{var Se,oe,$e;return[(Se=ve.context)==null?void 0:Se.elements.floating,mJ((oe=ve.context)==null?void 0:oe.elements.floating)].includes(Ee)||(($e=ve.context)==null?void 0:$e.elements.domReference)===Ee})));if(xe===y&&W&&PJ(W),o&&xe!==y&&!n_e(Ne)&&Tc(Y)===Y.body){if(Js(W)&&(W.focus(),o==="popup")){ee.request(()=>{W.focus()});return}const ve=X(),Se=_.current,oe=(Se&&ve.includes(Se)?Se:null)||ve[ve.length-1]||W;Js(oe)&&oe.focus()}if(O.current.insideReactTree){O.current.insideReactTree=!1;return}(C||!l)&&Ee&&ce&&!I.current&&(C||Ee!==IJ())&&(D.current=!0,b.setOpen(!1,fa(uC,ge)))})}function ye(){P.current||(O.current.insideReactTree=!0,Z.start(0,()=>{O.current.insideReactTree=!1}))}const de=Js(y)?y:null;if(!(!w&&!de))return bh(de&&Ri(de,"focusout",J),de&&Ri(de,"pointerdown",K),w&&Ri(w,"focusin",ie),w&&Ri(w,"focusout",J),w&&N&&Ri(w,"focusout",ye,!0))},[i,y,w,W,l,A,N,b,c,o,X,C,k,O,Z,z,ee,d,f,H]),p.useEffect(()=>{var xe,Ne,We;if(i||!w||!v)return;const Y=Array.from(((xe=N==null?void 0:N.portalNode)==null?void 0:xe.querySelectorAll(`[${lI("portal")}]`))||[]),ie=(We=(Ne=(A?gJ(A.nodesRef.current,k()):[]).find(Xe=>{var Re;return pJ(((Re=Xe.context)==null?void 0:Re.elements.domReference)||null)}))==null?void 0:Ne.context)==null?void 0:We.elements.domReference,ye=[...[w,...Y,M.current,V.current,N==null?void 0:N.beforeOutsideRef.current,N==null?void 0:N.afterOutsideRef.current,...H()],ie,rp(f),rp(d),C?y:null].filter(Xe=>Xe!=null),de=jJ(ye,{ariaHidden:l||C,mark:!1}),ge=[w,...Y].filter(Xe=>Xe!=null),Ee=jJ(ge);return()=>{Ee(),de()}},[v,i,y,w,l,N,C,A,k,d,f,H]),Jn(()=>{if(!v||i||!Js(W))return;L.current="",F.current="";const Y=kr(W),K=Tc(Y);queueMicrotask(()=>{const ie=E.current,J=typeof ie=="function"?ie(T.current||""):ie;if(J===void 0||J===!1||ii(W,K))return;let de=null;const ge=()=>(de==null&&(de=X(W)),de[0]||W);let Ee;J===!0||J===null?Ee=ge():Ee=rp(J),Ee=Ee||ge();const xe=ii(W,Tc(Y));$3(Ee,{preventScroll:Ee===W,shouldFocus(){if(!R.current)return!1;if(xe)return!0;const Ne=Tc(Y);return!(Ne!==Ee&&ii(W,Ne))}})})},[i,v,W,X,E,T,R]),Jn(()=>{if(i||!W)return;const Y=kr(W),K=Tc(Y),ie=T.current==null;RJ(K);function J(de){if(de.open||(L.current=mrt(de.nativeEvent,F.current)),de.reason===gu&&de.nativeEvent.type==="mouseleave"&&(D.current=!0),de.reason===A_e)if(de.nested)D.current=!1;else if(Wnt(de.nativeEvent)||t_e(de.nativeEvent))D.current=!1;else{let ge=!1;kr(W).createElement("div").focus({get preventScroll(){return ge=!0,!1}}),ge?D.current=!1:D.current=!0}}x.on("openchange",J);function ye(de){const ge=j.current;let Ee=typeof ge=="function"?ge(de):ge;if(Ee===void 0||Ee===!1)return null;Ee===null&&(Ee=!0);const xe=y!=null&&y.isConnected?y:null,Ne=K!=null&&K.isConnected&&ll(K)!=="body"?K:null;let We=ie?Ne||xe:xe||Ne;return We||(We=IJ()||null),typeof Ee=="boolean"?We:rp(Ee)||We||null}return()=>{x.off("openchange",J);const de=Tc(Y),ge=H(),Ee=ii(w,de)||ge.some(Xe=>Xe===de||ii(Xe,de))||A&&Zg(A.nodesRef.current,k(),!1).some(Xe=>{var Re;return ii((Re=Xe.context)==null?void 0:Re.elements.floating,de)}),xe=j.current,Ne=L.current,We=ye(Ne);queueMicrotask(()=>{const Xe=grt(We),Re=typeof xe!="boolean";if(xe&&!D.current&&Js(Xe)&&(!(!Re&&Xe!==de&&de!==Y.body)||Ee)){const se={preventScroll:!0};Ne==="keyboard"&&(se.focusVisible=!0),Xe.focus(se)}D.current=!1})}},[i,w,W,j,T,x,A,y,k,H]),Jn(()=>{if(!V1||v||!w)return;const Y=Tc(kr(w));!Js(Y)||!Gz(Y)||ii(w,Y)&&Y.blur()},[v,w]),Jn(()=>{if(!(i||!N))return N.setFocusManagerState({modal:l,closeOnFocusOut:c,open:v,onOpenChange:b.setOpen,domReference:y}),()=>{N.setFocusManagerState(null)}},[i,N,l,v,b,c,y]),Jn(()=>{if(!(i||!W))return PJ(W),()=>{queueMicrotask(oV)}},[i,W]);const ae=!i&&(l?!C:!0)&&(ne||l);return a.jsxs(p.Fragment,{children:[ae&&a.jsx(h0,{"data-type":"inside",ref:q,onFocus:Y=>{var K;if(l){const ie=X();$3(ie[ie.length-1])}else if(N!=null&&N.portalNode)if(D.current=!1,sw(Y,N.portalNode)){const ie=eV(y);ie==null||ie.focus()}else(K=rp(f??N.beforeOutsideRef))==null||K.focus()}}),n,ae&&a.jsx(h0,{"data-type":"inside",ref:U,onFocus:Y=>{var K;if(l)$3(X()[0]);else if(N!=null&&N.portalNode)if(c&&(D.current=!0),sw(Y,N.portalNode)){const ie=d_e(y);ie==null||ie.focus()}else(K=rp(d??N.afterOutsideRef))==null||K.focus()}})]})}function U_e(e,t={}){const{enabled:n=!0,event:i="click",toggle:r=!0,ignoreMouse:s=!1,stickIfOpen:o=!0,touchOpenDelay:l=0,reason:c=Zw}=t,u="rootStore"in e?e.rootStore:e,d=u.context.dataRef,f=p.useRef(void 0),h=Kz(),m=f0(),g=p.useMemo(()=>{function b(y,w,x,O){const k=fa(c,w,x);y&&O==="touch"&&l>0?m.start(l,()=>{u.setOpen(!0,k)}):u.setOpen(y,k)}function v(y,w,x){const O=d.current.openEvent,k=u.select("domReferenceElement")!==w;return y&&k||!y||!r?!0:O&&o?!x(O.type):!1}return{onPointerDown(y){f.current=rw(y.pointerType,!0)&&t_e(y.nativeEvent)?"virtual":y.pointerType},onMouseDown(y){const w=f.current,x=y.nativeEvent,O=u.select("open");if(y.button!==0||i==="click"||rw(w,!0)&&s)return;const k=v(O,y.currentTarget,E=>E==="click"||E==="mousedown"),S=uo(x);if(Gz(S)){b(k,x,S,w);return}const C=y.currentTarget;h.request(()=>{b(k,x,C,w)})},onClick(y){if(i==="mousedown-only")return;const w=f.current;if(i==="mousedown"&&w){f.current=void 0;return}if(rw(w,!0)&&s)return;const x=u.select("open"),O=v(x,y.currentTarget,k=>k==="click"||k==="mousedown"||k==="keydown"||k==="keyup");b(O,y.nativeEvent,y.currentTarget,w)},onKeyDown(){f.current=void 0}}},[d,i,s,c,u,o,r,h,m,l]);return p.useMemo(()=>n?{reference:g}:nc,[n,g])}function brt(){return!1}function yrt(e){return{escapeKey:typeof e=="boolean"?e:(e==null?void 0:e.escapeKey)??!1,outsidePress:typeof e=="boolean"?e:(e==null?void 0:e.outsidePress)??!0}}function Q_e(e,t={}){const{enabled:n=!0,escapeKey:i=!0,outsidePress:r=!0,outsidePressEvent:s="sloppy",referencePress:o=brt,bubbles:l,externalTree:c}=t,u="rootStore"in e?e.rootStore:e,d=u.useState("open"),f=u.useState("floatingElement"),{dataRef:h}=u.context,m=H1(c),g=ci(typeof r=="function"?r:()=>!1),b=typeof r=="function"?g:r,v=b!==!1,y=ci(()=>s),{escapeKey:w,outsidePress:x}=yrt(l),O=p.useRef(!1),k=p.useRef(!1),S=p.useRef(!1),C=p.useRef(!1),E=p.useRef(""),j=p.useRef(null),T=f0(),R=f0(),A=ci(()=>{R.clear(),h.current.insideReactTree=!1}),N=ci(q=>{var z;const U=(z=h.current.floatingContext)==null?void 0:z.nodeId;return(m?Zg(m.nodesRef.current,U):[]).some(ee=>{var ne;return((ne=ee.context)==null?void 0:ne.open)&&!ee.context.dataRef.current[q]})}),D=ci(q=>N3(q,u.select("floatingElement"))||N3(q,u.select("domReferenceElement"))),I=ci(q=>{o()&&u.setOpen(!1,fa(Zw,q.nativeEvent))}),P=ci(q=>{if(!d||!n||!i||q.key!=="Escape"||C.current||!w&&N("__escapeKeyBubbles"))return;const U=qnt(q)?q.nativeEvent:q,Z=fa(__e,U);u.setOpen(!1,Z),Z.isCanceled||q.preventDefault(),!w&&!Z.isPropagationAllowed&&q.stopPropagation()}),_=ci(()=>{h.current.insideReactTree=!0,R.start(0,A)}),L=ci(q=>{if(!d||!n||q.button!==0)return;const U=uo(q.nativeEvent);ii(u.select("floatingElement"),U)&&(O.current||(O.current=!0,k.current=!1))}),F=ci(q=>{!d||!n||(q.defaultPrevented||q.nativeEvent.defaultPrevented)&&O.current&&(k.current=!0)});p.useEffect(()=>{if(!d||!n)return A;h.current.__escapeKeyBubbles=w,h.current.__outsidePressBubbles=x;const q=new $u,U=new $u;function Z(){q.clear(),C.current=!0}function z(){q.start(V1?5:0,()=>{C.current=!1})}function ee(){S.current=!0,U.start(0,()=>{S.current=!1})}function ne(){O.current=!1,k.current=!1}function W(){const Re=E.current,se=Re==="pen"||!Re?"mouse":Re,ce=y(),ve=typeof ce=="function"?ce():ce;return typeof ve=="string"?ve:ve[se]}function X(Re){const se=W();return se==="intentional"&&Re.type!=="click"||se==="sloppy"&&Re.type==="click"}function H(Re){var ve;const se=(ve=h.current.floatingContext)==null?void 0:ve.nodeId,ce=m&&Zg(m.nodesRef.current,se).some(Se=>{var oe;return N3(Re,(oe=Se.context)==null?void 0:oe.elements.floating)});return D(Re)||ce}function ae(Re){if(X(Re)){Re.type!=="click"&&!D(Re)&&(U.clear(),S.current=!1),A();return}if(h.current.insideReactTree){A();return}const se=uo(Re),ce=`[${lI("inert")}]`,ve=Er(se)?se.getRootNode():null,Se=Array.from((Xw(ve)?ve:kr(u.select("floatingElement"))).querySelectorAll(ce)),oe=u.context.triggerElements;if(se&&(oe.hasElement(se)||oe.hasMatchingElement(Ue=>ii(Ue,se))))return;let $e=Er(se)?se:null;for(;$e&&!Pg($e);){const Ue=Yg($e);if(Pg(Ue)||!Er(Ue))break;$e=Ue}if(!(Se.length&&Er(se)&&!znt(se)&&!ii(se,u.select("floatingElement"))&&Se.every(Ue=>!ii($e,Ue)))){if(Js(se)&&!("touches"in Re)){const Ue=Pg(se),me=Lu(se),ke=/auto|scroll/,Ae=Ue||ke.test(me.overflowX),He=Ue||ke.test(me.overflowY),Qe=Ae&&se.clientWidth>0&&se.scrollWidth>se.clientWidth,jt=He&&se.clientHeight>0&&se.scrollHeight>se.clientHeight,Pt=me.direction==="rtl",Kt=jt&&(Pt?Re.offsetX<=se.offsetWidth-se.clientWidth:Re.offsetX>se.clientWidth),Ct=Qe&&Re.offsetY>se.clientHeight;if(Kt||Ct)return}if(!H(Re)){if(W()==="intentional"&&S.current){U.clear(),S.current=!1;return}typeof b=="function"&&!b(Re)||N("__outsidePressBubbles")||(u.setOpen(!1,fa(A_e,Re)),A())}}}function Y(Re){W()!=="sloppy"||Re.pointerType==="touch"||!u.select("open")||!n||D(Re)||ae(Re)}function K(Re){if(W()!=="sloppy"||!u.select("open")||!n||D(Re))return;const se=Re.touches[0];se&&(j.current={startTime:Date.now(),startX:se.clientX,startY:se.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},T.start(1e3,()=>{j.current&&(j.current.dismissOnTouchEnd=!1,j.current.dismissOnMouseDown=!1)}))}function ie(Re,se){const ce=uo(Re);if(!ce)return;const ve=Ri(ce,Re.type,()=>{se(Re),ve()})}function J(Re){E.current="touch",ie(Re,K)}function ye(Re){T.clear(),Re.type==="pointerdown"&&(E.current=Re.pointerType),!(Re.type==="mousedown"&&j.current&&!j.current.dismissOnMouseDown)&&ie(Re,se=>{se.type==="pointerdown"?Y(se):ae(se)})}function de(Re){if(!O.current)return;const se=k.current;if(ne(),W()==="intentional"){if(Re.type==="pointercancel"){se&&ee();return}if(!H(Re)){if(se){ee();return}typeof b=="function"&&!b(Re)||(U.clear(),S.current=!0,A())}}}function ge(Re){if(W()!=="sloppy"||!j.current||D(Re))return;const se=Re.touches[0];if(!se)return;const ce=Math.abs(se.clientX-j.current.startX),ve=Math.abs(se.clientY-j.current.startY),Se=Math.sqrt(ce*ce+ve*ve);Se>5&&(j.current.dismissOnTouchEnd=!0),Se>10&&(ae(Re),T.clear(),j.current=null)}function Ee(Re){ie(Re,ge)}function xe(Re){W()!=="sloppy"||!j.current||D(Re)||(j.current.dismissOnTouchEnd&&ae(Re),T.clear(),j.current=null)}function Ne(Re){ie(Re,xe)}const We=kr(f),Xe=bh(i&&bh(Ri(We,"keydown",P),Ri(We,"compositionstart",Z),Ri(We,"compositionend",z)),v&&bh(Ri(We,"click",ye,!0),Ri(We,"pointerdown",ye,!0),Ri(We,"pointerup",de,!0),Ri(We,"pointercancel",de,!0),Ri(We,"mousedown",ye,!0),Ri(We,"mouseup",de,!0),Ri(We,"touchstart",J,!0),Ri(We,"touchmove",Ee,!0),Ri(We,"touchend",Ne,!0)));return()=>{Xe(),q.clear(),U.clear(),ne(),S.current=!1,A()}},[h,f,i,v,b,d,n,w,x,P,A,y,N,D,m,u,T]);const M=p.useMemo(()=>({onKeyDown:P,onPointerDown:I,onClick:I}),[P,I]),V=p.useMemo(()=>({onKeyDown:P,onPointerDown:F,onMouseDown:F,onClickCapture:_,onMouseDownCapture(q){_(),L(q)},onPointerDownCapture(q){_(),L(q)},onMouseUpCapture:_,onTouchEndCapture:_,onTouchMoveCapture:_}),[P,_,L,F]);return p.useMemo(()=>n?{reference:M,floating:V,trigger:M}:{},[n,M,V])}function DJ(e,t,n){let{reference:i,floating:r}=e;const s=hd(t),o=WD(t),l=qD(o),c=wd(t),u=s==="y",d=i.x+i.width/2-r.width/2,f=i.y+i.height/2-r.height/2,h=i[l]/2-r[l]/2;let m;switch(c){case"top":m={x:d,y:i.y-r.height};break;case"bottom":m={x:d,y:i.y+i.height};break;case"right":m={x:i.x+i.width,y:f};break;case"left":m={x:i.x-r.width,y:f};break;default:m={x:i.x,y:i.y}}const g=pm(t);return g&&(m[o]+=h*(g==="end"?1:-1)*(n&&u?-1:1)),m}async function vrt(e,t){var n;t===void 0&&(t={});const{x:i,y:r,platform:s,rects:o,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=kh(t,e),g=Zz(m),v=l[h?f==="floating"?"reference":"floating":f],y=rI(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),w=f==="floating"?{x:i,y:r,width:o.floating.width,height:o.floating.height}:o.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),O=await(s.isElement==null?void 0:s.isElement(x))&&await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1},k=rI(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:x,strategy:c}):w);return{top:(y.top-k.top+g.top)/O.y,bottom:(k.bottom-y.bottom+g.bottom)/O.y,left:(y.left-k.left+g.left)/O.x,right:(k.right-y.right+g.right)/O.x}}const xrt=50,wrt=async(e,t,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:s=[],platform:o}=n,l=o.detectOverflow?o:{...o,detectOverflow:vrt},c=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:f}=DJ(u,i,c),h=i,m=0;const g={};for(let b=0;b({name:"arrow",options:e,async fn(t){const{x:n,y:i,placement:r,rects:s,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=kh(e,t)||{};if(u==null)return{};const f=Zz(d),h={x:n,y:i},m=WD(r),g=qD(m),b=await o.getDimensions(u),v=m==="y",y=v?"top":"left",w=v?"bottom":"right",x=v?"clientHeight":"clientWidth",O=s.reference[g]+s.reference[m]-h[m]-s.floating[g],k=h[m]-s.reference[m],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let C=S?S[x]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=l.floating[x]||s.floating[g]);const E=O/2-k/2,j=C/2-b[g]/2-1,T=Jg(f[y],j),R=Jg(f[w],j),A=C-b[g]-R,N=C/2-b[g]/2+E,D=Xz(T,N,A),I=!c.arrow&&pm(r)!=null&&N!==D&&s.reference[g]/2-(ND<=0)){var R,A;const D=(((R=s.flip)==null?void 0:R.index)||0)+1,I=C[D];if(I&&(!(f==="alignment"?w!==hd(I):!1)||T.every(L=>hd(L.placement)===w?L.overflows[0]>0:!0)))return{data:{index:D,overflows:T},reset:{placement:I}};let P=(A=T.filter(_=>_.overflows[0]<=0).sort((_,L)=>_.overflows[1]-L.overflows[1])[0])==null?void 0:A.placement;if(!P)switch(m){case"bestFit":{var N;const _=(N=T.filter(L=>{if(S){const F=hd(L.placement);return F===w||F==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(F=>F>0).reduce((F,M)=>F+M,0)]).sort((L,F)=>L[1]-F[1])[0])==null?void 0:N[0];_&&(P=_);break}case"initialPlacement":P=l;break}if(r!==P)return{reset:{placement:P}}}return{}}}};function MJ(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function LJ(e){return Gnt.some(t=>e[t]>=0)}const Srt=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:i}=t,{strategy:r="referenceHidden",...s}=kh(e,t);switch(r){case"referenceHidden":{const o=await i.detectOverflow(t,{...s,elementContext:"reference"}),l=MJ(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:LJ(l)}}}case"escaped":{const o=await i.detectOverflow(t,{...s,altBoundary:!0}),l=MJ(o,n.floating);return{data:{escapedOffsets:l,escaped:LJ(l)}}}default:return{}}}}},z_e=new Set(["left","top"]);async function Ert(e,t){const{placement:n,platform:i,elements:r}=e,s=await(i.isRTL==null?void 0:i.isRTL(r.floating)),o=wd(n),l=pm(n),c=hd(n)==="y",u=z_e.has(o)?-1:1,d=s&&c?-1:1,f=kh(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof g=="number"&&(m=l==="end"?g*-1:g),c?{x:m*d,y:h*u}:{x:h*u,y:m*d}}const Crt=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,i;const{x:r,y:s,placement:o,middlewareData:l}=t,c=await Ert(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(i=l.arrow)!=null&&i.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:{...c,placement:o}}}}},Art=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:i,placement:r,platform:s}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:c={fn:w=>{let{x,y:O}=w;return{x,y:O}}},...u}=kh(e,t),d={x:n,y:i},f=await s.detectOverflow(t,u),h=hd(r),m=Yz(h);let g=d[m],b=d[h];const v=(w,x)=>Xz(x+f[w==="y"?"top":"left"],x,x-f[w==="y"?"bottom":"right"]);o&&(g=v(m,g)),l&&(b=v(h,b));const y=c.fn({...t,[m]:g,[h]:b});return{...y,data:{x:y.x-n,y:y.y-i,enabled:{[m]:o,[h]:l}}}}}},Trt=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,i;const{x:r,y:s,placement:o,rects:l,middlewareData:c}=t,{offset:u=0,mainAxis:d=!0,crossAxis:f=!0}=kh(e,t),h={x:r,y:s},m=hd(o),g=Yz(m);let b=h[g],v=h[m];const y=kh(u,t),w=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:(n=y.mainAxis)!=null?n:0,crossAxis:(i=y.crossAxis)!=null?i:0};if(d){const k=g==="y"?"height":"width",S=l.reference[g]-l.floating[k]+w.mainAxis,C=l.reference[g]+l.reference[k]-w.mainAxis;bC&&(b=C)}if(f){var x,O;const k=g==="y"?"width":"height",S=z_e.has(wd(o)),C=l.reference[m]-l.floating[k]+(S&&((x=c.offset)==null?void 0:x[m])||0)+(S?0:w.crossAxis),E=l.reference[m]+l.reference[k]+(S?0:((O=c.offset)==null?void 0:O[m])||0)-(S?w.crossAxis:0);vE&&(v=E)}return{[g]:b,[m]:v}}}},_rt=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:i,platform:r,elements:s}=t,{apply:o=()=>{},...l}=kh(e,t),c=await r.detectOverflow(t,l),u=wd(n),d=pm(n),f=hd(n)==="y",{width:h,height:m}=i.floating;let g,b;u==="top"||u==="bottom"?(g=u,b=d===(await(r.isRTL==null?void 0:r.isRTL(s.floating))?"start":"end")?"left":"right"):(b=u,g=d==="end"?"top":"bottom");const v=m-c.top-c.bottom,y=h-c.left-c.right,w=Jg(m-c[g],v),x=Jg(h-c[b],y),O=t.middlewareData.shift,k=!O;let S=w,C=x;O!=null&&O.enabled.x&&(C=y),O!=null&&O.enabled.y&&(S=v),k&&!d&&(f?C=h-2*Pp(c.left,c.right):S=m-2*Pp(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});const E=await r.getDimensions(s.floating);return h!==E.width||m!==E.height?{reset:{rects:!0}}:{}}}};function V_e(e){const t=Lu(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const r=Js(e),s=r?e.offsetWidth:n,o=r?e.offsetHeight:i,l=nI(n)!==s||nI(i)!==o;return l&&(n=s,i=o),{width:n,height:i,$:l}}function lV(e){return Er(e)?e:e.contextElement}function aw(e){const t=lV(e);if(!Js(t))return Dp(1);const n=t.getBoundingClientRect(),{width:i,height:r,$:s}=V_e(t);let o=(s?nI(n.width):n.width)/i,l=(s?nI(n.height):n.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const jrt=Dp(0);function H_e(e){const t=ta(e);return!Wz()||!t.visualViewport?jrt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Nrt(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ta(e)}function p0(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=lV(e);let o=Dp(1);t&&(i?Er(i)&&(o=aw(i)):o=aw(e));const l=Nrt(s,n,i)?H_e(s):Dp(0);let c=(r.left+l.x)/o.x,u=(r.top+l.y)/o.y,d=r.width/o.x,f=r.height/o.y;if(s&&i){const h=ta(s),m=Er(i)?ta(i):i;let g=h,b=Z8(g);for(;b&&m!==g;){const v=aw(b),y=b.getBoundingClientRect(),w=Lu(b),x=y.left+(b.clientLeft+parseFloat(w.paddingLeft))*v.x,O=y.top+(b.clientTop+parseFloat(w.paddingTop))*v.y;c*=v.x,u*=v.y,d*=v.x,f*=v.y,c+=x,u+=O,g=ta(b),b=Z8(g)}}return rI({width:d,height:f,x:c,y:u})}function YD(e,t){const n=zD(e).scrollLeft;return t?t.left+n:p0(hm(e)).left+n}function q_e(e,t){const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-YD(e,n),r=n.top+t.scrollTop;return{x:i,y:r}}function Rrt(e){let{elements:t,rect:n,offsetParent:i,strategy:r}=e;const s=r==="fixed",o=hm(i),l=t?QD(t.floating):!1;if(i===o||l&&s)return n;let c={scrollLeft:0,scrollTop:0},u=Dp(1);const d=Dp(0),f=Js(i);if((f||!s)&&((ll(i)!=="body"||QA(o))&&(c=zD(i)),f)){const m=p0(i);u=aw(i),d.x=m.x+i.clientLeft,d.y=m.y+i.clientTop}const h=o&&!f&&!s?q_e(o,c):Dp(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+h.x,y:n.y*u.y-c.scrollTop*u.y+d.y+h.y}}function Irt(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Prt(e){const t=zD(e),n=e.ownerDocument.body,i=Pp(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=Pp(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-t.scrollLeft+YD(e);const o=-t.scrollTop;return Lu(n).direction==="rtl"&&(s+=Pp(e.clientWidth,n.clientWidth)-i),{width:i,height:r,x:s,y:o}}const Drt=25;function Mrt(e,t,n){n===void 0&&(n="viewport");const i=n==="layoutViewport",r=ta(e),s=hm(e),o=r.visualViewport;let l=s.clientWidth,c=s.clientHeight,u=0,d=0;if(o){const h=!Wz()||t==="fixed";i?h||(u=-o.offsetLeft,d=-o.offsetTop):(l=o.width,c=o.height,h&&(u=o.offsetLeft,d=o.offsetTop))}if(YD(s)<=0){const h=s.ownerDocument,m=h.body,g=getComputedStyle(m),b=h.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,v=Math.abs(s.clientWidth-m.clientWidth-b),y=getComputedStyle(s).scrollbarGutter==="stable both-edges"?v/2:v;y<=Drt&&(l-=y)}return{width:l,height:c,x:u,y:d}}function Lrt(e,t){const n=p0(e,!0,t==="fixed"),i=n.top+e.clientTop,r=n.left+e.clientLeft,s=aw(e),o=e.clientWidth*s.x,l=e.clientHeight*s.y,c=r*s.x,u=i*s.y;return{width:o,height:l,x:c,y:u}}function $J(e,t,n){let i;if(t==="viewport"||t==="layoutViewport")i=Mrt(e,n,t);else if(t==="document")i=Prt(hm(e));else if(Er(t))i=Lrt(t,n);else{const r=H_e(e);i={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return rI(i)}function $rt(e,t){const n=t.get(e);if(n)return n;let i=lC(e,[],!1).filter(l=>Er(l)&&ll(l)!=="body"),r=null;const s=Lu(e).position==="fixed";let o=s?Yg(e):e;for(;Er(o)&&!Pg(o);){const l=Lu(o),c=qz(o),u=r?r.position:s?"fixed":"";!c&&(u==="fixed"||u==="absolute"&&l.position==="static")?i=i.filter(f=>f!==o):r=l,o=Yg(o)}return t.set(e,i),i}function Frt(e){let{element:t,boundary:n,rootBoundary:i,strategy:r}=e;const o=[...n==="clippingAncestors"?QD(t)?[]:$rt(t,this._c):[].concat(n),i],l=$J(t,o[0],r);let c=l.top,u=l.right,d=l.bottom,f=l.left;for(let h=1;h{l(!1,1e-7)},1e3)}C=!1}try{i=new IntersectionObserver(E,{...S,root:s.ownerDocument})}catch{i=new IntersectionObserver(E,S)}i.observe(e)}const c=ta(e),u=()=>l(n);return c.addEventListener("resize",u),l(!0),()=>{c.removeEventListener("resize",u),o()}}function oB(e,t,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=i,u=lV(e),d=r||s?[...u?lC(u):[],...t?lC(t):[]]:[];d.forEach(y=>{r&&y.addEventListener("scroll",n),s&&y.addEventListener("resize",n)});const f=u&&l?Hrt(u,n,s):null;let h=-1,m=null;o&&(m=new ResizeObserver(y=>{let[w]=y;w&&w.target===u&&m&&t&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),n()}),u&&!c&&m.observe(u),t&&m.observe(t));let g,b=c?p0(e):null;c&&v();function v(){const y=p0(e);b&&!K_e(b,y)&&n(),b=y,g=requestAnimationFrame(v)}return n(),()=>{var y;d.forEach(w=>{r&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),f==null||f(),(y=m)==null||y.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const qrt=Crt,Wrt=Art,Krt=krt,Grt=_rt,Xrt=Srt,BJ=Ort,Yrt=Trt,Zrt=(e,t,n)=>{const i=new Map,r=n??{},s={...Vrt,...r.platform,_c:i};return wrt(e,t,{...r,platform:s})};var Jrt=typeof document<"u",est=function(){},mN=Jrt?p.useLayoutEffect:est;function cI(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,i,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(i=n;i--!==0;)if(!cI(e[i],t[i]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!{}.hasOwnProperty.call(t,r[i]))return!1;for(i=n;i--!==0;){const s=r[i];if(!(s==="_owner"&&e.$$typeof)&&!cI(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function G_e(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function UJ(e,t){const n=G_e(e);return Math.round(t*n)/n}function Q3(e){const t=p.useRef(e);return mN(()=>{t.current=e}),t}function X_e(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:i=[],platform:r,elements:{reference:s,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=p.useState(i);cI(h,i)||m(i);const[g,b]=p.useState(null),[v,y]=p.useState(null),w=p.useCallback(L=>{L!==S.current&&(S.current=L,b(L))},[]),x=p.useCallback(L=>{L!==C.current&&(C.current=L,y(L))},[]),O=s||g,k=o||v,S=p.useRef(null),C=p.useRef(null),E=p.useRef(d),j=c!=null,T=Q3(c),R=Q3(r),A=Q3(u),N=p.useCallback(()=>{if(!S.current||!C.current)return;const L={placement:t,strategy:n,middleware:h};R.current&&(L.platform=R.current),Zrt(S.current,C.current,L).then(F=>{const M={...F,isPositioned:A.current!==!1};D.current&&!cI(E.current,M)&&(E.current=M,yi.flushSync(()=>{f(M)}))})},[h,t,n,R,A]);mN(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(L=>({...L,isPositioned:!1})))},[u]);const D=p.useRef(!1);mN(()=>(D.current=!0,()=>{D.current=!1}),[]),mN(()=>{if(O&&(S.current=O),k&&(C.current=k),O&&k){if(T.current)return T.current(O,k,N);N()}},[O,k,N,T,j]);const I=p.useMemo(()=>({reference:S,floating:C,setReference:w,setFloating:x}),[w,x]),P=p.useMemo(()=>({reference:O,floating:k}),[O,k]),_=p.useMemo(()=>{const L={position:n,left:0,top:0};if(!P.floating)return L;const F=UJ(P.floating,d.x),M=UJ(P.floating,d.y);return l?{...L,transform:"translate("+F+"px, "+M+"px)",...G_e(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:M}},[n,l,P.floating,d.x,d.y]);return p.useMemo(()=>({...d,update:N,refs:I,elements:P,floatingStyles:_}),[d,N,I,P,_])}const tst=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:i,padding:r}=typeof e=="function"?e(n):e;return i&&t(i)?i.current!=null?BJ({element:i.current,padding:r}).fn(n):{}:i?BJ({element:i,padding:r}).fn(n):{}}}},Y_e=(e,t)=>{const n=qrt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Z_e=(e,t)=>{const n=Wrt(e);return{name:n.name,fn:n.fn,options:[e,t]}},J_e=(e,t)=>({fn:Yrt(e).fn,options:[e,t]}),eje=(e,t)=>{const n=Krt(e);return{name:n.name,fn:n.fn,options:[e,t]}},tje=(e,t)=>{const n=Grt(e);return{name:n.name,fn:n.fn,options:[e,t]}},nst=(e,t)=>{const n=Xrt(e);return{name:n.name,fn:n.fn,options:[e,t]}},ist=(e,t)=>{const n=tst(e);return{name:n.name,fn:n.fn,options:[e,t]}},rst={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId};class cV extends BD{constructor(n){const{syncOnly:i,nested:r,onOpenChange:s,triggerElements:o,...l}=n;super({...l,positionReference:l.referenceElement,domReferenceElement:l.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:L_e(),nested:r,triggerElements:o},rst);Zt(this,"syncOpenEvent",(n,i)=>{(!n||!this.state.open||i!=null&&Knt(i))&&(this.context.dataRef.current.openEvent=n?i:void 0)});Zt(this,"dispatchOpenChange",(n,i)=>{this.syncOpenEvent(n,i.event);const r={open:n,reason:i.reason,nativeEvent:i.event,nested:this.context.nested,triggerElement:i.trigger};this.context.events.emit("openchange",r)});Zt(this,"setOpen",(n,i)=>{var r,s,o,l;if(this.syncOnly){(s=(r=this.context).onOpenChange)==null||s.call(r,n,i);return}this.dispatchOpenChange(n,i),(l=(o=this.context).onOpenChange)==null||l.call(o,n,i)});this.syncOnly=i}}function sst(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:i,floatingId:r,nested:s,onOpenChange:o}=e,l=t.useState("open"),c=t.useState("activeTriggerElement"),u=t.useState(n?"popupElement":"positionerElement"),d=t.context.triggerElements,f=o,h=p.useRef(null);i===void 0&&h.current===null&&(h.current=new cV({open:l,transitionStatus:void 0,referenceElement:c,floatingElement:u,triggerElements:d,onOpenChange:f,floatingId:r,syncOnly:!0,nested:s}));const m=i??h.current;return t.useSyncedValue("floatingId",r),Jn(()=>{const g={open:l,floatingId:r,referenceElement:c,floatingElement:u};Er(c)&&(g.domReferenceElement=c),m.state.positionReference===m.state.referenceElement&&(g.positionReference=c),m.update(g)},[l,r,c,u,m]),m.context.onOpenChange=f,m.context.nested=s,m}function nje(e,t=!1,n=!1){const[i,r]=p.useState(e&&t?"idle":void 0),[s,o]=p.useState(e);return e&&!s&&(o(!0),r("starting")),!e&&s&&i!=="ending"&&!n&&r("ending"),!e&&!s&&i==="ending"&&r(void 0),Jn(()=>{if(!e&&s&&i!=="ending"&&n){const l=jc.request(()=>{r("ending")});return()=>{jc.cancel(l)}}},[e,s,i,n]),Jn(()=>{if(!e||t)return;const l=jc.request(()=>{r(void 0)});return()=>{jc.cancel(l)}},[t,e]),Jn(()=>{if(!e||!t)return;e&&s&&i!=="idle"&&r("starting");const l=jc.request(()=>{r("idle")});return()=>{jc.cancel(l)}},[t,e,s,i]),{mounted:s,setMounted:o,transitionStatus:i}}const ije={tabIndex:-1,[eB]:""};function rje(e){return t=>t==="touch"?e.current:!0}function sje(e,t=!1){const n=HA(),i=XD()!=null,r=Ad(()=>e(n,i)).current;return sst({popupStore:r,treatPopupAsFloatingElement:t,floatingRootContext:r.state.floatingRootContext,floatingId:n,nested:i,onOpenChange:r.setOpen}),r}function aje({handle:e,store:t}){return Jn(()=>e.attachStore(t),[e,t]),null}function ast(e,t){const n=p.useRef(null),i=p.useRef(null);return p.useCallback(r=>{if(e===void 0)return;let s=!1;if(n.current!==null){const o=n.current,l=i.current,c=t.context.triggerElements.getById(o);l&&c===l&&(t.context.triggerElements.delete(o),s=!0),n.current=null,i.current=null}if(r!==null&&(n.current=e,i.current=r,t.context.triggerElements.add(e,r),s=!0),s){const o=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==o&&t.set("triggerCount",o)}},[t,e])}function oje(e,t,n,i=!1){t?e.preventUnmountingOnClose=!1:i&&(e.preventUnmountingOnClose=!0);const r=(n==null?void 0:n.id)??null;(r||t)&&(e.activeTriggerId=r,e.activeTriggerElement=n??null)}function ost(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function lje(e,t,n,i){const r=n.useState("isMountedByTrigger",e),s=ast(e,n),o=ci(c=>{const u=n.select("open"),d=n.select("activeTriggerId");if(d===e){n.update({activeTriggerElement:c,...u?i:null});return}d==null&&u&&n.update({activeTriggerId:e,activeTriggerElement:c,...i})}),l=p.useCallback(c=>{s(c),c&&o(c)},[s,o]);return Jn(()=>{r&&n.update({activeTriggerElement:t.current,...i})},[r,n,t,...Object.values(i)]),{registerTrigger:l,isMountedByThisTrigger:r}}function cje(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,i=p.useRef(null),r=e.useState("open"),s=e.useState("triggerCount"),o=e.useState("activeTriggerId"),l=e.useState("activeTriggerElement");Jn(()=>{if(!r){i.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}const c=e.context.triggerElements.size,u={};e.state.triggerCount!==c&&(u.triggerCount=c);const d=e.select("activeTriggerId");let f=null;if(d){const h=e.context.triggerElements.getById(d);if(h)i.current=d,h!==e.state.activeTriggerElement&&(u.activeTriggerElement=h);else{for(const[m,g]of e.context.triggerElements.entries())if(g===e.state.activeTriggerElement){u.activeTriggerId=m,u.activeTriggerElement=g,i.current=m;break}u.activeTriggerId===void 0&&(i.current===d?f=d:i.current=null)}}else i.current=null;if(!f&&!d&&c===1){const h=e.context.triggerElements.entries().next();if(!h.done){const[m,g]=h.value;u.activeTriggerId=m,u.activeTriggerElement=g,i.current=m}}(u.triggerCount!==void 0||u.activeTriggerId!==void 0||u.activeTriggerElement!==void 0)&&e.update(u),f&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===f&&!e.context.triggerElements.getById(f)){const h=fa(C_e);e.setOpen(!1,h),h.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[r,e,s,o,l,n])}function uje(e,t,n){const{mounted:i,setMounted:r,transitionStatus:s}=nje(e),o=t.useState("preventUnmountingOnClose"),l=e?!1:o;t.useSyncedValues({mounted:i,transitionStatus:s,preventUnmountingOnClose:l});const c=ci(()=>{var u,d;r(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n==null||n(),(d=(u=t.context).onOpenChangeComplete)==null||d.call(u,!1)});return VA({enabled:i&&!e&&!l,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:s}}function dje(e,t){e.useSyncedValues(t),Jn(()=>()=>{e.update({activeTriggerProps:nc,inactiveTriggerProps:nc,popupProps:nc})},[e])}function fje(e,t){Jn(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),Jn(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class uV{constructor(){this.idMap=new Map}add(t,n){this.idMap.set(t,n)}delete(t){this.idMap.delete(t)}hasElement(t){for(const n of this.idMap.values())if(n===t)return!0;return!1}hasMatchingElement(t){for(const n of this.idMap.values())if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function lst(){return new cV({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new uV,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function hje(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:lst(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:nc,inactiveTriggerProps:nc,popupProps:nc}}function pje(e,t,n=!1){return new cV({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}const nE=e=>e.triggerIdProp??e.activeTriggerId,dV=e=>e.openProp??e.open,QJ=e=>{var n;return(((n=e.popupElement)==null?void 0:n.id)??e.floatingId)||void 0};function mje(e,t){return t!==void 0&&dV(e)&&nE(e)===t}function cst(e,t){return mje(e,t)?!0:t!==void 0&&dV(e)&&nE(e)==null&&e.triggerCount===1}const gje={open:dV,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:nE,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:QJ,isTriggerActive:(e,t)=>t!==void 0&&nE(e)===t,isOpenedByTrigger:(e,t)=>mje(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&nE(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>cst(e,t)?QJ(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function bje(e){const t=p.useCallback(i=>e===void 0?Uz:e.subscribeStore(i),[e]),n=p.useCallback(()=>e===void 0?void 0:e.store,[e]);return ZP.useSyncExternalStore(t,n,()=>e==null?void 0:e.serverStore)}function ust(e){return dst(e,e.rootContext)}function dst(e,t){const{nodeId:n,externalTree:i}=e,r=t.useState("referenceElement"),s=t.useState("floatingElement"),o=t.useState("domReferenceElement"),l=t.useState("open"),c=t.useState("floatingId"),[u,d]=p.useState(null),[f,h]=p.useState(void 0),[m,g]=p.useState(void 0),b=p.useRef(null),v=H1(i),y=p.useMemo(()=>({reference:r,floating:s,domReference:o}),[r,s,o]),w=X_e({...e,elements:{...y,...u&&{reference:u}}}),x=Er(f)?f:null,O=m===void 0?t.state.floatingElement:m;t.useSyncedValue("referenceElement",f??null),t.useSyncedValue("domReferenceElement",f===void 0?o:x),t.useSyncedValue("floatingElement",O);const k=p.useCallback(R=>{const A=Er(R)?{getBoundingClientRect:()=>R.getBoundingClientRect(),getClientRects:()=>R.getClientRects(),contextElement:R}:R;d(A),w.refs.setReference(A)},[w.refs]),S=p.useCallback(R=>{(Er(R)||R===null)&&(b.current=R,h(R)),(Er(w.refs.reference.current)||w.refs.reference.current===null||R!==null&&!Er(R))&&w.refs.setReference(R)},[w.refs,h]),C=p.useCallback(R=>{g(R),w.refs.setFloating(R)},[w.refs]),E=p.useMemo(()=>({...w.refs,setReference:S,setFloating:C,setPositionReference:k,domReference:b}),[w.refs,S,C,k]),j=p.useMemo(()=>({...w.elements,domReference:o}),[w.elements,o]),T=p.useMemo(()=>({...w,dataRef:t.context.dataRef,open:l,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:E,elements:j,nodeId:n,rootStore:t}),[w,E,j,n,t,l,c]);return Jn(()=>{o&&(b.current=o)},[o]),Jn(()=>{t.context.dataRef.current.floatingContext=T;const R=v==null?void 0:v.nodesRef.current.find(A=>A.id===n);R&&(R.context=T)}),p.useMemo(()=>({...w,context:T,refs:E,elements:j,rootStore:t}),[w,E,j,T,t])}class fV{constructor(){Zt(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});Zt(this,"disposeEffect",()=>this.dispose);this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new $u,this.restTimeout=new $u,this.handleCloseOptions=void 0}static create(){return new fV}}const uI=new WeakMap;function dI(e){var n,i,r;if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&uI.get(t)===e&&((n=e.pointerEventsScopeElement)==null||n.style.removeProperty("pointer-events"),(i=e.pointerEventsReferenceElement)==null||i.style.removeProperty("pointer-events"),(r=e.pointerEventsFloatingElement)==null||r.style.removeProperty("pointer-events"),uI.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function yje(e,t){const{scopeElement:n,referenceElement:i,floatingElement:r}=t,s=uI.get(n);s&&s!==e&&dI(s),dI(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=i,e.pointerEventsFloatingElement=r,uI.set(n,e),n.style.pointerEvents="none",i.style.pointerEvents="auto",r.style.pointerEvents="auto"}function vje(e){const t=e.context.dataRef.current,n=Ad(()=>t.hoverInteractionState??fV.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=n),$D(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function fst(e,t={}){const{enabled:n=!0,closeDelay:i=0,nodeId:r}=t,s="rootStore"in e?e.rootStore:e,o=s.useState("open"),l=s.useState("floatingElement"),c=s.useState("domReferenceElement"),{dataRef:u}=s.context,d=H1(),f=XD(),h=vje(s),m=f0(),g=ci(()=>{var y;return D_e((y=u.current.openEvent)==null?void 0:y.type,h.interactedInside)}),b=ci(()=>{var y;return lrt((y=u.current.openEvent)==null?void 0:y.type)}),v=ci(()=>{dI(h)});Jn(()=>{o||(h.pointerType=void 0,h.restTimeoutPending=!1,h.interactedInside=!1,v())},[o,h,v]),p.useEffect(()=>v,[v]),Jn(()=>{var y,w,x,O,k;if(n&&o&&(y=h.handleCloseOptions)!=null&&y.blockPointerEvents&&b()&&Er(c)&&l){const S=c,C=l,E=kr(l),j=(x=(w=d==null?void 0:d.nodesRef.current.find(N=>N.id===f))==null?void 0:w.context)==null?void 0:x.elements.floating;j&&(j.style.pointerEvents="");const T=h.pointerEventsScopeElement!==C?h.pointerEventsScopeElement:null,R=j!==C?j:null,A=((k=(O=h.handleCloseOptions)==null?void 0:O.getScope)==null?void 0:k.call(O))??T??R??S.closest("[data-rootownerid]")??E.body;return yje(h,{scopeElement:A,referenceElement:S,floatingElement:C}),()=>{v()}}},[n,o,c,l,h,b,d,f,v]),p.useEffect(()=>{if(!n)return;function y(){return!!(d&&f&&Zg(d.nodesRef.current,f).length>0)}function w(E){const j=sB(i,"close",h.pointerType),T=()=>{s.setOpen(!1,fa(gu,E)),d==null||d.events.emit("floating.closed",E)};j?h.openChangeTimeout.start(j,T):(h.openChangeTimeout.clear(),T())}function x(E){const j=uo(E);if(!Vnt(j)){h.interactedInside=!1;return}h.interactedInside=(j==null?void 0:j.closest("[aria-haspopup]"))!=null}function O(){h.openChangeTimeout.clear(),m.clear(),d==null||d.events.off("floating.closed",S),v()}function k(E){var A;if(y()&&d){d.events.on("floating.closed",S);return}if(e_e(E.relatedTarget,s.context.triggerElements))return;const j=((A=u.current.floatingContext)==null?void 0:A.nodeId)??r,T=E.relatedTarget;if(!(d&&j&&Er(T)&&Zg(d.nodesRef.current,j,!1).some(N=>{var D;return ii((D=N.context)==null?void 0:D.elements.floating,T)}))){if(h.handler){h.handler(E);return}v(),b()&&!g()&&w(E)}}function S(E){!d||!f||y()||m.start(0,()=>{d.events.off("floating.closed",S),s.setOpen(!1,fa(gu,E)),d.events.emit("floating.closed",E)})}const C=l;return bh(C&&Ri(C,"mouseenter",O),C&&Ri(C,"mouseleave",k),C&&Ri(C,"pointerdown",x,!0),()=>{d==null||d.events.off("floating.closed",S)})},[n,l,s,u,i,r,b,g,v,h,d,f,m])}const hst={current:null};function pst(e,t={}){var P;const{enabled:n=!0,delay:i=0,handleClose:r=null,mouseOnly:s=!1,restMs:o=0,move:l=!0,triggerElementRef:c=hst,externalTree:u,isActiveTrigger:d=!0,getHandleCloseContext:f,isClosing:h,shouldOpen:m,guardStaleOpen:g=!1}=t,b="rootStore"in e?e.rootStore:e,{dataRef:v,events:y}=b.context,w=H1(u),x=vje(b),O=p.useRef(!1),k=Zl(r),S=Zl(i),C=Zl(o),E=Zl(n),j=Zl(m),T=Zl(h),R=ci(()=>{var _;return D_e((_=v.current.openEvent)==null?void 0:_.type,x.interactedInside)}),A=ci(()=>{var _;return((_=j.current)==null?void 0:_.call(j))!==!1}),N=ci((_,L,F)=>{const M=b.context.triggerElements;if(M.hasElement(L))return!_||!ii(_,L);if(!Er(F))return!1;const V=F;return M.hasMatchingElement(q=>ii(q,V))&&(!_||!ii(_,V))}),D=ci(()=>{if(!x.handler)return;kr(b.select("domReferenceElement")).removeEventListener("mousemove",x.handler),x.handler=void 0}),I=ci(()=>{dI(x)});return d&&(x.handleCloseOptions=(P=k.current)==null?void 0:P.__options),p.useEffect(()=>D,[D]),p.useEffect(()=>{if(!n)return;function _(L){L.open?O.current=!1:(O.current=L.reason===gu,D(),x.openChangeTimeout.clear(),x.restTimeout.clear(),x.blockMouseMove=!0,x.restTimeoutPending=!1)}return y.on("openchange",_),()=>{y.off("openchange",_)}},[n,y,x,D]),p.useEffect(()=>{if(!n)return;function _(U,Z=!0){const z=sB(S.current,"close",x.pointerType);z?x.openChangeTimeout.start(z,()=>{b.setOpen(!1,fa(gu,U)),w==null||w.events.emit("floating.closed",U)}):Z&&(x.openChangeTimeout.clear(),b.setOpen(!1,fa(gu,U)),w==null||w.events.emit("floating.closed",U))}const L=c.current??(d?b.select("domReferenceElement"):null);if(!Er(L))return;function F(U){var ge;if(x.openChangeTimeout.clear(),x.blockMouseMove=!1,s&&!rw(x.pointerType))return;const Z=EJ(C.current),z=sB(S.current,"open",x.pointerType),ee=uo(U),ne=U.currentTarget??null,W=b.select("domReferenceElement");let X=ne;if(Er(ee)&&!b.context.triggerElements.hasElement(ee)){for(const Ee of b.context.triggerElements.elements())if(ii(Ee,ee)){X=Ee;break}}Er(ne)&&Er(W)&&!b.context.triggerElements.hasElement(ne)&&ii(ne,W)&&(X=W);const H=X==null?!1:N(W,X,ee),ae=b.select("open"),Y=((ge=T.current)==null?void 0:ge.call(T))??b.select("transitionStatus")==="ending",K=!ae&&Y&&O.current,ie=!H&&Er(X)&&Er(W)&&ii(W,X)&&K,J=Z>0&&!z,ye=H&&(ae||K)||ie,de=!ae||H;if(ye){A()&&b.setOpen(!0,fa(gu,U,X));return}J||(z?x.openChangeTimeout.start(z,()=>{de&&A()&&b.setOpen(!0,fa(gu,U,X))}):de&&A()&&b.setOpen(!0,fa(gu,U,X)))}function M(U){if(R()){I();return}D();const Z=b.select("domReferenceElement"),z=kr(Z);x.restTimeout.clear(),x.restTimeoutPending=!1;const ee=v.current.floatingContext??(f==null?void 0:f());if(e_e(U.relatedTarget,b.context.triggerElements))return;if(k.current&&ee){b.select("open")||x.openChangeTimeout.clear();const W=c.current;x.handler=k.current({...ee,tree:w,x:U.clientX,y:U.clientY,onClose(){I(),D(),E.current&&!R()&&W===b.select("domReferenceElement")&&_(U,!0)}}),z.addEventListener("mousemove",x.handler),x.handler(U);return}(x.pointerType==="touch"?!ii(b.select("floatingElement"),U.relatedTarget):!0)&&_(U)}function V(U){ii(L,U.relatedTarget)||(x.openChangeTimeout.clear(),x.restTimeout.clear(),x.restTimeoutPending=!1)}const q=g?Ri(L,"mouseout",V):void 0;return l?bh(Ri(L,"mousemove",F,{once:!0}),Ri(L,"mouseenter",F),Ri(L,"mouseleave",M),q):bh(Ri(L,"mouseenter",F),Ri(L,"mouseleave",M),q)},[D,I,v,S,b,n,k,x,d,N,R,s,l,C,c,w,E,f,T,A,g]),p.useMemo(()=>{if(!n)return;function _(L){x.pointerType=L.pointerType}return{onPointerDown:_,onPointerEnter:_,onMouseMove(L){var ee,ne,W;const{nativeEvent:F}=L,M=L.currentTarget,V=b.select("domReferenceElement"),q=b.select("open"),U=N(V,M,L.target);if(s&&!rw(x.pointerType))return;if(q&&U&&((ee=x.handleCloseOptions)!=null&&ee.blockPointerEvents)){const X=b.select("floatingElement");if(X){const H=((W=(ne=x.handleCloseOptions)==null?void 0:ne.getScope)==null?void 0:W.call(ne))??M.ownerDocument.body;yje(x,{scopeElement:H,referenceElement:M,floatingElement:X})}}const Z=EJ(C.current);if(q&&!U||Z===0||!U&&x.restTimeoutPending&&L.movementX**2+L.movementY**2<2)return;x.restTimeout.clear();function z(){if(x.restTimeoutPending=!1,R())return;const X=b.select("open");!x.blockMouseMove&&(!X||U)&&A()&&b.setOpen(!0,fa(gu,F,M))}x.pointerType==="touch"?yi.flushSync(()=>{z()}):U&&q?z():(x.restTimeoutPending=!0,x.restTimeout.start(Z,z))}}},[n,x,R,N,s,b,C,A])}const zJ=.1,mst=zJ*zJ,Hr=.5;function i_(e,t,n,i,r,s){return i>=t!=s>=t&&e<=(r-n)*(t-i)/(s-i)+n}function r_(e,t,n,i,r,s,o,l,c,u){let d=!1;return i_(e,t,n,i,r,s)&&(d=!d),i_(e,t,r,s,o,l)&&(d=!d),i_(e,t,o,l,c,u)&&(d=!d),i_(e,t,c,u,n,i)&&(d=!d),d}function gst(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function s_(e,t,n,i,r,s){const o=Math.min(n,r),l=Math.max(n,r),c=Math.min(i,s),u=Math.max(i,s);return e>=o&&e<=l&&t>=c&&t<=u}function bst(e={}){const{blockPointerEvents:t=!1}=e,n=new $u,i=({x:r,y:s,placement:o,elements:l,onClose:c,nodeId:u,tree:d})=>{const f=o==null?void 0:o.split("-")[0];let h=!1,m=null,g=null,b=typeof performance<"u"?performance.now():0;function v(w,x){const O=performance.now(),k=O-b;if(m===null||g===null||k===0)return m=w,g=x,b=O,!1;const S=w-m,C=x-g,E=S*S+C*C,j=k*k*mst;return m=w,g=x,b=O,E0)}function N(){A()||y()}if(A())return;const D=O.getBoundingClientRect(),I=k.getBoundingClientRect(),P=r>I.right-I.width/2,_=s>I.bottom-I.height/2,L=I.width>D.width,F=I.height>D.height,M=(L?D:I).left,V=(L?D:I).right,q=(F?D:I).top,U=(F?D:I).bottom;if(f==="top"&&s>=D.bottom-1||f==="bottom"&&s<=D.top+1||f==="left"&&r>=D.right-1||f==="right"&&r<=D.left+1){N();return}let Z=!1;switch(f){case"top":Z=s_(S,C,M,D.top+1,V,I.bottom-1);break;case"bottom":Z=s_(S,C,M,I.top+1,V,D.bottom-1);break;case"left":Z=s_(S,C,I.right-1,U,D.left+1,q);break;case"right":Z=s_(S,C,D.right-1,U,I.left+1,q);break}if(Z)return;if(h&&!gst(S,C,D)){N();return}if(!j&&v(S,C)){N();return}let z=!1;switch(f){case"top":{const ee=L?Hr/2:Hr*4,ne=L||P?r+ee:r-ee,W=L?r-ee:P?r+ee:r-ee,X=s+Hr+1,H=P||L?I.bottom-Hr:I.top,ae=P?L?I.bottom-Hr:I.top:I.bottom-Hr;z=r_(S,C,ne,X,W,X,I.left,H,I.right,ae);break}case"bottom":{const ee=L?Hr/2:Hr*4,ne=L||P?r+ee:r-ee,W=L?r-ee:P?r+ee:r-ee,X=s-Hr,H=P||L?I.top+Hr:I.bottom,ae=P?L?I.top+Hr:I.bottom:I.top+Hr;z=r_(S,C,ne,X,W,X,I.left,H,I.right,ae);break}case"left":{const ee=F?Hr/2:Hr*4,ne=F||_?s+ee:s-ee,W=F?s-ee:_?s+ee:s-ee,X=r+Hr+1,H=_||F?I.right-Hr:I.left,ae=_?F?I.right-Hr:I.left:I.right-Hr;z=r_(S,C,H,I.top,ae,I.bottom,X,ne,X,W);break}case"right":{const ee=F?Hr/2:Hr*4,ne=F||_?s+ee:s-ee,W=F?s-ee:_?s+ee:s-ee,X=r-Hr,H=_||F?I.left+Hr:I.right,ae=_?F?I.left+Hr:I.right:I.left+Hr;z=r_(S,C,X,ne,X,W,H,I.top,ae,I.bottom);break}}z?h||n.start(40,N):N()}};return i.__options={...e,blockPointerEvents:t},i}const yst=p.createContext(void 0);function vst(){const e=p.useContext(yst);return(e==null?void 0:e.direction)??"ltr"}const xst=e=>({name:"arrow",options:e,async fn(t){var F,M;const{x:n,y:i,placement:r,rects:s,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:d=0,offsetParent:f="real"}=kh(e,t)||{};if(u==null)return{};const h=Zz(d),m={x:n,y:i},g=WD(r),b=qD(g),v=await o.getDimensions(u),y=g==="y",w=y?"top":"left",x=y?"bottom":"right",O=y?"clientHeight":"clientWidth",k=s.reference[b]+s.reference[g]-m[g]-s.floating[b],S=m[g]-s.reference[g],C=f==="real"?await((F=o.getOffsetParent)==null?void 0:F.call(o,u)):l.floating;let E=l.floating[O]||s.floating[b];(!E||!await((M=o.isElement)==null?void 0:M.call(o,C)))&&(E=l.floating[O]||s.floating[b]);const j=k/2-S/2,T=E/2-v[b]/2-1,R=Math.min(h[w],T),A=Math.min(h[x],T),N=R,D=E-v[b]-A,I=E/2-v[b]/2+j,P=Xz(N,I,D),_=!c.arrow&&pm(r)!=null&&I!==P&&s.reference[b]/2-(I({...xst(e),options:[e,t]}),Ost={name:"hide",async fn(e){const{width:t,height:n,x:i,y:r}=e.rects.reference,s=t===0&&n===0&&i===0&&r===0,o=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||s}}}},kst={sideX:"left",sideY:"top"},VJ="--available-width",HJ="--available-height";function xje(e,t,n){const i=e==="inline-start"||e==="inline-end";return{top:"top",right:i?n?"inline-start":"inline-end":"right",bottom:"bottom",left:i?n?"inline-end":"inline-start":"left"}[t]}function qJ(e,t,n){const{rects:i,placement:r}=e;return{side:xje(t,wd(r),n),align:pm(r)||"center",anchor:{width:i.reference.width,height:i.reference.height},positioner:{width:i.floating.width,height:i.floating.height}}}function Sst(e){return Est(e,ust)}function Est(e,t){var tt,mt;const{anchor:n,positionMethod:i="absolute",side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:l=0,collisionBoundary:c,collisionPadding:u=5,sticky:d=!1,arrowPadding:f=5,disableAnchorTracking:h=!1,inline:m,keepMounted:g=!1,floatingRootContext:b,mounted:v,collisionAvoidance:y,shift:w,nodeId:x,adaptiveOrigin:O,lazyFlip:k=!1,externalTree:S}=e,[C,E]=p.useState(null);!v&&C!==null&&E(null);const j=y.side||"flip",T=y.align||"flip",R=y.fallbackAxisSide||"end",A=(w==null?void 0:w.crossAxis)??!1,N=w==null?void 0:w.rootBoundary,D=typeof n=="function"?n:void 0,I=ci(D),P=D?I:n,_=Zl(n),L=Zl(v),M=vst()==="rtl",V=C||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":M?"left":"right","inline-start":M?"right":"left"}[r],q=o==="center"?V:`${V}-${o}`;let U=u;typeof U=="number"?U={top:U,right:U,bottom:U,left:U}:U&&(U={top:U.top||0,right:U.right||0,bottom:U.bottom||0,left:U.left||0});const Z=1,z=r==="bottom"?Z:0,ee=r==="top"?Z:0,ne=r==="right"?Z:0,W=r==="left"?Z:0,X={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:U},H=p.useRef(null),ae=Zl(s),Y=Zl(l),K=typeof s!="function"?s:0,ie=typeof l!="function"?l:0,J=[];m&&J.push(m),J.push(Y_e(_e=>{const Ot=qJ(_e,r,M),Nt=typeof ae.current=="function"?ae.current(Ot):ae.current,Yt=typeof Y.current=="function"?Y.current(Ot):Y.current;return{mainAxis:Nt,crossAxis:Yt,alignmentAxis:Yt}},[K,ie,M,r]));const ye=T==="none"&&j!=="shift",de=!ye&&(d||A||j==="shift"),ge=j==="none"?null:eje({...X,padding:{top:U.top+Z+z,right:U.right+Z+W,bottom:U.bottom+Z+ee,left:U.left+Z+ne},mainAxis:!A&&j==="flip",crossAxis:T==="flip"?"alignment":!1,fallbackAxisSideDirection:R}),Ee=ye?null:Z_e({...X,rootBoundary:N,mainAxis:T!=="none",crossAxis:de,limiter:d||A?void 0:J_e(_e=>{if(!H.current)return{};const{width:Ot,height:Nt}=H.current.getBoundingClientRect(),Yt=hd(wd(_e.placement)),xn=Yt==="y"?Ot:Nt,Ke=Yt==="y"?U.left+U.right:U.top+U.bottom;return{offset:xn/2+Ke/2}})},[X,d,A,N,U,T]);j==="shift"||T==="shift"||o==="center"?J.push(Ee,ge):J.push(ge,Ee),J.push(tje({...X,apply({elements:{floating:_e},availableWidth:Ot,availableHeight:Nt,rects:Yt}){if(!L.current)return;const xn=_e.style;xn.setProperty(VJ,`${Ot}px`),xn.setProperty(HJ,`${Nt}px`);const Ke=ta(_e).devicePixelRatio||1,{x:St,y:qe,width:nt,height:et}=Yt.reference,ft=(Math.round((St+nt)*Ke)-Math.round(St*Ke))/Ke,Et=(Math.round((qe+et)*Ke)-Math.round(qe*Ke))/Ke;xn.setProperty("--anchor-width",`${ft}px`),xn.setProperty("--anchor-height",`${Et}px`)}}),wst(_e=>({element:H.current||kr(_e.elements.floating).createElement("div"),padding:f,offsetParent:"floating"}),[f]),{name:"transformOrigin",fn(_e){var De,on,On;const{elements:Ot,middlewareData:Nt,placement:Yt,rects:xn,y:Ke}=_e,St=wd(Yt),qe=hd(St),nt=H.current,et=((De=Nt.arrow)==null?void 0:De.x)||0,ft=((on=Nt.arrow)==null?void 0:on.y)||0,Et=(nt==null?void 0:nt.clientWidth)||0,At=(nt==null?void 0:nt.clientHeight)||0,It=et+Et/2,Gt=ft+At/2,Ye=Math.abs(((On=Nt.shift)==null?void 0:On.y)||0),wt=xn.reference.height/2,vt=typeof s=="function"?s(qJ(_e,r,M)):s,tn=Ye>vt,Qt={top:`${It}px calc(100% + ${vt}px)`,bottom:`${It}px ${-vt}px`,left:`calc(100% + ${vt}px) ${Gt}px`,right:`${-vt}px ${Gt}px`}[St],un=`${It}px ${xn.reference.y+wt-Ke}px`;return Ot.floating.style.setProperty("--transform-origin",de&&qe==="y"&&tn?un:Qt),{}}},Ost,O),Jn(()=>{!v&&b&&b.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[v,b]);const xe=p.useMemo(()=>({elementResize:!h&&typeof ResizeObserver<"u",layoutShift:!h&&typeof IntersectionObserver<"u"}),[h]),{refs:Ne,elements:We,x:Xe,y:Re,middlewareData:se,update:ce,placement:ve,context:Se,isPositioned:oe,floatingStyles:$e}=t({rootContext:b,open:g?v:void 0,placement:q,middleware:J,strategy:i,whileElementsMounted:g?void 0:(..._e)=>oB(..._e,xe),nodeId:x,externalTree:S}),{sideX:Ue,sideY:me}=se.adaptiveOrigin||kst,ke=oe?i:"fixed",Ae=p.useMemo(()=>{let _e;return oe?O?_e={position:ke,[Ue]:Xe,[me]:Re}:_e={...$e,position:ke}:_e={position:ke,top:0,left:0},_e[VJ]="100vw",_e[HJ]="100vh",oe||(_e.opacity=0),_e},[O,ke,Ue,Xe,me,Re,$e,oe]),He=p.useRef(null);Jn(()=>{if(!v)return;const _e=_.current,Ot=typeof _e=="function"?_e():_e,Yt=(WJ(Ot)?Ot.current:Ot)||null||null;Yt!==He.current&&(Ne.setPositionReference(Yt),He.current=Yt)},[v,Ne,P,_]),p.useEffect(()=>{if(!v)return;const _e=_.current;typeof _e!="function"&&WJ(_e)&&_e.current!==He.current&&(Ne.setPositionReference(_e.current),He.current=_e.current)},[v,Ne,P,_]),p.useEffect(()=>{if(g&&v&&We.reference&&We.floating)return oB(We.reference,We.floating,ce,xe)},[g,v,We,ce,xe]);const Qe=wd(ve),jt=xje(r,Qe,M),Pt=pm(ve)||"center",Kt=!!((tt=se.hide)!=null&&tt.referenceHidden);Jn(()=>{k&&v&&oe&&Qe!==V&&E(Qe)},[k,v,oe,Qe,V]);const Ct=p.useMemo(()=>{var _e,Ot;return{position:"absolute",top:(_e=se.arrow)==null?void 0:_e.y,left:(Ot=se.arrow)==null?void 0:Ot.x}},[se.arrow]),xt=((mt=se.arrow)==null?void 0:mt.centerOffset)!==0;return p.useMemo(()=>({positionerStyles:Ae,arrowStyles:Ct,arrowRef:H,arrowUncentered:xt,side:jt,align:Pt,physicalSide:Qe,anchorHidden:Kt,refs:Ne,context:Se,isPositioned:oe,update:ce}),[Ae,Ct,H,xt,jt,Pt,Qe,Kt,Ne,Se,oe,ce])}function WJ(e){return e!=null&&"current"in e}(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=oI.startingStyle]="startingStyle",e[e.endingStyle=oI.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({});const Cst={"data-popup-open":""},Ast={"data-popup-open":"","data-pressed":""},Tst={"data-open":""},_st={"data-closed":""},jst={"data-anchor-hidden":""},wje={open(e){return e?Cst:null}},Nst={open(e){return e?Ast:null}},hV={open(e){return e?Tst:_st},anchorHidden(e){return e?jst:null}},Oje={...hV,...KD};function kje(e){return e==="starting"?Mit:nc}function Rst(e,t,{styles:n,transitionStatus:i,props:r,refs:s,hidden:o,inert:l=!1}){const c={...n};return l&&(c.pointerEvents="none"),Ra("div",e,{state:t,ref:s,props:[{role:"presentation",hidden:o,style:c},kje(i),r],stateAttributesMapping:hV})}function Sje(){const e=Qz(),t=e.useState("toasts");return p.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function vf({orientation:e="vertical",maxHeight:t,hideScrollbar:n=!1,fadeEdges:i=!1,contentClassName:r="",className:s="",style:o,children:l,hasMore:c=!1,onLoadMore:u,threshold:d=24,onScroll:f,ref:h,...m}){const[g,b]=p.useState(!1),[v,y]=p.useState(!1),[w,x]=p.useState({top:!1,bottom:!1}),O=p.useRef(null),k=p.useRef(null),S=i&&e!=="horizontal",C=!!u&&e!=="horizontal";p.useImperativeHandle(h,()=>O.current,[]),p.useEffect(()=>()=>{var T;(T=k.current)==null||T.abort()},[]);const E=p.useCallback(()=>{const T=O.current;if(!S||!T)return;const R=T.scrollHeight-T.clientHeight,A=R>1&&T.scrollTop>1,N=R>1&&R-T.scrollTop>1;x(D=>D.top===A&&D.bottom===N?D:{top:A,bottom:N})},[S]);p.useEffect(()=>{const T=O.current;if(!S||!T)return;const R=new ResizeObserver(E);R.observe(T);for(const A of T.children)R.observe(A);return E(),()=>R.disconnect()},[S,C,E]);async function j(){if(!u||!c||k.current)return;const T=new AbortController;k.current=T,b(!0),y(!1);try{await u(T.signal)}catch{T.signal.aborted||y(!0)}finally{T.signal.aborted||b(!1),k.current===T&&(k.current=null)}}return a.jsxs("div",{...m,ref:O,className:`studio-scroll-area ${s}`.trim(),"data-orientation":e,"data-hide-scrollbar":n||void 0,"data-fade-edges":S&&(w.top||w.bottom)||void 0,"data-fade-top":S&&w.top||void 0,"data-fade-bottom":S&&w.bottom||void 0,style:{maxHeight:t,...o},onScroll:T=>{f==null||f(T),E();const R=T.currentTarget;!T.defaultPrevented&&e!=="horizontal"&&!v&&R.scrollTop>0&&R.scrollHeight-R.clientHeight-R.scrollTop<=Math.max(0,d)&&j()},children:[a.jsx("div",{className:`studio-scroll-area__content ${r}`.trim(),"aria-busy":u?g:void 0,children:l}),u&&e!=="horizontal"&&a.jsx(a.Fragment,{children:a.jsxs("div",{className:"studio-scroll-area__footer",children:[g?a.jsx(d0,{size:24}):a.jsx("span",{role:"status","aria-live":"polite",children:v?"加载失败":c?"向下滚动加载更多":"已加载全部"}),!g&&c&&a.jsx("button",{type:"button",onClick:()=>void j(),children:v?"重试":"加载更多"})]})})]})}function Ist(){const{add:e,close:t}=Sje();return{add:p.useCallback(({id:i,title:r,description:s,variant:o="info",duration:l,action:c,closeLabel:u,onClose:d})=>e({id:i,title:r,description:s,timeout:l,priority:"low",onClose:d,data:{variant:o,action:c,closeLabel:u}}),[e]),dismiss:t}}function Pst({position:e,label:t}){const{toasts:n,close:i}=Sje();return a.jsx(srt,{children:a.jsx(Nit,{className:"studio-toast-viewport","data-position":e,"data-empty":n.length===0||void 0,"aria-label":t,render:a.jsx(vf,{contentClassName:"studio-toast-viewport__stack"}),children:n.map(r=>{var s,o,l;return a.jsx(Kit,{toast:r,className:"studio-toast-root",swipeDirection:[],children:a.jsx(ont,{role:"presentation",variant:(s=r.data)==null?void 0:s.variant,title:r.title!=null?a.jsx(Zit,{render:a.jsx("div",{}),children:r.title}):void 0,description:r.description!=null?a.jsx(Yit,{render:a.jsx("div",{}),children:r.description}):void 0,action:(o=r.data)==null?void 0:o.action,closeLabel:(l=r.data)==null?void 0:l.closeLabel,onDismiss:()=>i(r.id)})},r.id)})})})}function Dst({children:e,duration:t=4e3,position:n="top-center",label:i="通知"}){return a.jsxs(pit,{timeout:t,limit:3,children:[e,a.jsx(Pst,{position:n,label:i})]})}function Mst({ownerId:e,sessionId:t,onOpen:n,hideNotices:i,refreshKey:r,onUpdate:s}){const{t:o}=Te("sandbox"),l=Ist(),c=p.useRef(new Map),u=p.useRef(new Map),d=p.useRef(null),f=p.useRef({sessionId:t,onOpen:n,toast:l,t:o,hideNotices:i,onUpdate:s});return f.current={sessionId:t,onOpen:n,toast:l,t:o,hideNotices:i,onUpdate:s},p.useEffect(()=>{if(i){f.current.toast.dismiss(),u.current.clear();return}for(const h of c.current.values())h.sessionId===t&&(f.current.toast.dismiss(h.runId),u.current.delete(h.runId))},[t,i]),p.useEffect(()=>{var h;(h=d.current)==null||h.call(d)},[r]),p.useEffect(()=>{if(!e)return;const h=new AbortController,m=c.current,g=u.current,b=new Set;let v,y=!1,w=[],x="";const O=(C,E=x)=>{var j,T;x=E,h.signal.aborted||(T=(j=f.current).onUpdate)==null||T.call(j,{ownerId:e,runs:w,loading:C,error:E})},k=C=>{const{toast:E,t:j,sessionId:T,onOpen:R}=f.current;if(!h.signal.aborted){if(f.current.hideNotices||C.sessionId===T){E.dismiss(C.runId),g.delete(C.runId);return}b.has(C.runId)||g.get(C.runId)===C.state||(g.set(C.runId,C.state),E.add({id:C.runId,duration:0,title:j(`taskNotice.${C.state}`),description:C.message.slice(0,80),variant:C.state==="succeeded"?"success":C.state==="failed"?"error":"info",closeLabel:j("taskNotice.hide"),onClose:()=>b.add(C.runId),action:a.jsx(Ci,{variant:"secondary",onClick:()=>{R(C.sessionId,h.signal).catch(A=>{h.signal.aborted||E.add({id:"task-open-error",variant:"error",description:A instanceof Error?A.message:String(A)})})},children:j("taskNotice.open")})}))}},S=async(C=!1)=>{if(!(y||h.signal.aborted)){clearTimeout(v),y=!0,C&&O(!0);try{const E=await ef.active(h.signal);if(h.signal.aborted)return;w=E,O(!1,"");const j=new Set(E.map(T=>T.runId));for(const T of m.values())if(!j.has(T.runId)&&!mu(T)){let R;try{R=await ef.get(T.runId,h.signal)}catch(A){if(A instanceof Gw&&A.status===404){m.delete(T.runId),g.delete(T.runId),f.current.toast.dismiss(T.runId);continue}throw A}if(h.signal.aborted)return;m.set(R.runId,R),k(R)}for(const T of E)m.set(T.runId,T),k(T);f.current.toast.dismiss("task-connection")}catch(E){if(h.signal.aborted)return;E instanceof Gw&&[401,403].includes(E.status)&&(w=[],m.clear(),g.clear(),f.current.toast.dismiss()),O(!1,E instanceof Error?E.message:f.current.t("taskNotice.reconnecting")),!h.signal.aborted&&m.size&&!f.current.hideNotices&&f.current.toast.add({id:"task-connection",duration:0,description:f.current.t("taskNotice.reconnecting")})}finally{y=!1,h.signal.aborted||(v=setTimeout(S,3e3))}}};return d.current=()=>{S(!0)},O(!0),S(),()=>{h.abort(),clearTimeout(v),d.current=null,f.current.toast.dismiss()}},[e]),null}function Lst(e){const{t}=Te("sandbox");return a.jsx(Dst,{position:"bottom-right",label:t("taskNotice.label"),children:a.jsx(Mst,{...e},e.ownerId)})}const dC=["super_admin","admin","developer","user"];class fC extends Error{constructor(t,n){super(t),this.code=t,this.status=n}}async function Eje(e){let t;try{t=await e.json()}catch{throw new fC("invalid_response",e.status)}if(!e.ok){const n=t&&typeof t=="object"&&"code"in t&&typeof t.code=="string"?t.code:"request_failed";throw new fC(n,e.status)}return t}function Cje(e){return!e||typeof e!="object"?!1:"id"in e&&typeof e.id=="string"&&"name"in e&&typeof e.name=="string"&&"email"in e&&typeof e.email=="string"&&"role"in e&&dC.some(t=>t===e.role)&&"status"in e&&typeof e.status=="string"&&"lastLogin"in e&&typeof e.lastLogin=="string"&&"protected"in e&&typeof e.protected=="boolean"&&"currentUser"in e&&typeof e.currentUser=="boolean"&&"roleConflict"in e&&typeof e.roleConflict=="boolean"}async function $st(e){const t=new URLSearchParams({page:String(e.page),pageSize:"20",query:e.query});e.role&&t.set("role",e.role);const n=await Eje(await yn(`/web/users?${t}`,{signal:e.signal,cache:"no-store"}));if(!n||typeof n!="object"||!("items"in n)||!Array.isArray(n.items)||!n.items.every(Cje)||!("total"in n)||typeof n.total!="number"||!("poolTotal"in n)||typeof n.poolTotal!="number"||!("page"in n)||typeof n.page!="number"||!("pageSize"in n)||typeof n.pageSize!="number"||!("userPoolId"in n)||typeof n.userPoolId!="string"||!("clientId"in n)||typeof n.clientId!="string"||!("provider"in n)||!["volcengine","byteplus"].includes(String(n.provider)))throw new fC("invalid_response",502);return n}async function Fst(e,t,n){const i=await Eje(await yn(`/web/users/${encodeURIComponent(e.id)}/role`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({role:t,expectedRole:e.role}),signal:n}));if(!i||typeof i!="object"||!("user"in i)||!Cje(i.user))throw new fC("invalid_response",502);return i.user}function Bst(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m7 9.5 5 5 5-5"})})}function Ust(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m6.5 12.5 3.5 3.5 7.5-8"})})}function xf({ariaLabel:e,value:t,valueLabel:n,placeholder:i,options:r,disabled:s=!1,searchValue:o,searchPlaceholder:l,loading:c=!1,hasMore:u=!1,emptyMessage:d,onSearchChange:f,onLoadMore:h,onChange:m}){const{t:g}=Te("ui"),b=l??g("deploymentSelect.searchPlaceholder"),v=d??g("deploymentSelect.emptyMessage"),y=p.useId(),w=p.useRef(null),x=p.useRef(null),O=p.useRef(null),k=p.useRef(null),S=p.useRef([]),[C,E]=p.useState(!1),[j,T]=p.useState(0),R=r.find(L=>L.value===t),A=(R==null?void 0:R.label)??(t?n:void 0),N=o!==void 0&&!!f,D=()=>{E(!1),N&&o&&(f==null||f(""))};p.useEffect(()=>{if(!C)return;const L=F=>{F.target instanceof Node&&w.current&&!w.current.contains(F.target)&&D()};return window.addEventListener("pointerdown",L),()=>window.removeEventListener("pointerdown",L)},[C,f,o,N]),p.useEffect(()=>{var L,F;if(C){if(N){(L=O.current)==null||L.focus();return}(F=S.current[j])==null||F.focus()}},[C,N]),p.useEffect(()=>{var L;!C||N&&document.activeElement===O.current||(L=S.current[j])==null||L.focus()},[j,C,N]),p.useEffect(()=>{T(L=>Math.min(L,Math.max(0,r.length-1)))},[r.length]),p.useEffect(()=>{if(!C||!u||c||!h)return;const L=window.requestAnimationFrame(()=>{const F=k.current;F&&F.scrollHeight<=F.clientHeight+1&&h()});return()=>window.cancelAnimationFrame(L)},[u,c,h,C,r.length]);const I=(L=1)=>{const F=r.findIndex(V=>V.value===t),M=F>=0?F:L===1?0:Math.max(0,r.length-1);T(M),E(!0)},P=L=>{r.length!==0&&T((L+r.length)%r.length)},_=L=>{var F;m(L.value),D(),(F=x.current)==null||F.focus()};return a.jsxs("div",{className:"pp-deployment-select",ref:w,onKeyDown:L=>{var M,V;const F=L.target===O.current;if(L.key==="Escape"&&C){L.preventDefault(),D(),(M=x.current)==null||M.focus();return}if(L.key==="Tab"){D();return}if(F){L.key==="ArrowDown"&&r.length>0&&(L.preventDefault(),T(0),(V=S.current[0])==null||V.focus());return}L.key==="ArrowDown"?(L.preventDefault(),C?P(j+1):I(1)):L.key==="ArrowUp"?(L.preventDefault(),C?P(j-1):I(-1)):C&&L.key==="Home"?(L.preventDefault(),T(0)):C&&L.key==="End"&&(L.preventDefault(),T(Math.max(0,r.length-1)))},children:[a.jsxs("button",{ref:x,type:"button",className:"pp-deployment-select-trigger","aria-label":e,"aria-haspopup":"listbox","aria-expanded":C,"aria-controls":C?y:void 0,disabled:s,onClick:()=>{C?D():I()},children:[a.jsx("span",{className:A?void 0:"is-placeholder",children:A??i}),a.jsx(Bst,{className:`pp-deployment-select-chevron${C?" is-open":""}`})]}),C&&a.jsxs("div",{className:"pp-deployment-select-menu",children:[N&&a.jsx("div",{className:"pp-deployment-select-search",children:a.jsx("input",{ref:O,type:"search",value:o,"aria-label":g("deploymentSelect.searchAriaLabel",{label:e}),placeholder:b,autoComplete:"off",onChange:L=>f==null?void 0:f(L.currentTarget.value)})}),a.jsx("div",{id:y,ref:k,className:"pp-deployment-select-options",role:"listbox","aria-label":e,"aria-busy":c||void 0,onScroll:L=>{if(!u||c||!h)return;const F=L.currentTarget;F.scrollHeight-F.scrollTop-F.clientHeight<=24&&h()},children:r.map((L,F)=>{const M=L.value===t;return a.jsxs("button",{ref:V=>{S.current[F]=V},type:"button",role:"option","aria-selected":M,tabIndex:F===j?0:-1,className:`pp-deployment-select-option${M?" is-selected":""}`,title:L.metadata?[L.label,L.description,L.metadata].filter(Boolean).join(` +`):L.description,onFocus:()=>T(F),onClick:()=>_(L),children:[a.jsxs("span",{className:"pp-deployment-select-copy",children:[a.jsxs("span",{className:"pp-deployment-select-name",children:[L.label,L.badge&&a.jsx("span",{className:"pp-deployment-select-badge",children:L.badge})]}),L.description&&a.jsx("small",{className:L.metadata?"pp-deployment-select-description":void 0,children:L.description}),L.metadata&&a.jsx("small",{className:"pp-deployment-select-metadata",children:L.metadata})]}),M&&a.jsx(Ust,{})]},L.value)})}),c&&a.jsx("div",{className:"pp-deployment-select-state","aria-live":"polite",children:g("deploymentSelect.loadingMore")}),!c&&r.length===0&&a.jsx("div",{className:"pp-deployment-select-state",children:v})]})]})}function ZD({label:e,onClick:t}){return a.jsx("button",{type:"button",className:"page-back-button","aria-label":e,title:e,onClick:t,children:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m14.5 6-6 6 6 6"})})})}function cn({as:e="span",className:t="",duration:n=4,spread:i=20,children:r,style:s,...o}){const l=Math.min(Math.max(i,5),45);return a.jsx(e,{className:`text-shimmer${t?` ${t}`:""}`,style:{...s,backgroundImage:`linear-gradient(to right, hsl(var(--muted-foreground)) ${50-l}%, hsl(var(--foreground)) 50%, hsl(var(--muted-foreground)) ${50+l}%)`,animationDuration:`${n}s`},...o,children:r})}function Qst(){return a.jsx("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M16 7a6.5 6.5 0 1 0 .2 5M16 3.5V7h-3.5"})})}function Aje(e){return e instanceof fC?e.code:"request_failed"}function zst({user:e,onClose:t,onSaved:n}){const{t:i,i18n:r}=Te("users"),s=p.useRef(null),o=p.useRef(null),l=p.useId(),c=p.useId(),[u,d]=p.useState(e.role),[f,h]=p.useState(!1),[m,g]=p.useState("");p.useEffect(()=>{const v=s.current,y=document.activeElement;return v==null||v.showModal(),()=>{var w;(w=o.current)==null||w.abort(),v==null||v.close(),y instanceof HTMLElement&&y.isConnected&&y.focus()}},[]);const b=async()=>{if(f||u===e.role&&!e.roleConflict)return;const v=new AbortController;o.current=v,h(!0),g("");try{const y=await Fst(e,u,v.signal);v.signal.aborted||n(y)}catch(y){v.signal.aborted||g(i(`errors.${Aje(y)}`,{defaultValue:i("errors.request_failed")}))}finally{v.signal.aborted||h(!1)}};return a.jsxs("dialog",{ref:s,className:"user-role-dialog","aria-labelledby":l,"aria-describedby":c,"aria-busy":f,onCancel:v=>{v.preventDefault(),f||t()},children:[a.jsxs("header",{children:[a.jsx("h2",{id:l,children:i("changeRole")}),a.jsx("button",{type:"button",className:"users-close",onClick:t,disabled:f,"aria-label":i("close"),children:a.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:a.jsx("path",{d:"m5 5 10 10M15 5 5 15"})})})]}),a.jsxs("div",{className:"user-role-dialog-body",children:[a.jsxs("div",{className:"users-account",children:[a.jsx("strong",{children:e.name}),a.jsx("span",{children:e.email||e.id})]}),a.jsx("label",{className:"users-field-label",children:i("role")}),a.jsx(xf,{ariaLabel:i("role"),placeholder:i("role"),value:u,disabled:f,options:dC.map(v=>({value:v,label:i(`roles.${v}`),description:i(`descriptions.${v}`)})),onChange:v=>{const y=dC.find(w=>w===v);y&&d(y)}},r.resolvedLanguage),a.jsx("p",{id:c,className:"users-help",children:i("effectiveAfterRefresh")}),m?a.jsx("p",{className:"users-error",role:"alert",children:m}):null]}),a.jsxs("footer",{children:[a.jsx("button",{className:"users-button",type:"button",disabled:f,onClick:t,children:i("cancel")}),a.jsx("button",{className:"users-button is-primary",type:"button",disabled:f||u===e.role&&!e.roleConflict,onClick:()=>void b(),children:i(f?"saving":"save")})]})]})}function Vst({onBack:e}){const{t,i18n:n}=Te("users"),[i,r]=p.useState(null),[s,o]=p.useState(!0),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(""),[m,g]=p.useState(""),[b,v]=p.useState(1),[y,w]=p.useState(0),[x,O]=p.useState(null),[k,S]=p.useState(null),[C,E]=p.useState(null);p.useEffect(()=>{const A=new AbortController;return o(!0),c(""),$st({page:b,query:f,role:m,signal:A.signal}).then(N=>{if(!A.signal.aborted){if(N.total>0&&N.items.length===0&&b>1){v(1);return}r(N),E(new Date)}}).catch(N=>{A.signal.aborted||c(Aje(N))}).finally(()=>{A.signal.aborted||o(!1)}),()=>A.abort()},[b,f,m,y]);const j=A=>{A.preventDefault(),h(u.trim()),v(1),w(N=>N+1)},T=A=>{if(!A)return t("neverLoggedIn");const N=Number(A),D=new Date(Number.isFinite(N)&&N>0?N<1e12?N*1e3:N:A);return Number.isNaN(D.getTime())?t("unknown"):D.toLocaleString(n.resolvedLanguage,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1})},R=Math.max(1,Math.ceil(((i==null?void 0:i.total)??0)/20));return a.jsxs("section",{className:"users-page","aria-labelledby":"users-title",children:[a.jsxs("header",{className:"users-page-header",children:[a.jsx(ZD,{label:t("back"),onClick:e}),a.jsx("h1",{id:"users-title",children:t("title")}),i?a.jsx("span",{className:"users-count",children:t("memberCount",{count:i.poolTotal})}):null]}),a.jsxs("div",{className:"users-content",children:[i?a.jsxs("div",{className:"users-pool",children:[a.jsx("span",{children:i.provider==="byteplus"?"BytePlus Identity":t("volcengineIdentity")}),a.jsxs("span",{className:"users-pool-id",title:i.userPoolId,children:[t("pool")," ",i.userPoolId]})]}):null,a.jsxs("div",{className:"users-toolbar",children:[a.jsxs("form",{className:"users-search",onSubmit:j,children:[a.jsx("input",{value:u,onChange:A=>d(A.target.value),onKeyDown:A=>{A.key==="Enter"&&(A.nativeEvent.isComposing||A.keyCode===229)&&A.preventDefault()},"aria-label":t("searchPlaceholder"),placeholder:t("searchPlaceholder"),maxLength:200}),a.jsx("button",{type:"submit",className:"users-button",disabled:s,children:t("search")})]}),a.jsx("div",{className:"users-role-filter",children:a.jsx(xf,{ariaLabel:t("filterRole"),placeholder:t("allRoles"),value:m,options:[{value:"",label:t("allRoles")},...dC.map(A=>({value:A,label:t(`roles.${A}`)}))],onChange:A=>{const N=dC.find(D=>D===A);g(N??""),v(1)}})}),a.jsxs("button",{type:"button",className:"users-button users-refresh",disabled:s,onClick:()=>{S(null),w(A=>A+1)},children:[a.jsx(Qst,{}),a.jsx("span",{children:t("refresh")})]})]}),a.jsx("div",{className:"users-feedback","aria-live":"polite",children:s?a.jsx(cn,{children:t("loading")}):k?a.jsx("span",{children:t("saved",{name:k.name,role:t(`roles.${k.role}`)})}):C?a.jsx("span",{children:t("updatedAt",{time:C.toLocaleTimeString(n.resolvedLanguage,{hour:"2-digit",minute:"2-digit",hour12:!1})})}):null}),l?a.jsxs("div",{className:"users-error users-error-banner",role:"alert",children:[a.jsx("span",{children:t(`errors.${l}`,{defaultValue:t("errors.request_failed")})}),a.jsx("button",{type:"button",className:"users-button",onClick:()=>w(A=>A+1),children:t("retry")})]}):null,a.jsxs("div",{className:"users-table-wrap","aria-busy":s,children:[a.jsxs("table",{className:"users-table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:t("user")}),a.jsx("th",{scope:"col",children:t("role")}),a.jsx("th",{scope:"col",children:t("status")}),a.jsx("th",{scope:"col",children:t("lastLogin")}),a.jsx("th",{scope:"col",children:a.jsx("span",{className:"sr-only",children:t("actions")})})]})}),a.jsx("tbody",{children:i==null?void 0:i.items.map(A=>{var N;return a.jsxs("tr",{children:[a.jsx("td",{"data-label":t("user"),children:a.jsxs("div",{className:"users-person",children:[a.jsx("span",{className:"users-avatar","aria-hidden":"true",children:(N=Array.from(A.name)[0])==null?void 0:N.toUpperCase()}),a.jsxs("div",{className:"users-account",children:[a.jsxs("strong",{children:[A.name,A.currentUser?a.jsx("span",{className:"users-self",children:t("you")}):null]}),a.jsx("span",{title:A.email||A.id,children:A.email||A.id})]})]})}),a.jsxs("td",{"data-label":t("role"),children:[a.jsx("span",{className:`users-role-badge${A.role==="super_admin"?" is-super":""}`,children:t(`roles.${A.role}`)}),A.roleConflict?a.jsx("span",{className:"users-inline-warning",children:t("roleConflict")}):null]}),a.jsx("td",{"data-label":t("status"),children:a.jsx("span",{className:"users-status",children:t(`states.${A.status}`,{defaultValue:t("unknown")})})}),a.jsx("td",{"data-label":t("lastLogin"),className:"users-last-login",children:T(A.lastLogin)}),a.jsx("td",{className:"users-actions",children:A.protected?a.jsx("span",{className:"users-protected",title:t("protectedExplanation"),children:t("initialAdministrator")}):a.jsx("button",{type:"button",className:"users-button is-text",disabled:s||!!l||A.currentUser,onClick:()=>{S(null),O(A)},children:t("changeRole")})})]},A.id)})})]}),!s&&!l&&(i==null?void 0:i.items.length)===0?a.jsxs("div",{className:"users-empty",children:[a.jsx("strong",{children:t("noUsers")}),a.jsx("span",{children:t(f||m?"tryAnotherSearch":"poolEmpty")})]}):null,s&&!i?a.jsx("div",{className:"users-empty",children:a.jsx(cn,{children:t("loading")})}):null]}),i?a.jsxs("footer",{className:"users-pagination",children:[a.jsx("span",{children:t("resultCount",{count:i.total})}),a.jsxs("div",{children:[a.jsx("button",{type:"button",className:"users-button",disabled:b<=1||s,onClick:()=>v(A=>A-1),children:t("previous")}),a.jsxs("span",{children:[b," / ",R]}),a.jsx("button",{type:"button",className:"users-button",disabled:b>=R||s,onClick:()=>v(A=>A+1),children:t("next")})]})]}):null]}),x?a.jsx(zst,{user:x,onClose:()=>O(null),onSaved:A=>{O(null),S(A),w(N=>N+1)}}):null]})}const Tje=p.createContext(null);function Hst(e){if(!e||/[?#]/.test(e))return null;try{const t=decodeURIComponent(e);return!/^\/data\/(output|workspace)\/.+/.test(t)||t.endsWith("/")||/[\\\u0000-\u001f\u007f]/.test(t)||t.split("/").some(n=>n==="."||n==="..")?null:t}catch{return null}}function qst({appName:e,sessionId:t,path:n,children:i}){const{t:r}=Te("conversation"),s=p.useRef(null),[o,l]=p.useState(!1),[c,u]=p.useState(!1);p.useEffect(()=>(l(!1),u(!1),()=>{var f;(f=s.current)==null||f.abort(),s.current=null}),[e,t,n]);async function d(){if(s.current)return;const f=new AbortController;s.current=f,l(!0),u(!1);try{const h=await uTe(e,t,n,f.signal);if(f.signal.aborted)return;const m=URL.createObjectURL(h),g=document.createElement("a");try{g.href=m,g.download=n.slice(n.lastIndexOf("/")+1),document.body.appendChild(g),g.click()}finally{g.remove(),window.setTimeout(()=>URL.revokeObjectURL(m),0)}}catch{f.signal.aborted||u(!0)}finally{s.current===f&&(s.current=null,l(!1))}}return a.jsxs(a.Fragment,{children:[a.jsxs("a",{className:"sandbox-file-download",href:encodeURI(n),"aria-disabled":o,"aria-busy":o,onClick:f=>{f.preventDefault(),d()},children:[a.jsx("span",{"aria-hidden":"true",children:"↓"}),a.jsxs("span",{children:[r(o?"markdown.downloading":"markdown.downloadFile")," · ",i]})]}),c&&a.jsxs("span",{role:"alert",children:[" ",r("markdown.downloadFailed")]})]})}const Wst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M5.293 12.707a1 1 0 0 1 0-1.414l5-5a1 1 0 1 1 1.414 1.414L8.414 11H18a1 1 0 1 1 0 2H8.414l3.293 3.293a1 1 0 0 1-1.414 1.414l-5-5Z",clipRule:"evenodd"})}),Kst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M18.707 12.707a1 1 0 0 0 0-1.414l-5-5a1 1 0 1 0-1.414 1.414L15.586 11H6a1 1 0 1 0 0 2h9.586l-3.293 3.293a1 1 0 0 0 1.414 1.414l5-5Z",clipRule:"evenodd"})}),Gst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M4.47192 2.5C5.02421 2.5 5.47192 2.94772 5.47192 3.5V5.07196C7.17065 3.47759 9.45675 2.5 11.9719 2.5C17.2186 2.5 21.4719 6.75329 21.4719 12C21.4719 17.2467 17.2186 21.5 11.9719 21.5C7.10262 21.5 3.0902 17.8375 2.53692 13.1164C2.47264 12.5679 2.8652 12.0711 3.41373 12.0068C3.96226 11.9425 4.45904 12.3351 4.52333 12.8836C4.95991 16.6089 8.12901 19.5 11.9719 19.5C16.1141 19.5 19.4719 16.1421 19.4719 12C19.4719 7.85786 16.1141 4.5 11.9719 4.5C9.75153 4.5 7.75552 5.46469 6.38146 7H9.00003C9.55232 7 10 7.44772 10 8C10 8.55228 9.55232 9 9.00003 9H4.47192C3.93256 9 3.49293 8.57299 3.47265 8.03859C3.47175 8.01771 3.47151 7.99677 3.47192 7.9758V3.5C3.47192 2.94772 3.91964 2.5 4.47192 2.5Z",fill:"currentColor"})}),JD=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M2.55823 12C2.55823 6.75329 6.81152 2.5 12.0582 2.5C14.5734 2.5 16.8595 3.47759 18.5582 5.07197V3.5C18.5582 2.94772 19.0059 2.5 19.5582 2.5C20.1105 2.5 20.5582 2.94772 20.5582 3.5V7.97591C20.5586 7.99622 20.5584 8.01651 20.5576 8.03674C20.5382 8.572 20.0982 9 19.5582 9H15.0582C14.5059 9 14.0582 8.55228 14.0582 8C14.0582 7.44772 14.5059 7 15.0582 7H17.6487C16.2746 5.46469 14.2786 4.5 12.0582 4.5C7.91609 4.5 4.55823 7.85786 4.55823 12C4.55823 16.1421 7.91609 19.5 12.0582 19.5C15.9011 19.5 19.0702 16.6089 19.5068 12.8836C19.5711 12.3351 20.0679 11.9425 20.6164 12.0068C21.165 12.0711 21.5575 12.5679 21.4932 13.1164C20.94 17.8375 16.9275 21.5 12.0582 21.5C6.81152 21.5 2.55823 17.2467 2.55823 12Z",fill:"currentColor"})}),a_=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M16.243 6.757a1 1 0 0 1 1 1v7.072a1 1 0 0 1-2 0v-4.657L8.464 16.95a1 1 0 0 1-1.414-1.414l6.778-6.779H9.172a1 1 0 0 1 0-2h7.07Z",clipRule:"evenodd"})}),Xst=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.jsx("path",{d:"M10.663 6.3872C10.8152 6.29068 11 6.40984 11 6.59007V8C11 8.55229 11.4477 9 12 9C12.5523 9 13 8.55229 13 8V6.59007C13 6.40984 13.1848 6.29068 13.337 6.3872C14.036 6.83047 14.5 7.61105 14.5 8.5C14.5 9.53284 13.8737 10.4194 12.9801 10.8006C12.9932 10.865 13 10.9317 13 11V13C13 13.5523 12.5523 14 12 14C11.4477 14 11 13.5523 11 13V11C11 10.9317 11.0068 10.865 11.0199 10.8006C10.1263 10.4194 9.5 9.53284 9.5 8.5C9.5 7.61105 9.96397 6.83047 10.663 6.3872Z",fill:"currentColor"}),a.jsx("path",{d:"M17.9754 4.01031C17.8588 4.00078 17.6965 4.00001 17.4 4.00001H9.8C8.94342 4.00001 8.36113 4.00078 7.91104 4.03756C7.47262 4.07338 7.24842 4.1383 7.09202 4.21799C6.7157 4.40974 6.40973 4.7157 6.21799 5.09202C6.1383 5.24842 6.07337 5.47263 6.03755 5.91104C6.00078 6.36113 6 6.94343 6 7.80001V16.1707C6.31278 16.0602 6.64937 16 7 16H18L18 4.60001C18 4.30348 17.9992 4.14122 17.9897 4.02464C17.9893 4.02 17.9889 4.0156 17.9886 4.01145C17.9844 4.01107 17.98 4.01069 17.9754 4.01031ZM17.657 18H7C6.44772 18 6 18.4477 6 19C6 19.5523 6.44772 20 7 20H17.657C17.5343 19.3301 17.5343 18.6699 17.657 18ZM4 19L4 7.75871C3.99999 6.95374 3.99998 6.28937 4.04419 5.74818C4.09012 5.18608 4.18868 4.66938 4.43597 4.18404C4.81947 3.43139 5.43139 2.81947 6.18404 2.43598C6.66937 2.18869 7.18608 2.09012 7.74818 2.0442C8.28937 1.99998 8.95373 1.99999 9.7587 2L17.4319 2C17.6843 1.99997 17.9301 1.99994 18.1382 2.01695C18.3668 2.03563 18.6366 2.07969 18.908 2.21799C19.2843 2.40974 19.5903 2.7157 19.782 3.09203C19.9203 3.36345 19.9644 3.63318 19.9831 3.86178C20.0001 4.06994 20 4.31574 20 4.56812L20 17C20 17.1325 19.9736 17.2638 19.9225 17.386C19.4458 18.5253 19.4458 19.4747 19.9225 20.614C20.0517 20.9227 20.0179 21.2755 19.8325 21.5541C19.6471 21.8326 19.3346 22 19 22H7C5.34315 22 4 20.6569 4 19Z",fill:"currentColor"})]}),hC=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M18.063 5.674a1 1 0 0 1 .263 1.39l-7.5 11a1 1 0 0 1-1.533.143l-4.5-4.5a1 1 0 1 1 1.414-1.414l3.647 3.647 6.82-10.003a1 1 0 0 1 1.39-.263Z",clipRule:"evenodd"})}),_je=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM16.0755 7.93219C16.5272 8.25003 16.6356 8.87383 16.3178 9.32549L11.5678 16.0755C11.3931 16.3237 11.1152 16.4792 10.8123 16.4981C10.5093 16.517 10.2142 16.3973 10.0101 16.1727L7.51006 13.4227C7.13855 13.014 7.16867 12.3816 7.57733 12.0101C7.98598 11.6386 8.61843 11.6687 8.98994 12.0773L10.6504 13.9039L14.6822 8.17451C15 7.72284 15.6238 7.61436 16.0755 7.93219Z",fill:"currentColor"})}),Yst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 16 9",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.292893 0.292893C0.683418 -0.0976311 1.31658 -0.0976311 1.70711 0.292893L8 6.58579L14.2929 0.292894C14.6834 -0.0976305 15.3166 -0.0976304 15.7071 0.292894C16.0976 0.683418 16.0976 1.31658 15.7071 1.70711L8.70711 8.70711C8.31658 9.09763 7.68342 9.09763 7.29289 8.70711L0.292893 1.70711C-0.0976311 1.31658 -0.0976311 0.683417 0.292893 0.292893Z"})}),Zst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M15.707 4.293a1 1 0 0 1 0 1.414L9.414 12l6.293 6.293a1 1 0 0 1-1.414 1.414l-7-7a1 1 0 0 1 0-1.414l7-7a1 1 0 0 1 1.414 0Z",clipRule:"evenodd"})}),Jst=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M8.293 4.293a1 1 0 0 1 1.414 0l7 7a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414-1.414L14.586 12 8.293 5.707a1 1 0 0 1 0-1.414Z",clipRule:"evenodd"})}),pV=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM12 6C12.5523 6 13 6.44772 13 7V12C13 12.2652 12.8946 12.5196 12.7071 12.7071L10.2071 15.2071C9.81658 15.5976 9.18342 15.5976 8.79289 15.2071C8.40237 14.8166 8.40237 14.1834 8.79289 13.7929L11 11.5858V7C11 6.44772 11.4477 6 12 6Z",fill:"currentColor"})}),eat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M12.659 9.753a1 1 0 0 1-1.318 0l-4-3.5A1 1 0 1 1 8.66 4.747L12 7.671l3.341-2.924a1 1 0 1 1 1.318 1.506l-4 3.5Zm-4.002 9.501a1 1 0 1 1-1.314-1.508l4-3.485a1 1 0 0 1 1.314 0l4 3.485a1 1 0 1 1-1.314 1.508L12 16.34l-3.343 2.913Z"})}),jje=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M12.7587 2H16.2413C17.0463 1.99999 17.7106 1.99998 18.2518 2.04419C18.8139 2.09012 19.3306 2.18868 19.816 2.43597C20.5686 2.81947 21.1805 3.43139 21.564 4.18404C21.8113 4.66937 21.9099 5.18608 21.9558 5.74817C22 6.28936 22 6.95372 22 7.75868V11.2413C22 12.0463 22 12.7106 21.9558 13.2518C21.9099 13.8139 21.8113 14.3306 21.564 14.816C21.1805 15.5686 20.5686 16.1805 19.816 16.564C19.3306 16.8113 18.8139 16.9099 18.2518 16.9558C17.8906 16.9853 17.4745 16.9951 16.9984 16.9984C16.9951 17.4745 16.9853 17.8906 16.9558 18.2518C16.9099 18.8139 16.8113 19.3306 16.564 19.816C16.1805 20.5686 15.5686 21.1805 14.816 21.564C14.3306 21.8113 13.8139 21.9099 13.2518 21.9558C12.7106 22 12.0463 22 11.2413 22H7.75868C6.95372 22 6.28936 22 5.74818 21.9558C5.18608 21.9099 4.66937 21.8113 4.18404 21.564C3.43139 21.1805 2.81947 20.5686 2.43597 19.816C2.18868 19.3306 2.09012 18.8139 2.04419 18.2518C1.99998 17.7106 1.99999 17.0463 2 16.2413V12.7587C1.99999 11.9537 1.99998 11.2894 2.04419 10.7482C2.09012 10.1861 2.18868 9.66937 2.43597 9.18404C2.81947 8.43139 3.43139 7.81947 4.18404 7.43598C4.66937 7.18868 5.18608 7.09012 5.74817 7.04419C6.10939 7.01468 6.52548 7.00487 7.00162 7.00162C7.00487 6.52548 7.01468 6.10939 7.04419 5.74817C7.09012 5.18608 7.18868 4.66937 7.43598 4.18404C7.81947 3.43139 8.43139 2.81947 9.18404 2.43597C9.66937 2.18868 10.1861 2.09012 10.7482 2.04419C11.2894 1.99998 11.9537 1.99999 12.7587 2ZM9.00176 7L11.2413 7C12.0463 6.99999 12.7106 6.99998 13.2518 7.04419C13.8139 7.09012 14.3306 7.18868 14.816 7.43598C15.5686 7.81947 16.1805 8.43139 16.564 9.18404C16.8113 9.66937 16.9099 10.1861 16.9558 10.7482C17 11.2894 17 11.9537 17 12.7587V14.9982C17.4455 14.9951 17.7954 14.9864 18.089 14.9624C18.5274 14.9266 18.7516 14.8617 18.908 14.782C19.2843 14.5903 19.5903 14.2843 19.782 13.908C19.8617 13.7516 19.9266 13.5274 19.9624 13.089C19.9992 12.6389 20 12.0566 20 11.2V7.8C20 6.94342 19.9992 6.36113 19.9624 5.91104C19.9266 5.47262 19.8617 5.24842 19.782 5.09202C19.5903 4.7157 19.2843 4.40973 18.908 4.21799C18.7516 4.1383 18.5274 4.07337 18.089 4.03755C17.6389 4.00078 17.0566 4 16.2 4H12.8C11.9434 4 11.3611 4.00078 10.911 4.03755C10.4726 4.07337 10.2484 4.1383 10.092 4.21799C9.7157 4.40973 9.40973 4.7157 9.21799 5.09202C9.1383 5.24842 9.07337 5.47262 9.03755 5.91104C9.01357 6.20463 9.00489 6.55447 9.00176 7ZM5.91104 9.03755C5.47262 9.07337 5.24842 9.1383 5.09202 9.21799C4.7157 9.40973 4.40973 9.7157 4.21799 10.092C4.1383 10.2484 4.07337 10.4726 4.03755 10.911C4.00078 11.3611 4 11.9434 4 12.8V16.2C4 17.0566 4.00078 17.6389 4.03755 18.089C4.07337 18.5274 4.1383 18.7516 4.21799 18.908C4.40973 19.2843 4.7157 19.5903 5.09202 19.782C5.24842 19.8617 5.47262 19.9266 5.91104 19.9624C6.36113 19.9992 6.94342 20 7.8 20H11.2C12.0566 20 12.6389 19.9992 13.089 19.9624C13.5274 19.9266 13.7516 19.8617 13.908 19.782C14.2843 19.5903 14.5903 19.2843 14.782 18.908C14.8617 18.7516 14.9266 18.5274 14.9624 18.089C14.9992 17.6389 15 17.0566 15 16.2V12.8C15 11.9434 14.9992 11.3611 14.9624 10.911C14.9266 10.4726 14.8617 10.2484 14.782 10.092C14.5903 9.7157 14.2843 9.40973 13.908 9.21799C13.7516 9.1383 13.5274 9.07337 13.089 9.03755C12.6389 9.00078 12.0566 9 11.2 9H7.8C6.94342 9 6.36113 9.00078 5.91104 9.03755Z",fill:"currentColor"})}),tat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M10.556 4a1 1 0 0 0-.97.751l-.292 1.14h5.421l-.293-1.14A1 1 0 0 0 13.453 4h-2.897Zm6.224 1.892-.421-1.639A3 3 0 0 0 13.453 2h-2.897A3 3 0 0 0 7.65 4.253l-.421 1.639H4a1 1 0 1 0 0 2h.1l1.215 11.425A3 3 0 0 0 8.3 22h7.4a3 3 0 0 0 2.984-2.683l1.214-11.425H20a1 1 0 1 0 0-2h-3.22Zm1.108 2H6.112l1.192 11.214A1 1 0 0 0 8.3 20h7.4a1 1 0 0 0 .995-.894l1.192-11.214ZM10 10a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0v-5a1 1 0 0 1 1-1Zm4 0a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0v-5a1 1 0 0 1 1-1Z",clipRule:"evenodd"})}),nat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M3 12a2 2 0 1 1 4 0 2 2 0 0 1-4 0Zm7 0a2 2 0 1 1 4 0 2 2 0 0 1-4 0Zm7 0a2 2 0 1 1 4 0 2 2 0 0 1-4 0Z"})}),iat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 10 16",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.34151 0.747423C4.71854 0.417526 5.28149 0.417526 5.65852 0.747423L9.65852 4.24742C10.0742 4.61111 10.1163 5.24287 9.75259 5.6585C9.38891 6.07414 8.75715 6.11626 8.34151 5.75258L5.00001 2.82877L1.65852 5.75258C1.24288 6.11626 0.61112 6.07414 0.247438 5.6585C-0.116244 5.24287 -0.0741267 4.61111 0.34151 4.24742L4.34151 0.747423ZM0.246065 10.3578C0.608879 9.94139 1.24055 9.89795 1.65695 10.2608L5.00001 13.1737L8.34308 10.2608C8.75948 9.89795 9.39115 9.94139 9.75396 10.3578C10.1168 10.7742 10.0733 11.4058 9.65695 11.7687L5.65695 15.2539C5.28043 15.582 4.7196 15.582 4.34308 15.2539L0.343082 11.7687C-0.0733128 11.4058 -0.116749 10.7742 0.246065 10.3578Z"})}),rat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M16.793 2.793a3.121 3.121 0 1 1 4.414 4.414l-8.5 8.5A1 1 0 0 1 12 16H9a1 1 0 0 1-1-1v-3a1 1 0 0 1 .293-.707l8.5-8.5Zm3 1.414a1.121 1.121 0 0 0-1.586 0L10 12.414V14h1.586l8.207-8.207a1.121 1.121 0 0 0 0-1.586ZM6 5a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-4a1 1 0 1 1 2 0v4a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h4a1 1 0 1 1 0 2H6Z",clipRule:"evenodd"})}),sat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M12 7a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 1 1-2 0V8h-3a1 1 0 0 1-1-1Zm-5 5a1 1 0 0 1 1 1v3h3a1 1 0 1 1 0 2H7a1 1 0 0 1-1-1v-4a1 1 0 0 1 1-1Z",clipRule:"evenodd"})}),aat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8-10C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2Zm4.465 6.763a1 1 0 0 0-1.228-1.228l-5.5 1.5a1 1 0 0 0-.702.702l-1.5 5.5a1 1 0 0 0 1.228 1.228l5.5-1.5a1 1 0 0 0 .702-.702l1.5-5.5Zm-6.54 5.312.89-3.26 3.26-.89-.89 3.26-3.26.89Z",clipRule:"evenodd"})}),oat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M14.4472 7.10558C14.9412 7.35257 15.1414 7.95324 14.8944 8.44722L10.8944 16.4472C10.6474 16.9412 10.0468 17.1414 9.55279 16.8944C9.05881 16.6474 8.85858 16.0468 9.10557 15.5528L13.1056 7.55279C13.3526 7.05881 13.9532 6.85859 14.4472 7.10558ZM6.6 7.20001C7.04183 7.53138 7.13137 8.15818 6.8 8.60001L4.25 12L6.8 15.4C7.13137 15.8418 7.04183 16.4686 6.6 16.8C6.15817 17.1314 5.53137 17.0418 5.2 16.6L2.2 12.6C1.93333 12.2444 1.93333 11.7556 2.2 11.4L5.2 7.40001C5.53137 6.95818 6.15817 6.86863 6.6 7.20001ZM17.4 7.20001C17.8418 6.86863 18.4686 6.95818 18.8 7.40001L21.8 11.4C22.0667 11.7556 22.0667 12.2444 21.8 12.6L18.8 16.6C18.4686 17.0418 17.8418 17.1314 17.4 16.8C16.9582 16.4686 16.8686 15.8418 17.2 15.4L19.75 12L17.2 8.60001C16.8686 8.15818 16.9582 7.53138 17.4 7.20001Z",fill:"currentColor"})}),Nje=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.jsx("path",{d:"M13 12a1 1 0 1 0-2 0v4a1 1 0 1 0 2 0v-4Zm-1-2.5A1.25 1.25 0 1 0 12 7a1.25 1.25 0 0 0 0 2.5Z"}),a.jsx("path",{fillRule:"evenodd",d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Z",clipRule:"evenodd"})]}),lat=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.jsx("path",{d:"M7.79289 9.04289C8.18342 8.65237 8.81658 8.65237 9.20711 9.04289L11.4571 11.2929C11.8476 11.6834 11.8476 12.3166 11.4571 12.7071L9.20711 14.9571C8.81658 15.3476 8.18342 15.3476 7.79289 14.9571C7.40237 14.5666 7.40237 13.9334 7.79289 13.5429L9.33579 12L7.79289 10.4571C7.40237 10.0666 7.40237 9.43342 7.79289 9.04289ZM12.25 14.25C12.25 13.6977 12.6977 13.25 13.25 13.25H15.5C16.0523 13.25 16.5 13.6977 16.5 14.25C16.5 14.8023 16.0523 15.25 15.5 15.25H13.25C12.6977 15.25 12.25 14.8023 12.25 14.25Z",fill:"currentColor"}),a.jsx("path",{d:"M2 8C2 5.79086 3.79086 4 6 4C6.55228 4 7 4.44772 7 5C7 5.55228 6.55228 6 6 6C4.89543 6 4 6.89543 4 8V16C4 17.1046 4.89543 18 6 18C6.55228 18 7 18.4477 7 19C7 19.5523 6.55228 20 6 20C3.79086 20 2 18.2091 2 16V8ZM17 5C17 4.44772 17.4477 4 18 4C20.2091 4 22 5.79086 22 8V16C22 18.2091 20.2091 20 18 20C17.4477 20 17 19.5523 17 19C17 18.4477 17.4477 18 18 18C19.1046 18 20 17.1046 20 16V8C20 6.89543 19.1046 6 18 6C17.4477 6 17 5.55228 17 5Z",fill:"currentColor"})]}),cat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M6 12C6 11.4477 6.44772 11 7 11H17C17.5523 11 18 11.4477 18 12C18 12.5523 17.5523 13 17 13H7C6.44772 13 6 12.5523 6 12Z",fill:"currentColor"})}),uat=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.jsx("path",{d:"M12.75 9.50001C12.75 9.08579 13.0858 8.75001 13.5 8.75001H14.5C14.9142 8.75001 15.25 9.08579 15.25 9.50001V14.5C15.25 14.9142 14.9142 15.25 14.5 15.25H13.5C13.0858 15.25 12.75 14.9142 12.75 14.5V9.50001Z",fill:"currentColor"}),a.jsx("path",{d:"M9.50001 8.75001C9.08579 8.75001 8.75001 9.08579 8.75001 9.50001V14.5C8.75001 14.9142 9.08579 15.25 9.50001 15.25H10.5C10.9142 15.25 11.25 14.9142 11.25 14.5V9.50001C11.25 9.08579 10.9142 8.75001 10.5 8.75001H9.50001Z",fill:"currentColor"}),a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.97144 12C1.97144 6.46138 6.46138 1.97144 12 1.97144C17.5386 1.97144 22.0286 6.46138 22.0286 12C22.0286 17.5386 17.5386 22.0286 12 22.0286C6.46138 22.0286 1.97144 17.5386 1.97144 12ZM12 4.02858C7.59751 4.02858 4.02858 7.59751 4.02858 12C4.02858 16.4025 7.59751 19.9714 12 19.9714C16.4025 19.9714 19.9714 16.4025 19.9714 12C19.9714 7.59751 16.4025 4.02858 12 4.02858Z",fill:"currentColor"})]}),KJ=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.jsx("path",{d:"M9.5 9.33165V14.6683C9.5 15.4595 10.3752 15.9373 11.0408 15.5095L15.1915 12.8412C15.8038 12.4475 15.8038 11.5524 15.1915 11.1588L11.0408 8.49047C10.3752 8.06265 9.5 8.54049 9.5 9.33165Z",fill:"currentColor"}),a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12Z",fill:"currentColor"})]}),dat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M8 16.7229V7.27711C8 6.29075 9.08894 5.69298 9.9211 6.22254L17.3428 10.9454C18.1147 11.4366 18.1147 12.5634 17.3428 13.0546L9.92109 17.7775C9.08894 18.3071 8 17.7093 8 16.7229Z",fill:"currentColor"})}),Rje=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M12 5a1 1 0 0 1 1 1v5h5a1 1 0 1 1 0 2h-5v5a1 1 0 1 1-2 0v-5H6a1 1 0 1 1 0-2h5V6a1 1 0 0 1 1-1Z",clipRule:"evenodd"})}),Ije=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M12 3C12.5523 3 13 3.44772 13 4L13 11H20C20.5523 11 21 11.4477 21 12C21 12.5523 20.5523 13 20 13L13 13L13 20C13 20.5523 12.5523 21 12 21C11.4477 21 11 20.5523 11 20L11 13L4 13C3.44772 13 3 12.5523 3 12C3 11.4477 3.44772 11 4 11L11 11L11 4C11 3.44772 11.4477 3 12 3Z",fill:"currentColor"})}),fat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M12 6C12.5523 6 13 6.44772 13 7V11H17C17.5523 11 18 11.4477 18 12C18 12.5523 17.5523 13 17 13H13V17C13 17.5523 12.5523 18 12 18C11.4477 18 11 17.5523 11 17V13H7C6.44772 13 6 12.5523 6 12C6 11.4477 6.44772 11 7 11H11V7C11 6.44772 11.4477 6 12 6Z",fill:"currentColor"})}),hat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.875 4.5C7.35418 4.5 4.5 7.35418 4.5 10.875C4.5 14.3958 7.35418 17.25 10.875 17.25C14.3958 17.25 17.25 14.3958 17.25 10.875C17.25 7.35418 14.3958 4.5 10.875 4.5ZM2.5 10.875C2.5 6.24962 6.24962 2.5 10.875 2.5C15.5004 2.5 19.25 6.24962 19.25 10.875C19.25 12.8273 18.582 14.6236 17.462 16.0478L21.2071 19.7929C21.5976 20.1834 21.5976 20.8166 21.2071 21.2071C20.8166 21.5976 20.1834 21.5976 19.7929 21.2071L16.0478 17.462C14.6236 18.582 12.8273 19.25 10.875 19.25C6.24962 19.25 2.5 15.5004 2.5 10.875Z",fill:"currentColor"})}),pat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M11.2929 3.29289C11.6834 2.90237 12.3166 2.90237 12.7071 3.29289L16.7071 7.29289C17.0976 7.68342 17.0976 8.31658 16.7071 8.70711C16.3166 9.09763 15.6834 9.09763 15.2929 8.70711L13 6.41421V15C13 15.5523 12.5523 16 12 16C11.4477 16 11 15.5523 11 15V6.41421L8.70711 8.70711C8.31658 9.09763 7.68342 9.09763 7.29289 8.70711C6.90237 8.31658 6.90237 7.68342 7.29289 7.29289L11.2929 3.29289ZM4 14C4.55229 14 5 14.4477 5 15V15.2C5 16.0566 5.00078 16.6389 5.03755 17.089C5.07337 17.5274 5.1383 17.7516 5.21799 17.908C5.40973 18.2843 5.7157 18.5903 6.09202 18.782C6.24842 18.8617 6.47262 18.9266 6.91104 18.9624C7.36113 18.9992 7.94342 19 8.8 19H15.2C16.0566 19 16.6389 18.9992 17.089 18.9624C17.5274 18.9266 17.7516 18.8617 17.908 18.782C18.2843 18.5903 18.5903 18.2843 18.782 17.908C18.8617 17.7516 18.9266 17.5274 18.9624 17.089C18.9992 16.6389 19 16.0566 19 15.2V15C19 14.4477 19.4477 14 20 14C20.5523 14 21 14.4477 21 15V15.2413C21 16.0463 21 16.7106 20.9558 17.2518C20.9099 17.8139 20.8113 18.3306 20.564 18.816C20.1805 19.5686 19.5686 20.1805 18.816 20.564C18.3306 20.8113 17.8139 20.9099 17.2518 20.9558C16.7106 21 16.0463 21 15.2413 21H8.75868C7.95372 21 7.28936 21 6.74817 20.9558C6.18608 20.9099 5.66937 20.8113 5.18404 20.564C4.43139 20.1805 3.81947 19.5686 3.43597 18.816C3.18868 18.3306 3.09012 17.8139 3.04419 17.2518C2.99998 16.7106 2.99999 16.0463 3 15.2413L3 15C3 14.4477 3.44772 14 4 14Z",fill:"currentColor"})}),mat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M6 8C6 6.89543 6.89543 6 8 6H16C17.1046 6 18 6.89543 18 8V16C18 17.1046 17.1046 18 16 18H8C6.89543 18 6 17.1046 6 16V8Z",fill:"currentColor"})}),gat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M14.5 4a5.5 5.5 0 0 0-5.078 7.616 1 1 0 0 1-.216 1.092l-4.749 4.75a1.475 1.475 0 0 0 2.086 2.085l4.749-4.749a1 1 0 0 1 1.092-.216A5.5 5.5 0 0 0 20 9.414l-1.293 1.293a3.828 3.828 0 1 1-5.414-5.414L14.585 4H14.5ZM7 9.5a7.5 7.5 0 0 1 9.969-7.084 1 1 0 0 1 .378 1.651l-2.64 2.64a1.829 1.829 0 0 0 2.586 2.586l2.64-2.64a1 1 0 0 1 1.651.378 7.5 7.5 0 0 1-9.328 9.627l-4.299 4.3a3.475 3.475 0 0 1-4.914-4.915l4.299-4.299A7.497 7.497 0 0 1 7 9.5Z"})}),gN=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{d:"M8.99805 16.796C8.99805 15.4164 7.87961 14.2979 6.5 14.2979C5.12039 14.2979 4.00195 15.4164 4.00195 16.796C4.00196 18.1756 5.1204 19.294 6.5 19.294C7.8796 19.294 8.99804 18.1756 8.99805 16.796ZM19.748 15.0479C19.748 14.7729 19.525 14.5499 19.25 14.5499H15.75C15.475 14.5499 15.252 14.7729 15.252 15.0479V18.5479C15.252 18.823 15.475 19.046 15.75 19.046H19.25C19.525 19.046 19.748 18.823 19.748 18.5479V15.0479ZM10.0469 3.45125C11.077 2.15921 13.0849 2.20276 14.0498 3.58113L16.4189 6.96492L16.5205 7.12215C17.5046 8.76341 16.3301 10.9023 14.3691 10.9024H9.63086C7.60676 10.9023 6.42029 8.62316 7.58105 6.96492L9.9502 3.58113L10.0469 3.45125ZM12.4082 4.73055C12.2223 4.46497 11.842 4.44826 11.6318 4.68074L11.5918 4.73055L9.22266 8.11433C8.99176 8.44435 9.22808 8.89744 9.63086 8.89754H14.3691C14.7468 8.89745 14.9774 8.49957 14.8145 8.17781L14.7773 8.11433L12.4082 4.73055ZM11.002 16.796C11.0019 19.2824 8.98638 21.2979 6.5 21.2979C4.01362 21.2979 1.99806 19.2824 1.99805 16.796C1.99805 14.3096 4.01361 12.294 6.5 12.294C8.98639 12.294 11.002 14.3096 11.002 16.796ZM21.752 18.5479C21.752 19.9297 20.6318 21.0499 19.25 21.0499H15.75C14.3682 21.0499 13.248 19.9297 13.248 18.5479V15.0479C13.2481 13.6662 14.3682 12.546 15.75 12.546H19.25C20.6318 12.546 21.7519 13.6662 21.752 15.0479V18.5479Z",fill:"currentColor"})}),bat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5555 4C10.099 4 9.70052 4.30906 9.58693 4.75114L9.29382 5.8919H14.715L14.4219 4.75114C14.3083 4.30906 13.9098 4 13.4533 4H10.5555ZM16.7799 5.8919L16.3589 4.25342C16.0182 2.92719 14.8226 2 13.4533 2H10.5555C9.18616 2 7.99062 2.92719 7.64985 4.25342L7.22886 5.8919H4C3.44772 5.8919 3 6.33961 3 6.8919C3 7.44418 3.44772 7.8919 4 7.8919H4.10069L5.31544 19.3172C5.47763 20.8427 6.76455 22 8.29863 22H15.7014C17.2354 22 18.5224 20.8427 18.6846 19.3172L19.8993 7.8919H20C20.5523 7.8919 21 7.44418 21 6.8919C21 6.33961 20.5523 5.8919 20 5.8919H16.7799ZM17.888 7.8919H6.11196L7.30423 19.1057C7.3583 19.6142 7.78727 20 8.29863 20H15.7014C16.2127 20 16.6417 19.6142 16.6958 19.1057L17.888 7.8919ZM10 10C10.5523 10 11 10.4477 11 11V16C11 16.5523 10.5523 17 10 17C9.44772 17 9 16.5523 9 16V11C9 10.4477 9.44772 10 10 10ZM14 10C14.5523 10 15 10.4477 15 11V16C15 16.5523 14.5523 17 14 17C13.4477 17 13 16.5523 13 16V11C13 10.4477 13.4477 10 14 10Z"})}),yat=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M7.5 5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5ZM3 7.5a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0ZM17 6a2 2 0 1 0 0 4 2 2 0 0 0 0-4Zm-4 2a4 4 0 1 1 8 0 4 4 0 0 1-8 0Zm-8.96 8.247C3.137 17.048 2.5 18.271 2.5 20a1 1 0 1 1-2 0c0-2.271.862-4.049 2.21-5.248C4.042 13.57 5.788 13 7.5 13s3.459.57 4.79 1.752c1.348 1.2 2.21 2.977 2.21 5.248a1 1 0 1 1-2 0c0-1.729-.638-2.952-1.54-3.753C10.042 15.43 8.788 15 7.5 15s-2.541.43-3.46 1.247Zm15.757-.607c-1.009-.638-2.338-.807-3.526-.472a1 1 0 0 1-.542-1.925c1.695-.478 3.616-.255 5.136.706 1.558.984 2.635 2.707 2.635 5.051a1 1 0 1 1-2 0c0-1.665-.732-2.746-1.703-3.36Z",clipRule:"evenodd"})}),Pje=e=>a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[a.jsx("path",{d:"M10.42 2.006a4 4 0 0 1 3.159 0c.674.29 1.188.822 1.667 1.456.474.627 1 1.473 1.653 2.523l3.542 5.696c.72 1.16 1.3 2.09 1.682 2.854.384.766.654 1.517.59 2.292a4 4 0 0 1-1.604 2.886c-.625.463-1.405.63-2.258.709-.85.078-1.945.078-3.311.078H8.46c-1.366 0-2.46 0-3.31-.078-.854-.078-1.634-.246-2.26-.71a4 4 0 0 1-1.603-2.885c-.064-.775.206-1.526.59-2.292.383-.764.961-1.694 1.682-2.854l3.542-5.696c.653-1.05 1.18-1.896 1.653-2.523.48-.634.993-1.166 1.667-1.456Zm2.37 1.838a2 2 0 0 0-1.58 0c-.192.083-.448.28-.86.825-.413.544-.891 1.312-1.577 2.415l-3.488 5.61c-.755 1.214-1.283 2.066-1.62 2.737-.34.678-.402 1.02-.385 1.232a2 2 0 0 0 .802 1.443c.171.127.494.255 1.25.324.748.069 1.75.07 3.18.07h6.976c1.43 0 2.432-.001 3.18-.07.756-.069 1.079-.197 1.25-.324a2 2 0 0 0 .802-1.443c.017-.212-.045-.554-.385-1.232-.337-.671-.865-1.523-1.62-2.737l-3.488-5.61c-.686-1.103-1.164-1.87-1.576-2.415-.413-.546-.67-.742-.861-.825"}),a.jsx("path",{d:"M12 7.5a1 1 0 0 1 1 1v3a1 1 0 1 1-2 0v-3a1 1 0 0 1 1-1M10.851 15a1.15 1.15 0 1 1 2.3 0 1.15 1.15 0 0 1-2.3 0"})]}),mV=e=>a.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:a.jsx("path",{fillRule:"evenodd",d:"M5.636 5.636a1 1 0 0 1 1.414 0l4.95 4.95 4.95-4.95a1 1 0 0 1 1.414 1.414L13.414 12l4.95 4.95a1 1 0 0 1-1.414 1.414L12 13.414l-4.95 4.95a1 1 0 0 1-1.414-1.414l4.95-4.95-4.95-4.95a1 1 0 0 1 0-1.414Z",clipRule:"evenodd"})});/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bat=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Pje=(...e)=>e.filter((t,n,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===n).join(" ").trim();/** + */const vat=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Dje=(...e)=>e.filter((t,n,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===n).join(" ").trim();/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */var yat={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + */var xat={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const vat=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:r="",children:s,iconNode:o,...l},c)=>p.createElement("svg",{ref:c,...yat,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:Pje("lucide",r),...l},[...o.map(([u,d])=>p.createElement(u,d)),...Array.isArray(s)?s:[s]]));/** + */const wat=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:r="",children:s,iconNode:o,...l},c)=>p.createElement("svg",{ref:c,...xat,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:Dje("lucide",r),...l},[...o.map(([u,d])=>p.createElement(u,d)),...Array.isArray(s)?s:[s]]));/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const An=(e,t)=>{const n=p.forwardRef(({className:i,...r},s)=>p.createElement(vat,{ref:s,iconNode:t,className:Pje(`lucide-${bat(e)}`,i),...r}));return n.displayName=`${e}`,n};/** + */const An=(e,t)=>{const n=p.forwardRef(({className:i,...r},s)=>p.createElement(wat,{ref:s,iconNode:t,className:Dje(`lucide-${vat(e)}`,i),...r}));return n.displayName=`${e}`,n};/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Dje=An("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** + */const Mje=An("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const xat=An("ArrowRightLeft",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]]);/** + */const Oat=An("ArrowRightLeft",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const nE=An("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** + */const iE=An("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const wat=An("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** + */const kat=An("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Mje=An("AtSign",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]]);/** + */const Lje=An("AtSign",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Lje=An("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** + */const $je=An("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Oat=An("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/** + */const Sat=An("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const kat=An("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/** + */const Eat=An("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ef=An("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + */const Cf=An("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Sat=An("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + */const Cat=An("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Eat=An("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** + */const Aat=An("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const HA=An("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + */const qA=An("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const gN=An("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** + */const bN=An("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Cat=An("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** + */const Tat=An("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const oB=An("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** + */const lB=An("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Aat=An("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** + */const _at=An("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Tat=An("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/** + */const jat=An("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -253,17 +253,17 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const _at=An("CornerDownRight",[["polyline",{points:"15 10 20 15 15 20",key:"1q7qjw"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]]);/** + */const Nat=An("CornerDownRight",[["polyline",{points:"15 10 20 15 15 20",key:"1q7qjw"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const jat=An("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/** + */const Rat=An("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bN=An("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** + */const yN=An("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -273,72 +273,72 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const KJ=An("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/** + */const GJ=An("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const p0=An("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** + */const m0=An("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Nat=An("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + */const Iat=An("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Rat=An("FileDown",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/** + */const Pat=An("FileDown",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Iat=An("FilePlus",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);/** + */const Dat=An("FilePlus",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const mV=An("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** + */const gV=An("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Pat=An("FileType2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M2 13v-1h6v1",key:"1dh9dg"}],["path",{d:"M5 12v6",key:"150t9c"}],["path",{d:"M4 18h2",key:"1xrofg"}]]);/** + */const Mat=An("FileType2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M2 13v-1h6v1",key:"1dh9dg"}],["path",{d:"M5 12v6",key:"150t9c"}],["path",{d:"M4 18h2",key:"1xrofg"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $je=An("FileVideo2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["rect",{width:"8",height:"6",x:"2",y:"12",rx:"1",key:"1a6c1e"}],["path",{d:"m10 15.5 4 2.5v-6l-4 2.5",key:"t7cp39"}]]);/** + */const Fje=An("FileVideo2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["rect",{width:"8",height:"6",x:"2",y:"12",rx:"1",key:"1a6c1e"}],["path",{d:"m10 15.5 4 2.5v-6l-4 2.5",key:"t7cp39"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Dat=An("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/** + */const Lat=An("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Mat=An("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/** + */const $at=An("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const gV=An("FolderUp",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m9 13 3-3 3 3",key:"1pxg3c"}]]);/** + */const bV=An("FolderUp",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m9 13 3-3 3 3",key:"1pxg3c"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Lat=An("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/** + */const Fat=An("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $at=An("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/** + */const Bat=An("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Fat=An("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/** + */const Uat=An("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -348,72 +348,72 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bV=An("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** + */const yV=An("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const pm=An("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** + */const mm=An("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Fje=An("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** + */const Bje=An("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Bat=An("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/** + */const Qat=An("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Fi=An("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** + */const Bi=An("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Uat=An("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/** + */const zat=An("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Qat=An("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** + */const Vat=An("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const iE=An("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/** + */const rE=An("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const zat=An("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** + */const Hat=An("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Bje=An("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** + */const Uje=An("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Vat=An("MonitorPlay",[["path",{d:"M10 7.75a.75.75 0 0 1 1.142-.638l3.664 2.249a.75.75 0 0 1 0 1.278l-3.664 2.25a.75.75 0 0 1-1.142-.64z",key:"1pctta"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",key:"x3v2xh"}]]);/** + */const qat=An("MonitorPlay",[["path",{d:"M10 7.75a.75.75 0 0 1 1.142-.638l3.664 2.249a.75.75 0 0 1 0 1.278l-3.664 2.25a.75.75 0 0 1-1.142-.64z",key:"1pctta"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",key:"x3v2xh"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Hat=An("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/** + */const Wat=An("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const qat=An("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** + */const Kat=An("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Uje=An("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** + */const Qje=An("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -423,17 +423,17 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Wat=An("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** + */const Gat=An("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Qje=An("Repeat",[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]]);/** + */const zje=An("Repeat",[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Kat=An("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/** + */const Xat=An("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -443,47 +443,47 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Gat=An("Shapes",[["path",{d:"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z",key:"1bo67w"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}],["circle",{cx:"17.5",cy:"17.5",r:"3.5",key:"w3z12y"}]]);/** + */const Yat=An("Shapes",[["path",{d:"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z",key:"1bo67w"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}],["circle",{cx:"17.5",cy:"17.5",r:"3.5",key:"w3z12y"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const GJ=An("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** + */const XJ=An("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const hC=An("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** + */const pC=An("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Xat=An("Split",[["path",{d:"M16 3h5v5",key:"1806ms"}],["path",{d:"M8 3H3v5",key:"15dfkv"}],["path",{d:"M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3",key:"1qrqzj"}],["path",{d:"m15 9 6-6",key:"ko1vev"}]]);/** + */const Zat=An("Split",[["path",{d:"M16 3h5v5",key:"1806ms"}],["path",{d:"M8 3H3v5",key:"15dfkv"}],["path",{d:"M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3",key:"1qrqzj"}],["path",{d:"m15 9 6-6",key:"ko1vev"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Jg=An("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** + */const eb=An("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Yat=An("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + */const Jat=An("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Zat=An("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/** + */const eot=An("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Do=An("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),XJ=Object.freeze({totalTokenCount:0,promptTokenCount:0,candidatesTokenCount:0,thoughtsTokenCount:0,cachedContentTokenCount:0}),rE=Object.freeze({modelName:"",current:XJ,cumulative:XJ}),Jat={totalTokenCount:"total_token_count",promptTokenCount:"prompt_token_count",candidatesTokenCount:"candidates_token_count",thoughtsTokenCount:"thoughts_token_count",cachedContentTokenCount:"cached_content_token_count"},eot=24,tot=64,not=16;function a_(e){var l,c;const t=e.trim();if(!t)return 0;const n=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/gu,i=((l=t.match(n))==null?void 0:l.length)??0,r=t.replace(n," "),s=(r.match(/[A-Za-z0-9_]+/g)??[]).reduce((u,d)=>u+Math.max(1,Math.ceil(d.length/4)),0),o=((c=r.match(/[^\sA-Za-z0-9_]/g))==null?void 0:c.length)??0;return i+s+o}function iot(e){var l,c,u;const t=((l=e.instruction)==null?void 0:l.trim())??"",n=((c=e.tools)==null?void 0:c.filter(d=>d.trim()))??[],i=((u=e.skills)==null?void 0:u.filter(d=>d.name.trim()))??[],r=a_(t),s=n.reduce((d,f)=>d+tot+a_(f),0),o=i.reduce((d,f)=>d+not+a_(f.name)+a_(f.description??""),0);return eot+r+s+o}function rot({usage:e,contextWindow:t,estimatedSystemTokens:n}){const i=Math.max(1,Math.round(t)),r=Math.max(0,e.current.promptTokenCount),s=Math.max(r,e.current.totalTokenCount),o=Math.min(i,r>0?Math.min(r,Math.max(0,n??0)):Math.max(0,n??0)),l=Math.max(0,r-o),c=r>0?Math.max(0,s-r):Math.max(0,s),u=r>0?s:o+c;return{systemTokens:o,inputTokens:l,outputTokens:c,remainingTokens:Math.max(0,i-u),usedTokens:u,contextWindow:i}}function sot(e){const t=[{kind:"system",tokens:e.systemTokens},{kind:"input",tokens:e.inputTokens},{kind:"output",tokens:e.outputTokens},{kind:"remaining",tokens:e.remainingTokens}],n=e.contextWindow/100;let i=0;const r=t.map(s=>{const o=i;return i+=s.tokens,{...s,start:o,end:i}});return Array.from({length:100},(s,o)=>{const l=o*n,c=l+n,u=r.flatMap(d=>{const f=Math.max(0,Math.min(c,d.end)-Math.max(l,d.start));return f>0?[{kind:d.kind,share:f/n}]:[]});return{index:o,slices:u}})}function dk(e,t){const n=e,i=n[t]??n[Jat[t]];return typeof i=="number"&&Number.isFinite(i)&&i>0?Math.round(i):0}function aot(e){const t=dk(e,"promptTokenCount"),n=dk(e,"candidatesTokenCount"),i=dk(e,"thoughtsTokenCount");return{totalTokenCount:dk(e,"totalTokenCount")||t+n+i,promptTokenCount:t,candidatesTokenCount:n,thoughtsTokenCount:i,cachedContentTokenCount:dk(e,"cachedContentTokenCount")}}function oot(e,t){return{totalTokenCount:e.totalTokenCount+t.totalTokenCount,promptTokenCount:e.promptTokenCount+t.promptTokenCount,candidatesTokenCount:e.candidatesTokenCount+t.candidatesTokenCount,thoughtsTokenCount:e.thoughtsTokenCount+t.thoughtsTokenCount,cachedContentTokenCount:e.cachedContentTokenCount+t.cachedContentTokenCount}}function yV(e,t){if(!t)return e;const n=typeof t.modelVersion=="string"?t.modelVersion.trim():"",i=typeof t.model_version=="string"?t.model_version.trim():"",r=n||i||e.modelName,s=t.usageMetadata??t.usage_metadata;if(!s)return r===e.modelName?e:{...e,modelName:r};const o=aot(s);return o.totalTokenCount===0?r===e.modelName?e:{...e,modelName:r}:{modelName:r,current:o,cumulative:oot(e.cumulative,o)}}function YJ(e){return e.reduce((t,n)=>yV(t,n),rE)}function ZJ(e){return e.blocks.flatMap(t=>t.kind==="tool"?[{name:t.name,args:t.args,response:t.response,done:t.done}]:[])}function lot(e){const t=e.attributes;return String(t["invocation.id"]??t["gen_ai.invocation.id"]??t["gcp.vertex.agent.invocation_id"]??"")}function cot(e,t){if(!t)return e;const n=new Set(e.filter(r=>lot(r)===t).map(r=>r.trace_id)),i=e.filter(r=>n.has(r.trace_id));return i.length>0?i:e}function m0(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function gg(e){return typeof e=="string"?e:""}function zje(e,t){return e==="pending"||e==="running"||e==="completed"||e==="failed"?e:t}function uot(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return{}}const n=m0(t)??{};return m0(n.result)??n}function dot(e){var n;const t=(n=m0(e))==null?void 0:n.branches;return Array.isArray(t)?t.map(i=>{var r;return gg((r=m0(i))==null?void 0:r.label)}):[]}function Vje(e,t,n){const i=dot(e),r=uot(t),s=Array.isArray(r.branches)?r.branches:[],o=n==="running"?"running":"pending";return{branches:[0,1].map(c=>{const u=m0(s[c])??{};return{label:gg(u.label)||i[c]||`方向 ${c+1}`,content:gg(u.content),status:zje(u.status,o),error:gg(u.error)}})}}function fot(e){const t=m0(e),n=m0(t==null?void 0:t.veadkStudioToolProgress);return!n||n.toolName!=="branch_compare"||typeof n.branchIndex!="number"||n.branchIndex<0||n.branchIndex>1?null:{toolName:"branch_compare",requestId:gg(n.requestId),branchIndex:n.branchIndex,label:gg(n.label),delta:gg(n.delta),status:zje(n.status,"running"),error:gg(n.error)||void 0}}function hot(e,t,n){return{branches:Vje(e,t,"running").branches.map((s,o)=>o===n.branchIndex?{...s,label:n.label||s.label,content:s.content+n.delta,status:n.status,error:n.error??s.error}:s)}}function Ko(e,t){return bn.t(`blocks.codexProgress.${e}`,{ns:"conversation",...t})}const Hje=28e4;function JJ(e){try{return JSON.stringify(e).length}catch{return Hje}}function pot(e){const t=e.slice(-200);let n=t.reduce((i,r)=>i+JJ(r),0);for(;t.length>1&&n>Hje;)n-=JJ(t.shift());return t}function wu(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Ji(e){return typeof e=="string"?e:""}function vV(e,t=""){const n=Ji(e).toLowerCase();return t.endsWith(".failed")||["failed","error","declined","cancelled"].includes(n)?"failed":t.endsWith(".completed")||["completed","done","success"].includes(n)?"completed":"running"}function qje(e){if(e.response!==void 0)return e.response;if(e.result!==void 0)return e.result;const t=e.aggregatedOutput??e.aggregated_output??e.output,n=e.exitCode??e.exit_code;if(!(t===void 0&&n===void 0))return{...t!==void 0?{output:t}:{},...n!==void 0?{exitCode:n}:{}}}function Wje(e){if(e.args!==void 0)return e.args;if(e.arguments!==void 0)return e.arguments;if(e.input!==void 0)return e.input;const t=Ji(e.command),n=Ji(e.cwd);if(t||n)return{...t?{command:t}:{},...n?{cwd:n}:{}};if(e.changes!==void 0)return{changes:e.changes};if(e.approval!==void 0)return e.approval}function py(e,t,n,i,r){return{kind:"tool",name:e,callId:t,args:i,response:r,done:n!=="running",status:n,...n==="failed"?{defaultOpen:!0}:{}}}function Kje(e){const t=Ji(e.id||e.itemId||e.item_id),n=Ji(e.kind);if(!t||!n)return null;const i=vV(e.status),r=Ji(e.text||e.detail||e.delta),s=!Ji(e.text||e.detail)&&typeof e.delta=="string";if(n==="thinking"||n==="reasoning")return r?{id:t,block:{kind:"thinking",text:r,done:i!=="running",thoughtKind:n==="reasoning"?"reasoning":"thought"},appendText:s}:null;if(n==="commentary")return r?{id:t,block:{kind:"text",text:r},appendText:s}:null;if(["message","text","assistant_final","final"].includes(n))return r?{id:t,block:{kind:"text",text:r},appendText:s,finalAnswer:!0}:null;if(n==="plan"){const o=Array.isArray(e.plan)?e.plan:[];return{id:t,block:{kind:"plan",title:Ji(e.title)||Ko("planTitle"),summary:r||void 0,items:o.flatMap(l=>{const c=wu(l),u=Ji(c==null?void 0:c.text);if(!u)return[];const d=Ji(c==null?void 0:c.status);return[{text:u,status:["pending","in_progress","completed","failed"].includes(d)?d:"pending"}]}),done:i!=="running"}}}if(["tool","command","command_execution","commandExecution","file_change","fileChange","mcp_tool_call","mcpToolCall","collab_tool_call","web_search","approval","status"].includes(n)){const o=Ko(n==="file_change"||n==="fileChange"?"fallback.fileChange":n==="approval"?"fallback.approval":n==="status"?"fallback.status":"fallback.command"),l=Wje(e),c=qje(e)??(n==="status"&&r||void 0);return{id:t,block:py(Ji(e.name||e.title)||o,t,i,l,c)}}return null}function Gje(e){const t=Ji(e.type),n=wu(e.item),i=Ji(n==null?void 0:n.type),r=Ji((n==null?void 0:n.id)||e.id)||(t==="turn.failed"?"turn":"");if(!r)return null;const s=vV(n==null?void 0:n.status,t);if(i==="reasoning"||i==="agent_message"){const o=Ji(n==null?void 0:n.text);return o?{id:r,block:i==="reasoning"?{kind:"thinking",text:o,done:s!=="running",thoughtKind:"reasoning"}:{kind:"text",text:o},...i==="agent_message"&&(n==null?void 0:n.phase)!=="commentary"?{finalAnswer:!0}:{}}:null}if(i==="todo_list"){const l=(Array.isArray(n==null?void 0:n.items)?n.items:[]).flatMap(c=>{const u=wu(c),d=Ji(u==null?void 0:u.text);if(!d)return[];const f=Ji(u==null?void 0:u.status).toLowerCase(),h=(u==null?void 0:u.completed)===!0||["completed","done"].includes(f)?"completed":["failed","error"].includes(f)?"failed":["in_progress","running"].includes(f)?"in_progress":"pending";return[{text:d,status:h}]});return l.length?{id:r,block:{kind:"plan",title:Ko("planTitle"),summary:Ko("planSummary",{completed:l.filter(c=>c.status==="completed").length,total:l.length}),items:l,done:s!=="running"}}:null}if(i==="command_execution"){const o=Ko(`command.${s}`);return{id:r,block:py(o,r,s,Wje(n??{}),qje(n??{}))}}if(i==="file_change"){const o=Array.isArray(n==null?void 0:n.changes)?n.changes:[],l=o.length?Ko("projectFiles",{count:o.length}):Ko("projectFile"),c=Ko(`fileChange.${s}`,{subject:l});return{id:r,block:py(c,r,s,o.length?{changes:o}:void 0)}}if(i==="mcp_tool_call"){const o=[Ji(n==null?void 0:n.server),Ji(n==null?void 0:n.tool)].filter(Boolean).join("/")||Ko("externalTool"),l=Ko(`mcp.${s}`,{tool:o}),c=wu(n==null?void 0:n.error),u=(n==null?void 0:n.result)!==void 0?n.result:Ji(c==null?void 0:c.message)||void 0;return{id:r,block:py(l,r,s,n==null?void 0:n.arguments,u)}}if(i==="collab_tool_call"){const o=Ji(n==null?void 0:n.tool),l=["spawn_agent","send_input","wait","close_agent"].includes(o)?o:"default",c=Ko(`collaboration.${l}.${s}`),u=Object.fromEntries(["tool","receiver_thread_ids","prompt"].filter(d=>(n==null?void 0:n[d])!==void 0).map(d=>[d,n==null?void 0:n[d]]));return{id:r,block:py(c,r,s,Object.keys(u).length?u:void 0,n==null?void 0:n.agents_states)}}if(i==="web_search"){const o=Ko(`webSearch.${s}`),l=Object.fromEntries(["query","action"].filter(c=>(n==null?void 0:n[c])!==void 0).map(c=>[c,n==null?void 0:n[c]]));return{id:r,block:py(o,r,s,Object.keys(l).length?l:void 0)}}if(i==="error"||t==="error"||t==="turn.failed"){const o=wu(e.error),l=Ji((n==null?void 0:n.message)||e.message||(o==null?void 0:o.message))||Ko("errorDetail");return{id:r,block:py(Ko("errorTitle"),r,"failed",void 0,l)}}return null}function mot(e){const t=wu(e),n=wu(t==null?void 0:t.veadkStudioToolProgress);if(!n||n.kind!=="codex")return null;const i=Ji(n.toolName),r=Ji(n.requestId);if(!i||!r)return null;const s=wu(n.event??n.activity);if(!s)return null;const o=wu(s.item)||Ji(s.type)?Gje(s):Kje(s);if(!o)return null;const l=Ji(n.title||n.label),c=Ji(s.agentSessionId??s.agent_session_id),u=Ji(s.sandboxSessionId??s.sandbox_session_id),d=Ji(s.threadId??s.thread_id),f=vV(s.status,Ji(s.type)),m=Ji(s.kind)==="status"&&f!=="running"?f:void 0;return{toolName:i,requestId:r,...l?{title:l}:{},...c?{agentSessionId:c}:{},...u?{sandboxSessionId:u}:{},...d?{threadId:d}:{},...m?{terminalStatus:m}:{},event:o}}function got(e,t){const n=wu(t),i=wu((n==null?void 0:n.codexActivity)??(n==null?void 0:n.codex_activity));if(!i)return e;const r=Ji(i.title)||(e==null?void 0:e.title)||"Codex Sandbox",s=Ji(i.agentSessionId??i.agent_session_id)||(e==null?void 0:e.agentSessionId),o=Ji(i.sandboxSessionId??i.sandbox_session_id)||(e==null?void 0:e.sandboxSessionId),l=Ji(i.threadId??i.thread_id)||(e==null?void 0:e.threadId);let c={title:r,...s?{agentSessionId:s}:{},...o?{sandboxSessionId:o}:{},...l?{threadId:l}:{},items:(e==null?void 0:e.items.slice())??[]};const u=Array.isArray(i.events)?i.events:[];for(const d of u){const f=wu(d);if(!f)continue;const h=wu(f.item)||Ji(f.type)?Gje(f):Kje(f);h&&(h.finalAnswer||(c=lB(c,{title:r,...s?{agentSessionId:s}:{},...o?{sandboxSessionId:o}:{},...l?{threadId:l}:{},event:h})))}return c}function lB(e,t){const n=(e==null?void 0:e.items.slice())??[],i=n.findIndex(r=>r.id===t.event.id);if(i>=0){const r=n[i].block,s=t.event.block;t.event.appendText&&r.kind==="text"&&s.kind==="text"?n[i]={id:t.event.id,block:{...s,text:r.text+s.text}}:t.event.appendText&&r.kind==="thinking"&&s.kind==="thinking"?n[i]={id:t.event.id,block:{...s,text:r.text+s.text}}:n[i]={id:t.event.id,block:s}}else n.push({id:t.event.id,block:t.event.block});return{title:t.title||(e==null?void 0:e.title)||"Codex Sandbox",...t.agentSessionId||e!=null&&e.agentSessionId?{agentSessionId:t.agentSessionId||(e==null?void 0:e.agentSessionId)}:{},...t.sandboxSessionId||e!=null&&e.sandboxSessionId?{sandboxSessionId:t.sandboxSessionId||(e==null?void 0:e.sandboxSessionId)}:{},...t.threadId||e!=null&&e.threadId?{threadId:t.threadId||(e==null?void 0:e.threadId)}:{},items:pot(n)}}const cB="send_a2ui_json_to_client",uB="validated_a2ui_json",yN="adk_request_credential",Q3="transfer_to_agent";function bot(e){var i,r,s,o;const t=e,n=((i=t==null?void 0:t.exchangedAuthCredential)==null?void 0:i.oauth2)??((r=t==null?void 0:t.exchanged_auth_credential)==null?void 0:r.oauth2)??((s=t==null?void 0:t.rawAuthCredential)==null?void 0:s.oauth2)??((o=t==null?void 0:t.raw_auth_credential)==null?void 0:o.oauth2);return(n==null?void 0:n.authUri)??(n==null?void 0:n.auth_uri)}function dB(){return{blocks:[],liveStart:0,pendingCodexProgress:[]}}const yot=2048;function eee(e,t){if(t.event.finalAnswer)return"applied";let n=-1;for(let i=e.length-1;i>=0;i-=1){const r=e[i];if(!(r.kind!=="tool"||r.name!==t.toolName)){if(r.callId===t.requestId)return r.done?"completed":(r.codexActivity=lB(r.codexActivity,t),r.status=t.terminalStatus??"running",t.terminalStatus&&(r.done=!0),"applied");if(!r.done){if(n>=0)return"unmatched";n=i}}}if(n>=0){const i=e[n];return i.kind!=="tool"?"unmatched":(i.codexActivity=lB(i.codexActivity,t),i.status=t.terminalStatus??"running",t.terminalStatus&&(i.done=!0),"applied")}return"unmatched"}function vot(e){if(!e||typeof e!="object"||Array.isArray(e))return"completed";const t=e,n=typeof t.status=="string"?t.status.toLowerCase():"";return t.ok===!1||["error","failed","denied","declined","cancelled","timeout"].includes(n)?"failed":"completed"}function tee(e){if(!e||typeof e!="object"||Array.isArray(e))return"";const t=e;return t.ok!==!0||typeof t.message!="string"?"":t.message.trim()}const pC=e=>e.functionCall??e.function_call,eb=e=>e.functionResponse??e.function_response;function H1(e){const t=e.customMetadata??e.custom_metadata;return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}function xot(e,t){const n=e[t];return n&&typeof n=="object"&&!Array.isArray(n)?n:{}}function sg(e,t){const n=e[t];return typeof n=="string"?n:""}function Xje(e){return xot(H1(e),"mpa")}function xV(e){const t=H1(e),n=Xje(e);return sg(t,"eventType")||sg(t,"event_type")||sg(n,"eventType")||sg(n,"event_type")||sg(n,"kind")}function aw(e){const t=H1(e),n=Xje(e);return sg(t,"source")==="sandbox"||sg(n,"source")==="sandbox"}function Yje(e){const t=xV(e);return t==="usage.updated"||t==="usage"}function hI(e){var t;return(((t=e.content)==null?void 0:t.parts)??[]).some(n=>{const i=eb(n),r=i==null?void 0:i.response;return(i==null?void 0:i.name)==="sandbox_task"&&r&&typeof r=="object"&&!Array.isArray(r)&&r.finalAlreadyEmitted===!0})}function nee(e){for(const t of e)t.kind!=="tool"||t.name!=="sandbox_task"||t.done||(t.done=!0,t.status="completed")}function wot(e,t){if(e===t)return!0;const n=new Set(["exec_command","commandExecution","command_execution","Run command"]);return n.has(e)&&n.has(t)}function iee(e,t=!1){const n=e&&typeof e=="object"?String(e.status??"").toLowerCase():"",i=["failed","error","cancelled","denied","timeout"].includes(n)||(e==null?void 0:e.ok)===!1,r=["running","started","working"].includes(n);return{done:i||!(t||r),status:i?"failed":t||r?"running":"completed"}}function Oot(e){return e.flatMap(t=>{var n;return t.kind!=="tool"||t.name!=="delegate_to_codex_sandbox"||!((n=t.codexActivity)!=null&&n.items.length)?[t]:[{kind:"activity-source",label:t.codexActivity.title||"Codex Sandbox"},...t.codexActivity.items.map(({block:i})=>i.kind==="tool"?{...i,source:"codex-sandbox"}:i)]})}function kot(e){if(!e||typeof e!="object")return"";const t=e,n=t.agentName??t.agent_name;return typeof n=="string"?n:""}function Sot(e){return e.replace(/-/g,"+").replace(/_/g,"/")}function qA(e){const t=[];for(const[n,i]of e.entries()){const r=i.partMetadata??i.part_metadata,s=r==null?void 0:r.veadkTransport;if((s==null?void 0:s.hidden)===!0)continue;const o=r==null?void 0:r.veadkMedia;if(typeof(o==null?void 0:o.uri)=="string"){t.push({id:String(o.id??o.uri),mimeType:typeof o.mimeType=="string"?o.mimeType:void 0,uri:o.uri,name:typeof o.name=="string"?o.name:void 0,sizeBytes:typeof o.sizeBytes=="number"?o.sizeBytes:void 0});continue}const l=i.inlineData??i.inline_data;if(l&&l.data){t.push({id:`inline-${n}-${l.displayName??l.display_name??"media"}`,mimeType:l.mimeType??l.mime_type,data:Sot(l.data),name:l.displayName??l.display_name});continue}const c=i.fileData??i.file_data,u=(c==null?void 0:c.fileUri)??(c==null?void 0:c.file_uri);c&&u&&t.push({id:u,mimeType:c.mimeType??c.mime_type,uri:u,name:c.displayName??c.display_name})}return t}function Gy(e){const t=e.partMetadata??e.part_metadata,n=t==null?void 0:t.veadkTransport;return(n==null?void 0:n.hideText)===!0?void 0:e.text}const Eot=new Set(["llm","sequential","parallel","loop","a2a"]);function Cot(e){var t;for(const n of e){const i=(t=n.partMetadata??n.part_metadata)==null?void 0:t.veadkInvocation;if(!i||typeof i!="object")continue;const r=i,s=Array.isArray(r.skills)?r.skills.flatMap(c=>{if(!c||typeof c!="object")return[];const u=c;return typeof u.name=="string"?[{name:u.name,description:typeof u.description=="string"?u.description:""}]:[]}):[];let o;const l=r.targetAgent;if(l&&typeof l=="object"){const c=l,u=c.type;typeof c.name=="string"&&typeof u=="string"&&Eot.has(u)&&Array.isArray(c.path)&&(o={name:c.name,description:typeof c.description=="string"?c.description:"",type:u,path:c.path.filter(d=>typeof d=="string")})}if(s.length>0||o)return{skills:s,targetAgent:o}}}function Aot(e,t){if(!t.length)return;const n=e[e.length-1];(n==null?void 0:n.kind)==="attachment"?n.files.push(...t):e.push({kind:"attachment",files:t})}function Tot(e,t){if(!t.length)return;const n=e[e.length-1];if((n==null?void 0:n.kind)==="artifact"){for(const i of t)n.files.some(r=>r.filename===i.filename&&r.version===i.version)||n.files.push(i);return}e.push({kind:"artifact",files:t})}function z3(e,t,n,i){const r=e[e.length-1];r&&r.kind===t&&(r.kind!=="thinking"||r.thoughtKind===i)?r.text+=n:e.push(t==="thinking"?{kind:t,text:n,done:!1,thoughtKind:i}:{kind:t,text:n})}function V3(e){const t=e.customMetadata??e.custom_metadata;if(t&&typeof t=="object"){const n=t.thoughtKind;if(n==="reasoning"||n==="thought")return n}return"reasoning"}function fk(e){for(const t of e)t.kind==="thinking"&&(t.done=!0)}function Zje(e,t,n={}){var h,m,g,b,v,y;const i=e.blocks.map(w=>({...w}));let r=e.liveStart,s=e.pendingCodexProgress.slice();if(Yje(t)&&!n.mpaA2a)return{blocks:i,liveStart:r,pendingCodexProgress:s};if(hI(t))return nee(i),fk(i),{blocks:i,liveStart:r,pendingCodexProgress:s};const o=((h=t.content)==null?void 0:h.parts)??[],l=o.flatMap(w=>{const x=fot(w.partMetadata??w.part_metadata);return x?[x]:[]}),c=o.flatMap(w=>{const x=mot(w.partMetadata??w.part_metadata);return x?[x]:[]});if(l.length>0||c.length>0){for(const w of l)for(let x=i.length-1;x>=0;x-=1){const O=i[x];if(!(O.kind!=="tool"||O.done||O.name!==w.toolName||w.requestId&&O.callId&&O.callId!==w.requestId)){O.response=hot(O.args,O.response,w),O.status="running";break}}for(const w of c)eee(i,w)==="unmatched"&&(s=[...s,w].slice(-64));return{blocks:i,liveStart:r,pendingCodexProgress:s}}const u=o.some(w=>pC(w)||eb(w));if(t.partial&&!u){for(const w of o){const x=Gy(w),O=n.mpaA2a&&w.thought?sg(H1(t),"reasoningSegmentId"):"";if(O&&typeof x=="string"&&x){const k=i.find(S=>S.kind==="thinking"&&S.reasoningSegmentId===O);(k==null?void 0:k.kind)==="thinking"?k.text+=x:i.push({kind:"thinking",text:x,done:!1,thoughtKind:V3(t),reasoningSegmentId:O});continue}typeof x=="string"&&x&&z3(i,w.thought?"thinking":"text",x,w.thought?V3(t):void 0)}return{blocks:i,liveStart:r,pendingCodexProgress:s}}const d=n.mpaA2a&&!o.some(w=>w.thought&&Gy(w))?i.slice(r).filter(w=>w.kind==="thinking"):[];i.length=r,i.push(...d);for(const w of o){const x=pC(w),O=eb(w),k=qA([w]),S=Gy(w);if(typeof S=="string"&&S)z3(i,w.thought?"thinking":"text",S,w.thought?V3(t):void 0);else if(k.length)fk(i),Aot(i,k);else if(x)if(fk(i),x.name===Q3){const C=kot(x.args)||((m=t.actions)==null?void 0:m.transferToAgent)||((g=t.actions)==null?void 0:g.transfer_to_agent)||bn.t("app:common.unknownAgent");i.push({kind:"agent-transfer",agentName:C,done:!1})}else{if(x.name==="sandbox_task"&&aw(t))continue;if(x.name===yN){const C=x.args??{},E=C.authConfig??C.auth_config??C,T=String(C.functionCallId??C.function_call_id??"").replace(/^_adk_toolset_auth_/,"")||void 0;i.push({kind:"auth",callId:x.id??"",label:T,authUri:bot(E),authConfig:E,done:!1})}else{const C=x.id?[...i].reverse().find(j=>j.kind==="tool"&&j.callId===x.id):void 0;if((C==null?void 0:C.kind)==="tool"){C.name=x.name??C.name,C.args=x.args??C.args,C.response===void 0&&(C.done=!1,C.status="running");continue}const E={kind:"tool",name:x.name??"",callId:x.id,args:x.args,done:!1};if(i.push(E),E.callId){const j=[];for(const T of s)T.toolName===E.name&&T.requestId===E.callId?eee(i,T):j.push(T);s=j}}}else if(O){if(fk(i),O.name===Q3)for(let E=i.length-1;E>=0;E--){const j=i[E];if(j.kind==="agent-transfer"&&!j.done){j.done=!0;break}}if(O.name===yN)for(let E=i.length-1;E>=0;E--){const j=i[E];if(j.kind==="auth"&&!j.done){j.done=!0;break}}let C=!1;for(let E=i.length-1;E>=0;E--){const j=i[E],T=j.kind==="tool"&&j.name==="delegate_to_codex_sandbox";if(j.kind==="tool"&&(!j.done||T||O.id&&j.callId===O.id)&&(O.id&&j.callId&&j.callId===O.id||(!O.id||!j.callId)&&wot(j.name,O.name??""))){const R=T?tee(j.response):"",A=iee(O.response,t.partial===!0);if(j.done=A.done,j.response=O.response,j.status=A.status,T){j.codexActivity=got(j.codexActivity,O.response),j.status=A.status==="running"?"running":vot(O.response);const N=tee(O.response);N&&N!==R&&z3(i,"text",N)}C=!0;break}}if(!C&&O.name!==Q3&&O.name!==yN&&O.name!==cB){const E=iee(O.response,t.partial===!0);i.push({kind:"tool",name:O.name??"",callId:O.id,response:O.response,done:E.done,status:E.status})}if(O.name===cB){const E=((b=O.response)==null?void 0:b[uB])??[];if(E.length){const j=i[i.length-1];j&&j.kind==="a2ui"?j.messages.push(...E):i.push({kind:"a2ui",messages:E})}}}}const f=((v=t.actions)==null?void 0:v.artifactDelta)??((y=t.actions)==null?void 0:y.artifact_delta);return f&&Tot(i,Object.entries(f).map(([w,x])=>({filename:w,version:x}))),aw(t)&&xV(t)==="invocation.completed"&&nee(i),fk(i),r=i.length,{blocks:i,liveStart:r,pendingCodexProgress:s}}function _ot(e,t){var u,d,f,h,m,g;if(e.partial===!0)return!1;if(hI(e))return!0;const n=((u=e.content)==null?void 0:u.parts)??[],i=n.some(b=>{const v=Gy(b);return!b.thought&&typeof v=="string"&&v.trim().length>0||qA([b]).length>0}),r=n.some(b=>{var y;const v=eb(b);return(v==null?void 0:v.name)===cB&&Array.isArray((y=v.response)==null?void 0:y[uB])&&v.response[uB].length>0}),s=((d=e.actions)==null?void 0:d.artifactDelta)??((f=e.actions)==null?void 0:f.artifact_delta),o=!!(s&&Object.keys(s).length>0),l=!!(((h=e.actions)==null?void 0:h.endOfAgent)??((m=e.actions)==null?void 0:m.end_of_agent)??((g=e.actions)==null?void 0:g.escalate)),c=t.some(b=>b.kind==="text"||b.kind==="attachment"||b.kind==="artifact"||b.kind==="a2ui"||b.kind==="delivery");return i||r||o||l&&c}function Jje(e){var n;const t=(n=e.customMetadata??e.custom_metadata)==null?void 0:n.a2aStatus;return typeof t=="string"?t:void 0}function ree(e){var n,i,r;if(Jje(e))return!0;const t=((n=e.actions)==null?void 0:n.artifactDelta)??((i=e.actions)==null?void 0:i.artifact_delta);return t&&Object.keys(t).length>0?!0:(((r=e.content)==null?void 0:r.parts)??[]).some(s=>!!(Gy(s)||qA([s]).length>0||pC(s)||eb(s)))}function jot(e,t){var o;const n=H1(t),i=((o=t.content)==null?void 0:o.parts)??[];if(t.partial!==!1||n.projectionSource!=="a2a-artifact"||aw(t)||!i.length||t.actions||!i.every(l=>l.thought&&typeof l.text=="string"&&!pC(l)&&!eb(l)&&qA([l]).length===0))return e;const r=e.blocks[e.blocks.length-1],s=i.map(l=>l.text).join("").trim();return(r==null?void 0:r.kind)!=="thinking"||!r.text.trim()||!s.startsWith(r.text.trim())?e:{...e,liveStart:e.blocks.length-1}}function Not(e,t,n,i){const r=e[t];if(!r||r.role!=="assistant"||i.turnIsStreaming||n(r))return!1;if(!i.mpaA2a)return!0;let s=t;for(;s>0&&e[s-1].role!=="user";)s-=1;let o=t+1;for(;oc.blocks.length>0)}function Rot(e){var t,n;return e.author!=="user"&&((t=e.content)==null?void 0:t.role)!=="user"?!1:!(((n=e.content)==null?void 0:n.parts)??[]).some(i=>pC(i)||eb(i))}function vN(e="adk-stream",t,n={}){var h,m,g,b;let i=0;const r=new Map,s=new Set,o=[];let l,c,u={...(h=t==null?void 0:t.meta)==null?void 0:h.mpaUsage};const d=v=>{if(!n.mpaA2a||!(v.usageMetadata??v.usage_metadata))return!1;const y=yV(rE,v).current.totalTokenCount;if(!y)return!1;const w=H1(v),x=JSON.stringify([w.source??"outer",w.requestId??"",v.invocationId??v.invocation_id??"",v.id||JSON.stringify(v.usageMetadata??v.usage_metadata)]);return Object.prototype.hasOwnProperty.call(u,x)?!1:(u={...u,[x]:y},!0)},f=(v,y)=>`${y}\0${v}`;if((t==null?void 0:t.role)==="assistant"){const v=((m=t.meta)==null?void 0:m.author)??"",y=((g=t.meta)==null?void 0:g.invocationId)??"",w=((b=t.meta)==null?void 0:b.localId)??`${e}-${i++}`,x=dB();x.blocks=t.blocks,x.liveStart=t.blocks.length,l=f(v,y),r.set(l,{acc:x,localId:w,meta:{...t.meta,localId:w,streaming:!0,eventId:void 0}})}return{project(v){var R,A,N;if(Rot(v))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};const y=d(v);if(n.mpaA2a&&!ree(v)&&!((A=(R=v.content)==null?void 0:R.parts)!=null&&A.length))return y&&c?(c={...c,meta:{...c.meta,mpaUsage:u}},{turn:c,completed:!1}):{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(Yje(v)&&!n.mpaA2a)return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(v.id&&s.has(v.id))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};v.id&&(s.add(v.id),o.push(v.id),o.length>yot&&s.delete(o.shift()));const w=v.author&&v.author!=="user"?v.author:"",x=v.invocationId??v.invocation_id??"";let O=aw(v)?"":w,k=f(O,x),S=r.get(k);if(!S&&aw(v)&&x){const P=[...r.entries()].find(([I])=>I.startsWith(`${x}\0`));P&&(k=P[0],S=P[1],O=S.meta.author??"")}if(!S&&l){const P=r.get(l);P&&(!P.meta.author||P.meta.author===O)&&(r.delete(l),l=void 0,S=P)}if(!S&&hI(v))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(!S&&!ree(v))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(!S){const P=`${e}-${i++}`;S={acc:dB(),localId:P,meta:{author:O||void 0,invocationId:x||void 0}}}S.acc=Zje(n.mpaA2a?jot(S.acc,v):S.acc,v,n);const C=v.usageMetadata??v.usage_metadata,E=_ot(v,S.acc.blocks);S.meta={...S.meta,author:O||S.meta.author,localId:S.localId,streaming:!E,a2aStatus:Jje(v),tokens:(C==null?void 0:C.totalTokenCount)||S.meta.tokens,...n.mpaA2a?{mpaUsage:u,mpaFinalAnswer:aw(v)&&xV(v)==="invocation.completed"?(((N=v.content)==null?void 0:N.parts)??[]).filter(P=>!P.thought).map(P=>Gy(P)??"").join("").trim()||void 0:S.meta.mpaFinalAnswer}:{},ts:v.timestamp||S.meta.ts,invocationId:x||S.meta.invocationId,eventId:E&&v.id?v.id:S.meta.eventId};const j={role:"assistant",blocks:S.acc.blocks,meta:S.meta},T=E&&hI(v);return E&&!T?(r.delete(k),l=void 0):r.set(k,S),n.mpaA2a&&(c=j),{turn:j,completed:E}},finish(){const v=[...r.values()].map(y=>({role:"assistant",blocks:y.acc.blocks.map(w=>w.kind==="thinking"?{...w,done:!0}:w),meta:{...y.meta,streaming:!1,...n.mpaA2a?{mpaUsage:u}:{}}}));return r.clear(),v}}}function Ty(e,t){var s;const n=(s=t.meta)==null?void 0:s.localId;if(!n)return[...e,t];const i=e.findIndex(o=>{var l;return((l=o.meta)==null?void 0:l.localId)===n});if(i<0)return[...e,t];const r=e.slice();return r[i]=t,r}function see(e,t={},n={}){var l;let i=[],r=0;const s=()=>vN(`adk-history-${r++}`,void 0,n);let o=s();for(const c of e)if(c.author==="user"){const d=((l=c.content)==null?void 0:l.parts)??[];if(d.some(b=>{var v;return((v=eb(b))==null?void 0:v.name)===yN})){for(let b=i.length-1;b>=0;b--)if(i[b].role==="assistant"){for(let v=i[b].blocks.length-1;v>=0;v--){const y=i[b].blocks[v];if(y.kind==="auth"){y.done=!0;break}}break}}const f=d.map(Gy).filter(b=>!!b).join(""),h=qA(d),m=Cot(d);if(!f&&!h.length&&!m)continue;for(const b of o.finish())i=Ty(i,b);const g=[];m&&g.push({kind:"invocation",value:m}),h.length&&g.push({kind:"attachment",files:h}),f&&g.push({kind:"text",text:f}),i.push({role:"user",blocks:g,meta:{ts:c.timestamp}}),o=s()}else{const d=o.project(c);d.ignored||(i=Ty(i,d.turn))}for(const c of o.finish())i=Ty(i,c);for(const c of i){const u=c.meta,d=u==null?void 0:u.eventId;if(!d)continue;const f=t[`veadk_feedback:${d}`];if(!f||typeof f!="object")continue;const h=f;h.rating!=="good"&&h.rating!=="bad"||(u.feedback=f)}return i}function iM(e,t=bn.t("app:titles.newConversation")){var n,i;for(const r of e??[])if(r.author==="user"||((n=r.content)==null?void 0:n.role)==="user"){const s=(((i=r.content)==null?void 0:i.parts)??[]).map(o=>o.text).find(Boolean);if(s)return s}return t}function Iot(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return e[t]}function Pot(e,t,n){var s;if(!n||!t.some(o=>{var l;return o.role==="assistant"&&((l=o.meta)==null?void 0:l.eventId)===n}))return e;const r=Iot(e);return((s=r==null?void 0:r.meta)==null?void 0:s.eventId)!==n?e:t}function eNe(e,t,n){if(e.name===t||e.id===t)return(n==null?void 0:n.type)==="parallel"?n:void 0;for(const i of e.children){const r=eNe(i,t,e);if(r)return r}}function Dot(e,t){var o,l;if(e.role!=="assistant"||!t)return;const n=(o=e.meta)==null?void 0:o.author;if(!n)return;const i=eNe(t,n);if(!i)return;const r=i.id||i.path.join("/")||i.name;return{key:`${((l=e.meta)==null?void 0:l.invocationId)??""}::${r}`,parent:i.name}}function Mot(e,t){const n=[];return e.forEach((i,r)=>{const s=Dot(i,t),o=n[n.length-1];if(s&&(o==null?void 0:o.groupKey)===s.key){o.turnIndexes.push(r);return}n.push({key:s?`parallel-${s.key}-${r}`:`turn-${r}`,turnIndexes:[r],parallelParent:s==null?void 0:s.parent,groupKey:s==null?void 0:s.key})}),n.map(({groupKey:i,...r})=>r)}function Lot(e,t,n){var r,s,o,l,c;if(!t)return e;const i=[];for(let u=0;u{var k;return(k=O.meta)!=null&&k.mpaFinalAnswer?[O.meta.mpaFinalAnswer.trim()]:[]})),m=f.map(O=>{var S;const k=O.blocks.filter(C=>C.kind==="text").map(C=>C.text).join("").trim();return!((S=O.meta)!=null&&S.mpaFinalAnswer)&&k&&h.has(k)?{...O,blocks:O.blocks.filter(C=>C.kind!=="text")}:O}),g=[...m].reverse().find(O=>O.blocks.some(k=>k.kind==="text"&&k.text.trim()))??f[f.length-1],b={},v=new Map,y=f.some(O=>{var k;return(k=O.meta)==null?void 0:k.mpaUsage});for(const O of f){for(const[S,C]of Object.entries(((r=O.meta)==null?void 0:r.mpaUsage)??{}))b[S]=Math.max(b[S]??0,C);const k=(s=O.meta)==null?void 0:s.tokens;if(typeof k=="number"&&Number.isFinite(k)&&k>=0){const S=((o=O.meta)==null?void 0:o.invocationId)||"unidentified";v.set(S,Math.max(v.get(S)??0,k))}}const w=y?Object.values(b):[...v.values()],x=f.flatMap(O=>{var k;return(k=O.meta)!=null&&k.ts?[O.meta.ts]:[]});i.push({role:"assistant",blocks:m.flatMap(O=>O.blocks),meta:{...g.meta,localId:(l=d.meta)==null?void 0:l.localId,author:void 0,streaming:u===e.length&&n||f.some(O=>{var k;return((k=O.meta)==null?void 0:k.streaming)===!0}),a2aStatus:(c=f[f.length-1].meta)==null?void 0:c.a2aStatus,ts:x.length?Math.max(...x):void 0,tokens:w.length?w.reduce((O,k)=>O+k,0):void 0,...y?{mpaUsage:b}:{}}})}return i}function $ot(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"9",cy:"8",r:"3.25"}),a.jsx("path",{d:"M2.75 20v-1.5a6.25 6.25 0 0 1 12.5 0V20M16 5.25a3.25 3.25 0 0 1 0 6.5M18 14a5.5 5.5 0 0 1 3.25 5V20"})]})}function tNe(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t{const t=p.Children.toArray(e),n=[];let i="";const r=()=>{i!==""&&(n.push(i),i="")};for(const s of t)if(!(s==null||typeof s=="boolean")){if(typeof s=="string"||typeof s=="number"){i+=String(s);continue}r(),n.push(s)}return r(),n},wV=e=>{const t=Fot(e),n=p.Children.count(t);return p.Children.map(t,i=>{if(typeof i=="string"&&i.trim())return n<=1?i:a.jsx("span",{children:i});if(p.isValidElement(i)){const r=i,{children:s,...o}=r.props;return s!=null?p.cloneElement(r,o,wV(s)):r}return i})},Bot="_Badge_1viyg_1",Uot={Badge:Bot},Ya=({children:e,className:t,variant:n="soft",color:i="secondary",size:r="sm",pill:s,...o})=>a.jsx("div",{className:Ui(Uot.Badge,t),"data-color":i,"data-size":r,"data-pill":s?"":void 0,"data-variant":n,...o,children:wV(e)});var Qot=typeof cg=="object"&&cg&&cg.Object===Object&&cg,zot=typeof self=="object"&&self&&self.Object===Object&&self;Qot||zot||Function("return this")();var Vot=typeof window<"u"?p.useLayoutEffect:p.useEffect;function Hot(){const e=p.useRef(!1);return p.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),p.useCallback(()=>e.current,[])}var aee={width:void 0,height:void 0};function nNe(e){const{ref:t,box:n="content-box"}=e,[{width:i,height:r},s]=p.useState(aee),o=Hot(),l=p.useRef({...aee}),c=p.useRef(void 0);return c.current=e.onResize,p.useEffect(()=>{if(!t.current||typeof window>"u"||!("ResizeObserver"in window))return;const u=new ResizeObserver(([d])=>{const f=n==="border-box"?"borderBoxSize":n==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",h=oee(d,f,"inlineSize"),m=oee(d,f,"blockSize");if(l.current.width!==h||l.current.height!==m){const b={width:h,height:m};l.current.width=h,l.current.height=m,c.current?c.current(b):o()&&s(b)}});return u.observe(t.current,{box:n}),()=>{u.disconnect()}},[n,t,o]),{width:i,height:r}}function oee(e,t,n){return e[t]?Array.isArray(e[t])?e[t][0][n]:e[t][n]:t==="contentBoxSize"?e.contentRect[n==="inlineSize"?"width":"height"]:void 0}function OV(e,t){const n=p.useRef(e);Vot(()=>{n.current=e},[e]),p.useEffect(()=>{if(!t&&t!==0)return;const i=setTimeout(()=>{n.current()},t);return()=>{clearTimeout(i)}},[t])}const qot={DEV:!1,MODE:"production"},ow=typeof import.meta<"u"?qot:void 0,Wot=!!(ow!=null&&ow.DEV),Kot=typeof navigator<"u"&&/(jsdom|happy-dom)/i.test(navigator.userAgent)||typeof globalThis.happyDOM=="object",iNe=(ow==null?void 0:ow.MODE)==="test"||Kot,Got=typeof window<"u",rNe=typeof document<"u",Xot=Got&&rNe,kV=e=>{const t=e.currentTarget;if(!(t instanceof HTMLElement))return;const n=t.offsetWidth;let i=.985;n<=80?i=.96:n<=150?i=.97:n<=220?i=.98:n>600&&(i=.995),t.style.setProperty("--scale",i.toString())},pI=(e,t)=>{const n=()=>{const o=setTimeout(e);return()=>{clearTimeout(o)}};if(!Xot||typeof window.requestAnimationFrame!="function"||rNe&&document.visibilityState==="hidden")return n();let r=2,s=window.requestAnimationFrame(function o(){r-=1,r===0?e():s=window.requestAnimationFrame(o)});return()=>{typeof window.cancelAnimationFrame=="function"&&window.cancelAnimationFrame(s)}},z0=e=>Object.keys(e).reduce((n,i)=>{const r=e[i];if(r||r===0){const s=i.startsWith("--")?"":"--",o=typeof r=="number"?`${r}px`:r;n[`${s}${i}`]=o}return n},{}),H3=e=>typeof e=="number"?`${e}deg`:e,q3=e=>String(e),o_=e=>`${e}ms`,W3=({x:e,y:t,scale:n,rotate:i,skewX:r,skewY:s}={})=>{const o=[e==null?null:`translateX(${e}px)`,t==null?null:`translateY(${t}px)`,n==null?null:`scale(${n})`,i==null?null:`rotate(${H3(i)})`,r==null?null:`skewX(${H3(r)})`,s==null?null:`skewY(${H3(s)})`].filter(Boolean);return o.length?o.join(" "):"none"},K3=({blur:e}={})=>{const t=[e==null?null:`blur(${e}px)`].filter(Boolean);return t.length?t.join(" "):"none"},Dp=e=>{e.preventDefault()},sNe=e=>e.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex^="-"]), [contenteditable]'),Yot="_LoadingIndicator_7yl6f_1",Zot={LoadingIndicator:Yot},WA=({className:e,size:t,strokeWidth:n,style:i,...r})=>a.jsx("div",{...r,className:Ui(Zot.LoadingIndicator,e),style:i||z0({"indicator-size":t,"indicator-stroke":n})});var Jot=Object.defineProperty,SV=(e,t)=>Jot(e,"name",{value:t,configurable:!0});function fB(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}SV(fB,"setRef");function aNe(...e){return t=>{let n=!1;const i=e.map(r=>{const s=fB(r,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let r=0;relt(e,"name",{value:t,configurable:!0});function Gp(e){const t=p.forwardRef((n,i)=>{let{children:r,...s}=n,o=null,l=!1;const c=[];hB(r)&&typeof l_=="function"&&(r=l_(r._payload)),p.Children.forEach(r,h=>{var m;if(fNe(h)){l=!0;const g=h;let b="child"in g.props?g.props.child:g.props.children;hB(b)&&typeof l_=="function"&&(b=l_(b._payload)),o=tlt(g,b),c.push((m=o==null?void 0:o.props)==null?void 0:m.children)}else c.push(h)}),o?o=p.cloneElement(o,void 0,c):!l&&p.Children.count(r)===1&&p.isValidElement(r)&&(o=r);const u=o?dNe(o):void 0,d=_r(i,u);if(!o){if(r||r===0)throw new Error(l?rlt(e):ilt(e));return r}const f=uNe(s,o.props??{});return o.type!==p.Fragment&&(f.ref=i?d:u),p.cloneElement(o,f)});return t.displayName=`${e}.Slot`,t}Cf(Gp,"createSlot");var oNe=Gp("Slot"),lNe=Symbol.for("radix.slottable");function cNe(e){const t=Cf(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=lNe,t}Cf(cNe,"createSlottable");var tlt=Cf((e,t)=>{if("child"in e.props){const n=e.props.child;return p.isValidElement(n)?p.cloneElement(n,void 0,e.props.children(n.props.children)):null}return p.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function uNe(e,t){const n={...t};for(const i in t){const r=e[i],s=t[i];/^on[A-Z]/.test(i)?r&&s?n[i]=(...l)=>{const c=s(...l);return r(...l),c}:r&&(n[i]=r):i==="style"?n[i]={...r,...s}:i==="className"&&(n[i]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}Cf(uNe,"mergeProps");function dNe(e){var i,r;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Cf(dNe,"getElementRef");function fNe(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===lNe}Cf(fNe,"isSlottable");var nlt=Symbol.for("react.lazy");function hB(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===nlt&&"_payload"in e&&hNe(e._payload)}Cf(hB,"isLazyComponent");function hNe(e){return typeof e=="object"&&e!==null&&"then"in e}Cf(hNe,"isPromiseLike");var ilt=Cf(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),rlt=Cf(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),l_=I0[" use ".trim().toString()],slt=Object.defineProperty,alt=(e,t)=>slt(e,"name",{value:t,configurable:!0}),olt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Xr=olt.reduce((e,t)=>{const n=Gp(`Primitive.${t}`),i=p.forwardRef((r,s)=>{const{asChild:o,...l}=r,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:s})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function EV(e,t){e&&yi.flushSync(()=>e.dispatchEvent(t))}alt(EV,"dispatchDiscreteCustomEvent");var llt=Object.defineProperty,clt=(e,t)=>llt(e,"name",{value:t,configurable:!0}),ult=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),dlt=p.forwardRef(clt(function(t,n){return a.jsx(Xr.span,{...t,ref:n,style:{...ult,...t.style}})},"VisuallyHidden")),flt=dlt,hlt=Object.defineProperty,od=(e,t)=>hlt(e,"name",{value:t,configurable:!0});function plt(e,t){const n=p.createContext(t);n.displayName=e+"Context";const i=od(s=>{const{children:o,...l}=s,c=p.useMemo(()=>l,Object.values(l));return a.jsx(n.Provider,{value:c,children:o})},"Provider");i.displayName=e+"Provider";function r(s,o={}){const{optional:l=!1}=o,c=p.useContext(n);if(c)return c;if(t!==void 0)return t;if(!l)throw new Error(`\`${s}\` must be used within \`${e}\``)}return od(r,"useContext"),[i,r]}od(plt,"createContext");function Hc(e,t=[]){let n=[];function i(s,o){const l=p.createContext(o);l.displayName=s+"Context";const c=n.length;n=[...n,o];const u=od(f=>{var y;const{scope:h,children:m,...g}=f,b=((y=h==null?void 0:h[e])==null?void 0:y[c])||l,v=p.useMemo(()=>g,Object.values(g));return a.jsx(b.Provider,{value:v,children:m})},"Provider");u.displayName=s+"Provider";function d(f,h,m={}){var y;const{optional:g=!1}=m,b=((y=h==null?void 0:h[e])==null?void 0:y[c])||l,v=p.useContext(b);if(v)return v;if(o!==void 0)return o;if(!g)throw new Error(`\`${f}\` must be used within \`${s}\``)}return od(d,"useContext"),[u,d]}od(i,"createContext");const r=od(()=>{const s=n.map(o=>p.createContext(o));return od(function(l){const c=(l==null?void 0:l[e])||s;return p.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])},"useScope")},"createScope");return r.scopeName=e,[i,pNe(r,...t)]}od(Hc,"createContextScope");function pNe(...e){const t=e[0];if(e.length===1)return t;const n=od(()=>{const i=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return od(function(s){const o=i.reduce((l,{useScope:c,scopeName:u})=>{const f=c(s)[`__scope${u}`];return{...l,...f}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}od(pNe,"composeContextScopes");var mlt=Object.defineProperty,To=(e,t)=>mlt(e,"name",{value:t,configurable:!0});function CV(e){const t=e+"CollectionProvider",[n,i]=Hc(t),[r,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=To(b=>{const{scope:v,children:y}=b,w=p.useRef(null),x=p.useRef(new Map).current;return a.jsx(r,{scope:v,itemMap:x,collectionRef:w,children:y})},"CollectionProvider");o.displayName=t;const l=e+"CollectionSlot",c=Gp(l),u=p.forwardRef((b,v)=>{const{scope:y,children:w}=b,x=s(l,y),O=_r(v,x.collectionRef);return a.jsx(c,{ref:O,children:w})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",h=Gp(d),m=p.forwardRef((b,v)=>{const{scope:y,children:w,...x}=b,O=p.useRef(null),k=_r(v,O),S=s(d,y);return p.useEffect(()=>(S.itemMap.set(O,{ref:O,...x}),()=>void S.itemMap.delete(O))),a.jsx(h,{[f]:"",ref:k,children:w})});m.displayName=d;function g(b){const v=s(e+"CollectionConsumer",b);return p.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const x=Array.from(w.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((S,C)=>x.indexOf(S.ref.current)-x.indexOf(C.ref.current))},[v.collectionRef,v.itemMap])}return To(g,"useCollection"),[{Provider:o,Slot:u,ItemSlot:m},g,i]}To(CV,"createCollection");var lee=new WeakMap,Va,hu,G3=(hu=class extends Map{constructor(n){super(n);PG(this,Va);w5(this,Va,[...super.keys()]),lee.set(this,!0)}set(n,i){return lee.get(this)&&(this.has(n)?kl(this,Va)[kl(this,Va).indexOf(n)]=n:kl(this,Va).push(n)),super.set(n,i),this}insert(n,i,r){const s=this.has(i),o=kl(this,Va).length,l=AV(n);let c=l>=0?l:o+l;const u=c<0||c>=o?-1:c;if(u===this.size||s&&u===this.size-1||u===-1)return this.set(i,r),this;const d=this.size+(s?0:1);l<0&&c++;const f=[...kl(this,Va)];let h,m=!1;for(let g=c;g=this.size&&(s=this.size-1),this.at(s)}keyFrom(n,i){const r=this.indexOf(n);if(r===-1)return;let s=r+i;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(n,i){let r=0;for(const s of this){if(Reflect.apply(n,i,[s,r,this]))return s;r++}}findIndex(n,i){let r=0;for(const s of this){if(Reflect.apply(n,i,[s,r,this]))return r;r++}return-1}filter(n,i){const r=[];let s=0;for(const o of this)Reflect.apply(n,i,[o,s,this])&&r.push(o),s++;return new hu(r)}map(n,i){const r=[];let s=0;for(const o of this)r.push([o[0],Reflect.apply(n,i,[o,s,this])]),s++;return new hu(r)}reduce(...n){const[i,r]=n;let s=0,o=r??this.at(0);for(const l of this)s===0&&n.length===1?o=l:o=Reflect.apply(i,this,[o,l,s,this]),s++;return o}reduceRight(...n){const[i,r]=n;let s=r??this.at(-1);for(let o=this.size-1;o>=0;o--){const l=this.at(o);o===this.size-1&&n.length===1?s=l:s=Reflect.apply(i,this,[s,l,o,this])}return s}toSorted(n){const i=[...this.entries()].sort(n);return new hu(i)}toReversed(){const n=new hu;for(let i=this.size-1;i>=0;i--){const r=this.keyAt(i),s=this.get(r);n.set(r,s)}return n}toSpliced(...n){const i=[...this.entries()];return i.splice(...n),new hu(i)}slice(n,i){const r=new hu;let s=this.size-1;if(n===void 0)return r;n<0&&(n=n+this.size),i!==void 0&&i>0&&(s=i-1);for(let o=n;o<=s;o++){const l=this.keyAt(o),c=this.get(l);r.set(l,c)}return r}every(n,i){let r=0;for(const s of this){if(!Reflect.apply(n,i,[s,r,this]))return!1;r++}return!0}some(n,i){let r=0;for(const s of this){if(Reflect.apply(n,i,[s,r,this]))return!0;r++}return!1}},Va=new WeakMap,To(hu,"OrderedDict"),hu);function xN(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=mNe(e,t);return n===-1?void 0:e[n]}To(xN,"at");function mNe(e,t){const n=e.length,i=AV(t),r=i>=0?i:n+i;return r<0||r>=n?-1:r}To(mNe,"toSafeIndex");function AV(e){return e!==e||e===0?0:Math.trunc(e)}To(AV,"toSafeInteger");function glt(e){const t=e+"CollectionProvider",[n,i]=Hc(t),[r,s]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new G3,setItemMap:To(()=>{},"setItemMap")}),o=To(({state:x,...O})=>x?a.jsx(c,{...O,state:x}):a.jsx(l,{...O}),"CollectionProvider");o.displayName=t;const l=To(x=>{const O=v();return a.jsx(c,{...x,state:O})},"CollectionInit");l.displayName=t+"Init";const c=To(x=>{const{scope:O,children:k,state:S}=x,C=p.useRef(null),[E,j]=p.useState(null),T=_r(C,j),[R,A]=S;return p.useEffect(()=>{if(!E)return;const N=yNe(()=>{});return N.observe(E,{childList:!0,subtree:!0}),()=>{N.disconnect()}},[E]),a.jsx(r,{scope:O,itemMap:R,setItemMap:A,collectionRef:T,collectionRefObject:C,collectionElement:E,children:k})},"CollectionProviderImpl");c.displayName=t+"Impl";const u=e+"CollectionSlot",d=Gp(u),f=p.forwardRef((x,O)=>{const{scope:k,children:S}=x,C=s(u,k),E=_r(O,C.collectionRef);return a.jsx(d,{ref:E,children:S})});f.displayName=u;const h=e+"CollectionItemSlot",m="data-radix-collection-item",g=Gp(h),b=p.forwardRef((x,O)=>{const{scope:k,children:S,...C}=x,E=p.useRef(null),[j,T]=p.useState(null),R=_r(O,E,T),A=s(h,k),{setItemMap:N}=A,P=p.useRef(C);gNe(P.current,C)||(P.current=C);const I=P.current;return p.useEffect(()=>{const D=I;return N(_=>j?_.has(j)?_.set(j,{...D,element:j}).toSorted(pB):(_.set(j,{...D,element:j}),_.toSorted(pB)):_),()=>{N(_=>!j||!_.has(j)?_:(_.delete(j),new G3(_)))}},[j,I,N]),a.jsx(g,{[m]:"",ref:R,children:S})});b.displayName=h;function v(){return p.useState(new G3)}To(v,"useInitCollection");function y(x){const{itemMap:O}=s(e+"CollectionConsumer",x);return O}return To(y,"useCollection"),[{Provider:o,Slot:f,ItemSlot:b},{createCollectionScope:i,useCollection:y,useInitCollection:v}]}To(glt,"createCollection");function gNe(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}To(gNe,"shallowEqual");function bNe(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}To(bNe,"isElementPreceding");function pB(e,t){return!e[1].element||!t[1].element?0:bNe(e[1].element,t[1].element)?-1:1}To(pB,"sortByDocumentPosition");function yNe(e){return new MutationObserver(n=>{for(const i of n)if(i.type==="childList"){e();return}})}To(yNe,"getChildListObserver");var blt=Object.defineProperty,q1=(e,t)=>blt(e,"name",{value:t,configurable:!0}),vNe=!!(typeof window<"u"&&window.document&&window.document.createElement);function Qn(e,t,{checkForDefaultPrevented:n=!0}={}){return q1(function(r){if(e==null||e(r),n===!1||!r||!r.defaultPrevented)return t==null?void 0:t(r)},"handleEvent")}q1(Qn,"composeEventHandlers");function ylt(e){var t;if(!vNe)throw new Error("Cannot access window outside of the DOM");return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)??window}q1(ylt,"getOwnerWindow");function mB(e){if(!vNe)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}q1(mB,"getOwnerDocument");function xNe(e,t=!1){const{activeElement:n}=mB(e);if(!(n!=null&&n.nodeName))return null;if(wNe(n)&&n.contentDocument)return xNe(n.contentDocument.body,t);if(t){const i=n.getAttribute("aria-activedescendant");if(i){const r=mB(n).getElementById(i);if(r)return r}}return n}q1(xNe,"getActiveElement");function wNe(e){return e.tagName==="IFRAME"}q1(wNe,"isFrame");var xd=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},vlt=Object.defineProperty,xlt=(e,t)=>vlt(e,"name",{value:t,configurable:!0}),cee=I0[" useEffectEvent ".trim().toString()],uee=I0[" useInsertionEffect ".trim().toString()];function ONe(e){if(typeof cee=="function")return cee(e);const t=p.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof uee=="function"?uee(()=>{t.current=e}):xd(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var i;return(i=t.current)==null?void 0:i.call(t,...n)},[])}xlt(ONe,"useEffectEvent");var wlt=Object.defineProperty,KA=(e,t)=>wlt(e,"name",{value:t,configurable:!0}),Olt=I0[" useInsertionEffect ".trim().toString()]||xd;function jd({prop:e,defaultProp:t,onChange:n=KA(()=>{},"onChange"),caller:i}){const[r,s,o]=kNe({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:r,u=p.useCallback(d=>{var f;if(l){const h=SNe(d)?d(e):d;h!==e&&((f=o.current)==null||f.call(o,h))}else s(d)},[l,e,s,o]);return[c,u]}KA(jd,"useControllableState");function kNe({defaultProp:e,onChange:t}){const[n,i]=p.useState(e),r=p.useRef(n),s=p.useRef(t);return Olt(()=>{s.current=t},[t]),p.useEffect(()=>{var o;r.current!==n&&((o=s.current)==null||o.call(s,n),r.current=n)},[n,r]),[n,i,s]}KA(kNe,"useUncontrolledState");function SNe(e){return typeof e=="function"}KA(SNe,"isFunction");var dee=Symbol("RADIX:SYNC_STATE");function klt(e,t,n,i){const{prop:r,defaultProp:s,onChange:o,caller:l}=t,c=r!==void 0,u=ONe(o),d=[{...n,state:s}];i&&d.push(i);const[f,h]=p.useReducer((v,y)=>{if(y.type===dee)return{...v,state:y.state};const w=e(v,y);return c&&!Object.is(w.state,v.state)&&u(w.state),w},...d),m=f.state,g=p.useRef(m);p.useEffect(()=>{g.current!==m&&(g.current=m,c||u(m))},[m,g,c]);const b=p.useMemo(()=>r!==void 0?{...f,state:r}:f,[f,r]);return p.useEffect(()=>{c&&!Object.is(r,f.state)&&h({type:dee,state:r})},[r,f.state,c]),[b,h]}KA(klt,"useControllableStateReducer");var Slt=Object.defineProperty,Xp=(e,t)=>Slt(e,"name",{value:t,configurable:!0});function ENe(e,t){return p.useReducer((n,i)=>t[n][i]??n,e)}Xp(ENe,"useStateMachine");var _h=Xp(e=>{const{present:t,children:n}=e,i=CNe(t),r=typeof n=="function"?n({present:i.isPresent}):p.Children.only(n),s=ANe(i.ref,TNe(r));return typeof n=="function"||i.isPresent?p.cloneElement(r,{ref:s}):null},"Presence");function CNe(e){const[t,n]=p.useState(),i=p.useRef(null),r=p.useRef(e),s=p.useRef("none"),o=p.useRef(void 0),l=e?"mounted":"unmounted",[c,u]=ENe(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{c==="mounted"?(s.current=o.current??sx(i.current),o.current=void 0):s.current="none"},[c]),xd(()=>{const d=i.current,f=r.current;if(f!==e){const m=s.current,g=sx(d);e?(o.current=g,u("MOUNT")):g==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(f&&m!==g?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,u]),xd(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,h=Xp(g=>{const v=sx(i.current).includes(CSS.escape(g.animationName));if(g.target===t&&v&&(u("ANIMATION_END"),!r.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},"handleAnimationEnd"),m=Xp(g=>{g.target===t&&(s.current=sx(i.current))},"handleAnimationStart");return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:p.useCallback(d=>{if(d){const f=getComputedStyle(d);i.current=f,o.current=sx(f)}else i.current=null;n(d)},[])}}Xp(CNe,"usePresence");function gB(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Xp(gB,"setRef");function ANe(...e){const t=p.useRef(e);return t.current=e,p.useCallback(n=>{const i=t.current;let r=!1;const s=i.map(o=>{const l=gB(o,n);return!r&&typeof l=="function"&&(r=!0),l});if(r)return()=>{for(let o=0;oElt(e,"name",{value:t,configurable:!0}),Alt=I0[" useId ".trim().toString()]||(()=>{}),Tlt=0;function tb(e){const[t,n]=p.useState(Alt());return xd(()=>{e||n(i=>i??String(Tlt++))},[e]),e||(t?`radix-${t}`:"")}Clt(tb,"useId");var _lt=Object.defineProperty,jlt=(e,t)=>_lt(e,"name",{value:t,configurable:!0}),Nlt=p.createContext(void 0);function GA(e){const t=p.useContext(Nlt);return e||t||"ltr"}jlt(GA,"useDirection");var Rlt=Object.defineProperty,Ilt=(e,t)=>Rlt(e,"name",{value:t,configurable:!0});function xf(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var i;return(i=t.current)==null?void 0:i.call(t,...n)},[])}Ilt(xf,"useCallbackRef");var Plt=Object.defineProperty,Co=(e,t)=>Plt(e,"name",{value:t,configurable:!0}),bB="dismissableLayer.update",Dlt="dismissableLayer.pointerDownOutside",Mlt="dismissableLayer.focusOutside",fee,_Ne=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),TV=p.forwardRef(Co(function(t,n){const{disableOutsidePointerEvents:i=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:c,onDismiss:u,...d}=t,f=p.useContext(_Ne),[h,m]=p.useState(null),g=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=p.useState({}),v=_r(n,m),y=Array.from(f.layers),[w]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),x=w?y.indexOf(w):-1,O=h?y.indexOf(h):-1,k=f.layersWithOutsidePointerEventsDisabled.size>0,S=O>=x,C=p.useRef(!1),E=jNe(A=>{o==null||o(A),c==null||c(A),A.defaultPrevented||u==null||u()},{ownerDocument:g,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:f.dismissableSurfaces,shouldHandlePointerDownOutside:p.useCallback(A=>{if(!(A instanceof Node))return!1;const N=[...f.branches].some(P=>P.contains(A));return S&&!N},[f.branches,S])}),j=NNe(A=>{if(r&&C.current)return;const N=A.target;[...f.branches].some(I=>I.contains(N))||(l==null||l(A),c==null||c(A),A.defaultPrevented||u==null||u())},g),T=h?O===y.length-1:!1,R=xf(A=>{A.key==="Escape"&&(s==null||s(A),!A.defaultPrevented&&u&&(A.preventDefault(),u()))});return p.useEffect(()=>{if(T)return g.addEventListener("keydown",R,{capture:!0}),()=>g.removeEventListener("keydown",R,{capture:!0})},[g,T,R]),p.useEffect(()=>{if(h)return i&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(fee=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),yB(),()=>{i&&(f.layersWithOutsidePointerEventsDisabled.delete(h),f.layersWithOutsidePointerEventsDisabled.size===0&&(g.body.style.pointerEvents=fee))}},[h,g,i,f]),p.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),yB())},[h,f]),p.useEffect(()=>{const A=Co(()=>b({}),"handleUpdate");return document.addEventListener(bB,A),()=>document.removeEventListener(bB,A)},[]),a.jsx(Xr.div,{...d,ref:v,style:{pointerEvents:k?S?"auto":"none":void 0,...t.style},onFocusCapture:Qn(t.onFocusCapture,j.onFocusCapture),onBlurCapture:Qn(t.onBlurCapture,j.onBlurCapture),onPointerDownCapture:Qn(t.onPointerDownCapture,E.onPointerDownCapture)})},"DismissableLayer"));function Llt(){const e=p.useContext(_Ne),[t,n]=p.useState(null);return p.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Co(Llt,"useDismissableLayerSurface");var $lt=Co(()=>!0,"IS_TRUE");function jNe(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:r,dismissableSurfaces:s,shouldHandlePointerDownOutside:o=$lt}=t,l=xf(e),c=p.useRef(!1),u=p.useRef(!1),d=p.useRef(new Map),f=p.useRef(()=>{});return p.useEffect(()=>{function h(){u.current=!1,r.current=!1,d.current.clear()}Co(h,"resetOutsideInteraction");function m(){return Array.from(d.current.values()).some(Boolean)}Co(m,"isOutsideInteractionIntercepted");function g(x){if(!u.current)return;const O=x.target;O instanceof Node&&[...s].some(S=>S.contains(O))||d.current.set(x.type,!0),x.type==="click"&&window.setTimeout(()=>{u.current&&f.current()},0)}Co(g,"handleInteractionCapture");function b(x){u.current&&d.current.set(x.type,!1)}Co(b,"handleInteractionBubble");const v=Co(x=>{if(x.target&&!c.current){let O=function(){n.removeEventListener("click",f.current);const S=m();h(),S||_V(Dlt,l,k,{discrete:!0})};if(Co(O,"handleAndDispatchPointerDownOutsideEvent"),!o(x.target)){n.removeEventListener("click",f.current),h(),c.current=!1;return}const k={originalEvent:x};u.current=!0,r.current=i&&x.button===0,d.current.clear(),!i||x.button!==0?O():(n.removeEventListener("click",f.current),f.current=O,n.addEventListener("click",f.current,{once:!0}))}else n.removeEventListener("click",f.current),h();c.current=!1},"handlePointerDown"),y=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const x of y)n.addEventListener(x,g,!0),n.addEventListener(x,b);const w=window.setTimeout(()=>{n.addEventListener("pointerdown",v)},0);return()=>{window.clearTimeout(w),n.removeEventListener("pointerdown",v),n.removeEventListener("click",f.current);for(const x of y)n.removeEventListener(x,g,!0),n.removeEventListener(x,b)}},[n,l,i,r,s,o]),{onPointerDownCapture:Co(()=>c.current=!0,"onPointerDownCapture")}}Co(jNe,"usePointerDownOutside");function NNe(e,t=globalThis==null?void 0:globalThis.document){const n=xf(e),i=p.useRef(!1);return p.useEffect(()=>{const r=Co(s=>{s.target&&!i.current&&_V(Mlt,n,{originalEvent:s},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:Co(()=>i.current=!0,"onFocusCapture"),onBlurCapture:Co(()=>i.current=!1,"onBlurCapture")}}Co(NNe,"useFocusOutside");function yB(){const e=new CustomEvent(bB);document.dispatchEvent(e)}Co(yB,"dispatchUpdate");function _V(e,t,n,{discrete:i}){const r=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),i?EV(r,s):r.dispatchEvent(s)}Co(_V,"handleAndDispatchCustomEvent");var Flt=Object.defineProperty,rc=(e,t)=>Flt(e,"name",{value:t,configurable:!0}),X3="focusScope.autoFocusOnMount",Y3="focusScope.autoFocusOnUnmount",hee={bubbles:!1,cancelable:!0},RNe=p.forwardRef(rc(function(t,n){const{loop:i=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...l}=t,[c,u]=p.useState(null),d=xf(s),f=xf(o),h=p.useRef(null),m=_r(n,u),g=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let v=function(O){if(g.paused||!c)return;const k=O.target;c.contains(k)?h.current=k:up(h.current,{select:!0})},y=function(O){if(g.paused||!c)return;const k=O.relatedTarget;k!==null&&(c.contains(k)||up(h.current,{select:!0}))},w=function(O){if(document.activeElement===document.body)for(const S of O)S.removedNodes.length>0&&up(c)};rc(v,"handleFocusIn"),rc(y,"handleFocusOut"),rc(w,"handleMutations"),document.addEventListener("focusin",v),document.addEventListener("focusout",y);const x=new MutationObserver(w);return c&&x.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",y),x.disconnect()}}},[r,c,g.paused]),p.useEffect(()=>{if(c){pee.add(g);const v=document.activeElement;if(!c.contains(v)){const w=new CustomEvent(X3,hee);c.addEventListener(X3,d),c.dispatchEvent(w),w.defaultPrevented||(INe($Ne(jV(c)),{select:!0}),document.activeElement===v&&up(c))}return()=>{c.removeEventListener(X3,d),setTimeout(()=>{const w=new CustomEvent(Y3,hee);c.addEventListener(Y3,f),c.dispatchEvent(w),w.defaultPrevented||up(v??document.body,{select:!0}),c.removeEventListener(Y3,f),pee.remove(g)},0)}}},[c,d,f,g]);const b=p.useCallback(v=>{if(!i&&!r||g.paused)return;const y=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,w=document.activeElement;if(y&&w){const x=v.currentTarget,[O,k]=PNe(x);O&&k?!v.shiftKey&&w===k?(v.preventDefault(),i&&up(O,{select:!0})):v.shiftKey&&w===O&&(v.preventDefault(),i&&up(k,{select:!0})):w===x&&v.preventDefault()}},[i,r,g.paused]);return a.jsx(Xr.div,{tabIndex:-1,...l,ref:m,onKeyDown:b})},"FocusScope"));function INe(e,{select:t=!1}={}){const n=document.activeElement;for(const i of e)if(up(i,{select:t}),document.activeElement!==n)return}rc(INe,"focusFirst");function PNe(e){const t=jV(e),n=vB(t,e),i=vB(t.reverse(),e);return[n,i]}rc(PNe,"getTabbableEdges");function jV(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:rc(i=>{const r=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||r?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}rc(jV,"getTabbableCandidates");function vB(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const i of e)if(!(n?!i.checkVisibility({checkVisibilityCSS:!0}):DNe(i,{upTo:t})))return i}rc(vB,"findVisible");function DNe(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}rc(DNe,"isHidden");function MNe(e){return e instanceof HTMLInputElement&&"select"in e}rc(MNe,"isSelectableInput");function up(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&MNe(e)&&t&&e.select()}}rc(up,"focus");var pee=LNe();function LNe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=xB(e,t),e.unshift(t)},remove(t){var n;e=xB(e,t),(n=e[0])==null||n.resume()}}}rc(LNe,"createFocusScopesStack");function xB(e,t){const n=[...e],i=n.indexOf(t);return i!==-1&&n.splice(i,1),n}rc(xB,"arrayRemove");function $Ne(e){return e.filter(t=>t.tagName!=="A")}rc($Ne,"removeLinks");var Blt=Object.defineProperty,Ult=(e,t)=>Blt(e,"name",{value:t,configurable:!0}),NV=p.forwardRef(Ult(function(t,n){var c;const{container:i,...r}=t,[s,o]=p.useState(!1);xd(()=>o(!0),[]);const l=i||s&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return l?yi.createPortal(a.jsx(Xr.div,{...r,ref:n}),l):null},"Portal")),Qlt=Object.defineProperty,RV=(e,t)=>Qlt(e,"name",{value:t,configurable:!0}),c_=0,Uf=null;function zlt(e){return rM(),e.children}RV(zlt,"FocusGuards");function rM(){p.useEffect(()=>{Uf||(Uf={start:wB(),end:wB()});const{start:e,end:t}=Uf;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),c_++,()=>{c_===1&&(Uf==null||Uf.start.remove(),Uf==null||Uf.end.remove(),Uf=null),c_=Math.max(0,c_-1)}},[])}RV(rM,"useFocusGuards");function wB(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}RV(wB,"createFocusGuard");var Zf=function(){return Zf=Object.assign||function(t){for(var n,i=1,r=arguments.length;i"u")return act;var t=oct(e),n=document.documentElement.clientWidth,i=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,i-n+t[2]-t[0])}},cct=QNe(),lw="data-scroll-locked",uct=function(e,t,n,i){var r=e.left,s=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),` - .`.concat(Hlt,` { + */const Do=An("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),YJ=Object.freeze({totalTokenCount:0,promptTokenCount:0,candidatesTokenCount:0,thoughtsTokenCount:0,cachedContentTokenCount:0}),sE=Object.freeze({modelName:"",current:YJ,cumulative:YJ}),tot={totalTokenCount:"total_token_count",promptTokenCount:"prompt_token_count",candidatesTokenCount:"candidates_token_count",thoughtsTokenCount:"thoughts_token_count",cachedContentTokenCount:"cached_content_token_count"},not=24,iot=64,rot=16;function o_(e){var l,c;const t=e.trim();if(!t)return 0;const n=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/gu,i=((l=t.match(n))==null?void 0:l.length)??0,r=t.replace(n," "),s=(r.match(/[A-Za-z0-9_]+/g)??[]).reduce((u,d)=>u+Math.max(1,Math.ceil(d.length/4)),0),o=((c=r.match(/[^\sA-Za-z0-9_]/g))==null?void 0:c.length)??0;return i+s+o}function sot(e){var l,c,u;const t=((l=e.instruction)==null?void 0:l.trim())??"",n=((c=e.tools)==null?void 0:c.filter(d=>d.trim()))??[],i=((u=e.skills)==null?void 0:u.filter(d=>d.name.trim()))??[],r=o_(t),s=n.reduce((d,f)=>d+iot+o_(f),0),o=i.reduce((d,f)=>d+rot+o_(f.name)+o_(f.description??""),0);return not+r+s+o}function aot({usage:e,contextWindow:t,estimatedSystemTokens:n}){const i=Math.max(1,Math.round(t)),r=Math.max(0,e.current.promptTokenCount),s=Math.max(r,e.current.totalTokenCount),o=Math.min(i,r>0?Math.min(r,Math.max(0,n??0)):Math.max(0,n??0)),l=Math.max(0,r-o),c=r>0?Math.max(0,s-r):Math.max(0,s),u=r>0?s:o+c;return{systemTokens:o,inputTokens:l,outputTokens:c,remainingTokens:Math.max(0,i-u),usedTokens:u,contextWindow:i}}function oot(e){const t=[{kind:"system",tokens:e.systemTokens},{kind:"input",tokens:e.inputTokens},{kind:"output",tokens:e.outputTokens},{kind:"remaining",tokens:e.remainingTokens}],n=e.contextWindow/100;let i=0;const r=t.map(s=>{const o=i;return i+=s.tokens,{...s,start:o,end:i}});return Array.from({length:100},(s,o)=>{const l=o*n,c=l+n,u=r.flatMap(d=>{const f=Math.max(0,Math.min(c,d.end)-Math.max(l,d.start));return f>0?[{kind:d.kind,share:f/n}]:[]});return{index:o,slices:u}})}function fk(e,t){const n=e,i=n[t]??n[tot[t]];return typeof i=="number"&&Number.isFinite(i)&&i>0?Math.round(i):0}function lot(e){const t=fk(e,"promptTokenCount"),n=fk(e,"candidatesTokenCount"),i=fk(e,"thoughtsTokenCount");return{totalTokenCount:fk(e,"totalTokenCount")||t+n+i,promptTokenCount:t,candidatesTokenCount:n,thoughtsTokenCount:i,cachedContentTokenCount:fk(e,"cachedContentTokenCount")}}function cot(e,t){return{totalTokenCount:e.totalTokenCount+t.totalTokenCount,promptTokenCount:e.promptTokenCount+t.promptTokenCount,candidatesTokenCount:e.candidatesTokenCount+t.candidatesTokenCount,thoughtsTokenCount:e.thoughtsTokenCount+t.thoughtsTokenCount,cachedContentTokenCount:e.cachedContentTokenCount+t.cachedContentTokenCount}}function vV(e,t){if(!t)return e;const n=typeof t.modelVersion=="string"?t.modelVersion.trim():"",i=typeof t.model_version=="string"?t.model_version.trim():"",r=n||i||e.modelName,s=t.usageMetadata??t.usage_metadata;if(!s)return r===e.modelName?e:{...e,modelName:r};const o=lot(s);return o.totalTokenCount===0?r===e.modelName?e:{...e,modelName:r}:{modelName:r,current:o,cumulative:cot(e.cumulative,o)}}function ZJ(e){return e.reduce((t,n)=>vV(t,n),sE)}function JJ(e){return e.blocks.flatMap(t=>t.kind==="tool"?[{name:t.name,args:t.args,response:t.response,done:t.done}]:[])}function uot(e){const t=e.attributes;return String(t["invocation.id"]??t["gen_ai.invocation.id"]??t["gcp.vertex.agent.invocation_id"]??"")}function dot(e,t){if(!t)return e;const n=new Set(e.filter(r=>uot(r)===t).map(r=>r.trace_id)),i=e.filter(r=>n.has(r.trace_id));return i.length>0?i:e}function g0(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function bg(e){return typeof e=="string"?e:""}function Vje(e,t){return e==="pending"||e==="running"||e==="completed"||e==="failed"?e:t}function fot(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return{}}const n=g0(t)??{};return g0(n.result)??n}function hot(e){var n;const t=(n=g0(e))==null?void 0:n.branches;return Array.isArray(t)?t.map(i=>{var r;return bg((r=g0(i))==null?void 0:r.label)}):[]}function Hje(e,t,n){const i=hot(e),r=fot(t),s=Array.isArray(r.branches)?r.branches:[],o=n==="running"?"running":"pending";return{branches:[0,1].map(c=>{const u=g0(s[c])??{};return{label:bg(u.label)||i[c]||`方向 ${c+1}`,content:bg(u.content),status:Vje(u.status,o),error:bg(u.error)}})}}function pot(e){const t=g0(e),n=g0(t==null?void 0:t.veadkStudioToolProgress);return!n||n.toolName!=="branch_compare"||typeof n.branchIndex!="number"||n.branchIndex<0||n.branchIndex>1?null:{toolName:"branch_compare",requestId:bg(n.requestId),branchIndex:n.branchIndex,label:bg(n.label),delta:bg(n.delta),status:Vje(n.status,"running"),error:bg(n.error)||void 0}}function mot(e,t,n){return{branches:Hje(e,t,"running").branches.map((s,o)=>o===n.branchIndex?{...s,label:n.label||s.label,content:s.content+n.delta,status:n.status,error:n.error??s.error}:s)}}function Ko(e,t){return bn.t(`blocks.codexProgress.${e}`,{ns:"conversation",...t})}const qje=28e4;function eee(e){try{return JSON.stringify(e).length}catch{return qje}}function got(e){const t=e.slice(-200);let n=t.reduce((i,r)=>i+eee(r),0);for(;t.length>1&&n>qje;)n-=eee(t.shift());return t}function Ou(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Ji(e){return typeof e=="string"?e:""}function xV(e,t=""){const n=Ji(e).toLowerCase();return t.endsWith(".failed")||["failed","error","declined","cancelled"].includes(n)?"failed":t.endsWith(".completed")||["completed","done","success"].includes(n)?"completed":"running"}function Wje(e){if(e.response!==void 0)return e.response;if(e.result!==void 0)return e.result;const t=e.aggregatedOutput??e.aggregated_output??e.output,n=e.exitCode??e.exit_code;if(!(t===void 0&&n===void 0))return{...t!==void 0?{output:t}:{},...n!==void 0?{exitCode:n}:{}}}function Kje(e){if(e.args!==void 0)return e.args;if(e.arguments!==void 0)return e.arguments;if(e.input!==void 0)return e.input;const t=Ji(e.command),n=Ji(e.cwd);if(t||n)return{...t?{command:t}:{},...n?{cwd:n}:{}};if(e.changes!==void 0)return{changes:e.changes};if(e.approval!==void 0)return e.approval}function my(e,t,n,i,r){return{kind:"tool",name:e,callId:t,args:i,response:r,done:n!=="running",status:n,...n==="failed"?{defaultOpen:!0}:{}}}function Gje(e){const t=Ji(e.id||e.itemId||e.item_id),n=Ji(e.kind);if(!t||!n)return null;const i=xV(e.status),r=Ji(e.text||e.detail||e.delta),s=!Ji(e.text||e.detail)&&typeof e.delta=="string";if(n==="thinking"||n==="reasoning")return r?{id:t,block:{kind:"thinking",text:r,done:i!=="running",thoughtKind:n==="reasoning"?"reasoning":"thought"},appendText:s}:null;if(n==="commentary")return r?{id:t,block:{kind:"text",text:r},appendText:s}:null;if(["message","text","assistant_final","final"].includes(n))return r?{id:t,block:{kind:"text",text:r},appendText:s,finalAnswer:!0}:null;if(n==="plan"){const o=Array.isArray(e.plan)?e.plan:[];return{id:t,block:{kind:"plan",title:Ji(e.title)||Ko("planTitle"),summary:r||void 0,items:o.flatMap(l=>{const c=Ou(l),u=Ji(c==null?void 0:c.text);if(!u)return[];const d=Ji(c==null?void 0:c.status);return[{text:u,status:["pending","in_progress","completed","failed"].includes(d)?d:"pending"}]}),done:i!=="running"}}}if(["tool","command","command_execution","commandExecution","file_change","fileChange","mcp_tool_call","mcpToolCall","collab_tool_call","web_search","approval","status"].includes(n)){const o=Ko(n==="file_change"||n==="fileChange"?"fallback.fileChange":n==="approval"?"fallback.approval":n==="status"?"fallback.status":"fallback.command"),l=Kje(e),c=Wje(e)??(n==="status"&&r||void 0);return{id:t,block:my(Ji(e.name||e.title)||o,t,i,l,c)}}return null}function Xje(e){const t=Ji(e.type),n=Ou(e.item),i=Ji(n==null?void 0:n.type),r=Ji((n==null?void 0:n.id)||e.id)||(t==="turn.failed"?"turn":"");if(!r)return null;const s=xV(n==null?void 0:n.status,t);if(i==="reasoning"||i==="agent_message"){const o=Ji(n==null?void 0:n.text);return o?{id:r,block:i==="reasoning"?{kind:"thinking",text:o,done:s!=="running",thoughtKind:"reasoning"}:{kind:"text",text:o},...i==="agent_message"&&(n==null?void 0:n.phase)!=="commentary"?{finalAnswer:!0}:{}}:null}if(i==="todo_list"){const l=(Array.isArray(n==null?void 0:n.items)?n.items:[]).flatMap(c=>{const u=Ou(c),d=Ji(u==null?void 0:u.text);if(!d)return[];const f=Ji(u==null?void 0:u.status).toLowerCase(),h=(u==null?void 0:u.completed)===!0||["completed","done"].includes(f)?"completed":["failed","error"].includes(f)?"failed":["in_progress","running"].includes(f)?"in_progress":"pending";return[{text:d,status:h}]});return l.length?{id:r,block:{kind:"plan",title:Ko("planTitle"),summary:Ko("planSummary",{completed:l.filter(c=>c.status==="completed").length,total:l.length}),items:l,done:s!=="running"}}:null}if(i==="command_execution"){const o=Ko(`command.${s}`);return{id:r,block:my(o,r,s,Kje(n??{}),Wje(n??{}))}}if(i==="file_change"){const o=Array.isArray(n==null?void 0:n.changes)?n.changes:[],l=o.length?Ko("projectFiles",{count:o.length}):Ko("projectFile"),c=Ko(`fileChange.${s}`,{subject:l});return{id:r,block:my(c,r,s,o.length?{changes:o}:void 0)}}if(i==="mcp_tool_call"){const o=[Ji(n==null?void 0:n.server),Ji(n==null?void 0:n.tool)].filter(Boolean).join("/")||Ko("externalTool"),l=Ko(`mcp.${s}`,{tool:o}),c=Ou(n==null?void 0:n.error),u=(n==null?void 0:n.result)!==void 0?n.result:Ji(c==null?void 0:c.message)||void 0;return{id:r,block:my(l,r,s,n==null?void 0:n.arguments,u)}}if(i==="collab_tool_call"){const o=Ji(n==null?void 0:n.tool),l=["spawn_agent","send_input","wait","close_agent"].includes(o)?o:"default",c=Ko(`collaboration.${l}.${s}`),u=Object.fromEntries(["tool","receiver_thread_ids","prompt"].filter(d=>(n==null?void 0:n[d])!==void 0).map(d=>[d,n==null?void 0:n[d]]));return{id:r,block:my(c,r,s,Object.keys(u).length?u:void 0,n==null?void 0:n.agents_states)}}if(i==="web_search"){const o=Ko(`webSearch.${s}`),l=Object.fromEntries(["query","action"].filter(c=>(n==null?void 0:n[c])!==void 0).map(c=>[c,n==null?void 0:n[c]]));return{id:r,block:my(o,r,s,Object.keys(l).length?l:void 0)}}if(i==="error"||t==="error"||t==="turn.failed"){const o=Ou(e.error),l=Ji((n==null?void 0:n.message)||e.message||(o==null?void 0:o.message))||Ko("errorDetail");return{id:r,block:my(Ko("errorTitle"),r,"failed",void 0,l)}}return null}function bot(e){const t=Ou(e),n=Ou(t==null?void 0:t.veadkStudioToolProgress);if(!n||n.kind!=="codex")return null;const i=Ji(n.toolName),r=Ji(n.requestId);if(!i||!r)return null;const s=Ou(n.event??n.activity);if(!s)return null;const o=Ou(s.item)||Ji(s.type)?Xje(s):Gje(s);if(!o)return null;const l=Ji(n.title||n.label),c=Ji(s.agentSessionId??s.agent_session_id),u=Ji(s.sandboxSessionId??s.sandbox_session_id),d=Ji(s.threadId??s.thread_id),f=xV(s.status,Ji(s.type)),m=Ji(s.kind)==="status"&&f!=="running"?f:void 0;return{toolName:i,requestId:r,...l?{title:l}:{},...c?{agentSessionId:c}:{},...u?{sandboxSessionId:u}:{},...d?{threadId:d}:{},...m?{terminalStatus:m}:{},event:o}}function yot(e,t){const n=Ou(t),i=Ou((n==null?void 0:n.codexActivity)??(n==null?void 0:n.codex_activity));if(!i)return e;const r=Ji(i.title)||(e==null?void 0:e.title)||"Codex Sandbox",s=Ji(i.agentSessionId??i.agent_session_id)||(e==null?void 0:e.agentSessionId),o=Ji(i.sandboxSessionId??i.sandbox_session_id)||(e==null?void 0:e.sandboxSessionId),l=Ji(i.threadId??i.thread_id)||(e==null?void 0:e.threadId);let c={title:r,...s?{agentSessionId:s}:{},...o?{sandboxSessionId:o}:{},...l?{threadId:l}:{},items:(e==null?void 0:e.items.slice())??[]};const u=Array.isArray(i.events)?i.events:[];for(const d of u){const f=Ou(d);if(!f)continue;const h=Ou(f.item)||Ji(f.type)?Xje(f):Gje(f);h&&(h.finalAnswer||(c=cB(c,{title:r,...s?{agentSessionId:s}:{},...o?{sandboxSessionId:o}:{},...l?{threadId:l}:{},event:h})))}return c}function cB(e,t){const n=(e==null?void 0:e.items.slice())??[],i=n.findIndex(r=>r.id===t.event.id);if(i>=0){const r=n[i].block,s=t.event.block;t.event.appendText&&r.kind==="text"&&s.kind==="text"?n[i]={id:t.event.id,block:{...s,text:r.text+s.text}}:t.event.appendText&&r.kind==="thinking"&&s.kind==="thinking"?n[i]={id:t.event.id,block:{...s,text:r.text+s.text}}:n[i]={id:t.event.id,block:s}}else n.push({id:t.event.id,block:t.event.block});return{title:t.title||(e==null?void 0:e.title)||"Codex Sandbox",...t.agentSessionId||e!=null&&e.agentSessionId?{agentSessionId:t.agentSessionId||(e==null?void 0:e.agentSessionId)}:{},...t.sandboxSessionId||e!=null&&e.sandboxSessionId?{sandboxSessionId:t.sandboxSessionId||(e==null?void 0:e.sandboxSessionId)}:{},...t.threadId||e!=null&&e.threadId?{threadId:t.threadId||(e==null?void 0:e.threadId)}:{},items:got(n)}}const uB="send_a2ui_json_to_client",dB="validated_a2ui_json",vN="adk_request_credential",z3="transfer_to_agent";function vot(e){var i,r,s,o;const t=e,n=((i=t==null?void 0:t.exchangedAuthCredential)==null?void 0:i.oauth2)??((r=t==null?void 0:t.exchanged_auth_credential)==null?void 0:r.oauth2)??((s=t==null?void 0:t.rawAuthCredential)==null?void 0:s.oauth2)??((o=t==null?void 0:t.raw_auth_credential)==null?void 0:o.oauth2);return(n==null?void 0:n.authUri)??(n==null?void 0:n.auth_uri)}function fB(){return{blocks:[],liveStart:0,pendingCodexProgress:[]}}const xot=2048;function tee(e,t){if(t.event.finalAnswer)return"applied";let n=-1;for(let i=e.length-1;i>=0;i-=1){const r=e[i];if(!(r.kind!=="tool"||r.name!==t.toolName)){if(r.callId===t.requestId)return r.done?"completed":(r.codexActivity=cB(r.codexActivity,t),r.status=t.terminalStatus??"running",t.terminalStatus&&(r.done=!0),"applied");if(!r.done){if(n>=0)return"unmatched";n=i}}}if(n>=0){const i=e[n];return i.kind!=="tool"?"unmatched":(i.codexActivity=cB(i.codexActivity,t),i.status=t.terminalStatus??"running",t.terminalStatus&&(i.done=!0),"applied")}return"unmatched"}function wot(e){if(!e||typeof e!="object"||Array.isArray(e))return"completed";const t=e,n=typeof t.status=="string"?t.status.toLowerCase():"";return t.ok===!1||["error","failed","denied","declined","cancelled","timeout"].includes(n)?"failed":"completed"}function nee(e){if(!e||typeof e!="object"||Array.isArray(e))return"";const t=e;return t.ok!==!0||typeof t.message!="string"?"":t.message.trim()}const mC=e=>e.functionCall??e.function_call,tb=e=>e.functionResponse??e.function_response;function q1(e){const t=e.customMetadata??e.custom_metadata;return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}function Oot(e,t){const n=e[t];return n&&typeof n=="object"&&!Array.isArray(n)?n:{}}function ag(e,t){const n=e[t];return typeof n=="string"?n:""}function Yje(e){return Oot(q1(e),"mpa")}function wV(e){const t=q1(e),n=Yje(e);return ag(t,"eventType")||ag(t,"event_type")||ag(n,"eventType")||ag(n,"event_type")||ag(n,"kind")}function ow(e){const t=q1(e),n=Yje(e);return ag(t,"source")==="sandbox"||ag(n,"source")==="sandbox"}function Zje(e){const t=wV(e);return t==="usage.updated"||t==="usage"}function hI(e){var t;return(((t=e.content)==null?void 0:t.parts)??[]).some(n=>{const i=tb(n),r=i==null?void 0:i.response;return(i==null?void 0:i.name)==="sandbox_task"&&r&&typeof r=="object"&&!Array.isArray(r)&&r.finalAlreadyEmitted===!0})}function iee(e){for(const t of e)t.kind!=="tool"||t.name!=="sandbox_task"||t.done||(t.done=!0,t.status="completed")}function kot(e,t){if(e===t)return!0;const n=new Set(["exec_command","commandExecution","command_execution","Run command"]);return n.has(e)&&n.has(t)}function ree(e,t=!1){const n=e&&typeof e=="object"?String(e.status??"").toLowerCase():"",i=["failed","error","cancelled","denied","timeout"].includes(n)||(e==null?void 0:e.ok)===!1,r=["running","started","working"].includes(n);return{done:i||!(t||r),status:i?"failed":t||r?"running":"completed"}}function Sot(e){return e.flatMap(t=>{var n;return t.kind!=="tool"||t.name!=="delegate_to_codex_sandbox"||!((n=t.codexActivity)!=null&&n.items.length)?[t]:[{kind:"activity-source",label:t.codexActivity.title||"Codex Sandbox"},...t.codexActivity.items.map(({block:i})=>i.kind==="tool"?{...i,source:"codex-sandbox"}:i)]})}function Eot(e){if(!e||typeof e!="object")return"";const t=e,n=t.agentName??t.agent_name;return typeof n=="string"?n:""}function Cot(e){return e.replace(/-/g,"+").replace(/_/g,"/")}function WA(e){const t=[];for(const[n,i]of e.entries()){const r=i.partMetadata??i.part_metadata,s=r==null?void 0:r.veadkTransport;if((s==null?void 0:s.hidden)===!0)continue;const o=r==null?void 0:r.veadkMedia;if(typeof(o==null?void 0:o.uri)=="string"){t.push({id:String(o.id??o.uri),mimeType:typeof o.mimeType=="string"?o.mimeType:void 0,uri:o.uri,name:typeof o.name=="string"?o.name:void 0,sizeBytes:typeof o.sizeBytes=="number"?o.sizeBytes:void 0});continue}const l=i.inlineData??i.inline_data;if(l&&l.data){t.push({id:`inline-${n}-${l.displayName??l.display_name??"media"}`,mimeType:l.mimeType??l.mime_type,data:Cot(l.data),name:l.displayName??l.display_name});continue}const c=i.fileData??i.file_data,u=(c==null?void 0:c.fileUri)??(c==null?void 0:c.file_uri);c&&u&&t.push({id:u,mimeType:c.mimeType??c.mime_type,uri:u,name:c.displayName??c.display_name})}return t}function Xy(e){const t=e.partMetadata??e.part_metadata,n=t==null?void 0:t.veadkTransport;return(n==null?void 0:n.hideText)===!0?void 0:e.text}const Aot=new Set(["llm","sequential","parallel","loop","a2a"]);function Tot(e){var t;for(const n of e){const i=(t=n.partMetadata??n.part_metadata)==null?void 0:t.veadkInvocation;if(!i||typeof i!="object")continue;const r=i,s=Array.isArray(r.skills)?r.skills.flatMap(c=>{if(!c||typeof c!="object")return[];const u=c;return typeof u.name=="string"?[{name:u.name,description:typeof u.description=="string"?u.description:""}]:[]}):[];let o;const l=r.targetAgent;if(l&&typeof l=="object"){const c=l,u=c.type;typeof c.name=="string"&&typeof u=="string"&&Aot.has(u)&&Array.isArray(c.path)&&(o={name:c.name,description:typeof c.description=="string"?c.description:"",type:u,path:c.path.filter(d=>typeof d=="string")})}if(s.length>0||o)return{skills:s,targetAgent:o}}}function _ot(e,t){if(!t.length)return;const n=e[e.length-1];(n==null?void 0:n.kind)==="attachment"?n.files.push(...t):e.push({kind:"attachment",files:t})}function jot(e,t){if(!t.length)return;const n=e[e.length-1];if((n==null?void 0:n.kind)==="artifact"){for(const i of t)n.files.some(r=>r.filename===i.filename&&r.version===i.version)||n.files.push(i);return}e.push({kind:"artifact",files:t})}function V3(e,t,n,i){const r=e[e.length-1];r&&r.kind===t&&(r.kind!=="thinking"||r.thoughtKind===i)?r.text+=n:e.push(t==="thinking"?{kind:t,text:n,done:!1,thoughtKind:i}:{kind:t,text:n})}function H3(e){const t=e.customMetadata??e.custom_metadata;if(t&&typeof t=="object"){const n=t.thoughtKind;if(n==="reasoning"||n==="thought")return n}return"reasoning"}function hk(e){for(const t of e)t.kind==="thinking"&&(t.done=!0)}function Jje(e,t,n={}){var h,m,g,b,v,y;const i=e.blocks.map(w=>({...w}));let r=e.liveStart,s=e.pendingCodexProgress.slice();if(Zje(t)&&!n.mpaA2a)return{blocks:i,liveStart:r,pendingCodexProgress:s};if(hI(t))return iee(i),hk(i),{blocks:i,liveStart:r,pendingCodexProgress:s};const o=((h=t.content)==null?void 0:h.parts)??[],l=o.flatMap(w=>{const x=pot(w.partMetadata??w.part_metadata);return x?[x]:[]}),c=o.flatMap(w=>{const x=bot(w.partMetadata??w.part_metadata);return x?[x]:[]});if(l.length>0||c.length>0){for(const w of l)for(let x=i.length-1;x>=0;x-=1){const O=i[x];if(!(O.kind!=="tool"||O.done||O.name!==w.toolName||w.requestId&&O.callId&&O.callId!==w.requestId)){O.response=mot(O.args,O.response,w),O.status="running";break}}for(const w of c)tee(i,w)==="unmatched"&&(s=[...s,w].slice(-64));return{blocks:i,liveStart:r,pendingCodexProgress:s}}const u=o.some(w=>mC(w)||tb(w));if(t.partial&&!u){for(const w of o){const x=Xy(w),O=n.mpaA2a&&w.thought?ag(q1(t),"reasoningSegmentId"):"";if(O&&typeof x=="string"&&x){const k=i.find(S=>S.kind==="thinking"&&S.reasoningSegmentId===O);(k==null?void 0:k.kind)==="thinking"?k.text+=x:i.push({kind:"thinking",text:x,done:!1,thoughtKind:H3(t),reasoningSegmentId:O});continue}typeof x=="string"&&x&&V3(i,w.thought?"thinking":"text",x,w.thought?H3(t):void 0)}return{blocks:i,liveStart:r,pendingCodexProgress:s}}const d=n.mpaA2a&&!o.some(w=>w.thought&&Xy(w))?i.slice(r).filter(w=>w.kind==="thinking"):[];i.length=r,i.push(...d);for(const w of o){const x=mC(w),O=tb(w),k=WA([w]),S=Xy(w);if(typeof S=="string"&&S)V3(i,w.thought?"thinking":"text",S,w.thought?H3(t):void 0);else if(k.length)hk(i),_ot(i,k);else if(x)if(hk(i),x.name===z3){const C=Eot(x.args)||((m=t.actions)==null?void 0:m.transferToAgent)||((g=t.actions)==null?void 0:g.transfer_to_agent)||bn.t("app:common.unknownAgent");i.push({kind:"agent-transfer",agentName:C,done:!1})}else{if(x.name==="sandbox_task"&&ow(t))continue;if(x.name===vN){const C=x.args??{},E=C.authConfig??C.auth_config??C,T=String(C.functionCallId??C.function_call_id??"").replace(/^_adk_toolset_auth_/,"")||void 0;i.push({kind:"auth",callId:x.id??"",label:T,authUri:vot(E),authConfig:E,done:!1})}else{const C=x.id?[...i].reverse().find(j=>j.kind==="tool"&&j.callId===x.id):void 0;if((C==null?void 0:C.kind)==="tool"){C.name=x.name??C.name,C.args=x.args??C.args,C.response===void 0&&(C.done=!1,C.status="running");continue}const E={kind:"tool",name:x.name??"",callId:x.id,args:x.args,done:!1};if(i.push(E),E.callId){const j=[];for(const T of s)T.toolName===E.name&&T.requestId===E.callId?tee(i,T):j.push(T);s=j}}}else if(O){if(hk(i),O.name===z3)for(let E=i.length-1;E>=0;E--){const j=i[E];if(j.kind==="agent-transfer"&&!j.done){j.done=!0;break}}if(O.name===vN)for(let E=i.length-1;E>=0;E--){const j=i[E];if(j.kind==="auth"&&!j.done){j.done=!0;break}}let C=!1;for(let E=i.length-1;E>=0;E--){const j=i[E],T=j.kind==="tool"&&j.name==="delegate_to_codex_sandbox";if(j.kind==="tool"&&(!j.done||T||O.id&&j.callId===O.id)&&(O.id&&j.callId&&j.callId===O.id||(!O.id||!j.callId)&&kot(j.name,O.name??""))){const R=T?nee(j.response):"",A=ree(O.response,t.partial===!0);if(j.done=A.done,j.response=O.response,j.status=A.status,T){j.codexActivity=yot(j.codexActivity,O.response),j.status=A.status==="running"?"running":wot(O.response);const N=nee(O.response);N&&N!==R&&V3(i,"text",N)}C=!0;break}}if(!C&&O.name!==z3&&O.name!==vN&&O.name!==uB){const E=ree(O.response,t.partial===!0);i.push({kind:"tool",name:O.name??"",callId:O.id,response:O.response,done:E.done,status:E.status})}if(O.name===uB){const E=((b=O.response)==null?void 0:b[dB])??[];if(E.length){const j=i[i.length-1];j&&j.kind==="a2ui"?j.messages.push(...E):i.push({kind:"a2ui",messages:E})}}}}const f=((v=t.actions)==null?void 0:v.artifactDelta)??((y=t.actions)==null?void 0:y.artifact_delta);return f&&jot(i,Object.entries(f).map(([w,x])=>({filename:w,version:x}))),ow(t)&&wV(t)==="invocation.completed"&&iee(i),hk(i),r=i.length,{blocks:i,liveStart:r,pendingCodexProgress:s}}function Not(e,t){var u,d,f,h,m,g;if(e.partial===!0)return!1;if(hI(e))return!0;const n=((u=e.content)==null?void 0:u.parts)??[],i=n.some(b=>{const v=Xy(b);return!b.thought&&typeof v=="string"&&v.trim().length>0||WA([b]).length>0}),r=n.some(b=>{var y;const v=tb(b);return(v==null?void 0:v.name)===uB&&Array.isArray((y=v.response)==null?void 0:y[dB])&&v.response[dB].length>0}),s=((d=e.actions)==null?void 0:d.artifactDelta)??((f=e.actions)==null?void 0:f.artifact_delta),o=!!(s&&Object.keys(s).length>0),l=!!(((h=e.actions)==null?void 0:h.endOfAgent)??((m=e.actions)==null?void 0:m.end_of_agent)??((g=e.actions)==null?void 0:g.escalate)),c=t.some(b=>b.kind==="text"||b.kind==="attachment"||b.kind==="artifact"||b.kind==="a2ui"||b.kind==="delivery");return i||r||o||l&&c}function eNe(e){var n;const t=(n=e.customMetadata??e.custom_metadata)==null?void 0:n.a2aStatus;return typeof t=="string"?t:void 0}function see(e){var n,i,r;if(eNe(e))return!0;const t=((n=e.actions)==null?void 0:n.artifactDelta)??((i=e.actions)==null?void 0:i.artifact_delta);return t&&Object.keys(t).length>0?!0:(((r=e.content)==null?void 0:r.parts)??[]).some(s=>!!(Xy(s)||WA([s]).length>0||mC(s)||tb(s)))}function Rot(e,t){var o;const n=q1(t),i=((o=t.content)==null?void 0:o.parts)??[];if(t.partial!==!1||n.projectionSource!=="a2a-artifact"||ow(t)||!i.length||t.actions||!i.every(l=>l.thought&&typeof l.text=="string"&&!mC(l)&&!tb(l)&&WA([l]).length===0))return e;const r=e.blocks[e.blocks.length-1],s=i.map(l=>l.text).join("").trim();return(r==null?void 0:r.kind)!=="thinking"||!r.text.trim()||!s.startsWith(r.text.trim())?e:{...e,liveStart:e.blocks.length-1}}function Iot(e,t,n,i){const r=e[t];if(!r||r.role!=="assistant"||i.turnIsStreaming||n(r))return!1;if(!i.mpaA2a)return!0;let s=t;for(;s>0&&e[s-1].role!=="user";)s-=1;let o=t+1;for(;oc.blocks.length>0)}function Pot(e){var t,n;return e.author!=="user"&&((t=e.content)==null?void 0:t.role)!=="user"?!1:!(((n=e.content)==null?void 0:n.parts)??[]).some(i=>mC(i)||tb(i))}function xN(e="adk-stream",t,n={}){var h,m,g,b;let i=0;const r=new Map,s=new Set,o=[];let l,c,u={...(h=t==null?void 0:t.meta)==null?void 0:h.mpaUsage};const d=v=>{if(!n.mpaA2a||!(v.usageMetadata??v.usage_metadata))return!1;const y=vV(sE,v).current.totalTokenCount;if(!y)return!1;const w=q1(v),x=JSON.stringify([w.source??"outer",w.requestId??"",v.invocationId??v.invocation_id??"",v.id||JSON.stringify(v.usageMetadata??v.usage_metadata)]);return Object.prototype.hasOwnProperty.call(u,x)?!1:(u={...u,[x]:y},!0)},f=(v,y)=>`${y}\0${v}`;if((t==null?void 0:t.role)==="assistant"){const v=((m=t.meta)==null?void 0:m.author)??"",y=((g=t.meta)==null?void 0:g.invocationId)??"",w=((b=t.meta)==null?void 0:b.localId)??`${e}-${i++}`,x=fB();x.blocks=t.blocks,x.liveStart=t.blocks.length,l=f(v,y),r.set(l,{acc:x,localId:w,meta:{...t.meta,localId:w,streaming:!0,eventId:void 0}})}return{project(v){var R,A,N;if(Pot(v))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};const y=d(v);if(n.mpaA2a&&!see(v)&&!((A=(R=v.content)==null?void 0:R.parts)!=null&&A.length))return y&&c?(c={...c,meta:{...c.meta,mpaUsage:u}},{turn:c,completed:!1}):{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(Zje(v)&&!n.mpaA2a)return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(v.id&&s.has(v.id))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};v.id&&(s.add(v.id),o.push(v.id),o.length>xot&&s.delete(o.shift()));const w=v.author&&v.author!=="user"?v.author:"",x=v.invocationId??v.invocation_id??"";let O=ow(v)?"":w,k=f(O,x),S=r.get(k);if(!S&&ow(v)&&x){const D=[...r.entries()].find(([I])=>I.startsWith(`${x}\0`));D&&(k=D[0],S=D[1],O=S.meta.author??"")}if(!S&&l){const D=r.get(l);D&&(!D.meta.author||D.meta.author===O)&&(r.delete(l),l=void 0,S=D)}if(!S&&hI(v))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(!S&&!see(v))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(!S){const D=`${e}-${i++}`;S={acc:fB(),localId:D,meta:{author:O||void 0,invocationId:x||void 0}}}S.acc=Jje(n.mpaA2a?Rot(S.acc,v):S.acc,v,n);const C=v.usageMetadata??v.usage_metadata,E=Not(v,S.acc.blocks);S.meta={...S.meta,author:O||S.meta.author,localId:S.localId,streaming:!E,a2aStatus:eNe(v),tokens:(C==null?void 0:C.totalTokenCount)||S.meta.tokens,...n.mpaA2a?{mpaUsage:u,mpaFinalAnswer:ow(v)&&wV(v)==="invocation.completed"?(((N=v.content)==null?void 0:N.parts)??[]).filter(D=>!D.thought).map(D=>Xy(D)??"").join("").trim()||void 0:S.meta.mpaFinalAnswer}:{},ts:v.timestamp||S.meta.ts,invocationId:x||S.meta.invocationId,eventId:E&&v.id?v.id:S.meta.eventId};const j={role:"assistant",blocks:S.acc.blocks,meta:S.meta},T=E&&hI(v);return E&&!T?(r.delete(k),l=void 0):r.set(k,S),n.mpaA2a&&(c=j),{turn:j,completed:E}},finish(){const v=[...r.values()].map(y=>({role:"assistant",blocks:y.acc.blocks.map(w=>w.kind==="thinking"?{...w,done:!0}:w),meta:{...y.meta,streaming:!1,...n.mpaA2a?{mpaUsage:u}:{}}}));return r.clear(),v}}}function _y(e,t){var s;const n=(s=t.meta)==null?void 0:s.localId;if(!n)return[...e,t];const i=e.findIndex(o=>{var l;return((l=o.meta)==null?void 0:l.localId)===n});if(i<0)return[...e,t];const r=e.slice();return r[i]=t,r}function aee(e,t={},n={}){var l;let i=[],r=0;const s=()=>xN(`adk-history-${r++}`,void 0,n);let o=s();for(const c of e)if(c.author==="user"){const d=((l=c.content)==null?void 0:l.parts)??[];if(d.some(b=>{var v;return((v=tb(b))==null?void 0:v.name)===vN})){for(let b=i.length-1;b>=0;b--)if(i[b].role==="assistant"){for(let v=i[b].blocks.length-1;v>=0;v--){const y=i[b].blocks[v];if(y.kind==="auth"){y.done=!0;break}}break}}const f=d.map(Xy).filter(b=>!!b).join(""),h=WA(d),m=Tot(d);if(!f&&!h.length&&!m)continue;for(const b of o.finish())i=_y(i,b);const g=[];m&&g.push({kind:"invocation",value:m}),h.length&&g.push({kind:"attachment",files:h}),f&&g.push({kind:"text",text:f}),i.push({role:"user",blocks:g,meta:{ts:c.timestamp}}),o=s()}else{const d=o.project(c);d.ignored||(i=_y(i,d.turn))}for(const c of o.finish())i=_y(i,c);for(const c of i){const u=c.meta,d=u==null?void 0:u.eventId;if(!d)continue;const f=t[`veadk_feedback:${d}`];if(!f||typeof f!="object")continue;const h=f;h.rating!=="good"&&h.rating!=="bad"||(u.feedback=f)}return i}function iM(e,t=bn.t("app:titles.newConversation")){var n,i;for(const r of e??[])if(r.author==="user"||((n=r.content)==null?void 0:n.role)==="user"){const s=(((i=r.content)==null?void 0:i.parts)??[]).map(o=>o.text).find(Boolean);if(s)return s}return t}function Dot(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return e[t]}function Mot(e,t,n){var s;if(!n||!t.some(o=>{var l;return o.role==="assistant"&&((l=o.meta)==null?void 0:l.eventId)===n}))return e;const r=Dot(e);return((s=r==null?void 0:r.meta)==null?void 0:s.eventId)!==n?e:t}function tNe(e,t,n){if(e.name===t||e.id===t)return(n==null?void 0:n.type)==="parallel"?n:void 0;for(const i of e.children){const r=tNe(i,t,e);if(r)return r}}function Lot(e,t){var o,l;if(e.role!=="assistant"||!t)return;const n=(o=e.meta)==null?void 0:o.author;if(!n)return;const i=tNe(t,n);if(!i)return;const r=i.id||i.path.join("/")||i.name;return{key:`${((l=e.meta)==null?void 0:l.invocationId)??""}::${r}`,parent:i.name}}function $ot(e,t){const n=[];return e.forEach((i,r)=>{const s=Lot(i,t),o=n[n.length-1];if(s&&(o==null?void 0:o.groupKey)===s.key){o.turnIndexes.push(r);return}n.push({key:s?`parallel-${s.key}-${r}`:`turn-${r}`,turnIndexes:[r],parallelParent:s==null?void 0:s.parent,groupKey:s==null?void 0:s.key})}),n.map(({groupKey:i,...r})=>r)}function Fot(e,t,n){var r,s,o,l,c;if(!t)return e;const i=[];for(let u=0;u{var k;return(k=O.meta)!=null&&k.mpaFinalAnswer?[O.meta.mpaFinalAnswer.trim()]:[]})),m=f.map(O=>{var S;const k=O.blocks.filter(C=>C.kind==="text").map(C=>C.text).join("").trim();return!((S=O.meta)!=null&&S.mpaFinalAnswer)&&k&&h.has(k)?{...O,blocks:O.blocks.filter(C=>C.kind!=="text")}:O}),g=[...m].reverse().find(O=>O.blocks.some(k=>k.kind==="text"&&k.text.trim()))??f[f.length-1],b={},v=new Map,y=f.some(O=>{var k;return(k=O.meta)==null?void 0:k.mpaUsage});for(const O of f){for(const[S,C]of Object.entries(((r=O.meta)==null?void 0:r.mpaUsage)??{}))b[S]=Math.max(b[S]??0,C);const k=(s=O.meta)==null?void 0:s.tokens;if(typeof k=="number"&&Number.isFinite(k)&&k>=0){const S=((o=O.meta)==null?void 0:o.invocationId)||"unidentified";v.set(S,Math.max(v.get(S)??0,k))}}const w=y?Object.values(b):[...v.values()],x=f.flatMap(O=>{var k;return(k=O.meta)!=null&&k.ts?[O.meta.ts]:[]});i.push({role:"assistant",blocks:m.flatMap(O=>O.blocks),meta:{...g.meta,localId:(l=d.meta)==null?void 0:l.localId,author:void 0,streaming:u===e.length&&n||f.some(O=>{var k;return((k=O.meta)==null?void 0:k.streaming)===!0}),a2aStatus:(c=f[f.length-1].meta)==null?void 0:c.a2aStatus,ts:x.length?Math.max(...x):void 0,tokens:w.length?w.reduce((O,k)=>O+k,0):void 0,...y?{mpaUsage:b}:{}}})}return i}function Bot(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"9",cy:"8",r:"3.25"}),a.jsx("path",{d:"M2.75 20v-1.5a6.25 6.25 0 0 1 12.5 0V20M16 5.25a3.25 3.25 0 0 1 0 6.5M18 14a5.5 5.5 0 0 1 3.25 5V20"})]})}function nNe(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t{const t=p.Children.toArray(e),n=[];let i="";const r=()=>{i!==""&&(n.push(i),i="")};for(const s of t)if(!(s==null||typeof s=="boolean")){if(typeof s=="string"||typeof s=="number"){i+=String(s);continue}r(),n.push(s)}return r(),n},OV=e=>{const t=Uot(e),n=p.Children.count(t);return p.Children.map(t,i=>{if(typeof i=="string"&&i.trim())return n<=1?i:a.jsx("span",{children:i});if(p.isValidElement(i)){const r=i,{children:s,...o}=r.props;return s!=null?p.cloneElement(r,o,OV(s)):r}return i})},Qot="_Badge_1viyg_1",zot={Badge:Qot},Ya=({children:e,className:t,variant:n="soft",color:i="secondary",size:r="sm",pill:s,...o})=>a.jsx("div",{className:Qi(zot.Badge,t),"data-color":i,"data-size":r,"data-pill":s?"":void 0,"data-variant":n,...o,children:OV(e)});var Vot=typeof ug=="object"&&ug&&ug.Object===Object&&ug,Hot=typeof self=="object"&&self&&self.Object===Object&&self;Vot||Hot||Function("return this")();var qot=typeof window<"u"?p.useLayoutEffect:p.useEffect;function Wot(){const e=p.useRef(!1);return p.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),p.useCallback(()=>e.current,[])}var oee={width:void 0,height:void 0};function iNe(e){const{ref:t,box:n="content-box"}=e,[{width:i,height:r},s]=p.useState(oee),o=Wot(),l=p.useRef({...oee}),c=p.useRef(void 0);return c.current=e.onResize,p.useEffect(()=>{if(!t.current||typeof window>"u"||!("ResizeObserver"in window))return;const u=new ResizeObserver(([d])=>{const f=n==="border-box"?"borderBoxSize":n==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",h=lee(d,f,"inlineSize"),m=lee(d,f,"blockSize");if(l.current.width!==h||l.current.height!==m){const b={width:h,height:m};l.current.width=h,l.current.height=m,c.current?c.current(b):o()&&s(b)}});return u.observe(t.current,{box:n}),()=>{u.disconnect()}},[n,t,o]),{width:i,height:r}}function lee(e,t,n){return e[t]?Array.isArray(e[t])?e[t][0][n]:e[t][n]:t==="contentBoxSize"?e.contentRect[n==="inlineSize"?"width":"height"]:void 0}function kV(e,t){const n=p.useRef(e);qot(()=>{n.current=e},[e]),p.useEffect(()=>{if(!t&&t!==0)return;const i=setTimeout(()=>{n.current()},t);return()=>{clearTimeout(i)}},[t])}const Kot={DEV:!1,MODE:"production"},lw=typeof import.meta<"u"?Kot:void 0,Got=!!(lw!=null&&lw.DEV),Xot=typeof navigator<"u"&&/(jsdom|happy-dom)/i.test(navigator.userAgent)||typeof globalThis.happyDOM=="object",rNe=(lw==null?void 0:lw.MODE)==="test"||Xot,Yot=typeof window<"u",sNe=typeof document<"u",Zot=Yot&&sNe,SV=e=>{const t=e.currentTarget;if(!(t instanceof HTMLElement))return;const n=t.offsetWidth;let i=.985;n<=80?i=.96:n<=150?i=.97:n<=220?i=.98:n>600&&(i=.995),t.style.setProperty("--scale",i.toString())},pI=(e,t)=>{const n=()=>{const o=setTimeout(e);return()=>{clearTimeout(o)}};if(!Zot||typeof window.requestAnimationFrame!="function"||sNe&&document.visibilityState==="hidden")return n();let r=2,s=window.requestAnimationFrame(function o(){r-=1,r===0?e():s=window.requestAnimationFrame(o)});return()=>{typeof window.cancelAnimationFrame=="function"&&window.cancelAnimationFrame(s)}},V0=e=>Object.keys(e).reduce((n,i)=>{const r=e[i];if(r||r===0){const s=i.startsWith("--")?"":"--",o=typeof r=="number"?`${r}px`:r;n[`${s}${i}`]=o}return n},{}),q3=e=>typeof e=="number"?`${e}deg`:e,W3=e=>String(e),l_=e=>`${e}ms`,K3=({x:e,y:t,scale:n,rotate:i,skewX:r,skewY:s}={})=>{const o=[e==null?null:`translateX(${e}px)`,t==null?null:`translateY(${t}px)`,n==null?null:`scale(${n})`,i==null?null:`rotate(${q3(i)})`,r==null?null:`skewX(${q3(r)})`,s==null?null:`skewY(${q3(s)})`].filter(Boolean);return o.length?o.join(" "):"none"},G3=({blur:e}={})=>{const t=[e==null?null:`blur(${e}px)`].filter(Boolean);return t.length?t.join(" "):"none"},Mp=e=>{e.preventDefault()},aNe=e=>e.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex^="-"]), [contenteditable]'),Jot="_LoadingIndicator_7yl6f_1",elt={LoadingIndicator:Jot},KA=({className:e,size:t,strokeWidth:n,style:i,...r})=>a.jsx("div",{...r,className:Qi(elt.LoadingIndicator,e),style:i||V0({"indicator-size":t,"indicator-stroke":n})});var tlt=Object.defineProperty,EV=(e,t)=>tlt(e,"name",{value:t,configurable:!0});function hB(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}EV(hB,"setRef");function oNe(...e){return t=>{let n=!1;const i=e.map(r=>{const s=hB(r,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let r=0;rnlt(e,"name",{value:t,configurable:!0});function Xp(e){const t=p.forwardRef((n,i)=>{let{children:r,...s}=n,o=null,l=!1;const c=[];pB(r)&&typeof c_=="function"&&(r=c_(r._payload)),p.Children.forEach(r,h=>{var m;if(hNe(h)){l=!0;const g=h;let b="child"in g.props?g.props.child:g.props.children;pB(b)&&typeof c_=="function"&&(b=c_(b._payload)),o=ilt(g,b),c.push((m=o==null?void 0:o.props)==null?void 0:m.children)}else c.push(h)}),o?o=p.cloneElement(o,void 0,c):!l&&p.Children.count(r)===1&&p.isValidElement(r)&&(o=r);const u=o?fNe(o):void 0,d=_r(i,u);if(!o){if(r||r===0)throw new Error(l?alt(e):slt(e));return r}const f=dNe(s,o.props??{});return o.type!==p.Fragment&&(f.ref=i?d:u),p.cloneElement(o,f)});return t.displayName=`${e}.Slot`,t}Af(Xp,"createSlot");var lNe=Xp("Slot"),cNe=Symbol.for("radix.slottable");function uNe(e){const t=Af(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=cNe,t}Af(uNe,"createSlottable");var ilt=Af((e,t)=>{if("child"in e.props){const n=e.props.child;return p.isValidElement(n)?p.cloneElement(n,void 0,e.props.children(n.props.children)):null}return p.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function dNe(e,t){const n={...t};for(const i in t){const r=e[i],s=t[i];/^on[A-Z]/.test(i)?r&&s?n[i]=(...l)=>{const c=s(...l);return r(...l),c}:r&&(n[i]=r):i==="style"?n[i]={...r,...s}:i==="className"&&(n[i]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}Af(dNe,"mergeProps");function fNe(e){var i,r;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Af(fNe,"getElementRef");function hNe(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===cNe}Af(hNe,"isSlottable");var rlt=Symbol.for("react.lazy");function pB(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===rlt&&"_payload"in e&&pNe(e._payload)}Af(pB,"isLazyComponent");function pNe(e){return typeof e=="object"&&e!==null&&"then"in e}Af(pNe,"isPromiseLike");var slt=Af(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),alt=Af(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),c_=P0[" use ".trim().toString()],olt=Object.defineProperty,llt=(e,t)=>olt(e,"name",{value:t,configurable:!0}),clt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Xr=clt.reduce((e,t)=>{const n=Xp(`Primitive.${t}`),i=p.forwardRef((r,s)=>{const{asChild:o,...l}=r,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:s})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function CV(e,t){e&&yi.flushSync(()=>e.dispatchEvent(t))}llt(CV,"dispatchDiscreteCustomEvent");var ult=Object.defineProperty,dlt=(e,t)=>ult(e,"name",{value:t,configurable:!0}),flt=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),hlt=p.forwardRef(dlt(function(t,n){return a.jsx(Xr.span,{...t,ref:n,style:{...flt,...t.style}})},"VisuallyHidden")),plt=hlt,mlt=Object.defineProperty,ld=(e,t)=>mlt(e,"name",{value:t,configurable:!0});function glt(e,t){const n=p.createContext(t);n.displayName=e+"Context";const i=ld(s=>{const{children:o,...l}=s,c=p.useMemo(()=>l,Object.values(l));return a.jsx(n.Provider,{value:c,children:o})},"Provider");i.displayName=e+"Provider";function r(s,o={}){const{optional:l=!1}=o,c=p.useContext(n);if(c)return c;if(t!==void 0)return t;if(!l)throw new Error(`\`${s}\` must be used within \`${e}\``)}return ld(r,"useContext"),[i,r]}ld(glt,"createContext");function qc(e,t=[]){let n=[];function i(s,o){const l=p.createContext(o);l.displayName=s+"Context";const c=n.length;n=[...n,o];const u=ld(f=>{var y;const{scope:h,children:m,...g}=f,b=((y=h==null?void 0:h[e])==null?void 0:y[c])||l,v=p.useMemo(()=>g,Object.values(g));return a.jsx(b.Provider,{value:v,children:m})},"Provider");u.displayName=s+"Provider";function d(f,h,m={}){var y;const{optional:g=!1}=m,b=((y=h==null?void 0:h[e])==null?void 0:y[c])||l,v=p.useContext(b);if(v)return v;if(o!==void 0)return o;if(!g)throw new Error(`\`${f}\` must be used within \`${s}\``)}return ld(d,"useContext"),[u,d]}ld(i,"createContext");const r=ld(()=>{const s=n.map(o=>p.createContext(o));return ld(function(l){const c=(l==null?void 0:l[e])||s;return p.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])},"useScope")},"createScope");return r.scopeName=e,[i,mNe(r,...t)]}ld(qc,"createContextScope");function mNe(...e){const t=e[0];if(e.length===1)return t;const n=ld(()=>{const i=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return ld(function(s){const o=i.reduce((l,{useScope:c,scopeName:u})=>{const f=c(s)[`__scope${u}`];return{...l,...f}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}ld(mNe,"composeContextScopes");var blt=Object.defineProperty,To=(e,t)=>blt(e,"name",{value:t,configurable:!0});function AV(e){const t=e+"CollectionProvider",[n,i]=qc(t),[r,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=To(b=>{const{scope:v,children:y}=b,w=p.useRef(null),x=p.useRef(new Map).current;return a.jsx(r,{scope:v,itemMap:x,collectionRef:w,children:y})},"CollectionProvider");o.displayName=t;const l=e+"CollectionSlot",c=Xp(l),u=p.forwardRef((b,v)=>{const{scope:y,children:w}=b,x=s(l,y),O=_r(v,x.collectionRef);return a.jsx(c,{ref:O,children:w})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",h=Xp(d),m=p.forwardRef((b,v)=>{const{scope:y,children:w,...x}=b,O=p.useRef(null),k=_r(v,O),S=s(d,y);return p.useEffect(()=>(S.itemMap.set(O,{ref:O,...x}),()=>void S.itemMap.delete(O))),a.jsx(h,{[f]:"",ref:k,children:w})});m.displayName=d;function g(b){const v=s(e+"CollectionConsumer",b);return p.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const x=Array.from(w.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((S,C)=>x.indexOf(S.ref.current)-x.indexOf(C.ref.current))},[v.collectionRef,v.itemMap])}return To(g,"useCollection"),[{Provider:o,Slot:u,ItemSlot:m},g,i]}To(AV,"createCollection");var cee=new WeakMap,Va,pu,X3=(pu=class extends Map{constructor(n){super(n);DG(this,Va);O5(this,Va,[...super.keys()]),cee.set(this,!0)}set(n,i){return cee.get(this)&&(this.has(n)?kl(this,Va)[kl(this,Va).indexOf(n)]=n:kl(this,Va).push(n)),super.set(n,i),this}insert(n,i,r){const s=this.has(i),o=kl(this,Va).length,l=TV(n);let c=l>=0?l:o+l;const u=c<0||c>=o?-1:c;if(u===this.size||s&&u===this.size-1||u===-1)return this.set(i,r),this;const d=this.size+(s?0:1);l<0&&c++;const f=[...kl(this,Va)];let h,m=!1;for(let g=c;g=this.size&&(s=this.size-1),this.at(s)}keyFrom(n,i){const r=this.indexOf(n);if(r===-1)return;let s=r+i;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(n,i){let r=0;for(const s of this){if(Reflect.apply(n,i,[s,r,this]))return s;r++}}findIndex(n,i){let r=0;for(const s of this){if(Reflect.apply(n,i,[s,r,this]))return r;r++}return-1}filter(n,i){const r=[];let s=0;for(const o of this)Reflect.apply(n,i,[o,s,this])&&r.push(o),s++;return new pu(r)}map(n,i){const r=[];let s=0;for(const o of this)r.push([o[0],Reflect.apply(n,i,[o,s,this])]),s++;return new pu(r)}reduce(...n){const[i,r]=n;let s=0,o=r??this.at(0);for(const l of this)s===0&&n.length===1?o=l:o=Reflect.apply(i,this,[o,l,s,this]),s++;return o}reduceRight(...n){const[i,r]=n;let s=r??this.at(-1);for(let o=this.size-1;o>=0;o--){const l=this.at(o);o===this.size-1&&n.length===1?s=l:s=Reflect.apply(i,this,[s,l,o,this])}return s}toSorted(n){const i=[...this.entries()].sort(n);return new pu(i)}toReversed(){const n=new pu;for(let i=this.size-1;i>=0;i--){const r=this.keyAt(i),s=this.get(r);n.set(r,s)}return n}toSpliced(...n){const i=[...this.entries()];return i.splice(...n),new pu(i)}slice(n,i){const r=new pu;let s=this.size-1;if(n===void 0)return r;n<0&&(n=n+this.size),i!==void 0&&i>0&&(s=i-1);for(let o=n;o<=s;o++){const l=this.keyAt(o),c=this.get(l);r.set(l,c)}return r}every(n,i){let r=0;for(const s of this){if(!Reflect.apply(n,i,[s,r,this]))return!1;r++}return!0}some(n,i){let r=0;for(const s of this){if(Reflect.apply(n,i,[s,r,this]))return!0;r++}return!1}},Va=new WeakMap,To(pu,"OrderedDict"),pu);function wN(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=gNe(e,t);return n===-1?void 0:e[n]}To(wN,"at");function gNe(e,t){const n=e.length,i=TV(t),r=i>=0?i:n+i;return r<0||r>=n?-1:r}To(gNe,"toSafeIndex");function TV(e){return e!==e||e===0?0:Math.trunc(e)}To(TV,"toSafeInteger");function ylt(e){const t=e+"CollectionProvider",[n,i]=qc(t),[r,s]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new X3,setItemMap:To(()=>{},"setItemMap")}),o=To(({state:x,...O})=>x?a.jsx(c,{...O,state:x}):a.jsx(l,{...O}),"CollectionProvider");o.displayName=t;const l=To(x=>{const O=v();return a.jsx(c,{...x,state:O})},"CollectionInit");l.displayName=t+"Init";const c=To(x=>{const{scope:O,children:k,state:S}=x,C=p.useRef(null),[E,j]=p.useState(null),T=_r(C,j),[R,A]=S;return p.useEffect(()=>{if(!E)return;const N=vNe(()=>{});return N.observe(E,{childList:!0,subtree:!0}),()=>{N.disconnect()}},[E]),a.jsx(r,{scope:O,itemMap:R,setItemMap:A,collectionRef:T,collectionRefObject:C,collectionElement:E,children:k})},"CollectionProviderImpl");c.displayName=t+"Impl";const u=e+"CollectionSlot",d=Xp(u),f=p.forwardRef((x,O)=>{const{scope:k,children:S}=x,C=s(u,k),E=_r(O,C.collectionRef);return a.jsx(d,{ref:E,children:S})});f.displayName=u;const h=e+"CollectionItemSlot",m="data-radix-collection-item",g=Xp(h),b=p.forwardRef((x,O)=>{const{scope:k,children:S,...C}=x,E=p.useRef(null),[j,T]=p.useState(null),R=_r(O,E,T),A=s(h,k),{setItemMap:N}=A,D=p.useRef(C);bNe(D.current,C)||(D.current=C);const I=D.current;return p.useEffect(()=>{const P=I;return N(_=>j?_.has(j)?_.set(j,{...P,element:j}).toSorted(mB):(_.set(j,{...P,element:j}),_.toSorted(mB)):_),()=>{N(_=>!j||!_.has(j)?_:(_.delete(j),new X3(_)))}},[j,I,N]),a.jsx(g,{[m]:"",ref:R,children:S})});b.displayName=h;function v(){return p.useState(new X3)}To(v,"useInitCollection");function y(x){const{itemMap:O}=s(e+"CollectionConsumer",x);return O}return To(y,"useCollection"),[{Provider:o,Slot:f,ItemSlot:b},{createCollectionScope:i,useCollection:y,useInitCollection:v}]}To(ylt,"createCollection");function bNe(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}To(bNe,"shallowEqual");function yNe(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}To(yNe,"isElementPreceding");function mB(e,t){return!e[1].element||!t[1].element?0:yNe(e[1].element,t[1].element)?-1:1}To(mB,"sortByDocumentPosition");function vNe(e){return new MutationObserver(n=>{for(const i of n)if(i.type==="childList"){e();return}})}To(vNe,"getChildListObserver");var vlt=Object.defineProperty,W1=(e,t)=>vlt(e,"name",{value:t,configurable:!0}),xNe=!!(typeof window<"u"&&window.document&&window.document.createElement);function Qn(e,t,{checkForDefaultPrevented:n=!0}={}){return W1(function(r){if(e==null||e(r),n===!1||!r||!r.defaultPrevented)return t==null?void 0:t(r)},"handleEvent")}W1(Qn,"composeEventHandlers");function xlt(e){var t;if(!xNe)throw new Error("Cannot access window outside of the DOM");return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)??window}W1(xlt,"getOwnerWindow");function gB(e){if(!xNe)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}W1(gB,"getOwnerDocument");function wNe(e,t=!1){const{activeElement:n}=gB(e);if(!(n!=null&&n.nodeName))return null;if(ONe(n)&&n.contentDocument)return wNe(n.contentDocument.body,t);if(t){const i=n.getAttribute("aria-activedescendant");if(i){const r=gB(n).getElementById(i);if(r)return r}}return n}W1(wNe,"getActiveElement");function ONe(e){return e.tagName==="IFRAME"}W1(ONe,"isFrame");var Od=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},wlt=Object.defineProperty,Olt=(e,t)=>wlt(e,"name",{value:t,configurable:!0}),uee=P0[" useEffectEvent ".trim().toString()],dee=P0[" useInsertionEffect ".trim().toString()];function kNe(e){if(typeof uee=="function")return uee(e);const t=p.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof dee=="function"?dee(()=>{t.current=e}):Od(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var i;return(i=t.current)==null?void 0:i.call(t,...n)},[])}Olt(kNe,"useEffectEvent");var klt=Object.defineProperty,GA=(e,t)=>klt(e,"name",{value:t,configurable:!0}),Slt=P0[" useInsertionEffect ".trim().toString()]||Od;function Rd({prop:e,defaultProp:t,onChange:n=GA(()=>{},"onChange"),caller:i}){const[r,s,o]=SNe({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:r,u=p.useCallback(d=>{var f;if(l){const h=ENe(d)?d(e):d;h!==e&&((f=o.current)==null||f.call(o,h))}else s(d)},[l,e,s,o]);return[c,u]}GA(Rd,"useControllableState");function SNe({defaultProp:e,onChange:t}){const[n,i]=p.useState(e),r=p.useRef(n),s=p.useRef(t);return Slt(()=>{s.current=t},[t]),p.useEffect(()=>{var o;r.current!==n&&((o=s.current)==null||o.call(s,n),r.current=n)},[n,r]),[n,i,s]}GA(SNe,"useUncontrolledState");function ENe(e){return typeof e=="function"}GA(ENe,"isFunction");var fee=Symbol("RADIX:SYNC_STATE");function Elt(e,t,n,i){const{prop:r,defaultProp:s,onChange:o,caller:l}=t,c=r!==void 0,u=kNe(o),d=[{...n,state:s}];i&&d.push(i);const[f,h]=p.useReducer((v,y)=>{if(y.type===fee)return{...v,state:y.state};const w=e(v,y);return c&&!Object.is(w.state,v.state)&&u(w.state),w},...d),m=f.state,g=p.useRef(m);p.useEffect(()=>{g.current!==m&&(g.current=m,c||u(m))},[m,g,c]);const b=p.useMemo(()=>r!==void 0?{...f,state:r}:f,[f,r]);return p.useEffect(()=>{c&&!Object.is(r,f.state)&&h({type:fee,state:r})},[r,f.state,c]),[b,h]}GA(Elt,"useControllableStateReducer");var Clt=Object.defineProperty,Yp=(e,t)=>Clt(e,"name",{value:t,configurable:!0});function CNe(e,t){return p.useReducer((n,i)=>t[n][i]??n,e)}Yp(CNe,"useStateMachine");var jh=Yp(e=>{const{present:t,children:n}=e,i=ANe(t),r=typeof n=="function"?n({present:i.isPresent}):p.Children.only(n),s=TNe(i.ref,_Ne(r));return typeof n=="function"||i.isPresent?p.cloneElement(r,{ref:s}):null},"Presence");function ANe(e){const[t,n]=p.useState(),i=p.useRef(null),r=p.useRef(e),s=p.useRef("none"),o=p.useRef(void 0),l=e?"mounted":"unmounted",[c,u]=CNe(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{c==="mounted"?(s.current=o.current??ax(i.current),o.current=void 0):s.current="none"},[c]),Od(()=>{const d=i.current,f=r.current;if(f!==e){const m=s.current,g=ax(d);e?(o.current=g,u("MOUNT")):g==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(f&&m!==g?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,u]),Od(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,h=Yp(g=>{const v=ax(i.current).includes(CSS.escape(g.animationName));if(g.target===t&&v&&(u("ANIMATION_END"),!r.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},"handleAnimationEnd"),m=Yp(g=>{g.target===t&&(s.current=ax(i.current))},"handleAnimationStart");return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:p.useCallback(d=>{if(d){const f=getComputedStyle(d);i.current=f,o.current=ax(f)}else i.current=null;n(d)},[])}}Yp(ANe,"usePresence");function bB(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Yp(bB,"setRef");function TNe(...e){const t=p.useRef(e);return t.current=e,p.useCallback(n=>{const i=t.current;let r=!1;const s=i.map(o=>{const l=bB(o,n);return!r&&typeof l=="function"&&(r=!0),l});if(r)return()=>{for(let o=0;oAlt(e,"name",{value:t,configurable:!0}),_lt=P0[" useId ".trim().toString()]||(()=>{}),jlt=0;function nb(e){const[t,n]=p.useState(_lt());return Od(()=>{e||n(i=>i??String(jlt++))},[e]),e||(t?`radix-${t}`:"")}Tlt(nb,"useId");var Nlt=Object.defineProperty,Rlt=(e,t)=>Nlt(e,"name",{value:t,configurable:!0}),Ilt=p.createContext(void 0);function XA(e){const t=p.useContext(Ilt);return e||t||"ltr"}Rlt(XA,"useDirection");var Plt=Object.defineProperty,Dlt=(e,t)=>Plt(e,"name",{value:t,configurable:!0});function wf(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var i;return(i=t.current)==null?void 0:i.call(t,...n)},[])}Dlt(wf,"useCallbackRef");var Mlt=Object.defineProperty,Co=(e,t)=>Mlt(e,"name",{value:t,configurable:!0}),yB="dismissableLayer.update",Llt="dismissableLayer.pointerDownOutside",$lt="dismissableLayer.focusOutside",hee,jNe=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),_V=p.forwardRef(Co(function(t,n){const{disableOutsidePointerEvents:i=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:c,onDismiss:u,...d}=t,f=p.useContext(jNe),[h,m]=p.useState(null),g=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=p.useState({}),v=_r(n,m),y=Array.from(f.layers),[w]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),x=w?y.indexOf(w):-1,O=h?y.indexOf(h):-1,k=f.layersWithOutsidePointerEventsDisabled.size>0,S=O>=x,C=p.useRef(!1),E=NNe(A=>{o==null||o(A),c==null||c(A),A.defaultPrevented||u==null||u()},{ownerDocument:g,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:f.dismissableSurfaces,shouldHandlePointerDownOutside:p.useCallback(A=>{if(!(A instanceof Node))return!1;const N=[...f.branches].some(D=>D.contains(A));return S&&!N},[f.branches,S])}),j=RNe(A=>{if(r&&C.current)return;const N=A.target;[...f.branches].some(I=>I.contains(N))||(l==null||l(A),c==null||c(A),A.defaultPrevented||u==null||u())},g),T=h?O===y.length-1:!1,R=wf(A=>{A.key==="Escape"&&(s==null||s(A),!A.defaultPrevented&&u&&(A.preventDefault(),u()))});return p.useEffect(()=>{if(T)return g.addEventListener("keydown",R,{capture:!0}),()=>g.removeEventListener("keydown",R,{capture:!0})},[g,T,R]),p.useEffect(()=>{if(h)return i&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(hee=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),vB(),()=>{i&&(f.layersWithOutsidePointerEventsDisabled.delete(h),f.layersWithOutsidePointerEventsDisabled.size===0&&(g.body.style.pointerEvents=hee))}},[h,g,i,f]),p.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),vB())},[h,f]),p.useEffect(()=>{const A=Co(()=>b({}),"handleUpdate");return document.addEventListener(yB,A),()=>document.removeEventListener(yB,A)},[]),a.jsx(Xr.div,{...d,ref:v,style:{pointerEvents:k?S?"auto":"none":void 0,...t.style},onFocusCapture:Qn(t.onFocusCapture,j.onFocusCapture),onBlurCapture:Qn(t.onBlurCapture,j.onBlurCapture),onPointerDownCapture:Qn(t.onPointerDownCapture,E.onPointerDownCapture)})},"DismissableLayer"));function Flt(){const e=p.useContext(jNe),[t,n]=p.useState(null);return p.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Co(Flt,"useDismissableLayerSurface");var Blt=Co(()=>!0,"IS_TRUE");function NNe(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:r,dismissableSurfaces:s,shouldHandlePointerDownOutside:o=Blt}=t,l=wf(e),c=p.useRef(!1),u=p.useRef(!1),d=p.useRef(new Map),f=p.useRef(()=>{});return p.useEffect(()=>{function h(){u.current=!1,r.current=!1,d.current.clear()}Co(h,"resetOutsideInteraction");function m(){return Array.from(d.current.values()).some(Boolean)}Co(m,"isOutsideInteractionIntercepted");function g(x){if(!u.current)return;const O=x.target;O instanceof Node&&[...s].some(S=>S.contains(O))||d.current.set(x.type,!0),x.type==="click"&&window.setTimeout(()=>{u.current&&f.current()},0)}Co(g,"handleInteractionCapture");function b(x){u.current&&d.current.set(x.type,!1)}Co(b,"handleInteractionBubble");const v=Co(x=>{if(x.target&&!c.current){let O=function(){n.removeEventListener("click",f.current);const S=m();h(),S||jV(Llt,l,k,{discrete:!0})};if(Co(O,"handleAndDispatchPointerDownOutsideEvent"),!o(x.target)){n.removeEventListener("click",f.current),h(),c.current=!1;return}const k={originalEvent:x};u.current=!0,r.current=i&&x.button===0,d.current.clear(),!i||x.button!==0?O():(n.removeEventListener("click",f.current),f.current=O,n.addEventListener("click",f.current,{once:!0}))}else n.removeEventListener("click",f.current),h();c.current=!1},"handlePointerDown"),y=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const x of y)n.addEventListener(x,g,!0),n.addEventListener(x,b);const w=window.setTimeout(()=>{n.addEventListener("pointerdown",v)},0);return()=>{window.clearTimeout(w),n.removeEventListener("pointerdown",v),n.removeEventListener("click",f.current);for(const x of y)n.removeEventListener(x,g,!0),n.removeEventListener(x,b)}},[n,l,i,r,s,o]),{onPointerDownCapture:Co(()=>c.current=!0,"onPointerDownCapture")}}Co(NNe,"usePointerDownOutside");function RNe(e,t=globalThis==null?void 0:globalThis.document){const n=wf(e),i=p.useRef(!1);return p.useEffect(()=>{const r=Co(s=>{s.target&&!i.current&&jV($lt,n,{originalEvent:s},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:Co(()=>i.current=!0,"onFocusCapture"),onBlurCapture:Co(()=>i.current=!1,"onBlurCapture")}}Co(RNe,"useFocusOutside");function vB(){const e=new CustomEvent(yB);document.dispatchEvent(e)}Co(vB,"dispatchUpdate");function jV(e,t,n,{discrete:i}){const r=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),i?CV(r,s):r.dispatchEvent(s)}Co(jV,"handleAndDispatchCustomEvent");var Ult=Object.defineProperty,rc=(e,t)=>Ult(e,"name",{value:t,configurable:!0}),Y3="focusScope.autoFocusOnMount",Z3="focusScope.autoFocusOnUnmount",pee={bubbles:!1,cancelable:!0},INe=p.forwardRef(rc(function(t,n){const{loop:i=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...l}=t,[c,u]=p.useState(null),d=wf(s),f=wf(o),h=p.useRef(null),m=_r(n,u),g=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let v=function(O){if(g.paused||!c)return;const k=O.target;c.contains(k)?h.current=k:dp(h.current,{select:!0})},y=function(O){if(g.paused||!c)return;const k=O.relatedTarget;k!==null&&(c.contains(k)||dp(h.current,{select:!0}))},w=function(O){if(document.activeElement===document.body)for(const S of O)S.removedNodes.length>0&&dp(c)};rc(v,"handleFocusIn"),rc(y,"handleFocusOut"),rc(w,"handleMutations"),document.addEventListener("focusin",v),document.addEventListener("focusout",y);const x=new MutationObserver(w);return c&&x.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",y),x.disconnect()}}},[r,c,g.paused]),p.useEffect(()=>{if(c){mee.add(g);const v=document.activeElement;if(!c.contains(v)){const w=new CustomEvent(Y3,pee);c.addEventListener(Y3,d),c.dispatchEvent(w),w.defaultPrevented||(PNe(FNe(NV(c)),{select:!0}),document.activeElement===v&&dp(c))}return()=>{c.removeEventListener(Y3,d),setTimeout(()=>{const w=new CustomEvent(Z3,pee);c.addEventListener(Z3,f),c.dispatchEvent(w),w.defaultPrevented||dp(v??document.body,{select:!0}),c.removeEventListener(Z3,f),mee.remove(g)},0)}}},[c,d,f,g]);const b=p.useCallback(v=>{if(!i&&!r||g.paused)return;const y=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,w=document.activeElement;if(y&&w){const x=v.currentTarget,[O,k]=DNe(x);O&&k?!v.shiftKey&&w===k?(v.preventDefault(),i&&dp(O,{select:!0})):v.shiftKey&&w===O&&(v.preventDefault(),i&&dp(k,{select:!0})):w===x&&v.preventDefault()}},[i,r,g.paused]);return a.jsx(Xr.div,{tabIndex:-1,...l,ref:m,onKeyDown:b})},"FocusScope"));function PNe(e,{select:t=!1}={}){const n=document.activeElement;for(const i of e)if(dp(i,{select:t}),document.activeElement!==n)return}rc(PNe,"focusFirst");function DNe(e){const t=NV(e),n=xB(t,e),i=xB(t.reverse(),e);return[n,i]}rc(DNe,"getTabbableEdges");function NV(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:rc(i=>{const r=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||r?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}rc(NV,"getTabbableCandidates");function xB(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const i of e)if(!(n?!i.checkVisibility({checkVisibilityCSS:!0}):MNe(i,{upTo:t})))return i}rc(xB,"findVisible");function MNe(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}rc(MNe,"isHidden");function LNe(e){return e instanceof HTMLInputElement&&"select"in e}rc(LNe,"isSelectableInput");function dp(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&LNe(e)&&t&&e.select()}}rc(dp,"focus");var mee=$Ne();function $Ne(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=wB(e,t),e.unshift(t)},remove(t){var n;e=wB(e,t),(n=e[0])==null||n.resume()}}}rc($Ne,"createFocusScopesStack");function wB(e,t){const n=[...e],i=n.indexOf(t);return i!==-1&&n.splice(i,1),n}rc(wB,"arrayRemove");function FNe(e){return e.filter(t=>t.tagName!=="A")}rc(FNe,"removeLinks");var Qlt=Object.defineProperty,zlt=(e,t)=>Qlt(e,"name",{value:t,configurable:!0}),RV=p.forwardRef(zlt(function(t,n){var c;const{container:i,...r}=t,[s,o]=p.useState(!1);Od(()=>o(!0),[]);const l=i||s&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return l?yi.createPortal(a.jsx(Xr.div,{...r,ref:n}),l):null},"Portal")),Vlt=Object.defineProperty,IV=(e,t)=>Vlt(e,"name",{value:t,configurable:!0}),u_=0,Qf=null;function Hlt(e){return rM(),e.children}IV(Hlt,"FocusGuards");function rM(){p.useEffect(()=>{Qf||(Qf={start:OB(),end:OB()});const{start:e,end:t}=Qf;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),u_++,()=>{u_===1&&(Qf==null||Qf.start.remove(),Qf==null||Qf.end.remove(),Qf=null),u_=Math.max(0,u_-1)}},[])}IV(rM,"useFocusGuards");function OB(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}IV(OB,"createFocusGuard");var Jf=function(){return Jf=Object.assign||function(t){for(var n,i=1,r=arguments.length;i"u")return lct;var t=cct(e),n=document.documentElement.clientWidth,i=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,i-n+t[2]-t[0])}},dct=zNe(),cw="data-scroll-locked",fct=function(e,t,n,i){var r=e.left,s=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),` + .`.concat(Wlt,` { overflow: hidden `).concat(i,`; padding-right: `).concat(l,"px ").concat(i,`; } - body[`).concat(lw,`] { + body[`).concat(cw,`] { overflow: hidden `).concat(i,`; overscroll-behavior: contain; `).concat([t&&"position: relative ".concat(i,";"),n==="margin"&&` @@ -496,179 +496,179 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...o?{snapshot:!0}:{}})}`)}(t.type== `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(i,";")].filter(Boolean).join(""),` } - .`).concat(wN,` { + .`).concat(ON,` { right: `).concat(l,"px ").concat(i,`; } - .`).concat(ON,` { + .`).concat(kN,` { margin-right: `).concat(l,"px ").concat(i,`; } - .`).concat(wN," .").concat(wN,` { + .`).concat(ON," .").concat(ON,` { right: 0 `).concat(i,`; } - .`).concat(ON," .").concat(ON,` { + .`).concat(kN," .").concat(kN,` { margin-right: 0 `).concat(i,`; } - body[`).concat(lw,`] { - `).concat(qlt,": ").concat(l,`px; + body[`).concat(cw,`] { + `).concat(Klt,": ").concat(l,`px; } -`)},gee=function(){var e=parseInt(document.body.getAttribute(lw)||"0",10);return isFinite(e)?e:0},dct=function(){p.useEffect(function(){return document.body.setAttribute(lw,(gee()+1).toString()),function(){var e=gee()-1;e<=0?document.body.removeAttribute(lw):document.body.setAttribute(lw,e.toString())}},[])},fct=function(e){var t=e.noRelative,n=e.noImportant,i=e.gapMode,r=i===void 0?"margin":i;dct();var s=p.useMemo(function(){return lct(r)},[r]);return p.createElement(cct,{styles:uct(s,!t,r,n?"":"!important")})},OB=!1;if(typeof window<"u")try{var u_=Object.defineProperty({},"passive",{get:function(){return OB=!0,!0}});window.addEventListener("test",u_,u_),window.removeEventListener("test",u_,u_)}catch{OB=!1}var Iv=OB?{passive:!1}:!1,hct=function(e){return e.tagName==="TEXTAREA"},zNe=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!hct(e)&&n[t]==="visible")},pct=function(e){return zNe(e,"overflowY")},mct=function(e){return zNe(e,"overflowX")},bee=function(e,t){var n=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var r=VNe(e,i);if(r){var s=HNe(e,i),o=s[1],l=s[2];if(o>l)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},gct=function(e){var t=e.scrollTop,n=e.scrollHeight,i=e.clientHeight;return[t,n,i]},bct=function(e){var t=e.scrollLeft,n=e.scrollWidth,i=e.clientWidth;return[t,n,i]},VNe=function(e,t){return e==="v"?pct(t):mct(t)},HNe=function(e,t){return e==="v"?gct(t):bct(t)},yct=function(e,t){return e==="h"&&t==="rtl"?-1:1},vct=function(e,t,n,i,r){var s=yct(e,window.getComputedStyle(t).direction),o=s*i,l=n.target,c=t.contains(l),u=!1,d=o>0,f=0,h=0;do{if(!l)break;var m=HNe(e,l),g=m[0],b=m[1],v=m[2],y=b-v-s*g;(g||y)&&VNe(e,l)&&(f+=y,h+=g);var w=l.parentNode;l=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&Math.abs(f)<1||!d&&Math.abs(h)<1)&&(u=!0),u},d_=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},yee=function(e){return[e.deltaX,e.deltaY]},vee=function(e){return e&&"current"in e?e.current:e},xct=function(e,t){return e[0]===t[0]&&e[1]===t[1]},wct=function(e){return` +`)},bee=function(){var e=parseInt(document.body.getAttribute(cw)||"0",10);return isFinite(e)?e:0},hct=function(){p.useEffect(function(){return document.body.setAttribute(cw,(bee()+1).toString()),function(){var e=bee()-1;e<=0?document.body.removeAttribute(cw):document.body.setAttribute(cw,e.toString())}},[])},pct=function(e){var t=e.noRelative,n=e.noImportant,i=e.gapMode,r=i===void 0?"margin":i;hct();var s=p.useMemo(function(){return uct(r)},[r]);return p.createElement(dct,{styles:fct(s,!t,r,n?"":"!important")})},kB=!1;if(typeof window<"u")try{var d_=Object.defineProperty({},"passive",{get:function(){return kB=!0,!0}});window.addEventListener("test",d_,d_),window.removeEventListener("test",d_,d_)}catch{kB=!1}var Pv=kB?{passive:!1}:!1,mct=function(e){return e.tagName==="TEXTAREA"},VNe=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!mct(e)&&n[t]==="visible")},gct=function(e){return VNe(e,"overflowY")},bct=function(e){return VNe(e,"overflowX")},yee=function(e,t){var n=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var r=HNe(e,i);if(r){var s=qNe(e,i),o=s[1],l=s[2];if(o>l)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},yct=function(e){var t=e.scrollTop,n=e.scrollHeight,i=e.clientHeight;return[t,n,i]},vct=function(e){var t=e.scrollLeft,n=e.scrollWidth,i=e.clientWidth;return[t,n,i]},HNe=function(e,t){return e==="v"?gct(t):bct(t)},qNe=function(e,t){return e==="v"?yct(t):vct(t)},xct=function(e,t){return e==="h"&&t==="rtl"?-1:1},wct=function(e,t,n,i,r){var s=xct(e,window.getComputedStyle(t).direction),o=s*i,l=n.target,c=t.contains(l),u=!1,d=o>0,f=0,h=0;do{if(!l)break;var m=qNe(e,l),g=m[0],b=m[1],v=m[2],y=b-v-s*g;(g||y)&&HNe(e,l)&&(f+=y,h+=g);var w=l.parentNode;l=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&Math.abs(f)<1||!d&&Math.abs(h)<1)&&(u=!0),u},f_=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},vee=function(e){return[e.deltaX,e.deltaY]},xee=function(e){return e&&"current"in e?e.current:e},Oct=function(e,t){return e[0]===t[0]&&e[1]===t[1]},kct=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},Oct=0,Pv=[];function kct(e){var t=p.useRef([]),n=p.useRef([0,0]),i=p.useRef(),r=p.useState(Oct++)[0],s=p.useState(QNe)[0],o=p.useRef(e);p.useEffect(function(){o.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var b=Vlt([e.lockRef.current],(e.shards||[]).map(vee),!0).filter(Boolean);return b.forEach(function(v){return v.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),b.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var l=p.useCallback(function(b,v){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!o.current.allowPinchZoom;var y=d_(b),w=n.current,x="deltaX"in b?b.deltaX:w[0]-y[0],O="deltaY"in b?b.deltaY:w[1]-y[1],k,S=b.target,C=Math.abs(x)>Math.abs(O)?"h":"v";if("touches"in b&&C==="h"&&S.type==="range")return!1;var E=window.getSelection(),j=E&&E.anchorNode,T=j?j===S||j.contains(S):!1;if(T)return!1;var R=bee(C,S);if(!R)return!0;if(R?k=C:(k=C==="v"?"h":"v",R=bee(C,S)),!R)return!1;if(!i.current&&"changedTouches"in b&&(x||O)&&(i.current=k),!k)return!0;var A=i.current||k;return vct(A,v,b,A==="h"?x:O)},[]),c=p.useCallback(function(b){var v=b;if(!(!Pv.length||Pv[Pv.length-1]!==s)){var y="deltaY"in v?yee(v):d_(v),w=t.current.filter(function(k){return k.name===v.type&&(k.target===v.target||v.target===k.shadowParent)&&xct(k.delta,y)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var x=(o.current.shards||[]).map(vee).filter(Boolean).filter(function(k){return k.contains(v.target)}),O=x.length>0?l(v,x[0]):!o.current.noIsolation;O&&v.cancelable&&v.preventDefault()}}},[]),u=p.useCallback(function(b,v,y,w){var x={name:b,delta:v,target:y,should:w,shadowParent:Sct(y)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(O){return O!==x})},1)},[]),d=p.useCallback(function(b){n.current=d_(b),i.current=void 0},[]),f=p.useCallback(function(b){u(b.type,yee(b),b.target,l(b,e.lockRef.current))},[]),h=p.useCallback(function(b){u(b.type,d_(b),b.target,l(b,e.lockRef.current))},[]);p.useEffect(function(){return Pv.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Iv),document.addEventListener("touchmove",c,Iv),document.addEventListener("touchstart",d,Iv),function(){Pv=Pv.filter(function(b){return b!==s}),document.removeEventListener("wheel",c,Iv),document.removeEventListener("touchmove",c,Iv),document.removeEventListener("touchstart",d,Iv)}},[]);var m=e.removeScrollBar,g=e.inert;return p.createElement(p.Fragment,null,g?p.createElement(s,{styles:wct(r)}):null,m?p.createElement(fct,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Sct(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ect=Jlt(UNe,kct);var IV=p.forwardRef(function(e,t){return p.createElement(sM,Zf({},e,{ref:t,sideCar:Ect}))});IV.classNames=sM.classNames;var Cct=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Dv=new WeakMap,f_=new WeakMap,h_={},t4=0,qNe=function(e){return e&&(e.host||qNe(e.parentNode))},Act=function(e,t){return t.map(function(n){if(e.contains(n))return n;var i=qNe(n);return i&&e.contains(i)?i:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Tct=function(e,t,n,i){var r=Act(t,Array.isArray(e)?e:[e]);h_[n]||(h_[n]=new WeakMap);var s=h_[n],o=[],l=new Set,c=new Set(r),u=function(f){!f||l.has(f)||(l.add(f),u(f.parentNode))};r.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(h){if(l.has(h))d(h);else try{var m=h.getAttribute(i),g=m!==null&&m!=="false",b=(Dv.get(h)||0)+1,v=(s.get(h)||0)+1;Dv.set(h,b),s.set(h,v),o.push(h),b===1&&g&&f_.set(h,!0),v===1&&h.setAttribute(n,"true"),g||h.setAttribute(i,"true")}catch(y){console.error("aria-hidden: cannot operate on ",h,y)}})};return d(t),l.clear(),t4++,function(){o.forEach(function(f){var h=Dv.get(f)-1,m=s.get(f)-1;Dv.set(f,h),s.set(f,m),h||(f_.has(f)||f.removeAttribute(i),f_.delete(f)),m||f.removeAttribute(n)}),t4--,t4||(Dv=new WeakMap,Dv=new WeakMap,f_=new WeakMap,h_={})}},WNe=function(e,t,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),r=Cct(e);return r?(i.push.apply(i,Array.from(r.querySelectorAll("[aria-live], script"))),Tct(i,r,n,"aria-hidden")):function(){return null}},_ct=Object.defineProperty,jct=(e,t)=>_ct(e,"name",{value:t,configurable:!0});function XA(e){const[t,n]=p.useState(void 0);return xd(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const i=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const s=r[0];let o,l;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,l=u.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}else n(void 0)},[e]),t}jct(XA,"useSize");var Nct=Object.defineProperty,Yp=(e,t)=>Nct(e,"name",{value:t,configurable:!0}),PV="Checkbox",[Rct,ghn]=Hc(PV),[Ict,DV]=Rct(PV);function KNe(e){const{__scopeCheckbox:t,checked:n,children:i,defaultChecked:r,disabled:s,form:o,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=e,[h,m]=jd({prop:n,defaultProp:r??!1,onChange:c,caller:PV}),[g,b]=p.useState(null),[v,y]=p.useState(null),w=p.useRef(!1),[x,O]=p.useReducer(C=>C+1,0),k=g?!!o||!!g.closest("form"):!0,S={checked:h,disabled:s,setChecked:m,control:g,setControl:b,name:l,form:o,value:d,hasConsumerStoppedPropagationRef:w,userInteractionCount:x,onUserInteraction:O,required:u,defaultChecked:Mp(r)?!1:r,isFormControl:k,bubbleInput:v,setBubbleInput:y};return a.jsx(Ict,{scope:t,...S,children:GNe(f)?f(S):i})}Yp(KNe,"CheckboxProvider");var Pct="CheckboxTrigger",Dct=p.forwardRef(Yp(function({__scopeCheckbox:t,onKeyDown:n,onClick:i,...r},s){const{control:o,value:l,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,onUserInteraction:g,isFormControl:b,bubbleInput:v}=DV(Pct,t),y=_r(s,f),w=p.useRef(u);return p.useEffect(()=>{const x=o==null?void 0:o.form;if(x){const O=Yp(()=>h(w.current),"reset");return x.addEventListener("reset",O),()=>x.removeEventListener("reset",O)}},[o,h]),a.jsx(Xr.button,{type:"button",role:"checkbox","aria-checked":Mp(u)?"mixed":u,"aria-required":d,"data-state":MV(u),"data-disabled":c?"":void 0,disabled:c,value:l,...r,ref:y,onKeyDown:Qn(n,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:Qn(i,x=>{g(),h(O=>Mp(O)?!0:!O),v&&b&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})})},"CheckboxTrigger")),Mct=p.forwardRef(Yp(function(t,n){const{__scopeCheckbox:i,name:r,checked:s,defaultChecked:o,required:l,disabled:c,value:u,onCheckedChange:d,form:f,...h}=t;return a.jsx(KNe,{__scopeCheckbox:i,checked:s,defaultChecked:o,disabled:c,required:l,onCheckedChange:d,name:r,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>a.jsxs(a.Fragment,{children:[a.jsx(Dct,{...h,ref:n,__scopeCheckbox:i}),m&&a.jsx(Bct,{__scopeCheckbox:i})]})})},"Checkbox")),Lct="CheckboxIndicator",$ct=p.forwardRef(Yp(function(t,n){const{__scopeCheckbox:i,forceMount:r,...s}=t,o=DV(Lct,i);return a.jsx(_h,{present:r||Mp(o.checked)||o.checked===!0,children:a.jsx(Xr.span,{"data-state":MV(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:n,style:{pointerEvents:"none",...t.style}})})},"CheckboxIndicator")),Fct="CheckboxBubbleInput",Bct=p.forwardRef(Yp(function({__scopeCheckbox:t,onClick:n,...i},r){const{control:s,hasConsumerStoppedPropagationRef:o,userInteractionCount:l,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:m,form:g,bubbleInput:b,setBubbleInput:v}=DV(Fct,t),y=_r(r,v),w=XA(s),x=p.useRef(!1),O=p.useRef(c),k=p.useRef(l);p.useEffect(()=>{const C=b;if(!C)return;const E=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(E,"checked").set,R=l!==k.current;k.current=l;const A=O.current!==c;O.current=c;const N=!(R&&o.current);if(A&&T){x.current=!R;const P=new Event("click",{bubbles:N});C.indeterminate=Mp(c),T.call(C,Mp(c)?!1:c),C.dispatchEvent(P),x.current=!1}},[b,c,o,l]);const S=p.useRef(Mp(c)?!1:c);return a.jsx(Xr.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??S.current,required:d,disabled:f,name:h,value:m,form:g,...i,tabIndex:-1,ref:y,onClick:Qn(n,C=>{x.current&&C.stopPropagation()}),style:{...i.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function GNe(e){return typeof e=="function"}Yp(GNe,"isFunction");function Mp(e){return e==="indeterminate"}Yp(Mp,"isIndeterminate");function MV(e){return Mp(e)?"indeterminate":e?"checked":"unchecked"}Yp(MV,"getState");var Uct=Object.defineProperty,Pg=(e,t)=>Uct(e,"name",{value:t,configurable:!0}),XNe="Popper",[YNe,W1]=Hc(XNe),[Qct,ZNe]=YNe(XNe),zct=Pg(e=>{const{__scopePopper:t,children:n}=e,[i,r]=p.useState(null),[s,o]=p.useState(void 0);return a.jsx(Qct,{scope:t,anchor:i,onAnchorChange:r,placementState:s,setPlacementState:o,children:n})},"Popper"),Vct="PopperAnchor",Hct=p.forwardRef(Pg(function(t,n){const{__scopePopper:i,virtualRef:r,...s}=t,o=ZNe(Vct,i),l=p.useRef(null),c=o.onAnchorChange,u=p.useCallback(b=>{l.current=b,b&&c(b)},[c]),d=_r(n,u),f=p.useRef(null);p.useEffect(()=>{if(!r)return;const b=f.current;f.current=r.current,b!==f.current&&c(f.current)});const h=o.placementState&&aM(o.placementState),m=h==null?void 0:h[0],g=h==null?void 0:h[1];return r?null:a.jsx(Xr.div,{"data-radix-popper-side":m,"data-radix-popper-align":g,...s,ref:d})},"PopperAnchor")),JNe="PopperContent",[qct,bhn]=YNe(JNe),Wct=p.forwardRef(Pg(function(t,n){var G,H,se,Y,X,ie,ee;const{__scopePopper:i,side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:b,...v}=t,y=ZNe(JNe,i),[w,x]=p.useState(null),O=_r(n,x),[k,S]=p.useState(null),C=XA(k),E=(C==null?void 0:C.width)??0,j=(C==null?void 0:C.height)??0,T=r+(o!=="center"?"-"+o:""),R=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},A=Array.isArray(d)?d:[d],N=A.length>0,P={padding:R,boundary:A.filter(eRe),altBoundary:N},{refs:I,floatingStyles:D,placement:_,isPositioned:L,middlewareData:F}=G_e({strategy:"fixed",placement:T,whileElementsMounted:Pg((...be)=>aB(...be,{animationFrame:g==="always"}),"whileElementsMounted"),elements:{reference:y.anchor},middleware:[X_e({mainAxis:s+j,alignmentAxis:l}),u&&Y_e({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?Z_e():void 0,...P}),u&&J_e({...P}),eje({...P,apply:Pg(({elements:be,rects:ue,availableWidth:pe,availableHeight:ke})=>{const{width:je,height:Pe}=ue.reference,Ee=be.floating.style;Ee.setProperty("--radix-popper-available-width",`${pe}px`),Ee.setProperty("--radix-popper-available-height",`${ke}px`),Ee.setProperty("--radix-popper-anchor-width",`${je}px`),Ee.setProperty("--radix-popper-anchor-height",`${Pe}px`)},"apply")}),k&&tst({element:k,padding:c}),Kct({arrowWidth:E,arrowHeight:j}),m&&est({strategy:"referenceHidden",...P,boundary:N?P.boundary:void 0})]}),M=y.setPlacementState;xd(()=>(M(_),()=>{M(void 0)}),[_,M]);const[V,q]=aM(_),U=xf(b);xd(()=>{L&&(U==null||U())},[L,U]);const J=(G=F.arrow)==null?void 0:G.x,z=(H=F.arrow)==null?void 0:H.y,Z=((se=F.arrow)==null?void 0:se.centerOffset)!==0,[ne,W]=p.useState();return xd(()=>{w&&W(window.getComputedStyle(w).zIndex)},[w]),a.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:L?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ne,"--radix-popper-transform-origin":[(Y=F.transformOrigin)==null?void 0:Y.x,(X=F.transformOrigin)==null?void 0:X.y].join(" "),...((ie=F.hide)==null?void 0:ie.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:a.jsx(qct,{scope:i,placedSide:V,placedAlign:q,onArrowChange:S,arrowX:J,arrowY:z,shouldHideArrow:Z,children:a.jsx(Xr.div,{"data-side":V,"data-align":q,...v,ref:O,style:{...v.style,animation:L?(ee=v.style)==null?void 0:ee.animation:"none"}})})})},"PopperContent"));function eRe(e){return e!==null}Pg(eRe,"isNotNull");var Kct=Pg(e=>({name:"transformOrigin",options:e,fn(t){var v,y,w;const{placement:n,rects:i,middlewareData:r}=t,o=((v=r.arrow)==null?void 0:v.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[u,d]=aM(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(((y=r.arrow)==null?void 0:y.x)??0)+l/2,m=(((w=r.arrow)==null?void 0:w.y)??0)+c/2;let g="",b="";return u==="bottom"?(g=o?f:`${h}px`,b=`${-c}px`):u==="top"?(g=o?f:`${h}px`,b=`${i.floating.height+c}px`):u==="right"?(g=`${-c}px`,b=o?f:`${m}px`):u==="left"&&(g=`${i.floating.width+c}px`,b=o?f:`${m}px`),{data:{x:g,y:b}}}}),"transformOrigin");function aM(e){const[t,n="center"]=e.split("-");return[t,n]}Pg(aM,"getSideAndAlignFromPlacement");var oM=zct,LV=Hct,$V=Wct,Gct=Object.defineProperty,FV=(e,t)=>Gct(e,"name",{value:t,configurable:!0}),n4=!1;function tRe(){const[e,t]=p.useState(n4);return p.useEffect(()=>{n4||(n4=!0,t(!0))},[]),e}FV(tRe,"useIsHydrated");var nRe=I0[" useSyncExternalStore ".trim().toString()];function iRe(){return()=>{}}FV(iRe,"subscribe");function rRe(){return nRe(iRe,()=>!0,()=>!1)}FV(rRe,"useIsHydratedModern");var Xct=typeof nRe=="function"?rRe:tRe,Yct=Object.defineProperty,V0=(e,t)=>Yct(e,"name",{value:t,configurable:!0}),i4="rovingFocusGroup.onEntryFocus",Zct={bubbles:!1,cancelable:!0},lM="RovingFocusGroup",[kB,sRe,Jct]=CV(lM),[eut,K1]=Hc(lM,[Jct]),[tut,nut]=eut(lM),iut=p.forwardRef(V0(function(t,n){return a.jsx(kB.Provider,{scope:t.__scopeRovingFocusGroup,children:a.jsx(kB.Slot,{scope:t.__scopeRovingFocusGroup,children:a.jsx(rut,{...t,ref:n})})})},"RovingFocusGroup")),rut=p.forwardRef(V0(function(t,n){const{__scopeRovingFocusGroup:i,orientation:r,loop:s=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...h}=t,m=p.useRef(null),g=_r(n,m),b=GA(o),[v,y]=jd({prop:l,defaultProp:c??null,onChange:u,caller:lM}),[w,x]=p.useState(!1),O=xf(d),k=sRe(i),S=p.useRef(!1),[C,E]=p.useState(0);return p.useEffect(()=>{const j=m.current;if(j)return j.addEventListener(i4,O),()=>j.removeEventListener(i4,O)},[O]),a.jsx(tut,{scope:i,orientation:r,dir:b,loop:s,currentTabStopId:v,onItemFocus:p.useCallback(j=>y(j),[y]),onItemShiftTab:p.useCallback(()=>x(!0),[]),onFocusableItemAdd:p.useCallback(()=>E(j=>j+1),[]),onFocusableItemRemove:p.useCallback(()=>E(j=>j-1),[]),children:a.jsx(Xr.div,{tabIndex:w||C===0?-1:0,"data-orientation":r,...h,ref:g,style:{outline:"none",...t.style},onMouseDown:Qn(t.onMouseDown,()=>{S.current=!0}),onFocus:Qn(t.onFocus,j=>{const T=!S.current;if(j.target===j.currentTarget&&T&&!w){const R=new CustomEvent(i4,Zct);if(j.currentTarget.dispatchEvent(R),!R.defaultPrevented){const A=k().filter(_=>_.focusable),N=A.find(_=>_.active),P=A.find(_=>_.id===v),D=[N,P,...A].filter(Boolean).map(_=>_.ref.current);BV(D,f)}}S.current=!1}),onBlur:Qn(t.onBlur,()=>x(!1))})})},"RovingFocusGroupImpl")),sut="RovingFocusGroupItem",aut=p.forwardRef(V0(function(t,n){const{__scopeRovingFocusGroup:i,focusable:r=!0,active:s=!1,tabStopId:o,children:l,...c}=t,u=tb(),d=o||u,f=nut(sut,i),h=f.currentTabStopId===d,m=sRe(i),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:v}=f,y=Xct();return xd(()=>{if(!(!y||!r))return g(),()=>b()},[y,r,g,b]),p.useEffect(()=>{if(!(y||!r))return g(),()=>b()},[y,r,g,b]),a.jsx(kB.ItemSlot,{scope:i,id:d,focusable:r,active:s,children:a.jsx(Xr.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...c,ref:n,onMouseDown:Qn(t.onMouseDown,w=>{r?f.onItemFocus(d):w.preventDefault()}),onFocus:Qn(t.onFocus,()=>f.onItemFocus(d)),onKeyDown:Qn(t.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){f.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const x=oRe(w,f.orientation,f.dir);if(x!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let k=m().filter(S=>S.focusable).map(S=>S.ref.current);if(x==="last")k.reverse();else if(x==="prev"||x==="next"){x==="prev"&&k.reverse();const S=k.indexOf(w.currentTarget);k=f.loop?lRe(k,S+1):k.slice(S+1)}setTimeout(()=>BV(k))}}),children:typeof l=="function"?l({isCurrentTabStop:h,hasTabStop:v!=null}):l})})},"RovingFocusGroupItem")),out={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function aRe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}V0(aRe,"getDirectionAwareKey");function oRe(e,t,n){const i=aRe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return out[i]}V0(oRe,"getFocusIntent");function BV(e,t=!1){const n=document.activeElement;for(const i of e)if(i===n||(i.focus({preventScroll:t}),document.activeElement!==n))return}V0(BV,"focusFirst");function lRe(e,t){return e.map((n,i)=>e[(t+i)%e.length])}V0(lRe,"wrapArray");var UV=iut,QV=aut,lut=Object.defineProperty,fr=(e,t)=>lut(e,"name",{value:t,configurable:!0}),SB=["Enter"," "],cut=["ArrowDown","PageUp","Home"],cRe=["ArrowUp","PageDown","End"],uut=[...cut,...cRe],dut={ltr:[...SB,"ArrowRight"],rtl:[...SB,"ArrowLeft"]},fut={ltr:["ArrowLeft"],rtl:["ArrowRight"]},cM="Menu",[mC,hut,put]=CV(cM),[H0,uRe]=Hc(cM,[put,W1,K1]),uM=W1(),dRe=K1(),[fRe,Eb]=H0(cM),[mut,YA]=H0(cM),gut=fr(e=>{const{__scopeMenu:t,open:n=!1,children:i,dir:r,onOpenChange:s,modal:o=!0}=e,l=uM(t),[c,u]=p.useState(null),d=p.useRef(!1),f=xf(s),h=GA(r);return p.useEffect(()=>{const m=fr(()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},"handleKeyDown"),g=fr(()=>d.current=!1,"handlePointer");return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),p.useEffect(()=>{if(!n)return;const m=fr(()=>f(!1),"handleBlur");return window.addEventListener("blur",m),()=>window.removeEventListener("blur",m)},[n,f]),a.jsx(oM,{...l,children:a.jsx(fRe,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:u,children:a.jsx(mut,{scope:t,onClose:p.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:o,children:i})})})},"Menu"),hRe=p.forwardRef(fr(function(t,n){const{__scopeMenu:i,...r}=t,s=uM(i);return a.jsx(LV,{...s,...r,ref:n})},"MenuAnchor")),pRe="MenuPortal",[but,mRe]=H0(pRe,{forceMount:void 0}),yut=fr(e=>{const{__scopeMenu:t,forceMount:n,children:i,container:r}=e,s=Eb(pRe,t);return a.jsx(but,{scope:t,forceMount:n,children:a.jsx(_h,{present:n||s.open,children:a.jsx(NV,{asChild:!0,container:r,children:i})})})},"MenuPortal"),hf="MenuContent",[vut,zV]=H0(hf),xut=p.forwardRef(fr(function(t,n){const i=mRe(hf,t.__scopeMenu),{forceMount:r=i.forceMount,...s}=t,o=Eb(hf,t.__scopeMenu),l=YA(hf,t.__scopeMenu);return a.jsx(mC.Provider,{scope:t.__scopeMenu,children:a.jsx(_h,{present:r||o.open,children:a.jsx(mC.Slot,{scope:t.__scopeMenu,children:l.modal?a.jsx(wut,{...s,ref:n}):a.jsx(Out,{...s,ref:n})})})})},"MenuContent")),wut=p.forwardRef(fr(function(t,n){const i=Eb(hf,t.__scopeMenu),r=p.useRef(null),s=_r(n,r);return p.useEffect(()=>{const o=r.current;if(o)return WNe(o)},[]),a.jsx(VV,{...t,ref:s,trapFocus:i.open,disableOutsidePointerEvents:i.open,disableOutsideScroll:!0,onFocusOutside:Qn(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentModal")),Out=p.forwardRef(fr(function(t,n){const i=Eb(hf,t.__scopeMenu);return a.jsx(VV,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentNonModal")),kut=Gp("MenuContent.ScrollLock"),VV=p.forwardRef(fr(function(t,n){const{__scopeMenu:i,loop:r=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,disableOutsideScroll:b,...v}=t,y=Eb(hf,i),w=YA(hf,i),x=uM(i),O=dRe(i),k=hut(i),[S,C]=p.useState(null),E=p.useRef(null),j=_r(n,E,y.onContentChange),T=p.useRef(0),R=p.useRef(""),A=p.useRef(0),N=p.useRef(null),P=p.useRef("right"),I=p.useRef(0),D=b?IV:p.Fragment,_=b?{as:kut,allowPinchZoom:!0}:void 0,L=fr(M=>{var W,G;const V=R.current+M,q=k().filter(H=>!H.disabled),U=document.activeElement,J=(W=q.find(H=>H.ref.current===U))==null?void 0:W.textValue,z=q.map(H=>H.textValue),Z=kRe(z,V,J),ne=(G=q.find(H=>H.textValue===Z))==null?void 0:G.ref.current;fr(function H(se){R.current=se,window.clearTimeout(T.current),se!==""&&(T.current=window.setTimeout(()=>H(""),1e3))},"updateSearch")(V),ne&&setTimeout(()=>ne.focus())},"handleTypeaheadSearch");p.useEffect(()=>()=>window.clearTimeout(T.current),[]),rM();const F=p.useCallback(M=>{var q,U;return P.current===((q=N.current)==null?void 0:q.side)&&ERe(M,(U=N.current)==null?void 0:U.area)},[]);return a.jsx(vut,{scope:i,searchRef:R,onItemEnter:p.useCallback(M=>{F(M)&&M.preventDefault()},[F]),onItemLeave:p.useCallback(M=>{var V;F(M)||((V=E.current)==null||V.focus(),C(null))},[F]),onTriggerLeave:p.useCallback(M=>{F(M)&&M.preventDefault()},[F]),pointerGraceTimerRef:A,onPointerGraceIntentChange:p.useCallback(M=>{N.current=M},[]),children:a.jsx(D,{..._,children:a.jsx(RNe,{asChild:!0,trapped:s,onMountAutoFocus:Qn(o,M=>{var V;M.preventDefault(),(V=E.current)==null||V.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:a.jsx(TV,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,children:a.jsx(UV,{asChild:!0,...O,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:Qn(u,M=>{w.isUsingKeyboardRef.current||M.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx($V,{role:"menu","aria-orientation":"vertical","data-state":qV(y.open),"data-radix-menu-content":"",dir:w.dir,...x,...v,ref:j,style:{outline:"none",...v.style},onKeyDown:Qn(v.onKeyDown,M=>{const q=M.target.closest("[data-radix-menu-content]")===M.currentTarget,U=M.ctrlKey||M.altKey||M.metaKey,J=M.key.length===1;q&&(M.key==="Tab"&&M.preventDefault(),!U&&J&&L(M.key));const z=E.current;if(M.target!==z||!uut.includes(M.key))return;M.preventDefault();const ne=k().filter(W=>!W.disabled).map(W=>W.ref.current);cRe.includes(M.key)&&ne.reverse(),wRe(ne)}),onBlur:Qn(t.onBlur,M=>{M.currentTarget.contains(M.target)||(window.clearTimeout(T.current),R.current="")}),onPointerMove:Qn(t.onPointerMove,Zw(M=>{const V=M.target,q=I.current!==M.clientX;if(M.currentTarget.contains(V)&&q){const U=M.clientX>I.current?"right":"left";P.current=U,I.current=M.clientX}}))})})})})})})},"MenuContentImpl")),Sut=p.forwardRef(fr(function(t,n){const{__scopeMenu:i,...r}=t;return a.jsx(Xr.div,{role:"group",...r,ref:n})},"MenuGroup")),EB="MenuItem",xee="menu.itemSelect",HV=p.forwardRef(fr(function(t,n){const{disabled:i=!1,onSelect:r,...s}=t,o=p.useRef(null),l=YA(EB,t.__scopeMenu),c=zV(EB,t.__scopeMenu),u=_r(n,o),d=p.useRef(!1),f=fr(()=>{const h=o.current;if(!i&&h){const m=new CustomEvent(xee,{bubbles:!0,cancelable:!0});h.addEventListener(xee,g=>r==null?void 0:r(g),{once:!0}),EV(h,m),m.defaultPrevented?d.current=!1:l.onClose()}},"handleSelect");return a.jsx(gRe,{...s,ref:u,disabled:i,onClick:Qn(t.onClick,f),onPointerDown:h=>{var m;(m=t.onPointerDown)==null||m.call(t,h),d.current=!0},onPointerUp:Qn(t.onPointerUp,h=>{var m;d.current||(m=h.currentTarget)==null||m.click()}),onKeyDown:Qn(t.onKeyDown,h=>{i||h.target!==h.currentTarget||c.searchRef.current!==""&&h.key===" "||SB.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})},"MenuItem")),gRe=p.forwardRef(fr(function(t,n){const{__scopeMenu:i,disabled:r=!1,textValue:s,...o}=t,l=zV(EB,i),c=dRe(i),u=p.useRef(null),d=_r(n,u),[f,h]=p.useState(!1),[m,g]=p.useState("");return p.useEffect(()=>{const b=u.current;b&&g((b.textContent??"").trim())},[o.children]),a.jsx(mC.ItemSlot,{scope:i,disabled:r,textValue:s??m,children:a.jsx(QV,{asChild:!0,...c,focusable:!r,children:a.jsx(Xr.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:d,onPointerMove:Qn(t.onPointerMove,Zw(b=>{r?l.onItemLeave(b):(l.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Qn(t.onPointerLeave,Zw(b=>l.onItemLeave(b))),onFocus:Qn(t.onFocus,()=>h(!0)),onBlur:Qn(t.onBlur,()=>h(!1))})})})},"MenuItemImpl")),Eut=p.forwardRef(fr(function(t,n){const{checked:i=!1,onCheckedChange:r,...s}=t;return a.jsx(yRe,{scope:t.__scopeMenu,checked:i,children:a.jsx(HV,{role:"menuitemcheckbox","aria-checked":gC(i)?"mixed":i,...s,ref:n,"data-state":dM(i),onSelect:Qn(s.onSelect,()=>r==null?void 0:r(gC(i)?!0:!i),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),Cut="MenuRadioGroup",[Aut,Tut]=H0(Cut,{value:void 0,onValueChange:fr(()=>{},"onValueChange")}),_ut=p.forwardRef(fr(function(t,n){const{value:i,onValueChange:r,...s}=t,o=xf(r);return a.jsx(Aut,{scope:t.__scopeMenu,value:i,onValueChange:o,children:a.jsx(Sut,{...s,ref:n})})},"MenuRadioGroup")),jut="MenuRadioItem",Nut=p.forwardRef(fr(function(t,n){const{value:i,...r}=t,s=Tut(jut,t.__scopeMenu),o=i===s.value;return a.jsx(yRe,{scope:t.__scopeMenu,checked:o,children:a.jsx(HV,{role:"menuitemradio","aria-checked":o,...r,ref:n,"data-state":dM(o),onSelect:Qn(r.onSelect,()=>{var l;return(l=s.onValueChange)==null?void 0:l.call(s,i)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),bRe="MenuItemIndicator",[yRe,Rut]=H0(bRe,{checked:!1}),Iut=p.forwardRef(fr(function(t,n){const{__scopeMenu:i,forceMount:r,...s}=t,o=Rut(bRe,i);return a.jsx(_h,{present:r||gC(o.checked)||o.checked===!0,children:a.jsx(Xr.span,{...s,ref:n,"data-state":dM(o.checked)})})},"MenuItemIndicator")),Put=p.forwardRef(fr(function(t,n){const{__scopeMenu:i,...r}=t;return a.jsx(Xr.div,{role:"separator","aria-orientation":"horizontal",...r,ref:n})},"MenuSeparator")),vRe="MenuSub",[Dut,xRe]=H0(vRe),Mut=fr(e=>{const{__scopeMenu:t,children:n,open:i=!1,onOpenChange:r}=e,s=Eb(vRe,t),o=uM(t),[l,c]=p.useState(null),[u,d]=p.useState(null),f=xf(r);return p.useEffect(()=>(s.open===!1&&f(!1),()=>f(!1)),[s.open,f]),a.jsx(oM,{...o,children:a.jsx(fRe,{scope:t,open:i,onOpenChange:f,content:u,onContentChange:d,children:a.jsx(Dut,{scope:t,contentId:tb(),triggerId:tb(),trigger:l,onTriggerChange:c,children:n})})})},"MenuSub"),p_="MenuSubTrigger",Lut=p.forwardRef(fr(function(t,n){const i=Eb(p_,t.__scopeMenu),r=YA(p_,t.__scopeMenu),s=xRe(p_,t.__scopeMenu),o=zV(p_,t.__scopeMenu),l=p.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=o,d={__scopeMenu:t.__scopeMenu},f=p.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);p.useEffect(()=>f,[f]),p.useEffect(()=>{const m=c.current;return()=>{window.clearTimeout(m),u(null)}},[c,u]);const h=_r(n,s.onTriggerChange);return a.jsx(hRe,{asChild:!0,...d,children:a.jsx(gRe,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?s.contentId:void 0,"data-state":qV(i.open),...t,ref:h,onClick:m=>{var g;(g=t.onClick)==null||g.call(t,m),!(t.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),i.open||i.onOpenChange(!0))},onPointerMove:Qn(t.onPointerMove,Zw(m=>{o.onItemEnter(m),!m.defaultPrevented&&!t.disabled&&!i.open&&!l.current&&(o.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{i.onOpenChange(!0),f()},100))})),onPointerLeave:Qn(t.onPointerLeave,Zw(m=>{var b,v;f();const g=(b=i.content)==null?void 0:b.getBoundingClientRect();if(g){const y=(v=i.content)==null?void 0:v.dataset.side,w=y==="right",x=w?-5:5,O=g[w?"left":"right"],k=g[w?"right":"left"];o.onPointerGraceIntentChange({area:[{x:m.clientX+x,y:m.clientY},{x:O,y:g.top},{x:k,y:g.top},{x:k,y:g.bottom},{x:O,y:g.bottom}],side:y}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(m),m.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Qn(t.onKeyDown,m=>{var b;t.disabled||m.target!==m.currentTarget||o.searchRef.current!==""&&m.key===" "||dut[r.dir].includes(m.key)&&(i.onOpenChange(!0),(b=i.content)==null||b.focus(),m.preventDefault())})})})},"MenuSubTrigger")),$ut="MenuSubContent",Fut=p.forwardRef(fr(function(t,n){const i=mRe(hf,t.__scopeMenu),{forceMount:r=i.forceMount,align:s="start",...o}=t,l=Eb(hf,t.__scopeMenu),c=YA(hf,t.__scopeMenu),u=xRe($ut,t.__scopeMenu),d=p.useRef(null),f=_r(n,d);return a.jsx(mC.Provider,{scope:t.__scopeMenu,children:a.jsx(_h,{present:r||l.open,children:a.jsx(mC.Slot,{scope:t.__scopeMenu,children:a.jsx(VV,{id:u.contentId,"aria-labelledby":u.triggerId,...o,ref:f,align:s,side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{var m;c.isUsingKeyboardRef.current&&((m=d.current)==null||m.focus()),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:Qn(t.onFocusOutside,h=>{h.target!==u.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:Qn(t.onEscapeKeyDown,h=>{c.onClose(),h.preventDefault()}),onKeyDown:Qn(t.onKeyDown,h=>{var b;const m=h.currentTarget.contains(h.target),g=fut[c.dir].includes(h.key);m&&g&&(l.onOpenChange(!1),(b=u.trigger)==null||b.focus(),h.preventDefault())})})})})})},"MenuSubContent"));function qV(e){return e?"open":"closed"}fr(qV,"getOpenState");function gC(e){return e==="indeterminate"}fr(gC,"isIndeterminate");function dM(e){return gC(e)?"indeterminate":e?"checked":"unchecked"}fr(dM,"getCheckedState");function wRe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}fr(wRe,"focusFirst");function ORe(e,t){return e.map((n,i)=>e[(t+i)%e.length])}fr(ORe,"wrapArray");function kRe(e,t,n){const r=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let o=ORe(e,Math.max(s,0));r.length===1&&(o=o.filter(u=>u!==n));const c=o.find(u=>u.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}fr(kRe,"getNextMatch");function SRe(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,o=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}fr(SRe,"isPointInPolygon");function ERe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return SRe(n,t)}fr(ERe,"isPointerInGraceArea");function Zw(e){return t=>t.pointerType==="mouse"?e(t):void 0}fr(Zw,"whenMouse");var But=gut,Uut=hRe,Qut=yut,zut=xut,Vut=HV,Hut=Eut,qut=_ut,Wut=Nut,Kut=Iut,Gut=Put,Xut=Mut,Yut=Lut,Zut=Fut,Jut=Object.defineProperty,Fu=(e,t)=>Jut(e,"name",{value:t,configurable:!0}),WV="DropdownMenu",[edt,yhn]=Hc(WV,[uRe]),Bu=uRe(),[tdt,CRe]=edt(WV),ndt=Fu(e=>{const{__scopeDropdownMenu:t,children:n,dir:i,open:r,defaultOpen:s,onOpenChange:o,modal:l=!0}=e,c=Bu(t),u=p.useRef(null),[d,f]=jd({prop:r,defaultProp:s??!1,onChange:o,caller:WV});return a.jsx(tdt,{scope:t,triggerId:tb(),triggerRef:u,contentId:tb(),open:d,onOpenChange:f,onOpenToggle:p.useCallback(()=>f(h=>!h),[f]),modal:l,children:a.jsx(But,{...c,open:d,onOpenChange:f,dir:i,modal:l,children:n})})},"DropdownMenu"),idt="DropdownMenuTrigger",rdt=p.forwardRef(Fu(function(t,n){const{__scopeDropdownMenu:i,disabled:r=!1,...s}=t,o=CRe(idt,i),l=Bu(i),c=_r(n,o.triggerRef);return a.jsx(Uut,{asChild:!0,...l,children:a.jsx(Xr.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:c,onPointerDown:Qn(t.onPointerDown,u=>{!r&&u.button===0&&u.ctrlKey===!1&&(o.onOpenToggle(),o.open||u.preventDefault())}),onKeyDown:Qn(t.onKeyDown,u=>{r||(["Enter"," "].includes(u.key)&&o.onOpenToggle(),u.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})},"DropdownMenuTrigger")),sdt=Fu(e=>{const{__scopeDropdownMenu:t,...n}=e,i=Bu(t);return a.jsx(Qut,{...i,...n})},"DropdownMenuPortal"),adt="DropdownMenuContent",odt=p.forwardRef(Fu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=CRe(adt,i),o=Bu(i),l=p.useRef(!1);return a.jsx(zut,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...r,ref:n,onCloseAutoFocus:Qn(t.onCloseAutoFocus,c=>{var u;l.current||(u=s.triggerRef.current)==null||u.focus(),l.current=!1,c.preventDefault()}),onInteractOutside:Qn(t.onInteractOutside,c=>{const u=c.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;(!s.modal||f)&&(l.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),ldt=p.forwardRef(Fu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Bu(i);return a.jsx(Vut,{...s,...r,ref:n})},"DropdownMenuItem")),cdt=p.forwardRef(Fu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Bu(i);return a.jsx(Hut,{...s,...r,ref:n})},"DropdownMenuCheckboxItem")),udt=p.forwardRef(Fu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Bu(i);return a.jsx(qut,{...s,...r,ref:n})},"DropdownMenuRadioGroup")),ddt=p.forwardRef(Fu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Bu(i);return a.jsx(Wut,{...s,...r,ref:n})},"DropdownMenuRadioItem")),fdt=p.forwardRef(Fu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Bu(i);return a.jsx(Kut,{...s,...r,ref:n})},"DropdownMenuItemIndicator")),hdt=p.forwardRef(Fu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Bu(i);return a.jsx(Gut,{...s,...r,ref:n})},"DropdownMenuSeparator")),pdt=Fu(e=>{const{__scopeDropdownMenu:t,children:n,open:i,onOpenChange:r,defaultOpen:s}=e,o=Bu(t),[l,c]=jd({prop:i,defaultProp:s??!1,onChange:r,caller:"DropdownMenuSub"});return a.jsx(Xut,{...o,open:l,onOpenChange:c,children:n})},"DropdownMenuSub"),mdt=p.forwardRef(Fu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Bu(i);return a.jsx(Yut,{...s,...r,ref:n})},"DropdownMenuSubTrigger")),gdt=p.forwardRef(Fu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Bu(i);return a.jsx(Zut,{...s,...r,ref:n,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuSubContent")),bdt=ndt,ydt=rdt,ARe=sdt,vdt=odt,TRe=ldt,xdt=cdt,wdt=udt,Odt=ddt,_Re=fdt,kdt=hdt,Sdt=pdt,Edt=mdt,Cdt=gdt,Adt=Object.defineProperty,Cb=(e,t)=>Adt(e,"name",{value:t,configurable:!0}),KV="Popover",[jRe,vhn]=Hc(KV,[W1]),GV=W1(),[Tdt,G1]=jRe(KV),_dt=Cb(e=>{const{__scopePopover:t,children:n,open:i,defaultOpen:r,onOpenChange:s,modal:o=!1}=e,l=GV(t),c=p.useRef(null),[u,d]=p.useState(!1),[f,h]=jd({prop:i,defaultProp:r??!1,onChange:s,caller:KV});return a.jsx(oM,{...l,children:a.jsx(Tdt,{scope:t,contentId:tb(),triggerRef:c,open:f,onOpenChange:h,onOpenToggle:p.useCallback(()=>h(m=>!m),[h]),hasCustomAnchor:u,onCustomAnchorAdd:p.useCallback(()=>d(!0),[]),onCustomAnchorRemove:p.useCallback(()=>d(!1),[]),modal:o,children:n})})},"Popover"),jdt="PopoverTrigger",Ndt=p.forwardRef(Cb(function(t,n){const{__scopePopover:i,...r}=t,s=G1(jdt,i),o=GV(i),l=_r(n,s.triggerRef),c=a.jsx(Xr.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":XV(s.open),...r,ref:l,onClick:Qn(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:a.jsx(LV,{asChild:!0,...o,children:c})},"PopoverTrigger")),NRe="PopoverPortal",[Rdt,Idt]=jRe(NRe,{forceMount:void 0}),Pdt=Cb(e=>{const{__scopePopover:t,forceMount:n,children:i,container:r}=e,s=G1(NRe,t);return a.jsx(Rdt,{scope:t,forceMount:n,children:a.jsx(_h,{present:n||s.open,children:a.jsx(NV,{asChild:!0,container:r,children:i})})})},"PopoverPortal"),bC="PopoverContent",Ddt=p.forwardRef(Cb(function(t,n){const i=Idt(bC,t.__scopePopover),{forceMount:r=i.forceMount,...s}=t,o=G1(bC,t.__scopePopover);return a.jsx(_h,{present:r||o.open,children:o.modal?a.jsx(Ldt,{...s,ref:n}):a.jsx($dt,{...s,ref:n})})},"PopoverContent")),Mdt=Gp("PopoverContent.RemoveScroll"),Ldt=p.forwardRef(Cb(function(t,n){const i=G1(bC,t.__scopePopover),r=p.useRef(null),s=_r(n,r),o=p.useRef(!1);return p.useEffect(()=>{const l=r.current;if(l)return WNe(l)},[]),a.jsx(IV,{as:Mdt,allowPinchZoom:!0,children:a.jsx(RRe,{...t,ref:s,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Qn(t.onCloseAutoFocus,l=>{var c;l.preventDefault(),o.current||(c=i.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Qn(t.onPointerDownOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;o.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:Qn(t.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),$dt=p.forwardRef(Cb(function(t,n){const i=G1(bC,t.__scopePopover),r=p.useRef(!1),s=p.useRef(!1);return a.jsx(RRe,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,c;(l=t.onCloseAutoFocus)==null||l.call(t,o),o.defaultPrevented||(r.current||(c=i.triggerRef.current)==null||c.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{var u,d;(u=t.onInteractOutside)==null||u.call(t,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=o.target;((d=i.triggerRef.current)==null?void 0:d.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})},"PopoverContentNonModal")),RRe=p.forwardRef(Cb(function(t,n){const{__scopePopover:i,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,...h}=t,m=G1(bC,i),g=GV(i);return rM(),a.jsx(RNe,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:a.jsx(TV,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:f,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),deferPointerDownOutside:!0,children:a.jsx($V,{"data-state":XV(m.open),role:"dialog",id:m.contentId,...g,...h,ref:n,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl"));function XV(e){return e?"open":"closed"}Cb(XV,"getState");var IRe=_dt,PRe=Ndt,DRe=Pdt,MRe=Ddt,Fdt=Object.defineProperty,_l=(e,t)=>Fdt(e,"name",{value:t,configurable:!0}),LRe="Radio",[Bdt,$Re]=Hc(LRe),[Udt,fM]=Bdt(LRe);function FRe(e){const{__scopeRadio:t,checked:n=!1,children:i,disabled:r,form:s,name:o,onCheck:l,required:c,value:u="on",internal_do_not_use_render:d}=e,[f,h]=p.useState(null),[m,g]=p.useState(null),b=p.useRef(!1),[v,y]=p.useReducer(O=>O+1,0),w=f?!!s||!!f.closest("form"):!0,x={checked:n,disabled:r,required:c,name:o,form:s,value:u,control:f,setControl:h,hasConsumerStoppedPropagationRef:b,userInteractionCount:v,onUserInteraction:y,isFormControl:w,bubbleInput:m,setBubbleInput:g,onCheck:_l(()=>l==null?void 0:l(),"onCheck")};return a.jsx(Udt,{scope:t,...x,children:BRe(d)?d(x):i})}_l(FRe,"RadioProvider");var Qdt="RadioTrigger",zdt=p.forwardRef(_l(function({__scopeRadio:t,onClick:n,...i},r){const{checked:s,disabled:o,value:l,setControl:c,onCheck:u,hasConsumerStoppedPropagationRef:d,onUserInteraction:f,isFormControl:h,bubbleInput:m}=fM(Qdt,t),g=_r(r,c);return a.jsx(Xr.button,{type:"button",role:"radio","aria-checked":s,"data-state":YV(s),"data-disabled":o?"":void 0,disabled:o,value:l,...i,ref:g,onClick:Qn(n,b=>{s||(f(),u()),m&&h&&(d.current=b.isPropagationStopped(),d.current||b.stopPropagation())})})},"RadioTrigger")),Vdt="RadioIndicator",Hdt=p.forwardRef(_l(function(t,n){const{__scopeRadio:i,forceMount:r,...s}=t,o=fM(Vdt,i);return a.jsx(_h,{present:r||o.checked,children:a.jsx(Xr.span,{"data-state":YV(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:n})})},"RadioIndicator")),qdt="RadioBubbleInput",Wdt=p.forwardRef(_l(function({__scopeRadio:t,onClick:n,...i},r){const{control:s,checked:o,required:l,disabled:c,name:u,value:d,form:f,bubbleInput:h,setBubbleInput:m,hasConsumerStoppedPropagationRef:g,userInteractionCount:b}=fM(qdt,t),v=_r(r,m),y=XA(s),w=p.useRef(!1),x=p.useRef(o),O=p.useRef(b);p.useEffect(()=>{const S=h;if(!S)return;const C=window.HTMLInputElement.prototype,j=Object.getOwnPropertyDescriptor(C,"checked").set,T=b!==O.current;O.current=b;const R=x.current!==o;x.current=o;const A=!(T&&g.current);if(R&&j){w.current=!T;const N=new Event("click",{bubbles:A});j.call(S,o),S.dispatchEvent(N),w.current=!1}},[h,o,g,b]);const k=p.useRef(o);return a.jsx(Xr.input,{type:"radio","aria-hidden":!0,defaultChecked:k.current,required:l,disabled:c,name:u,value:d,form:f,...i,tabIndex:-1,ref:v,onClick:Qn(n,S=>{w.current&&S.stopPropagation()}),style:{...i.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"RadioBubbleInput"));function BRe(e){return typeof e=="function"}_l(BRe,"isFunction");function YV(e){return e?"checked":"unchecked"}_l(YV,"getState");var Kdt=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ZV="RadioGroup",[Gdt,xhn]=Hc(ZV,[K1,$Re]),URe=K1(),hM=$Re(),[Xdt,Ydt]=Gdt(ZV),Zdt=p.forwardRef(_l(function(t,n){const{__scopeRadioGroup:i,name:r,form:s,defaultValue:o,value:l,required:c=!1,disabled:u=!1,orientation:d,dir:f,loop:h=!0,onValueChange:m,...g}=t,b=URe(i),v=GA(f),[y,w]=jd({prop:l,defaultProp:o??null,onChange:m,caller:ZV}),[x,O]=p.useState(null),k=_r(n,O),S=p.useRef(y);return p.useEffect(()=>{const C=s?x==null?void 0:x.ownerDocument.getElementById(s):x==null?void 0:x.closest("form");if(C instanceof HTMLFormElement){const E=_l(()=>w(S.current),"reset");return C.addEventListener("reset",E),()=>C.removeEventListener("reset",E)}},[x,s,w]),a.jsx(Xdt,{scope:i,name:r,form:s,required:c,disabled:u,value:y,onValueChange:w,children:a.jsx(UV,{asChild:!0,...b,orientation:d,dir:v,loop:h,children:a.jsx(Xr.div,{role:"radiogroup","aria-required":c,"aria-orientation":d,"data-disabled":u?"":void 0,dir:v,...g,ref:k})})})},"RadioGroup")),Jdt="RadioGroupItemProvider",eft="RadioGroupItemTrigger";function QRe(e){const{__scopeRadioGroup:t,value:n,disabled:i,children:r,internal_do_not_use_render:s}=e,o=Ydt(Jdt,t),l=hM(t),c=o.disabled||i;return a.jsx(FRe,{...l,checked:o.value===n,disabled:c,required:o.required,name:o.name,form:o.form,value:n,onCheck:()=>o.onValueChange(n),internal_do_not_use_render:s,children:r})}_l(QRe,"RadioGroupItemProvider");var tft=p.forwardRef(_l(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=URe(i),o=hM(i),{checked:l,disabled:c}=fM(eft,o.__scopeRadio),u=p.useRef(null),d=_r(n,u),f=p.useRef(!1);return p.useEffect(()=>{const h=_l(g=>{Kdt.includes(g.key)&&(f.current=!0)},"handleKeyDown"),m=_l(()=>f.current=!1,"handleKeyUp");return document.addEventListener("keydown",h),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",m)}},[]),a.jsx(QV,{asChild:!0,...s,focusable:!c,active:l,children:a.jsx(zdt,{...o,...r,ref:d,onKeyDown:Qn(r.onKeyDown,h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:Qn(r.onFocus,()=>{var h;f.current&&((h=u.current)==null||h.click())})})})},"RadioGroupItemTrigger")),nft=p.forwardRef(_l(function(t,n){const{__scopeRadioGroup:i,value:r,disabled:s,...o}=t;return a.jsx(QRe,{__scopeRadioGroup:i,value:r,disabled:s,internal_do_not_use_render:({isFormControl:l})=>a.jsxs(a.Fragment,{children:[a.jsx(tft,{...o,ref:n,__scopeRadioGroup:i}),l&&a.jsx(ift,{__scopeRadioGroup:i})]})})},"RadioGroupItem")),ift=p.forwardRef(_l(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=hM(i);return a.jsx(Wdt,{...s,...r,ref:n})},"RadioGroupItemBubbleInput")),rft=p.forwardRef(_l(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=hM(i);return a.jsx(Hdt,{...s,...r,ref:n})},"RadioGroupIndicator")),sft=Object.defineProperty,nb=(e,t)=>sft(e,"name",{value:t,configurable:!0}),JV="Switch",[aft,whn]=Hc(JV),[oft,eH]=aft(JV);function zRe(e){const{__scopeSwitch:t,checked:n,children:i,defaultChecked:r,disabled:s,form:o,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=e,[h,m]=jd({prop:n,defaultProp:r??!1,onChange:c,caller:JV}),[g,b]=p.useState(null),[v,y]=p.useState(null),w=p.useRef(!1),[x,O]=p.useReducer(C=>C+1,0),k=g?!!o||!!g.closest("form"):!0,S={checked:h,setChecked:m,disabled:s,control:g,setControl:b,name:l,form:o,value:d,hasConsumerStoppedPropagationRef:w,userInteractionCount:x,onUserInteraction:O,required:u,defaultChecked:r,isFormControl:k,bubbleInput:v,setBubbleInput:y};return a.jsx(oft,{scope:t,...S,children:VRe(f)?f(S):i})}nb(zRe,"SwitchProvider");var lft="SwitchTrigger",cft=p.forwardRef(nb(function({__scopeSwitch:t,onClick:n,...i},r){const{control:s,form:o,value:l,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,onUserInteraction:g,isFormControl:b,bubbleInput:v}=eH(lft,t),y=_r(r,f),w=p.useRef(u);return p.useEffect(()=>{const x=o?s==null?void 0:s.ownerDocument.getElementById(o):s==null?void 0:s.form;if(x instanceof HTMLFormElement){const O=nb(()=>h(w.current),"reset");return x.addEventListener("reset",O),()=>x.removeEventListener("reset",O)}},[s,o,h]),a.jsx(Xr.button,{type:"button",role:"switch","aria-checked":u,"aria-required":d,"data-state":tH(u),"data-disabled":c?"":void 0,disabled:c,value:l,...i,ref:y,onClick:Qn(n,x=>{g(),h(O=>!O),v&&b&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})})},"SwitchTrigger")),uft=p.forwardRef(nb(function(t,n){const{__scopeSwitch:i,name:r,checked:s,defaultChecked:o,required:l,disabled:c,value:u,onCheckedChange:d,form:f,...h}=t;return a.jsx(zRe,{__scopeSwitch:i,checked:s,defaultChecked:o,disabled:c,required:l,onCheckedChange:d,name:r,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>a.jsxs(a.Fragment,{children:[a.jsx(cft,{...h,ref:n,__scopeSwitch:i}),m&&a.jsx(pft,{__scopeSwitch:i})]})})},"Switch")),dft="SwitchThumb",fft=p.forwardRef(nb(function(t,n){const{__scopeSwitch:i,...r}=t,s=eH(dft,i);return a.jsx(Xr.span,{"data-state":tH(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:n})},"SwitchThumb")),hft="SwitchBubbleInput",pft=p.forwardRef(nb(function({__scopeSwitch:t,onClick:n,...i},r){const{control:s,hasConsumerStoppedPropagationRef:o,userInteractionCount:l,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:m,form:g,bubbleInput:b,setBubbleInput:v}=eH(hft,t),y=_r(r,v),w=XA(s),x=p.useRef(!1),O=p.useRef(c),k=p.useRef(l);p.useEffect(()=>{const C=b;if(!C)return;const E=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(E,"checked").set,R=l!==k.current;k.current=l;const A=O.current!==c;O.current=c;const N=!(R&&o.current);if(A&&T){x.current=!R;const P=new Event("click",{bubbles:N});T.call(C,c),C.dispatchEvent(P),x.current=!1}},[b,c,o,l]);const S=p.useRef(c);return a.jsx(Xr.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??S.current,required:d,disabled:f,name:h,value:m,form:g,...i,tabIndex:-1,ref:y,onClick:Qn(n,C=>{x.current&&C.stopPropagation()}),style:{...i.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function VRe(e){return typeof e=="function"}nb(VRe,"isFunction");function tH(e){return e?"checked":"unchecked"}nb(tH,"getState");var mft=Object.defineProperty,gft=(e,t)=>mft(e,"name",{value:t,configurable:!0}),bft="Toggle",yft=p.forwardRef(gft(function(t,n){const{pressed:i,defaultPressed:r,onPressedChange:s,...o}=t,[l,c]=jd({prop:i,onChange:s,defaultProp:r??!1,caller:bft});return a.jsx(Xr.button,{type:"button","aria-pressed":l,"data-state":l?"on":"off","data-disabled":t.disabled?"":void 0,...o,ref:n,onClick:Qn(t.onClick,()=>{t.disabled||c(!l)})})},"Toggle")),vft=Object.defineProperty,ib=(e,t)=>vft(e,"name",{value:t,configurable:!0}),X1="ToggleGroup",[HRe,Ohn]=Hc(X1,[K1]),qRe=K1(),xft=p.forwardRef(ib(function(t,n){const{type:i,...r}=t;if(i==="single"){const s=r;return a.jsx(wft,{role:"radiogroup",...s,ref:n})}if(i==="multiple"){const s=r;return a.jsx(Oft,{role:"toolbar",...s,ref:n})}throw new Error(`Missing prop \`type\` expected on \`${X1}\``)},"ToggleGroup")),[WRe,KRe]=HRe(X1),wft=p.forwardRef(ib(function(t,n){const{value:i,defaultValue:r,onValueChange:s=ib(()=>{},"onValueChange"),...o}=t,[l,c]=jd({prop:i,defaultProp:r??"",onChange:s,caller:X1});return a.jsx(WRe,{scope:t.__scopeToggleGroup,type:"single",value:p.useMemo(()=>l?[l]:[],[l]),onItemActivate:c,onItemDeactivate:p.useCallback(()=>c(""),[c]),children:a.jsx(GRe,{...o,ref:n})})},"ToggleGroupImplSingle")),Oft=p.forwardRef(ib(function(t,n){const{value:i,defaultValue:r,onValueChange:s=ib(()=>{},"onValueChange"),...o}=t,[l,c]=jd({prop:i,defaultProp:r??[],onChange:s,caller:X1}),u=p.useCallback(f=>c((h=[])=>[...h,f]),[c]),d=p.useCallback(f=>c((h=[])=>h.filter(m=>m!==f)),[c]);return a.jsx(WRe,{scope:t.__scopeToggleGroup,type:"multiple",value:l,onItemActivate:u,onItemDeactivate:d,children:a.jsx(GRe,{...o,ref:n})})},"ToggleGroupImplMultiple")),[kft,Sft]=HRe(X1),GRe=p.forwardRef(ib(function(t,n){const{__scopeToggleGroup:i,disabled:r=!1,rovingFocus:s=!0,orientation:o,dir:l,loop:c=!0,...u}=t,d=qRe(i),f=GA(l),h={dir:f,...u};return a.jsx(kft,{scope:i,rovingFocus:s,disabled:r,children:s?a.jsx(UV,{asChild:!0,...d,orientation:o,dir:f,loop:c,children:a.jsx(Xr.div,{...h,ref:n})}):a.jsx(Xr.div,{...h,ref:n})})},"ToggleGroupImpl")),CB="ToggleGroupItem",Eft=p.forwardRef(ib(function(t,n){const i=KRe(CB,t.__scopeToggleGroup),r=Sft(CB,t.__scopeToggleGroup),s=qRe(t.__scopeToggleGroup),o=i.value.includes(t.value),l=r.disabled||t.disabled,c={...t,pressed:o,disabled:l},u=p.useRef(null);return r.rovingFocus?a.jsx(QV,{asChild:!0,...s,focusable:!l,active:o,ref:u,children:a.jsx(wee,{...c,ref:n})}):a.jsx(wee,{...c,ref:n})},"ToggleGroupItem")),wee=p.forwardRef(ib(function(t,n){const{__scopeToggleGroup:i,value:r,...s}=t,o=KRe(CB,i),l={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},c=o.type==="single"?l:void 0;return a.jsx(yft,{...c,...s,ref:n,onPressedChange:u=>{u?o.onItemActivate(r):o.onItemDeactivate(r)}})},"ToggleGroupItemImpl")),Cft=Object.defineProperty,No=(e,t)=>Cft(e,"name",{value:t,configurable:!0}),[nH,khn]=Hc("Tooltip",[W1]),iH=W1(),Aft="TooltipProvider",Tft=700,AB="tooltip.open",[_ft,rH]=nH(Aft),jft=No(e=>{const{__scopeTooltip:t,delayDuration:n=Tft,skipDelayDuration:i=300,disableHoverableContent:r=!1,children:s}=e,o=p.useRef(!0),l=p.useRef(!1),c=p.useRef(0);return p.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),a.jsx(_ft,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:p.useCallback(()=>{i<=0||(window.clearTimeout(c.current),o.current=!1)},[i]),onClose:p.useCallback(()=>{i<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,i))},[i]),isPointerInTransitRef:l,onPointerInTransitChange:p.useCallback(u=>{l.current=u},[]),disableHoverableContent:r,children:s})},"TooltipProvider"),TB="Tooltip",[Nft,ZA]=nH(TB),Rft=No(e=>{const{__scopeTooltip:t,children:n,open:i,defaultOpen:r,onOpenChange:s,disableHoverableContent:o,delayDuration:l}=e,c=rH(TB,e.__scopeTooltip),u=iH(t),[d,f]=p.useState(null),[h,m]=p.useState(void 0),g=tb(),b=p.useRef(0),v=o??c.disableHoverableContent,y=l??c.delayDuration,w=p.useRef(!1),[x,O]=jd({prop:i,defaultProp:r??!1,onChange:No(T=>{T?(c.onOpen(),document.dispatchEvent(new CustomEvent(AB))):c.onClose(),s==null||s(T)},"onChange"),caller:TB}),k=p.useMemo(()=>x?w.current?"delayed-open":"instant-open":"closed",[x]),S=p.useCallback(()=>{window.clearTimeout(b.current),b.current=0,w.current=!1,O(!0)},[O]),C=p.useCallback(()=>{window.clearTimeout(b.current),b.current=0,O(!1)},[O]),E=p.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{w.current=!0,O(!0),b.current=0},y)},[y,O]);p.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]);const j=h??g;return a.jsx(oM,{...u,children:a.jsx(Nft,{scope:t,contentId:j,setContentId:m,open:x,stateAttribute:k,trigger:d,onTriggerChange:f,onTriggerEnter:p.useCallback(()=>{c.isOpenDelayedRef.current?E():S()},[c.isOpenDelayedRef,E,S]),onTriggerLeave:p.useCallback(()=>{v?C():(window.clearTimeout(b.current),b.current=0)},[C,v]),onOpen:S,onClose:C,disableHoverableContent:v,children:n})})},"Tooltip"),Oee="TooltipTrigger",Ift=p.forwardRef(No(function(t,n){const{__scopeTooltip:i,...r}=t,s=ZA(Oee,i),o=rH(Oee,i),l=iH(i),c=p.useRef(null),u=_r(n,c,s.onTriggerChange),d=p.useRef(!1),f=p.useRef(!1),h=p.useCallback(()=>d.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),a.jsx(LV,{asChild:!0,...l,children:a.jsx(Xr.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:u,onPointerMove:Qn(t.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:Qn(t.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:Qn(t.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:Qn(t.onFocus,()=>{d.current||s.onOpen()}),onBlur:Qn(t.onBlur,s.onClose),onClick:Qn(t.onClick,s.onClose)})})},"TooltipTrigger")),XRe="TooltipPortal",[Pft,Dft]=nH(XRe,{forceMount:void 0}),Mft=No(e=>{const{__scopeTooltip:t,forceMount:n,children:i,container:r}=e,s=ZA(XRe,t);return a.jsx(Pft,{scope:t,forceMount:n,children:a.jsx(_h,{present:n||s.open,children:a.jsx(NV,{asChild:!0,container:r,children:i})})})},"TooltipPortal"),yC="TooltipContent",Lft=p.forwardRef(No(function(t,n){const i=Dft(yC,t.__scopeTooltip),{forceMount:r=i.forceMount,side:s="top",...o}=t,l=ZA(yC,t.__scopeTooltip);return a.jsx(_h,{present:r||l.open,children:l.disableHoverableContent?a.jsx(YRe,{side:s,...o,ref:n}):a.jsx($ft,{side:s,...o,ref:n})})},"TooltipContent")),$ft=p.forwardRef(No(function(t,n){const i=ZA(yC,t.__scopeTooltip),r=rH(yC,t.__scopeTooltip),s=p.useRef(null),o=_r(n,s),[l,c]=p.useState(null),{trigger:u,onClose:d}=i,f=s.current,{onPointerInTransitChange:h}=r,m=p.useCallback(()=>{c(null),h(!1)},[h]),g=p.useCallback((b,v)=>{const y=b.currentTarget,w={x:b.clientX,y:b.clientY},x=ZRe(w,y.getBoundingClientRect()),O=JRe(w,x),k=eIe(v.getBoundingClientRect()),S=nIe([...O,...k]);c(S),h(!0)},[h]);return p.useEffect(()=>()=>m(),[m]),p.useEffect(()=>{if(u&&f){const b=No(y=>g(y,f),"handleTriggerLeave"),v=No(y=>g(y,u),"handleContentLeave");return u.addEventListener("pointerleave",b),f.addEventListener("pointerleave",v),()=>{u.removeEventListener("pointerleave",b),f.removeEventListener("pointerleave",v)}}},[u,f,g,m]),p.useEffect(()=>{if(l){const b=No(v=>{const y=v.target,w={x:v.clientX,y:v.clientY},x=(u==null?void 0:u.contains(y))||(f==null?void 0:f.contains(y)),O=!tIe(w,l);x?m():O&&(m(),d())},"handleTrackPointerGrace");return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[u,f,l,d,m]),a.jsx(YRe,{...t,ref:o})},"TooltipContentHoverable")),Fft=cNe("TooltipContent"),YRe=p.forwardRef(No(function(t,n){const{__scopeTooltip:i,children:r,"aria-label":s,id:o,onEscapeKeyDown:l,onPointerDownOutside:c,...u}=t,d=ZA(yC,i),f=iH(i),{onClose:h}=d;p.useEffect(()=>(document.addEventListener(AB,h),()=>document.removeEventListener(AB,h)),[h]),p.useEffect(()=>{if(d.trigger){const g=No(b=>{b.target instanceof Node&&b.target.contains(d.trigger)&&h()},"handleScroll");return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[d.trigger,h]);const{setContentId:m}=d;return xd(()=>(m(o),()=>{m(void 0)}),[o,m]),a.jsx(TV,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:g=>g.preventDefault(),onDismiss:h,children:a.jsxs($V,{"data-state":d.stateAttribute,role:s?void 0:"tooltip",id:s?void 0:d.contentId,...f,...u,ref:n,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[a.jsx(Fft,{children:r}),s?a.jsx(flt,{id:d.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl"));function ZRe(e,t){const n=Math.abs(t.top-e.y),i=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,i,r,s)){case s:return"left";case r:return"right";case n:return"top";case i:return"bottom";default:throw new Error("unreachable")}}No(ZRe,"getExitSideFromRect");function JRe(e,t,n=5){const i=[];switch(t){case"top":i.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":i.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":i.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":i.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return i}No(JRe,"getPaddedExitPoints");function eIe(e){const{top:t,right:n,bottom:i,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:i},{x:r,y:i}]}No(eIe,"getPointsFromRect");function tIe(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,o=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}No(tIe,"isPointInPolygon");function nIe(e){const t=e.slice();return t.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),iIe(t)}No(nIe,"getHull");function iIe(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i=2;){const s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let i=e.length-1;i>=0;i--){const r=e[i];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}No(iIe,"getHullPresorted");var Bft=jft,Uft=Rft,rIe=Ift,Qft=Mft,zft=Lft;function rb(e){const t=p.useRef(e);return t.current=e,t}let Jw=[],m_=!1;const kee=e=>{var t,n;if(e.key==="Escape"){const[i]=Jw;i&&(e.preventDefault(),(n=(t=i.callback).current)==null||n.call(t))}},sIe=()=>{Jw.length>0&&!m_?(document.body.addEventListener("keydown",kee),m_=!0):Jw.length===0&&m_&&(document.body.removeEventListener("keydown",kee),m_=!1)},Vft=e=>{Jw.unshift(e),sIe()},Hft=({id:e})=>{Jw=Jw.filter(t=>t.id!==e),sIe()},JA=(e,t)=>{const n=p.useId(),i=rb(t);p.useEffect(()=>{if(!e)return;const r={id:n,callback:i};return Vft(r),()=>Hft(r)},[n,e,i])},qft=p.createContext(null);function aIe(){const e=p.useContext(qft);return(e==null?void 0:e.linkComponent)??"a"}function eT(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}const Wft=()=>iNe,See=(e,t=!1,n="TransitionGroup")=>{const i=[];return p.Children.forEach(e,r=>{if(r&&typeof r=="object"&&"key"in r&&r.key)i.push(r);else if(t)throw new Error(`Child elements of <${n} /> must include a \`key\``)}),i},Mv=()=>{},Lv=e=>{const t=p.useRef(e);return t.current=e,p.useCallback(n=>t.current(n),[])};function Kft(e,t,n,i){const r=e.reduce((c,u)=>({...c,[u.key]:1}),{}),s=t.reduce((c,u)=>({...c,[u.component.key]:1}),{}),o=e.filter(c=>!s[c.key]).map(n),l=t.map(c=>({...c,component:e.find(({key:u})=>u===c.component.key)||c.component,shouldRender:!!r[c.component.key]}));return i==="append"?l.concat(o):o.concat(l)}function Gft(e,t,n){if((iNe||Wot)&&t&&n>1)throw new Error(`Cannot use forwardRef with multiple children in <${e} />`)}const Xft="_TransitionGroupChild_1hv1z_1",Yft={TransitionGroupChild:Xft},oIe={enter:!1,enterActive:!1,exit:!1,exitActive:!1,interrupted:!1},Zft=e=>({...oIe,enter:!e}),Jft=(e,t)=>{switch(t.type){case"enter-before":return{enter:!0,enterActive:!1,exit:!1,exitActive:!1,interrupted:e.interrupted||e.exit};case"enter-active":return{enter:!0,enterActive:!0,exit:!1,exitActive:!1,interrupted:!1};case"exit-before":return{enter:!1,enterActive:!1,exit:!0,exitActive:!1,interrupted:e.interrupted||e.enter};case"exit-active":return{enter:!1,enterActive:!1,exit:!0,exitActive:!0,interrupted:!1};case"done":default:return oIe}},eht=({ref:e,as:t,children:n,className:i,transitionId:r,style:s,preventMountTransition:o,shouldRender:l,enterDuration:c,exitDuration:u,removeChild:d,onEnter:f,onEnterActive:h,onEnterComplete:m,onExit:g,onExitActive:b,onExitComplete:v})=>{const[y,w]=p.useReducer(Jft,Zft(o||!1)),x=p.useRef(!1),O=p.useRef(null),k=p.useRef(c);k.current=c;const S=p.useRef(u);S.current=u;const C=p.useRef(null),E=p.useCallback(j=>{const T=O.current;if(!(!T||j===C.current))switch(C.current=j,j){case"enter":f(T);break;case"enter-active":h(T);break;case"enter-complete":m(T);break;case"exit":g(T);break;case"exit-active":b(T);break;case"exit-complete":v(T);break}},[f,h,m,g,b,v]);return ji.useLayoutEffect(()=>{if(!l){let R;w({type:"exit-before"}),E("exit");const A=pI(()=>{w({type:"exit-active"}),E("exit-active"),R=window.setTimeout(()=>{E("exit-complete"),d()},S.current)});return()=>{A(),R!==void 0&&clearTimeout(R)}}if(o&&!x.current){x.current=!0;return}let j;w({type:"enter-before"}),E("enter");const T=pI(()=>{w({type:"enter-active"}),E("enter-active"),j=window.setTimeout(()=>{w({type:"done"}),E("enter-complete")},k.current)});return()=>{T(),j!==void 0&&clearTimeout(j)}},[l,o,d,E]),p.useEffect(()=>()=>{x.current=!1},[]),a.jsx(t,{ref:eT([O,e]),className:Ui(i,Yft.TransitionGroupChild),"data-transition-id":r,style:s,"data-entering":y.enter?"":void 0,"data-entering-active":y.enterActive?"":void 0,"data-exiting":y.exit?"":void 0,"data-exiting-active":y.exitActive?"":void 0,"data-interrupted":y.interrupted?"":void 0,children:n})},tht=e=>{const{enterMountDelay:t,preventMountTransition:n}=e,i=!n&&t!=null?t:null,[r,s]=p.useState(i==null);return OV(()=>s(!0),r?null:i),r?a.jsx(eht,{...e}):null},Y1=e=>{const{ref:t,as:n="span",children:i,className:r,transitionId:s,style:o,enterDuration:l=0,exitDuration:c=0,preventInitialTransition:u=!0,enterMountDelay:d,insertMethod:f="append",disableAnimations:h=Wft()}=e,m=Lv(e.onEnter??Mv),g=Lv(e.onEnterActive??Mv),b=Lv(e.onEnterComplete??Mv),v=Lv(e.onExit??Mv),y=Lv(e.onExitActive??Mv),w=Lv(e.onExitComplete??Mv);p.Children.forEach(i,S=>{if(S&&!S.key)throw new Error("Child elements of must include a `key`")});const x=p.useCallback(S=>({component:S,shouldRender:!0,removeChild:()=>{k(C=>C.filter(E=>S.key!==E.component.key))},onEnter:m,onEnterActive:g,onEnterComplete:b,onExit:v,onExitActive:y,onExitComplete:w}),[m,g,b,v,y,w]),[O,k]=p.useState(()=>See(i).map(S=>({...x(S),preventMountTransition:u})));return p.useLayoutEffect(()=>{k(S=>{const C=See(i);return Kft(C,S,x,f)})},[i,f,x]),Gft("TransitionGroup",t,p.Children.count(i)),h?a.jsx(a.Fragment,{children:p.Children.map(i,S=>a.jsx(n,{ref:t,className:r,style:o,"data-transition-id":s,children:S}))}):a.jsx(a.Fragment,{children:O.map(({component:S,...C})=>a.jsx(tht,{...C,as:n,className:r,transitionId:s,enterDuration:l,exitDuration:c,enterMountDelay:d,style:o,ref:t,children:S},S.key))})},nht="_Button_1864l_1",iht="_ButtonInner_1864l_4",rht="_ButtonLoader_1864l_749",r4={Button:nht,ButtonInner:iht,ButtonLoader:rht},_t=e=>{const{type:t="button",color:n="primary",variant:i="solid",pill:r=!0,uniform:s=!1,size:o="md",iconSize:l,gutterSize:c,loading:u,selected:d,block:f,opticallyAlign:h,children:m,className:g,onClick:b,disabled:v,disabledTone:y,inert:w=u,...x}=e,O=v||w,k=p.useCallback(S=>{v||b==null||b(S)},[b,v]);return a.jsxs("button",{type:t,className:Ui(r4.Button,g),"data-color":n,"data-variant":i,"data-pill":r?"":void 0,"data-uniform":s?"":void 0,"data-size":o,"data-gutter-size":c,"data-icon-size":l,"data-loading":u?"":void 0,"data-selected":d?"":void 0,"data-block":f?"":void 0,"data-optically-align":h,onPointerEnter:kV,disabled:O,"aria-disabled":O,tabIndex:O?-1:void 0,"data-disabled":v?"":void 0,"data-disabled-tone":v?y:void 0,onClick:k,...x,children:[a.jsx(Y1,{className:r4.ButtonLoader,enterDuration:250,exitDuration:150,children:u&&a.jsx(WA,{},"loader")}),a.jsx("span",{className:r4.ButtonInner,children:wV(m)})]})},sht=()=>{var e;return typeof ClipboardItem<"u"&&!!((e=navigator.clipboard)!=null&&e.write)};function aht(e){const{"text/plain":t,...n}=e;return new ClipboardItem({...n,...t?{"text/plain":new Blob([t],{type:"text/plain"})}:null})}async function oht(e,t=document.body){if(typeof e=="string")return Eee(e,t);try{return sht()?(await navigator.clipboard.write([aht(e)]),!0):e["text/plain"]?Eee(e["text/plain"],t):!1}catch{return!1}}async function Eee(e,t=document.body){if(navigator.clipboard)try{return await navigator.clipboard.writeText(e),!0}catch{}const n=document.createElement("textarea");n.value=e,n.style.position="fixed",n.style.top="0",n.style.left="0",n.style.opacity="0",t.appendChild(n),n.focus(),n.select();let i=!1;try{i=document.execCommand("copy")}catch{}return t.removeChild(n),i}const lht="_TransitionItem_1o7b1_1",cht={TransitionItem:lht},uht=e=>{const{as:t="span",className:n,children:i,preventInitialTransition:r,insertMethod:s,transitionClassName:o,transitionPosition:l="absolute"}=e,{enterTotalDuration:c,exitTotalDuration:u,variables:d}=mht(e);return a.jsx(t,{className:Ui("block",l==="absolute"&&"relative",n),"data-transition-position":l,style:d,children:a.jsx(Y1,{as:t,className:Ui(cht.TransitionItem,o),enterDuration:c,exitDuration:u,insertMethod:s,preventInitialTransition:r,children:i})})},dht=400,fht=500,hht=200,pht=300;function mht({initial:e,enter:t,exit:n,forceCompositeLayer:i}){const r=W3(e),s=W3(t),o=W3(n),l=[r,o,s].some(b=>b!=="none"),c=(t==null?void 0:t.duration)??(l?fht:dht),u=(t==null?void 0:t.timingFunction)??(l?"var(--cubic-enter)":"ease"),d=(n==null?void 0:n.duration)??(l?pht:hht),f=(n==null?void 0:n.timingFunction)??(l?"var(--cubic-exit)":"ease"),h=z0({"tg-will-change":i?"transform, opacity":"auto","tg-enter-opacity":q3((t==null?void 0:t.opacity)??1),"tg-enter-transform":s,"tg-enter-filter":K3(t),"tg-enter-duration":o_(c),"tg-enter-delay":o_((t==null?void 0:t.delay)??0),"tg-enter-timing-function":u,"tg-exit-opacity":q3((n==null?void 0:n.opacity)??0),"tg-exit-transform":o,"tg-exit-filter":K3(n),"tg-exit-duration":o_(d),"tg-exit-delay":o_((n==null?void 0:n.delay)??0),"tg-exit-timing-function":f,"tg-initial-opacity":q3((e==null?void 0:e.opacity)??(n==null?void 0:n.opacity)??0),"tg-initial-transform":r==="none"?o:r,"tg-initial-filter":K3(e??n??{})}),m=((t==null?void 0:t.delay)??0)+c,g=((n==null?void 0:n.delay)??0)+d;return{enterTotalDuration:m,exitTotalDuration:g,variables:h}}const sH=({children:e,copyValue:t,onClick:n,...i})=>{const[r,s]=p.useState(!1),o=p.useRef(null),l=c=>{r||(s(!0),n==null||n(c),oht(typeof t=="function"?t():t),o.current=window.setTimeout(()=>{s(!1)},1300))};return p.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),a.jsxs(_t,{...i,onClick:l,children:[a.jsx(uht,{className:"w-[var(--button-icon-size)] h-[var(--button-icon-size)]",initial:{scale:.6},enter:{scale:1,delay:150,duration:300},exit:{scale:.6,duration:150},forceCompositeLayer:!0,children:r?a.jsx(fC,{},"copied-icon"):a.jsx(_je,{},"copy-icon")}),typeof e=="function"?e({copied:r}):e]})},ght="_Menu_1t4b0_1",bht="_MenuList_1t4b0_3",yht="_MenuItemContent_1t4b0_53",vht="_MenuItem_1t4b0_53",xht="_ItemActions_1t4b0_98",wht="_PressableInner_1t4b0_117",Oht="_Separator_1t4b0_135",kht="_SubMenuItem_1t4b0_139",Sht="_SubTriggerIcon_1t4b0_141",Eht="_RadioItem_1t4b0_151",Cht="_RadioIndicatorActive_1t4b0_158",Aht="_RadioIndicator_1t4b0_158",Tht="_CheckboxItem_1t4b0_249",_ht="_CheckboxIndicator_1t4b0_256",jht="_CheckboxCircle_1t4b0_269",js={Menu:ght,MenuList:bht,MenuItemContent:yht,MenuItem:vht,ItemActions:xht,PressableInner:wht,Separator:Oht,SubMenuItem:kht,SubTriggerIcon:Sht,RadioItem:Eht,RadioIndicatorActive:Cht,RadioIndicator:Aht,CheckboxItem:Tht,CheckboxIndicator:_ht,CheckboxCircle:jht},lIe=p.createContext(null),tT=()=>{const e=p.useContext(lIe);if(!e)throw new Error("Menu components must be wrapped in ");return e},er=({children:e,forceOpen:t,onOpen:n,onClose:i,modal:r=!1})=>{const[s,o]=p.useState(!1),l=t??s,c=rb(n),u=rb(i),d=p.useCallback(h=>{var m,g;o(h),h?(m=c.current)==null||m.call(c):(g=u.current)==null||g.call(u)},[c,u]);JA(s,()=>{d(!1)});const f=p.useMemo(()=>({open:l,setOpen:d}),[l,d]);return a.jsx(lIe.Provider,{value:f,children:a.jsx(bdt,{open:l,onOpenChange:d,modal:r,children:e})})},Nht=({className:e,children:t,disabled:n,onSelect:i,onClick:r})=>{const{open:s}=tT(),o=l=>{s||l.preventDefault()};return i?a.jsx(TRe,{className:Ui(js.MenuItem,e),onSelect:i,onClick:r,disabled:n,onPointerMove:o,onPointerLeave:o,children:a.jsx("div",{className:js.PressableInner,children:t})}):a.jsx("div",{className:Ui(js.MenuItemContent,e),children:t})},Rht=({className:e,children:t})=>a.jsx("div",{className:Ui(js.ItemActions,e),children:t}),Iht=({children:e,onClick:t})=>{const{setOpen:n}=tT();return a.jsx(_t,{className:"rounded-sm",color:"secondary",size:"xs",uniform:!0,iconSize:"sm",variant:"ghost",onClick:i=>{i.stopPropagation(),n(!1),t(i)},children:e})},Pht=e=>{const{className:t,children:n,href:i,to:r,disabled:s,as:o,...l}=e,{open:c}=tT(),u=i||r,d=u?/^https?:\/\//.test(u):!0,f=aIe(),h=o||(d?"a":f),m=b=>{c||b.preventDefault()},g=d?{target:"_blank",rel:"noopener noreferrer",href:i??r}:{href:i,to:r};return a.jsx(TRe,{asChild:!0,className:Ui(js.MenuItem,t),disabled:s,onPointerMove:d?void 0:m,onPointerLeave:d?void 0:m,children:a.jsx(h,{...g,...l,children:a.jsx("span",{className:js.PressableInner,children:n})})})},Dht=({className:e})=>a.jsx(kdt,{className:Ui(js.Separator,e),role:"separator"}),Mht=({children:e,side:t,sideOffset:n=5,align:i,alignOffset:r,width:s,minWidth:o,maxHeight:l})=>{const{open:c}=tT();return a.jsx(ARe,{forceMount:!0,children:a.jsx(Y1,{className:js.Menu,enterDuration:350,exitDuration:200,disableAnimations:!0,children:c&&a.jsx(vdt,{forceMount:!0,className:js.MenuList,side:t,sideOffset:n,align:i,alignOffset:r??(i==="center"?0:-5),avoidCollisions:!0,collisionPadding:{bottom:30,top:30,left:12,right:12},onEscapeKeyDown:Dp,style:z0({"menu-width":s,"menu-min-width":o,"menu-max-height":l}),children:e},"dropdown")})})},Lht=({children:e,disabled:t})=>a.jsx(ydt,{asChild:!0,disabled:t,children:e}),cIe=p.createContext(null),uIe=()=>{const e=p.useContext(cIe);if(!e)throw new Error("Submenu components must be wrapped in ");return e},$ht=({children:e,forceOpen:t,onOpen:n,onClose:i})=>{const[r,s]=p.useState(!1),o=p.useRef(null),l=t??r,c=rb(n),u=rb(i),d=p.useCallback(h=>{var m,g;s(h),h?(m=c.current)==null||m.call(c):(g=u.current)==null||g.call(u)},[c,u]);JA(r,()=>{var h;d(!1),(h=o.current)==null||h.focus()});const f=p.useMemo(()=>({open:l,setOpen:d,triggerRef:o}),[l,d]);return a.jsx(cIe.Provider,{value:f,children:a.jsx(Sdt,{open:l,onOpenChange:d,children:e})})},Fht=({className:e,children:t,disabled:n})=>{const{open:i}=tT(),{triggerRef:r}=uIe(),s=o=>{i||o.preventDefault()};return a.jsx(Edt,{ref:r,className:Ui(js.MenuItem,js.SubMenuItem,e),disabled:n,onPointerMove:s,onPointerLeave:s,children:a.jsxs("div",{className:js.PressableInner,children:[t,a.jsx(Yst,{width:"16",height:"16",className:js.SubTriggerIcon})]})})},Bht=({children:e,sideOffset:t=4,alignOffset:n=-6,width:i="auto",minWidth:r="auto",maxHeight:s})=>{const{open:o}=uIe();return a.jsx(ARe,{forceMount:!0,children:a.jsx(Y1,{className:js.Menu,enterDuration:350,exitDuration:200,disableAnimations:!0,children:o&&a.jsx(Cdt,{className:js.MenuList,sideOffset:t,alignOffset:n,avoidCollisions:!0,collisionPadding:{bottom:30,top:30,left:12,right:12},onEscapeKeyDown:Dp,style:z0({"menu-width":i,"menu-min-width":r,"menu-max-height":s}),children:e},"submenu")})})},Uht=({children:e,value:t,onChange:n,indicatorPosition:i="end",...r})=>a.jsx(wdt,{...r,value:t,onValueChange:s=>n(s),"data-indicator-position":i,children:e}),Qht=({className:e,children:t,...n})=>a.jsx(Odt,{className:Ui(js.MenuItem,js.RadioItem,e),...n,children:a.jsxs("div",{className:js.PressableInner,children:[a.jsx("div",{className:js.RadioIndicator,children:a.jsx(_Re,{className:js.RadioIndicatorActive})}),t]})}),zht=({className:e,children:t,indicatorPosition:n="end",indicatorVariant:i="solid",...r})=>a.jsx(xdt,{className:Ui(js.MenuItem,js.CheckboxItem,e),...r,"data-indicator-position":n,"data-indicator-variant":i,children:a.jsxs("div",{className:js.PressableInner,children:[a.jsx("div",{className:js.CheckboxIndicator,children:a.jsx(_Re,{children:i==="ghost"?a.jsx(fC,{className:"size-4"}):a.jsx("div",{className:js.CheckboxCircle,children:a.jsx(fC,{className:"size-4"})})})}),t]})});er.Content=Mht;er.Item=Nht;er.ItemActions=Rht;er.ItemAction=Iht;er.Link=Pht;er.Separator=Dht;er.Trigger=Lht;er.Sub=$ht;er.SubTrigger=Fht;er.SubContent=Bht;er.CheckboxItem=zht;er.RadioGroup=Uht;er.RadioItem=Qht;const Vht="_Tooltip_16g2y_1",Hht="_TriggerDecorator_16g2y_73",dIe={Tooltip:Vht,TriggerDecorator:Hht},ka=e=>{const{ref:t,children:n,content:i,forceOpen:r=i===null?!1:void 0,maxWidth:s=300,openDelay:o=150,interactive:l=!1,compact:c=!1,preventUnintentionalClickToClose:u,align:d,alignOffset:f=0,side:h,sideOffset:m=5,gutterSize:g="md",contentClassName:b,onPointerDown:v,onClick:y,...w}=e,[x,O]=p.useState(!1),[k,S]=p.useState(!1);OV(()=>S(!1),k?400:null);const C=r??x,E=T=>{typeof r!="boolean"&&(O(T),u&&S(T))},j=T=>{u&&k&&(T.preventDefault(),T.stopPropagation())};return a.jsxs(fIe,{open:C,delayDuration:o,onOpenChange:E,disableHoverableContent:!l,children:[a.jsx(rIe,{asChild:!0,children:a.jsx(oNe,{...w,ref:t,onPointerDown:T=>{j(T),v==null||v(T)},onClick:T=>{j(T),y==null||y(T)},children:n})}),a.jsx(hIe,{maxWidth:s,compact:c,align:d,alignOffset:f,side:h,sideOffset:m,gutterSize:g,className:b,children:i})]})},fIe=({children:e,open:t,onOpenChange:n,...i})=>(JA(t,()=>{n(!1)}),a.jsx(Bft,{children:a.jsx(Uft,{open:t,onOpenChange:n,...i,children:e})})),hIe=({children:e,maxWidth:t=300,compact:n=!1,clickable:i=void 0,alignOffset:r=0,sideOffset:s=5,gutterSize:o="md",className:l,style:c,...u})=>a.jsx(Qft,{children:a.jsx(zft,{...u,className:Ui(dIe.Tooltip,l),"data-compact":n,"data-clickable":i,"data-gutter-size":o,alignOffset:r,sideOffset:s,collisionPadding:15,hideWhenDetached:!0,style:{...c,maxWidth:t},onEscapeKeyDown:Dp,children:e})}),qht=({children:e,asChild:t=!0,...n})=>a.jsx(rIe,{asChild:t,...n,children:e}),Wht=e=>{const{children:t,className:n,focusable:i=!0,ref:r,...s}=e,o=typeof t=="string";return a.jsx(oNe,{ref:r,...s,className:Ui(dIe.TriggerDecorator,n),tabIndex:i?0:void 0,children:o?a.jsx("span",{children:t}):t})};ka.Root=fIe;ka.Content=hIe;ka.Trigger=qht;ka.TriggerDecorator=Wht;const Kht=50,Cee=48;function Ght(e){return(e.events??[]).flatMap(t=>{var r,s;const i=(((r=t.content)==null?void 0:r.parts)??[]).map(o=>typeof o.text=="string"?o.text:"").filter(Boolean).join("");return i?[{text:i,role:t.author??((s=t.content)==null?void 0:s.role)??"",ts:t.timestamp}]:[]})}function Xht(e){var t,n;for(const i of e.events??[])if(i.author==="user"||((t=i.content)==null?void 0:t.role)==="user"){const r=(((n=i.content)==null?void 0:n.parts)??[]).map(s=>s.text).find(Boolean);if(r)return r}return Q("search.untitledSession")}function Yht(e,t,n){const i=Math.max(0,t-Cee),r=Math.min(e.length,t+n+Cee);return(i>0?"…":"")+e.slice(i,r).trim()+(r{var c;if((c=l.events)!=null&&c.length)return l;try{return await sC(t,e,l.id)}catch{return l}})),o=[];for(const l of s)for(const{text:c,role:u,ts:d}of Ght(l)){const f=c.toLowerCase().indexOf(i);if(f!==-1){o.push({type:"session",appId:t,sessionId:l.id,title:Xht(l),snippet:Yht(c,f,i.length),role:u,ts:d??l.lastUpdateTime});break}}return o.sort((l,c)=>(c.ts??0)-(l.ts??0)),o.slice(0,Kht)}async function Jht(e,t){if(!e||!t.trim())return{results:[]};let n;try{n=await wTe(e,t.trim())}catch(o){const l=String(o);return{results:[],note:l.includes("404")?Q("search.webUnavailable"):Q("search.webFailed",{message:l})}}const{mounted:i,results:r,error:s}=n;return i?s?{results:[],note:s}:{results:r.map((o,l)=>({type:"web",index:l,title:o.title,url:o.url,siteName:o.siteName,summary:o.summary}))}:{results:[],note:Q("search.webNotMounted")}}async function ept(e,t,n,i){if(!t||!i.trim())return{results:[]};const r=await xTe(t,e,i.trim(),n);if(!r.mounted)return{results:[],note:Q(e==="knowledge"?"search.knowledgeNotMounted":"search.memoryNotMounted")};if(r.error)return{results:[],note:r.error};const s=r.sourceName??Q(e==="knowledge"?"search.knowledge":"search.longTermMemory");return{results:r.results.map((o,l)=>e==="knowledge"?{type:"knowledge",index:l,content:o.content,sourceName:s,sourceType:r.sourceType}:{type:"memory",index:l,content:o.content,sourceName:s,sourceType:r.sourceType,author:o.author,ts:o.timestamp})}}async function tpt(e,t,n){return e==="session"?{results:await Zht(n.userId,n.appId,t)}:e==="web"?Jht(n.appId,t):ept(e,n.appId,n.userId,t)}function pIe({mirrored:e=!1}){return a.jsxs("g",{opacity:"0.5",transform:e?"translate(20 0) scale(-1 1)":void 0,children:[a.jsx("path",{className:"sidebar-panel-glyph__divider",d:"M5.938 6.833c.11 0 .249.102.249.292v6.042c0 .19-.14.291-.249.291s-.248-.101-.248-.291V7.125c0-.19.139-.292.248-.292Z",strokeWidth:"1.167"}),a.jsx("path",{className:"sidebar-panel-glyph__frame",d:"M14.5 3.75h-9a3 3 0 0 0-3 3v6.857a3 3 0 0 0 3 3h9a3 3 0 0 0 3-3V6.75a3 3 0 0 0-3-3Z",strokeWidth:"1.667",strokeLinecap:"round",strokeLinejoin:"round"})]})}function npt(e){return a.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",...e,children:a.jsx(pIe,{})})}function ipt(e){return a.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",...e,children:a.jsx(pIe,{mirrored:!0})})}function rpt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 8.333c.368 0 .667.299.667.667v2h2a.667.667 0 0 1 0 1.333h-2v2a.667.667 0 0 1-1.334 0v-2h-2a.667.667 0 0 1 0-1.333h2V9c0-.368.299-.667.667-.667ZM7.667 1c3.49 0 6.383 2.554 6.913 5.896a.667.667 0 0 1-1.317.208 5.667 5.667 0 1 0-9.708 4.424.67.67 0 0 1 .07.12.667.667 0 0 1-.13.834l-.95.853 4.788-.002a.667.667 0 0 1 0 1.334l-5.657.002c-.917 0-1.35-1.131-.67-1.744l1.163-1.045A6.97 6.97 0 0 1 .667 8c0-3.866 3.134-7 7-7Z",fill:"currentColor"})})}function spt(e){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.333",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"7.333",cy:"7.333",r:"5.333"}),a.jsx("path",{d:"m11.133 11.133 2.867 2.867"})]})}function apt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M8 0.667c4.05 0 7.334 3.283 7.334 7.333 0 4.05-3.284 7.334-7.334 7.334S0.667 12.05 0.667 8 3.95 0.667 8 0.667Zm0 1.333a6 6 0 1 0 0 12A6 6 0 0 0 8 2ZM6.167 6c.368 0 .667.299.667.667v2a.667.667 0 0 1-1.334 0v-2c0-.368.299-.667.667-.667Zm3.666 0c.368 0 .667.299.667.667v2a.667.667 0 0 1-1.333 0v-2c0-.368.298-.667.666-.667Z",fill:"currentColor"})})}function mIe(e){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M7.58 2.6a.667.667 0 0 0-.667-.667h-.666a.667.667 0 0 0-.667.667v10.667c0 .368.299.666.667.666h.666a.667.667 0 0 0 .667-.666V2.6Zm1.333 10.667A2 2 0 0 1 6.913 15.267h-.666a2 2 0 0 1-2-2V2.6a2 2 0 0 1 2-2h.666a2 2 0 0 1 2 2v10.667Z",fill:"currentColor"}),a.jsx("path",{d:"M11.88 5.045a.667.667 0 0 0-.801-.514l-.653.136a.667.667 0 0 0-.504.786l1.85 8.092c.081.358.44.589.8.514l.653-.137a.667.667 0 0 0 .504-.786L11.88 5.045Zm3.155 7.82a2 2 0 0 1-1.512 2.358l-.653.136a2 2 0 0 1-2.403-1.541L8.617 5.726a2 2 0 0 1 1.513-2.358l.652-.136a2 2 0 0 1 2.404 1.541l1.849 8.092Z",fill:"currentColor"}),a.jsx("path",{d:"M4.247 2.6a.667.667 0 0 0-.667-.667h-.667a.667.667 0 0 0-.666.667v10.667c0 .368.298.666.666.666h.667a.667.667 0 0 0 .667-.666V2.6ZM5.58 13.267a2 2 0 0 1-2 2h-.667a2 2 0 0 1-2-2V2.6a2 2 0 0 1 2-2h.667a2 2 0 0 1 2 2v10.667Z",fill:"currentColor"})]})}function gIe(e){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M3.25 2.25h6l3.5 3.5v8H3.25v-11Z"}),a.jsx("path",{d:"M9.25 2.25v3.5h3.5M5.5 8.25h5M5.5 10.75h4"})]})}function opt({className:e="icon"}){return a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[a.jsx("path",{d:"M16.4 10.7a5.7 5.7 0 1 1-1.67-4.03"}),a.jsx("path",{d:"M15.25 15.25 19.6 19.6"})]})}function lpt({open:e}){return a.jsx("svg",{className:`search-source-chevron ${e?"open":""}`,viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:a.jsx("path",{d:"m3.25 4.75 2.75 2.5 2.75-2.5"})})}function cpt({active:e=!1,onClick:t}){const{t:n}=Te("workspaceTools");return a.jsxs("button",{className:`new-chat${e?" is-active":""}`,onClick:t,"aria-label":n("search.nav"),"aria-current":e?"page":void 0,title:n("search.nav"),children:[a.jsx(spt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:n("search.nav")})]})}function upt(e,t,n,i){const r=!!e,s=new Set((t==null?void 0:t.searchSources)??[]),o=l=>r?n?i("search.checkingCapabilities"):i("search.notMounted",{label:l}):i("search.selectAgent");return[{id:"session",label:i("search.sources.session"),ready:r,unavailableLabel:i("search.selectAgent")},{id:"web",label:i("search.sources.web"),ready:r&&s.has("web"),description:i("search.webDescription"),unavailableLabel:o(" web_search")},{id:"knowledge",label:i("search.sources.knowledge"),ready:r&&s.has("knowledge"),unavailableLabel:o(i("search.sources.knowledge"))},{id:"memory",label:i("search.sources.memory"),ready:r&&s.has("memory"),unavailableLabel:o(i("search.sources.memory"))}]}function mI(e,t){return{context_search:"Context Search",local:t("search.backendLocal"),mem0:"Mem0",milvus:"Milvus",opensearch:"OpenSearch",openviking:"OpenViking",redis:"Redis",tos_vector:"TOS Vector",viking:"VikingDB"}[e.toLowerCase()]??e}function Aee(e,t){return e?new Date(e*1e3).toLocaleString(t,{timeZone:"Asia/Shanghai",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):""}function dpt({userId:e,appId:t,agentInfo:n,capabilitiesLoading:i,agentLabel:r,onOpenSession:s}){var L,F;const{t:o,i18n:l}=Te("workspaceTools"),c=l.resolvedLanguage||l.language,[u,d]=p.useState("session"),[f,h]=p.useState(""),[m,g]=p.useState([]),[b,v]=p.useState(),[y,w]=p.useState(!1),[x,O]=p.useState(!1),[k,S]=p.useState(!1),C=p.useRef(0),E=p.useRef(null),j=upt(t,n,i,o),T=j.find(M=>M.id===u),R=u==="knowledge"?(L=n==null?void 0:n.components)==null?void 0:L.find(M=>M.source==="knowledgebase"||M.kind==="knowledgebase"):u==="memory"?(F=n==null?void 0:n.components)==null?void 0:F.find(M=>M.source==="long_term_memory"||M.kind==="memory"):void 0;p.useEffect(()=>{C.current+=1,d("session"),g([]),v(void 0),O(!1),w(!1),S(!1)},[t]),p.useEffect(()=>{if(!k)return;function M(V){var q;(q=E.current)!=null&&q.contains(V.target)||S(!1)}return document.addEventListener("pointerdown",M),()=>document.removeEventListener("pointerdown",M)},[k]);async function A(M,V){var z;const q=M.trim();if(!q||!((z=j.find(Z=>Z.id===V))!=null&&z.ready))return;const U=++C.current;w(!0),O(!0);let J;try{J=await tpt(V,q,{userId:e,appId:t})}catch(Z){const ne=Z instanceof Error?Z.message:String(Z);J={results:[],note:o("search.failed",{message:ne})}}U===C.current&&(g(J.results),v(J.note),w(!1))}function N(M){C.current+=1,h(M),g([]),v(void 0),O(!1),w(!1)}function P(M){C.current+=1,d(M),S(!1),g([]),v(void 0),O(!1),w(!1)}const I=!!(T!=null&&T.ready),D=t?u==="web"?o("search.placeholder.web"):u==="knowledge"?o("search.placeholder.knowledge",{name:(R==null?void 0:R.name)??o("search.placeholder.knowledgeFallback")}):u==="memory"?o("search.placeholder.memory",{name:(R==null?void 0:R.name)??o("search.placeholder.memoryFallback")}):o("search.placeholder.session"):o("search.placeholder.selectAgent"),_=R!=null&&R.backend?mI(R.backend,o):"";return a.jsxs("div",{className:"search",children:[a.jsxs("div",{className:"search-box",children:[a.jsxs("div",{className:"search-source-picker-wrap",ref:E,children:[a.jsxs("button",{className:"search-source-picker",type:"button","aria-label":o("search.sourceTypeAria",{label:(T==null?void 0:T.label)??o("search.notSelected")}),"aria-haspopup":"listbox","aria-expanded":k,onClick:()=>S(M=>!M),children:[a.jsx("span",{children:(T==null?void 0:T.label)??o("search.sourceType")}),_&&a.jsx("small",{children:_}),a.jsx(lpt,{open:k})]}),k&&a.jsx("div",{className:"search-source-menu",role:"listbox","aria-label":o("search.selectSource"),children:j.map(M=>{var U,J;const V=M.id==="knowledge"?(U=n==null?void 0:n.components)==null?void 0:U.find(z=>z.source==="knowledgebase"||z.kind==="knowledgebase"):M.id==="memory"?(J=n==null?void 0:n.components)==null?void 0:J.find(z=>z.source==="long_term_memory"||z.kind==="memory"):void 0,q=V?[V.name,V.backend?mI(V.backend,o):""].filter(Boolean).join(" · "):M.ready?M.description:M.unavailableLabel;return a.jsxs("button",{type:"button",role:"option","aria-selected":u===M.id,disabled:!M.ready,onClick:()=>P(M.id),children:[a.jsx("span",{children:M.label}),q&&a.jsx("small",{children:q})]},M.id)})})]}),a.jsx("span",{className:"search-box-divider","aria-hidden":!0}),a.jsx("input",{className:"search-input",value:f,onChange:M=>N(M.target.value),onKeyDown:M=>{M.key==="Enter"&&(M.preventDefault(),A(f,u))},placeholder:D,disabled:!I,autoFocus:!0}),a.jsx("button",{className:"search-go",onClick:()=>void A(f,u),disabled:!f.trim()||y,"aria-label":o("search.nav"),children:y?a.jsx(Fi,{className:"icon spin"}):a.jsx(opt,{className:"icon"})})]}),a.jsx("div",{className:"search-results",children:I?x?y?null:b?a.jsx("div",{className:"search-empty",children:b}):m.length===0&&x?a.jsx("div",{className:"search-empty",children:o("search.noResults",{query:f.trim()})}):m.map((M,V)=>a.jsx(fpt,{result:M,agentLabel:r,onOpen:s,locale:c},V)):a.jsx("div",{className:"search-empty",children:o(u==="web"?"search.instructions.web":u==="knowledge"?"search.instructions.knowledge":u==="memory"?"search.instructions.memory":"search.instructions.session")}):a.jsx("div",{className:"search-empty",children:t?i?o("search.loadingCapabilities"):(T==null?void 0:T.unavailableLabel)??o("search.sourceUnavailable"):o("search.noAgentHint")})})]})}function fpt({result:e,agentLabel:t,onOpen:n,locale:i}){const{t:r}=Te("workspaceTools");switch(e.type){case"session":return a.jsxs("button",{className:"search-result",onClick:()=>n(e.appId,e.sessionId),children:[a.jsx(Bje,{className:"search-result-icon"}),a.jsxs("div",{className:"search-result-body",children:[a.jsxs("div",{className:"search-result-head",children:[a.jsx("span",{className:"search-result-title",children:e.title}),a.jsxs("span",{className:"search-result-meta",children:[t(e.appId),e.ts?` · ${Aee(e.ts,i)}`:""]})]}),a.jsx("div",{className:"search-result-snippet",children:e.snippet})]})]});case"web":return a.jsxs("a",{className:"search-result",href:e.url||void 0,target:"_blank",rel:"noreferrer noopener",children:[a.jsx(nM,{className:"search-result-icon"}),a.jsxs("div",{className:"search-result-body",children:[a.jsxs("div",{className:"search-result-head",children:[a.jsx("span",{className:"search-result-title",children:e.title||e.url}),a.jsxs("span",{className:"search-result-meta",children:[e.siteName,e.url&&a.jsx(p0,{className:"search-result-ext"})]})]}),e.summary&&a.jsx("div",{className:"search-result-snippet",children:e.summary})]})]});case"knowledge":return a.jsxs("div",{className:"search-result search-result-static",children:[a.jsx(Tee,{source:"knowledge"}),a.jsxs("div",{className:"search-result-body",children:[a.jsxs("div",{className:"search-result-head",children:[a.jsx("span",{className:"search-result-title",children:r("search.knowledgeFragment",{index:e.index+1})}),a.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${mI(e.sourceType,r)}`:""]})]}),a.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});case"memory":return a.jsxs("div",{className:"search-result search-result-static",children:[a.jsx(Tee,{source:"memory"}),a.jsxs("div",{className:"search-result-body",children:[a.jsxs("div",{className:"search-result-head",children:[a.jsx("span",{className:"search-result-title",children:r("search.memoryFragment",{index:e.index+1})}),a.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${mI(e.sourceType,r)}`:"",e.ts?` · ${Aee(e.ts,i)}`:""]})]}),a.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});default:return null}}function Tee({source:e,className:t="search-result-icon"}){return e==="knowledge"?a.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[a.jsx("path",{d:"M5 5.5h10.5A3.5 3.5 0 0 1 19 9v9.5H8.5A3.5 3.5 0 0 1 5 15V5.5Z"}),a.jsx("path",{d:"M8.25 9h7.5M8.25 12.25h6"})]}):a.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[a.jsx("path",{d:"M12 4.5a7.5 7.5 0 1 0 7.5 7.5"}),a.jsx("path",{d:"M12 8a4 4 0 1 0 4 4M12 11.3a.7.7 0 1 0 0 1.4.7.7 0 0 0 0-1.4Z"})]})}function hpt({filled:e=!1,...t}){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:e?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[a.jsx("rect",{x:"3.5",y:"9.3",width:"4.5",height:"10.2",rx:"1.5"}),a.jsx("path",{d:"M8 10.2 11.3 4.8c.5-.8 1.7-.45 1.7.5v3.8h4.2a2.1 2.1 0 0 1 2.04 2.6l-1.4 5.75A2.1 2.1 0 0 1 15.8 19H8"})]})}function ppt({filled:e=!1,...t}){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:e?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"4.5",height:"10.2",rx:"1.5"}),a.jsx("path",{d:"M8 13.8 11.3 19.2c.5.8 1.7.45 1.7-.5v-3.8h4.2a2.1 2.1 0 0 0 2.04-2.6l-1.4-5.75A2.1 2.1 0 0 0 15.8 5H8"})]})}function bIe(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5.25 4.25h9.5a2.5 2.5 0 0 1 2.5 2.5v3.5"}),a.jsx("path",{d:"M13.25 17.75h-8a2.5 2.5 0 0 1-2.5-2.5v-8a3 3 0 0 1 3-3"}),a.jsx("path",{d:"M7 8.25h5.5M7 11.75h3.25"}),a.jsx("path",{d:"m13.35 16.65.42-2.16 4.76-4.76a1.35 1.35 0 0 1 1.91 1.91l-4.76 4.76-2.33.25Z"}),a.jsx("path",{d:"m17.65 10.6 1.9 1.9"})]})}const pM="/assets/media/logo-DCsNZy-k.svg",aH="data:image/svg+xml,%3csvg%20width='28'%20height='23'%20viewBox='0%200%2028%2023'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M17.1957%209.44218C17.0253%209.58161%2016.7774%209.47317%2016.7774%209.24079V8.01696V0.611967C16.7774%200.395085%2016.514%200.271152%2016.3591%200.410576L6.04172%209.16334C5.87132%209.30276%205.62345%209.19432%205.62345%208.96194V2.98218C5.62345%202.81178%205.48403%202.67235%205.31362%202.67235H0.309832C0.139424%202.67235%200%202.81178%200%202.98218V21.7115C0%2021.9284%200.263357%2022.0524%200.418273%2021.9129L10.7202%2013.1602C10.8906%2013.0207%2011.1385%2013.1292%2011.1385%2013.3616V22.0059C11.1385%2022.2228%2011.4018%2022.3467%2011.5567%2022.2073L21.8586%2013.4545C22.0291%2013.3151%2022.2769%2013.4235%2022.2769%2013.6559V19.6357C22.2769%2019.8061%2022.4163%2019.9455%2022.5868%2019.9455H27.5905C27.7609%2019.9455%2027.9004%2019.8061%2027.9004%2019.6357V0.890816C27.9004%200.673934%2027.637%200.550001%2027.4821%200.689425L17.1957%209.44218Z'%20fill='%230066FC'/%3e%3c/svg%3e";function mpt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M8.5 4.5H6a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-13a2 2 0 0 0-2-2h-2.5"}),a.jsx("rect",{x:"8.5",y:"2.5",width:"7",height:"4",rx:"1.5"}),a.jsx("path",{d:"m8 13 2.5 2.5L16 10"})]})}const _ee="(max-width: 860px)";function jee({title:e}){const t=p.useRef(null),n=p.useRef(null),[i,r]=p.useState(0);p.useLayoutEffect(()=>{const l=t.current,c=n.current;if(!l||!c)return;const u=()=>{const f=Math.max(0,Math.ceil(c.scrollWidth-l.clientWidth));r(h=>h===f?h:f)};u();const d=new ResizeObserver(u);return d.observe(l),d.observe(c),()=>d.disconnect()},[e]);const s=Math.min(12,Math.max(4.8,3.6+i/36)),o={"--history-title-translate":`-${i}px`,"--history-title-duration":`${s.toFixed(2)}s`};return a.jsx("span",{ref:t,className:`history-title${i>0?" is-overflowing":""}`,style:o,children:a.jsx("span",{ref:n,className:"history-title-text",children:e})})}function gpt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"7",cy:"7",r:"2.25"}),a.jsx("circle",{cx:"17",cy:"7",r:"2.25"}),a.jsx("circle",{cx:"7",cy:"17",r:"2.25"}),a.jsx("circle",{cx:"17",cy:"17",r:"2.25"})]})}function bpt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"12",cy:"12",r:"8.25"}),a.jsx("path",{d:"M3.75 12h16.5M12 3.75c2.1 2.2 3.2 4.95 3.2 8.25S14.1 18.05 12 20.25M12 3.75C9.9 5.95 8.8 8.7 8.8 12s1.1 6.05 3.2 8.25"})]})}function ypt(e){let t=2166136261;for(const i of e)t^=i.charCodeAt(0),t=Math.imul(t,16777619);const n=t>>>0;return{"--avatar-hue-a":194+n%22,"--avatar-hue-b":214+(n>>>6)%25,"--avatar-hue-c":176+(n>>>12)%25,"--avatar-x":`${22+(n>>>18)%55}%`,"--avatar-y":`${18+(n>>>24)%58}%`}}const vpt={super_admin:"account.roles.super_admin",admin:"account.roles.admin",developer:"account.roles.developer",user:"account.roles.user"};function xpt({activePage:e,access:t,userInfo:n,onAgentKitCli:i,onDeveloperResources:r,onSystemInfo:s,onIssueFeedback:o,onLogout:l}){const{t:c,i18n:u}=Te(["sidebar","common"]),[d,f]=p.useState("");if(!n)return null;const h=vet(n)||c("sidebar:account.defaultUser"),m=typeof n.email=="string"?n.email.trim():"",g=ypt(h),b=xet(n),v=b===d?"":b,y=vA(u.resolvedLanguage??u.language)??yA;return a.jsx("div",{className:"sidebar-user",children:a.jsxs("div",{className:"sidebar-user-row",children:[a.jsxs(er,{modal:!0,children:[a.jsx(er.Trigger,{children:a.jsxs("button",{type:"button",className:"sidebar-user-btn",title:h,children:[a.jsx("span",{className:`account-avatar${v?" has-image":""}`,style:g,"aria-hidden":"true",children:v?a.jsx("img",{className:"account-avatar-image",src:v,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>f(v)}):null}),a.jsx("span",{className:"sidebar-user-identity",children:a.jsx("span",{className:"sidebar-user-name",children:h})})]})}),a.jsxs(er.Content,{side:"top",align:"start",sideOffset:4,minWidth:216,children:[a.jsxs("div",{className:"account-menu-head",children:[a.jsx("span",{className:`account-avatar account-avatar--lg${v?" has-image":""}`,style:g,"aria-hidden":"true",children:v?a.jsx("img",{className:"account-avatar-image",src:v,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>f(v)}):null}),a.jsxs("div",{className:"account-id",children:[a.jsxs("div",{className:"account-name-row",children:[a.jsx("div",{className:"account-name",children:h}),a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",pill:!0,children:c(`sidebar:${vpt[t.role]}`)})]}),m&&m!==h&&a.jsx("div",{className:"account-sub",children:m})]})]}),a.jsxs(er.Item,{className:"account-menu-action",onSelect:s,children:[a.jsx(pm,{className:"icon","aria-hidden":"true"}),c("sidebar:account.systemInfo")]}),a.jsxs(er.Sub,{children:[a.jsx(er.SubTrigger,{className:"account-menu-action",children:a.jsxs("span",{className:"account-menu-action__label",children:[a.jsx(bpt,{className:"icon"}),c("sidebar:account.language")]})}),a.jsx(er.SubContent,{sideOffset:6,minWidth:136,children:a.jsx(er.RadioGroup,{value:y,onChange:w=>{Aqe(w)},indicatorPosition:"end",children:jU.map(w=>a.jsx(er.RadioItem,{value:w,children:c(`common:languageNames.${w}`)},w))})})]}),a.jsxs(er.Item,{className:"account-menu-action",onSelect:o,children:[a.jsx(bIe,{className:"icon"}),c("sidebar:account.issueFeedback")]}),a.jsxs(er.Item,{className:"account-menu-action",onSelect:l,children:[a.jsx(Qat,{className:"icon","aria-hidden":"true"}),c("sidebar:account.logout")]})]})]}),a.jsxs("div",{className:"sidebar-user-shortcuts","aria-label":c("sidebar:account.shortcuts"),children:[a.jsx(ka,{compact:!0,content:c("sidebar:account.tryCli"),children:a.jsx("button",{type:"button",className:"sidebar-user-shortcut",onClick:i,"aria-label":c("sidebar:account.tryCli"),children:a.jsx(aat,{className:"icon"})})}),a.jsx(ka,{compact:!0,content:c("sidebar:account.developerResources"),children:a.jsx("button",{type:"button",className:`sidebar-user-shortcut${e==="developer-resources"?" is-active":""}`,onClick:r,"aria-label":c("sidebar:account.developerResources"),"aria-current":e==="developer-resources"?"page":void 0,children:a.jsx(Kst,{className:"icon"})})})]})]})})}function wpt({branding:e,cloudProvider:t,sessions:n,currentSessionId:i,activePage:r,features:s,access:o,streamingSids:l,evaluatingSids:c,sandboxHistory:u,onNewChat:d,onSearch:f,onQuickCreate:h,onLibrary:m,onReviewCenter:g,onAddAgent:b,onMyAgents:v,onWorkspace:y,onApplications:w,onCronJobs:x,onAgentKitCli:O,onDeveloperResources:k,onSystemInfo:S,onUserManagement:C,onIssueFeedback:E,onPickSession:j,onDeleteSession:T,userInfo:R,onLogout:A}){const{t:N}=Te("sidebar"),P=z=>(s==null?void 0:s[z])!==!1,I=o.role==="admin"||o.role==="super_admin",D=o.capabilities.manageUsers&&!!C,[_,L]=p.useState(null),F=p.useRef(typeof window<"u"&&window.matchMedia(_ee).matches),[M,V]=p.useState(F.current),q=n.map(z=>({id:z.id,title:z.title||iM(z.events,N("history.newConversation")),createdAt:(z.lastUpdateTime??0)*1e3})).sort((z,Z)=>Z.createdAt-z.createdAt),U=()=>{F.current=!1,V(z=>!z),L(null)};p.useEffect(()=>{const z=window.matchMedia(_ee),Z=ne=>{ne.matches?V(W=>W||(F.current=!0,!0)):F.current&&(F.current=!1,V(!1))};return z.addEventListener("change",Z),()=>z.removeEventListener("change",Z)},[]);const J=t==="byteplus"?aH:pM;return a.jsxs("aside",{className:`sidebar ${M?"is-collapsed":""}`,children:[a.jsxs("div",{className:"sidebar-top",children:[a.jsxs("div",{className:"sidebar-brand-row",children:[a.jsxs("button",{type:"button",className:"brand",onClick:d,"aria-label":N("navigation.home"),title:N("navigation.home"),children:[a.jsx("img",{className:"brand-logo",src:e.logoUrl||J,width:20,height:20,alt:"","aria-hidden":!0}),a.jsx("span",{className:"brand-title",children:e.title})]}),a.jsx("button",{type:"button",className:"sidebar-collapse-toggle",onClick:U,"aria-label":N(M?"navigation.expand":"navigation.collapse"),title:N(M?"navigation.expand":"navigation.collapse"),children:M?a.jsx(ipt,{className:"icon"}):a.jsx(npt,{className:"icon"})})]}),a.jsxs("nav",{className:"sidebar-nav","aria-label":N("navigation.label"),children:[P("newChat")&&a.jsxs("button",{className:`new-chat new-chat--conversation${r==="new-chat"?" is-active":""}`,onClick:d,"aria-label":N("navigation.newChat"),"aria-current":r==="new-chat"?"page":void 0,title:N("navigation.newChat"),children:[a.jsx(rpt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.newChat")})]}),P("search")&&a.jsx(cpt,{active:r==="search",onClick:f}),a.jsxs("button",{className:`new-chat new-chat--agents${r==="agents"?" is-active":""}`,onClick:v,"aria-label":N("navigation.agents"),"aria-current":r==="agents"?"page":void 0,title:N("navigation.agents"),children:[a.jsx(apt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.agents")})]}),a.jsxs("button",{className:`new-chat new-chat--workspaces${r==="workspaces"?" is-active":""}`,onClick:y,"aria-label":N("navigation.workspaces"),"aria-current":r==="workspaces"?"page":void 0,title:N("navigation.workspaces"),children:[a.jsx(Oat,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.workspaces")})]}),a.jsxs("button",{className:`new-chat new-chat--library${r==="library"?" is-active":""}`,onClick:m,"aria-label":N("navigation.library"),"aria-current":r==="library"?"page":void 0,title:N("navigation.library"),children:[a.jsx(mIe,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.library")})]}),a.jsxs("button",{className:`new-chat new-chat--cronjobs${r==="cronjobs"?" is-active":""}`,onClick:x,"aria-label":N("navigation.cronjobs"),"aria-current":r==="cronjobs"?"page":void 0,title:N("navigation.cronjobs"),children:[a.jsx(hV,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.cronjobs")})]}),a.jsxs("button",{className:`new-chat new-chat--applications${r==="applications"?" is-active":""}`,onClick:w,"aria-label":N("navigation.automations"),"aria-current":r==="applications"?"page":void 0,title:N("navigation.automations"),children:[a.jsx(gpt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.automations")})]})]}),I||D?a.jsxs("nav",{className:"sidebar-nav sidebar-nav--administration","aria-label":N("navigation.administration"),children:[a.jsx("div",{className:"sidebar-nav-group-title","aria-hidden":"true",children:N("navigation.administration")}),I?a.jsxs("button",{type:"button",className:`new-chat new-chat--review-center${r==="review-center"?" is-active":""}`,onClick:g,"aria-label":N("navigation.reviewCenter"),"aria-current":r==="review-center"?"page":void 0,title:N("navigation.reviewCenter"),children:[a.jsx(mpt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.reviewCenter")})]}):null,D?a.jsxs("button",{type:"button",className:`new-chat${r==="users"?" is-active":""}`,onClick:C,"aria-label":N("navigation.users"),"aria-current":r==="users"?"page":void 0,title:N("navigation.users"),children:[a.jsx($ot,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.users")})]}):null]}):null]}),P("history")&&a.jsxs("div",{className:"sidebar-history",children:[a.jsxs("div",{className:"history-head",children:[a.jsx("span",{children:N("history.title")}),P("newChat")&&a.jsx("button",{type:"button",className:"history-new-chat",onClick:(u==null?void 0:u.onNew)??d,disabled:u==null?void 0:u.newDisabled,"aria-label":N("history.create"),title:N("history.create"),children:a.jsx(ic,{className:"icon"})})]}),a.jsx("div",{className:"history-list",children:u?a.jsxs(a.Fragment,{children:[u.loading&&u.threads.length===0?a.jsx("div",{className:"history-empty",role:"status",children:N("history.loading")}):null,u.error?a.jsx("div",{className:"history-error",role:"alert",children:u.error}):null,!u.loading&&!u.error&&u.threads.length===0?a.jsx("div",{className:"history-empty",children:N("history.empty")}):null,u.threads.map(z=>{const Z=z.id===u.currentThreadId,ne=z.name||z.preview||`Thread ${z.id.slice(0,8)}`,W=z.id===u.busyThreadId;return a.jsxs("div",{className:`history-item ${Z?"active":""}`,children:[a.jsxs("button",{type:"button",className:"history-item-btn",onClick:()=>u.onSelect(z.id),"aria-current":Z?"page":void 0,title:ne,disabled:W,children:[a.jsx(jee,{title:ne}),Z?a.jsx("span",{className:"history-current-badge",children:N("history.current")}):null]}),a.jsx("button",{type:"button",className:"history-more","aria-label":N("history.manage",{title:ne}),title:N("history.more"),disabled:W,onClick:()=>L(G=>G===z.id?null:z.id),children:a.jsx(KJ,{className:"icon"})}),_===z.id?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"menu-scrim",onClick:()=>L(null)}),a.jsx("div",{className:"history-menu",children:a.jsxs("button",{type:"button",className:"menu-item menu-item--danger",onClick:()=>{L(null),u.onDelete(z)},children:[a.jsx(Jg,{className:"icon"})," ",N("history.delete")]})})]}):null]},z.id)}),u.hasMore?a.jsx("button",{type:"button",className:"history-load-more",disabled:u.loading,onClick:u.onLoadMore,children:u.loading?N("history.loadingMore"):N("history.loadMore")}):null]}):a.jsxs(a.Fragment,{children:[q.length===0?a.jsx("div",{className:"history-empty",children:N("history.empty")}):null,q.map(z=>{const Z=z.id===i,ne=(l==null?void 0:l.has(z.id))===!0,W=!ne&&(c==null?void 0:c.has(z.id))===!0;return a.jsxs("div",{className:`history-item ${Z?"active":""}`,children:[a.jsxs("button",{className:"history-item-btn",onClick:()=>j(z.id),"aria-current":Z?"page":void 0,title:z.title,children:[a.jsx(jee,{title:z.title}),W&&a.jsxs("span",{className:"history-evaluating-status",title:N("history.evaluatingTitle"),children:[a.jsx("span",{className:"history-evaluating","aria-hidden":"true"}),N("history.evaluating")]})]}),a.jsxs("div",{className:"history-action-slot",children:[ne?a.jsx(WA,{className:"history-streaming-indicator",size:12,role:"status","aria-label":N("history.generating")}):null,a.jsx("button",{type:"button",className:"history-more","aria-label":N("history.manage",{title:z.title}),title:N("history.more"),onClick:()=>L(G=>G===z.id?null:z.id),children:a.jsx(KJ,{className:"icon"})})]}),_===z.id&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"menu-scrim",onClick:()=>L(null)}),a.jsx("div",{className:"history-menu",children:a.jsxs("button",{type:"button",className:"menu-item menu-item--danger",onClick:()=>{L(null),T(z.id)},children:[a.jsx(Jg,{className:"icon"})," ",N("history.delete")]})})]})]},z.id)})]})})]}),a.jsx("div",{className:"sidebar-footer",children:a.jsx(xpt,{activePage:r,access:o,userInfo:R,onAgentKitCli:O,onDeveloperResources:k,onSystemInfo:S,onIssueFeedback:E,onLogout:A})})]})}const Opt={name:"studio_share_space"},kpt={name:"studio_review_space"},yIe={share:Opt,review:kpt},Spt=yIe.share.name,vIe=yIe.review.name,Ept=[Spt,vIe];function xIe(e){return Ept.includes(e.trim().toLowerCase())}function Cpt(e){return e.name===vIe}const Apt="/web/skill-management";class e1 extends Error{constructor(t,n,i="SKILL_MANAGEMENT_ERROR",r="",s,o=""){super(t),this.status=n,this.code=i,this.statusText=r,this.originalError=s,this.rawResponse=o,this.name="SkillManagementApiError"}}async function dc(e,t={},n=ho){return fetch(Ta(`${Apt}${e}`),{...t,headers:ul(uc(t.headers)),signal:po(t.signal,n)})}async function nT(e,t){let n=t,i="SKILL_MANAGEMENT_ERROR",r;const s=await e.text().catch(()=>"");try{const o=JSON.parse(s);typeof o.detail=="string"?n=o.detail:o.detail&&(n=o.detail.message||t,i=o.detail.code||i,r=o.detail.originalError)}catch{s.trim()&&(n=Q("common.fallbackWithDetail",{fallback:t,detail:s.trim()}))}return new e1(n,e.status,i,e.statusText,r,s)}async function fc(e,t){if(!e.ok)throw await nT(e,t);return e.json()}async function Tpt(e){const t=new URLSearchParams({region:e.region,page:String(e.page),page_size:String(e.pageSize)});return e.project&&t.set("project",e.project),fc(await dc(`/spaces?${t}`,{signal:e.signal}),Q("skills.listSpacesFailed"))}async function _pt(e){if(xIe(e.name))throw new e1(Q("skills.reservedSpaceName"),409,"SKILL_SPACE_RESERVED_IDENTITY");return fc(await dc("/spaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Q("skills.createSpaceFailed"))}async function jpt(e){const t=new URLSearchParams({region:e.region});return fc(await dc(`/shared-space/ensure?${t}`,{method:"POST",signal:e.signal}),Q("skills.sharedSpaceFailed"))}async function Npt(e){return fc(await dc(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/review`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({region:e.region,version:e.version})},hr),Q("skills.submitReviewFailed"))}async function Rpt(e){const t=new URLSearchParams({region:e.region});return fc(await dc(`/reviews?${t}`,{signal:e.signal}),Q("skills.listReviewsFailed"))}async function Ipt(e){const t=new URLSearchParams({region:e.region});return fc(await dc(`/reviews/${encodeURIComponent(e.id)}/files?${t}`,{signal:e.signal},hr),Q("skills.reviewFilesFailed"))}async function Ppt(e){return fc(await dc(`/reviews/${encodeURIComponent(e.id)}/decision`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({region:e.region,decision:e.decision,reason:e.reason||"",comment:e.comment||""})},hr),Q("skills.decideReviewFailed"))}async function Dpt(e){const t=new URLSearchParams({region:e.region});return fc(await dc(`/spaces/${encodeURIComponent(e.spaceId)}/reviews?${t}`,{signal:e.signal}),Q("skills.listReviewsFailed"))}async function Mpt(e){if(xIe(e.name))throw new e1(Q("skills.reservedSpaceName"),409,"SKILL_SPACE_RESERVED_IDENTITY");return fc(await dc(`/spaces/${encodeURIComponent(e.spaceId)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e.name,description:e.description,region:e.region})}),Q("skills.updateSpaceFailed"))}async function Lpt(e){const t=new URLSearchParams({region:e.region});await fc(await dc(`/spaces/${encodeURIComponent(e.spaceId)}?${t}`,{method:"DELETE"}),Q("skills.deleteSpaceFailed"))}async function $pt(e){const t=new URLSearchParams({region:e.region});return e.project&&t.set("project",e.project),fc(await dc(`/spaces/${encodeURIComponent(e.spaceId)}/skills?${t}`,{method:"POST",headers:{"Content-Type":"application/zip"},body:e.file},hr),Q("skills.uploadFailed"))}async function Fpt(e){return fc(await dc("/validate",{method:"POST",headers:{"Content-Type":"application/zip"},body:e},hr),Q("skills.validateFailed"))}async function Bpt(e){const t=new URLSearchParams({region:e.region});await fc(await dc(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}?${t}`,{method:"DELETE"}),Q("skills.deleteFailed"))}async function wIe(e){const t=new URLSearchParams({region:e.region});e.version&&t.set("version",e.version),e.skillSpaceName&&t.set("skill_space_name",e.skillSpaceName),e.skillName&&t.set("skill_name",e.skillName);const n=await fc(await dc(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/files?${t}`),Q("skills.listFilesFailed"));return Array.isArray(n.files)?n.files:[]}async function Upt(e){var l;const t=new URLSearchParams({region:e.region});e.version&&t.set("version",e.version),e.skillSpaceName&&t.set("skill_space_name",e.skillSpaceName),e.skillName&&t.set("skill_name",e.skillName);const n=await dc(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/archive?${t}`,{},hr);n.ok||await fc(n,Q("skills.downloadFailed"));const r=((l=(n.headers.get("content-disposition")||"").match(/filename="([^"]+)"/))==null?void 0:l[1])||`${e.fallbackName}.zip`,s=URL.createObjectURL(await n.blob()),o=document.createElement("a");o.href=s,o.download=r,o.click(),URL.revokeObjectURL(s)}bn.hasResourceBundle("en-US","create")||bn.addResourceBundle("en-US","create",ehe,!0,!0);bn.hasResourceBundle("zh-CN","create")||bn.addResourceBundle("zh-CN","create",ave,!0,!0);function Xt(e,t={}){return bn.t(e,{...t,ns:"create"})}function Pc(e){var t;return((t=e==null?void 0:e.displayName)==null?void 0:t.trim())||(e==null?void 0:e.name)||""}async function mM(e,t){const n=await fetch(Ta(e),{headers:ul(uc({accept:"application/json"})),signal:po(t,ho)});if(!n.ok)throw await nT(n,Xt("helpers.skills.agentKitRequestFailed"));return n.json()}async function OIe(){return((await mM("/web/skill-spaces")).items||[]).filter(t=>!Cpt(t))}async function kIe(e,t){const n=t?`?region=${encodeURIComponent(t)}`:"";return(await mM(`/web/skill-spaces/${encodeURIComponent(e)}/skills${n}`)).items||[]}async function SIe(e,t){const n=new URLSearchParams({region:t.region,page:String(t.page),page_size:String(t.pageSize)});return t.project&&n.set("project",t.project),mM(`/web/skill-spaces/${encodeURIComponent(e)}/skills?${n.toString()}`,t.signal)}async function Qpt(e,t,n,i,r,s,o){const l=[];n&&l.push(`version=${encodeURIComponent(n)}`),i&&l.push(`region=${encodeURIComponent(i)}`),r&&l.push(`project=${encodeURIComponent(r)}`),s&&l.push(`skill_name=${encodeURIComponent(s)}`),o&&l.push(`skill_space_name=${encodeURIComponent(o)}`);const c=l.length>0?`?${l.join("&")}`:"";return mM(`/web/skill-spaces/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}${c}`)}function zpt(e,t){const n=_y(t);return{source:"skillspace",id:`ss:${e.id}/${n}/${t.version}`,name:t.skillName,description:t.skillDescription,folder:t.skillName,skillSpaceId:e.id,skillSpaceName:e.name,skillSpaceRegion:e.region,skillId:n,version:t.version}}function _y(e){return e.skillId||e.skillName}function Vpt(e,t,n="volcengine"){return n==="byteplus"?"":`https://console.volcengine.com/agentkit/${(t||"cn-beijing")==="cn-beijing"?"cn":"cn-shanghai"}/skillspace/detail/${encodeURIComponent(e)}`}const Hpt="data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20overflow='visible'%20style='display:%20block;'%20width='7.93649'%20height='8'%20viewBox='0%200%207.93649%208'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20id='Resizer'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.21499%200L0%207.27273L0.721499%208L7.93649%200.727273L7.21499%200ZM6.86867%203.99988L3.98268%206.90897L4.70418%207.63625L7.59017%204.72715L6.86867%203.99988Z'%20fill='%23737A87'/%3e%3c/svg%3e";function EIe({className:e="",counter:t,maxHeight:n,...i}){return a.jsxs("div",{className:`studio-textarea ${e}`.trim(),"data-counter":t!=null||void 0,style:{maxHeight:n},children:[a.jsx("textarea",{...i,className:"studio-textarea__input"}),t!=null&&a.jsx("span",{className:"studio-textarea__counter",children:t}),a.jsx("img",{className:"studio-textarea__resizer",src:Hpt,alt:"","aria-hidden":"true"})]})}async function CIe(e,t,n){const i=new URLSearchParams({region:e.region}),r=await fetch(Ta(`/web/skill-management/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/document?${i}`),{...t,headers:ul(uc(t.headers)),signal:po(e.signal,n)});if(!r.ok)throw await nT(r,"SKILL_DOCUMENT_REQUEST_FAILED");return r.json()}function qpt(e){return CIe(e,{},ho)}function Wpt(e){return CIe(e,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:e.content,baseVersion:e.baseVersion})},hr)}function Kpt({target:e,onClose:t,onSaved:n}){const{t:i}=Te("workspaceTools"),[r,s]=p.useState(null),[o,l]=p.useState(""),[c,u]=p.useState(!0),[d,f]=p.useState(!1),[h,m]=p.useState(""),[g,b]=p.useState(0),[v,y]=p.useState(!1),w=p.useId(),x=p.useRef(null),O=p.useRef(!1),k=p.useRef(!0),S=p.useRef({dirty:!1,onClose:t});S.current={dirty:r!==null&&o!==r.content,onClose:t};const C=p.useRef(null);function E(){O.current||(S.current.dirty?y(!0):S.current.onClose())}p.useEffect(()=>{var N,P;k.current=!0;const T=window.document.activeElement instanceof HTMLElement?window.document.activeElement:null,R=window.document.body.style.overflow;window.document.body.style.overflow="hidden",(P=(N=x.current)==null?void 0:N.querySelector("button"))==null||P.focus();function A(I){var _,L;if(I.isComposing||(I.key==="Escape"&&(I.preventDefault(),E()),I.key!=="Tab"))return;const D=Array.from(((_=x.current)==null?void 0:_.querySelectorAll('button:not([disabled]),textarea:not([disabled]),[tabindex="0"]'))??[]);D.length&&(I.shiftKey&&window.document.activeElement===D[0]?(I.preventDefault(),(L=D[D.length-1])==null||L.focus()):!I.shiftKey&&window.document.activeElement===D[D.length-1]&&(I.preventDefault(),D[0].focus()))}return window.addEventListener("keydown",A),()=>{var I;k.current=!1,(I=C.current)==null||I.abort(),window.removeEventListener("keydown",A),window.document.body.style.overflow=R,T!=null&&T.isConnected&&T.focus()}},[]),p.useEffect(()=>{const T=new AbortController;return u(!0),m(""),qpt({...e,signal:T.signal}).then(R=>{T.signal.aborted||(s(R),l(R.content))}).catch(()=>{T.signal.aborted||m("documentLoadFailed")}).finally(()=>{T.signal.aborted||u(!1)}),()=>T.abort()},[e,g]);async function j(){if(O.current||!(r!=null&&r.canUpdate)||o===r.content||!o.trim())return;O.current=!0,f(!0),m("");const T=new AbortController;C.current=T;try{await Wpt({...e,content:o,baseVersion:r.baseVersion,signal:T.signal}),k.current&&(n(),t())}catch(R){k.current&&m(R instanceof e1&&R.status===409?"documentConflict":R instanceof e1&&R.status===403?"accessDenied":"documentSaveFailed")}finally{O.current=!1,k.current&&f(!1)}}return yi.createPortal(a.jsx("div",{className:"mpa-skill-editor-backdrop",children:a.jsxs("section",{className:"mpa-skill-editor",role:"dialog","aria-modal":"true","aria-labelledby":w,ref:x,children:[a.jsxs("header",{children:[a.jsxs("h2",{id:w,children:[e.name," · SKILL.md"]}),a.jsx(Wi,{variant:"ghost",disabled:d,onClick:E,children:i("agentTopology.close")})]}),a.jsx("p",{className:"mpa-skill-editor-hint",children:i("agentTopology.documentEditHint")}),c?a.jsx("p",{role:"status",children:i("agentTopology.documentLoading")}):r?a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[r.baseVersion," ·"," ",i(r.canUpdate?"agentTopology.documentWritable":"agentTopology.documentReadOnly")]}),a.jsx(EIe,{"aria-label":"SKILL.md",value:o,readOnly:!r.canUpdate,disabled:d,maxLength:262144,spellCheck:!1,onChange:T=>l(T.currentTarget.value)})]}):null,h&&a.jsx("p",{role:"alert",children:i(`agentTopology.${h}`)}),v&&a.jsxs("div",{role:"alert",children:[a.jsx("p",{children:i("agentTopology.discardDocument")}),a.jsx(Wi,{variant:"outline",onClick:()=>y(!1),children:i("agentTopology.keepEditing")}),a.jsx(Wi,{variant:"secondary",onClick:t,children:i("agentTopology.discardChanges")})]}),a.jsxs("footer",{children:[!r&&!c&&a.jsx(Wi,{variant:"outline",onClick:()=>b(T=>T+1),children:i("agentTopology.refresh")}),(r==null?void 0:r.canUpdate)&&a.jsx(Wi,{loading:d,disabled:c||o===r.content||!o.trim(),onClick:()=>void j(),children:i("agentTopology.saveDocument")})]})]})}),window.document.body)}function vC(e){return e.trimEnd().replace(/[。.]+$/,"")}function AIe({selected:e,onChange:t,cloudProvider:n="volcengine"}){const{t:i}=Te("create"),[r,s]=p.useState([]),[o,l]=p.useState([]),[c,u]=p.useState(""),[d,f]=p.useState(!0),[h,m]=p.useState(!1),[g,b]=p.useState(null);p.useEffect(()=>{let O=!1;return(async()=>{f(!0),b(null);try{const k=await OIe();O||(s(k),k.length>0&&u(k[0].id))}catch(k){O||b(k instanceof Error?k.message:i("skills.space.loadError"))}finally{O||f(!1)}})(),()=>{O=!0}},[i]),p.useEffect(()=>{if(!c){l([]);return}const O=r.find(S=>S.id===c);let k=!1;return(async()=>{m(!0),b(null);try{const S=await kIe(c,O==null?void 0:O.region);k||l(S)}catch(S){k||b(S instanceof Error?S.message:i("skills.space.loadError"))}finally{k||m(!1)}})(),()=>{k=!0}},[c,r,i]);const v=r.find(O=>O.id===c),y=v?Vpt(v.id,v.region,n):"",w=(O,k)=>e.some(S=>S.source==="skillspace"&&S.skillId===O&&(S.version||"")===k),x=O=>{if(!v)return;const k=_y(O);if(w(k,O.version))t(e.filter(S=>!(S.source==="skillspace"&&S.skillId===k&&(S.version||"")===O.version)));else{const S=zpt(v,O);t([...e,{source:"skillspace",folder:S.folder||O.skillName,name:S.name,description:S.description,skillSpaceId:S.skillSpaceId,skillSpaceName:S.skillSpaceName,skillSpaceRegion:S.skillSpaceRegion,skillId:S.skillId,version:S.version}])}};return a.jsx("div",{className:"cw-skillspace",children:d?a.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[a.jsx(Fi,{className:"cw-i cw-spin"})," ",i("skills.space.loadingSpaces")]}):g?a.jsxs("div",{className:"cw-banner",children:[a.jsx(pm,{className:"cw-i"}),a.jsx("span",{children:g})]}):r.length===0?a.jsx("p",{className:"cw-empty-line",children:i("skills.space.noSpaces")}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"cw-skillspace-header",children:[a.jsx("select",{className:"cw-input cw-skillspace-select",value:c,onChange:O=>u(O.target.value),"aria-label":i("skills.space.selectSpace"),children:r.map(O=>a.jsxs("option",{value:O.id,children:[Pc(O)||O.id,O.description?` — ${vC(O.description)}`:""]},O.id))}),v&&a.jsxs(a.Fragment,{children:[v.region&&a.jsx("span",{className:"cw-skillspace-region-label",title:v.region,children:wh(v.region,n)}),y&&a.jsx("a",{href:y,target:"_blank",rel:"noopener noreferrer",className:"cw-button cw-button-secondary cw-skillspace-console-link",title:i("skills.space.openConsole"),"aria-label":i("skills.space.openConsole"),children:a.jsx(p0,{className:"cw-i cw-i-sm"})})]})]}),h?a.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[a.jsx(Fi,{className:"cw-i cw-spin"})," ",i("skills.space.loadingSkills")]}):o.length===0?a.jsx("p",{className:"cw-empty-line",children:i("skills.space.noSkills")}):a.jsx("div",{className:"cw-skill-results",children:o.map(O=>{const k=_y(O),S=w(k,O.version);return a.jsxs("button",{type:"button",className:`cw-skill-result ${S?"is-on":""}`,onClick:()=>x(O),"aria-pressed":S,children:[a.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:S?a.jsx(Ef,{className:"cw-i cw-i-sm"}):a.jsx(ic,{className:"cw-i cw-i-sm"})}),a.jsxs("span",{className:"cw-skill-result-meta",children:[a.jsxs("span",{className:"cw-skill-result-name",children:[O.skillName,O.version&&a.jsxs("span",{className:"cw-skill-result-version",children:[" ","v",O.version]})]}),O.skillDescription&&a.jsx("span",{className:"cw-skill-result-desc",children:vC(O.skillDescription)}),a.jsxs("span",{className:"cw-skill-result-repo",children:[a.jsx(Tat,{className:"cw-i cw-i-sm"})," ",Pc(v)||c]})]})]},`${k}/${O.version}`)})})]})})}function iT(e,t){return e.map(n=>({...n,get label(){return Xt(`${t}.${n.id}.label`)},get desc(){return Xt(`${t}.${n.id}.description`)}}))}function fd(e,t){const n={...e};for(const[i,r]of Object.entries(t))Object.defineProperty(n,i,{configurable:!0,enumerable:!0,get:()=>Xt(r)});return n}const TIe="https://ark.cn-beijing.volces.com/api/v3/";fd({key:"MODEL_AGENT_NAME",required:!1,placeholder:"doubao-seed-1-6-250615"},{comment:"traditional.catalog.env.modelAgentName.comment"});const kN=[fd({key:"MODEL_EMBEDDING_NAME",required:!1,placeholder:"doubao-embedding-vision-250615"},{comment:"traditional.catalog.env.embeddingModelName.comment"}),{key:"MODEL_EMBEDDING_DIM",required:!1,placeholder:"2048"},{key:"MODEL_EMBEDDING_API_BASE",required:!1,placeholder:TIe}],gI=[],bI={get label(){return Xt("traditional.catalog.links.console")},url:"https://console.volcengine.com/vikingdb/openviking"},Gpt={get label(){return Xt("traditional.catalog.links.documentation")},url:"https://github.com/volcengine/OpenViking/blob/main/docs/zh/api/05-sessions.md"},_Ie="https://api.vikingdb.cn-beijing.volces.com/openviking",Xpt=`{ +`)},Sct=0,Dv=[];function Ect(e){var t=p.useRef([]),n=p.useRef([0,0]),i=p.useRef(),r=p.useState(Sct++)[0],s=p.useState(zNe)[0],o=p.useRef(e);p.useEffect(function(){o.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var b=qlt([e.lockRef.current],(e.shards||[]).map(xee),!0).filter(Boolean);return b.forEach(function(v){return v.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),b.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var l=p.useCallback(function(b,v){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!o.current.allowPinchZoom;var y=f_(b),w=n.current,x="deltaX"in b?b.deltaX:w[0]-y[0],O="deltaY"in b?b.deltaY:w[1]-y[1],k,S=b.target,C=Math.abs(x)>Math.abs(O)?"h":"v";if("touches"in b&&C==="h"&&S.type==="range")return!1;var E=window.getSelection(),j=E&&E.anchorNode,T=j?j===S||j.contains(S):!1;if(T)return!1;var R=yee(C,S);if(!R)return!0;if(R?k=C:(k=C==="v"?"h":"v",R=yee(C,S)),!R)return!1;if(!i.current&&"changedTouches"in b&&(x||O)&&(i.current=k),!k)return!0;var A=i.current||k;return wct(A,v,b,A==="h"?x:O)},[]),c=p.useCallback(function(b){var v=b;if(!(!Dv.length||Dv[Dv.length-1]!==s)){var y="deltaY"in v?vee(v):f_(v),w=t.current.filter(function(k){return k.name===v.type&&(k.target===v.target||v.target===k.shadowParent)&&Oct(k.delta,y)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var x=(o.current.shards||[]).map(xee).filter(Boolean).filter(function(k){return k.contains(v.target)}),O=x.length>0?l(v,x[0]):!o.current.noIsolation;O&&v.cancelable&&v.preventDefault()}}},[]),u=p.useCallback(function(b,v,y,w){var x={name:b,delta:v,target:y,should:w,shadowParent:Cct(y)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(O){return O!==x})},1)},[]),d=p.useCallback(function(b){n.current=f_(b),i.current=void 0},[]),f=p.useCallback(function(b){u(b.type,vee(b),b.target,l(b,e.lockRef.current))},[]),h=p.useCallback(function(b){u(b.type,f_(b),b.target,l(b,e.lockRef.current))},[]);p.useEffect(function(){return Dv.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Pv),document.addEventListener("touchmove",c,Pv),document.addEventListener("touchstart",d,Pv),function(){Dv=Dv.filter(function(b){return b!==s}),document.removeEventListener("wheel",c,Pv),document.removeEventListener("touchmove",c,Pv),document.removeEventListener("touchstart",d,Pv)}},[]);var m=e.removeScrollBar,g=e.inert;return p.createElement(p.Fragment,null,g?p.createElement(s,{styles:kct(r)}):null,m?p.createElement(pct,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Cct(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Act=tct(QNe,Ect);var PV=p.forwardRef(function(e,t){return p.createElement(sM,Jf({},e,{ref:t,sideCar:Act}))});PV.classNames=sM.classNames;var Tct=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Mv=new WeakMap,h_=new WeakMap,p_={},n4=0,WNe=function(e){return e&&(e.host||WNe(e.parentNode))},_ct=function(e,t){return t.map(function(n){if(e.contains(n))return n;var i=WNe(n);return i&&e.contains(i)?i:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},jct=function(e,t,n,i){var r=_ct(t,Array.isArray(e)?e:[e]);p_[n]||(p_[n]=new WeakMap);var s=p_[n],o=[],l=new Set,c=new Set(r),u=function(f){!f||l.has(f)||(l.add(f),u(f.parentNode))};r.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(h){if(l.has(h))d(h);else try{var m=h.getAttribute(i),g=m!==null&&m!=="false",b=(Mv.get(h)||0)+1,v=(s.get(h)||0)+1;Mv.set(h,b),s.set(h,v),o.push(h),b===1&&g&&h_.set(h,!0),v===1&&h.setAttribute(n,"true"),g||h.setAttribute(i,"true")}catch(y){console.error("aria-hidden: cannot operate on ",h,y)}})};return d(t),l.clear(),n4++,function(){o.forEach(function(f){var h=Mv.get(f)-1,m=s.get(f)-1;Mv.set(f,h),s.set(f,m),h||(h_.has(f)||f.removeAttribute(i),h_.delete(f)),m||f.removeAttribute(n)}),n4--,n4||(Mv=new WeakMap,Mv=new WeakMap,h_=new WeakMap,p_={})}},KNe=function(e,t,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),r=Tct(e);return r?(i.push.apply(i,Array.from(r.querySelectorAll("[aria-live], script"))),jct(i,r,n,"aria-hidden")):function(){return null}},Nct=Object.defineProperty,Rct=(e,t)=>Nct(e,"name",{value:t,configurable:!0});function YA(e){const[t,n]=p.useState(void 0);return Od(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const i=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const s=r[0];let o,l;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,l=u.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}else n(void 0)},[e]),t}Rct(YA,"useSize");var Ict=Object.defineProperty,Zp=(e,t)=>Ict(e,"name",{value:t,configurable:!0}),DV="Checkbox",[Pct,yhn]=qc(DV),[Dct,MV]=Pct(DV);function GNe(e){const{__scopeCheckbox:t,checked:n,children:i,defaultChecked:r,disabled:s,form:o,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=e,[h,m]=Rd({prop:n,defaultProp:r??!1,onChange:c,caller:DV}),[g,b]=p.useState(null),[v,y]=p.useState(null),w=p.useRef(!1),[x,O]=p.useReducer(C=>C+1,0),k=g?!!o||!!g.closest("form"):!0,S={checked:h,disabled:s,setChecked:m,control:g,setControl:b,name:l,form:o,value:d,hasConsumerStoppedPropagationRef:w,userInteractionCount:x,onUserInteraction:O,required:u,defaultChecked:Lp(r)?!1:r,isFormControl:k,bubbleInput:v,setBubbleInput:y};return a.jsx(Dct,{scope:t,...S,children:XNe(f)?f(S):i})}Zp(GNe,"CheckboxProvider");var Mct="CheckboxTrigger",Lct=p.forwardRef(Zp(function({__scopeCheckbox:t,onKeyDown:n,onClick:i,...r},s){const{control:o,value:l,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,onUserInteraction:g,isFormControl:b,bubbleInput:v}=MV(Mct,t),y=_r(s,f),w=p.useRef(u);return p.useEffect(()=>{const x=o==null?void 0:o.form;if(x){const O=Zp(()=>h(w.current),"reset");return x.addEventListener("reset",O),()=>x.removeEventListener("reset",O)}},[o,h]),a.jsx(Xr.button,{type:"button",role:"checkbox","aria-checked":Lp(u)?"mixed":u,"aria-required":d,"data-state":LV(u),"data-disabled":c?"":void 0,disabled:c,value:l,...r,ref:y,onKeyDown:Qn(n,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:Qn(i,x=>{g(),h(O=>Lp(O)?!0:!O),v&&b&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})})},"CheckboxTrigger")),$ct=p.forwardRef(Zp(function(t,n){const{__scopeCheckbox:i,name:r,checked:s,defaultChecked:o,required:l,disabled:c,value:u,onCheckedChange:d,form:f,...h}=t;return a.jsx(GNe,{__scopeCheckbox:i,checked:s,defaultChecked:o,disabled:c,required:l,onCheckedChange:d,name:r,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>a.jsxs(a.Fragment,{children:[a.jsx(Lct,{...h,ref:n,__scopeCheckbox:i}),m&&a.jsx(Qct,{__scopeCheckbox:i})]})})},"Checkbox")),Fct="CheckboxIndicator",Bct=p.forwardRef(Zp(function(t,n){const{__scopeCheckbox:i,forceMount:r,...s}=t,o=MV(Fct,i);return a.jsx(jh,{present:r||Lp(o.checked)||o.checked===!0,children:a.jsx(Xr.span,{"data-state":LV(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:n,style:{pointerEvents:"none",...t.style}})})},"CheckboxIndicator")),Uct="CheckboxBubbleInput",Qct=p.forwardRef(Zp(function({__scopeCheckbox:t,onClick:n,...i},r){const{control:s,hasConsumerStoppedPropagationRef:o,userInteractionCount:l,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:m,form:g,bubbleInput:b,setBubbleInput:v}=MV(Uct,t),y=_r(r,v),w=YA(s),x=p.useRef(!1),O=p.useRef(c),k=p.useRef(l);p.useEffect(()=>{const C=b;if(!C)return;const E=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(E,"checked").set,R=l!==k.current;k.current=l;const A=O.current!==c;O.current=c;const N=!(R&&o.current);if(A&&T){x.current=!R;const D=new Event("click",{bubbles:N});C.indeterminate=Lp(c),T.call(C,Lp(c)?!1:c),C.dispatchEvent(D),x.current=!1}},[b,c,o,l]);const S=p.useRef(Lp(c)?!1:c);return a.jsx(Xr.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??S.current,required:d,disabled:f,name:h,value:m,form:g,...i,tabIndex:-1,ref:y,onClick:Qn(n,C=>{x.current&&C.stopPropagation()}),style:{...i.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function XNe(e){return typeof e=="function"}Zp(XNe,"isFunction");function Lp(e){return e==="indeterminate"}Zp(Lp,"isIndeterminate");function LV(e){return Lp(e)?"indeterminate":e?"checked":"unchecked"}Zp(LV,"getState");var zct=Object.defineProperty,Dg=(e,t)=>zct(e,"name",{value:t,configurable:!0}),YNe="Popper",[ZNe,K1]=qc(YNe),[Vct,JNe]=ZNe(YNe),Hct=Dg(e=>{const{__scopePopper:t,children:n}=e,[i,r]=p.useState(null),[s,o]=p.useState(void 0);return a.jsx(Vct,{scope:t,anchor:i,onAnchorChange:r,placementState:s,setPlacementState:o,children:n})},"Popper"),qct="PopperAnchor",Wct=p.forwardRef(Dg(function(t,n){const{__scopePopper:i,virtualRef:r,...s}=t,o=JNe(qct,i),l=p.useRef(null),c=o.onAnchorChange,u=p.useCallback(b=>{l.current=b,b&&c(b)},[c]),d=_r(n,u),f=p.useRef(null);p.useEffect(()=>{if(!r)return;const b=f.current;f.current=r.current,b!==f.current&&c(f.current)});const h=o.placementState&&aM(o.placementState),m=h==null?void 0:h[0],g=h==null?void 0:h[1];return r?null:a.jsx(Xr.div,{"data-radix-popper-side":m,"data-radix-popper-align":g,...s,ref:d})},"PopperAnchor")),eRe="PopperContent",[Kct,vhn]=ZNe(eRe),Gct=p.forwardRef(Dg(function(t,n){var X,H,ae,Y,K,ie,J;const{__scopePopper:i,side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:b,...v}=t,y=JNe(eRe,i),[w,x]=p.useState(null),O=_r(n,x),[k,S]=p.useState(null),C=YA(k),E=(C==null?void 0:C.width)??0,j=(C==null?void 0:C.height)??0,T=r+(o!=="center"?"-"+o:""),R=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},A=Array.isArray(d)?d:[d],N=A.length>0,D={padding:R,boundary:A.filter(tRe),altBoundary:N},{refs:I,floatingStyles:P,placement:_,isPositioned:L,middlewareData:F}=X_e({strategy:"fixed",placement:T,whileElementsMounted:Dg((...ye)=>oB(...ye,{animationFrame:g==="always"}),"whileElementsMounted"),elements:{reference:y.anchor},middleware:[Y_e({mainAxis:s+j,alignmentAxis:l}),u&&Z_e({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?J_e():void 0,...D}),u&&eje({...D}),tje({...D,apply:Dg(({elements:ye,rects:de,availableWidth:ge,availableHeight:Ee})=>{const{width:xe,height:Ne}=de.reference,We=ye.floating.style;We.setProperty("--radix-popper-available-width",`${ge}px`),We.setProperty("--radix-popper-available-height",`${Ee}px`),We.setProperty("--radix-popper-anchor-width",`${xe}px`),We.setProperty("--radix-popper-anchor-height",`${Ne}px`)},"apply")}),k&&ist({element:k,padding:c}),Xct({arrowWidth:E,arrowHeight:j}),m&&nst({strategy:"referenceHidden",...D,boundary:N?D.boundary:void 0})]}),M=y.setPlacementState;Od(()=>(M(_),()=>{M(void 0)}),[_,M]);const[V,q]=aM(_),U=wf(b);Od(()=>{L&&(U==null||U())},[L,U]);const Z=(X=F.arrow)==null?void 0:X.x,z=(H=F.arrow)==null?void 0:H.y,ee=((ae=F.arrow)==null?void 0:ae.centerOffset)!==0,[ne,W]=p.useState();return Od(()=>{w&&W(window.getComputedStyle(w).zIndex)},[w]),a.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...P,transform:L?P.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ne,"--radix-popper-transform-origin":[(Y=F.transformOrigin)==null?void 0:Y.x,(K=F.transformOrigin)==null?void 0:K.y].join(" "),...((ie=F.hide)==null?void 0:ie.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:a.jsx(Kct,{scope:i,placedSide:V,placedAlign:q,onArrowChange:S,arrowX:Z,arrowY:z,shouldHideArrow:ee,children:a.jsx(Xr.div,{"data-side":V,"data-align":q,...v,ref:O,style:{...v.style,animation:L?(J=v.style)==null?void 0:J.animation:"none"}})})})},"PopperContent"));function tRe(e){return e!==null}Dg(tRe,"isNotNull");var Xct=Dg(e=>({name:"transformOrigin",options:e,fn(t){var v,y,w;const{placement:n,rects:i,middlewareData:r}=t,o=((v=r.arrow)==null?void 0:v.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[u,d]=aM(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(((y=r.arrow)==null?void 0:y.x)??0)+l/2,m=(((w=r.arrow)==null?void 0:w.y)??0)+c/2;let g="",b="";return u==="bottom"?(g=o?f:`${h}px`,b=`${-c}px`):u==="top"?(g=o?f:`${h}px`,b=`${i.floating.height+c}px`):u==="right"?(g=`${-c}px`,b=o?f:`${m}px`):u==="left"&&(g=`${i.floating.width+c}px`,b=o?f:`${m}px`),{data:{x:g,y:b}}}}),"transformOrigin");function aM(e){const[t,n="center"]=e.split("-");return[t,n]}Dg(aM,"getSideAndAlignFromPlacement");var oM=Hct,$V=Wct,FV=Gct,Yct=Object.defineProperty,BV=(e,t)=>Yct(e,"name",{value:t,configurable:!0}),i4=!1;function nRe(){const[e,t]=p.useState(i4);return p.useEffect(()=>{i4||(i4=!0,t(!0))},[]),e}BV(nRe,"useIsHydrated");var iRe=P0[" useSyncExternalStore ".trim().toString()];function rRe(){return()=>{}}BV(rRe,"subscribe");function sRe(){return iRe(rRe,()=>!0,()=>!1)}BV(sRe,"useIsHydratedModern");var Zct=typeof iRe=="function"?sRe:nRe,Jct=Object.defineProperty,H0=(e,t)=>Jct(e,"name",{value:t,configurable:!0}),r4="rovingFocusGroup.onEntryFocus",eut={bubbles:!1,cancelable:!0},lM="RovingFocusGroup",[SB,aRe,tut]=AV(lM),[nut,G1]=qc(lM,[tut]),[iut,rut]=nut(lM),sut=p.forwardRef(H0(function(t,n){return a.jsx(SB.Provider,{scope:t.__scopeRovingFocusGroup,children:a.jsx(SB.Slot,{scope:t.__scopeRovingFocusGroup,children:a.jsx(aut,{...t,ref:n})})})},"RovingFocusGroup")),aut=p.forwardRef(H0(function(t,n){const{__scopeRovingFocusGroup:i,orientation:r,loop:s=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...h}=t,m=p.useRef(null),g=_r(n,m),b=XA(o),[v,y]=Rd({prop:l,defaultProp:c??null,onChange:u,caller:lM}),[w,x]=p.useState(!1),O=wf(d),k=aRe(i),S=p.useRef(!1),[C,E]=p.useState(0);return p.useEffect(()=>{const j=m.current;if(j)return j.addEventListener(r4,O),()=>j.removeEventListener(r4,O)},[O]),a.jsx(iut,{scope:i,orientation:r,dir:b,loop:s,currentTabStopId:v,onItemFocus:p.useCallback(j=>y(j),[y]),onItemShiftTab:p.useCallback(()=>x(!0),[]),onFocusableItemAdd:p.useCallback(()=>E(j=>j+1),[]),onFocusableItemRemove:p.useCallback(()=>E(j=>j-1),[]),children:a.jsx(Xr.div,{tabIndex:w||C===0?-1:0,"data-orientation":r,...h,ref:g,style:{outline:"none",...t.style},onMouseDown:Qn(t.onMouseDown,()=>{S.current=!0}),onFocus:Qn(t.onFocus,j=>{const T=!S.current;if(j.target===j.currentTarget&&T&&!w){const R=new CustomEvent(r4,eut);if(j.currentTarget.dispatchEvent(R),!R.defaultPrevented){const A=k().filter(_=>_.focusable),N=A.find(_=>_.active),D=A.find(_=>_.id===v),P=[N,D,...A].filter(Boolean).map(_=>_.ref.current);UV(P,f)}}S.current=!1}),onBlur:Qn(t.onBlur,()=>x(!1))})})},"RovingFocusGroupImpl")),out="RovingFocusGroupItem",lut=p.forwardRef(H0(function(t,n){const{__scopeRovingFocusGroup:i,focusable:r=!0,active:s=!1,tabStopId:o,children:l,...c}=t,u=nb(),d=o||u,f=rut(out,i),h=f.currentTabStopId===d,m=aRe(i),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:v}=f,y=Zct();return Od(()=>{if(!(!y||!r))return g(),()=>b()},[y,r,g,b]),p.useEffect(()=>{if(!(y||!r))return g(),()=>b()},[y,r,g,b]),a.jsx(SB.ItemSlot,{scope:i,id:d,focusable:r,active:s,children:a.jsx(Xr.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...c,ref:n,onMouseDown:Qn(t.onMouseDown,w=>{r?f.onItemFocus(d):w.preventDefault()}),onFocus:Qn(t.onFocus,()=>f.onItemFocus(d)),onKeyDown:Qn(t.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){f.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const x=lRe(w,f.orientation,f.dir);if(x!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let k=m().filter(S=>S.focusable).map(S=>S.ref.current);if(x==="last")k.reverse();else if(x==="prev"||x==="next"){x==="prev"&&k.reverse();const S=k.indexOf(w.currentTarget);k=f.loop?cRe(k,S+1):k.slice(S+1)}setTimeout(()=>UV(k))}}),children:typeof l=="function"?l({isCurrentTabStop:h,hasTabStop:v!=null}):l})})},"RovingFocusGroupItem")),cut={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function oRe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}H0(oRe,"getDirectionAwareKey");function lRe(e,t,n){const i=oRe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return cut[i]}H0(lRe,"getFocusIntent");function UV(e,t=!1){const n=document.activeElement;for(const i of e)if(i===n||(i.focus({preventScroll:t}),document.activeElement!==n))return}H0(UV,"focusFirst");function cRe(e,t){return e.map((n,i)=>e[(t+i)%e.length])}H0(cRe,"wrapArray");var QV=sut,zV=lut,uut=Object.defineProperty,fr=(e,t)=>uut(e,"name",{value:t,configurable:!0}),EB=["Enter"," "],dut=["ArrowDown","PageUp","Home"],uRe=["ArrowUp","PageDown","End"],fut=[...dut,...uRe],hut={ltr:[...EB,"ArrowRight"],rtl:[...EB,"ArrowLeft"]},put={ltr:["ArrowLeft"],rtl:["ArrowRight"]},cM="Menu",[gC,mut,gut]=AV(cM),[q0,dRe]=qc(cM,[gut,K1,G1]),uM=K1(),fRe=G1(),[hRe,Cb]=q0(cM),[but,ZA]=q0(cM),yut=fr(e=>{const{__scopeMenu:t,open:n=!1,children:i,dir:r,onOpenChange:s,modal:o=!0}=e,l=uM(t),[c,u]=p.useState(null),d=p.useRef(!1),f=wf(s),h=XA(r);return p.useEffect(()=>{const m=fr(()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},"handleKeyDown"),g=fr(()=>d.current=!1,"handlePointer");return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),p.useEffect(()=>{if(!n)return;const m=fr(()=>f(!1),"handleBlur");return window.addEventListener("blur",m),()=>window.removeEventListener("blur",m)},[n,f]),a.jsx(oM,{...l,children:a.jsx(hRe,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:u,children:a.jsx(but,{scope:t,onClose:p.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:o,children:i})})})},"Menu"),pRe=p.forwardRef(fr(function(t,n){const{__scopeMenu:i,...r}=t,s=uM(i);return a.jsx($V,{...s,...r,ref:n})},"MenuAnchor")),mRe="MenuPortal",[vut,gRe]=q0(mRe,{forceMount:void 0}),xut=fr(e=>{const{__scopeMenu:t,forceMount:n,children:i,container:r}=e,s=Cb(mRe,t);return a.jsx(vut,{scope:t,forceMount:n,children:a.jsx(jh,{present:n||s.open,children:a.jsx(RV,{asChild:!0,container:r,children:i})})})},"MenuPortal"),pf="MenuContent",[wut,VV]=q0(pf),Out=p.forwardRef(fr(function(t,n){const i=gRe(pf,t.__scopeMenu),{forceMount:r=i.forceMount,...s}=t,o=Cb(pf,t.__scopeMenu),l=ZA(pf,t.__scopeMenu);return a.jsx(gC.Provider,{scope:t.__scopeMenu,children:a.jsx(jh,{present:r||o.open,children:a.jsx(gC.Slot,{scope:t.__scopeMenu,children:l.modal?a.jsx(kut,{...s,ref:n}):a.jsx(Sut,{...s,ref:n})})})})},"MenuContent")),kut=p.forwardRef(fr(function(t,n){const i=Cb(pf,t.__scopeMenu),r=p.useRef(null),s=_r(n,r);return p.useEffect(()=>{const o=r.current;if(o)return KNe(o)},[]),a.jsx(HV,{...t,ref:s,trapFocus:i.open,disableOutsidePointerEvents:i.open,disableOutsideScroll:!0,onFocusOutside:Qn(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentModal")),Sut=p.forwardRef(fr(function(t,n){const i=Cb(pf,t.__scopeMenu);return a.jsx(HV,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentNonModal")),Eut=Xp("MenuContent.ScrollLock"),HV=p.forwardRef(fr(function(t,n){const{__scopeMenu:i,loop:r=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,disableOutsideScroll:b,...v}=t,y=Cb(pf,i),w=ZA(pf,i),x=uM(i),O=fRe(i),k=mut(i),[S,C]=p.useState(null),E=p.useRef(null),j=_r(n,E,y.onContentChange),T=p.useRef(0),R=p.useRef(""),A=p.useRef(0),N=p.useRef(null),D=p.useRef("right"),I=p.useRef(0),P=b?PV:p.Fragment,_=b?{as:Eut,allowPinchZoom:!0}:void 0,L=fr(M=>{var W,X;const V=R.current+M,q=k().filter(H=>!H.disabled),U=document.activeElement,Z=(W=q.find(H=>H.ref.current===U))==null?void 0:W.textValue,z=q.map(H=>H.textValue),ee=SRe(z,V,Z),ne=(X=q.find(H=>H.textValue===ee))==null?void 0:X.ref.current;fr(function H(ae){R.current=ae,window.clearTimeout(T.current),ae!==""&&(T.current=window.setTimeout(()=>H(""),1e3))},"updateSearch")(V),ne&&setTimeout(()=>ne.focus())},"handleTypeaheadSearch");p.useEffect(()=>()=>window.clearTimeout(T.current),[]),rM();const F=p.useCallback(M=>{var q,U;return D.current===((q=N.current)==null?void 0:q.side)&&CRe(M,(U=N.current)==null?void 0:U.area)},[]);return a.jsx(wut,{scope:i,searchRef:R,onItemEnter:p.useCallback(M=>{F(M)&&M.preventDefault()},[F]),onItemLeave:p.useCallback(M=>{var V;F(M)||((V=E.current)==null||V.focus(),C(null))},[F]),onTriggerLeave:p.useCallback(M=>{F(M)&&M.preventDefault()},[F]),pointerGraceTimerRef:A,onPointerGraceIntentChange:p.useCallback(M=>{N.current=M},[]),children:a.jsx(P,{..._,children:a.jsx(INe,{asChild:!0,trapped:s,onMountAutoFocus:Qn(o,M=>{var V;M.preventDefault(),(V=E.current)==null||V.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:a.jsx(_V,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,children:a.jsx(QV,{asChild:!0,...O,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:Qn(u,M=>{w.isUsingKeyboardRef.current||M.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx(FV,{role:"menu","aria-orientation":"vertical","data-state":WV(y.open),"data-radix-menu-content":"",dir:w.dir,...x,...v,ref:j,style:{outline:"none",...v.style},onKeyDown:Qn(v.onKeyDown,M=>{const q=M.target.closest("[data-radix-menu-content]")===M.currentTarget,U=M.ctrlKey||M.altKey||M.metaKey,Z=M.key.length===1;q&&(M.key==="Tab"&&M.preventDefault(),!U&&Z&&L(M.key));const z=E.current;if(M.target!==z||!fut.includes(M.key))return;M.preventDefault();const ne=k().filter(W=>!W.disabled).map(W=>W.ref.current);uRe.includes(M.key)&&ne.reverse(),ORe(ne)}),onBlur:Qn(t.onBlur,M=>{M.currentTarget.contains(M.target)||(window.clearTimeout(T.current),R.current="")}),onPointerMove:Qn(t.onPointerMove,Jw(M=>{const V=M.target,q=I.current!==M.clientX;if(M.currentTarget.contains(V)&&q){const U=M.clientX>I.current?"right":"left";D.current=U,I.current=M.clientX}}))})})})})})})},"MenuContentImpl")),Cut=p.forwardRef(fr(function(t,n){const{__scopeMenu:i,...r}=t;return a.jsx(Xr.div,{role:"group",...r,ref:n})},"MenuGroup")),CB="MenuItem",wee="menu.itemSelect",qV=p.forwardRef(fr(function(t,n){const{disabled:i=!1,onSelect:r,...s}=t,o=p.useRef(null),l=ZA(CB,t.__scopeMenu),c=VV(CB,t.__scopeMenu),u=_r(n,o),d=p.useRef(!1),f=fr(()=>{const h=o.current;if(!i&&h){const m=new CustomEvent(wee,{bubbles:!0,cancelable:!0});h.addEventListener(wee,g=>r==null?void 0:r(g),{once:!0}),CV(h,m),m.defaultPrevented?d.current=!1:l.onClose()}},"handleSelect");return a.jsx(bRe,{...s,ref:u,disabled:i,onClick:Qn(t.onClick,f),onPointerDown:h=>{var m;(m=t.onPointerDown)==null||m.call(t,h),d.current=!0},onPointerUp:Qn(t.onPointerUp,h=>{var m;d.current||(m=h.currentTarget)==null||m.click()}),onKeyDown:Qn(t.onKeyDown,h=>{i||h.target!==h.currentTarget||c.searchRef.current!==""&&h.key===" "||EB.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})},"MenuItem")),bRe=p.forwardRef(fr(function(t,n){const{__scopeMenu:i,disabled:r=!1,textValue:s,...o}=t,l=VV(CB,i),c=fRe(i),u=p.useRef(null),d=_r(n,u),[f,h]=p.useState(!1),[m,g]=p.useState("");return p.useEffect(()=>{const b=u.current;b&&g((b.textContent??"").trim())},[o.children]),a.jsx(gC.ItemSlot,{scope:i,disabled:r,textValue:s??m,children:a.jsx(zV,{asChild:!0,...c,focusable:!r,children:a.jsx(Xr.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:d,onPointerMove:Qn(t.onPointerMove,Jw(b=>{r?l.onItemLeave(b):(l.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Qn(t.onPointerLeave,Jw(b=>l.onItemLeave(b))),onFocus:Qn(t.onFocus,()=>h(!0)),onBlur:Qn(t.onBlur,()=>h(!1))})})})},"MenuItemImpl")),Aut=p.forwardRef(fr(function(t,n){const{checked:i=!1,onCheckedChange:r,...s}=t;return a.jsx(vRe,{scope:t.__scopeMenu,checked:i,children:a.jsx(qV,{role:"menuitemcheckbox","aria-checked":bC(i)?"mixed":i,...s,ref:n,"data-state":dM(i),onSelect:Qn(s.onSelect,()=>r==null?void 0:r(bC(i)?!0:!i),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),Tut="MenuRadioGroup",[_ut,jut]=q0(Tut,{value:void 0,onValueChange:fr(()=>{},"onValueChange")}),Nut=p.forwardRef(fr(function(t,n){const{value:i,onValueChange:r,...s}=t,o=wf(r);return a.jsx(_ut,{scope:t.__scopeMenu,value:i,onValueChange:o,children:a.jsx(Cut,{...s,ref:n})})},"MenuRadioGroup")),Rut="MenuRadioItem",Iut=p.forwardRef(fr(function(t,n){const{value:i,...r}=t,s=jut(Rut,t.__scopeMenu),o=i===s.value;return a.jsx(vRe,{scope:t.__scopeMenu,checked:o,children:a.jsx(qV,{role:"menuitemradio","aria-checked":o,...r,ref:n,"data-state":dM(o),onSelect:Qn(r.onSelect,()=>{var l;return(l=s.onValueChange)==null?void 0:l.call(s,i)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),yRe="MenuItemIndicator",[vRe,Put]=q0(yRe,{checked:!1}),Dut=p.forwardRef(fr(function(t,n){const{__scopeMenu:i,forceMount:r,...s}=t,o=Put(yRe,i);return a.jsx(jh,{present:r||bC(o.checked)||o.checked===!0,children:a.jsx(Xr.span,{...s,ref:n,"data-state":dM(o.checked)})})},"MenuItemIndicator")),Mut=p.forwardRef(fr(function(t,n){const{__scopeMenu:i,...r}=t;return a.jsx(Xr.div,{role:"separator","aria-orientation":"horizontal",...r,ref:n})},"MenuSeparator")),xRe="MenuSub",[Lut,wRe]=q0(xRe),$ut=fr(e=>{const{__scopeMenu:t,children:n,open:i=!1,onOpenChange:r}=e,s=Cb(xRe,t),o=uM(t),[l,c]=p.useState(null),[u,d]=p.useState(null),f=wf(r);return p.useEffect(()=>(s.open===!1&&f(!1),()=>f(!1)),[s.open,f]),a.jsx(oM,{...o,children:a.jsx(hRe,{scope:t,open:i,onOpenChange:f,content:u,onContentChange:d,children:a.jsx(Lut,{scope:t,contentId:nb(),triggerId:nb(),trigger:l,onTriggerChange:c,children:n})})})},"MenuSub"),m_="MenuSubTrigger",Fut=p.forwardRef(fr(function(t,n){const i=Cb(m_,t.__scopeMenu),r=ZA(m_,t.__scopeMenu),s=wRe(m_,t.__scopeMenu),o=VV(m_,t.__scopeMenu),l=p.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=o,d={__scopeMenu:t.__scopeMenu},f=p.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);p.useEffect(()=>f,[f]),p.useEffect(()=>{const m=c.current;return()=>{window.clearTimeout(m),u(null)}},[c,u]);const h=_r(n,s.onTriggerChange);return a.jsx(pRe,{asChild:!0,...d,children:a.jsx(bRe,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?s.contentId:void 0,"data-state":WV(i.open),...t,ref:h,onClick:m=>{var g;(g=t.onClick)==null||g.call(t,m),!(t.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),i.open||i.onOpenChange(!0))},onPointerMove:Qn(t.onPointerMove,Jw(m=>{o.onItemEnter(m),!m.defaultPrevented&&!t.disabled&&!i.open&&!l.current&&(o.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{i.onOpenChange(!0),f()},100))})),onPointerLeave:Qn(t.onPointerLeave,Jw(m=>{var b,v;f();const g=(b=i.content)==null?void 0:b.getBoundingClientRect();if(g){const y=(v=i.content)==null?void 0:v.dataset.side,w=y==="right",x=w?-5:5,O=g[w?"left":"right"],k=g[w?"right":"left"];o.onPointerGraceIntentChange({area:[{x:m.clientX+x,y:m.clientY},{x:O,y:g.top},{x:k,y:g.top},{x:k,y:g.bottom},{x:O,y:g.bottom}],side:y}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(m),m.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Qn(t.onKeyDown,m=>{var b;t.disabled||m.target!==m.currentTarget||o.searchRef.current!==""&&m.key===" "||hut[r.dir].includes(m.key)&&(i.onOpenChange(!0),(b=i.content)==null||b.focus(),m.preventDefault())})})})},"MenuSubTrigger")),But="MenuSubContent",Uut=p.forwardRef(fr(function(t,n){const i=gRe(pf,t.__scopeMenu),{forceMount:r=i.forceMount,align:s="start",...o}=t,l=Cb(pf,t.__scopeMenu),c=ZA(pf,t.__scopeMenu),u=wRe(But,t.__scopeMenu),d=p.useRef(null),f=_r(n,d);return a.jsx(gC.Provider,{scope:t.__scopeMenu,children:a.jsx(jh,{present:r||l.open,children:a.jsx(gC.Slot,{scope:t.__scopeMenu,children:a.jsx(HV,{id:u.contentId,"aria-labelledby":u.triggerId,...o,ref:f,align:s,side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{var m;c.isUsingKeyboardRef.current&&((m=d.current)==null||m.focus()),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:Qn(t.onFocusOutside,h=>{h.target!==u.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:Qn(t.onEscapeKeyDown,h=>{c.onClose(),h.preventDefault()}),onKeyDown:Qn(t.onKeyDown,h=>{var b;const m=h.currentTarget.contains(h.target),g=put[c.dir].includes(h.key);m&&g&&(l.onOpenChange(!1),(b=u.trigger)==null||b.focus(),h.preventDefault())})})})})})},"MenuSubContent"));function WV(e){return e?"open":"closed"}fr(WV,"getOpenState");function bC(e){return e==="indeterminate"}fr(bC,"isIndeterminate");function dM(e){return bC(e)?"indeterminate":e?"checked":"unchecked"}fr(dM,"getCheckedState");function ORe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}fr(ORe,"focusFirst");function kRe(e,t){return e.map((n,i)=>e[(t+i)%e.length])}fr(kRe,"wrapArray");function SRe(e,t,n){const r=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let o=kRe(e,Math.max(s,0));r.length===1&&(o=o.filter(u=>u!==n));const c=o.find(u=>u.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}fr(SRe,"getNextMatch");function ERe(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,o=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}fr(ERe,"isPointInPolygon");function CRe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return ERe(n,t)}fr(CRe,"isPointerInGraceArea");function Jw(e){return t=>t.pointerType==="mouse"?e(t):void 0}fr(Jw,"whenMouse");var Qut=yut,zut=pRe,Vut=xut,Hut=Out,qut=qV,Wut=Aut,Kut=Nut,Gut=Iut,Xut=Dut,Yut=Mut,Zut=$ut,Jut=Fut,edt=Uut,tdt=Object.defineProperty,Bu=(e,t)=>tdt(e,"name",{value:t,configurable:!0}),KV="DropdownMenu",[ndt,xhn]=qc(KV,[dRe]),Uu=dRe(),[idt,ARe]=ndt(KV),rdt=Bu(e=>{const{__scopeDropdownMenu:t,children:n,dir:i,open:r,defaultOpen:s,onOpenChange:o,modal:l=!0}=e,c=Uu(t),u=p.useRef(null),[d,f]=Rd({prop:r,defaultProp:s??!1,onChange:o,caller:KV});return a.jsx(idt,{scope:t,triggerId:nb(),triggerRef:u,contentId:nb(),open:d,onOpenChange:f,onOpenToggle:p.useCallback(()=>f(h=>!h),[f]),modal:l,children:a.jsx(Qut,{...c,open:d,onOpenChange:f,dir:i,modal:l,children:n})})},"DropdownMenu"),sdt="DropdownMenuTrigger",adt=p.forwardRef(Bu(function(t,n){const{__scopeDropdownMenu:i,disabled:r=!1,...s}=t,o=ARe(sdt,i),l=Uu(i),c=_r(n,o.triggerRef);return a.jsx(zut,{asChild:!0,...l,children:a.jsx(Xr.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:c,onPointerDown:Qn(t.onPointerDown,u=>{!r&&u.button===0&&u.ctrlKey===!1&&(o.onOpenToggle(),o.open||u.preventDefault())}),onKeyDown:Qn(t.onKeyDown,u=>{r||(["Enter"," "].includes(u.key)&&o.onOpenToggle(),u.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})},"DropdownMenuTrigger")),odt=Bu(e=>{const{__scopeDropdownMenu:t,...n}=e,i=Uu(t);return a.jsx(Vut,{...i,...n})},"DropdownMenuPortal"),ldt="DropdownMenuContent",cdt=p.forwardRef(Bu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=ARe(ldt,i),o=Uu(i),l=p.useRef(!1);return a.jsx(Hut,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...r,ref:n,onCloseAutoFocus:Qn(t.onCloseAutoFocus,c=>{var u;l.current||(u=s.triggerRef.current)==null||u.focus(),l.current=!1,c.preventDefault()}),onInteractOutside:Qn(t.onInteractOutside,c=>{const u=c.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;(!s.modal||f)&&(l.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),udt=p.forwardRef(Bu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Uu(i);return a.jsx(qut,{...s,...r,ref:n})},"DropdownMenuItem")),ddt=p.forwardRef(Bu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Uu(i);return a.jsx(Wut,{...s,...r,ref:n})},"DropdownMenuCheckboxItem")),fdt=p.forwardRef(Bu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Uu(i);return a.jsx(Kut,{...s,...r,ref:n})},"DropdownMenuRadioGroup")),hdt=p.forwardRef(Bu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Uu(i);return a.jsx(Gut,{...s,...r,ref:n})},"DropdownMenuRadioItem")),pdt=p.forwardRef(Bu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Uu(i);return a.jsx(Xut,{...s,...r,ref:n})},"DropdownMenuItemIndicator")),mdt=p.forwardRef(Bu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Uu(i);return a.jsx(Yut,{...s,...r,ref:n})},"DropdownMenuSeparator")),gdt=Bu(e=>{const{__scopeDropdownMenu:t,children:n,open:i,onOpenChange:r,defaultOpen:s}=e,o=Uu(t),[l,c]=Rd({prop:i,defaultProp:s??!1,onChange:r,caller:"DropdownMenuSub"});return a.jsx(Zut,{...o,open:l,onOpenChange:c,children:n})},"DropdownMenuSub"),bdt=p.forwardRef(Bu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Uu(i);return a.jsx(Jut,{...s,...r,ref:n})},"DropdownMenuSubTrigger")),ydt=p.forwardRef(Bu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=Uu(i);return a.jsx(edt,{...s,...r,ref:n,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuSubContent")),vdt=rdt,xdt=adt,TRe=odt,wdt=cdt,_Re=udt,Odt=ddt,kdt=fdt,Sdt=hdt,jRe=pdt,Edt=mdt,Cdt=gdt,Adt=bdt,Tdt=ydt,_dt=Object.defineProperty,Ab=(e,t)=>_dt(e,"name",{value:t,configurable:!0}),GV="Popover",[NRe,whn]=qc(GV,[K1]),XV=K1(),[jdt,X1]=NRe(GV),Ndt=Ab(e=>{const{__scopePopover:t,children:n,open:i,defaultOpen:r,onOpenChange:s,modal:o=!1}=e,l=XV(t),c=p.useRef(null),[u,d]=p.useState(!1),[f,h]=Rd({prop:i,defaultProp:r??!1,onChange:s,caller:GV});return a.jsx(oM,{...l,children:a.jsx(jdt,{scope:t,contentId:nb(),triggerRef:c,open:f,onOpenChange:h,onOpenToggle:p.useCallback(()=>h(m=>!m),[h]),hasCustomAnchor:u,onCustomAnchorAdd:p.useCallback(()=>d(!0),[]),onCustomAnchorRemove:p.useCallback(()=>d(!1),[]),modal:o,children:n})})},"Popover"),Rdt="PopoverTrigger",Idt=p.forwardRef(Ab(function(t,n){const{__scopePopover:i,...r}=t,s=X1(Rdt,i),o=XV(i),l=_r(n,s.triggerRef),c=a.jsx(Xr.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":YV(s.open),...r,ref:l,onClick:Qn(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:a.jsx($V,{asChild:!0,...o,children:c})},"PopoverTrigger")),RRe="PopoverPortal",[Pdt,Ddt]=NRe(RRe,{forceMount:void 0}),Mdt=Ab(e=>{const{__scopePopover:t,forceMount:n,children:i,container:r}=e,s=X1(RRe,t);return a.jsx(Pdt,{scope:t,forceMount:n,children:a.jsx(jh,{present:n||s.open,children:a.jsx(RV,{asChild:!0,container:r,children:i})})})},"PopoverPortal"),yC="PopoverContent",Ldt=p.forwardRef(Ab(function(t,n){const i=Ddt(yC,t.__scopePopover),{forceMount:r=i.forceMount,...s}=t,o=X1(yC,t.__scopePopover);return a.jsx(jh,{present:r||o.open,children:o.modal?a.jsx(Fdt,{...s,ref:n}):a.jsx(Bdt,{...s,ref:n})})},"PopoverContent")),$dt=Xp("PopoverContent.RemoveScroll"),Fdt=p.forwardRef(Ab(function(t,n){const i=X1(yC,t.__scopePopover),r=p.useRef(null),s=_r(n,r),o=p.useRef(!1);return p.useEffect(()=>{const l=r.current;if(l)return KNe(l)},[]),a.jsx(PV,{as:$dt,allowPinchZoom:!0,children:a.jsx(IRe,{...t,ref:s,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Qn(t.onCloseAutoFocus,l=>{var c;l.preventDefault(),o.current||(c=i.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Qn(t.onPointerDownOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;o.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:Qn(t.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),Bdt=p.forwardRef(Ab(function(t,n){const i=X1(yC,t.__scopePopover),r=p.useRef(!1),s=p.useRef(!1);return a.jsx(IRe,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,c;(l=t.onCloseAutoFocus)==null||l.call(t,o),o.defaultPrevented||(r.current||(c=i.triggerRef.current)==null||c.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{var u,d;(u=t.onInteractOutside)==null||u.call(t,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=o.target;((d=i.triggerRef.current)==null?void 0:d.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})},"PopoverContentNonModal")),IRe=p.forwardRef(Ab(function(t,n){const{__scopePopover:i,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,...h}=t,m=X1(yC,i),g=XV(i);return rM(),a.jsx(INe,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:a.jsx(_V,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:f,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),deferPointerDownOutside:!0,children:a.jsx(FV,{"data-state":YV(m.open),role:"dialog",id:m.contentId,...g,...h,ref:n,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl"));function YV(e){return e?"open":"closed"}Ab(YV,"getState");var PRe=Ndt,DRe=Idt,MRe=Mdt,LRe=Ldt,Udt=Object.defineProperty,_l=(e,t)=>Udt(e,"name",{value:t,configurable:!0}),$Re="Radio",[Qdt,FRe]=qc($Re),[zdt,fM]=Qdt($Re);function BRe(e){const{__scopeRadio:t,checked:n=!1,children:i,disabled:r,form:s,name:o,onCheck:l,required:c,value:u="on",internal_do_not_use_render:d}=e,[f,h]=p.useState(null),[m,g]=p.useState(null),b=p.useRef(!1),[v,y]=p.useReducer(O=>O+1,0),w=f?!!s||!!f.closest("form"):!0,x={checked:n,disabled:r,required:c,name:o,form:s,value:u,control:f,setControl:h,hasConsumerStoppedPropagationRef:b,userInteractionCount:v,onUserInteraction:y,isFormControl:w,bubbleInput:m,setBubbleInput:g,onCheck:_l(()=>l==null?void 0:l(),"onCheck")};return a.jsx(zdt,{scope:t,...x,children:URe(d)?d(x):i})}_l(BRe,"RadioProvider");var Vdt="RadioTrigger",Hdt=p.forwardRef(_l(function({__scopeRadio:t,onClick:n,...i},r){const{checked:s,disabled:o,value:l,setControl:c,onCheck:u,hasConsumerStoppedPropagationRef:d,onUserInteraction:f,isFormControl:h,bubbleInput:m}=fM(Vdt,t),g=_r(r,c);return a.jsx(Xr.button,{type:"button",role:"radio","aria-checked":s,"data-state":ZV(s),"data-disabled":o?"":void 0,disabled:o,value:l,...i,ref:g,onClick:Qn(n,b=>{s||(f(),u()),m&&h&&(d.current=b.isPropagationStopped(),d.current||b.stopPropagation())})})},"RadioTrigger")),qdt="RadioIndicator",Wdt=p.forwardRef(_l(function(t,n){const{__scopeRadio:i,forceMount:r,...s}=t,o=fM(qdt,i);return a.jsx(jh,{present:r||o.checked,children:a.jsx(Xr.span,{"data-state":ZV(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:n})})},"RadioIndicator")),Kdt="RadioBubbleInput",Gdt=p.forwardRef(_l(function({__scopeRadio:t,onClick:n,...i},r){const{control:s,checked:o,required:l,disabled:c,name:u,value:d,form:f,bubbleInput:h,setBubbleInput:m,hasConsumerStoppedPropagationRef:g,userInteractionCount:b}=fM(Kdt,t),v=_r(r,m),y=YA(s),w=p.useRef(!1),x=p.useRef(o),O=p.useRef(b);p.useEffect(()=>{const S=h;if(!S)return;const C=window.HTMLInputElement.prototype,j=Object.getOwnPropertyDescriptor(C,"checked").set,T=b!==O.current;O.current=b;const R=x.current!==o;x.current=o;const A=!(T&&g.current);if(R&&j){w.current=!T;const N=new Event("click",{bubbles:A});j.call(S,o),S.dispatchEvent(N),w.current=!1}},[h,o,g,b]);const k=p.useRef(o);return a.jsx(Xr.input,{type:"radio","aria-hidden":!0,defaultChecked:k.current,required:l,disabled:c,name:u,value:d,form:f,...i,tabIndex:-1,ref:v,onClick:Qn(n,S=>{w.current&&S.stopPropagation()}),style:{...i.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"RadioBubbleInput"));function URe(e){return typeof e=="function"}_l(URe,"isFunction");function ZV(e){return e?"checked":"unchecked"}_l(ZV,"getState");var Xdt=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],JV="RadioGroup",[Ydt,Ohn]=qc(JV,[G1,FRe]),QRe=G1(),hM=FRe(),[Zdt,Jdt]=Ydt(JV),eft=p.forwardRef(_l(function(t,n){const{__scopeRadioGroup:i,name:r,form:s,defaultValue:o,value:l,required:c=!1,disabled:u=!1,orientation:d,dir:f,loop:h=!0,onValueChange:m,...g}=t,b=QRe(i),v=XA(f),[y,w]=Rd({prop:l,defaultProp:o??null,onChange:m,caller:JV}),[x,O]=p.useState(null),k=_r(n,O),S=p.useRef(y);return p.useEffect(()=>{const C=s?x==null?void 0:x.ownerDocument.getElementById(s):x==null?void 0:x.closest("form");if(C instanceof HTMLFormElement){const E=_l(()=>w(S.current),"reset");return C.addEventListener("reset",E),()=>C.removeEventListener("reset",E)}},[x,s,w]),a.jsx(Zdt,{scope:i,name:r,form:s,required:c,disabled:u,value:y,onValueChange:w,children:a.jsx(QV,{asChild:!0,...b,orientation:d,dir:v,loop:h,children:a.jsx(Xr.div,{role:"radiogroup","aria-required":c,"aria-orientation":d,"data-disabled":u?"":void 0,dir:v,...g,ref:k})})})},"RadioGroup")),tft="RadioGroupItemProvider",nft="RadioGroupItemTrigger";function zRe(e){const{__scopeRadioGroup:t,value:n,disabled:i,children:r,internal_do_not_use_render:s}=e,o=Jdt(tft,t),l=hM(t),c=o.disabled||i;return a.jsx(BRe,{...l,checked:o.value===n,disabled:c,required:o.required,name:o.name,form:o.form,value:n,onCheck:()=>o.onValueChange(n),internal_do_not_use_render:s,children:r})}_l(zRe,"RadioGroupItemProvider");var ift=p.forwardRef(_l(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=QRe(i),o=hM(i),{checked:l,disabled:c}=fM(nft,o.__scopeRadio),u=p.useRef(null),d=_r(n,u),f=p.useRef(!1);return p.useEffect(()=>{const h=_l(g=>{Xdt.includes(g.key)&&(f.current=!0)},"handleKeyDown"),m=_l(()=>f.current=!1,"handleKeyUp");return document.addEventListener("keydown",h),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",m)}},[]),a.jsx(zV,{asChild:!0,...s,focusable:!c,active:l,children:a.jsx(Hdt,{...o,...r,ref:d,onKeyDown:Qn(r.onKeyDown,h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:Qn(r.onFocus,()=>{var h;f.current&&((h=u.current)==null||h.click())})})})},"RadioGroupItemTrigger")),rft=p.forwardRef(_l(function(t,n){const{__scopeRadioGroup:i,value:r,disabled:s,...o}=t;return a.jsx(zRe,{__scopeRadioGroup:i,value:r,disabled:s,internal_do_not_use_render:({isFormControl:l})=>a.jsxs(a.Fragment,{children:[a.jsx(ift,{...o,ref:n,__scopeRadioGroup:i}),l&&a.jsx(sft,{__scopeRadioGroup:i})]})})},"RadioGroupItem")),sft=p.forwardRef(_l(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=hM(i);return a.jsx(Gdt,{...s,...r,ref:n})},"RadioGroupItemBubbleInput")),aft=p.forwardRef(_l(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=hM(i);return a.jsx(Wdt,{...s,...r,ref:n})},"RadioGroupIndicator")),oft=Object.defineProperty,ib=(e,t)=>oft(e,"name",{value:t,configurable:!0}),eH="Switch",[lft,khn]=qc(eH),[cft,tH]=lft(eH);function VRe(e){const{__scopeSwitch:t,checked:n,children:i,defaultChecked:r,disabled:s,form:o,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=e,[h,m]=Rd({prop:n,defaultProp:r??!1,onChange:c,caller:eH}),[g,b]=p.useState(null),[v,y]=p.useState(null),w=p.useRef(!1),[x,O]=p.useReducer(C=>C+1,0),k=g?!!o||!!g.closest("form"):!0,S={checked:h,setChecked:m,disabled:s,control:g,setControl:b,name:l,form:o,value:d,hasConsumerStoppedPropagationRef:w,userInteractionCount:x,onUserInteraction:O,required:u,defaultChecked:r,isFormControl:k,bubbleInput:v,setBubbleInput:y};return a.jsx(cft,{scope:t,...S,children:HRe(f)?f(S):i})}ib(VRe,"SwitchProvider");var uft="SwitchTrigger",dft=p.forwardRef(ib(function({__scopeSwitch:t,onClick:n,...i},r){const{control:s,form:o,value:l,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,onUserInteraction:g,isFormControl:b,bubbleInput:v}=tH(uft,t),y=_r(r,f),w=p.useRef(u);return p.useEffect(()=>{const x=o?s==null?void 0:s.ownerDocument.getElementById(o):s==null?void 0:s.form;if(x instanceof HTMLFormElement){const O=ib(()=>h(w.current),"reset");return x.addEventListener("reset",O),()=>x.removeEventListener("reset",O)}},[s,o,h]),a.jsx(Xr.button,{type:"button",role:"switch","aria-checked":u,"aria-required":d,"data-state":nH(u),"data-disabled":c?"":void 0,disabled:c,value:l,...i,ref:y,onClick:Qn(n,x=>{g(),h(O=>!O),v&&b&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})})},"SwitchTrigger")),fft=p.forwardRef(ib(function(t,n){const{__scopeSwitch:i,name:r,checked:s,defaultChecked:o,required:l,disabled:c,value:u,onCheckedChange:d,form:f,...h}=t;return a.jsx(VRe,{__scopeSwitch:i,checked:s,defaultChecked:o,disabled:c,required:l,onCheckedChange:d,name:r,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>a.jsxs(a.Fragment,{children:[a.jsx(dft,{...h,ref:n,__scopeSwitch:i}),m&&a.jsx(gft,{__scopeSwitch:i})]})})},"Switch")),hft="SwitchThumb",pft=p.forwardRef(ib(function(t,n){const{__scopeSwitch:i,...r}=t,s=tH(hft,i);return a.jsx(Xr.span,{"data-state":nH(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:n})},"SwitchThumb")),mft="SwitchBubbleInput",gft=p.forwardRef(ib(function({__scopeSwitch:t,onClick:n,...i},r){const{control:s,hasConsumerStoppedPropagationRef:o,userInteractionCount:l,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:m,form:g,bubbleInput:b,setBubbleInput:v}=tH(mft,t),y=_r(r,v),w=YA(s),x=p.useRef(!1),O=p.useRef(c),k=p.useRef(l);p.useEffect(()=>{const C=b;if(!C)return;const E=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(E,"checked").set,R=l!==k.current;k.current=l;const A=O.current!==c;O.current=c;const N=!(R&&o.current);if(A&&T){x.current=!R;const D=new Event("click",{bubbles:N});T.call(C,c),C.dispatchEvent(D),x.current=!1}},[b,c,o,l]);const S=p.useRef(c);return a.jsx(Xr.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??S.current,required:d,disabled:f,name:h,value:m,form:g,...i,tabIndex:-1,ref:y,onClick:Qn(n,C=>{x.current&&C.stopPropagation()}),style:{...i.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function HRe(e){return typeof e=="function"}ib(HRe,"isFunction");function nH(e){return e?"checked":"unchecked"}ib(nH,"getState");var bft=Object.defineProperty,yft=(e,t)=>bft(e,"name",{value:t,configurable:!0}),vft="Toggle",xft=p.forwardRef(yft(function(t,n){const{pressed:i,defaultPressed:r,onPressedChange:s,...o}=t,[l,c]=Rd({prop:i,onChange:s,defaultProp:r??!1,caller:vft});return a.jsx(Xr.button,{type:"button","aria-pressed":l,"data-state":l?"on":"off","data-disabled":t.disabled?"":void 0,...o,ref:n,onClick:Qn(t.onClick,()=>{t.disabled||c(!l)})})},"Toggle")),wft=Object.defineProperty,rb=(e,t)=>wft(e,"name",{value:t,configurable:!0}),Y1="ToggleGroup",[qRe,Shn]=qc(Y1,[G1]),WRe=G1(),Oft=p.forwardRef(rb(function(t,n){const{type:i,...r}=t;if(i==="single"){const s=r;return a.jsx(kft,{role:"radiogroup",...s,ref:n})}if(i==="multiple"){const s=r;return a.jsx(Sft,{role:"toolbar",...s,ref:n})}throw new Error(`Missing prop \`type\` expected on \`${Y1}\``)},"ToggleGroup")),[KRe,GRe]=qRe(Y1),kft=p.forwardRef(rb(function(t,n){const{value:i,defaultValue:r,onValueChange:s=rb(()=>{},"onValueChange"),...o}=t,[l,c]=Rd({prop:i,defaultProp:r??"",onChange:s,caller:Y1});return a.jsx(KRe,{scope:t.__scopeToggleGroup,type:"single",value:p.useMemo(()=>l?[l]:[],[l]),onItemActivate:c,onItemDeactivate:p.useCallback(()=>c(""),[c]),children:a.jsx(XRe,{...o,ref:n})})},"ToggleGroupImplSingle")),Sft=p.forwardRef(rb(function(t,n){const{value:i,defaultValue:r,onValueChange:s=rb(()=>{},"onValueChange"),...o}=t,[l,c]=Rd({prop:i,defaultProp:r??[],onChange:s,caller:Y1}),u=p.useCallback(f=>c((h=[])=>[...h,f]),[c]),d=p.useCallback(f=>c((h=[])=>h.filter(m=>m!==f)),[c]);return a.jsx(KRe,{scope:t.__scopeToggleGroup,type:"multiple",value:l,onItemActivate:u,onItemDeactivate:d,children:a.jsx(XRe,{...o,ref:n})})},"ToggleGroupImplMultiple")),[Eft,Cft]=qRe(Y1),XRe=p.forwardRef(rb(function(t,n){const{__scopeToggleGroup:i,disabled:r=!1,rovingFocus:s=!0,orientation:o,dir:l,loop:c=!0,...u}=t,d=WRe(i),f=XA(l),h={dir:f,...u};return a.jsx(Eft,{scope:i,rovingFocus:s,disabled:r,children:s?a.jsx(QV,{asChild:!0,...d,orientation:o,dir:f,loop:c,children:a.jsx(Xr.div,{...h,ref:n})}):a.jsx(Xr.div,{...h,ref:n})})},"ToggleGroupImpl")),AB="ToggleGroupItem",Aft=p.forwardRef(rb(function(t,n){const i=GRe(AB,t.__scopeToggleGroup),r=Cft(AB,t.__scopeToggleGroup),s=WRe(t.__scopeToggleGroup),o=i.value.includes(t.value),l=r.disabled||t.disabled,c={...t,pressed:o,disabled:l},u=p.useRef(null);return r.rovingFocus?a.jsx(zV,{asChild:!0,...s,focusable:!l,active:o,ref:u,children:a.jsx(Oee,{...c,ref:n})}):a.jsx(Oee,{...c,ref:n})},"ToggleGroupItem")),Oee=p.forwardRef(rb(function(t,n){const{__scopeToggleGroup:i,value:r,...s}=t,o=GRe(AB,i),l={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},c=o.type==="single"?l:void 0;return a.jsx(xft,{...c,...s,ref:n,onPressedChange:u=>{u?o.onItemActivate(r):o.onItemDeactivate(r)}})},"ToggleGroupItemImpl")),Tft=Object.defineProperty,No=(e,t)=>Tft(e,"name",{value:t,configurable:!0}),[iH,Ehn]=qc("Tooltip",[K1]),rH=K1(),_ft="TooltipProvider",jft=700,TB="tooltip.open",[Nft,sH]=iH(_ft),Rft=No(e=>{const{__scopeTooltip:t,delayDuration:n=jft,skipDelayDuration:i=300,disableHoverableContent:r=!1,children:s}=e,o=p.useRef(!0),l=p.useRef(!1),c=p.useRef(0);return p.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),a.jsx(Nft,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:p.useCallback(()=>{i<=0||(window.clearTimeout(c.current),o.current=!1)},[i]),onClose:p.useCallback(()=>{i<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,i))},[i]),isPointerInTransitRef:l,onPointerInTransitChange:p.useCallback(u=>{l.current=u},[]),disableHoverableContent:r,children:s})},"TooltipProvider"),_B="Tooltip",[Ift,JA]=iH(_B),Pft=No(e=>{const{__scopeTooltip:t,children:n,open:i,defaultOpen:r,onOpenChange:s,disableHoverableContent:o,delayDuration:l}=e,c=sH(_B,e.__scopeTooltip),u=rH(t),[d,f]=p.useState(null),[h,m]=p.useState(void 0),g=nb(),b=p.useRef(0),v=o??c.disableHoverableContent,y=l??c.delayDuration,w=p.useRef(!1),[x,O]=Rd({prop:i,defaultProp:r??!1,onChange:No(T=>{T?(c.onOpen(),document.dispatchEvent(new CustomEvent(TB))):c.onClose(),s==null||s(T)},"onChange"),caller:_B}),k=p.useMemo(()=>x?w.current?"delayed-open":"instant-open":"closed",[x]),S=p.useCallback(()=>{window.clearTimeout(b.current),b.current=0,w.current=!1,O(!0)},[O]),C=p.useCallback(()=>{window.clearTimeout(b.current),b.current=0,O(!1)},[O]),E=p.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{w.current=!0,O(!0),b.current=0},y)},[y,O]);p.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]);const j=h??g;return a.jsx(oM,{...u,children:a.jsx(Ift,{scope:t,contentId:j,setContentId:m,open:x,stateAttribute:k,trigger:d,onTriggerChange:f,onTriggerEnter:p.useCallback(()=>{c.isOpenDelayedRef.current?E():S()},[c.isOpenDelayedRef,E,S]),onTriggerLeave:p.useCallback(()=>{v?C():(window.clearTimeout(b.current),b.current=0)},[C,v]),onOpen:S,onClose:C,disableHoverableContent:v,children:n})})},"Tooltip"),kee="TooltipTrigger",Dft=p.forwardRef(No(function(t,n){const{__scopeTooltip:i,...r}=t,s=JA(kee,i),o=sH(kee,i),l=rH(i),c=p.useRef(null),u=_r(n,c,s.onTriggerChange),d=p.useRef(!1),f=p.useRef(!1),h=p.useCallback(()=>d.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),a.jsx($V,{asChild:!0,...l,children:a.jsx(Xr.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:u,onPointerMove:Qn(t.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:Qn(t.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:Qn(t.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:Qn(t.onFocus,()=>{d.current||s.onOpen()}),onBlur:Qn(t.onBlur,s.onClose),onClick:Qn(t.onClick,s.onClose)})})},"TooltipTrigger")),YRe="TooltipPortal",[Mft,Lft]=iH(YRe,{forceMount:void 0}),$ft=No(e=>{const{__scopeTooltip:t,forceMount:n,children:i,container:r}=e,s=JA(YRe,t);return a.jsx(Mft,{scope:t,forceMount:n,children:a.jsx(jh,{present:n||s.open,children:a.jsx(RV,{asChild:!0,container:r,children:i})})})},"TooltipPortal"),vC="TooltipContent",Fft=p.forwardRef(No(function(t,n){const i=Lft(vC,t.__scopeTooltip),{forceMount:r=i.forceMount,side:s="top",...o}=t,l=JA(vC,t.__scopeTooltip);return a.jsx(jh,{present:r||l.open,children:l.disableHoverableContent?a.jsx(ZRe,{side:s,...o,ref:n}):a.jsx(Bft,{side:s,...o,ref:n})})},"TooltipContent")),Bft=p.forwardRef(No(function(t,n){const i=JA(vC,t.__scopeTooltip),r=sH(vC,t.__scopeTooltip),s=p.useRef(null),o=_r(n,s),[l,c]=p.useState(null),{trigger:u,onClose:d}=i,f=s.current,{onPointerInTransitChange:h}=r,m=p.useCallback(()=>{c(null),h(!1)},[h]),g=p.useCallback((b,v)=>{const y=b.currentTarget,w={x:b.clientX,y:b.clientY},x=JRe(w,y.getBoundingClientRect()),O=eIe(w,x),k=tIe(v.getBoundingClientRect()),S=iIe([...O,...k]);c(S),h(!0)},[h]);return p.useEffect(()=>()=>m(),[m]),p.useEffect(()=>{if(u&&f){const b=No(y=>g(y,f),"handleTriggerLeave"),v=No(y=>g(y,u),"handleContentLeave");return u.addEventListener("pointerleave",b),f.addEventListener("pointerleave",v),()=>{u.removeEventListener("pointerleave",b),f.removeEventListener("pointerleave",v)}}},[u,f,g,m]),p.useEffect(()=>{if(l){const b=No(v=>{const y=v.target,w={x:v.clientX,y:v.clientY},x=(u==null?void 0:u.contains(y))||(f==null?void 0:f.contains(y)),O=!nIe(w,l);x?m():O&&(m(),d())},"handleTrackPointerGrace");return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[u,f,l,d,m]),a.jsx(ZRe,{...t,ref:o})},"TooltipContentHoverable")),Uft=uNe("TooltipContent"),ZRe=p.forwardRef(No(function(t,n){const{__scopeTooltip:i,children:r,"aria-label":s,id:o,onEscapeKeyDown:l,onPointerDownOutside:c,...u}=t,d=JA(vC,i),f=rH(i),{onClose:h}=d;p.useEffect(()=>(document.addEventListener(TB,h),()=>document.removeEventListener(TB,h)),[h]),p.useEffect(()=>{if(d.trigger){const g=No(b=>{b.target instanceof Node&&b.target.contains(d.trigger)&&h()},"handleScroll");return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[d.trigger,h]);const{setContentId:m}=d;return Od(()=>(m(o),()=>{m(void 0)}),[o,m]),a.jsx(_V,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:g=>g.preventDefault(),onDismiss:h,children:a.jsxs(FV,{"data-state":d.stateAttribute,role:s?void 0:"tooltip",id:s?void 0:d.contentId,...f,...u,ref:n,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[a.jsx(Uft,{children:r}),s?a.jsx(plt,{id:d.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl"));function JRe(e,t){const n=Math.abs(t.top-e.y),i=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,i,r,s)){case s:return"left";case r:return"right";case n:return"top";case i:return"bottom";default:throw new Error("unreachable")}}No(JRe,"getExitSideFromRect");function eIe(e,t,n=5){const i=[];switch(t){case"top":i.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":i.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":i.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":i.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return i}No(eIe,"getPaddedExitPoints");function tIe(e){const{top:t,right:n,bottom:i,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:i},{x:r,y:i}]}No(tIe,"getPointsFromRect");function nIe(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,o=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}No(nIe,"isPointInPolygon");function iIe(e){const t=e.slice();return t.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),rIe(t)}No(iIe,"getHull");function rIe(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i=2;){const s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let i=e.length-1;i>=0;i--){const r=e[i];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}No(rIe,"getHullPresorted");var Qft=Rft,zft=Pft,sIe=Dft,Vft=$ft,Hft=Fft;function sb(e){const t=p.useRef(e);return t.current=e,t}let e1=[],g_=!1;const See=e=>{var t,n;if(e.key==="Escape"){const[i]=e1;i&&(e.preventDefault(),(n=(t=i.callback).current)==null||n.call(t))}},aIe=()=>{e1.length>0&&!g_?(document.body.addEventListener("keydown",See),g_=!0):e1.length===0&&g_&&(document.body.removeEventListener("keydown",See),g_=!1)},qft=e=>{e1.unshift(e),aIe()},Wft=({id:e})=>{e1=e1.filter(t=>t.id!==e),aIe()},eT=(e,t)=>{const n=p.useId(),i=sb(t);p.useEffect(()=>{if(!e)return;const r={id:n,callback:i};return qft(r),()=>Wft(r)},[n,e,i])},Kft=p.createContext(null);function oIe(){const e=p.useContext(Kft);return(e==null?void 0:e.linkComponent)??"a"}function tT(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}const Gft=()=>rNe,Eee=(e,t=!1,n="TransitionGroup")=>{const i=[];return p.Children.forEach(e,r=>{if(r&&typeof r=="object"&&"key"in r&&r.key)i.push(r);else if(t)throw new Error(`Child elements of <${n} /> must include a \`key\``)}),i},Lv=()=>{},$v=e=>{const t=p.useRef(e);return t.current=e,p.useCallback(n=>t.current(n),[])};function Xft(e,t,n,i){const r=e.reduce((c,u)=>({...c,[u.key]:1}),{}),s=t.reduce((c,u)=>({...c,[u.component.key]:1}),{}),o=e.filter(c=>!s[c.key]).map(n),l=t.map(c=>({...c,component:e.find(({key:u})=>u===c.component.key)||c.component,shouldRender:!!r[c.component.key]}));return i==="append"?l.concat(o):o.concat(l)}function Yft(e,t,n){if((rNe||Got)&&t&&n>1)throw new Error(`Cannot use forwardRef with multiple children in <${e} />`)}const Zft="_TransitionGroupChild_1hv1z_1",Jft={TransitionGroupChild:Zft},lIe={enter:!1,enterActive:!1,exit:!1,exitActive:!1,interrupted:!1},eht=e=>({...lIe,enter:!e}),tht=(e,t)=>{switch(t.type){case"enter-before":return{enter:!0,enterActive:!1,exit:!1,exitActive:!1,interrupted:e.interrupted||e.exit};case"enter-active":return{enter:!0,enterActive:!0,exit:!1,exitActive:!1,interrupted:!1};case"exit-before":return{enter:!1,enterActive:!1,exit:!0,exitActive:!1,interrupted:e.interrupted||e.enter};case"exit-active":return{enter:!1,enterActive:!1,exit:!0,exitActive:!0,interrupted:!1};case"done":default:return lIe}},nht=({ref:e,as:t,children:n,className:i,transitionId:r,style:s,preventMountTransition:o,shouldRender:l,enterDuration:c,exitDuration:u,removeChild:d,onEnter:f,onEnterActive:h,onEnterComplete:m,onExit:g,onExitActive:b,onExitComplete:v})=>{const[y,w]=p.useReducer(tht,eht(o||!1)),x=p.useRef(!1),O=p.useRef(null),k=p.useRef(c);k.current=c;const S=p.useRef(u);S.current=u;const C=p.useRef(null),E=p.useCallback(j=>{const T=O.current;if(!(!T||j===C.current))switch(C.current=j,j){case"enter":f(T);break;case"enter-active":h(T);break;case"enter-complete":m(T);break;case"exit":g(T);break;case"exit-active":b(T);break;case"exit-complete":v(T);break}},[f,h,m,g,b,v]);return Ni.useLayoutEffect(()=>{if(!l){let R;w({type:"exit-before"}),E("exit");const A=pI(()=>{w({type:"exit-active"}),E("exit-active"),R=window.setTimeout(()=>{E("exit-complete"),d()},S.current)});return()=>{A(),R!==void 0&&clearTimeout(R)}}if(o&&!x.current){x.current=!0;return}let j;w({type:"enter-before"}),E("enter");const T=pI(()=>{w({type:"enter-active"}),E("enter-active"),j=window.setTimeout(()=>{w({type:"done"}),E("enter-complete")},k.current)});return()=>{T(),j!==void 0&&clearTimeout(j)}},[l,o,d,E]),p.useEffect(()=>()=>{x.current=!1},[]),a.jsx(t,{ref:tT([O,e]),className:Qi(i,Jft.TransitionGroupChild),"data-transition-id":r,style:s,"data-entering":y.enter?"":void 0,"data-entering-active":y.enterActive?"":void 0,"data-exiting":y.exit?"":void 0,"data-exiting-active":y.exitActive?"":void 0,"data-interrupted":y.interrupted?"":void 0,children:n})},iht=e=>{const{enterMountDelay:t,preventMountTransition:n}=e,i=!n&&t!=null?t:null,[r,s]=p.useState(i==null);return kV(()=>s(!0),r?null:i),r?a.jsx(nht,{...e}):null},Z1=e=>{const{ref:t,as:n="span",children:i,className:r,transitionId:s,style:o,enterDuration:l=0,exitDuration:c=0,preventInitialTransition:u=!0,enterMountDelay:d,insertMethod:f="append",disableAnimations:h=Gft()}=e,m=$v(e.onEnter??Lv),g=$v(e.onEnterActive??Lv),b=$v(e.onEnterComplete??Lv),v=$v(e.onExit??Lv),y=$v(e.onExitActive??Lv),w=$v(e.onExitComplete??Lv);p.Children.forEach(i,S=>{if(S&&!S.key)throw new Error("Child elements of must include a `key`")});const x=p.useCallback(S=>({component:S,shouldRender:!0,removeChild:()=>{k(C=>C.filter(E=>S.key!==E.component.key))},onEnter:m,onEnterActive:g,onEnterComplete:b,onExit:v,onExitActive:y,onExitComplete:w}),[m,g,b,v,y,w]),[O,k]=p.useState(()=>Eee(i).map(S=>({...x(S),preventMountTransition:u})));return p.useLayoutEffect(()=>{k(S=>{const C=Eee(i);return Xft(C,S,x,f)})},[i,f,x]),Yft("TransitionGroup",t,p.Children.count(i)),h?a.jsx(a.Fragment,{children:p.Children.map(i,S=>a.jsx(n,{ref:t,className:r,style:o,"data-transition-id":s,children:S}))}):a.jsx(a.Fragment,{children:O.map(({component:S,...C})=>a.jsx(iht,{...C,as:n,className:r,transitionId:s,enterDuration:l,exitDuration:c,enterMountDelay:d,style:o,ref:t,children:S},S.key))})},rht="_Button_1864l_1",sht="_ButtonInner_1864l_4",aht="_ButtonLoader_1864l_749",s4={Button:rht,ButtonInner:sht,ButtonLoader:aht},_t=e=>{const{type:t="button",color:n="primary",variant:i="solid",pill:r=!0,uniform:s=!1,size:o="md",iconSize:l,gutterSize:c,loading:u,selected:d,block:f,opticallyAlign:h,children:m,className:g,onClick:b,disabled:v,disabledTone:y,inert:w=u,...x}=e,O=v||w,k=p.useCallback(S=>{v||b==null||b(S)},[b,v]);return a.jsxs("button",{type:t,className:Qi(s4.Button,g),"data-color":n,"data-variant":i,"data-pill":r?"":void 0,"data-uniform":s?"":void 0,"data-size":o,"data-gutter-size":c,"data-icon-size":l,"data-loading":u?"":void 0,"data-selected":d?"":void 0,"data-block":f?"":void 0,"data-optically-align":h,onPointerEnter:SV,disabled:O,"aria-disabled":O,tabIndex:O?-1:void 0,"data-disabled":v?"":void 0,"data-disabled-tone":v?y:void 0,onClick:k,...x,children:[a.jsx(Z1,{className:s4.ButtonLoader,enterDuration:250,exitDuration:150,children:u&&a.jsx(KA,{},"loader")}),a.jsx("span",{className:s4.ButtonInner,children:OV(m)})]})},oht=()=>{var e;return typeof ClipboardItem<"u"&&!!((e=navigator.clipboard)!=null&&e.write)};function lht(e){const{"text/plain":t,...n}=e;return new ClipboardItem({...n,...t?{"text/plain":new Blob([t],{type:"text/plain"})}:null})}async function cht(e,t=document.body){if(typeof e=="string")return Cee(e,t);try{return oht()?(await navigator.clipboard.write([lht(e)]),!0):e["text/plain"]?Cee(e["text/plain"],t):!1}catch{return!1}}async function Cee(e,t=document.body){if(navigator.clipboard)try{return await navigator.clipboard.writeText(e),!0}catch{}const n=document.createElement("textarea");n.value=e,n.style.position="fixed",n.style.top="0",n.style.left="0",n.style.opacity="0",t.appendChild(n),n.focus(),n.select();let i=!1;try{i=document.execCommand("copy")}catch{}return t.removeChild(n),i}const uht="_TransitionItem_1o7b1_1",dht={TransitionItem:uht},fht=e=>{const{as:t="span",className:n,children:i,preventInitialTransition:r,insertMethod:s,transitionClassName:o,transitionPosition:l="absolute"}=e,{enterTotalDuration:c,exitTotalDuration:u,variables:d}=bht(e);return a.jsx(t,{className:Qi("block",l==="absolute"&&"relative",n),"data-transition-position":l,style:d,children:a.jsx(Z1,{as:t,className:Qi(dht.TransitionItem,o),enterDuration:c,exitDuration:u,insertMethod:s,preventInitialTransition:r,children:i})})},hht=400,pht=500,mht=200,ght=300;function bht({initial:e,enter:t,exit:n,forceCompositeLayer:i}){const r=K3(e),s=K3(t),o=K3(n),l=[r,o,s].some(b=>b!=="none"),c=(t==null?void 0:t.duration)??(l?pht:hht),u=(t==null?void 0:t.timingFunction)??(l?"var(--cubic-enter)":"ease"),d=(n==null?void 0:n.duration)??(l?ght:mht),f=(n==null?void 0:n.timingFunction)??(l?"var(--cubic-exit)":"ease"),h=V0({"tg-will-change":i?"transform, opacity":"auto","tg-enter-opacity":W3((t==null?void 0:t.opacity)??1),"tg-enter-transform":s,"tg-enter-filter":G3(t),"tg-enter-duration":l_(c),"tg-enter-delay":l_((t==null?void 0:t.delay)??0),"tg-enter-timing-function":u,"tg-exit-opacity":W3((n==null?void 0:n.opacity)??0),"tg-exit-transform":o,"tg-exit-filter":G3(n),"tg-exit-duration":l_(d),"tg-exit-delay":l_((n==null?void 0:n.delay)??0),"tg-exit-timing-function":f,"tg-initial-opacity":W3((e==null?void 0:e.opacity)??(n==null?void 0:n.opacity)??0),"tg-initial-transform":r==="none"?o:r,"tg-initial-filter":G3(e??n??{})}),m=((t==null?void 0:t.delay)??0)+c,g=((n==null?void 0:n.delay)??0)+d;return{enterTotalDuration:m,exitTotalDuration:g,variables:h}}const aH=({children:e,copyValue:t,onClick:n,...i})=>{const[r,s]=p.useState(!1),o=p.useRef(null),l=c=>{r||(s(!0),n==null||n(c),cht(typeof t=="function"?t():t),o.current=window.setTimeout(()=>{s(!1)},1300))};return p.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),a.jsxs(_t,{...i,onClick:l,children:[a.jsx(fht,{className:"w-[var(--button-icon-size)] h-[var(--button-icon-size)]",initial:{scale:.6},enter:{scale:1,delay:150,duration:300},exit:{scale:.6,duration:150},forceCompositeLayer:!0,children:r?a.jsx(hC,{},"copied-icon"):a.jsx(jje,{},"copy-icon")}),typeof e=="function"?e({copied:r}):e]})},yht="_Menu_1t4b0_1",vht="_MenuList_1t4b0_3",xht="_MenuItemContent_1t4b0_53",wht="_MenuItem_1t4b0_53",Oht="_ItemActions_1t4b0_98",kht="_PressableInner_1t4b0_117",Sht="_Separator_1t4b0_135",Eht="_SubMenuItem_1t4b0_139",Cht="_SubTriggerIcon_1t4b0_141",Aht="_RadioItem_1t4b0_151",Tht="_RadioIndicatorActive_1t4b0_158",_ht="_RadioIndicator_1t4b0_158",jht="_CheckboxItem_1t4b0_249",Nht="_CheckboxIndicator_1t4b0_256",Rht="_CheckboxCircle_1t4b0_269",js={Menu:yht,MenuList:vht,MenuItemContent:xht,MenuItem:wht,ItemActions:Oht,PressableInner:kht,Separator:Sht,SubMenuItem:Eht,SubTriggerIcon:Cht,RadioItem:Aht,RadioIndicatorActive:Tht,RadioIndicator:_ht,CheckboxItem:jht,CheckboxIndicator:Nht,CheckboxCircle:Rht},cIe=p.createContext(null),nT=()=>{const e=p.useContext(cIe);if(!e)throw new Error("Menu components must be wrapped in ");return e},er=({children:e,forceOpen:t,onOpen:n,onClose:i,modal:r=!1})=>{const[s,o]=p.useState(!1),l=t??s,c=sb(n),u=sb(i),d=p.useCallback(h=>{var m,g;o(h),h?(m=c.current)==null||m.call(c):(g=u.current)==null||g.call(u)},[c,u]);eT(s,()=>{d(!1)});const f=p.useMemo(()=>({open:l,setOpen:d}),[l,d]);return a.jsx(cIe.Provider,{value:f,children:a.jsx(vdt,{open:l,onOpenChange:d,modal:r,children:e})})},Iht=({className:e,children:t,disabled:n,onSelect:i,onClick:r})=>{const{open:s}=nT(),o=l=>{s||l.preventDefault()};return i?a.jsx(_Re,{className:Qi(js.MenuItem,e),onSelect:i,onClick:r,disabled:n,onPointerMove:o,onPointerLeave:o,children:a.jsx("div",{className:js.PressableInner,children:t})}):a.jsx("div",{className:Qi(js.MenuItemContent,e),children:t})},Pht=({className:e,children:t})=>a.jsx("div",{className:Qi(js.ItemActions,e),children:t}),Dht=({children:e,onClick:t})=>{const{setOpen:n}=nT();return a.jsx(_t,{className:"rounded-sm",color:"secondary",size:"xs",uniform:!0,iconSize:"sm",variant:"ghost",onClick:i=>{i.stopPropagation(),n(!1),t(i)},children:e})},Mht=e=>{const{className:t,children:n,href:i,to:r,disabled:s,as:o,...l}=e,{open:c}=nT(),u=i||r,d=u?/^https?:\/\//.test(u):!0,f=oIe(),h=o||(d?"a":f),m=b=>{c||b.preventDefault()},g=d?{target:"_blank",rel:"noopener noreferrer",href:i??r}:{href:i,to:r};return a.jsx(_Re,{asChild:!0,className:Qi(js.MenuItem,t),disabled:s,onPointerMove:d?void 0:m,onPointerLeave:d?void 0:m,children:a.jsx(h,{...g,...l,children:a.jsx("span",{className:js.PressableInner,children:n})})})},Lht=({className:e})=>a.jsx(Edt,{className:Qi(js.Separator,e),role:"separator"}),$ht=({children:e,side:t,sideOffset:n=5,align:i,alignOffset:r,width:s,minWidth:o,maxHeight:l})=>{const{open:c}=nT();return a.jsx(TRe,{forceMount:!0,children:a.jsx(Z1,{className:js.Menu,enterDuration:350,exitDuration:200,disableAnimations:!0,children:c&&a.jsx(wdt,{forceMount:!0,className:js.MenuList,side:t,sideOffset:n,align:i,alignOffset:r??(i==="center"?0:-5),avoidCollisions:!0,collisionPadding:{bottom:30,top:30,left:12,right:12},onEscapeKeyDown:Mp,style:V0({"menu-width":s,"menu-min-width":o,"menu-max-height":l}),children:e},"dropdown")})})},Fht=({children:e,disabled:t})=>a.jsx(xdt,{asChild:!0,disabled:t,children:e}),uIe=p.createContext(null),dIe=()=>{const e=p.useContext(uIe);if(!e)throw new Error("Submenu components must be wrapped in ");return e},Bht=({children:e,forceOpen:t,onOpen:n,onClose:i})=>{const[r,s]=p.useState(!1),o=p.useRef(null),l=t??r,c=sb(n),u=sb(i),d=p.useCallback(h=>{var m,g;s(h),h?(m=c.current)==null||m.call(c):(g=u.current)==null||g.call(u)},[c,u]);eT(r,()=>{var h;d(!1),(h=o.current)==null||h.focus()});const f=p.useMemo(()=>({open:l,setOpen:d,triggerRef:o}),[l,d]);return a.jsx(uIe.Provider,{value:f,children:a.jsx(Cdt,{open:l,onOpenChange:d,children:e})})},Uht=({className:e,children:t,disabled:n})=>{const{open:i}=nT(),{triggerRef:r}=dIe(),s=o=>{i||o.preventDefault()};return a.jsx(Adt,{ref:r,className:Qi(js.MenuItem,js.SubMenuItem,e),disabled:n,onPointerMove:s,onPointerLeave:s,children:a.jsxs("div",{className:js.PressableInner,children:[t,a.jsx(Jst,{width:"16",height:"16",className:js.SubTriggerIcon})]})})},Qht=({children:e,sideOffset:t=4,alignOffset:n=-6,width:i="auto",minWidth:r="auto",maxHeight:s})=>{const{open:o}=dIe();return a.jsx(TRe,{forceMount:!0,children:a.jsx(Z1,{className:js.Menu,enterDuration:350,exitDuration:200,disableAnimations:!0,children:o&&a.jsx(Tdt,{className:js.MenuList,sideOffset:t,alignOffset:n,avoidCollisions:!0,collisionPadding:{bottom:30,top:30,left:12,right:12},onEscapeKeyDown:Mp,style:V0({"menu-width":i,"menu-min-width":r,"menu-max-height":s}),children:e},"submenu")})})},zht=({children:e,value:t,onChange:n,indicatorPosition:i="end",...r})=>a.jsx(kdt,{...r,value:t,onValueChange:s=>n(s),"data-indicator-position":i,children:e}),Vht=({className:e,children:t,...n})=>a.jsx(Sdt,{className:Qi(js.MenuItem,js.RadioItem,e),...n,children:a.jsxs("div",{className:js.PressableInner,children:[a.jsx("div",{className:js.RadioIndicator,children:a.jsx(jRe,{className:js.RadioIndicatorActive})}),t]})}),Hht=({className:e,children:t,indicatorPosition:n="end",indicatorVariant:i="solid",...r})=>a.jsx(Odt,{className:Qi(js.MenuItem,js.CheckboxItem,e),...r,"data-indicator-position":n,"data-indicator-variant":i,children:a.jsxs("div",{className:js.PressableInner,children:[a.jsx("div",{className:js.CheckboxIndicator,children:a.jsx(jRe,{children:i==="ghost"?a.jsx(hC,{className:"size-4"}):a.jsx("div",{className:js.CheckboxCircle,children:a.jsx(hC,{className:"size-4"})})})}),t]})});er.Content=$ht;er.Item=Iht;er.ItemActions=Pht;er.ItemAction=Dht;er.Link=Mht;er.Separator=Lht;er.Trigger=Fht;er.Sub=Bht;er.SubTrigger=Uht;er.SubContent=Qht;er.CheckboxItem=Hht;er.RadioGroup=zht;er.RadioItem=Vht;const qht="_Tooltip_16g2y_1",Wht="_TriggerDecorator_16g2y_73",fIe={Tooltip:qht,TriggerDecorator:Wht},ka=e=>{const{ref:t,children:n,content:i,forceOpen:r=i===null?!1:void 0,maxWidth:s=300,openDelay:o=150,interactive:l=!1,compact:c=!1,preventUnintentionalClickToClose:u,align:d,alignOffset:f=0,side:h,sideOffset:m=5,gutterSize:g="md",contentClassName:b,onPointerDown:v,onClick:y,...w}=e,[x,O]=p.useState(!1),[k,S]=p.useState(!1);kV(()=>S(!1),k?400:null);const C=r??x,E=T=>{typeof r!="boolean"&&(O(T),u&&S(T))},j=T=>{u&&k&&(T.preventDefault(),T.stopPropagation())};return a.jsxs(hIe,{open:C,delayDuration:o,onOpenChange:E,disableHoverableContent:!l,children:[a.jsx(sIe,{asChild:!0,children:a.jsx(lNe,{...w,ref:t,onPointerDown:T=>{j(T),v==null||v(T)},onClick:T=>{j(T),y==null||y(T)},children:n})}),a.jsx(pIe,{maxWidth:s,compact:c,align:d,alignOffset:f,side:h,sideOffset:m,gutterSize:g,className:b,children:i})]})},hIe=({children:e,open:t,onOpenChange:n,...i})=>(eT(t,()=>{n(!1)}),a.jsx(Qft,{children:a.jsx(zft,{open:t,onOpenChange:n,...i,children:e})})),pIe=({children:e,maxWidth:t=300,compact:n=!1,clickable:i=void 0,alignOffset:r=0,sideOffset:s=5,gutterSize:o="md",className:l,style:c,...u})=>a.jsx(Vft,{children:a.jsx(Hft,{...u,className:Qi(fIe.Tooltip,l),"data-compact":n,"data-clickable":i,"data-gutter-size":o,alignOffset:r,sideOffset:s,collisionPadding:15,hideWhenDetached:!0,style:{...c,maxWidth:t},onEscapeKeyDown:Mp,children:e})}),Kht=({children:e,asChild:t=!0,...n})=>a.jsx(sIe,{asChild:t,...n,children:e}),Ght=e=>{const{children:t,className:n,focusable:i=!0,ref:r,...s}=e,o=typeof t=="string";return a.jsx(lNe,{ref:r,...s,className:Qi(fIe.TriggerDecorator,n),tabIndex:i?0:void 0,children:o?a.jsx("span",{children:t}):t})};ka.Root=hIe;ka.Content=pIe;ka.Trigger=Kht;ka.TriggerDecorator=Ght;const Xht=50,Aee=48;function Yht(e){return(e.events??[]).flatMap(t=>{var r,s;const i=(((r=t.content)==null?void 0:r.parts)??[]).map(o=>typeof o.text=="string"?o.text:"").filter(Boolean).join("");return i?[{text:i,role:t.author??((s=t.content)==null?void 0:s.role)??"",ts:t.timestamp}]:[]})}function Zht(e){var t,n;for(const i of e.events??[])if(i.author==="user"||((t=i.content)==null?void 0:t.role)==="user"){const r=(((n=i.content)==null?void 0:n.parts)??[]).map(s=>s.text).find(Boolean);if(r)return r}return Q("search.untitledSession")}function Jht(e,t,n){const i=Math.max(0,t-Aee),r=Math.min(e.length,t+n+Aee);return(i>0?"…":"")+e.slice(i,r).trim()+(r{var c;if((c=l.events)!=null&&c.length)return l;try{return await aC(t,e,l.id)}catch{return l}})),o=[];for(const l of s)for(const{text:c,role:u,ts:d}of Yht(l)){const f=c.toLowerCase().indexOf(i);if(f!==-1){o.push({type:"session",appId:t,sessionId:l.id,title:Zht(l),snippet:Jht(c,f,i.length),role:u,ts:d??l.lastUpdateTime});break}}return o.sort((l,c)=>(c.ts??0)-(l.ts??0)),o.slice(0,Xht)}async function tpt(e,t){if(!e||!t.trim())return{results:[]};let n;try{n=await OTe(e,t.trim())}catch(o){const l=String(o);return{results:[],note:l.includes("404")?Q("search.webUnavailable"):Q("search.webFailed",{message:l})}}const{mounted:i,results:r,error:s}=n;return i?s?{results:[],note:s}:{results:r.map((o,l)=>({type:"web",index:l,title:o.title,url:o.url,siteName:o.siteName,summary:o.summary}))}:{results:[],note:Q("search.webNotMounted")}}async function npt(e,t,n,i){if(!t||!i.trim())return{results:[]};const r=await wTe(t,e,i.trim(),n);if(!r.mounted)return{results:[],note:Q(e==="knowledge"?"search.knowledgeNotMounted":"search.memoryNotMounted")};if(r.error)return{results:[],note:r.error};const s=r.sourceName??Q(e==="knowledge"?"search.knowledge":"search.longTermMemory");return{results:r.results.map((o,l)=>e==="knowledge"?{type:"knowledge",index:l,content:o.content,sourceName:s,sourceType:r.sourceType}:{type:"memory",index:l,content:o.content,sourceName:s,sourceType:r.sourceType,author:o.author,ts:o.timestamp})}}async function ipt(e,t,n){return e==="session"?{results:await ept(n.userId,n.appId,t)}:e==="web"?tpt(n.appId,t):npt(e,n.appId,n.userId,t)}function mIe({mirrored:e=!1}){return a.jsxs("g",{opacity:"0.5",transform:e?"translate(20 0) scale(-1 1)":void 0,children:[a.jsx("path",{className:"sidebar-panel-glyph__divider",d:"M5.938 6.833c.11 0 .249.102.249.292v6.042c0 .19-.14.291-.249.291s-.248-.101-.248-.291V7.125c0-.19.139-.292.248-.292Z",strokeWidth:"1.167"}),a.jsx("path",{className:"sidebar-panel-glyph__frame",d:"M14.5 3.75h-9a3 3 0 0 0-3 3v6.857a3 3 0 0 0 3 3h9a3 3 0 0 0 3-3V6.75a3 3 0 0 0-3-3Z",strokeWidth:"1.667",strokeLinecap:"round",strokeLinejoin:"round"})]})}function rpt(e){return a.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",...e,children:a.jsx(mIe,{})})}function spt(e){return a.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",...e,children:a.jsx(mIe,{mirrored:!0})})}function apt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 8.333c.368 0 .667.299.667.667v2h2a.667.667 0 0 1 0 1.333h-2v2a.667.667 0 0 1-1.334 0v-2h-2a.667.667 0 0 1 0-1.333h2V9c0-.368.299-.667.667-.667ZM7.667 1c3.49 0 6.383 2.554 6.913 5.896a.667.667 0 0 1-1.317.208 5.667 5.667 0 1 0-9.708 4.424.67.67 0 0 1 .07.12.667.667 0 0 1-.13.834l-.95.853 4.788-.002a.667.667 0 0 1 0 1.334l-5.657.002c-.917 0-1.35-1.131-.67-1.744l1.163-1.045A6.97 6.97 0 0 1 .667 8c0-3.866 3.134-7 7-7Z",fill:"currentColor"})})}function opt(e){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.333",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"7.333",cy:"7.333",r:"5.333"}),a.jsx("path",{d:"m11.133 11.133 2.867 2.867"})]})}function lpt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M8 0.667c4.05 0 7.334 3.283 7.334 7.333 0 4.05-3.284 7.334-7.334 7.334S0.667 12.05 0.667 8 3.95 0.667 8 0.667Zm0 1.333a6 6 0 1 0 0 12A6 6 0 0 0 8 2ZM6.167 6c.368 0 .667.299.667.667v2a.667.667 0 0 1-1.334 0v-2c0-.368.299-.667.667-.667Zm3.666 0c.368 0 .667.299.667.667v2a.667.667 0 0 1-1.333 0v-2c0-.368.298-.667.666-.667Z",fill:"currentColor"})})}function gIe(e){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M7.58 2.6a.667.667 0 0 0-.667-.667h-.666a.667.667 0 0 0-.667.667v10.667c0 .368.299.666.667.666h.666a.667.667 0 0 0 .667-.666V2.6Zm1.333 10.667A2 2 0 0 1 6.913 15.267h-.666a2 2 0 0 1-2-2V2.6a2 2 0 0 1 2-2h.666a2 2 0 0 1 2 2v10.667Z",fill:"currentColor"}),a.jsx("path",{d:"M11.88 5.045a.667.667 0 0 0-.801-.514l-.653.136a.667.667 0 0 0-.504.786l1.85 8.092c.081.358.44.589.8.514l.653-.137a.667.667 0 0 0 .504-.786L11.88 5.045Zm3.155 7.82a2 2 0 0 1-1.512 2.358l-.653.136a2 2 0 0 1-2.403-1.541L8.617 5.726a2 2 0 0 1 1.513-2.358l.652-.136a2 2 0 0 1 2.404 1.541l1.849 8.092Z",fill:"currentColor"}),a.jsx("path",{d:"M4.247 2.6a.667.667 0 0 0-.667-.667h-.667a.667.667 0 0 0-.666.667v10.667c0 .368.298.666.666.666h.667a.667.667 0 0 0 .667-.666V2.6ZM5.58 13.267a2 2 0 0 1-2 2h-.667a2 2 0 0 1-2-2V2.6a2 2 0 0 1 2-2h.667a2 2 0 0 1 2 2v10.667Z",fill:"currentColor"})]})}function bIe(e){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M3.25 2.25h6l3.5 3.5v8H3.25v-11Z"}),a.jsx("path",{d:"M9.25 2.25v3.5h3.5M5.5 8.25h5M5.5 10.75h4"})]})}function cpt({className:e="icon"}){return a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[a.jsx("path",{d:"M16.4 10.7a5.7 5.7 0 1 1-1.67-4.03"}),a.jsx("path",{d:"M15.25 15.25 19.6 19.6"})]})}function upt({open:e}){return a.jsx("svg",{className:`search-source-chevron ${e?"open":""}`,viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:a.jsx("path",{d:"m3.25 4.75 2.75 2.5 2.75-2.5"})})}function dpt({active:e=!1,onClick:t}){const{t:n}=Te("workspaceTools");return a.jsxs("button",{className:`new-chat${e?" is-active":""}`,onClick:t,"aria-label":n("search.nav"),"aria-current":e?"page":void 0,title:n("search.nav"),children:[a.jsx(opt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:n("search.nav")})]})}function fpt(e,t,n,i){const r=!!e,s=new Set((t==null?void 0:t.searchSources)??[]),o=l=>r?n?i("search.checkingCapabilities"):i("search.notMounted",{label:l}):i("search.selectAgent");return[{id:"session",label:i("search.sources.session"),ready:r,unavailableLabel:i("search.selectAgent")},{id:"web",label:i("search.sources.web"),ready:r&&s.has("web"),description:i("search.webDescription"),unavailableLabel:o(" web_search")},{id:"knowledge",label:i("search.sources.knowledge"),ready:r&&s.has("knowledge"),unavailableLabel:o(i("search.sources.knowledge"))},{id:"memory",label:i("search.sources.memory"),ready:r&&s.has("memory"),unavailableLabel:o(i("search.sources.memory"))}]}function mI(e,t){return{context_search:"Context Search",local:t("search.backendLocal"),mem0:"Mem0",milvus:"Milvus",opensearch:"OpenSearch",openviking:"OpenViking",redis:"Redis",tos_vector:"TOS Vector",viking:"VikingDB"}[e.toLowerCase()]??e}function Tee(e,t){return e?new Date(e*1e3).toLocaleString(t,{timeZone:"Asia/Shanghai",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):""}function hpt({userId:e,appId:t,agentInfo:n,capabilitiesLoading:i,agentLabel:r,onOpenSession:s}){var L,F;const{t:o,i18n:l}=Te("workspaceTools"),c=l.resolvedLanguage||l.language,[u,d]=p.useState("session"),[f,h]=p.useState(""),[m,g]=p.useState([]),[b,v]=p.useState(),[y,w]=p.useState(!1),[x,O]=p.useState(!1),[k,S]=p.useState(!1),C=p.useRef(0),E=p.useRef(null),j=fpt(t,n,i,o),T=j.find(M=>M.id===u),R=u==="knowledge"?(L=n==null?void 0:n.components)==null?void 0:L.find(M=>M.source==="knowledgebase"||M.kind==="knowledgebase"):u==="memory"?(F=n==null?void 0:n.components)==null?void 0:F.find(M=>M.source==="long_term_memory"||M.kind==="memory"):void 0;p.useEffect(()=>{C.current+=1,d("session"),g([]),v(void 0),O(!1),w(!1),S(!1)},[t]),p.useEffect(()=>{if(!k)return;function M(V){var q;(q=E.current)!=null&&q.contains(V.target)||S(!1)}return document.addEventListener("pointerdown",M),()=>document.removeEventListener("pointerdown",M)},[k]);async function A(M,V){var z;const q=M.trim();if(!q||!((z=j.find(ee=>ee.id===V))!=null&&z.ready))return;const U=++C.current;w(!0),O(!0);let Z;try{Z=await ipt(V,q,{userId:e,appId:t})}catch(ee){const ne=ee instanceof Error?ee.message:String(ee);Z={results:[],note:o("search.failed",{message:ne})}}U===C.current&&(g(Z.results),v(Z.note),w(!1))}function N(M){C.current+=1,h(M),g([]),v(void 0),O(!1),w(!1)}function D(M){C.current+=1,d(M),S(!1),g([]),v(void 0),O(!1),w(!1)}const I=!!(T!=null&&T.ready),P=t?u==="web"?o("search.placeholder.web"):u==="knowledge"?o("search.placeholder.knowledge",{name:(R==null?void 0:R.name)??o("search.placeholder.knowledgeFallback")}):u==="memory"?o("search.placeholder.memory",{name:(R==null?void 0:R.name)??o("search.placeholder.memoryFallback")}):o("search.placeholder.session"):o("search.placeholder.selectAgent"),_=R!=null&&R.backend?mI(R.backend,o):"";return a.jsxs("div",{className:"search",children:[a.jsxs("div",{className:"search-box",children:[a.jsxs("div",{className:"search-source-picker-wrap",ref:E,children:[a.jsxs("button",{className:"search-source-picker",type:"button","aria-label":o("search.sourceTypeAria",{label:(T==null?void 0:T.label)??o("search.notSelected")}),"aria-haspopup":"listbox","aria-expanded":k,onClick:()=>S(M=>!M),children:[a.jsx("span",{children:(T==null?void 0:T.label)??o("search.sourceType")}),_&&a.jsx("small",{children:_}),a.jsx(upt,{open:k})]}),k&&a.jsx("div",{className:"search-source-menu",role:"listbox","aria-label":o("search.selectSource"),children:j.map(M=>{var U,Z;const V=M.id==="knowledge"?(U=n==null?void 0:n.components)==null?void 0:U.find(z=>z.source==="knowledgebase"||z.kind==="knowledgebase"):M.id==="memory"?(Z=n==null?void 0:n.components)==null?void 0:Z.find(z=>z.source==="long_term_memory"||z.kind==="memory"):void 0,q=V?[V.name,V.backend?mI(V.backend,o):""].filter(Boolean).join(" · "):M.ready?M.description:M.unavailableLabel;return a.jsxs("button",{type:"button",role:"option","aria-selected":u===M.id,disabled:!M.ready,onClick:()=>D(M.id),children:[a.jsx("span",{children:M.label}),q&&a.jsx("small",{children:q})]},M.id)})})]}),a.jsx("span",{className:"search-box-divider","aria-hidden":!0}),a.jsx("input",{className:"search-input",value:f,onChange:M=>N(M.target.value),onKeyDown:M=>{M.key==="Enter"&&(M.preventDefault(),A(f,u))},placeholder:P,disabled:!I,autoFocus:!0}),a.jsx("button",{className:"search-go",onClick:()=>void A(f,u),disabled:!f.trim()||y,"aria-label":o("search.nav"),children:y?a.jsx(Bi,{className:"icon spin"}):a.jsx(cpt,{className:"icon"})})]}),a.jsx("div",{className:"search-results",children:I?x?y?null:b?a.jsx("div",{className:"search-empty",children:b}):m.length===0&&x?a.jsx("div",{className:"search-empty",children:o("search.noResults",{query:f.trim()})}):m.map((M,V)=>a.jsx(ppt,{result:M,agentLabel:r,onOpen:s,locale:c},V)):a.jsx("div",{className:"search-empty",children:o(u==="web"?"search.instructions.web":u==="knowledge"?"search.instructions.knowledge":u==="memory"?"search.instructions.memory":"search.instructions.session")}):a.jsx("div",{className:"search-empty",children:t?i?o("search.loadingCapabilities"):(T==null?void 0:T.unavailableLabel)??o("search.sourceUnavailable"):o("search.noAgentHint")})})]})}function ppt({result:e,agentLabel:t,onOpen:n,locale:i}){const{t:r}=Te("workspaceTools");switch(e.type){case"session":return a.jsxs("button",{className:"search-result",onClick:()=>n(e.appId,e.sessionId),children:[a.jsx(Uje,{className:"search-result-icon"}),a.jsxs("div",{className:"search-result-body",children:[a.jsxs("div",{className:"search-result-head",children:[a.jsx("span",{className:"search-result-title",children:e.title}),a.jsxs("span",{className:"search-result-meta",children:[t(e.appId),e.ts?` · ${Tee(e.ts,i)}`:""]})]}),a.jsx("div",{className:"search-result-snippet",children:e.snippet})]})]});case"web":return a.jsxs("a",{className:"search-result",href:e.url||void 0,target:"_blank",rel:"noreferrer noopener",children:[a.jsx(nM,{className:"search-result-icon"}),a.jsxs("div",{className:"search-result-body",children:[a.jsxs("div",{className:"search-result-head",children:[a.jsx("span",{className:"search-result-title",children:e.title||e.url}),a.jsxs("span",{className:"search-result-meta",children:[e.siteName,e.url&&a.jsx(m0,{className:"search-result-ext"})]})]}),e.summary&&a.jsx("div",{className:"search-result-snippet",children:e.summary})]})]});case"knowledge":return a.jsxs("div",{className:"search-result search-result-static",children:[a.jsx(_ee,{source:"knowledge"}),a.jsxs("div",{className:"search-result-body",children:[a.jsxs("div",{className:"search-result-head",children:[a.jsx("span",{className:"search-result-title",children:r("search.knowledgeFragment",{index:e.index+1})}),a.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${mI(e.sourceType,r)}`:""]})]}),a.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});case"memory":return a.jsxs("div",{className:"search-result search-result-static",children:[a.jsx(_ee,{source:"memory"}),a.jsxs("div",{className:"search-result-body",children:[a.jsxs("div",{className:"search-result-head",children:[a.jsx("span",{className:"search-result-title",children:r("search.memoryFragment",{index:e.index+1})}),a.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${mI(e.sourceType,r)}`:"",e.ts?` · ${Tee(e.ts,i)}`:""]})]}),a.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});default:return null}}function _ee({source:e,className:t="search-result-icon"}){return e==="knowledge"?a.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[a.jsx("path",{d:"M5 5.5h10.5A3.5 3.5 0 0 1 19 9v9.5H8.5A3.5 3.5 0 0 1 5 15V5.5Z"}),a.jsx("path",{d:"M8.25 9h7.5M8.25 12.25h6"})]}):a.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[a.jsx("path",{d:"M12 4.5a7.5 7.5 0 1 0 7.5 7.5"}),a.jsx("path",{d:"M12 8a4 4 0 1 0 4 4M12 11.3a.7.7 0 1 0 0 1.4.7.7 0 0 0 0-1.4Z"})]})}function mpt({filled:e=!1,...t}){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:e?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[a.jsx("rect",{x:"3.5",y:"9.3",width:"4.5",height:"10.2",rx:"1.5"}),a.jsx("path",{d:"M8 10.2 11.3 4.8c.5-.8 1.7-.45 1.7.5v3.8h4.2a2.1 2.1 0 0 1 2.04 2.6l-1.4 5.75A2.1 2.1 0 0 1 15.8 19H8"})]})}function gpt({filled:e=!1,...t}){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:e?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"4.5",height:"10.2",rx:"1.5"}),a.jsx("path",{d:"M8 13.8 11.3 19.2c.5.8 1.7.45 1.7-.5v-3.8h4.2a2.1 2.1 0 0 0 2.04-2.6l-1.4-5.75A2.1 2.1 0 0 0 15.8 5H8"})]})}function yIe(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5.25 4.25h9.5a2.5 2.5 0 0 1 2.5 2.5v3.5"}),a.jsx("path",{d:"M13.25 17.75h-8a2.5 2.5 0 0 1-2.5-2.5v-8a3 3 0 0 1 3-3"}),a.jsx("path",{d:"M7 8.25h5.5M7 11.75h3.25"}),a.jsx("path",{d:"m13.35 16.65.42-2.16 4.76-4.76a1.35 1.35 0 0 1 1.91 1.91l-4.76 4.76-2.33.25Z"}),a.jsx("path",{d:"m17.65 10.6 1.9 1.9"})]})}const pM="/assets/media/logo-DCsNZy-k.svg",oH="data:image/svg+xml,%3csvg%20width='28'%20height='23'%20viewBox='0%200%2028%2023'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M17.1957%209.44218C17.0253%209.58161%2016.7774%209.47317%2016.7774%209.24079V8.01696V0.611967C16.7774%200.395085%2016.514%200.271152%2016.3591%200.410576L6.04172%209.16334C5.87132%209.30276%205.62345%209.19432%205.62345%208.96194V2.98218C5.62345%202.81178%205.48403%202.67235%205.31362%202.67235H0.309832C0.139424%202.67235%200%202.81178%200%202.98218V21.7115C0%2021.9284%200.263357%2022.0524%200.418273%2021.9129L10.7202%2013.1602C10.8906%2013.0207%2011.1385%2013.1292%2011.1385%2013.3616V22.0059C11.1385%2022.2228%2011.4018%2022.3467%2011.5567%2022.2073L21.8586%2013.4545C22.0291%2013.3151%2022.2769%2013.4235%2022.2769%2013.6559V19.6357C22.2769%2019.8061%2022.4163%2019.9455%2022.5868%2019.9455H27.5905C27.7609%2019.9455%2027.9004%2019.8061%2027.9004%2019.6357V0.890816C27.9004%200.673934%2027.637%200.550001%2027.4821%200.689425L17.1957%209.44218Z'%20fill='%230066FC'/%3e%3c/svg%3e";function bpt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M8.5 4.5H6a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-13a2 2 0 0 0-2-2h-2.5"}),a.jsx("rect",{x:"8.5",y:"2.5",width:"7",height:"4",rx:"1.5"}),a.jsx("path",{d:"m8 13 2.5 2.5L16 10"})]})}const jee="(max-width: 860px)";function Nee({title:e}){const t=p.useRef(null),n=p.useRef(null),[i,r]=p.useState(0);p.useLayoutEffect(()=>{const l=t.current,c=n.current;if(!l||!c)return;const u=()=>{const f=Math.max(0,Math.ceil(c.scrollWidth-l.clientWidth));r(h=>h===f?h:f)};u();const d=new ResizeObserver(u);return d.observe(l),d.observe(c),()=>d.disconnect()},[e]);const s=Math.min(12,Math.max(4.8,3.6+i/36)),o={"--history-title-translate":`-${i}px`,"--history-title-duration":`${s.toFixed(2)}s`};return a.jsx("span",{ref:t,className:`history-title${i>0?" is-overflowing":""}`,style:o,children:a.jsx("span",{ref:n,className:"history-title-text",children:e})})}function ypt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"7",cy:"7",r:"2.25"}),a.jsx("circle",{cx:"17",cy:"7",r:"2.25"}),a.jsx("circle",{cx:"7",cy:"17",r:"2.25"}),a.jsx("circle",{cx:"17",cy:"17",r:"2.25"})]})}function vpt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"12",cy:"12",r:"8.25"}),a.jsx("path",{d:"M3.75 12h16.5M12 3.75c2.1 2.2 3.2 4.95 3.2 8.25S14.1 18.05 12 20.25M12 3.75C9.9 5.95 8.8 8.7 8.8 12s1.1 6.05 3.2 8.25"})]})}function xpt(e){let t=2166136261;for(const i of e)t^=i.charCodeAt(0),t=Math.imul(t,16777619);const n=t>>>0;return{"--avatar-hue-a":194+n%22,"--avatar-hue-b":214+(n>>>6)%25,"--avatar-hue-c":176+(n>>>12)%25,"--avatar-x":`${22+(n>>>18)%55}%`,"--avatar-y":`${18+(n>>>24)%58}%`}}const wpt={super_admin:"account.roles.super_admin",admin:"account.roles.admin",developer:"account.roles.developer",user:"account.roles.user"};function Opt({activePage:e,access:t,userInfo:n,onAgentKitCli:i,onDeveloperResources:r,onSystemInfo:s,onIssueFeedback:o,onLogout:l}){const{t:c,i18n:u}=Te(["sidebar","common"]),[d,f]=p.useState("");if(!n)return null;const h=wet(n)||c("sidebar:account.defaultUser"),m=typeof n.email=="string"?n.email.trim():"",g=xpt(h),b=Oet(n),v=b===d?"":b,y=xA(u.resolvedLanguage??u.language)??vA;return a.jsx("div",{className:"sidebar-user",children:a.jsxs("div",{className:"sidebar-user-row",children:[a.jsxs(er,{modal:!0,children:[a.jsx(er.Trigger,{children:a.jsxs("button",{type:"button",className:"sidebar-user-btn",title:h,children:[a.jsx("span",{className:`account-avatar${v?" has-image":""}`,style:g,"aria-hidden":"true",children:v?a.jsx("img",{className:"account-avatar-image",src:v,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>f(v)}):null}),a.jsx("span",{className:"sidebar-user-identity",children:a.jsx("span",{className:"sidebar-user-name",children:h})})]})}),a.jsxs(er.Content,{side:"top",align:"start",sideOffset:4,minWidth:216,children:[a.jsxs("div",{className:"account-menu-head",children:[a.jsx("span",{className:`account-avatar account-avatar--lg${v?" has-image":""}`,style:g,"aria-hidden":"true",children:v?a.jsx("img",{className:"account-avatar-image",src:v,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>f(v)}):null}),a.jsxs("div",{className:"account-id",children:[a.jsxs("div",{className:"account-name-row",children:[a.jsx("div",{className:"account-name",children:h}),a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",pill:!0,children:c(`sidebar:${wpt[t.role]}`)})]}),m&&m!==h&&a.jsx("div",{className:"account-sub",children:m})]})]}),a.jsxs(er.Item,{className:"account-menu-action",onSelect:s,children:[a.jsx(mm,{className:"icon","aria-hidden":"true"}),c("sidebar:account.systemInfo")]}),a.jsxs(er.Sub,{children:[a.jsx(er.SubTrigger,{className:"account-menu-action",children:a.jsxs("span",{className:"account-menu-action__label",children:[a.jsx(vpt,{className:"icon"}),c("sidebar:account.language")]})}),a.jsx(er.SubContent,{sideOffset:6,minWidth:136,children:a.jsx(er.RadioGroup,{value:y,onChange:w=>{_qe(w)},indicatorPosition:"end",children:NU.map(w=>a.jsx(er.RadioItem,{value:w,children:c(`common:languageNames.${w}`)},w))})})]}),a.jsxs(er.Item,{className:"account-menu-action",onSelect:o,children:[a.jsx(yIe,{className:"icon"}),c("sidebar:account.issueFeedback")]}),a.jsxs(er.Item,{className:"account-menu-action",onSelect:l,children:[a.jsx(Vat,{className:"icon","aria-hidden":"true"}),c("sidebar:account.logout")]})]})]}),a.jsxs("div",{className:"sidebar-user-shortcuts","aria-label":c("sidebar:account.shortcuts"),children:[a.jsx(ka,{compact:!0,content:c("sidebar:account.tryCli"),children:a.jsx("button",{type:"button",className:"sidebar-user-shortcut",onClick:i,"aria-label":c("sidebar:account.tryCli"),children:a.jsx(lat,{className:"icon"})})}),a.jsx(ka,{compact:!0,content:c("sidebar:account.developerResources"),children:a.jsx("button",{type:"button",className:`sidebar-user-shortcut${e==="developer-resources"?" is-active":""}`,onClick:r,"aria-label":c("sidebar:account.developerResources"),"aria-current":e==="developer-resources"?"page":void 0,children:a.jsx(Xst,{className:"icon"})})})]})]})})}function kpt({branding:e,cloudProvider:t,sessions:n,currentSessionId:i,activePage:r,features:s,access:o,streamingSids:l,evaluatingSids:c,sandboxHistory:u,onNewChat:d,onSearch:f,onQuickCreate:h,onLibrary:m,onReviewCenter:g,onAddAgent:b,onMyAgents:v,onWorkspace:y,onApplications:w,onCronJobs:x,onAgentKitCli:O,onDeveloperResources:k,onSystemInfo:S,onUserManagement:C,onIssueFeedback:E,onPickSession:j,onDeleteSession:T,userInfo:R,onLogout:A}){const{t:N}=Te("sidebar"),D=z=>(s==null?void 0:s[z])!==!1,I=o.role==="admin"||o.role==="super_admin",P=o.capabilities.manageUsers&&!!C,[_,L]=p.useState(null),F=p.useRef(typeof window<"u"&&window.matchMedia(jee).matches),[M,V]=p.useState(F.current),q=n.map(z=>({id:z.id,title:z.title||iM(z.events,N("history.newConversation")),createdAt:(z.lastUpdateTime??0)*1e3})).sort((z,ee)=>ee.createdAt-z.createdAt),U=()=>{F.current=!1,V(z=>!z),L(null)};p.useEffect(()=>{const z=window.matchMedia(jee),ee=ne=>{ne.matches?V(W=>W||(F.current=!0,!0)):F.current&&(F.current=!1,V(!1))};return z.addEventListener("change",ee),()=>z.removeEventListener("change",ee)},[]);const Z=t==="byteplus"?oH:pM;return a.jsxs("aside",{className:`sidebar ${M?"is-collapsed":""}`,children:[a.jsxs("div",{className:"sidebar-top",children:[a.jsxs("div",{className:"sidebar-brand-row",children:[a.jsxs("button",{type:"button",className:"brand",onClick:d,"aria-label":N("navigation.home"),title:N("navigation.home"),children:[a.jsx("img",{className:"brand-logo",src:e.logoUrl||Z,width:20,height:20,alt:"","aria-hidden":!0}),a.jsx("span",{className:"brand-title",children:e.title})]}),a.jsx("button",{type:"button",className:"sidebar-collapse-toggle",onClick:U,"aria-label":N(M?"navigation.expand":"navigation.collapse"),title:N(M?"navigation.expand":"navigation.collapse"),children:M?a.jsx(spt,{className:"icon"}):a.jsx(rpt,{className:"icon"})})]}),a.jsxs("nav",{className:"sidebar-nav","aria-label":N("navigation.label"),children:[D("newChat")&&a.jsxs("button",{className:`new-chat new-chat--conversation${r==="new-chat"?" is-active":""}`,onClick:d,"aria-label":N("navigation.newChat"),"aria-current":r==="new-chat"?"page":void 0,title:N("navigation.newChat"),children:[a.jsx(apt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.newChat")})]}),D("search")&&a.jsx(dpt,{active:r==="search",onClick:f}),a.jsxs("button",{className:`new-chat new-chat--agents${r==="agents"?" is-active":""}`,onClick:v,"aria-label":N("navigation.agents"),"aria-current":r==="agents"?"page":void 0,title:N("navigation.agents"),children:[a.jsx(lpt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.agents")})]}),a.jsxs("button",{className:`new-chat new-chat--workspaces${r==="workspaces"?" is-active":""}`,onClick:y,"aria-label":N("navigation.workspaces"),"aria-current":r==="workspaces"?"page":void 0,title:N("navigation.workspaces"),children:[a.jsx(Sat,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.workspaces")})]}),a.jsxs("button",{className:`new-chat new-chat--library${r==="library"?" is-active":""}`,onClick:m,"aria-label":N("navigation.library"),"aria-current":r==="library"?"page":void 0,title:N("navigation.library"),children:[a.jsx(gIe,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.library")})]}),a.jsxs("button",{className:`new-chat new-chat--cronjobs${r==="cronjobs"?" is-active":""}`,onClick:x,"aria-label":N("navigation.cronjobs"),"aria-current":r==="cronjobs"?"page":void 0,title:N("navigation.cronjobs"),children:[a.jsx(pV,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.cronjobs")})]}),a.jsxs("button",{className:`new-chat new-chat--applications${r==="applications"?" is-active":""}`,onClick:w,"aria-label":N("navigation.automations"),"aria-current":r==="applications"?"page":void 0,title:N("navigation.automations"),children:[a.jsx(ypt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.automations")})]})]}),I||P?a.jsxs("nav",{className:"sidebar-nav sidebar-nav--administration","aria-label":N("navigation.administration"),children:[a.jsx("div",{className:"sidebar-nav-group-title","aria-hidden":"true",children:N("navigation.administration")}),I?a.jsxs("button",{type:"button",className:`new-chat new-chat--review-center${r==="review-center"?" is-active":""}`,onClick:g,"aria-label":N("navigation.reviewCenter"),"aria-current":r==="review-center"?"page":void 0,title:N("navigation.reviewCenter"),children:[a.jsx(bpt,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.reviewCenter")})]}):null,P?a.jsxs("button",{type:"button",className:`new-chat${r==="users"?" is-active":""}`,onClick:C,"aria-label":N("navigation.users"),"aria-current":r==="users"?"page":void 0,title:N("navigation.users"),children:[a.jsx(Bot,{className:"icon"}),a.jsx("span",{className:"sidebar-nav-label",children:N("navigation.users")})]}):null]}):null]}),D("history")&&a.jsxs("div",{className:"sidebar-history",children:[a.jsxs("div",{className:"history-head",children:[a.jsx("span",{children:N("history.title")}),D("newChat")&&a.jsx("button",{type:"button",className:"history-new-chat",onClick:(u==null?void 0:u.onNew)??d,disabled:u==null?void 0:u.newDisabled,"aria-label":N("history.create"),title:N("history.create"),children:a.jsx(ic,{className:"icon"})})]}),a.jsx("div",{className:"history-list",children:u?a.jsxs(a.Fragment,{children:[u.loading&&u.threads.length===0?a.jsx("div",{className:"history-empty",role:"status",children:N("history.loading")}):null,u.error?a.jsx("div",{className:"history-error",role:"alert",children:u.error}):null,!u.loading&&!u.error&&u.threads.length===0?a.jsx("div",{className:"history-empty",children:N("history.empty")}):null,u.threads.map(z=>{const ee=z.id===u.currentThreadId,ne=z.name||z.preview||`Thread ${z.id.slice(0,8)}`,W=z.id===u.busyThreadId;return a.jsxs("div",{className:`history-item ${ee?"active":""}`,children:[a.jsxs("button",{type:"button",className:"history-item-btn",onClick:()=>u.onSelect(z.id),"aria-current":ee?"page":void 0,title:ne,disabled:W,children:[a.jsx(Nee,{title:ne}),ee?a.jsx("span",{className:"history-current-badge",children:N("history.current")}):null]}),a.jsx("button",{type:"button",className:"history-more","aria-label":N("history.manage",{title:ne}),title:N("history.more"),disabled:W,onClick:()=>L(X=>X===z.id?null:z.id),children:a.jsx(GJ,{className:"icon"})}),_===z.id?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"menu-scrim",onClick:()=>L(null)}),a.jsx("div",{className:"history-menu",children:a.jsxs("button",{type:"button",className:"menu-item menu-item--danger",onClick:()=>{L(null),u.onDelete(z)},children:[a.jsx(eb,{className:"icon"})," ",N("history.delete")]})})]}):null]},z.id)}),u.hasMore?a.jsx("button",{type:"button",className:"history-load-more",disabled:u.loading,onClick:u.onLoadMore,children:u.loading?N("history.loadingMore"):N("history.loadMore")}):null]}):a.jsxs(a.Fragment,{children:[q.length===0?a.jsx("div",{className:"history-empty",children:N("history.empty")}):null,q.map(z=>{const ee=z.id===i,ne=(l==null?void 0:l.has(z.id))===!0,W=!ne&&(c==null?void 0:c.has(z.id))===!0;return a.jsxs("div",{className:`history-item ${ee?"active":""}`,children:[a.jsxs("button",{className:"history-item-btn",onClick:()=>j(z.id),"aria-current":ee?"page":void 0,title:z.title,children:[a.jsx(Nee,{title:z.title}),W&&a.jsxs("span",{className:"history-evaluating-status",title:N("history.evaluatingTitle"),children:[a.jsx("span",{className:"history-evaluating","aria-hidden":"true"}),N("history.evaluating")]})]}),a.jsxs("div",{className:"history-action-slot",children:[ne?a.jsx(KA,{className:"history-streaming-indicator",size:12,role:"status","aria-label":N("history.generating")}):null,a.jsx("button",{type:"button",className:"history-more","aria-label":N("history.manage",{title:z.title}),title:N("history.more"),onClick:()=>L(X=>X===z.id?null:z.id),children:a.jsx(GJ,{className:"icon"})})]}),_===z.id&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"menu-scrim",onClick:()=>L(null)}),a.jsx("div",{className:"history-menu",children:a.jsxs("button",{type:"button",className:"menu-item menu-item--danger",onClick:()=>{L(null),T(z.id)},children:[a.jsx(eb,{className:"icon"})," ",N("history.delete")]})})]})]},z.id)})]})})]}),a.jsx("div",{className:"sidebar-footer",children:a.jsx(Opt,{activePage:r,access:o,userInfo:R,onAgentKitCli:O,onDeveloperResources:k,onSystemInfo:S,onIssueFeedback:E,onLogout:A})})]})}const Spt={name:"studio_share_space"},Ept={name:"studio_review_space"},vIe={share:Spt,review:Ept},Cpt=vIe.share.name,xIe=vIe.review.name,Apt=[Cpt,xIe];function wIe(e){return Apt.includes(e.trim().toLowerCase())}function Tpt(e){return e.name===xIe}const _pt="/web/skill-management";class t1 extends Error{constructor(t,n,i="SKILL_MANAGEMENT_ERROR",r="",s,o=""){super(t),this.status=n,this.code=i,this.statusText=r,this.originalError=s,this.rawResponse=o,this.name="SkillManagementApiError"}}async function dc(e,t={},n=ho){return fetch(Ta(`${_pt}${e}`),{...t,headers:ul(uc(t.headers)),signal:po(t.signal,n)})}async function iT(e,t){let n=t,i="SKILL_MANAGEMENT_ERROR",r;const s=await e.text().catch(()=>"");try{const o=JSON.parse(s);typeof o.detail=="string"?n=o.detail:o.detail&&(n=o.detail.message||t,i=o.detail.code||i,r=o.detail.originalError)}catch{s.trim()&&(n=Q("common.fallbackWithDetail",{fallback:t,detail:s.trim()}))}return new t1(n,e.status,i,e.statusText,r,s)}async function fc(e,t){if(!e.ok)throw await iT(e,t);return e.json()}async function jpt(e){const t=new URLSearchParams({region:e.region,page:String(e.page),page_size:String(e.pageSize)});return e.project&&t.set("project",e.project),fc(await dc(`/spaces?${t}`,{signal:e.signal}),Q("skills.listSpacesFailed"))}async function Npt(e){if(wIe(e.name))throw new t1(Q("skills.reservedSpaceName"),409,"SKILL_SPACE_RESERVED_IDENTITY");return fc(await dc("/spaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Q("skills.createSpaceFailed"))}async function Rpt(e){const t=new URLSearchParams({region:e.region});return fc(await dc(`/shared-space/ensure?${t}`,{method:"POST",signal:e.signal}),Q("skills.sharedSpaceFailed"))}async function Ipt(e){return fc(await dc(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/review`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({region:e.region,version:e.version})},hr),Q("skills.submitReviewFailed"))}async function Ppt(e){const t=new URLSearchParams({region:e.region});return fc(await dc(`/reviews?${t}`,{signal:e.signal}),Q("skills.listReviewsFailed"))}async function Dpt(e){const t=new URLSearchParams({region:e.region});return fc(await dc(`/reviews/${encodeURIComponent(e.id)}/files?${t}`,{signal:e.signal},hr),Q("skills.reviewFilesFailed"))}async function Mpt(e){return fc(await dc(`/reviews/${encodeURIComponent(e.id)}/decision`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({region:e.region,decision:e.decision,reason:e.reason||"",comment:e.comment||""})},hr),Q("skills.decideReviewFailed"))}async function Lpt(e){const t=new URLSearchParams({region:e.region});return fc(await dc(`/spaces/${encodeURIComponent(e.spaceId)}/reviews?${t}`,{signal:e.signal}),Q("skills.listReviewsFailed"))}async function $pt(e){if(wIe(e.name))throw new t1(Q("skills.reservedSpaceName"),409,"SKILL_SPACE_RESERVED_IDENTITY");return fc(await dc(`/spaces/${encodeURIComponent(e.spaceId)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e.name,description:e.description,region:e.region})}),Q("skills.updateSpaceFailed"))}async function Fpt(e){const t=new URLSearchParams({region:e.region});await fc(await dc(`/spaces/${encodeURIComponent(e.spaceId)}?${t}`,{method:"DELETE"}),Q("skills.deleteSpaceFailed"))}async function Bpt(e){const t=new URLSearchParams({region:e.region});return e.project&&t.set("project",e.project),fc(await dc(`/spaces/${encodeURIComponent(e.spaceId)}/skills?${t}`,{method:"POST",headers:{"Content-Type":"application/zip"},body:e.file},hr),Q("skills.uploadFailed"))}async function Upt(e){return fc(await dc("/validate",{method:"POST",headers:{"Content-Type":"application/zip"},body:e},hr),Q("skills.validateFailed"))}async function Qpt(e){const t=new URLSearchParams({region:e.region});await fc(await dc(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}?${t}`,{method:"DELETE"}),Q("skills.deleteFailed"))}async function OIe(e){const t=new URLSearchParams({region:e.region});e.version&&t.set("version",e.version),e.skillSpaceName&&t.set("skill_space_name",e.skillSpaceName),e.skillName&&t.set("skill_name",e.skillName);const n=await fc(await dc(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/files?${t}`),Q("skills.listFilesFailed"));return Array.isArray(n.files)?n.files:[]}async function zpt(e){var l;const t=new URLSearchParams({region:e.region});e.version&&t.set("version",e.version),e.skillSpaceName&&t.set("skill_space_name",e.skillSpaceName),e.skillName&&t.set("skill_name",e.skillName);const n=await dc(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/archive?${t}`,{},hr);n.ok||await fc(n,Q("skills.downloadFailed"));const r=((l=(n.headers.get("content-disposition")||"").match(/filename="([^"]+)"/))==null?void 0:l[1])||`${e.fallbackName}.zip`,s=URL.createObjectURL(await n.blob()),o=document.createElement("a");o.href=s,o.download=r,o.click(),URL.revokeObjectURL(s)}bn.hasResourceBundle("en-US","create")||bn.addResourceBundle("en-US","create",the,!0,!0);bn.hasResourceBundle("zh-CN","create")||bn.addResourceBundle("zh-CN","create",ove,!0,!0);function Xt(e,t={}){return bn.t(e,{...t,ns:"create"})}function Dc(e){var t;return((t=e==null?void 0:e.displayName)==null?void 0:t.trim())||(e==null?void 0:e.name)||""}async function mM(e,t){const n=await fetch(Ta(e),{headers:ul(uc({accept:"application/json"})),signal:po(t,ho)});if(!n.ok)throw await iT(n,Xt("helpers.skills.agentKitRequestFailed"));return n.json()}async function kIe(){return((await mM("/web/skill-spaces")).items||[]).filter(t=>!Tpt(t))}async function SIe(e,t){const n=t?`?region=${encodeURIComponent(t)}`:"";return(await mM(`/web/skill-spaces/${encodeURIComponent(e)}/skills${n}`)).items||[]}async function EIe(e,t){const n=new URLSearchParams({region:t.region,page:String(t.page),page_size:String(t.pageSize)});return t.project&&n.set("project",t.project),mM(`/web/skill-spaces/${encodeURIComponent(e)}/skills?${n.toString()}`,t.signal)}async function Vpt(e,t,n,i,r,s,o){const l=[];n&&l.push(`version=${encodeURIComponent(n)}`),i&&l.push(`region=${encodeURIComponent(i)}`),r&&l.push(`project=${encodeURIComponent(r)}`),s&&l.push(`skill_name=${encodeURIComponent(s)}`),o&&l.push(`skill_space_name=${encodeURIComponent(o)}`);const c=l.length>0?`?${l.join("&")}`:"";return mM(`/web/skill-spaces/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}${c}`)}function Hpt(e,t){const n=jy(t);return{source:"skillspace",id:`ss:${e.id}/${n}/${t.version}`,name:t.skillName,description:t.skillDescription,folder:t.skillName,skillSpaceId:e.id,skillSpaceName:e.name,skillSpaceRegion:e.region,skillId:n,version:t.version}}function jy(e){return e.skillId||e.skillName}function qpt(e,t,n="volcengine"){return n==="byteplus"?"":`https://console.volcengine.com/agentkit/${(t||"cn-beijing")==="cn-beijing"?"cn":"cn-shanghai"}/skillspace/detail/${encodeURIComponent(e)}`}const Wpt="data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20overflow='visible'%20style='display:%20block;'%20width='7.93649'%20height='8'%20viewBox='0%200%207.93649%208'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20id='Resizer'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.21499%200L0%207.27273L0.721499%208L7.93649%200.727273L7.21499%200ZM6.86867%203.99988L3.98268%206.90897L4.70418%207.63625L7.59017%204.72715L6.86867%203.99988Z'%20fill='%23737A87'/%3e%3c/svg%3e";function CIe({className:e="",counter:t,maxHeight:n,...i}){return a.jsxs("div",{className:`studio-textarea ${e}`.trim(),"data-counter":t!=null||void 0,style:{maxHeight:n},children:[a.jsx("textarea",{...i,className:"studio-textarea__input"}),t!=null&&a.jsx("span",{className:"studio-textarea__counter",children:t}),a.jsx("img",{className:"studio-textarea__resizer",src:Wpt,alt:"","aria-hidden":"true"})]})}async function AIe(e,t,n){const i=new URLSearchParams({region:e.region}),r=await fetch(Ta(`/web/skill-management/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/document?${i}`),{...t,headers:ul(uc(t.headers)),signal:po(e.signal,n)});if(!r.ok)throw await iT(r,"SKILL_DOCUMENT_REQUEST_FAILED");return r.json()}function Kpt(e){return AIe(e,{},ho)}function Gpt(e){return AIe(e,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:e.content,baseVersion:e.baseVersion})},hr)}function Xpt({target:e,onClose:t,onSaved:n}){const{t:i}=Te("workspaceTools"),[r,s]=p.useState(null),[o,l]=p.useState(""),[c,u]=p.useState(!0),[d,f]=p.useState(!1),[h,m]=p.useState(""),[g,b]=p.useState(0),[v,y]=p.useState(!1),w=p.useId(),x=p.useRef(null),O=p.useRef(!1),k=p.useRef(!0),S=p.useRef({dirty:!1,onClose:t});S.current={dirty:r!==null&&o!==r.content,onClose:t};const C=p.useRef(null);function E(){O.current||(S.current.dirty?y(!0):S.current.onClose())}p.useEffect(()=>{var N,D;k.current=!0;const T=window.document.activeElement instanceof HTMLElement?window.document.activeElement:null,R=window.document.body.style.overflow;window.document.body.style.overflow="hidden",(D=(N=x.current)==null?void 0:N.querySelector("button"))==null||D.focus();function A(I){var _,L;if(I.isComposing||(I.key==="Escape"&&(I.preventDefault(),E()),I.key!=="Tab"))return;const P=Array.from(((_=x.current)==null?void 0:_.querySelectorAll('button:not([disabled]),textarea:not([disabled]),[tabindex="0"]'))??[]);P.length&&(I.shiftKey&&window.document.activeElement===P[0]?(I.preventDefault(),(L=P[P.length-1])==null||L.focus()):!I.shiftKey&&window.document.activeElement===P[P.length-1]&&(I.preventDefault(),P[0].focus()))}return window.addEventListener("keydown",A),()=>{var I;k.current=!1,(I=C.current)==null||I.abort(),window.removeEventListener("keydown",A),window.document.body.style.overflow=R,T!=null&&T.isConnected&&T.focus()}},[]),p.useEffect(()=>{const T=new AbortController;return u(!0),m(""),Kpt({...e,signal:T.signal}).then(R=>{T.signal.aborted||(s(R),l(R.content))}).catch(()=>{T.signal.aborted||m("documentLoadFailed")}).finally(()=>{T.signal.aborted||u(!1)}),()=>T.abort()},[e,g]);async function j(){if(O.current||!(r!=null&&r.canUpdate)||o===r.content||!o.trim())return;O.current=!0,f(!0),m("");const T=new AbortController;C.current=T;try{await Gpt({...e,content:o,baseVersion:r.baseVersion,signal:T.signal}),k.current&&(n(),t())}catch(R){k.current&&m(R instanceof t1&&R.status===409?"documentConflict":R instanceof t1&&R.status===403?"accessDenied":"documentSaveFailed")}finally{O.current=!1,k.current&&f(!1)}}return yi.createPortal(a.jsx("div",{className:"mpa-skill-editor-backdrop",children:a.jsxs("section",{className:"mpa-skill-editor",role:"dialog","aria-modal":"true","aria-labelledby":w,ref:x,children:[a.jsxs("header",{children:[a.jsxs("h2",{id:w,children:[e.name," · SKILL.md"]}),a.jsx(Ci,{variant:"ghost",disabled:d,onClick:E,children:i("agentTopology.close")})]}),a.jsx("p",{className:"mpa-skill-editor-hint",children:i("agentTopology.documentEditHint")}),c?a.jsx("p",{role:"status",children:i("agentTopology.documentLoading")}):r?a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[r.baseVersion," ·"," ",i(r.canUpdate?"agentTopology.documentWritable":"agentTopology.documentReadOnly")]}),a.jsx(CIe,{"aria-label":"SKILL.md",value:o,readOnly:!r.canUpdate,disabled:d,maxLength:262144,spellCheck:!1,onChange:T=>l(T.currentTarget.value)})]}):null,h&&a.jsx("p",{role:"alert",children:i(`agentTopology.${h}`)}),v&&a.jsxs("div",{role:"alert",children:[a.jsx("p",{children:i("agentTopology.discardDocument")}),a.jsx(Ci,{variant:"outline",onClick:()=>y(!1),children:i("agentTopology.keepEditing")}),a.jsx(Ci,{variant:"secondary",onClick:t,children:i("agentTopology.discardChanges")})]}),a.jsxs("footer",{children:[!r&&!c&&a.jsx(Ci,{variant:"outline",onClick:()=>b(T=>T+1),children:i("agentTopology.refresh")}),(r==null?void 0:r.canUpdate)&&a.jsx(Ci,{loading:d,disabled:c||o===r.content||!o.trim(),onClick:()=>void j(),children:i("agentTopology.saveDocument")})]})]})}),window.document.body)}function xC(e){return e.trimEnd().replace(/[。.]+$/,"")}function TIe({selected:e,onChange:t,cloudProvider:n="volcengine"}){const{t:i}=Te("create"),[r,s]=p.useState([]),[o,l]=p.useState([]),[c,u]=p.useState(""),[d,f]=p.useState(!0),[h,m]=p.useState(!1),[g,b]=p.useState(null);p.useEffect(()=>{let O=!1;return(async()=>{f(!0),b(null);try{const k=await kIe();O||(s(k),k.length>0&&u(k[0].id))}catch(k){O||b(k instanceof Error?k.message:i("skills.space.loadError"))}finally{O||f(!1)}})(),()=>{O=!0}},[i]),p.useEffect(()=>{if(!c){l([]);return}const O=r.find(S=>S.id===c);let k=!1;return(async()=>{m(!0),b(null);try{const S=await SIe(c,O==null?void 0:O.region);k||l(S)}catch(S){k||b(S instanceof Error?S.message:i("skills.space.loadError"))}finally{k||m(!1)}})(),()=>{k=!0}},[c,r,i]);const v=r.find(O=>O.id===c),y=v?qpt(v.id,v.region,n):"",w=(O,k)=>e.some(S=>S.source==="skillspace"&&S.skillId===O&&(S.version||"")===k),x=O=>{if(!v)return;const k=jy(O);if(w(k,O.version))t(e.filter(S=>!(S.source==="skillspace"&&S.skillId===k&&(S.version||"")===O.version)));else{const S=Hpt(v,O);t([...e,{source:"skillspace",folder:S.folder||O.skillName,name:S.name,description:S.description,skillSpaceId:S.skillSpaceId,skillSpaceName:S.skillSpaceName,skillSpaceRegion:S.skillSpaceRegion,skillId:S.skillId,version:S.version}])}};return a.jsx("div",{className:"cw-skillspace",children:d?a.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[a.jsx(Bi,{className:"cw-i cw-spin"})," ",i("skills.space.loadingSpaces")]}):g?a.jsxs("div",{className:"cw-banner",children:[a.jsx(mm,{className:"cw-i"}),a.jsx("span",{children:g})]}):r.length===0?a.jsx("p",{className:"cw-empty-line",children:i("skills.space.noSpaces")}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"cw-skillspace-header",children:[a.jsx("select",{className:"cw-input cw-skillspace-select",value:c,onChange:O=>u(O.target.value),"aria-label":i("skills.space.selectSpace"),children:r.map(O=>a.jsxs("option",{value:O.id,children:[Dc(O)||O.id,O.description?` — ${xC(O.description)}`:""]},O.id))}),v&&a.jsxs(a.Fragment,{children:[v.region&&a.jsx("span",{className:"cw-skillspace-region-label",title:v.region,children:Oh(v.region,n)}),y&&a.jsx("a",{href:y,target:"_blank",rel:"noopener noreferrer",className:"cw-button cw-button-secondary cw-skillspace-console-link",title:i("skills.space.openConsole"),"aria-label":i("skills.space.openConsole"),children:a.jsx(m0,{className:"cw-i cw-i-sm"})})]})]}),h?a.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[a.jsx(Bi,{className:"cw-i cw-spin"})," ",i("skills.space.loadingSkills")]}):o.length===0?a.jsx("p",{className:"cw-empty-line",children:i("skills.space.noSkills")}):a.jsx("div",{className:"cw-skill-results",children:o.map(O=>{const k=jy(O),S=w(k,O.version);return a.jsxs("button",{type:"button",className:`cw-skill-result ${S?"is-on":""}`,onClick:()=>x(O),"aria-pressed":S,children:[a.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:S?a.jsx(Cf,{className:"cw-i cw-i-sm"}):a.jsx(ic,{className:"cw-i cw-i-sm"})}),a.jsxs("span",{className:"cw-skill-result-meta",children:[a.jsxs("span",{className:"cw-skill-result-name",children:[O.skillName,O.version&&a.jsxs("span",{className:"cw-skill-result-version",children:[" ","v",O.version]})]}),O.skillDescription&&a.jsx("span",{className:"cw-skill-result-desc",children:xC(O.skillDescription)}),a.jsxs("span",{className:"cw-skill-result-repo",children:[a.jsx(jat,{className:"cw-i cw-i-sm"})," ",Dc(v)||c]})]})]},`${k}/${O.version}`)})})]})})}function rT(e,t){return e.map(n=>({...n,get label(){return Xt(`${t}.${n.id}.label`)},get desc(){return Xt(`${t}.${n.id}.description`)}}))}function pd(e,t){const n={...e};for(const[i,r]of Object.entries(t))Object.defineProperty(n,i,{configurable:!0,enumerable:!0,get:()=>Xt(r)});return n}const _Ie="https://ark.cn-beijing.volces.com/api/v3/";pd({key:"MODEL_AGENT_NAME",required:!1,placeholder:"doubao-seed-1-6-250615"},{comment:"traditional.catalog.env.modelAgentName.comment"});const SN=[pd({key:"MODEL_EMBEDDING_NAME",required:!1,placeholder:"doubao-embedding-vision-250615"},{comment:"traditional.catalog.env.embeddingModelName.comment"}),{key:"MODEL_EMBEDDING_DIM",required:!1,placeholder:"2048"},{key:"MODEL_EMBEDDING_API_BASE",required:!1,placeholder:_Ie}],gI=[],bI={get label(){return Xt("traditional.catalog.links.console")},url:"https://console.volcengine.com/vikingdb/openviking"},Ypt={get label(){return Xt("traditional.catalog.links.documentation")},url:"https://github.com/volcengine/OpenViking/blob/main/docs/zh/api/05-sessions.md"},jIe="https://api.vikingdb.cn-beijing.volces.com/openviking",Zpt=`{ "self": {"enabled": true}, "peer": {"enabled": true}, "working_memory": {"enabled": true}, "memory_types": null -}`,Ypt=[{key:"DATABASE_VIKING_PROJECT",required:!1,placeholder:"default"},{key:"DATABASE_VIKING_REGION",required:!1},{key:"DATABASE_VIKING_COLLECTION_KIND",required:!1},{key:"DATABASE_VIKING_RESOURCE_ID",required:!1}],Zpt=[fd({key:"DATABASE_VIKINGMEM_PROJECT",required:!1,placeholder:"default",hidden:!0},{comment:"traditional.catalog.env.vikingMemoryProject.comment"}),fd({key:"DATABASE_VIKING_REGION",required:!1,hidden:!0},{comment:"traditional.catalog.env.vikingMemoryRegion.comment"}),fd({key:"DATABASE_VIKINGMEM_MEMORY_TYPE",required:!1,placeholder:"sys_event_v1,sys_profile_v1",hidden:!0},{comment:"traditional.catalog.env.vikingMemoryType.comment"})],uS=[fd({key:"FEISHU_APP_ID",required:!0,placeholder:"cli_xxx"},{comment:"traditional.catalog.env.feishuAppId.comment"}),fd({key:"FEISHU_APP_SECRET",required:!0,secret:!0},{placeholder:"traditional.catalog.env.feishuAppSecret.placeholder",comment:"traditional.catalog.env.feishuAppSecret.comment"})],cw={topK:"3",region:"cn-beijing",endpoint:"https://open.volcengineapi.com/"};function gM(e){if(e==="byteplus"){const t="ap-southeast-1";return{topK:cw.topK,region:t,endpoint:`https://agentkit.${t}.byteplusapi.com/`}}return cw}const jIe=[fd({key:"REGISTRY_SPACE_ID",required:!0},{placeholder:"traditional.catalog.env.registrySpaceId.placeholder",comment:"traditional.catalog.env.registrySpaceId.comment"}),fd({key:"REGISTRY_TOP_K",required:!1,placeholder:cw.topK},{comment:"traditional.catalog.env.registryTopK.comment"}),fd({key:"REGISTRY_REGION",required:!1,placeholder:cw.region},{comment:"traditional.catalog.env.registryRegion.comment"}),fd({key:"REGISTRY_ENDPOINT",required:!1,placeholder:cw.endpoint},{comment:"traditional.catalog.env.registryEndpoint.comment"})],rT=iT([{id:"web_search",importLine:"from veadk.tools.builtin_tools.web_search import web_search",toolNames:["web_search"],env:gI},{id:"parallel_web_search",importLine:"from veadk.tools.builtin_tools.parallel_web_search import parallel_web_search",toolNames:["parallel_web_search"],env:gI},{id:"link_reader",importLine:"from veadk.tools.builtin_tools.link_reader import link_reader",toolNames:["link_reader"],env:[]},{id:"web_scraper",importLine:"from veadk.tools.builtin_tools.web_scraper import web_scraper",toolNames:["web_scraper"],env:[{key:"TOOL_WEB_SCRAPER_ENDPOINT",required:!0},{key:"TOOL_WEB_SCRAPER_API_KEY",required:!0}]},{id:"image_generate",importLine:"from veadk.tools.builtin_tools.image_generate import image_generate",toolNames:["image_generate"],env:[{key:"MODEL_IMAGE_NAME",required:!1,placeholder:"doubao-seedream-5-0-260128"}]},{id:"image_edit",importLine:"from veadk.tools.builtin_tools.image_edit import image_edit",toolNames:["image_edit"],env:[{key:"MODEL_EDIT_NAME",required:!1,placeholder:"doubao-seededit-3-0-i2i-250628"}]},{id:"video_generate",importLine:"from veadk.tools.builtin_tools.video_generate import video_generate, video_task_query",toolNames:["video_generate","video_task_query"],env:[{key:"MODEL_VIDEO_NAME",required:!1,placeholder:"doubao-seedance-2-0-260128"}]},{id:"text_to_speech",importLine:"from veadk.tools.builtin_tools.tts import text_to_speech",toolNames:["text_to_speech"],env:[{key:"TOOL_VESPEECH_APP_ID",required:!0},{key:"TOOL_VESPEECH_SPEAKER",required:!1,placeholder:"zh_female_vv_uranus_bigtts"}]},{id:"run_code",importLine:"from veadk.tools.builtin_tools.run_code import run_code",toolNames:["run_code"],env:[{key:"AGENTKIT_TOOL_ID",required:!0,placeholder:"t-xxxx",get comment(){return Xt("traditional.catalog.env.agentKitToolId.comment")}},{key:"AGENTKIT_TOOL_REGION",required:!1,placeholder:"cn-beijing",get comment(){return Xt("traditional.catalog.env.agentKitToolRegion.comment")}}]},{id:"vesearch",importLine:"from veadk.tools.builtin_tools.vesearch import vesearch",toolNames:["vesearch"],env:[{key:"TOOL_VESEARCH_ENDPOINT",required:!0,comment:"VeSearch bot_id"}]}],"traditional.catalog"),Jpt=new Set(["web_scraper","text_to_speech","vesearch"]),emt=new Set(["web_search","parallel_web_search"]),tmt=rT.filter(e=>!Jpt.has(e.id));function NIe(e="volcengine"){const t=e==="byteplus"?emt:new Set;return tmt.filter(n=>!t.has(n.id))}const uw=iT([{id:"local",env:[]},{id:"sqlite",extraArgs:'local_database_path="./short_term_memory.db"',env:[]},{id:"mysql",env:[{key:"DATABASE_MYSQL_HOST",required:!0},{key:"DATABASE_MYSQL_USER",required:!0},{key:"DATABASE_MYSQL_PASSWORD",required:!0},{key:"DATABASE_MYSQL_DATABASE",required:!0}]},{id:"postgresql",env:[{key:"DATABASE_POSTGRESQL_HOST",required:!0},{key:"DATABASE_POSTGRESQL_PORT",required:!1,placeholder:"5432"},{key:"DATABASE_POSTGRESQL_USER",required:!0},{key:"DATABASE_POSTGRESQL_PASSWORD",required:!0},{key:"DATABASE_POSTGRESQL_DATABASE",required:!0}]}],"traditional.backends.shortTerm"),_B=iT([{id:"local",env:kN,pipExtra:"extensions",needsEmbedding:!0},{id:"opensearch",env:[{key:"DATABASE_OPENSEARCH_HOST",required:!0},{key:"DATABASE_OPENSEARCH_PORT",required:!1,placeholder:"9200"},{key:"DATABASE_OPENSEARCH_USERNAME",required:!0},{key:"DATABASE_OPENSEARCH_PASSWORD",required:!0},...kN],pipExtra:"extensions",needsEmbedding:!0},{id:"redis",env:[{key:"DATABASE_REDIS_HOST",required:!0},{key:"DATABASE_REDIS_PORT",required:!1,placeholder:"6379"},{key:"DATABASE_REDIS_PASSWORD",required:!1},...kN],pipExtra:"extensions",needsEmbedding:!0},{id:"viking",env:Zpt},{id:"openviking",env:[{key:"DATABASE_OPENVIKING_URL",required:!0,placeholder:_Ie,get comment(){return Xt("traditional.catalog.env.openVikingUrl.comment")},link:bI},{key:"DATABASE_OPENVIKING_API_KEY",required:!0,comment:"OpenViking API Key",link:bI},{key:"DATABASE_OPENVIKING_USER_ID",required:!1,placeholder:"default",get comment(){return Xt("traditional.catalog.env.openVikingMemoryUserId.comment")},get help(){return Xt("traditional.catalog.env.openVikingMemoryUserId.help")}},{key:"DATABASE_OPENVIKING_MEMORY_POLICY",required:!1,placeholder:Xpt,get comment(){return Xt("traditional.catalog.env.openVikingMemoryPolicy.comment")},multiline:!0,format:"json",get help(){return Xt("traditional.catalog.env.openVikingMemoryPolicy.help")},link:Gpt}]},{id:"mem0",env:[{key:"DATABASE_MEM0_API_KEY",required:!0},{key:"DATABASE_MEM0_BASE_URL",required:!1}],pipExtra:"database"}],"traditional.backends.longTerm"),Dg="viking",jB=iT([{id:"viking",env:Ypt},{id:"opensearch",env:[{key:"DATABASE_OPENSEARCH_HOST",required:!0},{key:"DATABASE_OPENSEARCH_PORT",required:!1,placeholder:"9200"},{key:"DATABASE_OPENSEARCH_USERNAME",required:!0},{key:"DATABASE_OPENSEARCH_PASSWORD",required:!0},...kN],pipExtra:"extensions",needsEmbedding:!0},{id:"context_search",env:[...gI,{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ID",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ENDPOINT",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_APIKEY",required:!0}]},{id:"openviking",env:[{key:"DATABASE_OPENVIKING_URL",required:!0,placeholder:_Ie,get comment(){return Xt("traditional.catalog.env.openVikingUrl.comment")},link:bI},{key:"DATABASE_OPENVIKING_API_KEY",required:!0,comment:"OpenViking API Key",link:bI},{key:"DATABASE_OPENVIKING_USER_ID",required:!1,placeholder:"default",get comment(){return Xt("traditional.catalog.env.openVikingKnowledgeUserId.comment")},get help(){return Xt("traditional.catalog.env.openVikingKnowledgeUserId.help")}},{key:"DATABASE_OPENVIKING_TARGET_URI",required:!1,placeholder:"viking://user/default/resources//",get comment(){return Xt("traditional.catalog.env.openVikingTargetUri.comment")},get help(){return Xt("traditional.catalog.env.openVikingTargetUri.help")}}]}],"traditional.backends.knowledge"),nmt=iT([{id:"apmplus",enableFlag:"ENABLE_APMPLUS",env:[{key:"OBSERVABILITY_OPENTELEMETRY_APMPLUS_SERVICE_NAME",required:!1}]},{id:"cozeloop",enableFlag:"ENABLE_COZELOOP",env:[{key:"OBSERVABILITY_OPENTELEMETRY_COZELOOP_API_KEY",required:!0},{key:"OBSERVABILITY_OPENTELEMETRY_COZELOOP_SERVICE_NAME",required:!1,comment:"CozeLoop space_id"}]},{id:"tls",enableFlag:"ENABLE_TLS",env:[...gI,fd({key:"OBSERVABILITY_OPENTELEMETRY_TLS_SERVICE_NAME",required:!1},{comment:"traditional.catalog.env.tlsServiceName.comment"})]}],"traditional.exporters");function wd(e="volcengine"){return{name:"",description:Xt("defaults.description"),instruction:Xt("defaults.instruction"),dynamicAgentDelegation:!1,agentType:"llm",cloudProvider:e,maxIterations:3,a2aUrl:"",tools:[],skills:[],memory:{shortTerm:!1,longTerm:!1},knowledgebase:!1,tracing:!1,subAgents:[],builtinTools:[],customTools:[],mcpTools:[],a2aRegistry:{enabled:!1,registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},modelName:Kp(e),modelFallbacks:[],modelSource:"ark",modelProvider:"",modelApiBase:"",shortTermBackend:"local",longTermBackend:"local",longTermMemoryIndex:"",autoSaveSession:!1,knowledgebaseBackend:Dg,knowledgebaseIndex:"",tracingExporters:[],selectedSkills:[],cloudEnvironment:{environmentId:"",environmentVersionId:""},deployment:{feishuEnabled:!1,modelApiKeyId:"",modelApiKeyName:""}}}function hk(e){return{id:e,get displayName(){return Xt(`traditional.optimization.options.${e}.label`)},get description(){return Xt(`traditional.optimization.options.${e}.description`)}}}const oH=[hk("context_engine"),hk("compressor"),hk("verifier"),hk("long_run_control"),hk("mcp_resilience")],imt=[{id:"quality",get displayName(){return Xt("traditional.optimization.groups.quality")},componentIds:["context_engine","verifier"]},{id:"cost",get displayName(){return Xt("traditional.optimization.groups.cost")},componentIds:["compressor"]},{id:"stability",get displayName(){return Xt("traditional.optimization.groups.stability")},componentIds:["long_run_control","mcp_resilience"]}],Z1=oH.map(e=>e.id);function rmt(e){return e==="byteplus"?Xt("traditional.optimization.bytePlusUnavailable"):null}const RIe=["context_engine","compressor","verifier","long_run_control"],smt=new Set(["1","true","yes","on"]),lH=[{id:"default",get displayName(){return Xt("traditional.optimization.profiles.default.label")},get description(){return Xt("traditional.optimization.profiles.default.description")},defaultComponents:[],autoAddedComponents:[]},{id:"ops",get displayName(){return Xt("traditional.optimization.profiles.ops.label")},get description(){return Xt("traditional.optimization.profiles.ops.description")},defaultComponents:["context_engine","verifier","long_run_control","mcp_resilience"],autoAddedComponents:["sql_readonly"]}];function SN(e){var t;return((t=oH.find(n=>n.id===e))==null?void 0:t.displayName)??e}function amt(e){var t;return((t=lH.find(n=>n.id===e))==null?void 0:t.displayName)??e}function cH(e){const t=lH.find(n=>n.id===e);return t?[...t.defaultComponents]:[]}function jy(e,t="default"){const n=new Set(e);return{enabled:n.size>0,profile:t,componentOverrides:Object.fromEntries(Z1.map(r=>[r,n.has(r)]))}}function uH(e){if(!e)return;const t=e.profile==="ops"?"ops":"default",n=t==="ops"?cH(t):Z1.filter(i=>{var r;return((r=e.componentOverrides)==null?void 0:r[i])===!0});return{...jy(n,t),...e.catalogVersion?{catalogVersion:e.catalogVersion}:{},...e.planHash?{planHash:e.planHash}:{}}}function s4(e){return smt.has((e==null?void 0:e.trim().toLowerCase())??"")}function omt(e){if(!e)return null;try{const t=JSON.parse(e);return t&&typeof t=="object"&&!Array.isArray(t)?t:null}catch{return null}}function lmt(e){var o;const t=new Map((e==null?void 0:e.map(({key:l,value:c})=>[l,c]))??[]),n=t.get("HARNESS_SIDECAR_ENABLED");if(n===void 0)return null;const i=((o=t.get("HARNESS_PROFILE"))==null?void 0:o.trim())==="ops"?"ops":"default";if(!s4(n))return jy([],i);const r=omt(t.get("HARNESS_SIDECAR_COMPONENT_OVERRIDES"));if(r){const l={...jy(Z1.filter(c=>r[c]===!0),i),enabled:!0};return i==="ops"?uH(l)??l:l}if(i==="ops")return jy(cH(i),i);const s=[...s4(t.get("HARNESS_MODEL_PROXY_ENABLED"))?RIe:[],...s4(t.get("HARNESS_MCP_GATEWAY_ENABLED"))?["mcp_resilience"]:[]];return{...jy(s,i),enabled:!0}}function cmt(e,t){return{...e,modelName:t.modelName||e.modelName,description:t.description,instruction:t.instruction}}function umt(e){var t;return((t=e.harnessSidecar)==null?void 0:t.profile)??"default"}function yI(e){var n;const t=(n=e.harnessSidecar)==null?void 0:n.componentOverrides;return t?Z1.filter(i=>t[i]):[]}function dmt(e){const t=new Set(yI(e));return RIe.filter(n=>t.has(n))}function fmt(e,t){const n=i=>({...i,mcpTools:(i.mcpTools??[]).map(r=>{var o,l;const s=!!(r.authTokenEnv&&(t.has(r.authTokenEnv)||r.authToken));return{...r,credentialConfigured:s,...s?{credentialSourceUrl:((o=r.url)==null?void 0:o.trim())??"",credentialSourceAuthTokenEnv:((l=r.authTokenEnv)==null?void 0:l.trim())??""}:{}}}),subAgents:i.subAgents.map(n),...i.workflow?{workflow:{...i.workflow,nodes:i.workflow.nodes.map(r=>({...r,agent:n(r.agent)}))}}:{}});return n(e)}function J1(e){const t=(e==null?void 0:e.trim())??"",n=t.indexOf("/");return n<=0||n===t.length-1?{modelName:t,modelProvider:""}:{modelName:t.slice(n+1),modelProvider:t.slice(0,n)}}function dH(e){return J1(e).modelName}function IIe(e,t,n,i=!1){var c,u,d,f;const r=J1((t==null?void 0:t.model)||(n==null?void 0:n.model)),s=(t==null?void 0:t.children)??[],o=t==null?void 0:t.type,l=e.agentType==="a2a"&&((c=e.a2aRegistry)!=null&&c.enabled)&&o==="llm"?"a2a":o??e.agentType;return{...e,name:((u=t==null?void 0:t.name)==null?void 0:u.trim())||((d=n==null?void 0:n.name)==null?void 0:d.trim())||e.name,description:(t==null?void 0:t.description)??e.description,instruction:i?e.instruction:(t==null?void 0:t.instruction)??e.instruction,agentType:l,modelName:r.modelName||e.modelName,modelProvider:r.modelProvider||e.modelProvider,skills:((f=t==null?void 0:t.skills)==null?void 0:f.map(h=>h.name))??e.skills,subAgents:e.subAgents.map((h,m)=>IIe(h,s[m],void 0,i))}}function hmt(e,t){const n=new Map(t.map(({key:o,value:l})=>[o,l]));if(!["REGISTRY_SPACE_ID","REGISTRY_TOP_K","REGISTRY_REGION","REGISTRY_ENDPOINT"].some(o=>n.has(o)))return e;const r=(o,l)=>n.has(o)?n.get(o)??"":l??"",s=o=>{var l;return{...o,...(l=o.a2aRegistry)!=null&&l.enabled?{a2aRegistry:{...o.a2aRegistry,registrySpaceId:r("REGISTRY_SPACE_ID",o.a2aRegistry.registrySpaceId),registryTopK:r("REGISTRY_TOP_K",o.a2aRegistry.registryTopK),registryRegion:r("REGISTRY_REGION",o.a2aRegistry.registryRegion),registryEndpoint:r("REGISTRY_ENDPOINT",o.a2aRegistry.registryEndpoint)}}:{},subAgents:o.subAgents.map(s)}};return s(e)}function NB(e,t){var c,u,d;const n=e.cloudProvider??t,i=wd(n),r=e.deployment,s=r==null?void 0:r.network,o=e.cloudEnvironment,l=e.a2aRegistry;return{...i,...e,name:e.name??i.name,description:e.description??i.description,instruction:e.instruction??i.instruction,agentType:e.agentType??i.agentType,cloudProvider:n,maxIterations:e.maxIterations??i.maxIterations,a2aUrl:e.a2aUrl??i.a2aUrl,model:e.model??void 0,modelSource:e.modelSource==="ark"||e.modelSource==="custom"?e.modelSource:void 0,modelName:e.modelName??i.modelName,modelProvider:e.modelProvider??i.modelProvider,modelApiBase:e.modelApiBase??i.modelApiBase,memory:{shortTerm:((c=e.memory)==null?void 0:c.shortTerm)??i.memory.shortTerm,longTerm:((u=e.memory)==null?void 0:u.longTerm)??i.memory.longTerm},tools:[...e.tools??[]],skills:[...e.skills??[]],knowledgebase:e.knowledgebase??i.knowledgebase,tracing:e.tracing??i.tracing,harnessSidecar:uH(e.harnessSidecar),subAgents:(e.subAgents??[]).map(f=>NB(f,n)),builtinTools:[...e.builtinTools??[]],customTools:[...e.customTools??[]],mcpTools:[...e.mcpTools??[]],a2aRegistry:{...i.a2aRegistry,...l??{},enabled:(l==null?void 0:l.enabled)??!1,registrySpaceId:(l==null?void 0:l.registrySpaceId)??"",registryTopK:(l==null?void 0:l.registryTopK)??"",registryRegion:(l==null?void 0:l.registryRegion)??"",registryEndpoint:(l==null?void 0:l.registryEndpoint)??""},shortTermBackend:e.shortTermBackend??i.shortTermBackend,longTermBackend:e.longTermBackend??i.longTermBackend,longTermMemoryIndex:e.longTermMemoryIndex??i.longTermMemoryIndex,autoSaveSession:e.autoSaveSession??i.autoSaveSession,knowledgebaseBackend:e.knowledgebaseBackend??i.knowledgebaseBackend,knowledgebaseIndex:e.knowledgebaseIndex??i.knowledgebaseIndex,tracingExporters:[...e.tracingExporters??[]],selectedSkills:[...e.selectedSkills??[]],cloudEnvironment:{...i.cloudEnvironment,...o??{},cliTools:[...(o==null?void 0:o.cliTools)??[]],dockerfile:typeof(o==null?void 0:o.dockerfile)=="string"?o.dockerfile:void 0},deployment:{...i.deployment,...r??{},feishuEnabled:(r==null?void 0:r.feishuEnabled)??!1,runtimeName:(r==null?void 0:r.runtimeName)??void 0,runtimeNameCustomized:(r==null?void 0:r.runtimeNameCustomized)??((d=i.deployment)==null?void 0:d.runtimeNameCustomized),network:s?{...s,vpcId:s.vpcId??"",subnetIds:s.subnetIds??"",enableSharedInternetAccess:s.enableSharedInternetAccess??!1}:void 0,modelApiKeyId:(r==null?void 0:r.modelApiKeyId)??"",modelApiKeyName:(r==null?void 0:r.modelApiKeyName)??"",envValues:(r==null?void 0:r.envValues)??void 0},...e.workflow?{workflow:{...e.workflow,nodes:e.workflow.nodes.map(f=>({...f,agent:NB(f.agent,n)}))}}:{}}}const pmt=["动态子智能体协作规则:","Dynamic sub-agent collaboration rules:"],mmt=["collect_resources","create_agents","handoff_to"];function gmt(e){return e.replace(/\\([\\`*_[\]{}()<>#+\-.!|])/g,"$1")}function bmt(e){const t=pmt.flatMap(i=>{const r=[];let s=0;for(;si-r),n=t.find((i,r)=>{const s=t[r+1]??e.length,o=gmt(e.slice(i,s));return mmt.every(l=>o.includes(l))});return n===void 0?e:e.slice(0,n).trimEnd()}function ymt(e){const t=n=>({...n,instruction:n.dynamicAgentDelegation===!0?bmt(n.instruction):n.instruction,subAgents:n.subAgents.map(t),...n.workflow?{workflow:{...n.workflow,nodes:n.workflow.nodes.map(i=>({...i,agent:t(i.agent)}))}}:{}});return t(e)}function PIe(e,t){var l,c;const n=wd(t),i=[...e.tools??[]],r=rT.filter(u=>u.toolNames.some(d=>i.includes(d))),s=new Set(r.flatMap(u=>u.toolNames)),o=J1(e.model);return{...n,modelSource:void 0,name:((l=e.name)==null?void 0:l.trim())??"",description:e.description??"",instruction:e.instruction||n.instruction,agentType:e.type??"llm",modelName:o.modelName,modelProvider:o.modelProvider,tools:i.filter(u=>!s.has(u)),builtinTools:r.map(u=>u.id),skills:((c=e.skills)==null?void 0:c.map(u=>u.name))??[],subAgents:(e.children??[]).map(u=>PIe(u,t))}}function fH(e,t,n=[]){var l,c,u,d;const i=((l=e.draft)==null?void 0:l.cloudProvider)??t,r=J1(e.model),s=e.draft?NB(e.draft,i):e.graph?PIe(e.graph,i):{...wd(i),modelSource:void 0,name:((c=e.name)==null?void 0:c.trim())||e.appName.trim(),description:e.description??"",instruction:e.instruction||wd(i).instruction,agentType:e.type??"llm",modelName:r.modelName,modelProvider:r.modelProvider,tools:[...e.tools??[]],skills:((u=e.skills)==null?void 0:u.map(f=>f.name))??[]},o=e.draft&&s.dynamicAgentDelegation===!0?ymt(s):s;return fmt(IIe(o,e.graph,{name:((d=e.name)==null?void 0:d.trim())||e.appName.trim(),model:e.model},!!e.draft),new Set(n))}function vmt(e,t){const n=i=>{var s;const r=((s=i.modelName)==null?void 0:s.trim())??"";return{...i,modelSource:i.agentType==="llm"||!i.agentType?t.has(r)?"ark":"custom":i.modelSource,subAgents:i.subAgents.map(n),...i.workflow?{workflow:{...i.workflow,nodes:i.workflow.nodes.map(o=>({...o,agent:n(o.agent)}))}}:{}}};return n(e)}const vI=[{id:"ubuntu-22.04",label:"Ubuntu 22.04",image:"ubuntu:22.04"},{id:"ubuntu-24.04",label:"Ubuntu 24.04",image:"ubuntu:24.04"}],DIe=[{id:"aio-sandbox",label:"AIO Sandbox",description:"内置 Sandbox Shell 能力 · Ubuntu 22.04"},{id:"codex-sandbox",label:"Codex Sandbox",description:"内置 Codex CLI、浏览器与代码执行环境"},{id:"ubuntu",label:"Ubuntu",description:"标准 Linux 基础镜像"}],hH="agentkit-cli-2107625663-cn-beijing.cr.volces.com/agentkit/agent-native-requirements-aio:0.2.1-20260831",MIe={volcengine:"enterprise-public-cn-beijing.cr.volces.com/vefaas-public/codexenv:1.1.0",byteplus:"enterprise-public-ap-southeast-1.cr.volces.com/vefaas-public/codexenv:1.1.0"},LIe=[{id:"python-3.10",label:"Python 3.10"},{id:"python-3.12",label:"Python 3.12"}],xmt={"python-3.10":"3.10.18","python-3.12":"3.12.11"},pH=[{id:"tools",label:"工具",description:"常用 CLI 与内容处理工具",options:[{id:"lark-cli",label:"lark-cli",description:"飞书开放平台命令行工具",installer:"pip",packageName:"lark-cli"},{id:"pandoc",label:"pandoc",description:"文档格式转换工具",installer:"apt",packageName:"pandoc"},{id:"opencli",label:"opencli",description:"将网站与桌面应用转换为命令行工具",installer:"npm",packageName:"@jackwener/opencli@1.8.7"}]},{id:"productivity",label:"效率",description:"加速依赖安装、检索和协作",options:[{id:"uv",label:"uv",description:"快速 Python 包与项目管理器",installer:"pip",packageName:"uv"},{id:"ripgrep",label:"ripgrep",description:"高性能文本检索工具",installer:"apt",packageName:"ripgrep"},{id:"jq",label:"jq",description:"JSON 查询与转换工具",installer:"apt",packageName:"jq"},{id:"github-cli",label:"GitHub CLI",description:"在终端中管理 GitHub 工作流",installer:"apt",packageName:"gh"}]},{id:"browser",label:"浏览器自动化",description:"网页操作、测试与内容采集",options:[{id:"playwright",label:"Playwright",description:"浏览器自动化与端到端测试",installer:"pip",packageName:"playwright"},{id:"chromium",label:"Chromium",description:"无头浏览器运行时",installer:"apt",packageName:"chromium"}]},{id:"system",label:"系统与媒体",description:"基础开发、网络和媒体处理能力",options:[{id:"git",label:"Git",description:"代码版本管理",installer:"apt",packageName:"git"},{id:"curl",label:"curl",description:"网络请求与文件下载",installer:"apt",packageName:"curl"},{id:"ffmpeg",label:"FFmpeg",description:"音视频转码与处理",installer:"apt",packageName:"ffmpeg"},{id:"imagemagick",label:"ImageMagick",description:"图片转换与批处理",installer:"apt",packageName:"imagemagick"}]}],wmt=pH.flatMap(e=>e.options),Omt=["build-essential","curl","libbz2-dev","libffi-dev","libgdbm-dev","liblzma-dev","libncursesw5-dev","libreadline-dev","libsqlite3-dev","libssl-dev","tk-dev","uuid-dev","zlib1g-dev"],kmt=["xvfb","fonts-noto-color-emoji","fonts-unifont","libfontconfig1","libfreetype6","xfonts-cyrillic","xfonts-scalable","fonts-liberation","fonts-ipafont-gothic","fonts-wqy-zenhei","fonts-tlwg-loma-otf","fonts-freefont-ttf"],Smt={"ubuntu-22.04":["libasound2","libatk-bridge2.0-0","libatk1.0-0","libatspi2.0-0","libcairo2","libcups2","libdbus-1-3","libdrm2","libgbm1","libglib2.0-0","libnspr4","libnss3","libpango-1.0-0","libwayland-client0","libx11-6","libxcb1","libxcomposite1","libxdamage1","libxext6","libxfixes3","libxkbcommon0","libxrandr2"],"ubuntu-24.04":["libasound2t64","libatk-bridge2.0-0t64","libatk1.0-0t64","libatspi2.0-0t64","libcairo2","libcups2t64","libdbus-1-3","libdrm2","libgbm1","libglib2.0-0t64","libnspr4","libnss3","libpango-1.0-0","libx11-6","libxcb1","libxcomposite1","libxdamage1","libxext6","libxfixes3","libxkbcommon0","libxrandr2"]};function pk(e,t){for(const n of t)e.includes(n)||e.push(n)}function Emt(e,t,n,i,r){const s=["ca-certificates"];r||pk(s,i?[`python${n}`,`python${n}-venv`]:Omt);for(const o of t)o.id==="playwright"||o.id==="chromium"||(o.installer==="apt"&&pk(s,[o.packageName]),o.id==="opencli"&&pk(s,["curl","xz-utils"]));return e.optionIds.some(o=>o==="playwright"||o==="chromium")&&(pk(s,kmt),pk(s,Smt[e.operatingSystem])),s}const a4={name:"",description:"",baseEnvironment:"aio-sandbox",operatingSystem:"ubuntu-22.04",language:"python-3.12",optionIds:[],selectedSkills:[]};function Lp(e){var t;return((t=LIe.find(n=>n.id===e))==null?void 0:t.label)??e}function RB(e){var t;return((t=vI.find(n=>n.id===e))==null?void 0:t.label)??e}function IB(e){var t;return((t=DIe.find(n=>n.id===e))==null?void 0:t.label)??e}function Cmt(e){var n;const t=((n=e.match(/^\s*FROM\s+(.+)$/im))==null?void 0:n[1])??"";return{baseEnvironment:/\/codexenv:/i.test(t)?"codex-sandbox":/aio\.sandbox/i.test(e)?"aio-sandbox":"ubuntu",operatingSystem:/ubuntu:24\.04/i.test(t)?"ubuntu-24.04":"ubuntu-22.04"}}function mH(e,t="volcengine"){const n=wmt.filter(b=>e.optionIds.includes(b.id)),i=e.baseEnvironment==="aio-sandbox",r=e.baseEnvironment==="codex-sandbox",s=i||r,o=s?"python-3.12":e.language,l=o.replace("python-",""),c=xmt[o],u=vI.find(b=>b.id===e.operatingSystem)??vI[0],d=e.operatingSystem==="ubuntu-22.04"&&l==="3.10"||e.operatingSystem==="ubuntu-24.04"&&l==="3.12",f=Emt(e,n,l,d,s),h=i?[`ARG AIO_BASE_IMAGE=${hH}`,"ARG AIO_BASE_PLATFORM=linux/amd64","",`# Base environment: AIO Sandbox (${u.label})`,"FROM --platform=${AIO_BASE_PLATFORM} ${AIO_BASE_IMAGE}"]:r?[`ARG CODEX_BASE_IMAGE=${MIe[t]}`,"ARG CODEX_BASE_PLATFORM=linux/amd64","","# Base environment: Codex Sandbox","FROM --platform=${CODEX_BASE_PLATFORM} ${CODEX_BASE_IMAGE}"]:[`# Operating system: ${u.label}`,`FROM ${u.image}`];h.push("","ARG DEBIAN_FRONTEND=noninteractive","ARG APT_MIRROR_URL=http://archive.ubuntu.com/ubuntu","ARG PIP_INDEX_URL=https://pypi.org/simple","ARG PYTHON_SOURCE_BASE_URL=https://www.python.org/ftp/python","ARG PLAYWRIGHT_DOWNLOAD_HOST=https://cdn.playwright.dev","ARG PIP_DEFAULT_TIMEOUT=300","ARG PIP_RETRIES=10","","# Install all system dependencies in one transaction from the provider-local mirror.","RUN set -eux; \\",' mirror="${APT_MIRROR_URL%/}"; \\'," for source_file in /etc/apt/sources.list /etc/apt/sources.list.d/*.sources; do \\",' [ -f "$source_file" ] || continue; \\',' sed -i -E "s#https?://(archive|security).ubuntu.com/ubuntu/?#${mirror}#g" "$source_file"; \\'," done; \\",` printf 'Acquire::Retries "5";\\nAcquire::ForceIPv4 "true";\\nAcquire::http::Timeout "60";\\nAcquire::https::Timeout "60";\\n' > /etc/apt/apt.conf.d/80-veadk-network; \\`," apt-get update; \\"," apt-get install -y --no-install-recommends \\",...f.map(b=>" "+b+" \\")," ; rm -rf /var/lib/apt/lists/*","","ENV PYTHONDONTWRITEBYTECODE=1 \\"," PYTHONUNBUFFERED=1 \\"," PIP_NO_CACHE_DIR=1","",`# Python ${l}`),i?h.push("# Keep Studio dependencies isolated from AIO's system interpreter.","RUN /opt/python3.12/bin/python -m venv /opt/veadk-environment/.venv","","ENV VIRTUAL_ENV=/opt/veadk-environment/.venv \\"," BASH_VENV_PATH=/opt/veadk-environment/.venv \\",' PATH="/opt/veadk-environment/.venv/bin:$PATH"'):r?h.push("# Keep Studio dependencies isolated from the Codex runtime.","RUN python3 -m venv /opt/veadk-environment/.venv","","ENV VIRTUAL_ENV=/opt/veadk-environment/.venv \\",' PATH="/opt/veadk-environment/.venv/bin:$PATH"'):d?h.push(`RUN python${l} -m venv /opt/venv`):h.push(`RUN curl --retry 5 --retry-all-errors --connect-timeout 30 -fsSL "\${PYTHON_SOURCE_BASE_URL}/${c}/Python-${c}.tgz" -o /tmp/python.tgz \\`," && mkdir -p /tmp/python-source \\"," && tar -xzf /tmp/python.tgz --strip-components=1 -C /tmp/python-source \\"," && cd /tmp/python-source \\"," && ./configure --prefix=/opt/python --with-ensurepip=install \\",' && make -j"$(nproc)" \\'," && make install \\",` && /opt/python/bin/python${l} -m venv /opt/venv \\`," && rm -rf /tmp/python-source /tmp/python.tgz"),s||h.push("",'ENV PATH="/opt/venv/bin:$PATH"');const m=new Set(e.optionIds);(m.has("playwright")||m.has("chromium"))&&h.push("","ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright \\"," PLAYWRIGHT_DOWNLOAD_CONNECTION_TIMEOUT=300000"),h.push("","WORKDIR /workspace","","# VeADK","RUN python -m pip install --upgrade veadk-python");let g=!1;for(const b of n)h.push("",`# ${b.label}`),b.id==="opencli"?h.push('RUN node_arch="$(dpkg --print-architecture)" \\',' && case "$node_arch" in amd64) node_arch=x64 ;; arm64) node_arch=arm64 ;; *) echo "Unsupported architecture: $node_arch" >&2; exit 1 ;; esac \\',' && curl --retry 5 --connect-timeout 30 -fsSL "https://nodejs.org/dist/v22.18.0/node-v22.18.0-linux-${node_arch}.tar.xz" -o /tmp/node.tar.xz \\'," && tar -xJf /tmp/node.tar.xz -C /usr/local --strip-components=1 \\",` && npm install --global ${b.packageName} \\`," && npm cache clean --force \\"," && rm -f /tmp/node.tar.xz"):b.id==="playwright"||b.id==="chromium"?g||(h.push("RUN python -m pip install --upgrade playwright"),h.push("RUN python -m playwright install chromium"),g=!0):b.installer!=="apt"&&h.push(`RUN python -m pip install --upgrade ${b.packageName}`);return i?h.push("","# Keep AIO's inherited /opt/gem/run.sh startup chain and shell API.","EXPOSE 8080"):r||h.push("",'CMD ["/bin/bash"]'),h.join(` -`)}function Amt(){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m7 7 10 10M17 7 7 17",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function Tmt(){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[a.jsx("circle",{cx:"10.8",cy:"10.8",r:"5.8",stroke:"currentColor",strokeWidth:"1.7"}),a.jsx("path",{d:"m15.2 15.2 4 4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function PB(){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[a.jsx("path",{d:"M5 7.25A2.25 2.25 0 0 1 7.25 5h9.5A2.25 2.25 0 0 1 19 7.25v9.5A2.25 2.25 0 0 1 16.75 19h-9.5A2.25 2.25 0 0 1 5 16.75v-9.5Z",stroke:"currentColor",strokeWidth:"1.6"}),a.jsx("path",{d:"M8.5 9.25 11 12l-2.5 2.75M12.75 14.75h2.75",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]})}function $Ie(){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[a.jsx("path",{d:"M4.75 7.25A2.25 2.25 0 0 1 7 5h3l1.5 2h5.5a2.25 2.25 0 0 1 2.25 2.25v7.5A2.25 2.25 0 0 1 17 19H7a2.25 2.25 0 0 1-2.25-2.25v-9.5Z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),a.jsx("path",{d:"M8 11.25h8M8 14.75h5.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}function _mt(){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M12 6.5v11M6.5 12h11",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function Nee(){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m7 7 10 10M17 7 7 17",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function Ree(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m3.5 8.25 2.75 2.75 6.25-6.25",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}function Cc(e){return`${e.environment_id}\0${e.environment_version_id}`}function sE(e){return e.latestVersion?{environment_id:e.id,environment_version_id:e.latestVersion.versionId}:null}function EN(e,t){return e.environmentIds.flatMap(n=>{const i=t.get(n),r=i?sE(i):null;return r?[r]:[]})}function jmt({environments:e,workspaces:t,value:n,selectedWorkspaceIds:i,loading:r,error:s,onConfirm:o,onClose:l}){const{t:c}=Te("workspaceTools"),[u,d]=p.useState(""),[f,h]=p.useState(!1),[m,g]=p.useState(""),b=p.useId(),v=p.useMemo(()=>new Map(e.map(A=>[A.id,A])),[e]),[y,w]=p.useState(()=>new Set(i)),[x,O]=p.useState(()=>{const A=new Set(t.filter(N=>i.includes(N.id)).flatMap(N=>N.environmentIds));return new Set(n.filter(N=>!A.has(N.environment_id)).map(Cc))}),k=p.useMemo(()=>new Set(t.filter(A=>y.has(A.id)).flatMap(A=>A.environmentIds)),[y,t]),S=p.useMemo(()=>{const A=new Set(x);for(const N of t)if(y.has(N.id))for(const P of EN(N,v))A.add(Cc(P));return A},[x,y,v,t]),C=p.useMemo(()=>{const A=u.trim().toLocaleLowerCase();return A?e.filter(N=>`${N.name} ${N.description} ${Lp(N.language)}`.toLocaleLowerCase().includes(A)):e},[e,u]),E=p.useMemo(()=>{const A=u.trim().toLocaleLowerCase();return A?t.filter(N=>{const P=N.environmentIds.map(I=>{var D;return((D=v.get(I))==null?void 0:D.name)??""}).join(" ");return`${N.name} ${N.description} ${P}`.toLocaleLowerCase().includes(A)}):t},[v,u,t]);p.useEffect(()=>{const A=document.body.style.overflow,N=P=>{P.key==="Escape"&&!f&&l()};return document.body.style.overflow="hidden",document.addEventListener("keydown",N),()=>{document.body.style.overflow=A,document.removeEventListener("keydown",N)}},[l,f]);const j=A=>{const N=sE(A);if(!N)return;const P=Cc(N);k.has(A.id)||O(I=>{const D=new Set(I);return D.has(P)?D.delete(P):D.add(P),D})},T=A=>{const N=EN(A,v);N.length!==0&&(w(P=>{const I=new Set(P);return I.has(A.id)?I.delete(A.id):I.add(A.id),I}),O(P=>{const I=new Set(P);for(const D of N)I.delete(Cc(D));return I}))},R=async()=>{const A=new Map(n.map(P=>[Cc(P),P])),N=e.flatMap(P=>{const I=sE(P);if(!I||!S.has(Cc(I)))return[];const D=A.get(Cc(I));return[{...I,mount_instance_id:(D==null?void 0:D.mount_instance_id)||crypto.randomUUID()}]});h(!0),g("");try{await o(N,[...y]),l()}catch(P){g(P instanceof Error?P.message:c("sessionEnvironment.mountFailed"))}finally{h(!1)}};return yi.createPortal(a.jsxs("div",{className:"studio-tool-dialog-layer",children:[a.jsx("button",{type:"button",className:"studio-tool-dialog-scrim","aria-label":c("sessionEnvironment.closeDialog"),disabled:f,onClick:l}),a.jsxs("section",{className:"studio-tool-dialog session-environment-dialog",role:"dialog","aria-modal":"true","aria-labelledby":b,children:[a.jsxs("header",{className:"studio-tool-dialog-head",children:[a.jsx("span",{className:"studio-tool-dialog-mark",children:a.jsx(PB,{})}),a.jsxs("div",{children:[a.jsx("h2",{id:b,children:c("sessionEnvironment.addTitle")}),a.jsx("p",{children:c("sessionEnvironment.description")})]}),a.jsx("button",{type:"button",className:"studio-tool-dialog-close","aria-label":c("sessionEnvironment.closeAdd"),disabled:f,onClick:l,children:a.jsx(Amt,{})})]}),a.jsxs("div",{className:"studio-tool-dialog-body",children:[a.jsxs("label",{className:"studio-tool-search",children:[a.jsx(Tmt,{}),a.jsx("input",{value:u,"aria-label":c("sessionEnvironment.searchAria"),placeholder:c("sessionEnvironment.searchPlaceholder"),autoFocus:!0,onChange:A=>d(A.target.value)})]}),a.jsx("div",{className:"studio-tool-picker session-environment-picker",role:"group","aria-label":c("sessionEnvironment.availableAria"),children:r?a.jsx("div",{className:"studio-tool-empty",children:c("sessionEnvironment.loading")}):s?a.jsx("div",{className:"studio-tool-empty",children:s}):C.length===0&&E.length===0?a.jsx("div",{className:"studio-tool-empty",children:c("sessionEnvironment.noMatch")}):a.jsxs(a.Fragment,{children:[E.length>0&&a.jsxs("section",{className:"session-environment-picker__group","aria-labelledby":`${b}-workspaces`,children:[a.jsx("h3",{id:`${b}-workspaces`,children:c("sessionEnvironment.workspaces")}),E.map(A=>{const N=EN(A,v),P=y.has(A.id),I=N.length===0;return a.jsxs("label",{className:`studio-tool-option session-environment-option is-workspace${P?" is-selected":""}${I?" is-disabled":""}`,children:[a.jsx("span",{className:"studio-tool-option-icon",children:a.jsx($Ie,{})}),a.jsxs("span",{className:"studio-tool-option-copy",children:[a.jsx("strong",{children:A.name}),a.jsx("span",{children:A.description||c("sessionEnvironment.reuseAll")}),a.jsx("small",{children:c("sessionEnvironment.availableEnvironmentCount",{count:N.length})})]}),a.jsx("input",{type:"checkbox",checked:P,disabled:I,"aria-label":c("sessionEnvironment.selectWorkspace",{name:A.name}),onChange:()=>T(A)}),a.jsx("span",{className:"session-environment-check","aria-hidden":"true",children:a.jsx(Ree,{})})]},A.id)})]}),C.length>0&&a.jsxs("section",{className:"session-environment-picker__group","aria-labelledby":`${b}-environments`,children:[a.jsx("h3",{id:`${b}-environments`,children:c("sessionEnvironment.environments")}),C.map(A=>{const N=sE(A);if(!N)return null;const P=t.filter(_=>y.has(_.id)&&_.environmentIds.includes(A.id)),I=P.length>0,D=S.has(Cc(N));return a.jsxs("label",{className:`studio-tool-option session-environment-option${D?" is-selected":""}${I?" is-covered":""}`,children:[a.jsx("span",{className:"studio-tool-option-icon",children:a.jsx(PB,{})}),a.jsxs("span",{className:"studio-tool-option-copy",children:[a.jsx("strong",{children:A.name}),a.jsx("span",{children:I?c("sessionEnvironment.includedByWorkspaces",{names:P.map(_=>_.name).join(c("sessionEnvironment.nameSeparator"))}):A.description||Lp(A.language)}),a.jsxs("small",{children:[Lp(A.language)," · ",N.environment_version_id]})]}),a.jsx("input",{type:"checkbox",checked:D,disabled:I,"aria-label":c("sessionEnvironment.selectEnvironment",{name:A.name}),onChange:()=>j(A)}),a.jsx("span",{className:"session-environment-check","aria-hidden":"true",children:a.jsx(Ree,{})})]},Cc(N))})]})]})})]}),a.jsxs("footer",{className:"session-environment-dialog__footer",children:[a.jsx("span",{className:m?"is-error":"",role:m?"alert":void 0,children:m||c("sessionEnvironment.selectionSummary",{workspaces:c("sessionEnvironment.selectedWorkspaceCount",{count:y.size}),environments:c("sessionEnvironment.coveredEnvironmentCount",{count:S.size})})}),a.jsxs("div",{children:[a.jsx("button",{type:"button",disabled:f,onClick:l,children:c("sessionEnvironment.cancel")}),a.jsx("button",{type:"button",className:"is-primary",disabled:r||f||!!s,onClick:()=>void R(),children:c(f?"sessionEnvironment.mounting":"sessionEnvironment.confirm")})]})]})]})]}),document.body)}function Nmt({environments:e,workspaces:t,value:n,selectedWorkspaceIds:i,loading:r,disabled:s=!1,error:o="",onChange:l,onRefresh:c}){const{t:u}=Te("workspaceTools"),[d,f]=p.useState(!1),[h,m]=p.useState(!1),[g,b]=p.useState(""),v=p.useRef(null),y=p.useMemo(()=>new Map(e.flatMap(E=>{const j=sE(E);return j?[[Cc(j),E]]:[]})),[e]),w=p.useMemo(()=>new Map(e.map(E=>[E.id,E])),[e]),x=t.filter(E=>i.includes(E.id)),O=new Set(x.flatMap(E=>E.environmentIds)),k=n.filter(E=>!O.has(E.environment_id)),S=()=>{f(!1),requestAnimationFrame(()=>{var E;return(E=v.current)==null?void 0:E.focus()})},C=async(E,j)=>{if(l){m(!0),b("");try{await l(E,j)}catch(T){b(T instanceof Error?T.message:u("sessionEnvironment.mountFailed"))}finally{m(!1)}}};return a.jsxs("div",{className:"session-environment-select",children:[n.length>0&&a.jsxs("div",{className:"session-environment-list",role:"list","aria-label":u("sessionEnvironment.mountedAria"),children:[x.map(E=>{const j=new Set(EN(E,w).map(T=>T.environment_id));return a.jsxs("div",{className:"session-environment-item is-workspace",role:"listitem",children:[a.jsx("span",{className:"session-environment-item__icon",children:a.jsx($Ie,{})}),a.jsxs("span",{className:"session-environment-item__copy",children:[a.jsx("strong",{children:E.name}),a.jsx("small",{children:u("sessionEnvironment.environmentCount",{count:j.size})})]}),l&&a.jsx("button",{type:"button",className:"topo-remove-capability","aria-label":u("sessionEnvironment.removeWorkspace",{name:E.name}),title:u("sessionEnvironment.remove"),disabled:s||h,onClick:()=>{const T=i.filter(A=>A!==E.id),R=new Set(t.filter(A=>T.includes(A.id)).flatMap(A=>A.environmentIds));C(n.filter(A=>!j.has(A.environment_id)||R.has(A.environment_id)),T)},children:a.jsx(Nee,{})})]},`workspace:${E.id}`)}),k.map(E=>{const j=y.get(Cc(E));return a.jsxs("div",{className:"session-environment-item",role:"listitem",children:[a.jsx("span",{className:"session-environment-item__icon",children:a.jsx(PB,{})}),a.jsxs("span",{className:"session-environment-item__copy",children:[a.jsx("strong",{children:(j==null?void 0:j.name)??E.environment_id}),a.jsx("small",{children:j?Lp(j.language):E.environment_version_id})]}),l&&a.jsx("button",{type:"button",className:"topo-remove-capability","aria-label":u("sessionEnvironment.removeEnvironment",{name:(j==null?void 0:j.name)??E.environment_id}),title:u("sessionEnvironment.remove"),disabled:s||h,onClick:()=>void C(n.filter(T=>Cc(T)!==Cc(E)),[...i]),children:a.jsx(Nee,{})})]},Cc(E))})]}),l&&a.jsxs("button",{ref:v,type:"button",className:"topo-capability-add-slot","aria-label":u("sessionEnvironment.add"),disabled:s||r||h,onClick:()=>{b(""),f(!0),c==null||c()},children:[a.jsx(_mt,{}),a.jsx("span",{children:n.length>0?u("sessionEnvironment.addMore"):u("sessionEnvironment.addForSession")})]}),g&&a.jsx("p",{className:"is-error",role:"alert",children:g}),(r||o||e.length===0)&&a.jsx("p",{className:o?"is-error":void 0,role:o?"alert":void 0,children:r?u("sessionEnvironment.loadingAvailable"):o||u("sessionEnvironment.empty")}),d&&a.jsx(jmt,{environments:e,workspaces:t,value:n,selectedWorkspaceIds:i,loading:r,error:o,onConfirm:(E,j)=>l==null?void 0:l(E,j),onClose:S})]})}function Rmt(e){return[...new Map(e.filter(t=>t.name.trim()).map(t=>[t.name.trim(),{...t,name:t.name.trim()}])).values()]}function o4({title:e,count:t}){const{t:n}=Te("workspaceTools");return a.jsxs("div",{className:"topo-module-title",children:[a.jsx("span",{className:"topo-module-label",title:e,children:e}),t!==void 0&&a.jsx("span",{className:"topo-section-count","aria-label":n("agentTopology.itemCount",{count:t}),children:t})]})}function Imt({info:e,loading:t,boundSkills:n,onRefresh:i,onOpenSkill:r,variant:s="rail",selectedSessionSkills:o=[],onSessionSkillsChange:l,environments:c=[],workspaces:u=[],selectedEnvironments:d=[],selectedEnvironmentWorkspaceIds:f=[],environmentsLoading:h=!1,environmentsDisabled:m=!1,environmentsError:g="",onEnvironmentsChange:b,onEnvironmentsRefresh:v}){var R,A,N,P,I;const{t:y}=Te("workspaceTools"),[w,x]=p.useState(null);if(t&&!e)return a.jsx("aside",{className:`topo is-loading${s==="drawer"?" is-drawer":""}`,"aria-label":y("agentTopology.info"),"aria-live":"polite",children:a.jsx(fn,{as:"span",className:"topo-loading-label",duration:2.2,children:y("agentTopology.loadingInfo")})});if(!e)return null;const O=dH(e.model),k=e.agentCategory==="mpa",S=((R=e.mpa)==null?void 0:R.agentsMdStatus)??"unsupported",C=k?((A=e.mpa)==null?void 0:A.agentsMd)??"":((N=e.graph)==null?void 0:N.instruction)??((P=e.draft)==null?void 0:P.instruction)??"",E=k?(n==null?void 0:n.skills)??[]:Rmt([...e.skills,...o.map(D=>({name:D.name,description:D.description??""}))]),j=n==null?void 0:n.error,T=j==="forbidden"?"accessDenied":j==="unsupported"?"skillsUnsupported":j==="degraded"?"skillsDegraded":"loadFailed";return a.jsx(a.Fragment,{children:a.jsxs("aside",{className:`topo${s==="drawer"?" is-drawer":""}`,"aria-label":y("agentTopology.infoAndTopology"),children:[a.jsxs("section",{className:"topo-agent-card","aria-label":y("agentTopology.info"),children:[a.jsxs("div",{className:"topo-agent-heading",children:[a.jsx("h2",{title:e.name,children:e.name||y("agentTopology.unnamedAgent")}),O&&a.jsx("span",{title:O,children:O})]}),e.description&&a.jsx("p",{className:"topo-description",title:e.description,children:e.description}),i&&a.jsx("button",{type:"button",className:"topo-refresh",onClick:i,disabled:t||(n==null?void 0:n.loading),children:y("agentTopology.refresh")})]}),a.jsxs("div",{className:"topo-module-stack",children:[a.jsxs("section",{className:"topo-module-card topo-agents-md-card","aria-label":y("agentTopology.agentsMd"),children:[a.jsx(o4,{title:y("agentTopology.agentsMd")}),a.jsx("div",{className:"topo-module-scroll topo-agents-md-scroll",role:"region","aria-label":y("agentTopology.agentsMd"),tabIndex:0,children:k&&S!=="ready"?a.jsx("div",{className:"topo-data-error",role:"status",children:y(`agentTopology.${S==="forbidden"?"accessDenied":S==="unsupported"?"documentUnsupported":"loadFailed"}`)}):C.trim()?a.jsx("pre",{className:"topo-agents-md-content",children:C}):a.jsx("div",{className:"topo-empty",children:y("agentTopology.notConfigured")})})]}),a.jsxs("section",{className:"topo-module-card topo-skills-card","aria-label":y("agentTopology.skills"),children:[a.jsx(o4,{title:y("agentTopology.skills"),count:k?n!=null&&n.complete?E.length:void 0:e.skillsPreviewSupported?E.length:void 0}),a.jsxs("div",{className:"topo-module-scroll topo-skills-scroll",role:"region","aria-label":y("agentTopology.skillList"),tabIndex:0,children:[k&&(n!=null&&n.loading)&&!E.length?a.jsx(fn,{as:"span",children:y("agentTopology.loadingSkills")}):!k&&!e.skillsPreviewSupported?a.jsx("div",{className:"topo-empty",children:y("agentTopology.previewUnsupported")}):E.length>0?a.jsx("div",{className:"topo-skill-list",children:E.map((D,_)=>{var L;return a.jsxs("div",{className:"topo-skill",title:D.description||D.name,children:[a.jsx("div",{className:"topo-skill-title",children:k&&r&&((L=n==null?void 0:n.skills[_])!=null&&L.skillId)&&!n.skills[_].lookupByName?a.jsx("button",{type:"button",className:"topo-skill-name topo-skill-open",onClick:()=>r(_),children:D.name}):a.jsx("span",{className:"topo-skill-name",children:D.name})}),D.description&&a.jsx("span",{className:"topo-skill-description",children:D.description})]},`${D.name}:${D.description}:${_}`)})}):j?null:a.jsx("div",{className:"topo-empty",children:y(k?(I=e.mpa)!=null&&I.skillSpaces.length?"agentTopology.noBoundSkills":"agentTopology.noBoundSpace":"agentTopology.notConfigured")}),j&&a.jsx("div",{className:"topo-data-error",role:"status",children:y(`agentTopology.${T}`)}),k&&(n==null?void 0:n.loading)&&E.length>0&&a.jsx("span",{role:"status",children:y("agentTopology.loadingSkills")})]}),!k&&l&&a.jsx("div",{className:"topo-capability-add-dock",children:a.jsxs("button",{type:"button",className:"topo-capability-add-slot","aria-label":y("agentTopology.addSkill"),disabled:m,onClick:()=>x("skill"),children:[a.jsx("span",{"aria-hidden":"true",children:"+"}),a.jsx("span",{children:y("agentTopology.addSkillHere")})]})})]}),(b||d.length>0)&&a.jsxs("section",{className:"topo-module-card topo-environment-card","aria-label":y("agentTopology.sessionEnvironment"),children:[a.jsx(o4,{title:y("agentTopology.environment"),count:d.length}),a.jsx(Nmt,{environments:c,workspaces:u,value:d,selectedWorkspaceIds:f,loading:h,disabled:m,error:g,onChange:b,onRefresh:v})]})]}),w==="skill"&&l&&yi.createPortal(a.jsxs("div",{className:"studio-tool-dialog-layer",children:[a.jsx("button",{type:"button",className:"studio-tool-dialog-scrim","aria-label":y("agentTopology.close"),onClick:()=>x(null)}),a.jsxs("section",{className:"studio-tool-dialog",role:"dialog","aria-modal":"true",children:[a.jsxs("header",{className:"studio-tool-dialog-head is-iconless",children:[a.jsxs("div",{children:[a.jsx("h2",{children:y("agentTopology.addSkill")}),a.jsx("p",{children:y("agentTopology.skillMountNextTurn")})]}),a.jsx("button",{type:"button",className:"studio-tool-dialog-close","aria-label":y("agentTopology.close"),onClick:()=>x(null),children:a.jsx(Do,{"aria-hidden":"true"})})]}),a.jsx("div",{className:"studio-tool-dialog-body",children:a.jsx(AIe,{selected:[...o],onChange:l})})]})]}),document.body)]})})}function Pmt(e){var i;if(((i=e.info)==null?void 0:i.agentCategory)!=="mpa")return null;const t=e.info.mpa,n=JSON.stringify([t==null?void 0:t.skillSpacesStatus,t==null?void 0:t.skillSpaces]);return a.jsx(Dmt,{...e,info:e.info},n)}function Dmt(e){const[t,n]=p.useState(null),[i,r]=p.useState(0),[s,o]=p.useState({skills:[],loading:!0,complete:!1}),l=e.info.mpa;return p.useEffect(()=>{const c=new AbortController;if((l==null?void 0:l.skillSpacesStatus)!=="ready")return o({skills:[],loading:!1,complete:!1,error:(l==null?void 0:l.skillSpacesStatus)??"unsupported"}),()=>c.abort();o(d=>({...d,loading:!0,error:void 0}));const u=new Map;return(async()=>{let d=!1;for(const f of l.skillSpaces){let h=0;for(let m=1;;m++){if(m>100)throw new Error("Skill pagination limit reached");const g=await SIe(f.id,{region:f.region,page:m,pageSize:100,signal:c.signal});if(c.signal.aborted)return;if(!Array.isArray(g.items)||!Number.isInteger(g.totalCount)||g.totalCount<0)throw new Error("Invalid SkillSpace page");const b=u.size;for(const v of g.items){if(typeof v.skillName!="string"||!v.skillName.trim())throw new Error("Invalid skill name");u.set(`${f.region}:${f.id}:${v.skillId||v.skillName}`,{spaceId:f.id,region:f.region,skillId:v.skillId,version:v.version,lookupByName:v.lookupByName,name:v.skillName,description:v.skillDescription||""})}if(h+=g.items.length,d||(d=g.degraded===!0),o({skills:[...u.values()],loading:!0,complete:!1}),h>=g.totalCount)break;if(!g.items.length||u.size===b)throw new Error("Skill pagination made no progress")}}c.signal.aborted||o({skills:[...u.values()],loading:!1,complete:!d,error:d?"degraded":void 0})})().catch(d=>{if(c.signal.aborted)return;const f=d instanceof e1&&[401,403].includes(d.status);o(h=>({skills:f?[]:u.size?[...u.values()]:h.skills,loading:!1,complete:!1,error:f?"forbidden":"error"}))}),()=>c.abort()},[l,i]),a.jsxs(a.Fragment,{children:[a.jsx(Imt,{...e,boundSkills:s,onOpenSkill:c=>n(s.skills[c]),onRefresh:()=>{e.onRefresh?e.onRefresh():r(c=>c+1)}}),t&&a.jsx(Kpt,{target:t,onClose:()=>n(null),onSaved:()=>r(c=>c+1)})]})}const sT={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};function Iee(e){return a.jsxs("svg",{...sT,...e,children:[a.jsx("rect",{x:"3.75",y:"5.25",width:"16.5",height:"13.5",rx:"2"}),a.jsx("path",{d:"m10.25 9 4.8 3-4.8 3V9Z"})]})}function Mmt(e){return a.jsxs("svg",{...sT,...e,children:[a.jsx("path",{d:"M12 3.75v10.5M8.4 10.8 12 14.4l3.6-3.6"}),a.jsx("path",{d:"M5 17.25v2h14v-2"})]})}function Lmt(e){return a.jsxs("svg",{...sT,...e,children:[a.jsx("path",{d:"M8.75 8.75 6.9 10.6a3.4 3.4 0 0 0 4.8 4.8l1.85-1.85"}),a.jsx("path",{d:"m15.25 15.25 1.85-1.85a3.4 3.4 0 0 0-4.8-4.8l-1.85 1.85"}),a.jsx("path",{d:"m9.4 14.6 5.2-5.2"})]})}function xI(e){return a.jsxs("svg",{...sT,...e,children:[a.jsx("path",{d:"M5 19h3.2L18.6 8.6a1.7 1.7 0 0 0 0-2.4l-.8-.8a1.7 1.7 0 0 0-2.4 0L5 15.8V19Z"}),a.jsx("path",{d:"m13.9 6.9 3.2 3.2M5 15.8 8.2 19"})]})}function FIe(e){return a.jsx("svg",{...sT,...e,children:a.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}const $mt=180,Pee=500,l4=10,Dee=32;function Fmt(e){return Array.from(new Set(e.split(/[,,]/).map(t=>t.trim()).filter(Boolean)))}function Bmt({artifact:e,busy:t,error:n,onClose:i,onSave:r}){const{t:s}=Te("workspaceTools"),[o,l]=p.useState(e.name),[c,u]=p.useState(e.description??""),[d,f]=p.useState((e.tags??[]).join(",")),[h,m]=p.useState(""),g=p.useId(),b=p.useId(),v=p.useRef(null),y=p.useRef(null),w=p.useRef(t),x=p.useRef(i);p.useEffect(()=>{w.current=t,x.current=i},[t,i]),p.useEffect(()=>{var j,T;const S=document.body.style.overflow,C=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(j=y.current)==null||j.focus(),(T=y.current)==null||T.select();const E=R=>{if(R.key==="Escape"&&!w.current){R.preventDefault(),x.current();return}if(R.key!=="Tab")return;const A=v.current;if(!A)return;const N=Array.from(A.querySelectorAll('button:not([disabled]), input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')).filter(D=>D.getClientRects().length>0);if(N.length===0){R.preventDefault();return}const P=N[0],I=N[N.length-1];R.shiftKey&&document.activeElement===P?(R.preventDefault(),I.focus()):!R.shiftKey&&document.activeElement===I&&(R.preventDefault(),P.focus())};return window.addEventListener("keydown",E),()=>{window.removeEventListener("keydown",E),document.body.style.overflow=S,C!=null&&C.isConnected&&C.focus()}},[]);const O=S=>{var j;S.preventDefault();const C=o.trim(),E=Fmt(d);if(!C){m(s("artifactEdit.nameRequired")),(j=y.current)==null||j.focus();return}if(E.length>l4){m(s("artifactEdit.tooManyTags",{max:l4}));return}if(E.some(T=>T.length>Dee)){m(s("artifactEdit.tagTooLong",{max:Dee}));return}m(""),r({name:C,description:c.trim(),tags:E})},k=h||n;return yi.createPortal(a.jsx("div",{className:"artifact-edit-backdrop",onMouseDown:S=>{S.target===S.currentTarget&&!t&&i()},children:a.jsxs("section",{ref:v,className:"artifact-edit-dialog",role:"dialog","aria-modal":"true","aria-labelledby":g,"aria-describedby":b,"aria-busy":t||void 0,children:[a.jsxs("header",{className:"artifact-edit-dialog__header",children:[a.jsxs("div",{children:[a.jsx("h2",{id:g,children:s("artifactEdit.title")}),a.jsx("p",{id:b,children:s("artifactEdit.subtitle")})]}),a.jsx("button",{type:"button",onClick:i,disabled:t,"aria-label":s("artifactEdit.close"),children:a.jsx(FIe,{})})]}),a.jsxs("form",{onSubmit:O,children:[a.jsxs("div",{className:"artifact-edit-dialog__body",children:[a.jsxs("label",{className:"artifact-edit-field",children:[a.jsx("span",{children:s("artifactEdit.name")}),a.jsx("input",{ref:y,value:o,maxLength:$mt,disabled:t,"aria-invalid":!!k||void 0,onChange:S=>{l(S.target.value),m("")}})]}),a.jsxs("label",{className:"artifact-edit-field",children:[a.jsx("span",{children:s("artifactEdit.description")}),a.jsx("textarea",{value:c,maxLength:Pee,disabled:t,rows:4,placeholder:s("artifactEdit.descriptionPlaceholder"),onChange:S=>u(S.target.value)}),a.jsxs("small",{children:[c.length,"/",Pee]})]}),a.jsxs("label",{className:"artifact-edit-field",children:[a.jsx("span",{children:s("artifactEdit.tags")}),a.jsx("input",{value:d,disabled:t,placeholder:s("artifactEdit.tagsPlaceholder",{max:l4}),onChange:S=>{f(S.target.value),m("")}})]}),k?a.jsx("div",{className:"artifact-edit-error",role:"alert",children:k}):null]}),a.jsxs("footer",{className:"artifact-edit-dialog__actions",children:[a.jsx("button",{type:"button",onClick:i,disabled:t,children:s("artifactEdit.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:t,children:s(t?"artifactEdit.saving":"artifactEdit.save")})]})]})]})}),document.body)}function BIe({label:e,menuLabel:t,items:n,placement:i="bottom-end"}){return a.jsxs(er,{children:[a.jsx(er.Trigger,{children:a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"md",iconSize:"sm",uniform:!0,"aria-label":e,title:e,disabled:n.length===0,children:a.jsx(eat,{"aria-hidden":"true"})})}),a.jsxs(er.Content,{side:i==="top-end"?"top":"bottom",align:"end",minWidth:148,children:[a.jsx("span",{className:"sr-only",children:t}),n.map(r=>a.jsx(er.Item,{disabled:r.disabled,onSelect:r.onSelect,children:a.jsx("span",{title:r.title,children:r.label})},r.label))]})]})}const Umt="_Alert_1tr02_1",Qmt="_Content_1tr02_145",zmt="_Indicator_1tr02_156",Vmt="_Message_1tr02_159",Hmt="_Title_1tr02_162",qmt="_Description_1tr02_168",Wmt="_Actions_1tr02_173",Xb={Alert:Umt,Content:Qmt,Indicator:zmt,Message:Vmt,Title:Hmt,Description:qmt,Actions:Wmt},Mg=({color:e="primary",variant:t="outline",title:n,description:i,actions:r,actionsPlacement:s,indicator:o,className:l,actionsClassName:c,ref:u,...d})=>{const f=p.useRef(null),h=p.useRef(null),[m,g]=p.useState("end"),{width:b}=nNe({ref:f});return p.useEffect(()=>{var y;const v=((y=h.current)==null?void 0:y.clientWidth)??0;if(v&&b){const w=v>b/3?"bottom":"end";g(w)}},[b]),a.jsxs("div",{ref:eT([u,f]),className:Ui(Xb.Alert,l),"data-variant":t,"data-color":e,role:e==="danger"?"alert":void 0,"data-actions-placement":s??m,...d,children:[o===!1?null:a.jsx("div",{className:Xb.Indicator,children:o??a.jsx(Kmt,{color:e})}),a.jsxs("div",{className:Xb.Content,children:[a.jsxs("div",{className:Xb.Message,children:[n&&a.jsx("div",{className:Xb.Title,children:n}),i&&a.jsx("div",{className:Xb.Description,children:i})]}),r&&a.jsx("div",{className:Ui(Xb.Actions,c),ref:h,children:r})]})]})},Kmt=({color:e})=>{switch(e){case"warning":case"caution":case"danger":return a.jsx(Ije,{});case"success":return a.jsx(Tje,{});default:return a.jsx(jje,{})}};function Cd({title:e,description:t,error:n,confirmLabel:i,cancelLabel:r,closeLabel:s,variant:o="warning",busy:l=!1,confirmDisabled:c=!1,onCancel:u,onConfirm:d}){const{t:f}=Te("shell"),h=r??f("confirm.cancel"),m=s??f("confirm.close"),g=p.useId(),b=p.useId(),v=p.useRef(null),y=p.useRef(l),w=p.useRef(u);return p.useEffect(()=>{y.current=l,w.current=u},[l,u]),p.useEffect(()=>{var S;const x=document.body.style.overflow,O=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(S=v.current)==null||S.focus();const k=C=>{C.key==="Escape"&&!y.current&&w.current()};return window.addEventListener("keydown",k),()=>{document.body.style.overflow=x,window.removeEventListener("keydown",k),O!=null&&O.isConnected&&O.focus()}},[]),yi.createPortal(a.jsx("div",{className:"studio-confirm-backdrop",onMouseDown:x=>{x.target===x.currentTarget&&!l&&u()},children:a.jsxs("section",{className:`studio-confirm-dialog studio-confirm-dialog--${o}`,role:"alertdialog","aria-modal":"true","aria-labelledby":g,"aria-describedby":b,"aria-busy":l||void 0,children:[a.jsxs("header",{className:"studio-confirm-head",children:[a.jsxs("div",{className:"studio-confirm-title-wrap",children:[a.jsx("span",{className:"studio-confirm-title-icon","aria-hidden":"true",children:a.jsx(Ije,{})}),a.jsx("h2",{id:g,children:e})]}),a.jsx(_t,{type:"button",className:"studio-confirm-close",color:"secondary",variant:"ghost",size:"lg",uniform:!0,pill:!1,onClick:u,disabled:l,"aria-label":m,children:a.jsx(pV,{})})]}),a.jsxs("div",{className:"studio-confirm-body",children:[a.jsx("div",{id:b,children:t}),n?a.jsx(Mg,{className:"studio-confirm-error",color:"danger",variant:"soft",description:n}):null]}),a.jsxs("footer",{className:"studio-confirm-actions",children:[a.jsx(_t,{ref:v,type:"button",color:"secondary",variant:"ghost",size:"lg",pill:!1,onClick:u,disabled:l,children:h}),a.jsx(_t,{type:"button",className:"studio-confirm-primary",color:o==="danger"?"danger":"primary",size:"lg",pill:!1,loading:l,onClick:d,disabled:l||c,children:i})]})]})}),document.body)}const Gmt="_Container_1a6nz_1",Xmt="_Input_1a6nz_229",Mee={Container:Gmt,Input:Xmt},_s=e=>{const t=p.useRef(null),i=`search-ui-input-${p.useId()}`,{id:r,name:s,type:o="text",variant:l="outline",size:c="md",gutterSize:u,className:d,autoComplete:f,disabled:h=!1,readOnly:m=!1,invalid:g=!1,allowAutofillExtensions:b=o==="password"||!!s||!!f&&f!=="off",onFocus:v,onBlur:y,onAnimationStart:w,onAutofill:x,autoSelect:O,startAdornment:k,endAdornment:S,pill:C,opticallyAlign:E,ref:j,...T}=e,R=I=>{const D=t.current;if(!I.target||!(I.target instanceof Element)||!D||D.contains(I.target)||I.target.closest("button, [type='button'], [role='button'], [role='menuitem']"))return;I.preventDefault(),document.activeElement!==D&&D.focus();const{left:_,top:L}=D.getBoundingClientRect(),{clientX:F,clientY:M}=I,V=M{var I;O&&((I=t.current)==null||I.select())},[O]);const P=I=>{w==null||w(I),I.animationName==="native-autofill-in"&&(x==null||x())};return a.jsxs("div",{className:Ui(Mee.Container,d),"data-variant":l,"data-size":c,"data-gutter-size":u,"data-focused":A,"data-disabled":h?"":void 0,"data-readonly":m?"":void 0,"data-invalid":g?"":void 0,"data-pill":C?"":void 0,"data-optically-align":E,"data-has-start-adornment":k?"":void 0,"data-has-end-adornment":S?"":void 0,onMouseDown:R,children:[k,a.jsx("input",{...T,ref:eT([j,t]),id:r||(b?void 0:i),className:Mee.Input,type:o,name:s,autoComplete:f,readOnly:m,disabled:h,onFocus:I=>{N(!0),v==null||v(I)},onBlur:I=>{N(!1),y==null||y(I)},onAnimationStart:P,"data-lpignore":b?void 0:!0,"data-1p-ignore":b?void 0:!0}),S]})},Ymt="_SelectControl_1tyi7_1",Zmt="_Clear_1tyi7_436",Jmt="_DropdownIcon_1tyi7_437",egt="_TriggerText_1tyi7_468",tgt="_IndicatorWrapper_1tyi7_476",ngt="_StartIcon_1tyi7_482",igt="_DropdownIconChevron_1tyi7_534",rgt="_LoadingIndicator_1tyi7_537",hp={SelectControl:Ymt,Clear:Zmt,DropdownIcon:Jmt,TriggerText:egt,IndicatorWrapper:tgt,StartIcon:ngt,DropdownIconChevron:igt,LoadingIndicator:rgt},sgt=({ref:e,onPointerDown:t,onKeyDown:n,onPointerEnter:i,onInteract:r,invalid:s,disabled:o,children:l,className:c,variant:u="outline",size:d="md",block:f,opticallyAlign:h,pill:m=!0,loading:g,onClearClick:b,selected:v=!1,StartIcon:y,dropdownIconType:w="dropdown",...x})=>{const O=p.useRef(null),S=!!b&&v&&!g&&!o,C=w&&w!=="none"&&!g,E=S||g||C,j=!g&&!o,T=A=>{var N;switch(A.key){case"ArrowDown":case"ArrowUp":case" ":A.stopPropagation(),A.preventDefault(),r?r():(N=O.current)==null||N.dispatchEvent(new PointerEvent("pointerdown",{bubbles:!0,cancelable:!0,pointerType:"mouse"}));break;case"Enter":break;default:n==null||n(A)}},R=A=>{var N;A.button!==2&&(A.stopPropagation(),r?(A.preventDefault(),r()):(t==null||t(A),(N=x.onClick)==null||N.call(x,A)))};return a.jsxs("span",{ref:eT([O,e]),className:Ui(hp.SelectControl,c),role:"button",tabIndex:o?-1:0,onPointerEnter:A=>{kV(A),i==null||i(A)},onPointerDown:j?R:void 0,onKeyDown:j?T:void 0,"data-variant":u,"data-block":f?"":void 0,"data-pill":m?"":void 0,"data-size":d,"data-optically-align":h,"aria-busy":g?"true":void 0,"data-selected":v,"data-loading":g?"":void 0,"data-invalid":s?"":void 0,"data-disabled":o?"":void 0,"aria-disabled":o,...x,onClick:void 0,children:[y&&a.jsx(y,{className:hp.StartIcon}),a.jsx("span",{className:hp.TriggerText,children:l}),E&&a.jsxs("div",{className:hp.IndicatorWrapper,children:[S&&a.jsx(_t,{"aria-label":"Clear current value",className:hp.Clear,onPointerDown:A=>{A.stopPropagation()},onClick:A=>{A.stopPropagation(),A.preventDefault(),b()},color:"secondary",variant:C?"ghost":"solid",size:"3xs",uniform:!0,pill:m,"data-only-child":C?void 0:"",children:a.jsx(pV,{})}),g&&a.jsx(WA,{className:hp.LoadingIndicator}),C&&a.jsx(agt,{iconType:w})]})]})},agt=({iconType:e})=>e==="chevronDown"?a.jsx(Gst,{className:Ui(hp.DropdownIcon,hp.DropdownIconChevron)}):a.jsx(tat,{className:hp.DropdownIcon}),ogt="_Menu_n4tw6_3",lgt="_MenuList_n4tw6_5",cgt="_MenuInner_n4tw6_50",ugt="_OptionsList_n4tw6_64",dgt="_Option_n4tw6_64",fgt="_PressableInner_n4tw6_111",hgt="_OptionInner_n4tw6_113",pgt="_OptionCheck_n4tw6_118",mgt="_OptionIndicatorSlot_n4tw6_123",ggt="_OptionGroupHeading_n4tw6_128",bgt="_OptionHardLimitHeading_n4tw6_140",ygt="_OptionsLimit_n4tw6_147",vgt="_Action_n4tw6_152",xgt="_ActionInner_n4tw6_218",wgt="_ActionsContainer_n4tw6_224",Ogt="_Search_n4tw6_244",kgt="_SearchEmpty_n4tw6_247",ys={Menu:ogt,MenuList:lgt,MenuInner:cgt,OptionsList:ugt,Option:dgt,PressableInner:fgt,OptionInner:hgt,OptionCheck:pgt,OptionIndicatorSlot:mgt,OptionGroupHeading:ggt,OptionHardLimitHeading:bgt,OptionsLimit:ygt,Action:vgt,ActionInner:xgt,ActionsContainer:wgt,Search:Ogt,SearchEmpty:kgt},UIe=p.createContext(null),Ab=()=>{const e=p.use(UIe);if(!e)throw new Error("Select components must be wrapped in ");return e},Cgt=({label:e})=>a.jsx(a.Fragment,{children:e}),Agt=({label:e})=>a.jsx(a.Fragment,{children:e}),Tgt=({values:e,selectedAll:t})=>{const n=t?"All selected":e.length===0?"Select...":e.length===1?e[0].label:`${e.length} selected`;return a.jsx(a.Fragment,{children:n})},ha=e=>{const{id:t,required:n,value:i,name:r,multiple:s,variant:o="outline",size:l="md",dropdownIconType:c="dropdown",loading:u=!1,clearable:d=!1,disabled:f=!1,placeholder:h="Select...",loadingPlaceholder:m="Loading...",pill:g=!0,listWidth:b,options:v,actions:y=[],side:w="bottom",avoidCollisions:x=!0,onChange:O,optionClassName:k,OptionView:S=Cgt,TriggerStartIcon:C,triggerClassName:E,opticallyAlign:j,TriggerView:T,searchPlaceholder:R="",searchPredicate:A=Bgt,searchEmptyMessage:N="No results found.",listMaxWidth:D="auto"}=e,I=e.block??o!=="ghost",P=e.align??(I?"center":"start"),_=e.alignOffset??(P==="center"?0:-5),L=e.listMinWidth??(I?"auto":300),F=sb((H,ae)=>{if(s){if(!H.value){O([]);return}if(ae){const Y=i.filter(ie=>ie!==H.value),K=MB(v,Y);O(K)}else{const Y=MB(v,i);O(Y.concat(H))}}else O(H)}),M=p.useRef(A);M.current=A;const V=p.useMemo(()=>y,[y.length]),q=p.useRef(y);q.current=y;const U=p.useCallback(H=>{var ae;(ae=q.current.find(Y=>Y.id===H))==null||ae.onSelect(H)},[]),Z=p.useMemo(()=>bH(v)?v.reduce((H,ae)=>H+ae.options.length,0):v.length,[v]),ee=`select-trigger-${p.useId()}`,ne=Z>15,W=p.useMemo(()=>s?{multiple:!0,value:i,TriggerView:T??Tgt}:{multiple:!1,value:i,TriggerView:T??Agt},[s,i,T]),X=p.useMemo(()=>({...W,triggerId:ee,id:t,name:r,required:n,options:v,placeholder:h,loadingPlaceholder:m,loading:u,clearable:d,variant:o,pill:g,size:l,dropdownIconType:c,block:I,align:P,alignOffset:_,side:w,avoidCollisions:x,listWidth:b,listMinWidth:L,listMaxWidth:D,searchPlaceholder:R,searchEmptyMessage:N,TriggerStartIcon:C,triggerClassName:E,opticallyAlign:j,optionClassName:k,OptionView:S,actions:V,onActionSelect:U,onSelectRef:F,searchPredicateRef:M,searchable:ne,disabled:f}),[W,ee,t,n,r,v,h,m,u,d,o,g,l,c,I,P,_,w,x,b,L,D,R,N,C,E,j,k,S,V,U,F,ne,f]);return a.jsx(QIe.Provider,{value:X,children:a.jsx(jgt,{})})},_gt=e=>{const{triggerId:t,id:n,required:i,value:r,multiple:s,options:o,loading:l,disabled:c,clearable:u,name:d,variant:f,pill:h,size:m,dropdownIconType:g,placeholder:b,loadingPlaceholder:v,block:y,opticallyAlign:w,triggerClassName:x,TriggerStartIcon:O,TriggerView:k,onSelectRef:S}=Tb(),{onOpenChange:C,...E}=e,j=s?r[0]:r,T=l?v:b,R=p.useMemo(()=>Qgt(o,j)||{value:"",label:T},[j,o,T]),A=s?r.length>0:!!r,N=l||!A,D=p.useMemo(()=>KIe(),[]),I=p.useMemo(()=>{if(!s)return{values:[],selectedAll:!1};const L=MB(o,r),F=o.flatMap(M=>"options"in M?M.options:M);return{values:L.length?L:[{value:"",label:T}],selectedAll:F.length<=r.length}},[s,o,r,T]),P=L=>{const F=L.key;if(!s&&GIe(F)){const M=D(F);L.stopPropagation();const V=XIe(o,M,j);V&&S.current(V)}},_=()=>{S.current({value:"",label:""}),C==null||C(!1)};return a.jsxs(ogt,{id:t,className:x,selected:!N,variant:f,pill:h,block:y,size:m,disabled:c,loading:l,StartIcon:O,opticallyAlign:w,dropdownIconType:g,onClearClick:u?_:void 0,onInteract:C,onKeyDown:P,...E,children:[s?a.jsx(k,{...I}):a.jsx(k,{...R}),(d||n)&&a.jsx("input",{id:n,name:d,value:j,tabIndex:-1,onFocus:()=>{var L;(L=document.getElementById(t))==null||L.focus()},onChange:()=>{},required:i,className:"sr-only w-full h-0 left-0 bottom-0 pointer-events-none","aria-hidden":"true"})]})},jgt=()=>{const{triggerId:e,loading:t,side:n,align:i,alignOffset:r,avoidCollisions:s,listWidth:o,listMinWidth:l,listMaxWidth:c}=Tb(),[u,d]=p.useState(!1),f=p.useRef(null),h=m=>{const g=m===void 0?!u:m;d(g),g||setTimeout(()=>{var v;if(!f.current)return;const b=document.activeElement;b&&!f.current.contains(b)||(v=document.getElementById(e))==null||v.focus()})};return eT(u,()=>{h(!1)}),a.jsxs(PRe,{open:u,onOpenChange:m=>{t&&m||h(m)},modal:!1,children:[a.jsx(DRe,{asChild:!0,children:a.jsx(_gt,{onOpenChange:h})}),a.jsx(MRe,{forceMount:!0,children:a.jsx(Z1,{className:ys.Menu,enterDuration:350,exitDuration:200,disableAnimations:!0,children:u&&a.jsx(LRe,{ref:f,forceMount:!0,className:ys.MenuList,side:n,sideOffset:5,align:i,alignOffset:r,avoidCollisions:s,collisionPadding:{bottom:30,top:30},onOpenAutoFocus:Mp,onCloseAutoFocus:Mp,onEscapeKeyDown:Mp,style:V0({"select-list-width":o,"select-list-min-width":l,"select-list-max-width":c}),children:a.jsx(Ngt,{onOpenChange:h})},"dropdown")})})]})},zIe=p.createContext(null),tO=()=>{const e=p.use(zIe);if(!e)throw new Error("CustomSelectMenu components must be wrapped in ");return e},Ngt=({onOpenChange:e})=>{const{multiple:t,value:n,options:i,searchable:r,searchPredicateRef:s}=Tb(),o=p.useRef(()=>e(!1)),l=p.useRef(null),c=p.useRef(null),u=p.useRef(null),[d,f]=p.useState(""),[h,m]=p.useState(()=>{var j;return((t?n[0]:n)||((j=b_(i))==null?void 0:j.value))??""}),g=p.useMemo(()=>KIe(),[]),v=`select-list-${p.useId()}`,y=p.useRef(t?"":n),w=p.useMemo(()=>d.trim().toLocaleLowerCase(),[d]),x=p.useMemo(()=>Ugt(i,w,s.current),[i,w,s]),O=p.useMemo(()=>b_(x),[x]),k=p.useRef(!1),S=E=>{const j=E.key,T=t?n[0]:n,R=h||(O==null?void 0:O.value)||T,A=document.activeElement===u.current,N=l.current;if(!N)return;const D=()=>{const _=new PointerEvent("pointerup",{bubbles:!0,cancelable:!0,pointerType:"mouse"}),L=fp(h,N);L==null||L.dispatchEvent(_)},I=(_,L)=>{m(_),L.scrollIntoView({block:"nearest"})},P=()=>{const _=t?n[0]:n;if(_){const F=fp(_,N);if(F){I(_,F);return}}const L=b_(i);if(L){const F=fp(L.value,N);F&&I(L.value,F)}};switch(j){case"ArrowDown":{if(E.preventDefault(),!h||!fp(h,N)){P();return}const _=zgt(h,N),L=_==null?void 0:_.getAttribute("data-option-id");_&&L&&I(L,_);return}case"ArrowUp":{if(E.preventDefault(),!h||!fp(h,N)){P();return}const _=Vgt(R,N),L=_==null?void 0:_.getAttribute("data-option-id");_&&L&&I(L,_);return}case"Enter":E.preventDefault(),D();return;case" ":if(w&&A)return;E.preventDefault(),D();return}if(GIe(j)){if(A)return;const _=g(j);E.stopPropagation();const L=XIe(i,_,h);if(L){const F=fp(L.value,N);F&&(m(L.value),F.scrollIntoView({block:"nearest"}))}}},C=p.useMemo(()=>({valueRef:y,listId:v,highlightedValue:h,setHighlightedValue:m,requestCloseRef:o,searchTerm:d,setSearchTerm:f,searchInputRef:u,listRef:c}),[v,h,m,d,f]);return p.useEffect(()=>{pI(()=>{if(!l.current)return;const j=fp(h,l.current);j==null||j.scrollIntoView({block:"center"})});const E=u.current||l.current;return E==null||E.focus({preventScroll:!0}),()=>{k.current=!1}},[]),p.useLayoutEffect(()=>{if(!k.current){k.current=!0;return}if(!c.current)return;c.current.scrollTop=0;const E=b_(x);E&&m(E.value)},[x]),a.jsx(zIe,{value:C,children:a.jsxs("div",{id:v,className:ys.MenuInner,onKeyDown:S,ref:l,tabIndex:0,children:[r&&a.jsx(Rgt,{value:d,onChange:f}),a.jsx(Igt,{filteredOptions:x}),a.jsx($gt,{})]})})},Rgt=({value:e,onChange:t})=>{const{searchPlaceholder:n}=Tb(),{listId:i,searchInputRef:r}=tO(),s=o=>{t(o.target.value)};return a.jsx("div",{className:ys.Search,children:a.jsx(_s,{startAdornment:a.jsx(hat,{width:16,height:16,className:"fill-secondary"}),ref:r,value:e,placeholder:n,onChange:s,autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-controls":i,"aria-expanded":!0})})},oT=e=>"options"in e,bH=e=>e[0]&&oT(e[0]),fw=300,Igt=({filteredOptions:e})=>{const{searchEmptyMessage:t}=Tb(),{listRef:n}=tO();if(!e.length)return typeof t=="string"?a.jsx("p",{className:ys.SearchEmpty,"data-text-only":!0,children:t}):a.jsx("div",{className:ys.SearchEmpty,children:t});const i=bH(e),r=!i&&e.length>fw,s=i?e.map(o=>a.jsx(Dgt,{...o},o.label)):e.slice(0,fw).map(o=>a.jsx(HIe,{...o},o.value));return a.jsxs("div",{className:ys.OptionsList,ref:n,children:[s,r&&a.jsx(VIe,{numHidden:e.length-fw})]})},Pgt={limit:100,label:"Show all"},Dgt=({label:e,options:t,optionsLimit:n=Pgt})=>{const i=p.useId(),{searchTerm:r,setHighlightedValue:s}=tO(),[o,l]=p.useState(!1),c=n.limit{l(!0),s(t[n.limit].value)};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:ys.OptionGroupHeading,children:[a.jsx("div",{className:ys.OptionIndicatorSlot}),e]}),d.map(h=>a.jsx(HIe,{...h},h.value)),c&&a.jsx(Mgt,{value:`group-limit-${i}`,label:n.label,onPointerUp:f}),u&&a.jsx(VIe,{numHidden:t.length-fw})]})},VIe=({numHidden:e})=>a.jsxs("div",{className:ys.OptionHardLimitHeading,children:[a.jsx("div",{className:ys.OptionIndicatorSlot}),`…and ${e.toLocaleString()} more options. Use search to refine results further.`]}),Mgt=({value:e,label:t,onPointerUp:n})=>{const{highlightedValue:i,setHighlightedValue:r}=tO(),s=e===i,o=()=>{s||r(e)},l=()=>{r(c=>c!==e?c:"")};return a.jsx("div",{className:Qi(ys.Option,ys.OptionsLimit),"data-option-id":e,"data-highlight":s?"":void 0,role:"option","aria-selected":s,onPointerUp:n,onPointerMove:o,onPointerLeave:l,children:a.jsxs("div",{className:Qi(ys.PressableInner,ys.OptionInner),children:[a.jsx("div",{className:ys.OptionIndicatorSlot}),t]})})},Lgt="data-option-id",HIe=e=>{const{optionClassName:t,OptionView:n,value:i,multiple:r,onSelectRef:s}=Tb(),{valueRef:o,requestCloseRef:l,highlightedValue:c,setHighlightedValue:u}=tO(),{value:d,disabled:f,tooltip:h}=e,m=o.current,g=r?i.includes(d):d===m,b=d===c,v=()=>{var x;r?s.current(e,g):(s.current(e),(x=l.current)==null||x.call(l))},y=()=>{b||u(d)},w=()=>{u(x=>x!==d?x:"")};return a.jsx("div",{className:Qi(ys.Option,t),"data-highlight":b?"":void 0,role:"option","aria-selected":b,"data-selected":g?"":void 0,[Lgt]:d,onPointerUp:f?void 0:v,onPointerMove:f?void 0:y,onPointerLeave:f?void 0:w,"aria-disabled":f,"data-disabled":f?"":void 0,children:a.jsxs("div",{className:ys.PressableInner,children:[a.jsxs("div",{className:ys.OptionInner,children:[a.jsx("div",{className:ys.OptionIndicatorSlot,children:g&&a.jsx(hC,{className:ys.OptionCheck})}),a.jsx(n,{...e}),h&&a.jsx(ka,{content:h.content,maxWidth:h.maxWidth,side:"right",children:a.jsx(Nje,{})})]}),e.description&&a.jsxs("div",{className:ys.OptionInner,children:[a.jsx("div",{className:ys.OptionIndicatorSlot}),e.description]})]})})},$gt=()=>{const{actions:e}=Tb();return e.length===0?null:a.jsx("div",{className:ys.ActionsContainer,children:e.map(t=>a.jsx(Fgt,{...t},t.id))})},Fgt=({id:e,label:t,Icon:n,className:i})=>{const{onActionSelect:r}=Tb(),{requestCloseRef:s}=tO(),o=c=>{switch(c.key){case"Tab":break;case"Enter":case" ":c.stopPropagation(),l();break;default:c.stopPropagation()}},l=()=>{var c;r(e),(c=s.current)==null||c.call(s)};return a.jsx("div",{className:ys.Action,onPointerUp:l,onKeyDown:o,tabIndex:0,children:a.jsxs("div",{className:Qi(ys.ActionInner,i),children:[n&&a.jsx(n,{role:"presentation"}),t]})})},Bgt=(e,t)=>e.label.toLowerCase().includes(t),Ugt=(e,t,n)=>{const i=t.trim().toLocaleLowerCase();if(!i)return e;const r=s=>n(s,i);return bH(e)?e.reduce((s,o)=>{const l=o.options.filter(r);return l.length&&s.push({...o,options:l}),s},[]):e.reduce((s,o)=>(r(o)&&s.push(o),s),[])},b_=e=>{if(!e.length)return;let t;for(const n of e)if(oT(n)){const i=n.options.find(r=>!r.disabled);if(i){t=i;break}}else if(!n.disabled){t=n;break}return t},Qgt=(e,t)=>{let n;for(const i of e)if(oT(i)){const r=i.options.find(s=>s.value===t);if(r){n=r;break}}else if(i.value===t){n=i;break}return n},MB=(e,t)=>{let n=[];const i=new Set(t);for(const r of e)if(oT(r)){const s=r.options.filter(o=>i.has(o.value));n=n.concat(s)}else i.has(r.value)&&n.push(r);return n},qIe=40,fp=(e,t)=>t.querySelector(`[data-option-id="${e}"]`),WIe=e=>e.matches("[data-option-id]:not([data-disabled])"),zgt=(e,t)=>{const n=fp(e,t);let i=n==null?void 0:n.nextElementSibling,r=0;for(;i&&r{const n=fp(e,t);let i=n==null?void 0:n.previousElementSibling,r=0;for(;i&&r{let e="",t;return n=>(n=n.toLowerCase(),e+=n,t&&clearTimeout(t),t=setTimeout(()=>{e=""},500),n.repeat(e.length)===e?n:e)},GIe=e=>/^[a-zA-Z0-9]$/.test(e),XIe=(e,t,n)=>{if(!e.length)return;let i,r,s=!n;const o=({disabled:l,label:c,value:u})=>u===n?(s=!0,!1):!l&&c.toLowerCase().startsWith(t);for(const l of e)if(oT(l)){for(const c of l.options)if(o(c))if(s){r=c;break}else i=i||c}else if(o(l))if(s){r=l;break}else i=i||l;return r||i};function Ja(...e){return e.filter(Boolean).join(" ")}const $ee=[["14 90% 62%","28 96% 80%","3 44% 24%"],["198 72% 56%","217 88% 79%","189 42% 24%"],["263 66% 63%","291 72% 81%","242 39% 25%"],["146 49% 52%","169 66% 78%","158 38% 23%"],["334 72% 63%","15 87% 80%","350 41% 25%"]];function Hgt(e){let t=2166136261;for(const o of e)t^=o.charCodeAt(0),t=Math.imul(t,16777619);const n=t>>>0,[i,r,s]=$ee[n%$ee.length];return{"--resource-identity-accent":i,"--resource-identity-glow":r,"--resource-identity-shadow":s,"--resource-identity-x":`${20+(n>>>7)%61}%`,"--resource-identity-y":`${18+(n>>>15)%57}%`}}function n1({seed:e,className:t}){return a.jsx("span",{className:Ja("resource-card__identity-mark",t),style:Hgt(e),"aria-hidden":"true"})}function qgt(e){return a.jsx("svg",{viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",...e,children:a.jsxs("g",{transform:"translate(0.875 0.875)",children:[a.jsx("path",{d:"M5.869 10.719a4.849 4.849 0 1 0 0-9.698 4.849 4.849 0 0 0 0 9.698Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),a.jsx("path",{d:"m11.229 11.229-1.021-1.021",stroke:"currentColor",strokeWidth:"0.984375",strokeLinecap:"round",strokeLinejoin:"round"})]})})}function Sh({className:e,...t}){return a.jsx("section",{className:Ja("resource-page",e),...t})}function W0({title:e,description:t,className:n}){return a.jsxs("header",{className:Ja("resource-page__header",n),children:[a.jsx("h1",{children:e}),t?a.jsx("p",{children:t}):null]})}function Wgt({className:e,...t}){return a.jsx("div",{className:Ja("resource-detail",e),...t})}function Kgt({className:e,...t}){return a.jsx("header",{className:Ja("resource-detail__header",e),...t})}function Ggt({title:e,description:t,identitySeed:n,meta:i,backLabel:r,onBack:s}){const{t:o}=Te("ui"),l=r??o("resourceCollection.back");return a.jsxs("div",{className:"resource-detail__heading",children:[s?a.jsx("button",{type:"button",className:"resource-detail__back",onClick:s,"aria-label":l,title:l,children:a.jsx(Aat,{"aria-hidden":"true"})}):null,a.jsxs("div",{className:"resource-detail__heading-copy",children:[a.jsxs("div",{className:"resource-detail__title-row",children:[a.jsx("span",{className:"resource-detail__identity",children:a.jsx(n1,{seed:n})}),a.jsx("h1",{children:e}),i?a.jsx("div",{className:"resource-detail__meta",children:i}):null]}),t?a.jsx("p",{children:t}):null]})]})}function Xgt({className:e,...t}){return a.jsx("div",{className:Ja("resource-detail__actions",e),...t})}function Ygt({className:e,...t}){return a.jsx("div",{className:Ja("resource-detail__body",e),...t})}function lT({title:e,description:t,identitySeed:n,meta:i,backLabel:r,onBack:s,actions:o,className:l,actionsClassName:c,bodyClassName:u,sections:d,activeSectionKey:f,navigationLabel:h,onSectionChange:m,children:g}){var x;const{t:b}=Te("ui"),v=!!(d!=null&&d.length),y=(x=d==null?void 0:d.find(O=>O.key===f))==null?void 0:x.content,w=h??b("resourceCollection.detailNavigation");return a.jsxs(Wgt,{className:l,children:[a.jsxs(Kgt,{children:[a.jsx(Ggt,{title:e,description:t,identitySeed:n,meta:i,backLabel:r,onBack:s}),o?a.jsx(Xgt,{className:c,children:o}):null]}),a.jsx(Ygt,{className:Ja(v&&"is-split",u),children:v?a.jsxs(a.Fragment,{children:[a.jsx("nav",{className:"resource-detail__navigation","aria-label":w,children:d==null?void 0:d.map(O=>a.jsx(_t,{type:"button",color:"secondary",variant:O.key===f?"soft":"ghost",size:"lg",pill:!1,block:!0,"aria-current":O.key===f?"page":void 0,disabled:O.disabled,onClick:()=>m==null?void 0:m(O.key),children:a.jsx("span",{className:"resource-detail__navigation-label",children:O.label})},O.key))}),a.jsx("div",{className:"resource-detail__content",children:y})]}):g})]})}function yH({className:e,...t}){return a.jsx("dl",{className:Ja("resource-detail__summary",e),...t})}function YIe({title:e,description:t,actions:n,className:i}){return a.jsxs("header",{className:Ja("resource-detail__section-header",i),children:[a.jsxs("div",{children:[a.jsx("h2",{children:e}),t?a.jsx("p",{children:t}):null]}),n]})}function vH({rows:e,rowKey:t,rowLabel:n,columns:i,searchValue:r,onSearchChange:s,searchPlaceholder:o,searchLabel:l,toolbarActions:c,primaryAction:u,rowActions:d,scrollRef:f,onScroll:h,busy:m,footer:g,emptyLabel:b}){const{t:v}=Te("ui"),y=!!d,w=b??v("resourceCollection.noData");return a.jsxs("div",{className:"resource-data-table",children:[a.jsxs("div",{className:"resource-data-table__toolbar",children:[a.jsx("div",{className:"resource-data-table__search",children:a.jsx(_s,{type:"search",value:r,onChange:x=>s(x.target.value),placeholder:o,"aria-label":l})}),c,u?a.jsx(_t,{type:"button",color:"primary",disabled:u.disabled,title:u.title,onClick:u.onClick,children:u.label}):null]}),a.jsxs("div",{ref:f,className:"resource-data-table__frame","aria-busy":m||void 0,onScroll:h,children:[a.jsxs("table",{className:"resource-data-table__table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[i.map(x=>a.jsx("th",{scope:"col",className:x.className,children:x.header},x.key)),y?a.jsx("th",{scope:"col",className:"resource-data-table__actions-heading",children:a.jsx("span",{className:"sr-only",children:v("resourceCollection.actions")})}):null]})}),a.jsx("tbody",{children:e.length===0?a.jsx("tr",{children:a.jsx("td",{className:"resource-data-table__empty",colSpan:i.length+(y?1:0),children:w})}):e.map(x=>{const O=t(x),k=(n==null?void 0:n(x))??O;return a.jsxs("tr",{children:[i.map(S=>a.jsx("td",{className:S.className,children:S.render(x)},S.key)),d?a.jsx("td",{className:"resource-data-table__actions",children:a.jsx(UIe,{label:v("resourceCollection.moreActions",{label:k}),menuLabel:v("resourceCollection.actionsFor",{label:k}),items:d(x)})}):null]},O)})})]}),g]})]})}function ab({className:e,...t}){return a.jsx("div",{className:Ja("resource-toolbar",e),...t})}function ob({items:e,value:t,onChange:n,ariaLabel:i,idPrefix:r,className:s}){const o=c=>{c.disabled||n(c.id)},l=(c,u)=>{var g;if(!["ArrowLeft","ArrowRight","Home","End"].includes(c.key))return;c.preventDefault();const d=e.filter(b=>!b.disabled),f=d.findIndex(b=>b.id===u.id),h=c.key==="Home"?0:c.key==="End"?d.length-1:(f+(c.key==="ArrowRight"?1:-1)+d.length)%d.length,m=d[h];m&&(n(m.id),(g=document.getElementById(`${r}-${m.id}-tab`))==null||g.focus())};return a.jsx("nav",{className:Ja("resource-tabs",s),"aria-label":i,role:"tablist",children:e.map(c=>a.jsx("button",{type:"button",id:`${r}-${c.id}-tab`,className:t===c.id?"is-active":void 0,role:"tab","aria-selected":t===c.id,"aria-controls":c.panelId,tabIndex:t===c.id?0:-1,disabled:c.disabled,onClick:()=>o(c),onKeyDown:u=>l(u,c),children:c.label},c.id))})}function Jp({className:e,...t}){return a.jsxs("label",{className:Ja("resource-search",e),children:[a.jsx(qgt,{}),a.jsx("input",{type:"search",...t})]})}const Zgt=150,Jgt=200;function Fee(e){e.dispatchEvent(new PointerEvent("pointerdown",{bubbles:!0,cancelable:!0,pointerType:"mouse",button:0}))}function lb({id:e,ariaLabel:t,value:n,options:i,onChange:r,className:s,disabled:o=!1}){const l=p.useRef(null),c=p.useRef(null),u=p.useRef(null),d=p.useRef(!1),f=p.useCallback(()=>{c.current!==null&&(window.clearTimeout(c.current),c.current=null)},[]),h=p.useCallback(()=>{u.current!==null&&(window.clearTimeout(u.current),u.current=null)},[]),m=p.useCallback(()=>{var y;return((y=l.current)==null?void 0:y.querySelector(".resource-filter-select__trigger"))??null},[]),g=p.useCallback(()=>{h();const y=m();d.current&&(y==null?void 0:y.getAttribute("data-state"))==="open"&&Fee(y),d.current=!1},[h,m]),b=p.useCallback(()=>{d.current&&(h(),u.current=window.setTimeout(g,Jgt))},[h,g]),v=p.useCallback(y=>{var O;if(o||!window.matchMedia("(hover: hover) and (pointer: fine)").matches)return;h();const w=m();if(!w||w.getAttribute("data-state")==="open")return;const x=document.activeElement;x instanceof HTMLElement&&x!==w&&!((O=l.current)!=null&&O.contains(x))&&x.matches("input, textarea, [contenteditable='true']")||(f(),c.current=window.setTimeout(()=>{const k=m();!k||k.getAttribute("data-state")==="open"||(d.current=!0,Fee(k))},Zgt))},[h,f,o,m]);return p.useEffect(()=>{const y=w=>{var C;if(!d.current)return;const x=m();if(!x||x.getAttribute("data-state")!=="open"){d.current=!1,h();return}const O=w.target;if(!(O instanceof Node))return;const k=x.getAttribute("aria-controls"),S=k?document.getElementById(k):null;if((C=l.current)!=null&&C.contains(O)||S!=null&&S.contains(O)){h();return}b()};return document.addEventListener("pointermove",y,{passive:!0}),()=>{document.removeEventListener("pointermove",y),f(),h()}},[h,f,m,b]),a.jsxs("div",{ref:l,className:Ja("resource-filter-select",s),onMouseEnter:v,onMouseLeave:()=>{f(),b()},children:[a.jsx("label",{className:"sr-only",htmlFor:e,children:t}),a.jsx(ha,{id:e,value:n,options:i,size:"md",variant:"ghost",pill:!1,block:!1,align:"end",listMinWidth:160,disabled:o,triggerClassName:"resource-filter-select__trigger",onChange:y=>r(y.value)})]})}const em=p.forwardRef(function({className:t,...n},i){return a.jsx("section",{ref:i,className:Ja("resource-results",t),...n})});function cl(){const{t:e}=Te("ui");return a.jsxs("div",{className:"resource-loading-state",role:"status","aria-live":"polite","aria-busy":"true",children:[a.jsx(KA,{size:16}),a.jsx(cn,{as:"span",duration:2.4,children:e("resourceCollection.loading")})]})}function K0({className:e,...t}){return a.jsx("div",{className:Ja("resource-grid",e),...t})}function xH({className:e,footer:t,actions:n,activateLabel:i,onActivate:r,children:s,...o}){return a.jsxs("article",{className:Ja("resource-card",r&&"is-interactive",e),...o,children:[r&&i?a.jsx("button",{type:"button",className:"resource-card__target","aria-label":i,title:i,onClick:r}):null,a.jsx("div",{className:"resource-card__content",children:s}),t||n?a.jsxs("footer",{className:"resource-card__footer",children:[t,n?a.jsx("div",{className:"resource-card__actions",children:n}):null]}):null]})}function AN({className:e,iconOnly:t=!1,tone:n="secondary",...i}){return a.jsx("button",{type:"button",className:Ja("resource-card__action",`is-${n}`,t&&"is-icon-only",e),...i})}function LB({label:e,icon:t="arrow",tone:n="primary",className:i,children:r,title:s,...o}){const l=t==="play"?a.jsx(dat,{}):t==="plus"?a.jsx(Ije,{}):a.jsx(Kst,{});return a.jsx(AN,{className:i,iconOnly:!0,tone:n,"aria-label":e,title:s??e,...o,children:r??l})}function wH({leading:e,title:t,titleText:n,subtitle:i,status:r}){return a.jsxs("div",{className:"resource-card__header",children:[a.jsxs("div",{className:"resource-card__identity",children:[e,a.jsxs("div",{className:"resource-card__title-copy",children:[a.jsx("h3",{title:n,children:t}),i]})]}),r]})}function OH({children:e,title:t}){return a.jsx("p",{className:"resource-card__description",title:t,children:e})}function ZIe({items:e,className:t}){return a.jsx("dl",{className:Ja("resource-card__metadata",t),children:e.map((n,i)=>a.jsxs("div",{className:n.className,children:[a.jsx("dt",{className:n.hideLabel?"sr-only":void 0,children:n.label}),a.jsx("dd",{title:n.title,children:n.value})]},`${String(n.label)}:${i}`))})}function cb({className:e,icon:t,children:n,...i}){return a.jsxs("button",{type:"button",className:Ja("resource-create-card",e),...i,children:[a.jsx("span",{className:"resource-create-card__icon","aria-hidden":"true",children:t}),a.jsx("span",{children:n})]})}const ebt=new Set(["avif","bmp","gif","heic","jpeg","jpg","png","svg","tif","tiff","webp"]),tbt=new Set(["avi","m4v","mkv","mov","mp4","mpeg","mpg","webm"]),nbt=new Set(["csv","htm","html","json","md","pdf","svg","txt","xml","yaml","yml"]);function JIe(e){const t=e.lastIndexOf(".");return t<0?"":e.slice(t+1).toLocaleLowerCase()}function wI(e,t){if(!Number.isFinite(e))return t;const n=e;return n>1e10?n:n*1e3}function ibt(e){var t,n;return((t=e.actions)==null?void 0:t.artifactDelta)??((n=e.actions)==null?void 0:n.artifact_delta)}function rbt(e){return`${e.replace(/\.pptx$/i,"")}.preview.webp`}function sbt(e){var t;return(((t=e.content)==null?void 0:t.parts)??[]).map(n=>n.functionResponse??n.function_response).filter(n=>!!n)}function abt(e){if(!e)return{};const t=e.result;return t&&typeof t=="object"&&!Array.isArray(t)?t:e}function Bee(e,t,n){var i;if(/\.[A-Za-z0-9]{2,8}$/.test(e))return e;try{const r=new URL(t).pathname.split("/").filter(Boolean),o=((i=(r[r.length-1]??"").match(/\.[A-Za-z0-9]{2,8}$/))==null?void 0:i[0])??"";if(o)return`${e}${o}`}catch{}return`${e}.${n==="image"?"png":"mp4"}`}function obt(e,t){const n=abt(t),i=e==="image_generate"||e.endsWith("_image_generate"),r=["video_generate","video_task_query"].some(u=>e===u||e.endsWith(`_${u}`));if(!i&&!r)return[];const s=i?"image":"video",o=[],l=n.success_list;if(Array.isArray(l)){for(const u of l)if(!(!u||typeof u!="object"||Array.isArray(u)))for(const[d,f]of Object.entries(u))typeof f=="string"&&f.startsWith("https://")&&o.push({name:Bee(d,f,s),url:f,type:s})}const c=n.video_url;if(r&&typeof c=="string"&&c.startsWith("https://")){const u=typeof n.task_id=="string"?n.task_id:void 0;o.push({name:Bee(u||"generated-video",c,s),url:c,type:s,taskId:u})}return o}function Uee(e,t){return new Date(wI(e,t)||Date.now()).toISOString()}function lbt(e,t){var r;const n=[],i=new Set;for(const s of e)for(const o of s.sessions){const l=wI(o.lastUpdateTime,Date.now()),c=iM(o.events,t);for(const u of o.events??[])for(const d of sbt(u)){const f=(d==null?void 0:d.name)??"";for(const h of obt(f,d==null?void 0:d.response)){const m=`${o.id}:${u.id??""}:${f}:${h.url}`;i.has(m)||(i.add(m),n.push({sourceUrl:h.url,name:h.name,mimeType:h.type==="image"?"image/png":"video/mp4",appName:s.appName,agentId:s.agentId,agentName:((r=s.agentName)==null?void 0:r.trim())||s.appName,sessionId:o.id,sessionTitle:c,sessionUpdatedAt:Uee(o.lastUpdateTime,l),createdAt:Uee(u.timestamp,l),origin:{runtimeId:s.runtimeId,region:s.region,eventId:u.id,invocationId:u.invocationId??u.invocation_id,toolName:f,taskId:h.taskId}}))}}}return n}function ePe(e){const t=JIe(e);return ebt.has(t)?"image":tbt.has(t)?"video":"document"}function cbt(e){const t=ePe(e);return t==="image"?"image":t==="video"?"video":nbt.has(JIe(e))?"frame":"unavailable"}function ubt(e,t,n="en-US"){var r;const i=[];for(const s of e)for(const o of s.sessions){const l=wI(o.lastUpdateTime,0),c=new Map;for(const u of o.events??[]){const d=ibt(u);if(!d)continue;const f=wI(u.timestamp,l);for(const[h,m]of Object.entries(d)){if(!h||!Number.isFinite(m))continue;const g=c.get(h);(!g||m>=g.version)&&c.set(h,{filename:h,version:m,createdAt:f})}}for(const u of c.values()){if(/\.preview\.webp$/i.test(u.filename))continue;const d=c.get(rbt(u.filename)),f=d??u,h=d?"image":cbt(u.filename);i.push({id:`${s.appName}:${o.id}:${u.filename}:${u.version}`,appName:s.appName,agentId:s.agentId,sessionId:o.id,sessionTitle:iM(o.events,t),agentName:((r=s.agentName)==null?void 0:r.trim())||s.appName,sessionUpdatedAt:l,name:u.filename,version:u.version,type:ePe(u.filename),createdAt:u.createdAt||l,origin:{runtimeId:s.runtimeId,region:s.region},preview:{filename:f.filename,version:f.version,mode:h}})}}return i.sort((s,o)=>o.createdAt-s.createdAt||s.name.localeCompare(o.name,n))}function tPe(e,t,n){if(!e)return n;const i=new Date(e);if(Number.isNaN(i.getTime()))return n;const r=new Date;return i.getFullYear()===r.getFullYear()&&i.getMonth()===r.getMonth()&&i.getDate()===r.getDate()?new Intl.DateTimeFormat(t,{hour:"2-digit",minute:"2-digit",hour12:!1}).format(i):new Intl.DateTimeFormat(t,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}).format(i)}function nPe(e){return!e||e<=0?"":e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(e<10*1024*1024?1:0)} MB`:`${(e/(1024*1024*1024)).toFixed(1)} GB`}const u4=40;function dbt(e){return[{value:"all",label:e("artifactLibrary.types.all")},{value:"document",label:e("artifactLibrary.types.document")},{value:"image",label:e("artifactLibrary.types.image")},{value:"video",label:e("artifactLibrary.types.video")}]}function fbt(e,t){return e(`artifactLibrary.types.${t}`)}function y_(e){return e instanceof Error?e.message:String(e)}function iPe({artifact:e,large:t=!1}){return a.jsx("div",{className:`library-artifact-preview library-artifact-preview--${e.type}${t?" is-large":""}`,children:e.thumbnailUrl?a.jsxs(a.Fragment,{children:[a.jsx("img",{className:"library-artifact-preview-media",src:e.thumbnailUrl,alt:"",loading:"lazy"}),e.type==="video"?a.jsx("span",{className:"artifact-video-play is-overlay","aria-hidden":"true",children:a.jsx(Pee,{})}):null]}):e.type==="document"?a.jsxs("div",{className:"artifact-document-sheet","aria-hidden":"true",children:[a.jsx("span",{className:"is-title"}),a.jsx("span",{}),a.jsx("span",{}),a.jsx("span",{className:"is-short"})]}):e.type==="image"?a.jsxs("div",{className:"artifact-image-scene","aria-hidden":"true",children:[a.jsx("span",{className:"artifact-image-sun"}),a.jsx("span",{className:"artifact-image-plane artifact-image-plane--back"}),a.jsx("span",{className:"artifact-image-plane artifact-image-plane--front"})]}):a.jsxs("div",{className:"artifact-video-frame","aria-hidden":"true",children:[a.jsx("span",{className:"artifact-video-orbit"}),a.jsx("span",{className:"artifact-video-node artifact-video-node--one"}),a.jsx("span",{className:"artifact-video-node artifact-video-node--two"}),a.jsx("span",{className:"artifact-video-play",children:a.jsx(Pee,{})})]})})}function hbt({artifact:e,pendingAction:t,disabled:n,onPreview:i,onDownload:r,onEdit:s,onDelete:o,onOpenSource:l,t:c,locale:u}){const d=t===`download:${e.id}`;return a.jsxs("tr",{className:"library-artifact-row",children:[a.jsx("td",{className:"library-artifact-file",children:a.jsxs("button",{type:"button",className:"library-artifact-preview-trigger","aria-label":c("artifactLibrary.previewArtifact",{name:e.name}),disabled:n||!!t,onClick:()=>i(e),children:[a.jsx("div",{className:"library-artifact-thumbnail",children:a.jsx(iPe,{artifact:e})}),a.jsxs("div",{className:"library-artifact-row-title",children:[a.jsx("span",{className:"library-artifact-row-name",title:e.name,children:e.name}),a.jsx("span",{className:"library-artifact-row-size",children:nPe(e.sizeBytes)||"—"})]})]})}),a.jsx("td",{className:"library-artifact-source-cell",children:l?a.jsxs("button",{type:"button",className:"library-artifact-source-link",title:`${e.agentName} / ${e.sessionTitle}`,onClick:()=>l(e),children:[a.jsx("span",{children:e.agentName}),a.jsx("span",{"aria-hidden":"true",children:"/"}),a.jsx("span",{children:e.sessionTitle})]}):a.jsxs("span",{title:`${e.agentName} / ${e.sessionTitle}`,children:[e.agentName," / ",e.sessionTitle]})}),a.jsx("td",{className:"library-artifact-time",children:tPe(e.updatedAt??e.createdAt,u,c("artifactLibrary.unknownTime"))}),a.jsx("td",{className:"library-artifact-actions-cell",children:a.jsx("div",{className:"library-artifact-actions",children:a.jsx(UIe,{label:c("artifactLibrary.moreActions",{name:e.name}),menuLabel:c("artifactLibrary.actionMenu",{name:e.name}),placement:"bottom-end",items:[{label:c(d?"artifactLibrary.downloading":"artifactLibrary.download"),onSelect:()=>r(e),disabled:n||!!t},...s?[{label:c("artifactLibrary.edit"),onSelect:()=>s(e),disabled:n||!!t||e.canManage===!1}]:[],...o?[{label:c("artifactLibrary.delete"),onSelect:()=>o(e),disabled:n||!!t||e.canManage===!1,danger:!0}]:[]]})})})]})}function pbt({sources:e=[],items:t,userId:n="",active:i=!0,activationRevision:r=0,loading:s=!1,error:o="",onRetry:l,onEdit:c,onDelete:u,onDownload:d,onOpenSource:f,region:h,toolbarLeading:m,toolbarFilters:g}){var Ue,me;const{t:b,i18n:v}=Te("workspaceTools"),y=v.resolvedLanguage||v.language,[w,x]=p.useState("all"),[O,k]=p.useState(""),[S,C]=p.useState(null),[E,j]=p.useState(""),[T,R]=p.useState(""),[A,N]=p.useState(""),[D,I]=p.useState(""),[P,_]=p.useState({}),[L,F]=p.useState(()=>new Set),[M,V]=p.useState(null),[q,U]=p.useState(!1),[Z,z]=p.useState(""),[ee,ne]=p.useState(null),[W,X]=p.useState(!1),[H,ae]=p.useState(u4),Y=p.useRef(null),K=p.useRef(null),ie=p.useRef(0),J=p.useRef(null),ye=p.useRef(null),de=p.useRef(!1),ge=p.useCallback(()=>{ie.current+=1,C(null),j(""),R("")},[]),Ee=p.useMemo(()=>t?[...t]:ubt(e,b("library.untitledSession"),y),[t,y,e,b]),xe=p.useMemo(()=>Ee.filter(ke=>!L.has(ke.id)).map(ke=>P[ke.id]??ke),[Ee,P,L]);p.useEffect(()=>()=>{ie.current+=1},[]),p.useEffect(()=>()=>{E&&URL.revokeObjectURL(E)},[E]),p.useEffect(()=>{var Qe;if(!S)return;const ke=document.activeElement,Ae=document.body.style.overflow;document.body.style.overflow="hidden",(Qe=Y.current)==null||Qe.focus();const He=jt=>{if(jt.key==="Escape"){jt.preventDefault(),ge();return}if(jt.key!=="Tab")return;const Pt=K.current;if(!Pt)return;const Kt=Array.from(Pt.querySelectorAll('button:not([disabled]), video[controls], iframe, [tabindex]:not([tabindex="-1"])')).filter(tt=>tt.getClientRects().length>0);if(Kt.length===0){jt.preventDefault();return}const Ct=Kt[0],xt=Kt[Kt.length-1];jt.shiftKey&&document.activeElement===Ct?(jt.preventDefault(),xt.focus()):!jt.shiftKey&&document.activeElement===xt&&(jt.preventDefault(),Ct.focus())};return document.addEventListener("keydown",He),()=>{document.removeEventListener("keydown",He),document.body.style.overflow=Ae,ke!=null&&ke.isConnected&&ke.focus()}},[ge,S]);const Ne=async ke=>{const Ae=ie.current+1;if(ie.current=Ae,N(""),j(""),C(ke),ke.preview.mode!=="unavailable"){if(ke.contentUrl){j(ke.contentUrl);return}R(`preview:${ke.id}`);try{const He=await Cz(ke.appName,n,ke.sessionId,ke.preview.filename,ke.preview.version);if(ie.current!==Ae){URL.revokeObjectURL(He);return}j(He)}catch(He){ie.current===Ae&&N(b("artifactLibrary.previewFailed",{name:ke.name,message:y_(He)}))}finally{ie.current===Ae&&R("")}}},We=async ke=>{N(""),R(`download:${ke.id}`);try{d?await d(ke):await Ez(ke.appName,n,ke.sessionId,ke.name,ke.version),I(b("artifactLibrary.downloadStarted",{name:ke.name}))}catch(Ae){N(b("artifactLibrary.downloadFailed",{name:ke.name,message:y_(Ae)}))}finally{R("")}},Xe=async ke=>{if(!(!M||!c)){U(!0),z("");try{const He=await c(M,ke)??{...M,...ke,updatedAt:Date.now()};_(Qe=>({...Qe,[M.id]:He})),I(b("artifactLibrary.updated",{name:He.name})),V(null)}catch(Ae){z(y_(Ae))}finally{U(!1)}}},Re=async()=>{if(!(!ee||!u)){X(!0),N("");try{await u(ee),F(ke=>new Set([...ke,ee.id])),I(b("artifactLibrary.deleted",{name:ee.name})),(S==null?void 0:S.id)===ee.id&&ge(),ne(null)}catch(ke){N(b("artifactLibrary.deleteFailed",{name:ee.name,message:y_(ke)})),ne(null)}finally{X(!1)}}},se=p.useMemo(()=>{const ke=O.trim().toLocaleLowerCase();return xe.filter(Ae=>{var He;return(He=Ae.origin)!=null&&He.region&&Ae.origin.region!==h||w!=="all"&&Ae.type!==w?!1:ke?[Ae.name,Ae.sessionTitle,Ae.agentName].some(Qe=>Qe.toLocaleLowerCase().includes(ke)):!0})},[w,xe,O,h]),ce=p.useMemo(()=>se.slice(0,H),[se,H]),ve=H{de.current||(de.current=!0,ae(ke=>ke+u4))},[]);p.useEffect(()=>{ae(u4)},[r,w,O,se.length]),p.useEffect(()=>{de.current=!1},[H]),p.useEffect(()=>{const ke=ye.current,Ae=J.current;if(!i||!ke||!Ae||!ve)return;const He=new IntersectionObserver(([Qe])=>{Qe.isIntersecting&&Se()},{root:Ae,rootMargin:"240px 0px",threshold:.01});return He.observe(ke),()=>He.disconnect()},[i,ve,Se,H]);const oe=()=>{const ke=J.current;!i||!ke||!ve||ke.scrollHeight-ke.scrollTop-ke.clientHeight<=240&&Se()},$e=!!O.trim()||w!=="all"||xe.some(ke=>{var Ae;return((Ae=ke.origin)==null?void 0:Ae.region)&&ke.origin.region!==h});return a.jsxs("div",{className:"artifact-library-page resource-collection",children:[a.jsxs(ab,{className:"artifact-library-toolbar library-resource-toolbar",children:[m,a.jsxs("div",{className:"resource-toolbar__actions",children:[a.jsx(lb,{id:"artifact-type-filter",ariaLabel:b("artifactLibrary.typeFilter"),value:w,options:dbt(b),onChange:x}),g,a.jsx(Jp,{"aria-label":b("artifactLibrary.searchAria"),value:O,onChange:ke=>k(ke.target.value),placeholder:b("artifactLibrary.searchPlaceholder")})]})]}),o&&xe.length>0?a.jsxs("div",{className:"artifact-library-banner",role:"alert",children:[a.jsx("span",{children:o}),l?a.jsx("button",{type:"button",onClick:l,children:b("artifactLibrary.retry")}):null]}):null,A?a.jsxs("div",{className:"artifact-library-banner",role:"alert",children:[a.jsx("span",{children:A}),a.jsx("button",{type:"button",onClick:()=>N(""),children:b("artifactLibrary.close")})]}):null,a.jsx(em,{ref:J,className:"artifact-library-results","aria-label":b("artifactLibrary.listAria"),onScroll:oe,children:a.jsxs("div",{className:"artifact-library-panel",children:[s&&xe.length===0?a.jsx(cl,{}):o&&xe.length===0?a.jsxs("div",{className:"artifact-library-empty is-error",role:"alert",children:[a.jsx("p",{children:b("artifactLibrary.loadFailed")}),a.jsx("span",{children:o}),l?a.jsx("button",{type:"button",onClick:l,children:b("artifactLibrary.reload")}):null]}):se.length===0?a.jsxs("div",{className:"artifact-library-empty",children:[a.jsx("p",{children:b($e?"artifactLibrary.noMatch":"artifactLibrary.noArtifacts")}),a.jsx("span",{children:b($e?"artifactLibrary.searchHint":"artifactLibrary.emptyHint")})]}):a.jsx("div",{className:"artifact-library-list",children:a.jsxs("table",{className:"artifact-library-table",children:[a.jsxs("colgroup",{children:[a.jsx("col",{className:"artifact-library-table__file-column"}),a.jsx("col",{className:"artifact-library-table__source-column"}),a.jsx("col",{className:"artifact-library-table__time-column"}),a.jsx("col",{className:"artifact-library-table__actions-column"})]}),a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:b("artifactLibrary.columns.name")}),a.jsx("th",{scope:"col",children:b("artifactLibrary.columns.source")}),a.jsx("th",{scope:"col",children:b("artifactLibrary.columns.updatedAt")}),a.jsx("th",{scope:"col",className:"artifact-library-table__actions-heading",children:b("artifactLibrary.columns.actions")})]})}),a.jsx("tbody",{children:ce.map(ke=>a.jsx(hbt,{artifact:ke,pendingAction:T,disabled:!n&&!t,onPreview:Ae=>void Ne(Ae),onDownload:Ae=>void We(Ae),onEdit:c?Ae=>{z(""),V(Ae)}:void 0,onDelete:u?ne:void 0,onOpenSource:f,t:b,locale:y},ke.id))})]})}),ve?a.jsx("div",{ref:ye,className:"artifact-library-load-more",role:"status","aria-live":"polite",children:a.jsx(cn,{as:"span",duration:2.4,children:b("artifactLibrary.loadingMore")})}):null]})}),a.jsx("p",{className:"artifact-library-status","aria-live":"polite",children:D}),S?a.jsxs("div",{className:"artifact-library-preview-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"artifact-library-preview-title",children:[a.jsx("button",{type:"button",className:"artifact-library-preview-backdrop","aria-label":b("artifactLibrary.preview.close"),onClick:ge}),a.jsxs("div",{ref:K,className:"artifact-library-preview-panel",children:[a.jsxs("header",{children:[a.jsxs("div",{children:[a.jsx("h2",{id:"artifact-library-preview-title",children:S.name}),a.jsx("p",{children:b("artifactLibrary.preview.meta",{type:fbt(b,S.type),version:S.version})})]}),a.jsx("button",{ref:Y,type:"button","aria-label":b("artifactLibrary.preview.close"),onClick:ge,children:a.jsx(BIe,{})})]}),a.jsxs("div",{className:"artifact-library-preview-content",children:[a.jsx("div",{className:"artifact-library-preview-canvas",children:T===`preview:${S.id}`?a.jsx(cn,{as:"span",duration:2.4,children:b("artifactLibrary.preview.loading")}):E&&S.preview.mode==="image"?a.jsx("img",{src:E,alt:b("artifactLibrary.preview.alt",{name:S.name})}):E&&S.preview.mode==="video"?a.jsx("video",{src:E,controls:!0,"aria-label":b("artifactLibrary.preview.alt",{name:S.name})}):E&&S.preview.mode==="frame"?a.jsx("iframe",{src:E,title:b("artifactLibrary.preview.alt",{name:S.name})}):a.jsxs("div",{className:"artifact-library-preview-unavailable",children:[a.jsx(iPe,{artifact:S,large:!0}),a.jsx("p",{children:b(A?"artifactLibrary.preview.loadFailed":"artifactLibrary.preview.unsupported")})]})}),a.jsxs("aside",{className:"artifact-library-preview-details","aria-label":b("artifactLibrary.preview.sourceAria"),children:[S.description?a.jsx("p",{className:"artifact-library-preview-description",children:S.description}):null,a.jsxs("dl",{children:[a.jsxs("div",{children:[a.jsx("dt",{children:b("artifactLibrary.preview.agent")}),a.jsx("dd",{title:S.agentName,children:S.agentName})]}),a.jsxs("div",{children:[a.jsx("dt",{children:b("artifactLibrary.preview.session")}),a.jsx("dd",{title:S.sessionTitle,children:S.sessionTitle})]}),(Ue=S.origin)!=null&&Ue.toolName?a.jsxs("div",{children:[a.jsx("dt",{children:b("artifactLibrary.preview.tool")}),a.jsx("dd",{children:S.origin.toolName})]}):null,a.jsxs("div",{children:[a.jsx("dt",{children:b("artifactLibrary.preview.createdAt")}),a.jsx("dd",{children:tPe(S.createdAt,y,b("artifactLibrary.unknownTime"))})]}),S.sizeBytes?a.jsxs("div",{children:[a.jsx("dt",{children:b("artifactLibrary.preview.fileSize")}),a.jsx("dd",{children:nPe(S.sizeBytes)})]}):null]}),(me=S.tags)!=null&&me.length?a.jsx("div",{className:"artifact-library-preview-tags","aria-label":b("artifactLibrary.preview.tags"),children:S.tags.map(ke=>a.jsx("span",{children:ke},ke))}):null]})]}),a.jsxs("footer",{children:[a.jsxs("div",{className:"artifact-library-preview-footer-start",children:[f?a.jsxs("button",{type:"button",className:"is-secondary",onClick:()=>{const ke=S;ge(),f(ke)},children:[a.jsx(Fmt,{}),b("artifactLibrary.preview.viewSession")]}):null,c?a.jsxs("button",{type:"button",className:"is-secondary",disabled:S.canManage===!1,onClick:()=>{const ke=S;ge(),z(""),V(ke)},children:[a.jsx(xI,{}),b("artifactLibrary.edit")]}):null]}),a.jsxs("button",{type:"button",disabled:T.startsWith("download:")||!n&&!t,onClick:()=>void We(S),children:[a.jsx($mt,{}),b("artifactLibrary.download")]})]})]})]}):null,M?a.jsx(Qmt,{artifact:M,busy:q,error:Z,onClose:()=>{q||V(null)},onSave:ke=>void Xe(ke)}):null,ee?a.jsx(Td,{title:b("artifactLibrary.deleteDialog.title"),description:b("artifactLibrary.deleteDialog.description",{name:ee.name}),confirmLabel:b(W?"artifactLibrary.deleteDialog.deleting":"artifactLibrary.deleteDialog.confirm"),closeLabel:b("artifactLibrary.deleteDialog.close"),variant:"danger",busy:W,onCancel:()=>{W||ne(null)},onConfirm:()=>void Re()}):null]})}bn.hasResourceBundle("en-US","workspaceTools")||bn.addResourceBundle("en-US","workspaceTools",Lbe,!0,!0);bn.hasResourceBundle("zh-CN","workspaceTools")||bn.addResourceBundle("zh-CN","workspaceTools",zOe,!0,!0);function _b(e,t={}){return bn.t(e,{...t,ns:"workspaceTools"})}function mbt(e,t){if(e&&typeof e=="object"&&"detail"in e){const n=e.detail;if(typeof n=="string"&&n.trim())return n}return t}async function cT(e,t){if(e.ok)return e;let n;try{n=await e.json()}catch{n=void 0}throw new Error(mbt(n,_b("artifactLibrary.api.withStatus",{message:t,status:e.status})))}function d4(e){if(typeof e=="number")return e;if(typeof e!="string")return 0;const t=Date.parse(e);return Number.isFinite(t)?t:0}function rPe(e){const t=e;return{...t,createdAt:d4(t.createdAt),updatedAt:d4(t.updatedAt),sessionUpdatedAt:d4(t.sessionUpdatedAt)}}async function sPe(e){const t=await e.json();return Array.isArray(t.items)?t.items.map(rPe):[]}async function gbt(){const e=await cT(await yn("/web/artifacts"),_b("artifactLibrary.api.listFailed"));return sPe(e)}async function bbt(e){if(e.length===0)return gbt();const t=await cT(await yn("/web/artifacts/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({candidates:e})},24e4),_b("artifactLibrary.api.syncFailed"));return sPe(t)}async function ybt(e,t){const n=await cT(await yn(`/web/artifacts/${encodeURIComponent(e.id)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),_b("artifactLibrary.api.updateFailed"));return rPe(await n.json())}async function vbt(e){await cT(await yn(`/web/artifacts/${encodeURIComponent(e.id)}`,{method:"DELETE"}),_b("artifactLibrary.api.deleteFailed"))}async function xbt(e){const n=await(await cT(await yn(`/web/artifacts/${encodeURIComponent(e.id)}/content?download=true`,{},24e4),_b("artifactLibrary.api.downloadFailed"))).blob(),i=URL.createObjectURL(n),r=document.createElement("a");r.href=i,r.download=e.name,document.body.appendChild(r),r.click(),r.remove(),window.setTimeout(()=>URL.revokeObjectURL(i),0)}const aPe="KNOWLEDGE_PROVIDER_ASSOCIATION_INVALID";class bM extends Error{constructor(n,i,r={}){super(n);Zt(this,"status");Zt(this,"errorCode");Zt(this,"requestId");Zt(this,"diagnostics");Zt(this,"detail");Zt(this,"payload");Zt(this,"rawBody");this.name="KnowledgeRequestError",this.status=i;const s=typeof r=="string"?{errorCode:r}:r;this.errorCode=s.errorCode||"",this.requestId=s.requestId||"",this.diagnostics=s.diagnostics,this.detail=s.detail,this.payload=s.payload,this.rawBody=s.rawBody||""}}class oPe extends Error{constructor(n){super(n.map(({region:i,error:r})=>`${i}: ${r.message||Q("knowledge.loadFailed")}`).join(` +`));Zt(this,"failures");this.name="KnowledgeRegionAggregateError",this.failures=n}}const wbt=new Set(["ak","apikey","sk","accesskey","accesskeyid","authorization","authkey","clientsecret","cookie","credential","credentials","password","passwd","privatekey","secret","secretaccesskey","secretkey","securitytoken","sessiontoken","setcookie","token"]),Obt=6,Qee=50,lPe=4e3;function kbt(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}function Sbt(e){const t=kbt(e);return wbt.has(t)||t.endsWith("password")||t.endsWith("secret")||t.endsWith("token")||t.endsWith("credential")}function Ebt(e){return/<\s*(?:!doctype|html|head|body|script|style)\b/i.test(e)}function fS(e){if(Ebt(e))return Q("knowledge.htmlHidden");const t=Q("knowledge.redacted");return e.replace(/\bBearer\s+[^\s,;]+/gi,`Bearer ${t}`).replace(/\b(?:set-)?cookie\s*:\s*[^\r\n]*/gi,`cookie: ${t}`).replace(/\bAKLT[A-Za-z0-9_-]{6,}\b/g,t).replace(/((?:access[_-]?key(?:[_-]?id)?|secret(?:[_-]?(?:access)?[_-]?key)?|session[_-]?token|security[_-]?token|client[_-]?secret|api[_-]?key|authorization|cookie|[a-z0-9_-]*(?:password|secret|token)|credential|ak|sk)\s*[:=]\s*)(?:"[^"]*"|'[^']*'|[^\s,;&]+)/gi,`$1${t}`).replace(/([?&](?:access[_-]?key|api[_-]?key|client[_-]?secret|security[_-]?token|session[_-]?token|secret|token|password|authorization|cookie|credential)=)[^&#\s]+/gi,`$1${t}`)}function $B(e,t=0,n=new WeakSet){if(e===null||typeof e=="number"||typeof e=="boolean")return e;if(typeof e=="string")return fS(e).slice(0,lPe);if(typeof e!="object")return;if(t>=Obt)return Q("knowledge.depthTruncated");if(n.has(e))return Q("knowledge.circularReference");if(n.add(e),Array.isArray(e))return e.slice(0,Qee).map(r=>$B(r,t+1,n));const i={};return Object.entries(e).slice(0,Qee).forEach(([r,s])=>{i[r]=Sbt(r)?Q("knowledge.redacted"):$B(s,t+1,n)}),i}function zee(e){if(e===void 0)return"";const t=$B(e);if(typeof t=="string")return t;if(t===void 0)return"";try{return JSON.stringify(t).slice(0,lPe)}catch{return Q("knowledge.diagnosticsUnavailable")}}function El(e,t){if(e instanceof oPe)return e.failures.map(({region:o,error:l})=>`${o} ${El(l,t)}`).join(` -`);if(!(e instanceof bM))return(e instanceof Error?dS(e.message):"")||t;const n=dS(e.message)||t,i=[Number.isFinite(e.status)?Q("knowledge.statusCode",{status:e.status}):"",e.errorCode?Q("knowledge.errorCode",{code:dS(e.errorCode)}):"",e.requestId?Q("knowledge.requestId",{requestId:dS(e.requestId)}):""].filter(Boolean).join(" · "),r=Qee(e.diagnostics),s=Qee(e.detail);return[n,i,r?Q("knowledge.diagnostics",{diagnostics:r}):"",s&&s!==n?Q("knowledge.detail",{detail:s}):""].filter(Boolean).join(` -`)}function AN(...e){for(const t of e)if(typeof t=="string"&&t.trim())return t.trim();return""}function Sbt(e){return Array.isArray(e)?e.map(t=>{const n=Ad(t),i=AN(n.msg,n.message);if(!i)return"";const r=Array.isArray(n.loc)?n.loc.filter(s=>typeof s=="string"||typeof s=="number").map(String).join("."):"";return r?`${r}: ${i}`:i}).filter(Boolean).join("; "):""}function Ebt(e,t=!0){const n=Ad(e),i=Object.prototype.hasOwnProperty.call(n,"detail")?n.detail:typeof e=="string"?e:void 0,r=Ad(i);return{message:typeof i=="string"?t?i.trim():"":AN(r.message,n.message,Sbt(i)),errorCode:AN(r.errorCode,n.errorCode),requestId:AN(r.requestId,r.request_id,r.RequestId,n.requestId,n.request_id),diagnostics:r.diagnostics??n.diagnostics,detail:i,payload:e}}function Ad(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}}function ar(e){return typeof e=="string"?e:""}function xC(e,t){return typeof e=="number"&&Number.isFinite(e)?e:t}function OH(e){const t=Ad(e);return{id:ar(t.id),name:ar(t.name),description:ar(t.description),providerType:ar(t.providerType),providerKnowledgeId:ar(t.providerKnowledgeId),projectName:ar(t.projectName),region:ar(t.region),status:ar(t.status),createdAt:ar(t.createdAt),updatedAt:ar(t.updatedAt),ownerId:ar(t.ownerId),ownerLabel:ar(t.ownerLabel),canManage:t.canManage===!0}}function cT(e){const t=Ad(e);return{id:ar(t.id),name:ar(t.name),type:ar(t.type),sizeBytes:xC(t.sizeBytes,0),status:ar(t.status),url:ar(t.url),tosPath:ar(t.tosPath),metadata:Ad(t.metadata),createdAt:ar(t.createdAt),updatedAt:ar(t.updatedAt),sourceMarkdown:ar(t.sourceMarkdown)}}function Cbt(e){const t=Ad(e),n=t.attachment,i=Ad(n);return{id:ar(t.id),title:ar(t.title),content:ar(t.content),attachmentUrl:ar(t.attachmentUrl)||ar(i.url)||ar(i.previewUrl),attachmentType:ar(t.attachmentType)||ar(i.type)||ar(i.mimeType),attachment:n,tableFields:t.tableFields}}async function Af(e,t={},n=ho){var f;const i=ul(uc(t.headers));i.set("accept","application/json"),t.body&&!(t.body instanceof FormData)&&i.set("content-type","application/json");const r=await fetch(e,{...t,headers:i,signal:po(t.signal,n)});if(r.ok)return r.status===204?void 0:r.json();const s=await r.text();let o=s,l=!1;if(s)try{o=JSON.parse(s),l=!0}catch{}const c=((f=r.headers.get("content-type"))==null?void 0:f.toLowerCase())||"",u=Ebt(o,l||c.startsWith("text/plain")),d=r.status===401?Q("knowledge.signInRequired"):r.status===403?Q("knowledge.forbidden"):r.status===404?Q("knowledge.notFound"):r.status===409?Q("knowledge.conflict"):Q("knowledge.requestFailed",{status:r.status});throw new bM(u.message||d,r.status,{errorCode:u.errorCode,requestId:u.requestId,diagnostics:u.diagnostics,detail:u.detail,payload:u.payload,rawBody:s})}function K0(e){const t=new URLSearchParams;e.trim()&&t.set("region",e.trim());const n=t.toString();return n?`?${n}`:""}async function Abt(e){var r;const t=new URLSearchParams({region:e.region,pageSize:String(e.pageSize??30)});(r=e.projectName)!=null&&r.trim()&&t.set("projectName",e.projectName.trim()),e.nextToken&&t.set("nextToken",e.nextToken);const n=await Af(`/web/knowledge-bases?${t.toString()}`,{signal:e.signal}),i=Ad(n);return{items:Array.isArray(i.items)?i.items.map(OH):[],nextToken:ar(i.nextToken)}}function Tbt(e){return`${e.region}\0${e.id}`}async function _bt(e){var l;const t=[...new Set(e.regions.map(c=>c.trim()).filter(Boolean))],n=e.nextTokens?t.filter(c=>{var u;return!!((u=e.nextTokens)!=null&&u[c])}):t;if(n.length===0)return{items:[],nextTokens:{},failures:[]};const i=await Promise.allSettled(n.map(async c=>{var u;return{region:c,page:await Abt({region:c,projectName:e.projectName,nextToken:(u=e.nextTokens)==null?void 0:u[c],pageSize:e.pageSize,signal:e.signal})}}));if((l=e.signal)!=null&&l.aborted)throw new DOMException("Aborted","AbortError");const r=[],s={},o=new Map;if(i.forEach((c,u)=>{var f;const d=n[u];if(c.status==="rejected"){const h=(f=e.nextTokens)==null?void 0:f[d];h&&(s[d]=h),r.push({region:d,error:c.reason instanceof Error?c.reason:new Error(Q("knowledge.loadFailed"))});return}c.value.page.nextToken&&(s[d]=c.value.page.nextToken),c.value.page.items.forEach(h=>{const m=h.region?h:{...h,region:d};o.set(Tbt(m),m)})}),r.length===n.length)throw new aPe(r);return{items:[...o.values()],nextTokens:s,failures:r}}function jbt(e){return Af("/web/knowledge-bases",{method:"POST",body:JSON.stringify(e)},hr).then(OH)}function Nbt(e,t,n){return Af(`/web/knowledge-bases/${encodeURIComponent(e)}${K0(t)}`,{method:"PATCH",body:JSON.stringify(n)}).then(OH)}function Rbt(e,t){return Af(`/web/knowledge-bases/${encodeURIComponent(e)}${K0(t)}`,{method:"DELETE"},hr)}async function Ibt(e,t){var s;const n=new URLSearchParams({region:t.region,offset:String(t.offset??0),limit:String(t.limit??30)});(s=t.documentType)!=null&&s.trim()&&n.set("documentType",t.documentType.trim());const i=await Af(`/web/knowledge-bases/${encodeURIComponent(e)}/documents?${n.toString()}`,{signal:t.signal}),r=Ad(i);return{items:Array.isArray(r.items)?r.items.map(cT):[],offset:xC(r.offset,0),limit:xC(r.limit,t.limit??30),hasMore:r.hasMore===!0}}async function Pbt(e,t,n){const i=new URLSearchParams({region:n.region,offset:String(n.offset??0),limit:String(n.limit??20)}),r=await Af(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/${encodeURIComponent(t)}/preview?${i.toString()}`,{signal:n.signal}),s=Ad(r);return{document:cT(s.document),chunks:Array.isArray(s.chunks)?s.chunks.map(Cbt):[],sourceMarkdown:ar(s.sourceMarkdown),offset:xC(s.offset,0),limit:xC(s.limit,n.limit??20),hasMore:s.hasMore===!0}}function Dbt(e,t,n){return Af(`/web/knowledge-bases/${encodeURIComponent(e)}/documents${K0(t)}`,{method:"POST",body:JSON.stringify(n)},hr).then(cT)}async function Mbt(e,t,n){const i=await Af(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/web-preview${K0(t)}`,{method:"POST",body:JSON.stringify({sourceType:"url",url:n.url})},hr),r=Ad(i);return{name:ar(r.name),url:ar(r.url),sourceMarkdown:ar(r.sourceMarkdown)}}function Lbt(e,t,n){var r,s;const i=new FormData;return i.set("file",n.file),(r=n.name)!=null&&r.trim()&&i.set("name",n.name.trim()),(s=n.documentType)!=null&&s.trim()&&i.set("documentType",n.documentType.trim()),n.metadata&&i.set("metadata",JSON.stringify(n.metadata)),Af(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/upload${K0(t)}`,{method:"POST",body:i},hr).then(cT)}function $bt(e,t,n,i){return Af(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/${encodeURIComponent(t)}${K0(n)}`,{method:"PATCH",body:JSON.stringify(i)}).then(cT)}function Fbt(e,t,n){return Af(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/${encodeURIComponent(t)}${K0(n)}`,{method:"DELETE"},hr)}function G0({className:e="",title:t,status:n,description:i,metadata:r,detailAction:s,action:o,auxiliaryAction:l}){return a.jsxs(vH,{className:`library-resource-card ${e}`.trim(),activateLabel:`${s.label} ${t}`,onActivate:s.disabled?void 0:s.onClick,footer:a.jsx(YIe,{items:r.map(c=>({label:c.label,value:c.value,title:c.title,hideLabel:!0}))}),actions:a.jsxs(a.Fragment,{children:[l?a.jsx(MB,{className:"library-resource-card__auxiliary-action",label:`${l.label} ${t}`,tone:"secondary",disabled:l.disabled,title:l.title??l.label,onClick:l.onClick,children:l.icon}):null,o?a.jsx(MB,{label:`${o.label} ${t}`,icon:o.icon,disabled:o.disabled,title:o.title,onClick:o.onClick}):null]}),children:[a.jsx(xH,{leading:a.jsx(t1,{seed:t}),title:t,titleText:t,status:n}),a.jsx(wH,{title:i,children:i})]})}function Shn(){}function zee(e){const t=[],n=String(e||"");let i=n.indexOf(","),r=0,s=!1;for(;!s;){i===-1&&(i=n.length,s=!0);const o=n.slice(r,i).trim();(o||!s)&&t.push(o),r=i+1,i=n.indexOf(",",r)}return t}function lPe(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Bbt=/[$_\p{ID_Start}]/u,Ubt=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,Qbt=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,zbt=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Vbt=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,cPe={};function Ehn(e){return e?Bbt.test(String.fromCodePoint(e)):!1}function Chn(e,t){const i=(t||cPe).jsx?Qbt:Ubt;return e?i.test(String.fromCodePoint(e)):!1}function Vee(e,t){return(cPe.jsx?Vbt:zbt).test(e)}const Hbt=/[ \t\n\f\r]/g;function qbt(e){return typeof e=="object"?e.type==="text"?Hee(e.value):!1:Hee(e)}function Hee(e){return e.replace(Hbt,"")===""}let uT=class{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}};uT.prototype.normal={};uT.prototype.property={};uT.prototype.space=void 0;function uPe(e,t){const n={},i={};for(const r of e)Object.assign(n,r.property),Object.assign(i,r.normal);return new uT(n,i,t)}function wC(e){return e.toLowerCase()}class qc{constructor(t,n){this.attribute=n,this.property=t}}qc.prototype.attribute="";qc.prototype.booleanish=!1;qc.prototype.boolean=!1;qc.prototype.commaOrSpaceSeparated=!1;qc.prototype.commaSeparated=!1;qc.prototype.defined=!1;qc.prototype.mustUseProperty=!1;qc.prototype.number=!1;qc.prototype.overloadedBoolean=!1;qc.prototype.property="";qc.prototype.spaceSeparated=!1;qc.prototype.space=void 0;let Wbt=0;const _i=X0(),Ha=X0(),$B=X0(),Ut=X0(),ms=X0(),fw=X0(),lu=X0();function X0(){return 2**++Wbt}const FB=Object.freeze(Object.defineProperty({__proto__:null,boolean:_i,booleanish:Ha,commaOrSpaceSeparated:lu,commaSeparated:fw,number:Ut,overloadedBoolean:$B,spaceSeparated:ms},Symbol.toStringTag,{value:"Module"})),d4=Object.keys(FB);class kH extends qc{constructor(t,n,i,r){let s=-1;if(super(t,n),qee(this,"space",r),typeof i=="number")for(;++s4&&n.slice(0,4)==="data"&&Zbt.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(Wee,eyt);i="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!Wee.test(s)){let o=s.replace(Ybt,Jbt);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}r=kH}return new r(i,t)}function Jbt(e){return"-"+e.toLowerCase()}function eyt(e){return e.charAt(1).toUpperCase()}const dT=uPe([dPe,Kbt,pPe,mPe,gPe],"html"),_b=uPe([dPe,Gbt,pPe,mPe,gPe],"svg");function Kee(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function bPe(e){return e.join(" ").trim()}var SH={},Gee=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,tyt=/\n/g,nyt=/^\s*/,iyt=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,ryt=/^:\s*/,syt=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,ayt=/^[;\s]*/,oyt=/^\s+|\s+$/g,lyt=` -`,Xee="/",Yee="*",xy="",cyt="comment",uyt="declaration";function dyt(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,i=1;function r(g){var b=g.match(tyt);b&&(n+=b.length);var v=g.lastIndexOf(lyt);i=~v?g.length-v:i+g.length}function s(){var g={line:n,column:i};return function(b){return b.position=new o(g),u(),b}}function o(g){this.start=g,this.end={line:n,column:i},this.source=t.source}o.prototype.content=e;function l(g){var b=new Error(t.source+":"+n+":"+i+": "+g);if(b.reason=g,b.filename=t.source,b.line=n,b.column=i,b.source=e,!t.silent)throw b}function c(g){var b=g.exec(e);if(b){var v=b[0];return r(v),e=e.slice(v.length),b}}function u(){c(nyt)}function d(g){var b;for(g=g||[];b=f();)b!==!1&&g.push(b);return g}function f(){var g=s();if(!(Xee!=e.charAt(0)||Yee!=e.charAt(1))){for(var b=2;xy!=e.charAt(b)&&(Yee!=e.charAt(b)||Xee!=e.charAt(b+1));)++b;if(b+=2,xy===e.charAt(b-1))return l("End of comment missing");var v=e.slice(2,b-2);return i+=2,r(v),e=e.slice(b),i+=2,g({type:cyt,comment:v})}}function h(){var g=s(),b=c(iyt);if(b){if(f(),!c(ryt))return l("property missing ':'");var v=c(syt),y=g({type:uyt,property:Zee(b[0].replace(Gee,xy)),value:v?Zee(v[0].replace(Gee,xy)):xy});return c(ayt),y}}function m(){var g=[];d(g);for(var b;b=h();)b!==!1&&(g.push(b),d(g));return g}return u(),m()}function Zee(e){return e?e.replace(oyt,xy):xy}var fyt=dyt,hyt=cg&&cg.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(SH,"__esModule",{value:!0});SH.default=myt;const pyt=hyt(fyt);function myt(e,t){let n=null;if(!e||typeof e!="string")return n;const i=(0,pyt.default)(e),r=typeof t=="function";return i.forEach(s=>{if(s.type!=="declaration")return;const{property:o,value:l}=s;r?t(o,l,s):l&&(n=n||{},n[o]=l)}),n}var vM={};Object.defineProperty(vM,"__esModule",{value:!0});vM.camelCase=void 0;var gyt=/^--[a-zA-Z0-9_-]+$/,byt=/-([a-z])/g,yyt=/^[^-]+$/,vyt=/^-(webkit|moz|ms|o|khtml)-/,xyt=/^-(ms)-/,wyt=function(e){return!e||yyt.test(e)||gyt.test(e)},Oyt=function(e,t){return t.toUpperCase()},Jee=function(e,t){return"".concat(t,"-")},kyt=function(e,t){return t===void 0&&(t={}),wyt(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(xyt,Jee):e=e.replace(vyt,Jee),e.replace(byt,Oyt))};vM.camelCase=kyt;var Syt=cg&&cg.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Eyt=Syt(SH),Cyt=vM;function BB(e,t){var n={};return!e||typeof e!="string"||(0,Eyt.default)(e,function(i,r){i&&r&&(n[(0,Cyt.camelCase)(i,t)]=r)}),n}BB.default=BB;var Ayt=BB;const Tyt=T1(Ayt),xM=yPe("end"),jh=yPe("start");function yPe(e){return t;function t(n){const i=n&&n.position&&n.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function _yt(e){const t=jh(e),n=xM(e);if(t&&n)return{start:t,end:n}}function aE(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ete(e.position):"start"in e||"end"in e?ete(e):"line"in e||"column"in e?UB(e):""}function UB(e){return tte(e&&e.line)+":"+tte(e&&e.column)}function ete(e){return UB(e&&e.start)+"-"+UB(e&&e.end)}function tte(e){return e&&typeof e=="number"?e:1}class Nl extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let r="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?r=t:!s.cause&&t&&(o=!0,r=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof i=="string"){const c=i.indexOf(":");c===-1?s.ruleId=i:(s.source=i.slice(0,c),s.ruleId=i.slice(c+1))}if(!s.place&&s.ancestors&&s.ancestors){const c=s.ancestors[s.ancestors.length-1];c&&(s.place=c.position)}const l=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=l?l.line:void 0,this.name=aE(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Nl.prototype.file="";Nl.prototype.name="";Nl.prototype.reason="";Nl.prototype.message="";Nl.prototype.stack="";Nl.prototype.column=void 0;Nl.prototype.line=void 0;Nl.prototype.ancestors=void 0;Nl.prototype.cause=void 0;Nl.prototype.fatal=void 0;Nl.prototype.place=void 0;Nl.prototype.ruleId=void 0;Nl.prototype.source=void 0;const EH={}.hasOwnProperty,jyt=new Map,Nyt=/[A-Z]/g,Ryt=new Set(["table","tbody","thead","tfoot","tr"]),Iyt=new Set(["td","th"]),vPe="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Pyt(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let i;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=Qyt(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=Uyt(n,t.jsx,t.jsxs)}const r={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?_b:dT,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=xPe(r,e,void 0);return s&&typeof s!="string"?s:r.create(e,r.Fragment,{children:s||void 0},void 0)}function xPe(e,t,n){if(t.type==="element")return Dyt(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Myt(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return $yt(e,t,n);if(t.type==="mdxjsEsm")return Lyt(e,t);if(t.type==="root")return Fyt(e,t,n);if(t.type==="text")return Byt(e,t)}function Dyt(e,t,n){const i=e.schema;let r=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(r=_b,e.schema=r),e.ancestors.push(t);const s=OPe(e,t.tagName,!1),o=zyt(e,t);let l=AH(e,t);return Ryt.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!qbt(c):!0})),wPe(e,o,s,t),CH(o,l),e.ancestors.pop(),e.schema=i,e.create(t,s,o,n)}function Myt(e,t){if(t.data&&t.data.estree&&e.evaluater){const i=t.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}OC(e,t.position)}function Lyt(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);OC(e,t.position)}function $yt(e,t,n){const i=e.schema;let r=i;t.name==="svg"&&i.space==="html"&&(r=_b,e.schema=r),e.ancestors.push(t);const s=t.name===null?e.Fragment:OPe(e,t.name,!0),o=Vyt(e,t),l=AH(e,t);return wPe(e,o,s,t),CH(o,l),e.ancestors.pop(),e.schema=i,e.create(t,s,o,n)}function Fyt(e,t,n){const i={};return CH(i,AH(e,t)),e.create(t,e.Fragment,i,n)}function Byt(e,t){return t.value}function wPe(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function CH(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Uyt(e,t,n){return i;function i(r,s,o,l){const u=Array.isArray(o.children)?n:t;return l?u(s,o,l):u(s,o)}}function Qyt(e,t){return n;function n(i,r,s,o){const l=Array.isArray(s.children),c=jh(i);return t(r,s,o,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function zyt(e,t){const n={};let i,r;for(r in t.properties)if(r!=="children"&&EH.call(t.properties,r)){const s=Hyt(e,r,t.properties[r]);if(s){const[o,l]=s;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&Iyt.has(t.tagName)?i=l:n[o]=l}}if(i){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function Vyt(e,t){const n={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const s=i.data.estree.body[0];s.type;const o=s.expression;o.type;const l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else OC(e,t.position);else{const r=i.name;let s;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const l=i.value.data.estree.body[0];l.type,s=e.evaluater.evaluateExpression(l.expression)}else OC(e,t.position);else s=i.value===null?!0:i.value;n[r]=s}return n}function AH(e,t){const n=[];let i=-1;const r=e.passKeys?new Map:jyt;for(;++ir?0:r+t:t=t>r?r:t,n=n>0?n:0,i.length<1e4)o=Array.from(i),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);s0?(ju(e,e.length,0,t),e):t}const rte={}.hasOwnProperty;function SPe(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function pf(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Jl=jb(/[A-Za-z]/),Tl=jb(/[\dA-Za-z]/),e0t=jb(/[#-'*+\--9=?A-Z^-~]/);function OI(e){return e!==null&&(e<32||e===127)}const QB=jb(/\d/),t0t=jb(/[\dA-Fa-f]/),n0t=jb(/[!-/:-@[-`{-~]/);function Kn(e){return e!==null&&e<-2}function cs(e){return e!==null&&(e<0||e===32)}function Gi(e){return e===-2||e===-1||e===32}const wM=jb(new RegExp("\\p{P}|\\p{S}","u")),g0=jb(/\s/);function jb(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function nO(e){const t=[];let n=-1,i=0,r=0;for(;++n55295&&s<57344){const l=e.charCodeAt(n+1);s<56320&&l>56319&&l<57344?(o=String.fromCharCode(s,l),r=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(i,n),encodeURIComponent(o)),i=n+r+1,o=""),r&&(n+=r,r=0)}return t.join("")+e.slice(i)}function dr(e,t,n,i){const r=i?i-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(c){return Gi(c)?(e.enter(n),l(c)):t(c)}function l(c){return Gi(c)&&s++o))return;const C=t.events.length;let E=C,j,T;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){if(j){T=t.events[E][1].end;break}j=!0}for(y(i),S=C;Sx;){const k=n[O];t.containerState=k[1],k[0].exit.call(t,e)}n.length=x}function w(){r.write([null]),s=void 0,r=void 0,t.containerState._closeFlow=void 0}}function o0t(e,t,n){return dr(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function n1(e){if(e===null||cs(e)||g0(e))return 1;if(wM(e))return 2}function OM(e,t,n){const i=[];let r=-1;for(;++r1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[i][1].end},h={...e[n][1].start};ate(f,-c),ate(h,c),o={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[i][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},s={type:c>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},r={type:c>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[i][1].end={...o.start},e[n][1].start={...l.end},u=[],e[i][1].end.offset-e[i][1].start.offset&&(u=nd(u,[["enter",e[i][1],t],["exit",e[i][1],t]])),u=nd(u,[["enter",r,t],["enter",o,t],["exit",o,t],["enter",s,t]]),u=nd(u,OM(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),u=nd(u,[["exit",s,t],["enter",l,t],["exit",l,t],["exit",r,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=nd(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,ju(e,i-1,n-i+3,u),n=i+u.length-d-2;break}}for(n=-1;++n0&&Gi(S)?dr(e,w,"linePrefix",s+1)(S):w(S)}function w(S){return S===null||Kn(S)?e.check(ote,b,O)(S):(e.enter("codeFlowValue"),x(S))}function x(S){return S===null||Kn(S)?(e.exit("codeFlowValue"),w(S)):(e.consume(S),x)}function O(S){return e.exit("codeFenced"),t(S)}function k(S,C,E){let j=0;return T;function T(I){return S.enter("lineEnding"),S.consume(I),S.exit("lineEnding"),R}function R(I){return S.enter("codeFencedFence"),Gi(I)?dr(S,A,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):A(I)}function A(I){return I===l?(S.enter("codeFencedFenceSequence"),N(I)):E(I)}function N(I){return I===l?(j++,S.consume(I),N):j>=o?(S.exit("codeFencedFenceSequence"),Gi(I)?dr(S,P,"whitespace")(I):P(I)):E(I)}function P(I){return I===null||Kn(I)?(S.exit("codeFencedFence"),C(I)):E(I)}}}function v0t(e,t,n){const i=this;return r;function r(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return i.parser.lazy[i.now().line]?n(o):t(o)}}const h4={name:"codeIndented",tokenize:w0t},x0t={partial:!0,tokenize:O0t};function w0t(e,t,n){const i=this;return r;function r(u){return e.enter("codeIndented"),dr(e,s,"linePrefix",5)(u)}function s(u){const d=i.events[i.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?o(u):n(u)}function o(u){return u===null?c(u):Kn(u)?e.attempt(x0t,o,c)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||Kn(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),l)}function c(u){return e.exit("codeIndented"),t(u)}}function O0t(e,t,n){const i=this;return r;function r(o){return i.parser.lazy[i.now().line]?n(o):Kn(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r):dr(e,s,"linePrefix",5)(o)}function s(o){const l=i.events[i.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):Kn(o)?r(o):n(o)}}const k0t={name:"codeText",previous:E0t,resolve:S0t,tokenize:C0t};function S0t(e){let t=e.length-4,n=3,i,r;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const r=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return i&&mk(this.left,i),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),mk(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),mk(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(o):e.interrupt(i.parser.constructs.flow,n,t)(o)}}function jPe(e,t,n,i,r,s,o,l,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return f;function f(y){return y===60?(e.enter(i),e.enter(r),e.enter(s),e.consume(y),e.exit(s),h):y===null||y===32||y===41||OI(y)?n(y):(e.enter(i),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),b(y))}function h(y){return y===62?(e.enter(s),e.consume(y),e.exit(s),e.exit(r),e.exit(i),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===62?(e.exit("chunkString"),e.exit(l),h(y)):y===null||y===60||Kn(y)?n(y):(e.consume(y),y===92?g:m)}function g(y){return y===60||y===62||y===92?(e.consume(y),m):m(y)}function b(y){return!d&&(y===null||y===41||cs(y))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(i),t(y)):d999||m===null||m===91||m===93&&!c||m===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(m):m===93?(e.exit(s),e.enter(r),e.consume(m),e.exit(r),e.exit(i),t):Kn(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(m))}function f(m){return m===null||m===91||m===93||Kn(m)||l++>999?(e.exit("chunkString"),d(m)):(e.consume(m),c||(c=!Gi(m)),m===92?h:f)}function h(m){return m===91||m===92||m===93?(e.consume(m),l++,f):f(m)}}function RPe(e,t,n,i,r,s){let o;return l;function l(h){return h===34||h===39||h===40?(e.enter(i),e.enter(r),e.consume(h),e.exit(r),o=h===40?41:h,c):n(h)}function c(h){return h===o?(e.enter(r),e.consume(h),e.exit(r),e.exit(i),t):(e.enter(s),u(h))}function u(h){return h===o?(e.exit(s),c(o)):h===null?n(h):Kn(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),dr(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===o||h===null||Kn(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?f:d)}function f(h){return h===o||h===92?(e.consume(h),d):d(h)}}function oE(e,t){let n;return i;function i(r){return Kn(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),n=!0,i):Gi(r)?dr(e,i,n?"linePrefix":"lineSuffix")(r):t(r)}}const P0t={name:"definition",tokenize:M0t},D0t={partial:!0,tokenize:L0t};function M0t(e,t,n){const i=this;let r;return s;function s(m){return e.enter("definition"),o(m)}function o(m){return NPe.call(i,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function l(m){return r=pf(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),c):n(m)}function c(m){return cs(m)?oE(e,u)(m):u(m)}function u(m){return jPe(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function d(m){return e.attempt(D0t,f,f)(m)}function f(m){return Gi(m)?dr(e,h,"whitespace")(m):h(m)}function h(m){return m===null||Kn(m)?(e.exit("definition"),i.parser.defined.push(r),t(m)):n(m)}}function L0t(e,t,n){return i;function i(l){return cs(l)?oE(e,r)(l):n(l)}function r(l){return RPe(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return Gi(l)?dr(e,o,"whitespace")(l):o(l)}function o(l){return l===null||Kn(l)?t(l):n(l)}}const $0t={name:"hardBreakEscape",tokenize:F0t};function F0t(e,t,n){return i;function i(s){return e.enter("hardBreakEscape"),e.consume(s),r}function r(s){return Kn(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const B0t={name:"headingAtx",resolve:U0t,tokenize:Q0t};function U0t(e,t){let n=e.length-2,i=3,r,s;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(r={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},s={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},ju(e,i,n-i+1,[["enter",r,t],["enter",s,t],["exit",s,t],["exit",r,t]])),e}function Q0t(e,t,n){let i=0;return r;function r(d){return e.enter("atxHeading"),s(d)}function s(d){return e.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&i++<6?(e.consume(d),o):d===null||cs(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||Kn(d)?(e.exit("atxHeading"),t(d)):Gi(d)?dr(e,l,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function c(d){return d===35?(e.consume(d),c):(e.exit("atxHeadingSequence"),l(d))}function u(d){return d===null||d===35||cs(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),u)}}const z0t=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],cte=["pre","script","style","textarea"],V0t={concrete:!0,name:"htmlFlow",resolveTo:W0t,tokenize:K0t},H0t={partial:!0,tokenize:X0t},q0t={partial:!0,tokenize:G0t};function W0t(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function K0t(e,t,n){const i=this;let r,s,o,l,c;return u;function u(U){return d(U)}function d(U){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(U),f}function f(U){return U===33?(e.consume(U),h):U===47?(e.consume(U),s=!0,b):U===63?(e.consume(U),r=3,i.interrupt?t:M):Jl(U)?(e.consume(U),o=String.fromCharCode(U),v):n(U)}function h(U){return U===45?(e.consume(U),r=2,m):U===91?(e.consume(U),r=5,l=0,g):Jl(U)?(e.consume(U),r=4,i.interrupt?t:M):n(U)}function m(U){return U===45?(e.consume(U),i.interrupt?t:M):n(U)}function g(U){const J="CDATA[";return U===J.charCodeAt(l++)?(e.consume(U),l===J.length?i.interrupt?t:A:g):n(U)}function b(U){return Jl(U)?(e.consume(U),o=String.fromCharCode(U),v):n(U)}function v(U){if(U===null||U===47||U===62||cs(U)){const J=U===47,z=o.toLowerCase();return!J&&!s&&cte.includes(z)?(r=1,i.interrupt?t(U):A(U)):z0t.includes(o.toLowerCase())?(r=6,J?(e.consume(U),y):i.interrupt?t(U):A(U)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(U):s?w(U):x(U))}return U===45||Tl(U)?(e.consume(U),o+=String.fromCharCode(U),v):n(U)}function y(U){return U===62?(e.consume(U),i.interrupt?t:A):n(U)}function w(U){return Gi(U)?(e.consume(U),w):T(U)}function x(U){return U===47?(e.consume(U),T):U===58||U===95||Jl(U)?(e.consume(U),O):Gi(U)?(e.consume(U),x):T(U)}function O(U){return U===45||U===46||U===58||U===95||Tl(U)?(e.consume(U),O):k(U)}function k(U){return U===61?(e.consume(U),S):Gi(U)?(e.consume(U),k):x(U)}function S(U){return U===null||U===60||U===61||U===62||U===96?n(U):U===34||U===39?(e.consume(U),c=U,C):Gi(U)?(e.consume(U),S):E(U)}function C(U){return U===c?(e.consume(U),c=null,j):U===null||Kn(U)?n(U):(e.consume(U),C)}function E(U){return U===null||U===34||U===39||U===47||U===60||U===61||U===62||U===96||cs(U)?k(U):(e.consume(U),E)}function j(U){return U===47||U===62||Gi(U)?x(U):n(U)}function T(U){return U===62?(e.consume(U),R):n(U)}function R(U){return U===null||Kn(U)?A(U):Gi(U)?(e.consume(U),R):n(U)}function A(U){return U===45&&r===2?(e.consume(U),D):U===60&&r===1?(e.consume(U),_):U===62&&r===4?(e.consume(U),V):U===63&&r===3?(e.consume(U),M):U===93&&r===5?(e.consume(U),F):Kn(U)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(H0t,q,N)(U)):U===null||Kn(U)?(e.exit("htmlFlowData"),N(U)):(e.consume(U),A)}function N(U){return e.check(q0t,P,q)(U)}function P(U){return e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),I}function I(U){return U===null||Kn(U)?N(U):(e.enter("htmlFlowData"),A(U))}function D(U){return U===45?(e.consume(U),M):A(U)}function _(U){return U===47?(e.consume(U),o="",L):A(U)}function L(U){if(U===62){const J=o.toLowerCase();return cte.includes(J)?(e.consume(U),V):A(U)}return Jl(U)&&o.length<8?(e.consume(U),o+=String.fromCharCode(U),L):A(U)}function F(U){return U===93?(e.consume(U),M):A(U)}function M(U){return U===62?(e.consume(U),V):U===45&&r===2?(e.consume(U),M):A(U)}function V(U){return U===null||Kn(U)?(e.exit("htmlFlowData"),q(U)):(e.consume(U),V)}function q(U){return e.exit("htmlFlow"),t(U)}}function G0t(e,t,n){const i=this;return r;function r(o){return Kn(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return i.parser.lazy[i.now().line]?n(o):t(o)}}function X0t(e,t,n){return i;function i(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(fT,t,n)}}const Y0t={name:"htmlText",tokenize:Z0t};function Z0t(e,t,n){const i=this;let r,s,o;return l;function l(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),c}function c(M){return M===33?(e.consume(M),u):M===47?(e.consume(M),k):M===63?(e.consume(M),x):Jl(M)?(e.consume(M),E):n(M)}function u(M){return M===45?(e.consume(M),d):M===91?(e.consume(M),s=0,g):Jl(M)?(e.consume(M),w):n(M)}function d(M){return M===45?(e.consume(M),m):n(M)}function f(M){return M===null?n(M):M===45?(e.consume(M),h):Kn(M)?(o=f,_(M)):(e.consume(M),f)}function h(M){return M===45?(e.consume(M),m):f(M)}function m(M){return M===62?D(M):M===45?h(M):f(M)}function g(M){const V="CDATA[";return M===V.charCodeAt(s++)?(e.consume(M),s===V.length?b:g):n(M)}function b(M){return M===null?n(M):M===93?(e.consume(M),v):Kn(M)?(o=b,_(M)):(e.consume(M),b)}function v(M){return M===93?(e.consume(M),y):b(M)}function y(M){return M===62?D(M):M===93?(e.consume(M),y):b(M)}function w(M){return M===null||M===62?D(M):Kn(M)?(o=w,_(M)):(e.consume(M),w)}function x(M){return M===null?n(M):M===63?(e.consume(M),O):Kn(M)?(o=x,_(M)):(e.consume(M),x)}function O(M){return M===62?D(M):x(M)}function k(M){return Jl(M)?(e.consume(M),S):n(M)}function S(M){return M===45||Tl(M)?(e.consume(M),S):C(M)}function C(M){return Kn(M)?(o=C,_(M)):Gi(M)?(e.consume(M),C):D(M)}function E(M){return M===45||Tl(M)?(e.consume(M),E):M===47||M===62||cs(M)?j(M):n(M)}function j(M){return M===47?(e.consume(M),D):M===58||M===95||Jl(M)?(e.consume(M),T):Kn(M)?(o=j,_(M)):Gi(M)?(e.consume(M),j):D(M)}function T(M){return M===45||M===46||M===58||M===95||Tl(M)?(e.consume(M),T):R(M)}function R(M){return M===61?(e.consume(M),A):Kn(M)?(o=R,_(M)):Gi(M)?(e.consume(M),R):j(M)}function A(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),r=M,N):Kn(M)?(o=A,_(M)):Gi(M)?(e.consume(M),A):(e.consume(M),P)}function N(M){return M===r?(e.consume(M),r=void 0,I):M===null?n(M):Kn(M)?(o=N,_(M)):(e.consume(M),N)}function P(M){return M===null||M===34||M===39||M===60||M===61||M===96?n(M):M===47||M===62||cs(M)?j(M):(e.consume(M),P)}function I(M){return M===47||M===62||cs(M)?j(M):n(M)}function D(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):n(M)}function _(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),L}function L(M){return Gi(M)?dr(e,F,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):F(M)}function F(M){return e.enter("htmlTextData"),o(M)}}const jH={name:"labelEnd",resolveAll:nvt,resolveTo:ivt,tokenize:rvt},J0t={tokenize:svt},evt={tokenize:avt},tvt={tokenize:ovt};function nvt(e){let t=-1;const n=[];for(;++t=3&&(u===null||Kn(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===r?(e.consume(u),i++,c):(e.exit("thematicBreakSequence"),Gi(u)?dr(e,l,"whitespace")(u):l(u))}}const Oc={continuation:{tokenize:bvt},exit:vvt,name:"list",tokenize:gvt},pvt={partial:!0,tokenize:xvt},mvt={partial:!0,tokenize:yvt};function gvt(e,t,n){const i=this,r=i.events[i.events.length-1];let s=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,o=0;return l;function l(m){const g=i.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!i.containerState.marker||m===i.containerState.marker:QB(m)){if(i.containerState.type||(i.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(TN,n,u)(m):u(m);if(!i.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(m)}return n(m)}function c(m){return QB(m)&&++o<10?(e.consume(m),c):(!i.interrupt||o<2)&&(i.containerState.marker?m===i.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):n(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||m,e.check(fT,i.interrupt?n:d,e.attempt(pvt,h,f))}function d(m){return i.containerState.initialBlankLine=!0,s++,h(m)}function f(m){return Gi(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),h):n(m)}function h(m){return i.containerState.size=s+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function bvt(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(fT,r,s);function r(l){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,dr(e,t,"listItemIndent",i.containerState.size+1)(l)}function s(l){return i.containerState.furtherBlankLines||!Gi(l)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,o(l)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(mvt,t,o)(l))}function o(l){return i.containerState._closeFlow=!0,i.interrupt=void 0,dr(e,e.attempt(Oc,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function yvt(e,t,n){const i=this;return dr(e,r,"listItemIndent",i.containerState.size+1);function r(s){const o=i.events[i.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===i.containerState.size?t(s):n(s)}}function vvt(e){e.exit(this.containerState.type)}function xvt(e,t,n){const i=this;return dr(e,r,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(s){const o=i.events[i.events.length-1];return!Gi(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const ute={name:"setextUnderline",resolveTo:wvt,tokenize:Ovt};function wvt(e,t){let n=e.length,i,r,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(r=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",s?(e.splice(r,0,["enter",o,t]),e.splice(s+1,0,["exit",e[i][1],t]),e[i][1].end={...e[s][1].end}):e[i][1]=o,e.push(["exit",o,t]),e}function Ovt(e,t,n){const i=this;let r;return s;function s(u){let d=i.events.length,f;for(;d--;)if(i.events[d][1].type!=="lineEnding"&&i.events[d][1].type!=="linePrefix"&&i.events[d][1].type!=="content"){f=i.events[d][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||f)?(e.enter("setextHeadingLine"),r=u,o(u)):n(u)}function o(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===r?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),Gi(u)?dr(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Kn(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const kvt={tokenize:Svt};function Svt(e){const t=this,n=e.attempt(fT,i,e.attempt(this.parser.constructs.flowInitial,r,dr(e,e.attempt(this.parser.constructs.flow,r,e.attempt(_0t,r)),"linePrefix")));return n;function i(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Evt={resolveAll:PPe()},Cvt=IPe("string"),Avt=IPe("text");function IPe(e){return{resolveAll:PPe(e==="text"?Tvt:void 0),tokenize:t};function t(n){const i=this,r=this.parser.constructs[e],s=n.attempt(r,o,l);return o;function o(d){return u(d)?s(d):l(d)}function l(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),c}function c(d){return u(d)?(n.exit("data"),s(d)):(n.consume(d),c)}function u(d){if(d===null)return!0;const f=r[d];let h=-1;if(f)for(;++h-1){const l=o[0];typeof l=="string"?o[0]=l.slice(i):o.shift()}s>0&&o.push(e[r].slice(0,s))}return o}function Uvt(e,t){let n=-1;const i=[];let r;for(;++n{const n=_d(t),i=TN(n.msg,n.message);if(!i)return"";const r=Array.isArray(n.loc)?n.loc.filter(s=>typeof s=="string"||typeof s=="number").map(String).join("."):"";return r?`${r}: ${i}`:i}).filter(Boolean).join("; "):""}function Abt(e,t=!0){const n=_d(e),i=Object.prototype.hasOwnProperty.call(n,"detail")?n.detail:typeof e=="string"?e:void 0,r=_d(i);return{message:typeof i=="string"?t?i.trim():"":TN(r.message,n.message,Cbt(i)),errorCode:TN(r.errorCode,n.errorCode),requestId:TN(r.requestId,r.request_id,r.RequestId,n.requestId,n.request_id),diagnostics:r.diagnostics??n.diagnostics,detail:i,payload:e}}function _d(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}}function ar(e){return typeof e=="string"?e:""}function wC(e,t){return typeof e=="number"&&Number.isFinite(e)?e:t}function kH(e){const t=_d(e);return{id:ar(t.id),name:ar(t.name),description:ar(t.description),providerType:ar(t.providerType),providerKnowledgeId:ar(t.providerKnowledgeId),projectName:ar(t.projectName),region:ar(t.region),status:ar(t.status),createdAt:ar(t.createdAt),updatedAt:ar(t.updatedAt),ownerId:ar(t.ownerId),ownerLabel:ar(t.ownerLabel),canManage:t.canManage===!0}}function uT(e){const t=_d(e);return{id:ar(t.id),name:ar(t.name),type:ar(t.type),sizeBytes:wC(t.sizeBytes,0),status:ar(t.status),url:ar(t.url),tosPath:ar(t.tosPath),metadata:_d(t.metadata),createdAt:ar(t.createdAt),updatedAt:ar(t.updatedAt),sourceMarkdown:ar(t.sourceMarkdown)}}function Tbt(e){const t=_d(e),n=t.attachment,i=_d(n);return{id:ar(t.id),title:ar(t.title),content:ar(t.content),attachmentUrl:ar(t.attachmentUrl)||ar(i.url)||ar(i.previewUrl),attachmentType:ar(t.attachmentType)||ar(i.type)||ar(i.mimeType),attachment:n,tableFields:t.tableFields}}async function Tf(e,t={},n=ho){var f;const i=ul(uc(t.headers));i.set("accept","application/json"),t.body&&!(t.body instanceof FormData)&&i.set("content-type","application/json");const r=await fetch(e,{...t,headers:i,signal:po(t.signal,n)});if(r.ok)return r.status===204?void 0:r.json();const s=await r.text();let o=s,l=!1;if(s)try{o=JSON.parse(s),l=!0}catch{}const c=((f=r.headers.get("content-type"))==null?void 0:f.toLowerCase())||"",u=Abt(o,l||c.startsWith("text/plain")),d=r.status===401?Q("knowledge.signInRequired"):r.status===403?Q("knowledge.forbidden"):r.status===404?Q("knowledge.notFound"):r.status===409?Q("knowledge.conflict"):Q("knowledge.requestFailed",{status:r.status});throw new bM(u.message||d,r.status,{errorCode:u.errorCode,requestId:u.requestId,diagnostics:u.diagnostics,detail:u.detail,payload:u.payload,rawBody:s})}function G0(e){const t=new URLSearchParams;e.trim()&&t.set("region",e.trim());const n=t.toString();return n?`?${n}`:""}async function _bt(e){var r;const t=new URLSearchParams({region:e.region,pageSize:String(e.pageSize??30)});(r=e.projectName)!=null&&r.trim()&&t.set("projectName",e.projectName.trim()),e.nextToken&&t.set("nextToken",e.nextToken);const n=await Tf(`/web/knowledge-bases?${t.toString()}`,{signal:e.signal}),i=_d(n);return{items:Array.isArray(i.items)?i.items.map(kH):[],nextToken:ar(i.nextToken)}}function jbt(e){return`${e.region}\0${e.id}`}async function Nbt(e){var l;const t=[...new Set(e.regions.map(c=>c.trim()).filter(Boolean))],n=e.nextTokens?t.filter(c=>{var u;return!!((u=e.nextTokens)!=null&&u[c])}):t;if(n.length===0)return{items:[],nextTokens:{},failures:[]};const i=await Promise.allSettled(n.map(async c=>{var u;return{region:c,page:await _bt({region:c,projectName:e.projectName,nextToken:(u=e.nextTokens)==null?void 0:u[c],pageSize:e.pageSize,signal:e.signal})}}));if((l=e.signal)!=null&&l.aborted)throw new DOMException("Aborted","AbortError");const r=[],s={},o=new Map;if(i.forEach((c,u)=>{var f;const d=n[u];if(c.status==="rejected"){const h=(f=e.nextTokens)==null?void 0:f[d];h&&(s[d]=h),r.push({region:d,error:c.reason instanceof Error?c.reason:new Error(Q("knowledge.loadFailed"))});return}c.value.page.nextToken&&(s[d]=c.value.page.nextToken),c.value.page.items.forEach(h=>{const m=h.region?h:{...h,region:d};o.set(jbt(m),m)})}),r.length===n.length)throw new oPe(r);return{items:[...o.values()],nextTokens:s,failures:r}}function Rbt(e){return Tf("/web/knowledge-bases",{method:"POST",body:JSON.stringify(e)},hr).then(kH)}function Ibt(e,t,n){return Tf(`/web/knowledge-bases/${encodeURIComponent(e)}${G0(t)}`,{method:"PATCH",body:JSON.stringify(n)}).then(kH)}function Pbt(e,t){return Tf(`/web/knowledge-bases/${encodeURIComponent(e)}${G0(t)}`,{method:"DELETE"},hr)}async function Dbt(e,t){var s;const n=new URLSearchParams({region:t.region,offset:String(t.offset??0),limit:String(t.limit??30)});(s=t.documentType)!=null&&s.trim()&&n.set("documentType",t.documentType.trim());const i=await Tf(`/web/knowledge-bases/${encodeURIComponent(e)}/documents?${n.toString()}`,{signal:t.signal}),r=_d(i);return{items:Array.isArray(r.items)?r.items.map(uT):[],offset:wC(r.offset,0),limit:wC(r.limit,t.limit??30),hasMore:r.hasMore===!0}}async function Mbt(e,t,n){const i=new URLSearchParams({region:n.region,offset:String(n.offset??0),limit:String(n.limit??20)}),r=await Tf(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/${encodeURIComponent(t)}/preview?${i.toString()}`,{signal:n.signal}),s=_d(r);return{document:uT(s.document),chunks:Array.isArray(s.chunks)?s.chunks.map(Tbt):[],sourceMarkdown:ar(s.sourceMarkdown),offset:wC(s.offset,0),limit:wC(s.limit,n.limit??20),hasMore:s.hasMore===!0}}function Lbt(e,t,n){return Tf(`/web/knowledge-bases/${encodeURIComponent(e)}/documents${G0(t)}`,{method:"POST",body:JSON.stringify(n)},hr).then(uT)}async function $bt(e,t,n){const i=await Tf(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/web-preview${G0(t)}`,{method:"POST",body:JSON.stringify({sourceType:"url",url:n.url})},hr),r=_d(i);return{name:ar(r.name),url:ar(r.url),sourceMarkdown:ar(r.sourceMarkdown)}}function Fbt(e,t,n){var r,s;const i=new FormData;return i.set("file",n.file),(r=n.name)!=null&&r.trim()&&i.set("name",n.name.trim()),(s=n.documentType)!=null&&s.trim()&&i.set("documentType",n.documentType.trim()),n.metadata&&i.set("metadata",JSON.stringify(n.metadata)),Tf(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/upload${G0(t)}`,{method:"POST",body:i},hr).then(uT)}function Bbt(e,t,n,i){return Tf(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/${encodeURIComponent(t)}${G0(n)}`,{method:"PATCH",body:JSON.stringify(i)}).then(uT)}function Ubt(e,t,n){return Tf(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/${encodeURIComponent(t)}${G0(n)}`,{method:"DELETE"},hr)}function X0({className:e="",title:t,status:n,description:i,metadata:r,detailAction:s,action:o,auxiliaryAction:l}){return a.jsxs(xH,{className:`library-resource-card ${e}`.trim(),activateLabel:`${s.label} ${t}`,onActivate:s.disabled?void 0:s.onClick,footer:a.jsx(ZIe,{items:r.map(c=>({label:c.label,value:c.value,title:c.title,hideLabel:!0}))}),actions:a.jsxs(a.Fragment,{children:[l?a.jsx(LB,{className:"library-resource-card__auxiliary-action",label:`${l.label} ${t}`,tone:"secondary",disabled:l.disabled,title:l.title??l.label,onClick:l.onClick,children:l.icon}):null,o?a.jsx(LB,{label:`${o.label} ${t}`,icon:o.icon,disabled:o.disabled,title:o.title,onClick:o.onClick}):null]}),children:[a.jsx(wH,{leading:a.jsx(n1,{seed:t}),title:t,titleText:t,status:n}),a.jsx(OH,{title:i,children:i})]})}function Chn(){}function Vee(e){const t=[],n=String(e||"");let i=n.indexOf(","),r=0,s=!1;for(;!s;){i===-1&&(i=n.length,s=!0);const o=n.slice(r,i).trim();(o||!s)&&t.push(o),r=i+1,i=n.indexOf(",",r)}return t}function cPe(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Qbt=/[$_\p{ID_Start}]/u,zbt=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,Vbt=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,Hbt=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,qbt=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uPe={};function Ahn(e){return e?Qbt.test(String.fromCodePoint(e)):!1}function Thn(e,t){const i=(t||uPe).jsx?Vbt:zbt;return e?i.test(String.fromCodePoint(e)):!1}function Hee(e,t){return(uPe.jsx?qbt:Hbt).test(e)}const Wbt=/[ \t\n\f\r]/g;function Kbt(e){return typeof e=="object"?e.type==="text"?qee(e.value):!1:qee(e)}function qee(e){return e.replace(Wbt,"")===""}let dT=class{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}};dT.prototype.normal={};dT.prototype.property={};dT.prototype.space=void 0;function dPe(e,t){const n={},i={};for(const r of e)Object.assign(n,r.property),Object.assign(i,r.normal);return new dT(n,i,t)}function OC(e){return e.toLowerCase()}class Wc{constructor(t,n){this.attribute=n,this.property=t}}Wc.prototype.attribute="";Wc.prototype.booleanish=!1;Wc.prototype.boolean=!1;Wc.prototype.commaOrSpaceSeparated=!1;Wc.prototype.commaSeparated=!1;Wc.prototype.defined=!1;Wc.prototype.mustUseProperty=!1;Wc.prototype.number=!1;Wc.prototype.overloadedBoolean=!1;Wc.prototype.property="";Wc.prototype.spaceSeparated=!1;Wc.prototype.space=void 0;let Gbt=0;const ji=Y0(),Ha=Y0(),FB=Y0(),Ut=Y0(),ms=Y0(),hw=Y0(),cu=Y0();function Y0(){return 2**++Gbt}const BB=Object.freeze(Object.defineProperty({__proto__:null,boolean:ji,booleanish:Ha,commaOrSpaceSeparated:cu,commaSeparated:hw,number:Ut,overloadedBoolean:FB,spaceSeparated:ms},Symbol.toStringTag,{value:"Module"})),f4=Object.keys(BB);class SH extends Wc{constructor(t,n,i,r){let s=-1;if(super(t,n),Wee(this,"space",r),typeof i=="number")for(;++s4&&n.slice(0,4)==="data"&&eyt.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(Kee,nyt);i="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!Kee.test(s)){let o=s.replace(Jbt,tyt);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}r=SH}return new r(i,t)}function tyt(e){return"-"+e.toLowerCase()}function nyt(e){return e.charAt(1).toUpperCase()}const fT=dPe([fPe,Xbt,mPe,gPe,bPe],"html"),jb=dPe([fPe,Ybt,mPe,gPe,bPe],"svg");function Gee(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function yPe(e){return e.join(" ").trim()}var EH={},Xee=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,iyt=/\n/g,ryt=/^\s*/,syt=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,ayt=/^:\s*/,oyt=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,lyt=/^[;\s]*/,cyt=/^\s+|\s+$/g,uyt=` +`,Yee="/",Zee="*",wy="",dyt="comment",fyt="declaration";function hyt(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,i=1;function r(g){var b=g.match(iyt);b&&(n+=b.length);var v=g.lastIndexOf(uyt);i=~v?g.length-v:i+g.length}function s(){var g={line:n,column:i};return function(b){return b.position=new o(g),u(),b}}function o(g){this.start=g,this.end={line:n,column:i},this.source=t.source}o.prototype.content=e;function l(g){var b=new Error(t.source+":"+n+":"+i+": "+g);if(b.reason=g,b.filename=t.source,b.line=n,b.column=i,b.source=e,!t.silent)throw b}function c(g){var b=g.exec(e);if(b){var v=b[0];return r(v),e=e.slice(v.length),b}}function u(){c(ryt)}function d(g){var b;for(g=g||[];b=f();)b!==!1&&g.push(b);return g}function f(){var g=s();if(!(Yee!=e.charAt(0)||Zee!=e.charAt(1))){for(var b=2;wy!=e.charAt(b)&&(Zee!=e.charAt(b)||Yee!=e.charAt(b+1));)++b;if(b+=2,wy===e.charAt(b-1))return l("End of comment missing");var v=e.slice(2,b-2);return i+=2,r(v),e=e.slice(b),i+=2,g({type:dyt,comment:v})}}function h(){var g=s(),b=c(syt);if(b){if(f(),!c(ayt))return l("property missing ':'");var v=c(oyt),y=g({type:fyt,property:Jee(b[0].replace(Xee,wy)),value:v?Jee(v[0].replace(Xee,wy)):wy});return c(lyt),y}}function m(){var g=[];d(g);for(var b;b=h();)b!==!1&&(g.push(b),d(g));return g}return u(),m()}function Jee(e){return e?e.replace(cyt,wy):wy}var pyt=hyt,myt=ug&&ug.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(EH,"__esModule",{value:!0});EH.default=byt;const gyt=myt(pyt);function byt(e,t){let n=null;if(!e||typeof e!="string")return n;const i=(0,gyt.default)(e),r=typeof t=="function";return i.forEach(s=>{if(s.type!=="declaration")return;const{property:o,value:l}=s;r?t(o,l,s):l&&(n=n||{},n[o]=l)}),n}var vM={};Object.defineProperty(vM,"__esModule",{value:!0});vM.camelCase=void 0;var yyt=/^--[a-zA-Z0-9_-]+$/,vyt=/-([a-z])/g,xyt=/^[^-]+$/,wyt=/^-(webkit|moz|ms|o|khtml)-/,Oyt=/^-(ms)-/,kyt=function(e){return!e||xyt.test(e)||yyt.test(e)},Syt=function(e,t){return t.toUpperCase()},ete=function(e,t){return"".concat(t,"-")},Eyt=function(e,t){return t===void 0&&(t={}),kyt(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(Oyt,ete):e=e.replace(wyt,ete),e.replace(vyt,Syt))};vM.camelCase=Eyt;var Cyt=ug&&ug.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Ayt=Cyt(EH),Tyt=vM;function UB(e,t){var n={};return!e||typeof e!="string"||(0,Ayt.default)(e,function(i,r){i&&r&&(n[(0,Tyt.camelCase)(i,t)]=r)}),n}UB.default=UB;var _yt=UB;const jyt=_1(_yt),xM=vPe("end"),Nh=vPe("start");function vPe(e){return t;function t(n){const i=n&&n.position&&n.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function Nyt(e){const t=Nh(e),n=xM(e);if(t&&n)return{start:t,end:n}}function oE(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?tte(e.position):"start"in e||"end"in e?tte(e):"line"in e||"column"in e?QB(e):""}function QB(e){return nte(e&&e.line)+":"+nte(e&&e.column)}function tte(e){return QB(e&&e.start)+"-"+QB(e&&e.end)}function nte(e){return e&&typeof e=="number"?e:1}class Nl extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let r="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?r=t:!s.cause&&t&&(o=!0,r=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof i=="string"){const c=i.indexOf(":");c===-1?s.ruleId=i:(s.source=i.slice(0,c),s.ruleId=i.slice(c+1))}if(!s.place&&s.ancestors&&s.ancestors){const c=s.ancestors[s.ancestors.length-1];c&&(s.place=c.position)}const l=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=l?l.line:void 0,this.name=oE(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Nl.prototype.file="";Nl.prototype.name="";Nl.prototype.reason="";Nl.prototype.message="";Nl.prototype.stack="";Nl.prototype.column=void 0;Nl.prototype.line=void 0;Nl.prototype.ancestors=void 0;Nl.prototype.cause=void 0;Nl.prototype.fatal=void 0;Nl.prototype.place=void 0;Nl.prototype.ruleId=void 0;Nl.prototype.source=void 0;const CH={}.hasOwnProperty,Ryt=new Map,Iyt=/[A-Z]/g,Pyt=new Set(["table","tbody","thead","tfoot","tr"]),Dyt=new Set(["td","th"]),xPe="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Myt(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let i;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=Vyt(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=zyt(n,t.jsx,t.jsxs)}const r={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?jb:fT,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=wPe(r,e,void 0);return s&&typeof s!="string"?s:r.create(e,r.Fragment,{children:s||void 0},void 0)}function wPe(e,t,n){if(t.type==="element")return Lyt(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return $yt(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Byt(e,t,n);if(t.type==="mdxjsEsm")return Fyt(e,t);if(t.type==="root")return Uyt(e,t,n);if(t.type==="text")return Qyt(e,t)}function Lyt(e,t,n){const i=e.schema;let r=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(r=jb,e.schema=r),e.ancestors.push(t);const s=kPe(e,t.tagName,!1),o=Hyt(e,t);let l=TH(e,t);return Pyt.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!Kbt(c):!0})),OPe(e,o,s,t),AH(o,l),e.ancestors.pop(),e.schema=i,e.create(t,s,o,n)}function $yt(e,t){if(t.data&&t.data.estree&&e.evaluater){const i=t.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}kC(e,t.position)}function Fyt(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);kC(e,t.position)}function Byt(e,t,n){const i=e.schema;let r=i;t.name==="svg"&&i.space==="html"&&(r=jb,e.schema=r),e.ancestors.push(t);const s=t.name===null?e.Fragment:kPe(e,t.name,!0),o=qyt(e,t),l=TH(e,t);return OPe(e,o,s,t),AH(o,l),e.ancestors.pop(),e.schema=i,e.create(t,s,o,n)}function Uyt(e,t,n){const i={};return AH(i,TH(e,t)),e.create(t,e.Fragment,i,n)}function Qyt(e,t){return t.value}function OPe(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function AH(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function zyt(e,t,n){return i;function i(r,s,o,l){const u=Array.isArray(o.children)?n:t;return l?u(s,o,l):u(s,o)}}function Vyt(e,t){return n;function n(i,r,s,o){const l=Array.isArray(s.children),c=Nh(i);return t(r,s,o,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function Hyt(e,t){const n={};let i,r;for(r in t.properties)if(r!=="children"&&CH.call(t.properties,r)){const s=Wyt(e,r,t.properties[r]);if(s){const[o,l]=s;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&Dyt.has(t.tagName)?i=l:n[o]=l}}if(i){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function qyt(e,t){const n={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const s=i.data.estree.body[0];s.type;const o=s.expression;o.type;const l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else kC(e,t.position);else{const r=i.name;let s;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const l=i.value.data.estree.body[0];l.type,s=e.evaluater.evaluateExpression(l.expression)}else kC(e,t.position);else s=i.value===null?!0:i.value;n[r]=s}return n}function TH(e,t){const n=[];let i=-1;const r=e.passKeys?new Map:Ryt;for(;++ir?0:r+t:t=t>r?r:t,n=n>0?n:0,i.length<1e4)o=Array.from(i),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);s0?(Nu(e,e.length,0,t),e):t}const ste={}.hasOwnProperty;function EPe(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function mf(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Jl=Nb(/[A-Za-z]/),Tl=Nb(/[\dA-Za-z]/),n0t=Nb(/[#-'*+\--9=?A-Z^-~]/);function OI(e){return e!==null&&(e<32||e===127)}const zB=Nb(/\d/),i0t=Nb(/[\dA-Fa-f]/),r0t=Nb(/[!-/:-@[-`{-~]/);function Kn(e){return e!==null&&e<-2}function cs(e){return e!==null&&(e<0||e===32)}function Gi(e){return e===-2||e===-1||e===32}const wM=Nb(new RegExp("\\p{P}|\\p{S}","u")),b0=Nb(/\s/);function Nb(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function iO(e){const t=[];let n=-1,i=0,r=0;for(;++n55295&&s<57344){const l=e.charCodeAt(n+1);s<56320&&l>56319&&l<57344?(o=String.fromCharCode(s,l),r=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(i,n),encodeURIComponent(o)),i=n+r+1,o=""),r&&(n+=r,r=0)}return t.join("")+e.slice(i)}function dr(e,t,n,i){const r=i?i-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(c){return Gi(c)?(e.enter(n),l(c)):t(c)}function l(c){return Gi(c)&&s++o))return;const C=t.events.length;let E=C,j,T;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){if(j){T=t.events[E][1].end;break}j=!0}for(y(i),S=C;Sx;){const k=n[O];t.containerState=k[1],k[0].exit.call(t,e)}n.length=x}function w(){r.write([null]),s=void 0,r=void 0,t.containerState._closeFlow=void 0}}function c0t(e,t,n){return dr(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function i1(e){if(e===null||cs(e)||b0(e))return 1;if(wM(e))return 2}function OM(e,t,n){const i=[];let r=-1;for(;++r1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[i][1].end},h={...e[n][1].start};ote(f,-c),ote(h,c),o={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[i][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},s={type:c>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},r={type:c>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[i][1].end={...o.start},e[n][1].start={...l.end},u=[],e[i][1].end.offset-e[i][1].start.offset&&(u=id(u,[["enter",e[i][1],t],["exit",e[i][1],t]])),u=id(u,[["enter",r,t],["enter",o,t],["exit",o,t],["enter",s,t]]),u=id(u,OM(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),u=id(u,[["exit",s,t],["enter",l,t],["exit",l,t],["exit",r,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=id(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Nu(e,i-1,n-i+3,u),n=i+u.length-d-2;break}}for(n=-1;++n0&&Gi(S)?dr(e,w,"linePrefix",s+1)(S):w(S)}function w(S){return S===null||Kn(S)?e.check(lte,b,O)(S):(e.enter("codeFlowValue"),x(S))}function x(S){return S===null||Kn(S)?(e.exit("codeFlowValue"),w(S)):(e.consume(S),x)}function O(S){return e.exit("codeFenced"),t(S)}function k(S,C,E){let j=0;return T;function T(I){return S.enter("lineEnding"),S.consume(I),S.exit("lineEnding"),R}function R(I){return S.enter("codeFencedFence"),Gi(I)?dr(S,A,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):A(I)}function A(I){return I===l?(S.enter("codeFencedFenceSequence"),N(I)):E(I)}function N(I){return I===l?(j++,S.consume(I),N):j>=o?(S.exit("codeFencedFenceSequence"),Gi(I)?dr(S,D,"whitespace")(I):D(I)):E(I)}function D(I){return I===null||Kn(I)?(S.exit("codeFencedFence"),C(I)):E(I)}}}function w0t(e,t,n){const i=this;return r;function r(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return i.parser.lazy[i.now().line]?n(o):t(o)}}const p4={name:"codeIndented",tokenize:k0t},O0t={partial:!0,tokenize:S0t};function k0t(e,t,n){const i=this;return r;function r(u){return e.enter("codeIndented"),dr(e,s,"linePrefix",5)(u)}function s(u){const d=i.events[i.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?o(u):n(u)}function o(u){return u===null?c(u):Kn(u)?e.attempt(O0t,o,c)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||Kn(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),l)}function c(u){return e.exit("codeIndented"),t(u)}}function S0t(e,t,n){const i=this;return r;function r(o){return i.parser.lazy[i.now().line]?n(o):Kn(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r):dr(e,s,"linePrefix",5)(o)}function s(o){const l=i.events[i.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):Kn(o)?r(o):n(o)}}const E0t={name:"codeText",previous:A0t,resolve:C0t,tokenize:T0t};function C0t(e){let t=e.length-4,n=3,i,r;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const r=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return i&&gk(this.left,i),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),gk(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),gk(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(o):e.interrupt(i.parser.constructs.flow,n,t)(o)}}function NPe(e,t,n,i,r,s,o,l,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return f;function f(y){return y===60?(e.enter(i),e.enter(r),e.enter(s),e.consume(y),e.exit(s),h):y===null||y===32||y===41||OI(y)?n(y):(e.enter(i),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),b(y))}function h(y){return y===62?(e.enter(s),e.consume(y),e.exit(s),e.exit(r),e.exit(i),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===62?(e.exit("chunkString"),e.exit(l),h(y)):y===null||y===60||Kn(y)?n(y):(e.consume(y),y===92?g:m)}function g(y){return y===60||y===62||y===92?(e.consume(y),m):m(y)}function b(y){return!d&&(y===null||y===41||cs(y))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(i),t(y)):d999||m===null||m===91||m===93&&!c||m===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(m):m===93?(e.exit(s),e.enter(r),e.consume(m),e.exit(r),e.exit(i),t):Kn(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(m))}function f(m){return m===null||m===91||m===93||Kn(m)||l++>999?(e.exit("chunkString"),d(m)):(e.consume(m),c||(c=!Gi(m)),m===92?h:f)}function h(m){return m===91||m===92||m===93?(e.consume(m),l++,f):f(m)}}function IPe(e,t,n,i,r,s){let o;return l;function l(h){return h===34||h===39||h===40?(e.enter(i),e.enter(r),e.consume(h),e.exit(r),o=h===40?41:h,c):n(h)}function c(h){return h===o?(e.enter(r),e.consume(h),e.exit(r),e.exit(i),t):(e.enter(s),u(h))}function u(h){return h===o?(e.exit(s),c(o)):h===null?n(h):Kn(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),dr(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===o||h===null||Kn(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?f:d)}function f(h){return h===o||h===92?(e.consume(h),d):d(h)}}function lE(e,t){let n;return i;function i(r){return Kn(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),n=!0,i):Gi(r)?dr(e,i,n?"linePrefix":"lineSuffix")(r):t(r)}}const M0t={name:"definition",tokenize:$0t},L0t={partial:!0,tokenize:F0t};function $0t(e,t,n){const i=this;let r;return s;function s(m){return e.enter("definition"),o(m)}function o(m){return RPe.call(i,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function l(m){return r=mf(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),c):n(m)}function c(m){return cs(m)?lE(e,u)(m):u(m)}function u(m){return NPe(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function d(m){return e.attempt(L0t,f,f)(m)}function f(m){return Gi(m)?dr(e,h,"whitespace")(m):h(m)}function h(m){return m===null||Kn(m)?(e.exit("definition"),i.parser.defined.push(r),t(m)):n(m)}}function F0t(e,t,n){return i;function i(l){return cs(l)?lE(e,r)(l):n(l)}function r(l){return IPe(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return Gi(l)?dr(e,o,"whitespace")(l):o(l)}function o(l){return l===null||Kn(l)?t(l):n(l)}}const B0t={name:"hardBreakEscape",tokenize:U0t};function U0t(e,t,n){return i;function i(s){return e.enter("hardBreakEscape"),e.consume(s),r}function r(s){return Kn(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const Q0t={name:"headingAtx",resolve:z0t,tokenize:V0t};function z0t(e,t){let n=e.length-2,i=3,r,s;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(r={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},s={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},Nu(e,i,n-i+1,[["enter",r,t],["enter",s,t],["exit",s,t],["exit",r,t]])),e}function V0t(e,t,n){let i=0;return r;function r(d){return e.enter("atxHeading"),s(d)}function s(d){return e.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&i++<6?(e.consume(d),o):d===null||cs(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||Kn(d)?(e.exit("atxHeading"),t(d)):Gi(d)?dr(e,l,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function c(d){return d===35?(e.consume(d),c):(e.exit("atxHeadingSequence"),l(d))}function u(d){return d===null||d===35||cs(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),u)}}const H0t=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],ute=["pre","script","style","textarea"],q0t={concrete:!0,name:"htmlFlow",resolveTo:G0t,tokenize:X0t},W0t={partial:!0,tokenize:Z0t},K0t={partial:!0,tokenize:Y0t};function G0t(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function X0t(e,t,n){const i=this;let r,s,o,l,c;return u;function u(U){return d(U)}function d(U){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(U),f}function f(U){return U===33?(e.consume(U),h):U===47?(e.consume(U),s=!0,b):U===63?(e.consume(U),r=3,i.interrupt?t:M):Jl(U)?(e.consume(U),o=String.fromCharCode(U),v):n(U)}function h(U){return U===45?(e.consume(U),r=2,m):U===91?(e.consume(U),r=5,l=0,g):Jl(U)?(e.consume(U),r=4,i.interrupt?t:M):n(U)}function m(U){return U===45?(e.consume(U),i.interrupt?t:M):n(U)}function g(U){const Z="CDATA[";return U===Z.charCodeAt(l++)?(e.consume(U),l===Z.length?i.interrupt?t:A:g):n(U)}function b(U){return Jl(U)?(e.consume(U),o=String.fromCharCode(U),v):n(U)}function v(U){if(U===null||U===47||U===62||cs(U)){const Z=U===47,z=o.toLowerCase();return!Z&&!s&&ute.includes(z)?(r=1,i.interrupt?t(U):A(U)):H0t.includes(o.toLowerCase())?(r=6,Z?(e.consume(U),y):i.interrupt?t(U):A(U)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(U):s?w(U):x(U))}return U===45||Tl(U)?(e.consume(U),o+=String.fromCharCode(U),v):n(U)}function y(U){return U===62?(e.consume(U),i.interrupt?t:A):n(U)}function w(U){return Gi(U)?(e.consume(U),w):T(U)}function x(U){return U===47?(e.consume(U),T):U===58||U===95||Jl(U)?(e.consume(U),O):Gi(U)?(e.consume(U),x):T(U)}function O(U){return U===45||U===46||U===58||U===95||Tl(U)?(e.consume(U),O):k(U)}function k(U){return U===61?(e.consume(U),S):Gi(U)?(e.consume(U),k):x(U)}function S(U){return U===null||U===60||U===61||U===62||U===96?n(U):U===34||U===39?(e.consume(U),c=U,C):Gi(U)?(e.consume(U),S):E(U)}function C(U){return U===c?(e.consume(U),c=null,j):U===null||Kn(U)?n(U):(e.consume(U),C)}function E(U){return U===null||U===34||U===39||U===47||U===60||U===61||U===62||U===96||cs(U)?k(U):(e.consume(U),E)}function j(U){return U===47||U===62||Gi(U)?x(U):n(U)}function T(U){return U===62?(e.consume(U),R):n(U)}function R(U){return U===null||Kn(U)?A(U):Gi(U)?(e.consume(U),R):n(U)}function A(U){return U===45&&r===2?(e.consume(U),P):U===60&&r===1?(e.consume(U),_):U===62&&r===4?(e.consume(U),V):U===63&&r===3?(e.consume(U),M):U===93&&r===5?(e.consume(U),F):Kn(U)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(W0t,q,N)(U)):U===null||Kn(U)?(e.exit("htmlFlowData"),N(U)):(e.consume(U),A)}function N(U){return e.check(K0t,D,q)(U)}function D(U){return e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),I}function I(U){return U===null||Kn(U)?N(U):(e.enter("htmlFlowData"),A(U))}function P(U){return U===45?(e.consume(U),M):A(U)}function _(U){return U===47?(e.consume(U),o="",L):A(U)}function L(U){if(U===62){const Z=o.toLowerCase();return ute.includes(Z)?(e.consume(U),V):A(U)}return Jl(U)&&o.length<8?(e.consume(U),o+=String.fromCharCode(U),L):A(U)}function F(U){return U===93?(e.consume(U),M):A(U)}function M(U){return U===62?(e.consume(U),V):U===45&&r===2?(e.consume(U),M):A(U)}function V(U){return U===null||Kn(U)?(e.exit("htmlFlowData"),q(U)):(e.consume(U),V)}function q(U){return e.exit("htmlFlow"),t(U)}}function Y0t(e,t,n){const i=this;return r;function r(o){return Kn(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return i.parser.lazy[i.now().line]?n(o):t(o)}}function Z0t(e,t,n){return i;function i(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(hT,t,n)}}const J0t={name:"htmlText",tokenize:evt};function evt(e,t,n){const i=this;let r,s,o;return l;function l(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),c}function c(M){return M===33?(e.consume(M),u):M===47?(e.consume(M),k):M===63?(e.consume(M),x):Jl(M)?(e.consume(M),E):n(M)}function u(M){return M===45?(e.consume(M),d):M===91?(e.consume(M),s=0,g):Jl(M)?(e.consume(M),w):n(M)}function d(M){return M===45?(e.consume(M),m):n(M)}function f(M){return M===null?n(M):M===45?(e.consume(M),h):Kn(M)?(o=f,_(M)):(e.consume(M),f)}function h(M){return M===45?(e.consume(M),m):f(M)}function m(M){return M===62?P(M):M===45?h(M):f(M)}function g(M){const V="CDATA[";return M===V.charCodeAt(s++)?(e.consume(M),s===V.length?b:g):n(M)}function b(M){return M===null?n(M):M===93?(e.consume(M),v):Kn(M)?(o=b,_(M)):(e.consume(M),b)}function v(M){return M===93?(e.consume(M),y):b(M)}function y(M){return M===62?P(M):M===93?(e.consume(M),y):b(M)}function w(M){return M===null||M===62?P(M):Kn(M)?(o=w,_(M)):(e.consume(M),w)}function x(M){return M===null?n(M):M===63?(e.consume(M),O):Kn(M)?(o=x,_(M)):(e.consume(M),x)}function O(M){return M===62?P(M):x(M)}function k(M){return Jl(M)?(e.consume(M),S):n(M)}function S(M){return M===45||Tl(M)?(e.consume(M),S):C(M)}function C(M){return Kn(M)?(o=C,_(M)):Gi(M)?(e.consume(M),C):P(M)}function E(M){return M===45||Tl(M)?(e.consume(M),E):M===47||M===62||cs(M)?j(M):n(M)}function j(M){return M===47?(e.consume(M),P):M===58||M===95||Jl(M)?(e.consume(M),T):Kn(M)?(o=j,_(M)):Gi(M)?(e.consume(M),j):P(M)}function T(M){return M===45||M===46||M===58||M===95||Tl(M)?(e.consume(M),T):R(M)}function R(M){return M===61?(e.consume(M),A):Kn(M)?(o=R,_(M)):Gi(M)?(e.consume(M),R):j(M)}function A(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),r=M,N):Kn(M)?(o=A,_(M)):Gi(M)?(e.consume(M),A):(e.consume(M),D)}function N(M){return M===r?(e.consume(M),r=void 0,I):M===null?n(M):Kn(M)?(o=N,_(M)):(e.consume(M),N)}function D(M){return M===null||M===34||M===39||M===60||M===61||M===96?n(M):M===47||M===62||cs(M)?j(M):(e.consume(M),D)}function I(M){return M===47||M===62||cs(M)?j(M):n(M)}function P(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):n(M)}function _(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),L}function L(M){return Gi(M)?dr(e,F,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):F(M)}function F(M){return e.enter("htmlTextData"),o(M)}}const NH={name:"labelEnd",resolveAll:rvt,resolveTo:svt,tokenize:avt},tvt={tokenize:ovt},nvt={tokenize:lvt},ivt={tokenize:cvt};function rvt(e){let t=-1;const n=[];for(;++t=3&&(u===null||Kn(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===r?(e.consume(u),i++,c):(e.exit("thematicBreakSequence"),Gi(u)?dr(e,l,"whitespace")(u):l(u))}}const Oc={continuation:{tokenize:vvt},exit:wvt,name:"list",tokenize:yvt},gvt={partial:!0,tokenize:Ovt},bvt={partial:!0,tokenize:xvt};function yvt(e,t,n){const i=this,r=i.events[i.events.length-1];let s=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,o=0;return l;function l(m){const g=i.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!i.containerState.marker||m===i.containerState.marker:zB(m)){if(i.containerState.type||(i.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(_N,n,u)(m):u(m);if(!i.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(m)}return n(m)}function c(m){return zB(m)&&++o<10?(e.consume(m),c):(!i.interrupt||o<2)&&(i.containerState.marker?m===i.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):n(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||m,e.check(hT,i.interrupt?n:d,e.attempt(gvt,h,f))}function d(m){return i.containerState.initialBlankLine=!0,s++,h(m)}function f(m){return Gi(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),h):n(m)}function h(m){return i.containerState.size=s+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function vvt(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(hT,r,s);function r(l){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,dr(e,t,"listItemIndent",i.containerState.size+1)(l)}function s(l){return i.containerState.furtherBlankLines||!Gi(l)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,o(l)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(bvt,t,o)(l))}function o(l){return i.containerState._closeFlow=!0,i.interrupt=void 0,dr(e,e.attempt(Oc,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function xvt(e,t,n){const i=this;return dr(e,r,"listItemIndent",i.containerState.size+1);function r(s){const o=i.events[i.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===i.containerState.size?t(s):n(s)}}function wvt(e){e.exit(this.containerState.type)}function Ovt(e,t,n){const i=this;return dr(e,r,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(s){const o=i.events[i.events.length-1];return!Gi(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const dte={name:"setextUnderline",resolveTo:kvt,tokenize:Svt};function kvt(e,t){let n=e.length,i,r,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(r=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",s?(e.splice(r,0,["enter",o,t]),e.splice(s+1,0,["exit",e[i][1],t]),e[i][1].end={...e[s][1].end}):e[i][1]=o,e.push(["exit",o,t]),e}function Svt(e,t,n){const i=this;let r;return s;function s(u){let d=i.events.length,f;for(;d--;)if(i.events[d][1].type!=="lineEnding"&&i.events[d][1].type!=="linePrefix"&&i.events[d][1].type!=="content"){f=i.events[d][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||f)?(e.enter("setextHeadingLine"),r=u,o(u)):n(u)}function o(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===r?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),Gi(u)?dr(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Kn(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const Evt={tokenize:Cvt};function Cvt(e){const t=this,n=e.attempt(hT,i,e.attempt(this.parser.constructs.flowInitial,r,dr(e,e.attempt(this.parser.constructs.flow,r,e.attempt(N0t,r)),"linePrefix")));return n;function i(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Avt={resolveAll:DPe()},Tvt=PPe("string"),_vt=PPe("text");function PPe(e){return{resolveAll:DPe(e==="text"?jvt:void 0),tokenize:t};function t(n){const i=this,r=this.parser.constructs[e],s=n.attempt(r,o,l);return o;function o(d){return u(d)?s(d):l(d)}function l(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),c}function c(d){return u(d)?(n.exit("data"),s(d)):(n.consume(d),c)}function u(d){if(d===null)return!0;const f=r[d];let h=-1;if(f)for(;++h-1){const l=o[0];typeof l=="string"?o[0]=l.slice(i):o.shift()}s>0&&o.push(e[r].slice(0,s))}return o}function zvt(e,t){let n=-1;const i=[];let r;for(;++n0){const Ye=Oe.tokenStack[Oe.tokenStack.length-1];(Ye[1]||fte).call(Oe,void 0,Ye[0])}for(ge.position={start:Mm(le.length>0?le[0][1].start:{line:1,column:1,offset:0}),end:Mm(le.length>0?le[le.length-2][1].end:{line:1,column:1,offset:0})},We=-1;++We0&&(i.className=["language-"+r[0]]);let s={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function txt(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nxt(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ixt(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),r=nO(i.toLowerCase()),s=e.footnoteOrder.indexOf(i);let o,l=e.footnoteCounts.get(i);l===void 0?(l=0,e.footnoteOrder.push(i),o=e.footnoteOrder.length):o=s+1,l+=1,e.footnoteCounts.set(i,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+r,id:n+"fnref-"+r+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function rxt(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function sxt(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function LPe(e,t){const n=t.referenceType;let i="]";if(n==="collapsed"?i+="[]":n==="full"&&(i+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+i}];const r=e.all(t),s=r[0];s&&s.type==="text"?s.value="["+s.value:r.unshift({type:"text",value:"["});const o=r[r.length-1];return o&&o.type==="text"?o.value+=i:r.push({type:"text",value:i}),r}function axt(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return LPe(e,t);const r={src:nO(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,s),e.applyData(t,s)}function oxt(e,t){const n={src:nO(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,i),e.applyData(t,i)}function lxt(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const i={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,i),e.applyData(t,i)}function cxt(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return LPe(e,t);const r={href:nO(i.url||"")};i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function uxt(e,t){const n={href:nO(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function dxt(e,t,n){const i=e.all(t),r=n?fxt(n):$Pe(t),s={},o=[];if(typeof t.checked=="boolean"){const d=i[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},i.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let l=-1;for(;++l0){const Ue=Se.tokenStack[Se.tokenStack.length-1];(Ue[1]||hte).call(Se,void 0,Ue[0])}for(ve.position={start:Lm(ce.length>0?ce[0][1].start:{line:1,column:1,offset:0}),end:Lm(ce.length>0?ce[ce.length-2][1].end:{line:1,column:1,offset:0})},$e=-1;++$e0&&(i.className=["language-"+r[0]]);let s={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function ixt(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function rxt(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function sxt(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),r=iO(i.toLowerCase()),s=e.footnoteOrder.indexOf(i);let o,l=e.footnoteCounts.get(i);l===void 0?(l=0,e.footnoteOrder.push(i),o=e.footnoteOrder.length):o=s+1,l+=1,e.footnoteCounts.set(i,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+r,id:n+"fnref-"+r+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function axt(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function oxt(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function $Pe(e,t){const n=t.referenceType;let i="]";if(n==="collapsed"?i+="[]":n==="full"&&(i+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+i}];const r=e.all(t),s=r[0];s&&s.type==="text"?s.value="["+s.value:r.unshift({type:"text",value:"["});const o=r[r.length-1];return o&&o.type==="text"?o.value+=i:r.push({type:"text",value:i}),r}function lxt(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return $Pe(e,t);const r={src:iO(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,s),e.applyData(t,s)}function cxt(e,t){const n={src:iO(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,i),e.applyData(t,i)}function uxt(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const i={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,i),e.applyData(t,i)}function dxt(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return $Pe(e,t);const r={href:iO(i.url||"")};i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function fxt(e,t){const n={href:iO(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function hxt(e,t,n){const i=e.all(t),r=n?pxt(n):FPe(t),s={},o=[];if(typeof t.checked=="boolean"){const d=i[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},i.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let l=-1;for(;++l1}function hxt(e,t){const n={},i=e.all(t);let r=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++r0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=jh(t.children[1]),c=xM(t.children[t.children.length-1]);l&&c&&(o.position={start:l,end:c}),r.push(o)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function yxt(e,t,n){const i=n?n.children:void 0,s=(i?i.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,l=o?o.length:t.children.length;let c=-1;const u=[];for(;++c0,!0),i[0]),r=i.index+i[0].length,i=n.exec(t);return s.push(mte(t.slice(r),r>0,!1)),s.join("")}function mte(e,t,n){let i=0,r=e.length;if(t){let s=e.codePointAt(i);for(;s===hte||s===pte;)i++,s=e.codePointAt(i)}if(n){let s=e.codePointAt(r-1);for(;s===hte||s===pte;)r--,s=e.codePointAt(r-1)}return r>i?e.slice(i,r):""}function wxt(e,t){const n={type:"text",value:xxt(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Oxt(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const kxt={blockquote:Zvt,break:Jvt,code:ext,delete:txt,emphasis:nxt,footnoteReference:ixt,heading:rxt,html:sxt,imageReference:axt,image:oxt,inlineCode:lxt,linkReference:cxt,link:uxt,listItem:dxt,list:hxt,paragraph:pxt,root:mxt,strong:gxt,table:bxt,tableCell:vxt,tableRow:yxt,text:wxt,thematicBreak:Oxt,toml:y_,yaml:y_,definition:y_,footnoteDefinition:y_};function y_(){}const FPe=-1,kM=0,lE=1,kI=2,NH=3,RH=4,IH=5,PH=6,BPe=7,UPe=8,Sxt=typeof self=="object"?self:globalThis,gte=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Sxt[e](t)},Ext=(e,t)=>{const n=(r,s)=>(e.set(s,r),r),i=r=>{if(e.has(r))return e.get(r);const[s,o]=t[r];switch(s){case kM:case FPe:return n(o,r);case lE:{const l=n([],r);for(const c of o)l.push(i(c));return l}case kI:{const l=n({},r);for(const[c,u]of o)l[i(c)]=i(u);return l}case NH:return n(new Date(o),r);case RH:{const{source:l,flags:c}=o;return n(new RegExp(l,c),r)}case IH:{const l=n(new Map,r);for(const[c,u]of o)l.set(i(c),i(u));return l}case PH:{const l=n(new Set,r);for(const c of o)l.add(i(c));return l}case BPe:{const{name:l,message:c}=o;return n(gte(l,c),r)}case UPe:return n(BigInt(o),r);case"BigInt":return n(Object(BigInt(o)),r);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return n(new DataView(l),o)}}return n(gte(s,o),r)};return i},bte=e=>Ext(new Map,e)(0),$v="",{toString:Cxt}={},{keys:Axt}=Object,gk=e=>{const t=typeof e;if(t!=="object"||!e)return[kM,t];const n=Cxt.call(e).slice(8,-1);switch(n){case"Array":return[lE,$v];case"Object":return[kI,$v];case"Date":return[NH,$v];case"RegExp":return[RH,$v];case"Map":return[IH,$v];case"Set":return[PH,$v];case"DataView":return[lE,n]}return n.includes("Array")?[lE,n]:n.includes("Error")?[BPe,n]:[kI,n]},v_=([e,t])=>e===kM&&(t==="function"||t==="symbol"),Txt=(e,t,n,i)=>{const r=(o,l)=>{const c=i.push(o)-1;return n.set(l,c),c},s=o=>{if(n.has(o))return n.get(o);let[l,c]=gk(o);switch(l){case kM:{let d=o;switch(c){case"bigint":l=UPe,d=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return r([FPe],o)}return r([l,d],o)}case lE:{if(c){let h=o;return c==="DataView"?h=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(h=new Uint8Array(o)),r([c,[...h]],o)}const d=[],f=r([l,d],o);for(const h of o)d.push(s(h));return f}case kI:{if(c)switch(c){case"BigInt":return r([c,o.toString()],o);case"Boolean":case"Number":case"String":return r([c,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const d=[],f=r([l,d],o);for(const h of Axt(o))(e||!v_(gk(o[h])))&&d.push([s(h),s(o[h])]);return f}case NH:return r([l,o.toISOString()],o);case RH:{const{source:d,flags:f}=o;return r([l,{source:d,flags:f}],o)}case IH:{const d=[],f=r([l,d],o);for(const[h,m]of o)(e||!(v_(gk(h))||v_(gk(m))))&&d.push([s(h),s(m)]);return f}case PH:{const d=[],f=r([l,d],o);for(const h of o)(e||!v_(gk(h)))&&d.push(s(h));return f}}const{message:u}=o;return r([l,{name:c,message:u}],o)};return s},yte=(e,{json:t,lossy:n}={})=>{const i=[];return Txt(!(t||n),!!t,new Map,i)(e),i},i1=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?bte(yte(e,t)):structuredClone(e):(e,t)=>bte(yte(e,t));function _xt(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function jxt(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Nxt(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||_xt,i=e.options.footnoteBackLabel||jxt,r=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c0&&g.push({type:"text",value:" "});let w=typeof n=="string"?n:n(c,m);typeof w=="string"&&(w={type:"text",value:w}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(c,m),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const v=d[d.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const w=v.children[v.children.length-1];w&&w.type==="text"?w.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...g)}else d.push(...g);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,y),l.push(y)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...i1(o),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:` +`});const u={type:"element",tagName:"li",properties:s,children:o};return e.patch(t,u),e.applyData(t,u)}function pxt(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let i=-1;for(;!t&&++i1}function mxt(e,t){const n={},i=e.all(t);let r=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++r0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=Nh(t.children[1]),c=xM(t.children[t.children.length-1]);l&&c&&(o.position={start:l,end:c}),r.push(o)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function xxt(e,t,n){const i=n?n.children:void 0,s=(i?i.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,l=o?o.length:t.children.length;let c=-1;const u=[];for(;++c0,!0),i[0]),r=i.index+i[0].length,i=n.exec(t);return s.push(gte(t.slice(r),r>0,!1)),s.join("")}function gte(e,t,n){let i=0,r=e.length;if(t){let s=e.codePointAt(i);for(;s===pte||s===mte;)i++,s=e.codePointAt(i)}if(n){let s=e.codePointAt(r-1);for(;s===pte||s===mte;)r--,s=e.codePointAt(r-1)}return r>i?e.slice(i,r):""}function kxt(e,t){const n={type:"text",value:Oxt(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Sxt(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Ext={blockquote:ext,break:txt,code:nxt,delete:ixt,emphasis:rxt,footnoteReference:sxt,heading:axt,html:oxt,imageReference:lxt,image:cxt,inlineCode:uxt,linkReference:dxt,link:fxt,listItem:hxt,list:mxt,paragraph:gxt,root:bxt,strong:yxt,table:vxt,tableCell:wxt,tableRow:xxt,text:kxt,thematicBreak:Sxt,toml:v_,yaml:v_,definition:v_,footnoteDefinition:v_};function v_(){}const BPe=-1,kM=0,cE=1,kI=2,RH=3,IH=4,PH=5,DH=6,UPe=7,QPe=8,Cxt=typeof self=="object"?self:globalThis,bte=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Cxt[e](t)},Axt=(e,t)=>{const n=(r,s)=>(e.set(s,r),r),i=r=>{if(e.has(r))return e.get(r);const[s,o]=t[r];switch(s){case kM:case BPe:return n(o,r);case cE:{const l=n([],r);for(const c of o)l.push(i(c));return l}case kI:{const l=n({},r);for(const[c,u]of o)l[i(c)]=i(u);return l}case RH:return n(new Date(o),r);case IH:{const{source:l,flags:c}=o;return n(new RegExp(l,c),r)}case PH:{const l=n(new Map,r);for(const[c,u]of o)l.set(i(c),i(u));return l}case DH:{const l=n(new Set,r);for(const c of o)l.add(i(c));return l}case UPe:{const{name:l,message:c}=o;return n(bte(l,c),r)}case QPe:return n(BigInt(o),r);case"BigInt":return n(Object(BigInt(o)),r);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return n(new DataView(l),o)}}return n(bte(s,o),r)};return i},yte=e=>Axt(new Map,e)(0),Fv="",{toString:Txt}={},{keys:_xt}=Object,bk=e=>{const t=typeof e;if(t!=="object"||!e)return[kM,t];const n=Txt.call(e).slice(8,-1);switch(n){case"Array":return[cE,Fv];case"Object":return[kI,Fv];case"Date":return[RH,Fv];case"RegExp":return[IH,Fv];case"Map":return[PH,Fv];case"Set":return[DH,Fv];case"DataView":return[cE,n]}return n.includes("Array")?[cE,n]:n.includes("Error")?[UPe,n]:[kI,n]},x_=([e,t])=>e===kM&&(t==="function"||t==="symbol"),jxt=(e,t,n,i)=>{const r=(o,l)=>{const c=i.push(o)-1;return n.set(l,c),c},s=o=>{if(n.has(o))return n.get(o);let[l,c]=bk(o);switch(l){case kM:{let d=o;switch(c){case"bigint":l=QPe,d=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return r([BPe],o)}return r([l,d],o)}case cE:{if(c){let h=o;return c==="DataView"?h=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(h=new Uint8Array(o)),r([c,[...h]],o)}const d=[],f=r([l,d],o);for(const h of o)d.push(s(h));return f}case kI:{if(c)switch(c){case"BigInt":return r([c,o.toString()],o);case"Boolean":case"Number":case"String":return r([c,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const d=[],f=r([l,d],o);for(const h of _xt(o))(e||!x_(bk(o[h])))&&d.push([s(h),s(o[h])]);return f}case RH:return r([l,o.toISOString()],o);case IH:{const{source:d,flags:f}=o;return r([l,{source:d,flags:f}],o)}case PH:{const d=[],f=r([l,d],o);for(const[h,m]of o)(e||!(x_(bk(h))||x_(bk(m))))&&d.push([s(h),s(m)]);return f}case DH:{const d=[],f=r([l,d],o);for(const h of o)(e||!x_(bk(h)))&&d.push(s(h));return f}}const{message:u}=o;return r([l,{name:c,message:u}],o)};return s},vte=(e,{json:t,lossy:n}={})=>{const i=[];return jxt(!(t||n),!!t,new Map,i)(e),i},r1=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?yte(vte(e,t)):structuredClone(e):(e,t)=>yte(vte(e,t));function Nxt(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Rxt(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Ixt(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Nxt,i=e.options.footnoteBackLabel||Rxt,r=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c0&&g.push({type:"text",value:" "});let w=typeof n=="string"?n:n(c,m);typeof w=="string"&&(w={type:"text",value:w}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(c,m),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const v=d[d.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const w=v.children[v.children.length-1];w&&w.type==="text"?w.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...g)}else d.push(...g);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,y),l.push(y)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...r1(o),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:` -`}]}}const hT=function(e){if(e==null)return Dxt;if(typeof e=="function")return SM(e);if(typeof e=="object")return Array.isArray(e)?Rxt(e):Ixt(e);if(typeof e=="string")return Pxt(e);throw new Error("Expected function, string, or object as test")};function Rxt(e){const t=[];let n=-1;for(;++n":""))+")"})}return h;function h(){let m=QPe,g,b,v;if((!t||s(c,u,d[d.length-1]||void 0))&&(m=Fxt(n(c,d)),m[0]===VB))return m;if("children"in c&&c.children){const y=c;if(y.children&&m[0]!==$xt)for(b=(i?y.children.length:-1)+o,v=d.concat(y);b>-1&&b":""))+")"})}return h;function h(){let m=zPe,g,b,v;if((!t||s(c,u,d[d.length-1]||void 0))&&(m=Uxt(n(c,d)),m[0]===HB))return m;if("children"in c&&c.children){const y=c;if(y.children&&m[0]!==Bxt)for(b=(i?y.children.length:-1)+o,v=d.concat(y);b>-1&&b0&&n.push({type:"text",value:` -`}),n}function vte(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function xte(e,t){const n=Uxt(e,t),i=n.one(e,void 0),r=Nxt(n),s=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return r&&s.children.push({type:"text",value:` -`},r),s}function qxt(e,t){return e&&"run"in e?async function(n,i){const r=xte(n,{file:i,...t});await e.run(r,i)}:function(n,i){return xte(n,{file:i,...e||t})}}function wte(e){if(e)throw e}var _N=Object.prototype.hasOwnProperty,VPe=Object.prototype.toString,Ote=Object.defineProperty,kte=Object.getOwnPropertyDescriptor,Ste=function(t){return typeof Array.isArray=="function"?Array.isArray(t):VPe.call(t)==="[object Array]"},Ete=function(t){if(!t||VPe.call(t)!=="[object Object]")return!1;var n=_N.call(t,"constructor"),i=t.constructor&&t.constructor.prototype&&_N.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!i)return!1;var r;for(r in t);return typeof r>"u"||_N.call(t,r)},Cte=function(t,n){Ote&&n.name==="__proto__"?Ote(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Ate=function(t,n){if(n==="__proto__")if(_N.call(t,n)){if(kte)return kte(t,n).value}else return;return t[n]},Wxt=function e(){var t,n,i,r,s,o,l=arguments[0],c=1,u=arguments.length,d=!1;for(typeof l=="boolean"&&(d=l,l=arguments[1]||{},c=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});co.length;let c;l&&o.push(r);try{c=e.apply(this,o)}catch(u){const d=u;if(l&&n)throw d;return r(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(s,r):c instanceof Error?r(c):s(c))}function r(o,...l){n||(n=!0,t(o,...l))}function s(o){r(null,o)}}const Kf={basename:Xxt,dirname:Yxt,extname:Zxt,join:Jxt,sep:"/"};function Xxt(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');mT(e);let n=0,i=-1,r=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;r--;)if(e.codePointAt(r)===47){if(s){n=r+1;break}}else i<0&&(s=!0,i=r+1);return i<0?"":e.slice(n,i)}if(t===e)return"";let o=-1,l=t.length-1;for(;r--;)if(e.codePointAt(r)===47){if(s){n=r+1;break}}else o<0&&(s=!0,o=r+1),l>-1&&(e.codePointAt(r)===t.codePointAt(l--)?l<0&&(i=r):(l=-1,i=o));return n===i?i=o:i<0&&(i=e.length),e.slice(n,i)}function Yxt(e){if(mT(e),e.length===0)return".";let t=-1,n=e.length,i;for(;--n;)if(e.codePointAt(n)===47){if(i){t=n;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Zxt(e){mT(e);let t=e.length,n=-1,i=0,r=-1,s=0,o;for(;t--;){const l=e.codePointAt(t);if(l===47){if(o){i=t+1;break}continue}n<0&&(o=!0,n=t+1),l===46?r<0?r=t:s!==1&&(s=1):r>-1&&(s=-1)}return r<0||n<0||s===0||s===1&&r===n-1&&r===i+1?"":e.slice(r,n)}function Jxt(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function twt(e,t){let n="",i=0,r=-1,s=0,o=-1,l,c;for(;++o<=e.length;){if(o2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",i=0):(n=n.slice(0,c),i=n.length-1-n.lastIndexOf("/")),r=o,s=0;continue}}else if(n.length>0){n="",i=0,r=o,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(r+1,o):n=e.slice(r+1,o),i=o-r-1;r=o,s=0}else l===46&&s>-1?s++:s=-1}return n}function mT(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const nwt={cwd:iwt};function iwt(){return"/"}function WB(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function rwt(e){if(typeof e=="string")e=new URL(e);else if(!WB(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return swt(e)}function swt(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let n=-1;for(;++n0){let[m,...g]=d;const b=i[h][1];qB(b)&&qB(m)&&(m=m4(!0,b,m)),i[h]=[u,m,...g]}}}}const cwt=new DH().freeze();function v4(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function x4(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function w4(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function _te(e){if(!qB(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function jte(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function x_(e){return uwt(e)?e:new HPe(e)}function uwt(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function dwt(e){return typeof e=="string"||fwt(e)}function fwt(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const hwt="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Nte=[],Rte={allowDangerousHtml:!0},pwt=/^(https?|ircs?|mailto|xmpp)$/i,mwt=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function qPe(e){const t=gwt(e),n=bwt(e);return ywt(t.runSync(t.parse(n),n),e)}function gwt(e){const t=e.rehypePlugins||Nte,n=e.remarkPlugins||Nte,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Rte}:Rte;return cwt().use(Yvt).use(n).use(qxt,i).use(t)}function bwt(e){const t=e.children||"",n=new HPe;return typeof t=="string"&&(n.value=t),n}function ywt(e,t){const n=t.allowedElements,i=t.allowElement,r=t.components,s=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||vwt;for(const d of mwt)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+hwt+d.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),pT(e,u),Pyt(e,{Fragment:a.Fragment,components:r,ignoreInvalidStyle:!0,jsx:a.jsx,jsxs:a.jsxs,passKeys:!0,passNode:!0});function u(d,f,h){if(d.type==="raw"&&h&&typeof f=="number")return o?h.children.splice(f,1):h.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let m;for(m in f4)if(Object.hasOwn(f4,m)&&Object.hasOwn(d.properties,m)){const g=d.properties[m],b=f4[m];(b===null||b.includes(d.tagName))&&(d.properties[m]=c(String(g||""),m,d))}}if(d.type==="element"){let m=n?!n.includes(d.tagName):s?s.includes(d.tagName):!1;if(!m&&i&&typeof f=="number"&&(m=!i(d,f,h)),m&&h&&typeof f=="number")return l&&d.children?h.children.splice(f,1,...d.children):h.children.splice(f,1),f}}}function vwt(e){const t=e.indexOf(":"),n=e.indexOf("?"),i=e.indexOf("#"),r=e.indexOf("/");return t===-1||r!==-1&&t>r||n!==-1&&t>n||i!==-1&&t>i||pwt.test(e.slice(0,t))?e:""}function Ite(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,r=n.indexOf(t);for(;r!==-1;)i++,r=n.indexOf(t,r+t.length);return i}function xwt(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function wwt(e,t,n){const r=hT((n||{}).ignore||[]),s=Owt(t);let o=-1;for(;++o0?{type:"text",value:S}:void 0),S===!1?h.lastIndex=O+1:(g!==O&&w.push({type:"text",value:u.value.slice(g,O)}),Array.isArray(S)?w.push(...S):S&&w.push(S),g=O+x[0].length,y=!0),!h.global)break;x=h.exec(u.value)}return y?(g?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],i=n.indexOf(")");const r=Ite(e,"(");let s=Ite(e,")");for(;i!==-1&&r>s;)e+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),s++;return[e,n]}function WPe(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||g0(n)||wM(n))&&(!t||n!==47)}KPe.peek=Hwt;function Lwt(){this.buffer()}function $wt(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Fwt(){this.buffer()}function Bwt(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Uwt(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=pf(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Qwt(e){this.exit(e)}function zwt(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=pf(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Vwt(e){this.exit(e)}function Hwt(){return"["}function KPe(e,t,n,i){const r=n.createTracker(i);let s=r.move("[^");const o=n.enter("footnoteReference"),l=n.enter("reference");return s+=r.move(n.safe(n.associationId(e),{after:"]",before:s})),l(),o(),s+=r.move("]"),s}function qwt(){return{enter:{gfmFootnoteCallString:Lwt,gfmFootnoteCall:$wt,gfmFootnoteDefinitionLabelString:Fwt,gfmFootnoteDefinition:Bwt},exit:{gfmFootnoteCallString:Uwt,gfmFootnoteCall:Qwt,gfmFootnoteDefinitionLabelString:zwt,gfmFootnoteDefinition:Vwt}}}function Wwt(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:KPe},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,r,s,o){const l=s.createTracker(o);let c=l.move("[^");const u=s.enter("footnoteDefinition"),d=s.enter("label");return c+=l.move(s.safe(s.associationId(i),{before:c,after:"]"})),d(),c+=l.move("]:"),i.children&&i.children.length>0&&(l.shift(4),c+=l.move((t?` -`:" ")+s.indentLines(s.containerFlow(i,l.current()),t?GPe:Kwt))),u(),c}}function Kwt(e,t,n){return t===0?e:GPe(e,t,n)}function GPe(e,t,n){return(n?"":" ")+e}const Gwt=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];XPe.peek=e1t;function Xwt(){return{canContainEols:["delete"],enter:{strikethrough:Zwt},exit:{strikethrough:Jwt}}}function Ywt(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Gwt}],handlers:{delete:XPe}}}function Zwt(e){this.enter({type:"delete",children:[]},e)}function Jwt(e){this.exit(e)}function XPe(e,t,n,i){const r=n.createTracker(i),s=n.enter("strikethrough");let o=r.move("~~");return o+=n.containerPhrasing(e,{...r.current(),before:o,after:"~"}),o+=r.move("~~"),s(),o}function e1t(){return"~"}function t1t(e){return e.length}function n1t(e,t){const n=t||{},i=(n.align||[]).concat(),r=n.stringLength||t1t,s=[],o=[],l=[],c=[];let u=0,d=-1;for(;++du&&(u=e[d].length);++yc[y])&&(c[y]=x)}b.push(w)}o[d]=b,l[d]=v}let f=-1;if(typeof i=="object"&&"length"in i)for(;++fc[f]&&(c[f]=w),m[f]=w),h[f]=x}o.splice(1,0,h),l.splice(1,0,m),d=-1;const g=[];for(;++d "),s.shift(2);const o=n.indentLines(n.containerFlow(e,s.current()),s1t);return r(),o}function s1t(e,t,n){return">"+(n?"":" ")+e}function a1t(e,t){return Mte(e,t.inConstruct,!0)&&!Mte(e,t.notInConstruct,!1)}function Mte(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let i=-1;for(;++io&&(o=s):s=1,r=i+t.length,i=n.indexOf(t,r);return o}function l1t(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function c1t(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function u1t(e,t,n,i){const r=c1t(n),s=e.value||"",o=r==="`"?"GraveAccent":"Tilde";if(l1t(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(s,d1t);return f(),h}const l=n.createTracker(i),c=r.repeat(Math.max(o1t(s,r)+1,3)),u=n.enter("codeFenced");let d=l.move(c);if(e.lang){const f=n.enter(`codeFencedLang${o}`);d+=l.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...l.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${o}`);d+=l.move(" "),d+=l.move(n.safe(e.meta,{before:d,after:` +`}),n}function xte(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function wte(e,t){const n=zxt(e,t),i=n.one(e,void 0),r=Ixt(n),s=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return r&&s.children.push({type:"text",value:` +`},r),s}function Kxt(e,t){return e&&"run"in e?async function(n,i){const r=wte(n,{file:i,...t});await e.run(r,i)}:function(n,i){return wte(n,{file:i,...e||t})}}function Ote(e){if(e)throw e}var jN=Object.prototype.hasOwnProperty,HPe=Object.prototype.toString,kte=Object.defineProperty,Ste=Object.getOwnPropertyDescriptor,Ete=function(t){return typeof Array.isArray=="function"?Array.isArray(t):HPe.call(t)==="[object Array]"},Cte=function(t){if(!t||HPe.call(t)!=="[object Object]")return!1;var n=jN.call(t,"constructor"),i=t.constructor&&t.constructor.prototype&&jN.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!i)return!1;var r;for(r in t);return typeof r>"u"||jN.call(t,r)},Ate=function(t,n){kte&&n.name==="__proto__"?kte(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Tte=function(t,n){if(n==="__proto__")if(jN.call(t,n)){if(Ste)return Ste(t,n).value}else return;return t[n]},Gxt=function e(){var t,n,i,r,s,o,l=arguments[0],c=1,u=arguments.length,d=!1;for(typeof l=="boolean"&&(d=l,l=arguments[1]||{},c=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});co.length;let c;l&&o.push(r);try{c=e.apply(this,o)}catch(u){const d=u;if(l&&n)throw d;return r(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(s,r):c instanceof Error?r(c):s(c))}function r(o,...l){n||(n=!0,t(o,...l))}function s(o){r(null,o)}}const Gf={basename:Zxt,dirname:Jxt,extname:ewt,join:twt,sep:"/"};function Zxt(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');gT(e);let n=0,i=-1,r=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;r--;)if(e.codePointAt(r)===47){if(s){n=r+1;break}}else i<0&&(s=!0,i=r+1);return i<0?"":e.slice(n,i)}if(t===e)return"";let o=-1,l=t.length-1;for(;r--;)if(e.codePointAt(r)===47){if(s){n=r+1;break}}else o<0&&(s=!0,o=r+1),l>-1&&(e.codePointAt(r)===t.codePointAt(l--)?l<0&&(i=r):(l=-1,i=o));return n===i?i=o:i<0&&(i=e.length),e.slice(n,i)}function Jxt(e){if(gT(e),e.length===0)return".";let t=-1,n=e.length,i;for(;--n;)if(e.codePointAt(n)===47){if(i){t=n;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function ewt(e){gT(e);let t=e.length,n=-1,i=0,r=-1,s=0,o;for(;t--;){const l=e.codePointAt(t);if(l===47){if(o){i=t+1;break}continue}n<0&&(o=!0,n=t+1),l===46?r<0?r=t:s!==1&&(s=1):r>-1&&(s=-1)}return r<0||n<0||s===0||s===1&&r===n-1&&r===i+1?"":e.slice(r,n)}function twt(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function iwt(e,t){let n="",i=0,r=-1,s=0,o=-1,l,c;for(;++o<=e.length;){if(o2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",i=0):(n=n.slice(0,c),i=n.length-1-n.lastIndexOf("/")),r=o,s=0;continue}}else if(n.length>0){n="",i=0,r=o,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(r+1,o):n=e.slice(r+1,o),i=o-r-1;r=o,s=0}else l===46&&s>-1?s++:s=-1}return n}function gT(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const rwt={cwd:swt};function swt(){return"/"}function KB(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function awt(e){if(typeof e=="string")e=new URL(e);else if(!KB(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return owt(e)}function owt(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let n=-1;for(;++n0){let[m,...g]=d;const b=i[h][1];WB(b)&&WB(m)&&(m=g4(!0,b,m)),i[h]=[u,m,...g]}}}}const dwt=new MH().freeze();function x4(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function w4(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function O4(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function jte(e){if(!WB(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Nte(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function w_(e){return fwt(e)?e:new qPe(e)}function fwt(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function hwt(e){return typeof e=="string"||pwt(e)}function pwt(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const mwt="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Rte=[],Ite={allowDangerousHtml:!0},gwt=/^(https?|ircs?|mailto|xmpp)$/i,bwt=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function WPe(e){const t=ywt(e),n=vwt(e);return xwt(t.runSync(t.parse(n),n),e)}function ywt(e){const t=e.rehypePlugins||Rte,n=e.remarkPlugins||Rte,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Ite}:Ite;return dwt().use(Jvt).use(n).use(Kxt,i).use(t)}function vwt(e){const t=e.children||"",n=new qPe;return typeof t=="string"&&(n.value=t),n}function xwt(e,t){const n=t.allowedElements,i=t.allowElement,r=t.components,s=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||wwt;for(const d of bwt)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+mwt+d.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),mT(e,u),Myt(e,{Fragment:a.Fragment,components:r,ignoreInvalidStyle:!0,jsx:a.jsx,jsxs:a.jsxs,passKeys:!0,passNode:!0});function u(d,f,h){if(d.type==="raw"&&h&&typeof f=="number")return o?h.children.splice(f,1):h.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let m;for(m in h4)if(Object.hasOwn(h4,m)&&Object.hasOwn(d.properties,m)){const g=d.properties[m],b=h4[m];(b===null||b.includes(d.tagName))&&(d.properties[m]=c(String(g||""),m,d))}}if(d.type==="element"){let m=n?!n.includes(d.tagName):s?s.includes(d.tagName):!1;if(!m&&i&&typeof f=="number"&&(m=!i(d,f,h)),m&&h&&typeof f=="number")return l&&d.children?h.children.splice(f,1,...d.children):h.children.splice(f,1),f}}}function wwt(e){const t=e.indexOf(":"),n=e.indexOf("?"),i=e.indexOf("#"),r=e.indexOf("/");return t===-1||r!==-1&&t>r||n!==-1&&t>n||i!==-1&&t>i||gwt.test(e.slice(0,t))?e:""}function Pte(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,r=n.indexOf(t);for(;r!==-1;)i++,r=n.indexOf(t,r+t.length);return i}function Owt(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function kwt(e,t,n){const r=pT((n||{}).ignore||[]),s=Swt(t);let o=-1;for(;++o0?{type:"text",value:S}:void 0),S===!1?h.lastIndex=O+1:(g!==O&&w.push({type:"text",value:u.value.slice(g,O)}),Array.isArray(S)?w.push(...S):S&&w.push(S),g=O+x[0].length,y=!0),!h.global)break;x=h.exec(u.value)}return y?(g?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],i=n.indexOf(")");const r=Pte(e,"(");let s=Pte(e,")");for(;i!==-1&&r>s;)e+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),s++;return[e,n]}function KPe(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||b0(n)||wM(n))&&(!t||n!==47)}GPe.peek=Wwt;function Fwt(){this.buffer()}function Bwt(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Uwt(){this.buffer()}function Qwt(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function zwt(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=mf(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Vwt(e){this.exit(e)}function Hwt(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=mf(this.sliceSerialize(e)).toLowerCase(),n.label=t}function qwt(e){this.exit(e)}function Wwt(){return"["}function GPe(e,t,n,i){const r=n.createTracker(i);let s=r.move("[^");const o=n.enter("footnoteReference"),l=n.enter("reference");return s+=r.move(n.safe(n.associationId(e),{after:"]",before:s})),l(),o(),s+=r.move("]"),s}function Kwt(){return{enter:{gfmFootnoteCallString:Fwt,gfmFootnoteCall:Bwt,gfmFootnoteDefinitionLabelString:Uwt,gfmFootnoteDefinition:Qwt},exit:{gfmFootnoteCallString:zwt,gfmFootnoteCall:Vwt,gfmFootnoteDefinitionLabelString:Hwt,gfmFootnoteDefinition:qwt}}}function Gwt(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:GPe},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,r,s,o){const l=s.createTracker(o);let c=l.move("[^");const u=s.enter("footnoteDefinition"),d=s.enter("label");return c+=l.move(s.safe(s.associationId(i),{before:c,after:"]"})),d(),c+=l.move("]:"),i.children&&i.children.length>0&&(l.shift(4),c+=l.move((t?` +`:" ")+s.indentLines(s.containerFlow(i,l.current()),t?XPe:Xwt))),u(),c}}function Xwt(e,t,n){return t===0?e:XPe(e,t,n)}function XPe(e,t,n){return(n?"":" ")+e}const Ywt=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];YPe.peek=n1t;function Zwt(){return{canContainEols:["delete"],enter:{strikethrough:e1t},exit:{strikethrough:t1t}}}function Jwt(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Ywt}],handlers:{delete:YPe}}}function e1t(e){this.enter({type:"delete",children:[]},e)}function t1t(e){this.exit(e)}function YPe(e,t,n,i){const r=n.createTracker(i),s=n.enter("strikethrough");let o=r.move("~~");return o+=n.containerPhrasing(e,{...r.current(),before:o,after:"~"}),o+=r.move("~~"),s(),o}function n1t(){return"~"}function i1t(e){return e.length}function r1t(e,t){const n=t||{},i=(n.align||[]).concat(),r=n.stringLength||i1t,s=[],o=[],l=[],c=[];let u=0,d=-1;for(;++du&&(u=e[d].length);++yc[y])&&(c[y]=x)}b.push(w)}o[d]=b,l[d]=v}let f=-1;if(typeof i=="object"&&"length"in i)for(;++fc[f]&&(c[f]=w),m[f]=w),h[f]=x}o.splice(1,0,h),l.splice(1,0,m),d=-1;const g=[];for(;++d "),s.shift(2);const o=n.indentLines(n.containerFlow(e,s.current()),o1t);return r(),o}function o1t(e,t,n){return">"+(n?"":" ")+e}function l1t(e,t){return Lte(e,t.inConstruct,!0)&&!Lte(e,t.notInConstruct,!1)}function Lte(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let i=-1;for(;++io&&(o=s):s=1,r=i+t.length,i=n.indexOf(t,r);return o}function u1t(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function d1t(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function f1t(e,t,n,i){const r=d1t(n),s=e.value||"",o=r==="`"?"GraveAccent":"Tilde";if(u1t(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(s,h1t);return f(),h}const l=n.createTracker(i),c=r.repeat(Math.max(c1t(s,r)+1,3)),u=n.enter("codeFenced");let d=l.move(c);if(e.lang){const f=n.enter(`codeFencedLang${o}`);d+=l.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...l.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${o}`);d+=l.move(" "),d+=l.move(n.safe(e.meta,{before:d,after:` `,encode:["`"],...l.current()})),f()}return d+=l.move(` `),s&&(d+=l.move(s+` -`)),d+=l.move(c),u(),d}function d1t(e,t,n){return(n?"":" ")+e}function MH(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function f1t(e,t,n,i){const r=MH(n),s=r==='"'?"Quote":"Apostrophe",o=n.enter("definition");let l=n.enter("label");const c=n.createTracker(i);let u=c.move("[");return u+=c.move(n.safe(n.associationId(e),{before:u,after:"]",...c.current()})),u+=c.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":` -`,...c.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=c.move(" "+r),u+=c.move(n.safe(e.title,{before:u,after:r,...c.current()})),u+=c.move(r),l()),o(),u}function h1t(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function kC(e){return"&#x"+e.toString(16).toUpperCase()+";"}function SI(e,t,n){const i=n1(e),r=n1(t);return i===void 0?r===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}ZPe.peek=p1t;function ZPe(e,t,n,i){const r=h1t(n),s=n.enter("emphasis"),o=n.createTracker(i),l=o.move(r);let c=o.move(n.containerPhrasing(e,{after:r,before:l,...o.current()}));const u=c.charCodeAt(0),d=SI(i.before.charCodeAt(i.before.length-1),u,r);d.inside&&(c=kC(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=SI(i.after.charCodeAt(0),f,r);h.inside&&(c=c.slice(0,-1)+kC(f));const m=o.move(r);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+m}function p1t(e,t,n){return n.options.emphasis||"*"}function m1t(e,t){let n=!1;return pT(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,VB}),!!((!e.depth||e.depth<3)&&TH(e)&&(t.options.setext||n))}function g1t(e,t,n,i){const r=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(i);if(m1t(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...s.current(),before:` +`)),d+=l.move(c),u(),d}function h1t(e,t,n){return(n?"":" ")+e}function LH(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function p1t(e,t,n,i){const r=LH(n),s=r==='"'?"Quote":"Apostrophe",o=n.enter("definition");let l=n.enter("label");const c=n.createTracker(i);let u=c.move("[");return u+=c.move(n.safe(n.associationId(e),{before:u,after:"]",...c.current()})),u+=c.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":` +`,...c.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=c.move(" "+r),u+=c.move(n.safe(e.title,{before:u,after:r,...c.current()})),u+=c.move(r),l()),o(),u}function m1t(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function SC(e){return"&#x"+e.toString(16).toUpperCase()+";"}function SI(e,t,n){const i=i1(e),r=i1(t);return i===void 0?r===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}JPe.peek=g1t;function JPe(e,t,n,i){const r=m1t(n),s=n.enter("emphasis"),o=n.createTracker(i),l=o.move(r);let c=o.move(n.containerPhrasing(e,{after:r,before:l,...o.current()}));const u=c.charCodeAt(0),d=SI(i.before.charCodeAt(i.before.length-1),u,r);d.inside&&(c=SC(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=SI(i.after.charCodeAt(0),f,r);h.inside&&(c=c.slice(0,-1)+SC(f));const m=o.move(r);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+m}function g1t(e,t,n){return n.options.emphasis||"*"}function b1t(e,t){let n=!1;return mT(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,HB}),!!((!e.depth||e.depth<3)&&_H(e)&&(t.options.setext||n))}function y1t(e,t,n,i){const r=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(i);if(b1t(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...s.current(),before:` `,after:` `});return f(),d(),h+` `+(r===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(` `))+1))}const o="#".repeat(r),l=n.enter("headingAtx"),c=n.enter("phrasing");s.move(o+" ");let u=n.containerPhrasing(e,{before:"# ",after:` -`,...s.current()});return/^[\t ]/.test(u)&&(u=kC(u.charCodeAt(0))+u.slice(1)),u=u?o+" "+u:o,n.options.closeAtx&&(u+=" "+o),c(),l(),u}JPe.peek=b1t;function JPe(e){return e.value||""}function b1t(){return"<"}eDe.peek=y1t;function eDe(e,t,n,i){const r=MH(n),s=r==='"'?"Quote":"Apostrophe",o=n.enter("image");let l=n.enter("label");const c=n.createTracker(i);let u=c.move("![");return u+=c.move(n.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=c.move(" "+r),u+=c.move(n.safe(e.title,{before:u,after:r,...c.current()})),u+=c.move(r),l()),u+=c.move(")"),o(),u}function y1t(){return"!"}tDe.peek=v1t;function tDe(e,t,n,i){const r=e.referenceType,s=n.enter("imageReference");let o=n.enter("label");const l=n.createTracker(i);let c=l.move("![");const u=n.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=d,s(),r==="full"||!u||u!==f?c+=l.move(f+"]"):r==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function v1t(){return"!"}nDe.peek=x1t;function nDe(e,t,n){let i=e.value||"",r="`",s=-1;for(;new RegExp("(^|[^`])"+r+"([^`]|$)").test(i);)r+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++s\u007F]/.test(e.url))}rDe.peek=w1t;function rDe(e,t,n,i){const r=MH(n),s=r==='"'?"Quote":"Apostrophe",o=n.createTracker(i);let l,c;if(iDe(e,n)){const d=n.stack;n.stack=[],l=n.enter("autolink");let f=o.move("<");return f+=o.move(n.containerPhrasing(e,{before:f,after:">",...o.current()})),f+=o.move(">"),l(),n.stack=d,f}l=n.enter("link"),c=n.enter("label");let u=o.move("[");return u+=o.move(n.containerPhrasing(e,{before:u,after:"](",...o.current()})),u+=o.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),u+=o.move("<"),u+=o.move(n.safe(e.url,{before:u,after:">",...o.current()})),u+=o.move(">")):(c=n.enter("destinationRaw"),u+=o.move(n.safe(e.url,{before:u,after:e.title?" ":")",...o.current()}))),c(),e.title&&(c=n.enter(`title${s}`),u+=o.move(" "+r),u+=o.move(n.safe(e.title,{before:u,after:r,...o.current()})),u+=o.move(r),c()),u+=o.move(")"),l(),u}function w1t(e,t,n){return iDe(e,n)?"<":"["}sDe.peek=O1t;function sDe(e,t,n,i){const r=e.referenceType,s=n.enter("linkReference");let o=n.enter("label");const l=n.createTracker(i);let c=l.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=d,s(),r==="full"||!u||u!==f?c+=l.move(f+"]"):r==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function O1t(){return"["}function LH(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function k1t(e){const t=LH(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function S1t(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function aDe(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function E1t(e,t,n,i){const r=n.enter("list"),s=n.bulletCurrent;let o=e.ordered?S1t(n):LH(n);const l=e.ordered?o==="."?")":".":k1t(n);let c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),aDe(n)===o&&d){let f=-1;for(;++f-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let o=s.length+1;(r==="tab"||r==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const l=n.createTracker(i);l.move(s+" ".repeat(o-s.length)),l.shift(o);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,l.current()),d);return c(),u;function d(f,h,m){return h?(m?"":" ".repeat(o))+f:(m?s:s+" ".repeat(o-s.length))+f}}function T1t(e,t,n,i){const r=n.enter("paragraph"),s=n.enter("phrasing"),o=n.containerPhrasing(e,i);return s(),r(),o}const _1t=hT(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function j1t(e,t,n,i){return(e.children.some(function(o){return _1t(o)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function N1t(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}oDe.peek=R1t;function oDe(e,t,n,i){const r=N1t(n),s=n.enter("strong"),o=n.createTracker(i),l=o.move(r+r);let c=o.move(n.containerPhrasing(e,{after:r,before:l,...o.current()}));const u=c.charCodeAt(0),d=SI(i.before.charCodeAt(i.before.length-1),u,r);d.inside&&(c=kC(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=SI(i.after.charCodeAt(0),f,r);h.inside&&(c=c.slice(0,-1)+kC(f));const m=o.move(r+r);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+m}function R1t(e,t,n){return n.options.strong||"*"}function I1t(e,t,n,i){return n.safe(e.value,i)}function P1t(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function D1t(e,t,n){const i=(aDe(n)+(n.options.ruleSpaces?" ":"")).repeat(P1t(n));return n.options.ruleSpaces?i.slice(0,-1):i}const lDe={blockquote:r1t,break:Lte,code:u1t,definition:f1t,emphasis:ZPe,hardBreak:Lte,heading:g1t,html:JPe,image:eDe,imageReference:tDe,inlineCode:nDe,link:rDe,linkReference:sDe,list:E1t,listItem:A1t,paragraph:T1t,root:j1t,strong:oDe,text:I1t,thematicBreak:D1t};function M1t(){return{enter:{table:L1t,tableData:$te,tableHeader:$te,tableRow:F1t},exit:{codeText:B1t,table:$1t,tableData:E4,tableHeader:E4,tableRow:E4}}}function L1t(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function $1t(e){this.exit(e),this.data.inTable=void 0}function F1t(e){this.enter({type:"tableRow",children:[]},e)}function E4(e){this.exit(e)}function $te(e){this.enter({type:"tableCell",children:[]},e)}function B1t(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,U1t));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function U1t(e,t){return t==="|"?t:e}function Q1t(e){const t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,r=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` +`,...s.current()});return/^[\t ]/.test(u)&&(u=SC(u.charCodeAt(0))+u.slice(1)),u=u?o+" "+u:o,n.options.closeAtx&&(u+=" "+o),c(),l(),u}eDe.peek=v1t;function eDe(e){return e.value||""}function v1t(){return"<"}tDe.peek=x1t;function tDe(e,t,n,i){const r=LH(n),s=r==='"'?"Quote":"Apostrophe",o=n.enter("image");let l=n.enter("label");const c=n.createTracker(i);let u=c.move("![");return u+=c.move(n.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=c.move(" "+r),u+=c.move(n.safe(e.title,{before:u,after:r,...c.current()})),u+=c.move(r),l()),u+=c.move(")"),o(),u}function x1t(){return"!"}nDe.peek=w1t;function nDe(e,t,n,i){const r=e.referenceType,s=n.enter("imageReference");let o=n.enter("label");const l=n.createTracker(i);let c=l.move("![");const u=n.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=d,s(),r==="full"||!u||u!==f?c+=l.move(f+"]"):r==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function w1t(){return"!"}iDe.peek=O1t;function iDe(e,t,n){let i=e.value||"",r="`",s=-1;for(;new RegExp("(^|[^`])"+r+"([^`]|$)").test(i);)r+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++s\u007F]/.test(e.url))}sDe.peek=k1t;function sDe(e,t,n,i){const r=LH(n),s=r==='"'?"Quote":"Apostrophe",o=n.createTracker(i);let l,c;if(rDe(e,n)){const d=n.stack;n.stack=[],l=n.enter("autolink");let f=o.move("<");return f+=o.move(n.containerPhrasing(e,{before:f,after:">",...o.current()})),f+=o.move(">"),l(),n.stack=d,f}l=n.enter("link"),c=n.enter("label");let u=o.move("[");return u+=o.move(n.containerPhrasing(e,{before:u,after:"](",...o.current()})),u+=o.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),u+=o.move("<"),u+=o.move(n.safe(e.url,{before:u,after:">",...o.current()})),u+=o.move(">")):(c=n.enter("destinationRaw"),u+=o.move(n.safe(e.url,{before:u,after:e.title?" ":")",...o.current()}))),c(),e.title&&(c=n.enter(`title${s}`),u+=o.move(" "+r),u+=o.move(n.safe(e.title,{before:u,after:r,...o.current()})),u+=o.move(r),c()),u+=o.move(")"),l(),u}function k1t(e,t,n){return rDe(e,n)?"<":"["}aDe.peek=S1t;function aDe(e,t,n,i){const r=e.referenceType,s=n.enter("linkReference");let o=n.enter("label");const l=n.createTracker(i);let c=l.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=d,s(),r==="full"||!u||u!==f?c+=l.move(f+"]"):r==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function S1t(){return"["}function $H(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function E1t(e){const t=$H(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function C1t(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function oDe(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function A1t(e,t,n,i){const r=n.enter("list"),s=n.bulletCurrent;let o=e.ordered?C1t(n):$H(n);const l=e.ordered?o==="."?")":".":E1t(n);let c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),oDe(n)===o&&d){let f=-1;for(;++f-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let o=s.length+1;(r==="tab"||r==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const l=n.createTracker(i);l.move(s+" ".repeat(o-s.length)),l.shift(o);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,l.current()),d);return c(),u;function d(f,h,m){return h?(m?"":" ".repeat(o))+f:(m?s:s+" ".repeat(o-s.length))+f}}function j1t(e,t,n,i){const r=n.enter("paragraph"),s=n.enter("phrasing"),o=n.containerPhrasing(e,i);return s(),r(),o}const N1t=pT(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function R1t(e,t,n,i){return(e.children.some(function(o){return N1t(o)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function I1t(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}lDe.peek=P1t;function lDe(e,t,n,i){const r=I1t(n),s=n.enter("strong"),o=n.createTracker(i),l=o.move(r+r);let c=o.move(n.containerPhrasing(e,{after:r,before:l,...o.current()}));const u=c.charCodeAt(0),d=SI(i.before.charCodeAt(i.before.length-1),u,r);d.inside&&(c=SC(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=SI(i.after.charCodeAt(0),f,r);h.inside&&(c=c.slice(0,-1)+SC(f));const m=o.move(r+r);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+m}function P1t(e,t,n){return n.options.strong||"*"}function D1t(e,t,n,i){return n.safe(e.value,i)}function M1t(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function L1t(e,t,n){const i=(oDe(n)+(n.options.ruleSpaces?" ":"")).repeat(M1t(n));return n.options.ruleSpaces?i.slice(0,-1):i}const cDe={blockquote:a1t,break:$te,code:f1t,definition:p1t,emphasis:JPe,hardBreak:$te,heading:y1t,html:eDe,image:tDe,imageReference:nDe,inlineCode:iDe,link:sDe,linkReference:aDe,list:A1t,listItem:_1t,paragraph:j1t,root:R1t,strong:lDe,text:D1t,thematicBreak:L1t};function $1t(){return{enter:{table:F1t,tableData:Fte,tableHeader:Fte,tableRow:U1t},exit:{codeText:Q1t,table:B1t,tableData:C4,tableHeader:C4,tableRow:C4}}}function F1t(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function B1t(e){this.exit(e),this.data.inTable=void 0}function U1t(e){this.enter({type:"tableRow",children:[]},e)}function C4(e){this.exit(e)}function Fte(e){this.enter({type:"tableCell",children:[]},e)}function Q1t(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,z1t));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function z1t(e,t){return t==="|"?t:e}function V1t(e){const t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,r=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:o,tableCell:c,tableRow:l}};function o(m,g,b,v){return u(d(m,b,v),m.align)}function l(m,g,b,v){const y=f(m,b,v),w=u([y]);return w.slice(0,w.indexOf(` -`))}function c(m,g,b,v){const y=b.enter("tableCell"),w=b.enter("phrasing"),x=b.containerPhrasing(m,{...v,before:s,after:s});return w(),y(),x}function u(m,g){return n1t(m,{align:g,alignDelimiters:i,padding:n,stringLength:r})}function d(m,g,b){const v=m.children;let y=-1;const w=[],x=g.enter("table");for(;++y0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const aOt={tokenize:pOt,partial:!0};function oOt(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:dOt,continuation:{tokenize:fOt},exit:hOt}},text:{91:{name:"gfmFootnoteCall",tokenize:uOt},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:lOt,resolveTo:cOt}}}}function lOt(e,t,n){const i=this;let r=i.events.length;const s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o;for(;r--;){const c=i.events[r][1];if(c.type==="labelImage"){o=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return l;function l(c){if(!o||!o._balanced)return n(c);const u=pf(i.sliceSerialize({start:o.end,end:i.now()}));return u.codePointAt(0)!==94||!s.includes(u.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function cOt(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},r={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};r.end.column++,r.end.offset++,r.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},r.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},l=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",r,t],["exit",r,t],["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...l),e}function uOt(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s=0,o;return l;function l(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),c}function c(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(f){if(s>999||f===93&&!o||f===null||f===91||cs(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return r.includes(pf(i.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return cs(f)||(o=!0),s++,e.consume(f),f===92?d:u}function d(f){return f===91||f===92||f===93?(e.consume(f),s++,u):u(f)}}function dOt(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s,o=0,l;return c;function c(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(g)}function d(g){if(o>999||g===93&&!l||g===null||g===91||cs(g))return n(g);if(g===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return s=pf(i.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return cs(g)||(l=!0),o++,e.consume(g),g===92?f:d}function f(g){return g===91||g===92||g===93?(e.consume(g),o++,d):d(g)}function h(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),r.includes(s)||r.push(s),dr(e,m,"gfmFootnoteDefinitionWhitespace")):n(g)}function m(g){return t(g)}}function fOt(e,t,n){return e.check(fT,t,e.attempt(aOt,t,n))}function hOt(e){e.exit("gfmFootnoteDefinition")}function pOt(e,t,n){const i=this;return dr(e,r,"gfmFootnoteDefinitionIndent",5);function r(s){const o=i.events[i.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(s):n(s)}}function mOt(e){let n=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:s,resolveAll:r};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function r(o,l){let c=-1;for(;++c1?c(g):(o.consume(g),f++,m);if(f<2&&!n)return c(g);const v=o.exit("strikethroughSequenceTemporary"),y=n1(g);return v._open=!y||y===2&&!!b,v._close=!b||b===2&&!!y,l(g)}}}class gOt{constructor(){this.map=[]}add(t,n,i){bOt(this,t,n,i)}consume(t){if(this.map.sort(function(s,o){return s[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const i=[];for(;n>0;)n-=1,i.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];i.push(t.slice()),t.length=0;let r=i.pop();for(;r;){for(const s of r)t.push(s);r=i.pop()}this.map.length=0}}function bOt(e,t,n,i){let r=0;if(!(n===0&&i.length===0)){for(;r-1;){const P=i.events[R][1].type;if(P==="lineEnding"||P==="linePrefix")R--;else break}const A=R>-1?i.events[R][1].type:null,N=A==="tableHead"||A==="tableRow"?S:c;return N===S&&i.parser.lazy[i.now().line]?n(T):N(T)}function c(T){return e.enter("tableHead"),e.enter("tableRow"),u(T)}function u(T){return T===124||(o=!0,s+=1),d(T)}function d(T){return T===null?n(T):Kn(T)?s>1?(s=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),m):n(T):Gi(T)?dr(e,d,"whitespace")(T):(s+=1,o&&(o=!1,r+=1),T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),o=!0,d):(e.enter("data"),f(T)))}function f(T){return T===null||T===124||cs(T)?(e.exit("data"),d(T)):(e.consume(T),T===92?h:f)}function h(T){return T===92||T===124?(e.consume(T),f):f(T)}function m(T){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(T):(e.enter("tableDelimiterRow"),o=!1,Gi(T)?dr(e,g,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):g(T))}function g(T){return T===45||T===58?v(T):T===124?(o=!0,e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),b):k(T)}function b(T){return Gi(T)?dr(e,v,"whitespace")(T):v(T)}function v(T){return T===58?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),y):T===45?(s+=1,y(T)):T===null||Kn(T)?O(T):k(T)}function y(T){return T===45?(e.enter("tableDelimiterFiller"),w(T)):k(T)}function w(T){return T===45?(e.consume(T),w):T===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(T))}function x(T){return Gi(T)?dr(e,O,"whitespace")(T):O(T)}function O(T){return T===124?g(T):T===null||Kn(T)?!o||r!==s?k(T):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(T)):k(T)}function k(T){return n(T)}function S(T){return e.enter("tableRow"),C(T)}function C(T){return T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),C):T===null||Kn(T)?(e.exit("tableRow"),t(T)):Gi(T)?dr(e,C,"whitespace")(T):(e.enter("data"),E(T))}function E(T){return T===null||T===124||cs(T)?(e.exit("data"),C(T)):(e.consume(T),T===92?j:E)}function j(T){return T===92||T===124?(e.consume(T),E):E(T)}}function wOt(e,t){let n=-1,i=!0,r=0,s=[0,0,0,0],o=[0,0,0,0],l=!1,c=0,u,d,f;const h=new gOt;for(;++nn[2]+1){const g=n[2]+1,b=n[3]-n[2]-1;e.add(g,b,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return r!==void 0&&(s.end=Object.assign({},ax(t.events,r)),e.add(r,0,[["exit",s,t]]),s=void 0),s}function Bte(e,t,n,i,r){const s=[],o=ax(t.events,n);r&&(r.end=Object.assign({},o),s.push(["exit",r,t])),i.end=Object.assign({},o),s.push(["exit",i,t]),e.add(n+1,0,s)}function ax(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const OOt={name:"tasklistCheck",tokenize:SOt};function kOt(){return{text:{91:OOt}}}function SOt(e,t,n){const i=this;return r;function r(c){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),s)}function s(c){return cs(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),o):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),o):n(c)}function o(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(c)}function l(c){return Kn(c)?t(c):Gi(c)?e.check({tokenize:EOt},t,n)(c):n(c)}}function EOt(e,t,n){return dr(e,i,"whitespace");function i(r){return r===null?n(r):t(r)}}function COt(e){return SPe([Y1t(),oOt(),mOt(e),vOt(),kOt()])}const AOt={};function bDe(e){const t=this,n=e||AOt,i=t.data(),r=i.micromarkExtensions||(i.micromarkExtensions=[]),s=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),o=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);r.push(COt(n)),s.push(W1t()),o.push(K1t(n))}const Ute=function(e,t,n){const i=hT(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++tu&&(u=d):d&&(u!==void 0&&u>-1&&c.push(` -`.repeat(u)||" "),u=-1,c.push(d))}return c.join("")}function vDe(e,t,n){return e.type==="element"?DOt(e,t,n):e.type==="text"?n.whitespace==="normal"?xDe(e,n):MOt(e):[]}function DOt(e,t,n){const i=wDe(e,n),r=e.children||[];let s=-1,o=[];if(IOt(e))return o;let l,c;for(GB(e)||Hte(e)&&Ute(t,e,Hte)?c=` -`:ROt(e)?(l=2,c=2):yDe(e)&&(l=1,c=1);++s]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},m=t.optional(r)+e.IDENT_RE+"\\s*\\(",g=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],b=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],O={type:b,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},k={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},S=[k,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],C={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:O,contains:S.concat([{begin:/\(/,end:/\)/,keywords:O,contains:S.concat(["self"]),relevance:0}]),relevance:0},E={className:"function",begin:"("+o+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:O,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:O,relevance:0},{begin:m,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:O,illegal:"",keywords:O,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:O},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function QOt(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=UOt(e),i=n.keywords;return i.type=[...i.type,...t.type],i.literal=[...i.literal,...t.literal],i.built_in=[...i.built_in,...t.built_in],i._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function EM(e){const t=e.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});const r={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},s=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,r]};r.contains.push(l);const c={match:/\\"/},u={className:"string",begin:/'/,end:/'/},d={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},h=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],m=e.SHEBANG({binary:`(${h.join("|")})`,relevance:10}),g={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},b=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],v=["true","false"],y={match:/(\/[a-z._-]+)+/},w=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],x=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],O=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],k=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:b,literal:v,built_in:[...w,...x,"set","shopt",...O,...k]},contains:[m,e.SHEBANG(),g,f,s,o,y,l,c,u,d,n]}}function zOt(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",o="("+i+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},m=t.optional(r)+e.IDENT_RE+"\\s*\\(",v={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},y=[f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],w={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:v,contains:y.concat([{begin:/\(/,end:/\)/,keywords:v,contains:y.concat(["self"]),relevance:0}]),relevance:0},x={begin:"("+o+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:v,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:v,relevance:0},{begin:m,returnBegin:!0,contains:[e.inherit(h,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C",aliases:["h"],keywords:v,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:f,strings:u,keywords:v}}}function VOt(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",o="(?!struct)("+i+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},m=t.optional(r)+e.IDENT_RE+"\\s*\\(",g=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],b=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],O={type:b,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},k={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},S=[k,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],C={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:O,contains:S.concat([{begin:/\(/,end:/\)/,keywords:O,contains:S.concat(["self"]),relevance:0}]),relevance:0},E={className:"function",begin:"("+o+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:O,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:O,relevance:0},{begin:m,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:O,illegal:"",keywords:O,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:O},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function HOt(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],i=["default","false","null","true"],r=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],s=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],o={keyword:r.concat(s),built_in:t,literal:i},l=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),c={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},u={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},d={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},f=e.inherit(d,{illegal:/\n/}),h={className:"subst",begin:/\{/,end:/\}/,keywords:o},m=e.inherit(h,{illegal:/\n/}),g={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,m]},b={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},v=e.inherit(b,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},m]});h.contains=[b,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.C_BLOCK_COMMENT_MODE],m.contains=[v,g,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const y={variants:[u,b,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},w={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},x=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",O={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:o,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},y,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,w,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,w,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+x+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:o,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,w],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,relevance:0,contains:[y,c,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},O]}}const qOt=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),WOt=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],KOt=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],GOt=[...WOt,...KOt],XOt=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),YOt=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),ZOt=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),JOt=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function kDe(e){const t=e.regex,n=qOt(e),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",s=/@-?\w[\w]*(-\w+)*/,o="[a-zA-Z-][a-zA-Z0-9_-]*",l=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,i,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+o,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+YOt.join("|")+")"},{begin:":(:)?("+ZOt.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+JOt.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:r,attribute:XOt.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+GOt.join("|")+")\\b"}]}}function SDe(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function EDe(e){const s={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:s,illegal:"CDe(e,t,n-1))}function ADe(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+CDe("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),c={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},u={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},d={className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:c,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+i+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:c,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,qte,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},qte,u]}}const Wte="[A-Za-z$_][0-9A-Za-z$_]*",tkt=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],nkt=["true","false","null","undefined","NaN","Infinity"],TDe=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],_De=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],jDe=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],ikt=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],rkt=[].concat(jDe,TDe,_De);function UH(e){const t=e.regex,n=(L,{after:F})=>{const M="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,F)=>{const M=L[0].length+L.index,V=L.input[M];if(V==="<"||V===","){F.ignoreMatch();return}V===">"&&(n(L,{after:M})||F.ignoreMatch());let q;const U=L.input.substring(M);if(q=U.match(/^\s*=/)){F.ignoreMatch();return}if((q=U.match(/^\s+extends\s+/))&&q.index===0){F.ignoreMatch();return}}},l={$pattern:Wte,keyword:tkt,literal:nkt,built_in:rkt,"variable.language":ikt},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},m={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},w={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const O=[].concat(w,h.contains),k=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(O)}]),S={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k},C={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},E={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...TDe,..._De]}},j={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[S],illegal:/%/},R={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function A(L){return t.concat("(?!",L.join("|"),")")}const N={match:t.concat(/\b/,A([...jDe,"super","import"].map(L=>`${L}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},P={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},I={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},S]},D="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",_={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(D)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[S]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:E},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),j,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,w,{match:/\$\d+/},f,E,{scope:"attr",match:i+t.lookahead(":"),relevance:0},_,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[w,e.REGEXP_MODE,{className:"function",begin:D,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[S,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},P,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[S]},N,R,C,I,{match:/\$[(.]/}]}}function QH(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],r={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[t,n,e.QUOTE_STRING_MODE,r,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var lx="[0-9](_*[0-9])*",S_=`\\.(${lx})`,E_="[0-9a-fA-F](_*[0-9a-fA-F])*",skt={className:"number",variants:[{begin:`(\\b(${lx})((${S_})|\\.)?|(${S_}))[eE][+-]?(${lx})[fFdD]?\\b`},{begin:`\\b(${lx})((${S_})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${S_})[fFdD]?\\b`},{begin:`\\b(${lx})[fFdD]\\b`},{begin:`\\b0[xX]((${E_})\\.?|(${E_})?\\.(${E_}))[pP][+-]?(${lx})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${E_})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function akt(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},i={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},r={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},s={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[s,r]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,s,r]}]};r.contains.push(o);const l={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},c={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(o,{className:"string"}),"self"]}]},u=skt,d=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),f={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},h=f;return h.variants[1].contains=[f],f.variants[1].contains=[h],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,d,n,i,l,c,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[f,e.C_LINE_COMMENT_MODE,d],relevance:0},e.C_LINE_COMMENT_MODE,d,l,c,o,e.C_NUMBER_MODE]},d]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},l,c]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` -`},u]}}const okt=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),lkt=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],ckt=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],ukt=[...lkt,...ckt],dkt=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),NDe=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),RDe=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),fkt=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),hkt=NDe.concat(RDe).sort().reverse();function pkt(e){const t=okt(e),n=hkt,i="and or not only",r="[\\w-]+",s="("+r+"|@\\{"+r+"\\})",o=[],l=[],c=function(x){return{className:"string",begin:"~?"+x+".*?"+x}},u=function(x,O,k){return{className:x,begin:O,relevance:k}},d={$pattern:/[a-z-]+/,keyword:i,attribute:dkt.join(" ")},f={begin:"\\(",end:"\\)",contains:l,keywords:d,relevance:0};l.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,c("'"),c('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,f,u("variable","@@?"+r,10),u("variable","@\\{"+r+"\\}"),u("built_in","~?`[^`]*?`"),{className:"attribute",begin:r+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const h=l.concat({begin:/\{/,end:/\}/,contains:o}),m={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},g={begin:s+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+fkt.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:l}}]},b={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:d,returnEnd:!0,contains:l,relevance:0}},v={className:"variable",variants:[{begin:"@"+r+"\\s*:",relevance:15},{begin:"@"+r}],starts:{end:"[;}]",returnEnd:!0,contains:h}},y={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:s,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,m,u("keyword","all\\b"),u("variable","@\\{"+r+"\\}"),{begin:"\\b("+ukt.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,u("selector-tag",s,0),u("selector-id","#"+s),u("selector-class","\\."+s,0),u("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+NDe.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+RDe.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},w={begin:r+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[y]};return o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,b,v,w,g,y,m,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:o}}function mkt(e){const t="\\[=*\\[",n="\\]=*\\]",i={begin:t,end:n,contains:["self"]},r=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[i],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:r.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:r}].concat(r)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[i],relevance:5}])}}function zH(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},r={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},s={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},d={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},f=e.inherit(u,{contains:[]}),h=e.inherit(d,{contains:[]});u.contains.push(h),d.contains.push(f);let m=[n,c];return[u,d,f,h].forEach(y=>{y.contains=y.contains.concat(m)}),m=m.concat(u,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:m},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:m}]}]},n,s,u,d,{className:"quote",begin:"^>\\s+",contains:m,end:"$"},r,i,c,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function gkt(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,l={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},c={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:l,illegal:"/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+c.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:c,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function bkt(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],i=/[dualxmsipngr]{0,12}/,r={$pattern:/[\w.]+/,keyword:n.join(" ")},s={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:r},o={begin:/->\{/,end:/\}/},l={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},c={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[l]},u={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},d=[e.BACKSLASH_ESCAPE,s,c],f=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],h=(b,v,y="\\1")=>{const w=y==="\\1"?y:t.concat(y,v);return t.concat(t.concat("(?:",b,")"),v,/(?:\\.|[^\\\/])*?/,w,/(?:\\.|[^\\\/])*?/,y,i)},m=(b,v,y)=>t.concat(t.concat("(?:",b,")"),v,/(?:\\.|[^\\\/])*?/,y,i),g=[c,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:"string",contains:d,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},u,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:h("s|tr|y",t.either(...f,{capture:!0}))},{begin:h("s|tr|y","\\(","\\)")},{begin:h("s|tr|y","\\[","\\]")},{begin:h("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:m("(?:m|qr)?",/\//,/\//)},{begin:m("m|qr",t.either(...f,{capture:!0}),/\1/)},{begin:m("m|qr",/\(/,/\)/)},{begin:m("m|qr",/\[/,/\]/)},{begin:m("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l,u]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return s.contains=g,o.contains=g,{name:"Perl",aliases:["pl","pm"],keywords:r,contains:g}}function ykt(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,i=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),r=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),s=t.concat(/[A-Z]+/,n),o={scope:"variable",match:"\\$+"+i},l={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},c={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},u=e.inherit(e.APOS_STRING_MODE,{illegal:null}),d=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(c)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(c),"on:begin":(P,I)=>{I.data._beginMatch=P[1]||P[2]},"on:end":(P,I)=>{I.data._beginMatch!==P[1]&&I.ignoreMatch()}},h=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),m=`[ -]`,g={scope:"string",variants:[d,u,f,h]},b={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},v=["false","null","true"],y=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],w=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],O={keyword:y,literal:(P=>{const I=[];return P.forEach(D=>{I.push(D),D.toLowerCase()===D?I.push(D.toUpperCase()):I.push(D.toLowerCase())}),I})(v),built_in:w},k=P=>P.map(I=>I.replace(/\|\d+$/,"")),S={variants:[{match:[/new/,t.concat(m,"+"),t.concat("(?!",k(w).join("\\b|"),"\\b)"),r],scope:{1:"keyword",4:"title.class"}}]},C=t.concat(i,"\\b(?!\\()"),E={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),C],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,t.concat(/::/,t.lookahead(/(?!class\b)/)),C],scope:{1:"title.class",3:"variable.constant"}},{match:[r,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[r,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},j={scope:"attr",match:t.concat(i,t.lookahead(":"),t.lookahead(/(?!::)/))},T={relevance:0,begin:/\(/,end:/\)/,keywords:O,contains:[j,o,E,e.C_BLOCK_COMMENT_MODE,g,b,S]},R={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",k(y).join("\\b|"),"|",k(w).join("\\b|"),"\\b)"),i,t.concat(m,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[T]};T.contains.push(R);const A=[j,E,e.C_BLOCK_COMMENT_MODE,g,b,S],N={begin:t.concat(/#\[\s*\\?/,t.either(r,s)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:v,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:v,keyword:["new","array"]},contains:["self",...A]},...A,{scope:"meta",variants:[{match:r},{match:s}]}]};return{case_insensitive:!1,keywords:O,contains:[N,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},l,{scope:"variable.language",match:/\$this\b/},o,R,E,{match:[/const/,/\s/,i],scope:{1:"keyword",3:"variable.constant"}},S,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:O,contains:["self",N,o,E,e.C_BLOCK_COMMENT_MODE,g,b]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},g,b]}}function vkt(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function IDe(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function HH(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},c={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},d={begin:/\{\{/,relevance:0},f={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,d,u]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},h="[0-9](_?[0-9])*",m=`(\\b(${h}))?\\.(${h})|\\b(${h})\\.`,g=`\\b|${i.join("|")}`,b={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${m}))[eE][+-]?(${h})[jJ]?(?=${g})`},{begin:`(${m})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${g})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${g})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${g})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${g})`},{begin:`\\b(${h})[jJ](?=${g})`}]},v={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",c,b,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,b,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,b,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,v,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[y]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[b,y,f]}]}}function xkt(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function wkt(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,i=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),r=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,s=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[r,i]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,i]},{scope:{1:"punctuation",2:"number"},match:[s,i]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,i]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:r},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:s},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function Okt(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",i=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),r=t.concat(i,/(::\w+)*/),o={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},l={className:"doctag",begin:"@[A-Za-z]+"},c={begin:"#<",end:">"},u=[e.COMMENT("#","$",{contains:[l]}),e.COMMENT("^=begin","^=end",{contains:[l],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],d={className:"subst",begin:/#\{/,end:/\}/,keywords:o},f={className:"string",contains:[e.BACKSLASH_ESCAPE,d],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,d]})]}]},h="[1-9](_?[0-9])*|0",m="[0-9](_?[0-9])*",g={className:"number",relevance:0,variants:[{begin:`\\b(${h})(\\.(${m}))?([eE][+-]?(${m})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},b={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},S=[f,{variants:[{match:[/class\s+/,r,/\s+<\s+/,r]},{match:[/\b(class|module)\s+/,r]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,r],scope:{2:"title.class"},keywords:o},{relevance:0,match:[r,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:i,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[b]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[f,{begin:n}],relevance:0},g,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,d],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(c,u),relevance:0}].concat(c,u);d.contains=S,b.contains=S;const T=[{begin:/^\s*=>/,starts:{end:"$",contains:S}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:o,contains:S}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(T).concat(u).concat(S)}}function PDe(e){const t=e.regex,n=/(r#)?/,i=t.concat(n,e.UNDERSCORE_IDENT_RE),r=t.concat(n,e.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,r,t.lookahead(/\s*\(/))},o="([ui](8|16|32|64|128|size)|f(32|64))?",l=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],c=["true","false","Some","None","Ok","Err"],u=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],d=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:d,keyword:l,literal:c,built_in:u},illegal:""},s]}}const kkt=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Skt=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Ekt=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Ckt=[...Skt,...Ekt],Akt=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Tkt=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),_kt=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),jkt=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function DDe(e){const t=kkt(e),n=_kt,i=Tkt,r="@[a-z-]+",s="and or not only",l={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+Ckt.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+i.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},l,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+jkt.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,l,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:r,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:Akt.join(" ")},contains:[{begin:r,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},l,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function Nkt(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function MDe(e){const t=e.regex,n=e.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},r={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["true","false","unknown"],o=["double precision","large object","with timezone","without timezone"],l=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],c=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],d=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],f=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],h=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],m=d,g=[...u,...c].filter(k=>!d.includes(k)),b={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},v={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:t.concat(/\b/,t.either(...m),/\s*\(/),relevance:0,keywords:{built_in:m}};function w(k){return t.concat(/\b/,t.either(...k.map(S=>S.replace(/\s+/,"\\s+"))),/\b/)}const x={scope:"keyword",match:w(h),relevance:0};function O(k,{exceptions:S,when:C}={}){const E=C;return S=S||[],k.map(j=>j.match(/\|\d+$/)||S.includes(j)?j:E(j)?`${j}|0`:j)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:O(g,{when:k=>k.length<3}),literal:s,type:l,built_in:f},contains:[{scope:"type",match:w(o)},x,y,b,i,r,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,v]}}function LDe(e){return e?typeof e=="string"?e:e.source:null}function bk(e){return qr("(?=",e,")")}function qr(...e){return e.map(n=>LDe(n)).join("")}function Rkt(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Gl(...e){return"("+(Rkt(e).capture?"":"?:")+e.map(i=>LDe(i)).join("|")+")"}const qH=e=>qr(/\b/,e,/\w$/.test(e)?/\b/:/\B/),Ikt=["Protocol","Type"].map(qH),Kte=["init","self"].map(qH),Pkt=["Any","Self"],C4=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Gte=["false","nil","true"],Dkt=["assignment","associativity","higherThan","left","lowerThan","none","right"],Mkt=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Xte=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],$De=Gl(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),FDe=Gl($De,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),A4=qr($De,FDe,"*"),BDe=Gl(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),EI=Gl(BDe,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),qf=qr(BDe,EI,"*"),C_=qr(/[A-Z]/,EI,"*"),Lkt=["attached","autoclosure",qr(/convention\(/,Gl("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",qr(/objc\(/,qf,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],$kt=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function Fkt(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),i=[e.C_LINE_COMMENT_MODE,n],r={match:[/\./,Gl(...Ikt,...Kte)],className:{2:"keyword"}},s={match:qr(/\./,Gl(...C4)),relevance:0},o=C4.filter(be=>typeof be=="string").concat(["_|0"]),l=C4.filter(be=>typeof be!="string").concat(Pkt).map(qH),c={variants:[{className:"keyword",match:Gl(...l,...Kte)}]},u={$pattern:Gl(/\b\w+/,/#\w+/),keyword:o.concat(Mkt),literal:Gte},d=[r,s,c],f={match:qr(/\./,Gl(...Xte)),relevance:0},h={className:"built_in",match:qr(/\b/,Gl(...Xte),/(?=\()/)},m=[f,h],g={match:/->/,relevance:0},b={className:"operator",relevance:0,variants:[{match:A4},{match:`\\.(\\.|${FDe})+`}]},v=[g,b],y="([0-9]_*)+",w="([0-9a-fA-F]_*)+",x={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${w})(\\.(${w}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},O=(be="")=>({className:"subst",variants:[{match:qr(/\\/,be,/[0\\tnr"']/)},{match:qr(/\\/,be,/u\{[0-9a-fA-F]{1,8}\}/)}]}),k=(be="")=>({className:"subst",match:qr(/\\/,be,/[\t ]*(?:[\r\n]|\r\n)/)}),S=(be="")=>({className:"subst",label:"interpol",begin:qr(/\\/,be,/\(/),end:/\)/}),C=(be="")=>({begin:qr(be,/"""/),end:qr(/"""/,be),contains:[O(be),k(be),S(be)]}),E=(be="")=>({begin:qr(be,/"/),end:qr(/"/,be),contains:[O(be),S(be)]}),j={className:"string",variants:[C(),C("#"),C("##"),C("###"),E(),E("#"),E("##"),E("###")]},T=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],R={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:T},A=be=>{const ue=qr(be,/\//),pe=qr(/\//,be);return{begin:ue,end:pe,contains:[...T,{scope:"comment",begin:`#(?!.*${pe})`,end:/$/}]}},N={scope:"regexp",variants:[A("###"),A("##"),A("#"),R]},P={match:qr(/`/,qf,/`/)},I={className:"variable",match:/\$\d+/},D={className:"variable",match:`\\$${EI}+`},_=[P,I,D],L={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:$kt,contains:[...v,x,j]}]}},F={scope:"keyword",match:qr(/@/,Gl(...Lkt),bk(Gl(/\(/,/\s+/)))},M={scope:"meta",match:qr(/@/,qf)},V=[L,F,M],q={match:bk(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:qr(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,EI,"+")},{className:"type",match:C_,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:qr(/\s+&\s+/,bk(C_)),relevance:0}]},U={begin://,keywords:u,contains:[...i,...d,...V,g,q]};q.contains.push(U);const J={match:qr(qf,/\s*:/),keywords:"_|0",relevance:0},z={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",J,...i,N,...d,...m,...v,x,j,..._,...V,q]},Z={begin://,keywords:"repeat each",contains:[...i,q]},ne={begin:Gl(bk(qr(qf,/\s*:/)),bk(qr(qf,/\s+/,qf,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:qf}]},W={begin:/\(/,end:/\)/,keywords:u,contains:[ne,...i,...d,...v,x,j,...V,q,z],endsParent:!0,illegal:/["']/},G={match:[/(func|macro)/,/\s+/,Gl(P.match,qf,A4)],className:{1:"keyword",3:"title.function"},contains:[Z,W,t],illegal:[/\[/,/%/]},H={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[Z,W,t],illegal:/\[|%/},se={match:[/operator/,/\s+/,A4],className:{1:"keyword",3:"title"}},Y={begin:[/precedencegroup/,/\s+/,C_],className:{1:"keyword",3:"title"},contains:[q],keywords:[...Dkt,...Gte],end:/}/},X={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},ie={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},ee={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,qf,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[Z,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:C_},...d],relevance:0}]};for(const be of j.variants){const ue=be.contains.find(ke=>ke.label==="interpol");ue.keywords=u;const pe=[...d,...m,...v,x,j,..._];ue.contains=[...pe,{begin:/\(/,end:/\)/,contains:["self",...pe]}]}return{name:"Swift",keywords:u,contains:[...i,G,H,X,ie,ee,se,Y,{beginKeywords:"import",end:/$/,contains:[...i],relevance:0},N,...d,...m,...v,x,j,..._,...V,q,z]}}const CI="[A-Za-z$_][0-9A-Za-z$_]*",UDe=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],QDe=["true","false","null","undefined","NaN","Infinity"],zDe=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],VDe=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],HDe=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],qDe=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],WDe=[].concat(HDe,zDe,VDe);function Bkt(e){const t=e.regex,n=(L,{after:F})=>{const M="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,F)=>{const M=L[0].length+L.index,V=L.input[M];if(V==="<"||V===","){F.ignoreMatch();return}V===">"&&(n(L,{after:M})||F.ignoreMatch());let q;const U=L.input.substring(M);if(q=U.match(/^\s*=/)){F.ignoreMatch();return}if((q=U.match(/^\s+extends\s+/))&&q.index===0){F.ignoreMatch();return}}},l={$pattern:CI,keyword:UDe,literal:QDe,built_in:WDe,"variable.language":qDe},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},m={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},w={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const O=[].concat(w,h.contains),k=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(O)}]),S={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k},C={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},E={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...zDe,...VDe]}},j={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[S],illegal:/%/},R={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function A(L){return t.concat("(?!",L.join("|"),")")}const N={match:t.concat(/\b/,A([...HDe,"super","import"].map(L=>`${L}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},P={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},I={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},S]},D="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",_={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(D)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[S]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:E},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),j,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,w,{match:/\$\d+/},f,E,{scope:"attr",match:i+t.lookahead(":"),relevance:0},_,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[w,e.REGEXP_MODE,{className:"function",begin:D,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[S,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},P,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[S]},N,R,C,I,{match:/\$[(.]/}]}}function WH(e){const t=e.regex,n=Bkt(e),i=CI,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[n.exports.CLASS_REFERENCE]},l={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:CI,keyword:UDe.concat(c),literal:QDe,built_in:WDe.concat(r),"variable.language":qDe},d={className:"meta",begin:"@"+i},f=(b,v,y)=>{const w=b.contains.findIndex(x=>x.label===v);if(w===-1)throw new Error("can not find mode to replace");b.contains.splice(w,1,y)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const h=n.contains.find(b=>b.scope==="attr"),m=Object.assign({},h,{match:t.concat(i,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,h,m]),n.contains=n.contains.concat([d,s,o,m]),f(n,"shebang",e.SHEBANG()),f(n,"use_strict",l);const g=n.contains.find(b=>b.label==="func.def");return g.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function Ukt(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},i={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},r=/\d{1,2}\/\d{1,2}\/\d{4}/,s=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,l=/\d{1,2}(:\d{1,2}){1,2}/,c={className:"literal",variants:[{begin:t.concat(/# */,t.either(s,r),/ *#/)},{begin:t.concat(/# */,l,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(s,r),/ +/,t.either(o,l),/ *#/)}]},u={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},d={className:"label",begin:/^\w+:/},f=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),h=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,i,c,u,d,f,h,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[h]}]}}function Qkt(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),i=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],r={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},s={className:"variable",begin:/\$[\w_]+/},o={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},l={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},c={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},u={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:i},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},s,o,r,e.QUOTE_STRING_MODE,c,u,l]}}function KDe(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(s,{begin:/\(/,end:/\)/}),l=e.inherit(e.APOS_STRING_MODE,{className:"string"}),c=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[s,c,l,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[s,o,c,l]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:u}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function KH(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,r]},l=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),h={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},m={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},g={begin:/\{/,end:/\}/,contains:[m],illegal:"\\n",relevance:0},b={begin:"\\[",end:"\\]",contains:[m],illegal:"\\n",relevance:0},v=[i,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},h,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},g,b,s,o],y=[...v];return y.pop(),y.push(l),m.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}const zkt={arduino:QOt,bash:EM,c:zOt,cpp:VOt,csharp:HOt,css:kDe,diff:SDe,go:EDe,graphql:ekt,ini:BH,java:ADe,javascript:UH,json:QH,kotlin:akt,less:pkt,lua:mkt,makefile:zH,markdown:VH,objectivec:gkt,perl:bkt,php:ykt,"php-template":vkt,plaintext:IDe,python:HH,"python-repl":xkt,r:wkt,ruby:Okt,rust:PDe,scss:DDe,shell:Nkt,sql:MDe,swift:Fkt,typescript:WH,vbnet:Ukt,wasm:Qkt,xml:KDe,yaml:KH};function GDe(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t],i=typeof n;(i==="object"||i==="function")&&!Object.isFrozen(n)&&GDe(n)}),e}let Yte=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function XDe(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function bg(e,...t){const n=Object.create(null);for(const i in e)n[i]=e[i];return t.forEach(function(i){for(const r in i)n[r]=i[r]}),n}const Vkt="",Zte=e=>!!e.scope,Hkt=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((i,r)=>`${i}${"_".repeat(r+1)}`)].join(" ")}return`${t}${e}`};class qkt{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=XDe(t)}openNode(t){if(!Zte(t))return;const n=Hkt(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){Zte(t)&&(this.buffer+=Vkt)}value(){return this.buffer}span(t){this.buffer+=``}}const Jte=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class GH{constructor(){this.rootNode=Jte(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const n=Jte({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(i=>this._walk(t,i)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{GH._collapse(n)}))}}class Wkt extends GH{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const i=t.root;n&&(i.scope=`language:${n}`),this.add(i)}toHTML(){return new qkt(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function SC(e){return e?typeof e=="string"?e:e.source:null}function YDe(e){return Z0("(?=",e,")")}function Kkt(e){return Z0("(?:",e,")*")}function Gkt(e){return Z0("(?:",e,")?")}function Z0(...e){return e.map(n=>SC(n)).join("")}function Xkt(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function XH(...e){return"("+(Xkt(e).capture?"":"?:")+e.map(i=>SC(i)).join("|")+")"}function ZDe(e){return new RegExp(e.toString()+"|").exec("").length-1}function Ykt(e,t){const n=e&&e.exec(t);return n&&n.index===0}const Zkt=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function YH(e,{joinWith:t}){let n=0;return e.map(i=>{n+=1;const r=n;let s=SC(i),o="";for(;s.length>0;){const l=Zkt.exec(s);if(!l){o+=s;break}o+=s.substring(0,l.index),s=s.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?o+="\\"+String(Number(l[1])+r):(o+=l[0],l[0]==="("&&n++)}return o}).map(i=>`(${i})`).join(t)}const Jkt=/\b\B/,JDe="[a-zA-Z]\\w*",ZH="[a-zA-Z_]\\w*",eMe="\\b\\d+(\\.\\d+)?",tMe="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",nMe="\\b(0b[01]+)",eSt="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",tSt=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=Z0(t,/.*\b/,e.binary,/\b.*/)),bg({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},e)},EC={begin:"\\\\[\\s\\S]",relevance:0},nSt={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[EC]},iSt={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[EC]},rSt={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},CM=function(e,t,n={}){const i=bg({scope:"comment",begin:e,end:t,contains:[]},n);i.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const r=XH("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return i.contains.push({begin:Z0(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},sSt=CM("//","$"),aSt=CM("/\\*","\\*/"),oSt=CM("#","$"),lSt={scope:"number",begin:eMe,relevance:0},cSt={scope:"number",begin:tMe,relevance:0},uSt={scope:"number",begin:nMe,relevance:0},dSt={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[EC,{begin:/\[/,end:/\]/,relevance:0,contains:[EC]}]},fSt={scope:"title",begin:JDe,relevance:0},hSt={scope:"title",begin:ZH,relevance:0},pSt={begin:"\\.\\s*"+ZH,relevance:0},mSt=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})};var A_=Object.freeze({__proto__:null,APOS_STRING_MODE:nSt,BACKSLASH_ESCAPE:EC,BINARY_NUMBER_MODE:uSt,BINARY_NUMBER_RE:nMe,COMMENT:CM,C_BLOCK_COMMENT_MODE:aSt,C_LINE_COMMENT_MODE:sSt,C_NUMBER_MODE:cSt,C_NUMBER_RE:tMe,END_SAME_AS_BEGIN:mSt,HASH_COMMENT_MODE:oSt,IDENT_RE:JDe,MATCH_NOTHING_RE:Jkt,METHOD_GUARD:pSt,NUMBER_MODE:lSt,NUMBER_RE:eMe,PHRASAL_WORDS_MODE:rSt,QUOTE_STRING_MODE:iSt,REGEXP_MODE:dSt,RE_STARTERS_RE:eSt,SHEBANG:tSt,TITLE_MODE:fSt,UNDERSCORE_IDENT_RE:ZH,UNDERSCORE_TITLE_MODE:hSt});function gSt(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function bSt(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function ySt(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=gSt,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function vSt(e,t){Array.isArray(e.illegal)&&(e.illegal=XH(...e.illegal))}function xSt(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function wSt(e,t){e.relevance===void 0&&(e.relevance=1)}const OSt=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(i=>{delete e[i]}),e.keywords=n.keywords,e.begin=Z0(n.beforeMatch,YDe(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},kSt=["of","and","for","in","not","or","if","then","parent","list","value"],SSt="keyword";function iMe(e,t,n=SSt){const i=Object.create(null);return typeof e=="string"?r(n,e.split(" ")):Array.isArray(e)?r(n,e):Object.keys(e).forEach(function(s){Object.assign(i,iMe(e[s],t,s))}),i;function r(s,o){t&&(o=o.map(l=>l.toLowerCase())),o.forEach(function(l){const c=l.split("|");i[c[0]]=[s,ESt(c[0],c[1])]})}}function ESt(e,t){return t?Number(t):CSt(e)?0:1}function CSt(e){return kSt.includes(e.toLowerCase())}const ene={},Xy=e=>{console.error(e)},tne=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Fv=(e,t)=>{ene[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),ene[`${e}/${t}`]=!0)},AI=new Error;function rMe(e,t,{key:n}){let i=0;const r=e[n],s={},o={};for(let l=1;l<=t.length;l++)o[l+i]=r[l],s[l+i]=!0,i+=ZDe(t[l-1]);e[n]=o,e[n]._emit=s,e[n]._multi=!0}function ASt(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Xy("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),AI;if(typeof e.beginScope!="object"||e.beginScope===null)throw Xy("beginScope must be object"),AI;rMe(e,e.begin,{key:"beginScope"}),e.begin=YH(e.begin,{joinWith:""})}}function TSt(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Xy("skip, excludeEnd, returnEnd not compatible with endScope: {}"),AI;if(typeof e.endScope!="object"||e.endScope===null)throw Xy("endScope must be object"),AI;rMe(e,e.end,{key:"endScope"}),e.end=YH(e.end,{joinWith:""})}}function _St(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function jSt(e){_St(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),ASt(e),TSt(e)}function NSt(e){function t(o,l){return new RegExp(SC(o),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,l]),this.matchAt+=ZDe(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(YH(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;const c=this.matcherRe.exec(l);if(!c)return null;const u=c.findIndex((f,h)=>h>0&&f!==void 0),d=this.matchIndexes[u];return c.splice(0,u),Object.assign(c,d)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];const c=new n;return this.rules.slice(l).forEach(([u,d])=>c.addRule(u,d)),c.compile(),this.multiRegexes[l]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,c){this.rules.push([l,c]),c.type==="begin"&&this.count++}exec(l){const c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let u=c.exec(l);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,u=d.exec(l)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function r(o){const l=new i;return o.contains.forEach(c=>l.addRule(c.begin,{rule:c,type:"begin"})),o.terminatorEnd&&l.addRule(o.terminatorEnd,{type:"end"}),o.illegal&&l.addRule(o.illegal,{type:"illegal"}),l}function s(o,l){const c=o;if(o.isCompiled)return c;[bSt,xSt,jSt,OSt].forEach(d=>d(o,l)),e.compilerExtensions.forEach(d=>d(o,l)),o.__beforeBegin=null,[ySt,vSt,wSt].forEach(d=>d(o,l)),o.isCompiled=!0;let u=null;return typeof o.keywords=="object"&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),u=o.keywords.$pattern,delete o.keywords.$pattern),u=u||/\w+/,o.keywords&&(o.keywords=iMe(o.keywords,e.case_insensitive)),c.keywordPatternRe=t(u,!0),l&&(o.begin||(o.begin=/\B|\b/),c.beginRe=t(c.begin),!o.end&&!o.endsWithParent&&(o.end=/\B|\b/),o.end&&(c.endRe=t(c.end)),c.terminatorEnd=SC(c.end)||"",o.endsWithParent&&l.terminatorEnd&&(c.terminatorEnd+=(o.end?"|":"")+l.terminatorEnd)),o.illegal&&(c.illegalRe=t(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map(function(d){return RSt(d==="self"?o:d)})),o.contains.forEach(function(d){s(d,c)}),o.starts&&s(o.starts,l),c.matcher=r(c),c}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=bg(e.classNameAliases||{}),s(e)}function sMe(e){return e?e.endsWithParent||sMe(e.starts):!1}function RSt(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return bg(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:sMe(e)?bg(e,{starts:e.starts?bg(e.starts):null}):Object.isFrozen(e)?bg(e):e}var ISt="11.11.1";class PSt extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const T4=XDe,nne=bg,ine=Symbol("nomatch"),DSt=7,aMe=function(e){const t=Object.create(null),n=Object.create(null),i=[];let r=!0;const s="Could not find the language '{}', did you forget to load/include a language module?",o={disableAutodetect:!0,name:"Plain text",contains:[]};let l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Wkt};function c(D){return l.noHighlightRe.test(D)}function u(D){let _=D.className+" ";_+=D.parentNode?D.parentNode.className:"";const L=l.languageDetectRe.exec(_);if(L){const F=E(L[1]);return F||(tne(s.replace("{}",L[1])),tne("Falling back to no-highlight mode for this block.",D)),F?L[1]:"no-highlight"}return _.split(/\s+/).find(F=>c(F)||E(F))}function d(D,_,L){let F="",M="";typeof _=="object"?(F=D,L=_.ignoreIllegals,M=_.language):(Fv("10.7.0","highlight(lang, code, ...args) has been deprecated."),Fv("10.7.0",`Please use highlight(code, options) instead. -https://github.com/highlightjs/highlight.js/issues/2277`),M=D,F=_),L===void 0&&(L=!0);const V={code:F,language:M};P("before:highlight",V);const q=V.result?V.result:f(V.language,V.code,L);return q.code=V.code,P("after:highlight",q),q}function f(D,_,L,F){const M=Object.create(null);function V(le,ge){return le.keywords[ge]}function q(){if(!pe.keywords){je.addText(Pe);return}let le=0;pe.keywordPatternRe.lastIndex=0;let ge=pe.keywordPatternRe.exec(Pe),Oe="";for(;ge;){Oe+=Pe.substring(le,ge.index);const Se=ee.case_insensitive?ge[0].toLowerCase():ge[0],We=V(pe,Se);if(We){const[Ye,ye]=We;if(je.addText(Oe),Oe="",M[Se]=(M[Se]||0)+1,M[Se]<=DSt&&(Ee+=ye),Ye.startsWith("_"))Oe+=ge[0];else{const we=ee.classNameAliases[Ye]||Ye;z(ge[0],we)}}else Oe+=ge[0];le=pe.keywordPatternRe.lastIndex,ge=pe.keywordPatternRe.exec(Pe)}Oe+=Pe.substring(le),je.addText(Oe)}function U(){if(Pe==="")return;let le=null;if(typeof pe.subLanguage=="string"){if(!t[pe.subLanguage]){je.addText(Pe);return}le=f(pe.subLanguage,Pe,!0,ke[pe.subLanguage]),ke[pe.subLanguage]=le._top}else le=m(Pe,pe.subLanguage.length?pe.subLanguage:null);pe.relevance>0&&(Ee+=le.relevance),je.__addSublanguage(le._emitter,le.language)}function J(){pe.subLanguage!=null?U():q(),Pe=""}function z(le,ge){le!==""&&(je.startScope(ge),je.addText(le),je.endScope())}function Z(le,ge){let Oe=1;const Se=ge.length-1;for(;Oe<=Se;){if(!le._emit[Oe]){Oe++;continue}const We=ee.classNameAliases[le[Oe]]||le[Oe],Ye=ge[Oe];We?z(Ye,We):(Pe=Ye,q(),Pe=""),Oe++}}function ne(le,ge){return le.scope&&typeof le.scope=="string"&&je.openNode(ee.classNameAliases[le.scope]||le.scope),le.beginScope&&(le.beginScope._wrap?(z(Pe,ee.classNameAliases[le.beginScope._wrap]||le.beginScope._wrap),Pe=""):le.beginScope._multi&&(Z(le.beginScope,ge),Pe="")),pe=Object.create(le,{parent:{value:pe}}),pe}function W(le,ge,Oe){let Se=Ykt(le.endRe,Oe);if(Se){if(le["on:end"]){const We=new Yte(le);le["on:end"](ge,We),We.isMatchIgnored&&(Se=!1)}if(Se){for(;le.endsParent&&le.parent;)le=le.parent;return le}}if(le.endsWithParent)return W(le.parent,ge,Oe)}function G(le){return pe.matcher.regexIndex===0?(Pe+=le[0],1):(ae=!0,0)}function H(le){const ge=le[0],Oe=le.rule,Se=new Yte(Oe),We=[Oe.__beforeBegin,Oe["on:begin"]];for(const Ye of We)if(Ye&&(Ye(le,Se),Se.isMatchIgnored))return G(ge);return Oe.skip?Pe+=ge:(Oe.excludeBegin&&(Pe+=ge),J(),!Oe.returnBegin&&!Oe.excludeBegin&&(Pe=ge)),ne(Oe,le),Oe.returnBegin?0:ge.length}function se(le){const ge=le[0],Oe=_.substring(le.index),Se=W(pe,le,Oe);if(!Se)return ine;const We=pe;pe.endScope&&pe.endScope._wrap?(J(),z(ge,pe.endScope._wrap)):pe.endScope&&pe.endScope._multi?(J(),Z(pe.endScope,le)):We.skip?Pe+=ge:(We.returnEnd||We.excludeEnd||(Pe+=ge),J(),We.excludeEnd&&(Pe=ge));do pe.scope&&je.closeNode(),!pe.skip&&!pe.subLanguage&&(Ee+=pe.relevance),pe=pe.parent;while(pe!==Se.parent);return Se.starts&&ne(Se.starts,le),We.returnEnd?0:ge.length}function Y(){const le=[];for(let ge=pe;ge!==ee;ge=ge.parent)ge.scope&&le.unshift(ge.scope);le.forEach(ge=>je.openNode(ge))}let X={};function ie(le,ge){const Oe=ge&&ge[0];if(Pe+=le,Oe==null)return J(),0;if(X.type==="begin"&&ge.type==="end"&&X.index===ge.index&&Oe===""){if(Pe+=_.slice(ge.index,ge.index+1),!r){const Se=new Error(`0 width match regex (${D})`);throw Se.languageName=D,Se.badRule=X.rule,Se}return 1}if(X=ge,ge.type==="begin")return H(ge);if(ge.type==="illegal"&&!L){const Se=new Error('Illegal lexeme "'+Oe+'" for mode "'+(pe.scope||"")+'"');throw Se.mode=pe,Se}else if(ge.type==="end"){const Se=se(ge);if(Se!==ine)return Se}if(ge.type==="illegal"&&Oe==="")return Pe+=` -`,1;if(_e>1e5&&_e>ge.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Pe+=Oe,Oe.length}const ee=E(D);if(!ee)throw Xy(s.replace("{}",D)),new Error('Unknown language: "'+D+'"');const be=NSt(ee);let ue="",pe=F||be;const ke={},je=new l.__emitter(l);Y();let Pe="",Ee=0,ze=0,_e=0,ae=!1;try{if(ee.__emitTokens)ee.__emitTokens(_,je);else{for(pe.matcher.considerAll();;){_e++,ae?ae=!1:pe.matcher.considerAll(),pe.matcher.lastIndex=ze;const le=pe.matcher.exec(_);if(!le)break;const ge=_.substring(ze,le.index),Oe=ie(ge,le);ze=le.index+Oe}ie(_.substring(ze))}return je.finalize(),ue=je.toHTML(),{language:D,value:ue,relevance:Ee,illegal:!1,_emitter:je,_top:pe}}catch(le){if(le.message&&le.message.includes("Illegal"))return{language:D,value:T4(_),illegal:!0,relevance:0,_illegalBy:{message:le.message,index:ze,context:_.slice(ze-100,ze+100),mode:le.mode,resultSoFar:ue},_emitter:je};if(r)return{language:D,value:T4(_),illegal:!1,relevance:0,errorRaised:le,_emitter:je,_top:pe};throw le}}function h(D){const _={value:T4(D),illegal:!1,relevance:0,_top:o,_emitter:new l.__emitter(l)};return _._emitter.addText(D),_}function m(D,_){_=_||l.languages||Object.keys(t);const L=h(D),F=_.filter(E).filter(T).map(J=>f(J,D,!1));F.unshift(L);const M=F.sort((J,z)=>{if(J.relevance!==z.relevance)return z.relevance-J.relevance;if(J.language&&z.language){if(E(J.language).supersetOf===z.language)return 1;if(E(z.language).supersetOf===J.language)return-1}return 0}),[V,q]=M,U=V;return U.secondBest=q,U}function g(D,_,L){const F=_&&n[_]||L;D.classList.add("hljs"),D.classList.add(`language-${F}`)}function b(D){let _=null;const L=u(D);if(c(L))return;if(P("before:highlightElement",{el:D,language:L}),D.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",D);return}if(D.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(D)),l.throwUnescapedHTML))throw new PSt("One of your code blocks includes unescaped HTML.",D.innerHTML);_=D;const F=_.textContent,M=L?d(F,{language:L,ignoreIllegals:!0}):m(F);D.innerHTML=M.value,D.dataset.highlighted="yes",g(D,L,M.language),D.result={language:M.language,re:M.relevance,relevance:M.relevance},M.secondBest&&(D.secondBest={language:M.secondBest.language,relevance:M.secondBest.relevance}),P("after:highlightElement",{el:D,result:M,text:F})}function v(D){l=nne(l,D)}const y=()=>{O(),Fv("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function w(){O(),Fv("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let x=!1;function O(){function D(){O()}if(document.readyState==="loading"){x||window.addEventListener("DOMContentLoaded",D,!1),x=!0;return}document.querySelectorAll(l.cssSelector).forEach(b)}function k(D,_){let L=null;try{L=_(e)}catch(F){if(Xy("Language definition for '{}' could not be registered.".replace("{}",D)),r)Xy(F);else throw F;L=o}L.name||(L.name=D),t[D]=L,L.rawDefinition=_.bind(null,e),L.aliases&&j(L.aliases,{languageName:D})}function S(D){delete t[D];for(const _ of Object.keys(n))n[_]===D&&delete n[_]}function C(){return Object.keys(t)}function E(D){return D=(D||"").toLowerCase(),t[D]||t[n[D]]}function j(D,{languageName:_}){typeof D=="string"&&(D=[D]),D.forEach(L=>{n[L.toLowerCase()]=_})}function T(D){const _=E(D);return _&&!_.disableAutodetect}function R(D){D["before:highlightBlock"]&&!D["before:highlightElement"]&&(D["before:highlightElement"]=_=>{D["before:highlightBlock"](Object.assign({block:_.el},_))}),D["after:highlightBlock"]&&!D["after:highlightElement"]&&(D["after:highlightElement"]=_=>{D["after:highlightBlock"](Object.assign({block:_.el},_))})}function A(D){R(D),i.push(D)}function N(D){const _=i.indexOf(D);_!==-1&&i.splice(_,1)}function P(D,_){const L=D;i.forEach(function(F){F[L]&&F[L](_)})}function I(D){return Fv("10.7.0","highlightBlock will be removed entirely in v12.0"),Fv("10.7.0","Please use highlightElement now."),b(D)}Object.assign(e,{highlight:d,highlightAuto:m,highlightAll:O,highlightElement:b,highlightBlock:I,configure:v,initHighlighting:y,initHighlightingOnLoad:w,registerLanguage:k,unregisterLanguage:S,listLanguages:C,getLanguage:E,registerAliases:j,autoDetection:T,inherit:nne,addPlugin:A,removePlugin:N}),e.debugMode=function(){r=!1},e.safeMode=function(){r=!0},e.versionString=ISt,e.regex={concat:Z0,lookahead:YDe,either:XH,optional:Gkt,anyNumberOfTimes:Kkt};for(const D in A_)typeof A_[D]=="object"&&GDe(A_[D]);return Object.assign(e,A_),e},r1=aMe({});r1.newInstance=()=>aMe({});var MSt=r1;r1.HighlightJS=r1;r1.default=r1;const al=T1(MSt),rne={},LSt="hljs-";function $St(e){const t=al.newInstance();return e&&s(e),{highlight:n,highlightAuto:i,listLanguages:r,register:s,registerAlias:o,registered:l};function n(c,u,d){const f=d||rne,h=typeof f.prefix=="string"?f.prefix:LSt;if(!t.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");t.configure({__emitter:FSt,classPrefix:h});const m=t.highlight(u,{ignoreIllegals:!0,language:c});if(m.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:m.errorRaised});const g=m._emitter.root,b=g.data;return b.language=m.language,b.relevance=m.relevance,g}function i(c,u){const f=(u||rne).subset||r();let h=-1,m=0,g;for(;++hm&&(m=v.data.relevance,g=v)}return g||{type:"root",children:[],data:{language:void 0,relevance:m}}}function r(){return t.listLanguages()}function s(c,u){if(typeof c=="string")t.registerLanguage(c,u);else{let d;for(d in c)Object.hasOwn(c,d)&&t.registerLanguage(d,c[d])}}function o(c,u){if(typeof c=="string")t.registerAliases(typeof u=="string"?u:[...u],{languageName:c});else{let d;for(d in c)if(Object.hasOwn(c,d)){const f=c[d];t.registerAliases(typeof f=="string"?f:[...f],{languageName:d})}}}function l(c){return!!t.getLanguage(c)}}class FSt{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],i=n.children[n.children.length-1];i&&i.type==="text"?i.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const i=this.stack[this.stack.length-1],r=t.root.children;n?i.children.push({type:"element",tagName:"span",properties:{className:[n]},children:r}):i.children.push(...r)}openNode(t){const n=this,i=t.split(".").map(function(o,l){return l?o+"_".repeat(l):n.options.classPrefix+o}),r=this.stack[this.stack.length-1],s={type:"element",tagName:"span",properties:{className:i},children:[]};r.children.push(s),this.stack.push(s)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const BSt={};function sne(e){const t=e||BSt,n=t.aliases,i=t.detect||!1,r=t.languages||zkt,s=t.plainText,o=t.prefix,l=t.subset;let c="hljs";const u=$St(r);if(n&&u.registerAlias(n),o){const d=o.indexOf("-");c=d===-1?o:o.slice(0,d)}return function(d,f){pT(d,"element",function(h,m,g){if(h.tagName!=="code"||!g||g.type!=="element"||g.tagName!=="pre")return;const b=USt(h);if(b===!1||!b&&!i||b&&s&&s.includes(b))return;Array.isArray(h.properties.className)||(h.properties.className=[]),h.properties.className.includes(c)||h.properties.className.unshift(c);const v=POt(h,{whitespace:"pre"});let y;try{y=b?u.highlight(b,v,{prefix:o}):u.highlightAuto(v,{prefix:o,subset:l})}catch(w){const x=w;if(b&&/Unknown language/.test(x.message)){f.message("Cannot highlight as `"+b+"`, it’s not registered",{ancestors:[g,h],cause:x,place:h.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw x}!b&&y.data&&y.data.language&&h.properties.className.push("language-"+y.data.language),y.children.length>0&&(h.children=y.children)})}}function USt(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let i;for(;++n-1&&s<=t.length){let o=0;for(;;){let l=n[o];if(l===void 0){const c=lne(t,n[o-1]);l=c===-1?t.length+1:c+1,n[o]=l}if(l>s)return{line:o+1,column:s-(o>0?n[o-1]:0)+1,offset:s};o++}}}function r(s){if(s&&typeof s.line=="number"&&typeof s.column=="number"&&!Number.isNaN(s.line)&&!Number.isNaN(s.column)){for(;n.length1?n[s.line-2]:0)+s.column-1;if(o=55296&&e<=57343}function hEt(e){return e>=56320&&e<=57343}function pEt(e,t){return(e-55296)*1024+9216+t}function fMe(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function hMe(e){return e>=64976&&e<=65007||fEt.has(e)}var dt;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(dt||(dt={}));const mEt=65536;class gEt{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=mEt,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:i,col:r,offset:s}=this,o=r+n,l=s+n;return{code:t,startLine:i,endLine:i,startCol:o,endCol:o,startOffset:l,endOffset:l}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(hEt(n))return this.pos++,this._addGap(),pEt(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,xe.EOF;return this._err(dt.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let i=0;i=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,xe.EOF;const i=this.html.charCodeAt(n);return i===xe.CARRIAGE_RETURN?xe.LINE_FEED:i}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,xe.EOF;let t=this.html.charCodeAt(this.pos);return t===xe.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,xe.LINE_FEED):t===xe.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,dMe(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===xe.LINE_FEED||t===xe.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){fMe(t)?this._err(dt.controlCharacterInInputStream):hMe(t)&&this._err(dt.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const bEt=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),yEt=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function vEt(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=yEt.get(e))!==null&&t!==void 0?t:e}var _o;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(_o||(_o={}));const xEt=32;var yg;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(yg||(yg={}));function YB(e){return e>=_o.ZERO&&e<=_o.NINE}function wEt(e){return e>=_o.UPPER_A&&e<=_o.UPPER_F||e>=_o.LOWER_A&&e<=_o.LOWER_F}function OEt(e){return e>=_o.UPPER_A&&e<=_o.UPPER_Z||e>=_o.LOWER_A&&e<=_o.LOWER_Z||YB(e)}function kEt(e){return e===_o.EQUALS||OEt(e)}var Oo;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Oo||(Oo={}));var yp;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(yp||(yp={}));class SEt{constructor(t,n,i){this.decodeTree=t,this.emitCodePoint=n,this.errors=i,this.state=Oo.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=yp.Strict}startEntity(t){this.decodeMode=t,this.state=Oo.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Oo.EntityStart:return t.charCodeAt(n)===_o.NUM?(this.state=Oo.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Oo.NamedEntity,this.stateNamedEntity(t,n));case Oo.NumericStart:return this.stateNumericStart(t,n);case Oo.NumericDecimal:return this.stateNumericDecimal(t,n);case Oo.NumericHex:return this.stateNumericHex(t,n);case Oo.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|xEt)===_o.LOWER_X?(this.state=Oo.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Oo.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,i,r){if(n!==i){const s=i-n;this.result=this.result*Math.pow(r,s)+Number.parseInt(t.substr(n,s),r),this.consumed+=s}}stateNumericHex(t,n){const i=n;for(;n>14;for(;n>14,s!==0){if(o===_o.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==yp.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:i}=this,r=(i[n]&yg.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,r,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,i){const{decodeTree:r}=this;return this.emitCodePoint(n===1?r[t]&~yg.VALUE_LENGTH:r[t+1],i),n===3&&this.emitCodePoint(r[t+2],i),i}end(){var t;switch(this.state){case Oo.NamedEntity:return this.result!==0&&(this.decodeMode!==yp.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Oo.NumericDecimal:return this.emitNumericEntity(0,2);case Oo.NumericHex:return this.emitNumericEntity(0,3);case Oo.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Oo.EntityStart:return 0}}}function EEt(e,t,n,i){const r=(t&yg.BRANCH_LENGTH)>>7,s=t&yg.JUMP_TABLE;if(r===0)return s!==0&&i===s?n:-1;if(s){const c=i-s;return c<0||c>=r?-1:e[n+c]-1}let o=n,l=o+r-1;for(;o<=l;){const c=o+l>>>1,u=e[c];if(ui)l=c-1;else return e[c+r]}return-1}var Rt;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(Rt||(Rt={}));var Yy;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(Yy||(Yy={}));var id;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(id||(id={}));var Je;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(Je||(Je={}));var B;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(B||(B={}));const CEt=new Map([[Je.A,B.A],[Je.ADDRESS,B.ADDRESS],[Je.ANNOTATION_XML,B.ANNOTATION_XML],[Je.APPLET,B.APPLET],[Je.AREA,B.AREA],[Je.ARTICLE,B.ARTICLE],[Je.ASIDE,B.ASIDE],[Je.B,B.B],[Je.BASE,B.BASE],[Je.BASEFONT,B.BASEFONT],[Je.BGSOUND,B.BGSOUND],[Je.BIG,B.BIG],[Je.BLOCKQUOTE,B.BLOCKQUOTE],[Je.BODY,B.BODY],[Je.BR,B.BR],[Je.BUTTON,B.BUTTON],[Je.CAPTION,B.CAPTION],[Je.CENTER,B.CENTER],[Je.CODE,B.CODE],[Je.COL,B.COL],[Je.COLGROUP,B.COLGROUP],[Je.DD,B.DD],[Je.DESC,B.DESC],[Je.DETAILS,B.DETAILS],[Je.DIALOG,B.DIALOG],[Je.DIR,B.DIR],[Je.DIV,B.DIV],[Je.DL,B.DL],[Je.DT,B.DT],[Je.EM,B.EM],[Je.EMBED,B.EMBED],[Je.FIELDSET,B.FIELDSET],[Je.FIGCAPTION,B.FIGCAPTION],[Je.FIGURE,B.FIGURE],[Je.FONT,B.FONT],[Je.FOOTER,B.FOOTER],[Je.FOREIGN_OBJECT,B.FOREIGN_OBJECT],[Je.FORM,B.FORM],[Je.FRAME,B.FRAME],[Je.FRAMESET,B.FRAMESET],[Je.H1,B.H1],[Je.H2,B.H2],[Je.H3,B.H3],[Je.H4,B.H4],[Je.H5,B.H5],[Je.H6,B.H6],[Je.HEAD,B.HEAD],[Je.HEADER,B.HEADER],[Je.HGROUP,B.HGROUP],[Je.HR,B.HR],[Je.HTML,B.HTML],[Je.I,B.I],[Je.IMG,B.IMG],[Je.IMAGE,B.IMAGE],[Je.INPUT,B.INPUT],[Je.IFRAME,B.IFRAME],[Je.KEYGEN,B.KEYGEN],[Je.LABEL,B.LABEL],[Je.LI,B.LI],[Je.LINK,B.LINK],[Je.LISTING,B.LISTING],[Je.MAIN,B.MAIN],[Je.MALIGNMARK,B.MALIGNMARK],[Je.MARQUEE,B.MARQUEE],[Je.MATH,B.MATH],[Je.MENU,B.MENU],[Je.META,B.META],[Je.MGLYPH,B.MGLYPH],[Je.MI,B.MI],[Je.MO,B.MO],[Je.MN,B.MN],[Je.MS,B.MS],[Je.MTEXT,B.MTEXT],[Je.NAV,B.NAV],[Je.NOBR,B.NOBR],[Je.NOFRAMES,B.NOFRAMES],[Je.NOEMBED,B.NOEMBED],[Je.NOSCRIPT,B.NOSCRIPT],[Je.OBJECT,B.OBJECT],[Je.OL,B.OL],[Je.OPTGROUP,B.OPTGROUP],[Je.OPTION,B.OPTION],[Je.P,B.P],[Je.PARAM,B.PARAM],[Je.PLAINTEXT,B.PLAINTEXT],[Je.PRE,B.PRE],[Je.RB,B.RB],[Je.RP,B.RP],[Je.RT,B.RT],[Je.RTC,B.RTC],[Je.RUBY,B.RUBY],[Je.S,B.S],[Je.SCRIPT,B.SCRIPT],[Je.SEARCH,B.SEARCH],[Je.SECTION,B.SECTION],[Je.SELECT,B.SELECT],[Je.SOURCE,B.SOURCE],[Je.SMALL,B.SMALL],[Je.SPAN,B.SPAN],[Je.STRIKE,B.STRIKE],[Je.STRONG,B.STRONG],[Je.STYLE,B.STYLE],[Je.SUB,B.SUB],[Je.SUMMARY,B.SUMMARY],[Je.SUP,B.SUP],[Je.TABLE,B.TABLE],[Je.TBODY,B.TBODY],[Je.TEMPLATE,B.TEMPLATE],[Je.TEXTAREA,B.TEXTAREA],[Je.TFOOT,B.TFOOT],[Je.TD,B.TD],[Je.TH,B.TH],[Je.THEAD,B.THEAD],[Je.TITLE,B.TITLE],[Je.TR,B.TR],[Je.TRACK,B.TRACK],[Je.TT,B.TT],[Je.U,B.U],[Je.UL,B.UL],[Je.SVG,B.SVG],[Je.VAR,B.VAR],[Je.WBR,B.WBR],[Je.XMP,B.XMP]]);function rO(e){var t;return(t=CEt.get(e))!==null&&t!==void 0?t:B.UNKNOWN}const Mt=B,AEt={[Rt.HTML]:new Set([Mt.ADDRESS,Mt.APPLET,Mt.AREA,Mt.ARTICLE,Mt.ASIDE,Mt.BASE,Mt.BASEFONT,Mt.BGSOUND,Mt.BLOCKQUOTE,Mt.BODY,Mt.BR,Mt.BUTTON,Mt.CAPTION,Mt.CENTER,Mt.COL,Mt.COLGROUP,Mt.DD,Mt.DETAILS,Mt.DIR,Mt.DIV,Mt.DL,Mt.DT,Mt.EMBED,Mt.FIELDSET,Mt.FIGCAPTION,Mt.FIGURE,Mt.FOOTER,Mt.FORM,Mt.FRAME,Mt.FRAMESET,Mt.H1,Mt.H2,Mt.H3,Mt.H4,Mt.H5,Mt.H6,Mt.HEAD,Mt.HEADER,Mt.HGROUP,Mt.HR,Mt.HTML,Mt.IFRAME,Mt.IMG,Mt.INPUT,Mt.LI,Mt.LINK,Mt.LISTING,Mt.MAIN,Mt.MARQUEE,Mt.MENU,Mt.META,Mt.NAV,Mt.NOEMBED,Mt.NOFRAMES,Mt.NOSCRIPT,Mt.OBJECT,Mt.OL,Mt.P,Mt.PARAM,Mt.PLAINTEXT,Mt.PRE,Mt.SCRIPT,Mt.SECTION,Mt.SELECT,Mt.SOURCE,Mt.STYLE,Mt.SUMMARY,Mt.TABLE,Mt.TBODY,Mt.TD,Mt.TEMPLATE,Mt.TEXTAREA,Mt.TFOOT,Mt.TH,Mt.THEAD,Mt.TITLE,Mt.TR,Mt.TRACK,Mt.UL,Mt.WBR,Mt.XMP]),[Rt.MATHML]:new Set([Mt.MI,Mt.MO,Mt.MN,Mt.MS,Mt.MTEXT,Mt.ANNOTATION_XML]),[Rt.SVG]:new Set([Mt.TITLE,Mt.FOREIGN_OBJECT,Mt.DESC]),[Rt.XLINK]:new Set,[Rt.XML]:new Set,[Rt.XMLNS]:new Set},ZB=new Set([Mt.H1,Mt.H2,Mt.H3,Mt.H4,Mt.H5,Mt.H6]);Je.STYLE,Je.SCRIPT,Je.XMP,Je.IFRAME,Je.NOEMBED,Je.NOFRAMES,Je.PLAINTEXT;var Ce;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(Ce||(Ce={}));const Ea={DATA:Ce.DATA,RCDATA:Ce.RCDATA,RAWTEXT:Ce.RAWTEXT,SCRIPT_DATA:Ce.SCRIPT_DATA,PLAINTEXT:Ce.PLAINTEXT,CDATA_SECTION:Ce.CDATA_SECTION};function TEt(e){return e>=xe.DIGIT_0&&e<=xe.DIGIT_9}function fS(e){return e>=xe.LATIN_CAPITAL_A&&e<=xe.LATIN_CAPITAL_Z}function _Et(e){return e>=xe.LATIN_SMALL_A&&e<=xe.LATIN_SMALL_Z}function zm(e){return _Et(e)||fS(e)}function une(e){return zm(e)||TEt(e)}function T_(e){return e+32}function mMe(e){return e===xe.SPACE||e===xe.LINE_FEED||e===xe.TABULATION||e===xe.FORM_FEED}function dne(e){return mMe(e)||e===xe.SOLIDUS||e===xe.GREATER_THAN_SIGN}function jEt(e){return e===xe.NULL?dt.nullCharacterReference:e>1114111?dt.characterReferenceOutsideUnicodeRange:dMe(e)?dt.surrogateCharacterReference:hMe(e)?dt.noncharacterCharacterReference:fMe(e)||e===xe.CARRIAGE_RETURN?dt.controlCharacterReference:null}class NEt{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=Ce.DATA,this.returnState=Ce.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new gEt(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new SEt(bEt,(i,r)=>{this.preprocessor.pos=this.entityStartPos+r-1,this._flushCodePointConsumedAsCharacterReference(i)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(dt.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:i=>{this._err(dt.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+i)},validateNumericCharacterReference:i=>{const r=jEt(i);r&&this._err(r,1)}}:void 0)}_err(t,n=0){var i,r;(r=(i=this.handler).onParseError)===null||r===void 0||r.call(i,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==null||t())}write(t,n,i){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||i==null||i()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n0&&this._err(dt.endTagWithAttributes),t.selfClosing&&this._err(dt.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case $i.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case $i.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case $i.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:$i.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=mMe(t)?$i.WHITESPACE_CHARACTER:t===xe.NULL?$i.NULL_CHARACTER:$i.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken($i.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=Ce.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?yp.Attribute:yp.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===Ce.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===Ce.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===Ce.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case Ce.DATA:{this._stateData(t);break}case Ce.RCDATA:{this._stateRcdata(t);break}case Ce.RAWTEXT:{this._stateRawtext(t);break}case Ce.SCRIPT_DATA:{this._stateScriptData(t);break}case Ce.PLAINTEXT:{this._statePlaintext(t);break}case Ce.TAG_OPEN:{this._stateTagOpen(t);break}case Ce.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case Ce.TAG_NAME:{this._stateTagName(t);break}case Ce.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case Ce.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case Ce.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case Ce.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case Ce.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case Ce.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case Ce.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case Ce.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case Ce.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case Ce.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case Ce.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case Ce.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case Ce.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case Ce.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case Ce.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case Ce.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case Ce.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case Ce.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case Ce.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case Ce.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case Ce.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case Ce.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case Ce.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case Ce.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case Ce.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case Ce.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case Ce.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case Ce.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case Ce.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case Ce.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case Ce.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case Ce.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case Ce.BOGUS_COMMENT:{this._stateBogusComment(t);break}case Ce.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case Ce.COMMENT_START:{this._stateCommentStart(t);break}case Ce.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case Ce.COMMENT:{this._stateComment(t);break}case Ce.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case Ce.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case Ce.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case Ce.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case Ce.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case Ce.COMMENT_END:{this._stateCommentEnd(t);break}case Ce.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case Ce.DOCTYPE:{this._stateDoctype(t);break}case Ce.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case Ce.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case Ce.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case Ce.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case Ce.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case Ce.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case Ce.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case Ce.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case Ce.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case Ce.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case Ce.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case Ce.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case Ce.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case Ce.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case Ce.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case Ce.CDATA_SECTION:{this._stateCdataSection(t);break}case Ce.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case Ce.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case Ce.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case Ce.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case xe.LESS_THAN_SIGN:{this.state=Ce.TAG_OPEN;break}case xe.AMPERSAND:{this._startCharacterReference();break}case xe.NULL:{this._err(dt.unexpectedNullCharacter),this._emitCodePoint(t);break}case xe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case xe.AMPERSAND:{this._startCharacterReference();break}case xe.LESS_THAN_SIGN:{this.state=Ce.RCDATA_LESS_THAN_SIGN;break}case xe.NULL:{this._err(dt.unexpectedNullCharacter),this._emitChars(Fs);break}case xe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case xe.LESS_THAN_SIGN:{this.state=Ce.RAWTEXT_LESS_THAN_SIGN;break}case xe.NULL:{this._err(dt.unexpectedNullCharacter),this._emitChars(Fs);break}case xe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case xe.LESS_THAN_SIGN:{this.state=Ce.SCRIPT_DATA_LESS_THAN_SIGN;break}case xe.NULL:{this._err(dt.unexpectedNullCharacter),this._emitChars(Fs);break}case xe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case xe.NULL:{this._err(dt.unexpectedNullCharacter),this._emitChars(Fs);break}case xe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(zm(t))this._createStartTagToken(),this.state=Ce.TAG_NAME,this._stateTagName(t);else switch(t){case xe.EXCLAMATION_MARK:{this.state=Ce.MARKUP_DECLARATION_OPEN;break}case xe.SOLIDUS:{this.state=Ce.END_TAG_OPEN;break}case xe.QUESTION_MARK:{this._err(dt.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=Ce.BOGUS_COMMENT,this._stateBogusComment(t);break}case xe.EOF:{this._err(dt.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(dt.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=Ce.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(zm(t))this._createEndTagToken(),this.state=Ce.TAG_NAME,this._stateTagName(t);else switch(t){case xe.GREATER_THAN_SIGN:{this._err(dt.missingEndTagName),this.state=Ce.DATA;break}case xe.EOF:{this._err(dt.eofBeforeTagName),this._emitChars("");break}case xe.NULL:{this._err(dt.unexpectedNullCharacter),this.state=Ce.SCRIPT_DATA_ESCAPED,this._emitChars(Fs);break}case xe.EOF:{this._err(dt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Ce.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===xe.SOLIDUS?this.state=Ce.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:zm(t)?(this._emitChars("<"),this.state=Ce.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=Ce.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){zm(t)?(this.state=Ce.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("");break}case xe.NULL:{this._err(dt.unexpectedNullCharacter),this.state=Ce.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Fs);break}case xe.EOF:{this._err(dt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Ce.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===xe.SOLIDUS?(this.state=Ce.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=Ce.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(wc.SCRIPT,!1)&&dne(this.preprocessor.peek(wc.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const i=this._indexOf(t);this.items[i]=n,i===this.stackTop&&(this.current=n)}insertAfter(t,n,i){const r=this._indexOf(t)+1;this.items.splice(r,0,n),this.tagIDs.splice(r,0,i),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==Rt.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop=0;i--)if(t.has(this.tagIDs[i])&&this.treeAdapter.getNamespaceURI(this.items[i])===n)return i;return-1}clearBackTo(t,n){const i=this._indexOfTagNames(t,n);this.shortenToLength(i+1)}clearBackToTableContext(){this.clearBackTo(MEt,Rt.HTML)}clearBackToTableBodyContext(){this.clearBackTo(DEt,Rt.HTML)}clearBackToTableRowContext(){this.clearBackTo(PEt,Rt.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===B.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===B.HTML}hasInDynamicScope(t,n){for(let i=this.stackTop;i>=0;i--){const r=this.tagIDs[i];switch(this.treeAdapter.getNamespaceURI(this.items[i])){case Rt.HTML:{if(r===t)return!0;if(n.has(r))return!1;break}case Rt.SVG:{if(pne.has(r))return!1;break}case Rt.MATHML:{if(hne.has(r))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,TI)}hasInListItemScope(t){return this.hasInDynamicScope(t,REt)}hasInButtonScope(t){return this.hasInDynamicScope(t,IEt)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case Rt.HTML:{if(ZB.has(n))return!0;if(TI.has(n))return!1;break}case Rt.SVG:{if(pne.has(n))return!1;break}case Rt.MATHML:{if(hne.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Rt.HTML)switch(this.tagIDs[n]){case t:return!0;case B.TABLE:case B.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===Rt.HTML)switch(this.tagIDs[t]){case B.TBODY:case B.THEAD:case B.TFOOT:return!0;case B.TABLE:case B.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Rt.HTML)switch(this.tagIDs[n]){case t:return!0;case B.OPTION:case B.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&gMe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&fne.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&fne.has(this.currentTagId);)this.pop()}}const _4=3;var Gf;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Gf||(Gf={}));const mne={type:Gf.Marker};class FEt{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const i=[],r=n.length,s=this.treeAdapter.getTagName(t),o=this.treeAdapter.getNamespaceURI(t);for(let l=0;l[o.name,o.value]));let s=0;for(let o=0;or.get(c.name)===c.value)&&(s+=1,s>=_4&&this.entries.splice(l.idx,1))}}insertMarker(){this.entries.unshift(mne)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Gf.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const i=this.entries.indexOf(this.bookmark);this.entries.splice(i,0,{type:Gf.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(mne);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(i=>i.type===Gf.Marker||this.treeAdapter.getTagName(i.element)===t);return n&&n.type===Gf.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Gf.Element&&n.element===t)}}const Vm={createDocument(){return{nodeName:"#document",mode:id.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const i=e.childNodes.indexOf(n);e.childNodes.splice(i,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,i){const r=e.childNodes.find(s=>s.nodeName==="#documentType");if(r)r.name=t,r.publicId=n,r.systemId=i;else{const s={nodeName:"#documentType",name:t,publicId:n,systemId:i,parentNode:null};Vm.appendChild(e,s)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(Vm.isTextNode(n)){n.value+=t;return}}Vm.appendChild(e,Vm.createTextNode(t))},insertTextBefore(e,t,n){const i=e.childNodes[e.childNodes.indexOf(n)-1];i&&Vm.isTextNode(i)?i.value+=t:Vm.insertBefore(e,Vm.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(i=>i.name));for(let i=0;ie.startsWith(n))}function HEt(e){return e.name===bMe&&e.publicId===null&&(e.systemId===null||e.systemId===BEt)}function qEt(e){if(e.name!==bMe)return id.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===UEt)return id.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),zEt.has(n))return id.QUIRKS;let i=t===null?QEt:yMe;if(gne(n,i))return id.QUIRKS;if(i=t===null?vMe:VEt,gne(n,i))return id.LIMITED_QUIRKS}return id.NO_QUIRKS}const bne={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},WEt="definitionurl",KEt="definitionURL",GEt=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),XEt=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Rt.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Rt.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Rt.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Rt.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Rt.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Rt.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Rt.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Rt.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Rt.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Rt.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Rt.XMLNS}]]),YEt=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),ZEt=new Set([B.B,B.BIG,B.BLOCKQUOTE,B.BODY,B.BR,B.CENTER,B.CODE,B.DD,B.DIV,B.DL,B.DT,B.EM,B.EMBED,B.H1,B.H2,B.H3,B.H4,B.H5,B.H6,B.HEAD,B.HR,B.I,B.IMG,B.LI,B.LISTING,B.MENU,B.META,B.NOBR,B.OL,B.P,B.PRE,B.RUBY,B.S,B.SMALL,B.SPAN,B.STRONG,B.STRIKE,B.SUB,B.SUP,B.TABLE,B.TT,B.U,B.UL,B.VAR]);function JEt(e){const t=e.tagID;return t===B.FONT&&e.attrs.some(({name:i})=>i===Yy.COLOR||i===Yy.SIZE||i===Yy.FACE)||ZEt.has(t)}function xMe(e){for(let t=0;t0&&this._setContextModes(t,n)}onItemPop(t,n){var i,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(r=(i=this.treeAdapter).onItemPop)===null||r===void 0||r.call(i,t,this.openElements.current),n){let s,o;this.openElements.stackTop===0&&this.fragmentContext?(s=this.fragmentContext,o=this.fragmentContextID):{current:s,currentTagId:o}=this.openElements,this._setContextModes(s,o)}}_setContextModes(t,n){const i=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===Rt.HTML;this.currentNotInHTML=!i,this.tokenizer.inForeignNode=!i&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,Rt.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=Ie.TEXT}switchToPlaintextParsing(){this.insertionMode=Ie.TEXT,this.originalInsertionMode=Ie.IN_BODY,this.tokenizer.state=Ea.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===Je.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Rt.HTML))switch(this.fragmentContextID){case B.TITLE:case B.TEXTAREA:{this.tokenizer.state=Ea.RCDATA;break}case B.STYLE:case B.XMP:case B.IFRAME:case B.NOEMBED:case B.NOFRAMES:case B.NOSCRIPT:{this.tokenizer.state=Ea.RAWTEXT;break}case B.SCRIPT:{this.tokenizer.state=Ea.SCRIPT_DATA;break}case B.PLAINTEXT:{this.tokenizer.state=Ea.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",i=t.publicId||"",r=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,i,r),t.location){const o=this.treeAdapter.getChildNodes(this.document).find(l=>this.treeAdapter.isDocumentTypeNode(l));o&&this.treeAdapter.setNodeSourceCodeLocation(o,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const i=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,i)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const i=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(i??this.document,t)}}_appendElement(t,n){const i=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(i,t.location)}_insertElement(t,n){const i=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(i,t.location),this.openElements.push(i,t.tagID)}_insertFakeElement(t,n){const i=this.treeAdapter.createElement(t,Rt.HTML,[]);this._attachElementToTree(i,null),this.openElements.push(i,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,Rt.HTML,t.attrs),i=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,i),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(Je.HTML,Rt.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,B.HTML)}_appendCommentNode(t,n){const i=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,i),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,t.location)}_insertCharacters(t){let n,i;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:i}=this._findFosterParentingLocation(),i?this.treeAdapter.insertTextBefore(n,t.chars,i):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const r=this.treeAdapter.getChildNodes(n),s=i?r.lastIndexOf(i):r.length,o=r[s-1];if(this.treeAdapter.getNodeSourceCodeLocation(o)){const{endLine:c,endCol:u,endOffset:d}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(o,{endLine:c,endCol:u,endOffset:d})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(o,t.location)}_adoptNodes(t,n){for(let i=this.treeAdapter.getFirstChild(t);i;i=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(i),this.treeAdapter.appendChild(n,i)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const i=n.location,r=this.treeAdapter.getTagName(t),s=n.type===$i.END_TAG&&r===n.tagName?{endTag:{...i},endLine:i.endLine,endCol:i.endCol,endOffset:i.endOffset}:{endLine:i.startLine,endCol:i.startCol,endOffset:i.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,s)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,i;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,i=this.fragmentContextID):{current:n,currentTagId:i}=this.openElements,t.tagID===B.SVG&&this.treeAdapter.getTagName(n)===Je.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===Rt.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===B.MGLYPH||t.tagID===B.MALIGNMARK)&&i!==void 0&&!this._isIntegrationPoint(i,n,Rt.HTML)}_processToken(t){switch(t.type){case $i.CHARACTER:{this.onCharacter(t);break}case $i.NULL_CHARACTER:{this.onNullCharacter(t);break}case $i.COMMENT:{this.onComment(t);break}case $i.DOCTYPE:{this.onDoctype(t);break}case $i.START_TAG:{this._processStartTag(t);break}case $i.END_TAG:{this.onEndTag(t);break}case $i.EOF:{this.onEof(t);break}case $i.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,i){const r=this.treeAdapter.getNamespaceURI(n),s=this.treeAdapter.getAttrList(n);return iCt(t,r,s,i)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(r=>r.type===Gf.Marker||this.openElements.contains(r.element)),i=n===-1?t-1:n-1;for(let r=i;r>=0;r--){const s=this.activeFormattingElements.entries[r];this._insertElement(s.token,this.treeAdapter.getNamespaceURI(s.element)),s.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=Ie.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(B.P),this.openElements.popUntilTagNamePopped(B.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case B.TR:{this.insertionMode=Ie.IN_ROW;return}case B.TBODY:case B.THEAD:case B.TFOOT:{this.insertionMode=Ie.IN_TABLE_BODY;return}case B.CAPTION:{this.insertionMode=Ie.IN_CAPTION;return}case B.COLGROUP:{this.insertionMode=Ie.IN_COLUMN_GROUP;return}case B.TABLE:{this.insertionMode=Ie.IN_TABLE;return}case B.BODY:{this.insertionMode=Ie.IN_BODY;return}case B.FRAMESET:{this.insertionMode=Ie.IN_FRAMESET;return}case B.SELECT:{this._resetInsertionModeForSelect(t);return}case B.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case B.HTML:{this.insertionMode=this.headElement?Ie.AFTER_HEAD:Ie.BEFORE_HEAD;return}case B.TD:case B.TH:{if(t>0){this.insertionMode=Ie.IN_CELL;return}break}case B.HEAD:{if(t>0){this.insertionMode=Ie.IN_HEAD;return}break}}this.insertionMode=Ie.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const i=this.openElements.tagIDs[n];if(i===B.TEMPLATE)break;if(i===B.TABLE){this.insertionMode=Ie.IN_SELECT_IN_TABLE;return}}this.insertionMode=Ie.IN_SELECT}_isElementCausesFosterParenting(t){return OMe.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case B.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===Rt.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case B.TABLE:{const i=this.treeAdapter.getParentNode(n);return i?{parent:i,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const i=this.treeAdapter.getNamespaceURI(t);return AEt[i].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){LAt(this,t);return}switch(this.insertionMode){case Ie.INITIAL:{yk(this,t);break}case Ie.BEFORE_HTML:{cE(this,t);break}case Ie.BEFORE_HEAD:{uE(this,t);break}case Ie.IN_HEAD:{dE(this,t);break}case Ie.IN_HEAD_NO_SCRIPT:{fE(this,t);break}case Ie.AFTER_HEAD:{hE(this,t);break}case Ie.IN_BODY:case Ie.IN_CAPTION:case Ie.IN_CELL:case Ie.IN_TEMPLATE:{SMe(this,t);break}case Ie.TEXT:case Ie.IN_SELECT:case Ie.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case Ie.IN_TABLE:case Ie.IN_TABLE_BODY:case Ie.IN_ROW:{j4(this,t);break}case Ie.IN_TABLE_TEXT:{jMe(this,t);break}case Ie.IN_COLUMN_GROUP:{_I(this,t);break}case Ie.AFTER_BODY:{jI(this,t);break}case Ie.AFTER_AFTER_BODY:{NN(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){MAt(this,t);return}switch(this.insertionMode){case Ie.INITIAL:{yk(this,t);break}case Ie.BEFORE_HTML:{cE(this,t);break}case Ie.BEFORE_HEAD:{uE(this,t);break}case Ie.IN_HEAD:{dE(this,t);break}case Ie.IN_HEAD_NO_SCRIPT:{fE(this,t);break}case Ie.AFTER_HEAD:{hE(this,t);break}case Ie.TEXT:{this._insertCharacters(t);break}case Ie.IN_TABLE:case Ie.IN_TABLE_BODY:case Ie.IN_ROW:{j4(this,t);break}case Ie.IN_COLUMN_GROUP:{_I(this,t);break}case Ie.AFTER_BODY:{jI(this,t);break}case Ie.AFTER_AFTER_BODY:{NN(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){JB(this,t);return}switch(this.insertionMode){case Ie.INITIAL:case Ie.BEFORE_HTML:case Ie.BEFORE_HEAD:case Ie.IN_HEAD:case Ie.IN_HEAD_NO_SCRIPT:case Ie.AFTER_HEAD:case Ie.IN_BODY:case Ie.IN_TABLE:case Ie.IN_CAPTION:case Ie.IN_COLUMN_GROUP:case Ie.IN_TABLE_BODY:case Ie.IN_ROW:case Ie.IN_CELL:case Ie.IN_SELECT:case Ie.IN_SELECT_IN_TABLE:case Ie.IN_TEMPLATE:case Ie.IN_FRAMESET:case Ie.AFTER_FRAMESET:{JB(this,t);break}case Ie.IN_TABLE_TEXT:{vk(this,t);break}case Ie.AFTER_BODY:{pCt(this,t);break}case Ie.AFTER_AFTER_BODY:case Ie.AFTER_AFTER_FRAMESET:{mCt(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case Ie.INITIAL:{gCt(this,t);break}case Ie.BEFORE_HEAD:case Ie.IN_HEAD:case Ie.IN_HEAD_NO_SCRIPT:case Ie.AFTER_HEAD:{this._err(t,dt.misplacedDoctype);break}case Ie.IN_TABLE_TEXT:{vk(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,dt.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?$At(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case Ie.INITIAL:{yk(this,t);break}case Ie.BEFORE_HTML:{bCt(this,t);break}case Ie.BEFORE_HEAD:{vCt(this,t);break}case Ie.IN_HEAD:{Tf(this,t);break}case Ie.IN_HEAD_NO_SCRIPT:{OCt(this,t);break}case Ie.AFTER_HEAD:{SCt(this,t);break}case Ie.IN_BODY:{Rl(this,t);break}case Ie.IN_TABLE:{s1(this,t);break}case Ie.IN_TABLE_TEXT:{vk(this,t);break}case Ie.IN_CAPTION:{xAt(this,t);break}case Ie.IN_COLUMN_GROUP:{rq(this,t);break}case Ie.IN_TABLE_BODY:{_M(this,t);break}case Ie.IN_ROW:{jM(this,t);break}case Ie.IN_CELL:{kAt(this,t);break}case Ie.IN_SELECT:{IMe(this,t);break}case Ie.IN_SELECT_IN_TABLE:{EAt(this,t);break}case Ie.IN_TEMPLATE:{AAt(this,t);break}case Ie.AFTER_BODY:{_At(this,t);break}case Ie.IN_FRAMESET:{jAt(this,t);break}case Ie.AFTER_FRAMESET:{RAt(this,t);break}case Ie.AFTER_AFTER_BODY:{PAt(this,t);break}case Ie.AFTER_AFTER_FRAMESET:{DAt(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?FAt(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case Ie.INITIAL:{yk(this,t);break}case Ie.BEFORE_HTML:{yCt(this,t);break}case Ie.BEFORE_HEAD:{xCt(this,t);break}case Ie.IN_HEAD:{wCt(this,t);break}case Ie.IN_HEAD_NO_SCRIPT:{kCt(this,t);break}case Ie.AFTER_HEAD:{ECt(this,t);break}case Ie.IN_BODY:{TM(this,t);break}case Ie.TEXT:{uAt(this,t);break}case Ie.IN_TABLE:{CC(this,t);break}case Ie.IN_TABLE_TEXT:{vk(this,t);break}case Ie.IN_CAPTION:{wAt(this,t);break}case Ie.IN_COLUMN_GROUP:{OAt(this,t);break}case Ie.IN_TABLE_BODY:{e9(this,t);break}case Ie.IN_ROW:{RMe(this,t);break}case Ie.IN_CELL:{SAt(this,t);break}case Ie.IN_SELECT:{PMe(this,t);break}case Ie.IN_SELECT_IN_TABLE:{CAt(this,t);break}case Ie.IN_TEMPLATE:{TAt(this,t);break}case Ie.AFTER_BODY:{MMe(this,t);break}case Ie.IN_FRAMESET:{NAt(this,t);break}case Ie.AFTER_FRAMESET:{IAt(this,t);break}case Ie.AFTER_AFTER_BODY:{NN(this,t);break}}}onEof(t){switch(this.insertionMode){case Ie.INITIAL:{yk(this,t);break}case Ie.BEFORE_HTML:{cE(this,t);break}case Ie.BEFORE_HEAD:{uE(this,t);break}case Ie.IN_HEAD:{dE(this,t);break}case Ie.IN_HEAD_NO_SCRIPT:{fE(this,t);break}case Ie.AFTER_HEAD:{hE(this,t);break}case Ie.IN_BODY:case Ie.IN_TABLE:case Ie.IN_CAPTION:case Ie.IN_COLUMN_GROUP:case Ie.IN_TABLE_BODY:case Ie.IN_ROW:case Ie.IN_CELL:case Ie.IN_SELECT:case Ie.IN_SELECT_IN_TABLE:{TMe(this,t);break}case Ie.TEXT:{dAt(this,t);break}case Ie.IN_TABLE_TEXT:{vk(this,t);break}case Ie.IN_TEMPLATE:{DMe(this,t);break}case Ie.AFTER_BODY:case Ie.IN_FRAMESET:case Ie.AFTER_FRAMESET:case Ie.AFTER_AFTER_BODY:case Ie.AFTER_AFTER_FRAMESET:{iq(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===xe.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case Ie.IN_HEAD:case Ie.IN_HEAD_NO_SCRIPT:case Ie.AFTER_HEAD:case Ie.TEXT:case Ie.IN_COLUMN_GROUP:case Ie.IN_SELECT:case Ie.IN_SELECT_IN_TABLE:case Ie.IN_FRAMESET:case Ie.AFTER_FRAMESET:{this._insertCharacters(t);break}case Ie.IN_BODY:case Ie.IN_CAPTION:case Ie.IN_CELL:case Ie.IN_TEMPLATE:case Ie.AFTER_BODY:case Ie.AFTER_AFTER_BODY:case Ie.AFTER_AFTER_FRAMESET:{kMe(this,t);break}case Ie.IN_TABLE:case Ie.IN_TABLE_BODY:case Ie.IN_ROW:{j4(this,t);break}case Ie.IN_TABLE_TEXT:{_Me(this,t);break}}}};function lCt(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):AMe(e,t),n}function cCt(e,t){let n=null,i=e.openElements.stackTop;for(;i>=0;i--){const r=e.openElements.items[i];if(r===t.element)break;e._isSpecialElement(r,e.openElements.tagIDs[i])&&(n=r)}return n||(e.openElements.shortenToLength(Math.max(i,0)),e.activeFormattingElements.removeEntry(t)),n}function uCt(e,t,n){let i=t,r=e.openElements.getCommonAncestor(t);for(let s=0,o=r;o!==n;s++,o=r){r=e.openElements.getCommonAncestor(o);const l=e.activeFormattingElements.getElementEntry(o),c=l&&s>=aCt;!l||c?(c&&e.activeFormattingElements.removeEntry(l),e.openElements.remove(o)):(o=dCt(e,l),i===t&&(e.activeFormattingElements.bookmark=l),e.treeAdapter.detachNode(i),e.treeAdapter.appendChild(o,i),i=o)}return i}function dCt(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),i=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,i),t.element=i,i}function fCt(e,t,n){const i=e.treeAdapter.getTagName(t),r=rO(i);if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{const s=e.treeAdapter.getNamespaceURI(t);r===B.TEMPLATE&&s===Rt.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function hCt(e,t,n){const i=e.treeAdapter.getNamespaceURI(n.element),{token:r}=n,s=e.treeAdapter.createElement(r.tagName,i,r.attrs);e._adoptNodes(t,s),e.treeAdapter.appendChild(t,s),e.activeFormattingElements.insertElementAfterBookmark(s,r),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,s,r.tagID)}function nq(e,t){for(let n=0;n=n;i--)e._setEndLocation(e.openElements.items[i],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const i=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(i);if(r&&!r.endTag&&(e._setEndLocation(i,t),e.openElements.stackTop>=1)){const s=e.openElements.items[1],o=e.treeAdapter.getNodeSourceCodeLocation(s);o&&!o.endTag&&e._setEndLocation(s,t)}}}}function gCt(e,t){e._setDocumentType(t);const n=t.forceQuirks?id.QUIRKS:qEt(t);HEt(t)||e._err(t,dt.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=Ie.BEFORE_HTML}function yk(e,t){e._err(t,dt.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,id.QUIRKS),e.insertionMode=Ie.BEFORE_HTML,e._processToken(t)}function bCt(e,t){t.tagID===B.HTML?(e._insertElement(t,Rt.HTML),e.insertionMode=Ie.BEFORE_HEAD):cE(e,t)}function yCt(e,t){const n=t.tagID;(n===B.HTML||n===B.HEAD||n===B.BODY||n===B.BR)&&cE(e,t)}function cE(e,t){e._insertFakeRootElement(),e.insertionMode=Ie.BEFORE_HEAD,e._processToken(t)}function vCt(e,t){switch(t.tagID){case B.HTML:{Rl(e,t);break}case B.HEAD:{e._insertElement(t,Rt.HTML),e.headElement=e.openElements.current,e.insertionMode=Ie.IN_HEAD;break}default:uE(e,t)}}function xCt(e,t){const n=t.tagID;n===B.HEAD||n===B.BODY||n===B.HTML||n===B.BR?uE(e,t):e._err(t,dt.endTagWithoutMatchingOpenElement)}function uE(e,t){e._insertFakeElement(Je.HEAD,B.HEAD),e.headElement=e.openElements.current,e.insertionMode=Ie.IN_HEAD,e._processToken(t)}function Tf(e,t){switch(t.tagID){case B.HTML:{Rl(e,t);break}case B.BASE:case B.BASEFONT:case B.BGSOUND:case B.LINK:case B.META:{e._appendElement(t,Rt.HTML),t.ackSelfClosing=!0;break}case B.TITLE:{e._switchToTextParsing(t,Ea.RCDATA);break}case B.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Ea.RAWTEXT):(e._insertElement(t,Rt.HTML),e.insertionMode=Ie.IN_HEAD_NO_SCRIPT);break}case B.NOFRAMES:case B.STYLE:{e._switchToTextParsing(t,Ea.RAWTEXT);break}case B.SCRIPT:{e._switchToTextParsing(t,Ea.SCRIPT_DATA);break}case B.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=Ie.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(Ie.IN_TEMPLATE);break}case B.HEAD:{e._err(t,dt.misplacedStartTagForHeadElement);break}default:dE(e,t)}}function wCt(e,t){switch(t.tagID){case B.HEAD:{e.openElements.pop(),e.insertionMode=Ie.AFTER_HEAD;break}case B.BODY:case B.BR:case B.HTML:{dE(e,t);break}case B.TEMPLATE:{J0(e,t);break}default:e._err(t,dt.endTagWithoutMatchingOpenElement)}}function J0(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==B.TEMPLATE&&e._err(t,dt.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(B.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,dt.endTagWithoutMatchingOpenElement)}function dE(e,t){e.openElements.pop(),e.insertionMode=Ie.AFTER_HEAD,e._processToken(t)}function OCt(e,t){switch(t.tagID){case B.HTML:{Rl(e,t);break}case B.BASEFONT:case B.BGSOUND:case B.HEAD:case B.LINK:case B.META:case B.NOFRAMES:case B.STYLE:{Tf(e,t);break}case B.NOSCRIPT:{e._err(t,dt.nestedNoscriptInHead);break}default:fE(e,t)}}function kCt(e,t){switch(t.tagID){case B.NOSCRIPT:{e.openElements.pop(),e.insertionMode=Ie.IN_HEAD;break}case B.BR:{fE(e,t);break}default:e._err(t,dt.endTagWithoutMatchingOpenElement)}}function fE(e,t){const n=t.type===$i.EOF?dt.openElementsLeftAfterEof:dt.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=Ie.IN_HEAD,e._processToken(t)}function SCt(e,t){switch(t.tagID){case B.HTML:{Rl(e,t);break}case B.BODY:{e._insertElement(t,Rt.HTML),e.framesetOk=!1,e.insertionMode=Ie.IN_BODY;break}case B.FRAMESET:{e._insertElement(t,Rt.HTML),e.insertionMode=Ie.IN_FRAMESET;break}case B.BASE:case B.BASEFONT:case B.BGSOUND:case B.LINK:case B.META:case B.NOFRAMES:case B.SCRIPT:case B.STYLE:case B.TEMPLATE:case B.TITLE:{e._err(t,dt.abandonedHeadElementChild),e.openElements.push(e.headElement,B.HEAD),Tf(e,t),e.openElements.remove(e.headElement);break}case B.HEAD:{e._err(t,dt.misplacedStartTagForHeadElement);break}default:hE(e,t)}}function ECt(e,t){switch(t.tagID){case B.BODY:case B.HTML:case B.BR:{hE(e,t);break}case B.TEMPLATE:{J0(e,t);break}default:e._err(t,dt.endTagWithoutMatchingOpenElement)}}function hE(e,t){e._insertFakeElement(Je.BODY,B.BODY),e.insertionMode=Ie.IN_BODY,AM(e,t)}function AM(e,t){switch(t.type){case $i.CHARACTER:{SMe(e,t);break}case $i.WHITESPACE_CHARACTER:{kMe(e,t);break}case $i.COMMENT:{JB(e,t);break}case $i.START_TAG:{Rl(e,t);break}case $i.END_TAG:{TM(e,t);break}case $i.EOF:{TMe(e,t);break}}}function kMe(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function SMe(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function CCt(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function ACt(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function TCt(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,Rt.HTML),e.insertionMode=Ie.IN_FRAMESET)}function _Ct(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,Rt.HTML)}function jCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&ZB.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,Rt.HTML)}function NCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,Rt.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function RCt(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,Rt.HTML),n||(e.formElement=e.openElements.current))}function ICt(e,t){e.framesetOk=!1;const n=t.tagID;for(let i=e.openElements.stackTop;i>=0;i--){const r=e.openElements.tagIDs[i];if(n===B.LI&&r===B.LI||(n===B.DD||n===B.DT)&&(r===B.DD||r===B.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==B.ADDRESS&&r!==B.DIV&&r!==B.P&&e._isSpecialElement(e.openElements.items[i],r))break}e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,Rt.HTML)}function PCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,Rt.HTML),e.tokenizer.state=Ea.PLAINTEXT}function DCt(e,t){e.openElements.hasInScope(B.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(B.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,Rt.HTML),e.framesetOk=!1}function MCt(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(Je.A);n&&(nq(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,Rt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function LCt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Rt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function $Ct(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(B.NOBR)&&(nq(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,Rt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function FCt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Rt.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function BCt(e,t){e.treeAdapter.getDocumentMode(e.document)!==id.QUIRKS&&e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,Rt.HTML),e.framesetOk=!1,e.insertionMode=Ie.IN_TABLE}function EMe(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Rt.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function CMe(e){const t=pMe(e,Yy.TYPE);return t!=null&&t.toLowerCase()===rCt}function UCt(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Rt.HTML),CMe(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function QCt(e,t){e._appendElement(t,Rt.HTML),t.ackSelfClosing=!0}function zCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._appendElement(t,Rt.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function VCt(e,t){t.tagName=Je.IMG,t.tagID=B.IMG,EMe(e,t)}function HCt(e,t){e._insertElement(t,Rt.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Ea.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=Ie.TEXT}function qCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Ea.RAWTEXT)}function WCt(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Ea.RAWTEXT)}function xne(e,t){e._switchToTextParsing(t,Ea.RAWTEXT)}function KCt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Rt.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===Ie.IN_TABLE||e.insertionMode===Ie.IN_CAPTION||e.insertionMode===Ie.IN_TABLE_BODY||e.insertionMode===Ie.IN_ROW||e.insertionMode===Ie.IN_CELL?Ie.IN_SELECT_IN_TABLE:Ie.IN_SELECT}function GCt(e,t){e.openElements.currentTagId===B.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,Rt.HTML)}function XCt(e,t){e.openElements.hasInScope(B.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,Rt.HTML)}function YCt(e,t){e.openElements.hasInScope(B.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(B.RTC),e._insertElement(t,Rt.HTML)}function ZCt(e,t){e._reconstructActiveFormattingElements(),xMe(t),tq(t),t.selfClosing?e._appendElement(t,Rt.MATHML):e._insertElement(t,Rt.MATHML),t.ackSelfClosing=!0}function JCt(e,t){e._reconstructActiveFormattingElements(),wMe(t),tq(t),t.selfClosing?e._appendElement(t,Rt.SVG):e._insertElement(t,Rt.SVG),t.ackSelfClosing=!0}function wne(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Rt.HTML)}function Rl(e,t){switch(t.tagID){case B.I:case B.S:case B.B:case B.U:case B.EM:case B.TT:case B.BIG:case B.CODE:case B.FONT:case B.SMALL:case B.STRIKE:case B.STRONG:{LCt(e,t);break}case B.A:{MCt(e,t);break}case B.H1:case B.H2:case B.H3:case B.H4:case B.H5:case B.H6:{jCt(e,t);break}case B.P:case B.DL:case B.OL:case B.UL:case B.DIV:case B.DIR:case B.NAV:case B.MAIN:case B.MENU:case B.ASIDE:case B.CENTER:case B.FIGURE:case B.FOOTER:case B.HEADER:case B.HGROUP:case B.DIALOG:case B.DETAILS:case B.ADDRESS:case B.ARTICLE:case B.SEARCH:case B.SECTION:case B.SUMMARY:case B.FIELDSET:case B.BLOCKQUOTE:case B.FIGCAPTION:{_Ct(e,t);break}case B.LI:case B.DD:case B.DT:{ICt(e,t);break}case B.BR:case B.IMG:case B.WBR:case B.AREA:case B.EMBED:case B.KEYGEN:{EMe(e,t);break}case B.HR:{zCt(e,t);break}case B.RB:case B.RTC:{XCt(e,t);break}case B.RT:case B.RP:{YCt(e,t);break}case B.PRE:case B.LISTING:{NCt(e,t);break}case B.XMP:{qCt(e,t);break}case B.SVG:{JCt(e,t);break}case B.HTML:{CCt(e,t);break}case B.BASE:case B.LINK:case B.META:case B.STYLE:case B.TITLE:case B.SCRIPT:case B.BGSOUND:case B.BASEFONT:case B.TEMPLATE:{Tf(e,t);break}case B.BODY:{ACt(e,t);break}case B.FORM:{RCt(e,t);break}case B.NOBR:{$Ct(e,t);break}case B.MATH:{ZCt(e,t);break}case B.TABLE:{BCt(e,t);break}case B.INPUT:{UCt(e,t);break}case B.PARAM:case B.TRACK:case B.SOURCE:{QCt(e,t);break}case B.IMAGE:{VCt(e,t);break}case B.BUTTON:{DCt(e,t);break}case B.APPLET:case B.OBJECT:case B.MARQUEE:{FCt(e,t);break}case B.IFRAME:{WCt(e,t);break}case B.SELECT:{KCt(e,t);break}case B.OPTION:case B.OPTGROUP:{GCt(e,t);break}case B.NOEMBED:case B.NOFRAMES:{xne(e,t);break}case B.FRAMESET:{TCt(e,t);break}case B.TEXTAREA:{HCt(e,t);break}case B.NOSCRIPT:{e.options.scriptingEnabled?xne(e,t):wne(e,t);break}case B.PLAINTEXT:{PCt(e,t);break}case B.COL:case B.TH:case B.TD:case B.TR:case B.HEAD:case B.FRAME:case B.TBODY:case B.TFOOT:case B.THEAD:case B.CAPTION:case B.COLGROUP:break;default:wne(e,t)}}function eAt(e,t){if(e.openElements.hasInScope(B.BODY)&&(e.insertionMode=Ie.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function tAt(e,t){e.openElements.hasInScope(B.BODY)&&(e.insertionMode=Ie.AFTER_BODY,MMe(e,t))}function nAt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function iAt(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(B.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(B.FORM):n&&e.openElements.remove(n))}function rAt(e){e.openElements.hasInButtonScope(B.P)||e._insertFakeElement(Je.P,B.P),e._closePElement()}function sAt(e){e.openElements.hasInListItemScope(B.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(B.LI),e.openElements.popUntilTagNamePopped(B.LI))}function aAt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function oAt(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function lAt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function cAt(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(Je.BR,B.BR),e.openElements.pop(),e.framesetOk=!1}function AMe(e,t){const n=t.tagName,i=t.tagID;for(let r=e.openElements.stackTop;r>0;r--){const s=e.openElements.items[r],o=e.openElements.tagIDs[r];if(i===o&&(i!==B.UNKNOWN||e.treeAdapter.getTagName(s)===n)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.stackTop>=r&&e.openElements.shortenToLength(r);break}if(e._isSpecialElement(s,o))break}}function TM(e,t){switch(t.tagID){case B.A:case B.B:case B.I:case B.S:case B.U:case B.EM:case B.TT:case B.BIG:case B.CODE:case B.FONT:case B.NOBR:case B.SMALL:case B.STRIKE:case B.STRONG:{nq(e,t);break}case B.P:{rAt(e);break}case B.DL:case B.UL:case B.OL:case B.DIR:case B.DIV:case B.NAV:case B.PRE:case B.MAIN:case B.MENU:case B.ASIDE:case B.BUTTON:case B.CENTER:case B.FIGURE:case B.FOOTER:case B.HEADER:case B.HGROUP:case B.DIALOG:case B.ADDRESS:case B.ARTICLE:case B.DETAILS:case B.SEARCH:case B.SECTION:case B.SUMMARY:case B.LISTING:case B.FIELDSET:case B.BLOCKQUOTE:case B.FIGCAPTION:{nAt(e,t);break}case B.LI:{sAt(e);break}case B.DD:case B.DT:{aAt(e,t);break}case B.H1:case B.H2:case B.H3:case B.H4:case B.H5:case B.H6:{oAt(e);break}case B.BR:{cAt(e);break}case B.BODY:{eAt(e,t);break}case B.HTML:{tAt(e,t);break}case B.FORM:{iAt(e);break}case B.APPLET:case B.OBJECT:case B.MARQUEE:{lAt(e,t);break}case B.TEMPLATE:{J0(e,t);break}default:AMe(e,t)}}function TMe(e,t){e.tmplInsertionModeStack.length>0?DMe(e,t):iq(e,t)}function uAt(e,t){var n;t.tagID===B.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function dAt(e,t){e._err(t,dt.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function j4(e,t){if(e.openElements.currentTagId!==void 0&&OMe.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=Ie.IN_TABLE_TEXT,t.type){case $i.CHARACTER:{jMe(e,t);break}case $i.WHITESPACE_CHARACTER:{_Me(e,t);break}}else gT(e,t)}function fAt(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,Rt.HTML),e.insertionMode=Ie.IN_CAPTION}function hAt(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Rt.HTML),e.insertionMode=Ie.IN_COLUMN_GROUP}function pAt(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Je.COLGROUP,B.COLGROUP),e.insertionMode=Ie.IN_COLUMN_GROUP,rq(e,t)}function mAt(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Rt.HTML),e.insertionMode=Ie.IN_TABLE_BODY}function gAt(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Je.TBODY,B.TBODY),e.insertionMode=Ie.IN_TABLE_BODY,_M(e,t)}function bAt(e,t){e.openElements.hasInTableScope(B.TABLE)&&(e.openElements.popUntilTagNamePopped(B.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function yAt(e,t){CMe(t)?e._appendElement(t,Rt.HTML):gT(e,t),t.ackSelfClosing=!0}function vAt(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,Rt.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function s1(e,t){switch(t.tagID){case B.TD:case B.TH:case B.TR:{gAt(e,t);break}case B.STYLE:case B.SCRIPT:case B.TEMPLATE:{Tf(e,t);break}case B.COL:{pAt(e,t);break}case B.FORM:{vAt(e,t);break}case B.TABLE:{bAt(e,t);break}case B.TBODY:case B.TFOOT:case B.THEAD:{mAt(e,t);break}case B.INPUT:{yAt(e,t);break}case B.CAPTION:{fAt(e,t);break}case B.COLGROUP:{hAt(e,t);break}default:gT(e,t)}}function CC(e,t){switch(t.tagID){case B.TABLE:{e.openElements.hasInTableScope(B.TABLE)&&(e.openElements.popUntilTagNamePopped(B.TABLE),e._resetInsertionMode());break}case B.TEMPLATE:{J0(e,t);break}case B.BODY:case B.CAPTION:case B.COL:case B.COLGROUP:case B.HTML:case B.TBODY:case B.TD:case B.TFOOT:case B.TH:case B.THEAD:case B.TR:break;default:gT(e,t)}}function gT(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,AM(e,t),e.fosterParentingEnabled=n}function _Me(e,t){e.pendingCharacterTokens.push(t)}function jMe(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function vk(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n0&&e.openElements.currentTagId===B.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===B.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===B.OPTGROUP&&e.openElements.pop();break}case B.OPTION:{e.openElements.currentTagId===B.OPTION&&e.openElements.pop();break}case B.SELECT:{e.openElements.hasInSelectScope(B.SELECT)&&(e.openElements.popUntilTagNamePopped(B.SELECT),e._resetInsertionMode());break}case B.TEMPLATE:{J0(e,t);break}}}function EAt(e,t){const n=t.tagID;n===B.CAPTION||n===B.TABLE||n===B.TBODY||n===B.TFOOT||n===B.THEAD||n===B.TR||n===B.TD||n===B.TH?(e.openElements.popUntilTagNamePopped(B.SELECT),e._resetInsertionMode(),e._processStartTag(t)):IMe(e,t)}function CAt(e,t){const n=t.tagID;n===B.CAPTION||n===B.TABLE||n===B.TBODY||n===B.TFOOT||n===B.THEAD||n===B.TR||n===B.TD||n===B.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(B.SELECT),e._resetInsertionMode(),e.onEndTag(t)):PMe(e,t)}function AAt(e,t){switch(t.tagID){case B.BASE:case B.BASEFONT:case B.BGSOUND:case B.LINK:case B.META:case B.NOFRAMES:case B.SCRIPT:case B.STYLE:case B.TEMPLATE:case B.TITLE:{Tf(e,t);break}case B.CAPTION:case B.COLGROUP:case B.TBODY:case B.TFOOT:case B.THEAD:{e.tmplInsertionModeStack[0]=Ie.IN_TABLE,e.insertionMode=Ie.IN_TABLE,s1(e,t);break}case B.COL:{e.tmplInsertionModeStack[0]=Ie.IN_COLUMN_GROUP,e.insertionMode=Ie.IN_COLUMN_GROUP,rq(e,t);break}case B.TR:{e.tmplInsertionModeStack[0]=Ie.IN_TABLE_BODY,e.insertionMode=Ie.IN_TABLE_BODY,_M(e,t);break}case B.TD:case B.TH:{e.tmplInsertionModeStack[0]=Ie.IN_ROW,e.insertionMode=Ie.IN_ROW,jM(e,t);break}default:e.tmplInsertionModeStack[0]=Ie.IN_BODY,e.insertionMode=Ie.IN_BODY,Rl(e,t)}}function TAt(e,t){t.tagID===B.TEMPLATE&&J0(e,t)}function DMe(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(B.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):iq(e,t)}function _At(e,t){t.tagID===B.HTML?Rl(e,t):jI(e,t)}function MMe(e,t){var n;if(t.tagID===B.HTML){if(e.fragmentContext||(e.insertionMode=Ie.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===B.HTML){e._setEndLocation(e.openElements.items[0],t);const i=e.openElements.items[1];i&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(i))===null||n===void 0)&&n.endTag)&&e._setEndLocation(i,t)}}else jI(e,t)}function jI(e,t){e.insertionMode=Ie.IN_BODY,AM(e,t)}function jAt(e,t){switch(t.tagID){case B.HTML:{Rl(e,t);break}case B.FRAMESET:{e._insertElement(t,Rt.HTML);break}case B.FRAME:{e._appendElement(t,Rt.HTML),t.ackSelfClosing=!0;break}case B.NOFRAMES:{Tf(e,t);break}}}function NAt(e,t){t.tagID===B.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==B.FRAMESET&&(e.insertionMode=Ie.AFTER_FRAMESET))}function RAt(e,t){switch(t.tagID){case B.HTML:{Rl(e,t);break}case B.NOFRAMES:{Tf(e,t);break}}}function IAt(e,t){t.tagID===B.HTML&&(e.insertionMode=Ie.AFTER_AFTER_FRAMESET)}function PAt(e,t){t.tagID===B.HTML?Rl(e,t):NN(e,t)}function NN(e,t){e.insertionMode=Ie.IN_BODY,AM(e,t)}function DAt(e,t){switch(t.tagID){case B.HTML:{Rl(e,t);break}case B.NOFRAMES:{Tf(e,t);break}}}function MAt(e,t){t.chars=Fs,e._insertCharacters(t)}function LAt(e,t){e._insertCharacters(t),e.framesetOk=!1}function LMe(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==Rt.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function $At(e,t){if(JEt(t))LMe(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),i=e.treeAdapter.getNamespaceURI(n);i===Rt.MATHML?xMe(t):i===Rt.SVG&&(eCt(t),wMe(t)),tq(t),t.selfClosing?e._appendElement(t,i):e._insertElement(t,i),t.ackSelfClosing=!0}}function FAt(e,t){if(t.tagID===B.P||t.tagID===B.BR){LMe(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const i=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(i)===Rt.HTML){e._endTagOutsideForeignContent(t);break}const r=e.treeAdapter.getTagName(i);if(r.toLowerCase()===t.tagName){t.tagName=r,e.openElements.shortenToLength(n);break}}}Je.AREA,Je.BASE,Je.BASEFONT,Je.BGSOUND,Je.BR,Je.COL,Je.EMBED,Je.FRAME,Je.HR,Je.IMG,Je.INPUT,Je.KEYGEN,Je.LINK,Je.META,Je.PARAM,Je.SOURCE,Je.TRACK,Je.WBR;const BAt=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,UAt=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),One={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function $Me(e,t){const n=YAt(e),i=YPe("type",{handlers:{root:QAt,element:zAt,text:VAt,comment:BMe,doctype:HAt,raw:WAt},unknown:KAt}),r={parser:n?new vne(One):vne.getFragmentParser(void 0,One),handle(l){i(l,r)},stitches:!1,options:t||{}};i(e,r),sO(r,jh());const s=n?r.parser.document:r.parser.getFragment(),o=ZSt(s,{file:r.options.file});return r.stitches&&pT(o,"comment",function(l,c,u){const d=l;if(d.value.stitch&&u&&c!==void 0){const f=u.children;return f[c]=d.value.stitch,c}}),o.type==="root"&&o.children.length===1&&o.children[0].type===e.type?o.children[0]:o}function FMe(e,t){let n=-1;if(e)for(;++n4&&(t.parser.tokenizer.state=0);const n={type:$i.CHARACTER,chars:e.value,location:bT(e)};sO(t,jh(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function HAt(e,t){const n={type:$i.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:bT(e)};sO(t,jh(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function qAt(e,t){t.stitches=!0;const n=ZAt(e);if("children"in e&&"children"in n){const i=$Me({type:"root",children:e.children},t.options);n.children=i.children}BMe({type:"comment",value:{stitch:n}},t)}function BMe(e,t){const n=e.value,i={type:$i.COMMENT,data:n,location:bT(e)};sO(t,jh(e)),t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken)}function WAt(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,UMe(t,jh(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(BAt,"<$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function KAt(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))qAt(n,t);else{let i="";throw UAt.has(n.type)&&(i=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+i)}}function sO(e,t){UMe(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=Ea.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function UMe(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function GAt(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Ea.PLAINTEXT)return;sO(t,jh(e));const i=t.parser.openElements.current;let r="namespaceURI"in i?i.namespaceURI:Ny.html;r===Ny.html&&n==="svg"&&(r=Ny.svg);const s=iEt({...e,children:[]},{space:r===Ny.svg?"svg":"html"}),o={type:$i.START_TAG,tagName:n,tagID:rO(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in s?s.attrs:[],location:bT(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function XAt(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&dEt.includes(n)||t.parser.tokenizer.state===Ea.PLAINTEXT)return;sO(t,xM(e));const i={type:$i.END_TAG,tagName:n,tagID:rO(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:bT(e)};t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Ea.RCDATA||t.parser.tokenizer.state===Ea.RAWTEXT||t.parser.tokenizer.state===Ea.SCRIPT_DATA)&&(t.parser.tokenizer.state=Ea.DATA)}function YAt(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function bT(e){const t=jh(e)||{line:void 0,column:void 0,offset:void 0},n=xM(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function ZAt(e){return"children"in e?i1({...e,children:[]}):i1(e)}function JAt(e){return function(t,n){return $Me(t,{...e,file:n})}}const eTt="modulepreload",tTt=function(e){return"/"+e},kne={},Zs=function(t,n,i){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));r=Promise.allSettled(n.map(c=>{if(c=tTt(c),c in kne)return;kne[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":eTt,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((h,m)=>{f.addEventListener("load",h),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return r.then(o=>{for(const l of o||[])l.status==="rejected"&&s(l.reason);return t().catch(s)})};var nTt=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,iTt=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,rTt=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,N4={Space_Separator:nTt,ID_Start:iTt,ID_Continue:rTt},va={isSpaceSeparator(e){return typeof e=="string"&&N4.Space_Separator.test(e)},isIdStartChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="$"||e==="_"||N4.ID_Start.test(e))},isIdContinueChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||e==="$"||e==="_"||e==="‌"||e==="‍"||N4.ID_Continue.test(e))},isDigit(e){return typeof e=="string"&&/[0-9]/.test(e)},isHexDigit(e){return typeof e=="string"&&/[0-9A-Fa-f]/.test(e)}};let t9,ec,vp,NI,cb,mf,ko,sq,pE;var sTt=function(t,n){t9=String(t),ec="start",vp=[],NI=0,cb=1,mf=0,ko=void 0,sq=void 0,pE=void 0;do ko=aTt(),cTt[ec]();while(ko.type!=="eof");return typeof n=="function"?n9({"":pE},"",n):pE};function n9(e,t,n){const i=e[t];if(i!=null&&typeof i=="object")if(Array.isArray(i))for(let r=0;r0;){const n=$p();if(!va.isHexDigit(n))throw As(Tt());e+=Tt()}return String.fromCodePoint(parseInt(e,16))}const cTt={start(){if(ko.type==="eof")throw Jb();R4()},beforePropertyName(){switch(ko.type){case"identifier":case"string":sq=ko.value,ec="afterPropertyName";return;case"punctuator":__();return;case"eof":throw Jb()}},afterPropertyName(){if(ko.type==="eof")throw Jb();ec="beforePropertyValue"},beforePropertyValue(){if(ko.type==="eof")throw Jb();R4()},beforeArrayValue(){if(ko.type==="eof")throw Jb();if(ko.type==="punctuator"&&ko.value==="]"){__();return}R4()},afterPropertyValue(){if(ko.type==="eof")throw Jb();switch(ko.value){case",":ec="beforePropertyName";return;case"}":__()}},afterArrayValue(){if(ko.type==="eof")throw Jb();switch(ko.value){case",":ec="beforeArrayValue";return;case"]":__()}},end(){}};function R4(){let e;switch(ko.type){case"punctuator":switch(ko.value){case"{":e={};break;case"[":e=[];break}break;case"null":case"boolean":case"numeric":case"string":e=ko.value;break}if(pE===void 0)pE=e;else{const t=vp[vp.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,sq,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(e!==null&&typeof e=="object")vp.push(e),Array.isArray(e)?ec="beforeArrayValue":ec="beforePropertyName";else{const t=vp[vp.length-1];t==null?ec="end":Array.isArray(t)?ec="afterArrayValue":ec="afterPropertyValue"}}function __(){vp.pop();const e=vp[vp.length-1];e==null?ec="end":Array.isArray(e)?ec="afterArrayValue":ec="afterPropertyValue"}function As(e){return RI(e===void 0?`JSON5: invalid end of input at ${cb}:${mf}`:`JSON5: invalid character '${zMe(e)}' at ${cb}:${mf}`)}function Jb(){return RI(`JSON5: invalid end of input at ${cb}:${mf}`)}function Sne(){return mf-=5,RI(`JSON5: invalid identifier character at ${cb}:${mf}`)}function uTt(e){console.warn(`JSON5: '${zMe(e)}' in strings is not valid ECMAScript; consider escaping`)}function zMe(e){const t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(t[e])return t[e];if(e<" "){const n=e.charCodeAt(0).toString(16);return"\\x"+("00"+n).substring(n.length)}return e}function RI(e){const t=new SyntaxError(e);return t.lineNumber=cb,t.columnNumber=mf,t}var dTt=function(t,n,i){const r=[];let s="",o,l,c="",u;if(n!=null&&typeof n=="object"&&!Array.isArray(n)&&(i=n.space,u=n.quote,n=n.replacer),typeof n=="function")l=n;else if(Array.isArray(n)){o=[];for(const b of n){let v;typeof b=="string"?v=b:(typeof b=="number"||b instanceof String||b instanceof Number)&&(v=String(b)),v!==void 0&&o.indexOf(v)<0&&o.push(v)}}return i instanceof Number?i=Number(i):i instanceof String&&(i=String(i)),typeof i=="number"?i>0&&(i=Math.min(10,Math.floor(i)),c=" ".substr(0,i)):typeof i=="string"&&(c=i.substr(0,10)),d("",{"":t});function d(b,v){let y=v[b];switch(y!=null&&(typeof y.toJSON5=="function"?y=y.toJSON5(b):typeof y.toJSON=="function"&&(y=y.toJSON(b))),l&&(y=l.call(v,b,y)),y instanceof Number?y=Number(y):y instanceof String?y=String(y):y instanceof Boolean&&(y=y.valueOf()),y){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof y=="string")return f(y);if(typeof y=="number")return String(y);if(typeof y=="object")return Array.isArray(y)?g(y):h(y)}function f(b){const v={"'":.1,'"':.2},y={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let w="";for(let O=0;Ov[O]=0)throw TypeError("Converting circular structure to JSON5");r.push(b);let v=s;s=s+c;let y=o||Object.keys(b),w=[];for(const O of y){const k=d(O,b);if(k!==void 0){let S=m(O)+":";c!==""&&(S+=" "),S+=k,w.push(S)}}let x;if(w.length===0)x="{}";else{let O;if(c==="")O=w.join(","),x="{"+O+"}";else{let k=`, +`))}function c(m,g,b,v){const y=b.enter("tableCell"),w=b.enter("phrasing"),x=b.containerPhrasing(m,{...v,before:s,after:s});return w(),y(),x}function u(m,g){return r1t(m,{align:g,alignDelimiters:i,padding:n,stringLength:r})}function d(m,g,b){const v=m.children;let y=-1;const w=[],x=g.enter("table");for(;++y0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const lOt={tokenize:gOt,partial:!0};function cOt(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:hOt,continuation:{tokenize:pOt},exit:mOt}},text:{91:{name:"gfmFootnoteCall",tokenize:fOt},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:uOt,resolveTo:dOt}}}}function uOt(e,t,n){const i=this;let r=i.events.length;const s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o;for(;r--;){const c=i.events[r][1];if(c.type==="labelImage"){o=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return l;function l(c){if(!o||!o._balanced)return n(c);const u=mf(i.sliceSerialize({start:o.end,end:i.now()}));return u.codePointAt(0)!==94||!s.includes(u.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function dOt(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},r={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};r.end.column++,r.end.offset++,r.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},r.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},l=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",r,t],["exit",r,t],["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...l),e}function fOt(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s=0,o;return l;function l(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),c}function c(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(f){if(s>999||f===93&&!o||f===null||f===91||cs(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return r.includes(mf(i.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return cs(f)||(o=!0),s++,e.consume(f),f===92?d:u}function d(f){return f===91||f===92||f===93?(e.consume(f),s++,u):u(f)}}function hOt(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s,o=0,l;return c;function c(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(g)}function d(g){if(o>999||g===93&&!l||g===null||g===91||cs(g))return n(g);if(g===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return s=mf(i.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return cs(g)||(l=!0),o++,e.consume(g),g===92?f:d}function f(g){return g===91||g===92||g===93?(e.consume(g),o++,d):d(g)}function h(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),r.includes(s)||r.push(s),dr(e,m,"gfmFootnoteDefinitionWhitespace")):n(g)}function m(g){return t(g)}}function pOt(e,t,n){return e.check(hT,t,e.attempt(lOt,t,n))}function mOt(e){e.exit("gfmFootnoteDefinition")}function gOt(e,t,n){const i=this;return dr(e,r,"gfmFootnoteDefinitionIndent",5);function r(s){const o=i.events[i.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(s):n(s)}}function bOt(e){let n=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:s,resolveAll:r};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function r(o,l){let c=-1;for(;++c1?c(g):(o.consume(g),f++,m);if(f<2&&!n)return c(g);const v=o.exit("strikethroughSequenceTemporary"),y=i1(g);return v._open=!y||y===2&&!!b,v._close=!b||b===2&&!!y,l(g)}}}class yOt{constructor(){this.map=[]}add(t,n,i){vOt(this,t,n,i)}consume(t){if(this.map.sort(function(s,o){return s[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const i=[];for(;n>0;)n-=1,i.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];i.push(t.slice()),t.length=0;let r=i.pop();for(;r;){for(const s of r)t.push(s);r=i.pop()}this.map.length=0}}function vOt(e,t,n,i){let r=0;if(!(n===0&&i.length===0)){for(;r-1;){const D=i.events[R][1].type;if(D==="lineEnding"||D==="linePrefix")R--;else break}const A=R>-1?i.events[R][1].type:null,N=A==="tableHead"||A==="tableRow"?S:c;return N===S&&i.parser.lazy[i.now().line]?n(T):N(T)}function c(T){return e.enter("tableHead"),e.enter("tableRow"),u(T)}function u(T){return T===124||(o=!0,s+=1),d(T)}function d(T){return T===null?n(T):Kn(T)?s>1?(s=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),m):n(T):Gi(T)?dr(e,d,"whitespace")(T):(s+=1,o&&(o=!1,r+=1),T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),o=!0,d):(e.enter("data"),f(T)))}function f(T){return T===null||T===124||cs(T)?(e.exit("data"),d(T)):(e.consume(T),T===92?h:f)}function h(T){return T===92||T===124?(e.consume(T),f):f(T)}function m(T){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(T):(e.enter("tableDelimiterRow"),o=!1,Gi(T)?dr(e,g,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):g(T))}function g(T){return T===45||T===58?v(T):T===124?(o=!0,e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),b):k(T)}function b(T){return Gi(T)?dr(e,v,"whitespace")(T):v(T)}function v(T){return T===58?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),y):T===45?(s+=1,y(T)):T===null||Kn(T)?O(T):k(T)}function y(T){return T===45?(e.enter("tableDelimiterFiller"),w(T)):k(T)}function w(T){return T===45?(e.consume(T),w):T===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(T))}function x(T){return Gi(T)?dr(e,O,"whitespace")(T):O(T)}function O(T){return T===124?g(T):T===null||Kn(T)?!o||r!==s?k(T):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(T)):k(T)}function k(T){return n(T)}function S(T){return e.enter("tableRow"),C(T)}function C(T){return T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),C):T===null||Kn(T)?(e.exit("tableRow"),t(T)):Gi(T)?dr(e,C,"whitespace")(T):(e.enter("data"),E(T))}function E(T){return T===null||T===124||cs(T)?(e.exit("data"),C(T)):(e.consume(T),T===92?j:E)}function j(T){return T===92||T===124?(e.consume(T),E):E(T)}}function kOt(e,t){let n=-1,i=!0,r=0,s=[0,0,0,0],o=[0,0,0,0],l=!1,c=0,u,d,f;const h=new yOt;for(;++nn[2]+1){const g=n[2]+1,b=n[3]-n[2]-1;e.add(g,b,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return r!==void 0&&(s.end=Object.assign({},ox(t.events,r)),e.add(r,0,[["exit",s,t]]),s=void 0),s}function Ute(e,t,n,i,r){const s=[],o=ox(t.events,n);r&&(r.end=Object.assign({},o),s.push(["exit",r,t])),i.end=Object.assign({},o),s.push(["exit",i,t]),e.add(n+1,0,s)}function ox(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const SOt={name:"tasklistCheck",tokenize:COt};function EOt(){return{text:{91:SOt}}}function COt(e,t,n){const i=this;return r;function r(c){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),s)}function s(c){return cs(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),o):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),o):n(c)}function o(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(c)}function l(c){return Kn(c)?t(c):Gi(c)?e.check({tokenize:AOt},t,n)(c):n(c)}}function AOt(e,t,n){return dr(e,i,"whitespace");function i(r){return r===null?n(r):t(r)}}function TOt(e){return EPe([J1t(),cOt(),bOt(e),wOt(),EOt()])}const _Ot={};function yDe(e){const t=this,n=e||_Ot,i=t.data(),r=i.micromarkExtensions||(i.micromarkExtensions=[]),s=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),o=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);r.push(TOt(n)),s.push(G1t()),o.push(X1t(n))}const Qte=function(e,t,n){const i=pT(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++tu&&(u=d):d&&(u!==void 0&&u>-1&&c.push(` +`.repeat(u)||" "),u=-1,c.push(d))}return c.join("")}function xDe(e,t,n){return e.type==="element"?LOt(e,t,n):e.type==="text"?n.whitespace==="normal"?wDe(e,n):$Ot(e):[]}function LOt(e,t,n){const i=ODe(e,n),r=e.children||[];let s=-1,o=[];if(DOt(e))return o;let l,c;for(XB(e)||qte(e)&&Qte(t,e,qte)?c=` +`:POt(e)?(l=2,c=2):vDe(e)&&(l=1,c=1);++s]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},m=t.optional(r)+e.IDENT_RE+"\\s*\\(",g=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],b=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],O={type:b,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},k={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},S=[k,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],C={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:O,contains:S.concat([{begin:/\(/,end:/\)/,keywords:O,contains:S.concat(["self"]),relevance:0}]),relevance:0},E={className:"function",begin:"("+o+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:O,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:O,relevance:0},{begin:m,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:O,illegal:"",keywords:O,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:O},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function VOt(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=zOt(e),i=n.keywords;return i.type=[...i.type,...t.type],i.literal=[...i.literal,...t.literal],i.built_in=[...i.built_in,...t.built_in],i._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function EM(e){const t=e.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});const r={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},s=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,r]};r.contains.push(l);const c={match:/\\"/},u={className:"string",begin:/'/,end:/'/},d={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},h=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],m=e.SHEBANG({binary:`(${h.join("|")})`,relevance:10}),g={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},b=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],v=["true","false"],y={match:/(\/[a-z._-]+)+/},w=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],x=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],O=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],k=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:b,literal:v,built_in:[...w,...x,"set","shopt",...O,...k]},contains:[m,e.SHEBANG(),g,f,s,o,y,l,c,u,d,n]}}function HOt(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",o="("+i+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},m=t.optional(r)+e.IDENT_RE+"\\s*\\(",v={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},y=[f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],w={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:v,contains:y.concat([{begin:/\(/,end:/\)/,keywords:v,contains:y.concat(["self"]),relevance:0}]),relevance:0},x={begin:"("+o+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:v,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:v,relevance:0},{begin:m,returnBegin:!0,contains:[e.inherit(h,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C",aliases:["h"],keywords:v,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:f,strings:u,keywords:v}}}function qOt(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",o="(?!struct)("+i+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},m=t.optional(r)+e.IDENT_RE+"\\s*\\(",g=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],b=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],O={type:b,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},k={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},S=[k,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],C={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:O,contains:S.concat([{begin:/\(/,end:/\)/,keywords:O,contains:S.concat(["self"]),relevance:0}]),relevance:0},E={className:"function",begin:"("+o+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:O,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:O,relevance:0},{begin:m,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:O,illegal:"",keywords:O,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:O},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function WOt(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],i=["default","false","null","true"],r=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],s=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],o={keyword:r.concat(s),built_in:t,literal:i},l=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),c={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},u={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},d={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},f=e.inherit(d,{illegal:/\n/}),h={className:"subst",begin:/\{/,end:/\}/,keywords:o},m=e.inherit(h,{illegal:/\n/}),g={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,m]},b={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},v=e.inherit(b,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},m]});h.contains=[b,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.C_BLOCK_COMMENT_MODE],m.contains=[v,g,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const y={variants:[u,b,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},w={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},x=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",O={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:o,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},y,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,w,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,w,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+x+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:o,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,w],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,relevance:0,contains:[y,c,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},O]}}const KOt=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),GOt=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],XOt=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],YOt=[...GOt,...XOt],ZOt=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),JOt=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),ekt=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),tkt=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function SDe(e){const t=e.regex,n=KOt(e),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",s=/@-?\w[\w]*(-\w+)*/,o="[a-zA-Z-][a-zA-Z0-9_-]*",l=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,i,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+o,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+JOt.join("|")+")"},{begin:":(:)?("+ekt.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+tkt.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:r,attribute:ZOt.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+YOt.join("|")+")\\b"}]}}function EDe(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function CDe(e){const s={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:s,illegal:"ADe(e,t,n-1))}function TDe(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+ADe("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),c={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},u={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},d={className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:c,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+i+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:c,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,Wte,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},Wte,u]}}const Kte="[A-Za-z$_][0-9A-Za-z$_]*",ikt=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],rkt=["true","false","null","undefined","NaN","Infinity"],_De=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],jDe=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],NDe=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],skt=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],akt=[].concat(NDe,_De,jDe);function QH(e){const t=e.regex,n=(L,{after:F})=>{const M="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,F)=>{const M=L[0].length+L.index,V=L.input[M];if(V==="<"||V===","){F.ignoreMatch();return}V===">"&&(n(L,{after:M})||F.ignoreMatch());let q;const U=L.input.substring(M);if(q=U.match(/^\s*=/)){F.ignoreMatch();return}if((q=U.match(/^\s+extends\s+/))&&q.index===0){F.ignoreMatch();return}}},l={$pattern:Kte,keyword:ikt,literal:rkt,built_in:akt,"variable.language":skt},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},m={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},w={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const O=[].concat(w,h.contains),k=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(O)}]),S={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k},C={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},E={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[..._De,...jDe]}},j={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[S],illegal:/%/},R={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function A(L){return t.concat("(?!",L.join("|"),")")}const N={match:t.concat(/\b/,A([...NDe,"super","import"].map(L=>`${L}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},D={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},I={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},S]},P="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",_={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(P)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[S]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:E},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),j,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,w,{match:/\$\d+/},f,E,{scope:"attr",match:i+t.lookahead(":"),relevance:0},_,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[w,e.REGEXP_MODE,{className:"function",begin:P,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[S,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},D,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[S]},N,R,C,I,{match:/\$[(.]/}]}}function zH(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],r={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[t,n,e.QUOTE_STRING_MODE,r,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var cx="[0-9](_*[0-9])*",E_=`\\.(${cx})`,C_="[0-9a-fA-F](_*[0-9a-fA-F])*",okt={className:"number",variants:[{begin:`(\\b(${cx})((${E_})|\\.)?|(${E_}))[eE][+-]?(${cx})[fFdD]?\\b`},{begin:`\\b(${cx})((${E_})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${E_})[fFdD]?\\b`},{begin:`\\b(${cx})[fFdD]\\b`},{begin:`\\b0[xX]((${C_})\\.?|(${C_})?\\.(${C_}))[pP][+-]?(${cx})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${C_})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function lkt(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},i={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},r={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},s={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[s,r]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,s,r]}]};r.contains.push(o);const l={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},c={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(o,{className:"string"}),"self"]}]},u=okt,d=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),f={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},h=f;return h.variants[1].contains=[f],f.variants[1].contains=[h],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,d,n,i,l,c,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[f,e.C_LINE_COMMENT_MODE,d],relevance:0},e.C_LINE_COMMENT_MODE,d,l,c,o,e.C_NUMBER_MODE]},d]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},l,c]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` +`},u]}}const ckt=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),ukt=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],dkt=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],fkt=[...ukt,...dkt],hkt=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),RDe=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),IDe=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),pkt=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),mkt=RDe.concat(IDe).sort().reverse();function gkt(e){const t=ckt(e),n=mkt,i="and or not only",r="[\\w-]+",s="("+r+"|@\\{"+r+"\\})",o=[],l=[],c=function(x){return{className:"string",begin:"~?"+x+".*?"+x}},u=function(x,O,k){return{className:x,begin:O,relevance:k}},d={$pattern:/[a-z-]+/,keyword:i,attribute:hkt.join(" ")},f={begin:"\\(",end:"\\)",contains:l,keywords:d,relevance:0};l.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,c("'"),c('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,f,u("variable","@@?"+r,10),u("variable","@\\{"+r+"\\}"),u("built_in","~?`[^`]*?`"),{className:"attribute",begin:r+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const h=l.concat({begin:/\{/,end:/\}/,contains:o}),m={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},g={begin:s+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+pkt.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:l}}]},b={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:d,returnEnd:!0,contains:l,relevance:0}},v={className:"variable",variants:[{begin:"@"+r+"\\s*:",relevance:15},{begin:"@"+r}],starts:{end:"[;}]",returnEnd:!0,contains:h}},y={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:s,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,m,u("keyword","all\\b"),u("variable","@\\{"+r+"\\}"),{begin:"\\b("+fkt.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,u("selector-tag",s,0),u("selector-id","#"+s),u("selector-class","\\."+s,0),u("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+RDe.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+IDe.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},w={begin:r+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[y]};return o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,b,v,w,g,y,m,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:o}}function bkt(e){const t="\\[=*\\[",n="\\]=*\\]",i={begin:t,end:n,contains:["self"]},r=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[i],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:r.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:r}].concat(r)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[i],relevance:5}])}}function VH(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},r={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},s={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},d={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},f=e.inherit(u,{contains:[]}),h=e.inherit(d,{contains:[]});u.contains.push(h),d.contains.push(f);let m=[n,c];return[u,d,f,h].forEach(y=>{y.contains=y.contains.concat(m)}),m=m.concat(u,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:m},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:m}]}]},n,s,u,d,{className:"quote",begin:"^>\\s+",contains:m,end:"$"},r,i,c,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function ykt(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,l={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},c={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:l,illegal:"/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+c.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:c,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function vkt(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],i=/[dualxmsipngr]{0,12}/,r={$pattern:/[\w.]+/,keyword:n.join(" ")},s={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:r},o={begin:/->\{/,end:/\}/},l={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},c={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[l]},u={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},d=[e.BACKSLASH_ESCAPE,s,c],f=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],h=(b,v,y="\\1")=>{const w=y==="\\1"?y:t.concat(y,v);return t.concat(t.concat("(?:",b,")"),v,/(?:\\.|[^\\\/])*?/,w,/(?:\\.|[^\\\/])*?/,y,i)},m=(b,v,y)=>t.concat(t.concat("(?:",b,")"),v,/(?:\\.|[^\\\/])*?/,y,i),g=[c,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:"string",contains:d,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},u,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:h("s|tr|y",t.either(...f,{capture:!0}))},{begin:h("s|tr|y","\\(","\\)")},{begin:h("s|tr|y","\\[","\\]")},{begin:h("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:m("(?:m|qr)?",/\//,/\//)},{begin:m("m|qr",t.either(...f,{capture:!0}),/\1/)},{begin:m("m|qr",/\(/,/\)/)},{begin:m("m|qr",/\[/,/\]/)},{begin:m("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l,u]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return s.contains=g,o.contains=g,{name:"Perl",aliases:["pl","pm"],keywords:r,contains:g}}function xkt(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,i=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),r=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),s=t.concat(/[A-Z]+/,n),o={scope:"variable",match:"\\$+"+i},l={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},c={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},u=e.inherit(e.APOS_STRING_MODE,{illegal:null}),d=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(c)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(c),"on:begin":(D,I)=>{I.data._beginMatch=D[1]||D[2]},"on:end":(D,I)=>{I.data._beginMatch!==D[1]&&I.ignoreMatch()}},h=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),m=`[ +]`,g={scope:"string",variants:[d,u,f,h]},b={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},v=["false","null","true"],y=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],w=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],O={keyword:y,literal:(D=>{const I=[];return D.forEach(P=>{I.push(P),P.toLowerCase()===P?I.push(P.toUpperCase()):I.push(P.toLowerCase())}),I})(v),built_in:w},k=D=>D.map(I=>I.replace(/\|\d+$/,"")),S={variants:[{match:[/new/,t.concat(m,"+"),t.concat("(?!",k(w).join("\\b|"),"\\b)"),r],scope:{1:"keyword",4:"title.class"}}]},C=t.concat(i,"\\b(?!\\()"),E={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),C],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,t.concat(/::/,t.lookahead(/(?!class\b)/)),C],scope:{1:"title.class",3:"variable.constant"}},{match:[r,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[r,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},j={scope:"attr",match:t.concat(i,t.lookahead(":"),t.lookahead(/(?!::)/))},T={relevance:0,begin:/\(/,end:/\)/,keywords:O,contains:[j,o,E,e.C_BLOCK_COMMENT_MODE,g,b,S]},R={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",k(y).join("\\b|"),"|",k(w).join("\\b|"),"\\b)"),i,t.concat(m,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[T]};T.contains.push(R);const A=[j,E,e.C_BLOCK_COMMENT_MODE,g,b,S],N={begin:t.concat(/#\[\s*\\?/,t.either(r,s)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:v,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:v,keyword:["new","array"]},contains:["self",...A]},...A,{scope:"meta",variants:[{match:r},{match:s}]}]};return{case_insensitive:!1,keywords:O,contains:[N,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},l,{scope:"variable.language",match:/\$this\b/},o,R,E,{match:[/const/,/\s/,i],scope:{1:"keyword",3:"variable.constant"}},S,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:O,contains:["self",N,o,E,e.C_BLOCK_COMMENT_MODE,g,b]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},g,b]}}function wkt(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function PDe(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function qH(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},c={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},d={begin:/\{\{/,relevance:0},f={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,d,u]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},h="[0-9](_?[0-9])*",m=`(\\b(${h}))?\\.(${h})|\\b(${h})\\.`,g=`\\b|${i.join("|")}`,b={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${m}))[eE][+-]?(${h})[jJ]?(?=${g})`},{begin:`(${m})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${g})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${g})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${g})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${g})`},{begin:`\\b(${h})[jJ](?=${g})`}]},v={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",c,b,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,b,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,b,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,v,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[y]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[b,y,f]}]}}function Okt(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function kkt(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,i=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),r=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,s=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[r,i]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,i]},{scope:{1:"punctuation",2:"number"},match:[s,i]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,i]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:r},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:s},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function Skt(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",i=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),r=t.concat(i,/(::\w+)*/),o={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},l={className:"doctag",begin:"@[A-Za-z]+"},c={begin:"#<",end:">"},u=[e.COMMENT("#","$",{contains:[l]}),e.COMMENT("^=begin","^=end",{contains:[l],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],d={className:"subst",begin:/#\{/,end:/\}/,keywords:o},f={className:"string",contains:[e.BACKSLASH_ESCAPE,d],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,d]})]}]},h="[1-9](_?[0-9])*|0",m="[0-9](_?[0-9])*",g={className:"number",relevance:0,variants:[{begin:`\\b(${h})(\\.(${m}))?([eE][+-]?(${m})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},b={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},S=[f,{variants:[{match:[/class\s+/,r,/\s+<\s+/,r]},{match:[/\b(class|module)\s+/,r]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,r],scope:{2:"title.class"},keywords:o},{relevance:0,match:[r,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:i,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[b]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[f,{begin:n}],relevance:0},g,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,d],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(c,u),relevance:0}].concat(c,u);d.contains=S,b.contains=S;const T=[{begin:/^\s*=>/,starts:{end:"$",contains:S}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:o,contains:S}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(T).concat(u).concat(S)}}function DDe(e){const t=e.regex,n=/(r#)?/,i=t.concat(n,e.UNDERSCORE_IDENT_RE),r=t.concat(n,e.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,r,t.lookahead(/\s*\(/))},o="([ui](8|16|32|64|128|size)|f(32|64))?",l=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],c=["true","false","Some","None","Ok","Err"],u=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],d=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:d,keyword:l,literal:c,built_in:u},illegal:""},s]}}const Ekt=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Ckt=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Akt=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Tkt=[...Ckt,...Akt],_kt=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),jkt=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Nkt=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Rkt=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function MDe(e){const t=Ekt(e),n=Nkt,i=jkt,r="@[a-z-]+",s="and or not only",l={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+Tkt.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+i.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},l,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Rkt.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,l,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:r,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:_kt.join(" ")},contains:[{begin:r,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},l,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function Ikt(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function LDe(e){const t=e.regex,n=e.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},r={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["true","false","unknown"],o=["double precision","large object","with timezone","without timezone"],l=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],c=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],d=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],f=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],h=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],m=d,g=[...u,...c].filter(k=>!d.includes(k)),b={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},v={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:t.concat(/\b/,t.either(...m),/\s*\(/),relevance:0,keywords:{built_in:m}};function w(k){return t.concat(/\b/,t.either(...k.map(S=>S.replace(/\s+/,"\\s+"))),/\b/)}const x={scope:"keyword",match:w(h),relevance:0};function O(k,{exceptions:S,when:C}={}){const E=C;return S=S||[],k.map(j=>j.match(/\|\d+$/)||S.includes(j)?j:E(j)?`${j}|0`:j)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:O(g,{when:k=>k.length<3}),literal:s,type:l,built_in:f},contains:[{scope:"type",match:w(o)},x,y,b,i,r,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,v]}}function $De(e){return e?typeof e=="string"?e:e.source:null}function yk(e){return qr("(?=",e,")")}function qr(...e){return e.map(n=>$De(n)).join("")}function Pkt(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Gl(...e){return"("+(Pkt(e).capture?"":"?:")+e.map(i=>$De(i)).join("|")+")"}const WH=e=>qr(/\b/,e,/\w$/.test(e)?/\b/:/\B/),Dkt=["Protocol","Type"].map(WH),Gte=["init","self"].map(WH),Mkt=["Any","Self"],A4=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Xte=["false","nil","true"],Lkt=["assignment","associativity","higherThan","left","lowerThan","none","right"],$kt=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Yte=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],FDe=Gl(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),BDe=Gl(FDe,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),T4=qr(FDe,BDe,"*"),UDe=Gl(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),EI=Gl(UDe,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Wf=qr(UDe,EI,"*"),A_=qr(/[A-Z]/,EI,"*"),Fkt=["attached","autoclosure",qr(/convention\(/,Gl("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",qr(/objc\(/,Wf,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],Bkt=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function Ukt(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),i=[e.C_LINE_COMMENT_MODE,n],r={match:[/\./,Gl(...Dkt,...Gte)],className:{2:"keyword"}},s={match:qr(/\./,Gl(...A4)),relevance:0},o=A4.filter(ye=>typeof ye=="string").concat(["_|0"]),l=A4.filter(ye=>typeof ye!="string").concat(Mkt).map(WH),c={variants:[{className:"keyword",match:Gl(...l,...Gte)}]},u={$pattern:Gl(/\b\w+/,/#\w+/),keyword:o.concat($kt),literal:Xte},d=[r,s,c],f={match:qr(/\./,Gl(...Yte)),relevance:0},h={className:"built_in",match:qr(/\b/,Gl(...Yte),/(?=\()/)},m=[f,h],g={match:/->/,relevance:0},b={className:"operator",relevance:0,variants:[{match:T4},{match:`\\.(\\.|${BDe})+`}]},v=[g,b],y="([0-9]_*)+",w="([0-9a-fA-F]_*)+",x={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${w})(\\.(${w}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},O=(ye="")=>({className:"subst",variants:[{match:qr(/\\/,ye,/[0\\tnr"']/)},{match:qr(/\\/,ye,/u\{[0-9a-fA-F]{1,8}\}/)}]}),k=(ye="")=>({className:"subst",match:qr(/\\/,ye,/[\t ]*(?:[\r\n]|\r\n)/)}),S=(ye="")=>({className:"subst",label:"interpol",begin:qr(/\\/,ye,/\(/),end:/\)/}),C=(ye="")=>({begin:qr(ye,/"""/),end:qr(/"""/,ye),contains:[O(ye),k(ye),S(ye)]}),E=(ye="")=>({begin:qr(ye,/"/),end:qr(/"/,ye),contains:[O(ye),S(ye)]}),j={className:"string",variants:[C(),C("#"),C("##"),C("###"),E(),E("#"),E("##"),E("###")]},T=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],R={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:T},A=ye=>{const de=qr(ye,/\//),ge=qr(/\//,ye);return{begin:de,end:ge,contains:[...T,{scope:"comment",begin:`#(?!.*${ge})`,end:/$/}]}},N={scope:"regexp",variants:[A("###"),A("##"),A("#"),R]},D={match:qr(/`/,Wf,/`/)},I={className:"variable",match:/\$\d+/},P={className:"variable",match:`\\$${EI}+`},_=[D,I,P],L={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:Bkt,contains:[...v,x,j]}]}},F={scope:"keyword",match:qr(/@/,Gl(...Fkt),yk(Gl(/\(/,/\s+/)))},M={scope:"meta",match:qr(/@/,Wf)},V=[L,F,M],q={match:yk(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:qr(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,EI,"+")},{className:"type",match:A_,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:qr(/\s+&\s+/,yk(A_)),relevance:0}]},U={begin://,keywords:u,contains:[...i,...d,...V,g,q]};q.contains.push(U);const Z={match:qr(Wf,/\s*:/),keywords:"_|0",relevance:0},z={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",Z,...i,N,...d,...m,...v,x,j,..._,...V,q]},ee={begin://,keywords:"repeat each",contains:[...i,q]},ne={begin:Gl(yk(qr(Wf,/\s*:/)),yk(qr(Wf,/\s+/,Wf,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Wf}]},W={begin:/\(/,end:/\)/,keywords:u,contains:[ne,...i,...d,...v,x,j,...V,q,z],endsParent:!0,illegal:/["']/},X={match:[/(func|macro)/,/\s+/,Gl(D.match,Wf,T4)],className:{1:"keyword",3:"title.function"},contains:[ee,W,t],illegal:[/\[/,/%/]},H={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[ee,W,t],illegal:/\[|%/},ae={match:[/operator/,/\s+/,T4],className:{1:"keyword",3:"title"}},Y={begin:[/precedencegroup/,/\s+/,A_],className:{1:"keyword",3:"title"},contains:[q],keywords:[...Lkt,...Xte],end:/}/},K={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},ie={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},J={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Wf,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[ee,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:A_},...d],relevance:0}]};for(const ye of j.variants){const de=ye.contains.find(Ee=>Ee.label==="interpol");de.keywords=u;const ge=[...d,...m,...v,x,j,..._];de.contains=[...ge,{begin:/\(/,end:/\)/,contains:["self",...ge]}]}return{name:"Swift",keywords:u,contains:[...i,X,H,K,ie,J,ae,Y,{beginKeywords:"import",end:/$/,contains:[...i],relevance:0},N,...d,...m,...v,x,j,..._,...V,q,z]}}const CI="[A-Za-z$_][0-9A-Za-z$_]*",QDe=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],zDe=["true","false","null","undefined","NaN","Infinity"],VDe=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],HDe=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],qDe=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],WDe=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],KDe=[].concat(qDe,VDe,HDe);function Qkt(e){const t=e.regex,n=(L,{after:F})=>{const M="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,F)=>{const M=L[0].length+L.index,V=L.input[M];if(V==="<"||V===","){F.ignoreMatch();return}V===">"&&(n(L,{after:M})||F.ignoreMatch());let q;const U=L.input.substring(M);if(q=U.match(/^\s*=/)){F.ignoreMatch();return}if((q=U.match(/^\s+extends\s+/))&&q.index===0){F.ignoreMatch();return}}},l={$pattern:CI,keyword:QDe,literal:zDe,built_in:KDe,"variable.language":WDe},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},m={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},w={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const O=[].concat(w,h.contains),k=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(O)}]),S={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k},C={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},E={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...VDe,...HDe]}},j={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[S],illegal:/%/},R={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function A(L){return t.concat("(?!",L.join("|"),")")}const N={match:t.concat(/\b/,A([...qDe,"super","import"].map(L=>`${L}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},D={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},I={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},S]},P="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",_={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(P)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[S]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:E},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),j,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,w,{match:/\$\d+/},f,E,{scope:"attr",match:i+t.lookahead(":"),relevance:0},_,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[w,e.REGEXP_MODE,{className:"function",begin:P,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[S,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},D,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[S]},N,R,C,I,{match:/\$[(.]/}]}}function KH(e){const t=e.regex,n=Qkt(e),i=CI,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[n.exports.CLASS_REFERENCE]},l={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:CI,keyword:QDe.concat(c),literal:zDe,built_in:KDe.concat(r),"variable.language":WDe},d={className:"meta",begin:"@"+i},f=(b,v,y)=>{const w=b.contains.findIndex(x=>x.label===v);if(w===-1)throw new Error("can not find mode to replace");b.contains.splice(w,1,y)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const h=n.contains.find(b=>b.scope==="attr"),m=Object.assign({},h,{match:t.concat(i,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,h,m]),n.contains=n.contains.concat([d,s,o,m]),f(n,"shebang",e.SHEBANG()),f(n,"use_strict",l);const g=n.contains.find(b=>b.label==="func.def");return g.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function zkt(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},i={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},r=/\d{1,2}\/\d{1,2}\/\d{4}/,s=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,l=/\d{1,2}(:\d{1,2}){1,2}/,c={className:"literal",variants:[{begin:t.concat(/# */,t.either(s,r),/ *#/)},{begin:t.concat(/# */,l,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(s,r),/ +/,t.either(o,l),/ *#/)}]},u={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},d={className:"label",begin:/^\w+:/},f=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),h=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,i,c,u,d,f,h,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[h]}]}}function Vkt(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),i=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],r={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},s={className:"variable",begin:/\$[\w_]+/},o={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},l={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},c={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},u={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:i},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},s,o,r,e.QUOTE_STRING_MODE,c,u,l]}}function GDe(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(s,{begin:/\(/,end:/\)/}),l=e.inherit(e.APOS_STRING_MODE,{className:"string"}),c=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[s,c,l,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[s,o,c,l]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:u}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function GH(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,r]},l=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),h={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},m={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},g={begin:/\{/,end:/\}/,contains:[m],illegal:"\\n",relevance:0},b={begin:"\\[",end:"\\]",contains:[m],illegal:"\\n",relevance:0},v=[i,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},h,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},g,b,s,o],y=[...v];return y.pop(),y.push(l),m.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}const Hkt={arduino:VOt,bash:EM,c:HOt,cpp:qOt,csharp:WOt,css:SDe,diff:EDe,go:CDe,graphql:nkt,ini:UH,java:TDe,javascript:QH,json:zH,kotlin:lkt,less:gkt,lua:bkt,makefile:VH,markdown:HH,objectivec:ykt,perl:vkt,php:xkt,"php-template":wkt,plaintext:PDe,python:qH,"python-repl":Okt,r:kkt,ruby:Skt,rust:DDe,scss:MDe,shell:Ikt,sql:LDe,swift:Ukt,typescript:KH,vbnet:zkt,wasm:Vkt,xml:GDe,yaml:GH};function XDe(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t],i=typeof n;(i==="object"||i==="function")&&!Object.isFrozen(n)&&XDe(n)}),e}let Zte=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function YDe(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function yg(e,...t){const n=Object.create(null);for(const i in e)n[i]=e[i];return t.forEach(function(i){for(const r in i)n[r]=i[r]}),n}const qkt="",Jte=e=>!!e.scope,Wkt=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((i,r)=>`${i}${"_".repeat(r+1)}`)].join(" ")}return`${t}${e}`};class Kkt{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=YDe(t)}openNode(t){if(!Jte(t))return;const n=Wkt(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){Jte(t)&&(this.buffer+=qkt)}value(){return this.buffer}span(t){this.buffer+=``}}const ene=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class XH{constructor(){this.rootNode=ene(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const n=ene({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(i=>this._walk(t,i)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{XH._collapse(n)}))}}class Gkt extends XH{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const i=t.root;n&&(i.scope=`language:${n}`),this.add(i)}toHTML(){return new Kkt(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function EC(e){return e?typeof e=="string"?e:e.source:null}function ZDe(e){return J0("(?=",e,")")}function Xkt(e){return J0("(?:",e,")*")}function Ykt(e){return J0("(?:",e,")?")}function J0(...e){return e.map(n=>EC(n)).join("")}function Zkt(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function YH(...e){return"("+(Zkt(e).capture?"":"?:")+e.map(i=>EC(i)).join("|")+")"}function JDe(e){return new RegExp(e.toString()+"|").exec("").length-1}function Jkt(e,t){const n=e&&e.exec(t);return n&&n.index===0}const eSt=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function ZH(e,{joinWith:t}){let n=0;return e.map(i=>{n+=1;const r=n;let s=EC(i),o="";for(;s.length>0;){const l=eSt.exec(s);if(!l){o+=s;break}o+=s.substring(0,l.index),s=s.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?o+="\\"+String(Number(l[1])+r):(o+=l[0],l[0]==="("&&n++)}return o}).map(i=>`(${i})`).join(t)}const tSt=/\b\B/,eMe="[a-zA-Z]\\w*",JH="[a-zA-Z_]\\w*",tMe="\\b\\d+(\\.\\d+)?",nMe="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",iMe="\\b(0b[01]+)",nSt="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",iSt=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=J0(t,/.*\b/,e.binary,/\b.*/)),yg({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},e)},CC={begin:"\\\\[\\s\\S]",relevance:0},rSt={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[CC]},sSt={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[CC]},aSt={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},CM=function(e,t,n={}){const i=yg({scope:"comment",begin:e,end:t,contains:[]},n);i.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const r=YH("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return i.contains.push({begin:J0(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},oSt=CM("//","$"),lSt=CM("/\\*","\\*/"),cSt=CM("#","$"),uSt={scope:"number",begin:tMe,relevance:0},dSt={scope:"number",begin:nMe,relevance:0},fSt={scope:"number",begin:iMe,relevance:0},hSt={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[CC,{begin:/\[/,end:/\]/,relevance:0,contains:[CC]}]},pSt={scope:"title",begin:eMe,relevance:0},mSt={scope:"title",begin:JH,relevance:0},gSt={begin:"\\.\\s*"+JH,relevance:0},bSt=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})};var T_=Object.freeze({__proto__:null,APOS_STRING_MODE:rSt,BACKSLASH_ESCAPE:CC,BINARY_NUMBER_MODE:fSt,BINARY_NUMBER_RE:iMe,COMMENT:CM,C_BLOCK_COMMENT_MODE:lSt,C_LINE_COMMENT_MODE:oSt,C_NUMBER_MODE:dSt,C_NUMBER_RE:nMe,END_SAME_AS_BEGIN:bSt,HASH_COMMENT_MODE:cSt,IDENT_RE:eMe,MATCH_NOTHING_RE:tSt,METHOD_GUARD:gSt,NUMBER_MODE:uSt,NUMBER_RE:tMe,PHRASAL_WORDS_MODE:aSt,QUOTE_STRING_MODE:sSt,REGEXP_MODE:hSt,RE_STARTERS_RE:nSt,SHEBANG:iSt,TITLE_MODE:pSt,UNDERSCORE_IDENT_RE:JH,UNDERSCORE_TITLE_MODE:mSt});function ySt(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function vSt(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function xSt(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=ySt,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function wSt(e,t){Array.isArray(e.illegal)&&(e.illegal=YH(...e.illegal))}function OSt(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function kSt(e,t){e.relevance===void 0&&(e.relevance=1)}const SSt=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(i=>{delete e[i]}),e.keywords=n.keywords,e.begin=J0(n.beforeMatch,ZDe(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},ESt=["of","and","for","in","not","or","if","then","parent","list","value"],CSt="keyword";function rMe(e,t,n=CSt){const i=Object.create(null);return typeof e=="string"?r(n,e.split(" ")):Array.isArray(e)?r(n,e):Object.keys(e).forEach(function(s){Object.assign(i,rMe(e[s],t,s))}),i;function r(s,o){t&&(o=o.map(l=>l.toLowerCase())),o.forEach(function(l){const c=l.split("|");i[c[0]]=[s,ASt(c[0],c[1])]})}}function ASt(e,t){return t?Number(t):TSt(e)?0:1}function TSt(e){return ESt.includes(e.toLowerCase())}const tne={},Yy=e=>{console.error(e)},nne=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Bv=(e,t)=>{tne[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),tne[`${e}/${t}`]=!0)},AI=new Error;function sMe(e,t,{key:n}){let i=0;const r=e[n],s={},o={};for(let l=1;l<=t.length;l++)o[l+i]=r[l],s[l+i]=!0,i+=JDe(t[l-1]);e[n]=o,e[n]._emit=s,e[n]._multi=!0}function _St(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Yy("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),AI;if(typeof e.beginScope!="object"||e.beginScope===null)throw Yy("beginScope must be object"),AI;sMe(e,e.begin,{key:"beginScope"}),e.begin=ZH(e.begin,{joinWith:""})}}function jSt(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Yy("skip, excludeEnd, returnEnd not compatible with endScope: {}"),AI;if(typeof e.endScope!="object"||e.endScope===null)throw Yy("endScope must be object"),AI;sMe(e,e.end,{key:"endScope"}),e.end=ZH(e.end,{joinWith:""})}}function NSt(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function RSt(e){NSt(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),_St(e),jSt(e)}function ISt(e){function t(o,l){return new RegExp(EC(o),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,l]),this.matchAt+=JDe(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(ZH(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;const c=this.matcherRe.exec(l);if(!c)return null;const u=c.findIndex((f,h)=>h>0&&f!==void 0),d=this.matchIndexes[u];return c.splice(0,u),Object.assign(c,d)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];const c=new n;return this.rules.slice(l).forEach(([u,d])=>c.addRule(u,d)),c.compile(),this.multiRegexes[l]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,c){this.rules.push([l,c]),c.type==="begin"&&this.count++}exec(l){const c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let u=c.exec(l);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,u=d.exec(l)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function r(o){const l=new i;return o.contains.forEach(c=>l.addRule(c.begin,{rule:c,type:"begin"})),o.terminatorEnd&&l.addRule(o.terminatorEnd,{type:"end"}),o.illegal&&l.addRule(o.illegal,{type:"illegal"}),l}function s(o,l){const c=o;if(o.isCompiled)return c;[vSt,OSt,RSt,SSt].forEach(d=>d(o,l)),e.compilerExtensions.forEach(d=>d(o,l)),o.__beforeBegin=null,[xSt,wSt,kSt].forEach(d=>d(o,l)),o.isCompiled=!0;let u=null;return typeof o.keywords=="object"&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),u=o.keywords.$pattern,delete o.keywords.$pattern),u=u||/\w+/,o.keywords&&(o.keywords=rMe(o.keywords,e.case_insensitive)),c.keywordPatternRe=t(u,!0),l&&(o.begin||(o.begin=/\B|\b/),c.beginRe=t(c.begin),!o.end&&!o.endsWithParent&&(o.end=/\B|\b/),o.end&&(c.endRe=t(c.end)),c.terminatorEnd=EC(c.end)||"",o.endsWithParent&&l.terminatorEnd&&(c.terminatorEnd+=(o.end?"|":"")+l.terminatorEnd)),o.illegal&&(c.illegalRe=t(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map(function(d){return PSt(d==="self"?o:d)})),o.contains.forEach(function(d){s(d,c)}),o.starts&&s(o.starts,l),c.matcher=r(c),c}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=yg(e.classNameAliases||{}),s(e)}function aMe(e){return e?e.endsWithParent||aMe(e.starts):!1}function PSt(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return yg(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:aMe(e)?yg(e,{starts:e.starts?yg(e.starts):null}):Object.isFrozen(e)?yg(e):e}var DSt="11.11.1";class MSt extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const _4=YDe,ine=yg,rne=Symbol("nomatch"),LSt=7,oMe=function(e){const t=Object.create(null),n=Object.create(null),i=[];let r=!0;const s="Could not find the language '{}', did you forget to load/include a language module?",o={disableAutodetect:!0,name:"Plain text",contains:[]};let l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Gkt};function c(P){return l.noHighlightRe.test(P)}function u(P){let _=P.className+" ";_+=P.parentNode?P.parentNode.className:"";const L=l.languageDetectRe.exec(_);if(L){const F=E(L[1]);return F||(nne(s.replace("{}",L[1])),nne("Falling back to no-highlight mode for this block.",P)),F?L[1]:"no-highlight"}return _.split(/\s+/).find(F=>c(F)||E(F))}function d(P,_,L){let F="",M="";typeof _=="object"?(F=P,L=_.ignoreIllegals,M=_.language):(Bv("10.7.0","highlight(lang, code, ...args) has been deprecated."),Bv("10.7.0",`Please use highlight(code, options) instead. +https://github.com/highlightjs/highlight.js/issues/2277`),M=P,F=_),L===void 0&&(L=!0);const V={code:F,language:M};D("before:highlight",V);const q=V.result?V.result:f(V.language,V.code,L);return q.code=V.code,D("after:highlight",q),q}function f(P,_,L,F){const M=Object.create(null);function V(ce,ve){return ce.keywords[ve]}function q(){if(!ge.keywords){xe.addText(Ne);return}let ce=0;ge.keywordPatternRe.lastIndex=0;let ve=ge.keywordPatternRe.exec(Ne),Se="";for(;ve;){Se+=Ne.substring(ce,ve.index);const oe=J.case_insensitive?ve[0].toLowerCase():ve[0],$e=V(ge,oe);if($e){const[Ue,me]=$e;if(xe.addText(Se),Se="",M[oe]=(M[oe]||0)+1,M[oe]<=LSt&&(We+=me),Ue.startsWith("_"))Se+=ve[0];else{const ke=J.classNameAliases[Ue]||Ue;z(ve[0],ke)}}else Se+=ve[0];ce=ge.keywordPatternRe.lastIndex,ve=ge.keywordPatternRe.exec(Ne)}Se+=Ne.substring(ce),xe.addText(Se)}function U(){if(Ne==="")return;let ce=null;if(typeof ge.subLanguage=="string"){if(!t[ge.subLanguage]){xe.addText(Ne);return}ce=f(ge.subLanguage,Ne,!0,Ee[ge.subLanguage]),Ee[ge.subLanguage]=ce._top}else ce=m(Ne,ge.subLanguage.length?ge.subLanguage:null);ge.relevance>0&&(We+=ce.relevance),xe.__addSublanguage(ce._emitter,ce.language)}function Z(){ge.subLanguage!=null?U():q(),Ne=""}function z(ce,ve){ce!==""&&(xe.startScope(ve),xe.addText(ce),xe.endScope())}function ee(ce,ve){let Se=1;const oe=ve.length-1;for(;Se<=oe;){if(!ce._emit[Se]){Se++;continue}const $e=J.classNameAliases[ce[Se]]||ce[Se],Ue=ve[Se];$e?z(Ue,$e):(Ne=Ue,q(),Ne=""),Se++}}function ne(ce,ve){return ce.scope&&typeof ce.scope=="string"&&xe.openNode(J.classNameAliases[ce.scope]||ce.scope),ce.beginScope&&(ce.beginScope._wrap?(z(Ne,J.classNameAliases[ce.beginScope._wrap]||ce.beginScope._wrap),Ne=""):ce.beginScope._multi&&(ee(ce.beginScope,ve),Ne="")),ge=Object.create(ce,{parent:{value:ge}}),ge}function W(ce,ve,Se){let oe=Jkt(ce.endRe,Se);if(oe){if(ce["on:end"]){const $e=new Zte(ce);ce["on:end"](ve,$e),$e.isMatchIgnored&&(oe=!1)}if(oe){for(;ce.endsParent&&ce.parent;)ce=ce.parent;return ce}}if(ce.endsWithParent)return W(ce.parent,ve,Se)}function X(ce){return ge.matcher.regexIndex===0?(Ne+=ce[0],1):(se=!0,0)}function H(ce){const ve=ce[0],Se=ce.rule,oe=new Zte(Se),$e=[Se.__beforeBegin,Se["on:begin"]];for(const Ue of $e)if(Ue&&(Ue(ce,oe),oe.isMatchIgnored))return X(ve);return Se.skip?Ne+=ve:(Se.excludeBegin&&(Ne+=ve),Z(),!Se.returnBegin&&!Se.excludeBegin&&(Ne=ve)),ne(Se,ce),Se.returnBegin?0:ve.length}function ae(ce){const ve=ce[0],Se=_.substring(ce.index),oe=W(ge,ce,Se);if(!oe)return rne;const $e=ge;ge.endScope&&ge.endScope._wrap?(Z(),z(ve,ge.endScope._wrap)):ge.endScope&&ge.endScope._multi?(Z(),ee(ge.endScope,ce)):$e.skip?Ne+=ve:($e.returnEnd||$e.excludeEnd||(Ne+=ve),Z(),$e.excludeEnd&&(Ne=ve));do ge.scope&&xe.closeNode(),!ge.skip&&!ge.subLanguage&&(We+=ge.relevance),ge=ge.parent;while(ge!==oe.parent);return oe.starts&&ne(oe.starts,ce),$e.returnEnd?0:ve.length}function Y(){const ce=[];for(let ve=ge;ve!==J;ve=ve.parent)ve.scope&&ce.unshift(ve.scope);ce.forEach(ve=>xe.openNode(ve))}let K={};function ie(ce,ve){const Se=ve&&ve[0];if(Ne+=ce,Se==null)return Z(),0;if(K.type==="begin"&&ve.type==="end"&&K.index===ve.index&&Se===""){if(Ne+=_.slice(ve.index,ve.index+1),!r){const oe=new Error(`0 width match regex (${P})`);throw oe.languageName=P,oe.badRule=K.rule,oe}return 1}if(K=ve,ve.type==="begin")return H(ve);if(ve.type==="illegal"&&!L){const oe=new Error('Illegal lexeme "'+Se+'" for mode "'+(ge.scope||"")+'"');throw oe.mode=ge,oe}else if(ve.type==="end"){const oe=ae(ve);if(oe!==rne)return oe}if(ve.type==="illegal"&&Se==="")return Ne+=` +`,1;if(Re>1e5&&Re>ve.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Ne+=Se,Se.length}const J=E(P);if(!J)throw Yy(s.replace("{}",P)),new Error('Unknown language: "'+P+'"');const ye=ISt(J);let de="",ge=F||ye;const Ee={},xe=new l.__emitter(l);Y();let Ne="",We=0,Xe=0,Re=0,se=!1;try{if(J.__emitTokens)J.__emitTokens(_,xe);else{for(ge.matcher.considerAll();;){Re++,se?se=!1:ge.matcher.considerAll(),ge.matcher.lastIndex=Xe;const ce=ge.matcher.exec(_);if(!ce)break;const ve=_.substring(Xe,ce.index),Se=ie(ve,ce);Xe=ce.index+Se}ie(_.substring(Xe))}return xe.finalize(),de=xe.toHTML(),{language:P,value:de,relevance:We,illegal:!1,_emitter:xe,_top:ge}}catch(ce){if(ce.message&&ce.message.includes("Illegal"))return{language:P,value:_4(_),illegal:!0,relevance:0,_illegalBy:{message:ce.message,index:Xe,context:_.slice(Xe-100,Xe+100),mode:ce.mode,resultSoFar:de},_emitter:xe};if(r)return{language:P,value:_4(_),illegal:!1,relevance:0,errorRaised:ce,_emitter:xe,_top:ge};throw ce}}function h(P){const _={value:_4(P),illegal:!1,relevance:0,_top:o,_emitter:new l.__emitter(l)};return _._emitter.addText(P),_}function m(P,_){_=_||l.languages||Object.keys(t);const L=h(P),F=_.filter(E).filter(T).map(Z=>f(Z,P,!1));F.unshift(L);const M=F.sort((Z,z)=>{if(Z.relevance!==z.relevance)return z.relevance-Z.relevance;if(Z.language&&z.language){if(E(Z.language).supersetOf===z.language)return 1;if(E(z.language).supersetOf===Z.language)return-1}return 0}),[V,q]=M,U=V;return U.secondBest=q,U}function g(P,_,L){const F=_&&n[_]||L;P.classList.add("hljs"),P.classList.add(`language-${F}`)}function b(P){let _=null;const L=u(P);if(c(L))return;if(D("before:highlightElement",{el:P,language:L}),P.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",P);return}if(P.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(P)),l.throwUnescapedHTML))throw new MSt("One of your code blocks includes unescaped HTML.",P.innerHTML);_=P;const F=_.textContent,M=L?d(F,{language:L,ignoreIllegals:!0}):m(F);P.innerHTML=M.value,P.dataset.highlighted="yes",g(P,L,M.language),P.result={language:M.language,re:M.relevance,relevance:M.relevance},M.secondBest&&(P.secondBest={language:M.secondBest.language,relevance:M.secondBest.relevance}),D("after:highlightElement",{el:P,result:M,text:F})}function v(P){l=ine(l,P)}const y=()=>{O(),Bv("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function w(){O(),Bv("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let x=!1;function O(){function P(){O()}if(document.readyState==="loading"){x||window.addEventListener("DOMContentLoaded",P,!1),x=!0;return}document.querySelectorAll(l.cssSelector).forEach(b)}function k(P,_){let L=null;try{L=_(e)}catch(F){if(Yy("Language definition for '{}' could not be registered.".replace("{}",P)),r)Yy(F);else throw F;L=o}L.name||(L.name=P),t[P]=L,L.rawDefinition=_.bind(null,e),L.aliases&&j(L.aliases,{languageName:P})}function S(P){delete t[P];for(const _ of Object.keys(n))n[_]===P&&delete n[_]}function C(){return Object.keys(t)}function E(P){return P=(P||"").toLowerCase(),t[P]||t[n[P]]}function j(P,{languageName:_}){typeof P=="string"&&(P=[P]),P.forEach(L=>{n[L.toLowerCase()]=_})}function T(P){const _=E(P);return _&&!_.disableAutodetect}function R(P){P["before:highlightBlock"]&&!P["before:highlightElement"]&&(P["before:highlightElement"]=_=>{P["before:highlightBlock"](Object.assign({block:_.el},_))}),P["after:highlightBlock"]&&!P["after:highlightElement"]&&(P["after:highlightElement"]=_=>{P["after:highlightBlock"](Object.assign({block:_.el},_))})}function A(P){R(P),i.push(P)}function N(P){const _=i.indexOf(P);_!==-1&&i.splice(_,1)}function D(P,_){const L=P;i.forEach(function(F){F[L]&&F[L](_)})}function I(P){return Bv("10.7.0","highlightBlock will be removed entirely in v12.0"),Bv("10.7.0","Please use highlightElement now."),b(P)}Object.assign(e,{highlight:d,highlightAuto:m,highlightAll:O,highlightElement:b,highlightBlock:I,configure:v,initHighlighting:y,initHighlightingOnLoad:w,registerLanguage:k,unregisterLanguage:S,listLanguages:C,getLanguage:E,registerAliases:j,autoDetection:T,inherit:ine,addPlugin:A,removePlugin:N}),e.debugMode=function(){r=!1},e.safeMode=function(){r=!0},e.versionString=DSt,e.regex={concat:J0,lookahead:ZDe,either:YH,optional:Ykt,anyNumberOfTimes:Xkt};for(const P in T_)typeof T_[P]=="object"&&XDe(T_[P]);return Object.assign(e,T_),e},s1=oMe({});s1.newInstance=()=>oMe({});var $St=s1;s1.HighlightJS=s1;s1.default=s1;const al=_1($St),sne={},FSt="hljs-";function BSt(e){const t=al.newInstance();return e&&s(e),{highlight:n,highlightAuto:i,listLanguages:r,register:s,registerAlias:o,registered:l};function n(c,u,d){const f=d||sne,h=typeof f.prefix=="string"?f.prefix:FSt;if(!t.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");t.configure({__emitter:USt,classPrefix:h});const m=t.highlight(u,{ignoreIllegals:!0,language:c});if(m.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:m.errorRaised});const g=m._emitter.root,b=g.data;return b.language=m.language,b.relevance=m.relevance,g}function i(c,u){const f=(u||sne).subset||r();let h=-1,m=0,g;for(;++hm&&(m=v.data.relevance,g=v)}return g||{type:"root",children:[],data:{language:void 0,relevance:m}}}function r(){return t.listLanguages()}function s(c,u){if(typeof c=="string")t.registerLanguage(c,u);else{let d;for(d in c)Object.hasOwn(c,d)&&t.registerLanguage(d,c[d])}}function o(c,u){if(typeof c=="string")t.registerAliases(typeof u=="string"?u:[...u],{languageName:c});else{let d;for(d in c)if(Object.hasOwn(c,d)){const f=c[d];t.registerAliases(typeof f=="string"?f:[...f],{languageName:d})}}}function l(c){return!!t.getLanguage(c)}}class USt{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],i=n.children[n.children.length-1];i&&i.type==="text"?i.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const i=this.stack[this.stack.length-1],r=t.root.children;n?i.children.push({type:"element",tagName:"span",properties:{className:[n]},children:r}):i.children.push(...r)}openNode(t){const n=this,i=t.split(".").map(function(o,l){return l?o+"_".repeat(l):n.options.classPrefix+o}),r=this.stack[this.stack.length-1],s={type:"element",tagName:"span",properties:{className:i},children:[]};r.children.push(s),this.stack.push(s)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const QSt={};function ane(e){const t=e||QSt,n=t.aliases,i=t.detect||!1,r=t.languages||Hkt,s=t.plainText,o=t.prefix,l=t.subset;let c="hljs";const u=BSt(r);if(n&&u.registerAlias(n),o){const d=o.indexOf("-");c=d===-1?o:o.slice(0,d)}return function(d,f){mT(d,"element",function(h,m,g){if(h.tagName!=="code"||!g||g.type!=="element"||g.tagName!=="pre")return;const b=zSt(h);if(b===!1||!b&&!i||b&&s&&s.includes(b))return;Array.isArray(h.properties.className)||(h.properties.className=[]),h.properties.className.includes(c)||h.properties.className.unshift(c);const v=MOt(h,{whitespace:"pre"});let y;try{y=b?u.highlight(b,v,{prefix:o}):u.highlightAuto(v,{prefix:o,subset:l})}catch(w){const x=w;if(b&&/Unknown language/.test(x.message)){f.message("Cannot highlight as `"+b+"`, it’s not registered",{ancestors:[g,h],cause:x,place:h.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw x}!b&&y.data&&y.data.language&&h.properties.className.push("language-"+y.data.language),y.children.length>0&&(h.children=y.children)})}}function zSt(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let i;for(;++n-1&&s<=t.length){let o=0;for(;;){let l=n[o];if(l===void 0){const c=cne(t,n[o-1]);l=c===-1?t.length+1:c+1,n[o]=l}if(l>s)return{line:o+1,column:s-(o>0?n[o-1]:0)+1,offset:s};o++}}}function r(s){if(s&&typeof s.line=="number"&&typeof s.column=="number"&&!Number.isNaN(s.line)&&!Number.isNaN(s.column)){for(;n.length1?n[s.line-2]:0)+s.column-1;if(o=55296&&e<=57343}function mEt(e){return e>=56320&&e<=57343}function gEt(e,t){return(e-55296)*1024+9216+t}function hMe(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function pMe(e){return e>=64976&&e<=65007||pEt.has(e)}var dt;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(dt||(dt={}));const bEt=65536;class yEt{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=bEt,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:i,col:r,offset:s}=this,o=r+n,l=s+n;return{code:t,startLine:i,endLine:i,startCol:o,endCol:o,startOffset:l,endOffset:l}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(mEt(n))return this.pos++,this._addGap(),gEt(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,Oe.EOF;return this._err(dt.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let i=0;i=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,Oe.EOF;const i=this.html.charCodeAt(n);return i===Oe.CARRIAGE_RETURN?Oe.LINE_FEED:i}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,Oe.EOF;let t=this.html.charCodeAt(this.pos);return t===Oe.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,Oe.LINE_FEED):t===Oe.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,fMe(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===Oe.LINE_FEED||t===Oe.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){hMe(t)?this._err(dt.controlCharacterInInputStream):pMe(t)&&this._err(dt.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const vEt=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),xEt=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function wEt(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=xEt.get(e))!==null&&t!==void 0?t:e}var _o;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(_o||(_o={}));const OEt=32;var vg;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(vg||(vg={}));function ZB(e){return e>=_o.ZERO&&e<=_o.NINE}function kEt(e){return e>=_o.UPPER_A&&e<=_o.UPPER_F||e>=_o.LOWER_A&&e<=_o.LOWER_F}function SEt(e){return e>=_o.UPPER_A&&e<=_o.UPPER_Z||e>=_o.LOWER_A&&e<=_o.LOWER_Z||ZB(e)}function EEt(e){return e===_o.EQUALS||SEt(e)}var Oo;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Oo||(Oo={}));var vp;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(vp||(vp={}));class CEt{constructor(t,n,i){this.decodeTree=t,this.emitCodePoint=n,this.errors=i,this.state=Oo.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=vp.Strict}startEntity(t){this.decodeMode=t,this.state=Oo.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Oo.EntityStart:return t.charCodeAt(n)===_o.NUM?(this.state=Oo.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Oo.NamedEntity,this.stateNamedEntity(t,n));case Oo.NumericStart:return this.stateNumericStart(t,n);case Oo.NumericDecimal:return this.stateNumericDecimal(t,n);case Oo.NumericHex:return this.stateNumericHex(t,n);case Oo.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|OEt)===_o.LOWER_X?(this.state=Oo.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Oo.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,i,r){if(n!==i){const s=i-n;this.result=this.result*Math.pow(r,s)+Number.parseInt(t.substr(n,s),r),this.consumed+=s}}stateNumericHex(t,n){const i=n;for(;n>14;for(;n>14,s!==0){if(o===_o.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==vp.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:i}=this,r=(i[n]&vg.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,r,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,i){const{decodeTree:r}=this;return this.emitCodePoint(n===1?r[t]&~vg.VALUE_LENGTH:r[t+1],i),n===3&&this.emitCodePoint(r[t+2],i),i}end(){var t;switch(this.state){case Oo.NamedEntity:return this.result!==0&&(this.decodeMode!==vp.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Oo.NumericDecimal:return this.emitNumericEntity(0,2);case Oo.NumericHex:return this.emitNumericEntity(0,3);case Oo.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Oo.EntityStart:return 0}}}function AEt(e,t,n,i){const r=(t&vg.BRANCH_LENGTH)>>7,s=t&vg.JUMP_TABLE;if(r===0)return s!==0&&i===s?n:-1;if(s){const c=i-s;return c<0||c>=r?-1:e[n+c]-1}let o=n,l=o+r-1;for(;o<=l;){const c=o+l>>>1,u=e[c];if(ui)l=c-1;else return e[c+r]}return-1}var Rt;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(Rt||(Rt={}));var Zy;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(Zy||(Zy={}));var rd;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(rd||(rd={}));var Je;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(Je||(Je={}));var B;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(B||(B={}));const TEt=new Map([[Je.A,B.A],[Je.ADDRESS,B.ADDRESS],[Je.ANNOTATION_XML,B.ANNOTATION_XML],[Je.APPLET,B.APPLET],[Je.AREA,B.AREA],[Je.ARTICLE,B.ARTICLE],[Je.ASIDE,B.ASIDE],[Je.B,B.B],[Je.BASE,B.BASE],[Je.BASEFONT,B.BASEFONT],[Je.BGSOUND,B.BGSOUND],[Je.BIG,B.BIG],[Je.BLOCKQUOTE,B.BLOCKQUOTE],[Je.BODY,B.BODY],[Je.BR,B.BR],[Je.BUTTON,B.BUTTON],[Je.CAPTION,B.CAPTION],[Je.CENTER,B.CENTER],[Je.CODE,B.CODE],[Je.COL,B.COL],[Je.COLGROUP,B.COLGROUP],[Je.DD,B.DD],[Je.DESC,B.DESC],[Je.DETAILS,B.DETAILS],[Je.DIALOG,B.DIALOG],[Je.DIR,B.DIR],[Je.DIV,B.DIV],[Je.DL,B.DL],[Je.DT,B.DT],[Je.EM,B.EM],[Je.EMBED,B.EMBED],[Je.FIELDSET,B.FIELDSET],[Je.FIGCAPTION,B.FIGCAPTION],[Je.FIGURE,B.FIGURE],[Je.FONT,B.FONT],[Je.FOOTER,B.FOOTER],[Je.FOREIGN_OBJECT,B.FOREIGN_OBJECT],[Je.FORM,B.FORM],[Je.FRAME,B.FRAME],[Je.FRAMESET,B.FRAMESET],[Je.H1,B.H1],[Je.H2,B.H2],[Je.H3,B.H3],[Je.H4,B.H4],[Je.H5,B.H5],[Je.H6,B.H6],[Je.HEAD,B.HEAD],[Je.HEADER,B.HEADER],[Je.HGROUP,B.HGROUP],[Je.HR,B.HR],[Je.HTML,B.HTML],[Je.I,B.I],[Je.IMG,B.IMG],[Je.IMAGE,B.IMAGE],[Je.INPUT,B.INPUT],[Je.IFRAME,B.IFRAME],[Je.KEYGEN,B.KEYGEN],[Je.LABEL,B.LABEL],[Je.LI,B.LI],[Je.LINK,B.LINK],[Je.LISTING,B.LISTING],[Je.MAIN,B.MAIN],[Je.MALIGNMARK,B.MALIGNMARK],[Je.MARQUEE,B.MARQUEE],[Je.MATH,B.MATH],[Je.MENU,B.MENU],[Je.META,B.META],[Je.MGLYPH,B.MGLYPH],[Je.MI,B.MI],[Je.MO,B.MO],[Je.MN,B.MN],[Je.MS,B.MS],[Je.MTEXT,B.MTEXT],[Je.NAV,B.NAV],[Je.NOBR,B.NOBR],[Je.NOFRAMES,B.NOFRAMES],[Je.NOEMBED,B.NOEMBED],[Je.NOSCRIPT,B.NOSCRIPT],[Je.OBJECT,B.OBJECT],[Je.OL,B.OL],[Je.OPTGROUP,B.OPTGROUP],[Je.OPTION,B.OPTION],[Je.P,B.P],[Je.PARAM,B.PARAM],[Je.PLAINTEXT,B.PLAINTEXT],[Je.PRE,B.PRE],[Je.RB,B.RB],[Je.RP,B.RP],[Je.RT,B.RT],[Je.RTC,B.RTC],[Je.RUBY,B.RUBY],[Je.S,B.S],[Je.SCRIPT,B.SCRIPT],[Je.SEARCH,B.SEARCH],[Je.SECTION,B.SECTION],[Je.SELECT,B.SELECT],[Je.SOURCE,B.SOURCE],[Je.SMALL,B.SMALL],[Je.SPAN,B.SPAN],[Je.STRIKE,B.STRIKE],[Je.STRONG,B.STRONG],[Je.STYLE,B.STYLE],[Je.SUB,B.SUB],[Je.SUMMARY,B.SUMMARY],[Je.SUP,B.SUP],[Je.TABLE,B.TABLE],[Je.TBODY,B.TBODY],[Je.TEMPLATE,B.TEMPLATE],[Je.TEXTAREA,B.TEXTAREA],[Je.TFOOT,B.TFOOT],[Je.TD,B.TD],[Je.TH,B.TH],[Je.THEAD,B.THEAD],[Je.TITLE,B.TITLE],[Je.TR,B.TR],[Je.TRACK,B.TRACK],[Je.TT,B.TT],[Je.U,B.U],[Je.UL,B.UL],[Je.SVG,B.SVG],[Je.VAR,B.VAR],[Je.WBR,B.WBR],[Je.XMP,B.XMP]]);function sO(e){var t;return(t=TEt.get(e))!==null&&t!==void 0?t:B.UNKNOWN}const Mt=B,_Et={[Rt.HTML]:new Set([Mt.ADDRESS,Mt.APPLET,Mt.AREA,Mt.ARTICLE,Mt.ASIDE,Mt.BASE,Mt.BASEFONT,Mt.BGSOUND,Mt.BLOCKQUOTE,Mt.BODY,Mt.BR,Mt.BUTTON,Mt.CAPTION,Mt.CENTER,Mt.COL,Mt.COLGROUP,Mt.DD,Mt.DETAILS,Mt.DIR,Mt.DIV,Mt.DL,Mt.DT,Mt.EMBED,Mt.FIELDSET,Mt.FIGCAPTION,Mt.FIGURE,Mt.FOOTER,Mt.FORM,Mt.FRAME,Mt.FRAMESET,Mt.H1,Mt.H2,Mt.H3,Mt.H4,Mt.H5,Mt.H6,Mt.HEAD,Mt.HEADER,Mt.HGROUP,Mt.HR,Mt.HTML,Mt.IFRAME,Mt.IMG,Mt.INPUT,Mt.LI,Mt.LINK,Mt.LISTING,Mt.MAIN,Mt.MARQUEE,Mt.MENU,Mt.META,Mt.NAV,Mt.NOEMBED,Mt.NOFRAMES,Mt.NOSCRIPT,Mt.OBJECT,Mt.OL,Mt.P,Mt.PARAM,Mt.PLAINTEXT,Mt.PRE,Mt.SCRIPT,Mt.SECTION,Mt.SELECT,Mt.SOURCE,Mt.STYLE,Mt.SUMMARY,Mt.TABLE,Mt.TBODY,Mt.TD,Mt.TEMPLATE,Mt.TEXTAREA,Mt.TFOOT,Mt.TH,Mt.THEAD,Mt.TITLE,Mt.TR,Mt.TRACK,Mt.UL,Mt.WBR,Mt.XMP]),[Rt.MATHML]:new Set([Mt.MI,Mt.MO,Mt.MN,Mt.MS,Mt.MTEXT,Mt.ANNOTATION_XML]),[Rt.SVG]:new Set([Mt.TITLE,Mt.FOREIGN_OBJECT,Mt.DESC]),[Rt.XLINK]:new Set,[Rt.XML]:new Set,[Rt.XMLNS]:new Set},JB=new Set([Mt.H1,Mt.H2,Mt.H3,Mt.H4,Mt.H5,Mt.H6]);Je.STYLE,Je.SCRIPT,Je.XMP,Je.IFRAME,Je.NOEMBED,Je.NOFRAMES,Je.PLAINTEXT;var Ce;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(Ce||(Ce={}));const Ea={DATA:Ce.DATA,RCDATA:Ce.RCDATA,RAWTEXT:Ce.RAWTEXT,SCRIPT_DATA:Ce.SCRIPT_DATA,PLAINTEXT:Ce.PLAINTEXT,CDATA_SECTION:Ce.CDATA_SECTION};function jEt(e){return e>=Oe.DIGIT_0&&e<=Oe.DIGIT_9}function hS(e){return e>=Oe.LATIN_CAPITAL_A&&e<=Oe.LATIN_CAPITAL_Z}function NEt(e){return e>=Oe.LATIN_SMALL_A&&e<=Oe.LATIN_SMALL_Z}function Vm(e){return NEt(e)||hS(e)}function dne(e){return Vm(e)||jEt(e)}function __(e){return e+32}function gMe(e){return e===Oe.SPACE||e===Oe.LINE_FEED||e===Oe.TABULATION||e===Oe.FORM_FEED}function fne(e){return gMe(e)||e===Oe.SOLIDUS||e===Oe.GREATER_THAN_SIGN}function REt(e){return e===Oe.NULL?dt.nullCharacterReference:e>1114111?dt.characterReferenceOutsideUnicodeRange:fMe(e)?dt.surrogateCharacterReference:pMe(e)?dt.noncharacterCharacterReference:hMe(e)||e===Oe.CARRIAGE_RETURN?dt.controlCharacterReference:null}class IEt{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=Ce.DATA,this.returnState=Ce.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new yEt(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new CEt(vEt,(i,r)=>{this.preprocessor.pos=this.entityStartPos+r-1,this._flushCodePointConsumedAsCharacterReference(i)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(dt.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:i=>{this._err(dt.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+i)},validateNumericCharacterReference:i=>{const r=REt(i);r&&this._err(r,1)}}:void 0)}_err(t,n=0){var i,r;(r=(i=this.handler).onParseError)===null||r===void 0||r.call(i,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==null||t())}write(t,n,i){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||i==null||i()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n0&&this._err(dt.endTagWithAttributes),t.selfClosing&&this._err(dt.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case Fi.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Fi.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Fi.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:Fi.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=gMe(t)?Fi.WHITESPACE_CHARACTER:t===Oe.NULL?Fi.NULL_CHARACTER:Fi.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(Fi.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=Ce.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?vp.Attribute:vp.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===Ce.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===Ce.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===Ce.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case Ce.DATA:{this._stateData(t);break}case Ce.RCDATA:{this._stateRcdata(t);break}case Ce.RAWTEXT:{this._stateRawtext(t);break}case Ce.SCRIPT_DATA:{this._stateScriptData(t);break}case Ce.PLAINTEXT:{this._statePlaintext(t);break}case Ce.TAG_OPEN:{this._stateTagOpen(t);break}case Ce.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case Ce.TAG_NAME:{this._stateTagName(t);break}case Ce.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case Ce.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case Ce.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case Ce.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case Ce.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case Ce.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case Ce.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case Ce.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case Ce.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case Ce.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case Ce.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case Ce.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case Ce.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case Ce.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case Ce.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case Ce.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case Ce.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case Ce.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case Ce.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case Ce.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case Ce.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case Ce.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case Ce.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case Ce.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case Ce.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case Ce.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case Ce.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case Ce.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case Ce.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case Ce.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case Ce.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case Ce.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case Ce.BOGUS_COMMENT:{this._stateBogusComment(t);break}case Ce.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case Ce.COMMENT_START:{this._stateCommentStart(t);break}case Ce.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case Ce.COMMENT:{this._stateComment(t);break}case Ce.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case Ce.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case Ce.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case Ce.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case Ce.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case Ce.COMMENT_END:{this._stateCommentEnd(t);break}case Ce.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case Ce.DOCTYPE:{this._stateDoctype(t);break}case Ce.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case Ce.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case Ce.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case Ce.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case Ce.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case Ce.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case Ce.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case Ce.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case Ce.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case Ce.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case Ce.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case Ce.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case Ce.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case Ce.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case Ce.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case Ce.CDATA_SECTION:{this._stateCdataSection(t);break}case Ce.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case Ce.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case Ce.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case Ce.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case Oe.LESS_THAN_SIGN:{this.state=Ce.TAG_OPEN;break}case Oe.AMPERSAND:{this._startCharacterReference();break}case Oe.NULL:{this._err(dt.unexpectedNullCharacter),this._emitCodePoint(t);break}case Oe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case Oe.AMPERSAND:{this._startCharacterReference();break}case Oe.LESS_THAN_SIGN:{this.state=Ce.RCDATA_LESS_THAN_SIGN;break}case Oe.NULL:{this._err(dt.unexpectedNullCharacter),this._emitChars(Fs);break}case Oe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case Oe.LESS_THAN_SIGN:{this.state=Ce.RAWTEXT_LESS_THAN_SIGN;break}case Oe.NULL:{this._err(dt.unexpectedNullCharacter),this._emitChars(Fs);break}case Oe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case Oe.LESS_THAN_SIGN:{this.state=Ce.SCRIPT_DATA_LESS_THAN_SIGN;break}case Oe.NULL:{this._err(dt.unexpectedNullCharacter),this._emitChars(Fs);break}case Oe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case Oe.NULL:{this._err(dt.unexpectedNullCharacter),this._emitChars(Fs);break}case Oe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(Vm(t))this._createStartTagToken(),this.state=Ce.TAG_NAME,this._stateTagName(t);else switch(t){case Oe.EXCLAMATION_MARK:{this.state=Ce.MARKUP_DECLARATION_OPEN;break}case Oe.SOLIDUS:{this.state=Ce.END_TAG_OPEN;break}case Oe.QUESTION_MARK:{this._err(dt.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=Ce.BOGUS_COMMENT,this._stateBogusComment(t);break}case Oe.EOF:{this._err(dt.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(dt.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=Ce.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(Vm(t))this._createEndTagToken(),this.state=Ce.TAG_NAME,this._stateTagName(t);else switch(t){case Oe.GREATER_THAN_SIGN:{this._err(dt.missingEndTagName),this.state=Ce.DATA;break}case Oe.EOF:{this._err(dt.eofBeforeTagName),this._emitChars("");break}case Oe.NULL:{this._err(dt.unexpectedNullCharacter),this.state=Ce.SCRIPT_DATA_ESCAPED,this._emitChars(Fs);break}case Oe.EOF:{this._err(dt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Ce.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===Oe.SOLIDUS?this.state=Ce.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Vm(t)?(this._emitChars("<"),this.state=Ce.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=Ce.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){Vm(t)?(this.state=Ce.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("");break}case Oe.NULL:{this._err(dt.unexpectedNullCharacter),this.state=Ce.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Fs);break}case Oe.EOF:{this._err(dt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Ce.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===Oe.SOLIDUS?(this.state=Ce.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=Ce.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(wc.SCRIPT,!1)&&fne(this.preprocessor.peek(wc.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const i=this._indexOf(t);this.items[i]=n,i===this.stackTop&&(this.current=n)}insertAfter(t,n,i){const r=this._indexOf(t)+1;this.items.splice(r,0,n),this.tagIDs.splice(r,0,i),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==Rt.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop=0;i--)if(t.has(this.tagIDs[i])&&this.treeAdapter.getNamespaceURI(this.items[i])===n)return i;return-1}clearBackTo(t,n){const i=this._indexOfTagNames(t,n);this.shortenToLength(i+1)}clearBackToTableContext(){this.clearBackTo($Et,Rt.HTML)}clearBackToTableBodyContext(){this.clearBackTo(LEt,Rt.HTML)}clearBackToTableRowContext(){this.clearBackTo(MEt,Rt.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===B.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===B.HTML}hasInDynamicScope(t,n){for(let i=this.stackTop;i>=0;i--){const r=this.tagIDs[i];switch(this.treeAdapter.getNamespaceURI(this.items[i])){case Rt.HTML:{if(r===t)return!0;if(n.has(r))return!1;break}case Rt.SVG:{if(mne.has(r))return!1;break}case Rt.MATHML:{if(pne.has(r))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,TI)}hasInListItemScope(t){return this.hasInDynamicScope(t,PEt)}hasInButtonScope(t){return this.hasInDynamicScope(t,DEt)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case Rt.HTML:{if(JB.has(n))return!0;if(TI.has(n))return!1;break}case Rt.SVG:{if(mne.has(n))return!1;break}case Rt.MATHML:{if(pne.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Rt.HTML)switch(this.tagIDs[n]){case t:return!0;case B.TABLE:case B.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===Rt.HTML)switch(this.tagIDs[t]){case B.TBODY:case B.THEAD:case B.TFOOT:return!0;case B.TABLE:case B.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Rt.HTML)switch(this.tagIDs[n]){case t:return!0;case B.OPTION:case B.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&bMe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&hne.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&hne.has(this.currentTagId);)this.pop()}}const j4=3;var Xf;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Xf||(Xf={}));const gne={type:Xf.Marker};class UEt{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const i=[],r=n.length,s=this.treeAdapter.getTagName(t),o=this.treeAdapter.getNamespaceURI(t);for(let l=0;l[o.name,o.value]));let s=0;for(let o=0;or.get(c.name)===c.value)&&(s+=1,s>=j4&&this.entries.splice(l.idx,1))}}insertMarker(){this.entries.unshift(gne)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Xf.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const i=this.entries.indexOf(this.bookmark);this.entries.splice(i,0,{type:Xf.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(gne);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(i=>i.type===Xf.Marker||this.treeAdapter.getTagName(i.element)===t);return n&&n.type===Xf.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Xf.Element&&n.element===t)}}const Hm={createDocument(){return{nodeName:"#document",mode:rd.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const i=e.childNodes.indexOf(n);e.childNodes.splice(i,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,i){const r=e.childNodes.find(s=>s.nodeName==="#documentType");if(r)r.name=t,r.publicId=n,r.systemId=i;else{const s={nodeName:"#documentType",name:t,publicId:n,systemId:i,parentNode:null};Hm.appendChild(e,s)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(Hm.isTextNode(n)){n.value+=t;return}}Hm.appendChild(e,Hm.createTextNode(t))},insertTextBefore(e,t,n){const i=e.childNodes[e.childNodes.indexOf(n)-1];i&&Hm.isTextNode(i)?i.value+=t:Hm.insertBefore(e,Hm.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(i=>i.name));for(let i=0;ie.startsWith(n))}function WEt(e){return e.name===yMe&&e.publicId===null&&(e.systemId===null||e.systemId===QEt)}function KEt(e){if(e.name!==yMe)return rd.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===zEt)return rd.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),HEt.has(n))return rd.QUIRKS;let i=t===null?VEt:vMe;if(bne(n,i))return rd.QUIRKS;if(i=t===null?xMe:qEt,bne(n,i))return rd.LIMITED_QUIRKS}return rd.NO_QUIRKS}const yne={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},GEt="definitionurl",XEt="definitionURL",YEt=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),ZEt=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Rt.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Rt.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Rt.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Rt.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Rt.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Rt.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Rt.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Rt.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Rt.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Rt.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Rt.XMLNS}]]),JEt=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),eCt=new Set([B.B,B.BIG,B.BLOCKQUOTE,B.BODY,B.BR,B.CENTER,B.CODE,B.DD,B.DIV,B.DL,B.DT,B.EM,B.EMBED,B.H1,B.H2,B.H3,B.H4,B.H5,B.H6,B.HEAD,B.HR,B.I,B.IMG,B.LI,B.LISTING,B.MENU,B.META,B.NOBR,B.OL,B.P,B.PRE,B.RUBY,B.S,B.SMALL,B.SPAN,B.STRONG,B.STRIKE,B.SUB,B.SUP,B.TABLE,B.TT,B.U,B.UL,B.VAR]);function tCt(e){const t=e.tagID;return t===B.FONT&&e.attrs.some(({name:i})=>i===Zy.COLOR||i===Zy.SIZE||i===Zy.FACE)||eCt.has(t)}function wMe(e){for(let t=0;t0&&this._setContextModes(t,n)}onItemPop(t,n){var i,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(r=(i=this.treeAdapter).onItemPop)===null||r===void 0||r.call(i,t,this.openElements.current),n){let s,o;this.openElements.stackTop===0&&this.fragmentContext?(s=this.fragmentContext,o=this.fragmentContextID):{current:s,currentTagId:o}=this.openElements,this._setContextModes(s,o)}}_setContextModes(t,n){const i=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===Rt.HTML;this.currentNotInHTML=!i,this.tokenizer.inForeignNode=!i&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,Rt.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=Ie.TEXT}switchToPlaintextParsing(){this.insertionMode=Ie.TEXT,this.originalInsertionMode=Ie.IN_BODY,this.tokenizer.state=Ea.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===Je.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Rt.HTML))switch(this.fragmentContextID){case B.TITLE:case B.TEXTAREA:{this.tokenizer.state=Ea.RCDATA;break}case B.STYLE:case B.XMP:case B.IFRAME:case B.NOEMBED:case B.NOFRAMES:case B.NOSCRIPT:{this.tokenizer.state=Ea.RAWTEXT;break}case B.SCRIPT:{this.tokenizer.state=Ea.SCRIPT_DATA;break}case B.PLAINTEXT:{this.tokenizer.state=Ea.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",i=t.publicId||"",r=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,i,r),t.location){const o=this.treeAdapter.getChildNodes(this.document).find(l=>this.treeAdapter.isDocumentTypeNode(l));o&&this.treeAdapter.setNodeSourceCodeLocation(o,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const i=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,i)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const i=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(i??this.document,t)}}_appendElement(t,n){const i=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(i,t.location)}_insertElement(t,n){const i=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(i,t.location),this.openElements.push(i,t.tagID)}_insertFakeElement(t,n){const i=this.treeAdapter.createElement(t,Rt.HTML,[]);this._attachElementToTree(i,null),this.openElements.push(i,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,Rt.HTML,t.attrs),i=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,i),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(Je.HTML,Rt.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,B.HTML)}_appendCommentNode(t,n){const i=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,i),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,t.location)}_insertCharacters(t){let n,i;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:i}=this._findFosterParentingLocation(),i?this.treeAdapter.insertTextBefore(n,t.chars,i):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const r=this.treeAdapter.getChildNodes(n),s=i?r.lastIndexOf(i):r.length,o=r[s-1];if(this.treeAdapter.getNodeSourceCodeLocation(o)){const{endLine:c,endCol:u,endOffset:d}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(o,{endLine:c,endCol:u,endOffset:d})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(o,t.location)}_adoptNodes(t,n){for(let i=this.treeAdapter.getFirstChild(t);i;i=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(i),this.treeAdapter.appendChild(n,i)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const i=n.location,r=this.treeAdapter.getTagName(t),s=n.type===Fi.END_TAG&&r===n.tagName?{endTag:{...i},endLine:i.endLine,endCol:i.endCol,endOffset:i.endOffset}:{endLine:i.startLine,endCol:i.startCol,endOffset:i.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,s)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,i;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,i=this.fragmentContextID):{current:n,currentTagId:i}=this.openElements,t.tagID===B.SVG&&this.treeAdapter.getTagName(n)===Je.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===Rt.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===B.MGLYPH||t.tagID===B.MALIGNMARK)&&i!==void 0&&!this._isIntegrationPoint(i,n,Rt.HTML)}_processToken(t){switch(t.type){case Fi.CHARACTER:{this.onCharacter(t);break}case Fi.NULL_CHARACTER:{this.onNullCharacter(t);break}case Fi.COMMENT:{this.onComment(t);break}case Fi.DOCTYPE:{this.onDoctype(t);break}case Fi.START_TAG:{this._processStartTag(t);break}case Fi.END_TAG:{this.onEndTag(t);break}case Fi.EOF:{this.onEof(t);break}case Fi.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,i){const r=this.treeAdapter.getNamespaceURI(n),s=this.treeAdapter.getAttrList(n);return sCt(t,r,s,i)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(r=>r.type===Xf.Marker||this.openElements.contains(r.element)),i=n===-1?t-1:n-1;for(let r=i;r>=0;r--){const s=this.activeFormattingElements.entries[r];this._insertElement(s.token,this.treeAdapter.getNamespaceURI(s.element)),s.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=Ie.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(B.P),this.openElements.popUntilTagNamePopped(B.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case B.TR:{this.insertionMode=Ie.IN_ROW;return}case B.TBODY:case B.THEAD:case B.TFOOT:{this.insertionMode=Ie.IN_TABLE_BODY;return}case B.CAPTION:{this.insertionMode=Ie.IN_CAPTION;return}case B.COLGROUP:{this.insertionMode=Ie.IN_COLUMN_GROUP;return}case B.TABLE:{this.insertionMode=Ie.IN_TABLE;return}case B.BODY:{this.insertionMode=Ie.IN_BODY;return}case B.FRAMESET:{this.insertionMode=Ie.IN_FRAMESET;return}case B.SELECT:{this._resetInsertionModeForSelect(t);return}case B.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case B.HTML:{this.insertionMode=this.headElement?Ie.AFTER_HEAD:Ie.BEFORE_HEAD;return}case B.TD:case B.TH:{if(t>0){this.insertionMode=Ie.IN_CELL;return}break}case B.HEAD:{if(t>0){this.insertionMode=Ie.IN_HEAD;return}break}}this.insertionMode=Ie.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const i=this.openElements.tagIDs[n];if(i===B.TEMPLATE)break;if(i===B.TABLE){this.insertionMode=Ie.IN_SELECT_IN_TABLE;return}}this.insertionMode=Ie.IN_SELECT}_isElementCausesFosterParenting(t){return kMe.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case B.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===Rt.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case B.TABLE:{const i=this.treeAdapter.getParentNode(n);return i?{parent:i,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const i=this.treeAdapter.getNamespaceURI(t);return _Et[i].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){FAt(this,t);return}switch(this.insertionMode){case Ie.INITIAL:{vk(this,t);break}case Ie.BEFORE_HTML:{uE(this,t);break}case Ie.BEFORE_HEAD:{dE(this,t);break}case Ie.IN_HEAD:{fE(this,t);break}case Ie.IN_HEAD_NO_SCRIPT:{hE(this,t);break}case Ie.AFTER_HEAD:{pE(this,t);break}case Ie.IN_BODY:case Ie.IN_CAPTION:case Ie.IN_CELL:case Ie.IN_TEMPLATE:{EMe(this,t);break}case Ie.TEXT:case Ie.IN_SELECT:case Ie.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case Ie.IN_TABLE:case Ie.IN_TABLE_BODY:case Ie.IN_ROW:{N4(this,t);break}case Ie.IN_TABLE_TEXT:{NMe(this,t);break}case Ie.IN_COLUMN_GROUP:{_I(this,t);break}case Ie.AFTER_BODY:{jI(this,t);break}case Ie.AFTER_AFTER_BODY:{RN(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){$At(this,t);return}switch(this.insertionMode){case Ie.INITIAL:{vk(this,t);break}case Ie.BEFORE_HTML:{uE(this,t);break}case Ie.BEFORE_HEAD:{dE(this,t);break}case Ie.IN_HEAD:{fE(this,t);break}case Ie.IN_HEAD_NO_SCRIPT:{hE(this,t);break}case Ie.AFTER_HEAD:{pE(this,t);break}case Ie.TEXT:{this._insertCharacters(t);break}case Ie.IN_TABLE:case Ie.IN_TABLE_BODY:case Ie.IN_ROW:{N4(this,t);break}case Ie.IN_COLUMN_GROUP:{_I(this,t);break}case Ie.AFTER_BODY:{jI(this,t);break}case Ie.AFTER_AFTER_BODY:{RN(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){e9(this,t);return}switch(this.insertionMode){case Ie.INITIAL:case Ie.BEFORE_HTML:case Ie.BEFORE_HEAD:case Ie.IN_HEAD:case Ie.IN_HEAD_NO_SCRIPT:case Ie.AFTER_HEAD:case Ie.IN_BODY:case Ie.IN_TABLE:case Ie.IN_CAPTION:case Ie.IN_COLUMN_GROUP:case Ie.IN_TABLE_BODY:case Ie.IN_ROW:case Ie.IN_CELL:case Ie.IN_SELECT:case Ie.IN_SELECT_IN_TABLE:case Ie.IN_TEMPLATE:case Ie.IN_FRAMESET:case Ie.AFTER_FRAMESET:{e9(this,t);break}case Ie.IN_TABLE_TEXT:{xk(this,t);break}case Ie.AFTER_BODY:{gCt(this,t);break}case Ie.AFTER_AFTER_BODY:case Ie.AFTER_AFTER_FRAMESET:{bCt(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case Ie.INITIAL:{yCt(this,t);break}case Ie.BEFORE_HEAD:case Ie.IN_HEAD:case Ie.IN_HEAD_NO_SCRIPT:case Ie.AFTER_HEAD:{this._err(t,dt.misplacedDoctype);break}case Ie.IN_TABLE_TEXT:{xk(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,dt.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?BAt(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case Ie.INITIAL:{vk(this,t);break}case Ie.BEFORE_HTML:{vCt(this,t);break}case Ie.BEFORE_HEAD:{wCt(this,t);break}case Ie.IN_HEAD:{_f(this,t);break}case Ie.IN_HEAD_NO_SCRIPT:{SCt(this,t);break}case Ie.AFTER_HEAD:{CCt(this,t);break}case Ie.IN_BODY:{Rl(this,t);break}case Ie.IN_TABLE:{a1(this,t);break}case Ie.IN_TABLE_TEXT:{xk(this,t);break}case Ie.IN_CAPTION:{OAt(this,t);break}case Ie.IN_COLUMN_GROUP:{sq(this,t);break}case Ie.IN_TABLE_BODY:{_M(this,t);break}case Ie.IN_ROW:{jM(this,t);break}case Ie.IN_CELL:{EAt(this,t);break}case Ie.IN_SELECT:{PMe(this,t);break}case Ie.IN_SELECT_IN_TABLE:{AAt(this,t);break}case Ie.IN_TEMPLATE:{_At(this,t);break}case Ie.AFTER_BODY:{NAt(this,t);break}case Ie.IN_FRAMESET:{RAt(this,t);break}case Ie.AFTER_FRAMESET:{PAt(this,t);break}case Ie.AFTER_AFTER_BODY:{MAt(this,t);break}case Ie.AFTER_AFTER_FRAMESET:{LAt(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?UAt(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case Ie.INITIAL:{vk(this,t);break}case Ie.BEFORE_HTML:{xCt(this,t);break}case Ie.BEFORE_HEAD:{OCt(this,t);break}case Ie.IN_HEAD:{kCt(this,t);break}case Ie.IN_HEAD_NO_SCRIPT:{ECt(this,t);break}case Ie.AFTER_HEAD:{ACt(this,t);break}case Ie.IN_BODY:{TM(this,t);break}case Ie.TEXT:{fAt(this,t);break}case Ie.IN_TABLE:{AC(this,t);break}case Ie.IN_TABLE_TEXT:{xk(this,t);break}case Ie.IN_CAPTION:{kAt(this,t);break}case Ie.IN_COLUMN_GROUP:{SAt(this,t);break}case Ie.IN_TABLE_BODY:{t9(this,t);break}case Ie.IN_ROW:{IMe(this,t);break}case Ie.IN_CELL:{CAt(this,t);break}case Ie.IN_SELECT:{DMe(this,t);break}case Ie.IN_SELECT_IN_TABLE:{TAt(this,t);break}case Ie.IN_TEMPLATE:{jAt(this,t);break}case Ie.AFTER_BODY:{LMe(this,t);break}case Ie.IN_FRAMESET:{IAt(this,t);break}case Ie.AFTER_FRAMESET:{DAt(this,t);break}case Ie.AFTER_AFTER_BODY:{RN(this,t);break}}}onEof(t){switch(this.insertionMode){case Ie.INITIAL:{vk(this,t);break}case Ie.BEFORE_HTML:{uE(this,t);break}case Ie.BEFORE_HEAD:{dE(this,t);break}case Ie.IN_HEAD:{fE(this,t);break}case Ie.IN_HEAD_NO_SCRIPT:{hE(this,t);break}case Ie.AFTER_HEAD:{pE(this,t);break}case Ie.IN_BODY:case Ie.IN_TABLE:case Ie.IN_CAPTION:case Ie.IN_COLUMN_GROUP:case Ie.IN_TABLE_BODY:case Ie.IN_ROW:case Ie.IN_CELL:case Ie.IN_SELECT:case Ie.IN_SELECT_IN_TABLE:{_Me(this,t);break}case Ie.TEXT:{hAt(this,t);break}case Ie.IN_TABLE_TEXT:{xk(this,t);break}case Ie.IN_TEMPLATE:{MMe(this,t);break}case Ie.AFTER_BODY:case Ie.IN_FRAMESET:case Ie.AFTER_FRAMESET:case Ie.AFTER_AFTER_BODY:case Ie.AFTER_AFTER_FRAMESET:{rq(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===Oe.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case Ie.IN_HEAD:case Ie.IN_HEAD_NO_SCRIPT:case Ie.AFTER_HEAD:case Ie.TEXT:case Ie.IN_COLUMN_GROUP:case Ie.IN_SELECT:case Ie.IN_SELECT_IN_TABLE:case Ie.IN_FRAMESET:case Ie.AFTER_FRAMESET:{this._insertCharacters(t);break}case Ie.IN_BODY:case Ie.IN_CAPTION:case Ie.IN_CELL:case Ie.IN_TEMPLATE:case Ie.AFTER_BODY:case Ie.AFTER_AFTER_BODY:case Ie.AFTER_AFTER_FRAMESET:{SMe(this,t);break}case Ie.IN_TABLE:case Ie.IN_TABLE_BODY:case Ie.IN_ROW:{N4(this,t);break}case Ie.IN_TABLE_TEXT:{jMe(this,t);break}}}};function uCt(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):TMe(e,t),n}function dCt(e,t){let n=null,i=e.openElements.stackTop;for(;i>=0;i--){const r=e.openElements.items[i];if(r===t.element)break;e._isSpecialElement(r,e.openElements.tagIDs[i])&&(n=r)}return n||(e.openElements.shortenToLength(Math.max(i,0)),e.activeFormattingElements.removeEntry(t)),n}function fCt(e,t,n){let i=t,r=e.openElements.getCommonAncestor(t);for(let s=0,o=r;o!==n;s++,o=r){r=e.openElements.getCommonAncestor(o);const l=e.activeFormattingElements.getElementEntry(o),c=l&&s>=lCt;!l||c?(c&&e.activeFormattingElements.removeEntry(l),e.openElements.remove(o)):(o=hCt(e,l),i===t&&(e.activeFormattingElements.bookmark=l),e.treeAdapter.detachNode(i),e.treeAdapter.appendChild(o,i),i=o)}return i}function hCt(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),i=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,i),t.element=i,i}function pCt(e,t,n){const i=e.treeAdapter.getTagName(t),r=sO(i);if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{const s=e.treeAdapter.getNamespaceURI(t);r===B.TEMPLATE&&s===Rt.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function mCt(e,t,n){const i=e.treeAdapter.getNamespaceURI(n.element),{token:r}=n,s=e.treeAdapter.createElement(r.tagName,i,r.attrs);e._adoptNodes(t,s),e.treeAdapter.appendChild(t,s),e.activeFormattingElements.insertElementAfterBookmark(s,r),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,s,r.tagID)}function iq(e,t){for(let n=0;n=n;i--)e._setEndLocation(e.openElements.items[i],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const i=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(i);if(r&&!r.endTag&&(e._setEndLocation(i,t),e.openElements.stackTop>=1)){const s=e.openElements.items[1],o=e.treeAdapter.getNodeSourceCodeLocation(s);o&&!o.endTag&&e._setEndLocation(s,t)}}}}function yCt(e,t){e._setDocumentType(t);const n=t.forceQuirks?rd.QUIRKS:KEt(t);WEt(t)||e._err(t,dt.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=Ie.BEFORE_HTML}function vk(e,t){e._err(t,dt.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,rd.QUIRKS),e.insertionMode=Ie.BEFORE_HTML,e._processToken(t)}function vCt(e,t){t.tagID===B.HTML?(e._insertElement(t,Rt.HTML),e.insertionMode=Ie.BEFORE_HEAD):uE(e,t)}function xCt(e,t){const n=t.tagID;(n===B.HTML||n===B.HEAD||n===B.BODY||n===B.BR)&&uE(e,t)}function uE(e,t){e._insertFakeRootElement(),e.insertionMode=Ie.BEFORE_HEAD,e._processToken(t)}function wCt(e,t){switch(t.tagID){case B.HTML:{Rl(e,t);break}case B.HEAD:{e._insertElement(t,Rt.HTML),e.headElement=e.openElements.current,e.insertionMode=Ie.IN_HEAD;break}default:dE(e,t)}}function OCt(e,t){const n=t.tagID;n===B.HEAD||n===B.BODY||n===B.HTML||n===B.BR?dE(e,t):e._err(t,dt.endTagWithoutMatchingOpenElement)}function dE(e,t){e._insertFakeElement(Je.HEAD,B.HEAD),e.headElement=e.openElements.current,e.insertionMode=Ie.IN_HEAD,e._processToken(t)}function _f(e,t){switch(t.tagID){case B.HTML:{Rl(e,t);break}case B.BASE:case B.BASEFONT:case B.BGSOUND:case B.LINK:case B.META:{e._appendElement(t,Rt.HTML),t.ackSelfClosing=!0;break}case B.TITLE:{e._switchToTextParsing(t,Ea.RCDATA);break}case B.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Ea.RAWTEXT):(e._insertElement(t,Rt.HTML),e.insertionMode=Ie.IN_HEAD_NO_SCRIPT);break}case B.NOFRAMES:case B.STYLE:{e._switchToTextParsing(t,Ea.RAWTEXT);break}case B.SCRIPT:{e._switchToTextParsing(t,Ea.SCRIPT_DATA);break}case B.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=Ie.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(Ie.IN_TEMPLATE);break}case B.HEAD:{e._err(t,dt.misplacedStartTagForHeadElement);break}default:fE(e,t)}}function kCt(e,t){switch(t.tagID){case B.HEAD:{e.openElements.pop(),e.insertionMode=Ie.AFTER_HEAD;break}case B.BODY:case B.BR:case B.HTML:{fE(e,t);break}case B.TEMPLATE:{ev(e,t);break}default:e._err(t,dt.endTagWithoutMatchingOpenElement)}}function ev(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==B.TEMPLATE&&e._err(t,dt.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(B.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,dt.endTagWithoutMatchingOpenElement)}function fE(e,t){e.openElements.pop(),e.insertionMode=Ie.AFTER_HEAD,e._processToken(t)}function SCt(e,t){switch(t.tagID){case B.HTML:{Rl(e,t);break}case B.BASEFONT:case B.BGSOUND:case B.HEAD:case B.LINK:case B.META:case B.NOFRAMES:case B.STYLE:{_f(e,t);break}case B.NOSCRIPT:{e._err(t,dt.nestedNoscriptInHead);break}default:hE(e,t)}}function ECt(e,t){switch(t.tagID){case B.NOSCRIPT:{e.openElements.pop(),e.insertionMode=Ie.IN_HEAD;break}case B.BR:{hE(e,t);break}default:e._err(t,dt.endTagWithoutMatchingOpenElement)}}function hE(e,t){const n=t.type===Fi.EOF?dt.openElementsLeftAfterEof:dt.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=Ie.IN_HEAD,e._processToken(t)}function CCt(e,t){switch(t.tagID){case B.HTML:{Rl(e,t);break}case B.BODY:{e._insertElement(t,Rt.HTML),e.framesetOk=!1,e.insertionMode=Ie.IN_BODY;break}case B.FRAMESET:{e._insertElement(t,Rt.HTML),e.insertionMode=Ie.IN_FRAMESET;break}case B.BASE:case B.BASEFONT:case B.BGSOUND:case B.LINK:case B.META:case B.NOFRAMES:case B.SCRIPT:case B.STYLE:case B.TEMPLATE:case B.TITLE:{e._err(t,dt.abandonedHeadElementChild),e.openElements.push(e.headElement,B.HEAD),_f(e,t),e.openElements.remove(e.headElement);break}case B.HEAD:{e._err(t,dt.misplacedStartTagForHeadElement);break}default:pE(e,t)}}function ACt(e,t){switch(t.tagID){case B.BODY:case B.HTML:case B.BR:{pE(e,t);break}case B.TEMPLATE:{ev(e,t);break}default:e._err(t,dt.endTagWithoutMatchingOpenElement)}}function pE(e,t){e._insertFakeElement(Je.BODY,B.BODY),e.insertionMode=Ie.IN_BODY,AM(e,t)}function AM(e,t){switch(t.type){case Fi.CHARACTER:{EMe(e,t);break}case Fi.WHITESPACE_CHARACTER:{SMe(e,t);break}case Fi.COMMENT:{e9(e,t);break}case Fi.START_TAG:{Rl(e,t);break}case Fi.END_TAG:{TM(e,t);break}case Fi.EOF:{_Me(e,t);break}}}function SMe(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function EMe(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function TCt(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function _Ct(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function jCt(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,Rt.HTML),e.insertionMode=Ie.IN_FRAMESET)}function NCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,Rt.HTML)}function RCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&JB.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,Rt.HTML)}function ICt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,Rt.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function PCt(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,Rt.HTML),n||(e.formElement=e.openElements.current))}function DCt(e,t){e.framesetOk=!1;const n=t.tagID;for(let i=e.openElements.stackTop;i>=0;i--){const r=e.openElements.tagIDs[i];if(n===B.LI&&r===B.LI||(n===B.DD||n===B.DT)&&(r===B.DD||r===B.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==B.ADDRESS&&r!==B.DIV&&r!==B.P&&e._isSpecialElement(e.openElements.items[i],r))break}e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,Rt.HTML)}function MCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,Rt.HTML),e.tokenizer.state=Ea.PLAINTEXT}function LCt(e,t){e.openElements.hasInScope(B.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(B.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,Rt.HTML),e.framesetOk=!1}function $Ct(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(Je.A);n&&(iq(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,Rt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function FCt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Rt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function BCt(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(B.NOBR)&&(iq(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,Rt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function UCt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Rt.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function QCt(e,t){e.treeAdapter.getDocumentMode(e.document)!==rd.QUIRKS&&e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,Rt.HTML),e.framesetOk=!1,e.insertionMode=Ie.IN_TABLE}function CMe(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Rt.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function AMe(e){const t=mMe(e,Zy.TYPE);return t!=null&&t.toLowerCase()===aCt}function zCt(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Rt.HTML),AMe(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function VCt(e,t){e._appendElement(t,Rt.HTML),t.ackSelfClosing=!0}function HCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._appendElement(t,Rt.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function qCt(e,t){t.tagName=Je.IMG,t.tagID=B.IMG,CMe(e,t)}function WCt(e,t){e._insertElement(t,Rt.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Ea.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=Ie.TEXT}function KCt(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Ea.RAWTEXT)}function GCt(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Ea.RAWTEXT)}function wne(e,t){e._switchToTextParsing(t,Ea.RAWTEXT)}function XCt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Rt.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===Ie.IN_TABLE||e.insertionMode===Ie.IN_CAPTION||e.insertionMode===Ie.IN_TABLE_BODY||e.insertionMode===Ie.IN_ROW||e.insertionMode===Ie.IN_CELL?Ie.IN_SELECT_IN_TABLE:Ie.IN_SELECT}function YCt(e,t){e.openElements.currentTagId===B.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,Rt.HTML)}function ZCt(e,t){e.openElements.hasInScope(B.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,Rt.HTML)}function JCt(e,t){e.openElements.hasInScope(B.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(B.RTC),e._insertElement(t,Rt.HTML)}function eAt(e,t){e._reconstructActiveFormattingElements(),wMe(t),nq(t),t.selfClosing?e._appendElement(t,Rt.MATHML):e._insertElement(t,Rt.MATHML),t.ackSelfClosing=!0}function tAt(e,t){e._reconstructActiveFormattingElements(),OMe(t),nq(t),t.selfClosing?e._appendElement(t,Rt.SVG):e._insertElement(t,Rt.SVG),t.ackSelfClosing=!0}function One(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Rt.HTML)}function Rl(e,t){switch(t.tagID){case B.I:case B.S:case B.B:case B.U:case B.EM:case B.TT:case B.BIG:case B.CODE:case B.FONT:case B.SMALL:case B.STRIKE:case B.STRONG:{FCt(e,t);break}case B.A:{$Ct(e,t);break}case B.H1:case B.H2:case B.H3:case B.H4:case B.H5:case B.H6:{RCt(e,t);break}case B.P:case B.DL:case B.OL:case B.UL:case B.DIV:case B.DIR:case B.NAV:case B.MAIN:case B.MENU:case B.ASIDE:case B.CENTER:case B.FIGURE:case B.FOOTER:case B.HEADER:case B.HGROUP:case B.DIALOG:case B.DETAILS:case B.ADDRESS:case B.ARTICLE:case B.SEARCH:case B.SECTION:case B.SUMMARY:case B.FIELDSET:case B.BLOCKQUOTE:case B.FIGCAPTION:{NCt(e,t);break}case B.LI:case B.DD:case B.DT:{DCt(e,t);break}case B.BR:case B.IMG:case B.WBR:case B.AREA:case B.EMBED:case B.KEYGEN:{CMe(e,t);break}case B.HR:{HCt(e,t);break}case B.RB:case B.RTC:{ZCt(e,t);break}case B.RT:case B.RP:{JCt(e,t);break}case B.PRE:case B.LISTING:{ICt(e,t);break}case B.XMP:{KCt(e,t);break}case B.SVG:{tAt(e,t);break}case B.HTML:{TCt(e,t);break}case B.BASE:case B.LINK:case B.META:case B.STYLE:case B.TITLE:case B.SCRIPT:case B.BGSOUND:case B.BASEFONT:case B.TEMPLATE:{_f(e,t);break}case B.BODY:{_Ct(e,t);break}case B.FORM:{PCt(e,t);break}case B.NOBR:{BCt(e,t);break}case B.MATH:{eAt(e,t);break}case B.TABLE:{QCt(e,t);break}case B.INPUT:{zCt(e,t);break}case B.PARAM:case B.TRACK:case B.SOURCE:{VCt(e,t);break}case B.IMAGE:{qCt(e,t);break}case B.BUTTON:{LCt(e,t);break}case B.APPLET:case B.OBJECT:case B.MARQUEE:{UCt(e,t);break}case B.IFRAME:{GCt(e,t);break}case B.SELECT:{XCt(e,t);break}case B.OPTION:case B.OPTGROUP:{YCt(e,t);break}case B.NOEMBED:case B.NOFRAMES:{wne(e,t);break}case B.FRAMESET:{jCt(e,t);break}case B.TEXTAREA:{WCt(e,t);break}case B.NOSCRIPT:{e.options.scriptingEnabled?wne(e,t):One(e,t);break}case B.PLAINTEXT:{MCt(e,t);break}case B.COL:case B.TH:case B.TD:case B.TR:case B.HEAD:case B.FRAME:case B.TBODY:case B.TFOOT:case B.THEAD:case B.CAPTION:case B.COLGROUP:break;default:One(e,t)}}function nAt(e,t){if(e.openElements.hasInScope(B.BODY)&&(e.insertionMode=Ie.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function iAt(e,t){e.openElements.hasInScope(B.BODY)&&(e.insertionMode=Ie.AFTER_BODY,LMe(e,t))}function rAt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function sAt(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(B.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(B.FORM):n&&e.openElements.remove(n))}function aAt(e){e.openElements.hasInButtonScope(B.P)||e._insertFakeElement(Je.P,B.P),e._closePElement()}function oAt(e){e.openElements.hasInListItemScope(B.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(B.LI),e.openElements.popUntilTagNamePopped(B.LI))}function lAt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function cAt(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function uAt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function dAt(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(Je.BR,B.BR),e.openElements.pop(),e.framesetOk=!1}function TMe(e,t){const n=t.tagName,i=t.tagID;for(let r=e.openElements.stackTop;r>0;r--){const s=e.openElements.items[r],o=e.openElements.tagIDs[r];if(i===o&&(i!==B.UNKNOWN||e.treeAdapter.getTagName(s)===n)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.stackTop>=r&&e.openElements.shortenToLength(r);break}if(e._isSpecialElement(s,o))break}}function TM(e,t){switch(t.tagID){case B.A:case B.B:case B.I:case B.S:case B.U:case B.EM:case B.TT:case B.BIG:case B.CODE:case B.FONT:case B.NOBR:case B.SMALL:case B.STRIKE:case B.STRONG:{iq(e,t);break}case B.P:{aAt(e);break}case B.DL:case B.UL:case B.OL:case B.DIR:case B.DIV:case B.NAV:case B.PRE:case B.MAIN:case B.MENU:case B.ASIDE:case B.BUTTON:case B.CENTER:case B.FIGURE:case B.FOOTER:case B.HEADER:case B.HGROUP:case B.DIALOG:case B.ADDRESS:case B.ARTICLE:case B.DETAILS:case B.SEARCH:case B.SECTION:case B.SUMMARY:case B.LISTING:case B.FIELDSET:case B.BLOCKQUOTE:case B.FIGCAPTION:{rAt(e,t);break}case B.LI:{oAt(e);break}case B.DD:case B.DT:{lAt(e,t);break}case B.H1:case B.H2:case B.H3:case B.H4:case B.H5:case B.H6:{cAt(e);break}case B.BR:{dAt(e);break}case B.BODY:{nAt(e,t);break}case B.HTML:{iAt(e,t);break}case B.FORM:{sAt(e);break}case B.APPLET:case B.OBJECT:case B.MARQUEE:{uAt(e,t);break}case B.TEMPLATE:{ev(e,t);break}default:TMe(e,t)}}function _Me(e,t){e.tmplInsertionModeStack.length>0?MMe(e,t):rq(e,t)}function fAt(e,t){var n;t.tagID===B.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function hAt(e,t){e._err(t,dt.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function N4(e,t){if(e.openElements.currentTagId!==void 0&&kMe.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=Ie.IN_TABLE_TEXT,t.type){case Fi.CHARACTER:{NMe(e,t);break}case Fi.WHITESPACE_CHARACTER:{jMe(e,t);break}}else bT(e,t)}function pAt(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,Rt.HTML),e.insertionMode=Ie.IN_CAPTION}function mAt(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Rt.HTML),e.insertionMode=Ie.IN_COLUMN_GROUP}function gAt(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Je.COLGROUP,B.COLGROUP),e.insertionMode=Ie.IN_COLUMN_GROUP,sq(e,t)}function bAt(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Rt.HTML),e.insertionMode=Ie.IN_TABLE_BODY}function yAt(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Je.TBODY,B.TBODY),e.insertionMode=Ie.IN_TABLE_BODY,_M(e,t)}function vAt(e,t){e.openElements.hasInTableScope(B.TABLE)&&(e.openElements.popUntilTagNamePopped(B.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function xAt(e,t){AMe(t)?e._appendElement(t,Rt.HTML):bT(e,t),t.ackSelfClosing=!0}function wAt(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,Rt.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function a1(e,t){switch(t.tagID){case B.TD:case B.TH:case B.TR:{yAt(e,t);break}case B.STYLE:case B.SCRIPT:case B.TEMPLATE:{_f(e,t);break}case B.COL:{gAt(e,t);break}case B.FORM:{wAt(e,t);break}case B.TABLE:{vAt(e,t);break}case B.TBODY:case B.TFOOT:case B.THEAD:{bAt(e,t);break}case B.INPUT:{xAt(e,t);break}case B.CAPTION:{pAt(e,t);break}case B.COLGROUP:{mAt(e,t);break}default:bT(e,t)}}function AC(e,t){switch(t.tagID){case B.TABLE:{e.openElements.hasInTableScope(B.TABLE)&&(e.openElements.popUntilTagNamePopped(B.TABLE),e._resetInsertionMode());break}case B.TEMPLATE:{ev(e,t);break}case B.BODY:case B.CAPTION:case B.COL:case B.COLGROUP:case B.HTML:case B.TBODY:case B.TD:case B.TFOOT:case B.TH:case B.THEAD:case B.TR:break;default:bT(e,t)}}function bT(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,AM(e,t),e.fosterParentingEnabled=n}function jMe(e,t){e.pendingCharacterTokens.push(t)}function NMe(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function xk(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n0&&e.openElements.currentTagId===B.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===B.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===B.OPTGROUP&&e.openElements.pop();break}case B.OPTION:{e.openElements.currentTagId===B.OPTION&&e.openElements.pop();break}case B.SELECT:{e.openElements.hasInSelectScope(B.SELECT)&&(e.openElements.popUntilTagNamePopped(B.SELECT),e._resetInsertionMode());break}case B.TEMPLATE:{ev(e,t);break}}}function AAt(e,t){const n=t.tagID;n===B.CAPTION||n===B.TABLE||n===B.TBODY||n===B.TFOOT||n===B.THEAD||n===B.TR||n===B.TD||n===B.TH?(e.openElements.popUntilTagNamePopped(B.SELECT),e._resetInsertionMode(),e._processStartTag(t)):PMe(e,t)}function TAt(e,t){const n=t.tagID;n===B.CAPTION||n===B.TABLE||n===B.TBODY||n===B.TFOOT||n===B.THEAD||n===B.TR||n===B.TD||n===B.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(B.SELECT),e._resetInsertionMode(),e.onEndTag(t)):DMe(e,t)}function _At(e,t){switch(t.tagID){case B.BASE:case B.BASEFONT:case B.BGSOUND:case B.LINK:case B.META:case B.NOFRAMES:case B.SCRIPT:case B.STYLE:case B.TEMPLATE:case B.TITLE:{_f(e,t);break}case B.CAPTION:case B.COLGROUP:case B.TBODY:case B.TFOOT:case B.THEAD:{e.tmplInsertionModeStack[0]=Ie.IN_TABLE,e.insertionMode=Ie.IN_TABLE,a1(e,t);break}case B.COL:{e.tmplInsertionModeStack[0]=Ie.IN_COLUMN_GROUP,e.insertionMode=Ie.IN_COLUMN_GROUP,sq(e,t);break}case B.TR:{e.tmplInsertionModeStack[0]=Ie.IN_TABLE_BODY,e.insertionMode=Ie.IN_TABLE_BODY,_M(e,t);break}case B.TD:case B.TH:{e.tmplInsertionModeStack[0]=Ie.IN_ROW,e.insertionMode=Ie.IN_ROW,jM(e,t);break}default:e.tmplInsertionModeStack[0]=Ie.IN_BODY,e.insertionMode=Ie.IN_BODY,Rl(e,t)}}function jAt(e,t){t.tagID===B.TEMPLATE&&ev(e,t)}function MMe(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(B.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):rq(e,t)}function NAt(e,t){t.tagID===B.HTML?Rl(e,t):jI(e,t)}function LMe(e,t){var n;if(t.tagID===B.HTML){if(e.fragmentContext||(e.insertionMode=Ie.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===B.HTML){e._setEndLocation(e.openElements.items[0],t);const i=e.openElements.items[1];i&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(i))===null||n===void 0)&&n.endTag)&&e._setEndLocation(i,t)}}else jI(e,t)}function jI(e,t){e.insertionMode=Ie.IN_BODY,AM(e,t)}function RAt(e,t){switch(t.tagID){case B.HTML:{Rl(e,t);break}case B.FRAMESET:{e._insertElement(t,Rt.HTML);break}case B.FRAME:{e._appendElement(t,Rt.HTML),t.ackSelfClosing=!0;break}case B.NOFRAMES:{_f(e,t);break}}}function IAt(e,t){t.tagID===B.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==B.FRAMESET&&(e.insertionMode=Ie.AFTER_FRAMESET))}function PAt(e,t){switch(t.tagID){case B.HTML:{Rl(e,t);break}case B.NOFRAMES:{_f(e,t);break}}}function DAt(e,t){t.tagID===B.HTML&&(e.insertionMode=Ie.AFTER_AFTER_FRAMESET)}function MAt(e,t){t.tagID===B.HTML?Rl(e,t):RN(e,t)}function RN(e,t){e.insertionMode=Ie.IN_BODY,AM(e,t)}function LAt(e,t){switch(t.tagID){case B.HTML:{Rl(e,t);break}case B.NOFRAMES:{_f(e,t);break}}}function $At(e,t){t.chars=Fs,e._insertCharacters(t)}function FAt(e,t){e._insertCharacters(t),e.framesetOk=!1}function $Me(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==Rt.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function BAt(e,t){if(tCt(t))$Me(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),i=e.treeAdapter.getNamespaceURI(n);i===Rt.MATHML?wMe(t):i===Rt.SVG&&(nCt(t),OMe(t)),nq(t),t.selfClosing?e._appendElement(t,i):e._insertElement(t,i),t.ackSelfClosing=!0}}function UAt(e,t){if(t.tagID===B.P||t.tagID===B.BR){$Me(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const i=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(i)===Rt.HTML){e._endTagOutsideForeignContent(t);break}const r=e.treeAdapter.getTagName(i);if(r.toLowerCase()===t.tagName){t.tagName=r,e.openElements.shortenToLength(n);break}}}Je.AREA,Je.BASE,Je.BASEFONT,Je.BGSOUND,Je.BR,Je.COL,Je.EMBED,Je.FRAME,Je.HR,Je.IMG,Je.INPUT,Je.KEYGEN,Je.LINK,Je.META,Je.PARAM,Je.SOURCE,Je.TRACK,Je.WBR;const QAt=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,zAt=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),kne={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function FMe(e,t){const n=JAt(e),i=ZPe("type",{handlers:{root:VAt,element:HAt,text:qAt,comment:UMe,doctype:WAt,raw:GAt},unknown:XAt}),r={parser:n?new xne(kne):xne.getFragmentParser(void 0,kne),handle(l){i(l,r)},stitches:!1,options:t||{}};i(e,r),aO(r,Nh());const s=n?r.parser.document:r.parser.getFragment(),o=eEt(s,{file:r.options.file});return r.stitches&&mT(o,"comment",function(l,c,u){const d=l;if(d.value.stitch&&u&&c!==void 0){const f=u.children;return f[c]=d.value.stitch,c}}),o.type==="root"&&o.children.length===1&&o.children[0].type===e.type?o.children[0]:o}function BMe(e,t){let n=-1;if(e)for(;++n4&&(t.parser.tokenizer.state=0);const n={type:Fi.CHARACTER,chars:e.value,location:yT(e)};aO(t,Nh(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function WAt(e,t){const n={type:Fi.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:yT(e)};aO(t,Nh(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function KAt(e,t){t.stitches=!0;const n=eTt(e);if("children"in e&&"children"in n){const i=FMe({type:"root",children:e.children},t.options);n.children=i.children}UMe({type:"comment",value:{stitch:n}},t)}function UMe(e,t){const n=e.value,i={type:Fi.COMMENT,data:n,location:yT(e)};aO(t,Nh(e)),t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken)}function GAt(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,QMe(t,Nh(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(QAt,"<$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function XAt(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))KAt(n,t);else{let i="";throw zAt.has(n.type)&&(i=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+i)}}function aO(e,t){QMe(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=Ea.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function QMe(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function YAt(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Ea.PLAINTEXT)return;aO(t,Nh(e));const i=t.parser.openElements.current;let r="namespaceURI"in i?i.namespaceURI:Ry.html;r===Ry.html&&n==="svg"&&(r=Ry.svg);const s=sEt({...e,children:[]},{space:r===Ry.svg?"svg":"html"}),o={type:Fi.START_TAG,tagName:n,tagID:sO(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in s?s.attrs:[],location:yT(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function ZAt(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&hEt.includes(n)||t.parser.tokenizer.state===Ea.PLAINTEXT)return;aO(t,xM(e));const i={type:Fi.END_TAG,tagName:n,tagID:sO(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:yT(e)};t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Ea.RCDATA||t.parser.tokenizer.state===Ea.RAWTEXT||t.parser.tokenizer.state===Ea.SCRIPT_DATA)&&(t.parser.tokenizer.state=Ea.DATA)}function JAt(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function yT(e){const t=Nh(e)||{line:void 0,column:void 0,offset:void 0},n=xM(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function eTt(e){return"children"in e?r1({...e,children:[]}):r1(e)}function tTt(e){return function(t,n){return FMe(t,{...e,file:n})}}const nTt="modulepreload",iTt=function(e){return"/"+e},Sne={},Zs=function(t,n,i){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));r=Promise.allSettled(n.map(c=>{if(c=iTt(c),c in Sne)return;Sne[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":nTt,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((h,m)=>{f.addEventListener("load",h),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return r.then(o=>{for(const l of o||[])l.status==="rejected"&&s(l.reason);return t().catch(s)})};var rTt=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,sTt=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,aTt=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,R4={Space_Separator:rTt,ID_Start:sTt,ID_Continue:aTt},va={isSpaceSeparator(e){return typeof e=="string"&&R4.Space_Separator.test(e)},isIdStartChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="$"||e==="_"||R4.ID_Start.test(e))},isIdContinueChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||e==="$"||e==="_"||e==="‌"||e==="‍"||R4.ID_Continue.test(e))},isDigit(e){return typeof e=="string"&&/[0-9]/.test(e)},isHexDigit(e){return typeof e=="string"&&/[0-9A-Fa-f]/.test(e)}};let n9,ec,xp,NI,ub,gf,ko,aq,mE;var oTt=function(t,n){n9=String(t),ec="start",xp=[],NI=0,ub=1,gf=0,ko=void 0,aq=void 0,mE=void 0;do ko=lTt(),dTt[ec]();while(ko.type!=="eof");return typeof n=="function"?i9({"":mE},"",n):mE};function i9(e,t,n){const i=e[t];if(i!=null&&typeof i=="object")if(Array.isArray(i))for(let r=0;r0;){const n=Fp();if(!va.isHexDigit(n))throw As(Tt());e+=Tt()}return String.fromCodePoint(parseInt(e,16))}const dTt={start(){if(ko.type==="eof")throw ey();I4()},beforePropertyName(){switch(ko.type){case"identifier":case"string":aq=ko.value,ec="afterPropertyName";return;case"punctuator":j_();return;case"eof":throw ey()}},afterPropertyName(){if(ko.type==="eof")throw ey();ec="beforePropertyValue"},beforePropertyValue(){if(ko.type==="eof")throw ey();I4()},beforeArrayValue(){if(ko.type==="eof")throw ey();if(ko.type==="punctuator"&&ko.value==="]"){j_();return}I4()},afterPropertyValue(){if(ko.type==="eof")throw ey();switch(ko.value){case",":ec="beforePropertyName";return;case"}":j_()}},afterArrayValue(){if(ko.type==="eof")throw ey();switch(ko.value){case",":ec="beforeArrayValue";return;case"]":j_()}},end(){}};function I4(){let e;switch(ko.type){case"punctuator":switch(ko.value){case"{":e={};break;case"[":e=[];break}break;case"null":case"boolean":case"numeric":case"string":e=ko.value;break}if(mE===void 0)mE=e;else{const t=xp[xp.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,aq,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(e!==null&&typeof e=="object")xp.push(e),Array.isArray(e)?ec="beforeArrayValue":ec="beforePropertyName";else{const t=xp[xp.length-1];t==null?ec="end":Array.isArray(t)?ec="afterArrayValue":ec="afterPropertyValue"}}function j_(){xp.pop();const e=xp[xp.length-1];e==null?ec="end":Array.isArray(e)?ec="afterArrayValue":ec="afterPropertyValue"}function As(e){return RI(e===void 0?`JSON5: invalid end of input at ${ub}:${gf}`:`JSON5: invalid character '${VMe(e)}' at ${ub}:${gf}`)}function ey(){return RI(`JSON5: invalid end of input at ${ub}:${gf}`)}function Ene(){return gf-=5,RI(`JSON5: invalid identifier character at ${ub}:${gf}`)}function fTt(e){console.warn(`JSON5: '${VMe(e)}' in strings is not valid ECMAScript; consider escaping`)}function VMe(e){const t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(t[e])return t[e];if(e<" "){const n=e.charCodeAt(0).toString(16);return"\\x"+("00"+n).substring(n.length)}return e}function RI(e){const t=new SyntaxError(e);return t.lineNumber=ub,t.columnNumber=gf,t}var hTt=function(t,n,i){const r=[];let s="",o,l,c="",u;if(n!=null&&typeof n=="object"&&!Array.isArray(n)&&(i=n.space,u=n.quote,n=n.replacer),typeof n=="function")l=n;else if(Array.isArray(n)){o=[];for(const b of n){let v;typeof b=="string"?v=b:(typeof b=="number"||b instanceof String||b instanceof Number)&&(v=String(b)),v!==void 0&&o.indexOf(v)<0&&o.push(v)}}return i instanceof Number?i=Number(i):i instanceof String&&(i=String(i)),typeof i=="number"?i>0&&(i=Math.min(10,Math.floor(i)),c=" ".substr(0,i)):typeof i=="string"&&(c=i.substr(0,10)),d("",{"":t});function d(b,v){let y=v[b];switch(y!=null&&(typeof y.toJSON5=="function"?y=y.toJSON5(b):typeof y.toJSON=="function"&&(y=y.toJSON(b))),l&&(y=l.call(v,b,y)),y instanceof Number?y=Number(y):y instanceof String?y=String(y):y instanceof Boolean&&(y=y.valueOf()),y){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof y=="string")return f(y);if(typeof y=="number")return String(y);if(typeof y=="object")return Array.isArray(y)?g(y):h(y)}function f(b){const v={"'":.1,'"':.2},y={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let w="";for(let O=0;Ov[O]=0)throw TypeError("Converting circular structure to JSON5");r.push(b);let v=s;s=s+c;let y=o||Object.keys(b),w=[];for(const O of y){const k=d(O,b);if(k!==void 0){let S=m(O)+":";c!==""&&(S+=" "),S+=k,w.push(S)}}let x;if(w.length===0)x="{}";else{let O;if(c==="")O=w.join(","),x="{"+O+"}";else{let k=`, `+s;O=w.join(k),x=`{ `+s+O+`, `+v+"}"}}return r.pop(),s=v,x}function m(b){if(b.length===0)return f(b);const v=String.fromCodePoint(b.codePointAt(0));if(!va.isIdStartChar(v))return f(b);for(let y=v.length;y=0)throw TypeError("Converting circular structure to JSON5");r.push(b);let v=s;s=s+c;let y=[];for(let x=0;x30)throw new Error("ECharts option nesting is too deep");if(typeof e=="number"&&!Number.isFinite(e))throw new Error("ECharts option contains a non-finite number");if(typeof e=="string"&&mTt.test(e.trim()))throw new Error("ECharts option contains an external resource");if(Array.isArray(e)){for(const n of e)II(n,t+1);return}if(pS(e))for(const[n,i]of Object.entries(e)){if(pTt.has(n))throw new Error("ECharts option contains an unsafe key");II(i,t+1)}}function gTt(e){var i;const t=e.trim(),n=t.match(/^(?:(?:const|let|var)\s+)?option\s*=\s*([\s\S]*?)\s*;?$/);return((i=n==null?void 0:n[1])==null?void 0:i.trim())||t}function bTt(e,t){let n=1,i="",r=!1,s=!1,o=!1;for(let l=t+1;li+2)throw new Error("Invalid ECharts gradient argument count");const r=n.slice(0,i).map(yTt),s=n[i],o=n[i+1]??!1;if(!Array.isArray(s)||typeof o!="boolean")throw new Error("Invalid ECharts gradient data");return e==="linear"?{type:e,x:r[0],y:r[1],x2:r[2],y2:r[3],colorStops:s,global:o}:{type:e,x:r[0],y:r[1],r:r[2],colorStops:s,global:o}}function xTt(e,t){const n=/^(?:new\s+)?echarts\.graphic\.(LinearGradient|RadialGradient)\s*\(/;let i="",r=!1,s=!1,o=!1;for(let l=t;lhTt)throw new Error("ECharts option is too large");const n=wTt(gTt(e));let i;try{i=VMe.parse(n)}catch(o){throw/\bfunction\s*\(|=>/.test(n)?new Error("ECharts function callbacks are not supported"):o}if(!pS(i))throw new Error("ECharts option must be a data object");II(i);const r={...i};r.aria={...pS(r.aria)?r.aria:{},enabled:!0};const s=r.tooltip;return pS(s)?r.tooltip={...s,renderMode:"richText"}:Array.isArray(s)&&(r.tooltip=s.map(o=>pS(o)?{...o,renderMode:"richText"}:o)),t&&(r.animation=!1),r}let I4;function OTt(){return I4??(I4=Zs(()=>import("../visualizations/echarts/index-CGT341lL.js"),[]).catch(e=>{throw I4=void 0,e})),I4}function kTt({source:e}){const{t}=Te("conversation"),n=p.useRef(null),[i,r]=p.useState(!1),[s,o]=p.useState("");return p.useEffect(()=>{let l=!1,c,u,d;r(!1);try{d=HMe(e,window.matchMedia("(prefers-reduced-motion: reduce)").matches),o("")}catch{o("invalid");return}return OTt().then(f=>{const h=n.current;l||!h||(c=f.init(h,void 0,{renderer:"svg"}),c.setOption(d,{notMerge:!0}),typeof ResizeObserver<"u"&&(u=new ResizeObserver(()=>c==null?void 0:c.resize()),u.observe(h)),r(!0))}).catch(()=>{c==null||c.dispose(),c=void 0,l||o("render")}),()=>{l=!0,u==null||u.disconnect(),c==null||c.dispose()}},[e]),a.jsxs("div",{className:`echarts-diagram${s?" echarts-diagram--error":""}`,role:"img","aria-label":t("visualization.echartsAria"),"aria-busy":!i&&!s,children:[a.jsx("div",{ref:n,className:"echarts-diagram__canvas",hidden:!!s}),!i&&!s?a.jsx("div",{className:"echarts-diagram__state","aria-live":"polite",children:a.jsx(fn,{duration:2.2,spread:15,children:t("visualization.rendering")})}):null,s?a.jsx("p",{className:"echarts-diagram__error",role:"alert",children:t(s==="invalid"?"visualization.invalidEcharts":"visualization.renderFailed")}):null]})}const STt=p.memo(kTt);let Ene,Cne=Promise.resolve(),ETt=0;function CTt(){return Ene??(Ene=Zs(async()=>{const{default:e}=await import("../visualizations/mermaid/mermaid.core-Vsbm7qIM.js").then(t=>t.ay);return{default:e}},__vite__mapDeps([0,1])).then(({default:e})=>(e.initialize({startOnLoad:!1,securityLevel:"strict",suppressErrorRendering:!0,theme:"neutral"}),e))),Ene}function ATt(e){const t=Cne.then(async()=>{const n=await CTt(),i=`mermaid-diagram-${ETt+=1}`;return n.render(i,e)});return Cne=t.then(()=>{},()=>{}),t}function TTt({source:e}){const{t}=Te("conversation"),n=p.useRef(null),[i,r]=p.useState(null),[s,o]=p.useState(!1);return p.useEffect(()=>{let l=!1;return r(null),o(!1),ATt(e).then(c=>{l||r(c)}).catch(()=>{l||o(!0)}),()=>{l=!0}},[e]),p.useEffect(()=>{!(i!=null&&i.bindFunctions)||!n.current||i.bindFunctions(n.current)},[i]),s?a.jsx("div",{className:"mermaid-diagram mermaid-diagram--error",children:a.jsx("p",{className:"mermaid-diagram__error",role:"alert",children:t("visualization.mermaidFailed")})}):i?a.jsx("div",{ref:n,className:"mermaid-diagram",role:"img","aria-label":t("visualization.mermaidAria"),dangerouslySetInnerHTML:{__html:i.svg}}):a.jsx("div",{className:"mermaid-diagram mermaid-diagram--loading","aria-live":"polite",children:a.jsx(fn,{duration:2.2,spread:15,children:t("visualization.rendering")})})}const _Tt=p.memo(TTt),jTt="_SegmentedControl_1sl7d_1",NTt="_SegmentedControlOption_1sl7d_140",RTt="_SegmentedControlThumb_1sl7d_219",r9={SegmentedControl:jTt,SegmentedControlOption:NTt,SegmentedControlThumb:RTt},ld=({value:e,onChange:t,children:n,block:i,pill:r=!0,size:s="md",gutterSize:o,className:l,onClick:c,...u})=>{const d=p.useRef(null),f=p.useRef(null),h=p.useCallback(g=>{const b=d.current,v=f.current;if(!b||!v)return;const y=b==null?void 0:b.querySelector('[data-state="on"]');if(!y)return;const w=b.clientWidth;let x=Math.floor(y.clientWidth);const O=y.offsetLeft;if(w-(x+O)<2&&(x=x-1),v.style.width=`${Math.floor(x)}px`,v.style.transform=`translateX(${O}px)`,b.scrollWidth>w){const k=w*.15,S=b.scrollLeft,C=y.offsetLeft,E=C+x;(CS+w-k)&&g&&y.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"})}},[]);nNe({ref:d,onResize:()=>{const g=f.current;if(!g)return;const b=g.style.transition;g.style.transition="",h(!1),g.style.transition=b}}),p.useLayoutEffect(()=>{const g=d.current,b=f.current;!g||!b||(h(!!b.style.transition),b.style.transition||pI(()=>{b.style.transition="width 300ms var(--cubic-enter), transform 300ms var(--cubic-enter)"}))},[h,e,s,o,r]);const m=g=>{g&&t&&t(g)};return a.jsxs(xft,{ref:d,className:Ui(r9.SegmentedControl,l),type:"single",value:e,loop:!1,onValueChange:m,onClick:c,"data-block":i?"":void 0,"data-pill":r?"":void 0,"data-size":s,"data-gutter-size":o,...u,children:[a.jsx("div",{className:r9.SegmentedControlThumb,ref:f}),n]})},ITt=({children:e,...t})=>a.jsx(Eft,{className:r9.SegmentedControlOption,...t,onPointerEnter:kV,children:a.jsx("span",{className:"relative",children:e})});ld.Option=ITt;function PTt({children:e,label:t,language:n,source:i,streaming:r=!1}){const{t:s}=Te("conversation"),[o,l]=p.useState("preview"),c=r?"code":o;return a.jsxs("section",{className:"visualization-card","aria-label":s("visualization.cardAria",{label:t}),children:[a.jsx("div",{className:"visualization-card__toolbar",children:a.jsxs(ld,{className:"visualization-card__tabs",value:c,size:"sm",gutterSize:"sm",pill:!1,"aria-label":s("visualization.viewAria",{label:t}),onChange:u=>{r||l(u)},children:[a.jsx(ld.Option,{value:"preview",disabled:r,children:s("visualization.preview")}),a.jsx(ld.Option,{value:"code",children:s("visualization.code")})]})}),a.jsx("div",{className:"visualization-card__body",children:c==="code"?a.jsx("pre",{className:"visualization-card__code",children:a.jsx("code",{className:`language-${n}`,children:i})}):e})]})}const DTt=p.memo(PTt);function qMe(e){const t=e==null?void 0:e.trim().toLowerCase();if(t==="mermaid")return"mermaid";if(t==="echart"||t==="echarts")return"echarts"}const WMe=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function s9(e){return typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(s9).join(""):p.isValidElement(e)?s9(e.props.children):""}function MTt(e){var i;const t=p.Children.toArray(e)[0];if(!p.isValidElement(t))return;const n=(i=t.props.className)==null?void 0:i.split(/\s+/).find(r=>r.startsWith("language-"));return qMe(n==null?void 0:n.slice(9))}function KMe(e){if(!e)return!1;try{const t=e.toLowerCase();return WMe.some(n=>t.includes(n))}catch{return!1}}function LTt(e){var i;const t=(i=e==null?void 0:e.properties)==null?void 0:i.href;if(!t)return!1;if(KMe(t))return!0;const n=e==null?void 0:e.children;if(n&&Array.isArray(n)){const r=n.map(s=>(s==null?void 0:s.value)||"").join("").toLowerCase();return WMe.some(s=>r.includes(s))}return!1}function $Tt({text:e,className:t,allowRawHtml:n=!0,streaming:i=!1}){const{t:r}=Te("conversation"),s=p.useContext(Aje),[o,l]=p.useState(null),c=(f,h)=>{if(f.src)return f.src;if(h){const m=b=>{var v;if(!b)return null;if(b.type==="source"&&((v=b.properties)!=null&&v.src))return b.properties.src;if(b.children)for(const y of b.children){const w=m(y);if(w)return w}return null},g=m({children:h});if(g)return g}return""},u=f=>{try{const m=new URL(f).pathname.split("/");return m[m.length-1]||"video.mp4"}catch{return"video.mp4"}},d=f=>f?Array.isArray(f)?f.map(h=>(h==null?void 0:h.value)||"").join("")||"video":(f==null?void 0:f.value)||"video":"video";return a.jsxs("div",{className:t?`md ${t}`:"md",children:[a.jsx(qPe,{disallowedElements:s?["file-card","personal-drive-enable-card"]:void 0,remarkPlugins:[bDe],rehypePlugins:n?[JAt,sne]:[sne],components:{pre:({node:f,children:h,...m})=>{const g=MTt(h);if(g==="mermaid"||g==="echarts"){const b=s9(h).replace(/\n$/,"");return a.jsx(DTt,{label:g==="mermaid"?"Mermaid":"ECharts",language:g,source:b,streaming:i,children:g==="mermaid"?a.jsx(_Tt,{source:b}):a.jsx(STt,{source:b})})}return a.jsx("pre",{...m,children:h})},a:({node:f,...h})=>{const m=h.href,g=s&&zst(m);if(g)return a.jsx(Vst,{...s,path:g,children:h.children});if(m&&(KMe(m)||LTt(f))){const b=m,v=d(f==null?void 0:f.children);return a.jsxs("div",{className:"video-container",children:[a.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":r("markdown.playVideo",{name:v}),onClick:()=>l({src:b,title:v}),children:[a.jsx("video",{src:b,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),a.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:a.jsx(iE,{})})]}),a.jsx("div",{className:"video-caption",children:a.jsx("a",{href:b,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:v})})]})}return a.jsx("a",{...h,target:"_blank",rel:"noopener noreferrer"})},img:({node:f,src:h,alt:m,...g})=>{const b=a.jsx("img",{...g,src:h,alt:m??"",loading:"lazy"});return h?a.jsx(MAe,{src:h,children:a.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":r("markdown.enlargeImage",{name:m||r("markdown.image")}),children:[b,a.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:a.jsx(iE,{})})]})}):b},video:({node:f,src:h,children:m,...g})=>{const b=c({src:h},m);return b?a.jsx("div",{className:"video-container",children:a.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":r("markdown.enlargeVideo"),onClick:()=>l({src:b}),children:[a.jsx("video",{src:b,...g,playsInline:!0,className:"video-thumbnail",children:m}),a.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:a.jsx(iE,{})})]})}):a.jsx("video",{src:h,controls:!0,playsInline:!0,className:"video-inline",...g,children:m})}},children:e}),o&&a.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":r("markdown.videoPreview"),onClick:()=>l(null),children:a.jsxs("div",{className:"video-viewer",onClick:f=>f.stopPropagation(),children:[a.jsxs("div",{className:"video-viewer-header",children:[a.jsx("div",{className:"video-viewer-title",children:o.title||u(o.src)}),a.jsxs("nav",{className:"video-viewer-nav",children:[a.jsx("a",{href:o.src,download:o.title||u(o.src),"aria-label":r("markdown.downloadVideo"),title:r("markdown.downloadVideo"),className:"video-viewer-download",children:a.jsx(tM,{})}),a.jsx("button",{type:"button",className:"video-viewer-close","aria-label":r("markdown.close"),onClick:()=>l(null),children:a.jsx(Do,{})})]})]}),a.jsx("div",{className:"video-viewer-body",children:a.jsx("video",{src:o.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const Td=p.memo($Tt);function P4(e){return(e==null?void 0:e.trim())||Tb("resourceMetadata.unknownSource")}function GMe(e){return(e==null?void 0:e.trim())||Tb("resourceMetadata.unknownCreator")}function FTt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5 5.5A2.5 2.5 0 0 1 7.5 3H19v16H7.5A2.5 2.5 0 0 0 5 21.5v-16Z"}),a.jsx("path",{d:"M5 18.5A2.5 2.5 0 0 1 7.5 16H19"}),a.jsx("path",{d:"M9 7h6M9 10h4"})]})}function BTt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3h8l4 4v14H6V3Z"}),a.jsx("path",{d:"M14 3v5h5M9 12h6M9 16h6"})]})}function UTt(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m7 7 10 10M17 7 7 17"})})}function QTt(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 5v14M5 12h14"})})}function yT({title:e,children:t,onClose:n,busy:i=!1,className:r=""}){const{t:s}=Te("ui"),o=p.useId(),l=p.useRef(null),c=p.useRef(null),u=p.useRef(i),d=p.useRef(n);return p.useEffect(()=>{u.current=i,d.current=n},[i,n]),p.useEffect(()=>{var g;const f=document.activeElement instanceof HTMLElement?document.activeElement:null,h=document.body.style.overflow;document.body.style.overflow="hidden",(g=l.current)==null||g.focus();const m=b=>{if(b.key==="Escape"&&!u.current){d.current();return}if(b.key!=="Tab")return;const v=c.current;if(!v)return;const y=Array.from(v.querySelectorAll('button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), a[href], audio[controls], video[controls], iframe, [tabindex]:not([tabindex="-1"])')).filter(O=>O.getClientRects().length>0);if(y.length===0){b.preventDefault();return}const w=y[0],x=y[y.length-1];b.shiftKey&&(document.activeElement===w||!v.contains(document.activeElement))?(b.preventDefault(),x.focus()):!b.shiftKey&&(document.activeElement===x||!v.contains(document.activeElement))&&(b.preventDefault(),w.focus())};return window.addEventListener("keydown",m),()=>{window.removeEventListener("keydown",m),document.body.style.overflow=h,f!=null&&f.isConnected&&f.focus()}},[]),yi.createPortal(a.jsx("div",{className:"knowledge-dialog-backdrop",onMouseDown:f=>{f.target===f.currentTarget&&!i&&n()},children:a.jsxs("section",{ref:c,className:`knowledge-dialog${r?` ${r}`:""}`,role:"dialog","aria-modal":"true","aria-labelledby":o,"aria-busy":i||void 0,children:[a.jsxs("header",{className:"knowledge-dialog__header",children:[a.jsx("h2",{id:o,children:e}),a.jsx("button",{ref:l,type:"button",onClick:n,disabled:i,"aria-label":s("common.close"),children:a.jsx(UTt,{})})]}),t]})}),document.body)}function AC({message:e}){return e?a.jsx("div",{className:"knowledge-form-error",role:"alert",children:e}):null}function a9(e){return e instanceof DOMException&&e.name==="AbortError"}function zTt(e,t){if(!e)return"";const n=Date.parse(e);return Number.isFinite(n)?new Intl.DateTimeFormat(t,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(n):e}const XMe=[".jpg",".jpeg",".png"].join(","),VTt=new Set(XMe.split(",")),YMe=[".pdf",".pptx",".docx",".xlsx",".txt"].join(","),HTt=new Set(YMe.split(",")),qTt=200*1024*1024;function o9(e){const t=e.lastIndexOf(".");return t<0?"":e.slice(t).toLocaleLowerCase()}function WTt(e,t,n){return e.size>qTt?n("knowledge.errors.fileTooLarge"):t==="image"?VTt.has(o9(e.name))?"":n("knowledge.errors.invalidImageType"):HTt.has(o9(e.name))?"":n("knowledge.errors.invalidDocumentType")}function aq(e){return e<=0?"-":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function l9(e){var r;const t=e.type.trim().replace(/^\./,"");if(t)return t.toUpperCase();const n=e.name.trim(),i=n.includes(".")?(r=n.split(".").pop())==null?void 0:r.trim():"";return i?i.toUpperCase():"-"}function KTt({region:e,onClose:t,onCreated:n}){const{t:i}=Te("ui"),[r,s]=p.useState(""),[o,l]=p.useState(""),[c,u]=p.useState(!1),[d,f]=p.useState(!1),[h,m]=p.useState(""),g=r.trim(),b=!!(g&&!/^[A-Za-z][A-Za-z0-9_]{0,47}$/.test(g)),v=async y=>{if(y.preventDefault(),u(!0),!g||b)return;f(!0),m("");const w={name:g,description:o.trim()||void 0,region:e};try{n(await jbt(w))}catch(x){m(El(x,i("knowledge.errors.createBase")))}finally{f(!1)}};return a.jsx(yT,{title:i("knowledge.createBase"),onClose:t,busy:d,children:a.jsxs("form",{onSubmit:y=>void v(y),children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:i("common.name")}),a.jsx("input",{autoFocus:!0,value:r,maxLength:48,"aria-invalid":c&&b||void 0,"aria-describedby":"knowledge-name-help",onBlur:()=>u(!0),onChange:y=>s(y.target.value)})]}),a.jsx("p",{id:"knowledge-name-help",className:`knowledge-dialog__note${c&&b?" is-error":""}`,role:c&&b?"alert":void 0,children:i(c&&b?"knowledge.invalidName":"knowledge.nameHelp")}),a.jsxs("label",{children:[a.jsx("span",{children:i("knowledge.optionalDescription")}),a.jsx("textarea",{value:o,maxLength:80,onChange:y=>l(y.target.value)})]}),a.jsx(AC,{message:h})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:t,disabled:d,children:i("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:d||!g||b,children:i(d?"common.creating":"common.create")})]})]})})}function GTt({item:e,onClose:t,onUpdated:n}){const{t:i}=Te("ui"),[r,s]=p.useState(e.description),[o,l]=p.useState(!1),[c,u]=p.useState(""),d=async f=>{f.preventDefault(),l(!0),u("");try{n(await Nbt(e.id,e.region,{description:r.trim()}))}catch(h){u(El(h,i("knowledge.errors.updateBase")))}finally{l(!1)}};return a.jsx(yT,{title:i("knowledge.editBase"),onClose:t,busy:o,children:a.jsxs("form",{onSubmit:f=>void d(f),children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:i("common.name")}),a.jsx("input",{value:e.name,disabled:!0})]}),a.jsxs("label",{children:[a.jsx("span",{children:i("common.description")}),a.jsx("textarea",{autoFocus:!0,value:r,maxLength:80,onChange:f=>s(f.target.value)})]}),a.jsx("p",{className:"knowledge-dialog__note",children:i("knowledge.descriptionOnly")}),a.jsx(AC,{message:c})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:t,disabled:o,children:i("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:o,children:i(o?"common.saving":"common.save")})]})]})})}function ZMe(e,t){if(!e.trim())return{};const n=JSON.parse(e);if(!n||Array.isArray(n)||typeof n!="object")throw new Error(t);return n}function XTt({base:e,onClose:t,onCreated:n,onAssociationInvalid:i}){const{t:r}=Te("ui"),[s,o]=p.useState("document"),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(""),[m,g]=p.useState(null),[b,v]=p.useState(!1),[y,w]=p.useState("{}"),[x,O]=p.useState(""),[k,S]=p.useState(""),[C,E]=p.useState(null),j=p.useRef(null),T=p.useRef(null),R=p.useRef(null),A=p.useRef(0),N=!!x;p.useEffect(()=>{var L;C&&!N&&((L=R.current)==null||L.focus())},[N,C]);const P=L=>{N||L===s||(o(L),g(null),h(""),c(""),d(""),S(""),E(null),v(!1),A.current=0,j.current&&(j.current.value=""))},I=L=>{if(!L||s==="web")return;const F=WTt(L,s,r);if(F){g(null),c(""),d(""),S(F);return}g(L),S(""),c(L.name.replace(/\.[^.]+$/,"")),d(o9(L.name).slice(1))},D=async L=>{if(L.preventDefault(),s==="web"?!f.trim():!m)return;let F;try{F=ZMe(y,r("knowledge.errors.metadataObject"))}catch(M){S(El(M,r("knowledge.errors.metadataFormat")));return}O(s==="web"?C?"save":"preview":"upload"),S("");try{if(s==="web")if(C){const M={sourceType:"url",metadata:C.metadata,url:C.preview.url,sourceTitle:C.preview.name,sourceMarkdown:C.preview.sourceMarkdown};await Dbt(e.id,e.region,M),n()}else{const M=await Mbt(e.id,e.region,{url:f.trim()});if(!M.sourceMarkdown.trim())throw new Error(r("knowledge.errors.noWebPreview"));E({preview:M,metadata:F})}else m&&(await Lbt(e.id,e.region,{file:m,name:l.trim()||void 0,documentType:u.trim()||void 0,metadata:F}),n())}catch(M){M instanceof bM&&M.errorCode===sPe?i(M):S(El(M,r(s==="web"?C?"knowledge.errors.addWeb":"knowledge.errors.previewWeb":"knowledge.errors.uploadFile")))}finally{O("")}},_=()=>{N||(E(null),S(""),requestAnimationFrame(()=>{var L;return(L=T.current)==null?void 0:L.focus()}))};return a.jsx(yT,{title:r(C?"knowledge.previewWeb":"knowledge.addData"),onClose:t,busy:N,className:C?"knowledge-dialog--preview knowledge-dialog--web-confirm":"",children:a.jsx("form",{onSubmit:L=>void D(L),children:C?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"knowledge-preview knowledge-web-preview",children:[a.jsxs("div",{className:"knowledge-preview__meta",children:[a.jsx("strong",{title:C.preview.name,children:C.preview.name}),a.jsx("a",{href:C.preview.url,target:"_blank",rel:"noopener noreferrer",children:r("knowledge.openOriginalWeb")})]}),a.jsx("div",{className:"knowledge-preview__body","aria-live":"polite",children:a.jsx("div",{className:"knowledge-preview__markdown-shell",children:a.jsx(Td,{text:C.preview.sourceMarkdown,allowRawHtml:!1,className:"knowledge-preview__markdown"})})}),k?a.jsx("div",{className:"knowledge-web-preview__error",children:a.jsx(AC,{message:k})}):null]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",className:"is-back",onClick:_,disabled:N,children:r("knowledge.backToEdit")}),a.jsx("button",{type:"button",onClick:t,disabled:N,children:r("common.cancel")}),a.jsx("button",{ref:R,type:"submit",className:"is-primary",disabled:N,children:r(x==="save"?"common.adding":"knowledge.confirmAdd")})]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsx("div",{className:"knowledge-source-tabs",role:"tablist","aria-label":r("knowledge.source"),children:[["image",r("knowledge.image")],["document",r("knowledge.documentFile")],["web",r("knowledge.webPage")]].map(([L,F])=>a.jsx("button",{type:"button",role:"tab",id:`knowledge-source-${L}-tab`,"aria-controls":`knowledge-source-${L}-panel`,"aria-selected":s===L,tabIndex:s===L?0:-1,className:s===L?"is-active":"",disabled:N,onClick:()=>P(L),onKeyDown:M=>{const V=["image","document","web"];if(!["ArrowLeft","ArrowRight","Home","End"].includes(M.key))return;M.preventDefault();const q=V.indexOf(L),U=M.key==="Home"?V[0]:M.key==="End"?V[V.length-1]:V[(q+(M.key==="ArrowRight"?1:-1)+V.length)%V.length];P(U),requestAnimationFrame(()=>{var J;return(J=document.getElementById(`knowledge-source-${U}-tab`))==null?void 0:J.focus()})},children:F},L))}),a.jsx("div",{id:`knowledge-source-${s}-panel`,className:"knowledge-source-panel",role:"tabpanel","aria-labelledby":`knowledge-source-${s}-tab`,children:s==="web"?a.jsxs(a.Fragment,{children:[a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.webUrl")}),a.jsx("input",{ref:T,autoFocus:!0,type:"url",value:f,disabled:N,onChange:L=>{h(L.target.value),S("")},placeholder:"https://example.com/article"})]}),a.jsx("div",{className:"knowledge-upload-status",role:"status","aria-live":"polite",children:x==="preview"?a.jsx(fn,{children:r("knowledge.generatingWebPreview")}):null})]}):a.jsxs(a.Fragment,{children:[a.jsx("input",{ref:j,className:"knowledge-upload-input",type:"file","aria-label":r("knowledge.selectFile"),accept:s==="image"?XMe:YMe,disabled:N,onChange:L=>{var F;I(((F=L.currentTarget.files)==null?void 0:F[0])??null),L.currentTarget.value=""}}),a.jsxs("button",{type:"button",className:`knowledge-upload-dropzone${b?" is-dragging":""}${m?" is-ready":""}`,disabled:N,onClick:()=>{var L;return(L=j.current)==null?void 0:L.click()},onDragEnter:L=>{L.preventDefault(),!N&&(A.current+=1,v(!0))},onDragOver:L=>{L.preventDefault(),N||(L.dataTransfer.dropEffect="copy")},onDragLeave:L=>{L.preventDefault(),A.current=Math.max(0,A.current-1),A.current===0&&v(!1)},onDrop:L=>{var F;L.preventDefault(),A.current=0,v(!1),N||I(((F=L.dataTransfer.files)==null?void 0:F[0])??null)},children:[a.jsx("strong",{children:m?m.name:r("knowledge.selectOrDropFile")}),a.jsx("span",{children:m?r("knowledge.selectedFile",{size:aq(m.size)}):r(s==="image"?"knowledge.imageFileHelp":"knowledge.documentFileHelp")})]}),a.jsx("div",{className:"knowledge-upload-status",role:"status","aria-live":"polite",children:N?a.jsx(fn,{children:r("knowledge.uploadingFile")}):null})]})}),s!=="web"?a.jsxs("div",{className:"knowledge-dialog__fields",children:[a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.optionalName")}),a.jsx("input",{value:l,disabled:N,maxLength:256,onChange:L=>c(L.target.value)})]}),a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.optionalType")}),a.jsx("input",{value:u,disabled:N,maxLength:64,onChange:L=>d(L.target.value),placeholder:"pdf, docx, png"})]})]}):null,a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.metadataJson")}),a.jsx("textarea",{className:"is-code",value:y,disabled:N,onChange:L=>w(L.target.value),spellCheck:!1})]}),a.jsx(AC,{message:k})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:t,disabled:N,children:r("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:N||(s==="web"?!f.trim():!m),children:r(N?s==="web"?"common.generating":"common.uploading":s==="web"?"knowledge.generatePreview":"knowledge.uploadFile")})]})]})})})}function YTt({base:e,item:t,onClose:n,onUpdated:i}){const{t:r}=Te("ui"),[s,o]=p.useState(()=>JSON.stringify(t.metadata??{},null,2)),[l,c]=p.useState(!1),[u,d]=p.useState(""),f=async h=>{h.preventDefault();let m;try{m=ZMe(s,r("knowledge.errors.metadataObject"))}catch(g){d(El(g,r("knowledge.errors.metadataFormat")));return}c(!0),d("");try{i(await $bt(e.id,t.id,e.region,{metadata:m}))}catch(g){d(El(g,r("knowledge.errors.updateDocument")))}finally{c(!1)}};return a.jsx(yT,{title:r("knowledge.editMetadata"),onClose:n,busy:l,children:a.jsxs("form",{onSubmit:h=>void f(h),children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.knowledge")}),a.jsx("input",{value:t.name||t.id,disabled:!0})]}),a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.metadataJson")}),a.jsx("textarea",{autoFocus:!0,className:"is-code knowledge-metadata-editor",value:s,onChange:h=>o(h.target.value),spellCheck:!1})]}),a.jsx(AC,{message:u})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:n,disabled:l,children:r("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:l,children:r(l?"common.saving":"common.save")})]})]})})}const JMe=new Set(["avif","bmp","gif","jpeg","jpg","png","svg","webp"]),eLe=new Set(["aac","flac","m4a","mp3","ogg","wav","webm"]),tLe=new Set(["m4v","mov","mp4","mpeg","mpg","ogg","webm"]),ZTt=new Set(["pdf"]),JTt=new Set(["doc","docx","ppt","pptx","xls","xlsx"]),e2t=new Set(["creating","indexing","pending","processing","queued","submitted"]),t2t=new Set(["error","failed","unavailable"]);function Ane(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}}function j_(e){if(e==null||e==="")return"-";if(["string","number","boolean"].includes(typeof e))return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function n2t(e,t){if(Array.isArray(e)){if(e.length===0)return null;const r=e.map(Ane);if(r.some(s=>Object.keys(s).length>0)){const s=[...new Set(r.flatMap(o=>Object.keys(o)))];return{columns:s,rows:r.map(o=>s.map(l=>j_(o[l])))}}return{columns:[t("knowledge.value")],rows:e.map(s=>[j_(s)])}}const n=Ane(e),i=Object.entries(n);if(i.length===0)return null;if(i.every(([,r])=>Array.isArray(r))){const r=i.map(([o])=>o),s=Math.max(...i.map(([,o])=>o.length));return{columns:r,rows:Array.from({length:s},(o,l)=>i.map(([,c])=>j_(c[l])))}}return{columns:[t("knowledge.field"),t("knowledge.value")],rows:i.map(([r,s])=>[r,j_(s)])}}function nLe(e){const t=e.trim();if(!t||t.startsWith("//"))return"";if(t.startsWith("/"))return t;try{const n=new URL(t);return["http:","https:"].includes(n.protocol)?n.href:""}catch{return""}}function i2t(e){const t=nLe(e);return t.startsWith("http://")||t.startsWith("https://")?t:""}function r2t(e){var r;const t=e.attachmentType.trim().toLocaleLowerCase();if(t==="image"||t==="doc-image"||t.startsWith("image/"))return"image";if(t==="audio"||t.startsWith("audio/"))return"audio";if(t==="video"||t.startsWith("video/"))return"video";if(t==="pdf"||t==="application/pdf")return"pdf";const n=e.attachmentUrl.split(/[?#]/,1)[0],i=n.includes(".")?((r=n.split(".").pop())==null?void 0:r.toLocaleLowerCase())??"":"";return JMe.has(i)?"image":eLe.has(i)?"audio":tLe.has(i)?"video":ZTt.has(i)?"pdf":t||i?"file":"none"}function s2t(e,t){const n=e.status.trim().toLocaleLowerCase();if(e2t.has(n))return{title:t("knowledge.preview.processingTitle"),detail:t("knowledge.preview.processingDetail")};if(t2t.has(n))return{title:t("knowledge.preview.failedTitle"),detail:t("knowledge.preview.failedDetail")};const i=l9(e).toLocaleLowerCase();return i==="pdf"||JTt.has(i)?{title:t("knowledge.preview.noParsedTitle"),detail:t("knowledge.preview.noParsedDetail")}:JMe.has(i)||eLe.has(i)||tLe.has(i)?{title:t("knowledge.preview.noMediaTitle"),detail:t("knowledge.preview.noMediaDetail")}:{title:t("knowledge.preview.noDataTitle"),detail:t("knowledge.preview.noDataDetail")}}function a2t({chunk:e}){const{t}=Te("ui"),[n,i]=p.useState(!1),r=nLe(e.attachmentUrl),s=r2t(e);return!r||s==="none"?null:n?a.jsx("div",{className:"knowledge-preview__attachment-error",children:t("knowledge.preview.attachmentError")}):s==="image"?a.jsx("img",{className:"knowledge-preview__image",src:r,alt:e.title||t("knowledge.preview.imageAlt"),loading:"lazy",onError:()=>i(!0)}):s==="audio"?a.jsx("audio",{className:"knowledge-preview__audio",src:r,controls:!0,preload:"metadata",onError:()=>i(!0),children:t("knowledge.preview.audioUnsupported")}):s==="video"?a.jsx("video",{className:"knowledge-preview__video",src:r,controls:!0,playsInline:!0,preload:"metadata",onError:()=>i(!0),children:t("knowledge.preview.videoUnsupported")}):s==="pdf"?a.jsxs("div",{className:"knowledge-preview__pdf",children:[a.jsx("iframe",{src:r,title:e.title?t("knowledge.preview.namedPdf",{name:e.title}):t("knowledge.preview.pdf"),sandbox:"",referrerPolicy:"no-referrer",onError:()=>i(!0)}),a.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:t("knowledge.preview.openPdf")})]}):a.jsxs("div",{className:"knowledge-preview__file-fallback",children:[a.jsx("p",{children:t("knowledge.preview.fileUnsupported")}),a.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:t("knowledge.preview.openOriginalFile")})]})}function o2t({base:e,item:t,onClose:n}){const{t:i}=Te("ui"),[r,s]=p.useState([]),[o,l]=p.useState(t),[c,u]=p.useState(""),[d,f]=p.useState(!0),[h,m]=p.useState(!1),[g,b]=p.useState(!1),[v,y]=p.useState(""),w=p.useRef(0),x=p.useRef(null),O=p.useCallback(async(E=0)=>{var R;(R=x.current)==null||R.abort();const j=new AbortController;x.current=j;const T=w.current+1;w.current=T,E>0?m(!0):f(!0),y(""),E===0&&(s([]),b(!1));try{const A=await Pbt(e.id,t.id,{region:e.region,offset:E,signal:j.signal});if(w.current!==T)return;l(A.document.id?A.document:t),u(A.sourceMarkdown||A.document.sourceMarkdown),s(N=>E>0?[...N,...A.chunks]:A.chunks),b(A.hasMore)}catch(A){!a9(A)&&w.current===T&&y(El(A,i("knowledge.errors.loadPreview")))}finally{w.current===T&&(f(!1),m(!1))}},[e.id,e.region,t,i]);p.useEffect(()=>(O(),()=>{var E;(E=x.current)==null||E.abort(),w.current+=1}),[O]);const k=i2t(o.url||t.url),S=s2t(o,i),C=o.metadata._veadk_content_format==="markdown";return a.jsx(yT,{title:o.name||t.name||t.id,onClose:n,className:"knowledge-dialog--preview",children:a.jsxs("div",{className:"knowledge-preview",children:[o.sizeBytes>0||k?a.jsxs("div",{className:"knowledge-preview__meta",children:[o.sizeBytes>0?a.jsx("span",{children:aq(o.sizeBytes)}):null,k?a.jsx("a",{href:k,target:"_blank",rel:"noopener noreferrer",children:i("knowledge.openOriginalWeb")}):null]}):null,a.jsx("div",{className:"knowledge-preview__body","aria-live":"polite",children:c?a.jsx("div",{className:"knowledge-preview__markdown-shell",children:a.jsx(Td,{text:c,allowRawHtml:!1,className:"knowledge-preview__markdown"})}):d?a.jsx("div",{className:"knowledge-preview__state",role:"status",children:a.jsx(fn,{as:"span",duration:2.4,children:i("knowledge.preview.loading")})}):v&&r.length===0?a.jsxs("div",{className:"knowledge-preview__state is-error",role:"alert",children:[a.jsx("p",{children:v}),a.jsx("button",{type:"button",onClick:()=>void O(),children:i("common.retry")})]}):r.length===0?a.jsxs("div",{className:"knowledge-preview__state",children:[a.jsx("p",{children:S.title}),a.jsx("span",{children:k?i("knowledge.preview.openOriginalHint"):S.detail}),a.jsx("button",{type:"button",onClick:()=>void O(),children:i("common.reload")})]}):a.jsxs("div",{className:"knowledge-preview__chunks",children:[r.map((E,j)=>{const T=n2t(E.tableFields,i),R=E.id||`${j}:${E.title}`;return a.jsxs("article",{className:"knowledge-preview__chunk",children:[a.jsx("header",{children:a.jsx("h3",{children:E.title||i("knowledge.preview.chunk",{index:j+1})})}),E.content?C?a.jsx(Td,{text:E.content,allowRawHtml:!1,className:"knowledge-preview__markdown"}):a.jsx("p",{className:"knowledge-preview__content",children:E.content}):null,T?a.jsx("div",{className:"knowledge-preview__table-wrap",children:a.jsxs("table",{children:[a.jsx("thead",{children:a.jsx("tr",{children:T.columns.map((A,N)=>a.jsx("th",{scope:"col",children:A},`${A}:${N}`))})}),a.jsx("tbody",{children:T.rows.map((A,N)=>a.jsx("tr",{children:A.map((P,I)=>a.jsx("td",{children:P},I))},N))})]})}):null,a.jsx(a2t,{chunk:E})]},R)}),v?a.jsx("div",{className:"knowledge-preview__more-error",role:"alert",children:v}):null,g?a.jsx("button",{type:"button",className:"knowledge-preview__load-more",disabled:h,onClick:()=>void O(r.length),children:h?a.jsx(fn,{as:"span",duration:2.4,children:i("knowledge.preview.loadingMore")}):i("knowledge.preview.loadMore")}):null]})})]})})}function l2t({cloudProvider:e,region:t,active:n=!0,activationRevision:i=0,onDetailChange:r,toolbarLeading:s,toolbarFilters:o}){const{t:l,i18n:c}=Te("ui"),[u,d]=p.useState([]),[f,h]=p.useState({}),[m,g]=p.useState([]),[b,v]=p.useState(""),[y,w]=p.useState("overview"),[x,O]=p.useState(""),[k,S]=p.useState(""),[C,E]=p.useState(!0),[j,T]=p.useState(!1),[R,A]=p.useState(""),[N,P]=p.useState([]),[I,D]=p.useState(!1),[_,L]=p.useState(""),[F,M]=p.useState(""),[V,q]=p.useState(""),[U,J]=p.useState(!1),[z,Z]=p.useState(!1),[ne,W]=p.useState(!1),[G,H]=p.useState(null),[se,Y]=p.useState(null),[X,ie]=p.useState(null),[ee,be]=p.useState(null),[ue,pe]=p.useState(null),[ke,je]=p.useState(!1),Pe=p.useRef(0),Ee=p.useRef(0),ze=p.useRef([]),_e=p.useRef(!1),ae=p.useRef(!1),le=p.useRef(null),ge=p.useRef(null),Oe=p.useRef({}),Se=p.useRef(!1),We=p.useRef(null),Ye=p.useRef(null),ye=p.useRef(null),we=p.useRef(null),Ae=p.useMemo(()=>[t],[t]),He=p.useCallback(Ke=>`${Ke.region}\0${Ke.id}`,[]),Ue=u.find(Ke=>He(Ke)===b)??null,jt=!!(Ue&&V===He(Ue));p.useEffect(()=>{r==null||r(!!Ue)},[r,Ue]),p.useEffect(()=>{w("overview"),S("")},[b]);const Pt=p.useMemo(()=>{const Ke=x.trim().toLocaleLowerCase();return Ke?u.filter(St=>[St.name,St.description,St.ownerLabel,St.providerKnowledgeId].some(qe=>qe.toLocaleLowerCase().includes(Ke))):u},[u,x]),Kt=p.useMemo(()=>{const Ke=k.trim().toLocaleLowerCase();return Ke?N.filter(St=>[St.name,St.id,l9(St)].some(qe=>qe.toLocaleLowerCase().includes(Ke))):N},[k,N]);p.useEffect(()=>{Y(null)},[Ue==null?void 0:Ue.id,Ue==null?void 0:Ue.region]);const Ct=p.useCallback(async(Ke=!1)=>{var nt;if(Ke&&(Se.current||Object.keys(Oe.current).length===0))return;(nt=le.current)==null||nt.abort();const St=new AbortController;le.current=St;const qe=Pe.current+1;Pe.current=qe,Se.current=!0,Ke?T(!0):E(!0),A(""),Ke||g([]);try{const et=await _bt({regions:Ae,nextTokens:Ke?Oe.current:void 0,signal:St.signal});if(Pe.current!==qe)return;d(Et=>Ke?[...Et,...et.items.filter(At=>!Et.some(It=>He(It)===He(At)))]:et.items),Oe.current=et.nextTokens,h(et.nextTokens);const ft=et.failures.map(({region:Et,error:At})=>`${wh(Et,e)}: ${El(At,l("common.loadFailed"))}`);g(Et=>Ke?[...new Set([...Et,...ft])]:ft),Ke||v(Et=>et.items.some(At=>He(At)===Et)?Et:"")}catch(et){if(a9(et))return;Pe.current===qe&&(Ke?g(ft=>[...new Set([...ft,El(et,l("knowledge.errors.loadMoreBases"))])]):A(El(et,l("knowledge.errors.loadBases"))))}finally{Pe.current===qe&&(Se.current=!1,E(!1),T(!1))}},[He,e,Ae,l]),xt=p.useCallback(async(Ke,St=!1)=>{var et;if(St&&_e.current)return;(et=ge.current)==null||et.abort();const qe=new AbortController;ge.current=qe;const nt=Ee.current+1;Ee.current=nt,St||(ze.current=[],ae.current=!1,P([]),J(!1),M("")),_e.current=!0,D(!0),St?M(""):L("");try{const ft=await Ibt(Ke.id,{region:Ke.region,offset:St?ze.current.length:0,signal:qe.signal});if(Ee.current!==nt)return;q(Gt=>Gt===He(Ke)?"":Gt);const Et=ze.current,At=St?[...Et,...ft.items.filter(Gt=>!Gt.id||!Et.some(Xe=>Xe.id===Gt.id))]:ft.items,It=ft.hasMore&&(!St||At.length>Et.length);ze.current=At,ae.current=It,P(At),J(It)}catch(ft){if(a9(ft))return;Ee.current===nt&&(ft instanceof bM&&ft.errorCode===sPe&&(q(He(Ke)),H(At=>At&&He(At)===He(Ke)?null:At)),St?M(El(ft,l("knowledge.errors.loadMoreData"))):L(El(ft,l("knowledge.errors.loadData"))))}finally{Ee.current===nt&&(_e.current=!1,D(!1))}},[He,l]);p.useEffect(()=>{var Ke;(Ke=le.current)==null||Ke.abort(),Pe.current+=1,Se.current=!1,Oe.current={},d([]),h({}),g([]),v(""),q(""),A(""),E(!0)},[e]),p.useEffect(()=>{if(n)return Ct(),()=>{var Ke;(Ke=le.current)==null||Ke.abort(),Pe.current+=1,Se.current=!1}},[n,i,Ct]),p.useEffect(()=>{var Ke,St;if(!n){(Ke=ge.current)==null||Ke.abort(),Ee.current+=1,_e.current=!1;return}if(!Ue){(St=ge.current)==null||St.abort(),Ee.current+=1,ze.current=[],_e.current=!1,ae.current=!1,P([]),J(!1),M("");return}return xt(Ue),()=>{var qe;(qe=ge.current)==null||qe.abort(),Ee.current+=1,_e.current=!1}},[n,i,Ue==null?void 0:Ue.id,Ue==null?void 0:Ue.region]);const tt=n&&!Ue&&!x.trim()&&!C&&!j&&!R&&Object.keys(f).length>0;p.useEffect(()=>{const Ke=Ye.current,St=We.current;if(!Ke||!St||!tt)return;const qe=new IntersectionObserver(([nt])=>{nt.isIntersecting&&Ct(!0)},{root:St,rootMargin:"240px 0px",threshold:.01});return qe.observe(Ke),()=>qe.disconnect()},[tt,Ct]);const mt=()=>{const Ke=We.current;!Ke||!tt||Ke.scrollHeight-Ke.scrollTop-Ke.clientHeight<=240&&Ct(!0)},Ne=!!(Ue&&N.length>0&&U&&!I&&!F);p.useEffect(()=>{const Ke=we.current,St=ye.current;if(!Ue||!Ke||!St||!Ne)return;const qe=new IntersectionObserver(([nt])=>{nt.isIntersecting&&xt(Ue,!0)},{root:ye.current,rootMargin:"240px 0px",threshold:.01});return qe.observe(Ke),()=>qe.disconnect()},[Ne,xt,Ue==null?void 0:Ue.id,Ue==null?void 0:Ue.region]);const Ot=()=>{const Ke=ye.current;if(!Ue||!Ke||!ae.current||_e.current||F)return;const{scrollHeight:St,scrollTop:qe,clientHeight:nt}=Ke;St-qe-nt<=240&&xt(Ue,!0)},Nt=Ke=>{d(St=>St.map(qe=>He(qe)===He(Ke)?Ke:qe))},Yt=async()=>{if(ee){je(!0);try{await Rbt(ee.id,ee.region),d(Ke=>Ke.filter(St=>He(St)!==He(ee))),q(Ke=>Ke===He(ee)?"":Ke),b===He(ee)&&v(""),be(null)}catch(Ke){A(El(Ke,l("knowledge.errors.deleteBase"))),be(null)}finally{je(!1)}}},xn=async()=>{if(!(!Ue||!ue)){je(!0);try{await Fbt(Ue.id,ue.id,Ue.region);const Ke=ze.current.filter(St=>St.id!==ue.id);ze.current=Ke,P(Ke),pe(null)}catch(Ke){L(El(Ke,l("knowledge.errors.deleteDocument"))),pe(null)}finally{je(!1)}}};return a.jsxs("section",{className:`knowledge-library${Ue?" is-detail":" resource-collection"}`,"aria-label":l("knowledge.library"),children:[Ue?a.jsx(oT,{className:"knowledge-library__detail",title:Ue.name,description:Ue.description||l("common.noDescription"),identitySeed:Ue.name,backLabel:l("knowledge.backToList"),onBack:()=>v(""),sections:[{key:"overview",label:l("skillCenter.overview"),content:a.jsx("section",{className:"knowledge-overview",children:a.jsxs(bH,{className:"knowledge-overview__summary",children:[a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.provider")}),a.jsx("dd",{children:Ue.providerType||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.knowledgeId")}),a.jsx("dd",{className:"knowledge-keyboard-reveal",tabIndex:0,title:Ue.providerKnowledgeId,children:Ue.providerKnowledgeId||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.project")}),a.jsx("dd",{children:Ue.projectName||"default"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.creator")}),a.jsx("dd",{children:P4(Ue.ownerLabel)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("skillCenter.updatedAt")}),a.jsx("dd",{children:zTt(Ue.updatedAt,c.resolvedLanguage??c.language)||"-"})]})]})})},{key:"data",label:l("knowledge.data"),content:a.jsx("section",{className:"knowledge-documents",children:a.jsx("div",{className:`knowledge-documents__body${N.length>0?" is-table":""}`,"aria-live":"polite",children:I&&N.length===0?a.jsx(cl,{}):_&&N.length===0?a.jsxs("div",{className:"knowledge-library__state is-error",role:"alert",children:[a.jsx("p",{children:_}),jt&&Ue.canManage?a.jsx("button",{type:"button",onClick:()=>be(Ue),children:l("knowledge.deleteInvalidAssociation")}):a.jsx("button",{type:"button",onClick:()=>void xt(Ue),children:l("common.retry")})]}):N.length===0?a.jsxs("div",{className:"knowledge-library__state",children:[a.jsx(BTt,{}),a.jsx("p",{children:l("knowledge.noData")}),Ue.canManage&&a.jsx("button",{type:"button",onClick:()=>H(Ue),children:l("knowledge.addFirstData")})]}):a.jsx(yH,{rows:Kt,rowKey:Ke=>Ke.id,rowLabel:Ke=>Ke.name||Ke.id,columns:[{key:"name",header:l("common.name"),className:"is-primary-column",render:Ke=>a.jsx("span",{title:Ke.name||Ke.id,children:Ke.name||Ke.id})},{key:"format",header:l("knowledge.format"),className:"is-compact-column",render:Ke=>l9(Ke)},{key:"size",header:l("knowledge.size"),className:"is-compact-column",render:Ke=>aq(Ke.sizeBytes)}],searchValue:k,onSearchChange:S,searchPlaceholder:l("knowledge.searchData"),searchLabel:l("knowledge.searchLibraryData"),primaryAction:Ue.canManage?{label:l(jt?"knowledge.associationInvalid":"knowledge.addData"),disabled:jt,title:jt?l("knowledge.providerMissing"):void 0,onClick:()=>H(Ue)}:void 0,rowActions:Ke=>[{label:l("common.preview"),onSelect:()=>Y(Ke)},...Ue.canManage?[{label:l("common.edit"),onSelect:()=>ie(Ke)},{label:l("common.delete"),onSelect:()=>pe(Ke),danger:!0}]:[]],scrollRef:ye,onScroll:Ot,busy:I,emptyLabel:l("knowledge.noMatchingData"),footer:I?a.jsxs("div",{className:"knowledge-document-pagination",role:"status","aria-live":"polite",children:[a.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),a.jsx("span",{children:l("knowledge.loadingMoreData")})]}):F?a.jsxs("div",{className:"knowledge-document-pagination is-error",role:"alert",children:[a.jsx("span",{children:F}),a.jsx("button",{type:"button",onClick:()=>void xt(Ue,!0),children:l("knowledge.retryLoading")})]}):U?a.jsx("div",{ref:we,className:"knowledge-document-pagination",role:"status","aria-live":"polite",children:l("skillCenter.scrollForMore")}):null})})})}],activeSectionKey:y,navigationLabel:l("knowledge.details"),onSectionChange:w,actions:Ue.canManage?a.jsxs(a.Fragment,{children:[a.jsx(_t,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>be(Ue),children:l("common.delete")}),a.jsx(_t,{type:"button",color:"primary",size:"lg",pill:!1,onClick:()=>W(!0),children:l("common.edit")})]}):void 0}):a.jsxs(a.Fragment,{children:[a.jsxs(sb,{className:"knowledge-library__toolbar library-resource-toolbar",children:[s,a.jsxs("div",{className:"resource-toolbar__actions",children:[o,a.jsx(Zp,{value:x,onChange:Ke=>O(Ke.target.value),placeholder:l("knowledge.searchBases"),"aria-label":l("knowledge.searchBases")})]})]}),a.jsxs(Jp,{ref:We,"aria-live":"polite",onScroll:mt,children:[m.length>0&&!C&&a.jsxs("div",{className:"knowledge-region-warning",role:"status",children:[a.jsx("span",{children:l("knowledge.someBasesFailed")}),a.jsx("button",{type:"button",onClick:()=>void Ct(),children:l("common.retry")})]}),C&&u.length===0?a.jsx(cl,{}):R?a.jsxs("div",{className:"knowledge-library__state is-error",role:"alert",children:[a.jsx("p",{children:R}),a.jsx("button",{type:"button",onClick:()=>void Ct(),children:l("common.retry")})]}):Pt.length===0&&x.trim()?a.jsxs("div",{className:"knowledge-library__state",children:[a.jsx(FTt,{}),a.jsx("p",{children:l("knowledge.noMatchingBases")})]}):a.jsxs(W0,{children:[x.trim()?null:a.jsx(lb,{"aria-label":l("knowledge.createBase"),icon:a.jsx(QTt,{}),onClick:()=>Z(!0),children:l("knowledge.createBase")}),Pt.map(Ke=>a.jsx(G0,{className:"knowledge-card",title:Ke.name,description:Ke.description||l("common.noDescription"),metadata:[{label:l("knowledge.creator"),value:P4(Ke.ownerLabel),title:P4(Ke.ownerLabel)},{label:l("knowledge.project"),value:Ke.projectName||"default",title:Ke.projectName||"default"}],action:{label:V===He(Ke)?l("knowledge.associationInvalid"):l("knowledge.addData"),icon:"plus",disabled:!Ke.canManage||V===He(Ke),title:Ke.canManage?V===He(Ke)?l("knowledge.providerMissing"):void 0:l("knowledge.noManagePermission"),onClick:()=>H(Ke)},detailAction:{label:l("common.viewDetails"),onClick:()=>v(He(Ke))}},He(Ke)))]}),tt||j?a.jsx("div",{ref:Ye,className:"my-agent-load-more",role:"status","aria-live":"polite",children:j?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),a.jsx("span",{children:l("knowledge.loadingMoreBases")})]}):tt?a.jsx("span",{children:l("skillCenter.scrollForMore")}):null}):null]})]}),z&&a.jsx(KTt,{region:t,onClose:()=>Z(!1),onCreated:Ke=>{d(St=>[Ke,...St]),v(He(Ke)),Z(!1)}}),Ue&&ne&&a.jsx(GTt,{item:Ue,onClose:()=>W(!1),onUpdated:Ke=>{Nt(Ke),W(!1)}}),Ue&&se&&a.jsx(o2t,{base:Ue,item:se,onClose:()=>Y(null)}),G&&a.jsx(XTt,{base:G,onClose:()=>H(null),onAssociationInvalid:Ke=>{q(He(G)),Ue&&He(Ue)===He(G)&&L(El(Ke,l("knowledge.associationInvalid"))),H(null)},onCreated:()=>{Ue&&He(Ue)===He(G)&&xt(Ue),H(null)}}),Ue&&X&&a.jsx(YTt,{base:Ue,item:X,onClose:()=>ie(null),onUpdated:Ke=>{const St=ze.current.map(qe=>qe.id===Ke.id?Ke:qe);ze.current=St,P(St),ie(null)}}),ee&&a.jsx(Cd,{title:l("knowledge.deleteBaseTitle"),description:l("knowledge.deleteBaseDescription",{name:ee.name}),confirmLabel:l(ke?"common.deleting":"common.delete"),variant:"danger",busy:ke,onCancel:()=>be(null),onConfirm:()=>void Yt()}),ue&&a.jsx(Cd,{title:l("knowledge.deleteDocumentTitle"),description:l("knowledge.deleteDocumentDescription",{name:ue.name||ue.id}),confirmLabel:l(ke?"common.deleting":"common.delete"),variant:"danger",busy:ke,onCancel:()=>pe(null),onConfirm:()=>void xn()})]})}const c2t="_EmptyMessage_1r5gu_1",u2t="_IconBadge_1r5gu_16",d2t="_Title_1r5gu_54",f2t="_Description_1r5gu_69",h2t="_ActionRow_1r5gu_77",vT={EmptyMessage:c2t,IconBadge:u2t,Title:d2t,Description:f2t,ActionRow:h2t},Wn=({children:e,className:t,fill:n="static"})=>a.jsx("div",{className:Ui(vT.EmptyMessage,t),"data-fill":n,children:e}),p2t=({size:e="md",color:t="secondary",children:n,className:i})=>a.jsx("div",{className:Ui(vT.IconBadge,i),"data-size":e,"data-color":t,children:n}),m2t=({children:e,className:t,color:n="secondary"})=>a.jsx("div",{className:Ui(vT.Title,t),"data-color":n,children:e}),g2t=({children:e,className:t})=>a.jsx("div",{className:Ui(vT.Description,t),children:e}),b2t=({children:e,className:t})=>a.jsx("div",{className:Ui(vT.ActionRow,t),children:e});Wn.Icon=p2t;Wn.Title=m2t;Wn.Description=g2t;Wn.ActionRow=b2t;bn.hasResourceBundle("en-US","skills")||bn.addResourceBundle("en-US","skills",zme,!0,!0);bn.hasResourceBundle("zh-CN","skills")||bn.addResourceBundle("zh-CN","skills",Gwe,!0,!0);function en(e,t={}){return bn.t(e,{...t,ns:"skills"})}const y2t="/web/skill-workbench";class c9 extends Error{constructor(t,n,i="SKILL_WORKBENCH_ERROR",r=!1,s="",o,l=""){super(t),this.status=n,this.code=i,this.retryable=r,this.statusText=s,this.originalError=o,this.rawResponse=l,this.name="SkillWorkbenchApiError"}}function Od(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(en("api.invalidFormat",{label:t}));return e}function Tne(e,t){if(e!=null){if(typeof e!="string"||!e.trim()||e.trim().length>256)throw new Error(en("api.invalidFormat",{label:t}));return e.trim()}}function v2t(e){if(e!=null){if(e==="pending"||e==="ready"||e==="failed"||e==="unknown")return e;throw new Error(en("api.invalidFormat",{label:en("api.recoveryStatus")}))}}async function Sh(e,t={},n=ho){return fetch(Ta(`${y2t}${e}`),{...t,headers:uc(t.headers),signal:po(t.signal,n)})}async function oq(e,t){var i;const n=await e.text().catch(()=>"");try{const r=Od(JSON.parse(n),en("api.errorResponse")),s=r.detail&&typeof r.detail=="object"?Od(r.detail,en("api.errorDetails")):r;return new c9(typeof s.message=="string"?s.message:t,e.status,typeof s.code=="string"?s.code:"SKILL_WORKBENCH_ERROR",s.retryable===!0,e.statusText,s.originalError&&typeof s.originalError=="object"?s.originalError:void 0,n)}catch{const r=((i=e.headers.get("content-type"))==null?void 0:i.split(";",1)[0])||en("api.missingContentType");return new c9(en("api.gatewayError",{fallback:t,status:e.status,contentType:r}),e.status,"SKILL_WORKBENCH_ERROR",!1,e.statusText,void 0,n)}}async function ub(e,t){if(!e.ok)throw await oq(e,t);const n=e.headers.get("content-type")??"";if(!n.includes("application/json")){const i=n.split(";",1)[0]||en("api.missingContentType");throw new Error(en("api.nonJson",{fallback:t,status:e.status,contentType:i}))}return e.json()}function x2t(e){return Array.isArray(e)?e.map(t=>{const n=Od(t,en("api.activity")),i=n.kind,r=n.status;if(typeof n.id!="string"||!["status","thinking","message","tool"].includes(String(i))||!["running","done"].includes(String(r)))throw new Error(en("api.invalidActivity"));if(i==="tool"){if(typeof n.name!="string")throw new Error(en("api.invalidToolActivity"));return{id:n.id,kind:i,status:r,name:n.name,...n.input!==void 0?{args:n.input}:{},...n.output!==void 0?{response:n.output}:{}}}if(typeof n.text!="string")throw new Error(en("api.invalidTextActivity"));return{id:n.id,kind:i,status:r,text:n.text}}):[]}function w2t(e){if(e==null)return;const t=Od(e,en("api.publication"));if(typeof t.revision!="number"||typeof t.skillId!="string"||typeof t.version!="string"||!Array.isArray(t.skillSpaceIds)||!t.skillSpaceIds.every(n=>typeof n=="string")||t.disposition!=="create-new"&&t.disposition!=="update-source"||!AD(t.region)||typeof t.projectName!="string")throw new Error(en("api.invalidFormat",{label:en("api.publication")}));return{revision:t.revision,skillId:t.skillId,version:t.version,skillSpaceIds:t.skillSpaceIds,disposition:t.disposition,region:t.region,projectName:t.projectName}}function TC(e){const t=Od(e,en("api.task"));if(typeof t.jobId!="string"||t.operation!=="create"&&t.operation!=="optimize"||typeof t.intent!="string"||typeof t.revision!="number"||typeof t.state!="string")throw new Error(en("api.invalidFormat",{label:en("api.task")}));const n=Array.isArray(t.files)?t.files.flatMap(l=>{const c=Od(l,en("api.file"));return typeof c.path=="string"&&typeof c.size=="number"?[{path:c.path,size:c.size}]:[]}):[];if(!["running","ready","failed","cancelled","expired","published"].includes(t.state))throw new Error(en("api.unknownTaskState"));const r=Tne(t.toolId,"Tool ID"),s=Tne(t.sessionId,"Session ID"),o=v2t(t.recoveryStatus);return{jobId:t.jobId,operation:t.operation,intent:t.intent,...typeof t.model=="string"?{model:t.model}:{},...typeof t.style=="string"?{style:t.style}:{},...typeof t.requestedName=="string"?{requestedName:t.requestedName}:{},revision:t.revision,...r?{toolId:r}:{},...s?{sessionId:s}:{},...typeof t.sessionTtlSeconds=="number"?{sessionTtlSeconds:t.sessionTtlSeconds}:{},...typeof t.expiresAt=="string"?{expiresAt:t.expiresAt}:{},...typeof t.recoveryAvailable=="boolean"?{recoveryAvailable:t.recoveryAvailable}:{},...o?{recoveryStatus:o}:{},...typeof t.recoveredFromSnapshot=="boolean"?{recoveredFromSnapshot:t.recoveredFromSnapshot}:{},state:t.state,stage:typeof t.stage=="string"?t.stage:"generating",activities:x2t(t.activities),files:n,...t.source&&typeof t.source=="object"?{source:t.source}:{},...typeof t.name=="string"?{name:t.name}:{},...typeof t.description=="string"?{description:t.description}:{},...typeof t.skillMd=="string"?{skillMd:t.skillMd}:{},...typeof t.error=="string"?{error:t.error}:{},...t.validation&&typeof t.validation=="object"?{validation:t.validation}:{},...t.publication?{publication:w2t(t.publication)}:{}}}async function NM(e){const t=Od(await ub(await Sh("/capabilities",{signal:e}),en("api.loadCapability")),en("api.capability"));return{enabled:t.enabled===!0,reason:typeof t.reason=="string"?t.reason:"",operations:Array.isArray(t.operations)?t.operations.filter(n=>n==="create"||n==="optimize"):[],models:Array.isArray(t.models)?t.models.flatMap(n=>{if(!n||typeof n!="object")return[];const i=n;return typeof i.id=="string"&&typeof i.label=="string"?[{id:i.id,label:i.label}]:[]}):[],styles:t.styles&&typeof t.styles=="object"&&!Array.isArray(t.styles)?Object.fromEntries(Object.entries(t.styles).filter(n=>typeof n[1]=="string")):{},...typeof t.maxUploadBytes=="number"?{maxUploadBytes:t.maxUploadBytes}:{}}}async function O2t(e){if(e.file){const n=new URLSearchParams({operation:"optimize",intent:e.intent});e.jobId&&n.set("job_id",e.jobId),e.model&&n.set("model",e.model),e.style&&n.set("style",e.style),e.name&&n.set("name",e.name);const i=await Sh(`/tasks/from-upload?${n}`,{method:"POST",body:e.file,headers:{"Content-Type":"application/zip"},signal:e.signal},hr);return TC(await ub(i,en("api.startOptimization")))}const t=await Sh("/tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operation:e.operation,intent:e.intent,...e.model?{model:e.model}:{},...e.style?{style:e.style}:{},...e.name?{name:e.name}:{},...e.jobId?{jobId:e.jobId}:{},...e.source?{source:{kind:"skill-center",skillId:e.source.skillId,skillName:e.source.name,version:e.source.version,region:e.source.region,projectName:e.source.projectName,skillSpaceId:e.source.skillSpaceId,skillSpaceName:e.source.skillSpaceName}}:{}}),signal:e.signal},hr);return TC(await ub(t,en("api.startTask")))}async function k2t(e,t){return TC(await ub(await Sh(`/tasks/${encodeURIComponent(e)}`,{signal:t}),en("api.loadTask")))}async function D4(e,t,n){const i=new URLSearchParams;i.set("expected_revision",String(t));const r=Od(await ub(await Sh(`/tasks/${encodeURIComponent(e)}/artifact?${i.toString()}`,{signal:n}),en("api.loadArtifact")),en("api.artifact"));if(r.jobId!==e||r.revision!==t||!Number.isSafeInteger(r.revision)||r.revision<1||typeof r.sha256!="string"||!/^[0-9a-f]{64}$/.test(r.sha256)||typeof r.name!="string"||typeof r.description!="string"||!Array.isArray(r.files))throw new Error(en("api.invalidFormat",{label:en("api.artifact")}));const s=r.files.map(o=>{const l=Od(o,en("api.artifactFile"));if(typeof l.path!="string"||typeof l.size!="number"||typeof l.content!="string")throw new Error(en("api.invalidFormat",{label:en("api.artifactFile")}));return{path:l.path,size:l.size,content:l.content}});return{jobId:r.jobId,revision:r.revision,sha256:r.sha256,name:r.name,description:r.description,files:s}}async function M4(e){const t=await Sh(`/tasks/${encodeURIComponent(e.jobId)}/refinements`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({intent:e.intent,expectedRevision:e.expectedRevision})},hr);return TC(await ub(t,en("api.refine")))}async function S2t(e){const t=await Sh(`/tasks/${encodeURIComponent(e.jobId)}/stop`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expectedRevision:e.expectedRevision})});return TC(await ub(t,en("api.stop")))}async function E2t(e){const t=await Sh(`/tasks/${encodeURIComponent(e.jobId)}/publish-stream`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/x-ndjson"},body:JSON.stringify({disposition:e.disposition,expectedRevision:e.expectedRevision,expectedArtifactSha256:e.expectedArtifactSha256,skillSpaceIds:e.skillSpaceIds??[],projectName:e.projectName,region:e.region}),signal:e.signal},0);if(!t.ok)throw await oq(t,en("api.publish"));if(!(t.headers.get("content-type")??"").includes("application/x-ndjson"))throw new Error(en("api.nonNdjson"));if(!t.body)throw new Error(en("api.missingStream"));const i=new Set(["preparing","uploading","registering","activating","publishing"]);let r=null,s="";const o=new TextDecoder,l=t.body.getReader(),c=u=>{var h;if(!u.trim())return;const d=Od(JSON.parse(u),en("api.publishProgress"));if(d.type==="progress"){if(typeof d.phase!="string"||!i.has(d.phase)||typeof d.message!="string")throw new Error(en("api.invalidPublishProgress"));(h=e.onProgress)==null||h.call(e,{phase:d.phase,message:d.message});return}if(d.type==="error"){const m=Od(d.error,en("api.publishError"));throw new c9(typeof m.message=="string"?m.message:en("api.publish"),500,typeof m.code=="string"?m.code:"SKILL_PUBLISH_FAILED",m.retryable===!0,"",m.originalError&&typeof m.originalError=="object"?m.originalError:void 0,JSON.stringify(d.error))}if(d.type!=="complete")throw new Error(en("api.unknownPublishEvent"));const f=Od(d.result,en("api.publishResult"));if(typeof f.skillId!="string"||typeof f.version!="string"||!Array.isArray(f.skillSpaceIds)||!f.skillSpaceIds.every(m=>typeof m=="string")||f.disposition!=="create-new"&&f.disposition!=="update-source"||!AD(f.region)||typeof f.projectName!="string")throw new Error(en("api.invalidFormat",{label:en("api.publishResult")}));r={skillId:f.skillId,version:f.version,skillSpaceIds:f.skillSpaceIds,disposition:f.disposition,region:f.region,projectName:f.projectName}};for(;;){const{value:u,done:d}=await l.read();s+=o.decode(u,{stream:!d});const f=s.split(` -`);if(s=f.pop()??"",f.forEach(c),d)break}if(c(s),!r)throw new Error(en("api.streamEnded"));return r}async function C2t(e){await ub(await Sh(`/tasks/${encodeURIComponent(e)}`,{method:"DELETE"}),en("api.deleteTask"))}async function A2t(e,t,n){var c;const i=new URLSearchParams;i.set("expected_revision",String(t)),i.set("expected_sha256",n);const r=await Sh(`/tasks/${encodeURIComponent(e)}/download?${i.toString()}`,{},hr);if(!r.ok)throw await oq(r,en("api.download"));const o=((c=(r.headers.get("content-disposition")??"").match(/filename="([^"]+)"/))==null?void 0:c[1])??"skill.zip",l=URL.createObjectURL(await r.blob());try{const u=document.createElement("a");u.href=l,u.download=o,u.click()}finally{URL.revokeObjectURL(l)}}const iLe=p.createContext(void 0);function ev(e){const t=p.useContext(iLe);if(t===void 0&&!e)throw new Error(Vc(47));return t}const T2t={...mje,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class _2t extends BD{constructor(n,i,r){const s=new cV;super(j2t(n,s,i,r),N2t(s),T2t);Zt(this,"setOpen",(n,i)=>{var f,h;const r=i.reason===mu,s=i.reason===Yw&&i.event.detail===0,o=!n&&(i.reason===T_e||i.reason==null),l=sst(i),c=this.select("activeTriggerId");if(!n&&i.reason===A_e&&i.trigger==null&&c!=null&&(i.trigger=this.context.triggerElements.getById(c)??this.select("activeTriggerElement")??void 0),(h=(f=this.context).onOpenChange)==null||h.call(f,n,i),i.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,i);const u=()=>{const m={open:n,openChangeReason:i.reason};aje(m,n,i.trigger,l()),this.update(m)};r?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(Iit,()=>{this.set("stickIfOpen",!1)}),yi.flushSync(u)):u();let d;s?d="click":o?d="dismiss":i.reason===cC&&(d="focus"),this.set("instantType",d)})}}function j2t(e,t,n,i=!1){const r={...fje(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return r.open&&(e==null?void 0:e.mounted)===void 0&&(r.mounted=!0),r.floatingRootContext=hje(t,n,i),r}function N2t(e){return{popupRef:p.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:p.createRef(),beforeContentFocusGuardRef:p.createRef(),stickIfOpenTimeout:new Lu,triggerElements:e}}function _ne({props:e}){const{children:t,open:n,defaultOpen:i=!1,onOpenChange:r,onOpenChangeComplete:s,modal:o=!1,handle:l,triggerId:c,defaultTriggerId:u=null}=e,d=I2t(l,{modal:o,open:i,openProp:n,activeTriggerId:u,triggerIdProp:c});d.useControlledProp("openProp",n),d.useControlledProp("triggerIdProp",c);const f=d.useState("open"),h=d.useState("mounted"),m=d.useState("payload");d.useContextCallback("onOpenChange",r),d.useContextCallback("onOpenChangeComplete",s),dje(d,f),lje(d);const{forceUnmount:g}=cje(f,d,()=>{d.update({stickIfOpen:!0,openChangeReason:null})});d.useSyncedValues({modal:o}),p.useEffect(()=>{f||d.context.stickIfOpenTimeout.clear()},[d,f]),p.useImperativeHandle(e.actionsRef,()=>({unmount:g,close:()=>d.setOpen(!1,fa(__e))}),[g,d]);const b=f||h;return a.jsxs(iLe.Provider,{value:d,children:[l&&a.jsx(sje,{handle:l,store:d}),b&&a.jsx(P2t,{store:d,modal:o}),typeof t=="function"?t({payload:m}):t]})}function R2t(e){return ev(!0)?a.jsx(_ne,{props:e}):a.jsx(frt,{children:a.jsx(_ne,{props:e})})}function I2t(e,t){const n=rje((i,r)=>new _2t(t,i,r));return p.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function P2t({store:e,modal:t}){const n=e.useState("floatingRootContext"),i=U_e(n,{outsidePressEvent:{mouse:t==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),r=i.reference,s=i.floating;return uje(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:s}),null}const D2t=300;function em(e){return VA(e,"base-ui")}function M2t(e,t){const n=p.useRef(null);function i(s){yi.flushSync(()=>{e.setOpen(!1,fa(cC,s.nativeEvent,s.currentTarget))});const o=cit(n.current);o==null||o.focus()}function r(s){var l;const o=e.select("positionerElement");if(o&&rw(s,o))(l=e.context.beforeContentFocusGuardRef.current)==null||l.focus();else{yi.flushSync(()=>{e.setOpen(!1,fa(cC,s.nativeEvent,s.currentTarget))});let c=lit(e.context.triggerFocusTargetRef.current||t.current);for(;c!==null&&ii(o,c);){const u=c;if(c=Jz(c),c===u)break}c==null||c.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:i,handleFocusTargetFocus:r}}function L2t(e){const t=p.useRef(""),n=p.useCallback(r=>{r.defaultPrevented||(t.current=r.pointerType,e(r,r.pointerType))},[e]);return{onClick:p.useCallback(r=>{if(r.detail===0){e(r,"keyboard");return}"pointerType"in r?e(r,r.pointerType):e(r,t.current),t.current=""},[e]),onPointerDown:n}}function rLe(e,t){const n=ci((s,o)=>{(typeof e=="function"?e():e)||t(o||(HD?"touch":""))}),{onClick:i,onPointerDown:r}=L2t(n);return p.useMemo(()=>({onClick:i,onPointerDown:r}),[i,r])}const $2t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,disabled:o=!1,nativeButton:l=!0,handle:c,payload:u,openOnHover:d=!1,delay:f=D2t,closeDelay:h=0,id:m,...g}=t,b=ev(!0),y=gje(c)??b;if(!y)throw new Error(Vc(74));const w=em(m),x=y.useState("isTriggerActive",w),O=y.useState("floatingRootContext"),k=y.useState("isOpenedByTrigger",w),S=y.useState("triggerPopupId",w),C=p.useRef(null),{registerTrigger:E,isMountedByThisTrigger:j}=oje(w,C,y,{payload:u,disabled:o,openOnHover:d,closeDelay:h}),T=y.useState("openChangeReason"),R=y.useState("stickIfOpen"),A=y.useState("openMethod"),N=y.useState("focusManagerModal"),P=fst(O,{enabled:!o&&d&&(A!=="touch"||T!==Yw),mouseOnly:!0,move:!1,handleClose:mst(),restMs:f,delay:{close:h},triggerElementRef:C,isActiveTrigger:x,isClosing:()=>y.select("transitionStatus")==="ending"}),I=B_e(O,{stickIfOpen:R}),D=rLe(()=>y.select("open"),ne=>{y.set("openMethod",ne)}),_=y.useState("triggerProps",j),{getButtonProps:L,buttonRef:F}=GD({disabled:o,native:l}),M={open(ne){return ne&&T===Yw?_st.open(ne):xje.open(ne)}},{preFocusGuardRef:V,handlePreFocusGuardFocus:q,handleFocusTargetFocus:U}=M2t(y,C),z=Ra("button",t,{state:{disabled:o,open:k},ref:[F,n,E,C],props:[I.reference,P,_,D,{[sV]:"",id:w,"aria-haspopup":"dialog","aria-expanded":k,"aria-controls":S},g,L],stateAttributesMapping:M}),Z=a.jsx(p.Fragment,{children:z},w);return j&&!N?a.jsxs(p.Fragment,{children:[a.jsx(f0,{ref:V,onFocus:q}),Z,a.jsx(f0,{ref:y.context.triggerFocusTargetRef,onFocus:U})]}):Z}),sLe=p.createContext(void 0);function F2t(){const e=p.useContext(sLe);if(e===void 0)throw new Error(Vc(45));return e}const B2t=p.forwardRef(function(t,n){const{keepMounted:i=!1,...r}=t;return ev().useState("mounted")||i?a.jsx(sLe.Provider,{value:i,children:a.jsx(I_e,{ref:n,...r})}):null}),aLe=p.createContext(void 0);function U2t(){const e=p.useContext(aLe);if(!e)throw new Error(Vc(46));return e}const oLe=p.forwardRef(function(t,n){const{cutout:i,...r}=t;let s;if(i){const o=i.getBoundingClientRect();s=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${o.left}px ${o.top}px,${o.left}px ${o.bottom}px,${o.right}px ${o.bottom}px,${o.right}px ${o.top}px,${o.left}px ${o.top}px)`}return a.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...r,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});let jne={},Nne={},Rne="";function RM(e,t){return UA(e)?e:t}function Ine(e,t,n){return/hidden|clip/.test(e.getComputedStyle(RM(t,n)).overflowY)}function Q2t(e){if(typeof document>"u")return!1;const t=kr(e);return ta(t).innerWidth-t.documentElement.clientWidth>0}function z2t(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=kr(e),i=n.documentElement,r=n.body,s=RM(i,r),o=s.style.overflowY,l=i.style.scrollbarGutter;i.style.scrollbarGutter="stable",s.style.overflowY="scroll";const c=s.offsetWidth;s.style.overflowY="hidden";const u=s.offsetWidth;return s.style.overflowY=o,i.style.scrollbarGutter=l,c===u}function V2t(e){const t=kr(e),n=t.documentElement,i=t.body,r=RM(n,i),s={overflowY:r.style.overflowY,overflowX:r.style.overflowX};return Object.assign(r.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(r.style,s)}}function H2t(e){var m;const t=kr(e),n=t.documentElement,i=t.body,r=ta(n);let s=0,o=0,l=!1;const c=_c.create();if(z1&&(((m=r.visualViewport)==null?void 0:m.scale)??1)!==1)return()=>{};function u(){const g=r.getComputedStyle(n),b=r.getComputedStyle(i),w=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,o=n.scrollLeft,jne={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Rne=n.style.scrollBehavior,Nne={position:i.style.position,height:i.style.height,width:i.style.width,boxSizing:i.style.boxSizing,overflowY:i.style.overflowY,overflowX:i.style.overflowX,scrollBehavior:i.style.scrollBehavior};const x=n.scrollHeight>n.clientHeight,O=n.scrollWidth>n.clientWidth,k=g.overflowY==="scroll"||b.overflowY==="scroll",S=g.overflowX==="scroll"||b.overflowX==="scroll",C=Math.max(0,r.innerWidth-i.clientWidth),E=Math.max(0,r.innerHeight-i.clientHeight),j=parseFloat(b.marginTop)+parseFloat(b.marginBottom),T=parseFloat(b.marginLeft)+parseFloat(b.marginRight),R=RM(n,i);if(l=z2t(e),l){n.style.scrollbarGutter=w,R.style.overflowY="hidden",R.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:w,overflowY:"hidden",overflowX:"hidden"}),(x||k)&&(n.style.overflowY="scroll"),(O||S)&&(n.style.overflowX="scroll"),Object.assign(i.style,{position:"relative",height:j||E?`calc(100dvh - ${j+E}px)`:"100dvh",width:T||C?`calc(100vw - ${T+C}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),i.scrollTop=s,i.scrollLeft=o,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function d(){Object.assign(n.style,jne),Object.assign(i.style,Nne),l||(n.scrollTop=s,n.scrollLeft=o,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=Rne)}function f(){d(),c.request(u)}u();const h=Ni(r,"resize",f);return()=>{c.cancel(),d(),typeof r.removeEventListener=="function"&&h()}}class q2t{constructor(){Zt(this,"lockCount",0);Zt(this,"restore",null);Zt(this,"timeoutLock",Lu.create());Zt(this,"timeoutUnlock",Lu.create());Zt(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});Zt(this,"unlock",()=>{var t;this.lockCount===0&&this.restore&&((t=this.restore)==null||t.call(this),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const n=kr(t),i=n.documentElement,r=n.body,s=ta(i);if(Ine(s,i,r)){const l=new s.MutationObserver(()=>{Ine(s,i,r)||(l.disconnect(),this.restore=null,this.lock(t))}),c={attributes:!0};l.observe(i,c),l.observe(r,c),this.restore=()=>l.disconnect();return}const o=HD||!Q2t(t);this.restore=o?V2t(t):H2t(t)}}const W2t=new q2t;function lLe(e=!0,t=null){Jn(()=>{if(e)return W2t.acquire(t)},[e,t])}const K2t=20;function G2t(e,t,n,i){const[r,s]=p.useState(!1);Jn(()=>{if(!e||!t||n==null){s(!1);return}const o=kr(n).documentElement.clientWidth,l=n.offsetWidth;s(o>0&&l>0&&l>=o-K2t)},[e,t,n]),lLe(e&&(!t||r),i)}const X2t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,anchor:o,positionMethod:l,side:c,align:u,sideOffset:d,alignOffset:f,collisionBoundary:h="clipping-ancestors",collisionPadding:m,arrowPadding:g,sticky:b,disableAnchorTracking:v=!1,collisionAvoidance:y=Fit,...w}=t,x=ev(),O=F2t(),k=urt(),S=x.useState("floatingRootContext"),C=x.useState("mounted"),E=x.useState("open"),j=x.useState("openChangeReason"),T=x.useState("activeTriggerElement"),R=x.useState("modal"),A=x.useState("openMethod"),N=x.useState("positionerElement"),P=x.useState("instantType"),I=x.useState("transitionStatus"),D=x.useState("adaptiveOrigin"),_=p.useRef(null),L=rV(N),F=Ost({anchor:o,floatingRootContext:S,positionMethod:l,mounted:C,side:c,sideOffset:d,align:u,alignOffset:f,arrowPadding:g,collisionBoundary:h,collisionPadding:m,sticky:b,disableAnchorTracking:v,keepMounted:O,nodeId:k,collisionAvoidance:y,adaptiveOrigin:D}),M=S.useState("domReferenceElement");Jn(()=>{const z=M,Z=_.current;if(z&&(_.current=z),Z&&z&&z!==Z){x.set("instantType",void 0);const ne=new AbortController;return L(()=>{x.set("instantType","trigger-change")},ne.signal),()=>{ne.abort()}}},[M,L,x]);const V=R===!0&&j!==mu;G2t(E&&V,A==="touch",N,T);const q=x.useStateSetter("positionerElement"),U={open:E,side:F.side,align:F.align,anchorHidden:F.anchorHidden,instant:P},J=jst(t,U,{styles:F.positionerStyles,transitionStatus:I,props:w,refs:[n,q],hidden:!C,inert:!E});return a.jsxs(aLe.Provider,{value:F,children:[C&&V&&a.jsx(oLe,{inert:iV(!E),cutout:T}),a.jsx(drt,{id:k,children:J})]})}),Y2t="ArrowUp",Z2t="ArrowDown",J2t="ArrowLeft",e_t="ArrowRight",t_t="Home",n_t="End",cLe=new Set([Y2t,Z2t,J2t,e_t,t_t,n_t]),i_t=p.createContext(void 0);function r_t(e){return p.useContext(i_t)}const s_t=p.createContext(void 0);function a_t(){const[e,t]=p.useState(0),n=ci(()=>(t(r=>r+1),()=>{t(r=>Math.max(0,r-1))}));return{context:p.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}const o_t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,initialFocus:o,finalFocus:l,...c}=t,u=ev(),d=U2t(),f=r_t()!=null,{context:h,hasClosePart:m}=a_t(),g=u.useState("open"),b=u.useState("openMethod"),v=u.useState("instantType"),y=u.useState("transitionStatus"),w=u.useState("popupProps"),x=u.useState("titleElementId"),O=u.useState("descriptionElementId"),k=u.useState("modal"),S=u.useState("mounted"),C=u.useState("openChangeReason"),E=u.useState("activeTriggerElement"),j=u.useState("floatingRootContext"),T=j.useState("floatingId"),R=u.useState("disabled"),A=u.useState("openOnHover"),N=u.useState("closeDelay");zA({open:g,ref:u.context.popupRef,onComplete(){var F,M;g&&((M=(F=u.context).onOpenChangeComplete)==null||M.call(F,!0))}}),ust(j,{enabled:A&&!R,closeDelay:N});const P=o===void 0?ije(u.context.popupRef):o,I=k!==!1&&m;u.useSyncedValue("focusManagerModal",I);const D=u.useStateSetter("popupElement"),_={open:g,side:d.side,align:d.align,instant:v,transitionStatus:y},L=Ra("div",t,{state:_,ref:[n,u.context.popupRef,D],props:[w,{id:T,role:"dialog",...nje,"aria-labelledby":x,"aria-describedby":O,onKeyDown(F){f&&cLe.has(F.key)&&F.stopPropagation()}},Oje(y),c],stateAttributesMapping:wje});return a.jsx(F_e,{context:j,openInteractionType:b,modal:I,disabled:!S||C===mu,initialFocus:P,returnFocus:l,restoreFocus:"popup",previousFocusableElement:Js(E)?E:void 0,nextFocusableElement:u.context.triggerFocusTargetRef,beforeContentFocusGuardRef:u.context.beforeContentFocusGuardRef,children:a.jsx(s_t.Provider,{value:h,children:L})})}),l_t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...o}=t,l=ev(),c=em(o.id);return l.useSyncedValueWithCleanup("titleElementId",c),Ra("h2",t,{ref:n,props:[{id:c},o]})}),c_t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...o}=t,l=ev(),c=em(o.id);return l.useSyncedValueWithCleanup("descriptionElementId",c),Ra("p",t,{ref:n,props:[{id:c},o]})});function Pne(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"10.25",cy:"10.25",r:"6.25"}),a.jsx("path",{d:"M4.15 10.25h12.2M10.25 4c1.65 1.72 2.5 3.8 2.5 6.25s-.85 4.53-2.5 6.25M10.25 4c-1.65 1.72-2.5 3.8-2.5 6.25s.85 4.53 2.5 6.25M14.8 14.8 20 20"})]})}function u_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.25",y:"5.25",width:"15.5",height:"13.5",rx:"2.25"}),a.jsx("circle",{cx:"8.1",cy:"9.3",r:"1.35"}),a.jsx("path",{d:"m4.7 16.5 3.65-3.7 2.45 2.25 2.2-2.2 4.35 4.1"}),a.jsx("path",{d:"m19.4 2.75.48 1.37 1.37.48-1.37.48-.48 1.37-.48-1.37-1.37-.48 1.37-.48.48-1.37Z",fill:"currentColor",stroke:"none"})]})}function lq(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{className:"video-generate-icon__body",d:"M3.25 9h17.5v7.35a2.4 2.4 0 0 1-2.4 2.4H5.65a2.4 2.4 0 0 1-2.4-2.4V9Z"}),a.jsxs("g",{className:"video-generate-icon__clapper",children:[a.jsx("path",{d:"M3.25 9V7.65a2.4 2.4 0 0 1 2.4-2.4h12.7a2.4 2.4 0 0 1 2.4 2.4V9H3.25Z"}),a.jsx("path",{d:"M6.75 5.25 9.3 9M12 5.25 14.55 9M17.25 5.25 19.8 9"})]}),a.jsx("path",{d:"m10.25 11.45 4 2.55-4 2.55v-5.1Z"})]})}function d_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M4.25 5.25h15.5v10.5H4.25zM8.25 19.75h7.5M12 15.75v4"}),a.jsx("path",{d:"m7.25 12.75 2.35-2.4 2.15 1.65 3.4-3.6 1.6 1.55"}),a.jsx("circle",{cx:"7.25",cy:"8.4",r:".7",fill:"currentColor",stroke:"none"})]})}function f_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5 7.4c0-1.55 3.13-2.8 7-2.8s7 1.25 7 2.8-3.13 2.8-7 2.8-7-1.25-7-2.8Z"}),a.jsx("path",{d:"M5 7.4v4.55c0 1.55 3.13 2.8 7 2.8s7-1.25 7-2.8V7.4M5 11.95v4.55c0 1.55 3.13 2.8 7 2.8s7-1.25 7-2.8v-4.55"}),a.jsx("path",{d:"M8.2 12.25h.01M8.2 16.8h.01"})]})}function h_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M4.25 4.25h4.5v15.5h-4.5zM8.75 5.75h5v14h-5zM13.75 4.25h4.1v10.25h-4.1z"}),a.jsx("path",{d:"M5.75 7h1.5M10.25 8.25h2M10.25 11h2M15.15 7h1.3"}),a.jsx("circle",{cx:"17.45",cy:"17.35",r:"2.45"}),a.jsx("path",{d:"m19.25 19.15 1.55 1.55"})]})}function p_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M4.25 6.25h6.25c1 0 1.5.55 1.5 1.45v11.05c0-.9-.5-1.45-1.5-1.45H4.25V6.25Z"}),a.jsx("path",{d:"M19.75 9.1v8.2H13.5c-1 0-1.5.55-1.5 1.45V7.7c0-.9.5-1.45 1.5-1.45h2.15"}),a.jsx("path",{d:"m19 3.2.58 1.62 1.62.58-1.62.58L19 7.6l-.58-1.62-1.62-.58 1.62-.58L19 3.2Z",fill:"currentColor",stroke:"none"})]})}function m_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"m4.2 8.4 1.15 10.2h13.3L19.8 8.4"}),a.jsx("path",{d:"M4.2 8.4h15.6L17.9 5H6.1L4.2 8.4Z"}),a.jsx("path",{d:"M7.2 12.2c1.1-1 2.25 1.25 3.4.25 1.05-.9 2.15 1.3 3.3.25"}),a.jsx("path",{d:"m8.2 15.1 1.45 1.35 1.45-1.35M13.55 16.45h2.35"})]})}function g_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"6",cy:"6.25",r:"2.25"}),a.jsx("circle",{cx:"18",cy:"6.25",r:"2.25"}),a.jsx("circle",{cx:"12",cy:"17.75",r:"2.25"}),a.jsx("path",{d:"m7.7 7.75 2.7 7.55M16.3 7.75l-2.7 7.55M8.25 6.25h7.5"})]})}function Dne(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"9",cy:"8",r:"3"}),a.jsx("path",{d:"M3.75 18.75c.45-3.05 2.2-4.65 5.25-4.65s4.8 1.6 5.25 4.65"}),a.jsx("path",{d:"M17.75 4.25v5.5M15 7h5.5M16 13.25h4.25M18.125 11.125v4.25"})]})}function b_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"4",y:"4.25",width:"16",height:"5",rx:"1.5"}),a.jsx("rect",{x:"4",y:"14.75",width:"16",height:"5",rx:"1.5"}),a.jsx("path",{d:"M7.25 6.75h.01M7.25 17.25h.01M10 6.75h6.5M10 17.25h6.5"})]})}function y_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3.75h8l4 4v12.5H6V3.75Z"}),a.jsx("path",{d:"M14 3.75v4h4M8.75 11h6.5M8.75 14.25h6.5M8.75 17.5h4"})]})}function Mne(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.75",y:"4.5",width:"16.5",height:"15",rx:"2.5"}),a.jsx("path",{d:"m7.5 9 2.75 2.5L7.5 14M12.5 14h4"}),a.jsx("path",{d:"M3.75 7.5h16.5",opacity:".62"})]})}function aO(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m6 3.25 4.5 4.75L6 12.75"})})}function v_t({value:e}){const{t,i18n:n}=Te("adk"),[i,r]=p.useState(!1),s=f=>f==null?t("developmentRuns.notReported"):f.toLocaleString(n.resolvedLanguage||n.language),o=z2e,l=e.usage,c=(l==null?void 0:l.inputTokens)!=null&&l.cachedInputTokens!=null&&l.cachedInputTokens<=l.inputTokens?l.inputTokens-l.cachedInputTokens:void 0,u=l!=null&&l.inputTokens&&l.cachedInputTokens!=null&&c!=null?`${(l.cachedInputTokens/l.inputTokens*100).toFixed(1)}%`:void 0,d=[["inputTokens",l==null?void 0:l.inputTokens],["cachedInputTokens",l==null?void 0:l.cachedInputTokens],["uncachedInputTokens",c],["cacheWriteInputTokens",l==null?void 0:l.cacheWriteInputTokens],["outputTokens",l==null?void 0:l.outputTokens],["reasoningOutputTokens",l==null?void 0:l.reasoningOutputTokens]];return a.jsxs("div",{className:"development-turn-summary","data-turn-id":e.turnId,children:[a.jsx("span",{children:t(`developmentRuns.turnStatus.${e.status}`)}),a.jsx("span",{children:t("developmentRuns.toolCalls",{count:e.toolCalls})}),a.jsx("span",{children:t("developmentRuns.turnDuration",{duration:o(e.durationMs)})}),a.jsx("span",{title:t("developmentRuns.toolDurationHelp"),children:t(e.toolDurationComplete?"developmentRuns.toolDuration":"developmentRuns.toolDurationPartial",{duration:o(e.toolDurationMs)})}),a.jsxs(R2t,{open:i,onOpenChange:r,children:[a.jsxs($2t,{className:"development-token-trigger",openOnHover:!0,delay:150,closeDelay:150,onFocus:f=>{f.currentTarget.matches(":focus-visible")&&r(!0)},children:[a.jsx("span",{children:"Tokens"}),a.jsx("span",{className:"development-token-value",children:s(l==null?void 0:l.totalTokens)}),e.usageIncomplete&&a.jsxs("span",{children:["· ",t("developmentRuns.partial")]}),a.jsx(aO,{className:"development-token-chevron"})]}),a.jsx(B2t,{children:a.jsx(X2t,{side:"top",align:"end",sideOffset:8,className:"development-token-positioner",children:a.jsxs(o_t,{className:"development-token-popup",initialFocus:!1,finalFocus:!1,children:[a.jsx(l_t,{className:"development-token-title",children:t("developmentRuns.tokenDetails")}),a.jsxs("dl",{children:[a.jsxs("div",{children:[a.jsx("dt",{children:t("developmentRuns.model")}),a.jsx("dd",{children:e.model||t("developmentRuns.notReported")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:t("developmentRuns.totalTokens")}),a.jsx("dd",{children:s(l==null?void 0:l.totalTokens)})]}),d.map(([f,h])=>a.jsxs("div",{children:[a.jsx("dt",{children:t(`developmentRuns.${f}`)}),a.jsx("dd",{children:s(h)})]},f)),a.jsxs("div",{children:[a.jsx("dt",{children:t("developmentRuns.cacheHitRate")}),a.jsx("dd",{children:u||t("developmentRuns.notReported")})]})]}),a.jsxs(c_t,{className:"development-token-note",children:[t("developmentRuns.tokenHelp"),e.usageIncomplete?` ${t("developmentRuns.partialHelp")}`:""]})]})})})]})]})}function cq(e){return a.jsx("svg",{viewBox:"0 0 111 117",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M0 5.6016C7.82288e-05 0.621244 6.02226 -1.87314 9.54395 1.64847L40.1289 32.2334L68.5732 3.7891C69.5834 2.77903 70.9533 2.21099 72.3818 2.21097H82.7031C82.7917 2.20658 82.8806 2.20414 82.9697 2.20414H104.775C109.574 2.20427 111.977 8.00691 108.584 11.4004L64.916 55.0664C64.3075 55.8528 63.9436 56.7647 63.8242 57.6993C63.7142 56.4884 63.1964 55.3069 62.2695 54.3799L45.4082 37.5186H45.4072L40.124 32.2354L17.832 54.5284C16.7671 55.5933 16.2416 56.993 16.2549 58.3887C16.2417 59.7843 16.7672 61.1842 17.832 62.2491L39.9287 84.3467L9.54395 114.733C6.0223 118.255 0.000223474 115.761 0 110.78V5.6016ZM63.8018 58.8702C63.8962 59.9086 64.2936 60.9229 64.9961 61.7735L108.591 105.368C111.984 108.762 109.58 114.564 104.781 114.564H94.4336C94.3543 114.568 94.274 114.569 94.1934 114.569H72.3877C70.9592 114.569 69.5892 114.002 68.5791 112.992L39.9336 84.3467L58.4531 65.8282L58.4453 65.8203L62.2695 61.9981C63.1476 61.12 63.6567 60.0136 63.8018 58.8702Z",fill:"currentColor"})})}function IM({kind:e,...t}){return e==="thinking"?a.jsx(cq,{...t}):a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:e==="tool"?a.jsxs(a.Fragment,{children:[a.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"3"}),a.jsx("path",{d:"m7 9 3 3-3 3m6 0h4"})]}):e==="plan"?a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"m4 7 1.5 1.5L8 6m-4 7 1.5 1.5L8 12M11 7h9m-9 6h9m-9 6h9"}),a.jsx("circle",{cx:"6",cy:"19",r:"1"})]}):a.jsx(a.Fragment,{children:a.jsx("path",{d:"M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9zM14 3v6h6M8 13h8m-4-3v6M8 18h8"})})})}function x_t({blocks:e,active:t,status:n,render:i}){const{t:r}=Te("adk"),[s,o]=p.useState(!1),l=[...e].reverse().find(h=>"done"in h&&!h.done),c=e.filter(h=>h.kind==="tool"),u=c.filter(h=>h.durationMs!=null),d=u.reduce((h,m)=>h+(m.durationMs||0),0);let f=r("developmentRuns.processSummary",{count:e.length});return t&&(f=n||((l==null?void 0:l.kind)==="thinking"?r("developmentRuns.thinking"):(l==null?void 0:l.kind)==="tool"?V2e(l):(l==null?void 0:l.kind)==="plan"?r("developmentRuns.plan"):(l==null?void 0:l.kind)==="diff"?r("developmentRuns.diff"):r("developmentRuns.processing"))),a.jsxs("section",{className:"development-process",children:[a.jsxs("button",{type:"button",className:"development-process__toggle","aria-expanded":s,onClick:()=>o(!s),children:[a.jsx(aO,{className:`tool-chevron${s?" is-open":""}`}),a.jsx("span",{className:"tool-icon",children:a.jsx(IM,{kind:(l==null?void 0:l.kind)==="thinking"||(l==null?void 0:l.kind)==="plan"||(l==null?void 0:l.kind)==="diff"?l.kind:"tool"})}),t?a.jsx(fn,{className:"development-process__title","aria-live":"polite",children:f}):a.jsx("span",{className:"development-process__title",children:f}),!t&&c.length>0&&a.jsxs("span",{className:"development-process__duration",children:[r("developmentRuns.toolCalls",{count:c.length}),u.length>0?` · ${r(u.length===c.length?"developmentRuns.toolDuration":"developmentRuns.toolDurationPartial",{duration:z2e(d)})}`:""]})]}),a.jsx("div",{className:"development-process__items",hidden:!s,children:i(e)})]})}function w_t({blocks:e,active:t,status:n="",render:i}){const{t:r}=Te("adk"),s=nnt(e),o=s[s.length-1],l=[...e].reverse().find(u=>u.kind==="progress"),c=n||((l==null?void 0:l.kind)==="progress"?l.text:"");return a.jsxs(a.Fragment,{children:[s.map(u=>u.process?a.jsx(x_t,{blocks:u.blocks,active:t&&u===o,status:c,render:i},u.id):a.jsx("div",{"data-assistant-phase":u.blocks[0].phase,children:i(u.blocks)},u.id)),t&&!(o!=null&&o.process)&&a.jsxs("div",{className:"development-process__status",role:"status",children:[a.jsx("span",{className:"tool-icon",children:a.jsx(IM,{kind:"thinking"})}),a.jsx(fn,{children:c||r("developmentRuns.processing")})]})]})}const O_t={formatDate(e){const t=e.value??e.date??e.timestamp;if(t==null)return"";const n=new Date(t);return isNaN(n.getTime())?String(t):n.toLocaleString()}};function k_t(e,t){if(!t||t==="/")return e;const n=t.replace(/^\//,"").split("/").map(r=>r.replace(/~1/g,"/").replace(/~0/g,"~"));let i=e;for(const r of n){if(i==null||typeof i!="object")return;i=i[r]}return i}function S_t(e){return typeof e=="object"&&e!==null&&typeof e.path=="string"}function E_t(e){return typeof e=="object"&&e!==null&&typeof e.call=="string"}function uq(e,t){if(S_t(e))return k_t(t,e.path);if(E_t(e)){const n=O_t[e.call],i={};for(const[r,s]of Object.entries(e.args??{}))i[r]=uq(s,t);return n?n(i):`[unknown fn: ${e.call}]`}return e}function C_t(e,t){const n=uq(e,t);return n==null?"":typeof n=="string"?n:String(n)}const uLe=new Map;function tv(e,t){uLe.set(e,t)}function A_t(e){return uLe.get(e)}function T_t(e,t,n){const i=t.replace(/^\//,"").split("/").map(s=>s.replace(/~1/g,"/").replace(/~0/g,"~"));let r=e;for(let s=0;suq(i,e.dataModel),resolveString:i=>C_t(i,e.dataModel),dispatchAction:t,render:i=>{if(!i)return null;const r=e.components[i];if(!r)return null;const s=A_t(r.component)??__t;return a.jsx(s,{node:r,ctx:n},i)}};return a.jsx("div",{className:"a2ui-surface","data-a2ui-surface":e.surfaceId,children:n.render(e.rootId)})}function fLe(e){const t=p.useRef(null),n=p.useRef(!0),i=28,r=p.useCallback(()=>{const s=t.current;s&&(n.current=s.scrollHeight-s.scrollTop-s.clientHeight{const s=t.current;s&&n.current&&(s.scrollTop=s.scrollHeight)},[e]),{ref:t,onScroll:r}}function PM({value:e,skillPrefix:t="/",onRemoveSkill:n,onRemoveAgent:i}){const{t:r}=Te("conversation");return e.skills.length===0&&!e.targetAgent?null:a.jsxs("div",{className:"invocation-chips","aria-label":r("invocation.ariaLabel"),children:[e.skills.map(s=>a.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:s.description,children:[a.jsx(hC,{"aria-hidden":!0}),a.jsxs("span",{children:[t,s.name]}),n?a.jsx("button",{type:"button",onClick:()=>n(s.name),"aria-label":r("invocation.removeSkill",{name:s.name}),children:a.jsx(Do,{})}):null]},s.name)),e.targetAgent?a.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:e.targetAgent.description,children:[a.jsx(Mje,{"aria-hidden":!0}),a.jsx("span",{children:e.targetAgent.name}),i?a.jsx("button",{type:"button",onClick:i,"aria-label":r("invocation.removeAgent",{name:e.targetAgent.name}),children:a.jsx(Do,{})}):null]}):null]})}function dq(e=""){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e==="application/pdf"?"pdf":e==="text/markdown"?"markdown":"text"}function hLe(e){var n,i,r,s;const t=dq(e.mimeType);return t==="pdf"?"PDF":t==="markdown"?"MD":t==="video"?((i=(n=e.mimeType)==null?void 0:n.split("/")[1])==null?void 0:i.toUpperCase())??"VIDEO":t==="image"?((s=(r=e.mimeType)==null?void 0:r.split("/")[1])==null?void 0:s.toUpperCase())??"IMAGE":"TXT"}function pLe(e){return e?e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`:""}function mLe(e,t){return e.previewUrl?e.previewUrl:e.data?`data:${e.mimeType??"application/octet-stream"};base64,${e.data}`:e.uri?hTe(t,e.uri):""}function N_t({kind:e}){return e==="image"?a.jsx(bV,{}):e==="video"?a.jsx($je,{}):e==="pdf"?a.jsx(Pat,{}):a.jsx(mV,{})}function DM({appName:e,items:t,compact:n=!1,onRemove:i}){const{t:r}=Te("conversation"),[s,o]=p.useState(null);return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:`media-grid${n?" media-grid--compact":""}`,children:t.map(l=>{const c=dq(l.mimeType),u=mLe(l,e),d=l.status==="uploading"||l.status==="error"||!u,f=a.jsxs("button",{type:"button",className:"media-card-main",disabled:d,onClick:c==="image"?void 0:()=>o(l),"aria-label":r("media.preview",{name:l.name??r("media.attachment")}),children:[c==="image"&&u?a.jsx("img",{className:"media-card-image",src:u,alt:l.name??r("media.image"),loading:"lazy"}):c==="video"&&u?a.jsxs("div",{className:"media-card-video-container",children:[a.jsx("video",{className:"media-card-video",src:u,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),a.jsx("span",{className:"media-card-video-play",children:a.jsx(Uje,{})})]}):a.jsx("span",{className:"media-card-icon",children:a.jsx(N_t,{kind:c})}),a.jsxs("span",{className:"media-card-copy",children:[a.jsx("span",{className:"media-card-name",children:l.name??r("media.attachment")}),a.jsxs("span",{className:"media-card-meta",children:[a.jsx("span",{className:"media-card-type",children:hLe(l)}),l.status==="uploading"?a.jsxs(a.Fragment,{children:[a.jsx(Fi,{className:"media-card-spinner"})," ",r("media.uploading")]}):l.status==="error"?l.error??r("media.uploadFailed"):pLe(l.sizeBytes)]})]}),!n&&l.status!=="uploading"&&l.status!=="error"?a.jsx(iE,{className:"media-card-open"}):null]});return a.jsxs(Cr.div,{className:`media-card media-card--${c}${l.status==="error"?" media-card--error":""}`,layout:!0,initial:{opacity:0,scale:.985,y:4},animate:{opacity:1,scale:1,y:0},children:[c==="image"&&!d?a.jsx(MAe,{src:u,children:f}):f,i?a.jsx("button",{type:"button",className:"media-card-remove","aria-label":r("media.remove",{name:l.name??r("media.attachment")}),onClick:()=>i(l.id),children:a.jsx(Do,{})}):null]},l.id)})}),a.jsx(ff,{children:s?a.jsx(R_t,{appName:e,item:s,onClose:()=>o(null)}):null})]})}function R_t({appName:e,item:t,onClose:n}){const{t:i}=Te("conversation"),r=p.useMemo(()=>mLe(t,e),[e,t]),s=dq(t.mimeType),[o,l]=p.useState(""),[c,u]=p.useState(s==="text"||s==="markdown"),[d,f]=p.useState("");return p.useEffect(()=>{const h=m=>{m.key==="Escape"&&n()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[n]),p.useEffect(()=>{if(s!=="text"&&s!=="markdown")return;const h=new AbortController;return u(!0),f(""),fetch(r,{signal:h.signal}).then(m=>{if(!m.ok)throw new Error(`HTTP ${m.status}`);return m.text()}).then(l).catch(m=>{h.signal.aborted||f(m instanceof Error?m.message:String(m))}).finally(()=>{h.signal.aborted||u(!1)}),()=>h.abort()},[s,r]),a.jsx(Cr.div,{className:"media-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":i("media.previewDialog",{name:t.name??i("media.attachment")}),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onMouseDown:h=>{h.target===h.currentTarget&&n()},children:a.jsxs(Cr.div,{className:"media-viewer",initial:{opacity:0,y:18,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.99},transition:{type:"spring",stiffness:420,damping:30},children:[a.jsxs("header",{className:"media-viewer-header",children:[a.jsxs("div",{children:[a.jsx("strong",{children:t.name??i("media.attachment")}),a.jsxs("span",{children:[hLe(t),t.sizeBytes?` · ${pLe(t.sizeBytes)}`:""]})]}),a.jsxs("nav",{children:[a.jsx("a",{href:r,download:t.name,"aria-label":i("media.download"),children:a.jsx(tM,{})}),a.jsx("button",{type:"button",onClick:n,"aria-label":i("media.close"),children:a.jsx(Do,{})})]})]}),a.jsxs("div",{className:`media-viewer-body media-viewer-body--${s}`,children:[s==="image"?a.jsx("img",{src:r,alt:t.name??i("media.image")}):null,s==="video"?a.jsx("div",{className:"media-viewer-video-wrapper",children:a.jsx("video",{src:r,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",className:"media-viewer-video"})}):null,s==="pdf"?a.jsx("iframe",{src:r,title:t.name??"PDF"}):null,c?a.jsxs("div",{className:"media-viewer-loading",children:[a.jsx(Fi,{})," ",i("media.reading")]}):null,!c&&d?a.jsx("div",{className:"media-viewer-loading",children:i("media.loadFailed",{error:d})}):null,!c&&s==="markdown"?a.jsx("div",{className:"media-document",children:a.jsx(Td,{text:o})}):null,!c&&s==="text"?a.jsx("pre",{className:"media-document media-document--plain",children:o}):null]})]})})}function I_t({definition:e,label:t,done:n,open:i,onToggle:r}){const{t:s}=Te("conversation"),o=e.icon,l=n?e.doneLabel:e.runningLabel,c=t??s(`blocks.tools.${e.name}.${n?"done":"running"}`,{defaultValue:l});return a.jsxs("button",{type:"button",className:`builtin-tool-head${n?" is-done":" is-running"}`,"data-tool-tone":e.tone,onClick:r,"aria-expanded":i,children:[a.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:a.jsx(o,{})}),n?a.jsx("span",{className:"builtin-tool-label",children:c}):a.jsx(fn,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:c}),a.jsx(aO,{className:`builtin-tool-chevron${i?" is-open":""}`})]})}function Nu(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function qn(e){return typeof e=="string"?e:""}function Lne(e){return typeof e=="number"&&Number.isFinite(e)?e:0}function cd(e){return Array.isArray(e)?e:[]}function u9(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return{}}const n=Nu(t)??{};return Nu(n.result)??n}function MM(e){if(typeof e=="string")try{return MM(JSON.parse(e))}catch{return e}const t=Nu(e);if(!t)return"";const n=Nu(t.result);return qn(t.error)||qn(t.message)||qn(n==null?void 0:n.error)||qn(n==null?void 0:n.message)}function P_t(e){if(e.kind==="tool")return"tool";if(e.kind==="knowledge_base")return"knowledge_base";const t=Nu(e.metadata),n=qn(t==null?void 0:t.source_type).toLowerCase(),i=qn(e.source).toLowerCase();return n==="skillhub"||i.startsWith("skill_hub:")?"skill_hub":"skill_space"}const gLe={tool:"Tools",knowledge:"AgentKit Knowledge Base",skillCenter:"AgentKit Skill Center",unknownSource:"Unknown source",unnamedResource:"Unnamed resource",unnamedAgent:"Unnamed agent"};function D_t(e,t){return e==="veadk_builtin_tools"?t.tool:e==="agentkit_knowledge"?t.knowledge:e.startsWith("skill_hub:")?`Skill Hub ${e.slice(10)}`:e.startsWith("skill_space:")?`${t.skillCenter} ${e.slice(12)}`:e||t.unknownSource}function M_t(e){return e==="veadk_builtin_tools"?"tool":e==="agentkit_knowledge"?"knowledge_base":e.startsWith("skill_hub:")?"skill_hub":"skill_space"}function L_t(e,t=gLe){const n=u9(e),i=Nu(n.capabilities)??{},r=cd(n.resources).flatMap(o=>{const l=Nu(o);if(!l)return[];const c=l.kind==="tool"?"tool":l.kind==="knowledge_base"?"knowledge_base":"skill";return[{ref:qn(l.ref),kind:c,category:P_t(l),name:qn(l.name)||qn(l.ref)||t.unnamedResource,description:qn(l.description),source:qn(l.source),version:qn(l.version)}]}),s=cd(n.sources).flatMap(o=>{const l=Nu(o);if(!l)return[];const c=qn(l.source),u=qn(l.status),d=u==="error"?"error":u==="skipped"?"skipped":"ok";return[{source:c,category:M_t(c),label:D_t(c,t),status:d,count:Lne(l.count),message:qn(l.message),searchKeywords:cd(l.search_keywords).map(qn).filter(Boolean)}]});return{collectionId:qn(n.collection_id),capabilities:{googleAdkVersion:qn(i.google_adk_version),agentTypes:cd(i.agent_types).map(qn).filter(Boolean),maxOrchestrationDepth:Lne(i.max_orchestration_depth)},resources:r,sources:s,counts:{all:r.length,skill_hub:r.filter(o=>o.category==="skill_hub").length,skill_space:r.filter(o=>o.category==="skill_space").length,knowledge_base:r.filter(o=>o.category==="knowledge_base").length,tool:r.filter(o=>o.category==="tool").length}}}function $_t(e,t){return{resources:e.resources.filter(n=>n.category===t),sources:e.sources.filter(n=>n.category===t)}}function bLe(e,t,n=gLe){const i=u9(e),r=u9(t),s=new Map(cd(r.results).flatMap(d=>{const f=Nu(d),h=qn(f==null?void 0:f.name);return f&&h?[[h,f]]:[]})),o=cd(i.agents).flatMap(d=>{const f=Nu(d),h=qn(f==null?void 0:f.name);return f&&h?[f]:[]}),l=new Set(o.map(d=>qn(d.name))),c=[...s.entries()].filter(([d])=>!l.has(d)).map(([d])=>({name:d})),u=[...o,...c].map(d=>{const f=qn(d.name),h=cd(d.nodes).flatMap(C=>{const E=Nu(C);return E?[E]:[]}),m=qn(d.root_node),g=h.find(C=>qn(C.id)===m),b=h.filter(C=>qn(C.id)!==m).map(C=>({id:qn(C.id)||n.unnamedAgent,type:qn(C.type)||"llm",description:qn(C.description)})),v=s.get(f),y=qn(v==null?void 0:v.status),w=y==="failed"?"failed":y==="completed"?"completed":"running",x=$ne(v==null?void 0:v.resources),O=x.length>0?x:$ne(h.flatMap(C=>cd(C.resources))),k=Fne(v==null?void 0:v.python_tools),S=k.length>0?k:Fne(h.flatMap(C=>cd(C.python_tools)));return{name:f,description:qn(v==null?void 0:v.description)||qn(g==null?void 0:g.description)||qn(d.task),task:qn(d.task),rootType:qn(v==null?void 0:v.root_type)||qn(g==null?void 0:g.type)||"llm",nodeCount:h.length,subAgentCount:b.length,resourceCount:O.length,pythonToolCount:S.length,skills:O.filter(C=>C.kind==="skill"),knowledgeBases:O.filter(C=>C.kind==="knowledge_base"),builtinTools:O.filter(C=>C.kind==="tool"),pythonTools:S,subAgents:b,status:w,output:qn(v==null?void 0:v.output),error:qn(v==null?void 0:v.error)}});return{collectionId:qn(r.collection_id)||qn(i.collection_id),agents:u,completedCount:u.filter(d=>d.status==="completed").length,failedCount:u.filter(d=>d.status==="failed").length,runningCount:u.filter(d=>d.status==="running").length}}function F_t(e,t){return!!MM(t)||bLe(e,t).failedCount>0}function $ne(e){const t=new Set;return cd(e).flatMap(n=>{const i=Nu(n),r=qn(i?i.ref:n);if(!r||t.has(r))return[];t.add(r);const s=qn(i==null?void 0:i.kind),o=s==="tool"||r.startsWith("veadk_tool:")?"tool":s==="knowledge_base"||r.startsWith("agentkit_kb:")?"knowledge_base":"skill",l=r.split(":");return[{ref:r,kind:o,name:qn(i==null?void 0:i.name)||l[l.length-1]||r,description:qn(i==null?void 0:i.description),version:qn(i==null?void 0:i.version),source:qn(i==null?void 0:i.source)}]})}function Fne(e){const t=new Set;return cd(e).flatMap(n=>{const i=Nu(n),r=qn(i==null?void 0:i.name),s=qn(i==null?void 0:i.code),o=`${r}\0${s}`;return!i||!r||t.has(o)?[]:(t.add(o),[{name:r,description:qn(i.description),code:s,entrypoint:qn(i.entrypoint)||r,dependencies:cd(i.dependencies).map(qn).filter(Boolean)}])})}function B_t({branch:e}){return a.jsxs("div",{className:`branch-compare__body${e.status==="running"?" is-streaming":""}`,"aria-live":"polite",children:[e.content?a.jsx(Td,{text:e.content,streaming:e.status==="running"}):null,e.status==="running"?a.jsx("span",{className:"branch-compare__caret","aria-hidden":"true"}):null,e.error?a.jsx("p",{className:"branch-compare__error",children:e.error}):null]})}function U_t({args:e,response:t,status:n,onBranchSelect:i}){const{t:r}=Te("conversation"),s=p.useMemo(()=>Vje(e,t,n),[e,t,n]),[o,l]=p.useState(0);return a.jsxs("section",{className:"branch-compare","aria-label":r("blocks.branchCompare.ariaLabel"),children:[a.jsx("div",{className:"branch-compare__tabs",role:"tablist","aria-label":r("blocks.branchCompare.selectDirection"),children:s.branches.map((c,u)=>a.jsx("button",{className:`branch-compare__tab${o===u?" is-active":""}`,type:"button",role:"tab","aria-selected":o===u,"aria-controls":`branch-compare-panel-${u}`,onClick:()=>l(u),children:a.jsx(Ya,{color:"info",size:"sm",variant:"soft",children:c.label})},`${c.label}:${u}`))}),a.jsx("div",{className:"branch-compare__branches",children:s.branches.map((c,u)=>a.jsxs("article",{className:`branch-compare__branch${o===u?" is-active":""}`,id:`branch-compare-panel-${u}`,role:"tabpanel",children:[a.jsx("header",{className:"branch-compare__head",children:a.jsx(Ya,{color:"info",size:"sm",variant:"soft",children:c.label})}),a.jsx(B_t,{branch:c}),a.jsx("footer",{className:"branch-compare__footer",children:a.jsx(_t,{type:"button",color:"info",variant:"ghost",size:"sm",pill:!1,disabled:c.status!=="completed",onClick:()=>i==null?void 0:i(c),children:r("blocks.branchCompare.continue")})})]},`${c.label}:${u}`))})]})}function yLe({controlled:e,default:t,name:n,state:i="value"}){const{current:r}=p.useRef(e!==void 0),[s,o]=p.useState(t),l=r?e:s,c=p.useCallback(u=>{r||o(u)},[]);return[l,c]}const vLe=p.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function Q_t(){return p.useContext(vLe)}function z_t(e){const{children:t,elementsRef:n,labelsRef:i,onMapChange:r}=e,s=ci(r),[,o]=p.useState(!1),l=Ed(H_t).current,c=Ed(V_t).current,u=p.useRef(0),d=p.useRef(!0),f=p.useRef([]),h=p.useRef(null),m=ci(()=>{d.current||(d.current=!0,o(k=>!k))}),g=ci((k,S)=>{c.set(k,S),m()}),b=ci(k=>{c.delete(k),m()}),v=ci(k=>{const S=new Map;return n.current.length=0,i&&(i.current.length=0),k.forEach(C=>{var E,j;S.set(C.element,{...C.registration.metadata??{},index:C.index}),n.current[C.index]=C.element,i&&(i.current[C.index]=C.registration.label!==void 0?C.registration.label:((j=(E=C.registration.textRef)==null?void 0:E.current)==null?void 0:j.textContent)??C.element.textContent)}),u.current=n.current.length,S});function y(k){var E;if((E=h.current)==null||E.disconnect(),h.current=null,typeof MutationObserver!="function"||k.length<2)return;const S=new MutationObserver(j=>{if(!K_t(j))return;let T=null;for(const R of k)if(R.isConnected){if(T&&xLe(T,R)>0){S.disconnect(),m();return}T=R}});h.current=S;const C=new Set;for(let j=1;jS.observe(j,{childList:!0}))}const w=ci(()=>{const[k,S]=q_t(c),C=v(k);y(S),f.current=k,d.current=!1,l.forEach(E=>E(C)),s(C)});Jn(()=>(d.current||v(f.current),()=>{n.current=[],i&&(i.current=[])}),[n,i,v]),Jn(()=>{d.current&&w()}),Jn(()=>()=>{var k;(k=h.current)==null||k.disconnect(),d.current=!0},[]);const x=ci(k=>(l.add(k),()=>{l.delete(k)})),O=p.useMemo(()=>({register:g,unregister:b,subscribeMapChange:x,nextIndexRef:u}),[g,b,x,u]);return a.jsx(vLe.Provider,{value:O,children:t})}function V_t(){return new Map}function H_t(){return new Set}function q_t(e){const t=new Set,n=[],i=[];e.forEach((s,o)=>{if(!o.isConnected)return;const l=s.index,c={index:l??-1,element:o,registration:s};l===null?i.push(c):l>=0&&(t.add(l),n.push(c))});let r=0;return i.sort((s,o)=>xLe(s.element,o.element)),i.forEach(s=>{for(;t.has(r);)r+=1;s.index=r,n.push(s),r+=1}),t.size>0&&n.sort((s,o)=>s.index-o.index),[n,i.map(s=>s.element)]}function W_t(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function K_t(e){for(const t of e)for(let n=0;nnull},kLe=p.forwardRef(function(t,n){const{render:i,className:r,disabled:s=!1,hiddenUntilFound:o,keepMounted:l,loopFocus:c,onValueChange:u,multiple:d=!1,orientation:f="vertical",value:h,defaultValue:m,style:g,...b}=t,v=p.useMemo(()=>{if(h===void 0)return m??[]},[h,m]),y=p.useRef([]),[w,x]=yLe({controlled:h,default:v,name:"Accordion",state:"value"}),O=ci((E,j,T)=>{if(d)if(j){const R=w.slice();if(R.push(E),u==null||u(R,T),T.isCanceled)return;x(R)}else{const R=w.filter(A=>A!==E);if(u==null||u(R,T),T.isCanceled)return;x(R)}else{const R=w[0]===E?[]:[E];if(u==null||u(R,T),T.isCanceled)return;x(R)}}),k=p.useMemo(()=>({value:w,disabled:s,orientation:f}),[w,s,f]),S=p.useMemo(()=>({disabled:s,handleValueChange:O,hiddenUntilFound:o??!1,keepMounted:l??!1,state:k,value:w}),[s,O,o,l,k,w]),C=Ra("div",t,{state:k,ref:n,props:b,stateAttributesMapping:G_t});return a.jsx(wLe.Provider,{value:S,children:a.jsx(z_t,{elementsRef:y,children:C})})});function X_t(e){const{open:t,defaultOpen:n,onOpenChange:i,disabled:r}=e,[s,o]=yLe({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:l,setMounted:c,transitionStatus:u}=tje(s,!0,!0),d=em(),[f,h]=p.useState(),m=f===null?void 0:f??d,g=ci(b=>{const v=!s,y=fa(Yw,b.nativeEvent);i(v,y),!y.isCanceled&&o(v)});return p.useMemo(()=>({defaultPanelId:d,disabled:r,handleTrigger:g,mounted:l,open:s,panelId:m,setMounted:c,setOpen:o,setPanelIdState:h,transitionStatus:u}),[d,r,g,l,s,m,c,o,h,u])}const SLe=p.createContext(void 0);function ELe(){const e=p.useContext(SLe);if(e===void 0)throw new Error(Vc(15));return e}function Y_t(e={}){const{guess:t,label:n,metadata:i,textRef:r,index:s}=e,{register:o,unregister:l,subscribeMapChange:c,nextIndexRef:u}=Q_t(),d=p.useRef(-1),[f,h]=p.useState(s==null&&t?()=>{if(d.current===-1){const v=u.current;u.current+=1,d.current=v}return d.current}:-1),m=s??f,g=p.useRef(null),b=p.useCallback(v=>{const y=g.current;y&&l(y),g.current=v,v&&o(v,{metadata:i??null,index:s??null,label:n,textRef:r})},[s,o,l,i,n,r]);return Jn(()=>{if(s==null)return c(v=>{var w;const y=g.current?(w=v.get(g.current))==null?void 0:w.index:null;y!=null&&h(y)})},[s,c]),{ref:b,index:m}}const CLe=p.createContext(void 0);function fq(){const e=p.useContext(CLe);if(e===void 0)throw new Error(Vc(9));return e}let hq=function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=oI.startingStyle]="startingStyle",e[e.endingStyle=oI.endingStyle]="endingStyle",e}({}),Z_t=function(e){return e.panelOpen="data-panel-open",e}({});const J_t={[hq.open]:""},ejt={[hq.closed]:""},tjt={open(e){return e?{[Z_t.panelOpen]:""}:null}},njt={open(e){return e?J_t:ejt}};let ijt=function(e){return e.index="data-index",e.disabled="data-disabled",e.open="data-open",e}({});const pq={...njt,index:e=>({[ijt.index]:String(e)}),...KD,value:()=>null},ALe=p.forwardRef(function(t,n){const{className:i,disabled:r=!1,onOpenChange:s,render:o,value:l,style:c,...u}=t,{ref:d,index:f}=Y_t(),h=Xw(n,d),{disabled:m,handleValueChange:g,state:b,value:v}=OLe(),y=em(),w=l??y,x=r||m,O=v.indexOf(w)!==-1,k=ci((D,_)=>{s==null||s(D,_),!_.isCanceled&&g(w,D,_)}),S=X_t({open:O,onOpenChange:k,disabled:x}),C=p.useMemo(()=>({open:S.open,disabled:S.disabled,transitionStatus:S.transitionStatus}),[S.open,S.disabled,S.transitionStatus]),E=p.useMemo(()=>({...S,onOpenChange:k,state:C}),[S,C,k]),j=p.useMemo(()=>({...b,hidden:!O&&!S.mounted,index:f,disabled:x,open:O}),[S.mounted,x,f,O,b]),T=em(),[R,A]=p.useState(),N=R===null?void 0:R??T,P=p.useMemo(()=>({defaultTriggerId:T,open:O,state:j,setTriggerId:A,triggerId:N}),[T,O,j,A,N]),I=Ra("div",t,{state:j,ref:h,props:u,stateAttributesMapping:pq});return a.jsx(SLe.Provider,{value:E,children:a.jsx(CLe.Provider,{value:P,children:I})})}),TLe=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...o}=t,{state:l}=fq();return Ra("h3",t,{state:l,ref:n,props:o,stateAttributesMapping:pq})}),_Le=p.forwardRef(function(t,n){const{disabled:i,className:r,id:s,render:o,nativeButton:l=!0,style:c,...u}=t,{panelId:d,open:f,handleTrigger:h,disabled:m}=ELe(),g=i||m,{getButtonProps:b,buttonRef:v}=GD({disabled:g,focusableWhenDisabled:!0,native:l}),{defaultTriggerId:y,state:w,setTriggerId:x}=fq(),O=s||void 0,k=O??y;return Jn(()=>(x(E=>O??(E===null?void 0:E)),()=>{x(E=>E===O?null:E)}),[O,x]),Ra("button",t,{state:w,ref:[n,v],props:[{"aria-controls":f?d:void 0,"aria-expanded":f,id:k,onClick:h},u,b],stateAttributesMapping:tjt})}),xk={height:void 0,width:void 0};function rjt(e){const{externalRef:t,hiddenUntilFound:n,id:i,keepMounted:r,mounted:s,onOpenChange:o,open:l,setMounted:c,setOpen:u,transitionStatus:d}=e,f=p.useRef(null),h=p.useRef(null),[m,g]=p.useState(xk),b=p.useRef(xk),v=p.useRef(!1),y=p.useRef(l),w=p.useRef(!1),[x,O]=p.useState(!1),k=p.useRef(null),S=Xw(t,f),C=Zl(l),E=rV(f),j=!l&&!s,T=x?"idle":d,R=l&&(y.current||w.current),A=!l&&s&&h.current==="css-animation"&&m.height===void 0&&m.width===void 0?b.current:m,N=n&&j&&h.current!=="css-animation",P=ci((F,M=!0)=>{M&&(b.current=F),g(F)}),I=ci(()=>{var F;(F=k.current)==null||F.call(k),k.current=null}),D=ci(F=>{I(),k.current=()=>{k.current=null,F()}}),_=ci(()=>{l&&s&&h.current==="css-animation"&&(w.current=!0)});Jn(()=>{!x||d==="starting"||O(!1)},[x,d]),p.useEffect(()=>()=>{_(),I()},[_,I]),Jn(()=>{const F=f.current;if(!F)return;!l&&k.current&&I();const M=sjt(F,R);if(h.current=M,l&&d==="idle"&&y.current&&M==="css-animation"){b.current=Bv(F);return}if(l&&d==="starting"){const U=v.current;if(v.current=!1,M==="none"){P(Bv(F)),O(!0);return}if(M==="css-transition"){const Z=ajt(F);if(P(Bv(F)),!U)return Z;const ne=N_(F,"transition-duration","0s");return D(ne),O(!0),Z}P(Bv(F));const J=N_(F,"animation-name","none");if(!U){J();return}const z=N_(F,"animation-duration","0s");J(),D(z),O(!0);return}if(!l&&s&&(d==="idle"||d==="starting")){if(y.current=!1,w.current=!1,M==="none"){P(xk,!1),c(!1);return}P(Bv(F));return}if(d!=="ending")return;if(M==="none"){c(!1);return}const V=Bv(F);if(!(V.height>0||V.width>0)){c(!1);return}P(V),M==="css-animation"&&N_(F,"animation-name","none")()},[s,l,I,P,c,D,R,d]),zA({enabled:l&&s&&T==="idle",open:!0,ref:f,onComplete(){l&&P(xk,!1)}}),p.useEffect(()=>{if(l||!s||T!=="ending"||!f.current)return;const M=new AbortController;let V=-1;function q(){C.current||(c(!1),P(xk,!1))}return V=_c.request(()=>{E(q,M.signal)}),()=>{_c.cancel(V),M.abort()}},[C,s,l,T,E,P,c]),Jn(()=>{const F=f.current;!F||!n||!j||F.setAttribute("hidden","until-found")},[j,n]),p.useEffect(function(){const M=f.current;if(!M)return;function V(q){const U=fa(E_e,q);o(!0,U),!U.isCanceled&&(v.current=!0,u(!0))}return Ni(M,"beforematch",V)},[o,u]);const L=r||n||s||l;return{height:A.height,props:{...N?{[hq.startingStyle]:""}:void 0,hidden:j,id:i},ref:S,shouldPreventOpenAnimation:R,shouldRender:L,transitionStatus:T,width:A.width}}function Bv(e){return{height:e.scrollHeight,width:e.scrollWidth}}function sjt(e,t){const n=ta(e).getComputedStyle(e),i=(n.animationName.split(",").map(s=>s.trim()).some(s=>s!==""&&s!=="none")||t)&&Bne(n.animationDuration),r=Bne(n.transitionDuration);return i&&r||r?"css-transition":i?"css-animation":"none"}function Bne(e){return e.split(",").map(t=>t.trim()).some(t=>t!==""&&Number.parseFloat(t)>0)}function N_(e,t,n){const i=e.style.getPropertyValue(t),r=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(i===""){e.style.removeProperty(t);return}e.style.setProperty(t,i,r)}}function ajt(e){const t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(r=>{e.style.setProperty(r,"initial","important")});function n(){Object.entries(t).forEach(([r,s])=>{if(s===""){e.style.removeProperty(r);return}e.style.setProperty(r,s)})}const i=_c.request(n);return()=>{_c.cancel(i),n()}}let Une=function(e){return e.accordionPanelHeight="--accordion-panel-height",e.accordionPanelWidth="--accordion-panel-width",e}({});const jLe=p.forwardRef(function(t,n){const{className:i,hiddenUntilFound:r,keepMounted:s,id:o,render:l,style:c,...u}=t,{hiddenUntilFound:d,keepMounted:f}=OLe(),{defaultPanelId:h,mounted:m,onOpenChange:g,open:b,setMounted:v,setOpen:y,setPanelIdState:w,transitionStatus:x}=ELe(),O=r??d,k=s??f,S=o||void 0,C=o??h;Jn(()=>(w(M=>S??(M===null?void 0:M)),()=>{w(M=>M===S?null:M)}),[S,w]);const{height:E,props:j,ref:T,shouldPreventOpenAnimation:R,shouldRender:A,transitionStatus:N,width:P}=rjt({externalRef:n,hiddenUntilFound:O,id:C,keepMounted:k,mounted:m,onOpenChange:g,open:b,setMounted:v,setOpen:y,transitionStatus:x}),{state:I,triggerId:D}=fq(),_={...I,transitionStatus:N},L=m_e(c,_),F=Ra("div",{...t,style:void 0},{state:_,ref:T,props:[j,{"aria-labelledby":D,role:"region",style:{[Une.accordionPanelHeight]:E===void 0?"auto":`${E}px`,[Une.accordionPanelWidth]:P===void 0?"auto":`${P}px`}},u,L?{style:L}:void 0,R?{style:{animationName:"none"}}:void 0],stateAttributesMapping:pq});return A?F:null}),ojt=(e,t)=>{const n=e.currentTarget,i={x:e.clientX,y:e.clientY},r=ljt(i,n.getBoundingClientRect()),s=cjt(i,r),o=ujt(t.getBoundingClientRect());return fjt([...s,...o])};function ljt(e,t){const n=Math.abs(t.top-e.y),i=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,i,r,s)){case s:return"left";case r:return"right";case n:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function cjt(e,t,n=5){const i=[];switch(t){case"top":i.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":i.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":i.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":i.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return i}function ujt(e){const{top:t,right:n,bottom:i,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:i},{x:r,y:i}]}function djt(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,o=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}function fjt(e){const t=e.slice();return t.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),hjt(t)}function hjt(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i=2;){const s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let i=e.length-1;i>=0;i--){const r=e[i];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const pjt="_Transition_1wdpp_1",mjt="_Popover_1wdpp_3",NLe={Transition:pjt,Popover:mjt},RLe=p.createContext(null),LM=()=>{const e=p.use(RLe);if(!e)throw new Error("Popover components must be wrapped in ");return e},Lg=({open:e,onOpenChange:t,showOnHover:n=!1,hoverOpenDelay:i=150,children:r})=>{const[s,o]=p.useState(!1),[l,c]=p.useState(!1),u=p.useRef(null),d=p.useRef(null),f=p.useRef(void 0),h=p.useRef(!1),m=p.useRef(!1),g=e??s,[b,v]=p.useState(!1);OV(()=>v(!1),b?500:null);const y=rb(t),w=rb(C=>{var E,j;clearTimeout(f.current),g!==C&&(C||(c(!1),n&&h.current&&((E=u.current)==null||E.focus()),h.current=!1),(j=y.current)==null||j.call(y,C),o(C),n&&v(C))}),x=p.useCallback(C=>{w.current(C)},[w]),O=p.useCallback(()=>{f.current=setTimeout(()=>x(!0),i)},[x,i]),k=p.useCallback(()=>{clearTimeout(f.current)},[]);p.useEffect(()=>()=>{clearTimeout(f.current)},[]);const S=p.useMemo(()=>({open:g,setOpen:x,shake:l,setShake:c,showOnHover:n,temporarilyPreventClickToClose:b,onTriggerEnter:O,onTriggerLeave:k,isPointerInTransitRef:m,triggerRef:u,contentRef:d,hoverOpenFocusedWithTab:h}),[g,x,l,c,n,b,h,m,O,k]);return a.jsx(RLe,{value:S,children:a.jsx(IRe,{open:g,onOpenChange:x,modal:!1,children:r})})},gjt=({children:e,onPointerDown:t,onClick:n})=>{const{setOpen:i,showOnHover:r,temporarilyPreventClickToClose:s,onTriggerEnter:o,onTriggerLeave:l,isPointerInTransitRef:c,triggerRef:u,contentRef:d}=LM(),f=p.useRef(!1),h=b=>{!(b.currentTarget.nodeName.toLocaleLowerCase()==="a")&&s&&(b.preventDefault(),b.stopPropagation())},m=b=>{b.pointerType!=="touch"&&!f.current&&!c.current&&(o(),f.current=!0)},g=()=>{f.current&&(l(),f.current=!1)};return a.jsx(PRe,{asChild:!0,ref:u,onPointerDown:b=>{h(b),t==null||t(b)},onClick:b=>{h(b),n==null||n(b)},onPointerMove:r?m:void 0,onPointerLeave:r?g:void 0,onFocus:r?()=>i(!0):void 0,onBlur:r?()=>{setTimeout(()=>{var b;(b=d.current)!=null&&b.contains(document.activeElement)||i(!1)},50)}:void 0,children:e})},ILe=({children:e,avoidCollisions:t,width:n,minWidth:i,maxWidth:r,side:s,sideOffset:o=8,align:l,alignOffset:c,translucent:u,className:d,autoFocus:f=!0})=>{const{showOnHover:h,shake:m,contentRef:g}=LM(),b=v=>{const y=g.current;if(y&&v.target===y&&v.key==="Tab"&&v.shiftKey){v.preventDefault(),v.stopPropagation();const w=sNe(y),x=w[w.length-1];x==null||x.focus()}};return p.useEffect(()=>{const v=g.current;!v||!f||v!=null&&v.contains(document.activeElement)||h||v.focus({preventScroll:!0})},[g,h,f]),a.jsx(MRe,{forceMount:!0,ref:g,className:Ui(NLe.Popover,d),style:z0({"popover-width":n,"popover-min-width":i,"popover-max-width":r}),onCloseAutoFocus:h?Dp:void 0,"data-animate":m?"shake":void 0,"data-translucent":u?"true":void 0,side:s,sideOffset:o,align:l,alignOffset:c??(l==="center"?0:-5),avoidCollisions:t??!0,hideWhenDetached:!0,collisionPadding:20,onOpenAutoFocus:Dp,onEscapeKeyDown:Dp,onKeyDown:b,children:e})},bjt=e=>{const{setOpen:t,triggerRef:n,contentRef:i,isPointerInTransitRef:r,hoverOpenFocusedWithTab:s}=LM(),[o,l]=p.useState(null),c=p.useCallback(()=>{l(null),r.current=!1},[r]),u=p.useCallback((d,f)=>{const h=ojt(d,f);l(h),r.current=!0},[r]);return p.useEffect(()=>()=>c(),[c]),p.useEffect(()=>{const d=n.current,f=i.current;if(!d||!f)return;const h=g=>u(g,f),m=g=>u(g,d);return d.addEventListener("pointerleave",h),f.addEventListener("pointerleave",m),()=>{d.removeEventListener("pointerleave",h),f.removeEventListener("pointerleave",m)}},[i,n,u,c]),p.useEffect(()=>{if(!o)return;const d=f=>{const h=n.current,m=i.current,g=f.target,b={x:f.clientX,y:f.clientY},v=(h==null?void 0:h.contains(g))||(m==null?void 0:m.contains(g)),y=!djt(b,o),w=g.hasAttribute("aria-haspopup");v?c():(y||w)&&(c(),t(!1))};return document.addEventListener("pointermove",d),()=>document.removeEventListener("pointermove",d)},[o,t,c,n,i]),p.useEffect(()=>{const d=f=>{if(i.current&&f.key==="Tab"&&!f.shiftKey){const[h]=sNe(i.current);h&&(f.preventDefault(),h.focus(),s.current=!0,document.removeEventListener("keydown",d))}};return document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d)}},[i,s]),a.jsx(ILe,{...e})},yjt=e=>{const{open:t,showOnHover:n,setOpen:i}=LM();return JA(t,()=>{i(!1)}),a.jsx(DRe,{forceMount:!0,children:a.jsx(Y1,{enterDuration:600,exitDuration:300,className:NLe.Transition,disableAnimations:!0,children:t&&(n?a.jsx(bjt,{...e},"popover-hover"):a.jsx(ILe,{...e},"popover"))})})};Lg.Trigger=gjt;Lg.Content=yjt;const vjt=["skill_hub","skill_space","knowledge_base","tool"];function PLe(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m4 6 4 4 4-4"})})}function DLe({label:e}){return a.jsx("div",{className:"create-agent-card__loading",role:"status","aria-label":e,children:[0,1,2].map(t=>a.jsxs("div",{className:"create-agent-card__skeleton-row","aria-hidden":"true",children:[a.jsx("span",{}),a.jsx("span",{})]},t))})}function xjt(e,t){return e.kind==="tool"?t("blocks.createAgents.builtinTool"):e.kind==="knowledge_base"?t("blocks.createAgents.knowledgeBase"):e.source.startsWith("skill_hub:")?"Skill Hub":e.source.startsWith("skill_space:")?t("blocks.createAgents.skillCenter"):"Skill"}function L4({label:e,resources:t}){const{t:n}=Te("conversation");return t.length===0?null:a.jsxs("section",{className:"create-agent-card__popover-section",children:[a.jsx("h4",{children:e}),a.jsx("div",{className:"create-agent-card__popover-list",children:t.map(i=>a.jsxs("div",{className:"create-agent-card__popover-item",children:[a.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[a.jsx("strong",{children:i.name}),a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",children:xjt(i,n)})]}),i.description?a.jsx("p",{children:i.description}):null]},i.ref))})]})}function wjt({tools:e}){const{t}=Te("conversation");return e.length===0?null:a.jsxs("section",{className:"create-agent-card__popover-section",children:[a.jsx("h4",{children:t("blocks.createAgents.selfAuthoredTools")}),a.jsx(kLe,{children:e.map((n,i)=>a.jsxs(ALe,{className:"create-agent-card__python-tool",value:`${n.name}:${i}`,children:[a.jsx(TLe,{className:"create-agent-card__python-tool-header",children:a.jsxs(_Le,{className:"create-agent-card__python-tool-trigger",children:[a.jsxs("span",{children:[a.jsx("strong",{children:n.name}),n.description?a.jsx("small",{children:n.description}):null]}),a.jsxs("span",{className:"create-agent-card__python-tool-meta",children:[a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",children:t("blocks.createAgents.selfAuthoredTools")}),a.jsx(PLe,{className:"create-agent-card__python-tool-chevron"})]})]})}),a.jsxs(jLe,{className:"create-agent-card__python-tool-panel",children:[n.dependencies.length>0?a.jsx("div",{className:"create-agent-card__python-tool-dependencies",children:t("blocks.createAgents.dependencies",{items:n.dependencies.join(", ")})}):null,a.jsx("pre",{tabIndex:0,"aria-label":t("blocks.createAgents.fullCode",{name:n.name}),children:a.jsx("code",{children:n.code})})]})]},`${n.name}:${i}`))})]})}function Ojt({agents:e}){const{t}=Te("conversation");return e.length===0?null:a.jsxs("section",{className:"create-agent-card__popover-section",children:[a.jsx("h4",{children:t("blocks.createAgents.subAgents")}),a.jsx("div",{className:"create-agent-card__popover-list",children:e.map(n=>a.jsxs("div",{className:"create-agent-card__popover-item",children:[a.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[a.jsx("strong",{children:n.id}),a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",children:t(`blocks.createAgents.agentTypes.${n.type}`,{defaultValue:n.type})})]}),n.description?a.jsx("p",{children:n.description}):null]},n.id))})]})}function R_({label:e,count:t,icon:n,children:i}){const{t:r}=Te("conversation"),s=a.jsxs("button",{className:"create-agent-card__resource-metric",type:"button",disabled:t===0,"aria-label":r("blocks.createAgents.itemCount",{label:e,count:t}),children:[n,a.jsx("span",{children:t})]});return t===0?s:a.jsxs(Lg,{showOnHover:!0,hoverOpenDelay:120,children:[a.jsx(Lg.Trigger,{children:s}),a.jsx(Lg.Content,{side:"top",align:"start",minWidth:"auto",maxWidth:360,className:"create-agent-card__resource-popover",children:i})]})}function kjt({response:e,status:t}){const{t:n}=Te("conversation"),i=p.useMemo(()=>({tool:n("blocks.createAgents.sourceLabels.tool"),knowledge:n("blocks.createAgents.sourceLabels.knowledge"),skillCenter:n("blocks.createAgents.sourceLabels.skillCenter"),unknownSource:n("blocks.createAgents.sourceLabels.unknown"),unnamedResource:n("blocks.createAgents.unnamedResource"),unnamedAgent:n("blocks.createAgents.unnamedAgent")}),[n]),r=p.useMemo(()=>L_t(e,i),[i,e]),s=p.useMemo(()=>vjt.map(c=>{const u=$_t(r,c);return{value:c,label:n(`blocks.createAgents.categories.${c}`),...u,searchKeywords:[...new Set(u.sources.flatMap(d=>d.searchKeywords))]}}),[r,n]),o=t==="failed",l=o?MM(e):"";return a.jsx("section",{className:"create-agent-tool-card","aria-label":n("blocks.createAgents.collectionAria"),children:t==="running"?a.jsx(DLe,{label:n("blocks.createAgents.retrieving")}):o?a.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[a.jsx("span",{className:"create-agent-card__message-title",children:n("blocks.createAgents.retrievalFailed")}),a.jsx("span",{children:l||n("blocks.createAgents.checkConfig")})]}):a.jsx(kLe,{className:"create-agent-card__accordion",children:s.map(c=>a.jsxs(ALe,{className:"create-agent-card__accordion-item",value:c.value,children:[a.jsx(TLe,{className:"create-agent-card__accordion-header",children:a.jsxs(_Le,{className:"create-agent-card__accordion-trigger",children:[a.jsx("span",{children:c.label}),a.jsxs("span",{className:"create-agent-card__accordion-meta",children:[a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",children:c.sources.length===0?c.value==="skill_hub"?n("blocks.createAgents.notSearched"):n("blocks.createAgents.notConfigured"):c.resources.length}),a.jsx(PLe,{className:"create-agent-card__accordion-chevron"})]})]})}),a.jsx(jLe,{className:"create-agent-card__accordion-content",children:a.jsxs("div",{className:"create-agent-card__accordion-scroll",role:"region","aria-label":n("blocks.createAgents.resourceList",{label:c.label}),tabIndex:0,children:[c.value==="skill_hub"&&c.searchKeywords.length>0?a.jsxs("div",{className:"create-agent-card__search-keywords",children:[a.jsx("span",{children:n("blocks.createAgents.searchKeywords")}),a.jsx("span",{children:c.searchKeywords.join("、")})]}):null,c.resources.length>0?a.jsx("div",{className:"create-agent-card__resource-list",children:c.resources.map(u=>a.jsx("div",{className:"create-agent-card__resource",children:a.jsxs("div",{className:"create-agent-card__resource-main",children:[a.jsxs("div",{className:"create-agent-card__resource-title",children:[a.jsx("span",{className:"create-agent-card__resource-name",children:u.name}),u.version?a.jsx(Ya,{className:"create-agent-card__resource-version",color:"secondary",size:"sm",variant:"soft",children:u.version}):null]}),u.description?a.jsx("p",{children:u.description}):null]})},u.ref))}):a.jsxs("div",{className:"create-agent-card__empty-category",children:[a.jsx("p",{children:c.sources.length===0?c.value==="skill_hub"?n("blocks.createAgents.skillHubSkipped"):n("blocks.createAgents.sourceSkipped",{label:c.label}):n("blocks.createAgents.noResources")}),c.sources.filter(u=>u.message).map(u=>a.jsx("p",{className:"create-agent-card__raw-source-error",children:u.message},u.source))]})]})})]},c.value))},r.collectionId||"collected-resources")})}function Sjt({args:e,response:t,status:n}){const{t:i}=Te("conversation"),r=p.useMemo(()=>({tool:i("blocks.createAgents.sourceLabels.tool"),knowledge:i("blocks.createAgents.sourceLabels.knowledge"),skillCenter:i("blocks.createAgents.sourceLabels.skillCenter"),unknownSource:i("blocks.createAgents.sourceLabels.unknown"),unnamedResource:i("blocks.createAgents.unnamedResource"),unnamedAgent:i("blocks.createAgents.unnamedAgent")}),[i]),s=p.useMemo(()=>bLe(e,t,r),[e,r,t]),o=n==="failed"?MM(t):"";return a.jsxs("section",{className:"create-agent-tool-card is-agent-results","aria-label":i("blocks.createAgents.resultAria"),children:[o?a.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[a.jsx("span",{className:"create-agent-card__message-title",children:i("blocks.createAgents.creationFailed")}),a.jsx("span",{children:o})]}):null,s.agents.length>0?a.jsx("div",{className:"create-agent-card__agent-grid",children:s.agents.map(l=>{const c=n==="failed"?"failed":l.status,u=l.error||c==="failed"&&o,d=l.builtinTools.length+l.pythonTools.length;return a.jsxs(vH,{className:`create-agent-card__agent-card${u?" is-error":""}`,children:[a.jsx(xH,{leading:a.jsx(t1,{seed:l.name}),title:l.name,titleText:l.name,status:a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",children:i(`blocks.createAgents.agentTypes.${l.rootType}`,{defaultValue:l.rootType})})}),l.description?a.jsx(wH,{children:l.description}):null,u?a.jsx("div",{className:"create-agent-card__agent-result is-error",role:"alert",children:u}):null,a.jsxs("div",{className:"create-agent-card__agent-resources","aria-label":i("blocks.createAgents.agentResources",{name:l.name}),children:[a.jsx(R_,{label:i("blocks.createAgents.skill"),count:l.skills.length,icon:a.jsx(mN,{"aria-hidden":"true"}),children:a.jsx(L4,{label:i("blocks.createAgents.skill"),resources:l.skills})}),a.jsx(R_,{label:i("blocks.createAgents.knowledgeBase"),count:l.knowledgeBases.length,icon:a.jsx(mIe,{"aria-hidden":"true"}),children:a.jsx(L4,{label:i("blocks.createAgents.knowledgeBase"),resources:l.knowledgeBases})}),a.jsxs(R_,{label:i("blocks.createAgents.toolsLabel"),count:d,icon:a.jsx(pat,{"aria-hidden":"true"}),children:[a.jsx(L4,{label:i("blocks.createAgents.builtinTool"),resources:l.builtinTools}),a.jsx(wjt,{tools:l.pythonTools})]}),a.jsx(R_,{label:i("blocks.createAgents.subAgents"),count:l.subAgentCount,icon:a.jsx(gat,{"aria-hidden":"true"}),children:a.jsx(Ojt,{agents:l.subAgents})})]})]},l.name)})}):n==="running"?a.jsx(DLe,{label:i("blocks.createAgents.creating")}):a.jsxs("div",{className:"create-agent-card__message",children:[a.jsx("span",{className:"create-agent-card__message-title",children:i("blocks.createAgents.noAgents")}),a.jsx("span",{children:i("blocks.createAgents.noAgentResult")})]})]})}const Ejt={web_search:{name:"web_search",runningLabel:"Searching the web",doneLabel:"Web search complete",tone:"search",icon:Pne},link_reader:{name:"link_reader",runningLabel:"Reading webpage",doneLabel:"Webpage read complete",tone:"search",icon:Pne},run_code:{name:"run_code",runningLabel:"Running code in the AgentKit sandbox",doneLabel:"Code execution completed in the AgentKit sandbox",tone:"sandbox",icon:m_t},list_envs:{name:"list_envs",runningLabel:"Checking available environments",doneLabel:"Available environments loaded",tone:"resources",icon:b_t},get_env_manifest:{name:"get_env_manifest",runningLabel:"Loading the environment manifest",doneLabel:"Environment manifest loaded",tone:"knowledge",icon:y_t},execute_in_sandbox:{name:"execute_in_sandbox",runningLabel:"Running a command in the environment",doneLabel:"Command completed in the environment",tone:"sandbox",icon:Mne},delegate_to_codex_sandbox:{name:"delegate_to_codex_sandbox",runningLabel:"Codex Sandbox is running",doneLabel:"Codex Sandbox completed",failedLabel:"Codex Sandbox failed",tone:"sandbox",icon:Mne},image_generate:{name:"image_generate",runningLabel:"Generating image",doneLabel:"Image generated",tone:"image",icon:u_t},video_generate:{name:"video_generate",runningLabel:"Generating video",doneLabel:"Video generated",tone:"video",icon:lq},ppt_generate:{name:"ppt_generate",runningLabel:"Generating presentation",doneLabel:"Presentation generated",tone:"presentation",icon:d_t},load_memory:{name:"load_memory",runningLabel:"Searching long-term memory",doneLabel:"Memory search complete",tone:"memory",icon:f_t},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"Searching the knowledge base",doneLabel:"Knowledge base search complete",tone:"knowledge",icon:h_t},load_skill:{name:"load_skill",runningLabel:"Loading skill",doneLabel:"Skill loaded",tone:"skill",icon:p_t},collect_resources:{name:"collect_resources",runningLabel:"Collecting available resources",doneLabel:"Resource collection complete",failedLabel:"Resource collection failed",tone:"resources",icon:g_t,detailRenderer:kjt},create_agents:{name:"create_agents",runningLabel:"Creating and running agents",doneLabel:"Agent creation complete",failedLabel:"Agent creation failed",tone:"agent",icon:Dne,detailRenderer:Sjt},branch_compare:{name:"branch_compare",runningLabel:"",doneLabel:"",failedLabel:"",tone:"search",icon:Dne,detailRenderer:U_t,hideHeader:!0}};function mq(e){return Ejt[e]}function Cjt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3h8l4 4v14H6Z"}),a.jsx("path",{d:"M14 3v5h5"}),a.jsx("path",{d:"m10 12-2 2 2 2M14 12l2 2-2 2"})]})}function Ajt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M12 3 19 6v5c0 4.6-2.8 7.8-7 10-4.2-2.2-7-5.4-7-10V6l7-3Z"}),a.jsx("path",{d:"m9 12 2 2 4-4"})]})}function Tjt(e,t){const n=new Map(e.map(o=>[o.path,o.content])),i=new Map(t.map(o=>[o.path,o.content])),r=new Set([...n.keys(),...i.keys()]),s=[];for(const o of[...r].sort((l,c)=>l.localeCompare(c))){const l=n.get(o),c=i.get(o);l!==c&&s.push({path:o,status:l===void 0?"added":c===void 0?"deleted":"modified",before:l??"",after:c??""})}return s}function Nb(e){return{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,...e}}function MLe(e){return a.jsx("svg",{...Nb(e),children:a.jsx("path",{d:"m9 7-5 5 5 5M15 7l5 5-5 5M13.5 4l-3 16"})})}function $4(e){return a.jsx("svg",{...Nb(e),children:a.jsx("path",{d:"M6.5 3.75h7l4 4V20.25h-11zM13.5 3.75v4h4M9 12h6M9 15.5h4.5"})})}function _jt(e){return a.jsx("svg",{...Nb(e),children:a.jsx("path",{d:"M3.75 7.25h6l1.75 2h8.75v9.25H3.75zM3.75 7.25V5.5h5l1.5 1.75"})})}function jjt(e){return a.jsx("svg",{...Nb(e),children:a.jsx("path",{d:"m9 5 7 7-7 7"})})}function xT(e){return a.jsx("svg",{...Nb(e),children:a.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function Njt(e){return a.jsxs("svg",{...Nb(e),children:[a.jsx("circle",{cx:"12",cy:"12",r:"3.25"}),a.jsx("path",{d:"M12 2.75v2M12 19.25v2M2.75 12h2M19.25 12h2M5.45 5.45l1.4 1.4M17.15 17.15l1.4 1.4M18.55 5.45l-1.4 1.4M6.85 17.15l-1.4 1.4"})]})}function Rjt(e){return a.jsx("svg",{...Nb(e),children:a.jsx("path",{d:"M19.25 15.25A8 8 0 0 1 8.75 4.75a8 8 0 1 0 10.5 10.5Z"})})}function LLe(e){return a.jsxs("svg",{...Nb(e),children:[a.jsx("path",{d:"M19.25 8.25V4.5l-1.8 1.8a7.5 7.5 0 1 0 1.8 7.65"}),a.jsx("path",{d:"M19.25 4.5H15.5"})]})}const Ijt=p.lazy(()=>Zs(()=>Promise.resolve().then(()=>wFe),void 0)),Pjt=p.lazy(()=>Zs(()=>import("../chunks/CodeDiffEditor-D2VDIxmZ.js"),[])),$Le="veadk-code-workspace-theme";function Djt(e){const t={name:"",children:new Map};for(const n of e){const i=n.path.split("/").filter(Boolean);let r=t;i.forEach((s,o)=>{let l=r.children.get(s);l||(l={name:s,children:new Map},r.children.set(s,l)),o===i.length-1&&(l.path=n.path),r=l})}return t}function Mjt(e,t=!1){return[...e.children.values()].sort((n,i)=>{const r=n.children.size>0&&n.path===void 0,s=i.children.size>0&&i.path===void 0;return r!==s?t?r?1:-1:r?-1:1:n.name.localeCompare(i.name)})}function Ljt(){if(typeof window>"u")return"light";try{return window.localStorage.getItem($Le)==="dark"?"dark":"light"}catch{return"light"}}function $jt(e){return e===""?0:e.split(` -`).length}function a1({project:e,open:t,onClose:n,onChange:i,readOnly:r=!1,comparison:s}){var N;const{t:o}=Te("workspaceTools"),l=p.useId(),c=p.useRef(null),u=p.useRef(null),d=p.useRef(n),[f,h]=p.useState(Ljt),m=p.useMemo(()=>s?Tjt(s.baseProject.files,e.files):[],[s,e.files]),g=p.useMemo(()=>s?m.map(P=>({path:P.path,content:P.status==="deleted"?P.before:P.after})):e.files,[m,s,e.files]),b=p.useMemo(()=>new Map(m.map(P=>[P.path,P.status])),[m]),[v,y]=p.useState(((N=g[0])==null?void 0:N.path)??null),[w,x]=p.useState(new Set),O=p.useMemo(()=>Djt(g),[g]),k=g.find(P=>P.path===v)??null,S=m.find(P=>P.path===v)??null;if(d.current=n,p.useEffect(()=>{try{window.localStorage.setItem($Le,f)}catch{}},[f]),p.useEffect(()=>{var _;if(!t)return;const P=document.body.style.overflow,I=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(_=u.current)==null||_.focus();const D=L=>{if(L.key==="Escape"){L.preventDefault(),d.current();return}if(L.key!=="Tab"||!c.current)return;const F=[...c.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')].filter(q=>q.offsetParent!==null);if(F.length===0)return;const M=F[0],V=F[F.length-1];L.shiftKey&&document.activeElement===M?(L.preventDefault(),V.focus()):!L.shiftKey&&document.activeElement===V&&(L.preventDefault(),M.focus())};return window.addEventListener("keydown",D),()=>{document.body.style.overflow=P,window.removeEventListener("keydown",D),I!=null&&I.isConnected&&I.focus()}},[t]),p.useEffect(()=>{k||g.length===0||y(g[0].path)},[g,k]),!t)return null;function C(P){x(I=>{const D=new Set(I);return D.has(P)?D.delete(P):D.add(P),D})}function E(P){return P?a.jsx("span",{className:`code-browser-change is-${P}`,children:o(`codeBrowser.change.${P}`)}):null}function j(P,I,D){return Mjt(P,I===0).map(_=>{const L=D?`${D}/${_.name}`:_.name;if(!(_.children.size>0&&_.path===void 0)&&_.path){const V=b.get(_.path);return a.jsxs("button",{type:"button",className:`code-browser-file${v===_.path?" is-active":""}`,style:{paddingLeft:`${12+I*16}px`},onClick:()=>y(_.path??null),title:_.path,"aria-pressed":v===_.path,children:[a.jsx($4,{}),a.jsx("span",{children:_.name}),E(V)]},L)}const M=w.has(L);return a.jsxs("div",{children:[a.jsxs("button",{type:"button",className:"code-browser-folder",style:{paddingLeft:`${10+I*16}px`},onClick:()=>C(L),"aria-expanded":!M,children:[a.jsx(jjt,{className:M?"":"is-open"}),a.jsx(_jt,{}),a.jsx("span",{children:_.name})]}),!M&&j(_,I+1,L)]},L)})}function T(P){!k||s||i({...e,files:e.files.map(I=>I.path===k.path?{...I,content:P}:I)})}const R=f==="light"?"dark":"light",A=o(s?"codeBrowser.noChanges":"codeBrowser.chooseFile");return yi.createPortal(a.jsx("div",{className:"code-browser-backdrop",onMouseDown:P=>{P.target===P.currentTarget&&n()},children:a.jsxs("section",{ref:c,className:`code-browser-dialog is-${f}`,role:"dialog","aria-modal":"true","aria-labelledby":l,children:[a.jsxs("header",{className:"code-browser-head",children:[a.jsxs("div",{className:"code-browser-title-wrap",children:[a.jsx("span",{className:"code-browser-title-icon",children:a.jsx(MLe,{})}),a.jsxs("div",{children:[a.jsx("h2",{id:l,children:o(s?"codeBrowser.compareTitle":"codeBrowser.workspaceTitle")}),a.jsx("p",{title:e.name,children:e.name||o("codeBrowser.projectFallback")})]})]}),a.jsxs("div",{className:"code-browser-head-actions",children:[a.jsx("button",{type:"button",className:"code-browser-icon-button",onClick:()=>h(R),"aria-label":o("codeBrowser.switchTheme"),title:o("codeBrowser.switchThemeTitle",{theme:o(`codeBrowser.themes.${R}`)}),children:f==="light"?a.jsx(Rjt,{}):a.jsx(Njt,{})}),a.jsx("button",{ref:u,type:"button",className:"code-browser-icon-button",onClick:n,"aria-label":o("codeBrowser.closeWorkspace"),title:o("codeBrowser.close"),children:a.jsx(xT,{})})]})]}),a.jsxs("div",{className:"code-browser-workspace",children:[a.jsxs("aside",{className:"code-browser-sidebar","aria-label":o(s?"codeBrowser.changedFiles":"codeBrowser.projectFiles"),children:[a.jsxs("div",{className:"code-browser-sidebar-head",children:[a.jsx("span",{children:o(s?"codeBrowser.changes":"codeBrowser.files")}),a.jsx("span",{children:g.length})]}),a.jsx("div",{className:"code-browser-tree",children:g.length>0?j(O,0,""):a.jsx("div",{className:"code-browser-empty",children:A})})]}),a.jsxs("main",{className:"code-browser-main",children:[a.jsx("div",{className:"code-browser-tabs",role:"tablist","aria-label":o("codeBrowser.openFiles"),children:k?a.jsxs("div",{className:"code-browser-tab",role:"tab","aria-selected":"true",children:[a.jsx($4,{}),a.jsx("span",{children:k.path.split("/").pop()}),E(S==null?void 0:S.status)]}):null}),a.jsxs("div",{className:"code-browser-path",children:[a.jsx($4,{}),a.jsx("span",{children:(k==null?void 0:k.path)??o("codeBrowser.noFileSelected")})]}),s?a.jsxs("div",{className:"code-browser-diff-labels","aria-label":o("codeBrowser.comparisonDirection"),children:[a.jsx("span",{children:s.baseLabel??o("codeBrowser.before")}),a.jsx("span",{children:s.targetLabel??o("codeBrowser.after")})]}):null,a.jsx("div",{className:"code-browser-editor",children:k?a.jsx(p.Suspense,{fallback:a.jsx("div",{className:"code-browser-empty",children:o("codeBrowser.loadingEditor")}),children:S?a.jsx(Pjt,{before:S.before,after:S.after,path:S.path,theme:f}):a.jsx(Ijt,{value:k.content,path:k.path,onChange:T,readOnly:r,theme:f})}):a.jsx("div",{className:"code-browser-empty",children:A})}),a.jsxs("footer",{className:"code-browser-statusbar",children:[a.jsx("span",{children:s?o("codeBrowser.changedFileCount",{count:m.length}):o("codeBrowser.fileCount",{count:e.files.length})}),a.jsx("span",{children:k?o("codeBrowser.lineCount",{count:$jt(k.content)}):"UTF-8"})]})]})]})]})}),document.body)}function Fjt({project:e,onChange:t,className:n="",label:i}){const{t:r}=Te("workspaceTools"),[s,o]=p.useState(!1),l=i??r("codeBrowser.viewSource");return a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:`code-browser-trigger ${n}`.trim(),onClick:()=>o(!0),"aria-label":r("codeBrowser.viewSourceAria"),title:l,children:[a.jsx(MLe,{}),a.jsx("span",{children:l})]}),a.jsx(a1,{project:e,open:s,onClose:()=>o(!1),onChange:t})]})}const my="••••••••",I_=5,Uv=8e3,Bjt=8,Ujt=/(?:authorization|cookie|password|passwd|secret|token|api[_-]?key|access[_-]?key|credential|signature|^env(?:ironment)?$|^ak$|^sk$)/i,FLe=/\u001b\[[0-?]*[ -/]*[@-~]/g,BLe=/\u001b\][^\u0007]*(?:\u0007|\u001b\\)/g,ULe=/[\u0000-\u0008\u000b\u000c\u000e-\u001a\u001c-\u001f\u007f-\u009f]/g,Qjt=new Set(["exec_command","commandExecution","command_execution","run_code","execute_in_sandbox","Run command"]),zjt=new Set(["web_search","search","grep","rg"]),Vjt=new Set(["read_file","read","list_files","glob","ls"]),Hjt=new Set(["apply_patch","file_change","fileChange"]),qjt=new Set(["create_goal","update_goal","get_goal"]);function vg(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function b0(...e){for(const t of e)if(typeof t=="string"&&t.trim())return t.trim();return""}function F4(...e){for(const t of e){if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"&&t.trim()&&Number.isFinite(Number(t)))return Number(t)}}function PI(e){const t=vg(e);if(!t)return[];const n=[t];for(const i of["payload","input","arguments","args","goal","result","display","safeCommandSummary","safeInputSummary"]){const r=vg(t[i]);r&&n.push(r)}return n}function mE(e,...t){return b0(...e.flatMap(n=>t.map(i=>n[i])))}function Wjt(e){let t=e.replace(FLe,"").replace(BLe,"").replace(ULe,"");return/[=:]|Bearer|Cookie|AKLT/i.test(t)&&(t=t.replace(/\bBearer\s+[^\s,;]+/gi,`Bearer ${my}`).replace(/\b(?:set-)?cookie\s*:\s*[^\r\n]*/gi,`cookie: ${my}`).replace(/\bAKLT[A-Za-z0-9_-]{6,}\b/g,my).replace(/((?:access[_-]?key(?:[_-]?id)?|secret(?:[_-]?(?:access)?[_-]?key)?|session[_-]?token|security[_-]?token|client[_-]?secret|api[_-]?key|authorization|cookie|[a-z0-9_-]{0,80}(?:password|secret|token)|credential|ak|sk)\s*[:=]\s*)(?:"[^"]*"|'[^']*'|[^\s,;&]+)/gi,`$1${my}`).replace(/([?&](?:access[_-]?key|api[_-]?key|client[_-]?secret|security[_-]?token|session[_-]?token|secret|token|password|authorization|cookie|credential)=)[^&#\s]+/gi,`$1${my}`).replace(/([?&](?:x-amz-(?:credential|signature|security-token)|x-tos-signature|signature)=)[^&#\s]+/gi,`$1${my}`)),t}function rf(e){return Wjt(e).replace(FLe,"").replace(BLe,"").replace(ULe,"")}function DI(e,t=0,n=new WeakSet){if(t>=Bjt)return"[truncated: maximum depth]";if(typeof e=="string")return rf(e);if(e===null||typeof e!="object")return e;if(n.has(e))return"[circular]";if(n.add(e),Array.isArray(e))return e.map(r=>DI(r,t+1,n));const i=vg(e);return i?Object.fromEntries(Object.entries(i).map(([r,s])=>[r,Ujt.test(r)?my:DI(s,t+1,n)])):e}function B4(e){const t=rf(e).trimEnd();if(!t)return;const n=t.split(/\r?\n/);return t.length>Uv*2?{text:t.slice(0,Uv)+t.slice(-Uv),head:[t.slice(0,Uv)],tail:[t.slice(-Uv)],omittedLines:0,omittedCharacters:t.length-Uv*2}:n.length<=I_*2?{text:t,head:n,tail:[],omittedLines:0,omittedCharacters:0}:{text:t,head:n.slice(0,I_),tail:n.slice(-I_),omittedLines:n.length-I_*2,omittedCharacters:0}}function Kjt(e){return qjt.has(e)?"goal":Qjt.has(e)?"command":zjt.has(e)||/search/i.test(e)?"search":Vjt.has(e)||/(?:read|list|glob)/i.test(e)?"read":Hjt.has(e)||/(?:write|edit|patch|file.?change)/i.test(e)?"file-change":/^(?:mcp|tool__)/i.test(e)||e.includes("/")?"mcp":/auth|credential|approval/i.test(e)?"authorization":"generic"}function Gjt(e,t){if(e.status)return e.status;const n=b0(t==null?void 0:t.status).toLowerCase();return(t==null?void 0:t.ok)===!1||["failed","error","cancelled","denied","timeout"].includes(n)?"failed":e.done||["completed","done","success"].includes(n)?"completed":"running"}function Qne(e){return typeof e=="string"?e.trim()?[e.trim()]:[]:Array.isArray(e)?e.flatMap(t=>{if(typeof t=="string")return t.trim()?[t.trim()]:[];const n=vg(t),i=b0(n==null?void 0:n.path,n==null?void 0:n.filename,n==null?void 0:n.name);return i?[i]:[]}):[]}function Xjt(e,t,n,i,r){const s=[...PI(n),...PI(i)];return e==="goal"?rf(mE(s,"objective","title","name")):e==="command"?rf(mE(s,"command","cmd","script","commandPreview","binary")):e==="search"?rf(mE(s,"query","pattern","search")):e==="read"||e==="file-change"?r.slice(0,2).map(rf).join(", "):rf(e==="mcp"?b0(n==null?void 0:n.query,n==null?void 0:n.resource,n==null?void 0:n.path):b0(n==null?void 0:n.title,n==null?void 0:n.name,i==null?void 0:i.message,i==null?void 0:i.status,t))}function gq(e){const t=vg(e.args),n=vg(e.response),i=e.args===void 0?void 0:DI(e.args),r=e.response===void 0?void 0:DI(e.response),s=[...PI(e.args),...PI(e.response)],o=Kjt(e.name),l=Gjt(e,n),c=vg(n==null?void 0:n.display)??vg(t==null?void 0:t.display),u=b0(n==null?void 0:n.aggregatedOutput,n==null?void 0:n.aggregated_output,n==null?void 0:n.output,n==null?void 0:n.errorMessage,n==null?void 0:n.error_message),d=[...Qne((t==null?void 0:t.paths)??(t==null?void 0:t.files)??(t==null?void 0:t.changes)??(t==null?void 0:t.path)),...Qne((n==null?void 0:n.paths)??(n==null?void 0:n.files)??(n==null?void 0:n.changes))],f=F4(n==null?void 0:n.exitCode,n==null?void 0:n.exit_code),h=F4(n==null?void 0:n.durationMs,n==null?void 0:n.duration_ms,c==null?void 0:c.durationMs),m=F4(n==null?void 0:n.count,n==null?void 0:n.total,n==null?void 0:n.totalCount);return{category:o,titleKey:o==="generic"?`generic.named.${l}`:`${o}.${l}`,titleParams:o==="generic"?{tool:e.name}:void 0,title:e.title,summary:Xjt(o,e.name,t,n,d),status:l,source:e.source,command:o==="command"?rf(b0(mE(s,"command","cmd","script","commandPreview","binary"))):void 0,cwd:o==="command"&&rf(mE(s,"cwd"))||void 0,output:B4(u),exitCode:f,durationMs:h,resultCount:m,paths:[...new Set(d.map(rf))],defaultOpen:e.defaultOpen===!0||l==="running"||l==="failed",rawArgs:i,rawResponse:r,rawArgsPreview:i===void 0?void 0:B4(zne(i)),rawResponsePreview:r===void 0?void 0:B4(zne(r))}}function zne(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}function Vne(e){return e.status==="completed"&&(e.category==="read"||e.category==="search")}function Nd(e){return{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,...e}}function Yjt(e){return a.jsxs("svg",{...Nd(e),children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),a.jsx("path",{d:"m7.5 9 2.7 2.5L7.5 14M12.7 14h3.8M3.8 7.5h16.4"})]})}function QLe(e){return a.jsxs("svg",{...Nd(e),children:[a.jsx("path",{d:"M6 3.5h7l5 5v12H6zM13 3.5v5h5M8.8 13h5.7M8.8 16h3.8"}),a.jsx("circle",{cx:"16.8",cy:"16.5",r:"2.3"}),a.jsx("path",{d:"m18.5 18.2 1.8 1.8"})]})}function Zjt(e){return a.jsxs("svg",{...Nd(e),children:[a.jsx("circle",{cx:"10.5",cy:"10.5",r:"5.75"}),a.jsx("path",{d:"m15 15 4.25 4.25"})]})}function Jjt(e){return a.jsxs("svg",{...Nd(e),children:[a.jsx("path",{d:"M5.5 3.5h7l4 4v4M12.5 3.5v4h4M10.5 20.5h-5v-17"}),a.jsx("path",{d:"m12.5 17.5 5.6-5.6 2 2-5.6 5.6-2.8.8z"})]})}function eNt(e){return a.jsxs("svg",{...Nd(e),children:[a.jsx("path",{d:"M8 8V4.5M16 8V4.5M6.5 8h11v3.5a5.5 5.5 0 0 1-11 0zM12 17v3"}),a.jsx("path",{d:"M5.5 4.5h5M13.5 4.5h5"})]})}function tNt(e){return a.jsxs("svg",{...Nd(e),children:[a.jsx("path",{d:"M12 3.5 19 6v5.2c0 4.3-2.7 7.6-7 9.3-4.3-1.7-7-5-7-9.3V6z"}),a.jsx("path",{d:"m8.8 12 2 2 4.4-4.4"})]})}function Hne(e){return a.jsx("svg",{...Nd(e),children:a.jsx("path",{d:"M14.8 6.2a4.1 4.1 0 0 0-5.6 5.6l-5.4 5.4a2 2 0 0 0 2.8 2.8l5.4-5.4a4.1 4.1 0 0 0 5.6-5.6l-2.5 2.5-2.6-.6-.6-2.6z"})})}function bq(e){return a.jsx("svg",{...Nd(e),children:a.jsx("path",{d:"m9 5 7 7-7 7"})})}function zLe(e){return a.jsx("svg",{...Nd(e),children:a.jsx("path",{d:"m5 12.5 4.5 4.5L19 7.5"})})}function nNt(e){return a.jsxs("svg",{...Nd(e),children:[a.jsx("circle",{cx:"12",cy:"12",r:"8.5"}),a.jsx("path",{d:"M12 7.5v5.25M12 16.25h.01"})]})}function iNt(e){return a.jsx("svg",{...Nd(e),children:a.jsx("path",{d:"M20 12a8 8 0 1 1-2.35-5.65"})})}function rNt(e){return a.jsxs("svg",{...Nd(e),children:[a.jsx("rect",{x:"8",y:"8",width:"11",height:"11",rx:"2"}),a.jsx("path",{d:"M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2"})]})}const sNt={goal:Hne,command:Yjt,read:QLe,search:Zjt,"file-change":Jjt,mcp:eNt,authorization:tNt,generic:Hne};function aNt(e){return e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(e<1e4?1:0)} s`}function VLe(e){if(e===void 0)return"";if(typeof e=="string"){const t=e.trim();if(t.startsWith("{")||t.startsWith("["))try{return JSON.stringify(JSON.parse(t),null,2)}catch{return e}return e}try{return JSON.stringify(e,null,2)}catch{return String(e)}}function oNt({status:e}){return e==="running"||e==="queued"?a.jsx(iNt,{className:"tool-activity__status-icon is-spinning"}):e==="failed"?a.jsx(nNt,{className:"tool-activity__status-icon"}):a.jsx(zLe,{className:"tool-activity__status-icon"})}function lNt({presentation:e,callId:t}){const{t:n}=Te("conversation"),[i,r]=p.useState(!1),[s,o]=p.useState(""),[l,c]=p.useState(!1),u=p.useRef(void 0);p.useEffect(()=>()=>window.clearTimeout(u.current),[]);const d=async(f,h)=>{window.clearTimeout(u.current);try{await navigator.clipboard.writeText(typeof h=="string"?h:VLe(h)),o(f),c(!1),u.current=window.setTimeout(()=>o(""),1500)}catch{o(""),c(!0),u.current=window.setTimeout(()=>c(!1),3e3)}};return e.rawArgs===void 0&&e.rawResponse===void 0&&!t?null:a.jsxs("div",{className:"tool-activity__raw",children:[a.jsxs("button",{type:"button",onClick:()=>r(f=>!f),"aria-expanded":i,children:[n("blocks.toolActivity.rawData"),a.jsx(bq,{className:i?"is-open":""})]}),i?a.jsxs("div",{className:"tool-activity__raw-body",children:[t?a.jsxs("div",{className:"tool-activity__raw-id",children:[a.jsx("span",{children:n("blocks.toolActivity.callId")}),a.jsx("code",{children:t}),a.jsx("button",{type:"button",onClick:()=>void d("id",t),"aria-label":n("blocks.toolActivity.copyCallId"),children:a.jsx(rNt,{})})]}):null,e.rawArgs!==void 0?a.jsx(qne,{label:n("blocks.arguments"),value:e.rawArgs,preview:e.rawArgsPreview,copied:s==="input",onCopy:()=>void d("input",e.rawArgs)}):null,e.rawResponse!==void 0?a.jsx(qne,{label:n("blocks.result"),value:e.rawResponse,preview:e.rawResponsePreview,copied:s==="result",onCopy:()=>void d("result",e.rawResponse)}):null,l?a.jsx("span",{className:"tool-activity__copy-error",role:"alert",children:n("blocks.toolActivity.copyFailed")}):null]}):null]})}function qne({label:e,value:t,preview:n,copied:i,onCopy:r}){const{t:s}=Te("conversation");return a.jsxs("section",{className:"tool-activity__raw-section",children:[a.jsxs("div",{children:[a.jsx("span",{children:e}),a.jsx("button",{type:"button",onClick:r,children:s(i?"blocks.toolActivity.copied":"blocks.toolActivity.copy")})]}),a.jsxs("pre",{children:[(n==null?void 0:n.head.join(` -`))??VLe(t),n&&n.omittedCharacters>0?` +`+v+"]"}return r.pop(),s=v,w}};const pTt={parse:oTt,stringify:hTt};var HMe=pTt;const mTt=2e5,gTt=new Set(["__proto__","constructor","prototype"]),bTt=/^(?:https?:|data:|blob:|file:|javascript:|image:\/\/)/i;function mS(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function II(e,t=0){if(t>30)throw new Error("ECharts option nesting is too deep");if(typeof e=="number"&&!Number.isFinite(e))throw new Error("ECharts option contains a non-finite number");if(typeof e=="string"&&bTt.test(e.trim()))throw new Error("ECharts option contains an external resource");if(Array.isArray(e)){for(const n of e)II(n,t+1);return}if(mS(e))for(const[n,i]of Object.entries(e)){if(gTt.has(n))throw new Error("ECharts option contains an unsafe key");II(i,t+1)}}function yTt(e){var i;const t=e.trim(),n=t.match(/^(?:(?:const|let|var)\s+)?option\s*=\s*([\s\S]*?)\s*;?$/);return((i=n==null?void 0:n[1])==null?void 0:i.trim())||t}function vTt(e,t){let n=1,i="",r=!1,s=!1,o=!1;for(let l=t+1;li+2)throw new Error("Invalid ECharts gradient argument count");const r=n.slice(0,i).map(xTt),s=n[i],o=n[i+1]??!1;if(!Array.isArray(s)||typeof o!="boolean")throw new Error("Invalid ECharts gradient data");return e==="linear"?{type:e,x:r[0],y:r[1],x2:r[2],y2:r[3],colorStops:s,global:o}:{type:e,x:r[0],y:r[1],r:r[2],colorStops:s,global:o}}function OTt(e,t){const n=/^(?:new\s+)?echarts\.graphic\.(LinearGradient|RadialGradient)\s*\(/;let i="",r=!1,s=!1,o=!1;for(let l=t;lmTt)throw new Error("ECharts option is too large");const n=kTt(yTt(e));let i;try{i=HMe.parse(n)}catch(o){throw/\bfunction\s*\(|=>/.test(n)?new Error("ECharts function callbacks are not supported"):o}if(!mS(i))throw new Error("ECharts option must be a data object");II(i);const r={...i};r.aria={...mS(r.aria)?r.aria:{},enabled:!0};const s=r.tooltip;return mS(s)?r.tooltip={...s,renderMode:"richText"}:Array.isArray(s)&&(r.tooltip=s.map(o=>mS(o)?{...o,renderMode:"richText"}:o)),t&&(r.animation=!1),r}let P4;function STt(){return P4??(P4=Zs(()=>import("../visualizations/echarts/index-CGT341lL.js"),[]).catch(e=>{throw P4=void 0,e})),P4}function ETt({source:e}){const{t}=Te("conversation"),n=p.useRef(null),[i,r]=p.useState(!1),[s,o]=p.useState("");return p.useEffect(()=>{let l=!1,c,u,d;r(!1);try{d=qMe(e,window.matchMedia("(prefers-reduced-motion: reduce)").matches),o("")}catch{o("invalid");return}return STt().then(f=>{const h=n.current;l||!h||(c=f.init(h,void 0,{renderer:"svg"}),c.setOption(d,{notMerge:!0}),typeof ResizeObserver<"u"&&(u=new ResizeObserver(()=>c==null?void 0:c.resize()),u.observe(h)),r(!0))}).catch(()=>{c==null||c.dispose(),c=void 0,l||o("render")}),()=>{l=!0,u==null||u.disconnect(),c==null||c.dispose()}},[e]),a.jsxs("div",{className:`echarts-diagram${s?" echarts-diagram--error":""}`,role:"img","aria-label":t("visualization.echartsAria"),"aria-busy":!i&&!s,children:[a.jsx("div",{ref:n,className:"echarts-diagram__canvas",hidden:!!s}),!i&&!s?a.jsx("div",{className:"echarts-diagram__state","aria-live":"polite",children:a.jsx(cn,{duration:2.2,spread:15,children:t("visualization.rendering")})}):null,s?a.jsx("p",{className:"echarts-diagram__error",role:"alert",children:t(s==="invalid"?"visualization.invalidEcharts":"visualization.renderFailed")}):null]})}const CTt=p.memo(ETt);let Cne,Ane=Promise.resolve(),ATt=0;function TTt(){return Cne??(Cne=Zs(async()=>{const{default:e}=await import("../visualizations/mermaid/mermaid.core-CgV8Rw9c.js").then(t=>t.ay);return{default:e}},__vite__mapDeps([0,1])).then(({default:e})=>(e.initialize({startOnLoad:!1,securityLevel:"strict",suppressErrorRendering:!0,theme:"neutral"}),e))),Cne}function _Tt(e){const t=Ane.then(async()=>{const n=await TTt(),i=`mermaid-diagram-${ATt+=1}`;return n.render(i,e)});return Ane=t.then(()=>{},()=>{}),t}function jTt({source:e}){const{t}=Te("conversation"),n=p.useRef(null),[i,r]=p.useState(null),[s,o]=p.useState(!1);return p.useEffect(()=>{let l=!1;return r(null),o(!1),_Tt(e).then(c=>{l||r(c)}).catch(()=>{l||o(!0)}),()=>{l=!0}},[e]),p.useEffect(()=>{!(i!=null&&i.bindFunctions)||!n.current||i.bindFunctions(n.current)},[i]),s?a.jsx("div",{className:"mermaid-diagram mermaid-diagram--error",children:a.jsx("p",{className:"mermaid-diagram__error",role:"alert",children:t("visualization.mermaidFailed")})}):i?a.jsx("div",{ref:n,className:"mermaid-diagram",role:"img","aria-label":t("visualization.mermaidAria"),dangerouslySetInnerHTML:{__html:i.svg}}):a.jsx("div",{className:"mermaid-diagram mermaid-diagram--loading","aria-live":"polite",children:a.jsx(cn,{duration:2.2,spread:15,children:t("visualization.rendering")})})}const NTt=p.memo(jTt),RTt="_SegmentedControl_1sl7d_1",ITt="_SegmentedControlOption_1sl7d_140",PTt="_SegmentedControlThumb_1sl7d_219",s9={SegmentedControl:RTt,SegmentedControlOption:ITt,SegmentedControlThumb:PTt},cd=({value:e,onChange:t,children:n,block:i,pill:r=!0,size:s="md",gutterSize:o,className:l,onClick:c,...u})=>{const d=p.useRef(null),f=p.useRef(null),h=p.useCallback(g=>{const b=d.current,v=f.current;if(!b||!v)return;const y=b==null?void 0:b.querySelector('[data-state="on"]');if(!y)return;const w=b.clientWidth;let x=Math.floor(y.clientWidth);const O=y.offsetLeft;if(w-(x+O)<2&&(x=x-1),v.style.width=`${Math.floor(x)}px`,v.style.transform=`translateX(${O}px)`,b.scrollWidth>w){const k=w*.15,S=b.scrollLeft,C=y.offsetLeft,E=C+x;(CS+w-k)&&g&&y.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"})}},[]);iNe({ref:d,onResize:()=>{const g=f.current;if(!g)return;const b=g.style.transition;g.style.transition="",h(!1),g.style.transition=b}}),p.useLayoutEffect(()=>{const g=d.current,b=f.current;!g||!b||(h(!!b.style.transition),b.style.transition||pI(()=>{b.style.transition="width 300ms var(--cubic-enter), transform 300ms var(--cubic-enter)"}))},[h,e,s,o,r]);const m=g=>{g&&t&&t(g)};return a.jsxs(Oft,{ref:d,className:Qi(s9.SegmentedControl,l),type:"single",value:e,loop:!1,onValueChange:m,onClick:c,"data-block":i?"":void 0,"data-pill":r?"":void 0,"data-size":s,"data-gutter-size":o,...u,children:[a.jsx("div",{className:s9.SegmentedControlThumb,ref:f}),n]})},DTt=({children:e,...t})=>a.jsx(Aft,{className:s9.SegmentedControlOption,...t,onPointerEnter:SV,children:a.jsx("span",{className:"relative",children:e})});cd.Option=DTt;function MTt({children:e,label:t,language:n,source:i,streaming:r=!1}){const{t:s}=Te("conversation"),[o,l]=p.useState("preview"),c=r?"code":o;return a.jsxs("section",{className:"visualization-card","aria-label":s("visualization.cardAria",{label:t}),children:[a.jsx("div",{className:"visualization-card__toolbar",children:a.jsxs(cd,{className:"visualization-card__tabs",value:c,size:"sm",gutterSize:"sm",pill:!1,"aria-label":s("visualization.viewAria",{label:t}),onChange:u=>{r||l(u)},children:[a.jsx(cd.Option,{value:"preview",disabled:r,children:s("visualization.preview")}),a.jsx(cd.Option,{value:"code",children:s("visualization.code")})]})}),a.jsx("div",{className:"visualization-card__body",children:c==="code"?a.jsx("pre",{className:"visualization-card__code",children:a.jsx("code",{className:`language-${n}`,children:i})}):e})]})}const LTt=p.memo(MTt);function WMe(e){const t=e==null?void 0:e.trim().toLowerCase();if(t==="mermaid")return"mermaid";if(t==="echart"||t==="echarts")return"echarts"}const KMe=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function a9(e){return typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(a9).join(""):p.isValidElement(e)?a9(e.props.children):""}function $Tt(e){var i;const t=p.Children.toArray(e)[0];if(!p.isValidElement(t))return;const n=(i=t.props.className)==null?void 0:i.split(/\s+/).find(r=>r.startsWith("language-"));return WMe(n==null?void 0:n.slice(9))}function GMe(e){if(!e)return!1;try{const t=e.toLowerCase();return KMe.some(n=>t.includes(n))}catch{return!1}}function FTt(e){var i;const t=(i=e==null?void 0:e.properties)==null?void 0:i.href;if(!t)return!1;if(GMe(t))return!0;const n=e==null?void 0:e.children;if(n&&Array.isArray(n)){const r=n.map(s=>(s==null?void 0:s.value)||"").join("").toLowerCase();return KMe.some(s=>r.includes(s))}return!1}function BTt({text:e,className:t,allowRawHtml:n=!0,streaming:i=!1}){const{t:r}=Te("conversation"),s=p.useContext(Tje),[o,l]=p.useState(null),c=(f,h)=>{if(f.src)return f.src;if(h){const m=b=>{var v;if(!b)return null;if(b.type==="source"&&((v=b.properties)!=null&&v.src))return b.properties.src;if(b.children)for(const y of b.children){const w=m(y);if(w)return w}return null},g=m({children:h});if(g)return g}return""},u=f=>{try{const m=new URL(f).pathname.split("/");return m[m.length-1]||"video.mp4"}catch{return"video.mp4"}},d=f=>f?Array.isArray(f)?f.map(h=>(h==null?void 0:h.value)||"").join("")||"video":(f==null?void 0:f.value)||"video":"video";return a.jsxs("div",{className:t?`md ${t}`:"md",children:[a.jsx(WPe,{disallowedElements:s?["file-card","personal-drive-enable-card"]:void 0,remarkPlugins:[yDe],rehypePlugins:n?[tTt,ane]:[ane],components:{pre:({node:f,children:h,...m})=>{const g=$Tt(h);if(g==="mermaid"||g==="echarts"){const b=a9(h).replace(/\n$/,"");return a.jsx(LTt,{label:g==="mermaid"?"Mermaid":"ECharts",language:g,source:b,streaming:i,children:g==="mermaid"?a.jsx(NTt,{source:b}):a.jsx(CTt,{source:b})})}return a.jsx("pre",{...m,children:h})},a:({node:f,...h})=>{const m=h.href,g=s&&Hst(m);if(g)return a.jsx(qst,{...s,path:g,children:h.children});if(m&&(GMe(m)||FTt(f))){const b=m,v=d(f==null?void 0:f.children);return a.jsxs("div",{className:"video-container",children:[a.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":r("markdown.playVideo",{name:v}),onClick:()=>l({src:b,title:v}),children:[a.jsx("video",{src:b,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),a.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:a.jsx(rE,{})})]}),a.jsx("div",{className:"video-caption",children:a.jsx("a",{href:b,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:v})})]})}return a.jsx("a",{...h,target:"_blank",rel:"noopener noreferrer"})},img:({node:f,src:h,alt:m,...g})=>{const b=a.jsx("img",{...g,src:h,alt:m??"",loading:"lazy"});return h?a.jsx(LAe,{src:h,children:a.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":r("markdown.enlargeImage",{name:m||r("markdown.image")}),children:[b,a.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:a.jsx(rE,{})})]})}):b},video:({node:f,src:h,children:m,...g})=>{const b=c({src:h},m);return b?a.jsx("div",{className:"video-container",children:a.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":r("markdown.enlargeVideo"),onClick:()=>l({src:b}),children:[a.jsx("video",{src:b,...g,playsInline:!0,className:"video-thumbnail",children:m}),a.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:a.jsx(rE,{})})]})}):a.jsx("video",{src:h,controls:!0,playsInline:!0,className:"video-inline",...g,children:m})}},children:e}),o&&a.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":r("markdown.videoPreview"),onClick:()=>l(null),children:a.jsxs("div",{className:"video-viewer",onClick:f=>f.stopPropagation(),children:[a.jsxs("div",{className:"video-viewer-header",children:[a.jsx("div",{className:"video-viewer-title",children:o.title||u(o.src)}),a.jsxs("nav",{className:"video-viewer-nav",children:[a.jsx("a",{href:o.src,download:o.title||u(o.src),"aria-label":r("markdown.downloadVideo"),title:r("markdown.downloadVideo"),className:"video-viewer-download",children:a.jsx(tM,{})}),a.jsx("button",{type:"button",className:"video-viewer-close","aria-label":r("markdown.close"),onClick:()=>l(null),children:a.jsx(Do,{})})]})]}),a.jsx("div",{className:"video-viewer-body",children:a.jsx("video",{src:o.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const jd=p.memo(BTt);function D4(e){return(e==null?void 0:e.trim())||_b("resourceMetadata.unknownSource")}function XMe(e){return(e==null?void 0:e.trim())||_b("resourceMetadata.unknownCreator")}function UTt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5 5.5A2.5 2.5 0 0 1 7.5 3H19v16H7.5A2.5 2.5 0 0 0 5 21.5v-16Z"}),a.jsx("path",{d:"M5 18.5A2.5 2.5 0 0 1 7.5 16H19"}),a.jsx("path",{d:"M9 7h6M9 10h4"})]})}function QTt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3h8l4 4v14H6V3Z"}),a.jsx("path",{d:"M14 3v5h5M9 12h6M9 16h6"})]})}function zTt(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m7 7 10 10M17 7 7 17"})})}function VTt(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 5v14M5 12h14"})})}function vT({title:e,children:t,onClose:n,busy:i=!1,className:r=""}){const{t:s}=Te("ui"),o=p.useId(),l=p.useRef(null),c=p.useRef(null),u=p.useRef(i),d=p.useRef(n);return p.useEffect(()=>{u.current=i,d.current=n},[i,n]),p.useEffect(()=>{var g;const f=document.activeElement instanceof HTMLElement?document.activeElement:null,h=document.body.style.overflow;document.body.style.overflow="hidden",(g=l.current)==null||g.focus();const m=b=>{if(b.key==="Escape"&&!u.current){d.current();return}if(b.key!=="Tab")return;const v=c.current;if(!v)return;const y=Array.from(v.querySelectorAll('button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), a[href], audio[controls], video[controls], iframe, [tabindex]:not([tabindex="-1"])')).filter(O=>O.getClientRects().length>0);if(y.length===0){b.preventDefault();return}const w=y[0],x=y[y.length-1];b.shiftKey&&(document.activeElement===w||!v.contains(document.activeElement))?(b.preventDefault(),x.focus()):!b.shiftKey&&(document.activeElement===x||!v.contains(document.activeElement))&&(b.preventDefault(),w.focus())};return window.addEventListener("keydown",m),()=>{window.removeEventListener("keydown",m),document.body.style.overflow=h,f!=null&&f.isConnected&&f.focus()}},[]),yi.createPortal(a.jsx("div",{className:"knowledge-dialog-backdrop",onMouseDown:f=>{f.target===f.currentTarget&&!i&&n()},children:a.jsxs("section",{ref:c,className:`knowledge-dialog${r?` ${r}`:""}`,role:"dialog","aria-modal":"true","aria-labelledby":o,"aria-busy":i||void 0,children:[a.jsxs("header",{className:"knowledge-dialog__header",children:[a.jsx("h2",{id:o,children:e}),a.jsx("button",{ref:l,type:"button",onClick:n,disabled:i,"aria-label":s("common.close"),children:a.jsx(zTt,{})})]}),t]})}),document.body)}function TC({message:e}){return e?a.jsx("div",{className:"knowledge-form-error",role:"alert",children:e}):null}function o9(e){return e instanceof DOMException&&e.name==="AbortError"}function HTt(e,t){if(!e)return"";const n=Date.parse(e);return Number.isFinite(n)?new Intl.DateTimeFormat(t,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(n):e}const YMe=[".jpg",".jpeg",".png"].join(","),qTt=new Set(YMe.split(",")),ZMe=[".pdf",".pptx",".docx",".xlsx",".txt"].join(","),WTt=new Set(ZMe.split(",")),KTt=200*1024*1024;function l9(e){const t=e.lastIndexOf(".");return t<0?"":e.slice(t).toLocaleLowerCase()}function GTt(e,t,n){return e.size>KTt?n("knowledge.errors.fileTooLarge"):t==="image"?qTt.has(l9(e.name))?"":n("knowledge.errors.invalidImageType"):WTt.has(l9(e.name))?"":n("knowledge.errors.invalidDocumentType")}function oq(e){return e<=0?"-":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function c9(e){var r;const t=e.type.trim().replace(/^\./,"");if(t)return t.toUpperCase();const n=e.name.trim(),i=n.includes(".")?(r=n.split(".").pop())==null?void 0:r.trim():"";return i?i.toUpperCase():"-"}function XTt({region:e,onClose:t,onCreated:n}){const{t:i}=Te("ui"),[r,s]=p.useState(""),[o,l]=p.useState(""),[c,u]=p.useState(!1),[d,f]=p.useState(!1),[h,m]=p.useState(""),g=r.trim(),b=!!(g&&!/^[A-Za-z][A-Za-z0-9_]{0,47}$/.test(g)),v=async y=>{if(y.preventDefault(),u(!0),!g||b)return;f(!0),m("");const w={name:g,description:o.trim()||void 0,region:e};try{n(await Rbt(w))}catch(x){m(El(x,i("knowledge.errors.createBase")))}finally{f(!1)}};return a.jsx(vT,{title:i("knowledge.createBase"),onClose:t,busy:d,children:a.jsxs("form",{onSubmit:y=>void v(y),children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:i("common.name")}),a.jsx("input",{autoFocus:!0,value:r,maxLength:48,"aria-invalid":c&&b||void 0,"aria-describedby":"knowledge-name-help",onBlur:()=>u(!0),onChange:y=>s(y.target.value)})]}),a.jsx("p",{id:"knowledge-name-help",className:`knowledge-dialog__note${c&&b?" is-error":""}`,role:c&&b?"alert":void 0,children:i(c&&b?"knowledge.invalidName":"knowledge.nameHelp")}),a.jsxs("label",{children:[a.jsx("span",{children:i("knowledge.optionalDescription")}),a.jsx("textarea",{value:o,maxLength:80,onChange:y=>l(y.target.value)})]}),a.jsx(TC,{message:h})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:t,disabled:d,children:i("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:d||!g||b,children:i(d?"common.creating":"common.create")})]})]})})}function YTt({item:e,onClose:t,onUpdated:n}){const{t:i}=Te("ui"),[r,s]=p.useState(e.description),[o,l]=p.useState(!1),[c,u]=p.useState(""),d=async f=>{f.preventDefault(),l(!0),u("");try{n(await Ibt(e.id,e.region,{description:r.trim()}))}catch(h){u(El(h,i("knowledge.errors.updateBase")))}finally{l(!1)}};return a.jsx(vT,{title:i("knowledge.editBase"),onClose:t,busy:o,children:a.jsxs("form",{onSubmit:f=>void d(f),children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:i("common.name")}),a.jsx("input",{value:e.name,disabled:!0})]}),a.jsxs("label",{children:[a.jsx("span",{children:i("common.description")}),a.jsx("textarea",{autoFocus:!0,value:r,maxLength:80,onChange:f=>s(f.target.value)})]}),a.jsx("p",{className:"knowledge-dialog__note",children:i("knowledge.descriptionOnly")}),a.jsx(TC,{message:c})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:t,disabled:o,children:i("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:o,children:i(o?"common.saving":"common.save")})]})]})})}function JMe(e,t){if(!e.trim())return{};const n=JSON.parse(e);if(!n||Array.isArray(n)||typeof n!="object")throw new Error(t);return n}function ZTt({base:e,onClose:t,onCreated:n,onAssociationInvalid:i}){const{t:r}=Te("ui"),[s,o]=p.useState("document"),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(""),[m,g]=p.useState(null),[b,v]=p.useState(!1),[y,w]=p.useState("{}"),[x,O]=p.useState(""),[k,S]=p.useState(""),[C,E]=p.useState(null),j=p.useRef(null),T=p.useRef(null),R=p.useRef(null),A=p.useRef(0),N=!!x;p.useEffect(()=>{var L;C&&!N&&((L=R.current)==null||L.focus())},[N,C]);const D=L=>{N||L===s||(o(L),g(null),h(""),c(""),d(""),S(""),E(null),v(!1),A.current=0,j.current&&(j.current.value=""))},I=L=>{if(!L||s==="web")return;const F=GTt(L,s,r);if(F){g(null),c(""),d(""),S(F);return}g(L),S(""),c(L.name.replace(/\.[^.]+$/,"")),d(l9(L.name).slice(1))},P=async L=>{if(L.preventDefault(),s==="web"?!f.trim():!m)return;let F;try{F=JMe(y,r("knowledge.errors.metadataObject"))}catch(M){S(El(M,r("knowledge.errors.metadataFormat")));return}O(s==="web"?C?"save":"preview":"upload"),S("");try{if(s==="web")if(C){const M={sourceType:"url",metadata:C.metadata,url:C.preview.url,sourceTitle:C.preview.name,sourceMarkdown:C.preview.sourceMarkdown};await Lbt(e.id,e.region,M),n()}else{const M=await $bt(e.id,e.region,{url:f.trim()});if(!M.sourceMarkdown.trim())throw new Error(r("knowledge.errors.noWebPreview"));E({preview:M,metadata:F})}else m&&(await Fbt(e.id,e.region,{file:m,name:l.trim()||void 0,documentType:u.trim()||void 0,metadata:F}),n())}catch(M){M instanceof bM&&M.errorCode===aPe?i(M):S(El(M,r(s==="web"?C?"knowledge.errors.addWeb":"knowledge.errors.previewWeb":"knowledge.errors.uploadFile")))}finally{O("")}},_=()=>{N||(E(null),S(""),requestAnimationFrame(()=>{var L;return(L=T.current)==null?void 0:L.focus()}))};return a.jsx(vT,{title:r(C?"knowledge.previewWeb":"knowledge.addData"),onClose:t,busy:N,className:C?"knowledge-dialog--preview knowledge-dialog--web-confirm":"",children:a.jsx("form",{onSubmit:L=>void P(L),children:C?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"knowledge-preview knowledge-web-preview",children:[a.jsxs("div",{className:"knowledge-preview__meta",children:[a.jsx("strong",{title:C.preview.name,children:C.preview.name}),a.jsx("a",{href:C.preview.url,target:"_blank",rel:"noopener noreferrer",children:r("knowledge.openOriginalWeb")})]}),a.jsx("div",{className:"knowledge-preview__body","aria-live":"polite",children:a.jsx("div",{className:"knowledge-preview__markdown-shell",children:a.jsx(jd,{text:C.preview.sourceMarkdown,allowRawHtml:!1,className:"knowledge-preview__markdown"})})}),k?a.jsx("div",{className:"knowledge-web-preview__error",children:a.jsx(TC,{message:k})}):null]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",className:"is-back",onClick:_,disabled:N,children:r("knowledge.backToEdit")}),a.jsx("button",{type:"button",onClick:t,disabled:N,children:r("common.cancel")}),a.jsx("button",{ref:R,type:"submit",className:"is-primary",disabled:N,children:r(x==="save"?"common.adding":"knowledge.confirmAdd")})]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsx("div",{className:"knowledge-source-tabs",role:"tablist","aria-label":r("knowledge.source"),children:[["image",r("knowledge.image")],["document",r("knowledge.documentFile")],["web",r("knowledge.webPage")]].map(([L,F])=>a.jsx("button",{type:"button",role:"tab",id:`knowledge-source-${L}-tab`,"aria-controls":`knowledge-source-${L}-panel`,"aria-selected":s===L,tabIndex:s===L?0:-1,className:s===L?"is-active":"",disabled:N,onClick:()=>D(L),onKeyDown:M=>{const V=["image","document","web"];if(!["ArrowLeft","ArrowRight","Home","End"].includes(M.key))return;M.preventDefault();const q=V.indexOf(L),U=M.key==="Home"?V[0]:M.key==="End"?V[V.length-1]:V[(q+(M.key==="ArrowRight"?1:-1)+V.length)%V.length];D(U),requestAnimationFrame(()=>{var Z;return(Z=document.getElementById(`knowledge-source-${U}-tab`))==null?void 0:Z.focus()})},children:F},L))}),a.jsx("div",{id:`knowledge-source-${s}-panel`,className:"knowledge-source-panel",role:"tabpanel","aria-labelledby":`knowledge-source-${s}-tab`,children:s==="web"?a.jsxs(a.Fragment,{children:[a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.webUrl")}),a.jsx("input",{ref:T,autoFocus:!0,type:"url",value:f,disabled:N,onChange:L=>{h(L.target.value),S("")},placeholder:"https://example.com/article"})]}),a.jsx("div",{className:"knowledge-upload-status",role:"status","aria-live":"polite",children:x==="preview"?a.jsx(cn,{children:r("knowledge.generatingWebPreview")}):null})]}):a.jsxs(a.Fragment,{children:[a.jsx("input",{ref:j,className:"knowledge-upload-input",type:"file","aria-label":r("knowledge.selectFile"),accept:s==="image"?YMe:ZMe,disabled:N,onChange:L=>{var F;I(((F=L.currentTarget.files)==null?void 0:F[0])??null),L.currentTarget.value=""}}),a.jsxs("button",{type:"button",className:`knowledge-upload-dropzone${b?" is-dragging":""}${m?" is-ready":""}`,disabled:N,onClick:()=>{var L;return(L=j.current)==null?void 0:L.click()},onDragEnter:L=>{L.preventDefault(),!N&&(A.current+=1,v(!0))},onDragOver:L=>{L.preventDefault(),N||(L.dataTransfer.dropEffect="copy")},onDragLeave:L=>{L.preventDefault(),A.current=Math.max(0,A.current-1),A.current===0&&v(!1)},onDrop:L=>{var F;L.preventDefault(),A.current=0,v(!1),N||I(((F=L.dataTransfer.files)==null?void 0:F[0])??null)},children:[a.jsx("strong",{children:m?m.name:r("knowledge.selectOrDropFile")}),a.jsx("span",{children:m?r("knowledge.selectedFile",{size:oq(m.size)}):r(s==="image"?"knowledge.imageFileHelp":"knowledge.documentFileHelp")})]}),a.jsx("div",{className:"knowledge-upload-status",role:"status","aria-live":"polite",children:N?a.jsx(cn,{children:r("knowledge.uploadingFile")}):null})]})}),s!=="web"?a.jsxs("div",{className:"knowledge-dialog__fields",children:[a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.optionalName")}),a.jsx("input",{value:l,disabled:N,maxLength:256,onChange:L=>c(L.target.value)})]}),a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.optionalType")}),a.jsx("input",{value:u,disabled:N,maxLength:64,onChange:L=>d(L.target.value),placeholder:"pdf, docx, png"})]})]}):null,a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.metadataJson")}),a.jsx("textarea",{className:"is-code",value:y,disabled:N,onChange:L=>w(L.target.value),spellCheck:!1})]}),a.jsx(TC,{message:k})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:t,disabled:N,children:r("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:N||(s==="web"?!f.trim():!m),children:r(N?s==="web"?"common.generating":"common.uploading":s==="web"?"knowledge.generatePreview":"knowledge.uploadFile")})]})]})})})}function JTt({base:e,item:t,onClose:n,onUpdated:i}){const{t:r}=Te("ui"),[s,o]=p.useState(()=>JSON.stringify(t.metadata??{},null,2)),[l,c]=p.useState(!1),[u,d]=p.useState(""),f=async h=>{h.preventDefault();let m;try{m=JMe(s,r("knowledge.errors.metadataObject"))}catch(g){d(El(g,r("knowledge.errors.metadataFormat")));return}c(!0),d("");try{i(await Bbt(e.id,t.id,e.region,{metadata:m}))}catch(g){d(El(g,r("knowledge.errors.updateDocument")))}finally{c(!1)}};return a.jsx(vT,{title:r("knowledge.editMetadata"),onClose:n,busy:l,children:a.jsxs("form",{onSubmit:h=>void f(h),children:[a.jsxs("div",{className:"knowledge-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.knowledge")}),a.jsx("input",{value:t.name||t.id,disabled:!0})]}),a.jsxs("label",{children:[a.jsx("span",{children:r("knowledge.metadataJson")}),a.jsx("textarea",{autoFocus:!0,className:"is-code knowledge-metadata-editor",value:s,onChange:h=>o(h.target.value),spellCheck:!1})]}),a.jsx(TC,{message:u})]}),a.jsxs("footer",{className:"knowledge-dialog__actions",children:[a.jsx("button",{type:"button",onClick:n,disabled:l,children:r("common.cancel")}),a.jsx("button",{type:"submit",className:"is-primary",disabled:l,children:r(l?"common.saving":"common.save")})]})]})})}const eLe=new Set(["avif","bmp","gif","jpeg","jpg","png","svg","webp"]),tLe=new Set(["aac","flac","m4a","mp3","ogg","wav","webm"]),nLe=new Set(["m4v","mov","mp4","mpeg","mpg","ogg","webm"]),e2t=new Set(["pdf"]),t2t=new Set(["doc","docx","ppt","pptx","xls","xlsx"]),n2t=new Set(["creating","indexing","pending","processing","queued","submitted"]),i2t=new Set(["error","failed","unavailable"]);function Tne(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}}function N_(e){if(e==null||e==="")return"-";if(["string","number","boolean"].includes(typeof e))return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function r2t(e,t){if(Array.isArray(e)){if(e.length===0)return null;const r=e.map(Tne);if(r.some(s=>Object.keys(s).length>0)){const s=[...new Set(r.flatMap(o=>Object.keys(o)))];return{columns:s,rows:r.map(o=>s.map(l=>N_(o[l])))}}return{columns:[t("knowledge.value")],rows:e.map(s=>[N_(s)])}}const n=Tne(e),i=Object.entries(n);if(i.length===0)return null;if(i.every(([,r])=>Array.isArray(r))){const r=i.map(([o])=>o),s=Math.max(...i.map(([,o])=>o.length));return{columns:r,rows:Array.from({length:s},(o,l)=>i.map(([,c])=>N_(c[l])))}}return{columns:[t("knowledge.field"),t("knowledge.value")],rows:i.map(([r,s])=>[r,N_(s)])}}function iLe(e){const t=e.trim();if(!t||t.startsWith("//"))return"";if(t.startsWith("/"))return t;try{const n=new URL(t);return["http:","https:"].includes(n.protocol)?n.href:""}catch{return""}}function s2t(e){const t=iLe(e);return t.startsWith("http://")||t.startsWith("https://")?t:""}function a2t(e){var r;const t=e.attachmentType.trim().toLocaleLowerCase();if(t==="image"||t==="doc-image"||t.startsWith("image/"))return"image";if(t==="audio"||t.startsWith("audio/"))return"audio";if(t==="video"||t.startsWith("video/"))return"video";if(t==="pdf"||t==="application/pdf")return"pdf";const n=e.attachmentUrl.split(/[?#]/,1)[0],i=n.includes(".")?((r=n.split(".").pop())==null?void 0:r.toLocaleLowerCase())??"":"";return eLe.has(i)?"image":tLe.has(i)?"audio":nLe.has(i)?"video":e2t.has(i)?"pdf":t||i?"file":"none"}function o2t(e,t){const n=e.status.trim().toLocaleLowerCase();if(n2t.has(n))return{title:t("knowledge.preview.processingTitle"),detail:t("knowledge.preview.processingDetail")};if(i2t.has(n))return{title:t("knowledge.preview.failedTitle"),detail:t("knowledge.preview.failedDetail")};const i=c9(e).toLocaleLowerCase();return i==="pdf"||t2t.has(i)?{title:t("knowledge.preview.noParsedTitle"),detail:t("knowledge.preview.noParsedDetail")}:eLe.has(i)||tLe.has(i)||nLe.has(i)?{title:t("knowledge.preview.noMediaTitle"),detail:t("knowledge.preview.noMediaDetail")}:{title:t("knowledge.preview.noDataTitle"),detail:t("knowledge.preview.noDataDetail")}}function l2t({chunk:e}){const{t}=Te("ui"),[n,i]=p.useState(!1),r=iLe(e.attachmentUrl),s=a2t(e);return!r||s==="none"?null:n?a.jsx("div",{className:"knowledge-preview__attachment-error",children:t("knowledge.preview.attachmentError")}):s==="image"?a.jsx("img",{className:"knowledge-preview__image",src:r,alt:e.title||t("knowledge.preview.imageAlt"),loading:"lazy",onError:()=>i(!0)}):s==="audio"?a.jsx("audio",{className:"knowledge-preview__audio",src:r,controls:!0,preload:"metadata",onError:()=>i(!0),children:t("knowledge.preview.audioUnsupported")}):s==="video"?a.jsx("video",{className:"knowledge-preview__video",src:r,controls:!0,playsInline:!0,preload:"metadata",onError:()=>i(!0),children:t("knowledge.preview.videoUnsupported")}):s==="pdf"?a.jsxs("div",{className:"knowledge-preview__pdf",children:[a.jsx("iframe",{src:r,title:e.title?t("knowledge.preview.namedPdf",{name:e.title}):t("knowledge.preview.pdf"),sandbox:"",referrerPolicy:"no-referrer",onError:()=>i(!0)}),a.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:t("knowledge.preview.openPdf")})]}):a.jsxs("div",{className:"knowledge-preview__file-fallback",children:[a.jsx("p",{children:t("knowledge.preview.fileUnsupported")}),a.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:t("knowledge.preview.openOriginalFile")})]})}function c2t({base:e,item:t,onClose:n}){const{t:i}=Te("ui"),[r,s]=p.useState([]),[o,l]=p.useState(t),[c,u]=p.useState(""),[d,f]=p.useState(!0),[h,m]=p.useState(!1),[g,b]=p.useState(!1),[v,y]=p.useState(""),w=p.useRef(0),x=p.useRef(null),O=p.useCallback(async(E=0)=>{var R;(R=x.current)==null||R.abort();const j=new AbortController;x.current=j;const T=w.current+1;w.current=T,E>0?m(!0):f(!0),y(""),E===0&&(s([]),b(!1));try{const A=await Mbt(e.id,t.id,{region:e.region,offset:E,signal:j.signal});if(w.current!==T)return;l(A.document.id?A.document:t),u(A.sourceMarkdown||A.document.sourceMarkdown),s(N=>E>0?[...N,...A.chunks]:A.chunks),b(A.hasMore)}catch(A){!o9(A)&&w.current===T&&y(El(A,i("knowledge.errors.loadPreview")))}finally{w.current===T&&(f(!1),m(!1))}},[e.id,e.region,t,i]);p.useEffect(()=>(O(),()=>{var E;(E=x.current)==null||E.abort(),w.current+=1}),[O]);const k=s2t(o.url||t.url),S=o2t(o,i),C=o.metadata._veadk_content_format==="markdown";return a.jsx(vT,{title:o.name||t.name||t.id,onClose:n,className:"knowledge-dialog--preview",children:a.jsxs("div",{className:"knowledge-preview",children:[o.sizeBytes>0||k?a.jsxs("div",{className:"knowledge-preview__meta",children:[o.sizeBytes>0?a.jsx("span",{children:oq(o.sizeBytes)}):null,k?a.jsx("a",{href:k,target:"_blank",rel:"noopener noreferrer",children:i("knowledge.openOriginalWeb")}):null]}):null,a.jsx("div",{className:"knowledge-preview__body","aria-live":"polite",children:c?a.jsx("div",{className:"knowledge-preview__markdown-shell",children:a.jsx(jd,{text:c,allowRawHtml:!1,className:"knowledge-preview__markdown"})}):d?a.jsx("div",{className:"knowledge-preview__state",role:"status",children:a.jsx(cn,{as:"span",duration:2.4,children:i("knowledge.preview.loading")})}):v&&r.length===0?a.jsxs("div",{className:"knowledge-preview__state is-error",role:"alert",children:[a.jsx("p",{children:v}),a.jsx("button",{type:"button",onClick:()=>void O(),children:i("common.retry")})]}):r.length===0?a.jsxs("div",{className:"knowledge-preview__state",children:[a.jsx("p",{children:S.title}),a.jsx("span",{children:k?i("knowledge.preview.openOriginalHint"):S.detail}),a.jsx("button",{type:"button",onClick:()=>void O(),children:i("common.reload")})]}):a.jsxs("div",{className:"knowledge-preview__chunks",children:[r.map((E,j)=>{const T=r2t(E.tableFields,i),R=E.id||`${j}:${E.title}`;return a.jsxs("article",{className:"knowledge-preview__chunk",children:[a.jsx("header",{children:a.jsx("h3",{children:E.title||i("knowledge.preview.chunk",{index:j+1})})}),E.content?C?a.jsx(jd,{text:E.content,allowRawHtml:!1,className:"knowledge-preview__markdown"}):a.jsx("p",{className:"knowledge-preview__content",children:E.content}):null,T?a.jsx("div",{className:"knowledge-preview__table-wrap",children:a.jsxs("table",{children:[a.jsx("thead",{children:a.jsx("tr",{children:T.columns.map((A,N)=>a.jsx("th",{scope:"col",children:A},`${A}:${N}`))})}),a.jsx("tbody",{children:T.rows.map((A,N)=>a.jsx("tr",{children:A.map((D,I)=>a.jsx("td",{children:D},I))},N))})]})}):null,a.jsx(l2t,{chunk:E})]},R)}),v?a.jsx("div",{className:"knowledge-preview__more-error",role:"alert",children:v}):null,g?a.jsx("button",{type:"button",className:"knowledge-preview__load-more",disabled:h,onClick:()=>void O(r.length),children:h?a.jsx(cn,{as:"span",duration:2.4,children:i("knowledge.preview.loadingMore")}):i("knowledge.preview.loadMore")}):null]})})]})})}function u2t({cloudProvider:e,region:t,active:n=!0,activationRevision:i=0,onDetailChange:r,toolbarLeading:s,toolbarFilters:o}){const{t:l,i18n:c}=Te("ui"),[u,d]=p.useState([]),[f,h]=p.useState({}),[m,g]=p.useState([]),[b,v]=p.useState(""),[y,w]=p.useState("overview"),[x,O]=p.useState(""),[k,S]=p.useState(""),[C,E]=p.useState(!0),[j,T]=p.useState(!1),[R,A]=p.useState(""),[N,D]=p.useState([]),[I,P]=p.useState(!1),[_,L]=p.useState(""),[F,M]=p.useState(""),[V,q]=p.useState(""),[U,Z]=p.useState(!1),[z,ee]=p.useState(!1),[ne,W]=p.useState(!1),[X,H]=p.useState(null),[ae,Y]=p.useState(null),[K,ie]=p.useState(null),[J,ye]=p.useState(null),[de,ge]=p.useState(null),[Ee,xe]=p.useState(!1),Ne=p.useRef(0),We=p.useRef(0),Xe=p.useRef([]),Re=p.useRef(!1),se=p.useRef(!1),ce=p.useRef(null),ve=p.useRef(null),Se=p.useRef({}),oe=p.useRef(!1),$e=p.useRef(null),Ue=p.useRef(null),me=p.useRef(null),ke=p.useRef(null),Ae=p.useMemo(()=>[t],[t]),He=p.useCallback(Ke=>`${Ke.region}\0${Ke.id}`,[]),Qe=u.find(Ke=>He(Ke)===b)??null,jt=!!(Qe&&V===He(Qe));p.useEffect(()=>{r==null||r(!!Qe)},[r,Qe]),p.useEffect(()=>{w("overview"),S("")},[b]);const Pt=p.useMemo(()=>{const Ke=x.trim().toLocaleLowerCase();return Ke?u.filter(St=>[St.name,St.description,St.ownerLabel,St.providerKnowledgeId].some(qe=>qe.toLocaleLowerCase().includes(Ke))):u},[u,x]),Kt=p.useMemo(()=>{const Ke=k.trim().toLocaleLowerCase();return Ke?N.filter(St=>[St.name,St.id,c9(St)].some(qe=>qe.toLocaleLowerCase().includes(Ke))):N},[k,N]);p.useEffect(()=>{Y(null)},[Qe==null?void 0:Qe.id,Qe==null?void 0:Qe.region]);const Ct=p.useCallback(async(Ke=!1)=>{var nt;if(Ke&&(oe.current||Object.keys(Se.current).length===0))return;(nt=ce.current)==null||nt.abort();const St=new AbortController;ce.current=St;const qe=Ne.current+1;Ne.current=qe,oe.current=!0,Ke?T(!0):E(!0),A(""),Ke||g([]);try{const et=await Nbt({regions:Ae,nextTokens:Ke?Se.current:void 0,signal:St.signal});if(Ne.current!==qe)return;d(Et=>Ke?[...Et,...et.items.filter(At=>!Et.some(It=>He(It)===He(At)))]:et.items),Se.current=et.nextTokens,h(et.nextTokens);const ft=et.failures.map(({region:Et,error:At})=>`${Oh(Et,e)}: ${El(At,l("common.loadFailed"))}`);g(Et=>Ke?[...new Set([...Et,...ft])]:ft),Ke||v(Et=>et.items.some(At=>He(At)===Et)?Et:"")}catch(et){if(o9(et))return;Ne.current===qe&&(Ke?g(ft=>[...new Set([...ft,El(et,l("knowledge.errors.loadMoreBases"))])]):A(El(et,l("knowledge.errors.loadBases"))))}finally{Ne.current===qe&&(oe.current=!1,E(!1),T(!1))}},[He,e,Ae,l]),xt=p.useCallback(async(Ke,St=!1)=>{var et;if(St&&Re.current)return;(et=ve.current)==null||et.abort();const qe=new AbortController;ve.current=qe;const nt=We.current+1;We.current=nt,St||(Xe.current=[],se.current=!1,D([]),Z(!1),M("")),Re.current=!0,P(!0),St?M(""):L("");try{const ft=await Dbt(Ke.id,{region:Ke.region,offset:St?Xe.current.length:0,signal:qe.signal});if(We.current!==nt)return;q(Gt=>Gt===He(Ke)?"":Gt);const Et=Xe.current,At=St?[...Et,...ft.items.filter(Gt=>!Gt.id||!Et.some(Ye=>Ye.id===Gt.id))]:ft.items,It=ft.hasMore&&(!St||At.length>Et.length);Xe.current=At,se.current=It,D(At),Z(It)}catch(ft){if(o9(ft))return;We.current===nt&&(ft instanceof bM&&ft.errorCode===aPe&&(q(He(Ke)),H(At=>At&&He(At)===He(Ke)?null:At)),St?M(El(ft,l("knowledge.errors.loadMoreData"))):L(El(ft,l("knowledge.errors.loadData"))))}finally{We.current===nt&&(Re.current=!1,P(!1))}},[He,l]);p.useEffect(()=>{var Ke;(Ke=ce.current)==null||Ke.abort(),Ne.current+=1,oe.current=!1,Se.current={},d([]),h({}),g([]),v(""),q(""),A(""),E(!0)},[e]),p.useEffect(()=>{if(n)return Ct(),()=>{var Ke;(Ke=ce.current)==null||Ke.abort(),Ne.current+=1,oe.current=!1}},[n,i,Ct]),p.useEffect(()=>{var Ke,St;if(!n){(Ke=ve.current)==null||Ke.abort(),We.current+=1,Re.current=!1;return}if(!Qe){(St=ve.current)==null||St.abort(),We.current+=1,Xe.current=[],Re.current=!1,se.current=!1,D([]),Z(!1),M("");return}return xt(Qe),()=>{var qe;(qe=ve.current)==null||qe.abort(),We.current+=1,Re.current=!1}},[n,i,Qe==null?void 0:Qe.id,Qe==null?void 0:Qe.region]);const tt=n&&!Qe&&!x.trim()&&!C&&!j&&!R&&Object.keys(f).length>0;p.useEffect(()=>{const Ke=Ue.current,St=$e.current;if(!Ke||!St||!tt)return;const qe=new IntersectionObserver(([nt])=>{nt.isIntersecting&&Ct(!0)},{root:St,rootMargin:"240px 0px",threshold:.01});return qe.observe(Ke),()=>qe.disconnect()},[tt,Ct]);const mt=()=>{const Ke=$e.current;!Ke||!tt||Ke.scrollHeight-Ke.scrollTop-Ke.clientHeight<=240&&Ct(!0)},_e=!!(Qe&&N.length>0&&U&&!I&&!F);p.useEffect(()=>{const Ke=ke.current,St=me.current;if(!Qe||!Ke||!St||!_e)return;const qe=new IntersectionObserver(([nt])=>{nt.isIntersecting&&xt(Qe,!0)},{root:me.current,rootMargin:"240px 0px",threshold:.01});return qe.observe(Ke),()=>qe.disconnect()},[_e,xt,Qe==null?void 0:Qe.id,Qe==null?void 0:Qe.region]);const Ot=()=>{const Ke=me.current;if(!Qe||!Ke||!se.current||Re.current||F)return;const{scrollHeight:St,scrollTop:qe,clientHeight:nt}=Ke;St-qe-nt<=240&&xt(Qe,!0)},Nt=Ke=>{d(St=>St.map(qe=>He(qe)===He(Ke)?Ke:qe))},Yt=async()=>{if(J){xe(!0);try{await Pbt(J.id,J.region),d(Ke=>Ke.filter(St=>He(St)!==He(J))),q(Ke=>Ke===He(J)?"":Ke),b===He(J)&&v(""),ye(null)}catch(Ke){A(El(Ke,l("knowledge.errors.deleteBase"))),ye(null)}finally{xe(!1)}}},xn=async()=>{if(!(!Qe||!de)){xe(!0);try{await Ubt(Qe.id,de.id,Qe.region);const Ke=Xe.current.filter(St=>St.id!==de.id);Xe.current=Ke,D(Ke),ge(null)}catch(Ke){L(El(Ke,l("knowledge.errors.deleteDocument"))),ge(null)}finally{xe(!1)}}};return a.jsxs("section",{className:`knowledge-library${Qe?" is-detail":" resource-collection"}`,"aria-label":l("knowledge.library"),children:[Qe?a.jsx(lT,{className:"knowledge-library__detail",title:Qe.name,description:Qe.description||l("common.noDescription"),identitySeed:Qe.name,backLabel:l("knowledge.backToList"),onBack:()=>v(""),sections:[{key:"overview",label:l("skillCenter.overview"),content:a.jsx("section",{className:"knowledge-overview",children:a.jsxs(yH,{className:"knowledge-overview__summary",children:[a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.provider")}),a.jsx("dd",{children:Qe.providerType||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.knowledgeId")}),a.jsx("dd",{className:"knowledge-keyboard-reveal",tabIndex:0,title:Qe.providerKnowledgeId,children:Qe.providerKnowledgeId||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.project")}),a.jsx("dd",{children:Qe.projectName||"default"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("knowledge.creator")}),a.jsx("dd",{children:D4(Qe.ownerLabel)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("skillCenter.updatedAt")}),a.jsx("dd",{children:HTt(Qe.updatedAt,c.resolvedLanguage??c.language)||"-"})]})]})})},{key:"data",label:l("knowledge.data"),content:a.jsx("section",{className:"knowledge-documents",children:a.jsx("div",{className:`knowledge-documents__body${N.length>0?" is-table":""}`,"aria-live":"polite",children:I&&N.length===0?a.jsx(cl,{}):_&&N.length===0?a.jsxs("div",{className:"knowledge-library__state is-error",role:"alert",children:[a.jsx("p",{children:_}),jt&&Qe.canManage?a.jsx("button",{type:"button",onClick:()=>ye(Qe),children:l("knowledge.deleteInvalidAssociation")}):a.jsx("button",{type:"button",onClick:()=>void xt(Qe),children:l("common.retry")})]}):N.length===0?a.jsxs("div",{className:"knowledge-library__state",children:[a.jsx(QTt,{}),a.jsx("p",{children:l("knowledge.noData")}),Qe.canManage&&a.jsx("button",{type:"button",onClick:()=>H(Qe),children:l("knowledge.addFirstData")})]}):a.jsx(vH,{rows:Kt,rowKey:Ke=>Ke.id,rowLabel:Ke=>Ke.name||Ke.id,columns:[{key:"name",header:l("common.name"),className:"is-primary-column",render:Ke=>a.jsx("span",{title:Ke.name||Ke.id,children:Ke.name||Ke.id})},{key:"format",header:l("knowledge.format"),className:"is-compact-column",render:Ke=>c9(Ke)},{key:"size",header:l("knowledge.size"),className:"is-compact-column",render:Ke=>oq(Ke.sizeBytes)}],searchValue:k,onSearchChange:S,searchPlaceholder:l("knowledge.searchData"),searchLabel:l("knowledge.searchLibraryData"),primaryAction:Qe.canManage?{label:l(jt?"knowledge.associationInvalid":"knowledge.addData"),disabled:jt,title:jt?l("knowledge.providerMissing"):void 0,onClick:()=>H(Qe)}:void 0,rowActions:Ke=>[{label:l("common.preview"),onSelect:()=>Y(Ke)},...Qe.canManage?[{label:l("common.edit"),onSelect:()=>ie(Ke)},{label:l("common.delete"),onSelect:()=>ge(Ke),danger:!0}]:[]],scrollRef:me,onScroll:Ot,busy:I,emptyLabel:l("knowledge.noMatchingData"),footer:I?a.jsxs("div",{className:"knowledge-document-pagination",role:"status","aria-live":"polite",children:[a.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),a.jsx("span",{children:l("knowledge.loadingMoreData")})]}):F?a.jsxs("div",{className:"knowledge-document-pagination is-error",role:"alert",children:[a.jsx("span",{children:F}),a.jsx("button",{type:"button",onClick:()=>void xt(Qe,!0),children:l("knowledge.retryLoading")})]}):U?a.jsx("div",{ref:ke,className:"knowledge-document-pagination",role:"status","aria-live":"polite",children:l("skillCenter.scrollForMore")}):null})})})}],activeSectionKey:y,navigationLabel:l("knowledge.details"),onSectionChange:w,actions:Qe.canManage?a.jsxs(a.Fragment,{children:[a.jsx(_t,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>ye(Qe),children:l("common.delete")}),a.jsx(_t,{type:"button",color:"primary",size:"lg",pill:!1,onClick:()=>W(!0),children:l("common.edit")})]}):void 0}):a.jsxs(a.Fragment,{children:[a.jsxs(ab,{className:"knowledge-library__toolbar library-resource-toolbar",children:[s,a.jsxs("div",{className:"resource-toolbar__actions",children:[o,a.jsx(Jp,{value:x,onChange:Ke=>O(Ke.target.value),placeholder:l("knowledge.searchBases"),"aria-label":l("knowledge.searchBases")})]})]}),a.jsxs(em,{ref:$e,"aria-live":"polite",onScroll:mt,children:[m.length>0&&!C&&a.jsxs("div",{className:"knowledge-region-warning",role:"status",children:[a.jsx("span",{children:l("knowledge.someBasesFailed")}),a.jsx("button",{type:"button",onClick:()=>void Ct(),children:l("common.retry")})]}),C&&u.length===0?a.jsx(cl,{}):R?a.jsxs("div",{className:"knowledge-library__state is-error",role:"alert",children:[a.jsx("p",{children:R}),a.jsx("button",{type:"button",onClick:()=>void Ct(),children:l("common.retry")})]}):Pt.length===0&&x.trim()?a.jsxs("div",{className:"knowledge-library__state",children:[a.jsx(UTt,{}),a.jsx("p",{children:l("knowledge.noMatchingBases")})]}):a.jsxs(K0,{children:[x.trim()?null:a.jsx(cb,{"aria-label":l("knowledge.createBase"),icon:a.jsx(VTt,{}),onClick:()=>ee(!0),children:l("knowledge.createBase")}),Pt.map(Ke=>a.jsx(X0,{className:"knowledge-card",title:Ke.name,description:Ke.description||l("common.noDescription"),metadata:[{label:l("knowledge.creator"),value:D4(Ke.ownerLabel),title:D4(Ke.ownerLabel)},{label:l("knowledge.project"),value:Ke.projectName||"default",title:Ke.projectName||"default"}],action:{label:V===He(Ke)?l("knowledge.associationInvalid"):l("knowledge.addData"),icon:"plus",disabled:!Ke.canManage||V===He(Ke),title:Ke.canManage?V===He(Ke)?l("knowledge.providerMissing"):void 0:l("knowledge.noManagePermission"),onClick:()=>H(Ke)},detailAction:{label:l("common.viewDetails"),onClick:()=>v(He(Ke))}},He(Ke)))]}),tt||j?a.jsx("div",{ref:Ue,className:"my-agent-load-more",role:"status","aria-live":"polite",children:j?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),a.jsx("span",{children:l("knowledge.loadingMoreBases")})]}):tt?a.jsx("span",{children:l("skillCenter.scrollForMore")}):null}):null]})]}),z&&a.jsx(XTt,{region:t,onClose:()=>ee(!1),onCreated:Ke=>{d(St=>[Ke,...St]),v(He(Ke)),ee(!1)}}),Qe&&ne&&a.jsx(YTt,{item:Qe,onClose:()=>W(!1),onUpdated:Ke=>{Nt(Ke),W(!1)}}),Qe&&ae&&a.jsx(c2t,{base:Qe,item:ae,onClose:()=>Y(null)}),X&&a.jsx(ZTt,{base:X,onClose:()=>H(null),onAssociationInvalid:Ke=>{q(He(X)),Qe&&He(Qe)===He(X)&&L(El(Ke,l("knowledge.associationInvalid"))),H(null)},onCreated:()=>{Qe&&He(Qe)===He(X)&&xt(Qe),H(null)}}),Qe&&K&&a.jsx(JTt,{base:Qe,item:K,onClose:()=>ie(null),onUpdated:Ke=>{const St=Xe.current.map(qe=>qe.id===Ke.id?Ke:qe);Xe.current=St,D(St),ie(null)}}),J&&a.jsx(Td,{title:l("knowledge.deleteBaseTitle"),description:l("knowledge.deleteBaseDescription",{name:J.name}),confirmLabel:l(Ee?"common.deleting":"common.delete"),variant:"danger",busy:Ee,onCancel:()=>ye(null),onConfirm:()=>void Yt()}),de&&a.jsx(Td,{title:l("knowledge.deleteDocumentTitle"),description:l("knowledge.deleteDocumentDescription",{name:de.name||de.id}),confirmLabel:l(Ee?"common.deleting":"common.delete"),variant:"danger",busy:Ee,onCancel:()=>ge(null),onConfirm:()=>void xn()})]})}const d2t="_EmptyMessage_1r5gu_1",f2t="_IconBadge_1r5gu_16",h2t="_Title_1r5gu_54",p2t="_Description_1r5gu_69",m2t="_ActionRow_1r5gu_77",xT={EmptyMessage:d2t,IconBadge:f2t,Title:h2t,Description:p2t,ActionRow:m2t},Wn=({children:e,className:t,fill:n="static"})=>a.jsx("div",{className:Qi(xT.EmptyMessage,t),"data-fill":n,children:e}),g2t=({size:e="md",color:t="secondary",children:n,className:i})=>a.jsx("div",{className:Qi(xT.IconBadge,i),"data-size":e,"data-color":t,children:n}),b2t=({children:e,className:t,color:n="secondary"})=>a.jsx("div",{className:Qi(xT.Title,t),"data-color":n,children:e}),y2t=({children:e,className:t})=>a.jsx("div",{className:Qi(xT.Description,t),children:e}),v2t=({children:e,className:t})=>a.jsx("div",{className:Qi(xT.ActionRow,t),children:e});Wn.Icon=g2t;Wn.Title=b2t;Wn.Description=y2t;Wn.ActionRow=v2t;bn.hasResourceBundle("en-US","skills")||bn.addResourceBundle("en-US","skills",Vme,!0,!0);bn.hasResourceBundle("zh-CN","skills")||bn.addResourceBundle("zh-CN","skills",Xwe,!0,!0);function en(e,t={}){return bn.t(e,{...t,ns:"skills"})}const x2t="/web/skill-workbench";class u9 extends Error{constructor(t,n,i="SKILL_WORKBENCH_ERROR",r=!1,s="",o,l=""){super(t),this.status=n,this.code=i,this.retryable=r,this.statusText=s,this.originalError=o,this.rawResponse=l,this.name="SkillWorkbenchApiError"}}function Sd(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(en("api.invalidFormat",{label:t}));return e}function _ne(e,t){if(e!=null){if(typeof e!="string"||!e.trim()||e.trim().length>256)throw new Error(en("api.invalidFormat",{label:t}));return e.trim()}}function w2t(e){if(e!=null){if(e==="pending"||e==="ready"||e==="failed"||e==="unknown")return e;throw new Error(en("api.invalidFormat",{label:en("api.recoveryStatus")}))}}async function Eh(e,t={},n=ho){return fetch(Ta(`${x2t}${e}`),{...t,headers:uc(t.headers),signal:po(t.signal,n)})}async function lq(e,t){var i;const n=await e.text().catch(()=>"");try{const r=Sd(JSON.parse(n),en("api.errorResponse")),s=r.detail&&typeof r.detail=="object"?Sd(r.detail,en("api.errorDetails")):r;return new u9(typeof s.message=="string"?s.message:t,e.status,typeof s.code=="string"?s.code:"SKILL_WORKBENCH_ERROR",s.retryable===!0,e.statusText,s.originalError&&typeof s.originalError=="object"?s.originalError:void 0,n)}catch{const r=((i=e.headers.get("content-type"))==null?void 0:i.split(";",1)[0])||en("api.missingContentType");return new u9(en("api.gatewayError",{fallback:t,status:e.status,contentType:r}),e.status,"SKILL_WORKBENCH_ERROR",!1,e.statusText,void 0,n)}}async function db(e,t){if(!e.ok)throw await lq(e,t);const n=e.headers.get("content-type")??"";if(!n.includes("application/json")){const i=n.split(";",1)[0]||en("api.missingContentType");throw new Error(en("api.nonJson",{fallback:t,status:e.status,contentType:i}))}return e.json()}function O2t(e){return Array.isArray(e)?e.map(t=>{const n=Sd(t,en("api.activity")),i=n.kind,r=n.status;if(typeof n.id!="string"||!["status","thinking","message","tool"].includes(String(i))||!["running","done"].includes(String(r)))throw new Error(en("api.invalidActivity"));if(i==="tool"){if(typeof n.name!="string")throw new Error(en("api.invalidToolActivity"));return{id:n.id,kind:i,status:r,name:n.name,...n.input!==void 0?{args:n.input}:{},...n.output!==void 0?{response:n.output}:{}}}if(typeof n.text!="string")throw new Error(en("api.invalidTextActivity"));return{id:n.id,kind:i,status:r,text:n.text}}):[]}function k2t(e){if(e==null)return;const t=Sd(e,en("api.publication"));if(typeof t.revision!="number"||typeof t.skillId!="string"||typeof t.version!="string"||!Array.isArray(t.skillSpaceIds)||!t.skillSpaceIds.every(n=>typeof n=="string")||t.disposition!=="create-new"&&t.disposition!=="update-source"||!AD(t.region)||typeof t.projectName!="string")throw new Error(en("api.invalidFormat",{label:en("api.publication")}));return{revision:t.revision,skillId:t.skillId,version:t.version,skillSpaceIds:t.skillSpaceIds,disposition:t.disposition,region:t.region,projectName:t.projectName}}function _C(e){const t=Sd(e,en("api.task"));if(typeof t.jobId!="string"||t.operation!=="create"&&t.operation!=="optimize"||typeof t.intent!="string"||typeof t.revision!="number"||typeof t.state!="string")throw new Error(en("api.invalidFormat",{label:en("api.task")}));const n=Array.isArray(t.files)?t.files.flatMap(l=>{const c=Sd(l,en("api.file"));return typeof c.path=="string"&&typeof c.size=="number"?[{path:c.path,size:c.size}]:[]}):[];if(!["running","ready","failed","cancelled","expired","published"].includes(t.state))throw new Error(en("api.unknownTaskState"));const r=_ne(t.toolId,"Tool ID"),s=_ne(t.sessionId,"Session ID"),o=w2t(t.recoveryStatus);return{jobId:t.jobId,operation:t.operation,intent:t.intent,...typeof t.model=="string"?{model:t.model}:{},...typeof t.style=="string"?{style:t.style}:{},...typeof t.requestedName=="string"?{requestedName:t.requestedName}:{},revision:t.revision,...r?{toolId:r}:{},...s?{sessionId:s}:{},...typeof t.sessionTtlSeconds=="number"?{sessionTtlSeconds:t.sessionTtlSeconds}:{},...typeof t.expiresAt=="string"?{expiresAt:t.expiresAt}:{},...typeof t.recoveryAvailable=="boolean"?{recoveryAvailable:t.recoveryAvailable}:{},...o?{recoveryStatus:o}:{},...typeof t.recoveredFromSnapshot=="boolean"?{recoveredFromSnapshot:t.recoveredFromSnapshot}:{},state:t.state,stage:typeof t.stage=="string"?t.stage:"generating",activities:O2t(t.activities),files:n,...t.source&&typeof t.source=="object"?{source:t.source}:{},...typeof t.name=="string"?{name:t.name}:{},...typeof t.description=="string"?{description:t.description}:{},...typeof t.skillMd=="string"?{skillMd:t.skillMd}:{},...typeof t.error=="string"?{error:t.error}:{},...t.validation&&typeof t.validation=="object"?{validation:t.validation}:{},...t.publication?{publication:k2t(t.publication)}:{}}}async function NM(e){const t=Sd(await db(await Eh("/capabilities",{signal:e}),en("api.loadCapability")),en("api.capability"));return{enabled:t.enabled===!0,reason:typeof t.reason=="string"?t.reason:"",operations:Array.isArray(t.operations)?t.operations.filter(n=>n==="create"||n==="optimize"):[],models:Array.isArray(t.models)?t.models.flatMap(n=>{if(!n||typeof n!="object")return[];const i=n;return typeof i.id=="string"&&typeof i.label=="string"?[{id:i.id,label:i.label}]:[]}):[],styles:t.styles&&typeof t.styles=="object"&&!Array.isArray(t.styles)?Object.fromEntries(Object.entries(t.styles).filter(n=>typeof n[1]=="string")):{},...typeof t.maxUploadBytes=="number"?{maxUploadBytes:t.maxUploadBytes}:{}}}async function S2t(e){if(e.file){const n=new URLSearchParams({operation:"optimize",intent:e.intent});e.jobId&&n.set("job_id",e.jobId),e.model&&n.set("model",e.model),e.style&&n.set("style",e.style),e.name&&n.set("name",e.name);const i=await Eh(`/tasks/from-upload?${n}`,{method:"POST",body:e.file,headers:{"Content-Type":"application/zip"},signal:e.signal},hr);return _C(await db(i,en("api.startOptimization")))}const t=await Eh("/tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operation:e.operation,intent:e.intent,...e.model?{model:e.model}:{},...e.style?{style:e.style}:{},...e.name?{name:e.name}:{},...e.jobId?{jobId:e.jobId}:{},...e.source?{source:{kind:"skill-center",skillId:e.source.skillId,skillName:e.source.name,version:e.source.version,region:e.source.region,projectName:e.source.projectName,skillSpaceId:e.source.skillSpaceId,skillSpaceName:e.source.skillSpaceName}}:{}}),signal:e.signal},hr);return _C(await db(t,en("api.startTask")))}async function E2t(e,t){return _C(await db(await Eh(`/tasks/${encodeURIComponent(e)}`,{signal:t}),en("api.loadTask")))}async function M4(e,t,n){const i=new URLSearchParams;i.set("expected_revision",String(t));const r=Sd(await db(await Eh(`/tasks/${encodeURIComponent(e)}/artifact?${i.toString()}`,{signal:n}),en("api.loadArtifact")),en("api.artifact"));if(r.jobId!==e||r.revision!==t||!Number.isSafeInteger(r.revision)||r.revision<1||typeof r.sha256!="string"||!/^[0-9a-f]{64}$/.test(r.sha256)||typeof r.name!="string"||typeof r.description!="string"||!Array.isArray(r.files))throw new Error(en("api.invalidFormat",{label:en("api.artifact")}));const s=r.files.map(o=>{const l=Sd(o,en("api.artifactFile"));if(typeof l.path!="string"||typeof l.size!="number"||typeof l.content!="string")throw new Error(en("api.invalidFormat",{label:en("api.artifactFile")}));return{path:l.path,size:l.size,content:l.content}});return{jobId:r.jobId,revision:r.revision,sha256:r.sha256,name:r.name,description:r.description,files:s}}async function L4(e){const t=await Eh(`/tasks/${encodeURIComponent(e.jobId)}/refinements`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({intent:e.intent,expectedRevision:e.expectedRevision})},hr);return _C(await db(t,en("api.refine")))}async function C2t(e){const t=await Eh(`/tasks/${encodeURIComponent(e.jobId)}/stop`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expectedRevision:e.expectedRevision})});return _C(await db(t,en("api.stop")))}async function A2t(e){const t=await Eh(`/tasks/${encodeURIComponent(e.jobId)}/publish-stream`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/x-ndjson"},body:JSON.stringify({disposition:e.disposition,expectedRevision:e.expectedRevision,expectedArtifactSha256:e.expectedArtifactSha256,skillSpaceIds:e.skillSpaceIds??[],projectName:e.projectName,region:e.region}),signal:e.signal},0);if(!t.ok)throw await lq(t,en("api.publish"));if(!(t.headers.get("content-type")??"").includes("application/x-ndjson"))throw new Error(en("api.nonNdjson"));if(!t.body)throw new Error(en("api.missingStream"));const i=new Set(["preparing","uploading","registering","activating","publishing"]);let r=null,s="";const o=new TextDecoder,l=t.body.getReader(),c=u=>{var h;if(!u.trim())return;const d=Sd(JSON.parse(u),en("api.publishProgress"));if(d.type==="progress"){if(typeof d.phase!="string"||!i.has(d.phase)||typeof d.message!="string")throw new Error(en("api.invalidPublishProgress"));(h=e.onProgress)==null||h.call(e,{phase:d.phase,message:d.message});return}if(d.type==="error"){const m=Sd(d.error,en("api.publishError"));throw new u9(typeof m.message=="string"?m.message:en("api.publish"),500,typeof m.code=="string"?m.code:"SKILL_PUBLISH_FAILED",m.retryable===!0,"",m.originalError&&typeof m.originalError=="object"?m.originalError:void 0,JSON.stringify(d.error))}if(d.type!=="complete")throw new Error(en("api.unknownPublishEvent"));const f=Sd(d.result,en("api.publishResult"));if(typeof f.skillId!="string"||typeof f.version!="string"||!Array.isArray(f.skillSpaceIds)||!f.skillSpaceIds.every(m=>typeof m=="string")||f.disposition!=="create-new"&&f.disposition!=="update-source"||!AD(f.region)||typeof f.projectName!="string")throw new Error(en("api.invalidFormat",{label:en("api.publishResult")}));r={skillId:f.skillId,version:f.version,skillSpaceIds:f.skillSpaceIds,disposition:f.disposition,region:f.region,projectName:f.projectName}};for(;;){const{value:u,done:d}=await l.read();s+=o.decode(u,{stream:!d});const f=s.split(` +`);if(s=f.pop()??"",f.forEach(c),d)break}if(c(s),!r)throw new Error(en("api.streamEnded"));return r}async function T2t(e){await db(await Eh(`/tasks/${encodeURIComponent(e)}`,{method:"DELETE"}),en("api.deleteTask"))}async function _2t(e,t,n){var c;const i=new URLSearchParams;i.set("expected_revision",String(t)),i.set("expected_sha256",n);const r=await Eh(`/tasks/${encodeURIComponent(e)}/download?${i.toString()}`,{},hr);if(!r.ok)throw await lq(r,en("api.download"));const o=((c=(r.headers.get("content-disposition")??"").match(/filename="([^"]+)"/))==null?void 0:c[1])??"skill.zip",l=URL.createObjectURL(await r.blob());try{const u=document.createElement("a");u.href=l,u.download=o,u.click()}finally{URL.revokeObjectURL(l)}}const rLe=p.createContext(void 0);function tv(e){const t=p.useContext(rLe);if(t===void 0&&!e)throw new Error(Hc(47));return t}const j2t={...gje,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class N2t extends BD{constructor(n,i,r){const s=new uV;super(R2t(n,s,i,r),I2t(s),j2t);Zt(this,"setOpen",(n,i)=>{var f,h;const r=i.reason===gu,s=i.reason===Zw&&i.event.detail===0,o=!n&&(i.reason===__e||i.reason==null),l=ost(i),c=this.select("activeTriggerId");if(!n&&i.reason===T_e&&i.trigger==null&&c!=null&&(i.trigger=this.context.triggerElements.getById(c)??this.select("activeTriggerElement")??void 0),(h=(f=this.context).onOpenChange)==null||h.call(f,n,i),i.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,i);const u=()=>{const m={open:n,openChangeReason:i.reason};oje(m,n,i.trigger,l()),this.update(m)};r?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(Dit,()=>{this.set("stickIfOpen",!1)}),yi.flushSync(u)):u();let d;s?d="click":o?d="dismiss":i.reason===uC&&(d="focus"),this.set("instantType",d)})}}function R2t(e,t,n,i=!1){const r={...hje(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return r.open&&(e==null?void 0:e.mounted)===void 0&&(r.mounted=!0),r.floatingRootContext=pje(t,n,i),r}function I2t(e){return{popupRef:p.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:p.createRef(),beforeContentFocusGuardRef:p.createRef(),stickIfOpenTimeout:new $u,triggerElements:e}}function jne({props:e}){const{children:t,open:n,defaultOpen:i=!1,onOpenChange:r,onOpenChangeComplete:s,modal:o=!1,handle:l,triggerId:c,defaultTriggerId:u=null}=e,d=D2t(l,{modal:o,open:i,openProp:n,activeTriggerId:u,triggerIdProp:c});d.useControlledProp("openProp",n),d.useControlledProp("triggerIdProp",c);const f=d.useState("open"),h=d.useState("mounted"),m=d.useState("payload");d.useContextCallback("onOpenChange",r),d.useContextCallback("onOpenChangeComplete",s),fje(d,f),cje(d);const{forceUnmount:g}=uje(f,d,()=>{d.update({stickIfOpen:!0,openChangeReason:null})});d.useSyncedValues({modal:o}),p.useEffect(()=>{f||d.context.stickIfOpenTimeout.clear()},[d,f]),p.useImperativeHandle(e.actionsRef,()=>({unmount:g,close:()=>d.setOpen(!1,fa(j_e))}),[g,d]);const b=f||h;return a.jsxs(rLe.Provider,{value:d,children:[l&&a.jsx(aje,{handle:l,store:d}),b&&a.jsx(M2t,{store:d,modal:o}),typeof t=="function"?t({payload:m}):t]})}function P2t(e){return tv(!0)?a.jsx(jne,{props:e}):a.jsx(prt,{children:a.jsx(jne,{props:e})})}function D2t(e,t){const n=sje((i,r)=>new N2t(t,i,r));return p.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function M2t({store:e,modal:t}){const n=e.useState("floatingRootContext"),i=Q_e(n,{outsidePressEvent:{mouse:t==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),r=i.reference,s=i.floating;return dje(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:s}),null}const L2t=300;function tm(e){return HA(e,"base-ui")}function $2t(e,t){const n=p.useRef(null);function i(s){yi.flushSync(()=>{e.setOpen(!1,fa(uC,s.nativeEvent,s.currentTarget))});const o=dit(n.current);o==null||o.focus()}function r(s){var l;const o=e.select("positionerElement");if(o&&sw(s,o))(l=e.context.beforeContentFocusGuardRef.current)==null||l.focus();else{yi.flushSync(()=>{e.setOpen(!1,fa(uC,s.nativeEvent,s.currentTarget))});let c=uit(e.context.triggerFocusTargetRef.current||t.current);for(;c!==null&&ii(o,c);){const u=c;if(c=eV(c),c===u)break}c==null||c.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:i,handleFocusTargetFocus:r}}function F2t(e){const t=p.useRef(""),n=p.useCallback(r=>{r.defaultPrevented||(t.current=r.pointerType,e(r,r.pointerType))},[e]);return{onClick:p.useCallback(r=>{if(r.detail===0){e(r,"keyboard");return}"pointerType"in r?e(r,r.pointerType):e(r,t.current),t.current=""},[e]),onPointerDown:n}}function sLe(e,t){const n=ci((s,o)=>{(typeof e=="function"?e():e)||t(o||(HD?"touch":""))}),{onClick:i,onPointerDown:r}=F2t(n);return p.useMemo(()=>({onClick:i,onPointerDown:r}),[i,r])}const B2t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,disabled:o=!1,nativeButton:l=!0,handle:c,payload:u,openOnHover:d=!1,delay:f=L2t,closeDelay:h=0,id:m,...g}=t,b=tv(!0),y=bje(c)??b;if(!y)throw new Error(Hc(74));const w=tm(m),x=y.useState("isTriggerActive",w),O=y.useState("floatingRootContext"),k=y.useState("isOpenedByTrigger",w),S=y.useState("triggerPopupId",w),C=p.useRef(null),{registerTrigger:E,isMountedByThisTrigger:j}=lje(w,C,y,{payload:u,disabled:o,openOnHover:d,closeDelay:h}),T=y.useState("openChangeReason"),R=y.useState("stickIfOpen"),A=y.useState("openMethod"),N=y.useState("focusManagerModal"),D=pst(O,{enabled:!o&&d&&(A!=="touch"||T!==Zw),mouseOnly:!0,move:!1,handleClose:bst(),restMs:f,delay:{close:h},triggerElementRef:C,isActiveTrigger:x,isClosing:()=>y.select("transitionStatus")==="ending"}),I=U_e(O,{stickIfOpen:R}),P=sLe(()=>y.select("open"),ne=>{y.set("openMethod",ne)}),_=y.useState("triggerProps",j),{getButtonProps:L,buttonRef:F}=GD({disabled:o,native:l}),M={open(ne){return ne&&T===Zw?Nst.open(ne):wje.open(ne)}},{preFocusGuardRef:V,handlePreFocusGuardFocus:q,handleFocusTargetFocus:U}=$2t(y,C),z=Ra("button",t,{state:{disabled:o,open:k},ref:[F,n,E,C],props:[I.reference,D,_,P,{[aV]:"",id:w,"aria-haspopup":"dialog","aria-expanded":k,"aria-controls":S},g,L],stateAttributesMapping:M}),ee=a.jsx(p.Fragment,{children:z},w);return j&&!N?a.jsxs(p.Fragment,{children:[a.jsx(h0,{ref:V,onFocus:q}),ee,a.jsx(h0,{ref:y.context.triggerFocusTargetRef,onFocus:U})]}):ee}),aLe=p.createContext(void 0);function U2t(){const e=p.useContext(aLe);if(e===void 0)throw new Error(Hc(45));return e}const Q2t=p.forwardRef(function(t,n){const{keepMounted:i=!1,...r}=t;return tv().useState("mounted")||i?a.jsx(aLe.Provider,{value:i,children:a.jsx(P_e,{ref:n,...r})}):null}),oLe=p.createContext(void 0);function z2t(){const e=p.useContext(oLe);if(!e)throw new Error(Hc(46));return e}const lLe=p.forwardRef(function(t,n){const{cutout:i,...r}=t;let s;if(i){const o=i.getBoundingClientRect();s=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${o.left}px ${o.top}px,${o.left}px ${o.bottom}px,${o.right}px ${o.bottom}px,${o.right}px ${o.top}px,${o.left}px ${o.top}px)`}return a.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...r,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});let Nne={},Rne={},Ine="";function RM(e,t){return QA(e)?e:t}function Pne(e,t,n){return/hidden|clip/.test(e.getComputedStyle(RM(t,n)).overflowY)}function V2t(e){if(typeof document>"u")return!1;const t=kr(e);return ta(t).innerWidth-t.documentElement.clientWidth>0}function H2t(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=kr(e),i=n.documentElement,r=n.body,s=RM(i,r),o=s.style.overflowY,l=i.style.scrollbarGutter;i.style.scrollbarGutter="stable",s.style.overflowY="scroll";const c=s.offsetWidth;s.style.overflowY="hidden";const u=s.offsetWidth;return s.style.overflowY=o,i.style.scrollbarGutter=l,c===u}function q2t(e){const t=kr(e),n=t.documentElement,i=t.body,r=RM(n,i),s={overflowY:r.style.overflowY,overflowX:r.style.overflowX};return Object.assign(r.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(r.style,s)}}function W2t(e){var m;const t=kr(e),n=t.documentElement,i=t.body,r=ta(n);let s=0,o=0,l=!1;const c=jc.create();if(V1&&(((m=r.visualViewport)==null?void 0:m.scale)??1)!==1)return()=>{};function u(){const g=r.getComputedStyle(n),b=r.getComputedStyle(i),w=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,o=n.scrollLeft,Nne={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Ine=n.style.scrollBehavior,Rne={position:i.style.position,height:i.style.height,width:i.style.width,boxSizing:i.style.boxSizing,overflowY:i.style.overflowY,overflowX:i.style.overflowX,scrollBehavior:i.style.scrollBehavior};const x=n.scrollHeight>n.clientHeight,O=n.scrollWidth>n.clientWidth,k=g.overflowY==="scroll"||b.overflowY==="scroll",S=g.overflowX==="scroll"||b.overflowX==="scroll",C=Math.max(0,r.innerWidth-i.clientWidth),E=Math.max(0,r.innerHeight-i.clientHeight),j=parseFloat(b.marginTop)+parseFloat(b.marginBottom),T=parseFloat(b.marginLeft)+parseFloat(b.marginRight),R=RM(n,i);if(l=H2t(e),l){n.style.scrollbarGutter=w,R.style.overflowY="hidden",R.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:w,overflowY:"hidden",overflowX:"hidden"}),(x||k)&&(n.style.overflowY="scroll"),(O||S)&&(n.style.overflowX="scroll"),Object.assign(i.style,{position:"relative",height:j||E?`calc(100dvh - ${j+E}px)`:"100dvh",width:T||C?`calc(100vw - ${T+C}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),i.scrollTop=s,i.scrollLeft=o,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function d(){Object.assign(n.style,Nne),Object.assign(i.style,Rne),l||(n.scrollTop=s,n.scrollLeft=o,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=Ine)}function f(){d(),c.request(u)}u();const h=Ri(r,"resize",f);return()=>{c.cancel(),d(),typeof r.removeEventListener=="function"&&h()}}class K2t{constructor(){Zt(this,"lockCount",0);Zt(this,"restore",null);Zt(this,"timeoutLock",$u.create());Zt(this,"timeoutUnlock",$u.create());Zt(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});Zt(this,"unlock",()=>{var t;this.lockCount===0&&this.restore&&((t=this.restore)==null||t.call(this),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const n=kr(t),i=n.documentElement,r=n.body,s=ta(i);if(Pne(s,i,r)){const l=new s.MutationObserver(()=>{Pne(s,i,r)||(l.disconnect(),this.restore=null,this.lock(t))}),c={attributes:!0};l.observe(i,c),l.observe(r,c),this.restore=()=>l.disconnect();return}const o=HD||!V2t(t);this.restore=o?q2t(t):W2t(t)}}const G2t=new K2t;function cLe(e=!0,t=null){Jn(()=>{if(e)return G2t.acquire(t)},[e,t])}const X2t=20;function Y2t(e,t,n,i){const[r,s]=p.useState(!1);Jn(()=>{if(!e||!t||n==null){s(!1);return}const o=kr(n).documentElement.clientWidth,l=n.offsetWidth;s(o>0&&l>0&&l>=o-X2t)},[e,t,n]),cLe(e&&(!t||r),i)}const Z2t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,anchor:o,positionMethod:l,side:c,align:u,sideOffset:d,alignOffset:f,collisionBoundary:h="clipping-ancestors",collisionPadding:m,arrowPadding:g,sticky:b,disableAnchorTracking:v=!1,collisionAvoidance:y=Uit,...w}=t,x=tv(),O=U2t(),k=frt(),S=x.useState("floatingRootContext"),C=x.useState("mounted"),E=x.useState("open"),j=x.useState("openChangeReason"),T=x.useState("activeTriggerElement"),R=x.useState("modal"),A=x.useState("openMethod"),N=x.useState("positionerElement"),D=x.useState("instantType"),I=x.useState("transitionStatus"),P=x.useState("adaptiveOrigin"),_=p.useRef(null),L=sV(N),F=Sst({anchor:o,floatingRootContext:S,positionMethod:l,mounted:C,side:c,sideOffset:d,align:u,alignOffset:f,arrowPadding:g,collisionBoundary:h,collisionPadding:m,sticky:b,disableAnchorTracking:v,keepMounted:O,nodeId:k,collisionAvoidance:y,adaptiveOrigin:P}),M=S.useState("domReferenceElement");Jn(()=>{const z=M,ee=_.current;if(z&&(_.current=z),ee&&z&&z!==ee){x.set("instantType",void 0);const ne=new AbortController;return L(()=>{x.set("instantType","trigger-change")},ne.signal),()=>{ne.abort()}}},[M,L,x]);const V=R===!0&&j!==gu;Y2t(E&&V,A==="touch",N,T);const q=x.useStateSetter("positionerElement"),U={open:E,side:F.side,align:F.align,anchorHidden:F.anchorHidden,instant:D},Z=Rst(t,U,{styles:F.positionerStyles,transitionStatus:I,props:w,refs:[n,q],hidden:!C,inert:!E});return a.jsxs(oLe.Provider,{value:F,children:[C&&V&&a.jsx(lLe,{inert:rV(!E),cutout:T}),a.jsx(hrt,{id:k,children:Z})]})}),J2t="ArrowUp",e_t="ArrowDown",t_t="ArrowLeft",n_t="ArrowRight",i_t="Home",r_t="End",uLe=new Set([J2t,e_t,t_t,n_t,i_t,r_t]),s_t=p.createContext(void 0);function a_t(e){return p.useContext(s_t)}const o_t=p.createContext(void 0);function l_t(){const[e,t]=p.useState(0),n=ci(()=>(t(r=>r+1),()=>{t(r=>Math.max(0,r-1))}));return{context:p.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}const c_t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,initialFocus:o,finalFocus:l,...c}=t,u=tv(),d=z2t(),f=a_t()!=null,{context:h,hasClosePart:m}=l_t(),g=u.useState("open"),b=u.useState("openMethod"),v=u.useState("instantType"),y=u.useState("transitionStatus"),w=u.useState("popupProps"),x=u.useState("titleElementId"),O=u.useState("descriptionElementId"),k=u.useState("modal"),S=u.useState("mounted"),C=u.useState("openChangeReason"),E=u.useState("activeTriggerElement"),j=u.useState("floatingRootContext"),T=j.useState("floatingId"),R=u.useState("disabled"),A=u.useState("openOnHover"),N=u.useState("closeDelay");VA({open:g,ref:u.context.popupRef,onComplete(){var F,M;g&&((M=(F=u.context).onOpenChangeComplete)==null||M.call(F,!0))}}),fst(j,{enabled:A&&!R,closeDelay:N});const D=o===void 0?rje(u.context.popupRef):o,I=k!==!1&&m;u.useSyncedValue("focusManagerModal",I);const P=u.useStateSetter("popupElement"),_={open:g,side:d.side,align:d.align,instant:v,transitionStatus:y},L=Ra("div",t,{state:_,ref:[n,u.context.popupRef,P],props:[w,{id:T,role:"dialog",...ije,"aria-labelledby":x,"aria-describedby":O,onKeyDown(F){f&&uLe.has(F.key)&&F.stopPropagation()}},kje(y),c],stateAttributesMapping:Oje});return a.jsx(B_e,{context:j,openInteractionType:b,modal:I,disabled:!S||C===gu,initialFocus:D,returnFocus:l,restoreFocus:"popup",previousFocusableElement:Js(E)?E:void 0,nextFocusableElement:u.context.triggerFocusTargetRef,beforeContentFocusGuardRef:u.context.beforeContentFocusGuardRef,children:a.jsx(o_t.Provider,{value:h,children:L})})}),u_t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...o}=t,l=tv(),c=tm(o.id);return l.useSyncedValueWithCleanup("titleElementId",c),Ra("h2",t,{ref:n,props:[{id:c},o]})}),d_t=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...o}=t,l=tv(),c=tm(o.id);return l.useSyncedValueWithCleanup("descriptionElementId",c),Ra("p",t,{ref:n,props:[{id:c},o]})});function Dne(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"10.25",cy:"10.25",r:"6.25"}),a.jsx("path",{d:"M4.15 10.25h12.2M10.25 4c1.65 1.72 2.5 3.8 2.5 6.25s-.85 4.53-2.5 6.25M10.25 4c-1.65 1.72-2.5 3.8-2.5 6.25s.85 4.53 2.5 6.25M14.8 14.8 20 20"})]})}function f_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.25",y:"5.25",width:"15.5",height:"13.5",rx:"2.25"}),a.jsx("circle",{cx:"8.1",cy:"9.3",r:"1.35"}),a.jsx("path",{d:"m4.7 16.5 3.65-3.7 2.45 2.25 2.2-2.2 4.35 4.1"}),a.jsx("path",{d:"m19.4 2.75.48 1.37 1.37.48-1.37.48-.48 1.37-.48-1.37-1.37-.48 1.37-.48.48-1.37Z",fill:"currentColor",stroke:"none"})]})}function cq(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{className:"video-generate-icon__body",d:"M3.25 9h17.5v7.35a2.4 2.4 0 0 1-2.4 2.4H5.65a2.4 2.4 0 0 1-2.4-2.4V9Z"}),a.jsxs("g",{className:"video-generate-icon__clapper",children:[a.jsx("path",{d:"M3.25 9V7.65a2.4 2.4 0 0 1 2.4-2.4h12.7a2.4 2.4 0 0 1 2.4 2.4V9H3.25Z"}),a.jsx("path",{d:"M6.75 5.25 9.3 9M12 5.25 14.55 9M17.25 5.25 19.8 9"})]}),a.jsx("path",{d:"m10.25 11.45 4 2.55-4 2.55v-5.1Z"})]})}function h_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M4.25 5.25h15.5v10.5H4.25zM8.25 19.75h7.5M12 15.75v4"}),a.jsx("path",{d:"m7.25 12.75 2.35-2.4 2.15 1.65 3.4-3.6 1.6 1.55"}),a.jsx("circle",{cx:"7.25",cy:"8.4",r:".7",fill:"currentColor",stroke:"none"})]})}function p_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5 7.4c0-1.55 3.13-2.8 7-2.8s7 1.25 7 2.8-3.13 2.8-7 2.8-7-1.25-7-2.8Z"}),a.jsx("path",{d:"M5 7.4v4.55c0 1.55 3.13 2.8 7 2.8s7-1.25 7-2.8V7.4M5 11.95v4.55c0 1.55 3.13 2.8 7 2.8s7-1.25 7-2.8v-4.55"}),a.jsx("path",{d:"M8.2 12.25h.01M8.2 16.8h.01"})]})}function m_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M4.25 4.25h4.5v15.5h-4.5zM8.75 5.75h5v14h-5zM13.75 4.25h4.1v10.25h-4.1z"}),a.jsx("path",{d:"M5.75 7h1.5M10.25 8.25h2M10.25 11h2M15.15 7h1.3"}),a.jsx("circle",{cx:"17.45",cy:"17.35",r:"2.45"}),a.jsx("path",{d:"m19.25 19.15 1.55 1.55"})]})}function g_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M4.25 6.25h6.25c1 0 1.5.55 1.5 1.45v11.05c0-.9-.5-1.45-1.5-1.45H4.25V6.25Z"}),a.jsx("path",{d:"M19.75 9.1v8.2H13.5c-1 0-1.5.55-1.5 1.45V7.7c0-.9.5-1.45 1.5-1.45h2.15"}),a.jsx("path",{d:"m19 3.2.58 1.62 1.62.58-1.62.58L19 7.6l-.58-1.62-1.62-.58 1.62-.58L19 3.2Z",fill:"currentColor",stroke:"none"})]})}function b_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"m4.2 8.4 1.15 10.2h13.3L19.8 8.4"}),a.jsx("path",{d:"M4.2 8.4h15.6L17.9 5H6.1L4.2 8.4Z"}),a.jsx("path",{d:"M7.2 12.2c1.1-1 2.25 1.25 3.4.25 1.05-.9 2.15 1.3 3.3.25"}),a.jsx("path",{d:"m8.2 15.1 1.45 1.35 1.45-1.35M13.55 16.45h2.35"})]})}function y_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"6",cy:"6.25",r:"2.25"}),a.jsx("circle",{cx:"18",cy:"6.25",r:"2.25"}),a.jsx("circle",{cx:"12",cy:"17.75",r:"2.25"}),a.jsx("path",{d:"m7.7 7.75 2.7 7.55M16.3 7.75l-2.7 7.55M8.25 6.25h7.5"})]})}function Mne(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"9",cy:"8",r:"3"}),a.jsx("path",{d:"M3.75 18.75c.45-3.05 2.2-4.65 5.25-4.65s4.8 1.6 5.25 4.65"}),a.jsx("path",{d:"M17.75 4.25v5.5M15 7h5.5M16 13.25h4.25M18.125 11.125v4.25"})]})}function v_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"4",y:"4.25",width:"16",height:"5",rx:"1.5"}),a.jsx("rect",{x:"4",y:"14.75",width:"16",height:"5",rx:"1.5"}),a.jsx("path",{d:"M7.25 6.75h.01M7.25 17.25h.01M10 6.75h6.5M10 17.25h6.5"})]})}function x_t(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3.75h8l4 4v12.5H6V3.75Z"}),a.jsx("path",{d:"M14 3.75v4h4M8.75 11h6.5M8.75 14.25h6.5M8.75 17.5h4"})]})}function Lne(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.75",y:"4.5",width:"16.5",height:"15",rx:"2.5"}),a.jsx("path",{d:"m7.5 9 2.75 2.5L7.5 14M12.5 14h4"}),a.jsx("path",{d:"M3.75 7.5h16.5",opacity:".62"})]})}function oO(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m6 3.25 4.5 4.75L6 12.75"})})}function w_t({value:e}){const{t,i18n:n}=Te("adk"),[i,r]=p.useState(!1),s=f=>f==null?t("developmentRuns.notReported"):f.toLocaleString(n.resolvedLanguage||n.language),o=V2e,l=e.usage,c=(l==null?void 0:l.inputTokens)!=null&&l.cachedInputTokens!=null&&l.cachedInputTokens<=l.inputTokens?l.inputTokens-l.cachedInputTokens:void 0,u=l!=null&&l.inputTokens&&l.cachedInputTokens!=null&&c!=null?`${(l.cachedInputTokens/l.inputTokens*100).toFixed(1)}%`:void 0,d=[["inputTokens",l==null?void 0:l.inputTokens],["cachedInputTokens",l==null?void 0:l.cachedInputTokens],["uncachedInputTokens",c],["cacheWriteInputTokens",l==null?void 0:l.cacheWriteInputTokens],["outputTokens",l==null?void 0:l.outputTokens],["reasoningOutputTokens",l==null?void 0:l.reasoningOutputTokens]];return a.jsxs("div",{className:"development-turn-summary","data-turn-id":e.turnId,children:[a.jsx("span",{children:t(`developmentRuns.turnStatus.${e.status}`)}),a.jsx("span",{children:t("developmentRuns.toolCalls",{count:e.toolCalls})}),a.jsx("span",{children:t("developmentRuns.turnDuration",{duration:o(e.durationMs)})}),a.jsx("span",{title:t("developmentRuns.toolDurationHelp"),children:t(e.toolDurationComplete?"developmentRuns.toolDuration":"developmentRuns.toolDurationPartial",{duration:o(e.toolDurationMs)})}),a.jsxs(P2t,{open:i,onOpenChange:r,children:[a.jsxs(B2t,{className:"development-token-trigger",openOnHover:!0,delay:150,closeDelay:150,onFocus:f=>{f.currentTarget.matches(":focus-visible")&&r(!0)},children:[a.jsx("span",{children:"Tokens"}),a.jsx("span",{className:"development-token-value",children:s(l==null?void 0:l.totalTokens)}),e.usageIncomplete&&a.jsxs("span",{children:["· ",t("developmentRuns.partial")]}),a.jsx(oO,{className:"development-token-chevron"})]}),a.jsx(Q2t,{children:a.jsx(Z2t,{side:"top",align:"end",sideOffset:8,className:"development-token-positioner",children:a.jsxs(c_t,{className:"development-token-popup",initialFocus:!1,finalFocus:!1,children:[a.jsx(u_t,{className:"development-token-title",children:t("developmentRuns.tokenDetails")}),a.jsxs("dl",{children:[a.jsxs("div",{children:[a.jsx("dt",{children:t("developmentRuns.model")}),a.jsx("dd",{children:e.model||t("developmentRuns.notReported")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:t("developmentRuns.totalTokens")}),a.jsx("dd",{children:s(l==null?void 0:l.totalTokens)})]}),d.map(([f,h])=>a.jsxs("div",{children:[a.jsx("dt",{children:t(`developmentRuns.${f}`)}),a.jsx("dd",{children:s(h)})]},f)),a.jsxs("div",{children:[a.jsx("dt",{children:t("developmentRuns.cacheHitRate")}),a.jsx("dd",{children:u||t("developmentRuns.notReported")})]})]}),a.jsxs(d_t,{className:"development-token-note",children:[t("developmentRuns.tokenHelp"),e.usageIncomplete?` ${t("developmentRuns.partialHelp")}`:""]})]})})})]})]})}function uq(e){return a.jsx("svg",{viewBox:"0 0 111 117",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M0 5.6016C7.82288e-05 0.621244 6.02226 -1.87314 9.54395 1.64847L40.1289 32.2334L68.5732 3.7891C69.5834 2.77903 70.9533 2.21099 72.3818 2.21097H82.7031C82.7917 2.20658 82.8806 2.20414 82.9697 2.20414H104.775C109.574 2.20427 111.977 8.00691 108.584 11.4004L64.916 55.0664C64.3075 55.8528 63.9436 56.7647 63.8242 57.6993C63.7142 56.4884 63.1964 55.3069 62.2695 54.3799L45.4082 37.5186H45.4072L40.124 32.2354L17.832 54.5284C16.7671 55.5933 16.2416 56.993 16.2549 58.3887C16.2417 59.7843 16.7672 61.1842 17.832 62.2491L39.9287 84.3467L9.54395 114.733C6.0223 118.255 0.000223474 115.761 0 110.78V5.6016ZM63.8018 58.8702C63.8962 59.9086 64.2936 60.9229 64.9961 61.7735L108.591 105.368C111.984 108.762 109.58 114.564 104.781 114.564H94.4336C94.3543 114.568 94.274 114.569 94.1934 114.569H72.3877C70.9592 114.569 69.5892 114.002 68.5791 112.992L39.9336 84.3467L58.4531 65.8282L58.4453 65.8203L62.2695 61.9981C63.1476 61.12 63.6567 60.0136 63.8018 58.8702Z",fill:"currentColor"})})}function IM({kind:e,...t}){return e==="thinking"?a.jsx(uq,{...t}):a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:e==="tool"?a.jsxs(a.Fragment,{children:[a.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"3"}),a.jsx("path",{d:"m7 9 3 3-3 3m6 0h4"})]}):e==="plan"?a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"m4 7 1.5 1.5L8 6m-4 7 1.5 1.5L8 12M11 7h9m-9 6h9m-9 6h9"}),a.jsx("circle",{cx:"6",cy:"19",r:"1"})]}):a.jsx(a.Fragment,{children:a.jsx("path",{d:"M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9zM14 3v6h6M8 13h8m-4-3v6M8 18h8"})})})}function O_t({blocks:e,active:t,status:n,render:i}){const{t:r}=Te("adk"),[s,o]=p.useState(!1),l=[...e].reverse().find(h=>"done"in h&&!h.done),c=e.filter(h=>h.kind==="tool"),u=c.filter(h=>h.durationMs!=null),d=u.reduce((h,m)=>h+(m.durationMs||0),0);let f=r("developmentRuns.processSummary",{count:e.length});return t&&(f=n||((l==null?void 0:l.kind)==="thinking"?r("developmentRuns.thinking"):(l==null?void 0:l.kind)==="tool"?H2e(l):(l==null?void 0:l.kind)==="plan"?r("developmentRuns.plan"):(l==null?void 0:l.kind)==="diff"?r("developmentRuns.diff"):r("developmentRuns.processing"))),a.jsxs("section",{className:"development-process",children:[a.jsxs("button",{type:"button",className:"development-process__toggle","aria-expanded":s,onClick:()=>o(!s),children:[a.jsx(oO,{className:`tool-chevron${s?" is-open":""}`}),a.jsx("span",{className:"tool-icon",children:a.jsx(IM,{kind:(l==null?void 0:l.kind)==="thinking"||(l==null?void 0:l.kind)==="plan"||(l==null?void 0:l.kind)==="diff"?l.kind:"tool"})}),t?a.jsx(cn,{className:"development-process__title","aria-live":"polite",children:f}):a.jsx("span",{className:"development-process__title",children:f}),!t&&c.length>0&&a.jsxs("span",{className:"development-process__duration",children:[r("developmentRuns.toolCalls",{count:c.length}),u.length>0?` · ${r(u.length===c.length?"developmentRuns.toolDuration":"developmentRuns.toolDurationPartial",{duration:V2e(d)})}`:""]})]}),a.jsx("div",{className:"development-process__items",hidden:!s,children:i(e)})]})}function k_t({blocks:e,active:t,status:n="",render:i}){const{t:r}=Te("adk"),s=rnt(e),o=s[s.length-1],l=[...e].reverse().find(u=>u.kind==="progress"),c=n||((l==null?void 0:l.kind)==="progress"?l.text:"");return a.jsxs(a.Fragment,{children:[s.map(u=>u.process?a.jsx(O_t,{blocks:u.blocks,active:t&&u===o,status:c,render:i},u.id):a.jsx("div",{"data-assistant-phase":u.blocks[0].phase,children:i(u.blocks)},u.id)),t&&!(o!=null&&o.process)&&a.jsxs("div",{className:"development-process__status",role:"status",children:[a.jsx("span",{className:"tool-icon",children:a.jsx(IM,{kind:"thinking"})}),a.jsx(cn,{children:c||r("developmentRuns.processing")})]})]})}const S_t={formatDate(e){const t=e.value??e.date??e.timestamp;if(t==null)return"";const n=new Date(t);return isNaN(n.getTime())?String(t):n.toLocaleString()}};function E_t(e,t){if(!t||t==="/")return e;const n=t.replace(/^\//,"").split("/").map(r=>r.replace(/~1/g,"/").replace(/~0/g,"~"));let i=e;for(const r of n){if(i==null||typeof i!="object")return;i=i[r]}return i}function C_t(e){return typeof e=="object"&&e!==null&&typeof e.path=="string"}function A_t(e){return typeof e=="object"&&e!==null&&typeof e.call=="string"}function dq(e,t){if(C_t(e))return E_t(t,e.path);if(A_t(e)){const n=S_t[e.call],i={};for(const[r,s]of Object.entries(e.args??{}))i[r]=dq(s,t);return n?n(i):`[unknown fn: ${e.call}]`}return e}function T_t(e,t){const n=dq(e,t);return n==null?"":typeof n=="string"?n:String(n)}const dLe=new Map;function nv(e,t){dLe.set(e,t)}function __t(e){return dLe.get(e)}function j_t(e,t,n){const i=t.replace(/^\//,"").split("/").map(s=>s.replace(/~1/g,"/").replace(/~0/g,"~"));let r=e;for(let s=0;sdq(i,e.dataModel),resolveString:i=>T_t(i,e.dataModel),dispatchAction:t,render:i=>{if(!i)return null;const r=e.components[i];if(!r)return null;const s=__t(r.component)??N_t;return a.jsx(s,{node:r,ctx:n},i)}};return a.jsx("div",{className:"a2ui-surface","data-a2ui-surface":e.surfaceId,children:n.render(e.rootId)})}function hLe(e){const t=p.useRef(null),n=p.useRef(!0),i=28,r=p.useCallback(()=>{const s=t.current;s&&(n.current=s.scrollHeight-s.scrollTop-s.clientHeight{const s=t.current;s&&n.current&&(s.scrollTop=s.scrollHeight)},[e]),{ref:t,onScroll:r}}function PM({value:e,skillPrefix:t="/",onRemoveSkill:n,onRemoveAgent:i}){const{t:r}=Te("conversation");return e.skills.length===0&&!e.targetAgent?null:a.jsxs("div",{className:"invocation-chips","aria-label":r("invocation.ariaLabel"),children:[e.skills.map(s=>a.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:s.description,children:[a.jsx(pC,{"aria-hidden":!0}),a.jsxs("span",{children:[t,s.name]}),n?a.jsx("button",{type:"button",onClick:()=>n(s.name),"aria-label":r("invocation.removeSkill",{name:s.name}),children:a.jsx(Do,{})}):null]},s.name)),e.targetAgent?a.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:e.targetAgent.description,children:[a.jsx(Lje,{"aria-hidden":!0}),a.jsx("span",{children:e.targetAgent.name}),i?a.jsx("button",{type:"button",onClick:i,"aria-label":r("invocation.removeAgent",{name:e.targetAgent.name}),children:a.jsx(Do,{})}):null]}):null]})}function fq(e=""){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e==="application/pdf"?"pdf":e==="text/markdown"?"markdown":"text"}function pLe(e){var n,i,r,s;const t=fq(e.mimeType);return t==="pdf"?"PDF":t==="markdown"?"MD":t==="video"?((i=(n=e.mimeType)==null?void 0:n.split("/")[1])==null?void 0:i.toUpperCase())??"VIDEO":t==="image"?((s=(r=e.mimeType)==null?void 0:r.split("/")[1])==null?void 0:s.toUpperCase())??"IMAGE":"TXT"}function mLe(e){return e?e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`:""}function gLe(e,t){return e.previewUrl?e.previewUrl:e.data?`data:${e.mimeType??"application/octet-stream"};base64,${e.data}`:e.uri?pTe(t,e.uri):""}function I_t({kind:e}){return e==="image"?a.jsx(yV,{}):e==="video"?a.jsx(Fje,{}):e==="pdf"?a.jsx(Mat,{}):a.jsx(gV,{})}function DM({appName:e,items:t,compact:n=!1,onRemove:i}){const{t:r}=Te("conversation"),[s,o]=p.useState(null);return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:`media-grid${n?" media-grid--compact":""}`,children:t.map(l=>{const c=fq(l.mimeType),u=gLe(l,e),d=l.status==="uploading"||l.status==="error"||!u,f=a.jsxs("button",{type:"button",className:"media-card-main",disabled:d,onClick:c==="image"?void 0:()=>o(l),"aria-label":r("media.preview",{name:l.name??r("media.attachment")}),children:[c==="image"&&u?a.jsx("img",{className:"media-card-image",src:u,alt:l.name??r("media.image"),loading:"lazy"}):c==="video"&&u?a.jsxs("div",{className:"media-card-video-container",children:[a.jsx("video",{className:"media-card-video",src:u,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),a.jsx("span",{className:"media-card-video-play",children:a.jsx(Qje,{})})]}):a.jsx("span",{className:"media-card-icon",children:a.jsx(I_t,{kind:c})}),a.jsxs("span",{className:"media-card-copy",children:[a.jsx("span",{className:"media-card-name",children:l.name??r("media.attachment")}),a.jsxs("span",{className:"media-card-meta",children:[a.jsx("span",{className:"media-card-type",children:pLe(l)}),l.status==="uploading"?a.jsxs(a.Fragment,{children:[a.jsx(Bi,{className:"media-card-spinner"})," ",r("media.uploading")]}):l.status==="error"?l.error??r("media.uploadFailed"):mLe(l.sizeBytes)]})]}),!n&&l.status!=="uploading"&&l.status!=="error"?a.jsx(rE,{className:"media-card-open"}):null]});return a.jsxs(Cr.div,{className:`media-card media-card--${c}${l.status==="error"?" media-card--error":""}`,layout:!0,initial:{opacity:0,scale:.985,y:4},animate:{opacity:1,scale:1,y:0},children:[c==="image"&&!d?a.jsx(LAe,{src:u,children:f}):f,i?a.jsx("button",{type:"button",className:"media-card-remove","aria-label":r("media.remove",{name:l.name??r("media.attachment")}),onClick:()=>i(l.id),children:a.jsx(Do,{})}):null]},l.id)})}),a.jsx(hf,{children:s?a.jsx(P_t,{appName:e,item:s,onClose:()=>o(null)}):null})]})}function P_t({appName:e,item:t,onClose:n}){const{t:i}=Te("conversation"),r=p.useMemo(()=>gLe(t,e),[e,t]),s=fq(t.mimeType),[o,l]=p.useState(""),[c,u]=p.useState(s==="text"||s==="markdown"),[d,f]=p.useState("");return p.useEffect(()=>{const h=m=>{m.key==="Escape"&&n()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[n]),p.useEffect(()=>{if(s!=="text"&&s!=="markdown")return;const h=new AbortController;return u(!0),f(""),fetch(r,{signal:h.signal}).then(m=>{if(!m.ok)throw new Error(`HTTP ${m.status}`);return m.text()}).then(l).catch(m=>{h.signal.aborted||f(m instanceof Error?m.message:String(m))}).finally(()=>{h.signal.aborted||u(!1)}),()=>h.abort()},[s,r]),a.jsx(Cr.div,{className:"media-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":i("media.previewDialog",{name:t.name??i("media.attachment")}),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onMouseDown:h=>{h.target===h.currentTarget&&n()},children:a.jsxs(Cr.div,{className:"media-viewer",initial:{opacity:0,y:18,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.99},transition:{type:"spring",stiffness:420,damping:30},children:[a.jsxs("header",{className:"media-viewer-header",children:[a.jsxs("div",{children:[a.jsx("strong",{children:t.name??i("media.attachment")}),a.jsxs("span",{children:[pLe(t),t.sizeBytes?` · ${mLe(t.sizeBytes)}`:""]})]}),a.jsxs("nav",{children:[a.jsx("a",{href:r,download:t.name,"aria-label":i("media.download"),children:a.jsx(tM,{})}),a.jsx("button",{type:"button",onClick:n,"aria-label":i("media.close"),children:a.jsx(Do,{})})]})]}),a.jsxs("div",{className:`media-viewer-body media-viewer-body--${s}`,children:[s==="image"?a.jsx("img",{src:r,alt:t.name??i("media.image")}):null,s==="video"?a.jsx("div",{className:"media-viewer-video-wrapper",children:a.jsx("video",{src:r,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",className:"media-viewer-video"})}):null,s==="pdf"?a.jsx("iframe",{src:r,title:t.name??"PDF"}):null,c?a.jsxs("div",{className:"media-viewer-loading",children:[a.jsx(Bi,{})," ",i("media.reading")]}):null,!c&&d?a.jsx("div",{className:"media-viewer-loading",children:i("media.loadFailed",{error:d})}):null,!c&&s==="markdown"?a.jsx("div",{className:"media-document",children:a.jsx(jd,{text:o})}):null,!c&&s==="text"?a.jsx("pre",{className:"media-document media-document--plain",children:o}):null]})]})})}function D_t({definition:e,label:t,done:n,open:i,onToggle:r}){const{t:s}=Te("conversation"),o=e.icon,l=n?e.doneLabel:e.runningLabel,c=t??s(`blocks.tools.${e.name}.${n?"done":"running"}`,{defaultValue:l});return a.jsxs("button",{type:"button",className:`builtin-tool-head${n?" is-done":" is-running"}`,"data-tool-tone":e.tone,onClick:r,"aria-expanded":i,children:[a.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:a.jsx(o,{})}),n?a.jsx("span",{className:"builtin-tool-label",children:c}):a.jsx(cn,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:c}),a.jsx(oO,{className:`builtin-tool-chevron${i?" is-open":""}`})]})}function Ru(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function qn(e){return typeof e=="string"?e:""}function $ne(e){return typeof e=="number"&&Number.isFinite(e)?e:0}function ud(e){return Array.isArray(e)?e:[]}function d9(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return{}}const n=Ru(t)??{};return Ru(n.result)??n}function MM(e){if(typeof e=="string")try{return MM(JSON.parse(e))}catch{return e}const t=Ru(e);if(!t)return"";const n=Ru(t.result);return qn(t.error)||qn(t.message)||qn(n==null?void 0:n.error)||qn(n==null?void 0:n.message)}function M_t(e){if(e.kind==="tool")return"tool";if(e.kind==="knowledge_base")return"knowledge_base";const t=Ru(e.metadata),n=qn(t==null?void 0:t.source_type).toLowerCase(),i=qn(e.source).toLowerCase();return n==="skillhub"||i.startsWith("skill_hub:")?"skill_hub":"skill_space"}const bLe={tool:"Tools",knowledge:"AgentKit Knowledge Base",skillCenter:"AgentKit Skill Center",unknownSource:"Unknown source",unnamedResource:"Unnamed resource",unnamedAgent:"Unnamed agent"};function L_t(e,t){return e==="veadk_builtin_tools"?t.tool:e==="agentkit_knowledge"?t.knowledge:e.startsWith("skill_hub:")?`Skill Hub ${e.slice(10)}`:e.startsWith("skill_space:")?`${t.skillCenter} ${e.slice(12)}`:e||t.unknownSource}function $_t(e){return e==="veadk_builtin_tools"?"tool":e==="agentkit_knowledge"?"knowledge_base":e.startsWith("skill_hub:")?"skill_hub":"skill_space"}function F_t(e,t=bLe){const n=d9(e),i=Ru(n.capabilities)??{},r=ud(n.resources).flatMap(o=>{const l=Ru(o);if(!l)return[];const c=l.kind==="tool"?"tool":l.kind==="knowledge_base"?"knowledge_base":"skill";return[{ref:qn(l.ref),kind:c,category:M_t(l),name:qn(l.name)||qn(l.ref)||t.unnamedResource,description:qn(l.description),source:qn(l.source),version:qn(l.version)}]}),s=ud(n.sources).flatMap(o=>{const l=Ru(o);if(!l)return[];const c=qn(l.source),u=qn(l.status),d=u==="error"?"error":u==="skipped"?"skipped":"ok";return[{source:c,category:$_t(c),label:L_t(c,t),status:d,count:$ne(l.count),message:qn(l.message),searchKeywords:ud(l.search_keywords).map(qn).filter(Boolean)}]});return{collectionId:qn(n.collection_id),capabilities:{googleAdkVersion:qn(i.google_adk_version),agentTypes:ud(i.agent_types).map(qn).filter(Boolean),maxOrchestrationDepth:$ne(i.max_orchestration_depth)},resources:r,sources:s,counts:{all:r.length,skill_hub:r.filter(o=>o.category==="skill_hub").length,skill_space:r.filter(o=>o.category==="skill_space").length,knowledge_base:r.filter(o=>o.category==="knowledge_base").length,tool:r.filter(o=>o.category==="tool").length}}}function B_t(e,t){return{resources:e.resources.filter(n=>n.category===t),sources:e.sources.filter(n=>n.category===t)}}function yLe(e,t,n=bLe){const i=d9(e),r=d9(t),s=new Map(ud(r.results).flatMap(d=>{const f=Ru(d),h=qn(f==null?void 0:f.name);return f&&h?[[h,f]]:[]})),o=ud(i.agents).flatMap(d=>{const f=Ru(d),h=qn(f==null?void 0:f.name);return f&&h?[f]:[]}),l=new Set(o.map(d=>qn(d.name))),c=[...s.entries()].filter(([d])=>!l.has(d)).map(([d])=>({name:d})),u=[...o,...c].map(d=>{const f=qn(d.name),h=ud(d.nodes).flatMap(C=>{const E=Ru(C);return E?[E]:[]}),m=qn(d.root_node),g=h.find(C=>qn(C.id)===m),b=h.filter(C=>qn(C.id)!==m).map(C=>({id:qn(C.id)||n.unnamedAgent,type:qn(C.type)||"llm",description:qn(C.description)})),v=s.get(f),y=qn(v==null?void 0:v.status),w=y==="failed"?"failed":y==="completed"?"completed":"running",x=Fne(v==null?void 0:v.resources),O=x.length>0?x:Fne(h.flatMap(C=>ud(C.resources))),k=Bne(v==null?void 0:v.python_tools),S=k.length>0?k:Bne(h.flatMap(C=>ud(C.python_tools)));return{name:f,description:qn(v==null?void 0:v.description)||qn(g==null?void 0:g.description)||qn(d.task),task:qn(d.task),rootType:qn(v==null?void 0:v.root_type)||qn(g==null?void 0:g.type)||"llm",nodeCount:h.length,subAgentCount:b.length,resourceCount:O.length,pythonToolCount:S.length,skills:O.filter(C=>C.kind==="skill"),knowledgeBases:O.filter(C=>C.kind==="knowledge_base"),builtinTools:O.filter(C=>C.kind==="tool"),pythonTools:S,subAgents:b,status:w,output:qn(v==null?void 0:v.output),error:qn(v==null?void 0:v.error)}});return{collectionId:qn(r.collection_id)||qn(i.collection_id),agents:u,completedCount:u.filter(d=>d.status==="completed").length,failedCount:u.filter(d=>d.status==="failed").length,runningCount:u.filter(d=>d.status==="running").length}}function U_t(e,t){return!!MM(t)||yLe(e,t).failedCount>0}function Fne(e){const t=new Set;return ud(e).flatMap(n=>{const i=Ru(n),r=qn(i?i.ref:n);if(!r||t.has(r))return[];t.add(r);const s=qn(i==null?void 0:i.kind),o=s==="tool"||r.startsWith("veadk_tool:")?"tool":s==="knowledge_base"||r.startsWith("agentkit_kb:")?"knowledge_base":"skill",l=r.split(":");return[{ref:r,kind:o,name:qn(i==null?void 0:i.name)||l[l.length-1]||r,description:qn(i==null?void 0:i.description),version:qn(i==null?void 0:i.version),source:qn(i==null?void 0:i.source)}]})}function Bne(e){const t=new Set;return ud(e).flatMap(n=>{const i=Ru(n),r=qn(i==null?void 0:i.name),s=qn(i==null?void 0:i.code),o=`${r}\0${s}`;return!i||!r||t.has(o)?[]:(t.add(o),[{name:r,description:qn(i.description),code:s,entrypoint:qn(i.entrypoint)||r,dependencies:ud(i.dependencies).map(qn).filter(Boolean)}])})}function Q_t({branch:e}){return a.jsxs("div",{className:`branch-compare__body${e.status==="running"?" is-streaming":""}`,"aria-live":"polite",children:[e.content?a.jsx(jd,{text:e.content,streaming:e.status==="running"}):null,e.status==="running"?a.jsx("span",{className:"branch-compare__caret","aria-hidden":"true"}):null,e.error?a.jsx("p",{className:"branch-compare__error",children:e.error}):null]})}function z_t({args:e,response:t,status:n,onBranchSelect:i}){const{t:r}=Te("conversation"),s=p.useMemo(()=>Hje(e,t,n),[e,t,n]),[o,l]=p.useState(0);return a.jsxs("section",{className:"branch-compare","aria-label":r("blocks.branchCompare.ariaLabel"),children:[a.jsx("div",{className:"branch-compare__tabs",role:"tablist","aria-label":r("blocks.branchCompare.selectDirection"),children:s.branches.map((c,u)=>a.jsx("button",{className:`branch-compare__tab${o===u?" is-active":""}`,type:"button",role:"tab","aria-selected":o===u,"aria-controls":`branch-compare-panel-${u}`,onClick:()=>l(u),children:a.jsx(Ya,{color:"info",size:"sm",variant:"soft",children:c.label})},`${c.label}:${u}`))}),a.jsx("div",{className:"branch-compare__branches",children:s.branches.map((c,u)=>a.jsxs("article",{className:`branch-compare__branch${o===u?" is-active":""}`,id:`branch-compare-panel-${u}`,role:"tabpanel",children:[a.jsx("header",{className:"branch-compare__head",children:a.jsx(Ya,{color:"info",size:"sm",variant:"soft",children:c.label})}),a.jsx(Q_t,{branch:c}),a.jsx("footer",{className:"branch-compare__footer",children:a.jsx(_t,{type:"button",color:"info",variant:"ghost",size:"sm",pill:!1,disabled:c.status!=="completed",onClick:()=>i==null?void 0:i(c),children:r("blocks.branchCompare.continue")})})]},`${c.label}:${u}`))})]})}function vLe({controlled:e,default:t,name:n,state:i="value"}){const{current:r}=p.useRef(e!==void 0),[s,o]=p.useState(t),l=r?e:s,c=p.useCallback(u=>{r||o(u)},[]);return[l,c]}const xLe=p.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function V_t(){return p.useContext(xLe)}function H_t(e){const{children:t,elementsRef:n,labelsRef:i,onMapChange:r}=e,s=ci(r),[,o]=p.useState(!1),l=Ad(W_t).current,c=Ad(q_t).current,u=p.useRef(0),d=p.useRef(!0),f=p.useRef([]),h=p.useRef(null),m=ci(()=>{d.current||(d.current=!0,o(k=>!k))}),g=ci((k,S)=>{c.set(k,S),m()}),b=ci(k=>{c.delete(k),m()}),v=ci(k=>{const S=new Map;return n.current.length=0,i&&(i.current.length=0),k.forEach(C=>{var E,j;S.set(C.element,{...C.registration.metadata??{},index:C.index}),n.current[C.index]=C.element,i&&(i.current[C.index]=C.registration.label!==void 0?C.registration.label:((j=(E=C.registration.textRef)==null?void 0:E.current)==null?void 0:j.textContent)??C.element.textContent)}),u.current=n.current.length,S});function y(k){var E;if((E=h.current)==null||E.disconnect(),h.current=null,typeof MutationObserver!="function"||k.length<2)return;const S=new MutationObserver(j=>{if(!X_t(j))return;let T=null;for(const R of k)if(R.isConnected){if(T&&wLe(T,R)>0){S.disconnect(),m();return}T=R}});h.current=S;const C=new Set;for(let j=1;jS.observe(j,{childList:!0}))}const w=ci(()=>{const[k,S]=K_t(c),C=v(k);y(S),f.current=k,d.current=!1,l.forEach(E=>E(C)),s(C)});Jn(()=>(d.current||v(f.current),()=>{n.current=[],i&&(i.current=[])}),[n,i,v]),Jn(()=>{d.current&&w()}),Jn(()=>()=>{var k;(k=h.current)==null||k.disconnect(),d.current=!0},[]);const x=ci(k=>(l.add(k),()=>{l.delete(k)})),O=p.useMemo(()=>({register:g,unregister:b,subscribeMapChange:x,nextIndexRef:u}),[g,b,x,u]);return a.jsx(xLe.Provider,{value:O,children:t})}function q_t(){return new Map}function W_t(){return new Set}function K_t(e){const t=new Set,n=[],i=[];e.forEach((s,o)=>{if(!o.isConnected)return;const l=s.index,c={index:l??-1,element:o,registration:s};l===null?i.push(c):l>=0&&(t.add(l),n.push(c))});let r=0;return i.sort((s,o)=>wLe(s.element,o.element)),i.forEach(s=>{for(;t.has(r);)r+=1;s.index=r,n.push(s),r+=1}),t.size>0&&n.sort((s,o)=>s.index-o.index),[n,i.map(s=>s.element)]}function G_t(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function X_t(e){for(const t of e)for(let n=0;nnull},SLe=p.forwardRef(function(t,n){const{render:i,className:r,disabled:s=!1,hiddenUntilFound:o,keepMounted:l,loopFocus:c,onValueChange:u,multiple:d=!1,orientation:f="vertical",value:h,defaultValue:m,style:g,...b}=t,v=p.useMemo(()=>{if(h===void 0)return m??[]},[h,m]),y=p.useRef([]),[w,x]=vLe({controlled:h,default:v,name:"Accordion",state:"value"}),O=ci((E,j,T)=>{if(d)if(j){const R=w.slice();if(R.push(E),u==null||u(R,T),T.isCanceled)return;x(R)}else{const R=w.filter(A=>A!==E);if(u==null||u(R,T),T.isCanceled)return;x(R)}else{const R=w[0]===E?[]:[E];if(u==null||u(R,T),T.isCanceled)return;x(R)}}),k=p.useMemo(()=>({value:w,disabled:s,orientation:f}),[w,s,f]),S=p.useMemo(()=>({disabled:s,handleValueChange:O,hiddenUntilFound:o??!1,keepMounted:l??!1,state:k,value:w}),[s,O,o,l,k,w]),C=Ra("div",t,{state:k,ref:n,props:b,stateAttributesMapping:Y_t});return a.jsx(OLe.Provider,{value:S,children:a.jsx(H_t,{elementsRef:y,children:C})})});function Z_t(e){const{open:t,defaultOpen:n,onOpenChange:i,disabled:r}=e,[s,o]=vLe({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:l,setMounted:c,transitionStatus:u}=nje(s,!0,!0),d=tm(),[f,h]=p.useState(),m=f===null?void 0:f??d,g=ci(b=>{const v=!s,y=fa(Zw,b.nativeEvent);i(v,y),!y.isCanceled&&o(v)});return p.useMemo(()=>({defaultPanelId:d,disabled:r,handleTrigger:g,mounted:l,open:s,panelId:m,setMounted:c,setOpen:o,setPanelIdState:h,transitionStatus:u}),[d,r,g,l,s,m,c,o,h,u])}const ELe=p.createContext(void 0);function CLe(){const e=p.useContext(ELe);if(e===void 0)throw new Error(Hc(15));return e}function J_t(e={}){const{guess:t,label:n,metadata:i,textRef:r,index:s}=e,{register:o,unregister:l,subscribeMapChange:c,nextIndexRef:u}=V_t(),d=p.useRef(-1),[f,h]=p.useState(s==null&&t?()=>{if(d.current===-1){const v=u.current;u.current+=1,d.current=v}return d.current}:-1),m=s??f,g=p.useRef(null),b=p.useCallback(v=>{const y=g.current;y&&l(y),g.current=v,v&&o(v,{metadata:i??null,index:s??null,label:n,textRef:r})},[s,o,l,i,n,r]);return Jn(()=>{if(s==null)return c(v=>{var w;const y=g.current?(w=v.get(g.current))==null?void 0:w.index:null;y!=null&&h(y)})},[s,c]),{ref:b,index:m}}const ALe=p.createContext(void 0);function hq(){const e=p.useContext(ALe);if(e===void 0)throw new Error(Hc(9));return e}let pq=function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=oI.startingStyle]="startingStyle",e[e.endingStyle=oI.endingStyle]="endingStyle",e}({}),ejt=function(e){return e.panelOpen="data-panel-open",e}({});const tjt={[pq.open]:""},njt={[pq.closed]:""},ijt={open(e){return e?{[ejt.panelOpen]:""}:null}},rjt={open(e){return e?tjt:njt}};let sjt=function(e){return e.index="data-index",e.disabled="data-disabled",e.open="data-open",e}({});const mq={...rjt,index:e=>({[sjt.index]:String(e)}),...KD,value:()=>null},TLe=p.forwardRef(function(t,n){const{className:i,disabled:r=!1,onOpenChange:s,render:o,value:l,style:c,...u}=t,{ref:d,index:f}=J_t(),h=Yw(n,d),{disabled:m,handleValueChange:g,state:b,value:v}=kLe(),y=tm(),w=l??y,x=r||m,O=v.indexOf(w)!==-1,k=ci((P,_)=>{s==null||s(P,_),!_.isCanceled&&g(w,P,_)}),S=Z_t({open:O,onOpenChange:k,disabled:x}),C=p.useMemo(()=>({open:S.open,disabled:S.disabled,transitionStatus:S.transitionStatus}),[S.open,S.disabled,S.transitionStatus]),E=p.useMemo(()=>({...S,onOpenChange:k,state:C}),[S,C,k]),j=p.useMemo(()=>({...b,hidden:!O&&!S.mounted,index:f,disabled:x,open:O}),[S.mounted,x,f,O,b]),T=tm(),[R,A]=p.useState(),N=R===null?void 0:R??T,D=p.useMemo(()=>({defaultTriggerId:T,open:O,state:j,setTriggerId:A,triggerId:N}),[T,O,j,A,N]),I=Ra("div",t,{state:j,ref:h,props:u,stateAttributesMapping:mq});return a.jsx(ELe.Provider,{value:E,children:a.jsx(ALe.Provider,{value:D,children:I})})}),_Le=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...o}=t,{state:l}=hq();return Ra("h3",t,{state:l,ref:n,props:o,stateAttributesMapping:mq})}),jLe=p.forwardRef(function(t,n){const{disabled:i,className:r,id:s,render:o,nativeButton:l=!0,style:c,...u}=t,{panelId:d,open:f,handleTrigger:h,disabled:m}=CLe(),g=i||m,{getButtonProps:b,buttonRef:v}=GD({disabled:g,focusableWhenDisabled:!0,native:l}),{defaultTriggerId:y,state:w,setTriggerId:x}=hq(),O=s||void 0,k=O??y;return Jn(()=>(x(E=>O??(E===null?void 0:E)),()=>{x(E=>E===O?null:E)}),[O,x]),Ra("button",t,{state:w,ref:[n,v],props:[{"aria-controls":f?d:void 0,"aria-expanded":f,id:k,onClick:h},u,b],stateAttributesMapping:ijt})}),wk={height:void 0,width:void 0};function ajt(e){const{externalRef:t,hiddenUntilFound:n,id:i,keepMounted:r,mounted:s,onOpenChange:o,open:l,setMounted:c,setOpen:u,transitionStatus:d}=e,f=p.useRef(null),h=p.useRef(null),[m,g]=p.useState(wk),b=p.useRef(wk),v=p.useRef(!1),y=p.useRef(l),w=p.useRef(!1),[x,O]=p.useState(!1),k=p.useRef(null),S=Yw(t,f),C=Zl(l),E=sV(f),j=!l&&!s,T=x?"idle":d,R=l&&(y.current||w.current),A=!l&&s&&h.current==="css-animation"&&m.height===void 0&&m.width===void 0?b.current:m,N=n&&j&&h.current!=="css-animation",D=ci((F,M=!0)=>{M&&(b.current=F),g(F)}),I=ci(()=>{var F;(F=k.current)==null||F.call(k),k.current=null}),P=ci(F=>{I(),k.current=()=>{k.current=null,F()}}),_=ci(()=>{l&&s&&h.current==="css-animation"&&(w.current=!0)});Jn(()=>{!x||d==="starting"||O(!1)},[x,d]),p.useEffect(()=>()=>{_(),I()},[_,I]),Jn(()=>{const F=f.current;if(!F)return;!l&&k.current&&I();const M=ojt(F,R);if(h.current=M,l&&d==="idle"&&y.current&&M==="css-animation"){b.current=Uv(F);return}if(l&&d==="starting"){const U=v.current;if(v.current=!1,M==="none"){D(Uv(F)),O(!0);return}if(M==="css-transition"){const ee=ljt(F);if(D(Uv(F)),!U)return ee;const ne=R_(F,"transition-duration","0s");return P(ne),O(!0),ee}D(Uv(F));const Z=R_(F,"animation-name","none");if(!U){Z();return}const z=R_(F,"animation-duration","0s");Z(),P(z),O(!0);return}if(!l&&s&&(d==="idle"||d==="starting")){if(y.current=!1,w.current=!1,M==="none"){D(wk,!1),c(!1);return}D(Uv(F));return}if(d!=="ending")return;if(M==="none"){c(!1);return}const V=Uv(F);if(!(V.height>0||V.width>0)){c(!1);return}D(V),M==="css-animation"&&R_(F,"animation-name","none")()},[s,l,I,D,c,P,R,d]),VA({enabled:l&&s&&T==="idle",open:!0,ref:f,onComplete(){l&&D(wk,!1)}}),p.useEffect(()=>{if(l||!s||T!=="ending"||!f.current)return;const M=new AbortController;let V=-1;function q(){C.current||(c(!1),D(wk,!1))}return V=jc.request(()=>{E(q,M.signal)}),()=>{jc.cancel(V),M.abort()}},[C,s,l,T,E,D,c]),Jn(()=>{const F=f.current;!F||!n||!j||F.setAttribute("hidden","until-found")},[j,n]),p.useEffect(function(){const M=f.current;if(!M)return;function V(q){const U=fa(C_e,q);o(!0,U),!U.isCanceled&&(v.current=!0,u(!0))}return Ri(M,"beforematch",V)},[o,u]);const L=r||n||s||l;return{height:A.height,props:{...N?{[pq.startingStyle]:""}:void 0,hidden:j,id:i},ref:S,shouldPreventOpenAnimation:R,shouldRender:L,transitionStatus:T,width:A.width}}function Uv(e){return{height:e.scrollHeight,width:e.scrollWidth}}function ojt(e,t){const n=ta(e).getComputedStyle(e),i=(n.animationName.split(",").map(s=>s.trim()).some(s=>s!==""&&s!=="none")||t)&&Une(n.animationDuration),r=Une(n.transitionDuration);return i&&r||r?"css-transition":i?"css-animation":"none"}function Une(e){return e.split(",").map(t=>t.trim()).some(t=>t!==""&&Number.parseFloat(t)>0)}function R_(e,t,n){const i=e.style.getPropertyValue(t),r=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(i===""){e.style.removeProperty(t);return}e.style.setProperty(t,i,r)}}function ljt(e){const t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(r=>{e.style.setProperty(r,"initial","important")});function n(){Object.entries(t).forEach(([r,s])=>{if(s===""){e.style.removeProperty(r);return}e.style.setProperty(r,s)})}const i=jc.request(n);return()=>{jc.cancel(i),n()}}let Qne=function(e){return e.accordionPanelHeight="--accordion-panel-height",e.accordionPanelWidth="--accordion-panel-width",e}({});const NLe=p.forwardRef(function(t,n){const{className:i,hiddenUntilFound:r,keepMounted:s,id:o,render:l,style:c,...u}=t,{hiddenUntilFound:d,keepMounted:f}=kLe(),{defaultPanelId:h,mounted:m,onOpenChange:g,open:b,setMounted:v,setOpen:y,setPanelIdState:w,transitionStatus:x}=CLe(),O=r??d,k=s??f,S=o||void 0,C=o??h;Jn(()=>(w(M=>S??(M===null?void 0:M)),()=>{w(M=>M===S?null:M)}),[S,w]);const{height:E,props:j,ref:T,shouldPreventOpenAnimation:R,shouldRender:A,transitionStatus:N,width:D}=ajt({externalRef:n,hiddenUntilFound:O,id:C,keepMounted:k,mounted:m,onOpenChange:g,open:b,setMounted:v,setOpen:y,transitionStatus:x}),{state:I,triggerId:P}=hq(),_={...I,transitionStatus:N},L=g_e(c,_),F=Ra("div",{...t,style:void 0},{state:_,ref:T,props:[j,{"aria-labelledby":P,role:"region",style:{[Qne.accordionPanelHeight]:E===void 0?"auto":`${E}px`,[Qne.accordionPanelWidth]:D===void 0?"auto":`${D}px`}},u,L?{style:L}:void 0,R?{style:{animationName:"none"}}:void 0],stateAttributesMapping:mq});return A?F:null}),cjt=(e,t)=>{const n=e.currentTarget,i={x:e.clientX,y:e.clientY},r=ujt(i,n.getBoundingClientRect()),s=djt(i,r),o=fjt(t.getBoundingClientRect());return pjt([...s,...o])};function ujt(e,t){const n=Math.abs(t.top-e.y),i=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,i,r,s)){case s:return"left";case r:return"right";case n:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function djt(e,t,n=5){const i=[];switch(t){case"top":i.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":i.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":i.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":i.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return i}function fjt(e){const{top:t,right:n,bottom:i,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:i},{x:r,y:i}]}function hjt(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,o=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}function pjt(e){const t=e.slice();return t.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),mjt(t)}function mjt(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i=2;){const s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let i=e.length-1;i>=0;i--){const r=e[i];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const gjt="_Transition_1wdpp_1",bjt="_Popover_1wdpp_3",RLe={Transition:gjt,Popover:bjt},ILe=p.createContext(null),LM=()=>{const e=p.use(ILe);if(!e)throw new Error("Popover components must be wrapped in ");return e},$g=({open:e,onOpenChange:t,showOnHover:n=!1,hoverOpenDelay:i=150,children:r})=>{const[s,o]=p.useState(!1),[l,c]=p.useState(!1),u=p.useRef(null),d=p.useRef(null),f=p.useRef(void 0),h=p.useRef(!1),m=p.useRef(!1),g=e??s,[b,v]=p.useState(!1);kV(()=>v(!1),b?500:null);const y=sb(t),w=sb(C=>{var E,j;clearTimeout(f.current),g!==C&&(C||(c(!1),n&&h.current&&((E=u.current)==null||E.focus()),h.current=!1),(j=y.current)==null||j.call(y,C),o(C),n&&v(C))}),x=p.useCallback(C=>{w.current(C)},[w]),O=p.useCallback(()=>{f.current=setTimeout(()=>x(!0),i)},[x,i]),k=p.useCallback(()=>{clearTimeout(f.current)},[]);p.useEffect(()=>()=>{clearTimeout(f.current)},[]);const S=p.useMemo(()=>({open:g,setOpen:x,shake:l,setShake:c,showOnHover:n,temporarilyPreventClickToClose:b,onTriggerEnter:O,onTriggerLeave:k,isPointerInTransitRef:m,triggerRef:u,contentRef:d,hoverOpenFocusedWithTab:h}),[g,x,l,c,n,b,h,m,O,k]);return a.jsx(ILe,{value:S,children:a.jsx(PRe,{open:g,onOpenChange:x,modal:!1,children:r})})},yjt=({children:e,onPointerDown:t,onClick:n})=>{const{setOpen:i,showOnHover:r,temporarilyPreventClickToClose:s,onTriggerEnter:o,onTriggerLeave:l,isPointerInTransitRef:c,triggerRef:u,contentRef:d}=LM(),f=p.useRef(!1),h=b=>{!(b.currentTarget.nodeName.toLocaleLowerCase()==="a")&&s&&(b.preventDefault(),b.stopPropagation())},m=b=>{b.pointerType!=="touch"&&!f.current&&!c.current&&(o(),f.current=!0)},g=()=>{f.current&&(l(),f.current=!1)};return a.jsx(DRe,{asChild:!0,ref:u,onPointerDown:b=>{h(b),t==null||t(b)},onClick:b=>{h(b),n==null||n(b)},onPointerMove:r?m:void 0,onPointerLeave:r?g:void 0,onFocus:r?()=>i(!0):void 0,onBlur:r?()=>{setTimeout(()=>{var b;(b=d.current)!=null&&b.contains(document.activeElement)||i(!1)},50)}:void 0,children:e})},PLe=({children:e,avoidCollisions:t,width:n,minWidth:i,maxWidth:r,side:s,sideOffset:o=8,align:l,alignOffset:c,translucent:u,className:d,autoFocus:f=!0})=>{const{showOnHover:h,shake:m,contentRef:g}=LM(),b=v=>{const y=g.current;if(y&&v.target===y&&v.key==="Tab"&&v.shiftKey){v.preventDefault(),v.stopPropagation();const w=aNe(y),x=w[w.length-1];x==null||x.focus()}};return p.useEffect(()=>{const v=g.current;!v||!f||v!=null&&v.contains(document.activeElement)||h||v.focus({preventScroll:!0})},[g,h,f]),a.jsx(LRe,{forceMount:!0,ref:g,className:Qi(RLe.Popover,d),style:V0({"popover-width":n,"popover-min-width":i,"popover-max-width":r}),onCloseAutoFocus:h?Mp:void 0,"data-animate":m?"shake":void 0,"data-translucent":u?"true":void 0,side:s,sideOffset:o,align:l,alignOffset:c??(l==="center"?0:-5),avoidCollisions:t??!0,hideWhenDetached:!0,collisionPadding:20,onOpenAutoFocus:Mp,onEscapeKeyDown:Mp,onKeyDown:b,children:e})},vjt=e=>{const{setOpen:t,triggerRef:n,contentRef:i,isPointerInTransitRef:r,hoverOpenFocusedWithTab:s}=LM(),[o,l]=p.useState(null),c=p.useCallback(()=>{l(null),r.current=!1},[r]),u=p.useCallback((d,f)=>{const h=cjt(d,f);l(h),r.current=!0},[r]);return p.useEffect(()=>()=>c(),[c]),p.useEffect(()=>{const d=n.current,f=i.current;if(!d||!f)return;const h=g=>u(g,f),m=g=>u(g,d);return d.addEventListener("pointerleave",h),f.addEventListener("pointerleave",m),()=>{d.removeEventListener("pointerleave",h),f.removeEventListener("pointerleave",m)}},[i,n,u,c]),p.useEffect(()=>{if(!o)return;const d=f=>{const h=n.current,m=i.current,g=f.target,b={x:f.clientX,y:f.clientY},v=(h==null?void 0:h.contains(g))||(m==null?void 0:m.contains(g)),y=!hjt(b,o),w=g.hasAttribute("aria-haspopup");v?c():(y||w)&&(c(),t(!1))};return document.addEventListener("pointermove",d),()=>document.removeEventListener("pointermove",d)},[o,t,c,n,i]),p.useEffect(()=>{const d=f=>{if(i.current&&f.key==="Tab"&&!f.shiftKey){const[h]=aNe(i.current);h&&(f.preventDefault(),h.focus(),s.current=!0,document.removeEventListener("keydown",d))}};return document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d)}},[i,s]),a.jsx(PLe,{...e})},xjt=e=>{const{open:t,showOnHover:n,setOpen:i}=LM();return eT(t,()=>{i(!1)}),a.jsx(MRe,{forceMount:!0,children:a.jsx(Z1,{enterDuration:600,exitDuration:300,className:RLe.Transition,disableAnimations:!0,children:t&&(n?a.jsx(vjt,{...e},"popover-hover"):a.jsx(PLe,{...e},"popover"))})})};$g.Trigger=yjt;$g.Content=xjt;const wjt=["skill_hub","skill_space","knowledge_base","tool"];function DLe(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"m4 6 4 4 4-4"})})}function MLe({label:e}){return a.jsx("div",{className:"create-agent-card__loading",role:"status","aria-label":e,children:[0,1,2].map(t=>a.jsxs("div",{className:"create-agent-card__skeleton-row","aria-hidden":"true",children:[a.jsx("span",{}),a.jsx("span",{})]},t))})}function Ojt(e,t){return e.kind==="tool"?t("blocks.createAgents.builtinTool"):e.kind==="knowledge_base"?t("blocks.createAgents.knowledgeBase"):e.source.startsWith("skill_hub:")?"Skill Hub":e.source.startsWith("skill_space:")?t("blocks.createAgents.skillCenter"):"Skill"}function $4({label:e,resources:t}){const{t:n}=Te("conversation");return t.length===0?null:a.jsxs("section",{className:"create-agent-card__popover-section",children:[a.jsx("h4",{children:e}),a.jsx("div",{className:"create-agent-card__popover-list",children:t.map(i=>a.jsxs("div",{className:"create-agent-card__popover-item",children:[a.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[a.jsx("strong",{children:i.name}),a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",children:Ojt(i,n)})]}),i.description?a.jsx("p",{children:i.description}):null]},i.ref))})]})}function kjt({tools:e}){const{t}=Te("conversation");return e.length===0?null:a.jsxs("section",{className:"create-agent-card__popover-section",children:[a.jsx("h4",{children:t("blocks.createAgents.selfAuthoredTools")}),a.jsx(SLe,{children:e.map((n,i)=>a.jsxs(TLe,{className:"create-agent-card__python-tool",value:`${n.name}:${i}`,children:[a.jsx(_Le,{className:"create-agent-card__python-tool-header",children:a.jsxs(jLe,{className:"create-agent-card__python-tool-trigger",children:[a.jsxs("span",{children:[a.jsx("strong",{children:n.name}),n.description?a.jsx("small",{children:n.description}):null]}),a.jsxs("span",{className:"create-agent-card__python-tool-meta",children:[a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",children:t("blocks.createAgents.selfAuthoredTools")}),a.jsx(DLe,{className:"create-agent-card__python-tool-chevron"})]})]})}),a.jsxs(NLe,{className:"create-agent-card__python-tool-panel",children:[n.dependencies.length>0?a.jsx("div",{className:"create-agent-card__python-tool-dependencies",children:t("blocks.createAgents.dependencies",{items:n.dependencies.join(", ")})}):null,a.jsx("pre",{tabIndex:0,"aria-label":t("blocks.createAgents.fullCode",{name:n.name}),children:a.jsx("code",{children:n.code})})]})]},`${n.name}:${i}`))})]})}function Sjt({agents:e}){const{t}=Te("conversation");return e.length===0?null:a.jsxs("section",{className:"create-agent-card__popover-section",children:[a.jsx("h4",{children:t("blocks.createAgents.subAgents")}),a.jsx("div",{className:"create-agent-card__popover-list",children:e.map(n=>a.jsxs("div",{className:"create-agent-card__popover-item",children:[a.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[a.jsx("strong",{children:n.id}),a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",children:t(`blocks.createAgents.agentTypes.${n.type}`,{defaultValue:n.type})})]}),n.description?a.jsx("p",{children:n.description}):null]},n.id))})]})}function I_({label:e,count:t,icon:n,children:i}){const{t:r}=Te("conversation"),s=a.jsxs("button",{className:"create-agent-card__resource-metric",type:"button",disabled:t===0,"aria-label":r("blocks.createAgents.itemCount",{label:e,count:t}),children:[n,a.jsx("span",{children:t})]});return t===0?s:a.jsxs($g,{showOnHover:!0,hoverOpenDelay:120,children:[a.jsx($g.Trigger,{children:s}),a.jsx($g.Content,{side:"top",align:"start",minWidth:"auto",maxWidth:360,className:"create-agent-card__resource-popover",children:i})]})}function Ejt({response:e,status:t}){const{t:n}=Te("conversation"),i=p.useMemo(()=>({tool:n("blocks.createAgents.sourceLabels.tool"),knowledge:n("blocks.createAgents.sourceLabels.knowledge"),skillCenter:n("blocks.createAgents.sourceLabels.skillCenter"),unknownSource:n("blocks.createAgents.sourceLabels.unknown"),unnamedResource:n("blocks.createAgents.unnamedResource"),unnamedAgent:n("blocks.createAgents.unnamedAgent")}),[n]),r=p.useMemo(()=>F_t(e,i),[i,e]),s=p.useMemo(()=>wjt.map(c=>{const u=B_t(r,c);return{value:c,label:n(`blocks.createAgents.categories.${c}`),...u,searchKeywords:[...new Set(u.sources.flatMap(d=>d.searchKeywords))]}}),[r,n]),o=t==="failed",l=o?MM(e):"";return a.jsx("section",{className:"create-agent-tool-card","aria-label":n("blocks.createAgents.collectionAria"),children:t==="running"?a.jsx(MLe,{label:n("blocks.createAgents.retrieving")}):o?a.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[a.jsx("span",{className:"create-agent-card__message-title",children:n("blocks.createAgents.retrievalFailed")}),a.jsx("span",{children:l||n("blocks.createAgents.checkConfig")})]}):a.jsx(SLe,{className:"create-agent-card__accordion",children:s.map(c=>a.jsxs(TLe,{className:"create-agent-card__accordion-item",value:c.value,children:[a.jsx(_Le,{className:"create-agent-card__accordion-header",children:a.jsxs(jLe,{className:"create-agent-card__accordion-trigger",children:[a.jsx("span",{children:c.label}),a.jsxs("span",{className:"create-agent-card__accordion-meta",children:[a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",children:c.sources.length===0?c.value==="skill_hub"?n("blocks.createAgents.notSearched"):n("blocks.createAgents.notConfigured"):c.resources.length}),a.jsx(DLe,{className:"create-agent-card__accordion-chevron"})]})]})}),a.jsx(NLe,{className:"create-agent-card__accordion-content",children:a.jsxs("div",{className:"create-agent-card__accordion-scroll",role:"region","aria-label":n("blocks.createAgents.resourceList",{label:c.label}),tabIndex:0,children:[c.value==="skill_hub"&&c.searchKeywords.length>0?a.jsxs("div",{className:"create-agent-card__search-keywords",children:[a.jsx("span",{children:n("blocks.createAgents.searchKeywords")}),a.jsx("span",{children:c.searchKeywords.join("、")})]}):null,c.resources.length>0?a.jsx("div",{className:"create-agent-card__resource-list",children:c.resources.map(u=>a.jsx("div",{className:"create-agent-card__resource",children:a.jsxs("div",{className:"create-agent-card__resource-main",children:[a.jsxs("div",{className:"create-agent-card__resource-title",children:[a.jsx("span",{className:"create-agent-card__resource-name",children:u.name}),u.version?a.jsx(Ya,{className:"create-agent-card__resource-version",color:"secondary",size:"sm",variant:"soft",children:u.version}):null]}),u.description?a.jsx("p",{children:u.description}):null]})},u.ref))}):a.jsxs("div",{className:"create-agent-card__empty-category",children:[a.jsx("p",{children:c.sources.length===0?c.value==="skill_hub"?n("blocks.createAgents.skillHubSkipped"):n("blocks.createAgents.sourceSkipped",{label:c.label}):n("blocks.createAgents.noResources")}),c.sources.filter(u=>u.message).map(u=>a.jsx("p",{className:"create-agent-card__raw-source-error",children:u.message},u.source))]})]})})]},c.value))},r.collectionId||"collected-resources")})}function Cjt({args:e,response:t,status:n}){const{t:i}=Te("conversation"),r=p.useMemo(()=>({tool:i("blocks.createAgents.sourceLabels.tool"),knowledge:i("blocks.createAgents.sourceLabels.knowledge"),skillCenter:i("blocks.createAgents.sourceLabels.skillCenter"),unknownSource:i("blocks.createAgents.sourceLabels.unknown"),unnamedResource:i("blocks.createAgents.unnamedResource"),unnamedAgent:i("blocks.createAgents.unnamedAgent")}),[i]),s=p.useMemo(()=>yLe(e,t,r),[e,r,t]),o=n==="failed"?MM(t):"";return a.jsxs("section",{className:"create-agent-tool-card is-agent-results","aria-label":i("blocks.createAgents.resultAria"),children:[o?a.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[a.jsx("span",{className:"create-agent-card__message-title",children:i("blocks.createAgents.creationFailed")}),a.jsx("span",{children:o})]}):null,s.agents.length>0?a.jsx("div",{className:"create-agent-card__agent-grid",children:s.agents.map(l=>{const c=n==="failed"?"failed":l.status,u=l.error||c==="failed"&&o,d=l.builtinTools.length+l.pythonTools.length;return a.jsxs(xH,{className:`create-agent-card__agent-card${u?" is-error":""}`,children:[a.jsx(wH,{leading:a.jsx(n1,{seed:l.name}),title:l.name,titleText:l.name,status:a.jsx(Ya,{color:"secondary",size:"sm",variant:"soft",children:i(`blocks.createAgents.agentTypes.${l.rootType}`,{defaultValue:l.rootType})})}),l.description?a.jsx(OH,{children:l.description}):null,u?a.jsx("div",{className:"create-agent-card__agent-result is-error",role:"alert",children:u}):null,a.jsxs("div",{className:"create-agent-card__agent-resources","aria-label":i("blocks.createAgents.agentResources",{name:l.name}),children:[a.jsx(I_,{label:i("blocks.createAgents.skill"),count:l.skills.length,icon:a.jsx(gN,{"aria-hidden":"true"}),children:a.jsx($4,{label:i("blocks.createAgents.skill"),resources:l.skills})}),a.jsx(I_,{label:i("blocks.createAgents.knowledgeBase"),count:l.knowledgeBases.length,icon:a.jsx(gIe,{"aria-hidden":"true"}),children:a.jsx($4,{label:i("blocks.createAgents.knowledgeBase"),resources:l.knowledgeBases})}),a.jsxs(I_,{label:i("blocks.createAgents.toolsLabel"),count:d,icon:a.jsx(gat,{"aria-hidden":"true"}),children:[a.jsx($4,{label:i("blocks.createAgents.builtinTool"),resources:l.builtinTools}),a.jsx(kjt,{tools:l.pythonTools})]}),a.jsx(I_,{label:i("blocks.createAgents.subAgents"),count:l.subAgentCount,icon:a.jsx(yat,{"aria-hidden":"true"}),children:a.jsx(Sjt,{agents:l.subAgents})})]})]},l.name)})}):n==="running"?a.jsx(MLe,{label:i("blocks.createAgents.creating")}):a.jsxs("div",{className:"create-agent-card__message",children:[a.jsx("span",{className:"create-agent-card__message-title",children:i("blocks.createAgents.noAgents")}),a.jsx("span",{children:i("blocks.createAgents.noAgentResult")})]})]})}const Ajt={web_search:{name:"web_search",runningLabel:"Searching the web",doneLabel:"Web search complete",tone:"search",icon:Dne},link_reader:{name:"link_reader",runningLabel:"Reading webpage",doneLabel:"Webpage read complete",tone:"search",icon:Dne},run_code:{name:"run_code",runningLabel:"Running code in the AgentKit sandbox",doneLabel:"Code execution completed in the AgentKit sandbox",tone:"sandbox",icon:b_t},list_envs:{name:"list_envs",runningLabel:"Checking available environments",doneLabel:"Available environments loaded",tone:"resources",icon:v_t},get_env_manifest:{name:"get_env_manifest",runningLabel:"Loading the environment manifest",doneLabel:"Environment manifest loaded",tone:"knowledge",icon:x_t},execute_in_sandbox:{name:"execute_in_sandbox",runningLabel:"Running a command in the environment",doneLabel:"Command completed in the environment",tone:"sandbox",icon:Lne},delegate_to_codex_sandbox:{name:"delegate_to_codex_sandbox",runningLabel:"Codex Sandbox is running",doneLabel:"Codex Sandbox completed",failedLabel:"Codex Sandbox failed",tone:"sandbox",icon:Lne},image_generate:{name:"image_generate",runningLabel:"Generating image",doneLabel:"Image generated",tone:"image",icon:f_t},video_generate:{name:"video_generate",runningLabel:"Generating video",doneLabel:"Video generated",tone:"video",icon:cq},ppt_generate:{name:"ppt_generate",runningLabel:"Generating presentation",doneLabel:"Presentation generated",tone:"presentation",icon:h_t},load_memory:{name:"load_memory",runningLabel:"Searching long-term memory",doneLabel:"Memory search complete",tone:"memory",icon:p_t},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"Searching the knowledge base",doneLabel:"Knowledge base search complete",tone:"knowledge",icon:m_t},load_skill:{name:"load_skill",runningLabel:"Loading skill",doneLabel:"Skill loaded",tone:"skill",icon:g_t},collect_resources:{name:"collect_resources",runningLabel:"Collecting available resources",doneLabel:"Resource collection complete",failedLabel:"Resource collection failed",tone:"resources",icon:y_t,detailRenderer:Ejt},create_agents:{name:"create_agents",runningLabel:"Creating and running agents",doneLabel:"Agent creation complete",failedLabel:"Agent creation failed",tone:"agent",icon:Mne,detailRenderer:Cjt},branch_compare:{name:"branch_compare",runningLabel:"",doneLabel:"",failedLabel:"",tone:"search",icon:Mne,detailRenderer:z_t,hideHeader:!0}};function gq(e){return Ajt[e]}function Tjt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6 3h8l4 4v14H6Z"}),a.jsx("path",{d:"M14 3v5h5"}),a.jsx("path",{d:"m10 12-2 2 2 2M14 12l2 2-2 2"})]})}function _jt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M12 3 19 6v5c0 4.6-2.8 7.8-7 10-4.2-2.2-7-5.4-7-10V6l7-3Z"}),a.jsx("path",{d:"m9 12 2 2 4-4"})]})}function jjt(e,t){const n=new Map(e.map(o=>[o.path,o.content])),i=new Map(t.map(o=>[o.path,o.content])),r=new Set([...n.keys(),...i.keys()]),s=[];for(const o of[...r].sort((l,c)=>l.localeCompare(c))){const l=n.get(o),c=i.get(o);l!==c&&s.push({path:o,status:l===void 0?"added":c===void 0?"deleted":"modified",before:l??"",after:c??""})}return s}function Rb(e){return{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,...e}}function LLe(e){return a.jsx("svg",{...Rb(e),children:a.jsx("path",{d:"m9 7-5 5 5 5M15 7l5 5-5 5M13.5 4l-3 16"})})}function F4(e){return a.jsx("svg",{...Rb(e),children:a.jsx("path",{d:"M6.5 3.75h7l4 4V20.25h-11zM13.5 3.75v4h4M9 12h6M9 15.5h4.5"})})}function Njt(e){return a.jsx("svg",{...Rb(e),children:a.jsx("path",{d:"M3.75 7.25h6l1.75 2h8.75v9.25H3.75zM3.75 7.25V5.5h5l1.5 1.75"})})}function Rjt(e){return a.jsx("svg",{...Rb(e),children:a.jsx("path",{d:"m9 5 7 7-7 7"})})}function wT(e){return a.jsx("svg",{...Rb(e),children:a.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function Ijt(e){return a.jsxs("svg",{...Rb(e),children:[a.jsx("circle",{cx:"12",cy:"12",r:"3.25"}),a.jsx("path",{d:"M12 2.75v2M12 19.25v2M2.75 12h2M19.25 12h2M5.45 5.45l1.4 1.4M17.15 17.15l1.4 1.4M18.55 5.45l-1.4 1.4M6.85 17.15l-1.4 1.4"})]})}function Pjt(e){return a.jsx("svg",{...Rb(e),children:a.jsx("path",{d:"M19.25 15.25A8 8 0 0 1 8.75 4.75a8 8 0 1 0 10.5 10.5Z"})})}function $Le(e){return a.jsxs("svg",{...Rb(e),children:[a.jsx("path",{d:"M19.25 8.25V4.5l-1.8 1.8a7.5 7.5 0 1 0 1.8 7.65"}),a.jsx("path",{d:"M19.25 4.5H15.5"})]})}const Djt=p.lazy(()=>Zs(()=>Promise.resolve().then(()=>OFe),void 0)),Mjt=p.lazy(()=>Zs(()=>import("../chunks/CodeDiffEditor-2mGXDZcj.js"),[])),FLe="veadk-code-workspace-theme";function Ljt(e){const t={name:"",children:new Map};for(const n of e){const i=n.path.split("/").filter(Boolean);let r=t;i.forEach((s,o)=>{let l=r.children.get(s);l||(l={name:s,children:new Map},r.children.set(s,l)),o===i.length-1&&(l.path=n.path),r=l})}return t}function $jt(e,t=!1){return[...e.children.values()].sort((n,i)=>{const r=n.children.size>0&&n.path===void 0,s=i.children.size>0&&i.path===void 0;return r!==s?t?r?1:-1:r?-1:1:n.name.localeCompare(i.name)})}function Fjt(){if(typeof window>"u")return"light";try{return window.localStorage.getItem(FLe)==="dark"?"dark":"light"}catch{return"light"}}function Bjt(e){return e===""?0:e.split(` +`).length}function o1({project:e,open:t,onClose:n,onChange:i,readOnly:r=!1,comparison:s}){var N;const{t:o}=Te("workspaceTools"),l=p.useId(),c=p.useRef(null),u=p.useRef(null),d=p.useRef(n),[f,h]=p.useState(Fjt),m=p.useMemo(()=>s?jjt(s.baseProject.files,e.files):[],[s,e.files]),g=p.useMemo(()=>s?m.map(D=>({path:D.path,content:D.status==="deleted"?D.before:D.after})):e.files,[m,s,e.files]),b=p.useMemo(()=>new Map(m.map(D=>[D.path,D.status])),[m]),[v,y]=p.useState(((N=g[0])==null?void 0:N.path)??null),[w,x]=p.useState(new Set),O=p.useMemo(()=>Ljt(g),[g]),k=g.find(D=>D.path===v)??null,S=m.find(D=>D.path===v)??null;if(d.current=n,p.useEffect(()=>{try{window.localStorage.setItem(FLe,f)}catch{}},[f]),p.useEffect(()=>{var _;if(!t)return;const D=document.body.style.overflow,I=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(_=u.current)==null||_.focus();const P=L=>{if(L.key==="Escape"){L.preventDefault(),d.current();return}if(L.key!=="Tab"||!c.current)return;const F=[...c.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')].filter(q=>q.offsetParent!==null);if(F.length===0)return;const M=F[0],V=F[F.length-1];L.shiftKey&&document.activeElement===M?(L.preventDefault(),V.focus()):!L.shiftKey&&document.activeElement===V&&(L.preventDefault(),M.focus())};return window.addEventListener("keydown",P),()=>{document.body.style.overflow=D,window.removeEventListener("keydown",P),I!=null&&I.isConnected&&I.focus()}},[t]),p.useEffect(()=>{k||g.length===0||y(g[0].path)},[g,k]),!t)return null;function C(D){x(I=>{const P=new Set(I);return P.has(D)?P.delete(D):P.add(D),P})}function E(D){return D?a.jsx("span",{className:`code-browser-change is-${D}`,children:o(`codeBrowser.change.${D}`)}):null}function j(D,I,P){return $jt(D,I===0).map(_=>{const L=P?`${P}/${_.name}`:_.name;if(!(_.children.size>0&&_.path===void 0)&&_.path){const V=b.get(_.path);return a.jsxs("button",{type:"button",className:`code-browser-file${v===_.path?" is-active":""}`,style:{paddingLeft:`${12+I*16}px`},onClick:()=>y(_.path??null),title:_.path,"aria-pressed":v===_.path,children:[a.jsx(F4,{}),a.jsx("span",{children:_.name}),E(V)]},L)}const M=w.has(L);return a.jsxs("div",{children:[a.jsxs("button",{type:"button",className:"code-browser-folder",style:{paddingLeft:`${10+I*16}px`},onClick:()=>C(L),"aria-expanded":!M,children:[a.jsx(Rjt,{className:M?"":"is-open"}),a.jsx(Njt,{}),a.jsx("span",{children:_.name})]}),!M&&j(_,I+1,L)]},L)})}function T(D){!k||s||i({...e,files:e.files.map(I=>I.path===k.path?{...I,content:D}:I)})}const R=f==="light"?"dark":"light",A=o(s?"codeBrowser.noChanges":"codeBrowser.chooseFile");return yi.createPortal(a.jsx("div",{className:"code-browser-backdrop",onMouseDown:D=>{D.target===D.currentTarget&&n()},children:a.jsxs("section",{ref:c,className:`code-browser-dialog is-${f}`,role:"dialog","aria-modal":"true","aria-labelledby":l,children:[a.jsxs("header",{className:"code-browser-head",children:[a.jsxs("div",{className:"code-browser-title-wrap",children:[a.jsx("span",{className:"code-browser-title-icon",children:a.jsx(LLe,{})}),a.jsxs("div",{children:[a.jsx("h2",{id:l,children:o(s?"codeBrowser.compareTitle":"codeBrowser.workspaceTitle")}),a.jsx("p",{title:e.name,children:e.name||o("codeBrowser.projectFallback")})]})]}),a.jsxs("div",{className:"code-browser-head-actions",children:[a.jsx("button",{type:"button",className:"code-browser-icon-button",onClick:()=>h(R),"aria-label":o("codeBrowser.switchTheme"),title:o("codeBrowser.switchThemeTitle",{theme:o(`codeBrowser.themes.${R}`)}),children:f==="light"?a.jsx(Pjt,{}):a.jsx(Ijt,{})}),a.jsx("button",{ref:u,type:"button",className:"code-browser-icon-button",onClick:n,"aria-label":o("codeBrowser.closeWorkspace"),title:o("codeBrowser.close"),children:a.jsx(wT,{})})]})]}),a.jsxs("div",{className:"code-browser-workspace",children:[a.jsxs("aside",{className:"code-browser-sidebar","aria-label":o(s?"codeBrowser.changedFiles":"codeBrowser.projectFiles"),children:[a.jsxs("div",{className:"code-browser-sidebar-head",children:[a.jsx("span",{children:o(s?"codeBrowser.changes":"codeBrowser.files")}),a.jsx("span",{children:g.length})]}),a.jsx("div",{className:"code-browser-tree",children:g.length>0?j(O,0,""):a.jsx("div",{className:"code-browser-empty",children:A})})]}),a.jsxs("main",{className:"code-browser-main",children:[a.jsx("div",{className:"code-browser-tabs",role:"tablist","aria-label":o("codeBrowser.openFiles"),children:k?a.jsxs("div",{className:"code-browser-tab",role:"tab","aria-selected":"true",children:[a.jsx(F4,{}),a.jsx("span",{children:k.path.split("/").pop()}),E(S==null?void 0:S.status)]}):null}),a.jsxs("div",{className:"code-browser-path",children:[a.jsx(F4,{}),a.jsx("span",{children:(k==null?void 0:k.path)??o("codeBrowser.noFileSelected")})]}),s?a.jsxs("div",{className:"code-browser-diff-labels","aria-label":o("codeBrowser.comparisonDirection"),children:[a.jsx("span",{children:s.baseLabel??o("codeBrowser.before")}),a.jsx("span",{children:s.targetLabel??o("codeBrowser.after")})]}):null,a.jsx("div",{className:"code-browser-editor",children:k?a.jsx(p.Suspense,{fallback:a.jsx("div",{className:"code-browser-empty",children:o("codeBrowser.loadingEditor")}),children:S?a.jsx(Mjt,{before:S.before,after:S.after,path:S.path,theme:f}):a.jsx(Djt,{value:k.content,path:k.path,onChange:T,readOnly:r,theme:f})}):a.jsx("div",{className:"code-browser-empty",children:A})}),a.jsxs("footer",{className:"code-browser-statusbar",children:[a.jsx("span",{children:s?o("codeBrowser.changedFileCount",{count:m.length}):o("codeBrowser.fileCount",{count:e.files.length})}),a.jsx("span",{children:k?o("codeBrowser.lineCount",{count:Bjt(k.content)}):"UTF-8"})]})]})]})]})}),document.body)}function Ujt({project:e,onChange:t,className:n="",label:i}){const{t:r}=Te("workspaceTools"),[s,o]=p.useState(!1),l=i??r("codeBrowser.viewSource");return a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:`code-browser-trigger ${n}`.trim(),onClick:()=>o(!0),"aria-label":r("codeBrowser.viewSourceAria"),title:l,children:[a.jsx(LLe,{}),a.jsx("span",{children:l})]}),a.jsx(o1,{project:e,open:s,onClose:()=>o(!1),onChange:t})]})}const gy="••••••••",P_=5,Qv=8e3,Qjt=8,zjt=/(?:authorization|cookie|password|passwd|secret|token|api[_-]?key|access[_-]?key|credential|signature|^env(?:ironment)?$|^ak$|^sk$)/i,BLe=/\u001b\[[0-?]*[ -/]*[@-~]/g,ULe=/\u001b\][^\u0007]*(?:\u0007|\u001b\\)/g,QLe=/[\u0000-\u0008\u000b\u000c\u000e-\u001a\u001c-\u001f\u007f-\u009f]/g,Vjt=new Set(["exec_command","commandExecution","command_execution","run_code","execute_in_sandbox","Run command"]),Hjt=new Set(["web_search","search","grep","rg"]),qjt=new Set(["read_file","read","list_files","glob","ls"]),Wjt=new Set(["apply_patch","file_change","fileChange"]),Kjt=new Set(["create_goal","update_goal","get_goal"]);function xg(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function y0(...e){for(const t of e)if(typeof t=="string"&&t.trim())return t.trim();return""}function B4(...e){for(const t of e){if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"&&t.trim()&&Number.isFinite(Number(t)))return Number(t)}}function PI(e){const t=xg(e);if(!t)return[];const n=[t];for(const i of["payload","input","arguments","args","goal","result","display","safeCommandSummary","safeInputSummary"]){const r=xg(t[i]);r&&n.push(r)}return n}function gE(e,...t){return y0(...e.flatMap(n=>t.map(i=>n[i])))}function Gjt(e){let t=e.replace(BLe,"").replace(ULe,"").replace(QLe,"");return/[=:]|Bearer|Cookie|AKLT/i.test(t)&&(t=t.replace(/\bBearer\s+[^\s,;]+/gi,`Bearer ${gy}`).replace(/\b(?:set-)?cookie\s*:\s*[^\r\n]*/gi,`cookie: ${gy}`).replace(/\bAKLT[A-Za-z0-9_-]{6,}\b/g,gy).replace(/((?:access[_-]?key(?:[_-]?id)?|secret(?:[_-]?(?:access)?[_-]?key)?|session[_-]?token|security[_-]?token|client[_-]?secret|api[_-]?key|authorization|cookie|[a-z0-9_-]{0,80}(?:password|secret|token)|credential|ak|sk)\s*[:=]\s*)(?:"[^"]*"|'[^']*'|[^\s,;&]+)/gi,`$1${gy}`).replace(/([?&](?:access[_-]?key|api[_-]?key|client[_-]?secret|security[_-]?token|session[_-]?token|secret|token|password|authorization|cookie|credential)=)[^&#\s]+/gi,`$1${gy}`).replace(/([?&](?:x-amz-(?:credential|signature|security-token)|x-tos-signature|signature)=)[^&#\s]+/gi,`$1${gy}`)),t}function sf(e){return Gjt(e).replace(BLe,"").replace(ULe,"").replace(QLe,"")}function DI(e,t=0,n=new WeakSet){if(t>=Qjt)return"[truncated: maximum depth]";if(typeof e=="string")return sf(e);if(e===null||typeof e!="object")return e;if(n.has(e))return"[circular]";if(n.add(e),Array.isArray(e))return e.map(r=>DI(r,t+1,n));const i=xg(e);return i?Object.fromEntries(Object.entries(i).map(([r,s])=>[r,zjt.test(r)?gy:DI(s,t+1,n)])):e}function U4(e){const t=sf(e).trimEnd();if(!t)return;const n=t.split(/\r?\n/);return t.length>Qv*2?{text:t.slice(0,Qv)+t.slice(-Qv),head:[t.slice(0,Qv)],tail:[t.slice(-Qv)],omittedLines:0,omittedCharacters:t.length-Qv*2}:n.length<=P_*2?{text:t,head:n,tail:[],omittedLines:0,omittedCharacters:0}:{text:t,head:n.slice(0,P_),tail:n.slice(-P_),omittedLines:n.length-P_*2,omittedCharacters:0}}function Xjt(e){return Kjt.has(e)?"goal":Vjt.has(e)?"command":Hjt.has(e)||/search/i.test(e)?"search":qjt.has(e)||/(?:read|list|glob)/i.test(e)?"read":Wjt.has(e)||/(?:write|edit|patch|file.?change)/i.test(e)?"file-change":/^(?:mcp|tool__)/i.test(e)||e.includes("/")?"mcp":/auth|credential|approval/i.test(e)?"authorization":"generic"}function Yjt(e,t){if(e.status)return e.status;const n=y0(t==null?void 0:t.status).toLowerCase();return(t==null?void 0:t.ok)===!1||["failed","error","cancelled","denied","timeout"].includes(n)?"failed":e.done||["completed","done","success"].includes(n)?"completed":"running"}function zne(e){return typeof e=="string"?e.trim()?[e.trim()]:[]:Array.isArray(e)?e.flatMap(t=>{if(typeof t=="string")return t.trim()?[t.trim()]:[];const n=xg(t),i=y0(n==null?void 0:n.path,n==null?void 0:n.filename,n==null?void 0:n.name);return i?[i]:[]}):[]}function Zjt(e,t,n,i,r){const s=[...PI(n),...PI(i)];return e==="goal"?sf(gE(s,"objective","title","name")):e==="command"?sf(gE(s,"command","cmd","script","commandPreview","binary")):e==="search"?sf(gE(s,"query","pattern","search")):e==="read"||e==="file-change"?r.slice(0,2).map(sf).join(", "):sf(e==="mcp"?y0(n==null?void 0:n.query,n==null?void 0:n.resource,n==null?void 0:n.path):y0(n==null?void 0:n.title,n==null?void 0:n.name,i==null?void 0:i.message,i==null?void 0:i.status,t))}function bq(e){const t=xg(e.args),n=xg(e.response),i=e.args===void 0?void 0:DI(e.args),r=e.response===void 0?void 0:DI(e.response),s=[...PI(e.args),...PI(e.response)],o=Xjt(e.name),l=Yjt(e,n),c=xg(n==null?void 0:n.display)??xg(t==null?void 0:t.display),u=y0(n==null?void 0:n.aggregatedOutput,n==null?void 0:n.aggregated_output,n==null?void 0:n.output,n==null?void 0:n.errorMessage,n==null?void 0:n.error_message),d=[...zne((t==null?void 0:t.paths)??(t==null?void 0:t.files)??(t==null?void 0:t.changes)??(t==null?void 0:t.path)),...zne((n==null?void 0:n.paths)??(n==null?void 0:n.files)??(n==null?void 0:n.changes))],f=B4(n==null?void 0:n.exitCode,n==null?void 0:n.exit_code),h=B4(n==null?void 0:n.durationMs,n==null?void 0:n.duration_ms,c==null?void 0:c.durationMs),m=B4(n==null?void 0:n.count,n==null?void 0:n.total,n==null?void 0:n.totalCount);return{category:o,titleKey:o==="generic"?`generic.named.${l}`:`${o}.${l}`,titleParams:o==="generic"?{tool:e.name}:void 0,title:e.title,summary:Zjt(o,e.name,t,n,d),status:l,source:e.source,command:o==="command"?sf(y0(gE(s,"command","cmd","script","commandPreview","binary"))):void 0,cwd:o==="command"&&sf(gE(s,"cwd"))||void 0,output:U4(u),exitCode:f,durationMs:h,resultCount:m,paths:[...new Set(d.map(sf))],defaultOpen:e.defaultOpen===!0||l==="running"||l==="failed",rawArgs:i,rawResponse:r,rawArgsPreview:i===void 0?void 0:U4(Vne(i)),rawResponsePreview:r===void 0?void 0:U4(Vne(r))}}function Vne(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}function Hne(e){return e.status==="completed"&&(e.category==="read"||e.category==="search")}function Id(e){return{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,...e}}function Jjt(e){return a.jsxs("svg",{...Id(e),children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),a.jsx("path",{d:"m7.5 9 2.7 2.5L7.5 14M12.7 14h3.8M3.8 7.5h16.4"})]})}function zLe(e){return a.jsxs("svg",{...Id(e),children:[a.jsx("path",{d:"M6 3.5h7l5 5v12H6zM13 3.5v5h5M8.8 13h5.7M8.8 16h3.8"}),a.jsx("circle",{cx:"16.8",cy:"16.5",r:"2.3"}),a.jsx("path",{d:"m18.5 18.2 1.8 1.8"})]})}function eNt(e){return a.jsxs("svg",{...Id(e),children:[a.jsx("circle",{cx:"10.5",cy:"10.5",r:"5.75"}),a.jsx("path",{d:"m15 15 4.25 4.25"})]})}function tNt(e){return a.jsxs("svg",{...Id(e),children:[a.jsx("path",{d:"M5.5 3.5h7l4 4v4M12.5 3.5v4h4M10.5 20.5h-5v-17"}),a.jsx("path",{d:"m12.5 17.5 5.6-5.6 2 2-5.6 5.6-2.8.8z"})]})}function nNt(e){return a.jsxs("svg",{...Id(e),children:[a.jsx("path",{d:"M8 8V4.5M16 8V4.5M6.5 8h11v3.5a5.5 5.5 0 0 1-11 0zM12 17v3"}),a.jsx("path",{d:"M5.5 4.5h5M13.5 4.5h5"})]})}function iNt(e){return a.jsxs("svg",{...Id(e),children:[a.jsx("path",{d:"M12 3.5 19 6v5.2c0 4.3-2.7 7.6-7 9.3-4.3-1.7-7-5-7-9.3V6z"}),a.jsx("path",{d:"m8.8 12 2 2 4.4-4.4"})]})}function qne(e){return a.jsx("svg",{...Id(e),children:a.jsx("path",{d:"M14.8 6.2a4.1 4.1 0 0 0-5.6 5.6l-5.4 5.4a2 2 0 0 0 2.8 2.8l5.4-5.4a4.1 4.1 0 0 0 5.6-5.6l-2.5 2.5-2.6-.6-.6-2.6z"})})}function yq(e){return a.jsx("svg",{...Id(e),children:a.jsx("path",{d:"m9 5 7 7-7 7"})})}function VLe(e){return a.jsx("svg",{...Id(e),children:a.jsx("path",{d:"m5 12.5 4.5 4.5L19 7.5"})})}function rNt(e){return a.jsxs("svg",{...Id(e),children:[a.jsx("circle",{cx:"12",cy:"12",r:"8.5"}),a.jsx("path",{d:"M12 7.5v5.25M12 16.25h.01"})]})}function sNt(e){return a.jsx("svg",{...Id(e),children:a.jsx("path",{d:"M20 12a8 8 0 1 1-2.35-5.65"})})}function aNt(e){return a.jsxs("svg",{...Id(e),children:[a.jsx("rect",{x:"8",y:"8",width:"11",height:"11",rx:"2"}),a.jsx("path",{d:"M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2"})]})}const oNt={goal:qne,command:Jjt,read:zLe,search:eNt,"file-change":tNt,mcp:nNt,authorization:iNt,generic:qne};function lNt(e){return e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(e<1e4?1:0)} s`}function HLe(e){if(e===void 0)return"";if(typeof e=="string"){const t=e.trim();if(t.startsWith("{")||t.startsWith("["))try{return JSON.stringify(JSON.parse(t),null,2)}catch{return e}return e}try{return JSON.stringify(e,null,2)}catch{return String(e)}}function cNt({status:e}){return e==="running"||e==="queued"?a.jsx(sNt,{className:"tool-activity__status-icon is-spinning"}):e==="failed"?a.jsx(rNt,{className:"tool-activity__status-icon"}):a.jsx(VLe,{className:"tool-activity__status-icon"})}function uNt({presentation:e,callId:t}){const{t:n}=Te("conversation"),[i,r]=p.useState(!1),[s,o]=p.useState(""),[l,c]=p.useState(!1),u=p.useRef(void 0);p.useEffect(()=>()=>window.clearTimeout(u.current),[]);const d=async(f,h)=>{window.clearTimeout(u.current);try{await navigator.clipboard.writeText(typeof h=="string"?h:HLe(h)),o(f),c(!1),u.current=window.setTimeout(()=>o(""),1500)}catch{o(""),c(!0),u.current=window.setTimeout(()=>c(!1),3e3)}};return e.rawArgs===void 0&&e.rawResponse===void 0&&!t?null:a.jsxs("div",{className:"tool-activity__raw",children:[a.jsxs("button",{type:"button",onClick:()=>r(f=>!f),"aria-expanded":i,children:[n("blocks.toolActivity.rawData"),a.jsx(yq,{className:i?"is-open":""})]}),i?a.jsxs("div",{className:"tool-activity__raw-body",children:[t?a.jsxs("div",{className:"tool-activity__raw-id",children:[a.jsx("span",{children:n("blocks.toolActivity.callId")}),a.jsx("code",{children:t}),a.jsx("button",{type:"button",onClick:()=>void d("id",t),"aria-label":n("blocks.toolActivity.copyCallId"),children:a.jsx(aNt,{})})]}):null,e.rawArgs!==void 0?a.jsx(Wne,{label:n("blocks.arguments"),value:e.rawArgs,preview:e.rawArgsPreview,copied:s==="input",onCopy:()=>void d("input",e.rawArgs)}):null,e.rawResponse!==void 0?a.jsx(Wne,{label:n("blocks.result"),value:e.rawResponse,preview:e.rawResponsePreview,copied:s==="result",onCopy:()=>void d("result",e.rawResponse)}):null,l?a.jsx("span",{className:"tool-activity__copy-error",role:"alert",children:n("blocks.toolActivity.copyFailed")}):null]}):null]})}function Wne({label:e,value:t,preview:n,copied:i,onCopy:r}){const{t:s}=Te("conversation");return a.jsxs("section",{className:"tool-activity__raw-section",children:[a.jsxs("div",{children:[a.jsx("span",{children:e}),a.jsx("button",{type:"button",onClick:r,children:s(i?"blocks.toolActivity.copied":"blocks.toolActivity.copy")})]}),a.jsxs("pre",{children:[(n==null?void 0:n.head.join(` +`))??HLe(t),n&&n.omittedCharacters>0?` ${s("blocks.toolActivity.omittedCharacters",{count:n.omittedCharacters})} ${n.tail.join(` `)}`:n&&n.omittedLines>0?` ${s("blocks.toolActivity.omittedLines",{count:n.omittedLines})} ${n.tail.join(` -`)}`:""]})]})}function cNt({presentation:e}){const{t}=Te("conversation"),n=e.output;return n?a.jsxs("pre",{className:"tool-activity__output",children:[n.head.join(` +`)}`:""]})]})}function dNt({presentation:e}){const{t}=Te("conversation"),n=e.output;return n?a.jsxs("pre",{className:"tool-activity__output",children:[n.head.join(` `),n.omittedCharacters>0?` `+t("blocks.toolActivity.omittedCharacters",{count:n.omittedCharacters})+` `+n.tail.join(` `):n.omittedLines>0?` ${t("blocks.toolActivity.omittedLines",{count:n.omittedLines})} ${n.tail.join(` -`)}`:""]}):null}function HLe({input:e,children:t}){const{t:n}=Te("conversation"),i=gq(e),[r,s]=p.useState(i.defaultOpen),o=p.useRef(!1);p.useEffect(()=>{o.current||s(i.defaultOpen)},[i.defaultOpen]);const l=sNt[i.category],c=i.title||n(`blocks.toolActivity.${i.titleKey}`,{...i.titleParams,defaultValue:e.name||n("blocks.toolActivity.generic.completed")}),u=[i.durationMs===void 0?"":aNt(i.durationMs),i.exitCode===void 0?"":n("blocks.toolActivity.exitCode",{code:i.exitCode})].filter(Boolean),d=!!(t||i.command||i.output||i.paths.length||i.rawArgs!==void 0||i.rawResponse!==void 0);return a.jsxs("section",{className:"tool-activity","data-status":i.status,"data-category":i.category,children:[a.jsxs("button",{className:"tool-activity__head",type:"button","aria-expanded":d?r:void 0,disabled:!d,onClick:()=>{o.current=!0,s(f=>!f)},children:[a.jsx("span",{className:"tool-activity__icon","aria-hidden":"true",children:a.jsx(l,{})}),a.jsx("span",{className:"tool-activity__status",role:"img","aria-label":n(`blocks.toolActivity.status.${i.status}`),children:a.jsx(oNt,{status:i.status})}),a.jsx("span",{className:"tool-activity__title",children:c}),i.summary?a.jsx("span",{className:"tool-activity__summary",children:i.summary}):null,u.length?a.jsx("span",{className:"tool-activity__metrics",children:u.join(" · ")}):null,d?a.jsx(bq,{className:`tool-activity__chevron${r?" is-open":""}`,"aria-hidden":"true"}):null]}),a.jsx("div",{className:`tool-activity__collapse${r&&d?" is-open":""}`,"aria-hidden":!r||!d,inert:!r||!d?!0:void 0,children:a.jsx("div",{className:"tool-activity__collapse-inner",children:a.jsxs("div",{className:"tool-activity__detail",children:[i.command?a.jsxs("code",{className:"tool-activity__command",children:["$ ",i.command]}):null,i.cwd?a.jsx("div",{className:"tool-activity__cwd",children:i.cwd}):null,i.paths.length?a.jsx("ul",{className:"tool-activity__paths",children:i.paths.map(f=>a.jsx("li",{children:f},f))}):null,a.jsx(cNt,{presentation:i}),t,a.jsx(lNt,{presentation:i,callId:e.callId})]})})})]})}function uNt({items:e}){const{t}=Te("conversation"),[n,i]=p.useState(!1);return a.jsxs("section",{className:"tool-activity tool-activity--exploration",children:[a.jsxs("button",{className:"tool-activity__head",type:"button","aria-expanded":n,onClick:()=>i(r=>!r),children:[a.jsx("span",{className:"tool-activity__icon","aria-hidden":"true",children:a.jsx(QLe,{})}),a.jsx("span",{className:"tool-activity__status",role:"img","aria-label":t("blocks.toolActivity.status.completed"),children:a.jsx(zLe,{className:"tool-activity__status-icon"})}),a.jsx("span",{className:"tool-activity__title",children:t("blocks.toolActivity.explored",{count:e.length})}),a.jsx("span",{className:"tool-activity__summary",children:e.map(r=>gq(r).summary).filter(Boolean).slice(0,2).join(", ")}),a.jsx(bq,{className:`tool-activity__chevron${n?" is-open":""}`,"aria-hidden":"true"})]}),a.jsx("div",{className:`tool-activity__collapse${n?" is-open":""}`,"aria-hidden":!n,inert:n?void 0:!0,children:a.jsx("div",{className:"tool-activity__collapse-inner",children:a.jsx("div",{className:"tool-activity__exploration-items",children:e.map((r,s)=>a.jsx(HLe,{input:r},r.callId||`${r.name}:${s}`))})})})]})}const qLe="send_a2ui_json_to_client",dNt=28,fNt=3e3;function hNt(e,t,n){let i=t;for(let r=0;r65535?2:1}return i}function pNt(e){return e<=4?1:Math.min(18,Math.max(2,Math.ceil(e/6)))}function WLe(e,t,n,i){const[r,s]=p.useState(()=>t?"":e),o=p.useRef(r),l=p.useRef(e),c=p.useRef(null),u=p.useRef(0),d=p.useRef(n);return l.current=e,d.current=n,p.useEffect(()=>{const f=o.current,h=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(!t||h||!e.startsWith(f)){c.current!==null&&window.cancelAnimationFrame(c.current),c.current=null,f!==e&&(o.current=e,s(e));return}if(f===e||c.current!==null)return;const m=g=>{const b=l.current,v=o.current;if(!b.startsWith(v)){o.current=b,s(b),c.current=null;return}if(g-u.current{var f;(f=d.current)==null||f.call(d)},[r]),p.useEffect(()=>{r===e&&(i==null||i())},[r,i,e]),p.useEffect(()=>()=>{c.current!==null&&(window.cancelAnimationFrame(c.current),c.current=null)},[]),r}function mNt(){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M14.3 5.25a4.6 4.6 0 0 0-5.55 5.55L3.6 15.95a1.8 1.8 0 0 0 0 2.55l1.9 1.9a1.8 1.8 0 0 0 2.55 0l5.15-5.15a4.6 4.6 0 0 0 5.55-5.55l-2.9 2.9-2.45-.55-.55-2.45 2.9-2.9a4.6 4.6 0 0 0-1.45-1.45Z"})})}function gNt(){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"m4.5 7 1.8 1.8L9.5 5.5"}),a.jsx("path",{d:"M12 7h7.5"}),a.jsx("path",{d:"m4.5 13 1.8 1.8 3.2-3.3"}),a.jsx("path",{d:"M12 13h7.5"}),a.jsx("path",{d:"M5 19h4"}),a.jsx("path",{d:"M12 19h7.5"})]})}function bNt(){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M5 5v7.25A3.75 3.75 0 0 0 8.75 16H19"}),a.jsx("path",{d:"m15.5 12.5 3.5 3.5-3.5 3.5"})]})}function yNt({activity:e}){const{t}=Te("conversation"),n=[["Agent Session",e.agentSessionId],["Sandbox Session",e.sandboxSessionId],["Codex Thread",e.threadId]].filter(i=>!!i[1]);return n.length?a.jsx("dl",{className:"codex-sandbox-run__identity","aria-label":t("blocks.sandboxIdentity"),children:n.map(([i,r])=>a.jsxs("div",{children:[a.jsx("dt",{children:i}),a.jsx("dd",{title:r,children:r})]},i))}):null}function d9(e,t,n){if(e!=="load_skill"||t==null||typeof t!="object"||Array.isArray(t))return;const i=t.skill_name;if(!(typeof i!="string"||!i.trim()))return n("blocks.useSkill",{name:i.trim()})}function KLe({text:e,done:t,thoughtKind:n="thought",answerStarted:i=!1,streaming:r=!1,onStreamFrame:s}){const{t:o}=Te("conversation"),[l,c]=p.useState(!(t||i)),u=p.useRef(!1);p.useEffect(()=>{u.current||c(!(t||i))},[i,t]);const d=()=>{u.current=!0,c(b=>!b)},f=e.replace(/\r\n?/g,` +`)}`:""]}):null}function qLe({input:e,children:t}){const{t:n}=Te("conversation"),i=bq(e),[r,s]=p.useState(i.defaultOpen),o=p.useRef(!1);p.useEffect(()=>{o.current||s(i.defaultOpen)},[i.defaultOpen]);const l=oNt[i.category],c=i.title||n(`blocks.toolActivity.${i.titleKey}`,{...i.titleParams,defaultValue:e.name||n("blocks.toolActivity.generic.completed")}),u=[i.durationMs===void 0?"":lNt(i.durationMs),i.exitCode===void 0?"":n("blocks.toolActivity.exitCode",{code:i.exitCode})].filter(Boolean),d=!!(t||i.command||i.output||i.paths.length||i.rawArgs!==void 0||i.rawResponse!==void 0);return a.jsxs("section",{className:"tool-activity","data-status":i.status,"data-category":i.category,children:[a.jsxs("button",{className:"tool-activity__head",type:"button","aria-expanded":d?r:void 0,disabled:!d,onClick:()=>{o.current=!0,s(f=>!f)},children:[a.jsx("span",{className:"tool-activity__icon","aria-hidden":"true",children:a.jsx(l,{})}),a.jsx("span",{className:"tool-activity__status",role:"img","aria-label":n(`blocks.toolActivity.status.${i.status}`),children:a.jsx(cNt,{status:i.status})}),a.jsx("span",{className:"tool-activity__title",children:c}),i.summary?a.jsx("span",{className:"tool-activity__summary",children:i.summary}):null,u.length?a.jsx("span",{className:"tool-activity__metrics",children:u.join(" · ")}):null,d?a.jsx(yq,{className:`tool-activity__chevron${r?" is-open":""}`,"aria-hidden":"true"}):null]}),a.jsx("div",{className:`tool-activity__collapse${r&&d?" is-open":""}`,"aria-hidden":!r||!d,inert:!r||!d?!0:void 0,children:a.jsx("div",{className:"tool-activity__collapse-inner",children:a.jsxs("div",{className:"tool-activity__detail",children:[i.command?a.jsxs("code",{className:"tool-activity__command",children:["$ ",i.command]}):null,i.cwd?a.jsx("div",{className:"tool-activity__cwd",children:i.cwd}):null,i.paths.length?a.jsx("ul",{className:"tool-activity__paths",children:i.paths.map(f=>a.jsx("li",{children:f},f))}):null,a.jsx(dNt,{presentation:i}),t,a.jsx(uNt,{presentation:i,callId:e.callId})]})})})]})}function fNt({items:e}){const{t}=Te("conversation"),[n,i]=p.useState(!1);return a.jsxs("section",{className:"tool-activity tool-activity--exploration",children:[a.jsxs("button",{className:"tool-activity__head",type:"button","aria-expanded":n,onClick:()=>i(r=>!r),children:[a.jsx("span",{className:"tool-activity__icon","aria-hidden":"true",children:a.jsx(zLe,{})}),a.jsx("span",{className:"tool-activity__status",role:"img","aria-label":t("blocks.toolActivity.status.completed"),children:a.jsx(VLe,{className:"tool-activity__status-icon"})}),a.jsx("span",{className:"tool-activity__title",children:t("blocks.toolActivity.explored",{count:e.length})}),a.jsx("span",{className:"tool-activity__summary",children:e.map(r=>bq(r).summary).filter(Boolean).slice(0,2).join(", ")}),a.jsx(yq,{className:`tool-activity__chevron${n?" is-open":""}`,"aria-hidden":"true"})]}),a.jsx("div",{className:`tool-activity__collapse${n?" is-open":""}`,"aria-hidden":!n,inert:n?void 0:!0,children:a.jsx("div",{className:"tool-activity__collapse-inner",children:a.jsx("div",{className:"tool-activity__exploration-items",children:e.map((r,s)=>a.jsx(qLe,{input:r},r.callId||`${r.name}:${s}`))})})})]})}const WLe="send_a2ui_json_to_client",hNt=28,pNt=3e3;function mNt(e,t,n){let i=t;for(let r=0;r65535?2:1}return i}function gNt(e){return e<=4?1:Math.min(18,Math.max(2,Math.ceil(e/6)))}function KLe(e,t,n,i){const[r,s]=p.useState(()=>t?"":e),o=p.useRef(r),l=p.useRef(e),c=p.useRef(null),u=p.useRef(0),d=p.useRef(n);return l.current=e,d.current=n,p.useEffect(()=>{const f=o.current,h=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(!t||h||!e.startsWith(f)){c.current!==null&&window.cancelAnimationFrame(c.current),c.current=null,f!==e&&(o.current=e,s(e));return}if(f===e||c.current!==null)return;const m=g=>{const b=l.current,v=o.current;if(!b.startsWith(v)){o.current=b,s(b),c.current=null;return}if(g-u.current{var f;(f=d.current)==null||f.call(d)},[r]),p.useEffect(()=>{r===e&&(i==null||i())},[r,i,e]),p.useEffect(()=>()=>{c.current!==null&&(window.cancelAnimationFrame(c.current),c.current=null)},[]),r}function bNt(){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M14.3 5.25a4.6 4.6 0 0 0-5.55 5.55L3.6 15.95a1.8 1.8 0 0 0 0 2.55l1.9 1.9a1.8 1.8 0 0 0 2.55 0l5.15-5.15a4.6 4.6 0 0 0 5.55-5.55l-2.9 2.9-2.45-.55-.55-2.45 2.9-2.9a4.6 4.6 0 0 0-1.45-1.45Z"})})}function yNt(){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"m4.5 7 1.8 1.8L9.5 5.5"}),a.jsx("path",{d:"M12 7h7.5"}),a.jsx("path",{d:"m4.5 13 1.8 1.8 3.2-3.3"}),a.jsx("path",{d:"M12 13h7.5"}),a.jsx("path",{d:"M5 19h4"}),a.jsx("path",{d:"M12 19h7.5"})]})}function vNt(){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M5 5v7.25A3.75 3.75 0 0 0 8.75 16H19"}),a.jsx("path",{d:"m15.5 12.5 3.5 3.5-3.5 3.5"})]})}function xNt({activity:e}){const{t}=Te("conversation"),n=[["Agent Session",e.agentSessionId],["Sandbox Session",e.sandboxSessionId],["Codex Thread",e.threadId]].filter(i=>!!i[1]);return n.length?a.jsx("dl",{className:"codex-sandbox-run__identity","aria-label":t("blocks.sandboxIdentity"),children:n.map(([i,r])=>a.jsxs("div",{children:[a.jsx("dt",{children:i}),a.jsx("dd",{title:r,children:r})]},i))}):null}function f9(e,t,n){if(e!=="load_skill"||t==null||typeof t!="object"||Array.isArray(t))return;const i=t.skill_name;if(!(typeof i!="string"||!i.trim()))return n("blocks.useSkill",{name:i.trim()})}function GLe({text:e,done:t,thoughtKind:n="thought",answerStarted:i=!1,streaming:r=!1,onStreamFrame:s}){const{t:o}=Te("conversation"),[l,c]=p.useState(!(t||i)),u=p.useRef(!1);p.useEffect(()=>{u.current||c(!(t||i))},[i,t]);const d=()=>{u.current=!0,c(b=>!b)},f=e.replace(/\r\n?/g,` `).trimStart().split(/\n{2,}/).map(b=>b.replace(/[^\S\n]*\n[^\S\n]*/g,(v,y,w)=>{const x=w[y-1]??"",O=w[y+v.length]??"";return!x||!O||new RegExp("\\p{Script=Han}","u").test(x)&&new RegExp("\\p{Script=Han}","u").test(O)||/[(\[{“‘/]/u.test(x)||/[),.\]},。!?;:、”’]/u.test(O)?"":" "})).join(` -`),h=WLe(f,!t||r,s),{ref:m,onScroll:g}=fLe(h);return a.jsxs("div",{className:"block-thinking",children:[a.jsxs("button",{className:"think-head",onClick:d,type:"button",children:[a.jsx("span",{className:"think-icon","aria-hidden":"true",children:a.jsx(cq,{className:`thinking-logo ${t?"":"is-active"}`})}),t?a.jsx("span",{className:"think-label think-label--done",children:o(n==="reasoning"?"blocks.reasoningDone":"blocks.thinkingDone")}):a.jsx(fn,{className:"think-label",duration:2.4,spread:18,children:o(n==="reasoning"?"blocks.reasoning":"blocks.thinking")}),a.jsx(HA,{className:`chev ${l?"open":""}`})]}),a.jsx("div",{className:`think-collapse ${l&&h?"open":""}`,children:a.jsx("div",{className:"think-collapse-inner",children:a.jsx("div",{className:"think-body scroll",ref:m,onScroll:g,children:h})})})]})}function GLe({text:e}){return a.jsx("div",{className:"block-progress",role:"status","aria-live":"polite","aria-atomic":"true",children:a.jsxs("div",{className:"think-head progress-head",children:[a.jsx("span",{className:"think-icon","aria-hidden":"true",children:a.jsx(cq,{className:"thinking-logo is-active"})}),a.jsx(fn,{className:"think-label",duration:2.4,spread:18,children:e})]})})}function vNt({value:e,onResolve:t,onResolveComparison:n,onDownload:i,onDeploy:r}){const{t:s,i18n:o}=Te("conversation"),l=N=>N.split(new RegExp("(?<=[/_-])")).map((P,I)=>a.jsxs(p.Fragment,{children:[P,a.jsx("wbr",{})]},`${I}:${P}`)),[c,u]=p.useState(e.files?e:null),[d,f]=p.useState(!1),[h,m]=p.useState(!1),[g,b]=p.useState(null),[v,y]=p.useState(null),[w,x]=p.useState(""),[O,k]=p.useState(null),S=new Date(e.validatedAt),C=e.validatedAt?Number.isNaN(S.getTime())?e.validatedAt:S.toLocaleString(o.resolvedLanguage??o.language,{hour12:!1}):s("blocks.justNow");p.useEffect(()=>{if(!O)return;const N=window.setTimeout(()=>k(null),fNt);return()=>window.clearTimeout(N)},[O]);async function E(){if(c)return c;if(!t)throw new Error(s("blocks.sourceUnavailable"));const N=await t(e);return u(N),N}async function j(){y("source"),x(""),k(null);try{await E(),f(!0)}catch(N){x(N instanceof Error?N.message:String(N))}finally{y(null)}}async function T(){if(i){y("download"),x(""),k(null);try{await i(e),k({message:s("blocks.downloadStarted")})}catch(N){x(N instanceof Error?N.message:String(N))}finally{y(null)}}}async function R(){if(n){y("compare"),x(""),k(null);try{const N=g??await n(e);b(N),m(!0)}catch(N){x(N instanceof Error?N.message:String(N))}finally{y(null)}}}async function A(){y("deploy"),x(""),k(null);try{r==null||r(await E())}catch(N){x(N instanceof Error?N.message:String(N))}finally{y(null)}}return a.jsxs(a.Fragment,{children:[a.jsxs("section",{className:`delivery-card${e.verified?" is-verified":" is-unverified"}`,"aria-label":e.verified?s("blocks.verifiedDelivery"):s("blocks.generatedSource"),children:[a.jsxs("header",{className:"delivery-card-header",children:[a.jsx("span",{className:"delivery-card-icon",children:e.verified?a.jsx(Ajt,{}):a.jsx(Cjt,{})}),a.jsxs("div",{className:"delivery-card-heading",children:[a.jsx("strong",{children:l(e.agentName)}),a.jsx("span",{children:e.verified?s("blocks.verifiedDelivery"):s("blocks.generatedSource")})]})]}),a.jsxs("dl",{className:"delivery-card-grid",children:[a.jsxs("div",{className:"delivery-card-entry",children:[a.jsx("dt",{children:s("blocks.entryPoint")}),a.jsx("dd",{children:a.jsx("code",{children:l(e.entryPoint)})})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("blocks.fileCount")}),a.jsx("dd",{children:e.fileCount})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("blocks.size")}),a.jsxs("dd",{children:[(e.artifactSize/1024).toFixed(1)," KiB"]})]}),a.jsxs("div",{className:"delivery-card-time",children:[a.jsx("dt",{children:e.verified?s("blocks.validationTime"):s("blocks.generationTime")}),a.jsx("dd",{children:C})]})]}),a.jsxs("p",{className:"delivery-card-gates",children:[e.verified?s("blocks.checksPassed",{count:e.gateSummary.length}):s("blocks.sourceReady")," ","· ",a.jsx("code",{children:e.artifactSha256.slice(0,12)})]}),e.verified?null:a.jsx("p",{className:"delivery-card-guidance",children:s("blocks.sourceGuidance")}),a.jsxs("div",{className:"delivery-card-actions",children:[a.jsxs("div",{className:"delivery-card-secondary-actions",children:[a.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void j(),disabled:!t||v!==null,children:[v==="source"?a.jsx(Fi,{className:"spin","aria-hidden":"true"}):null,s("blocks.viewSource")]}),e.projectId&&e.versionId&&e.parentVersionId?a.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void R(),disabled:!n||v!==null,children:[v==="compare"?a.jsx(Fi,{className:"spin","aria-hidden":"true"}):null,s(v==="compare"?"blocks.preparing":"blocks.viewChanges")]}):null,a.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void T(),disabled:!i||v!==null,"aria-busy":v==="download",children:[v==="download"?a.jsx(Fi,{className:"spin","aria-hidden":"true"}):null,s(v==="download"?"blocks.preparing":"blocks.downloadSource")]})]}),a.jsxs("button",{type:"button",className:"delivery-card-primary",onClick:()=>void A(),disabled:!e.deployable||!r||!t||v!==null,title:e.deployable?s("blocks.manualDeploy"):s("blocks.sourceNotReady"),children:[v==="deploy"?a.jsx(Fi,{className:"spin","aria-hidden":"true"}):null,s("blocks.deployAgent")]})]}),w?a.jsx("p",{className:"delivery-card-error",role:"alert",children:w}):null,O?a.jsx("p",{className:"delivery-card-status",role:"status","aria-live":"polite",children:O.message}):null]}),a.jsx(a1,{project:{name:e.agentName,files:(c==null?void 0:c.files)??[]},open:d,onClose:()=>f(!1),onChange:()=>{},readOnly:!0}),a.jsx(a1,{project:{name:(g==null?void 0:g.target.agentName)??e.agentName,files:(g==null?void 0:g.target.files)??[]},comparison:g?{baseProject:{name:g.base.agentName,files:g.base.files??[]},baseLabel:s("blocks.beforeOptimization"),targetLabel:s("blocks.afterOptimization")}:void 0,open:h,onClose:()=>m(!1),onChange:()=>{},readOnly:!0})]})}function XLe({a2aStatus:e}){const{t}=Te("conversation");return e==="connecting"||e==="submitted"||e==="working"?a.jsx(GLe,{text:t(`blocks.a2a.${e}`)}):a.jsx(KLe,{text:"",done:!1})}const xNt=p.memo(function({text:t,streaming:n,onStreamFrame:i,onStreamComplete:r}){const s=WLe(t,n,i,r);return s?a.jsx("div",{className:"bubble",children:a.jsx(Td,{text:s,streaming:n})}):null});function wNt({title:e,summary:t,items:n,done:i}){const{t:r}=Te("conversation"),[s,o]=p.useState(!i),l=p.useRef(!1);p.useEffect(()=>{l.current||o(!i)},[i]);const c=()=>{l.current=!0,o(u=>!u)};return a.jsxs("div",{className:"block-plan",children:[a.jsxs("button",{className:"plan-head",type:"button",onClick:c,"aria-expanded":n.length>0?s:void 0,disabled:n.length===0,children:[a.jsx("span",{className:"plan-icon","aria-hidden":"true",children:a.jsx(gNt,{})}),i?a.jsx("span",{className:"plan-title",children:e}):a.jsx(fn,{className:"plan-title",duration:2.2,spread:15,children:e}),t?a.jsx("span",{className:"plan-summary",children:t}):null,n.length>0?a.jsx(aO,{className:`plan-chevron${s?" is-open":""}`}):null]}),a.jsx("div",{className:`think-collapse ${s&&n.length>0?"open":""}`,children:a.jsx("div",{className:"think-collapse-inner",children:n.length>0?a.jsx("ol",{className:"plan-items",children:n.map((u,d)=>a.jsxs("li",{"data-status":u.status,children:[a.jsx("span",{className:"plan-item-marker","aria-hidden":"true"}),a.jsx("span",{className:"plan-item-text",children:u.text}),a.jsx("small",{children:r(`blocks.planStatuses.${u.status}`)})]},`${d}:${u.text}`))}):null})})]})}function ONt(e){if(!e||typeof e!="object")return[];const t=e,n=t.result;let i=[];if(Array.isArray(t.studio_artifacts))i=t.studio_artifacts;else if(n&&typeof n=="object"){const r=n.studio_artifacts;Array.isArray(r)&&(i=r)}return i.flatMap(r=>{if(!r||typeof r!="object")return[];const s=r;return typeof s.name=="string"&&typeof s.contentUrl=="string"?[{name:s.name,contentUrl:s.contentUrl}]:[]})}function kNt({name:e,callId:t,args:n,response:i,done:r,status:s,defaultOpen:o=!1,retrying:l=!1,codexActivity:c,native:u=!1,progressText:d,source:f,onBranchSelect:h,onAction:m}){const{t:g}=Te("conversation"),v=e==="create_agents"&&r&&F_t(n,i)?"failed":s??(r?"completed":"running"),y=e==="create_agents"&&v==="failed"&&l,w=mq(e),x=w==null?void 0:w.detailRenderer,O=(w==null?void 0:w.hideHeader)===!0,k=O||o||!!x||!!c,[S,C]=p.useState(k),E=p.useRef(!1);p.useEffect(()=>{!E.current&&k&&C(!0)},[k]);const j=()=>{E.current=!0,C(P=>!P)},T=e===qLe?g("blocks.renderUi"):e,R=ONt(i);if((!w||!x)&&!c){const P=w?v==="failed"?g(`blocks.tools.${w.name}.failed`,{defaultValue:w.failedLabel??w.doneLabel}):v==="running"?g(`blocks.tools.${w.name}.running`,{defaultValue:w.runningLabel}):g(`blocks.tools.${w.name}.done`,{defaultValue:w.doneLabel}):void 0;return a.jsx(HLe,{input:{name:e,title:d9(e,n,g)??P,callId:t,args:n,response:i,done:r,status:v,defaultOpen:o,source:f},children:R.length>0?a.jsx("div",{className:"studio-tool-artifacts",children:R.map(I=>a.jsx("a",{href:I.contentUrl,download:I.name,children:g("blocks.downloadNamed",{name:I.name})},`${I.contentUrl}:${I.name}`))}):null})}const A=i==null?null:typeof i=="string"?i:JSON.stringify(i,null,2),N=!u&&A&&A.length>2e3?`${A.slice(0,2e3)} -${g("blocks.truncated")}`:A;return a.jsxs(Cr.div,{className:`block-tool${w?" block-tool--builtin":""}`,"data-status":v,initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[w&&!O?a.jsx(I_t,{definition:w,label:y?g("blocks.agentAdjusting"):v==="failed"?g(`blocks.tools.${w.name}.failed`,{defaultValue:w.failedLabel??w.doneLabel}):d9(e,n,g),done:r,open:S,onToggle:j}):w?null:a.jsxs("button",{className:"tool-head tool-head--generic",onClick:j,type:"button","aria-expanded":S,children:[a.jsx("span",{className:"tool-icon tool-icon--generic","aria-hidden":"true",children:u?a.jsx(IM,{kind:"tool"}):a.jsx(mNt,{})}),r?a.jsx("span",{className:"tool-name",children:T}):a.jsx(fn,{className:"tool-name",duration:2.2,spread:15,children:T}),u&&v==="failed"&&a.jsx("span",{className:"development-tool-failure",children:a.jsx(Nw,{ns:"adk",i18nKey:"developmentRuns.toolFailed"})}),a.jsx(aO,{className:`tool-chevron${S?" is-open":""}`})]}),a.jsx("div",{className:`${O?"":"think-collapse "}${S?"open":""}`,children:a.jsxs("div",{className:"think-collapse-inner",children:[c?a.jsxs("section",{className:"codex-sandbox-run","aria-label":g("blocks.sandboxDetails"),children:[a.jsxs("div",{className:"codex-sandbox-run__label",children:[a.jsxs("span",{className:"codex-sandbox-run__badge",children:[a.jsx(bNt,{}),a.jsx("span",{children:"Codex Sandbox"})]}),a.jsx("span",{className:"codex-sandbox-run__title",children:c.title})]}),a.jsx(yNt,{activity:c}),a.jsx("div",{className:"codex-sandbox-run__stream",children:c.items.length>0?a.jsx(y0,{blocks:c.items.map(P=>P.block),streaming:!r,onAction:m}):a.jsx(fn,{className:"codex-sandbox-run__empty",children:g("blocks.waitingCodex")})})]}):null,x?a.jsx(x,{args:n,response:i,status:v,onBranchSelect:h}):c?null:a.jsxs("div",{className:"tool-detail",children:[d&&a.jsx("div",{className:"development-tool-meta",children:d}),n!=null&&a.jsxs("div",{className:"tool-section",children:[a.jsx("div",{className:"tool-section-label",children:g("blocks.arguments")}),a.jsx("pre",{className:"tool-args",children:JSON.stringify(n,null,2)})]}),N!=null&&a.jsxs("div",{className:"tool-section",children:[a.jsx("div",{className:"tool-section-label",children:g("blocks.result")}),a.jsx("pre",{className:"tool-args tool-result",children:N})]}),R.length>0&&a.jsxs("div",{className:"tool-section",children:[a.jsx("div",{className:"tool-section-label",children:g("blocks.artifacts")}),a.jsx("div",{className:"studio-tool-artifacts",children:R.map(P=>a.jsx("a",{href:P.contentUrl,download:P.name,children:g("blocks.downloadNamed",{name:P.name})},`${P.contentUrl}:${P.name}`))})]})]})]})})]})}function SNt({block:e,onDownload:t,onPreview:n}){const{t:i}=Te("conversation"),[r,s]=p.useState(""),[o,l]=p.useState(""),[c,u]=p.useState(null);p.useEffect(()=>()=>{c&&URL.revokeObjectURL(c.url)},[c]);const d=()=>u(null),f=async(g,b)=>{if(t){s(`download:${g}`),l("");try{await t(g,b)}catch(v){l(v instanceof Error?v.message:String(v))}finally{s("")}}},h=async(g,b,v)=>{if(n){s(`preview:${v}`),l("");try{const y=await n(g,b);u({name:v,url:y})}catch(y){l(y instanceof Error?y.message:String(y))}finally{s("")}}},m=e.files.filter(g=>!g.filename.endsWith(".preview.webp"));return a.jsxs("div",{className:"artifact-list",children:[m.map(g=>{const b=`${g.filename.replace(/\.pptx$/i,"")}.preview.webp`,v=e.files.find(y=>y.filename===b);return a.jsxs("div",{className:"artifact-card",children:[a.jsx("span",{className:"artifact-card__icon","aria-hidden":"true",children:a.jsx(mV,{})}),a.jsxs("span",{className:"artifact-card__copy",children:[a.jsx("span",{className:"artifact-card__name",children:g.filename}),a.jsx("span",{className:"artifact-card__hint",children:i("blocks.powerpoint")})]}),a.jsxs("span",{className:"artifact-card__actions",children:[v&&a.jsxs("button",{className:"artifact-card__action",type:"button",disabled:!n||r!=="",onClick:()=>void h(v.filename,v.version,g.filename),children:[r===`preview:${g.filename}`?a.jsx(Fi,{className:"spin"}):a.jsx(Nat,{}),i("blocks.preview")]}),a.jsxs("button",{className:"artifact-card__action artifact-card__action--primary",type:"button",disabled:!t||r!=="",onClick:()=>void f(g.filename,g.version),children:[r===`download:${g.filename}`?a.jsx(Fi,{className:"spin"}):a.jsx(tM,{}),i("blocks.download")]})]})]},`${g.filename}:${g.version}`)}),o&&a.jsx("div",{className:"artifact-card__error",children:o}),c&&a.jsxs("div",{className:"artifact-preview",role:"dialog","aria-modal":"true","aria-label":i("blocks.previewDialog",{name:c.name}),children:[a.jsx("button",{className:"artifact-preview__backdrop",type:"button","aria-label":i("blocks.closePreview"),onClick:d}),a.jsxs("div",{className:"artifact-preview__panel",children:[a.jsxs("div",{className:"artifact-preview__header",children:[a.jsx("span",{children:c.name}),a.jsx("button",{type:"button","aria-label":i("blocks.closePreview"),onClick:d,children:a.jsx(Do,{})})]}),a.jsx("div",{className:"artifact-preview__canvas",children:a.jsx("img",{src:c.url,alt:i("blocks.slidePreview",{name:c.name})})})]})]})]})}function ENt({block:e,onAuth:t}){const{t:n}=Te("conversation"),[i,r]=p.useState(e.done?"done":"idle"),[s,o]=p.useState(""),l=e.label||n("blocks.mcpToolset"),c=(()=>{try{return e.authUri?new URL(e.authUri).host:""}catch{return""}})(),u=async()=>{if(t){o(""),r("authorizing");try{await t(e),r("done")}catch(f){o(f instanceof Error?f.message:String(f)),r("idle")}}};return e.done||i==="done"?a.jsxs(Cr.div,{className:"auth-card-collapsed",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},children:[a.jsx(GJ,{className:"auth-card-icon auth-card-icon--done"}),a.jsx("span",{children:n("blocks.authorized",{tool:l})})]}):a.jsxs(Cr.div,{className:"auth-card",initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[a.jsxs("div",{className:"auth-card-head",children:[a.jsx(GJ,{className:"auth-card-icon"}),a.jsx("span",{className:"auth-card-title",children:n("blocks.authorizationRequired",{tool:l})})]}),a.jsxs("p",{className:"auth-card-desc",children:[a.jsx(Nw,{t:n,i18nKey:"blocks.oauthDescription",values:{tool:l},components:{code:a.jsx("code",{className:"auth-card-code"})}}),c&&a.jsxs(a.Fragment,{children:[" ",a.jsx(Nw,{t:n,i18nKey:"blocks.oauthProvider",values:{provider:c},components:{code:a.jsx("code",{className:"auth-card-code"})}})," "]}),n("blocks.oauthContinue")]}),a.jsx("button",{className:"auth-card-btn",onClick:u,disabled:i==="authorizing"||!e.authUri,children:i==="authorizing"?a.jsxs(a.Fragment,{children:[a.jsx(Fi,{className:"cw-i spin"})," ",n("blocks.waitingAuthorization")]}):a.jsx(a.Fragment,{children:n("blocks.authorize")})}),!e.authUri&&a.jsx("div",{className:"auth-card-err",children:n("blocks.missingAuthorizationUrl")}),s&&a.jsx("div",{className:"auth-card-err",children:s})]})}function CNt(e,t,n){const i=mq(e.name),r=d9(e.name,e.args,n);if(r||!i)return r;const s=t==="failed"?"failed":t==="running"?"running":"done",o=t==="failed"?i.failedLabel??i.doneLabel:t==="running"?i.runningLabel:i.doneLabel;return n(`blocks.tools.${i.name}.${s}`,{defaultValue:o})}function Wne(e,t){const n=e.status??(e.done?"completed":"running");return{name:e.name,title:t?CNt(e,n,t):void 0,callId:e.callId,args:e.args,response:e.response,done:e.done,status:e.status,defaultOpen:e.defaultOpen,source:e.source}}function ANt(e,t){var s;const n=[];let i=[];const r=()=>{i.length&&(n.push(i.length>1?{kind:"tool-exploration",items:i.map(o=>Wne(o,t))}:i[0]),i=[])};for(const o of e){if(o.kind!=="tool"||(s=mq(o.name))!=null&&s.detailRenderer){r(),n.push(o);continue}const l=gq(Wne(o)),c=!i.length||i[i.length-1].source===o.source;if(Vne(l)&&c){i.push(o);continue}r(),Vne(l)?i.push(o):n.push(o)}return r(),n}function y0({groupProcess:e=!1,liveStatus:t,blocks:n,appName:i="",streaming:r=!1,onStreamFrame:s,onStreamComplete:o,onAction:l,onAuth:c,onArtifactDownload:u,onArtifactPreview:d,onResolveDelivery:f,onResolveDeliveryComparison:h,onDownloadDelivery:m,onDeployDelivery:g,onBranchSelect:b}){if(e)return a.jsx(w_t,{blocks:n,active:r,status:t,render:x=>a.jsx(y0,{blocks:x,appName:i,streaming:r,onStreamFrame:s,onStreamComplete:o,onAction:l,onAuth:c,onArtifactDownload:u,onArtifactPreview:d,onResolveDelivery:f,onResolveDeliveryComparison:h,onDownloadDelivery:m,onDeployDelivery:g,onBranchSelect:b})});const{t:v}=Te("conversation"),y=ANt(Oot(n),v),w=y.reduce((x,O,k)=>O.kind==="text"?k:x,-1);return a.jsx(a.Fragment,{children:y.map((x,O)=>{switch(x.kind){case"turn-summary":return a.jsx(v_t,{value:x.value},x.id||O);case"diff":return a.jsxs("details",{className:"development-diff",children:[a.jsxs("summary",{children:[a.jsx("span",{className:"tool-icon",children:a.jsx(IM,{kind:"diff"})}),a.jsx("span",{children:a.jsx(Nw,{ns:"adk",i18nKey:"developmentRuns.diff"})}),a.jsx(aO,{className:"tool-chevron"})]}),a.jsx("pre",{children:x.text})]},x.id??O);case"progress":return a.jsx(GLe,{text:x.text},"build-progress");case"activity-source":return a.jsx("div",{className:"tool-activity-source",children:x.label},`${O}:${x.label}`);case"tool-exploration":return a.jsx(uNt,{items:x.items},`exploration:${O}`);case"thinking":{const k=y.slice(O+1).some(S=>S.kind==="text"&&!!S.text.trim());return a.jsx(KLe,{text:x.text,done:x.done,thoughtKind:x.thoughtKind,answerStarted:k,streaming:r,onStreamFrame:s},x.id??O)}case"text":{const k=x.text.replace(/^\s+/,"");return k?a.jsx(xNt,{text:k,streaming:r,onStreamFrame:s,onStreamComplete:O===w?o:void 0},x.id??O):null}case"plan":return a.jsx(wNt,{title:x.title,summary:x.summary,items:x.items,done:x.done},x.id??O);case"attachment":return a.jsx(DM,{appName:i,items:x.files},x.id??O);case"artifact":return a.jsx(SNt,{block:x,onDownload:u,onPreview:d},x.id??O);case"delivery":return a.jsx(vNt,{value:x.value,onResolve:f,onResolveComparison:h,onDownload:m,onDeploy:g},x.id??O);case"invocation":return a.jsx(PM,{value:x.value},x.id??O);case"tool":{if(x.name===qLe&&x.done)return null;const k=x.name==="create_agents"&&y.slice(O+1).some(S=>S.kind==="tool"&&S.name==="create_agents");return a.jsx(kNt,{name:x.itemType?V2e(x):x.name,callId:x.callId,native:!!x.itemType,progressText:x.progressText,args:x.args,response:x.response,done:x.done,status:x.status,defaultOpen:x.defaultOpen,retrying:x.name==="create_agents"&&(r||k),codexActivity:x.codexActivity,source:x.source,onBranchSelect:b,onAction:l},x.id??O)}case"agent-transfer":return null;case"auth":return a.jsx(ENt,{block:x,onAuth:c},x.id??O);case"a2ui":return dLe(x.messages).filter(k=>k.components[k.rootId]).map(k=>a.jsx(Cr.div,{initial:{opacity:0,y:8,scale:.985},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:380,damping:30},children:a.jsx(j_t,{surface:k,onAction:l})},`${O}-${k.surfaceId}`));default:return null}})})}const TNt=()=>{};function _Nt(e){if(e.kind==="message")return{kind:"text",text:e.text};if(e.kind==="thinking")return{kind:"thinking",text:e.text,done:e.status==="done"};if(e.kind==="tool")return{kind:"tool",name:e.name,args:e.args,response:e.response,done:e.status==="done"};throw new Error(en("conversation.unsupportedActivity"))}function jNt({activities:e}){const{t}=Te("skills"),n=p.useMemo(()=>e.filter(i=>i.kind!=="status").map(_Nt),[e]);return n.length===0?null:a.jsx("div",{className:"skill-conversation","aria-label":t("conversation.ariaLabel"),"aria-live":"polite",children:a.jsx(y0,{blocks:n,onAction:TNt})})}function Kne(){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m7 9 5 5 5-5",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}function RN({label:e,value:t,options:n,onChange:i,disabled:r=!1,allowCustom:s=!1,required:o=!1,placeholder:l,error:c}){const{t:u}=Te("skills"),d=l??u("configSelect.placeholder"),f=p.useId(),h=p.useId(),m=p.useId(),g=p.useRef(null),b=p.useRef(null),v=p.useRef(null),y=p.useRef(null),w=p.useRef([]),x=n.findIndex(I=>I.value===t),O=t.trim().toLocaleLowerCase(),k=s&&O?n.filter(I=>I.value.toLocaleLowerCase().includes(O)||I.label.toLocaleLowerCase().includes(O)):n,[S,C]=p.useState(!1),[E,j]=p.useState(Math.max(0,x)),T=x>=0?n[x]:void 0,R=r||!s&&n.length===0,A=(I=!1)=>{C(!1),I&&window.requestAnimationFrame(()=>{var D,_;return s?(D=v.current)==null?void 0:D.focus():(_=b.current)==null?void 0:_.focus()})},N=I=>{R||k.length!==0&&(j(Math.min(Math.max(I,0),k.length-1)),C(!0))};p.useEffect(()=>{if(!S)return;const I=y.current,D=s?void 0:window.requestAnimationFrame(()=>{var M;(M=w.current[E])==null||M.focus()}),_=M=>{if(!I)return;const V=I.scrollTop<=0,q=I.scrollTop+I.clientHeight>=I.scrollHeight-1;(I.scrollHeight<=I.clientHeight||M.deltaY<0&&V||M.deltaY>0&&q)&&M.preventDefault(),M.stopPropagation()},L=M=>{var V;M.target instanceof Node&&!((V=g.current)!=null&&V.contains(M.target))&&A()},F=M=>{M.key==="Escape"&&A(!0)};return I==null||I.addEventListener("wheel",_,{passive:!1}),window.addEventListener("pointerdown",L),window.addEventListener("keydown",F),()=>{D!==void 0&&window.cancelAnimationFrame(D),I==null||I.removeEventListener("wheel",_),window.removeEventListener("pointerdown",L),window.removeEventListener("keydown",F)}},[E,s,S]);const P=I=>{var _;if(k.length===0)return;const D=(I+k.length)%k.length;j(D),(_=w.current[D])==null||_.focus()};return a.jsxs("div",{ref:g,className:`skill-config-select${S?" is-open":""}`,onBlur:I=>{var D;(!I.relatedTarget||!((D=g.current)!=null&&D.contains(I.relatedTarget)))&&A()},children:[a.jsxs("span",{id:h,className:"skill-config-select__label",children:[e,o?a.jsx("span",{className:"skill-required-mark","aria-hidden":"true",children:"*"}):null]}),s?a.jsxs("div",{className:`skill-config-select__trigger is-editable${r?" is-disabled":""}`,"aria-expanded":S,children:[a.jsx("input",{ref:v,value:t,disabled:r,role:"combobox","aria-autocomplete":"list","aria-expanded":S,"aria-controls":S?f:void 0,"aria-labelledby":h,"aria-required":o,"aria-invalid":!!c,"aria-describedby":c?m:void 0,placeholder:d,onChange:I=>{i(I.target.value),j(0),n.length>0&&C(!0)},onClick:()=>{!S&&k.length>0&&N(0)},onKeyDown:I=>{var D,_;if(!(I.nativeEvent.isComposing||I.keyCode===229))if(I.key==="ArrowDown")I.preventDefault(),S?(D=w.current[E])==null||D.focus():N(0);else if(I.key==="ArrowUp")I.preventDefault(),S?(_=w.current[k.length-1])==null||_.focus():N(k.length-1);else if(I.key==="Enter"&&S){I.preventDefault();const L=k[E];L&&i(L.value),A()}else I.key==="Escape"&&(I.preventDefault(),A())}}),a.jsx("button",{type:"button",className:"skill-config-select__toggle",disabled:r||n.length===0,"aria-label":u(S?"configSelect.collapseOptions":"configSelect.expandOptions"),onClick:()=>{S?A():N(0)},children:a.jsx(Kne,{})})]}):a.jsxs("button",{ref:b,type:"button",className:"skill-config-select__trigger",disabled:R,"aria-haspopup":"listbox","aria-expanded":S,"aria-controls":S?f:void 0,"aria-labelledby":h,"aria-required":o,onClick:()=>{S?A():N(x>=0?x:0)},onKeyDown:I=>{I.key==="ArrowDown"?(I.preventDefault(),N(x>=0?x:0)):I.key==="ArrowUp"&&(I.preventDefault(),N(x>=0?x:n.length-1))},children:[a.jsx("span",{className:T?void 0:"is-placeholder",title:T==null?void 0:T.label,children:(T==null?void 0:T.label)||(n.length===0?u("configSelect.noOptions"):d)}),a.jsx(Kne,{})]}),S?a.jsxs("div",{ref:y,id:f,className:"skill-config-select__menu",role:"listbox","aria-labelledby":h,children:[k.length===0?a.jsx("div",{className:"skill-config-select__empty",role:"status",children:u("configSelect.noMatches")}):null,k.map((I,D)=>{const _=I.value===t;return a.jsx("button",{ref:L=>{w.current[D]=L},type:"button",role:"option","aria-selected":_,tabIndex:D===E?0:-1,className:`skill-config-select__option${_?" is-selected":""}`,title:I.label,onFocus:()=>j(D),onClick:()=>{i(I.value),A(!0)},onKeyDown:L=>{L.key==="Enter"||L.key===" "?(L.preventDefault(),i(I.value),A(!0)):L.key==="ArrowDown"?(L.preventDefault(),P(D+1)):L.key==="ArrowUp"?(L.preventDefault(),P(D-1)):L.key==="Home"?(L.preventDefault(),P(0)):L.key==="End"&&(L.preventDefault(),P(n.length-1))},children:I.label},I.value)})]}):null,c?a.jsx("span",{id:m,className:"skill-config-select__error",role:"alert",children:c}):null]})}function Pr(e,t){return e instanceof Error?e:typeof e=="string"&&e.trim()?new Error(e.trim()):new Error(t)}function Ns({error:e}){var s,o,l,c,u;const{t}=Te("skills"),n=e,i=(o=(s=n.originalError)==null?void 0:s.message)==null?void 0:o.trim(),r=[typeof n.status=="number"?`HTTP ${n.status}${n.statusText?` ${n.statusText}`:""}`:"",n.code?t("errorDetails.code",{code:n.code}):"",(l=n.originalError)!=null&&l.type?t("errorDetails.type",{type:n.originalError.type}):"",(c=n.originalError)!=null&&c.repr&&n.originalError.repr!==i?t("errorDetails.representation",{value:n.originalError.repr}):"",(u=n.rawResponse)!=null&&u.trim()?t("errorDetails.rawResponse",{value:n.rawResponse.trim()}):""].filter(Boolean);return a.jsxs("div",{className:"skill-error-details",children:[a.jsx("div",{className:"skill-error-details__summary",children:e.message}),i?a.jsx("div",{className:"skill-error-details__original",children:t("errorDetails.original",{message:i})}):null,r.length>0?a.jsxs("details",{children:[a.jsx("summary",{children:t("errorDetails.details")}),a.jsx("pre",{children:r.join(` -`)})]}):null]})}const yq=Symbol.for("yaml.alias"),f9=Symbol.for("yaml.document"),$g=Symbol.for("yaml.map"),YLe=Symbol.for("yaml.pair"),Eh=Symbol.for("yaml.scalar"),oO=Symbol.for("yaml.seq"),_d=Symbol.for("yaml.node.type"),lO=e=>!!e&&typeof e=="object"&&e[_d]===yq,wT=e=>!!e&&typeof e=="object"&&e[_d]===f9,OT=e=>!!e&&typeof e=="object"&&e[_d]===$g,ja=e=>!!e&&typeof e=="object"&&e[_d]===YLe,xs=e=>!!e&&typeof e=="object"&&e[_d]===Eh,kT=e=>!!e&&typeof e=="object"&&e[_d]===oO;function Ca(e){if(e&&typeof e=="object")switch(e[_d]){case $g:case oO:return!0}return!1}function _a(e){if(e&&typeof e=="object")switch(e[_d]){case yq:case $g:case Eh:case oO:return!0}return!1}const ZLe=e=>(xs(e)||Ca(e))&&!!e.anchor,gy=Symbol("break visit"),NNt=Symbol("skip children"),gE=Symbol("remove node");function cO(e,t){const n=RNt(t);wT(e)?Mx(null,e.contents,n,Object.freeze([e]))===gE&&(e.contents=null):Mx(null,e,n,Object.freeze([]))}cO.BREAK=gy;cO.SKIP=NNt;cO.REMOVE=gE;function Mx(e,t,n,i){const r=INt(e,t,n,i);if(_a(r)||ja(r))return PNt(e,i,r),Mx(e,r,n,i);if(typeof r!="symbol"){if(Ca(t)){i=Object.freeze(i.concat(t));for(let s=0;se.replace(/[!,[\]{}]/g,t=>DNt[t]);class Xl{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Xl.defaultYaml,t),this.tags=Object.assign({},Xl.defaultTags,n)}clone(){const t=new Xl(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Xl(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Xl.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Xl.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Xl.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Xl.defaultTags),this.atNextDocument=!1);const i=t.trim().split(/[ \t]+/),r=i.shift();switch(r){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;const[s,o]=i;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[s]=i;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{const o=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,o),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const o=t.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,i,r]=t.match(/^(.*!)([^!]*)$/s);r||n(`The ${t} tag has no suffix`);const s=this.tags[i];if(s)try{return s+decodeURIComponent(r)}catch(o){return n(String(o)),null}return i==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,i]of Object.entries(this.tags))if(t.startsWith(i))return n+MNt(t.substring(i.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags);let r;if(t&&i.length>0&&_a(t.contents)){const s={};cO(t.contents,(o,l)=>{_a(l)&&l.tag&&(s[l.tag]=!0)}),r=Object.keys(s)}else r=[];for(const[s,o]of i)s==="!!"&&o==="tag:yaml.org,2002:"||(!t||r.some(l=>l.startsWith(o)))&&n.push(`%TAG ${s} ${o}`);return n.join(` -`)}}Xl.defaultYaml={explicit:!1,version:"1.2"};Xl.defaultTags={"!!":"tag:yaml.org,2002:"};function JLe(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function e5e(e){const t=new Set;return cO(e,{Value(n,i){i.anchor&&t.add(i.anchor)}}),t}function t5e(e,t){for(let n=1;;++n){const i=`${e}${n}`;if(!t.has(i))return i}}function LNt(e,t){const n=[],i=new Map;let r=null;return{onAnchor:s=>{n.push(s),r??(r=e5e(e));const o=t5e(t,r);return r.add(o),o},setAnchors:()=>{for(const s of n){const o=i.get(s);if(typeof o=="object"&&o.anchor&&(xs(o.node)||Ca(o.node)))o.node.anchor=o.anchor;else{const l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=s,l}}},sourceObjects:i}}function Lx(e,t,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,s=i.length;rkd(i,String(r),n));if(e&&typeof e.toJSON=="function"){if(!n||!ZLe(e))return e.toJSON(t,n);const i={aliasCount:0,count:1,res:void 0};n.anchors.set(e,i),n.onCreate=s=>{i.res=s,delete n.onCreate};const r=e.toJSON(t,n);return n.onCreate&&n.onCreate(r),r}return typeof e=="bigint"&&!(n!=null&&n.keep)?Number(e):e}class vq{constructor(t){Object.defineProperty(this,_d,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:s}={}){if(!wT(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=kd(this,"",o);if(typeof r=="function")for(const{count:c,res:u}of o.anchors.values())r(u,c);return typeof s=="function"?Lx(s,{"":l},"",l):l}}let xq=class extends vq{constructor(t){super(yq),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if((n==null?void 0:n.maxAliasCount)===0)throw new ReferenceError("Alias resolution is disabled");let i;n!=null&&n.aliasResolveCache?i=n.aliasResolveCache:(i=[],cO(t,{Node:(s,o)=>{(lO(o)||ZLe(o))&&i.push(o)}}),n&&(n.aliasResolveCache=i));let r;for(const s of i){if(s===this)break;s.anchor===this.source&&(r=s)}return r}toJSON(t,n){if(!n)return{source:this.source};const{anchors:i,doc:r,maxAliasCount:s}=n,o=this.resolve(r,n);if(!o){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let l=i.get(o);if(l||(kd(o,null,n),l=i.get(o)),(l==null?void 0:l.res)===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(s>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=IN(r,o,i)),l.count*l.aliasCount>s)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return l.res}toString(t,n,i){const r=`*${this.source}`;if(t){if(JLe(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(t.implicitKey)return`${r} `}return r}};function IN(e,t,n){if(lO(t)){const i=t.resolve(e),r=n&&i&&n.get(i);return r?r.count*r.aliasCount:0}else if(Ca(t)){let i=0;for(const r of t.items){const s=IN(e,r,n);s>i&&(i=s)}return i}else if(ja(t)){const i=IN(e,t.key,n),r=IN(e,t.value,n);return Math.max(i,r)}return 1}const n5e=e=>!e||typeof e!="function"&&typeof e!="object";class wi extends vq{constructor(t){super(Eh),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:kd(this.value,t,n)}toString(){return String(this.value)}}wi.BLOCK_FOLDED="BLOCK_FOLDED";wi.BLOCK_LITERAL="BLOCK_LITERAL";wi.PLAIN="PLAIN";wi.QUOTE_DOUBLE="QUOTE_DOUBLE";wi.QUOTE_SINGLE="QUOTE_SINGLE";const $Nt="tag:yaml.org,2002:";function FNt(e,t,n){if(t){const i=n.filter(s=>s.tag===t),r=i.find(s=>!s.format)??i[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return n.find(i=>{var r;return((r=i.identify)==null?void 0:r.call(i,e))&&!i.format})}function _C(e,t,n){var f,h,m;if(wT(e)&&(e=e.contents),_a(e))return e;if(ja(e)){const g=(h=(f=n.schema[$g]).createNode)==null?void 0:h.call(f,n.schema,null,n);return g.items.push(e),g}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:i,onAnchor:r,onTagObj:s,schema:o,sourceObjects:l}=n;let c;if(i&&e&&typeof e=="object"){if(c=l.get(e),c)return c.anchor??(c.anchor=r(e)),new xq(c.anchor);c={anchor:null,node:null},l.set(e,c)}t!=null&&t.startsWith("!!")&&(t=$Nt+t.slice(2));let u=FNt(e,t,o.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const g=new wi(e);return c&&(c.node=g),g}u=e instanceof Map?o[$g]:Symbol.iterator in Object(e)?o[oO]:o[$g]}s&&(s(u),delete n.onTagObj);const d=u!=null&&u.createNode?u.createNode(n.schema,e,n):typeof((m=u==null?void 0:u.nodeClass)==null?void 0:m.from)=="function"?u.nodeClass.from(n.schema,e,n):new wi(e);return t?d.tag=t:u.default||(d.tag=u.tag),c&&(c.node=d),d}function MI(e,t,n){let i=n;for(let r=t.length-1;r>=0;--r){const s=t[r];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){const o=[];o[s]=i,i=o}else i=new Map([[s,i]])}return _C(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const mS=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class i5e extends vq{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(i=>_a(i)||ja(i)?i.clone(t):i),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(mS(t))this.add(n);else{const[i,...r]=t,s=this.get(i,!0);if(Ca(s))s.addIn(r,n);else if(s===void 0&&this.schema)this.set(i,MI(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}deleteIn(t){const[n,...i]=t;if(i.length===0)return this.delete(n);const r=this.get(n,!0);if(Ca(r))return r.deleteIn(i);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(t,n){const[i,...r]=t,s=this.get(i,!0);return r.length===0?!n&&xs(s)?s.value:s:Ca(s)?s.getIn(r,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!ja(n))return!1;const i=n.value;return i==null||t&&xs(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(t){const[n,...i]=t;if(i.length===0)return this.has(n);const r=this.get(n,!0);return Ca(r)?r.hasIn(i):!1}setIn(t,n){const[i,...r]=t;if(r.length===0)this.set(i,n);else{const s=this.get(i,!0);if(Ca(s))s.setIn(r,n);else if(s===void 0&&this.schema)this.set(i,MI(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}}const BNt=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Ep(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Ry=(e,t,n)=>e.endsWith(` -`)?Ep(n,t):n.includes(` +`),h=KLe(f,!t||r,s),{ref:m,onScroll:g}=hLe(h);return a.jsxs("div",{className:"block-thinking",children:[a.jsxs("button",{className:"think-head",onClick:d,type:"button",children:[a.jsx("span",{className:"think-icon","aria-hidden":"true",children:a.jsx(uq,{className:`thinking-logo ${t?"":"is-active"}`})}),t?a.jsx("span",{className:"think-label think-label--done",children:o(n==="reasoning"?"blocks.reasoningDone":"blocks.thinkingDone")}):a.jsx(cn,{className:"think-label",duration:2.4,spread:18,children:o(n==="reasoning"?"blocks.reasoning":"blocks.thinking")}),a.jsx(qA,{className:`chev ${l?"open":""}`})]}),a.jsx("div",{className:`think-collapse ${l&&h?"open":""}`,children:a.jsx("div",{className:"think-collapse-inner",children:a.jsx("div",{className:"think-body scroll",ref:m,onScroll:g,children:h})})})]})}function XLe({text:e}){return a.jsx("div",{className:"block-progress",role:"status","aria-live":"polite","aria-atomic":"true",children:a.jsxs("div",{className:"think-head progress-head",children:[a.jsx("span",{className:"think-icon","aria-hidden":"true",children:a.jsx(uq,{className:"thinking-logo is-active"})}),a.jsx(cn,{className:"think-label",duration:2.4,spread:18,children:e})]})})}function wNt({value:e,onResolve:t,onResolveComparison:n,onDownload:i,onDeploy:r}){const{t:s,i18n:o}=Te("conversation"),l=N=>N.split(new RegExp("(?<=[/_-])")).map((D,I)=>a.jsxs(p.Fragment,{children:[D,a.jsx("wbr",{})]},`${I}:${D}`)),[c,u]=p.useState(e.files?e:null),[d,f]=p.useState(!1),[h,m]=p.useState(!1),[g,b]=p.useState(null),[v,y]=p.useState(null),[w,x]=p.useState(""),[O,k]=p.useState(null),S=new Date(e.validatedAt),C=e.validatedAt?Number.isNaN(S.getTime())?e.validatedAt:S.toLocaleString(o.resolvedLanguage??o.language,{hour12:!1}):s("blocks.justNow");p.useEffect(()=>{if(!O)return;const N=window.setTimeout(()=>k(null),pNt);return()=>window.clearTimeout(N)},[O]);async function E(){if(c)return c;if(!t)throw new Error(s("blocks.sourceUnavailable"));const N=await t(e);return u(N),N}async function j(){y("source"),x(""),k(null);try{await E(),f(!0)}catch(N){x(N instanceof Error?N.message:String(N))}finally{y(null)}}async function T(){if(i){y("download"),x(""),k(null);try{await i(e),k({message:s("blocks.downloadStarted")})}catch(N){x(N instanceof Error?N.message:String(N))}finally{y(null)}}}async function R(){if(n){y("compare"),x(""),k(null);try{const N=g??await n(e);b(N),m(!0)}catch(N){x(N instanceof Error?N.message:String(N))}finally{y(null)}}}async function A(){y("deploy"),x(""),k(null);try{r==null||r(await E())}catch(N){x(N instanceof Error?N.message:String(N))}finally{y(null)}}return a.jsxs(a.Fragment,{children:[a.jsxs("section",{className:`delivery-card${e.verified?" is-verified":" is-unverified"}`,"aria-label":e.verified?s("blocks.verifiedDelivery"):s("blocks.generatedSource"),children:[a.jsxs("header",{className:"delivery-card-header",children:[a.jsx("span",{className:"delivery-card-icon",children:e.verified?a.jsx(_jt,{}):a.jsx(Tjt,{})}),a.jsxs("div",{className:"delivery-card-heading",children:[a.jsx("strong",{children:l(e.agentName)}),a.jsx("span",{children:e.verified?s("blocks.verifiedDelivery"):s("blocks.generatedSource")})]})]}),a.jsxs("dl",{className:"delivery-card-grid",children:[a.jsxs("div",{className:"delivery-card-entry",children:[a.jsx("dt",{children:s("blocks.entryPoint")}),a.jsx("dd",{children:a.jsx("code",{children:l(e.entryPoint)})})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("blocks.fileCount")}),a.jsx("dd",{children:e.fileCount})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("blocks.size")}),a.jsxs("dd",{children:[(e.artifactSize/1024).toFixed(1)," KiB"]})]}),a.jsxs("div",{className:"delivery-card-time",children:[a.jsx("dt",{children:e.verified?s("blocks.validationTime"):s("blocks.generationTime")}),a.jsx("dd",{children:C})]})]}),a.jsxs("p",{className:"delivery-card-gates",children:[e.verified?s("blocks.checksPassed",{count:e.gateSummary.length}):s("blocks.sourceReady")," ","· ",a.jsx("code",{children:e.artifactSha256.slice(0,12)})]}),e.verified?null:a.jsx("p",{className:"delivery-card-guidance",children:s("blocks.sourceGuidance")}),a.jsxs("div",{className:"delivery-card-actions",children:[a.jsxs("div",{className:"delivery-card-secondary-actions",children:[a.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void j(),disabled:!t||v!==null,children:[v==="source"?a.jsx(Bi,{className:"spin","aria-hidden":"true"}):null,s("blocks.viewSource")]}),e.projectId&&e.versionId&&e.parentVersionId?a.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void R(),disabled:!n||v!==null,children:[v==="compare"?a.jsx(Bi,{className:"spin","aria-hidden":"true"}):null,s(v==="compare"?"blocks.preparing":"blocks.viewChanges")]}):null,a.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void T(),disabled:!i||v!==null,"aria-busy":v==="download",children:[v==="download"?a.jsx(Bi,{className:"spin","aria-hidden":"true"}):null,s(v==="download"?"blocks.preparing":"blocks.downloadSource")]})]}),a.jsxs("button",{type:"button",className:"delivery-card-primary",onClick:()=>void A(),disabled:!e.deployable||!r||!t||v!==null,title:e.deployable?s("blocks.manualDeploy"):s("blocks.sourceNotReady"),children:[v==="deploy"?a.jsx(Bi,{className:"spin","aria-hidden":"true"}):null,s("blocks.deployAgent")]})]}),w?a.jsx("p",{className:"delivery-card-error",role:"alert",children:w}):null,O?a.jsx("p",{className:"delivery-card-status",role:"status","aria-live":"polite",children:O.message}):null]}),a.jsx(o1,{project:{name:e.agentName,files:(c==null?void 0:c.files)??[]},open:d,onClose:()=>f(!1),onChange:()=>{},readOnly:!0}),a.jsx(o1,{project:{name:(g==null?void 0:g.target.agentName)??e.agentName,files:(g==null?void 0:g.target.files)??[]},comparison:g?{baseProject:{name:g.base.agentName,files:g.base.files??[]},baseLabel:s("blocks.beforeOptimization"),targetLabel:s("blocks.afterOptimization")}:void 0,open:h,onClose:()=>m(!1),onChange:()=>{},readOnly:!0})]})}function YLe({a2aStatus:e}){const{t}=Te("conversation");return e==="connecting"||e==="submitted"||e==="working"?a.jsx(XLe,{text:t(`blocks.a2a.${e}`)}):a.jsx(GLe,{text:"",done:!1})}const ONt=p.memo(function({text:t,streaming:n,onStreamFrame:i,onStreamComplete:r}){const s=KLe(t,n,i,r);return s?a.jsx("div",{className:"bubble",children:a.jsx(jd,{text:s,streaming:n})}):null});function kNt({title:e,summary:t,items:n,done:i}){const{t:r}=Te("conversation"),[s,o]=p.useState(!i),l=p.useRef(!1);p.useEffect(()=>{l.current||o(!i)},[i]);const c=()=>{l.current=!0,o(u=>!u)};return a.jsxs("div",{className:"block-plan",children:[a.jsxs("button",{className:"plan-head",type:"button",onClick:c,"aria-expanded":n.length>0?s:void 0,disabled:n.length===0,children:[a.jsx("span",{className:"plan-icon","aria-hidden":"true",children:a.jsx(yNt,{})}),i?a.jsx("span",{className:"plan-title",children:e}):a.jsx(cn,{className:"plan-title",duration:2.2,spread:15,children:e}),t?a.jsx("span",{className:"plan-summary",children:t}):null,n.length>0?a.jsx(oO,{className:`plan-chevron${s?" is-open":""}`}):null]}),a.jsx("div",{className:`think-collapse ${s&&n.length>0?"open":""}`,children:a.jsx("div",{className:"think-collapse-inner",children:n.length>0?a.jsx("ol",{className:"plan-items",children:n.map((u,d)=>a.jsxs("li",{"data-status":u.status,children:[a.jsx("span",{className:"plan-item-marker","aria-hidden":"true"}),a.jsx("span",{className:"plan-item-text",children:u.text}),a.jsx("small",{children:r(`blocks.planStatuses.${u.status}`)})]},`${d}:${u.text}`))}):null})})]})}function SNt(e){if(!e||typeof e!="object")return[];const t=e,n=t.result;let i=[];if(Array.isArray(t.studio_artifacts))i=t.studio_artifacts;else if(n&&typeof n=="object"){const r=n.studio_artifacts;Array.isArray(r)&&(i=r)}return i.flatMap(r=>{if(!r||typeof r!="object")return[];const s=r;return typeof s.name=="string"&&typeof s.contentUrl=="string"?[{name:s.name,contentUrl:s.contentUrl}]:[]})}function ENt({name:e,callId:t,args:n,response:i,done:r,status:s,defaultOpen:o=!1,retrying:l=!1,codexActivity:c,native:u=!1,progressText:d,source:f,onBranchSelect:h,onAction:m}){const{t:g}=Te("conversation"),v=e==="create_agents"&&r&&U_t(n,i)?"failed":s??(r?"completed":"running"),y=e==="create_agents"&&v==="failed"&&l,w=gq(e),x=w==null?void 0:w.detailRenderer,O=(w==null?void 0:w.hideHeader)===!0,k=O||o||!!x||!!c,[S,C]=p.useState(k),E=p.useRef(!1);p.useEffect(()=>{!E.current&&k&&C(!0)},[k]);const j=()=>{E.current=!0,C(D=>!D)},T=e===WLe?g("blocks.renderUi"):e,R=SNt(i);if((!w||!x)&&!c){const D=w?v==="failed"?g(`blocks.tools.${w.name}.failed`,{defaultValue:w.failedLabel??w.doneLabel}):v==="running"?g(`blocks.tools.${w.name}.running`,{defaultValue:w.runningLabel}):g(`blocks.tools.${w.name}.done`,{defaultValue:w.doneLabel}):void 0;return a.jsx(qLe,{input:{name:e,title:f9(e,n,g)??D,callId:t,args:n,response:i,done:r,status:v,defaultOpen:o,source:f},children:R.length>0?a.jsx("div",{className:"studio-tool-artifacts",children:R.map(I=>a.jsx("a",{href:I.contentUrl,download:I.name,children:g("blocks.downloadNamed",{name:I.name})},`${I.contentUrl}:${I.name}`))}):null})}const A=i==null?null:typeof i=="string"?i:JSON.stringify(i,null,2),N=!u&&A&&A.length>2e3?`${A.slice(0,2e3)} +${g("blocks.truncated")}`:A;return a.jsxs(Cr.div,{className:`block-tool${w?" block-tool--builtin":""}`,"data-status":v,initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[w&&!O?a.jsx(D_t,{definition:w,label:y?g("blocks.agentAdjusting"):v==="failed"?g(`blocks.tools.${w.name}.failed`,{defaultValue:w.failedLabel??w.doneLabel}):f9(e,n,g),done:r,open:S,onToggle:j}):w?null:a.jsxs("button",{className:"tool-head tool-head--generic",onClick:j,type:"button","aria-expanded":S,children:[a.jsx("span",{className:"tool-icon tool-icon--generic","aria-hidden":"true",children:u?a.jsx(IM,{kind:"tool"}):a.jsx(bNt,{})}),r?a.jsx("span",{className:"tool-name",children:T}):a.jsx(cn,{className:"tool-name",duration:2.2,spread:15,children:T}),u&&v==="failed"&&a.jsx("span",{className:"development-tool-failure",children:a.jsx(Rw,{ns:"adk",i18nKey:"developmentRuns.toolFailed"})}),a.jsx(oO,{className:`tool-chevron${S?" is-open":""}`})]}),a.jsx("div",{className:`${O?"":"think-collapse "}${S?"open":""}`,children:a.jsxs("div",{className:"think-collapse-inner",children:[c?a.jsxs("section",{className:"codex-sandbox-run","aria-label":g("blocks.sandboxDetails"),children:[a.jsxs("div",{className:"codex-sandbox-run__label",children:[a.jsxs("span",{className:"codex-sandbox-run__badge",children:[a.jsx(vNt,{}),a.jsx("span",{children:"Codex Sandbox"})]}),a.jsx("span",{className:"codex-sandbox-run__title",children:c.title})]}),a.jsx(xNt,{activity:c}),a.jsx("div",{className:"codex-sandbox-run__stream",children:c.items.length>0?a.jsx(v0,{blocks:c.items.map(D=>D.block),streaming:!r,onAction:m}):a.jsx(cn,{className:"codex-sandbox-run__empty",children:g("blocks.waitingCodex")})})]}):null,x?a.jsx(x,{args:n,response:i,status:v,onBranchSelect:h}):c?null:a.jsxs("div",{className:"tool-detail",children:[d&&a.jsx("div",{className:"development-tool-meta",children:d}),n!=null&&a.jsxs("div",{className:"tool-section",children:[a.jsx("div",{className:"tool-section-label",children:g("blocks.arguments")}),a.jsx("pre",{className:"tool-args",children:JSON.stringify(n,null,2)})]}),N!=null&&a.jsxs("div",{className:"tool-section",children:[a.jsx("div",{className:"tool-section-label",children:g("blocks.result")}),a.jsx("pre",{className:"tool-args tool-result",children:N})]}),R.length>0&&a.jsxs("div",{className:"tool-section",children:[a.jsx("div",{className:"tool-section-label",children:g("blocks.artifacts")}),a.jsx("div",{className:"studio-tool-artifacts",children:R.map(D=>a.jsx("a",{href:D.contentUrl,download:D.name,children:g("blocks.downloadNamed",{name:D.name})},`${D.contentUrl}:${D.name}`))})]})]})]})})]})}function CNt({block:e,onDownload:t,onPreview:n}){const{t:i}=Te("conversation"),[r,s]=p.useState(""),[o,l]=p.useState(""),[c,u]=p.useState(null);p.useEffect(()=>()=>{c&&URL.revokeObjectURL(c.url)},[c]);const d=()=>u(null),f=async(g,b)=>{if(t){s(`download:${g}`),l("");try{await t(g,b)}catch(v){l(v instanceof Error?v.message:String(v))}finally{s("")}}},h=async(g,b,v)=>{if(n){s(`preview:${v}`),l("");try{const y=await n(g,b);u({name:v,url:y})}catch(y){l(y instanceof Error?y.message:String(y))}finally{s("")}}},m=e.files.filter(g=>!g.filename.endsWith(".preview.webp"));return a.jsxs("div",{className:"artifact-list",children:[m.map(g=>{const b=`${g.filename.replace(/\.pptx$/i,"")}.preview.webp`,v=e.files.find(y=>y.filename===b);return a.jsxs("div",{className:"artifact-card",children:[a.jsx("span",{className:"artifact-card__icon","aria-hidden":"true",children:a.jsx(gV,{})}),a.jsxs("span",{className:"artifact-card__copy",children:[a.jsx("span",{className:"artifact-card__name",children:g.filename}),a.jsx("span",{className:"artifact-card__hint",children:i("blocks.powerpoint")})]}),a.jsxs("span",{className:"artifact-card__actions",children:[v&&a.jsxs("button",{className:"artifact-card__action",type:"button",disabled:!n||r!=="",onClick:()=>void h(v.filename,v.version,g.filename),children:[r===`preview:${g.filename}`?a.jsx(Bi,{className:"spin"}):a.jsx(Iat,{}),i("blocks.preview")]}),a.jsxs("button",{className:"artifact-card__action artifact-card__action--primary",type:"button",disabled:!t||r!=="",onClick:()=>void f(g.filename,g.version),children:[r===`download:${g.filename}`?a.jsx(Bi,{className:"spin"}):a.jsx(tM,{}),i("blocks.download")]})]})]},`${g.filename}:${g.version}`)}),o&&a.jsx("div",{className:"artifact-card__error",children:o}),c&&a.jsxs("div",{className:"artifact-preview",role:"dialog","aria-modal":"true","aria-label":i("blocks.previewDialog",{name:c.name}),children:[a.jsx("button",{className:"artifact-preview__backdrop",type:"button","aria-label":i("blocks.closePreview"),onClick:d}),a.jsxs("div",{className:"artifact-preview__panel",children:[a.jsxs("div",{className:"artifact-preview__header",children:[a.jsx("span",{children:c.name}),a.jsx("button",{type:"button","aria-label":i("blocks.closePreview"),onClick:d,children:a.jsx(Do,{})})]}),a.jsx("div",{className:"artifact-preview__canvas",children:a.jsx("img",{src:c.url,alt:i("blocks.slidePreview",{name:c.name})})})]})]})]})}function ANt({block:e,onAuth:t}){const{t:n}=Te("conversation"),[i,r]=p.useState(e.done?"done":"idle"),[s,o]=p.useState(""),l=e.label||n("blocks.mcpToolset"),c=(()=>{try{return e.authUri?new URL(e.authUri).host:""}catch{return""}})(),u=async()=>{if(t){o(""),r("authorizing");try{await t(e),r("done")}catch(f){o(f instanceof Error?f.message:String(f)),r("idle")}}};return e.done||i==="done"?a.jsxs(Cr.div,{className:"auth-card-collapsed",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},children:[a.jsx(XJ,{className:"auth-card-icon auth-card-icon--done"}),a.jsx("span",{children:n("blocks.authorized",{tool:l})})]}):a.jsxs(Cr.div,{className:"auth-card",initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[a.jsxs("div",{className:"auth-card-head",children:[a.jsx(XJ,{className:"auth-card-icon"}),a.jsx("span",{className:"auth-card-title",children:n("blocks.authorizationRequired",{tool:l})})]}),a.jsxs("p",{className:"auth-card-desc",children:[a.jsx(Rw,{t:n,i18nKey:"blocks.oauthDescription",values:{tool:l},components:{code:a.jsx("code",{className:"auth-card-code"})}}),c&&a.jsxs(a.Fragment,{children:[" ",a.jsx(Rw,{t:n,i18nKey:"blocks.oauthProvider",values:{provider:c},components:{code:a.jsx("code",{className:"auth-card-code"})}})," "]}),n("blocks.oauthContinue")]}),a.jsx("button",{className:"auth-card-btn",onClick:u,disabled:i==="authorizing"||!e.authUri,children:i==="authorizing"?a.jsxs(a.Fragment,{children:[a.jsx(Bi,{className:"cw-i spin"})," ",n("blocks.waitingAuthorization")]}):a.jsx(a.Fragment,{children:n("blocks.authorize")})}),!e.authUri&&a.jsx("div",{className:"auth-card-err",children:n("blocks.missingAuthorizationUrl")}),s&&a.jsx("div",{className:"auth-card-err",children:s})]})}function TNt(e,t,n){const i=gq(e.name),r=f9(e.name,e.args,n);if(r||!i)return r;const s=t==="failed"?"failed":t==="running"?"running":"done",o=t==="failed"?i.failedLabel??i.doneLabel:t==="running"?i.runningLabel:i.doneLabel;return n(`blocks.tools.${i.name}.${s}`,{defaultValue:o})}function Kne(e,t){const n=e.status??(e.done?"completed":"running");return{name:e.name,title:t?TNt(e,n,t):void 0,callId:e.callId,args:e.args,response:e.response,done:e.done,status:e.status,defaultOpen:e.defaultOpen,source:e.source}}function _Nt(e,t){var s;const n=[];let i=[];const r=()=>{i.length&&(n.push(i.length>1?{kind:"tool-exploration",items:i.map(o=>Kne(o,t))}:i[0]),i=[])};for(const o of e){if(o.kind!=="tool"||(s=gq(o.name))!=null&&s.detailRenderer){r(),n.push(o);continue}const l=bq(Kne(o)),c=!i.length||i[i.length-1].source===o.source;if(Hne(l)&&c){i.push(o);continue}r(),Hne(l)?i.push(o):n.push(o)}return r(),n}function v0({groupProcess:e=!1,liveStatus:t,blocks:n,appName:i="",streaming:r=!1,onStreamFrame:s,onStreamComplete:o,onAction:l,onAuth:c,onArtifactDownload:u,onArtifactPreview:d,onResolveDelivery:f,onResolveDeliveryComparison:h,onDownloadDelivery:m,onDeployDelivery:g,onBranchSelect:b}){if(e)return a.jsx(k_t,{blocks:n,active:r,status:t,render:x=>a.jsx(v0,{blocks:x,appName:i,streaming:r,onStreamFrame:s,onStreamComplete:o,onAction:l,onAuth:c,onArtifactDownload:u,onArtifactPreview:d,onResolveDelivery:f,onResolveDeliveryComparison:h,onDownloadDelivery:m,onDeployDelivery:g,onBranchSelect:b})});const{t:v}=Te("conversation"),y=_Nt(Sot(n),v),w=y.reduce((x,O,k)=>O.kind==="text"?k:x,-1);return a.jsx(a.Fragment,{children:y.map((x,O)=>{switch(x.kind){case"turn-summary":return a.jsx(w_t,{value:x.value},x.id||O);case"diff":return a.jsxs("details",{className:"development-diff",children:[a.jsxs("summary",{children:[a.jsx("span",{className:"tool-icon",children:a.jsx(IM,{kind:"diff"})}),a.jsx("span",{children:a.jsx(Rw,{ns:"adk",i18nKey:"developmentRuns.diff"})}),a.jsx(oO,{className:"tool-chevron"})]}),a.jsx("pre",{children:x.text})]},x.id??O);case"progress":return a.jsx(XLe,{text:x.text},"build-progress");case"activity-source":return a.jsx("div",{className:"tool-activity-source",children:x.label},`${O}:${x.label}`);case"tool-exploration":return a.jsx(fNt,{items:x.items},`exploration:${O}`);case"thinking":{const k=y.slice(O+1).some(S=>S.kind==="text"&&!!S.text.trim());return a.jsx(GLe,{text:x.text,done:x.done,thoughtKind:x.thoughtKind,answerStarted:k,streaming:r,onStreamFrame:s},x.id??O)}case"text":{const k=x.text.replace(/^\s+/,"");return k?a.jsx(ONt,{text:k,streaming:r,onStreamFrame:s,onStreamComplete:O===w?o:void 0},x.id??O):null}case"plan":return a.jsx(kNt,{title:x.title,summary:x.summary,items:x.items,done:x.done},x.id??O);case"attachment":return a.jsx(DM,{appName:i,items:x.files},x.id??O);case"artifact":return a.jsx(CNt,{block:x,onDownload:u,onPreview:d},x.id??O);case"delivery":return a.jsx(wNt,{value:x.value,onResolve:f,onResolveComparison:h,onDownload:m,onDeploy:g},x.id??O);case"invocation":return a.jsx(PM,{value:x.value},x.id??O);case"tool":{if(x.name===WLe&&x.done)return null;const k=x.name==="create_agents"&&y.slice(O+1).some(S=>S.kind==="tool"&&S.name==="create_agents");return a.jsx(ENt,{name:x.itemType?H2e(x):x.name,callId:x.callId,native:!!x.itemType,progressText:x.progressText,args:x.args,response:x.response,done:x.done,status:x.status,defaultOpen:x.defaultOpen,retrying:x.name==="create_agents"&&(r||k),codexActivity:x.codexActivity,source:x.source,onBranchSelect:b,onAction:l},x.id??O)}case"agent-transfer":return null;case"auth":return a.jsx(ANt,{block:x,onAuth:c},x.id??O);case"a2ui":return fLe(x.messages).filter(k=>k.components[k.rootId]).map(k=>a.jsx(Cr.div,{initial:{opacity:0,y:8,scale:.985},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:380,damping:30},children:a.jsx(R_t,{surface:k,onAction:l})},`${O}-${k.surfaceId}`));default:return null}})})}const jNt=()=>{};function NNt(e){if(e.kind==="message")return{kind:"text",text:e.text};if(e.kind==="thinking")return{kind:"thinking",text:e.text,done:e.status==="done"};if(e.kind==="tool")return{kind:"tool",name:e.name,args:e.args,response:e.response,done:e.status==="done"};throw new Error(en("conversation.unsupportedActivity"))}function RNt({activities:e}){const{t}=Te("skills"),n=p.useMemo(()=>e.filter(i=>i.kind!=="status").map(NNt),[e]);return n.length===0?null:a.jsx("div",{className:"skill-conversation","aria-label":t("conversation.ariaLabel"),"aria-live":"polite",children:a.jsx(v0,{blocks:n,onAction:jNt})})}function Gne(){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m7 9 5 5 5-5",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}function IN({label:e,value:t,options:n,onChange:i,disabled:r=!1,allowCustom:s=!1,required:o=!1,placeholder:l,error:c}){const{t:u}=Te("skills"),d=l??u("configSelect.placeholder"),f=p.useId(),h=p.useId(),m=p.useId(),g=p.useRef(null),b=p.useRef(null),v=p.useRef(null),y=p.useRef(null),w=p.useRef([]),x=n.findIndex(I=>I.value===t),O=t.trim().toLocaleLowerCase(),k=s&&O?n.filter(I=>I.value.toLocaleLowerCase().includes(O)||I.label.toLocaleLowerCase().includes(O)):n,[S,C]=p.useState(!1),[E,j]=p.useState(Math.max(0,x)),T=x>=0?n[x]:void 0,R=r||!s&&n.length===0,A=(I=!1)=>{C(!1),I&&window.requestAnimationFrame(()=>{var P,_;return s?(P=v.current)==null?void 0:P.focus():(_=b.current)==null?void 0:_.focus()})},N=I=>{R||k.length!==0&&(j(Math.min(Math.max(I,0),k.length-1)),C(!0))};p.useEffect(()=>{if(!S)return;const I=y.current,P=s?void 0:window.requestAnimationFrame(()=>{var M;(M=w.current[E])==null||M.focus()}),_=M=>{if(!I)return;const V=I.scrollTop<=0,q=I.scrollTop+I.clientHeight>=I.scrollHeight-1;(I.scrollHeight<=I.clientHeight||M.deltaY<0&&V||M.deltaY>0&&q)&&M.preventDefault(),M.stopPropagation()},L=M=>{var V;M.target instanceof Node&&!((V=g.current)!=null&&V.contains(M.target))&&A()},F=M=>{M.key==="Escape"&&A(!0)};return I==null||I.addEventListener("wheel",_,{passive:!1}),window.addEventListener("pointerdown",L),window.addEventListener("keydown",F),()=>{P!==void 0&&window.cancelAnimationFrame(P),I==null||I.removeEventListener("wheel",_),window.removeEventListener("pointerdown",L),window.removeEventListener("keydown",F)}},[E,s,S]);const D=I=>{var _;if(k.length===0)return;const P=(I+k.length)%k.length;j(P),(_=w.current[P])==null||_.focus()};return a.jsxs("div",{ref:g,className:`skill-config-select${S?" is-open":""}`,onBlur:I=>{var P;(!I.relatedTarget||!((P=g.current)!=null&&P.contains(I.relatedTarget)))&&A()},children:[a.jsxs("span",{id:h,className:"skill-config-select__label",children:[e,o?a.jsx("span",{className:"skill-required-mark","aria-hidden":"true",children:"*"}):null]}),s?a.jsxs("div",{className:`skill-config-select__trigger is-editable${r?" is-disabled":""}`,"aria-expanded":S,children:[a.jsx("input",{ref:v,value:t,disabled:r,role:"combobox","aria-autocomplete":"list","aria-expanded":S,"aria-controls":S?f:void 0,"aria-labelledby":h,"aria-required":o,"aria-invalid":!!c,"aria-describedby":c?m:void 0,placeholder:d,onChange:I=>{i(I.target.value),j(0),n.length>0&&C(!0)},onClick:()=>{!S&&k.length>0&&N(0)},onKeyDown:I=>{var P,_;if(!(I.nativeEvent.isComposing||I.keyCode===229))if(I.key==="ArrowDown")I.preventDefault(),S?(P=w.current[E])==null||P.focus():N(0);else if(I.key==="ArrowUp")I.preventDefault(),S?(_=w.current[k.length-1])==null||_.focus():N(k.length-1);else if(I.key==="Enter"&&S){I.preventDefault();const L=k[E];L&&i(L.value),A()}else I.key==="Escape"&&(I.preventDefault(),A())}}),a.jsx("button",{type:"button",className:"skill-config-select__toggle",disabled:r||n.length===0,"aria-label":u(S?"configSelect.collapseOptions":"configSelect.expandOptions"),onClick:()=>{S?A():N(0)},children:a.jsx(Gne,{})})]}):a.jsxs("button",{ref:b,type:"button",className:"skill-config-select__trigger",disabled:R,"aria-haspopup":"listbox","aria-expanded":S,"aria-controls":S?f:void 0,"aria-labelledby":h,"aria-required":o,onClick:()=>{S?A():N(x>=0?x:0)},onKeyDown:I=>{I.key==="ArrowDown"?(I.preventDefault(),N(x>=0?x:0)):I.key==="ArrowUp"&&(I.preventDefault(),N(x>=0?x:n.length-1))},children:[a.jsx("span",{className:T?void 0:"is-placeholder",title:T==null?void 0:T.label,children:(T==null?void 0:T.label)||(n.length===0?u("configSelect.noOptions"):d)}),a.jsx(Gne,{})]}),S?a.jsxs("div",{ref:y,id:f,className:"skill-config-select__menu",role:"listbox","aria-labelledby":h,children:[k.length===0?a.jsx("div",{className:"skill-config-select__empty",role:"status",children:u("configSelect.noMatches")}):null,k.map((I,P)=>{const _=I.value===t;return a.jsx("button",{ref:L=>{w.current[P]=L},type:"button",role:"option","aria-selected":_,tabIndex:P===E?0:-1,className:`skill-config-select__option${_?" is-selected":""}`,title:I.label,onFocus:()=>j(P),onClick:()=>{i(I.value),A(!0)},onKeyDown:L=>{L.key==="Enter"||L.key===" "?(L.preventDefault(),i(I.value),A(!0)):L.key==="ArrowDown"?(L.preventDefault(),D(P+1)):L.key==="ArrowUp"?(L.preventDefault(),D(P-1)):L.key==="Home"?(L.preventDefault(),D(0)):L.key==="End"&&(L.preventDefault(),D(n.length-1))},children:I.label},I.value)})]}):null,c?a.jsx("span",{id:m,className:"skill-config-select__error",role:"alert",children:c}):null]})}function Pr(e,t){return e instanceof Error?e:typeof e=="string"&&e.trim()?new Error(e.trim()):new Error(t)}function Ns({error:e}){var s,o,l,c,u;const{t}=Te("skills"),n=e,i=(o=(s=n.originalError)==null?void 0:s.message)==null?void 0:o.trim(),r=[typeof n.status=="number"?`HTTP ${n.status}${n.statusText?` ${n.statusText}`:""}`:"",n.code?t("errorDetails.code",{code:n.code}):"",(l=n.originalError)!=null&&l.type?t("errorDetails.type",{type:n.originalError.type}):"",(c=n.originalError)!=null&&c.repr&&n.originalError.repr!==i?t("errorDetails.representation",{value:n.originalError.repr}):"",(u=n.rawResponse)!=null&&u.trim()?t("errorDetails.rawResponse",{value:n.rawResponse.trim()}):""].filter(Boolean);return a.jsxs("div",{className:"skill-error-details",children:[a.jsx("div",{className:"skill-error-details__summary",children:e.message}),i?a.jsx("div",{className:"skill-error-details__original",children:t("errorDetails.original",{message:i})}):null,r.length>0?a.jsxs("details",{children:[a.jsx("summary",{children:t("errorDetails.details")}),a.jsx("pre",{children:r.join(` +`)})]}):null]})}const vq=Symbol.for("yaml.alias"),h9=Symbol.for("yaml.document"),Fg=Symbol.for("yaml.map"),ZLe=Symbol.for("yaml.pair"),Ch=Symbol.for("yaml.scalar"),lO=Symbol.for("yaml.seq"),Nd=Symbol.for("yaml.node.type"),cO=e=>!!e&&typeof e=="object"&&e[Nd]===vq,OT=e=>!!e&&typeof e=="object"&&e[Nd]===h9,kT=e=>!!e&&typeof e=="object"&&e[Nd]===Fg,ja=e=>!!e&&typeof e=="object"&&e[Nd]===ZLe,xs=e=>!!e&&typeof e=="object"&&e[Nd]===Ch,ST=e=>!!e&&typeof e=="object"&&e[Nd]===lO;function Ca(e){if(e&&typeof e=="object")switch(e[Nd]){case Fg:case lO:return!0}return!1}function _a(e){if(e&&typeof e=="object")switch(e[Nd]){case vq:case Fg:case Ch:case lO:return!0}return!1}const JLe=e=>(xs(e)||Ca(e))&&!!e.anchor,by=Symbol("break visit"),INt=Symbol("skip children"),bE=Symbol("remove node");function uO(e,t){const n=PNt(t);OT(e)?Lx(null,e.contents,n,Object.freeze([e]))===bE&&(e.contents=null):Lx(null,e,n,Object.freeze([]))}uO.BREAK=by;uO.SKIP=INt;uO.REMOVE=bE;function Lx(e,t,n,i){const r=DNt(e,t,n,i);if(_a(r)||ja(r))return MNt(e,i,r),Lx(e,r,n,i);if(typeof r!="symbol"){if(Ca(t)){i=Object.freeze(i.concat(t));for(let s=0;se.replace(/[!,[\]{}]/g,t=>LNt[t]);class Xl{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Xl.defaultYaml,t),this.tags=Object.assign({},Xl.defaultTags,n)}clone(){const t=new Xl(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Xl(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Xl.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Xl.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Xl.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Xl.defaultTags),this.atNextDocument=!1);const i=t.trim().split(/[ \t]+/),r=i.shift();switch(r){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;const[s,o]=i;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[s]=i;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{const o=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,o),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const o=t.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,i,r]=t.match(/^(.*!)([^!]*)$/s);r||n(`The ${t} tag has no suffix`);const s=this.tags[i];if(s)try{return s+decodeURIComponent(r)}catch(o){return n(String(o)),null}return i==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,i]of Object.entries(this.tags))if(t.startsWith(i))return n+$Nt(t.substring(i.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags);let r;if(t&&i.length>0&&_a(t.contents)){const s={};uO(t.contents,(o,l)=>{_a(l)&&l.tag&&(s[l.tag]=!0)}),r=Object.keys(s)}else r=[];for(const[s,o]of i)s==="!!"&&o==="tag:yaml.org,2002:"||(!t||r.some(l=>l.startsWith(o)))&&n.push(`%TAG ${s} ${o}`);return n.join(` +`)}}Xl.defaultYaml={explicit:!1,version:"1.2"};Xl.defaultTags={"!!":"tag:yaml.org,2002:"};function e5e(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function t5e(e){const t=new Set;return uO(e,{Value(n,i){i.anchor&&t.add(i.anchor)}}),t}function n5e(e,t){for(let n=1;;++n){const i=`${e}${n}`;if(!t.has(i))return i}}function FNt(e,t){const n=[],i=new Map;let r=null;return{onAnchor:s=>{n.push(s),r??(r=t5e(e));const o=n5e(t,r);return r.add(o),o},setAnchors:()=>{for(const s of n){const o=i.get(s);if(typeof o=="object"&&o.anchor&&(xs(o.node)||Ca(o.node)))o.node.anchor=o.anchor;else{const l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=s,l}}},sourceObjects:i}}function $x(e,t,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,s=i.length;rEd(i,String(r),n));if(e&&typeof e.toJSON=="function"){if(!n||!JLe(e))return e.toJSON(t,n);const i={aliasCount:0,count:1,res:void 0};n.anchors.set(e,i),n.onCreate=s=>{i.res=s,delete n.onCreate};const r=e.toJSON(t,n);return n.onCreate&&n.onCreate(r),r}return typeof e=="bigint"&&!(n!=null&&n.keep)?Number(e):e}class xq{constructor(t){Object.defineProperty(this,Nd,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:s}={}){if(!OT(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=Ed(this,"",o);if(typeof r=="function")for(const{count:c,res:u}of o.anchors.values())r(u,c);return typeof s=="function"?$x(s,{"":l},"",l):l}}let wq=class extends xq{constructor(t){super(vq),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if((n==null?void 0:n.maxAliasCount)===0)throw new ReferenceError("Alias resolution is disabled");let i;n!=null&&n.aliasResolveCache?i=n.aliasResolveCache:(i=[],uO(t,{Node:(s,o)=>{(cO(o)||JLe(o))&&i.push(o)}}),n&&(n.aliasResolveCache=i));let r;for(const s of i){if(s===this)break;s.anchor===this.source&&(r=s)}return r}toJSON(t,n){if(!n)return{source:this.source};const{anchors:i,doc:r,maxAliasCount:s}=n,o=this.resolve(r,n);if(!o){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let l=i.get(o);if(l||(Ed(o,null,n),l=i.get(o)),(l==null?void 0:l.res)===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(s>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=PN(r,o,i)),l.count*l.aliasCount>s)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return l.res}toString(t,n,i){const r=`*${this.source}`;if(t){if(e5e(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(t.implicitKey)return`${r} `}return r}};function PN(e,t,n){if(cO(t)){const i=t.resolve(e),r=n&&i&&n.get(i);return r?r.count*r.aliasCount:0}else if(Ca(t)){let i=0;for(const r of t.items){const s=PN(e,r,n);s>i&&(i=s)}return i}else if(ja(t)){const i=PN(e,t.key,n),r=PN(e,t.value,n);return Math.max(i,r)}return 1}const i5e=e=>!e||typeof e!="function"&&typeof e!="object";class wi extends xq{constructor(t){super(Ch),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:Ed(this.value,t,n)}toString(){return String(this.value)}}wi.BLOCK_FOLDED="BLOCK_FOLDED";wi.BLOCK_LITERAL="BLOCK_LITERAL";wi.PLAIN="PLAIN";wi.QUOTE_DOUBLE="QUOTE_DOUBLE";wi.QUOTE_SINGLE="QUOTE_SINGLE";const BNt="tag:yaml.org,2002:";function UNt(e,t,n){if(t){const i=n.filter(s=>s.tag===t),r=i.find(s=>!s.format)??i[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return n.find(i=>{var r;return((r=i.identify)==null?void 0:r.call(i,e))&&!i.format})}function jC(e,t,n){var f,h,m;if(OT(e)&&(e=e.contents),_a(e))return e;if(ja(e)){const g=(h=(f=n.schema[Fg]).createNode)==null?void 0:h.call(f,n.schema,null,n);return g.items.push(e),g}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:i,onAnchor:r,onTagObj:s,schema:o,sourceObjects:l}=n;let c;if(i&&e&&typeof e=="object"){if(c=l.get(e),c)return c.anchor??(c.anchor=r(e)),new wq(c.anchor);c={anchor:null,node:null},l.set(e,c)}t!=null&&t.startsWith("!!")&&(t=BNt+t.slice(2));let u=UNt(e,t,o.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const g=new wi(e);return c&&(c.node=g),g}u=e instanceof Map?o[Fg]:Symbol.iterator in Object(e)?o[lO]:o[Fg]}s&&(s(u),delete n.onTagObj);const d=u!=null&&u.createNode?u.createNode(n.schema,e,n):typeof((m=u==null?void 0:u.nodeClass)==null?void 0:m.from)=="function"?u.nodeClass.from(n.schema,e,n):new wi(e);return t?d.tag=t:u.default||(d.tag=u.tag),c&&(c.node=d),d}function MI(e,t,n){let i=n;for(let r=t.length-1;r>=0;--r){const s=t[r];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){const o=[];o[s]=i,i=o}else i=new Map([[s,i]])}return jC(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const gS=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class r5e extends xq{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(i=>_a(i)||ja(i)?i.clone(t):i),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(gS(t))this.add(n);else{const[i,...r]=t,s=this.get(i,!0);if(Ca(s))s.addIn(r,n);else if(s===void 0&&this.schema)this.set(i,MI(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}deleteIn(t){const[n,...i]=t;if(i.length===0)return this.delete(n);const r=this.get(n,!0);if(Ca(r))return r.deleteIn(i);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(t,n){const[i,...r]=t,s=this.get(i,!0);return r.length===0?!n&&xs(s)?s.value:s:Ca(s)?s.getIn(r,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!ja(n))return!1;const i=n.value;return i==null||t&&xs(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(t){const[n,...i]=t;if(i.length===0)return this.has(n);const r=this.get(n,!0);return Ca(r)?r.hasIn(i):!1}setIn(t,n){const[i,...r]=t;if(r.length===0)this.set(i,n);else{const s=this.get(i,!0);if(Ca(s))s.setIn(r,n);else if(s===void 0&&this.schema)this.set(i,MI(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}}const QNt=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Cp(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Iy=(e,t,n)=>e.endsWith(` +`)?Cp(n,t):n.includes(` `)?` -`+Ep(n,t):(e.endsWith(" ")?"":" ")+n,r5e="flow",h9="block",PN="quoted";function $M(e,t,n="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:s=20,onFold:o,onOverflow:l}={}){if(!r||r<0)return e;rr-Math.max(2,s)?u.push(0):f=r-i);let h,m,g=!1,b=-1,v=-1,y=-1;n===h9&&(b=Gne(e,b,t.length),b!==-1&&(f=b+c));for(let x;x=e[b+=1];){if(n===PN&&x==="\\"){switch(v=b,e[b+1]){case"x":b+=3;break;case"u":b+=5;break;case"U":b+=9;break;default:b+=1}y=b}if(x===` -`)n===h9&&(b=Gne(e,b,t.length)),f=b+t.length+c,h=void 0;else{if(x===" "&&m&&m!==" "&&m!==` +`+Cp(n,t):(e.endsWith(" ")?"":" ")+n,s5e="flow",p9="block",DN="quoted";function $M(e,t,n="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:s=20,onFold:o,onOverflow:l}={}){if(!r||r<0)return e;rr-Math.max(2,s)?u.push(0):f=r-i);let h,m,g=!1,b=-1,v=-1,y=-1;n===p9&&(b=Xne(e,b,t.length),b!==-1&&(f=b+c));for(let x;x=e[b+=1];){if(n===DN&&x==="\\"){switch(v=b,e[b+1]){case"x":b+=3;break;case"u":b+=5;break;case"U":b+=9;break;default:b+=1}y=b}if(x===` +`)n===p9&&(b=Xne(e,b,t.length)),f=b+t.length+c,h=void 0;else{if(x===" "&&m&&m!==" "&&m!==` `&&m!==" "){const O=e[b+1];O&&O!==" "&&O!==` -`&&O!==" "&&(h=b)}if(b>=f)if(h)u.push(h),f=h+c,h=void 0;else if(n===PN){for(;m===" "||m===" ";)m=x,x=e[b+=1],g=!0;const O=b>y+1?b-2:v-1;if(d[O])return e;u.push(O),d[O]=!0,f=O+c,h=void 0}else g=!0}m=x}if(g&&l&&l(),u.length===0)return e;o&&o();let w=e.slice(0,u[0]);for(let x=0;x({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),BM=e=>/^(%|---|\.\.\.)/m.test(e);function UNt(e,t,n){if(!t||t<0)return!1;const i=t-n,r=e.length;if(r<=i)return!1;for(let s=0,o=0;si)return!0;if(o=s+1,r-o<=i)return!1}return!0}function bE(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:i}=t,r=t.options.doubleQuotedMinMultiLineLength,s=t.indent||(BM(e)?" ":"");let o="",l=0;for(let c=0,u=n[c];u;u=n[++c])if(u===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(o+=n.slice(l,c)+"\\ ",c+=1,l=c,u="\\"),u==="\\")switch(n[c+1]){case"u":{o+=n.slice(l,c);const d=n.substr(c+2,4);switch(d){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:d.substr(0,2)==="00"?o+="\\x"+d.substr(2):o+=n.substr(c,6)}c+=5,l=c+1}break;case"n":if(i||n[c+2]==='"'||n.length=f)if(h)u.push(h),f=h+c,h=void 0;else if(n===DN){for(;m===" "||m===" ";)m=x,x=e[b+=1],g=!0;const O=b>y+1?b-2:v-1;if(d[O])return e;u.push(O),d[O]=!0,f=O+c,h=void 0}else g=!0}m=x}if(g&&l&&l(),u.length===0)return e;o&&o();let w=e.slice(0,u[0]);for(let x=0;x({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),BM=e=>/^(%|---|\.\.\.)/m.test(e);function zNt(e,t,n){if(!t||t<0)return!1;const i=t-n,r=e.length;if(r<=i)return!1;for(let s=0,o=0;si)return!0;if(o=s+1,r-o<=i)return!1}return!0}function yE(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:i}=t,r=t.options.doubleQuotedMinMultiLineLength,s=t.indent||(BM(e)?" ":"");let o="",l=0;for(let c=0,u=n[c];u;u=n[++c])if(u===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(o+=n.slice(l,c)+"\\ ",c+=1,l=c,u="\\"),u==="\\")switch(n[c+1]){case"u":{o+=n.slice(l,c);const d=n.substr(c+2,4);switch(d){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:d.substr(0,2)==="00"?o+="\\x"+d.substr(2):o+=n.substr(c,6)}c+=5,l=c+1}break;case"n":if(i||n[c+2]==='"'||n.length `;let f,h;for(h=n.length;h>0;--h){const k=n[h-1];if(k!==` `&&k!==" "&&k!==" ")break}let m=n.substring(h);const g=m.indexOf(` `);g===-1?f="-":n===m||g!==m.length-1?(f="+",s&&s()):f="",m&&(n=n.slice(0,-m.length),m[m.length-1]===` -`&&(m=m.slice(0,-1)),m=m.replace(m9,`$&${u}`));let b=!1,v,y=-1;for(v=0;v{S=!0});const E=$M(`${w}${k}${m}`,u,h9,C);if(!S)return`>${O} +$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${u}`);let S=!1;const C=FM(i,!0);o!=="folded"&&t!==wi.BLOCK_FOLDED&&(C.onOverflow=()=>{S=!0});const E=$M(`${w}${k}${m}`,u,p9,C);if(!S)return`>${O} ${u}${E}`}return n=n.replace(/\n+/g,`$&${u}`),`|${O} -${u}${w}${n}${m}`}function QNt(e,t,n,i){const{type:r,value:s}=e,{actualString:o,implicitKey:l,indent:c,indentStep:u,inFlow:d}=t;if(l&&s.includes(` -`)||d&&/[[\]{},]/.test(s))return $x(s,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||d||!s.includes(` -`)?$x(s,t):DN(e,t,n,i);if(!l&&!d&&r!==wi.PLAIN&&s.includes(` -`))return DN(e,t,n,i);if(BM(s)){if(c==="")return t.forceBlockIndent=!0,DN(e,t,n,i);if(l&&c===u)return $x(s,t)}const f=s.replace(/\n+/g,`$& -${c}`);if(o){const h=b=>{var v;return b.default&&b.tag!=="tag:yaml.org,2002:str"&&((v=b.test)==null?void 0:v.test(f))},{compat:m,tags:g}=t.doc.schema;if(g.some(h)||m!=null&&m.some(h))return $x(s,t)}return l?f:$M(f,c,r5e,FM(t,!1))}function wq(e,t,n,i){const{implicitKey:r,inFlow:s}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:l}=e;l!==wi.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(l=wi.QUOTE_DOUBLE);const c=d=>{switch(d){case wi.BLOCK_FOLDED:case wi.BLOCK_LITERAL:return r||s?$x(o.value,t):DN(o,t,n,i);case wi.QUOTE_DOUBLE:return bE(o.value,t);case wi.QUOTE_SINGLE:return p9(o.value,t);case wi.PLAIN:return QNt(o,t,n,i);default:return null}};let u=c(l);if(u===null){const{defaultKeyType:d,defaultStringType:f}=t.options,h=r&&d||f;if(u=c(h),u===null)throw new Error(`Unsupported default string type ${h}`)}return u}function s5e(e,t){const n=Object.assign({blockQuote:!0,commentString:BNt,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let i;switch(n.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:i,options:n}}function zNt(e,t){var r;if(t.tag){const s=e.filter(o=>o.tag===t.tag);if(s.length>0)return s.find(o=>o.format===t.format)??s[0]}let n,i;if(xs(t)){i=t.value;let s=e.filter(o=>{var l;return(l=o.identify)==null?void 0:l.call(o,i)});if(s.length>1){const o=s.filter(l=>l.test);o.length>0&&(s=o)}n=s.find(o=>o.format===t.format)??s.find(o=>!o.format)}else i=t,n=e.find(s=>s.nodeClass&&i instanceof s.nodeClass);if(!n){const s=((r=i==null?void 0:i.constructor)==null?void 0:r.name)??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${s} value`)}return n}function VNt(e,t,{anchors:n,doc:i}){if(!i.directives)return"";const r=[],s=(xs(e)||Ca(e))&&e.anchor;s&&JLe(s)&&(n.add(s),r.push(`&${s}`));const o=e.tag??(t.default?null:t.tag);return o&&r.push(i.directives.tagString(o)),r.join(" ")}function o1(e,t,n,i){var c;if(ja(e))return e.toString(t,n,i);if(lO(e)){if(t.doc.directives)return e.toString(t);if((c=t.resolvedAliases)!=null&&c.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let r;const s=_a(e)?e:t.doc.createNode(e,{onTagObj:u=>r=u});r??(r=zNt(t.doc.schema.tags,s));const o=VNt(s,r,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const l=typeof r.stringify=="function"?r.stringify(s,t,n,i):xs(s)?wq(s,t,n,i):s.toString(t,n,i);return o?xs(s)||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o} -${t.indent}${l}`:l}function HNt({key:e,value:t},n,i,r){const{allNullValues:s,doc:o,indent:l,indentStep:c,options:{commentString:u,indentSeq:d,simpleKeys:f}}=n;let h=_a(e)&&e.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(Ca(e)||!_a(e)&&typeof e=="object"){const C="With simple keys, collection cannot be used as a key value";throw new Error(C)}}let m=!f&&(!e||h&&t==null&&!n.inFlow||Ca(e)||(xs(e)?e.type===wi.BLOCK_FOLDED||e.type===wi.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!m&&(f||!s),indent:l+c});let g=!1,b=!1,v=o1(e,n,()=>g=!0,()=>b=!0);if(!m&&!n.inFlow&&v.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(n.inFlow){if(s||t==null)return g&&i&&i(),v===""?"?":m?`? ${v}`:v}else if(s&&!f||t==null&&m)return v=`? ${v}`,h&&!g?v+=Ry(v,n.indent,u(h)):b&&r&&r(),v;g&&(h=null),m?(h&&(v+=Ry(v,n.indent,u(h))),v=`? ${v} -${l}:`):(v=`${v}:`,h&&(v+=Ry(v,n.indent,u(h))));let y,w,x;_a(t)?(y=!!t.spaceBefore,w=t.commentBefore,x=t.comment):(y=!1,w=null,x=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!m&&!h&&xs(t)&&(n.indentAtStart=v.length+1),b=!1,!d&&c.length>=2&&!n.inFlow&&!m&&kT(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let O=!1;const k=o1(t,n,()=>O=!0,()=>b=!0);let S=" ";if(h||y||w){if(S=y?` +${u}${w}${n}${m}`}function VNt(e,t,n,i){const{type:r,value:s}=e,{actualString:o,implicitKey:l,indent:c,indentStep:u,inFlow:d}=t;if(l&&s.includes(` +`)||d&&/[[\]{},]/.test(s))return Fx(s,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||d||!s.includes(` +`)?Fx(s,t):MN(e,t,n,i);if(!l&&!d&&r!==wi.PLAIN&&s.includes(` +`))return MN(e,t,n,i);if(BM(s)){if(c==="")return t.forceBlockIndent=!0,MN(e,t,n,i);if(l&&c===u)return Fx(s,t)}const f=s.replace(/\n+/g,`$& +${c}`);if(o){const h=b=>{var v;return b.default&&b.tag!=="tag:yaml.org,2002:str"&&((v=b.test)==null?void 0:v.test(f))},{compat:m,tags:g}=t.doc.schema;if(g.some(h)||m!=null&&m.some(h))return Fx(s,t)}return l?f:$M(f,c,s5e,FM(t,!1))}function Oq(e,t,n,i){const{implicitKey:r,inFlow:s}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:l}=e;l!==wi.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(l=wi.QUOTE_DOUBLE);const c=d=>{switch(d){case wi.BLOCK_FOLDED:case wi.BLOCK_LITERAL:return r||s?Fx(o.value,t):MN(o,t,n,i);case wi.QUOTE_DOUBLE:return yE(o.value,t);case wi.QUOTE_SINGLE:return m9(o.value,t);case wi.PLAIN:return VNt(o,t,n,i);default:return null}};let u=c(l);if(u===null){const{defaultKeyType:d,defaultStringType:f}=t.options,h=r&&d||f;if(u=c(h),u===null)throw new Error(`Unsupported default string type ${h}`)}return u}function a5e(e,t){const n=Object.assign({blockQuote:!0,commentString:QNt,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let i;switch(n.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:i,options:n}}function HNt(e,t){var r;if(t.tag){const s=e.filter(o=>o.tag===t.tag);if(s.length>0)return s.find(o=>o.format===t.format)??s[0]}let n,i;if(xs(t)){i=t.value;let s=e.filter(o=>{var l;return(l=o.identify)==null?void 0:l.call(o,i)});if(s.length>1){const o=s.filter(l=>l.test);o.length>0&&(s=o)}n=s.find(o=>o.format===t.format)??s.find(o=>!o.format)}else i=t,n=e.find(s=>s.nodeClass&&i instanceof s.nodeClass);if(!n){const s=((r=i==null?void 0:i.constructor)==null?void 0:r.name)??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${s} value`)}return n}function qNt(e,t,{anchors:n,doc:i}){if(!i.directives)return"";const r=[],s=(xs(e)||Ca(e))&&e.anchor;s&&e5e(s)&&(n.add(s),r.push(`&${s}`));const o=e.tag??(t.default?null:t.tag);return o&&r.push(i.directives.tagString(o)),r.join(" ")}function l1(e,t,n,i){var c;if(ja(e))return e.toString(t,n,i);if(cO(e)){if(t.doc.directives)return e.toString(t);if((c=t.resolvedAliases)!=null&&c.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let r;const s=_a(e)?e:t.doc.createNode(e,{onTagObj:u=>r=u});r??(r=HNt(t.doc.schema.tags,s));const o=qNt(s,r,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const l=typeof r.stringify=="function"?r.stringify(s,t,n,i):xs(s)?Oq(s,t,n,i):s.toString(t,n,i);return o?xs(s)||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o} +${t.indent}${l}`:l}function WNt({key:e,value:t},n,i,r){const{allNullValues:s,doc:o,indent:l,indentStep:c,options:{commentString:u,indentSeq:d,simpleKeys:f}}=n;let h=_a(e)&&e.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(Ca(e)||!_a(e)&&typeof e=="object"){const C="With simple keys, collection cannot be used as a key value";throw new Error(C)}}let m=!f&&(!e||h&&t==null&&!n.inFlow||Ca(e)||(xs(e)?e.type===wi.BLOCK_FOLDED||e.type===wi.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!m&&(f||!s),indent:l+c});let g=!1,b=!1,v=l1(e,n,()=>g=!0,()=>b=!0);if(!m&&!n.inFlow&&v.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(n.inFlow){if(s||t==null)return g&&i&&i(),v===""?"?":m?`? ${v}`:v}else if(s&&!f||t==null&&m)return v=`? ${v}`,h&&!g?v+=Iy(v,n.indent,u(h)):b&&r&&r(),v;g&&(h=null),m?(h&&(v+=Iy(v,n.indent,u(h))),v=`? ${v} +${l}:`):(v=`${v}:`,h&&(v+=Iy(v,n.indent,u(h))));let y,w,x;_a(t)?(y=!!t.spaceBefore,w=t.commentBefore,x=t.comment):(y=!1,w=null,x=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!m&&!h&&xs(t)&&(n.indentAtStart=v.length+1),b=!1,!d&&c.length>=2&&!n.inFlow&&!m&&ST(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let O=!1;const k=l1(t,n,()=>O=!0,()=>b=!0);let S=" ";if(h||y||w){if(S=y?` `:"",w){const C=u(w);S+=` -${Ep(C,n.indent)}`}k===""&&!n.inFlow?S===` +${Cp(C,n.indent)}`}k===""&&!n.inFlow?S===` `&&x&&(S=` `):S+=` ${n.indent}`}else if(!m&&Ca(t)){const C=k[0],E=k.indexOf(` `),j=E!==-1,T=n.inFlow??t.flow??t.items.length===0;if(j||!T){let R=!1;if(j&&(C==="&"||C==="!")){let A=k.indexOf(" ");C==="&"&&A!==-1&&Ae===P_||typeof e=="symbol"&&e.description===P_,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new wi(Symbol(P_)),{addToJSMap:o5e}),stringify:()=>P_},qNt=(e,t)=>(Fp.identify(t)||xs(t)&&(!t.type||t.type===wi.PLAIN)&&Fp.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===Fp.tag&&n.default));function o5e(e,t,n){const i=l5e(e,n);if(kT(i))for(const r of i.items)U4(e,t,r);else if(Array.isArray(i))for(const r of i)U4(e,t,r);else U4(e,t,i)}function U4(e,t,n){const i=l5e(e,n);if(!OT(i))throw new Error("Merge sources must be maps or map aliases");const r=i.toJSON(null,e,Map);for(const[s,o]of r)t instanceof Map?t.has(s)||t.set(s,o):t instanceof Set?t.add(s):Object.prototype.hasOwnProperty.call(t,s)||Object.defineProperty(t,s,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function l5e(e,t){return e&&lO(t)?t.resolve(e.doc,e):t}function c5e(e,t,{key:n,value:i}){if(_a(n)&&n.addToJSMap)n.addToJSMap(e,t,i);else if(qNt(e,n))o5e(e,t,i);else{const r=kd(n,"",e);if(t instanceof Map)t.set(r,kd(i,r,e));else if(t instanceof Set)t.add(r);else{const s=WNt(n,r,e),o=kd(i,s,e);s in t?Object.defineProperty(t,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[s]=o}}return t}function WNt(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(_a(e)&&(n!=null&&n.doc)){const i=s5e(n.doc,{});i.anchors=new Set;for(const s of n.anchors.keys())i.anchors.add(s.anchor);i.inFlow=!0,i.inStringifyKey=!0;const r=e.toString(i);if(!n.mapKeyWarned){let s=JSON.stringify(r);s.length>40&&(s=s.substring(0,36)+'..."'),a5e(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function Oq(e,t,n){const i=_C(e,void 0,n),r=_C(t,void 0,n);return new sc(i,r)}class sc{constructor(t,n=null){Object.defineProperty(this,_d,{value:YLe}),this.key=t,this.value=n}clone(t){let{key:n,value:i}=this;return _a(n)&&(n=n.clone(t)),_a(i)&&(i=i.clone(t)),new sc(n,i)}toJSON(t,n){const i=n!=null&&n.mapAsMap?new Map:{};return c5e(n,i,this)}toString(t,n,i){return t!=null&&t.doc?HNt(this,t,n,i):JSON.stringify(this)}}function u5e(e,t,n){return(t.inFlow??e.flow?GNt:KNt)(e,t,n)}function KNt({comment:e,items:t},n,{blockItemPrefix:i,flowChars:r,itemIndent:s,onChompKeep:o,onComment:l}){const{indent:c,options:{commentString:u}}=n,d=Object.assign({},n,{indent:s,type:null});let f=!1;const h=[];for(let g=0;gv=null,()=>f=!0);v&&(y+=Ry(y,s,u(v))),f&&v&&(f=!1),h.push(i+y)}let m;if(h.length===0)m=r.start+r.end;else{m=h[0];for(let g=1;ge===D_||typeof e=="symbol"&&e.description===D_,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new wi(Symbol(D_)),{addToJSMap:l5e}),stringify:()=>D_},KNt=(e,t)=>(Bp.identify(t)||xs(t)&&(!t.type||t.type===wi.PLAIN)&&Bp.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===Bp.tag&&n.default));function l5e(e,t,n){const i=c5e(e,n);if(ST(i))for(const r of i.items)Q4(e,t,r);else if(Array.isArray(i))for(const r of i)Q4(e,t,r);else Q4(e,t,i)}function Q4(e,t,n){const i=c5e(e,n);if(!kT(i))throw new Error("Merge sources must be maps or map aliases");const r=i.toJSON(null,e,Map);for(const[s,o]of r)t instanceof Map?t.has(s)||t.set(s,o):t instanceof Set?t.add(s):Object.prototype.hasOwnProperty.call(t,s)||Object.defineProperty(t,s,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function c5e(e,t){return e&&cO(t)?t.resolve(e.doc,e):t}function u5e(e,t,{key:n,value:i}){if(_a(n)&&n.addToJSMap)n.addToJSMap(e,t,i);else if(KNt(e,n))l5e(e,t,i);else{const r=Ed(n,"",e);if(t instanceof Map)t.set(r,Ed(i,r,e));else if(t instanceof Set)t.add(r);else{const s=GNt(n,r,e),o=Ed(i,s,e);s in t?Object.defineProperty(t,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[s]=o}}return t}function GNt(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(_a(e)&&(n!=null&&n.doc)){const i=a5e(n.doc,{});i.anchors=new Set;for(const s of n.anchors.keys())i.anchors.add(s.anchor);i.inFlow=!0,i.inStringifyKey=!0;const r=e.toString(i);if(!n.mapKeyWarned){let s=JSON.stringify(r);s.length>40&&(s=s.substring(0,36)+'..."'),o5e(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function kq(e,t,n){const i=jC(e,void 0,n),r=jC(t,void 0,n);return new sc(i,r)}class sc{constructor(t,n=null){Object.defineProperty(this,Nd,{value:ZLe}),this.key=t,this.value=n}clone(t){let{key:n,value:i}=this;return _a(n)&&(n=n.clone(t)),_a(i)&&(i=i.clone(t)),new sc(n,i)}toJSON(t,n){const i=n!=null&&n.mapAsMap?new Map:{};return u5e(n,i,this)}toString(t,n,i){return t!=null&&t.doc?WNt(this,t,n,i):JSON.stringify(this)}}function d5e(e,t,n){return(t.inFlow??e.flow?YNt:XNt)(e,t,n)}function XNt({comment:e,items:t},n,{blockItemPrefix:i,flowChars:r,itemIndent:s,onChompKeep:o,onComment:l}){const{indent:c,options:{commentString:u}}=n,d=Object.assign({},n,{indent:s,type:null});let f=!1;const h=[];for(let g=0;gv=null,()=>f=!0);v&&(y+=Iy(y,s,u(v))),f&&v&&(f=!1),h.push(i+y)}let m;if(h.length===0)m=r.start+r.end;else{m=h[0];for(let g=1;gv=null);u||(u=f.length>d||y.includes(` -`)),g0&&(u||(u=f.reduce((w,x)=>w+x.length+2,2)+(y.length+2)>t.options.lineWidth)),u&&(y+=",")),v&&(y+=Ry(y,i,l(v))),f.push(y),d=f.length}const{start:h,end:m}=n;if(f.length===0)return h+m;if(!u){const g=f.reduce((b,v)=>b+v.length+2,2);u=t.options.lineWidth>0&&g>t.options.lineWidth}if(u){let g=h;for(const b of f)g+=b?` +`+Cp(u(e),c),l&&l()):f&&o&&o(),m}function YNt({items:e},t,{flowChars:n,itemIndent:i}){const{indent:r,indentStep:s,flowCollectionPadding:o,options:{commentString:l}}=t;i+=s;const c=Object.assign({},t,{indent:i,inFlow:!0,type:null});let u=!1,d=0;const f=[];for(let g=0;gv=null);u||(u=f.length>d||y.includes(` +`)),g0&&(u||(u=f.reduce((w,x)=>w+x.length+2,2)+(y.length+2)>t.options.lineWidth)),u&&(y+=",")),v&&(y+=Iy(y,i,l(v))),f.push(y),d=f.length}const{start:h,end:m}=n;if(f.length===0)return h+m;if(!u){const g=f.reduce((b,v)=>b+v.length+2,2);u=t.options.lineWidth>0&&g>t.options.lineWidth}if(u){let g=h;for(const b of f)g+=b?` ${s}${r}${b}`:` `;return`${g} -${r}${m}`}else return`${h}${o}${f.join(" ")}${o}${m}`}function LI({indent:e,options:{commentString:t}},n,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){const s=Ep(t(i),e);n.push(s.trimStart())}}function Iy(e,t){const n=xs(t)?t.value:t;for(const i of e)if(ja(i)&&(i.key===t||i.key===n||xs(i.key)&&i.key.value===n))return i}class ud extends i5e{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super($g,t),this.items=[]}static from(t,n,i){const{keepUndefined:r,replacer:s}=i,o=new this(t),l=(c,u)=>{if(typeof s=="function")u=s.call(n,c,u);else if(Array.isArray(s)&&!s.includes(c))return;(u!==void 0||r)&&o.items.push(Oq(c,u,i))};if(n instanceof Map)for(const[c,u]of n)l(c,u);else if(n&&typeof n=="object")for(const c of Object.keys(n))l(c,n[c]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,n){var o;let i;ja(t)?i=t:!t||typeof t!="object"||!("key"in t)?i=new sc(t,t==null?void 0:t.value):i=new sc(t.key,t.value);const r=Iy(this.items,i.key),s=(o=this.schema)==null?void 0:o.sortMapEntries;if(r){if(!n)throw new Error(`Key ${i.key} already set`);xs(r.value)&&n5e(i.value)?r.value.value=i.value:r.value=i.value}else if(s){const l=this.items.findIndex(c=>s(i,c)<0);l===-1?this.items.push(i):this.items.splice(l,0,i)}else this.items.push(i)}delete(t){const n=Iy(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const i=Iy(this.items,t),r=i==null?void 0:i.value;return(!n&&xs(r)?r.value:r)??void 0}has(t){return!!Iy(this.items,t)}set(t,n){this.add(new sc(t,n),!0)}toJSON(t,n,i){const r=i?new i:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(r);for(const s of this.items)c5e(n,r,s);return r}toString(t,n,i){if(!t)return JSON.stringify(this);for(const r of this.items)if(!ja(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),u5e(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:i,onComment:n})}}const uO={collection:"map",default:!0,nodeClass:ud,tag:"tag:yaml.org,2002:map",resolve(e,t){return OT(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>ud.from(e,t,n)};class v0 extends i5e{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(oO,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=D_(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const i=D_(t);if(typeof i!="number")return;const r=this.items[i];return!n&&xs(r)?r.value:r}has(t){const n=D_(t);return typeof n=="number"&&n=0?t:null}const dO={collection:"seq",default:!0,nodeClass:v0,tag:"tag:yaml.org,2002:seq",resolve(e,t){return kT(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>v0.from(e,t,n)},UM={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,i){return t=Object.assign({actualString:!0},t),wq(e,t,n,i)}},QM={identify:e=>e==null,createNode:()=>new wi(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new wi(null),stringify:({source:e},t)=>typeof e=="string"&&QM.test.test(e)?e:t.options.nullStr},kq={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new wi(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&kq.test.test(e)){const i=e[0]==="t"||e[0]==="T";if(t===i)return e}return t?n.options.trueStr:n.options.falseStr}};function _f({format:e,minFractionDigits:t,tag:n,value:i}){if(typeof i=="bigint")return String(i);const r=typeof i=="number"?i:Number(i);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let s=Object.is(i,-0)?"-0":JSON.stringify(i);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let o=s.indexOf(".");o<0&&(o=s.length,s+=".");let l=t-(s.length-o-1);for(;l-- >0;)s+="0"}return s}const d5e={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:_f},f5e={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():_f(e)}},h5e={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new wi(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:_f},zM=e=>typeof e=="bigint"||Number.isInteger(e),Sq=(e,t,n,{intAsBigInt:i})=>i?BigInt(e):parseInt(e.substring(t),n);function p5e(e,t,n){const{value:i}=e;return zM(i)&&i>=0?n+i.toString(t):_f(e)}const m5e={identify:e=>zM(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Sq(e,2,8,n),stringify:e=>p5e(e,8,"0o")},g5e={identify:zM,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Sq(e,0,10,n),stringify:_f},b5e={identify:e=>zM(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Sq(e,2,16,n),stringify:e=>p5e(e,16,"0x")},XNt=[uO,dO,UM,QM,kq,m5e,g5e,b5e,d5e,f5e,h5e];function Xne(e){return typeof e=="bigint"||Number.isInteger(e)}const M_=({value:e})=>JSON.stringify(e),YNt=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:M_},{identify:e=>e==null,createNode:()=>new wi(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:M_},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:M_},{identify:Xne,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Xne(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:M_}],ZNt={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},JNt=[uO,dO].concat(YNt,ZNt),Eq={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),i=new Uint8Array(n.length);for(let r=0;r1&&t("Each pair must have its own sequence indicator");const r=i.items[0]||new sc(new wi(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore} +${r}${m}`}else return`${h}${o}${f.join(" ")}${o}${m}`}function LI({indent:e,options:{commentString:t}},n,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){const s=Cp(t(i),e);n.push(s.trimStart())}}function Py(e,t){const n=xs(t)?t.value:t;for(const i of e)if(ja(i)&&(i.key===t||i.key===n||xs(i.key)&&i.key.value===n))return i}class dd extends r5e{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Fg,t),this.items=[]}static from(t,n,i){const{keepUndefined:r,replacer:s}=i,o=new this(t),l=(c,u)=>{if(typeof s=="function")u=s.call(n,c,u);else if(Array.isArray(s)&&!s.includes(c))return;(u!==void 0||r)&&o.items.push(kq(c,u,i))};if(n instanceof Map)for(const[c,u]of n)l(c,u);else if(n&&typeof n=="object")for(const c of Object.keys(n))l(c,n[c]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,n){var o;let i;ja(t)?i=t:!t||typeof t!="object"||!("key"in t)?i=new sc(t,t==null?void 0:t.value):i=new sc(t.key,t.value);const r=Py(this.items,i.key),s=(o=this.schema)==null?void 0:o.sortMapEntries;if(r){if(!n)throw new Error(`Key ${i.key} already set`);xs(r.value)&&i5e(i.value)?r.value.value=i.value:r.value=i.value}else if(s){const l=this.items.findIndex(c=>s(i,c)<0);l===-1?this.items.push(i):this.items.splice(l,0,i)}else this.items.push(i)}delete(t){const n=Py(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const i=Py(this.items,t),r=i==null?void 0:i.value;return(!n&&xs(r)?r.value:r)??void 0}has(t){return!!Py(this.items,t)}set(t,n){this.add(new sc(t,n),!0)}toJSON(t,n,i){const r=i?new i:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(r);for(const s of this.items)u5e(n,r,s);return r}toString(t,n,i){if(!t)return JSON.stringify(this);for(const r of this.items)if(!ja(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),d5e(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:i,onComment:n})}}const dO={collection:"map",default:!0,nodeClass:dd,tag:"tag:yaml.org,2002:map",resolve(e,t){return kT(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>dd.from(e,t,n)};class x0 extends r5e{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(lO,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=M_(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const i=M_(t);if(typeof i!="number")return;const r=this.items[i];return!n&&xs(r)?r.value:r}has(t){const n=M_(t);return typeof n=="number"&&n=0?t:null}const fO={collection:"seq",default:!0,nodeClass:x0,tag:"tag:yaml.org,2002:seq",resolve(e,t){return ST(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>x0.from(e,t,n)},UM={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,i){return t=Object.assign({actualString:!0},t),Oq(e,t,n,i)}},QM={identify:e=>e==null,createNode:()=>new wi(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new wi(null),stringify:({source:e},t)=>typeof e=="string"&&QM.test.test(e)?e:t.options.nullStr},Sq={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new wi(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&Sq.test.test(e)){const i=e[0]==="t"||e[0]==="T";if(t===i)return e}return t?n.options.trueStr:n.options.falseStr}};function jf({format:e,minFractionDigits:t,tag:n,value:i}){if(typeof i=="bigint")return String(i);const r=typeof i=="number"?i:Number(i);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let s=Object.is(i,-0)?"-0":JSON.stringify(i);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let o=s.indexOf(".");o<0&&(o=s.length,s+=".");let l=t-(s.length-o-1);for(;l-- >0;)s+="0"}return s}const f5e={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:jf},h5e={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():jf(e)}},p5e={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new wi(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:jf},zM=e=>typeof e=="bigint"||Number.isInteger(e),Eq=(e,t,n,{intAsBigInt:i})=>i?BigInt(e):parseInt(e.substring(t),n);function m5e(e,t,n){const{value:i}=e;return zM(i)&&i>=0?n+i.toString(t):jf(e)}const g5e={identify:e=>zM(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Eq(e,2,8,n),stringify:e=>m5e(e,8,"0o")},b5e={identify:zM,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Eq(e,0,10,n),stringify:jf},y5e={identify:e=>zM(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Eq(e,2,16,n),stringify:e=>m5e(e,16,"0x")},ZNt=[dO,fO,UM,QM,Sq,g5e,b5e,y5e,f5e,h5e,p5e];function Yne(e){return typeof e=="bigint"||Number.isInteger(e)}const L_=({value:e})=>JSON.stringify(e),JNt=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:L_},{identify:e=>e==null,createNode:()=>new wi(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:L_},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:L_},{identify:Yne,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Yne(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:L_}],eRt={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},tRt=[dO,fO].concat(JNt,eRt),Cq={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),i=new Uint8Array(n.length);for(let r=0;r1&&t("Each pair must have its own sequence indicator");const r=i.items[0]||new sc(new wi(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore} ${r.key.commentBefore}`:i.commentBefore),i.comment){const s=r.value??r.key;s.comment=s.comment?`${i.comment} -${s.comment}`:i.comment}i=r}e.items[n]=ja(i)?i:new sc(i)}}else t("Expected a sequence for this tag");return e}function v5e(e,t,n){const{replacer:i}=n,r=new v0(e);r.tag="tag:yaml.org,2002:pairs";let s=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof i=="function"&&(o=i.call(t,String(s++),o));let l,c;if(Array.isArray(o))if(o.length===2)l=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const u=Object.keys(o);if(u.length===1)l=u[0],c=o[l];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else l=o;r.items.push(Oq(l,c,n))}return r}const Cq={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:y5e,createNode:v5e};class hw extends v0{constructor(){super(),this.add=ud.prototype.add.bind(this),this.delete=ud.prototype.delete.bind(this),this.get=ud.prototype.get.bind(this),this.has=ud.prototype.has.bind(this),this.set=ud.prototype.set.bind(this),this.tag=hw.tag}toJSON(t,n){if(!n)return super.toJSON(t);const i=new Map;n!=null&&n.onCreate&&n.onCreate(i);for(const r of this.items){let s,o;if(ja(r)?(s=kd(r.key,"",n),o=kd(r.value,s,n)):s=kd(r,"",n),i.has(s))throw new Error("Ordered maps must not include duplicate keys");i.set(s,o)}return i}static from(t,n,i){const r=v5e(t,n,i),s=new this;return s.items=r.items,s}}hw.tag="tag:yaml.org,2002:omap";const Aq={collection:"seq",identify:e=>e instanceof Map,nodeClass:hw,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=y5e(e,t),i=[];for(const{key:r}of n.items)xs(r)&&(i.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new hw,n)},createNode:(e,t,n)=>hw.from(e,t,n)};function x5e({value:e,source:t},n){return t&&(e?w5e:O5e).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const w5e={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new wi(!0),stringify:x5e},O5e={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new wi(!1),stringify:x5e},eRt={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:_f},tRt={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():_f(e)}},nRt={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new wi(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const i=e.substring(n+1).replace(/_/g,"");i[i.length-1]==="0"&&(t.minFractionDigits=i.length)}return t},stringify:_f},ST=e=>typeof e=="bigint"||Number.isInteger(e);function VM(e,t,n,{intAsBigInt:i}){const r=e[0];if((r==="-"||r==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),i){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const o=BigInt(e);return r==="-"?BigInt(-1)*o:o}const s=parseInt(e,n);return r==="-"?-1*s:s}function Tq(e,t,n){const{value:i}=e;if(ST(i)){const r=i.toString(t);return i<0?"-"+n+r.substr(1):n+r}return _f(e)}const iRt={identify:ST,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>VM(e,2,2,n),stringify:e=>Tq(e,2,"0b")},rRt={identify:ST,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>VM(e,1,8,n),stringify:e=>Tq(e,8,"0")},sRt={identify:ST,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>VM(e,0,10,n),stringify:_f},aRt={identify:ST,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>VM(e,2,16,n),stringify:e=>Tq(e,16,"0x")};class pw extends ud{constructor(t){super(t),this.tag=pw.tag}add(t){let n;ja(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new sc(t.key,null):n=new sc(t,null),Iy(this.items,n.key)||this.items.push(n)}get(t,n){const i=Iy(this.items,t);return!n&&ja(i)?xs(i.key)?i.key.value:i.key:i}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const i=Iy(this.items,t);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new sc(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,i){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,i);throw new Error("Set items must all have null values")}static from(t,n,i){const{replacer:r}=i,s=new this(t);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof r=="function"&&(o=r.call(n,o,o)),s.items.push(Oq(o,null,i));return s}}pw.tag="tag:yaml.org,2002:set";const _q={collection:"map",identify:e=>e instanceof Set,nodeClass:pw,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>pw.from(e,t,n),resolve(e,t){if(OT(e)){if(e.hasAllNullValues(!0))return Object.assign(new pw,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function jq(e,t){const n=e[0],i=n==="-"||n==="+"?e.substring(1):e,r=o=>t?BigInt(o):Number(o),s=i.replace(/_/g,"").split(":").reduce((o,l)=>o*r(60)+r(l),r(0));return n==="-"?r(-1)*s:s}function k5e(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return _f(e);let i="";t<0&&(i="-",t*=n(-1));const r=n(60),s=[t%r];return t<60?s.unshift(0):(t=(t-s[0])/r,s.unshift(t%r),t>=60&&(t=(t-s[0])/r,s.unshift(t))),i+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const S5e={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>jq(e,n),stringify:k5e},E5e={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>jq(e,!1),stringify:k5e},HM={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(HM.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,i,r,s,o,l]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0;let u=Date.UTC(n,i-1,r,s||0,o||0,l||0,c);const d=t[8];if(d&&d!=="Z"){let f=jq(d,!1);Math.abs(f)<30&&(f*=60),u-=6e4*f}return new Date(u)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},Yne=[uO,dO,UM,QM,w5e,O5e,iRt,rRt,sRt,aRt,eRt,tRt,nRt,Eq,Fp,Aq,Cq,_q,S5e,E5e,HM],Zne=new Map([["core",XNt],["failsafe",[uO,dO,UM]],["json",JNt],["yaml11",Yne],["yaml-1.1",Yne]]),Jne={binary:Eq,bool:kq,float:h5e,floatExp:f5e,floatNaN:d5e,floatTime:E5e,int:g5e,intHex:b5e,intOct:m5e,intTime:S5e,map:uO,merge:Fp,null:QM,omap:Aq,pairs:Cq,seq:dO,set:_q,timestamp:HM},oRt={"tag:yaml.org,2002:binary":Eq,"tag:yaml.org,2002:merge":Fp,"tag:yaml.org,2002:omap":Aq,"tag:yaml.org,2002:pairs":Cq,"tag:yaml.org,2002:set":_q,"tag:yaml.org,2002:timestamp":HM};function Q4(e,t,n){const i=Zne.get(t);if(i&&!e)return n&&!i.includes(Fp)?i.concat(Fp):i.slice();let r=i;if(!r)if(Array.isArray(e))r=[];else{const s=Array.from(Zne.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${s} or define customTags array`)}if(Array.isArray(e))for(const s of e)r=r.concat(s);else typeof e=="function"&&(r=e(r.slice()));return n&&(r=r.concat(Fp)),r.reduce((s,o)=>{const l=typeof o=="string"?Jne[o]:o;if(!l){const c=JSON.stringify(o),u=Object.keys(Jne).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${u}`)}return s.includes(l)||s.push(l),s},[])}const lRt=(e,t)=>e.keyt.key?1:0;let cRt=class C5e{constructor({compat:t,customTags:n,merge:i,resolveKnownTags:r,schema:s,sortMapEntries:o,toStringDefaults:l}){this.compat=Array.isArray(t)?Q4(t,"compat"):t?Q4(null,t):null,this.name=typeof s=="string"&&s||"core",this.knownTags=r?oRt:{},this.tags=Q4(n,this.name,i),this.toStringOptions=l??null,Object.defineProperty(this,$g,{value:uO}),Object.defineProperty(this,Eh,{value:UM}),Object.defineProperty(this,oO,{value:dO}),this.sortMapEntries=typeof o=="function"?o:o===!0?lRt:null}clone(){const t=Object.create(C5e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function uRt(e,t){var c;const n=[];let i=t.directives===!0;if(t.directives!==!1&&e.directives){const u=e.directives.toString(e);u?(n.push(u),i=!0):e.directives.docStart&&(i=!0)}i&&n.push("---");const r=s5e(e,t),{commentString:s}=r.options;if(e.commentBefore){n.length!==1&&n.unshift("");const u=s(e.commentBefore);n.unshift(Ep(u,""))}let o=!1,l=null;if(e.contents){if(_a(e.contents)){if(e.contents.spaceBefore&&i&&n.push(""),e.contents.commentBefore){const f=s(e.contents.commentBefore);n.push(Ep(f,""))}r.forceBlockIndent=!!e.comment,l=e.contents.comment}const u=l?void 0:()=>o=!0;let d=o1(e.contents,r,()=>l=null,u);l&&(d+=Ry(d,"",s(l))),(d[0]==="|"||d[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${d}`:n.push(d)}else n.push(o1(e.contents,r));if((c=e.directives)!=null&&c.docEnd)if(e.comment){const u=s(e.comment);u.includes(` -`)?(n.push("..."),n.push(Ep(u,""))):n.push(`... ${u}`)}else n.push("...");else{let u=e.comment;u&&o&&(u=u.replace(/^\n+/,"")),u&&((!o||l)&&n[n.length-1]!==""&&n.push(""),n.push(Ep(s(u),"")))}return n.join(` +${s.comment}`:i.comment}i=r}e.items[n]=ja(i)?i:new sc(i)}}else t("Expected a sequence for this tag");return e}function x5e(e,t,n){const{replacer:i}=n,r=new x0(e);r.tag="tag:yaml.org,2002:pairs";let s=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof i=="function"&&(o=i.call(t,String(s++),o));let l,c;if(Array.isArray(o))if(o.length===2)l=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const u=Object.keys(o);if(u.length===1)l=u[0],c=o[l];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else l=o;r.items.push(kq(l,c,n))}return r}const Aq={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:v5e,createNode:x5e};class pw extends x0{constructor(){super(),this.add=dd.prototype.add.bind(this),this.delete=dd.prototype.delete.bind(this),this.get=dd.prototype.get.bind(this),this.has=dd.prototype.has.bind(this),this.set=dd.prototype.set.bind(this),this.tag=pw.tag}toJSON(t,n){if(!n)return super.toJSON(t);const i=new Map;n!=null&&n.onCreate&&n.onCreate(i);for(const r of this.items){let s,o;if(ja(r)?(s=Ed(r.key,"",n),o=Ed(r.value,s,n)):s=Ed(r,"",n),i.has(s))throw new Error("Ordered maps must not include duplicate keys");i.set(s,o)}return i}static from(t,n,i){const r=x5e(t,n,i),s=new this;return s.items=r.items,s}}pw.tag="tag:yaml.org,2002:omap";const Tq={collection:"seq",identify:e=>e instanceof Map,nodeClass:pw,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=v5e(e,t),i=[];for(const{key:r}of n.items)xs(r)&&(i.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new pw,n)},createNode:(e,t,n)=>pw.from(e,t,n)};function w5e({value:e,source:t},n){return t&&(e?O5e:k5e).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const O5e={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new wi(!0),stringify:w5e},k5e={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new wi(!1),stringify:w5e},nRt={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:jf},iRt={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():jf(e)}},rRt={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new wi(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const i=e.substring(n+1).replace(/_/g,"");i[i.length-1]==="0"&&(t.minFractionDigits=i.length)}return t},stringify:jf},ET=e=>typeof e=="bigint"||Number.isInteger(e);function VM(e,t,n,{intAsBigInt:i}){const r=e[0];if((r==="-"||r==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),i){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const o=BigInt(e);return r==="-"?BigInt(-1)*o:o}const s=parseInt(e,n);return r==="-"?-1*s:s}function _q(e,t,n){const{value:i}=e;if(ET(i)){const r=i.toString(t);return i<0?"-"+n+r.substr(1):n+r}return jf(e)}const sRt={identify:ET,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>VM(e,2,2,n),stringify:e=>_q(e,2,"0b")},aRt={identify:ET,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>VM(e,1,8,n),stringify:e=>_q(e,8,"0")},oRt={identify:ET,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>VM(e,0,10,n),stringify:jf},lRt={identify:ET,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>VM(e,2,16,n),stringify:e=>_q(e,16,"0x")};class mw extends dd{constructor(t){super(t),this.tag=mw.tag}add(t){let n;ja(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new sc(t.key,null):n=new sc(t,null),Py(this.items,n.key)||this.items.push(n)}get(t,n){const i=Py(this.items,t);return!n&&ja(i)?xs(i.key)?i.key.value:i.key:i}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const i=Py(this.items,t);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new sc(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,i){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,i);throw new Error("Set items must all have null values")}static from(t,n,i){const{replacer:r}=i,s=new this(t);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof r=="function"&&(o=r.call(n,o,o)),s.items.push(kq(o,null,i));return s}}mw.tag="tag:yaml.org,2002:set";const jq={collection:"map",identify:e=>e instanceof Set,nodeClass:mw,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>mw.from(e,t,n),resolve(e,t){if(kT(e)){if(e.hasAllNullValues(!0))return Object.assign(new mw,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function Nq(e,t){const n=e[0],i=n==="-"||n==="+"?e.substring(1):e,r=o=>t?BigInt(o):Number(o),s=i.replace(/_/g,"").split(":").reduce((o,l)=>o*r(60)+r(l),r(0));return n==="-"?r(-1)*s:s}function S5e(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return jf(e);let i="";t<0&&(i="-",t*=n(-1));const r=n(60),s=[t%r];return t<60?s.unshift(0):(t=(t-s[0])/r,s.unshift(t%r),t>=60&&(t=(t-s[0])/r,s.unshift(t))),i+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const E5e={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>Nq(e,n),stringify:S5e},C5e={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>Nq(e,!1),stringify:S5e},HM={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(HM.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,i,r,s,o,l]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0;let u=Date.UTC(n,i-1,r,s||0,o||0,l||0,c);const d=t[8];if(d&&d!=="Z"){let f=Nq(d,!1);Math.abs(f)<30&&(f*=60),u-=6e4*f}return new Date(u)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},Zne=[dO,fO,UM,QM,O5e,k5e,sRt,aRt,oRt,lRt,nRt,iRt,rRt,Cq,Bp,Tq,Aq,jq,E5e,C5e,HM],Jne=new Map([["core",ZNt],["failsafe",[dO,fO,UM]],["json",tRt],["yaml11",Zne],["yaml-1.1",Zne]]),eie={binary:Cq,bool:Sq,float:p5e,floatExp:h5e,floatNaN:f5e,floatTime:C5e,int:b5e,intHex:y5e,intOct:g5e,intTime:E5e,map:dO,merge:Bp,null:QM,omap:Tq,pairs:Aq,seq:fO,set:jq,timestamp:HM},cRt={"tag:yaml.org,2002:binary":Cq,"tag:yaml.org,2002:merge":Bp,"tag:yaml.org,2002:omap":Tq,"tag:yaml.org,2002:pairs":Aq,"tag:yaml.org,2002:set":jq,"tag:yaml.org,2002:timestamp":HM};function z4(e,t,n){const i=Jne.get(t);if(i&&!e)return n&&!i.includes(Bp)?i.concat(Bp):i.slice();let r=i;if(!r)if(Array.isArray(e))r=[];else{const s=Array.from(Jne.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${s} or define customTags array`)}if(Array.isArray(e))for(const s of e)r=r.concat(s);else typeof e=="function"&&(r=e(r.slice()));return n&&(r=r.concat(Bp)),r.reduce((s,o)=>{const l=typeof o=="string"?eie[o]:o;if(!l){const c=JSON.stringify(o),u=Object.keys(eie).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${u}`)}return s.includes(l)||s.push(l),s},[])}const uRt=(e,t)=>e.keyt.key?1:0;let dRt=class A5e{constructor({compat:t,customTags:n,merge:i,resolveKnownTags:r,schema:s,sortMapEntries:o,toStringDefaults:l}){this.compat=Array.isArray(t)?z4(t,"compat"):t?z4(null,t):null,this.name=typeof s=="string"&&s||"core",this.knownTags=r?cRt:{},this.tags=z4(n,this.name,i),this.toStringOptions=l??null,Object.defineProperty(this,Fg,{value:dO}),Object.defineProperty(this,Ch,{value:UM}),Object.defineProperty(this,lO,{value:fO}),this.sortMapEntries=typeof o=="function"?o:o===!0?uRt:null}clone(){const t=Object.create(A5e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function fRt(e,t){var c;const n=[];let i=t.directives===!0;if(t.directives!==!1&&e.directives){const u=e.directives.toString(e);u?(n.push(u),i=!0):e.directives.docStart&&(i=!0)}i&&n.push("---");const r=a5e(e,t),{commentString:s}=r.options;if(e.commentBefore){n.length!==1&&n.unshift("");const u=s(e.commentBefore);n.unshift(Cp(u,""))}let o=!1,l=null;if(e.contents){if(_a(e.contents)){if(e.contents.spaceBefore&&i&&n.push(""),e.contents.commentBefore){const f=s(e.contents.commentBefore);n.push(Cp(f,""))}r.forceBlockIndent=!!e.comment,l=e.contents.comment}const u=l?void 0:()=>o=!0;let d=l1(e.contents,r,()=>l=null,u);l&&(d+=Iy(d,"",s(l))),(d[0]==="|"||d[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${d}`:n.push(d)}else n.push(l1(e.contents,r));if((c=e.directives)!=null&&c.docEnd)if(e.comment){const u=s(e.comment);u.includes(` +`)?(n.push("..."),n.push(Cp(u,""))):n.push(`... ${u}`)}else n.push("...");else{let u=e.comment;u&&o&&(u=u.replace(/^\n+/,"")),u&&((!o||l)&&n[n.length-1]!==""&&n.push(""),n.push(Cp(s(u),"")))}return n.join(` `)+` -`}class ET{constructor(t,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,_d,{value:f9});let r=null;typeof n=="function"||Array.isArray(n)?r=n:i===void 0&&n&&(i=n,n=void 0);const s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=s;let{version:o}=s;i!=null&&i._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Xl({version:o}),this.setSchema(o,i),this.contents=t===void 0?null:this.createNode(t,r,i)}clone(){const t=Object.create(ET.prototype,{[_d]:{value:f9}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=_a(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Qv(this.contents)&&this.contents.add(t)}addIn(t,n){Qv(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const i=e5e(this);t.anchor=!n||i.has(n)?t5e(n||"a",i):n}return new xq(t.anchor)}createNode(t,n,i){let r;if(typeof n=="function")t=n.call({"":t},"",t),r=n;else if(Array.isArray(n)){const v=w=>typeof w=="number"||w instanceof String||w instanceof Number,y=n.filter(v).map(String);y.length>0&&(n=n.concat(y)),r=n}else i===void 0&&n&&(i=n,n=void 0);const{aliasDuplicateObjects:s,anchorPrefix:o,flow:l,keepUndefined:c,onTagObj:u,tag:d}=i??{},{onAnchor:f,setAnchors:h,sourceObjects:m}=LNt(this,o||"a"),g={aliasDuplicateObjects:s??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:u,replacer:r,schema:this.schema,sourceObjects:m},b=_C(t,d,g);return l&&Ca(b)&&(b.flow=!0),h(),b}createPair(t,n,i={}){const r=this.createNode(t,null,i),s=this.createNode(n,null,i);return new sc(r,s)}delete(t){return Qv(this.contents)?this.contents.delete(t):!1}deleteIn(t){return mS(t)?this.contents==null?!1:(this.contents=null,!0):Qv(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return Ca(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return mS(t)?!n&&xs(this.contents)?this.contents.value:this.contents:Ca(this.contents)?this.contents.getIn(t,n):void 0}has(t){return Ca(this.contents)?this.contents.has(t):!1}hasIn(t){return mS(t)?this.contents!==void 0:Ca(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=MI(this.schema,[t],n):Qv(this.contents)&&this.contents.set(t,n)}setIn(t,n){mS(t)?this.contents=n:this.contents==null?this.contents=MI(this.schema,Array.from(t),n):Qv(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let i;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Xl({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new Xl({version:t}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{const r=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(i)this.schema=new cRt(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:i,maxAliasCount:r,onAnchor:s,reviver:o}={}){const l={anchors:new Map,doc:this,keep:!t,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=kd(this.contents,n??"",l);if(typeof s=="function")for(const{count:u,res:d}of l.anchors.values())s(d,u);return typeof o=="function"?Lx(o,{"":c},"",c):c}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return uRt(this,t)}}function Qv(e){if(Ca(e))return!0;throw new Error("Expected a YAML collection as document contents")}class A5e extends Error{constructor(t,n,i,r){super(),this.name=t,this.code=i,this.message=r,this.pos=n}}class gS extends A5e{constructor(t,n,i){super("YAMLParseError",t,n,i)}}class dRt extends A5e{constructor(t,n,i){super("YAMLWarning",t,n,i)}}const eie=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(l=>t.linePos(l));const{line:i,col:r}=n.linePos[0];n.message+=` at line ${i}, column ${r}`;let s=r-1,o=e.substring(t.lineStarts[i-1],t.lineStarts[i]).replace(/[\n\r]+$/,"");if(s>=60&&o.length>80){const l=Math.min(s-39,o.length-79);o="…"+o.substring(l),s-=l-1}if(o.length>80&&(o=o.substring(0,79)+"…"),i>1&&/^ *$/.test(o.substring(0,s))){let l=e.substring(t.lineStarts[i-2],t.lineStarts[i-1]);l.length>80&&(l=l.substring(0,79)+`… +`}class CT{constructor(t,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Nd,{value:h9});let r=null;typeof n=="function"||Array.isArray(n)?r=n:i===void 0&&n&&(i=n,n=void 0);const s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=s;let{version:o}=s;i!=null&&i._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Xl({version:o}),this.setSchema(o,i),this.contents=t===void 0?null:this.createNode(t,r,i)}clone(){const t=Object.create(CT.prototype,{[Nd]:{value:h9}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=_a(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){zv(this.contents)&&this.contents.add(t)}addIn(t,n){zv(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const i=t5e(this);t.anchor=!n||i.has(n)?n5e(n||"a",i):n}return new wq(t.anchor)}createNode(t,n,i){let r;if(typeof n=="function")t=n.call({"":t},"",t),r=n;else if(Array.isArray(n)){const v=w=>typeof w=="number"||w instanceof String||w instanceof Number,y=n.filter(v).map(String);y.length>0&&(n=n.concat(y)),r=n}else i===void 0&&n&&(i=n,n=void 0);const{aliasDuplicateObjects:s,anchorPrefix:o,flow:l,keepUndefined:c,onTagObj:u,tag:d}=i??{},{onAnchor:f,setAnchors:h,sourceObjects:m}=FNt(this,o||"a"),g={aliasDuplicateObjects:s??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:u,replacer:r,schema:this.schema,sourceObjects:m},b=jC(t,d,g);return l&&Ca(b)&&(b.flow=!0),h(),b}createPair(t,n,i={}){const r=this.createNode(t,null,i),s=this.createNode(n,null,i);return new sc(r,s)}delete(t){return zv(this.contents)?this.contents.delete(t):!1}deleteIn(t){return gS(t)?this.contents==null?!1:(this.contents=null,!0):zv(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return Ca(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return gS(t)?!n&&xs(this.contents)?this.contents.value:this.contents:Ca(this.contents)?this.contents.getIn(t,n):void 0}has(t){return Ca(this.contents)?this.contents.has(t):!1}hasIn(t){return gS(t)?this.contents!==void 0:Ca(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=MI(this.schema,[t],n):zv(this.contents)&&this.contents.set(t,n)}setIn(t,n){gS(t)?this.contents=n:this.contents==null?this.contents=MI(this.schema,Array.from(t),n):zv(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let i;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Xl({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new Xl({version:t}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{const r=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(i)this.schema=new dRt(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:i,maxAliasCount:r,onAnchor:s,reviver:o}={}){const l={anchors:new Map,doc:this,keep:!t,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=Ed(this.contents,n??"",l);if(typeof s=="function")for(const{count:u,res:d}of l.anchors.values())s(d,u);return typeof o=="function"?$x(o,{"":c},"",c):c}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return fRt(this,t)}}function zv(e){if(Ca(e))return!0;throw new Error("Expected a YAML collection as document contents")}class T5e extends Error{constructor(t,n,i,r){super(),this.name=t,this.code=i,this.message=r,this.pos=n}}class bS extends T5e{constructor(t,n,i){super("YAMLParseError",t,n,i)}}class hRt extends T5e{constructor(t,n,i){super("YAMLWarning",t,n,i)}}const tie=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(l=>t.linePos(l));const{line:i,col:r}=n.linePos[0];n.message+=` at line ${i}, column ${r}`;let s=r-1,o=e.substring(t.lineStarts[i-1],t.lineStarts[i]).replace(/[\n\r]+$/,"");if(s>=60&&o.length>80){const l=Math.min(s-39,o.length-79);o="…"+o.substring(l),s-=l-1}if(o.length>80&&(o=o.substring(0,79)+"…"),i>1&&/^ *$/.test(o.substring(0,s))){let l=e.substring(t.lineStarts[i-2],t.lineStarts[i-1]);l.length>80&&(l=l.substring(0,79)+`… `),o=l+o}if(/[^ ]/.test(o)){let l=1;const c=n.linePos[1];(c==null?void 0:c.line)===i&&c.col>r&&(l=Math.max(1,Math.min(c.col-r,80-s)));const u=" ".repeat(s)+"^".repeat(l);n.message+=`: ${o} ${u} -`}};function l1(e,{flow:t,indicator:n,next:i,offset:r,onError:s,parentIndent:o,startOnNewline:l}){let c=!1,u=l,d=l,f="",h="",m=!1,g=!1,b=null,v=null,y=null,w=null,x=null,O=null,k=null;for(const E of e)switch(g&&(E.type!=="space"&&E.type!=="newline"&&E.type!=="comma"&&s(E.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g=!1),b&&(u&&E.type!=="comment"&&E.type!=="newline"&&s(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),b=null),E.type){case"space":!t&&(n!=="doc-start"||(i==null?void 0:i.type)!=="flow-collection")&&E.source.includes(" ")&&(b=E),d=!0;break;case"comment":{d||s(E,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const j=E.source.substring(1)||" ";f?f+=h+j:f=j,h="",u=!1;break}case"newline":u?f?f+=E.source:(!O||n!=="seq-item-ind")&&(c=!0):h+=E.source,u=!0,m=!0,(v||y)&&(w=E),d=!0;break;case"anchor":v&&s(E,"MULTIPLE_ANCHORS","A node can have at most one anchor"),E.source.endsWith(":")&&s(E.offset+E.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),v=E,k??(k=E.offset),u=!1,d=!1,g=!0;break;case"tag":{y&&s(E,"MULTIPLE_TAGS","A node can have at most one tag"),y=E,k??(k=E.offset),u=!1,d=!1,g=!0;break}case n:(v||y)&&s(E,"BAD_PROP_ORDER",`Anchors and tags must be after the ${E.source} indicator`),O&&s(E,"UNEXPECTED_TOKEN",`Unexpected ${E.source} in ${t??"collection"}`),O=E,u=n==="seq-item-ind"||n==="explicit-key-ind",d=!1;break;case"comma":if(t){x&&s(E,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),x=E,u=!1,d=!1;break}default:s(E,"UNEXPECTED_TOKEN",`Unexpected ${E.type} token`),u=!1,d=!1}const S=e[e.length-1],C=S?S.offset+S.source.length:r;return g&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&s(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),b&&(u&&b.indent<=o||(i==null?void 0:i.type)==="block-map"||(i==null?void 0:i.type)==="block-seq")&&s(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:x,found:O,spaceBefore:c,comment:f,hasNewline:m,anchor:v,tag:y,newlineAfterProp:w,end:C,start:k??C}}function jC(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(` -`))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(jC(t.key)||jC(t.value))return!0}return!1;default:return!0}}function g9(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const i=t.end[0];i.indent===e&&(i.source==="]"||i.source==="}")&&jC(t)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function T5e(e,t,n){const{uniqueKeys:i}=e.options;if(i===!1)return!1;const r=typeof i=="function"?i:(s,o)=>s===o||xs(s)&&xs(o)&&s.value===o.value;return t.some(s=>r(s.key,n))}const tie="All mapping items must start at the same column";function fRt({composeNode:e,composeEmptyNode:t},n,i,r,s){var d;const o=(s==null?void 0:s.nodeClass)??ud,l=new o(n.schema);n.atRoot&&(n.atRoot=!1);let c=i.offset,u=null;for(const f of i.items){const{start:h,key:m,sep:g,value:b}=f,v=l1(h,{indicator:"explicit-key-ind",next:m??(g==null?void 0:g[0]),offset:c,onError:r,parentIndent:i.indent,startOnNewline:!0}),y=!v.found;if(y){if(m&&(m.type==="block-seq"?r(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in m&&m.indent!==i.indent&&r(c,"BAD_INDENT",tie)),!v.anchor&&!v.tag&&!g){u=v.end,v.comment&&(l.comment?l.comment+=` -`+v.comment:l.comment=v.comment);continue}(v.newlineAfterProp||jC(m))&&r(m??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((d=v.found)==null?void 0:d.indent)!==i.indent&&r(c,"BAD_INDENT",tie);n.atKey=!0;const w=v.end,x=m?e(n,m,v,r):t(n,w,h,null,v,r);n.schema.compat&&g9(i.indent,m,r),n.atKey=!1,T5e(n,l.items,x)&&r(w,"DUPLICATE_KEY","Map keys must be unique");const O=l1(g??[],{indicator:"map-value-ind",next:b,offset:x.range[2],onError:r,parentIndent:i.indent,startOnNewline:!m||m.type==="block-scalar"});if(c=O.end,O.found){y&&((b==null?void 0:b.type)==="block-map"&&!O.hasNewline&&r(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&v.starte&&(e.type==="block-map"||e.type==="block-seq");function pRt({composeNode:e,composeEmptyNode:t},n,i,r,s){var v;const o=i.start.source==="{",l=o?"flow map":"flow sequence",c=(s==null?void 0:s.nodeClass)??(o?ud:v0),u=new c(n.schema);u.flow=!0;const d=n.atRoot;d&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=i.offset+i.start.source.length;for(let y=0;y0){const y=CT(g,b,n.options.strict,r);y.comment&&(u.comment?u.comment+=` -`+y.comment:u.comment=y.comment),u.range=[i.offset,b,y.offset]}else u.range=[i.offset,b,b];return u}function H4(e,t,n,i,r,s){const o=n.type==="block-map"?fRt(e,t,n,i,s):n.type==="block-seq"?hRt(e,t,n,i,s):pRt(e,t,n,i,s),l=o.constructor;return r==="!"||r===l.tagName?(o.tag=l.tagName,o):(r&&(o.tag=r),o)}function mRt(e,t,n,i,r){var h;const s=i.tag,o=s?t.directives.tagName(s.source,m=>r(s,"TAG_RESOLVE_FAILED",m)):null;if(n.type==="block-seq"){const{anchor:m,newlineAfterProp:g}=i,b=m&&s?m.offset>s.offset?m:s:m??s;b&&(!g||g.offsetm.tag===o&&m.collection===l);if(!c){const m=t.schema.knownTags[o];if((m==null?void 0:m.collection)===l)t.schema.tags.push(Object.assign({},m,{default:!1})),c=m;else return m?r(s,"BAD_COLLECTION_TYPE",`${m.tag} used for ${l} collection, but expects ${m.collection??"scalar"}`,!0):r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),H4(e,t,n,r,o)}const u=H4(e,t,n,r,o,c),d=((h=c.resolve)==null?void 0:h.call(c,u,m=>r(s,"TAG_RESOLVE_FAILED",m),t.options))??u,f=_a(d)?d:new wi(d);return f.range=u.range,f.tag=o,c!=null&&c.format&&(f.format=c.format),f}function gRt(e,t,n){const i=t.offset,r=bRt(t,e.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};const s=r.mode===">"?wi.BLOCK_FOLDED:wi.BLOCK_LITERAL,o=t.source?yRt(t.source):[];let l=o.length;for(let b=o.length-1;b>=0;--b){const v=o[b][1];if(v===""||v==="\r")l=b;else break}if(l===0){const b=r.chomp==="+"&&o.length>0?` +`}};function c1(e,{flow:t,indicator:n,next:i,offset:r,onError:s,parentIndent:o,startOnNewline:l}){let c=!1,u=l,d=l,f="",h="",m=!1,g=!1,b=null,v=null,y=null,w=null,x=null,O=null,k=null;for(const E of e)switch(g&&(E.type!=="space"&&E.type!=="newline"&&E.type!=="comma"&&s(E.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g=!1),b&&(u&&E.type!=="comment"&&E.type!=="newline"&&s(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),b=null),E.type){case"space":!t&&(n!=="doc-start"||(i==null?void 0:i.type)!=="flow-collection")&&E.source.includes(" ")&&(b=E),d=!0;break;case"comment":{d||s(E,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const j=E.source.substring(1)||" ";f?f+=h+j:f=j,h="",u=!1;break}case"newline":u?f?f+=E.source:(!O||n!=="seq-item-ind")&&(c=!0):h+=E.source,u=!0,m=!0,(v||y)&&(w=E),d=!0;break;case"anchor":v&&s(E,"MULTIPLE_ANCHORS","A node can have at most one anchor"),E.source.endsWith(":")&&s(E.offset+E.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),v=E,k??(k=E.offset),u=!1,d=!1,g=!0;break;case"tag":{y&&s(E,"MULTIPLE_TAGS","A node can have at most one tag"),y=E,k??(k=E.offset),u=!1,d=!1,g=!0;break}case n:(v||y)&&s(E,"BAD_PROP_ORDER",`Anchors and tags must be after the ${E.source} indicator`),O&&s(E,"UNEXPECTED_TOKEN",`Unexpected ${E.source} in ${t??"collection"}`),O=E,u=n==="seq-item-ind"||n==="explicit-key-ind",d=!1;break;case"comma":if(t){x&&s(E,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),x=E,u=!1,d=!1;break}default:s(E,"UNEXPECTED_TOKEN",`Unexpected ${E.type} token`),u=!1,d=!1}const S=e[e.length-1],C=S?S.offset+S.source.length:r;return g&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&s(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),b&&(u&&b.indent<=o||(i==null?void 0:i.type)==="block-map"||(i==null?void 0:i.type)==="block-seq")&&s(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:x,found:O,spaceBefore:c,comment:f,hasNewline:m,anchor:v,tag:y,newlineAfterProp:w,end:C,start:k??C}}function NC(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(` +`))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(NC(t.key)||NC(t.value))return!0}return!1;default:return!0}}function b9(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const i=t.end[0];i.indent===e&&(i.source==="]"||i.source==="}")&&NC(t)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function _5e(e,t,n){const{uniqueKeys:i}=e.options;if(i===!1)return!1;const r=typeof i=="function"?i:(s,o)=>s===o||xs(s)&&xs(o)&&s.value===o.value;return t.some(s=>r(s.key,n))}const nie="All mapping items must start at the same column";function pRt({composeNode:e,composeEmptyNode:t},n,i,r,s){var d;const o=(s==null?void 0:s.nodeClass)??dd,l=new o(n.schema);n.atRoot&&(n.atRoot=!1);let c=i.offset,u=null;for(const f of i.items){const{start:h,key:m,sep:g,value:b}=f,v=c1(h,{indicator:"explicit-key-ind",next:m??(g==null?void 0:g[0]),offset:c,onError:r,parentIndent:i.indent,startOnNewline:!0}),y=!v.found;if(y){if(m&&(m.type==="block-seq"?r(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in m&&m.indent!==i.indent&&r(c,"BAD_INDENT",nie)),!v.anchor&&!v.tag&&!g){u=v.end,v.comment&&(l.comment?l.comment+=` +`+v.comment:l.comment=v.comment);continue}(v.newlineAfterProp||NC(m))&&r(m??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((d=v.found)==null?void 0:d.indent)!==i.indent&&r(c,"BAD_INDENT",nie);n.atKey=!0;const w=v.end,x=m?e(n,m,v,r):t(n,w,h,null,v,r);n.schema.compat&&b9(i.indent,m,r),n.atKey=!1,_5e(n,l.items,x)&&r(w,"DUPLICATE_KEY","Map keys must be unique");const O=c1(g??[],{indicator:"map-value-ind",next:b,offset:x.range[2],onError:r,parentIndent:i.indent,startOnNewline:!m||m.type==="block-scalar"});if(c=O.end,O.found){y&&((b==null?void 0:b.type)==="block-map"&&!O.hasNewline&&r(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&v.starte&&(e.type==="block-map"||e.type==="block-seq");function gRt({composeNode:e,composeEmptyNode:t},n,i,r,s){var v;const o=i.start.source==="{",l=o?"flow map":"flow sequence",c=(s==null?void 0:s.nodeClass)??(o?dd:x0),u=new c(n.schema);u.flow=!0;const d=n.atRoot;d&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=i.offset+i.start.source.length;for(let y=0;y0){const y=AT(g,b,n.options.strict,r);y.comment&&(u.comment?u.comment+=` +`+y.comment:u.comment=y.comment),u.range=[i.offset,b,y.offset]}else u.range=[i.offset,b,b];return u}function q4(e,t,n,i,r,s){const o=n.type==="block-map"?pRt(e,t,n,i,s):n.type==="block-seq"?mRt(e,t,n,i,s):gRt(e,t,n,i,s),l=o.constructor;return r==="!"||r===l.tagName?(o.tag=l.tagName,o):(r&&(o.tag=r),o)}function bRt(e,t,n,i,r){var h;const s=i.tag,o=s?t.directives.tagName(s.source,m=>r(s,"TAG_RESOLVE_FAILED",m)):null;if(n.type==="block-seq"){const{anchor:m,newlineAfterProp:g}=i,b=m&&s?m.offset>s.offset?m:s:m??s;b&&(!g||g.offsetm.tag===o&&m.collection===l);if(!c){const m=t.schema.knownTags[o];if((m==null?void 0:m.collection)===l)t.schema.tags.push(Object.assign({},m,{default:!1})),c=m;else return m?r(s,"BAD_COLLECTION_TYPE",`${m.tag} used for ${l} collection, but expects ${m.collection??"scalar"}`,!0):r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),q4(e,t,n,r,o)}const u=q4(e,t,n,r,o,c),d=((h=c.resolve)==null?void 0:h.call(c,u,m=>r(s,"TAG_RESOLVE_FAILED",m),t.options))??u,f=_a(d)?d:new wi(d);return f.range=u.range,f.tag=o,c!=null&&c.format&&(f.format=c.format),f}function yRt(e,t,n){const i=t.offset,r=vRt(t,e.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};const s=r.mode===">"?wi.BLOCK_FOLDED:wi.BLOCK_LITERAL,o=t.source?xRt(t.source):[];let l=o.length;for(let b=o.length-1;b>=0;--b){const v=o[b][1];if(v===""||v==="\r")l=b;else break}if(l===0){const b=r.chomp==="+"&&o.length>0?` `.repeat(Math.max(1,o.length-1)):"";let v=i+r.length;return t.source&&(v+=t.source.length),{value:b,type:s,comment:r.comment,range:[i,v,v]}}let c=t.indent+r.indent,u=t.offset+r.length,d=0;for(let b=0;bc&&(c=v.length);else{v.length=l;--b)o[b][0].length>c&&(l=b+1);let f="",h="",m=!1;for(let b=0;bc||y[0]===" "?(h===" "?h=` @@ -683,66 +683,66 @@ ${u} `+o[b][0].slice(c);f[f.length-1]!==` `&&(f+=` `);break;default:f+=` -`}const g=i+r.length+t.source.length;return{value:f,type:s,comment:r.comment,range:[i,g,g]}}function bRt({offset:e,props:t},n,i){if(t[0].type!=="block-scalar-header")return i(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:r}=t[0],s=r[0];let o=0,l="",c=-1;for(let h=1;hn(i+h,m,g);switch(r){case"scalar":l=wi.PLAIN,c=xRt(s,u);break;case"single-quoted-scalar":l=wi.QUOTE_SINGLE,c=wRt(s,u);break;case"double-quoted-scalar":l=wi.QUOTE_DOUBLE,c=ORt(s,u);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[i,i+s.length,i+s.length]}}const d=i+s.length,f=CT(o,d,t,n);return{value:c,type:l,comment:f.comment,range:[i,d,f.offset]}}function xRt(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),_5e(e)}function wRt(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),_5e(e.slice(1,-1)).replace(/''/g,"'")}function _5e(e){let t,n;try{t=new RegExp(`(.*?)(?n(i+h,m,g);switch(r){case"scalar":l=wi.PLAIN,c=ORt(s,u);break;case"single-quoted-scalar":l=wi.QUOTE_SINGLE,c=kRt(s,u);break;case"double-quoted-scalar":l=wi.QUOTE_DOUBLE,c=SRt(s,u);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[i,i+s.length,i+s.length]}}const d=i+s.length,f=AT(o,d,t,n);return{value:c,type:l,comment:f.comment,range:[i,d,f.offset]}}function ORt(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),j5e(e)}function kRt(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),j5e(e.slice(1,-1)).replace(/''/g,"'")}function j5e(e){let t,n;try{t=new RegExp(`(.*?)(?s?e.slice(s,i+1):r)}else n+=r}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function kRt(e,t){let n="",i=e[t+1];for(;(i===" "||i===" "||i===` +`)&&(n+=i>s?e.slice(s,i+1):r)}else n+=r}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function ERt(e,t){let n="",i=e[t+1];for(;(i===" "||i===" "||i===` `||i==="\r")&&!(i==="\r"&&e[t+2]!==` `);)i===` `&&(n+=` -`),t+=1,i=e[t+1];return n||(n=" "),{fold:n,offset:t}}const SRt={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` -`,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function ERt(e,t,n,i){const r=e.substr(t,n),o=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(o)}catch{const l=e.substr(t-2,n+2);return i(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}function j5e(e,t,n,i){const{value:r,type:s,comment:o,range:l}=t.type==="block-scalar"?gRt(e,t,i):vRt(t,e.options.strict,i),c=n?e.directives.tagName(n.source,f=>i(n,"TAG_RESOLVE_FAILED",f)):null;let u;e.options.stringKeys&&e.atKey?u=e.schema[Eh]:c?u=CRt(e.schema,r,c,n,i):t.type==="scalar"?u=ARt(e,r,t,i):u=e.schema[Eh];let d;try{const f=u.resolve(r,h=>i(n??t,"TAG_RESOLVE_FAILED",h),e.options);d=xs(f)?f:new wi(f)}catch(f){const h=f instanceof Error?f.message:String(f);i(n??t,"TAG_RESOLVE_FAILED",h),d=new wi(r)}return d.range=l,d.source=r,s&&(d.type=s),c&&(d.tag=c),u.format&&(d.format=u.format),o&&(d.comment=o),d}function CRt(e,t,n,i,r){var l;if(n==="!")return e[Eh];const s=[];for(const c of e.tags)if(!c.collection&&c.tag===n)if(c.default&&c.test)s.push(c);else return c;for(const c of s)if((l=c.test)!=null&&l.test(t))return c;const o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[Eh])}function ARt({atKey:e,directives:t,schema:n},i,r,s){const o=n.tags.find(l=>{var c;return(l.default===!0||e&&l.default==="key")&&((c=l.test)==null?void 0:c.test(i))})||n[Eh];if(n.compat){const l=n.compat.find(c=>{var u;return c.default&&((u=c.test)==null?void 0:u.test(i))})??n[Eh];if(o.tag!==l.tag){const c=t.tagString(o.tag),u=t.tagString(l.tag),d=`Value may be parsed as either ${c} or ${u}`;s(r,"TAG_RESOLVE_FAILED",d,!0)}}return o}function TRt(e,t,n){if(t){n??(n=t.length);for(let i=n-1;i>=0;--i){let r=t[i];switch(r.type){case"space":case"comment":case"newline":e-=r.source.length;continue}for(r=t[++i];(r==null?void 0:r.type)==="space";)e+=r.source.length,r=t[++i];break}}return e}const _Rt={composeNode:N5e,composeEmptyNode:Nq};function N5e(e,t,n,i){const r=e.atKey,{spaceBefore:s,comment:o,anchor:l,tag:c}=n;let u,d=!0;switch(t.type){case"alias":u=jRt(e,t,i),(l||c)&&i(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":u=j5e(e,t,c,i),l&&(u.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=mRt(_Rt,e,t,n,i),l&&(u.anchor=l.source.substring(1))}catch(f){const h=f instanceof Error?f.message:String(f);i(t,"RESOURCE_EXHAUSTION",h)}break;default:{const f=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;i(t,"UNEXPECTED_TOKEN",f),d=!1}}return u??(u=Nq(e,t.offset,void 0,null,n,i)),l&&u.anchor===""&&i(l,"BAD_ALIAS","Anchor cannot be an empty string"),r&&e.options.stringKeys&&(!xs(u)||typeof u.value!="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str")&&i(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(u.spaceBefore=!0),o&&(t.type==="scalar"&&t.source===""?u.comment=o:u.commentBefore=o),e.options.keepSourceTokens&&d&&(u.srcToken=t),u}function Nq(e,t,n,i,{spaceBefore:r,comment:s,anchor:o,tag:l,end:c},u){const d={type:"scalar",offset:TRt(t,n,i),indent:-1,source:""},f=j5e(e,d,l,u);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&u(o,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(f.spaceBefore=!0),s&&(f.comment=s,f.range[2]=c),f}function jRt({options:e},{offset:t,source:n,end:i},r){const s=new xq(n.substring(1));s.source===""&&r(t,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&r(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=t+n.length,l=CT(i,o,e.strict,r);return s.range=[t,o,l.offset],l.comment&&(s.comment=l.comment),s}function NRt(e,t,{offset:n,start:i,value:r,end:s},o){const l=Object.assign({_directives:t},e),c=new ET(void 0,l),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=l1(i,{indicator:"doc-start",next:r??(s==null?void 0:s[0]),offset:n,onError:o,parentIndent:0,startOnNewline:!0});d.found&&(c.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!d.hasNewline&&o(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=r?N5e(u,r,d,o):Nq(u,d.end,i,null,d,o);const f=c.contents.range[2],h=CT(s,f,!1,o);return h.comment&&(c.comment=h.comment),c.range=[n,f,h.offset],c}function wk(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function nie(e){var r;let t="",n=!1,i=!1;for(let s=0;si(n,"TAG_RESOLVE_FAILED",f)):null;let u;e.options.stringKeys&&e.atKey?u=e.schema[Ch]:c?u=TRt(e.schema,r,c,n,i):t.type==="scalar"?u=_Rt(e,r,t,i):u=e.schema[Ch];let d;try{const f=u.resolve(r,h=>i(n??t,"TAG_RESOLVE_FAILED",h),e.options);d=xs(f)?f:new wi(f)}catch(f){const h=f instanceof Error?f.message:String(f);i(n??t,"TAG_RESOLVE_FAILED",h),d=new wi(r)}return d.range=l,d.source=r,s&&(d.type=s),c&&(d.tag=c),u.format&&(d.format=u.format),o&&(d.comment=o),d}function TRt(e,t,n,i,r){var l;if(n==="!")return e[Ch];const s=[];for(const c of e.tags)if(!c.collection&&c.tag===n)if(c.default&&c.test)s.push(c);else return c;for(const c of s)if((l=c.test)!=null&&l.test(t))return c;const o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[Ch])}function _Rt({atKey:e,directives:t,schema:n},i,r,s){const o=n.tags.find(l=>{var c;return(l.default===!0||e&&l.default==="key")&&((c=l.test)==null?void 0:c.test(i))})||n[Ch];if(n.compat){const l=n.compat.find(c=>{var u;return c.default&&((u=c.test)==null?void 0:u.test(i))})??n[Ch];if(o.tag!==l.tag){const c=t.tagString(o.tag),u=t.tagString(l.tag),d=`Value may be parsed as either ${c} or ${u}`;s(r,"TAG_RESOLVE_FAILED",d,!0)}}return o}function jRt(e,t,n){if(t){n??(n=t.length);for(let i=n-1;i>=0;--i){let r=t[i];switch(r.type){case"space":case"comment":case"newline":e-=r.source.length;continue}for(r=t[++i];(r==null?void 0:r.type)==="space";)e+=r.source.length,r=t[++i];break}}return e}const NRt={composeNode:R5e,composeEmptyNode:Rq};function R5e(e,t,n,i){const r=e.atKey,{spaceBefore:s,comment:o,anchor:l,tag:c}=n;let u,d=!0;switch(t.type){case"alias":u=RRt(e,t,i),(l||c)&&i(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":u=N5e(e,t,c,i),l&&(u.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=bRt(NRt,e,t,n,i),l&&(u.anchor=l.source.substring(1))}catch(f){const h=f instanceof Error?f.message:String(f);i(t,"RESOURCE_EXHAUSTION",h)}break;default:{const f=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;i(t,"UNEXPECTED_TOKEN",f),d=!1}}return u??(u=Rq(e,t.offset,void 0,null,n,i)),l&&u.anchor===""&&i(l,"BAD_ALIAS","Anchor cannot be an empty string"),r&&e.options.stringKeys&&(!xs(u)||typeof u.value!="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str")&&i(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(u.spaceBefore=!0),o&&(t.type==="scalar"&&t.source===""?u.comment=o:u.commentBefore=o),e.options.keepSourceTokens&&d&&(u.srcToken=t),u}function Rq(e,t,n,i,{spaceBefore:r,comment:s,anchor:o,tag:l,end:c},u){const d={type:"scalar",offset:jRt(t,n,i),indent:-1,source:""},f=N5e(e,d,l,u);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&u(o,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(f.spaceBefore=!0),s&&(f.comment=s,f.range[2]=c),f}function RRt({options:e},{offset:t,source:n,end:i},r){const s=new wq(n.substring(1));s.source===""&&r(t,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&r(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=t+n.length,l=AT(i,o,e.strict,r);return s.range=[t,o,l.offset],l.comment&&(s.comment=l.comment),s}function IRt(e,t,{offset:n,start:i,value:r,end:s},o){const l=Object.assign({_directives:t},e),c=new CT(void 0,l),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=c1(i,{indicator:"doc-start",next:r??(s==null?void 0:s[0]),offset:n,onError:o,parentIndent:0,startOnNewline:!0});d.found&&(c.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!d.hasNewline&&o(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=r?R5e(u,r,d,o):Rq(u,d.end,i,null,d,o);const f=c.contents.range[2],h=AT(s,f,!1,o);return h.comment&&(c.comment=h.comment),c.range=[n,f,h.offset],c}function Ok(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function iie(e){var r;let t="",n=!1,i=!1;for(let s=0;s{const o=wk(n);s?this.warnings.push(new dRt(o,i,r)):this.errors.push(new gS(o,i,r))},this.directives=new Xl({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:i,afterEmptyLine:r}=nie(this.prelude);if(i){const s=t.contents;if(n)t.comment=t.comment?`${t.comment} +`)+(o.substring(1)||" "),n=!0,i=!1;break;case"%":((r=e[s+1])==null?void 0:r[0])!=="#"&&(s+=1),n=!1;break;default:n||(i=!0),n=!1}}return{comment:t,afterEmptyLine:i}}let PRt=class{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,i,r,s)=>{const o=Ok(n);s?this.warnings.push(new hRt(o,i,r)):this.errors.push(new bS(o,i,r))},this.directives=new Xl({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:i,afterEmptyLine:r}=iie(this.prelude);if(i){const s=t.contents;if(n)t.comment=t.comment?`${t.comment} ${i}`:i;else if(r||t.directives.docStart||!s)t.commentBefore=i;else if(Ca(s)&&!s.flow&&s.items.length>0){let o=s.items[0];ja(o)&&(o=o.key);const l=o.commentBefore;o.commentBefore=l?`${i} ${l}`:i}else{const o=s.commentBefore;s.commentBefore=o?`${i} -${o}`:i}}if(n){for(let s=0;s{const s=wk(t);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",i,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=NRt(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,i=new gS(wk(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){const i="Unexpected doc-end without preceding document";this.errors.push(new gS(wk(t),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;const n=CT(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const i=this.doc.comment;this.doc.comment=i?`${i} -${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new gS(wk(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const i=Object.assign({_directives:this.directives},this.options),r=new ET(void 0,i);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}};const R5e="\uFEFF",I5e="",P5e="",b9="";function IRt(e){switch(e){case R5e:return"byte-order-mark";case I5e:return"doc-mode";case P5e:return"flow-error-end";case b9:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` +${o}`:i}}if(n){for(let s=0;s{const s=Ok(t);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",i,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=IRt(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,i=new bS(Ok(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){const i="Unexpected doc-end without preceding document";this.errors.push(new bS(Ok(t),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;const n=AT(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const i=this.doc.comment;this.doc.comment=i?`${i} +${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new bS(Ok(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const i=Object.assign({_directives:this.directives},this.options),r=new CT(void 0,i);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}};const I5e="\uFEFF",P5e="",D5e="",y9="";function DRt(e){switch(e){case I5e:return"byte-order-mark";case P5e:return"doc-mode";case D5e:return"flow-error-end";case y9:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` `:case`\r -`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function Wd(e){switch(e){case void 0:case" ":case` -`:case"\r":case" ":return!0;default:return!1}}const iie=new Set("0123456789ABCDEFabcdef"),PRt=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),L_=new Set(",[]{}"),DRt=new Set(` ,[]{} -\r `),q4=e=>!e||DRt.has(e);class MRt{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let i=this.next??"stream";for(;i&&(n||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===` +`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function Gd(e){switch(e){case void 0:case" ":case` +`:case"\r":case" ":return!0;default:return!1}}const rie=new Set("0123456789ABCDEFabcdef"),MRt=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),$_=new Set(",[]{}"),LRt=new Set(` ,[]{} +\r `),W4=e=>!e||LRt.has(e);class $Rt{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let i=this.next??"stream";for(;i&&(n||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===` `?!0:n==="\r"?this.buffer[t+1]===` `:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let i=0;for(;n===" ";)n=this.buffer[++i+t];if(n==="\r"){const r=this.buffer[i+t+1];if(r===` `||!r&&!this.atEnd)return t+i+1}return n===` -`||i>=this.indentNext||!n&&!this.atEnd?t+i:-1}if(n==="-"||n==="."){const i=this.buffer.substr(t,3);if((i==="---"||i==="...")&&Wd(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&tthis.indentValue&&!Wd(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&Wd(n)){const i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(q4),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,i=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=i=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const r=this.getLine();if(r===null)return this.setNext("flow");if((i!==-1&&i=this.indentNext||!n&&!this.atEnd?t+i:-1}if(n==="-"||n==="."){const i=this.buffer.substr(t,3);if((i==="---"||i==="...")&&Gd(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&tthis.indentValue&&!Gd(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&Gd(n)){const i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(W4),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,i=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=i=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const r=this.getLine();if(r===null)return this.setNext("flow");if((i!==-1&&i"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>Wd(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,i;e:for(let s=this.pos;i=this.buffer[s];++s)switch(i){case" ":n+=1;break;case` +`,s)}r!==-1&&(n=r-(i[r-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const n=this.buffer[++t];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>Gd(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,i;e:for(let s=this.pos;i=this.buffer[s];++s)switch(i){case" ":n+=1;break;case` `:t=s,n=0;break;case"\r":{const o=this.buffer[s+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===` `)break}default:break e}if(!i&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const s=this.continueScalar(t+1);if(s===-1)break;t=this.buffer.indexOf(` `,s)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let r=t+1;for(i=this.buffer[r];i===" ";)i=this.buffer[++r];if(i===" "){for(;i===" "||i===" "||i==="\r"||i===` `;)i=this.buffer[++r];t=r-1}else if(!this.blockScalarKeep)do{let s=t-1,o=this.buffer[s];o==="\r"&&(o=this.buffer[--s]);const l=s;for(;o===" ";)o=this.buffer[--s];if(o===` -`&&s>=this.pos&&s+1+n>l)t=s;else break}while(!0);return yield b9,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,i=this.pos-1,r;for(;r=this.buffer[++i];)if(r===":"){const s=this.buffer[i+1];if(Wd(s)||t&&L_.has(s))break;n=i}else if(Wd(r)){let s=this.buffer[i+1];if(r==="\r"&&(s===` +`&&s>=this.pos&&s+1+n>l)t=s;else break}while(!0);return yield y9,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,i=this.pos-1,r;for(;r=this.buffer[++i];)if(r===":"){const s=this.buffer[i+1];if(Gd(s)||t&&$_.has(s))break;n=i}else if(Gd(r)){let s=this.buffer[i+1];if(r==="\r"&&(s===` `?(i+=1,r=` -`,s=this.buffer[i+1]):n=i),s==="#"||t&&L_.has(s))break;if(r===` -`){const o=this.continueScalar(i+1);if(o===-1)break;i=Math.max(i,o-2)}}else{if(t&&L_.has(r))break;n=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield b9,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const i=this.buffer.slice(this.pos,t);return i?(yield i,this.pos+=i.length,i.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(q4),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,i=this.charAt(1);if(Wd(i)||n&&L_.has(i)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!Wd(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(PRt.has(n))n=this.buffer[++t];else if(n==="%"&&iie.has(this.buffer[t+1])&&iie.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===` +`,s=this.buffer[i+1]):n=i),s==="#"||t&&$_.has(s))break;if(r===` +`){const o=this.continueScalar(i+1);if(o===-1)break;i=Math.max(i,o-2)}}else{if(t&&$_.has(r))break;n=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield y9,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const i=this.buffer.slice(this.pos,t);return i?(yield i,this.pos+=i.length,i.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(W4),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,i=this.charAt(1);if(Gd(i)||n&&$_.has(i)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!Gd(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(MRt.has(n))n=this.buffer[++t];else if(n==="%"&&rie.has(this.buffer[t+1])&&rie.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===` `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===` -`?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,i;do i=this.buffer[++n];while(i===" "||t&&i===" ");const r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(t){let n=this.pos,i=this.buffer[n];for(;!t(i);)i=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class LRt{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,i=this.lineStarts.length;for(;n>1;this.lineStarts[s]=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=e[++t])==null?void 0:n.type)==="space";);return e.splice(t,e.length)}function $I(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&(t==null?void 0:t.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const i=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in i?i.indent:0:n.type==="flow-collection"&&i.type==="document"&&(n.indent=0),n.type==="flow-collection"&&sie(n),i.type){case"document":i.value=n;break;case"block-scalar":i.props.push(n);break;case"block-map":{const r=i.items[i.items.length-1];if(r.value){i.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{const r=i.items[i.items.length-1];r.value?i.items.push({start:[],value:n}):r.value=n;break}case"flow-collection":{const r=i.items[i.items.length-1];!r||r.value?i.items.push({start:[],key:n,sep:[]}):r.sep?r.value=n:Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const r=n.items[n.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&rie(r.start)===-1&&(n.indent===0||r.start.every(s=>s.type!=="comment"||s.indent0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(t){let n=this.pos,i=this.buffer[n];for(;!t(i);)i=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class FRt{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,i=this.lineStarts.length;for(;n>1;this.lineStarts[s]=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=e[++t])==null?void 0:n.type)==="space";);return e.splice(t,e.length)}function $I(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&(t==null?void 0:t.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const i=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in i?i.indent:0:n.type==="flow-collection"&&i.type==="document"&&(n.indent=0),n.type==="flow-collection"&&aie(n),i.type){case"document":i.value=n;break;case"block-scalar":i.props.push(n);break;case"block-map":{const r=i.items[i.items.length-1];if(r.value){i.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{const r=i.items[i.items.length-1];r.value?i.items.push({start:[],value:n}):r.value=n;break}case"flow-collection":{const r=i.items[i.items.length-1];!r||r.value?i.items.push({start:[],key:n,sep:[]}):r.sep?r.value=n:Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const r=n.items[n.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&sie(r.start)===-1&&(n.indent===0||r.start.every(s=>s.type!=="comment"||s.indent=t.indent){const r=!this.onKeyLine&&this.indent===t.indent,s=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let o=[];if(s&&n.sep&&!n.value){const l=[];for(let c=0;ct.indent&&(l.length=0);break;default:l.length=0}}l.length>=2&&(o=n.sep.splice(l[1]))}switch(this.type){case"anchor":case"tag":s||n.value?(o.push(this.sourceToken),t.items.push({start:o}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):s||n.value?(o.push(this.sourceToken),t.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Gm(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(D5e(n.key)&&!Gm(n.sep,"newline")){const l=zv(n.start),c=n.key,u=n.sep;u.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:c,sep:u}]})}else o.length>0?n.sep=n.sep.concat(o,this.sourceToken):n.sep.push(this.sourceToken);else if(Gm(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const l=zv(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||s?t.items.push({start:o,key:null,sep:[this.sourceToken]}):Gm(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const l=this.flowScalar(this.type);s||n.value?(t.items.push({start:o,key:l,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(l):(Object.assign(n,{key:l,sep:[]}),this.onKeyLine=!0);return}default:{const l=this.startBlockValue(t);if(l){if(l.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Gm(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&t.items.push({start:o});this.stack.push(l);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var i;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const r="end"in n.value?n.value.end:void 0,s=Array.isArray(r)?r[r.length-1]:void 0;(s==null?void 0:s.type)==="comment"?r==null||r.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const r=t.items[t.items.length-2],s=(i=r==null?void 0:r.value)==null?void 0:i.end;if(Array.isArray(s)){$I(s,n.start),s.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||Gm(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const r=this.startBlockValue(t);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while((i==null?void 0:i.type)==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const r=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const i=this.startBlockValue(t);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{const i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===t.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){const r=$_(i),s=zv(r);sie(t);const o=t.end.splice(1,t.end.length);o.push(this.sourceToken);const l={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:s,key:t,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(` +`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){var i;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const r="end"in n.value?n.value.end:void 0,s=Array.isArray(r)?r[r.length-1]:void 0;(s==null?void 0:s.type)==="comment"?r==null||r.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const r=t.items[t.items.length-2],s=(i=r==null?void 0:r.value)==null?void 0:i.end;if(Array.isArray(s)){$I(s,n.start),s.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const r=!this.onKeyLine&&this.indent===t.indent,s=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let o=[];if(s&&n.sep&&!n.value){const l=[];for(let c=0;ct.indent&&(l.length=0);break;default:l.length=0}}l.length>=2&&(o=n.sep.splice(l[1]))}switch(this.type){case"anchor":case"tag":s||n.value?(o.push(this.sourceToken),t.items.push({start:o}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):s||n.value?(o.push(this.sourceToken),t.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Xm(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(M5e(n.key)&&!Xm(n.sep,"newline")){const l=Vv(n.start),c=n.key,u=n.sep;u.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:c,sep:u}]})}else o.length>0?n.sep=n.sep.concat(o,this.sourceToken):n.sep.push(this.sourceToken);else if(Xm(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const l=Vv(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||s?t.items.push({start:o,key:null,sep:[this.sourceToken]}):Xm(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const l=this.flowScalar(this.type);s||n.value?(t.items.push({start:o,key:l,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(l):(Object.assign(n,{key:l,sep:[]}),this.onKeyLine=!0);return}default:{const l=this.startBlockValue(t);if(l){if(l.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Xm(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&t.items.push({start:o});this.stack.push(l);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var i;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const r="end"in n.value?n.value.end:void 0,s=Array.isArray(r)?r[r.length-1]:void 0;(s==null?void 0:s.type)==="comment"?r==null||r.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const r=t.items[t.items.length-2],s=(i=r==null?void 0:r.value)==null?void 0:i.end;if(Array.isArray(s)){$I(s,n.start),s.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||Xm(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const r=this.startBlockValue(t);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while((i==null?void 0:i.type)==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const r=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const i=this.startBlockValue(t);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{const i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===t.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){const r=F_(i),s=Vv(r);aie(t);const o=t.end.splice(1,t.end.length);o.push(this.sourceToken);const l={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:s,key:t,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(` `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(` -`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=$_(t),i=zv(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=$_(t),i=zv(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};function FRt(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new LRt||null,prettyErrors:t}}function M5e(e,t={}){const{lineCounter:n,prettyErrors:i}=FRt(t),r=new $Rt(n==null?void 0:n.addNewLine),s=new RRt(t);let o=null;for(const l of s.compose(r.parse(e),!0,e.length))if(!o)o=l;else if(o.options.logLevel!=="silent"){o.errors.push(new gS(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(o.errors.forEach(eie(e,n)),o.warnings.forEach(eie(e,n))),o}function BRt(e,t,n){let i;const r=M5e(e,n);if(!r)return null;if(r.warnings.forEach(s=>a5e(r.options.logLevel,s)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:i},n))}function qM(e,t,n){let i=null;if(typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){const r=Math.round(n);n=r<1?void 0:r>8?{indent:8}:{indent:r}}if(e===void 0){const{keepUndefined:r}=n??t??{};if(!r)return}return wT(e)&&!i?e.toString(n):new ET(e,i,n).toString(n)}const L5e=1024;let URt=0,hd=class{constructor(t,n){this.from=t,this.to=n}};class ui{constructor(t={}){this.id=URt++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=t.combine||null}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof t!="function"&&(t=Za.match(t)),n=>{let i=t(n);return i===void 0?null:[this,i]}}}ui.closedBy=new ui({deserialize:e=>e.split(" ")});ui.openedBy=new ui({deserialize:e=>e.split(" ")});ui.group=new ui({deserialize:e=>e.split(" ")});ui.isolate=new ui({deserialize:e=>{if(e&&e!="rtl"&&e!="ltr"&&e!="auto")throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}});ui.contextHash=new ui({perNode:!0});ui.lookAhead=new ui({perNode:!0});ui.mounted=new ui({perNode:!0});class mw{constructor(t,n,i,r=!1){this.tree=t,this.overlay=n,this.parser=i,this.bracketed=r}static get(t){return t&&t.props&&t.props[ui.mounted.id]}}const QRt=Object.create(null);class Za{constructor(t,n,i,r=0){this.name=t,this.props=n,this.id=i,this.flags=r}static define(t){let n=t.props&&t.props.length?Object.create(null):QRt,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),r=new Za(t.name||"",n,t.id,i);if(t.props){for(let s of t.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[s[0].id]=s[1]}}return r}prop(t){return this.props[t.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(t){if(typeof t=="string"){if(this.name==t)return!0;let n=this.prop(ui.group);return n?n.indexOf(t)>-1:!1}return this.id==t}static match(t){let n=Object.create(null);for(let i in t)for(let r of i.split(" "))n[r]=t[i];return i=>{for(let r=i.prop(ui.group),s=-1;s<(r?r.length:0);s++){let o=n[s<0?i.name:r[s]];if(o)return o}}}}Za.none=new Za("",Object.create(null),0,8);class fO{constructor(t){this.types=t;for(let n=0;n0;for(let c=this.cursor(o|Sr.IncludeAnonymous);;){let u=!1;if(c.from<=s&&c.to>=r&&(!l&&c.type.isAnonymous||n(c)!==!1)){if(c.firstChild())continue;u=!0}for(;u&&i&&(l||!c.type.isAnonymous)&&i(c),!c.nextSibling();){if(!c.parent())return;u=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let n in this.props)t.push([+n,this.props[n]]);return t}balance(t={}){return this.children.length<=8?this:Pq(Za.none,this.children,this.positions,0,this.children.length,0,this.length,(n,i,r)=>new Bi(this.type,n,i,r,this.propValues),t.makeTree||((n,i,r)=>new Bi(Za.none,n,i,r)))}static build(t){return qRt(t)}}Bi.empty=new Bi(Za.none,[],[],0);class Rq{constructor(t,n){this.buffer=t,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Rq(this.buffer,this.index)}}class db{constructor(t,n,i){this.buffer=t,this.length=n,this.set=i}get type(){return Za.none}toString(){let t=[];for(let n=0;n0));c=o[c+3]);return l}slice(t,n,i){let r=this.buffer,s=new Uint16Array(n-t),o=0;for(let l=t,c=0;l=t&&nt;case 1:return n<=t&&i>t;case 2:return i>t;case 4:return!0}}function NC(e,t,n,i){for(var r;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to0?l.length:-1;t!=u;t+=n){let d=l[t],f=c[t]+o.from,h;if(!(!(s&Sr.EnterBracketed&&d instanceof Bi&&(h=mw.get(d))&&!h.overlay&&h.bracketed&&i>=f&&i<=f+d.length)&&!$5e(r,i,f,f+d.length))){if(d instanceof db){if(s&Sr.ExcludeBuffers)continue;let m=d.findChild(0,d.buffer.length,n,i-f,r);if(m>-1)return new oh(new zRt(o,d,t,f),null,m)}else if(s&Sr.IncludeAnonymous||!d.type.isAnonymous||Iq(d)){let m;if(!(s&Sr.IgnoreMounts)&&(m=mw.get(d))&&!m.overlay)return new jl(m.tree,f,t,o);let g=new jl(d,f,t,o);return s&Sr.IncludeAnonymous||!g.type.isAnonymous?g:g.nextChild(n<0?d.children.length-1:0,n,i,r,s)}}}if(s&Sr.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?t=o.index+n:t=n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}prop(t){return this._tree.prop(t)}enter(t,n,i=0){let r;if(!(i&Sr.IgnoreOverlays)&&(r=mw.get(this._tree))&&r.overlay){let s=t-this.from,o=i&Sr.EnterBracketed&&r.bracketed;for(let{from:l,to:c}of r.overlay)if((n>0||o?l<=s:l=s:c>s))return new jl(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,i)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function oie(e,t,n,i){let r=e.cursor(),s=[];if(!r.firstChild())return s;if(n!=null){for(let o=!1;!o;)if(o=r.type.is(n),!r.nextSibling())return s}for(;;){if(i!=null&&r.type.is(i))return s;if(r.type.is(t)&&s.push(r.node),!r.nextSibling())return i==null?s:[]}}function y9(e,t,n=t.length-1){for(let i=e;n>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(t[n]&&t[n]!=i.name)return!1;n--}}return!0}class zRt{constructor(t,n,i,r){this.parent=t,this.buffer=n,this.index=i,this.start=r}}class oh extends F5e{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,n,i){super(),this.context=t,this._parent=n,this.index=i,this.type=t.buffer.set.types[t.buffer.buffer[i]]}child(t,n,i){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t,n-this.context.start,i);return s<0?null:new oh(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}prop(t){return this.type.prop(t)}enter(t,n,i=0){if(i&Sr.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return s<0?null:new oh(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new oh(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new oh(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],n=[],{buffer:i}=this.context,r=this.index+4,s=i.buffer[this.index+3];if(s>r){let o=i.buffer[this.index+1];t.push(i.slice(r,s,o)),n.push(0)}return new Bi(this.type,t,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function B5e(e){if(!e.length)return null;let t=0,n=e[0];for(let s=1;sn.from||o.to=t){let l=new jl(o.tree,o.overlay[0].from+s.from,-1,s);(r||(r=[i])).push(NC(l,t,n,!1))}}return r?B5e(r):i}class FI{get name(){return this.type.name}constructor(t,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~Sr.EnterBracketed,t instanceof jl)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let i=t._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=t,this.yieldBuf(t.index)}}yieldNode(t){return t?(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0):!1}yieldBuf(t,n){this.index=t;let{start:i,buffer:r}=this.buffer;return this.type=n||r.set.types[r.buffer[t]],this.from=i+r.buffer[t+1],this.to=i+r.buffer[t+2],!0}yield(t){return t?t instanceof jl?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,n,i){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,n,i,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],t,n-this.buffer.start,i);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,n,i=this.mode){return this.buffer?i&Sr.ExcludeBuffers?!1:this.enterChild(1,t,n):this.yield(this._tree.enter(t,n,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Sr.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&Sr.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode)):!1;let{buffer:n}=this.buffer,i=this.stack.length-1;if(t<0){let r=i<0?0:this.stack[i]+4;if(this.index!=r)return this.yieldBuf(n.findChild(r,this.index,-1,0,4))}else{let r=n.buffer[this.index+3];if(r<(i<0?n.buffer.length:n.buffer[this.stack[i]+3]))return this.yieldBuf(r)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let n,i,{buffer:r}=this;if(r){if(t>0){if(this.index-1)for(let s=n+t,o=t<0?-1:i._tree.children.length;s!=o;s+=t){let l=i._tree.children[s];if(this.mode&Sr.IncludeAnonymous||l instanceof db||!l.type.isAnonymous||Iq(l))return!1}return!0}move(t,n){if(n&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,n=0){for(;(this.from==this.to||(n<1?this.from>=t:this.from>t)||(n>-1?this.to<=t:this.to=0;){for(let o=t;o;o=o._parent)if(o.index==r){if(r==this.index)return o;n=o,i=s+1;break e}r=this.stack[--s]}for(let r=i;r=0;s--){if(s<0)return y9(this._tree,t,r);let o=i[n.buffer[this.stack[s]]];if(!o.isAnonymous){if(t[r]&&t[r]!=o.name)return!1;r--}}return!0}}function Iq(e){return e.children.some(t=>t instanceof db||!t.type.isAnonymous||Iq(t))}function qRt(e){var t;let{buffer:n,nodeSet:i,maxBufferLength:r=L5e,reused:s=[],minRepeatType:o=i.types.length}=e,l=Array.isArray(n)?new Rq(n,n.length):n,c=i.types,u=0,d=0;function f(k,S,C,E,j,T){let{id:R,start:A,end:N,size:P}=l,I=d,D=u;if(P<0)if(l.next(),P==-1){let V=s[R];C.push(V),E.push(A-k);return}else if(P==-3){u=R;return}else if(P==-4){d=R;return}else throw new RangeError(`Unrecognized record size: ${P}`);let _=c[R],L,F,M=A-k;if(N-A<=r&&(F=v(l.pos-S,j))){let V=new Uint16Array(F.size-F.skip),q=l.pos-F.size,U=V.length;for(;l.pos>q;)U=y(F.start,V,U);L=new db(V,N-F.start,i),M=F.start-k}else{let V=l.pos-P;l.next();let q=[],U=[],J=R>=o?R:-1,z=0,Z=N;for(;l.pos>V;)J>=0&&l.id==J&&l.size>=0?(l.end<=Z-r&&(g(q,U,A,z,l.end,Z,J,I,D),z=q.length,Z=l.end),l.next()):T>2500?h(A,V,q,U):f(A,V,q,U,J,T+1);if(J>=0&&z>0&&z-1&&z>0){let ne=m(_,D);L=Pq(_,q,U,0,q.length,0,N-A,ne,ne)}else L=b(_,q,U,N-A,I-N,D)}C.push(L),E.push(M)}function h(k,S,C,E){let j=[],T=0,R=-1;for(;l.pos>S;){let{id:A,start:N,end:P,size:I}=l;if(I>4)l.next();else{if(R>-1&&N=0;P-=3)A[I++]=j[P],A[I++]=j[P+1]-N,A[I++]=j[P+2]-N,A[I++]=I;C.push(new db(A,j[2]-N,i)),E.push(N-k)}}function m(k,S){return(C,E,j)=>{let T=0,R=C.length-1,A,N;if(R>=0&&(A=C[R])instanceof Bi){if(!R&&A.type==k&&A.length==j)return A;(N=A.prop(ui.lookAhead))&&(T=E[R]+A.length+N)}return b(k,C,E,j,T,S)}}function g(k,S,C,E,j,T,R,A,N){let P=[],I=[];for(;k.length>E;)P.push(k.pop()),I.push(S.pop()+C-j);k.push(b(i.types[R],P,I,T-j,A-T,N)),S.push(j-C)}function b(k,S,C,E,j,T,R){if(T){let A=[ui.contextHash,T];R=R?[A].concat(R):[A]}if(j>25){let A=[ui.lookAhead,j];R=R?[A].concat(R):[A]}return new Bi(k,S,C,E,R)}function v(k,S){let C=l.fork(),E=0,j=0,T=0,R=C.end-r,A={size:0,start:0,skip:0};e:for(let N=C.pos-k;C.pos>N;){let P=C.size;if(C.id==S&&P>=0){A.size=E,A.start=j,A.skip=T,T+=4,E+=4,C.next();continue}let I=C.pos-P;if(P<0||I=o?4:0,_=C.start;for(C.next();C.pos>I;){if(C.size<0)if(C.size==-3||C.size==-4)D+=4;else break e;else C.id>=o&&(D+=4);C.next()}j=_,E+=P,T+=D}return(S<0||E==k)&&(A.size=E,A.start=j,A.skip=T),A.size>4?A:void 0}function y(k,S,C){let{id:E,start:j,end:T,size:R}=l;if(l.next(),R>=0&&E4){let N=l.pos-(R-4);for(;l.pos>N;)C=y(k,S,C)}S[--C]=A,S[--C]=T-k,S[--C]=j-k,S[--C]=E}else R==-3?u=E:R==-4&&(d=E);return C}let w=[],x=[];for(;l.pos>0;)f(e.start||0,e.bufferStart||0,w,x,-1,0);let O=(t=e.length)!==null&&t!==void 0?t:w.length?x[0]+w[0].length:0;return new Bi(c[e.topID],w.reverse(),x.reverse(),O)}const lie=new WeakMap;function MN(e,t){if(!e.isAnonymous||t instanceof db||t.type!=e)return 1;let n=lie.get(t);if(n==null){n=1;for(let i of t.children){if(i.type!=e||!(i instanceof Bi)){n=1;break}n+=MN(e,i)}lie.set(t,n)}return n}function Pq(e,t,n,i,r,s,o,l,c){let u=0;for(let g=i;g=d)break;S+=C}if(x==O+1){if(S>d){let C=g[O];m(C.children,C.positions,0,C.children.length,b[O]+w);continue}f.push(g[O])}else{let C=b[x-1]+g[x-1].length-k;f.push(Pq(e,g,b,O,x,k,C,null,c))}h.push(k+w-s)}}return m(t,n,i,r,0),(l||c)(f,h,o)}class Dq{constructor(){this.map=new WeakMap}setBuffer(t,n,i){let r=this.map.get(t);r||this.map.set(t,r=new Map),r.set(n,i)}getBuffer(t,n){let i=this.map.get(t);return i&&i.get(n)}set(t,n){t instanceof oh?this.setBuffer(t.context.buffer,t.index,n):t instanceof jl&&this.map.set(t.tree,n)}get(t){return t instanceof oh?this.getBuffer(t.context.buffer,t.index):t instanceof jl?this.map.get(t.tree):void 0}cursorSet(t,n){t.buffer?this.setBuffer(t.buffer.buffer,t.index,n):this.map.set(t.tree,n)}cursorGet(t){return t.buffer?this.getBuffer(t.buffer.buffer,t.index):this.map.get(t.tree)}}class Bp{constructor(t,n,i,r,s=!1,o=!1){this.from=t,this.to=n,this.tree=i,this.offset=r,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],i=!1){let r=[new Bp(0,t.length,t,0,!1,i)];for(let s of n)s.to>t.length&&r.push(s);return r}static applyChanges(t,n,i=128){if(!n.length)return t;let r=[],s=1,o=t.length?t[0]:null;for(let l=0,c=0,u=0;;l++){let d=l=i)for(;o&&o.from=h.from||f<=h.to||u){let m=Math.max(h.from,c)-u,g=Math.min(h.to,f)-u;h=m>=g?null:new Bp(m,g,h.tree,h.offset+u,l>0,!!d)}if(h&&r.push(h),o.to>f)break;o=snew hd(r.from,r.to)):[new hd(0,0)]:[new hd(0,t.length)],this.createParse(t,n||[],i)}parse(t,n,i){let r=this.startParse(t,n,i);for(;;){let s=r.advance();if(s)return s}}}class WRt{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,n){return this.string.slice(t,n)}}function U5e(e){return(t,n,i,r)=>new GRt(t,e,n,i,r)}class cie{constructor(t,n,i,r,s,o){this.parser=t,this.parse=n,this.overlay=i,this.bracketed=r,this.target=s,this.from=o}}function uie(e){if(!e.length||e.some(t=>t.from>=t.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(e))}class KRt{constructor(t,n,i,r,s,o,l,c){this.parser=t,this.predicate=n,this.mounts=i,this.index=r,this.start=s,this.bracketed=o,this.target=l,this.prev=c,this.depth=0,this.ranges=[]}}const v9=new ui({perNode:!0});class GRt{constructor(t,n,i,r,s){this.nest=n,this.input=i,this.fragments=r,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=t}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new Bi(i.type,i.children,i.positions,i.length,i.propValues.concat([[v9,this.stoppedAt]]))),i}let t=this.inner[this.innerDone],n=t.parse.advance();if(n){this.innerDone++;let i=Object.assign(Object.create(null),t.target.props);i[ui.mounted.id]=new mw(n,t.overlay,t.parser,t.bracketed),t.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let t=this.input.length;for(let n=this.innerDone;n=this.stoppedAt)l=!1;else if(t.hasNode(r)){if(n){let u=n.mounts.find(d=>d.frag.from<=r.from&&d.frag.to>=r.to&&d.mount.overlay);if(u)for(let d of u.mount.overlay){let f=d.from+u.pos,h=d.to+u.pos;f>=r.from&&h<=r.to&&!n.ranges.some(m=>m.fromf)&&n.ranges.push({from:f,to:h})}}l=!1}else if(i&&(o=XRt(i.ranges,r.from,r.to)))l=o!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.fromnew hd(f.from-r.from,f.to-r.from)):null,!!s.bracketed,r.tree,d.length?d[0].from:r.from)),s.overlay?d.length&&(i={ranges:d,depth:0,prev:i}):l=!1}}else if(n&&(c=n.predicate(r))&&(c===!0&&(c=new hd(r.from,r.to)),c.from=0&&n.ranges[u].to==c.from?n.ranges[u]={from:n.ranges[u].from,to:c.to}:n.ranges.push(c)}if(l&&r.firstChild())n&&n.depth++,i&&i.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(n&&!--n.depth){let u=hie(this.ranges,n.ranges);u.length&&(uie(u),this.inner.splice(n.index,0,new cie(n.parser,n.parser.startParse(this.input,pie(n.mounts,u),u),n.ranges.map(d=>new hd(d.from-n.start,d.to-n.start)),n.bracketed,n.target,u[0].from))),n=n.prev}i&&!--i.depth&&(i=i.prev)}}}}function XRt(e,t,n){for(let i of e){if(i.from>=n)break;if(i.to>t)return i.from<=t&&i.to>=n?2:1}return 0}function die(e,t,n,i,r,s){if(t=t&&n.enter(i,1,Sr.IgnoreOverlays|Sr.ExcludeBuffers)))if(n.to<=t)n.next(!1)||(this.done=!0);else break}hasNode(t){if(this.moveTo(t.from),!this.done&&this.cursor.from+this.offset==t.from&&this.cursor.tree)for(let n=this.cursor.tree;;){if(n==t.tree)return!0;if(n.children.length&&n.positions[0]==0&&n.children[0]instanceof Bi)n=n.children[0];else break}return!1}}let ZRt=class{constructor(t){var n;if(this.fragments=t,this.curTo=0,this.fragI=0,t.length){let i=this.curFrag=t[0];this.curTo=(n=i.tree.prop(v9))!==null&&n!==void 0?n:i.to,this.inner=new fie(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(t){for(;this.curFrag&&t.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=t.from&&this.curTo>=t.to&&this.inner.hasNode(t)}nextFrag(){var t;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let n=this.curFrag=this.fragments[this.fragI];this.curTo=(t=n.tree.prop(v9))!==null&&t!==void 0?t:n.to,this.inner=new fie(n.tree,-n.offset)}}findMounts(t,n){var i;let r=[];if(this.inner){this.inner.cursor.moveTo(t,1);for(let s=this.inner.cursor.node;s;s=s.parent){let o=(i=s.tree)===null||i===void 0?void 0:i.prop(ui.mounted);if(o&&o.parser==n)for(let l=this.fragI;l=s.to)break;c.tree==this.curFrag.tree&&r.push({frag:c,pos:s.from-c.offset,mount:o})}}}return r}};function hie(e,t){let n=null,i=t;for(let r=1,s=0;r=l)break;c.to<=o||(n||(i=n=t.slice()),c.froml&&n.splice(s+1,0,new hd(l,c.to))):c.to>l?n[s--]=new hd(l,c.to):n.splice(s--,1))}}return i}function JRt(e,t,n,i){let r=0,s=0,o=!1,l=!1,c=-1e9,u=[];for(;;){let d=r==e.length?1e9:o?e[r].to:e[r].from,f=s==t.length?1e9:l?t[s].to:t[s].from;if(o!=l){let h=Math.max(c,n),m=Math.min(d,f,i);hnew hd(h.from+i,h.to+i)),f=JRt(t,d,c,u);for(let h=0,m=c;;h++){let g=h==f.length,b=g?u:f[h].from;if(b>m&&n.push(new Bp(m,b,r.tree,-o,s.from>=m||s.openStart,s.to<=b||s.openEnd)),g)break;m=f[h].to}}else n.push(new Bp(c,u,r.tree,-o,s.from>=o||s.openStart,s.to<=l||s.openEnd))}return n}let x9=[],Q5e=[];(()=>{let e="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(t=>t?parseInt(t,36):1);for(let t=0,n=0;t>1;if(e=Q5e[i])t=i+1;else return!0;if(t==n)return!1}}function mie(e){return e>=127462&&e<=127487}const gie=8205;function tIt(e,t,n=!0,i=!0){return(n?z5e:nIt)(e,t,i)}function z5e(e,t,n){if(t==e.length)return t;t&&V5e(e.charCodeAt(t))&&H5e(e.charCodeAt(t-1))&&t--;let i=W4(e,t);for(t+=bie(i);t=0&&mie(W4(e,o));)s++,o-=2;if(s%2==0)break;t+=2}else break}return t}function nIt(e,t,n){for(;t>1;){let i=z5e(e,t-2,n);if(i=56320&&e<57344}function H5e(e){return e>=55296&&e<56320}function bie(e){return e<65536?1:2}let xr=class q5e{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,n,i){[t,n]=c1(this,t,n);let r=[];return this.decompose(0,t,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(n,this.length,r,1),Jf.from(r,this.length-(n-t)+i.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,n=this.length){[t,n]=c1(this,t,n);let i=[];return this.decompose(t,n,i,0),Jf.from(i,n-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let n=this.scanIdentical(t,1),i=this.length-this.scanIdentical(t,-1),r=new yE(this),s=new yE(t);for(let o=n,l=n;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=i)return!0}}iter(t=1){return new yE(this,t)}iterRange(t,n=this.length){return new W5e(this,t,n)}iterLines(t,n){let i;if(t==null)i=this.iter();else{n==null&&(n=this.lines+1);let r=this.line(t).from;i=this.iterRange(r,Math.max(r,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new K5e(i)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(t.length==0)throw new RangeError("A document must have at least one line");return t.length==1&&!t[0]?q5e.empty:t.length<=32?new wa(t):Jf.from(wa.split(t,[]))}};class wa extends xr{constructor(t,n=iIt(t)){super(),this.text=t,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(t,n,i,r){for(let s=0;;s++){let o=this.text[s],l=r+o.length;if((n?i:l)>=t)return new rIt(r,l,i,o);r=l+1,i++}}decompose(t,n,i,r){let s=t<=0&&n>=this.length?this:new wa(yie(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(r&1){let o=i.pop(),l=LN(s.text,o.text.slice(),0,s.length);if(l.length<=32)i.push(new wa(l,o.length+s.length));else{let c=l.length>>1;i.push(new wa(l.slice(0,c)),new wa(l.slice(c)))}}else i.push(s)}replace(t,n,i){if(!(i instanceof wa))return super.replace(t,n,i);[t,n]=c1(this,t,n);let r=LN(this.text,LN(i.text,yie(this.text,0,t)),n),s=this.length+i.length-(n-t);return r.length<=32?new wa(r,s):Jf.from(wa.split(r,[]),s)}sliceString(t,n=this.length,i=` -`){[t,n]=c1(this,t,n);let r="";for(let s=0,o=0;s<=n&&ot&&o&&(r+=i),ts&&(r+=l.slice(Math.max(0,t-s),n-s)),s=c+1}return r}flatten(t){for(let n of this.text)t.push(n)}scanIdentical(){return 0}static split(t,n){let i=[],r=-1;for(let s of t)i.push(s),r+=s.length+1,i.length==32&&(n.push(new wa(i,r)),i=[],r=-1);return r>-1&&n.push(new wa(i,r)),n}}class Jf extends xr{constructor(t,n){super(),this.children=t,this.length=n,this.lines=0;for(let i of t)this.lines+=i.lines}lineInner(t,n,i,r){for(let s=0;;s++){let o=this.children[s],l=r+o.length,c=i+o.lines-1;if((n?c:l)>=t)return o.lineInner(t,n,i,r);r=l+1,i=c+1}}decompose(t,n,i,r){for(let s=0,o=0;o<=n&&s=o){let u=r&((o<=t?1:0)|(c>=n?2:0));o>=t&&c<=n&&!u?i.push(l):l.decompose(t-o,n-o,i,u)}o=c+1}}replace(t,n,i){if([t,n]=c1(this,t,n),i.lines=s&&n<=l){let c=o.replace(t-s,n-s,i),u=this.lines-o.lines+c.lines;if(c.lines>4&&c.lines>u>>6){let d=this.children.slice();return d[r]=c,new Jf(d,this.length-(n-t)+i.length)}return super.replace(s,l,c)}s=l+1}return super.replace(t,n,i)}sliceString(t,n=this.length,i=` -`){[t,n]=c1(this,t,n);let r="";for(let s=0,o=0;st&&s&&(r+=i),to&&(r+=l.sliceString(t-o,n-o,i)),o=c+1}return r}flatten(t){for(let n of this.children)n.flatten(t)}scanIdentical(t,n){if(!(t instanceof Jf))return 0;let i=0,[r,s,o,l]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;r+=n,s+=n){if(r==o||s==l)return i;let c=this.children[r],u=t.children[s];if(c!=u)return i+c.scanIdentical(u,n);i+=c.length+1}}static from(t,n=t.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let m of t)i+=m.lines;if(i<32){let m=[];for(let g of t)g.flatten(m);return new wa(m,n)}let r=Math.max(32,i>>5),s=r<<1,o=r>>1,l=[],c=0,u=-1,d=[];function f(m){let g;if(m.lines>s&&m instanceof Jf)for(let b of m.children)f(b);else m.lines>o&&(c>o||!c)?(h(),l.push(m)):m instanceof wa&&c&&(g=d[d.length-1])instanceof wa&&m.lines+g.lines<=32?(c+=m.lines,u+=m.length+1,d[d.length-1]=new wa(g.text.concat(m.text),g.length+1+m.length)):(c+m.lines>r&&h(),c+=m.lines,u+=m.length+1,d.push(m))}function h(){c!=0&&(l.push(d.length==1?d[0]:Jf.from(d,u)),u=-1,c=d.length=0)}for(let m of t)f(m);return h(),l.length==1?l[0]:new Jf(l,n)}}xr.empty=new wa([""],0);function iIt(e){let t=-1;for(let n of e)t+=n.length+1;return t}function LN(e,t,n=0,i=1e9){for(let r=0,s=0,o=!0;s=n&&(c>i&&(l=l.slice(0,i-r)),r0?1:(t instanceof wa?t.text.length:t.children.length)<<1]}nextInner(t,n){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,r=this.nodes[i],s=this.offsets[i],o=s>>1,l=r instanceof wa?r.text.length:r.children.length;if(o==(n>0?l:0)){if(i==0)return this.done=!0,this.value="",this;n>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(n>0?0:1)){if(this.offsets[i]+=n,t==0)return this.lineBreak=!0,this.value=` -`,this;t--}else if(r instanceof wa){let c=r.text[o+(n<0?-1:0)];if(this.offsets[i]+=n,c.length>Math.max(0,t))return this.value=t==0?c:n>0?c.slice(t):c.slice(0,c.length-t),this;t-=c.length}else{let c=r.children[o+(n<0?-1:0)];t>c.length?(t-=c.length,this.offsets[i]+=n):(n<0&&this.offsets[i]--,this.nodes.push(c),this.offsets.push(n>0?1:(c instanceof wa?c.text.length:c.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class W5e{constructor(t,n,i){this.value="",this.done=!1,this.cursor=new yE(t,n>i?-1:1),this.pos=n>i?t.length:0,this.from=Math.min(n,i),this.to=Math.max(n,i)}nextInner(t,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let i=n<0?this.pos-this.from:this.to-this.pos;t>i&&(t=i),i-=t;let{value:r}=this.cursor.next(t);return this.pos+=(r.length+t)*n,this.value=r.length<=i?r:n<0?r.slice(r.length-i):r.slice(0,i),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class K5e{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:n,lineBreak:i,value:r}=this.inner.next(t);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(xr.prototype[Symbol.iterator]=function(){return this.iter()},yE.prototype[Symbol.iterator]=W5e.prototype[Symbol.iterator]=K5e.prototype[Symbol.iterator]=function(){return this});let rIt=class{constructor(t,n,i,r){this.from=t,this.to=n,this.number=i,this.text=r}get length(){return this.to-this.from}};function c1(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function Ro(e,t,n=!0,i=!0){return tIt(e,t,n,i)}function sIt(e){return e>=56320&&e<57344}function aIt(e){return e>=55296&&e<56320}function jc(e,t){let n=e.charCodeAt(t);if(!aIt(n)||t+1==e.length)return n;let i=e.charCodeAt(t+1);return sIt(i)?(n-55296<<10)+(i-56320)+65536:n}function Mq(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function eh(e){return e<65536?1:2}const w9=/\r\n?|\n/;var il=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(il||(il={}));class bh{constructor(t){this.sections=t}get length(){let t=0;for(let n=0;nt)return s+(t-r);s+=l}else{if(i!=il.Simple&&u>=t&&(i==il.TrackDel&&rt||i==il.TrackBefore&&rt))return null;if(u>t||u==t&&n<0&&!l)return t==r||n<0?s:s+c;s+=c}r=u}if(t>r)throw new RangeError(`Position ${t} is out of range for changeset of length ${r}`);return s}touchesRange(t,n=t){for(let i=0,r=0;i=0&&r<=n&&l>=t)return rn?"cover":!0;r=l}return!1}toString(){let t="";for(let n=0;n=0?":"+r:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new bh(t)}static create(t){return new bh(t)}}class lo extends bh{constructor(t,n){super(t),this.inserted=n}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return O9(this,(n,i,r,s,o)=>t=t.replace(r,r+(i-n),o),!1),t}mapDesc(t,n=!1){return k9(this,t,n,!0)}invert(t){let n=this.sections.slice(),i=[];for(let r=0,s=0;r=0){n[r]=l,n[r+1]=o;let c=r>>1;for(;i.length0&&xg(i,n,s.text),s.forward(d),l+=d}let u=t[o++];for(;l>1].toJSON()))}return t}static of(t,n,i){let r=[],s=[],o=0,l=null;function c(d=!1){if(!d&&!r.length)return;oh||f<0||h>n)throw new RangeError(`Invalid change range ${f} to ${h} (in doc of length ${n})`);let g=m?typeof m=="string"?xr.of(m.split(i||w9)):m:xr.empty,b=g.length;if(f==h&&b==0)return;fo&&Cl(r,f-o,-1),Cl(r,h-f,b),xg(s,r,g),o=h}}return u(t),c(!l),l}static empty(t){return new lo(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],i=[];for(let r=0;rl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)n.push(s[0],0);else{for(;i.length=0&&n<=0&&n==e[r+1]?e[r]+=t:r>=0&&t==0&&e[r]==0?e[r+1]+=n:i?(e[r]+=t,e[r+1]+=n):e.push(t,n)}function xg(e,t,n){if(n.length==0)return;let i=t.length-2>>1;if(i>1])),!(n||o==e.sections.length||e.sections[o+1]<0);)l=e.sections[o++],c=e.sections[o++];t(r,u,s,d,f),r=u,s=d}}}function k9(e,t,n,i=!1){let r=[],s=i?[]:null,o=new RC(e),l=new RC(t);for(let c=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let u=Math.min(o.len,l.len);Cl(r,u,-1),o.forward(u),l.forward(u)}else if(l.ins>=0&&(o.ins<0||c==o.i||o.off==0&&(l.len=0&&c=0){let u=0,d=o.len;for(;d;)if(l.ins==-1){let f=Math.min(d,l.len);u+=f,d-=f,l.forward(f)}else if(l.ins==0&&l.lenc||o.ins>=0&&o.len>c)&&(l||i.length>u),s.forward2(c),o.forward(c)}}}}class RC{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i>1;return n>=t.length?xr.empty:t[n]}textBit(t){let{inserted:n}=this.set,i=this.i-2>>1;return i>=n.length&&!t?xr.empty:n[i].slice(this.off,t==null?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){this.ins==-1?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class ag{constructor(t,n,i,r){this.from=t,this.to=n,this.flags=i,this.goalColumn=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let t=this.flags&7;return t==7?null:t}map(t,n=-1){let i,r;return this.empty?i=r=t.mapPos(this.from,n):(i=t.mapPos(this.from,1),r=t.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new ag(i,r,this.flags,this.goalColumn)}extend(t,n=t,i=0){if(t<=this.anchor&&n>=this.anchor)return ht.range(t,n,void 0,void 0,i);let r=Math.abs(t-this.anchor)>Math.abs(n-this.anchor)?t:n;return ht.range(this.anchor,r,void 0,void 0,i)}eq(t,n=!1){return this.anchor==t.anchor&&this.head==t.head&&this.goalColumn==t.goalColumn&&(!n||!this.empty||this.assoc==t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return ht.range(t.anchor,t.head)}static create(t,n,i,r){return new ag(t,n,i,r)}}class ht{constructor(t,n){this.ranges=t,this.mainIndex=n}map(t,n=-1){return t.empty?this:ht.create(this.ranges.map(i=>i.map(t,n)),this.mainIndex)}eq(t,n=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let i=0;it.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!="number"||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new ht(t.ranges.map(n=>ag.fromJSON(n)),t.main)}static single(t,n=t){return new ht([ht.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,r=0;rr.from-s.from),n=t.indexOf(i);for(let r=1;rs.head?ht.range(c,l):ht.range(l,c))}}return new ht(t,n)}}function X5e(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let Lq=0;class mn{constructor(t,n,i,r,s){this.combine=t,this.compareInput=n,this.compare=i,this.isStatic=r,this.id=Lq++,this.default=t([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(t={}){return new mn(t.combine||(n=>n),t.compareInput||((n,i)=>n===i),t.compare||(t.combine?(n,i)=>n===i:$q),!!t.static,t.enables)}of(t){return new $N([],this,0,t)}compute(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new $N(t,this,1,n)}computeN(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new $N(t,this,2,n)}from(t,n){return n||(n=i=>i),this.compute([t],i=>n(i.field(t)))}}function $q(e,t){return e==t||e.length==t.length&&e.every((n,i)=>n===t[i])}class $N{constructor(t,n,i,r){this.dependencies=t,this.facet=n,this.type=i,this.value=r,this.id=Lq++}dynamicSlot(t){var n;let i=this.value,r=this.facet.compareInput,s=this.id,o=t[s]>>1,l=this.type==2,c=!1,u=!1,d=[];for(let f of this.dependencies)f=="doc"?c=!0:f=="selection"?u=!0:((n=t[f.id])!==null&&n!==void 0?n:1)&1||d.push(t[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,h){if(c&&h.docChanged||u&&(h.docChanged||h.selection)||S9(f,d)){let m=i(f);if(l?!vie(m,f.values[o],r):!r(m,f.values[o]))return f.values[o]=m,1}return 0},reconfigure:(f,h)=>{let m,g=h.config.address[s];if(g!=null){let b=UI(h,g);if(this.dependencies.every(v=>v instanceof mn?h.facet(v)===f.facet(v):v instanceof dl?h.field(v,!1)==f.field(v,!1):!0)||(l?vie(m=i(f),b,r):r(m=i(f),b)))return f.values[o]=b,0}else m=i(f);return f.values[o]=m,1}}}get extension(){return this}}function vie(e,t,n){if(e.length!=t.length)return!1;for(let i=0;ie[c.id]),r=n.map(c=>c.type),s=i.filter(c=>!(c&1)),o=e[t.id]>>1;function l(c){let u=[];for(let d=0;di===r),t);return t.provide&&(n.provides=t.provide(n)),n}create(t){let n=t.facet(B_).find(i=>i.field==this);return((n==null?void 0:n.create)||this.createF)(t)}slot(t){let n=t[this.id]>>1;return{create:i=>(i.values[n]=this.create(i),1),update:(i,r)=>{let s=i.values[n],o=this.updateF(s,r);return this.compareF(s,o)?0:(i.values[n]=o,1)},reconfigure:(i,r)=>{let s=i.facet(B_),o=r.facet(B_),l;return(l=s.find(c=>c.field==this))&&l!=o.find(c=>c.field==this)?(i.values[n]=l.create(i),1):r.config.address[this.id]!=null?(i.values[n]=r.field(this),0):(i.values[n]=this.create(i),1)}}}init(t){return[this,B_.of({field:this,create:t})]}get extension(){return this}}const wy={lowest:4,low:3,default:2,high:1,highest:0};function Ok(e){return t=>new Y5e(t,e)}const gm={highest:Ok(wy.highest),high:Ok(wy.high),default:Ok(wy.default),low:Ok(wy.low),lowest:Ok(wy.lowest)};class Y5e{constructor(t,n){this.inner=t,this.prec=n}get extension(){return this}}class KM{of(t){return new E9(this,t)}reconfigure(t){return KM.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class E9{constructor(t,n){this.compartment=t,this.inner=n}get extension(){return this}}class BI{constructor(t,n,i,r,s,o){for(this.base=t,this.compartments=n,this.dynamicSlots=i,this.address=r,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(t,n,i){let r=[],s=Object.create(null),o=new Map;for(let h of lIt(t,n,o))h instanceof dl?r.push(h):(s[h.facet.id]||(s[h.facet.id]=[])).push(h);let l=Object.create(null),c=[],u=[];for(let h of r)l[h.id]=u.length<<1,u.push(m=>h.slot(m));let d=i==null?void 0:i.config.facets;for(let h in s){let m=s[h],g=m[0].facet,b=d&&d[h]||[];if(m.every(v=>v.type==0))if(l[g.id]=c.length<<1|1,$q(b,m))c.push(i.facet(g));else{let v=g.combine(m.map(y=>y.value));c.push(i&&g.compare(v,i.facet(g))?i.facet(g):v)}else{for(let v of m)v.type==0?(l[v.id]=c.length<<1|1,c.push(v.value)):(l[v.id]=u.length<<1,u.push(y=>v.dynamicSlot(y)));l[g.id]=u.length<<1,u.push(v=>oIt(v,g,m))}}let f=u.map(h=>h(l));return new BI(t,o,f,l,c,s)}}function lIt(e,t,n){let i=[[],[],[],[],[]],r=new Map;function s(o,l){let c=r.get(o);if(c!=null){if(c<=l)return;let u=i[c].indexOf(o);u>-1&&i[c].splice(u,1),o instanceof E9&&n.delete(o.compartment)}if(r.set(o,l),Array.isArray(o))for(let u of o)s(u,l);else if(o instanceof E9){if(n.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let u=t.get(o.compartment)||o.inner;n.set(o.compartment,u),s(u,l)}else if(o instanceof Y5e)s(o.inner,o.prec);else if(o instanceof dl)i[l].push(o),o.provides&&s(o.provides,l);else if(o instanceof $N)i[l].push(o),o.facet.extensions&&s(o.facet.extensions,wy.default);else{let u=o.extension;if(!u)throw new Error(`Unrecognized extension value in extension set (${o}).`);if(u==o)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(u,l)}}return s(e,wy.default),i.reduce((o,l)=>o.concat(l))}function vE(e,t){if(t&1)return 2;let n=t>>1,i=e.status[n];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;e.status[n]=4;let r=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|r}function UI(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}const Z5e=mn.define(),C9=mn.define({combine:e=>e.some(t=>t),static:!0}),J5e=mn.define({combine:e=>e.length?e[0]:void 0,static:!0}),e3e=mn.define(),t3e=mn.define(),n3e=mn.define(),i3e=mn.define({combine:e=>e.length?e[0]:!1});class Rh{constructor(t,n){this.type=t,this.value=n}static define(){return new cIt}}class cIt{of(t){return new Rh(this,t)}}class uIt{constructor(t){this.map=t}of(t){return new pi(this,t)}}class pi{constructor(t,n){this.type=t,this.value=n}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new pi(this.type,n)}is(t){return this.type==t}static define(t={}){return new uIt(t.map||(n=>n))}static mapEffects(t,n){if(!t.length)return t;let i=[];for(let r of t){let s=r.map(n);s&&i.push(s)}return i}}pi.reconfigure=pi.define();pi.appendConfig=pi.define();class Xa{constructor(t,n,i,r,s,o){this.startState=t,this.changes=n,this.selection=i,this.effects=r,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,i&&X5e(i,n.newLength),s.some(l=>l.type==Xa.time)||(this.annotations=s.concat(Xa.time.of(Date.now())))}static create(t,n,i,r,s,o){return new Xa(t,n,i,r,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let n of this.annotations)if(n.type==t)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(Xa.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]=="."))}}Xa.time=Rh.define();Xa.userEvent=Rh.define();Xa.addToHistory=Rh.define();Xa.remote=Rh.define();function dIt(e,t){let n=[];for(let i=0,r=0;;){let s,o;if(i=e[i]))s=e[i++],o=e[i++];else if(r=0;r--){let s=i[r](e);s instanceof Xa?e=s:Array.isArray(s)&&s.length==1&&s[0]instanceof Xa?e=s[0]:e=s3e(t,gw(s),!1)}return e}function hIt(e){let t=e.startState,n=t.facet(n3e),i=e;for(let r=n.length-1;r>=0;r--){let s=n[r](e);s&&Object.keys(s).length&&(i=r3e(i,A9(t,s,e.changes.newLength),!0))}return i==e?e:Xa.create(t,e.changes,e.selection,i.effects,i.annotations,i.scrollIntoView)}const pIt=[];function gw(e){return e==null?pIt:Array.isArray(e)?e:[e]}var Qs=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(Qs||(Qs={}));const mIt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let T9;try{T9=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function gIt(e){if(T9)return T9.test(e);for(let t=0;t"€"&&(n.toUpperCase()!=n.toLowerCase()||mIt.test(n)))return!0}return!1}function bIt(e){return t=>{if(!/\S/.test(t))return Qs.Space;if(gIt(t))return Qs.Word;for(let n=0;n-1)return Qs.Word;return Qs.Other}}class tr{constructor(t,n,i,r,s,o){this.config=t,this.doc=n,this.selection=i,this.values=r,this.status=t.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let l=0;lr.set(u,c)),n=null),r.set(l.value.compartment,l.value.extension)):l.is(pi.reconfigure)?(n=null,i=l.value):l.is(pi.appendConfig)&&(n=null,i=gw(i).concat(l.value));let s;n?s=t.startState.values.slice():(n=BI.resolve(i,r,this),s=new tr(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(c,u)=>u.reconfigure(c,this),null).values);let o=t.startState.facet(C9)?t.newSelection:t.newSelection.asSingle();new tr(n,t.newDoc,o,s,(l,c)=>c.update(l,t),t)}replaceSelection(t){return typeof t=="string"&&(t=this.toText(t)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:t},range:ht.cursor(n.from+t.length)}))}changeByRange(t){let n=this.selection,i=t(n.ranges[0]),r=this.changes(i.changes),s=[i.range],o=gw(i.effects);for(let l=1;lo.spec.fromJSON(l,c)))}}return tr.create({doc:t.doc,selection:ht.fromJSON(t.selection),extensions:n.extensions?r.concat([n.extensions]):r})}static create(t={}){let n=BI.resolve(t.extensions||[],new Map),i=t.doc instanceof xr?t.doc:xr.of((t.doc||"").split(n.staticFacet(tr.lineSeparator)||w9)),r=t.selection?t.selection instanceof ht?t.selection:ht.single(t.selection.anchor,t.selection.head):ht.single(0);return X5e(r,i.length),n.staticFacet(C9)||(r=r.asSingle()),new tr(n,i,r,n.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(tr.tabSize)}get lineBreak(){return this.facet(tr.lineSeparator)||` -`}get readOnly(){return this.facet(i3e)}phrase(t,...n){for(let i of this.facet(tr.phrases))if(Object.prototype.hasOwnProperty.call(i,t)){t=i[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(i,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>n.length?i:n[s-1]})),t}languageDataAt(t,n,i=-1){let r=[];for(let s of this.facet(Z5e))for(let o of s(this,n,i))Object.prototype.hasOwnProperty.call(o,t)&&r.push(o[t]);return r}charCategorizer(t){let n=this.languageDataAt("wordChars",t);return bIt(n.length?n[0]:"")}wordAt(t){let{text:n,from:i,length:r}=this.doc.lineAt(t),s=this.charCategorizer(t),o=t-i,l=t-i;for(;o>0;){let c=Ro(n,o,!1);if(s(n.slice(c,o))!=Qs.Word)break;o=c}for(;le.length?e[0]:4});tr.lineSeparator=J5e;tr.readOnly=i3e;tr.phrases=mn.define({compare(e,t){let n=Object.keys(e),i=Object.keys(t);return n.length==i.length&&n.every(r=>e[r]==t[r])}});tr.languageData=Z5e;tr.changeFilter=e3e;tr.transactionFilter=t3e;tr.transactionExtender=n3e;KM.reconfigure=pi.define();function Ih(e,t,n={}){let i={};for(let r of e)for(let s of Object.keys(r)){let o=r[s],l=i[s];if(l===void 0)i[s]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(n,s))i[s]=n[s](l,o);else throw new Error("Config merge conflict for field "+s)}for(let r in t)i[r]===void 0&&(i[r]=t[r]);return i}class fb{eq(t){return this==t}range(t,n=t){return IC.create(t,n,this)}}fb.prototype.startSide=fb.prototype.endSide=0;fb.prototype.point=!1;fb.prototype.mapMode=il.TrackDel;function Fq(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}class IC{constructor(t,n,i){this.from=t,this.to=n,this.value=i}static create(t,n,i){return new IC(t,n,i)}}function _9(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class Bq{constructor(t,n,i,r){this.from=t,this.to=n,this.value=i,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(t,n,i,r=0){let s=i?this.to:this.from;for(let o=r,l=s.length;;){if(o==l)return o;let c=o+l>>1,u=s[c]-t||(i?this.value[c].endSide:this.value[c].startSide)-n;if(c==o)return u>=0?o:l;u>=0?l=c:o=c+1}}between(t,n,i,r){for(let s=this.findIndex(n,-1e9,!0),o=this.findIndex(i,1e9,!1,s);sm||h==m&&u.startSide>0&&u.endSide<=0)continue;(m-h||u.endSide-u.startSide)<0||(o<0&&(o=h),u.point&&(l=Math.max(l,m-h)),i.push(u),r.push(h-o),s.push(m-o))}return{mapped:i.length?new Bq(r,s,i,l):null,pos:o}}}class Ki{constructor(t,n,i,r){this.chunkPos=t,this.chunk=n,this.nextLayer=i,this.maxPoint=r}static create(t,n,i,r){return new Ki(t,n,i,r)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let n of this.chunk)t+=n.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:n=[],sort:i=!1,filterFrom:r=0,filterTo:s=this.length}=t,o=t.filter;if(n.length==0&&!o)return this;if(i&&(n=n.slice().sort(_9)),this.isEmpty)return n.length?Ki.of(n):this;let l=new a3e(this,null,-1).goto(0),c=0,u=[],d=new tm;for(;l.value||c=0){let f=n[c++];d.addInner(f.from,f.to,f.value)||u.push(f)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||sl.to||s=s&&t<=s+o.length&&o.between(s,t-s,n-s,i)===!1)return}this.nextLayer.between(t,n,i)}}iter(t=0){return PC.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,n=0){return PC.from(t).goto(n)}static compare(t,n,i,r,s=-1){let o=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),l=n.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),c=xie(o,l,i),u=new kk(o,c,s),d=new kk(l,c,s);i.iterGaps((f,h,m)=>wie(u,f,d,h,m,r)),i.empty&&i.length==0&&wie(u,0,d,0,0,r)}static eq(t,n,i=0,r){r==null&&(r=999999999);let s=t.filter(d=>!d.isEmpty&&n.indexOf(d)<0),o=n.filter(d=>!d.isEmpty&&t.indexOf(d)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let l=xie(s,o),c=new kk(s,l,0).goto(i),u=new kk(o,l,0).goto(i);for(;;){if(c.to!=u.to||!j9(c.active,u.active)||c.point&&(!u.point||!Fq(c.point,u.point)))return!1;if(c.to>r)return!0;c.next(),u.next()}}static spans(t,n,i,r,s=-1){let o=new kk(t,null,s).goto(n),l=n,c=o.openStart;for(;;){let u=Math.min(o.to,i);if(o.point){let d=o.activeForPoint(o.to),f=o.pointFroml&&(r.span(l,u,o.active,c),c=o.openEnd(u));if(o.to>i)return c+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(t,n=!1){let i=new tm;for(let r of t instanceof IC?[t]:n?yIt(t):t)i.add(r.from,r.to,r.value);return i.finish()}static join(t){if(!t.length)return Ki.empty;let n=t[t.length-1];for(let i=t.length-2;i>=0;i--)for(let r=t[i];r!=Ki.empty;r=r.nextLayer)n=new Ki(r.chunkPos,r.chunk,n,Math.max(r.maxPoint,n.maxPoint));return n}}Ki.empty=new Ki([],[],null,-1);function yIt(e){if(e.length>1)for(let t=e[0],n=1;n0)return e.slice().sort(_9);t=i}return e}Ki.empty.nextLayer=Ki.empty;class tm{finishChunk(t){this.chunks.push(new Bq(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,n,i){this.addInner(t,n,i)||(this.nextLayer||(this.nextLayer=new tm)).add(t,n,i)}addInner(t,n,i){let r=t-this.lastTo||i.startSide-this.last.endSide;if(r<=0&&(t-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(n-this.chunkStart),this.last=i,this.lastFrom=t,this.lastTo=n,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,n-t)),!0)}addChunk(t,n){if((t-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(t);let i=n.value.length-1;return this.last=n.value[i],this.lastFrom=n.from[i]+t,this.lastTo=n.to[i]+t,!0}finish(){return this.finishInner(Ki.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return t;let n=Ki.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,n}}function xie(e,t,n){let i=new Map;for(let s of e)for(let o=0;o=this.minPoint)break}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&r.push(new a3e(o,n,i,s));return r.length==1?r[0]:new PC(r)}get startSide(){return this.value?this.value.startSide:0}goto(t,n=-1e9){for(let i of this.heap)i.goto(t,n);for(let i=this.heap.length>>1;i>=0;i--)K4(this.heap,i);return this.next(),this}forward(t,n){for(let i of this.heap)i.forward(t,n);for(let i=this.heap.length>>1;i>=0;i--)K4(this.heap,i);(this.to-t||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),K4(this.heap,0)}}}function K4(e,t){for(let n=e[t];;){let i=(t<<1)+1;if(i>=e.length)break;let r=e[i];if(i+1=0&&(r=e[i+1],i++),n.compare(r)<0)break;e[i]=n,e[t]=r,t=i}}class kk{constructor(t,n,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=PC.from(t,n,i)}goto(t,n=-1e9){return this.cursor.goto(t,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=n,this.openStart=-1,this.next(),this}forward(t,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(t,n)}removeActive(t){U_(this.active,t),U_(this.activeTo,t),U_(this.activeRank,t),this.minActive=Oie(this.active,this.activeTo)}addActive(t){let n=0,{value:i,to:r,rank:s}=this.cursor;for(;n0;)n++;Q_(this.active,n,i),Q_(this.activeTo,n,r),Q_(this.activeRank,n,s),t&&Q_(t,n,this.cursor.from),this.minActive=Oie(this.active,this.activeTo)}next(){let t=this.to,n=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>t){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&U_(i,r)}else if(this.cursor.value)if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(i),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from=0&&i[r]=0&&!(this.activeRank[i]t||this.activeTo[i]==t&&this.active[i].endSide>=this.point.endSide)&&n.push(this.active[i]);return n.reverse()}openEnd(t){let n=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>t;i--)n++;return n}}function wie(e,t,n,i,r,s){e.goto(t),n.goto(i);let o=i+r,l=i,c=i-t,u=!!s.boundChange;for(let d=!1;;){let f=e.to+c-n.to,h=f||e.endSide-n.endSide,m=h<0?e.to+c:n.to,g=Math.min(m,o);if(e.point||n.point?(e.point&&n.point&&Fq(e.point,n.point)&&j9(e.activeForPoint(e.to),n.activeForPoint(n.to))||s.comparePoint(l,g,e.point,n.point),d=!1):(d&&s.boundChange(l),g>l&&!j9(e.active,n.active)&&s.compareRange(l,g,e.active,n.active),u&&go)break;l=m,h<=0&&e.next(),h>=0&&n.next()}}function j9(e,t){if(e.length!=t.length)return!1;for(let n=0;n=t;i--)e[i+1]=e[i];e[t]=n}function Oie(e,t){let n=-1,i=1e9;for(let r=0;r=t)return r;if(r==e.length)break;s+=e.charCodeAt(r)==9?n-s%n:1,r=Ro(e,r)}return i===!0?-1:e.length}const R9="ͼ",kie=typeof Symbol>"u"?"__"+R9:Symbol.for(R9),I9=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Sie=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class hb{constructor(t,n){this.rules=[];let{finish:i}=n||{};function r(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,l,c,u){let d=[],f=/^@(\w+)\b/.exec(o[0]),h=f&&f[1]=="keyframes";if(f&&l==null)return c.push(o[0]+";");for(let m in l){let g=l[m];if(/&/.test(m))s(m.split(/,\s*/).map(b=>o.map(v=>b.replace(/&/,v))).reduce((b,v)=>b.concat(v)),g,c);else if(g&&typeof g=="object"){if(!f)throw new RangeError("The value of a property ("+m+") should be a primitive value.");s(r(m),g,d,h)}else g!=null&&d.push(m.replace(/_.*/,"").replace(/[A-Z]/g,b=>"-"+b.toLowerCase())+": "+g+";")}(d.length||h)&&c.push((i&&!f&&!u?o.map(i):o).join(", ")+" {"+d.join(" ")+"}")}for(let o in t)s(r(o),t[o],this.rules)}getRules(){return this.rules.join(` -`)}static newName(){let t=Sie[kie]||1;return Sie[kie]=t+1,R9+t.toString(36)}static mount(t,n,i){let r=t[I9],s=i&&i.nonce;r?s&&r.setNonce(s):r=new vIt(t,s),r.mount(Array.isArray(n)?n:[n],t)}}let Eie=new Map;class vIt{constructor(t,n){let i=t.ownerDocument||t,r=i.defaultView;if(!t.head&&t.adoptedStyleSheets&&r.CSSStyleSheet){let s=Eie.get(i);if(s)return t[I9]=s;this.sheet=new r.CSSStyleSheet,Eie.set(i,this)}else this.styleTag=i.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],t[I9]=this}mount(t,n){let i=this.sheet,r=0,s=0;for(let o=0;o-1&&(this.modules.splice(c,1),s--,c=-1),c==-1){if(this.modules.splice(s++,0,l),i)for(let u=0;u",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},xIt=typeof navigator<"u"&&/Mac/.test(navigator.platform),wIt=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var el=0;el<10;el++)pb[48+el]=pb[96+el]=String(el);for(var el=1;el<=24;el++)pb[el+111]="F"+el;for(var el=65;el<=90;el++)pb[el]=String.fromCharCode(el+32),DC[el]=String.fromCharCode(el);for(var G4 in pb)DC.hasOwnProperty(G4)||(DC[G4]=pb[G4]);function OIt(e){var t=xIt&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||wIt&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?DC:pb)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function Kr(){var e=arguments[0];typeof e=="string"&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var r=n[i];typeof r=="string"?e.setAttribute(i,r):r!=null&&(e[i]=r)}t++}for(;t2);var hn={mac:Tie||/Mac/.test(Yl.platform),windows:/Win/.test(Yl.platform),linux:/Linux|X11/.test(Yl.platform),ie:GM,ie_version:l3e?P9.documentMode||6:M9?+M9[1]:D9?+D9[1]:0,gecko:Cie,gecko_version:Cie?+(/Firefox\/(\d+)/.exec(Yl.userAgent)||[0,0])[1]:0,chrome:!!X4,chrome_version:X4?+X4[1]:0,ios:Tie,android:/Android\b/.test(Yl.userAgent),webkit:Aie,webkit_version:Aie?+(/\bAppleWebKit\/(\d+)/.exec(Yl.userAgent)||[0,0])[1]:0,safari:L9,safari_version:L9?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Yl.userAgent)||[0,0])[1]:0,tabSize:P9.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function Uq(e,t){for(let n in e)n=="class"&&t.class?t.class+=" "+e.class:n=="style"&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}const QI=Object.create(null);function Qq(e,t,n){if(e==t)return!0;e||(e=QI),t||(t=QI);let i=Object.keys(e),r=Object.keys(t);if(i.length-0!=r.length-0)return!1;for(let s of i)if(s!=n&&(r.indexOf(s)==-1||e[s]!==t[s]))return!1;return!0}function kIt(e,t){for(let n=e.attributes.length-1;n>=0;n--){let i=e.attributes[n].name;t[i]==null&&e.removeAttribute(i)}for(let n in t){let i=t[n];n=="style"?e.style.cssText=i:e.getAttribute(n)!=i&&e.setAttribute(n,i)}}function _ie(e,t,n){let i=!1;if(t)for(let r in t)n&&r in n||(i=!0,r=="style"?e.style.cssText="":e.removeAttribute(r));if(n)for(let r in n)t&&t[r]==n[r]||(i=!0,r=="style"?e.style.cssText=n[r]:e.setAttribute(r,n[r]));return i}function SIt(e){let t=Object.create(null);for(let n=0;n0?3e8:-4e8:n>0?1e8:-1e8,new x0(t,n,n,i,t.widget||null,!1)}static replace(t){let n=!!t.block,i,r;if(t.isBlockGap)i=-5e8,r=4e8;else{let{start:s,end:o}=c3e(t,n);i=(s?n?-3e8:-1:5e8)-1,r=(o?n?2e8:1:-6e8)+1}return new x0(t,i,r,n,t.widget||null,!0)}static line(t){return new TT(t)}static set(t,n=!1){return Ki.of(t,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Fn.none=Ki.empty;class AT extends Fn{constructor(t){let{start:n,end:i}=c3e(t);super(n?-1:5e8,i?1:-6e8,null,t),this.tagName=t.tagName||"span",this.attrs=t.class&&t.attributes?Uq(t.attributes,{class:t.class}):t.class?{class:t.class}:t.attributes||QI}eq(t){return this==t||t instanceof AT&&this.tagName==t.tagName&&Qq(this.attrs,t.attrs)}range(t,n=t){if(t>=n)throw new RangeError("Mark decorations may not be empty");return super.range(t,n)}}AT.prototype.point=!1;class TT extends Fn{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof TT&&this.spec.class==t.spec.class&&Qq(this.spec.attributes,t.spec.attributes)}range(t,n=t){if(n!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,n)}}TT.prototype.mapMode=il.TrackBefore;TT.prototype.point=!0;class x0 extends Fn{constructor(t,n,i,r,s,o){super(n,i,s,t),this.block=r,this.isReplace=o,this.mapMode=r?n<=0?il.TrackBefore:il.TrackAfter:il.TrackDel}get type(){return this.startSide!=this.endSide?ol.WidgetRange:this.startSide<=0?ol.WidgetBefore:ol.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof x0&&EIt(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(t,n=t){if(this.isReplace&&(t>n||t==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,n)}}x0.prototype.point=!0;function c3e(e,t=!1){let{inclusiveStart:n,inclusiveEnd:i}=e;return n==null&&(n=e.inclusive),i==null&&(i=e.inclusive),{start:n??t,end:i??t}}function EIt(e,t){return e==t||!!(e&&t&&e.compare(t))}function bw(e,t,n,i=0){let r=n.length-1;r>=0&&n[r]+i>=e?n[r]=Math.max(n[r],t):n.push(e,t)}class MC extends fb{constructor(t,n,i){super(),this.tagName=t,this.attributes=n,this.rank=i}eq(t){return t==this||t instanceof MC&&this.tagName==t.tagName&&Qq(this.attributes,t.attributes)}static create(t){return new MC(t.tagName,t.attributes||QI,t.rank==null?50:Math.max(0,Math.min(t.rank,100)))}static set(t,n=!1){return Ki.of(t,n)}}MC.prototype.startSide=MC.prototype.endSide=-1;function LC(e){let t;return e.nodeType==11?t=e.getSelection?e:e.ownerDocument:t=e,t.getSelection()}function $9(e,t){return t?e==t||e.contains(t.nodeType!=1?t.parentNode:t):!1}function xE(e,t){if(!t.anchorNode)return!1;try{return $9(e,t.anchorNode)}catch{return!1}}function wE(e){return e.nodeType==3?FC(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function OE(e,t,n,i){return n?jie(e,t,n,i,-1)||jie(e,t,n,i,1):!1}function mb(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function zI(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function jie(e,t,n,i,r){for(;;){if(e==n&&t==i)return!0;if(t==(r<0?0:nm(e))){if(e.nodeName=="DIV")return!1;let s=e.parentNode;if(!s||s.nodeType!=1)return!1;t=mb(e)+(r<0?0:1),e=s}else if(e.nodeType==1){if(e=e.childNodes[t+(r<0?-1:0)],e.nodeType==1&&e.contentEditable=="false")return!1;t=r<0?nm(e):0}else return!1}}function nm(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function $C(e,t){let{left:n,right:i}=e;if(n==i)return e;let r=t?n:i;return{left:r,right:r,top:e.top,bottom:e.bottom}}function CIt(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function u3e(e,t){let n=t.width/e.offsetWidth,i=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(t.height-e.offsetHeight)<1)&&(i=1),{scaleX:n,scaleY:i}}function AIt(e,t,n,i,r,s,o,l){let c=e.ownerDocument,u=c.defaultView||window;for(let d=e,f=!1;d&&!f;)if(d.nodeType==1){let h,m=d==c.body,g=1,b=1;if(m)h=CIt(u);else{if(/^(fixed|sticky)$/.test(getComputedStyle(d).position)&&(f=!0),d.scrollHeight<=d.clientHeight&&d.scrollWidth<=d.clientWidth){d=d.assignedSlot||d.parentNode;continue}let w=d.getBoundingClientRect();({scaleX:g,scaleY:b}=u3e(d,w)),h={left:w.left,right:w.left+d.clientWidth*g,top:w.top,bottom:w.top+d.clientHeight*b}}let v=0,y=0;if(r=="nearest")t.top0&&t.bottom>h.bottom+y&&(y=t.bottom-h.bottom+o)):t.bottom>h.bottom-o&&(y=t.bottom-h.bottom+o,n<0&&t.top-y0&&t.right>h.right+v&&(v=t.right-h.right+s)):t.right>h.right-s&&(v=t.right-h.right+s,n<0&&t.lefth.bottom||t.lefth.right)&&(t={left:Math.max(t.left,h.left),right:Math.min(t.right,h.right),top:Math.max(t.top,h.top),bottom:Math.min(t.bottom,h.bottom)}),d=d.assignedSlot||d.parentNode}else if(d.nodeType==11)d=d.host;else break}function d3e(e,t=!0){let n=e.ownerDocument,i=null,r=null;for(let s=e.parentNode;s&&!(s==n.body||(!t||i)&&r);)if(s.nodeType==1)!r&&s.scrollHeight>s.clientHeight&&(r=s),t&&!i&&s.scrollWidth>s.clientWidth&&(i=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:i,y:r}}class TIt{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:n,focusNode:i}=t;this.set(n,Math.min(t.anchorOffset,n?nm(n):0),i,Math.min(t.focusOffset,i?nm(i):0))}set(t,n,i,r){this.anchorNode=t,this.anchorOffset=n,this.focusNode=i,this.focusOffset=r}}let by=null;hn.safari&&hn.safari_version>=26&&(by=!1);function f3e(e){if(e.setActive)return e.setActive();if(by)return e.focus(by);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(by==null?{get preventScroll(){return by={preventScroll:!0},!0}}:void 0),!by){by=!1;for(let n=0;nMath.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function p3e(e,t){for(let n=e,i=t;;){if(n.nodeType==3&&i>0)return{node:n,offset:i};if(n.nodeType==1&&i>0){if(n.contentEditable=="false")return null;n=n.childNodes[i-1],i=nm(n)}else if(n.parentNode&&!zI(n))i=mb(n),n=n.parentNode;else return null}}function m3e(e,t){for(let n=e,i=t;;){if(n.nodeType==3&&i=n){if(l.level==i)return o;(s<0||(r!=0?r<0?l.fromn:t[s].level>l.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}}function y3e(e,t){if(e.length!=t.length)return!1;for(let n=0;n=0;b-=3)if(Qf[b+1]==-m){let v=Qf[b+2],y=v&2?r:v&4?v&1?s:r:0;y&&(as[f]=as[Qf[b]]=y),l=b;break}}else{if(Qf.length==189)break;Qf[l++]=f,Qf[l++]=h,Qf[l++]=c}else if((g=as[f])==2||g==1){let b=g==r;c=b?0:1;for(let v=l-3;v>=0;v-=3){let y=Qf[v+2];if(y&2)break;if(b)Qf[v+2]|=2;else{if(y&4)break;Qf[v+2]|=4}}}}}function MIt(e,t,n,i){for(let r=0,s=i;r<=n.length;r++){let o=r?n[r-1].to:e,l=rc;)g==v&&(g=n[--b].from,v=b?n[b-1].to:e),as[--g]=m;c=d}else s=u,c++}}}function B9(e,t,n,i,r,s,o){let l=i%2?2:1;if(i%2==r%2)for(let c=t,u=0;cc&&o.push(new lh(c,b.from,m));let v=b.direction==w0!=!(m%2);U9(e,v?i+1:i,r,b.inner,b.from,b.to,o),c=b.to}g=b.to}else{if(g==n||(d?as[g]!=l:as[g]==l))break;g++}h?B9(e,c,g,i+1,r,h,o):ct;){let d=!0,f=!1;if(!u||c>s[u-1].to){let b=as[c-1];b!=l&&(d=!1,f=b==16)}let h=!d&&l==1?[]:null,m=d?i:i+1,g=c;e:for(;;)if(u&&g==s[u-1].to){if(f)break e;let b=s[--u];if(!d)for(let v=b.from,y=u;;){if(v==t)break e;if(y&&s[y-1].to==v)v=s[--y].from;else{if(as[v-1]==l)break e;break}}if(h)h.push(b);else{b.toas.length;)as[as.length]=256;let i=[],r=t==w0?0:1;return U9(e,r,r,n,0,e.length,i),i}function v3e(e){return[new lh(0,e,0)]}let x3e="";function $It(e,t,n,i,r){var s;let o=i.head-e.from,l=lh.find(t,o,(s=i.bidiLevel)!==null&&s!==void 0?s:-1,i.assoc),c=t[l],u=c.side(r,n);if(o==u){let h=l+=r?1:-1;if(h<0||h>=t.length)return null;c=t[l=h],o=c.side(!r,n),u=c.side(r,n)}let d=Ro(e.text,o,c.forward(r,n));(dc.to)&&(d=u),x3e=e.text.slice(Math.min(o,d),Math.max(o,d));let f=l==(r?t.length-1:0)?null:t[l+(r?1:-1)];return f&&d==u&&f.level+(r?0:1)e.some(t=>t)}),T3e=mn.define({combine:e=>e.some(t=>t)}),_3e=mn.define();class vw{constructor(t,n,i,r,s,o=!1){this.range=t,this.y=n,this.x=i,this.yMargin=r,this.xMargin=s,this.isSnapshot=o}map(t){return t.empty?this:new vw(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new vw(ht.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const z_=pi.define({map:(e,t)=>e.map(t)}),j3e=pi.define();function Dc(e,t,n){let i=e.facet(S3e);i.length?i[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+":",t):console.error(t))}const xp=mn.define({combine:e=>e.length?e[0]:!0});let BIt=0;const Fx=mn.define({combine(e){return e.filter((t,n)=>{for(let i=0;i{let c=[];return o&&c.push(XM.of(u=>{let d=u.plugin(l);return d?o(d):Fn.none})),s&&c.push(s(l)),c})}static fromClass(t,n){return ma.define((i,r)=>new t(i,r),n)}}class Y4{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(t){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(i){if(Dc(n.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(t,this.spec.arg)}catch(n){Dc(t.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(i){Dc(t.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const N3e=mn.define(),qq=mn.define(),XM=mn.define(),R3e=mn.define(),Wq=mn.define(),_T=mn.define(),I3e=mn.define();function Rie(e,t){let n=e.state.facet(I3e);if(!n.length)return n;let i=n.map(s=>s instanceof Function?s(e):s),r=[];return Ki.spans(i,t.from,t.to,{point(){},span(s,o,l,c){let u=s-t.from,d=o-t.from,f=r;for(let h=l.length-1;h>=0;h--,c--){let m=l[h].spec.bidiIsolate,g;if(m==null&&(m=FIt(t.text,u,d)),c>0&&f.length&&(g=f[f.length-1]).to==u&&g.direction==m)g.to=d,f=g.inner;else{let b={from:u,to:d,direction:m,inner:[]};f.push(b),f=b.inner}}}}),r}const P3e=mn.define();function Kq(e){let t=0,n=0,i=0,r=0;for(let s of e.state.facet(P3e)){let o=s(e);o&&(o.left!=null&&(t=Math.max(t,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(r=Math.max(r,o.bottom)))}return{left:t,right:n,top:i,bottom:r}}const bS=mn.define();class pd{constructor(t,n,i,r){this.fromA=t,this.toA=n,this.fromB=i,this.toB=r}join(t){return new pd(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let n=t.length,i=this;for(;n>0;n--){let r=t[n-1];if(!(r.fromA>i.toA)){if(r.toAr.push(new pd(s,o,l,c))),this.changedRanges=r}static create(t,n,i){return new VI(t,n,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(t=>t.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const UIt=[];class pa{constructor(t,n,i=0){this.dom=t,this.length=n,this.flags=i,this.parent=null,t.cmTile=this}get breakAfter(){return this.flags&1}get children(){return UIt}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(t){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&kIt(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(t){this.dom=t,t.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(t,n=this.posAtStart){let i=n;for(let r of this.children){if(r==t)return i;i+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(t){return this.posBefore(t)+t.length}covers(t){return!0}coordsIn(t,n,i){return null}domPosFor(t,n){let i=mb(this.dom),r=this.length?t>0:n>0;return new cf(this.parent.dom,i+(r?1:0),t==0||t==this.length)}markDirty(t){this.flags&=-3,t&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let t=this;t;t=t.parent)if(t instanceof ZM)return t;return null}static get(t){return t.cmTile}}class YM extends pa{constructor(t){super(t,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(t){this.children.push(t),t.parent=this}sync(t){if(this.flags&2)return;super.sync(t);let n=this.dom,i=null,r,s=(t==null?void 0:t.node)==n?t:null,o=0;for(let l of this.children){if(l.sync(t),o+=l.length+l.breakAfter,r=i?i.nextSibling:n.firstChild,s&&r!=l.dom&&(s.written=!0),l.dom.parentNode==n)for(;r&&r!=l.dom;)r=Iie(r);else n.insertBefore(l.dom,r);i=l.dom}for(r=i?i.nextSibling:n.firstChild,s&&r&&(s.written=!0);r;)r=Iie(r);this.length=o}}function Iie(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class ZM extends YM{constructor(t,n){super(n),this.view=t}owns(t){for(;t;t=t.parent)if(t==this)return!0;return!1}isBlock(){return!0}nearest(t){for(;;){if(!t)return null;let n=pa.get(t);if(n&&this.owns(n))return n;t=t.parentNode}}blockTiles(t){for(let n=[],i=this,r=0,s=0;;)if(r==i.children.length){if(!n.length)return;i=i.parent,i.breakAfter&&s++,r=n.pop()}else{let o=i.children[r++];if(o instanceof Up)n.push(r),i=o,r=0;else{let l=s+o.length,c=t(o,s);if(c!==void 0)return c;s=l+o.breakAfter}}}resolveBlock(t,n){let i,r=-1,s,o=-1;if(this.blockTiles((l,c)=>{let u=c+l.length;if(t>=c&&t<=u){if(l.isWidget()&&n>=-1&&n<=1){if(l.flags&32)return!0;l.flags&16&&(i=void 0)}(ct||t==c&&(n>1?l.length:l.covers(-1)))&&(!s||!l.isWidget()&&s.isWidget())&&(s=l,o=t-c)}}),!i&&!s)throw new Error("No tile at position "+t);return i&&n<0||!s?{tile:i,offset:r}:{tile:s,offset:o}}}class Up extends YM{constructor(t,n){super(t),this.wrapper=n}isBlock(){return!0}covers(t){return this.children.length?t<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(t,n){let i=new Up(n||document.createElement(t.tagName),t);return n||(i.flags|=4),i}}class u1 extends YM{constructor(t,n){super(t),this.attrs=n}isLine(){return!0}static start(t,n,i){let r=new u1(n||document.createElement("div"),t);return(!n||!i)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(t,n,i){let r=null,s=-1,o=null,l=-1;function c(d,f){for(let h=0,m=0;h=f&&(g.isComposite()?c(g,f-m):(!o||o.isHidden&&(n>0&&!(o.flags&32)||i&&zIt(o,g)))&&(b>f||g.flags&32)?(o=g,l=f-m):(mr&&(t=r);let s=t,o=t,l=0;t==0&&n<0||t==r&&n>=0?hn.chrome||hn.gecko||(t?(s--,l=1):o=0)?0:c.length-1];return hn.safari&&!l&&u.width==0&&(u=Array.prototype.find.call(c,d=>d.width)||u),i==null?u:$C(u,(l?l>0:n<0)==i)}static of(t,n){let i=new Py(n||document.createTextNode(t),t);return n||(i.flags|=2),i}}class O0 extends pa{constructor(t,n,i,r){super(t,n,r),this.widget=i}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(t){return this.flags&48?!1:(this.flags&(t<0?64:128))>0}coordsIn(t,n){return this.coordsInWidget(t,n,!1)}coordsInWidget(t,n,i){let r=this.widget.coordsAt(this.dom,t,n);if(r)return r;if(i)return $C(this.dom.getBoundingClientRect(),this.length?t==0:n<=0);{let s=this.dom.getClientRects(),o=null;if(!s.length)return null;let l=this.flags&16?!0:this.flags&32?!1:t>0;for(let c=l?s.length-1:0;o=s[c],!(t>0?c==0:c==s.length-1||o.top0==i)}}class VIt{constructor(t){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=t}advance(t,n,i){let{tile:r,index:s,beforeBreak:o,parents:l}=this;for(;t||n>0;)if(r.isComposite())if(o){if(!t)break;i&&i.break(),t--,o=!1}else if(s==r.children.length){if(!t&&!l.length)break;i&&i.leave(r),o=!!r.breakAfter,{tile:r,index:s}=l.pop(),s++}else{let c=r.children[s],u=c.breakAfter;(n>0?c.length<=t:c.length=0;l--){let c=n.marks[l],u=r.lastChild;if(u instanceof Ic&&u.mark.eq(c.mark))u.dom!=c.dom&&u.setDOM(Z4(c.dom)),r=u;else{if(this.cache.reused.get(c)){let f=pa.get(c.dom);f&&f.setDOM(Z4(c.dom))}let d=Ic.of(c.mark,c.dom);r.append(d),r=d}this.cache.reused.set(c,2)}let s=pa.get(t.text);s&&this.cache.reused.set(s,2);let o=new Py(t.text,t.text.nodeValue);o.flags|=8,this.pos=t.range.toB,r.append(o)}addInlineWidget(t,n,i){let r=this.afterWidget&&t.flags&48&&(this.afterWidget.flags&48)==(t.flags&48);r||this.flushBuffer();let s=this.ensureMarks(n,i);!r&&!(t.flags&16)&&s.append(this.getBuffer(1)),s.append(t),this.pos+=t.length,this.afterWidget=t}addMark(t,n,i){this.flushBuffer(),this.ensureMarks(n,i).append(t),this.pos+=t.length,this.afterWidget=null}addBlockWidget(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}continueWidget(t){let n=this.afterWidget||this.lastBlock;n.length+=t,this.pos+=t}addLineStart(t,n){var i;t||(t=D3e);let r=u1.start(t,n||((i=this.cache.find(u1))===null||i===void 0?void 0:i.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(t){this.blockPosCovered()||this.addLineStart(t)}ensureLine(t){this.curLine||this.addLineStart(t)}ensureMarks(t,n){var i;let r=this.curLine;for(let s=t.length-1;s>=0;s--){let o=t[s],l;if(n>0&&(l=r.lastChild)&&l instanceof Ic&&l.mark.eq(o))r=l,n--;else{let c=Ic.of(o,(i=this.cache.find(Ic,u=>u.mark.eq(o)))===null||i===void 0?void 0:i.dom);r.append(c),r=c,n=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let t=this.curLine.lastChild;(!t||!Pie(this.curLine,!1)||t.dom.nodeName!="BR"&&t.isWidget()&&!(hn.ios&&Pie(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(J4,0,32)||new O0(J4.toDOM(),0,J4,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let t=this.wrappers.length-1;t>=0;t--)this.wrappers[t].to=this.pos){let n=t.rank*102+t.value.rank,i=new HIt(t.from,t.to,t.value,n),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-i.rank||this.wrappers[r-1].to-i.to)<0;)r--;this.wrappers.splice(r,0,i)}this.wrapperPos=this.pos}getBlockPos(){var t;this.updateBlockWrappers();let n=this.root;for(let i of this.wrappers){let r=n.lastChild;if(i.fromo.wrapper.eq(i.wrapper)))===null||t===void 0?void 0:t.dom);n.append(s),n=s}}return n}blockPosCovered(){let t=this.lastBlock;return t!=null&&!t.breakAfter&&(!t.isWidget()||(t.flags&160)>0)}getBuffer(t){let n=2|(t<0?16:32),i=this.cache.find(HI,void 0,1);return i&&(i.flags=n),i||new HI(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class WIt{constructor(t){this.skipCount=0,this.text="",this.textOff=0,this.cursor=t.iter()}skip(t){this.textOff+t<=this.text.length?this.textOff+=t:(this.skipCount+=t-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(t){if(this.textOff==this.text.length){let{value:r,lineBreak:s,done:o}=this.cursor.next(this.skipCount);if(this.skipCount=0,o)throw new Error("Ran out of text content when drawing inline views");this.text=r;let l=this.textOff=Math.min(t,r.length);return s?null:r.slice(0,l)}let n=Math.min(this.text.length,this.textOff+t),i=this.text.slice(this.textOff,n);return this.textOff=n,i}}const qI=[O0,u1,Py,Ic,HI,Up,ZM];for(let e=0;e[]),this.index=qI.map(()=>0),this.reused=new Map}add(t){let n=t.constructor.bucket,i=this.buckets[n];i.length<6?i.push(t):i[this.index[n]=(this.index[n]+1)%6]=t}find(t,n,i=2){let r=t.bucket,s=this.buckets[r],o=this.index[r];for(let l=0;l{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(t,n){let i=n&&this.getCompositionContext(n.text);for(let r=0,s=0,o=0;;){let l=or){let u=c-r;this.preserve(u,!o,!l),r=c,s+=u}if(!l)break;n&&l.fromA<=n.range.fromA&&l.toA>=n.range.toA?(this.forward(l.fromA,n.range.fromA,n.range.fromA{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(c-l);else{let u=c>0||l{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof Ic&&r.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?r.length&&(r.length=s=0):o instanceof Ic&&(r.shift(),s=Math.min(s,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(t)}emit(t,n){let i=null,r=this.builder,s=-1,o=Ki.spans(this.decorations,t,n,{point:(l,c,u,d,f,h)=>{if(u instanceof x0){if(this.disallowBlockEffectsFor[h]){if(u.block)throw new RangeError("Block decorations may not be specified via plugins");if(c>this.view.state.doc.lineAt(l).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=d.length,f>d.length)r.continueWidget(c-l);else{let m=u.widget||(u.block?d1.block:d1.inline),g=XIt(u),b=this.cache.findWidget(m,c-l,g)||O0.of(m,this.view,c-l,g);u.block?(u.startSide>0&&r.addLineStartIfNotCovered(i),r.addBlockWidget(b)):(r.ensureLine(i),r.addInlineWidget(b,d,f))}i=null}else i=YIt(i,u);c>l&&this.text.skip(c-l)},span:(l,c,u,d)=>{for(let f=l;f-1&&(this.openWidget=o>s),this.openWidget||r.addLineStartIfNotCovered(i),this.openMarks=o}forward(t,n,i=1){n-t<=10?this.old.advance(n-t,i,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-t-10,-1),this.old.advance(5,i,this.reuseWalker))}getCompositionContext(t){let n=[],i=null;for(let r=t.parentNode;;r=r.parentNode){let s=pa.get(r);if(r==this.view.contentDOM)break;s instanceof Ic?n.push(s):s!=null&&s.isLine()?i=s:s instanceof Up||(r.nodeName=="DIV"&&!i&&r!=this.view.contentDOM?i=new u1(r,D3e):i||n.push(Ic.of(new AT({tagName:r.nodeName.toLowerCase(),attributes:SIt(r)}),r)))}return{line:i,marks:n}}}function Pie(e,t){let n=i=>{for(let r of i.children)if((t?r.isText():r.length)||n(r))return!0;return!1};return n(e)}function XIt(e){let t=e.isReplace?(e.startSide<0?64:0)|(e.endSide>0?128:0):e.startSide>0?32:16;return e.block&&(t|=256),t}const D3e={class:"cm-line"};function YIt(e,t){let n=t.spec.attributes,i=t.spec.class;return!n&&!i||(e||(e={class:"cm-line"}),n&&Uq(n,e),i&&(e.class+=" "+i)),e}function ZIt(e){let t=[];for(let n=e.parents.length;n>1;n--){let i=n==e.parents.length?e.tile:e.parents[n].tile;i instanceof Ic&&t.push(i.mark)}return t}function Z4(e){let t=pa.get(e);return t&&t.setDOM(e.cloneNode()),e}class d1 extends jf{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}d1.inline=new d1("span");d1.block=new d1("div");const J4=new class extends jf{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class Die{constructor(t){this.view=t,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=Fn.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new ZM(t,t.contentDOM),this.updateInner([new pd(0,0,0,t.state.doc.length)],null)}update(t){var n;let i=t.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:d,toA:f})=>fthis.minWidthTo)?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(t);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?r=this.domChanged.newSel.head:!oPt(t.changes,this.hasComposition)&&!t.selectionSet&&(r=t.state.selection.main.head));let s=r>-1?ePt(this.view,t.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:d,to:f}=this.hasComposition;i=new pd(d,f,t.changes.mapPos(d,-1),t.changes.mapPos(f,1)).addToSet(i.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(hn.ie||hn.chrome)&&!s&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.blockWrappers;this.updateDeco();let c=iPt(o,this.decorations,t.changes);c.length&&(i=pd.extendWithRanges(i,c));let u=sPt(l,this.blockWrappers,t.changes);return u.length&&(i=pd.extendWithRanges(i,u)),s&&!i.some(d=>d.fromA<=s.range.fromA&&d.toA>=s.range.toA)&&(i=s.range.addToSet(i.slice())),this.tile.flags&2&&i.length==0?!1:(this.updateInner(i,s),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,n){this.view.viewState.mustMeasureContent=!0;let{observer:i}=this.view;i.ignore(()=>{if(n||t.length){let o=this.tile,l=new GIt(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&pa.get(n.text)&&l.cache.reused.set(pa.get(n.text),2),this.tile=l.run(t,n),z9(o,l.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=hn.chrome||hn.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||i.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to-1)&&xE(i,this.view.observer.selectionRange)&&!(r&&i.contains(r));if(!(s||n||o))return;let l=this.forceSelection;this.forceSelection=!1;let c=this.view.state.selection.main,u,d;if(c.empty?d=u=this.inlineDOMNearPos(c.anchor,c.assoc||1):(d=this.inlineDOMNearPos(c.head,c.head==c.from?1:-1),u=this.inlineDOMNearPos(c.anchor,c.anchor==c.from?1:-1)),hn.gecko&&c.empty&&!this.hasComposition&&JIt(u)){let h=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(h,u.node.childNodes[u.offset]||null)),u=d=new cf(h,0),l=!0}let f=this.view.observer.selectionRange;(l||!f.focusNode||(!OE(u.node,u.offset,f.anchorNode,f.anchorOffset)||!OE(d.node,d.offset,f.focusNode,f.focusOffset))&&!this.suppressWidgetCursorChange(f,c))&&(this.view.observer.ignore(()=>{hn.android&&hn.chrome&&i.contains(f.focusNode)&&aPt(f.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let h=LC(this.view.root);if(h)if(c.empty){if(hn.gecko){let m=tPt(u.node,u.offset);if(m&&m!=3){let g=(m==1?p3e:m3e)(u.node,u.offset);g&&(u=new cf(g.node,g.offset))}}h.collapse(u.node,u.offset),c.bidiLevel!=null&&h.caretBidiLevel!==void 0&&(h.caretBidiLevel=c.bidiLevel)}else if(h.extend){h.collapse(u.node,u.offset);try{h.extend(d.node,d.offset)}catch{}}else{let m=document.createRange();c.anchor>c.head&&([u,d]=[d,u]),m.setEnd(d.node,d.offset),m.setStart(u.node,u.offset),h.removeAllRanges(),h.addRange(m)}o&&this.view.root.activeElement==i&&(i.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(u,d)),this.impreciseAnchor=u.precise?null:new cf(f.anchorNode,f.anchorOffset),this.impreciseHead=d.precise?null:new cf(f.focusNode,f.focusOffset)}suppressWidgetCursorChange(t,n){return this.hasComposition&&n.empty&&OE(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,n=t.state.selection.main,i=LC(t.root),{anchorNode:r,anchorOffset:s}=t.observer.selectionRange;if(!i||!n.empty||!n.assoc||!i.modify)return;let o=this.lineAt(n.head,n.assoc);if(!o)return;let l=o.posAtStart;if(n.head==l||n.head==l+o.length)return;let c=this.coordsAt(n.head,-1),u=this.coordsAt(n.head,1);if(!c||!u||c.bottom>u.top)return;let d=this.domAtPos(n.head+n.assoc,n.assoc);i.collapse(d.node,d.offset),i.modify("move",n.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let f=t.observer.selectionRange;t.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=n.from&&i.collapse(r,s)}posFromDOM(t,n){let i=this.tile.nearest(t);if(!i)return this.tile.dom.compareDocumentPosition(t)&2?0:this.view.state.doc.length;let r=i.posAtStart;if(i.isComposite()){let s;if(t==i.dom)s=i.dom.childNodes[n];else{let o=nm(t)==0?0:n==0?-1:1;for(;;){let l=t.parentNode;if(l==i.dom)break;o==0&&l.firstChild!=l.lastChild&&(t==l.firstChild?o=-1:o=1),t=l}o<0?s=t:s=t.nextSibling}if(s==i.dom.firstChild)return r;for(;s&&!pa.get(s);)s=s.nextSibling;if(!s)return r+i.length;for(let o=0,l=r;;o++){let c=i.children[o];if(c.dom==s)return l;l+=c.length+c.breakAfter}}else return i.isText()?t==i.dom?r+n:r+(n?i.length:0):r}domAtPos(t,n){let{tile:i,offset:r}=this.tile.resolveBlock(t,n);return i.isWidget()?i.domPosFor(r,n):i.domIn(r,n)}inlineDOMNearPos(t,n){let i,r=-1,s=!1,o,l=-1,c=!1;return this.tile.blockTiles((u,d)=>{if(u.isWidget()){if(u.flags&32&&d>=t)return!0;u.flags&16&&(s=!0)}else{let f=d+u.length;if(d<=t&&(i=u,r=t-d,s=f=t&&!o&&(o=u,l=t-d,c=d>t),d>t&&o)return!0}}),!i&&!o?this.domAtPos(t,n):(s&&o?i=null:c&&i&&(o=null),i&&n<0||!o?i.domIn(r,n):o.domIn(l,n))}coordsAt(t,n,i){let{tile:r,offset:s}=this.tile.resolveBlock(t,n);return r.isWidget()?r.widget instanceof e$?null:r.coordsInWidget(s,n,!0):r.coordsIn(s,n,i)}lineAt(t,n){let{tile:i}=this.tile.resolveBlock(t,n);return i.isLine()?i:null}coordsForChar(t){let{tile:n,offset:i}=this.tile.resolveBlock(t,1);if(!n.isLine())return null;function r(s,o){if(s.isComposite())for(let l of s.children){if(l.length>=o){let c=r(l,o);if(c)return c}if(o-=l.length,o<0)break}else if(s.isText()&&oMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,c=this.view.textDirection==os.LTR,u=0,d=(f,h,m)=>{for(let g=0;gr);g++){let b=f.children[g],v=h+b.length,y=b.dom.getBoundingClientRect(),{height:w}=y;if(m&&!g&&(u+=y.top-m.top),b instanceof Up)v>i&&d(b,h,y);else if(h>=i&&(u>0&&n.push(-u),n.push(w+u),u=0,o)){let x=b.dom.lastChild,O=x?wE(x):[];if(O.length){let k=O[O.length-1],S=c?k.right-y.left:y.right-k.left;S>l&&(l=S,this.minWidth=s,this.minWidthFrom=h,this.minWidthTo=v)}}m&&g==f.children.length-1&&(u+=m.bottom-y.bottom),h=v+b.breakAfter}};return d(this.tile,0,null),n}textDirectionAt(t){let{tile:n}=this.tile.resolveBlock(t,1);return getComputedStyle(n.dom).direction=="rtl"?os.RTL:os.LTR}measureTextSize(){let t=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let l=0,c;for(let u of o.children){if(!u.isText()||/[^ -~]/.test(u.text))return;let d=wE(u.dom);if(d.length!=1)return;l+=d[0].width,c=d[0].height}if(l)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:l/o.length,textHeight:c}}});if(t)return t;let n=document.createElement("div"),i,r,s;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let o=wE(n.firstChild)[0];i=n.getBoundingClientRect().height,r=o&&o.width?o.width/27:7,s=o&&o.height?o.height:i,n.remove()}),{lineHeight:i,charWidth:r,textHeight:s}}computeBlockGapDeco(){let t=[],n=this.view.viewState;for(let i=0,r=0;;r++){let s=r==n.viewports.length?null:n.viewports[r],o=s?s.from-1:this.view.state.doc.length;if(o>i){let l=(n.lineBlockAt(o).bottom-n.lineBlockAt(i).top)/this.view.scaleY;t.push(Fn.replace({widget:new e$(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!s)break;i=s.to+1}return Fn.set(t)}updateDeco(){let t=1,n=this.view.state.facet(XM).map(s=>(this.dynamicDecorationMap[t++]=typeof s=="function")?s(this.view):s),i=!1,r=this.view.state.facet(Wq).map((s,o)=>{let l=typeof s=="function";return l&&(i=!0),l?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[t++]=i,n.push(Ki.join(r))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];ttypeof s=="function"?s(this.view):s)}scrollIntoView(t){if(t.isSnapshot){let u=this.view.viewState.lineBlockAt(t.range.head);this.view.scrollDOM.scrollTop=u.top-t.yMargin,this.view.scrollDOM.scrollLeft=t.xMargin;return}for(let u of this.view.state.facet(_3e))try{if(u(this.view,t.range,t))return!0}catch(d){Dc(this.view.state,d,"scroll handler")}let{range:n}=t,i=this.coordsAt(n.head,n.assoc||(n.head>n.anchor?-1:1)),r;if(!i)return;!n.empty&&(r=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(i={left:Math.min(i.left,r.left),top:Math.min(i.top,r.top),right:Math.max(i.right,r.right),bottom:Math.max(i.bottom,r.bottom)});let s=Kq(this.view),o={left:i.left-s.left,top:i.top-s.top,right:i.right+s.right,bottom:i.bottom+s.bottom},{offsetWidth:l,offsetHeight:c}=this.view.scrollDOM;if(AIt(this.view.scrollDOM,o,n.head1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottomi.isWidget()||i.children.some(n);return n(this.tile.resolveBlock(t,1).tile)}destroy(){z9(this.tile)}}function z9(e,t){let n=t==null?void 0:t.get(e);if(n!=1){n==null&&e.destroy();for(let i of e.children)z9(i,t)}}function JIt(e){return e.node.nodeType==1&&e.node.firstChild&&(e.offset==0||e.node.childNodes[e.offset-1].contentEditable=="false")&&(e.offset==e.node.childNodes.length||e.node.childNodes[e.offset].contentEditable=="false")}function M3e(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let i=p3e(n.focusNode,n.focusOffset),r=m3e(n.focusNode,n.focusOffset),s=i||r;if(r&&i&&r.node!=i.node){let l=pa.get(r.node);if(!l||l.isText()&&l.text!=r.node.nodeValue)s=r;else if(e.docView.lastCompositionAfterCursor){let c=pa.get(i.node);!c||c.isText()&&c.text!=i.node.nodeValue||(s=r)}}if(e.docView.lastCompositionAfterCursor=s!=i,!s)return null;let o=t-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function ePt(e,t,n){let i=M3e(e,n);if(!i)return null;let{node:r,from:s,to:o}=i,l=r.nodeValue;if(/[\n\r]/.test(l)||e.state.doc.sliceString(i.from,i.to)!=l)return null;let c=t.invertedDesc;return{range:new pd(c.mapPos(s),c.mapPos(o),s,o),text:r}}function tPt(e,t){return e.nodeType!=1?0:(t&&e.childNodes[t-1].contentEditable=="false"?1:0)|(t{it.from&&(n=!0)}),n}class e$ extends jf{constructor(t){super(),this.height=t}toDOM(){let t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function lPt(e,t,n=1){let i=e.charCategorizer(t),r=e.doc.lineAt(t),s=t-r.from;if(r.length==0)return ht.cursor(t);s==0?n=1:s==r.length&&(n=-1);let o=s,l=s;n<0?o=Ro(r.text,s,!1):l=Ro(r.text,s);let c=i(r.text.slice(o,l));for(;o>0;){let u=Ro(r.text,o,!1);if(i(r.text.slice(u,o))!=c)break;o=u}for(;le.defaultLineHeight*1.5){let l=e.viewState.heightOracle.textHeight,c=Math.floor((r-n.top-(e.defaultLineHeight-l)*.5)/l);s+=c*e.viewState.heightOracle.lineLength}let o=e.state.sliceDoc(n.from,n.to);return n.from+N9(o,s,e.state.tabSize)}function V9(e,t,n){let i=e.lineBlockAt(t);if(Array.isArray(i.type)){let r;for(let s of i.type){if(s.from>t)break;if(!(s.tot)return s;(!r||s.type==ol.Text&&(r.type!=s.type||(n<0?s.fromt)))&&(r=s)}}return r||i}return i}function uPt(e,t,n,i){let r=V9(e,t.head,t.assoc||-1),s=!i||r.type!=ol.Text||!(e.lineWrapping||r.widgetLineBreaks)?null:e.coordsAtPos(t.assoc<0&&t.head>r.from?t.head-1:t.head);if(s){let o=e.dom.getBoundingClientRect(),l=e.textDirectionAt(r.from),c=e.posAtCoords({x:n==(l==os.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(c!=null)return ht.cursor(c,n?-1:1)}return ht.cursor(n?r.to:r.from,n?-1:1)}function Mie(e,t,n,i){let r=e.state.doc.lineAt(t.head),s=e.bidiSpans(r),o=e.textDirectionAt(r.from);for(let l=t,c=null;;){let u=$It(r,s,o,l,n),d=x3e;if(!u){if(r.number==(n?e.state.doc.lines:1))return l;d=` -`,r=e.state.doc.line(r.number+(n?1:-1)),s=e.bidiSpans(r),u=e.visualLineSide(r,!n)}if(c){if(!c(d))return l}else{if(!i)return u;c=i(d)}l=u}}function dPt(e,t,n){let i=e.state.charCategorizer(t),r=i(n);return s=>{let o=i(s);return r==Qs.Space&&(r=o),r==o}}function fPt(e,t,n,i){let r=t.head,s=n?1:-1;if(r==(n?e.state.doc.length:0))return ht.cursor(r,t.assoc);let o=t.goalColumn,l,c=e.contentDOM.getBoundingClientRect(),u=e.coordsAtPos(r,t.assoc||((t.empty?n:t.head==t.from)?1:-1)),d=e.documentTop;if(u)o==null&&(o=u.left-c.left),l=s<0?u.top:u.bottom;else{let g=e.viewState.lineBlockAt(r);o==null&&(o=Math.min(c.right-c.left,e.defaultCharacterWidth*(r-g.from))),l=(s<0?g.top:g.bottom)+d}let f=c.left+o,h=e.viewState.heightOracle.textHeight>>1,m=i??h;for(let g=0;;g+=h){let b=l+(m+g)*s,v=H9(e,{x:f,y:b},!1,s);if(n?b>c.bottom:bl:w{if(t>s&&tr(e)),n.from,t.head>n.from?-1:1);return i==n.from?n:ht.cursor(i,ie.viewState.docHeight)return new th(e.state.doc.length,-1);if(u=e.elementAtHeight(c),i==null)break;if(u.type==ol.Text){if(i<0?u.toe.viewport.to)break;let h=e.docView.coordsAt(i<0?u.from:u.to,i>0?-1:1);if(h&&(i<0?h.top<=c+s:h.bottom>=c+s))break}let f=e.viewState.heightOracle.textHeight/2;c=i>0?u.bottom+f:u.top-f}if(e.viewport.from>=u.to||e.viewport.to<=u.from){if(n)return null;if(u.type==ol.Text){let f=cPt(e,r,u,o,l);return new th(f,f==u.from?1:-1)}}if(u.type!=ol.Text)return c<(u.top+u.bottom)/2?new th(u.from,1):new th(u.to,-1);let d=e.docView.lineAt(u.from,2);return(!d||d.length!=u.length)&&(d=e.docView.lineAt(u.from,-2)),new hPt(e,o,l,e.textDirectionAt(u.from)).scanTile(d,u.from)}class hPt{constructor(t,n,i,r){this.view=t,this.x=n,this.y=i,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(t){return(!this.line||this.line.from>t||this.line.to1||i.length&&(i[0].level!=this.baseDir||i[0].to+r.from>1;t:if(o.has(b)){let y=r+Math.floor(Math.random()*g);for(let w=0;w1)){if(w.bottomthis.y)(!u||u.top>w.top)&&(u=w),x=-1;else{let O=w.left>this.x?this.x-w.left:w.right(g+g+b)/3)return this.y=c.bottom-1,this.scan(t,n,!0);if(u&&u.top<(g+b+b)/3)return this.y=u.top+1,this.scan(t,n,!0)}let m=(l?this.dirAt(t[d],1):this.baseDir)==os.LTR;return{i:d,after:this.x>(h.left+h.right)/2==m}}scanText(t,n){let i=[];for(let s=0;s{let o=i[s]-n,l=i[s+1]-n;return FC(t.dom,o,l).getClientRects()});return r.after?new th(i[r.i+1],-1):new th(i[r.i],1)}scanTile(t,n){if(!t.length)return new th(n,1);if(t.children.length==1){let l=t.children[0];if(l.isText())return this.scanText(l,n);if(l.isComposite())return this.scanTile(l,n)}let i=[n];for(let l=0,c=n;l{let c=t.children[l];return c.flags&48?null:(c.dom.nodeType==1?c.dom:FC(c.dom,0,c.length)).getClientRects()}),s=t.children[r.i],o=i[r.i];return s.isText()?this.scanText(s,o):s.isComposite()?this.scanTile(s,o):r.after?new th(i[r.i+1],-1):new th(o,1)}}const cx="￿";class pPt{constructor(t,n){this.points=t,this.view=n,this.text="",this.lineSeparator=n.state.facet(tr.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=cx}readRange(t,n){if(!t)return this;let i=t.parentNode;for(let r=t;;){this.findPointBefore(i,r);let s=this.text.length;this.readNode(r);let o=pa.get(r),l=r.nextSibling;if(l==n){o!=null&&o.breakAfter&&!l&&i!=this.view.contentDOM&&this.lineBreak();break}let c=pa.get(l);(o&&c?o.breakAfter:(o?o.breakAfter:zI(r))||zI(l)&&(r.nodeName!="BR"||o!=null&&o.isWidget())&&this.text.length>s)&&!gPt(l,n)&&this.lineBreak(),r=l}return this.findPointBefore(i,n),this}readTextNode(t){let n=t.nodeValue;for(let i of this.points)i.node==t&&(i.pos=this.text.length+Math.min(i.offset,n.length));for(let i=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,l;if(this.lineSeparator?(s=n.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=r.exec(n))&&(s=l.index,o=l[0].length),this.append(n.slice(i,s<0?n.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let c of this.points)c.node==t&&c.pos>this.text.length&&(c.pos-=o-1);i=s+o}}readNode(t){let n=pa.get(t),i=n&&n.overrideDOMText;if(i!=null){this.findPointInside(t,i.length);for(let r=i.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else t.nodeType==3?this.readTextNode(t):t.nodeName=="BR"?t.nextSibling&&this.lineBreak():t.nodeType==1&&this.readRange(t.firstChild,null)}findPointBefore(t,n){for(let i of this.points)i.node==t&&t.childNodes[i.offset]==n&&(i.pos=this.text.length)}findPointInside(t,n){for(let i of this.points)(t.nodeType==3?i.node==t:t.contains(i.node))&&(i.pos=this.text.length+(mPt(t,i.node,i.offset)?n:0))}}function mPt(e,t,n){for(;;){if(!t||n-1;let{impreciseHead:s,impreciseAnchor:o}=t.docView,l=t.state.selection;if(t.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=$3e(t.docView.tile,n,i,0))){let c=s||o?[]:vPt(t),u=new pPt(c,t);u.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=u.text,this.newSel=xPt(c,this.bounds.from)}else{let c=t.observer.selectionRange,u=s&&s.node==c.focusNode&&s.offset==c.focusOffset||!$9(t.contentDOM,c.focusNode)?l.main.head:t.docView.posFromDOM(c.focusNode,c.focusOffset),d=o&&o.node==c.anchorNode&&o.offset==c.anchorOffset||!$9(t.contentDOM,c.anchorNode)?l.main.anchor:t.docView.posFromDOM(c.anchorNode,c.anchorOffset),f=t.viewport;if((hn.ios||hn.chrome)&&u!=d&&Math.min(u,d)<=l.main.from&&Math.max(u,d)>=l.main.to&&(f.from>0||f.to-1&&l.ranges.length>1)this.newSel=l.replaceRange(ht.range(d,u));else if(t.lineWrapping&&d==u&&!(l.main.empty&&l.main.head==u)&&t.inputState.lastTouchTime>Date.now()-100){let h=t.coordsAtPos(u,-1),m=0;h&&(m=t.inputState.lastTouchY<=h.bottom?-1:1),this.newSel=ht.create([ht.cursor(u,m)])}else this.newSel=ht.single(d,u)}}}function $3e(e,t,n,i){if(e.isComposite()){let r=-1,s=-1,o=-1,l=-1;for(let c=0,u=i,d=i;cn)return $3e(f,t,n,u);if(h>=t&&r==-1&&(r=c,s=u),u>n&&f.dom.parentNode==e.dom){o=c,l=d;break}d=h,u=h+f.breakAfter}return{from:s,to:l<0?i+e.length:l,startDOM:(r?e.children[r-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:o=0?e.children[o].dom:null}}else return e.isText()?{from:i,to:i+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling}:null}function F3e(e,t){let n,{newSel:i}=t,{state:r}=e,s=r.selection.main,o=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:l,to:c}=t.bounds,u=s.from,d=null;(o===8||hn.android&&t.text.length=l&&s.to<=c&&(t.typeOver||f!=t.text)&&f.slice(0,s.from-l)==t.text.slice(0,s.from-l)&&f.slice(s.to-l)==t.text.slice(h=t.text.length-(f.length-(s.to-l)))?n={from:s.from,to:s.to,insert:xr.of(t.text.slice(s.from-l,h).split(cx))}:(m=B3e(f,t.text,u-l,d))&&(hn.chrome&&o==13&&m.toB==m.from+2&&t.text.slice(m.from,m.toB)==cx+cx&&m.toB--,n={from:l+m.from,to:l+m.toA,insert:xr.of(t.text.slice(m.from,m.toB).split(cx))})}else i&&(!e.hasFocus&&r.facet(xp)||WI(i,s))&&(i=null);if(!n&&!i)return!1;if((hn.mac||hn.android)&&n&&n.from==n.to&&n.from==s.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute("autocorrect")=="off"?(i&&n.insert.length==2&&(i=ht.single(i.main.anchor-1,i.main.head-1)),n={from:n.from,to:n.to,insert:xr.of([n.insert.toString().replace("."," ")])}):r.doc.lineAt(s.from).toDate.now()-50?n={from:s.from,to:s.to,insert:r.toText(e.inputState.insertingText)}:hn.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==` - `&&e.lineWrapping&&(i&&(i=ht.single(i.main.anchor-1,i.main.head-1)),n={from:s.from,to:s.to,insert:xr.of([" "])}),n)return Gq(e,n,i,o);if(i&&!WI(i,s)){let l=!1,c="select";return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin=="select"&&(l=!0),c=e.inputState.lastSelectionOrigin,c=="select.pointer"&&(i=L3e(r.facet(_T).map(u=>u(e)),i))),e.dispatch({selection:i,scrollIntoView:l,userEvent:c}),!0}else return!1}function Gq(e,t,n,i=-1){if(hn.ios&&e.inputState.flushIOSKey(t))return!0;let r=e.state.selection.main;if(hn.android&&(t.to==r.to&&(t.from==r.from||t.from==r.from-1&&e.state.sliceDoc(t.from,r.from)==" ")&&t.insert.length==1&&t.insert.lines==2&&yw(e.contentDOM,"Enter",13)||(t.from==r.from-1&&t.to==r.to&&t.insert.length==0||i==8&&t.insert.lengthr.head)&&yw(e.contentDOM,"Backspace",8)||t.from==r.from&&t.to==r.to+1&&t.insert.length==0&&yw(e.contentDOM,"Delete",46)))return!0;let s=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let o,l=()=>o||(o=yPt(e,t,n));return e.state.facet(E3e).some(c=>c(e,t.from,t.to,s,l))||e.dispatch(l()),!0}function yPt(e,t,n){let i,r=e.state,s=r.selection.main,o=-1;if(t.from==t.to&&t.froms.to){let c=t.fromf(e)),u,c);t.from==d&&(o=d)}if(o>-1)i={changes:t,selection:ht.cursor(t.from+t.insert.length,-1)};else if(t.from>=s.from&&t.to<=s.to&&t.to-t.from>=(s.to-s.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let c=s.fromt.to?r.sliceDoc(t.to,s.to):"";i=r.replaceSelection(e.state.toText(c+t.insert.sliceString(0,void 0,e.state.lineBreak)+u))}else{let c=r.changes(t),u=n&&n.main.to<=c.newLength?n.main:void 0;if(r.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=s.to+10&&t.to>=s.to-10){let d=e.state.sliceDoc(t.from,t.to),f,h=n&&M3e(e,n.main.head);if(h){let g=t.insert.length-(t.to-t.from);f={from:h.from,to:h.to-g}}else f=e.state.doc.lineAt(s.head);let m=s.to-t.to;i=r.changeByRange(g=>{if(g.from==s.from&&g.to==s.to)return{changes:c,range:u||g.map(c)};let b=g.to-m,v=b-d.length;if(e.state.sliceDoc(v,b)!=d||b>=f.from&&v<=f.to)return{range:g};let y=r.changes({from:v,to:b,insert:t.insert}),w=g.to-s.to;return{changes:y,range:u?ht.range(Math.max(0,u.anchor+w),Math.max(0,u.head+w)):g.map(y)}})}else i={changes:c,selection:u&&r.selection.replaceRange(u)}}let l="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,l+=".compose",e.inputState.compositionFirstChange&&(l+=".start",e.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:l,scrollIntoView:!0})}function B3e(e,t,n,i){let r=Math.min(e.length,t.length),s=0;for(;s0&&l>0&&e.charCodeAt(o-1)==t.charCodeAt(l-1);)o--,l--;if(i=="end"){let c=Math.max(0,s-Math.min(o,l));n-=o+c-s}if(o=o?s-n:0;s-=c,l=s+(l-o),o=s}else if(l=l?s-n:0;s-=c,o=s+(o-l),l=s}return{from:s,toA:o,toB:l}}function vPt(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}=e.observer.selectionRange;return n&&(t.push(new Lie(n,i)),(r!=n||s!=i)&&t.push(new Lie(r,s))),t}function xPt(e,t){if(e.length==0)return null;let n=e[0].pos,i=e.length==2?e[1].pos:n;return n>-1&&i>-1?ht.single(n+t,i+t):null}function WI(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}class wPt{setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}constructor(t){this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,hn.safari&&t.contentDOM.addEventListener("input",()=>null),hn.gecko&&LPt(t.contentDOM.ownerDocument)}handleEvent(t){!jPt(this.view,t)||this.ignoreDuringComposition(t)||t.type=="keydown"&&this.keydown(t)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(t.type,t)):this.runHandlers(t.type,t))}runHandlers(t,n){let i=this.handlers[t];if(i){for(let r of i.observers)r(this.view,n);for(let r of i.handlers){if(n.defaultPrevented)break;if(r(this.view,n)){n.preventDefault();break}}}}ensureHandlers(t){let n=kPt(t),i=this.handlers,r=this.view.contentDOM;for(let s in n)if(s!="scroll"){let o=!n[s].handlers.length,l=i[s];l&&o!=!l.handlers.length&&(r.removeEventListener(s,this.handleEvent),l=null),l||r.addEventListener(s,this.handleEvent,{passive:o})}for(let s in i)s!="scroll"&&!n[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=n}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&t.keyCode!=27&&Q3e.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),hn.android&&hn.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;if(hn.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&(U3e.some(n=>n.keyCode==t.keyCode)&&!t.ctrlKey||SPt.indexOf(t.key)>-1&&t.ctrlKey)){let n={ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey,shiftKey:t.shiftKey};return n.shiftKey&&hn.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&OPt(this.view.win)&&(n.shiftKey=!1),this.pendingIOSKey={key:t.key,keyCode:t.keyCode,mods:n},setTimeout(()=>this.flushIOSKey(),250),!0}return t.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(t){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&t&&t.from0?!0:hn.safari&&!hn.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.view.observer.update(t),this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function OPt(e){return e.visualViewport?e.visualViewport.height*e.visualViewport.scale/e.document.documentElement.clientHeight<.85:!1}function $ie(e,t){return(n,i)=>{try{return t.call(e,i,n)}catch(r){Dc(n.state,r)}}}function kPt(e){let t=Object.create(null);function n(i){return t[i]||(t[i]={observers:[],handlers:[]})}for(let i of e){let r=i.spec,s=r&&r.plugin.domEventHandlers,o=r&&r.plugin.domEventObservers;if(s)for(let l in s){let c=s[l];c&&n(l).handlers.push($ie(i.value,c))}if(o)for(let l in o){let c=o[l];c&&n(l).observers.push($ie(i.value,c))}}for(let i in Of)n(i).handlers.push(Of[i]);for(let i in oc)n(i).observers.push(oc[i]);return t}const U3e=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],SPt="dthko",Q3e=[16,17,18,20,91,92,224,225],V_=6;function H_(e){return Math.max(0,e)*.7+8}function EPt(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}class CPt{constructor(t,n,i,r){this.view=t,this.startEvent=n,this.style=i,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=d3e(t.contentDOM),this.atoms=t.state.facet(_T).map(o=>o(t));let s=t.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=t.state.facet(tr.allowMultipleSelections)&&APt(t,n),this.dragging=_Pt(t,n)&&H3e(n)==1?null:!1}start(t){this.dragging===!1&&this.select(t)}move(t){if(t.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&EPt(this.startEvent,t)<10)return;this.select(this.lastEvent=t);let n=0,i=0,r=0,s=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:l}=this.scrollParents.y.getBoundingClientRect());let c=Kq(this.view);t.clientX-c.left<=r+V_?n=-H_(r-t.clientX):t.clientX+c.right>=o-V_&&(n=H_(t.clientX-o)),t.clientY-c.top<=s+V_?i=-H_(s-t.clientY):t.clientY+c.bottom>=l-V_&&(i=H_(t.clientY-l)),this.setScrollSpeed(n,i)}up(t){this.dragging==null&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,n){this.scrollSpeed={x:t,y:n},t||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:t,y:n}=this.scrollSpeed;t&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=t,t=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(t||n)&&this.view.win.scrollBy(t,n),this.dragging===!1&&this.select(this.lastEvent)}select(t){let{view:n}=this,i=L3e(this.atoms,this.style.get(t,this.extend,this.multiple));(this.mustSelect||!i.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(t){t.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(t)&&setTimeout(()=>this.select(this.lastEvent),20)}}function APt(e,t){let n=e.state.facet(w3e);return n.length?n[0](t):hn.mac?t.metaKey:t.ctrlKey}function TPt(e,t){let n=e.state.facet(O3e);return n.length?n[0](t):hn.mac?!t.altKey:!t.ctrlKey}function _Pt(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let i=LC(e.root);if(!i||i.rangeCount==0)return!0;let r=i.getRangeAt(0).getClientRects();for(let s=0;s=t.clientX&&o.top<=t.clientY&&o.bottom>=t.clientY)return!0}return!1}function jPt(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,i;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(i=pa.get(n))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(t))return!1;return!0}const Of=Object.create(null),oc=Object.create(null),z3e=hn.ie&&hn.ie_version<15||hn.ios&&hn.webkit_version<604;function NPt(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{e.focus(),n.remove(),V3e(e,n.value)},50)}function JM(e,t,n){for(let i of e.facet(t))n=i(n,e);return n}function V3e(e,t){t=JM(e.state,Vq,t);let{state:n}=e,i,r=1,s=n.toText(t),o=s.lines==n.selection.ranges.length;if(q9!=null&&n.selection.ranges.every(c=>c.empty)&&q9==s.toString()){let c=-1;i=n.changeByRange(u=>{let d=n.doc.lineAt(u.from);if(d.from==c)return{range:u};c=d.from;let f=n.toText((o?s.line(r++).text:t)+n.lineBreak);return{changes:{from:d.from,insert:f},range:ht.cursor(u.from+f.length)}})}else o?i=n.changeByRange(c=>{let u=s.line(r++);return{changes:{from:c.from,to:c.to,insert:u.text},range:ht.cursor(c.from+u.length)}}):i=n.replaceSelection(s);e.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}oc.scroll=e=>{let t=e.inputState;t.lastScrollTop=e.scrollDOM.scrollTop,t.lastScrollLeft=e.scrollDOM.scrollLeft,hn.ios&&!t.touchActive&&(t.lastIOSMomentumScroll=Date.now())};oc.wheel=oc.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()};Of.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1);oc.touchstart=(e,t)=>{let n=e.inputState,i=t.targetTouches[0];n.touchActive=!0,n.lastTouchTime=Date.now(),i&&(n.lastTouchX=i.clientX,n.lastTouchY=i.clientY),n.setSelectionOrigin("select.pointer")};oc.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")};oc.touchend=(e,t)=>{e.inputState.touchActive=!1};Of.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let i of e.state.facet(k3e))if(n=i(e,t),n)break;if(!n&&t.button==0&&(n=IPt(e,t)),n){let i=!e.hasFocus;e.inputState.startMouseSelection(new CPt(e,t,n,i)),i&&e.observer.ignore(()=>{f3e(e.contentDOM);let s=e.root.activeElement;s&&!s.contains(e.contentDOM)&&s.blur()});let r=e.inputState.mouseSelection;if(r)return r.start(t),r.dragging===!1}else e.inputState.setSelectionOrigin("select.pointer");return!1};function Fie(e,t,n,i){if(i==1)return ht.cursor(t,n);if(i==2)return lPt(e.state,t,n);{let r=e.docView.lineAt(t,n),s=e.state.doc.lineAt(r?r.posAtEnd:t),o=r?r.posAtStart:s.from,l=r?r.posAtEnd:s.to;return lDate.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(Uie+1)%3:1}function IPt(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),i=H3e(t),r=e.state.selection;return{update(s){s.docChanged&&(n.pos=s.changes.mapPos(n.pos),r=r.map(s.changes))},get(s,o,l){let c=e.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),u,d=Fie(e,c.pos,c.assoc,i);if(n.pos!=c.pos&&!o){let f=Fie(e,n.pos,n.assoc,i),h=Math.min(f.from,d.from),m=Math.max(f.to,d.to);d=h1&&(u=PPt(r,c.pos))?u:l?r.addRange(d):ht.create([d])}}}function PPt(e,t){for(let n=0;n=t)return ht.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n?1:0))}return null}Of.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.tile.nearest(t.target);if(r&&r.isWidget()){let s=r.posAtStart,o=s+r.length;(s>=n.to||o<=n.from)&&(n=ht.undirectionalRange(s,o))}}let{inputState:i}=e;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",JM(e.state,Hq,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1};Of.dragend=e=>(e.inputState.draggedContent=null,!1);function zie(e,t,n,i){if(n=JM(e.state,Vq,n),!n)return;let r=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:s}=e.inputState,o=i&&s&&TPt(e,t)?{from:s.from,to:s.to}:null,l={from:r,insert:n},c=e.state.changes(o?[o,l]:l);e.focus(),e.dispatch({changes:c,selection:{anchor:c.mapPos(r,-1),head:c.mapPos(r,1)},userEvent:o?"move.drop":"input.drop"}),e.inputState.draggedContent=null}Of.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let i=Array(n.length),r=0,s=()=>{++r==n.length&&zie(e,t,i.filter(o=>o!=null).join(e.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),s()},l.readAsText(n[o])}return!0}else{let i=t.dataTransfer.getData("Text");if(i)return zie(e,t,i,!0),!0}return!1};Of.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=z3e?null:t.clipboardData;return n?(V3e(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(NPt(e),!1)};function DPt(e,t){let n=e.dom.parentNode;if(!n)return;let i=n.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=t,i.focus(),i.selectionEnd=t.length,i.selectionStart=0,setTimeout(()=>{i.remove(),e.focus()},50)}function MPt(e){let t=[],n=[],i=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let r=-1;for(let{from:s}of e.selection.ranges){let o=e.doc.lineAt(s);o.number>r&&(t.push(o.text),n.push({from:o.from,to:Math.min(e.doc.length,o.to+1)})),r=o.number}i=!0}return{text:JM(e,Hq,t.join(e.lineBreak)),ranges:n,linewise:i}}let q9=null;Of.copy=Of.cut=(e,t)=>{if(!xE(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:i,linewise:r}=MPt(e.state);if(!n&&!r)return!1;q9=r?n:null,t.type=="cut"&&!e.state.readOnly&&e.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let s=z3e?null:t.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):(DPt(e,n),!1)};const q3e=Rh.define();function W3e(e,t){let n=[];for(let i of e.facet(C3e)){let r=i(e,t);r&&n.push(r)}return n.length?e.update({effects:n,annotations:q3e.of(!0)}):null}function K3e(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=W3e(e.state,t);n?e.dispatch(n):e.update([])}},10)}oc.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),K3e(e)};oc.blur=e=>{e.observer.clearSelectionRange(),K3e(e)};oc.compositionstart=oc.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange==null&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))};oc.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,hn.chrome&&hn.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))};oc.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()};Of.beforeinput=(e,t)=>{var n,i;if((t.inputType=="insertText"||t.inputType=="insertCompositionText")&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),t.inputType=="insertReplacementText"&&e.observer.editContext){let s=(n=t.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),o=t.getTargetRanges();if(s&&o.length){let l=o[0],c=e.posAtDOM(l.startContainer,l.startOffset),u=e.posAtDOM(l.endContainer,l.endOffset);return Gq(e,{from:c,to:u,insert:e.state.toText(s)},null),!0}}let r;if(hn.chrome&&hn.android&&(r=U3e.find(s=>s.inputType==t.inputType))&&(e.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let s=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return hn.ios&&t.inputType=="deleteContentForward"&&e.observer.flushSoon(),hn.safari&&t.inputType=="insertText"&&e.inputState.composing>=0&&setTimeout(()=>oc.compositionend(e,t),20),!1};const Vie=new Set;function LPt(e){Vie.has(e)||(Vie.add(e),e.addEventListener("copy",()=>{}),e.addEventListener("cut",()=>{}))}const Hie=["pre-wrap","normal","pre-line","break-spaces"];let f1=!1;function qie(){f1=!1}class $Pt{constructor(t){this.lineWrapping=t,this.doc=xr.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(t,n){let i=this.doc.lineAt(n).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((n-t-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return Hie.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let n=!1;for(let i=0;i-1,c=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=n,this.charWidth=i,this.textHeight=r,this.lineLength=s,c){this.heightSamples={};for(let u=0;u0}set outdated(t){this.flags=(t?2:0)|this.flags&-3}setHeight(t){this.height!=t&&(Math.abs(this.height-t)>FN&&(f1=!0),this.height=t)}replace(t,n,i){return ac.of(i)}decomposeLeft(t,n){n.push(this)}decomposeRight(t,n){n.push(this)}applyChanges(t,n,i,r){let s=this,o=i.doc;for(let l=r.length-1;l>=0;l--){let{fromA:c,toA:u,fromB:d,toB:f}=r[l],h=s.lineAt(c,gs.ByPosNoHeight,i.setDoc(n),0,0),m=h.to>=u?h:s.lineAt(u,gs.ByPosNoHeight,i,0,0);for(f+=m.to-u,u=m.to;l>0&&h.from<=r[l-1].toA;)c=r[l-1].fromA,d=r[l-1].fromB,l--,cs*2){let l=t[n-1];l.break?t.splice(--n,1,l.left,null,l.right):t.splice(--n,1,l.left,l.right),i+=1+l.break,r-=l.size}else if(s>r*2){let l=t[i];l.break?t.splice(i,1,l.left,null,l.right):t.splice(i,1,l.left,l.right),i+=2+l.break,s-=l.size}else break;else if(r=s&&o(this.lineAt(0,gs.ByPos,i,r,s))}setMeasuredHeight(t){let n=t.heights[t.index++];n<0?(this.spaceAbove=-n,n=t.heights[t.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(t,n=0,i=!1,r){return r&&r.from<=n&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}}class du extends G3e{constructor(t,n,i){super(t,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=i}mainBlock(t,n){return new of(n,this.length,t+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(t,n,i){let r=i[0];return i.length==1&&(r instanceof du||r instanceof Zo&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof Zo?r=new du(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):ac.of(i)}updateHeight(t,n=0,i=!1,r){return r&&r.from<=n&&r.more?this.setMeasuredHeight(r):(i||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Zo extends ac{constructor(t){super(t,0)}heightMetrics(t,n){let i=t.doc.lineAt(n).number,r=t.doc.lineAt(n+this.length).number,s=r-i+1,o,l=0;if(t.lineWrapping){let c=Math.min(this.height,t.lineHeight*s);o=c/s,this.length>s+1&&(l=(this.height-c)/(this.length-s-1))}else o=this.height/s;return{firstLine:i,lastLine:r,perLine:o,perChar:l}}blockAt(t,n,i,r){let{firstLine:s,lastLine:o,perLine:l,perChar:c}=this.heightMetrics(n,r);if(n.lineWrapping){let u=r+(t0){let s=i[i.length-1];s instanceof Zo?i[i.length-1]=new Zo(s.length+r):i.push(null,new Zo(r-1))}if(t>0){let s=i[0];s instanceof Zo?i[0]=new Zo(t+s.length):i.unshift(new Zo(t-1),null)}return ac.of(i)}decomposeLeft(t,n){n.push(new Zo(t-1),null)}decomposeRight(t,n){n.push(null,new Zo(this.length-t-1))}updateHeight(t,n=0,i=!1,r){let s=n+this.length;if(r&&r.from<=n+this.length&&r.more){let o=[],l=Math.max(n,r.from),c=-1;for(r.from>n&&o.push(new Zo(r.from-n-1).updateHeight(t,n));l<=s&&r.more;){let d=t.doc.lineAt(l).length;o.length&&o.push(null);let f=r.heights[r.index++],h=0;f<0&&(h=-f,f=r.heights[r.index++]),c==-1?c=f:Math.abs(f-c)>=FN&&(c=-2);let m=new du(d,f,h);m.outdated=!1,o.push(m),l+=d+1}l<=s&&o.push(null,new Zo(s-l).updateHeight(t,l));let u=ac.of(o);return(c<0||Math.abs(u.height-this.height)>=FN||Math.abs(c-this.heightMetrics(t,n).perLine)>=FN)&&(f1=!0),KI(this,u)}else(i||this.outdated)&&(this.setHeight(t.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class UPt extends ac{constructor(t,n,i){super(t.length+n+i.length,t.height+i.height,n|(t.outdated||i.outdated?2:0)),this.left=t,this.right=i,this.size=t.size+i.size}get break(){return this.flags&1}blockAt(t,n,i,r){let s=i+this.left.height;return tl))return u;let d=n==gs.ByPosNoHeight?gs.ByPosNoHeight:gs.ByPos;return c?u.join(this.right.lineAt(l,d,i,o,l)):this.left.lineAt(l,d,i,r,s).join(u)}forEachLine(t,n,i,r,s,o){let l=r+this.left.height,c=s+this.left.length+this.break;if(this.break)t=c&&this.right.forEachLine(t,n,i,l,c,o);else{let u=this.lineAt(c,gs.ByPos,i,r,s);t=t&&u.from<=n&&o(u),n>u.to&&this.right.forEachLine(u.to+1,n,i,l,c,o)}}replace(t,n,i){let r=this.left.length+this.break;if(nthis.left.length)return this.balanced(this.left,this.right.replace(t-r,n-r,i));let s=[];t>0&&this.decomposeLeft(t,s);let o=s.length;for(let l of i)s.push(l);if(t>0&&Wie(s,o-1),n=i&&n.push(null)),t>i&&this.right.decomposeLeft(t-i,n)}decomposeRight(t,n){let i=this.left.length,r=i+this.break;if(t>=r)return this.right.decomposeRight(t-r,n);t2*n.size||n.size>2*t.size?ac.of(this.break?[t,null,n]:[t,n]):(this.left=KI(this.left,t),this.right=KI(this.right,n),this.setHeight(t.height+n.height),this.outdated=t.outdated||n.outdated,this.size=t.size+n.size,this.length=t.length+this.break+n.length,this)}updateHeight(t,n=0,i=!1,r){let{left:s,right:o}=this,l=n+s.length+this.break,c=null;return r&&r.from<=n+s.length&&r.more?c=s=s.updateHeight(t,n,i,r):s.updateHeight(t,n,i),r&&r.from<=l+o.length&&r.more?c=o=o.updateHeight(t,l,i,r):o.updateHeight(t,l,i),c?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Wie(e,t){let n,i;e[t]==null&&(n=e[t-1])instanceof Zo&&(i=e[t+1])instanceof Zo&&e.splice(t-1,3,new Zo(n.length+1+i.length))}const QPt=5;class Xq{constructor(t,n){this.pos=t,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,n){if(this.lineStart>-1){let i=Math.min(n,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof du?r.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new du(i-this.pos,-1,0)),this.writtenTo=i,n>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(t,n,i){if(t=QPt)&&this.addLineDeco(r,s,o)}else n>t&&this.span(t,n);this.lineEnd>-1&&this.lineEnd-1)return;let{from:t,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=n,this.writtenTot&&this.nodes.push(new du(this.pos-t,-1,0)),this.writtenTo=this.pos}blankContent(t,n){let i=new Zo(n-t);return this.oracle.doc.lineAt(t).to==n&&(i.flags|=4),i}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof du)return t;let n=new du(0,-1,0);return this.nodes.push(n),n}addBlock(t){this.enterLine();let n=t.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,n&&n.endSide>0&&(this.covering=t)}addLineDeco(t,n,i){let r=this.ensureLine();r.length+=i,r.collapsed+=i,r.widgetHeight=Math.max(r.widgetHeight,t),r.breaks+=n,this.writtenTo=this.pos=this.pos+i}finish(t){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof du)&&!this.isCovered?this.nodes.push(new du(0,-1,0)):(this.writtenTod.clientHeight||d.scrollWidth>d.clientWidth)&&f.overflow!="visible"){let h=d.getBoundingClientRect();s=Math.max(s,h.left),o=Math.min(o,h.right),l=Math.max(l,h.top),c=Math.min(u==e.parentNode?r.innerHeight:c,h.bottom)}u=f.position=="absolute"||f.position=="fixed"?d.offsetParent:d.parentNode}else if(u.nodeType==11)u=u.host;else break;return{left:s-n.left,right:Math.max(s,o)-n.left,top:l-(n.top+t),bottom:Math.max(l,c)-(n.top+t)}}function qPt(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left0&&t.top0}function WPt(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class n${constructor(t,n,i,r){this.from=t,this.to=n,this.size=i,this.displaySize=r}static same(t,n){if(t.length!=n.length)return!1;for(let i=0;itypeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new $Pt(i),this.stateDeco=Xie(n),this.heightMap=ac.empty().applyChanges(this.stateDeco,xr.empty,this.heightOracle.setDoc(n.doc),[new pd(0,0,0,n.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Fn.set(this.lineGaps.map(r=>r.draw(this,!1))),this.scrollParent=t.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:n}=this.state.selection;for(let i=0;i<=1;i++){let r=i?n.head:n.anchor;if(!t.some(({from:s,to:o})=>r>=s&&r<=o)){let{from:s,to:o}=this.lineBlockAt(r);t.push(new q_(s,o))}}return this.viewports=t.sort((i,r)=>i.from-r.from),this.updateScaler()}updateScaler(){let t=this.scaler;return this.scaler=this.heightMap.height<=7e6?Gie:new Yq(this.heightOracle,this.heightMap,this.viewports),t.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,t=>{this.viewportLines.push(yS(t,this.scaler))})}update(t,n=null){this.state=t.state;let i=this.stateDeco;this.stateDeco=Xie(this.state);let r=t.changedRanges,s=pd.extendWithRanges(r,zPt(i,this.stateDeco,t?t.changes:lo.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);qie(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||f1)&&(t.flags|=2),l?(this.scrollAnchorPos=t.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let c=s.length?this.mapViewport(this.viewport,t.changes):this.viewport;(n&&(n.range.headc.to)||!this.viewportIsAppropriate(c))&&(c=this.getViewport(0,n));let u=c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,t.flags|=this.updateForViewport(),(u||!t.changes.empty||t.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(t.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(t.selectionSet||t.focusChanged)&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(T3e)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:t}=this,n=t.contentDOM,i=window.getComputedStyle(n),r=this.heightOracle,s=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?os.RTL:os.LTR;let o=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",l=n.getBoundingClientRect(),c=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let u=0,d=0;if(l.width&&l.height){let{scaleX:k,scaleY:S}=u3e(n,l);(k>.005&&Math.abs(this.scaleX-k)>.005||S>.005&&Math.abs(this.scaleY-S)>.005)&&(this.scaleX=k,this.scaleY=S,u|=16,o=c=!0)}let f=(parseInt(i.paddingTop)||0)*this.scaleY,h=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=h)&&(this.paddingTop=f,this.paddingBottom=h,u|=18),this.editorWidth!=t.scrollDOM.clientWidth&&(r.lineWrapping&&(c=!0),this.editorWidth=t.scrollDOM.clientWidth,u|=16);let m=d3e(this.view.contentDOM,!1).y;m!=this.scrollParent&&(this.scrollParent=m,this.scrollAnchorHeight=-1,this.scrollOffset=0);let g=this.getScrollOffset();this.scrollOffset!=g&&(this.scrollAnchorHeight=-1,this.scrollOffset=g),this.scrolledToBottom=h3e(this.scrollParent||t.win);let b=(this.printing?WPt:HPt)(n,this.paddingTop),v=b.top-this.pixelViewport.top,y=b.bottom-this.pixelViewport.bottom;this.pixelViewport=b;let w=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(w!=this.inView&&(this.inView=w,w&&(c=!0)),!this.inView&&!this.scrollTarget&&!qPt(t.dom))return 0;let x=l.width;if((this.contentDOMWidth!=x||this.editorHeight!=t.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=t.scrollDOM.clientHeight,u|=16),c){let k=t.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(k)&&(o=!0),o||r.lineWrapping&&Math.abs(x-this.contentDOMWidth)>r.charWidth){let{lineHeight:S,charWidth:C,textHeight:E}=t.docView.measureTextSize();o=S>0&&r.refresh(s,S,C,E,Math.max(5,x/C),k),o&&(t.docView.minWidth=0,u|=16)}v>0&&y>0?d=Math.max(v,y):v<0&&y<0&&(d=Math.min(v,y)),qie();for(let S of this.viewports){let C=S.from==this.viewport.from?k:t.docView.measureVisibleLineHeights(S);this.heightMap=(o?ac.empty().applyChanges(this.stateDeco,xr.empty,this.heightOracle,[new pd(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(r,0,o,new FPt(S.from,C))}f1&&(u|=2)}let O=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return O&&(u&2&&(u|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),u|=this.updateForViewport()),(u&2||O)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,t)),u|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),u}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,n){let i=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,c=new q_(r.lineAt(o-i*1e3,gs.ByHeight,s,0,0).from,r.lineAt(l+(1-i)*1e3,gs.ByHeight,s,0,0).to);if(n){let{head:u}=n.range;if(uc.to){let d=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=r.lineAt(u,gs.ByPos,s,0,0),h;n.y=="center"?h=(f.top+f.bottom)/2-d/2:n.y=="start"||n.y=="nearest"&&u=l+Math.max(10,Math.min(i,250)))&&r>o-2*1e3&&s>1,o=r<<1;if(this.defaultTextDirection!=os.LTR&&!i)return[];let l=[],c=(d,f,h,m)=>{if(f-dd&&yy.from>=h.from&&y.to<=h.to&&Math.abs(y.from-d)y.fromw));if(!v){if(fx.from<=f&&x.to>=f)){let x=n.moveToLineBoundary(ht.cursor(f),!1,!0).head;x>d&&(f=x)}let y=this.gapSize(h,d,f,m),w=i||y<2e6?y:2e6;v=new n$(d,f,y,w)}l.push(v)},u=d=>{if(d.length2e6)for(let S of t)S.from>=d.from&&S.fromd.from&&c(d.from,m,d,f),gn.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(t){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let i=[];Ki.spans(n,this.viewport.from,this.viewport.to,{span(s,o){i.push({from:s,to:o})},point(){}},20);let r=0;if(i.length!=this.visibleRanges.length)r=12;else for(let s=0;s=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(n=>n.from<=t&&n.to>=t)||yS(this.heightMap.lineAt(t,gs.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=t&&n.bottom>=t)||yS(this.heightMap.lineAt(this.scaler.fromDOM(t),gs.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(t){let n=this.lineBlockAtHeight(t+8);return n.from>=this.viewport.from||this.viewportLines[0].top-t>200?n:this.viewportLines[0]}elementAtHeight(t){return yS(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}let q_=class{constructor(t,n){this.from=t,this.to=n}};function GPt(e,t,n){let i=[],r=e,s=0;return Ki.spans(n,e,t,{span(){},point(o,l){o>r&&(i.push({from:r,to:o}),s+=o-r),r=l}},20),r=1)return t[t.length-1].to;let i=Math.floor(e*n);for(let r=0;;r++){let{from:s,to:o}=t[r],l=o-s;if(i<=l)return s+i;i-=l}}function K_(e,t){let n=0;for(let{from:i,to:r}of e.ranges){if(t<=r){n+=t-i;break}n+=r-i}return n/e.total}function XPt(e,t){for(let n of e)if(t(n))return n}const Gie={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};function Xie(e){let t=e.facet(XM).filter(i=>typeof i!="function"),n=e.facet(Wq).filter(i=>typeof i!="function");return n.length&&t.push(Ki.join(n)),t}class Yq{constructor(t,n,i){let r=0,s=0,o=0;this.viewports=i.map(({from:l,to:c})=>{let u=n.lineAt(l,gs.ByPos,t,0,0).top,d=n.lineAt(c,gs.ByPos,t,0,0).bottom;return r+=d-u,{from:l,to:c,top:u,bottom:d,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(n.height-r);for(let l of this.viewports)l.domTop=o+(l.top-s)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),s=l.bottom}toDOM(t){for(let n=0,i=0,r=0;;n++){let s=nn.from==t.viewports[i].from&&n.to==t.viewports[i].to):!1}}function yS(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),i=t.toDOM(e.bottom);return new of(e.from,e.length,n,i-n,Array.isArray(e._content)?e._content.map(r=>yS(r,t)):e._content)}const G_=mn.define({combine:e=>e.join(" ")}),W9=mn.define({combine:e=>e.indexOf(!0)>-1}),K9=hb.newName(),X3e=hb.newName(),Y3e=hb.newName(),Z3e={"&light":"."+X3e,"&dark":"."+Y3e};function G9(e,t,n){return new hb(t,{finish(i){return/&/.test(i)?i.replace(/&\w*/,r=>{if(r=="&")return e;if(!n||!n[r])throw new RangeError(`Unsupported selector: ${r}`);return n[r]}):e+" "+i}})}const YPt=G9("."+K9,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Z3e),ZPt={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},i$=hn.ie&&hn.ie_version<=11;class JPt{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new TIt,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver(n=>{for(let i of n)this.queue.push(i);(hn.ie&&hn.ie_version<=11||hn.ios&&t.composing)&&n.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&hn.android&&t.constructor.EDIT_CONTEXT!==!1&&!(hn.chrome&&hn.chrome_version<126)&&(this.editContext=new tDt(t),t.state.facet(xp)&&(t.contentDOM.editContext=this.editContext.editContext)),i$&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(t){(t.type=="change"||!t.type)&&!t.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some((n,i)=>n!=t[i]))){this.gapIntersection.disconnect();for(let n of t)this.gapIntersection.observe(n);this.gaps=t}}onSelectionChange(t){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,r=this.selectionRange;if(i.state.facet(xp)?i.root.activeElement!=this.dom:!xE(this.dom,r))return;let s=r.anchorNode&&i.docView.tile.nearest(r.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(t)){n||(this.selectionChanged=!1);return}(hn.ie&&hn.ie_version<=11||hn.android&&hn.chrome)&&!i.state.selection.main.empty&&r.focusNode&&OE(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,n=LC(t.root);if(!n)return!1;let i=hn.safari&&t.root.nodeType==11&&t.root.activeElement==this.dom&&eDt(this.view,n)||n;if(!i||this.selectionRange.eq(i))return!1;let r=xE(this.dom,i);return r&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&yw(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||t=="Enter")&&(this.delayedAndroidKey={key:t,keyCode:n,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let n=-1,i=-1,r=!1;for(let s of t){let o=this.readMutation(s);o&&(o.typeOver&&(r=!0),n==-1?{from:n,to:i}=o:(n=Math.min(o.from,n),i=Math.max(o.to,i)))}return{from:n,to:i,typeOver:r}}readChange(){let{from:t,to:n,typeOver:i}=this.processRecords(),r=this.selectionChanged&&xE(this.dom,this.selectionRange);if(t<0&&!r)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new bPt(this.view,t,n,i);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let i=this.view.state,r=F3e(this.view,n);return this.view.state==i&&(n.domChanged||n.newSel&&!WI(this.view.state.selection,n.newSel.main))&&this.view.update([]),r}readMutation(t){let n=this.view.docView.tile.nearest(t.target);if(!n||n.isWidget())return null;if(n.markDirty(t.type=="attributes"),t.type=="childList"){let i=Yie(n,t.previousSibling||t.target.previousSibling,-1),r=Yie(n,t.nextSibling||t.target.nextSibling,1);return{from:i?n.posAfter(i):n.posAtStart,to:r?n.posBefore(r):n.posAtEnd,typeOver:!1}}else return t.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}update(t){this.editContext&&(this.editContext.update(t),t.startState.facet(xp)!=t.state.facet(xp)&&(t.view.contentDOM.editContext=t.state.facet(xp)?this.editContext.editContext:null))}destroy(){var t,n,i;this.stop(),(t=this.intersection)===null||t===void 0||t.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function Yie(e,t,n){for(;t;){let i=pa.get(t);if(i&&i.parent==e)return i;let r=t.parentNode;t=r!=e.dom?r:n>0?t.nextSibling:t.previousSibling}return null}function Zie(e,t){let n=t.startContainer,i=t.startOffset,r=t.endContainer,s=t.endOffset,o=e.docView.domAtPos(e.state.selection.main.anchor,1);return OE(o.node,o.offset,r,s)&&([n,i,r,s]=[r,s,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}}function eDt(e,t){if(t.getComposedRanges){let r=t.getComposedRanges(e.root)[0];if(r)return Zie(e,r)}let n=null;function i(r){r.preventDefault(),r.stopImmediatePropagation(),n=r.getTargetRanges()[0]}return e.contentDOM.addEventListener("beforeinput",i,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",i,!0),n?Zie(e,n):null}class tDt{constructor(t){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(t.state);let n=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});this.handlers.textupdate=i=>{let r=t.state.selection.main,{anchor:s,head:o}=r,l=this.toEditorPos(i.updateRangeStart),c=this.toEditorPos(i.updateRangeEnd);t.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:l,drifted:!1});let u=c-l>i.text.length;l==this.from&&sthis.to&&(c=s);let d=B3e(t.state.sliceDoc(l,c),i.text,(u?r.from:r.to)-l,u?"end":null);if(!d){let h=ht.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));WI(h,r)||t.dispatch({selection:h,userEvent:"select"});return}let f={from:d.from+l,to:d.toA+l,insert:xr.of(i.text.slice(d.from,d.toB).split(` -`))};if((hn.mac||hn.android)&&f.from==o-1&&/^\. ?$/.test(i.text)&&t.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:l,to:c,insert:xr.of([i.text.replace("."," ")])}),this.pendingContextChange=f,!t.state.readOnly){let h=this.to-this.from+(f.to-f.from+f.insert.length);Gq(t,f,ht.single(this.toEditorPos(i.selectionStart,h),this.toEditorPos(i.selectionEnd,h)))}this.pendingContextChange&&(this.revertPending(t.state),this.setSelection(t.state)),f.from=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(n.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let r=[],s=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o{let r=[];for(let s of i.getTextFormats()){let o=s.underlineStyle,l=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(l)){let c=this.toEditorPos(s.rangeStart),u=this.toEditorPos(s.rangeEnd);if(c{t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(t.inputState.composing=-1,t.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(t.state)}};for(let i in this.handlers)n.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{let r=LC(i.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let n=0,i=!1,r=this.pendingContextChange;return t.changes.iterChanges((s,o,l,c,u)=>{if(i)return;let d=u.length-(o-s);if(r&&o>=r.to)if(r.from==s&&r.to==o&&r.insert.eq(u)){r=this.pendingContextChange=null,n+=d,this.to+=d;return}else r=null,this.revertPending(t.state);if(s+=n,o+=n,o<=this.from)this.from+=d,this.to+=d;else if(sthis.to||this.to-this.from+u.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),u.toString()),this.to+=d}n+=d}),r&&!i&&this.revertPending(t.state),!i}update(t){let n=this.pendingContextChange,i=t.startState.selection.main;this.composing&&(this.composing.drifted||!t.changes.touchesRange(i.from,i.to)&&t.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=t.changes.mapPos(this.composing.editorBase)):!this.applyEdits(t)||!this.rangeIsValid(t.state)?(this.pendingContextChange=null,this.reset(t.state)):(t.docChanged||t.selectionSet||n)&&this.setSelection(t.state),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:n}=t.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(t.doc.length,n+1e4)}reset(t){this.resetRange(t),this.editContext.updateText(0,this.editContext.text.length,t.doc.sliceString(this.from,this.to)),this.setSelection(t)}revertPending(t){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),t.doc.sliceString(n.from,n.to))}setSelection(t){let{main:n}=t.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),r=this.toContextPos(n.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(i,r)}rangeIsValid(t){let{head:n}=t.selection.main;return!(this.from>0&&n-this.from<500||this.to1e4*3)}toEditorPos(t,n=this.to-this.from){t=Math.min(t,n);let i=this.composing;return i&&i.drifted?i.editorBase+(t-i.contextBase):t+this.from}toContextPos(t){let n=this.composing;return n&&n.drifted?n.contextBase+(t-n.editorBase):t-this.from}destroy(){for(let t in this.handlers)this.editContext.removeEventListener(t,this.handlers[t])}}class Jt{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),t.parent&&t.parent.appendChild(this.dom);let{dispatch:i}=t;this.dispatchTransactions=t.dispatchTransactions||i&&(r=>r.forEach(s=>i(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=t.root||_It(t.parent)||document,this.viewState=new Kie(this,t.state||tr.create(t)),t.scrollTo&&t.scrollTo.is(z_)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Fx).map(r=>new Y4(r));for(let r of this.plugins)r.update(this);this.observer=new JPt(this),this.inputState=new wPt(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Die(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...t){let n=t.length==1&&t[0]instanceof Xa?t:t.length==1&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(n,this)}update(t){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,i=!1,r,s=this.state;for(let h of t){if(h.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=h.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,l=0,c=null;t.some(h=>h.annotation(q3e))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,c=W3e(s,o),c||(l=1));let u=this.observer.delayedAndroidKey,d=null;if(u?(this.observer.clearDelayedAndroidKey(),d=this.observer.readChange(),(d&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(d=null)):this.observer.clear(),s.facet(tr.phrases)!=this.state.facet(tr.phrases))return this.setState(s);r=VI.create(this,s,t),r.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let h of t){if(f&&(f=f.map(h.changes)),h.scrollIntoView){let{main:m}=h.state.selection,{x:g,y:b}=this.state.facet(Jt.cursorScrollMargin);f=new vw(m.empty?m:ht.cursor(m.head,m.head>m.anchor?-1:1),"nearest","nearest",b,g)}for(let m of h.effects)m.is(z_)&&(f=m.value.clip(this.state))}this.viewState.update(r,f),this.bidiCache=GI.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),n=this.docView.update(r),this.state.facet(bS)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(n,t.some(h=>h.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(G_)!=r.state.facet(G_)&&(this.viewState.mustMeasureContent=!0),(n||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!r.empty)for(let h of this.state.facet(Q9))try{h(r)}catch(m){Dc(this.state,m,"update listener")}(c||d)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),d&&!F3e(this,d)&&u.force&&yw(this.contentDOM,u.key,u.keyCode)})}setState(t){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=t;return}this.updateState=2;let n=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new Kie(this,t),this.plugins=t.facet(Fx).map(i=>new Y4(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new Die(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(t){let n=t.startState.facet(Fx),i=t.state.facet(Fx);if(n!=i){let r=[];for(let s of i){let o=n.indexOf(s);if(o<0)r.push(new Y4(s));else{let l=this.plugins[o];l.mustUpdate=t,r.push(l)}}for(let s of this.plugins)s.mustUpdate!=t&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=t;for(let r=0;r-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,t&&this.observer.forceFlush();let n=null,i=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(h3e(i||this.win))s=-1,o=this.viewState.heightMap.height;else{let m=this.viewState.scrollAnchorAt(r);s=m.from,o=m.top}this.updateState=1;let c=this.viewState.measure();if(!c&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let u=[];c&4||([this.measureRequests,u]=[u,this.measureRequests]);let d=u.map(m=>{try{return m.read(this)}catch(g){return Dc(this.state,g),Jie}}),f=VI.create(this,this.state,[]),h=!1;f.flags|=c,n?n.flags|=c:n=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),h=this.docView.update(f),h&&this.docViewUpdate());for(let m=0;m1||g<-1)&&!(hn.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(i==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r=r+g,i?i.scrollTop+=g:this.win.scrollBy(0,g),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let l of this.state.facet(Q9))l(n)}get themeClasses(){return K9+" "+(this.state.facet(W9)?Y3e:X3e)+" "+this.state.facet(G_)}updateAttrs(){let t=ere(this,N3e,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(xp)?"true":"false",class:"cm-content",style:`${hn.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),ere(this,qq,n);let i=this.observer.ignore(()=>{let r=_ie(this.contentDOM,this.contentAttrs,n),s=_ie(this.dom,this.editorAttrs,t);return r||s});return this.editorAttrs=t,this.contentAttrs=n,i}showAnnouncements(t){let n=!0;for(let i of t)for(let r of i.effects)if(r.is(Jt.announce)){n&&(this.announceDOM.textContent=""),n=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(bS);let t=this.state.facet(Jt.cspNonce);hb.mount(this.root,this.styleModules.concat(YPt).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),t){if(this.measureRequests.indexOf(t)>-1)return;if(t.key!=null){for(let n=0;ni.plugin==t)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,n,i){return t$(this,t,Mie(this,t,n,i))}moveByGroup(t,n){return t$(this,t,Mie(this,t,n,i=>dPt(this,t.head,i)))}visualLineSide(t,n){let i=this.bidiSpans(t),r=this.textDirectionAt(t.from),s=i[n?i.length-1:0];return ht.cursor(s.side(n,r)+t.from,s.forward(!n,r)?1:-1)}moveToLineBoundary(t,n,i=!0){return uPt(this,t,n,i)}moveVertically(t,n,i){return t$(this,t,fPt(this,t,n,i))}domAtPos(t,n=1){return this.docView.domAtPos(t,n)}posAtDOM(t,n=0){return this.docView.posFromDOM(t,n)}posAtCoords(t,n=!0){this.readMeasured();let i=H9(this,t,n);return i&&i.pos}posAndSideAtCoords(t,n=!0){return this.readMeasured(),H9(this,t,n)}coordsAtPos(t,n=1){this.readMeasured();let i=this.state.doc.lineAt(t),r=this.bidiSpans(i),s=r[lh.find(r,t-i.from,-1,n)];return this.docView.coordsAt(t,n,s.dir==os.RTL)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(A3e)||tthis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>nDt)return v3e(t.length);let n=this.textDirectionAt(t.from),i;for(let s of this.bidiCache)if(s.from==t.from&&s.dir==n&&(s.fresh||y3e(s.isolates,i=Rie(this,t))))return s.order;i||(i=Rie(this,t));let r=LIt(t.text,n,i);return this.bidiCache.push(new GI(t.from,t.to,n,i,!0,r)),r}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||hn.safari&&((t=this.inputState)===null||t===void 0?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{f3e(this.contentDOM),this.docView.updateSelection()})}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((t.nodeType==9?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,n={}){var i,r,s,o;return z_.of(new vw(typeof t=="number"?ht.cursor(t):t,(i=n.y)!==null&&i!==void 0?i:"nearest",(r=n.x)!==null&&r!==void 0?r:"nearest",(s=n.yMargin)!==null&&s!==void 0?s:5,(o=n.xMargin)!==null&&o!==void 0?o:5))}scrollSnapshot(){let{scrollTop:t,scrollLeft:n}=this.scrollDOM,i=this.viewState.scrollAnchorAt(t);return z_.of(new vw(ht.cursor(i.from),"start","start",i.top-t,n,!0))}setTabFocusMode(t){t==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof t=="boolean"?this.inputState.tabFocusMode=t?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+t)}static domEventHandlers(t){return ma.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return ma.define(()=>({}),{eventObservers:t})}static theme(t,n){let i=hb.newName(),r=[G_.of(i),bS.of(G9(`.${i}`,t))];return n&&n.dark&&r.push(W9.of(!0)),r}static baseTheme(t){return gm.lowest(bS.of(G9("."+K9,t,Z3e)))}static findFromDOM(t){var n;let i=t.querySelector(".cm-content"),r=i&&pa.get(i)||pa.get(t);return((n=r==null?void 0:r.root)===null||n===void 0?void 0:n.view)||null}}Jt.styleModule=bS;Jt.inputHandler=E3e;Jt.clipboardInputFilter=Vq;Jt.clipboardOutputFilter=Hq;Jt.scrollHandler=_3e;Jt.focusChangeEffect=C3e;Jt.perLineTextDirection=A3e;Jt.exceptionSink=S3e;Jt.updateListener=Q9;Jt.editable=xp;Jt.mouseSelectionStyle=k3e;Jt.dragMovesSelection=O3e;Jt.clickAddsSelectionRange=w3e;Jt.decorations=XM;Jt.blockWrappers=R3e;Jt.outerDecorations=Wq;Jt.atomicRanges=_T;Jt.bidiIsolatedRanges=I3e;Jt.cursorScrollMargin=mn.define({combine:e=>{let t=5,n=5;for(let i of e)typeof i=="number"?t=n=i:{x:t,y:n}=i;return{x:t,y:n}}});Jt.scrollMargins=P3e;Jt.darkTheme=W9;Jt.cspNonce=mn.define({combine:e=>e.length?e[0]:""});Jt.contentAttributes=qq;Jt.editorAttributes=N3e;Jt.lineWrapping=Jt.contentAttributes.of({class:"cm-lineWrapping"});Jt.announce=pi.define();const nDt=4096,Jie={};class GI{constructor(t,n,i,r,s,o){this.from=t,this.to=n,this.dir=i,this.isolates=r,this.fresh=s,this.order=o}static update(t,n){if(n.empty&&!t.some(s=>s.fresh))return t;let i=[],r=t.length?t[t.length-1].dir:os.LTR;for(let s=Math.max(0,t.length-10);s=0;r--){let s=i[r],o=typeof s=="function"?s(e):s;o&&Uq(o,n)}return n}const iDt=hn.mac?"mac":hn.windows?"win":hn.linux?"linux":"key";function rDt(e,t){const n=e.split(/-(?!$)/);let i=n[n.length-1];i=="Space"&&(i=" ");let r,s,o,l;for(let c=0;ci.concat(r),[]))),n}function aDt(e,t,n){return e4e(J3e(e.state),t,e,n)}let og=null;const oDt=4e3;function lDt(e,t=iDt){let n=Object.create(null),i=Object.create(null),r=(o,l)=>{let c=i[o];if(c==null)i[o]=l;else if(c!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,l,c,u,d)=>{var f,h;let m=n[o]||(n[o]=Object.create(null)),g=l.split(/ (?!$)/).map(y=>rDt(y,t));for(let y=1;y{let O=og={view:x,prefix:w,scope:o};return setTimeout(()=>{og==O&&(og=null)},oDt),!0}]})}let b=g.join(" ");r(b,!1);let v=m[b]||(m[b]={preventDefault:!1,stopPropagation:!1,run:((h=(f=m._any)===null||f===void 0?void 0:f.run)===null||h===void 0?void 0:h.slice())||[]});c&&v.run.push(c),u&&(v.preventDefault=!0),d&&(v.stopPropagation=!0)};for(let o of e){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let u of l){let d=n[u]||(n[u]=Object.create(null));d._any||(d._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=o;for(let h in d)d[h].run.push(m=>f(m,X9))}let c=o[t]||o.key;if(c)for(let u of l)s(u,c,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(u,"Shift-"+c,o.shift,o.preventDefault,o.stopPropagation)}return n}let X9=null;function e4e(e,t,n,i){X9=t;let r=OIt(t),s=jc(r,0),o=eh(s)==r.length&&r!=" ",l="",c=!1,u=!1,d=!1;og&&og.view==n&&og.scope==i&&(l=og.prefix+" ",Q3e.indexOf(t.keyCode)<0&&(u=!0,og=null));let f=new Set,h=v=>{if(v){for(let y of v.run)if(!f.has(y)&&(f.add(y),y(n)))return v.stopPropagation&&(d=!0),!0;v.preventDefault&&(v.stopPropagation&&(d=!0),u=!0)}return!1},m=e[i],g,b;return m&&(h(m[l+X_(r,t,!o)])?c=!0:o&&(t.altKey||t.metaKey||t.ctrlKey)&&!(hn.windows&&t.ctrlKey&&t.altKey)&&!(hn.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(g=pb[t.keyCode])&&g!=r?(h(m[l+X_(g,t,!0)])||t.shiftKey&&(b=DC[t.keyCode])!=r&&b!=g&&h(m[l+X_(b,t,!1)]))&&(c=!0):o&&t.shiftKey&&h(m[l+X_(r,t,!0)])&&(c=!0),!c&&h(m._any)&&(c=!0)),u&&(c=!0),c&&d&&t.stopPropagation(),X9=null,c}class Zy{constructor(t,n,i,r,s){this.className=t,this.left=n,this.top=i,this.width=r,this.height=s}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}update(t,n){return n.className!=this.className?!1:(this.adjust(t),!0)}adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",this.width!=null&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}static forRange(t,n,i){if(i.empty){let r=t.coordsAtPos(i.head,i.assoc||1);if(!r)return[];let s=t4e(t);return[new Zy(n,r.left-s.left,r.top-s.top,null,r.bottom-r.top)]}else return cDt(t,n,i)}}function t4e(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==os.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function nre(e,t,n,i){let r=e.coordsAtPos(t,n*2);if(!r)return i;let s=e.dom.getBoundingClientRect(),o=(r.top+r.bottom)/2,l=e.posAtCoords({x:s.left+1,y:o}),c=e.posAtCoords({x:s.right-1,y:o});return l==null||c==null?i:{from:Math.max(i.from,Math.min(l,c)),to:Math.min(i.to,Math.max(l,c))}}function cDt(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let i=Math.max(n.from,e.viewport.from),r=Math.min(n.to,e.viewport.to),s=e.textDirection==os.LTR,o=e.contentDOM,l=o.getBoundingClientRect(),c=t4e(e),u=o.querySelector(".cm-line"),d=u&&window.getComputedStyle(u),f=l.left+(d?parseInt(d.paddingLeft)+Math.min(0,parseInt(d.textIndent)):0),h=l.right-(d?parseInt(d.paddingRight):0),m=V9(e,i,1),g=V9(e,r,-1),b=m.type==ol.Text?m:null,v=g.type==ol.Text?g:null;if(b&&(e.lineWrapping||m.widgetLineBreaks)&&(b=nre(e,i,1,b)),v&&(e.lineWrapping||g.widgetLineBreaks)&&(v=nre(e,r,-1,v)),b&&v&&b.from==v.from&&b.to==v.to)return w(x(n.from,n.to,b));{let k=b?x(n.from,null,b):O(m,!1),S=v?x(null,n.to,v):O(g,!0),C=[];return(b||m).to<(v||g).from-(b&&v?1:0)||m.widgetLineBreaks>1&&k.bottom+e.defaultLineHeight/2A&&P.from=D)break;M>I&&R(Math.max(F,I),k==null&&F<=A,Math.min(M,D),S==null&&M>=N,L.dir)}if(I=_.to+1,I>=D)break}return T.length==0&&R(A,k==null,N,S==null,e.textDirection),{top:E,bottom:j,horizontal:T}}function O(k,S){let C=l.top+(S?k.top:k.bottom);return{top:C,bottom:C,horizontal:[]}}}function uDt(e,t){return e.constructor==t.constructor&&e.eq(t)}class dDt{constructor(t,n){this.view=t,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,t)}update(t){t.startState.facet(BN)!=t.state.facet(BN)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq))}docViewUpdate(t){this.layer.updateOnDocViewUpdate!==!1&&t.requestMeasure(this.measureReq)}setOrder(t){let n=0,i=t.facet(BN);for(;n!uDt(n,this.drawn[i]))){let n=this.dom.firstChild,i=0;for(let r of t)r.update&&n&&r.constructor&&this.drawn[i].constructor&&r.update(n,this.drawn[i])?(n=n.nextSibling,i++):this.dom.insertBefore(r.draw(),n);for(;n;){let r=n.nextSibling;n.remove(),n=r}this.drawn=t,hn.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const BN=mn.define();function n4e(e){return[ma.define(t=>new dDt(t,e)),BN.of(e)]}const h1=mn.define({combine(e){return Ih(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(t,n)=>Math.min(t,n),drawRangeCursor:(t,n)=>t||n})}});function fDt(e={}){return[h1.of(e),hDt,pDt,mDt,T3e.of(!0)]}function i4e(e){return e.startState.facet(h1)!=e.state.facet(h1)}const hDt=n4e({above:!0,markers(e){let{state:t}=e,n=t.facet(h1),i=[];for(let r of t.selection.ranges){let s=r==t.selection.main;if(r.empty||n.drawRangeCursor&&!(s&&hn.ios&&n.iosSelectionHandles)){let o=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=r.empty?r:ht.cursor(r.head,r.assoc);for(let c of Zy.forRange(e,o,l))i.push(c)}}return i},update(e,t){e.transactions.some(i=>i.selection)&&(t.style.animationName=t.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=i4e(e);return n&&ire(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){ire(t.state,e)},class:"cm-cursorLayer"});function ire(e,t){t.style.animationDuration=e.facet(h1).cursorBlinkRate+"ms"}const pDt=n4e({above:!1,markers(e){let t=[],{main:n,ranges:i}=e.state.selection;for(let r of i)if(!r.empty)for(let s of Zy.forRange(e,"cm-selectionBackground",r))t.push(s);if(hn.ios&&!n.empty&&e.state.facet(h1).iosSelectionHandles){for(let r of Zy.forRange(e,"cm-selectionHandle cm-selectionHandle-start",ht.cursor(n.from,1)))t.push(r);for(let r of Zy.forRange(e,"cm-selectionHandle cm-selectionHandle-end",ht.cursor(n.to,1)))t.push(r)}return t},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||i4e(e)},class:"cm-selectionLayer"}),mDt=gm.highest(Jt.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),r4e=pi.define({map(e,t){return e==null?null:t.mapPos(e)}}),vS=dl.define({create(){return null},update(e,t){return e!=null&&(e=t.changes.mapPos(e)),t.effects.reduce((n,i)=>i.is(r4e)?i.value:n,e)}}),gDt=ma.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(vS);n==null?this.cursor!=null&&((t=this.cursor)===null||t===void 0||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(vS)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(vS),n=t!=null&&e.coordsAtPos(t);if(!n)return null;let i=e.scrollDOM.getBoundingClientRect();return{left:n.left-i.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-i.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/n+"px",this.cursor.style.height=e.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(vS)!=e&&this.view.dispatch({effects:r4e.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){(e.target==this.view.contentDOM||!this.view.contentDOM.contains(e.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function bDt(){return[vS,gDt]}function rre(e,t,n,i,r){t.lastIndex=0;for(let s=e.iterRange(n,i),o=n,l;!s.next().done;o+=s.value.length)if(!s.lineBreak)for(;l=t.exec(s.value);)r(o+l.index,l)}function yDt(e,t){let n=e.visibleRanges;if(n.length==1&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let i=[];for(let{from:r,to:s}of n)r=Math.max(e.state.doc.lineAt(r).from,r-t),s=Math.min(e.state.doc.lineAt(s).to,s+t),i.length&&i[i.length-1].to>=r?i[i.length-1].to=s:i.push({from:r,to:s});return i}class vDt{constructor(t){const{regexp:n,decoration:i,decorate:r,boundary:s,maxLength:o=1e3}=t;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,r)this.addMatch=(l,c,u,d)=>r(d,u,u+l[0].length,l,c);else if(typeof i=="function")this.addMatch=(l,c,u,d)=>{let f=i(l,c,u);f&&d(u,u+l[0].length,f)};else if(i)this.addMatch=(l,c,u,d)=>d(u,u+l[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=o}createDeco(t){let n=new tm,i=n.add.bind(n);for(let{from:r,to:s}of yDt(t,this.maxLength))rre(t.state.doc,this.regexp,r,s,(o,l)=>this.addMatch(l,t,o,i));return n.finish()}updateDeco(t,n){let i=1e9,r=-1;return t.docChanged&&t.changes.iterChanges((s,o,l,c)=>{c>=t.view.viewport.from&&l<=t.view.viewport.to&&(i=Math.min(l,i),r=Math.max(c,r))}),t.viewportMoved||r-i>1e3?this.createDeco(t.view):r>-1?this.updateRange(t.view,n.map(t.changes),i,r):n}updateRange(t,n,i,r){for(let s of t.visibleRanges){let o=Math.max(s.from,i),l=Math.min(s.to,r);if(l>=o){let c=t.state.doc.lineAt(o),u=c.toc.from;o--)if(this.boundary.test(c.text[o-1-c.from])){d=o;break}for(;lh.push(y.range(b,v));if(c==u)for(this.regexp.lastIndex=d-c.from;(m=this.regexp.exec(c.text))&&m.indexthis.addMatch(v,t,b,g));n=n.update({filterFrom:d,filterTo:f,filter:(b,v)=>bf,add:h})}}return n}}const Y9=/x/.unicode!=null?"gu":"g",xDt=new RegExp(`[\0-\b ---Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Y9),wDt={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let r$=null;function ODt(){var e;if(r$==null&&typeof document<"u"&&document.body){let t=document.body.style;r$=((e=t.tabSize)!==null&&e!==void 0?e:t.MozTabSize)!=null}return r$||!1}const UN=mn.define({combine(e){let t=Ih(e,{render:null,specialChars:xDt,addSpecialChars:null});return(t.replaceTabs=!ODt())&&(t.specialChars=new RegExp(" |"+t.specialChars.source,Y9)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,Y9)),t}});function kDt(e={}){return[UN.of(e),SDt()]}let sre=null;function SDt(){return sre||(sre=ma.fromClass(class{constructor(e){this.view=e,this.decorations=Fn.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(UN)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new vDt({regexp:e.specialChars,decoration:(t,n,i)=>{let{doc:r}=n.state,s=jc(t[0],0);if(s==9){let o=r.lineAt(i),l=n.state.tabSize,c=wf(o.text,l,i-o.from);return Fn.replace({widget:new TDt((l-c%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=Fn.replace({widget:new ADt(e,s)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(UN);e.startState.facet(UN)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))}const EDt="•";function CDt(e){return e>=32?EDt:e==10?"␤":String.fromCharCode(9216+e)}class ADt extends jf{constructor(t,n){super(),this.options=t,this.code=n}eq(t){return t.code==this.code}toDOM(t){let n=CDt(this.code),i=t.state.phrase("Control character")+" "+(wDt[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,i,n);if(r)return r;let s=document.createElement("span");return s.textContent=n,s.title=i,s.setAttribute("aria-label",i),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class TDt extends jf{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent=" ",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}function _Dt(){return NDt}const jDt=Fn.line({class:"cm-activeLine"}),NDt=ma.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let i of e.state.selection.ranges){let r=e.lineBlockAt(i.head);r.from>t&&(n.push(jDt.range(r.from)),t=r.from)}return Fn.set(n)}},{decorations:e=>e.decorations});class RDt extends jf{constructor(t){super(),this.content=t}toDOM(t){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(t):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(t){let n=t.firstChild?wE(t.firstChild):[];if(!n.length)return null;let i=window.getComputedStyle(t.parentNode),r=$C(n[0],i.direction!="rtl"),s=parseInt(i.lineHeight);return r.bottom-r.top>s*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+s}:r}ignoreEvent(){return!1}}function IDt(e){let t=ma.fromClass(class{constructor(n){this.view=n,this.placeholder=e?Fn.set([Fn.widget({widget:new RDt(e),side:1}).range(0)]):Fn.none}get decorations(){return this.view.state.doc.length?Fn.none:this.placeholder}},{decorations:n=>n.decorations});return typeof e=="string"?[t,Jt.contentAttributes.of({"aria-placeholder":e})]:t}const Z9=2e3;function PDt(e,t,n){let i=Math.min(t.line,n.line),r=Math.max(t.line,n.line),s=[];if(t.off>Z9||n.off>Z9||t.col<0||n.col<0){let o=Math.min(t.off,n.off),l=Math.max(t.off,n.off);for(let c=i;c<=r;c++){let u=e.doc.line(c);u.length<=l&&s.push(ht.range(u.from+o,u.to+l))}}else{let o=Math.min(t.col,n.col),l=Math.max(t.col,n.col);for(let c=i;c<=r;c++){let u=e.doc.line(c),d=N9(u.text,o,e.tabSize,!0);if(d<0)s.push(ht.cursor(u.to));else{let f=N9(u.text,l,e.tabSize);s.push(ht.range(u.from+d,u.from+f))}}}return s}function DDt(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}function are(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),i=e.state.doc.lineAt(n),r=n-i.from,s=r>Z9?-1:r==i.length?DDt(e,t.clientX):wf(i.text,e.state.tabSize,n-i.from);return{line:i.number,col:s,off:r}}function MDt(e,t){let n=are(e,t),i=e.state.selection;return n?{update(r){if(r.docChanged){let s=r.changes.mapPos(r.startState.doc.line(n.line).from),o=r.state.doc.lineAt(s);n={line:o.number,col:n.col,off:Math.min(n.off,o.length)},i=i.map(r.changes)}},get(r,s,o){let l=are(e,r);if(!l)return i;let c=PDt(e.state,n,l);return c.length?o?ht.create(c.concat(i.ranges)):ht.create(c):i}}:null}function LDt(e){let t=n=>n.altKey&&n.button==0;return Jt.mouseSelectionStyle.of((n,i)=>t(i)?MDt(n,i):null)}const $Dt={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},FDt={style:"cursor: crosshair"};function BDt(e={}){let[t,n]=$Dt[e.key||"Alt"],i=ma.fromClass(class{constructor(r){this.view=r,this.isDown=!1}set(r){this.isDown!=r&&(this.isDown=r,this.view.update([]))}},{eventObservers:{keydown(r){this.set(r.keyCode==t||n(r))},keyup(r){(r.keyCode==t||!n(r))&&this.set(!1)},mousemove(r){this.set(n(r))}}});return[i,Jt.contentAttributes.of(r=>{var s;return!((s=r.plugin(i))===null||s===void 0)&&s.isDown?FDt:null})]}const Y_="-10000px";class s4e{constructor(t,n,i,r){this.facet=n,this.createTooltipView=i,this.removeTooltipView=r,this.input=t.state.facet(n),this.tooltips=this.input.filter(o=>o);let s=null;this.tooltipViews=this.tooltips.map(o=>s=i(o,s))}update(t,n){var i;let r=t.state.facet(this.facet),s=r.filter(c=>c);if(r===this.input){for(let c of this.tooltipViews)c.update&&c.update(t);return!1}let o=[],l=n?[]:null;for(let c=0;cn[u]=c),n.length=l.length),this.input=r,this.tooltips=s,this.tooltipViews=o,!0}}function UDt(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}const s$=mn.define({combine:e=>{var t,n,i;return{position:hn.ios?"absolute":((t=e.find(r=>r.position))===null||t===void 0?void 0:t.position)||"fixed",parent:((n=e.find(r=>r.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((i=e.find(r=>r.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||UDt}}}),ore=new WeakMap,Zq=ma.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(s$);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new s4e(e,Jq,(n,i)=>this.createTooltip(n,i),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,i=e.state.facet(s$);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;n=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),i=t?t.dom:null;if(n.dom.classList.add("cm-tooltip"),e.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let r=document.createElement("div");r.className="cm-tooltip-arrow",n.dom.appendChild(r)}return n.dom.style.position=this.position,n.dom.style.top=Y_,n.dom.style.left="0px",this.container.insertBefore(n.dom,i),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(e=i.destroy)===null||e===void 0||e.call(i);this.parent&&this.container.remove(),(t=this.resizeObserver)===null||t===void 0||t.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(hn.safari){let o=s.getBoundingClientRect();n=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}else n=!!s.offsetParent&&s.offsetParent!=this.container.ownerDocument.body}if(n||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(e=s.width/this.parent.offsetWidth,t=s.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),r=Kq(this.view);return{visible:{left:i.left+r.left,top:i.top+r.top,right:i.right-r.right,bottom:i.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,o)=>{let l=this.manager.tooltipViews[o];return l.getCoords?l.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(s$).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){var t;if(e.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:n,space:i,scaleX:r,scaleY:s}=e,o=[];for(let l=0;l=Math.min(n.bottom,i.bottom)||f.rightMath.min(n.right,i.right)+.1)){d.style.top=Y_;continue}let m=c.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,g=m?7:0,b=h.right-h.left,v=(t=ore.get(u))!==null&&t!==void 0?t:h.bottom-h.top,y=u.offset||zDt,w=this.view.textDirection==os.LTR,x=h.width>i.right-i.left?w?i.left:i.right-h.width:w?Math.max(i.left,Math.min(f.left-(m?14:0)+y.x,i.right-b)):Math.min(Math.max(i.left,f.left-b+(m?14:0)-y.x),i.right-b),O=this.above[l];!c.strictSide&&(O?f.top-v-g-y.yi.bottom)&&O==i.bottom-f.bottom>f.top-i.top&&(O=this.above[l]=!O);let k=(O?f.top-i.top:i.bottom-f.bottom)-g;if(kx&&E.topS&&(S=O?E.top-v-2-g:E.bottom+g+2);if(this.position=="absolute"?(d.style.top=(S-e.parent.top)/s+"px",lre(d,(x-e.parent.left)/r)):(d.style.top=S/s+"px",lre(d,x/r)),m){let E=f.left+(w?y.x:-y.x)-(x+14-7);m.style.left=E/r+"px"}u.overlap!==!0&&o.push({left:x,top:S,right:C,bottom:S+v}),d.classList.toggle("cm-tooltip-above",O),d.classList.toggle("cm-tooltip-below",!O),u.positioned&&u.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=Y_}},{eventObservers:{scroll(){this.maybeMeasure()}}});function lre(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}const QDt=Jt.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),zDt={x:0,y:0},Jq=mn.define({enables:[Zq,QDt]}),XI=mn.define({combine:e=>e.reduce((t,n)=>t.concat(n),[])});class eL{static create(t){return new eL(t)}constructor(t){this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new s4e(t,XI,(n,i)=>this.createHostedView(n,i),n=>n.dom.remove())}createHostedView(t,n){let i=t.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}mount(t){for(let n of this.manager.tooltipViews)n.mount&&n.mount(t);this.mounted=!0}positioned(t){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(t)}update(t){this.manager.update(t)}destroy(){var t;for(let n of this.manager.tooltipViews)(t=n.destroy)===null||t===void 0||t.call(n)}passProp(t){let n;for(let i of this.manager.tooltipViews){let r=i[t];if(r!==void 0){if(n===void 0)n=r;else if(n!==r)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const VDt=Jq.compute([XI],e=>{let t=e.facet(XI);return t.length===0?null:{pos:Math.min(...t.map(n=>n.pos)),end:Math.max(...t.map(n=>{var i;return(i=n.end)!==null&&i!==void 0?i:n.pos})),create:eL.create,above:t[0].above,arrow:t.some(n=>n.arrow)}}),a4e=mn.define();class HDt{constructor(t,n,i,r,s,o){this.view=t,this.source=n,this.field=i,this.locked=r,this.setHover=s,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:t.dom,time:0},this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(t){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let t=Date.now()-this.lastMove.time;to.bottom||n.xo.right+t.defaultCharacterWidth)return;let l=t.bidiSpans(t.state.doc.lineAt(r)).find(u=>u.from<=r&&u.to>=r),c=l&&l.dir==os.RTL?-1:1;s=n.x{if(l&&!(Array.isArray(l)&&!l.length)){let c=Array.isArray(l)?l:[l];r&&this.locked.set(c,r),t.dispatch({effects:this.setHover.of(c)})}};if(s&&"then"in s){let l=this.pending={pos:n};s.then(c=>{this.pending==l&&(this.pending=null,o(c))},c=>Dc(t.state,c,"hover tooltip"))}else o(s)}get tooltip(){let t=this.view.plugin(Zq),n=t?t.manager.tooltips.findIndex(i=>i.create==eL.create):-1;return n>-1?t.manager.tooltipViews[n]:null}mousemove(t){var n,i;this.lastMove={x:t.clientX,y:t.clientY,target:t.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:s}=this;if(r.length&&!this.locked.has(r)&&s&&!qDt(s.dom,t)||this.pending){let{pos:o}=r[0]||this.pending,l=(i=(n=r[0])===null||n===void 0?void 0:n.end)!==null&&i!==void 0?i:o;(o==l?this.view.posAtCoords(this.lastMove)!=o:!WDt(this.view,o,l,t.clientX,t.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(t){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length&&!this.locked.has(n)){let{tooltip:i}=this;i&&i.dom.contains(t.relatedTarget)?this.watchTooltipLeave(i.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(t){let n=i=>{t.removeEventListener("mouseleave",n);let{active:r}=this;r.length&&!this.locked.has(r)&&!this.view.dom.contains(i.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};t.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const Z_=4;function qDt(e,t){let{left:n,right:i,top:r,bottom:s}=e.getBoundingClientRect(),o;if(o=e.querySelector(".cm-tooltip-arrow")){let l=o.getBoundingClientRect();r=Math.min(l.top,r),s=Math.max(l.bottom,s)}return t.clientX>=n-Z_&&t.clientX<=i+Z_&&t.clientY>=r-Z_&&t.clientY<=s+Z_}function WDt(e,t,n,i,r,s){let o=e.scrollDOM.getBoundingClientRect(),l=e.documentTop+e.documentPadding.top+e.contentHeight;if(o.left>i||o.rightr||Math.min(o.bottom,l)=t&&c<=n}function KDt(e,t={}){let n=pi.define(),i=new WeakMap,r=dl.define({create(){return[]},update(o,l){let c=i.get(o);if(o.length&&(t.hideOnChange&&(l.docChanged||l.selection)?o=[]:c&&c(l)?o=[]:t.hideOn&&(o=o.filter(u=>!t.hideOn(l,u)))),l.docChanged&&o.length){let u=[];for(let d of o){let f=l.changes.mapPos(d.pos,-1,il.TrackDel);if(f!=null){let h=Object.assign(Object.create(null),d);h.pos=f,h.end!=null&&(h.end=l.changes.mapPos(h.end)),u.push(h)}}o=u}for(let u of l.effects)u.is(n)&&(o=u.value,c=void 0),(u.is(XDt)&&!u.value||u.value==r)&&(o=[]);return o.length&&c&&i.set(o,c),o},provide:o=>XI.from(o)});const s=ma.define(o=>new HDt(o,e,r,i,n,t.hoverTime||300));return{active:r,extension:[r,s,a4e.of(s),VDt]}}function GDt(e,t,n,i={}){var r;let s=e.state.facet(a4e).map(o=>e.plugin(o)).filter(o=>!!o);if(i.tooltip&&i.tooltip.active){let o=s.find(l=>l.field==i.tooltip.active);o&&(s=[o])}for(let o of s)o.activateHover(e,t,n,(r=i.until)!==null&&r!==void 0?r:()=>!1)}function o4e(e,t){let n=e.plugin(Zq);if(!n)return null;let i=n.manager.tooltips.indexOf(t);return i<0?null:n.manager.tooltipViews[i]}const XDt=pi.define(),cre=mn.define({combine(e){let t,n;for(let i of e)t=t||i.topContainer,n=n||i.bottomContainer;return{topContainer:t,bottomContainer:n}}});function eW(e,t){let n=e.plugin(l4e),i=n?n.specs.indexOf(t):-1;return i>-1?n.panels[i]:null}const l4e=ma.fromClass(class{constructor(e){this.input=e.state.facet(BC),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(e));let t=e.state.facet(cre);this.top=new J_(e,!0,t.topContainer),this.bottom=new J_(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(e){let t=e.state.facet(cre);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new J_(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new J_(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(BC);if(n!=this.input){let i=n.filter(c=>c),r=[],s=[],o=[],l=[];for(let c of i){let u=this.specs.indexOf(c),d;u<0?(d=c(e.view),l.push(d)):(d=this.panels[u],d.update&&d.update(e)),r.push(d),(d.top?s:o).push(d)}this.specs=i,this.panels=r,this.top.sync(s),this.bottom.sync(o);for(let c of l)c.dom.classList.add("cm-panel"),c.mount&&c.mount()}else for(let i of this.panels)i.update&&i.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>Jt.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class J_{constructor(t,n,i){this.view=t,this.top=n,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let n of this.panels)n.destroy&&t.indexOf(n)<0&&n.destroy();this.panels=t,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let t=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;t!=n.dom;)t=ure(t);t=t.nextSibling}else this.dom.insertBefore(n.dom,t);for(;t;)t=ure(t)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let t of this.classes.split(" "))t&&this.container.classList.remove(t);for(let t of(this.classes=this.view.themeClasses).split(" "))t&&this.container.classList.add(t)}}}function ure(e){let t=e.nextSibling;return e.remove(),t}const BC=mn.define({enables:l4e});function YDt(e,t){let n,i=new Promise(o=>n=o),r=o=>ZDt(o,t,n);e.state.field(a$,!1)?e.dispatch({effects:c4e.of(r)}):e.dispatch({effects:pi.appendConfig.of(a$.init(()=>[r]))});let s=u4e.of(r);return{close:s,result:i.then(o=>((e.win.queueMicrotask||(c=>e.win.setTimeout(c,10)))(()=>{e.state.field(a$).indexOf(r)>-1&&e.dispatch({effects:s})}),o))}}const a$=dl.define({create(){return[]},update(e,t){for(let n of t.effects)n.is(c4e)?e=[n.value].concat(e):n.is(u4e)&&(e=e.filter(i=>i!=n.value));return e},provide:e=>BC.computeN([e],t=>t.field(e))}),c4e=pi.define(),u4e=pi.define();function ZDt(e,t,n){let i=t.content?t.content(e,()=>o(null)):null;if(!i){if(i=Kr("form"),t.input){let l=Kr("input",t.input);/^(text|password|number|email|tel|url)$/.test(l.type)&&l.classList.add("cm-textfield"),l.name||(l.name="input"),i.appendChild(Kr("label",(t.label||"")+": ",l))}else i.appendChild(document.createTextNode(t.label||""));i.appendChild(document.createTextNode(" ")),i.appendChild(Kr("button",{class:"cm-button",type:"submit"},t.submitLabel||"OK"))}let r=i.nodeName=="FORM"?[i]:i.querySelectorAll("form");for(let l=0;l{u.keyCode==27?(u.preventDefault(),o(null)):u.keyCode==13&&(u.preventDefault(),o(c))}),c.addEventListener("submit",u=>{u.preventDefault(),o(c)})}let s=Kr("div",i,Kr("button",{onclick:()=>o(null),"aria-label":e.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));t.class&&(s.className=t.class),s.classList.add("cm-dialog");function o(l){s.contains(s.ownerDocument.activeElement)&&e.focus(),n(l)}return{dom:s,top:t.top,mount:()=>{if(t.focus){let l;typeof t.focus=="string"?l=i.querySelector(t.focus):l=i.querySelector("input")||i.querySelector("button"),l&&"select"in l?l.select():l&&"focus"in l&&l.focus()}}}}class im extends fb{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}im.prototype.elementClass="";im.prototype.toDOM=void 0;im.prototype.mapMode=il.TrackBefore;im.prototype.startSide=im.prototype.endSide=-1;im.prototype.point=!0;const QN=mn.define(),JDt=mn.define(),eMt={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Ki.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},SE=mn.define();function tMt(e){return[d4e(),SE.of({...eMt,...e})]}const dre=mn.define({combine:e=>e.some(t=>t)});function d4e(e){return[nMt]}const nMt=ma.fromClass(class{constructor(e){this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=e.state.facet(SE).map(t=>new hre(e,t)),this.fixed=!e.state.facet(dre);for(let t of this.gutters)t.config.side=="after"?this.getDOMAfter().appendChild(t.dom):this.dom.appendChild(t.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,i=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(i<(n.to-n.from)*.8)}if(e.geometryChanged){let t=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=t,this.domAfter&&(this.domAfter.style.minHeight=t)}this.view.state.facet(dre)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=Ki.iter(this.view.state.facet(QN),this.view.viewport.from),i=[],r=this.gutters.map(s=>new iMt(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(s.type)){let o=!0;for(let l of s.type)if(l.type==ol.Text&&o){J9(n,i,l.from);for(let c of r)c.line(this.view,l,i);o=!1}else if(l.widget)for(let c of r)c.widget(this.view,l)}else if(s.type==ol.Text){J9(n,i,s.from);for(let o of r)o.line(this.view,s,i)}else if(s.widget)for(let o of r)o.widget(this.view,s);for(let s of r)s.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(SE),n=e.state.facet(SE),i=e.docChanged||e.heightChanged||e.viewportChanged||!Ki.eq(e.startState.facet(QN),e.state.facet(QN),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let r of this.gutters)r.update(e)&&(i=!0);else{i=!0;let r=[];for(let s of n){let o=t.indexOf(s);o<0?r.push(new hre(this.view,s)):(this.gutters[o].update(e),r.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),r.indexOf(s)<0&&s.destroy();for(let s of r)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=r}return i}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>Jt.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||n.gutters.length==0||!n.fixed)return null;let i=n.dom.offsetWidth*t.scaleX,r=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==os.LTR?{left:i,right:r}:{right:i,left:r}})});function fre(e){return Array.isArray(e)?e:[e]}function J9(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class iMt{constructor(t,n,i){this.gutter=t,this.height=i,this.i=0,this.cursor=Ki.iter(t.markers,n.from)}addElement(t,n,i){let{gutter:r}=this,s=(n.top-this.height)/t.scaleY,o=n.height/t.scaleY;if(this.i==r.elements.length){let l=new f4e(t,o,s,i);r.elements.push(l),r.dom.appendChild(l.dom)}else r.elements[this.i].update(t,o,s,i);this.height=n.bottom,this.i++}line(t,n,i){let r=[];J9(this.cursor,r,n.from),i.length&&(r=r.concat(i));let s=this.gutter.config.lineMarker(t,n,r);s&&r.unshift(s);let o=this.gutter;r.length==0&&!o.config.renderEmptyElements||this.addElement(t,n,r)}widget(t,n){let i=this.gutter.config.widgetMarker(t,n.widget,n),r=i?[i]:null;for(let s of t.state.facet(JDt)){let o=s(t,n.widget,n);o&&(r||(r=[])).push(o)}r&&this.addElement(t,n,r)}finish(){let t=this.gutter;for(;t.elements.length>this.i;){let n=t.elements.pop();t.dom.removeChild(n.dom),n.destroy()}}}class hre{constructor(t,n){this.view=t,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in n.domEventHandlers)this.dom.addEventListener(i,r=>{let s=r.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let c=s.getBoundingClientRect();o=(c.top+c.bottom)/2}else o=r.clientY;let l=t.lineBlockAtHeight(o-t.documentTop);n.domEventHandlers[i](t,l,r)&&r.preventDefault()});this.markers=fre(n.markers(t)),n.initialSpacer&&(this.spacer=new f4e(t,0,0,[n.initialSpacer(t)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(t){let n=this.markers;if(this.markers=fre(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],t);r!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[r])}let i=t.view.viewport;return!Ki.eq(this.markers,n,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(t):!1)}destroy(){for(let t of this.elements)t.destroy()}}class f4e{constructor(t,n,i,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(t,n,i,r)}update(t,n,i,r){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),rMt(this.markers,r)||this.setMarkers(t,r)}setMarkers(t,n){let i="cm-gutterElement",r=this.dom.firstChild;for(let s=0,o=0;;){let l=o,c=ss(l,c,u)||o(l,c,u):o}return i}})}});class o$ extends im{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function l$(e,t){return e.state.facet(Bx).formatNumber(t,e.state)}const oMt=SE.compute([Bx],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(t){return t.state.facet(sMt)},lineMarker(t,n,i){return i.some(r=>r.toDOM)?null:new o$(l$(t,t.state.doc.lineAt(n.from).number))},widgetMarker:(t,n,i)=>{for(let r of t.state.facet(aMt)){let s=r(t,n,i);if(s)return s}return null},lineMarkerChange:t=>t.startState.facet(Bx)!=t.state.facet(Bx),initialSpacer(t){return new o$(l$(t,pre(t.state.doc.lines)))},updateSpacer(t,n){let i=l$(n.view,pre(n.view.state.doc.lines));return i==t.number?t:new o$(i)},domEventHandlers:e.facet(Bx).domEventHandlers,side:"before"}));function h4e(e={}){return[Bx.of(e),d4e(),oMt]}function pre(e){let t=9;for(;t{let t=[],n=-1;for(let i of e.selection.ranges){let r=e.doc.lineAt(i.head).from;r>n&&(n=r,t.push(lMt.range(r)))}return Ki.of(t)});function uMt(){return cMt}let dMt=0,Xf=class e7{constructor(t,n,i,r){this.name=t,this.set=n,this.base=i,this.modified=r,this.id=dMt++}toString(){let{name:t}=this;for(let n of this.modified)n.name&&(t=`${n.name}(${t})`);return t}static define(t,n){let i=typeof t=="string"?t:"?";if(t instanceof e7&&(n=t),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let r=new e7(i,[],null,[]);if(r.set.push(r),n)for(let s of n.set)r.set.push(s);return r}static defineModifier(t){let n=new YI(t);return i=>i.modified.indexOf(n)>-1?i:YI.get(i.base||i,i.modified.concat(n).sort((r,s)=>r.id-s.id))}},fMt=0;class YI{constructor(t){this.name=t,this.instances=[],this.id=fMt++}static get(t,n){if(!n.length)return t;let i=n[0].instances.find(l=>l.base==t&&hMt(n,l.modified));if(i)return i;let r=[],s=new Xf(t.name,r,t,n);for(let l of n)l.instances.push(s);let o=pMt(n);for(let l of t.set)if(!l.modified.length)for(let c of o)r.push(YI.get(l,c));return s}}function hMt(e,t){return e.length==t.length&&e.every((n,i)=>n==t[i])}function pMt(e){let t=[[]];for(let n=0;ni.length-n.length)}function bm(e){let t=Object.create(null);for(let n in e){let i=e[n];Array.isArray(i)||(i=[i]);for(let r of n.split(" "))if(r){let s=[],o=2,l=r;for(let f=0;;){if(l=="..."&&f>0&&f+3==r.length){o=1;break}let h=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!h)throw new RangeError("Invalid path: "+r);if(s.push(h[0]=="*"?"":h[0][0]=='"'?JSON.parse(h[0]):h[0]),f+=h[0].length,f==r.length)break;let m=r[f++];if(f==r.length&&m=="!"){o=0;break}if(m!="/")throw new RangeError("Invalid path: "+r);l=r.slice(f)}let c=s.length-1,u=s[c];if(!u)throw new RangeError("Invalid path: "+r);let d=new UC(i,o,c>0?s.slice(0,c):null);t[u]=d.sort(t[u])}}return p4e.add(t)}const p4e=new ui({combine(e,t){let n,i,r;for(;e||t;){if(!e||t&&e.depth>=t.depth?(r=t,t=t.next):(r=e,e=e.next),n&&n.mode==r.mode&&!r.context&&!n.context)continue;let s=new UC(r.tags,r.mode,r.context);n?n.next=s:i=s,n=s}return i}});let UC=class{constructor(t,n,i,r){this.tags=t,this.mode=n,this.context=i,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(t){return!t||t.depth{let o=r;for(let l of s)for(let c of l.set){let u=n[c.id];if(u){o=o?o+" "+u:u;break}}return o},scope:i}}function mMt(e,t){let n=null;for(let i of e){let r=i.style(t);r&&(n=n?n+" "+r:r)}return n}function gMt(e,t,n,i=0,r=e.length){let s=new bMt(i,Array.isArray(t)?t:[t],n);s.highlightRange(e.cursor(),i,r,"",s.highlighters),s.flush(r)}class bMt{constructor(t,n,i){this.at=t,this.highlighters=n,this.span=i,this.class=""}startSpan(t,n){n!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=n)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,n,i,r,s){let{type:o,from:l,to:c}=t;if(l>=i||c<=n)return;o.isTop&&(s=this.highlighters.filter(m=>!m.scope||m.scope(o)));let u=r,d=yMt(t)||UC.empty,f=mMt(s,d.tags);if(f&&(u&&(u+=" "),u+=f,d.mode==1&&(r+=(r?" ":"")+f)),this.startSpan(Math.max(n,l),u),d.opaque)return;let h=t.tree&&t.tree.prop(ui.mounted);if(h&&h.overlay){let m=t.node.enter(h.overlay[0].from+l,1),g=this.highlighters.filter(v=>!v.scope||v.scope(h.tree.type)),b=t.firstChild();for(let v=0,y=l;;v++){let w=v=x||!t.nextSibling())););if(!w||x>i)break;y=w.to+l,y>n&&(this.highlightRange(m.cursor(),Math.max(n,w.from+l),Math.min(i,y),"",g),this.startSpan(Math.min(i,y),u))}b&&t.parent()}else if(t.firstChild()){h&&(r="");do if(!(t.to<=n)){if(t.from>=i)break;this.highlightRange(t,n,i,r,s),this.startSpan(Math.min(i,t.to),u)}while(t.nextSibling());t.parent()}}}function yMt(e){let t=e.type.prop(p4e);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}const an=Xf.define,ej=an(),Xm=an(),mre=an(Xm),gre=an(Xm),Ym=an(),tj=an(Ym),c$=an(Ym),Wf=an(),ey=an(Wf),zf=an(),Vf=an(),t7=an(),Sk=an(t7),nj=an(),fe={comment:ej,lineComment:an(ej),blockComment:an(ej),docComment:an(ej),name:Xm,variableName:an(Xm),typeName:mre,tagName:an(mre),propertyName:gre,attributeName:an(gre),className:an(Xm),labelName:an(Xm),namespace:an(Xm),macroName:an(Xm),literal:Ym,string:tj,docString:an(tj),character:an(tj),attributeValue:an(tj),number:c$,integer:an(c$),float:an(c$),bool:an(Ym),regexp:an(Ym),escape:an(Ym),color:an(Ym),url:an(Ym),keyword:zf,self:an(zf),null:an(zf),atom:an(zf),unit:an(zf),modifier:an(zf),operatorKeyword:an(zf),controlKeyword:an(zf),definitionKeyword:an(zf),moduleKeyword:an(zf),operator:Vf,derefOperator:an(Vf),arithmeticOperator:an(Vf),logicOperator:an(Vf),bitwiseOperator:an(Vf),compareOperator:an(Vf),updateOperator:an(Vf),definitionOperator:an(Vf),typeOperator:an(Vf),controlOperator:an(Vf),punctuation:t7,separator:an(t7),bracket:Sk,angleBracket:an(Sk),squareBracket:an(Sk),paren:an(Sk),brace:an(Sk),content:Wf,heading:ey,heading1:an(ey),heading2:an(ey),heading3:an(ey),heading4:an(ey),heading5:an(ey),heading6:an(ey),contentSeparator:an(Wf),list:an(Wf),quote:an(Wf),emphasis:an(Wf),strong:an(Wf),link:an(Wf),monospace:an(Wf),strikethrough:an(Wf),inserted:an(),deleted:an(),changed:an(),invalid:an(),meta:nj,documentMeta:an(nj),annotation:an(nj),processingInstruction:an(nj),definition:Xf.defineModifier("definition"),constant:Xf.defineModifier("constant"),function:Xf.defineModifier("function"),standard:Xf.defineModifier("standard"),local:Xf.defineModifier("local"),special:Xf.defineModifier("special")};for(let e in fe){let t=fe[e];t instanceof Xf&&(t.name=e)}m4e([{tag:fe.link,class:"tok-link"},{tag:fe.heading,class:"tok-heading"},{tag:fe.emphasis,class:"tok-emphasis"},{tag:fe.strong,class:"tok-strong"},{tag:fe.keyword,class:"tok-keyword"},{tag:fe.atom,class:"tok-atom"},{tag:fe.bool,class:"tok-bool"},{tag:fe.url,class:"tok-url"},{tag:fe.labelName,class:"tok-labelName"},{tag:fe.inserted,class:"tok-inserted"},{tag:fe.deleted,class:"tok-deleted"},{tag:fe.literal,class:"tok-literal"},{tag:fe.string,class:"tok-string"},{tag:fe.number,class:"tok-number"},{tag:[fe.regexp,fe.escape,fe.special(fe.string)],class:"tok-string2"},{tag:fe.variableName,class:"tok-variableName"},{tag:fe.local(fe.variableName),class:"tok-variableName tok-local"},{tag:fe.definition(fe.variableName),class:"tok-variableName tok-definition"},{tag:fe.special(fe.variableName),class:"tok-variableName2"},{tag:fe.definition(fe.propertyName),class:"tok-propertyName tok-definition"},{tag:fe.typeName,class:"tok-typeName"},{tag:fe.namespace,class:"tok-namespace"},{tag:fe.className,class:"tok-className"},{tag:fe.macroName,class:"tok-macroName"},{tag:fe.propertyName,class:"tok-propertyName"},{tag:fe.operator,class:"tok-operator"},{tag:fe.comment,class:"tok-comment"},{tag:fe.meta,class:"tok-meta"},{tag:fe.invalid,class:"tok-invalid"},{tag:fe.punctuation,class:"tok-punctuation"}]);var u$;const wg=new ui;function tL(e){return mn.define({combine:e?t=>t.concat(e):void 0})}const tW=new ui;class Ou{constructor(t,n,i=[],r=""){this.data=t,this.name=r,tr.prototype.hasOwnProperty("tree")||Object.defineProperty(tr.prototype,"tree",{get(){return Yr(this)}}),this.parser=n,this.extension=[gb.of(this),tr.languageData.of((s,o,l)=>{let c=bre(s,o,l),u=c.type.prop(wg);if(!u)return[];let d=s.facet(u),f=c.type.prop(tW);if(f){let h=c.resolve(o-c.from,l);for(let m of f)if(m.test(h,s)){let g=s.facet(m.facet);return m.type=="replace"?g:g.concat(d)}}return d})].concat(i)}isActiveAt(t,n,i=-1){return bre(t,n,i).type.prop(wg)==this.data}findRegions(t){let n=t.facet(gb);if((n==null?void 0:n.data)==this.data)return[{from:0,to:t.doc.length}];if(!n||!n.allowsNesting)return[];let i=[],r=(s,o)=>{if(s.prop(wg)==this.data){i.push({from:o,to:o+s.length});return}let l=s.prop(ui.mounted);if(l){if(l.tree.prop(wg)==this.data){if(l.overlay)for(let c of l.overlay)i.push({from:c.from+o,to:c.to+o});else i.push({from:o,to:o+s.length});return}else if(l.overlay){let c=i.length;if(r(l.tree,l.overlay[0].from+o),i.length>c)return}}for(let c=0;ci.isTop?n:void 0)]}),t.name)}configure(t,n){return new rm(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Yr(e){let t=e.field(Ou.state,!1);return t?t.tree:Bi.empty}class vMt{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,n){let i=this.cursorPos-this.string.length;return t=this.cursorPos?this.doc.sliceString(t,n):this.string.slice(t-i,n-i)}}let Ek=null;class k0{constructor(t,n,i=[],r,s,o,l,c){this.parser=t,this.state=n,this.fragments=i,this.tree=r,this.treeLen=s,this.viewport=o,this.skipped=l,this.scheduleOn=c,this.parse=null,this.tempSkipped=[]}static create(t,n,i){return new k0(t,n,[],Bi.empty,0,i,[],null)}startParse(){return this.parser.startParse(new vMt(this.state.doc),this.fragments)}work(t,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Bi.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof t=="number"){let r=Date.now()+t;t=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=t,this.tree=n,this.fragments=this.withoutTempSkipped(Bp.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let n=Ek;Ek=this;try{return t()}finally{Ek=n}}withoutTempSkipped(t){for(let n;n=this.tempSkipped.pop();)t=yre(t,n.from,n.to);return t}changes(t,n){let{fragments:i,tree:r,treeLen:s,viewport:o,skipped:l}=this;if(this.takeTree(),!t.empty){let c=[];if(t.iterChangedRanges((u,d,f,h)=>c.push({fromA:u,toA:d,fromB:f,toB:h})),i=Bp.applyChanges(i,c),r=Bi.empty,s=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){l=[];for(let u of this.skipped){let d=t.mapPos(u.from,1),f=t.mapPos(u.to,-1);dt.from&&(this.fragments=yre(this.fragments,r,s),this.skipped.splice(i--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,n){this.skipped.push({from:t,to:n})}static getSkippingParser(t){return new class extends WM{createParse(n,i,r){let s=r[0].from,o=r[r.length-1].to;return{parsedPos:s,advance(){let c=Ek;if(c){for(let u of r)c.tempSkipped.push(u);t&&(c.scheduleOn=c.scheduleOn?Promise.all([c.scheduleOn,t]):t)}return this.parsedPos=o,new Bi(Za.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let n=this.fragments;return this.treeLen>=t&&n.length&&n[0].from==0&&n[0].to>=t}static get(){return Ek}}function yre(e,t,n){return Bp.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class p1{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),i=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,i)||n.takeTree(),new p1(n)}static init(t){let n=Math.min(3e3,t.doc.length),i=k0.create(t.facet(gb).parser,t,{from:0,to:n});return i.work(20,n)||i.takeTree(),new p1(i)}}Ou.state=dl.define({create:p1.init,update(e,t){for(let n of t.effects)if(n.is(Ou.setState))return n.value;return t.startState.facet(gb)!=t.state.facet(gb)?p1.init(t.state):e.apply(t)}});let g4e=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&(g4e=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const d$=typeof navigator<"u"&&(!((u$=navigator.scheduling)===null||u$===void 0)&&u$.isInputPending)?()=>navigator.scheduling.isInputPending():null,xMt=ma.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let n=this.view.state.field(Ou.state).context;(n.updateViewport(t.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:t}=this.view,n=t.field(Ou.state);(n.tree!=n.context.tree||!n.context.isDone(t.doc.length))&&(this.working=g4e(this.work))}work(t){this.working=null;let n=Date.now();if(this.chunkEndr+1e3,c=s.context.work(()=>d$&&d$()||Date.now()>o,r+(l?0:1e5));this.chunkBudget-=Date.now()-n,(c||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:Ou.setState.of(new p1(s.context))})),this.chunkBudget>0&&!(c&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Dc(this.view.state,n)).then(()=>this.workScheduled--),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),gb=mn.define({combine(e){return e.length?e[0]:null},enables:e=>[Ou.state,xMt,Jt.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class bb{constructor(t,n=[]){this.language=t,this.support=n,this.extension=[t,n]}}class ZI{constructor(t,n,i,r,s,o=void 0){this.name=t,this.alias=n,this.extensions=i,this.filename=r,this.loadFunc=s,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(t=>this.support=t,t=>{throw this.loading=null,t}))}static of(t){let{load:n,support:i}=t;if(!n){if(!i)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");n=()=>Promise.resolve(i)}return new ZI(t.name,(t.alias||[]).concat(t.name).map(r=>r.toLowerCase()),t.extensions||[],t.filename,n,i)}static matchFilename(t,n){for(let r of t)if(r.filename&&r.filename.test(n))return r;let i=/\.([^.]+)$/.exec(n);if(i){for(let r of t)if(r.extensions.indexOf(i[1])>-1)return r}return null}static matchLanguageName(t,n,i=!0){n=n.toLowerCase();for(let r of t)if(r.alias.some(s=>s==n))return r;if(i)for(let r of t)for(let s of r.alias){let o=n.indexOf(s);if(o>-1&&(s.length>2||!/\w/.test(n[o-1])&&!/\w/.test(n[o+s.length])))return r}return null}}const wMt=mn.define(),pO=mn.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(n=>n!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function S0(e){let t=e.facet(pO);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function QC(e,t){let n="",i=e.tabSize,r=e.facet(pO)[0];if(r==" "){for(;t>=i;)n+=" ",t-=i;r=" "}for(let s=0;s=t?OMt(e,n,t):null}class nL{constructor(t,n={}){this.state=t,this.options=n,this.unit=S0(t)}lineAt(t,n=1){let i=this.state.doc.lineAt(t),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=i.from&&r<=i.to?s&&r==t?{text:"",from:t}:(n<0?r-1&&(s+=o-this.countColumn(i,i.search(/\S|$/))),s}countColumn(t,n=t.length){return wf(t,this.state.tabSize,n)}lineIndent(t,n=1){let{text:i,from:r}=this.lineAt(t,n),s=this.options.overrideIndentation;if(s){let o=s(r);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const ym=new ui;function OMt(e,t,n){let i=t.resolveStack(n),r=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(r!=i.node){let s=[];for(let o=r;o&&!(o.fromi.node.to||o.from==i.node.from&&o.type==i.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)i={node:s[o],next:i}}return b4e(i,e,n)}function b4e(e,t,n){for(let i=e;i;i=i.next){let r=SMt(i.node);if(r)return r(iW.create(t,n,i))}return 0}function kMt(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function SMt(e){let t=e.type.prop(ym);if(t)return t;let n=e.firstChild,i;if(n&&(i=n.type.prop(ui.closedBy))){let r=e.lastChild,s=r&&i.indexOf(r.name)>-1;return o=>y4e(o,!0,1,void 0,s&&!kMt(o)?r.from:void 0)}return e.parent==null?EMt:null}function EMt(){return 0}class iW extends nL{constructor(t,n,i){super(t.state,t.options),this.base=t,this.pos=n,this.context=i}get node(){return this.context.node}static create(t,n,i){return new iW(t,n,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let n=this.state.doc.lineAt(t.from);for(;;){let i=t.resolve(n.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(CMt(i,t))break;n=this.state.doc.lineAt(i.from)}return this.lineIndent(n.from)}continue(){return b4e(this.context.next,this.base,this.pos)}}function CMt(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function AMt(e){let t=e.node,n=t.childAfter(t.from),i=t.lastChild;if(!n)return null;let r=e.options.simulateBreak,s=e.state.doc.lineAt(n.from),o=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let l=n.to;;){let c=t.childAfter(l);if(!c||c==i)return null;if(!c.type.isSkipped){if(c.from>=o)return null;let u=/^ */.exec(s.text.slice(n.to-s.from))[0].length;return{from:n.from,to:n.to+u}}l=c.to}}function xw({closing:e,align:t=!0,units:n=1}){return i=>y4e(i,t,n,e)}function y4e(e,t,n,i,r){let s=e.textAfter,o=s.match(/^\s*/)[0].length,l=i&&s.slice(o,o+i.length)==i||r==e.pos+o,c=t?AMt(e):null;return c?l?e.column(c.from):e.column(c.to):e.baseIndent+(l?0:e.unit*n)}const TMt=e=>e.baseIndent;function ww({except:e,units:t=1}={}){return n=>{let i=e&&e.test(n.textAfter);return n.baseIndent+(i?0:t*n.unit)}}const _Mt=200;function jMt(){return tr.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:i}=e.newSelection.main,r=n.lineAt(i);if(i>r.from+_Mt)return e;let s=n.sliceString(r.from,i);if(!t.some(u=>u.test(s)))return e;let{state:o}=e,l=-1,c=[];for(let{head:u}of o.selection.ranges){let d=o.doc.lineAt(u);if(d.from==l)continue;l=d.from;let f=nW(o,d.from);if(f==null)continue;let h=/^\s*/.exec(d.text)[0],m=QC(o,f);h!=m&&c.push({from:d.from,to:d.from+h.length,insert:m})}return c.length?[e,{changes:c,sequential:!0}]:e})}const v4e=mn.define(),vm=new ui;function jT(e){let t=e.firstChild,n=e.lastChild;return t&&t.ton)continue;if(s&&l.from=t&&u.to>n&&(s=u)}}return s}function RMt(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function JI(e,t,n){for(let i of e.facet(v4e)){let r=i(e,t,n);if(r)return r}return NMt(e,t,n)}function x4e(e,t){let n=t.mapPos(e.from,1),i=t.mapPos(e.to,-1);return n>=i?void 0:{from:n,to:i}}const iL=pi.define({map:x4e}),NT=pi.define({map:x4e});function w4e(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(i=>i.from<=n&&i.to>=n)||t.push(e.lineBlockAt(n));return t}const E0=dl.define({create(){return Fn.none},update(e,t){t.isUserEvent("delete")&&t.changes.iterChangedRanges((i,r)=>e=vre(e,i,r)),e=e.map(t.changes);let n=[];for(let i of t.effects)i.is(iL)&&!IMt(e,i.value.from,i.value.to)?n.push(i.value):i.is(NT)&&(e=e.update({filter:(r,s)=>i.value.from!=r||i.value.to!=s,filterFrom:i.value.from,filterTo:i.value.to}));if(n.length){let{preparePlaceholder:i}=t.state.facet(S4e),r=n.map(s=>(i?Fn.replace({widget:new BMt(i(t.state,s))}):xre).range(s.from,s.to));e=e.update({add:r})}return t.selection&&(e=vre(e,t.selection.main.head)),e},provide:e=>Jt.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(i,r)=>{n.push(i,r)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n{rt&&(i=!0)}),i?e.update({filterFrom:t,filterTo:n,filter:(r,s)=>r>=n||s<=t}):e}function eP(e,t,n){var i;let r=null;return(i=e.field(E0,!1))===null||i===void 0||i.between(t,n,(s,o)=>{(!r||r.from>s)&&(r={from:s,to:o})}),r}function IMt(e,t,n){let i=!1;return e.between(t,t,(r,s)=>{r==t&&s==n&&(i=!0)}),i}function O4e(e,t){return e.field(E0,!1)?t:t.concat(pi.appendConfig.of(E4e()))}const PMt=e=>{for(let t of w4e(e)){let n=JI(e.state,t.from,t.to);if(n)return e.dispatch({effects:O4e(e.state,[iL.of(n),k4e(e,n)])}),!0}return!1},DMt=e=>{if(!e.state.field(E0,!1))return!1;let t=[];for(let n of w4e(e)){let i=eP(e.state,n.from,n.to);i&&t.push(NT.of(i),k4e(e,i,!1))}return t.length&&e.dispatch({effects:t}),t.length>0};function k4e(e,t,n=!0){let i=e.state.doc.lineAt(t.from).number,r=e.state.doc.lineAt(t.to).number;return Jt.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${i} ${e.state.phrase("to")} ${r}.`)}const MMt=e=>{let{state:t}=e,n=[];for(let i=0;i{let t=e.state.field(E0,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(i,r)=>{n.push(NT.of({from:i,to:r}))}),e.dispatch({effects:n}),!0},$Mt=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:PMt},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:DMt},{key:"Ctrl-Alt-[",run:MMt},{key:"Ctrl-Alt-]",run:LMt}],FMt={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},S4e=mn.define({combine(e){return Ih(e,FMt)}});function E4e(e){return[E0,zMt]}function C4e(e,t){let{state:n}=e,i=n.facet(S4e),r=o=>{let l=e.lineBlockAt(e.posAtDOM(o.target)),c=eP(e.state,l.from,l.to);c&&e.dispatch({effects:NT.of(c)}),o.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(e,r,t);let s=document.createElement("span");return s.textContent=i.placeholderText,s.setAttribute("aria-label",n.phrase("folded code")),s.title=n.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=r,s}const xre=Fn.replace({widget:new class extends jf{toDOM(e){return C4e(e,null)}}});class BMt extends jf{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return C4e(t,this.value)}}const UMt={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class f$ extends im{constructor(t,n){super(),this.config=t,this.open=n}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=t.state.phrase(this.open?"Fold line":"Unfold line"),n}}function QMt(e={}){let t={...UMt,...e},n=new f$(t,!0),i=new f$(t,!1),r=ma.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(gb)!=o.state.facet(gb)||o.startState.field(E0,!1)!=o.state.field(E0,!1)||Yr(o.startState)!=Yr(o.state)||t.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new tm;for(let c of o.viewportLineBlocks){let u=eP(o.state,c.from,c.to)?i:JI(o.state,c.from,c.to)?n:null;u&&l.add(c.from,c.from,u)}return l.finish()}}),{domEventHandlers:s}=t;return[r,tMt({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(r))===null||l===void 0?void 0:l.markers)||Ki.empty},initialSpacer(){return new f$(t,!1)},domEventHandlers:{...s,click:(o,l,c)=>{if(s.click&&s.click(o,l,c))return!0;let u=eP(o.state,l.from,l.to);if(u)return o.dispatch({effects:NT.of(u)}),!0;let d=JI(o.state,l.from,l.to);return d?(o.dispatch({effects:iL.of(d)}),!0):!1}}}),E4e()]}const zMt=Jt.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class RT{constructor(t,n){this.specs=t;let i;function r(l){let c=hb.newName();return(i||(i=Object.create(null)))["."+c]=l,c}const s=typeof n.all=="string"?n.all:n.all?r(n.all):void 0,o=n.scope;this.scope=o instanceof Ou?l=>l.prop(wg)==o.data:o?l=>l==o:void 0,this.style=m4e(t.map(l=>({tag:l.tag,class:l.class||r(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=i?new hb(i):null,this.themeType=n.themeType}static define(t,n){return new RT(t,n||{})}}const n7=mn.define(),A4e=mn.define({combine(e){return e.length?[e[0]]:null}});function zN(e){let t=e.facet(n7);return t.length?t:e.facet(A4e)}function T4e(e,t){let n=[HMt],i;return e instanceof RT&&(e.module&&n.push(Jt.styleModule.of(e.module)),i=e.themeType),t!=null&&t.fallback?n.push(A4e.of(e)):i?n.push(n7.computeN([Jt.darkTheme],r=>r.facet(Jt.darkTheme)==(i=="dark")?[e]:[])):n.push(n7.of(e)),n}function Bhn(e,t,n){let i=zN(e),r=null;if(i){for(let s of i)if(!s.scope||n){let o=s.style(t);o&&(r=r?r+" "+o:o)}}return r}class VMt{constructor(t){this.markCache=Object.create(null),this.tree=Yr(t.state),this.decorations=this.buildDeco(t,zN(t.state)),this.decoratedTo=t.viewport.to}update(t){let n=Yr(t.state),i=zN(t.state),r=i!=zN(t.startState),{viewport:s}=t.view,o=t.changes.mapPos(this.decoratedTo,1);n.length=s.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=o):(n!=this.tree||t.viewportChanged||r)&&(this.tree=n,this.decorations=this.buildDeco(t.view,i),this.decoratedTo=s.to)}buildDeco(t,n){if(!n||!this.tree.length)return Fn.none;let i=new tm;for(let{from:r,to:s}of t.visibleRanges)gMt(this.tree,n,(o,l,c)=>{i.add(o,l,this.markCache[c]||(this.markCache[c]=Fn.mark({class:c})))},r,s);return i.finish()}}const HMt=gm.high(ma.fromClass(VMt,{decorations:e=>e.decorations})),qMt=RT.define([{tag:fe.meta,color:"#404740"},{tag:fe.link,textDecoration:"underline"},{tag:fe.heading,textDecoration:"underline",fontWeight:"bold"},{tag:fe.emphasis,fontStyle:"italic"},{tag:fe.strong,fontWeight:"bold"},{tag:fe.strikethrough,textDecoration:"line-through"},{tag:fe.keyword,color:"#708"},{tag:[fe.atom,fe.bool,fe.url,fe.contentSeparator,fe.labelName],color:"#219"},{tag:[fe.literal,fe.inserted],color:"#164"},{tag:[fe.string,fe.deleted],color:"#a11"},{tag:[fe.regexp,fe.escape,fe.special(fe.string)],color:"#e40"},{tag:fe.definition(fe.variableName),color:"#00f"},{tag:fe.local(fe.variableName),color:"#30a"},{tag:[fe.typeName,fe.namespace],color:"#085"},{tag:fe.className,color:"#167"},{tag:[fe.special(fe.variableName),fe.macroName],color:"#256"},{tag:fe.definition(fe.propertyName),color:"#00c"},{tag:fe.comment,color:"#940"},{tag:fe.invalid,color:"#f00"}]),WMt=Jt.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),_4e=1e4,j4e="()[]{}",N4e=mn.define({combine(e){return Ih(e,{afterCursor:!0,brackets:j4e,maxScanDistance:_4e,renderMatch:XMt})}}),KMt=Fn.mark({class:"cm-matchingBracket"}),GMt=Fn.mark({class:"cm-nonmatchingBracket"});function XMt(e){let t=[],n=e.matched?KMt:GMt;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}function wre(e){let t=[],n=e.facet(N4e);for(let i of e.selection.ranges){if(!i.empty)continue;let r=ch(e,i.head,-1,n)||i.head>0&&ch(e,i.head-1,1,n)||n.afterCursor&&(ch(e,i.head,1,n)||i.heade.decorations}),ZMt=[YMt,WMt];function JMt(e={}){return[N4e.of(e),ZMt]}const R4e=new ui;function i7(e,t,n){let i=e.prop(t<0?ui.openedBy:ui.closedBy);if(i)return i;if(e.name.length==1){let r=n.indexOf(e.name);if(r>-1&&r%2==(t<0?1:0))return[n[r+t]]}return null}function r7(e){let t=e.type.prop(R4e);return t?t(e.node):e}function ch(e,t,n,i={}){let r=i.maxScanDistance||_4e,s=i.brackets||j4e,o=Yr(e),l=o.resolveInner(t,n);for(let c=l;c;c=c.parent){let u=i7(c.type,n,s);if(u&&c.from0?t>=d.from&&td.from&&t<=d.to))return eLt(e,t,n,c,d,u,s)}}return tLt(e,t,n,o,l.type,r,s)}function eLt(e,t,n,i,r,s,o){let l=i.parent,c={from:r.from,to:r.to},u=0,d=l==null?void 0:l.cursor();if(d&&(n<0?d.childBefore(i.from):d.childAfter(i.to)))do if(n<0?d.to<=i.from:d.from>=i.to){if(u==0&&s.indexOf(d.type.name)>-1&&d.from0)return null;let u={from:n<0?t-1:t,to:n>0?t+1:t},d=e.doc.iterRange(t,n>0?e.doc.length:0),f=0;for(let h=0;!d.next().done&&h<=s;){let m=d.value;n<0&&(h+=m.length);let g=t+h*n;for(let b=n>0?0:m.length-1,v=n>0?m.length:-1;b!=v;b+=n){let y=o.indexOf(m[b]);if(!(y<0||i.resolveInner(g+b,1).type!=r))if(y%2==0==n>0)f++;else{if(f==1)return{start:u,end:{from:g+b,to:g+b+1},matched:y>>1==c>>1};f--}}n>0&&(h+=m.length)}return d.done?{start:u,matched:!1}:null}function Ore(e,t,n,i=0,r=0){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));let s=r;for(let o=i;o=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.posn}eatSpace(){let t=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t}skipToEnd(){this.pos=this.string.length}skipTo(t){let n=this.string.indexOf(t,this.pos);if(n>-1)return this.pos=n,!0}backUp(t){this.pos-=t}column(){return this.lastColumnPosi?o.toLowerCase():o,s=this.string.substr(this.pos,t.length);return r(s)==r(t)?(n!==!1&&(this.pos+=t.length),!0):null}else{let r=this.string.slice(this.pos).match(t);return r&&r.index>0?null:(r&&n!==!1&&(this.pos+=r[0].length),r)}}current(){return this.string.slice(this.start,this.pos)}}function nLt(e){return{name:e.name||"",token:e.token,blankLine:e.blankLine||(()=>{}),startState:e.startState||(()=>!0),copyState:e.copyState||iLt,indent:e.indent||(()=>null),languageData:e.languageData||{},tokenTable:e.tokenTable||aW,mergeTokens:e.mergeTokens!==!1}}function iLt(e){if(typeof e!="object")return e;let t={};for(let n in e){let i=e[n];t[n]=i instanceof Array?i.slice():i}return t}const kre=new WeakMap;class rW extends Ou{constructor(t){let n=tL(t.languageData),i=nLt(t),r,s=new class extends WM{createParse(o,l,c){return new sLt(r,o,l,c)}};super(n,s,[],t.name),this.topNode=lLt(n,this),r=this,this.streamParser=i,this.stateAfter=new ui({perNode:!0}),this.tokenTable=t.tokenTable?new L4e(i.tokenTable):oLt}static define(t){return new rW(t)}getIndent(t){let n,{overrideIndentation:i}=t.options;i&&(n=kre.get(t.state),n!=null&&n1e4)return null;for(;s=i&&n+t.length<=r&&t.prop(e.stateAfter);if(s)return{state:e.streamParser.copyState(s),pos:n+t.length};for(let o=t.children.length-1;o>=0;o--){let l=t.children[o],c=n+t.positions[o],u=l instanceof Bi&&c=t.length)return t;!r&&n==0&&t.type==e.topNode&&(r=!0);for(let s=t.children.length-1;s>=0;s--){let o=t.positions[s],l=t.children[s],c;if(on&&sW(e,s.tree,0-s.offset,n,l),u;if(c&&c.pos<=i&&(u=P4e(e,s.tree,n+s.offset,c.pos+s.offset,!1)))return{state:c.state,tree:u}}return{state:e.streamParser.startState(r?S0(r):4),tree:Bi.empty}}let sLt=class{constructor(t,n,i,r){this.lang=t,this.input=n,this.fragments=i,this.ranges=r,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=r[r.length-1].to;let s=k0.get(),o=r[0].from,{state:l,tree:c}=rLt(t,i,o,this.to,s==null?void 0:s.state);this.state=l,this.parsedPos=this.chunkStart=o+c.length;for(let u=0;uu.from<=s.viewport.from&&u.to>=s.viewport.from)&&(this.state=this.lang.streamParser.startState(S0(s.state)),s.skipUntilInView(this.parsedPos,s.viewport.from),this.parsedPos=s.viewport.from),this.moveRangeIndex()}advance(){let t=k0.get(),n=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),i=Math.min(n,this.chunkStart+512);for(t&&(i=Math.min(i,t.viewport.to));this.parsedPos=n?this.finish():t&&this.parsedPos>=t.viewport.to?(t.skipUntilInView(this.parsedPos,n),this.finish()):null}stopAt(t){this.stoppedAt=t}lineAfter(t){let n=this.input.chunk(t);if(this.input.lineChunks)n==` +`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=F_(t),i=Vv(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=F_(t),i=Vv(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};function URt(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new FRt||null,prettyErrors:t}}function L5e(e,t={}){const{lineCounter:n,prettyErrors:i}=URt(t),r=new BRt(n==null?void 0:n.addNewLine),s=new PRt(t);let o=null;for(const l of s.compose(r.parse(e),!0,e.length))if(!o)o=l;else if(o.options.logLevel!=="silent"){o.errors.push(new bS(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(o.errors.forEach(tie(e,n)),o.warnings.forEach(tie(e,n))),o}function QRt(e,t,n){let i;const r=L5e(e,n);if(!r)return null;if(r.warnings.forEach(s=>o5e(r.options.logLevel,s)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:i},n))}function qM(e,t,n){let i=null;if(typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){const r=Math.round(n);n=r<1?void 0:r>8?{indent:8}:{indent:r}}if(e===void 0){const{keepUndefined:r}=n??t??{};if(!r)return}return OT(e)&&!i?e.toString(n):new CT(e,i,n).toString(n)}const $5e=1024;let zRt=0,md=class{constructor(t,n){this.from=t,this.to=n}};class ui{constructor(t={}){this.id=zRt++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=t.combine||null}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof t!="function"&&(t=Za.match(t)),n=>{let i=t(n);return i===void 0?null:[this,i]}}}ui.closedBy=new ui({deserialize:e=>e.split(" ")});ui.openedBy=new ui({deserialize:e=>e.split(" ")});ui.group=new ui({deserialize:e=>e.split(" ")});ui.isolate=new ui({deserialize:e=>{if(e&&e!="rtl"&&e!="ltr"&&e!="auto")throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}});ui.contextHash=new ui({perNode:!0});ui.lookAhead=new ui({perNode:!0});ui.mounted=new ui({perNode:!0});class gw{constructor(t,n,i,r=!1){this.tree=t,this.overlay=n,this.parser=i,this.bracketed=r}static get(t){return t&&t.props&&t.props[ui.mounted.id]}}const VRt=Object.create(null);class Za{constructor(t,n,i,r=0){this.name=t,this.props=n,this.id=i,this.flags=r}static define(t){let n=t.props&&t.props.length?Object.create(null):VRt,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),r=new Za(t.name||"",n,t.id,i);if(t.props){for(let s of t.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[s[0].id]=s[1]}}return r}prop(t){return this.props[t.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(t){if(typeof t=="string"){if(this.name==t)return!0;let n=this.prop(ui.group);return n?n.indexOf(t)>-1:!1}return this.id==t}static match(t){let n=Object.create(null);for(let i in t)for(let r of i.split(" "))n[r]=t[i];return i=>{for(let r=i.prop(ui.group),s=-1;s<(r?r.length:0);s++){let o=n[s<0?i.name:r[s]];if(o)return o}}}}Za.none=new Za("",Object.create(null),0,8);class hO{constructor(t){this.types=t;for(let n=0;n0;for(let c=this.cursor(o|Sr.IncludeAnonymous);;){let u=!1;if(c.from<=s&&c.to>=r&&(!l&&c.type.isAnonymous||n(c)!==!1)){if(c.firstChild())continue;u=!0}for(;u&&i&&(l||!c.type.isAnonymous)&&i(c),!c.nextSibling();){if(!c.parent())return;u=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let n in this.props)t.push([+n,this.props[n]]);return t}balance(t={}){return this.children.length<=8?this:Dq(Za.none,this.children,this.positions,0,this.children.length,0,this.length,(n,i,r)=>new Ui(this.type,n,i,r,this.propValues),t.makeTree||((n,i,r)=>new Ui(Za.none,n,i,r)))}static build(t){return KRt(t)}}Ui.empty=new Ui(Za.none,[],[],0);class Iq{constructor(t,n){this.buffer=t,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Iq(this.buffer,this.index)}}class fb{constructor(t,n,i){this.buffer=t,this.length=n,this.set=i}get type(){return Za.none}toString(){let t=[];for(let n=0;n0));c=o[c+3]);return l}slice(t,n,i){let r=this.buffer,s=new Uint16Array(n-t),o=0;for(let l=t,c=0;l=t&&nt;case 1:return n<=t&&i>t;case 2:return i>t;case 4:return!0}}function RC(e,t,n,i){for(var r;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to0?l.length:-1;t!=u;t+=n){let d=l[t],f=c[t]+o.from,h;if(!(!(s&Sr.EnterBracketed&&d instanceof Ui&&(h=gw.get(d))&&!h.overlay&&h.bracketed&&i>=f&&i<=f+d.length)&&!F5e(r,i,f,f+d.length))){if(d instanceof fb){if(s&Sr.ExcludeBuffers)continue;let m=d.findChild(0,d.buffer.length,n,i-f,r);if(m>-1)return new lh(new HRt(o,d,t,f),null,m)}else if(s&Sr.IncludeAnonymous||!d.type.isAnonymous||Pq(d)){let m;if(!(s&Sr.IgnoreMounts)&&(m=gw.get(d))&&!m.overlay)return new jl(m.tree,f,t,o);let g=new jl(d,f,t,o);return s&Sr.IncludeAnonymous||!g.type.isAnonymous?g:g.nextChild(n<0?d.children.length-1:0,n,i,r,s)}}}if(s&Sr.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?t=o.index+n:t=n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}prop(t){return this._tree.prop(t)}enter(t,n,i=0){let r;if(!(i&Sr.IgnoreOverlays)&&(r=gw.get(this._tree))&&r.overlay){let s=t-this.from,o=i&Sr.EnterBracketed&&r.bracketed;for(let{from:l,to:c}of r.overlay)if((n>0||o?l<=s:l=s:c>s))return new jl(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,i)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function lie(e,t,n,i){let r=e.cursor(),s=[];if(!r.firstChild())return s;if(n!=null){for(let o=!1;!o;)if(o=r.type.is(n),!r.nextSibling())return s}for(;;){if(i!=null&&r.type.is(i))return s;if(r.type.is(t)&&s.push(r.node),!r.nextSibling())return i==null?s:[]}}function v9(e,t,n=t.length-1){for(let i=e;n>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(t[n]&&t[n]!=i.name)return!1;n--}}return!0}class HRt{constructor(t,n,i,r){this.parent=t,this.buffer=n,this.index=i,this.start=r}}class lh extends B5e{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,n,i){super(),this.context=t,this._parent=n,this.index=i,this.type=t.buffer.set.types[t.buffer.buffer[i]]}child(t,n,i){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t,n-this.context.start,i);return s<0?null:new lh(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}prop(t){return this.type.prop(t)}enter(t,n,i=0){if(i&Sr.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return s<0?null:new lh(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new lh(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new lh(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],n=[],{buffer:i}=this.context,r=this.index+4,s=i.buffer[this.index+3];if(s>r){let o=i.buffer[this.index+1];t.push(i.slice(r,s,o)),n.push(0)}return new Ui(this.type,t,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function U5e(e){if(!e.length)return null;let t=0,n=e[0];for(let s=1;sn.from||o.to=t){let l=new jl(o.tree,o.overlay[0].from+s.from,-1,s);(r||(r=[i])).push(RC(l,t,n,!1))}}return r?U5e(r):i}class FI{get name(){return this.type.name}constructor(t,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~Sr.EnterBracketed,t instanceof jl)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let i=t._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=t,this.yieldBuf(t.index)}}yieldNode(t){return t?(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0):!1}yieldBuf(t,n){this.index=t;let{start:i,buffer:r}=this.buffer;return this.type=n||r.set.types[r.buffer[t]],this.from=i+r.buffer[t+1],this.to=i+r.buffer[t+2],!0}yield(t){return t?t instanceof jl?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,n,i){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,n,i,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],t,n-this.buffer.start,i);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,n,i=this.mode){return this.buffer?i&Sr.ExcludeBuffers?!1:this.enterChild(1,t,n):this.yield(this._tree.enter(t,n,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Sr.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&Sr.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode)):!1;let{buffer:n}=this.buffer,i=this.stack.length-1;if(t<0){let r=i<0?0:this.stack[i]+4;if(this.index!=r)return this.yieldBuf(n.findChild(r,this.index,-1,0,4))}else{let r=n.buffer[this.index+3];if(r<(i<0?n.buffer.length:n.buffer[this.stack[i]+3]))return this.yieldBuf(r)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let n,i,{buffer:r}=this;if(r){if(t>0){if(this.index-1)for(let s=n+t,o=t<0?-1:i._tree.children.length;s!=o;s+=t){let l=i._tree.children[s];if(this.mode&Sr.IncludeAnonymous||l instanceof fb||!l.type.isAnonymous||Pq(l))return!1}return!0}move(t,n){if(n&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,n=0){for(;(this.from==this.to||(n<1?this.from>=t:this.from>t)||(n>-1?this.to<=t:this.to=0;){for(let o=t;o;o=o._parent)if(o.index==r){if(r==this.index)return o;n=o,i=s+1;break e}r=this.stack[--s]}for(let r=i;r=0;s--){if(s<0)return v9(this._tree,t,r);let o=i[n.buffer[this.stack[s]]];if(!o.isAnonymous){if(t[r]&&t[r]!=o.name)return!1;r--}}return!0}}function Pq(e){return e.children.some(t=>t instanceof fb||!t.type.isAnonymous||Pq(t))}function KRt(e){var t;let{buffer:n,nodeSet:i,maxBufferLength:r=$5e,reused:s=[],minRepeatType:o=i.types.length}=e,l=Array.isArray(n)?new Iq(n,n.length):n,c=i.types,u=0,d=0;function f(k,S,C,E,j,T){let{id:R,start:A,end:N,size:D}=l,I=d,P=u;if(D<0)if(l.next(),D==-1){let V=s[R];C.push(V),E.push(A-k);return}else if(D==-3){u=R;return}else if(D==-4){d=R;return}else throw new RangeError(`Unrecognized record size: ${D}`);let _=c[R],L,F,M=A-k;if(N-A<=r&&(F=v(l.pos-S,j))){let V=new Uint16Array(F.size-F.skip),q=l.pos-F.size,U=V.length;for(;l.pos>q;)U=y(F.start,V,U);L=new fb(V,N-F.start,i),M=F.start-k}else{let V=l.pos-D;l.next();let q=[],U=[],Z=R>=o?R:-1,z=0,ee=N;for(;l.pos>V;)Z>=0&&l.id==Z&&l.size>=0?(l.end<=ee-r&&(g(q,U,A,z,l.end,ee,Z,I,P),z=q.length,ee=l.end),l.next()):T>2500?h(A,V,q,U):f(A,V,q,U,Z,T+1);if(Z>=0&&z>0&&z-1&&z>0){let ne=m(_,P);L=Dq(_,q,U,0,q.length,0,N-A,ne,ne)}else L=b(_,q,U,N-A,I-N,P)}C.push(L),E.push(M)}function h(k,S,C,E){let j=[],T=0,R=-1;for(;l.pos>S;){let{id:A,start:N,end:D,size:I}=l;if(I>4)l.next();else{if(R>-1&&N=0;D-=3)A[I++]=j[D],A[I++]=j[D+1]-N,A[I++]=j[D+2]-N,A[I++]=I;C.push(new fb(A,j[2]-N,i)),E.push(N-k)}}function m(k,S){return(C,E,j)=>{let T=0,R=C.length-1,A,N;if(R>=0&&(A=C[R])instanceof Ui){if(!R&&A.type==k&&A.length==j)return A;(N=A.prop(ui.lookAhead))&&(T=E[R]+A.length+N)}return b(k,C,E,j,T,S)}}function g(k,S,C,E,j,T,R,A,N){let D=[],I=[];for(;k.length>E;)D.push(k.pop()),I.push(S.pop()+C-j);k.push(b(i.types[R],D,I,T-j,A-T,N)),S.push(j-C)}function b(k,S,C,E,j,T,R){if(T){let A=[ui.contextHash,T];R=R?[A].concat(R):[A]}if(j>25){let A=[ui.lookAhead,j];R=R?[A].concat(R):[A]}return new Ui(k,S,C,E,R)}function v(k,S){let C=l.fork(),E=0,j=0,T=0,R=C.end-r,A={size:0,start:0,skip:0};e:for(let N=C.pos-k;C.pos>N;){let D=C.size;if(C.id==S&&D>=0){A.size=E,A.start=j,A.skip=T,T+=4,E+=4,C.next();continue}let I=C.pos-D;if(D<0||I=o?4:0,_=C.start;for(C.next();C.pos>I;){if(C.size<0)if(C.size==-3||C.size==-4)P+=4;else break e;else C.id>=o&&(P+=4);C.next()}j=_,E+=D,T+=P}return(S<0||E==k)&&(A.size=E,A.start=j,A.skip=T),A.size>4?A:void 0}function y(k,S,C){let{id:E,start:j,end:T,size:R}=l;if(l.next(),R>=0&&E4){let N=l.pos-(R-4);for(;l.pos>N;)C=y(k,S,C)}S[--C]=A,S[--C]=T-k,S[--C]=j-k,S[--C]=E}else R==-3?u=E:R==-4&&(d=E);return C}let w=[],x=[];for(;l.pos>0;)f(e.start||0,e.bufferStart||0,w,x,-1,0);let O=(t=e.length)!==null&&t!==void 0?t:w.length?x[0]+w[0].length:0;return new Ui(c[e.topID],w.reverse(),x.reverse(),O)}const cie=new WeakMap;function LN(e,t){if(!e.isAnonymous||t instanceof fb||t.type!=e)return 1;let n=cie.get(t);if(n==null){n=1;for(let i of t.children){if(i.type!=e||!(i instanceof Ui)){n=1;break}n+=LN(e,i)}cie.set(t,n)}return n}function Dq(e,t,n,i,r,s,o,l,c){let u=0;for(let g=i;g=d)break;S+=C}if(x==O+1){if(S>d){let C=g[O];m(C.children,C.positions,0,C.children.length,b[O]+w);continue}f.push(g[O])}else{let C=b[x-1]+g[x-1].length-k;f.push(Dq(e,g,b,O,x,k,C,null,c))}h.push(k+w-s)}}return m(t,n,i,r,0),(l||c)(f,h,o)}class Mq{constructor(){this.map=new WeakMap}setBuffer(t,n,i){let r=this.map.get(t);r||this.map.set(t,r=new Map),r.set(n,i)}getBuffer(t,n){let i=this.map.get(t);return i&&i.get(n)}set(t,n){t instanceof lh?this.setBuffer(t.context.buffer,t.index,n):t instanceof jl&&this.map.set(t.tree,n)}get(t){return t instanceof lh?this.getBuffer(t.context.buffer,t.index):t instanceof jl?this.map.get(t.tree):void 0}cursorSet(t,n){t.buffer?this.setBuffer(t.buffer.buffer,t.index,n):this.map.set(t.tree,n)}cursorGet(t){return t.buffer?this.getBuffer(t.buffer.buffer,t.index):this.map.get(t.tree)}}class Up{constructor(t,n,i,r,s=!1,o=!1){this.from=t,this.to=n,this.tree=i,this.offset=r,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],i=!1){let r=[new Up(0,t.length,t,0,!1,i)];for(let s of n)s.to>t.length&&r.push(s);return r}static applyChanges(t,n,i=128){if(!n.length)return t;let r=[],s=1,o=t.length?t[0]:null;for(let l=0,c=0,u=0;;l++){let d=l=i)for(;o&&o.from=h.from||f<=h.to||u){let m=Math.max(h.from,c)-u,g=Math.min(h.to,f)-u;h=m>=g?null:new Up(m,g,h.tree,h.offset+u,l>0,!!d)}if(h&&r.push(h),o.to>f)break;o=snew md(r.from,r.to)):[new md(0,0)]:[new md(0,t.length)],this.createParse(t,n||[],i)}parse(t,n,i){let r=this.startParse(t,n,i);for(;;){let s=r.advance();if(s)return s}}}class GRt{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,n){return this.string.slice(t,n)}}function Q5e(e){return(t,n,i,r)=>new YRt(t,e,n,i,r)}class uie{constructor(t,n,i,r,s,o){this.parser=t,this.parse=n,this.overlay=i,this.bracketed=r,this.target=s,this.from=o}}function die(e){if(!e.length||e.some(t=>t.from>=t.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(e))}class XRt{constructor(t,n,i,r,s,o,l,c){this.parser=t,this.predicate=n,this.mounts=i,this.index=r,this.start=s,this.bracketed=o,this.target=l,this.prev=c,this.depth=0,this.ranges=[]}}const x9=new ui({perNode:!0});class YRt{constructor(t,n,i,r,s){this.nest=n,this.input=i,this.fragments=r,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=t}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new Ui(i.type,i.children,i.positions,i.length,i.propValues.concat([[x9,this.stoppedAt]]))),i}let t=this.inner[this.innerDone],n=t.parse.advance();if(n){this.innerDone++;let i=Object.assign(Object.create(null),t.target.props);i[ui.mounted.id]=new gw(n,t.overlay,t.parser,t.bracketed),t.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let t=this.input.length;for(let n=this.innerDone;n=this.stoppedAt)l=!1;else if(t.hasNode(r)){if(n){let u=n.mounts.find(d=>d.frag.from<=r.from&&d.frag.to>=r.to&&d.mount.overlay);if(u)for(let d of u.mount.overlay){let f=d.from+u.pos,h=d.to+u.pos;f>=r.from&&h<=r.to&&!n.ranges.some(m=>m.fromf)&&n.ranges.push({from:f,to:h})}}l=!1}else if(i&&(o=ZRt(i.ranges,r.from,r.to)))l=o!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.fromnew md(f.from-r.from,f.to-r.from)):null,!!s.bracketed,r.tree,d.length?d[0].from:r.from)),s.overlay?d.length&&(i={ranges:d,depth:0,prev:i}):l=!1}}else if(n&&(c=n.predicate(r))&&(c===!0&&(c=new md(r.from,r.to)),c.from=0&&n.ranges[u].to==c.from?n.ranges[u]={from:n.ranges[u].from,to:c.to}:n.ranges.push(c)}if(l&&r.firstChild())n&&n.depth++,i&&i.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(n&&!--n.depth){let u=pie(this.ranges,n.ranges);u.length&&(die(u),this.inner.splice(n.index,0,new uie(n.parser,n.parser.startParse(this.input,mie(n.mounts,u),u),n.ranges.map(d=>new md(d.from-n.start,d.to-n.start)),n.bracketed,n.target,u[0].from))),n=n.prev}i&&!--i.depth&&(i=i.prev)}}}}function ZRt(e,t,n){for(let i of e){if(i.from>=n)break;if(i.to>t)return i.from<=t&&i.to>=n?2:1}return 0}function fie(e,t,n,i,r,s){if(t=t&&n.enter(i,1,Sr.IgnoreOverlays|Sr.ExcludeBuffers)))if(n.to<=t)n.next(!1)||(this.done=!0);else break}hasNode(t){if(this.moveTo(t.from),!this.done&&this.cursor.from+this.offset==t.from&&this.cursor.tree)for(let n=this.cursor.tree;;){if(n==t.tree)return!0;if(n.children.length&&n.positions[0]==0&&n.children[0]instanceof Ui)n=n.children[0];else break}return!1}}let eIt=class{constructor(t){var n;if(this.fragments=t,this.curTo=0,this.fragI=0,t.length){let i=this.curFrag=t[0];this.curTo=(n=i.tree.prop(x9))!==null&&n!==void 0?n:i.to,this.inner=new hie(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(t){for(;this.curFrag&&t.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=t.from&&this.curTo>=t.to&&this.inner.hasNode(t)}nextFrag(){var t;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let n=this.curFrag=this.fragments[this.fragI];this.curTo=(t=n.tree.prop(x9))!==null&&t!==void 0?t:n.to,this.inner=new hie(n.tree,-n.offset)}}findMounts(t,n){var i;let r=[];if(this.inner){this.inner.cursor.moveTo(t,1);for(let s=this.inner.cursor.node;s;s=s.parent){let o=(i=s.tree)===null||i===void 0?void 0:i.prop(ui.mounted);if(o&&o.parser==n)for(let l=this.fragI;l=s.to)break;c.tree==this.curFrag.tree&&r.push({frag:c,pos:s.from-c.offset,mount:o})}}}return r}};function pie(e,t){let n=null,i=t;for(let r=1,s=0;r=l)break;c.to<=o||(n||(i=n=t.slice()),c.froml&&n.splice(s+1,0,new md(l,c.to))):c.to>l?n[s--]=new md(l,c.to):n.splice(s--,1))}}return i}function tIt(e,t,n,i){let r=0,s=0,o=!1,l=!1,c=-1e9,u=[];for(;;){let d=r==e.length?1e9:o?e[r].to:e[r].from,f=s==t.length?1e9:l?t[s].to:t[s].from;if(o!=l){let h=Math.max(c,n),m=Math.min(d,f,i);hnew md(h.from+i,h.to+i)),f=tIt(t,d,c,u);for(let h=0,m=c;;h++){let g=h==f.length,b=g?u:f[h].from;if(b>m&&n.push(new Up(m,b,r.tree,-o,s.from>=m||s.openStart,s.to<=b||s.openEnd)),g)break;m=f[h].to}}else n.push(new Up(c,u,r.tree,-o,s.from>=o||s.openStart,s.to<=l||s.openEnd))}return n}let w9=[],z5e=[];(()=>{let e="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(t=>t?parseInt(t,36):1);for(let t=0,n=0;t>1;if(e=z5e[i])t=i+1;else return!0;if(t==n)return!1}}function gie(e){return e>=127462&&e<=127487}const bie=8205;function iIt(e,t,n=!0,i=!0){return(n?V5e:rIt)(e,t,i)}function V5e(e,t,n){if(t==e.length)return t;t&&H5e(e.charCodeAt(t))&&q5e(e.charCodeAt(t-1))&&t--;let i=K4(e,t);for(t+=yie(i);t=0&&gie(K4(e,o));)s++,o-=2;if(s%2==0)break;t+=2}else break}return t}function rIt(e,t,n){for(;t>1;){let i=V5e(e,t-2,n);if(i=56320&&e<57344}function q5e(e){return e>=55296&&e<56320}function yie(e){return e<65536?1:2}let xr=class W5e{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,n,i){[t,n]=u1(this,t,n);let r=[];return this.decompose(0,t,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(n,this.length,r,1),eh.from(r,this.length-(n-t)+i.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,n=this.length){[t,n]=u1(this,t,n);let i=[];return this.decompose(t,n,i,0),eh.from(i,n-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let n=this.scanIdentical(t,1),i=this.length-this.scanIdentical(t,-1),r=new vE(this),s=new vE(t);for(let o=n,l=n;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=i)return!0}}iter(t=1){return new vE(this,t)}iterRange(t,n=this.length){return new K5e(this,t,n)}iterLines(t,n){let i;if(t==null)i=this.iter();else{n==null&&(n=this.lines+1);let r=this.line(t).from;i=this.iterRange(r,Math.max(r,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new G5e(i)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(t.length==0)throw new RangeError("A document must have at least one line");return t.length==1&&!t[0]?W5e.empty:t.length<=32?new wa(t):eh.from(wa.split(t,[]))}};class wa extends xr{constructor(t,n=sIt(t)){super(),this.text=t,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(t,n,i,r){for(let s=0;;s++){let o=this.text[s],l=r+o.length;if((n?i:l)>=t)return new aIt(r,l,i,o);r=l+1,i++}}decompose(t,n,i,r){let s=t<=0&&n>=this.length?this:new wa(vie(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(r&1){let o=i.pop(),l=$N(s.text,o.text.slice(),0,s.length);if(l.length<=32)i.push(new wa(l,o.length+s.length));else{let c=l.length>>1;i.push(new wa(l.slice(0,c)),new wa(l.slice(c)))}}else i.push(s)}replace(t,n,i){if(!(i instanceof wa))return super.replace(t,n,i);[t,n]=u1(this,t,n);let r=$N(this.text,$N(i.text,vie(this.text,0,t)),n),s=this.length+i.length-(n-t);return r.length<=32?new wa(r,s):eh.from(wa.split(r,[]),s)}sliceString(t,n=this.length,i=` +`){[t,n]=u1(this,t,n);let r="";for(let s=0,o=0;s<=n&&ot&&o&&(r+=i),ts&&(r+=l.slice(Math.max(0,t-s),n-s)),s=c+1}return r}flatten(t){for(let n of this.text)t.push(n)}scanIdentical(){return 0}static split(t,n){let i=[],r=-1;for(let s of t)i.push(s),r+=s.length+1,i.length==32&&(n.push(new wa(i,r)),i=[],r=-1);return r>-1&&n.push(new wa(i,r)),n}}class eh extends xr{constructor(t,n){super(),this.children=t,this.length=n,this.lines=0;for(let i of t)this.lines+=i.lines}lineInner(t,n,i,r){for(let s=0;;s++){let o=this.children[s],l=r+o.length,c=i+o.lines-1;if((n?c:l)>=t)return o.lineInner(t,n,i,r);r=l+1,i=c+1}}decompose(t,n,i,r){for(let s=0,o=0;o<=n&&s=o){let u=r&((o<=t?1:0)|(c>=n?2:0));o>=t&&c<=n&&!u?i.push(l):l.decompose(t-o,n-o,i,u)}o=c+1}}replace(t,n,i){if([t,n]=u1(this,t,n),i.lines=s&&n<=l){let c=o.replace(t-s,n-s,i),u=this.lines-o.lines+c.lines;if(c.lines>4&&c.lines>u>>6){let d=this.children.slice();return d[r]=c,new eh(d,this.length-(n-t)+i.length)}return super.replace(s,l,c)}s=l+1}return super.replace(t,n,i)}sliceString(t,n=this.length,i=` +`){[t,n]=u1(this,t,n);let r="";for(let s=0,o=0;st&&s&&(r+=i),to&&(r+=l.sliceString(t-o,n-o,i)),o=c+1}return r}flatten(t){for(let n of this.children)n.flatten(t)}scanIdentical(t,n){if(!(t instanceof eh))return 0;let i=0,[r,s,o,l]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;r+=n,s+=n){if(r==o||s==l)return i;let c=this.children[r],u=t.children[s];if(c!=u)return i+c.scanIdentical(u,n);i+=c.length+1}}static from(t,n=t.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let m of t)i+=m.lines;if(i<32){let m=[];for(let g of t)g.flatten(m);return new wa(m,n)}let r=Math.max(32,i>>5),s=r<<1,o=r>>1,l=[],c=0,u=-1,d=[];function f(m){let g;if(m.lines>s&&m instanceof eh)for(let b of m.children)f(b);else m.lines>o&&(c>o||!c)?(h(),l.push(m)):m instanceof wa&&c&&(g=d[d.length-1])instanceof wa&&m.lines+g.lines<=32?(c+=m.lines,u+=m.length+1,d[d.length-1]=new wa(g.text.concat(m.text),g.length+1+m.length)):(c+m.lines>r&&h(),c+=m.lines,u+=m.length+1,d.push(m))}function h(){c!=0&&(l.push(d.length==1?d[0]:eh.from(d,u)),u=-1,c=d.length=0)}for(let m of t)f(m);return h(),l.length==1?l[0]:new eh(l,n)}}xr.empty=new wa([""],0);function sIt(e){let t=-1;for(let n of e)t+=n.length+1;return t}function $N(e,t,n=0,i=1e9){for(let r=0,s=0,o=!0;s=n&&(c>i&&(l=l.slice(0,i-r)),r0?1:(t instanceof wa?t.text.length:t.children.length)<<1]}nextInner(t,n){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,r=this.nodes[i],s=this.offsets[i],o=s>>1,l=r instanceof wa?r.text.length:r.children.length;if(o==(n>0?l:0)){if(i==0)return this.done=!0,this.value="",this;n>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(n>0?0:1)){if(this.offsets[i]+=n,t==0)return this.lineBreak=!0,this.value=` +`,this;t--}else if(r instanceof wa){let c=r.text[o+(n<0?-1:0)];if(this.offsets[i]+=n,c.length>Math.max(0,t))return this.value=t==0?c:n>0?c.slice(t):c.slice(0,c.length-t),this;t-=c.length}else{let c=r.children[o+(n<0?-1:0)];t>c.length?(t-=c.length,this.offsets[i]+=n):(n<0&&this.offsets[i]--,this.nodes.push(c),this.offsets.push(n>0?1:(c instanceof wa?c.text.length:c.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class K5e{constructor(t,n,i){this.value="",this.done=!1,this.cursor=new vE(t,n>i?-1:1),this.pos=n>i?t.length:0,this.from=Math.min(n,i),this.to=Math.max(n,i)}nextInner(t,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let i=n<0?this.pos-this.from:this.to-this.pos;t>i&&(t=i),i-=t;let{value:r}=this.cursor.next(t);return this.pos+=(r.length+t)*n,this.value=r.length<=i?r:n<0?r.slice(r.length-i):r.slice(0,i),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class G5e{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:n,lineBreak:i,value:r}=this.inner.next(t);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(xr.prototype[Symbol.iterator]=function(){return this.iter()},vE.prototype[Symbol.iterator]=K5e.prototype[Symbol.iterator]=G5e.prototype[Symbol.iterator]=function(){return this});let aIt=class{constructor(t,n,i,r){this.from=t,this.to=n,this.number=i,this.text=r}get length(){return this.to-this.from}};function u1(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function Ro(e,t,n=!0,i=!0){return iIt(e,t,n,i)}function oIt(e){return e>=56320&&e<57344}function lIt(e){return e>=55296&&e<56320}function Nc(e,t){let n=e.charCodeAt(t);if(!lIt(n)||t+1==e.length)return n;let i=e.charCodeAt(t+1);return oIt(i)?(n-55296<<10)+(i-56320)+65536:n}function Lq(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function th(e){return e<65536?1:2}const O9=/\r\n?|\n/;var il=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(il||(il={}));class yh{constructor(t){this.sections=t}get length(){let t=0;for(let n=0;nt)return s+(t-r);s+=l}else{if(i!=il.Simple&&u>=t&&(i==il.TrackDel&&rt||i==il.TrackBefore&&rt))return null;if(u>t||u==t&&n<0&&!l)return t==r||n<0?s:s+c;s+=c}r=u}if(t>r)throw new RangeError(`Position ${t} is out of range for changeset of length ${r}`);return s}touchesRange(t,n=t){for(let i=0,r=0;i=0&&r<=n&&l>=t)return rn?"cover":!0;r=l}return!1}toString(){let t="";for(let n=0;n=0?":"+r:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new yh(t)}static create(t){return new yh(t)}}class lo extends yh{constructor(t,n){super(t),this.inserted=n}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return k9(this,(n,i,r,s,o)=>t=t.replace(r,r+(i-n),o),!1),t}mapDesc(t,n=!1){return S9(this,t,n,!0)}invert(t){let n=this.sections.slice(),i=[];for(let r=0,s=0;r=0){n[r]=l,n[r+1]=o;let c=r>>1;for(;i.length0&&wg(i,n,s.text),s.forward(d),l+=d}let u=t[o++];for(;l>1].toJSON()))}return t}static of(t,n,i){let r=[],s=[],o=0,l=null;function c(d=!1){if(!d&&!r.length)return;oh||f<0||h>n)throw new RangeError(`Invalid change range ${f} to ${h} (in doc of length ${n})`);let g=m?typeof m=="string"?xr.of(m.split(i||O9)):m:xr.empty,b=g.length;if(f==h&&b==0)return;fo&&Cl(r,f-o,-1),Cl(r,h-f,b),wg(s,r,g),o=h}}return u(t),c(!l),l}static empty(t){return new lo(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],i=[];for(let r=0;rl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)n.push(s[0],0);else{for(;i.length=0&&n<=0&&n==e[r+1]?e[r]+=t:r>=0&&t==0&&e[r]==0?e[r+1]+=n:i?(e[r]+=t,e[r+1]+=n):e.push(t,n)}function wg(e,t,n){if(n.length==0)return;let i=t.length-2>>1;if(i>1])),!(n||o==e.sections.length||e.sections[o+1]<0);)l=e.sections[o++],c=e.sections[o++];t(r,u,s,d,f),r=u,s=d}}}function S9(e,t,n,i=!1){let r=[],s=i?[]:null,o=new IC(e),l=new IC(t);for(let c=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let u=Math.min(o.len,l.len);Cl(r,u,-1),o.forward(u),l.forward(u)}else if(l.ins>=0&&(o.ins<0||c==o.i||o.off==0&&(l.len=0&&c=0){let u=0,d=o.len;for(;d;)if(l.ins==-1){let f=Math.min(d,l.len);u+=f,d-=f,l.forward(f)}else if(l.ins==0&&l.lenc||o.ins>=0&&o.len>c)&&(l||i.length>u),s.forward2(c),o.forward(c)}}}}class IC{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i>1;return n>=t.length?xr.empty:t[n]}textBit(t){let{inserted:n}=this.set,i=this.i-2>>1;return i>=n.length&&!t?xr.empty:n[i].slice(this.off,t==null?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){this.ins==-1?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class og{constructor(t,n,i,r){this.from=t,this.to=n,this.flags=i,this.goalColumn=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let t=this.flags&7;return t==7?null:t}map(t,n=-1){let i,r;return this.empty?i=r=t.mapPos(this.from,n):(i=t.mapPos(this.from,1),r=t.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new og(i,r,this.flags,this.goalColumn)}extend(t,n=t,i=0){if(t<=this.anchor&&n>=this.anchor)return ht.range(t,n,void 0,void 0,i);let r=Math.abs(t-this.anchor)>Math.abs(n-this.anchor)?t:n;return ht.range(this.anchor,r,void 0,void 0,i)}eq(t,n=!1){return this.anchor==t.anchor&&this.head==t.head&&this.goalColumn==t.goalColumn&&(!n||!this.empty||this.assoc==t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return ht.range(t.anchor,t.head)}static create(t,n,i,r){return new og(t,n,i,r)}}class ht{constructor(t,n){this.ranges=t,this.mainIndex=n}map(t,n=-1){return t.empty?this:ht.create(this.ranges.map(i=>i.map(t,n)),this.mainIndex)}eq(t,n=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let i=0;it.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!="number"||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new ht(t.ranges.map(n=>og.fromJSON(n)),t.main)}static single(t,n=t){return new ht([ht.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,r=0;rr.from-s.from),n=t.indexOf(i);for(let r=1;rs.head?ht.range(c,l):ht.range(l,c))}}return new ht(t,n)}}function Y5e(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let $q=0;class mn{constructor(t,n,i,r,s){this.combine=t,this.compareInput=n,this.compare=i,this.isStatic=r,this.id=$q++,this.default=t([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(t={}){return new mn(t.combine||(n=>n),t.compareInput||((n,i)=>n===i),t.compare||(t.combine?(n,i)=>n===i:Fq),!!t.static,t.enables)}of(t){return new FN([],this,0,t)}compute(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new FN(t,this,1,n)}computeN(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new FN(t,this,2,n)}from(t,n){return n||(n=i=>i),this.compute([t],i=>n(i.field(t)))}}function Fq(e,t){return e==t||e.length==t.length&&e.every((n,i)=>n===t[i])}class FN{constructor(t,n,i,r){this.dependencies=t,this.facet=n,this.type=i,this.value=r,this.id=$q++}dynamicSlot(t){var n;let i=this.value,r=this.facet.compareInput,s=this.id,o=t[s]>>1,l=this.type==2,c=!1,u=!1,d=[];for(let f of this.dependencies)f=="doc"?c=!0:f=="selection"?u=!0:((n=t[f.id])!==null&&n!==void 0?n:1)&1||d.push(t[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,h){if(c&&h.docChanged||u&&(h.docChanged||h.selection)||E9(f,d)){let m=i(f);if(l?!xie(m,f.values[o],r):!r(m,f.values[o]))return f.values[o]=m,1}return 0},reconfigure:(f,h)=>{let m,g=h.config.address[s];if(g!=null){let b=UI(h,g);if(this.dependencies.every(v=>v instanceof mn?h.facet(v)===f.facet(v):v instanceof dl?h.field(v,!1)==f.field(v,!1):!0)||(l?xie(m=i(f),b,r):r(m=i(f),b)))return f.values[o]=b,0}else m=i(f);return f.values[o]=m,1}}}get extension(){return this}}function xie(e,t,n){if(e.length!=t.length)return!1;for(let i=0;ie[c.id]),r=n.map(c=>c.type),s=i.filter(c=>!(c&1)),o=e[t.id]>>1;function l(c){let u=[];for(let d=0;di===r),t);return t.provide&&(n.provides=t.provide(n)),n}create(t){let n=t.facet(U_).find(i=>i.field==this);return((n==null?void 0:n.create)||this.createF)(t)}slot(t){let n=t[this.id]>>1;return{create:i=>(i.values[n]=this.create(i),1),update:(i,r)=>{let s=i.values[n],o=this.updateF(s,r);return this.compareF(s,o)?0:(i.values[n]=o,1)},reconfigure:(i,r)=>{let s=i.facet(U_),o=r.facet(U_),l;return(l=s.find(c=>c.field==this))&&l!=o.find(c=>c.field==this)?(i.values[n]=l.create(i),1):r.config.address[this.id]!=null?(i.values[n]=r.field(this),0):(i.values[n]=this.create(i),1)}}}init(t){return[this,U_.of({field:this,create:t})]}get extension(){return this}}const Oy={lowest:4,low:3,default:2,high:1,highest:0};function kk(e){return t=>new Z5e(t,e)}const bm={highest:kk(Oy.highest),high:kk(Oy.high),default:kk(Oy.default),low:kk(Oy.low),lowest:kk(Oy.lowest)};class Z5e{constructor(t,n){this.inner=t,this.prec=n}get extension(){return this}}class KM{of(t){return new C9(this,t)}reconfigure(t){return KM.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class C9{constructor(t,n){this.compartment=t,this.inner=n}get extension(){return this}}class BI{constructor(t,n,i,r,s,o){for(this.base=t,this.compartments=n,this.dynamicSlots=i,this.address=r,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(t,n,i){let r=[],s=Object.create(null),o=new Map;for(let h of uIt(t,n,o))h instanceof dl?r.push(h):(s[h.facet.id]||(s[h.facet.id]=[])).push(h);let l=Object.create(null),c=[],u=[];for(let h of r)l[h.id]=u.length<<1,u.push(m=>h.slot(m));let d=i==null?void 0:i.config.facets;for(let h in s){let m=s[h],g=m[0].facet,b=d&&d[h]||[];if(m.every(v=>v.type==0))if(l[g.id]=c.length<<1|1,Fq(b,m))c.push(i.facet(g));else{let v=g.combine(m.map(y=>y.value));c.push(i&&g.compare(v,i.facet(g))?i.facet(g):v)}else{for(let v of m)v.type==0?(l[v.id]=c.length<<1|1,c.push(v.value)):(l[v.id]=u.length<<1,u.push(y=>v.dynamicSlot(y)));l[g.id]=u.length<<1,u.push(v=>cIt(v,g,m))}}let f=u.map(h=>h(l));return new BI(t,o,f,l,c,s)}}function uIt(e,t,n){let i=[[],[],[],[],[]],r=new Map;function s(o,l){let c=r.get(o);if(c!=null){if(c<=l)return;let u=i[c].indexOf(o);u>-1&&i[c].splice(u,1),o instanceof C9&&n.delete(o.compartment)}if(r.set(o,l),Array.isArray(o))for(let u of o)s(u,l);else if(o instanceof C9){if(n.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let u=t.get(o.compartment)||o.inner;n.set(o.compartment,u),s(u,l)}else if(o instanceof Z5e)s(o.inner,o.prec);else if(o instanceof dl)i[l].push(o),o.provides&&s(o.provides,l);else if(o instanceof FN)i[l].push(o),o.facet.extensions&&s(o.facet.extensions,Oy.default);else{let u=o.extension;if(!u)throw new Error(`Unrecognized extension value in extension set (${o}).`);if(u==o)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(u,l)}}return s(e,Oy.default),i.reduce((o,l)=>o.concat(l))}function xE(e,t){if(t&1)return 2;let n=t>>1,i=e.status[n];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;e.status[n]=4;let r=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|r}function UI(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}const J5e=mn.define(),A9=mn.define({combine:e=>e.some(t=>t),static:!0}),e3e=mn.define({combine:e=>e.length?e[0]:void 0,static:!0}),t3e=mn.define(),n3e=mn.define(),i3e=mn.define(),r3e=mn.define({combine:e=>e.length?e[0]:!1});class Ih{constructor(t,n){this.type=t,this.value=n}static define(){return new dIt}}class dIt{of(t){return new Ih(this,t)}}class fIt{constructor(t){this.map=t}of(t){return new pi(this,t)}}class pi{constructor(t,n){this.type=t,this.value=n}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new pi(this.type,n)}is(t){return this.type==t}static define(t={}){return new fIt(t.map||(n=>n))}static mapEffects(t,n){if(!t.length)return t;let i=[];for(let r of t){let s=r.map(n);s&&i.push(s)}return i}}pi.reconfigure=pi.define();pi.appendConfig=pi.define();class Xa{constructor(t,n,i,r,s,o){this.startState=t,this.changes=n,this.selection=i,this.effects=r,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,i&&Y5e(i,n.newLength),s.some(l=>l.type==Xa.time)||(this.annotations=s.concat(Xa.time.of(Date.now())))}static create(t,n,i,r,s,o){return new Xa(t,n,i,r,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let n of this.annotations)if(n.type==t)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(Xa.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]=="."))}}Xa.time=Ih.define();Xa.userEvent=Ih.define();Xa.addToHistory=Ih.define();Xa.remote=Ih.define();function hIt(e,t){let n=[];for(let i=0,r=0;;){let s,o;if(i=e[i]))s=e[i++],o=e[i++];else if(r=0;r--){let s=i[r](e);s instanceof Xa?e=s:Array.isArray(s)&&s.length==1&&s[0]instanceof Xa?e=s[0]:e=a3e(t,bw(s),!1)}return e}function mIt(e){let t=e.startState,n=t.facet(i3e),i=e;for(let r=n.length-1;r>=0;r--){let s=n[r](e);s&&Object.keys(s).length&&(i=s3e(i,T9(t,s,e.changes.newLength),!0))}return i==e?e:Xa.create(t,e.changes,e.selection,i.effects,i.annotations,i.scrollIntoView)}const gIt=[];function bw(e){return e==null?gIt:Array.isArray(e)?e:[e]}var Qs=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(Qs||(Qs={}));const bIt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let _9;try{_9=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function yIt(e){if(_9)return _9.test(e);for(let t=0;t"€"&&(n.toUpperCase()!=n.toLowerCase()||bIt.test(n)))return!0}return!1}function vIt(e){return t=>{if(!/\S/.test(t))return Qs.Space;if(yIt(t))return Qs.Word;for(let n=0;n-1)return Qs.Word;return Qs.Other}}class tr{constructor(t,n,i,r,s,o){this.config=t,this.doc=n,this.selection=i,this.values=r,this.status=t.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let l=0;lr.set(u,c)),n=null),r.set(l.value.compartment,l.value.extension)):l.is(pi.reconfigure)?(n=null,i=l.value):l.is(pi.appendConfig)&&(n=null,i=bw(i).concat(l.value));let s;n?s=t.startState.values.slice():(n=BI.resolve(i,r,this),s=new tr(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(c,u)=>u.reconfigure(c,this),null).values);let o=t.startState.facet(A9)?t.newSelection:t.newSelection.asSingle();new tr(n,t.newDoc,o,s,(l,c)=>c.update(l,t),t)}replaceSelection(t){return typeof t=="string"&&(t=this.toText(t)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:t},range:ht.cursor(n.from+t.length)}))}changeByRange(t){let n=this.selection,i=t(n.ranges[0]),r=this.changes(i.changes),s=[i.range],o=bw(i.effects);for(let l=1;lo.spec.fromJSON(l,c)))}}return tr.create({doc:t.doc,selection:ht.fromJSON(t.selection),extensions:n.extensions?r.concat([n.extensions]):r})}static create(t={}){let n=BI.resolve(t.extensions||[],new Map),i=t.doc instanceof xr?t.doc:xr.of((t.doc||"").split(n.staticFacet(tr.lineSeparator)||O9)),r=t.selection?t.selection instanceof ht?t.selection:ht.single(t.selection.anchor,t.selection.head):ht.single(0);return Y5e(r,i.length),n.staticFacet(A9)||(r=r.asSingle()),new tr(n,i,r,n.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(tr.tabSize)}get lineBreak(){return this.facet(tr.lineSeparator)||` +`}get readOnly(){return this.facet(r3e)}phrase(t,...n){for(let i of this.facet(tr.phrases))if(Object.prototype.hasOwnProperty.call(i,t)){t=i[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(i,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>n.length?i:n[s-1]})),t}languageDataAt(t,n,i=-1){let r=[];for(let s of this.facet(J5e))for(let o of s(this,n,i))Object.prototype.hasOwnProperty.call(o,t)&&r.push(o[t]);return r}charCategorizer(t){let n=this.languageDataAt("wordChars",t);return vIt(n.length?n[0]:"")}wordAt(t){let{text:n,from:i,length:r}=this.doc.lineAt(t),s=this.charCategorizer(t),o=t-i,l=t-i;for(;o>0;){let c=Ro(n,o,!1);if(s(n.slice(c,o))!=Qs.Word)break;o=c}for(;le.length?e[0]:4});tr.lineSeparator=e3e;tr.readOnly=r3e;tr.phrases=mn.define({compare(e,t){let n=Object.keys(e),i=Object.keys(t);return n.length==i.length&&n.every(r=>e[r]==t[r])}});tr.languageData=J5e;tr.changeFilter=t3e;tr.transactionFilter=n3e;tr.transactionExtender=i3e;KM.reconfigure=pi.define();function Ph(e,t,n={}){let i={};for(let r of e)for(let s of Object.keys(r)){let o=r[s],l=i[s];if(l===void 0)i[s]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(n,s))i[s]=n[s](l,o);else throw new Error("Config merge conflict for field "+s)}for(let r in t)i[r]===void 0&&(i[r]=t[r]);return i}class hb{eq(t){return this==t}range(t,n=t){return PC.create(t,n,this)}}hb.prototype.startSide=hb.prototype.endSide=0;hb.prototype.point=!1;hb.prototype.mapMode=il.TrackDel;function Bq(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}class PC{constructor(t,n,i){this.from=t,this.to=n,this.value=i}static create(t,n,i){return new PC(t,n,i)}}function j9(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class Uq{constructor(t,n,i,r){this.from=t,this.to=n,this.value=i,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(t,n,i,r=0){let s=i?this.to:this.from;for(let o=r,l=s.length;;){if(o==l)return o;let c=o+l>>1,u=s[c]-t||(i?this.value[c].endSide:this.value[c].startSide)-n;if(c==o)return u>=0?o:l;u>=0?l=c:o=c+1}}between(t,n,i,r){for(let s=this.findIndex(n,-1e9,!0),o=this.findIndex(i,1e9,!1,s);sm||h==m&&u.startSide>0&&u.endSide<=0)continue;(m-h||u.endSide-u.startSide)<0||(o<0&&(o=h),u.point&&(l=Math.max(l,m-h)),i.push(u),r.push(h-o),s.push(m-o))}return{mapped:i.length?new Uq(r,s,i,l):null,pos:o}}}class Ki{constructor(t,n,i,r){this.chunkPos=t,this.chunk=n,this.nextLayer=i,this.maxPoint=r}static create(t,n,i,r){return new Ki(t,n,i,r)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let n of this.chunk)t+=n.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:n=[],sort:i=!1,filterFrom:r=0,filterTo:s=this.length}=t,o=t.filter;if(n.length==0&&!o)return this;if(i&&(n=n.slice().sort(j9)),this.isEmpty)return n.length?Ki.of(n):this;let l=new o3e(this,null,-1).goto(0),c=0,u=[],d=new nm;for(;l.value||c=0){let f=n[c++];d.addInner(f.from,f.to,f.value)||u.push(f)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||sl.to||s=s&&t<=s+o.length&&o.between(s,t-s,n-s,i)===!1)return}this.nextLayer.between(t,n,i)}}iter(t=0){return DC.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,n=0){return DC.from(t).goto(n)}static compare(t,n,i,r,s=-1){let o=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),l=n.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),c=wie(o,l,i),u=new Sk(o,c,s),d=new Sk(l,c,s);i.iterGaps((f,h,m)=>Oie(u,f,d,h,m,r)),i.empty&&i.length==0&&Oie(u,0,d,0,0,r)}static eq(t,n,i=0,r){r==null&&(r=999999999);let s=t.filter(d=>!d.isEmpty&&n.indexOf(d)<0),o=n.filter(d=>!d.isEmpty&&t.indexOf(d)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let l=wie(s,o),c=new Sk(s,l,0).goto(i),u=new Sk(o,l,0).goto(i);for(;;){if(c.to!=u.to||!N9(c.active,u.active)||c.point&&(!u.point||!Bq(c.point,u.point)))return!1;if(c.to>r)return!0;c.next(),u.next()}}static spans(t,n,i,r,s=-1){let o=new Sk(t,null,s).goto(n),l=n,c=o.openStart;for(;;){let u=Math.min(o.to,i);if(o.point){let d=o.activeForPoint(o.to),f=o.pointFroml&&(r.span(l,u,o.active,c),c=o.openEnd(u));if(o.to>i)return c+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(t,n=!1){let i=new nm;for(let r of t instanceof PC?[t]:n?xIt(t):t)i.add(r.from,r.to,r.value);return i.finish()}static join(t){if(!t.length)return Ki.empty;let n=t[t.length-1];for(let i=t.length-2;i>=0;i--)for(let r=t[i];r!=Ki.empty;r=r.nextLayer)n=new Ki(r.chunkPos,r.chunk,n,Math.max(r.maxPoint,n.maxPoint));return n}}Ki.empty=new Ki([],[],null,-1);function xIt(e){if(e.length>1)for(let t=e[0],n=1;n0)return e.slice().sort(j9);t=i}return e}Ki.empty.nextLayer=Ki.empty;class nm{finishChunk(t){this.chunks.push(new Uq(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,n,i){this.addInner(t,n,i)||(this.nextLayer||(this.nextLayer=new nm)).add(t,n,i)}addInner(t,n,i){let r=t-this.lastTo||i.startSide-this.last.endSide;if(r<=0&&(t-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(n-this.chunkStart),this.last=i,this.lastFrom=t,this.lastTo=n,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,n-t)),!0)}addChunk(t,n){if((t-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(t);let i=n.value.length-1;return this.last=n.value[i],this.lastFrom=n.from[i]+t,this.lastTo=n.to[i]+t,!0}finish(){return this.finishInner(Ki.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return t;let n=Ki.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,n}}function wie(e,t,n){let i=new Map;for(let s of e)for(let o=0;o=this.minPoint)break}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&r.push(new o3e(o,n,i,s));return r.length==1?r[0]:new DC(r)}get startSide(){return this.value?this.value.startSide:0}goto(t,n=-1e9){for(let i of this.heap)i.goto(t,n);for(let i=this.heap.length>>1;i>=0;i--)G4(this.heap,i);return this.next(),this}forward(t,n){for(let i of this.heap)i.forward(t,n);for(let i=this.heap.length>>1;i>=0;i--)G4(this.heap,i);(this.to-t||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),G4(this.heap,0)}}}function G4(e,t){for(let n=e[t];;){let i=(t<<1)+1;if(i>=e.length)break;let r=e[i];if(i+1=0&&(r=e[i+1],i++),n.compare(r)<0)break;e[i]=n,e[t]=r,t=i}}class Sk{constructor(t,n,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=DC.from(t,n,i)}goto(t,n=-1e9){return this.cursor.goto(t,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=n,this.openStart=-1,this.next(),this}forward(t,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(t,n)}removeActive(t){Q_(this.active,t),Q_(this.activeTo,t),Q_(this.activeRank,t),this.minActive=kie(this.active,this.activeTo)}addActive(t){let n=0,{value:i,to:r,rank:s}=this.cursor;for(;n0;)n++;z_(this.active,n,i),z_(this.activeTo,n,r),z_(this.activeRank,n,s),t&&z_(t,n,this.cursor.from),this.minActive=kie(this.active,this.activeTo)}next(){let t=this.to,n=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>t){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&Q_(i,r)}else if(this.cursor.value)if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(i),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from=0&&i[r]=0&&!(this.activeRank[i]t||this.activeTo[i]==t&&this.active[i].endSide>=this.point.endSide)&&n.push(this.active[i]);return n.reverse()}openEnd(t){let n=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>t;i--)n++;return n}}function Oie(e,t,n,i,r,s){e.goto(t),n.goto(i);let o=i+r,l=i,c=i-t,u=!!s.boundChange;for(let d=!1;;){let f=e.to+c-n.to,h=f||e.endSide-n.endSide,m=h<0?e.to+c:n.to,g=Math.min(m,o);if(e.point||n.point?(e.point&&n.point&&Bq(e.point,n.point)&&N9(e.activeForPoint(e.to),n.activeForPoint(n.to))||s.comparePoint(l,g,e.point,n.point),d=!1):(d&&s.boundChange(l),g>l&&!N9(e.active,n.active)&&s.compareRange(l,g,e.active,n.active),u&&go)break;l=m,h<=0&&e.next(),h>=0&&n.next()}}function N9(e,t){if(e.length!=t.length)return!1;for(let n=0;n=t;i--)e[i+1]=e[i];e[t]=n}function kie(e,t){let n=-1,i=1e9;for(let r=0;r=t)return r;if(r==e.length)break;s+=e.charCodeAt(r)==9?n-s%n:1,r=Ro(e,r)}return i===!0?-1:e.length}const I9="ͼ",Sie=typeof Symbol>"u"?"__"+I9:Symbol.for(I9),P9=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Eie=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class pb{constructor(t,n){this.rules=[];let{finish:i}=n||{};function r(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,l,c,u){let d=[],f=/^@(\w+)\b/.exec(o[0]),h=f&&f[1]=="keyframes";if(f&&l==null)return c.push(o[0]+";");for(let m in l){let g=l[m];if(/&/.test(m))s(m.split(/,\s*/).map(b=>o.map(v=>b.replace(/&/,v))).reduce((b,v)=>b.concat(v)),g,c);else if(g&&typeof g=="object"){if(!f)throw new RangeError("The value of a property ("+m+") should be a primitive value.");s(r(m),g,d,h)}else g!=null&&d.push(m.replace(/_.*/,"").replace(/[A-Z]/g,b=>"-"+b.toLowerCase())+": "+g+";")}(d.length||h)&&c.push((i&&!f&&!u?o.map(i):o).join(", ")+" {"+d.join(" ")+"}")}for(let o in t)s(r(o),t[o],this.rules)}getRules(){return this.rules.join(` +`)}static newName(){let t=Eie[Sie]||1;return Eie[Sie]=t+1,I9+t.toString(36)}static mount(t,n,i){let r=t[P9],s=i&&i.nonce;r?s&&r.setNonce(s):r=new wIt(t,s),r.mount(Array.isArray(n)?n:[n],t)}}let Cie=new Map;class wIt{constructor(t,n){let i=t.ownerDocument||t,r=i.defaultView;if(!t.head&&t.adoptedStyleSheets&&r.CSSStyleSheet){let s=Cie.get(i);if(s)return t[P9]=s;this.sheet=new r.CSSStyleSheet,Cie.set(i,this)}else this.styleTag=i.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],t[P9]=this}mount(t,n){let i=this.sheet,r=0,s=0;for(let o=0;o-1&&(this.modules.splice(c,1),s--,c=-1),c==-1){if(this.modules.splice(s++,0,l),i)for(let u=0;u",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},OIt=typeof navigator<"u"&&/Mac/.test(navigator.platform),kIt=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var el=0;el<10;el++)mb[48+el]=mb[96+el]=String(el);for(var el=1;el<=24;el++)mb[el+111]="F"+el;for(var el=65;el<=90;el++)mb[el]=String.fromCharCode(el+32),MC[el]=String.fromCharCode(el);for(var X4 in mb)MC.hasOwnProperty(X4)||(MC[X4]=mb[X4]);function SIt(e){var t=OIt&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||kIt&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?MC:mb)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function Kr(){var e=arguments[0];typeof e=="string"&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var r=n[i];typeof r=="string"?e.setAttribute(i,r):r!=null&&(e[i]=r)}t++}for(;t2);var hn={mac:_ie||/Mac/.test(Yl.platform),windows:/Win/.test(Yl.platform),linux:/Linux|X11/.test(Yl.platform),ie:GM,ie_version:c3e?D9.documentMode||6:L9?+L9[1]:M9?+M9[1]:0,gecko:Aie,gecko_version:Aie?+(/Firefox\/(\d+)/.exec(Yl.userAgent)||[0,0])[1]:0,chrome:!!Y4,chrome_version:Y4?+Y4[1]:0,ios:_ie,android:/Android\b/.test(Yl.userAgent),webkit:Tie,webkit_version:Tie?+(/\bAppleWebKit\/(\d+)/.exec(Yl.userAgent)||[0,0])[1]:0,safari:$9,safari_version:$9?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Yl.userAgent)||[0,0])[1]:0,tabSize:D9.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function Qq(e,t){for(let n in e)n=="class"&&t.class?t.class+=" "+e.class:n=="style"&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}const QI=Object.create(null);function zq(e,t,n){if(e==t)return!0;e||(e=QI),t||(t=QI);let i=Object.keys(e),r=Object.keys(t);if(i.length-0!=r.length-0)return!1;for(let s of i)if(s!=n&&(r.indexOf(s)==-1||e[s]!==t[s]))return!1;return!0}function EIt(e,t){for(let n=e.attributes.length-1;n>=0;n--){let i=e.attributes[n].name;t[i]==null&&e.removeAttribute(i)}for(let n in t){let i=t[n];n=="style"?e.style.cssText=i:e.getAttribute(n)!=i&&e.setAttribute(n,i)}}function jie(e,t,n){let i=!1;if(t)for(let r in t)n&&r in n||(i=!0,r=="style"?e.style.cssText="":e.removeAttribute(r));if(n)for(let r in n)t&&t[r]==n[r]||(i=!0,r=="style"?e.style.cssText=n[r]:e.setAttribute(r,n[r]));return i}function CIt(e){let t=Object.create(null);for(let n=0;n0?3e8:-4e8:n>0?1e8:-1e8,new w0(t,n,n,i,t.widget||null,!1)}static replace(t){let n=!!t.block,i,r;if(t.isBlockGap)i=-5e8,r=4e8;else{let{start:s,end:o}=u3e(t,n);i=(s?n?-3e8:-1:5e8)-1,r=(o?n?2e8:1:-6e8)+1}return new w0(t,i,r,n,t.widget||null,!0)}static line(t){return new _T(t)}static set(t,n=!1){return Ki.of(t,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Fn.none=Ki.empty;class TT extends Fn{constructor(t){let{start:n,end:i}=u3e(t);super(n?-1:5e8,i?1:-6e8,null,t),this.tagName=t.tagName||"span",this.attrs=t.class&&t.attributes?Qq(t.attributes,{class:t.class}):t.class?{class:t.class}:t.attributes||QI}eq(t){return this==t||t instanceof TT&&this.tagName==t.tagName&&zq(this.attrs,t.attrs)}range(t,n=t){if(t>=n)throw new RangeError("Mark decorations may not be empty");return super.range(t,n)}}TT.prototype.point=!1;class _T extends Fn{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof _T&&this.spec.class==t.spec.class&&zq(this.spec.attributes,t.spec.attributes)}range(t,n=t){if(n!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,n)}}_T.prototype.mapMode=il.TrackBefore;_T.prototype.point=!0;class w0 extends Fn{constructor(t,n,i,r,s,o){super(n,i,s,t),this.block=r,this.isReplace=o,this.mapMode=r?n<=0?il.TrackBefore:il.TrackAfter:il.TrackDel}get type(){return this.startSide!=this.endSide?ol.WidgetRange:this.startSide<=0?ol.WidgetBefore:ol.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof w0&&AIt(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(t,n=t){if(this.isReplace&&(t>n||t==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,n)}}w0.prototype.point=!0;function u3e(e,t=!1){let{inclusiveStart:n,inclusiveEnd:i}=e;return n==null&&(n=e.inclusive),i==null&&(i=e.inclusive),{start:n??t,end:i??t}}function AIt(e,t){return e==t||!!(e&&t&&e.compare(t))}function yw(e,t,n,i=0){let r=n.length-1;r>=0&&n[r]+i>=e?n[r]=Math.max(n[r],t):n.push(e,t)}class LC extends hb{constructor(t,n,i){super(),this.tagName=t,this.attributes=n,this.rank=i}eq(t){return t==this||t instanceof LC&&this.tagName==t.tagName&&zq(this.attributes,t.attributes)}static create(t){return new LC(t.tagName,t.attributes||QI,t.rank==null?50:Math.max(0,Math.min(t.rank,100)))}static set(t,n=!1){return Ki.of(t,n)}}LC.prototype.startSide=LC.prototype.endSide=-1;function $C(e){let t;return e.nodeType==11?t=e.getSelection?e:e.ownerDocument:t=e,t.getSelection()}function F9(e,t){return t?e==t||e.contains(t.nodeType!=1?t.parentNode:t):!1}function wE(e,t){if(!t.anchorNode)return!1;try{return F9(e,t.anchorNode)}catch{return!1}}function OE(e){return e.nodeType==3?BC(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function kE(e,t,n,i){return n?Nie(e,t,n,i,-1)||Nie(e,t,n,i,1):!1}function gb(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function zI(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function Nie(e,t,n,i,r){for(;;){if(e==n&&t==i)return!0;if(t==(r<0?0:im(e))){if(e.nodeName=="DIV")return!1;let s=e.parentNode;if(!s||s.nodeType!=1)return!1;t=gb(e)+(r<0?0:1),e=s}else if(e.nodeType==1){if(e=e.childNodes[t+(r<0?-1:0)],e.nodeType==1&&e.contentEditable=="false")return!1;t=r<0?im(e):0}else return!1}}function im(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function FC(e,t){let{left:n,right:i}=e;if(n==i)return e;let r=t?n:i;return{left:r,right:r,top:e.top,bottom:e.bottom}}function TIt(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function d3e(e,t){let n=t.width/e.offsetWidth,i=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(t.height-e.offsetHeight)<1)&&(i=1),{scaleX:n,scaleY:i}}function _It(e,t,n,i,r,s,o,l){let c=e.ownerDocument,u=c.defaultView||window;for(let d=e,f=!1;d&&!f;)if(d.nodeType==1){let h,m=d==c.body,g=1,b=1;if(m)h=TIt(u);else{if(/^(fixed|sticky)$/.test(getComputedStyle(d).position)&&(f=!0),d.scrollHeight<=d.clientHeight&&d.scrollWidth<=d.clientWidth){d=d.assignedSlot||d.parentNode;continue}let w=d.getBoundingClientRect();({scaleX:g,scaleY:b}=d3e(d,w)),h={left:w.left,right:w.left+d.clientWidth*g,top:w.top,bottom:w.top+d.clientHeight*b}}let v=0,y=0;if(r=="nearest")t.top0&&t.bottom>h.bottom+y&&(y=t.bottom-h.bottom+o)):t.bottom>h.bottom-o&&(y=t.bottom-h.bottom+o,n<0&&t.top-y0&&t.right>h.right+v&&(v=t.right-h.right+s)):t.right>h.right-s&&(v=t.right-h.right+s,n<0&&t.lefth.bottom||t.lefth.right)&&(t={left:Math.max(t.left,h.left),right:Math.min(t.right,h.right),top:Math.max(t.top,h.top),bottom:Math.min(t.bottom,h.bottom)}),d=d.assignedSlot||d.parentNode}else if(d.nodeType==11)d=d.host;else break}function f3e(e,t=!0){let n=e.ownerDocument,i=null,r=null;for(let s=e.parentNode;s&&!(s==n.body||(!t||i)&&r);)if(s.nodeType==1)!r&&s.scrollHeight>s.clientHeight&&(r=s),t&&!i&&s.scrollWidth>s.clientWidth&&(i=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:i,y:r}}class jIt{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:n,focusNode:i}=t;this.set(n,Math.min(t.anchorOffset,n?im(n):0),i,Math.min(t.focusOffset,i?im(i):0))}set(t,n,i,r){this.anchorNode=t,this.anchorOffset=n,this.focusNode=i,this.focusOffset=r}}let yy=null;hn.safari&&hn.safari_version>=26&&(yy=!1);function h3e(e){if(e.setActive)return e.setActive();if(yy)return e.focus(yy);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(yy==null?{get preventScroll(){return yy={preventScroll:!0},!0}}:void 0),!yy){yy=!1;for(let n=0;nMath.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function m3e(e,t){for(let n=e,i=t;;){if(n.nodeType==3&&i>0)return{node:n,offset:i};if(n.nodeType==1&&i>0){if(n.contentEditable=="false")return null;n=n.childNodes[i-1],i=im(n)}else if(n.parentNode&&!zI(n))i=gb(n),n=n.parentNode;else return null}}function g3e(e,t){for(let n=e,i=t;;){if(n.nodeType==3&&i=n){if(l.level==i)return o;(s<0||(r!=0?r<0?l.fromn:t[s].level>l.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}}function v3e(e,t){if(e.length!=t.length)return!1;for(let n=0;n=0;b-=3)if(zf[b+1]==-m){let v=zf[b+2],y=v&2?r:v&4?v&1?s:r:0;y&&(as[f]=as[zf[b]]=y),l=b;break}}else{if(zf.length==189)break;zf[l++]=f,zf[l++]=h,zf[l++]=c}else if((g=as[f])==2||g==1){let b=g==r;c=b?0:1;for(let v=l-3;v>=0;v-=3){let y=zf[v+2];if(y&2)break;if(b)zf[v+2]|=2;else{if(y&4)break;zf[v+2]|=4}}}}}function $It(e,t,n,i){for(let r=0,s=i;r<=n.length;r++){let o=r?n[r-1].to:e,l=rc;)g==v&&(g=n[--b].from,v=b?n[b-1].to:e),as[--g]=m;c=d}else s=u,c++}}}function U9(e,t,n,i,r,s,o){let l=i%2?2:1;if(i%2==r%2)for(let c=t,u=0;cc&&o.push(new ch(c,b.from,m));let v=b.direction==O0!=!(m%2);Q9(e,v?i+1:i,r,b.inner,b.from,b.to,o),c=b.to}g=b.to}else{if(g==n||(d?as[g]!=l:as[g]==l))break;g++}h?U9(e,c,g,i+1,r,h,o):ct;){let d=!0,f=!1;if(!u||c>s[u-1].to){let b=as[c-1];b!=l&&(d=!1,f=b==16)}let h=!d&&l==1?[]:null,m=d?i:i+1,g=c;e:for(;;)if(u&&g==s[u-1].to){if(f)break e;let b=s[--u];if(!d)for(let v=b.from,y=u;;){if(v==t)break e;if(y&&s[y-1].to==v)v=s[--y].from;else{if(as[v-1]==l)break e;break}}if(h)h.push(b);else{b.toas.length;)as[as.length]=256;let i=[],r=t==O0?0:1;return Q9(e,r,r,n,0,e.length,i),i}function x3e(e){return[new ch(0,e,0)]}let w3e="";function BIt(e,t,n,i,r){var s;let o=i.head-e.from,l=ch.find(t,o,(s=i.bidiLevel)!==null&&s!==void 0?s:-1,i.assoc),c=t[l],u=c.side(r,n);if(o==u){let h=l+=r?1:-1;if(h<0||h>=t.length)return null;c=t[l=h],o=c.side(!r,n),u=c.side(r,n)}let d=Ro(e.text,o,c.forward(r,n));(dc.to)&&(d=u),w3e=e.text.slice(Math.min(o,d),Math.max(o,d));let f=l==(r?t.length-1:0)?null:t[l+(r?1:-1)];return f&&d==u&&f.level+(r?0:1)e.some(t=>t)}),_3e=mn.define({combine:e=>e.some(t=>t)}),j3e=mn.define();class xw{constructor(t,n,i,r,s,o=!1){this.range=t,this.y=n,this.x=i,this.yMargin=r,this.xMargin=s,this.isSnapshot=o}map(t){return t.empty?this:new xw(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new xw(ht.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const V_=pi.define({map:(e,t)=>e.map(t)}),N3e=pi.define();function Mc(e,t,n){let i=e.facet(E3e);i.length?i[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+":",t):console.error(t))}const wp=mn.define({combine:e=>e.length?e[0]:!0});let QIt=0;const Bx=mn.define({combine(e){return e.filter((t,n)=>{for(let i=0;i{let c=[];return o&&c.push(XM.of(u=>{let d=u.plugin(l);return d?o(d):Fn.none})),s&&c.push(s(l)),c})}static fromClass(t,n){return ma.define((i,r)=>new t(i,r),n)}}class Z4{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(t){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(i){if(Mc(n.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(t,this.spec.arg)}catch(n){Mc(t.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(i){Mc(t.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const R3e=mn.define(),Wq=mn.define(),XM=mn.define(),I3e=mn.define(),Kq=mn.define(),jT=mn.define(),P3e=mn.define();function Iie(e,t){let n=e.state.facet(P3e);if(!n.length)return n;let i=n.map(s=>s instanceof Function?s(e):s),r=[];return Ki.spans(i,t.from,t.to,{point(){},span(s,o,l,c){let u=s-t.from,d=o-t.from,f=r;for(let h=l.length-1;h>=0;h--,c--){let m=l[h].spec.bidiIsolate,g;if(m==null&&(m=UIt(t.text,u,d)),c>0&&f.length&&(g=f[f.length-1]).to==u&&g.direction==m)g.to=d,f=g.inner;else{let b={from:u,to:d,direction:m,inner:[]};f.push(b),f=b.inner}}}}),r}const D3e=mn.define();function Gq(e){let t=0,n=0,i=0,r=0;for(let s of e.state.facet(D3e)){let o=s(e);o&&(o.left!=null&&(t=Math.max(t,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(r=Math.max(r,o.bottom)))}return{left:t,right:n,top:i,bottom:r}}const yS=mn.define();class gd{constructor(t,n,i,r){this.fromA=t,this.toA=n,this.fromB=i,this.toB=r}join(t){return new gd(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let n=t.length,i=this;for(;n>0;n--){let r=t[n-1];if(!(r.fromA>i.toA)){if(r.toAr.push(new gd(s,o,l,c))),this.changedRanges=r}static create(t,n,i){return new VI(t,n,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(t=>t.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const zIt=[];class pa{constructor(t,n,i=0){this.dom=t,this.length=n,this.flags=i,this.parent=null,t.cmTile=this}get breakAfter(){return this.flags&1}get children(){return zIt}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(t){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&EIt(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(t){this.dom=t,t.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(t,n=this.posAtStart){let i=n;for(let r of this.children){if(r==t)return i;i+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(t){return this.posBefore(t)+t.length}covers(t){return!0}coordsIn(t,n,i){return null}domPosFor(t,n){let i=gb(this.dom),r=this.length?t>0:n>0;return new uf(this.parent.dom,i+(r?1:0),t==0||t==this.length)}markDirty(t){this.flags&=-3,t&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let t=this;t;t=t.parent)if(t instanceof ZM)return t;return null}static get(t){return t.cmTile}}class YM extends pa{constructor(t){super(t,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(t){this.children.push(t),t.parent=this}sync(t){if(this.flags&2)return;super.sync(t);let n=this.dom,i=null,r,s=(t==null?void 0:t.node)==n?t:null,o=0;for(let l of this.children){if(l.sync(t),o+=l.length+l.breakAfter,r=i?i.nextSibling:n.firstChild,s&&r!=l.dom&&(s.written=!0),l.dom.parentNode==n)for(;r&&r!=l.dom;)r=Pie(r);else n.insertBefore(l.dom,r);i=l.dom}for(r=i?i.nextSibling:n.firstChild,s&&r&&(s.written=!0);r;)r=Pie(r);this.length=o}}function Pie(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class ZM extends YM{constructor(t,n){super(n),this.view=t}owns(t){for(;t;t=t.parent)if(t==this)return!0;return!1}isBlock(){return!0}nearest(t){for(;;){if(!t)return null;let n=pa.get(t);if(n&&this.owns(n))return n;t=t.parentNode}}blockTiles(t){for(let n=[],i=this,r=0,s=0;;)if(r==i.children.length){if(!n.length)return;i=i.parent,i.breakAfter&&s++,r=n.pop()}else{let o=i.children[r++];if(o instanceof Qp)n.push(r),i=o,r=0;else{let l=s+o.length,c=t(o,s);if(c!==void 0)return c;s=l+o.breakAfter}}}resolveBlock(t,n){let i,r=-1,s,o=-1;if(this.blockTiles((l,c)=>{let u=c+l.length;if(t>=c&&t<=u){if(l.isWidget()&&n>=-1&&n<=1){if(l.flags&32)return!0;l.flags&16&&(i=void 0)}(ct||t==c&&(n>1?l.length:l.covers(-1)))&&(!s||!l.isWidget()&&s.isWidget())&&(s=l,o=t-c)}}),!i&&!s)throw new Error("No tile at position "+t);return i&&n<0||!s?{tile:i,offset:r}:{tile:s,offset:o}}}class Qp extends YM{constructor(t,n){super(t),this.wrapper=n}isBlock(){return!0}covers(t){return this.children.length?t<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(t,n){let i=new Qp(n||document.createElement(t.tagName),t);return n||(i.flags|=4),i}}class d1 extends YM{constructor(t,n){super(t),this.attrs=n}isLine(){return!0}static start(t,n,i){let r=new d1(n||document.createElement("div"),t);return(!n||!i)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(t,n,i){let r=null,s=-1,o=null,l=-1;function c(d,f){for(let h=0,m=0;h=f&&(g.isComposite()?c(g,f-m):(!o||o.isHidden&&(n>0&&!(o.flags&32)||i&&HIt(o,g)))&&(b>f||g.flags&32)?(o=g,l=f-m):(mr&&(t=r);let s=t,o=t,l=0;t==0&&n<0||t==r&&n>=0?hn.chrome||hn.gecko||(t?(s--,l=1):o=0)?0:c.length-1];return hn.safari&&!l&&u.width==0&&(u=Array.prototype.find.call(c,d=>d.width)||u),i==null?u:FC(u,(l?l>0:n<0)==i)}static of(t,n){let i=new Dy(n||document.createTextNode(t),t);return n||(i.flags|=2),i}}class k0 extends pa{constructor(t,n,i,r){super(t,n,r),this.widget=i}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(t){return this.flags&48?!1:(this.flags&(t<0?64:128))>0}coordsIn(t,n){return this.coordsInWidget(t,n,!1)}coordsInWidget(t,n,i){let r=this.widget.coordsAt(this.dom,t,n);if(r)return r;if(i)return FC(this.dom.getBoundingClientRect(),this.length?t==0:n<=0);{let s=this.dom.getClientRects(),o=null;if(!s.length)return null;let l=this.flags&16?!0:this.flags&32?!1:t>0;for(let c=l?s.length-1:0;o=s[c],!(t>0?c==0:c==s.length-1||o.top0==i)}}class qIt{constructor(t){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=t}advance(t,n,i){let{tile:r,index:s,beforeBreak:o,parents:l}=this;for(;t||n>0;)if(r.isComposite())if(o){if(!t)break;i&&i.break(),t--,o=!1}else if(s==r.children.length){if(!t&&!l.length)break;i&&i.leave(r),o=!!r.breakAfter,{tile:r,index:s}=l.pop(),s++}else{let c=r.children[s],u=c.breakAfter;(n>0?c.length<=t:c.length=0;l--){let c=n.marks[l],u=r.lastChild;if(u instanceof Pc&&u.mark.eq(c.mark))u.dom!=c.dom&&u.setDOM(J4(c.dom)),r=u;else{if(this.cache.reused.get(c)){let f=pa.get(c.dom);f&&f.setDOM(J4(c.dom))}let d=Pc.of(c.mark,c.dom);r.append(d),r=d}this.cache.reused.set(c,2)}let s=pa.get(t.text);s&&this.cache.reused.set(s,2);let o=new Dy(t.text,t.text.nodeValue);o.flags|=8,this.pos=t.range.toB,r.append(o)}addInlineWidget(t,n,i){let r=this.afterWidget&&t.flags&48&&(this.afterWidget.flags&48)==(t.flags&48);r||this.flushBuffer();let s=this.ensureMarks(n,i);!r&&!(t.flags&16)&&s.append(this.getBuffer(1)),s.append(t),this.pos+=t.length,this.afterWidget=t}addMark(t,n,i){this.flushBuffer(),this.ensureMarks(n,i).append(t),this.pos+=t.length,this.afterWidget=null}addBlockWidget(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}continueWidget(t){let n=this.afterWidget||this.lastBlock;n.length+=t,this.pos+=t}addLineStart(t,n){var i;t||(t=M3e);let r=d1.start(t,n||((i=this.cache.find(d1))===null||i===void 0?void 0:i.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(t){this.blockPosCovered()||this.addLineStart(t)}ensureLine(t){this.curLine||this.addLineStart(t)}ensureMarks(t,n){var i;let r=this.curLine;for(let s=t.length-1;s>=0;s--){let o=t[s],l;if(n>0&&(l=r.lastChild)&&l instanceof Pc&&l.mark.eq(o))r=l,n--;else{let c=Pc.of(o,(i=this.cache.find(Pc,u=>u.mark.eq(o)))===null||i===void 0?void 0:i.dom);r.append(c),r=c,n=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let t=this.curLine.lastChild;(!t||!Die(this.curLine,!1)||t.dom.nodeName!="BR"&&t.isWidget()&&!(hn.ios&&Die(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(e$,0,32)||new k0(e$.toDOM(),0,e$,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let t=this.wrappers.length-1;t>=0;t--)this.wrappers[t].to=this.pos){let n=t.rank*102+t.value.rank,i=new WIt(t.from,t.to,t.value,n),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-i.rank||this.wrappers[r-1].to-i.to)<0;)r--;this.wrappers.splice(r,0,i)}this.wrapperPos=this.pos}getBlockPos(){var t;this.updateBlockWrappers();let n=this.root;for(let i of this.wrappers){let r=n.lastChild;if(i.fromo.wrapper.eq(i.wrapper)))===null||t===void 0?void 0:t.dom);n.append(s),n=s}}return n}blockPosCovered(){let t=this.lastBlock;return t!=null&&!t.breakAfter&&(!t.isWidget()||(t.flags&160)>0)}getBuffer(t){let n=2|(t<0?16:32),i=this.cache.find(HI,void 0,1);return i&&(i.flags=n),i||new HI(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class GIt{constructor(t){this.skipCount=0,this.text="",this.textOff=0,this.cursor=t.iter()}skip(t){this.textOff+t<=this.text.length?this.textOff+=t:(this.skipCount+=t-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(t){if(this.textOff==this.text.length){let{value:r,lineBreak:s,done:o}=this.cursor.next(this.skipCount);if(this.skipCount=0,o)throw new Error("Ran out of text content when drawing inline views");this.text=r;let l=this.textOff=Math.min(t,r.length);return s?null:r.slice(0,l)}let n=Math.min(this.text.length,this.textOff+t),i=this.text.slice(this.textOff,n);return this.textOff=n,i}}const qI=[k0,d1,Dy,Pc,HI,Qp,ZM];for(let e=0;e[]),this.index=qI.map(()=>0),this.reused=new Map}add(t){let n=t.constructor.bucket,i=this.buckets[n];i.length<6?i.push(t):i[this.index[n]=(this.index[n]+1)%6]=t}find(t,n,i=2){let r=t.bucket,s=this.buckets[r],o=this.index[r];for(let l=0;l{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(t,n){let i=n&&this.getCompositionContext(n.text);for(let r=0,s=0,o=0;;){let l=or){let u=c-r;this.preserve(u,!o,!l),r=c,s+=u}if(!l)break;n&&l.fromA<=n.range.fromA&&l.toA>=n.range.toA?(this.forward(l.fromA,n.range.fromA,n.range.fromA{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(c-l);else{let u=c>0||l{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof Pc&&r.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?r.length&&(r.length=s=0):o instanceof Pc&&(r.shift(),s=Math.min(s,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(t)}emit(t,n){let i=null,r=this.builder,s=-1,o=Ki.spans(this.decorations,t,n,{point:(l,c,u,d,f,h)=>{if(u instanceof w0){if(this.disallowBlockEffectsFor[h]){if(u.block)throw new RangeError("Block decorations may not be specified via plugins");if(c>this.view.state.doc.lineAt(l).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=d.length,f>d.length)r.continueWidget(c-l);else{let m=u.widget||(u.block?f1.block:f1.inline),g=ZIt(u),b=this.cache.findWidget(m,c-l,g)||k0.of(m,this.view,c-l,g);u.block?(u.startSide>0&&r.addLineStartIfNotCovered(i),r.addBlockWidget(b)):(r.ensureLine(i),r.addInlineWidget(b,d,f))}i=null}else i=JIt(i,u);c>l&&this.text.skip(c-l)},span:(l,c,u,d)=>{for(let f=l;f-1&&(this.openWidget=o>s),this.openWidget||r.addLineStartIfNotCovered(i),this.openMarks=o}forward(t,n,i=1){n-t<=10?this.old.advance(n-t,i,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-t-10,-1),this.old.advance(5,i,this.reuseWalker))}getCompositionContext(t){let n=[],i=null;for(let r=t.parentNode;;r=r.parentNode){let s=pa.get(r);if(r==this.view.contentDOM)break;s instanceof Pc?n.push(s):s!=null&&s.isLine()?i=s:s instanceof Qp||(r.nodeName=="DIV"&&!i&&r!=this.view.contentDOM?i=new d1(r,M3e):i||n.push(Pc.of(new TT({tagName:r.nodeName.toLowerCase(),attributes:CIt(r)}),r)))}return{line:i,marks:n}}}function Die(e,t){let n=i=>{for(let r of i.children)if((t?r.isText():r.length)||n(r))return!0;return!1};return n(e)}function ZIt(e){let t=e.isReplace?(e.startSide<0?64:0)|(e.endSide>0?128:0):e.startSide>0?32:16;return e.block&&(t|=256),t}const M3e={class:"cm-line"};function JIt(e,t){let n=t.spec.attributes,i=t.spec.class;return!n&&!i||(e||(e={class:"cm-line"}),n&&Qq(n,e),i&&(e.class+=" "+i)),e}function ePt(e){let t=[];for(let n=e.parents.length;n>1;n--){let i=n==e.parents.length?e.tile:e.parents[n].tile;i instanceof Pc&&t.push(i.mark)}return t}function J4(e){let t=pa.get(e);return t&&t.setDOM(e.cloneNode()),e}class f1 extends Nf{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}f1.inline=new f1("span");f1.block=new f1("div");const e$=new class extends Nf{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class Mie{constructor(t){this.view=t,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=Fn.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new ZM(t,t.contentDOM),this.updateInner([new gd(0,0,0,t.state.doc.length)],null)}update(t){var n;let i=t.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:d,toA:f})=>fthis.minWidthTo)?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(t);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?r=this.domChanged.newSel.head:!cPt(t.changes,this.hasComposition)&&!t.selectionSet&&(r=t.state.selection.main.head));let s=r>-1?nPt(this.view,t.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:d,to:f}=this.hasComposition;i=new gd(d,f,t.changes.mapPos(d,-1),t.changes.mapPos(f,1)).addToSet(i.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(hn.ie||hn.chrome)&&!s&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.blockWrappers;this.updateDeco();let c=sPt(o,this.decorations,t.changes);c.length&&(i=gd.extendWithRanges(i,c));let u=oPt(l,this.blockWrappers,t.changes);return u.length&&(i=gd.extendWithRanges(i,u)),s&&!i.some(d=>d.fromA<=s.range.fromA&&d.toA>=s.range.toA)&&(i=s.range.addToSet(i.slice())),this.tile.flags&2&&i.length==0?!1:(this.updateInner(i,s),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,n){this.view.viewState.mustMeasureContent=!0;let{observer:i}=this.view;i.ignore(()=>{if(n||t.length){let o=this.tile,l=new YIt(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&pa.get(n.text)&&l.cache.reused.set(pa.get(n.text),2),this.tile=l.run(t,n),V9(o,l.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=hn.chrome||hn.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||i.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to-1)&&wE(i,this.view.observer.selectionRange)&&!(r&&i.contains(r));if(!(s||n||o))return;let l=this.forceSelection;this.forceSelection=!1;let c=this.view.state.selection.main,u,d;if(c.empty?d=u=this.inlineDOMNearPos(c.anchor,c.assoc||1):(d=this.inlineDOMNearPos(c.head,c.head==c.from?1:-1),u=this.inlineDOMNearPos(c.anchor,c.anchor==c.from?1:-1)),hn.gecko&&c.empty&&!this.hasComposition&&tPt(u)){let h=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(h,u.node.childNodes[u.offset]||null)),u=d=new uf(h,0),l=!0}let f=this.view.observer.selectionRange;(l||!f.focusNode||(!kE(u.node,u.offset,f.anchorNode,f.anchorOffset)||!kE(d.node,d.offset,f.focusNode,f.focusOffset))&&!this.suppressWidgetCursorChange(f,c))&&(this.view.observer.ignore(()=>{hn.android&&hn.chrome&&i.contains(f.focusNode)&&lPt(f.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let h=$C(this.view.root);if(h)if(c.empty){if(hn.gecko){let m=iPt(u.node,u.offset);if(m&&m!=3){let g=(m==1?m3e:g3e)(u.node,u.offset);g&&(u=new uf(g.node,g.offset))}}h.collapse(u.node,u.offset),c.bidiLevel!=null&&h.caretBidiLevel!==void 0&&(h.caretBidiLevel=c.bidiLevel)}else if(h.extend){h.collapse(u.node,u.offset);try{h.extend(d.node,d.offset)}catch{}}else{let m=document.createRange();c.anchor>c.head&&([u,d]=[d,u]),m.setEnd(d.node,d.offset),m.setStart(u.node,u.offset),h.removeAllRanges(),h.addRange(m)}o&&this.view.root.activeElement==i&&(i.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(u,d)),this.impreciseAnchor=u.precise?null:new uf(f.anchorNode,f.anchorOffset),this.impreciseHead=d.precise?null:new uf(f.focusNode,f.focusOffset)}suppressWidgetCursorChange(t,n){return this.hasComposition&&n.empty&&kE(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,n=t.state.selection.main,i=$C(t.root),{anchorNode:r,anchorOffset:s}=t.observer.selectionRange;if(!i||!n.empty||!n.assoc||!i.modify)return;let o=this.lineAt(n.head,n.assoc);if(!o)return;let l=o.posAtStart;if(n.head==l||n.head==l+o.length)return;let c=this.coordsAt(n.head,-1),u=this.coordsAt(n.head,1);if(!c||!u||c.bottom>u.top)return;let d=this.domAtPos(n.head+n.assoc,n.assoc);i.collapse(d.node,d.offset),i.modify("move",n.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let f=t.observer.selectionRange;t.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=n.from&&i.collapse(r,s)}posFromDOM(t,n){let i=this.tile.nearest(t);if(!i)return this.tile.dom.compareDocumentPosition(t)&2?0:this.view.state.doc.length;let r=i.posAtStart;if(i.isComposite()){let s;if(t==i.dom)s=i.dom.childNodes[n];else{let o=im(t)==0?0:n==0?-1:1;for(;;){let l=t.parentNode;if(l==i.dom)break;o==0&&l.firstChild!=l.lastChild&&(t==l.firstChild?o=-1:o=1),t=l}o<0?s=t:s=t.nextSibling}if(s==i.dom.firstChild)return r;for(;s&&!pa.get(s);)s=s.nextSibling;if(!s)return r+i.length;for(let o=0,l=r;;o++){let c=i.children[o];if(c.dom==s)return l;l+=c.length+c.breakAfter}}else return i.isText()?t==i.dom?r+n:r+(n?i.length:0):r}domAtPos(t,n){let{tile:i,offset:r}=this.tile.resolveBlock(t,n);return i.isWidget()?i.domPosFor(r,n):i.domIn(r,n)}inlineDOMNearPos(t,n){let i,r=-1,s=!1,o,l=-1,c=!1;return this.tile.blockTiles((u,d)=>{if(u.isWidget()){if(u.flags&32&&d>=t)return!0;u.flags&16&&(s=!0)}else{let f=d+u.length;if(d<=t&&(i=u,r=t-d,s=f=t&&!o&&(o=u,l=t-d,c=d>t),d>t&&o)return!0}}),!i&&!o?this.domAtPos(t,n):(s&&o?i=null:c&&i&&(o=null),i&&n<0||!o?i.domIn(r,n):o.domIn(l,n))}coordsAt(t,n,i){let{tile:r,offset:s}=this.tile.resolveBlock(t,n);return r.isWidget()?r.widget instanceof t$?null:r.coordsInWidget(s,n,!0):r.coordsIn(s,n,i)}lineAt(t,n){let{tile:i}=this.tile.resolveBlock(t,n);return i.isLine()?i:null}coordsForChar(t){let{tile:n,offset:i}=this.tile.resolveBlock(t,1);if(!n.isLine())return null;function r(s,o){if(s.isComposite())for(let l of s.children){if(l.length>=o){let c=r(l,o);if(c)return c}if(o-=l.length,o<0)break}else if(s.isText()&&oMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,c=this.view.textDirection==os.LTR,u=0,d=(f,h,m)=>{for(let g=0;gr);g++){let b=f.children[g],v=h+b.length,y=b.dom.getBoundingClientRect(),{height:w}=y;if(m&&!g&&(u+=y.top-m.top),b instanceof Qp)v>i&&d(b,h,y);else if(h>=i&&(u>0&&n.push(-u),n.push(w+u),u=0,o)){let x=b.dom.lastChild,O=x?OE(x):[];if(O.length){let k=O[O.length-1],S=c?k.right-y.left:y.right-k.left;S>l&&(l=S,this.minWidth=s,this.minWidthFrom=h,this.minWidthTo=v)}}m&&g==f.children.length-1&&(u+=m.bottom-y.bottom),h=v+b.breakAfter}};return d(this.tile,0,null),n}textDirectionAt(t){let{tile:n}=this.tile.resolveBlock(t,1);return getComputedStyle(n.dom).direction=="rtl"?os.RTL:os.LTR}measureTextSize(){let t=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let l=0,c;for(let u of o.children){if(!u.isText()||/[^ -~]/.test(u.text))return;let d=OE(u.dom);if(d.length!=1)return;l+=d[0].width,c=d[0].height}if(l)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:l/o.length,textHeight:c}}});if(t)return t;let n=document.createElement("div"),i,r,s;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let o=OE(n.firstChild)[0];i=n.getBoundingClientRect().height,r=o&&o.width?o.width/27:7,s=o&&o.height?o.height:i,n.remove()}),{lineHeight:i,charWidth:r,textHeight:s}}computeBlockGapDeco(){let t=[],n=this.view.viewState;for(let i=0,r=0;;r++){let s=r==n.viewports.length?null:n.viewports[r],o=s?s.from-1:this.view.state.doc.length;if(o>i){let l=(n.lineBlockAt(o).bottom-n.lineBlockAt(i).top)/this.view.scaleY;t.push(Fn.replace({widget:new t$(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!s)break;i=s.to+1}return Fn.set(t)}updateDeco(){let t=1,n=this.view.state.facet(XM).map(s=>(this.dynamicDecorationMap[t++]=typeof s=="function")?s(this.view):s),i=!1,r=this.view.state.facet(Kq).map((s,o)=>{let l=typeof s=="function";return l&&(i=!0),l?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[t++]=i,n.push(Ki.join(r))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];ttypeof s=="function"?s(this.view):s)}scrollIntoView(t){if(t.isSnapshot){let u=this.view.viewState.lineBlockAt(t.range.head);this.view.scrollDOM.scrollTop=u.top-t.yMargin,this.view.scrollDOM.scrollLeft=t.xMargin;return}for(let u of this.view.state.facet(j3e))try{if(u(this.view,t.range,t))return!0}catch(d){Mc(this.view.state,d,"scroll handler")}let{range:n}=t,i=this.coordsAt(n.head,n.assoc||(n.head>n.anchor?-1:1)),r;if(!i)return;!n.empty&&(r=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(i={left:Math.min(i.left,r.left),top:Math.min(i.top,r.top),right:Math.max(i.right,r.right),bottom:Math.max(i.bottom,r.bottom)});let s=Gq(this.view),o={left:i.left-s.left,top:i.top-s.top,right:i.right+s.right,bottom:i.bottom+s.bottom},{offsetWidth:l,offsetHeight:c}=this.view.scrollDOM;if(_It(this.view.scrollDOM,o,n.head1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottomi.isWidget()||i.children.some(n);return n(this.tile.resolveBlock(t,1).tile)}destroy(){V9(this.tile)}}function V9(e,t){let n=t==null?void 0:t.get(e);if(n!=1){n==null&&e.destroy();for(let i of e.children)V9(i,t)}}function tPt(e){return e.node.nodeType==1&&e.node.firstChild&&(e.offset==0||e.node.childNodes[e.offset-1].contentEditable=="false")&&(e.offset==e.node.childNodes.length||e.node.childNodes[e.offset].contentEditable=="false")}function L3e(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let i=m3e(n.focusNode,n.focusOffset),r=g3e(n.focusNode,n.focusOffset),s=i||r;if(r&&i&&r.node!=i.node){let l=pa.get(r.node);if(!l||l.isText()&&l.text!=r.node.nodeValue)s=r;else if(e.docView.lastCompositionAfterCursor){let c=pa.get(i.node);!c||c.isText()&&c.text!=i.node.nodeValue||(s=r)}}if(e.docView.lastCompositionAfterCursor=s!=i,!s)return null;let o=t-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function nPt(e,t,n){let i=L3e(e,n);if(!i)return null;let{node:r,from:s,to:o}=i,l=r.nodeValue;if(/[\n\r]/.test(l)||e.state.doc.sliceString(i.from,i.to)!=l)return null;let c=t.invertedDesc;return{range:new gd(c.mapPos(s),c.mapPos(o),s,o),text:r}}function iPt(e,t){return e.nodeType!=1?0:(t&&e.childNodes[t-1].contentEditable=="false"?1:0)|(t{it.from&&(n=!0)}),n}class t$ extends Nf{constructor(t){super(),this.height=t}toDOM(){let t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function uPt(e,t,n=1){let i=e.charCategorizer(t),r=e.doc.lineAt(t),s=t-r.from;if(r.length==0)return ht.cursor(t);s==0?n=1:s==r.length&&(n=-1);let o=s,l=s;n<0?o=Ro(r.text,s,!1):l=Ro(r.text,s);let c=i(r.text.slice(o,l));for(;o>0;){let u=Ro(r.text,o,!1);if(i(r.text.slice(u,o))!=c)break;o=u}for(;le.defaultLineHeight*1.5){let l=e.viewState.heightOracle.textHeight,c=Math.floor((r-n.top-(e.defaultLineHeight-l)*.5)/l);s+=c*e.viewState.heightOracle.lineLength}let o=e.state.sliceDoc(n.from,n.to);return n.from+R9(o,s,e.state.tabSize)}function H9(e,t,n){let i=e.lineBlockAt(t);if(Array.isArray(i.type)){let r;for(let s of i.type){if(s.from>t)break;if(!(s.tot)return s;(!r||s.type==ol.Text&&(r.type!=s.type||(n<0?s.fromt)))&&(r=s)}}return r||i}return i}function fPt(e,t,n,i){let r=H9(e,t.head,t.assoc||-1),s=!i||r.type!=ol.Text||!(e.lineWrapping||r.widgetLineBreaks)?null:e.coordsAtPos(t.assoc<0&&t.head>r.from?t.head-1:t.head);if(s){let o=e.dom.getBoundingClientRect(),l=e.textDirectionAt(r.from),c=e.posAtCoords({x:n==(l==os.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(c!=null)return ht.cursor(c,n?-1:1)}return ht.cursor(n?r.to:r.from,n?-1:1)}function Lie(e,t,n,i){let r=e.state.doc.lineAt(t.head),s=e.bidiSpans(r),o=e.textDirectionAt(r.from);for(let l=t,c=null;;){let u=BIt(r,s,o,l,n),d=w3e;if(!u){if(r.number==(n?e.state.doc.lines:1))return l;d=` +`,r=e.state.doc.line(r.number+(n?1:-1)),s=e.bidiSpans(r),u=e.visualLineSide(r,!n)}if(c){if(!c(d))return l}else{if(!i)return u;c=i(d)}l=u}}function hPt(e,t,n){let i=e.state.charCategorizer(t),r=i(n);return s=>{let o=i(s);return r==Qs.Space&&(r=o),r==o}}function pPt(e,t,n,i){let r=t.head,s=n?1:-1;if(r==(n?e.state.doc.length:0))return ht.cursor(r,t.assoc);let o=t.goalColumn,l,c=e.contentDOM.getBoundingClientRect(),u=e.coordsAtPos(r,t.assoc||((t.empty?n:t.head==t.from)?1:-1)),d=e.documentTop;if(u)o==null&&(o=u.left-c.left),l=s<0?u.top:u.bottom;else{let g=e.viewState.lineBlockAt(r);o==null&&(o=Math.min(c.right-c.left,e.defaultCharacterWidth*(r-g.from))),l=(s<0?g.top:g.bottom)+d}let f=c.left+o,h=e.viewState.heightOracle.textHeight>>1,m=i??h;for(let g=0;;g+=h){let b=l+(m+g)*s,v=q9(e,{x:f,y:b},!1,s);if(n?b>c.bottom:bl:w{if(t>s&&tr(e)),n.from,t.head>n.from?-1:1);return i==n.from?n:ht.cursor(i,ie.viewState.docHeight)return new nh(e.state.doc.length,-1);if(u=e.elementAtHeight(c),i==null)break;if(u.type==ol.Text){if(i<0?u.toe.viewport.to)break;let h=e.docView.coordsAt(i<0?u.from:u.to,i>0?-1:1);if(h&&(i<0?h.top<=c+s:h.bottom>=c+s))break}let f=e.viewState.heightOracle.textHeight/2;c=i>0?u.bottom+f:u.top-f}if(e.viewport.from>=u.to||e.viewport.to<=u.from){if(n)return null;if(u.type==ol.Text){let f=dPt(e,r,u,o,l);return new nh(f,f==u.from?1:-1)}}if(u.type!=ol.Text)return c<(u.top+u.bottom)/2?new nh(u.from,1):new nh(u.to,-1);let d=e.docView.lineAt(u.from,2);return(!d||d.length!=u.length)&&(d=e.docView.lineAt(u.from,-2)),new mPt(e,o,l,e.textDirectionAt(u.from)).scanTile(d,u.from)}class mPt{constructor(t,n,i,r){this.view=t,this.x=n,this.y=i,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(t){return(!this.line||this.line.from>t||this.line.to1||i.length&&(i[0].level!=this.baseDir||i[0].to+r.from>1;t:if(o.has(b)){let y=r+Math.floor(Math.random()*g);for(let w=0;w1)){if(w.bottomthis.y)(!u||u.top>w.top)&&(u=w),x=-1;else{let O=w.left>this.x?this.x-w.left:w.right(g+g+b)/3)return this.y=c.bottom-1,this.scan(t,n,!0);if(u&&u.top<(g+b+b)/3)return this.y=u.top+1,this.scan(t,n,!0)}let m=(l?this.dirAt(t[d],1):this.baseDir)==os.LTR;return{i:d,after:this.x>(h.left+h.right)/2==m}}scanText(t,n){let i=[];for(let s=0;s{let o=i[s]-n,l=i[s+1]-n;return BC(t.dom,o,l).getClientRects()});return r.after?new nh(i[r.i+1],-1):new nh(i[r.i],1)}scanTile(t,n){if(!t.length)return new nh(n,1);if(t.children.length==1){let l=t.children[0];if(l.isText())return this.scanText(l,n);if(l.isComposite())return this.scanTile(l,n)}let i=[n];for(let l=0,c=n;l{let c=t.children[l];return c.flags&48?null:(c.dom.nodeType==1?c.dom:BC(c.dom,0,c.length)).getClientRects()}),s=t.children[r.i],o=i[r.i];return s.isText()?this.scanText(s,o):s.isComposite()?this.scanTile(s,o):r.after?new nh(i[r.i+1],-1):new nh(o,1)}}const ux="￿";class gPt{constructor(t,n){this.points=t,this.view=n,this.text="",this.lineSeparator=n.state.facet(tr.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=ux}readRange(t,n){if(!t)return this;let i=t.parentNode;for(let r=t;;){this.findPointBefore(i,r);let s=this.text.length;this.readNode(r);let o=pa.get(r),l=r.nextSibling;if(l==n){o!=null&&o.breakAfter&&!l&&i!=this.view.contentDOM&&this.lineBreak();break}let c=pa.get(l);(o&&c?o.breakAfter:(o?o.breakAfter:zI(r))||zI(l)&&(r.nodeName!="BR"||o!=null&&o.isWidget())&&this.text.length>s)&&!yPt(l,n)&&this.lineBreak(),r=l}return this.findPointBefore(i,n),this}readTextNode(t){let n=t.nodeValue;for(let i of this.points)i.node==t&&(i.pos=this.text.length+Math.min(i.offset,n.length));for(let i=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,l;if(this.lineSeparator?(s=n.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=r.exec(n))&&(s=l.index,o=l[0].length),this.append(n.slice(i,s<0?n.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let c of this.points)c.node==t&&c.pos>this.text.length&&(c.pos-=o-1);i=s+o}}readNode(t){let n=pa.get(t),i=n&&n.overrideDOMText;if(i!=null){this.findPointInside(t,i.length);for(let r=i.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else t.nodeType==3?this.readTextNode(t):t.nodeName=="BR"?t.nextSibling&&this.lineBreak():t.nodeType==1&&this.readRange(t.firstChild,null)}findPointBefore(t,n){for(let i of this.points)i.node==t&&t.childNodes[i.offset]==n&&(i.pos=this.text.length)}findPointInside(t,n){for(let i of this.points)(t.nodeType==3?i.node==t:t.contains(i.node))&&(i.pos=this.text.length+(bPt(t,i.node,i.offset)?n:0))}}function bPt(e,t,n){for(;;){if(!t||n-1;let{impreciseHead:s,impreciseAnchor:o}=t.docView,l=t.state.selection;if(t.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=F3e(t.docView.tile,n,i,0))){let c=s||o?[]:wPt(t),u=new gPt(c,t);u.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=u.text,this.newSel=OPt(c,this.bounds.from)}else{let c=t.observer.selectionRange,u=s&&s.node==c.focusNode&&s.offset==c.focusOffset||!F9(t.contentDOM,c.focusNode)?l.main.head:t.docView.posFromDOM(c.focusNode,c.focusOffset),d=o&&o.node==c.anchorNode&&o.offset==c.anchorOffset||!F9(t.contentDOM,c.anchorNode)?l.main.anchor:t.docView.posFromDOM(c.anchorNode,c.anchorOffset),f=t.viewport;if((hn.ios||hn.chrome)&&u!=d&&Math.min(u,d)<=l.main.from&&Math.max(u,d)>=l.main.to&&(f.from>0||f.to-1&&l.ranges.length>1)this.newSel=l.replaceRange(ht.range(d,u));else if(t.lineWrapping&&d==u&&!(l.main.empty&&l.main.head==u)&&t.inputState.lastTouchTime>Date.now()-100){let h=t.coordsAtPos(u,-1),m=0;h&&(m=t.inputState.lastTouchY<=h.bottom?-1:1),this.newSel=ht.create([ht.cursor(u,m)])}else this.newSel=ht.single(d,u)}}}function F3e(e,t,n,i){if(e.isComposite()){let r=-1,s=-1,o=-1,l=-1;for(let c=0,u=i,d=i;cn)return F3e(f,t,n,u);if(h>=t&&r==-1&&(r=c,s=u),u>n&&f.dom.parentNode==e.dom){o=c,l=d;break}d=h,u=h+f.breakAfter}return{from:s,to:l<0?i+e.length:l,startDOM:(r?e.children[r-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:o=0?e.children[o].dom:null}}else return e.isText()?{from:i,to:i+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling}:null}function B3e(e,t){let n,{newSel:i}=t,{state:r}=e,s=r.selection.main,o=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:l,to:c}=t.bounds,u=s.from,d=null;(o===8||hn.android&&t.text.length=l&&s.to<=c&&(t.typeOver||f!=t.text)&&f.slice(0,s.from-l)==t.text.slice(0,s.from-l)&&f.slice(s.to-l)==t.text.slice(h=t.text.length-(f.length-(s.to-l)))?n={from:s.from,to:s.to,insert:xr.of(t.text.slice(s.from-l,h).split(ux))}:(m=U3e(f,t.text,u-l,d))&&(hn.chrome&&o==13&&m.toB==m.from+2&&t.text.slice(m.from,m.toB)==ux+ux&&m.toB--,n={from:l+m.from,to:l+m.toA,insert:xr.of(t.text.slice(m.from,m.toB).split(ux))})}else i&&(!e.hasFocus&&r.facet(wp)||WI(i,s))&&(i=null);if(!n&&!i)return!1;if((hn.mac||hn.android)&&n&&n.from==n.to&&n.from==s.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute("autocorrect")=="off"?(i&&n.insert.length==2&&(i=ht.single(i.main.anchor-1,i.main.head-1)),n={from:n.from,to:n.to,insert:xr.of([n.insert.toString().replace("."," ")])}):r.doc.lineAt(s.from).toDate.now()-50?n={from:s.from,to:s.to,insert:r.toText(e.inputState.insertingText)}:hn.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==` + `&&e.lineWrapping&&(i&&(i=ht.single(i.main.anchor-1,i.main.head-1)),n={from:s.from,to:s.to,insert:xr.of([" "])}),n)return Xq(e,n,i,o);if(i&&!WI(i,s)){let l=!1,c="select";return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin=="select"&&(l=!0),c=e.inputState.lastSelectionOrigin,c=="select.pointer"&&(i=$3e(r.facet(jT).map(u=>u(e)),i))),e.dispatch({selection:i,scrollIntoView:l,userEvent:c}),!0}else return!1}function Xq(e,t,n,i=-1){if(hn.ios&&e.inputState.flushIOSKey(t))return!0;let r=e.state.selection.main;if(hn.android&&(t.to==r.to&&(t.from==r.from||t.from==r.from-1&&e.state.sliceDoc(t.from,r.from)==" ")&&t.insert.length==1&&t.insert.lines==2&&vw(e.contentDOM,"Enter",13)||(t.from==r.from-1&&t.to==r.to&&t.insert.length==0||i==8&&t.insert.lengthr.head)&&vw(e.contentDOM,"Backspace",8)||t.from==r.from&&t.to==r.to+1&&t.insert.length==0&&vw(e.contentDOM,"Delete",46)))return!0;let s=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let o,l=()=>o||(o=xPt(e,t,n));return e.state.facet(C3e).some(c=>c(e,t.from,t.to,s,l))||e.dispatch(l()),!0}function xPt(e,t,n){let i,r=e.state,s=r.selection.main,o=-1;if(t.from==t.to&&t.froms.to){let c=t.fromf(e)),u,c);t.from==d&&(o=d)}if(o>-1)i={changes:t,selection:ht.cursor(t.from+t.insert.length,-1)};else if(t.from>=s.from&&t.to<=s.to&&t.to-t.from>=(s.to-s.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let c=s.fromt.to?r.sliceDoc(t.to,s.to):"";i=r.replaceSelection(e.state.toText(c+t.insert.sliceString(0,void 0,e.state.lineBreak)+u))}else{let c=r.changes(t),u=n&&n.main.to<=c.newLength?n.main:void 0;if(r.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=s.to+10&&t.to>=s.to-10){let d=e.state.sliceDoc(t.from,t.to),f,h=n&&L3e(e,n.main.head);if(h){let g=t.insert.length-(t.to-t.from);f={from:h.from,to:h.to-g}}else f=e.state.doc.lineAt(s.head);let m=s.to-t.to;i=r.changeByRange(g=>{if(g.from==s.from&&g.to==s.to)return{changes:c,range:u||g.map(c)};let b=g.to-m,v=b-d.length;if(e.state.sliceDoc(v,b)!=d||b>=f.from&&v<=f.to)return{range:g};let y=r.changes({from:v,to:b,insert:t.insert}),w=g.to-s.to;return{changes:y,range:u?ht.range(Math.max(0,u.anchor+w),Math.max(0,u.head+w)):g.map(y)}})}else i={changes:c,selection:u&&r.selection.replaceRange(u)}}let l="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,l+=".compose",e.inputState.compositionFirstChange&&(l+=".start",e.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:l,scrollIntoView:!0})}function U3e(e,t,n,i){let r=Math.min(e.length,t.length),s=0;for(;s0&&l>0&&e.charCodeAt(o-1)==t.charCodeAt(l-1);)o--,l--;if(i=="end"){let c=Math.max(0,s-Math.min(o,l));n-=o+c-s}if(o=o?s-n:0;s-=c,l=s+(l-o),o=s}else if(l=l?s-n:0;s-=c,o=s+(o-l),l=s}return{from:s,toA:o,toB:l}}function wPt(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}=e.observer.selectionRange;return n&&(t.push(new $ie(n,i)),(r!=n||s!=i)&&t.push(new $ie(r,s))),t}function OPt(e,t){if(e.length==0)return null;let n=e[0].pos,i=e.length==2?e[1].pos:n;return n>-1&&i>-1?ht.single(n+t,i+t):null}function WI(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}class kPt{setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}constructor(t){this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,hn.safari&&t.contentDOM.addEventListener("input",()=>null),hn.gecko&&FPt(t.contentDOM.ownerDocument)}handleEvent(t){!RPt(this.view,t)||this.ignoreDuringComposition(t)||t.type=="keydown"&&this.keydown(t)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(t.type,t)):this.runHandlers(t.type,t))}runHandlers(t,n){let i=this.handlers[t];if(i){for(let r of i.observers)r(this.view,n);for(let r of i.handlers){if(n.defaultPrevented)break;if(r(this.view,n)){n.preventDefault();break}}}}ensureHandlers(t){let n=EPt(t),i=this.handlers,r=this.view.contentDOM;for(let s in n)if(s!="scroll"){let o=!n[s].handlers.length,l=i[s];l&&o!=!l.handlers.length&&(r.removeEventListener(s,this.handleEvent),l=null),l||r.addEventListener(s,this.handleEvent,{passive:o})}for(let s in i)s!="scroll"&&!n[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=n}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&t.keyCode!=27&&z3e.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),hn.android&&hn.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;if(hn.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&(Q3e.some(n=>n.keyCode==t.keyCode)&&!t.ctrlKey||CPt.indexOf(t.key)>-1&&t.ctrlKey)){let n={ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey,shiftKey:t.shiftKey};return n.shiftKey&&hn.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&SPt(this.view.win)&&(n.shiftKey=!1),this.pendingIOSKey={key:t.key,keyCode:t.keyCode,mods:n},setTimeout(()=>this.flushIOSKey(),250),!0}return t.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(t){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&t&&t.from0?!0:hn.safari&&!hn.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.view.observer.update(t),this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function SPt(e){return e.visualViewport?e.visualViewport.height*e.visualViewport.scale/e.document.documentElement.clientHeight<.85:!1}function Fie(e,t){return(n,i)=>{try{return t.call(e,i,n)}catch(r){Mc(n.state,r)}}}function EPt(e){let t=Object.create(null);function n(i){return t[i]||(t[i]={observers:[],handlers:[]})}for(let i of e){let r=i.spec,s=r&&r.plugin.domEventHandlers,o=r&&r.plugin.domEventObservers;if(s)for(let l in s){let c=s[l];c&&n(l).handlers.push(Fie(i.value,c))}if(o)for(let l in o){let c=o[l];c&&n(l).observers.push(Fie(i.value,c))}}for(let i in kf)n(i).handlers.push(kf[i]);for(let i in oc)n(i).observers.push(oc[i]);return t}const Q3e=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],CPt="dthko",z3e=[16,17,18,20,91,92,224,225],H_=6;function q_(e){return Math.max(0,e)*.7+8}function APt(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}class TPt{constructor(t,n,i,r){this.view=t,this.startEvent=n,this.style=i,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=f3e(t.contentDOM),this.atoms=t.state.facet(jT).map(o=>o(t));let s=t.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=t.state.facet(tr.allowMultipleSelections)&&_Pt(t,n),this.dragging=NPt(t,n)&&q3e(n)==1?null:!1}start(t){this.dragging===!1&&this.select(t)}move(t){if(t.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&APt(this.startEvent,t)<10)return;this.select(this.lastEvent=t);let n=0,i=0,r=0,s=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:l}=this.scrollParents.y.getBoundingClientRect());let c=Gq(this.view);t.clientX-c.left<=r+H_?n=-q_(r-t.clientX):t.clientX+c.right>=o-H_&&(n=q_(t.clientX-o)),t.clientY-c.top<=s+H_?i=-q_(s-t.clientY):t.clientY+c.bottom>=l-H_&&(i=q_(t.clientY-l)),this.setScrollSpeed(n,i)}up(t){this.dragging==null&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,n){this.scrollSpeed={x:t,y:n},t||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:t,y:n}=this.scrollSpeed;t&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=t,t=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(t||n)&&this.view.win.scrollBy(t,n),this.dragging===!1&&this.select(this.lastEvent)}select(t){let{view:n}=this,i=$3e(this.atoms,this.style.get(t,this.extend,this.multiple));(this.mustSelect||!i.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(t){t.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(t)&&setTimeout(()=>this.select(this.lastEvent),20)}}function _Pt(e,t){let n=e.state.facet(O3e);return n.length?n[0](t):hn.mac?t.metaKey:t.ctrlKey}function jPt(e,t){let n=e.state.facet(k3e);return n.length?n[0](t):hn.mac?!t.altKey:!t.ctrlKey}function NPt(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let i=$C(e.root);if(!i||i.rangeCount==0)return!0;let r=i.getRangeAt(0).getClientRects();for(let s=0;s=t.clientX&&o.top<=t.clientY&&o.bottom>=t.clientY)return!0}return!1}function RPt(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,i;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(i=pa.get(n))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(t))return!1;return!0}const kf=Object.create(null),oc=Object.create(null),V3e=hn.ie&&hn.ie_version<15||hn.ios&&hn.webkit_version<604;function IPt(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{e.focus(),n.remove(),H3e(e,n.value)},50)}function JM(e,t,n){for(let i of e.facet(t))n=i(n,e);return n}function H3e(e,t){t=JM(e.state,Hq,t);let{state:n}=e,i,r=1,s=n.toText(t),o=s.lines==n.selection.ranges.length;if(W9!=null&&n.selection.ranges.every(c=>c.empty)&&W9==s.toString()){let c=-1;i=n.changeByRange(u=>{let d=n.doc.lineAt(u.from);if(d.from==c)return{range:u};c=d.from;let f=n.toText((o?s.line(r++).text:t)+n.lineBreak);return{changes:{from:d.from,insert:f},range:ht.cursor(u.from+f.length)}})}else o?i=n.changeByRange(c=>{let u=s.line(r++);return{changes:{from:c.from,to:c.to,insert:u.text},range:ht.cursor(c.from+u.length)}}):i=n.replaceSelection(s);e.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}oc.scroll=e=>{let t=e.inputState;t.lastScrollTop=e.scrollDOM.scrollTop,t.lastScrollLeft=e.scrollDOM.scrollLeft,hn.ios&&!t.touchActive&&(t.lastIOSMomentumScroll=Date.now())};oc.wheel=oc.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()};kf.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1);oc.touchstart=(e,t)=>{let n=e.inputState,i=t.targetTouches[0];n.touchActive=!0,n.lastTouchTime=Date.now(),i&&(n.lastTouchX=i.clientX,n.lastTouchY=i.clientY),n.setSelectionOrigin("select.pointer")};oc.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")};oc.touchend=(e,t)=>{e.inputState.touchActive=!1};kf.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let i of e.state.facet(S3e))if(n=i(e,t),n)break;if(!n&&t.button==0&&(n=DPt(e,t)),n){let i=!e.hasFocus;e.inputState.startMouseSelection(new TPt(e,t,n,i)),i&&e.observer.ignore(()=>{h3e(e.contentDOM);let s=e.root.activeElement;s&&!s.contains(e.contentDOM)&&s.blur()});let r=e.inputState.mouseSelection;if(r)return r.start(t),r.dragging===!1}else e.inputState.setSelectionOrigin("select.pointer");return!1};function Bie(e,t,n,i){if(i==1)return ht.cursor(t,n);if(i==2)return uPt(e.state,t,n);{let r=e.docView.lineAt(t,n),s=e.state.doc.lineAt(r?r.posAtEnd:t),o=r?r.posAtStart:s.from,l=r?r.posAtEnd:s.to;return lDate.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(Qie+1)%3:1}function DPt(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),i=q3e(t),r=e.state.selection;return{update(s){s.docChanged&&(n.pos=s.changes.mapPos(n.pos),r=r.map(s.changes))},get(s,o,l){let c=e.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),u,d=Bie(e,c.pos,c.assoc,i);if(n.pos!=c.pos&&!o){let f=Bie(e,n.pos,n.assoc,i),h=Math.min(f.from,d.from),m=Math.max(f.to,d.to);d=h1&&(u=MPt(r,c.pos))?u:l?r.addRange(d):ht.create([d])}}}function MPt(e,t){for(let n=0;n=t)return ht.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n?1:0))}return null}kf.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.tile.nearest(t.target);if(r&&r.isWidget()){let s=r.posAtStart,o=s+r.length;(s>=n.to||o<=n.from)&&(n=ht.undirectionalRange(s,o))}}let{inputState:i}=e;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",JM(e.state,qq,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1};kf.dragend=e=>(e.inputState.draggedContent=null,!1);function Vie(e,t,n,i){if(n=JM(e.state,Hq,n),!n)return;let r=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:s}=e.inputState,o=i&&s&&jPt(e,t)?{from:s.from,to:s.to}:null,l={from:r,insert:n},c=e.state.changes(o?[o,l]:l);e.focus(),e.dispatch({changes:c,selection:{anchor:c.mapPos(r,-1),head:c.mapPos(r,1)},userEvent:o?"move.drop":"input.drop"}),e.inputState.draggedContent=null}kf.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let i=Array(n.length),r=0,s=()=>{++r==n.length&&Vie(e,t,i.filter(o=>o!=null).join(e.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),s()},l.readAsText(n[o])}return!0}else{let i=t.dataTransfer.getData("Text");if(i)return Vie(e,t,i,!0),!0}return!1};kf.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=V3e?null:t.clipboardData;return n?(H3e(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(IPt(e),!1)};function LPt(e,t){let n=e.dom.parentNode;if(!n)return;let i=n.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=t,i.focus(),i.selectionEnd=t.length,i.selectionStart=0,setTimeout(()=>{i.remove(),e.focus()},50)}function $Pt(e){let t=[],n=[],i=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let r=-1;for(let{from:s}of e.selection.ranges){let o=e.doc.lineAt(s);o.number>r&&(t.push(o.text),n.push({from:o.from,to:Math.min(e.doc.length,o.to+1)})),r=o.number}i=!0}return{text:JM(e,qq,t.join(e.lineBreak)),ranges:n,linewise:i}}let W9=null;kf.copy=kf.cut=(e,t)=>{if(!wE(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:i,linewise:r}=$Pt(e.state);if(!n&&!r)return!1;W9=r?n:null,t.type=="cut"&&!e.state.readOnly&&e.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let s=V3e?null:t.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):(LPt(e,n),!1)};const W3e=Ih.define();function K3e(e,t){let n=[];for(let i of e.facet(A3e)){let r=i(e,t);r&&n.push(r)}return n.length?e.update({effects:n,annotations:W3e.of(!0)}):null}function G3e(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=K3e(e.state,t);n?e.dispatch(n):e.update([])}},10)}oc.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),G3e(e)};oc.blur=e=>{e.observer.clearSelectionRange(),G3e(e)};oc.compositionstart=oc.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange==null&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))};oc.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,hn.chrome&&hn.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))};oc.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()};kf.beforeinput=(e,t)=>{var n,i;if((t.inputType=="insertText"||t.inputType=="insertCompositionText")&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),t.inputType=="insertReplacementText"&&e.observer.editContext){let s=(n=t.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),o=t.getTargetRanges();if(s&&o.length){let l=o[0],c=e.posAtDOM(l.startContainer,l.startOffset),u=e.posAtDOM(l.endContainer,l.endOffset);return Xq(e,{from:c,to:u,insert:e.state.toText(s)},null),!0}}let r;if(hn.chrome&&hn.android&&(r=Q3e.find(s=>s.inputType==t.inputType))&&(e.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let s=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return hn.ios&&t.inputType=="deleteContentForward"&&e.observer.flushSoon(),hn.safari&&t.inputType=="insertText"&&e.inputState.composing>=0&&setTimeout(()=>oc.compositionend(e,t),20),!1};const Hie=new Set;function FPt(e){Hie.has(e)||(Hie.add(e),e.addEventListener("copy",()=>{}),e.addEventListener("cut",()=>{}))}const qie=["pre-wrap","normal","pre-line","break-spaces"];let h1=!1;function Wie(){h1=!1}class BPt{constructor(t){this.lineWrapping=t,this.doc=xr.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(t,n){let i=this.doc.lineAt(n).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((n-t-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return qie.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let n=!1;for(let i=0;i-1,c=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=n,this.charWidth=i,this.textHeight=r,this.lineLength=s,c){this.heightSamples={};for(let u=0;u0}set outdated(t){this.flags=(t?2:0)|this.flags&-3}setHeight(t){this.height!=t&&(Math.abs(this.height-t)>BN&&(h1=!0),this.height=t)}replace(t,n,i){return ac.of(i)}decomposeLeft(t,n){n.push(this)}decomposeRight(t,n){n.push(this)}applyChanges(t,n,i,r){let s=this,o=i.doc;for(let l=r.length-1;l>=0;l--){let{fromA:c,toA:u,fromB:d,toB:f}=r[l],h=s.lineAt(c,gs.ByPosNoHeight,i.setDoc(n),0,0),m=h.to>=u?h:s.lineAt(u,gs.ByPosNoHeight,i,0,0);for(f+=m.to-u,u=m.to;l>0&&h.from<=r[l-1].toA;)c=r[l-1].fromA,d=r[l-1].fromB,l--,cs*2){let l=t[n-1];l.break?t.splice(--n,1,l.left,null,l.right):t.splice(--n,1,l.left,l.right),i+=1+l.break,r-=l.size}else if(s>r*2){let l=t[i];l.break?t.splice(i,1,l.left,null,l.right):t.splice(i,1,l.left,l.right),i+=2+l.break,s-=l.size}else break;else if(r=s&&o(this.lineAt(0,gs.ByPos,i,r,s))}setMeasuredHeight(t){let n=t.heights[t.index++];n<0?(this.spaceAbove=-n,n=t.heights[t.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(t,n=0,i=!1,r){return r&&r.from<=n&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}}class fu extends X3e{constructor(t,n,i){super(t,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=i}mainBlock(t,n){return new lf(n,this.length,t+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(t,n,i){let r=i[0];return i.length==1&&(r instanceof fu||r instanceof Zo&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof Zo?r=new fu(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):ac.of(i)}updateHeight(t,n=0,i=!1,r){return r&&r.from<=n&&r.more?this.setMeasuredHeight(r):(i||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Zo extends ac{constructor(t){super(t,0)}heightMetrics(t,n){let i=t.doc.lineAt(n).number,r=t.doc.lineAt(n+this.length).number,s=r-i+1,o,l=0;if(t.lineWrapping){let c=Math.min(this.height,t.lineHeight*s);o=c/s,this.length>s+1&&(l=(this.height-c)/(this.length-s-1))}else o=this.height/s;return{firstLine:i,lastLine:r,perLine:o,perChar:l}}blockAt(t,n,i,r){let{firstLine:s,lastLine:o,perLine:l,perChar:c}=this.heightMetrics(n,r);if(n.lineWrapping){let u=r+(t0){let s=i[i.length-1];s instanceof Zo?i[i.length-1]=new Zo(s.length+r):i.push(null,new Zo(r-1))}if(t>0){let s=i[0];s instanceof Zo?i[0]=new Zo(t+s.length):i.unshift(new Zo(t-1),null)}return ac.of(i)}decomposeLeft(t,n){n.push(new Zo(t-1),null)}decomposeRight(t,n){n.push(null,new Zo(this.length-t-1))}updateHeight(t,n=0,i=!1,r){let s=n+this.length;if(r&&r.from<=n+this.length&&r.more){let o=[],l=Math.max(n,r.from),c=-1;for(r.from>n&&o.push(new Zo(r.from-n-1).updateHeight(t,n));l<=s&&r.more;){let d=t.doc.lineAt(l).length;o.length&&o.push(null);let f=r.heights[r.index++],h=0;f<0&&(h=-f,f=r.heights[r.index++]),c==-1?c=f:Math.abs(f-c)>=BN&&(c=-2);let m=new fu(d,f,h);m.outdated=!1,o.push(m),l+=d+1}l<=s&&o.push(null,new Zo(s-l).updateHeight(t,l));let u=ac.of(o);return(c<0||Math.abs(u.height-this.height)>=BN||Math.abs(c-this.heightMetrics(t,n).perLine)>=BN)&&(h1=!0),KI(this,u)}else(i||this.outdated)&&(this.setHeight(t.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class zPt extends ac{constructor(t,n,i){super(t.length+n+i.length,t.height+i.height,n|(t.outdated||i.outdated?2:0)),this.left=t,this.right=i,this.size=t.size+i.size}get break(){return this.flags&1}blockAt(t,n,i,r){let s=i+this.left.height;return tl))return u;let d=n==gs.ByPosNoHeight?gs.ByPosNoHeight:gs.ByPos;return c?u.join(this.right.lineAt(l,d,i,o,l)):this.left.lineAt(l,d,i,r,s).join(u)}forEachLine(t,n,i,r,s,o){let l=r+this.left.height,c=s+this.left.length+this.break;if(this.break)t=c&&this.right.forEachLine(t,n,i,l,c,o);else{let u=this.lineAt(c,gs.ByPos,i,r,s);t=t&&u.from<=n&&o(u),n>u.to&&this.right.forEachLine(u.to+1,n,i,l,c,o)}}replace(t,n,i){let r=this.left.length+this.break;if(nthis.left.length)return this.balanced(this.left,this.right.replace(t-r,n-r,i));let s=[];t>0&&this.decomposeLeft(t,s);let o=s.length;for(let l of i)s.push(l);if(t>0&&Kie(s,o-1),n=i&&n.push(null)),t>i&&this.right.decomposeLeft(t-i,n)}decomposeRight(t,n){let i=this.left.length,r=i+this.break;if(t>=r)return this.right.decomposeRight(t-r,n);t2*n.size||n.size>2*t.size?ac.of(this.break?[t,null,n]:[t,n]):(this.left=KI(this.left,t),this.right=KI(this.right,n),this.setHeight(t.height+n.height),this.outdated=t.outdated||n.outdated,this.size=t.size+n.size,this.length=t.length+this.break+n.length,this)}updateHeight(t,n=0,i=!1,r){let{left:s,right:o}=this,l=n+s.length+this.break,c=null;return r&&r.from<=n+s.length&&r.more?c=s=s.updateHeight(t,n,i,r):s.updateHeight(t,n,i),r&&r.from<=l+o.length&&r.more?c=o=o.updateHeight(t,l,i,r):o.updateHeight(t,l,i),c?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Kie(e,t){let n,i;e[t]==null&&(n=e[t-1])instanceof Zo&&(i=e[t+1])instanceof Zo&&e.splice(t-1,3,new Zo(n.length+1+i.length))}const VPt=5;class Yq{constructor(t,n){this.pos=t,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,n){if(this.lineStart>-1){let i=Math.min(n,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof fu?r.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new fu(i-this.pos,-1,0)),this.writtenTo=i,n>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(t,n,i){if(t=VPt)&&this.addLineDeco(r,s,o)}else n>t&&this.span(t,n);this.lineEnd>-1&&this.lineEnd-1)return;let{from:t,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=n,this.writtenTot&&this.nodes.push(new fu(this.pos-t,-1,0)),this.writtenTo=this.pos}blankContent(t,n){let i=new Zo(n-t);return this.oracle.doc.lineAt(t).to==n&&(i.flags|=4),i}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof fu)return t;let n=new fu(0,-1,0);return this.nodes.push(n),n}addBlock(t){this.enterLine();let n=t.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,n&&n.endSide>0&&(this.covering=t)}addLineDeco(t,n,i){let r=this.ensureLine();r.length+=i,r.collapsed+=i,r.widgetHeight=Math.max(r.widgetHeight,t),r.breaks+=n,this.writtenTo=this.pos=this.pos+i}finish(t){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof fu)&&!this.isCovered?this.nodes.push(new fu(0,-1,0)):(this.writtenTod.clientHeight||d.scrollWidth>d.clientWidth)&&f.overflow!="visible"){let h=d.getBoundingClientRect();s=Math.max(s,h.left),o=Math.min(o,h.right),l=Math.max(l,h.top),c=Math.min(u==e.parentNode?r.innerHeight:c,h.bottom)}u=f.position=="absolute"||f.position=="fixed"?d.offsetParent:d.parentNode}else if(u.nodeType==11)u=u.host;else break;return{left:s-n.left,right:Math.max(s,o)-n.left,top:l-(n.top+t),bottom:Math.max(l,c)-(n.top+t)}}function KPt(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left0&&t.top0}function GPt(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class i${constructor(t,n,i,r){this.from=t,this.to=n,this.size=i,this.displaySize=r}static same(t,n){if(t.length!=n.length)return!1;for(let i=0;itypeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new BPt(i),this.stateDeco=Yie(n),this.heightMap=ac.empty().applyChanges(this.stateDeco,xr.empty,this.heightOracle.setDoc(n.doc),[new gd(0,0,0,n.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Fn.set(this.lineGaps.map(r=>r.draw(this,!1))),this.scrollParent=t.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:n}=this.state.selection;for(let i=0;i<=1;i++){let r=i?n.head:n.anchor;if(!t.some(({from:s,to:o})=>r>=s&&r<=o)){let{from:s,to:o}=this.lineBlockAt(r);t.push(new W_(s,o))}}return this.viewports=t.sort((i,r)=>i.from-r.from),this.updateScaler()}updateScaler(){let t=this.scaler;return this.scaler=this.heightMap.height<=7e6?Xie:new Zq(this.heightOracle,this.heightMap,this.viewports),t.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,t=>{this.viewportLines.push(vS(t,this.scaler))})}update(t,n=null){this.state=t.state;let i=this.stateDeco;this.stateDeco=Yie(this.state);let r=t.changedRanges,s=gd.extendWithRanges(r,HPt(i,this.stateDeco,t?t.changes:lo.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);Wie(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||h1)&&(t.flags|=2),l?(this.scrollAnchorPos=t.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let c=s.length?this.mapViewport(this.viewport,t.changes):this.viewport;(n&&(n.range.headc.to)||!this.viewportIsAppropriate(c))&&(c=this.getViewport(0,n));let u=c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,t.flags|=this.updateForViewport(),(u||!t.changes.empty||t.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(t.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(t.selectionSet||t.focusChanged)&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(_3e)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:t}=this,n=t.contentDOM,i=window.getComputedStyle(n),r=this.heightOracle,s=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?os.RTL:os.LTR;let o=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",l=n.getBoundingClientRect(),c=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let u=0,d=0;if(l.width&&l.height){let{scaleX:k,scaleY:S}=d3e(n,l);(k>.005&&Math.abs(this.scaleX-k)>.005||S>.005&&Math.abs(this.scaleY-S)>.005)&&(this.scaleX=k,this.scaleY=S,u|=16,o=c=!0)}let f=(parseInt(i.paddingTop)||0)*this.scaleY,h=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=h)&&(this.paddingTop=f,this.paddingBottom=h,u|=18),this.editorWidth!=t.scrollDOM.clientWidth&&(r.lineWrapping&&(c=!0),this.editorWidth=t.scrollDOM.clientWidth,u|=16);let m=f3e(this.view.contentDOM,!1).y;m!=this.scrollParent&&(this.scrollParent=m,this.scrollAnchorHeight=-1,this.scrollOffset=0);let g=this.getScrollOffset();this.scrollOffset!=g&&(this.scrollAnchorHeight=-1,this.scrollOffset=g),this.scrolledToBottom=p3e(this.scrollParent||t.win);let b=(this.printing?GPt:WPt)(n,this.paddingTop),v=b.top-this.pixelViewport.top,y=b.bottom-this.pixelViewport.bottom;this.pixelViewport=b;let w=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(w!=this.inView&&(this.inView=w,w&&(c=!0)),!this.inView&&!this.scrollTarget&&!KPt(t.dom))return 0;let x=l.width;if((this.contentDOMWidth!=x||this.editorHeight!=t.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=t.scrollDOM.clientHeight,u|=16),c){let k=t.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(k)&&(o=!0),o||r.lineWrapping&&Math.abs(x-this.contentDOMWidth)>r.charWidth){let{lineHeight:S,charWidth:C,textHeight:E}=t.docView.measureTextSize();o=S>0&&r.refresh(s,S,C,E,Math.max(5,x/C),k),o&&(t.docView.minWidth=0,u|=16)}v>0&&y>0?d=Math.max(v,y):v<0&&y<0&&(d=Math.min(v,y)),Wie();for(let S of this.viewports){let C=S.from==this.viewport.from?k:t.docView.measureVisibleLineHeights(S);this.heightMap=(o?ac.empty().applyChanges(this.stateDeco,xr.empty,this.heightOracle,[new gd(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(r,0,o,new UPt(S.from,C))}h1&&(u|=2)}let O=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return O&&(u&2&&(u|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),u|=this.updateForViewport()),(u&2||O)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,t)),u|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),u}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,n){let i=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,c=new W_(r.lineAt(o-i*1e3,gs.ByHeight,s,0,0).from,r.lineAt(l+(1-i)*1e3,gs.ByHeight,s,0,0).to);if(n){let{head:u}=n.range;if(uc.to){let d=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=r.lineAt(u,gs.ByPos,s,0,0),h;n.y=="center"?h=(f.top+f.bottom)/2-d/2:n.y=="start"||n.y=="nearest"&&u=l+Math.max(10,Math.min(i,250)))&&r>o-2*1e3&&s>1,o=r<<1;if(this.defaultTextDirection!=os.LTR&&!i)return[];let l=[],c=(d,f,h,m)=>{if(f-dd&&yy.from>=h.from&&y.to<=h.to&&Math.abs(y.from-d)y.fromw));if(!v){if(fx.from<=f&&x.to>=f)){let x=n.moveToLineBoundary(ht.cursor(f),!1,!0).head;x>d&&(f=x)}let y=this.gapSize(h,d,f,m),w=i||y<2e6?y:2e6;v=new i$(d,f,y,w)}l.push(v)},u=d=>{if(d.length2e6)for(let S of t)S.from>=d.from&&S.fromd.from&&c(d.from,m,d,f),gn.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(t){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let i=[];Ki.spans(n,this.viewport.from,this.viewport.to,{span(s,o){i.push({from:s,to:o})},point(){}},20);let r=0;if(i.length!=this.visibleRanges.length)r=12;else for(let s=0;s=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(n=>n.from<=t&&n.to>=t)||vS(this.heightMap.lineAt(t,gs.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=t&&n.bottom>=t)||vS(this.heightMap.lineAt(this.scaler.fromDOM(t),gs.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(t){let n=this.lineBlockAtHeight(t+8);return n.from>=this.viewport.from||this.viewportLines[0].top-t>200?n:this.viewportLines[0]}elementAtHeight(t){return vS(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}let W_=class{constructor(t,n){this.from=t,this.to=n}};function YPt(e,t,n){let i=[],r=e,s=0;return Ki.spans(n,e,t,{span(){},point(o,l){o>r&&(i.push({from:r,to:o}),s+=o-r),r=l}},20),r=1)return t[t.length-1].to;let i=Math.floor(e*n);for(let r=0;;r++){let{from:s,to:o}=t[r],l=o-s;if(i<=l)return s+i;i-=l}}function G_(e,t){let n=0;for(let{from:i,to:r}of e.ranges){if(t<=r){n+=t-i;break}n+=r-i}return n/e.total}function ZPt(e,t){for(let n of e)if(t(n))return n}const Xie={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};function Yie(e){let t=e.facet(XM).filter(i=>typeof i!="function"),n=e.facet(Kq).filter(i=>typeof i!="function");return n.length&&t.push(Ki.join(n)),t}class Zq{constructor(t,n,i){let r=0,s=0,o=0;this.viewports=i.map(({from:l,to:c})=>{let u=n.lineAt(l,gs.ByPos,t,0,0).top,d=n.lineAt(c,gs.ByPos,t,0,0).bottom;return r+=d-u,{from:l,to:c,top:u,bottom:d,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(n.height-r);for(let l of this.viewports)l.domTop=o+(l.top-s)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),s=l.bottom}toDOM(t){for(let n=0,i=0,r=0;;n++){let s=nn.from==t.viewports[i].from&&n.to==t.viewports[i].to):!1}}function vS(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),i=t.toDOM(e.bottom);return new lf(e.from,e.length,n,i-n,Array.isArray(e._content)?e._content.map(r=>vS(r,t)):e._content)}const X_=mn.define({combine:e=>e.join(" ")}),K9=mn.define({combine:e=>e.indexOf(!0)>-1}),G9=pb.newName(),Y3e=pb.newName(),Z3e=pb.newName(),J3e={"&light":"."+Y3e,"&dark":"."+Z3e};function X9(e,t,n){return new pb(t,{finish(i){return/&/.test(i)?i.replace(/&\w*/,r=>{if(r=="&")return e;if(!n||!n[r])throw new RangeError(`Unsupported selector: ${r}`);return n[r]}):e+" "+i}})}const JPt=X9("."+G9,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},J3e),eDt={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},r$=hn.ie&&hn.ie_version<=11;class tDt{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new jIt,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver(n=>{for(let i of n)this.queue.push(i);(hn.ie&&hn.ie_version<=11||hn.ios&&t.composing)&&n.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&hn.android&&t.constructor.EDIT_CONTEXT!==!1&&!(hn.chrome&&hn.chrome_version<126)&&(this.editContext=new iDt(t),t.state.facet(wp)&&(t.contentDOM.editContext=this.editContext.editContext)),r$&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(t){(t.type=="change"||!t.type)&&!t.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some((n,i)=>n!=t[i]))){this.gapIntersection.disconnect();for(let n of t)this.gapIntersection.observe(n);this.gaps=t}}onSelectionChange(t){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,r=this.selectionRange;if(i.state.facet(wp)?i.root.activeElement!=this.dom:!wE(this.dom,r))return;let s=r.anchorNode&&i.docView.tile.nearest(r.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(t)){n||(this.selectionChanged=!1);return}(hn.ie&&hn.ie_version<=11||hn.android&&hn.chrome)&&!i.state.selection.main.empty&&r.focusNode&&kE(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,n=$C(t.root);if(!n)return!1;let i=hn.safari&&t.root.nodeType==11&&t.root.activeElement==this.dom&&nDt(this.view,n)||n;if(!i||this.selectionRange.eq(i))return!1;let r=wE(this.dom,i);return r&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&vw(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||t=="Enter")&&(this.delayedAndroidKey={key:t,keyCode:n,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let n=-1,i=-1,r=!1;for(let s of t){let o=this.readMutation(s);o&&(o.typeOver&&(r=!0),n==-1?{from:n,to:i}=o:(n=Math.min(o.from,n),i=Math.max(o.to,i)))}return{from:n,to:i,typeOver:r}}readChange(){let{from:t,to:n,typeOver:i}=this.processRecords(),r=this.selectionChanged&&wE(this.dom,this.selectionRange);if(t<0&&!r)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new vPt(this.view,t,n,i);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let i=this.view.state,r=B3e(this.view,n);return this.view.state==i&&(n.domChanged||n.newSel&&!WI(this.view.state.selection,n.newSel.main))&&this.view.update([]),r}readMutation(t){let n=this.view.docView.tile.nearest(t.target);if(!n||n.isWidget())return null;if(n.markDirty(t.type=="attributes"),t.type=="childList"){let i=Zie(n,t.previousSibling||t.target.previousSibling,-1),r=Zie(n,t.nextSibling||t.target.nextSibling,1);return{from:i?n.posAfter(i):n.posAtStart,to:r?n.posBefore(r):n.posAtEnd,typeOver:!1}}else return t.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}update(t){this.editContext&&(this.editContext.update(t),t.startState.facet(wp)!=t.state.facet(wp)&&(t.view.contentDOM.editContext=t.state.facet(wp)?this.editContext.editContext:null))}destroy(){var t,n,i;this.stop(),(t=this.intersection)===null||t===void 0||t.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function Zie(e,t,n){for(;t;){let i=pa.get(t);if(i&&i.parent==e)return i;let r=t.parentNode;t=r!=e.dom?r:n>0?t.nextSibling:t.previousSibling}return null}function Jie(e,t){let n=t.startContainer,i=t.startOffset,r=t.endContainer,s=t.endOffset,o=e.docView.domAtPos(e.state.selection.main.anchor,1);return kE(o.node,o.offset,r,s)&&([n,i,r,s]=[r,s,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}}function nDt(e,t){if(t.getComposedRanges){let r=t.getComposedRanges(e.root)[0];if(r)return Jie(e,r)}let n=null;function i(r){r.preventDefault(),r.stopImmediatePropagation(),n=r.getTargetRanges()[0]}return e.contentDOM.addEventListener("beforeinput",i,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",i,!0),n?Jie(e,n):null}class iDt{constructor(t){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(t.state);let n=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});this.handlers.textupdate=i=>{let r=t.state.selection.main,{anchor:s,head:o}=r,l=this.toEditorPos(i.updateRangeStart),c=this.toEditorPos(i.updateRangeEnd);t.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:l,drifted:!1});let u=c-l>i.text.length;l==this.from&&sthis.to&&(c=s);let d=U3e(t.state.sliceDoc(l,c),i.text,(u?r.from:r.to)-l,u?"end":null);if(!d){let h=ht.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));WI(h,r)||t.dispatch({selection:h,userEvent:"select"});return}let f={from:d.from+l,to:d.toA+l,insert:xr.of(i.text.slice(d.from,d.toB).split(` +`))};if((hn.mac||hn.android)&&f.from==o-1&&/^\. ?$/.test(i.text)&&t.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:l,to:c,insert:xr.of([i.text.replace("."," ")])}),this.pendingContextChange=f,!t.state.readOnly){let h=this.to-this.from+(f.to-f.from+f.insert.length);Xq(t,f,ht.single(this.toEditorPos(i.selectionStart,h),this.toEditorPos(i.selectionEnd,h)))}this.pendingContextChange&&(this.revertPending(t.state),this.setSelection(t.state)),f.from=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(n.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let r=[],s=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o{let r=[];for(let s of i.getTextFormats()){let o=s.underlineStyle,l=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(l)){let c=this.toEditorPos(s.rangeStart),u=this.toEditorPos(s.rangeEnd);if(c{t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(t.inputState.composing=-1,t.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(t.state)}};for(let i in this.handlers)n.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{let r=$C(i.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let n=0,i=!1,r=this.pendingContextChange;return t.changes.iterChanges((s,o,l,c,u)=>{if(i)return;let d=u.length-(o-s);if(r&&o>=r.to)if(r.from==s&&r.to==o&&r.insert.eq(u)){r=this.pendingContextChange=null,n+=d,this.to+=d;return}else r=null,this.revertPending(t.state);if(s+=n,o+=n,o<=this.from)this.from+=d,this.to+=d;else if(sthis.to||this.to-this.from+u.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),u.toString()),this.to+=d}n+=d}),r&&!i&&this.revertPending(t.state),!i}update(t){let n=this.pendingContextChange,i=t.startState.selection.main;this.composing&&(this.composing.drifted||!t.changes.touchesRange(i.from,i.to)&&t.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=t.changes.mapPos(this.composing.editorBase)):!this.applyEdits(t)||!this.rangeIsValid(t.state)?(this.pendingContextChange=null,this.reset(t.state)):(t.docChanged||t.selectionSet||n)&&this.setSelection(t.state),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:n}=t.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(t.doc.length,n+1e4)}reset(t){this.resetRange(t),this.editContext.updateText(0,this.editContext.text.length,t.doc.sliceString(this.from,this.to)),this.setSelection(t)}revertPending(t){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),t.doc.sliceString(n.from,n.to))}setSelection(t){let{main:n}=t.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),r=this.toContextPos(n.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(i,r)}rangeIsValid(t){let{head:n}=t.selection.main;return!(this.from>0&&n-this.from<500||this.to1e4*3)}toEditorPos(t,n=this.to-this.from){t=Math.min(t,n);let i=this.composing;return i&&i.drifted?i.editorBase+(t-i.contextBase):t+this.from}toContextPos(t){let n=this.composing;return n&&n.drifted?n.contextBase+(t-n.editorBase):t-this.from}destroy(){for(let t in this.handlers)this.editContext.removeEventListener(t,this.handlers[t])}}class Jt{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),t.parent&&t.parent.appendChild(this.dom);let{dispatch:i}=t;this.dispatchTransactions=t.dispatchTransactions||i&&(r=>r.forEach(s=>i(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=t.root||NIt(t.parent)||document,this.viewState=new Gie(this,t.state||tr.create(t)),t.scrollTo&&t.scrollTo.is(V_)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Bx).map(r=>new Z4(r));for(let r of this.plugins)r.update(this);this.observer=new tDt(this),this.inputState=new kPt(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Mie(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...t){let n=t.length==1&&t[0]instanceof Xa?t:t.length==1&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(n,this)}update(t){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,i=!1,r,s=this.state;for(let h of t){if(h.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=h.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,l=0,c=null;t.some(h=>h.annotation(W3e))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,c=K3e(s,o),c||(l=1));let u=this.observer.delayedAndroidKey,d=null;if(u?(this.observer.clearDelayedAndroidKey(),d=this.observer.readChange(),(d&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(d=null)):this.observer.clear(),s.facet(tr.phrases)!=this.state.facet(tr.phrases))return this.setState(s);r=VI.create(this,s,t),r.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let h of t){if(f&&(f=f.map(h.changes)),h.scrollIntoView){let{main:m}=h.state.selection,{x:g,y:b}=this.state.facet(Jt.cursorScrollMargin);f=new xw(m.empty?m:ht.cursor(m.head,m.head>m.anchor?-1:1),"nearest","nearest",b,g)}for(let m of h.effects)m.is(V_)&&(f=m.value.clip(this.state))}this.viewState.update(r,f),this.bidiCache=GI.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),n=this.docView.update(r),this.state.facet(yS)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(n,t.some(h=>h.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(X_)!=r.state.facet(X_)&&(this.viewState.mustMeasureContent=!0),(n||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!r.empty)for(let h of this.state.facet(z9))try{h(r)}catch(m){Mc(this.state,m,"update listener")}(c||d)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),d&&!B3e(this,d)&&u.force&&vw(this.contentDOM,u.key,u.keyCode)})}setState(t){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=t;return}this.updateState=2;let n=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new Gie(this,t),this.plugins=t.facet(Bx).map(i=>new Z4(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new Mie(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(t){let n=t.startState.facet(Bx),i=t.state.facet(Bx);if(n!=i){let r=[];for(let s of i){let o=n.indexOf(s);if(o<0)r.push(new Z4(s));else{let l=this.plugins[o];l.mustUpdate=t,r.push(l)}}for(let s of this.plugins)s.mustUpdate!=t&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=t;for(let r=0;r-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,t&&this.observer.forceFlush();let n=null,i=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(p3e(i||this.win))s=-1,o=this.viewState.heightMap.height;else{let m=this.viewState.scrollAnchorAt(r);s=m.from,o=m.top}this.updateState=1;let c=this.viewState.measure();if(!c&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let u=[];c&4||([this.measureRequests,u]=[u,this.measureRequests]);let d=u.map(m=>{try{return m.read(this)}catch(g){return Mc(this.state,g),ere}}),f=VI.create(this,this.state,[]),h=!1;f.flags|=c,n?n.flags|=c:n=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),h=this.docView.update(f),h&&this.docViewUpdate());for(let m=0;m1||g<-1)&&!(hn.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(i==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r=r+g,i?i.scrollTop+=g:this.win.scrollBy(0,g),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let l of this.state.facet(z9))l(n)}get themeClasses(){return G9+" "+(this.state.facet(K9)?Z3e:Y3e)+" "+this.state.facet(X_)}updateAttrs(){let t=tre(this,R3e,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(wp)?"true":"false",class:"cm-content",style:`${hn.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),tre(this,Wq,n);let i=this.observer.ignore(()=>{let r=jie(this.contentDOM,this.contentAttrs,n),s=jie(this.dom,this.editorAttrs,t);return r||s});return this.editorAttrs=t,this.contentAttrs=n,i}showAnnouncements(t){let n=!0;for(let i of t)for(let r of i.effects)if(r.is(Jt.announce)){n&&(this.announceDOM.textContent=""),n=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(yS);let t=this.state.facet(Jt.cspNonce);pb.mount(this.root,this.styleModules.concat(JPt).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),t){if(this.measureRequests.indexOf(t)>-1)return;if(t.key!=null){for(let n=0;ni.plugin==t)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,n,i){return n$(this,t,Lie(this,t,n,i))}moveByGroup(t,n){return n$(this,t,Lie(this,t,n,i=>hPt(this,t.head,i)))}visualLineSide(t,n){let i=this.bidiSpans(t),r=this.textDirectionAt(t.from),s=i[n?i.length-1:0];return ht.cursor(s.side(n,r)+t.from,s.forward(!n,r)?1:-1)}moveToLineBoundary(t,n,i=!0){return fPt(this,t,n,i)}moveVertically(t,n,i){return n$(this,t,pPt(this,t,n,i))}domAtPos(t,n=1){return this.docView.domAtPos(t,n)}posAtDOM(t,n=0){return this.docView.posFromDOM(t,n)}posAtCoords(t,n=!0){this.readMeasured();let i=q9(this,t,n);return i&&i.pos}posAndSideAtCoords(t,n=!0){return this.readMeasured(),q9(this,t,n)}coordsAtPos(t,n=1){this.readMeasured();let i=this.state.doc.lineAt(t),r=this.bidiSpans(i),s=r[ch.find(r,t-i.from,-1,n)];return this.docView.coordsAt(t,n,s.dir==os.RTL)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(T3e)||tthis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>rDt)return x3e(t.length);let n=this.textDirectionAt(t.from),i;for(let s of this.bidiCache)if(s.from==t.from&&s.dir==n&&(s.fresh||v3e(s.isolates,i=Iie(this,t))))return s.order;i||(i=Iie(this,t));let r=FIt(t.text,n,i);return this.bidiCache.push(new GI(t.from,t.to,n,i,!0,r)),r}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||hn.safari&&((t=this.inputState)===null||t===void 0?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{h3e(this.contentDOM),this.docView.updateSelection()})}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((t.nodeType==9?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,n={}){var i,r,s,o;return V_.of(new xw(typeof t=="number"?ht.cursor(t):t,(i=n.y)!==null&&i!==void 0?i:"nearest",(r=n.x)!==null&&r!==void 0?r:"nearest",(s=n.yMargin)!==null&&s!==void 0?s:5,(o=n.xMargin)!==null&&o!==void 0?o:5))}scrollSnapshot(){let{scrollTop:t,scrollLeft:n}=this.scrollDOM,i=this.viewState.scrollAnchorAt(t);return V_.of(new xw(ht.cursor(i.from),"start","start",i.top-t,n,!0))}setTabFocusMode(t){t==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof t=="boolean"?this.inputState.tabFocusMode=t?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+t)}static domEventHandlers(t){return ma.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return ma.define(()=>({}),{eventObservers:t})}static theme(t,n){let i=pb.newName(),r=[X_.of(i),yS.of(X9(`.${i}`,t))];return n&&n.dark&&r.push(K9.of(!0)),r}static baseTheme(t){return bm.lowest(yS.of(X9("."+G9,t,J3e)))}static findFromDOM(t){var n;let i=t.querySelector(".cm-content"),r=i&&pa.get(i)||pa.get(t);return((n=r==null?void 0:r.root)===null||n===void 0?void 0:n.view)||null}}Jt.styleModule=yS;Jt.inputHandler=C3e;Jt.clipboardInputFilter=Hq;Jt.clipboardOutputFilter=qq;Jt.scrollHandler=j3e;Jt.focusChangeEffect=A3e;Jt.perLineTextDirection=T3e;Jt.exceptionSink=E3e;Jt.updateListener=z9;Jt.editable=wp;Jt.mouseSelectionStyle=S3e;Jt.dragMovesSelection=k3e;Jt.clickAddsSelectionRange=O3e;Jt.decorations=XM;Jt.blockWrappers=I3e;Jt.outerDecorations=Kq;Jt.atomicRanges=jT;Jt.bidiIsolatedRanges=P3e;Jt.cursorScrollMargin=mn.define({combine:e=>{let t=5,n=5;for(let i of e)typeof i=="number"?t=n=i:{x:t,y:n}=i;return{x:t,y:n}}});Jt.scrollMargins=D3e;Jt.darkTheme=K9;Jt.cspNonce=mn.define({combine:e=>e.length?e[0]:""});Jt.contentAttributes=Wq;Jt.editorAttributes=R3e;Jt.lineWrapping=Jt.contentAttributes.of({class:"cm-lineWrapping"});Jt.announce=pi.define();const rDt=4096,ere={};class GI{constructor(t,n,i,r,s,o){this.from=t,this.to=n,this.dir=i,this.isolates=r,this.fresh=s,this.order=o}static update(t,n){if(n.empty&&!t.some(s=>s.fresh))return t;let i=[],r=t.length?t[t.length-1].dir:os.LTR;for(let s=Math.max(0,t.length-10);s=0;r--){let s=i[r],o=typeof s=="function"?s(e):s;o&&Qq(o,n)}return n}const sDt=hn.mac?"mac":hn.windows?"win":hn.linux?"linux":"key";function aDt(e,t){const n=e.split(/-(?!$)/);let i=n[n.length-1];i=="Space"&&(i=" ");let r,s,o,l;for(let c=0;ci.concat(r),[]))),n}function lDt(e,t,n){return t4e(e4e(e.state),t,e,n)}let lg=null;const cDt=4e3;function uDt(e,t=sDt){let n=Object.create(null),i=Object.create(null),r=(o,l)=>{let c=i[o];if(c==null)i[o]=l;else if(c!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,l,c,u,d)=>{var f,h;let m=n[o]||(n[o]=Object.create(null)),g=l.split(/ (?!$)/).map(y=>aDt(y,t));for(let y=1;y{let O=lg={view:x,prefix:w,scope:o};return setTimeout(()=>{lg==O&&(lg=null)},cDt),!0}]})}let b=g.join(" ");r(b,!1);let v=m[b]||(m[b]={preventDefault:!1,stopPropagation:!1,run:((h=(f=m._any)===null||f===void 0?void 0:f.run)===null||h===void 0?void 0:h.slice())||[]});c&&v.run.push(c),u&&(v.preventDefault=!0),d&&(v.stopPropagation=!0)};for(let o of e){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let u of l){let d=n[u]||(n[u]=Object.create(null));d._any||(d._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=o;for(let h in d)d[h].run.push(m=>f(m,Y9))}let c=o[t]||o.key;if(c)for(let u of l)s(u,c,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(u,"Shift-"+c,o.shift,o.preventDefault,o.stopPropagation)}return n}let Y9=null;function t4e(e,t,n,i){Y9=t;let r=SIt(t),s=Nc(r,0),o=th(s)==r.length&&r!=" ",l="",c=!1,u=!1,d=!1;lg&&lg.view==n&&lg.scope==i&&(l=lg.prefix+" ",z3e.indexOf(t.keyCode)<0&&(u=!0,lg=null));let f=new Set,h=v=>{if(v){for(let y of v.run)if(!f.has(y)&&(f.add(y),y(n)))return v.stopPropagation&&(d=!0),!0;v.preventDefault&&(v.stopPropagation&&(d=!0),u=!0)}return!1},m=e[i],g,b;return m&&(h(m[l+Y_(r,t,!o)])?c=!0:o&&(t.altKey||t.metaKey||t.ctrlKey)&&!(hn.windows&&t.ctrlKey&&t.altKey)&&!(hn.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(g=mb[t.keyCode])&&g!=r?(h(m[l+Y_(g,t,!0)])||t.shiftKey&&(b=MC[t.keyCode])!=r&&b!=g&&h(m[l+Y_(b,t,!1)]))&&(c=!0):o&&t.shiftKey&&h(m[l+Y_(r,t,!0)])&&(c=!0),!c&&h(m._any)&&(c=!0)),u&&(c=!0),c&&d&&t.stopPropagation(),Y9=null,c}class Jy{constructor(t,n,i,r,s){this.className=t,this.left=n,this.top=i,this.width=r,this.height=s}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}update(t,n){return n.className!=this.className?!1:(this.adjust(t),!0)}adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",this.width!=null&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}static forRange(t,n,i){if(i.empty){let r=t.coordsAtPos(i.head,i.assoc||1);if(!r)return[];let s=n4e(t);return[new Jy(n,r.left-s.left,r.top-s.top,null,r.bottom-r.top)]}else return dDt(t,n,i)}}function n4e(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==os.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function ire(e,t,n,i){let r=e.coordsAtPos(t,n*2);if(!r)return i;let s=e.dom.getBoundingClientRect(),o=(r.top+r.bottom)/2,l=e.posAtCoords({x:s.left+1,y:o}),c=e.posAtCoords({x:s.right-1,y:o});return l==null||c==null?i:{from:Math.max(i.from,Math.min(l,c)),to:Math.min(i.to,Math.max(l,c))}}function dDt(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let i=Math.max(n.from,e.viewport.from),r=Math.min(n.to,e.viewport.to),s=e.textDirection==os.LTR,o=e.contentDOM,l=o.getBoundingClientRect(),c=n4e(e),u=o.querySelector(".cm-line"),d=u&&window.getComputedStyle(u),f=l.left+(d?parseInt(d.paddingLeft)+Math.min(0,parseInt(d.textIndent)):0),h=l.right-(d?parseInt(d.paddingRight):0),m=H9(e,i,1),g=H9(e,r,-1),b=m.type==ol.Text?m:null,v=g.type==ol.Text?g:null;if(b&&(e.lineWrapping||m.widgetLineBreaks)&&(b=ire(e,i,1,b)),v&&(e.lineWrapping||g.widgetLineBreaks)&&(v=ire(e,r,-1,v)),b&&v&&b.from==v.from&&b.to==v.to)return w(x(n.from,n.to,b));{let k=b?x(n.from,null,b):O(m,!1),S=v?x(null,n.to,v):O(g,!0),C=[];return(b||m).to<(v||g).from-(b&&v?1:0)||m.widgetLineBreaks>1&&k.bottom+e.defaultLineHeight/2A&&D.from=P)break;M>I&&R(Math.max(F,I),k==null&&F<=A,Math.min(M,P),S==null&&M>=N,L.dir)}if(I=_.to+1,I>=P)break}return T.length==0&&R(A,k==null,N,S==null,e.textDirection),{top:E,bottom:j,horizontal:T}}function O(k,S){let C=l.top+(S?k.top:k.bottom);return{top:C,bottom:C,horizontal:[]}}}function fDt(e,t){return e.constructor==t.constructor&&e.eq(t)}class hDt{constructor(t,n){this.view=t,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,t)}update(t){t.startState.facet(UN)!=t.state.facet(UN)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq))}docViewUpdate(t){this.layer.updateOnDocViewUpdate!==!1&&t.requestMeasure(this.measureReq)}setOrder(t){let n=0,i=t.facet(UN);for(;n!fDt(n,this.drawn[i]))){let n=this.dom.firstChild,i=0;for(let r of t)r.update&&n&&r.constructor&&this.drawn[i].constructor&&r.update(n,this.drawn[i])?(n=n.nextSibling,i++):this.dom.insertBefore(r.draw(),n);for(;n;){let r=n.nextSibling;n.remove(),n=r}this.drawn=t,hn.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const UN=mn.define();function i4e(e){return[ma.define(t=>new hDt(t,e)),UN.of(e)]}const p1=mn.define({combine(e){return Ph(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(t,n)=>Math.min(t,n),drawRangeCursor:(t,n)=>t||n})}});function pDt(e={}){return[p1.of(e),mDt,gDt,bDt,_3e.of(!0)]}function r4e(e){return e.startState.facet(p1)!=e.state.facet(p1)}const mDt=i4e({above:!0,markers(e){let{state:t}=e,n=t.facet(p1),i=[];for(let r of t.selection.ranges){let s=r==t.selection.main;if(r.empty||n.drawRangeCursor&&!(s&&hn.ios&&n.iosSelectionHandles)){let o=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=r.empty?r:ht.cursor(r.head,r.assoc);for(let c of Jy.forRange(e,o,l))i.push(c)}}return i},update(e,t){e.transactions.some(i=>i.selection)&&(t.style.animationName=t.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=r4e(e);return n&&rre(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){rre(t.state,e)},class:"cm-cursorLayer"});function rre(e,t){t.style.animationDuration=e.facet(p1).cursorBlinkRate+"ms"}const gDt=i4e({above:!1,markers(e){let t=[],{main:n,ranges:i}=e.state.selection;for(let r of i)if(!r.empty)for(let s of Jy.forRange(e,"cm-selectionBackground",r))t.push(s);if(hn.ios&&!n.empty&&e.state.facet(p1).iosSelectionHandles){for(let r of Jy.forRange(e,"cm-selectionHandle cm-selectionHandle-start",ht.cursor(n.from,1)))t.push(r);for(let r of Jy.forRange(e,"cm-selectionHandle cm-selectionHandle-end",ht.cursor(n.to,1)))t.push(r)}return t},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||r4e(e)},class:"cm-selectionLayer"}),bDt=bm.highest(Jt.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),s4e=pi.define({map(e,t){return e==null?null:t.mapPos(e)}}),xS=dl.define({create(){return null},update(e,t){return e!=null&&(e=t.changes.mapPos(e)),t.effects.reduce((n,i)=>i.is(s4e)?i.value:n,e)}}),yDt=ma.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(xS);n==null?this.cursor!=null&&((t=this.cursor)===null||t===void 0||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(xS)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(xS),n=t!=null&&e.coordsAtPos(t);if(!n)return null;let i=e.scrollDOM.getBoundingClientRect();return{left:n.left-i.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-i.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/n+"px",this.cursor.style.height=e.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(xS)!=e&&this.view.dispatch({effects:s4e.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){(e.target==this.view.contentDOM||!this.view.contentDOM.contains(e.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function vDt(){return[xS,yDt]}function sre(e,t,n,i,r){t.lastIndex=0;for(let s=e.iterRange(n,i),o=n,l;!s.next().done;o+=s.value.length)if(!s.lineBreak)for(;l=t.exec(s.value);)r(o+l.index,l)}function xDt(e,t){let n=e.visibleRanges;if(n.length==1&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let i=[];for(let{from:r,to:s}of n)r=Math.max(e.state.doc.lineAt(r).from,r-t),s=Math.min(e.state.doc.lineAt(s).to,s+t),i.length&&i[i.length-1].to>=r?i[i.length-1].to=s:i.push({from:r,to:s});return i}class wDt{constructor(t){const{regexp:n,decoration:i,decorate:r,boundary:s,maxLength:o=1e3}=t;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,r)this.addMatch=(l,c,u,d)=>r(d,u,u+l[0].length,l,c);else if(typeof i=="function")this.addMatch=(l,c,u,d)=>{let f=i(l,c,u);f&&d(u,u+l[0].length,f)};else if(i)this.addMatch=(l,c,u,d)=>d(u,u+l[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=o}createDeco(t){let n=new nm,i=n.add.bind(n);for(let{from:r,to:s}of xDt(t,this.maxLength))sre(t.state.doc,this.regexp,r,s,(o,l)=>this.addMatch(l,t,o,i));return n.finish()}updateDeco(t,n){let i=1e9,r=-1;return t.docChanged&&t.changes.iterChanges((s,o,l,c)=>{c>=t.view.viewport.from&&l<=t.view.viewport.to&&(i=Math.min(l,i),r=Math.max(c,r))}),t.viewportMoved||r-i>1e3?this.createDeco(t.view):r>-1?this.updateRange(t.view,n.map(t.changes),i,r):n}updateRange(t,n,i,r){for(let s of t.visibleRanges){let o=Math.max(s.from,i),l=Math.min(s.to,r);if(l>=o){let c=t.state.doc.lineAt(o),u=c.toc.from;o--)if(this.boundary.test(c.text[o-1-c.from])){d=o;break}for(;lh.push(y.range(b,v));if(c==u)for(this.regexp.lastIndex=d-c.from;(m=this.regexp.exec(c.text))&&m.indexthis.addMatch(v,t,b,g));n=n.update({filterFrom:d,filterTo:f,filter:(b,v)=>bf,add:h})}}return n}}const Z9=/x/.unicode!=null?"gu":"g",ODt=new RegExp(`[\0-\b +--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Z9),kDt={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let s$=null;function SDt(){var e;if(s$==null&&typeof document<"u"&&document.body){let t=document.body.style;s$=((e=t.tabSize)!==null&&e!==void 0?e:t.MozTabSize)!=null}return s$||!1}const QN=mn.define({combine(e){let t=Ph(e,{render:null,specialChars:ODt,addSpecialChars:null});return(t.replaceTabs=!SDt())&&(t.specialChars=new RegExp(" |"+t.specialChars.source,Z9)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,Z9)),t}});function EDt(e={}){return[QN.of(e),CDt()]}let are=null;function CDt(){return are||(are=ma.fromClass(class{constructor(e){this.view=e,this.decorations=Fn.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(QN)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new wDt({regexp:e.specialChars,decoration:(t,n,i)=>{let{doc:r}=n.state,s=Nc(t[0],0);if(s==9){let o=r.lineAt(i),l=n.state.tabSize,c=Of(o.text,l,i-o.from);return Fn.replace({widget:new jDt((l-c%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=Fn.replace({widget:new _Dt(e,s)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(QN);e.startState.facet(QN)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))}const ADt="•";function TDt(e){return e>=32?ADt:e==10?"␤":String.fromCharCode(9216+e)}class _Dt extends Nf{constructor(t,n){super(),this.options=t,this.code=n}eq(t){return t.code==this.code}toDOM(t){let n=TDt(this.code),i=t.state.phrase("Control character")+" "+(kDt[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,i,n);if(r)return r;let s=document.createElement("span");return s.textContent=n,s.title=i,s.setAttribute("aria-label",i),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class jDt extends Nf{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent=" ",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}function NDt(){return IDt}const RDt=Fn.line({class:"cm-activeLine"}),IDt=ma.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let i of e.state.selection.ranges){let r=e.lineBlockAt(i.head);r.from>t&&(n.push(RDt.range(r.from)),t=r.from)}return Fn.set(n)}},{decorations:e=>e.decorations});class PDt extends Nf{constructor(t){super(),this.content=t}toDOM(t){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(t):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(t){let n=t.firstChild?OE(t.firstChild):[];if(!n.length)return null;let i=window.getComputedStyle(t.parentNode),r=FC(n[0],i.direction!="rtl"),s=parseInt(i.lineHeight);return r.bottom-r.top>s*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+s}:r}ignoreEvent(){return!1}}function DDt(e){let t=ma.fromClass(class{constructor(n){this.view=n,this.placeholder=e?Fn.set([Fn.widget({widget:new PDt(e),side:1}).range(0)]):Fn.none}get decorations(){return this.view.state.doc.length?Fn.none:this.placeholder}},{decorations:n=>n.decorations});return typeof e=="string"?[t,Jt.contentAttributes.of({"aria-placeholder":e})]:t}const J9=2e3;function MDt(e,t,n){let i=Math.min(t.line,n.line),r=Math.max(t.line,n.line),s=[];if(t.off>J9||n.off>J9||t.col<0||n.col<0){let o=Math.min(t.off,n.off),l=Math.max(t.off,n.off);for(let c=i;c<=r;c++){let u=e.doc.line(c);u.length<=l&&s.push(ht.range(u.from+o,u.to+l))}}else{let o=Math.min(t.col,n.col),l=Math.max(t.col,n.col);for(let c=i;c<=r;c++){let u=e.doc.line(c),d=R9(u.text,o,e.tabSize,!0);if(d<0)s.push(ht.cursor(u.to));else{let f=R9(u.text,l,e.tabSize);s.push(ht.range(u.from+d,u.from+f))}}}return s}function LDt(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}function ore(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),i=e.state.doc.lineAt(n),r=n-i.from,s=r>J9?-1:r==i.length?LDt(e,t.clientX):Of(i.text,e.state.tabSize,n-i.from);return{line:i.number,col:s,off:r}}function $Dt(e,t){let n=ore(e,t),i=e.state.selection;return n?{update(r){if(r.docChanged){let s=r.changes.mapPos(r.startState.doc.line(n.line).from),o=r.state.doc.lineAt(s);n={line:o.number,col:n.col,off:Math.min(n.off,o.length)},i=i.map(r.changes)}},get(r,s,o){let l=ore(e,r);if(!l)return i;let c=MDt(e.state,n,l);return c.length?o?ht.create(c.concat(i.ranges)):ht.create(c):i}}:null}function FDt(e){let t=n=>n.altKey&&n.button==0;return Jt.mouseSelectionStyle.of((n,i)=>t(i)?$Dt(n,i):null)}const BDt={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},UDt={style:"cursor: crosshair"};function QDt(e={}){let[t,n]=BDt[e.key||"Alt"],i=ma.fromClass(class{constructor(r){this.view=r,this.isDown=!1}set(r){this.isDown!=r&&(this.isDown=r,this.view.update([]))}},{eventObservers:{keydown(r){this.set(r.keyCode==t||n(r))},keyup(r){(r.keyCode==t||!n(r))&&this.set(!1)},mousemove(r){this.set(n(r))}}});return[i,Jt.contentAttributes.of(r=>{var s;return!((s=r.plugin(i))===null||s===void 0)&&s.isDown?UDt:null})]}const Z_="-10000px";class a4e{constructor(t,n,i,r){this.facet=n,this.createTooltipView=i,this.removeTooltipView=r,this.input=t.state.facet(n),this.tooltips=this.input.filter(o=>o);let s=null;this.tooltipViews=this.tooltips.map(o=>s=i(o,s))}update(t,n){var i;let r=t.state.facet(this.facet),s=r.filter(c=>c);if(r===this.input){for(let c of this.tooltipViews)c.update&&c.update(t);return!1}let o=[],l=n?[]:null;for(let c=0;cn[u]=c),n.length=l.length),this.input=r,this.tooltips=s,this.tooltipViews=o,!0}}function zDt(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}const a$=mn.define({combine:e=>{var t,n,i;return{position:hn.ios?"absolute":((t=e.find(r=>r.position))===null||t===void 0?void 0:t.position)||"fixed",parent:((n=e.find(r=>r.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((i=e.find(r=>r.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||zDt}}}),lre=new WeakMap,Jq=ma.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(a$);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new a4e(e,eW,(n,i)=>this.createTooltip(n,i),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,i=e.state.facet(a$);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;n=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),i=t?t.dom:null;if(n.dom.classList.add("cm-tooltip"),e.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let r=document.createElement("div");r.className="cm-tooltip-arrow",n.dom.appendChild(r)}return n.dom.style.position=this.position,n.dom.style.top=Z_,n.dom.style.left="0px",this.container.insertBefore(n.dom,i),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(e=i.destroy)===null||e===void 0||e.call(i);this.parent&&this.container.remove(),(t=this.resizeObserver)===null||t===void 0||t.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(hn.safari){let o=s.getBoundingClientRect();n=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}else n=!!s.offsetParent&&s.offsetParent!=this.container.ownerDocument.body}if(n||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(e=s.width/this.parent.offsetWidth,t=s.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),r=Gq(this.view);return{visible:{left:i.left+r.left,top:i.top+r.top,right:i.right-r.right,bottom:i.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,o)=>{let l=this.manager.tooltipViews[o];return l.getCoords?l.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(a$).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){var t;if(e.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:n,space:i,scaleX:r,scaleY:s}=e,o=[];for(let l=0;l=Math.min(n.bottom,i.bottom)||f.rightMath.min(n.right,i.right)+.1)){d.style.top=Z_;continue}let m=c.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,g=m?7:0,b=h.right-h.left,v=(t=lre.get(u))!==null&&t!==void 0?t:h.bottom-h.top,y=u.offset||HDt,w=this.view.textDirection==os.LTR,x=h.width>i.right-i.left?w?i.left:i.right-h.width:w?Math.max(i.left,Math.min(f.left-(m?14:0)+y.x,i.right-b)):Math.min(Math.max(i.left,f.left-b+(m?14:0)-y.x),i.right-b),O=this.above[l];!c.strictSide&&(O?f.top-v-g-y.yi.bottom)&&O==i.bottom-f.bottom>f.top-i.top&&(O=this.above[l]=!O);let k=(O?f.top-i.top:i.bottom-f.bottom)-g;if(kx&&E.topS&&(S=O?E.top-v-2-g:E.bottom+g+2);if(this.position=="absolute"?(d.style.top=(S-e.parent.top)/s+"px",cre(d,(x-e.parent.left)/r)):(d.style.top=S/s+"px",cre(d,x/r)),m){let E=f.left+(w?y.x:-y.x)-(x+14-7);m.style.left=E/r+"px"}u.overlap!==!0&&o.push({left:x,top:S,right:C,bottom:S+v}),d.classList.toggle("cm-tooltip-above",O),d.classList.toggle("cm-tooltip-below",!O),u.positioned&&u.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=Z_}},{eventObservers:{scroll(){this.maybeMeasure()}}});function cre(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}const VDt=Jt.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),HDt={x:0,y:0},eW=mn.define({enables:[Jq,VDt]}),XI=mn.define({combine:e=>e.reduce((t,n)=>t.concat(n),[])});class eL{static create(t){return new eL(t)}constructor(t){this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new a4e(t,XI,(n,i)=>this.createHostedView(n,i),n=>n.dom.remove())}createHostedView(t,n){let i=t.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}mount(t){for(let n of this.manager.tooltipViews)n.mount&&n.mount(t);this.mounted=!0}positioned(t){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(t)}update(t){this.manager.update(t)}destroy(){var t;for(let n of this.manager.tooltipViews)(t=n.destroy)===null||t===void 0||t.call(n)}passProp(t){let n;for(let i of this.manager.tooltipViews){let r=i[t];if(r!==void 0){if(n===void 0)n=r;else if(n!==r)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const qDt=eW.compute([XI],e=>{let t=e.facet(XI);return t.length===0?null:{pos:Math.min(...t.map(n=>n.pos)),end:Math.max(...t.map(n=>{var i;return(i=n.end)!==null&&i!==void 0?i:n.pos})),create:eL.create,above:t[0].above,arrow:t.some(n=>n.arrow)}}),o4e=mn.define();class WDt{constructor(t,n,i,r,s,o){this.view=t,this.source=n,this.field=i,this.locked=r,this.setHover=s,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:t.dom,time:0},this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(t){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let t=Date.now()-this.lastMove.time;to.bottom||n.xo.right+t.defaultCharacterWidth)return;let l=t.bidiSpans(t.state.doc.lineAt(r)).find(u=>u.from<=r&&u.to>=r),c=l&&l.dir==os.RTL?-1:1;s=n.x{if(l&&!(Array.isArray(l)&&!l.length)){let c=Array.isArray(l)?l:[l];r&&this.locked.set(c,r),t.dispatch({effects:this.setHover.of(c)})}};if(s&&"then"in s){let l=this.pending={pos:n};s.then(c=>{this.pending==l&&(this.pending=null,o(c))},c=>Mc(t.state,c,"hover tooltip"))}else o(s)}get tooltip(){let t=this.view.plugin(Jq),n=t?t.manager.tooltips.findIndex(i=>i.create==eL.create):-1;return n>-1?t.manager.tooltipViews[n]:null}mousemove(t){var n,i;this.lastMove={x:t.clientX,y:t.clientY,target:t.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:s}=this;if(r.length&&!this.locked.has(r)&&s&&!KDt(s.dom,t)||this.pending){let{pos:o}=r[0]||this.pending,l=(i=(n=r[0])===null||n===void 0?void 0:n.end)!==null&&i!==void 0?i:o;(o==l?this.view.posAtCoords(this.lastMove)!=o:!GDt(this.view,o,l,t.clientX,t.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(t){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length&&!this.locked.has(n)){let{tooltip:i}=this;i&&i.dom.contains(t.relatedTarget)?this.watchTooltipLeave(i.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(t){let n=i=>{t.removeEventListener("mouseleave",n);let{active:r}=this;r.length&&!this.locked.has(r)&&!this.view.dom.contains(i.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};t.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const J_=4;function KDt(e,t){let{left:n,right:i,top:r,bottom:s}=e.getBoundingClientRect(),o;if(o=e.querySelector(".cm-tooltip-arrow")){let l=o.getBoundingClientRect();r=Math.min(l.top,r),s=Math.max(l.bottom,s)}return t.clientX>=n-J_&&t.clientX<=i+J_&&t.clientY>=r-J_&&t.clientY<=s+J_}function GDt(e,t,n,i,r,s){let o=e.scrollDOM.getBoundingClientRect(),l=e.documentTop+e.documentPadding.top+e.contentHeight;if(o.left>i||o.rightr||Math.min(o.bottom,l)=t&&c<=n}function XDt(e,t={}){let n=pi.define(),i=new WeakMap,r=dl.define({create(){return[]},update(o,l){let c=i.get(o);if(o.length&&(t.hideOnChange&&(l.docChanged||l.selection)?o=[]:c&&c(l)?o=[]:t.hideOn&&(o=o.filter(u=>!t.hideOn(l,u)))),l.docChanged&&o.length){let u=[];for(let d of o){let f=l.changes.mapPos(d.pos,-1,il.TrackDel);if(f!=null){let h=Object.assign(Object.create(null),d);h.pos=f,h.end!=null&&(h.end=l.changes.mapPos(h.end)),u.push(h)}}o=u}for(let u of l.effects)u.is(n)&&(o=u.value,c=void 0),(u.is(ZDt)&&!u.value||u.value==r)&&(o=[]);return o.length&&c&&i.set(o,c),o},provide:o=>XI.from(o)});const s=ma.define(o=>new WDt(o,e,r,i,n,t.hoverTime||300));return{active:r,extension:[r,s,o4e.of(s),qDt]}}function YDt(e,t,n,i={}){var r;let s=e.state.facet(o4e).map(o=>e.plugin(o)).filter(o=>!!o);if(i.tooltip&&i.tooltip.active){let o=s.find(l=>l.field==i.tooltip.active);o&&(s=[o])}for(let o of s)o.activateHover(e,t,n,(r=i.until)!==null&&r!==void 0?r:()=>!1)}function l4e(e,t){let n=e.plugin(Jq);if(!n)return null;let i=n.manager.tooltips.indexOf(t);return i<0?null:n.manager.tooltipViews[i]}const ZDt=pi.define(),ure=mn.define({combine(e){let t,n;for(let i of e)t=t||i.topContainer,n=n||i.bottomContainer;return{topContainer:t,bottomContainer:n}}});function tW(e,t){let n=e.plugin(c4e),i=n?n.specs.indexOf(t):-1;return i>-1?n.panels[i]:null}const c4e=ma.fromClass(class{constructor(e){this.input=e.state.facet(UC),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(e));let t=e.state.facet(ure);this.top=new ej(e,!0,t.topContainer),this.bottom=new ej(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(e){let t=e.state.facet(ure);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new ej(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new ej(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(UC);if(n!=this.input){let i=n.filter(c=>c),r=[],s=[],o=[],l=[];for(let c of i){let u=this.specs.indexOf(c),d;u<0?(d=c(e.view),l.push(d)):(d=this.panels[u],d.update&&d.update(e)),r.push(d),(d.top?s:o).push(d)}this.specs=i,this.panels=r,this.top.sync(s),this.bottom.sync(o);for(let c of l)c.dom.classList.add("cm-panel"),c.mount&&c.mount()}else for(let i of this.panels)i.update&&i.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>Jt.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class ej{constructor(t,n,i){this.view=t,this.top=n,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let n of this.panels)n.destroy&&t.indexOf(n)<0&&n.destroy();this.panels=t,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let t=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;t!=n.dom;)t=dre(t);t=t.nextSibling}else this.dom.insertBefore(n.dom,t);for(;t;)t=dre(t)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let t of this.classes.split(" "))t&&this.container.classList.remove(t);for(let t of(this.classes=this.view.themeClasses).split(" "))t&&this.container.classList.add(t)}}}function dre(e){let t=e.nextSibling;return e.remove(),t}const UC=mn.define({enables:c4e});function JDt(e,t){let n,i=new Promise(o=>n=o),r=o=>eMt(o,t,n);e.state.field(o$,!1)?e.dispatch({effects:u4e.of(r)}):e.dispatch({effects:pi.appendConfig.of(o$.init(()=>[r]))});let s=d4e.of(r);return{close:s,result:i.then(o=>((e.win.queueMicrotask||(c=>e.win.setTimeout(c,10)))(()=>{e.state.field(o$).indexOf(r)>-1&&e.dispatch({effects:s})}),o))}}const o$=dl.define({create(){return[]},update(e,t){for(let n of t.effects)n.is(u4e)?e=[n.value].concat(e):n.is(d4e)&&(e=e.filter(i=>i!=n.value));return e},provide:e=>UC.computeN([e],t=>t.field(e))}),u4e=pi.define(),d4e=pi.define();function eMt(e,t,n){let i=t.content?t.content(e,()=>o(null)):null;if(!i){if(i=Kr("form"),t.input){let l=Kr("input",t.input);/^(text|password|number|email|tel|url)$/.test(l.type)&&l.classList.add("cm-textfield"),l.name||(l.name="input"),i.appendChild(Kr("label",(t.label||"")+": ",l))}else i.appendChild(document.createTextNode(t.label||""));i.appendChild(document.createTextNode(" ")),i.appendChild(Kr("button",{class:"cm-button",type:"submit"},t.submitLabel||"OK"))}let r=i.nodeName=="FORM"?[i]:i.querySelectorAll("form");for(let l=0;l{u.keyCode==27?(u.preventDefault(),o(null)):u.keyCode==13&&(u.preventDefault(),o(c))}),c.addEventListener("submit",u=>{u.preventDefault(),o(c)})}let s=Kr("div",i,Kr("button",{onclick:()=>o(null),"aria-label":e.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));t.class&&(s.className=t.class),s.classList.add("cm-dialog");function o(l){s.contains(s.ownerDocument.activeElement)&&e.focus(),n(l)}return{dom:s,top:t.top,mount:()=>{if(t.focus){let l;typeof t.focus=="string"?l=i.querySelector(t.focus):l=i.querySelector("input")||i.querySelector("button"),l&&"select"in l?l.select():l&&"focus"in l&&l.focus()}}}}class rm extends hb{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}rm.prototype.elementClass="";rm.prototype.toDOM=void 0;rm.prototype.mapMode=il.TrackBefore;rm.prototype.startSide=rm.prototype.endSide=-1;rm.prototype.point=!0;const zN=mn.define(),tMt=mn.define(),nMt={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Ki.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},EE=mn.define();function iMt(e){return[f4e(),EE.of({...nMt,...e})]}const fre=mn.define({combine:e=>e.some(t=>t)});function f4e(e){return[rMt]}const rMt=ma.fromClass(class{constructor(e){this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=e.state.facet(EE).map(t=>new pre(e,t)),this.fixed=!e.state.facet(fre);for(let t of this.gutters)t.config.side=="after"?this.getDOMAfter().appendChild(t.dom):this.dom.appendChild(t.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,i=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(i<(n.to-n.from)*.8)}if(e.geometryChanged){let t=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=t,this.domAfter&&(this.domAfter.style.minHeight=t)}this.view.state.facet(fre)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=Ki.iter(this.view.state.facet(zN),this.view.viewport.from),i=[],r=this.gutters.map(s=>new sMt(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(s.type)){let o=!0;for(let l of s.type)if(l.type==ol.Text&&o){e7(n,i,l.from);for(let c of r)c.line(this.view,l,i);o=!1}else if(l.widget)for(let c of r)c.widget(this.view,l)}else if(s.type==ol.Text){e7(n,i,s.from);for(let o of r)o.line(this.view,s,i)}else if(s.widget)for(let o of r)o.widget(this.view,s);for(let s of r)s.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(EE),n=e.state.facet(EE),i=e.docChanged||e.heightChanged||e.viewportChanged||!Ki.eq(e.startState.facet(zN),e.state.facet(zN),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let r of this.gutters)r.update(e)&&(i=!0);else{i=!0;let r=[];for(let s of n){let o=t.indexOf(s);o<0?r.push(new pre(this.view,s)):(this.gutters[o].update(e),r.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),r.indexOf(s)<0&&s.destroy();for(let s of r)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=r}return i}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>Jt.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||n.gutters.length==0||!n.fixed)return null;let i=n.dom.offsetWidth*t.scaleX,r=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==os.LTR?{left:i,right:r}:{right:i,left:r}})});function hre(e){return Array.isArray(e)?e:[e]}function e7(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class sMt{constructor(t,n,i){this.gutter=t,this.height=i,this.i=0,this.cursor=Ki.iter(t.markers,n.from)}addElement(t,n,i){let{gutter:r}=this,s=(n.top-this.height)/t.scaleY,o=n.height/t.scaleY;if(this.i==r.elements.length){let l=new h4e(t,o,s,i);r.elements.push(l),r.dom.appendChild(l.dom)}else r.elements[this.i].update(t,o,s,i);this.height=n.bottom,this.i++}line(t,n,i){let r=[];e7(this.cursor,r,n.from),i.length&&(r=r.concat(i));let s=this.gutter.config.lineMarker(t,n,r);s&&r.unshift(s);let o=this.gutter;r.length==0&&!o.config.renderEmptyElements||this.addElement(t,n,r)}widget(t,n){let i=this.gutter.config.widgetMarker(t,n.widget,n),r=i?[i]:null;for(let s of t.state.facet(tMt)){let o=s(t,n.widget,n);o&&(r||(r=[])).push(o)}r&&this.addElement(t,n,r)}finish(){let t=this.gutter;for(;t.elements.length>this.i;){let n=t.elements.pop();t.dom.removeChild(n.dom),n.destroy()}}}class pre{constructor(t,n){this.view=t,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in n.domEventHandlers)this.dom.addEventListener(i,r=>{let s=r.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let c=s.getBoundingClientRect();o=(c.top+c.bottom)/2}else o=r.clientY;let l=t.lineBlockAtHeight(o-t.documentTop);n.domEventHandlers[i](t,l,r)&&r.preventDefault()});this.markers=hre(n.markers(t)),n.initialSpacer&&(this.spacer=new h4e(t,0,0,[n.initialSpacer(t)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(t){let n=this.markers;if(this.markers=hre(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],t);r!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[r])}let i=t.view.viewport;return!Ki.eq(this.markers,n,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(t):!1)}destroy(){for(let t of this.elements)t.destroy()}}class h4e{constructor(t,n,i,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(t,n,i,r)}update(t,n,i,r){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),aMt(this.markers,r)||this.setMarkers(t,r)}setMarkers(t,n){let i="cm-gutterElement",r=this.dom.firstChild;for(let s=0,o=0;;){let l=o,c=ss(l,c,u)||o(l,c,u):o}return i}})}});class l$ extends rm{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function c$(e,t){return e.state.facet(Ux).formatNumber(t,e.state)}const cMt=EE.compute([Ux],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(t){return t.state.facet(oMt)},lineMarker(t,n,i){return i.some(r=>r.toDOM)?null:new l$(c$(t,t.state.doc.lineAt(n.from).number))},widgetMarker:(t,n,i)=>{for(let r of t.state.facet(lMt)){let s=r(t,n,i);if(s)return s}return null},lineMarkerChange:t=>t.startState.facet(Ux)!=t.state.facet(Ux),initialSpacer(t){return new l$(c$(t,mre(t.state.doc.lines)))},updateSpacer(t,n){let i=c$(n.view,mre(n.view.state.doc.lines));return i==t.number?t:new l$(i)},domEventHandlers:e.facet(Ux).domEventHandlers,side:"before"}));function p4e(e={}){return[Ux.of(e),f4e(),cMt]}function mre(e){let t=9;for(;t{let t=[],n=-1;for(let i of e.selection.ranges){let r=e.doc.lineAt(i.head).from;r>n&&(n=r,t.push(uMt.range(r)))}return Ki.of(t)});function fMt(){return dMt}let hMt=0,Yf=class t7{constructor(t,n,i,r){this.name=t,this.set=n,this.base=i,this.modified=r,this.id=hMt++}toString(){let{name:t}=this;for(let n of this.modified)n.name&&(t=`${n.name}(${t})`);return t}static define(t,n){let i=typeof t=="string"?t:"?";if(t instanceof t7&&(n=t),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let r=new t7(i,[],null,[]);if(r.set.push(r),n)for(let s of n.set)r.set.push(s);return r}static defineModifier(t){let n=new YI(t);return i=>i.modified.indexOf(n)>-1?i:YI.get(i.base||i,i.modified.concat(n).sort((r,s)=>r.id-s.id))}},pMt=0;class YI{constructor(t){this.name=t,this.instances=[],this.id=pMt++}static get(t,n){if(!n.length)return t;let i=n[0].instances.find(l=>l.base==t&&mMt(n,l.modified));if(i)return i;let r=[],s=new Yf(t.name,r,t,n);for(let l of n)l.instances.push(s);let o=gMt(n);for(let l of t.set)if(!l.modified.length)for(let c of o)r.push(YI.get(l,c));return s}}function mMt(e,t){return e.length==t.length&&e.every((n,i)=>n==t[i])}function gMt(e){let t=[[]];for(let n=0;ni.length-n.length)}function ym(e){let t=Object.create(null);for(let n in e){let i=e[n];Array.isArray(i)||(i=[i]);for(let r of n.split(" "))if(r){let s=[],o=2,l=r;for(let f=0;;){if(l=="..."&&f>0&&f+3==r.length){o=1;break}let h=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!h)throw new RangeError("Invalid path: "+r);if(s.push(h[0]=="*"?"":h[0][0]=='"'?JSON.parse(h[0]):h[0]),f+=h[0].length,f==r.length)break;let m=r[f++];if(f==r.length&&m=="!"){o=0;break}if(m!="/")throw new RangeError("Invalid path: "+r);l=r.slice(f)}let c=s.length-1,u=s[c];if(!u)throw new RangeError("Invalid path: "+r);let d=new QC(i,o,c>0?s.slice(0,c):null);t[u]=d.sort(t[u])}}return m4e.add(t)}const m4e=new ui({combine(e,t){let n,i,r;for(;e||t;){if(!e||t&&e.depth>=t.depth?(r=t,t=t.next):(r=e,e=e.next),n&&n.mode==r.mode&&!r.context&&!n.context)continue;let s=new QC(r.tags,r.mode,r.context);n?n.next=s:i=s,n=s}return i}});let QC=class{constructor(t,n,i,r){this.tags=t,this.mode=n,this.context=i,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(t){return!t||t.depth{let o=r;for(let l of s)for(let c of l.set){let u=n[c.id];if(u){o=o?o+" "+u:u;break}}return o},scope:i}}function bMt(e,t){let n=null;for(let i of e){let r=i.style(t);r&&(n=n?n+" "+r:r)}return n}function yMt(e,t,n,i=0,r=e.length){let s=new vMt(i,Array.isArray(t)?t:[t],n);s.highlightRange(e.cursor(),i,r,"",s.highlighters),s.flush(r)}class vMt{constructor(t,n,i){this.at=t,this.highlighters=n,this.span=i,this.class=""}startSpan(t,n){n!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=n)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,n,i,r,s){let{type:o,from:l,to:c}=t;if(l>=i||c<=n)return;o.isTop&&(s=this.highlighters.filter(m=>!m.scope||m.scope(o)));let u=r,d=xMt(t)||QC.empty,f=bMt(s,d.tags);if(f&&(u&&(u+=" "),u+=f,d.mode==1&&(r+=(r?" ":"")+f)),this.startSpan(Math.max(n,l),u),d.opaque)return;let h=t.tree&&t.tree.prop(ui.mounted);if(h&&h.overlay){let m=t.node.enter(h.overlay[0].from+l,1),g=this.highlighters.filter(v=>!v.scope||v.scope(h.tree.type)),b=t.firstChild();for(let v=0,y=l;;v++){let w=v=x||!t.nextSibling())););if(!w||x>i)break;y=w.to+l,y>n&&(this.highlightRange(m.cursor(),Math.max(n,w.from+l),Math.min(i,y),"",g),this.startSpan(Math.min(i,y),u))}b&&t.parent()}else if(t.firstChild()){h&&(r="");do if(!(t.to<=n)){if(t.from>=i)break;this.highlightRange(t,n,i,r,s),this.startSpan(Math.min(i,t.to),u)}while(t.nextSibling());t.parent()}}}function xMt(e){let t=e.type.prop(m4e);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}const an=Yf.define,tj=an(),Ym=an(),gre=an(Ym),bre=an(Ym),Zm=an(),nj=an(Zm),u$=an(Zm),Kf=an(),ty=an(Kf),Vf=an(),Hf=an(),n7=an(),Ek=an(n7),ij=an(),he={comment:tj,lineComment:an(tj),blockComment:an(tj),docComment:an(tj),name:Ym,variableName:an(Ym),typeName:gre,tagName:an(gre),propertyName:bre,attributeName:an(bre),className:an(Ym),labelName:an(Ym),namespace:an(Ym),macroName:an(Ym),literal:Zm,string:nj,docString:an(nj),character:an(nj),attributeValue:an(nj),number:u$,integer:an(u$),float:an(u$),bool:an(Zm),regexp:an(Zm),escape:an(Zm),color:an(Zm),url:an(Zm),keyword:Vf,self:an(Vf),null:an(Vf),atom:an(Vf),unit:an(Vf),modifier:an(Vf),operatorKeyword:an(Vf),controlKeyword:an(Vf),definitionKeyword:an(Vf),moduleKeyword:an(Vf),operator:Hf,derefOperator:an(Hf),arithmeticOperator:an(Hf),logicOperator:an(Hf),bitwiseOperator:an(Hf),compareOperator:an(Hf),updateOperator:an(Hf),definitionOperator:an(Hf),typeOperator:an(Hf),controlOperator:an(Hf),punctuation:n7,separator:an(n7),bracket:Ek,angleBracket:an(Ek),squareBracket:an(Ek),paren:an(Ek),brace:an(Ek),content:Kf,heading:ty,heading1:an(ty),heading2:an(ty),heading3:an(ty),heading4:an(ty),heading5:an(ty),heading6:an(ty),contentSeparator:an(Kf),list:an(Kf),quote:an(Kf),emphasis:an(Kf),strong:an(Kf),link:an(Kf),monospace:an(Kf),strikethrough:an(Kf),inserted:an(),deleted:an(),changed:an(),invalid:an(),meta:ij,documentMeta:an(ij),annotation:an(ij),processingInstruction:an(ij),definition:Yf.defineModifier("definition"),constant:Yf.defineModifier("constant"),function:Yf.defineModifier("function"),standard:Yf.defineModifier("standard"),local:Yf.defineModifier("local"),special:Yf.defineModifier("special")};for(let e in he){let t=he[e];t instanceof Yf&&(t.name=e)}g4e([{tag:he.link,class:"tok-link"},{tag:he.heading,class:"tok-heading"},{tag:he.emphasis,class:"tok-emphasis"},{tag:he.strong,class:"tok-strong"},{tag:he.keyword,class:"tok-keyword"},{tag:he.atom,class:"tok-atom"},{tag:he.bool,class:"tok-bool"},{tag:he.url,class:"tok-url"},{tag:he.labelName,class:"tok-labelName"},{tag:he.inserted,class:"tok-inserted"},{tag:he.deleted,class:"tok-deleted"},{tag:he.literal,class:"tok-literal"},{tag:he.string,class:"tok-string"},{tag:he.number,class:"tok-number"},{tag:[he.regexp,he.escape,he.special(he.string)],class:"tok-string2"},{tag:he.variableName,class:"tok-variableName"},{tag:he.local(he.variableName),class:"tok-variableName tok-local"},{tag:he.definition(he.variableName),class:"tok-variableName tok-definition"},{tag:he.special(he.variableName),class:"tok-variableName2"},{tag:he.definition(he.propertyName),class:"tok-propertyName tok-definition"},{tag:he.typeName,class:"tok-typeName"},{tag:he.namespace,class:"tok-namespace"},{tag:he.className,class:"tok-className"},{tag:he.macroName,class:"tok-macroName"},{tag:he.propertyName,class:"tok-propertyName"},{tag:he.operator,class:"tok-operator"},{tag:he.comment,class:"tok-comment"},{tag:he.meta,class:"tok-meta"},{tag:he.invalid,class:"tok-invalid"},{tag:he.punctuation,class:"tok-punctuation"}]);var d$;const Og=new ui;function tL(e){return mn.define({combine:e?t=>t.concat(e):void 0})}const nW=new ui;class ku{constructor(t,n,i=[],r=""){this.data=t,this.name=r,tr.prototype.hasOwnProperty("tree")||Object.defineProperty(tr.prototype,"tree",{get(){return Yr(this)}}),this.parser=n,this.extension=[bb.of(this),tr.languageData.of((s,o,l)=>{let c=yre(s,o,l),u=c.type.prop(Og);if(!u)return[];let d=s.facet(u),f=c.type.prop(nW);if(f){let h=c.resolve(o-c.from,l);for(let m of f)if(m.test(h,s)){let g=s.facet(m.facet);return m.type=="replace"?g:g.concat(d)}}return d})].concat(i)}isActiveAt(t,n,i=-1){return yre(t,n,i).type.prop(Og)==this.data}findRegions(t){let n=t.facet(bb);if((n==null?void 0:n.data)==this.data)return[{from:0,to:t.doc.length}];if(!n||!n.allowsNesting)return[];let i=[],r=(s,o)=>{if(s.prop(Og)==this.data){i.push({from:o,to:o+s.length});return}let l=s.prop(ui.mounted);if(l){if(l.tree.prop(Og)==this.data){if(l.overlay)for(let c of l.overlay)i.push({from:c.from+o,to:c.to+o});else i.push({from:o,to:o+s.length});return}else if(l.overlay){let c=i.length;if(r(l.tree,l.overlay[0].from+o),i.length>c)return}}for(let c=0;ci.isTop?n:void 0)]}),t.name)}configure(t,n){return new sm(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Yr(e){let t=e.field(ku.state,!1);return t?t.tree:Ui.empty}class wMt{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,n){let i=this.cursorPos-this.string.length;return t=this.cursorPos?this.doc.sliceString(t,n):this.string.slice(t-i,n-i)}}let Ck=null;class S0{constructor(t,n,i=[],r,s,o,l,c){this.parser=t,this.state=n,this.fragments=i,this.tree=r,this.treeLen=s,this.viewport=o,this.skipped=l,this.scheduleOn=c,this.parse=null,this.tempSkipped=[]}static create(t,n,i){return new S0(t,n,[],Ui.empty,0,i,[],null)}startParse(){return this.parser.startParse(new wMt(this.state.doc),this.fragments)}work(t,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Ui.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof t=="number"){let r=Date.now()+t;t=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=t,this.tree=n,this.fragments=this.withoutTempSkipped(Up.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let n=Ck;Ck=this;try{return t()}finally{Ck=n}}withoutTempSkipped(t){for(let n;n=this.tempSkipped.pop();)t=vre(t,n.from,n.to);return t}changes(t,n){let{fragments:i,tree:r,treeLen:s,viewport:o,skipped:l}=this;if(this.takeTree(),!t.empty){let c=[];if(t.iterChangedRanges((u,d,f,h)=>c.push({fromA:u,toA:d,fromB:f,toB:h})),i=Up.applyChanges(i,c),r=Ui.empty,s=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){l=[];for(let u of this.skipped){let d=t.mapPos(u.from,1),f=t.mapPos(u.to,-1);dt.from&&(this.fragments=vre(this.fragments,r,s),this.skipped.splice(i--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,n){this.skipped.push({from:t,to:n})}static getSkippingParser(t){return new class extends WM{createParse(n,i,r){let s=r[0].from,o=r[r.length-1].to;return{parsedPos:s,advance(){let c=Ck;if(c){for(let u of r)c.tempSkipped.push(u);t&&(c.scheduleOn=c.scheduleOn?Promise.all([c.scheduleOn,t]):t)}return this.parsedPos=o,new Ui(Za.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let n=this.fragments;return this.treeLen>=t&&n.length&&n[0].from==0&&n[0].to>=t}static get(){return Ck}}function vre(e,t,n){return Up.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class m1{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),i=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,i)||n.takeTree(),new m1(n)}static init(t){let n=Math.min(3e3,t.doc.length),i=S0.create(t.facet(bb).parser,t,{from:0,to:n});return i.work(20,n)||i.takeTree(),new m1(i)}}ku.state=dl.define({create:m1.init,update(e,t){for(let n of t.effects)if(n.is(ku.setState))return n.value;return t.startState.facet(bb)!=t.state.facet(bb)?m1.init(t.state):e.apply(t)}});let b4e=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&(b4e=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const f$=typeof navigator<"u"&&(!((d$=navigator.scheduling)===null||d$===void 0)&&d$.isInputPending)?()=>navigator.scheduling.isInputPending():null,OMt=ma.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let n=this.view.state.field(ku.state).context;(n.updateViewport(t.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:t}=this.view,n=t.field(ku.state);(n.tree!=n.context.tree||!n.context.isDone(t.doc.length))&&(this.working=b4e(this.work))}work(t){this.working=null;let n=Date.now();if(this.chunkEndr+1e3,c=s.context.work(()=>f$&&f$()||Date.now()>o,r+(l?0:1e5));this.chunkBudget-=Date.now()-n,(c||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:ku.setState.of(new m1(s.context))})),this.chunkBudget>0&&!(c&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Mc(this.view.state,n)).then(()=>this.workScheduled--),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),bb=mn.define({combine(e){return e.length?e[0]:null},enables:e=>[ku.state,OMt,Jt.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class yb{constructor(t,n=[]){this.language=t,this.support=n,this.extension=[t,n]}}class ZI{constructor(t,n,i,r,s,o=void 0){this.name=t,this.alias=n,this.extensions=i,this.filename=r,this.loadFunc=s,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(t=>this.support=t,t=>{throw this.loading=null,t}))}static of(t){let{load:n,support:i}=t;if(!n){if(!i)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");n=()=>Promise.resolve(i)}return new ZI(t.name,(t.alias||[]).concat(t.name).map(r=>r.toLowerCase()),t.extensions||[],t.filename,n,i)}static matchFilename(t,n){for(let r of t)if(r.filename&&r.filename.test(n))return r;let i=/\.([^.]+)$/.exec(n);if(i){for(let r of t)if(r.extensions.indexOf(i[1])>-1)return r}return null}static matchLanguageName(t,n,i=!0){n=n.toLowerCase();for(let r of t)if(r.alias.some(s=>s==n))return r;if(i)for(let r of t)for(let s of r.alias){let o=n.indexOf(s);if(o>-1&&(s.length>2||!/\w/.test(n[o-1])&&!/\w/.test(n[o+s.length])))return r}return null}}const kMt=mn.define(),mO=mn.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(n=>n!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function E0(e){let t=e.facet(mO);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function zC(e,t){let n="",i=e.tabSize,r=e.facet(mO)[0];if(r==" "){for(;t>=i;)n+=" ",t-=i;r=" "}for(let s=0;s=t?SMt(e,n,t):null}class nL{constructor(t,n={}){this.state=t,this.options=n,this.unit=E0(t)}lineAt(t,n=1){let i=this.state.doc.lineAt(t),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=i.from&&r<=i.to?s&&r==t?{text:"",from:t}:(n<0?r-1&&(s+=o-this.countColumn(i,i.search(/\S|$/))),s}countColumn(t,n=t.length){return Of(t,this.state.tabSize,n)}lineIndent(t,n=1){let{text:i,from:r}=this.lineAt(t,n),s=this.options.overrideIndentation;if(s){let o=s(r);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const vm=new ui;function SMt(e,t,n){let i=t.resolveStack(n),r=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(r!=i.node){let s=[];for(let o=r;o&&!(o.fromi.node.to||o.from==i.node.from&&o.type==i.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)i={node:s[o],next:i}}return y4e(i,e,n)}function y4e(e,t,n){for(let i=e;i;i=i.next){let r=CMt(i.node);if(r)return r(rW.create(t,n,i))}return 0}function EMt(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function CMt(e){let t=e.type.prop(vm);if(t)return t;let n=e.firstChild,i;if(n&&(i=n.type.prop(ui.closedBy))){let r=e.lastChild,s=r&&i.indexOf(r.name)>-1;return o=>v4e(o,!0,1,void 0,s&&!EMt(o)?r.from:void 0)}return e.parent==null?AMt:null}function AMt(){return 0}class rW extends nL{constructor(t,n,i){super(t.state,t.options),this.base=t,this.pos=n,this.context=i}get node(){return this.context.node}static create(t,n,i){return new rW(t,n,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let n=this.state.doc.lineAt(t.from);for(;;){let i=t.resolve(n.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(TMt(i,t))break;n=this.state.doc.lineAt(i.from)}return this.lineIndent(n.from)}continue(){return y4e(this.context.next,this.base,this.pos)}}function TMt(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function _Mt(e){let t=e.node,n=t.childAfter(t.from),i=t.lastChild;if(!n)return null;let r=e.options.simulateBreak,s=e.state.doc.lineAt(n.from),o=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let l=n.to;;){let c=t.childAfter(l);if(!c||c==i)return null;if(!c.type.isSkipped){if(c.from>=o)return null;let u=/^ */.exec(s.text.slice(n.to-s.from))[0].length;return{from:n.from,to:n.to+u}}l=c.to}}function ww({closing:e,align:t=!0,units:n=1}){return i=>v4e(i,t,n,e)}function v4e(e,t,n,i,r){let s=e.textAfter,o=s.match(/^\s*/)[0].length,l=i&&s.slice(o,o+i.length)==i||r==e.pos+o,c=t?_Mt(e):null;return c?l?e.column(c.from):e.column(c.to):e.baseIndent+(l?0:e.unit*n)}const jMt=e=>e.baseIndent;function Ow({except:e,units:t=1}={}){return n=>{let i=e&&e.test(n.textAfter);return n.baseIndent+(i?0:t*n.unit)}}const NMt=200;function RMt(){return tr.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:i}=e.newSelection.main,r=n.lineAt(i);if(i>r.from+NMt)return e;let s=n.sliceString(r.from,i);if(!t.some(u=>u.test(s)))return e;let{state:o}=e,l=-1,c=[];for(let{head:u}of o.selection.ranges){let d=o.doc.lineAt(u);if(d.from==l)continue;l=d.from;let f=iW(o,d.from);if(f==null)continue;let h=/^\s*/.exec(d.text)[0],m=zC(o,f);h!=m&&c.push({from:d.from,to:d.from+h.length,insert:m})}return c.length?[e,{changes:c,sequential:!0}]:e})}const x4e=mn.define(),xm=new ui;function NT(e){let t=e.firstChild,n=e.lastChild;return t&&t.ton)continue;if(s&&l.from=t&&u.to>n&&(s=u)}}return s}function PMt(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function JI(e,t,n){for(let i of e.facet(x4e)){let r=i(e,t,n);if(r)return r}return IMt(e,t,n)}function w4e(e,t){let n=t.mapPos(e.from,1),i=t.mapPos(e.to,-1);return n>=i?void 0:{from:n,to:i}}const iL=pi.define({map:w4e}),RT=pi.define({map:w4e});function O4e(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(i=>i.from<=n&&i.to>=n)||t.push(e.lineBlockAt(n));return t}const C0=dl.define({create(){return Fn.none},update(e,t){t.isUserEvent("delete")&&t.changes.iterChangedRanges((i,r)=>e=xre(e,i,r)),e=e.map(t.changes);let n=[];for(let i of t.effects)i.is(iL)&&!DMt(e,i.value.from,i.value.to)?n.push(i.value):i.is(RT)&&(e=e.update({filter:(r,s)=>i.value.from!=r||i.value.to!=s,filterFrom:i.value.from,filterTo:i.value.to}));if(n.length){let{preparePlaceholder:i}=t.state.facet(E4e),r=n.map(s=>(i?Fn.replace({widget:new QMt(i(t.state,s))}):wre).range(s.from,s.to));e=e.update({add:r})}return t.selection&&(e=xre(e,t.selection.main.head)),e},provide:e=>Jt.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(i,r)=>{n.push(i,r)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n{rt&&(i=!0)}),i?e.update({filterFrom:t,filterTo:n,filter:(r,s)=>r>=n||s<=t}):e}function eP(e,t,n){var i;let r=null;return(i=e.field(C0,!1))===null||i===void 0||i.between(t,n,(s,o)=>{(!r||r.from>s)&&(r={from:s,to:o})}),r}function DMt(e,t,n){let i=!1;return e.between(t,t,(r,s)=>{r==t&&s==n&&(i=!0)}),i}function k4e(e,t){return e.field(C0,!1)?t:t.concat(pi.appendConfig.of(C4e()))}const MMt=e=>{for(let t of O4e(e)){let n=JI(e.state,t.from,t.to);if(n)return e.dispatch({effects:k4e(e.state,[iL.of(n),S4e(e,n)])}),!0}return!1},LMt=e=>{if(!e.state.field(C0,!1))return!1;let t=[];for(let n of O4e(e)){let i=eP(e.state,n.from,n.to);i&&t.push(RT.of(i),S4e(e,i,!1))}return t.length&&e.dispatch({effects:t}),t.length>0};function S4e(e,t,n=!0){let i=e.state.doc.lineAt(t.from).number,r=e.state.doc.lineAt(t.to).number;return Jt.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${i} ${e.state.phrase("to")} ${r}.`)}const $Mt=e=>{let{state:t}=e,n=[];for(let i=0;i{let t=e.state.field(C0,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(i,r)=>{n.push(RT.of({from:i,to:r}))}),e.dispatch({effects:n}),!0},BMt=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:MMt},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:LMt},{key:"Ctrl-Alt-[",run:$Mt},{key:"Ctrl-Alt-]",run:FMt}],UMt={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},E4e=mn.define({combine(e){return Ph(e,UMt)}});function C4e(e){return[C0,HMt]}function A4e(e,t){let{state:n}=e,i=n.facet(E4e),r=o=>{let l=e.lineBlockAt(e.posAtDOM(o.target)),c=eP(e.state,l.from,l.to);c&&e.dispatch({effects:RT.of(c)}),o.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(e,r,t);let s=document.createElement("span");return s.textContent=i.placeholderText,s.setAttribute("aria-label",n.phrase("folded code")),s.title=n.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=r,s}const wre=Fn.replace({widget:new class extends Nf{toDOM(e){return A4e(e,null)}}});class QMt extends Nf{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return A4e(t,this.value)}}const zMt={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class h$ extends rm{constructor(t,n){super(),this.config=t,this.open=n}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=t.state.phrase(this.open?"Fold line":"Unfold line"),n}}function VMt(e={}){let t={...zMt,...e},n=new h$(t,!0),i=new h$(t,!1),r=ma.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(bb)!=o.state.facet(bb)||o.startState.field(C0,!1)!=o.state.field(C0,!1)||Yr(o.startState)!=Yr(o.state)||t.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new nm;for(let c of o.viewportLineBlocks){let u=eP(o.state,c.from,c.to)?i:JI(o.state,c.from,c.to)?n:null;u&&l.add(c.from,c.from,u)}return l.finish()}}),{domEventHandlers:s}=t;return[r,iMt({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(r))===null||l===void 0?void 0:l.markers)||Ki.empty},initialSpacer(){return new h$(t,!1)},domEventHandlers:{...s,click:(o,l,c)=>{if(s.click&&s.click(o,l,c))return!0;let u=eP(o.state,l.from,l.to);if(u)return o.dispatch({effects:RT.of(u)}),!0;let d=JI(o.state,l.from,l.to);return d?(o.dispatch({effects:iL.of(d)}),!0):!1}}}),C4e()]}const HMt=Jt.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class IT{constructor(t,n){this.specs=t;let i;function r(l){let c=pb.newName();return(i||(i=Object.create(null)))["."+c]=l,c}const s=typeof n.all=="string"?n.all:n.all?r(n.all):void 0,o=n.scope;this.scope=o instanceof ku?l=>l.prop(Og)==o.data:o?l=>l==o:void 0,this.style=g4e(t.map(l=>({tag:l.tag,class:l.class||r(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=i?new pb(i):null,this.themeType=n.themeType}static define(t,n){return new IT(t,n||{})}}const i7=mn.define(),T4e=mn.define({combine(e){return e.length?[e[0]]:null}});function VN(e){let t=e.facet(i7);return t.length?t:e.facet(T4e)}function _4e(e,t){let n=[WMt],i;return e instanceof IT&&(e.module&&n.push(Jt.styleModule.of(e.module)),i=e.themeType),t!=null&&t.fallback?n.push(T4e.of(e)):i?n.push(i7.computeN([Jt.darkTheme],r=>r.facet(Jt.darkTheme)==(i=="dark")?[e]:[])):n.push(i7.of(e)),n}function Qhn(e,t,n){let i=VN(e),r=null;if(i){for(let s of i)if(!s.scope||n){let o=s.style(t);o&&(r=r?r+" "+o:o)}}return r}class qMt{constructor(t){this.markCache=Object.create(null),this.tree=Yr(t.state),this.decorations=this.buildDeco(t,VN(t.state)),this.decoratedTo=t.viewport.to}update(t){let n=Yr(t.state),i=VN(t.state),r=i!=VN(t.startState),{viewport:s}=t.view,o=t.changes.mapPos(this.decoratedTo,1);n.length=s.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=o):(n!=this.tree||t.viewportChanged||r)&&(this.tree=n,this.decorations=this.buildDeco(t.view,i),this.decoratedTo=s.to)}buildDeco(t,n){if(!n||!this.tree.length)return Fn.none;let i=new nm;for(let{from:r,to:s}of t.visibleRanges)yMt(this.tree,n,(o,l,c)=>{i.add(o,l,this.markCache[c]||(this.markCache[c]=Fn.mark({class:c})))},r,s);return i.finish()}}const WMt=bm.high(ma.fromClass(qMt,{decorations:e=>e.decorations})),KMt=IT.define([{tag:he.meta,color:"#404740"},{tag:he.link,textDecoration:"underline"},{tag:he.heading,textDecoration:"underline",fontWeight:"bold"},{tag:he.emphasis,fontStyle:"italic"},{tag:he.strong,fontWeight:"bold"},{tag:he.strikethrough,textDecoration:"line-through"},{tag:he.keyword,color:"#708"},{tag:[he.atom,he.bool,he.url,he.contentSeparator,he.labelName],color:"#219"},{tag:[he.literal,he.inserted],color:"#164"},{tag:[he.string,he.deleted],color:"#a11"},{tag:[he.regexp,he.escape,he.special(he.string)],color:"#e40"},{tag:he.definition(he.variableName),color:"#00f"},{tag:he.local(he.variableName),color:"#30a"},{tag:[he.typeName,he.namespace],color:"#085"},{tag:he.className,color:"#167"},{tag:[he.special(he.variableName),he.macroName],color:"#256"},{tag:he.definition(he.propertyName),color:"#00c"},{tag:he.comment,color:"#940"},{tag:he.invalid,color:"#f00"}]),GMt=Jt.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),j4e=1e4,N4e="()[]{}",R4e=mn.define({combine(e){return Ph(e,{afterCursor:!0,brackets:N4e,maxScanDistance:j4e,renderMatch:ZMt})}}),XMt=Fn.mark({class:"cm-matchingBracket"}),YMt=Fn.mark({class:"cm-nonmatchingBracket"});function ZMt(e){let t=[],n=e.matched?XMt:YMt;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}function Ore(e){let t=[],n=e.facet(R4e);for(let i of e.selection.ranges){if(!i.empty)continue;let r=uh(e,i.head,-1,n)||i.head>0&&uh(e,i.head-1,1,n)||n.afterCursor&&(uh(e,i.head,1,n)||i.heade.decorations}),eLt=[JMt,GMt];function tLt(e={}){return[R4e.of(e),eLt]}const I4e=new ui;function r7(e,t,n){let i=e.prop(t<0?ui.openedBy:ui.closedBy);if(i)return i;if(e.name.length==1){let r=n.indexOf(e.name);if(r>-1&&r%2==(t<0?1:0))return[n[r+t]]}return null}function s7(e){let t=e.type.prop(I4e);return t?t(e.node):e}function uh(e,t,n,i={}){let r=i.maxScanDistance||j4e,s=i.brackets||N4e,o=Yr(e),l=o.resolveInner(t,n);for(let c=l;c;c=c.parent){let u=r7(c.type,n,s);if(u&&c.from0?t>=d.from&&td.from&&t<=d.to))return nLt(e,t,n,c,d,u,s)}}return iLt(e,t,n,o,l.type,r,s)}function nLt(e,t,n,i,r,s,o){let l=i.parent,c={from:r.from,to:r.to},u=0,d=l==null?void 0:l.cursor();if(d&&(n<0?d.childBefore(i.from):d.childAfter(i.to)))do if(n<0?d.to<=i.from:d.from>=i.to){if(u==0&&s.indexOf(d.type.name)>-1&&d.from0)return null;let u={from:n<0?t-1:t,to:n>0?t+1:t},d=e.doc.iterRange(t,n>0?e.doc.length:0),f=0;for(let h=0;!d.next().done&&h<=s;){let m=d.value;n<0&&(h+=m.length);let g=t+h*n;for(let b=n>0?0:m.length-1,v=n>0?m.length:-1;b!=v;b+=n){let y=o.indexOf(m[b]);if(!(y<0||i.resolveInner(g+b,1).type!=r))if(y%2==0==n>0)f++;else{if(f==1)return{start:u,end:{from:g+b,to:g+b+1},matched:y>>1==c>>1};f--}}n>0&&(h+=m.length)}return d.done?{start:u,matched:!1}:null}function kre(e,t,n,i=0,r=0){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));let s=r;for(let o=i;o=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.posn}eatSpace(){let t=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t}skipToEnd(){this.pos=this.string.length}skipTo(t){let n=this.string.indexOf(t,this.pos);if(n>-1)return this.pos=n,!0}backUp(t){this.pos-=t}column(){return this.lastColumnPosi?o.toLowerCase():o,s=this.string.substr(this.pos,t.length);return r(s)==r(t)?(n!==!1&&(this.pos+=t.length),!0):null}else{let r=this.string.slice(this.pos).match(t);return r&&r.index>0?null:(r&&n!==!1&&(this.pos+=r[0].length),r)}}current(){return this.string.slice(this.start,this.pos)}}function rLt(e){return{name:e.name||"",token:e.token,blankLine:e.blankLine||(()=>{}),startState:e.startState||(()=>!0),copyState:e.copyState||sLt,indent:e.indent||(()=>null),languageData:e.languageData||{},tokenTable:e.tokenTable||oW,mergeTokens:e.mergeTokens!==!1}}function sLt(e){if(typeof e!="object")return e;let t={};for(let n in e){let i=e[n];t[n]=i instanceof Array?i.slice():i}return t}const Sre=new WeakMap;class sW extends ku{constructor(t){let n=tL(t.languageData),i=rLt(t),r,s=new class extends WM{createParse(o,l,c){return new oLt(r,o,l,c)}};super(n,s,[],t.name),this.topNode=uLt(n,this),r=this,this.streamParser=i,this.stateAfter=new ui({perNode:!0}),this.tokenTable=t.tokenTable?new $4e(i.tokenTable):cLt}static define(t){return new sW(t)}getIndent(t){let n,{overrideIndentation:i}=t.options;i&&(n=Sre.get(t.state),n!=null&&n1e4)return null;for(;s=i&&n+t.length<=r&&t.prop(e.stateAfter);if(s)return{state:e.streamParser.copyState(s),pos:n+t.length};for(let o=t.children.length-1;o>=0;o--){let l=t.children[o],c=n+t.positions[o],u=l instanceof Ui&&c=t.length)return t;!r&&n==0&&t.type==e.topNode&&(r=!0);for(let s=t.children.length-1;s>=0;s--){let o=t.positions[s],l=t.children[s],c;if(on&&aW(e,s.tree,0-s.offset,n,l),u;if(c&&c.pos<=i&&(u=D4e(e,s.tree,n+s.offset,c.pos+s.offset,!1)))return{state:c.state,tree:u}}return{state:e.streamParser.startState(r?E0(r):4),tree:Ui.empty}}let oLt=class{constructor(t,n,i,r){this.lang=t,this.input=n,this.fragments=i,this.ranges=r,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=r[r.length-1].to;let s=S0.get(),o=r[0].from,{state:l,tree:c}=aLt(t,i,o,this.to,s==null?void 0:s.state);this.state=l,this.parsedPos=this.chunkStart=o+c.length;for(let u=0;uu.from<=s.viewport.from&&u.to>=s.viewport.from)&&(this.state=this.lang.streamParser.startState(E0(s.state)),s.skipUntilInView(this.parsedPos,s.viewport.from),this.parsedPos=s.viewport.from),this.moveRangeIndex()}advance(){let t=S0.get(),n=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),i=Math.min(n,this.chunkStart+512);for(t&&(i=Math.min(i,t.viewport.to));this.parsedPos=n?this.finish():t&&this.parsedPos>=t.viewport.to?(t.skipUntilInView(this.parsedPos,n),this.finish()):null}stopAt(t){this.stoppedAt=t}lineAfter(t){let n=this.input.chunk(t);if(this.input.lineChunks)n==` `&&(n="");else{let i=n.indexOf(` -`);i>-1&&(n=n.slice(0,i))}return t+n.length<=this.to?n:n.slice(0,this.to-t)}nextLine(){let t=this.parsedPos,n=this.lineAfter(t),i=t+n.length;for(let r=this.rangeIndex;;){let s=this.ranges[r].to;if(s>=i||(n=n.slice(0,s-(i-n.length)),r++,r==this.ranges.length))break;let o=this.ranges[r].from,l=this.lineAfter(o);n+=l,i=o+l.length}return{line:n,end:i}}skipGapsTo(t,n,i){for(;;){let r=this.ranges[this.rangeIndex].to,s=t+n;if(i>0?r>s:r>=s)break;let o=this.ranges[++this.rangeIndex].from;n+=o-r}return n}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){r=this.skipGapsTo(n,r,1),n+=r;let l=this.chunk.length;r=this.skipGapsTo(i,r,-1),i+=r,s+=this.chunk.length-l}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&s==4&&o>=0&&this.chunk[o]==t&&this.chunk[o+2]==n?this.chunk[o+2]=i:this.chunk.push(t,n,i,s),r}parseLine(t){let{line:n,end:i}=this.nextLine(),r=0,{streamParser:s}=this.lang,o=new I4e(n,t?t.state.tabSize:4,t?S0(t.state):2);if(o.eol())s.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=D4e(s.token,o,this.state);if(l&&(r=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,r)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPost.start)return r}throw new Error("Stream parser failed to advance stream.")}const aW=Object.create(null),zC=[Za.none],aLt=new fO(zC),Sre=[],Ere=Object.create(null),M4e=Object.create(null);for(let[e,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])M4e[e]=$4e(aW,t);class L4e{constructor(t){this.extra=t,this.table=Object.assign(Object.create(null),M4e)}resolve(t){return t?this.table[t]||(this.table[t]=$4e(this.extra,t)):0}}const oLt=new L4e(aW);function h$(e,t){Sre.indexOf(e)>-1||(Sre.push(e),console.warn(t))}function $4e(e,t){let n=[];for(let l of t.split(" ")){let c=[];for(let u of l.split(".")){let d=e[u]||fe[u];d?typeof d=="function"?c.length?c=c.map(d):h$(u,`Modifier ${u} used at start of tag`):c.length?h$(u,`Tag ${u} used as modifier`):c=Array.isArray(d)?d:[d]:h$(u,`Unknown highlighting tag ${u}`)}for(let u of c)n.push(u)}if(!n.length)return 0;let i=t.replace(/ /g,"_"),r=i+" "+n.map(l=>l.id),s=Ere[r];if(s)return s.id;let o=Ere[r]=Za.define({id:zC.length,name:i,props:[bm({[i]:n})]});return zC.push(o),o.id}function lLt(e,t){let n=Za.define({id:zC.length,name:"Document",props:[wg.add(()=>e),ym.add(()=>i=>t.getIndent(i))],top:!0});return zC.push(n),n}os.RTL,os.LTR;var Cre={};class tP{constructor(t,n,i,r,s,o,l,c,u,d=0,f){this.p=t,this.stack=n,this.state=i,this.reducePos=r,this.pos=s,this.score=o,this.buffer=l,this.bufferBase=c,this.curContext=u,this.lookAhead=d,this.parent=f}toString(){return`[${this.stack.filter((t,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,n,i=0){let r=t.parser.context;return new tP(t,[],n,i,i,0,[],0,r?new Are(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var n;let i=t>>19,r=t&65535,{parser:s}=this.p,o=this.reducePos=2e3&&!(!((n=this.p.parser.nodeSet.types[r])===null||n===void 0)&&n.isAnonymous)&&(u==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=d):this.p.lastBigReductionSizec;)this.stack.pop();this.reduceContext(r,u)}storeNode(t,n,i,r=4,s=!1){if(t==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&this.buffer[o-4]==0&&this.buffer[o-1]>-1){if(n==i)return;if(this.buffer[o-2]>=n){this.buffer[o-2]=i;return}}}if(!s||this.pos==i)this.buffer.push(t,n,i,r);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let l=!1;for(let c=o;c>0&&this.buffer[c-2]>i;c-=4)if(this.buffer[c-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>i;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,r>4&&(r-=4)}this.buffer[o]=t,this.buffer[o+1]=n,this.buffer[o+2]=i,this.buffer[o+3]=r}}shift(t,n,i,r){if(t&131072)this.pushState(t&65535,this.pos);else if(t&262144)this.pos=r,this.shiftContext(n,i),n<=this.p.parser.maxNode&&this.buffer.push(n,i,r,4);else{let s=t,{parser:o}=this.p;this.pos=r;let l=o.stateFlag(s,1);!l&&(r>i||n<=o.maxNode)&&(this.reducePos=r),this.pushState(s,l?i:Math.min(i,this.reducePos)),this.shiftContext(n,i),n<=o.maxNode&&this.buffer.push(n,i,r,4)}}apply(t,n,i,r){t&65536?this.reduce(t):this.shift(t,n,i,r)}useNode(t,n){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=t)&&(this.p.reused.push(t),i++);let r=this.pos;this.reducePos=this.pos=r+t.length,this.pushState(n,r),this.buffer.push(i,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,n=t.buffer.length;for(n&&t.buffer[n-4]==0&&(n-=4);n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let i=t.buffer.slice(n),r=t.bufferBase+n;for(;t&&r==t.bufferBase;)t=t.parent;return new tP(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,r,this.curContext,this.lookAhead,t)}recoverByDelete(t,n){let i=t<=this.p.parser.maxNode;i&&this.storeNode(t,this.pos,n,4),this.storeNode(0,this.pos,n,i?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(t){for(let n=new cLt(this);;){let i=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,t);if(i==0)return!1;if(!(i&65536))return!0;n.reduce(i)}}recoverByInsert(t){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let r=[];for(let s=0,o;sc&1&&l==o)||r.push(n[s],o)}n=r}let i=[];for(let r=0;r>19,r=n&65535,s=this.stack.length-i*3;if(s<0||t.getGoto(this.stack[s],r,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;n=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:t}=this.p,n=[],i=(r,s)=>{if(!n.includes(r))return n.push(r),t.allActions(r,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-s;if(l>1){let c=o&65535,u=this.stack.length-l*3;if(u>=0&&t.getGoto(this.stack[u],c,!1)>=0)return l<<19|65536|c}}else{let l=i(o,s+1);if(l!=null)return l}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:t}=this.p;return t.data[t.stateSlot(this.state,1)]==65535&&!t.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let n=0;n0&&this.emitLookAhead()}}class Are{constructor(t,n){this.tracker=t,this.context=n,this.hash=t.strict?t.hash(n):0}}class cLt{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let n=t&65535,i=t>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=r}}class nP{constructor(t,n,i){this.stack=t,this.pos=n,this.index=i,this.buffer=t.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new nP(t,n,n-t.bufferBase)}maybeNext(){let t=this.stack.parent;t!=null&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new nP(this.stack,this.pos,this.index)}}function xS(e,t=Uint16Array){if(typeof e!="string")return e;let n=null;for(let i=0,r=0;i=92&&o--,o>=34&&o--;let c=o-32;if(c>=46&&(c-=46,l=!0),s+=c,l)break;s*=46}n?n[r++]=s:n=new t(s)}return n}class VN{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Tre=new VN;class uLt{constructor(t,n){this.input=t,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Tre,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(t,n){let i=this.range,r=this.rangeIndex,s=this.pos+t;for(;si.to:s>=i.to;){if(r==this.ranges.length-1)return null;let o=this.ranges[++r];s+=o.from-i.to,i=o}return s}clipPos(t){if(t>=this.range.from&&tt)return Math.max(t,n.from);return this.end}peek(t){let n=this.chunkOff+t,i,r;if(n>=0&&n=this.chunk2Pos&&il.to&&(this.chunk2=this.chunk2.slice(0,l.to-i)),r=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),r}acceptToken(t,n=0){let i=n?this.resolveOffset(n,-1):this.pos;if(i==null||i=this.chunk2Pos&&this.posthis.range.to?t.slice(0,this.range.to-this.pos):t,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(t,n){if(n?(this.token=n,n.start=t,n.lookAhead=t+1,n.value=n.extended=-1):this.token=Tre,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,n-this.chunkPos);if(t>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,n-this.chunk2Pos);if(t>=this.range.from&&n<=this.range.to)return this.input.read(t,n);let i="";for(let r of this.ranges){if(r.from>=n)break;r.to>t&&(i+=this.input.read(Math.max(r.from,t),Math.min(r.to,n)))}return i}}class Ow{constructor(t,n){this.data=t,this.id=n}token(t,n){let{parser:i}=n.p;F4e(this.data,t,n,this.id,i.data,i.tokenPrecTable)}}Ow.prototype.contextual=Ow.prototype.fallback=Ow.prototype.extend=!1;class iP{constructor(t,n,i){this.precTable=n,this.elseToken=i,this.data=typeof t=="string"?xS(t):t}token(t,n){let i=t.pos,r=0;for(;;){let s=t.next<0,o=t.resolveOffset(1,1);if(F4e(this.data,t,n,0,this.data,this.precTable),t.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,o==null)break;t.reset(o,t.token)}r&&(t.reset(i,t.token),t.acceptToken(this.elseToken,r))}}iP.prototype.contextual=Ow.prototype.fallback=Ow.prototype.extend=!1;class Ia{constructor(t,n={}){this.token=t,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function F4e(e,t,n,i,r,s){let o=0,l=1<0){let g=e[m];if(c.allows(g)&&(t.token.value==-1||t.token.value==g||dLt(g,t.token.value,r,s))){t.acceptToken(g);break}}let d=t.next,f=0,h=e[o+2];if(t.next<0&&h>f&&e[u+h*3-3]==65535){o=e[u+h*3-1];continue e}for(;f>1,g=u+m+(m<<1),b=e[g],v=e[g+1]||65536;if(d=v)f=m+1;else{o=e[g+2],t.advance();continue e}}break}}function _re(e,t,n){for(let i=t,r;(r=e[i])!=65535;i++)if(r==n)return i-t;return-1}function dLt(e,t,n,i){let r=_re(n,i,t);return r<0||_re(n,i,e)t)&&!i.type.isError)return n<0?Math.max(0,Math.min(i.to-1,t-25)):Math.min(e.length,Math.max(i.from+1,t+25));if(n<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return n<0?0:e.length}}let fLt=class{constructor(t,n){this.fragments=t,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?jre(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?jre(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(tt)return this.nextStart=o,null;if(s instanceof Bi){if(o==t){if(o=Math.max(this.safeFrom,t)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[n]++,this.nextStart=o+s.length}}};class hLt{constructor(t,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(i=>new VN)}getActions(t){let n=0,i=null,{parser:r}=t.p,{tokenizers:s}=r,o=r.stateSlot(t.state,3),l=t.curContext?t.curContext.hash:0,c=0;for(let u=0;uf.end+25&&(c=Math.max(f.lookAhead,c)),f.value!=0)){let h=n;if(f.extended>-1&&(n=this.addActions(t,f.extended,f.end,n)),n=this.addActions(t,f.value,f.end,n),!d.extend&&(i=f,n>h))break}}for(;this.actions.length>n;)this.actions.pop();return c&&t.setLookAhead(c),!i&&t.pos==this.stream.end&&(i=new VN,i.value=t.p.parser.eofTerm,i.start=i.end=t.pos,n=this.addActions(t,i.value,i.end,n)),this.mainToken=i,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let n=new VN,{pos:i,p:r}=t;return n.start=i,n.end=Math.min(i+1,r.stream.end),n.value=i==r.stream.end?r.parser.eofTerm:0,n}updateCachedToken(t,n,i){let r=this.stream.clipPos(i.pos);if(n.token(this.stream.reset(r,t),i),t.value>-1){let{parser:s}=i.p;for(let o=0;o=0&&i.p.parser.dialect.allows(l>>1)){l&1?t.extended=l>>1:t.value=l>>1;break}}}else t.value=0,t.end=this.stream.clipPos(r+1)}putAction(t,n,i,r){for(let s=0;st.bufferLength*4?new fLt(i,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t=this.stacks,n=this.minStackPos,i=this.stacks=[],r,s;if(this.bigReductionCount>300&&t.length==1){let[o]=t;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;on)i.push(l);else{if(this.advanceStack(l,i,t))continue;{r||(r=[],s=[]),r.push(l);let c=this.tokens.getMainToken(l);s.push(c.value,c.end)}}break}}if(!i.length){let o=r&&gLt(r);if(o)return nu&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw nu&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&r){let o=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,i);if(o)return nu&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(i.length>o)for(i.sort((l,c)=>c.score-l.score);i.length>o;)i.pop();i.some(l=>l.reducePos>n)&&this.recovering--}else if(i.length>1){e:for(let o=0;o500&&u.buffer.length>500)if((l.score-u.score||l.buffer.length-u.buffer.length)>0)i.splice(c--,1);else{i.splice(o--,1);continue e}}}i.length>12&&(i.sort((o,l)=>l.score-o.score),i.splice(12,i.length-12))}this.minStackPos=i[0].pos;for(let o=1;o ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let u=t.curContext&&t.curContext.tracker.strict,d=u?t.curContext.hash:0;for(let f=this.fragments.nodeAt(r);f;){let h=this.parser.nodeSet.types[f.type.id]==f.type?s.getGoto(t.state,f.type.id):-1;if(h>-1&&f.length&&(!u||(f.prop(ui.contextHash)||0)==d))return t.useNode(f,h),nu&&console.log(o+this.stackID(t)+` (via reuse of ${s.getName(f.type.id)})`),!0;if(!(f instanceof Bi)||f.children.length==0||f.positions[0]>0)break;let m=f.children[0];if(m instanceof Bi&&f.positions[0]==0)f=m;else break}}let l=s.stateSlot(t.state,4);if(l>0)return t.reduce(l),nu&&console.log(o+this.stackID(t)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(t.stack.length>=8400)for(;t.stack.length>6e3&&t.forceReduce(););let c=this.tokens.getActions(t);for(let u=0;ur?n.push(g):i.push(g)}return!1}advanceFully(t,n){let i=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>i)return Nre(t,n),!0}}runRecovery(t,n,i){let r=null,s=!1;for(let o=0;o ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),nu&&console.log(d+this.stackID(l)+" (restarted)"),this.advanceFully(l,i))))continue;let f=l.split(),h=d;for(let m=0;m<10&&f.forceReduce()&&(nu&&console.log(h+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,i));m++)nu&&(h=this.stackID(f)+" -> ");for(let m of l.recoverByInsert(c))nu&&console.log(d+this.stackID(m)+" (via recover-insert)"),this.advanceFully(m,i);this.stream.end>l.pos?(u==l.pos&&(u++,c=0),l.recoverByDelete(c,u),nu&&console.log(d+this.stackID(l)+` (via recover-delete ${this.parser.getName(c)})`),Nre(l,i)):(!r||r.scoree;class rL{constructor(t){this.start=t.start,this.shift=t.shift||m$,this.reduce=t.reduce||m$,this.reuse=t.reuse||m$,this.hash=t.hash||(()=>0),this.strict=t.strict!==!1}}class sm extends WM{constructor(t){if(super(),this.wrappers=[],t.version!=14)throw new RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);let n=t.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let l=0;lt.topRules[l][1]),r=[];for(let l=0;l=0)s(d,c,l[u++]);else{let f=l[u+-d];for(let h=-d;h>0;h--)s(l[u++],c,f);u++}}}this.nodeSet=new fO(n.map((l,c)=>Za.define({name:c>=this.minRepeatTerm?void 0:l,id:c,props:r[c],top:i.indexOf(c)>-1,error:c==0,skipped:t.skippedNodes&&t.skippedNodes.indexOf(c)>-1}))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=L5e;let o=xS(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new Ow(o,l):l),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,n,i){let r=new pLt(this,t,n,i);for(let s of this.wrappers)r=s(r,t,n,i);return r}getGoto(t,n,i=!1){let r=this.goto;if(n>=r[0])return-1;for(let s=r[n+1];;){let o=r[s++],l=o&1,c=r[s++];if(l&&i)return c;for(let u=s+(o>>1);s0}validAction(t,n){return!!this.allActions(t,i=>i==n?!0:null)}allActions(t,n){let i=this.stateSlot(t,4),r=i?n(i):void 0;for(let s=this.stateSlot(t,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=pp(this.data,s+2);else break;r=n(pp(this.data,s+1))}return r}nextStates(t){let n=[];for(let i=this.stateSlot(t,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=pp(this.data,i+2);else break;if(!(this.data[i+2]&1)){let r=this.data[i+1];n.some((s,o)=>o&1&&s==r)||n.push(this.data[i],r)}}return n}configure(t){let n=Object.assign(Object.create(sm.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let i=this.topRules[t.top];if(!i)throw new RangeError(`Invalid top rule name ${t.top}`);n.top=i}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(i=>{let r=t.tokenizers.find(s=>s.from==i);return r?r.to:i})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((i,r)=>{let s=t.specializers.find(l=>l.from==i.external);if(!s)return i;let o=Object.assign(Object.assign({},i),{external:s.to});return n.specializers[r]=Rre(o),o})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let n=this.dynamicPrecedences;return n==null?0:n[t]||0}parseDialect(t){let n=Object.keys(this.dialects),i=n.map(()=>!1);if(t)for(let s of t.split(" ")){let o=n.indexOf(s);o>=0&&(i[o]=!0)}let r=null;for(let s=0;si)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.scoree.external(n,i)<<1|t}return e.get}const bLt=316,yLt=317,Ire=1,vLt=2,xLt=3,wLt=4,OLt=318,kLt=320,SLt=321,ELt=5,CLt=6,ALt=0,s7=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],B4e=125,TLt=59,a7=47,_Lt=42,jLt=43,NLt=45,RLt=60,ILt=44,PLt=63,DLt=46,MLt=91,LLt=new rL({start:!1,shift(e,t){return t==ELt||t==CLt||t==kLt?e:t==SLt},strict:!1}),$Lt=new Ia((e,t)=>{let{next:n}=e;(n==B4e||n==-1||t.context)&&e.acceptToken(OLt)},{contextual:!0,fallback:!0}),FLt=new Ia((e,t)=>{let{next:n}=e,i;s7.indexOf(n)>-1||n==a7&&((i=e.peek(1))==a7||i==_Lt)||n!=B4e&&n!=TLt&&n!=-1&&!t.context&&e.acceptToken(bLt)},{contextual:!0}),BLt=new Ia((e,t)=>{e.next==MLt&&!t.context&&e.acceptToken(yLt)},{contextual:!0}),ULt=new Ia((e,t)=>{let{next:n}=e;if(n==jLt||n==NLt){if(e.advance(),n==e.next){e.advance();let i=!t.context&&t.canShift(Ire);e.acceptToken(i?Ire:vLt)}}else n==PLt&&e.peek(1)==DLt&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(xLt))},{contextual:!0});function g$(e,t){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!t&&e>=48&&e<=57}const QLt=new Ia((e,t)=>{if(e.next!=RLt||!t.dialectEnabled(ALt)||(e.advance(),e.next==a7))return;let n=0;for(;s7.indexOf(e.next)>-1;)e.advance(),n++;if(g$(e.next,!0)){for(e.advance(),n++;g$(e.next,!1);)e.advance(),n++;for(;s7.indexOf(e.next)>-1;)e.advance(),n++;if(e.next==ILt)return;for(let i=0;;i++){if(i==7){if(!g$(e.next,!0))return;break}if(e.next!="extends".charCodeAt(i))break;e.advance(),n++}}e.acceptToken(wLt,-n)}),zLt=bm({"get set async static":fe.modifier,"for while do if else switch try catch finally return throw break continue default case defer":fe.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":fe.operatorKeyword,"let var const using function class extends":fe.definitionKeyword,"import export from":fe.moduleKeyword,"with debugger new":fe.keyword,TemplateString:fe.special(fe.string),super:fe.atom,BooleanLiteral:fe.bool,this:fe.self,null:fe.null,Star:fe.modifier,VariableName:fe.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":fe.function(fe.variableName),VariableDefinition:fe.definition(fe.variableName),Label:fe.labelName,PropertyName:fe.propertyName,PrivatePropertyName:fe.special(fe.propertyName),"CallExpression/MemberExpression/PropertyName":fe.function(fe.propertyName),"FunctionDeclaration/VariableDefinition":fe.function(fe.definition(fe.variableName)),"ClassDeclaration/VariableDefinition":fe.definition(fe.className),"NewExpression/VariableName":fe.className,PropertyDefinition:fe.definition(fe.propertyName),PrivatePropertyDefinition:fe.definition(fe.special(fe.propertyName)),UpdateOp:fe.updateOperator,"LineComment Hashbang":fe.lineComment,BlockComment:fe.blockComment,Number:fe.number,String:fe.string,Escape:fe.escape,ArithOp:fe.arithmeticOperator,LogicOp:fe.logicOperator,BitOp:fe.bitwiseOperator,CompareOp:fe.compareOperator,RegExp:fe.regexp,Equals:fe.definitionOperator,Arrow:fe.function(fe.punctuation),": Spread":fe.punctuation,"( )":fe.paren,"[ ]":fe.squareBracket,"{ }":fe.brace,"InterpolationStart InterpolationEnd":fe.special(fe.brace),".":fe.derefOperator,", ;":fe.separator,"@":fe.meta,TypeName:fe.typeName,TypeDefinition:fe.definition(fe.typeName),"type enum interface implements namespace module declare":fe.definitionKeyword,"abstract global Privacy readonly override":fe.modifier,"is keyof unique infer asserts":fe.operatorKeyword,JSXAttributeValue:fe.attributeValue,JSXText:fe.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":fe.angleBracket,"JSXIdentifier JSXNameSpacedName":fe.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":fe.attributeName,"JSXBuiltin/JSXIdentifier":fe.standard(fe.tagName)}),VLt={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},HLt={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},qLt={__proto__:null,"<":193},WLt=sm.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-EtOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-EPO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-ERQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<VO!l$xO#jROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!OVO!l$xO#jVO!l$xO#jROe!iOpkOrPO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]VO!l$xO#j^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOrROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]WO!l$xO#jgPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{SU+P%]S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mR>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o>UPS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^T)z$u){V+P%]S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SS#q]SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uSSR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:mSR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:oS)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>X>ZR>Y>['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mSS$oh$pR4U/U'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:mS#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^Q+T%aQ/c*Oo4OP>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^n=rTQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o4OP>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f]>^nZ>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f]>^nZ>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.lPQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.nSR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:LLt,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[zLt],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$i&j(Wp(Z!b'|0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(X#S$i&j'}0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$i&j(Wp(Z!b'}0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$i&j!p),Q(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(V':f$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$i&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$d`$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$d``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$d`$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(Z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$d`(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$i&j(Wp(Z!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$i&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(Z!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$i&j(WpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(WpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Wp(Z!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$i&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$i&j(Z!b!X7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(Z!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(Z!b!X7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(Z!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$i&j(Z!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!g$b$i&j$O)Lv(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#R-v$?V_!^(CdvBr$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!q7`$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$i&j(Wp(Z!b'|0/l$]#t(T,2j(e$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[FLt,BLt,ULt,QLt,2,3,4,5,6,7,8,9,10,11,12,13,14,$Lt,new iP("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new iP("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:e=>VLt[e]||-1},{term:343,get:e=>HLt[e]||-1},{term:95,get:e=>qLt[e]||-1}],tokenPrec:15201});class oW{constructor(t,n,i,r){this.state=t,this.pos=n,this.explicit=i,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let n=Yr(this.state).resolveInner(this.pos,-1);for(;n&&t.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(t){let n=this.state.doc.lineAt(this.pos),i=Math.max(n.from,this.pos-250),r=n.text.slice(i-n.from,this.pos-n.from),s=r.search(Q4e(t,!1));return s<0?null:{from:i+s,to:this.pos,text:r.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(t,n,i){t=="abort"&&this.abortListeners&&(this.abortListeners.push(n),i&&i.onDocChange&&(this.abortOnDocChange=!0))}}function Pre(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function KLt(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let s=1;stypeof r=="string"?{label:r}:r),[n,i]=t.every(r=>/^\w+$/.test(r.label))?[/\w*$/,/\w+$/]:KLt(t);return r=>{let s=r.matchBefore(i);return s||r.explicit?{from:s?s.from:r.pos,options:t,validFor:n}:null}}function U4e(e,t){return n=>{for(let i=Yr(n.state).resolveInner(n.pos,-1);i;i=i.parent){if(e.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return t(n)}}class Dre{constructor(t,n,i,r){this.completion=t,this.source=n,this.match=i,this.score=r}}function Jy(e){return e.selection.main.from}function Q4e(e,t){var n;let{source:i}=e,r=t&&i[0]!="^",s=i[i.length-1]!="$";return!r&&!s?e:new RegExp(`${r?"^":""}(?:${i})${s?"$":""}`,(n=e.flags)!==null&&n!==void 0?n:e.ignoreCase?"i":"")}const cW=Rh.define();function GLt(e,t,n,i){let{main:r}=e.selection,s=n-r.from,o=i-r.from;return{...e.changeByRange(l=>{if(l!=r&&n!=i&&e.sliceDoc(l.from+s,l.from+o)!=e.sliceDoc(n,i))return{range:l};let c=e.toText(t);return{changes:{from:l.from+s,to:i==r.from?l.to:l.from+o,insert:c},range:ht.cursor(l.from+s+c.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const Mre=new WeakMap;function XLt(e){if(!Array.isArray(e))return e;let t=Mre.get(e);return t||Mre.set(e,t=lW(e)),t}const rP=pi.define(),VC=pi.define();class YLt{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n=48&&k<=57||k>=97&&k<=122?2:k>=65&&k<=90?1:0:(S=Mq(k))!=S.toLowerCase()?1:S!=S.toUpperCase()?2:0;(!w||C==1&&v||O==0&&C!=0)&&(n[f]==k||i[f]==k&&(h=!0)?o[f++]=w:o.length&&(y=!1)),O=C,w+=eh(k)}return f==c&&o[0]==0&&y?this.result(-100+(h?-200:0),o,t):m==c&&g==0?this.ret(-200-t.length+(b==t.length?0:-100),[0,b]):l>-1?this.ret(-700-t.length,[l,l+this.pattern.length]):m==c?this.ret(-900-t.length,[g,b]):f==c?this.result(-100+(h?-200:0)+-700+(y?0:-1100),o,t):n.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,t)}result(t,n,i){let r=[],s=0;for(let o of n){let l=o+(this.astral?eh(jc(i,o)):1);s&&r[s-1]==o?r[s-1]=l:(r[s++]=o,r[s++]=l)}return this.ret(t-i.length,r)}}class ZLt{constructor(t){this.pattern=t,this.matched=[],this.score=0,this.folded=t.toLowerCase()}match(t){if(t.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:JLt,filterStrict:!1,compareCompletions:(t,n)=>(t.sortText||t.label).localeCompare(n.sortText||n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(t,n)=>t&&n,closeOnBlur:(t,n)=>t&&n,icons:(t,n)=>t&&n,tooltipClass:(t,n)=>i=>Lre(t(i),n(i)),optionClass:(t,n)=>i=>Lre(t(i),n(i)),addToOptions:(t,n)=>t.concat(n),filterStrict:(t,n)=>t||n})}});function Lre(e,t){return e?t?e+" "+t:e:t}function JLt(e,t,n,i,r,s){let o=e.textDirection==os.RTL,l=o,c=!1,u="top",d,f,h=t.left-r.left,m=r.right-t.right,g=i.right-i.left,b=i.bottom-i.top;if(l&&h=b||w>t.top?d=n.bottom-t.top:(u="bottom",d=t.bottom-n.top)}let v=(t.bottom-t.top)/s.offsetHeight,y=(t.right-t.left)/s.offsetWidth;return{style:`${u}: ${d/v}px; max-width: ${f/y}px`,class:"cm-completionInfo-"+(c?o?"left-narrow":"right-narrow":l?"left":"right")}}const uW=pi.define();function e5t(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(n){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),n.type&&i.classList.add(...n.type.split(/\s+/g).map(r=>"cm-completionIcon-"+r)),i.setAttribute("aria-hidden","true"),i},position:20}),t.push({render(n,i,r,s){let o=document.createElement("span");o.className="cm-completionLabel";let l=n.displayLabel||n.label,c=0;for(let u=0;uc&&o.appendChild(document.createTextNode(l.slice(c,d)));let h=o.appendChild(document.createElement("span"));h.appendChild(document.createTextNode(l.slice(d,f))),h.className="cm-completionMatchedText",c=f}return cn.position-i.position).map(n=>n.render)}function b$(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let r=Math.floor(t/n);return{from:r*n,to:(r+1)*n}}let i=Math.ceil((e-t)/n);return{from:e-i*n,to:e-(i-1)*n}}class t5t{constructor(t,n,i){this.view=t,this.stateField=n,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:c=>this.placeInfo(c),key:this},this.space=null,this.currentClass="";let r=t.state.field(n),{options:s,selected:o}=r.open,l=t.state.facet(jo);this.optionContent=e5t(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=b$(s.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",c=>{let{options:u}=t.state.field(n).open;for(let d=c.target,f;d&&d!=this.dom;d=d.parentNode)if(d.nodeName=="LI"&&(f=/-(\d+)$/.exec(d.id))&&+f[1]this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;d!=null&&(t.dispatch({effects:uW.of(d)}),c.preventDefault())}}),this.dom.addEventListener("focusout",c=>{let u=t.state.field(this.stateField,!1);u&&u.tooltip&&t.state.facet(jo).closeOnBlur&&c.relatedTarget!=t.contentDOM&&t.dispatch({effects:VC.of(null)})}),this.showOptions(s,r.id)}mount(){this.updateSel()}showOptions(t,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(t){var n;let i=t.state.field(this.stateField),r=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),i!=r){let{options:s,selected:o,disabled:l}=i.open;(!r.open||r.open.options!=s)&&(this.range=b$(s.length,o,t.state.facet(jo).maxRenderedOptions),this.showOptions(s,i.id)),this.updateSel(),l!=((n=r.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(t){let n=this.tooltipClass(t);if(n!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of n.split(" "))i&&this.dom.classList.add(i);this.currentClass=n}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),n=t.open;(n.selected>-1&&n.selected=this.range.to)&&(this.range=b$(n.options.length,n.selected,this.view.state.facet(jo).maxRenderedOptions),this.showOptions(n.options,t.id));let i=this.updateSelectedOption(n.selected);if(i){this.destroyInfo();let{completion:r}=n.options[n.selected],{info:s}=r;if(!s)return;let o=typeof s=="string"?document.createTextNode(s):s(r);if(!o)return;"then"in o?o.then(l=>{l&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(l,r)}).catch(l=>Dc(this.view.state,l,"completion info")):(this.addInfoPane(o,r),i.setAttribute("aria-describedby",this.info.id))}}addInfoPane(t,n){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",i.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),t.nodeType!=null)i.appendChild(t),this.infoDestroy=null;else{let{dom:r,destroy:s}=t;i.appendChild(r),this.infoDestroy=s||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){let n=null;for(let i=this.list.firstChild,r=this.range.from;i;i=i.nextSibling,r++)i.nodeName!="LI"||!i.id?r--:r==t?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),n=i):i.hasAttribute("aria-selected")&&(i.removeAttribute("aria-selected"),i.removeAttribute("aria-describedby"));return n&&i5t(this.list,n),n}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let n=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),r=t.getBoundingClientRect(),s=this.space;if(!s){let o=this.dom.ownerDocument.documentElement;s={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return r.top>Math.min(s.bottom,n.bottom)-10||r.bottom{o.target==r&&o.preventDefault()});let s=null;for(let o=i.from;oi.from||i.from==0))if(s=h,typeof u!="string"&&u.header)r.appendChild(u.header(u));else{let m=r.appendChild(document.createElement("completion-section"));m.textContent=h}}const d=r.appendChild(document.createElement("li"));d.id=n+"-"+o,d.setAttribute("role","option");let f=this.optionClass(l);f&&(d.className=f);for(let h of this.optionContent){let m=h(l,this.view.state,this.view,c);m&&d.appendChild(m)}}return i.from&&r.classList.add("cm-completionListIncompleteTop"),i.tonew t5t(n,e,t)}function i5t(e,t){let n=e.getBoundingClientRect(),i=t.getBoundingClientRect(),r=n.height/e.offsetHeight;i.topn.bottom&&(e.scrollTop+=(i.bottom-n.bottom)/r)}function $re(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}function r5t(e,t){let n=[],i=null,r=null,s=d=>{n.push(d);let{section:f}=d.completion;if(f){i||(i=[]);let h=typeof f=="string"?f:f.name;i.some(m=>m.name==h)||i.push(typeof f=="string"?{name:h}:f)}},o=t.facet(jo);for(let d of e)if(d.hasResult()){let f=d.result.getMatch;if(d.result.filter===!1)for(let h of d.result.options)s(new Dre(h,d.source,f?f(h):[],1e9-n.length));else{let h=t.sliceDoc(d.from,d.to),m,g=o.filterStrict?new ZLt(h):new YLt(h);for(let b of d.result.options)if(m=g.match(b.label)){let v=b.displayLabel?f?f(b,m.matched):[]:m.matched,y=m.score+(b.boost||0);if(s(new Dre(b,d.source,v,y)),typeof b.section=="object"&&b.section.rank==="dynamic"){let{name:w}=b.section;r||(r=Object.create(null)),r[w]=Math.max(y,r[w]||-1e9)}}}}if(i){let d=Object.create(null),f=0,h=(m,g)=>(m.rank==="dynamic"&&g.rank==="dynamic"?r[g.name]-r[m.name]:0)||(typeof m.rank=="number"?m.rank:1e9)-(typeof g.rank=="number"?g.rank:1e9)||(m.nameh.score-f.score||u(f.completion,h.completion))){let f=d.completion;!c||c.label!=f.label||c.detail!=f.detail||c.type!=null&&f.type!=null&&c.type!=f.type||c.apply!=f.apply||c.boost!=f.boost?l.push(d):$re(d.completion)>$re(c)&&(l[l.length-1]=d),c=d.completion}return l}class Ux{constructor(t,n,i,r,s,o){this.options=t,this.attrs=n,this.tooltip=i,this.timestamp=r,this.selected=s,this.disabled=o}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new Ux(this.options,Fre(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,i,r,s,o){if(r&&!o&&t.some(u=>u.isPending))return r.setDisabled();let l=r5t(t,n);if(!l.length)return r&&t.some(u=>u.isPending)?r.setDisabled():null;let c=n.facet(jo).selectOnOpen?0:-1;if(r&&r.selected!=c&&r.selected!=-1){let u=r.options[r.selected].completion;for(let d=0;dd.hasResult()?Math.min(u,d.from):u,1e8),create:u5t,above:s.aboveCursor},r?r.timestamp:Date.now(),c,!1)}map(t){return new Ux(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new Ux(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class sP{constructor(t,n,i){this.active=t,this.id=n,this.open=i}static start(){return new sP(l5t,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,i=n.facet(jo),s=(i.override||n.languageDataAt("autocomplete",Jy(n)).map(XLt)).map(c=>(this.active.find(d=>d.source==c)||new md(c,this.active.some(d=>d.state!=0)?1:0)).update(t,i));s.length==this.active.length&&s.every((c,u)=>c==this.active[u])&&(s=this.active);let o=this.open,l=t.effects.some(c=>c.is(dW));o&&t.docChanged&&(o=o.map(t.changes)),t.selection||s.some(c=>c.hasResult()&&t.changes.touchesRange(c.from,c.to))||!s5t(s,this.active)||l?o=Ux.build(s,n,this.id,o,i,l):o&&o.disabled&&!s.some(c=>c.isPending)&&(o=null),!o&&s.every(c=>!c.isPending)&&s.some(c=>c.hasResult())&&(s=s.map(c=>c.hasResult()?new md(c.source,0):c));for(let c of t.effects)c.is(uW)&&(o=o&&o.setSelected(c.value,this.id));return s==this.active&&o==this.open?this:new sP(s,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?a5t:o5t}}function s5t(e,t){if(e==t)return!0;for(let n=0,i=0;;){for(;n-1&&(n["aria-activedescendant"]=e+"-"+t),n}const l5t=[];function z4e(e,t){if(e.isUserEvent("input.complete")){let i=e.annotation(cW);if(i&&t.activateOnCompletion(i))return 12}let n=e.isUserEvent("input.type");return n&&t.activateOnTyping?5:n?1:e.isUserEvent("delete.backward")?2:e.selection?8:e.docChanged?16:0}class md{constructor(t,n,i=!1){this.source=t,this.state=n,this.explicit=i}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let i=z4e(t,n),r=this;(i&8||i&16&&this.touches(t))&&(r=new md(r.source,0)),i&4&&r.state==0&&(r=new md(this.source,1)),r=r.updateFor(t,i);for(let s of t.effects)if(s.is(rP))r=new md(r.source,1,s.value);else if(s.is(VC))r=new md(r.source,0);else if(s.is(dW))for(let o of s.value)o.source==r.source&&(r=o);return r}updateFor(t,n){return this.map(t.changes)}map(t){return this}touches(t){return t.changes.touchesRange(Jy(t.state))}}class kw extends md{constructor(t,n,i,r,s,o){super(t,3,n),this.limit=i,this.result=r,this.from=s,this.to=o}hasResult(){return!0}updateFor(t,n){var i;if(!(n&3))return this.map(t.changes);let r=this.result;r.map&&!t.changes.empty&&(r=r.map(r,t.changes));let s=t.changes.mapPos(this.from),o=t.changes.mapPos(this.to,1),l=Jy(t.state);if(l>o||!r||n&2&&(Jy(t.startState)==this.from||ln.map(t))}}),Nc=dl.define({create(){return sP.start()},update(e,t){return e.update(t)},provide:e=>[Jq.from(e,t=>t.tooltip),Jt.contentAttributes.from(e,t=>t.attrs)]});function fW(e,t){const n=t.completion.apply||t.completion.label;let i=e.state.field(Nc).active.find(r=>r.source==t.source);return i instanceof kw?(typeof n=="string"?e.dispatch({...GLt(e.state,n,i.from,i.to),annotations:cW.of(t.completion)}):n(e,t.completion,i.from,i.to),!0):!1}const u5t=n5t(Nc,fW);function ij(e,t="option"){return n=>{let i=n.state.field(Nc,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp-1?i.open.selected+r*(e?1:-1):e?0:o-1;return l<0?l=t=="page"?0:o-1:l>=o&&(l=t=="page"?o-1:0),n.dispatch({effects:uW.of(l)}),!0}}const d5t=e=>{let t=e.state.field(Nc,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestampe.state.field(Nc,!1)?(e.dispatch({effects:rP.of(!0)}),!0):!1,f5t=e=>{let t=e.state.field(Nc,!1);return!t||!t.active.some(n=>n.state!=0)?!1:(e.dispatch({effects:VC.of(null)}),!0)};class h5t{constructor(t,n){this.active=t,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const p5t=50,m5t=1e3,g5t=ma.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(Nc).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(Nc),n=e.state.facet(jo);if(!e.selectionSet&&!e.docChanged&&e.startState.field(Nc)==t)return;let i=e.transactions.some(s=>{let o=z4e(s,n);return o&8||(s.selection||s.docChanged)&&!(o&3)});for(let s=0;sp5t&&Date.now()-o.time>m5t){for(let l of o.context.abortListeners)try{l()}catch(c){Dc(this.view.state,c)}o.context.abortListeners=null,this.running.splice(s--,1)}else o.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(s=>s.effects.some(o=>o.is(rP)))&&(this.pendingStart=!0);let r=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(s=>s.isPending&&!this.running.some(o=>o.active.source==s.source))?setTimeout(()=>this.startUpdate(),r):-1,this.composing!=0)for(let s of e.transactions)s.isUserEvent("input.type")?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(Nc);for(let n of t.active)n.isPending&&!this.running.some(i=>i.active.source==n.source)&&this.startQuery(n);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(jo).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=Jy(t),i=new oW(t,n,e.explicit,this.view),r=new h5t(e,i);this.running.push(r),Promise.resolve(e.source(i)).then(s=>{r.context.aborted||(r.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:VC.of(null)}),Dc(this.view.state,s)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(jo).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(jo),i=this.view.state.field(Nc);for(let r=0;rl.source==s.active.source);if(o&&o.isPending)if(s.done==null){let l=new md(s.active.source,0);for(let c of s.updates)l=l.update(c,n);l.isPending||t.push(l)}else this.startQuery(o)}(t.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:dW.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(Nc,!1);if(t&&t.tooltip&&this.view.state.facet(jo).closeOnBlur){let n=t.open&&o4e(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:VC.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:rP.of(!1)}),20),this.composing=0}}}),b5t=typeof navigator=="object"&&/Win/.test(navigator.platform),y5t=gm.highest(Jt.domEventHandlers({keydown(e,t){let n=t.state.field(Nc,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(b5t&&e.altKey)||e.metaKey)return!1;let i=n.open.options[n.open.selected],r=n.active.find(o=>o.source==i.source),s=i.completion.commitCharacters||r.result.commitCharacters;return s&&s.indexOf(e.key)>-1&&fW(t,i),!1}})),V4e=Jt.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class v5t{constructor(t,n,i,r){this.field=t,this.line=n,this.from=i,this.to=r}}class hW{constructor(t,n,i){this.field=t,this.from=n,this.to=i}map(t){let n=t.mapPos(this.from,-1,il.TrackDel),i=t.mapPos(this.to,1,il.TrackDel);return n==null||i==null?null:new hW(this.field,n,i)}}class pW{constructor(t,n){this.lines=t,this.fieldPositions=n}instantiate(t,n){let i=[],r=[n],s=t.doc.lineAt(n),o=/^\s*/.exec(s.text)[0];for(let c of this.lines){if(i.length){let u=o,d=/^\t*/.exec(c)[0].length;for(let f=0;fnew hW(c.field,r[c.line]+c.from,r[c.line]+c.to));return{text:i,ranges:l}}static parse(t){let n=[],i=[],r=[],s;for(let o of t.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(o);){let l=s[1]?+s[1]:null,c=s[2]||s[3]||"",u=-1;l===0&&(l=1e9);let d=c.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f=u&&h.field++}for(let f of r)if(f.line==i.length&&f.from>s.index){let h=s[2]?3+(s[1]||"").length:2;f.from-=h,f.to-=h}r.push(new v5t(u,i.length,s.index,s.index+d.length)),o=o.slice(0,s.index)+c+o.slice(s.index+s[0].length)}o=o.replace(/\\([{}])/g,(l,c,u)=>{for(let d of r)d.line==i.length&&d.from>u&&(d.from--,d.to--);return c}),i.push(o)}return new pW(i,r)}}let x5t=Fn.widget({widget:new class extends jf{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),w5t=Fn.mark({class:"cm-snippetField"});class mO{constructor(t,n){this.ranges=t,this.active=n,this.deco=Fn.set(t.map(i=>(i.from==i.to?x5t:w5t).range(i.from,i.to)),!0)}map(t){let n=[];for(let i of this.ranges){let r=i.map(t);if(!r)return null;n.push(r)}return new mO(n,this.active)}selectionInsideField(t){return t.ranges.every(n=>this.ranges.some(i=>i.field==this.active&&i.from<=n.from&&i.to>=n.to))}}const IT=pi.define({map(e,t){return e&&e.map(t)}}),O5t=pi.define(),HC=dl.define({create(){return null},update(e,t){for(let n of t.effects){if(n.is(IT))return n.value;if(n.is(O5t)&&e)return new mO(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>Jt.decorations.from(e,t=>t?t.deco:Fn.none)});function mW(e,t){return ht.create(e.filter(n=>n.field==t).map(n=>ht.range(n.from,n.to)))}function k5t(e){let t=pW.parse(e);return(n,i,r,s)=>{let{text:o,ranges:l}=t.instantiate(n.state,r),{main:c}=n.state.selection,u={changes:{from:r,to:s==c.from?c.to:s,insert:xr.of(o)},scrollIntoView:!0,annotations:i?[cW.of(i),Xa.userEvent.of("input.complete")]:void 0};if(l.length&&(u.selection=mW(l,0)),l.some(d=>d.field>0)){let d=new mO(l,0),f=u.effects=[IT.of(d)];n.state.field(HC,!1)===void 0&&f.push(pi.appendConfig.of([HC,T5t,_5t,V4e]))}n.dispatch(n.state.update(u))}}function H4e(e){return({state:t,dispatch:n})=>{let i=t.field(HC,!1);if(!i||e<0&&i.active==0)return!1;let r=i.active+e,s=e>0&&!i.ranges.some(o=>o.field==r+e);return n(t.update({selection:mW(i.ranges,r),effects:IT.of(s?null:new mO(i.ranges,r)),scrollIntoView:!0})),!0}}const S5t=({state:e,dispatch:t})=>e.field(HC,!1)?(t(e.update({effects:IT.of(null)})),!0):!1,E5t=H4e(1),C5t=H4e(-1),A5t=[{key:"Tab",run:E5t,shift:C5t},{key:"Escape",run:S5t}],Bre=mn.define({combine(e){return e.length?e[0]:A5t}}),T5t=gm.highest(hO.compute([Bre],e=>e.facet(Bre)));function Ys(e,t){return{...t,apply:k5t(e)}}const _5t=Jt.domEventHandlers({mousedown(e,t){let n=t.state.field(HC,!1),i;if(!n||(i=t.posAtCoords({x:e.clientX,y:e.clientY}))==null)return!1;let r=n.ranges.find(s=>s.from<=i&&s.to>=i);return!r||r.field==n.active?!1:(t.dispatch({selection:mW(n.ranges,r.field),effects:IT.of(n.ranges.some(s=>s.field>r.field)?new mO(n.ranges,r.field):null),scrollIntoView:!0}),!0)}}),qC={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Dy=pi.define({map(e,t){let n=t.mapPos(e,-1,il.TrackAfter);return n??void 0}}),gW=new class extends fb{};gW.startSide=1;gW.endSide=-1;const q4e=dl.define({create(){return Ki.empty},update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:i=>i>=n.from&&i<=n.to})}for(let n of t.effects)n.is(Dy)&&(e=e.update({add:[gW.range(n.value,n.value+1)]}));return e}});function j5t(){return[R5t,q4e]}const v$="()[]{}<>«»»«[]{}";function W4e(e){for(let t=0;t{if((N5t?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let r=e.state.selection.main;if(i.length>2||i.length==2&&eh(jc(i,0))==1||t!=r.from||n!=r.to)return!1;let s=D5t(e.state,i);return s?(e.dispatch(s),!0):!1}),I5t=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=K4e(e,e.selection.main.head).brackets||qC.brackets,r=null,s=e.changeByRange(o=>{if(o.empty){let l=M5t(e.doc,o.head);for(let c of i)if(c==l&&sL(e.doc,o.head)==W4e(jc(c,0)))return{changes:{from:o.head-c.length,to:o.head+c.length},range:ht.cursor(o.head-c.length)}}return{range:r=o}});return r||t(e.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!r},P5t=[{key:"Backspace",run:I5t}];function D5t(e,t){let n=K4e(e,e.selection.main.head),i=n.brackets||qC.brackets;for(let r of i){let s=W4e(jc(r,0));if(t==r)return s==r?F5t(e,r,i.indexOf(r+r+r)>-1,n):L5t(e,r,s,n.before||qC.before);if(t==s&&G4e(e,e.selection.main.from))return $5t(e,r,s)}return null}function G4e(e,t){let n=!1;return e.field(q4e).between(0,e.doc.length,i=>{i==t&&(n=!0)}),n}function sL(e,t){let n=e.sliceString(t,t+2);return n.slice(0,eh(jc(n,0)))}function M5t(e,t){let n=e.sliceString(t-2,t);return eh(jc(n,0))==n.length?n:n.slice(1)}function L5t(e,t,n,i){let r=null,s=e.changeByRange(o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:n,from:o.to}],effects:Dy.of(o.to+t.length),range:ht.range(o.anchor+t.length,o.head+t.length)};let l=sL(e.doc,o.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:t+n,from:o.head},effects:Dy.of(o.head+t.length),range:ht.cursor(o.head+t.length)}:{range:r=o}});return r?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function $5t(e,t,n){let i=null,r=e.changeByRange(s=>s.empty&&sL(e.doc,s.head)==n?{changes:{from:s.head,to:s.head+n.length,insert:n},range:ht.cursor(s.head+n.length)}:i={range:s});return i?null:e.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function F5t(e,t,n,i){let r=i.stringPrefixes||qC.stringPrefixes,s=null,o=e.changeByRange(l=>{if(!l.empty)return{changes:[{insert:t,from:l.from},{insert:t,from:l.to}],effects:Dy.of(l.to+t.length),range:ht.range(l.anchor+t.length,l.head+t.length)};let c=l.head,u=sL(e.doc,c),d;if(u==t){if(Ure(e,c))return{changes:{insert:t+t,from:c},effects:Dy.of(c+t.length),range:ht.cursor(c+t.length)};if(G4e(e,c)){let h=n&&e.sliceDoc(c,c+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:c,to:c+h.length,insert:h},range:ht.cursor(c+h.length)}}}else{if(n&&e.sliceDoc(c-2*t.length,c)==t+t&&(d=Qre(e,c-2*t.length,r))>-1&&Ure(e,d))return{changes:{insert:t+t+t+t,from:c},effects:Dy.of(c+t.length),range:ht.cursor(c+t.length)};if(e.charCategorizer(c)(u)!=Qs.Word&&Qre(e,c,r)>-1&&!B5t(e,c,t,r))return{changes:{insert:t+t,from:c},effects:Dy.of(c+t.length),range:ht.cursor(c+t.length)}}return{range:s=l}});return s?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function Ure(e,t){let n=Yr(e).resolveInner(t+1);return n.parent&&n.from==t}function B5t(e,t,n,i){let r=Yr(e).resolveInner(t,-1),s=i.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=e.sliceDoc(r.from,Math.min(r.to,r.from+n.length+s)),c=l.indexOf(n);if(!c||c>-1&&i.indexOf(l.slice(0,c))>-1){let d=r.firstChild;for(;d&&d.from==r.from&&d.to-d.from>n.length+c;){if(e.sliceDoc(d.to-n.length,d.to)==n)return!1;d=d.firstChild}return!0}let u=r.to==t&&r.parent;if(!u)break;r=u}return!1}function Qre(e,t,n){let i=e.charCategorizer(t);if(i(e.sliceDoc(t-1,t))!=Qs.Word)return t;for(let r of n){let s=t-r.length;if(e.sliceDoc(s,t)==r&&i(e.sliceDoc(s-1,s))!=Qs.Word)return s}return-1}function U5t(e={}){return[y5t,Nc,jo.of(e),g5t,Q5t,V4e]}const X4e=[{key:"Ctrl-Space",run:y$},{mac:"Alt-`",run:y$},{mac:"Alt-i",run:y$},{key:"Escape",run:f5t},{key:"ArrowDown",run:ij(!0)},{key:"ArrowUp",run:ij(!1)},{key:"PageDown",run:ij(!0,"page")},{key:"PageUp",run:ij(!1,"page")},{key:"Enter",run:d5t}],Q5t=gm.highest(hO.computeN([jo],e=>e.facet(jo).defaultKeymap?[X4e]:[])),Y4e=[Ys("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Ys("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Ys("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Ys("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Ys("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Ys(`try { +`);i>-1&&(n=n.slice(0,i))}return t+n.length<=this.to?n:n.slice(0,this.to-t)}nextLine(){let t=this.parsedPos,n=this.lineAfter(t),i=t+n.length;for(let r=this.rangeIndex;;){let s=this.ranges[r].to;if(s>=i||(n=n.slice(0,s-(i-n.length)),r++,r==this.ranges.length))break;let o=this.ranges[r].from,l=this.lineAfter(o);n+=l,i=o+l.length}return{line:n,end:i}}skipGapsTo(t,n,i){for(;;){let r=this.ranges[this.rangeIndex].to,s=t+n;if(i>0?r>s:r>=s)break;let o=this.ranges[++this.rangeIndex].from;n+=o-r}return n}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){r=this.skipGapsTo(n,r,1),n+=r;let l=this.chunk.length;r=this.skipGapsTo(i,r,-1),i+=r,s+=this.chunk.length-l}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&s==4&&o>=0&&this.chunk[o]==t&&this.chunk[o+2]==n?this.chunk[o+2]=i:this.chunk.push(t,n,i,s),r}parseLine(t){let{line:n,end:i}=this.nextLine(),r=0,{streamParser:s}=this.lang,o=new P4e(n,t?t.state.tabSize:4,t?E0(t.state):2);if(o.eol())s.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=M4e(s.token,o,this.state);if(l&&(r=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,r)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPost.start)return r}throw new Error("Stream parser failed to advance stream.")}const oW=Object.create(null),VC=[Za.none],lLt=new hO(VC),Ere=[],Cre=Object.create(null),L4e=Object.create(null);for(let[e,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])L4e[e]=F4e(oW,t);class $4e{constructor(t){this.extra=t,this.table=Object.assign(Object.create(null),L4e)}resolve(t){return t?this.table[t]||(this.table[t]=F4e(this.extra,t)):0}}const cLt=new $4e(oW);function p$(e,t){Ere.indexOf(e)>-1||(Ere.push(e),console.warn(t))}function F4e(e,t){let n=[];for(let l of t.split(" ")){let c=[];for(let u of l.split(".")){let d=e[u]||he[u];d?typeof d=="function"?c.length?c=c.map(d):p$(u,`Modifier ${u} used at start of tag`):c.length?p$(u,`Tag ${u} used as modifier`):c=Array.isArray(d)?d:[d]:p$(u,`Unknown highlighting tag ${u}`)}for(let u of c)n.push(u)}if(!n.length)return 0;let i=t.replace(/ /g,"_"),r=i+" "+n.map(l=>l.id),s=Cre[r];if(s)return s.id;let o=Cre[r]=Za.define({id:VC.length,name:i,props:[ym({[i]:n})]});return VC.push(o),o.id}function uLt(e,t){let n=Za.define({id:VC.length,name:"Document",props:[Og.add(()=>e),vm.add(()=>i=>t.getIndent(i))],top:!0});return VC.push(n),n}os.RTL,os.LTR;var Are={};class tP{constructor(t,n,i,r,s,o,l,c,u,d=0,f){this.p=t,this.stack=n,this.state=i,this.reducePos=r,this.pos=s,this.score=o,this.buffer=l,this.bufferBase=c,this.curContext=u,this.lookAhead=d,this.parent=f}toString(){return`[${this.stack.filter((t,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,n,i=0){let r=t.parser.context;return new tP(t,[],n,i,i,0,[],0,r?new Tre(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var n;let i=t>>19,r=t&65535,{parser:s}=this.p,o=this.reducePos=2e3&&!(!((n=this.p.parser.nodeSet.types[r])===null||n===void 0)&&n.isAnonymous)&&(u==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=d):this.p.lastBigReductionSizec;)this.stack.pop();this.reduceContext(r,u)}storeNode(t,n,i,r=4,s=!1){if(t==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&this.buffer[o-4]==0&&this.buffer[o-1]>-1){if(n==i)return;if(this.buffer[o-2]>=n){this.buffer[o-2]=i;return}}}if(!s||this.pos==i)this.buffer.push(t,n,i,r);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let l=!1;for(let c=o;c>0&&this.buffer[c-2]>i;c-=4)if(this.buffer[c-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>i;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,r>4&&(r-=4)}this.buffer[o]=t,this.buffer[o+1]=n,this.buffer[o+2]=i,this.buffer[o+3]=r}}shift(t,n,i,r){if(t&131072)this.pushState(t&65535,this.pos);else if(t&262144)this.pos=r,this.shiftContext(n,i),n<=this.p.parser.maxNode&&this.buffer.push(n,i,r,4);else{let s=t,{parser:o}=this.p;this.pos=r;let l=o.stateFlag(s,1);!l&&(r>i||n<=o.maxNode)&&(this.reducePos=r),this.pushState(s,l?i:Math.min(i,this.reducePos)),this.shiftContext(n,i),n<=o.maxNode&&this.buffer.push(n,i,r,4)}}apply(t,n,i,r){t&65536?this.reduce(t):this.shift(t,n,i,r)}useNode(t,n){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=t)&&(this.p.reused.push(t),i++);let r=this.pos;this.reducePos=this.pos=r+t.length,this.pushState(n,r),this.buffer.push(i,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,n=t.buffer.length;for(n&&t.buffer[n-4]==0&&(n-=4);n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let i=t.buffer.slice(n),r=t.bufferBase+n;for(;t&&r==t.bufferBase;)t=t.parent;return new tP(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,r,this.curContext,this.lookAhead,t)}recoverByDelete(t,n){let i=t<=this.p.parser.maxNode;i&&this.storeNode(t,this.pos,n,4),this.storeNode(0,this.pos,n,i?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(t){for(let n=new dLt(this);;){let i=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,t);if(i==0)return!1;if(!(i&65536))return!0;n.reduce(i)}}recoverByInsert(t){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let r=[];for(let s=0,o;sc&1&&l==o)||r.push(n[s],o)}n=r}let i=[];for(let r=0;r>19,r=n&65535,s=this.stack.length-i*3;if(s<0||t.getGoto(this.stack[s],r,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;n=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:t}=this.p,n=[],i=(r,s)=>{if(!n.includes(r))return n.push(r),t.allActions(r,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-s;if(l>1){let c=o&65535,u=this.stack.length-l*3;if(u>=0&&t.getGoto(this.stack[u],c,!1)>=0)return l<<19|65536|c}}else{let l=i(o,s+1);if(l!=null)return l}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:t}=this.p;return t.data[t.stateSlot(this.state,1)]==65535&&!t.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let n=0;n0&&this.emitLookAhead()}}class Tre{constructor(t,n){this.tracker=t,this.context=n,this.hash=t.strict?t.hash(n):0}}class dLt{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let n=t&65535,i=t>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=r}}class nP{constructor(t,n,i){this.stack=t,this.pos=n,this.index=i,this.buffer=t.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new nP(t,n,n-t.bufferBase)}maybeNext(){let t=this.stack.parent;t!=null&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new nP(this.stack,this.pos,this.index)}}function wS(e,t=Uint16Array){if(typeof e!="string")return e;let n=null;for(let i=0,r=0;i=92&&o--,o>=34&&o--;let c=o-32;if(c>=46&&(c-=46,l=!0),s+=c,l)break;s*=46}n?n[r++]=s:n=new t(s)}return n}class HN{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const _re=new HN;class fLt{constructor(t,n){this.input=t,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=_re,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(t,n){let i=this.range,r=this.rangeIndex,s=this.pos+t;for(;si.to:s>=i.to;){if(r==this.ranges.length-1)return null;let o=this.ranges[++r];s+=o.from-i.to,i=o}return s}clipPos(t){if(t>=this.range.from&&tt)return Math.max(t,n.from);return this.end}peek(t){let n=this.chunkOff+t,i,r;if(n>=0&&n=this.chunk2Pos&&il.to&&(this.chunk2=this.chunk2.slice(0,l.to-i)),r=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),r}acceptToken(t,n=0){let i=n?this.resolveOffset(n,-1):this.pos;if(i==null||i=this.chunk2Pos&&this.posthis.range.to?t.slice(0,this.range.to-this.pos):t,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(t,n){if(n?(this.token=n,n.start=t,n.lookAhead=t+1,n.value=n.extended=-1):this.token=_re,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,n-this.chunkPos);if(t>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,n-this.chunk2Pos);if(t>=this.range.from&&n<=this.range.to)return this.input.read(t,n);let i="";for(let r of this.ranges){if(r.from>=n)break;r.to>t&&(i+=this.input.read(Math.max(r.from,t),Math.min(r.to,n)))}return i}}class kw{constructor(t,n){this.data=t,this.id=n}token(t,n){let{parser:i}=n.p;B4e(this.data,t,n,this.id,i.data,i.tokenPrecTable)}}kw.prototype.contextual=kw.prototype.fallback=kw.prototype.extend=!1;class iP{constructor(t,n,i){this.precTable=n,this.elseToken=i,this.data=typeof t=="string"?wS(t):t}token(t,n){let i=t.pos,r=0;for(;;){let s=t.next<0,o=t.resolveOffset(1,1);if(B4e(this.data,t,n,0,this.data,this.precTable),t.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,o==null)break;t.reset(o,t.token)}r&&(t.reset(i,t.token),t.acceptToken(this.elseToken,r))}}iP.prototype.contextual=kw.prototype.fallback=kw.prototype.extend=!1;class Ia{constructor(t,n={}){this.token=t,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function B4e(e,t,n,i,r,s){let o=0,l=1<0){let g=e[m];if(c.allows(g)&&(t.token.value==-1||t.token.value==g||hLt(g,t.token.value,r,s))){t.acceptToken(g);break}}let d=t.next,f=0,h=e[o+2];if(t.next<0&&h>f&&e[u+h*3-3]==65535){o=e[u+h*3-1];continue e}for(;f>1,g=u+m+(m<<1),b=e[g],v=e[g+1]||65536;if(d=v)f=m+1;else{o=e[g+2],t.advance();continue e}}break}}function jre(e,t,n){for(let i=t,r;(r=e[i])!=65535;i++)if(r==n)return i-t;return-1}function hLt(e,t,n,i){let r=jre(n,i,t);return r<0||jre(n,i,e)t)&&!i.type.isError)return n<0?Math.max(0,Math.min(i.to-1,t-25)):Math.min(e.length,Math.max(i.from+1,t+25));if(n<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return n<0?0:e.length}}let pLt=class{constructor(t,n){this.fragments=t,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?Nre(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?Nre(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(tt)return this.nextStart=o,null;if(s instanceof Ui){if(o==t){if(o=Math.max(this.safeFrom,t)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[n]++,this.nextStart=o+s.length}}};class mLt{constructor(t,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(i=>new HN)}getActions(t){let n=0,i=null,{parser:r}=t.p,{tokenizers:s}=r,o=r.stateSlot(t.state,3),l=t.curContext?t.curContext.hash:0,c=0;for(let u=0;uf.end+25&&(c=Math.max(f.lookAhead,c)),f.value!=0)){let h=n;if(f.extended>-1&&(n=this.addActions(t,f.extended,f.end,n)),n=this.addActions(t,f.value,f.end,n),!d.extend&&(i=f,n>h))break}}for(;this.actions.length>n;)this.actions.pop();return c&&t.setLookAhead(c),!i&&t.pos==this.stream.end&&(i=new HN,i.value=t.p.parser.eofTerm,i.start=i.end=t.pos,n=this.addActions(t,i.value,i.end,n)),this.mainToken=i,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let n=new HN,{pos:i,p:r}=t;return n.start=i,n.end=Math.min(i+1,r.stream.end),n.value=i==r.stream.end?r.parser.eofTerm:0,n}updateCachedToken(t,n,i){let r=this.stream.clipPos(i.pos);if(n.token(this.stream.reset(r,t),i),t.value>-1){let{parser:s}=i.p;for(let o=0;o=0&&i.p.parser.dialect.allows(l>>1)){l&1?t.extended=l>>1:t.value=l>>1;break}}}else t.value=0,t.end=this.stream.clipPos(r+1)}putAction(t,n,i,r){for(let s=0;st.bufferLength*4?new pLt(i,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t=this.stacks,n=this.minStackPos,i=this.stacks=[],r,s;if(this.bigReductionCount>300&&t.length==1){let[o]=t;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;on)i.push(l);else{if(this.advanceStack(l,i,t))continue;{r||(r=[],s=[]),r.push(l);let c=this.tokens.getMainToken(l);s.push(c.value,c.end)}}break}}if(!i.length){let o=r&&yLt(r);if(o)return iu&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw iu&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&r){let o=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,i);if(o)return iu&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(i.length>o)for(i.sort((l,c)=>c.score-l.score);i.length>o;)i.pop();i.some(l=>l.reducePos>n)&&this.recovering--}else if(i.length>1){e:for(let o=0;o500&&u.buffer.length>500)if((l.score-u.score||l.buffer.length-u.buffer.length)>0)i.splice(c--,1);else{i.splice(o--,1);continue e}}}i.length>12&&(i.sort((o,l)=>l.score-o.score),i.splice(12,i.length-12))}this.minStackPos=i[0].pos;for(let o=1;o ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let u=t.curContext&&t.curContext.tracker.strict,d=u?t.curContext.hash:0;for(let f=this.fragments.nodeAt(r);f;){let h=this.parser.nodeSet.types[f.type.id]==f.type?s.getGoto(t.state,f.type.id):-1;if(h>-1&&f.length&&(!u||(f.prop(ui.contextHash)||0)==d))return t.useNode(f,h),iu&&console.log(o+this.stackID(t)+` (via reuse of ${s.getName(f.type.id)})`),!0;if(!(f instanceof Ui)||f.children.length==0||f.positions[0]>0)break;let m=f.children[0];if(m instanceof Ui&&f.positions[0]==0)f=m;else break}}let l=s.stateSlot(t.state,4);if(l>0)return t.reduce(l),iu&&console.log(o+this.stackID(t)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(t.stack.length>=8400)for(;t.stack.length>6e3&&t.forceReduce(););let c=this.tokens.getActions(t);for(let u=0;ur?n.push(g):i.push(g)}return!1}advanceFully(t,n){let i=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>i)return Rre(t,n),!0}}runRecovery(t,n,i){let r=null,s=!1;for(let o=0;o ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),iu&&console.log(d+this.stackID(l)+" (restarted)"),this.advanceFully(l,i))))continue;let f=l.split(),h=d;for(let m=0;m<10&&f.forceReduce()&&(iu&&console.log(h+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,i));m++)iu&&(h=this.stackID(f)+" -> ");for(let m of l.recoverByInsert(c))iu&&console.log(d+this.stackID(m)+" (via recover-insert)"),this.advanceFully(m,i);this.stream.end>l.pos?(u==l.pos&&(u++,c=0),l.recoverByDelete(c,u),iu&&console.log(d+this.stackID(l)+` (via recover-delete ${this.parser.getName(c)})`),Rre(l,i)):(!r||r.scoree;class rL{constructor(t){this.start=t.start,this.shift=t.shift||g$,this.reduce=t.reduce||g$,this.reuse=t.reuse||g$,this.hash=t.hash||(()=>0),this.strict=t.strict!==!1}}class am extends WM{constructor(t){if(super(),this.wrappers=[],t.version!=14)throw new RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);let n=t.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let l=0;lt.topRules[l][1]),r=[];for(let l=0;l=0)s(d,c,l[u++]);else{let f=l[u+-d];for(let h=-d;h>0;h--)s(l[u++],c,f);u++}}}this.nodeSet=new hO(n.map((l,c)=>Za.define({name:c>=this.minRepeatTerm?void 0:l,id:c,props:r[c],top:i.indexOf(c)>-1,error:c==0,skipped:t.skippedNodes&&t.skippedNodes.indexOf(c)>-1}))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=$5e;let o=wS(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new kw(o,l):l),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,n,i){let r=new gLt(this,t,n,i);for(let s of this.wrappers)r=s(r,t,n,i);return r}getGoto(t,n,i=!1){let r=this.goto;if(n>=r[0])return-1;for(let s=r[n+1];;){let o=r[s++],l=o&1,c=r[s++];if(l&&i)return c;for(let u=s+(o>>1);s0}validAction(t,n){return!!this.allActions(t,i=>i==n?!0:null)}allActions(t,n){let i=this.stateSlot(t,4),r=i?n(i):void 0;for(let s=this.stateSlot(t,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=mp(this.data,s+2);else break;r=n(mp(this.data,s+1))}return r}nextStates(t){let n=[];for(let i=this.stateSlot(t,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=mp(this.data,i+2);else break;if(!(this.data[i+2]&1)){let r=this.data[i+1];n.some((s,o)=>o&1&&s==r)||n.push(this.data[i],r)}}return n}configure(t){let n=Object.assign(Object.create(am.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let i=this.topRules[t.top];if(!i)throw new RangeError(`Invalid top rule name ${t.top}`);n.top=i}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(i=>{let r=t.tokenizers.find(s=>s.from==i);return r?r.to:i})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((i,r)=>{let s=t.specializers.find(l=>l.from==i.external);if(!s)return i;let o=Object.assign(Object.assign({},i),{external:s.to});return n.specializers[r]=Ire(o),o})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let n=this.dynamicPrecedences;return n==null?0:n[t]||0}parseDialect(t){let n=Object.keys(this.dialects),i=n.map(()=>!1);if(t)for(let s of t.split(" ")){let o=n.indexOf(s);o>=0&&(i[o]=!0)}let r=null;for(let s=0;si)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.scoree.external(n,i)<<1|t}return e.get}const vLt=316,xLt=317,Pre=1,wLt=2,OLt=3,kLt=4,SLt=318,ELt=320,CLt=321,ALt=5,TLt=6,_Lt=0,a7=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],U4e=125,jLt=59,o7=47,NLt=42,RLt=43,ILt=45,PLt=60,DLt=44,MLt=63,LLt=46,$Lt=91,FLt=new rL({start:!1,shift(e,t){return t==ALt||t==TLt||t==ELt?e:t==CLt},strict:!1}),BLt=new Ia((e,t)=>{let{next:n}=e;(n==U4e||n==-1||t.context)&&e.acceptToken(SLt)},{contextual:!0,fallback:!0}),ULt=new Ia((e,t)=>{let{next:n}=e,i;a7.indexOf(n)>-1||n==o7&&((i=e.peek(1))==o7||i==NLt)||n!=U4e&&n!=jLt&&n!=-1&&!t.context&&e.acceptToken(vLt)},{contextual:!0}),QLt=new Ia((e,t)=>{e.next==$Lt&&!t.context&&e.acceptToken(xLt)},{contextual:!0}),zLt=new Ia((e,t)=>{let{next:n}=e;if(n==RLt||n==ILt){if(e.advance(),n==e.next){e.advance();let i=!t.context&&t.canShift(Pre);e.acceptToken(i?Pre:wLt)}}else n==MLt&&e.peek(1)==LLt&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(OLt))},{contextual:!0});function b$(e,t){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!t&&e>=48&&e<=57}const VLt=new Ia((e,t)=>{if(e.next!=PLt||!t.dialectEnabled(_Lt)||(e.advance(),e.next==o7))return;let n=0;for(;a7.indexOf(e.next)>-1;)e.advance(),n++;if(b$(e.next,!0)){for(e.advance(),n++;b$(e.next,!1);)e.advance(),n++;for(;a7.indexOf(e.next)>-1;)e.advance(),n++;if(e.next==DLt)return;for(let i=0;;i++){if(i==7){if(!b$(e.next,!0))return;break}if(e.next!="extends".charCodeAt(i))break;e.advance(),n++}}e.acceptToken(kLt,-n)}),HLt=ym({"get set async static":he.modifier,"for while do if else switch try catch finally return throw break continue default case defer":he.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":he.operatorKeyword,"let var const using function class extends":he.definitionKeyword,"import export from":he.moduleKeyword,"with debugger new":he.keyword,TemplateString:he.special(he.string),super:he.atom,BooleanLiteral:he.bool,this:he.self,null:he.null,Star:he.modifier,VariableName:he.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":he.function(he.variableName),VariableDefinition:he.definition(he.variableName),Label:he.labelName,PropertyName:he.propertyName,PrivatePropertyName:he.special(he.propertyName),"CallExpression/MemberExpression/PropertyName":he.function(he.propertyName),"FunctionDeclaration/VariableDefinition":he.function(he.definition(he.variableName)),"ClassDeclaration/VariableDefinition":he.definition(he.className),"NewExpression/VariableName":he.className,PropertyDefinition:he.definition(he.propertyName),PrivatePropertyDefinition:he.definition(he.special(he.propertyName)),UpdateOp:he.updateOperator,"LineComment Hashbang":he.lineComment,BlockComment:he.blockComment,Number:he.number,String:he.string,Escape:he.escape,ArithOp:he.arithmeticOperator,LogicOp:he.logicOperator,BitOp:he.bitwiseOperator,CompareOp:he.compareOperator,RegExp:he.regexp,Equals:he.definitionOperator,Arrow:he.function(he.punctuation),": Spread":he.punctuation,"( )":he.paren,"[ ]":he.squareBracket,"{ }":he.brace,"InterpolationStart InterpolationEnd":he.special(he.brace),".":he.derefOperator,", ;":he.separator,"@":he.meta,TypeName:he.typeName,TypeDefinition:he.definition(he.typeName),"type enum interface implements namespace module declare":he.definitionKeyword,"abstract global Privacy readonly override":he.modifier,"is keyof unique infer asserts":he.operatorKeyword,JSXAttributeValue:he.attributeValue,JSXText:he.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":he.angleBracket,"JSXIdentifier JSXNameSpacedName":he.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":he.attributeName,"JSXBuiltin/JSXIdentifier":he.standard(he.tagName)}),qLt={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},WLt={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},KLt={__proto__:null,"<":193},GLt=am.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-EtOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-EPO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-ERQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<VO!l$xO#jROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!OVO!l$xO#jVO!l$xO#jROe!iOpkOrPO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]VO!l$xO#j^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOrROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]WO!l$xO#jgPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{SU+P%]S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mR>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o>UPS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^T)z$u){V+P%]S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SS#q]SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uSSR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:mSR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:oS)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>X>ZR>Y>['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mSS$oh$pR4U/U'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:mS#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^Q+T%aQ/c*Oo4OP>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^n=rTQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o4OP>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f]>^nZ>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f]>^nZ>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.lPQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.nSR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:FLt,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[HLt],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$i&j(Wp(Z!b'|0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(X#S$i&j'}0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$i&j(Wp(Z!b'}0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$i&j!p),Q(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(V':f$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$i&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$d`$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$d``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$d`$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(Z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$d`(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$i&j(Wp(Z!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$i&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(Z!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$i&j(WpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(WpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Wp(Z!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$i&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$i&j(Z!b!X7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(Z!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(Z!b!X7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(Z!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$i&j(Z!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!g$b$i&j$O)Lv(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#R-v$?V_!^(CdvBr$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!q7`$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$i&j(Wp(Z!b'|0/l$]#t(T,2j(e$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[ULt,QLt,zLt,VLt,2,3,4,5,6,7,8,9,10,11,12,13,14,BLt,new iP("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new iP("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:e=>qLt[e]||-1},{term:343,get:e=>WLt[e]||-1},{term:95,get:e=>KLt[e]||-1}],tokenPrec:15201});class lW{constructor(t,n,i,r){this.state=t,this.pos=n,this.explicit=i,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let n=Yr(this.state).resolveInner(this.pos,-1);for(;n&&t.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(t){let n=this.state.doc.lineAt(this.pos),i=Math.max(n.from,this.pos-250),r=n.text.slice(i-n.from,this.pos-n.from),s=r.search(z4e(t,!1));return s<0?null:{from:i+s,to:this.pos,text:r.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(t,n,i){t=="abort"&&this.abortListeners&&(this.abortListeners.push(n),i&&i.onDocChange&&(this.abortOnDocChange=!0))}}function Dre(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function XLt(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let s=1;stypeof r=="string"?{label:r}:r),[n,i]=t.every(r=>/^\w+$/.test(r.label))?[/\w*$/,/\w+$/]:XLt(t);return r=>{let s=r.matchBefore(i);return s||r.explicit?{from:s?s.from:r.pos,options:t,validFor:n}:null}}function Q4e(e,t){return n=>{for(let i=Yr(n.state).resolveInner(n.pos,-1);i;i=i.parent){if(e.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return t(n)}}class Mre{constructor(t,n,i,r){this.completion=t,this.source=n,this.match=i,this.score=r}}function e0(e){return e.selection.main.from}function z4e(e,t){var n;let{source:i}=e,r=t&&i[0]!="^",s=i[i.length-1]!="$";return!r&&!s?e:new RegExp(`${r?"^":""}(?:${i})${s?"$":""}`,(n=e.flags)!==null&&n!==void 0?n:e.ignoreCase?"i":"")}const uW=Ih.define();function YLt(e,t,n,i){let{main:r}=e.selection,s=n-r.from,o=i-r.from;return{...e.changeByRange(l=>{if(l!=r&&n!=i&&e.sliceDoc(l.from+s,l.from+o)!=e.sliceDoc(n,i))return{range:l};let c=e.toText(t);return{changes:{from:l.from+s,to:i==r.from?l.to:l.from+o,insert:c},range:ht.cursor(l.from+s+c.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const Lre=new WeakMap;function ZLt(e){if(!Array.isArray(e))return e;let t=Lre.get(e);return t||Lre.set(e,t=cW(e)),t}const rP=pi.define(),HC=pi.define();class JLt{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n=48&&k<=57||k>=97&&k<=122?2:k>=65&&k<=90?1:0:(S=Lq(k))!=S.toLowerCase()?1:S!=S.toUpperCase()?2:0;(!w||C==1&&v||O==0&&C!=0)&&(n[f]==k||i[f]==k&&(h=!0)?o[f++]=w:o.length&&(y=!1)),O=C,w+=th(k)}return f==c&&o[0]==0&&y?this.result(-100+(h?-200:0),o,t):m==c&&g==0?this.ret(-200-t.length+(b==t.length?0:-100),[0,b]):l>-1?this.ret(-700-t.length,[l,l+this.pattern.length]):m==c?this.ret(-900-t.length,[g,b]):f==c?this.result(-100+(h?-200:0)+-700+(y?0:-1100),o,t):n.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,t)}result(t,n,i){let r=[],s=0;for(let o of n){let l=o+(this.astral?th(Nc(i,o)):1);s&&r[s-1]==o?r[s-1]=l:(r[s++]=o,r[s++]=l)}return this.ret(t-i.length,r)}}class e5t{constructor(t){this.pattern=t,this.matched=[],this.score=0,this.folded=t.toLowerCase()}match(t){if(t.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:t5t,filterStrict:!1,compareCompletions:(t,n)=>(t.sortText||t.label).localeCompare(n.sortText||n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(t,n)=>t&&n,closeOnBlur:(t,n)=>t&&n,icons:(t,n)=>t&&n,tooltipClass:(t,n)=>i=>$re(t(i),n(i)),optionClass:(t,n)=>i=>$re(t(i),n(i)),addToOptions:(t,n)=>t.concat(n),filterStrict:(t,n)=>t||n})}});function $re(e,t){return e?t?e+" "+t:e:t}function t5t(e,t,n,i,r,s){let o=e.textDirection==os.RTL,l=o,c=!1,u="top",d,f,h=t.left-r.left,m=r.right-t.right,g=i.right-i.left,b=i.bottom-i.top;if(l&&h=b||w>t.top?d=n.bottom-t.top:(u="bottom",d=t.bottom-n.top)}let v=(t.bottom-t.top)/s.offsetHeight,y=(t.right-t.left)/s.offsetWidth;return{style:`${u}: ${d/v}px; max-width: ${f/y}px`,class:"cm-completionInfo-"+(c?o?"left-narrow":"right-narrow":l?"left":"right")}}const dW=pi.define();function n5t(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(n){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),n.type&&i.classList.add(...n.type.split(/\s+/g).map(r=>"cm-completionIcon-"+r)),i.setAttribute("aria-hidden","true"),i},position:20}),t.push({render(n,i,r,s){let o=document.createElement("span");o.className="cm-completionLabel";let l=n.displayLabel||n.label,c=0;for(let u=0;uc&&o.appendChild(document.createTextNode(l.slice(c,d)));let h=o.appendChild(document.createElement("span"));h.appendChild(document.createTextNode(l.slice(d,f))),h.className="cm-completionMatchedText",c=f}return cn.position-i.position).map(n=>n.render)}function y$(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let r=Math.floor(t/n);return{from:r*n,to:(r+1)*n}}let i=Math.ceil((e-t)/n);return{from:e-i*n,to:e-(i-1)*n}}class i5t{constructor(t,n,i){this.view=t,this.stateField=n,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:c=>this.placeInfo(c),key:this},this.space=null,this.currentClass="";let r=t.state.field(n),{options:s,selected:o}=r.open,l=t.state.facet(jo);this.optionContent=n5t(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=y$(s.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",c=>{let{options:u}=t.state.field(n).open;for(let d=c.target,f;d&&d!=this.dom;d=d.parentNode)if(d.nodeName=="LI"&&(f=/-(\d+)$/.exec(d.id))&&+f[1]this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;d!=null&&(t.dispatch({effects:dW.of(d)}),c.preventDefault())}}),this.dom.addEventListener("focusout",c=>{let u=t.state.field(this.stateField,!1);u&&u.tooltip&&t.state.facet(jo).closeOnBlur&&c.relatedTarget!=t.contentDOM&&t.dispatch({effects:HC.of(null)})}),this.showOptions(s,r.id)}mount(){this.updateSel()}showOptions(t,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(t){var n;let i=t.state.field(this.stateField),r=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),i!=r){let{options:s,selected:o,disabled:l}=i.open;(!r.open||r.open.options!=s)&&(this.range=y$(s.length,o,t.state.facet(jo).maxRenderedOptions),this.showOptions(s,i.id)),this.updateSel(),l!=((n=r.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(t){let n=this.tooltipClass(t);if(n!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of n.split(" "))i&&this.dom.classList.add(i);this.currentClass=n}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),n=t.open;(n.selected>-1&&n.selected=this.range.to)&&(this.range=y$(n.options.length,n.selected,this.view.state.facet(jo).maxRenderedOptions),this.showOptions(n.options,t.id));let i=this.updateSelectedOption(n.selected);if(i){this.destroyInfo();let{completion:r}=n.options[n.selected],{info:s}=r;if(!s)return;let o=typeof s=="string"?document.createTextNode(s):s(r);if(!o)return;"then"in o?o.then(l=>{l&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(l,r)}).catch(l=>Mc(this.view.state,l,"completion info")):(this.addInfoPane(o,r),i.setAttribute("aria-describedby",this.info.id))}}addInfoPane(t,n){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",i.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),t.nodeType!=null)i.appendChild(t),this.infoDestroy=null;else{let{dom:r,destroy:s}=t;i.appendChild(r),this.infoDestroy=s||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){let n=null;for(let i=this.list.firstChild,r=this.range.from;i;i=i.nextSibling,r++)i.nodeName!="LI"||!i.id?r--:r==t?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),n=i):i.hasAttribute("aria-selected")&&(i.removeAttribute("aria-selected"),i.removeAttribute("aria-describedby"));return n&&s5t(this.list,n),n}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let n=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),r=t.getBoundingClientRect(),s=this.space;if(!s){let o=this.dom.ownerDocument.documentElement;s={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return r.top>Math.min(s.bottom,n.bottom)-10||r.bottom{o.target==r&&o.preventDefault()});let s=null;for(let o=i.from;oi.from||i.from==0))if(s=h,typeof u!="string"&&u.header)r.appendChild(u.header(u));else{let m=r.appendChild(document.createElement("completion-section"));m.textContent=h}}const d=r.appendChild(document.createElement("li"));d.id=n+"-"+o,d.setAttribute("role","option");let f=this.optionClass(l);f&&(d.className=f);for(let h of this.optionContent){let m=h(l,this.view.state,this.view,c);m&&d.appendChild(m)}}return i.from&&r.classList.add("cm-completionListIncompleteTop"),i.tonew i5t(n,e,t)}function s5t(e,t){let n=e.getBoundingClientRect(),i=t.getBoundingClientRect(),r=n.height/e.offsetHeight;i.topn.bottom&&(e.scrollTop+=(i.bottom-n.bottom)/r)}function Fre(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}function a5t(e,t){let n=[],i=null,r=null,s=d=>{n.push(d);let{section:f}=d.completion;if(f){i||(i=[]);let h=typeof f=="string"?f:f.name;i.some(m=>m.name==h)||i.push(typeof f=="string"?{name:h}:f)}},o=t.facet(jo);for(let d of e)if(d.hasResult()){let f=d.result.getMatch;if(d.result.filter===!1)for(let h of d.result.options)s(new Mre(h,d.source,f?f(h):[],1e9-n.length));else{let h=t.sliceDoc(d.from,d.to),m,g=o.filterStrict?new e5t(h):new JLt(h);for(let b of d.result.options)if(m=g.match(b.label)){let v=b.displayLabel?f?f(b,m.matched):[]:m.matched,y=m.score+(b.boost||0);if(s(new Mre(b,d.source,v,y)),typeof b.section=="object"&&b.section.rank==="dynamic"){let{name:w}=b.section;r||(r=Object.create(null)),r[w]=Math.max(y,r[w]||-1e9)}}}}if(i){let d=Object.create(null),f=0,h=(m,g)=>(m.rank==="dynamic"&&g.rank==="dynamic"?r[g.name]-r[m.name]:0)||(typeof m.rank=="number"?m.rank:1e9)-(typeof g.rank=="number"?g.rank:1e9)||(m.nameh.score-f.score||u(f.completion,h.completion))){let f=d.completion;!c||c.label!=f.label||c.detail!=f.detail||c.type!=null&&f.type!=null&&c.type!=f.type||c.apply!=f.apply||c.boost!=f.boost?l.push(d):Fre(d.completion)>Fre(c)&&(l[l.length-1]=d),c=d.completion}return l}class Qx{constructor(t,n,i,r,s,o){this.options=t,this.attrs=n,this.tooltip=i,this.timestamp=r,this.selected=s,this.disabled=o}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new Qx(this.options,Bre(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,i,r,s,o){if(r&&!o&&t.some(u=>u.isPending))return r.setDisabled();let l=a5t(t,n);if(!l.length)return r&&t.some(u=>u.isPending)?r.setDisabled():null;let c=n.facet(jo).selectOnOpen?0:-1;if(r&&r.selected!=c&&r.selected!=-1){let u=r.options[r.selected].completion;for(let d=0;dd.hasResult()?Math.min(u,d.from):u,1e8),create:f5t,above:s.aboveCursor},r?r.timestamp:Date.now(),c,!1)}map(t){return new Qx(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new Qx(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class sP{constructor(t,n,i){this.active=t,this.id=n,this.open=i}static start(){return new sP(u5t,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,i=n.facet(jo),s=(i.override||n.languageDataAt("autocomplete",e0(n)).map(ZLt)).map(c=>(this.active.find(d=>d.source==c)||new bd(c,this.active.some(d=>d.state!=0)?1:0)).update(t,i));s.length==this.active.length&&s.every((c,u)=>c==this.active[u])&&(s=this.active);let o=this.open,l=t.effects.some(c=>c.is(fW));o&&t.docChanged&&(o=o.map(t.changes)),t.selection||s.some(c=>c.hasResult()&&t.changes.touchesRange(c.from,c.to))||!o5t(s,this.active)||l?o=Qx.build(s,n,this.id,o,i,l):o&&o.disabled&&!s.some(c=>c.isPending)&&(o=null),!o&&s.every(c=>!c.isPending)&&s.some(c=>c.hasResult())&&(s=s.map(c=>c.hasResult()?new bd(c.source,0):c));for(let c of t.effects)c.is(dW)&&(o=o&&o.setSelected(c.value,this.id));return s==this.active&&o==this.open?this:new sP(s,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?l5t:c5t}}function o5t(e,t){if(e==t)return!0;for(let n=0,i=0;;){for(;n-1&&(n["aria-activedescendant"]=e+"-"+t),n}const u5t=[];function V4e(e,t){if(e.isUserEvent("input.complete")){let i=e.annotation(uW);if(i&&t.activateOnCompletion(i))return 12}let n=e.isUserEvent("input.type");return n&&t.activateOnTyping?5:n?1:e.isUserEvent("delete.backward")?2:e.selection?8:e.docChanged?16:0}class bd{constructor(t,n,i=!1){this.source=t,this.state=n,this.explicit=i}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let i=V4e(t,n),r=this;(i&8||i&16&&this.touches(t))&&(r=new bd(r.source,0)),i&4&&r.state==0&&(r=new bd(this.source,1)),r=r.updateFor(t,i);for(let s of t.effects)if(s.is(rP))r=new bd(r.source,1,s.value);else if(s.is(HC))r=new bd(r.source,0);else if(s.is(fW))for(let o of s.value)o.source==r.source&&(r=o);return r}updateFor(t,n){return this.map(t.changes)}map(t){return this}touches(t){return t.changes.touchesRange(e0(t.state))}}class Sw extends bd{constructor(t,n,i,r,s,o){super(t,3,n),this.limit=i,this.result=r,this.from=s,this.to=o}hasResult(){return!0}updateFor(t,n){var i;if(!(n&3))return this.map(t.changes);let r=this.result;r.map&&!t.changes.empty&&(r=r.map(r,t.changes));let s=t.changes.mapPos(this.from),o=t.changes.mapPos(this.to,1),l=e0(t.state);if(l>o||!r||n&2&&(e0(t.startState)==this.from||ln.map(t))}}),Rc=dl.define({create(){return sP.start()},update(e,t){return e.update(t)},provide:e=>[eW.from(e,t=>t.tooltip),Jt.contentAttributes.from(e,t=>t.attrs)]});function hW(e,t){const n=t.completion.apply||t.completion.label;let i=e.state.field(Rc).active.find(r=>r.source==t.source);return i instanceof Sw?(typeof n=="string"?e.dispatch({...YLt(e.state,n,i.from,i.to),annotations:uW.of(t.completion)}):n(e,t.completion,i.from,i.to),!0):!1}const f5t=r5t(Rc,hW);function rj(e,t="option"){return n=>{let i=n.state.field(Rc,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp-1?i.open.selected+r*(e?1:-1):e?0:o-1;return l<0?l=t=="page"?0:o-1:l>=o&&(l=t=="page"?o-1:0),n.dispatch({effects:dW.of(l)}),!0}}const h5t=e=>{let t=e.state.field(Rc,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestampe.state.field(Rc,!1)?(e.dispatch({effects:rP.of(!0)}),!0):!1,p5t=e=>{let t=e.state.field(Rc,!1);return!t||!t.active.some(n=>n.state!=0)?!1:(e.dispatch({effects:HC.of(null)}),!0)};class m5t{constructor(t,n){this.active=t,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const g5t=50,b5t=1e3,y5t=ma.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(Rc).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(Rc),n=e.state.facet(jo);if(!e.selectionSet&&!e.docChanged&&e.startState.field(Rc)==t)return;let i=e.transactions.some(s=>{let o=V4e(s,n);return o&8||(s.selection||s.docChanged)&&!(o&3)});for(let s=0;sg5t&&Date.now()-o.time>b5t){for(let l of o.context.abortListeners)try{l()}catch(c){Mc(this.view.state,c)}o.context.abortListeners=null,this.running.splice(s--,1)}else o.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(s=>s.effects.some(o=>o.is(rP)))&&(this.pendingStart=!0);let r=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(s=>s.isPending&&!this.running.some(o=>o.active.source==s.source))?setTimeout(()=>this.startUpdate(),r):-1,this.composing!=0)for(let s of e.transactions)s.isUserEvent("input.type")?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(Rc);for(let n of t.active)n.isPending&&!this.running.some(i=>i.active.source==n.source)&&this.startQuery(n);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(jo).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=e0(t),i=new lW(t,n,e.explicit,this.view),r=new m5t(e,i);this.running.push(r),Promise.resolve(e.source(i)).then(s=>{r.context.aborted||(r.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:HC.of(null)}),Mc(this.view.state,s)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(jo).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(jo),i=this.view.state.field(Rc);for(let r=0;rl.source==s.active.source);if(o&&o.isPending)if(s.done==null){let l=new bd(s.active.source,0);for(let c of s.updates)l=l.update(c,n);l.isPending||t.push(l)}else this.startQuery(o)}(t.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:fW.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(Rc,!1);if(t&&t.tooltip&&this.view.state.facet(jo).closeOnBlur){let n=t.open&&l4e(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:HC.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:rP.of(!1)}),20),this.composing=0}}}),v5t=typeof navigator=="object"&&/Win/.test(navigator.platform),x5t=bm.highest(Jt.domEventHandlers({keydown(e,t){let n=t.state.field(Rc,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(v5t&&e.altKey)||e.metaKey)return!1;let i=n.open.options[n.open.selected],r=n.active.find(o=>o.source==i.source),s=i.completion.commitCharacters||r.result.commitCharacters;return s&&s.indexOf(e.key)>-1&&hW(t,i),!1}})),H4e=Jt.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class w5t{constructor(t,n,i,r){this.field=t,this.line=n,this.from=i,this.to=r}}class pW{constructor(t,n,i){this.field=t,this.from=n,this.to=i}map(t){let n=t.mapPos(this.from,-1,il.TrackDel),i=t.mapPos(this.to,1,il.TrackDel);return n==null||i==null?null:new pW(this.field,n,i)}}class mW{constructor(t,n){this.lines=t,this.fieldPositions=n}instantiate(t,n){let i=[],r=[n],s=t.doc.lineAt(n),o=/^\s*/.exec(s.text)[0];for(let c of this.lines){if(i.length){let u=o,d=/^\t*/.exec(c)[0].length;for(let f=0;fnew pW(c.field,r[c.line]+c.from,r[c.line]+c.to));return{text:i,ranges:l}}static parse(t){let n=[],i=[],r=[],s;for(let o of t.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(o);){let l=s[1]?+s[1]:null,c=s[2]||s[3]||"",u=-1;l===0&&(l=1e9);let d=c.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f=u&&h.field++}for(let f of r)if(f.line==i.length&&f.from>s.index){let h=s[2]?3+(s[1]||"").length:2;f.from-=h,f.to-=h}r.push(new w5t(u,i.length,s.index,s.index+d.length)),o=o.slice(0,s.index)+c+o.slice(s.index+s[0].length)}o=o.replace(/\\([{}])/g,(l,c,u)=>{for(let d of r)d.line==i.length&&d.from>u&&(d.from--,d.to--);return c}),i.push(o)}return new mW(i,r)}}let O5t=Fn.widget({widget:new class extends Nf{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),k5t=Fn.mark({class:"cm-snippetField"});class gO{constructor(t,n){this.ranges=t,this.active=n,this.deco=Fn.set(t.map(i=>(i.from==i.to?O5t:k5t).range(i.from,i.to)),!0)}map(t){let n=[];for(let i of this.ranges){let r=i.map(t);if(!r)return null;n.push(r)}return new gO(n,this.active)}selectionInsideField(t){return t.ranges.every(n=>this.ranges.some(i=>i.field==this.active&&i.from<=n.from&&i.to>=n.to))}}const PT=pi.define({map(e,t){return e&&e.map(t)}}),S5t=pi.define(),qC=dl.define({create(){return null},update(e,t){for(let n of t.effects){if(n.is(PT))return n.value;if(n.is(S5t)&&e)return new gO(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>Jt.decorations.from(e,t=>t?t.deco:Fn.none)});function gW(e,t){return ht.create(e.filter(n=>n.field==t).map(n=>ht.range(n.from,n.to)))}function E5t(e){let t=mW.parse(e);return(n,i,r,s)=>{let{text:o,ranges:l}=t.instantiate(n.state,r),{main:c}=n.state.selection,u={changes:{from:r,to:s==c.from?c.to:s,insert:xr.of(o)},scrollIntoView:!0,annotations:i?[uW.of(i),Xa.userEvent.of("input.complete")]:void 0};if(l.length&&(u.selection=gW(l,0)),l.some(d=>d.field>0)){let d=new gO(l,0),f=u.effects=[PT.of(d)];n.state.field(qC,!1)===void 0&&f.push(pi.appendConfig.of([qC,j5t,N5t,H4e]))}n.dispatch(n.state.update(u))}}function q4e(e){return({state:t,dispatch:n})=>{let i=t.field(qC,!1);if(!i||e<0&&i.active==0)return!1;let r=i.active+e,s=e>0&&!i.ranges.some(o=>o.field==r+e);return n(t.update({selection:gW(i.ranges,r),effects:PT.of(s?null:new gO(i.ranges,r)),scrollIntoView:!0})),!0}}const C5t=({state:e,dispatch:t})=>e.field(qC,!1)?(t(e.update({effects:PT.of(null)})),!0):!1,A5t=q4e(1),T5t=q4e(-1),_5t=[{key:"Tab",run:A5t,shift:T5t},{key:"Escape",run:C5t}],Ure=mn.define({combine(e){return e.length?e[0]:_5t}}),j5t=bm.highest(pO.compute([Ure],e=>e.facet(Ure)));function Ys(e,t){return{...t,apply:E5t(e)}}const N5t=Jt.domEventHandlers({mousedown(e,t){let n=t.state.field(qC,!1),i;if(!n||(i=t.posAtCoords({x:e.clientX,y:e.clientY}))==null)return!1;let r=n.ranges.find(s=>s.from<=i&&s.to>=i);return!r||r.field==n.active?!1:(t.dispatch({selection:gW(n.ranges,r.field),effects:PT.of(n.ranges.some(s=>s.field>r.field)?new gO(n.ranges,r.field):null),scrollIntoView:!0}),!0)}}),WC={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},My=pi.define({map(e,t){let n=t.mapPos(e,-1,il.TrackAfter);return n??void 0}}),bW=new class extends hb{};bW.startSide=1;bW.endSide=-1;const W4e=dl.define({create(){return Ki.empty},update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:i=>i>=n.from&&i<=n.to})}for(let n of t.effects)n.is(My)&&(e=e.update({add:[bW.range(n.value,n.value+1)]}));return e}});function R5t(){return[P5t,W4e]}const x$="()[]{}<>«»»«[]{}";function K4e(e){for(let t=0;t{if((I5t?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let r=e.state.selection.main;if(i.length>2||i.length==2&&th(Nc(i,0))==1||t!=r.from||n!=r.to)return!1;let s=L5t(e.state,i);return s?(e.dispatch(s),!0):!1}),D5t=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=G4e(e,e.selection.main.head).brackets||WC.brackets,r=null,s=e.changeByRange(o=>{if(o.empty){let l=$5t(e.doc,o.head);for(let c of i)if(c==l&&sL(e.doc,o.head)==K4e(Nc(c,0)))return{changes:{from:o.head-c.length,to:o.head+c.length},range:ht.cursor(o.head-c.length)}}return{range:r=o}});return r||t(e.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!r},M5t=[{key:"Backspace",run:D5t}];function L5t(e,t){let n=G4e(e,e.selection.main.head),i=n.brackets||WC.brackets;for(let r of i){let s=K4e(Nc(r,0));if(t==r)return s==r?U5t(e,r,i.indexOf(r+r+r)>-1,n):F5t(e,r,s,n.before||WC.before);if(t==s&&X4e(e,e.selection.main.from))return B5t(e,r,s)}return null}function X4e(e,t){let n=!1;return e.field(W4e).between(0,e.doc.length,i=>{i==t&&(n=!0)}),n}function sL(e,t){let n=e.sliceString(t,t+2);return n.slice(0,th(Nc(n,0)))}function $5t(e,t){let n=e.sliceString(t-2,t);return th(Nc(n,0))==n.length?n:n.slice(1)}function F5t(e,t,n,i){let r=null,s=e.changeByRange(o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:n,from:o.to}],effects:My.of(o.to+t.length),range:ht.range(o.anchor+t.length,o.head+t.length)};let l=sL(e.doc,o.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:t+n,from:o.head},effects:My.of(o.head+t.length),range:ht.cursor(o.head+t.length)}:{range:r=o}});return r?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function B5t(e,t,n){let i=null,r=e.changeByRange(s=>s.empty&&sL(e.doc,s.head)==n?{changes:{from:s.head,to:s.head+n.length,insert:n},range:ht.cursor(s.head+n.length)}:i={range:s});return i?null:e.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function U5t(e,t,n,i){let r=i.stringPrefixes||WC.stringPrefixes,s=null,o=e.changeByRange(l=>{if(!l.empty)return{changes:[{insert:t,from:l.from},{insert:t,from:l.to}],effects:My.of(l.to+t.length),range:ht.range(l.anchor+t.length,l.head+t.length)};let c=l.head,u=sL(e.doc,c),d;if(u==t){if(Qre(e,c))return{changes:{insert:t+t,from:c},effects:My.of(c+t.length),range:ht.cursor(c+t.length)};if(X4e(e,c)){let h=n&&e.sliceDoc(c,c+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:c,to:c+h.length,insert:h},range:ht.cursor(c+h.length)}}}else{if(n&&e.sliceDoc(c-2*t.length,c)==t+t&&(d=zre(e,c-2*t.length,r))>-1&&Qre(e,d))return{changes:{insert:t+t+t+t,from:c},effects:My.of(c+t.length),range:ht.cursor(c+t.length)};if(e.charCategorizer(c)(u)!=Qs.Word&&zre(e,c,r)>-1&&!Q5t(e,c,t,r))return{changes:{insert:t+t,from:c},effects:My.of(c+t.length),range:ht.cursor(c+t.length)}}return{range:s=l}});return s?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function Qre(e,t){let n=Yr(e).resolveInner(t+1);return n.parent&&n.from==t}function Q5t(e,t,n,i){let r=Yr(e).resolveInner(t,-1),s=i.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=e.sliceDoc(r.from,Math.min(r.to,r.from+n.length+s)),c=l.indexOf(n);if(!c||c>-1&&i.indexOf(l.slice(0,c))>-1){let d=r.firstChild;for(;d&&d.from==r.from&&d.to-d.from>n.length+c;){if(e.sliceDoc(d.to-n.length,d.to)==n)return!1;d=d.firstChild}return!0}let u=r.to==t&&r.parent;if(!u)break;r=u}return!1}function zre(e,t,n){let i=e.charCategorizer(t);if(i(e.sliceDoc(t-1,t))!=Qs.Word)return t;for(let r of n){let s=t-r.length;if(e.sliceDoc(s,t)==r&&i(e.sliceDoc(s-1,s))!=Qs.Word)return s}return-1}function z5t(e={}){return[x5t,Rc,jo.of(e),y5t,V5t,H4e]}const Y4e=[{key:"Ctrl-Space",run:v$},{mac:"Alt-`",run:v$},{mac:"Alt-i",run:v$},{key:"Escape",run:p5t},{key:"ArrowDown",run:rj(!0)},{key:"ArrowUp",run:rj(!1)},{key:"PageDown",run:rj(!0,"page")},{key:"PageUp",run:rj(!1,"page")},{key:"Enter",run:h5t}],V5t=bm.highest(pO.computeN([jo],e=>e.facet(jo).defaultKeymap?[Y4e]:[])),Z4e=[Ys("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Ys("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Ys("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Ys("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Ys("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Ys(`try { \${} } catch (\${error}) { \${} @@ -754,42 +754,42 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus constructor(\${params}) { \${} } -}`,{label:"class",detail:"definition",type:"keyword"}),Ys('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Ys('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],z5t=Y4e.concat([Ys("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Ys("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Ys("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),zre=new Dq,Z4e=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Ck(e){return(t,n)=>{let i=t.node.getChild("VariableDefinition");return i&&n(i,e),!0}}const V5t=["FunctionDeclaration"],H5t={FunctionDeclaration:Ck("function"),ClassDeclaration:Ck("class"),ClassExpression:()=>!0,EnumDeclaration:Ck("constant"),TypeAliasDeclaration:Ck("type"),NamespaceDeclaration:Ck("namespace"),VariableDefinition(e,t){e.matchContext(V5t)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function J4e(e,t){let n=zre.get(t);if(n)return n;let i=[],r=!0;function s(o,l){let c=e.sliceString(o.from,o.to);i.push({label:c,type:l})}return t.cursor(Sr.IncludeAnonymous).iterate(o=>{if(r)r=!1;else if(o.name){let l=H5t[o.name];if(l&&l(o,s)||Z4e.has(o.name))return!1}else if(o.to-o.from>8192){for(let l of J4e(e,o.node))i.push(l);return!1}}),zre.set(t,i),i}const Vre=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,e$e=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function q5t(e){let t=Yr(e.state).resolveInner(e.pos,-1);if(e$e.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&Vre.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let i=[];for(let r=t;r;r=r.parent)Z4e.has(r.name)&&(i=i.concat(J4e(e.state.doc,r)));return{options:i,from:n?t.from:e.pos,validFor:Vre}}const yh=rm.define({name:"javascript",parser:WLt.configure({props:[ym.add({IfStatement:ww({except:/^\s*({|else\b)/}),TryStatement:ww({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:TMt,SwitchBody:e=>{let t=e.textAfter,n=/^\s*\}/.test(t),i=/^\s*(case|default)\b/.test(t);return e.baseIndent+(n?0:i?1:2)*e.unit},Block:xw({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":ww({except:/^\s*{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),vm.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":jT,BlockComment(e){return{from:e.from+2,to:e.to-2}},JSXElement(e){let t=e.firstChild;if(!t||t.name=="JSXSelfClosingTag")return null;let n=e.lastChild;return{from:t.to,to:n.type.isError?e.to:n.from}},"JSXSelfClosingTag JSXOpenTag"(e){var t;let n=(t=e.firstChild)===null||t===void 0?void 0:t.nextSibling,i=e.lastChild;return!n||n.type.isError?null:{from:n.to,to:i.type.isError?e.to:i.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),t$e={test:e=>/^JSX/.test(e.name),facet:tL({commentTokens:{block:{open:"{/*",close:"*/}"}}})},n$e=yh.configure({dialect:"ts"},"typescript"),i$e=yh.configure({dialect:"jsx",props:[tW.add(e=>e.isTop?[t$e]:void 0)]}),r$e=yh.configure({dialect:"jsx ts",props:[tW.add(e=>e.isTop?[t$e]:void 0)]},"typescript");let s$e=e=>({label:e,type:"keyword"});const a$e="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(s$e),W5t=a$e.concat(["declare","implements","private","protected","public"].map(s$e));function o7(e={}){let t=e.jsx?e.typescript?r$e:i$e:e.typescript?n$e:yh,n=e.typescript?z5t.concat(W5t):Y4e.concat(a$e);return new bb(t,[yh.data.of({autocomplete:U4e(e$e,lW(n))}),yh.data.of({autocomplete:q5t}),e.jsx?X5t:[]])}function K5t(e){for(;;){if(e.name=="JSXOpenTag"||e.name=="JSXSelfClosingTag"||e.name=="JSXFragmentTag")return e;if(e.name=="JSXEscape"||!e.parent)return null;e=e.parent}}function Hre(e,t,n=e.length){for(let i=t==null?void 0:t.firstChild;i;i=i.nextSibling)if(i.name=="JSXIdentifier"||i.name=="JSXBuiltin"||i.name=="JSXNamespacedName"||i.name=="JSXMemberExpression")return e.sliceString(i.from,Math.min(i.to,n));return""}const G5t=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),X5t=Jt.inputHandler.of((e,t,n,i,r)=>{if((G5t?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||i!=">"&&i!="/"||!yh.isActiveAt(e.state,t,-1))return!1;let s=r(),{state:o}=s,l=o.changeByRange(c=>{var u;let{head:d}=c,f=Yr(o).resolveInner(d-1,-1),h;if(f.name=="JSXStartTag"&&(f=f.parent),!(o.doc.sliceString(d-1,d)!=i||f.name=="JSXAttributeValue"&&f.to>d)){if(i==">"&&f.name=="JSXFragmentTag")return{range:c,changes:{from:d,insert:""}};if(i=="/"&&f.name=="JSXStartCloseTag"){let m=f.parent,g=m.parent;if(g&&m.from==d-2&&((h=Hre(o.doc,g.firstChild,d))||((u=g.firstChild)===null||u===void 0?void 0:u.name)=="JSXFragmentTag")){let b=`${h}>`;return{range:ht.cursor(d+b.length,-1),changes:{from:d,insert:b}}}}else if(i==">"){let m=K5t(f);if(m&&m.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(o.doc.sliceString(d,d+2))&&(h=Hre(o.doc,m,d)))return{range:c,changes:{from:d,insert:``}}}}return{range:c}});return l.changes.empty?!1:(e.dispatch([s,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Y5t=bm({String:fe.string,Number:fe.number,"True False":fe.bool,PropertyName:fe.propertyName,Null:fe.null,", :":fe.separator,"[ ]":fe.squareBracket,"{ }":fe.brace}),Z5t=sm.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[Y5t],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),J5t=rm.define({name:"json",parser:Z5t.configure({props:[ym.add({Object:ww({except:/^\s*\}/}),Array:ww({except:/^\s*\]/})}),vm.add({"Object Array":jT})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function e3t(){return new bb(J5t)}class aP{static create(t,n,i,r,s){let o=r+(r<<8)+t+(n<<4)|0;return new aP(t,n,i,o,s,[],[])}constructor(t,n,i,r,s,o,l){this.type=t,this.value=n,this.from=i,this.hash=r,this.end=s,this.children=o,this.positions=l,this.hashProp=[[ui.contextHash,r]]}addChild(t,n){t.prop(ui.contextHash)!=this.hash&&(t=new Bi(t.type,t.children,t.positions,t.length,this.hashProp)),this.children.push(t),this.positions.push(n)}toTree(t,n=this.end){let i=this.children.length-1;return i>=0&&(n=Math.max(n,this.positions[i]+this.children[i].length+this.from)),new Bi(t.types[this.type],this.children,this.positions,n-this.from).balance({makeTree:(r,s,o)=>new Bi(Za.none,r,s,o,this.hashProp)})}}var qt;(function(e){e[e.Document=1]="Document",e[e.CodeBlock=2]="CodeBlock",e[e.FencedCode=3]="FencedCode",e[e.Blockquote=4]="Blockquote",e[e.HorizontalRule=5]="HorizontalRule",e[e.BulletList=6]="BulletList",e[e.OrderedList=7]="OrderedList",e[e.ListItem=8]="ListItem",e[e.ATXHeading1=9]="ATXHeading1",e[e.ATXHeading2=10]="ATXHeading2",e[e.ATXHeading3=11]="ATXHeading3",e[e.ATXHeading4=12]="ATXHeading4",e[e.ATXHeading5=13]="ATXHeading5",e[e.ATXHeading6=14]="ATXHeading6",e[e.SetextHeading1=15]="SetextHeading1",e[e.SetextHeading2=16]="SetextHeading2",e[e.HTMLBlock=17]="HTMLBlock",e[e.LinkReference=18]="LinkReference",e[e.Paragraph=19]="Paragraph",e[e.CommentBlock=20]="CommentBlock",e[e.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",e[e.Escape=22]="Escape",e[e.Entity=23]="Entity",e[e.HardBreak=24]="HardBreak",e[e.Emphasis=25]="Emphasis",e[e.StrongEmphasis=26]="StrongEmphasis",e[e.Link=27]="Link",e[e.Image=28]="Image",e[e.InlineCode=29]="InlineCode",e[e.HTMLTag=30]="HTMLTag",e[e.Comment=31]="Comment",e[e.ProcessingInstruction=32]="ProcessingInstruction",e[e.Autolink=33]="Autolink",e[e.HeaderMark=34]="HeaderMark",e[e.QuoteMark=35]="QuoteMark",e[e.ListMark=36]="ListMark",e[e.LinkMark=37]="LinkMark",e[e.EmphasisMark=38]="EmphasisMark",e[e.CodeMark=39]="CodeMark",e[e.CodeText=40]="CodeText",e[e.CodeInfo=41]="CodeInfo",e[e.LinkTitle=42]="LinkTitle",e[e.LinkLabel=43]="LinkLabel",e[e.URL=44]="URL"})(qt||(qt={}));class t3t{constructor(t,n){this.start=t,this.content=n,this.marks=[],this.parsers=[]}}class n3t{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let t=this.skipSpace(this.basePos);this.indent=this.countIndent(t,this.pos,this.indent),this.pos=t,this.next=t==this.text.length?-1:this.text.charCodeAt(t)}skipSpace(t){return EE(this.text,t)}reset(t){for(this.text=t,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(t){this.basePos=t,this.baseIndent=this.countIndent(t,this.pos,this.indent)}moveBaseColumn(t){this.baseIndent=t,this.basePos=this.findColumn(t)}addMarker(t){this.markers.push(t)}countIndent(t,n=0,i=0){for(let r=n;r=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let i=(e.type==qt.OrderedList?vW:yW)(n,t,!1);return i>0&&(e.type!=qt.BulletList||bW(n,t,!1)<0)&&n.text.charCodeAt(n.pos+i-1)==e.value}const o$e={[qt.Blockquote](e,t,n){return n.next!=62?!1:(n.markers.push(ur(qt.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(Rd(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0)},[qt.ListItem](e,t,n){return n.indent-1?!1:(n.moveBaseColumn(n.baseIndent+e.value),!0)},[qt.OrderedList]:qre,[qt.BulletList]:qre,[qt.Document](){return!0}};function Rd(e){return e==32||e==9||e==10||e==13}function EE(e,t=0){for(;tn&&Rd(e.charCodeAt(t-1));)t--;return t}function l$e(e){if(e.next!=96&&e.next!=126)return-1;let t=e.pos+1;for(;t-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf(g$e.SetextHeading)>-1||i<3?-1:1}function u$e(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function yW(e,t,n){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||Rd(e.text.charCodeAt(e.pos+1)))&&(!n||u$e(t,qt.BulletList)||e.skipSpace(e.pos+2)=48&&r<=57;){i++;if(i==e.text.length)return-1;r=e.text.charCodeAt(i)}return i==e.pos||i>e.pos+9||r!=46&&r!=41||ie.pos+1||e.next!=49)?-1:i+1-e.pos}function d$e(e){if(e.next!=35)return-1;let t=e.pos+1;for(;t6?-1:n}function f$e(e){if(e.next!=45&&e.next!=61||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t/,p$e=/\?>/,c7=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/,m$e=/\?>/,u7=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/i.exec(i);if(s)return e.append(ur(qt.Comment,n,n+1+s[0].length));let o=/^\?[^]*?\?>/.exec(i);if(o)return e.append(ur(qt.ProcessingInstruction,n,n+1+o[0].length));let l=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(i);return l?e.append(ur(qt.HTMLTag,n,n+1+l[0].length)):-1},Emphasis(e,t,n){if(t!=95&&t!=42)return-1;let i=n+1;for(;e.char(i)==t;)i++;let r=e.slice(n-1,n),s=e.slice(i,i+1),o=KC.test(r),l=KC.test(s),c=/\s|^$/.test(r),u=/\s|^$/.test(s),d=!u&&(!l||c||o),f=!c&&(!o||u||l),h=d&&(t==42||!f||o),m=f&&(t==42||!d||l);return e.append(new fu(t==95?w$e:O$e,n,i,(h?1:0)|(m?2:0)))},HardBreak(e,t,n){if(t==92&&e.char(n+1)==10)return e.append(ur(qt.HardBreak,n,n+2));if(t==32){let i=n+1;for(;e.char(i)==32;)i++;if(e.char(i)==10&&i>=n+2)return e.append(ur(qt.HardBreak,n,i+1))}return-1},Link(e,t,n){return t==91?e.append(new fu(Oy,n,n+1,1)):-1},Image(e,t,n){return t==33&&e.char(n+1)==91?e.append(new fu(oP,n,n+2,1)):-1},LinkEnd(e,t,n){if(t!=93)return-1;for(let i=e.parts.length-1;i>=0;i--){let r=e.parts[i];if(r instanceof fu&&(r.type==Oy||r.type==oP)){if(!r.side||e.skipSpace(r.to)==n&&!/[(\[]/.test(e.slice(n+1,n+2)))return e.parts[i]=null,-1;let s=e.takeContent(i),o=e.parts[i]=l3t(e,s,r.type==Oy?qt.Link:qt.Image,r.from,n+1);if(r.type==Oy)for(let l=0;lt?ur(qt.URL,t+n,s+n):s==e.length?null:!1}}function S$e(e,t,n){let i=e.charCodeAt(t);if(i!=39&&i!=34&&i!=40)return!1;let r=i==40?41:i;for(let s=t+1,o=!1;s=this.end?-1:this.text.charCodeAt(t-this.offset)}get end(){return this.offset+this.text.length}slice(t,n){return this.text.slice(t-this.offset,n-this.offset)}append(t){return this.parts.push(t),t.to}addDelimiter(t,n,i,r,s){return this.append(new fu(t,n,i,(r?1:0)|(s?2:0)))}get hasOpenLink(){for(let t=this.parts.length-1;t>=0;t--){let n=this.parts[t];if(n instanceof fu&&(n.type==Oy||n.type==oP))return!0}return!1}addElement(t){return this.append(t)}resolveMarkers(t){for(let i=t;i=t;c--){let b=this.parts[c];if(b instanceof fu&&b.side&1&&b.type==r.type&&!(s&&(r.side&1||b.side&2)&&(b.to-b.from+o)%3==0&&((b.to-b.from)%3||o%3))){l=b;break}}if(!l)continue;let u=r.type.resolve,d=[],f=l.from,h=r.to;if(s){let b=Math.min(2,l.to-l.from,o);f=l.to-b,h=r.from+b,u=b==1?"Emphasis":"StrongEmphasis"}l.type.mark&&d.push(this.elt(l.type.mark,f,l.to));for(let b=c+1;b=0;n--){let i=this.parts[n];if(i instanceof fu&&i.type==t&&i.side&1)return n}return null}takeContent(t){let n=this.resolveMarkers(t);return this.parts.length=t,n}getDelimiterAt(t){let n=this.parts[t];return n instanceof fu?n:null}skipSpace(t){return EE(this.text,t-this.offset)+this.offset}elt(t,n,i,r){return typeof t=="string"?ur(this.parser.getNodeType(t),n,i,r):new x$e(t,n)}}xW.linkStart=Oy;xW.imageStart=oP;function d7(e,t){if(!t.length)return e;if(!e.length)return t;let n=e.slice(),i=0;for(let r of t){for(;i(t?t-1:0))return!1;if(this.fragmentEnd<0){let s=this.fragment.to;for(;s>0&&this.input.read(s-1,s)!=` -`;)s--;this.fragmentEnd=s?s-1:0}let i=this.cursor;i||(i=this.cursor=this.fragment.tree.cursor(),i.firstChild());let r=t+this.fragment.offset;for(;i.to<=r;)if(!i.parent())return!1;for(;;){if(i.from>=r)return this.fragment.from<=n;if(!i.childAfter(r))return!1}}matches(t){let n=this.cursor.tree;return n&&n.prop(ui.contextHash)==t}takeNodes(t){let n=this.cursor,i=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),s=t.absoluteLineStart,o=s,l=t.block.children.length,c=o,u=l;for(;;){if(n.to-i>r){if(n.type.isAnonymous&&n.firstChild())continue;break}let d=C$e(n.from-i,t.ranges);if(n.to-i<=t.ranges[t.rangeI].to)t.addNode(n.tree,d);else{let f=new Bi(t.parser.nodeSet.types[qt.Paragraph],[],[],0,t.block.hashProp);t.reusePlaceholders.set(f,n.tree),t.addNode(f,d)}if(n.type.is("Block")&&(c3t.indexOf(n.type.id)<0?(o=n.to-i,l=t.block.children.length):(o=c,l=u),c=n.to-i,u=t.block.children.length),!n.nextSibling())break}for(;t.block.children.length>l;)t.block.children.pop(),t.block.positions.pop();return o-s}}function C$e(e,t){let n=e;for(let i=1;irj[e]),Object.keys(rj).map(e=>g$e[e]),Object.keys(rj),s3t,o$e,Object.keys(w$).map(e=>w$[e]),Object.keys(w$),[]);function h3t(e,t,n){let i=[];for(let r=e.firstChild,s=t;;r=r.nextSibling){let o=r?r.from:n;if(o>s&&i.push({from:s,to:o}),!r)break;s=r.to}return i}function p3t(e){let{codeParser:t,htmlParser:n}=e;return{wrap:U5e((r,s)=>{let o=r.type.id;if(t&&(o==qt.CodeBlock||o==qt.FencedCode)){let l="";if(o==qt.FencedCode){let u=r.node.getChild(qt.CodeInfo);u&&(l=s.read(u.from,u.to))}let c=t(l);if(c)return{parser:c,overlay:u=>u.type.id==qt.CodeText,bracketed:o==qt.FencedCode}}else if(n&&(o==qt.HTMLBlock||o==qt.HTMLTag||o==qt.CommentBlock))return{parser:n,overlay:h3t(r.node,r.from,r.to)};return null})}}const m3t={resolve:"Strikethrough",mark:"StrikethroughMark"},g3t={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":fe.strikethrough}},{name:"StrikethroughMark",style:fe.processingInstruction}],parseInline:[{name:"Strikethrough",parse(e,t,n){if(t!=126||e.char(n+1)!=126||e.char(n+2)==126)return-1;let i=e.slice(n-1,n),r=e.slice(n+2,n+3),s=/\s|^$/.test(i),o=/\s|^$/.test(r),l=KC.test(i),c=KC.test(r);return e.addDelimiter(m3t,n,n+2,!o&&(!c||s||l),!s&&(!l||o||c))},after:"Emphasis"}]};function CE(e,t,n=0,i,r=0){let s=0,o=!0,l=-1,c=-1,u=!1,d=()=>{i.push(e.elt("TableCell",r+l,r+c,e.parser.parseInline(t.slice(l,c),r+l)))};for(let f=n;f-1)&&s++,o=!1,i&&(l>-1&&d(),i.push(e.elt("TableDelimiter",f+r,f+r+1))),l=c=-1):(u||h!=32&&h!=9)&&(l<0&&(l=f),c=f+1),u=!u&&h==92}return l>-1&&(s++,i&&d()),s}function Xre(e,t){for(let n=t;n\s]*\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class Yre{constructor(){this.rows=null}nextLine(t,n,i){if(this.rows==null){this.rows=!1;let r;if((n.next==45||n.next==58||n.next==124)&&A$e.test(r=n.text.slice(n.pos))){let s=[];CE(t,i.content,0,s,i.start)==CE(t,r,0)&&(this.rows=[t.elt("TableHeader",i.start,i.start+i.content.length,s),t.elt("TableDelimiter",t.lineStart+n.pos,t.lineStart+n.text.length)])}}else if(this.rows){let r=[];CE(t,n.text,n.pos,r,t.lineStart),this.rows.push(t.elt("TableRow",t.lineStart+n.pos,t.lineStart+n.text.length,r))}return!1}finish(t,n){return this.rows?(t.addLeafElement(n,t.elt("Table",n.start,n.start+n.content.length,this.rows)),!0):!1}}const b3t={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":fe.heading}},"TableRow",{name:"TableCell",style:fe.content},{name:"TableDelimiter",style:fe.processingInstruction}],parseBlock:[{name:"Table",leaf(e,t){return Xre(t.content,0)?new Yre:null},endLeaf(e,t,n){if(n.parsers.some(r=>r instanceof Yre)||!Xre(t.text,t.basePos))return!1;let i=e.peekLine();return A$e.test(i)&&CE(e,t.text,t.basePos)==CE(e,i,t.basePos)},before:"SetextHeading"}]};class y3t{nextLine(){return!1}finish(t,n){return t.addLeafElement(n,t.elt("Task",n.start,n.start+n.content.length,[t.elt("TaskMarker",n.start,n.start+3),...t.parser.parseInline(n.content.slice(3),n.start+3)])),!0}}const v3t={defineNodes:[{name:"Task",block:!0,style:fe.list},{name:"TaskMarker",style:fe.atom}],parseBlock:[{name:"TaskList",leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name=="ListItem"?new y3t:null},after:"SetextHeading"}]},Zre=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,Jre=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,x3t=/[\w-]+\.[\w-]+($|[/:])/,ese=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,tse=/\/[a-zA-Z\d@.]+/gy;function nse(e,t,n,i){let r=0;for(let s=t;s-1)return-1;let i=t+n[0].length;for(;;){let r=e[i-1],s;if(/[?!.,:*_~]/.test(r)||r==")"&&nse(e,t,i,")")>nse(e,t,i,"("))i--;else if(r==";"&&(s=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,i))))i=t+s.index;else break}return i}function ise(e,t){ese.lastIndex=t;let n=ese.exec(e);if(!n)return-1;let i=n[0][n[0].length-1];return i=="_"||i=="-"?-1:t+n[0].length-(i=="."?1:0)}const O3t={parseInline:[{name:"Autolink",parse(e,t,n){let i=n-e.offset;if(i&&/\w/.test(e.text[i-1]))return-1;Zre.lastIndex=i;let r=Zre.exec(e.text),s=-1;if(!r)return-1;if(r[1]||r[2]){if(s=w3t(e.text,i+r[0].length),s>-1&&e.hasOpenLink){let o=/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(i,s));s=i+o[0].length}}else r[3]?s=ise(e.text,i):(s=ise(e.text,i+r[0].length),s>-1&&r[0]=="xmpp:"&&(tse.lastIndex=s,r=tse.exec(e.text),r&&(s=r.index+r[0].length)));return s<0?-1:(e.addElement(e.elt("URL",n,s+e.offset)),s+e.offset)}}]},k3t=[b3t,v3t,g3t,O3t];function T$e(e,t,n){return(i,r,s)=>{if(r!=e||i.char(s+1)==e)return-1;let o=[i.elt(n,s,s+1)];for(let l=s+1;l=65&&e<=90||e==95||e>=97&&e<=122||e>=161}let ose=null,lse=null,cse=0;function h7(e,t){let n=e.pos+t;if(cse==n&&lse==e)return ose;let i=e.peek(t),r="";for(;X3t(i);)r+=String.fromCharCode(i),i=e.peek(++t);return lse=e,cse=n,ose=r?r.toLowerCase():i==Y3t||i==Z3t?void 0:null}const M$e=60,lP=62,OW=47,Y3t=63,Z3t=33,J3t=45;function use(e,t){this.name=e,this.parent=t}const e4t=[wW,R$e,_$e,j$e,N$e],t4t=new rL({start:null,shift(e,t,n,i){return e4t.indexOf(t)>-1?new use(h7(i,1)||"",e):e},reduce(e,t){return t==I$e&&e?e.parent:e},reuse(e,t,n,i){let r=t.type.id;return r==wW||r==V3t?new use(h7(i,1)||"",e):e},strict:!1}),n4t=new Ia((e,t)=>{if(e.next!=M$e){e.next<0&&t.context&&e.acceptToken(O$);return}e.advance();let n=e.next==OW;n&&e.advance();let i=h7(e,0);if(i===void 0)return;if(!i)return e.acceptToken(n?$3t:L3t);let r=t.context?t.context.name:null;if(n){if(i==r)return e.acceptToken(P3t);if(r&&G3t[r])return e.acceptToken(O$,-2);if(t.dialectEnabled(q3t))return e.acceptToken(D3t);for(let s=t.context;s;s=s.parent)if(s.name==i)return;e.acceptToken(M3t)}else{if(i=="script")return e.acceptToken(_$e);if(i=="style")return e.acceptToken(j$e);if(i=="textarea")return e.acceptToken(N$e);if(K3t.hasOwnProperty(i))return e.acceptToken(R$e);r&&ase[r]&&ase[r][i]?e.acceptToken(O$,-1):e.acceptToken(wW)}},{contextual:!0}),i4t=new Ia(e=>{for(let t=0,n=0;;n++){if(e.next<0){n&&e.acceptToken(sse);break}if(e.next==J3t)t++;else if(e.next==lP&&t>=2){n>=3&&e.acceptToken(sse,-2);break}else t=0;e.advance()}});function r4t(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const s4t=new Ia((e,t)=>{if(e.next==OW&&e.peek(1)==lP){let n=t.dialectEnabled(W3t)||r4t(t.context);e.acceptToken(n?I3t:rse,2)}else e.next==lP&&e.acceptToken(rse,1)});function kW(e,t,n){let i=2+e.length;return new Ia(r=>{for(let s=0,o=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(t);break}if(s==0&&r.next==M$e||s==1&&r.next==OW||s>=2&&so?r.acceptToken(t,-o):r.acceptToken(n,-(o-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(t,1);break}else s=o=0;r.advance()}})}const a4t=kW("script",A3t,T3t),o4t=kW("style",_3t,j3t),l4t=kW("textarea",N3t,R3t),c4t=bm({"Text RawText IncompleteTag IncompleteCloseTag":fe.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":fe.angleBracket,TagName:fe.tagName,"MismatchedCloseTag/TagName":[fe.tagName,fe.invalid],AttributeName:fe.attributeName,"AttributeValue UnquotedAttributeValue":fe.attributeValue,Is:fe.definitionOperator,"EntityReference CharacterReference":fe.character,Comment:fe.blockComment,ProcessingInst:fe.processingInstruction,DoctypeDecl:fe.documentMeta}),u4t=sm.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:",c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:t4t,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[c4t],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let u=l.type.id;if(u==U3t)return k$(l,c,n);if(u==Q3t)return k$(l,c,i);if(u==z3t)return k$(l,c,r);if(u==I$e&&s.length){let d=l.node,f=d.firstChild,h=f&&dse(f,c),m;if(h){for(let g of s)if(g.tag==h&&(!g.attrs||g.attrs(m||(m=L$e(f,c))))){let b=d.lastChild,v=b.type.id==H3t?b.from:d.to;if(v>f.to)return{parser:g.parser,overlay:[{from:f.to,to:v}]}}}}if(o&&u==P$e){let d=l.node,f;if(f=d.firstChild){let h=o[c.read(f.from,f.to)];if(h)for(let m of h){if(m.tagName&&m.tagName!=dse(d.parent,c))continue;let g=d.lastChild;if(g.type.id==f7){let b=g.from+1,v=g.lastChild,y=g.to-(v&&v.isError?0:1);if(y>b)return{parser:m.parser,overlay:[{from:b,to:y}],bracketed:!0}}else if(g.type.id==D$e)return{parser:m.parser,overlay:[{from:g.from,to:g.to}]}}}}return null})}const d4t=145,fse=1,f4t=146,h4t=147,F$e=2,p4t=148,m4t=3,g4t=4,B$e=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],b4t=58,y4t=40,U$e=95,v4t=91,HN=45,x4t=46,w4t=35,O4t=37,k4t=38,S4t=92,E4t=10,C4t=42;function GC(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function SW(e){return e>=48&&e<=57}function hse(e){return SW(e)||e>=97&&e<=102||e>=65&&e<=70}const Q$e=(e,t,n)=>(i,r)=>{for(let s=!1,o=0,l=0;;l++){let{next:c}=i;if(GC(c)||c==HN||c==U$e||s&&SW(c))!s&&(c!=HN||l>0)&&(s=!0),o===l&&c==HN&&o++,i.advance();else if(c==S4t&&i.peek(1)!=E4t){if(i.advance(),hse(i.next)){do i.advance();while(hse(i.next));i.next==32&&i.advance()}else i.next>-1&&i.advance();s=!0}else{s&&i.acceptToken(o==2&&r.canShift(F$e)?t:c==y4t?n:e);break}}},A4t=new Ia(Q$e(f4t,F$e,h4t),{contextual:!0}),T4t=new Ia(Q$e(p4t,m4t,g4t),{contextual:!0}),_4t=new Ia(e=>{if(B$e.includes(e.peek(-1))){let{next:t}=e;(GC(t)||t==U$e||t==w4t||t==x4t||t==C4t||t==v4t||t==b4t&&GC(e.peek(1))||t==HN||t==k4t)&&e.acceptToken(d4t)}}),j4t=new Ia(e=>{if(!B$e.includes(e.peek(-1))){let{next:t}=e;if(t==O4t&&(e.advance(),e.acceptToken(fse)),GC(t)){do e.advance();while(GC(e.next)||SW(e.next));e.acceptToken(fse)}}}),N4t=bm({"AtKeyword import charset namespace keyframes media supports font-feature-values":fe.definitionKeyword,"from to selector scope MatchFlag":fe.keyword,NamespaceName:fe.namespace,KeyframeName:fe.labelName,KeyframeRangeName:fe.operatorKeyword,TagName:fe.tagName,ClassName:fe.className,PseudoClassName:fe.constant(fe.className),IdName:fe.labelName,"FeatureName PropertyName":fe.propertyName,AttributeName:fe.attributeName,NumberLiteral:fe.number,KeywordQuery:fe.keyword,UnaryQueryOp:fe.operatorKeyword,"CallTag ValueName FontName":fe.atom,VariableName:fe.variableName,Callee:fe.operatorKeyword,Unit:fe.unit,"UniversalSelector NestingSelector":fe.definitionOperator,"MatchOp CompareOp":fe.compareOperator,"ChildOp SiblingOp, LogicOp":fe.logicOperator,BinOp:fe.arithmeticOperator,Important:fe.modifier,Comment:fe.blockComment,ColorLiteral:fe.color,"ParenthesizedContent StringLiteral":fe.string,":":fe.punctuation,"PseudoOp #":fe.derefOperator,"; , |":fe.separator,"( )":fe.paren,"[ ]":fe.squareBracket,"{ }":fe.brace}),R4t={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:152,"url-prefix":152,domain:152,regexp:152},I4t={__proto__:null,or:104,and:104,not:112,only:112,layer:206},P4t={__proto__:null,selector:118,style:124,layer:202},D4t={__proto__:null,"@import":198,"@media":210,"@charset":214,"@namespace":218,"@keyframes":224,"@supports":236,"@scope":240,"@font-feature-values":246},M4t={__proto__:null,to:243},L4t=sm.deserialize({version:14,states:"MlQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FnO&XQdO'#CkO&xQaO'#CcO'SQdO'#CnO'_QdO'#EOO'dQdO'#EQO'oQdO'#EXO'oQdO'#E[OOQP'#Fn'#FnO)RQhO'#E}OOQS'#Fm'#FmOOQS'#FQ'#FQQYQdOOO)YQdO'#EbO*iQhO'#EhO)YQdO'#EjO*pQdO'#ElO*{QdO'#EoO)}QhO'#EuO+TQdO'#EwO+`QdO'#EzO+eQaO'#CfO+lQ`O'#E_O+qQ`O'#F{O+|QdO'#F{QOQ`OOP,WO&jO'#CaPOOO)CA])CA]OOQP'#Ci'#CiOOQP,59R,59RO%VQdO,59ROOQP'#Cm'#CmOOQP,59V,59VO&XQdO,59VO,cQdO,59YO'_QdO,5:jO'dQdO,5:lO'oQdO,5:sO'oQdO,5:uO'oQdO,5:vO'oQdO'#FXO,nQ`O,58}O,vQdO'#E^OOQS,58},58}OOQP'#Cq'#CqOOQO'#D|'#D|OOQP,59Y,59YO,}Q`O,59YO-SQ`O,59YOOQP'#EP'#EPOOQP,5:j,5:jO-XQpO'#ERO-dQdO'#ESO-iQ`O'#ESO-nQpO,5:lO.XQaO,5:sO.oQaO,5:vOOQW'#D^'#D^O/nQhO'#DgO0RQhO,5;iO)}QhO'#DeO0`Q`O'#DnO0eQhO'#DxOOQW'#Ft'#FtOOQS,5;i,5;iO0jQ`O'#DhO0oQ`O'#DkOOQS-E9O-E9OOOQ['#Cv'#CvO0tQdO'#CwO1[QdO'#C}O1rQdO'#DQO2YQ!pO'#DSO4fQ!jO,5:|OOQO'#DX'#DXO-SQ`O'#DWO4vQ!nO'#FqO6|Q`O'#DYO7RQ`O'#DyOOQ['#Fq'#FqO7WQhO'#GOO7fQ`O,5;SO7kQ!bO,5;UOOQS'#En'#EnO7sQ`O,5;WO7xQdO,5;WOOQO'#Eq'#EqO8QQ`O,5;ZO8VQhO,5;aO'oQdO'#DjOOQS,5;c,5;cO0jQ`O,5;cO8_QdO,5;cOOQS'#F`'#F`O8gQdO'#E|O7fQ`O,5;fO8oQdO,5:yO9PQdO'#FZO9^Q`O,5lQhO'#DoOOQW,5:Y,5:YOOQW,5:d,5:dOOQW,5:S,5:SO>vQhO,5:VO?bQ!fO'#FrOOQS'#Fr'#FrOOQS'#FS'#FSO@rQdO,59cOOQ[,59c,59cOAYQdO,59iOOQ[,59i,59iOApQdO,59lOOQ[,59l,59lOOQ[,59n,59nO)YQdO,59pOBWQhO'#EdOOQW'#Ed'#EdOBuQ`O1G0hO4oQhO1G0hOOQ[,59r,59rO)}QhO'#D[OOQ[,59t,59tOBzQ#tO,5:eOCVQhO'#F]OCdQ`O,5vQhO'#DmOI_QhO'#DqOIgQhO'#DsOIlQhO'#FwOOQO'#Fw'#FwOItQ!bO'#DwOOQO'#Fy'#FyOOQO'#Fv'#FvOIyQ`O1G/qOOQS-E9Q-E9QOOQ[1G.}1G.}OOQ[1G/T1G/TOOQ[1G/W1G/WOOQ[1G/[1G/[OJOQdO,5;OOOQS7+&S7+&SOJTQ`O7+&SOJYQhO'#D]OJbQ`O,59vO)}QhO,59vOOQ[1G0P1G0POJjQ`O1G0POJoQhO,5;wOOQO-E9Z-E9ZOOQS7+&^7+&^OJ}QbO'#DSOOQO'#Et'#EtOK]Q`O'#EsOOQO'#Es'#EsOKhQ`O'#F^OKpQdO,5;^OOQS,5;^,5;^OOQ[1G/p1G/pOOQS7+&i7+&iO7fQ`O7+&iOK{Q!fO'#FYO)YQdO'#FYOMSQdO7+&POOQO7+&P7+&POOQO,5:{,5:{OOQO1G1a1G1aOMgQ!bO<vQhO'#DrOOQO,5:],5:]O! hQhO,5:_OGUQhO,5:cOOQW7+%]7+%]OOQO'#Ef'#EfO! pQ`O1G0jOOQS<xAN>xO!#zQ`OAN>xO!$PQaO,5;rOOQO-E9U-E9UO!$ZQdO,5;qOOQO-E9T-E9TOOQW<vQhO'#DuOOQO1G/y1G/yO!%vQ!bO1G/}OJOQdO'#F[O!&OQ`O7+&UOOQW7+&U7+&UO!&WQ!bO1G/cOOQ[7+$|7+$|O!&cQhO7+$|P!&jQ`O'#FTOOQO,5;y,5;yOOQO-E9]-E9]OOQS1G1d1G1dOOQPG24dG24dO!&oQ`OAN>ZO)YQdO1G1[O!&tQ`O7+'jOOQO1G/x1G/xO!&|Q`O,5:aO!$eQhO7+%iOOQO,5;v,5;vOOQO-E9Y-E9YOOQW<Q!]!^>|!^!_?_!_!`@Z!`!a@n!a!b%Z!b!cAo!c!k%Z!k!lC|!l!u%Z!u!vC|!v!}%Z!}#OD_#O#P%Z#P#QDp#Q#R2X#R#]%Z#]#^ER#^#g%Z#g#hC|#h#o%Z#o#pIf#p#qIw#q#rJ`#r#sJq#s#y%Z#y#z&R#z$f%Z$f$g&R$g#BY%Z#BY#BZ&R#BZ$IS%Z$IS$I_&R$I_$I|%Z$I|$JO&R$JO$JT%Z$JT$JU&R$JU$KV%Z$KV$KW&R$KW&FU%Z&FU&FV&R&FV;'S%Z;'S;=`KY<%lO%Z`%^SOy%jz;'S%j;'S;=`%{<%lO%j`%oS!o`Oy%jz;'S%j;'S;=`%{<%lO%j`&OP;=`<%l%j~&Wh$[~OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%j~'yh$[~!o`OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%jj)jS$qYOy%jz;'S%j;'S;=`%{<%lO%j~)yWOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d<%lO)v~*hOw~~*kRO;'S)v;'S;=`*t;=`O)v~*wXOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d;=`<%l)v<%lO)v~+gP;=`<%l)vj+oYmYOy%jz!Q%j!Q![,_![!c%j!c!i,_!i#T%j#T#Z,_#Z;'S%j;'S;=`%{<%lO%jj,dY!o`Oy%jz!Q%j!Q![-S![!c%j!c!i-S!i#T%j#T#Z-S#Z;'S%j;'S;=`%{<%lO%jj-XY!o`Oy%jz!Q%j!Q![-w![!c%j!c!i-w!i#T%j#T#Z-w#Z;'S%j;'S;=`%{<%lO%jj.OYuY!o`Oy%jz!Q%j!Q![.n![!c%j!c!i.n!i#T%j#T#Z.n#Z;'S%j;'S;=`%{<%lO%jj.uYuY!o`Oy%jz!Q%j!Q![/e![!c%j!c!i/e!i#T%j#T#Z/e#Z;'S%j;'S;=`%{<%lO%jj/jY!o`Oy%jz!Q%j!Q![0Y![!c%j!c!i0Y!i#T%j#T#Z0Y#Z;'S%j;'S;=`%{<%lO%jj0aYuY!o`Oy%jz!Q%j!Q![1P![!c%j!c!i1P!i#T%j#T#Z1P#Z;'S%j;'S;=`%{<%lO%jj1UY!o`Oy%jz!Q%j!Q![1t![!c%j!c!i1t!i#T%j#T#Z1t#Z;'S%j;'S;=`%{<%lO%jj1{SuY!o`Oy%jz;'S%j;'S;=`%{<%lO%jd2[UOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jd2uS!yS!o`Oy%jz;'S%j;'S;=`%{<%lO%jb3WS^QOy%jz;'S%j;'S;=`%{<%lO%j~3gWOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{<%lO3d~4SRO;'S3d;'S;=`4];=`O3d~4`XOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{;=`<%l3d<%lO3d~5OP;=`<%l3dj5WShYOy%jz;'S%j;'S;=`%{<%lO%j~5iOg~n5pUWQyWOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jj6ZWyW#PQOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj6xU!o`Oy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%jj7cY!o`$gYOy%jz!Q%j!Q![7[![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj8WY!o`Oy%jz{%j{|8v|}%j}!O8v!O!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj8{U!o`Oy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj9fU!o`$gYOy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj:P[!o`$gYOy%jz!O%j!O!P7[!P!Q%j!Q![9x![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj:zS!dYOy%jz;'S%j;'S;=`%{<%lO%jj;]WyWOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj;zU`YOy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%j~VUcYOy%jz![%j![!]>i!];'S%j;'S;=`%{<%lO%jj>pSdY!o`Oy%jz;'S%j;'S;=`%{<%lO%jj?RSnYOy%jz;'S%j;'S;=`%{<%lO%jh?dU!WWOy%jz!_%j!_!`?v!`;'S%j;'S;=`%{<%lO%jh?}S!WW!o`Oy%jz;'S%j;'S;=`%{<%lO%jl@bS!WW!ySOy%jz;'S%j;'S;=`%{<%lO%jj@uV!|Q!WWOy%jz!_%j!_!`?v!`!aA[!a;'S%j;'S;=`%{<%lO%jbAcS!|Q!o`Oy%jz;'S%j;'S;=`%{<%lO%jjArYOy%jz}%j}!OBb!O!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjBgW!o`Oy%jz!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjCW[lY!o`Oy%jz}%j}!OCP!O!Q%j!Q![CP![!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jhDRS!zWOy%jz;'S%j;'S;=`%{<%lO%jjDdSpYOy%jz;'S%j;'S;=`%{<%lO%jnDuSo^Oy%jz;'S%j;'S;=`%{<%lO%jjEWU!zWOy%jz#a%j#a#bEj#b;'S%j;'S;=`%{<%lO%jbEoU!o`Oy%jz#d%j#d#eFR#e;'S%j;'S;=`%{<%lO%jbFWU!o`Oy%jz#c%j#c#dFj#d;'S%j;'S;=`%{<%lO%jbFoU!o`Oy%jz#f%j#f#gGR#g;'S%j;'S;=`%{<%lO%jbGWU!o`Oy%jz#h%j#h#iGj#i;'S%j;'S;=`%{<%lO%jbGoU!o`Oy%jz#T%j#T#UHR#U;'S%j;'S;=`%{<%lO%jbHWU!o`Oy%jz#b%j#b#cHj#c;'S%j;'S;=`%{<%lO%jbHoU!o`Oy%jz#h%j#h#iIR#i;'S%j;'S;=`%{<%lO%jbIYS$pQ!o`Oy%jz;'S%j;'S;=`%{<%lO%jjIkSsYOy%jz;'S%j;'S;=`%{<%lO%jfI|U$cUOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jjJeSrYOy%jz;'S%j;'S;=`%{<%lO%jfJvU#PQOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%j`K]P;=`<%l%Z",tokenizers:[_4t,j4t,A4t,T4t,1,2,3,4,new iP("m~RRYZ[z{a~~g~aO$_~~dP!P!Qg~lO$`~~",28,152)],topRules:{StyleSheet:[0,6],Styles:[1,126]},dynamicPrecedences:{94:1},specialized:[{term:147,get:e=>R4t[e]||-1},{term:148,get:e=>I4t[e]||-1},{term:4,get:e=>P4t[e]||-1},{term:28,get:e=>D4t[e]||-1},{term:146,get:e=>M4t[e]||-1}],tokenPrec:2405});let S$=null;function E$(){if(!S$&&typeof document=="object"&&document.body){let{style:e}=document.body,t=[],n=new Set;for(let i in e)i!="cssText"&&i!="cssFloat"&&typeof e[i]=="string"&&(/[A-Z]/.test(i)&&(i=i.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),n.has(i)||(t.push(i),n.add(i)));S$=t.sort().map(i=>({type:"property",label:i,apply:i+": "}))}return S$||[]}const pse=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(e=>({type:"class",label:e})),mse=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(e=>({type:"keyword",label:e})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(e=>({type:"constant",label:e}))),$4t=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(e=>({type:"type",label:e})),F4t=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(e=>({type:"keyword",label:e})),Yh=/^(\w[\w-]*|-\w[\w-]*|)$/,B4t=/^-(-[\w-]*)?$/;function U4t(e,t){var n;if((e.name=="("||e.type.isError)&&(e=e.parent||e),e.name!="ArgList")return!1;let i=(n=e.parent)===null||n===void 0?void 0:n.firstChild;return(i==null?void 0:i.name)!="Callee"?!1:t.sliceString(i.from,i.to)=="var"}const gse=new Dq,Q4t=["Declaration"];function z4t(e){for(let t=e;;){if(t.type.isTop)return t;if(!(t=t.parent))return e}}function z$e(e,t,n){if(t.to-t.from>4096){let i=gse.get(t);if(i)return i;let r=[],s=new Set,o=t.cursor(Sr.IncludeAnonymous);if(o.firstChild())do for(let l of z$e(e,o.node,n))s.has(l.label)||(s.add(l.label),r.push(l));while(o.nextSibling());return gse.set(t,r),r}else{let i=[],r=new Set;return t.cursor().iterate(s=>{var o;if(n(s)&&s.matchContext(Q4t)&&((o=s.node.nextSibling)===null||o===void 0?void 0:o.name)==":"){let l=e.sliceString(s.from,s.to);r.has(l)||(r.add(l),i.push({label:l,type:"variable"}))}}),i}}const V4t=e=>t=>{let{state:n,pos:i}=t,r=Yr(n).resolveInner(i,-1),s=r.type.isError&&r.from==r.to-1&&n.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:E$(),validFor:Yh};if(r.name=="ValueName")return{from:r.from,options:mse,validFor:Yh};if(r.name=="PseudoClassName")return{from:r.from,options:pse,validFor:Yh};if(e(r)||(t.explicit||s)&&U4t(r,n.doc))return{from:e(r)||s?r.from:i,options:z$e(n.doc,z4t(r),e),validFor:B4t};if(r.name=="TagName"){for(let{parent:c}=r;c;c=c.parent)if(c.name=="Block")return{from:r.from,options:E$(),validFor:Yh};return{from:r.from,options:$4t,validFor:Yh}}if(r.name=="AtKeyword")return{from:r.from,options:F4t,validFor:Yh};if(!t.explicit)return null;let o=r.resolve(i),l=o.childBefore(i);return l&&l.name==":"&&o.name=="PseudoClassSelector"?{from:i,options:pse,validFor:Yh}:l&&l.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:i,options:mse,validFor:Yh}:o.name=="Block"||o.name=="Styles"?{from:i,options:E$(),validFor:Yh}:null},H4t=V4t(e=>e.name=="VariableName"),cP=rm.define({name:"css",parser:L4t.configure({props:[ym.add({Declaration:ww()}),vm.add({"Block KeyframeList":jT})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function q4t(){return new bb(cP,cP.data.of({autocomplete:H4t}))}const Tk=["_blank","_self","_top","_parent"],C$=["ascii","utf-8","utf-16","latin1","latin1"],A$=["get","post","put","delete"],T$=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],iu=["true","false"],Pn={},W4t={a:{attrs:{href:null,ping:null,type:null,media:null,target:Tk,hreflang:null}},abbr:Pn,address:Pn,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Pn,aside:Pn,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Pn,base:{attrs:{href:null,target:Tk}},bdi:Pn,bdo:Pn,blockquote:{attrs:{cite:null}},body:Pn,br:Pn,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:T$,formmethod:A$,formnovalidate:["novalidate"],formtarget:Tk,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Pn,center:Pn,cite:Pn,code:Pn,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:Pn,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Pn,div:Pn,dl:Pn,dt:Pn,em:Pn,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Pn,figure:Pn,footer:Pn,form:{attrs:{action:null,name:null,"accept-charset":C$,autocomplete:["on","off"],enctype:T$,method:A$,novalidate:["novalidate"],target:Tk}},h1:Pn,h2:Pn,h3:Pn,h4:Pn,h5:Pn,h6:Pn,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Pn,hgroup:Pn,hr:Pn,html:{attrs:{manifest:null}},i:Pn,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:T$,formmethod:A$,formnovalidate:["novalidate"],formtarget:Tk,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:Pn,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Pn,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:Pn,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:C$,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Pn,noscript:Pn,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Pn,param:{attrs:{name:null,value:null}},pre:Pn,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Pn,rt:Pn,ruby:Pn,samp:Pn,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:C$}},section:Pn,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Pn,source:{attrs:{src:null,type:null,media:null}},span:Pn,strong:Pn,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Pn,summary:Pn,sup:Pn,table:Pn,tbody:Pn,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Pn,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:Pn,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Pn,time:{attrs:{datetime:null}},title:Pn,tr:Pn,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Pn,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:Pn},V$e={accesskey:null,class:null,contenteditable:iu,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:iu,autocorrect:iu,autocapitalize:iu,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":iu,"aria-autocomplete":["inline","list","both","none"],"aria-busy":iu,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":iu,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":iu,"aria-hidden":iu,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":iu,"aria-multiselectable":iu,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":iu,"aria-relevant":null,"aria-required":iu,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},H$e="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of H$e)V$e[e]=null;class XC{constructor(t,n){this.tags={...W4t,...t},this.globalAttrs={...V$e,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}XC.default=new XC;function g1(e,t,n=e.length){if(!t)return"";let i=t.firstChild,r=i&&i.getChild("TagName");return r?e.sliceString(r.from,Math.min(r.to,n)):""}function b1(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function q$e(e,t,n){let i=n.tags[g1(e,b1(t))];return(i==null?void 0:i.children)||n.allTags}function EW(e,t){let n=[];for(let i=b1(t);i&&!i.type.isTop;i=b1(i.parent)){let r=g1(e,i);if(r&&i.lastChild.name=="CloseTag")break;r&&n.indexOf(r)<0&&(t.name=="EndTag"||t.from>=i.firstChild.to)&&n.push(r)}return n}const W$e=/^[:\-\.\w\u00b7-\uffff]*$/;function bse(e,t,n,i,r){let s=/\s*>/.test(e.sliceDoc(r,r+5))?"":">",o=b1(n,n.name=="StartTag"||n.name=="TagName");return{from:i,to:r,options:q$e(e.doc,o,t).map(l=>({label:l,type:"type"})).concat(EW(e.doc,n).map((l,c)=>({label:"/"+l,apply:"/"+l+s,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function yse(e,t,n,i){let r=/\s*>/.test(e.sliceDoc(i,i+5))?"":">";return{from:n,to:i,options:EW(e.doc,t).map((s,o)=>({label:s,apply:s+r,type:"type",boost:99-o})),validFor:W$e}}function K4t(e,t,n,i){let r=[],s=0;for(let o of q$e(e.doc,n,t))r.push({label:"<"+o,type:"type"});for(let o of EW(e.doc,n))r.push({label:"",type:"type",boost:99-s++});return{from:i,to:i,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function G4t(e,t,n,i,r){let s=b1(n),o=s?t.tags[g1(e.doc,s)]:null,l=o&&o.attrs?Object.keys(o.attrs):[],c=o&&o.globalAttrs===!1?l:l.length?l.concat(t.globalAttrNames):t.globalAttrNames;return{from:i,to:r,options:c.map(u=>({label:u,type:"property"})),validFor:W$e}}function X4t(e,t,n,i,r){var s;let o=(s=n.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),l=[],c;if(o){let u=e.sliceDoc(o.from,o.to),d=t.globalAttrs[u];if(!d){let f=b1(n),h=f?t.tags[g1(e.doc,f)]:null;d=(h==null?void 0:h.attrs)&&h.attrs[u]}if(d){let f=e.sliceDoc(i,r).toLowerCase(),h='"',m='"';/^['"]/.test(f)?(c=f[0]=='"'?/^[^"]*$/:/^[^']*$/,h="",m=e.sliceDoc(r,r+1)==f[0]?"":f[0],f=f.slice(1),i++):c=/^[^\s<>='"]*$/;for(let g of d)l.push({label:g,apply:h+g+m,type:"constant"})}}return{from:i,to:r,options:l,validFor:c}}function K$e(e,t){let{state:n,pos:i}=t,r=Yr(n).resolveInner(i,-1),s=r.resolve(i);for(let o=i,l;s==r&&(l=r.childBefore(o));){let c=l.lastChild;if(!c||!c.type.isError||c.fromK$e(i,r)}const J4t=yh.parser.configure({top:"SingleExpression"}),G$e=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:n$e.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:i$e.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:r$e.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:J4t},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:yh.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:cP.parser}],X$e=[{name:"style",parser:cP.parser.configure({top:"Styles"})}].concat(H$e.map(e=>({name:e,parser:yh.parser}))),Y$e=rm.define({name:"html",parser:u4t.configure({props:[ym.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].lengthe.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),qN=Y$e.configure({wrap:$$e(G$e,X$e)});function e$t(e={}){let t="",n;e.matchClosingTags===!1&&(t="noMatch"),e.selfClosingTags===!0&&(t=(t?t+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(n=$$e((e.nestedLanguages||[]).concat(G$e),(e.nestedAttributes||[]).concat(X$e)));let i=n?Y$e.configure({wrap:n,dialect:t}):t?qN.configure({dialect:t}):qN;return new bb(i,[qN.data.of({autocomplete:Z4t(e)}),e.autoCloseTags!==!1?t$t:[],o7().support,q4t().support])}const vse=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),t$t=Jt.inputHandler.of((e,t,n,i,r)=>{if(e.composing||e.state.readOnly||t!=n||i!=">"&&i!="/"||!qN.isActiveAt(e.state,t,-1))return!1;let s=r(),{state:o}=s,l=o.changeByRange(c=>{var u,d,f;let h=o.doc.sliceString(c.from-1,c.to)==i,{head:m}=c,g=Yr(o).resolveInner(m,-1),b;if(h&&i==">"&&g.name=="EndTag"){let v=g.parent;if(((d=(u=v.parent)===null||u===void 0?void 0:u.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(b=g1(o.doc,v.parent,m))&&!vse.has(b)){let y=m+(o.doc.sliceString(m,m+1)===">"?1:0),w=``;return{range:c,changes:{from:m,to:y,insert:w}}}}else if(h&&i=="/"&&g.name=="IncompleteCloseTag"){let v=g.parent;if(g.from==m-2&&((f=v.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(b=g1(o.doc,v,m))&&!vse.has(b)){let y=m+(o.doc.sliceString(m,m+1)===">"?1:0),w=`${b}>`;return{range:ht.cursor(m+w.length,-1),changes:{from:m,to:y,insert:w}}}}return{range:c}});return l.changes.empty?!1:(e.dispatch([s,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Z$e=tL({commentTokens:{block:{open:""}}}),J$e=new ui,e6e=f3t.configure({props:[vm.add(e=>!e.is("Block")||e.is("Document")||p7(e)!=null||n$t(e)?void 0:(t,n)=>({from:n.doc.lineAt(t.from).to,to:t.to})),J$e.add(p7),ym.add({Document:()=>null}),wg.add({Document:Z$e})]});function p7(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function n$t(e){return e.name=="OrderedList"||e.name=="BulletList"}function i$t(e,t){let n=e;for(;;){let i=n.nextSibling,r;if(!i||(r=p7(i.type))!=null&&r<=t)break;n=i}return n.to}const r$t=v4e.of((e,t,n)=>{for(let i=Yr(e).resolveInner(n,-1);i&&!(i.fromn)return{from:n,to:s}}return null});function CW(e){return new Ou(Z$e,e,[],"markdown")}const s$t=CW(e6e),a$t=e6e.configure([k3t,E3t,S3t,C3t,{props:[vm.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),uP=CW(a$t);function o$t(e,t){return n=>{if(n&&e){let i=null;if(n=/\S*/.exec(n)[0],typeof e=="function"?i=e(n):i=ZI.matchLanguageName(e,n,!0),i instanceof ZI)return i.support?i.support.language.parser:k0.getSkippingParser(i.load());if(i)return i.parser}return t?t.parser:null}}let _$=class{constructor(t,n,i,r,s,o,l){this.node=t,this.from=n,this.to=i,this.spaceBefore=r,this.spaceAfter=s,this.type=o,this.item=l}blank(t,n=!0){let i=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(t!=null){for(;i.length0;r--)i+=" ";return i+(n?this.spaceAfter:"")}}marker(t,n){let i=this.node.name=="OrderedList"?String(+n6e(this.item,t)[2]+n):"";return this.spaceBefore+i+this.type+this.spaceAfter}};function t6e(e,t){let n=[],i=[];for(let r=e;r;r=r.parent){if(r.name=="FencedCode")return i;(r.name=="ListItem"||r.name=="Blockquote")&&n.push(r)}for(let r=n.length-1;r>=0;r--){let s=n[r],o,l=t.lineAt(s.from),c=s.from-l.from;if(s.name=="Blockquote"&&(o=/^ *>( ?)/.exec(l.text.slice(c))))i.push(new _$(s,c,c+o[0].length,"",o[1],">",null));else if(s.name=="ListItem"&&s.parent.name=="OrderedList"&&(o=/^( *)\d+([.)])( *)/.exec(l.text.slice(c)))){let u=o[3],d=o[0].length;u.length>=4&&(u=u.slice(0,u.length-4),d-=4),i.push(new _$(s.parent,c,c+d,o[1],u,o[2],s))}else if(s.name=="ListItem"&&s.parent.name=="BulletList"&&(o=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(l.text.slice(c)))){let u=o[4],d=o[0].length;u.length>4&&(u=u.slice(0,u.length-4),d-=4);let f=o[2];o[3]&&(f+=o[3].replace(/[xX]/," ")),i.push(new _$(s.parent,c,c+d,o[1],u,f,s))}}return i}function n6e(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function j$(e,t,n,i=0){for(let r=-1,s=e;;){if(s.name=="ListItem"){let l=n6e(s,t),c=+l[2];if(r>=0){if(c!=r+1)return;n.push({from:s.from+l[1].length,to:s.from+l[0].length,insert:String(r+2+i)})}r=c}let o=s.nextSibling;if(!o)break;s=o}}function AW(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(pO)!=" ")return e;let i=wf(e,4,n),r="";for(let s=i;s>0;)s>=4?(r+=" ",s-=4):(r+=" ",s--);return r+e.slice(n)}const l$t=(e={})=>({state:t,dispatch:n})=>{let i=Yr(t),{doc:r}=t,s=null,o=t.changeByRange(l=>{if(!l.empty||!uP.isActiveAt(t,l.from,-1)&&!uP.isActiveAt(t,l.from,1))return s={range:l};let c=l.from,u=r.lineAt(c),d=t6e(i.resolveInner(c,-1),r);for(;d.length&&d[d.length-1].from>c-u.from;)d.pop();if(!d.length)return s={range:l};let f=d[d.length-1];if(f.to-f.spaceAfter.length>c-u.from)return s={range:l};let h=c>=f.to-f.spaceAfter.length&&!/\S/.test(u.text.slice(f.to));if(f.item&&h){let y=f.node.firstChild,w=f.node.getChild("ListItem","ListItem");if(y.to>=c||w&&w.to0&&!/[^\s>]/.test(r.lineAt(u.from-1).text)||e.nonTightLists===!1){let x=d.length>1?d[d.length-2]:null,O,k="";x&&x.item?(O=u.from+x.from,k=x.marker(r,1)):O=u.from+(x?x.to:0);let S=[{from:O,to:c,insert:k}];return f.node.name=="OrderedList"&&j$(f.item,r,S,-2),x&&x.node.name=="OrderedList"&&j$(x.item,r,S),{range:ht.cursor(O+k.length),changes:S}}else{let x=wse(d,t,u);return{range:ht.cursor(c+x.length+1),changes:{from:u.from,insert:x+t.lineBreak}}}}if(f.node.name=="Blockquote"&&h&&u.from){let y=r.lineAt(u.from-1),w=/>\s*$/.exec(y.text);if(w&&w.index==f.from){let x=t.changes([{from:y.from+w.index,to:y.to},{from:u.from+f.from,to:u.to}]);return{range:l.map(x),changes:x}}}let m=[];f.node.name=="OrderedList"&&j$(f.item,r,m);let g=f.item&&f.item.from]*/.exec(u.text)[0].length>=f.to)for(let y=0,w=d.length-1;y<=w;y++)b+=y==w&&!g?d[y].marker(r,1):d[y].blank(yu.from&&/\s/.test(u.text.charAt(v-u.from-1));)v--;return b=AW(b,t),u$t(f.node,t.doc)&&(b=wse(d,t,u)+t.lineBreak+b),m.push({from:v,to:c,insert:t.lineBreak+b}),{range:ht.cursor(v+b.length+1),changes:m}});return s?!1:(n(t.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)},c$t=l$t();function xse(e){return e.name=="QuoteMark"||e.name=="ListMark"}function u$t(e,t){if(e.name!="OrderedList"&&e.name!="BulletList")return!1;let n=e.firstChild,i=e.getChild("ListItem","ListItem");if(!i)return!1;let r=t.lineAt(n.to),s=t.lineAt(i.from),o=/^[\s>]*$/.test(r.text);return r.number+(o?0:1){let n=Yr(e),i=null,r=e.changeByRange(s=>{let o=s.from,{doc:l}=e;if(s.empty&&uP.isActiveAt(e,s.from)){let c=l.lineAt(o),u=t6e(d$t(n,o),l);if(u.length){let d=u[u.length-1],f=d.to-d.spaceAfter.length+(d.spaceAfter?1:0);if(o-c.from>f&&!/\S/.test(c.text.slice(f,o-c.from)))return{range:ht.cursor(c.from+f),changes:{from:c.from+f,to:o}};if(o-c.from==f&&(d.item&&c.from<=d.item.from||/^[\s>]*$/.test(c.text.slice(0,d.to)))){let h=c.from+d.from;if(d.item&&d.node.from{var n;let{main:i}=t.state.selection;if(i.empty)return!1;let r=(n=e.clipboardData)===null||n===void 0?void 0:n.getData("text/plain");if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r="https://"+r),!uP.isActiveAt(t.state,i.from,1)))return!1;let s=Yr(t.state),o=!1;return s.iterate({from:i.from,to:i.to,enter:l=>{(l.from>i.from||b$t.test(l.name))&&(o=!0)},leave:l=>{l.to=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}const y6t=new Ia((e,t)=>{let n;if(e.next<0)e.acceptToken(O$t);else if(t.context.flags&WN)R$(e.next)&&e.acceptToken(w$t,1);else if(((n=e.peek(-1))<0||R$(n))&&t.canShift(Ose)){let i=0;for(;e.next==TW||e.next==oL;)e.advance(),i++;(e.next==C0||e.next==YC||e.next==_W)&&e.acceptToken(Ose,-i)}else R$(e.next)&&e.acceptToken(x$t,1)},{contextual:!0}),v6t=new Ia((e,t)=>{let n=t.context;if(n.flags)return;let i=e.peek(-1);if(i==C0||i==YC){let r=0,s=0;for(;;){if(e.next==TW)r++;else if(e.next==oL)r+=8-r%8;else break;e.advance(),s++}r!=n.indent&&e.next!=C0&&e.next!=YC&&e.next!=_W&&(r[e,t|u6e])),O6t=new rL({start:x6t,reduce(e,t,n,i){return e.flags&WN&&b6t.has(t)||(t==F$t||t==o6e)&&e.flags&u6e?e.parent:e},shift(e,t,n,i){return t==r6e?new KN(e,w6t(i.read(i.pos,n.pos)),0):t==s6e?e.parent:t==E$t||t==_$t||t==R$t||t==a6e?new KN(e,0,WN):Cse.has(t)?new KN(e,0,Cse.get(t)|e.flags&WN):e},hash(e){return e.hash}}),k6t=new Ia(e=>{for(let t=0;t<5;t++){if(e.next!="print".charCodeAt(t))return;e.advance()}if(!/\w/.test(String.fromCharCode(e.next)))for(let t=0;;t++){let n=e.peek(t);if(!(n==TW||n==oL)){n!=u6t&&n!=d6t&&n!=C0&&n!=YC&&n!=_W&&e.acceptToken(v$t);return}}}),S6t=new Ia((e,t)=>{let{flags:n}=t.context,i=n&sp?c6e:l6e,r=(n&ap)>0,s=!(n&op),o=(n&lp)>0,l=e.pos;for(;!(e.next<0);)if(o&&e.next==m7)if(e.peek(1)==m7)e.advance(2);else{if(e.pos==l){e.acceptToken(a6e,1);return}break}else if(s&&e.next==Ese){if(e.pos==l){e.advance();let c=e.next;c>=0&&(e.advance(),E6t(e,c)),e.acceptToken(S$t);return}break}else if(e.next==Ese&&!s&&e.peek(1)>-1)e.advance(2);else if(e.next==i&&(!r||e.peek(1)==i&&e.peek(2)==i)){if(e.pos==l){e.acceptToken(kse,r?3:1);return}break}else if(e.next==C0){if(r)e.advance();else if(e.pos==l){e.acceptToken(kse);return}break}else e.advance();e.pos>l&&e.acceptToken(k$t)});function E6t(e,t){if(t==f6t)for(let n=0;n<2&&e.next>=48&&e.next<=55;n++)e.advance();else if(t==h6t)for(let n=0;n<2&&I$(e.next);n++)e.advance();else if(t==m6t)for(let n=0;n<4&&I$(e.next);n++)e.advance();else if(t==g6t)for(let n=0;n<8&&I$(e.next);n++)e.advance();else if(t==p6t&&e.next==m7){for(e.advance();e.next>=0&&e.next!=Sse&&e.next!=l6e&&e.next!=c6e&&e.next!=C0;)e.advance();e.next==Sse&&e.advance()}}const C6t=bm({'async "*" "**" FormatConversion FormatSpec':fe.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":fe.controlKeyword,"in not and or is del":fe.operatorKeyword,"from def class global nonlocal lambda":fe.definitionKeyword,import:fe.moduleKeyword,"with as print":fe.keyword,Boolean:fe.bool,None:fe.null,VariableName:fe.variableName,"CallExpression/VariableName":fe.function(fe.variableName),"FunctionDefinition/VariableName":fe.function(fe.definition(fe.variableName)),"ClassDefinition/VariableName":fe.definition(fe.className),PropertyName:fe.propertyName,"CallExpression/MemberExpression/PropertyName":fe.function(fe.propertyName),Comment:fe.lineComment,Number:fe.number,String:fe.string,FormatString:fe.special(fe.string),Escape:fe.escape,UpdateOp:fe.updateOperator,"ArithOp!":fe.arithmeticOperator,BitOp:fe.bitwiseOperator,CompareOp:fe.compareOperator,AssignOp:fe.definitionOperator,Ellipsis:fe.punctuation,At:fe.meta,"( )":fe.paren,"[ ]":fe.squareBracket,"{ }":fe.brace,".":fe.derefOperator,", ;":fe.separator}),A6t={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},T6t=sm.deserialize({version:14,states:"##jQ`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO5TQdO'#DoOOQS,5:Y,5:YO5hQdO'#HdOOQS,5:],5:]O5uQ!fO,5:]O5zQtO,59YO1lQdO,59bO1lQdO,59bO1lQdO,59bO8jQdO,59bO8oQdO,59bO8vQdO,59jO8}QdO'#HTO:TQdO'#HSOOQS'#HS'#HSOOQS'#D['#D[O:lQdO,59aO'vQdO,59aO:zQdO,59aOOQS,59y,59yO;PQdO,5:RO'vQdO,5:ROOQS,5:Q,5:QO;_QdO,5:QO;dQdO,5:XO'vQdO,5:XO'vQdO,5:VOOQS,5:U,5:UO;uQdO,5:UO;zQdO,5:WOOOW'#Fy'#FyOOOOQS'#Ds'#DsOOQS1G/w1G/wOOQS1G.|1G.|O!/[QtO1G.|O!/cQtO1G.|O1lQdO1G.|O!0OQdO1G/UOOQS'#DZ'#DZO0rQdO,59tOOQS1G.{1G.{O!0VQdO1G/eO!0gQdO1G/eO!0oQdO1G/fO'vQdO'#H[O!0tQdO'#H[O!0yQtO1G.{O!1ZQdO,59iO!2aQdO,5=zO!2qQdO,5=zO!2yQdO1G/mO!3OQtO1G/mOOQS1G/l1G/lO!3`QdO,5=uO!4VQdO,5=uO0rQdO1G/qO!4tQdO1G/sO!4yQtO1G/sO!5ZQtO1G/qOOQS1G/p1G/pOOQS1G/r1G/rOOOW-E9w-E9wOOQS1G/{1G/{O!5kQdO'#HxO0rQdO'#HxO!5|QdO,5>cOOOW-E9x-E9xOOQS1G/|1G/|OOQS-E9{-E9{O!6[Q#xO1G2zO!6{QtO1G2zO'vQdO,5kOOQS1G1`1G1`O!8RQdO1G1`OOQS'#DV'#DVO0rQdO,5=qOOQS,5=q,5=qO!8WQdO'#FrO!8cQdO,59oO!8kQdO1G/XO!8uQtO,5=uOOQS1G3`1G3`OOQS,5:m,5:mO!9fQdO'#GtOOQS,5jO!;ZQdO,5>jO1XQdO,5>jO!;lQdO,5>iOOQS-E:R-E:RO!;qQdO1G0lO!;|QdO1G0lO!lO!lO!hO!=VQdO,5>hO!=hQdO'#EpO0rQdO1G0tO!=sQdO1G0tO!=xQgO1G0zO!AvQgO1G0}O!EqQdO,5>oO!E{QdO,5>oO!FTQtO,5>oO0rQdO1G1PO!F_QdO1G1PO4iQdO1G1UO!!vQdO1G1WOOQV,5;a,5;aO!FdQfO,5;aO!FiQgO1G1QO!JjQdO'#GZO4iQdO1G1QO4iQdO1G1QO!JzQdO,5>pO!KXQdO,5>pO1XQdO,5>pOOQV1G1U1G1UO!KaQdO'#FSO!KrQ!fO1G1WO!KzQdO1G1WOOQV1G1]1G1]O4iQdO1G1]O!LPQdO1G1]O!LXQdO'#F^OOQV1G1b1G1bO!#ZQtO1G1bPOOO1G2v1G2vP!L^OSO1G2vOOQS,5=},5=}OOQS'#Dp'#DpO0rQdO,5=}O!LfQdO,5=|O!LyQdO,5=|OOQS1G/u1G/uO!MRQdO,5>PO!McQdO,5>PO!MkQdO,5>PO!NOQdO,5>PO!N`QdO,5>POOQS1G3j1G3jOOQS7+$h7+$hO!8kQdO7+$pO#!RQdO1G.|O#!YQdO1G.|OOQS1G/`1G/`OOQS,5<`,5<`O'vQdO,5<`OOQS7+%P7+%PO#!aQdO7+%POOQS-E9r-E9rOOQS7+%Q7+%QO#!qQdO,5=vO'vQdO,5=vOOQS7+$g7+$gO#!vQdO7+%PO##OQdO7+%QO##TQdO1G3fOOQS7+%X7+%XO##eQdO1G3fO##mQdO7+%XOOQS,5<_,5<_O'vQdO,5<_O##rQdO1G3aOOQS-E9q-E9qO#$iQdO7+%]OOQS7+%_7+%_O#$wQdO1G3aO#%fQdO7+%_O#%kQdO1G3gO#%{QdO1G3gO#&TQdO7+%]O#&YQdO,5>dO#&sQdO,5>dO#&sQdO,5>dOOQS'#Dx'#DxO#'UO&jO'#DzO#'aO`O'#HyOOOW1G3}1G3}O#'fQdO1G3}O#'nQdO1G3}O#'yQ#xO7+(fO#(jQtO1G2UP#)TQdO'#GOOOQS,5nQdO,5sQdO1G4OOOQS-E9y-E9yO#?^QdO1G4OO<[QdO'#H{OOOO'#D{'#D{OOOO'#F|'#F|O#?oO&jO,5:fOOOW,5>e,5>eOOOW7+)i7+)iO#?zQdO7+)iO#@SQdO1G2zO#@mQdO1G2zP'vQdO'#FuO0rQdO<mO#BQQdO,5>mOOQS1G0v1G0vOOQS<rO#KgQdO,5>rO#KrQdO,5>rO#K}QdO,5>qO#L`QdO,5>qOOQS1G1Y1G1YOOQS,5;p,5;pOOQV<VAN>VO$ oQdO<cAN>cO0rQdO1G1|O$!PQtO1G1|P$!ZQdO'#FvOOQS1G2R1G2RP$!hQdO'#F{O$!uQdO7+)jO$#`QdO,5>gOOOO-E9z-E9zOOOW<tO$4{QdO,5>tO1XQdO,5vO$)nQdO,5>vOOQS1G1p1G1pOOQS,5<[,5<[OOQU7+'P7+'PO$+zQdO1G/iO$)nQdO,5wO$8zQdO,5>wOOQS1G1s1G1sOOQS7+'S7+'SP$)nQdO'#GdO$9SQdO1G4bO$9^QdO1G4bO$9fQdO1G4bOOQS7+%T7+%TO$9tQdO1G1tO$:SQtO'#FaO$:ZQdO,5<}OOQS,5<},5<}O$:iQdO1G4cOOQS-E:a-E:aO$)nQdO,5<|O$:pQdO,5<|O$:uQdO7+)|OOQS-E:`-E:`O$;PQdO7+)|O$)nQdO,5S~O%cOS%^OSSOS%]PQ~OPdOVaOfoOhYOopOs!POvqO!PrO!Q{O!T!SO!U!RO!XZO!][O!h`O!r`O!s`O!t`O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#l!QO#o!TO#s!UO#u!VO#z!WO#}hO$P!XO%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~O%]!YO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%j![O%k!]O%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aO~Ok%xXl%xXm%xXn%xXo%xXp%xXs%xXz%xX{%xX!x%xX#g%xX%[%xX%_%xX%z%xXg%xX!T%xX!U%xX%{%xX!W%xX![%xX!Q%xX#[%xXt%xX!m%xX~P%SOfoOhYO!XZO!][O!h`O!r`O!s`O!t`O%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~Oz%wX{%wX#g%wX%[%wX%_%wX%z%wX~Ok!pOl!qOm!oOn!oOo!rOp!sOs!tO!x%wX~P)pOV!zOg!|Oo0cOv0qO!PrO~P'vOV#OOo0cOv0qO!W#PO~P'vOV#SOa#TOo0cOv0qO![#UO~P'vOQ#XO%`#XO%a#ZO~OQ#^OR#[O%`#^O%a#`O~OV%iX_%iXa%iXh%iXk%iXl%iXm%iXn%iXo%iXp%iXs%iXz%iX!X%iX!f%iX%j%iX%k%iX%l%iX%m%iX%n%iX%o%iX%p%iX%q%iX%r%iX%s%iXg%iX!T%iX!U%iX~O&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O{%iX!x%iX#g%iX%[%iX%_%iX%z%iX%{%iX!W%iX![%iX!Q%iX#[%iXt%iX!m%iX~P,eOz#dO{%hX!x%hX#g%hX%[%hX%_%hX%z%hX~Oo0cOv0qO~P'vO#g#gO%[#iO%_#iO~O%uWO~O!T#nO#u!VO#z!WO#}hO~OopO~P'vOV#sOa#tO%uWO{wP~OV#xOo0cOv0qO!Q#yO~P'vO{#{O!x$QO%z#|O#g!yX%[!yX%_!yX~OV#xOo0cOv0qO#g#SX%[#SX%_#SX~P'vOo0cOv0qO#g#WX%[#WX%_#WX~P'vOh$WO%uWO~O!f$YO!r$YO%uWO~OV$eO~P'vO!U$gO#s$hO#u$iO~O{$jO~OV$qO~P'vOS$sO%[$rO%_$rO%c$tO~OV$}Oa$}Og%POo0cOv0qO~P'vOo0cOv0qO{%SO~P'vO&Y%UO~Oa!bOh!iO!X!kO!f!mOVba_bakbalbambanbaobapbasbazba{ba!xba#gba%[ba%_ba%jba%kba%lba%mba%nba%oba%pba%qba%rba%sba%zbagba!Tba!Uba%{ba!Wba![ba!Qba#[batba!mba~On%ZO~Oo%ZO~P'vOo0cO~P'vOk0eOl0fOm0dOn0dOo0mOp0nOs0rOg%wX!T%wX!U%wX%{%wX!W%wX![%wX!Q%wX#[%wX!m%wX~P)pO%{%]Og%vXz%vX!T%vX!U%vX!W%vX{%vX~Og%_Oz%`O!T%dO!U%cO~Og%_O~Oz%gO!T%dO!U%cO!W&SX~O!W%kO~Oz%lO{%nO!T%dO!U%cO![%}X~O![%rO~O![%sO~OQ#XO%`#XO%a%uO~OV%wOo0cOv0qO!PrO~P'vOQ#^OR#[O%`#^O%a%zO~OV!qa_!qaa!qah!qak!qal!qam!qan!qao!qap!qas!qaz!qa{!qa!X!qa!f!qa!x!qa#g!qa%[!qa%_!qa%j!qa%k!qa%l!qa%m!qa%n!qa%o!qa%p!qa%q!qa%r!qa%s!qa%z!qag!qa!T!qa!U!qa%{!qa!W!qa![!qa!Q!qa#[!qat!qa!m!qa~P#yOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P%SOV&OOopOvqO{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P'vOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#g$zX%[$zX%_$zX~P'vO#g#gO%[&TO%_&TO~O!f&UOh&sX%[&sXz&sX#[&sX#g&sX%_&sX#Z&sXg&sX~Oh!iO%[&WO~Okealeameaneaoeapeaseazea{ea!xea#gea%[ea%_ea%zeagea!Tea!Uea%{ea!Wea![ea!Qea#[eatea!mea~P%SOsqazqa{qa#gqa%[qa%_qa%zqa~Ok!pOl!qOm!oOn!oOo!rOp!sO!xqa~PEcO%z&YOz%yX{%yX~O%uWOz%yX{%yX~Oz&]O{wX~O{&_O~Oz%lO#g%}X%[%}X%_%}Xg%}X{%}X![%}X!m%}X%z%}X~OV0lOo0cOv0qO!PrO~P'vO%z#|O#gUa%[Ua%_Ua~Oz&hO#g&PX%[&PX%_&PXn&PX~P%SOz&kO!Q&jO#g#Wa%[#Wa%_#Wa~Oz&lO#[&nO#g&rX%[&rX%_&rXg&rX~O!f$YO!r$YO#Z&qO%uWO~O#Z&qO~Oz&sO#g&tX%[&tX%_&tX~Oz&uO#g&pX%[&pX%_&pX{&pX~O!X&wO%z&xO~Oz&|On&wX~P%SOn'PO~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO%['UO~P'vOt'YO#p'WO#q'XOP#naV#naf#nah#nao#nas#nav#na!P#na!Q#na!T#na!U#na!X#na!]#na!h#na!r#na!s#na!t#na!{#na!}#na#P#na#R#na#T#na#X#na#Z#na#^#na#_#na#a#na#c#na#l#na#o#na#s#na#u#na#z#na#}#na$P#na%X#na%o#na%p#na%t#na%u#na&Z#na&[#na&]#na&^#na&_#na&`#na&a#na&b#na&c#na&d#na&e#na&f#na&g#na&h#na&i#na&j#na%Z#na%_#na~Oz'ZO#[']O{&xX~Oh'_O!X&wO~Oh!iO{$jO!X&wO~O{'eO~P%SO%['hO%_'hO~OS'iO%['hO%_'hO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%k!]O~P!#uO%kWi~P!#uOV!aO_!aOa!bOh!iO!X!kO!f!mO%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%m!_O%n!_O~P!&pO%mWi%nWi~P!&pOa!bOh!iO!X!kO!f!mOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%mWi%nWi%oWi%pWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~OV!aO_!aO%q!aO%r!aO%s!aO~P!)nOVWi_Wi%qWi%rWi%sWi~P!)nO!T%dO!U%cOg&VXz&VX~O%z'kO%{'kO~P,eOz'mOg&UX~Og'oO~Oz'pO{'rO!W&XX~Oo0cOv0qOz'pO{'sO!W&XX~P'vO!W'uO~Om!oOn!oOo!rOp!sOkjisjizji{ji!xji#gji%[ji%_ji%zji~Ol!qO~P!.aOlji~P!.aOk0eOl0fOm0dOn0dOo0mOp0nO~Ot'wO~P!/jOV'|Og'}Oo0cOv0qO~P'vOg'}Oz(OO~Og(QO~O!U(SO~Og(TOz(OO!T%dO!U%cO~P%SOk0eOl0fOm0dOn0dOo0mOp0nOgqa!Tqa!Uqa%{qa!Wqa![qa!Qqa#[qatqa!mqa~PEcOV'|Oo0cOv0qO!W&Sa~P'vOz(WO!W&Sa~O!W(XO~Oz(WO!T%dO!U%cO!W&Sa~P%SOV(]Oo0cOv0qO![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~P'vOz(^O![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~O![(aO~Oz(^O!T%dO!U%cO![%}a~P%SOz(dO!T%dO!U%cO![&Ta~P%SOz(gO{&lX![&lX!m&lX%z&lX~O{(kO![(mO!m(nO%z(jO~OV&OOopOvqO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~P'vOz(pO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~O!f&UOh&sa%[&saz&sa#[&sa#g&sa%_&sa#Z&sag&sa~O%[(uO~OV#sOa#tO%uWO~Oz&]O{wa~OopOvqO~P'vOz(^O#g%}a%[%}a%_%}ag%}a{%}a![%}a!m%}a%z%}a~P%SOz(zO#g%hX%[%hX%_%hX%z%hX~O%z#|O#gUi%[Ui%_Ui~O#g&Pa%[&Pa%_&Pan&Pa~P'vOz(}O#g&Pa%[&Pa%_&Pan&Pa~O%uWO#g&ra%[&ra%_&rag&ra~Oz)SO#g&ra%[&ra%_&rag&ra~Og)VO~OV)WOh$WO%uWO~O#Z)XO~O%uWO#g&ta%[&ta%_&ta~Oz)ZO#g&ta%[&ta%_&ta~Oo0cOv0qO#g&pa%[&pa%_&pa{&pa~P'vOz)^O#g&pa%[&pa%_&pa{&pa~OV)`Oa)`O%uWO~O%z)eO~Ot)hO#j)gOP#hiV#hif#hih#hio#his#hiv#hi!P#hi!Q#hi!T#hi!U#hi!X#hi!]#hi!h#hi!r#hi!s#hi!t#hi!{#hi!}#hi#P#hi#R#hi#T#hi#X#hi#Z#hi#^#hi#_#hi#a#hi#c#hi#l#hi#o#hi#s#hi#u#hi#z#hi#}#hi$P#hi%X#hi%o#hi%p#hi%t#hi%u#hi&Z#hi&[#hi&]#hi&^#hi&_#hi&`#hi&a#hi&b#hi&c#hi&d#hi&e#hi&f#hi&g#hi&h#hi&i#hi&j#hi%Z#hi%_#hi~Ot)iOP#kiV#kif#kih#kio#kis#kiv#ki!P#ki!Q#ki!T#ki!U#ki!X#ki!]#ki!h#ki!r#ki!s#ki!t#ki!{#ki!}#ki#P#ki#R#ki#T#ki#X#ki#Z#ki#^#ki#_#ki#a#ki#c#ki#l#ki#o#ki#s#ki#u#ki#z#ki#}#ki$P#ki%X#ki%o#ki%p#ki%t#ki%u#ki&Z#ki&[#ki&]#ki&^#ki&_#ki&`#ki&a#ki&b#ki&c#ki&d#ki&e#ki&f#ki&g#ki&h#ki&i#ki&j#ki%Z#ki%_#ki~OV)kOn&wa~P'vOz)lOn&wa~Oz)lOn&wa~P%SOn)pO~O%Y)tO~Ot)wO#p'WO#q)vOP#niV#nif#nih#nio#nis#niv#ni!P#ni!Q#ni!T#ni!U#ni!X#ni!]#ni!h#ni!r#ni!s#ni!t#ni!{#ni!}#ni#P#ni#R#ni#T#ni#X#ni#Z#ni#^#ni#_#ni#a#ni#c#ni#l#ni#o#ni#s#ni#u#ni#z#ni#}#ni$P#ni%X#ni%o#ni%p#ni%t#ni%u#ni&Z#ni&[#ni&]#ni&^#ni&_#ni&`#ni&a#ni&b#ni&c#ni&d#ni&e#ni&f#ni&g#ni&h#ni&i#ni&j#ni%Z#ni%_#ni~OV)zOo0cOv0qO{$jO~P'vOo0cOv0qO{&xa~P'vOz*OO{&xa~OV*SOa*TOg*WO%q*UO%uWO~O{$jO&{*YO~Oh'_O~Oh!iO{$jO~O%[*_O~O%[*aO%_*aO~OV$}Oa$}Oo0cOv0qOg&Ua~P'vOz*dOg&Ua~Oo0cOv0qO{*gO!W&Xa~P'vOz*hO!W&Xa~Oo0cOv0qOz*hO{*kO!W&Xa~P'vOo0cOv0qOz*hO!W&Xa~P'vOz*hO{*kO!W&Xa~Om0dOn0dOo0mOp0nOgjikjisjizji!Tji!Uji%{ji!Wji{ji![ji#gji%[ji%_ji!Qji#[jitji!mji%zji~Ol0fO~P!NkOlji~P!NkOV'|Og*pOo0cOv0qO~P'vOn*rO~Og*pOz*tO~Og*uO~OV'|Oo0cOv0qO!W&Si~P'vOz*vO!W&Si~O!W*wO~OV(]Oo0cOv0qO![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~P'vOz*zO!T%dO!U%cO![&Ti~Oz*}O![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~O![+OO~Oa+QOo0cOv0qO![&Ti~P'vOz*zO![&Ti~O![+SO~OV+UOo0cOv0qO{&la![&la!m&la%z&la~P'vOz+VO{&la![&la!m&la%z&la~O!]+YO&n+[O![!nX~O![+^O~O{(kO![+_O~O{(kO![+_O!m+`O~OV&OOopOvqO{%hq!x%hq#g%hq%[%hq%_%hq%z%hq~P'vOz$ri{$ri!x$ri#g$ri%[$ri%_$ri%z$ri~P%SOV&OOopOvqO~P'vOV&OOo0cOv0qO#g%ha%[%ha%_%ha%z%ha~P'vOz+aO#g%ha%[%ha%_%ha%z%ha~Oz$ia#g$ia%[$ia%_$ian$ia~P%SO#g&Pi%[&Pi%_&Pin&Pi~P'vOz+dO#g#Wq%[#Wq%_#Wq~O#[+eOz$va#g$va%[$va%_$vag$va~O%uWO#g&ri%[&ri%_&rig&ri~Oz+gO#g&ri%[&ri%_&rig&ri~OV+iOh$WO%uWO~O%uWO#g&ti%[&ti%_&ti~Oo0cOv0qO#g&pi%[&pi%_&pi{&pi~P'vO{#{Oz#eX!W#eX~Oz+mO!W&uX~O!W+oO~Ot+rO#j)gOP#hqV#hqf#hqh#hqo#hqs#hqv#hq!P#hq!Q#hq!T#hq!U#hq!X#hq!]#hq!h#hq!r#hq!s#hq!t#hq!{#hq!}#hq#P#hq#R#hq#T#hq#X#hq#Z#hq#^#hq#_#hq#a#hq#c#hq#l#hq#o#hq#s#hq#u#hq#z#hq#}#hq$P#hq%X#hq%o#hq%p#hq%t#hq%u#hq&Z#hq&[#hq&]#hq&^#hq&_#hq&`#hq&a#hq&b#hq&c#hq&d#hq&e#hq&f#hq&g#hq&h#hq&i#hq&j#hq%Z#hq%_#hq~On$|az$|a~P%SOV)kOn&wi~P'vOz+yOn&wi~Oz,TO{$jO#[,TO~O#q,VOP#nqV#nqf#nqh#nqo#nqs#nqv#nq!P#nq!Q#nq!T#nq!U#nq!X#nq!]#nq!h#nq!r#nq!s#nq!t#nq!{#nq!}#nq#P#nq#R#nq#T#nq#X#nq#Z#nq#^#nq#_#nq#a#nq#c#nq#l#nq#o#nq#s#nq#u#nq#z#nq#}#nq$P#nq%X#nq%o#nq%p#nq%t#nq%u#nq&Z#nq&[#nq&]#nq&^#nq&_#nq&`#nq&a#nq&b#nq&c#nq&d#nq&e#nq&f#nq&g#nq&h#nq&i#nq&j#nq%Z#nq%_#nq~O#[,WOz%Oa{%Oa~Oo0cOv0qO{&xi~P'vOz,YO{&xi~O{#{O%z,[Og&zXz&zX~O%uWOg&zXz&zX~Oz,`Og&yX~Og,bO~O%Y,eO~O!T%dO!U%cOg&Viz&Vi~OV$}Oa$}Oo0cOv0qOg&Ui~P'vO{,hOz$la!W$la~Oo0cOv0qO{,iOz$la!W$la~P'vOo0cOv0qO{*gO!W&Xi~P'vOz,lO!W&Xi~Oo0cOv0qOz,lO!W&Xi~P'vOz,lO{,oO!W&Xi~Og$hiz$hi!W$hi~P%SOV'|Oo0cOv0qO~P'vOn,qO~OV'|Og,rOo0cOv0qO~P'vOV'|Oo0cOv0qO!W&Sq~P'vOz$gi![$gi#g$gi%[$gi%_$gig$gi{$gi!m$gi%z$gi~P%SOV(]Oo0cOv0qO~P'vOa+QOo0cOv0qO![&Tq~P'vOz,sO![&Tq~O![,tO~OV(]Oo0cOv0qO![%}q#g%}q%[%}q%_%}qg%}q{%}q!m%}q%z%}q~P'vO{,uO~OV+UOo0cOv0qO{&li![&li!m&li%z&li~P'vOz,zO{&li![&li!m&li%z&li~O!]+YO&n+[O![!na~O{(kO![,}O~OV&OOo0cOv0qO#g%hi%[%hi%_%hi%z%hi~P'vOz-OO#g%hi%[%hi%_%hi%z%hi~O%uWO#g&rq%[&rq%_&rqg&rq~Oz-RO#g&rq%[&rq%_&rqg&rq~OV)`Oa)`O%uWO!W&ua~Oz-TO!W&ua~On$|iz$|i~P%SOV)kO~P'vOV)kOn&wq~P'vOt-XOP#myV#myf#myh#myo#mys#myv#my!P#my!Q#my!T#my!U#my!X#my!]#my!h#my!r#my!s#my!t#my!{#my!}#my#P#my#R#my#T#my#X#my#Z#my#^#my#_#my#a#my#c#my#l#my#o#my#s#my#u#my#z#my#}#my$P#my%X#my%o#my%p#my%t#my%u#my&Z#my&[#my&]#my&^#my&_#my&`#my&a#my&b#my&c#my&d#my&e#my&f#my&g#my&h#my&i#my&j#my%Z#my%_#my~O%Z-]O%_-]O~P`O#q-^OP#nyV#nyf#nyh#nyo#nys#nyv#ny!P#ny!Q#ny!T#ny!U#ny!X#ny!]#ny!h#ny!r#ny!s#ny!t#ny!{#ny!}#ny#P#ny#R#ny#T#ny#X#ny#Z#ny#^#ny#_#ny#a#ny#c#ny#l#ny#o#ny#s#ny#u#ny#z#ny#}#ny$P#ny%X#ny%o#ny%p#ny%t#ny%u#ny&Z#ny&[#ny&]#ny&^#ny&_#ny&`#ny&a#ny&b#ny&c#ny&d#ny&e#ny&f#ny&g#ny&h#ny&i#ny&j#ny%Z#ny%_#ny~Oz-aO{$jO#[-aO~Oo0cOv0qO{&xq~P'vOz-dO{&xq~O%z,[Og&zaz&za~O{#{Og&zaz&za~OV*SOa*TO%q*UO%uWOg&ya~Oz-hOg&ya~O$S-lO~OV$}Oa$}Oo0cOv0qO~P'vOo0cOv0qO{-mOz$li!W$li~P'vOo0cOv0qOz$li!W$li~P'vO{-mOz$li!W$li~Oo0cOv0qO{*gO~P'vOo0cOv0qO{*gO!W&Xq~P'vOz-pO!W&Xq~Oo0cOv0qOz-pO!W&Xq~P'vOs-sO!T%dO!U%cOg&Oq!W&Oq![&Oqz&Oq~P!/jOa+QOo0cOv0qO![&Ty~P'vOz$ji![$ji~P%SOa+QOo0cOv0qO~P'vOV+UOo0cOv0qO~P'vOV+UOo0cOv0qO{&lq![&lq!m&lq%z&lq~P'vO{(kO![-xO!m-yO%z-wO~OV&OOo0cOv0qO#g%hq%[%hq%_%hq%z%hq~P'vO%uWO#g&ry%[&ry%_&ryg&ry~OV)`Oa)`O%uWO!W&ui~Ot-}OP#m!RV#m!Rf#m!Rh#m!Ro#m!Rs#m!Rv#m!R!P#m!R!Q#m!R!T#m!R!U#m!R!X#m!R!]#m!R!h#m!R!r#m!R!s#m!R!t#m!R!{#m!R!}#m!R#P#m!R#R#m!R#T#m!R#X#m!R#Z#m!R#^#m!R#_#m!R#a#m!R#c#m!R#l#m!R#o#m!R#s#m!R#u#m!R#z#m!R#}#m!R$P#m!R%X#m!R%o#m!R%p#m!R%t#m!R%u#m!R&Z#m!R&[#m!R&]#m!R&^#m!R&_#m!R&`#m!R&a#m!R&b#m!R&c#m!R&d#m!R&e#m!R&f#m!R&g#m!R&h#m!R&i#m!R&j#m!R%Z#m!R%_#m!R~Oo0cOv0qO{&xy~P'vOV*SOa*TO%q*UO%uWOg&yi~O$S-lO%Z.VO%_.VO~OV.aOh._O!X.^O!].`O!h.YO!s.[O!t.[O%p.XO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O~Oo0cOv0qOz$lq!W$lq~P'vO{.fOz$lq!W$lq~Oo0cOv0qO{*gO!W&Xy~P'vOz.gO!W&Xy~Oo0cOv.kO~P'vOs-sO!T%dO!U%cOg&Oy!W&Oy![&Oyz&Oy~P!/jO{(kO![.nO~O{(kO![.nO!m.oO~OV*SOa*TO%q*UO%uWO~Oh.tO!f.rOz$TX#[$TX%j$TXg$TX~Os$TX{$TX!W$TX![$TX~P$-bO%o.vO%p.vOs$UXz$UX{$UX#[$UX%j$UX!W$UXg$UX![$UX~O!h.xO~Oz.|O#[/OO%j.yOs&|X{&|X!W&|Xg&|X~Oa/RO~P$)zOh.tOs&}Xz&}X{&}X#[&}X%j&}X!W&}Xg&}X![&}X~Os/VO{$jO~Oo0cOv0qOz$ly!W$ly~P'vOo0cOv0qO{*gO!W&X!R~P'vOz/ZO!W&X!R~Og&RXs&RX!T&RX!U&RX!W&RX![&RXz&RX~P!/jOs-sO!T%dO!U%cOg&Qa!W&Qa![&Qaz&Qa~O{(kO![/^O~O!f.rOh$[as$[az$[a{$[a#[$[a%j$[a!W$[ag$[a![$[a~O!h/eO~O%o.vO%p.vOs$Uaz$Ua{$Ua#[$Ua%j$Ua!W$Uag$Ua![$Ua~O%j.yOs$Yaz$Ya{$Ya#[$Ya!W$Yag$Ya![$Ya~Os&|a{&|a!W&|ag&|a~P$)nOz/jOs&|a{&|a!W&|ag&|a~O!W/mO~Og/mO~O{/oO~O![/pO~Oo0cOv0qO{*gO!W&X!Z~P'vO{/sO~O%z/tO~P$-bOz/uO#[/OO%j.yOg'PX~Oz/uOg'PX~Og/wO~O!h/xO~O#[/OOs%Saz%Sa{%Sa%j%Sa!W%Sag%Sa![%Sa~O#[/OO%j.yOs%Waz%Wa{%Wa!W%Wag%Wa~Os&|i{&|i!W&|ig&|i~P$)nOz/zO#[/OO%j.yO!['Oa~Og'Pa~P$)nOz0SOg'Pa~Oa0UO!['Oi~P$)zOz0WO!['Oi~Oz0WO#[/OO%j.yO!['Oi~O#[/OO%j.yOg$biz$bi~O%z0ZO~P$-bO#[/OO%j.yOg%Vaz%Va~Og'Pi~P$)nO{0^O~Oa0UO!['Oq~P$)zOz0`O!['Oq~O#[/OO%j.yOz%Ui![%Ui~Oa0UO~P$)zOa0UO!['Oy~P$)zO#[/OO%j.yOg$ciz$ci~O#[/OO%j.yOz%Uq![%Uq~Oz+aO#g%ha%[%ha%_%ha%z%ha~P%SOV&OOo0cOv0qO~P'vOn0hO~Oo0hO~P'vO{0iO~Ot0jO~P!/jO&]&Z&j&h&i&g&f&d&e&c&b&`&a&_&^&[%u~",goto:"!=j'QPPPPPP'RP'Z*s+[+t,_,y-fP.SP'Z.r.r'ZPPP'Z2[PPPPPP2[5PPP5PP7b7k=sPP=v>h>kPP'Z'ZPP>zPP'Z'ZPP'Z'Z'Z'Z'Z?O?w'ZP?zP@QDXGuGyPG|HWH['ZPPPH_Hk'RP'R'RP'RP'RP'RP'RP'R'R'RP'RPP'RPP'RP'RPHqH}IVPI^IdPI^PI^I^PPPI^PKrPK{LVL]KrPI^LfPI^PLmLsPLwM]MzNeLwLwNkNxLwLwLwLw! ^! d! g! l! o! y!!P!!]!!o!!u!#P!#V!#s!#y!$P!$Z!$a!$g!$y!%T!%Z!%a!%k!%q!%w!%}!&T!&Z!&e!&k!&u!&{!'U!'[!'k!'s!'}!(UPPPPPPPPPPP!([!(_!(e!(n!(x!)TPPPPPPPPPPPP!-u!/Z!3^!6oPP!6w!7W!7a!8Y!8P!8c!8i!8l!8o!8r!8z!9jPPPPPPPPPPPPPPPPP!9m!9q!9wP!:]!:a!:m!:v!;S!;j!;m!;p!;v!;|!_![!]Do!]!^Es!^!_FZ!_!`Gk!`!aHX!a!b%T!b!cIf!c!dJU!d!eK^!e!hJU!h!i!#f!i!tJU!t!u!,|!u!wJU!w!x!.t!x!}JU!}#O!0S#O#P&o#P#Q!0j#Q#R!1Q#R#SJU#S#T%T#T#UJU#U#VK^#V#YJU#Y#Z!#f#Z#fJU#f#g!,|#g#iJU#i#j!.t#j#oJU#o#p!1n#p#q!1s#q#r!2a#r#s!2f#s$g%T$g;'SJU;'S;=`KW<%lOJU`%YT&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T`%lP;=`<%l%To%v]&n`%c_OX%TXY%oY[%T[]%o]p%Tpq%oq#O%T#O#P&o#P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To&tX&n`OY%TYZ%oZ]%T]^%o^#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc'f[&n`O!_%T!_!`([!`#T%T#T#U(r#U#f%T#f#g(r#g#h(r#h#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(cTmR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(yT!mR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk)aV&n`&[ZOr%Trs)vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk){V&n`Or%Trs*bs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk*iT&n`&^ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To+PZS_&n`OY*xYZ%TZ]*x]^%T^#o*x#o#p+r#p#q*x#q#r+r#r;'S*x;'S;=`,^<%lO*x_+wTS_OY+rZ]+r^;'S+r;'S;=`,W<%lO+r_,ZP;=`<%l+ro,aP;=`<%l*xj,kV%rQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-XT!xY&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-oV%lQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.]V&n`&ZZOw%Twx.rx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.wV&n`Ow%Twx/^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/eT&n`&]ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/{ThZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc0cTgR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk0yXVZ&n`Oz%Tz{1f{!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk1mVaR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk2ZV%oZ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc2wTzR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To3_W%pZ&n`O!_%T!_!`-Q!`!a3w!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Td4OT&{S&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk4fX!fQ&n`O!O%T!O!P5R!P!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5WV&n`O!O%T!O!P5m!P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5tT!rZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti6[a!hX&n`O!Q%T!Q![6T![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S6T#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti7fZ&n`O{%T{|8X|}%T}!O8X!O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8^V&n`O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8z]!hX&n`O!Q%T!Q![8s![!l%T!l!m9s!m#R%T#R#S8s#S#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti9zT!hX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk:bX%qR&n`O!P%T!P!Q:}!Q!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj;UV%sQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti;ro!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!d%T!d!e?q!e!g%T!g!h7a!h!l%T!l!m9s!m!q%T!q!rA]!r!z%T!z!{Bq!{#R%T#R#S>_#S#U%T#U#V?q#V#X%T#X#Y7a#Y#^%T#^#_9s#_#c%T#c#dA]#d#l%T#l#mBq#m#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti=xV&n`O!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti>fc!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S>_#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti?vY&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti@mY!hX&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiAbX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBUX!hX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBv]&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiCv]!hX&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToDvV{_&n`O!_%T!_!`E]!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TcEdT%{R&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkEzT#gZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkFbXmR&n`O!^%T!^!_F}!_!`([!`!a([!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjGUV%mQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkGrV%zZ&n`O!_%T!_!`([!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkH`WmR&n`O!_%T!_!`([!`!aHx!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjIPV%nQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkIoV_Q#}P&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToJ_]&n`&YS%uZO!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoKZP;=`<%lJUoKge&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!tJU!t!uLx!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#gLx#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoMRa&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUkN_V&n`&`ZOr%TrsNts#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkNyV&n`Or%Trs! `s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! gT&n`&bZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! }V&n`&_ZOw%Twx!!dx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!!iV&n`Ow%Twx!#Ox#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!#VT&n`&aZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!#oe&n`&YS%uZOr%Trs!%Qsw%Twx!&px!Q%T!Q![JU![!c%T!c!tJU!t!u!(`!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#g!(`#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!%XV&n`&dZOr%Trs!%ns#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!%sV&n`Or%Trs!&Ys#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&aT&n`&fZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&wV&n`&cZOw%Twx!'^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!'cV&n`Ow%Twx!'xx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!(PT&n`&eZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!(ia&n`&YS%uZOr%Trs!)nsw%Twx!+^x!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!)uV&n`&hZOr%Trs!*[s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*aV&n`Or%Trs!*vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*}T&n`&jZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!+eV&n`&gZOw%Twx!+zx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,PV&n`Ow%Twx!,fx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,mT&n`&iZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!-Vi&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[k6t,v6t,y6t,S6t,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:e=>A6t[e]||-1}],tokenPrec:7668}),Ase=new Dq,d6e=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function aj(e){return(t,n,i)=>{if(i)return!1;let r=t.node.getChild("VariableName");return r&&n(r,e),!0}}const _6t={FunctionDefinition:aj("function"),ClassDefinition:aj("class"),ForStatement(e,t,n){if(n){for(let i=e.node.firstChild;i;i=i.nextSibling)if(i.name=="VariableName")t(i,"variable");else if(i.name=="in")break}},ImportStatement(e,t){var n,i;let{node:r}=e,s=((n=r.firstChild)===null||n===void 0?void 0:n.name)=="from";for(let o=r.getChild("import");o;o=o.nextSibling)o.name=="VariableName"&&((i=o.nextSibling)===null||i===void 0?void 0:i.name)!="as"&&t(o,s?"variable":"namespace")},AssignStatement(e,t){for(let n=e.node.firstChild;n;n=n.nextSibling)if(n.name=="VariableName")t(n,"variable");else if(n.name==":"||n.name=="AssignOp")break},ParamList(e,t){for(let n=null,i=e.node.firstChild;i;i=i.nextSibling)i.name=="VariableName"&&(!n||!/\*|AssignOp/.test(n.name))&&t(i,"variable"),n=i},CapturePattern:aj("variable"),AsPattern:aj("variable"),__proto__:null};function f6e(e,t){let n=Ase.get(t);if(n)return n;let i=[],r=!0;function s(o,l){let c=e.sliceString(o.from,o.to);i.push({label:c,type:l})}return t.cursor(Sr.IncludeAnonymous).iterate(o=>{if(o.name){let l=_6t[o.name];if(l&&l(o,s,r)||!r&&d6e.has(o.name))return!1;r=!1}else if(o.to-o.from>8192){for(let l of f6e(e,o.node))i.push(l);return!1}}),Ase.set(t,i),i}const Tse=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,h6e=["String","FormatString","Comment","PropertyName"];function j6t(e){let t=Yr(e.state).resolveInner(e.pos,-1);if(h6e.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&Tse.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let i=[];for(let r=t;r;r=r.parent)d6e.has(r.name)&&(i=i.concat(f6e(e.state.doc,r)));return{options:i,from:n?t.from:e.pos,validFor:Tse}}const N6t=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(e=>({label:e,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(e=>({label:e,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(e=>({label:e,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(e=>({label:e,type:"function"}))),R6t=[Ys("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),Ys("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),Ys("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),Ys("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),Ys(`if \${}: +`);i=r<0?n:n.slice(0,r)}return t+i.length>this.to?i.slice(0,this.to-t):i}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(t,n,i=0){this.block=aP.create(t,i,this.lineStart+n,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(t,n,i=0){this.startContext(this.parser.getNodeType(t),n,i)}addNode(t,n,i){typeof t=="number"&&(t=new Ui(this.parser.nodeSet.types[t],g1,g1,(i??this.prevLineEnd())-n)),this.block.addChild(t,n-this.block.from)}addElement(t){this.block.addChild(t.toTree(this.parser.nodeSet),t.from-this.block.from)}addLeafElement(t,n){this.addNode(this.buffer.writeElements(f7(n.children,t.marks),-n.from).finish(n.type,n.to-n.from),n.from)}finishContext(){let t=this.stack.pop(),n=this.stack[this.stack.length-1];n.addChild(t.toTree(this.parser.nodeSet),t.from-n.from),this.block=n}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(t){return this.ranges.length>1?y$e(this.ranges,0,t.topNode,this.ranges[0].from,this.reusePlaceholders):t}finishLeaf(t){for(let i of t.parsers)if(i.finish(this,t))return;let n=f7(this.parser.parseInline(t.content,t.start),t.marks);this.addNode(this.buffer.writeElements(n,-t.start).finish(qt.Paragraph,t.content.length),t.start)}elt(t,n,i,r){return typeof t=="string"?ur(this.parser.getNodeType(t),n,i,r):new w$e(t,n)}get buffer(){return new x$e(this.parser.nodeSet)}}function y$e(e,t,n,i,r){let s=e[t].to,o=[],l=[],c=n.from+i;function u(d,f){for(;f?d>=s:d>s;){let h=e[t+1].from-s;i+=h,d+=h,t++,s=e[t].to}}for(let d=n.firstChild;d;d=d.nextSibling){u(d.from+i,!0);let f=d.from+i,h,m=r.get(d.tree);m?h=m:d.to+i>s?(h=y$e(e,t,d,i,r),u(d.to+i,!1)):h=d.toTree(),o.push(h),l.push(f-c)}return u(n.to+i,!1),new Ui(n.type,o,l,n.to+i-c,n.tree?n.tree.propValues:void 0)}class aL extends WM{constructor(t,n,i,r,s,o,l,c,u){super(),this.nodeSet=t,this.blockParsers=n,this.leafBlockParsers=i,this.blockNames=r,this.endLeafBlock=s,this.skipContextMarkup=o,this.inlineParsers=l,this.inlineNames=c,this.wrappers=u,this.nodeTypes=Object.create(null);for(let d of t.types)this.nodeTypes[d.name]=d.id}createParse(t,n,i){let r=new c3t(this,t,n,i);for(let s of this.wrappers)r=s(r,t,n,i);return r}configure(t){let n=d7(t);if(!n)return this;let{nodeSet:i,skipContextMarkup:r}=this,s=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),l=this.blockNames.slice(),c=this.inlineParsers.slice(),u=this.inlineNames.slice(),d=this.endLeafBlock.slice(),f=this.wrappers;if(Tk(n.defineNodes)){r=Object.assign({},r);let h=i.types.slice(),m;for(let g of n.defineNodes){let{name:b,block:v,composite:y,style:w}=typeof g=="string"?{name:g}:g;if(h.some(k=>k.name==b))continue;y&&(r[h.length]=(k,S,C)=>y(S,C,k.value));let x=h.length,O=y?["Block","BlockContext"]:v?x>=qt.ATXHeading1&&x<=qt.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;h.push(Za.define({id:x,name:b,props:O&&[[ui.group,O]]})),w&&(m||(m={}),Array.isArray(w)||w instanceof Yf?m[b]=w:Object.assign(m,w))}i=new hO(h),m&&(i=i.extend(ym(m)))}if(Tk(n.props)&&(i=i.extend(...n.props)),Tk(n.remove))for(let h of n.remove){let m=this.blockNames.indexOf(h),g=this.inlineNames.indexOf(h);m>-1&&(s[m]=o[m]=void 0),g>-1&&(c[g]=void 0)}if(Tk(n.parseBlock))for(let h of n.parseBlock){let m=l.indexOf(h.name);if(m>-1)s[m]=h.parse,o[m]=h.leaf;else{let g=h.before?aj(l,h.before):h.after?aj(l,h.after)+1:l.length-1;s.splice(g,0,h.parse),o.splice(g,0,h.leaf),l.splice(g,0,h.name)}h.endLeaf&&d.push(h.endLeaf)}if(Tk(n.parseInline))for(let h of n.parseInline){let m=u.indexOf(h.name);if(m>-1)c[m]=h.parse;else{let g=h.before?aj(u,h.before):h.after?aj(u,h.after)+1:u.length-1;c.splice(g,0,h.parse),u.splice(g,0,h.name)}}return n.wrap&&(f=f.concat(n.wrap)),new aL(i,s,o,l,d,r,c,u,f)}getNodeType(t){let n=this.nodeTypes[t];if(n==null)throw new RangeError(`Unknown node type '${t}'`);return n}parseInline(t,n){let i=new wW(this,t,n);e:for(let r=n;r=0){r=l;continue e}}r++}return i.resolveMarkers(0)}}function Tk(e){return e!=null&&e.length>0}function d7(e){if(!Array.isArray(e))return e;if(e.length==0)return null;let t=d7(e[0]);if(e.length==1)return t;let n=d7(e.slice(1));if(!n||!t)return t||n;let i=(o,l)=>(o||g1).concat(l||g1),r=t.wrap,s=n.wrap;return{props:i(t.props,n.props),defineNodes:i(t.defineNodes,n.defineNodes),parseBlock:i(t.parseBlock,n.parseBlock),parseInline:i(t.parseInline,n.parseInline),remove:i(t.remove,n.remove),wrap:r?s?(o,l,c,u)=>r(s(o,l,c,u),l,c,u):r:s}}function aj(e,t){let n=e.indexOf(t);if(n<0)throw new RangeError(`Position specified relative to unknown parser ${t}`);return n}let v$e=[Za.none];for(let e=1,t;t=qt[e];e++)v$e[e]=Za.define({id:e,name:t,props:e>=qt.Escape?[]:[[ui.group,e in l$e?["Block","BlockContext"]:["Block","LeafBlock"]]],top:t=="Document"});const g1=[];class x$e{constructor(t){this.nodeSet=t,this.content=[],this.nodes=[]}write(t,n,i,r=0){return this.content.push(t,n,i,4+r*4),this}writeElements(t,n=0){for(let i of t)i.writeTo(this,n);return this}finish(t,n){return Ui.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:t,length:n})}}let KC=class{constructor(t,n,i,r=g1){this.type=t,this.from=n,this.to=i,this.children=r}writeTo(t,n){let i=t.content.length;t.writeElements(this.children,n),t.content.push(this.type,this.from+n,this.to+n,t.content.length+4-i)}toTree(t){return new x$e(t).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class w$e{constructor(t,n){this.tree=t,this.from=n}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return g1}writeTo(t,n){t.nodes.push(this.tree),t.content.push(t.nodes.length-1,this.from+n,this.to+n,-1)}toTree(){return this.tree}}function ur(e,t,n,i){return new KC(e,t,n,i)}const O$e={resolve:"Emphasis",mark:"EmphasisMark"},k$e={resolve:"Emphasis",mark:"EmphasisMark"},ky={},oP={};class hu{constructor(t,n,i,r){this.type=t,this.from=n,this.to=i,this.side=r}}const Xre="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let GC=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{GC=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}const O$={Escape(e,t,n){if(t!=92||n==e.end-1)return-1;let i=e.char(n+1);for(let r=0;r]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(i);if(r)return e.append(ur(qt.Autolink,n,n+1+r[0].length,[ur(qt.LinkMark,n,n+1),ur(qt.URL,n+1,n+r[0].length),ur(qt.LinkMark,n+r[0].length,n+1+r[0].length)]));let s=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(i);if(s)return e.append(ur(qt.Comment,n,n+1+s[0].length));let o=/^\?[^]*?\?>/.exec(i);if(o)return e.append(ur(qt.ProcessingInstruction,n,n+1+o[0].length));let l=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(i);return l?e.append(ur(qt.HTMLTag,n,n+1+l[0].length)):-1},Emphasis(e,t,n){if(t!=95&&t!=42)return-1;let i=n+1;for(;e.char(i)==t;)i++;let r=e.slice(n-1,n),s=e.slice(i,i+1),o=GC.test(r),l=GC.test(s),c=/\s|^$/.test(r),u=/\s|^$/.test(s),d=!u&&(!l||c||o),f=!c&&(!o||u||l),h=d&&(t==42||!f||o),m=f&&(t==42||!d||l);return e.append(new hu(t==95?O$e:k$e,n,i,(h?1:0)|(m?2:0)))},HardBreak(e,t,n){if(t==92&&e.char(n+1)==10)return e.append(ur(qt.HardBreak,n,n+2));if(t==32){let i=n+1;for(;e.char(i)==32;)i++;if(e.char(i)==10&&i>=n+2)return e.append(ur(qt.HardBreak,n,i+1))}return-1},Link(e,t,n){return t==91?e.append(new hu(ky,n,n+1,1)):-1},Image(e,t,n){return t==33&&e.char(n+1)==91?e.append(new hu(oP,n,n+2,1)):-1},LinkEnd(e,t,n){if(t!=93)return-1;for(let i=e.parts.length-1;i>=0;i--){let r=e.parts[i];if(r instanceof hu&&(r.type==ky||r.type==oP)){if(!r.side||e.skipSpace(r.to)==n&&!/[(\[]/.test(e.slice(n+1,n+2)))return e.parts[i]=null,-1;let s=e.takeContent(i),o=e.parts[i]=u3t(e,s,r.type==ky?qt.Link:qt.Image,r.from,n+1);if(r.type==ky)for(let l=0;lt?ur(qt.URL,t+n,s+n):s==e.length?null:!1}}function E$e(e,t,n){let i=e.charCodeAt(t);if(i!=39&&i!=34&&i!=40)return!1;let r=i==40?41:i;for(let s=t+1,o=!1;s=this.end?-1:this.text.charCodeAt(t-this.offset)}get end(){return this.offset+this.text.length}slice(t,n){return this.text.slice(t-this.offset,n-this.offset)}append(t){return this.parts.push(t),t.to}addDelimiter(t,n,i,r,s){return this.append(new hu(t,n,i,(r?1:0)|(s?2:0)))}get hasOpenLink(){for(let t=this.parts.length-1;t>=0;t--){let n=this.parts[t];if(n instanceof hu&&(n.type==ky||n.type==oP))return!0}return!1}addElement(t){return this.append(t)}resolveMarkers(t){for(let i=t;i=t;c--){let b=this.parts[c];if(b instanceof hu&&b.side&1&&b.type==r.type&&!(s&&(r.side&1||b.side&2)&&(b.to-b.from+o)%3==0&&((b.to-b.from)%3||o%3))){l=b;break}}if(!l)continue;let u=r.type.resolve,d=[],f=l.from,h=r.to;if(s){let b=Math.min(2,l.to-l.from,o);f=l.to-b,h=r.from+b,u=b==1?"Emphasis":"StrongEmphasis"}l.type.mark&&d.push(this.elt(l.type.mark,f,l.to));for(let b=c+1;b=0;n--){let i=this.parts[n];if(i instanceof hu&&i.type==t&&i.side&1)return n}return null}takeContent(t){let n=this.resolveMarkers(t);return this.parts.length=t,n}getDelimiterAt(t){let n=this.parts[t];return n instanceof hu?n:null}skipSpace(t){return CE(this.text,t-this.offset)+this.offset}elt(t,n,i,r){return typeof t=="string"?ur(this.parser.getNodeType(t),n,i,r):new w$e(t,n)}}wW.linkStart=ky;wW.imageStart=oP;function f7(e,t){if(!t.length)return e;if(!e.length)return t;let n=e.slice(),i=0;for(let r of t){for(;i(t?t-1:0))return!1;if(this.fragmentEnd<0){let s=this.fragment.to;for(;s>0&&this.input.read(s-1,s)!=` +`;)s--;this.fragmentEnd=s?s-1:0}let i=this.cursor;i||(i=this.cursor=this.fragment.tree.cursor(),i.firstChild());let r=t+this.fragment.offset;for(;i.to<=r;)if(!i.parent())return!1;for(;;){if(i.from>=r)return this.fragment.from<=n;if(!i.childAfter(r))return!1}}matches(t){let n=this.cursor.tree;return n&&n.prop(ui.contextHash)==t}takeNodes(t){let n=this.cursor,i=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),s=t.absoluteLineStart,o=s,l=t.block.children.length,c=o,u=l;for(;;){if(n.to-i>r){if(n.type.isAnonymous&&n.firstChild())continue;break}let d=A$e(n.from-i,t.ranges);if(n.to-i<=t.ranges[t.rangeI].to)t.addNode(n.tree,d);else{let f=new Ui(t.parser.nodeSet.types[qt.Paragraph],[],[],0,t.block.hashProp);t.reusePlaceholders.set(f,n.tree),t.addNode(f,d)}if(n.type.is("Block")&&(d3t.indexOf(n.type.id)<0?(o=n.to-i,l=t.block.children.length):(o=c,l=u),c=n.to-i,u=t.block.children.length),!n.nextSibling())break}for(;t.block.children.length>l;)t.block.children.pop(),t.block.positions.pop();return o-s}}function A$e(e,t){let n=e;for(let i=1;isj[e]),Object.keys(sj).map(e=>b$e[e]),Object.keys(sj),o3t,l$e,Object.keys(O$).map(e=>O$[e]),Object.keys(O$),[]);function m3t(e,t,n){let i=[];for(let r=e.firstChild,s=t;;r=r.nextSibling){let o=r?r.from:n;if(o>s&&i.push({from:s,to:o}),!r)break;s=r.to}return i}function g3t(e){let{codeParser:t,htmlParser:n}=e;return{wrap:Q5e((r,s)=>{let o=r.type.id;if(t&&(o==qt.CodeBlock||o==qt.FencedCode)){let l="";if(o==qt.FencedCode){let u=r.node.getChild(qt.CodeInfo);u&&(l=s.read(u.from,u.to))}let c=t(l);if(c)return{parser:c,overlay:u=>u.type.id==qt.CodeText,bracketed:o==qt.FencedCode}}else if(n&&(o==qt.HTMLBlock||o==qt.HTMLTag||o==qt.CommentBlock))return{parser:n,overlay:m3t(r.node,r.from,r.to)};return null})}}const b3t={resolve:"Strikethrough",mark:"StrikethroughMark"},y3t={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":he.strikethrough}},{name:"StrikethroughMark",style:he.processingInstruction}],parseInline:[{name:"Strikethrough",parse(e,t,n){if(t!=126||e.char(n+1)!=126||e.char(n+2)==126)return-1;let i=e.slice(n-1,n),r=e.slice(n+2,n+3),s=/\s|^$/.test(i),o=/\s|^$/.test(r),l=GC.test(i),c=GC.test(r);return e.addDelimiter(b3t,n,n+2,!o&&(!c||s||l),!s&&(!l||o||c))},after:"Emphasis"}]};function AE(e,t,n=0,i,r=0){let s=0,o=!0,l=-1,c=-1,u=!1,d=()=>{i.push(e.elt("TableCell",r+l,r+c,e.parser.parseInline(t.slice(l,c),r+l)))};for(let f=n;f-1)&&s++,o=!1,i&&(l>-1&&d(),i.push(e.elt("TableDelimiter",f+r,f+r+1))),l=c=-1):(u||h!=32&&h!=9)&&(l<0&&(l=f),c=f+1),u=!u&&h==92}return l>-1&&(s++,i&&d()),s}function Yre(e,t){for(let n=t;n\s]*\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class Zre{constructor(){this.rows=null}nextLine(t,n,i){if(this.rows==null){this.rows=!1;let r;if((n.next==45||n.next==58||n.next==124)&&T$e.test(r=n.text.slice(n.pos))){let s=[];AE(t,i.content,0,s,i.start)==AE(t,r,0)&&(this.rows=[t.elt("TableHeader",i.start,i.start+i.content.length,s),t.elt("TableDelimiter",t.lineStart+n.pos,t.lineStart+n.text.length)])}}else if(this.rows){let r=[];AE(t,n.text,n.pos,r,t.lineStart),this.rows.push(t.elt("TableRow",t.lineStart+n.pos,t.lineStart+n.text.length,r))}return!1}finish(t,n){return this.rows?(t.addLeafElement(n,t.elt("Table",n.start,n.start+n.content.length,this.rows)),!0):!1}}const v3t={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":he.heading}},"TableRow",{name:"TableCell",style:he.content},{name:"TableDelimiter",style:he.processingInstruction}],parseBlock:[{name:"Table",leaf(e,t){return Yre(t.content,0)?new Zre:null},endLeaf(e,t,n){if(n.parsers.some(r=>r instanceof Zre)||!Yre(t.text,t.basePos))return!1;let i=e.peekLine();return T$e.test(i)&&AE(e,t.text,t.basePos)==AE(e,i,t.basePos)},before:"SetextHeading"}]};class x3t{nextLine(){return!1}finish(t,n){return t.addLeafElement(n,t.elt("Task",n.start,n.start+n.content.length,[t.elt("TaskMarker",n.start,n.start+3),...t.parser.parseInline(n.content.slice(3),n.start+3)])),!0}}const w3t={defineNodes:[{name:"Task",block:!0,style:he.list},{name:"TaskMarker",style:he.atom}],parseBlock:[{name:"TaskList",leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name=="ListItem"?new x3t:null},after:"SetextHeading"}]},Jre=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,ese=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,O3t=/[\w-]+\.[\w-]+($|[/:])/,tse=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,nse=/\/[a-zA-Z\d@.]+/gy;function ise(e,t,n,i){let r=0;for(let s=t;s-1)return-1;let i=t+n[0].length;for(;;){let r=e[i-1],s;if(/[?!.,:*_~]/.test(r)||r==")"&&ise(e,t,i,")")>ise(e,t,i,"("))i--;else if(r==";"&&(s=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,i))))i=t+s.index;else break}return i}function rse(e,t){tse.lastIndex=t;let n=tse.exec(e);if(!n)return-1;let i=n[0][n[0].length-1];return i=="_"||i=="-"?-1:t+n[0].length-(i=="."?1:0)}const S3t={parseInline:[{name:"Autolink",parse(e,t,n){let i=n-e.offset;if(i&&/\w/.test(e.text[i-1]))return-1;Jre.lastIndex=i;let r=Jre.exec(e.text),s=-1;if(!r)return-1;if(r[1]||r[2]){if(s=k3t(e.text,i+r[0].length),s>-1&&e.hasOpenLink){let o=/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(i,s));s=i+o[0].length}}else r[3]?s=rse(e.text,i):(s=rse(e.text,i+r[0].length),s>-1&&r[0]=="xmpp:"&&(nse.lastIndex=s,r=nse.exec(e.text),r&&(s=r.index+r[0].length)));return s<0?-1:(e.addElement(e.elt("URL",n,s+e.offset)),s+e.offset)}}]},E3t=[v3t,w3t,y3t,S3t];function _$e(e,t,n){return(i,r,s)=>{if(r!=e||i.char(s+1)==e)return-1;let o=[i.elt(n,s,s+1)];for(let l=s+1;l=65&&e<=90||e==95||e>=97&&e<=122||e>=161}let lse=null,cse=null,use=0;function p7(e,t){let n=e.pos+t;if(use==n&&cse==e)return lse;let i=e.peek(t),r="";for(;Z3t(i);)r+=String.fromCharCode(i),i=e.peek(++t);return cse=e,use=n,lse=r?r.toLowerCase():i==J3t||i==e4t?void 0:null}const L$e=60,lP=62,kW=47,J3t=63,e4t=33,t4t=45;function dse(e,t){this.name=e,this.parent=t}const n4t=[OW,I$e,j$e,N$e,R$e],i4t=new rL({start:null,shift(e,t,n,i){return n4t.indexOf(t)>-1?new dse(p7(i,1)||"",e):e},reduce(e,t){return t==P$e&&e?e.parent:e},reuse(e,t,n,i){let r=t.type.id;return r==OW||r==q3t?new dse(p7(i,1)||"",e):e},strict:!1}),r4t=new Ia((e,t)=>{if(e.next!=L$e){e.next<0&&t.context&&e.acceptToken(k$);return}e.advance();let n=e.next==kW;n&&e.advance();let i=p7(e,0);if(i===void 0)return;if(!i)return e.acceptToken(n?B3t:F3t);let r=t.context?t.context.name:null;if(n){if(i==r)return e.acceptToken(M3t);if(r&&Y3t[r])return e.acceptToken(k$,-2);if(t.dialectEnabled(K3t))return e.acceptToken(L3t);for(let s=t.context;s;s=s.parent)if(s.name==i)return;e.acceptToken($3t)}else{if(i=="script")return e.acceptToken(j$e);if(i=="style")return e.acceptToken(N$e);if(i=="textarea")return e.acceptToken(R$e);if(X3t.hasOwnProperty(i))return e.acceptToken(I$e);r&&ose[r]&&ose[r][i]?e.acceptToken(k$,-1):e.acceptToken(OW)}},{contextual:!0}),s4t=new Ia(e=>{for(let t=0,n=0;;n++){if(e.next<0){n&&e.acceptToken(ase);break}if(e.next==t4t)t++;else if(e.next==lP&&t>=2){n>=3&&e.acceptToken(ase,-2);break}else t=0;e.advance()}});function a4t(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const o4t=new Ia((e,t)=>{if(e.next==kW&&e.peek(1)==lP){let n=t.dialectEnabled(G3t)||a4t(t.context);e.acceptToken(n?D3t:sse,2)}else e.next==lP&&e.acceptToken(sse,1)});function SW(e,t,n){let i=2+e.length;return new Ia(r=>{for(let s=0,o=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(t);break}if(s==0&&r.next==L$e||s==1&&r.next==kW||s>=2&&so?r.acceptToken(t,-o):r.acceptToken(n,-(o-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(t,1);break}else s=o=0;r.advance()}})}const l4t=SW("script",_3t,j3t),c4t=SW("style",N3t,R3t),u4t=SW("textarea",I3t,P3t),d4t=ym({"Text RawText IncompleteTag IncompleteCloseTag":he.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":he.angleBracket,TagName:he.tagName,"MismatchedCloseTag/TagName":[he.tagName,he.invalid],AttributeName:he.attributeName,"AttributeValue UnquotedAttributeValue":he.attributeValue,Is:he.definitionOperator,"EntityReference CharacterReference":he.character,Comment:he.blockComment,ProcessingInst:he.processingInstruction,DoctypeDecl:he.documentMeta}),f4t=am.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:",c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:i4t,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[d4t],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let u=l.type.id;if(u==z3t)return S$(l,c,n);if(u==V3t)return S$(l,c,i);if(u==H3t)return S$(l,c,r);if(u==P$e&&s.length){let d=l.node,f=d.firstChild,h=f&&fse(f,c),m;if(h){for(let g of s)if(g.tag==h&&(!g.attrs||g.attrs(m||(m=$$e(f,c))))){let b=d.lastChild,v=b.type.id==W3t?b.from:d.to;if(v>f.to)return{parser:g.parser,overlay:[{from:f.to,to:v}]}}}}if(o&&u==D$e){let d=l.node,f;if(f=d.firstChild){let h=o[c.read(f.from,f.to)];if(h)for(let m of h){if(m.tagName&&m.tagName!=fse(d.parent,c))continue;let g=d.lastChild;if(g.type.id==h7){let b=g.from+1,v=g.lastChild,y=g.to-(v&&v.isError?0:1);if(y>b)return{parser:m.parser,overlay:[{from:b,to:y}],bracketed:!0}}else if(g.type.id==M$e)return{parser:m.parser,overlay:[{from:g.from,to:g.to}]}}}}return null})}const h4t=145,hse=1,p4t=146,m4t=147,B$e=2,g4t=148,b4t=3,y4t=4,U$e=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],v4t=58,x4t=40,Q$e=95,w4t=91,qN=45,O4t=46,k4t=35,S4t=37,E4t=38,C4t=92,A4t=10,T4t=42;function XC(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function EW(e){return e>=48&&e<=57}function pse(e){return EW(e)||e>=97&&e<=102||e>=65&&e<=70}const z$e=(e,t,n)=>(i,r)=>{for(let s=!1,o=0,l=0;;l++){let{next:c}=i;if(XC(c)||c==qN||c==Q$e||s&&EW(c))!s&&(c!=qN||l>0)&&(s=!0),o===l&&c==qN&&o++,i.advance();else if(c==C4t&&i.peek(1)!=A4t){if(i.advance(),pse(i.next)){do i.advance();while(pse(i.next));i.next==32&&i.advance()}else i.next>-1&&i.advance();s=!0}else{s&&i.acceptToken(o==2&&r.canShift(B$e)?t:c==x4t?n:e);break}}},_4t=new Ia(z$e(p4t,B$e,m4t),{contextual:!0}),j4t=new Ia(z$e(g4t,b4t,y4t),{contextual:!0}),N4t=new Ia(e=>{if(U$e.includes(e.peek(-1))){let{next:t}=e;(XC(t)||t==Q$e||t==k4t||t==O4t||t==T4t||t==w4t||t==v4t&&XC(e.peek(1))||t==qN||t==E4t)&&e.acceptToken(h4t)}}),R4t=new Ia(e=>{if(!U$e.includes(e.peek(-1))){let{next:t}=e;if(t==S4t&&(e.advance(),e.acceptToken(hse)),XC(t)){do e.advance();while(XC(e.next)||EW(e.next));e.acceptToken(hse)}}}),I4t=ym({"AtKeyword import charset namespace keyframes media supports font-feature-values":he.definitionKeyword,"from to selector scope MatchFlag":he.keyword,NamespaceName:he.namespace,KeyframeName:he.labelName,KeyframeRangeName:he.operatorKeyword,TagName:he.tagName,ClassName:he.className,PseudoClassName:he.constant(he.className),IdName:he.labelName,"FeatureName PropertyName":he.propertyName,AttributeName:he.attributeName,NumberLiteral:he.number,KeywordQuery:he.keyword,UnaryQueryOp:he.operatorKeyword,"CallTag ValueName FontName":he.atom,VariableName:he.variableName,Callee:he.operatorKeyword,Unit:he.unit,"UniversalSelector NestingSelector":he.definitionOperator,"MatchOp CompareOp":he.compareOperator,"ChildOp SiblingOp, LogicOp":he.logicOperator,BinOp:he.arithmeticOperator,Important:he.modifier,Comment:he.blockComment,ColorLiteral:he.color,"ParenthesizedContent StringLiteral":he.string,":":he.punctuation,"PseudoOp #":he.derefOperator,"; , |":he.separator,"( )":he.paren,"[ ]":he.squareBracket,"{ }":he.brace}),P4t={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:152,"url-prefix":152,domain:152,regexp:152},D4t={__proto__:null,or:104,and:104,not:112,only:112,layer:206},M4t={__proto__:null,selector:118,style:124,layer:202},L4t={__proto__:null,"@import":198,"@media":210,"@charset":214,"@namespace":218,"@keyframes":224,"@supports":236,"@scope":240,"@font-feature-values":246},$4t={__proto__:null,to:243},F4t=am.deserialize({version:14,states:"MlQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FnO&XQdO'#CkO&xQaO'#CcO'SQdO'#CnO'_QdO'#EOO'dQdO'#EQO'oQdO'#EXO'oQdO'#E[OOQP'#Fn'#FnO)RQhO'#E}OOQS'#Fm'#FmOOQS'#FQ'#FQQYQdOOO)YQdO'#EbO*iQhO'#EhO)YQdO'#EjO*pQdO'#ElO*{QdO'#EoO)}QhO'#EuO+TQdO'#EwO+`QdO'#EzO+eQaO'#CfO+lQ`O'#E_O+qQ`O'#F{O+|QdO'#F{QOQ`OOP,WO&jO'#CaPOOO)CA])CA]OOQP'#Ci'#CiOOQP,59R,59RO%VQdO,59ROOQP'#Cm'#CmOOQP,59V,59VO&XQdO,59VO,cQdO,59YO'_QdO,5:jO'dQdO,5:lO'oQdO,5:sO'oQdO,5:uO'oQdO,5:vO'oQdO'#FXO,nQ`O,58}O,vQdO'#E^OOQS,58},58}OOQP'#Cq'#CqOOQO'#D|'#D|OOQP,59Y,59YO,}Q`O,59YO-SQ`O,59YOOQP'#EP'#EPOOQP,5:j,5:jO-XQpO'#ERO-dQdO'#ESO-iQ`O'#ESO-nQpO,5:lO.XQaO,5:sO.oQaO,5:vOOQW'#D^'#D^O/nQhO'#DgO0RQhO,5;iO)}QhO'#DeO0`Q`O'#DnO0eQhO'#DxOOQW'#Ft'#FtOOQS,5;i,5;iO0jQ`O'#DhO0oQ`O'#DkOOQS-E9O-E9OOOQ['#Cv'#CvO0tQdO'#CwO1[QdO'#C}O1rQdO'#DQO2YQ!pO'#DSO4fQ!jO,5:|OOQO'#DX'#DXO-SQ`O'#DWO4vQ!nO'#FqO6|Q`O'#DYO7RQ`O'#DyOOQ['#Fq'#FqO7WQhO'#GOO7fQ`O,5;SO7kQ!bO,5;UOOQS'#En'#EnO7sQ`O,5;WO7xQdO,5;WOOQO'#Eq'#EqO8QQ`O,5;ZO8VQhO,5;aO'oQdO'#DjOOQS,5;c,5;cO0jQ`O,5;cO8_QdO,5;cOOQS'#F`'#F`O8gQdO'#E|O7fQ`O,5;fO8oQdO,5:yO9PQdO'#FZO9^Q`O,5lQhO'#DoOOQW,5:Y,5:YOOQW,5:d,5:dOOQW,5:S,5:SO>vQhO,5:VO?bQ!fO'#FrOOQS'#Fr'#FrOOQS'#FS'#FSO@rQdO,59cOOQ[,59c,59cOAYQdO,59iOOQ[,59i,59iOApQdO,59lOOQ[,59l,59lOOQ[,59n,59nO)YQdO,59pOBWQhO'#EdOOQW'#Ed'#EdOBuQ`O1G0hO4oQhO1G0hOOQ[,59r,59rO)}QhO'#D[OOQ[,59t,59tOBzQ#tO,5:eOCVQhO'#F]OCdQ`O,5vQhO'#DmOI_QhO'#DqOIgQhO'#DsOIlQhO'#FwOOQO'#Fw'#FwOItQ!bO'#DwOOQO'#Fy'#FyOOQO'#Fv'#FvOIyQ`O1G/qOOQS-E9Q-E9QOOQ[1G.}1G.}OOQ[1G/T1G/TOOQ[1G/W1G/WOOQ[1G/[1G/[OJOQdO,5;OOOQS7+&S7+&SOJTQ`O7+&SOJYQhO'#D]OJbQ`O,59vO)}QhO,59vOOQ[1G0P1G0POJjQ`O1G0POJoQhO,5;wOOQO-E9Z-E9ZOOQS7+&^7+&^OJ}QbO'#DSOOQO'#Et'#EtOK]Q`O'#EsOOQO'#Es'#EsOKhQ`O'#F^OKpQdO,5;^OOQS,5;^,5;^OOQ[1G/p1G/pOOQS7+&i7+&iO7fQ`O7+&iOK{Q!fO'#FYO)YQdO'#FYOMSQdO7+&POOQO7+&P7+&POOQO,5:{,5:{OOQO1G1a1G1aOMgQ!bO<vQhO'#DrOOQO,5:],5:]O! hQhO,5:_OGUQhO,5:cOOQW7+%]7+%]OOQO'#Ef'#EfO! pQ`O1G0jOOQS<xAN>xO!#zQ`OAN>xO!$PQaO,5;rOOQO-E9U-E9UO!$ZQdO,5;qOOQO-E9T-E9TOOQW<vQhO'#DuOOQO1G/y1G/yO!%vQ!bO1G/}OJOQdO'#F[O!&OQ`O7+&UOOQW7+&U7+&UO!&WQ!bO1G/cOOQ[7+$|7+$|O!&cQhO7+$|P!&jQ`O'#FTOOQO,5;y,5;yOOQO-E9]-E9]OOQS1G1d1G1dOOQPG24dG24dO!&oQ`OAN>ZO)YQdO1G1[O!&tQ`O7+'jOOQO1G/x1G/xO!&|Q`O,5:aO!$eQhO7+%iOOQO,5;v,5;vOOQO-E9Y-E9YOOQW<Q!]!^>|!^!_?_!_!`@Z!`!a@n!a!b%Z!b!cAo!c!k%Z!k!lC|!l!u%Z!u!vC|!v!}%Z!}#OD_#O#P%Z#P#QDp#Q#R2X#R#]%Z#]#^ER#^#g%Z#g#hC|#h#o%Z#o#pIf#p#qIw#q#rJ`#r#sJq#s#y%Z#y#z&R#z$f%Z$f$g&R$g#BY%Z#BY#BZ&R#BZ$IS%Z$IS$I_&R$I_$I|%Z$I|$JO&R$JO$JT%Z$JT$JU&R$JU$KV%Z$KV$KW&R$KW&FU%Z&FU&FV&R&FV;'S%Z;'S;=`KY<%lO%Z`%^SOy%jz;'S%j;'S;=`%{<%lO%j`%oS!o`Oy%jz;'S%j;'S;=`%{<%lO%j`&OP;=`<%l%j~&Wh$[~OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%j~'yh$[~!o`OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%jj)jS$qYOy%jz;'S%j;'S;=`%{<%lO%j~)yWOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d<%lO)v~*hOw~~*kRO;'S)v;'S;=`*t;=`O)v~*wXOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d;=`<%l)v<%lO)v~+gP;=`<%l)vj+oYmYOy%jz!Q%j!Q![,_![!c%j!c!i,_!i#T%j#T#Z,_#Z;'S%j;'S;=`%{<%lO%jj,dY!o`Oy%jz!Q%j!Q![-S![!c%j!c!i-S!i#T%j#T#Z-S#Z;'S%j;'S;=`%{<%lO%jj-XY!o`Oy%jz!Q%j!Q![-w![!c%j!c!i-w!i#T%j#T#Z-w#Z;'S%j;'S;=`%{<%lO%jj.OYuY!o`Oy%jz!Q%j!Q![.n![!c%j!c!i.n!i#T%j#T#Z.n#Z;'S%j;'S;=`%{<%lO%jj.uYuY!o`Oy%jz!Q%j!Q![/e![!c%j!c!i/e!i#T%j#T#Z/e#Z;'S%j;'S;=`%{<%lO%jj/jY!o`Oy%jz!Q%j!Q![0Y![!c%j!c!i0Y!i#T%j#T#Z0Y#Z;'S%j;'S;=`%{<%lO%jj0aYuY!o`Oy%jz!Q%j!Q![1P![!c%j!c!i1P!i#T%j#T#Z1P#Z;'S%j;'S;=`%{<%lO%jj1UY!o`Oy%jz!Q%j!Q![1t![!c%j!c!i1t!i#T%j#T#Z1t#Z;'S%j;'S;=`%{<%lO%jj1{SuY!o`Oy%jz;'S%j;'S;=`%{<%lO%jd2[UOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jd2uS!yS!o`Oy%jz;'S%j;'S;=`%{<%lO%jb3WS^QOy%jz;'S%j;'S;=`%{<%lO%j~3gWOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{<%lO3d~4SRO;'S3d;'S;=`4];=`O3d~4`XOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{;=`<%l3d<%lO3d~5OP;=`<%l3dj5WShYOy%jz;'S%j;'S;=`%{<%lO%j~5iOg~n5pUWQyWOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jj6ZWyW#PQOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj6xU!o`Oy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%jj7cY!o`$gYOy%jz!Q%j!Q![7[![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj8WY!o`Oy%jz{%j{|8v|}%j}!O8v!O!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj8{U!o`Oy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj9fU!o`$gYOy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj:P[!o`$gYOy%jz!O%j!O!P7[!P!Q%j!Q![9x![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj:zS!dYOy%jz;'S%j;'S;=`%{<%lO%jj;]WyWOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj;zU`YOy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%j~VUcYOy%jz![%j![!]>i!];'S%j;'S;=`%{<%lO%jj>pSdY!o`Oy%jz;'S%j;'S;=`%{<%lO%jj?RSnYOy%jz;'S%j;'S;=`%{<%lO%jh?dU!WWOy%jz!_%j!_!`?v!`;'S%j;'S;=`%{<%lO%jh?}S!WW!o`Oy%jz;'S%j;'S;=`%{<%lO%jl@bS!WW!ySOy%jz;'S%j;'S;=`%{<%lO%jj@uV!|Q!WWOy%jz!_%j!_!`?v!`!aA[!a;'S%j;'S;=`%{<%lO%jbAcS!|Q!o`Oy%jz;'S%j;'S;=`%{<%lO%jjArYOy%jz}%j}!OBb!O!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjBgW!o`Oy%jz!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjCW[lY!o`Oy%jz}%j}!OCP!O!Q%j!Q![CP![!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jhDRS!zWOy%jz;'S%j;'S;=`%{<%lO%jjDdSpYOy%jz;'S%j;'S;=`%{<%lO%jnDuSo^Oy%jz;'S%j;'S;=`%{<%lO%jjEWU!zWOy%jz#a%j#a#bEj#b;'S%j;'S;=`%{<%lO%jbEoU!o`Oy%jz#d%j#d#eFR#e;'S%j;'S;=`%{<%lO%jbFWU!o`Oy%jz#c%j#c#dFj#d;'S%j;'S;=`%{<%lO%jbFoU!o`Oy%jz#f%j#f#gGR#g;'S%j;'S;=`%{<%lO%jbGWU!o`Oy%jz#h%j#h#iGj#i;'S%j;'S;=`%{<%lO%jbGoU!o`Oy%jz#T%j#T#UHR#U;'S%j;'S;=`%{<%lO%jbHWU!o`Oy%jz#b%j#b#cHj#c;'S%j;'S;=`%{<%lO%jbHoU!o`Oy%jz#h%j#h#iIR#i;'S%j;'S;=`%{<%lO%jbIYS$pQ!o`Oy%jz;'S%j;'S;=`%{<%lO%jjIkSsYOy%jz;'S%j;'S;=`%{<%lO%jfI|U$cUOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jjJeSrYOy%jz;'S%j;'S;=`%{<%lO%jfJvU#PQOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%j`K]P;=`<%l%Z",tokenizers:[N4t,R4t,_4t,j4t,1,2,3,4,new iP("m~RRYZ[z{a~~g~aO$_~~dP!P!Qg~lO$`~~",28,152)],topRules:{StyleSheet:[0,6],Styles:[1,126]},dynamicPrecedences:{94:1},specialized:[{term:147,get:e=>P4t[e]||-1},{term:148,get:e=>D4t[e]||-1},{term:4,get:e=>M4t[e]||-1},{term:28,get:e=>L4t[e]||-1},{term:146,get:e=>$4t[e]||-1}],tokenPrec:2405});let E$=null;function C$(){if(!E$&&typeof document=="object"&&document.body){let{style:e}=document.body,t=[],n=new Set;for(let i in e)i!="cssText"&&i!="cssFloat"&&typeof e[i]=="string"&&(/[A-Z]/.test(i)&&(i=i.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),n.has(i)||(t.push(i),n.add(i)));E$=t.sort().map(i=>({type:"property",label:i,apply:i+": "}))}return E$||[]}const mse=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(e=>({type:"class",label:e})),gse=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(e=>({type:"keyword",label:e})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(e=>({type:"constant",label:e}))),B4t=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(e=>({type:"type",label:e})),U4t=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(e=>({type:"keyword",label:e})),Zh=/^(\w[\w-]*|-\w[\w-]*|)$/,Q4t=/^-(-[\w-]*)?$/;function z4t(e,t){var n;if((e.name=="("||e.type.isError)&&(e=e.parent||e),e.name!="ArgList")return!1;let i=(n=e.parent)===null||n===void 0?void 0:n.firstChild;return(i==null?void 0:i.name)!="Callee"?!1:t.sliceString(i.from,i.to)=="var"}const bse=new Mq,V4t=["Declaration"];function H4t(e){for(let t=e;;){if(t.type.isTop)return t;if(!(t=t.parent))return e}}function V$e(e,t,n){if(t.to-t.from>4096){let i=bse.get(t);if(i)return i;let r=[],s=new Set,o=t.cursor(Sr.IncludeAnonymous);if(o.firstChild())do for(let l of V$e(e,o.node,n))s.has(l.label)||(s.add(l.label),r.push(l));while(o.nextSibling());return bse.set(t,r),r}else{let i=[],r=new Set;return t.cursor().iterate(s=>{var o;if(n(s)&&s.matchContext(V4t)&&((o=s.node.nextSibling)===null||o===void 0?void 0:o.name)==":"){let l=e.sliceString(s.from,s.to);r.has(l)||(r.add(l),i.push({label:l,type:"variable"}))}}),i}}const q4t=e=>t=>{let{state:n,pos:i}=t,r=Yr(n).resolveInner(i,-1),s=r.type.isError&&r.from==r.to-1&&n.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:C$(),validFor:Zh};if(r.name=="ValueName")return{from:r.from,options:gse,validFor:Zh};if(r.name=="PseudoClassName")return{from:r.from,options:mse,validFor:Zh};if(e(r)||(t.explicit||s)&&z4t(r,n.doc))return{from:e(r)||s?r.from:i,options:V$e(n.doc,H4t(r),e),validFor:Q4t};if(r.name=="TagName"){for(let{parent:c}=r;c;c=c.parent)if(c.name=="Block")return{from:r.from,options:C$(),validFor:Zh};return{from:r.from,options:B4t,validFor:Zh}}if(r.name=="AtKeyword")return{from:r.from,options:U4t,validFor:Zh};if(!t.explicit)return null;let o=r.resolve(i),l=o.childBefore(i);return l&&l.name==":"&&o.name=="PseudoClassSelector"?{from:i,options:mse,validFor:Zh}:l&&l.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:i,options:gse,validFor:Zh}:o.name=="Block"||o.name=="Styles"?{from:i,options:C$(),validFor:Zh}:null},W4t=q4t(e=>e.name=="VariableName"),cP=sm.define({name:"css",parser:F4t.configure({props:[vm.add({Declaration:Ow()}),xm.add({"Block KeyframeList":NT})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function K4t(){return new yb(cP,cP.data.of({autocomplete:W4t}))}const _k=["_blank","_self","_top","_parent"],A$=["ascii","utf-8","utf-16","latin1","latin1"],T$=["get","post","put","delete"],_$=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],ru=["true","false"],Pn={},G4t={a:{attrs:{href:null,ping:null,type:null,media:null,target:_k,hreflang:null}},abbr:Pn,address:Pn,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Pn,aside:Pn,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Pn,base:{attrs:{href:null,target:_k}},bdi:Pn,bdo:Pn,blockquote:{attrs:{cite:null}},body:Pn,br:Pn,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:_$,formmethod:T$,formnovalidate:["novalidate"],formtarget:_k,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Pn,center:Pn,cite:Pn,code:Pn,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:Pn,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Pn,div:Pn,dl:Pn,dt:Pn,em:Pn,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Pn,figure:Pn,footer:Pn,form:{attrs:{action:null,name:null,"accept-charset":A$,autocomplete:["on","off"],enctype:_$,method:T$,novalidate:["novalidate"],target:_k}},h1:Pn,h2:Pn,h3:Pn,h4:Pn,h5:Pn,h6:Pn,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Pn,hgroup:Pn,hr:Pn,html:{attrs:{manifest:null}},i:Pn,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:_$,formmethod:T$,formnovalidate:["novalidate"],formtarget:_k,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:Pn,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Pn,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:Pn,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:A$,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Pn,noscript:Pn,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Pn,param:{attrs:{name:null,value:null}},pre:Pn,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Pn,rt:Pn,ruby:Pn,samp:Pn,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:A$}},section:Pn,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Pn,source:{attrs:{src:null,type:null,media:null}},span:Pn,strong:Pn,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Pn,summary:Pn,sup:Pn,table:Pn,tbody:Pn,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Pn,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:Pn,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Pn,time:{attrs:{datetime:null}},title:Pn,tr:Pn,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Pn,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:Pn},H$e={accesskey:null,class:null,contenteditable:ru,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:ru,autocorrect:ru,autocapitalize:ru,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":ru,"aria-autocomplete":["inline","list","both","none"],"aria-busy":ru,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":ru,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":ru,"aria-hidden":ru,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":ru,"aria-multiselectable":ru,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":ru,"aria-relevant":null,"aria-required":ru,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},q$e="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of q$e)H$e[e]=null;class YC{constructor(t,n){this.tags={...G4t,...t},this.globalAttrs={...H$e,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}YC.default=new YC;function b1(e,t,n=e.length){if(!t)return"";let i=t.firstChild,r=i&&i.getChild("TagName");return r?e.sliceString(r.from,Math.min(r.to,n)):""}function y1(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function W$e(e,t,n){let i=n.tags[b1(e,y1(t))];return(i==null?void 0:i.children)||n.allTags}function CW(e,t){let n=[];for(let i=y1(t);i&&!i.type.isTop;i=y1(i.parent)){let r=b1(e,i);if(r&&i.lastChild.name=="CloseTag")break;r&&n.indexOf(r)<0&&(t.name=="EndTag"||t.from>=i.firstChild.to)&&n.push(r)}return n}const K$e=/^[:\-\.\w\u00b7-\uffff]*$/;function yse(e,t,n,i,r){let s=/\s*>/.test(e.sliceDoc(r,r+5))?"":">",o=y1(n,n.name=="StartTag"||n.name=="TagName");return{from:i,to:r,options:W$e(e.doc,o,t).map(l=>({label:l,type:"type"})).concat(CW(e.doc,n).map((l,c)=>({label:"/"+l,apply:"/"+l+s,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function vse(e,t,n,i){let r=/\s*>/.test(e.sliceDoc(i,i+5))?"":">";return{from:n,to:i,options:CW(e.doc,t).map((s,o)=>({label:s,apply:s+r,type:"type",boost:99-o})),validFor:K$e}}function X4t(e,t,n,i){let r=[],s=0;for(let o of W$e(e.doc,n,t))r.push({label:"<"+o,type:"type"});for(let o of CW(e.doc,n))r.push({label:"",type:"type",boost:99-s++});return{from:i,to:i,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Y4t(e,t,n,i,r){let s=y1(n),o=s?t.tags[b1(e.doc,s)]:null,l=o&&o.attrs?Object.keys(o.attrs):[],c=o&&o.globalAttrs===!1?l:l.length?l.concat(t.globalAttrNames):t.globalAttrNames;return{from:i,to:r,options:c.map(u=>({label:u,type:"property"})),validFor:K$e}}function Z4t(e,t,n,i,r){var s;let o=(s=n.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),l=[],c;if(o){let u=e.sliceDoc(o.from,o.to),d=t.globalAttrs[u];if(!d){let f=y1(n),h=f?t.tags[b1(e.doc,f)]:null;d=(h==null?void 0:h.attrs)&&h.attrs[u]}if(d){let f=e.sliceDoc(i,r).toLowerCase(),h='"',m='"';/^['"]/.test(f)?(c=f[0]=='"'?/^[^"]*$/:/^[^']*$/,h="",m=e.sliceDoc(r,r+1)==f[0]?"":f[0],f=f.slice(1),i++):c=/^[^\s<>='"]*$/;for(let g of d)l.push({label:g,apply:h+g+m,type:"constant"})}}return{from:i,to:r,options:l,validFor:c}}function G$e(e,t){let{state:n,pos:i}=t,r=Yr(n).resolveInner(i,-1),s=r.resolve(i);for(let o=i,l;s==r&&(l=r.childBefore(o));){let c=l.lastChild;if(!c||!c.type.isError||c.fromG$e(i,r)}const t$t=vh.parser.configure({top:"SingleExpression"}),X$e=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:i$e.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:r$e.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:s$e.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:t$t},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:vh.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:cP.parser}],Y$e=[{name:"style",parser:cP.parser.configure({top:"Styles"})}].concat(q$e.map(e=>({name:e,parser:vh.parser}))),Z$e=sm.define({name:"html",parser:f4t.configure({props:[vm.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].lengthe.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),WN=Z$e.configure({wrap:F$e(X$e,Y$e)});function n$t(e={}){let t="",n;e.matchClosingTags===!1&&(t="noMatch"),e.selfClosingTags===!0&&(t=(t?t+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(n=F$e((e.nestedLanguages||[]).concat(X$e),(e.nestedAttributes||[]).concat(Y$e)));let i=n?Z$e.configure({wrap:n,dialect:t}):t?WN.configure({dialect:t}):WN;return new yb(i,[WN.data.of({autocomplete:e$t(e)}),e.autoCloseTags!==!1?i$t:[],l7().support,K4t().support])}const xse=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),i$t=Jt.inputHandler.of((e,t,n,i,r)=>{if(e.composing||e.state.readOnly||t!=n||i!=">"&&i!="/"||!WN.isActiveAt(e.state,t,-1))return!1;let s=r(),{state:o}=s,l=o.changeByRange(c=>{var u,d,f;let h=o.doc.sliceString(c.from-1,c.to)==i,{head:m}=c,g=Yr(o).resolveInner(m,-1),b;if(h&&i==">"&&g.name=="EndTag"){let v=g.parent;if(((d=(u=v.parent)===null||u===void 0?void 0:u.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(b=b1(o.doc,v.parent,m))&&!xse.has(b)){let y=m+(o.doc.sliceString(m,m+1)===">"?1:0),w=``;return{range:c,changes:{from:m,to:y,insert:w}}}}else if(h&&i=="/"&&g.name=="IncompleteCloseTag"){let v=g.parent;if(g.from==m-2&&((f=v.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(b=b1(o.doc,v,m))&&!xse.has(b)){let y=m+(o.doc.sliceString(m,m+1)===">"?1:0),w=`${b}>`;return{range:ht.cursor(m+w.length,-1),changes:{from:m,to:y,insert:w}}}}return{range:c}});return l.changes.empty?!1:(e.dispatch([s,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),J$e=tL({commentTokens:{block:{open:""}}}),e6e=new ui,t6e=p3t.configure({props:[xm.add(e=>!e.is("Block")||e.is("Document")||m7(e)!=null||r$t(e)?void 0:(t,n)=>({from:n.doc.lineAt(t.from).to,to:t.to})),e6e.add(m7),vm.add({Document:()=>null}),Og.add({Document:J$e})]});function m7(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function r$t(e){return e.name=="OrderedList"||e.name=="BulletList"}function s$t(e,t){let n=e;for(;;){let i=n.nextSibling,r;if(!i||(r=m7(i.type))!=null&&r<=t)break;n=i}return n.to}const a$t=x4e.of((e,t,n)=>{for(let i=Yr(e).resolveInner(n,-1);i&&!(i.fromn)return{from:n,to:s}}return null});function AW(e){return new ku(J$e,e,[],"markdown")}const o$t=AW(t6e),l$t=t6e.configure([E3t,A3t,C3t,T3t,{props:[xm.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),uP=AW(l$t);function c$t(e,t){return n=>{if(n&&e){let i=null;if(n=/\S*/.exec(n)[0],typeof e=="function"?i=e(n):i=ZI.matchLanguageName(e,n,!0),i instanceof ZI)return i.support?i.support.language.parser:S0.getSkippingParser(i.load());if(i)return i.parser}return t?t.parser:null}}let j$=class{constructor(t,n,i,r,s,o,l){this.node=t,this.from=n,this.to=i,this.spaceBefore=r,this.spaceAfter=s,this.type=o,this.item=l}blank(t,n=!0){let i=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(t!=null){for(;i.length0;r--)i+=" ";return i+(n?this.spaceAfter:"")}}marker(t,n){let i=this.node.name=="OrderedList"?String(+i6e(this.item,t)[2]+n):"";return this.spaceBefore+i+this.type+this.spaceAfter}};function n6e(e,t){let n=[],i=[];for(let r=e;r;r=r.parent){if(r.name=="FencedCode")return i;(r.name=="ListItem"||r.name=="Blockquote")&&n.push(r)}for(let r=n.length-1;r>=0;r--){let s=n[r],o,l=t.lineAt(s.from),c=s.from-l.from;if(s.name=="Blockquote"&&(o=/^ *>( ?)/.exec(l.text.slice(c))))i.push(new j$(s,c,c+o[0].length,"",o[1],">",null));else if(s.name=="ListItem"&&s.parent.name=="OrderedList"&&(o=/^( *)\d+([.)])( *)/.exec(l.text.slice(c)))){let u=o[3],d=o[0].length;u.length>=4&&(u=u.slice(0,u.length-4),d-=4),i.push(new j$(s.parent,c,c+d,o[1],u,o[2],s))}else if(s.name=="ListItem"&&s.parent.name=="BulletList"&&(o=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(l.text.slice(c)))){let u=o[4],d=o[0].length;u.length>4&&(u=u.slice(0,u.length-4),d-=4);let f=o[2];o[3]&&(f+=o[3].replace(/[xX]/," ")),i.push(new j$(s.parent,c,c+d,o[1],u,f,s))}}return i}function i6e(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function N$(e,t,n,i=0){for(let r=-1,s=e;;){if(s.name=="ListItem"){let l=i6e(s,t),c=+l[2];if(r>=0){if(c!=r+1)return;n.push({from:s.from+l[1].length,to:s.from+l[0].length,insert:String(r+2+i)})}r=c}let o=s.nextSibling;if(!o)break;s=o}}function TW(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(mO)!=" ")return e;let i=Of(e,4,n),r="";for(let s=i;s>0;)s>=4?(r+=" ",s-=4):(r+=" ",s--);return r+e.slice(n)}const u$t=(e={})=>({state:t,dispatch:n})=>{let i=Yr(t),{doc:r}=t,s=null,o=t.changeByRange(l=>{if(!l.empty||!uP.isActiveAt(t,l.from,-1)&&!uP.isActiveAt(t,l.from,1))return s={range:l};let c=l.from,u=r.lineAt(c),d=n6e(i.resolveInner(c,-1),r);for(;d.length&&d[d.length-1].from>c-u.from;)d.pop();if(!d.length)return s={range:l};let f=d[d.length-1];if(f.to-f.spaceAfter.length>c-u.from)return s={range:l};let h=c>=f.to-f.spaceAfter.length&&!/\S/.test(u.text.slice(f.to));if(f.item&&h){let y=f.node.firstChild,w=f.node.getChild("ListItem","ListItem");if(y.to>=c||w&&w.to0&&!/[^\s>]/.test(r.lineAt(u.from-1).text)||e.nonTightLists===!1){let x=d.length>1?d[d.length-2]:null,O,k="";x&&x.item?(O=u.from+x.from,k=x.marker(r,1)):O=u.from+(x?x.to:0);let S=[{from:O,to:c,insert:k}];return f.node.name=="OrderedList"&&N$(f.item,r,S,-2),x&&x.node.name=="OrderedList"&&N$(x.item,r,S),{range:ht.cursor(O+k.length),changes:S}}else{let x=Ose(d,t,u);return{range:ht.cursor(c+x.length+1),changes:{from:u.from,insert:x+t.lineBreak}}}}if(f.node.name=="Blockquote"&&h&&u.from){let y=r.lineAt(u.from-1),w=/>\s*$/.exec(y.text);if(w&&w.index==f.from){let x=t.changes([{from:y.from+w.index,to:y.to},{from:u.from+f.from,to:u.to}]);return{range:l.map(x),changes:x}}}let m=[];f.node.name=="OrderedList"&&N$(f.item,r,m);let g=f.item&&f.item.from]*/.exec(u.text)[0].length>=f.to)for(let y=0,w=d.length-1;y<=w;y++)b+=y==w&&!g?d[y].marker(r,1):d[y].blank(yu.from&&/\s/.test(u.text.charAt(v-u.from-1));)v--;return b=TW(b,t),f$t(f.node,t.doc)&&(b=Ose(d,t,u)+t.lineBreak+b),m.push({from:v,to:c,insert:t.lineBreak+b}),{range:ht.cursor(v+b.length+1),changes:m}});return s?!1:(n(t.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)},d$t=u$t();function wse(e){return e.name=="QuoteMark"||e.name=="ListMark"}function f$t(e,t){if(e.name!="OrderedList"&&e.name!="BulletList")return!1;let n=e.firstChild,i=e.getChild("ListItem","ListItem");if(!i)return!1;let r=t.lineAt(n.to),s=t.lineAt(i.from),o=/^[\s>]*$/.test(r.text);return r.number+(o?0:1){let n=Yr(e),i=null,r=e.changeByRange(s=>{let o=s.from,{doc:l}=e;if(s.empty&&uP.isActiveAt(e,s.from)){let c=l.lineAt(o),u=n6e(h$t(n,o),l);if(u.length){let d=u[u.length-1],f=d.to-d.spaceAfter.length+(d.spaceAfter?1:0);if(o-c.from>f&&!/\S/.test(c.text.slice(f,o-c.from)))return{range:ht.cursor(c.from+f),changes:{from:c.from+f,to:o}};if(o-c.from==f&&(d.item&&c.from<=d.item.from||/^[\s>]*$/.test(c.text.slice(0,d.to)))){let h=c.from+d.from;if(d.item&&d.node.from{var n;let{main:i}=t.state.selection;if(i.empty)return!1;let r=(n=e.clipboardData)===null||n===void 0?void 0:n.getData("text/plain");if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r="https://"+r),!uP.isActiveAt(t.state,i.from,1)))return!1;let s=Yr(t.state),o=!1;return s.iterate({from:i.from,to:i.to,enter:l=>{(l.from>i.from||v$t.test(l.name))&&(o=!0)},leave:l=>{l.to=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}const x6t=new Ia((e,t)=>{let n;if(e.next<0)e.acceptToken(S$t);else if(t.context.flags&KN)I$(e.next)&&e.acceptToken(k$t,1);else if(((n=e.peek(-1))<0||I$(n))&&t.canShift(kse)){let i=0;for(;e.next==_W||e.next==oL;)e.advance(),i++;(e.next==A0||e.next==ZC||e.next==jW)&&e.acceptToken(kse,-i)}else I$(e.next)&&e.acceptToken(O$t,1)},{contextual:!0}),w6t=new Ia((e,t)=>{let n=t.context;if(n.flags)return;let i=e.peek(-1);if(i==A0||i==ZC){let r=0,s=0;for(;;){if(e.next==_W)r++;else if(e.next==oL)r+=8-r%8;else break;e.advance(),s++}r!=n.indent&&e.next!=A0&&e.next!=ZC&&e.next!=jW&&(r[e,t|d6e])),S6t=new rL({start:O6t,reduce(e,t,n,i){return e.flags&KN&&v6t.has(t)||(t==U$t||t==l6e)&&e.flags&d6e?e.parent:e},shift(e,t,n,i){return t==s6e?new GN(e,k6t(i.read(i.pos,n.pos)),0):t==a6e?e.parent:t==A$t||t==N$t||t==P$t||t==o6e?new GN(e,0,KN):Ase.has(t)?new GN(e,0,Ase.get(t)|e.flags&KN):e},hash(e){return e.hash}}),E6t=new Ia(e=>{for(let t=0;t<5;t++){if(e.next!="print".charCodeAt(t))return;e.advance()}if(!/\w/.test(String.fromCharCode(e.next)))for(let t=0;;t++){let n=e.peek(t);if(!(n==_W||n==oL)){n!=f6t&&n!=h6t&&n!=A0&&n!=ZC&&n!=jW&&e.acceptToken(w$t);return}}}),C6t=new Ia((e,t)=>{let{flags:n}=t.context,i=n&ap?u6e:c6e,r=(n&op)>0,s=!(n&lp),o=(n&cp)>0,l=e.pos;for(;!(e.next<0);)if(o&&e.next==g7)if(e.peek(1)==g7)e.advance(2);else{if(e.pos==l){e.acceptToken(o6e,1);return}break}else if(s&&e.next==Cse){if(e.pos==l){e.advance();let c=e.next;c>=0&&(e.advance(),A6t(e,c)),e.acceptToken(C$t);return}break}else if(e.next==Cse&&!s&&e.peek(1)>-1)e.advance(2);else if(e.next==i&&(!r||e.peek(1)==i&&e.peek(2)==i)){if(e.pos==l){e.acceptToken(Sse,r?3:1);return}break}else if(e.next==A0){if(r)e.advance();else if(e.pos==l){e.acceptToken(Sse);return}break}else e.advance();e.pos>l&&e.acceptToken(E$t)});function A6t(e,t){if(t==p6t)for(let n=0;n<2&&e.next>=48&&e.next<=55;n++)e.advance();else if(t==m6t)for(let n=0;n<2&&P$(e.next);n++)e.advance();else if(t==b6t)for(let n=0;n<4&&P$(e.next);n++)e.advance();else if(t==y6t)for(let n=0;n<8&&P$(e.next);n++)e.advance();else if(t==g6t&&e.next==g7){for(e.advance();e.next>=0&&e.next!=Ese&&e.next!=c6e&&e.next!=u6e&&e.next!=A0;)e.advance();e.next==Ese&&e.advance()}}const T6t=ym({'async "*" "**" FormatConversion FormatSpec':he.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":he.controlKeyword,"in not and or is del":he.operatorKeyword,"from def class global nonlocal lambda":he.definitionKeyword,import:he.moduleKeyword,"with as print":he.keyword,Boolean:he.bool,None:he.null,VariableName:he.variableName,"CallExpression/VariableName":he.function(he.variableName),"FunctionDefinition/VariableName":he.function(he.definition(he.variableName)),"ClassDefinition/VariableName":he.definition(he.className),PropertyName:he.propertyName,"CallExpression/MemberExpression/PropertyName":he.function(he.propertyName),Comment:he.lineComment,Number:he.number,String:he.string,FormatString:he.special(he.string),Escape:he.escape,UpdateOp:he.updateOperator,"ArithOp!":he.arithmeticOperator,BitOp:he.bitwiseOperator,CompareOp:he.compareOperator,AssignOp:he.definitionOperator,Ellipsis:he.punctuation,At:he.meta,"( )":he.paren,"[ ]":he.squareBracket,"{ }":he.brace,".":he.derefOperator,", ;":he.separator}),_6t={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},j6t=am.deserialize({version:14,states:"##jQ`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO5TQdO'#DoOOQS,5:Y,5:YO5hQdO'#HdOOQS,5:],5:]O5uQ!fO,5:]O5zQtO,59YO1lQdO,59bO1lQdO,59bO1lQdO,59bO8jQdO,59bO8oQdO,59bO8vQdO,59jO8}QdO'#HTO:TQdO'#HSOOQS'#HS'#HSOOQS'#D['#D[O:lQdO,59aO'vQdO,59aO:zQdO,59aOOQS,59y,59yO;PQdO,5:RO'vQdO,5:ROOQS,5:Q,5:QO;_QdO,5:QO;dQdO,5:XO'vQdO,5:XO'vQdO,5:VOOQS,5:U,5:UO;uQdO,5:UO;zQdO,5:WOOOW'#Fy'#FyOOOOQS'#Ds'#DsOOQS1G/w1G/wOOQS1G.|1G.|O!/[QtO1G.|O!/cQtO1G.|O1lQdO1G.|O!0OQdO1G/UOOQS'#DZ'#DZO0rQdO,59tOOQS1G.{1G.{O!0VQdO1G/eO!0gQdO1G/eO!0oQdO1G/fO'vQdO'#H[O!0tQdO'#H[O!0yQtO1G.{O!1ZQdO,59iO!2aQdO,5=zO!2qQdO,5=zO!2yQdO1G/mO!3OQtO1G/mOOQS1G/l1G/lO!3`QdO,5=uO!4VQdO,5=uO0rQdO1G/qO!4tQdO1G/sO!4yQtO1G/sO!5ZQtO1G/qOOQS1G/p1G/pOOQS1G/r1G/rOOOW-E9w-E9wOOQS1G/{1G/{O!5kQdO'#HxO0rQdO'#HxO!5|QdO,5>cOOOW-E9x-E9xOOQS1G/|1G/|OOQS-E9{-E9{O!6[Q#xO1G2zO!6{QtO1G2zO'vQdO,5kOOQS1G1`1G1`O!8RQdO1G1`OOQS'#DV'#DVO0rQdO,5=qOOQS,5=q,5=qO!8WQdO'#FrO!8cQdO,59oO!8kQdO1G/XO!8uQtO,5=uOOQS1G3`1G3`OOQS,5:m,5:mO!9fQdO'#GtOOQS,5jO!;ZQdO,5>jO1XQdO,5>jO!;lQdO,5>iOOQS-E:R-E:RO!;qQdO1G0lO!;|QdO1G0lO!lO!lO!hO!=VQdO,5>hO!=hQdO'#EpO0rQdO1G0tO!=sQdO1G0tO!=xQgO1G0zO!AvQgO1G0}O!EqQdO,5>oO!E{QdO,5>oO!FTQtO,5>oO0rQdO1G1PO!F_QdO1G1PO4iQdO1G1UO!!vQdO1G1WOOQV,5;a,5;aO!FdQfO,5;aO!FiQgO1G1QO!JjQdO'#GZO4iQdO1G1QO4iQdO1G1QO!JzQdO,5>pO!KXQdO,5>pO1XQdO,5>pOOQV1G1U1G1UO!KaQdO'#FSO!KrQ!fO1G1WO!KzQdO1G1WOOQV1G1]1G1]O4iQdO1G1]O!LPQdO1G1]O!LXQdO'#F^OOQV1G1b1G1bO!#ZQtO1G1bPOOO1G2v1G2vP!L^OSO1G2vOOQS,5=},5=}OOQS'#Dp'#DpO0rQdO,5=}O!LfQdO,5=|O!LyQdO,5=|OOQS1G/u1G/uO!MRQdO,5>PO!McQdO,5>PO!MkQdO,5>PO!NOQdO,5>PO!N`QdO,5>POOQS1G3j1G3jOOQS7+$h7+$hO!8kQdO7+$pO#!RQdO1G.|O#!YQdO1G.|OOQS1G/`1G/`OOQS,5<`,5<`O'vQdO,5<`OOQS7+%P7+%PO#!aQdO7+%POOQS-E9r-E9rOOQS7+%Q7+%QO#!qQdO,5=vO'vQdO,5=vOOQS7+$g7+$gO#!vQdO7+%PO##OQdO7+%QO##TQdO1G3fOOQS7+%X7+%XO##eQdO1G3fO##mQdO7+%XOOQS,5<_,5<_O'vQdO,5<_O##rQdO1G3aOOQS-E9q-E9qO#$iQdO7+%]OOQS7+%_7+%_O#$wQdO1G3aO#%fQdO7+%_O#%kQdO1G3gO#%{QdO1G3gO#&TQdO7+%]O#&YQdO,5>dO#&sQdO,5>dO#&sQdO,5>dOOQS'#Dx'#DxO#'UO&jO'#DzO#'aO`O'#HyOOOW1G3}1G3}O#'fQdO1G3}O#'nQdO1G3}O#'yQ#xO7+(fO#(jQtO1G2UP#)TQdO'#GOOOQS,5nQdO,5sQdO1G4OOOQS-E9y-E9yO#?^QdO1G4OO<[QdO'#H{OOOO'#D{'#D{OOOO'#F|'#F|O#?oO&jO,5:fOOOW,5>e,5>eOOOW7+)i7+)iO#?zQdO7+)iO#@SQdO1G2zO#@mQdO1G2zP'vQdO'#FuO0rQdO<mO#BQQdO,5>mOOQS1G0v1G0vOOQS<rO#KgQdO,5>rO#KrQdO,5>rO#K}QdO,5>qO#L`QdO,5>qOOQS1G1Y1G1YOOQS,5;p,5;pOOQV<VAN>VO$ oQdO<cAN>cO0rQdO1G1|O$!PQtO1G1|P$!ZQdO'#FvOOQS1G2R1G2RP$!hQdO'#F{O$!uQdO7+)jO$#`QdO,5>gOOOO-E9z-E9zOOOW<tO$4{QdO,5>tO1XQdO,5vO$)nQdO,5>vOOQS1G1p1G1pOOQS,5<[,5<[OOQU7+'P7+'PO$+zQdO1G/iO$)nQdO,5wO$8zQdO,5>wOOQS1G1s1G1sOOQS7+'S7+'SP$)nQdO'#GdO$9SQdO1G4bO$9^QdO1G4bO$9fQdO1G4bOOQS7+%T7+%TO$9tQdO1G1tO$:SQtO'#FaO$:ZQdO,5<}OOQS,5<},5<}O$:iQdO1G4cOOQS-E:a-E:aO$)nQdO,5<|O$:pQdO,5<|O$:uQdO7+)|OOQS-E:`-E:`O$;PQdO7+)|O$)nQdO,5S~O%cOS%^OSSOS%]PQ~OPdOVaOfoOhYOopOs!POvqO!PrO!Q{O!T!SO!U!RO!XZO!][O!h`O!r`O!s`O!t`O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#l!QO#o!TO#s!UO#u!VO#z!WO#}hO$P!XO%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~O%]!YO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%j![O%k!]O%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aO~Ok%xXl%xXm%xXn%xXo%xXp%xXs%xXz%xX{%xX!x%xX#g%xX%[%xX%_%xX%z%xXg%xX!T%xX!U%xX%{%xX!W%xX![%xX!Q%xX#[%xXt%xX!m%xX~P%SOfoOhYO!XZO!][O!h`O!r`O!s`O!t`O%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~Oz%wX{%wX#g%wX%[%wX%_%wX%z%wX~Ok!pOl!qOm!oOn!oOo!rOp!sOs!tO!x%wX~P)pOV!zOg!|Oo0cOv0qO!PrO~P'vOV#OOo0cOv0qO!W#PO~P'vOV#SOa#TOo0cOv0qO![#UO~P'vOQ#XO%`#XO%a#ZO~OQ#^OR#[O%`#^O%a#`O~OV%iX_%iXa%iXh%iXk%iXl%iXm%iXn%iXo%iXp%iXs%iXz%iX!X%iX!f%iX%j%iX%k%iX%l%iX%m%iX%n%iX%o%iX%p%iX%q%iX%r%iX%s%iXg%iX!T%iX!U%iX~O&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O{%iX!x%iX#g%iX%[%iX%_%iX%z%iX%{%iX!W%iX![%iX!Q%iX#[%iXt%iX!m%iX~P,eOz#dO{%hX!x%hX#g%hX%[%hX%_%hX%z%hX~Oo0cOv0qO~P'vO#g#gO%[#iO%_#iO~O%uWO~O!T#nO#u!VO#z!WO#}hO~OopO~P'vOV#sOa#tO%uWO{wP~OV#xOo0cOv0qO!Q#yO~P'vO{#{O!x$QO%z#|O#g!yX%[!yX%_!yX~OV#xOo0cOv0qO#g#SX%[#SX%_#SX~P'vOo0cOv0qO#g#WX%[#WX%_#WX~P'vOh$WO%uWO~O!f$YO!r$YO%uWO~OV$eO~P'vO!U$gO#s$hO#u$iO~O{$jO~OV$qO~P'vOS$sO%[$rO%_$rO%c$tO~OV$}Oa$}Og%POo0cOv0qO~P'vOo0cOv0qO{%SO~P'vO&Y%UO~Oa!bOh!iO!X!kO!f!mOVba_bakbalbambanbaobapbasbazba{ba!xba#gba%[ba%_ba%jba%kba%lba%mba%nba%oba%pba%qba%rba%sba%zbagba!Tba!Uba%{ba!Wba![ba!Qba#[batba!mba~On%ZO~Oo%ZO~P'vOo0cO~P'vOk0eOl0fOm0dOn0dOo0mOp0nOs0rOg%wX!T%wX!U%wX%{%wX!W%wX![%wX!Q%wX#[%wX!m%wX~P)pO%{%]Og%vXz%vX!T%vX!U%vX!W%vX{%vX~Og%_Oz%`O!T%dO!U%cO~Og%_O~Oz%gO!T%dO!U%cO!W&SX~O!W%kO~Oz%lO{%nO!T%dO!U%cO![%}X~O![%rO~O![%sO~OQ#XO%`#XO%a%uO~OV%wOo0cOv0qO!PrO~P'vOQ#^OR#[O%`#^O%a%zO~OV!qa_!qaa!qah!qak!qal!qam!qan!qao!qap!qas!qaz!qa{!qa!X!qa!f!qa!x!qa#g!qa%[!qa%_!qa%j!qa%k!qa%l!qa%m!qa%n!qa%o!qa%p!qa%q!qa%r!qa%s!qa%z!qag!qa!T!qa!U!qa%{!qa!W!qa![!qa!Q!qa#[!qat!qa!m!qa~P#yOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P%SOV&OOopOvqO{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P'vOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#g$zX%[$zX%_$zX~P'vO#g#gO%[&TO%_&TO~O!f&UOh&sX%[&sXz&sX#[&sX#g&sX%_&sX#Z&sXg&sX~Oh!iO%[&WO~Okealeameaneaoeapeaseazea{ea!xea#gea%[ea%_ea%zeagea!Tea!Uea%{ea!Wea![ea!Qea#[eatea!mea~P%SOsqazqa{qa#gqa%[qa%_qa%zqa~Ok!pOl!qOm!oOn!oOo!rOp!sO!xqa~PEcO%z&YOz%yX{%yX~O%uWOz%yX{%yX~Oz&]O{wX~O{&_O~Oz%lO#g%}X%[%}X%_%}Xg%}X{%}X![%}X!m%}X%z%}X~OV0lOo0cOv0qO!PrO~P'vO%z#|O#gUa%[Ua%_Ua~Oz&hO#g&PX%[&PX%_&PXn&PX~P%SOz&kO!Q&jO#g#Wa%[#Wa%_#Wa~Oz&lO#[&nO#g&rX%[&rX%_&rXg&rX~O!f$YO!r$YO#Z&qO%uWO~O#Z&qO~Oz&sO#g&tX%[&tX%_&tX~Oz&uO#g&pX%[&pX%_&pX{&pX~O!X&wO%z&xO~Oz&|On&wX~P%SOn'PO~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO%['UO~P'vOt'YO#p'WO#q'XOP#naV#naf#nah#nao#nas#nav#na!P#na!Q#na!T#na!U#na!X#na!]#na!h#na!r#na!s#na!t#na!{#na!}#na#P#na#R#na#T#na#X#na#Z#na#^#na#_#na#a#na#c#na#l#na#o#na#s#na#u#na#z#na#}#na$P#na%X#na%o#na%p#na%t#na%u#na&Z#na&[#na&]#na&^#na&_#na&`#na&a#na&b#na&c#na&d#na&e#na&f#na&g#na&h#na&i#na&j#na%Z#na%_#na~Oz'ZO#[']O{&xX~Oh'_O!X&wO~Oh!iO{$jO!X&wO~O{'eO~P%SO%['hO%_'hO~OS'iO%['hO%_'hO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%k!]O~P!#uO%kWi~P!#uOV!aO_!aOa!bOh!iO!X!kO!f!mO%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%m!_O%n!_O~P!&pO%mWi%nWi~P!&pOa!bOh!iO!X!kO!f!mOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%mWi%nWi%oWi%pWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~OV!aO_!aO%q!aO%r!aO%s!aO~P!)nOVWi_Wi%qWi%rWi%sWi~P!)nO!T%dO!U%cOg&VXz&VX~O%z'kO%{'kO~P,eOz'mOg&UX~Og'oO~Oz'pO{'rO!W&XX~Oo0cOv0qOz'pO{'sO!W&XX~P'vO!W'uO~Om!oOn!oOo!rOp!sOkjisjizji{ji!xji#gji%[ji%_ji%zji~Ol!qO~P!.aOlji~P!.aOk0eOl0fOm0dOn0dOo0mOp0nO~Ot'wO~P!/jOV'|Og'}Oo0cOv0qO~P'vOg'}Oz(OO~Og(QO~O!U(SO~Og(TOz(OO!T%dO!U%cO~P%SOk0eOl0fOm0dOn0dOo0mOp0nOgqa!Tqa!Uqa%{qa!Wqa![qa!Qqa#[qatqa!mqa~PEcOV'|Oo0cOv0qO!W&Sa~P'vOz(WO!W&Sa~O!W(XO~Oz(WO!T%dO!U%cO!W&Sa~P%SOV(]Oo0cOv0qO![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~P'vOz(^O![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~O![(aO~Oz(^O!T%dO!U%cO![%}a~P%SOz(dO!T%dO!U%cO![&Ta~P%SOz(gO{&lX![&lX!m&lX%z&lX~O{(kO![(mO!m(nO%z(jO~OV&OOopOvqO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~P'vOz(pO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~O!f&UOh&sa%[&saz&sa#[&sa#g&sa%_&sa#Z&sag&sa~O%[(uO~OV#sOa#tO%uWO~Oz&]O{wa~OopOvqO~P'vOz(^O#g%}a%[%}a%_%}ag%}a{%}a![%}a!m%}a%z%}a~P%SOz(zO#g%hX%[%hX%_%hX%z%hX~O%z#|O#gUi%[Ui%_Ui~O#g&Pa%[&Pa%_&Pan&Pa~P'vOz(}O#g&Pa%[&Pa%_&Pan&Pa~O%uWO#g&ra%[&ra%_&rag&ra~Oz)SO#g&ra%[&ra%_&rag&ra~Og)VO~OV)WOh$WO%uWO~O#Z)XO~O%uWO#g&ta%[&ta%_&ta~Oz)ZO#g&ta%[&ta%_&ta~Oo0cOv0qO#g&pa%[&pa%_&pa{&pa~P'vOz)^O#g&pa%[&pa%_&pa{&pa~OV)`Oa)`O%uWO~O%z)eO~Ot)hO#j)gOP#hiV#hif#hih#hio#his#hiv#hi!P#hi!Q#hi!T#hi!U#hi!X#hi!]#hi!h#hi!r#hi!s#hi!t#hi!{#hi!}#hi#P#hi#R#hi#T#hi#X#hi#Z#hi#^#hi#_#hi#a#hi#c#hi#l#hi#o#hi#s#hi#u#hi#z#hi#}#hi$P#hi%X#hi%o#hi%p#hi%t#hi%u#hi&Z#hi&[#hi&]#hi&^#hi&_#hi&`#hi&a#hi&b#hi&c#hi&d#hi&e#hi&f#hi&g#hi&h#hi&i#hi&j#hi%Z#hi%_#hi~Ot)iOP#kiV#kif#kih#kio#kis#kiv#ki!P#ki!Q#ki!T#ki!U#ki!X#ki!]#ki!h#ki!r#ki!s#ki!t#ki!{#ki!}#ki#P#ki#R#ki#T#ki#X#ki#Z#ki#^#ki#_#ki#a#ki#c#ki#l#ki#o#ki#s#ki#u#ki#z#ki#}#ki$P#ki%X#ki%o#ki%p#ki%t#ki%u#ki&Z#ki&[#ki&]#ki&^#ki&_#ki&`#ki&a#ki&b#ki&c#ki&d#ki&e#ki&f#ki&g#ki&h#ki&i#ki&j#ki%Z#ki%_#ki~OV)kOn&wa~P'vOz)lOn&wa~Oz)lOn&wa~P%SOn)pO~O%Y)tO~Ot)wO#p'WO#q)vOP#niV#nif#nih#nio#nis#niv#ni!P#ni!Q#ni!T#ni!U#ni!X#ni!]#ni!h#ni!r#ni!s#ni!t#ni!{#ni!}#ni#P#ni#R#ni#T#ni#X#ni#Z#ni#^#ni#_#ni#a#ni#c#ni#l#ni#o#ni#s#ni#u#ni#z#ni#}#ni$P#ni%X#ni%o#ni%p#ni%t#ni%u#ni&Z#ni&[#ni&]#ni&^#ni&_#ni&`#ni&a#ni&b#ni&c#ni&d#ni&e#ni&f#ni&g#ni&h#ni&i#ni&j#ni%Z#ni%_#ni~OV)zOo0cOv0qO{$jO~P'vOo0cOv0qO{&xa~P'vOz*OO{&xa~OV*SOa*TOg*WO%q*UO%uWO~O{$jO&{*YO~Oh'_O~Oh!iO{$jO~O%[*_O~O%[*aO%_*aO~OV$}Oa$}Oo0cOv0qOg&Ua~P'vOz*dOg&Ua~Oo0cOv0qO{*gO!W&Xa~P'vOz*hO!W&Xa~Oo0cOv0qOz*hO{*kO!W&Xa~P'vOo0cOv0qOz*hO!W&Xa~P'vOz*hO{*kO!W&Xa~Om0dOn0dOo0mOp0nOgjikjisjizji!Tji!Uji%{ji!Wji{ji![ji#gji%[ji%_ji!Qji#[jitji!mji%zji~Ol0fO~P!NkOlji~P!NkOV'|Og*pOo0cOv0qO~P'vOn*rO~Og*pOz*tO~Og*uO~OV'|Oo0cOv0qO!W&Si~P'vOz*vO!W&Si~O!W*wO~OV(]Oo0cOv0qO![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~P'vOz*zO!T%dO!U%cO![&Ti~Oz*}O![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~O![+OO~Oa+QOo0cOv0qO![&Ti~P'vOz*zO![&Ti~O![+SO~OV+UOo0cOv0qO{&la![&la!m&la%z&la~P'vOz+VO{&la![&la!m&la%z&la~O!]+YO&n+[O![!nX~O![+^O~O{(kO![+_O~O{(kO![+_O!m+`O~OV&OOopOvqO{%hq!x%hq#g%hq%[%hq%_%hq%z%hq~P'vOz$ri{$ri!x$ri#g$ri%[$ri%_$ri%z$ri~P%SOV&OOopOvqO~P'vOV&OOo0cOv0qO#g%ha%[%ha%_%ha%z%ha~P'vOz+aO#g%ha%[%ha%_%ha%z%ha~Oz$ia#g$ia%[$ia%_$ian$ia~P%SO#g&Pi%[&Pi%_&Pin&Pi~P'vOz+dO#g#Wq%[#Wq%_#Wq~O#[+eOz$va#g$va%[$va%_$vag$va~O%uWO#g&ri%[&ri%_&rig&ri~Oz+gO#g&ri%[&ri%_&rig&ri~OV+iOh$WO%uWO~O%uWO#g&ti%[&ti%_&ti~Oo0cOv0qO#g&pi%[&pi%_&pi{&pi~P'vO{#{Oz#eX!W#eX~Oz+mO!W&uX~O!W+oO~Ot+rO#j)gOP#hqV#hqf#hqh#hqo#hqs#hqv#hq!P#hq!Q#hq!T#hq!U#hq!X#hq!]#hq!h#hq!r#hq!s#hq!t#hq!{#hq!}#hq#P#hq#R#hq#T#hq#X#hq#Z#hq#^#hq#_#hq#a#hq#c#hq#l#hq#o#hq#s#hq#u#hq#z#hq#}#hq$P#hq%X#hq%o#hq%p#hq%t#hq%u#hq&Z#hq&[#hq&]#hq&^#hq&_#hq&`#hq&a#hq&b#hq&c#hq&d#hq&e#hq&f#hq&g#hq&h#hq&i#hq&j#hq%Z#hq%_#hq~On$|az$|a~P%SOV)kOn&wi~P'vOz+yOn&wi~Oz,TO{$jO#[,TO~O#q,VOP#nqV#nqf#nqh#nqo#nqs#nqv#nq!P#nq!Q#nq!T#nq!U#nq!X#nq!]#nq!h#nq!r#nq!s#nq!t#nq!{#nq!}#nq#P#nq#R#nq#T#nq#X#nq#Z#nq#^#nq#_#nq#a#nq#c#nq#l#nq#o#nq#s#nq#u#nq#z#nq#}#nq$P#nq%X#nq%o#nq%p#nq%t#nq%u#nq&Z#nq&[#nq&]#nq&^#nq&_#nq&`#nq&a#nq&b#nq&c#nq&d#nq&e#nq&f#nq&g#nq&h#nq&i#nq&j#nq%Z#nq%_#nq~O#[,WOz%Oa{%Oa~Oo0cOv0qO{&xi~P'vOz,YO{&xi~O{#{O%z,[Og&zXz&zX~O%uWOg&zXz&zX~Oz,`Og&yX~Og,bO~O%Y,eO~O!T%dO!U%cOg&Viz&Vi~OV$}Oa$}Oo0cOv0qOg&Ui~P'vO{,hOz$la!W$la~Oo0cOv0qO{,iOz$la!W$la~P'vOo0cOv0qO{*gO!W&Xi~P'vOz,lO!W&Xi~Oo0cOv0qOz,lO!W&Xi~P'vOz,lO{,oO!W&Xi~Og$hiz$hi!W$hi~P%SOV'|Oo0cOv0qO~P'vOn,qO~OV'|Og,rOo0cOv0qO~P'vOV'|Oo0cOv0qO!W&Sq~P'vOz$gi![$gi#g$gi%[$gi%_$gig$gi{$gi!m$gi%z$gi~P%SOV(]Oo0cOv0qO~P'vOa+QOo0cOv0qO![&Tq~P'vOz,sO![&Tq~O![,tO~OV(]Oo0cOv0qO![%}q#g%}q%[%}q%_%}qg%}q{%}q!m%}q%z%}q~P'vO{,uO~OV+UOo0cOv0qO{&li![&li!m&li%z&li~P'vOz,zO{&li![&li!m&li%z&li~O!]+YO&n+[O![!na~O{(kO![,}O~OV&OOo0cOv0qO#g%hi%[%hi%_%hi%z%hi~P'vOz-OO#g%hi%[%hi%_%hi%z%hi~O%uWO#g&rq%[&rq%_&rqg&rq~Oz-RO#g&rq%[&rq%_&rqg&rq~OV)`Oa)`O%uWO!W&ua~Oz-TO!W&ua~On$|iz$|i~P%SOV)kO~P'vOV)kOn&wq~P'vOt-XOP#myV#myf#myh#myo#mys#myv#my!P#my!Q#my!T#my!U#my!X#my!]#my!h#my!r#my!s#my!t#my!{#my!}#my#P#my#R#my#T#my#X#my#Z#my#^#my#_#my#a#my#c#my#l#my#o#my#s#my#u#my#z#my#}#my$P#my%X#my%o#my%p#my%t#my%u#my&Z#my&[#my&]#my&^#my&_#my&`#my&a#my&b#my&c#my&d#my&e#my&f#my&g#my&h#my&i#my&j#my%Z#my%_#my~O%Z-]O%_-]O~P`O#q-^OP#nyV#nyf#nyh#nyo#nys#nyv#ny!P#ny!Q#ny!T#ny!U#ny!X#ny!]#ny!h#ny!r#ny!s#ny!t#ny!{#ny!}#ny#P#ny#R#ny#T#ny#X#ny#Z#ny#^#ny#_#ny#a#ny#c#ny#l#ny#o#ny#s#ny#u#ny#z#ny#}#ny$P#ny%X#ny%o#ny%p#ny%t#ny%u#ny&Z#ny&[#ny&]#ny&^#ny&_#ny&`#ny&a#ny&b#ny&c#ny&d#ny&e#ny&f#ny&g#ny&h#ny&i#ny&j#ny%Z#ny%_#ny~Oz-aO{$jO#[-aO~Oo0cOv0qO{&xq~P'vOz-dO{&xq~O%z,[Og&zaz&za~O{#{Og&zaz&za~OV*SOa*TO%q*UO%uWOg&ya~Oz-hOg&ya~O$S-lO~OV$}Oa$}Oo0cOv0qO~P'vOo0cOv0qO{-mOz$li!W$li~P'vOo0cOv0qOz$li!W$li~P'vO{-mOz$li!W$li~Oo0cOv0qO{*gO~P'vOo0cOv0qO{*gO!W&Xq~P'vOz-pO!W&Xq~Oo0cOv0qOz-pO!W&Xq~P'vOs-sO!T%dO!U%cOg&Oq!W&Oq![&Oqz&Oq~P!/jOa+QOo0cOv0qO![&Ty~P'vOz$ji![$ji~P%SOa+QOo0cOv0qO~P'vOV+UOo0cOv0qO~P'vOV+UOo0cOv0qO{&lq![&lq!m&lq%z&lq~P'vO{(kO![-xO!m-yO%z-wO~OV&OOo0cOv0qO#g%hq%[%hq%_%hq%z%hq~P'vO%uWO#g&ry%[&ry%_&ryg&ry~OV)`Oa)`O%uWO!W&ui~Ot-}OP#m!RV#m!Rf#m!Rh#m!Ro#m!Rs#m!Rv#m!R!P#m!R!Q#m!R!T#m!R!U#m!R!X#m!R!]#m!R!h#m!R!r#m!R!s#m!R!t#m!R!{#m!R!}#m!R#P#m!R#R#m!R#T#m!R#X#m!R#Z#m!R#^#m!R#_#m!R#a#m!R#c#m!R#l#m!R#o#m!R#s#m!R#u#m!R#z#m!R#}#m!R$P#m!R%X#m!R%o#m!R%p#m!R%t#m!R%u#m!R&Z#m!R&[#m!R&]#m!R&^#m!R&_#m!R&`#m!R&a#m!R&b#m!R&c#m!R&d#m!R&e#m!R&f#m!R&g#m!R&h#m!R&i#m!R&j#m!R%Z#m!R%_#m!R~Oo0cOv0qO{&xy~P'vOV*SOa*TO%q*UO%uWOg&yi~O$S-lO%Z.VO%_.VO~OV.aOh._O!X.^O!].`O!h.YO!s.[O!t.[O%p.XO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O~Oo0cOv0qOz$lq!W$lq~P'vO{.fOz$lq!W$lq~Oo0cOv0qO{*gO!W&Xy~P'vOz.gO!W&Xy~Oo0cOv.kO~P'vOs-sO!T%dO!U%cOg&Oy!W&Oy![&Oyz&Oy~P!/jO{(kO![.nO~O{(kO![.nO!m.oO~OV*SOa*TO%q*UO%uWO~Oh.tO!f.rOz$TX#[$TX%j$TXg$TX~Os$TX{$TX!W$TX![$TX~P$-bO%o.vO%p.vOs$UXz$UX{$UX#[$UX%j$UX!W$UXg$UX![$UX~O!h.xO~Oz.|O#[/OO%j.yOs&|X{&|X!W&|Xg&|X~Oa/RO~P$)zOh.tOs&}Xz&}X{&}X#[&}X%j&}X!W&}Xg&}X![&}X~Os/VO{$jO~Oo0cOv0qOz$ly!W$ly~P'vOo0cOv0qO{*gO!W&X!R~P'vOz/ZO!W&X!R~Og&RXs&RX!T&RX!U&RX!W&RX![&RXz&RX~P!/jOs-sO!T%dO!U%cOg&Qa!W&Qa![&Qaz&Qa~O{(kO![/^O~O!f.rOh$[as$[az$[a{$[a#[$[a%j$[a!W$[ag$[a![$[a~O!h/eO~O%o.vO%p.vOs$Uaz$Ua{$Ua#[$Ua%j$Ua!W$Uag$Ua![$Ua~O%j.yOs$Yaz$Ya{$Ya#[$Ya!W$Yag$Ya![$Ya~Os&|a{&|a!W&|ag&|a~P$)nOz/jOs&|a{&|a!W&|ag&|a~O!W/mO~Og/mO~O{/oO~O![/pO~Oo0cOv0qO{*gO!W&X!Z~P'vO{/sO~O%z/tO~P$-bOz/uO#[/OO%j.yOg'PX~Oz/uOg'PX~Og/wO~O!h/xO~O#[/OOs%Saz%Sa{%Sa%j%Sa!W%Sag%Sa![%Sa~O#[/OO%j.yOs%Waz%Wa{%Wa!W%Wag%Wa~Os&|i{&|i!W&|ig&|i~P$)nOz/zO#[/OO%j.yO!['Oa~Og'Pa~P$)nOz0SOg'Pa~Oa0UO!['Oi~P$)zOz0WO!['Oi~Oz0WO#[/OO%j.yO!['Oi~O#[/OO%j.yOg$biz$bi~O%z0ZO~P$-bO#[/OO%j.yOg%Vaz%Va~Og'Pi~P$)nO{0^O~Oa0UO!['Oq~P$)zOz0`O!['Oq~O#[/OO%j.yOz%Ui![%Ui~Oa0UO~P$)zOa0UO!['Oy~P$)zO#[/OO%j.yOg$ciz$ci~O#[/OO%j.yOz%Uq![%Uq~Oz+aO#g%ha%[%ha%_%ha%z%ha~P%SOV&OOo0cOv0qO~P'vOn0hO~Oo0hO~P'vO{0iO~Ot0jO~P!/jO&]&Z&j&h&i&g&f&d&e&c&b&`&a&_&^&[%u~",goto:"!=j'QPPPPPP'RP'Z*s+[+t,_,y-fP.SP'Z.r.r'ZPPP'Z2[PPPPPP2[5PPP5PP7b7k=sPP=v>h>kPP'Z'ZPP>zPP'Z'ZPP'Z'Z'Z'Z'Z?O?w'ZP?zP@QDXGuGyPG|HWH['ZPPPH_Hk'RP'R'RP'RP'RP'RP'RP'R'R'RP'RPP'RPP'RP'RPHqH}IVPI^IdPI^PI^I^PPPI^PKrPK{LVL]KrPI^LfPI^PLmLsPLwM]MzNeLwLwNkNxLwLwLwLw! ^! d! g! l! o! y!!P!!]!!o!!u!#P!#V!#s!#y!$P!$Z!$a!$g!$y!%T!%Z!%a!%k!%q!%w!%}!&T!&Z!&e!&k!&u!&{!'U!'[!'k!'s!'}!(UPPPPPPPPPPP!([!(_!(e!(n!(x!)TPPPPPPPPPPPP!-u!/Z!3^!6oPP!6w!7W!7a!8Y!8P!8c!8i!8l!8o!8r!8z!9jPPPPPPPPPPPPPPPPP!9m!9q!9wP!:]!:a!:m!:v!;S!;j!;m!;p!;v!;|!_![!]Do!]!^Es!^!_FZ!_!`Gk!`!aHX!a!b%T!b!cIf!c!dJU!d!eK^!e!hJU!h!i!#f!i!tJU!t!u!,|!u!wJU!w!x!.t!x!}JU!}#O!0S#O#P&o#P#Q!0j#Q#R!1Q#R#SJU#S#T%T#T#UJU#U#VK^#V#YJU#Y#Z!#f#Z#fJU#f#g!,|#g#iJU#i#j!.t#j#oJU#o#p!1n#p#q!1s#q#r!2a#r#s!2f#s$g%T$g;'SJU;'S;=`KW<%lOJU`%YT&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T`%lP;=`<%l%To%v]&n`%c_OX%TXY%oY[%T[]%o]p%Tpq%oq#O%T#O#P&o#P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To&tX&n`OY%TYZ%oZ]%T]^%o^#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc'f[&n`O!_%T!_!`([!`#T%T#T#U(r#U#f%T#f#g(r#g#h(r#h#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(cTmR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(yT!mR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk)aV&n`&[ZOr%Trs)vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk){V&n`Or%Trs*bs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk*iT&n`&^ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To+PZS_&n`OY*xYZ%TZ]*x]^%T^#o*x#o#p+r#p#q*x#q#r+r#r;'S*x;'S;=`,^<%lO*x_+wTS_OY+rZ]+r^;'S+r;'S;=`,W<%lO+r_,ZP;=`<%l+ro,aP;=`<%l*xj,kV%rQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-XT!xY&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-oV%lQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.]V&n`&ZZOw%Twx.rx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.wV&n`Ow%Twx/^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/eT&n`&]ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/{ThZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc0cTgR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk0yXVZ&n`Oz%Tz{1f{!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk1mVaR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk2ZV%oZ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc2wTzR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To3_W%pZ&n`O!_%T!_!`-Q!`!a3w!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Td4OT&{S&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk4fX!fQ&n`O!O%T!O!P5R!P!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5WV&n`O!O%T!O!P5m!P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5tT!rZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti6[a!hX&n`O!Q%T!Q![6T![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S6T#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti7fZ&n`O{%T{|8X|}%T}!O8X!O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8^V&n`O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8z]!hX&n`O!Q%T!Q![8s![!l%T!l!m9s!m#R%T#R#S8s#S#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti9zT!hX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk:bX%qR&n`O!P%T!P!Q:}!Q!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj;UV%sQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti;ro!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!d%T!d!e?q!e!g%T!g!h7a!h!l%T!l!m9s!m!q%T!q!rA]!r!z%T!z!{Bq!{#R%T#R#S>_#S#U%T#U#V?q#V#X%T#X#Y7a#Y#^%T#^#_9s#_#c%T#c#dA]#d#l%T#l#mBq#m#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti=xV&n`O!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti>fc!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S>_#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti?vY&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti@mY!hX&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiAbX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBUX!hX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBv]&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiCv]!hX&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToDvV{_&n`O!_%T!_!`E]!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TcEdT%{R&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkEzT#gZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkFbXmR&n`O!^%T!^!_F}!_!`([!`!a([!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjGUV%mQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkGrV%zZ&n`O!_%T!_!`([!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkH`WmR&n`O!_%T!_!`([!`!aHx!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjIPV%nQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkIoV_Q#}P&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToJ_]&n`&YS%uZO!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoKZP;=`<%lJUoKge&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!tJU!t!uLx!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#gLx#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoMRa&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUkN_V&n`&`ZOr%TrsNts#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkNyV&n`Or%Trs! `s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! gT&n`&bZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! }V&n`&_ZOw%Twx!!dx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!!iV&n`Ow%Twx!#Ox#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!#VT&n`&aZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!#oe&n`&YS%uZOr%Trs!%Qsw%Twx!&px!Q%T!Q![JU![!c%T!c!tJU!t!u!(`!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#g!(`#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!%XV&n`&dZOr%Trs!%ns#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!%sV&n`Or%Trs!&Ys#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&aT&n`&fZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&wV&n`&cZOw%Twx!'^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!'cV&n`Ow%Twx!'xx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!(PT&n`&eZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!(ia&n`&YS%uZOr%Trs!)nsw%Twx!+^x!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!)uV&n`&hZOr%Trs!*[s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*aV&n`Or%Trs!*vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*}T&n`&jZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!+eV&n`&gZOw%Twx!+zx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,PV&n`Ow%Twx!,fx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,mT&n`&iZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!-Vi&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[E6t,w6t,x6t,C6t,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:e=>_6t[e]||-1}],tokenPrec:7668}),Tse=new Mq,f6e=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function oj(e){return(t,n,i)=>{if(i)return!1;let r=t.node.getChild("VariableName");return r&&n(r,e),!0}}const N6t={FunctionDefinition:oj("function"),ClassDefinition:oj("class"),ForStatement(e,t,n){if(n){for(let i=e.node.firstChild;i;i=i.nextSibling)if(i.name=="VariableName")t(i,"variable");else if(i.name=="in")break}},ImportStatement(e,t){var n,i;let{node:r}=e,s=((n=r.firstChild)===null||n===void 0?void 0:n.name)=="from";for(let o=r.getChild("import");o;o=o.nextSibling)o.name=="VariableName"&&((i=o.nextSibling)===null||i===void 0?void 0:i.name)!="as"&&t(o,s?"variable":"namespace")},AssignStatement(e,t){for(let n=e.node.firstChild;n;n=n.nextSibling)if(n.name=="VariableName")t(n,"variable");else if(n.name==":"||n.name=="AssignOp")break},ParamList(e,t){for(let n=null,i=e.node.firstChild;i;i=i.nextSibling)i.name=="VariableName"&&(!n||!/\*|AssignOp/.test(n.name))&&t(i,"variable"),n=i},CapturePattern:oj("variable"),AsPattern:oj("variable"),__proto__:null};function h6e(e,t){let n=Tse.get(t);if(n)return n;let i=[],r=!0;function s(o,l){let c=e.sliceString(o.from,o.to);i.push({label:c,type:l})}return t.cursor(Sr.IncludeAnonymous).iterate(o=>{if(o.name){let l=N6t[o.name];if(l&&l(o,s,r)||!r&&f6e.has(o.name))return!1;r=!1}else if(o.to-o.from>8192){for(let l of h6e(e,o.node))i.push(l);return!1}}),Tse.set(t,i),i}const _se=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,p6e=["String","FormatString","Comment","PropertyName"];function R6t(e){let t=Yr(e.state).resolveInner(e.pos,-1);if(p6e.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&_se.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let i=[];for(let r=t;r;r=r.parent)f6e.has(r.name)&&(i=i.concat(h6e(e.state.doc,r)));return{options:i,from:n?t.from:e.pos,validFor:_se}}const I6t=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(e=>({label:e,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(e=>({label:e,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(e=>({label:e,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(e=>({label:e,type:"function"}))),P6t=[Ys("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),Ys("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),Ys("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),Ys("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),Ys(`if \${}: -`,{label:"if",detail:"block",type:"keyword"}),Ys("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),Ys("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),Ys("import ${module}",{label:"import",detail:"statement",type:"keyword"}),Ys("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],I6t=U4e(h6e,lW(N6t.concat(R6t)));function P$(e){let{node:t,pos:n}=e,i=e.lineIndent(n,-1),r=null;for(;;){let s=t.childBefore(n);if(s)if(s.name=="Comment")n=s.from;else if(s.name=="Body"||s.name=="MatchBody")e.baseIndentFor(s)+e.unit<=i&&(r=s),t=s;else if(s.name=="MatchClause")t=s;else if(s.type.is("Statement"))t=s;else break;else break}return r}function D$(e,t){let n=e.baseIndentFor(t),i=e.lineAt(e.pos,-1),r=i.from+i.text.length;return/^\s*($|#)/.test(i.text)&&e.node.ton?null:n+e.unit}const M$=rm.define({name:"python",parser:T6t.configure({props:[ym.add({Body:e=>{var t;let n=/^\s*(#|$)/.test(e.textAfter)&&P$(e)||e.node;return(t=D$(e,n))!==null&&t!==void 0?t:e.continue()},MatchBody:e=>{var t;let n=P$(e);return(t=D$(e,n||e.node))!==null&&t!==void 0?t:e.continue()},IfStatement:e=>/^\s*(else:|elif )/.test(e.textAfter)?e.baseIndent:e.continue(),"ForStatement WhileStatement":e=>/^\s*else:/.test(e.textAfter)?e.baseIndent:e.continue(),TryStatement:e=>/^\s*(except[ :]|finally:|else:)/.test(e.textAfter)?e.baseIndent:e.continue(),MatchStatement:e=>/^\s*case /.test(e.textAfter)?e.baseIndent+e.unit:e.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":xw({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":xw({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":xw({closing:"]"}),MemberExpression:e=>e.baseIndent+e.unit,"String FormatString":()=>null,Script:e=>{var t;let n=P$(e);return(t=n&&D$(e,n))!==null&&t!==void 0?t:e.continue()}}),vm.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":jT,Body:(e,t)=>({from:e.from+1,to:e.to-(e.to==t.doc.length?0:1)}),"String FormatString":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/}});function P6t(){return new bb(M$,[M$.data.of({autocomplete:j6t}),M$.data.of({autocomplete:I6t})])}const ux=63,_se=64,D6t=1,M6t=2,p6e=3,L6t=4,m6e=5,$6t=6,F6t=7,g6e=65,B6t=66,U6t=8,Q6t=9,z6t=10,V6t=11,H6t=12,b6e=13,q6t=19,W6t=20,K6t=29,G6t=33,X6t=34,Y6t=47,Z6t=0,jW=1,g7=2,ZC=3,b7=4;class ky{constructor(t,n,i){this.parent=t,this.depth=n,this.type=i,this.hash=(t?t.hash+t.hash<<8:0)+n+(n<<4)+i}}ky.top=new ky(null,-1,Z6t);function AE(e,t){for(let n=0,i=t-e.pos-1;;i--,n++){let r=e.peek(i);if(am(r)||r==-1)return n}}function y7(e){return e==32||e==9}function am(e){return e==10||e==13}function y6e(e){return y7(e)||am(e)}function My(e){return e<0||y6e(e)}const J6t=new rL({start:ky.top,reduce(e,t){return e.type==ZC&&(t==W6t||t==X6t)?e.parent:e},shift(e,t,n,i){if(t==p6e)return new ky(e,AE(i,i.pos),jW);if(t==g6e||t==m6e)return new ky(e,AE(i,i.pos),g7);if(t==ux)return e.parent;if(t==q6t||t==G6t)return new ky(e,0,ZC);if(t==b6e&&e.type==b7)return e.parent;if(t==Y6t){let r=/[1-9]/.exec(i.read(i.pos,n.pos));if(r)return new ky(e,e.depth+ +r[0],b7)}return e},hash(e){return e.hash}});function y1(e,t,n=0){return e.peek(n)==t&&e.peek(n+1)==t&&e.peek(n+2)==t&&My(e.peek(n+3))}const eFt=new Ia((e,t)=>{if(e.next==-1&&t.canShift(_se))return e.acceptToken(_se);let n=e.peek(-1);if((am(n)||n<0)&&t.context.type!=ZC){if(y1(e,45))if(t.canShift(ux))e.acceptToken(ux);else return e.acceptToken(D6t,3);if(y1(e,46))if(t.canShift(ux))e.acceptToken(ux);else return e.acceptToken(M6t,3);let i=0;for(;e.next==32;)i++,e.advance();(i{if(t.context.type==ZC){e.next==63&&(e.advance(),My(e.next)&&e.acceptToken(F6t));return}if(e.next==45)e.advance(),My(e.next)&&e.acceptToken(t.context.type==jW&&t.context.depth==AE(e,e.pos-1)?L6t:p6e);else if(e.next==63)e.advance(),My(e.next)&&e.acceptToken(t.context.type==g7&&t.context.depth==AE(e,e.pos-1)?$6t:m6e);else{let n=e.pos;for(;;)if(y7(e.next)){if(e.pos==n)return;e.advance()}else if(e.next==33)v6e(e);else if(e.next==38)v7(e);else if(e.next==42){v7(e);break}else if(e.next==39||e.next==34){if(NW(e,!0))break;return}else if(e.next==91||e.next==123){if(!iFt(e))return;break}else{x6e(e,!0,!1,0);break}for(;y7(e.next);)e.advance();if(e.next==58){if(e.pos==n&&t.canShift(K6t))return;let i=e.peek(1);My(i)&&e.acceptTokenTo(t.context.type==g7&&t.context.depth==AE(e,n)?B6t:g6e,n)}}},{contextual:!0});function nFt(e){return e>32&&e<127&&e!=34&&e!=37&&e!=44&&e!=60&&e!=62&&e!=92&&e!=94&&e!=96&&e!=123&&e!=124&&e!=125}function jse(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function Nse(e,t){return e.next==37?(e.advance(),jse(e.next)&&e.advance(),jse(e.next)&&e.advance(),!0):nFt(e.next)||t&&e.next==44?(e.advance(),!0):!1}function v6e(e){if(e.advance(),e.next==60){for(e.advance();;)if(!Nse(e,!0)){e.next==62&&e.advance();break}}else for(;Nse(e,!1););}function v7(e){for(e.advance();!My(e.next)&&dP(e.next)!="f";)e.advance()}function NW(e,t){let n=e.next,i=!1,r=e.pos;for(e.advance();;){let s=e.next;if(s<0)break;if(e.advance(),s==n)if(s==39)if(e.next==39)e.advance();else break;else break;else if(s==92&&n==34)e.next>=0&&e.advance();else if(am(s)){if(t)return!1;i=!0}else if(t&&e.pos>=r+1024)return!1}return!i}function iFt(e){for(let t=[],n=e.pos+1024;;)if(e.next==91||e.next==123)t.push(e.next),e.advance();else if(e.next==39||e.next==34){if(!NW(e,!0))return!1}else if(e.next==93||e.next==125){if(t[t.length-1]!=e.next-2)return!1;if(t.pop(),e.advance(),!t.length)return!0}else{if(e.next<0||e.pos>n||am(e.next))return!1;e.advance()}}const rFt="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function dP(e){return e<33?"u":e>125?"s":rFt[e-33]}function L$(e,t){let n=dP(e);return n!="u"&&!(t&&n=="f")}function x6e(e,t,n,i){if(dP(e.next)=="s"||(e.next==63||e.next==58||e.next==45)&&L$(e.peek(1),n))e.advance();else return!1;let r=e.pos;for(;;){let s=e.next,o=0,l=i+1;for(;y6e(s);){if(am(s)){if(t)return!1;l=0}else l++;s=e.peek(++o)}if(!(s>=0&&(s==58?L$(e.peek(o+1),n):s==35?e.peek(o-1)!=32:L$(s,n)))||!n&&l<=i||l==0&&!n&&(y1(e,45,o)||y1(e,46,o)))break;if(t&&dP(s)=="f")return!1;for(let u=o;u>=0;u--)e.advance();if(t&&e.pos>r+1024)return!1}return!0}const sFt=new Ia((e,t)=>{if(e.next==33)v6e(e),e.acceptToken(H6t);else if(e.next==38||e.next==42){let n=e.next==38?z6t:V6t;v7(e),e.acceptToken(n)}else e.next==39||e.next==34?(NW(e,!1),e.acceptToken(Q6t)):x6e(e,!1,t.context.type==ZC,t.context.depth)&&e.acceptToken(U6t)}),aFt=new Ia((e,t)=>{let n=t.context.type==b7?t.context.depth:-1,i=e.pos;e:for(;;){let r=0,s=e.next;for(;s==32;)s=e.peek(++r);if(!r&&(y1(e,45,r)||y1(e,46,r))||!am(s)&&(n<0&&(n=Math.max(t.context.depth+1,r)),rYAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:J6t,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[oFt],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[eFt,tFt,sFt,aFt,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),cFt=rm.define({name:"yaml",parser:lFt.configure({props:[ym.add({Stream:e=>{for(let t=e.node.resolve(e.pos,-1);t&&t.to>=e.pos;t=t.parent){if(t.name=="BlockLiteralContent"&&t.frome.pos)return null}}return null},FlowMapping:xw({closing:"}"}),FlowSequence:xw({closing:"]"})}),vm.add({"FlowMapping FlowSequence":jT,"Item Pair BlockLiteral":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function uFt(){return new bb(cFt)}function dFt(e){w6e(e,"start");var t={},n=e.languageData||{},i=!1;for(var r in e)if(r!=n&&e.hasOwnProperty(r))for(var s=t[r]=[],o=e[r],l=0;l2&&o.token&&typeof o.token!="string"){n.pending=[];for(var u=2;u-1)return null;var r=n.indent.length-1,s=e[n.state];e:for(;;){for(var o=0;o{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),i=IW(e.state,n.from);return i.line?AFt(e):i.block?_Ft(e):!1};function RW(e,t){return({state:n,dispatch:i})=>{if(n.readOnly)return!1;let r=e(t,n);return r?(i(n.update(r)),!0):!1}}const AFt=RW(RFt,0),TFt=RW(C6e,0),_Ft=RW((e,t)=>C6e(e,t,NFt(t)),0);function IW(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const _k=50;function jFt(e,{open:t,close:n},i,r){let s=e.sliceDoc(i-_k,i),o=e.sliceDoc(r,r+_k),l=/\s*$/.exec(s)[0].length,c=/^\s*/.exec(o)[0].length,u=s.length-l;if(s.slice(u-t.length,u)==t&&o.slice(c,c+n.length)==n)return{open:{pos:i-l,margin:l&&1},close:{pos:r+c,margin:c&&1}};let d,f;r-i<=2*_k?d=f=e.sliceDoc(i,r):(d=e.sliceDoc(i,i+_k),f=e.sliceDoc(r-_k,r));let h=/^\s*/.exec(d)[0].length,m=/\s*$/.exec(f)[0].length,g=f.length-m-n.length;return d.slice(h,h+t.length)==t&&f.slice(g,g+n.length)==n?{open:{pos:i+h+t.length,margin:/\s/.test(d.charAt(h+t.length))?1:0},close:{pos:r-m-n.length,margin:/\s/.test(f.charAt(g-1))?1:0}}:null}function NFt(e){let t=[];for(let n of e.selection.ranges){let i=e.doc.lineAt(n.from),r=n.to<=i.to?i:e.doc.lineAt(n.to);r.from>i.from&&r.from==n.to&&(r=n.to==i.to+1?i:e.doc.lineAt(n.to-1));let s=t.length-1;s>=0&&t[s].to>i.from?t[s].to=r.to:t.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return t}function C6e(e,t,n=t.selection.ranges){let i=n.map(s=>IW(t,s.from).block);if(!i.every(s=>s))return null;let r=n.map((s,o)=>jFt(t,i[o],s.from,s.to));if(e!=2&&!r.every(s=>s))return{changes:t.changes(n.map((s,o)=>r[o]?[]:[{from:s.from,insert:i[o].open+" "},{from:s.to,insert:" "+i[o].close}]))};if(e!=1&&r.some(s=>s)){let s=[];for(let o=0,l;or&&(s==o||o>f.from)){r=f.from;let h=/^\s*/.exec(f.text)[0].length,m=h==f.length,g=f.text.slice(h,h+u.length)==u?h:-1;hs.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:l,token:c,indent:u,empty:d,single:f}of i)(f||!d)&&s.push({from:l.from+u,insert:c+" "});let o=t.changes(s);return{changes:o,selection:t.selection.map(o,1)}}else if(e!=1&&i.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:l,token:c}of i)if(l>=0){let u=o.from+l,d=u+c.length;o.text[d-o.from]==" "&&d++,s.push({from:u,to:d})}return{changes:s}}return null}const w7=Rh.define(),IFt=Rh.define(),PFt=mn.define(),A6e=mn.define({combine(e){return Ih(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,n)=>(i,r)=>t(i,r)||n(i,r)})}}),T6e=dl.define({create(){return uh.empty},update(e,t){let n=t.state.facet(A6e),i=t.annotation(w7);if(i){let c=Mc.fromTransaction(t,i.selection),u=i.side,d=u==0?e.undone:e.done;return c?d=fP(d,d.length,n.minDepth,c):d=N6e(d,t.startState.selection),new uh(u==0?i.rest:d,u==0?d:i.rest)}let r=t.annotation(IFt);if((r=="full"||r=="before")&&(e=e.isolate()),t.annotation(Xa.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let s=Mc.fromTransaction(t),o=t.annotation(Xa.time),l=t.annotation(Xa.userEvent);return s?e=e.addChanges(s,o,l,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,l,n.newGroupDelay)),(r=="full"||r=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(t=>t.toJSON()),undone:e.undone.map(t=>t.toJSON())}},fromJSON(e){return new uh(e.done.map(Mc.fromJSON),e.undone.map(Mc.fromJSON))}});function DFt(e={}){return[T6e,A6e.of(e),Jt.domEventHandlers({beforeinput(t,n){let i=t.inputType=="historyUndo"?_6e:t.inputType=="historyRedo"?O7:null;return i?(t.preventDefault(),i(n)):!1}})]}function lL(e,t){return function({state:n,dispatch:i}){if(!t&&n.readOnly)return!1;let r=n.field(T6e,!1);if(!r)return!1;let s=r.pop(e,n,t);return s?(i(s),!0):!1}}const _6e=lL(0,!1),O7=lL(1,!1),MFt=lL(0,!0),LFt=lL(1,!0);class Mc{constructor(t,n,i,r,s){this.changes=t,this.effects=n,this.mapped=i,this.startSelection=r,this.selectionsAfter=s}setSelAfter(t){return new Mc(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,n,i;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(t){return new Mc(t.changes&&lo.fromJSON(t.changes),[],t.mapped&&bh.fromJSON(t.mapped),t.startSelection&&ht.fromJSON(t.startSelection),t.selectionsAfter.map(ht.fromJSON))}static fromTransaction(t,n){let i=gd;for(let r of t.startState.facet(PFt)){let s=r(t);s.length&&(i=i.concat(s))}return!i.length&&t.changes.empty?null:new Mc(t.changes.invert(t.startState.doc),i,void 0,n||t.startState.selection,gd)}static selection(t){return new Mc(void 0,gd,void 0,void 0,t)}}function fP(e,t,n,i){let r=t+1>n+20?t-n-1:0,s=e.slice(r,t);return s.push(i),s}function $Ft(e,t){let n=[],i=!1;return e.iterChangedRanges((r,s)=>n.push(r,s)),t.iterChangedRanges((r,s,o,l)=>{for(let c=0;c=u&&o<=d&&(i=!0)}}),i}function FFt(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,i)=>n.empty!=t.ranges[i].empty).length===0}function j6e(e,t){return e.length?t.length?e.concat(t):e:t}const gd=[],BFt=200;function N6e(e,t){if(e.length){let n=e[e.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-BFt));return i.length&&i[i.length-1].eq(t)?e:(i.push(t),fP(e,e.length-1,1e9,n.setSelAfter(i)))}else return[Mc.selection([t])]}function UFt(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function $$(e,t){if(!e.length)return e;let n=e.length,i=gd;for(;n;){let r=QFt(e[n-1],t,i);if(r.changes&&!r.changes.empty||r.effects.length){let s=e.slice(0,n);return s[n-1]=r,s}else t=r.mapped,n--,i=r.selectionsAfter}return i.length?[Mc.selection(i)]:gd}function QFt(e,t,n){let i=j6e(e.selectionsAfter.length?e.selectionsAfter.map(l=>l.map(t)):gd,n);if(!e.changes)return Mc.selection(i);let r=e.changes.map(t),s=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(s):s;return new Mc(r,pi.mapEffects(e.effects,t),o,e.startSelection.map(s),i)}const zFt=/^(input\.type|delete)($|\.)/;class uh{constructor(t,n,i=0,r=void 0){this.done=t,this.undone=n,this.prevTime=i,this.prevUserEvent=r}isolate(){return this.prevTime?new uh(this.done,this.undone):this}addChanges(t,n,i,r,s){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&t.changes&&(!i||zFt.test(i))&&(!l.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?e.moveByChar(n,t):cL(n,t))}function Il(e){return e.textDirectionAt(e.state.selection.main.head)==os.LTR}const I6e=e=>R6e(e,!Il(e)),P6e=e=>R6e(e,Il(e));function D6e(e,t){return Rf(e,n=>n.empty?e.moveByGroup(n,t):cL(n,t))}const HFt=e=>D6e(e,!Il(e)),qFt=e=>D6e(e,Il(e));function WFt(e,t,n){if(t.type.prop(n))return!0;let i=t.to-t.from;return i&&(i>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function uL(e,t,n){let i=Yr(e).resolveInner(t.head),r=n?ui.closedBy:ui.openedBy;for(let c=t.head;;){let u=n?i.childAfter(c):i.childBefore(c);if(!u)break;WFt(e,u,r)?i=u:c=n?u.to:u.from}let s=i.type.prop(r),o,l;return s&&(o=n?ch(e,i.from,1):ch(e,i.to,-1))&&o.matched?l=n?o.end.to:o.end.from:l=n?i.to:i.from,ht.cursor(l,n?-1:1)}const KFt=e=>Rf(e,t=>uL(e.state,t,!Il(e))),GFt=e=>Rf(e,t=>uL(e.state,t,Il(e)));function M6e(e,t){return Rf(e,n=>{if(!n.empty)return cL(n,t);let i=e.moveVertically(n,t);return i.head!=n.head?i:e.moveToLineBoundary(n,t)})}const L6e=e=>M6e(e,!1),$6e=e=>M6e(e,!0);function F6e(e){let t=e.scrollDOM.clientHeighto.empty?e.moveVertically(o,t,n.height):cL(o,t));if(r.eq(i.selection))return!1;let s;if(n.selfScroll){let o=e.coordsAtPos(i.selection.main.head),l=e.scrollDOM.getBoundingClientRect(),c=l.top+n.marginTop,u=l.bottom-n.marginBottom;o&&o.top>c&&o.bottomB6e(e,!1),k7=e=>B6e(e,!0);function Rb(e,t,n){let i=e.lineBlockAt(t.head),r=e.moveToLineBoundary(t,n);if(r.head==t.head&&r.head!=(n?i.to:i.from)&&(r=e.moveToLineBoundary(t,n,!1)),!n&&r.head==i.from&&i.length){let s=/^\s*/.exec(e.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;s&&t.head!=i.from+s&&(r=ht.cursor(i.from+s))}return r}const XFt=e=>Rf(e,t=>Rb(e,t,!0)),YFt=e=>Rf(e,t=>Rb(e,t,!1)),ZFt=e=>Rf(e,t=>Rb(e,t,!Il(e))),JFt=e=>Rf(e,t=>Rb(e,t,Il(e))),e8t=e=>Rf(e,t=>ht.cursor(e.lineBlockAt(t.head).from,1)),t8t=e=>Rf(e,t=>ht.cursor(e.lineBlockAt(t.head).to,-1));function n8t(e,t,n){let i=!1,r=gO(e.selection,s=>{let o=ch(e,s.head,-1)||ch(e,s.head,1)||s.head>0&&ch(e,s.head-1,1)||s.headn8t(e,t);function Id(e,t,n){let i=gO(e.state.selection,r=>{r.undirectional&&r.head>=r.anchor!=t&&(r=ht.range(r.head,r.anchor));let s=n(r);return ht.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return i.eq(e.state.selection)?!1:(e.dispatch(Nf(e.state,i)),!0)}function U6e(e,t){return Id(e,t,n=>e.moveByChar(n,t))}const Q6e=e=>U6e(e,!Il(e)),z6e=e=>U6e(e,Il(e));function V6e(e,t){return Id(e,t,n=>e.moveByGroup(n,t))}const r8t=e=>V6e(e,!Il(e)),s8t=e=>V6e(e,Il(e)),a8t=e=>{let t=!Il(e);return Id(e,t,n=>uL(e.state,n,t))},o8t=e=>{let t=Il(e);return Id(e,t,n=>uL(e.state,n,t))};function H6e(e,t){return Id(e,t,n=>e.moveVertically(n,t))}const q6e=e=>H6e(e,!1),W6e=e=>H6e(e,!0);function K6e(e,t){return Id(e,t,n=>e.moveVertically(n,t,F6e(e).height))}const Ise=e=>K6e(e,!1),Pse=e=>K6e(e,!0),l8t=e=>Id(e,!0,t=>Rb(e,t,!0)),c8t=e=>Id(e,!1,t=>Rb(e,t,!1)),u8t=e=>{let t=!Il(e);return Id(e,t,n=>Rb(e,n,t))},d8t=e=>{let t=Il(e);return Id(e,t,n=>Rb(e,n,t))},f8t=e=>Id(e,!1,t=>ht.cursor(e.lineBlockAt(t.head).from)),h8t=e=>Id(e,!0,t=>ht.cursor(e.lineBlockAt(t.head).to)),Dse=({state:e,dispatch:t})=>(t(Nf(e,{anchor:0})),!0),Mse=({state:e,dispatch:t})=>(t(Nf(e,{anchor:e.doc.length})),!0),Lse=({state:e,dispatch:t})=>(t(Nf(e,{anchor:e.selection.main.anchor,head:0})),!0),$se=({state:e,dispatch:t})=>(t(Nf(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),p8t=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),m8t=({state:e,dispatch:t})=>{let n=dL(e).map(({from:i,to:r})=>ht.range(i,Math.min(r+1,e.doc.length)));return t(e.update({selection:ht.create(n),userEvent:"select"})),!0},g8t=({state:e,dispatch:t})=>{let n=gO(e.selection,i=>{let r=Yr(e),s=r.resolveStack(i.from,1);if(i.empty){let o=r.resolveStack(i.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}for(let o=s;o;o=o.next){let{node:l}=o;if((l.from=i.to||l.to>i.to&&l.from<=i.from)&&o.next)return ht.range(l.to,l.from)}return i});return n.eq(e.selection)?!1:(t(Nf(e,n)),!0)};function G6e(e,t){let{state:n}=e,i=n.selection,r=n.selection.ranges.slice();for(let s of n.selection.ranges){let o=n.doc.lineAt(s.head);if(t?o.to0)for(let l=s;;){let c=e.moveVertically(l,t);if(c.heado.to){r.some(u=>u.head==c.head)||r.push(c);break}else{if(c.head==l.head)break;l=c}}}return r.length==i.ranges.length?!1:(e.dispatch(Nf(n,ht.create(r,r.length-1))),!0)}const b8t=e=>G6e(e,!1),y8t=e=>G6e(e,!0),v8t=({state:e,dispatch:t})=>{let n=e.selection,i=null;return n.ranges.length>1?i=ht.create([n.main]):n.main.empty||(i=ht.create([ht.cursor(n.main.head)])),i?(t(Nf(e,i)),!0):!1};function PT(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:i}=e,r=i.changeByRange(s=>{let{from:o,to:l}=s;if(o==l){let c=t(s);co&&(n="delete.forward",c=oj(e,c,!0)),o=Math.min(o,c),l=Math.max(l,c)}else o=oj(e,o,!1),l=oj(e,l,!0);return o==l?{range:s}:{changes:{from:o,to:l},range:ht.cursor(o,or(e)))i.between(t,t,(r,s)=>{rt&&(t=n?s:r)});return t}const X6e=(e,t,n)=>PT(e,i=>{let r=i.from,{state:s}=e,o=s.doc.lineAt(r),l,c;if(n&&!t&&r>o.from&&rX6e(e,!1,!0),Y6e=e=>X6e(e,!0,!1),Z6e=(e,t)=>PT(e,n=>{let i=n.head,{state:r}=e,s=r.doc.lineAt(i),o=r.charCategorizer(i);for(let l=null;;){if(i==(t?s.to:s.from)){i==n.head&&s.number!=(t?r.doc.lines:1)&&(i+=t?1:-1);break}let c=Ro(s.text,i-s.from,t)+s.from,u=s.text.slice(Math.min(i,c)-s.from,Math.max(i,c)-s.from),d=o(u);if(l!=null&&d!=l)break;(u!=" "||i!=n.head)&&(l=d),i=c}return i}),J6e=e=>Z6e(e,!1),x8t=e=>Z6e(e,!0),w8t=e=>PT(e,t=>{let n=e.lineBlockAt(t.head).to;return t.headPT(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),k8t=e=>PT(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head{if(e.readOnly)return!1;let n=e.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:xr.of(["",""])},range:ht.cursor(i.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},E8t=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(i=>{if(!i.empty||i.from==0||i.from==e.doc.length)return{range:i};let r=i.from,s=e.doc.lineAt(r),o=r==s.from?r-1:Ro(s.text,r-s.from,!1)+s.from,l=r==s.to?r+1:Ro(s.text,r-s.from,!0)+s.from;return{changes:{from:o,to:l,insert:e.doc.slice(r,l).append(e.doc.slice(o,r))},range:ht.cursor(l)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function dL(e){let t=[],n=-1;for(let i of e.selection.ranges){let r=e.doc.lineAt(i.from),s=e.doc.lineAt(i.to);if(!i.empty&&i.to==s.from&&(s=e.doc.lineAt(i.to-1)),n>=r.number){let o=t[t.length-1];o.to=s.to,o.ranges.push(i)}else t.push({from:r.from,to:s.to,ranges:[i]});n=s.number+1}return t}function eFe(e,t,n){if(e.readOnly)return!1;let i=[],r=[];for(let s of dL(e)){if(n?s.to==e.doc.length:s.from==0)continue;let o=e.doc.lineAt(n?s.to+1:s.from-1),l=o.length+1;if(n){i.push({from:s.to,to:o.to},{from:s.from,insert:o.text+e.lineBreak});for(let c of s.ranges)r.push(ht.range(Math.min(e.doc.length,c.anchor+l),Math.min(e.doc.length,c.head+l)))}else{i.push({from:o.from,to:s.from},{from:s.to,insert:e.lineBreak+o.text});for(let c of s.ranges)r.push(ht.range(c.anchor-l,c.head-l))}}return i.length?(t(e.update({changes:i,scrollIntoView:!0,selection:ht.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const C8t=({state:e,dispatch:t})=>eFe(e,t,!1),A8t=({state:e,dispatch:t})=>eFe(e,t,!0);function tFe(e,t,n){if(e.readOnly)return!1;let i=[];for(let s of dL(e))n?i.push({from:s.from,insert:e.doc.slice(s.from,s.to)+e.lineBreak}):i.push({from:s.to,insert:e.lineBreak+e.doc.slice(s.from,s.to)});let r=e.changes(i);return t(e.update({changes:r,selection:e.selection.map(r,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const T8t=({state:e,dispatch:t})=>tFe(e,t,!1),_8t=({state:e,dispatch:t})=>tFe(e,t,!0),j8t=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(dL(t).map(({from:r,to:s})=>(r>0?r--:s{let s;if(e.lineWrapping){let o=e.lineBlockAt(r.head),l=e.coordsAtPos(r.head,r.assoc||1);l&&(s=o.bottom+e.documentTop-l.bottom+e.defaultLineHeight/2)}return e.moveVertically(r,!0,s)}).map(n);return e.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function N8t(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=Yr(e).resolveInner(t),i=n.childBefore(t),r=n.childAfter(t),s;return i&&r&&i.to<=t&&r.from>=t&&(s=i.type.prop(ui.closedBy))&&s.indexOf(r.name)>-1&&e.doc.lineAt(i.to).from==e.doc.lineAt(r.from).from&&!/\S/.test(e.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}const Fse=nFe(!1),R8t=nFe(!0);function nFe(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let i=t.changeByRange(r=>{let{from:s,to:o}=r,l=t.doc.lineAt(s),c=!e&&s==o&&N8t(t,s);e&&(s=o=(o<=l.to?l:t.doc.lineAt(o)).to);let u=new nL(t,{simulateBreak:s,simulateDoubleBreak:!!c}),d=nW(u,s);for(d==null&&(d=wf(/^\s*/.exec(t.doc.lineAt(s).text)[0],t.tabSize));ol.from&&s{let r=[];for(let o=i.from;o<=i.to;){let l=e.doc.lineAt(o);l.number>n&&(i.empty||i.to>l.from)&&(t(l,r,i),n=l.number),o=l.to+1}let s=e.changes(r);return{changes:r,range:ht.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}const I8t=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),i=new nL(e,{overrideIndentation:s=>{let o=n[s];return o??-1}}),r=PW(e,(s,o,l)=>{let c=nW(i,s.from);if(c==null)return;/\S/.test(s.text)||(c=0);let u=/^\s*/.exec(s.text)[0],d=QC(e,c);(u!=d||l.frome.readOnly?!1:(t(e.update(PW(e,(n,i)=>{i.push({from:n.from,insert:e.facet(pO)})}),{userEvent:"input.indent"})),!0),rFe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(PW(e,(n,i)=>{let r=/^\s*/.exec(n.text)[0];if(!r)return;let s=wf(r,e.tabSize),o=0,l=QC(e,Math.max(0,s-S0(e)));for(;o(e.setTabFocusMode(),!0),D8t=[{key:"Ctrl-b",run:I6e,shift:Q6e,preventDefault:!0},{key:"Ctrl-f",run:P6e,shift:z6e},{key:"Ctrl-p",run:L6e,shift:q6e},{key:"Ctrl-n",run:$6e,shift:W6e},{key:"Ctrl-a",run:e8t,shift:f8t},{key:"Ctrl-e",run:t8t,shift:h8t},{key:"Ctrl-d",run:Y6e},{key:"Ctrl-h",run:S7},{key:"Ctrl-k",run:w8t},{key:"Ctrl-Alt-h",run:J6e},{key:"Ctrl-o",run:S8t},{key:"Ctrl-t",run:E8t},{key:"Ctrl-v",run:k7}],M8t=[{key:"ArrowLeft",run:I6e,shift:Q6e,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:HFt,shift:r8t,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:ZFt,shift:u8t,preventDefault:!0},{key:"ArrowRight",run:P6e,shift:z6e,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:qFt,shift:s8t,preventDefault:!0},{mac:"Cmd-ArrowRight",run:JFt,shift:d8t,preventDefault:!0},{key:"ArrowUp",run:L6e,shift:q6e,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Dse,shift:Lse},{mac:"Ctrl-ArrowUp",run:Rse,shift:Ise},{key:"ArrowDown",run:$6e,shift:W6e,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Mse,shift:$se},{mac:"Ctrl-ArrowDown",run:k7,shift:Pse},{key:"PageUp",run:Rse,shift:Ise},{key:"PageDown",run:k7,shift:Pse},{key:"Home",run:YFt,shift:c8t,preventDefault:!0},{key:"Mod-Home",run:Dse,shift:Lse},{key:"End",run:XFt,shift:l8t,preventDefault:!0},{key:"Mod-End",run:Mse,shift:$se},{key:"Enter",run:Fse,shift:Fse},{key:"Mod-a",run:p8t},{key:"Backspace",run:S7,shift:S7,preventDefault:!0},{key:"Delete",run:Y6e,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:J6e,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:x8t,preventDefault:!0},{mac:"Mod-Backspace",run:O8t,preventDefault:!0},{mac:"Mod-Delete",run:k8t,preventDefault:!0}].concat(D8t.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),L8t=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:KFt,shift:a8t},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:GFt,shift:o8t},{key:"Alt-ArrowUp",run:C8t},{key:"Shift-Alt-ArrowUp",run:T8t},{key:"Alt-ArrowDown",run:A8t},{key:"Shift-Alt-ArrowDown",run:_8t},{key:"Mod-Alt-ArrowUp",run:b8t},{key:"Mod-Alt-ArrowDown",run:y8t},{key:"Escape",run:v8t},{key:"Mod-Enter",run:R8t},{key:"Alt-l",mac:"Ctrl-l",run:m8t},{key:"Mod-i",run:g8t,preventDefault:!0},{key:"Mod-[",run:rFe},{key:"Mod-]",run:iFe},{key:"Mod-Alt-\\",run:I8t},{key:"Shift-Mod-k",run:j8t},{key:"Shift-Mod-\\",run:i8t},{key:"Mod-/",run:CFt},{key:"Alt-A",run:TFt},{key:"Ctrl-m",mac:"Shift-Alt-m",run:P8t}].concat(M8t),$8t={key:"Tab",run:iFe,shift:rFe},Bse=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class v1{constructor(t,n,i=0,r=t.length,s,o){this.test=o,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(i,r),this.bufferStart=i,this.normalize=s?l=>s(Bse(l)):Bse,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return jc(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let n=Mq(t),i=this.bufferStart+this.bufferPos;this.bufferPos+=eh(t);let r=this.normalize(n);if(r.length)for(let s=0,o=i,l=!0;;s++){let c=r.charCodeAt(s),u=this.match(c,o,l,this.bufferPos+this.bufferStart,s==r.length-1);if(u)return this.value=u,this;if(s==r.length-1)break;l&&sthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let i=this.curLineStart+n.index,r=i+n[0].length;if(this.matchPos=hP(this.text,r+(i==r?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,r,n)))return this.value={from:i,to:r,precise:!0,match:n},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=i||r.to<=n){let l=new Sw(n,t.sliceString(n,i));return F$.set(t,l),l}if(r.from==n&&r.to==i)return r;let{text:s,from:o}=r;return o>n&&(s=t.sliceString(n,o)+s,o=n),r.to=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==t&&(this.re.lastIndex=t+1,n=this.re.exec(this.flat.text)),n){let i=this.flat.from+n.index,r=i+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,r,n)))return this.value={from:i,to:r,precise:!0,match:n},this.matchPos=hP(this.text,r+(i==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Sw.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(aFe.prototype[Symbol.iterator]=oFe.prototype[Symbol.iterator]=function(){return this});function F8t(e){try{return new RegExp(e,DW),!0}catch{return!1}}function hP(e,t){if(t>=e.length)return t;let n=e.lineAt(t),i;for(;t=56320&&i<57344;)t++;return t}const B8t=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:i,result:r}=YDt(e,{label:t.phrase("Go to line"),input:{type:"text",name:"line",value:n},focus:!0,submitLabel:t.phrase("go")});return r.then(s=>{let o=s&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(s.elements.line.value);if(!o){e.dispatch({effects:i});return}let l=t.doc.lineAt(t.selection.main.head),[,c,u,d,f]=o,h=d?+d.slice(1):0,m=u?+u:l.number;if(u&&f){let v=m/100;c&&(v=v*(c=="-"?-1:1)+l.number/t.doc.lines),m=Math.round(t.doc.lines*v)}else u&&c&&(m=m*(c=="-"?-1:1)+l.number);let g=t.doc.line(Math.max(1,Math.min(t.doc.lines,m))),b=ht.cursor(g.from+Math.max(0,Math.min(h,g.length)));e.dispatch({effects:[i,Jt.scrollIntoView(b.from,{y:"center"})],selection:b})}),!0},U8t={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Q8t=mn.define({combine(e){return Ih(e,U8t,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function z8t(e){return[K8t,W8t]}const V8t=Fn.mark({class:"cm-selectionMatch"}),H8t=Fn.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Use(e,t,n,i){return(n==0||e(t.sliceDoc(n-1,n))!=Qs.Word)&&(i==t.doc.length||e(t.sliceDoc(i,i+1))!=Qs.Word)}function q8t(e,t,n,i){return e(t.sliceDoc(n,n+1))==Qs.Word&&e(t.sliceDoc(i-1,i))==Qs.Word}const W8t=ma.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(Q8t),{state:n}=e,i=n.selection;if(i.ranges.length>1)return Fn.none;let r=i.main,s,o=null;if(r.empty){if(!t.highlightWordAroundCursor)return Fn.none;let c=n.wordAt(r.head);if(!c)return Fn.none;o=n.charCategorizer(r.head),s=n.sliceDoc(c.from,c.to)}else{let c=r.to-r.from;if(c200)return Fn.none;if(t.wholeWords){if(s=n.sliceDoc(r.from,r.to),o=n.charCategorizer(r.head),!(Use(o,n,r.from,r.to)&&q8t(o,n,r.from,r.to)))return Fn.none}else if(s=n.sliceDoc(r.from,r.to),!s)return Fn.none}let l=[];for(let c of e.visibleRanges){let u=new v1(n.doc,s,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!o||Use(o,n,d,f))&&(r.empty&&d<=r.from&&f>=r.to?l.push(H8t.range(d,f)):(d>=r.to||f<=r.from)&&l.push(V8t.range(d,f)),l.length>t.maxMatches))return Fn.none}}return Fn.set(l)}},{decorations:e=>e.decorations}),K8t=Jt.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),G8t=({state:e,dispatch:t})=>{let{selection:n}=e,i=ht.create(n.ranges.map(r=>e.wordAt(r.head)||ht.cursor(r.head)),n.mainIndex);return i.eq(n)?!1:(t(e.update({selection:i})),!0)};function X8t(e,t){let{main:n,ranges:i}=e.selection,r=e.wordAt(n.head),s=r&&r.from==n.from&&r.to==n.to;for(let o=!1,l=new v1(e.doc,t,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new v1(e.doc,t,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(c=>c.from==l.value.from))continue;if(s){let c=e.wordAt(l.value.from);if(!c||c.from!=l.value.from||c.to!=l.value.to)continue}return l.value}}const Y8t=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(s=>s.from===s.to))return G8t({state:e,dispatch:t});let i=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(s=>e.sliceDoc(s.from,s.to)!=i))return!1;let r=X8t(e,i);return r?(t(e.update({selection:e.selection.addRange(ht.range(r.from,r.to),!1),effects:Jt.scrollIntoView(r.to)})),!0):!1},bO=mn.define({combine(e){return Ih(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new dBt(t),scrollToMatch:t=>Jt.scrollIntoView(t)})}});class lFe{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||F8t(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord,this.test=t.test}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(n,i)=>i=="n"?` -`:i=="r"?"\r":i=="t"?" ":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord&&this.test==t.test}create(){return this.regexp?new iBt(this):new eBt(this)}getCursor(t,n=0,i){let r=t.doc?t:tr.create({doc:t});return i==null&&(i=r.doc.length),this.regexp?fx(this,r,n,i):dx(this,r,n,i)}}class cFe{constructor(t){this.spec=t}}function Z8t(e,t,n){return(i,r,s,o)=>{if(n&&!n(i,r,s,o))return!1;let l=i>=o&&r<=o+s.length?s.slice(i-o,r-o):t.doc.sliceString(i,r);return e(l,t,i,r)}}function dx(e,t,n,i){let r;return e.wholeWord&&(r=J8t(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(r=Z8t(e.test,t,r)),new v1(t.doc,e.unquoted,n,i,e.caseSensitive?void 0:s=>s.toLowerCase(),r)}function J8t(e,t){return(n,i,r,s)=>((s>n||s+r.length=n)return null;r.push(i.value)}return r}highlight(t,n,i,r){let s=dx(this.spec,t,Math.max(0,n-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,t.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}function tBt(e,t,n){return(i,r,s)=>(!n||n(i,r,s))&&e(s[0],t,i,r)}function fx(e,t,n,i){let r;return e.wholeWord&&(r=nBt(t.charCategorizer(t.selection.main.head))),e.test&&(r=tBt(e.test,t,r)),new aFe(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:r},n,i)}function pP(e,t){return e.slice(Ro(e,t,!1),t)}function mP(e,t){return e.slice(t,Ro(e,t))}function nBt(e){return(t,n,i)=>!i[0].length||(e(pP(i.input,i.index))!=Qs.Word||e(mP(i.input,i.index))!=Qs.Word)&&(e(mP(i.input,i.index+i[0].length))!=Qs.Word||e(pP(i.input,i.index+i[0].length))!=Qs.Word)}class iBt extends cFe{nextMatch(t,n,i){let r=fx(this.spec,t,i,t.doc.length).next();return r.done&&(r=fx(this.spec,t,0,n).next()),r.done?null:r.value}prevMatchInRange(t,n,i){for(let r=1;;r++){let s=Math.max(n,i-r*1e4),o=fx(this.spec,t,s,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(s==n||l.from>s+10))return l;if(s==n)return null}}prevMatch(t,n,i){return this.prevMatchInRange(t,0,n)||this.prevMatchInRange(t,i,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,i)=>{if(i=="&")return t.match[0];if(i=="$")return"$";for(let r=i.length;r>0;r--){let s=+i.slice(0,r);if(s>0&&s=n)return null;r.push(i.value)}return r}highlight(t,n,i,r){let s=fx(this.spec,t,Math.max(0,n-250),Math.min(i+250,t.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}const JC=pi.define(),MW=pi.define(),Fg=dl.define({create(e){return new B$(E7(e).create(),null)},update(e,t){for(let n of t.effects)n.is(JC)?e=new B$(n.value.create(),e.panel):n.is(MW)&&(e=new B$(e.query,n.value?LW:null));return e},provide:e=>BC.from(e,t=>t.panel)});class B${constructor(t,n){this.query=t,this.panel=n}}const rBt=Fn.mark({class:"cm-searchMatch"}),sBt=Fn.mark({class:"cm-searchMatch cm-searchMatch-selected"}),aBt=ma.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(Fg))}update(e){let t=e.state.field(Fg);(t!=e.startState.field(Fg)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return Fn.none;let{view:n}=this,i=new tm;for(let r=0,s=n.visibleRanges,o=s.length;rs[r+1].from-2*250;)c=s[++r].to;e.highlight(n.state,l,c,(u,d)=>{let f=n.state.selection.ranges.some(h=>h.from==u&&h.to==d);i.add(u,d,f?sBt:rBt)})}return i.finish()}},{decorations:e=>e.decorations});function DT(e){return t=>{let n=t.state.field(Fg,!1);return n&&n.query.spec.valid?e(t,n):fFe(t)}}const gP=DT((e,{query:t})=>{let{to:n}=e.state.selection.main,i=t.nextMatch(e.state,n,n);if(!i)return!1;let r=ht.single(i.from,i.to),s=e.state.facet(bO);return e.dispatch({selection:r,effects:[$W(e,i),s.scrollToMatch(r.main,e)],userEvent:"select.search"}),dFe(e),!0}),bP=DT((e,{query:t})=>{let{state:n}=e,{from:i}=n.selection.main,r=t.prevMatch(n,i,i);if(!r)return!1;let s=ht.single(r.from,r.to),o=e.state.facet(bO);return e.dispatch({selection:s,effects:[$W(e,r),o.scrollToMatch(s.main,e)],userEvent:"select.search"}),dFe(e),!0}),oBt=DT((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:ht.create(n.map(i=>ht.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),lBt=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:i,to:r}=n.main,s=[],o=0;for(let l=new v1(e.doc,e.sliceDoc(i,r));!l.next().done;){if(s.length>1e3)return!1;l.value.from==i&&(o=s.length),s.push(ht.range(l.value.from,l.value.to))}return t(e.update({selection:ht.create(s,o),userEvent:"select.search.matches"})),!0},Qse=DT((e,{query:t})=>{let{state:n}=e,{from:i,to:r}=n.selection.main;if(n.readOnly)return!1;let s=t.nextMatch(n,i,i);if(!s)return!1;let o=s,l=[],c,u,d=[];o.precise?o.from==i&&o.to==r&&(u=n.toText(t.getReplacement(o)),l.push({from:o.from,to:o.to,insert:u}),o=t.nextMatch(n,o.from,o.to),d.push(Jt.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(i).number)+"."))):o=t.nextMatch(n,o.from,o.to);let f=e.state.changes(l);return o&&(c=ht.single(o.from,o.to).map(f),d.push($W(e,o)),d.push(n.facet(bO).scrollToMatch(c.main,e))),e.dispatch({changes:f,selection:c,effects:d,userEvent:"input.replace"}),!0}),cBt=DT((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let r of t.matchAll(e.state,1e9)){let{from:s,to:o,precise:l}=r;l&&n.push({from:s,to:o,insert:t.getReplacement(r)})}if(!n.length)return!1;let i=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:Jt.announce.of(i),userEvent:"input.replace.all"}),!0});function LW(e){return e.state.facet(bO).createPanel(e)}function E7(e,t){var n,i,r,s,o;let l=e.selection.main,c=l.empty||l.to>l.from+100?"":e.sliceDoc(l.from,l.to);if(t&&!c)return t;let u=e.facet(bO);return new lFe({search:((n=t==null?void 0:t.literal)!==null&&n!==void 0?n:u.literal)?c:c.replace(/\n/g,"\\n"),caseSensitive:(i=t==null?void 0:t.caseSensitive)!==null&&i!==void 0?i:u.caseSensitive,literal:(r=t==null?void 0:t.literal)!==null&&r!==void 0?r:u.literal,regexp:(s=t==null?void 0:t.regexp)!==null&&s!==void 0?s:u.regexp,wholeWord:(o=t==null?void 0:t.wholeWord)!==null&&o!==void 0?o:u.wholeWord})}function uFe(e){let t=eW(e,LW);return t&&t.dom.querySelector("[main-field]")}function dFe(e){let t=uFe(e);t&&t==e.root.activeElement&&t.select()}const fFe=e=>{let t=e.state.field(Fg,!1);if(t&&t.panel){let n=uFe(e);if(n&&n!=e.root.activeElement){let i=E7(e.state,t.query.spec);i.valid&&e.dispatch({effects:JC.of(i)}),n.focus(),n.select()}}else e.dispatch({effects:[MW.of(!0),t?JC.of(E7(e.state,t.query.spec)):pi.appendConfig.of(hBt)]});return!0},hFe=e=>{let t=e.state.field(Fg,!1);if(!t||!t.panel)return!1;let n=eW(e,LW);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:MW.of(!1)}),!0},uBt=[{key:"Mod-f",run:fFe,scope:"editor search-panel"},{key:"F3",run:gP,shift:bP,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:gP,shift:bP,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:hFe,scope:"editor search-panel"},{key:"Mod-Shift-l",run:lBt},{key:"Mod-Alt-g",run:B8t},{key:"Mod-d",run:Y8t,preventDefault:!0}];class dBt{constructor(t){this.view=t;let n=this.query=t.state.field(Fg).query.spec;this.commit=this.commit.bind(this),this.searchField=Kr("input",{value:n.search,placeholder:ru(t,"Find"),"aria-label":ru(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Kr("input",{value:n.replace,placeholder:ru(t,"Replace"),"aria-label":ru(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Kr("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=Kr("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=Kr("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function i(r,s,o){return Kr("button",{class:"cm-button",name:r,onclick:s,type:"button"},o)}this.dom=Kr("div",{onkeydown:r=>this.keydown(r),class:"cm-search"},[this.searchField,i("next",()=>gP(t),[ru(t,"next")]),i("prev",()=>bP(t),[ru(t,"previous")]),i("select",()=>oBt(t),[ru(t,"all")]),Kr("label",null,[this.caseField,ru(t,"match case")]),Kr("label",null,[this.reField,ru(t,"regexp")]),Kr("label",null,[this.wordField,ru(t,"by word")]),...t.state.readOnly?[]:[Kr("br"),this.replaceField,i("replace",()=>Qse(t),[ru(t,"replace")]),i("replaceAll",()=>cBt(t),[ru(t,"replace all")])],Kr("button",{name:"close",onclick:()=>hFe(t),"aria-label":ru(t,"close"),type:"button"},["×"])])}commit(){let t=new lFe({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:JC.of(t)}))}keydown(t){aDt(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?bP:gP)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),Qse(this.view))}update(t){for(let n of t.transactions)for(let i of n.effects)i.is(JC)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(bO).top}}function ru(e,t){return e.state.phrase(t)}const lj=30,cj=/[\s\.,:;?!]/;function $W(e,{from:t,to:n}){let i=e.state.doc.lineAt(t),r=e.state.doc.lineAt(n).to,s=Math.max(i.from,t-lj),o=Math.min(r,n+lj),l=e.state.sliceDoc(s,o);if(s!=i.from){for(let c=0;cl.length-lj;c--)if(!cj.test(l[c-1])&&cj.test(l[c])){l=l.slice(0,c);break}}return Jt.announce.of(`${e.state.phrase("current match")}. ${l} ${e.state.phrase("on line")} ${i.number}.`)}const fBt=Jt.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),hBt=[Fg,gm.low(aBt),fBt];class zse{constructor(t,n,i){this.from=t,this.to=n,this.diagnostic=i}}class Sy{constructor(t,n,i){this.diagnostics=t,this.panel=n,this.selected=i}static init(t,n,i){let r=i.facet(eA).markerFilter;r&&(t=r(t,i));let s=t.slice().sort((m,g)=>m.from-g.from||m.to-g.to),o=new tm,l=[],c=0,u=i.doc.iter(),d=0,f=i.doc.length;for(let m=0;;){let g=m==s.length?null:s[m];if(!g&&!l.length)break;let b,v;if(l.length)b=c,v=l.reduce((x,O)=>Math.min(x,O.to),g&&g.from>b?g.from:1e8);else{if(b=g.from,b>f)break;v=g.to,l.push(g),m++}for(;mx.from||x.to==b))l.push(x),m++,v=Math.min(x.to,v);else{v=Math.min(x.from,v);break}}v=Math.min(v,f);let y=!1;if(l.some(x=>x.from==b&&(x.to==v||v==f))&&(y=b==v,!y&&v-b<10)){let x=b-(d+u.value.length);x>0&&(u.next(x),d=b);for(let O=b;;){if(O>=v){y=!0;break}if(!u.lineBreak&&d+u.value.length>O)break;O=d+u.value.length,d+=u.value.length,u.next()}}let w=CBt(l);if(y)o.add(b,b,Fn.widget({widget:new OBt(w),diagnostics:l.slice()}));else{let x=l.reduce((O,k)=>k.markClass?O+" "+k.markClass:O,"");o.add(b,v,Fn.mark({class:"cm-lintRange cm-lintRange-"+w+x,diagnostics:l.slice(),inclusiveEnd:l.some(O=>O.to>v)}))}if(c=v,c==f)break;for(let x=0;x{if(!(t&&o.diagnostics.indexOf(t)<0))if(!i)i=new zse(r,s,t||o.diagnostics[0]);else{if(o.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new zse(i.from,s,i.diagnostic)}}),i}function pBt(e,t){let n=t.pos,i=t.end||n,r=e.state.facet(eA).hideOn(e,n,i);if(r!=null)return r;let s=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(o=>o.is(pFe))||e.changes.touchesRange(s.from,Math.max(s.to,i)))}function mBt(e,t){return e.field(ku,!1)?t:t.concat(pi.appendConfig.of(ABt))}const pFe=pi.define(),FW=pi.define(),mFe=pi.define(),ku=dl.define({create(){return new Sy(Fn.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),i=null,r=e.panel;if(e.selected){let s=t.changes.mapPos(e.selected.from,1);i=yb(n,e.selected.diagnostic,s)||yb(n,null,s)}!n.size&&r&&t.state.facet(eA).autoPanel&&(r=null),e=new Sy(n,r,i)}for(let n of t.effects)if(n.is(pFe)){let i=t.state.facet(eA).autoPanel?n.value.length?tA.open:null:e.panel;e=Sy.init(n.value,i,t.state)}else n.is(FW)?e=new Sy(e.diagnostics,n.value?tA.open:null,e.selected):n.is(mFe)&&(e=new Sy(e.diagnostics,e.panel,n.value));return e},provide:e=>[BC.from(e,t=>t.panel),Jt.decorations.from(e,t=>t.diagnostics)]}),gBt=Fn.mark({class:"cm-lintRange cm-lintRange-active"});function bBt(e,t,n){let{diagnostics:i}=e.state.field(ku),r,s=-1,o=-1;i.between(t-(n<0?1:0),t+(n>0?1:0),(c,u,{spec:d})=>{if(t>=c&&t<=u&&(c==u||(t>c||n>0)&&(tbFe(e,n,!1)))}const vBt=e=>{let t=e.state.field(ku,!1);(!t||!t.panel)&&e.dispatch({effects:mBt(e.state,[FW.of(!0)])});let n=eW(e,tA.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},Vse=e=>{let t=e.state.field(ku,!1);return!t||!t.panel?!1:(e.dispatch({effects:FW.of(!1)}),!0)},xBt=e=>{let t=e.state.field(ku,!1);if(!t)return!1;let n=e.state.selection.main,i=yb(t.diagnostics,null,n.to+1);return!i&&(i=yb(t.diagnostics,null,0),!i||i.from==n.from&&i.to==n.to)?!1:(e.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),GDt(e,i.from,1,{tooltip:yFe,until:r=>r.docChanged||r.newSelection.main.headi.to}),!0)},wBt=[{key:"Mod-Shift-m",run:vBt,preventDefault:!0},{key:"F8",run:xBt}],eA=mn.define({combine(e){return{sources:e.map(t=>t.source).filter(t=>t!=null),...Ih(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:Hse,tooltipFilter:Hse,needsRefresh:(t,n)=>t?n?i=>t(i)||n(i):t:n,hideOn:(t,n)=>t?n?(i,r,s)=>t(i,r,s)||n(i,r,s):t:n,autoPanel:(t,n)=>t||n})}}});function Hse(e,t){return e?t?(n,i)=>t(e(n,i),i):e:t}function gFe(e){let t=[];if(e)e:for(let{name:n}of e){for(let i=0;is.toLowerCase()==r.toLowerCase())){t.push(r);continue e}}t.push("")}return t}function bFe(e,t,n){var i;let r=n?gFe(t.actions):[];return Kr("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},Kr("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),(i=t.actions)===null||i===void 0?void 0:i.map((s,o)=>{let l=!1,c=m=>{if(m.preventDefault(),l)return;l=!0;let g=yb(e.state.field(ku).diagnostics,t);g&&s.apply(e,g.from,g.to)},{name:u}=s,d=r[o]?u.indexOf(r[o]):-1,f=d<0?u:[u.slice(0,d),Kr("u",u.slice(d,d+1)),u.slice(d+1)],h=s.markClass?" "+s.markClass:"";return Kr("button",{type:"button",class:"cm-diagnosticAction"+h,onclick:c,onmousedown:c,"aria-label":` Action: ${u}${d<0?"":` (access key "${r[o]})"`}.`},f)}),t.source&&Kr("div",{class:"cm-diagnosticSource"},t.source))}class OBt extends jf{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return Kr("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class qse{constructor(t,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=bFe(t,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class tA{constructor(t){this.view=t,this.items=[];let n=r=>{if(!(r.ctrlKey||r.altKey||r.metaKey)){if(r.keyCode==27)Vse(this.view),this.view.focus();else if(r.keyCode==38||r.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(r.keyCode==40||r.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(r.keyCode==36)this.moveSelection(0);else if(r.keyCode==35)this.moveSelection(this.items.length-1);else if(r.keyCode==13)this.view.focus();else if(r.keyCode>=65&&r.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],o=gFe(s.actions);for(let l=0;l{for(let s=0;sVse(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(ku).selected;if(!t)return-1;for(let n=0;n{for(let d of u.diagnostics){if(o.has(d))continue;o.add(d);let f=-1,h;for(let m=i;mi&&(this.items.splice(i,f-i),r=!0)),n&&h.diagnostic==n.diagnostic?h.dom.hasAttribute("aria-selected")||(h.dom.setAttribute("aria-selected","true"),s=h):h.dom.hasAttribute("aria-selected")&&h.dom.removeAttribute("aria-selected"),i++}});i({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:c})=>{let u=c.height/this.list.offsetHeight;l.topc.bottom&&(this.list.scrollTop+=(l.bottom-c.bottom)/u)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let t=this.list.firstChild;function n(){let i=t;t=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;t!=i.dom;)n();t=i.dom.nextSibling}else this.list.insertBefore(i.dom,t);for(;t;)n()}moveSelection(t){if(this.selectedIndex<0)return;let n=this.view.state.field(ku),i=yb(n.diagnostics,this.items[t].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:mFe.of(i)})}static open(t){return new tA(t)}}function kBt(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(e)}')`}function uj(e){return kBt(``,'width="6" height="3"')}const SBt=Jt.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:uj("#f11")},".cm-lintRange-warning":{backgroundImage:uj("orange")},".cm-lintRange-info":{backgroundImage:uj("#999")},".cm-lintRange-hint":{backgroundImage:uj("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function EBt(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}function CBt(e){let t="hint",n=1;for(let i of e){let r=EBt(i.severity);r>n&&(n=r,t=i.severity)}return t}const yFe=KDt(bBt,{hideOn:pBt}),ABt=[ku,Jt.decorations.compute([ku],e=>{let{selected:t,panel:n}=e.field(ku);return!t||!n||t.from==t.to?Fn.none:Fn.set([gBt.range(t.from,t.to)])}),yFe,SBt];var Wse=function(t){t===void 0&&(t={});var n=t,i=n.crosshairCursor,r=i===void 0?!1:i,s=[];t.closeBracketsKeymap!==!1&&(s=s.concat(P5t)),t.defaultKeymap!==!1&&(s=s.concat(L8t)),t.searchKeymap!==!1&&(s=s.concat(uBt)),t.historyKeymap!==!1&&(s=s.concat(VFt)),t.foldKeymap!==!1&&(s=s.concat($Mt)),t.completionKeymap!==!1&&(s=s.concat(X4e)),t.lintKeymap!==!1&&(s=s.concat(wBt));var o=[];return t.lineNumbers!==!1&&o.push(h4e()),t.highlightActiveLineGutter!==!1&&o.push(uMt()),t.highlightSpecialChars!==!1&&o.push(kDt()),t.history!==!1&&o.push(DFt()),t.foldGutter!==!1&&o.push(QMt()),t.drawSelection!==!1&&o.push(fDt()),t.dropCursor!==!1&&o.push(bDt()),t.allowMultipleSelections!==!1&&o.push(tr.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&o.push(jMt()),t.syntaxHighlighting!==!1&&o.push(T4e(qMt,{fallback:!0})),t.bracketMatching!==!1&&o.push(JMt()),t.closeBrackets!==!1&&o.push(j5t()),t.autocompletion!==!1&&o.push(U5t()),t.rectangularSelection!==!1&&o.push(LDt()),r!==!1&&o.push(BDt()),t.highlightActiveLine!==!1&&o.push(_Dt()),t.highlightSelectionMatches!==!1&&o.push(z8t()),t.tabSize&&typeof t.tabSize=="number"&&o.push(pO.of(" ".repeat(t.tabSize))),o.concat([hO.of(s.flat())]).filter(Boolean)};const TBt="#e5c07b",Kse="#e06c75",_Bt="#56b6c2",jBt="#ffffff",GN="#abb2bf",C7="#7d8799",NBt="#61afef",RBt="#98c379",Gse="#d19a66",IBt="#c678dd",PBt="#21252b",Xse="#2c313a",Yse="#282c34",U$="#353a42",DBt="#3E4451",Zse="#528bff",MBt=Jt.theme({"&":{color:GN,backgroundColor:Yse},".cm-content":{caretColor:Zse},".cm-cursor, .cm-dropCursor":{borderLeftColor:Zse},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:DBt},".cm-panels":{backgroundColor:PBt,color:GN},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:Yse,color:C7,border:"none"},".cm-activeLineGutter":{backgroundColor:Xse},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:U$},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:U$,borderBottomColor:U$},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Xse,color:GN}}},{dark:!0}),LBt=RT.define([{tag:fe.keyword,color:IBt},{tag:[fe.name,fe.deleted,fe.character,fe.propertyName,fe.macroName],color:Kse},{tag:[fe.function(fe.variableName),fe.labelName],color:NBt},{tag:[fe.color,fe.constant(fe.name),fe.standard(fe.name)],color:Gse},{tag:[fe.definition(fe.name),fe.separator],color:GN},{tag:[fe.typeName,fe.className,fe.number,fe.changed,fe.annotation,fe.modifier,fe.self,fe.namespace],color:TBt},{tag:[fe.operator,fe.operatorKeyword,fe.url,fe.escape,fe.regexp,fe.link,fe.special(fe.string)],color:_Bt},{tag:[fe.meta,fe.comment],color:C7},{tag:fe.strong,fontWeight:"bold"},{tag:fe.emphasis,fontStyle:"italic"},{tag:fe.strikethrough,textDecoration:"line-through"},{tag:fe.link,color:C7,textDecoration:"underline"},{tag:fe.heading,fontWeight:"bold",color:Kse},{tag:[fe.atom,fe.bool,fe.special(fe.variableName)],color:Gse},{tag:[fe.processingInstruction,fe.string,fe.inserted],color:RBt},{tag:fe.invalid,color:jBt}]),$Bt=[MBt,T4e(LBt)];var FBt=Jt.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),BBt=function(t){t===void 0&&(t={});var n=t,i=n.indentWithTab,r=i===void 0?!0:i,s=n.editable,o=s===void 0?!0:s,l=n.readOnly,c=l===void 0?!1:l,u=n.theme,d=u===void 0?"light":u,f=n.placeholder,h=f===void 0?"":f,m=n.basicSetup,g=m===void 0?!0:m,b=[];switch(r&&b.unshift(hO.of([$8t])),g&&(typeof g=="boolean"?b.unshift(Wse()):b.unshift(Wse(g))),h&&b.unshift(IDt(h)),d){case"light":b.push(FBt);break;case"dark":b.push($Bt);break;case"none":break;default:b.push(d);break}return o===!1&&b.push(Jt.editable.of(!1)),c&&b.push(tr.readOnly.of(!0)),[...b]},UBt=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(t=>!t.empty)});class QBt{constructor(t,n){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=n,this.timeoutMS=n,this.callbacks.push(t)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var t=this.callbacks.slice();this.callbacks.length=0,t.forEach(n=>{try{n()}catch(i){console.error("TimeoutLatch callback error:",i)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class Jse{constructor(){this.interval=null,this.latches=new Set}add(t){this.latches.add(t),this.start()}remove(t){this.latches.delete(t),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(t=>{t.tick(),t.isDone&&this.remove(t)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}}var Q$=null,zBt=()=>typeof window>"u"?new Jse:(Q$||(Q$=new Jse),Q$),VBt=Jt.theme({"& .cm-scroller":{height:"100% !important"}}),eae=null,z$=null;function HBt(e,t,n,i,r,s){if(!e&&!t&&!n&&!i&&!r&&!s)return null;var o=JSON.stringify({height:e,minHeight:t,maxHeight:n,width:i,minWidth:r,maxWidth:s});return o===eae||(eae=o,z$=Jt.theme({"&":{height:e,minHeight:t,maxHeight:n,width:i,minWidth:r,maxWidth:s}})),z$}var tae=Rh.define(),qBt=200,WBt=[];function KBt(e){var t=e.value,n=e.selection,i=e.onChange,r=e.onStatistics,s=e.onCreateEditor,o=e.onUpdate,l=e.extensions,c=l===void 0?WBt:l,u=e.autoFocus,d=e.theme,f=d===void 0?"light":d,h=e.height,m=h===void 0?null:h,g=e.minHeight,b=g===void 0?null:g,v=e.maxHeight,y=v===void 0?null:v,w=e.width,x=w===void 0?null:w,O=e.minWidth,k=O===void 0?null:O,S=e.maxWidth,C=S===void 0?null:S,E=e.placeholder,j=E===void 0?"":E,T=e.editable,R=T===void 0?!0:T,A=e.readOnly,N=A===void 0?!1:A,P=e.indentWithTab,I=P===void 0?!0:P,D=e.basicSetup,_=D===void 0?!0:D,L=e.root,F=e.initialState,M=p.useState(),V=M[0],q=M[1],U=p.useState(),J=U[0],z=U[1],Z=p.useState(),ne=Z[0],W=Z[1],G=p.useState(()=>({current:null}))[0],H=p.useState(()=>({current:null}))[0],se=HBt(m,b,y,x,k,C),Y=Jt.updateListener.of(ee=>{if(ee.docChanged&&typeof i=="function"&&!ee.transactions.some(pe=>pe.annotation(tae))){G.current?G.current.reset():(G.current=new QBt(()=>{if(H.current){var pe=H.current;H.current=null,pe()}G.current=null},qBt),zBt().add(G.current));var be=ee.state.doc,ue=be.toString();i(ue,ee)}r&&r(UBt(ee))}),X=BBt({theme:f,editable:R,readOnly:N,placeholder:j,indentWithTab:I,basicSetup:_}),ie=[Y,...se?[se]:[],VBt,...X];return o&&typeof o=="function"&&ie.push(Jt.updateListener.of(o)),ie=ie.concat(c),p.useLayoutEffect(()=>{if(V&&!ne){var ee={doc:t,selection:n,extensions:ie},be=F?tr.fromJSON(F.json,ee,F.fields):tr.create(ee);if(W(be),!J){var ue=new Jt({state:be,parent:V,root:L});z(ue),s&&s(ue,be)}}return()=>{J&&(W(void 0),z(void 0))}},[V,ne]),p.useEffect(()=>{e.container&&q(e.container)},[e.container]),p.useEffect(()=>()=>{J&&(J.destroy(),z(void 0)),G.current&&(G.current.cancel(),G.current=null)},[J]),p.useEffect(()=>{u&&J&&J.focus()},[u,J]),p.useEffect(()=>{J&&J.dispatch({effects:pi.reconfigure.of(ie)})},[f,c,m,b,y,x,k,C,j,R,N,I,_,i,o]),p.useEffect(()=>{if(t!==void 0){var ee=J?J.state.doc.toString():"";if(J&&t!==ee){var be=G.current&&!G.current.isDone,ue=()=>{J&&t!==J.state.doc.toString()&&J.dispatch({changes:{from:0,to:J.state.doc.toString().length,insert:t||""},annotations:[tae.of(!0)]})};be?H.current=ue:ue()}}},[t,J]),{state:ne,setState:W,view:J,setView:z,container:V,setContainer:q}}var GBt=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],vFe=p.forwardRef((e,t)=>{var n=e.className,i=e.value,r=i===void 0?"":i,s=e.selection,o=e.extensions,l=o===void 0?[]:o,c=e.onChange,u=e.onStatistics,d=e.onCreateEditor,f=e.onUpdate,h=e.autoFocus,m=e.theme,g=m===void 0?"light":m,b=e.height,v=e.minHeight,y=e.maxHeight,w=e.width,x=e.minWidth,O=e.maxWidth,k=e.basicSetup,S=e.placeholder,C=e.indentWithTab,E=e.editable,j=e.readOnly,T=e.root,R=e.initialState,A=EFt(e,GBt),N=p.useRef(null),P=KBt({root:T,value:r,autoFocus:h,theme:g,height:b,minHeight:v,maxHeight:y,width:w,minWidth:x,maxWidth:O,basicSetup:k,placeholder:S,indentWithTab:C,editable:E,readOnly:j,selection:s,onChange:c,onStatistics:u,onCreateEditor:d,onUpdate:f,extensions:l,initialState:R}),I=P.state,D=P.view,_=P.container,L=P.setContainer;p.useImperativeHandle(t,()=>({editor:N.current,state:I,view:D}),[N,_,I,D]);var F=p.useCallback(V=>{N.current=V,L(V)},[L]);if(typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var M=typeof g=="string"?"cm-theme-"+g:"cm-theme";return a.jsx("div",x7({ref:F,className:""+M+(n?" "+n:"")},A))});vFe.displayName="CodeMirror";function xFe(e){const t=e.toLowerCase(),n=t.split("/").pop()??t,i=n.includes(".")?n.split(".").pop():"";return n==="dockerfile"||n.startsWith("dockerfile.")||n.endsWith(".dockerfile")?[rW.define(SFt)]:i==="py"||i==="pyi"?[P6t()]:["ts","tsx","mts","cts"].includes(i??"")?[o7({typescript:!0,jsx:i==="tsx"})]:["js","jsx","mjs","cjs"].includes(i??"")?[o7({jsx:i==="jsx"})]:i==="json"||i==="jsonc"?[e3t()]:i==="yaml"||i==="yml"?[uFt()]:["md","markdown"].includes(i??"")?[p$t()]:[]}function MT({value:e,path:t,onChange:n,readOnly:i=!1,theme:r="light",lineNumberStart:s=1,height:o="100%",minHeight:l,maxHeight:c,extensions:u}){const d=p.useMemo(()=>[...xFe(t),...s===1?[]:[h4e({formatNumber:f=>String(f+s-1)})],...u??[]],[s,t,u]);return a.jsx(vFe,{value:e,height:o,minHeight:l,maxHeight:c,theme:r,extensions:d,editable:!i,onChange:n,basicSetup:{lineNumbers:s===1,foldGutter:!0,highlightActiveLine:!0,highlightActiveLineGutter:!0,autocompletion:!1}})}const wFe=Object.freeze(Object.defineProperty({__proto__:null,default:MT,languageFor:xFe},Symbol.toStringTag,{value:"Module"}));function XBt(e){var s;const t=e.split(/\r?\n/);if(((s=t[0])==null?void 0:s.trim())!=="---")return{body:e,frontmatter:[]};const n=t.findIndex((o,l)=>l>0&&o.trim()==="---");if(n<0)return{body:e,frontmatter:[]};const i=M5e(t.slice(1,n).join(` +`,{label:"if",detail:"block",type:"keyword"}),Ys("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),Ys("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),Ys("import ${module}",{label:"import",detail:"statement",type:"keyword"}),Ys("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],D6t=Q4e(p6e,cW(I6t.concat(P6t)));function D$(e){let{node:t,pos:n}=e,i=e.lineIndent(n,-1),r=null;for(;;){let s=t.childBefore(n);if(s)if(s.name=="Comment")n=s.from;else if(s.name=="Body"||s.name=="MatchBody")e.baseIndentFor(s)+e.unit<=i&&(r=s),t=s;else if(s.name=="MatchClause")t=s;else if(s.type.is("Statement"))t=s;else break;else break}return r}function M$(e,t){let n=e.baseIndentFor(t),i=e.lineAt(e.pos,-1),r=i.from+i.text.length;return/^\s*($|#)/.test(i.text)&&e.node.ton?null:n+e.unit}const L$=sm.define({name:"python",parser:j6t.configure({props:[vm.add({Body:e=>{var t;let n=/^\s*(#|$)/.test(e.textAfter)&&D$(e)||e.node;return(t=M$(e,n))!==null&&t!==void 0?t:e.continue()},MatchBody:e=>{var t;let n=D$(e);return(t=M$(e,n||e.node))!==null&&t!==void 0?t:e.continue()},IfStatement:e=>/^\s*(else:|elif )/.test(e.textAfter)?e.baseIndent:e.continue(),"ForStatement WhileStatement":e=>/^\s*else:/.test(e.textAfter)?e.baseIndent:e.continue(),TryStatement:e=>/^\s*(except[ :]|finally:|else:)/.test(e.textAfter)?e.baseIndent:e.continue(),MatchStatement:e=>/^\s*case /.test(e.textAfter)?e.baseIndent+e.unit:e.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":ww({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":ww({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":ww({closing:"]"}),MemberExpression:e=>e.baseIndent+e.unit,"String FormatString":()=>null,Script:e=>{var t;let n=D$(e);return(t=n&&M$(e,n))!==null&&t!==void 0?t:e.continue()}}),xm.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":NT,Body:(e,t)=>({from:e.from+1,to:e.to-(e.to==t.doc.length?0:1)}),"String FormatString":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/}});function M6t(){return new yb(L$,[L$.data.of({autocomplete:R6t}),L$.data.of({autocomplete:D6t})])}const dx=63,jse=64,L6t=1,$6t=2,m6e=3,F6t=4,g6e=5,B6t=6,U6t=7,b6e=65,Q6t=66,z6t=8,V6t=9,H6t=10,q6t=11,W6t=12,y6e=13,K6t=19,G6t=20,X6t=29,Y6t=33,Z6t=34,J6t=47,eFt=0,NW=1,b7=2,JC=3,y7=4;class Sy{constructor(t,n,i){this.parent=t,this.depth=n,this.type=i,this.hash=(t?t.hash+t.hash<<8:0)+n+(n<<4)+i}}Sy.top=new Sy(null,-1,eFt);function TE(e,t){for(let n=0,i=t-e.pos-1;;i--,n++){let r=e.peek(i);if(om(r)||r==-1)return n}}function v7(e){return e==32||e==9}function om(e){return e==10||e==13}function v6e(e){return v7(e)||om(e)}function Ly(e){return e<0||v6e(e)}const tFt=new rL({start:Sy.top,reduce(e,t){return e.type==JC&&(t==G6t||t==Z6t)?e.parent:e},shift(e,t,n,i){if(t==m6e)return new Sy(e,TE(i,i.pos),NW);if(t==b6e||t==g6e)return new Sy(e,TE(i,i.pos),b7);if(t==dx)return e.parent;if(t==K6t||t==Y6t)return new Sy(e,0,JC);if(t==y6e&&e.type==y7)return e.parent;if(t==J6t){let r=/[1-9]/.exec(i.read(i.pos,n.pos));if(r)return new Sy(e,e.depth+ +r[0],y7)}return e},hash(e){return e.hash}});function v1(e,t,n=0){return e.peek(n)==t&&e.peek(n+1)==t&&e.peek(n+2)==t&&Ly(e.peek(n+3))}const nFt=new Ia((e,t)=>{if(e.next==-1&&t.canShift(jse))return e.acceptToken(jse);let n=e.peek(-1);if((om(n)||n<0)&&t.context.type!=JC){if(v1(e,45))if(t.canShift(dx))e.acceptToken(dx);else return e.acceptToken(L6t,3);if(v1(e,46))if(t.canShift(dx))e.acceptToken(dx);else return e.acceptToken($6t,3);let i=0;for(;e.next==32;)i++,e.advance();(i{if(t.context.type==JC){e.next==63&&(e.advance(),Ly(e.next)&&e.acceptToken(U6t));return}if(e.next==45)e.advance(),Ly(e.next)&&e.acceptToken(t.context.type==NW&&t.context.depth==TE(e,e.pos-1)?F6t:m6e);else if(e.next==63)e.advance(),Ly(e.next)&&e.acceptToken(t.context.type==b7&&t.context.depth==TE(e,e.pos-1)?B6t:g6e);else{let n=e.pos;for(;;)if(v7(e.next)){if(e.pos==n)return;e.advance()}else if(e.next==33)x6e(e);else if(e.next==38)x7(e);else if(e.next==42){x7(e);break}else if(e.next==39||e.next==34){if(RW(e,!0))break;return}else if(e.next==91||e.next==123){if(!sFt(e))return;break}else{w6e(e,!0,!1,0);break}for(;v7(e.next);)e.advance();if(e.next==58){if(e.pos==n&&t.canShift(X6t))return;let i=e.peek(1);Ly(i)&&e.acceptTokenTo(t.context.type==b7&&t.context.depth==TE(e,n)?Q6t:b6e,n)}}},{contextual:!0});function rFt(e){return e>32&&e<127&&e!=34&&e!=37&&e!=44&&e!=60&&e!=62&&e!=92&&e!=94&&e!=96&&e!=123&&e!=124&&e!=125}function Nse(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function Rse(e,t){return e.next==37?(e.advance(),Nse(e.next)&&e.advance(),Nse(e.next)&&e.advance(),!0):rFt(e.next)||t&&e.next==44?(e.advance(),!0):!1}function x6e(e){if(e.advance(),e.next==60){for(e.advance();;)if(!Rse(e,!0)){e.next==62&&e.advance();break}}else for(;Rse(e,!1););}function x7(e){for(e.advance();!Ly(e.next)&&dP(e.next)!="f";)e.advance()}function RW(e,t){let n=e.next,i=!1,r=e.pos;for(e.advance();;){let s=e.next;if(s<0)break;if(e.advance(),s==n)if(s==39)if(e.next==39)e.advance();else break;else break;else if(s==92&&n==34)e.next>=0&&e.advance();else if(om(s)){if(t)return!1;i=!0}else if(t&&e.pos>=r+1024)return!1}return!i}function sFt(e){for(let t=[],n=e.pos+1024;;)if(e.next==91||e.next==123)t.push(e.next),e.advance();else if(e.next==39||e.next==34){if(!RW(e,!0))return!1}else if(e.next==93||e.next==125){if(t[t.length-1]!=e.next-2)return!1;if(t.pop(),e.advance(),!t.length)return!0}else{if(e.next<0||e.pos>n||om(e.next))return!1;e.advance()}}const aFt="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function dP(e){return e<33?"u":e>125?"s":aFt[e-33]}function $$(e,t){let n=dP(e);return n!="u"&&!(t&&n=="f")}function w6e(e,t,n,i){if(dP(e.next)=="s"||(e.next==63||e.next==58||e.next==45)&&$$(e.peek(1),n))e.advance();else return!1;let r=e.pos;for(;;){let s=e.next,o=0,l=i+1;for(;v6e(s);){if(om(s)){if(t)return!1;l=0}else l++;s=e.peek(++o)}if(!(s>=0&&(s==58?$$(e.peek(o+1),n):s==35?e.peek(o-1)!=32:$$(s,n)))||!n&&l<=i||l==0&&!n&&(v1(e,45,o)||v1(e,46,o)))break;if(t&&dP(s)=="f")return!1;for(let u=o;u>=0;u--)e.advance();if(t&&e.pos>r+1024)return!1}return!0}const oFt=new Ia((e,t)=>{if(e.next==33)x6e(e),e.acceptToken(W6t);else if(e.next==38||e.next==42){let n=e.next==38?H6t:q6t;x7(e),e.acceptToken(n)}else e.next==39||e.next==34?(RW(e,!1),e.acceptToken(V6t)):w6e(e,!1,t.context.type==JC,t.context.depth)&&e.acceptToken(z6t)}),lFt=new Ia((e,t)=>{let n=t.context.type==y7?t.context.depth:-1,i=e.pos;e:for(;;){let r=0,s=e.next;for(;s==32;)s=e.peek(++r);if(!r&&(v1(e,45,r)||v1(e,46,r))||!om(s)&&(n<0&&(n=Math.max(t.context.depth+1,r)),rYAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:tFt,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[cFt],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[nFt,iFt,oFt,lFt,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),dFt=sm.define({name:"yaml",parser:uFt.configure({props:[vm.add({Stream:e=>{for(let t=e.node.resolve(e.pos,-1);t&&t.to>=e.pos;t=t.parent){if(t.name=="BlockLiteralContent"&&t.frome.pos)return null}}return null},FlowMapping:ww({closing:"}"}),FlowSequence:ww({closing:"]"})}),xm.add({"FlowMapping FlowSequence":NT,"Item Pair BlockLiteral":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function fFt(){return new yb(dFt)}function hFt(e){O6e(e,"start");var t={},n=e.languageData||{},i=!1;for(var r in e)if(r!=n&&e.hasOwnProperty(r))for(var s=t[r]=[],o=e[r],l=0;l2&&o.token&&typeof o.token!="string"){n.pending=[];for(var u=2;u-1)return null;var r=n.indent.length-1,s=e[n.state];e:for(;;){for(var o=0;o{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),i=PW(e.state,n.from);return i.line?_Ft(e):i.block?NFt(e):!1};function IW(e,t){return({state:n,dispatch:i})=>{if(n.readOnly)return!1;let r=e(t,n);return r?(i(n.update(r)),!0):!1}}const _Ft=IW(PFt,0),jFt=IW(A6e,0),NFt=IW((e,t)=>A6e(e,t,IFt(t)),0);function PW(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const jk=50;function RFt(e,{open:t,close:n},i,r){let s=e.sliceDoc(i-jk,i),o=e.sliceDoc(r,r+jk),l=/\s*$/.exec(s)[0].length,c=/^\s*/.exec(o)[0].length,u=s.length-l;if(s.slice(u-t.length,u)==t&&o.slice(c,c+n.length)==n)return{open:{pos:i-l,margin:l&&1},close:{pos:r+c,margin:c&&1}};let d,f;r-i<=2*jk?d=f=e.sliceDoc(i,r):(d=e.sliceDoc(i,i+jk),f=e.sliceDoc(r-jk,r));let h=/^\s*/.exec(d)[0].length,m=/\s*$/.exec(f)[0].length,g=f.length-m-n.length;return d.slice(h,h+t.length)==t&&f.slice(g,g+n.length)==n?{open:{pos:i+h+t.length,margin:/\s/.test(d.charAt(h+t.length))?1:0},close:{pos:r-m-n.length,margin:/\s/.test(f.charAt(g-1))?1:0}}:null}function IFt(e){let t=[];for(let n of e.selection.ranges){let i=e.doc.lineAt(n.from),r=n.to<=i.to?i:e.doc.lineAt(n.to);r.from>i.from&&r.from==n.to&&(r=n.to==i.to+1?i:e.doc.lineAt(n.to-1));let s=t.length-1;s>=0&&t[s].to>i.from?t[s].to=r.to:t.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return t}function A6e(e,t,n=t.selection.ranges){let i=n.map(s=>PW(t,s.from).block);if(!i.every(s=>s))return null;let r=n.map((s,o)=>RFt(t,i[o],s.from,s.to));if(e!=2&&!r.every(s=>s))return{changes:t.changes(n.map((s,o)=>r[o]?[]:[{from:s.from,insert:i[o].open+" "},{from:s.to,insert:" "+i[o].close}]))};if(e!=1&&r.some(s=>s)){let s=[];for(let o=0,l;or&&(s==o||o>f.from)){r=f.from;let h=/^\s*/.exec(f.text)[0].length,m=h==f.length,g=f.text.slice(h,h+u.length)==u?h:-1;hs.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:l,token:c,indent:u,empty:d,single:f}of i)(f||!d)&&s.push({from:l.from+u,insert:c+" "});let o=t.changes(s);return{changes:o,selection:t.selection.map(o,1)}}else if(e!=1&&i.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:l,token:c}of i)if(l>=0){let u=o.from+l,d=u+c.length;o.text[d-o.from]==" "&&d++,s.push({from:u,to:d})}return{changes:s}}return null}const O7=Ih.define(),DFt=Ih.define(),MFt=mn.define(),T6e=mn.define({combine(e){return Ph(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,n)=>(i,r)=>t(i,r)||n(i,r)})}}),_6e=dl.define({create(){return dh.empty},update(e,t){let n=t.state.facet(T6e),i=t.annotation(O7);if(i){let c=Lc.fromTransaction(t,i.selection),u=i.side,d=u==0?e.undone:e.done;return c?d=fP(d,d.length,n.minDepth,c):d=R6e(d,t.startState.selection),new dh(u==0?i.rest:d,u==0?d:i.rest)}let r=t.annotation(DFt);if((r=="full"||r=="before")&&(e=e.isolate()),t.annotation(Xa.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let s=Lc.fromTransaction(t),o=t.annotation(Xa.time),l=t.annotation(Xa.userEvent);return s?e=e.addChanges(s,o,l,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,l,n.newGroupDelay)),(r=="full"||r=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(t=>t.toJSON()),undone:e.undone.map(t=>t.toJSON())}},fromJSON(e){return new dh(e.done.map(Lc.fromJSON),e.undone.map(Lc.fromJSON))}});function LFt(e={}){return[_6e,T6e.of(e),Jt.domEventHandlers({beforeinput(t,n){let i=t.inputType=="historyUndo"?j6e:t.inputType=="historyRedo"?k7:null;return i?(t.preventDefault(),i(n)):!1}})]}function lL(e,t){return function({state:n,dispatch:i}){if(!t&&n.readOnly)return!1;let r=n.field(_6e,!1);if(!r)return!1;let s=r.pop(e,n,t);return s?(i(s),!0):!1}}const j6e=lL(0,!1),k7=lL(1,!1),$Ft=lL(0,!0),FFt=lL(1,!0);class Lc{constructor(t,n,i,r,s){this.changes=t,this.effects=n,this.mapped=i,this.startSelection=r,this.selectionsAfter=s}setSelAfter(t){return new Lc(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,n,i;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(t){return new Lc(t.changes&&lo.fromJSON(t.changes),[],t.mapped&&yh.fromJSON(t.mapped),t.startSelection&&ht.fromJSON(t.startSelection),t.selectionsAfter.map(ht.fromJSON))}static fromTransaction(t,n){let i=yd;for(let r of t.startState.facet(MFt)){let s=r(t);s.length&&(i=i.concat(s))}return!i.length&&t.changes.empty?null:new Lc(t.changes.invert(t.startState.doc),i,void 0,n||t.startState.selection,yd)}static selection(t){return new Lc(void 0,yd,void 0,void 0,t)}}function fP(e,t,n,i){let r=t+1>n+20?t-n-1:0,s=e.slice(r,t);return s.push(i),s}function BFt(e,t){let n=[],i=!1;return e.iterChangedRanges((r,s)=>n.push(r,s)),t.iterChangedRanges((r,s,o,l)=>{for(let c=0;c=u&&o<=d&&(i=!0)}}),i}function UFt(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,i)=>n.empty!=t.ranges[i].empty).length===0}function N6e(e,t){return e.length?t.length?e.concat(t):e:t}const yd=[],QFt=200;function R6e(e,t){if(e.length){let n=e[e.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-QFt));return i.length&&i[i.length-1].eq(t)?e:(i.push(t),fP(e,e.length-1,1e9,n.setSelAfter(i)))}else return[Lc.selection([t])]}function zFt(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function F$(e,t){if(!e.length)return e;let n=e.length,i=yd;for(;n;){let r=VFt(e[n-1],t,i);if(r.changes&&!r.changes.empty||r.effects.length){let s=e.slice(0,n);return s[n-1]=r,s}else t=r.mapped,n--,i=r.selectionsAfter}return i.length?[Lc.selection(i)]:yd}function VFt(e,t,n){let i=N6e(e.selectionsAfter.length?e.selectionsAfter.map(l=>l.map(t)):yd,n);if(!e.changes)return Lc.selection(i);let r=e.changes.map(t),s=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(s):s;return new Lc(r,pi.mapEffects(e.effects,t),o,e.startSelection.map(s),i)}const HFt=/^(input\.type|delete)($|\.)/;class dh{constructor(t,n,i=0,r=void 0){this.done=t,this.undone=n,this.prevTime=i,this.prevUserEvent=r}isolate(){return this.prevTime?new dh(this.done,this.undone):this}addChanges(t,n,i,r,s){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&t.changes&&(!i||HFt.test(i))&&(!l.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?e.moveByChar(n,t):cL(n,t))}function Il(e){return e.textDirectionAt(e.state.selection.main.head)==os.LTR}const P6e=e=>I6e(e,!Il(e)),D6e=e=>I6e(e,Il(e));function M6e(e,t){return If(e,n=>n.empty?e.moveByGroup(n,t):cL(n,t))}const WFt=e=>M6e(e,!Il(e)),KFt=e=>M6e(e,Il(e));function GFt(e,t,n){if(t.type.prop(n))return!0;let i=t.to-t.from;return i&&(i>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function uL(e,t,n){let i=Yr(e).resolveInner(t.head),r=n?ui.closedBy:ui.openedBy;for(let c=t.head;;){let u=n?i.childAfter(c):i.childBefore(c);if(!u)break;GFt(e,u,r)?i=u:c=n?u.to:u.from}let s=i.type.prop(r),o,l;return s&&(o=n?uh(e,i.from,1):uh(e,i.to,-1))&&o.matched?l=n?o.end.to:o.end.from:l=n?i.to:i.from,ht.cursor(l,n?-1:1)}const XFt=e=>If(e,t=>uL(e.state,t,!Il(e))),YFt=e=>If(e,t=>uL(e.state,t,Il(e)));function L6e(e,t){return If(e,n=>{if(!n.empty)return cL(n,t);let i=e.moveVertically(n,t);return i.head!=n.head?i:e.moveToLineBoundary(n,t)})}const $6e=e=>L6e(e,!1),F6e=e=>L6e(e,!0);function B6e(e){let t=e.scrollDOM.clientHeighto.empty?e.moveVertically(o,t,n.height):cL(o,t));if(r.eq(i.selection))return!1;let s;if(n.selfScroll){let o=e.coordsAtPos(i.selection.main.head),l=e.scrollDOM.getBoundingClientRect(),c=l.top+n.marginTop,u=l.bottom-n.marginBottom;o&&o.top>c&&o.bottomU6e(e,!1),S7=e=>U6e(e,!0);function Ib(e,t,n){let i=e.lineBlockAt(t.head),r=e.moveToLineBoundary(t,n);if(r.head==t.head&&r.head!=(n?i.to:i.from)&&(r=e.moveToLineBoundary(t,n,!1)),!n&&r.head==i.from&&i.length){let s=/^\s*/.exec(e.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;s&&t.head!=i.from+s&&(r=ht.cursor(i.from+s))}return r}const ZFt=e=>If(e,t=>Ib(e,t,!0)),JFt=e=>If(e,t=>Ib(e,t,!1)),e8t=e=>If(e,t=>Ib(e,t,!Il(e))),t8t=e=>If(e,t=>Ib(e,t,Il(e))),n8t=e=>If(e,t=>ht.cursor(e.lineBlockAt(t.head).from,1)),i8t=e=>If(e,t=>ht.cursor(e.lineBlockAt(t.head).to,-1));function r8t(e,t,n){let i=!1,r=bO(e.selection,s=>{let o=uh(e,s.head,-1)||uh(e,s.head,1)||s.head>0&&uh(e,s.head-1,1)||s.headr8t(e,t);function Dd(e,t,n){let i=bO(e.state.selection,r=>{r.undirectional&&r.head>=r.anchor!=t&&(r=ht.range(r.head,r.anchor));let s=n(r);return ht.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return i.eq(e.state.selection)?!1:(e.dispatch(Rf(e.state,i)),!0)}function Q6e(e,t){return Dd(e,t,n=>e.moveByChar(n,t))}const z6e=e=>Q6e(e,!Il(e)),V6e=e=>Q6e(e,Il(e));function H6e(e,t){return Dd(e,t,n=>e.moveByGroup(n,t))}const a8t=e=>H6e(e,!Il(e)),o8t=e=>H6e(e,Il(e)),l8t=e=>{let t=!Il(e);return Dd(e,t,n=>uL(e.state,n,t))},c8t=e=>{let t=Il(e);return Dd(e,t,n=>uL(e.state,n,t))};function q6e(e,t){return Dd(e,t,n=>e.moveVertically(n,t))}const W6e=e=>q6e(e,!1),K6e=e=>q6e(e,!0);function G6e(e,t){return Dd(e,t,n=>e.moveVertically(n,t,B6e(e).height))}const Pse=e=>G6e(e,!1),Dse=e=>G6e(e,!0),u8t=e=>Dd(e,!0,t=>Ib(e,t,!0)),d8t=e=>Dd(e,!1,t=>Ib(e,t,!1)),f8t=e=>{let t=!Il(e);return Dd(e,t,n=>Ib(e,n,t))},h8t=e=>{let t=Il(e);return Dd(e,t,n=>Ib(e,n,t))},p8t=e=>Dd(e,!1,t=>ht.cursor(e.lineBlockAt(t.head).from)),m8t=e=>Dd(e,!0,t=>ht.cursor(e.lineBlockAt(t.head).to)),Mse=({state:e,dispatch:t})=>(t(Rf(e,{anchor:0})),!0),Lse=({state:e,dispatch:t})=>(t(Rf(e,{anchor:e.doc.length})),!0),$se=({state:e,dispatch:t})=>(t(Rf(e,{anchor:e.selection.main.anchor,head:0})),!0),Fse=({state:e,dispatch:t})=>(t(Rf(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),g8t=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),b8t=({state:e,dispatch:t})=>{let n=dL(e).map(({from:i,to:r})=>ht.range(i,Math.min(r+1,e.doc.length)));return t(e.update({selection:ht.create(n),userEvent:"select"})),!0},y8t=({state:e,dispatch:t})=>{let n=bO(e.selection,i=>{let r=Yr(e),s=r.resolveStack(i.from,1);if(i.empty){let o=r.resolveStack(i.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}for(let o=s;o;o=o.next){let{node:l}=o;if((l.from=i.to||l.to>i.to&&l.from<=i.from)&&o.next)return ht.range(l.to,l.from)}return i});return n.eq(e.selection)?!1:(t(Rf(e,n)),!0)};function X6e(e,t){let{state:n}=e,i=n.selection,r=n.selection.ranges.slice();for(let s of n.selection.ranges){let o=n.doc.lineAt(s.head);if(t?o.to0)for(let l=s;;){let c=e.moveVertically(l,t);if(c.heado.to){r.some(u=>u.head==c.head)||r.push(c);break}else{if(c.head==l.head)break;l=c}}}return r.length==i.ranges.length?!1:(e.dispatch(Rf(n,ht.create(r,r.length-1))),!0)}const v8t=e=>X6e(e,!1),x8t=e=>X6e(e,!0),w8t=({state:e,dispatch:t})=>{let n=e.selection,i=null;return n.ranges.length>1?i=ht.create([n.main]):n.main.empty||(i=ht.create([ht.cursor(n.main.head)])),i?(t(Rf(e,i)),!0):!1};function DT(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:i}=e,r=i.changeByRange(s=>{let{from:o,to:l}=s;if(o==l){let c=t(s);co&&(n="delete.forward",c=lj(e,c,!0)),o=Math.min(o,c),l=Math.max(l,c)}else o=lj(e,o,!1),l=lj(e,l,!0);return o==l?{range:s}:{changes:{from:o,to:l},range:ht.cursor(o,or(e)))i.between(t,t,(r,s)=>{rt&&(t=n?s:r)});return t}const Y6e=(e,t,n)=>DT(e,i=>{let r=i.from,{state:s}=e,o=s.doc.lineAt(r),l,c;if(n&&!t&&r>o.from&&rY6e(e,!1,!0),Z6e=e=>Y6e(e,!0,!1),J6e=(e,t)=>DT(e,n=>{let i=n.head,{state:r}=e,s=r.doc.lineAt(i),o=r.charCategorizer(i);for(let l=null;;){if(i==(t?s.to:s.from)){i==n.head&&s.number!=(t?r.doc.lines:1)&&(i+=t?1:-1);break}let c=Ro(s.text,i-s.from,t)+s.from,u=s.text.slice(Math.min(i,c)-s.from,Math.max(i,c)-s.from),d=o(u);if(l!=null&&d!=l)break;(u!=" "||i!=n.head)&&(l=d),i=c}return i}),eFe=e=>J6e(e,!1),O8t=e=>J6e(e,!0),k8t=e=>DT(e,t=>{let n=e.lineBlockAt(t.head).to;return t.headDT(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),E8t=e=>DT(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head{if(e.readOnly)return!1;let n=e.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:xr.of(["",""])},range:ht.cursor(i.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},A8t=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(i=>{if(!i.empty||i.from==0||i.from==e.doc.length)return{range:i};let r=i.from,s=e.doc.lineAt(r),o=r==s.from?r-1:Ro(s.text,r-s.from,!1)+s.from,l=r==s.to?r+1:Ro(s.text,r-s.from,!0)+s.from;return{changes:{from:o,to:l,insert:e.doc.slice(r,l).append(e.doc.slice(o,r))},range:ht.cursor(l)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function dL(e){let t=[],n=-1;for(let i of e.selection.ranges){let r=e.doc.lineAt(i.from),s=e.doc.lineAt(i.to);if(!i.empty&&i.to==s.from&&(s=e.doc.lineAt(i.to-1)),n>=r.number){let o=t[t.length-1];o.to=s.to,o.ranges.push(i)}else t.push({from:r.from,to:s.to,ranges:[i]});n=s.number+1}return t}function tFe(e,t,n){if(e.readOnly)return!1;let i=[],r=[];for(let s of dL(e)){if(n?s.to==e.doc.length:s.from==0)continue;let o=e.doc.lineAt(n?s.to+1:s.from-1),l=o.length+1;if(n){i.push({from:s.to,to:o.to},{from:s.from,insert:o.text+e.lineBreak});for(let c of s.ranges)r.push(ht.range(Math.min(e.doc.length,c.anchor+l),Math.min(e.doc.length,c.head+l)))}else{i.push({from:o.from,to:s.from},{from:s.to,insert:e.lineBreak+o.text});for(let c of s.ranges)r.push(ht.range(c.anchor-l,c.head-l))}}return i.length?(t(e.update({changes:i,scrollIntoView:!0,selection:ht.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const T8t=({state:e,dispatch:t})=>tFe(e,t,!1),_8t=({state:e,dispatch:t})=>tFe(e,t,!0);function nFe(e,t,n){if(e.readOnly)return!1;let i=[];for(let s of dL(e))n?i.push({from:s.from,insert:e.doc.slice(s.from,s.to)+e.lineBreak}):i.push({from:s.to,insert:e.lineBreak+e.doc.slice(s.from,s.to)});let r=e.changes(i);return t(e.update({changes:r,selection:e.selection.map(r,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const j8t=({state:e,dispatch:t})=>nFe(e,t,!1),N8t=({state:e,dispatch:t})=>nFe(e,t,!0),R8t=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(dL(t).map(({from:r,to:s})=>(r>0?r--:s{let s;if(e.lineWrapping){let o=e.lineBlockAt(r.head),l=e.coordsAtPos(r.head,r.assoc||1);l&&(s=o.bottom+e.documentTop-l.bottom+e.defaultLineHeight/2)}return e.moveVertically(r,!0,s)}).map(n);return e.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function I8t(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=Yr(e).resolveInner(t),i=n.childBefore(t),r=n.childAfter(t),s;return i&&r&&i.to<=t&&r.from>=t&&(s=i.type.prop(ui.closedBy))&&s.indexOf(r.name)>-1&&e.doc.lineAt(i.to).from==e.doc.lineAt(r.from).from&&!/\S/.test(e.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}const Bse=iFe(!1),P8t=iFe(!0);function iFe(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let i=t.changeByRange(r=>{let{from:s,to:o}=r,l=t.doc.lineAt(s),c=!e&&s==o&&I8t(t,s);e&&(s=o=(o<=l.to?l:t.doc.lineAt(o)).to);let u=new nL(t,{simulateBreak:s,simulateDoubleBreak:!!c}),d=iW(u,s);for(d==null&&(d=Of(/^\s*/.exec(t.doc.lineAt(s).text)[0],t.tabSize));ol.from&&s{let r=[];for(let o=i.from;o<=i.to;){let l=e.doc.lineAt(o);l.number>n&&(i.empty||i.to>l.from)&&(t(l,r,i),n=l.number),o=l.to+1}let s=e.changes(r);return{changes:r,range:ht.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}const D8t=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),i=new nL(e,{overrideIndentation:s=>{let o=n[s];return o??-1}}),r=DW(e,(s,o,l)=>{let c=iW(i,s.from);if(c==null)return;/\S/.test(s.text)||(c=0);let u=/^\s*/.exec(s.text)[0],d=zC(e,c);(u!=d||l.frome.readOnly?!1:(t(e.update(DW(e,(n,i)=>{i.push({from:n.from,insert:e.facet(mO)})}),{userEvent:"input.indent"})),!0),sFe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(DW(e,(n,i)=>{let r=/^\s*/.exec(n.text)[0];if(!r)return;let s=Of(r,e.tabSize),o=0,l=zC(e,Math.max(0,s-E0(e)));for(;o(e.setTabFocusMode(),!0),L8t=[{key:"Ctrl-b",run:P6e,shift:z6e,preventDefault:!0},{key:"Ctrl-f",run:D6e,shift:V6e},{key:"Ctrl-p",run:$6e,shift:W6e},{key:"Ctrl-n",run:F6e,shift:K6e},{key:"Ctrl-a",run:n8t,shift:p8t},{key:"Ctrl-e",run:i8t,shift:m8t},{key:"Ctrl-d",run:Z6e},{key:"Ctrl-h",run:E7},{key:"Ctrl-k",run:k8t},{key:"Ctrl-Alt-h",run:eFe},{key:"Ctrl-o",run:C8t},{key:"Ctrl-t",run:A8t},{key:"Ctrl-v",run:S7}],$8t=[{key:"ArrowLeft",run:P6e,shift:z6e,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:WFt,shift:a8t,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:e8t,shift:f8t,preventDefault:!0},{key:"ArrowRight",run:D6e,shift:V6e,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:KFt,shift:o8t,preventDefault:!0},{mac:"Cmd-ArrowRight",run:t8t,shift:h8t,preventDefault:!0},{key:"ArrowUp",run:$6e,shift:W6e,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Mse,shift:$se},{mac:"Ctrl-ArrowUp",run:Ise,shift:Pse},{key:"ArrowDown",run:F6e,shift:K6e,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Lse,shift:Fse},{mac:"Ctrl-ArrowDown",run:S7,shift:Dse},{key:"PageUp",run:Ise,shift:Pse},{key:"PageDown",run:S7,shift:Dse},{key:"Home",run:JFt,shift:d8t,preventDefault:!0},{key:"Mod-Home",run:Mse,shift:$se},{key:"End",run:ZFt,shift:u8t,preventDefault:!0},{key:"Mod-End",run:Lse,shift:Fse},{key:"Enter",run:Bse,shift:Bse},{key:"Mod-a",run:g8t},{key:"Backspace",run:E7,shift:E7,preventDefault:!0},{key:"Delete",run:Z6e,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:eFe,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:O8t,preventDefault:!0},{mac:"Mod-Backspace",run:S8t,preventDefault:!0},{mac:"Mod-Delete",run:E8t,preventDefault:!0}].concat(L8t.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),F8t=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:XFt,shift:l8t},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:YFt,shift:c8t},{key:"Alt-ArrowUp",run:T8t},{key:"Shift-Alt-ArrowUp",run:j8t},{key:"Alt-ArrowDown",run:_8t},{key:"Shift-Alt-ArrowDown",run:N8t},{key:"Mod-Alt-ArrowUp",run:v8t},{key:"Mod-Alt-ArrowDown",run:x8t},{key:"Escape",run:w8t},{key:"Mod-Enter",run:P8t},{key:"Alt-l",mac:"Ctrl-l",run:b8t},{key:"Mod-i",run:y8t,preventDefault:!0},{key:"Mod-[",run:sFe},{key:"Mod-]",run:rFe},{key:"Mod-Alt-\\",run:D8t},{key:"Shift-Mod-k",run:R8t},{key:"Shift-Mod-\\",run:s8t},{key:"Mod-/",run:TFt},{key:"Alt-A",run:jFt},{key:"Ctrl-m",mac:"Shift-Alt-m",run:M8t}].concat($8t),B8t={key:"Tab",run:rFe,shift:sFe},Use=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class x1{constructor(t,n,i=0,r=t.length,s,o){this.test=o,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(i,r),this.bufferStart=i,this.normalize=s?l=>s(Use(l)):Use,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Nc(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let n=Lq(t),i=this.bufferStart+this.bufferPos;this.bufferPos+=th(t);let r=this.normalize(n);if(r.length)for(let s=0,o=i,l=!0;;s++){let c=r.charCodeAt(s),u=this.match(c,o,l,this.bufferPos+this.bufferStart,s==r.length-1);if(u)return this.value=u,this;if(s==r.length-1)break;l&&sthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let i=this.curLineStart+n.index,r=i+n[0].length;if(this.matchPos=hP(this.text,r+(i==r?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,r,n)))return this.value={from:i,to:r,precise:!0,match:n},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=i||r.to<=n){let l=new Ew(n,t.sliceString(n,i));return B$.set(t,l),l}if(r.from==n&&r.to==i)return r;let{text:s,from:o}=r;return o>n&&(s=t.sliceString(n,o)+s,o=n),r.to=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==t&&(this.re.lastIndex=t+1,n=this.re.exec(this.flat.text)),n){let i=this.flat.from+n.index,r=i+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,r,n)))return this.value={from:i,to:r,precise:!0,match:n},this.matchPos=hP(this.text,r+(i==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Ew.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(oFe.prototype[Symbol.iterator]=lFe.prototype[Symbol.iterator]=function(){return this});function U8t(e){try{return new RegExp(e,MW),!0}catch{return!1}}function hP(e,t){if(t>=e.length)return t;let n=e.lineAt(t),i;for(;t=56320&&i<57344;)t++;return t}const Q8t=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:i,result:r}=JDt(e,{label:t.phrase("Go to line"),input:{type:"text",name:"line",value:n},focus:!0,submitLabel:t.phrase("go")});return r.then(s=>{let o=s&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(s.elements.line.value);if(!o){e.dispatch({effects:i});return}let l=t.doc.lineAt(t.selection.main.head),[,c,u,d,f]=o,h=d?+d.slice(1):0,m=u?+u:l.number;if(u&&f){let v=m/100;c&&(v=v*(c=="-"?-1:1)+l.number/t.doc.lines),m=Math.round(t.doc.lines*v)}else u&&c&&(m=m*(c=="-"?-1:1)+l.number);let g=t.doc.line(Math.max(1,Math.min(t.doc.lines,m))),b=ht.cursor(g.from+Math.max(0,Math.min(h,g.length)));e.dispatch({effects:[i,Jt.scrollIntoView(b.from,{y:"center"})],selection:b})}),!0},z8t={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},V8t=mn.define({combine(e){return Ph(e,z8t,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function H8t(e){return[X8t,G8t]}const q8t=Fn.mark({class:"cm-selectionMatch"}),W8t=Fn.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Qse(e,t,n,i){return(n==0||e(t.sliceDoc(n-1,n))!=Qs.Word)&&(i==t.doc.length||e(t.sliceDoc(i,i+1))!=Qs.Word)}function K8t(e,t,n,i){return e(t.sliceDoc(n,n+1))==Qs.Word&&e(t.sliceDoc(i-1,i))==Qs.Word}const G8t=ma.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(V8t),{state:n}=e,i=n.selection;if(i.ranges.length>1)return Fn.none;let r=i.main,s,o=null;if(r.empty){if(!t.highlightWordAroundCursor)return Fn.none;let c=n.wordAt(r.head);if(!c)return Fn.none;o=n.charCategorizer(r.head),s=n.sliceDoc(c.from,c.to)}else{let c=r.to-r.from;if(c200)return Fn.none;if(t.wholeWords){if(s=n.sliceDoc(r.from,r.to),o=n.charCategorizer(r.head),!(Qse(o,n,r.from,r.to)&&K8t(o,n,r.from,r.to)))return Fn.none}else if(s=n.sliceDoc(r.from,r.to),!s)return Fn.none}let l=[];for(let c of e.visibleRanges){let u=new x1(n.doc,s,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!o||Qse(o,n,d,f))&&(r.empty&&d<=r.from&&f>=r.to?l.push(W8t.range(d,f)):(d>=r.to||f<=r.from)&&l.push(q8t.range(d,f)),l.length>t.maxMatches))return Fn.none}}return Fn.set(l)}},{decorations:e=>e.decorations}),X8t=Jt.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Y8t=({state:e,dispatch:t})=>{let{selection:n}=e,i=ht.create(n.ranges.map(r=>e.wordAt(r.head)||ht.cursor(r.head)),n.mainIndex);return i.eq(n)?!1:(t(e.update({selection:i})),!0)};function Z8t(e,t){let{main:n,ranges:i}=e.selection,r=e.wordAt(n.head),s=r&&r.from==n.from&&r.to==n.to;for(let o=!1,l=new x1(e.doc,t,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new x1(e.doc,t,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(c=>c.from==l.value.from))continue;if(s){let c=e.wordAt(l.value.from);if(!c||c.from!=l.value.from||c.to!=l.value.to)continue}return l.value}}const J8t=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(s=>s.from===s.to))return Y8t({state:e,dispatch:t});let i=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(s=>e.sliceDoc(s.from,s.to)!=i))return!1;let r=Z8t(e,i);return r?(t(e.update({selection:e.selection.addRange(ht.range(r.from,r.to),!1),effects:Jt.scrollIntoView(r.to)})),!0):!1},yO=mn.define({combine(e){return Ph(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new hBt(t),scrollToMatch:t=>Jt.scrollIntoView(t)})}});class cFe{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||U8t(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord,this.test=t.test}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(n,i)=>i=="n"?` +`:i=="r"?"\r":i=="t"?" ":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord&&this.test==t.test}create(){return this.regexp?new sBt(this):new nBt(this)}getCursor(t,n=0,i){let r=t.doc?t:tr.create({doc:t});return i==null&&(i=r.doc.length),this.regexp?hx(this,r,n,i):fx(this,r,n,i)}}class uFe{constructor(t){this.spec=t}}function eBt(e,t,n){return(i,r,s,o)=>{if(n&&!n(i,r,s,o))return!1;let l=i>=o&&r<=o+s.length?s.slice(i-o,r-o):t.doc.sliceString(i,r);return e(l,t,i,r)}}function fx(e,t,n,i){let r;return e.wholeWord&&(r=tBt(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(r=eBt(e.test,t,r)),new x1(t.doc,e.unquoted,n,i,e.caseSensitive?void 0:s=>s.toLowerCase(),r)}function tBt(e,t){return(n,i,r,s)=>((s>n||s+r.length=n)return null;r.push(i.value)}return r}highlight(t,n,i,r){let s=fx(this.spec,t,Math.max(0,n-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,t.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}function iBt(e,t,n){return(i,r,s)=>(!n||n(i,r,s))&&e(s[0],t,i,r)}function hx(e,t,n,i){let r;return e.wholeWord&&(r=rBt(t.charCategorizer(t.selection.main.head))),e.test&&(r=iBt(e.test,t,r)),new oFe(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:r},n,i)}function pP(e,t){return e.slice(Ro(e,t,!1),t)}function mP(e,t){return e.slice(t,Ro(e,t))}function rBt(e){return(t,n,i)=>!i[0].length||(e(pP(i.input,i.index))!=Qs.Word||e(mP(i.input,i.index))!=Qs.Word)&&(e(mP(i.input,i.index+i[0].length))!=Qs.Word||e(pP(i.input,i.index+i[0].length))!=Qs.Word)}class sBt extends uFe{nextMatch(t,n,i){let r=hx(this.spec,t,i,t.doc.length).next();return r.done&&(r=hx(this.spec,t,0,n).next()),r.done?null:r.value}prevMatchInRange(t,n,i){for(let r=1;;r++){let s=Math.max(n,i-r*1e4),o=hx(this.spec,t,s,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(s==n||l.from>s+10))return l;if(s==n)return null}}prevMatch(t,n,i){return this.prevMatchInRange(t,0,n)||this.prevMatchInRange(t,i,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,i)=>{if(i=="&")return t.match[0];if(i=="$")return"$";for(let r=i.length;r>0;r--){let s=+i.slice(0,r);if(s>0&&s=n)return null;r.push(i.value)}return r}highlight(t,n,i,r){let s=hx(this.spec,t,Math.max(0,n-250),Math.min(i+250,t.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}const eA=pi.define(),LW=pi.define(),Bg=dl.define({create(e){return new U$(C7(e).create(),null)},update(e,t){for(let n of t.effects)n.is(eA)?e=new U$(n.value.create(),e.panel):n.is(LW)&&(e=new U$(e.query,n.value?$W:null));return e},provide:e=>UC.from(e,t=>t.panel)});class U${constructor(t,n){this.query=t,this.panel=n}}const aBt=Fn.mark({class:"cm-searchMatch"}),oBt=Fn.mark({class:"cm-searchMatch cm-searchMatch-selected"}),lBt=ma.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(Bg))}update(e){let t=e.state.field(Bg);(t!=e.startState.field(Bg)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return Fn.none;let{view:n}=this,i=new nm;for(let r=0,s=n.visibleRanges,o=s.length;rs[r+1].from-2*250;)c=s[++r].to;e.highlight(n.state,l,c,(u,d)=>{let f=n.state.selection.ranges.some(h=>h.from==u&&h.to==d);i.add(u,d,f?oBt:aBt)})}return i.finish()}},{decorations:e=>e.decorations});function MT(e){return t=>{let n=t.state.field(Bg,!1);return n&&n.query.spec.valid?e(t,n):hFe(t)}}const gP=MT((e,{query:t})=>{let{to:n}=e.state.selection.main,i=t.nextMatch(e.state,n,n);if(!i)return!1;let r=ht.single(i.from,i.to),s=e.state.facet(yO);return e.dispatch({selection:r,effects:[FW(e,i),s.scrollToMatch(r.main,e)],userEvent:"select.search"}),fFe(e),!0}),bP=MT((e,{query:t})=>{let{state:n}=e,{from:i}=n.selection.main,r=t.prevMatch(n,i,i);if(!r)return!1;let s=ht.single(r.from,r.to),o=e.state.facet(yO);return e.dispatch({selection:s,effects:[FW(e,r),o.scrollToMatch(s.main,e)],userEvent:"select.search"}),fFe(e),!0}),cBt=MT((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:ht.create(n.map(i=>ht.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),uBt=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:i,to:r}=n.main,s=[],o=0;for(let l=new x1(e.doc,e.sliceDoc(i,r));!l.next().done;){if(s.length>1e3)return!1;l.value.from==i&&(o=s.length),s.push(ht.range(l.value.from,l.value.to))}return t(e.update({selection:ht.create(s,o),userEvent:"select.search.matches"})),!0},zse=MT((e,{query:t})=>{let{state:n}=e,{from:i,to:r}=n.selection.main;if(n.readOnly)return!1;let s=t.nextMatch(n,i,i);if(!s)return!1;let o=s,l=[],c,u,d=[];o.precise?o.from==i&&o.to==r&&(u=n.toText(t.getReplacement(o)),l.push({from:o.from,to:o.to,insert:u}),o=t.nextMatch(n,o.from,o.to),d.push(Jt.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(i).number)+"."))):o=t.nextMatch(n,o.from,o.to);let f=e.state.changes(l);return o&&(c=ht.single(o.from,o.to).map(f),d.push(FW(e,o)),d.push(n.facet(yO).scrollToMatch(c.main,e))),e.dispatch({changes:f,selection:c,effects:d,userEvent:"input.replace"}),!0}),dBt=MT((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let r of t.matchAll(e.state,1e9)){let{from:s,to:o,precise:l}=r;l&&n.push({from:s,to:o,insert:t.getReplacement(r)})}if(!n.length)return!1;let i=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:Jt.announce.of(i),userEvent:"input.replace.all"}),!0});function $W(e){return e.state.facet(yO).createPanel(e)}function C7(e,t){var n,i,r,s,o;let l=e.selection.main,c=l.empty||l.to>l.from+100?"":e.sliceDoc(l.from,l.to);if(t&&!c)return t;let u=e.facet(yO);return new cFe({search:((n=t==null?void 0:t.literal)!==null&&n!==void 0?n:u.literal)?c:c.replace(/\n/g,"\\n"),caseSensitive:(i=t==null?void 0:t.caseSensitive)!==null&&i!==void 0?i:u.caseSensitive,literal:(r=t==null?void 0:t.literal)!==null&&r!==void 0?r:u.literal,regexp:(s=t==null?void 0:t.regexp)!==null&&s!==void 0?s:u.regexp,wholeWord:(o=t==null?void 0:t.wholeWord)!==null&&o!==void 0?o:u.wholeWord})}function dFe(e){let t=tW(e,$W);return t&&t.dom.querySelector("[main-field]")}function fFe(e){let t=dFe(e);t&&t==e.root.activeElement&&t.select()}const hFe=e=>{let t=e.state.field(Bg,!1);if(t&&t.panel){let n=dFe(e);if(n&&n!=e.root.activeElement){let i=C7(e.state,t.query.spec);i.valid&&e.dispatch({effects:eA.of(i)}),n.focus(),n.select()}}else e.dispatch({effects:[LW.of(!0),t?eA.of(C7(e.state,t.query.spec)):pi.appendConfig.of(mBt)]});return!0},pFe=e=>{let t=e.state.field(Bg,!1);if(!t||!t.panel)return!1;let n=tW(e,$W);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:LW.of(!1)}),!0},fBt=[{key:"Mod-f",run:hFe,scope:"editor search-panel"},{key:"F3",run:gP,shift:bP,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:gP,shift:bP,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:pFe,scope:"editor search-panel"},{key:"Mod-Shift-l",run:uBt},{key:"Mod-Alt-g",run:Q8t},{key:"Mod-d",run:J8t,preventDefault:!0}];class hBt{constructor(t){this.view=t;let n=this.query=t.state.field(Bg).query.spec;this.commit=this.commit.bind(this),this.searchField=Kr("input",{value:n.search,placeholder:su(t,"Find"),"aria-label":su(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Kr("input",{value:n.replace,placeholder:su(t,"Replace"),"aria-label":su(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Kr("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=Kr("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=Kr("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function i(r,s,o){return Kr("button",{class:"cm-button",name:r,onclick:s,type:"button"},o)}this.dom=Kr("div",{onkeydown:r=>this.keydown(r),class:"cm-search"},[this.searchField,i("next",()=>gP(t),[su(t,"next")]),i("prev",()=>bP(t),[su(t,"previous")]),i("select",()=>cBt(t),[su(t,"all")]),Kr("label",null,[this.caseField,su(t,"match case")]),Kr("label",null,[this.reField,su(t,"regexp")]),Kr("label",null,[this.wordField,su(t,"by word")]),...t.state.readOnly?[]:[Kr("br"),this.replaceField,i("replace",()=>zse(t),[su(t,"replace")]),i("replaceAll",()=>dBt(t),[su(t,"replace all")])],Kr("button",{name:"close",onclick:()=>pFe(t),"aria-label":su(t,"close"),type:"button"},["×"])])}commit(){let t=new cFe({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:eA.of(t)}))}keydown(t){lDt(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?bP:gP)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),zse(this.view))}update(t){for(let n of t.transactions)for(let i of n.effects)i.is(eA)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(yO).top}}function su(e,t){return e.state.phrase(t)}const cj=30,uj=/[\s\.,:;?!]/;function FW(e,{from:t,to:n}){let i=e.state.doc.lineAt(t),r=e.state.doc.lineAt(n).to,s=Math.max(i.from,t-cj),o=Math.min(r,n+cj),l=e.state.sliceDoc(s,o);if(s!=i.from){for(let c=0;cl.length-cj;c--)if(!uj.test(l[c-1])&&uj.test(l[c])){l=l.slice(0,c);break}}return Jt.announce.of(`${e.state.phrase("current match")}. ${l} ${e.state.phrase("on line")} ${i.number}.`)}const pBt=Jt.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),mBt=[Bg,bm.low(lBt),pBt];class Vse{constructor(t,n,i){this.from=t,this.to=n,this.diagnostic=i}}class Ey{constructor(t,n,i){this.diagnostics=t,this.panel=n,this.selected=i}static init(t,n,i){let r=i.facet(tA).markerFilter;r&&(t=r(t,i));let s=t.slice().sort((m,g)=>m.from-g.from||m.to-g.to),o=new nm,l=[],c=0,u=i.doc.iter(),d=0,f=i.doc.length;for(let m=0;;){let g=m==s.length?null:s[m];if(!g&&!l.length)break;let b,v;if(l.length)b=c,v=l.reduce((x,O)=>Math.min(x,O.to),g&&g.from>b?g.from:1e8);else{if(b=g.from,b>f)break;v=g.to,l.push(g),m++}for(;mx.from||x.to==b))l.push(x),m++,v=Math.min(x.to,v);else{v=Math.min(x.from,v);break}}v=Math.min(v,f);let y=!1;if(l.some(x=>x.from==b&&(x.to==v||v==f))&&(y=b==v,!y&&v-b<10)){let x=b-(d+u.value.length);x>0&&(u.next(x),d=b);for(let O=b;;){if(O>=v){y=!0;break}if(!u.lineBreak&&d+u.value.length>O)break;O=d+u.value.length,d+=u.value.length,u.next()}}let w=TBt(l);if(y)o.add(b,b,Fn.widget({widget:new SBt(w),diagnostics:l.slice()}));else{let x=l.reduce((O,k)=>k.markClass?O+" "+k.markClass:O,"");o.add(b,v,Fn.mark({class:"cm-lintRange cm-lintRange-"+w+x,diagnostics:l.slice(),inclusiveEnd:l.some(O=>O.to>v)}))}if(c=v,c==f)break;for(let x=0;x{if(!(t&&o.diagnostics.indexOf(t)<0))if(!i)i=new Vse(r,s,t||o.diagnostics[0]);else{if(o.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new Vse(i.from,s,i.diagnostic)}}),i}function gBt(e,t){let n=t.pos,i=t.end||n,r=e.state.facet(tA).hideOn(e,n,i);if(r!=null)return r;let s=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(o=>o.is(mFe))||e.changes.touchesRange(s.from,Math.max(s.to,i)))}function bBt(e,t){return e.field(Su,!1)?t:t.concat(pi.appendConfig.of(_Bt))}const mFe=pi.define(),BW=pi.define(),gFe=pi.define(),Su=dl.define({create(){return new Ey(Fn.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),i=null,r=e.panel;if(e.selected){let s=t.changes.mapPos(e.selected.from,1);i=vb(n,e.selected.diagnostic,s)||vb(n,null,s)}!n.size&&r&&t.state.facet(tA).autoPanel&&(r=null),e=new Ey(n,r,i)}for(let n of t.effects)if(n.is(mFe)){let i=t.state.facet(tA).autoPanel?n.value.length?nA.open:null:e.panel;e=Ey.init(n.value,i,t.state)}else n.is(BW)?e=new Ey(e.diagnostics,n.value?nA.open:null,e.selected):n.is(gFe)&&(e=new Ey(e.diagnostics,e.panel,n.value));return e},provide:e=>[UC.from(e,t=>t.panel),Jt.decorations.from(e,t=>t.diagnostics)]}),yBt=Fn.mark({class:"cm-lintRange cm-lintRange-active"});function vBt(e,t,n){let{diagnostics:i}=e.state.field(Su),r,s=-1,o=-1;i.between(t-(n<0?1:0),t+(n>0?1:0),(c,u,{spec:d})=>{if(t>=c&&t<=u&&(c==u||(t>c||n>0)&&(tyFe(e,n,!1)))}const wBt=e=>{let t=e.state.field(Su,!1);(!t||!t.panel)&&e.dispatch({effects:bBt(e.state,[BW.of(!0)])});let n=tW(e,nA.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},Hse=e=>{let t=e.state.field(Su,!1);return!t||!t.panel?!1:(e.dispatch({effects:BW.of(!1)}),!0)},OBt=e=>{let t=e.state.field(Su,!1);if(!t)return!1;let n=e.state.selection.main,i=vb(t.diagnostics,null,n.to+1);return!i&&(i=vb(t.diagnostics,null,0),!i||i.from==n.from&&i.to==n.to)?!1:(e.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),YDt(e,i.from,1,{tooltip:vFe,until:r=>r.docChanged||r.newSelection.main.headi.to}),!0)},kBt=[{key:"Mod-Shift-m",run:wBt,preventDefault:!0},{key:"F8",run:OBt}],tA=mn.define({combine(e){return{sources:e.map(t=>t.source).filter(t=>t!=null),...Ph(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:qse,tooltipFilter:qse,needsRefresh:(t,n)=>t?n?i=>t(i)||n(i):t:n,hideOn:(t,n)=>t?n?(i,r,s)=>t(i,r,s)||n(i,r,s):t:n,autoPanel:(t,n)=>t||n})}}});function qse(e,t){return e?t?(n,i)=>t(e(n,i),i):e:t}function bFe(e){let t=[];if(e)e:for(let{name:n}of e){for(let i=0;is.toLowerCase()==r.toLowerCase())){t.push(r);continue e}}t.push("")}return t}function yFe(e,t,n){var i;let r=n?bFe(t.actions):[];return Kr("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},Kr("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),(i=t.actions)===null||i===void 0?void 0:i.map((s,o)=>{let l=!1,c=m=>{if(m.preventDefault(),l)return;l=!0;let g=vb(e.state.field(Su).diagnostics,t);g&&s.apply(e,g.from,g.to)},{name:u}=s,d=r[o]?u.indexOf(r[o]):-1,f=d<0?u:[u.slice(0,d),Kr("u",u.slice(d,d+1)),u.slice(d+1)],h=s.markClass?" "+s.markClass:"";return Kr("button",{type:"button",class:"cm-diagnosticAction"+h,onclick:c,onmousedown:c,"aria-label":` Action: ${u}${d<0?"":` (access key "${r[o]})"`}.`},f)}),t.source&&Kr("div",{class:"cm-diagnosticSource"},t.source))}class SBt extends Nf{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return Kr("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class Wse{constructor(t,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=yFe(t,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class nA{constructor(t){this.view=t,this.items=[];let n=r=>{if(!(r.ctrlKey||r.altKey||r.metaKey)){if(r.keyCode==27)Hse(this.view),this.view.focus();else if(r.keyCode==38||r.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(r.keyCode==40||r.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(r.keyCode==36)this.moveSelection(0);else if(r.keyCode==35)this.moveSelection(this.items.length-1);else if(r.keyCode==13)this.view.focus();else if(r.keyCode>=65&&r.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],o=bFe(s.actions);for(let l=0;l{for(let s=0;sHse(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(Su).selected;if(!t)return-1;for(let n=0;n{for(let d of u.diagnostics){if(o.has(d))continue;o.add(d);let f=-1,h;for(let m=i;mi&&(this.items.splice(i,f-i),r=!0)),n&&h.diagnostic==n.diagnostic?h.dom.hasAttribute("aria-selected")||(h.dom.setAttribute("aria-selected","true"),s=h):h.dom.hasAttribute("aria-selected")&&h.dom.removeAttribute("aria-selected"),i++}});i({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:c})=>{let u=c.height/this.list.offsetHeight;l.topc.bottom&&(this.list.scrollTop+=(l.bottom-c.bottom)/u)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let t=this.list.firstChild;function n(){let i=t;t=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;t!=i.dom;)n();t=i.dom.nextSibling}else this.list.insertBefore(i.dom,t);for(;t;)n()}moveSelection(t){if(this.selectedIndex<0)return;let n=this.view.state.field(Su),i=vb(n.diagnostics,this.items[t].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:gFe.of(i)})}static open(t){return new nA(t)}}function EBt(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(e)}')`}function dj(e){return EBt(``,'width="6" height="3"')}const CBt=Jt.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:dj("#f11")},".cm-lintRange-warning":{backgroundImage:dj("orange")},".cm-lintRange-info":{backgroundImage:dj("#999")},".cm-lintRange-hint":{backgroundImage:dj("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function ABt(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}function TBt(e){let t="hint",n=1;for(let i of e){let r=ABt(i.severity);r>n&&(n=r,t=i.severity)}return t}const vFe=XDt(vBt,{hideOn:gBt}),_Bt=[Su,Jt.decorations.compute([Su],e=>{let{selected:t,panel:n}=e.field(Su);return!t||!n||t.from==t.to?Fn.none:Fn.set([yBt.range(t.from,t.to)])}),vFe,CBt];var Kse=function(t){t===void 0&&(t={});var n=t,i=n.crosshairCursor,r=i===void 0?!1:i,s=[];t.closeBracketsKeymap!==!1&&(s=s.concat(M5t)),t.defaultKeymap!==!1&&(s=s.concat(F8t)),t.searchKeymap!==!1&&(s=s.concat(fBt)),t.historyKeymap!==!1&&(s=s.concat(qFt)),t.foldKeymap!==!1&&(s=s.concat(BMt)),t.completionKeymap!==!1&&(s=s.concat(Y4e)),t.lintKeymap!==!1&&(s=s.concat(kBt));var o=[];return t.lineNumbers!==!1&&o.push(p4e()),t.highlightActiveLineGutter!==!1&&o.push(fMt()),t.highlightSpecialChars!==!1&&o.push(EDt()),t.history!==!1&&o.push(LFt()),t.foldGutter!==!1&&o.push(VMt()),t.drawSelection!==!1&&o.push(pDt()),t.dropCursor!==!1&&o.push(vDt()),t.allowMultipleSelections!==!1&&o.push(tr.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&o.push(RMt()),t.syntaxHighlighting!==!1&&o.push(_4e(KMt,{fallback:!0})),t.bracketMatching!==!1&&o.push(tLt()),t.closeBrackets!==!1&&o.push(R5t()),t.autocompletion!==!1&&o.push(z5t()),t.rectangularSelection!==!1&&o.push(FDt()),r!==!1&&o.push(QDt()),t.highlightActiveLine!==!1&&o.push(NDt()),t.highlightSelectionMatches!==!1&&o.push(H8t()),t.tabSize&&typeof t.tabSize=="number"&&o.push(mO.of(" ".repeat(t.tabSize))),o.concat([pO.of(s.flat())]).filter(Boolean)};const jBt="#e5c07b",Gse="#e06c75",NBt="#56b6c2",RBt="#ffffff",XN="#abb2bf",A7="#7d8799",IBt="#61afef",PBt="#98c379",Xse="#d19a66",DBt="#c678dd",MBt="#21252b",Yse="#2c313a",Zse="#282c34",Q$="#353a42",LBt="#3E4451",Jse="#528bff",$Bt=Jt.theme({"&":{color:XN,backgroundColor:Zse},".cm-content":{caretColor:Jse},".cm-cursor, .cm-dropCursor":{borderLeftColor:Jse},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:LBt},".cm-panels":{backgroundColor:MBt,color:XN},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:Zse,color:A7,border:"none"},".cm-activeLineGutter":{backgroundColor:Yse},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Q$},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Q$,borderBottomColor:Q$},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Yse,color:XN}}},{dark:!0}),FBt=IT.define([{tag:he.keyword,color:DBt},{tag:[he.name,he.deleted,he.character,he.propertyName,he.macroName],color:Gse},{tag:[he.function(he.variableName),he.labelName],color:IBt},{tag:[he.color,he.constant(he.name),he.standard(he.name)],color:Xse},{tag:[he.definition(he.name),he.separator],color:XN},{tag:[he.typeName,he.className,he.number,he.changed,he.annotation,he.modifier,he.self,he.namespace],color:jBt},{tag:[he.operator,he.operatorKeyword,he.url,he.escape,he.regexp,he.link,he.special(he.string)],color:NBt},{tag:[he.meta,he.comment],color:A7},{tag:he.strong,fontWeight:"bold"},{tag:he.emphasis,fontStyle:"italic"},{tag:he.strikethrough,textDecoration:"line-through"},{tag:he.link,color:A7,textDecoration:"underline"},{tag:he.heading,fontWeight:"bold",color:Gse},{tag:[he.atom,he.bool,he.special(he.variableName)],color:Xse},{tag:[he.processingInstruction,he.string,he.inserted],color:PBt},{tag:he.invalid,color:RBt}]),BBt=[$Bt,_4e(FBt)];var UBt=Jt.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),QBt=function(t){t===void 0&&(t={});var n=t,i=n.indentWithTab,r=i===void 0?!0:i,s=n.editable,o=s===void 0?!0:s,l=n.readOnly,c=l===void 0?!1:l,u=n.theme,d=u===void 0?"light":u,f=n.placeholder,h=f===void 0?"":f,m=n.basicSetup,g=m===void 0?!0:m,b=[];switch(r&&b.unshift(pO.of([B8t])),g&&(typeof g=="boolean"?b.unshift(Kse()):b.unshift(Kse(g))),h&&b.unshift(DDt(h)),d){case"light":b.push(UBt);break;case"dark":b.push(BBt);break;case"none":break;default:b.push(d);break}return o===!1&&b.push(Jt.editable.of(!1)),c&&b.push(tr.readOnly.of(!0)),[...b]},zBt=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(t=>!t.empty)});class VBt{constructor(t,n){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=n,this.timeoutMS=n,this.callbacks.push(t)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var t=this.callbacks.slice();this.callbacks.length=0,t.forEach(n=>{try{n()}catch(i){console.error("TimeoutLatch callback error:",i)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class eae{constructor(){this.interval=null,this.latches=new Set}add(t){this.latches.add(t),this.start()}remove(t){this.latches.delete(t),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(t=>{t.tick(),t.isDone&&this.remove(t)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}}var z$=null,HBt=()=>typeof window>"u"?new eae:(z$||(z$=new eae),z$),qBt=Jt.theme({"& .cm-scroller":{height:"100% !important"}}),tae=null,V$=null;function WBt(e,t,n,i,r,s){if(!e&&!t&&!n&&!i&&!r&&!s)return null;var o=JSON.stringify({height:e,minHeight:t,maxHeight:n,width:i,minWidth:r,maxWidth:s});return o===tae||(tae=o,V$=Jt.theme({"&":{height:e,minHeight:t,maxHeight:n,width:i,minWidth:r,maxWidth:s}})),V$}var nae=Ih.define(),KBt=200,GBt=[];function XBt(e){var t=e.value,n=e.selection,i=e.onChange,r=e.onStatistics,s=e.onCreateEditor,o=e.onUpdate,l=e.extensions,c=l===void 0?GBt:l,u=e.autoFocus,d=e.theme,f=d===void 0?"light":d,h=e.height,m=h===void 0?null:h,g=e.minHeight,b=g===void 0?null:g,v=e.maxHeight,y=v===void 0?null:v,w=e.width,x=w===void 0?null:w,O=e.minWidth,k=O===void 0?null:O,S=e.maxWidth,C=S===void 0?null:S,E=e.placeholder,j=E===void 0?"":E,T=e.editable,R=T===void 0?!0:T,A=e.readOnly,N=A===void 0?!1:A,D=e.indentWithTab,I=D===void 0?!0:D,P=e.basicSetup,_=P===void 0?!0:P,L=e.root,F=e.initialState,M=p.useState(),V=M[0],q=M[1],U=p.useState(),Z=U[0],z=U[1],ee=p.useState(),ne=ee[0],W=ee[1],X=p.useState(()=>({current:null}))[0],H=p.useState(()=>({current:null}))[0],ae=WBt(m,b,y,x,k,C),Y=Jt.updateListener.of(J=>{if(J.docChanged&&typeof i=="function"&&!J.transactions.some(ge=>ge.annotation(nae))){X.current?X.current.reset():(X.current=new VBt(()=>{if(H.current){var ge=H.current;H.current=null,ge()}X.current=null},KBt),HBt().add(X.current));var ye=J.state.doc,de=ye.toString();i(de,J)}r&&r(zBt(J))}),K=QBt({theme:f,editable:R,readOnly:N,placeholder:j,indentWithTab:I,basicSetup:_}),ie=[Y,...ae?[ae]:[],qBt,...K];return o&&typeof o=="function"&&ie.push(Jt.updateListener.of(o)),ie=ie.concat(c),p.useLayoutEffect(()=>{if(V&&!ne){var J={doc:t,selection:n,extensions:ie},ye=F?tr.fromJSON(F.json,J,F.fields):tr.create(J);if(W(ye),!Z){var de=new Jt({state:ye,parent:V,root:L});z(de),s&&s(de,ye)}}return()=>{Z&&(W(void 0),z(void 0))}},[V,ne]),p.useEffect(()=>{e.container&&q(e.container)},[e.container]),p.useEffect(()=>()=>{Z&&(Z.destroy(),z(void 0)),X.current&&(X.current.cancel(),X.current=null)},[Z]),p.useEffect(()=>{u&&Z&&Z.focus()},[u,Z]),p.useEffect(()=>{Z&&Z.dispatch({effects:pi.reconfigure.of(ie)})},[f,c,m,b,y,x,k,C,j,R,N,I,_,i,o]),p.useEffect(()=>{if(t!==void 0){var J=Z?Z.state.doc.toString():"";if(Z&&t!==J){var ye=X.current&&!X.current.isDone,de=()=>{Z&&t!==Z.state.doc.toString()&&Z.dispatch({changes:{from:0,to:Z.state.doc.toString().length,insert:t||""},annotations:[nae.of(!0)]})};ye?H.current=de:de()}}},[t,Z]),{state:ne,setState:W,view:Z,setView:z,container:V,setContainer:q}}var YBt=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],xFe=p.forwardRef((e,t)=>{var n=e.className,i=e.value,r=i===void 0?"":i,s=e.selection,o=e.extensions,l=o===void 0?[]:o,c=e.onChange,u=e.onStatistics,d=e.onCreateEditor,f=e.onUpdate,h=e.autoFocus,m=e.theme,g=m===void 0?"light":m,b=e.height,v=e.minHeight,y=e.maxHeight,w=e.width,x=e.minWidth,O=e.maxWidth,k=e.basicSetup,S=e.placeholder,C=e.indentWithTab,E=e.editable,j=e.readOnly,T=e.root,R=e.initialState,A=AFt(e,YBt),N=p.useRef(null),D=XBt({root:T,value:r,autoFocus:h,theme:g,height:b,minHeight:v,maxHeight:y,width:w,minWidth:x,maxWidth:O,basicSetup:k,placeholder:S,indentWithTab:C,editable:E,readOnly:j,selection:s,onChange:c,onStatistics:u,onCreateEditor:d,onUpdate:f,extensions:l,initialState:R}),I=D.state,P=D.view,_=D.container,L=D.setContainer;p.useImperativeHandle(t,()=>({editor:N.current,state:I,view:P}),[N,_,I,P]);var F=p.useCallback(V=>{N.current=V,L(V)},[L]);if(typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var M=typeof g=="string"?"cm-theme-"+g:"cm-theme";return a.jsx("div",w7({ref:F,className:""+M+(n?" "+n:"")},A))});xFe.displayName="CodeMirror";function wFe(e){const t=e.toLowerCase(),n=t.split("/").pop()??t,i=n.includes(".")?n.split(".").pop():"";return n==="dockerfile"||n.startsWith("dockerfile.")||n.endsWith(".dockerfile")?[sW.define(CFt)]:i==="py"||i==="pyi"?[M6t()]:["ts","tsx","mts","cts"].includes(i??"")?[l7({typescript:!0,jsx:i==="tsx"})]:["js","jsx","mjs","cjs"].includes(i??"")?[l7({jsx:i==="jsx"})]:i==="json"||i==="jsonc"?[n3t()]:i==="yaml"||i==="yml"?[fFt()]:["md","markdown"].includes(i??"")?[g$t()]:[]}function LT({value:e,path:t,onChange:n,readOnly:i=!1,theme:r="light",lineNumberStart:s=1,height:o="100%",minHeight:l,maxHeight:c,extensions:u}){const d=p.useMemo(()=>[...wFe(t),...s===1?[]:[p4e({formatNumber:f=>String(f+s-1)})],...u??[]],[s,t,u]);return a.jsx(xFe,{value:e,height:o,minHeight:l,maxHeight:c,theme:r,extensions:d,editable:!i,onChange:n,basicSetup:{lineNumbers:s===1,foldGutter:!0,highlightActiveLine:!0,highlightActiveLineGutter:!0,autocompletion:!1}})}const OFe=Object.freeze(Object.defineProperty({__proto__:null,default:LT,languageFor:wFe},Symbol.toStringTag,{value:"Module"}));function ZBt(e){var s;const t=e.split(/\r?\n/);if(((s=t[0])==null?void 0:s.trim())!=="---")return{body:e,frontmatter:[]};const n=t.findIndex((o,l)=>l>0&&o.trim()==="---");if(n<0)return{body:e,frontmatter:[]};const i=L5e(t.slice(1,n).join(` `));if(i.errors.length>0)return{body:e,frontmatter:[]};const r=i.toJS();return!r||typeof r!="object"||Array.isArray(r)?{body:e,frontmatter:[]}:{body:t.slice(n+1).join(` -`).replace(/^\s*\n/,""),frontmatter:Object.entries(r).map(([o,l])=>({key:o,value:typeof l=="string"?l:qM(l).trim()}))}}function YBt(){return a.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M2.75 5.5h5l1.5 1.75h8v7.25a1.75 1.75 0 0 1-1.75 1.75h-11a1.75 1.75 0 0 1-1.75-1.75v-9Z"})})}function ZBt(){return a.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[a.jsx("path",{d:"M5 2.75h6l4 4v10.5H5z"}),a.jsx("path",{d:"M11 2.75v4h4"})]})}function JBt(e){const t={children:[]};for(const i of e){let r=t;const s=i.path.split("/").filter(Boolean);s.forEach((o,l)=>{let c=r.children.find(u=>u.name===o);if(!c){const u=s.slice(0,l+1).join("/");c={name:o,path:u,children:[]},r.children.push(c)}l===s.length-1&&(c.file=i),r=c})}const n=i=>{i.sort((r,s)=>+!!r.file-+!!s.file||r.name.localeCompare(s.name)),i.forEach(r=>n(r.children))};return n(t.children),t.children}function OFe({nodes:e,depth:t,activePath:n,onSelect:i}){return e.map(r=>a.jsxs("div",{children:[r.file?a.jsxs("button",{type:"button",className:`skill-file-tree__row${r.path===n?" is-active":""}`,style:{paddingLeft:`${12+t*16}px`},onClick:()=>i(r.file),title:r.path,children:[a.jsx(ZBt,{}),a.jsx("span",{children:r.name}),a.jsxs("small",{children:[r.file.size.toLocaleString()," B"]})]}):a.jsxs("div",{className:"skill-file-tree__row is-folder",style:{paddingLeft:`${12+t*16}px`},title:r.path,children:[a.jsx(YBt,{}),a.jsx("span",{children:r.name})]}),r.children.length>0?a.jsx(OFe,{nodes:r.children,depth:t+1,activePath:n,onSelect:i}):null]},r.path))}function e9t(e){if(e.content===void 0)return;if(e.content.startsWith("data:")){const i=document.createElement("a");i.href=e.content,i.download=e.path.split("/").pop()||"skill-file",i.click();return}const t=URL.createObjectURL(new Blob([e.content])),n=document.createElement("a");n.href=t,n.download=e.path.split("/").pop()||"skill-file",n.click(),URL.revokeObjectURL(t)}function fL({files:e}){var m;const{t,i18n:n}=Te("skills"),i=p.useMemo(()=>JBt(e),[e]),[r,s]=p.useState(((m=e[0])==null?void 0:m.path)||""),[o,l]=p.useState("preview"),c=e.find(g=>g.path===r)||e[0],u=(c==null?void 0:c.path.toLowerCase())||"",d=u.endsWith(".md")||u.endsWith(".markdown"),f=/\.(png|jpe?g|gif|webp|svg)$/.test(u),h=p.useMemo(()=>XBt(d&&(c==null?void 0:c.content)!==void 0?c.content:""),[c==null?void 0:c.content,d]);return a.jsxs("div",{className:"skill-file-browser",children:[a.jsx("aside",{className:"skill-file-tree","aria-label":t("fileTree.ariaLabel"),children:a.jsx(OFe,{nodes:i,depth:0,activePath:(c==null?void 0:c.path)||"",onSelect:g=>s(g.path)})}),a.jsx("section",{className:"skill-file-preview",children:c?a.jsxs(a.Fragment,{children:[a.jsxs("header",{children:[a.jsx("span",{title:c.path,children:c.path}),a.jsxs("div",{children:[d?a.jsx("button",{type:"button",onClick:()=>l(g=>g==="preview"?"source":"preview"),children:t(o==="preview"?"fileTree.viewSource":"fileTree.viewPreview")}):null,a.jsx("button",{type:"button",disabled:c.content===void 0,onClick:()=>e9t(c),children:t("fileTree.download")})]})]}),a.jsx("div",{className:"skill-file-preview__body",children:c.kind==="binary"||c.content===void 0?a.jsxs("div",{className:"skill-file-preview__binary",children:[a.jsx("strong",{children:t("fileTree.binaryFile")}),a.jsx("span",{children:t("fileTree.bytes",{value:new Intl.NumberFormat(n.resolvedLanguage).format(c.size)})}),a.jsx("span",{children:t("fileTree.binaryDescription")})]}):f?a.jsx("img",{src:c.content.startsWith("data:")?c.content:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(c.content)}`,alt:c.path}):d&&o==="preview"?a.jsxs("div",{className:"skill-file-preview__markdown",children:[h.frontmatter.length>0?a.jsx("dl",{className:"skill-file-preview__frontmatter","aria-label":t("fileTree.metadata"),children:h.frontmatter.map(g=>a.jsxs("div",{children:[a.jsx("dt",{children:g.key}),a.jsx("dd",{children:g.value})]},g.key))}):null,a.jsx(Td,{text:h.body,allowRawHtml:!1,className:"skill-file-preview__markdown-body"})]}):a.jsx(MT,{value:c.content,path:c.path,readOnly:!0,onChange:()=>{}})})]}):a.jsx("div",{className:"skill-file-preview__binary",children:t("fileTree.noFiles")})})]})}const t9t=Object.freeze(Object.defineProperty({__proto__:null,SkillFileTree:fL},Symbol.toStringTag,{value:"Module"})),n9t=1200,i9t=3,kFe=2,r9t=/SKILL\.md|frontmatter|Skill name|description|根目录|目录名|UTF-8|文本文件|文件数|符号链接|敏感凭证/i,nae={concise:"generation.styles.concise",strict:"generation.styles.strict",tutorial:"generation.styles.tutorial",automation:"generation.styles.automation"};function iae(e,t){var n;return{id:`group-${Date.now()}-${e}`,model:((n=t.models[e%Math.max(1,t.models.length)])==null?void 0:n.id)||"",style:"concise",customStyle:""}}function s9t(e){return e?e.state==="ready"?en("generation.stages.ready"):e.state==="failed"?en("generation.stages.failed"):e.state==="cancelled"?en("generation.stages.cancelled"):e.stage==="validating"?en("generation.stages.validating"):e.stage==="packaging"?en("generation.stages.packaging"):en("generation.stages.generating"):en("generation.stages.preparing")}function V$(e){var t;return e.state==="failed"&&((t=e.validation)==null?void 0:t.valid)===!1&&e.validation.errors.some(n=>r9t.test(n))}function rae(e){var n;const t=((n=e.validation)==null?void 0:n.errors.join(` +`).replace(/^\s*\n/,""),frontmatter:Object.entries(r).map(([o,l])=>({key:o,value:typeof l=="string"?l:qM(l).trim()}))}}function JBt(){return a.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M2.75 5.5h5l1.5 1.75h8v7.25a1.75 1.75 0 0 1-1.75 1.75h-11a1.75 1.75 0 0 1-1.75-1.75v-9Z"})})}function e9t(){return a.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[a.jsx("path",{d:"M5 2.75h6l4 4v10.5H5z"}),a.jsx("path",{d:"M11 2.75v4h4"})]})}function t9t(e){const t={children:[]};for(const i of e){let r=t;const s=i.path.split("/").filter(Boolean);s.forEach((o,l)=>{let c=r.children.find(u=>u.name===o);if(!c){const u=s.slice(0,l+1).join("/");c={name:o,path:u,children:[]},r.children.push(c)}l===s.length-1&&(c.file=i),r=c})}const n=i=>{i.sort((r,s)=>+!!r.file-+!!s.file||r.name.localeCompare(s.name)),i.forEach(r=>n(r.children))};return n(t.children),t.children}function kFe({nodes:e,depth:t,activePath:n,onSelect:i}){return e.map(r=>a.jsxs("div",{children:[r.file?a.jsxs("button",{type:"button",className:`skill-file-tree__row${r.path===n?" is-active":""}`,style:{paddingLeft:`${12+t*16}px`},onClick:()=>i(r.file),title:r.path,children:[a.jsx(e9t,{}),a.jsx("span",{children:r.name}),a.jsxs("small",{children:[r.file.size.toLocaleString()," B"]})]}):a.jsxs("div",{className:"skill-file-tree__row is-folder",style:{paddingLeft:`${12+t*16}px`},title:r.path,children:[a.jsx(JBt,{}),a.jsx("span",{children:r.name})]}),r.children.length>0?a.jsx(kFe,{nodes:r.children,depth:t+1,activePath:n,onSelect:i}):null]},r.path))}function n9t(e){if(e.content===void 0)return;if(e.content.startsWith("data:")){const i=document.createElement("a");i.href=e.content,i.download=e.path.split("/").pop()||"skill-file",i.click();return}const t=URL.createObjectURL(new Blob([e.content])),n=document.createElement("a");n.href=t,n.download=e.path.split("/").pop()||"skill-file",n.click(),URL.revokeObjectURL(t)}function fL({files:e}){var m;const{t,i18n:n}=Te("skills"),i=p.useMemo(()=>t9t(e),[e]),[r,s]=p.useState(((m=e[0])==null?void 0:m.path)||""),[o,l]=p.useState("preview"),c=e.find(g=>g.path===r)||e[0],u=(c==null?void 0:c.path.toLowerCase())||"",d=u.endsWith(".md")||u.endsWith(".markdown"),f=/\.(png|jpe?g|gif|webp|svg)$/.test(u),h=p.useMemo(()=>ZBt(d&&(c==null?void 0:c.content)!==void 0?c.content:""),[c==null?void 0:c.content,d]);return a.jsxs("div",{className:"skill-file-browser",children:[a.jsx("aside",{className:"skill-file-tree","aria-label":t("fileTree.ariaLabel"),children:a.jsx(kFe,{nodes:i,depth:0,activePath:(c==null?void 0:c.path)||"",onSelect:g=>s(g.path)})}),a.jsx("section",{className:"skill-file-preview",children:c?a.jsxs(a.Fragment,{children:[a.jsxs("header",{children:[a.jsx("span",{title:c.path,children:c.path}),a.jsxs("div",{children:[d?a.jsx("button",{type:"button",onClick:()=>l(g=>g==="preview"?"source":"preview"),children:t(o==="preview"?"fileTree.viewSource":"fileTree.viewPreview")}):null,a.jsx("button",{type:"button",disabled:c.content===void 0,onClick:()=>n9t(c),children:t("fileTree.download")})]})]}),a.jsx("div",{className:"skill-file-preview__body",children:c.kind==="binary"||c.content===void 0?a.jsxs("div",{className:"skill-file-preview__binary",children:[a.jsx("strong",{children:t("fileTree.binaryFile")}),a.jsx("span",{children:t("fileTree.bytes",{value:new Intl.NumberFormat(n.resolvedLanguage).format(c.size)})}),a.jsx("span",{children:t("fileTree.binaryDescription")})]}):f?a.jsx("img",{src:c.content.startsWith("data:")?c.content:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(c.content)}`,alt:c.path}):d&&o==="preview"?a.jsxs("div",{className:"skill-file-preview__markdown",children:[h.frontmatter.length>0?a.jsx("dl",{className:"skill-file-preview__frontmatter","aria-label":t("fileTree.metadata"),children:h.frontmatter.map(g=>a.jsxs("div",{children:[a.jsx("dt",{children:g.key}),a.jsx("dd",{children:g.value})]},g.key))}):null,a.jsx(jd,{text:h.body,allowRawHtml:!1,className:"skill-file-preview__markdown-body"})]}):a.jsx(LT,{value:c.content,path:c.path,readOnly:!0,onChange:()=>{}})})]}):a.jsx("div",{className:"skill-file-preview__binary",children:t("fileTree.noFiles")})})]})}const i9t=Object.freeze(Object.defineProperty({__proto__:null,SkillFileTree:fL},Symbol.toStringTag,{value:"Module"})),r9t=1200,s9t=3,SFe=2,a9t=/SKILL\.md|frontmatter|Skill name|description|根目录|目录名|UTF-8|文本文件|文件数|符号链接|敏感凭证/i,iae={concise:"generation.styles.concise",strict:"generation.styles.strict",tutorial:"generation.styles.tutorial",automation:"generation.styles.automation"};function rae(e,t){var n;return{id:`group-${Date.now()}-${e}`,model:((n=t.models[e%Math.max(1,t.models.length)])==null?void 0:n.id)||"",style:"concise",customStyle:""}}function o9t(e){return e?e.state==="ready"?en("generation.stages.ready"):e.state==="failed"?en("generation.stages.failed"):e.state==="cancelled"?en("generation.stages.cancelled"):e.stage==="validating"?en("generation.stages.validating"):e.stage==="packaging"?en("generation.stages.packaging"):en("generation.stages.generating"):en("generation.stages.preparing")}function H$(e){var t;return e.state==="failed"&&((t=e.validation)==null?void 0:t.valid)===!1&&e.validation.errors.some(n=>a9t.test(n))}function sae(e){var n;const t=((n=e.validation)==null?void 0:n.errors.join(` `))||e.error||en("generation.validation.fallback");return[en("generation.validation.repairInstruction"),en("generation.validation.recheckInstruction"),t.slice(0,2e3)].join(` -`)}function a9t(e){var t;if(e.repairing||((t=e.task)==null?void 0:t.state)==="running"&&e.repairMode){if(e.repairMode==="manual")return en("generation.stages.repairingAgain");const n=Math.max(1,e.repairAttempts||1);return en("generation.stages.autoRepairing",{attempt:n,max:kFe})}return s9t(e.task)}function sae(){return a.jsxs("svg",{className:"skill-generation__spinner",viewBox:"0 0 20 20","aria-hidden":"true",children:[a.jsx("circle",{cx:"10",cy:"10",r:"7"}),a.jsx("path",{d:"M10 3a7 7 0 0 1 7 7"})]})}function o9t(e,t=Date.now()){if(!(e!=null&&e.expiresAt))return en("generation.sessionMax");const n=Math.max(0,new Date(e.expiresAt).getTime()-t),i=Math.floor(n/6e4),r=Math.floor(n%6e4/1e3);return en("generation.remaining",{minutes:i,seconds:String(r).padStart(2,"0")})}function l9t(e){return e?e.length>64?en("generation.validation.nameTooLong"):/^[a-z0-9-]+$/.test(e)?"":en("generation.validation.invalidName"):""}function aae(e){return e?e.length>128?en("generation.validation.modelTooLong"):/^[A-Za-z0-9][A-Za-z0-9._:/-]*$/.test(e)?"":en("generation.validation.invalidModel"):""}function H$(e){return`${e.region||""}:${e.id}`}function c9t(){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m14.5 6-6 6 6 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}function u9t({operation:e,cloudProvider:t,space:n,availableSpaces:i=[],spacesLoading:r=!1,initialIntent:s="",source:o,onBack:l,onPublished:c}){var Oe,Se,We,Ye;const{t:u}=Te("skills"),[d,f]=p.useState(null),[h,m]=p.useState(null),[g,b]=p.useState(s),[v,y]=p.useState(""),[w,x]=p.useState([]),[O,k]=p.useState([]),[S,C]=p.useState(""),[E,j]=p.useState(!1),[T,R]=p.useState(""),[A,N]=p.useState(""),[P,I]=p.useState(null),[D,_]=p.useState(""),[L,F]=p.useState(""),[M,V]=p.useState(n?H$(n):""),[q,U]=p.useState(Date.now()),J=p.useRef([]);p.useEffect(()=>{const ye=new AbortController;return NM(ye.signal).then(we=>{f(we),x([iae(0,we)])}).catch(we=>{ye.signal.aborted||m(Pr(we,en("generation.errors.loadCapability")))}),()=>ye.abort()},[]),p.useEffect(()=>{J.current=O},[O]),p.useEffect(()=>{const ye=window.setInterval(()=>U(Date.now()),1e3);return()=>window.clearInterval(ye)},[]),p.useEffect(()=>{const ye=we=>{J.current.some(Ae=>{var He;return((He=Ae.task)==null?void 0:He.state)==="running"||Ae.repairing})&&we.preventDefault()};return window.addEventListener("beforeunload",ye),()=>{var we;window.removeEventListener("beforeunload",ye);for(const Ae of J.current)(we=Ae.task)!=null&&we.jobId&&C2t(Ae.task.jobId).catch(()=>{})}},[]),p.useEffect(()=>{if(!O.some(He=>{var Ue;return((Ue=He.task)==null?void 0:Ue.state)==="running"||He.repairing}))return;let ye=!1,we;const Ae=async()=>{const He=J.current,Ue=await Promise.all(He.map(async jt=>{var Pt;if(((Pt=jt.task)==null?void 0:Pt.state)!=="running")return jt;try{const Kt=await k2t(jt.task.jobId);if(V$(Kt)&&(jt.repairAttempts||0)tt.map(mt=>mt.id===jt.id?{...mt,task:Kt,repairing:!0,repairMode:"auto",repairAttempts:xt,repairError:void 0}:mt));try{const tt=await M4({jobId:Kt.jobId,intent:rae(Kt),expectedRevision:Kt.revision});return{...jt,task:tt,artifact:void 0,repairing:!1,repairMode:"auto",repairAttempts:xt,repairError:void 0,error:void 0,pollError:void 0}}catch(tt){return{...jt,task:Kt,repairing:!1,repairMode:void 0,repairAttempts:xt,repairError:Pr(tt,en("generation.errors.autoRepair")),pollError:void 0}}}let Ct=jt.artifact;return Kt.state==="ready"&&(Ct=await D4(Kt.jobId,Kt.revision)),{...jt,task:Kt,artifact:Ct,repairing:!1,repairMode:Kt.state==="running"?jt.repairMode:void 0,repairError:void 0,error:void 0,pollError:void 0}}catch(Kt){return{...jt,pollError:Pr(Kt,en("generation.errors.pollCandidate"))}}}));ye||(k(Ue),we=window.setTimeout(()=>void Ae(),n9t))};return Ae(),()=>{ye=!0,we!==void 0&&window.clearTimeout(we)}},[O.some(ye=>{var we;return((we=ye.task)==null?void 0:we.state)==="running"||ye.repairing})]);const z=O.find(ye=>ye.id===S)||O[0],Z=e==="create"&&!n,ne=i.find(ye=>H$(ye)===M)??null,W=n??ne,G=i.map(ye=>({value:H$(ye),label:`${Pc(ye)||u("generation.unnamedSpace")} · ${wh(ye.region||"cn-beijing",t)}`})),H=l9t(v),se=!!(d!=null&&d.enabled&&g.trim()&&!H&&w.length>0&&w.every(ye=>ye.model.trim()&&!aae(ye.model.trim()))),Y=(ye,we)=>{x(Ae=>Ae.map(He=>He.id===ye?{...He,...we}:He))},X=async ye=>{const we={...ye,model:ye.model.trim()},Ae=ye.style==="custom"?ye.customStyle.trim():ye.style;try{const He=await O2t({operation:e,intent:g.trim(),model:we.model,style:Ae,name:v.trim()||void 0,source:o});return{id:ye.id,config:we,task:He}}catch(He){return{id:ye.id,config:we,error:Pr(He,en("generation.errors.createCandidate"))}}},ie=async()=>{if(!se)return;j(!0),I(null);const ye=w.map(Ae=>({id:Ae.id,config:Ae}));k(ye),C(w[0].id);const we=await Promise.all(w.map(X));k(we)},ee=async ye=>{k(Ae=>Ae.map(He=>He.id===ye.id?{...He,error:void 0}:He));const we=await X(ye.config);k(Ae=>Ae.map(He=>He.id===ye.id?we:He))},be=async()=>{if(!(!(z!=null&&z.task)||!T.trim()||z.task.state!=="ready")){N("refine"),I(null);try{const ye=await M4({jobId:z.task.jobId,intent:T.trim(),expectedRevision:z.task.revision});k(we=>we.map(Ae=>Ae.id===z.id?{...Ae,task:ye,artifact:void 0}:Ae)),R("")}catch(ye){I(Pr(ye,en("generation.errors.refine")))}finally{N("")}}},ue=async()=>{if(!(!(z!=null&&z.task)||!V$(z.task))){N("refine"),I(null),k(ye=>ye.map(we=>we.id===z.id?{...we,repairing:!0,repairMode:"manual",repairError:void 0}:we));try{const ye=await M4({jobId:z.task.jobId,intent:rae(z.task),expectedRevision:z.task.revision});k(we=>we.map(Ae=>Ae.id===z.id?{...Ae,task:ye,artifact:void 0,repairing:!1,repairMode:"manual",repairError:void 0}:Ae))}catch(ye){k(we=>we.map(Ae=>Ae.id===z.id?{...Ae,repairing:!1,repairMode:void 0,repairError:Pr(ye,en("generation.errors.repairAgain"))}:Ae))}finally{N("")}}},pe=async()=>{if(!(!(z!=null&&z.task)||z.task.state!=="ready"||L)){N("publish"),I(null);try{if(!W)throw new Error(en("generation.errors.selectSpace"));const ye=z.artifact||await D4(z.task.jobId,z.task.revision),we=(o==null?void 0:o.region)||W.region||"";if(!AD(we))throw new Error(en("generation.errors.unsupportedRegion"));await E2t({jobId:z.task.jobId,expectedRevision:z.task.revision,expectedArtifactSha256:ye.sha256,disposition:e==="optimize"?"update-source":"create-new",skillSpaceIds:[W.id],projectName:(o==null?void 0:o.projectName)||W.projectName,region:we,onProgress:Ae=>_(Ae.message)}),F(z.id),c()}catch(ye){I(Pr(ye,en("generation.errors.upload")))}finally{N(""),_("")}}},ke=async()=>{if(!(!(z!=null&&z.task)||z.task.state!=="ready")){N("download");try{const ye=z.artifact||await D4(z.task.jobId,z.task.revision);await A2t(z.task.jobId,z.task.revision,ye.sha256)}catch(ye){I(Pr(ye,en("generation.errors.download")))}finally{N("")}}},je=async()=>{O.some(ye=>{var we;return((we=ye.task)==null?void 0:we.state)==="running"})&&!window.confirm(en("generation.leaveConfirmation"))||(await Promise.allSettled(O.flatMap(ye=>{var we;return((we=ye.task)==null?void 0:we.state)==="running"?[S2t({jobId:ye.task.jobId,expectedRevision:ye.task.revision})]:[]})),l())},Pe=e==="create"?u("generation.createTitle"):u("generation.optimizeTitle",{name:(o==null?void 0:o.name)||u("generation.skillFallback")}),Ee=ye=>{var we;return((we=d==null?void 0:d.models.find(Ae=>Ae.id===ye))==null?void 0:we.label)||ye},ze=ye=>ye.config.style==="custom"?ye.config.customStyle.trim()||u("generation.styles.customFallback"):u(nae[ye.config.style]),_e=[...Object.entries(nae).map(([ye,we])=>({value:ye,label:u(we)})),{value:"custom",label:u("generation.styles.custom")}],ae=ye=>ye.error||ye.repairError?u("generation.stages.failed"):a9t(ye),le=ye=>!ye.error&&!ye.repairError&&(ye.repairing||!ye.task||ye.task.state==="running"),ge=O.some(ye=>{var we;return((we=ye.task)==null?void 0:we.state)==="ready"});return a.jsxs("section",{className:"skill-generation",children:[a.jsxs("header",{className:"skill-generation__header",children:[a.jsx("button",{type:"button",className:"skillcenter-back",onClick:()=>void je(),"aria-label":u("generation.back"),children:a.jsx(c9t,{})}),a.jsxs("div",{children:[a.jsx("h1",{children:Pe}),a.jsx("p",{children:Pc(n)||u("generation.home")})]}),O.length>0?a.jsx("span",{className:"skill-generation__ttl",children:o9t(z==null?void 0:z.task,q)}):null]}),E?a.jsxs("div",{className:"skill-generation__workspace",children:[a.jsx("div",{className:"skill-generation__candidate-tabs",role:"tablist","aria-label":u("generation.candidates"),children:O.map(ye=>a.jsxs("button",{type:"button",role:"tab","aria-selected":(z==null?void 0:z.id)===ye.id,className:(z==null?void 0:z.id)===ye.id?"is-active":"",onClick:()=>C(ye.id),children:[a.jsxs("span",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.style")}),a.jsx("strong",{children:ze(ye)})]}),a.jsxs("span",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.model")}),a.jsx("strong",{children:Ee(ye.config.model)})]}),a.jsxs("span",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.progress")}),a.jsxs("strong",{children:[le(ye)?a.jsx(sae,{}):null,ae(ye)]})]})]},ye.id))}),z?a.jsxs("div",{className:"skill-generation__candidate",children:[a.jsxs("section",{className:"skill-generation__activity",children:[a.jsx("header",{children:a.jsxs("div",{className:"skill-generation__candidate-summary",children:[a.jsxs("div",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.style")}),a.jsx("strong",{children:ze(z)})]}),a.jsxs("div",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.model")}),a.jsx("strong",{children:Ee(z.config.model)})]}),a.jsxs("div",{className:"skill-generation__summary-row","aria-live":"polite",children:[a.jsx("span",{children:u("generation.progress")}),a.jsxs("strong",{children:[le(z)?a.jsx(sae,{}):null,le(z)?a.jsx(fn,{children:ae(z)}):ae(z)]})]})]})}),z.task?a.jsx(jNt,{activities:z.task.activities}):null,z.pollError?a.jsx("div",{className:"skill-inline-notice",children:a.jsx(Ns,{error:z.pollError})}):null,z.repairError?a.jsx("div",{className:"skill-inline-notice",children:a.jsx(Ns,{error:z.repairError})}):null,z.error?a.jsxs("div",{className:"skill-inline-error",children:[a.jsx(Ns,{error:z.error}),a.jsx("button",{type:"button",onClick:()=>void ee(z),children:u("generation.retryCandidate")})]}):null,(Oe=z.task)!=null&&Oe.validation&&!z.task.validation.valid&&!z.repairing&&z.task.state==="failed"?a.jsxs("div",{className:"skill-validation-errors",children:[a.jsx("strong",{children:u("generation.formatValidationFailed")}),z.task.validation.errors.map(ye=>a.jsx("p",{children:ye},ye)),V$(z.task)?a.jsx("button",{type:"button",disabled:!!A,onClick:()=>void ue(),children:u("generation.repairAgain")}):null]}):null]}),a.jsxs("section",{className:"skill-generation__files",children:[a.jsxs("header",{children:[a.jsx("h2",{children:u("generation.files")}),((Se=z.task)==null?void 0:Se.state)==="ready"?a.jsx("button",{type:"button",onClick:()=>void ke(),disabled:!!A,children:u("generation.downloadZip")}):null]}),z.artifact?a.jsx(fL,{files:z.artifact.files}):a.jsx("div",{className:"skill-generation__files-empty",children:((We=z.task)==null?void 0:We.state)==="ready"?u("generation.loadingFiles"):u("generation.filesPending")})]}),((Ye=z.task)==null?void 0:Ye.state)==="ready"?a.jsxs("div",{className:"skill-generation__ready-actions",children:[Z?a.jsx("div",{className:"skill-generation__publish-target",children:a.jsx(RN,{label:u("generation.uploadToSpace"),value:M,options:G,onChange:V,disabled:r,placeholder:u(r?"generation.loadingSpaces":"generation.selectSpace")})}):null,a.jsxs("footer",{className:"skill-generation__followup",children:[a.jsx("textarea",{value:T,onChange:ye=>R(ye.target.value),placeholder:u("generation.continuePlaceholder")}),a.jsx("button",{type:"button",className:"skill-button",disabled:!T.trim()||!!A,onClick:()=>void be(),children:u("generation.continue")}),a.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!!A||!!L||!W,onClick:()=>void pe(),children:A==="publish"?D||u("generation.uploading"):u(e==="optimize"?"generation.overwrite":Z?"generation.uploadToSelectedSpace":"generation.uploadToCurrentSpace")})]})]}):null,P?a.jsx("div",{className:"skill-inline-error skill-generation__action-error",children:a.jsx(Ns,{error:P})}):null]}):null,!ge&&O.every(ye=>ye.error)?a.jsx("div",{className:"skill-inline-error",children:u("generation.allCandidatesFailed")}):null]}):a.jsxs("div",{className:"skill-generation__setup",children:[a.jsx("div",{className:"skill-generation__section-head is-basic",children:a.jsx("div",{children:a.jsx("strong",{children:u("generation.basicInfo")})})}),a.jsxs("label",{children:[a.jsxs("span",{children:[u("generation.goal"),a.jsx("span",{className:"skill-required-mark","aria-hidden":"true",children:"*"})]}),a.jsx("textarea",{required:!0,value:g,onChange:ye=>b(ye.target.value),placeholder:u(e==="create"?"generation.createIntentPlaceholder":"generation.optimizeIntentPlaceholder")})]}),a.jsxs("label",{children:[a.jsx("span",{children:u("generation.skillName")}),a.jsx("input",{value:v,onChange:ye=>y(ye.target.value),placeholder:u("generation.autoNamePlaceholder"),"aria-invalid":!!H,"aria-describedby":"skill-name-help"}),H?a.jsx("span",{id:"skill-name-help",className:"skill-generation__field-error",role:"alert",children:H}):a.jsx("span",{id:"skill-name-help",className:"skill-generation__field-help",children:u("generation.nameHelp")})]}),a.jsx("div",{className:"skill-generation__section-head",children:a.jsxs("div",{children:[a.jsx("strong",{children:u(e==="create"?"generation.createPlans":"generation.optimizePlans")}),a.jsx("span",{children:u(e==="create"?"generation.createPlansDescription":"generation.optimizePlansDescription")})]})}),a.jsxs("div",{className:"skill-generation__groups",children:[w.map((ye,we)=>a.jsxs("article",{className:"skill-generation__group",children:[a.jsxs("header",{children:[a.jsx("strong",{children:u("generation.plan",{count:we+1})}),w.length>1?a.jsx("button",{type:"button",onClick:()=>x(Ae=>Ae.filter(He=>He.id!==ye.id)),children:u("generation.remove")}):null]}),a.jsx(RN,{label:u("generation.model"),required:!0,value:ye.model,options:(d==null?void 0:d.models.map(Ae=>({value:Ae.id,label:Ae.label})))||[],onChange:Ae=>Y(ye.id,{model:Ae}),allowCustom:!0,placeholder:u("generation.modelPlaceholder"),error:aae(ye.model.trim())}),a.jsx(RN,{label:u("generation.style"),required:!0,value:ye.style,options:_e,onChange:Ae=>Y(ye.id,{style:Ae})}),ye.style==="custom"?a.jsxs("label",{children:[a.jsx("span",{children:u("generation.customStyle")}),a.jsx("textarea",{value:ye.customStyle,onChange:Ae=>Y(ye.id,{customStyle:Ae.target.value}),placeholder:u("generation.customStylePlaceholder")})]}):null]},ye.id)),d&&w.lengthx(ye=>[...ye,iae(ye.length,d)]),children:u("generation.addConfiguration")}):null]}),h?a.jsx("div",{className:"skill-inline-error",children:a.jsx(Ns,{error:h})}):null,d&&!d.enabled?a.jsx("div",{className:"skill-inline-notice",children:u("generation.notConfigured")}):null,a.jsx("div",{className:"skill-generation__setup-actions",children:a.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!se,onClick:()=>void ie(),children:u("generation.generate")})})]})]})}async function SFe(e,t,n,i){const r=new URLSearchParams({region:e.region}),s=await fetch(Ta(`/web/skill-management/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/versions?${r}`),{...t,headers:ul(uc(t.headers)),signal:po(e.signal,i)});if(!s.ok)throw await nT(s,n);return s.json()}function d9t(e){return SFe(e,{},Q("skills.listVersionsFailed"),ho)}function f9t(e){return SFe(e,{method:"POST",headers:{"Content-Type":"application/zip"},body:e.file},Q("skills.uploadVersionFailed"),hr)}function EFe(e){const t=new Map;for(const n of e){const i=`${n.sourceSkillId}:${n.version}`,r=t.get(i);(!r||n.submittedAt>r.submittedAt)&&t.set(i,n)}return t}function h9t(e,t,n,i){const r=i.trim().toLocaleLowerCase();return e.filter(s=>s.kind===t&&(n==="all"||s.status===n)&&`${s.name} ${s.description} ${s.author} ${s.version}`.toLocaleLowerCase().includes(r))}const CFe=p.createContext(void 0);function Ib(e){const t=p.useContext(CFe);if(!e&&t===void 0)throw new Error(Vc(27));return t}const nv=p.forwardRef(function(t,n){const{render:i,className:r,style:s,forceRender:o=!1,...l}=t,c=Ib(),u=c.useState("open"),d=c.useState("nested"),f=c.useState("mounted"),h=c.useState("transitionStatus");return Ra("div",t,{state:{open:u,transitionStatus:h},ref:[c.context.backdropRef,n],stateAttributesMapping:wje,props:[{role:"presentation",hidden:!f,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:o||!d})}),hL=p.forwardRef(function(t,n){const{render:i,className:r,style:s,disabled:o=!1,nativeButton:l=!0,...c}=t,u=Ib(),d=u.useState("open"),{getButtonProps:f,buttonRef:h}=GD({disabled:o,native:l}),m={disabled:o};function g(b){d&&u.setOpen(!1,fa(A_e,b.nativeEvent))}return Ra("button",t,{state:m,ref:[n,h],props:[{onClick:g},c,f]})}),LT=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:o,...l}=t,c=Ib(),u=em(o);return c.useSyncedValueWithCleanup("descriptionElementId",u),Ra("p",t,{ref:n,props:[{id:u},l]})}),AFe=p.createContext(void 0);function p9t(){const e=p.useContext(AFe);if(e===void 0)throw new Error(Vc(26));return e}const m9t={...fV,...KD,nestedDialogOpen(e){return e?{"data-nested-dialog-open":""}:null}},iv=p.forwardRef(function(t,n){const{render:i,className:r,style:s,finalFocus:o,initialFocus:l,...c}=t,u=Ib(),d=u.useState("descriptionElementId"),f=u.useState("disablePointerDismissal"),h=u.useState("floatingRootContext"),m=u.useState("popupProps"),g=u.useState("modal"),b=u.useState("mounted"),v=u.useState("nested"),y=u.useState("nestedOpenDialogCount"),w=u.useState("open"),x=u.useState("openMethod"),O=u.useState("titleElementId"),k=u.useState("transitionStatus"),S=u.useState("role"),C=h.useState("floatingId");p9t(),zA({open:w,ref:u.context.popupRef,onComplete(){var N,P;w&&((P=(N=u.context).onOpenChangeComplete)==null||P.call(N,!0))}});const E=l===void 0?ije(u.context.popupRef):l,j=y>0,T=u.useStateSetter("popupElement"),A=Ra("div",t,{state:{open:w,nested:v,transitionStatus:k,nestedDialogOpen:j},props:[m,{id:C,"aria-labelledby":O,"aria-describedby":d,role:S,...nje,hidden:!b,onKeyDown(N){cLe.has(N.key)&&N.stopPropagation()},style:{"--nested-dialogs":y}},c],ref:[n,u.context.popupRef,T],stateAttributesMapping:m9t});return a.jsx(F_e,{context:h,openInteractionType:x,disabled:!b,closeOnFocusOut:!f,initialFocus:E,returnFocus:o,modal:g!==!1,restoreFocus:"popup",children:A})}),rv=p.forwardRef(function(t,n){const{keepMounted:i=!1,...r}=t,s=Ib(),o=s.useState("mounted"),l=s.useState("modal"),c=s.useState("open");return o||i?a.jsx(AFe.Provider,{value:i,children:a.jsxs(I_e,{ref:n,...r,children:[o&&l===!0&&a.jsx(oLe,{ref:s.context.internalBackdropRef,inert:iV(!c)}),t.children]})}):null});function g9t({store:e,parentContext:t,isDrawer:n}){const i=e.useState("open"),r=e.useState("disablePointerDismissal"),s=e.useState("modal"),o=e.useState("popupElement"),l=e.useState("floatingRootContext"),[c,u]=p.useState(0),[d,f]=p.useState(0),h=c===0,m=U_e(l,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:s==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(g){if(!e.context.outsidePressEnabledRef.current||"button"in g&&g.button!==0)return!1;if("touches"in g){if(g.type==="touchend"){if(g.changedTouches.length!==1||g.touches.length!==0)return!1}else if(g.touches.length!==1)return!1}const b=uo(g);if(h&&!r){if(s){const v=e.context.internalBackdropRef.current,y=e.context.backdropRef.current;return v||y?v===b||y===b||ii(b,o)&&!(b!=null&&b.hasAttribute("data-base-ui-portal")):!0}return!0}return!1},escapeKey:h});return lLe(i&&s===!0,o),e.useContextCallback("onNestedDialogOpen",(g,b)=>{u(g),f(b)}),Jn(()=>(t!=null&&t.onNestedDialogOpen&&(i?t.onNestedDialogOpen(c+1,d+(n?1:0)):t.onNestedDialogOpen(0,0)),()=>{t!=null&&t.onNestedDialogOpen&&i&&t.onNestedDialogOpen(0,0)}),[n,i,c,d,t]),uje(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:c,nestedOpenDrawerCount:d}),null}const b9t={...mje,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role};class y9t extends BD{constructor(n,i,r){const s=new cV,o=v9t(n,s,i,r);super(o,x9t(s),b9t);Zt(this,"setOpen",(n,i)=>{var s,o;if(i.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!n&&i.trigger==null&&this.state.activeTriggerId!=null&&(i.trigger=this.state.activeTriggerElement??void 0),(o=(s=this.context).onOpenChange)==null||o.call(s,n,i),i.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,i);const r={open:n};aje(r,n,i.trigger),this.update(r)})}}function v9t(e,t,n,i=!1){const r={...fje(),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e};return r.floatingRootContext=hje(t,n,i),r}function x9t(e){return{popupRef:p.createRef(),backdropRef:p.createRef(),internalBackdropRef:p.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function w9t(e,t){const{children:n,open:i,defaultOpen:r=!1,onOpenChange:s,onOpenChangeComplete:o,disablePointerDismissal:l=!1,modal:c=!0,actionsRef:u,handle:d,triggerId:f,defaultTriggerId:h=null}=t,m=e==="drawer",g=c,b=l,v="dialog",y=Ib(!0),w=y!=null,x={modal:g,disablePointerDismissal:b,nested:w,role:v},O=rje((T,R)=>new y9t({open:r,openProp:i,activeTriggerId:h,triggerIdProp:f,...x},T,R),!0);O.useControlledProp("openProp",i),O.useControlledProp("triggerIdProp",f),O.useSyncedValues(x),O.useContextCallback("onOpenChange",s),O.useContextCallback("onOpenChangeComplete",o);const k=O.useState("open"),S=O.useState("mounted"),C=O.useState("payload");dje(O,k),lje(O);const{forceUnmount:E}=cje(k,O);p.useImperativeHandle(u,()=>({unmount:E,close:()=>O.setOpen(!1,fa(__e))}),[E,O]);const j=k||S;return a.jsxs(CFe.Provider,{value:O,children:[d&&a.jsx(sje,{handle:d,store:O}),j&&a.jsx(g9t,{store:O,parentContext:y==null?void 0:y.context,isDrawer:m}),typeof n=="function"?n({payload:C}):n]})}function sv(e){return w9t("dialog",e)}const yO=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:o,...l}=t,c=Ib(),u=em(o);return c.useSyncedValueWithCleanup("titleElementId",u),Ra("h2",t,{ref:n,props:[{id:u},l]})}),TFe=p.forwardRef(function(t,n){const{render:i,className:r,style:s,disabled:o=!1,nativeButton:l=!0,id:c,payload:u,handle:d,...f}=t,h=Ib(!0),g=gje(d)??h;if(!g)throw new Error(Vc(79));const b=em(c),v=g.useState("floatingRootContext"),y=g.useState("isOpenedByTrigger",b),w=g.useState("triggerPopupId",b),x=p.useRef(null),{registerTrigger:O,isMountedByThisTrigger:k}=oje(b,x,g,{payload:u}),{getButtonProps:S,buttonRef:C}=GD({disabled:o,native:l}),E=B_e(v),j=rLe(()=>g.select("open"),A=>{g.set("openMethod",A)}),T={disabled:o,open:y},R=g.useState("triggerProps",k);return Ra("button",t,{state:T,ref:[C,n,O,x],props:[E.reference,R,j,{[sV]:"",id:b,"aria-haspopup":"dialog","aria-expanded":y,"aria-controls":w},f,S],stateAttributesMapping:xje})});async function _Fe(e,t){const n=new URLSearchParams({region:e.region}),i=t?"/retry":`?${n}`,r=await fetch(Ta(`/web/skill-management/reviews/${encodeURIComponent(e.id)}/score${i}`),{method:t?"POST":"GET",headers:ul(uc(t?{"Content-Type":"application/json"}:void 0)),...t?{body:JSON.stringify({region:e.region})}:{},signal:po(e.signal,ho)});if(!r.ok)throw await nT(r,bn.t(t?"score.retryFailed":"score.loadFailed",{ns:"reviews"}));return r.json()}const O9t=e=>_Fe(e,!1),k9t=e=>_Fe(e,!0),S9t=["safety","usability","completeness","reliability","maintainability"];function jFe(e){return(e==null?void 0:e.status)==="queued"||(e==null?void 0:e.status)==="running"}function E9t(e){if(e.status!=="not_requested")return{status:e.status,overallScore:e.overallScore,scoredAt:e.scoredAt,modelName:e.modelName,rubricVersion:e.rubricVersion,error:e.error}}function BW({score:e}){const{t}=Te("reviews");return a.jsx("span",{className:`review-score-label is-${(e==null?void 0:e.status)||"unscored"}`,children:(e==null?void 0:e.status)==="completed"?typeof e.overallScore=="number"?t("score.points",{score:e.overallScore}):t("score.insufficient"):t(`score.status.${(e==null?void 0:e.status)||"unscored"}`)})}function NFe({application:e,canRetry:t=!1,onScoreChanged:n}){const{t:i,i18n:r}=Te("reviews"),[s,o]=p.useState(e.aiReview),[l,c]=p.useState(!!e.aiReview),[u,d]=p.useState(null),[f,h]=p.useState({revision:0,retry:!1}),[m,g]=p.useState(""),b=p.useRef(-1),v=p.useRef(n);v.current=n;const{id:y,region:w}=e,x=!!e.aiReview;p.useEffect(()=>{if(!x&&f.revision===0)return;const S=new AbortController;let C,E=!1,j=!0;const T=async(N,P=!1)=>{var I;if(!(E||S.signal.aborted)&&!(!P&&document.visibilityState==="hidden")){E=!0,P&&c(!0),d(null);try{const D=await(N?k9t:O9t)({id:y,region:w,signal:S.signal});if(S.signal.aborted)return;o(D),(I=v.current)==null||I.call(v,D,N),j=jFe(D),j&&document.visibilityState!=="hidden"&&(C=setTimeout(()=>void T(!1),5e3))}catch(D){S.signal.aborted||(j=!1,d(Pr(D,i(N?"score.retryFailed":"score.loadFailed"))))}finally{E=!1,S.signal.aborted||c(!1)}}},R=()=>{clearTimeout(C),j&&document.visibilityState!=="hidden"&&T(!1)},A=f.retry&&b.current!==f.revision;return A&&(b.current=f.revision),T(A,!0),document.addEventListener("visibilitychange",R),()=>{S.abort(),clearTimeout(C),document.removeEventListener("visibilitychange",R)}},[y,w,x,f,i]);const O=(s==null?void 0:s.status)==="completed"?s.result:void 0;p.useEffect(()=>{if(!O){g("");return}const S=URL.createObjectURL(new Blob([JSON.stringify(O,null,2)],{type:"application/json"}));return g(S),()=>URL.revokeObjectURL(S)},[O]);const k=S=>h(C=>({revision:C.revision+1,retry:S}));return a.jsxs("section",{className:"review-score","aria-label":i("score.title"),children:[a.jsxs("div",{className:"review-score__header",children:[a.jsx("div",{"aria-live":"polite",children:l?a.jsx(fn,{children:i(f.retry?"score.starting":"score.loading")}):a.jsx(BW,{score:s})}),a.jsxs("div",{className:"review-score__actions",children:[m?a.jsx("a",{className:"cw-btn cw-btn-ghost",href:m,download:`${y}-score.json`,children:i("score.download")}):null,t&&(!s||s.status==="failed"||s.status==="not_requested")?a.jsx("button",{type:"button",className:"cw-btn cw-btn-ghost",disabled:l,onClick:()=>k(!0),children:i((s==null?void 0:s.status)==="failed"?"score.retry":"score.start")}):null]})]}),a.jsx("p",{className:"review-score__hint",children:i("score.hint")}),u?a.jsxs("div",{className:"review-score__error",role:"alert",children:[a.jsx(Ns,{error:u}),a.jsx("button",{type:"button",className:"cw-btn cw-btn-ghost",disabled:l,onClick:()=>k(!1),children:i("score.reload")})]}):null,s!=null&&s.error?a.jsx("div",{role:"alert",className:"review-score__error",children:a.jsxs("details",{className:"review-score__raw-error",open:!0,children:[a.jsx("summary",{children:i("score.originalError")}),a.jsx("pre",{children:s.error})]})}):(s==null?void 0:s.status)==="failed"?a.jsx("p",{role:"alert",className:"review-score__error",children:i("score.failed")}):null,O?a.jsxs(a.Fragment,{children:[O.riskFlags.length?a.jsxs("div",{className:"review-score__risks",children:[a.jsx("h3",{children:i("score.risks")}),a.jsx("ul",{children:O.riskFlags.map((S,C)=>a.jsxs("li",{children:[a.jsx("strong",{children:i(`score.severity.${S.severity}`)})," · ",S.reason]},`${C}:${S.reason}`))})]}):null,O.coverage&&!O.coverage.complete?a.jsxs("div",{className:"review-score__coverage",children:[a.jsx("h3",{children:i("score.coverage")}),a.jsx("p",{children:i("score.coverageIncomplete")}),a.jsx("p",{children:i("score.coverageCount",{included:O.coverage.includedFiles,total:O.coverage.totalFiles})}),a.jsxs("ul",{children:[O.coverage.omittedFiles.map(S=>a.jsx("li",{children:i("score.omittedFile",S)},`omitted:${S.path}`)),O.coverage.truncatedFiles.map(S=>a.jsx("li",{children:i("score.truncatedFile",S)},`truncated:${S.path}`))]})]}):null,a.jsx("dl",{className:"review-score__dimensions",children:S9t.map(S=>{const C=O.dimensions[S];return a.jsxs("div",{className:S==="safety"&&C.score!==null&&C.score<60?"is-risk":void 0,children:[a.jsxs("dt",{children:[a.jsx("span",{children:i(`score.dimensions.${S}`)}),a.jsx("strong",{children:C.score===null?i("score.insufficient"):i("score.points",{score:C.score})})]}),a.jsx("dd",{children:C.reason})]},S)})}),O.suggestions.length?a.jsxs("div",{className:"review-score__suggestions",children:[a.jsx("h3",{children:i("score.suggestions")}),a.jsx("ul",{children:O.suggestions.map((S,C)=>a.jsx("li",{children:S},`${C}:${S}`))})]}):null,a.jsxs("dl",{className:"review-score__metadata",children:[a.jsxs("div",{children:[a.jsx("dt",{children:i("score.model")}),a.jsx("dd",{children:O.modelName})]}),a.jsxs("div",{children:[a.jsx("dt",{children:i("score.rubric")}),a.jsx("dd",{children:O.rubricVersion})]}),a.jsxs("div",{children:[a.jsx("dt",{children:i("score.time")}),a.jsx("dd",{children:a.jsx("time",{dateTime:O.scoredAt,children:new Date(O.scoredAt).toLocaleString(r.language,{hour12:!1})})})]})]})]}):null]})}function C9t({application:e}){const{t}=Te("reviews"),[n,i]=p.useState(!1),[r,s]=p.useState(e.aiReview),o=p.useId();return p.useEffect(()=>s(e.aiReview),[e.aiReview]),a.jsxs("div",{className:"review-score-history",children:[a.jsxs("button",{type:"button",className:"review-score-history__toggle","aria-expanded":n,"aria-controls":o,onClick:()=>i(l=>!l),children:[a.jsx("span",{children:t("score.title")}),a.jsx(BW,{score:r}),a.jsx("span",{children:t(n?"score.collapse":"score.expand")})]}),n?a.jsx("div",{id:o,children:a.jsx(NFe,{application:e,onScoreChanged:s},`${e.region}:${e.id}`)}):null]})}function $T({status:e}){const{t}=Te("reviews");return a.jsxs("span",{className:`review-status is-${e}`,children:[a.jsx("span",{"aria-hidden":"true"}),t(`status.${e}`)]})}function UW({person:e,fallback:t,compact:n=!1}){const{t:i}=Te("reviews"),[r,s]=p.useState(""),o=(e==null?void 0:e.name)||t||i("detail.unknownReviewer"),l=e==null?void 0:e.avatarUrl;return a.jsxs("span",{className:`review-person${n?" is-compact":""}`,children:[l&&l!==r?a.jsx("img",{className:"review-person__avatar",src:l,alt:"",referrerPolicy:"no-referrer",onError:()=>s(l)}):a.jsx("span",{className:"review-person__avatar is-fallback","aria-hidden":"true",children:Array.from(o)[0]}),a.jsxs("span",{className:"review-person__text",children:[a.jsx("span",{children:o}),!n&&(e!=null&&e.email)?a.jsx("span",{className:"review-person__email",children:e.email}):null]})]})}function QW({application:e}){const{t,i18n:n}=Te("reviews");return a.jsxs("div",{className:"review-outcome",children:[a.jsx($T,{status:e.status}),e.reviewer||e.reviewedBy||e.reviewedAt?a.jsxs("dl",{className:"review-outcome__facts",children:[e.reviewer||e.reviewedBy?a.jsxs("div",{children:[a.jsx("dt",{children:t(`detail.${e.status==="returned"?"returnedBy":e.status==="approved"?"approvedBy":"reviewer"}`)}),a.jsx("dd",{children:a.jsx(UW,{person:e.reviewer,fallback:e.reviewedBy})})]}):null,e.reviewedAt?a.jsxs("div",{children:[a.jsx("dt",{children:t("detail.reviewedAt")}),a.jsx("dd",{children:a.jsx("time",{dateTime:e.reviewedAt,children:new Date(e.reviewedAt).toLocaleString(n.language,{hour12:!1})})})]}):null]}):null,e.reason?a.jsxs("div",{className:"review-outcome__message is-returned",children:[a.jsx("strong",{children:t("decision.reason")}),a.jsx("p",{children:e.reason})]}):null,e.comment?a.jsxs("div",{className:"review-outcome__message",children:[a.jsx("strong",{children:t("detail.comment")}),a.jsx("p",{children:e.comment})]}):null,e.status==="pending"?a.jsx("p",{className:"review-outcome__hint",children:t("detail.pendingHint")}):null,e.status==="approving"?a.jsx("p",{className:"review-outcome__hint",children:t("detail.approvingHint")}):null]})}function zW({applications:e}){const{t,i18n:n}=Te("reviews");return e.length?a.jsx("ol",{className:"review-source-history",children:[...e].sort((i,r)=>r.submittedAt.localeCompare(i.submittedAt)).map(i=>a.jsxs("li",{children:[a.jsxs("div",{className:"review-source-history__submission",children:[a.jsx("strong",{children:i.version}),a.jsx("span",{children:t("detail.submitted",{name:i.author})}),a.jsx("time",{dateTime:i.submittedAt,children:new Date(i.submittedAt).toLocaleString(n.language,{hour12:!1})})]}),a.jsx(QW,{application:i}),a.jsx(C9t,{application:i})]},i.id))}):a.jsx("p",{className:"review-outcome__hint",children:t("detail.noHistory")})}function A9t({name:e,applications:t,onClose:n}){const{t:i}=Te("reviews"),r=p.useRef(document.activeElement instanceof HTMLElement?document.activeElement:null);return a.jsx(sv,{open:!0,onOpenChange:s=>{s||n()},children:a.jsxs(rv,{children:[a.jsx(nv,{className:"review-backdrop"}),a.jsxs(iv,{className:"review-drawer",finalFocus:()=>{var s;return(s=r.current)!=null&&s.isConnected?r.current:null},children:[a.jsxs("header",{className:"review-drawer__header",children:[a.jsxs("div",{children:[a.jsx(yO,{children:i("detail.history")}),a.jsx(LT,{children:e})]}),a.jsx(hL,{className:"review-icon-button","aria-label":i("actions.close"),children:a.jsx(xT,{})})]}),a.jsx("div",{className:"review-drawer__body",children:a.jsx(zW,{applications:t})})]})]})})}function T9t({skill:e,space:t,region:n,reviews:i,onClose:r,onChanged:s,onSubmitReview:o}){const{t:l,i18n:c}=Te("ui"),[u,d]=p.useState(null),[f,h]=p.useState(e.version),[m,g]=p.useState(!0),[b,v]=p.useState(null),[y,w]=p.useState(null),[x,O]=p.useState([]),[k,S]=p.useState(!1),[C,E]=p.useState(null),[j,T]=p.useState(0),[R,A]=p.useState(0),[N,P]=p.useState(null),I=p.useRef(null),D=p.useRef(null),_=p.useRef(null),L=p.useRef(!1),F=p.useRef(!0),M=p.useRef({onClose:r,busy:N});M.current={onClose:r,busy:N};const V=u==null?void 0:u.items.find(G=>G.version===f),q=p.useMemo(()=>EFe(i),[i]),U=q.get(`${e.skillId}:${f}`),J=i.filter(G=>G.sourceSkillId===e.skillId&&G.version===f&&G.id!==(U==null?void 0:U.id)),z=!!(o&&(u!=null&&u.canUpdate)&&V&&["running","ready"].includes(V.status.toLowerCase())&&(!U||U.status==="returned"));p.useEffect(()=>{var se;F.current=!0;const G=document.activeElement instanceof HTMLElement?document.activeElement:null;(se=_.current)==null||se.focus();const H=Y=>{var be;if(Y.key==="Escape"&&(Y.preventDefault(),M.current.busy||M.current.onClose()),Y.key!=="Tab")return;const X=Array.from(((be=I.current)==null?void 0:be.querySelectorAll('button:not([disabled]), input:not([disabled]):not([type="file"]), a[href], summary, [tabindex="0"]'))||[]),ie=X[0],ee=X[X.length-1];Y.shiftKey&&document.activeElement===ie&&(Y.preventDefault(),ee==null||ee.focus()),!Y.shiftKey&&document.activeElement===ee&&(Y.preventDefault(),ie==null||ie.focus())};return document.addEventListener("keydown",H),()=>{F.current=!1,document.removeEventListener("keydown",H),G!=null&&G.isConnected&&G.focus()}},[]),p.useEffect(()=>{const G=new AbortController;return g(!0),v(null),d9t({spaceId:t.id,skillId:e.skillId,region:n,signal:G.signal}).then(H=>{G.signal.aborted||(d(H),h(se=>{var Y;return H.items.some(X=>X.version===se)?se:((Y=H.items[0])==null?void 0:Y.version)||""}))}).catch(H=>{G.signal.aborted||v(Pr(H,l("skillCenter.versions.loadFailed")))}).finally(()=>{G.signal.aborted||g(!1)}),()=>G.abort()},[t.id,e.skillId,n,j,l]),p.useEffect(()=>{if(!f||!V)return;let G=!0;return S(!0),E(null),O([]),wIe({spaceId:t.id,skillId:e.skillId,region:n,version:f}).then(H=>{G&&O(H)}).catch(H=>{G&&E(Pr(H,l("skillCenter.versions.filesFailed")))}).finally(()=>{G&&S(!1)}),()=>{G=!1}},[t.id,e.skillId,n,f,!!V,R,l]);async function Z(G){if(!L.current){L.current=!0,P("upload"),w(null);try{const H=await f9t({spaceId:t.id,skillId:e.skillId,region:n,file:G});if(!F.current)return;h(H.version),T(se=>se+1),s()}catch(H){F.current&&w(Pr(H,l("skillCenter.versions.uploadFailed")))}finally{L.current=!1,F.current&&P(null)}}}async function ne(){if(!(!z||!o||L.current)){L.current=!0,P("submit"),w(null);try{await o(f)}catch(G){F.current&&w(Pr(G,l("skillCenter.versions.submitFailed")))}finally{L.current=!1,F.current&&P(null)}}}function W(G){if(!G)return"—";const H=new Date(G);return Number.isNaN(H.getTime())?G:H.toLocaleString(c.resolvedLanguage||c.language)}return a.jsx("div",{className:"skill-detail-backdrop",onMouseDown:G=>{G.target===G.currentTarget&&!N&&r()},children:a.jsxs("section",{className:"skill-detail-dialog skill-versions",role:"dialog","aria-modal":"true","aria-labelledby":"skill-versions-title",ref:I,children:[a.jsxs("header",{className:"skill-detail-head",children:[a.jsx("div",{className:"skill-detail-heading",children:a.jsxs("div",{children:[a.jsx("h2",{id:"skill-versions-title",children:l("skillCenter.versions.title")}),a.jsx("p",{title:e.skillName,children:e.skillName})]})}),a.jsxs("div",{className:"skill-detail-actions",children:[a.jsx("button",{type:"button",disabled:m||!!N,onClick:()=>T(G=>G+1),children:l("skillCenter.versions.refresh")}),u!=null&&u.canUpdate?a.jsx("button",{type:"button",disabled:!!N,onClick:()=>{var G;return(G=D.current)==null?void 0:G.click()},children:l(N==="upload"?"skillCenter.versions.uploading":"skillCenter.versions.upload")}):null,a.jsx("button",{type:"button",ref:_,disabled:!!N,onClick:r,children:l("skillCenter.versions.close")})]}),a.jsx("input",{className:"skill-versions__file-input",ref:D,type:"file",accept:".zip,application/zip","aria-label":l("skillCenter.versions.upload"),onChange:G=>{var se;const H=(se=G.target.files)==null?void 0:se[0];G.target.value="",H&&Z(H)}})]}),y?a.jsx("div",{className:"skill-versions__notice",role:"alert",children:a.jsx(Ns,{error:y})}):null,u!=null&&u.canUpdate?a.jsx("p",{className:"skill-versions__hint",children:l("skillCenter.versions.hint")}):null,a.jsxs("div",{className:"skill-versions__body",children:[a.jsxs("div",{className:"skill-versions__history","aria-busy":m,children:[m&&!u?a.jsx("p",{role:"status",children:l("skillCenter.versions.loading")}):null,b?a.jsxs("div",{role:"alert",children:[a.jsx(Ns,{error:b}),a.jsx("button",{className:"cw-btn cw-btn-ghost",type:"button",onClick:()=>T(G=>G+1),children:l("skillCenter.versions.retry")})]}):null,!m&&!b&&!(u!=null&&u.items.length)?a.jsx("p",{children:l("skillCenter.versions.empty")}):null,a.jsx("div",{className:"skill-versions__list",role:"list","aria-label":l("skillCenter.versions.title"),children:u==null?void 0:u.items.map(G=>a.jsx("div",{role:"listitem",children:a.jsxs("button",{type:"button",className:`skill-versions__version${f===G.version?" is-active":""}`,"aria-pressed":f===G.version,onClick:()=>h(G.version),children:[a.jsxs("span",{className:"skill-versions__version-title",children:[a.jsx("strong",{children:G.sourceVersion||G.version}),G.isCurrent?a.jsx("span",{children:l("skillCenter.versions.current")}):null]}),a.jsx("time",{dateTime:G.createdAt,children:W(G.createdAt)}),q.get(`${e.skillId}:${G.version}`)?a.jsx($T,{status:q.get(`${e.skillId}:${G.version}`).status}):a.jsx("span",{children:l(t.isShared?"skillCenter.versions.shared":"skillCenter.versions.notSubmitted")})]})},G.version))})]}),a.jsx("div",{className:"skill-versions__detail",children:V?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"skill-versions__summary",children:[a.jsxs("div",{children:[a.jsx("h3",{children:V.sourceVersion||V.version}),a.jsx("p",{title:V.description,children:V.description}),V.author||e.author?a.jsx("p",{className:"skill-versions__author",children:l("skillCenter.authorName",{name:V.author||e.author})}):null]}),o&&(u!=null&&u.canUpdate)?a.jsx("button",{type:"button",className:"cw-btn cw-btn-primary",disabled:!z||!!N,onClick:()=>void ne(),children:l(N==="submit"?"skillCenter.versions.submitting":"skillCenter.versions.submit")}):null]}),V.error?a.jsx("p",{className:"skill-versions__notice",role:"alert",children:V.error}):null,["running","ready"].includes(V.status.toLowerCase())?null:a.jsx("p",{role:"status",children:l("skillCenter.versions.processing",{status:V.status})}),U?a.jsx(QW,{application:U}):null,J.length?a.jsxs("details",{className:"skill-versions__review-history",children:[a.jsx("summary",{children:l("skillCenter.versions.history")}),a.jsx(zW,{applications:J})]}):null,a.jsx("div",{className:"skill-versions__files",children:k?a.jsx("p",{role:"status",children:l("skillCenter.versions.filesLoading")}):C?a.jsxs("div",{role:"alert",children:[a.jsx(Ns,{error:C}),a.jsx("button",{className:"cw-btn cw-btn-ghost",type:"button",onClick:()=>A(G=>G+1),children:l("skillCenter.versions.retry")})]}):x.length?a.jsx(fL,{files:x},f):a.jsx("p",{children:l("skillCenter.versions.filesEmpty")})})]}):null})]})]})})}function _9t({region:e,active:t,revision:n,onOpen:i}){const{t:r}=Te("ui"),[s,o]=p.useState(null),[l,c]=p.useState(null),[u,d]=p.useState(0);return p.useEffect(()=>{if(!t)return;const f=new AbortController;return c(null),jpt({region:e,signal:f.signal}).then(h=>{f.signal.aborted||o(h)}).catch(h=>{f.signal.aborted||c(Pr(h,r("skillCenter.sharedLoadFailed")))}),()=>f.abort()},[t,e,u,n,r]),a.jsxs("div",{className:"skillcenter-shared-space",children:[a.jsx(G0,{className:"skillcenter-space-card",title:r("skillCenter.sharedSpace"),description:r("skillCenter.sharedDescription"),status:a.jsx("span",{className:"skillcenter-shared-badge",children:r("skillCenter.sharedVisibility")}),metadata:[{label:r("skillCenter.skillCount"),value:s?r("skillCenter.skillCountValue",{count:s.skillCount??0}):r(l?"skillCenter.sharedLoadFailed":"skillCenter.sharedPreparing")}],detailAction:{label:r("common.viewDetails"),disabled:!s||!!l,onClick:()=>{s&&i(s)}},action:l?{label:r("common.reload"),onClick:()=>d(f=>f+1)}:void 0}),l?a.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:a.jsx(Ns,{error:l})}):null]})}function VW({title:e,children:t,onClose:n,className:i=""}){const{t:r}=Te("skills"),s=p.useRef(null);return p.useEffect(()=>{var l;(l=s.current)==null||l.focus();const o=c=>c.key==="Escape"&&n();return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[n]),a.jsx("div",{className:"skill-dialog-backdrop",onMouseDown:n,children:a.jsxs("section",{className:`skill-dialog${i?` ${i}`:""}`,role:"dialog","aria-modal":"true","aria-label":e,onMouseDown:o=>o.stopPropagation(),children:[a.jsxs("header",{children:[a.jsx("h2",{children:e}),a.jsx("button",{ref:s,type:"button",onClick:n,"aria-label":r("management.close"),children:r("management.close")})]}),t]})})}function j9t({region:e,regionOptions:t,onClose:n,onCreated:i}){const{t:r}=Te("skills"),[s,o]=p.useState(""),[l,c]=p.useState(""),[u,d]=p.useState(e),[f,h]=p.useState(!1),[m,g]=p.useState(null),b=async()=>{if(s.trim()){h(!0),g(null);try{const v=await _pt({name:s.trim(),description:l.trim()||void 0,region:u});i({...v,region:v.region||u})}catch(v){g(Pr(v,r("management.createSpaceFailed")))}finally{h(!1)}}};return a.jsxs(VW,{title:r("management.createSpaceTitle"),onClose:n,children:[a.jsxs("div",{className:"skill-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:r("management.name")}),a.jsx("input",{autoFocus:!0,value:s,maxLength:128,onChange:v=>o(v.target.value)})]}),a.jsx(RN,{label:r("management.region"),value:u,options:t,onChange:d,required:!0}),a.jsxs("label",{children:[a.jsx("span",{children:r("management.optionalDescription")}),a.jsx("textarea",{value:l,maxLength:1024,onChange:v=>c(v.target.value)})]}),m?a.jsx("div",{className:"skill-inline-error",children:a.jsx(Ns,{error:m})}):null]}),a.jsxs("footer",{children:[a.jsx("button",{type:"button",className:"skill-button",onClick:n,children:r("management.cancel")}),a.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!s.trim()||f,onClick:()=>void b(),children:r(f?"management.creating":"management.create")})]})]})}function N9t({space:e,region:t,onClose:n,onUpdated:i}){const{t:r}=Te("skills"),[s,o]=p.useState(e.name),[l,c]=p.useState(e.description||""),[u,d]=p.useState(!1),[f,h]=p.useState(null),m=async()=>{if(s.trim()){d(!0),h(null);try{const g=await Mpt({spaceId:e.id,name:s.trim(),description:l.trim()||void 0,region:t});i({...e,...g,skillCount:e.skillCount})}catch(g){h(Pr(g,r("management.updateSpaceFailed")))}finally{d(!1)}}};return a.jsxs(VW,{title:r("management.editSpaceTitle"),onClose:n,children:[a.jsxs("div",{className:"skill-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:r("management.name")}),a.jsx("input",{autoFocus:!0,value:s,maxLength:128,onChange:g=>o(g.target.value)})]}),a.jsxs("label",{children:[a.jsx("span",{children:r("management.optionalDescription")}),a.jsx("textarea",{value:l,maxLength:1024,onChange:g=>c(g.target.value)})]}),f?a.jsx("div",{className:"skill-inline-error",children:a.jsx(Ns,{error:f})}):null]}),a.jsxs("footer",{children:[a.jsx("button",{type:"button",className:"skill-button",onClick:n,children:r("management.cancel")}),a.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!s.trim()||u,onClick:()=>void m(),children:r(u?"management.saving":"management.save")})]})]})}function R9t({space:e,region:t,onClose:n,onUploaded:i}){const{t:r,i18n:s}=Te("skills"),[o,l]=p.useState(null),[c,u]=p.useState(null),[d,f]=p.useState(!1),[h,m]=p.useState(!1),[g,b]=p.useState(null),[v,y]=p.useState(!1),w=p.useRef(0),x=p.useRef(null),O=async S=>{const C=w.current+1;if(w.current=C,l(S),u(null),b(null),f(!!S),!!S)try{const E=await Fpt(S);w.current===C&&u({name:E.name,fileCount:E.files.length})}catch(E){w.current===C&&b(Pr(E,r("management.archiveValidationFailed")))}finally{w.current===C&&f(!1)}},k=async()=>{if(!(!o||!c)){m(!0),b(null);try{await $pt({spaceId:e.id,region:t,project:e.projectName,file:o}),i()}catch(S){b(Pr(S,r("management.uploadFailed")))}finally{m(!1)}}};return a.jsxs(VW,{title:r("management.uploadTitle",{name:Pc(e)}),className:"skill-upload-dialog",onClose:n,children:[a.jsxs("div",{className:"skill-dialog__body",children:[a.jsx("input",{ref:x,className:"skill-upload-dialog__input",type:"file",accept:".zip,application/zip",onChange:S=>{var C;return void O(((C=S.target.files)==null?void 0:C[0])||null)}}),a.jsxs("button",{type:"button",className:`skill-upload-dropzone${v?" is-dragging":""}`,onClick:()=>{var S;return(S=x.current)==null?void 0:S.click()},onDragEnter:S=>{S.preventDefault(),y(!0)},onDragOver:S=>{S.preventDefault(),S.dataTransfer.dropEffect="copy",y(!0)},onDragLeave:S=>{S.currentTarget.contains(S.relatedTarget)||y(!1)},onDrop:S=>{var C;S.preventDefault(),y(!1),O(((C=S.dataTransfer.files)==null?void 0:C[0])||null)},children:[a.jsx("strong",{children:o?o.name:r("management.dropzone")}),a.jsx("span",{children:o?r("fileTree.bytes",{value:new Intl.NumberFormat(s.resolvedLanguage).format(o.size)}):r("management.chooseLocalFile")})]}),a.jsx("p",{children:r("management.archiveHelp")}),d?a.jsx("div",{className:"skill-inline-notice",children:r("management.validating")}):null,c?a.jsx("div",{className:"skill-inline-notice",children:r("management.validationPassed",{name:c.name,count:c.fileCount})}):null,g?a.jsx("div",{className:"skill-inline-error",children:a.jsx(Ns,{error:g})}):null]}),a.jsxs("footer",{children:[a.jsx("button",{type:"button",className:"skill-button",onClick:n,children:r("management.cancel")}),a.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!o||!c||d||h,onClick:()=>void k(),children:r(h?"management.uploading":"management.upload")})]})]})}function I9t(e){if(typeof e=="number")return e<1e12?e*1e3:e;const t=e.trim(),n=Number(t);return/^\d+(?:\.\d+)?$/.test(t)?n<1e12?n*1e3:n:Date.parse(t)}function FT(e,t=Date.now(),n="zh-CN"){if(e===void 0||e==="")return"—";const i=I9t(e);if(!Number.isFinite(i))return"—";const r=Math.floor(Math.max(0,t-i)/1e3),s=new Intl.RelativeTimeFormat(n,{numeric:"always"}),o=(f,h,m)=>n.toLowerCase().startsWith("zh")?`${f} ${m}前`:s.format(-f,h);if(r<60)return o(r,"second","秒");const l=Math.floor(r/60);if(l<60)return o(l,"minute","分钟");const c=Math.floor(l/60);if(c<24)return o(c,"hour","小时");const u=Math.floor(c/24);if(u<30)return o(u,"day","天");const d=Math.floor(u/30);return d<12?o(d,"month","个月"):o(Math.floor(d/12),"year","年")}const P9t=12,oae=12;function yP({disabled:e,placement:t="top",children:n}){const{t:i}=Te("ui"),r=p.useId();return a.jsxs("span",{className:`skillcenter-disabled-action${e?" is-disabled":""} is-${t}`,tabIndex:e?0:void 0,"aria-describedby":e?r:void 0,children:[n,e?a.jsx("span",{id:r,className:"skillcenter-disabled-tooltip",role:"tooltip",children:i("skillCenter.sandboxNotConfigured")}):null]})}const D9t=new Set(["active","available","creating","disabled","enabled","failed","inactive","pending","published","ready","released","running","success","unavailable","unreleased","updating"]);function RFe(e,t){const n=(e||"").trim().toLowerCase();return D9t.has(n)?t(`skillCenter.status.${n}`):t("skillCenter.status.unknown")}function M9t(e){const t=(e||"").toLowerCase();return["active","available","enabled","published","ready","released","success"].includes(t)||t==="running"?"is-positive":["creating","pending","updating"].includes(t)?"is-progress":["failed","unavailable"].includes(t)?"is-danger":"is-muted"}function L9t(e,t){if(!e)return"";const n=e.trim(),i=Number(n),r=/^\d+(?:\.\d+)?$/.test(n)?new Date(i<1e12?i*1e3:i):new Date(n);return Number.isNaN(r.getTime())?e:new Intl.DateTimeFormat(t,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(r)}function lae(e){if(!e)return 0;const t=e.trim(),n=Number(t),i=/^\d+(?:\.\d+)?$/.test(t)?new Date(n<1e12?n*1e3:n):new Date(t);return Number.isNaN(i.getTime())?0:i.getTime()}function cu(e){return`${e.region||"default"}:${e.projectName||"default"}:${e.id}`}function $9t(e,t){const n=new Map(e.map(i=>[cu(i),i]));for(const i of t)n.set(cu(i),i);return[...n.values()].sort((i,r)=>lae(r.updatedAt)-lae(i.updatedAt))}function F9t(e){const t=e.replace(/\r\n/g,` +`)}function l9t(e){var t;if(e.repairing||((t=e.task)==null?void 0:t.state)==="running"&&e.repairMode){if(e.repairMode==="manual")return en("generation.stages.repairingAgain");const n=Math.max(1,e.repairAttempts||1);return en("generation.stages.autoRepairing",{attempt:n,max:SFe})}return o9t(e.task)}function aae(){return a.jsxs("svg",{className:"skill-generation__spinner",viewBox:"0 0 20 20","aria-hidden":"true",children:[a.jsx("circle",{cx:"10",cy:"10",r:"7"}),a.jsx("path",{d:"M10 3a7 7 0 0 1 7 7"})]})}function c9t(e,t=Date.now()){if(!(e!=null&&e.expiresAt))return en("generation.sessionMax");const n=Math.max(0,new Date(e.expiresAt).getTime()-t),i=Math.floor(n/6e4),r=Math.floor(n%6e4/1e3);return en("generation.remaining",{minutes:i,seconds:String(r).padStart(2,"0")})}function u9t(e){return e?e.length>64?en("generation.validation.nameTooLong"):/^[a-z0-9-]+$/.test(e)?"":en("generation.validation.invalidName"):""}function oae(e){return e?e.length>128?en("generation.validation.modelTooLong"):/^[A-Za-z0-9][A-Za-z0-9._:/-]*$/.test(e)?"":en("generation.validation.invalidModel"):""}function q$(e){return`${e.region||""}:${e.id}`}function d9t(){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m14.5 6-6 6 6 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}function f9t({operation:e,cloudProvider:t,space:n,availableSpaces:i=[],spacesLoading:r=!1,initialIntent:s="",source:o,onBack:l,onPublished:c}){var Se,oe,$e,Ue;const{t:u}=Te("skills"),[d,f]=p.useState(null),[h,m]=p.useState(null),[g,b]=p.useState(s),[v,y]=p.useState(""),[w,x]=p.useState([]),[O,k]=p.useState([]),[S,C]=p.useState(""),[E,j]=p.useState(!1),[T,R]=p.useState(""),[A,N]=p.useState(""),[D,I]=p.useState(null),[P,_]=p.useState(""),[L,F]=p.useState(""),[M,V]=p.useState(n?q$(n):""),[q,U]=p.useState(Date.now()),Z=p.useRef([]);p.useEffect(()=>{const me=new AbortController;return NM(me.signal).then(ke=>{f(ke),x([rae(0,ke)])}).catch(ke=>{me.signal.aborted||m(Pr(ke,en("generation.errors.loadCapability")))}),()=>me.abort()},[]),p.useEffect(()=>{Z.current=O},[O]),p.useEffect(()=>{const me=window.setInterval(()=>U(Date.now()),1e3);return()=>window.clearInterval(me)},[]),p.useEffect(()=>{const me=ke=>{Z.current.some(Ae=>{var He;return((He=Ae.task)==null?void 0:He.state)==="running"||Ae.repairing})&&ke.preventDefault()};return window.addEventListener("beforeunload",me),()=>{var ke;window.removeEventListener("beforeunload",me);for(const Ae of Z.current)(ke=Ae.task)!=null&&ke.jobId&&T2t(Ae.task.jobId).catch(()=>{})}},[]),p.useEffect(()=>{if(!O.some(He=>{var Qe;return((Qe=He.task)==null?void 0:Qe.state)==="running"||He.repairing}))return;let me=!1,ke;const Ae=async()=>{const He=Z.current,Qe=await Promise.all(He.map(async jt=>{var Pt;if(((Pt=jt.task)==null?void 0:Pt.state)!=="running")return jt;try{const Kt=await E2t(jt.task.jobId);if(H$(Kt)&&(jt.repairAttempts||0)tt.map(mt=>mt.id===jt.id?{...mt,task:Kt,repairing:!0,repairMode:"auto",repairAttempts:xt,repairError:void 0}:mt));try{const tt=await L4({jobId:Kt.jobId,intent:sae(Kt),expectedRevision:Kt.revision});return{...jt,task:tt,artifact:void 0,repairing:!1,repairMode:"auto",repairAttempts:xt,repairError:void 0,error:void 0,pollError:void 0}}catch(tt){return{...jt,task:Kt,repairing:!1,repairMode:void 0,repairAttempts:xt,repairError:Pr(tt,en("generation.errors.autoRepair")),pollError:void 0}}}let Ct=jt.artifact;return Kt.state==="ready"&&(Ct=await M4(Kt.jobId,Kt.revision)),{...jt,task:Kt,artifact:Ct,repairing:!1,repairMode:Kt.state==="running"?jt.repairMode:void 0,repairError:void 0,error:void 0,pollError:void 0}}catch(Kt){return{...jt,pollError:Pr(Kt,en("generation.errors.pollCandidate"))}}}));me||(k(Qe),ke=window.setTimeout(()=>void Ae(),r9t))};return Ae(),()=>{me=!0,ke!==void 0&&window.clearTimeout(ke)}},[O.some(me=>{var ke;return((ke=me.task)==null?void 0:ke.state)==="running"||me.repairing})]);const z=O.find(me=>me.id===S)||O[0],ee=e==="create"&&!n,ne=i.find(me=>q$(me)===M)??null,W=n??ne,X=i.map(me=>({value:q$(me),label:`${Dc(me)||u("generation.unnamedSpace")} · ${Oh(me.region||"cn-beijing",t)}`})),H=u9t(v),ae=!!(d!=null&&d.enabled&&g.trim()&&!H&&w.length>0&&w.every(me=>me.model.trim()&&!oae(me.model.trim()))),Y=(me,ke)=>{x(Ae=>Ae.map(He=>He.id===me?{...He,...ke}:He))},K=async me=>{const ke={...me,model:me.model.trim()},Ae=me.style==="custom"?me.customStyle.trim():me.style;try{const He=await S2t({operation:e,intent:g.trim(),model:ke.model,style:Ae,name:v.trim()||void 0,source:o});return{id:me.id,config:ke,task:He}}catch(He){return{id:me.id,config:ke,error:Pr(He,en("generation.errors.createCandidate"))}}},ie=async()=>{if(!ae)return;j(!0),I(null);const me=w.map(Ae=>({id:Ae.id,config:Ae}));k(me),C(w[0].id);const ke=await Promise.all(w.map(K));k(ke)},J=async me=>{k(Ae=>Ae.map(He=>He.id===me.id?{...He,error:void 0}:He));const ke=await K(me.config);k(Ae=>Ae.map(He=>He.id===me.id?ke:He))},ye=async()=>{if(!(!(z!=null&&z.task)||!T.trim()||z.task.state!=="ready")){N("refine"),I(null);try{const me=await L4({jobId:z.task.jobId,intent:T.trim(),expectedRevision:z.task.revision});k(ke=>ke.map(Ae=>Ae.id===z.id?{...Ae,task:me,artifact:void 0}:Ae)),R("")}catch(me){I(Pr(me,en("generation.errors.refine")))}finally{N("")}}},de=async()=>{if(!(!(z!=null&&z.task)||!H$(z.task))){N("refine"),I(null),k(me=>me.map(ke=>ke.id===z.id?{...ke,repairing:!0,repairMode:"manual",repairError:void 0}:ke));try{const me=await L4({jobId:z.task.jobId,intent:sae(z.task),expectedRevision:z.task.revision});k(ke=>ke.map(Ae=>Ae.id===z.id?{...Ae,task:me,artifact:void 0,repairing:!1,repairMode:"manual",repairError:void 0}:Ae))}catch(me){k(ke=>ke.map(Ae=>Ae.id===z.id?{...Ae,repairing:!1,repairMode:void 0,repairError:Pr(me,en("generation.errors.repairAgain"))}:Ae))}finally{N("")}}},ge=async()=>{if(!(!(z!=null&&z.task)||z.task.state!=="ready"||L)){N("publish"),I(null);try{if(!W)throw new Error(en("generation.errors.selectSpace"));const me=z.artifact||await M4(z.task.jobId,z.task.revision),ke=(o==null?void 0:o.region)||W.region||"";if(!AD(ke))throw new Error(en("generation.errors.unsupportedRegion"));await A2t({jobId:z.task.jobId,expectedRevision:z.task.revision,expectedArtifactSha256:me.sha256,disposition:e==="optimize"?"update-source":"create-new",skillSpaceIds:[W.id],projectName:(o==null?void 0:o.projectName)||W.projectName,region:ke,onProgress:Ae=>_(Ae.message)}),F(z.id),c()}catch(me){I(Pr(me,en("generation.errors.upload")))}finally{N(""),_("")}}},Ee=async()=>{if(!(!(z!=null&&z.task)||z.task.state!=="ready")){N("download");try{const me=z.artifact||await M4(z.task.jobId,z.task.revision);await _2t(z.task.jobId,z.task.revision,me.sha256)}catch(me){I(Pr(me,en("generation.errors.download")))}finally{N("")}}},xe=async()=>{O.some(me=>{var ke;return((ke=me.task)==null?void 0:ke.state)==="running"})&&!window.confirm(en("generation.leaveConfirmation"))||(await Promise.allSettled(O.flatMap(me=>{var ke;return((ke=me.task)==null?void 0:ke.state)==="running"?[C2t({jobId:me.task.jobId,expectedRevision:me.task.revision})]:[]})),l())},Ne=e==="create"?u("generation.createTitle"):u("generation.optimizeTitle",{name:(o==null?void 0:o.name)||u("generation.skillFallback")}),We=me=>{var ke;return((ke=d==null?void 0:d.models.find(Ae=>Ae.id===me))==null?void 0:ke.label)||me},Xe=me=>me.config.style==="custom"?me.config.customStyle.trim()||u("generation.styles.customFallback"):u(iae[me.config.style]),Re=[...Object.entries(iae).map(([me,ke])=>({value:me,label:u(ke)})),{value:"custom",label:u("generation.styles.custom")}],se=me=>me.error||me.repairError?u("generation.stages.failed"):l9t(me),ce=me=>!me.error&&!me.repairError&&(me.repairing||!me.task||me.task.state==="running"),ve=O.some(me=>{var ke;return((ke=me.task)==null?void 0:ke.state)==="ready"});return a.jsxs("section",{className:"skill-generation",children:[a.jsxs("header",{className:"skill-generation__header",children:[a.jsx("button",{type:"button",className:"skillcenter-back",onClick:()=>void xe(),"aria-label":u("generation.back"),children:a.jsx(d9t,{})}),a.jsxs("div",{children:[a.jsx("h1",{children:Ne}),a.jsx("p",{children:Dc(n)||u("generation.home")})]}),O.length>0?a.jsx("span",{className:"skill-generation__ttl",children:c9t(z==null?void 0:z.task,q)}):null]}),E?a.jsxs("div",{className:"skill-generation__workspace",children:[a.jsx("div",{className:"skill-generation__candidate-tabs",role:"tablist","aria-label":u("generation.candidates"),children:O.map(me=>a.jsxs("button",{type:"button",role:"tab","aria-selected":(z==null?void 0:z.id)===me.id,className:(z==null?void 0:z.id)===me.id?"is-active":"",onClick:()=>C(me.id),children:[a.jsxs("span",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.style")}),a.jsx("strong",{children:Xe(me)})]}),a.jsxs("span",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.model")}),a.jsx("strong",{children:We(me.config.model)})]}),a.jsxs("span",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.progress")}),a.jsxs("strong",{children:[ce(me)?a.jsx(aae,{}):null,se(me)]})]})]},me.id))}),z?a.jsxs("div",{className:"skill-generation__candidate",children:[a.jsxs("section",{className:"skill-generation__activity",children:[a.jsx("header",{children:a.jsxs("div",{className:"skill-generation__candidate-summary",children:[a.jsxs("div",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.style")}),a.jsx("strong",{children:Xe(z)})]}),a.jsxs("div",{className:"skill-generation__summary-row",children:[a.jsx("span",{children:u("generation.model")}),a.jsx("strong",{children:We(z.config.model)})]}),a.jsxs("div",{className:"skill-generation__summary-row","aria-live":"polite",children:[a.jsx("span",{children:u("generation.progress")}),a.jsxs("strong",{children:[ce(z)?a.jsx(aae,{}):null,ce(z)?a.jsx(cn,{children:se(z)}):se(z)]})]})]})}),z.task?a.jsx(RNt,{activities:z.task.activities}):null,z.pollError?a.jsx("div",{className:"skill-inline-notice",children:a.jsx(Ns,{error:z.pollError})}):null,z.repairError?a.jsx("div",{className:"skill-inline-notice",children:a.jsx(Ns,{error:z.repairError})}):null,z.error?a.jsxs("div",{className:"skill-inline-error",children:[a.jsx(Ns,{error:z.error}),a.jsx("button",{type:"button",onClick:()=>void J(z),children:u("generation.retryCandidate")})]}):null,(Se=z.task)!=null&&Se.validation&&!z.task.validation.valid&&!z.repairing&&z.task.state==="failed"?a.jsxs("div",{className:"skill-validation-errors",children:[a.jsx("strong",{children:u("generation.formatValidationFailed")}),z.task.validation.errors.map(me=>a.jsx("p",{children:me},me)),H$(z.task)?a.jsx("button",{type:"button",disabled:!!A,onClick:()=>void de(),children:u("generation.repairAgain")}):null]}):null]}),a.jsxs("section",{className:"skill-generation__files",children:[a.jsxs("header",{children:[a.jsx("h2",{children:u("generation.files")}),((oe=z.task)==null?void 0:oe.state)==="ready"?a.jsx("button",{type:"button",onClick:()=>void Ee(),disabled:!!A,children:u("generation.downloadZip")}):null]}),z.artifact?a.jsx(fL,{files:z.artifact.files}):a.jsx("div",{className:"skill-generation__files-empty",children:(($e=z.task)==null?void 0:$e.state)==="ready"?u("generation.loadingFiles"):u("generation.filesPending")})]}),((Ue=z.task)==null?void 0:Ue.state)==="ready"?a.jsxs("div",{className:"skill-generation__ready-actions",children:[ee?a.jsx("div",{className:"skill-generation__publish-target",children:a.jsx(IN,{label:u("generation.uploadToSpace"),value:M,options:X,onChange:V,disabled:r,placeholder:u(r?"generation.loadingSpaces":"generation.selectSpace")})}):null,a.jsxs("footer",{className:"skill-generation__followup",children:[a.jsx("textarea",{value:T,onChange:me=>R(me.target.value),placeholder:u("generation.continuePlaceholder")}),a.jsx("button",{type:"button",className:"skill-button",disabled:!T.trim()||!!A,onClick:()=>void ye(),children:u("generation.continue")}),a.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!!A||!!L||!W,onClick:()=>void ge(),children:A==="publish"?P||u("generation.uploading"):u(e==="optimize"?"generation.overwrite":ee?"generation.uploadToSelectedSpace":"generation.uploadToCurrentSpace")})]})]}):null,D?a.jsx("div",{className:"skill-inline-error skill-generation__action-error",children:a.jsx(Ns,{error:D})}):null]}):null,!ve&&O.every(me=>me.error)?a.jsx("div",{className:"skill-inline-error",children:u("generation.allCandidatesFailed")}):null]}):a.jsxs("div",{className:"skill-generation__setup",children:[a.jsx("div",{className:"skill-generation__section-head is-basic",children:a.jsx("div",{children:a.jsx("strong",{children:u("generation.basicInfo")})})}),a.jsxs("label",{children:[a.jsxs("span",{children:[u("generation.goal"),a.jsx("span",{className:"skill-required-mark","aria-hidden":"true",children:"*"})]}),a.jsx("textarea",{required:!0,value:g,onChange:me=>b(me.target.value),placeholder:u(e==="create"?"generation.createIntentPlaceholder":"generation.optimizeIntentPlaceholder")})]}),a.jsxs("label",{children:[a.jsx("span",{children:u("generation.skillName")}),a.jsx("input",{value:v,onChange:me=>y(me.target.value),placeholder:u("generation.autoNamePlaceholder"),"aria-invalid":!!H,"aria-describedby":"skill-name-help"}),H?a.jsx("span",{id:"skill-name-help",className:"skill-generation__field-error",role:"alert",children:H}):a.jsx("span",{id:"skill-name-help",className:"skill-generation__field-help",children:u("generation.nameHelp")})]}),a.jsx("div",{className:"skill-generation__section-head",children:a.jsxs("div",{children:[a.jsx("strong",{children:u(e==="create"?"generation.createPlans":"generation.optimizePlans")}),a.jsx("span",{children:u(e==="create"?"generation.createPlansDescription":"generation.optimizePlansDescription")})]})}),a.jsxs("div",{className:"skill-generation__groups",children:[w.map((me,ke)=>a.jsxs("article",{className:"skill-generation__group",children:[a.jsxs("header",{children:[a.jsx("strong",{children:u("generation.plan",{count:ke+1})}),w.length>1?a.jsx("button",{type:"button",onClick:()=>x(Ae=>Ae.filter(He=>He.id!==me.id)),children:u("generation.remove")}):null]}),a.jsx(IN,{label:u("generation.model"),required:!0,value:me.model,options:(d==null?void 0:d.models.map(Ae=>({value:Ae.id,label:Ae.label})))||[],onChange:Ae=>Y(me.id,{model:Ae}),allowCustom:!0,placeholder:u("generation.modelPlaceholder"),error:oae(me.model.trim())}),a.jsx(IN,{label:u("generation.style"),required:!0,value:me.style,options:Re,onChange:Ae=>Y(me.id,{style:Ae})}),me.style==="custom"?a.jsxs("label",{children:[a.jsx("span",{children:u("generation.customStyle")}),a.jsx("textarea",{value:me.customStyle,onChange:Ae=>Y(me.id,{customStyle:Ae.target.value}),placeholder:u("generation.customStylePlaceholder")})]}):null]},me.id)),d&&w.lengthx(me=>[...me,rae(me.length,d)]),children:u("generation.addConfiguration")}):null]}),h?a.jsx("div",{className:"skill-inline-error",children:a.jsx(Ns,{error:h})}):null,d&&!d.enabled?a.jsx("div",{className:"skill-inline-notice",children:u("generation.notConfigured")}):null,a.jsx("div",{className:"skill-generation__setup-actions",children:a.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!ae,onClick:()=>void ie(),children:u("generation.generate")})})]})]})}async function EFe(e,t,n,i){const r=new URLSearchParams({region:e.region}),s=await fetch(Ta(`/web/skill-management/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/versions?${r}`),{...t,headers:ul(uc(t.headers)),signal:po(e.signal,i)});if(!s.ok)throw await iT(s,n);return s.json()}function h9t(e){return EFe(e,{},Q("skills.listVersionsFailed"),ho)}function p9t(e){return EFe(e,{method:"POST",headers:{"Content-Type":"application/zip"},body:e.file},Q("skills.uploadVersionFailed"),hr)}function CFe(e){const t=new Map;for(const n of e){const i=`${n.sourceSkillId}:${n.version}`,r=t.get(i);(!r||n.submittedAt>r.submittedAt)&&t.set(i,n)}return t}function m9t(e,t,n,i){const r=i.trim().toLocaleLowerCase();return e.filter(s=>s.kind===t&&(n==="all"||s.status===n)&&`${s.name} ${s.description} ${s.author} ${s.version}`.toLocaleLowerCase().includes(r))}const AFe=p.createContext(void 0);function Pb(e){const t=p.useContext(AFe);if(!e&&t===void 0)throw new Error(Hc(27));return t}const iv=p.forwardRef(function(t,n){const{render:i,className:r,style:s,forceRender:o=!1,...l}=t,c=Pb(),u=c.useState("open"),d=c.useState("nested"),f=c.useState("mounted"),h=c.useState("transitionStatus");return Ra("div",t,{state:{open:u,transitionStatus:h},ref:[c.context.backdropRef,n],stateAttributesMapping:Oje,props:[{role:"presentation",hidden:!f,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:o||!d})}),hL=p.forwardRef(function(t,n){const{render:i,className:r,style:s,disabled:o=!1,nativeButton:l=!0,...c}=t,u=Pb(),d=u.useState("open"),{getButtonProps:f,buttonRef:h}=GD({disabled:o,native:l}),m={disabled:o};function g(b){d&&u.setOpen(!1,fa(T_e,b.nativeEvent))}return Ra("button",t,{state:m,ref:[n,h],props:[{onClick:g},c,f]})}),$T=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:o,...l}=t,c=Pb(),u=tm(o);return c.useSyncedValueWithCleanup("descriptionElementId",u),Ra("p",t,{ref:n,props:[{id:u},l]})}),TFe=p.createContext(void 0);function g9t(){const e=p.useContext(TFe);if(e===void 0)throw new Error(Hc(26));return e}const b9t={...hV,...KD,nestedDialogOpen(e){return e?{"data-nested-dialog-open":""}:null}},rv=p.forwardRef(function(t,n){const{render:i,className:r,style:s,finalFocus:o,initialFocus:l,...c}=t,u=Pb(),d=u.useState("descriptionElementId"),f=u.useState("disablePointerDismissal"),h=u.useState("floatingRootContext"),m=u.useState("popupProps"),g=u.useState("modal"),b=u.useState("mounted"),v=u.useState("nested"),y=u.useState("nestedOpenDialogCount"),w=u.useState("open"),x=u.useState("openMethod"),O=u.useState("titleElementId"),k=u.useState("transitionStatus"),S=u.useState("role"),C=h.useState("floatingId");g9t(),VA({open:w,ref:u.context.popupRef,onComplete(){var N,D;w&&((D=(N=u.context).onOpenChangeComplete)==null||D.call(N,!0))}});const E=l===void 0?rje(u.context.popupRef):l,j=y>0,T=u.useStateSetter("popupElement"),A=Ra("div",t,{state:{open:w,nested:v,transitionStatus:k,nestedDialogOpen:j},props:[m,{id:C,"aria-labelledby":O,"aria-describedby":d,role:S,...ije,hidden:!b,onKeyDown(N){uLe.has(N.key)&&N.stopPropagation()},style:{"--nested-dialogs":y}},c],ref:[n,u.context.popupRef,T],stateAttributesMapping:b9t});return a.jsx(B_e,{context:h,openInteractionType:x,disabled:!b,closeOnFocusOut:!f,initialFocus:E,returnFocus:o,modal:g!==!1,restoreFocus:"popup",children:A})}),sv=p.forwardRef(function(t,n){const{keepMounted:i=!1,...r}=t,s=Pb(),o=s.useState("mounted"),l=s.useState("modal"),c=s.useState("open");return o||i?a.jsx(TFe.Provider,{value:i,children:a.jsxs(P_e,{ref:n,...r,children:[o&&l===!0&&a.jsx(lLe,{ref:s.context.internalBackdropRef,inert:rV(!c)}),t.children]})}):null});function y9t({store:e,parentContext:t,isDrawer:n}){const i=e.useState("open"),r=e.useState("disablePointerDismissal"),s=e.useState("modal"),o=e.useState("popupElement"),l=e.useState("floatingRootContext"),[c,u]=p.useState(0),[d,f]=p.useState(0),h=c===0,m=Q_e(l,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:s==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(g){if(!e.context.outsidePressEnabledRef.current||"button"in g&&g.button!==0)return!1;if("touches"in g){if(g.type==="touchend"){if(g.changedTouches.length!==1||g.touches.length!==0)return!1}else if(g.touches.length!==1)return!1}const b=uo(g);if(h&&!r){if(s){const v=e.context.internalBackdropRef.current,y=e.context.backdropRef.current;return v||y?v===b||y===b||ii(b,o)&&!(b!=null&&b.hasAttribute("data-base-ui-portal")):!0}return!0}return!1},escapeKey:h});return cLe(i&&s===!0,o),e.useContextCallback("onNestedDialogOpen",(g,b)=>{u(g),f(b)}),Jn(()=>(t!=null&&t.onNestedDialogOpen&&(i?t.onNestedDialogOpen(c+1,d+(n?1:0)):t.onNestedDialogOpen(0,0)),()=>{t!=null&&t.onNestedDialogOpen&&i&&t.onNestedDialogOpen(0,0)}),[n,i,c,d,t]),dje(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:c,nestedOpenDrawerCount:d}),null}const v9t={...gje,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role};class x9t extends BD{constructor(n,i,r){const s=new uV,o=w9t(n,s,i,r);super(o,O9t(s),v9t);Zt(this,"setOpen",(n,i)=>{var s,o;if(i.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!n&&i.trigger==null&&this.state.activeTriggerId!=null&&(i.trigger=this.state.activeTriggerElement??void 0),(o=(s=this.context).onOpenChange)==null||o.call(s,n,i),i.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,i);const r={open:n};oje(r,n,i.trigger),this.update(r)})}}function w9t(e,t,n,i=!1){const r={...hje(),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e};return r.floatingRootContext=pje(t,n,i),r}function O9t(e){return{popupRef:p.createRef(),backdropRef:p.createRef(),internalBackdropRef:p.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function k9t(e,t){const{children:n,open:i,defaultOpen:r=!1,onOpenChange:s,onOpenChangeComplete:o,disablePointerDismissal:l=!1,modal:c=!0,actionsRef:u,handle:d,triggerId:f,defaultTriggerId:h=null}=t,m=e==="drawer",g=c,b=l,v="dialog",y=Pb(!0),w=y!=null,x={modal:g,disablePointerDismissal:b,nested:w,role:v},O=sje((T,R)=>new x9t({open:r,openProp:i,activeTriggerId:h,triggerIdProp:f,...x},T,R),!0);O.useControlledProp("openProp",i),O.useControlledProp("triggerIdProp",f),O.useSyncedValues(x),O.useContextCallback("onOpenChange",s),O.useContextCallback("onOpenChangeComplete",o);const k=O.useState("open"),S=O.useState("mounted"),C=O.useState("payload");fje(O,k),cje(O);const{forceUnmount:E}=uje(k,O);p.useImperativeHandle(u,()=>({unmount:E,close:()=>O.setOpen(!1,fa(j_e))}),[E,O]);const j=k||S;return a.jsxs(AFe.Provider,{value:O,children:[d&&a.jsx(aje,{handle:d,store:O}),j&&a.jsx(y9t,{store:O,parentContext:y==null?void 0:y.context,isDrawer:m}),typeof n=="function"?n({payload:C}):n]})}function av(e){return k9t("dialog",e)}const vO=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:o,...l}=t,c=Pb(),u=tm(o);return c.useSyncedValueWithCleanup("titleElementId",u),Ra("h2",t,{ref:n,props:[{id:u},l]})}),_Fe=p.forwardRef(function(t,n){const{render:i,className:r,style:s,disabled:o=!1,nativeButton:l=!0,id:c,payload:u,handle:d,...f}=t,h=Pb(!0),g=bje(d)??h;if(!g)throw new Error(Hc(79));const b=tm(c),v=g.useState("floatingRootContext"),y=g.useState("isOpenedByTrigger",b),w=g.useState("triggerPopupId",b),x=p.useRef(null),{registerTrigger:O,isMountedByThisTrigger:k}=lje(b,x,g,{payload:u}),{getButtonProps:S,buttonRef:C}=GD({disabled:o,native:l}),E=U_e(v),j=sLe(()=>g.select("open"),A=>{g.set("openMethod",A)}),T={disabled:o,open:y},R=g.useState("triggerProps",k);return Ra("button",t,{state:T,ref:[C,n,O,x],props:[E.reference,R,j,{[aV]:"",id:b,"aria-haspopup":"dialog","aria-expanded":y,"aria-controls":w},f,S],stateAttributesMapping:wje})});async function jFe(e,t){const n=new URLSearchParams({region:e.region}),i=t?"/retry":`?${n}`,r=await fetch(Ta(`/web/skill-management/reviews/${encodeURIComponent(e.id)}/score${i}`),{method:t?"POST":"GET",headers:ul(uc(t?{"Content-Type":"application/json"}:void 0)),...t?{body:JSON.stringify({region:e.region})}:{},signal:po(e.signal,ho)});if(!r.ok)throw await iT(r,bn.t(t?"score.retryFailed":"score.loadFailed",{ns:"reviews"}));return r.json()}const S9t=e=>jFe(e,!1),E9t=e=>jFe(e,!0),C9t=["safety","usability","completeness","reliability","maintainability"];function NFe(e){return(e==null?void 0:e.status)==="queued"||(e==null?void 0:e.status)==="running"}function A9t(e){if(e.status!=="not_requested")return{status:e.status,overallScore:e.overallScore,scoredAt:e.scoredAt,modelName:e.modelName,rubricVersion:e.rubricVersion,error:e.error}}function UW({score:e}){const{t}=Te("reviews");return a.jsx("span",{className:`review-score-label is-${(e==null?void 0:e.status)||"unscored"}`,children:(e==null?void 0:e.status)==="completed"?typeof e.overallScore=="number"?t("score.points",{score:e.overallScore}):t("score.insufficient"):t(`score.status.${(e==null?void 0:e.status)||"unscored"}`)})}function RFe({application:e,canRetry:t=!1,onScoreChanged:n}){const{t:i,i18n:r}=Te("reviews"),[s,o]=p.useState(e.aiReview),[l,c]=p.useState(!!e.aiReview),[u,d]=p.useState(null),[f,h]=p.useState({revision:0,retry:!1}),[m,g]=p.useState(""),b=p.useRef(-1),v=p.useRef(n);v.current=n;const{id:y,region:w}=e,x=!!e.aiReview;p.useEffect(()=>{if(!x&&f.revision===0)return;const S=new AbortController;let C,E=!1,j=!0;const T=async(N,D=!1)=>{var I;if(!(E||S.signal.aborted)&&!(!D&&document.visibilityState==="hidden")){E=!0,D&&c(!0),d(null);try{const P=await(N?E9t:S9t)({id:y,region:w,signal:S.signal});if(S.signal.aborted)return;o(P),(I=v.current)==null||I.call(v,P,N),j=NFe(P),j&&document.visibilityState!=="hidden"&&(C=setTimeout(()=>void T(!1),5e3))}catch(P){S.signal.aborted||(j=!1,d(Pr(P,i(N?"score.retryFailed":"score.loadFailed"))))}finally{E=!1,S.signal.aborted||c(!1)}}},R=()=>{clearTimeout(C),j&&document.visibilityState!=="hidden"&&T(!1)},A=f.retry&&b.current!==f.revision;return A&&(b.current=f.revision),T(A,!0),document.addEventListener("visibilitychange",R),()=>{S.abort(),clearTimeout(C),document.removeEventListener("visibilitychange",R)}},[y,w,x,f,i]);const O=(s==null?void 0:s.status)==="completed"?s.result:void 0;p.useEffect(()=>{if(!O){g("");return}const S=URL.createObjectURL(new Blob([JSON.stringify(O,null,2)],{type:"application/json"}));return g(S),()=>URL.revokeObjectURL(S)},[O]);const k=S=>h(C=>({revision:C.revision+1,retry:S}));return a.jsxs("section",{className:"review-score","aria-label":i("score.title"),children:[a.jsxs("div",{className:"review-score__header",children:[a.jsx("div",{"aria-live":"polite",children:l?a.jsx(cn,{children:i(f.retry?"score.starting":"score.loading")}):a.jsx(UW,{score:s})}),a.jsxs("div",{className:"review-score__actions",children:[m?a.jsx("a",{className:"cw-btn cw-btn-ghost",href:m,download:`${y}-score.json`,children:i("score.download")}):null,t&&(!s||s.status==="failed"||s.status==="not_requested")?a.jsx("button",{type:"button",className:"cw-btn cw-btn-ghost",disabled:l,onClick:()=>k(!0),children:i((s==null?void 0:s.status)==="failed"?"score.retry":"score.start")}):null]})]}),a.jsx("p",{className:"review-score__hint",children:i("score.hint")}),u?a.jsxs("div",{className:"review-score__error",role:"alert",children:[a.jsx(Ns,{error:u}),a.jsx("button",{type:"button",className:"cw-btn cw-btn-ghost",disabled:l,onClick:()=>k(!1),children:i("score.reload")})]}):null,s!=null&&s.error?a.jsx("div",{role:"alert",className:"review-score__error",children:a.jsxs("details",{className:"review-score__raw-error",open:!0,children:[a.jsx("summary",{children:i("score.originalError")}),a.jsx("pre",{children:s.error})]})}):(s==null?void 0:s.status)==="failed"?a.jsx("p",{role:"alert",className:"review-score__error",children:i("score.failed")}):null,O?a.jsxs(a.Fragment,{children:[O.riskFlags.length?a.jsxs("div",{className:"review-score__risks",children:[a.jsx("h3",{children:i("score.risks")}),a.jsx("ul",{children:O.riskFlags.map((S,C)=>a.jsxs("li",{children:[a.jsx("strong",{children:i(`score.severity.${S.severity}`)})," · ",S.reason]},`${C}:${S.reason}`))})]}):null,O.coverage&&!O.coverage.complete?a.jsxs("div",{className:"review-score__coverage",children:[a.jsx("h3",{children:i("score.coverage")}),a.jsx("p",{children:i("score.coverageIncomplete")}),a.jsx("p",{children:i("score.coverageCount",{included:O.coverage.includedFiles,total:O.coverage.totalFiles})}),a.jsxs("ul",{children:[O.coverage.omittedFiles.map(S=>a.jsx("li",{children:i("score.omittedFile",S)},`omitted:${S.path}`)),O.coverage.truncatedFiles.map(S=>a.jsx("li",{children:i("score.truncatedFile",S)},`truncated:${S.path}`))]})]}):null,a.jsx("dl",{className:"review-score__dimensions",children:C9t.map(S=>{const C=O.dimensions[S];return a.jsxs("div",{className:S==="safety"&&C.score!==null&&C.score<60?"is-risk":void 0,children:[a.jsxs("dt",{children:[a.jsx("span",{children:i(`score.dimensions.${S}`)}),a.jsx("strong",{children:C.score===null?i("score.insufficient"):i("score.points",{score:C.score})})]}),a.jsx("dd",{children:C.reason})]},S)})}),O.suggestions.length?a.jsxs("div",{className:"review-score__suggestions",children:[a.jsx("h3",{children:i("score.suggestions")}),a.jsx("ul",{children:O.suggestions.map((S,C)=>a.jsx("li",{children:S},`${C}:${S}`))})]}):null,a.jsxs("dl",{className:"review-score__metadata",children:[a.jsxs("div",{children:[a.jsx("dt",{children:i("score.model")}),a.jsx("dd",{children:O.modelName})]}),a.jsxs("div",{children:[a.jsx("dt",{children:i("score.rubric")}),a.jsx("dd",{children:O.rubricVersion})]}),a.jsxs("div",{children:[a.jsx("dt",{children:i("score.time")}),a.jsx("dd",{children:a.jsx("time",{dateTime:O.scoredAt,children:new Date(O.scoredAt).toLocaleString(r.language,{hour12:!1})})})]})]})]}):null]})}function T9t({application:e}){const{t}=Te("reviews"),[n,i]=p.useState(!1),[r,s]=p.useState(e.aiReview),o=p.useId();return p.useEffect(()=>s(e.aiReview),[e.aiReview]),a.jsxs("div",{className:"review-score-history",children:[a.jsxs("button",{type:"button",className:"review-score-history__toggle","aria-expanded":n,"aria-controls":o,onClick:()=>i(l=>!l),children:[a.jsx("span",{children:t("score.title")}),a.jsx(UW,{score:r}),a.jsx("span",{children:t(n?"score.collapse":"score.expand")})]}),n?a.jsx("div",{id:o,children:a.jsx(RFe,{application:e,onScoreChanged:s},`${e.region}:${e.id}`)}):null]})}function FT({status:e}){const{t}=Te("reviews");return a.jsxs("span",{className:`review-status is-${e}`,children:[a.jsx("span",{"aria-hidden":"true"}),t(`status.${e}`)]})}function QW({person:e,fallback:t,compact:n=!1}){const{t:i}=Te("reviews"),[r,s]=p.useState(""),o=(e==null?void 0:e.name)||t||i("detail.unknownReviewer"),l=e==null?void 0:e.avatarUrl;return a.jsxs("span",{className:`review-person${n?" is-compact":""}`,children:[l&&l!==r?a.jsx("img",{className:"review-person__avatar",src:l,alt:"",referrerPolicy:"no-referrer",onError:()=>s(l)}):a.jsx("span",{className:"review-person__avatar is-fallback","aria-hidden":"true",children:Array.from(o)[0]}),a.jsxs("span",{className:"review-person__text",children:[a.jsx("span",{children:o}),!n&&(e!=null&&e.email)?a.jsx("span",{className:"review-person__email",children:e.email}):null]})]})}function zW({application:e}){const{t,i18n:n}=Te("reviews");return a.jsxs("div",{className:"review-outcome",children:[a.jsx(FT,{status:e.status}),e.reviewer||e.reviewedBy||e.reviewedAt?a.jsxs("dl",{className:"review-outcome__facts",children:[e.reviewer||e.reviewedBy?a.jsxs("div",{children:[a.jsx("dt",{children:t(`detail.${e.status==="returned"?"returnedBy":e.status==="approved"?"approvedBy":"reviewer"}`)}),a.jsx("dd",{children:a.jsx(QW,{person:e.reviewer,fallback:e.reviewedBy})})]}):null,e.reviewedAt?a.jsxs("div",{children:[a.jsx("dt",{children:t("detail.reviewedAt")}),a.jsx("dd",{children:a.jsx("time",{dateTime:e.reviewedAt,children:new Date(e.reviewedAt).toLocaleString(n.language,{hour12:!1})})})]}):null]}):null,e.reason?a.jsxs("div",{className:"review-outcome__message is-returned",children:[a.jsx("strong",{children:t("decision.reason")}),a.jsx("p",{children:e.reason})]}):null,e.comment?a.jsxs("div",{className:"review-outcome__message",children:[a.jsx("strong",{children:t("detail.comment")}),a.jsx("p",{children:e.comment})]}):null,e.status==="pending"?a.jsx("p",{className:"review-outcome__hint",children:t("detail.pendingHint")}):null,e.status==="approving"?a.jsx("p",{className:"review-outcome__hint",children:t("detail.approvingHint")}):null]})}function VW({applications:e}){const{t,i18n:n}=Te("reviews");return e.length?a.jsx("ol",{className:"review-source-history",children:[...e].sort((i,r)=>r.submittedAt.localeCompare(i.submittedAt)).map(i=>a.jsxs("li",{children:[a.jsxs("div",{className:"review-source-history__submission",children:[a.jsx("strong",{children:i.version}),a.jsx("span",{children:t("detail.submitted",{name:i.author})}),a.jsx("time",{dateTime:i.submittedAt,children:new Date(i.submittedAt).toLocaleString(n.language,{hour12:!1})})]}),a.jsx(zW,{application:i}),a.jsx(T9t,{application:i})]},i.id))}):a.jsx("p",{className:"review-outcome__hint",children:t("detail.noHistory")})}function _9t({name:e,applications:t,onClose:n}){const{t:i}=Te("reviews"),r=p.useRef(document.activeElement instanceof HTMLElement?document.activeElement:null);return a.jsx(av,{open:!0,onOpenChange:s=>{s||n()},children:a.jsxs(sv,{children:[a.jsx(iv,{className:"review-backdrop"}),a.jsxs(rv,{className:"review-drawer",finalFocus:()=>{var s;return(s=r.current)!=null&&s.isConnected?r.current:null},children:[a.jsxs("header",{className:"review-drawer__header",children:[a.jsxs("div",{children:[a.jsx(vO,{children:i("detail.history")}),a.jsx($T,{children:e})]}),a.jsx(hL,{className:"review-icon-button","aria-label":i("actions.close"),children:a.jsx(wT,{})})]}),a.jsx("div",{className:"review-drawer__body",children:a.jsx(VW,{applications:t})})]})]})})}function j9t({skill:e,space:t,region:n,reviews:i,onClose:r,onChanged:s,onSubmitReview:o}){const{t:l,i18n:c}=Te("ui"),[u,d]=p.useState(null),[f,h]=p.useState(e.version),[m,g]=p.useState(!0),[b,v]=p.useState(null),[y,w]=p.useState(null),[x,O]=p.useState([]),[k,S]=p.useState(!1),[C,E]=p.useState(null),[j,T]=p.useState(0),[R,A]=p.useState(0),[N,D]=p.useState(null),I=p.useRef(null),P=p.useRef(null),_=p.useRef(null),L=p.useRef(!1),F=p.useRef(!0),M=p.useRef({onClose:r,busy:N});M.current={onClose:r,busy:N};const V=u==null?void 0:u.items.find(X=>X.version===f),q=p.useMemo(()=>CFe(i),[i]),U=q.get(`${e.skillId}:${f}`),Z=i.filter(X=>X.sourceSkillId===e.skillId&&X.version===f&&X.id!==(U==null?void 0:U.id)),z=!!(o&&(u!=null&&u.canUpdate)&&V&&["running","ready"].includes(V.status.toLowerCase())&&(!U||U.status==="returned"));p.useEffect(()=>{var ae;F.current=!0;const X=document.activeElement instanceof HTMLElement?document.activeElement:null;(ae=_.current)==null||ae.focus();const H=Y=>{var ye;if(Y.key==="Escape"&&(Y.preventDefault(),M.current.busy||M.current.onClose()),Y.key!=="Tab")return;const K=Array.from(((ye=I.current)==null?void 0:ye.querySelectorAll('button:not([disabled]), input:not([disabled]):not([type="file"]), a[href], summary, [tabindex="0"]'))||[]),ie=K[0],J=K[K.length-1];Y.shiftKey&&document.activeElement===ie&&(Y.preventDefault(),J==null||J.focus()),!Y.shiftKey&&document.activeElement===J&&(Y.preventDefault(),ie==null||ie.focus())};return document.addEventListener("keydown",H),()=>{F.current=!1,document.removeEventListener("keydown",H),X!=null&&X.isConnected&&X.focus()}},[]),p.useEffect(()=>{const X=new AbortController;return g(!0),v(null),h9t({spaceId:t.id,skillId:e.skillId,region:n,signal:X.signal}).then(H=>{X.signal.aborted||(d(H),h(ae=>{var Y;return H.items.some(K=>K.version===ae)?ae:((Y=H.items[0])==null?void 0:Y.version)||""}))}).catch(H=>{X.signal.aborted||v(Pr(H,l("skillCenter.versions.loadFailed")))}).finally(()=>{X.signal.aborted||g(!1)}),()=>X.abort()},[t.id,e.skillId,n,j,l]),p.useEffect(()=>{if(!f||!V)return;let X=!0;return S(!0),E(null),O([]),OIe({spaceId:t.id,skillId:e.skillId,region:n,version:f}).then(H=>{X&&O(H)}).catch(H=>{X&&E(Pr(H,l("skillCenter.versions.filesFailed")))}).finally(()=>{X&&S(!1)}),()=>{X=!1}},[t.id,e.skillId,n,f,!!V,R,l]);async function ee(X){if(!L.current){L.current=!0,D("upload"),w(null);try{const H=await p9t({spaceId:t.id,skillId:e.skillId,region:n,file:X});if(!F.current)return;h(H.version),T(ae=>ae+1),s()}catch(H){F.current&&w(Pr(H,l("skillCenter.versions.uploadFailed")))}finally{L.current=!1,F.current&&D(null)}}}async function ne(){if(!(!z||!o||L.current)){L.current=!0,D("submit"),w(null);try{await o(f)}catch(X){F.current&&w(Pr(X,l("skillCenter.versions.submitFailed")))}finally{L.current=!1,F.current&&D(null)}}}function W(X){if(!X)return"—";const H=new Date(X);return Number.isNaN(H.getTime())?X:H.toLocaleString(c.resolvedLanguage||c.language)}return a.jsx("div",{className:"skill-detail-backdrop",onMouseDown:X=>{X.target===X.currentTarget&&!N&&r()},children:a.jsxs("section",{className:"skill-detail-dialog skill-versions",role:"dialog","aria-modal":"true","aria-labelledby":"skill-versions-title",ref:I,children:[a.jsxs("header",{className:"skill-detail-head",children:[a.jsx("div",{className:"skill-detail-heading",children:a.jsxs("div",{children:[a.jsx("h2",{id:"skill-versions-title",children:l("skillCenter.versions.title")}),a.jsx("p",{title:e.skillName,children:e.skillName})]})}),a.jsxs("div",{className:"skill-detail-actions",children:[a.jsx("button",{type:"button",disabled:m||!!N,onClick:()=>T(X=>X+1),children:l("skillCenter.versions.refresh")}),u!=null&&u.canUpdate?a.jsx("button",{type:"button",disabled:!!N,onClick:()=>{var X;return(X=P.current)==null?void 0:X.click()},children:l(N==="upload"?"skillCenter.versions.uploading":"skillCenter.versions.upload")}):null,a.jsx("button",{type:"button",ref:_,disabled:!!N,onClick:r,children:l("skillCenter.versions.close")})]}),a.jsx("input",{className:"skill-versions__file-input",ref:P,type:"file",accept:".zip,application/zip","aria-label":l("skillCenter.versions.upload"),onChange:X=>{var ae;const H=(ae=X.target.files)==null?void 0:ae[0];X.target.value="",H&&ee(H)}})]}),y?a.jsx("div",{className:"skill-versions__notice",role:"alert",children:a.jsx(Ns,{error:y})}):null,u!=null&&u.canUpdate?a.jsx("p",{className:"skill-versions__hint",children:l("skillCenter.versions.hint")}):null,a.jsxs("div",{className:"skill-versions__body",children:[a.jsxs("div",{className:"skill-versions__history","aria-busy":m,children:[m&&!u?a.jsx("p",{role:"status",children:l("skillCenter.versions.loading")}):null,b?a.jsxs("div",{role:"alert",children:[a.jsx(Ns,{error:b}),a.jsx("button",{className:"cw-btn cw-btn-ghost",type:"button",onClick:()=>T(X=>X+1),children:l("skillCenter.versions.retry")})]}):null,!m&&!b&&!(u!=null&&u.items.length)?a.jsx("p",{children:l("skillCenter.versions.empty")}):null,a.jsx("div",{className:"skill-versions__list",role:"list","aria-label":l("skillCenter.versions.title"),children:u==null?void 0:u.items.map(X=>a.jsx("div",{role:"listitem",children:a.jsxs("button",{type:"button",className:`skill-versions__version${f===X.version?" is-active":""}`,"aria-pressed":f===X.version,onClick:()=>h(X.version),children:[a.jsxs("span",{className:"skill-versions__version-title",children:[a.jsx("strong",{children:X.sourceVersion||X.version}),X.isCurrent?a.jsx("span",{children:l("skillCenter.versions.current")}):null]}),a.jsx("time",{dateTime:X.createdAt,children:W(X.createdAt)}),q.get(`${e.skillId}:${X.version}`)?a.jsx(FT,{status:q.get(`${e.skillId}:${X.version}`).status}):a.jsx("span",{children:l(t.isShared?"skillCenter.versions.shared":"skillCenter.versions.notSubmitted")})]})},X.version))})]}),a.jsx("div",{className:"skill-versions__detail",children:V?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"skill-versions__summary",children:[a.jsxs("div",{children:[a.jsx("h3",{children:V.sourceVersion||V.version}),a.jsx("p",{title:V.description,children:V.description}),V.author||e.author?a.jsx("p",{className:"skill-versions__author",children:l("skillCenter.authorName",{name:V.author||e.author})}):null]}),o&&(u!=null&&u.canUpdate)?a.jsx("button",{type:"button",className:"cw-btn cw-btn-primary",disabled:!z||!!N,onClick:()=>void ne(),children:l(N==="submit"?"skillCenter.versions.submitting":"skillCenter.versions.submit")}):null]}),V.error?a.jsx("p",{className:"skill-versions__notice",role:"alert",children:V.error}):null,["running","ready"].includes(V.status.toLowerCase())?null:a.jsx("p",{role:"status",children:l("skillCenter.versions.processing",{status:V.status})}),U?a.jsx(zW,{application:U}):null,Z.length?a.jsxs("details",{className:"skill-versions__review-history",children:[a.jsx("summary",{children:l("skillCenter.versions.history")}),a.jsx(VW,{applications:Z})]}):null,a.jsx("div",{className:"skill-versions__files",children:k?a.jsx("p",{role:"status",children:l("skillCenter.versions.filesLoading")}):C?a.jsxs("div",{role:"alert",children:[a.jsx(Ns,{error:C}),a.jsx("button",{className:"cw-btn cw-btn-ghost",type:"button",onClick:()=>A(X=>X+1),children:l("skillCenter.versions.retry")})]}):x.length?a.jsx(fL,{files:x},f):a.jsx("p",{children:l("skillCenter.versions.filesEmpty")})})]}):null})]})]})})}function N9t({region:e,active:t,revision:n,onOpen:i}){const{t:r}=Te("ui"),[s,o]=p.useState(null),[l,c]=p.useState(null),[u,d]=p.useState(0);return p.useEffect(()=>{if(!t)return;const f=new AbortController;return c(null),Rpt({region:e,signal:f.signal}).then(h=>{f.signal.aborted||o(h)}).catch(h=>{f.signal.aborted||c(Pr(h,r("skillCenter.sharedLoadFailed")))}),()=>f.abort()},[t,e,u,n,r]),a.jsxs("div",{className:"skillcenter-shared-space",children:[a.jsx(X0,{className:"skillcenter-space-card",title:r("skillCenter.sharedSpace"),description:r("skillCenter.sharedDescription"),status:a.jsx("span",{className:"skillcenter-shared-badge",children:r("skillCenter.sharedVisibility")}),metadata:[{label:r("skillCenter.skillCount"),value:s?r("skillCenter.skillCountValue",{count:s.skillCount??0}):r(l?"skillCenter.sharedLoadFailed":"skillCenter.sharedPreparing")}],detailAction:{label:r("common.viewDetails"),disabled:!s||!!l,onClick:()=>{s&&i(s)}},action:l?{label:r("common.reload"),onClick:()=>d(f=>f+1)}:void 0}),l?a.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:a.jsx(Ns,{error:l})}):null]})}function HW({title:e,children:t,onClose:n,className:i=""}){const{t:r}=Te("skills"),s=p.useRef(null);return p.useEffect(()=>{var l;(l=s.current)==null||l.focus();const o=c=>c.key==="Escape"&&n();return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[n]),a.jsx("div",{className:"skill-dialog-backdrop",onMouseDown:n,children:a.jsxs("section",{className:`skill-dialog${i?` ${i}`:""}`,role:"dialog","aria-modal":"true","aria-label":e,onMouseDown:o=>o.stopPropagation(),children:[a.jsxs("header",{children:[a.jsx("h2",{children:e}),a.jsx("button",{ref:s,type:"button",onClick:n,"aria-label":r("management.close"),children:r("management.close")})]}),t]})})}function R9t({region:e,regionOptions:t,onClose:n,onCreated:i}){const{t:r}=Te("skills"),[s,o]=p.useState(""),[l,c]=p.useState(""),[u,d]=p.useState(e),[f,h]=p.useState(!1),[m,g]=p.useState(null),b=async()=>{if(s.trim()){h(!0),g(null);try{const v=await Npt({name:s.trim(),description:l.trim()||void 0,region:u});i({...v,region:v.region||u})}catch(v){g(Pr(v,r("management.createSpaceFailed")))}finally{h(!1)}}};return a.jsxs(HW,{title:r("management.createSpaceTitle"),onClose:n,children:[a.jsxs("div",{className:"skill-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:r("management.name")}),a.jsx("input",{autoFocus:!0,value:s,maxLength:128,onChange:v=>o(v.target.value)})]}),a.jsx(IN,{label:r("management.region"),value:u,options:t,onChange:d,required:!0}),a.jsxs("label",{children:[a.jsx("span",{children:r("management.optionalDescription")}),a.jsx("textarea",{value:l,maxLength:1024,onChange:v=>c(v.target.value)})]}),m?a.jsx("div",{className:"skill-inline-error",children:a.jsx(Ns,{error:m})}):null]}),a.jsxs("footer",{children:[a.jsx("button",{type:"button",className:"skill-button",onClick:n,children:r("management.cancel")}),a.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!s.trim()||f,onClick:()=>void b(),children:r(f?"management.creating":"management.create")})]})]})}function I9t({space:e,region:t,onClose:n,onUpdated:i}){const{t:r}=Te("skills"),[s,o]=p.useState(e.name),[l,c]=p.useState(e.description||""),[u,d]=p.useState(!1),[f,h]=p.useState(null),m=async()=>{if(s.trim()){d(!0),h(null);try{const g=await $pt({spaceId:e.id,name:s.trim(),description:l.trim()||void 0,region:t});i({...e,...g,skillCount:e.skillCount})}catch(g){h(Pr(g,r("management.updateSpaceFailed")))}finally{d(!1)}}};return a.jsxs(HW,{title:r("management.editSpaceTitle"),onClose:n,children:[a.jsxs("div",{className:"skill-dialog__body",children:[a.jsxs("label",{children:[a.jsx("span",{children:r("management.name")}),a.jsx("input",{autoFocus:!0,value:s,maxLength:128,onChange:g=>o(g.target.value)})]}),a.jsxs("label",{children:[a.jsx("span",{children:r("management.optionalDescription")}),a.jsx("textarea",{value:l,maxLength:1024,onChange:g=>c(g.target.value)})]}),f?a.jsx("div",{className:"skill-inline-error",children:a.jsx(Ns,{error:f})}):null]}),a.jsxs("footer",{children:[a.jsx("button",{type:"button",className:"skill-button",onClick:n,children:r("management.cancel")}),a.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!s.trim()||u,onClick:()=>void m(),children:r(u?"management.saving":"management.save")})]})]})}function P9t({space:e,region:t,onClose:n,onUploaded:i}){const{t:r,i18n:s}=Te("skills"),[o,l]=p.useState(null),[c,u]=p.useState(null),[d,f]=p.useState(!1),[h,m]=p.useState(!1),[g,b]=p.useState(null),[v,y]=p.useState(!1),w=p.useRef(0),x=p.useRef(null),O=async S=>{const C=w.current+1;if(w.current=C,l(S),u(null),b(null),f(!!S),!!S)try{const E=await Upt(S);w.current===C&&u({name:E.name,fileCount:E.files.length})}catch(E){w.current===C&&b(Pr(E,r("management.archiveValidationFailed")))}finally{w.current===C&&f(!1)}},k=async()=>{if(!(!o||!c)){m(!0),b(null);try{await Bpt({spaceId:e.id,region:t,project:e.projectName,file:o}),i()}catch(S){b(Pr(S,r("management.uploadFailed")))}finally{m(!1)}}};return a.jsxs(HW,{title:r("management.uploadTitle",{name:Dc(e)}),className:"skill-upload-dialog",onClose:n,children:[a.jsxs("div",{className:"skill-dialog__body",children:[a.jsx("input",{ref:x,className:"skill-upload-dialog__input",type:"file",accept:".zip,application/zip",onChange:S=>{var C;return void O(((C=S.target.files)==null?void 0:C[0])||null)}}),a.jsxs("button",{type:"button",className:`skill-upload-dropzone${v?" is-dragging":""}`,onClick:()=>{var S;return(S=x.current)==null?void 0:S.click()},onDragEnter:S=>{S.preventDefault(),y(!0)},onDragOver:S=>{S.preventDefault(),S.dataTransfer.dropEffect="copy",y(!0)},onDragLeave:S=>{S.currentTarget.contains(S.relatedTarget)||y(!1)},onDrop:S=>{var C;S.preventDefault(),y(!1),O(((C=S.dataTransfer.files)==null?void 0:C[0])||null)},children:[a.jsx("strong",{children:o?o.name:r("management.dropzone")}),a.jsx("span",{children:o?r("fileTree.bytes",{value:new Intl.NumberFormat(s.resolvedLanguage).format(o.size)}):r("management.chooseLocalFile")})]}),a.jsx("p",{children:r("management.archiveHelp")}),d?a.jsx("div",{className:"skill-inline-notice",children:r("management.validating")}):null,c?a.jsx("div",{className:"skill-inline-notice",children:r("management.validationPassed",{name:c.name,count:c.fileCount})}):null,g?a.jsx("div",{className:"skill-inline-error",children:a.jsx(Ns,{error:g})}):null]}),a.jsxs("footer",{children:[a.jsx("button",{type:"button",className:"skill-button",onClick:n,children:r("management.cancel")}),a.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!o||!c||d||h,onClick:()=>void k(),children:r(h?"management.uploading":"management.upload")})]})]})}function D9t(e){if(typeof e=="number")return e<1e12?e*1e3:e;const t=e.trim(),n=Number(t);return/^\d+(?:\.\d+)?$/.test(t)?n<1e12?n*1e3:n:Date.parse(t)}function BT(e,t=Date.now(),n="zh-CN"){if(e===void 0||e==="")return"—";const i=D9t(e);if(!Number.isFinite(i))return"—";const r=Math.floor(Math.max(0,t-i)/1e3),s=new Intl.RelativeTimeFormat(n,{numeric:"always"}),o=(f,h,m)=>n.toLowerCase().startsWith("zh")?`${f} ${m}前`:s.format(-f,h);if(r<60)return o(r,"second","秒");const l=Math.floor(r/60);if(l<60)return o(l,"minute","分钟");const c=Math.floor(l/60);if(c<24)return o(c,"hour","小时");const u=Math.floor(c/24);if(u<30)return o(u,"day","天");const d=Math.floor(u/30);return d<12?o(d,"month","个月"):o(Math.floor(d/12),"year","年")}const M9t=12,lae=12;function yP({disabled:e,placement:t="top",children:n}){const{t:i}=Te("ui"),r=p.useId();return a.jsxs("span",{className:`skillcenter-disabled-action${e?" is-disabled":""} is-${t}`,tabIndex:e?0:void 0,"aria-describedby":e?r:void 0,children:[n,e?a.jsx("span",{id:r,className:"skillcenter-disabled-tooltip",role:"tooltip",children:i("skillCenter.sandboxNotConfigured")}):null]})}const L9t=new Set(["active","available","creating","disabled","enabled","failed","inactive","pending","published","ready","released","running","success","unavailable","unreleased","updating"]);function IFe(e,t){const n=(e||"").trim().toLowerCase();return L9t.has(n)?t(`skillCenter.status.${n}`):t("skillCenter.status.unknown")}function $9t(e){const t=(e||"").toLowerCase();return["active","available","enabled","published","ready","released","success"].includes(t)||t==="running"?"is-positive":["creating","pending","updating"].includes(t)?"is-progress":["failed","unavailable"].includes(t)?"is-danger":"is-muted"}function F9t(e,t){if(!e)return"";const n=e.trim(),i=Number(n),r=/^\d+(?:\.\d+)?$/.test(n)?new Date(i<1e12?i*1e3:i):new Date(n);return Number.isNaN(r.getTime())?e:new Intl.DateTimeFormat(t,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(r)}function cae(e){if(!e)return 0;const t=e.trim(),n=Number(t),i=/^\d+(?:\.\d+)?$/.test(t)?new Date(n<1e12?n*1e3:n):new Date(t);return Number.isNaN(i.getTime())?0:i.getTime()}function uu(e){return`${e.region||"default"}:${e.projectName||"default"}:${e.id}`}function B9t(e,t){const n=new Map(e.map(i=>[uu(i),i]));for(const i of t)n.set(uu(i),i);return[...n.values()].sort((i,r)=>cae(r.updatedAt)-cae(i.updatedAt))}function U9t(e){const t=e.replace(/\r\n/g,` `);if(!t.startsWith(`--- `))return e;const n=t.indexOf(` --- -`,4);return n>=0?t.slice(n+5).trimStart():e}function IFe(e,t){const n=(e||"").trim();return!n||[">",">-","|","|-"].includes(n)?t("common.noDescription"):n}function B9t(){return a.jsx("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:a.jsx("path",{d:"m7.5 7.5 9 9m0-9-9 9",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function U9t(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 5.5v13M5.5 12h13",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}function cae({direction:e}){return a.jsx("svg",{className:"icon",viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,children:a.jsx("path",{d:e==="left"?"m11.7 5.5-4.2 4.5 4.2 4.5":"m8.3 5.5 4.2 4.5-4.2 4.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function Q9t(){return a.jsx("span",{className:"skillcenter-loading-mark","aria-hidden":!0})}function z9t({page:e,total:t,pageSize:n,onPage:i}){const{t:r}=Te("ui"),s=Math.max(1,Math.ceil(t/n));return a.jsxs("footer",{className:"skillcenter-pager",children:[a.jsx("span",{children:r("skillCenter.totalItems",{count:t})}),a.jsxs("div",{className:"skillcenter-pager-actions",children:[a.jsx("button",{type:"button",onClick:()=>i(e-1),disabled:e<=1,"aria-label":r("common.previousPage"),children:a.jsx(cae,{direction:"left"})}),a.jsxs("span",{children:[e," / ",s]}),a.jsx("button",{type:"button",onClick:()=>i(e+1),disabled:e>=s,"aria-label":r("common.nextPage"),children:a.jsx(cae,{direction:"right"})})]})]})}function V9t({children:e}){return a.jsx("div",{className:"skillcenter-empty",children:e})}function q$({kind:e,title:t,description:n,error:i,action:r}){return a.jsx("div",{className:`skillcenter-page-state is-${e}`,role:e==="error"?"alert":"status",children:a.jsxs(Wn,{fill:"none",children:[a.jsx(Wn.Title,{children:t}),n?a.jsx(Wn.Description,{children:n}):null,i?a.jsx(Ns,{error:i}):null,r?a.jsx(Wn.ActionRow,{children:a.jsx(_t,{color:"secondary",size:"lg",onClick:r.onClick,children:r.label})}):null]})})}function uae({errors:e,cloudProvider:t,fullPage:n=!1,onRetry:i}){const{t:r}=Te("ui");return a.jsxs("div",{className:`skillcenter-space-errors${n?" is-full-page":""}`,role:"alert",children:[a.jsxs("div",{className:"skillcenter-space-errors__content",children:[a.jsx("strong",{children:r(n?"skillCenter.cannotLoadSpaces":"skillCenter.someSpacesFailed")}),e.map(({region:s,error:o})=>a.jsxs("section",{children:[a.jsx("span",{children:wh(s,t)}),a.jsx(Ns,{error:o})]},s))]}),a.jsx("button",{type:"button",onClick:i,children:r("common.reload")})]})}function H9t({skill:e,space:t,region:n,cloudProvider:i,detail:r,files:s,loading:o,error:l,canOptimize:c,reviews:u,reviewsLoading:d,reviewsError:f,onOptimize:h,onDownload:m,onClose:g}){const{t:b}=Te("ui"),[v,y]=p.useState("files");return p.useEffect(()=>{const w=x=>{x.key==="Escape"&&g()};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[g]),a.jsx("div",{className:"skill-detail-backdrop",role:"presentation",onMouseDown:g,children:a.jsxs("section",{className:"skill-detail-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-detail-title",onMouseDown:w=>w.stopPropagation(),children:[a.jsxs("header",{className:"skill-detail-head",children:[a.jsx("div",{className:"skill-detail-heading",children:a.jsxs("div",{children:[a.jsx("h2",{id:"skill-detail-title",children:(r==null?void 0:r.name)||e.skillName}),a.jsx("p",{children:IFe((r==null?void 0:r.description)||e.skillDescription,b)})]})}),a.jsxs("div",{className:"skill-detail-actions",children:[a.jsx("button",{type:"button",onClick:m,disabled:s.length===0,children:b("skillCenter.downloadZip")}),t.isShared?null:a.jsx(yP,{disabled:!c,placement:"bottom",children:a.jsx("button",{type:"button",onClick:h,disabled:!c,children:b("skillCenter.optimize")})}),a.jsx("button",{type:"button",className:"skill-detail-close",onClick:g,"aria-label":b("skillCenter.closeSkillDetails"),children:a.jsx(B9t,{})})]})]}),a.jsxs("dl",{className:"skill-detail-meta",children:[a.jsxs("div",{children:[a.jsx("dt",{children:b("skillCenter.skillId")}),a.jsx("dd",{title:e.skillId,children:e.skillId})]}),a.jsxs("div",{children:[a.jsx("dt",{children:b("agentSelector.version")}),a.jsx("dd",{children:e.sourceVersion||(r==null?void 0:r.version)||e.version||"—"})]}),e.author?a.jsxs("div",{children:[a.jsx("dt",{children:b("skillCenter.author")}),a.jsx("dd",{children:e.author})]}):null,a.jsxs("div",{children:[a.jsx("dt",{children:b("agentSelector.status")}),a.jsx("dd",{children:RFe(e.skillStatus,b)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:b("skillCenter.skillSpace")}),a.jsx("dd",{title:Pc(t),children:t.isShared?b("skillCenter.sharedSpace"):Pc(t)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:b("myAgents.region")}),a.jsx("dd",{children:wh(n,i)})]})]}),a.jsx(ab,{className:"skill-detail-tabs",idPrefix:"skill-detail",ariaLabel:b("skillCenter.skillDetailSections"),value:v,items:[{id:"files",label:b("skillCenter.allFiles"),panelId:"skill-detail-panel"},{id:"reviews",label:b("skillCenter.reviewHistory"),panelId:"skill-detail-panel"}],onChange:y}),a.jsx("div",{className:`skill-detail-content${v==="files"?" skill-detail-content--files":" skill-detail-content--reviews"}`,id:"skill-detail-panel",role:"tabpanel","aria-labelledby":`skill-detail-${v}-tab`,children:v==="reviews"?d?a.jsx(cl,{}):f?a.jsx("div",{role:"alert",children:a.jsx(Ns,{error:f})}):a.jsx(zW,{applications:u}):o?a.jsxs("div",{className:"skillcenter-loading",children:[a.jsx(Q9t,{}),b("skillCenter.loadingSkillContent")]}):l?a.jsx("div",{className:"skillcenter-error",children:a.jsx(Ns,{error:l})}):s.length>0?a.jsx(fL,{files:s.map(w=>w.path.endsWith("SKILL.md")&&w.content?{...w,content:F9t(w.content)}:w)}):a.jsx(V9t,{children:b("skillCenter.noSkillContent")})})]})})}function q9t({space:e,canUseSandbox:t,onUpload:n,onSandbox:i,onClose:r}){const{t:s}=Te("ui");return p.useEffect(()=>{const o=l=>{l.key==="Escape"&&r()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[r]),a.jsx("div",{className:"skill-dialog-backdrop",role:"presentation",onMouseDown:r,children:a.jsxs("section",{className:"skill-dialog skill-add-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-add-dialog-title",onMouseDown:o=>o.stopPropagation(),children:[a.jsxs("header",{children:[a.jsxs("div",{children:[a.jsx("h2",{id:"skill-add-dialog-title",children:s("skillCenter.addSkill")}),a.jsx("p",{title:Pc(e),children:Pc(e)})]}),a.jsx("button",{type:"button",onClick:r,children:s("common.cancel")})]}),a.jsxs("div",{className:"skill-add-dialog__options",children:[a.jsxs("button",{type:"button",onClick:n,children:[a.jsx("strong",{children:s("skillCenter.localUpload")}),a.jsx("span",{children:s("skillCenter.localUploadDescription")})]}),a.jsx(yP,{disabled:!t,placement:"inside",children:a.jsxs("button",{type:"button",disabled:!t,onClick:i,children:[a.jsx("strong",{children:s("skillCenter.autoCreate")}),a.jsx("span",{children:s("skillCenter.autoCreateDescription")})]})})]})]})})}function W9t({cloudProvider:e="volcengine",region:t,active:n=!0,activationRevision:i=0,initialWorkspace:r=null,onInitialWorkspaceConsumed:s,onPageTitleChange:o,toolbarLeading:l,toolbarFilters:c}){var zt;const{t:u,i18n:d}=Te("ui"),f=p.useMemo(()=>[t],[t]),[h,m]=p.useState([]),[g,b]=p.useState(null),[v,y]=p.useState([]),w=p.useMemo(()=>EFe(v),[v]),[x,O]=p.useState(null),[k,S]=p.useState(null),[C,E]=p.useState(!1),j=p.useRef(""),T=p.useRef(!1),[R,A]=p.useState({}),[N,P]=p.useState(!1),[I,D]=p.useState(""),[_,L]=p.useState((r==null?void 0:r.space)??null),F=p.useRef(_);F.current=_;const[M,V]=p.useState([]),[q,U]=p.useState(1),[J,z]=p.useState(0),[Z,ne]=p.useState(!1),[W,G]=p.useState(null),[H,se]=p.useState(!1),[Y,X]=p.useState(""),[ie,ee]=p.useState("overview"),[be,ue]=p.useState(null),[pe,ke]=p.useState(null),[je,Pe]=p.useState(null),[Ee,ze]=p.useState([]),[_e,ae]=p.useState(!1),[le,ge]=p.useState(null),[Oe,Se]=p.useState(null),[We,Ye]=p.useState(!1),[ye,we]=p.useState(null),[Ae,He]=p.useState(null),[Ue,jt]=p.useState(null),[Pt,Kt]=p.useState(0),[Ct,xt]=p.useState(0),[tt,mt]=p.useState(""),[Ne,Ot]=p.useState(""),[Nt,Yt]=p.useState(null),[xn,Ke]=p.useState(r),St=p.useRef(0),qe=p.useRef(0),nt=p.useRef(!1),et=p.useRef(null),ft=p.useRef(null),Et=p.useRef(null),At=p.useDeferredValue(I),It=p.useDeferredValue(Y),Gt=xn&&(_||xn.selectPublishSpace)?xn.operation==="create"?u("skillCenter.createSkill"):u("skillCenter.optimizeNamed",{name:((zt=xn.source)==null?void 0:zt.name)||u("skillCenter.skill")}):"",Xe=_!=null&&_.isShared?u("skillCenter.sharedSpace"):Pc(_),wt=!(_!=null&&_.isShared)||_.canWrite===!0,vt=Gt||Xe||u("skillCenter.library");p.useEffect(()=>{n&&(o==null||o(vt))},[n,o,vt]),p.useEffect(()=>{r&&(s==null||s())},[r,s]);const tn=p.useMemo(()=>{const Qe=At.trim().toLocaleLowerCase(),bt=h.filter(Ht=>!Ht.isShared);return Qe?bt.filter(Ht=>`${Pc(Ht)} ${Ht.name} ${Ht.description||""} ${Ht.projectName||""}`.toLocaleLowerCase().includes(Qe)):bt},[At,h]),Qt=p.useMemo(()=>{const Qe=It.trim().toLocaleLowerCase();return Qe?M.filter(bt=>`${bt.skillName} ${bt.skillDescription||""}`.toLocaleLowerCase().includes(Qe)):M},[It,M]),cn=(_==null?void 0:_.region)||Zi(e);p.useEffect(()=>{if(!n||!_)return;const Qe=()=>xt(Ht=>Ht+1),bt=()=>{document.visibilityState==="visible"&&Qe()};return window.addEventListener("focus",Qe),document.addEventListener("visibilitychange",bt),()=>{window.removeEventListener("focus",Qe),document.removeEventListener("visibilitychange",bt)}},[n,_==null?void 0:_.id]),p.useEffect(()=>{const Qe=_?`${cn}:${_.id}`:"";if(j.current!==Qe&&(j.current=Qe,y([]),O(null),ke(null)),S(null),E(!1),!n||!_||_.isShared)return;const bt=new AbortController;return E(!0),Dpt({spaceId:_.id,region:cn,signal:bt.signal}).then(Ht=>{bt.signal.aborted||y(Ht.items)}).catch(Ht=>{bt.signal.aborted||S(Pr(Ht,u("skillCenter.reviewStatusFailed")))}).finally(()=>{bt.signal.aborted||E(!1)}),()=>bt.abort()},[_==null?void 0:_.id,_==null?void 0:_.isShared,cn,Ct,n,i,u]);const Me=p.useMemo(()=>f.flatMap(Qe=>{var Ht;const bt=(Ht=R[Qe])==null?void 0:Ht.error;return bt?[{region:Qe,error:bt}]:[]}),[R,f]),on=f.some(Qe=>{const bt=R[Qe];return!!(bt&&!bt.done&&!bt.error)}),On=Me.length===f.length;p.useEffect(()=>{const Qe=new AbortController;return NM(Qe.signal).then(Se).catch(()=>Se({enabled:!1,reason:u("skillCenter.adminNotConfigured"),operations:["create","optimize"],models:[],styles:{}})),()=>Qe.abort()},[u]);const Sn=p.useCallback(async(Qe,bt)=>{var Dr;if(nt.current||Qe.length===0)return;nt.current=!0,P(!0),bt&&((Dr=et.current)==null||Dr.abort(),m([]),A(Object.fromEntries(Qe.map(({region:ti})=>[ti,{nextPage:1,loadedCount:0,done:!1,error:null}]))));const Ht=new AbortController;et.current=Ht;const _n=++qe.current,jr=await Promise.allSettled(Qe.map(async({region:ti,page:Si})=>({region:ti,page:Si,result:await Tpt({region:ti,page:Si,pageSize:P9t,signal:Ht.signal})})));if(qe.current!==_n)return;const Hs=jr.map((ti,Si)=>{const Zr=Qe[Si];return ti.status==="rejected"?{request:Zr,error:Pr(ti.reason,u("skillCenter.errors.loadSpaces")),items:[],totalCount:0,scannedCount:0}:{request:Zr,error:null,items:(ti.value.result.items||[]).map(Jr=>({...Jr,region:Jr.region||ti.value.region})),totalCount:ti.value.result.totalCount||0,scannedCount:ti.value.result.scannedCount??ti.value.result.items.length}}),qs=Hs.flatMap(ti=>ti.items);A(ti=>{const Si={...ti};return Hs.forEach(({request:Zr,error:Jr,scannedCount:ga,totalCount:go})=>{const us=Si[Zr.region]||{nextPage:Zr.page,loadedCount:0,done:!1,error:null};if(Jr){Si[Zr.region]={...us,error:Jr};return}const he=us.loadedCount+ga;Si[Zr.region]={nextPage:Zr.page+1,loadedCount:he,done:ga===0||he>=go,error:null}}),Si}),m(ti=>$9t(bt?[]:ti,qs)),L(ti=>ti&&(qs.find(Si=>cu(Si)===cu(ti))||ti)),nt.current=!1,P(!1)},[]),Qi=p.useCallback(()=>{if(nt.current)return;const Qe=f.flatMap(bt=>{const Ht=R[bt];return Ht&&!Ht.done&&!Ht.error?[{region:bt,page:Ht.nextPage}]:[]});Sn(Qe,!1)},[Sn,R,f]);p.useEffect(()=>{ei(),L(null),V([]),U(1)},[e]),p.useEffect(()=>{if(n)return Sn(f.map(Qe=>({region:Qe,page:1})),!0),()=>{var Qe;qe.current+=1,(Qe=et.current)==null||Qe.abort(),nt.current=!1}},[n,i,Sn,f,Pt]),p.useEffect(()=>{const Qe=Et.current,bt=ft.current;if(!Qe||!bt||!on||N)return;const Ht=new IntersectionObserver(([_n])=>{_n.isIntersecting&&Qi()},{root:bt,rootMargin:"240px 0px",threshold:.01});return Ht.observe(Qe),()=>Ht.disconnect()},[on,Qi,N]);const un=()=>{const Qe=ft.current;!Qe||!on||N||Qe.scrollHeight-Qe.scrollTop-Qe.clientHeight<=240&&Qi()};p.useEffect(()=>{if(!_){V([]),z(0),se(!1);return}let Qe=!0;return ne(!0),G(null),SIe(_.id,{region:cn,page:q,pageSize:oae,project:_.projectName}).then(bt=>{Qe&&(V(bt.items||[]),z(bt.totalCount||0),se(bt.degraded===!0))}).catch(bt=>{Qe&&(V([]),z(0),se(!1),G(Pr(bt,u("skillCenter.errors.loadSkills"))))}).finally(()=>{Qe&&ne(!1)}),()=>{Qe=!1}},[cn,_,q,Ct,u]);const lr=Qe=>{ei(),L(Qe),ee("overview"),U(1),X("")},Mn=()=>{ei(),L(null),V([]),z(0),se(!1),ee("overview"),U(1),X(""),Yt(null)},ei=()=>{St.current+=1,ue(null),Pe(null),ze([]),ge(null),ae(!1)},Bn=async Qe=>{if(!_)return;const bt=_y(Qe),Ht=St.current+1;St.current=Ht,ue(Qe),Pe(null),ge(null),ae(!0);try{const[_n,jr]=await Promise.all([Qpt(_.id,bt,Qe.version,cn,_.projectName,Qe.skillName,_.name),wIe({spaceId:_.id,skillId:bt,version:Qe.version,region:cn,skillSpaceName:_.name,skillName:Qe.skillName})]);St.current===Ht&&(Pe(_n),ze(jr))}catch(_n){St.current===Ht&&ge(Pr(_n,u("skillCenter.errors.loadSkillDetails")))}finally{St.current===Ht&&ae(!1)}},ki=Qe=>{if(_)return{kind:"skill-center",skillId:_y(Qe),version:Qe.version,region:cn,projectName:_.projectName,skillSpaceId:_.id,skillSpaceName:_.name,name:Qe.skillName,description:Qe.skillDescription}},zn=Qe=>{const bt=ki(Qe);!bt||!(Oe!=null&&Oe.enabled)||(ei(),Ke({operation:"optimize",source:bt}))},Rn=async Qe=>{if(!(!_||!window.confirm(u("skillCenter.deleteSkillConfirm",{name:Qe.skillName})))){mt(Qe.skillId),Yt(null);try{await Bpt({spaceId:_.id,skillId:Qe.skillId,region:cn}),xt(bt=>bt+1),Kt(bt=>bt+1)}catch(bt){Yt(Pr(bt,u("skillCenter.errors.deleteSkill")))}finally{mt("")}}},di=async Qe=>{if(!window.confirm(u("skillCenter.deleteSpaceConfirm",{name:Pc(Qe)})))return;const bt=cu(Qe);Ot(bt),Yt(null);try{await Lpt({spaceId:Qe.id,region:Qe.region||Zi(e)}),_&&cu(_)===bt&&Mn(),Kt(Ht=>Ht+1)}catch(Ht){Yt(Pr(Ht,u("skillCenter.errors.deleteSpace")))}finally{Ot("")}},rt=async(Qe,bt=Qe.version,Ht=!1)=>{var Hs,qs,Dr,ti;if(!_||T.current)return;const _n=_,jr=`${_n.region}:${_n.id}:${Qe.skillId}:${bt}`;T.current=!0,b(jr),Yt(null);try{const Si=await Npt({spaceId:_n.id,skillId:Qe.skillId,version:bt,region:_n.region||cn});((Hs=F.current)==null?void 0:Hs.id)===_n.id&&((qs=F.current)==null?void 0:qs.region)===_n.region&&y(Zr=>[...Zr.filter(Jr=>Jr.id!==Si.id),Si])}catch(Si){if(Ht)throw Pr(Si,u("skillCenter.reviewFailed"));((Dr=F.current)==null?void 0:Dr.id)===_n.id&&((ti=F.current)==null?void 0:ti.region)===_n.region&&Yt(Pr(Si,u("skillCenter.reviewFailed")))}finally{T.current=!1,b(null)}};return xn&&(_||xn.selectPublishSpace)?a.jsx(u9t,{operation:xn.operation,cloudProvider:e,space:_??void 0,availableSpaces:h.filter(Qe=>!Qe.isShared),spacesLoading:N,initialIntent:xn.initialIntent,source:xn.source,onBack:()=>Ke(null),onPublished:()=>{xt(Qe=>Qe+1),Kt(Qe=>Qe+1)}}):a.jsxs("section",{className:`skillcenter${_?" is-space":" resource-collection"}`,children:[_?a.jsx(oT,{className:"skillcenter-detail",title:Xe||_.name,description:_.isShared?u("skillCenter.sharedDescription"):_.description||u("skillCenter.manageSpaceDescription"),identitySeed:_.name,backLabel:u("skillCenter.backToSpaces"),onBack:Mn,sections:[{key:"overview",label:u("skillCenter.overview"),content:a.jsxs(a.Fragment,{children:[Nt?a.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:a.jsx(Ns,{error:Nt})}):null,k?a.jsxs("div",{className:"skillcenter-inline-error",role:"alert",children:[a.jsx(Ns,{error:k}),a.jsx("button",{type:"button",onClick:()=>xt(Qe=>Qe+1),children:u("common.reload")})]}):null,a.jsx("section",{className:"skillcenter-overview",children:a.jsxs(bH,{className:"skillcenter-detail-facts",children:[a.jsxs("div",{children:[a.jsx("dt",{children:u("skillCenter.skillCount")}),a.jsx("dd",{children:J})]}),a.jsxs("div",{children:[a.jsx("dt",{children:u("skillCenter.updatedAt")}),a.jsx("dd",{children:_.updatedAt?L9t(_.updatedAt,d.resolvedLanguage??d.language):"—"})]})]})})]})},{key:"skills",label:u("skillCenter.skills"),content:a.jsxs(a.Fragment,{children:[Nt?a.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:a.jsx(Ns,{error:Nt})}):null,k?a.jsxs("div",{className:"skillcenter-inline-error",role:"alert",children:[a.jsx(Ns,{error:k}),a.jsx("button",{type:"button",onClick:()=>xt(Qe=>Qe+1),children:u("common.reload")})]}):null,a.jsxs("section",{className:"skillcenter-results","aria-label":u("skillCenter.skillsInSpace",{name:Xe||_.name}),children:[a.jsx(XIe,{title:u("skillCenter.skills"),description:u("skillCenter.totalItems",{count:J}),actions:a.jsxs(a.Fragment,{children:[a.jsx(Zp,{"aria-label":u("skillCenter.searchSkills"),value:Y,onChange:Qe=>X(Qe.target.value),placeholder:u("skillCenter.searchSkills")}),a.jsx(_t,{color:"secondary",variant:"outline",size:"sm",pill:!1,disabled:Z||C,onClick:()=>xt(Qe=>Qe+1),children:u("common.refresh")})]})}),H?a.jsx("div",{className:"skillcenter-inline-warning",role:"status",children:u("skillCenter.degradedRelationWarning")}):null,Z&&M.length===0?a.jsx(cl,{}):W&&M.length===0?a.jsx(q$,{kind:"error",title:u("skillCenter.cannotLoadSkills"),error:W,action:{label:u("common.reload"),onClick:()=>xt(Qe=>Qe+1)}}):Qt.length===0?a.jsx(q$,{kind:"empty",title:Y.trim()?u("skillCenter.noMatchingSkills"):u("skillCenter.noSkills"),description:Y.trim()?u("skillCenter.tryAnotherName"):u(_.isShared?"skillCenter.sharedEmpty":"skillCenter.emptySkillsDescription"),action:!Y.trim()&&wt?{label:u("skillCenter.localUpload"),onClick:()=>jt(_)}:void 0}):a.jsx("div",{className:"skillcenter-table-wrap",children:a.jsxs("table",{className:"skillcenter-table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:u("skillCenter.skills")}),a.jsx("th",{scope:"col",children:u("agentSelector.status")}),a.jsx("th",{scope:"col",className:"skillcenter-table__actions-heading",children:u("skillCenter.actions")})]})}),a.jsx("tbody",{children:Qt.map(Qe=>{const bt=w.get(`${Qe.skillId}:${Qe.version}`);return a.jsxs("tr",{children:[a.jsx("td",{className:"skillcenter-table__skill",children:a.jsxs("button",{type:"button",onClick:()=>void Bn(Qe),children:[a.jsxs("span",{className:"skillcenter-table__title-row",children:[a.jsx("strong",{title:Qe.skillName,children:Qe.skillName}),Qe.version?a.jsx("span",{className:"skillcenter-table__version-badge",children:Qe.sourceVersion||Qe.version}):null]}),a.jsx("span",{className:"skillcenter-table__description",children:IFe(Qe.skillDescription,u)}),_.isShared&&Qe.author?a.jsx("span",{className:"skillcenter-table__author",children:u("skillCenter.authorName",{name:Qe.author})}):null]})}),a.jsx("td",{children:a.jsxs("div",{className:"skillcenter-review-status",children:[a.jsx("span",{className:`skillcenter-status ${M9t(Qe.skillStatus)}`,children:RFe(Qe.skillStatus,u)}),bt?a.jsx($T,{status:bt.status}):null,bt!=null&&bt.reviewer||bt!=null&&bt.reviewedBy?a.jsx(UW,{compact:!0,person:bt.reviewer,fallback:bt.reviewedBy}):null]})}),a.jsx("td",{children:a.jsxs("div",{className:"skillcenter-table__actions",children:[a.jsx("button",{type:"button",onClick:()=>void Bn(Qe),children:u("common.view")}),!Qe.lookupByName&&Qe.skillId?a.jsx("button",{type:"button",onClick:()=>ke(Qe),children:u("skillCenter.versions.title")}):null,!_.isShared&&!Qe.lookupByName&&Qe.skillId?a.jsx("button",{type:"button",disabled:C||k!==null||g!==null||bt!==void 0&&bt.status!=="returned",onClick:()=>void rt(Qe),children:g===`${_.region}:${_.id}:${Qe.skillId}:${Qe.version}`?u("skillCenter.reviewSubmitting"):u(bt?{pending:"skillCenter.reviewPending",approving:"skillCenter.reviewApproving",approved:"skillCenter.reviewApproved",returned:"skillCenter.reviewRetry"}[bt.status]:"skillCenter.requestPublication")}):null,v.some(Ht=>Ht.sourceSkillId===Qe.skillId)?a.jsx("button",{type:"button",onClick:()=>O(Qe),children:u("skillCenter.reviewHistory")}):null,_.isShared?null:a.jsx(yP,{disabled:!(Oe!=null&&Oe.enabled),children:a.jsx("button",{type:"button",disabled:!(Oe!=null&&Oe.enabled),onClick:()=>zn(Qe),children:u("skillCenter.optimize")})}),!Qe.lookupByName&&wt?a.jsx("button",{type:"button",className:"is-danger",disabled:tt===Qe.skillId,onClick:()=>void Rn(Qe),children:tt===Qe.skillId?u("common.deleting"):u("common.delete")}):null]})})]},`${_y(Qe)}:${Qe.version}`)})})]})}),!Y.trim()&&!Z&&!W&&J>0?a.jsx(z9t,{page:q,total:J,pageSize:oae,onPage:U}):null]})]})}],activeSectionKey:ie,navigationLabel:u("skillCenter.spaceDetails"),onSectionChange:Qe=>ee(Qe),actionsClassName:"skillcenter-toolbar-actions",actions:a.jsxs(a.Fragment,{children:[_.isShared?null:a.jsxs(a.Fragment,{children:[a.jsx(_t,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:()=>we(_),children:u("skillCenter.editSpace")}),a.jsx(_t,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,disabled:Ne===cu(_),onClick:()=>void di(_),children:Ne===cu(_)?u("common.deleting"):u("skillCenter.deleteSpace")})]}),wt?a.jsx(_t,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:()=>jt(_),children:u("skillCenter.localUpload")}):null,_.isShared?null:a.jsx(yP,{disabled:!(Oe!=null&&Oe.enabled),children:a.jsxs(_t,{type:"button",color:"primary",size:"lg",pill:!1,disabled:!(Oe!=null&&Oe.enabled),onClick:()=>Ke({operation:"create"}),children:[a.jsx(Rje,{"aria-hidden":"true"}),a.jsx("span",{children:u("skillCenter.createSkill")})]})})]})}):a.jsxs(a.Fragment,{children:[a.jsxs(sb,{className:"skillcenter-list-toolbar library-resource-toolbar",children:[l,a.jsxs("div",{className:"resource-toolbar__actions",children:[c,a.jsx(Zp,{"aria-label":u("skillCenter.searchSpaces"),value:I,onChange:Qe=>D(Qe.target.value),placeholder:u("skillCenter.searchSpaces")})]})]}),Nt?a.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:a.jsx(Ns,{error:Nt})}):null,a.jsxs(Jp,{className:"skillcenter-list-results",ref:ft,"aria-label":u("skillCenter.spaceList"),onScroll:un,children:[Me.length>0&&!On?a.jsx(uae,{errors:Me,cloudProvider:e,onRetry:()=>Kt(Qe=>Qe+1)}):null,a.jsxs(W0,{children:[a.jsx(_9t,{region:t,active:n,revision:Pt+i,onOpen:lr},`${e}:${t}`),I.trim()?null:a.jsx(lb,{"aria-label":u("skillCenter.createSpace"),icon:a.jsx(U9t,{}),onClick:()=>Ye(!0),children:u("skillCenter.newSpace")}),tn.map(Qe=>{const bt=cu(Qe);return a.jsx(G0,{className:"skillcenter-space-card",title:Pc(Qe),description:Qe.description||u("common.noDescription"),metadata:[{label:u("skillCenter.skillCount"),value:u("skillCenter.skillCountValue",{count:Qe.skillCount??0})},{label:u("skillCenter.updatedAt"),value:FT(Qe.updatedAt,Date.now(),d.resolvedLanguage??d.language)}],action:{label:u("skillCenter.addSkill"),icon:"plus",onClick:()=>He(Qe)},detailAction:{label:u("common.viewDetails"),onClick:()=>lr(Qe)}},bt)})]}),N&&h.length===0?a.jsx(cl,{}):On&&h.length===0?a.jsx(uae,{errors:Me,cloudProvider:e,fullPage:!0,onRetry:()=>Kt(Qe=>Qe+1)}):tn.length===0&&I.trim()?a.jsx(q$,{kind:"empty",title:u("skillCenter.noMatchingSpaces"),description:u("skillCenter.tryAnotherName")}):null,!On&&h.length>0?a.jsx("div",{className:"my-agent-load-more",ref:Et,"aria-live":"polite",children:N?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),a.jsx("span",{children:u("skillCenter.loadingMoreSpaces")})]}):on?a.jsx("span",{children:u("skillCenter.scrollForMore")}):Me.length>0?a.jsx("span",{children:u("skillCenter.someSpacesFailed")}):a.jsx("span",{children:u("skillCenter.allSpacesLoaded")})}):null]})]}),pe&&_?a.jsx(T9t,{skill:pe,space:_,region:cn,reviews:v.filter(Qe=>Qe.sourceSkillId===pe.skillId),onClose:()=>ke(null),onChanged:()=>xt(Qe=>Qe+1),onSubmitReview:!_.isShared&&!C&&!k?Qe=>rt(pe,Qe,!0):void 0},`${cn}:${_.id}:${pe.skillId}`):null,x?a.jsx(A9t,{name:x.skillName,applications:v.filter(Qe=>Qe.sourceSkillId===x.skillId),onClose:()=>O(null)}):null,be&&_&&a.jsx(H9t,{skill:be,space:_,region:cn,cloudProvider:e,detail:je,files:Ee,loading:_e,error:le,reviews:v.filter(Qe=>Qe.sourceSkillId===be.skillId),reviewsLoading:C,reviewsError:k,canOptimize:!_.isShared&&(Oe==null?void 0:Oe.enabled)===!0,onOptimize:()=>zn(be),onDownload:()=>void Upt({spaceId:_.id,skillId:_y(be),version:be.version,region:cn,fallbackName:be.skillName,skillSpaceName:_.name,skillName:be.skillName}).catch(Qe=>ge(Pr(Qe,u("skillCenter.errors.downloadSkill")))),onClose:ei}),We?a.jsx(j9t,{region:t,regionOptions:_u(e),onClose:()=>Ye(!1),onCreated:Qe=>{Ye(!1),Kt(bt=>bt+1),L({...Qe,region:Qe.region||t})}}):null,ye?a.jsx(N9t,{space:ye,region:ye.region||Zi(e),onClose:()=>we(null),onUpdated:Qe=>{const bt={...Qe,region:Qe.region||ye.region||Zi(e)};we(null),L(Ht=>Ht&&cu(Ht)===cu(bt)?bt:Ht),m(Ht=>Ht.map(_n=>cu(_n)===cu(bt)?bt:_n)),Kt(Ht=>Ht+1)}}):null,Ae?a.jsx(q9t,{space:Ae,canUseSandbox:(Oe==null?void 0:Oe.enabled)===!0,onClose:()=>He(null),onUpload:()=>{jt(Ae),He(null)},onSandbox:()=>{const Qe=Ae;He(null),lr(Qe),Ke({operation:"create"})}}):null,Ue?a.jsx(R9t,{space:Ue,region:Ue.region||Zi(e),onClose:()=>jt(null),onUploaded:()=>{jt(null),xt(Qe=>Qe+1),Kt(Qe=>Qe+1)}}):null]})}function K9t(e){return[{id:"skills",label:e("library.tabs.skills"),panelId:"library-skills-panel"},{id:"knowledge",label:e("library.tabs.knowledge"),panelId:"library-knowledge-panel"},{id:"artifacts",label:e("library.tabs.artifacts"),panelId:"library-artifacts-panel"}]}function G9t({cloudProvider:e,studioRegion:t="",activeTab:n,onTabChange:i,onPageTitleChange:r,skillInitialWorkspace:s=null,onSkillInitialWorkspaceConsumed:o,artifactSources:l=[],artifactUserId:c="",onArtifactActivate:u,onArtifactSourceOpen:d}){const{t:f,i18n:h}=Te("workspaceTools"),m=p.useMemo(()=>K9t(f),[f]),g=f("library.tabs.skills"),b=AD(t)?t:Zi(e),[v,y]=p.useState(b),[w,x]=p.useState(g),O=p.useRef(g),[k,S]=p.useState(!1),[C,E]=p.useState(()=>new Set(["skills",n])),[j,T]=p.useState({skills:0,knowledge:0,artifacts:0}),R=p.useRef(u),[A,N]=p.useState([]),[P,I]=p.useState(!1),[D,_]=p.useState(""),L=p.useMemo(()=>{const ne=abt(l,f("library.untitledSession"));return{key:JSON.stringify(ne),candidates:ne}},[l,f]),F=p.useRef(L);F.current.key!==L.key&&(F.current=L);const M=F.current.candidates,V=p.useMemo(()=>_u(e),[e]);p.useEffect(()=>{y(b)},[b]),p.useEffect(()=>{const ne=O.current;x(W=>W===ne?g:W),O.current=g},[g]),p.useEffect(()=>{R.current=u},[u]),p.useEffect(()=>{E(ne=>{if(ne.has(n))return ne;const W=new Set(ne);return W.add(n),W})},[n]),p.useEffect(()=>{var W;const ne=n==="skills"?w:((W=m.find(G=>G.id===n))==null?void 0:W.label)||f("library.title");r==null||r(ne)},[n,r,w,f,m]),p.useEffect(()=>{var ne;n==="artifacts"&&((ne=R.current)==null||ne.call(R))},[n,j.artifacts]);const q=p.useCallback(async()=>{I(!0),_("");try{N(await mbt(M))}catch(ne){_(ne instanceof Error?ne.message:String(ne))}finally{I(!1)}},[M]);p.useEffect(()=>{n==="artifacts"&&q()},[n,j.artifacts,q]);const U=ne=>{E(W=>{if(W.has(ne))return W;const G=new Set(W);return G.add(ne),G}),T(W=>({...W,[ne]:W[ne]+1})),i(ne)},J=a.jsx(ab,{idPrefix:"library",ariaLabel:f("library.categoryAria"),value:n,items:m,onChange:U}),z=ne=>a.jsx(ob,{id:ne,ariaLabel:f("library.regionAria"),value:v,options:V,onChange:y}),Z=n==="skills"?w!==g:n==="knowledge"&&k;return a.jsxs(kh,{className:`library-view${Z?" is-detail":""}`,"aria-label":f("library.title"),children:[Z?null:a.jsx(q0,{className:"library-view__header",title:f("library.title")}),a.jsxs("div",{className:"library-panels",children:[C.has("skills")?a.jsx("div",{id:"library-skills-panel",className:"library-panel",role:"tabpanel","aria-labelledby":"library-skills-tab",hidden:n!=="skills",children:a.jsx(W9t,{cloudProvider:e,region:v,active:n==="skills",activationRevision:j.skills,onPageTitleChange:x,initialWorkspace:s,onInitialWorkspaceConsumed:o,toolbarLeading:J,toolbarFilters:z("library-skills-region-filter")})}):null,C.has("knowledge")?a.jsx("div",{id:"library-knowledge-panel",className:"library-panel",role:"tabpanel","aria-labelledby":"library-knowledge-tab",hidden:n!=="knowledge",children:a.jsx(l2t,{cloudProvider:e,region:v,active:n==="knowledge",activationRevision:j.knowledge,onDetailChange:S,toolbarLeading:J,toolbarFilters:z("library-knowledge-region-filter")})}):null,C.has("artifacts")?a.jsx("div",{id:"library-artifacts-panel",className:"library-panel",role:"tabpanel","aria-labelledby":"library-artifacts-tab",hidden:n!=="artifacts",children:a.jsx(fbt,{items:A,region:v,userId:c,active:n==="artifacts",activationRevision:j.artifacts,loading:P,error:D?So(D,h.resolvedLanguage||h.language)||f("artifactLibrary.loadDetailFallback"):"",onRetry:()=>void q(),onEdit:gbt,onDelete:bbt,onDownload:ybt,onOpenSource:d?ne=>d(ne.appName,ne.sessionId):void 0,toolbarLeading:J,toolbarFilters:z("library-artifacts-region-filter")})}):null]})]})}const PFe="veadk_agentkit_connections",X9t=3e3,dae=6e4;function sf(){try{const e=localStorage.getItem(PFe);return(e?JSON.parse(e):[]).filter(n=>!n.runtimeId||!!n.region)}catch{return[]}}function pL(e){try{localStorage.setItem(PFe,JSON.stringify(e))}catch{}}function gf(e,t){return`agentkit:${e}:${t}`}function DFe(e){try{return new URL(e).host}catch{return e}}function vO(e){WAe();for(const t of e)if(!(t.runtimeId&&!t.region))for(const n of t.apps)qAe(gf(t.id,n),t.runtimeId?{app:n,runtimeId:t.runtimeId,mpaInstanceId:t.mpaInstanceId,region:t.region,agentCategory:t.agentCategory}:{app:n,base:t.base,apiKey:t.apiKey})}function MFe(e,t,n,i,r,s,o,l){const c=sf(),u=c.findIndex(h=>h.runtimeId===e),d=u===-1?void 0:c[u],f={id:`rt_${e}`,name:t||e,runtimeId:e,region:n,apps:i,appLabels:r,currentVersion:s,agentCategory:o??(d==null?void 0:d.agentCategory),mpaInstanceId:(l==null?void 0:l.trim())||(d==null?void 0:d.mpaInstanceId)};return u===-1?c.push(f):c[u]=f,pL(c),vO(c),f}async function Y9t(e,t,n,i,r,s,o){let l=null,c=n||"cn-beijing",u=null;for(const m of LA(n))try{const g=await Ww(e,m,{retryProbe:!0,preferCached:!0,currentVersion:i});if(g&&g.length>0){await w2e(e,m),l=g,c=m;break}}catch(g){if(g instanceof U1)throw vP(e),g;if(g instanceof Oa&&g.unsupported){u=g;continue}throw g}if(!l||l.length===0)throw vP(e),u||new Oa(Q("connections.runtimeUnsupported"),!0,!0);const d=(r==null?void 0:r.trim())||l[0],f=Object.fromEntries(l.map(m=>[m,m===l[0]?d:m])),h=MFe(e,t,c,l,f,i,s,o);return gf(h.id,l[0])}function Z9t(e){return new Promise(t=>window.setTimeout(t,e))}async function XN(e,t,n,i,r={}){const s=Date.now();for(;;)try{return await Y9t(e,t,n,i,r.agentName,r.agentCategory,r.mpaInstanceId)}catch(o){const l=Date.now()-s;if(!r.waitForReady||!(o instanceof Oa)||!o.retryable||l>=dae)throw o;const c=Math.min(X9t,dae-l);await Z9t(c)}}async function LFe(e,t,n,i){const r=t.trim().replace(/\/+$/,""),s=await $A(r,n.trim()),o={id:Date.now().toString(36),name:e.trim()||DFe(r),base:r,apiKey:n.trim(),apps:s,appLabels:i&&s.length>0?{[s[0]]:i}:void 0},l=[...sf().filter(c=>c.base!==r),o];return pL(l),vO(l),o}function J9t(e){const t=sf().filter(n=>n.id!==e);return pL(t),vO(t),t}function vP(e){const t=sf().filter(n=>n.runtimeId!==e);return pL(t),vO(t),t}function $Fe(e,t){const n=e.map(r=>({id:r,label:r,app:r,remote:!1})),i=t.flatMap(r=>r.apps.map(s=>{var l;const o=((l=r.appLabels)==null?void 0:l[s])??s;return{id:gf(r.id,s),label:o,app:s,remote:!0,host:r.runtimeId?r.name:DFe(r.base??""),runtimeId:r.runtimeId,region:r.region,currentVersion:r.currentVersion,agentCategory:r.agentCategory,mpaInstanceId:r.mpaInstanceId}}));return[...n,...i]}const fae=Object.freeze(Object.defineProperty({__proto__:null,addConnection:LFe,addRuntimeConnection:MFe,buildAgentEntries:$Fe,connectRuntime:XN,loadConnections:sf,registerConnections:vO,remoteAppId:gf,removeConnection:J9t,removeRuntimeConnection:vP},Symbol.toStringTag,{value:"Module"}));function e7t({onAdded:e,onCancel:t}){const{t:n}=Te("conversation"),[i,r]=p.useState(""),[s,o]=p.useState(""),[l,c]=p.useState(""),[u,d]=p.useState(!1),[f,h]=p.useState(""),m=i.trim().length>0&&s.trim().length>0&&!u;async function g(){if(m){d(!0),h("");try{const b=await LFe(l,i,s,l);if(b.apps.length===0){h(n("addAgentKit.noAgents")),d(!1);return}e(gf(b.id,b.apps[0]))}catch(b){h(n("addAgentKit.connectionFailed",{error:String(b)})),d(!1)}}}return a.jsx("div",{className:"addagent",children:a.jsxs("div",{className:"addagent-card",children:[a.jsx("h2",{className:"addagent-title",children:n("addAgentKit.title")}),a.jsx("p",{className:"addagent-sub",children:n("addAgentKit.description")}),a.jsxs("label",{className:"addagent-field",children:[a.jsx("span",{className:"addagent-label",children:n("addAgentKit.url")}),a.jsx("input",{className:"addagent-input",value:i,onChange:b=>r(b.target.value),placeholder:"https://xxxxx.apigateway-cn-beijing.volceapi.com",autoFocus:!0})]}),a.jsxs("label",{className:"addagent-field",children:[a.jsx("span",{className:"addagent-label",children:"API Key"}),a.jsx("input",{className:"addagent-input",type:"password",value:s,onChange:b=>o(b.target.value),placeholder:n("addAgentKit.apiKeyHint")})]}),a.jsxs("label",{className:"addagent-field",children:[a.jsx("span",{className:"addagent-label",children:n("addAgentKit.displayName")}),a.jsx("input",{className:"addagent-input",value:l,onChange:b=>c(b.target.value),placeholder:n("addAgentKit.displayNameHint")})]}),f&&a.jsx("div",{className:"addagent-error",children:f}),a.jsxs("div",{className:"addagent-actions",children:[a.jsx("button",{className:"addagent-btn addagent-btn--ghost",onClick:t,disabled:u,children:n("addAgentKit.cancel")}),a.jsxs("button",{className:"addagent-btn addagent-btn--primary",onClick:g,disabled:!m,children:[u?a.jsx(Fi,{className:"icon spin"}):null,n(u?"addAgentKit.connecting":"addAgentKit.connect")]})]})]})})}const t7t=/[\u3400-\u4dbf\u4e00-\u9fff\uf900-\ufaff]/u,n7t={"deploy.build.logs_syncing":"client.deploymentProgress.buildLogsSyncing","deploy.build.logs_complete":"client.deploymentProgress.buildLogsComplete","deploy.build.failed_logs_synced":"client.deploymentProgress.buildFailedLogsSynced","deploy.build.logs_unavailable":"client.deploymentProgress.buildLogsUnavailable","deploy.build.final_logs_unavailable":"client.deploymentProgress.finalBuildLogsUnavailable"},i7t={prepare:"client.deploymentProgress.preparing",upload:"client.deploymentProgress.uploading",build:"client.deploymentProgress.building",deploy:"client.deploymentProgress.deploying",publish:"client.deploymentProgress.publishing",evaluation:"client.deploymentProgress.evaluating",update:"client.deploymentProgress.updating",profile_applying:"client.deploymentProgress.applyingMpaProfile",smoke_running:"client.deploymentProgress.runningMpaSmoke",runnable:"client.deploymentProgress.mpaReady",complete:"client.deploymentProgress.completing",github:"client.deploymentProgress.github"};function mL(e){var r,s;const t=((r=e.message)==null?void 0:r.trim())??"",n=e.messageCode?n7t[e.messageCode]:void 0;if(n)return Q(n);if(t&&(j8().toLowerCase()==="zh-cn"||!t7t.test(t)))return t;if(e.phase==="build"&&((s=e.buildLog)!=null&&s.status)){const o={running:"client.deploymentProgress.buildLogsSyncing",complete:"client.deploymentProgress.buildLogsComplete",error:"client.deploymentProgress.buildLogsUnavailable"}[e.buildLog.status];if(o)return Q(o)}const i=e.phase?i7t[e.phase]:void 0;return i?Q(i):t||Q("client.deploymentProgress.inProgress")}function eo(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,i;n{}};function gL(){for(var e=0,t=arguments.length,n={},i;e=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}YN.prototype=gL.prototype={constructor:YN,on:function(e,t){var n=this._,i=s7t(e+"",n),r,s=-1,o=i.length;if(arguments.length<2){for(;++s0)for(var n=new Array(r),i=0,r,s;i=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),pae.hasOwnProperty(t)?{space:pae[t],local:e}:e}function o7t(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===A7&&t.documentElement.namespaceURI===A7?t.createElement(e):t.createElementNS(n,e)}}function l7t(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function FFe(e){var t=bL(e);return(t.local?l7t:o7t)(t)}function c7t(){}function HW(e){return e==null?c7t:function(){return this.querySelector(e)}}function u7t(e){typeof e!="function"&&(e=HW(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r=x&&(x=w+1);!(k=v[x])&&++x=0;)(o=i[r])&&(s&&o.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(o,s),s=o);return this}function D7t(e){e||(e=M7t);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var n=this._groups,i=n.length,r=new Array(i),s=0;st?1:e>=t?0:NaN}function L7t(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function $7t(){return Array.from(this)}function F7t(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?X7t:typeof t=="function"?Z7t:Y7t)(e,t,n??"")):x1(this.node(),e)}function x1(e,t){return e.style.getPropertyValue(t)||VFe(e).getComputedStyle(e,null).getPropertyValue(t)}function eUt(e){return function(){delete this[e]}}function tUt(e,t){return function(){this[e]=t}}function nUt(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function iUt(e,t){return arguments.length>1?this.each((t==null?eUt:typeof t=="function"?nUt:tUt)(e,t)):this.node()[e]}function HFe(e){return e.trim().split(/^|\s+/)}function qW(e){return e.classList||new qFe(e)}function qFe(e){this._node=e,this._names=HFe(e.getAttribute("class")||"")}qFe.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function WFe(e,t){for(var n=qW(e),i=-1,r=t.length;++i=0&&(n=t.slice(i+1),t=t.slice(0,i)),{type:t,name:n}})}function NUt(e){return function(){var t=this.__on;if(t){for(var n=0,i=-1,r=t.length,s;n()=>e;function T7(e,{sourceEvent:t,subject:n,target:i,identifier:r,active:s,x:o,y:l,dx:c,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}T7.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function UUt(e){return!e.ctrlKey&&!e.button}function QUt(){return this.parentNode}function zUt(e,t){return t??{x:e.x,y:e.y}}function VUt(){return navigator.maxTouchPoints||"ontouchstart"in this}function JFe(){var e=UUt,t=QUt,n=zUt,i=VUt,r={},s=gL("start","drag","end"),o=0,l,c,u,d,f=0;function h(O){O.on("mousedown.drag",m).filter(i).on("touchstart.drag",v).on("touchmove.drag",y,BUt).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(O,k){if(!(d||!e.call(this,O,k))){var S=x(this,t.call(this,O,k),O,k,"mouse");S&&(vu(O.view).on("mousemove.drag",g,nA).on("mouseup.drag",b,nA),YFe(O.view),W$(O),u=!1,l=O.clientX,c=O.clientY,S("start",O))}}function g(O){if(Ew(O),!u){var k=O.clientX-l,S=O.clientY-c;u=k*k+S*S>f}r.mouse("drag",O)}function b(O){vu(O.view).on("mousemove.drag mouseup.drag",null),ZFe(O.view,u),Ew(O),r.mouse("end",O)}function v(O,k){if(e.call(this,O,k)){var S=O.changedTouches,C=t.call(this,O,k),E=S.length,j,T;for(j=0;j>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?fj(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?fj(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=qUt.exec(e))?new Lc(t[1],t[2],t[3],1):(t=WUt.exec(e))?new Lc(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=KUt.exec(e))?fj(t[1],t[2],t[3],t[4]):(t=GUt.exec(e))?fj(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=XUt.exec(e))?wae(t[1],t[2]/100,t[3]/100,1):(t=YUt.exec(e))?wae(t[1],t[2]/100,t[3]/100,t[4]):mae.hasOwnProperty(e)?yae(mae[e]):e==="transparent"?new Lc(NaN,NaN,NaN,0):null}function yae(e){return new Lc(e>>16&255,e>>8&255,e&255,1)}function fj(e,t,n,i){return i<=0&&(e=t=n=NaN),new Lc(e,t,n,i)}function eQt(e){return e instanceof UT||(e=A0(e)),e?(e=e.rgb(),new Lc(e.r,e.g,e.b,e.opacity)):new Lc}function _7(e,t,n,i){return arguments.length===1?eQt(e):new Lc(e,t,n,i??1)}function Lc(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}WW(Lc,_7,e8e(UT,{brighter(e){return e=e==null?wP:Math.pow(wP,e),new Lc(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?iA:Math.pow(iA,e),new Lc(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Lc(e0(this.r),e0(this.g),e0(this.b),OP(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:vae,formatHex:vae,formatHex8:tQt,formatRgb:xae,toString:xae}));function vae(){return`#${Ly(this.r)}${Ly(this.g)}${Ly(this.b)}`}function tQt(){return`#${Ly(this.r)}${Ly(this.g)}${Ly(this.b)}${Ly((isNaN(this.opacity)?1:this.opacity)*255)}`}function xae(){const e=OP(this.opacity);return`${e===1?"rgb(":"rgba("}${e0(this.r)}, ${e0(this.g)}, ${e0(this.b)}${e===1?")":`, ${e})`}`}function OP(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function e0(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ly(e){return e=e0(e),(e<16?"0":"")+e.toString(16)}function wae(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new lf(e,t,n,i)}function t8e(e){if(e instanceof lf)return new lf(e.h,e.s,e.l,e.opacity);if(e instanceof UT||(e=A0(e)),!e)return new lf;if(e instanceof lf)return e;e=e.rgb();var t=e.r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),s=Math.max(t,n,i),o=NaN,l=s-r,c=(s+r)/2;return l?(t===s?o=(n-i)/l+(n0&&c<1?0:o,new lf(o,l,c,e.opacity)}function nQt(e,t,n,i){return arguments.length===1?t8e(e):new lf(e,t,n,i??1)}function lf(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}WW(lf,nQt,e8e(UT,{brighter(e){return e=e==null?wP:Math.pow(wP,e),new lf(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?iA:Math.pow(iA,e),new lf(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new Lc(K$(e>=240?e-240:e+120,r,i),K$(e,r,i),K$(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new lf(Oae(this.h),hj(this.s),hj(this.l),OP(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=OP(this.opacity);return`${e===1?"hsl(":"hsla("}${Oae(this.h)}, ${hj(this.s)*100}%, ${hj(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Oae(e){return e=(e||0)%360,e<0?e+360:e}function hj(e){return Math.max(0,Math.min(1,e||0))}function K$(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const yL=e=>()=>e;function n8e(e,t){return function(n){return e+n*t}}function iQt(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}function Hhn(e,t){var n=t-e;return n?n8e(e,n>180||n<-180?n-360*Math.round(n/360):n):yL(isNaN(e)?t:e)}function rQt(e){return(e=+e)==1?i8e:function(t,n){return n-t?iQt(t,n,e):yL(isNaN(t)?n:t)}}function i8e(e,t){var n=t-e;return n?n8e(e,n):yL(isNaN(e)?t:e)}const kP=function e(t){var n=rQt(t);function i(r,s){var o=n((r=_7(r)).r,(s=_7(s)).r),l=n(r.g,s.g),c=n(r.b,s.b),u=i8e(r.opacity,s.opacity);return function(d){return r.r=o(d),r.g=l(d),r.b=c(d),r.opacity=u(d),r+""}}return i.gamma=e,i}(1);function sQt(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,i=t.slice(),r;return function(s){for(r=0;rn&&(s=t.slice(n,s),l[o]?l[o]+=s:l[++o]=s),(i=i[0])===(r=r[0])?l[o]?l[o]+=r:l[++o]=r:(l[++o]=null,c.push({i:o,x:Yf(i,r)})),n=G$.lastIndex;return n180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(r(f)+"rotate(",null,i)-2,x:Yf(u,d)})):d&&f.push(r(f)+"rotate("+d+i)}function l(u,d,f,h){u!==d?h.push({i:f.push(r(f)+"skewX(",null,i)-2,x:Yf(u,d)}):d&&f.push(r(f)+"skewX("+d+i)}function c(u,d,f,h,m,g){if(u!==f||d!==h){var b=m.push(r(m)+"scale(",null,",",null,")");g.push({i:b-4,x:Yf(u,f)},{i:b-2,x:Yf(d,h)})}else(f!==1||h!==1)&&m.push(r(m)+"scale("+f+","+h+")")}return function(u,d){var f=[],h=[];return u=e(u),d=e(d),s(u.translateX,u.translateY,d.translateX,d.translateY,f,h),o(u.rotate,d.rotate,f,h),l(u.skewX,d.skewX,f,h),c(u.scaleX,u.scaleY,d.scaleX,d.scaleY,f,h),u=d=null,function(m){for(var g=-1,b=h.length,v;++g=0&&e._call.call(void 0,t),e=e._next;--w1}function Eae(){T0=(EP=sA.now())+vL,w1=wS=0;try{xQt()}finally{w1=0,OQt(),T0=0}}function wQt(){var e=sA.now(),t=e-EP;t>o8e&&(vL-=t,EP=e)}function OQt(){for(var e,t=SP,n,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:SP=n);OS=e,R7(i)}function R7(e){if(!w1){wS&&(wS=clearTimeout(wS));var t=e-T0;t>24?(e<1/0&&(wS=setTimeout(Eae,e-sA.now()-vL)),jk&&(jk=clearInterval(jk))):(jk||(EP=sA.now(),jk=setInterval(wQt,o8e)),w1=1,l8e(Eae))}}function Cae(e,t,n){var i=new CP;return t=t==null?0:+t,i.restart(r=>{i.stop(),e(r+t)},t,n),i}var kQt=gL("start","end","cancel","interrupt"),SQt=[],u8e=0,Aae=1,I7=2,JN=3,Tae=4,P7=5,eR=6;function xL(e,t,n,i,r,s){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;EQt(e,n,{name:t,index:i,group:r,on:kQt,tween:SQt,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:u8e})}function GW(e,t){var n=If(e,t);if(n.state>u8e)throw new Error("too late; already scheduled");return n}function Ph(e,t){var n=If(e,t);if(n.state>JN)throw new Error("too late; already running");return n}function If(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function EQt(e,t,n){var i=e.__transition,r;i[t]=n,n.timer=c8e(s,0,n.time);function s(u){n.state=Aae,n.timer.restart(o,n.delay,n.time),n.delay<=u&&o(u-n.delay)}function o(u){var d,f,h,m;if(n.state!==Aae)return c();for(d in i)if(m=i[d],m.name===n.name){if(m.state===JN)return Cae(o);m.state===Tae?(m.state=eR,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete i[d]):+dI7&&i.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function tzt(e,t,n){var i,r,s=ezt(t)?GW:Ph;return function(){var o=s(this,e),l=o.on;l!==i&&(r=(i=l).copy()).on(t,n),o.on=r}}function nzt(e,t){var n=this._id;return arguments.length<2?If(this.node(),n).on.on(e):this.each(tzt(n,e,t))}function izt(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function rzt(){return this.on("end.remove",izt(this._id))}function szt(e){var t=this._name,n=this._id;typeof e!="function"&&(e=HW(e));for(var i=this._groups,r=i.length,s=new Array(r),o=0;o()=>e;function jzt(e,{sourceEvent:t,target:n,transform:i,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:r}})}function Cp(e,t,n){this.k=e,this.x=t,this.y=n}Cp.prototype={constructor:Cp,scale:function(e){return e===1?this:new Cp(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Cp(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var wL=new Cp(1,0,0);p8e.prototype=Cp.prototype;function p8e(e){for(;!e.__zoom;)if(!(e=e.parentNode))return wL;return e.__zoom}function X$(e){e.stopImmediatePropagation()}function Nk(e){e.preventDefault(),e.stopImmediatePropagation()}function Nzt(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Rzt(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function _ae(){return this.__zoom||wL}function Izt(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Pzt(){return navigator.maxTouchPoints||"ontouchstart"in this}function Dzt(e,t,n){var i=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(r>i?(i+r)/2:Math.min(0,i)||Math.max(0,r),o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o))}function m8e(){var e=Nzt,t=Rzt,n=Dzt,i=Izt,r=Pzt,s=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,c=ZN,u=gL("start","zoom","end"),d,f,h,m=500,g=150,b=0,v=10;function y(P){P.property("__zoom",_ae).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",j).on("dblclick.zoom",T).filter(r).on("touchstart.zoom",R).on("touchmove.zoom",A).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(P,I,D,_){var L=P.selection?P.selection():P;L.property("__zoom",_ae),P!==L?k(P,I,D,_):L.interrupt().each(function(){S(this,arguments).event(_).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},y.scaleBy=function(P,I,D,_){y.scaleTo(P,function(){var L=this.__zoom.k,F=typeof I=="function"?I.apply(this,arguments):I;return L*F},D,_)},y.scaleTo=function(P,I,D,_){y.transform(P,function(){var L=t.apply(this,arguments),F=this.__zoom,M=D==null?O(L):typeof D=="function"?D.apply(this,arguments):D,V=F.invert(M),q=typeof I=="function"?I.apply(this,arguments):I;return n(x(w(F,q),M,V),L,o)},D,_)},y.translateBy=function(P,I,D,_){y.transform(P,function(){return n(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof D=="function"?D.apply(this,arguments):D),t.apply(this,arguments),o)},null,_)},y.translateTo=function(P,I,D,_,L){y.transform(P,function(){var F=t.apply(this,arguments),M=this.__zoom,V=_==null?O(F):typeof _=="function"?_.apply(this,arguments):_;return n(wL.translate(V[0],V[1]).scale(M.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof D=="function"?-D.apply(this,arguments):-D),F,o)},_,L)};function w(P,I){return I=Math.max(s[0],Math.min(s[1],I)),I===P.k?P:new Cp(I,P.x,P.y)}function x(P,I,D){var _=I[0]-D[0]*P.k,L=I[1]-D[1]*P.k;return _===P.x&&L===P.y?P:new Cp(P.k,_,L)}function O(P){return[(+P[0][0]+ +P[1][0])/2,(+P[0][1]+ +P[1][1])/2]}function k(P,I,D,_){P.on("start.zoom",function(){S(this,arguments).event(_).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(_).end()}).tween("zoom",function(){var L=this,F=arguments,M=S(L,F).event(_),V=t.apply(L,F),q=D==null?O(V):typeof D=="function"?D.apply(L,F):D,U=Math.max(V[1][0]-V[0][0],V[1][1]-V[0][1]),J=L.__zoom,z=typeof I=="function"?I.apply(L,F):I,Z=c(J.invert(q).concat(U/J.k),z.invert(q).concat(U/z.k));return function(ne){if(ne===1)ne=z;else{var W=Z(ne),G=U/W[2];ne=new Cp(G,q[0]-W[0]*G,q[1]-W[1]*G)}M.zoom(null,ne)}})}function S(P,I,D){return!D&&P.__zooming||new C(P,I)}function C(P,I){this.that=P,this.args=I,this.active=0,this.sourceEvent=null,this.extent=t.apply(P,I),this.taps=0}C.prototype={event:function(P){return P&&(this.sourceEvent=P),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(P,I){return this.mouse&&P!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&P!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&P!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(P){var I=vu(this.that).datum();u.call(P,this.that,new jzt(P,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:u}),I)}};function E(P,...I){if(!e.apply(this,arguments))return;var D=S(this,I).event(P),_=this.__zoom,L=Math.max(s[0],Math.min(s[1],_.k*Math.pow(2,i.apply(this,arguments)))),F=tf(P);if(D.wheel)(D.mouse[0][0]!==F[0]||D.mouse[0][1]!==F[1])&&(D.mouse[1]=_.invert(D.mouse[0]=F)),clearTimeout(D.wheel);else{if(_.k===L)return;D.mouse=[F,_.invert(F)],tR(this),D.start()}Nk(P),D.wheel=setTimeout(M,g),D.zoom("mouse",n(x(w(_,L),D.mouse[0],D.mouse[1]),D.extent,o));function M(){D.wheel=null,D.end()}}function j(P,...I){if(h||!e.apply(this,arguments))return;var D=P.currentTarget,_=S(this,I,!0).event(P),L=vu(P.view).on("mousemove.zoom",q,!0).on("mouseup.zoom",U,!0),F=tf(P,D),M=P.clientX,V=P.clientY;YFe(P.view),X$(P),_.mouse=[F,this.__zoom.invert(F)],tR(this),_.start();function q(J){if(Nk(J),!_.moved){var z=J.clientX-M,Z=J.clientY-V;_.moved=z*z+Z*Z>b}_.event(J).zoom("mouse",n(x(_.that.__zoom,_.mouse[0]=tf(J,D),_.mouse[1]),_.extent,o))}function U(J){L.on("mousemove.zoom mouseup.zoom",null),ZFe(J.view,_.moved),Nk(J),_.event(J).end()}}function T(P,...I){if(e.apply(this,arguments)){var D=this.__zoom,_=tf(P.changedTouches?P.changedTouches[0]:P,this),L=D.invert(_),F=D.k*(P.shiftKey?.5:2),M=n(x(w(D,F),_,L),t.apply(this,I),o);Nk(P),l>0?vu(this).transition().duration(l).call(k,M,_,P):vu(this).call(y.transform,M,_,P)}}function R(P,...I){if(e.apply(this,arguments)){var D=P.touches,_=D.length,L=S(this,I,P.changedTouches.length===_).event(P),F,M,V,q;for(X$(P),M=0;M<_;++M)V=D[M],q=tf(V,this),q=[q,this.__zoom.invert(q),V.identifier],L.touch0?!L.touch1&&L.touch0[2]!==q[2]&&(L.touch1=q,L.taps=0):(L.touch0=q,F=!0,L.taps=1+!!d);d&&(d=clearTimeout(d)),F&&(L.taps<2&&(f=q[0],d=setTimeout(function(){d=null},m)),tR(this),L.start())}}function A(P,...I){if(this.__zooming){var D=S(this,I).event(P),_=P.changedTouches,L=_.length,F,M,V,q;for(Nk(P),F=0;F`Seems like you have not used zustand provider as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:i})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:i}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},aA=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],g8e=["Enter"," ","Escape"],b8e={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var O1;(function(e){e.Strict="strict",e.Loose="loose"})(O1||(O1={}));var t0;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(t0||(t0={}));var oA;(function(e){e.Partial="partial",e.Full="full"})(oA||(oA={}));const y8e={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var lg;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(lg||(lg={}));var lA;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(lA||(lA={}));var vn;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(vn||(vn={}));const jae={[vn.Left]:vn.Right,[vn.Right]:vn.Left,[vn.Top]:vn.Bottom,[vn.Bottom]:vn.Top};function v8e(e){return e===null?null:e?"valid":"invalid"}const x8e=e=>"id"in e&&"source"in e&&"target"in e,Mzt=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),YW=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),QT=(e,t=[0,0])=>{const{width:n,height:i}=xm(e),r=e.origin??t,s=n*r[0],o=i*r[1];return{x:e.position.x-s,y:e.position.y-o}},Lzt=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((i,r)=>{const s=typeof r=="string";let o=!t.nodeLookup&&!s?r:void 0;t.nodeLookup&&(o=s?t.nodeLookup.get(r):YW(r)?r:t.nodeLookup.get(r.id));const l=o?AP(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return OL(i,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return kL(n)},zT=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},i=!1;return e.forEach(r=>{(t.filter===void 0||t.filter(r))&&(n=OL(n,AP(r)),i=!0)}),i?kL(n):{x:0,y:0,width:0,height:0}},ZW=(e,t,[n,i,r]=[0,0,1],s=!1,o=!1)=>{const l={...xO(t,[n,i,r]),width:t.width/r,height:t.height/r},c=[];for(const u of e.values()){const{measured:d,selectable:f=!0,hidden:h=!1}=u;if(o&&!f||h)continue;const m=d.width??u.width??u.initialWidth??null,g=d.height??u.height??u.initialHeight??null,b=cA(l,S1(u)),v=(m??0)*(g??0),y=s&&b>0;(!u.internals.handleBounds||y||b>=v||u.dragging)&&c.push(u)}return c},$zt=(e,t)=>{const n=new Set;return e.forEach(i=>{n.add(i.id)}),t.filter(i=>n.has(i.source)||n.has(i.target))};function Fzt(e,t){const n=new Map,i=t!=null&&t.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{r.measured.width&&r.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!r.hidden)&&(!i||i.has(r.id))&&n.set(r.id,r)}),n}async function Bzt({nodes:e,width:t,height:n,panZoom:i,minZoom:r,maxZoom:s},o){if(e.size===0)return!0;const l=Fzt(e,o),c=zT(l),u=eK(c,t,n,(o==null?void 0:o.minZoom)??r,(o==null?void 0:o.maxZoom)??s,(o==null?void 0:o.padding)??.1);return await i.setViewport(u,{duration:o==null?void 0:o.duration,ease:o==null?void 0:o.ease,interpolate:o==null?void 0:o.interpolate}),!0}function w8e({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:i=[0,0],nodeExtent:r,onError:s}){const o=n.get(e),l=o.parentId?n.get(o.parentId):void 0,{x:c,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},d=o.origin??i;let f=o.extent||r;if(o.extent==="parent"&&!o.expandParent)if(!l)s==null||s("005",kf.error005());else{const m=l.measured.width,g=l.measured.height;m&&g&&(f=[[c,u],[c+m,u+g]])}else l&&j0(o.extent)&&(f=[[o.extent[0][0]+c,o.extent[0][1]+u],[o.extent[1][0]+c,o.extent[1][1]+u]]);const h=j0(f)?_0(t,f,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(s==null||s("015",kf.error015())),{position:{x:h.x-c+(o.measured.width??0)*d[0],y:h.y-u+(o.measured.height??0)*d[1]},positionAbsolute:h}}async function Uzt({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:i,onBeforeDelete:r}){const s=new Set(e.map(h=>h.id)),o=[];for(const h of n){if(h.deletable===!1)continue;const m=s.has(h.id),g=!m&&h.parentId&&o.find(b=>b.id===h.parentId);(m||g)&&o.push(h)}const l=new Set(t.map(h=>h.id)),c=i.filter(h=>h.deletable!==!1),d=$zt(o,c);for(const h of c)l.has(h.id)&&!d.find(g=>g.id===h.id)&&d.push(h);if(!r)return{edges:d,nodes:o};const f=await r({nodes:o,edges:d});return typeof f=="boolean"?f?{edges:d,nodes:o}:{edges:[],nodes:[]}:f}const k1=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),_0=(e={x:0,y:0},t,n)=>({x:k1(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:k1(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function O8e(e,t,n){const{width:i,height:r}=xm(n),{x:s,y:o}=n.internals.positionAbsolute;return _0(e,[[s,o],[s+i,o+r]],t)}const Nae=(e,t,n)=>en?-k1(Math.abs(e-n),1,t)/t:0,JW=(e,t,n=15,i=40)=>{const r=Nae(e.x,i,t.width-i)*n,s=Nae(e.y,i,t.height-i)*n;return[r,s]},OL=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),D7=({x:e,y:t,width:n,height:i})=>({x:e,y:t,x2:e+n,y2:t+i}),kL=({x:e,y:t,x2:n,y2:i})=>({x:e,y:t,width:n-e,height:i-t}),S1=(e,t=[0,0])=>{var r,s;const{x:n,y:i}=YW(e)?e.internals.positionAbsolute:QT(e,t);return{x:n,y:i,width:((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0,height:((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0}},AP=(e,t=[0,0])=>{var r,s;const{x:n,y:i}=YW(e)?e.internals.positionAbsolute:QT(e,t);return{x:n,y:i,x2:n+(((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0),y2:i+(((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0)}},k8e=(e,t)=>kL(OL(D7(e),D7(t))),cA=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),i=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*i)},Rae=e=>uf(e.width)&&uf(e.height)&&uf(e.x)&&uf(e.y),uf=e=>!isNaN(e)&&isFinite(e),S8e=(e,t)=>(n,i)=>{},VT=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),xO=({x:e,y:t},[n,i,r],s=!1,o=[1,1])=>{const l={x:(e-n)/r,y:(t-i)/r};return s?VT(l,o):l},E1=({x:e,y:t},[n,i,r])=>({x:e*r+n,y:t*r+i});function Vv(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Qzt(e,t,n){if(typeof e=="string"||typeof e=="number"){const i=Vv(e,n),r=Vv(e,t);return{top:i,right:r,bottom:i,left:r,x:r*2,y:i*2}}if(typeof e=="object"){const i=Vv(e.top??e.y??0,n),r=Vv(e.bottom??e.y??0,n),s=Vv(e.left??e.x??0,t),o=Vv(e.right??e.x??0,t);return{top:i,right:o,bottom:r,left:s,x:s+o,y:i+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function zzt(e,t,n,i,r,s){const{x:o,y:l}=E1(e,[t,n,i]),{x:c,y:u}=E1({x:e.x+e.width,y:e.y+e.height},[t,n,i]),d=r-c,f=s-u;return{left:Math.floor(o),top:Math.floor(l),right:Math.floor(d),bottom:Math.floor(f)}}const eK=(e,t,n,i,r,s)=>{const o=Qzt(s,t,n),l=(t-o.x)/e.width,c=(n-o.y)/e.height,u=Math.min(l,c),d=k1(u,i,r),f=e.x+e.width/2,h=e.y+e.height/2,m=t/2-f*d,g=n/2-h*d,b=zzt(e,m,g,d,t,n),v={left:Math.min(b.left-o.left,0),top:Math.min(b.top-o.top,0),right:Math.min(b.right-o.right,0),bottom:Math.min(b.bottom-o.bottom,0)};return{x:m-v.left+v.right,y:g-v.top+v.bottom,zoom:d}},uA=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function j0(e){return e!=null&&e!=="parent"}function xm(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function tK(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function E8e(e,t={width:0,height:0},n,i,r){const s={...e},o=i.get(n);if(o){const l=o.origin||r;s.x+=o.internals.positionAbsolute.x-(t.width??0)*l[0],s.y+=o.internals.positionAbsolute.y-(t.height??0)*l[1]}return s}function Iae(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Vzt(){let e,t;return{promise:new Promise((i,r)=>{e=i,t=r}),resolve:e,reject:t}}function Hzt(e){return{...b8e,...e||{}}}function _E(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:i,containerBounds:r}){const{x:s,y:o}=df(e),l=xO({x:s-((r==null?void 0:r.left)??0),y:o-((r==null?void 0:r.top)??0)},i),{x:c,y:u}=n?VT(l,t):l;return{xSnapped:c,ySnapped:u,...l}}const nK=e=>({width:e.offsetWidth,height:e.offsetHeight}),C8e=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},qzt=["INPUT","SELECT","TEXTAREA"];function A8e(e){var i,r;const t=((r=(i=e.composedPath)==null?void 0:i.call(e))==null?void 0:r[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:qzt.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const T8e=e=>"clientX"in e,df=(e,t)=>{var s,o;const n=T8e(e),i=n?e.clientX:(s=e.touches)==null?void 0:s[0].clientX,r=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:i-((t==null?void 0:t.left)??0),y:r-((t==null?void 0:t.top)??0)}},Pae=(e,t,n,i,r)=>{const s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(o=>{const l=o.getBoundingClientRect();return{id:o.getAttribute("data-handleid"),type:e,nodeId:r,position:o.getAttribute("data-handlepos"),x:(l.left-n.left)/i,y:(l.top-n.top)/i,...nK(o)}})};function _8e({sourceX:e,sourceY:t,targetX:n,targetY:i,sourceControlX:r,sourceControlY:s,targetControlX:o,targetControlY:l}){const c=e*.125+r*.375+o*.375+n*.125,u=t*.125+s*.375+l*.375+i*.125,d=Math.abs(c-e),f=Math.abs(u-t);return[c,u,d,f]}function gj(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Dae({pos:e,x1:t,y1:n,x2:i,y2:r,c:s}){switch(e){case vn.Left:return[t-gj(t-i,s),n];case vn.Right:return[t+gj(i-t,s),n];case vn.Top:return[t,n-gj(n-r,s)];case vn.Bottom:return[t,n+gj(r-n,s)]}}function j8e({sourceX:e,sourceY:t,sourcePosition:n=vn.Bottom,targetX:i,targetY:r,targetPosition:s=vn.Top,curvature:o=.25}){const[l,c]=Dae({pos:n,x1:e,y1:t,x2:i,y2:r,c:o}),[u,d]=Dae({pos:s,x1:i,y1:r,x2:e,y2:t,c:o}),[f,h,m,g]=_8e({sourceX:e,sourceY:t,targetX:i,targetY:r,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${e},${t} C${l},${c} ${u},${d} ${i},${r}`,f,h,m,g]}function N8e({sourceX:e,sourceY:t,targetX:n,targetY:i}){const r=Math.abs(n-e)/2,s=n0}const Gzt=({source:e,sourceHandle:t,target:n,targetHandle:i})=>`xy-edge__${e}${t||""}-${n}${i||""}`,Xzt=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),Yzt=(e,t,n={})=>{var s;if(!e.source||!e.target)return(s=n.onError)==null||s.call(n,"006",kf.error006()),t;const i=n.getEdgeId||Gzt;let r;return x8e(e)?r={...e}:r={...e,id:i(e)},Xzt(r,t)?t:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,t.concat(r))};function R8e({sourceX:e,sourceY:t,targetX:n,targetY:i}){const[r,s,o,l]=N8e({sourceX:e,sourceY:t,targetX:n,targetY:i});return[`M ${e},${t}L ${n},${i}`,r,s,o,l]}const Mae={[vn.Left]:{x:-1,y:0},[vn.Right]:{x:1,y:0},[vn.Top]:{x:0,y:-1},[vn.Bottom]:{x:0,y:1}},Zzt=({source:e,sourcePosition:t=vn.Bottom,target:n})=>t===vn.Left||t===vn.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Jzt({source:e,sourcePosition:t=vn.Bottom,target:n,targetPosition:i=vn.Top,center:r,offset:s,stepPosition:o}){const l=Mae[t],c=Mae[i],u={x:e.x+l.x*s,y:e.y+l.y*s},d={x:n.x+c.x*s,y:n.y+c.y*s},f=Zzt({source:u,sourcePosition:t,target:d}),h=f.x!==0?"x":"y",m=f[h];let g=[],b,v;const y={x:0,y:0},w={x:0,y:0},[,,x,O]=N8e({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[h]*c[h]===-1){h==="x"?(b=r.x??u.x+(d.x-u.x)*o,v=r.y??(u.y+d.y)/2):(b=r.x??(u.x+d.x)/2,v=r.y??u.y+(d.y-u.y)*o);const E=[{x:b,y:u.y},{x:b,y:d.y}],j=[{x:u.x,y:v},{x:d.x,y:v}];l[h]===m?g=h==="x"?E:j:g=h==="x"?j:E}else{const E=[{x:u.x,y:d.y}],j=[{x:d.x,y:u.y}];if(h==="x"?g=l.x===m?j:E:g=l.y===m?E:j,t===i){const P=Math.abs(e[h]-n[h]);if(P<=s){const I=Math.min(s-1,s-P);l[h]===m?y[h]=(u[h]>e[h]?-1:1)*I:w[h]=(d[h]>n[h]?-1:1)*I}}if(t!==i){const P=h==="x"?"y":"x",I=l[h]===c[P],D=u[P]>d[P],_=u[P]=N?(b=(T.x+R.x)/2,v=g[0].y):(b=g[0].x,v=(T.y+R.y)/2)}const k={x:u.x+y.x,y:u.y+y.y},S={x:d.x+w.x,y:d.y+w.y};return[[e,...k.x!==g[0].x||k.y!==g[0].y?[k]:[],...g,...S.x!==g[g.length-1].x||S.y!==g[g.length-1].y?[S]:[],n],b,v,x,O]}function eVt(e,t,n,i){const r=Math.min(Lae(e,t)/2,Lae(t,n)/2,i),{x:s,y:o}=t;if(e.x===s&&s===n.x||e.y===o&&o===n.y)return`L${s} ${o}`;if(e.y===o){const u=e.xn.id===t):e[0])||null}function M7(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`:""}function nVt(e,{id:t,defaultColor:n,defaultMarkerStart:i,defaultMarkerEnd:r}){const s=new Set;return e.reduce((o,l)=>([l.markerStart||i,l.markerEnd||r].forEach(c=>{if(c&&typeof c=="object"){const u=M7(c,t);s.has(u)||(o.push({id:u,color:c.color||n,...c}),s.add(u))}}),o),[]).sort((o,l)=>o.id.localeCompare(l.id))}const I8e=1e3,iVt=10,iK={nodeOrigin:[0,0],nodeExtent:aA,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},rVt={...iK,checkEquality:!0};function rK(e,t){const n={...e};for(const i in t)t[i]!==void 0&&(n[i]=t[i]);return n}function sVt(e,t,n){const i=rK(iK,n);for(const r of e.values())if(r.parentId)aK(r,e,t,i);else{const s=QT(r,i.nodeOrigin),o=j0(r.extent)?r.extent:i.nodeExtent,l=_0(s,o,xm(r));r.internals.positionAbsolute=l}}function aVt(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],i=[];for(const r of e.handles){const s={id:r.id,width:r.width??1,height:r.height??1,nodeId:e.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?n.push(s):r.type==="target"&&i.push(s)}return{source:n,target:i}}function sK(e){return e==="manual"}function L7(e,t,n,i={}){var d,f;const r=rK(rVt,i),s={i:0},o=new Map(t),l=r!=null&&r.elevateNodesOnSelect&&!sK(r.zIndexMode)?I8e:0;let c=e.length>0,u=!1;t.clear(),n.clear();for(const h of e){let m=o.get(h.id);if(r.checkEquality&&h===(m==null?void 0:m.internals.userNode))t.set(h.id,m);else{const g=QT(h,r.nodeOrigin),b=j0(h.extent)?h.extent:r.nodeExtent,v=_0(g,b,xm(h));m={...r.defaults,...h,measured:{width:(d=h.measured)==null?void 0:d.width,height:(f=h.measured)==null?void 0:f.height},internals:{positionAbsolute:v,handleBounds:aVt(h,m),z:P8e(h,l,r.zIndexMode),userNode:h}},t.set(h.id,m)}(m.measured===void 0||m.measured.width===void 0||m.measured.height===void 0)&&!m.hidden&&(c=!1),h.parentId&&aK(m,t,n,i,s),u||(u=h.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:u}}function oVt(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function aK(e,t,n,i,r){const{elevateNodesOnSelect:s,nodeOrigin:o,nodeExtent:l,zIndexMode:c}=rK(iK,i),u=e.parentId,d=t.get(u);if(!d){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}oVt(e,n),r&&!d.parentId&&d.internals.rootParentIndex===void 0&&c==="auto"&&(d.internals.rootParentIndex=++r.i,d.internals.z=d.internals.z+r.i*iVt),r&&d.internals.rootParentIndex!==void 0&&(r.i=d.internals.rootParentIndex);const f=s&&!sK(c)?I8e:0,{x:h,y:m,z:g}=lVt(e,d,o,l,f,c),{positionAbsolute:b}=e.internals,v=h!==b.x||m!==b.y;(v||g!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:h,y:m}:b,z:g}})}function P8e(e,t,n){const i=uf(e.zIndex)?e.zIndex:0;return sK(n)?i:i+(e.selected?t:0)}function lVt(e,t,n,i,r,s){const{x:o,y:l}=t.internals.positionAbsolute,c=xm(e),u=QT(e,n),d=j0(e.extent)?_0(u,e.extent,c):u;let f=_0({x:o+d.x,y:l+d.y},i,c);e.extent==="parent"&&(f=O8e(f,c,t));const h=P8e(e,r,s),m=t.internals.z??0;return{x:f.x,y:f.y,z:m>=h?m+1:h}}function oK(e,t,n,i=[0,0]){var o;const r=[],s=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const u=((o=s.get(l.parentId))==null?void 0:o.expandedRect)??S1(c),d=k8e(u,l.rect);s.set(l.parentId,{expandedRect:d,parent:c})}return s.size>0&&s.forEach(({expandedRect:l,parent:c},u)=>{var x;const d=c.internals.positionAbsolute,f=xm(c),h=c.origin??i,m=l.x0||g>0||y||w)&&(r.push({id:u,type:"position",position:{x:c.position.x-m+y,y:c.position.y-g+w}}),(x=n.get(u))==null||x.forEach(O=>{e.some(k=>k.id===O.id)||r.push({id:O.id,type:"position",position:{x:O.position.x+m,y:O.position.y+g}})})),(f.width0){const m=oK(h,t,n,r);u.push(...m)}return{changes:u,updatedInternals:c}}async function uVt({delta:e,panZoom:t,transform:n,translateExtent:i,width:r,height:s}){if(!t||!e.x&&!e.y)return!1;const o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,s]],i);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function Uae(e,t,n,i,r,s){let o=r;const l=i.get(o)||new Map;i.set(o,l.set(n,t)),o=`${r}-${e}`;const c=i.get(o)||new Map;if(i.set(o,c.set(n,t)),s){o=`${r}-${e}-${s}`;const u=i.get(o)||new Map;i.set(o,u.set(n,t))}}function D8e(e,t,n){e.clear(),t.clear();for(const i of n){const{source:r,target:s,sourceHandle:o=null,targetHandle:l=null}=i,c={edgeId:i.id,source:r,target:s,sourceHandle:o,targetHandle:l},u=`${r}-${o}--${s}-${l}`,d=`${s}-${l}--${r}-${o}`;Uae("source",c,d,e,r,o),Uae("target",c,u,e,s,l),t.set(i.id,i)}}function M8e(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:M8e(n,t):!1}function Qae(e,t,n){var r;let i=e;do{if((r=i==null?void 0:i.matches)!=null&&r.call(i,t))return!0;if(i===n)return!1;i=i==null?void 0:i.parentElement}while(i);return!1}function dVt(e,t,n,i){const r=new Map;for(const[s,o]of e)if((o.selected||o.id===i)&&(!o.parentId||!M8e(o,e))&&(o.draggable||t&&typeof o.draggable>"u")){const l=e.get(s);l&&r.set(s,{id:s,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return r}function Y$({nodeId:e,dragItems:t,nodeLookup:n,dragging:i=!0}){var o,l,c;const r=[];for(const[u,d]of t){const f=(o=n.get(u))==null?void 0:o.internals.userNode;f&&r.push({...f,position:d.position,dragging:i})}if(!e)return[r[0],r];const s=(l=n.get(e))==null?void 0:l.internals.userNode;return[s?{...s,position:((c=t.get(e))==null?void 0:c.position)||s.position,dragging:i}:r[0],r]}function fVt({dragItems:e,snapGrid:t,x:n,y:i}){const r=e.values().next().value;if(!r)return null;const s={x:n-r.distance.x,y:i-r.distance.y},o=VT(s,t);return{x:o.x-s.x,y:o.y-s.y}}function hVt({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:i,onDragStop:r}){let s={x:null,y:null},o=0,l=new Map,c=!1,u={x:0,y:0},d=null,f=!1,h=null,m=!1,g=!1,b=null;function v({noDragClassName:w,handleSelector:x,domNode:O,isSelectable:k,nodeId:S,nodeClickDistance:C=0}){h=vu(O);function E({x:A,y:N}){const{nodeLookup:P,nodeExtent:I,snapGrid:D,snapToGrid:_,nodeOrigin:L,onNodeDrag:F,onSelectionDrag:M,onError:V,updateNodePositions:q}=t();s={x:A,y:N};let U=!1;const J=l.size>1,z=J&&I?D7(zT(l)):null,Z=J&&_?fVt({dragItems:l,snapGrid:D,x:A,y:N}):null;for(const[ne,W]of l){if(!P.has(ne))continue;let G={x:A-W.distance.x,y:N-W.distance.y};_&&(G=Z?{x:Math.round(G.x+Z.x),y:Math.round(G.y+Z.y)}:VT(G,D));let H=null;if(J&&I&&!W.extent&&z){const{positionAbsolute:X}=W.internals,ie=X.x-z.x+I[0][0],ee=X.x+W.measured.width-z.x2+I[1][0],be=X.y-z.y+I[0][1],ue=X.y+W.measured.height-z.y2+I[1][1];H=[[ie,be],[ee,ue]]}const{position:se,positionAbsolute:Y}=w8e({nodeId:ne,nextPosition:G,nodeLookup:P,nodeExtent:H||I,nodeOrigin:L,onError:V});U=U||W.position.x!==se.x||W.position.y!==se.y,W.position=se,W.internals.positionAbsolute=Y}if(g=g||U,!!U&&(q(l,!0),b&&(i||F||!S&&M))){const[ne,W]=Y$({nodeId:S,dragItems:l,nodeLookup:P});i==null||i(b,l,ne,W),F==null||F(b,ne,W),S||M==null||M(b,W)}}async function j(){if(!d)return;const{transform:A,panBy:N,autoPanSpeed:P,autoPanOnNodeDrag:I}=t();if(!I){c=!1,cancelAnimationFrame(o);return}const[D,_]=JW(u,d,P);(D!==0||_!==0)&&(s.x=(s.x??0)-D/A[2],s.y=(s.y??0)-_/A[2],await N({x:D,y:_})&&E(s)),o=requestAnimationFrame(j)}function T(A){var J;const{nodeLookup:N,multiSelectionActive:P,nodesDraggable:I,transform:D,snapGrid:_,snapToGrid:L,selectNodesOnDrag:F,onNodeDragStart:M,onSelectionDragStart:V,unselectNodesAndEdges:q}=t();f=!0,(!F||!k)&&!P&&S&&((J=N.get(S))!=null&&J.selected||q()),k&&F&&S&&(e==null||e(S));const U=_E(A.sourceEvent,{transform:D,snapGrid:_,snapToGrid:L,containerBounds:d});if(s=U,l=dVt(N,I,U,S),l.size>0&&(n||M||!S&&V)){const[z,Z]=Y$({nodeId:S,dragItems:l,nodeLookup:N});n==null||n(A.sourceEvent,l,z,Z),M==null||M(A.sourceEvent,z,Z),S||V==null||V(A.sourceEvent,Z)}}const R=JFe().clickDistance(C).on("start",A=>{const{domNode:N,nodeDragThreshold:P,transform:I,snapGrid:D,snapToGrid:_}=t();d=(N==null?void 0:N.getBoundingClientRect())||null,m=!1,g=!1,b=A.sourceEvent,P===0&&T(A),s=_E(A.sourceEvent,{transform:I,snapGrid:D,snapToGrid:_,containerBounds:d}),u=df(A.sourceEvent,d)}).on("drag",A=>{const{autoPanOnNodeDrag:N,transform:P,snapGrid:I,snapToGrid:D,nodeDragThreshold:_,nodeLookup:L}=t(),F=_E(A.sourceEvent,{transform:P,snapGrid:I,snapToGrid:D,containerBounds:d});if(b=A.sourceEvent,(A.sourceEvent.type==="touchmove"&&A.sourceEvent.touches.length>1||S&&!L.has(S))&&(m=!0),!m){if(!c&&N&&f&&(c=!0,j()),!f){const M=df(A.sourceEvent,d),V=M.x-u.x,q=M.y-u.y;Math.sqrt(V*V+q*q)>_&&T(A)}(s.x!==F.xSnapped||s.y!==F.ySnapped)&&l&&f&&(u=df(A.sourceEvent,d),E(F))}}).on("end",A=>{if(!f||m){m&&l.size>0&&t().updateNodePositions(l,!1);return}if(c=!1,f=!1,cancelAnimationFrame(o),l.size>0){const{nodeLookup:N,updateNodePositions:P,onNodeDragStop:I,onSelectionDragStop:D}=t();if(g&&(P(l,!1),g=!1),r||I||!S&&D){const[_,L]=Y$({nodeId:S,dragItems:l,nodeLookup:N,dragging:!1});r==null||r(A.sourceEvent,l,_,L),I==null||I(A.sourceEvent,_,L),S||D==null||D(A.sourceEvent,L)}}}).filter(A=>{const N=A.target;return!A.button&&(!w||!Qae(N,`.${w}`,O))&&(!x||Qae(N,x,O))});h.call(R)}function y(){h==null||h.on(".drag",null)}return{update:v,destroy:y}}function pVt(e,t,n){const i=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const s of t.values())cA(r,S1(s))>0&&i.push(s);return i}const mVt=250;function gVt(e,t,n,i){var l,c;let r=[],s=1/0;const o=pVt(e,n,t+mVt);for(const u of o){const d=[...((l=u.internals.handleBounds)==null?void 0:l.source)??[],...((c=u.internals.handleBounds)==null?void 0:c.target)??[]];for(const f of d){if(i.nodeId===f.nodeId&&i.type===f.type&&i.id===f.id)continue;const{x:h,y:m}=N0(u,f,f.position,!0),g=Math.sqrt(Math.pow(h-e.x,2)+Math.pow(m-e.y,2));g>t||(g1){const u=i.type==="source"?"target":"source";return r.find(d=>d.type===u)??r[0]}return r[0]}function L8e(e,t,n,i,r,s=!1){var u,d,f;const o=i.get(e);if(!o)return null;const l=r==="strict"?(u=o.internals.handleBounds)==null?void 0:u[t]:[...((d=o.internals.handleBounds)==null?void 0:d.source)??[],...((f=o.internals.handleBounds)==null?void 0:f.target)??[]],c=(n?l==null?void 0:l.find(h=>h.id===n):l==null?void 0:l[0])??null;return c&&s?{...c,...N0(o,c,c.position,!0)}:c}function $8e(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function bVt(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const F8e=()=>!0;function yVt(e,{connectionMode:t,connectionRadius:n,handleId:i,nodeId:r,edgeUpdaterType:s,isTarget:o,domNode:l,nodeLookup:c,lib:u,autoPanOnConnect:d,flowId:f,panBy:h,cancelConnection:m,onConnectStart:g,onConnect:b,onConnectEnd:v,isValidConnection:y=F8e,onReconnectEnd:w,updateConnection:x,getTransform:O,getFromHandle:k,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:E}){const j=C8e(e.target);let T=0,R;const{x:A,y:N}=df(e),P=$8e(s,E),I=l==null?void 0:l.getBoundingClientRect();let D=!1;if(!I||!P)return;const _=L8e(r,P,i,c,t);if(!_)return;let L=df(e,I),F=!1,M=null,V=!1,q=null;function U(){if(!d||!I)return;const[se,Y]=JW(L,I,S);h({x:se,y:Y}),T=requestAnimationFrame(U)}const J={..._,nodeId:r,type:P,position:_.position},z=c.get(r);let ne={inProgress:!0,isValid:null,from:N0(z,J,vn.Left,!0),fromHandle:J,fromPosition:J.position,fromNode:z,to:L,toHandle:null,toPosition:jae[J.position],toNode:null,pointer:L};function W(){D=!0,x(ne),g==null||g(e,{nodeId:r,handleId:i,handleType:P})}C===0&&W();function G(se){if(!D){const{x:ue,y:pe}=df(se),ke=ue-A,je=pe-N;if(!(ke*ke+je*je>C*C))return;W()}if(!k()||!J){H(se);return}const Y=O();L=df(se,I),R=gVt(xO(L,Y,!1,[1,1]),n,c,J),F||(U(),F=!0);const X=B8e(se,{handle:R,connectionMode:t,fromNodeId:r,fromHandleId:i,fromType:o?"target":"source",isValidConnection:y,doc:j,lib:u,flowId:f,nodeLookup:c});q=X.handleDomNode,M=X.connection,V=bVt(!!R,X.isValid);const ie=c.get(r),ee=ie?N0(ie,J,vn.Left,!0):ne.from,be={...ne,from:ee,isValid:V,to:X.toHandle&&V?E1({x:X.toHandle.x,y:X.toHandle.y},Y):L,toHandle:X.toHandle,toPosition:V&&X.toHandle?X.toHandle.position:jae[J.position],toNode:X.toHandle?c.get(X.toHandle.nodeId):null,pointer:L};x(be),ne=be}function H(se){if(!("touches"in se&&se.touches.length>0)){if(D){(R||q)&&M&&V&&(b==null||b(M));const{inProgress:Y,...X}=ne,ie={...X,toPosition:ne.toHandle?ne.toPosition:null};v==null||v(se,ie),s&&(w==null||w(se,ie))}m(),cancelAnimationFrame(T),F=!1,V=!1,M=null,q=null,j.removeEventListener("mousemove",G),j.removeEventListener("mouseup",H),j.removeEventListener("touchmove",G),j.removeEventListener("touchend",H)}}j.addEventListener("mousemove",G),j.addEventListener("mouseup",H),j.addEventListener("touchmove",G),j.addEventListener("touchend",H)}function B8e(e,{handle:t,connectionMode:n,fromNodeId:i,fromHandleId:r,fromType:s,doc:o,lib:l,flowId:c,isValidConnection:u=F8e,nodeLookup:d}){const f=s==="target",h=t?o.querySelector(`.${l}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:m,y:g}=df(e),b=o.elementFromPoint(m,g),v=b!=null&&b.classList.contains(`${l}-flow__handle`)?b:h,y={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const w=$8e(void 0,v),x=v.getAttribute("data-nodeid"),O=v.getAttribute("data-handleid"),k=v.classList.contains("connectable"),S=v.classList.contains("connectableend");if(!x||!w)return y;const C={source:f?x:i,sourceHandle:f?O:r,target:f?i:x,targetHandle:f?r:O};y.connection=C;const j=k&&S&&(n===O1.Strict?f&&w==="source"||!f&&w==="target":x!==i||O!==r);y.isValid=j&&u(C),y.toHandle=L8e(x,w,O,d,n,!0)}return y}const $7={onPointerDown:yVt,isValid:B8e};function vVt({domNode:e,panZoom:t,getTransform:n,getViewScale:i}){const r=vu(e);function s({translateExtent:l,width:c,height:u,zoomStep:d=1,pannable:f=!0,zoomable:h=!0,inversePan:m=!1}){const g=x=>{if(x.sourceEvent.type!=="wheel"||!t)return;const O=n(),k=x.sourceEvent.ctrlKey&&uA()?10:1,S=-x.sourceEvent.deltaY*(x.sourceEvent.deltaMode===1?.05:x.sourceEvent.deltaMode?1:.002)*d,C=O[2]*Math.pow(2,S*k);t.scaleTo(C)};let b=[0,0];const v=x=>{(x.sourceEvent.type==="mousedown"||x.sourceEvent.type==="touchstart")&&(b=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY])},y=x=>{const O=n();if(x.sourceEvent.type!=="mousemove"&&x.sourceEvent.type!=="touchmove"||!t)return;const k=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY],S=[k[0]-b[0],k[1]-b[1]];b=k;const C=i()*Math.max(O[2],Math.log(O[2]))*(m?-1:1),E={x:O[0]-S[0]*C,y:O[1]-S[1]*C},j=[[0,0],[c,u]];t.setViewportConstrained({x:E.x,y:E.y,zoom:O[2]},j,l)},w=m8e().on("start",v).on("zoom",f?y:null).on("zoom.wheel",h?g:null);r.call(w,{})}function o(){r.on("zoom",null)}return{update:s,destroy:o,pointer:tf}}const SL=e=>({x:e.x,y:e.y,zoom:e.k}),Z$=({x:e,y:t,zoom:n})=>wL.translate(e,t).scale(n),Qx=(e,t)=>e.target.closest(`.${t}`),U8e=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),xVt=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,J$=(e,t=0,n=xVt,i=()=>{})=>{const r=typeof t=="number"&&t>0;return r||i(),r?e.transition().duration(t).ease(n).on("end",i):e},Q8e=e=>{const t=e.ctrlKey&&uA()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function wVt({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:i,panOnScrollMode:r,panOnScrollSpeed:s,zoomOnPinch:o,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:u}){return d=>{if(Qx(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(d.ctrlKey&&o){const v=tf(d),y=Q8e(d),w=f*Math.pow(2,y);i.scaleTo(n,w,v,d);return}const h=d.deltaMode===1?20:1;let m=r===t0.Vertical?0:d.deltaX*h,g=r===t0.Horizontal?0:d.deltaY*h;!uA()&&d.shiftKey&&r!==t0.Vertical&&(m=d.deltaY*h,g=0),i.translateBy(n,-(m/f)*s,-(g/f)*s,{internal:!0});const b=SL(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(d,b),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,b),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(d,b))}}function OVt({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(i,r){const s=i.type==="wheel",o=!t&&s&&!i.ctrlKey,l=Qx(i,e);if(i.ctrlKey&&s&&l&&i.preventDefault(),o||l)return null;i.preventDefault(),n.call(this,i,r)}}function kVt({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return i=>{var s,o,l;if((s=i.sourceEvent)!=null&&s.internal)return;const r=SL(i.transform);e.mouseButton=((o=i.sourceEvent)==null?void 0:o.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=r,((l=i.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(i.sourceEvent,r))}}function SVt({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:i,onPanZoom:r}){return s=>{var o,l;e.usedRightMouseButton=!!(n&&U8e(t,e.mouseButton??0)),(o=s.sourceEvent)!=null&&o.sync||i([s.transform.x,s.transform.y,s.transform.k]),r&&!((l=s.sourceEvent)!=null&&l.internal)&&(r==null||r(s.sourceEvent,SL(s.transform)))}}function EVt({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:i,onPanZoomEnd:r,onPaneContextMenu:s}){return o=>{var l;if(!((l=o.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,s&&U8e(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&s(o.sourceEvent),e.usedRightMouseButton=!1,i(!1),r)){const c=SL(o.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r==null||r(o.sourceEvent,c)},n?150:0)}}}function CVt({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:i,panOnScroll:r,zoomOnDoubleClick:s,userSelectionActive:o,noWheelClassName:l,noPanClassName:c,lib:u,connectionInProgress:d}){return f=>{var v;const h=e||t,m=n&&f.ctrlKey,g=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(Qx(f,`${u}-flow__node`)||Qx(f,`${u}-flow__edge`)))return!0;if(!i&&!h&&!r&&!s&&!n||o||d&&!g||Qx(f,l)&&g||Qx(f,c)&&(!g||r&&g&&!e)||!n&&f.ctrlKey&&g)return!1;if(!n&&f.type==="touchstart"&&((v=f.touches)==null?void 0:v.length)>1)return f.preventDefault(),!1;if(!h&&!r&&!m&&g||!i&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(i)&&!i.includes(f.button)&&f.type==="mousedown")return!1;const b=Array.isArray(i)&&i.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||g)&&b}}function AVt({domNode:e,minZoom:t,maxZoom:n,translateExtent:i,viewport:r,onPanZoom:s,onPanZoomStart:o,onPanZoomEnd:l,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=m8e().scaleExtent([t,n]).translateExtent(i),h=vu(e).call(f);w({x:r.x,y:r.y,zoom:k1(r.zoom,t,n)},[[0,0],[d.width,d.height]],i);const m=h.on("wheel.zoom"),g=h.on("dblclick.zoom");f.wheelDelta(Q8e);async function b(R,A){return h?new Promise(N=>{f==null||f.interpolate((A==null?void 0:A.interpolate)==="linear"?TE:ZN).transform(J$(h,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>N(!0)),R)}):!1}function v({noWheelClassName:R,noPanClassName:A,onPaneContextMenu:N,userSelectionActive:P,panOnScroll:I,panOnDrag:D,panOnScrollMode:_,panOnScrollSpeed:L,preventScrolling:F,zoomOnPinch:M,zoomOnScroll:V,zoomOnDoubleClick:q,zoomActivationKeyPressed:U,lib:J,onTransformChange:z,connectionInProgress:Z,paneClickDistance:ne,selectionOnDrag:W}){P&&!u.isZoomingOrPanning&&y();const G=I&&!U&&!P;f.clickDistance(W?1/0:!uf(ne)||ne<0?0:ne);const H=G?wVt({zoomPanValues:u,noWheelClassName:R,d3Selection:h,d3Zoom:f,panOnScrollMode:_,panOnScrollSpeed:L,zoomOnPinch:M,onPanZoomStart:o,onPanZoom:s,onPanZoomEnd:l}):OVt({noWheelClassName:R,preventScrolling:F,d3ZoomHandler:m});h.on("wheel.zoom",H,{passive:!1});const se=kVt({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:o});f.on("start",se);const Y=SVt({zoomPanValues:u,panOnDrag:D,onPaneContextMenu:!!N,onPanZoom:s,onTransformChange:z});f.on("zoom",Y);const X=EVt({zoomPanValues:u,panOnDrag:D,panOnScroll:I,onPaneContextMenu:N,onPanZoomEnd:l,onDraggingChange:c});f.on("end",X);const ie=CVt({zoomActivationKeyPressed:U,panOnDrag:D,zoomOnScroll:V,panOnScroll:I,zoomOnDoubleClick:q,zoomOnPinch:M,userSelectionActive:P,noPanClassName:A,noWheelClassName:R,lib:J,connectionInProgress:Z});f.filter(ie),q?h.on("dblclick.zoom",g):h.on("dblclick.zoom",null)}function y(){f.on("zoom",null)}async function w(R,A,N){const P=Z$(R),I=f==null?void 0:f.constrain()(P,A,N);return I&&await b(I),I}async function x(R,A){const N=Z$(R);return await b(N,A),N}function O(R){if(h){const A=Z$(R),N=h.property("__zoom");(N.k!==R.zoom||N.x!==R.x||N.y!==R.y)&&(f==null||f.transform(h,A,null,{sync:!0}))}}function k(){const R=h?p8e(h.node()):{x:0,y:0,k:1};return{x:R.x,y:R.y,zoom:R.k}}async function S(R,A){return h?new Promise(N=>{f==null||f.interpolate((A==null?void 0:A.interpolate)==="linear"?TE:ZN).scaleTo(J$(h,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>N(!0)),R)}):!1}async function C(R,A){return h?new Promise(N=>{f==null||f.interpolate((A==null?void 0:A.interpolate)==="linear"?TE:ZN).scaleBy(J$(h,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>N(!0)),R)}):!1}function E(R){f==null||f.scaleExtent(R)}function j(R){f==null||f.translateExtent(R)}function T(R){const A=!uf(R)||R<0?0:R;f==null||f.clickDistance(A)}return{update:v,destroy:y,setViewport:x,setViewportConstrained:w,getViewport:k,scaleTo:S,scaleBy:C,setScaleExtent:E,setTranslateExtent:j,syncViewport:O,setClickDistance:T}}var C1;(function(e){e.Line="line",e.Handle="handle"})(C1||(C1={}));function TVt({width:e,prevWidth:t,height:n,prevHeight:i,affectsX:r,affectsY:s}){const o=e-t,l=n-i,c=[o>0?1:o<0?-1:0,l>0?1:l<0?-1:0];return o&&r&&(c[0]=c[0]*-1),l&&s&&(c[1]=c[1]*-1),c}function zae(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),i=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:i,affectsY:r}}function $m(e,t){return Math.max(0,t-e)}function Fm(e,t){return Math.max(0,e-t)}function bj(e,t,n){return Math.max(0,t-e,e-n)}function Vae(e,t){return e?!t:t}function _Vt(e,t,n,i,r,s,o,l){let{affectsX:c,affectsY:u}=t;const{isHorizontal:d,isVertical:f}=t,h=d&&f,{xSnapped:m,ySnapped:g}=n,{minWidth:b,maxWidth:v,minHeight:y,maxHeight:w}=i,{x,y:O,width:k,height:S,aspectRatio:C}=e;let E=Math.floor(d?m-e.pointerX:0),j=Math.floor(f?g-e.pointerY:0);const T=k+(c?-E:E),R=S+(u?-j:j),A=-s[0]*k,N=-s[1]*S;let P=bj(T,b,v),I=bj(R,y,w);if(o){let L=0,F=0;c&&E<0?L=$m(x+E+A,o[0][0]):!c&&E>0&&(L=Fm(x+T+A,o[1][0])),u&&j<0?F=$m(O+j+N,o[0][1]):!u&&j>0&&(F=Fm(O+R+N,o[1][1])),P=Math.max(P,L),I=Math.max(I,F)}if(l){let L=0,F=0;c&&E>0?L=Fm(x+E,l[0][0]):!c&&E<0&&(L=$m(x+T,l[1][0])),u&&j>0?F=Fm(O+j,l[0][1]):!u&&j<0&&(F=$m(O+R,l[1][1])),P=Math.max(P,L),I=Math.max(I,F)}if(r){if(d){const L=bj(T/C,y,w)*C;if(P=Math.max(P,L),o){let F=0;!c&&!u||c&&!u&&h?F=Fm(O+N+T/C,o[1][1])*C:F=$m(O+N+(c?E:-E)/C,o[0][1])*C,P=Math.max(P,F)}if(l){let F=0;!c&&!u||c&&!u&&h?F=$m(O+T/C,l[1][1])*C:F=Fm(O+(c?E:-E)/C,l[0][1])*C,P=Math.max(P,F)}}if(f){const L=bj(R*C,b,v)/C;if(I=Math.max(I,L),o){let F=0;!c&&!u||u&&!c&&h?F=Fm(x+R*C+A,o[1][0])/C:F=$m(x+(u?j:-j)*C+A,o[0][0])/C,I=Math.max(I,F)}if(l){let F=0;!c&&!u||u&&!c&&h?F=$m(x+R*C,l[1][0])/C:F=Fm(x+(u?j:-j)*C,l[0][0])/C,I=Math.max(I,F)}}}j=j+(j<0?I:-I),E=E+(E<0?P:-P),r&&(h?T>R*C?j=(Vae(c,u)?-E:E)/C:E=(Vae(c,u)?-j:j)*C:d?(j=E/C,u=c):(E=j*C,c=u));const D=c?x+E:x,_=u?O+j:O;return{width:k+(c?-E:E),height:S+(u?-j:j),x:s[0]*E*(c?-1:1)+D,y:s[1]*j*(u?-1:1)+_}}const z8e={width:0,height:0,x:0,y:0},jVt={...z8e,pointerX:0,pointerY:0,aspectRatio:1};function NVt(e,t,n){const i=t.position.x+e.position.x,r=t.position.y+e.position.y,s=e.measured.width??0,o=e.measured.height??0,l=n[0]*s,c=n[1]*o;return[[i-l,r-c],[i+s-l,r+o-c]]}function RVt({domNode:e,nodeId:t,getStoreItems:n,onChange:i,onEnd:r}){const s=vu(e);let o={controlDirection:zae("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:u,boundaries:d,keepAspectRatio:f,resizeDirection:h,onResizeStart:m,onResize:g,onResizeEnd:b,shouldResize:v}){let y={...z8e},w={...jVt};o={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:zae(u)};let x,O=null,k=[],S,C,E,j=!1;const T=JFe().on("start",R=>{const{nodeLookup:A,transform:N,snapGrid:P,snapToGrid:I,nodeOrigin:D,paneDomNode:_}=n();if(x=A.get(t),!x)return;O=(_==null?void 0:_.getBoundingClientRect())??null;const{xSnapped:L,ySnapped:F}=_E(R.sourceEvent,{transform:N,snapGrid:P,snapToGrid:I,containerBounds:O});y={width:x.measured.width??0,height:x.measured.height??0,x:x.position.x??0,y:x.position.y??0},w={...y,pointerX:L,pointerY:F,aspectRatio:y.width/y.height},S=void 0,C=j0(x.extent)?x.extent:void 0,x.parentId&&(x.extent==="parent"||x.expandParent)&&(S=A.get(x.parentId)),S&&x.extent==="parent"&&(C=[[0,0],[S.measured.width,S.measured.height]]),k=[],E=void 0;for(const[M,V]of A)if(V.parentId===t&&(k.push({id:M,position:{...V.position},extent:V.extent}),V.extent==="parent"||V.expandParent)){const q=NVt(V,x,V.origin??D);E?E=[[Math.min(q[0][0],E[0][0]),Math.min(q[0][1],E[0][1])],[Math.max(q[1][0],E[1][0]),Math.max(q[1][1],E[1][1])]]:E=q}m==null||m(R,{...y})}).on("drag",R=>{const{transform:A,snapGrid:N,snapToGrid:P,nodeOrigin:I}=n(),D=_E(R.sourceEvent,{transform:A,snapGrid:N,snapToGrid:P,containerBounds:O}),_=[];if(!x)return;const{x:L,y:F,width:M,height:V}=y,q={},U=x.origin??I,{width:J,height:z,x:Z,y:ne}=_Vt(w,o.controlDirection,D,o.boundaries,o.keepAspectRatio,U,C,E),W=J!==M,G=z!==V,H=Z!==L&&W,se=ne!==F&&G;if(!H&&!se&&!W&&!G)return;if((H||se||U[0]===1||U[1]===1)&&(q.x=H?Z:y.x,q.y=se?ne:y.y,y.x=q.x,y.y=q.y,k.length>0)){const ee=Z-L,be=ne-F;for(const ue of k)ue.position={x:ue.position.x-ee+U[0]*(J-M),y:ue.position.y-be+U[1]*(z-V)},_.push(ue)}if((W||G)&&(q.width=W&&(!o.resizeDirection||o.resizeDirection==="horizontal")?J:y.width,q.height=G&&(!o.resizeDirection||o.resizeDirection==="vertical")?z:y.height,y.width=q.width,y.height=q.height),S&&x.expandParent){const ee=U[0]*(q.width??0);q.x&&q.x{j&&(b==null||b(R,{...y}),r==null||r({...y}),j=!1)});s.call(T)}function c(){s.on(".drag",null)}return{update:l,destroy:c}}const IVt={},Hae=e=>{let t;const n=new Set,i=(d,f)=>{const h=typeof d=="function"?d(t):d;if(!Object.is(h,t)){const m=t;t=f??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(g=>g(t,m))}},r=()=>t,c={setState:i,getState:r,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(IVt?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=t=e(i,r,c);return c},PVt=e=>e?Hae(e):Hae,{useDebugValue:DVt}=ji,{useSyncExternalStoreWithSelector:MVt}=bnt,LVt=e=>e;function V8e(e,t=LVt,n){const i=MVt(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return DVt(i),i}const qae=(e,t)=>{const n=PVt(e),i=(r,s=t)=>V8e(n,r,s);return Object.assign(i,n),i},$Vt=(e,t)=>e?qae(e,t):qae;function zs(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[i,r]of e)if(!Object.is(r,t.get(i)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const i of n)if(!Object.prototype.hasOwnProperty.call(t,i)||!Object.is(e[i],t[i]))return!1;return!0}const EL=p.createContext(null),FVt=EL.Provider,H8e=kf.error001("react");function ir(e,t){const n=p.useContext(EL);if(n===null)throw new Error(H8e);return V8e(n,e,t)}function Vs(){const e=p.useContext(EL);if(e===null)throw new Error(H8e);return p.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Wae={display:"none"},BVt={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},q8e="react-flow__node-desc",W8e="react-flow__edge-desc",UVt="react-flow__aria-live",QVt=e=>e.ariaLiveMessage,zVt=e=>e.ariaLabelConfig;function VVt({rfId:e}){const t=ir(QVt);return a.jsx("div",{id:`${UVt}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:BVt,children:t})}function HVt({rfId:e,disableKeyboardA11y:t}){const n=ir(zVt);return a.jsxs(a.Fragment,{children:[a.jsx("div",{id:`${q8e}-${e}`,style:Wae,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),a.jsx("div",{id:`${W8e}-${e}`,style:Wae,children:n["edge.a11yDescription.default"]}),!t&&a.jsx(VVt,{rfId:e})]})}const CL=p.forwardRef(({position:e="top-left",children:t,className:n,style:i,...r},s)=>{const o=`${e}`.split("-");return a.jsx("div",{className:eo(["react-flow__panel",n,...o]),style:i,ref:s,...r,children:t})});CL.displayName="Panel";function qVt({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:a.jsx(CL,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:a.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const WVt=e=>{const t=[],n=[];for(const[,i]of e.nodeLookup)i.selected&&t.push(i.internals.userNode);for(const[,i]of e.edgeLookup)i.selected&&n.push(i);return{selectedNodes:t,selectedEdges:n}},yj=e=>e.id;function KVt(e,t){return zs(e.selectedNodes.map(yj),t.selectedNodes.map(yj))&&zs(e.selectedEdges.map(yj),t.selectedEdges.map(yj))}function GVt({onSelectionChange:e}){const t=Vs(),{selectedNodes:n,selectedEdges:i}=ir(WVt,KVt);return p.useEffect(()=>{const r={nodes:n,edges:i};e==null||e(r),t.getState().onSelectionChangeHandlers.forEach(s=>s(r))},[n,i,e]),null}const XVt=e=>!!e.onSelectionChangeHandlers;function YVt({onSelectionChange:e}){const t=ir(XVt);return e||t?a.jsx(GVt,{onSelectionChange:e}):null}const K8e=[0,0],ZVt={x:0,y:0,zoom:1},JVt=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],Kae=[...JVt,"rfId"],eHt=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),Gae={translateExtent:aA,nodeOrigin:K8e,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function tHt(e){const{setNodes:t,setEdges:n,setMinZoom:i,setMaxZoom:r,setTranslateExtent:s,setNodeExtent:o,reset:l,setDefaultNodesAndEdges:c}=ir(eHt,zs),u=Vs();p.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{d.current=Gae,l()}),[]);const d=p.useRef(Gae);return p.useEffect(()=>{for(const f of Kae){const h=e[f],m=d.current[f];h!==m&&(typeof e[f]>"u"||(f==="nodes"?t(h):f==="edges"?n(h):f==="minZoom"?i(h):f==="maxZoom"?r(h):f==="translateExtent"?s(h):f==="nodeExtent"?o(h):f==="ariaLabelConfig"?u.setState({ariaLabelConfig:Hzt(h)}):f==="fitView"?u.setState({fitViewQueued:h}):f==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[f]:h})))}d.current=e},Kae.map(f=>e[f])),null}function Xae(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function nHt(e){var i;const[t,n]=p.useState(e==="system"?null:e);return p.useEffect(()=>{if(e!=="system"){n(e);return}const r=Xae(),s=()=>n(r!=null&&r.matches?"dark":"light");return s(),r==null||r.addEventListener("change",s),()=>{r==null||r.removeEventListener("change",s)}},[e]),t!==null?t:(i=Xae())!=null&&i.matches?"dark":"light"}const Yae=typeof document<"u"?document:null;function dA(e=null,t={target:Yae,actInsideInputWithModifier:!0}){const[n,i]=p.useState(!1),r=p.useRef(!1),s=p.useRef(new Set([])),[o,l]=p.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",` +`,4);return n>=0?t.slice(n+5).trimStart():e}function PFe(e,t){const n=(e||"").trim();return!n||[">",">-","|","|-"].includes(n)?t("common.noDescription"):n}function Q9t(){return a.jsx("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:a.jsx("path",{d:"m7.5 7.5 9 9m0-9-9 9",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function z9t(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 5.5v13M5.5 12h13",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}function uae({direction:e}){return a.jsx("svg",{className:"icon",viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,children:a.jsx("path",{d:e==="left"?"m11.7 5.5-4.2 4.5 4.2 4.5":"m8.3 5.5 4.2 4.5-4.2 4.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function V9t(){return a.jsx("span",{className:"skillcenter-loading-mark","aria-hidden":!0})}function H9t({page:e,total:t,pageSize:n,onPage:i}){const{t:r}=Te("ui"),s=Math.max(1,Math.ceil(t/n));return a.jsxs("footer",{className:"skillcenter-pager",children:[a.jsx("span",{children:r("skillCenter.totalItems",{count:t})}),a.jsxs("div",{className:"skillcenter-pager-actions",children:[a.jsx("button",{type:"button",onClick:()=>i(e-1),disabled:e<=1,"aria-label":r("common.previousPage"),children:a.jsx(uae,{direction:"left"})}),a.jsxs("span",{children:[e," / ",s]}),a.jsx("button",{type:"button",onClick:()=>i(e+1),disabled:e>=s,"aria-label":r("common.nextPage"),children:a.jsx(uae,{direction:"right"})})]})]})}function q9t({children:e}){return a.jsx("div",{className:"skillcenter-empty",children:e})}function W$({kind:e,title:t,description:n,error:i,action:r}){return a.jsx("div",{className:`skillcenter-page-state is-${e}`,role:e==="error"?"alert":"status",children:a.jsxs(Wn,{fill:"none",children:[a.jsx(Wn.Title,{children:t}),n?a.jsx(Wn.Description,{children:n}):null,i?a.jsx(Ns,{error:i}):null,r?a.jsx(Wn.ActionRow,{children:a.jsx(_t,{color:"secondary",size:"lg",onClick:r.onClick,children:r.label})}):null]})})}function dae({errors:e,cloudProvider:t,fullPage:n=!1,onRetry:i}){const{t:r}=Te("ui");return a.jsxs("div",{className:`skillcenter-space-errors${n?" is-full-page":""}`,role:"alert",children:[a.jsxs("div",{className:"skillcenter-space-errors__content",children:[a.jsx("strong",{children:r(n?"skillCenter.cannotLoadSpaces":"skillCenter.someSpacesFailed")}),e.map(({region:s,error:o})=>a.jsxs("section",{children:[a.jsx("span",{children:Oh(s,t)}),a.jsx(Ns,{error:o})]},s))]}),a.jsx("button",{type:"button",onClick:i,children:r("common.reload")})]})}function W9t({skill:e,space:t,region:n,cloudProvider:i,detail:r,files:s,loading:o,error:l,canOptimize:c,reviews:u,reviewsLoading:d,reviewsError:f,onOptimize:h,onDownload:m,onClose:g}){const{t:b}=Te("ui"),[v,y]=p.useState("files");return p.useEffect(()=>{const w=x=>{x.key==="Escape"&&g()};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[g]),a.jsx("div",{className:"skill-detail-backdrop",role:"presentation",onMouseDown:g,children:a.jsxs("section",{className:"skill-detail-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-detail-title",onMouseDown:w=>w.stopPropagation(),children:[a.jsxs("header",{className:"skill-detail-head",children:[a.jsx("div",{className:"skill-detail-heading",children:a.jsxs("div",{children:[a.jsx("h2",{id:"skill-detail-title",children:(r==null?void 0:r.name)||e.skillName}),a.jsx("p",{children:PFe((r==null?void 0:r.description)||e.skillDescription,b)})]})}),a.jsxs("div",{className:"skill-detail-actions",children:[a.jsx("button",{type:"button",onClick:m,disabled:s.length===0,children:b("skillCenter.downloadZip")}),t.isShared?null:a.jsx(yP,{disabled:!c,placement:"bottom",children:a.jsx("button",{type:"button",onClick:h,disabled:!c,children:b("skillCenter.optimize")})}),a.jsx("button",{type:"button",className:"skill-detail-close",onClick:g,"aria-label":b("skillCenter.closeSkillDetails"),children:a.jsx(Q9t,{})})]})]}),a.jsxs("dl",{className:"skill-detail-meta",children:[a.jsxs("div",{children:[a.jsx("dt",{children:b("skillCenter.skillId")}),a.jsx("dd",{title:e.skillId,children:e.skillId})]}),a.jsxs("div",{children:[a.jsx("dt",{children:b("agentSelector.version")}),a.jsx("dd",{children:e.sourceVersion||(r==null?void 0:r.version)||e.version||"—"})]}),e.author?a.jsxs("div",{children:[a.jsx("dt",{children:b("skillCenter.author")}),a.jsx("dd",{children:e.author})]}):null,a.jsxs("div",{children:[a.jsx("dt",{children:b("agentSelector.status")}),a.jsx("dd",{children:IFe(e.skillStatus,b)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:b("skillCenter.skillSpace")}),a.jsx("dd",{title:Dc(t),children:t.isShared?b("skillCenter.sharedSpace"):Dc(t)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:b("myAgents.region")}),a.jsx("dd",{children:Oh(n,i)})]})]}),a.jsx(ob,{className:"skill-detail-tabs",idPrefix:"skill-detail",ariaLabel:b("skillCenter.skillDetailSections"),value:v,items:[{id:"files",label:b("skillCenter.allFiles"),panelId:"skill-detail-panel"},{id:"reviews",label:b("skillCenter.reviewHistory"),panelId:"skill-detail-panel"}],onChange:y}),a.jsx("div",{className:`skill-detail-content${v==="files"?" skill-detail-content--files":" skill-detail-content--reviews"}`,id:"skill-detail-panel",role:"tabpanel","aria-labelledby":`skill-detail-${v}-tab`,children:v==="reviews"?d?a.jsx(cl,{}):f?a.jsx("div",{role:"alert",children:a.jsx(Ns,{error:f})}):a.jsx(VW,{applications:u}):o?a.jsxs("div",{className:"skillcenter-loading",children:[a.jsx(V9t,{}),b("skillCenter.loadingSkillContent")]}):l?a.jsx("div",{className:"skillcenter-error",children:a.jsx(Ns,{error:l})}):s.length>0?a.jsx(fL,{files:s.map(w=>w.path.endsWith("SKILL.md")&&w.content?{...w,content:U9t(w.content)}:w)}):a.jsx(q9t,{children:b("skillCenter.noSkillContent")})})]})})}function K9t({space:e,canUseSandbox:t,onUpload:n,onSandbox:i,onClose:r}){const{t:s}=Te("ui");return p.useEffect(()=>{const o=l=>{l.key==="Escape"&&r()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[r]),a.jsx("div",{className:"skill-dialog-backdrop",role:"presentation",onMouseDown:r,children:a.jsxs("section",{className:"skill-dialog skill-add-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-add-dialog-title",onMouseDown:o=>o.stopPropagation(),children:[a.jsxs("header",{children:[a.jsxs("div",{children:[a.jsx("h2",{id:"skill-add-dialog-title",children:s("skillCenter.addSkill")}),a.jsx("p",{title:Dc(e),children:Dc(e)})]}),a.jsx("button",{type:"button",onClick:r,children:s("common.cancel")})]}),a.jsxs("div",{className:"skill-add-dialog__options",children:[a.jsxs("button",{type:"button",onClick:n,children:[a.jsx("strong",{children:s("skillCenter.localUpload")}),a.jsx("span",{children:s("skillCenter.localUploadDescription")})]}),a.jsx(yP,{disabled:!t,placement:"inside",children:a.jsxs("button",{type:"button",disabled:!t,onClick:i,children:[a.jsx("strong",{children:s("skillCenter.autoCreate")}),a.jsx("span",{children:s("skillCenter.autoCreateDescription")})]})})]})]})})}function G9t({cloudProvider:e="volcengine",region:t,active:n=!0,activationRevision:i=0,initialWorkspace:r=null,onInitialWorkspaceConsumed:s,onPageTitleChange:o,toolbarLeading:l,toolbarFilters:c}){var zt;const{t:u,i18n:d}=Te("ui"),f=p.useMemo(()=>[t],[t]),[h,m]=p.useState([]),[g,b]=p.useState(null),[v,y]=p.useState([]),w=p.useMemo(()=>CFe(v),[v]),[x,O]=p.useState(null),[k,S]=p.useState(null),[C,E]=p.useState(!1),j=p.useRef(""),T=p.useRef(!1),[R,A]=p.useState({}),[N,D]=p.useState(!1),[I,P]=p.useState(""),[_,L]=p.useState((r==null?void 0:r.space)??null),F=p.useRef(_);F.current=_;const[M,V]=p.useState([]),[q,U]=p.useState(1),[Z,z]=p.useState(0),[ee,ne]=p.useState(!1),[W,X]=p.useState(null),[H,ae]=p.useState(!1),[Y,K]=p.useState(""),[ie,J]=p.useState("overview"),[ye,de]=p.useState(null),[ge,Ee]=p.useState(null),[xe,Ne]=p.useState(null),[We,Xe]=p.useState([]),[Re,se]=p.useState(!1),[ce,ve]=p.useState(null),[Se,oe]=p.useState(null),[$e,Ue]=p.useState(!1),[me,ke]=p.useState(null),[Ae,He]=p.useState(null),[Qe,jt]=p.useState(null),[Pt,Kt]=p.useState(0),[Ct,xt]=p.useState(0),[tt,mt]=p.useState(""),[_e,Ot]=p.useState(""),[Nt,Yt]=p.useState(null),[xn,Ke]=p.useState(r),St=p.useRef(0),qe=p.useRef(0),nt=p.useRef(!1),et=p.useRef(null),ft=p.useRef(null),Et=p.useRef(null),At=p.useDeferredValue(I),It=p.useDeferredValue(Y),Gt=xn&&(_||xn.selectPublishSpace)?xn.operation==="create"?u("skillCenter.createSkill"):u("skillCenter.optimizeNamed",{name:((zt=xn.source)==null?void 0:zt.name)||u("skillCenter.skill")}):"",Ye=_!=null&&_.isShared?u("skillCenter.sharedSpace"):Dc(_),wt=!(_!=null&&_.isShared)||_.canWrite===!0,vt=Gt||Ye||u("skillCenter.library");p.useEffect(()=>{n&&(o==null||o(vt))},[n,o,vt]),p.useEffect(()=>{r&&(s==null||s())},[r,s]);const tn=p.useMemo(()=>{const ze=At.trim().toLocaleLowerCase(),bt=h.filter(Ht=>!Ht.isShared);return ze?bt.filter(Ht=>`${Dc(Ht)} ${Ht.name} ${Ht.description||""} ${Ht.projectName||""}`.toLocaleLowerCase().includes(ze)):bt},[At,h]),Qt=p.useMemo(()=>{const ze=It.trim().toLocaleLowerCase();return ze?M.filter(bt=>`${bt.skillName} ${bt.skillDescription||""}`.toLocaleLowerCase().includes(ze)):M},[It,M]),un=(_==null?void 0:_.region)||Zi(e);p.useEffect(()=>{if(!n||!_)return;const ze=()=>xt(Ht=>Ht+1),bt=()=>{document.visibilityState==="visible"&&ze()};return window.addEventListener("focus",ze),document.addEventListener("visibilitychange",bt),()=>{window.removeEventListener("focus",ze),document.removeEventListener("visibilitychange",bt)}},[n,_==null?void 0:_.id]),p.useEffect(()=>{const ze=_?`${un}:${_.id}`:"";if(j.current!==ze&&(j.current=ze,y([]),O(null),Ee(null)),S(null),E(!1),!n||!_||_.isShared)return;const bt=new AbortController;return E(!0),Lpt({spaceId:_.id,region:un,signal:bt.signal}).then(Ht=>{bt.signal.aborted||y(Ht.items)}).catch(Ht=>{bt.signal.aborted||S(Pr(Ht,u("skillCenter.reviewStatusFailed")))}).finally(()=>{bt.signal.aborted||E(!1)}),()=>bt.abort()},[_==null?void 0:_.id,_==null?void 0:_.isShared,un,Ct,n,i,u]);const De=p.useMemo(()=>f.flatMap(ze=>{var Ht;const bt=(Ht=R[ze])==null?void 0:Ht.error;return bt?[{region:ze,error:bt}]:[]}),[R,f]),on=f.some(ze=>{const bt=R[ze];return!!(bt&&!bt.done&&!bt.error)}),On=De.length===f.length;p.useEffect(()=>{const ze=new AbortController;return NM(ze.signal).then(oe).catch(()=>oe({enabled:!1,reason:u("skillCenter.adminNotConfigured"),operations:["create","optimize"],models:[],styles:{}})),()=>ze.abort()},[u]);const Sn=p.useCallback(async(ze,bt)=>{var Dr;if(nt.current||ze.length===0)return;nt.current=!0,D(!0),bt&&((Dr=et.current)==null||Dr.abort(),m([]),A(Object.fromEntries(ze.map(({region:ti})=>[ti,{nextPage:1,loadedCount:0,done:!1,error:null}]))));const Ht=new AbortController;et.current=Ht;const _n=++qe.current,jr=await Promise.allSettled(ze.map(async({region:ti,page:Si})=>({region:ti,page:Si,result:await jpt({region:ti,page:Si,pageSize:M9t,signal:Ht.signal})})));if(qe.current!==_n)return;const Hs=jr.map((ti,Si)=>{const Zr=ze[Si];return ti.status==="rejected"?{request:Zr,error:Pr(ti.reason,u("skillCenter.errors.loadSpaces")),items:[],totalCount:0,scannedCount:0}:{request:Zr,error:null,items:(ti.value.result.items||[]).map(Jr=>({...Jr,region:Jr.region||ti.value.region})),totalCount:ti.value.result.totalCount||0,scannedCount:ti.value.result.scannedCount??ti.value.result.items.length}}),qs=Hs.flatMap(ti=>ti.items);A(ti=>{const Si={...ti};return Hs.forEach(({request:Zr,error:Jr,scannedCount:ga,totalCount:go})=>{const us=Si[Zr.region]||{nextPage:Zr.page,loadedCount:0,done:!1,error:null};if(Jr){Si[Zr.region]={...us,error:Jr};return}const pe=us.loadedCount+ga;Si[Zr.region]={nextPage:Zr.page+1,loadedCount:pe,done:ga===0||pe>=go,error:null}}),Si}),m(ti=>B9t(bt?[]:ti,qs)),L(ti=>ti&&(qs.find(Si=>uu(Si)===uu(ti))||ti)),nt.current=!1,D(!1)},[]),zi=p.useCallback(()=>{if(nt.current)return;const ze=f.flatMap(bt=>{const Ht=R[bt];return Ht&&!Ht.done&&!Ht.error?[{region:bt,page:Ht.nextPage}]:[]});Sn(ze,!1)},[Sn,R,f]);p.useEffect(()=>{ei(),L(null),V([]),U(1)},[e]),p.useEffect(()=>{if(n)return Sn(f.map(ze=>({region:ze,page:1})),!0),()=>{var ze;qe.current+=1,(ze=et.current)==null||ze.abort(),nt.current=!1}},[n,i,Sn,f,Pt]),p.useEffect(()=>{const ze=Et.current,bt=ft.current;if(!ze||!bt||!on||N)return;const Ht=new IntersectionObserver(([_n])=>{_n.isIntersecting&&zi()},{root:bt,rootMargin:"240px 0px",threshold:.01});return Ht.observe(ze),()=>Ht.disconnect()},[on,zi,N]);const dn=()=>{const ze=ft.current;!ze||!on||N||ze.scrollHeight-ze.scrollTop-ze.clientHeight<=240&&zi()};p.useEffect(()=>{if(!_){V([]),z(0),ae(!1);return}let ze=!0;return ne(!0),X(null),EIe(_.id,{region:un,page:q,pageSize:lae,project:_.projectName}).then(bt=>{ze&&(V(bt.items||[]),z(bt.totalCount||0),ae(bt.degraded===!0))}).catch(bt=>{ze&&(V([]),z(0),ae(!1),X(Pr(bt,u("skillCenter.errors.loadSkills"))))}).finally(()=>{ze&&ne(!1)}),()=>{ze=!1}},[un,_,q,Ct,u]);const lr=ze=>{ei(),L(ze),J("overview"),U(1),K("")},Mn=()=>{ei(),L(null),V([]),z(0),ae(!1),J("overview"),U(1),K(""),Yt(null)},ei=()=>{St.current+=1,de(null),Ne(null),Xe([]),ve(null),se(!1)},Bn=async ze=>{if(!_)return;const bt=jy(ze),Ht=St.current+1;St.current=Ht,de(ze),Ne(null),ve(null),se(!0);try{const[_n,jr]=await Promise.all([Vpt(_.id,bt,ze.version,un,_.projectName,ze.skillName,_.name),OIe({spaceId:_.id,skillId:bt,version:ze.version,region:un,skillSpaceName:_.name,skillName:ze.skillName})]);St.current===Ht&&(Ne(_n),Xe(jr))}catch(_n){St.current===Ht&&ve(Pr(_n,u("skillCenter.errors.loadSkillDetails")))}finally{St.current===Ht&&se(!1)}},ki=ze=>{if(_)return{kind:"skill-center",skillId:jy(ze),version:ze.version,region:un,projectName:_.projectName,skillSpaceId:_.id,skillSpaceName:_.name,name:ze.skillName,description:ze.skillDescription}},zn=ze=>{const bt=ki(ze);!bt||!(Se!=null&&Se.enabled)||(ei(),Ke({operation:"optimize",source:bt}))},Rn=async ze=>{if(!(!_||!window.confirm(u("skillCenter.deleteSkillConfirm",{name:ze.skillName})))){mt(ze.skillId),Yt(null);try{await Qpt({spaceId:_.id,skillId:ze.skillId,region:un}),xt(bt=>bt+1),Kt(bt=>bt+1)}catch(bt){Yt(Pr(bt,u("skillCenter.errors.deleteSkill")))}finally{mt("")}}},di=async ze=>{if(!window.confirm(u("skillCenter.deleteSpaceConfirm",{name:Dc(ze)})))return;const bt=uu(ze);Ot(bt),Yt(null);try{await Fpt({spaceId:ze.id,region:ze.region||Zi(e)}),_&&uu(_)===bt&&Mn(),Kt(Ht=>Ht+1)}catch(Ht){Yt(Pr(Ht,u("skillCenter.errors.deleteSpace")))}finally{Ot("")}},rt=async(ze,bt=ze.version,Ht=!1)=>{var Hs,qs,Dr,ti;if(!_||T.current)return;const _n=_,jr=`${_n.region}:${_n.id}:${ze.skillId}:${bt}`;T.current=!0,b(jr),Yt(null);try{const Si=await Ipt({spaceId:_n.id,skillId:ze.skillId,version:bt,region:_n.region||un});((Hs=F.current)==null?void 0:Hs.id)===_n.id&&((qs=F.current)==null?void 0:qs.region)===_n.region&&y(Zr=>[...Zr.filter(Jr=>Jr.id!==Si.id),Si])}catch(Si){if(Ht)throw Pr(Si,u("skillCenter.reviewFailed"));((Dr=F.current)==null?void 0:Dr.id)===_n.id&&((ti=F.current)==null?void 0:ti.region)===_n.region&&Yt(Pr(Si,u("skillCenter.reviewFailed")))}finally{T.current=!1,b(null)}};return xn&&(_||xn.selectPublishSpace)?a.jsx(f9t,{operation:xn.operation,cloudProvider:e,space:_??void 0,availableSpaces:h.filter(ze=>!ze.isShared),spacesLoading:N,initialIntent:xn.initialIntent,source:xn.source,onBack:()=>Ke(null),onPublished:()=>{xt(ze=>ze+1),Kt(ze=>ze+1)}}):a.jsxs("section",{className:`skillcenter${_?" is-space":" resource-collection"}`,children:[_?a.jsx(lT,{className:"skillcenter-detail",title:Ye||_.name,description:_.isShared?u("skillCenter.sharedDescription"):_.description||u("skillCenter.manageSpaceDescription"),identitySeed:_.name,backLabel:u("skillCenter.backToSpaces"),onBack:Mn,sections:[{key:"overview",label:u("skillCenter.overview"),content:a.jsxs(a.Fragment,{children:[Nt?a.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:a.jsx(Ns,{error:Nt})}):null,k?a.jsxs("div",{className:"skillcenter-inline-error",role:"alert",children:[a.jsx(Ns,{error:k}),a.jsx("button",{type:"button",onClick:()=>xt(ze=>ze+1),children:u("common.reload")})]}):null,a.jsx("section",{className:"skillcenter-overview",children:a.jsxs(yH,{className:"skillcenter-detail-facts",children:[a.jsxs("div",{children:[a.jsx("dt",{children:u("skillCenter.skillCount")}),a.jsx("dd",{children:Z})]}),a.jsxs("div",{children:[a.jsx("dt",{children:u("skillCenter.updatedAt")}),a.jsx("dd",{children:_.updatedAt?F9t(_.updatedAt,d.resolvedLanguage??d.language):"—"})]})]})})]})},{key:"skills",label:u("skillCenter.skills"),content:a.jsxs(a.Fragment,{children:[Nt?a.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:a.jsx(Ns,{error:Nt})}):null,k?a.jsxs("div",{className:"skillcenter-inline-error",role:"alert",children:[a.jsx(Ns,{error:k}),a.jsx("button",{type:"button",onClick:()=>xt(ze=>ze+1),children:u("common.reload")})]}):null,a.jsxs("section",{className:"skillcenter-results","aria-label":u("skillCenter.skillsInSpace",{name:Ye||_.name}),children:[a.jsx(YIe,{title:u("skillCenter.skills"),description:u("skillCenter.totalItems",{count:Z}),actions:a.jsxs(a.Fragment,{children:[a.jsx(Jp,{"aria-label":u("skillCenter.searchSkills"),value:Y,onChange:ze=>K(ze.target.value),placeholder:u("skillCenter.searchSkills")}),a.jsx(_t,{color:"secondary",variant:"outline",size:"sm",pill:!1,disabled:ee||C,onClick:()=>xt(ze=>ze+1),children:u("common.refresh")})]})}),H?a.jsx("div",{className:"skillcenter-inline-warning",role:"status",children:u("skillCenter.degradedRelationWarning")}):null,ee&&M.length===0?a.jsx(cl,{}):W&&M.length===0?a.jsx(W$,{kind:"error",title:u("skillCenter.cannotLoadSkills"),error:W,action:{label:u("common.reload"),onClick:()=>xt(ze=>ze+1)}}):Qt.length===0?a.jsx(W$,{kind:"empty",title:Y.trim()?u("skillCenter.noMatchingSkills"):u("skillCenter.noSkills"),description:Y.trim()?u("skillCenter.tryAnotherName"):u(_.isShared?"skillCenter.sharedEmpty":"skillCenter.emptySkillsDescription"),action:!Y.trim()&&wt?{label:u("skillCenter.localUpload"),onClick:()=>jt(_)}:void 0}):a.jsx("div",{className:"skillcenter-table-wrap",children:a.jsxs("table",{className:"skillcenter-table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:u("skillCenter.skills")}),a.jsx("th",{scope:"col",children:u("agentSelector.status")}),a.jsx("th",{scope:"col",className:"skillcenter-table__actions-heading",children:u("skillCenter.actions")})]})}),a.jsx("tbody",{children:Qt.map(ze=>{const bt=w.get(`${ze.skillId}:${ze.version}`);return a.jsxs("tr",{children:[a.jsx("td",{className:"skillcenter-table__skill",children:a.jsxs("button",{type:"button",onClick:()=>void Bn(ze),children:[a.jsxs("span",{className:"skillcenter-table__title-row",children:[a.jsx("strong",{title:ze.skillName,children:ze.skillName}),ze.version?a.jsx("span",{className:"skillcenter-table__version-badge",children:ze.sourceVersion||ze.version}):null]}),a.jsx("span",{className:"skillcenter-table__description",children:PFe(ze.skillDescription,u)}),_.isShared&&ze.author?a.jsx("span",{className:"skillcenter-table__author",children:u("skillCenter.authorName",{name:ze.author})}):null]})}),a.jsx("td",{children:a.jsxs("div",{className:"skillcenter-review-status",children:[a.jsx("span",{className:`skillcenter-status ${$9t(ze.skillStatus)}`,children:IFe(ze.skillStatus,u)}),bt?a.jsx(FT,{status:bt.status}):null,bt!=null&&bt.reviewer||bt!=null&&bt.reviewedBy?a.jsx(QW,{compact:!0,person:bt.reviewer,fallback:bt.reviewedBy}):null]})}),a.jsx("td",{children:a.jsxs("div",{className:"skillcenter-table__actions",children:[a.jsx("button",{type:"button",onClick:()=>void Bn(ze),children:u("common.view")}),!ze.lookupByName&&ze.skillId?a.jsx("button",{type:"button",onClick:()=>Ee(ze),children:u("skillCenter.versions.title")}):null,!_.isShared&&!ze.lookupByName&&ze.skillId?a.jsx("button",{type:"button",disabled:C||k!==null||g!==null||bt!==void 0&&bt.status!=="returned",onClick:()=>void rt(ze),children:g===`${_.region}:${_.id}:${ze.skillId}:${ze.version}`?u("skillCenter.reviewSubmitting"):u(bt?{pending:"skillCenter.reviewPending",approving:"skillCenter.reviewApproving",approved:"skillCenter.reviewApproved",returned:"skillCenter.reviewRetry"}[bt.status]:"skillCenter.requestPublication")}):null,v.some(Ht=>Ht.sourceSkillId===ze.skillId)?a.jsx("button",{type:"button",onClick:()=>O(ze),children:u("skillCenter.reviewHistory")}):null,_.isShared?null:a.jsx(yP,{disabled:!(Se!=null&&Se.enabled),children:a.jsx("button",{type:"button",disabled:!(Se!=null&&Se.enabled),onClick:()=>zn(ze),children:u("skillCenter.optimize")})}),!ze.lookupByName&&wt?a.jsx("button",{type:"button",className:"is-danger",disabled:tt===ze.skillId,onClick:()=>void Rn(ze),children:tt===ze.skillId?u("common.deleting"):u("common.delete")}):null]})})]},`${jy(ze)}:${ze.version}`)})})]})}),!Y.trim()&&!ee&&!W&&Z>0?a.jsx(H9t,{page:q,total:Z,pageSize:lae,onPage:U}):null]})]})}],activeSectionKey:ie,navigationLabel:u("skillCenter.spaceDetails"),onSectionChange:ze=>J(ze),actionsClassName:"skillcenter-toolbar-actions",actions:a.jsxs(a.Fragment,{children:[_.isShared?null:a.jsxs(a.Fragment,{children:[a.jsx(_t,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:()=>ke(_),children:u("skillCenter.editSpace")}),a.jsx(_t,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,disabled:_e===uu(_),onClick:()=>void di(_),children:_e===uu(_)?u("common.deleting"):u("skillCenter.deleteSpace")})]}),wt?a.jsx(_t,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:()=>jt(_),children:u("skillCenter.localUpload")}):null,_.isShared?null:a.jsx(yP,{disabled:!(Se!=null&&Se.enabled),children:a.jsxs(_t,{type:"button",color:"primary",size:"lg",pill:!1,disabled:!(Se!=null&&Se.enabled),onClick:()=>Ke({operation:"create"}),children:[a.jsx(Ije,{"aria-hidden":"true"}),a.jsx("span",{children:u("skillCenter.createSkill")})]})})]})}):a.jsxs(a.Fragment,{children:[a.jsxs(ab,{className:"skillcenter-list-toolbar library-resource-toolbar",children:[l,a.jsxs("div",{className:"resource-toolbar__actions",children:[c,a.jsx(Jp,{"aria-label":u("skillCenter.searchSpaces"),value:I,onChange:ze=>P(ze.target.value),placeholder:u("skillCenter.searchSpaces")})]})]}),Nt?a.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:a.jsx(Ns,{error:Nt})}):null,a.jsxs(em,{className:"skillcenter-list-results",ref:ft,"aria-label":u("skillCenter.spaceList"),onScroll:dn,children:[De.length>0&&!On?a.jsx(dae,{errors:De,cloudProvider:e,onRetry:()=>Kt(ze=>ze+1)}):null,a.jsxs(K0,{children:[a.jsx(N9t,{region:t,active:n,revision:Pt+i,onOpen:lr},`${e}:${t}`),I.trim()?null:a.jsx(cb,{"aria-label":u("skillCenter.createSpace"),icon:a.jsx(z9t,{}),onClick:()=>Ue(!0),children:u("skillCenter.newSpace")}),tn.map(ze=>{const bt=uu(ze);return a.jsx(X0,{className:"skillcenter-space-card",title:Dc(ze),description:ze.description||u("common.noDescription"),metadata:[{label:u("skillCenter.skillCount"),value:u("skillCenter.skillCountValue",{count:ze.skillCount??0})},{label:u("skillCenter.updatedAt"),value:BT(ze.updatedAt,Date.now(),d.resolvedLanguage??d.language)}],action:{label:u("skillCenter.addSkill"),icon:"plus",onClick:()=>He(ze)},detailAction:{label:u("common.viewDetails"),onClick:()=>lr(ze)}},bt)})]}),N&&h.length===0?a.jsx(cl,{}):On&&h.length===0?a.jsx(dae,{errors:De,cloudProvider:e,fullPage:!0,onRetry:()=>Kt(ze=>ze+1)}):tn.length===0&&I.trim()?a.jsx(W$,{kind:"empty",title:u("skillCenter.noMatchingSpaces"),description:u("skillCenter.tryAnotherName")}):null,!On&&h.length>0?a.jsx("div",{className:"my-agent-load-more",ref:Et,"aria-live":"polite",children:N?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),a.jsx("span",{children:u("skillCenter.loadingMoreSpaces")})]}):on?a.jsx("span",{children:u("skillCenter.scrollForMore")}):De.length>0?a.jsx("span",{children:u("skillCenter.someSpacesFailed")}):a.jsx("span",{children:u("skillCenter.allSpacesLoaded")})}):null]})]}),ge&&_?a.jsx(j9t,{skill:ge,space:_,region:un,reviews:v.filter(ze=>ze.sourceSkillId===ge.skillId),onClose:()=>Ee(null),onChanged:()=>xt(ze=>ze+1),onSubmitReview:!_.isShared&&!C&&!k?ze=>rt(ge,ze,!0):void 0},`${un}:${_.id}:${ge.skillId}`):null,x?a.jsx(_9t,{name:x.skillName,applications:v.filter(ze=>ze.sourceSkillId===x.skillId),onClose:()=>O(null)}):null,ye&&_&&a.jsx(W9t,{skill:ye,space:_,region:un,cloudProvider:e,detail:xe,files:We,loading:Re,error:ce,reviews:v.filter(ze=>ze.sourceSkillId===ye.skillId),reviewsLoading:C,reviewsError:k,canOptimize:!_.isShared&&(Se==null?void 0:Se.enabled)===!0,onOptimize:()=>zn(ye),onDownload:()=>void zpt({spaceId:_.id,skillId:jy(ye),version:ye.version,region:un,fallbackName:ye.skillName,skillSpaceName:_.name,skillName:ye.skillName}).catch(ze=>ve(Pr(ze,u("skillCenter.errors.downloadSkill")))),onClose:ei}),$e?a.jsx(R9t,{region:t,regionOptions:ju(e),onClose:()=>Ue(!1),onCreated:ze=>{Ue(!1),Kt(bt=>bt+1),L({...ze,region:ze.region||t})}}):null,me?a.jsx(I9t,{space:me,region:me.region||Zi(e),onClose:()=>ke(null),onUpdated:ze=>{const bt={...ze,region:ze.region||me.region||Zi(e)};ke(null),L(Ht=>Ht&&uu(Ht)===uu(bt)?bt:Ht),m(Ht=>Ht.map(_n=>uu(_n)===uu(bt)?bt:_n)),Kt(Ht=>Ht+1)}}):null,Ae?a.jsx(K9t,{space:Ae,canUseSandbox:(Se==null?void 0:Se.enabled)===!0,onClose:()=>He(null),onUpload:()=>{jt(Ae),He(null)},onSandbox:()=>{const ze=Ae;He(null),lr(ze),Ke({operation:"create"})}}):null,Qe?a.jsx(P9t,{space:Qe,region:Qe.region||Zi(e),onClose:()=>jt(null),onUploaded:()=>{jt(null),xt(ze=>ze+1),Kt(ze=>ze+1)}}):null]})}function X9t(e){return[{id:"skills",label:e("library.tabs.skills"),panelId:"library-skills-panel"},{id:"knowledge",label:e("library.tabs.knowledge"),panelId:"library-knowledge-panel"},{id:"artifacts",label:e("library.tabs.artifacts"),panelId:"library-artifacts-panel"}]}function Y9t({cloudProvider:e,studioRegion:t="",activeTab:n,onTabChange:i,onPageTitleChange:r,skillInitialWorkspace:s=null,onSkillInitialWorkspaceConsumed:o,artifactSources:l=[],artifactUserId:c="",onArtifactActivate:u,onArtifactSourceOpen:d}){const{t:f,i18n:h}=Te("workspaceTools"),m=p.useMemo(()=>X9t(f),[f]),g=f("library.tabs.skills"),b=AD(t)?t:Zi(e),[v,y]=p.useState(b),[w,x]=p.useState(g),O=p.useRef(g),[k,S]=p.useState(!1),[C,E]=p.useState(()=>new Set(["skills",n])),[j,T]=p.useState({skills:0,knowledge:0,artifacts:0}),R=p.useRef(u),[A,N]=p.useState([]),[D,I]=p.useState(!1),[P,_]=p.useState(""),L=p.useMemo(()=>{const ne=lbt(l,f("library.untitledSession"));return{key:JSON.stringify(ne),candidates:ne}},[l,f]),F=p.useRef(L);F.current.key!==L.key&&(F.current=L);const M=F.current.candidates,V=p.useMemo(()=>ju(e),[e]);p.useEffect(()=>{y(b)},[b]),p.useEffect(()=>{const ne=O.current;x(W=>W===ne?g:W),O.current=g},[g]),p.useEffect(()=>{R.current=u},[u]),p.useEffect(()=>{E(ne=>{if(ne.has(n))return ne;const W=new Set(ne);return W.add(n),W})},[n]),p.useEffect(()=>{var W;const ne=n==="skills"?w:((W=m.find(X=>X.id===n))==null?void 0:W.label)||f("library.title");r==null||r(ne)},[n,r,w,f,m]),p.useEffect(()=>{var ne;n==="artifacts"&&((ne=R.current)==null||ne.call(R))},[n,j.artifacts]);const q=p.useCallback(async()=>{I(!0),_("");try{N(await bbt(M))}catch(ne){_(ne instanceof Error?ne.message:String(ne))}finally{I(!1)}},[M]);p.useEffect(()=>{n==="artifacts"&&q()},[n,j.artifacts,q]);const U=ne=>{E(W=>{if(W.has(ne))return W;const X=new Set(W);return X.add(ne),X}),T(W=>({...W,[ne]:W[ne]+1})),i(ne)},Z=a.jsx(ob,{idPrefix:"library",ariaLabel:f("library.categoryAria"),value:n,items:m,onChange:U}),z=ne=>a.jsx(lb,{id:ne,ariaLabel:f("library.regionAria"),value:v,options:V,onChange:y}),ee=n==="skills"?w!==g:n==="knowledge"&&k;return a.jsxs(Sh,{className:`library-view${ee?" is-detail":""}`,"aria-label":f("library.title"),children:[ee?null:a.jsx(W0,{className:"library-view__header",title:f("library.title")}),a.jsxs("div",{className:"library-panels",children:[C.has("skills")?a.jsx("div",{id:"library-skills-panel",className:"library-panel",role:"tabpanel","aria-labelledby":"library-skills-tab",hidden:n!=="skills",children:a.jsx(G9t,{cloudProvider:e,region:v,active:n==="skills",activationRevision:j.skills,onPageTitleChange:x,initialWorkspace:s,onInitialWorkspaceConsumed:o,toolbarLeading:Z,toolbarFilters:z("library-skills-region-filter")})}):null,C.has("knowledge")?a.jsx("div",{id:"library-knowledge-panel",className:"library-panel",role:"tabpanel","aria-labelledby":"library-knowledge-tab",hidden:n!=="knowledge",children:a.jsx(u2t,{cloudProvider:e,region:v,active:n==="knowledge",activationRevision:j.knowledge,onDetailChange:S,toolbarLeading:Z,toolbarFilters:z("library-knowledge-region-filter")})}):null,C.has("artifacts")?a.jsx("div",{id:"library-artifacts-panel",className:"library-panel",role:"tabpanel","aria-labelledby":"library-artifacts-tab",hidden:n!=="artifacts",children:a.jsx(pbt,{items:A,region:v,userId:c,active:n==="artifacts",activationRevision:j.artifacts,loading:D,error:P?So(P,h.resolvedLanguage||h.language)||f("artifactLibrary.loadDetailFallback"):"",onRetry:()=>void q(),onEdit:ybt,onDelete:vbt,onDownload:xbt,onOpenSource:d?ne=>d(ne.appName,ne.sessionId):void 0,toolbarLeading:Z,toolbarFilters:z("library-artifacts-region-filter")})}):null]})]})}const DFe="veadk_agentkit_connections",Z9t=3e3,fae=6e4;function af(){try{const e=localStorage.getItem(DFe);return(e?JSON.parse(e):[]).filter(n=>!n.runtimeId||!!n.region)}catch{return[]}}function pL(e){try{localStorage.setItem(DFe,JSON.stringify(e))}catch{}}function bf(e,t){return`agentkit:${e}:${t}`}function MFe(e){try{return new URL(e).host}catch{return e}}function xO(e){KAe();for(const t of e)if(!(t.runtimeId&&!t.region))for(const n of t.apps)WAe(bf(t.id,n),t.runtimeId?{app:n,runtimeId:t.runtimeId,mpaInstanceId:t.mpaInstanceId,region:t.region,agentCategory:t.agentCategory}:{app:n,base:t.base,apiKey:t.apiKey})}function LFe(e,t,n,i,r,s,o,l){const c=af(),u=c.findIndex(h=>h.runtimeId===e),d=u===-1?void 0:c[u],f={id:`rt_${e}`,name:t||e,runtimeId:e,region:n,apps:i,appLabels:r,currentVersion:s,agentCategory:o??(d==null?void 0:d.agentCategory),mpaInstanceId:(l==null?void 0:l.trim())||(d==null?void 0:d.mpaInstanceId)};return u===-1?c.push(f):c[u]=f,pL(c),xO(c),f}async function J9t(e,t,n,i,r,s,o){let l=null,c=n||"cn-beijing",u=null;for(const m of $A(n))try{const g=await Kw(e,m,{retryProbe:!0,preferCached:!0,currentVersion:i});if(g&&g.length>0){await O2e(e,m),l=g,c=m;break}}catch(g){if(g instanceof Q1)throw vP(e),g;if(g instanceof Oa&&g.unsupported){u=g;continue}throw g}if(!l||l.length===0)throw vP(e),u||new Oa(Q("connections.runtimeUnsupported"),!0,!0);const d=(r==null?void 0:r.trim())||l[0],f=Object.fromEntries(l.map(m=>[m,m===l[0]?d:m])),h=LFe(e,t,c,l,f,i,s,o);return bf(h.id,l[0])}function e7t(e){return new Promise(t=>window.setTimeout(t,e))}async function YN(e,t,n,i,r={}){const s=Date.now();for(;;)try{return await J9t(e,t,n,i,r.agentName,r.agentCategory,r.mpaInstanceId)}catch(o){const l=Date.now()-s;if(!r.waitForReady||!(o instanceof Oa)||!o.retryable||l>=fae)throw o;const c=Math.min(Z9t,fae-l);await e7t(c)}}async function $Fe(e,t,n,i){const r=t.trim().replace(/\/+$/,""),s=await FA(r,n.trim()),o={id:Date.now().toString(36),name:e.trim()||MFe(r),base:r,apiKey:n.trim(),apps:s,appLabels:i&&s.length>0?{[s[0]]:i}:void 0},l=[...af().filter(c=>c.base!==r),o];return pL(l),xO(l),o}function t7t(e){const t=af().filter(n=>n.id!==e);return pL(t),xO(t),t}function vP(e){const t=af().filter(n=>n.runtimeId!==e);return pL(t),xO(t),t}function FFe(e,t){const n=e.map(r=>({id:r,label:r,app:r,remote:!1})),i=t.flatMap(r=>r.apps.map(s=>{var l;const o=((l=r.appLabels)==null?void 0:l[s])??s;return{id:bf(r.id,s),label:o,app:s,remote:!0,host:r.runtimeId?r.name:MFe(r.base??""),runtimeId:r.runtimeId,region:r.region,currentVersion:r.currentVersion,agentCategory:r.agentCategory,mpaInstanceId:r.mpaInstanceId}}));return[...n,...i]}const hae=Object.freeze(Object.defineProperty({__proto__:null,addConnection:$Fe,addRuntimeConnection:LFe,buildAgentEntries:FFe,connectRuntime:YN,loadConnections:af,registerConnections:xO,remoteAppId:bf,removeConnection:t7t,removeRuntimeConnection:vP},Symbol.toStringTag,{value:"Module"}));function n7t({onAdded:e,onCancel:t}){const{t:n}=Te("conversation"),[i,r]=p.useState(""),[s,o]=p.useState(""),[l,c]=p.useState(""),[u,d]=p.useState(!1),[f,h]=p.useState(""),m=i.trim().length>0&&s.trim().length>0&&!u;async function g(){if(m){d(!0),h("");try{const b=await $Fe(l,i,s,l);if(b.apps.length===0){h(n("addAgentKit.noAgents")),d(!1);return}e(bf(b.id,b.apps[0]))}catch(b){h(n("addAgentKit.connectionFailed",{error:String(b)})),d(!1)}}}return a.jsx("div",{className:"addagent",children:a.jsxs("div",{className:"addagent-card",children:[a.jsx("h2",{className:"addagent-title",children:n("addAgentKit.title")}),a.jsx("p",{className:"addagent-sub",children:n("addAgentKit.description")}),a.jsxs("label",{className:"addagent-field",children:[a.jsx("span",{className:"addagent-label",children:n("addAgentKit.url")}),a.jsx("input",{className:"addagent-input",value:i,onChange:b=>r(b.target.value),placeholder:"https://xxxxx.apigateway-cn-beijing.volceapi.com",autoFocus:!0})]}),a.jsxs("label",{className:"addagent-field",children:[a.jsx("span",{className:"addagent-label",children:"API Key"}),a.jsx("input",{className:"addagent-input",type:"password",value:s,onChange:b=>o(b.target.value),placeholder:n("addAgentKit.apiKeyHint")})]}),a.jsxs("label",{className:"addagent-field",children:[a.jsx("span",{className:"addagent-label",children:n("addAgentKit.displayName")}),a.jsx("input",{className:"addagent-input",value:l,onChange:b=>c(b.target.value),placeholder:n("addAgentKit.displayNameHint")})]}),f&&a.jsx("div",{className:"addagent-error",children:f}),a.jsxs("div",{className:"addagent-actions",children:[a.jsx("button",{className:"addagent-btn addagent-btn--ghost",onClick:t,disabled:u,children:n("addAgentKit.cancel")}),a.jsxs("button",{className:"addagent-btn addagent-btn--primary",onClick:g,disabled:!m,children:[u?a.jsx(Bi,{className:"icon spin"}):null,n(u?"addAgentKit.connecting":"addAgentKit.connect")]})]})]})})}const i7t=/[\u3400-\u4dbf\u4e00-\u9fff\uf900-\ufaff]/u,r7t={"deploy.build.logs_syncing":"client.deploymentProgress.buildLogsSyncing","deploy.build.logs_complete":"client.deploymentProgress.buildLogsComplete","deploy.build.failed_logs_synced":"client.deploymentProgress.buildFailedLogsSynced","deploy.build.logs_unavailable":"client.deploymentProgress.buildLogsUnavailable","deploy.build.final_logs_unavailable":"client.deploymentProgress.finalBuildLogsUnavailable"},s7t={prepare:"client.deploymentProgress.preparing",upload:"client.deploymentProgress.uploading",build:"client.deploymentProgress.building",deploy:"client.deploymentProgress.deploying",publish:"client.deploymentProgress.publishing",evaluation:"client.deploymentProgress.evaluating",update:"client.deploymentProgress.updating",profile_applying:"client.deploymentProgress.applyingMpaProfile",smoke_running:"client.deploymentProgress.runningMpaSmoke",runnable:"client.deploymentProgress.mpaReady",complete:"client.deploymentProgress.completing",github:"client.deploymentProgress.github"};function mL(e){var r,s;const t=((r=e.message)==null?void 0:r.trim())??"",n=e.messageCode?r7t[e.messageCode]:void 0;if(n)return Q(n);if(t&&(N8().toLowerCase()==="zh-cn"||!i7t.test(t)))return t;if(e.phase==="build"&&((s=e.buildLog)!=null&&s.status)){const o={running:"client.deploymentProgress.buildLogsSyncing",complete:"client.deploymentProgress.buildLogsComplete",error:"client.deploymentProgress.buildLogsUnavailable"}[e.buildLog.status];if(o)return Q(o)}const i=e.phase?s7t[e.phase]:void 0;return i?Q(i):t||Q("client.deploymentProgress.inProgress")}function eo(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,i;n{}};function gL(){for(var e=0,t=arguments.length,n={},i;e=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}ZN.prototype=gL.prototype={constructor:ZN,on:function(e,t){var n=this._,i=o7t(e+"",n),r,s=-1,o=i.length;if(arguments.length<2){for(;++s0)for(var n=new Array(r),i=0,r,s;i=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),mae.hasOwnProperty(t)?{space:mae[t],local:e}:e}function c7t(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===T7&&t.documentElement.namespaceURI===T7?t.createElement(e):t.createElementNS(n,e)}}function u7t(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function BFe(e){var t=bL(e);return(t.local?u7t:c7t)(t)}function d7t(){}function qW(e){return e==null?d7t:function(){return this.querySelector(e)}}function f7t(e){typeof e!="function"&&(e=qW(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r=x&&(x=w+1);!(k=v[x])&&++x=0;)(o=i[r])&&(s&&o.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(o,s),s=o);return this}function L7t(e){e||(e=$7t);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var n=this._groups,i=n.length,r=new Array(i),s=0;st?1:e>=t?0:NaN}function F7t(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function B7t(){return Array.from(this)}function U7t(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?Z7t:typeof t=="function"?eUt:J7t)(e,t,n??"")):w1(this.node(),e)}function w1(e,t){return e.style.getPropertyValue(t)||HFe(e).getComputedStyle(e,null).getPropertyValue(t)}function nUt(e){return function(){delete this[e]}}function iUt(e,t){return function(){this[e]=t}}function rUt(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function sUt(e,t){return arguments.length>1?this.each((t==null?nUt:typeof t=="function"?rUt:iUt)(e,t)):this.node()[e]}function qFe(e){return e.trim().split(/^|\s+/)}function WW(e){return e.classList||new WFe(e)}function WFe(e){this._node=e,this._names=qFe(e.getAttribute("class")||"")}WFe.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function KFe(e,t){for(var n=WW(e),i=-1,r=t.length;++i=0&&(n=t.slice(i+1),t=t.slice(0,i)),{type:t,name:n}})}function IUt(e){return function(){var t=this.__on;if(t){for(var n=0,i=-1,r=t.length,s;n()=>e;function _7(e,{sourceEvent:t,subject:n,target:i,identifier:r,active:s,x:o,y:l,dx:c,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}_7.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function zUt(e){return!e.ctrlKey&&!e.button}function VUt(){return this.parentNode}function HUt(e,t){return t??{x:e.x,y:e.y}}function qUt(){return navigator.maxTouchPoints||"ontouchstart"in this}function e8e(){var e=zUt,t=VUt,n=HUt,i=qUt,r={},s=gL("start","drag","end"),o=0,l,c,u,d,f=0;function h(O){O.on("mousedown.drag",m).filter(i).on("touchstart.drag",v).on("touchmove.drag",y,QUt).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(O,k){if(!(d||!e.call(this,O,k))){var S=x(this,t.call(this,O,k),O,k,"mouse");S&&(xu(O.view).on("mousemove.drag",g,iA).on("mouseup.drag",b,iA),ZFe(O.view),K$(O),u=!1,l=O.clientX,c=O.clientY,S("start",O))}}function g(O){if(Cw(O),!u){var k=O.clientX-l,S=O.clientY-c;u=k*k+S*S>f}r.mouse("drag",O)}function b(O){xu(O.view).on("mousemove.drag mouseup.drag",null),JFe(O.view,u),Cw(O),r.mouse("end",O)}function v(O,k){if(e.call(this,O,k)){var S=O.changedTouches,C=t.call(this,O,k),E=S.length,j,T;for(j=0;j>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?hj(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?hj(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=KUt.exec(e))?new $c(t[1],t[2],t[3],1):(t=GUt.exec(e))?new $c(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=XUt.exec(e))?hj(t[1],t[2],t[3],t[4]):(t=YUt.exec(e))?hj(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=ZUt.exec(e))?Oae(t[1],t[2]/100,t[3]/100,1):(t=JUt.exec(e))?Oae(t[1],t[2]/100,t[3]/100,t[4]):gae.hasOwnProperty(e)?vae(gae[e]):e==="transparent"?new $c(NaN,NaN,NaN,0):null}function vae(e){return new $c(e>>16&255,e>>8&255,e&255,1)}function hj(e,t,n,i){return i<=0&&(e=t=n=NaN),new $c(e,t,n,i)}function nQt(e){return e instanceof QT||(e=T0(e)),e?(e=e.rgb(),new $c(e.r,e.g,e.b,e.opacity)):new $c}function j7(e,t,n,i){return arguments.length===1?nQt(e):new $c(e,t,n,i??1)}function $c(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}KW($c,j7,t8e(QT,{brighter(e){return e=e==null?wP:Math.pow(wP,e),new $c(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?rA:Math.pow(rA,e),new $c(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new $c(t0(this.r),t0(this.g),t0(this.b),OP(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:xae,formatHex:xae,formatHex8:iQt,formatRgb:wae,toString:wae}));function xae(){return`#${$y(this.r)}${$y(this.g)}${$y(this.b)}`}function iQt(){return`#${$y(this.r)}${$y(this.g)}${$y(this.b)}${$y((isNaN(this.opacity)?1:this.opacity)*255)}`}function wae(){const e=OP(this.opacity);return`${e===1?"rgb(":"rgba("}${t0(this.r)}, ${t0(this.g)}, ${t0(this.b)}${e===1?")":`, ${e})`}`}function OP(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function t0(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function $y(e){return e=t0(e),(e<16?"0":"")+e.toString(16)}function Oae(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new cf(e,t,n,i)}function n8e(e){if(e instanceof cf)return new cf(e.h,e.s,e.l,e.opacity);if(e instanceof QT||(e=T0(e)),!e)return new cf;if(e instanceof cf)return e;e=e.rgb();var t=e.r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),s=Math.max(t,n,i),o=NaN,l=s-r,c=(s+r)/2;return l?(t===s?o=(n-i)/l+(n0&&c<1?0:o,new cf(o,l,c,e.opacity)}function rQt(e,t,n,i){return arguments.length===1?n8e(e):new cf(e,t,n,i??1)}function cf(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}KW(cf,rQt,t8e(QT,{brighter(e){return e=e==null?wP:Math.pow(wP,e),new cf(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?rA:Math.pow(rA,e),new cf(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new $c(G$(e>=240?e-240:e+120,r,i),G$(e,r,i),G$(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new cf(kae(this.h),pj(this.s),pj(this.l),OP(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=OP(this.opacity);return`${e===1?"hsl(":"hsla("}${kae(this.h)}, ${pj(this.s)*100}%, ${pj(this.l)*100}%${e===1?")":`, ${e})`}`}}));function kae(e){return e=(e||0)%360,e<0?e+360:e}function pj(e){return Math.max(0,Math.min(1,e||0))}function G$(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const yL=e=>()=>e;function i8e(e,t){return function(n){return e+n*t}}function sQt(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}function Whn(e,t){var n=t-e;return n?i8e(e,n>180||n<-180?n-360*Math.round(n/360):n):yL(isNaN(e)?t:e)}function aQt(e){return(e=+e)==1?r8e:function(t,n){return n-t?sQt(t,n,e):yL(isNaN(t)?n:t)}}function r8e(e,t){var n=t-e;return n?i8e(e,n):yL(isNaN(e)?t:e)}const kP=function e(t){var n=aQt(t);function i(r,s){var o=n((r=j7(r)).r,(s=j7(s)).r),l=n(r.g,s.g),c=n(r.b,s.b),u=r8e(r.opacity,s.opacity);return function(d){return r.r=o(d),r.g=l(d),r.b=c(d),r.opacity=u(d),r+""}}return i.gamma=e,i}(1);function oQt(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,i=t.slice(),r;return function(s){for(r=0;rn&&(s=t.slice(n,s),l[o]?l[o]+=s:l[++o]=s),(i=i[0])===(r=r[0])?l[o]?l[o]+=r:l[++o]=r:(l[++o]=null,c.push({i:o,x:Zf(i,r)})),n=X$.lastIndex;return n180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(r(f)+"rotate(",null,i)-2,x:Zf(u,d)})):d&&f.push(r(f)+"rotate("+d+i)}function l(u,d,f,h){u!==d?h.push({i:f.push(r(f)+"skewX(",null,i)-2,x:Zf(u,d)}):d&&f.push(r(f)+"skewX("+d+i)}function c(u,d,f,h,m,g){if(u!==f||d!==h){var b=m.push(r(m)+"scale(",null,",",null,")");g.push({i:b-4,x:Zf(u,f)},{i:b-2,x:Zf(d,h)})}else(f!==1||h!==1)&&m.push(r(m)+"scale("+f+","+h+")")}return function(u,d){var f=[],h=[];return u=e(u),d=e(d),s(u.translateX,u.translateY,d.translateX,d.translateY,f,h),o(u.rotate,d.rotate,f,h),l(u.skewX,d.skewX,f,h),c(u.scaleX,u.scaleY,d.scaleX,d.scaleY,f,h),u=d=null,function(m){for(var g=-1,b=h.length,v;++g=0&&e._call.call(void 0,t),e=e._next;--O1}function Cae(){_0=(EP=aA.now())+vL,O1=OS=0;try{OQt()}finally{O1=0,SQt(),_0=0}}function kQt(){var e=aA.now(),t=e-EP;t>l8e&&(vL-=t,EP=e)}function SQt(){for(var e,t=SP,n,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:SP=n);kS=e,I7(i)}function I7(e){if(!O1){OS&&(OS=clearTimeout(OS));var t=e-_0;t>24?(e<1/0&&(OS=setTimeout(Cae,e-aA.now()-vL)),Nk&&(Nk=clearInterval(Nk))):(Nk||(EP=aA.now(),Nk=setInterval(kQt,l8e)),O1=1,c8e(Cae))}}function Aae(e,t,n){var i=new CP;return t=t==null?0:+t,i.restart(r=>{i.stop(),e(r+t)},t,n),i}var EQt=gL("start","end","cancel","interrupt"),CQt=[],d8e=0,Tae=1,P7=2,eR=3,_ae=4,D7=5,tR=6;function xL(e,t,n,i,r,s){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;AQt(e,n,{name:t,index:i,group:r,on:EQt,tween:CQt,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:d8e})}function XW(e,t){var n=Pf(e,t);if(n.state>d8e)throw new Error("too late; already scheduled");return n}function Dh(e,t){var n=Pf(e,t);if(n.state>eR)throw new Error("too late; already running");return n}function Pf(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function AQt(e,t,n){var i=e.__transition,r;i[t]=n,n.timer=u8e(s,0,n.time);function s(u){n.state=Tae,n.timer.restart(o,n.delay,n.time),n.delay<=u&&o(u-n.delay)}function o(u){var d,f,h,m;if(n.state!==Tae)return c();for(d in i)if(m=i[d],m.name===n.name){if(m.state===eR)return Aae(o);m.state===_ae?(m.state=tR,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete i[d]):+dP7&&i.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function izt(e,t,n){var i,r,s=nzt(t)?XW:Dh;return function(){var o=s(this,e),l=o.on;l!==i&&(r=(i=l).copy()).on(t,n),o.on=r}}function rzt(e,t){var n=this._id;return arguments.length<2?Pf(this.node(),n).on.on(e):this.each(izt(n,e,t))}function szt(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function azt(){return this.on("end.remove",szt(this._id))}function ozt(e){var t=this._name,n=this._id;typeof e!="function"&&(e=qW(e));for(var i=this._groups,r=i.length,s=new Array(r),o=0;o()=>e;function Rzt(e,{sourceEvent:t,target:n,transform:i,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:r}})}function Ap(e,t,n){this.k=e,this.x=t,this.y=n}Ap.prototype={constructor:Ap,scale:function(e){return e===1?this:new Ap(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ap(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var wL=new Ap(1,0,0);m8e.prototype=Ap.prototype;function m8e(e){for(;!e.__zoom;)if(!(e=e.parentNode))return wL;return e.__zoom}function Y$(e){e.stopImmediatePropagation()}function Rk(e){e.preventDefault(),e.stopImmediatePropagation()}function Izt(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Pzt(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function jae(){return this.__zoom||wL}function Dzt(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Mzt(){return navigator.maxTouchPoints||"ontouchstart"in this}function Lzt(e,t,n){var i=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(r>i?(i+r)/2:Math.min(0,i)||Math.max(0,r),o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o))}function g8e(){var e=Izt,t=Pzt,n=Lzt,i=Dzt,r=Mzt,s=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,c=JN,u=gL("start","zoom","end"),d,f,h,m=500,g=150,b=0,v=10;function y(D){D.property("__zoom",jae).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",j).on("dblclick.zoom",T).filter(r).on("touchstart.zoom",R).on("touchmove.zoom",A).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(D,I,P,_){var L=D.selection?D.selection():D;L.property("__zoom",jae),D!==L?k(D,I,P,_):L.interrupt().each(function(){S(this,arguments).event(_).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},y.scaleBy=function(D,I,P,_){y.scaleTo(D,function(){var L=this.__zoom.k,F=typeof I=="function"?I.apply(this,arguments):I;return L*F},P,_)},y.scaleTo=function(D,I,P,_){y.transform(D,function(){var L=t.apply(this,arguments),F=this.__zoom,M=P==null?O(L):typeof P=="function"?P.apply(this,arguments):P,V=F.invert(M),q=typeof I=="function"?I.apply(this,arguments):I;return n(x(w(F,q),M,V),L,o)},P,_)},y.translateBy=function(D,I,P,_){y.transform(D,function(){return n(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof P=="function"?P.apply(this,arguments):P),t.apply(this,arguments),o)},null,_)},y.translateTo=function(D,I,P,_,L){y.transform(D,function(){var F=t.apply(this,arguments),M=this.__zoom,V=_==null?O(F):typeof _=="function"?_.apply(this,arguments):_;return n(wL.translate(V[0],V[1]).scale(M.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof P=="function"?-P.apply(this,arguments):-P),F,o)},_,L)};function w(D,I){return I=Math.max(s[0],Math.min(s[1],I)),I===D.k?D:new Ap(I,D.x,D.y)}function x(D,I,P){var _=I[0]-P[0]*D.k,L=I[1]-P[1]*D.k;return _===D.x&&L===D.y?D:new Ap(D.k,_,L)}function O(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function k(D,I,P,_){D.on("start.zoom",function(){S(this,arguments).event(_).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(_).end()}).tween("zoom",function(){var L=this,F=arguments,M=S(L,F).event(_),V=t.apply(L,F),q=P==null?O(V):typeof P=="function"?P.apply(L,F):P,U=Math.max(V[1][0]-V[0][0],V[1][1]-V[0][1]),Z=L.__zoom,z=typeof I=="function"?I.apply(L,F):I,ee=c(Z.invert(q).concat(U/Z.k),z.invert(q).concat(U/z.k));return function(ne){if(ne===1)ne=z;else{var W=ee(ne),X=U/W[2];ne=new Ap(X,q[0]-W[0]*X,q[1]-W[1]*X)}M.zoom(null,ne)}})}function S(D,I,P){return!P&&D.__zooming||new C(D,I)}function C(D,I){this.that=D,this.args=I,this.active=0,this.sourceEvent=null,this.extent=t.apply(D,I),this.taps=0}C.prototype={event:function(D){return D&&(this.sourceEvent=D),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(D,I){return this.mouse&&D!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&D!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&D!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(D){var I=xu(this.that).datum();u.call(D,this.that,new Rzt(D,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:u}),I)}};function E(D,...I){if(!e.apply(this,arguments))return;var P=S(this,I).event(D),_=this.__zoom,L=Math.max(s[0],Math.min(s[1],_.k*Math.pow(2,i.apply(this,arguments)))),F=nf(D);if(P.wheel)(P.mouse[0][0]!==F[0]||P.mouse[0][1]!==F[1])&&(P.mouse[1]=_.invert(P.mouse[0]=F)),clearTimeout(P.wheel);else{if(_.k===L)return;P.mouse=[F,_.invert(F)],nR(this),P.start()}Rk(D),P.wheel=setTimeout(M,g),P.zoom("mouse",n(x(w(_,L),P.mouse[0],P.mouse[1]),P.extent,o));function M(){P.wheel=null,P.end()}}function j(D,...I){if(h||!e.apply(this,arguments))return;var P=D.currentTarget,_=S(this,I,!0).event(D),L=xu(D.view).on("mousemove.zoom",q,!0).on("mouseup.zoom",U,!0),F=nf(D,P),M=D.clientX,V=D.clientY;ZFe(D.view),Y$(D),_.mouse=[F,this.__zoom.invert(F)],nR(this),_.start();function q(Z){if(Rk(Z),!_.moved){var z=Z.clientX-M,ee=Z.clientY-V;_.moved=z*z+ee*ee>b}_.event(Z).zoom("mouse",n(x(_.that.__zoom,_.mouse[0]=nf(Z,P),_.mouse[1]),_.extent,o))}function U(Z){L.on("mousemove.zoom mouseup.zoom",null),JFe(Z.view,_.moved),Rk(Z),_.event(Z).end()}}function T(D,...I){if(e.apply(this,arguments)){var P=this.__zoom,_=nf(D.changedTouches?D.changedTouches[0]:D,this),L=P.invert(_),F=P.k*(D.shiftKey?.5:2),M=n(x(w(P,F),_,L),t.apply(this,I),o);Rk(D),l>0?xu(this).transition().duration(l).call(k,M,_,D):xu(this).call(y.transform,M,_,D)}}function R(D,...I){if(e.apply(this,arguments)){var P=D.touches,_=P.length,L=S(this,I,D.changedTouches.length===_).event(D),F,M,V,q;for(Y$(D),M=0;M<_;++M)V=P[M],q=nf(V,this),q=[q,this.__zoom.invert(q),V.identifier],L.touch0?!L.touch1&&L.touch0[2]!==q[2]&&(L.touch1=q,L.taps=0):(L.touch0=q,F=!0,L.taps=1+!!d);d&&(d=clearTimeout(d)),F&&(L.taps<2&&(f=q[0],d=setTimeout(function(){d=null},m)),nR(this),L.start())}}function A(D,...I){if(this.__zooming){var P=S(this,I).event(D),_=D.changedTouches,L=_.length,F,M,V,q;for(Rk(D),F=0;F`Seems like you have not used zustand provider as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:i})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:i}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},oA=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],b8e=["Enter"," ","Escape"],y8e={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var k1;(function(e){e.Strict="strict",e.Loose="loose"})(k1||(k1={}));var n0;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(n0||(n0={}));var lA;(function(e){e.Partial="partial",e.Full="full"})(lA||(lA={}));const v8e={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var cg;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(cg||(cg={}));var cA;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(cA||(cA={}));var vn;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(vn||(vn={}));const Nae={[vn.Left]:vn.Right,[vn.Right]:vn.Left,[vn.Top]:vn.Bottom,[vn.Bottom]:vn.Top};function x8e(e){return e===null?null:e?"valid":"invalid"}const w8e=e=>"id"in e&&"source"in e&&"target"in e,$zt=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),ZW=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),zT=(e,t=[0,0])=>{const{width:n,height:i}=wm(e),r=e.origin??t,s=n*r[0],o=i*r[1];return{x:e.position.x-s,y:e.position.y-o}},Fzt=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((i,r)=>{const s=typeof r=="string";let o=!t.nodeLookup&&!s?r:void 0;t.nodeLookup&&(o=s?t.nodeLookup.get(r):ZW(r)?r:t.nodeLookup.get(r.id));const l=o?AP(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return OL(i,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return kL(n)},VT=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},i=!1;return e.forEach(r=>{(t.filter===void 0||t.filter(r))&&(n=OL(n,AP(r)),i=!0)}),i?kL(n):{x:0,y:0,width:0,height:0}},JW=(e,t,[n,i,r]=[0,0,1],s=!1,o=!1)=>{const l={...wO(t,[n,i,r]),width:t.width/r,height:t.height/r},c=[];for(const u of e.values()){const{measured:d,selectable:f=!0,hidden:h=!1}=u;if(o&&!f||h)continue;const m=d.width??u.width??u.initialWidth??null,g=d.height??u.height??u.initialHeight??null,b=uA(l,E1(u)),v=(m??0)*(g??0),y=s&&b>0;(!u.internals.handleBounds||y||b>=v||u.dragging)&&c.push(u)}return c},Bzt=(e,t)=>{const n=new Set;return e.forEach(i=>{n.add(i.id)}),t.filter(i=>n.has(i.source)||n.has(i.target))};function Uzt(e,t){const n=new Map,i=t!=null&&t.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{r.measured.width&&r.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!r.hidden)&&(!i||i.has(r.id))&&n.set(r.id,r)}),n}async function Qzt({nodes:e,width:t,height:n,panZoom:i,minZoom:r,maxZoom:s},o){if(e.size===0)return!0;const l=Uzt(e,o),c=VT(l),u=tK(c,t,n,(o==null?void 0:o.minZoom)??r,(o==null?void 0:o.maxZoom)??s,(o==null?void 0:o.padding)??.1);return await i.setViewport(u,{duration:o==null?void 0:o.duration,ease:o==null?void 0:o.ease,interpolate:o==null?void 0:o.interpolate}),!0}function O8e({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:i=[0,0],nodeExtent:r,onError:s}){const o=n.get(e),l=o.parentId?n.get(o.parentId):void 0,{x:c,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},d=o.origin??i;let f=o.extent||r;if(o.extent==="parent"&&!o.expandParent)if(!l)s==null||s("005",Sf.error005());else{const m=l.measured.width,g=l.measured.height;m&&g&&(f=[[c,u],[c+m,u+g]])}else l&&N0(o.extent)&&(f=[[o.extent[0][0]+c,o.extent[0][1]+u],[o.extent[1][0]+c,o.extent[1][1]+u]]);const h=N0(f)?j0(t,f,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(s==null||s("015",Sf.error015())),{position:{x:h.x-c+(o.measured.width??0)*d[0],y:h.y-u+(o.measured.height??0)*d[1]},positionAbsolute:h}}async function zzt({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:i,onBeforeDelete:r}){const s=new Set(e.map(h=>h.id)),o=[];for(const h of n){if(h.deletable===!1)continue;const m=s.has(h.id),g=!m&&h.parentId&&o.find(b=>b.id===h.parentId);(m||g)&&o.push(h)}const l=new Set(t.map(h=>h.id)),c=i.filter(h=>h.deletable!==!1),d=Bzt(o,c);for(const h of c)l.has(h.id)&&!d.find(g=>g.id===h.id)&&d.push(h);if(!r)return{edges:d,nodes:o};const f=await r({nodes:o,edges:d});return typeof f=="boolean"?f?{edges:d,nodes:o}:{edges:[],nodes:[]}:f}const S1=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),j0=(e={x:0,y:0},t,n)=>({x:S1(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:S1(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function k8e(e,t,n){const{width:i,height:r}=wm(n),{x:s,y:o}=n.internals.positionAbsolute;return j0(e,[[s,o],[s+i,o+r]],t)}const Rae=(e,t,n)=>en?-S1(Math.abs(e-n),1,t)/t:0,eK=(e,t,n=15,i=40)=>{const r=Rae(e.x,i,t.width-i)*n,s=Rae(e.y,i,t.height-i)*n;return[r,s]},OL=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),M7=({x:e,y:t,width:n,height:i})=>({x:e,y:t,x2:e+n,y2:t+i}),kL=({x:e,y:t,x2:n,y2:i})=>({x:e,y:t,width:n-e,height:i-t}),E1=(e,t=[0,0])=>{var r,s;const{x:n,y:i}=ZW(e)?e.internals.positionAbsolute:zT(e,t);return{x:n,y:i,width:((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0,height:((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0}},AP=(e,t=[0,0])=>{var r,s;const{x:n,y:i}=ZW(e)?e.internals.positionAbsolute:zT(e,t);return{x:n,y:i,x2:n+(((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0),y2:i+(((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0)}},S8e=(e,t)=>kL(OL(M7(e),M7(t))),uA=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),i=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*i)},Iae=e=>df(e.width)&&df(e.height)&&df(e.x)&&df(e.y),df=e=>!isNaN(e)&&isFinite(e),E8e=(e,t)=>(n,i)=>{},HT=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),wO=({x:e,y:t},[n,i,r],s=!1,o=[1,1])=>{const l={x:(e-n)/r,y:(t-i)/r};return s?HT(l,o):l},C1=({x:e,y:t},[n,i,r])=>({x:e*r+n,y:t*r+i});function Hv(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Vzt(e,t,n){if(typeof e=="string"||typeof e=="number"){const i=Hv(e,n),r=Hv(e,t);return{top:i,right:r,bottom:i,left:r,x:r*2,y:i*2}}if(typeof e=="object"){const i=Hv(e.top??e.y??0,n),r=Hv(e.bottom??e.y??0,n),s=Hv(e.left??e.x??0,t),o=Hv(e.right??e.x??0,t);return{top:i,right:o,bottom:r,left:s,x:s+o,y:i+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Hzt(e,t,n,i,r,s){const{x:o,y:l}=C1(e,[t,n,i]),{x:c,y:u}=C1({x:e.x+e.width,y:e.y+e.height},[t,n,i]),d=r-c,f=s-u;return{left:Math.floor(o),top:Math.floor(l),right:Math.floor(d),bottom:Math.floor(f)}}const tK=(e,t,n,i,r,s)=>{const o=Vzt(s,t,n),l=(t-o.x)/e.width,c=(n-o.y)/e.height,u=Math.min(l,c),d=S1(u,i,r),f=e.x+e.width/2,h=e.y+e.height/2,m=t/2-f*d,g=n/2-h*d,b=Hzt(e,m,g,d,t,n),v={left:Math.min(b.left-o.left,0),top:Math.min(b.top-o.top,0),right:Math.min(b.right-o.right,0),bottom:Math.min(b.bottom-o.bottom,0)};return{x:m-v.left+v.right,y:g-v.top+v.bottom,zoom:d}},dA=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function N0(e){return e!=null&&e!=="parent"}function wm(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function nK(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function C8e(e,t={width:0,height:0},n,i,r){const s={...e},o=i.get(n);if(o){const l=o.origin||r;s.x+=o.internals.positionAbsolute.x-(t.width??0)*l[0],s.y+=o.internals.positionAbsolute.y-(t.height??0)*l[1]}return s}function Pae(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function qzt(){let e,t;return{promise:new Promise((i,r)=>{e=i,t=r}),resolve:e,reject:t}}function Wzt(e){return{...y8e,...e||{}}}function jE(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:i,containerBounds:r}){const{x:s,y:o}=ff(e),l=wO({x:s-((r==null?void 0:r.left)??0),y:o-((r==null?void 0:r.top)??0)},i),{x:c,y:u}=n?HT(l,t):l;return{xSnapped:c,ySnapped:u,...l}}const iK=e=>({width:e.offsetWidth,height:e.offsetHeight}),A8e=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},Kzt=["INPUT","SELECT","TEXTAREA"];function T8e(e){var i,r;const t=((r=(i=e.composedPath)==null?void 0:i.call(e))==null?void 0:r[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:Kzt.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const _8e=e=>"clientX"in e,ff=(e,t)=>{var s,o;const n=_8e(e),i=n?e.clientX:(s=e.touches)==null?void 0:s[0].clientX,r=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:i-((t==null?void 0:t.left)??0),y:r-((t==null?void 0:t.top)??0)}},Dae=(e,t,n,i,r)=>{const s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(o=>{const l=o.getBoundingClientRect();return{id:o.getAttribute("data-handleid"),type:e,nodeId:r,position:o.getAttribute("data-handlepos"),x:(l.left-n.left)/i,y:(l.top-n.top)/i,...iK(o)}})};function j8e({sourceX:e,sourceY:t,targetX:n,targetY:i,sourceControlX:r,sourceControlY:s,targetControlX:o,targetControlY:l}){const c=e*.125+r*.375+o*.375+n*.125,u=t*.125+s*.375+l*.375+i*.125,d=Math.abs(c-e),f=Math.abs(u-t);return[c,u,d,f]}function bj(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Mae({pos:e,x1:t,y1:n,x2:i,y2:r,c:s}){switch(e){case vn.Left:return[t-bj(t-i,s),n];case vn.Right:return[t+bj(i-t,s),n];case vn.Top:return[t,n-bj(n-r,s)];case vn.Bottom:return[t,n+bj(r-n,s)]}}function N8e({sourceX:e,sourceY:t,sourcePosition:n=vn.Bottom,targetX:i,targetY:r,targetPosition:s=vn.Top,curvature:o=.25}){const[l,c]=Mae({pos:n,x1:e,y1:t,x2:i,y2:r,c:o}),[u,d]=Mae({pos:s,x1:i,y1:r,x2:e,y2:t,c:o}),[f,h,m,g]=j8e({sourceX:e,sourceY:t,targetX:i,targetY:r,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${e},${t} C${l},${c} ${u},${d} ${i},${r}`,f,h,m,g]}function R8e({sourceX:e,sourceY:t,targetX:n,targetY:i}){const r=Math.abs(n-e)/2,s=n0}const Yzt=({source:e,sourceHandle:t,target:n,targetHandle:i})=>`xy-edge__${e}${t||""}-${n}${i||""}`,Zzt=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),Jzt=(e,t,n={})=>{var s;if(!e.source||!e.target)return(s=n.onError)==null||s.call(n,"006",Sf.error006()),t;const i=n.getEdgeId||Yzt;let r;return w8e(e)?r={...e}:r={...e,id:i(e)},Zzt(r,t)?t:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,t.concat(r))};function I8e({sourceX:e,sourceY:t,targetX:n,targetY:i}){const[r,s,o,l]=R8e({sourceX:e,sourceY:t,targetX:n,targetY:i});return[`M ${e},${t}L ${n},${i}`,r,s,o,l]}const Lae={[vn.Left]:{x:-1,y:0},[vn.Right]:{x:1,y:0},[vn.Top]:{x:0,y:-1},[vn.Bottom]:{x:0,y:1}},eVt=({source:e,sourcePosition:t=vn.Bottom,target:n})=>t===vn.Left||t===vn.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function tVt({source:e,sourcePosition:t=vn.Bottom,target:n,targetPosition:i=vn.Top,center:r,offset:s,stepPosition:o}){const l=Lae[t],c=Lae[i],u={x:e.x+l.x*s,y:e.y+l.y*s},d={x:n.x+c.x*s,y:n.y+c.y*s},f=eVt({source:u,sourcePosition:t,target:d}),h=f.x!==0?"x":"y",m=f[h];let g=[],b,v;const y={x:0,y:0},w={x:0,y:0},[,,x,O]=R8e({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[h]*c[h]===-1){h==="x"?(b=r.x??u.x+(d.x-u.x)*o,v=r.y??(u.y+d.y)/2):(b=r.x??(u.x+d.x)/2,v=r.y??u.y+(d.y-u.y)*o);const E=[{x:b,y:u.y},{x:b,y:d.y}],j=[{x:u.x,y:v},{x:d.x,y:v}];l[h]===m?g=h==="x"?E:j:g=h==="x"?j:E}else{const E=[{x:u.x,y:d.y}],j=[{x:d.x,y:u.y}];if(h==="x"?g=l.x===m?j:E:g=l.y===m?E:j,t===i){const D=Math.abs(e[h]-n[h]);if(D<=s){const I=Math.min(s-1,s-D);l[h]===m?y[h]=(u[h]>e[h]?-1:1)*I:w[h]=(d[h]>n[h]?-1:1)*I}}if(t!==i){const D=h==="x"?"y":"x",I=l[h]===c[D],P=u[D]>d[D],_=u[D]=N?(b=(T.x+R.x)/2,v=g[0].y):(b=g[0].x,v=(T.y+R.y)/2)}const k={x:u.x+y.x,y:u.y+y.y},S={x:d.x+w.x,y:d.y+w.y};return[[e,...k.x!==g[0].x||k.y!==g[0].y?[k]:[],...g,...S.x!==g[g.length-1].x||S.y!==g[g.length-1].y?[S]:[],n],b,v,x,O]}function nVt(e,t,n,i){const r=Math.min($ae(e,t)/2,$ae(t,n)/2,i),{x:s,y:o}=t;if(e.x===s&&s===n.x||e.y===o&&o===n.y)return`L${s} ${o}`;if(e.y===o){const u=e.xn.id===t):e[0])||null}function L7(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`:""}function rVt(e,{id:t,defaultColor:n,defaultMarkerStart:i,defaultMarkerEnd:r}){const s=new Set;return e.reduce((o,l)=>([l.markerStart||i,l.markerEnd||r].forEach(c=>{if(c&&typeof c=="object"){const u=L7(c,t);s.has(u)||(o.push({id:u,color:c.color||n,...c}),s.add(u))}}),o),[]).sort((o,l)=>o.id.localeCompare(l.id))}const P8e=1e3,sVt=10,rK={nodeOrigin:[0,0],nodeExtent:oA,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},aVt={...rK,checkEquality:!0};function sK(e,t){const n={...e};for(const i in t)t[i]!==void 0&&(n[i]=t[i]);return n}function oVt(e,t,n){const i=sK(rK,n);for(const r of e.values())if(r.parentId)oK(r,e,t,i);else{const s=zT(r,i.nodeOrigin),o=N0(r.extent)?r.extent:i.nodeExtent,l=j0(s,o,wm(r));r.internals.positionAbsolute=l}}function lVt(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],i=[];for(const r of e.handles){const s={id:r.id,width:r.width??1,height:r.height??1,nodeId:e.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?n.push(s):r.type==="target"&&i.push(s)}return{source:n,target:i}}function aK(e){return e==="manual"}function $7(e,t,n,i={}){var d,f;const r=sK(aVt,i),s={i:0},o=new Map(t),l=r!=null&&r.elevateNodesOnSelect&&!aK(r.zIndexMode)?P8e:0;let c=e.length>0,u=!1;t.clear(),n.clear();for(const h of e){let m=o.get(h.id);if(r.checkEquality&&h===(m==null?void 0:m.internals.userNode))t.set(h.id,m);else{const g=zT(h,r.nodeOrigin),b=N0(h.extent)?h.extent:r.nodeExtent,v=j0(g,b,wm(h));m={...r.defaults,...h,measured:{width:(d=h.measured)==null?void 0:d.width,height:(f=h.measured)==null?void 0:f.height},internals:{positionAbsolute:v,handleBounds:lVt(h,m),z:D8e(h,l,r.zIndexMode),userNode:h}},t.set(h.id,m)}(m.measured===void 0||m.measured.width===void 0||m.measured.height===void 0)&&!m.hidden&&(c=!1),h.parentId&&oK(m,t,n,i,s),u||(u=h.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:u}}function cVt(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function oK(e,t,n,i,r){const{elevateNodesOnSelect:s,nodeOrigin:o,nodeExtent:l,zIndexMode:c}=sK(rK,i),u=e.parentId,d=t.get(u);if(!d){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}cVt(e,n),r&&!d.parentId&&d.internals.rootParentIndex===void 0&&c==="auto"&&(d.internals.rootParentIndex=++r.i,d.internals.z=d.internals.z+r.i*sVt),r&&d.internals.rootParentIndex!==void 0&&(r.i=d.internals.rootParentIndex);const f=s&&!aK(c)?P8e:0,{x:h,y:m,z:g}=uVt(e,d,o,l,f,c),{positionAbsolute:b}=e.internals,v=h!==b.x||m!==b.y;(v||g!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:h,y:m}:b,z:g}})}function D8e(e,t,n){const i=df(e.zIndex)?e.zIndex:0;return aK(n)?i:i+(e.selected?t:0)}function uVt(e,t,n,i,r,s){const{x:o,y:l}=t.internals.positionAbsolute,c=wm(e),u=zT(e,n),d=N0(e.extent)?j0(u,e.extent,c):u;let f=j0({x:o+d.x,y:l+d.y},i,c);e.extent==="parent"&&(f=k8e(f,c,t));const h=D8e(e,r,s),m=t.internals.z??0;return{x:f.x,y:f.y,z:m>=h?m+1:h}}function lK(e,t,n,i=[0,0]){var o;const r=[],s=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const u=((o=s.get(l.parentId))==null?void 0:o.expandedRect)??E1(c),d=S8e(u,l.rect);s.set(l.parentId,{expandedRect:d,parent:c})}return s.size>0&&s.forEach(({expandedRect:l,parent:c},u)=>{var x;const d=c.internals.positionAbsolute,f=wm(c),h=c.origin??i,m=l.x0||g>0||y||w)&&(r.push({id:u,type:"position",position:{x:c.position.x-m+y,y:c.position.y-g+w}}),(x=n.get(u))==null||x.forEach(O=>{e.some(k=>k.id===O.id)||r.push({id:O.id,type:"position",position:{x:O.position.x+m,y:O.position.y+g}})})),(f.width0){const m=lK(h,t,n,r);u.push(...m)}return{changes:u,updatedInternals:c}}async function fVt({delta:e,panZoom:t,transform:n,translateExtent:i,width:r,height:s}){if(!t||!e.x&&!e.y)return!1;const o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,s]],i);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function Qae(e,t,n,i,r,s){let o=r;const l=i.get(o)||new Map;i.set(o,l.set(n,t)),o=`${r}-${e}`;const c=i.get(o)||new Map;if(i.set(o,c.set(n,t)),s){o=`${r}-${e}-${s}`;const u=i.get(o)||new Map;i.set(o,u.set(n,t))}}function M8e(e,t,n){e.clear(),t.clear();for(const i of n){const{source:r,target:s,sourceHandle:o=null,targetHandle:l=null}=i,c={edgeId:i.id,source:r,target:s,sourceHandle:o,targetHandle:l},u=`${r}-${o}--${s}-${l}`,d=`${s}-${l}--${r}-${o}`;Qae("source",c,d,e,r,o),Qae("target",c,u,e,s,l),t.set(i.id,i)}}function L8e(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:L8e(n,t):!1}function zae(e,t,n){var r;let i=e;do{if((r=i==null?void 0:i.matches)!=null&&r.call(i,t))return!0;if(i===n)return!1;i=i==null?void 0:i.parentElement}while(i);return!1}function hVt(e,t,n,i){const r=new Map;for(const[s,o]of e)if((o.selected||o.id===i)&&(!o.parentId||!L8e(o,e))&&(o.draggable||t&&typeof o.draggable>"u")){const l=e.get(s);l&&r.set(s,{id:s,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return r}function Z$({nodeId:e,dragItems:t,nodeLookup:n,dragging:i=!0}){var o,l,c;const r=[];for(const[u,d]of t){const f=(o=n.get(u))==null?void 0:o.internals.userNode;f&&r.push({...f,position:d.position,dragging:i})}if(!e)return[r[0],r];const s=(l=n.get(e))==null?void 0:l.internals.userNode;return[s?{...s,position:((c=t.get(e))==null?void 0:c.position)||s.position,dragging:i}:r[0],r]}function pVt({dragItems:e,snapGrid:t,x:n,y:i}){const r=e.values().next().value;if(!r)return null;const s={x:n-r.distance.x,y:i-r.distance.y},o=HT(s,t);return{x:o.x-s.x,y:o.y-s.y}}function mVt({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:i,onDragStop:r}){let s={x:null,y:null},o=0,l=new Map,c=!1,u={x:0,y:0},d=null,f=!1,h=null,m=!1,g=!1,b=null;function v({noDragClassName:w,handleSelector:x,domNode:O,isSelectable:k,nodeId:S,nodeClickDistance:C=0}){h=xu(O);function E({x:A,y:N}){const{nodeLookup:D,nodeExtent:I,snapGrid:P,snapToGrid:_,nodeOrigin:L,onNodeDrag:F,onSelectionDrag:M,onError:V,updateNodePositions:q}=t();s={x:A,y:N};let U=!1;const Z=l.size>1,z=Z&&I?M7(VT(l)):null,ee=Z&&_?pVt({dragItems:l,snapGrid:P,x:A,y:N}):null;for(const[ne,W]of l){if(!D.has(ne))continue;let X={x:A-W.distance.x,y:N-W.distance.y};_&&(X=ee?{x:Math.round(X.x+ee.x),y:Math.round(X.y+ee.y)}:HT(X,P));let H=null;if(Z&&I&&!W.extent&&z){const{positionAbsolute:K}=W.internals,ie=K.x-z.x+I[0][0],J=K.x+W.measured.width-z.x2+I[1][0],ye=K.y-z.y+I[0][1],de=K.y+W.measured.height-z.y2+I[1][1];H=[[ie,ye],[J,de]]}const{position:ae,positionAbsolute:Y}=O8e({nodeId:ne,nextPosition:X,nodeLookup:D,nodeExtent:H||I,nodeOrigin:L,onError:V});U=U||W.position.x!==ae.x||W.position.y!==ae.y,W.position=ae,W.internals.positionAbsolute=Y}if(g=g||U,!!U&&(q(l,!0),b&&(i||F||!S&&M))){const[ne,W]=Z$({nodeId:S,dragItems:l,nodeLookup:D});i==null||i(b,l,ne,W),F==null||F(b,ne,W),S||M==null||M(b,W)}}async function j(){if(!d)return;const{transform:A,panBy:N,autoPanSpeed:D,autoPanOnNodeDrag:I}=t();if(!I){c=!1,cancelAnimationFrame(o);return}const[P,_]=eK(u,d,D);(P!==0||_!==0)&&(s.x=(s.x??0)-P/A[2],s.y=(s.y??0)-_/A[2],await N({x:P,y:_})&&E(s)),o=requestAnimationFrame(j)}function T(A){var Z;const{nodeLookup:N,multiSelectionActive:D,nodesDraggable:I,transform:P,snapGrid:_,snapToGrid:L,selectNodesOnDrag:F,onNodeDragStart:M,onSelectionDragStart:V,unselectNodesAndEdges:q}=t();f=!0,(!F||!k)&&!D&&S&&((Z=N.get(S))!=null&&Z.selected||q()),k&&F&&S&&(e==null||e(S));const U=jE(A.sourceEvent,{transform:P,snapGrid:_,snapToGrid:L,containerBounds:d});if(s=U,l=hVt(N,I,U,S),l.size>0&&(n||M||!S&&V)){const[z,ee]=Z$({nodeId:S,dragItems:l,nodeLookup:N});n==null||n(A.sourceEvent,l,z,ee),M==null||M(A.sourceEvent,z,ee),S||V==null||V(A.sourceEvent,ee)}}const R=e8e().clickDistance(C).on("start",A=>{const{domNode:N,nodeDragThreshold:D,transform:I,snapGrid:P,snapToGrid:_}=t();d=(N==null?void 0:N.getBoundingClientRect())||null,m=!1,g=!1,b=A.sourceEvent,D===0&&T(A),s=jE(A.sourceEvent,{transform:I,snapGrid:P,snapToGrid:_,containerBounds:d}),u=ff(A.sourceEvent,d)}).on("drag",A=>{const{autoPanOnNodeDrag:N,transform:D,snapGrid:I,snapToGrid:P,nodeDragThreshold:_,nodeLookup:L}=t(),F=jE(A.sourceEvent,{transform:D,snapGrid:I,snapToGrid:P,containerBounds:d});if(b=A.sourceEvent,(A.sourceEvent.type==="touchmove"&&A.sourceEvent.touches.length>1||S&&!L.has(S))&&(m=!0),!m){if(!c&&N&&f&&(c=!0,j()),!f){const M=ff(A.sourceEvent,d),V=M.x-u.x,q=M.y-u.y;Math.sqrt(V*V+q*q)>_&&T(A)}(s.x!==F.xSnapped||s.y!==F.ySnapped)&&l&&f&&(u=ff(A.sourceEvent,d),E(F))}}).on("end",A=>{if(!f||m){m&&l.size>0&&t().updateNodePositions(l,!1);return}if(c=!1,f=!1,cancelAnimationFrame(o),l.size>0){const{nodeLookup:N,updateNodePositions:D,onNodeDragStop:I,onSelectionDragStop:P}=t();if(g&&(D(l,!1),g=!1),r||I||!S&&P){const[_,L]=Z$({nodeId:S,dragItems:l,nodeLookup:N,dragging:!1});r==null||r(A.sourceEvent,l,_,L),I==null||I(A.sourceEvent,_,L),S||P==null||P(A.sourceEvent,L)}}}).filter(A=>{const N=A.target;return!A.button&&(!w||!zae(N,`.${w}`,O))&&(!x||zae(N,x,O))});h.call(R)}function y(){h==null||h.on(".drag",null)}return{update:v,destroy:y}}function gVt(e,t,n){const i=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const s of t.values())uA(r,E1(s))>0&&i.push(s);return i}const bVt=250;function yVt(e,t,n,i){var l,c;let r=[],s=1/0;const o=gVt(e,n,t+bVt);for(const u of o){const d=[...((l=u.internals.handleBounds)==null?void 0:l.source)??[],...((c=u.internals.handleBounds)==null?void 0:c.target)??[]];for(const f of d){if(i.nodeId===f.nodeId&&i.type===f.type&&i.id===f.id)continue;const{x:h,y:m}=R0(u,f,f.position,!0),g=Math.sqrt(Math.pow(h-e.x,2)+Math.pow(m-e.y,2));g>t||(g1){const u=i.type==="source"?"target":"source";return r.find(d=>d.type===u)??r[0]}return r[0]}function $8e(e,t,n,i,r,s=!1){var u,d,f;const o=i.get(e);if(!o)return null;const l=r==="strict"?(u=o.internals.handleBounds)==null?void 0:u[t]:[...((d=o.internals.handleBounds)==null?void 0:d.source)??[],...((f=o.internals.handleBounds)==null?void 0:f.target)??[]],c=(n?l==null?void 0:l.find(h=>h.id===n):l==null?void 0:l[0])??null;return c&&s?{...c,...R0(o,c,c.position,!0)}:c}function F8e(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function vVt(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const B8e=()=>!0;function xVt(e,{connectionMode:t,connectionRadius:n,handleId:i,nodeId:r,edgeUpdaterType:s,isTarget:o,domNode:l,nodeLookup:c,lib:u,autoPanOnConnect:d,flowId:f,panBy:h,cancelConnection:m,onConnectStart:g,onConnect:b,onConnectEnd:v,isValidConnection:y=B8e,onReconnectEnd:w,updateConnection:x,getTransform:O,getFromHandle:k,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:E}){const j=A8e(e.target);let T=0,R;const{x:A,y:N}=ff(e),D=F8e(s,E),I=l==null?void 0:l.getBoundingClientRect();let P=!1;if(!I||!D)return;const _=$8e(r,D,i,c,t);if(!_)return;let L=ff(e,I),F=!1,M=null,V=!1,q=null;function U(){if(!d||!I)return;const[ae,Y]=eK(L,I,S);h({x:ae,y:Y}),T=requestAnimationFrame(U)}const Z={..._,nodeId:r,type:D,position:_.position},z=c.get(r);let ne={inProgress:!0,isValid:null,from:R0(z,Z,vn.Left,!0),fromHandle:Z,fromPosition:Z.position,fromNode:z,to:L,toHandle:null,toPosition:Nae[Z.position],toNode:null,pointer:L};function W(){P=!0,x(ne),g==null||g(e,{nodeId:r,handleId:i,handleType:D})}C===0&&W();function X(ae){if(!P){const{x:de,y:ge}=ff(ae),Ee=de-A,xe=ge-N;if(!(Ee*Ee+xe*xe>C*C))return;W()}if(!k()||!Z){H(ae);return}const Y=O();L=ff(ae,I),R=yVt(wO(L,Y,!1,[1,1]),n,c,Z),F||(U(),F=!0);const K=U8e(ae,{handle:R,connectionMode:t,fromNodeId:r,fromHandleId:i,fromType:o?"target":"source",isValidConnection:y,doc:j,lib:u,flowId:f,nodeLookup:c});q=K.handleDomNode,M=K.connection,V=vVt(!!R,K.isValid);const ie=c.get(r),J=ie?R0(ie,Z,vn.Left,!0):ne.from,ye={...ne,from:J,isValid:V,to:K.toHandle&&V?C1({x:K.toHandle.x,y:K.toHandle.y},Y):L,toHandle:K.toHandle,toPosition:V&&K.toHandle?K.toHandle.position:Nae[Z.position],toNode:K.toHandle?c.get(K.toHandle.nodeId):null,pointer:L};x(ye),ne=ye}function H(ae){if(!("touches"in ae&&ae.touches.length>0)){if(P){(R||q)&&M&&V&&(b==null||b(M));const{inProgress:Y,...K}=ne,ie={...K,toPosition:ne.toHandle?ne.toPosition:null};v==null||v(ae,ie),s&&(w==null||w(ae,ie))}m(),cancelAnimationFrame(T),F=!1,V=!1,M=null,q=null,j.removeEventListener("mousemove",X),j.removeEventListener("mouseup",H),j.removeEventListener("touchmove",X),j.removeEventListener("touchend",H)}}j.addEventListener("mousemove",X),j.addEventListener("mouseup",H),j.addEventListener("touchmove",X),j.addEventListener("touchend",H)}function U8e(e,{handle:t,connectionMode:n,fromNodeId:i,fromHandleId:r,fromType:s,doc:o,lib:l,flowId:c,isValidConnection:u=B8e,nodeLookup:d}){const f=s==="target",h=t?o.querySelector(`.${l}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:m,y:g}=ff(e),b=o.elementFromPoint(m,g),v=b!=null&&b.classList.contains(`${l}-flow__handle`)?b:h,y={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const w=F8e(void 0,v),x=v.getAttribute("data-nodeid"),O=v.getAttribute("data-handleid"),k=v.classList.contains("connectable"),S=v.classList.contains("connectableend");if(!x||!w)return y;const C={source:f?x:i,sourceHandle:f?O:r,target:f?i:x,targetHandle:f?r:O};y.connection=C;const j=k&&S&&(n===k1.Strict?f&&w==="source"||!f&&w==="target":x!==i||O!==r);y.isValid=j&&u(C),y.toHandle=$8e(x,w,O,d,n,!0)}return y}const F7={onPointerDown:xVt,isValid:U8e};function wVt({domNode:e,panZoom:t,getTransform:n,getViewScale:i}){const r=xu(e);function s({translateExtent:l,width:c,height:u,zoomStep:d=1,pannable:f=!0,zoomable:h=!0,inversePan:m=!1}){const g=x=>{if(x.sourceEvent.type!=="wheel"||!t)return;const O=n(),k=x.sourceEvent.ctrlKey&&dA()?10:1,S=-x.sourceEvent.deltaY*(x.sourceEvent.deltaMode===1?.05:x.sourceEvent.deltaMode?1:.002)*d,C=O[2]*Math.pow(2,S*k);t.scaleTo(C)};let b=[0,0];const v=x=>{(x.sourceEvent.type==="mousedown"||x.sourceEvent.type==="touchstart")&&(b=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY])},y=x=>{const O=n();if(x.sourceEvent.type!=="mousemove"&&x.sourceEvent.type!=="touchmove"||!t)return;const k=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY],S=[k[0]-b[0],k[1]-b[1]];b=k;const C=i()*Math.max(O[2],Math.log(O[2]))*(m?-1:1),E={x:O[0]-S[0]*C,y:O[1]-S[1]*C},j=[[0,0],[c,u]];t.setViewportConstrained({x:E.x,y:E.y,zoom:O[2]},j,l)},w=g8e().on("start",v).on("zoom",f?y:null).on("zoom.wheel",h?g:null);r.call(w,{})}function o(){r.on("zoom",null)}return{update:s,destroy:o,pointer:nf}}const SL=e=>({x:e.x,y:e.y,zoom:e.k}),J$=({x:e,y:t,zoom:n})=>wL.translate(e,t).scale(n),zx=(e,t)=>e.target.closest(`.${t}`),Q8e=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),OVt=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,e6=(e,t=0,n=OVt,i=()=>{})=>{const r=typeof t=="number"&&t>0;return r||i(),r?e.transition().duration(t).ease(n).on("end",i):e},z8e=e=>{const t=e.ctrlKey&&dA()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function kVt({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:i,panOnScrollMode:r,panOnScrollSpeed:s,zoomOnPinch:o,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:u}){return d=>{if(zx(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(d.ctrlKey&&o){const v=nf(d),y=z8e(d),w=f*Math.pow(2,y);i.scaleTo(n,w,v,d);return}const h=d.deltaMode===1?20:1;let m=r===n0.Vertical?0:d.deltaX*h,g=r===n0.Horizontal?0:d.deltaY*h;!dA()&&d.shiftKey&&r!==n0.Vertical&&(m=d.deltaY*h,g=0),i.translateBy(n,-(m/f)*s,-(g/f)*s,{internal:!0});const b=SL(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(d,b),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,b),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(d,b))}}function SVt({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(i,r){const s=i.type==="wheel",o=!t&&s&&!i.ctrlKey,l=zx(i,e);if(i.ctrlKey&&s&&l&&i.preventDefault(),o||l)return null;i.preventDefault(),n.call(this,i,r)}}function EVt({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return i=>{var s,o,l;if((s=i.sourceEvent)!=null&&s.internal)return;const r=SL(i.transform);e.mouseButton=((o=i.sourceEvent)==null?void 0:o.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=r,((l=i.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(i.sourceEvent,r))}}function CVt({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:i,onPanZoom:r}){return s=>{var o,l;e.usedRightMouseButton=!!(n&&Q8e(t,e.mouseButton??0)),(o=s.sourceEvent)!=null&&o.sync||i([s.transform.x,s.transform.y,s.transform.k]),r&&!((l=s.sourceEvent)!=null&&l.internal)&&(r==null||r(s.sourceEvent,SL(s.transform)))}}function AVt({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:i,onPanZoomEnd:r,onPaneContextMenu:s}){return o=>{var l;if(!((l=o.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,s&&Q8e(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&s(o.sourceEvent),e.usedRightMouseButton=!1,i(!1),r)){const c=SL(o.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r==null||r(o.sourceEvent,c)},n?150:0)}}}function TVt({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:i,panOnScroll:r,zoomOnDoubleClick:s,userSelectionActive:o,noWheelClassName:l,noPanClassName:c,lib:u,connectionInProgress:d}){return f=>{var v;const h=e||t,m=n&&f.ctrlKey,g=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(zx(f,`${u}-flow__node`)||zx(f,`${u}-flow__edge`)))return!0;if(!i&&!h&&!r&&!s&&!n||o||d&&!g||zx(f,l)&&g||zx(f,c)&&(!g||r&&g&&!e)||!n&&f.ctrlKey&&g)return!1;if(!n&&f.type==="touchstart"&&((v=f.touches)==null?void 0:v.length)>1)return f.preventDefault(),!1;if(!h&&!r&&!m&&g||!i&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(i)&&!i.includes(f.button)&&f.type==="mousedown")return!1;const b=Array.isArray(i)&&i.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||g)&&b}}function _Vt({domNode:e,minZoom:t,maxZoom:n,translateExtent:i,viewport:r,onPanZoom:s,onPanZoomStart:o,onPanZoomEnd:l,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=g8e().scaleExtent([t,n]).translateExtent(i),h=xu(e).call(f);w({x:r.x,y:r.y,zoom:S1(r.zoom,t,n)},[[0,0],[d.width,d.height]],i);const m=h.on("wheel.zoom"),g=h.on("dblclick.zoom");f.wheelDelta(z8e);async function b(R,A){return h?new Promise(N=>{f==null||f.interpolate((A==null?void 0:A.interpolate)==="linear"?_E:JN).transform(e6(h,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>N(!0)),R)}):!1}function v({noWheelClassName:R,noPanClassName:A,onPaneContextMenu:N,userSelectionActive:D,panOnScroll:I,panOnDrag:P,panOnScrollMode:_,panOnScrollSpeed:L,preventScrolling:F,zoomOnPinch:M,zoomOnScroll:V,zoomOnDoubleClick:q,zoomActivationKeyPressed:U,lib:Z,onTransformChange:z,connectionInProgress:ee,paneClickDistance:ne,selectionOnDrag:W}){D&&!u.isZoomingOrPanning&&y();const X=I&&!U&&!D;f.clickDistance(W?1/0:!df(ne)||ne<0?0:ne);const H=X?kVt({zoomPanValues:u,noWheelClassName:R,d3Selection:h,d3Zoom:f,panOnScrollMode:_,panOnScrollSpeed:L,zoomOnPinch:M,onPanZoomStart:o,onPanZoom:s,onPanZoomEnd:l}):SVt({noWheelClassName:R,preventScrolling:F,d3ZoomHandler:m});h.on("wheel.zoom",H,{passive:!1});const ae=EVt({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:o});f.on("start",ae);const Y=CVt({zoomPanValues:u,panOnDrag:P,onPaneContextMenu:!!N,onPanZoom:s,onTransformChange:z});f.on("zoom",Y);const K=AVt({zoomPanValues:u,panOnDrag:P,panOnScroll:I,onPaneContextMenu:N,onPanZoomEnd:l,onDraggingChange:c});f.on("end",K);const ie=TVt({zoomActivationKeyPressed:U,panOnDrag:P,zoomOnScroll:V,panOnScroll:I,zoomOnDoubleClick:q,zoomOnPinch:M,userSelectionActive:D,noPanClassName:A,noWheelClassName:R,lib:Z,connectionInProgress:ee});f.filter(ie),q?h.on("dblclick.zoom",g):h.on("dblclick.zoom",null)}function y(){f.on("zoom",null)}async function w(R,A,N){const D=J$(R),I=f==null?void 0:f.constrain()(D,A,N);return I&&await b(I),I}async function x(R,A){const N=J$(R);return await b(N,A),N}function O(R){if(h){const A=J$(R),N=h.property("__zoom");(N.k!==R.zoom||N.x!==R.x||N.y!==R.y)&&(f==null||f.transform(h,A,null,{sync:!0}))}}function k(){const R=h?m8e(h.node()):{x:0,y:0,k:1};return{x:R.x,y:R.y,zoom:R.k}}async function S(R,A){return h?new Promise(N=>{f==null||f.interpolate((A==null?void 0:A.interpolate)==="linear"?_E:JN).scaleTo(e6(h,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>N(!0)),R)}):!1}async function C(R,A){return h?new Promise(N=>{f==null||f.interpolate((A==null?void 0:A.interpolate)==="linear"?_E:JN).scaleBy(e6(h,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>N(!0)),R)}):!1}function E(R){f==null||f.scaleExtent(R)}function j(R){f==null||f.translateExtent(R)}function T(R){const A=!df(R)||R<0?0:R;f==null||f.clickDistance(A)}return{update:v,destroy:y,setViewport:x,setViewportConstrained:w,getViewport:k,scaleTo:S,scaleBy:C,setScaleExtent:E,setTranslateExtent:j,syncViewport:O,setClickDistance:T}}var A1;(function(e){e.Line="line",e.Handle="handle"})(A1||(A1={}));function jVt({width:e,prevWidth:t,height:n,prevHeight:i,affectsX:r,affectsY:s}){const o=e-t,l=n-i,c=[o>0?1:o<0?-1:0,l>0?1:l<0?-1:0];return o&&r&&(c[0]=c[0]*-1),l&&s&&(c[1]=c[1]*-1),c}function Vae(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),i=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:i,affectsY:r}}function Fm(e,t){return Math.max(0,t-e)}function Bm(e,t){return Math.max(0,e-t)}function yj(e,t,n){return Math.max(0,t-e,e-n)}function Hae(e,t){return e?!t:t}function NVt(e,t,n,i,r,s,o,l){let{affectsX:c,affectsY:u}=t;const{isHorizontal:d,isVertical:f}=t,h=d&&f,{xSnapped:m,ySnapped:g}=n,{minWidth:b,maxWidth:v,minHeight:y,maxHeight:w}=i,{x,y:O,width:k,height:S,aspectRatio:C}=e;let E=Math.floor(d?m-e.pointerX:0),j=Math.floor(f?g-e.pointerY:0);const T=k+(c?-E:E),R=S+(u?-j:j),A=-s[0]*k,N=-s[1]*S;let D=yj(T,b,v),I=yj(R,y,w);if(o){let L=0,F=0;c&&E<0?L=Fm(x+E+A,o[0][0]):!c&&E>0&&(L=Bm(x+T+A,o[1][0])),u&&j<0?F=Fm(O+j+N,o[0][1]):!u&&j>0&&(F=Bm(O+R+N,o[1][1])),D=Math.max(D,L),I=Math.max(I,F)}if(l){let L=0,F=0;c&&E>0?L=Bm(x+E,l[0][0]):!c&&E<0&&(L=Fm(x+T,l[1][0])),u&&j>0?F=Bm(O+j,l[0][1]):!u&&j<0&&(F=Fm(O+R,l[1][1])),D=Math.max(D,L),I=Math.max(I,F)}if(r){if(d){const L=yj(T/C,y,w)*C;if(D=Math.max(D,L),o){let F=0;!c&&!u||c&&!u&&h?F=Bm(O+N+T/C,o[1][1])*C:F=Fm(O+N+(c?E:-E)/C,o[0][1])*C,D=Math.max(D,F)}if(l){let F=0;!c&&!u||c&&!u&&h?F=Fm(O+T/C,l[1][1])*C:F=Bm(O+(c?E:-E)/C,l[0][1])*C,D=Math.max(D,F)}}if(f){const L=yj(R*C,b,v)/C;if(I=Math.max(I,L),o){let F=0;!c&&!u||u&&!c&&h?F=Bm(x+R*C+A,o[1][0])/C:F=Fm(x+(u?j:-j)*C+A,o[0][0])/C,I=Math.max(I,F)}if(l){let F=0;!c&&!u||u&&!c&&h?F=Fm(x+R*C,l[1][0])/C:F=Bm(x+(u?j:-j)*C,l[0][0])/C,I=Math.max(I,F)}}}j=j+(j<0?I:-I),E=E+(E<0?D:-D),r&&(h?T>R*C?j=(Hae(c,u)?-E:E)/C:E=(Hae(c,u)?-j:j)*C:d?(j=E/C,u=c):(E=j*C,c=u));const P=c?x+E:x,_=u?O+j:O;return{width:k+(c?-E:E),height:S+(u?-j:j),x:s[0]*E*(c?-1:1)+P,y:s[1]*j*(u?-1:1)+_}}const V8e={width:0,height:0,x:0,y:0},RVt={...V8e,pointerX:0,pointerY:0,aspectRatio:1};function IVt(e,t,n){const i=t.position.x+e.position.x,r=t.position.y+e.position.y,s=e.measured.width??0,o=e.measured.height??0,l=n[0]*s,c=n[1]*o;return[[i-l,r-c],[i+s-l,r+o-c]]}function PVt({domNode:e,nodeId:t,getStoreItems:n,onChange:i,onEnd:r}){const s=xu(e);let o={controlDirection:Vae("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:u,boundaries:d,keepAspectRatio:f,resizeDirection:h,onResizeStart:m,onResize:g,onResizeEnd:b,shouldResize:v}){let y={...V8e},w={...RVt};o={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:Vae(u)};let x,O=null,k=[],S,C,E,j=!1;const T=e8e().on("start",R=>{const{nodeLookup:A,transform:N,snapGrid:D,snapToGrid:I,nodeOrigin:P,paneDomNode:_}=n();if(x=A.get(t),!x)return;O=(_==null?void 0:_.getBoundingClientRect())??null;const{xSnapped:L,ySnapped:F}=jE(R.sourceEvent,{transform:N,snapGrid:D,snapToGrid:I,containerBounds:O});y={width:x.measured.width??0,height:x.measured.height??0,x:x.position.x??0,y:x.position.y??0},w={...y,pointerX:L,pointerY:F,aspectRatio:y.width/y.height},S=void 0,C=N0(x.extent)?x.extent:void 0,x.parentId&&(x.extent==="parent"||x.expandParent)&&(S=A.get(x.parentId)),S&&x.extent==="parent"&&(C=[[0,0],[S.measured.width,S.measured.height]]),k=[],E=void 0;for(const[M,V]of A)if(V.parentId===t&&(k.push({id:M,position:{...V.position},extent:V.extent}),V.extent==="parent"||V.expandParent)){const q=IVt(V,x,V.origin??P);E?E=[[Math.min(q[0][0],E[0][0]),Math.min(q[0][1],E[0][1])],[Math.max(q[1][0],E[1][0]),Math.max(q[1][1],E[1][1])]]:E=q}m==null||m(R,{...y})}).on("drag",R=>{const{transform:A,snapGrid:N,snapToGrid:D,nodeOrigin:I}=n(),P=jE(R.sourceEvent,{transform:A,snapGrid:N,snapToGrid:D,containerBounds:O}),_=[];if(!x)return;const{x:L,y:F,width:M,height:V}=y,q={},U=x.origin??I,{width:Z,height:z,x:ee,y:ne}=NVt(w,o.controlDirection,P,o.boundaries,o.keepAspectRatio,U,C,E),W=Z!==M,X=z!==V,H=ee!==L&&W,ae=ne!==F&&X;if(!H&&!ae&&!W&&!X)return;if((H||ae||U[0]===1||U[1]===1)&&(q.x=H?ee:y.x,q.y=ae?ne:y.y,y.x=q.x,y.y=q.y,k.length>0)){const J=ee-L,ye=ne-F;for(const de of k)de.position={x:de.position.x-J+U[0]*(Z-M),y:de.position.y-ye+U[1]*(z-V)},_.push(de)}if((W||X)&&(q.width=W&&(!o.resizeDirection||o.resizeDirection==="horizontal")?Z:y.width,q.height=X&&(!o.resizeDirection||o.resizeDirection==="vertical")?z:y.height,y.width=q.width,y.height=q.height),S&&x.expandParent){const J=U[0]*(q.width??0);q.x&&q.x{j&&(b==null||b(R,{...y}),r==null||r({...y}),j=!1)});s.call(T)}function c(){s.on(".drag",null)}return{update:l,destroy:c}}const DVt={},qae=e=>{let t;const n=new Set,i=(d,f)=>{const h=typeof d=="function"?d(t):d;if(!Object.is(h,t)){const m=t;t=f??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(g=>g(t,m))}},r=()=>t,c={setState:i,getState:r,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(DVt?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=t=e(i,r,c);return c},MVt=e=>e?qae(e):qae,{useDebugValue:LVt}=Ni,{useSyncExternalStoreWithSelector:$Vt}=vnt,FVt=e=>e;function H8e(e,t=FVt,n){const i=$Vt(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return LVt(i),i}const Wae=(e,t)=>{const n=MVt(e),i=(r,s=t)=>H8e(n,r,s);return Object.assign(i,n),i},BVt=(e,t)=>e?Wae(e,t):Wae;function zs(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[i,r]of e)if(!Object.is(r,t.get(i)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const i of n)if(!Object.prototype.hasOwnProperty.call(t,i)||!Object.is(e[i],t[i]))return!1;return!0}const EL=p.createContext(null),UVt=EL.Provider,q8e=Sf.error001("react");function ir(e,t){const n=p.useContext(EL);if(n===null)throw new Error(q8e);return H8e(n,e,t)}function Vs(){const e=p.useContext(EL);if(e===null)throw new Error(q8e);return p.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Kae={display:"none"},QVt={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},W8e="react-flow__node-desc",K8e="react-flow__edge-desc",zVt="react-flow__aria-live",VVt=e=>e.ariaLiveMessage,HVt=e=>e.ariaLabelConfig;function qVt({rfId:e}){const t=ir(VVt);return a.jsx("div",{id:`${zVt}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:QVt,children:t})}function WVt({rfId:e,disableKeyboardA11y:t}){const n=ir(HVt);return a.jsxs(a.Fragment,{children:[a.jsx("div",{id:`${W8e}-${e}`,style:Kae,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),a.jsx("div",{id:`${K8e}-${e}`,style:Kae,children:n["edge.a11yDescription.default"]}),!t&&a.jsx(qVt,{rfId:e})]})}const CL=p.forwardRef(({position:e="top-left",children:t,className:n,style:i,...r},s)=>{const o=`${e}`.split("-");return a.jsx("div",{className:eo(["react-flow__panel",n,...o]),style:i,ref:s,...r,children:t})});CL.displayName="Panel";function KVt({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:a.jsx(CL,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:a.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const GVt=e=>{const t=[],n=[];for(const[,i]of e.nodeLookup)i.selected&&t.push(i.internals.userNode);for(const[,i]of e.edgeLookup)i.selected&&n.push(i);return{selectedNodes:t,selectedEdges:n}},vj=e=>e.id;function XVt(e,t){return zs(e.selectedNodes.map(vj),t.selectedNodes.map(vj))&&zs(e.selectedEdges.map(vj),t.selectedEdges.map(vj))}function YVt({onSelectionChange:e}){const t=Vs(),{selectedNodes:n,selectedEdges:i}=ir(GVt,XVt);return p.useEffect(()=>{const r={nodes:n,edges:i};e==null||e(r),t.getState().onSelectionChangeHandlers.forEach(s=>s(r))},[n,i,e]),null}const ZVt=e=>!!e.onSelectionChangeHandlers;function JVt({onSelectionChange:e}){const t=ir(ZVt);return e||t?a.jsx(YVt,{onSelectionChange:e}):null}const G8e=[0,0],eHt={x:0,y:0,zoom:1},tHt=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],Gae=[...tHt,"rfId"],nHt=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),Xae={translateExtent:oA,nodeOrigin:G8e,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function iHt(e){const{setNodes:t,setEdges:n,setMinZoom:i,setMaxZoom:r,setTranslateExtent:s,setNodeExtent:o,reset:l,setDefaultNodesAndEdges:c}=ir(nHt,zs),u=Vs();p.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{d.current=Xae,l()}),[]);const d=p.useRef(Xae);return p.useEffect(()=>{for(const f of Gae){const h=e[f],m=d.current[f];h!==m&&(typeof e[f]>"u"||(f==="nodes"?t(h):f==="edges"?n(h):f==="minZoom"?i(h):f==="maxZoom"?r(h):f==="translateExtent"?s(h):f==="nodeExtent"?o(h):f==="ariaLabelConfig"?u.setState({ariaLabelConfig:Wzt(h)}):f==="fitView"?u.setState({fitViewQueued:h}):f==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[f]:h})))}d.current=e},Gae.map(f=>e[f])),null}function Yae(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function rHt(e){var i;const[t,n]=p.useState(e==="system"?null:e);return p.useEffect(()=>{if(e!=="system"){n(e);return}const r=Yae(),s=()=>n(r!=null&&r.matches?"dark":"light");return s(),r==null||r.addEventListener("change",s),()=>{r==null||r.removeEventListener("change",s)}},[e]),t!==null?t:(i=Yae())!=null&&i.matches?"dark":"light"}const Zae=typeof document<"u"?document:null;function fA(e=null,t={target:Zae,actInsideInputWithModifier:!0}){const[n,i]=p.useState(!1),r=p.useRef(!1),s=p.useRef(new Set([])),[o,l]=p.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",` `).replace(` `,` +`).split(` -`)),d=u.reduce((f,h)=>f.concat(...h),[]);return[u,d]}return[[],[]]},[e]);return p.useEffect(()=>{const c=(t==null?void 0:t.target)??Yae,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=m=>{var v,y;if(r.current=m.ctrlKey||m.metaKey||m.shiftKey||m.altKey,(!r.current||r.current&&!u)&&A8e(m))return!1;const b=Jae(m.code,l);if(s.current.add(m[b]),Zae(o,s.current,!1)){const w=((y=(v=m.composedPath)==null?void 0:v.call(m))==null?void 0:y[0])||m.target,x=(w==null?void 0:w.nodeName)==="BUTTON"||(w==null?void 0:w.nodeName)==="A";t.preventDefault!==!1&&(r.current||!x)&&m.preventDefault(),i(!0)}},f=m=>{const g=Jae(m.code,l);Zae(o,s.current,!0)?(i(!1),s.current.clear()):s.current.delete(m[g]),m.key==="Meta"&&s.current.clear(),r.current=!1},h=()=>{s.current.clear(),i(!1)};return c==null||c.addEventListener("keydown",d),c==null||c.addEventListener("keyup",f),window.addEventListener("blur",h),window.addEventListener("contextmenu",h),()=>{c==null||c.removeEventListener("keydown",d),c==null||c.removeEventListener("keyup",f),window.removeEventListener("blur",h),window.removeEventListener("contextmenu",h)}}},[e,i]),n}function Zae(e,t,n){return e.filter(i=>n||i.length===t.size).some(i=>i.every(r=>t.has(r)))}function Jae(e,t){return t.includes(e)?"code":"key"}const iHt=()=>{const e=Vs();return p.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:i}=e.getState();return i?i.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[i,r,s],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??i,y:t.y??r,zoom:t.zoom??s},n),!0):!1},getViewport:()=>{const[t,n,i]=e.getState().transform;return{x:t,y:n,zoom:i}},setCenter:async(t,n,i)=>e.getState().setCenter(t,n,i),fitBounds:async(t,n)=>{const{width:i,height:r,minZoom:s,maxZoom:o,panZoom:l}=e.getState(),c=eK(t,i,r,s,o,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(c,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:i,snapGrid:r,snapToGrid:s,domNode:o}=e.getState();if(!o)return t;const{x:l,y:c}=o.getBoundingClientRect(),u={x:t.x-l,y:t.y-c},d=n.snapGrid??r,f=n.snapToGrid??s;return xO(u,i,f,d)},flowToScreenPosition:t=>{const{transform:n,domNode:i}=e.getState();if(!i)return t;const{x:r,y:s}=i.getBoundingClientRect(),o=E1(t,n);return{x:o.x+r,y:o.y+s}}}),[])};function G8e(e,t){const n=[],i=new Map,r=[];for(const s of e)if(s.type==="add"){r.push(s);continue}else if(s.type==="remove"||s.type==="replace")i.set(s.id,[s]);else{const o=i.get(s.id);o?o.push(s):i.set(s.id,[s])}for(const s of t){const o=i.get(s.id);if(!o){n.push(s);continue}if(o[0].type==="remove")continue;if(o[0].type==="replace"){n.push({...o[0].item});continue}const l={...s};for(const c of o)rHt(c,l);n.push(l)}return r.length&&r.forEach(s=>{s.index!==void 0?n.splice(s.index,0,{...s.item}):n.push({...s.item})}),n}function rHt(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function X8e(e,t){return G8e(e,t)}function Y8e(e,t){return G8e(e,t)}function yy(e,t){return{id:e,type:"select",selected:t}}function zx(e,t=new Set,n=!1){const i=[];for(const[r,s]of e){const o=t.has(r);!(s.selected===void 0&&!o)&&s.selected!==o&&(n&&(s.selected=o),i.push(yy(s.id,o)))}return i}function eoe({items:e=[],lookup:t}){var r;const n=[],i=new Map(e.map(s=>[s.id,s]));for(const[s,o]of e.entries()){const l=t.get(o.id),c=((r=l==null?void 0:l.internals)==null?void 0:r.userNode)??l;c!==void 0&&c!==o&&n.push({id:o.id,item:o,type:"replace"}),c===void 0&&n.push({item:o,type:"add",index:s})}for(const[s]of t)i.get(s)===void 0&&n.push({id:s,type:"remove"});return n}function toe(e){return{id:e.id,type:"remove"}}const sHt=S8e();function aHt(e,t,n={}){return Yzt(e,t,{...n,onError:n.onError??sHt})}const noe=e=>Mzt(e),oHt=e=>x8e(e);function Z8e(e){return p.forwardRef(e)}const lHt=typeof window<"u"?p.useLayoutEffect:p.useEffect;function ioe(e){const[t,n]=p.useState(BigInt(0)),[i]=p.useState(()=>cHt(()=>n(r=>r+BigInt(1))));return lHt(()=>{const r=i.get();r.length&&(e(r),i.reset())},[t]),i}function cHt(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const J8e=p.createContext(null);function uHt({children:e}){const t=Vs(),n=p.useCallback(l=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:d,onNodesChange:f,nodeLookup:h,fitViewQueued:m,onNodesChangeMiddlewareMap:g}=t.getState();let b=c;for(const y of l)b=typeof y=="function"?y(b):y;let v=eoe({items:b,lookup:h});for(const y of g.values())v=y(v);d&&u(b),v.length>0?f==null||f(v):m&&window.requestAnimationFrame(()=>{const{fitViewQueued:y,nodes:w,setNodes:x}=t.getState();y&&x(w)})},[]),i=ioe(n),r=p.useCallback(l=>{const{edges:c=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:f,edgeLookup:h}=t.getState();let m=c;for(const g of l)m=typeof g=="function"?g(m):g;d?u(m):f&&f(eoe({items:m,lookup:h}))},[]),s=ioe(r),o=p.useMemo(()=>({nodeQueue:i,edgeQueue:s}),[]);return a.jsx(J8e.Provider,{value:o,children:e})}function dHt(){const e=p.useContext(J8e);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const fHt=e=>!!e.panZoom;function AL(){const e=iHt(),t=Vs(),n=dHt(),i=ir(fHt),r=p.useMemo(()=>{const s=f=>t.getState().nodeLookup.get(f),o=f=>{n.nodeQueue.push(f)},l=f=>{n.edgeQueue.push(f)},c=f=>{var y,w;const{nodeLookup:h,nodeOrigin:m}=t.getState(),g=noe(f)?f:h.get(f.id),b=g.parentId?E8e(g.position,g.measured,g.parentId,h,m):g.position,v={...g,position:b,width:((y=g.measured)==null?void 0:y.width)??g.width,height:((w=g.measured)==null?void 0:w.height)??g.height};return S1(v)},u=(f,h,m={replace:!1})=>{o(g=>g.map(b=>{if(b.id===f){const v=typeof h=="function"?h(b):h;return m.replace&&noe(v)?v:{...b,...v}}return b}))},d=(f,h,m={replace:!1})=>{l(g=>g.map(b=>{if(b.id===f){const v=typeof h=="function"?h(b):h;return m.replace&&oHt(v)?v:{...b,...v}}return b}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var h;return(h=s(f))==null?void 0:h.internals.userNode},getInternalNode:s,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(h=>({...h}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:o,setEdges:l,addNodes:f=>{const h=Array.isArray(f)?f:[f];n.nodeQueue.push(m=>[...m,...h])},addEdges:f=>{const h=Array.isArray(f)?f:[f];n.edgeQueue.push(m=>[...m,...h])},toObject:()=>{const{nodes:f=[],edges:h=[],transform:m}=t.getState(),[g,b,v]=m;return{nodes:f.map(y=>({...y})),edges:h.map(y=>({...y})),viewport:{x:g,y:b,zoom:v}}},deleteElements:async({nodes:f=[],edges:h=[]})=>{const{nodes:m,edges:g,onNodesDelete:b,onEdgesDelete:v,triggerNodeChanges:y,triggerEdgeChanges:w,onDelete:x,onBeforeDelete:O}=t.getState(),{nodes:k,edges:S}=await Uzt({nodesToRemove:f,edgesToRemove:h,nodes:m,edges:g,onBeforeDelete:O}),C=S.length>0,E=k.length>0;if(C){const j=S.map(toe);v==null||v(S),w(j)}if(E){const j=k.map(toe);b==null||b(k),y(j)}return(E||C)&&(x==null||x({nodes:k,edges:S})),{deletedNodes:k,deletedEdges:S}},getIntersectingNodes:(f,h=!0,m)=>{const g=Rae(f),b=g?f:c(f),v=m!==void 0;return b?(m||t.getState().nodes).filter(y=>{const w=t.getState().nodeLookup.get(y.id);if(w&&!g&&(y.id===f.id||!w.internals.positionAbsolute))return!1;const x=S1(v?y:w),O=cA(x,b);return h&&O>0||O>=x.width*x.height||O>=b.width*b.height}):[]},isNodeIntersecting:(f,h,m=!0)=>{const b=Rae(f)?f:c(f);if(!b)return!1;const v=cA(b,h);return m&&v>0||v>=h.width*h.height||v>=b.width*b.height},updateNode:u,updateNodeData:(f,h,m={replace:!1})=>{u(f,g=>{const b=typeof h=="function"?h(g):h;return m.replace?{...g,data:b}:{...g,data:{...g.data,...b}}},m)},updateEdge:d,updateEdgeData:(f,h,m={replace:!1})=>{d(f,g=>{const b=typeof h=="function"?h(g):h;return m.replace?{...g,data:b}:{...g,data:{...g.data,...b}}},m)},getNodesBounds:f=>{const{nodeLookup:h,nodeOrigin:m}=t.getState();return Lzt(f,{nodeLookup:h,nodeOrigin:m})},getHandleConnections:({type:f,id:h,nodeId:m})=>{var g;return Array.from(((g=t.getState().connectionLookup.get(`${m}-${f}${h?`-${h}`:""}`))==null?void 0:g.values())??[])},getNodeConnections:({type:f,handleId:h,nodeId:m})=>{var g;return Array.from(((g=t.getState().connectionLookup.get(`${m}${f?h?`-${f}-${h}`:`-${f}`:""}`))==null?void 0:g.values())??[])},fitView:async f=>{const h=t.getState().fitViewResolver??Vzt();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:h}),n.nodeQueue.push(m=>[...m]),h.promise}}},[]);return p.useMemo(()=>({...r,...e,viewportInitialized:i}),[i])}const roe=e=>e.selected,hHt=typeof window<"u"?window:void 0;function pHt({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Vs(),{deleteElements:i}=AL(),r=dA(e,{actInsideInputWithModifier:!1}),s=dA(t,{target:hHt});p.useEffect(()=>{if(r){const{edges:o,nodes:l}=n.getState();i({nodes:l.filter(roe),edges:o.filter(roe)}),n.setState({nodesSelectionActive:!1})}},[r]),p.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])}function mHt(e){const t=Vs();p.useEffect(()=>{const n=()=>{var r,s,o,l;if(!e.current||!(((s=(r=e.current).checkVisibility)==null?void 0:s.call(r))??!0))return!1;const i=nK(e.current);(i.height===0||i.width===0)&&((l=(o=t.getState()).onError)==null||l.call(o,"004",kf.error004())),t.setState({width:i.width||500,height:i.height||500})};if(e.current){n(),window.addEventListener("resize",n);const i=new ResizeObserver(()=>n());return i.observe(e.current),()=>{window.removeEventListener("resize",n),i&&e.current&&i.unobserve(e.current)}}},[])}const TL={position:"absolute",width:"100%",height:"100%",top:0,left:0},gHt=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function bHt({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:i=!1,panOnScrollSpeed:r=.5,panOnScrollMode:s=t0.Free,zoomOnDoubleClick:o=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:m=!0,children:g,noWheelClassName:b,noPanClassName:v,onViewportChange:y,isControlledViewport:w,paneClickDistance:x,selectionOnDrag:O}){const k=Vs(),S=p.useRef(null),{userSelectionActive:C,lib:E,connectionInProgress:j}=ir(gHt,zs),T=dA(h),R=p.useRef();mHt(S);const A=p.useCallback(N=>{y==null||y({x:N[0],y:N[1],zoom:N[2]}),w||k.setState({transform:N})},[y,w]);return p.useEffect(()=>{if(S.current){R.current=AVt({domNode:S.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:c,onDraggingChange:D=>k.setState(_=>_.paneDragging===D?_:{paneDragging:D}),onPanZoomStart:(D,_)=>{const{onViewportChangeStart:L,onMoveStart:F}=k.getState();F==null||F(D,_),L==null||L(_)},onPanZoom:(D,_)=>{const{onViewportChange:L,onMove:F}=k.getState();F==null||F(D,_),L==null||L(_)},onPanZoomEnd:(D,_)=>{const{onViewportChangeEnd:L,onMoveEnd:F}=k.getState();F==null||F(D,_),L==null||L(_)}});const{x:N,y:P,zoom:I}=R.current.getViewport();return k.setState({panZoom:R.current,transform:[N,P,I],domNode:S.current.closest(".react-flow")}),()=>{var D;(D=R.current)==null||D.destroy()}}},[]),p.useEffect(()=>{var N;(N=R.current)==null||N.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:i,panOnScrollSpeed:r,panOnScrollMode:s,zoomOnDoubleClick:o,panOnDrag:l,zoomActivationKeyPressed:T,preventScrolling:m,noPanClassName:v,userSelectionActive:C,noWheelClassName:b,lib:E,onTransformChange:A,connectionInProgress:j,selectionOnDrag:O,paneClickDistance:x})},[e,t,n,i,r,s,o,l,T,m,v,C,b,E,A,j,O,x]),a.jsx("div",{className:"react-flow__renderer",ref:S,style:TL,children:g})}const yHt=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function vHt(){const{userSelectionActive:e,userSelectionRect:t}=ir(yHt,zs);return e&&t?a.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const e6=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},xHt=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function wHt({isSelecting:e,selectionKeyPressed:t,selectionMode:n=oA.Full,panOnDrag:i,autoPanOnSelection:r,paneClickDistance:s,selectionOnDrag:o,onSelectionStart:l,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:f,onPaneMouseEnter:h,onPaneMouseMove:m,onPaneMouseLeave:g,children:b}){const v=p.useRef(0),y=Vs(),{userSelectionActive:w,elementsSelectable:x,dragging:O,connectionInProgress:k,panBy:S,autoPanSpeed:C}=ir(xHt,zs),E=x&&(e||w),j=p.useRef(null),T=p.useRef(),R=p.useRef(new Set),A=p.useRef(new Set),N=p.useRef(!1),P=p.useRef({x:0,y:0}),I=p.useRef(!1),D=W=>{if(N.current||k){N.current=!1;return}u==null||u(W),y.getState().resetSelectedElements(),y.setState({nodesSelectionActive:!1})},_=W=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){W.preventDefault();return}d==null||d(W)},L=f?W=>f(W):void 0,F=W=>{N.current&&(W.stopPropagation(),N.current=!1)},M=W=>{var ue,pe;const{domNode:G,transform:H}=y.getState();if(T.current=G==null?void 0:G.getBoundingClientRect(),!T.current)return;const se=W.target===j.current;if(!se&&!!W.target.closest(".nokey")||!e||!(o&&se||t)||W.button!==0||!W.isPrimary)return;(pe=(ue=W.target)==null?void 0:ue.setPointerCapture)==null||pe.call(ue,W.pointerId),N.current=!1;const{x:ie,y:ee}=df(W.nativeEvent,T.current),be=xO({x:ie,y:ee},H);y.setState({userSelectionRect:{width:0,height:0,startX:be.x,startY:be.y,x:ie,y:ee}}),se||(W.stopPropagation(),W.preventDefault())};function V(W,G){const{userSelectionRect:H}=y.getState();if(!H)return;const{transform:se,nodeLookup:Y,edgeLookup:X,connectionLookup:ie,triggerNodeChanges:ee,triggerEdgeChanges:be,defaultEdgeOptions:ue}=y.getState(),pe={x:H.startX,y:H.startY},{x:ke,y:je}=E1(pe,se),Pe={startX:pe.x,startY:pe.y,x:Wae.id)),A.current=new Set;const _e=(ue==null?void 0:ue.selectable)??!0;for(const ae of R.current){const le=ie.get(ae);if(le)for(const{edgeId:ge}of le.values()){const Oe=X.get(ge);Oe&&(Oe.selectable??_e)&&A.current.add(ge)}}if(!Iae(Ee,R.current)){const ae=zx(Y,R.current,!0);ee(ae)}if(!Iae(ze,A.current)){const ae=zx(X,A.current);be(ae)}y.setState({userSelectionRect:Pe,userSelectionActive:!0,nodesSelectionActive:!1})}function q(){if(!r||!T.current)return;const[W,G]=JW(P.current,T.current,C);S({x:W,y:G}).then(H=>{if(!N.current||!H){v.current=requestAnimationFrame(q);return}const{x:se,y:Y}=P.current;V(se,Y),v.current=requestAnimationFrame(q)})}const U=()=>{cancelAnimationFrame(v.current),v.current=0,I.current=!1};p.useEffect(()=>()=>U(),[]);const J=W=>{const{userSelectionRect:G,transform:H,resetSelectedElements:se}=y.getState();if(!T.current||!G)return;const{x:Y,y:X}=df(W.nativeEvent,T.current);P.current={x:Y,y:X};const ie=E1({x:G.startX,y:G.startY},H);if(!N.current){const ee=t?0:s;if(Math.hypot(Y-ie.x,X-ie.y)<=ee)return;se(),l==null||l(W)}N.current=!0,I.current||(q(),I.current=!0),V(Y,X)},z=W=>{var G,H;W.button===0&&((H=(G=W.target)==null?void 0:G.releasePointerCapture)==null||H.call(G,W.pointerId),!w&&W.target===j.current&&y.getState().userSelectionRect&&(D==null||D(W)),y.setState({userSelectionActive:!1,userSelectionRect:null}),N.current&&(c==null||c(W),y.setState({nodesSelectionActive:R.current.size>0})),U())},Z=W=>{var G,H;(H=(G=W.target)==null?void 0:G.releasePointerCapture)==null||H.call(G,W.pointerId),U()},ne=i===!0||Array.isArray(i)&&i.includes(0);return a.jsxs("div",{className:eo(["react-flow__pane",{draggable:ne,dragging:O,selection:e}]),onClick:E?void 0:e6(D,j),onContextMenu:e6(_,j),onWheel:e6(L,j),onPointerEnter:E?void 0:h,onPointerMove:E?J:m,onPointerUp:E?z:void 0,onPointerCancel:E?Z:void 0,onPointerDownCapture:E?M:void 0,onClickCapture:E?F:void 0,onPointerLeave:g,ref:j,style:TL,children:[b,a.jsx(vHt,{})]})}function F7({id:e,store:t,unselect:n=!1,nodeRef:i}){const{addSelectedNodes:r,unselectNodesAndEdges:s,multiSelectionActive:o,nodeLookup:l,onError:c}=t.getState(),u=l.get(e);if(!u){c==null||c("012",kf.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&o)&&(s({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var d;return(d=i==null?void 0:i.current)==null?void 0:d.blur()})):r([e])}function eBe({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:i,nodeId:r,isSelectable:s,nodeClickDistance:o}){const l=Vs(),[c,u]=p.useState(!1),d=p.useRef();return p.useEffect(()=>{d.current=hVt({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{F7({id:f,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),p.useEffect(()=>{if(!(t||!e.current||!d.current))return d.current.update({noDragClassName:n,handleSelector:i,domNode:e.current,isSelectable:s,nodeId:r,nodeClickDistance:o}),()=>{var f;(f=d.current)==null||f.destroy()}},[n,i,t,s,e,r,o]),c}const OHt=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function tBe(){const e=Vs();return p.useCallback(n=>{const{nodeExtent:i,snapToGrid:r,snapGrid:s,nodesDraggable:o,onError:l,updateNodePositions:c,nodeLookup:u,nodeOrigin:d}=e.getState(),f=new Map,h=OHt(o),m=r?s[0]:5,g=r?s[1]:5,b=n.direction.x*m*n.factor,v=n.direction.y*g*n.factor;for(const[,y]of u){if(!h(y))continue;let w={x:y.internals.positionAbsolute.x+b,y:y.internals.positionAbsolute.y+v};r&&(w=VT(w,s));const{position:x,positionAbsolute:O}=w8e({nodeId:y.id,nextPosition:w,nodeLookup:u,nodeExtent:i,nodeOrigin:d,onError:l});y.position=x,y.internals.positionAbsolute=O,f.set(y.id,y)}c(f)},[])}const lK=p.createContext(null),kHt=lK.Provider;lK.Consumer;const nBe=()=>p.useContext(lK),SHt=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),EHt=(e,t,n)=>i=>{const{connectionClickStartHandle:r,connectionMode:s,connection:o}=i,{fromHandle:l,toHandle:c,isValid:u}=o,d=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:d,clickConnecting:(r==null?void 0:r.nodeId)===e&&(r==null?void 0:r.id)===t&&(r==null?void 0:r.type)===n,isPossibleEndHandle:s===O1.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!r,valid:d&&u}};function CHt({type:e="source",position:t=vn.Top,isValidConnection:n,isConnectable:i=!0,isConnectableStart:r=!0,isConnectableEnd:s=!0,id:o,onConnect:l,children:c,className:u,onMouseDown:d,onTouchStart:f,...h},m){var I,D;const g=o||null,b=e==="target",v=Vs(),y=nBe(),{connectOnClick:w,noPanClassName:x,rfId:O}=ir(SHt,zs),{connectingFrom:k,connectingTo:S,clickConnecting:C,isPossibleEndHandle:E,connectionInProcess:j,clickConnectionInProcess:T,valid:R}=ir(EHt(y,g,e),zs);y||(D=(I=v.getState()).onError)==null||D.call(I,"010",kf.error010());const A=_=>{const{defaultEdgeOptions:L,onConnect:F,hasDefaultEdges:M}=v.getState(),V={...L,..._};if(M){const{edges:q,setEdges:U,onError:J}=v.getState();U(aHt(V,q,{onError:J}))}F==null||F(V),l==null||l(V)},N=_=>{if(!y)return;const L=T8e(_.nativeEvent);if(r&&(L&&_.button===0||!L)){const F=v.getState();$7.onPointerDown(_.nativeEvent,{handleDomNode:_.currentTarget,autoPanOnConnect:F.autoPanOnConnect,connectionMode:F.connectionMode,connectionRadius:F.connectionRadius,domNode:F.domNode,nodeLookup:F.nodeLookup,lib:F.lib,isTarget:b,handleId:g,nodeId:y,flowId:F.rfId,panBy:F.panBy,cancelConnection:F.cancelConnection,onConnectStart:F.onConnectStart,onConnectEnd:(...M)=>{var V,q;return(q=(V=v.getState()).onConnectEnd)==null?void 0:q.call(V,...M)},updateConnection:F.updateConnection,onConnect:A,isValidConnection:n||((...M)=>{var V,q;return((q=(V=v.getState()).isValidConnection)==null?void 0:q.call(V,...M))??!0}),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:F.autoPanSpeed,dragThreshold:F.connectionDragThreshold})}L?d==null||d(_):f==null||f(_)},P=_=>{const{onClickConnectStart:L,onClickConnectEnd:F,connectionClickStartHandle:M,connectionMode:V,isValidConnection:q,lib:U,rfId:J,nodeLookup:z,connection:Z}=v.getState();if(!y||!M&&!r)return;if(!M){L==null||L(_.nativeEvent,{nodeId:y,handleId:g,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:y,type:e,id:g}});return}const ne=C8e(_.target),W=n||q,{connection:G,isValid:H}=$7.isValid(_.nativeEvent,{handle:{nodeId:y,id:g,type:e},connectionMode:V,fromNodeId:M.nodeId,fromHandleId:M.id||null,fromType:M.type,isValidConnection:W,flowId:J,doc:ne,lib:U,nodeLookup:z});H&&G&&A(G);const se=structuredClone(Z);delete se.inProgress,se.toPosition=se.toHandle?se.toHandle.position:null,F==null||F(_,se),v.setState({connectionClickStartHandle:null})};return a.jsx("div",{"data-handleid":g,"data-nodeid":y,"data-handlepos":t,"data-id":`${O}-${y}-${g}-${e}`,className:eo(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",x,u,{source:!b,target:b,connectable:i,connectablestart:r,connectableend:s,clickconnecting:C,connectingfrom:k,connectingto:S,valid:R,connectionindicator:i&&(!j||E)&&(j||T?s:r)}]),onMouseDown:N,onTouchStart:N,onClick:w?P:void 0,ref:m,...h,children:c})}const $c=p.memo(Z8e(CHt));function AHt({data:e,isConnectable:t,sourcePosition:n=vn.Bottom}){return a.jsxs(a.Fragment,{children:[e==null?void 0:e.label,a.jsx($c,{type:"source",position:n,isConnectable:t})]})}function THt({data:e,isConnectable:t,targetPosition:n=vn.Top,sourcePosition:i=vn.Bottom}){return a.jsxs(a.Fragment,{children:[a.jsx($c,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,a.jsx($c,{type:"source",position:i,isConnectable:t})]})}function _Ht(){return null}function jHt({data:e,isConnectable:t,targetPosition:n=vn.Top}){return a.jsxs(a.Fragment,{children:[a.jsx($c,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const _P={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},soe={input:AHt,default:THt,output:jHt,group:_Ht};function NHt(e){var t,n,i,r;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((i=e.style)==null?void 0:i.width),height:e.height??((r=e.style)==null?void 0:r.height)}}const RHt=e=>{const{width:t,height:n,x:i,y:r}=zT(e.nodeLookup,{filter:s=>!!s.selected});return{width:uf(t)?t:null,height:uf(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${i}px,${r}px)`}};function IHt({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const i=Vs(),{width:r,height:s,transformString:o,userSelectionActive:l}=ir(RHt,zs),c=tBe(),u=p.useRef(null);p.useEffect(()=>{var m;n||(m=u.current)==null||m.focus({preventScroll:!0})},[n]);const d=!l&&r!==null&&s!==null;if(eBe({nodeRef:u,disabled:!d}),!d)return null;const f=e?m=>{const g=i.getState().nodes.filter(b=>b.selected);e(m,g)}:void 0,h=m=>{Object.prototype.hasOwnProperty.call(_P,m.key)&&(m.preventDefault(),c({direction:_P[m.key],factor:m.shiftKey?4:1}))};return a.jsx("div",{className:eo(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:a.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:r,height:s}})})}const aoe=typeof window<"u"?window:void 0,PHt=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function iBe({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:o,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:d,selectionMode:f,onSelectionStart:h,onSelectionEnd:m,multiSelectionKeyCode:g,panActivationKeyCode:b,zoomActivationKeyCode:v,elementsSelectable:y,zoomOnScroll:w,zoomOnPinch:x,panOnScroll:O,panOnScrollSpeed:k,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:E,autoPanOnSelection:j,defaultViewport:T,translateExtent:R,minZoom:A,maxZoom:N,preventScrolling:P,onSelectionContextMenu:I,noWheelClassName:D,noPanClassName:_,disableKeyboardA11y:L,onViewportChange:F,isControlledViewport:M}){const{nodesSelectionActive:V,userSelectionActive:q}=ir(PHt,zs),U=dA(u,{target:aoe}),J=dA(b,{target:aoe}),z=J||E,Z=J||O,ne=d&&z!==!0,W=U||q||ne;return pHt({deleteKeyCode:c,multiSelectionKeyCode:g}),a.jsx(bHt,{onPaneContextMenu:s,elementsSelectable:y,zoomOnScroll:w,zoomOnPinch:x,panOnScroll:Z,panOnScrollSpeed:k,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:!U&&z,defaultViewport:T,translateExtent:R,minZoom:A,maxZoom:N,zoomActivationKeyCode:v,preventScrolling:P,noWheelClassName:D,noPanClassName:_,onViewportChange:F,isControlledViewport:M,paneClickDistance:l,selectionOnDrag:ne,children:a.jsxs(wHt,{onSelectionStart:h,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:o,panOnDrag:z,autoPanOnSelection:j,isSelecting:!!W,selectionMode:f,selectionKeyPressed:U,paneClickDistance:l,selectionOnDrag:ne,children:[e,V&&a.jsx(IHt,{onSelectionContextMenu:I,noPanClassName:_,disableKeyboardA11y:L})]})})}iBe.displayName="FlowRenderer";const DHt=p.memo(iBe),MHt=e=>t=>e?ZW(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function LHt(e){return ir(p.useCallback(MHt(e),[e]),zs)}const $Ht=e=>e.updateNodeInternals;function FHt(){const e=ir($Ht),[t]=p.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const i=new Map;n.forEach(r=>{const s=r.target.getAttribute("data-id");i.set(s,{id:s,nodeElement:r.target,force:!0})}),e(i)}));return p.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function BHt({node:e,nodeType:t,hasDimensions:n,resizeObserver:i}){const r=Vs(),s=p.useRef(null),o=p.useRef(null),l=p.useRef(e.sourcePosition),c=p.useRef(e.targetPosition),u=p.useRef(t),d=n&&!!e.internals.handleBounds;return p.useEffect(()=>{s.current&&!e.hidden&&(!d||o.current!==s.current)&&(o.current&&(i==null||i.unobserve(o.current)),i==null||i.observe(s.current),o.current=s.current)},[d,e.hidden]),p.useEffect(()=>()=>{o.current&&(i==null||i.unobserve(o.current),o.current=null)},[]),p.useEffect(()=>{if(s.current){const f=u.current!==t,h=l.current!==e.sourcePosition,m=c.current!==e.targetPosition;(f||h||m)&&(u.current=t,l.current=e.sourcePosition,c.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:s.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),s}function UHt({id:e,onClick:t,onMouseEnter:n,onMouseMove:i,onMouseLeave:r,onContextMenu:s,onDoubleClick:o,nodesDraggable:l,elementsSelectable:c,nodesConnectable:u,nodesFocusable:d,resizeObserver:f,noDragClassName:h,noPanClassName:m,disableKeyboardA11y:g,rfId:b,nodeTypes:v,nodeClickDistance:y,onError:w}){const{node:x,internals:O,isParent:k}=ir(W=>{const G=W.nodeLookup.get(e),H=W.parentLookup.has(e);return{node:G,internals:G.internals,isParent:H}},zs);let S=x.type||"default",C=(v==null?void 0:v[S])||soe[S];C===void 0&&(w==null||w("003",kf.error003(S)),S="default",C=(v==null?void 0:v.default)||soe.default);const E=!!(x.draggable||l&&typeof x.draggable>"u"),j=!!(x.selectable||c&&typeof x.selectable>"u"),T=!!(x.connectable||u&&typeof x.connectable>"u"),R=!!(x.focusable||d&&typeof x.focusable>"u"),A=Vs(),N=tK(x),P=BHt({node:x,nodeType:S,hasDimensions:N,resizeObserver:f}),I=eBe({nodeRef:P,disabled:x.hidden||!E,noDragClassName:h,handleSelector:x.dragHandle,nodeId:e,isSelectable:j,nodeClickDistance:y}),D=tBe();if(x.hidden)return null;const _=xm(x),L=NHt(x),F=j||E||t||n||i||r,M=n?W=>n(W,{...O.userNode}):void 0,V=i?W=>i(W,{...O.userNode}):void 0,q=r?W=>r(W,{...O.userNode}):void 0,U=s?W=>s(W,{...O.userNode}):void 0,J=o?W=>o(W,{...O.userNode}):void 0,z=W=>{const{selectNodesOnDrag:G,nodeDragThreshold:H}=A.getState();j&&(!G||!E||H>0)&&F7({id:e,store:A,nodeRef:P}),t&&t(W,{...O.userNode})},Z=W=>{if(!(A8e(W.nativeEvent)||g)){if(g8e.includes(W.key)&&j){const G=W.key==="Escape";F7({id:e,store:A,unselect:G,nodeRef:P})}else if(E&&x.selected&&Object.prototype.hasOwnProperty.call(_P,W.key)){W.preventDefault();const{ariaLabelConfig:G}=A.getState();A.setState({ariaLiveMessage:G["node.a11yDescription.ariaLiveMessage"]({direction:W.key.replace("Arrow","").toLowerCase(),x:~~O.positionAbsolute.x,y:~~O.positionAbsolute.y})}),D({direction:_P[W.key],factor:W.shiftKey?4:1})}}},ne=()=>{var ie;if(g||!((ie=P.current)!=null&&ie.matches(":focus-visible")))return;const{transform:W,width:G,height:H,autoPanOnNodeFocus:se,setCenter:Y}=A.getState();if(!se)return;ZW(new Map([[e,x]]),{x:0,y:0,width:G,height:H},W,!0).length>0||Y(x.position.x+_.width/2,x.position.y+_.height/2,{zoom:W[2]})};return a.jsx("div",{className:eo(["react-flow__node",`react-flow__node-${S}`,{[m]:E},x.className,{selected:x.selected,selectable:j,parent:k,draggable:E,dragging:I}]),ref:P,style:{zIndex:O.z,transform:`translate(${O.positionAbsolute.x}px,${O.positionAbsolute.y}px)`,pointerEvents:F?"all":"none",visibility:N?"visible":"hidden",...x.style,...L},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:M,onMouseMove:V,onMouseLeave:q,onContextMenu:U,onClick:z,onDoubleClick:J,onKeyDown:R?Z:void 0,tabIndex:R?0:void 0,onFocus:R?ne:void 0,role:x.ariaRole??(R?"group":void 0),"aria-roledescription":"node","aria-describedby":g?void 0:`${q8e}-${b}`,"aria-label":x.ariaLabel,...x.domAttributes,children:a.jsx(kHt,{value:e,children:a.jsx(C,{id:e,data:x.data,type:S,positionAbsoluteX:O.positionAbsolute.x,positionAbsoluteY:O.positionAbsolute.y,selected:x.selected??!1,selectable:j,draggable:E,deletable:x.deletable??!0,isConnectable:T,sourcePosition:x.sourcePosition,targetPosition:x.targetPosition,dragging:I,dragHandle:x.dragHandle,zIndex:O.z,parentId:x.parentId,..._})})})}var QHt=p.memo(UHt);const zHt=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function rBe(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:r,onError:s}=ir(zHt,zs),o=LHt(e.onlyRenderVisibleElements),l=FHt();return a.jsx("div",{className:"react-flow__nodes",style:TL,children:o.map(c=>a.jsx(QHt,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:s},c))})}rBe.displayName="NodeRenderer";const VHt=p.memo(rBe);function HHt(e){return ir(p.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const i=[];if(n.width&&n.height)for(const r of n.edges){const s=n.nodeLookup.get(r.source),o=n.nodeLookup.get(r.target);s&&o&&Kzt({sourceNode:s,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&i.push(r.id)}return i},[e]),zs)}const qHt=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return a.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},WHt=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return a.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},ooe={[lA.Arrow]:qHt,[lA.ArrowClosed]:WHt};function KHt(e){const t=Vs();return p.useMemo(()=>{var r,s;return Object.prototype.hasOwnProperty.call(ooe,e)?ooe[e]:((s=(r=t.getState()).onError)==null||s.call(r,"009",kf.error009(e)),null)},[e])}const GHt=({id:e,type:t,color:n,width:i=12.5,height:r=12.5,markerUnits:s="strokeWidth",strokeWidth:o,orient:l="auto-start-reverse"})=>{const c=KHt(t);return c?a.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${i}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:l,refX:"0",refY:"0",children:a.jsx(c,{color:n,strokeWidth:o})}):null},sBe=({defaultColor:e,rfId:t})=>{const n=ir(s=>s.edges),i=ir(s=>s.defaultEdgeOptions),r=p.useMemo(()=>nVt(n,{id:t,defaultColor:e,defaultMarkerStart:i==null?void 0:i.markerStart,defaultMarkerEnd:i==null?void 0:i.markerEnd}),[n,i,t,e]);return r.length?a.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:a.jsx("defs",{children:r.map(s=>a.jsx(GHt,{id:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient},s.id))})}):null};sBe.displayName="MarkerDefinitions";var XHt=p.memo(sBe);function aBe({x:e,y:t,label:n,labelStyle:i,labelShowBg:r=!0,labelBgStyle:s,labelBgPadding:o=[2,4],labelBgBorderRadius:l=2,children:c,className:u,...d}){const[f,h]=p.useState({x:1,y:0,width:0,height:0}),m=eo(["react-flow__edge-textwrapper",u]),g=p.useRef(null);return p.useEffect(()=>{if(g.current){const b=g.current.getBBox();h({x:b.x,y:b.y,width:b.width,height:b.height})}},[n]),n?a.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:m,visibility:f.width?"visible":"hidden",...d,children:[r&&a.jsx("rect",{width:f.width+2*o[0],x:-o[0],y:-o[1],height:f.height+2*o[1],className:"react-flow__edge-textbg",style:s,rx:l,ry:l}),a.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:g,style:i,children:n}),c]}):null}aBe.displayName="EdgeText";const YHt=p.memo(aBe);function HT({path:e,labelX:t,labelY:n,label:i,labelStyle:r,labelShowBg:s,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:u=20,...d}){return a.jsxs(a.Fragment,{children:[a.jsx("path",{...d,d:e,fill:"none",className:eo(["react-flow__edge-path",d.className])}),u?a.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,i&&uf(t)&&uf(n)?a.jsx(YHt,{x:t,y:n,label:i,labelStyle:r,labelShowBg:s,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function loe({pos:e,x1:t,y1:n,x2:i,y2:r}){return e===vn.Left||e===vn.Right?[.5*(t+i),n]:[t,.5*(n+r)]}function oBe({sourceX:e,sourceY:t,sourcePosition:n=vn.Bottom,targetX:i,targetY:r,targetPosition:s=vn.Top}){const[o,l]=loe({pos:n,x1:e,y1:t,x2:i,y2:r}),[c,u]=loe({pos:s,x1:i,y1:r,x2:e,y2:t}),[d,f,h,m]=_8e({sourceX:e,sourceY:t,targetX:i,targetY:r,sourceControlX:o,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${o},${l} ${c},${u} ${i},${r}`,d,f,h,m]}function lBe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:o,targetPosition:l,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,interactionWidth:y})=>{const[w,x,O]=oBe({sourceX:n,sourceY:i,sourcePosition:o,targetX:r,targetY:s,targetPosition:l}),k=e.isInternal?void 0:t;return a.jsx(HT,{id:k,path:w,labelX:x,labelY:O,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,interactionWidth:y})})}const ZHt=lBe({isInternal:!1}),cBe=lBe({isInternal:!0});ZHt.displayName="SimpleBezierEdge";cBe.displayName="SimpleBezierEdgeInternal";function uBe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,sourcePosition:m=vn.Bottom,targetPosition:g=vn.Top,markerEnd:b,markerStart:v,pathOptions:y,interactionWidth:w})=>{const[x,O,k]=TP({sourceX:n,sourceY:i,sourcePosition:m,targetX:r,targetY:s,targetPosition:g,borderRadius:y==null?void 0:y.borderRadius,offset:y==null?void 0:y.offset,stepPosition:y==null?void 0:y.stepPosition}),S=e.isInternal?void 0:t;return a.jsx(HT,{id:S,path:x,labelX:O,labelY:k,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:b,markerStart:v,interactionWidth:w})})}const dBe=uBe({isInternal:!1}),fBe=uBe({isInternal:!0});dBe.displayName="SmoothStepEdge";fBe.displayName="SmoothStepEdgeInternal";function hBe(e){return p.memo(({id:t,...n})=>{var r;const i=e.isInternal?void 0:t;return a.jsx(dBe,{...n,id:i,pathOptions:p.useMemo(()=>{var s;return{borderRadius:0,offset:(s=n.pathOptions)==null?void 0:s.offset}},[(r=n.pathOptions)==null?void 0:r.offset])})})}const JHt=hBe({isInternal:!1}),pBe=hBe({isInternal:!0});JHt.displayName="StepEdge";pBe.displayName="StepEdgeInternal";function mBe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:m,markerStart:g,interactionWidth:b})=>{const[v,y,w]=R8e({sourceX:n,sourceY:i,targetX:r,targetY:s}),x=e.isInternal?void 0:t;return a.jsx(HT,{id:x,path:v,labelX:y,labelY:w,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:m,markerStart:g,interactionWidth:b})})}const eqt=mBe({isInternal:!1}),gBe=mBe({isInternal:!0});eqt.displayName="StraightEdge";gBe.displayName="StraightEdgeInternal";function bBe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:o=vn.Bottom,targetPosition:l=vn.Top,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,pathOptions:y,interactionWidth:w})=>{const[x,O,k]=j8e({sourceX:n,sourceY:i,sourcePosition:o,targetX:r,targetY:s,targetPosition:l,curvature:y==null?void 0:y.curvature}),S=e.isInternal?void 0:t;return a.jsx(HT,{id:S,path:x,labelX:O,labelY:k,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,interactionWidth:w})})}const tqt=bBe({isInternal:!1}),yBe=bBe({isInternal:!0});tqt.displayName="BezierEdge";yBe.displayName="BezierEdgeInternal";const coe={default:yBe,straight:gBe,step:pBe,smoothstep:fBe,simplebezier:cBe},uoe={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},nqt=(e,t,n)=>n===vn.Left?e-t:n===vn.Right?e+t:e,iqt=(e,t,n)=>n===vn.Top?e-t:n===vn.Bottom?e+t:e,doe="react-flow__edgeupdater";function foe({position:e,centerX:t,centerY:n,radius:i=10,onMouseDown:r,onMouseEnter:s,onMouseOut:o,type:l}){return a.jsx("circle",{onMouseDown:r,onMouseEnter:s,onMouseOut:o,className:eo([doe,`${doe}-${l}`]),cx:nqt(t,i,e),cy:iqt(n,i,e),r:i,stroke:"transparent",fill:"transparent"})}function rqt({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:i,sourceY:r,targetX:s,targetY:o,sourcePosition:l,targetPosition:c,onReconnect:u,onReconnectStart:d,onReconnectEnd:f,setReconnecting:h,setUpdateHover:m}){const g=Vs(),b=(O,k)=>{if(O.button!==0)return;const{autoPanOnConnect:S,domNode:C,connectionMode:E,connectionRadius:j,lib:T,onConnectStart:R,cancelConnection:A,nodeLookup:N,rfId:P,panBy:I,updateConnection:D}=g.getState(),_=k.type==="target",L=(V,q)=>{h(!1),f==null||f(V,n,k.type,q)},F=V=>u==null?void 0:u(n,V),M=(V,q)=>{h(!0),d==null||d(O,n,k.type),R==null||R(V,q)};$7.onPointerDown(O.nativeEvent,{autoPanOnConnect:S,connectionMode:E,connectionRadius:j,domNode:C,handleId:k.id,nodeId:k.nodeId,nodeLookup:N,isTarget:_,edgeUpdaterType:k.type,lib:T,flowId:P,cancelConnection:A,panBy:I,isValidConnection:(...V)=>{var q,U;return((U=(q=g.getState()).isValidConnection)==null?void 0:U.call(q,...V))??!0},onConnect:F,onConnectStart:M,onConnectEnd:(...V)=>{var q,U;return(U=(q=g.getState()).onConnectEnd)==null?void 0:U.call(q,...V)},onReconnectEnd:L,updateConnection:D,getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,dragThreshold:g.getState().connectionDragThreshold,handleDomNode:O.currentTarget})},v=O=>b(O,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),y=O=>b(O,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),w=()=>m(!0),x=()=>m(!1);return a.jsxs(a.Fragment,{children:[(e===!0||e==="source")&&a.jsx(foe,{position:l,centerX:i,centerY:r,radius:t,onMouseDown:v,onMouseEnter:w,onMouseOut:x,type:"source"}),(e===!0||e==="target")&&a.jsx(foe,{position:c,centerX:s,centerY:o,radius:t,onMouseDown:y,onMouseEnter:w,onMouseOut:x,type:"target"})]})}function sqt({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:i,onClick:r,onDoubleClick:s,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:m,rfId:g,edgeTypes:b,noPanClassName:v,onError:y,disableKeyboardA11y:w}){let x=ir(Y=>Y.edgeLookup.get(e));const O=ir(Y=>Y.defaultEdgeOptions);x=O?{...O,...x}:x;let k=x.type||"default",S=(b==null?void 0:b[k])||coe[k];S===void 0&&(y==null||y("011",kf.error011(k)),k="default",S=(b==null?void 0:b.default)||coe.default);const C=!!(x.focusable||t&&typeof x.focusable>"u"),E=typeof f<"u"&&(x.reconnectable||n&&typeof x.reconnectable>"u"),j=!!(x.selectable||i&&typeof x.selectable>"u"),T=p.useRef(null),[R,A]=p.useState(!1),[N,P]=p.useState(!1),I=Vs(),{zIndex:D,sourceX:_,sourceY:L,targetX:F,targetY:M,sourcePosition:V,targetPosition:q}=ir(p.useCallback(Y=>{const X=Y.nodeLookup.get(x.source),ie=Y.nodeLookup.get(x.target);if(!X||!ie)return{zIndex:x.zIndex,...uoe};const ee=tVt({id:e,sourceNode:X,targetNode:ie,sourceHandle:x.sourceHandle||null,targetHandle:x.targetHandle||null,connectionMode:Y.connectionMode,onError:y});return{zIndex:Wzt({selected:x.selected,zIndex:x.zIndex,sourceNode:X,targetNode:ie,elevateOnSelect:Y.elevateEdgesOnSelect,zIndexMode:Y.zIndexMode}),...ee||uoe}},[x.source,x.target,x.sourceHandle,x.targetHandle,x.selected,x.zIndex]),zs),U=p.useMemo(()=>x.markerStart?`url('#${M7(x.markerStart,g)}')`:void 0,[x.markerStart,g]),J=p.useMemo(()=>x.markerEnd?`url('#${M7(x.markerEnd,g)}')`:void 0,[x.markerEnd,g]);if(x.hidden||_===null||L===null||F===null||M===null)return null;const z=Y=>{var be;const{addSelectedEdges:X,unselectNodesAndEdges:ie,multiSelectionActive:ee}=I.getState();j&&(I.setState({nodesSelectionActive:!1}),x.selected&&ee?(ie({nodes:[],edges:[x]}),(be=T.current)==null||be.blur()):X([e])),r&&r(Y,x)},Z=s?Y=>{s(Y,{...x})}:void 0,ne=o?Y=>{o(Y,{...x})}:void 0,W=l?Y=>{l(Y,{...x})}:void 0,G=c?Y=>{c(Y,{...x})}:void 0,H=u?Y=>{u(Y,{...x})}:void 0,se=Y=>{var X;if(!w&&g8e.includes(Y.key)&&j){const{unselectNodesAndEdges:ie,addSelectedEdges:ee}=I.getState();Y.key==="Escape"?((X=T.current)==null||X.blur(),ie({edges:[x]})):ee([e])}};return a.jsx("svg",{style:{zIndex:D},children:a.jsxs("g",{className:eo(["react-flow__edge",`react-flow__edge-${k}`,x.className,v,{selected:x.selected,animated:x.animated,inactive:!j&&!r,updating:R,selectable:j}]),onClick:z,onDoubleClick:Z,onContextMenu:ne,onMouseEnter:W,onMouseMove:G,onMouseLeave:H,onKeyDown:C?se:void 0,tabIndex:C?0:void 0,role:x.ariaRole??(C?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":x.ariaLabel===null?void 0:x.ariaLabel||`Edge from ${x.source} to ${x.target}`,"aria-describedby":C?`${W8e}-${g}`:void 0,ref:T,...x.domAttributes,children:[!N&&a.jsx(S,{id:e,source:x.source,target:x.target,type:x.type,selected:x.selected,animated:x.animated,selectable:j,deletable:x.deletable??!0,label:x.label,labelStyle:x.labelStyle,labelShowBg:x.labelShowBg,labelBgStyle:x.labelBgStyle,labelBgPadding:x.labelBgPadding,labelBgBorderRadius:x.labelBgBorderRadius,sourceX:_,sourceY:L,targetX:F,targetY:M,sourcePosition:V,targetPosition:q,data:x.data,style:x.style,sourceHandleId:x.sourceHandle,targetHandleId:x.targetHandle,markerStart:U,markerEnd:J,pathOptions:"pathOptions"in x?x.pathOptions:void 0,interactionWidth:x.interactionWidth}),E&&a.jsx(rqt,{edge:x,isReconnectable:E,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:m,sourceX:_,sourceY:L,targetX:F,targetY:M,sourcePosition:V,targetPosition:q,setUpdateHover:A,setReconnecting:P})]})})}var aqt=p.memo(sqt);const oqt=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function vBe({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:i,noPanClassName:r,onReconnect:s,onEdgeContextMenu:o,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:f,onEdgeDoubleClick:h,onReconnectStart:m,onReconnectEnd:g,disableKeyboardA11y:b}){const{edgesFocusable:v,edgesReconnectable:y,elementsSelectable:w,onError:x}=ir(oqt,zs),O=HHt(t);return a.jsxs("div",{className:"react-flow__edges",children:[a.jsx(XHt,{defaultColor:e,rfId:n}),O.map(k=>a.jsx(aqt,{id:k,edgesFocusable:v,edgesReconnectable:y,elementsSelectable:w,noPanClassName:r,onReconnect:s,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,reconnectRadius:f,onDoubleClick:h,onReconnectStart:m,onReconnectEnd:g,rfId:n,onError:x,edgeTypes:i,disableKeyboardA11y:b},k))]})}vBe.displayName="EdgeRenderer";const lqt=p.memo(vBe),cqt=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function uqt({children:e}){const t=ir(cqt);return a.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function dqt(e){const t=AL(),n=p.useRef(!1);p.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const fqt=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function hqt(e){const t=ir(fqt),n=Vs();return p.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function pqt(e){return e.connection.inProgress?{...e.connection,to:xO(e.connection.to,e.transform)}:{...e.connection}}function mqt(e){return pqt}function gqt(e){const t=mqt();return ir(t,zs)}const bqt=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function yqt({containerStyle:e,style:t,type:n,component:i}){const{nodesConnectable:r,width:s,height:o,isValid:l,inProgress:c}=ir(bqt,zs);return!(s&&r&&c)?null:a.jsx("svg",{style:e,width:s,height:o,className:"react-flow__connectionline react-flow__container",children:a.jsx("g",{className:eo(["react-flow__connection",v8e(l)]),children:a.jsx(xBe,{style:t,type:n,CustomComponent:i,isValid:l})})})}const xBe=({style:e,type:t=lg.Bezier,CustomComponent:n,isValid:i})=>{const{inProgress:r,from:s,fromNode:o,fromHandle:l,fromPosition:c,to:u,toNode:d,toHandle:f,toPosition:h,pointer:m}=gqt();if(!r)return;if(n)return a.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:l,fromX:s.x,fromY:s.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:h,connectionStatus:v8e(i),toNode:d,toHandle:f,pointer:m});let g="";const b={sourceX:s.x,sourceY:s.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:h};switch(t){case lg.Bezier:[g]=j8e(b);break;case lg.SimpleBezier:[g]=oBe(b);break;case lg.Step:[g]=TP({...b,borderRadius:0});break;case lg.SmoothStep:[g]=TP(b);break;default:[g]=R8e(b)}return a.jsx("path",{d:g,fill:"none",className:"react-flow__connection-path",style:e})};xBe.displayName="ConnectionLine";const vqt={};function hoe(e=vqt){p.useRef(e),Vs(),p.useEffect(()=>{},[e])}function xqt(){Vs(),p.useRef(!1),p.useEffect(()=>{},[])}function wBe({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:i,onEdgeClick:r,onNodeDoubleClick:s,onEdgeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:f,onSelectionStart:h,onSelectionEnd:m,connectionLineType:g,connectionLineStyle:b,connectionLineComponent:v,connectionLineContainerStyle:y,selectionKeyCode:w,selectionOnDrag:x,selectionMode:O,multiSelectionKeyCode:k,panActivationKeyCode:S,zoomActivationKeyCode:C,deleteKeyCode:E,onlyRenderVisibleElements:j,elementsSelectable:T,defaultViewport:R,translateExtent:A,minZoom:N,maxZoom:P,preventScrolling:I,defaultMarkerColor:D,zoomOnScroll:_,zoomOnPinch:L,panOnScroll:F,panOnScrollSpeed:M,panOnScrollMode:V,zoomOnDoubleClick:q,panOnDrag:U,autoPanOnSelection:J,onPaneClick:z,onPaneMouseEnter:Z,onPaneMouseMove:ne,onPaneMouseLeave:W,onPaneScroll:G,onPaneContextMenu:H,paneClickDistance:se,nodeClickDistance:Y,onEdgeContextMenu:X,onEdgeMouseEnter:ie,onEdgeMouseMove:ee,onEdgeMouseLeave:be,reconnectRadius:ue,onReconnect:pe,onReconnectStart:ke,onReconnectEnd:je,noDragClassName:Pe,noWheelClassName:Ee,noPanClassName:ze,disableKeyboardA11y:_e,nodeExtent:ae,rfId:le,viewport:ge,onViewportChange:Oe}){return hoe(e),hoe(t),xqt(),dqt(n),hqt(ge),a.jsx(DHt,{onPaneClick:z,onPaneMouseEnter:Z,onPaneMouseMove:ne,onPaneMouseLeave:W,onPaneContextMenu:H,onPaneScroll:G,paneClickDistance:se,deleteKeyCode:E,selectionKeyCode:w,selectionOnDrag:x,selectionMode:O,onSelectionStart:h,onSelectionEnd:m,multiSelectionKeyCode:k,panActivationKeyCode:S,zoomActivationKeyCode:C,elementsSelectable:T,zoomOnScroll:_,zoomOnPinch:L,zoomOnDoubleClick:q,panOnScroll:F,panOnScrollSpeed:M,panOnScrollMode:V,panOnDrag:U,autoPanOnSelection:J,defaultViewport:R,translateExtent:A,minZoom:N,maxZoom:P,onSelectionContextMenu:f,preventScrolling:I,noDragClassName:Pe,noWheelClassName:Ee,noPanClassName:ze,disableKeyboardA11y:_e,onViewportChange:Oe,isControlledViewport:!!ge,children:a.jsxs(uqt,{children:[a.jsx(lqt,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:o,onReconnect:pe,onReconnectStart:ke,onReconnectEnd:je,onlyRenderVisibleElements:j,onEdgeContextMenu:X,onEdgeMouseEnter:ie,onEdgeMouseMove:ee,onEdgeMouseLeave:be,reconnectRadius:ue,defaultMarkerColor:D,noPanClassName:ze,disableKeyboardA11y:_e,rfId:le}),a.jsx(yqt,{style:b,type:g,component:v,containerStyle:y}),a.jsx("div",{className:"react-flow__edgelabel-renderer"}),a.jsx(VHt,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:Y,onlyRenderVisibleElements:j,noPanClassName:ze,noDragClassName:Pe,disableKeyboardA11y:_e,nodeExtent:ae,rfId:le}),a.jsx("div",{className:"react-flow__viewport-portal"})]})})}wBe.displayName="GraphView";const wqt=p.memo(wBe),Oqt=S8e(),poe=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:o,fitViewOptions:l,minZoom:c=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:f,zIndexMode:h="basic"}={})=>{const m=new Map,g=new Map,b=new Map,v=new Map,y=i??t??[],w=n??e??[],x=d??[0,0],O=f??aA;D8e(b,v,y);const{nodesInitialized:k}=L7(w,m,g,{nodeOrigin:x,nodeExtent:O,zIndexMode:h});let S=[0,0,1];if(o&&r&&s){const C=zT(m,{filter:R=>!!((R.width||R.initialWidth)&&(R.height||R.initialHeight))}),{x:E,y:j,zoom:T}=eK(C,r,s,c,u,(l==null?void 0:l.padding)??.1);S=[E,j,T]}return{rfId:"1",width:r??0,height:s??0,transform:S,nodes:w,nodesInitialized:k,nodeLookup:m,parentLookup:g,edges:y,edgeLookup:v,connectionLookup:b,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:i!==void 0,panZoom:null,minZoom:c,maxZoom:u,translateExtent:aA,nodeExtent:O,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:O1.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:x,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:l,fitViewResolver:null,connection:{...y8e},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Oqt,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:b8e,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},kqt=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h})=>$Vt((m,g)=>{async function b(){const{nodeLookup:v,panZoom:y,fitViewOptions:w,fitViewResolver:x,width:O,height:k,minZoom:S,maxZoom:C}=g();y&&(await Bzt({nodes:v,width:O,height:k,panZoom:y,minZoom:S,maxZoom:C},w),x==null||x.resolve(!0),m({fitViewResolver:null}))}return{...poe({nodes:e,edges:t,width:r,height:s,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,defaultNodes:n,defaultEdges:i,zIndexMode:h}),setNodes:v=>{const{nodeLookup:y,parentLookup:w,nodeOrigin:x,elevateNodesOnSelect:O,fitViewQueued:k,zIndexMode:S,nodesSelectionActive:C}=g(),{nodesInitialized:E,hasSelectedNodes:j}=L7(v,y,w,{nodeOrigin:x,nodeExtent:f,elevateNodesOnSelect:O,checkEquality:!0,zIndexMode:S}),T=C&&j;k&&E?(b(),m({nodes:v,nodesInitialized:E,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:T})):m({nodes:v,nodesInitialized:E,nodesSelectionActive:T})},setEdges:v=>{const{connectionLookup:y,edgeLookup:w}=g();D8e(y,w,v),m({edges:v})},setDefaultNodesAndEdges:(v,y)=>{if(v){const{setNodes:w}=g();w(v),m({hasDefaultNodes:!0})}if(y){const{setEdges:w}=g();w(y),m({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:y,nodeLookup:w,parentLookup:x,domNode:O,nodeOrigin:k,nodeExtent:S,debug:C,fitViewQueued:E,zIndexMode:j}=g(),{changes:T,updatedInternals:R}=cVt(v,w,x,O,k,S,j);R&&(sVt(w,x,{nodeOrigin:k,nodeExtent:S,zIndexMode:j}),E?(b(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),(T==null?void 0:T.length)>0&&(C&&console.log("React Flow: trigger node changes",T),y==null||y(T)))},updateNodePositions:(v,y=!1)=>{const w=[];let x=[];const{nodeLookup:O,triggerNodeChanges:k,connection:S,updateConnection:C,onNodesChangeMiddlewareMap:E}=g();for(const[j,T]of v){const R=O.get(j),A=!!(R!=null&&R.expandParent&&(R!=null&&R.parentId)&&(T!=null&&T.position)),N={id:j,type:"position",position:A?{x:Math.max(0,T.position.x),y:Math.max(0,T.position.y)}:T.position,dragging:y};if(R&&S.inProgress&&S.fromNode.id===R.id){const P=N0(R,S.fromHandle,vn.Left,!0);C({...S,from:P})}A&&R.parentId&&w.push({id:j,parentId:R.parentId,rect:{...T.internals.positionAbsolute,width:T.measured.width??0,height:T.measured.height??0}}),x.push(N)}if(w.length>0){const{parentLookup:j,nodeOrigin:T}=g(),R=oK(w,O,j,T);x.push(...R)}for(const j of E.values())x=j(x);k(x)},triggerNodeChanges:v=>{const{onNodesChange:y,setNodes:w,nodes:x,hasDefaultNodes:O,debug:k}=g();if(v!=null&&v.length){if(O){const S=X8e(v,x);w(S)}k&&console.log("React Flow: trigger node changes",v),y==null||y(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:y,setEdges:w,edges:x,hasDefaultEdges:O,debug:k}=g();if(v!=null&&v.length){if(O){const S=Y8e(v,x);w(S)}k&&console.log("React Flow: trigger edge changes",v),y==null||y(v)}},addSelectedNodes:v=>{const{multiSelectionActive:y,edgeLookup:w,nodeLookup:x,triggerNodeChanges:O,triggerEdgeChanges:k}=g();if(y){const S=v.map(C=>yy(C,!0));O(S);return}O(zx(x,new Set([...v]),!0)),k(zx(w))},addSelectedEdges:v=>{const{multiSelectionActive:y,edgeLookup:w,nodeLookup:x,triggerNodeChanges:O,triggerEdgeChanges:k}=g();if(y){const S=v.map(C=>yy(C,!0));k(S);return}k(zx(w,new Set([...v]))),O(zx(x,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:y}={})=>{const{edges:w,nodes:x,nodeLookup:O,triggerNodeChanges:k,triggerEdgeChanges:S}=g(),C=v||x,E=y||w,j=[];for(const R of C){if(!R.selected)continue;const A=O.get(R.id);A&&(A.selected=!1),j.push(yy(R.id,!1))}const T=[];for(const R of E)R.selected&&T.push(yy(R.id,!1));k(j),S(T)},setMinZoom:v=>{const{panZoom:y,maxZoom:w}=g();y==null||y.setScaleExtent([v,w]),m({minZoom:v})},setMaxZoom:v=>{const{panZoom:y,minZoom:w}=g();y==null||y.setScaleExtent([w,v]),m({maxZoom:v})},setTranslateExtent:v=>{var y;(y=g().panZoom)==null||y.setTranslateExtent(v),m({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:y,triggerNodeChanges:w,triggerEdgeChanges:x,elementsSelectable:O}=g();if(!O)return;const k=y.reduce((C,E)=>E.selected?[...C,yy(E.id,!1)]:C,[]),S=v.reduce((C,E)=>E.selected?[...C,yy(E.id,!1)]:C,[]);w(k),x(S)},setNodeExtent:v=>{const{nodes:y,nodeLookup:w,parentLookup:x,nodeOrigin:O,elevateNodesOnSelect:k,nodeExtent:S,zIndexMode:C}=g();v[0][0]===S[0][0]&&v[0][1]===S[0][1]&&v[1][0]===S[1][0]&&v[1][1]===S[1][1]||(L7(y,w,x,{nodeOrigin:O,nodeExtent:v,elevateNodesOnSelect:k,checkEquality:!1,zIndexMode:C}),m({nodeExtent:v}))},panBy:v=>{const{transform:y,width:w,height:x,panZoom:O,translateExtent:k}=g();return uVt({delta:v,panZoom:O,transform:y,translateExtent:k,width:w,height:x})},setCenter:async(v,y,w)=>{const{width:x,height:O,maxZoom:k,panZoom:S}=g();if(!S)return!1;const C=typeof(w==null?void 0:w.zoom)<"u"?w.zoom:k;return await S.setViewport({x:x/2-v*C,y:O/2-y*C,zoom:C},{duration:w==null?void 0:w.duration,ease:w==null?void 0:w.ease,interpolate:w==null?void 0:w.interpolate}),!0},cancelConnection:()=>{m({connection:{...y8e}})},updateConnection:v=>{m({connection:v})},reset:()=>m({...poe()})}},Object.is);function OBe({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:i,initialWidth:r,initialHeight:s,initialMinZoom:o,initialMaxZoom:l,initialFitViewOptions:c,fitView:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:m}){const[g]=p.useState(()=>kqt({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:u,minZoom:o,maxZoom:l,fitViewOptions:c,nodeOrigin:d,nodeExtent:f,zIndexMode:h}));return a.jsx(FVt,{value:g,children:a.jsx(uHt,{children:m})})}function Sqt({children:e,nodes:t,edges:n,defaultNodes:i,defaultEdges:r,width:s,height:o,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:m}){return p.useContext(EL)?a.jsx(a.Fragment,{children:e}):a.jsx(OBe,{initialNodes:t,initialEdges:n,defaultNodes:i,defaultEdges:r,initialWidth:s,initialHeight:o,fitView:l,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:m,children:e})}const Eqt={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Cqt({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,className:r,nodeTypes:s,edgeTypes:o,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:h,onConnect:m,onConnectStart:g,onConnectEnd:b,onClickConnectStart:v,onClickConnectEnd:y,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:O,onNodeContextMenu:k,onNodeDoubleClick:S,onNodeDragStart:C,onNodeDrag:E,onNodeDragStop:j,onNodesDelete:T,onEdgesDelete:R,onDelete:A,onSelectionChange:N,onSelectionDragStart:P,onSelectionDrag:I,onSelectionDragStop:D,onSelectionContextMenu:_,onSelectionStart:L,onSelectionEnd:F,onBeforeDelete:M,connectionMode:V,connectionLineType:q=lg.Bezier,connectionLineStyle:U,connectionLineComponent:J,connectionLineContainerStyle:z,deleteKeyCode:Z="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:W=!1,selectionMode:G=oA.Full,panActivationKeyCode:H="Space",multiSelectionKeyCode:se=uA()?"Meta":"Control",zoomActivationKeyCode:Y=uA()?"Meta":"Control",snapToGrid:X,snapGrid:ie,onlyRenderVisibleElements:ee=!1,selectNodesOnDrag:be,nodesDraggable:ue,autoPanOnNodeFocus:pe,nodesConnectable:ke,nodesFocusable:je,nodeOrigin:Pe=K8e,edgesFocusable:Ee,edgesReconnectable:ze,elementsSelectable:_e=!0,defaultViewport:ae=ZVt,minZoom:le=.5,maxZoom:ge=2,translateExtent:Oe=aA,preventScrolling:Se=!0,nodeExtent:We,defaultMarkerColor:Ye="#b1b1b7",zoomOnScroll:ye=!0,zoomOnPinch:we=!0,panOnScroll:Ae=!1,panOnScrollSpeed:He=.5,panOnScrollMode:Ue=t0.Free,zoomOnDoubleClick:jt=!0,panOnDrag:Pt=!0,onPaneClick:Kt,onPaneMouseEnter:Ct,onPaneMouseMove:xt,onPaneMouseLeave:tt,onPaneScroll:mt,onPaneContextMenu:Ne,paneClickDistance:Ot=1,nodeClickDistance:Nt=0,children:Yt,onReconnect:xn,onReconnectStart:Ke,onReconnectEnd:St,onEdgeContextMenu:qe,onEdgeDoubleClick:nt,onEdgeMouseEnter:et,onEdgeMouseMove:ft,onEdgeMouseLeave:Et,reconnectRadius:At=10,onNodesChange:It,onEdgesChange:Gt,noDragClassName:Xe="nodrag",noWheelClassName:wt="nowheel",noPanClassName:vt="nopan",fitView:tn,fitViewOptions:Qt,connectOnClick:cn,attributionPosition:Me,proOptions:on,defaultEdgeOptions:On,elevateNodesOnSelect:Sn=!0,elevateEdgesOnSelect:Qi=!1,disableKeyboardA11y:un=!1,autoPanOnConnect:lr,autoPanOnNodeDrag:Mn,autoPanOnSelection:ei=!0,autoPanSpeed:Bn,connectionRadius:ki,isValidConnection:zn,onError:Rn,style:di,id:rt,nodeDragThreshold:zt,connectionDragThreshold:Qe,viewport:bt,onViewportChange:Ht,width:_n,height:jr,colorMode:Hs="light",debug:qs,onScroll:Dr,ariaLabelConfig:ti,zIndexMode:Si="basic",...Zr},Jr){const ga=rt||"1",go=nHt(Hs),us=p.useCallback(he=>{he.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Dr==null||Dr(he)},[Dr]);return a.jsx("div",{"data-testid":"rf__wrapper",...Zr,onScroll:us,style:{...di,...Eqt},ref:Jr,className:eo(["react-flow",r,go]),id:rt,role:"application",children:a.jsxs(Sqt,{nodes:e,edges:t,width:_n,height:jr,fitView:tn,fitViewOptions:Qt,minZoom:le,maxZoom:ge,nodeOrigin:Pe,nodeExtent:We,zIndexMode:Si,children:[a.jsx(tHt,{nodes:e,edges:t,defaultNodes:n,defaultEdges:i,onConnect:m,onConnectStart:g,onConnectEnd:b,onClickConnectStart:v,onClickConnectEnd:y,nodesDraggable:ue,autoPanOnNodeFocus:pe,nodesConnectable:ke,nodesFocusable:je,edgesFocusable:Ee,edgesReconnectable:ze,elementsSelectable:_e,elevateNodesOnSelect:Sn,elevateEdgesOnSelect:Qi,minZoom:le,maxZoom:ge,nodeExtent:We,onNodesChange:It,onEdgesChange:Gt,snapToGrid:X,snapGrid:ie,connectionMode:V,translateExtent:Oe,connectOnClick:cn,defaultEdgeOptions:On,fitView:tn,fitViewOptions:Qt,onNodesDelete:T,onEdgesDelete:R,onDelete:A,onNodeDragStart:C,onNodeDrag:E,onNodeDragStop:j,onSelectionDrag:I,onSelectionDragStart:P,onSelectionDragStop:D,onMove:d,onMoveStart:f,onMoveEnd:h,noPanClassName:vt,nodeOrigin:Pe,rfId:ga,autoPanOnConnect:lr,autoPanOnNodeDrag:Mn,autoPanSpeed:Bn,onError:Rn,connectionRadius:ki,isValidConnection:zn,selectNodesOnDrag:be,nodeDragThreshold:zt,connectionDragThreshold:Qe,onBeforeDelete:M,debug:qs,ariaLabelConfig:ti,zIndexMode:Si}),a.jsx(wqt,{onInit:u,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:O,onNodeContextMenu:k,onNodeDoubleClick:S,nodeTypes:s,edgeTypes:o,connectionLineType:q,connectionLineStyle:U,connectionLineComponent:J,connectionLineContainerStyle:z,selectionKeyCode:ne,selectionOnDrag:W,selectionMode:G,deleteKeyCode:Z,multiSelectionKeyCode:se,panActivationKeyCode:H,zoomActivationKeyCode:Y,onlyRenderVisibleElements:ee,defaultViewport:ae,translateExtent:Oe,minZoom:le,maxZoom:ge,preventScrolling:Se,zoomOnScroll:ye,zoomOnPinch:we,zoomOnDoubleClick:jt,panOnScroll:Ae,panOnScrollSpeed:He,panOnScrollMode:Ue,panOnDrag:Pt,autoPanOnSelection:ei,onPaneClick:Kt,onPaneMouseEnter:Ct,onPaneMouseMove:xt,onPaneMouseLeave:tt,onPaneScroll:mt,onPaneContextMenu:Ne,paneClickDistance:Ot,nodeClickDistance:Nt,onSelectionContextMenu:_,onSelectionStart:L,onSelectionEnd:F,onReconnect:xn,onReconnectStart:Ke,onReconnectEnd:St,onEdgeContextMenu:qe,onEdgeDoubleClick:nt,onEdgeMouseEnter:et,onEdgeMouseMove:ft,onEdgeMouseLeave:Et,reconnectRadius:At,defaultMarkerColor:Ye,noDragClassName:Xe,noWheelClassName:wt,noPanClassName:vt,rfId:ga,disableKeyboardA11y:un,nodeExtent:We,viewport:bt,onViewportChange:Ht}),a.jsx(YVt,{onSelectionChange:N}),Yt,a.jsx(qVt,{proOptions:on,position:Me}),a.jsx(HVt,{rfId:ga,disableKeyboardA11y:un})]})})}var Aqt=Z8e(Cqt);const Tqt=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function _qt({children:e}){const t=ir(Tqt);return t?yi.createPortal(e,t):null}function jqt(e){const[t,n]=p.useState(e),i=p.useCallback(r=>n(s=>X8e(r,s)),[]);return[t,n,i]}function Nqt(e){const[t,n]=p.useState(e),i=p.useCallback(r=>n(s=>Y8e(r,s)),[]);return[t,n,i]}const Rqt=e=>t=>{if(!e.includeHiddenNodes)return t.nodesInitialized;if(t.nodeLookup.size===0)return!1;for(const[,{internals:n}]of t.nodeLookup)if(n.handleBounds===void 0||!tK(n.userNode))return!1;return!0};function Iqt(e={includeHiddenNodes:!1}){return ir(Rqt(e))}function Pqt({dimensions:e,lineWidth:t,variant:n,className:i}){return a.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:eo(["react-flow__background-pattern",n,i])})}function Dqt({radius:e,className:t}){return a.jsx("circle",{cx:e,cy:e,r:e,className:eo(["react-flow__background-pattern","dots",t])})}var Bg;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Bg||(Bg={}));const Mqt={[Bg.Dots]:1,[Bg.Lines]:1,[Bg.Cross]:6},Lqt=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function kBe({id:e,variant:t=Bg.Dots,gap:n=20,size:i,lineWidth:r=1,offset:s=0,color:o,bgColor:l,style:c,className:u,patternClassName:d}){const f=p.useRef(null),{transform:h,patternId:m}=ir(Lqt,zs),g=i||Mqt[t],b=t===Bg.Dots,v=t===Bg.Cross,y=Array.isArray(n)?n:[n,n],w=[y[0]*h[2]||1,y[1]*h[2]||1],x=g*h[2],O=Array.isArray(s)?s:[s,s],k=v?[x,x]:w,S=[O[0]*h[2]||1+k[0]/2,O[1]*h[2]||1+k[1]/2],C=`${m}${e||""}`;return a.jsxs("svg",{className:eo(["react-flow__background",u]),style:{...c,...TL,"--xy-background-color-props":l,"--xy-background-pattern-color-props":o},ref:f,"data-testid":"rf__background",children:[a.jsx("pattern",{id:C,x:h[0]%w[0],y:h[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${S[0]},-${S[1]})`,children:b?a.jsx(Dqt,{radius:x/2,className:d}):a.jsx(Pqt,{dimensions:k,lineWidth:r,variant:t,className:d})}),a.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${C})`})]})}kBe.displayName="Background";const $qt=p.memo(kBe);function Fqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:a.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Bqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:a.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Uqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:a.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function Qqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:a.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function zqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:a.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function vj({children:e,className:t,...n}){return a.jsx("button",{type:"button",className:eo(["react-flow__controls-button",t]),...n,children:e})}const Vqt=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function SBe({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:i=!0,fitViewOptions:r,onZoomIn:s,onZoomOut:o,onFitView:l,onInteractiveChange:c,className:u,children:d,position:f="bottom-left",orientation:h="vertical","aria-label":m}){const g=Vs(),{isInteractive:b,minZoomReached:v,maxZoomReached:y,ariaLabelConfig:w}=ir(Vqt,zs),{zoomIn:x,zoomOut:O,fitView:k}=AL(),S=()=>{x(),s==null||s()},C=()=>{O(),o==null||o()},E=()=>{k(r),l==null||l()},j=()=>{g.setState({nodesDraggable:!b,nodesConnectable:!b,elementsSelectable:!b}),c==null||c(!b)},T=h==="horizontal"?"horizontal":"vertical";return a.jsxs(CL,{className:eo(["react-flow__controls",T,u]),position:f,style:e,"data-testid":"rf__controls","aria-label":m??w["controls.ariaLabel"],children:[t&&a.jsxs(a.Fragment,{children:[a.jsx(vj,{onClick:S,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:y,children:a.jsx(Fqt,{})}),a.jsx(vj,{onClick:C,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:v,children:a.jsx(Bqt,{})})]}),n&&a.jsx(vj,{className:"react-flow__controls-fitview",onClick:E,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:a.jsx(Uqt,{})}),i&&a.jsx(vj,{className:"react-flow__controls-interactive",onClick:j,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:b?a.jsx(zqt,{}):a.jsx(Qqt,{})}),d]})}SBe.displayName="Controls";const Hqt=p.memo(SBe);function qqt({id:e,x:t,y:n,width:i,height:r,style:s,color:o,strokeColor:l,strokeWidth:c,className:u,borderRadius:d,shapeRendering:f,selected:h,onClick:m}){const{background:g,backgroundColor:b}=s||{},v=o||g||b;return a.jsx("rect",{className:eo(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:d,ry:d,width:i,height:r,style:{fill:v,stroke:l,strokeWidth:c},shapeRendering:f,onClick:m?y=>m(y,e):void 0})}const Wqt=p.memo(qqt),Kqt=e=>e.nodes.map(t=>t.id),t6=e=>e instanceof Function?e:()=>e;function Gqt({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:r,nodeComponent:s=Wqt,onClick:o}){const l=ir(Kqt,zs),c=t6(t),u=t6(e),d=t6(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return a.jsx(a.Fragment,{children:l.map(h=>a.jsx(Yqt,{id:h,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:i,nodeStrokeWidth:r,NodeComponent:s,onClick:o,shapeRendering:f},h))})}function Xqt({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:i,nodeBorderRadius:r,nodeStrokeWidth:s,shapeRendering:o,NodeComponent:l,onClick:c}){const{node:u,x:d,y:f,width:h,height:m}=ir(g=>{const b=g.nodeLookup.get(e);if(!b)return{node:void 0,x:0,y:0,width:0,height:0};const v=b.internals.userNode,{x:y,y:w}=b.internals.positionAbsolute,{width:x,height:O}=xm(v);return{node:v,x:y,y:w,width:x,height:O}},zs);return!u||u.hidden||!tK(u)?null:a.jsx(l,{x:d,y:f,width:h,height:m,style:u.style,selected:!!u.selected,className:i(u),color:t(u),borderRadius:r,strokeColor:n(u),strokeWidth:s,shapeRendering:o,onClick:c,id:u.id})}const Yqt=p.memo(Xqt);var Zqt=p.memo(Gqt);const Jqt=200,eWt=150,tWt=e=>!e.hidden,nWt=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?k8e(zT(e.nodeLookup,{filter:tWt}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},iWt="react-flow__minimap-desc";function EBe({style:e,className:t,nodeStrokeColor:n,nodeColor:i,nodeClassName:r="",nodeBorderRadius:s=5,nodeStrokeWidth:o,nodeComponent:l,bgColor:c,maskColor:u,maskStrokeColor:d,maskStrokeWidth:f,position:h="bottom-right",onClick:m,onNodeClick:g,pannable:b=!1,zoomable:v=!1,ariaLabel:y,inversePan:w,zoomStep:x=1,offsetScale:O=5}){const k=Vs(),S=p.useRef(null),{boundingRect:C,viewBB:E,rfId:j,panZoom:T,translateExtent:R,flowWidth:A,flowHeight:N,ariaLabelConfig:P}=ir(nWt,zs),I=(e==null?void 0:e.width)??Jqt,D=(e==null?void 0:e.height)??eWt,_=C.width/I,L=C.height/D,F=Math.max(_,L),M=F*I,V=F*D,q=O*F,U=C.x-(M-C.width)/2-q,J=C.y-(V-C.height)/2-q,z=M+q*2,Z=V+q*2,ne=`${iWt}-${j}`,W=p.useRef(0),G=p.useRef();W.current=F,p.useEffect(()=>{if(S.current&&T)return G.current=vVt({domNode:S.current,panZoom:T,getTransform:()=>k.getState().transform,getViewScale:()=>W.current}),()=>{var X;(X=G.current)==null||X.destroy()}},[T]),p.useEffect(()=>{var X;(X=G.current)==null||X.update({translateExtent:R,width:A,height:N,inversePan:w,pannable:b,zoomStep:x,zoomable:v})},[b,v,w,x,R,A,N]);const H=m?X=>{var be;const[ie,ee]=((be=G.current)==null?void 0:be.pointer(X))||[0,0];m(X,{x:ie,y:ee})}:void 0,se=g?p.useCallback((X,ie)=>{const ee=k.getState().nodeLookup.get(ie).internals.userNode;g(X,ee)},[]):void 0,Y=y??P["minimap.ariaLabel"];return a.jsx(CL,{position:h,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*F:void 0,"--xy-minimap-node-background-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o=="number"?o:void 0},className:eo(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:a.jsxs("svg",{width:I,height:D,viewBox:`${U} ${J} ${z} ${Z}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ne,ref:S,onClick:H,children:[Y&&a.jsx("title",{id:ne,children:Y}),a.jsx(Zqt,{onClick:se,nodeColor:i,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:r,nodeStrokeWidth:o,nodeComponent:l}),a.jsx("path",{className:"react-flow__minimap-mask",d:`M${U-q},${J-q}h${z+q*2}v${Z+q*2}h${-z-q*2}z - M${E.x},${E.y}h${E.width}v${E.height}h${-E.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}EBe.displayName="MiniMap";p.memo(EBe);const rWt=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,sWt={[C1.Line]:"right",[C1.Handle]:"bottom-right"};function aWt({nodeId:e,position:t,variant:n=C1.Handle,className:i,style:r=void 0,children:s,color:o,minWidth:l=10,minHeight:c=10,maxWidth:u=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:h,autoScale:m=!0,shouldResize:g,onResizeStart:b,onResize:v,onResizeEnd:y}){const w=nBe(),x=typeof e=="string"?e:w,O=Vs(),k=p.useRef(null),S=n===C1.Handle,C=ir(p.useCallback(rWt(S&&m),[S,m]),zs),E=p.useRef(null),j=t??sWt[n];p.useEffect(()=>{if(!(!k.current||!x))return E.current||(E.current=RVt({domNode:k.current,nodeId:x,getStoreItems:()=>{const{nodeLookup:R,transform:A,snapGrid:N,snapToGrid:P,nodeOrigin:I,domNode:D}=O.getState();return{nodeLookup:R,transform:A,snapGrid:N,snapToGrid:P,nodeOrigin:I,paneDomNode:D}},onChange:(R,A)=>{const{triggerNodeChanges:N,nodeLookup:P,parentLookup:I,nodeOrigin:D}=O.getState(),_=[],L={x:R.x,y:R.y},F=P.get(x);if(F&&F.expandParent&&F.parentId){const M=F.origin??D,V=R.width??F.measured.width??0,q=R.height??F.measured.height??0,U={id:F.id,parentId:F.parentId,rect:{width:V,height:q,...E8e({x:R.x??F.position.x,y:R.y??F.position.y},{width:V,height:q},F.parentId,P,M)}},J=oK([U],P,I,D);_.push(...J),L.x=R.x?Math.max(M[0]*V,R.x):void 0,L.y=R.y?Math.max(M[1]*q,R.y):void 0}if(L.x!==void 0&&L.y!==void 0){const M={id:x,type:"position",position:{...L}};_.push(M)}if(R.width!==void 0&&R.height!==void 0){const V={id:x,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:R.width,height:R.height}};_.push(V)}for(const M of A){const V={...M,type:"position"};_.push(V)}N(_)},onEnd:({width:R,height:A})=>{const N={id:x,type:"dimensions",resizing:!1,dimensions:{width:R,height:A}};O.getState().triggerNodeChanges([N])}})),E.current.update({controlPosition:j,boundaries:{minWidth:l,minHeight:c,maxWidth:u,maxHeight:d},keepAspectRatio:f,resizeDirection:h,onResizeStart:b,onResize:v,onResizeEnd:y,shouldResize:g}),()=>{var R;(R=E.current)==null||R.destroy()}},[j,l,c,u,d,f,b,v,y,g]);const T=j.split("-");return a.jsx("div",{className:eo(["react-flow__resize-control","nodrag",...T,n,i]),ref:k,style:{...r,scale:C,...o&&{[S?"backgroundColor":"borderColor"]:o}},children:s})}p.memo(aWt);var CBe=Object.defineProperty,oWt=(e,t,n)=>t in e?CBe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lWt=(e,t)=>{for(var n in t)CBe(e,n,{get:t[n],enumerable:!0})},cWt=(e,t,n)=>oWt(e,t+"",n),ABe={};lWt(ABe,{Graph:()=>Pd,alg:()=>cK,json:()=>_Be,version:()=>fWt});var uWt=Object.defineProperty,TBe=(e,t)=>{for(var n in t)uWt(e,n,{get:t[n],enumerable:!0})},Pd=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected="directed"in e?e.directed:!0,this._isMultigraph="multigraph"in e?e.multigraph:!1,this._isCompound="compound"in e?e.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return typeof e!="function"?this._defaultNodeLabelFn=()=>e:this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(n=>{t!==void 0?this.setNode(n,t):this.setNode(n)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]="\0",this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(n=>{this.setParent(n)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(t===void 0)t="\0";else{t+="";for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!=="\0")return t}}children(e="\0"){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e==="\0")return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t);for(let i of this.successors(e))n.add(i);return Array.from(n.values())}}isLeaf(e){let t;return this.isDirected()?t=this.successors(e):t=this.neighbors(e),t.length===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([r,s])=>{e(r)&&t.setNode(r,s)}),Object.values(this._edgeObjs).forEach(r=>{t.hasNode(r.v)&&t.hasNode(r.w)&&t.setEdge(r,this.edge(r))});let n={},i=r=>{let s=this.parent(r);return!s||t.hasNode(s)?(n[r]=s??void 0,s??void 0):s in n?n[s]:i(s)};return this._isCompound&&t.nodes().forEach(r=>t.setParent(r,i(r))),t}setDefaultEdgeLabel(e){return typeof e!="function"?this._defaultEdgeLabelFn=()=>e:this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((n,i)=>(t!==void 0?this.setEdge(n,i,t):this.setEdge(n,i),i)),this}setEdge(e,t,n,i){let r,s,o,l,c=!1;typeof e=="object"&&e!==null&&"v"in e?(r=e.v,s=e.w,o=e.name,arguments.length===2&&(l=t,c=!0)):(r=e,s=t,o=i,arguments.length>2&&(l=n,c=!0)),r=""+r,s=""+s,o!==void 0&&(o=""+o);let u=kS(this._isDirected,r,s,o);if(u in this._edgeLabels)return c&&(this._edgeLabels[u]=l),this;if(o!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(r),this.setNode(s),this._edgeLabels[u]=c?l:this._defaultEdgeLabelFn(r,s,o);let d=dWt(this._isDirected,r,s,o);return r=d.v,s=d.w,Object.freeze(d),this._edgeObjs[u]=d,moe(this._preds[s],r),moe(this._sucs[r],s),this._in[s][u]=d,this._out[r][u]=d,this._edgeCount++,this}edge(e,t,n){let i=arguments.length===1?n6(this._isDirected,e):kS(this._isDirected,e,t,n);return this._edgeLabels[i]}edgeAsObj(e,t,n){let i=arguments.length===1?this.edge(e):this.edge(e,t,n);return typeof i!="object"?{label:i}:i}hasEdge(e,t,n){return(arguments.length===1?n6(this._isDirected,e):kS(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let i=arguments.length===1?n6(this._isDirected,e):kS(this._isDirected,e,t,n),r=this._edgeObjs[i];if(r){let s=r.v,o=r.w;delete this._edgeLabels[i],delete this._edgeObjs[i],goe(this._preds[o],s),goe(this._sucs[s],o),delete this._in[o][i],delete this._out[s][i],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,n){if(!e)return;let i=Object.values(e);return n?i.filter(r=>r.v===t&&r.w===n||r.v===n&&r.w===t):i}};function moe(e,t){e[t]?e[t]++:e[t]=1}function goe(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function kS(e,t,n,i){let r=""+t,s=""+n;if(!e&&r>s){let o=r;r=s,s=o}return r+""+s+""+(i===void 0?"\0":i)}function dWt(e,t,n,i){let r=""+t,s=""+n;if(!e&&r>s){let l=r;r=s,s=l}let o={v:r,w:s};return i&&(o.name=i),o}function n6(e,t){return kS(e,t.v,t.w,t.name)}var fWt="4.0.1",_Be={};TBe(_Be,{read:()=>gWt,write:()=>hWt});function hWt(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:pWt(e),edges:mWt(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function pWt(e){return e.nodes().map(t=>{let n=e.node(t),i=e.parent(t),r={v:t};return n!==void 0&&(r.value=n),i!==void 0&&(r.parent=i),r})}function mWt(e){return e.edges().map(t=>{let n=e.edge(t),i={v:t.v,w:t.w};return t.name!==void 0&&(i.name=t.name),n!==void 0&&(i.value=n),i})}function gWt(e){let t=new Pd(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(n=>{t.setNode(n.v,n.value),n.parent&&t.setParent(n.v,n.parent)}),e.edges.forEach(n=>{t.setEdge({v:n.v,w:n.w,name:n.name},n.value)}),t}var cK={};TBe(cK,{CycleException:()=>NP,bellmanFord:()=>jBe,components:()=>vWt,dijkstra:()=>jP,dijkstraAll:()=>OWt,findCycles:()=>kWt,floydWarshall:()=>EWt,isAcyclic:()=>AWt,postorder:()=>_Wt,preorder:()=>jWt,prim:()=>NWt,shortestPaths:()=>RWt,tarjan:()=>RBe,topsort:()=>IBe});var bWt=()=>1;function jBe(e,t,n,i){return yWt(e,String(t),n||bWt,i||function(r){return e.outEdges(r)})}function yWt(e,t,n,i){let r={},s,o=0,l=e.nodes(),c=function(f){let h=n(f);r[f.v].distance+he.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(e,t){let n=this._keyIndices,i=String(e);if(!(i in n)){let r=this._arr,s=r.length;return n[i]=s,r.push({key:i,priority:t}),this._decrease(s),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw new Error(`Key not found: ${e}`);let i=this._arr[n].priority;if(t>i)throw new Error(`New priority is greater than current priority. Key: ${e} Old: ${i} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,i=n+1,r=e;n>1,!(t[i].priority1;function jP(e,t,n,i){let r=function(s){return e.outEdges(s)};return wWt(e,String(t),n||xWt,i||r)}function wWt(e,t,n,i){let r={},s=new NBe,o,l,c=function(u){let d=u.v!==o?u.v:u.w,f=r[d],h=n(u),m=l.distance+h;if(h<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+u+" Weight: "+h);m0&&(o=s.removeMin(),l=r[o],l.distance!==Number.POSITIVE_INFINITY);)i(o).forEach(c);return r}function OWt(e,t,n){return e.nodes().reduce(function(i,r){return i[r]=jP(e,r,t,n),i},{})}function RBe(e){let t=0,n=[],i={},r=[];function s(o){let l=i[o]={onStack:!0,lowlink:t,index:t++};if(n.push(o),e.successors(o).forEach(function(c){c in i?i[c].onStack&&(l.lowlink=Math.min(l.lowlink,i[c].index)):(s(c),l.lowlink=Math.min(l.lowlink,i[c].lowlink))}),l.lowlink===l.index){let c=[],u;do u=n.pop(),i[u].onStack=!1,c.push(u);while(o!==u);r.push(c)}}return e.nodes().forEach(function(o){o in i||s(o)}),r}function kWt(e){return RBe(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var SWt=()=>1;function EWt(e,t,n){return CWt(e,t||SWt,n||function(i){return e.outEdges(i)})}function CWt(e,t,n){let i={},r=e.nodes();return r.forEach(function(s){i[s]={},i[s][s]={distance:0,predecessor:""},r.forEach(function(o){s!==o&&(i[s][o]={distance:Number.POSITIVE_INFINITY,predecessor:""})}),n(s).forEach(function(o){let l=o.v===s?o.w:o.v,c=t(o);i[s][l]={distance:c,predecessor:s}})}),r.forEach(function(s){let o=i[s];r.forEach(function(l){let c=i[l];r.forEach(function(u){let d=c[s],f=o[u],h=c[u],m=d.distance+f.distance;m{var c;return(c=e.isDirected()?e.successors(l):e.neighbors(l))!=null?c:[]},o={};return t.forEach(function(l){if(!e.hasNode(l))throw new Error("Graph does not have node: "+l);r=PBe(e,l,n==="post",o,s,i,r)}),r}function PBe(e,t,n,i,r,s,o){return t in i||(i[t]=!0,n||(o=s(o,t)),r(t).forEach(function(l){o=PBe(e,l,n,i,r,s,o)}),n&&(o=s(o,t))),o}function DBe(e,t,n){return TWt(e,t,n,function(i,r){return i.push(r),i},[])}function _Wt(e,t){return DBe(e,t,"post")}function jWt(e,t){return DBe(e,t,"pre")}function NWt(e,t){let n=new Pd,i={},r=new NBe,s;function o(c){let u=c.v===s?c.w:c.v,d=r.priority(u);if(d!==void 0){let f=t(c);f0;){if(s=r.removeMin(),s in i)n.setEdge(s,i[s]);else{if(l)throw new Error("Input graph is not connected: "+e);l=!0}e.nodeEdges(s).forEach(o)}return n}function RWt(e,t,n,i){return IWt(e,t,n,i??(r=>{let s=e.outEdges(r);return s??[]}))}function IWt(e,t,n,i){if(n===void 0)return jP(e,t,n,i);let r=!1,s=e.nodes();for(let o=0;ot.setNode(n,e.node(n))),e.edges().forEach(n=>{let i=t.edge(n.v,n.w)||{weight:0,minlen:1},r=e.edge(n);t.setEdge(n.v,n.w,{weight:i.weight+r.weight,minlen:Math.max(i.minlen,r.minlen)})}),t}function MBe(e){let t=new Pd({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function boe(e,t){let n=e.x,i=e.y,r=t.x-n,s=t.y-i,o=e.width/2,l=e.height/2;if(!r&&!s)throw new Error("Not possible to find intersection inside of the rectangle");let c,u;return Math.abs(s)*o>Math.abs(r)*l?(s<0&&(l=-l),c=l*r/s,u=l):(r<0&&(o=-o),c=o,u=o*s/r),{x:n+c,y:i+u}}function qT(e){let t=fA($Be(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let i=e.node(n),r=i.rank;r!==void 0&&(t[r]||(t[r]=[]),t[r][i.order]=n)}),t}function DWt(e){let t=e.nodes().map(i=>{let r=e.node(i).rank;return r===void 0?Number.MAX_VALUE:r}),n=dh(Math.min,t);e.nodes().forEach(i=>{let r=e.node(i);Object.hasOwn(r,"rank")&&(r.rank-=n)})}function MWt(e){let t=e.nodes().map(o=>e.node(o).rank).filter(o=>o!==void 0),n=dh(Math.min,t),i=[];e.nodes().forEach(o=>{let l=e.node(o).rank-n;i[l]||(i[l]=[]),i[l].push(o)});let r=0,s=e.graph().nodeRankFactor;Array.from(i).forEach((o,l)=>{o===void 0&&l%s!==0?--r:o!==void 0&&r&&o.forEach(c=>e.node(c).rank+=r)})}function yoe(e,t,n,i){let r={width:0,height:0};return arguments.length>=4&&(r.rank=n,r.order=i),wO(e,"border",r,t)}function LWt(e,t=LBe){let n=[];for(let i=0;iLBe){let n=LWt(t);return e(...n.map(i=>e(...i)))}else return e(...t)}function $Be(e){let t=e.nodes().map(n=>{let i=e.node(n).rank;return i===void 0?Number.MIN_VALUE:i});return dh(Math.max,t)}function $Wt(e,t){let n={lhs:[],rhs:[]};return e.forEach(i=>{t(i)?n.lhs.push(i):n.rhs.push(i)}),n}function FBe(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}}function BBe(e,t){return t()}var FWt=0;function uK(e){let t=++FWt;return e+(""+t)}function fA(e,t,n=1){t==null&&(t=e,e=0);let i=s=>sti[t]:n=t,Object.entries(e).reduce((i,[r,s])=>(i[r]=n(s,r),i),{})}function BWt(e,t){return e.reduce((n,i,r)=>(n[i]=t[r],n),{})}var jL="\0",UWt="3.0.0",QWt=class{constructor(){cWt(this,"_sentinel");let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return voe(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&voe(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,zWt)),n=n._prev;return"["+e.join(", ")+"]"}};function voe(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function zWt(e,t){if(e!=="_next"&&e!=="_prev")return t}var VWt=QWt,HWt=()=>1;function qWt(e,t){if(e.nodeCount()<=1)return[];let n=KWt(e,t||HWt);return WWt(n.graph,n.buckets,n.zeroIdx).flatMap(i=>e.outEdges(i.v,i.w)||[])}function WWt(e,t,n){var i;let r=[],s=t[t.length-1],o=t[0],l;for(;e.nodeCount();){for(;l=o.dequeue();)i6(e,t,n,l);for(;l=s.dequeue();)i6(e,t,n,l);if(e.nodeCount()){for(let c=t.length-2;c>0;--c)if(l=(i=t[c])==null?void 0:i.dequeue(),l){r=r.concat(i6(e,t,n,l,!0)||[]);break}}}return r}function i6(e,t,n,i,r){let s=[],o=r?s:void 0;return(e.inEdges(i.v)||[]).forEach(l=>{let c=e.edge(l),u=e.node(l.v);r&&s.push({v:l.v,w:l.w}),u.out-=c,B7(t,n,u)}),(e.outEdges(i.v)||[]).forEach(l=>{let c=e.edge(l),u=l.w,d=e.node(u);d.in-=c,B7(t,n,d)}),e.removeNode(i.v),o}function KWt(e,t){let n=new Pd,i=0,r=0;e.nodes().forEach(l=>{n.setNode(l,{v:l,in:0,out:0})}),e.edges().forEach(l=>{let c=n.edge(l.v,l.w)||0,u=t(l),d=c+u;n.setEdge(l.v,l.w,d);let f=n.node(l.v),h=n.node(l.w);r=Math.max(r,f.out+=u),i=Math.max(i,h.in+=u)});let s=GWt(r+i+3).map(()=>new VWt),o=i+1;return n.nodes().forEach(l=>{B7(s,o,n.node(l))}),{graph:n,buckets:s,zeroIdx:o}}function B7(e,t,n){var i,r,s;n.out?n.in?(s=e[n.out-n.in+t])==null||s.enqueue(n):(r=e[e.length-1])==null||r.enqueue(n):(i=e[0])==null||i.enqueue(n)}function GWt(e){let t=[];for(let n=0;n{let i=e.edge(n);e.removeEdge(n),i.forwardName=n.name,i.reversed=!0,e.setEdge(n.w,n.v,i,uK("rev"))});function t(n){return i=>n.edge(i).weight}}function YWt(e){let t=[],n={},i={};function r(s){Object.hasOwn(i,s)||(i[s]=!0,n[s]=!0,e.outEdges(s).forEach(o=>{Object.hasOwn(n,o.w)?t.push(o):r(o.w)}),delete n[s])}return e.nodes().forEach(r),t}function ZWt(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let i=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,i)}})}function JWt(e){e.graph().dummyChains=[],e.edges().forEach(t=>eKt(e,t))}function eKt(e,t){let n=t.v,i=e.node(n).rank,r=t.w,s=e.node(r).rank,o=t.name,l=e.edge(t),c=l.labelRank;if(s===i+1)return;e.removeEdge(t);let u,d,f;for(f=0,++i;i{let n=e.node(t),i=n.edgeLabel,r;for(e.setEdge(n.edgeObj,i);n.dummy;)r=e.successors(t)[0],e.removeNode(t),i.points.push({x:n.x,y:n.y}),n.dummy==="edge-label"&&(i.x=n.x,i.y=n.y,i.width=n.width,i.height=n.height),t=r,n=e.node(t)})}function dK(e){let t={};function n(i){let r=e.node(i);if(Object.hasOwn(t,i))return r.rank;t[i]=!0;let s=e.outEdges(i),o=s?s.map(c=>c==null?Number.POSITIVE_INFINITY:n(c.w)-e.edge(c).minlen):[],l=dh(Math.min,o);return l===Number.POSITIVE_INFINITY&&(l=0),r.rank=l}e.sources().forEach(n)}function A1(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var UBe=nKt;function nKt(e){let t=new Pd({directed:!1}),n=e.nodes();if(n.length===0)throw new Error("Graph must have at least one node");let i=n[0],r=e.nodeCount();t.setNode(i,{});let s,o;for(;iKt(t,e){let o=s.v,l=i===o?s.w:o;!e.hasNode(l)&&!A1(t,s)&&(e.setNode(l,{}),e.setEdge(i,l,{}),n(l))})}return e.nodes().forEach(n),e.nodeCount()}function rKt(e,t){return t.edges().reduce((n,i)=>{let r=Number.POSITIVE_INFINITY;return e.hasNode(i.v)!==e.hasNode(i.w)&&(r=A1(t,i)),rt.node(i).rank+=n)}var{preorder:aKt,postorder:oKt}=cK,lKt=av;av.initLowLimValues=hK;av.initCutValues=fK;av.calcCutValue=QBe;av.leaveEdge=VBe;av.enterEdge=HBe;av.exchangeEdges=qBe;function av(e){e=PWt(e),dK(e);let t=UBe(e);hK(t),fK(t,e);let n,i;for(;n=VBe(t);)i=HBe(t,e,n),qBe(t,e,n,i)}function fK(e,t){let n=oKt(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(i=>cKt(e,t,i))}function cKt(e,t,n){let i=e.node(n).parent,r=e.edge(n,i);r.cutvalue=QBe(e,t,n)}function QBe(e,t,n){let i=e.node(n).parent,r=!0,s=t.edge(n,i),o=0;s||(r=!1,s=t.edge(i,n)),o=s.weight;let l=t.nodeEdges(n);return l&&l.forEach(c=>{let u=c.v===n,d=u?c.w:c.v;if(d!==i){let f=u===r,h=t.edge(c).weight;if(o+=f?h:-h,dKt(e,n,d)){let m=e.edge(n,d).cutvalue;o+=f?-m:m}}}),o}function hK(e,t){arguments.length<2&&(t=e.nodes()[0]),zBe(e,{},1,t)}function zBe(e,t,n,i,r){let s=n,o=e.node(i);t[i]=!0;let l=e.neighbors(i);return l&&l.forEach(c=>{Object.hasOwn(t,c)||(n=zBe(e,t,n,c,i))}),o.low=s,o.lim=n++,r?o.parent=r:delete o.parent,n}function VBe(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function HBe(e,t,n){let i=n.v,r=n.w;t.hasEdge(i,r)||(i=n.w,r=n.v);let s=e.node(i),o=e.node(r),l=s,c=!1;return s.lim>o.lim&&(l=o,c=!0),t.edges().filter(u=>c===xoe(e,e.node(u.v),l)&&c!==xoe(e,e.node(u.w),l)).reduce((u,d)=>A1(t,d)!e.node(r).parent);if(!n)return;let i=aKt(e,[n]);i=i.slice(1),i.forEach(r=>{let s=e.node(r).parent,o=t.edge(r,s),l=!1;o||(o=t.edge(s,r),l=!0),t.node(r).rank=t.node(s).rank+(l?o.minlen:-o.minlen)})}function dKt(e,t,n){return e.hasEdge(t,n)}function xoe(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var fKt=hKt;function hKt(e){let t=e.graph().ranker;if(typeof t=="function")return t(e);switch(t){case"network-simplex":woe(e);break;case"tight-tree":mKt(e);break;case"longest-path":pKt(e);break;case"none":break;default:woe(e)}}var pKt=dK;function mKt(e){dK(e),UBe(e)}function woe(e){lKt(e)}var gKt=bKt;function bKt(e){let t=vKt(e);e.graph().dummyChains.forEach(n=>{let i=e.node(n),r=i.edgeObj,s=yKt(e,t,r.v,r.w),o=s.path,l=s.lca,c=0,u=o[c],d=!0;for(;n!==r.w;){if(i=e.node(n),d){for(;(u=o[c])!==l&&e.node(u).maxRanko||l>t[c].lim));let u=c,d=i;for(;(d=e.parent(d))!==u;)s.push(d);return{path:r.concat(s.reverse()),lca:u}}function vKt(e){let t={},n=0;function i(r){let s=n;e.children(r).forEach(i),t[r]={low:s,lim:n++}}return e.children(jL).forEach(i),t}function xKt(e){let t=wO(e,"root",{},"_root"),n=wKt(e),i=Object.values(n),r=dh(Math.max,i)-1,s=2*r+1;e.graph().nestingRoot=t,e.edges().forEach(l=>e.edge(l).minlen*=s);let o=OKt(e)+1;e.children(jL).forEach(l=>WBe(e,t,s,o,r,n,l)),e.graph().nodeRankFactor=s}function WBe(e,t,n,i,r,s,o){var l;let c=e.children(o);if(!c.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}let u=yoe(e,"_bt"),d=yoe(e,"_bb"),f=e.node(o);e.setParent(u,o),f.borderTop=u,e.setParent(d,o),f.borderBottom=d,c.forEach(h=>{var m;WBe(e,t,n,i,r,s,h);let g=e.node(h),b=g.borderTop?g.borderTop:h,v=g.borderBottom?g.borderBottom:h,y=g.borderTop?i:2*i,w=b!==v?1:r-((m=s[o])!=null?m:0)+1;e.setEdge(u,b,{weight:y,minlen:w,nestingEdge:!0}),e.setEdge(v,d,{weight:y,minlen:w,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,u,{weight:0,minlen:r+((l=s[o])!=null?l:0)})}function wKt(e){let t={};function n(i,r){let s=e.children(i);s&&s.length&&s.forEach(o=>n(o,r+1)),t[i]=r}return e.children(jL).forEach(i=>n(i,1)),t}function OKt(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function kKt(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(n=>{e.edge(n).nestingEdge&&e.removeEdge(n)})}var SKt=EKt;function EKt(e){function t(n){let i=e.children(n),r=e.node(n);if(i.length&&i.forEach(t),Object.hasOwn(r,"minRank")){r.borderLeft=[],r.borderRight=[];for(let s=r.minRank,o=r.maxRank+1;skoe(e.node(t))),e.edges().forEach(t=>koe(e.edge(t)))}function koe(e){let t=e.width;e.width=e.height,e.height=t}function TKt(e){e.nodes().forEach(t=>r6(e.node(t))),e.edges().forEach(t=>{var n;let i=e.edge(t);(n=i.points)==null||n.forEach(r6),Object.hasOwn(i,"y")&&r6(i)})}function r6(e){e.y=-e.y}function _Kt(e){e.nodes().forEach(t=>s6(e.node(t))),e.edges().forEach(t=>{var n;let i=e.edge(t);(n=i.points)==null||n.forEach(s6),Object.hasOwn(i,"x")&&s6(i)})}function s6(e){let t=e.x;e.x=e.y,e.y=t}function jKt(e){let t={},n=e.nodes().filter(l=>!e.children(l).length),i=n.map(l=>e.node(l).rank),r=dh(Math.max,i),s=fA(r+1).map(()=>[]);function o(l){if(t[l])return;t[l]=!0;let c=e.node(l);s[c.rank].push(l);let u=e.successors(l);u&&u.forEach(o)}return n.sort((l,c)=>e.node(l).rank-e.node(c).rank).forEach(o),s}function NKt(e,t){let n=0;for(let i=1;id)),r=t.flatMap(u=>{let d=e.outEdges(u);return d?d.map(f=>({pos:i[f.w],weight:e.edge(f).weight})).sort((f,h)=>f.pos-h.pos):[]}),s=1;for(;s{let d=u.pos+s;l[d]+=u.weight;let f=0;for(;d>0;)d%2&&(f+=l[d+1]),d=d-1>>1,l[d]+=u.weight;c+=u.weight*f}),c}function IKt(e,t=[]){return t.map(n=>{let i=e.inEdges(n);if(!i||!i.length)return{v:n};{let r=i.reduce((s,o)=>{let l=e.edge(o),c=e.node(o.v);return{sum:s.sum+l.weight*c.order,weight:s.weight+l.weight}},{sum:0,weight:0});return{v:n,barycenter:r.sum/r.weight,weight:r.weight}}})}function PKt(e,t){let n={};e.forEach((r,s)=>{let o={indegree:0,in:[],out:[],vs:[r.v],i:s};r.barycenter!==void 0&&(o.barycenter=r.barycenter,o.weight=r.weight),n[r.v]=o}),t.edges().forEach(r=>{let s=n[r.v],o=n[r.w];s!==void 0&&o!==void 0&&(o.indegree++,s.out.push(o))});let i=Object.values(n).filter(r=>!r.indegree);return DKt(i)}function DKt(e){let t=[];function n(r){return s=>{s.merged||(s.barycenter===void 0||r.barycenter===void 0||s.barycenter>=r.barycenter)&&MKt(r,s)}}function i(r){return s=>{s.in.push(r),--s.indegree===0&&e.push(s)}}for(;e.length;){let r=e.pop();t.push(r),r.in.reverse().forEach(n(r)),r.out.forEach(i(r))}return t.filter(r=>!r.merged).map(r=>RP(r,["vs","i","barycenter","weight"]))}function MKt(e,t){let n=0,i=0;e.weight&&(n+=e.barycenter*e.weight,i+=e.weight),t.weight&&(n+=t.barycenter*t.weight,i+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/i,e.weight=i,e.i=Math.min(t.i,e.i),t.merged=!0}function LKt(e,t){let n=$Wt(e,d=>Object.hasOwn(d,"barycenter")),i=n.lhs,r=n.rhs.sort((d,f)=>f.i-d.i),s=[],o=0,l=0,c=0;i.sort($Kt(!!t)),c=Soe(s,r,c),i.forEach(d=>{c+=d.vs.length,s.push(d.vs),o+=d.barycenter*d.weight,l+=d.weight,c=Soe(s,r,c)});let u={vs:s.flat(1)};return l&&(u.barycenter=o/l,u.weight=l),u}function Soe(e,t,n){let i;for(;t.length&&(i=t[t.length-1]).i<=n;)t.pop(),e.push(i.vs),n++;return n}function $Kt(e){return(t,n)=>t.barycentern.barycenter?1:e?n.i-t.i:t.i-n.i}function GBe(e,t,n,i){let r=e.children(t),s=e.node(t),o=s?s.borderLeft:void 0,l=s?s.borderRight:void 0,c={};o&&(r=r.filter(h=>h!==o&&h!==l));let u=IKt(e,r);u.forEach(h=>{if(e.children(h.v).length){let m=GBe(e,h.v,n,i);c[h.v]=m,Object.hasOwn(m,"barycenter")&&BKt(h,m)}});let d=PKt(u,n);FKt(d,c);let f=LKt(d,i);if(o&&l){f.vs=[o,f.vs,l].flat(1);let h=e.predecessors(o);if(h&&h.length){let m=e.node(h[0]),g=e.predecessors(l),b=e.node(g[0]);Object.hasOwn(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+m.order+b.order)/(f.weight+2),f.weight+=2}}return f}function FKt(e,t){e.forEach(n=>{n.vs=n.vs.flatMap(i=>t[i]?t[i].vs:i)})}function BKt(e,t){e.barycenter!==void 0?(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight):(e.barycenter=t.barycenter,e.weight=t.weight)}function UKt(e,t,n,i){i||(i=e.nodes());let r=QKt(e),s=new Pd({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(o=>e.node(o));return i.forEach(o=>{let l=e.node(o),c=e.parent(o);if(l.rank===t||l.minRank<=t&&t<=l.maxRank){s.setNode(o),s.setParent(o,c||r);let u=e[n](o);u&&u.forEach(d=>{let f=d.v===o?d.w:d.v,h=s.edge(f,o),m=h!==void 0?h.weight:0;s.setEdge(f,o,{weight:e.edge(d).weight+m})}),Object.hasOwn(l,"minRank")&&s.setNode(o,{borderLeft:l.borderLeft[t],borderRight:l.borderRight[t]})}}),s}function QKt(e){let t;for(;e.hasNode(t=uK("_root")););return t}function zKt(e,t,n){let i={},r;n.forEach(s=>{let o=e.parent(s),l,c;for(;o;){if(l=e.parent(o),l?(c=i[l],i[l]=o):(c=r,r=o),c&&c!==o){t.setEdge(c,o);return}o=l}})}function XBe(e,t={}){if(typeof t.customOrder=="function"){t.customOrder(e,XBe);return}let n=$Be(e),i=Eoe(e,fA(1,n+1),"inEdges"),r=Eoe(e,fA(n-1,-1,-1),"outEdges"),s=jKt(e);if(Coe(e,s),t.disableOptimalOrderHeuristic)return;let o=Number.POSITIVE_INFINITY,l,c=t.constraints||[];for(let u=0,d=0;d<4;++u,++d){VKt(u%2?i:r,u%4>=2,c),s=qT(e);let f=NKt(e,s);f{i.has(s)||i.set(s,[]),i.get(s).push(o)};for(let s of e.nodes()){let o=e.node(s);if(typeof o.rank=="number"&&r(o.rank,s),typeof o.minRank=="number"&&typeof o.maxRank=="number")for(let l=o.minRank;l<=o.maxRank;l++)l!==o.rank&&r(l,s)}return t.map(function(s){return UKt(e,s,n,i.get(s)||[])})}function VKt(e,t,n){let i=new Pd;e.forEach(function(r){n.forEach(l=>i.setEdge(l.left,l.right));let s=r.graph().root,o=GBe(r,s,i,t);o.vs.forEach((l,c)=>r.node(l).order=c),zKt(r,i,o.vs)})}function Coe(e,t){Object.values(t).forEach(n=>n.forEach((i,r)=>e.node(i).order=r))}function HKt(e,t){let n={};function i(r,s){let o=0,l=0,c=r.length,u=s[s.length-1];return s.forEach((d,f)=>{let h=WKt(e,d),m=h?e.node(h).order:c;(h||d===u)&&(s.slice(l,f+1).forEach(g=>{let b=e.predecessors(g);b&&b.forEach(v=>{let y=e.node(v),w=y.order;(w{let f=s[d];if(f!==void 0&&e.node(f).dummy){let h=e.predecessors(f);h&&h.forEach(m=>{if(m===void 0)return;let g=e.node(m);g.dummy&&(g.orderu)&&YBe(n,m,f)})}})}function r(s,o){let l=-1,c=-1,u=0;return o.forEach((d,f)=>{if(e.node(d).dummy==="border"){let h=e.predecessors(d);if(h&&h.length){let m=h[0];if(m===void 0)return;c=e.node(m).order,i(o,u,f,l,c),u=f,l=c}}i(o,u,o.length,c,s.length)}),o}return t.length&&t.reduce(r),n}function WKt(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(i=>e.node(i).dummy)}}function YBe(e,t,n){if(t>n){let r=t;t=n,n=r}let i=e[t];i||(e[t]=i={}),i[n]=!0}function KKt(e,t,n){if(t>n){let r=t;t=n,n=r}let i=e[t];return i!==void 0&&Object.hasOwn(i,n)}function GKt(e,t,n,i){let r={},s={},o={};return t.forEach(l=>{l.forEach((c,u)=>{r[c]=c,s[c]=c,o[c]=u})}),t.forEach(l=>{let c=-1;l.forEach(u=>{let d=i(u);if(d&&d.length){let f=d.sort((m,g)=>{let b=o[m],v=o[g];return(b!==void 0?b:0)-(v!==void 0?v:0)}),h=(f.length-1)/2;for(let m=Math.floor(h),g=Math.ceil(h);m<=g;++m){let b=f[m];if(b===void 0)continue;let v=o[b];if(v!==void 0&&s[u]===u&&c{var y;let w=(y=s[v.v])!=null?y:0,x=o.edge(v);return Math.max(b,w+(x!==void 0?x:0))},0):s[m]=0}function d(m){let g=o.outEdges(m),b=Number.POSITIVE_INFINITY;g&&(b=g.reduce((y,w)=>{let x=s[w.w],O=o.edge(w);return Math.min(y,(x!==void 0?x:0)-(O!==void 0?O:0))},Number.POSITIVE_INFINITY));let v=e.node(m);b!==Number.POSITIVE_INFINITY&&v.borderType!==l&&(s[m]=Math.max(s[m]!==void 0?s[m]:0,b))}function f(m){return o.predecessors(m)||[]}function h(m){return o.successors(m)||[]}return c(u,f),c(d,h),Object.keys(i).forEach(m=>{var g;let b=n[m];b!==void 0&&(s[m]=(g=s[b])!=null?g:0)}),s}function YKt(e,t,n,i){let r=new Pd,s=e.graph(),o=nGt(s.nodesep,s.edgesep,i);return t.forEach(l=>{let c;l.forEach(u=>{let d=n[u];if(d!==void 0){if(r.setNode(d),c!==void 0){let f=n[c];if(f!==void 0){let h=r.edge(f,d);r.setEdge(f,d,Math.max(o(e,u,c),h||0))}}c=u}})}),r}function ZKt(e,t){return Object.values(t).reduce((n,i)=>{let r=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY;Object.entries(i).forEach(([l,c])=>{let u=iGt(e,l)/2;r=Math.max(c+u,r),s=Math.min(c-u,s)});let o=r-s;return o{["l","r"].forEach(o=>{let l=s+o,c=e[l];if(!c||c===t)return;let u=Object.values(c),d=i-dh(Math.min,u);o!=="l"&&(d=r-dh(Math.max,u)),d&&(e[l]=_L(c,f=>f+d))})})}function eGt(e,t=void 0){let n=e.ul;return n?_L(n,(i,r)=>{var s,o;if(t){let c=t.toLowerCase(),u=e[c];if(u&&u[r]!==void 0)return u[r]}let l=Object.values(e).map(c=>{let u=c[r];return u!==void 0?u:0}).sort((c,u)=>c-u);return(((s=l[1])!=null?s:0)+((o=l[2])!=null?o:0))/2}):{}}function tGt(e){let t=qT(e),n=Object.assign(HKt(e,t),qKt(e,t)),i={},r;["u","d"].forEach(o=>{r=o==="u"?t:Object.values(t).reverse(),["l","r"].forEach(l=>{l==="r"&&(r=r.map(d=>Object.values(d).reverse()));let c=GKt(e,r,n,d=>(o==="u"?e.predecessors(d):e.successors(d))||[]),u=XKt(e,r,c.root,c.align,l==="r");l==="r"&&(u=_L(u,d=>-d)),i[o+l]=u})});let s=ZKt(e,i);return JKt(i,s),eGt(i,e.graph().align)}function nGt(e,t,n){return(i,r,s)=>{let o=i.node(r),l=i.node(s),c=0,u;if(c+=o.width/2,Object.hasOwn(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":u=-o.width/2;break;case"r":u=o.width/2;break}if(u&&(c+=n?u:-u),u=void 0,c+=(o.dummy?t:e)/2,c+=(l.dummy?t:e)/2,c+=l.width/2,Object.hasOwn(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":u=l.width/2;break;case"r":u=-l.width/2;break}return u&&(c+=n?u:-u),c}}function iGt(e,t){return e.node(t).width}function rGt(e){e=MBe(e),sGt(e),Object.entries(tGt(e)).forEach(([t,n])=>e.node(t).x=n)}function sGt(e){let t=qT(e),n=e.graph(),i=n.ranksep,r=n.rankalign,s=0;t.forEach(o=>{let l=o.reduce((c,u)=>{var d;let f=(d=e.node(u).height)!=null?d:0;return c>f?c:f},0);o.forEach(c=>{let u=e.node(c);r==="top"?u.y=s+u.height/2:r==="bottom"?u.y=s+l-u.height/2:u.y=s+l/2}),s+=l+i})}function aGt(e,t={}){let n=t.debugTiming?FBe:BBe;return n("layout",()=>{let i=n(" buildLayoutGraph",()=>gGt(e));return n(" runLayout",()=>oGt(i,n,t)),n(" updateInputGraph",()=>lGt(e,i)),i})}function oGt(e,t,n){t(" makeSpaceForEdgeLabels",()=>bGt(e)),t(" removeSelfEdges",()=>CGt(e)),t(" acyclic",()=>XWt(e)),t(" nestingGraph.run",()=>xKt(e)),t(" rank",()=>fKt(MBe(e))),t(" injectEdgeLabelProxies",()=>yGt(e)),t(" removeEmptyRanks",()=>MWt(e)),t(" nestingGraph.cleanup",()=>kKt(e)),t(" normalizeRanks",()=>DWt(e)),t(" assignRankMinMax",()=>vGt(e)),t(" removeEdgeLabelProxies",()=>xGt(e)),t(" normalize.run",()=>JWt(e)),t(" parentDummyChains",()=>gKt(e)),t(" addBorderSegments",()=>SKt(e)),t(" order",()=>XBe(e,n)),t(" insertSelfEdges",()=>AGt(e)),t(" adjustCoordinateSystem",()=>CKt(e)),t(" position",()=>rGt(e)),t(" positionSelfEdges",()=>TGt(e)),t(" removeBorderNodes",()=>EGt(e)),t(" normalize.undo",()=>tKt(e)),t(" fixupEdgeLabelCoords",()=>kGt(e)),t(" undoCoordinateSystem",()=>AKt(e)),t(" translateGraph",()=>wGt(e)),t(" assignNodeIntersects",()=>OGt(e)),t(" reversePoints",()=>SGt(e)),t(" acyclic.undo",()=>ZWt(e))}function lGt(e,t){e.nodes().forEach(n=>{let i=e.node(n),r=t.node(n);i&&(i.x=r.x,i.y=r.y,i.order=r.order,i.rank=r.rank,t.children(n).length&&(i.width=r.width,i.height=r.height))}),e.edges().forEach(n=>{let i=e.edge(n),r=t.edge(n);i.points=r.points,Object.hasOwn(r,"x")&&(i.x=r.x,i.y=r.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var cGt=["nodesep","edgesep","ranksep","marginx","marginy"],uGt={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},dGt=["acyclicer","ranker","rankdir","align","rankalign"],fGt=["width","height","rank"],Aoe={width:0,height:0},hGt=["minlen","weight","width","height","labeloffset"],pGt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},mGt=["labelpos"];function gGt(e){let t=new Pd({multigraph:!0,compound:!0}),n=o6(e.graph());return t.setGraph(Object.assign({},uGt,a6(n,cGt),RP(n,dGt))),e.nodes().forEach(i=>{let r=o6(e.node(i)),s=a6(r,fGt);Object.keys(Aoe).forEach(l=>{s[l]===void 0&&(s[l]=Aoe[l])}),t.setNode(i,s);let o=e.parent(i);o!==void 0&&t.setParent(i,o)}),e.edges().forEach(i=>{let r=o6(e.edge(i));t.setEdge(i,Object.assign({},pGt,a6(r,hGt),RP(r,mGt)))}),t}function bGt(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let i=e.edge(n);i.minlen*=2,i.labelpos.toLowerCase()!=="c"&&(t.rankdir==="TB"||t.rankdir==="BT"?i.width+=i.labeloffset:i.height+=i.labeloffset)})}function yGt(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let i=e.node(t.v),r={rank:(e.node(t.w).rank-i.rank)/2+i.rank,e:t};wO(e,"edge-proxy",r,"_ep")}})}function vGt(e){let t=0;e.nodes().forEach(n=>{let i=e.node(n);i.borderTop&&(i.minRank=e.node(i.borderTop).rank,i.maxRank=e.node(i.borderBottom).rank,t=Math.max(t,i.maxRank))}),e.graph().maxRank=t}function xGt(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy==="edge-proxy"){let i=n;e.edge(i.e).labelRank=n.rank,e.removeNode(t)}})}function wGt(e){let t=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,r=0,s=e.graph(),o=s.marginx||0,l=s.marginy||0;function c(u){let d=u.x,f=u.y,h=u.width,m=u.height;t=Math.min(t,d-h/2),n=Math.max(n,d+h/2),i=Math.min(i,f-m/2),r=Math.max(r,f+m/2)}e.nodes().forEach(u=>c(e.node(u))),e.edges().forEach(u=>{let d=e.edge(u);Object.hasOwn(d,"x")&&c(d)}),t-=o,i-=l,e.nodes().forEach(u=>{let d=e.node(u);d.x-=t,d.y-=i}),e.edges().forEach(u=>{let d=e.edge(u);d.points.forEach(f=>{f.x-=t,f.y-=i}),Object.hasOwn(d,"x")&&(d.x-=t),Object.hasOwn(d,"y")&&(d.y-=i)}),s.width=n-t+o,s.height=r-i+l}function OGt(e){e.edges().forEach(t=>{let n=e.edge(t),i=e.node(t.v),r=e.node(t.w),s,o;n.points?(s=n.points[0],o=n.points[n.points.length-1]):(n.points=[],s=r,o=i),n.points.unshift(boe(i,s)),n.points.push(boe(r,o))})}function kGt(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,"x"))switch((n.labelpos==="l"||n.labelpos==="r")&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}})}function SGt(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function EGt(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),i=e.node(n.borderTop),r=e.node(n.borderBottom),s=e.node(n.borderLeft[n.borderLeft.length-1]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-s.x),n.height=Math.abs(r.y-i.y),n.x=s.x+n.width/2,n.y=i.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy==="border"&&e.removeNode(t)})}function CGt(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function AGt(e){qT(e).forEach(t=>{let n=0;t.forEach((i,r)=>{let s=e.node(i);s.order=r+n,(s.selfEdges||[]).forEach(o=>{wO(e,"selfedge",{width:o.label.width,height:o.label.height,rank:s.rank,order:r+ ++n,e:o.e,label:o.label},"_se")}),delete s.selfEdges})})}function TGt(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy==="selfedge"){let i=n,r=e.node(i.e.v),s=r.x+r.width/2,o=r.y,l=n.x-s,c=r.height/2;e.setEdge(i.e,i.label),e.removeNode(t),i.label.points=[{x:s+2*l/3,y:o-c},{x:s+5*l/6,y:o-c},{x:s+l,y:o},{x:s+5*l/6,y:o+c},{x:s+2*l/3,y:o+c}],i.label.x=n.x,i.label.y=n.y}})}function a6(e,t){return _L(RP(e,t),Number)}function o6(e){let t={};return e&&Object.entries(e).forEach(([n,i])=>{typeof n=="string"&&(n=n.toLowerCase()),t[n]=i}),t}function _Gt(e){let t=qT(e),n=new Pd({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(i=>{n.setNode(i,{label:i}),n.setParent(i,"layer"+e.node(i).rank)}),e.edges().forEach(i=>n.setEdge(i.v,i.w,{},i.name)),t.forEach((i,r)=>{let s="layer"+r;n.setNode(s,{rank:"same"}),i.reduce((o,l)=>(n.setEdge(o,l,{style:"invis"}),l))}),n}var jGt={graphlib:ABe,version:UWt,layout:aGt,debug:_Gt,util:{time:FBe,notime:BBe}},Toe=jGt;/*! For license information please see dagre.esm.js.LEGAL.txt */const SS={llm:{labelKey:"buildCanvas.patterns.llm.label",descriptionKey:"buildCanvas.patterns.llm.description",icon:Lje},sequential:{labelKey:"buildCanvas.patterns.sequential.label",descriptionKey:"buildCanvas.patterns.sequential.description",icon:Bat},parallel:{labelKey:"buildCanvas.patterns.parallel.label",descriptionKey:"buildCanvas.patterns.parallel.description",icon:xat},loop:{labelKey:"buildCanvas.patterns.loop.label",descriptionKey:"buildCanvas.patterns.loop.description",icon:Qje},a2a:{labelKey:"buildCanvas.patterns.a2a.label",descriptionKey:"buildCanvas.patterns.a2a.description",icon:nM}},U7=220,Q7=88,_oe=96,joe=34,jE=64,l6=310,Vx=24,ZBe=56,z7=40,Noe=40,NGt=18,RGt=58,IGt=!1,PGt=e=>e==="sequential"||e==="parallel"||e==="loop";function V7(e,t){const n=e.agentType??"llm";return PGt(n)||n==="llm"&&(t.length===0||e.subAgents.length>0)}function H7(e,t=[],n="horizontal",i=!1){const r=e.agentType??"llm";if(!V7(e,t))return{width:U7,height:Q7};if(i&&e.subAgents.length===0)return{width:l6,height:jE};const s=e.subAgents.map((f,h)=>H7(f,[...t,h],n,i)),o=s.length?Math.max(...s.map(f=>f.width)):0,l=s.length?Math.max(...s.map(f=>f.height)):0,c=s.length&&r!=="parallel"?ZBe:Vx,u=n==="horizontal"?r!=="parallel":r==="parallel",d=s.length?r==="parallel"?NGt+Noe:r==="loop"?RGt:0:Noe;return u?{width:Math.max(l6,s.reduce((f,h)=>f+h.width,0)+z7*Math.max(0,s.length-1)+c*2),height:jE+Vx+l+d+Vx}:{width:Math.max(l6,o+Vx*2),height:jE+c+s.reduce((f,h)=>f+h.height,0)+z7*Math.max(0,s.length-1)+d+c}}function Rk(e){return e.length===0?"agent-root":`agent-${e.join("-")}`}function DGt(e,t){return e.length===t.length&&e.every((n,i)=>n===t[i])}function Roe(e){const t=n=>[n.agentType??"llm",n.subAgents.map(t)];return JSON.stringify(t(e))}function Ik(e,t,n,i){const r=(i==null?void 0:i.tone)==="sequential"?"hsl(213 40% 40%)":(i==null?void 0:i.tone)==="loop"?"hsl(151 34% 34%)":"hsl(220 9% 38%)";return{id:`${e}-${t}${i!=null&&i.loop?"-loop":""}`,source:e,target:t,sourceHandle:i!=null&&i.loop?"loop-source":void 0,targetHandle:i!=null&&i.loop?"loop-target":void 0,label:n,type:"insertStep",data:i?{insert:i.insert,loop:i.loop,tone:i.tone}:void 0,animated:i==null?void 0:i.loop,markerEnd:{type:lA.ArrowClosed,width:16,height:16,color:r},style:{stroke:r,strokeWidth:1.5},labelStyle:{fill:"hsl(215 14% 42%)",fontSize:10,fontWeight:600},labelBgStyle:{fill:"hsl(var(--background))",fillOpacity:.92}}}function Ioe(e,t,n=!1,i){const r=[{id:"terminal-input",type:"terminal",position:{x:0,y:0},data:{kind:"terminal",title:i("buildCanvas.terminals.input")},selectable:!1,draggable:!1},{id:"terminal-output",type:"terminal",position:{x:0,y:0},data:{kind:"terminal",title:i("buildCanvas.terminals.output")},selectable:!1,draggable:!1}],s=[];function o(f,h,m,g,b){const v=f.agentType??"llm",y=Rk(h);return V7(f,h)?(l(f,h,m,g,b),y):(r.push({id:y,type:"agent",parentId:m,extent:"parent",position:g,data:{kind:"agent",path:h,agent:f,title:v==="a2a"?i("buildCanvas.patterns.a2a.label"):f.name.trim()||(h.length===0?i("buildCanvas.rootAgent"):i("buildCanvas.unnamedStep")),pattern:v,description:f.description.trim()||i(SS[v].descriptionKey),childCount:f.subAgents.length,containedIn:b}}),y)}function l(f,h,m,g={x:0,y:0},b){const v=f.agentType??"sequential",y=Rk(h),w=H7(f,h,t,n);r.push({id:y,type:"group",parentId:m,extent:m?"parent":void 0,position:g,style:{width:w.width,height:w.height},data:{kind:"agent",path:h,agent:f,title:f.name.trim()||(h.length===0?i("buildCanvas.rootAgent"):i(SS[v].labelKey)),pattern:v,description:f.description.trim()||i(SS[v].descriptionKey),childCount:f.subAgents.length,containedIn:b,layoutWidth:w.width,layoutHeight:w.height,compactEmptyGroup:n&&f.subAgents.length===0}});const x=f.subAgents.map((E,j)=>H7(E,[...h,j],t,n)),O=x.length&&v!=="parallel"?ZBe:Vx,k=t==="horizontal"?v!=="parallel":v==="parallel";let S=O;const C=f.subAgents.map((E,j)=>{const T=x[j],R=k?{x:S,y:jE+Vx}:{x:(w.width-T.width)/2,y:jE+S};return S+=(k?T.width:T.height)+z7,o(E,[...h,j],y,R,v)});if(v==="sequential"||v==="loop"){for(let E=0;E1&&s.push(Ik(C[C.length-1],C[0],i("buildCanvas.edges.continueLoop"),{loop:!0,tone:"loop"}))}return y}const c=(f,h)=>{const m=f.agentType??"llm",g=Rk(h);if(V7(f,h))return l(f,h),[g];if(r.push({id:g,type:"agent",position:{x:0,y:0},data:{kind:"agent",path:h,agent:f,title:m==="a2a"?i("buildCanvas.patterns.a2a.label"):f.name.trim()||(h.length===0?i("buildCanvas.rootAgent"):i("buildCanvas.unnamedStep")),pattern:m,description:f.description.trim()||i(SS[m].descriptionKey),childCount:f.subAgents.length}}),f.subAgents.length===0)return[g];const b=[];return f.subAgents.forEach((v,y)=>{const w=[...h,y],x=Rk(w);s.push(Ik(g,x,i("buildCanvas.edges.call"),{insert:{parentPath:h,index:y}})),b.push(...c(v,w))}),b},u=Rk([]),d=c(e,[]);return s.push(Ik("terminal-input",u)),d.forEach(f=>s.push(Ik(f,"terminal-output"))),MGt(r,s,t)}function MGt(e,t,n){const i=new Toe.graphlib.Graph().setDefaultEdgeLabel(()=>({}));i.setGraph({rankdir:n==="vertical"?"TB":"LR",ranksep:50,nodesep:34,edgesep:14,marginx:24,marginy:24});const r=new Set(e.filter(s=>!s.parentId).map(s=>s.id));return e.filter(s=>!s.parentId).forEach(s=>{const o=s.data.kind==="terminal";i.setNode(s.id,{width:o?_oe:s.data.layoutWidth??U7,height:o?joe:s.data.layoutHeight??Q7})}),t.filter(s=>r.has(s.source)&&r.has(s.target)).forEach(s=>i.setEdge(s.source,s.target)),Toe.layout(i),{nodes:e.map(s=>{if(s.parentId)return s;const o=i.node(s.id),l=s.data.kind==="terminal",c=l?_oe:s.data.layoutWidth??U7,u=l?joe:s.data.layoutHeight??Q7;return{...s,position:{x:o.x-c/2,y:o.y-u/2}}}),edges:t}}const NL=p.createContext(null),RL=p.createContext("horizontal");function LGt({id:e,sourceX:t,sourceY:n,targetX:i,targetY:r,sourcePosition:s,targetPosition:o,markerEnd:l,style:c,label:u,data:d}){const{t:f}=Te("create"),h=p.useContext(NL),[m,g]=p.useState(!1),[b,v,y]=TP({sourceX:t,sourceY:n,targetX:i,targetY:r,sourcePosition:s,targetPosition:o,offset:d!=null&&d.loop?28:20});return a.jsxs(a.Fragment,{children:[a.jsx(HT,{id:e,path:b,markerEnd:l,style:c}),h&&(d==null?void 0:d.insert)&&a.jsx("path",{d:b,className:"abc-edge-hover-path",onPointerEnter:()=>g(!0),onPointerLeave:()=>g(!1)}),(u||h&&(d==null?void 0:d.insert))&&a.jsx(_qt,{children:a.jsxs("div",{className:`abc-edge-tools${h&&(d!=null&&d.insert)?" can-insert":""}${m?" is-visible":""}`,style:{transform:`translate(-50%, -50%) translate(${v}px, ${y}px)`},onPointerEnter:()=>g(!0),onPointerLeave:()=>g(!1),children:[u&&a.jsx("span",{className:"abc-edge-label",children:u}),h&&(d==null?void 0:d.insert)&&a.jsx("button",{type:"button",className:"abc-edge-add nodrag nopan","aria-label":f("buildCanvas.actions.insertHere"),title:f("buildCanvas.actions.insertHere"),onClick:w=>{w.stopPropagation(),h==null||h.onInsert(d.insert.parentPath,d.insert.index)},children:a.jsx(ic,{})})]})})]})}function $Gt({data:e,selected:t}){const{t:n}=Te("create"),i=p.useContext(NL),r=p.useContext(RL),s=r==="vertical"?vn.Top:vn.Left,o=r==="vertical"?vn.Bottom:vn.Right,l=r==="vertical"?vn.Right:vn.Bottom,c=e.pattern??"llm",u=SS[c],d=u.icon;return a.jsxs("div",{className:`abc-node is-${c}${e.containedIn?` is-contained-in-${e.containedIn}`:""}${t?" is-selected":""}`,children:[a.jsx($c,{type:"target",position:s,className:"abc-handle"}),c!=="llm"&&a.jsx("span",{className:"abc-node-icon",children:a.jsx(d,{})}),a.jsxs("span",{className:"abc-node-copy",children:[a.jsx("span",{className:"abc-node-meta",children:a.jsx("span",{children:n(u.labelKey)})}),a.jsx("strong",{children:e.title}),a.jsx("small",{children:e.description})]}),i&&e.path!==void 0&&e.path.length>0&&a.jsx("button",{type:"button",className:"abc-node-delete nodrag nopan","aria-label":n("buildCanvas.actions.deleteNamed",{name:e.title}),title:n("buildCanvas.actions.deleteNode"),onClick:f=>{f.stopPropagation(),i==null||i.onDelete(e.path)},children:a.jsx(Jg,{})}),a.jsx($c,{type:"source",position:o,className:"abc-handle"}),e.containedIn==="loop"&&a.jsxs(a.Fragment,{children:[a.jsx($c,{id:"loop-target",type:"target",position:l,className:"abc-handle abc-loop-handle"}),a.jsx($c,{id:"loop-source",type:"source",position:l,className:"abc-handle abc-loop-handle"})]})]})}function FGt({data:e,selected:t}){const{t:n}=Te("create"),i=p.useContext(NL),r=p.useContext(RL),s=r==="vertical"?vn.Top:vn.Left,o=r==="vertical"?vn.Bottom:vn.Right,l=r==="vertical"?vn.Right:vn.Bottom,c=e.pattern??"sequential",u=e.childCount??0,d=n(c==="llm"?"buildCanvas.actions.addSubagent":c==="parallel"?"buildCanvas.actions.addParallelStep":c==="loop"?"buildCanvas.actions.addLoopStep":"buildCanvas.actions.addNextStep");return a.jsxs("div",{className:`abc-group is-${c}${e.compactEmptyGroup?" is-compact-empty":""}${t?" is-selected":""}`,children:[a.jsx($c,{type:"target",position:s,className:"abc-handle"}),a.jsx("header",{className:"abc-group-head",children:a.jsxs("span",{children:[a.jsx("strong",{title:e.title,children:e.title}),a.jsx("small",{children:e.description})]})}),i&&e.path!==void 0&&u>0&&c!=="parallel"&&a.jsxs("div",{className:"abc-group-boundary-actions",children:[a.jsx("button",{type:"button",className:"abc-group-boundary-add is-start nodrag nopan","aria-label":n("buildCanvas.actions.addFirst"),title:n("buildCanvas.actions.addFirst"),onClick:f=>{f.stopPropagation(),i.onInsert(e.path,0)},children:a.jsx(ic,{})}),a.jsx("button",{type:"button",className:"abc-group-boundary-add is-end nodrag nopan","aria-label":n("buildCanvas.actions.addLast"),title:n("buildCanvas.actions.addLast"),onClick:f=>{f.stopPropagation(),i.onAdd(e.path)},children:a.jsx(ic,{})})]}),i&&e.path!==void 0&&u>0&&c==="parallel"&&a.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-bottom nodrag nopan",onClick:f=>{f.stopPropagation(),i.onAdd(e.path)},children:[a.jsx(ic,{}),a.jsx("span",{children:d})]}),i&&e.path!==void 0&&u===0&&a.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-empty nodrag nopan",onClick:f=>{f.stopPropagation(),i.onAdd(e.path)},children:[a.jsx(ic,{}),a.jsx("span",{children:d})]}),i&&e.path!==void 0&&e.path.length>0&&a.jsx("button",{type:"button",className:"abc-node-delete nodrag nopan","aria-label":n("buildCanvas.actions.deleteNamed",{name:e.title}),title:n("buildCanvas.actions.deleteNode"),onClick:f=>{f.stopPropagation(),i==null||i.onDelete(e.path)},children:a.jsx(Jg,{})}),a.jsx($c,{type:"source",position:o,className:"abc-handle"}),e.containedIn==="loop"&&a.jsxs(a.Fragment,{children:[a.jsx($c,{id:"loop-target",type:"target",position:l,className:"abc-handle abc-loop-handle"}),a.jsx($c,{id:"loop-source",type:"source",position:l,className:"abc-handle abc-loop-handle"})]})]})}function BGt({data:e}){const t=p.useContext(RL);return a.jsxs("div",{className:"abc-terminal",children:[a.jsx($c,{type:"target",position:t==="vertical"?vn.Top:vn.Left,className:"abc-handle"}),a.jsx("span",{children:e.title}),a.jsx($c,{type:"source",position:t==="vertical"?vn.Bottom:vn.Right,className:"abc-handle"})]})}const UGt={agent:$Gt,group:FGt,terminal:BGt},QGt={insertStep:LGt};function zGt({draft:e,selectedPath:t,onSelect:n,onAdd:i,onInsert:r,onDelete:s,readOnly:o=!1,interactivePreview:l=!1,direction:c="horizontal"}){const{t:u}=Te("create"),d=p.useMemo(()=>Ioe(e,c,o,u),[]),[f,h,m]=jqt(d.nodes),[g,b,v]=Nqt(d.edges),y=Iqt(),w=p.useRef(`${c}:${o?"readonly":"editable"}:${Roe(e)}`),x=p.useRef(null),{fitView:O}=AL(),k=p.useMemo(()=>Ioe(e,c,o,u),[c,e,o,u]),[S,C]=p.useState(()=>window.matchMedia("(max-width: 860px)").matches),E=p.useMemo(()=>o?{padding:.16,minZoom:.05,maxZoom:.9}:S?{padding:.08,minZoom:.35,maxZoom:.9}:{padding:.14,minZoom:.42,maxZoom:1.1},[S,o]),j=p.useCallback((R=0)=>{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{const A=x.current;if(A&&(A.clientWidth===0||A.clientHeight===0)&&R<8){j(R+1);return}O(E)})})},[E,O]);p.useEffect(()=>{const R=window.matchMedia("(max-width: 860px)"),A=N=>C(N.matches);return R.addEventListener("change",A),()=>R.removeEventListener("change",A)},[]),p.useEffect(()=>{const R=`${c}:${o?"readonly":"editable"}:${Roe(e)}`,A=R!==w.current;w.current=R,b(k.edges),h(N=>{const P=new Map(N.map(I=>[I.id,I]));return k.nodes.map(I=>{const D=P.get(I.id);return{...I,measured:!A&&D&&D.type===I.type?D.measured:void 0,position:!A&&D?D.position:I.position,selected:I.data.kind==="agent"&&!!I.data.path&&DGt(I.data.path,t)}})}),A&&j()},[k,e,j,t,b,h]),p.useEffect(()=>{j()},[S,j]),p.useEffect(()=>{y&&j()},[k,j,y]),p.useEffect(()=>{if(!o||!x.current)return;const R=new ResizeObserver(()=>j());return R.observe(x.current),j(),()=>R.disconnect()},[j,o]);const T=p.useMemo(()=>o?null:{onAdd:i,onInsert:r,onDelete:s},[i,s,r,o]);return a.jsx(RL.Provider,{value:c,children:a.jsx(NL.Provider,{value:T,children:a.jsx("section",{className:`abc-root is-${c}${o?" is-readonly":""}`,"aria-label":u(o?"buildCanvas.readOnlyLabel":"buildCanvas.label"),children:a.jsx("div",{ref:x,className:"abc-canvas",children:a.jsxs(Aqt,{nodes:f,edges:g,nodeTypes:UGt,edgeTypes:QGt,onNodesChange:m,onEdgesChange:v,onNodeClick:(R,A)=>{!o&&A.data.kind==="agent"&&A.data.path&&n(A.data.path)},nodesDraggable:!o,nodesConnectable:!1,nodesFocusable:!o,elementsSelectable:!o,edgesFocusable:!1,edgesReconnectable:!1,panOnDrag:!o||l,zoomOnDoubleClick:l,zoomOnPinch:!o||l,zoomOnScroll:!o||l,fitView:!0,fitViewOptions:E,onInit:()=>j(),minZoom:o?.05:.35,maxZoom:1.6,proOptions:{hideAttribution:!0},ariaLabelConfig:{"controls.ariaLabel":u("buildCanvas.controls.ariaLabel"),"controls.zoomIn.ariaLabel":u("buildCanvas.controls.zoomIn"),"controls.zoomOut.ariaLabel":u("buildCanvas.controls.zoomOut"),"controls.fitView.ariaLabel":u("buildCanvas.controls.fitView")},children:[a.jsx($qt,{gap:20,size:1.2,color:"hsl(34 20% 82%)"}),(!o||l)&&a.jsx(Hqt,{showInteractive:!1}),IGt]})})})})})}function IP(e){return a.jsx(OBe,{children:a.jsx(zGt,{...e})})}function VGt(e){return[{id:"case-1",itemKey:"case-1",kind:"good",input:e("agentWorkspace.defaultCases.weeklyFeedback.input"),output:e("agentWorkspace.defaultCases.weeklyFeedback.output"),referenceOutput:e("agentWorkspace.defaultCases.weeklyFeedback.output"),comment:"",agentName:e("agentWorkspace.defaultCases.agentName"),sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T09:12:00+08:00",evaluationSetId:"",evaluationSetName:e("agentWorkspace.defaultCases.goodSetName"),workspaceId:"",tag:e("agentWorkspace.defaultCases.weeklyFeedback.tag"),source:"auto",score:.92,reason:e("agentWorkspace.defaultCases.weeklyFeedback.reason")},{id:"case-2",itemKey:"case-2",kind:"good",input:e("agentWorkspace.defaultCases.research.input"),output:e("agentWorkspace.defaultCases.research.output"),referenceOutput:e("agentWorkspace.defaultCases.research.output"),comment:"",agentName:e("agentWorkspace.defaultCases.agentName"),sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T08:47:00+08:00",evaluationSetId:"",evaluationSetName:e("agentWorkspace.defaultCases.goodSetName"),workspaceId:"",tag:e("agentWorkspace.defaultCases.research.tag"),source:"user"},{id:"case-3",itemKey:"case-3",kind:"bad",input:e("agentWorkspace.defaultCases.uncertainConclusion.input"),output:e("agentWorkspace.defaultCases.uncertainConclusion.output"),referenceOutput:"",comment:"",agentName:e("agentWorkspace.defaultCases.agentName"),sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T07:35:00+08:00",evaluationSetId:"",evaluationSetName:e("agentWorkspace.defaultCases.badSetName"),workspaceId:"",tag:e("agentWorkspace.defaultCases.uncertainConclusion.tag"),source:"auto",score:.28,reason:e("agentWorkspace.defaultCases.uncertainConclusion.reason")},{id:"case-4",itemKey:"case-4",kind:"bad",input:e("agentWorkspace.defaultCases.repeatedTool.input"),output:e("agentWorkspace.defaultCases.repeatedTool.output"),referenceOutput:"",comment:"",agentName:e("agentWorkspace.defaultCases.agentName"),sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T06:58:00+08:00",evaluationSetId:"",evaluationSetName:e("agentWorkspace.defaultCases.badSetName"),workspaceId:"",tag:e("agentWorkspace.defaultCases.repeatedTool.tag"),source:"user"}]}const HGt=[{id:"eval-regression",name:"核心能力回归",agentIds:[],caseSet:"核心回归集",evaluator:"综合质量评估器",metrics:["回答质量","工具调用"],concurrency:"4",history:[{id:"run-1",createdAt:"今天 10:32",score:88,status:"completed"},{id:"run-2",createdAt:"昨天 16:08",score:84,status:"completed"}]},{id:"eval-safety",name:"安全与幻觉检查",agentIds:[],caseSet:"安全边界集",evaluator:"事实一致性评估器",metrics:["事实准确性","拒答合理性"],concurrency:"2",history:[{id:"run-3",createdAt:"7 月 25 日 14:20",score:91,status:"completed"}]}],qGt={核心能力回归:"agentWorkspace.evaluationDefaults.coreRegression",安全与幻觉检查:"agentWorkspace.evaluationDefaults.safetyCheck",核心回归集:"agentWorkspace.evaluationDefaults.coreSet",安全边界集:"agentWorkspace.evaluationDefaults.safetySet",工具调用集:"agentWorkspace.evaluationDefaults.toolSet",综合质量评估器:"agentWorkspace.evaluationDefaults.qualityEvaluator",事实一致性评估器:"agentWorkspace.evaluationDefaults.factualEvaluator",工具调用评估器:"agentWorkspace.evaluationDefaults.toolEvaluator",回答质量:"agentWorkspace.evaluationDefaults.responseQuality",事实准确性:"agentWorkspace.evaluationDefaults.factualAccuracy",工具调用:"agentWorkspace.evaluationDefaults.toolUse",响应效率:"agentWorkspace.evaluationDefaults.responseEfficiency","今天 10:32":"agentWorkspace.evaluationDefaults.todayTime","昨天 16:08":"agentWorkspace.evaluationDefaults.yesterdayTime","7 月 25 日 14:20":"agentWorkspace.evaluationDefaults.julyTime",刚刚:"agentWorkspace.evaluationDefaults.justNow"};function ES(e,t){const n=qGt[e];return n?t(n):e}const WGt=["basic","profileConfig","sessionConfig","usage","diagnostics","evaluations","optimizations","integrations","versions"],KGt=20;function JBe(e,t,n){const i=Date.parse(e);return Number.isNaN(i)?n("agentWorkspace.notProvided"):new Intl.DateTimeFormat(t,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).format(i)}const Pk=[{id:"api-server",label:"API Server"},{id:"a2a",label:"A2A"}];function e9e(e){if(!e||typeof e!="object")return"";const t=e.id;return typeof t=="string"?t:""}function hx(e){var t;return e9e((t=e==null?void 0:e.effectiveRefs)==null?void 0:t.model)}function Poe(e,t){var r;const n=(r=e==null?void 0:e.overrides)==null?void 0:r[t];if(!n||typeof n!="object")return"";const i=n.mode;return i==="replace"||i==="clear"||i==="inherit"?i:""}function t9e(e){var n;const t=(n=e==null?void 0:e.effectiveRefs)==null?void 0:n.mcpServers;return Array.isArray(t)?t.map(e9e).filter(Boolean):[]}function GGt(e,t){switch(e){case"active_operation":return t("agentWorkspace.mpaDeleteBlockerActiveOperation");case"active_sessions":return t("agentWorkspace.mpaDeleteBlockerActiveSessions");case"binding_ambiguous":return t("agentWorkspace.mpaDeleteBlockerBindingAmbiguous");case"runtime_missing":return t("agentWorkspace.mpaDeleteBlockerRuntimeMissing");case"orphan_runtime":return t("agentWorkspace.mpaDeleteBlockerOrphanRuntime");default:return e}}function XGt(e,t){switch(e){case"runtime_legacy_auth_unsupported":return t("agentWorkspace.mpaRuntimeLegacyAuthUnsupported");case"profile_not_found":return t("agentWorkspace.mpaRuntimeOrphan");case"binding_ambiguous":return t("agentWorkspace.mpaRuntimeBindingAmbiguous");case"runtime_missing":return t("agentWorkspace.mpaRuntimeMissing");default:return e??""}}function YGt({preview:e,t}){const n=e.blockers.map(i=>GGt(i,t));return a.jsxs("div",{className:"aw-mpa-delete-preview",children:[a.jsx("p",{children:t("agentWorkspace.mpaDeletePreviewSummary")}),a.jsxs("dl",{className:"aw-mpa-delete-preview__stats",children:[a.jsxs("div",{children:[a.jsx("dt",{children:t("agentWorkspace.mpaDeletePreviewSessions")}),a.jsx("dd",{children:e.sessionCounts.total})]}),a.jsxs("div",{children:[a.jsx("dt",{children:t("agentWorkspace.mpaDeletePreviewActiveSessions")}),a.jsx("dd",{children:e.sessionCounts.active})]}),a.jsxs("div",{children:[a.jsx("dt",{children:t("agentWorkspace.mpaDeletePreviewIdleSessions")}),a.jsx("dd",{children:e.sessionCounts.idle})]})]}),n.length>0?a.jsxs("div",{className:"aw-mpa-delete-preview__blockers",role:"status",children:[a.jsx("strong",{children:t("agentWorkspace.mpaDeleteBlocked")}),a.jsx("ul",{children:n.map(i=>a.jsx("li",{children:i},i))})]}):a.jsx("ol",{className:"aw-mpa-delete-preview__plan",children:e.cleanupPlan.map(i=>a.jsx("li",{children:t(`agentWorkspace.mpaDeleteStage.${i.stage}`,{count:i.count})},i.stage))})]})}function c6(e,t){return e instanceof nw&&e.status===412?t:e instanceof Error?e.message:String(e)}function ZGt(e){return t9e(e).length}function Doe(e,t){const n=t9e(e);return n.length?n.join(", "):t("agentWorkspace.none")}function Moe(e,t){var n;return!!((n=e==null?void 0:e.overrides)!=null&&n[t])}function JGt(e,t,n){return`mpa-session-profile-upgrade:${e}:${t}:${n}`}function u6(e,t){return e?`${e.replace(/\/+$/,"")}${t}`:""}function eXt(e,t){const n=e.trim();if(!n||!t)return n;try{const i=new URL(n),r=i.hostname.replace(/^\[|\]$/g,"").toLowerCase();if(!["localhost","127.0.0.1","::1"].includes(r))return n;const s=new URL(t);return i.protocol=s.protocol,i.hostname=s.hostname,i.port=s.port,i.toString()}catch{return n}}function Loe(e,t){return e==="key_auth"?"API Key":e==="custom_jwt"?"OAuth / JWT":t(e==="none"?"agentWorkspace.noAuthentication":"agentWorkspace.notAvailable")}function $oe(e,t){return t(e==="published"?"agentWorkspace.githubStatus.published":e==="publishing"?"agentWorkspace.githubStatus.publishing":e==="failed"?"agentWorkspace.githubStatus.failed":e==="pending"?"agentWorkspace.githubStatus.pending":"agentWorkspace.githubStatus.unknown")}function tXt(e,t){return e.changeType==="rollback"?t("agentWorkspace.rollbackEvent"):e.version}function q7(e){return JSON.stringify(e)}function n9e(e){return e==="key_auth"?`API_KEY = "" +`)),d=u.reduce((f,h)=>f.concat(...h),[]);return[u,d]}return[[],[]]},[e]);return p.useEffect(()=>{const c=(t==null?void 0:t.target)??Zae,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=m=>{var v,y;if(r.current=m.ctrlKey||m.metaKey||m.shiftKey||m.altKey,(!r.current||r.current&&!u)&&T8e(m))return!1;const b=eoe(m.code,l);if(s.current.add(m[b]),Jae(o,s.current,!1)){const w=((y=(v=m.composedPath)==null?void 0:v.call(m))==null?void 0:y[0])||m.target,x=(w==null?void 0:w.nodeName)==="BUTTON"||(w==null?void 0:w.nodeName)==="A";t.preventDefault!==!1&&(r.current||!x)&&m.preventDefault(),i(!0)}},f=m=>{const g=eoe(m.code,l);Jae(o,s.current,!0)?(i(!1),s.current.clear()):s.current.delete(m[g]),m.key==="Meta"&&s.current.clear(),r.current=!1},h=()=>{s.current.clear(),i(!1)};return c==null||c.addEventListener("keydown",d),c==null||c.addEventListener("keyup",f),window.addEventListener("blur",h),window.addEventListener("contextmenu",h),()=>{c==null||c.removeEventListener("keydown",d),c==null||c.removeEventListener("keyup",f),window.removeEventListener("blur",h),window.removeEventListener("contextmenu",h)}}},[e,i]),n}function Jae(e,t,n){return e.filter(i=>n||i.length===t.size).some(i=>i.every(r=>t.has(r)))}function eoe(e,t){return t.includes(e)?"code":"key"}const sHt=()=>{const e=Vs();return p.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:i}=e.getState();return i?i.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[i,r,s],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??i,y:t.y??r,zoom:t.zoom??s},n),!0):!1},getViewport:()=>{const[t,n,i]=e.getState().transform;return{x:t,y:n,zoom:i}},setCenter:async(t,n,i)=>e.getState().setCenter(t,n,i),fitBounds:async(t,n)=>{const{width:i,height:r,minZoom:s,maxZoom:o,panZoom:l}=e.getState(),c=tK(t,i,r,s,o,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(c,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:i,snapGrid:r,snapToGrid:s,domNode:o}=e.getState();if(!o)return t;const{x:l,y:c}=o.getBoundingClientRect(),u={x:t.x-l,y:t.y-c},d=n.snapGrid??r,f=n.snapToGrid??s;return wO(u,i,f,d)},flowToScreenPosition:t=>{const{transform:n,domNode:i}=e.getState();if(!i)return t;const{x:r,y:s}=i.getBoundingClientRect(),o=C1(t,n);return{x:o.x+r,y:o.y+s}}}),[])};function X8e(e,t){const n=[],i=new Map,r=[];for(const s of e)if(s.type==="add"){r.push(s);continue}else if(s.type==="remove"||s.type==="replace")i.set(s.id,[s]);else{const o=i.get(s.id);o?o.push(s):i.set(s.id,[s])}for(const s of t){const o=i.get(s.id);if(!o){n.push(s);continue}if(o[0].type==="remove")continue;if(o[0].type==="replace"){n.push({...o[0].item});continue}const l={...s};for(const c of o)aHt(c,l);n.push(l)}return r.length&&r.forEach(s=>{s.index!==void 0?n.splice(s.index,0,{...s.item}):n.push({...s.item})}),n}function aHt(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function Y8e(e,t){return X8e(e,t)}function Z8e(e,t){return X8e(e,t)}function vy(e,t){return{id:e,type:"select",selected:t}}function Vx(e,t=new Set,n=!1){const i=[];for(const[r,s]of e){const o=t.has(r);!(s.selected===void 0&&!o)&&s.selected!==o&&(n&&(s.selected=o),i.push(vy(s.id,o)))}return i}function toe({items:e=[],lookup:t}){var r;const n=[],i=new Map(e.map(s=>[s.id,s]));for(const[s,o]of e.entries()){const l=t.get(o.id),c=((r=l==null?void 0:l.internals)==null?void 0:r.userNode)??l;c!==void 0&&c!==o&&n.push({id:o.id,item:o,type:"replace"}),c===void 0&&n.push({item:o,type:"add",index:s})}for(const[s]of t)i.get(s)===void 0&&n.push({id:s,type:"remove"});return n}function noe(e){return{id:e.id,type:"remove"}}const oHt=E8e();function lHt(e,t,n={}){return Jzt(e,t,{...n,onError:n.onError??oHt})}const ioe=e=>$zt(e),cHt=e=>w8e(e);function J8e(e){return p.forwardRef(e)}const uHt=typeof window<"u"?p.useLayoutEffect:p.useEffect;function roe(e){const[t,n]=p.useState(BigInt(0)),[i]=p.useState(()=>dHt(()=>n(r=>r+BigInt(1))));return uHt(()=>{const r=i.get();r.length&&(e(r),i.reset())},[t]),i}function dHt(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const eBe=p.createContext(null);function fHt({children:e}){const t=Vs(),n=p.useCallback(l=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:d,onNodesChange:f,nodeLookup:h,fitViewQueued:m,onNodesChangeMiddlewareMap:g}=t.getState();let b=c;for(const y of l)b=typeof y=="function"?y(b):y;let v=toe({items:b,lookup:h});for(const y of g.values())v=y(v);d&&u(b),v.length>0?f==null||f(v):m&&window.requestAnimationFrame(()=>{const{fitViewQueued:y,nodes:w,setNodes:x}=t.getState();y&&x(w)})},[]),i=roe(n),r=p.useCallback(l=>{const{edges:c=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:f,edgeLookup:h}=t.getState();let m=c;for(const g of l)m=typeof g=="function"?g(m):g;d?u(m):f&&f(toe({items:m,lookup:h}))},[]),s=roe(r),o=p.useMemo(()=>({nodeQueue:i,edgeQueue:s}),[]);return a.jsx(eBe.Provider,{value:o,children:e})}function hHt(){const e=p.useContext(eBe);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const pHt=e=>!!e.panZoom;function AL(){const e=sHt(),t=Vs(),n=hHt(),i=ir(pHt),r=p.useMemo(()=>{const s=f=>t.getState().nodeLookup.get(f),o=f=>{n.nodeQueue.push(f)},l=f=>{n.edgeQueue.push(f)},c=f=>{var y,w;const{nodeLookup:h,nodeOrigin:m}=t.getState(),g=ioe(f)?f:h.get(f.id),b=g.parentId?C8e(g.position,g.measured,g.parentId,h,m):g.position,v={...g,position:b,width:((y=g.measured)==null?void 0:y.width)??g.width,height:((w=g.measured)==null?void 0:w.height)??g.height};return E1(v)},u=(f,h,m={replace:!1})=>{o(g=>g.map(b=>{if(b.id===f){const v=typeof h=="function"?h(b):h;return m.replace&&ioe(v)?v:{...b,...v}}return b}))},d=(f,h,m={replace:!1})=>{l(g=>g.map(b=>{if(b.id===f){const v=typeof h=="function"?h(b):h;return m.replace&&cHt(v)?v:{...b,...v}}return b}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var h;return(h=s(f))==null?void 0:h.internals.userNode},getInternalNode:s,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(h=>({...h}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:o,setEdges:l,addNodes:f=>{const h=Array.isArray(f)?f:[f];n.nodeQueue.push(m=>[...m,...h])},addEdges:f=>{const h=Array.isArray(f)?f:[f];n.edgeQueue.push(m=>[...m,...h])},toObject:()=>{const{nodes:f=[],edges:h=[],transform:m}=t.getState(),[g,b,v]=m;return{nodes:f.map(y=>({...y})),edges:h.map(y=>({...y})),viewport:{x:g,y:b,zoom:v}}},deleteElements:async({nodes:f=[],edges:h=[]})=>{const{nodes:m,edges:g,onNodesDelete:b,onEdgesDelete:v,triggerNodeChanges:y,triggerEdgeChanges:w,onDelete:x,onBeforeDelete:O}=t.getState(),{nodes:k,edges:S}=await zzt({nodesToRemove:f,edgesToRemove:h,nodes:m,edges:g,onBeforeDelete:O}),C=S.length>0,E=k.length>0;if(C){const j=S.map(noe);v==null||v(S),w(j)}if(E){const j=k.map(noe);b==null||b(k),y(j)}return(E||C)&&(x==null||x({nodes:k,edges:S})),{deletedNodes:k,deletedEdges:S}},getIntersectingNodes:(f,h=!0,m)=>{const g=Iae(f),b=g?f:c(f),v=m!==void 0;return b?(m||t.getState().nodes).filter(y=>{const w=t.getState().nodeLookup.get(y.id);if(w&&!g&&(y.id===f.id||!w.internals.positionAbsolute))return!1;const x=E1(v?y:w),O=uA(x,b);return h&&O>0||O>=x.width*x.height||O>=b.width*b.height}):[]},isNodeIntersecting:(f,h,m=!0)=>{const b=Iae(f)?f:c(f);if(!b)return!1;const v=uA(b,h);return m&&v>0||v>=h.width*h.height||v>=b.width*b.height},updateNode:u,updateNodeData:(f,h,m={replace:!1})=>{u(f,g=>{const b=typeof h=="function"?h(g):h;return m.replace?{...g,data:b}:{...g,data:{...g.data,...b}}},m)},updateEdge:d,updateEdgeData:(f,h,m={replace:!1})=>{d(f,g=>{const b=typeof h=="function"?h(g):h;return m.replace?{...g,data:b}:{...g,data:{...g.data,...b}}},m)},getNodesBounds:f=>{const{nodeLookup:h,nodeOrigin:m}=t.getState();return Fzt(f,{nodeLookup:h,nodeOrigin:m})},getHandleConnections:({type:f,id:h,nodeId:m})=>{var g;return Array.from(((g=t.getState().connectionLookup.get(`${m}-${f}${h?`-${h}`:""}`))==null?void 0:g.values())??[])},getNodeConnections:({type:f,handleId:h,nodeId:m})=>{var g;return Array.from(((g=t.getState().connectionLookup.get(`${m}${f?h?`-${f}-${h}`:`-${f}`:""}`))==null?void 0:g.values())??[])},fitView:async f=>{const h=t.getState().fitViewResolver??qzt();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:h}),n.nodeQueue.push(m=>[...m]),h.promise}}},[]);return p.useMemo(()=>({...r,...e,viewportInitialized:i}),[i])}const soe=e=>e.selected,mHt=typeof window<"u"?window:void 0;function gHt({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Vs(),{deleteElements:i}=AL(),r=fA(e,{actInsideInputWithModifier:!1}),s=fA(t,{target:mHt});p.useEffect(()=>{if(r){const{edges:o,nodes:l}=n.getState();i({nodes:l.filter(soe),edges:o.filter(soe)}),n.setState({nodesSelectionActive:!1})}},[r]),p.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])}function bHt(e){const t=Vs();p.useEffect(()=>{const n=()=>{var r,s,o,l;if(!e.current||!(((s=(r=e.current).checkVisibility)==null?void 0:s.call(r))??!0))return!1;const i=iK(e.current);(i.height===0||i.width===0)&&((l=(o=t.getState()).onError)==null||l.call(o,"004",Sf.error004())),t.setState({width:i.width||500,height:i.height||500})};if(e.current){n(),window.addEventListener("resize",n);const i=new ResizeObserver(()=>n());return i.observe(e.current),()=>{window.removeEventListener("resize",n),i&&e.current&&i.unobserve(e.current)}}},[])}const TL={position:"absolute",width:"100%",height:"100%",top:0,left:0},yHt=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function vHt({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:i=!1,panOnScrollSpeed:r=.5,panOnScrollMode:s=n0.Free,zoomOnDoubleClick:o=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:m=!0,children:g,noWheelClassName:b,noPanClassName:v,onViewportChange:y,isControlledViewport:w,paneClickDistance:x,selectionOnDrag:O}){const k=Vs(),S=p.useRef(null),{userSelectionActive:C,lib:E,connectionInProgress:j}=ir(yHt,zs),T=fA(h),R=p.useRef();bHt(S);const A=p.useCallback(N=>{y==null||y({x:N[0],y:N[1],zoom:N[2]}),w||k.setState({transform:N})},[y,w]);return p.useEffect(()=>{if(S.current){R.current=_Vt({domNode:S.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:c,onDraggingChange:P=>k.setState(_=>_.paneDragging===P?_:{paneDragging:P}),onPanZoomStart:(P,_)=>{const{onViewportChangeStart:L,onMoveStart:F}=k.getState();F==null||F(P,_),L==null||L(_)},onPanZoom:(P,_)=>{const{onViewportChange:L,onMove:F}=k.getState();F==null||F(P,_),L==null||L(_)},onPanZoomEnd:(P,_)=>{const{onViewportChangeEnd:L,onMoveEnd:F}=k.getState();F==null||F(P,_),L==null||L(_)}});const{x:N,y:D,zoom:I}=R.current.getViewport();return k.setState({panZoom:R.current,transform:[N,D,I],domNode:S.current.closest(".react-flow")}),()=>{var P;(P=R.current)==null||P.destroy()}}},[]),p.useEffect(()=>{var N;(N=R.current)==null||N.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:i,panOnScrollSpeed:r,panOnScrollMode:s,zoomOnDoubleClick:o,panOnDrag:l,zoomActivationKeyPressed:T,preventScrolling:m,noPanClassName:v,userSelectionActive:C,noWheelClassName:b,lib:E,onTransformChange:A,connectionInProgress:j,selectionOnDrag:O,paneClickDistance:x})},[e,t,n,i,r,s,o,l,T,m,v,C,b,E,A,j,O,x]),a.jsx("div",{className:"react-flow__renderer",ref:S,style:TL,children:g})}const xHt=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function wHt(){const{userSelectionActive:e,userSelectionRect:t}=ir(xHt,zs);return e&&t?a.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const t6=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},OHt=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function kHt({isSelecting:e,selectionKeyPressed:t,selectionMode:n=lA.Full,panOnDrag:i,autoPanOnSelection:r,paneClickDistance:s,selectionOnDrag:o,onSelectionStart:l,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:f,onPaneMouseEnter:h,onPaneMouseMove:m,onPaneMouseLeave:g,children:b}){const v=p.useRef(0),y=Vs(),{userSelectionActive:w,elementsSelectable:x,dragging:O,connectionInProgress:k,panBy:S,autoPanSpeed:C}=ir(OHt,zs),E=x&&(e||w),j=p.useRef(null),T=p.useRef(),R=p.useRef(new Set),A=p.useRef(new Set),N=p.useRef(!1),D=p.useRef({x:0,y:0}),I=p.useRef(!1),P=W=>{if(N.current||k){N.current=!1;return}u==null||u(W),y.getState().resetSelectedElements(),y.setState({nodesSelectionActive:!1})},_=W=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){W.preventDefault();return}d==null||d(W)},L=f?W=>f(W):void 0,F=W=>{N.current&&(W.stopPropagation(),N.current=!1)},M=W=>{var de,ge;const{domNode:X,transform:H}=y.getState();if(T.current=X==null?void 0:X.getBoundingClientRect(),!T.current)return;const ae=W.target===j.current;if(!ae&&!!W.target.closest(".nokey")||!e||!(o&&ae||t)||W.button!==0||!W.isPrimary)return;(ge=(de=W.target)==null?void 0:de.setPointerCapture)==null||ge.call(de,W.pointerId),N.current=!1;const{x:ie,y:J}=ff(W.nativeEvent,T.current),ye=wO({x:ie,y:J},H);y.setState({userSelectionRect:{width:0,height:0,startX:ye.x,startY:ye.y,x:ie,y:J}}),ae||(W.stopPropagation(),W.preventDefault())};function V(W,X){const{userSelectionRect:H}=y.getState();if(!H)return;const{transform:ae,nodeLookup:Y,edgeLookup:K,connectionLookup:ie,triggerNodeChanges:J,triggerEdgeChanges:ye,defaultEdgeOptions:de}=y.getState(),ge={x:H.startX,y:H.startY},{x:Ee,y:xe}=C1(ge,ae),Ne={startX:ge.x,startY:ge.y,x:Wse.id)),A.current=new Set;const Re=(de==null?void 0:de.selectable)??!0;for(const se of R.current){const ce=ie.get(se);if(ce)for(const{edgeId:ve}of ce.values()){const Se=K.get(ve);Se&&(Se.selectable??Re)&&A.current.add(ve)}}if(!Pae(We,R.current)){const se=Vx(Y,R.current,!0);J(se)}if(!Pae(Xe,A.current)){const se=Vx(K,A.current);ye(se)}y.setState({userSelectionRect:Ne,userSelectionActive:!0,nodesSelectionActive:!1})}function q(){if(!r||!T.current)return;const[W,X]=eK(D.current,T.current,C);S({x:W,y:X}).then(H=>{if(!N.current||!H){v.current=requestAnimationFrame(q);return}const{x:ae,y:Y}=D.current;V(ae,Y),v.current=requestAnimationFrame(q)})}const U=()=>{cancelAnimationFrame(v.current),v.current=0,I.current=!1};p.useEffect(()=>()=>U(),[]);const Z=W=>{const{userSelectionRect:X,transform:H,resetSelectedElements:ae}=y.getState();if(!T.current||!X)return;const{x:Y,y:K}=ff(W.nativeEvent,T.current);D.current={x:Y,y:K};const ie=C1({x:X.startX,y:X.startY},H);if(!N.current){const J=t?0:s;if(Math.hypot(Y-ie.x,K-ie.y)<=J)return;ae(),l==null||l(W)}N.current=!0,I.current||(q(),I.current=!0),V(Y,K)},z=W=>{var X,H;W.button===0&&((H=(X=W.target)==null?void 0:X.releasePointerCapture)==null||H.call(X,W.pointerId),!w&&W.target===j.current&&y.getState().userSelectionRect&&(P==null||P(W)),y.setState({userSelectionActive:!1,userSelectionRect:null}),N.current&&(c==null||c(W),y.setState({nodesSelectionActive:R.current.size>0})),U())},ee=W=>{var X,H;(H=(X=W.target)==null?void 0:X.releasePointerCapture)==null||H.call(X,W.pointerId),U()},ne=i===!0||Array.isArray(i)&&i.includes(0);return a.jsxs("div",{className:eo(["react-flow__pane",{draggable:ne,dragging:O,selection:e}]),onClick:E?void 0:t6(P,j),onContextMenu:t6(_,j),onWheel:t6(L,j),onPointerEnter:E?void 0:h,onPointerMove:E?Z:m,onPointerUp:E?z:void 0,onPointerCancel:E?ee:void 0,onPointerDownCapture:E?M:void 0,onClickCapture:E?F:void 0,onPointerLeave:g,ref:j,style:TL,children:[b,a.jsx(wHt,{})]})}function B7({id:e,store:t,unselect:n=!1,nodeRef:i}){const{addSelectedNodes:r,unselectNodesAndEdges:s,multiSelectionActive:o,nodeLookup:l,onError:c}=t.getState(),u=l.get(e);if(!u){c==null||c("012",Sf.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&o)&&(s({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var d;return(d=i==null?void 0:i.current)==null?void 0:d.blur()})):r([e])}function tBe({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:i,nodeId:r,isSelectable:s,nodeClickDistance:o}){const l=Vs(),[c,u]=p.useState(!1),d=p.useRef();return p.useEffect(()=>{d.current=mVt({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{B7({id:f,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),p.useEffect(()=>{if(!(t||!e.current||!d.current))return d.current.update({noDragClassName:n,handleSelector:i,domNode:e.current,isSelectable:s,nodeId:r,nodeClickDistance:o}),()=>{var f;(f=d.current)==null||f.destroy()}},[n,i,t,s,e,r,o]),c}const SHt=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function nBe(){const e=Vs();return p.useCallback(n=>{const{nodeExtent:i,snapToGrid:r,snapGrid:s,nodesDraggable:o,onError:l,updateNodePositions:c,nodeLookup:u,nodeOrigin:d}=e.getState(),f=new Map,h=SHt(o),m=r?s[0]:5,g=r?s[1]:5,b=n.direction.x*m*n.factor,v=n.direction.y*g*n.factor;for(const[,y]of u){if(!h(y))continue;let w={x:y.internals.positionAbsolute.x+b,y:y.internals.positionAbsolute.y+v};r&&(w=HT(w,s));const{position:x,positionAbsolute:O}=O8e({nodeId:y.id,nextPosition:w,nodeLookup:u,nodeExtent:i,nodeOrigin:d,onError:l});y.position=x,y.internals.positionAbsolute=O,f.set(y.id,y)}c(f)},[])}const cK=p.createContext(null),EHt=cK.Provider;cK.Consumer;const iBe=()=>p.useContext(cK),CHt=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),AHt=(e,t,n)=>i=>{const{connectionClickStartHandle:r,connectionMode:s,connection:o}=i,{fromHandle:l,toHandle:c,isValid:u}=o,d=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:d,clickConnecting:(r==null?void 0:r.nodeId)===e&&(r==null?void 0:r.id)===t&&(r==null?void 0:r.type)===n,isPossibleEndHandle:s===k1.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!r,valid:d&&u}};function THt({type:e="source",position:t=vn.Top,isValidConnection:n,isConnectable:i=!0,isConnectableStart:r=!0,isConnectableEnd:s=!0,id:o,onConnect:l,children:c,className:u,onMouseDown:d,onTouchStart:f,...h},m){var I,P;const g=o||null,b=e==="target",v=Vs(),y=iBe(),{connectOnClick:w,noPanClassName:x,rfId:O}=ir(CHt,zs),{connectingFrom:k,connectingTo:S,clickConnecting:C,isPossibleEndHandle:E,connectionInProcess:j,clickConnectionInProcess:T,valid:R}=ir(AHt(y,g,e),zs);y||(P=(I=v.getState()).onError)==null||P.call(I,"010",Sf.error010());const A=_=>{const{defaultEdgeOptions:L,onConnect:F,hasDefaultEdges:M}=v.getState(),V={...L,..._};if(M){const{edges:q,setEdges:U,onError:Z}=v.getState();U(lHt(V,q,{onError:Z}))}F==null||F(V),l==null||l(V)},N=_=>{if(!y)return;const L=_8e(_.nativeEvent);if(r&&(L&&_.button===0||!L)){const F=v.getState();F7.onPointerDown(_.nativeEvent,{handleDomNode:_.currentTarget,autoPanOnConnect:F.autoPanOnConnect,connectionMode:F.connectionMode,connectionRadius:F.connectionRadius,domNode:F.domNode,nodeLookup:F.nodeLookup,lib:F.lib,isTarget:b,handleId:g,nodeId:y,flowId:F.rfId,panBy:F.panBy,cancelConnection:F.cancelConnection,onConnectStart:F.onConnectStart,onConnectEnd:(...M)=>{var V,q;return(q=(V=v.getState()).onConnectEnd)==null?void 0:q.call(V,...M)},updateConnection:F.updateConnection,onConnect:A,isValidConnection:n||((...M)=>{var V,q;return((q=(V=v.getState()).isValidConnection)==null?void 0:q.call(V,...M))??!0}),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:F.autoPanSpeed,dragThreshold:F.connectionDragThreshold})}L?d==null||d(_):f==null||f(_)},D=_=>{const{onClickConnectStart:L,onClickConnectEnd:F,connectionClickStartHandle:M,connectionMode:V,isValidConnection:q,lib:U,rfId:Z,nodeLookup:z,connection:ee}=v.getState();if(!y||!M&&!r)return;if(!M){L==null||L(_.nativeEvent,{nodeId:y,handleId:g,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:y,type:e,id:g}});return}const ne=A8e(_.target),W=n||q,{connection:X,isValid:H}=F7.isValid(_.nativeEvent,{handle:{nodeId:y,id:g,type:e},connectionMode:V,fromNodeId:M.nodeId,fromHandleId:M.id||null,fromType:M.type,isValidConnection:W,flowId:Z,doc:ne,lib:U,nodeLookup:z});H&&X&&A(X);const ae=structuredClone(ee);delete ae.inProgress,ae.toPosition=ae.toHandle?ae.toHandle.position:null,F==null||F(_,ae),v.setState({connectionClickStartHandle:null})};return a.jsx("div",{"data-handleid":g,"data-nodeid":y,"data-handlepos":t,"data-id":`${O}-${y}-${g}-${e}`,className:eo(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",x,u,{source:!b,target:b,connectable:i,connectablestart:r,connectableend:s,clickconnecting:C,connectingfrom:k,connectingto:S,valid:R,connectionindicator:i&&(!j||E)&&(j||T?s:r)}]),onMouseDown:N,onTouchStart:N,onClick:w?D:void 0,ref:m,...h,children:c})}const Fc=p.memo(J8e(THt));function _Ht({data:e,isConnectable:t,sourcePosition:n=vn.Bottom}){return a.jsxs(a.Fragment,{children:[e==null?void 0:e.label,a.jsx(Fc,{type:"source",position:n,isConnectable:t})]})}function jHt({data:e,isConnectable:t,targetPosition:n=vn.Top,sourcePosition:i=vn.Bottom}){return a.jsxs(a.Fragment,{children:[a.jsx(Fc,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,a.jsx(Fc,{type:"source",position:i,isConnectable:t})]})}function NHt(){return null}function RHt({data:e,isConnectable:t,targetPosition:n=vn.Top}){return a.jsxs(a.Fragment,{children:[a.jsx(Fc,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const _P={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},aoe={input:_Ht,default:jHt,output:RHt,group:NHt};function IHt(e){var t,n,i,r;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((i=e.style)==null?void 0:i.width),height:e.height??((r=e.style)==null?void 0:r.height)}}const PHt=e=>{const{width:t,height:n,x:i,y:r}=VT(e.nodeLookup,{filter:s=>!!s.selected});return{width:df(t)?t:null,height:df(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${i}px,${r}px)`}};function DHt({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const i=Vs(),{width:r,height:s,transformString:o,userSelectionActive:l}=ir(PHt,zs),c=nBe(),u=p.useRef(null);p.useEffect(()=>{var m;n||(m=u.current)==null||m.focus({preventScroll:!0})},[n]);const d=!l&&r!==null&&s!==null;if(tBe({nodeRef:u,disabled:!d}),!d)return null;const f=e?m=>{const g=i.getState().nodes.filter(b=>b.selected);e(m,g)}:void 0,h=m=>{Object.prototype.hasOwnProperty.call(_P,m.key)&&(m.preventDefault(),c({direction:_P[m.key],factor:m.shiftKey?4:1}))};return a.jsx("div",{className:eo(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:a.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:r,height:s}})})}const ooe=typeof window<"u"?window:void 0,MHt=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function rBe({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:o,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:d,selectionMode:f,onSelectionStart:h,onSelectionEnd:m,multiSelectionKeyCode:g,panActivationKeyCode:b,zoomActivationKeyCode:v,elementsSelectable:y,zoomOnScroll:w,zoomOnPinch:x,panOnScroll:O,panOnScrollSpeed:k,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:E,autoPanOnSelection:j,defaultViewport:T,translateExtent:R,minZoom:A,maxZoom:N,preventScrolling:D,onSelectionContextMenu:I,noWheelClassName:P,noPanClassName:_,disableKeyboardA11y:L,onViewportChange:F,isControlledViewport:M}){const{nodesSelectionActive:V,userSelectionActive:q}=ir(MHt,zs),U=fA(u,{target:ooe}),Z=fA(b,{target:ooe}),z=Z||E,ee=Z||O,ne=d&&z!==!0,W=U||q||ne;return gHt({deleteKeyCode:c,multiSelectionKeyCode:g}),a.jsx(vHt,{onPaneContextMenu:s,elementsSelectable:y,zoomOnScroll:w,zoomOnPinch:x,panOnScroll:ee,panOnScrollSpeed:k,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:!U&&z,defaultViewport:T,translateExtent:R,minZoom:A,maxZoom:N,zoomActivationKeyCode:v,preventScrolling:D,noWheelClassName:P,noPanClassName:_,onViewportChange:F,isControlledViewport:M,paneClickDistance:l,selectionOnDrag:ne,children:a.jsxs(kHt,{onSelectionStart:h,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:o,panOnDrag:z,autoPanOnSelection:j,isSelecting:!!W,selectionMode:f,selectionKeyPressed:U,paneClickDistance:l,selectionOnDrag:ne,children:[e,V&&a.jsx(DHt,{onSelectionContextMenu:I,noPanClassName:_,disableKeyboardA11y:L})]})})}rBe.displayName="FlowRenderer";const LHt=p.memo(rBe),$Ht=e=>t=>e?JW(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function FHt(e){return ir(p.useCallback($Ht(e),[e]),zs)}const BHt=e=>e.updateNodeInternals;function UHt(){const e=ir(BHt),[t]=p.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const i=new Map;n.forEach(r=>{const s=r.target.getAttribute("data-id");i.set(s,{id:s,nodeElement:r.target,force:!0})}),e(i)}));return p.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function QHt({node:e,nodeType:t,hasDimensions:n,resizeObserver:i}){const r=Vs(),s=p.useRef(null),o=p.useRef(null),l=p.useRef(e.sourcePosition),c=p.useRef(e.targetPosition),u=p.useRef(t),d=n&&!!e.internals.handleBounds;return p.useEffect(()=>{s.current&&!e.hidden&&(!d||o.current!==s.current)&&(o.current&&(i==null||i.unobserve(o.current)),i==null||i.observe(s.current),o.current=s.current)},[d,e.hidden]),p.useEffect(()=>()=>{o.current&&(i==null||i.unobserve(o.current),o.current=null)},[]),p.useEffect(()=>{if(s.current){const f=u.current!==t,h=l.current!==e.sourcePosition,m=c.current!==e.targetPosition;(f||h||m)&&(u.current=t,l.current=e.sourcePosition,c.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:s.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),s}function zHt({id:e,onClick:t,onMouseEnter:n,onMouseMove:i,onMouseLeave:r,onContextMenu:s,onDoubleClick:o,nodesDraggable:l,elementsSelectable:c,nodesConnectable:u,nodesFocusable:d,resizeObserver:f,noDragClassName:h,noPanClassName:m,disableKeyboardA11y:g,rfId:b,nodeTypes:v,nodeClickDistance:y,onError:w}){const{node:x,internals:O,isParent:k}=ir(W=>{const X=W.nodeLookup.get(e),H=W.parentLookup.has(e);return{node:X,internals:X.internals,isParent:H}},zs);let S=x.type||"default",C=(v==null?void 0:v[S])||aoe[S];C===void 0&&(w==null||w("003",Sf.error003(S)),S="default",C=(v==null?void 0:v.default)||aoe.default);const E=!!(x.draggable||l&&typeof x.draggable>"u"),j=!!(x.selectable||c&&typeof x.selectable>"u"),T=!!(x.connectable||u&&typeof x.connectable>"u"),R=!!(x.focusable||d&&typeof x.focusable>"u"),A=Vs(),N=nK(x),D=QHt({node:x,nodeType:S,hasDimensions:N,resizeObserver:f}),I=tBe({nodeRef:D,disabled:x.hidden||!E,noDragClassName:h,handleSelector:x.dragHandle,nodeId:e,isSelectable:j,nodeClickDistance:y}),P=nBe();if(x.hidden)return null;const _=wm(x),L=IHt(x),F=j||E||t||n||i||r,M=n?W=>n(W,{...O.userNode}):void 0,V=i?W=>i(W,{...O.userNode}):void 0,q=r?W=>r(W,{...O.userNode}):void 0,U=s?W=>s(W,{...O.userNode}):void 0,Z=o?W=>o(W,{...O.userNode}):void 0,z=W=>{const{selectNodesOnDrag:X,nodeDragThreshold:H}=A.getState();j&&(!X||!E||H>0)&&B7({id:e,store:A,nodeRef:D}),t&&t(W,{...O.userNode})},ee=W=>{if(!(T8e(W.nativeEvent)||g)){if(b8e.includes(W.key)&&j){const X=W.key==="Escape";B7({id:e,store:A,unselect:X,nodeRef:D})}else if(E&&x.selected&&Object.prototype.hasOwnProperty.call(_P,W.key)){W.preventDefault();const{ariaLabelConfig:X}=A.getState();A.setState({ariaLiveMessage:X["node.a11yDescription.ariaLiveMessage"]({direction:W.key.replace("Arrow","").toLowerCase(),x:~~O.positionAbsolute.x,y:~~O.positionAbsolute.y})}),P({direction:_P[W.key],factor:W.shiftKey?4:1})}}},ne=()=>{var ie;if(g||!((ie=D.current)!=null&&ie.matches(":focus-visible")))return;const{transform:W,width:X,height:H,autoPanOnNodeFocus:ae,setCenter:Y}=A.getState();if(!ae)return;JW(new Map([[e,x]]),{x:0,y:0,width:X,height:H},W,!0).length>0||Y(x.position.x+_.width/2,x.position.y+_.height/2,{zoom:W[2]})};return a.jsx("div",{className:eo(["react-flow__node",`react-flow__node-${S}`,{[m]:E},x.className,{selected:x.selected,selectable:j,parent:k,draggable:E,dragging:I}]),ref:D,style:{zIndex:O.z,transform:`translate(${O.positionAbsolute.x}px,${O.positionAbsolute.y}px)`,pointerEvents:F?"all":"none",visibility:N?"visible":"hidden",...x.style,...L},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:M,onMouseMove:V,onMouseLeave:q,onContextMenu:U,onClick:z,onDoubleClick:Z,onKeyDown:R?ee:void 0,tabIndex:R?0:void 0,onFocus:R?ne:void 0,role:x.ariaRole??(R?"group":void 0),"aria-roledescription":"node","aria-describedby":g?void 0:`${W8e}-${b}`,"aria-label":x.ariaLabel,...x.domAttributes,children:a.jsx(EHt,{value:e,children:a.jsx(C,{id:e,data:x.data,type:S,positionAbsoluteX:O.positionAbsolute.x,positionAbsoluteY:O.positionAbsolute.y,selected:x.selected??!1,selectable:j,draggable:E,deletable:x.deletable??!0,isConnectable:T,sourcePosition:x.sourcePosition,targetPosition:x.targetPosition,dragging:I,dragHandle:x.dragHandle,zIndex:O.z,parentId:x.parentId,..._})})})}var VHt=p.memo(zHt);const HHt=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function sBe(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:r,onError:s}=ir(HHt,zs),o=FHt(e.onlyRenderVisibleElements),l=UHt();return a.jsx("div",{className:"react-flow__nodes",style:TL,children:o.map(c=>a.jsx(VHt,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:s},c))})}sBe.displayName="NodeRenderer";const qHt=p.memo(sBe);function WHt(e){return ir(p.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const i=[];if(n.width&&n.height)for(const r of n.edges){const s=n.nodeLookup.get(r.source),o=n.nodeLookup.get(r.target);s&&o&&Xzt({sourceNode:s,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&i.push(r.id)}return i},[e]),zs)}const KHt=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return a.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},GHt=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return a.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},loe={[cA.Arrow]:KHt,[cA.ArrowClosed]:GHt};function XHt(e){const t=Vs();return p.useMemo(()=>{var r,s;return Object.prototype.hasOwnProperty.call(loe,e)?loe[e]:((s=(r=t.getState()).onError)==null||s.call(r,"009",Sf.error009(e)),null)},[e])}const YHt=({id:e,type:t,color:n,width:i=12.5,height:r=12.5,markerUnits:s="strokeWidth",strokeWidth:o,orient:l="auto-start-reverse"})=>{const c=XHt(t);return c?a.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${i}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:l,refX:"0",refY:"0",children:a.jsx(c,{color:n,strokeWidth:o})}):null},aBe=({defaultColor:e,rfId:t})=>{const n=ir(s=>s.edges),i=ir(s=>s.defaultEdgeOptions),r=p.useMemo(()=>rVt(n,{id:t,defaultColor:e,defaultMarkerStart:i==null?void 0:i.markerStart,defaultMarkerEnd:i==null?void 0:i.markerEnd}),[n,i,t,e]);return r.length?a.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:a.jsx("defs",{children:r.map(s=>a.jsx(YHt,{id:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient},s.id))})}):null};aBe.displayName="MarkerDefinitions";var ZHt=p.memo(aBe);function oBe({x:e,y:t,label:n,labelStyle:i,labelShowBg:r=!0,labelBgStyle:s,labelBgPadding:o=[2,4],labelBgBorderRadius:l=2,children:c,className:u,...d}){const[f,h]=p.useState({x:1,y:0,width:0,height:0}),m=eo(["react-flow__edge-textwrapper",u]),g=p.useRef(null);return p.useEffect(()=>{if(g.current){const b=g.current.getBBox();h({x:b.x,y:b.y,width:b.width,height:b.height})}},[n]),n?a.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:m,visibility:f.width?"visible":"hidden",...d,children:[r&&a.jsx("rect",{width:f.width+2*o[0],x:-o[0],y:-o[1],height:f.height+2*o[1],className:"react-flow__edge-textbg",style:s,rx:l,ry:l}),a.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:g,style:i,children:n}),c]}):null}oBe.displayName="EdgeText";const JHt=p.memo(oBe);function qT({path:e,labelX:t,labelY:n,label:i,labelStyle:r,labelShowBg:s,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:u=20,...d}){return a.jsxs(a.Fragment,{children:[a.jsx("path",{...d,d:e,fill:"none",className:eo(["react-flow__edge-path",d.className])}),u?a.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,i&&df(t)&&df(n)?a.jsx(JHt,{x:t,y:n,label:i,labelStyle:r,labelShowBg:s,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function coe({pos:e,x1:t,y1:n,x2:i,y2:r}){return e===vn.Left||e===vn.Right?[.5*(t+i),n]:[t,.5*(n+r)]}function lBe({sourceX:e,sourceY:t,sourcePosition:n=vn.Bottom,targetX:i,targetY:r,targetPosition:s=vn.Top}){const[o,l]=coe({pos:n,x1:e,y1:t,x2:i,y2:r}),[c,u]=coe({pos:s,x1:i,y1:r,x2:e,y2:t}),[d,f,h,m]=j8e({sourceX:e,sourceY:t,targetX:i,targetY:r,sourceControlX:o,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${o},${l} ${c},${u} ${i},${r}`,d,f,h,m]}function cBe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:o,targetPosition:l,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,interactionWidth:y})=>{const[w,x,O]=lBe({sourceX:n,sourceY:i,sourcePosition:o,targetX:r,targetY:s,targetPosition:l}),k=e.isInternal?void 0:t;return a.jsx(qT,{id:k,path:w,labelX:x,labelY:O,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,interactionWidth:y})})}const eqt=cBe({isInternal:!1}),uBe=cBe({isInternal:!0});eqt.displayName="SimpleBezierEdge";uBe.displayName="SimpleBezierEdgeInternal";function dBe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,sourcePosition:m=vn.Bottom,targetPosition:g=vn.Top,markerEnd:b,markerStart:v,pathOptions:y,interactionWidth:w})=>{const[x,O,k]=TP({sourceX:n,sourceY:i,sourcePosition:m,targetX:r,targetY:s,targetPosition:g,borderRadius:y==null?void 0:y.borderRadius,offset:y==null?void 0:y.offset,stepPosition:y==null?void 0:y.stepPosition}),S=e.isInternal?void 0:t;return a.jsx(qT,{id:S,path:x,labelX:O,labelY:k,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:b,markerStart:v,interactionWidth:w})})}const fBe=dBe({isInternal:!1}),hBe=dBe({isInternal:!0});fBe.displayName="SmoothStepEdge";hBe.displayName="SmoothStepEdgeInternal";function pBe(e){return p.memo(({id:t,...n})=>{var r;const i=e.isInternal?void 0:t;return a.jsx(fBe,{...n,id:i,pathOptions:p.useMemo(()=>{var s;return{borderRadius:0,offset:(s=n.pathOptions)==null?void 0:s.offset}},[(r=n.pathOptions)==null?void 0:r.offset])})})}const tqt=pBe({isInternal:!1}),mBe=pBe({isInternal:!0});tqt.displayName="StepEdge";mBe.displayName="StepEdgeInternal";function gBe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:m,markerStart:g,interactionWidth:b})=>{const[v,y,w]=I8e({sourceX:n,sourceY:i,targetX:r,targetY:s}),x=e.isInternal?void 0:t;return a.jsx(qT,{id:x,path:v,labelX:y,labelY:w,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:m,markerStart:g,interactionWidth:b})})}const nqt=gBe({isInternal:!1}),bBe=gBe({isInternal:!0});nqt.displayName="StraightEdge";bBe.displayName="StraightEdgeInternal";function yBe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:o=vn.Bottom,targetPosition:l=vn.Top,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,pathOptions:y,interactionWidth:w})=>{const[x,O,k]=N8e({sourceX:n,sourceY:i,sourcePosition:o,targetX:r,targetY:s,targetPosition:l,curvature:y==null?void 0:y.curvature}),S=e.isInternal?void 0:t;return a.jsx(qT,{id:S,path:x,labelX:O,labelY:k,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,interactionWidth:w})})}const iqt=yBe({isInternal:!1}),vBe=yBe({isInternal:!0});iqt.displayName="BezierEdge";vBe.displayName="BezierEdgeInternal";const uoe={default:vBe,straight:bBe,step:mBe,smoothstep:hBe,simplebezier:uBe},doe={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},rqt=(e,t,n)=>n===vn.Left?e-t:n===vn.Right?e+t:e,sqt=(e,t,n)=>n===vn.Top?e-t:n===vn.Bottom?e+t:e,foe="react-flow__edgeupdater";function hoe({position:e,centerX:t,centerY:n,radius:i=10,onMouseDown:r,onMouseEnter:s,onMouseOut:o,type:l}){return a.jsx("circle",{onMouseDown:r,onMouseEnter:s,onMouseOut:o,className:eo([foe,`${foe}-${l}`]),cx:rqt(t,i,e),cy:sqt(n,i,e),r:i,stroke:"transparent",fill:"transparent"})}function aqt({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:i,sourceY:r,targetX:s,targetY:o,sourcePosition:l,targetPosition:c,onReconnect:u,onReconnectStart:d,onReconnectEnd:f,setReconnecting:h,setUpdateHover:m}){const g=Vs(),b=(O,k)=>{if(O.button!==0)return;const{autoPanOnConnect:S,domNode:C,connectionMode:E,connectionRadius:j,lib:T,onConnectStart:R,cancelConnection:A,nodeLookup:N,rfId:D,panBy:I,updateConnection:P}=g.getState(),_=k.type==="target",L=(V,q)=>{h(!1),f==null||f(V,n,k.type,q)},F=V=>u==null?void 0:u(n,V),M=(V,q)=>{h(!0),d==null||d(O,n,k.type),R==null||R(V,q)};F7.onPointerDown(O.nativeEvent,{autoPanOnConnect:S,connectionMode:E,connectionRadius:j,domNode:C,handleId:k.id,nodeId:k.nodeId,nodeLookup:N,isTarget:_,edgeUpdaterType:k.type,lib:T,flowId:D,cancelConnection:A,panBy:I,isValidConnection:(...V)=>{var q,U;return((U=(q=g.getState()).isValidConnection)==null?void 0:U.call(q,...V))??!0},onConnect:F,onConnectStart:M,onConnectEnd:(...V)=>{var q,U;return(U=(q=g.getState()).onConnectEnd)==null?void 0:U.call(q,...V)},onReconnectEnd:L,updateConnection:P,getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,dragThreshold:g.getState().connectionDragThreshold,handleDomNode:O.currentTarget})},v=O=>b(O,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),y=O=>b(O,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),w=()=>m(!0),x=()=>m(!1);return a.jsxs(a.Fragment,{children:[(e===!0||e==="source")&&a.jsx(hoe,{position:l,centerX:i,centerY:r,radius:t,onMouseDown:v,onMouseEnter:w,onMouseOut:x,type:"source"}),(e===!0||e==="target")&&a.jsx(hoe,{position:c,centerX:s,centerY:o,radius:t,onMouseDown:y,onMouseEnter:w,onMouseOut:x,type:"target"})]})}function oqt({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:i,onClick:r,onDoubleClick:s,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:m,rfId:g,edgeTypes:b,noPanClassName:v,onError:y,disableKeyboardA11y:w}){let x=ir(Y=>Y.edgeLookup.get(e));const O=ir(Y=>Y.defaultEdgeOptions);x=O?{...O,...x}:x;let k=x.type||"default",S=(b==null?void 0:b[k])||uoe[k];S===void 0&&(y==null||y("011",Sf.error011(k)),k="default",S=(b==null?void 0:b.default)||uoe.default);const C=!!(x.focusable||t&&typeof x.focusable>"u"),E=typeof f<"u"&&(x.reconnectable||n&&typeof x.reconnectable>"u"),j=!!(x.selectable||i&&typeof x.selectable>"u"),T=p.useRef(null),[R,A]=p.useState(!1),[N,D]=p.useState(!1),I=Vs(),{zIndex:P,sourceX:_,sourceY:L,targetX:F,targetY:M,sourcePosition:V,targetPosition:q}=ir(p.useCallback(Y=>{const K=Y.nodeLookup.get(x.source),ie=Y.nodeLookup.get(x.target);if(!K||!ie)return{zIndex:x.zIndex,...doe};const J=iVt({id:e,sourceNode:K,targetNode:ie,sourceHandle:x.sourceHandle||null,targetHandle:x.targetHandle||null,connectionMode:Y.connectionMode,onError:y});return{zIndex:Gzt({selected:x.selected,zIndex:x.zIndex,sourceNode:K,targetNode:ie,elevateOnSelect:Y.elevateEdgesOnSelect,zIndexMode:Y.zIndexMode}),...J||doe}},[x.source,x.target,x.sourceHandle,x.targetHandle,x.selected,x.zIndex]),zs),U=p.useMemo(()=>x.markerStart?`url('#${L7(x.markerStart,g)}')`:void 0,[x.markerStart,g]),Z=p.useMemo(()=>x.markerEnd?`url('#${L7(x.markerEnd,g)}')`:void 0,[x.markerEnd,g]);if(x.hidden||_===null||L===null||F===null||M===null)return null;const z=Y=>{var ye;const{addSelectedEdges:K,unselectNodesAndEdges:ie,multiSelectionActive:J}=I.getState();j&&(I.setState({nodesSelectionActive:!1}),x.selected&&J?(ie({nodes:[],edges:[x]}),(ye=T.current)==null||ye.blur()):K([e])),r&&r(Y,x)},ee=s?Y=>{s(Y,{...x})}:void 0,ne=o?Y=>{o(Y,{...x})}:void 0,W=l?Y=>{l(Y,{...x})}:void 0,X=c?Y=>{c(Y,{...x})}:void 0,H=u?Y=>{u(Y,{...x})}:void 0,ae=Y=>{var K;if(!w&&b8e.includes(Y.key)&&j){const{unselectNodesAndEdges:ie,addSelectedEdges:J}=I.getState();Y.key==="Escape"?((K=T.current)==null||K.blur(),ie({edges:[x]})):J([e])}};return a.jsx("svg",{style:{zIndex:P},children:a.jsxs("g",{className:eo(["react-flow__edge",`react-flow__edge-${k}`,x.className,v,{selected:x.selected,animated:x.animated,inactive:!j&&!r,updating:R,selectable:j}]),onClick:z,onDoubleClick:ee,onContextMenu:ne,onMouseEnter:W,onMouseMove:X,onMouseLeave:H,onKeyDown:C?ae:void 0,tabIndex:C?0:void 0,role:x.ariaRole??(C?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":x.ariaLabel===null?void 0:x.ariaLabel||`Edge from ${x.source} to ${x.target}`,"aria-describedby":C?`${K8e}-${g}`:void 0,ref:T,...x.domAttributes,children:[!N&&a.jsx(S,{id:e,source:x.source,target:x.target,type:x.type,selected:x.selected,animated:x.animated,selectable:j,deletable:x.deletable??!0,label:x.label,labelStyle:x.labelStyle,labelShowBg:x.labelShowBg,labelBgStyle:x.labelBgStyle,labelBgPadding:x.labelBgPadding,labelBgBorderRadius:x.labelBgBorderRadius,sourceX:_,sourceY:L,targetX:F,targetY:M,sourcePosition:V,targetPosition:q,data:x.data,style:x.style,sourceHandleId:x.sourceHandle,targetHandleId:x.targetHandle,markerStart:U,markerEnd:Z,pathOptions:"pathOptions"in x?x.pathOptions:void 0,interactionWidth:x.interactionWidth}),E&&a.jsx(aqt,{edge:x,isReconnectable:E,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:m,sourceX:_,sourceY:L,targetX:F,targetY:M,sourcePosition:V,targetPosition:q,setUpdateHover:A,setReconnecting:D})]})})}var lqt=p.memo(oqt);const cqt=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function xBe({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:i,noPanClassName:r,onReconnect:s,onEdgeContextMenu:o,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:f,onEdgeDoubleClick:h,onReconnectStart:m,onReconnectEnd:g,disableKeyboardA11y:b}){const{edgesFocusable:v,edgesReconnectable:y,elementsSelectable:w,onError:x}=ir(cqt,zs),O=WHt(t);return a.jsxs("div",{className:"react-flow__edges",children:[a.jsx(ZHt,{defaultColor:e,rfId:n}),O.map(k=>a.jsx(lqt,{id:k,edgesFocusable:v,edgesReconnectable:y,elementsSelectable:w,noPanClassName:r,onReconnect:s,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,reconnectRadius:f,onDoubleClick:h,onReconnectStart:m,onReconnectEnd:g,rfId:n,onError:x,edgeTypes:i,disableKeyboardA11y:b},k))]})}xBe.displayName="EdgeRenderer";const uqt=p.memo(xBe),dqt=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function fqt({children:e}){const t=ir(dqt);return a.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function hqt(e){const t=AL(),n=p.useRef(!1);p.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const pqt=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function mqt(e){const t=ir(pqt),n=Vs();return p.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function gqt(e){return e.connection.inProgress?{...e.connection,to:wO(e.connection.to,e.transform)}:{...e.connection}}function bqt(e){return gqt}function yqt(e){const t=bqt();return ir(t,zs)}const vqt=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function xqt({containerStyle:e,style:t,type:n,component:i}){const{nodesConnectable:r,width:s,height:o,isValid:l,inProgress:c}=ir(vqt,zs);return!(s&&r&&c)?null:a.jsx("svg",{style:e,width:s,height:o,className:"react-flow__connectionline react-flow__container",children:a.jsx("g",{className:eo(["react-flow__connection",x8e(l)]),children:a.jsx(wBe,{style:t,type:n,CustomComponent:i,isValid:l})})})}const wBe=({style:e,type:t=cg.Bezier,CustomComponent:n,isValid:i})=>{const{inProgress:r,from:s,fromNode:o,fromHandle:l,fromPosition:c,to:u,toNode:d,toHandle:f,toPosition:h,pointer:m}=yqt();if(!r)return;if(n)return a.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:l,fromX:s.x,fromY:s.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:h,connectionStatus:x8e(i),toNode:d,toHandle:f,pointer:m});let g="";const b={sourceX:s.x,sourceY:s.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:h};switch(t){case cg.Bezier:[g]=N8e(b);break;case cg.SimpleBezier:[g]=lBe(b);break;case cg.Step:[g]=TP({...b,borderRadius:0});break;case cg.SmoothStep:[g]=TP(b);break;default:[g]=I8e(b)}return a.jsx("path",{d:g,fill:"none",className:"react-flow__connection-path",style:e})};wBe.displayName="ConnectionLine";const wqt={};function poe(e=wqt){p.useRef(e),Vs(),p.useEffect(()=>{},[e])}function Oqt(){Vs(),p.useRef(!1),p.useEffect(()=>{},[])}function OBe({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:i,onEdgeClick:r,onNodeDoubleClick:s,onEdgeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:f,onSelectionStart:h,onSelectionEnd:m,connectionLineType:g,connectionLineStyle:b,connectionLineComponent:v,connectionLineContainerStyle:y,selectionKeyCode:w,selectionOnDrag:x,selectionMode:O,multiSelectionKeyCode:k,panActivationKeyCode:S,zoomActivationKeyCode:C,deleteKeyCode:E,onlyRenderVisibleElements:j,elementsSelectable:T,defaultViewport:R,translateExtent:A,minZoom:N,maxZoom:D,preventScrolling:I,defaultMarkerColor:P,zoomOnScroll:_,zoomOnPinch:L,panOnScroll:F,panOnScrollSpeed:M,panOnScrollMode:V,zoomOnDoubleClick:q,panOnDrag:U,autoPanOnSelection:Z,onPaneClick:z,onPaneMouseEnter:ee,onPaneMouseMove:ne,onPaneMouseLeave:W,onPaneScroll:X,onPaneContextMenu:H,paneClickDistance:ae,nodeClickDistance:Y,onEdgeContextMenu:K,onEdgeMouseEnter:ie,onEdgeMouseMove:J,onEdgeMouseLeave:ye,reconnectRadius:de,onReconnect:ge,onReconnectStart:Ee,onReconnectEnd:xe,noDragClassName:Ne,noWheelClassName:We,noPanClassName:Xe,disableKeyboardA11y:Re,nodeExtent:se,rfId:ce,viewport:ve,onViewportChange:Se}){return poe(e),poe(t),Oqt(),hqt(n),mqt(ve),a.jsx(LHt,{onPaneClick:z,onPaneMouseEnter:ee,onPaneMouseMove:ne,onPaneMouseLeave:W,onPaneContextMenu:H,onPaneScroll:X,paneClickDistance:ae,deleteKeyCode:E,selectionKeyCode:w,selectionOnDrag:x,selectionMode:O,onSelectionStart:h,onSelectionEnd:m,multiSelectionKeyCode:k,panActivationKeyCode:S,zoomActivationKeyCode:C,elementsSelectable:T,zoomOnScroll:_,zoomOnPinch:L,zoomOnDoubleClick:q,panOnScroll:F,panOnScrollSpeed:M,panOnScrollMode:V,panOnDrag:U,autoPanOnSelection:Z,defaultViewport:R,translateExtent:A,minZoom:N,maxZoom:D,onSelectionContextMenu:f,preventScrolling:I,noDragClassName:Ne,noWheelClassName:We,noPanClassName:Xe,disableKeyboardA11y:Re,onViewportChange:Se,isControlledViewport:!!ve,children:a.jsxs(fqt,{children:[a.jsx(uqt,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:o,onReconnect:ge,onReconnectStart:Ee,onReconnectEnd:xe,onlyRenderVisibleElements:j,onEdgeContextMenu:K,onEdgeMouseEnter:ie,onEdgeMouseMove:J,onEdgeMouseLeave:ye,reconnectRadius:de,defaultMarkerColor:P,noPanClassName:Xe,disableKeyboardA11y:Re,rfId:ce}),a.jsx(xqt,{style:b,type:g,component:v,containerStyle:y}),a.jsx("div",{className:"react-flow__edgelabel-renderer"}),a.jsx(qHt,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:Y,onlyRenderVisibleElements:j,noPanClassName:Xe,noDragClassName:Ne,disableKeyboardA11y:Re,nodeExtent:se,rfId:ce}),a.jsx("div",{className:"react-flow__viewport-portal"})]})})}OBe.displayName="GraphView";const kqt=p.memo(OBe),Sqt=E8e(),moe=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:o,fitViewOptions:l,minZoom:c=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:f,zIndexMode:h="basic"}={})=>{const m=new Map,g=new Map,b=new Map,v=new Map,y=i??t??[],w=n??e??[],x=d??[0,0],O=f??oA;M8e(b,v,y);const{nodesInitialized:k}=$7(w,m,g,{nodeOrigin:x,nodeExtent:O,zIndexMode:h});let S=[0,0,1];if(o&&r&&s){const C=VT(m,{filter:R=>!!((R.width||R.initialWidth)&&(R.height||R.initialHeight))}),{x:E,y:j,zoom:T}=tK(C,r,s,c,u,(l==null?void 0:l.padding)??.1);S=[E,j,T]}return{rfId:"1",width:r??0,height:s??0,transform:S,nodes:w,nodesInitialized:k,nodeLookup:m,parentLookup:g,edges:y,edgeLookup:v,connectionLookup:b,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:i!==void 0,panZoom:null,minZoom:c,maxZoom:u,translateExtent:oA,nodeExtent:O,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:k1.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:x,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:l,fitViewResolver:null,connection:{...v8e},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Sqt,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:y8e,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Eqt=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h})=>BVt((m,g)=>{async function b(){const{nodeLookup:v,panZoom:y,fitViewOptions:w,fitViewResolver:x,width:O,height:k,minZoom:S,maxZoom:C}=g();y&&(await Qzt({nodes:v,width:O,height:k,panZoom:y,minZoom:S,maxZoom:C},w),x==null||x.resolve(!0),m({fitViewResolver:null}))}return{...moe({nodes:e,edges:t,width:r,height:s,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,defaultNodes:n,defaultEdges:i,zIndexMode:h}),setNodes:v=>{const{nodeLookup:y,parentLookup:w,nodeOrigin:x,elevateNodesOnSelect:O,fitViewQueued:k,zIndexMode:S,nodesSelectionActive:C}=g(),{nodesInitialized:E,hasSelectedNodes:j}=$7(v,y,w,{nodeOrigin:x,nodeExtent:f,elevateNodesOnSelect:O,checkEquality:!0,zIndexMode:S}),T=C&&j;k&&E?(b(),m({nodes:v,nodesInitialized:E,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:T})):m({nodes:v,nodesInitialized:E,nodesSelectionActive:T})},setEdges:v=>{const{connectionLookup:y,edgeLookup:w}=g();M8e(y,w,v),m({edges:v})},setDefaultNodesAndEdges:(v,y)=>{if(v){const{setNodes:w}=g();w(v),m({hasDefaultNodes:!0})}if(y){const{setEdges:w}=g();w(y),m({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:y,nodeLookup:w,parentLookup:x,domNode:O,nodeOrigin:k,nodeExtent:S,debug:C,fitViewQueued:E,zIndexMode:j}=g(),{changes:T,updatedInternals:R}=dVt(v,w,x,O,k,S,j);R&&(oVt(w,x,{nodeOrigin:k,nodeExtent:S,zIndexMode:j}),E?(b(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),(T==null?void 0:T.length)>0&&(C&&console.log("React Flow: trigger node changes",T),y==null||y(T)))},updateNodePositions:(v,y=!1)=>{const w=[];let x=[];const{nodeLookup:O,triggerNodeChanges:k,connection:S,updateConnection:C,onNodesChangeMiddlewareMap:E}=g();for(const[j,T]of v){const R=O.get(j),A=!!(R!=null&&R.expandParent&&(R!=null&&R.parentId)&&(T!=null&&T.position)),N={id:j,type:"position",position:A?{x:Math.max(0,T.position.x),y:Math.max(0,T.position.y)}:T.position,dragging:y};if(R&&S.inProgress&&S.fromNode.id===R.id){const D=R0(R,S.fromHandle,vn.Left,!0);C({...S,from:D})}A&&R.parentId&&w.push({id:j,parentId:R.parentId,rect:{...T.internals.positionAbsolute,width:T.measured.width??0,height:T.measured.height??0}}),x.push(N)}if(w.length>0){const{parentLookup:j,nodeOrigin:T}=g(),R=lK(w,O,j,T);x.push(...R)}for(const j of E.values())x=j(x);k(x)},triggerNodeChanges:v=>{const{onNodesChange:y,setNodes:w,nodes:x,hasDefaultNodes:O,debug:k}=g();if(v!=null&&v.length){if(O){const S=Y8e(v,x);w(S)}k&&console.log("React Flow: trigger node changes",v),y==null||y(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:y,setEdges:w,edges:x,hasDefaultEdges:O,debug:k}=g();if(v!=null&&v.length){if(O){const S=Z8e(v,x);w(S)}k&&console.log("React Flow: trigger edge changes",v),y==null||y(v)}},addSelectedNodes:v=>{const{multiSelectionActive:y,edgeLookup:w,nodeLookup:x,triggerNodeChanges:O,triggerEdgeChanges:k}=g();if(y){const S=v.map(C=>vy(C,!0));O(S);return}O(Vx(x,new Set([...v]),!0)),k(Vx(w))},addSelectedEdges:v=>{const{multiSelectionActive:y,edgeLookup:w,nodeLookup:x,triggerNodeChanges:O,triggerEdgeChanges:k}=g();if(y){const S=v.map(C=>vy(C,!0));k(S);return}k(Vx(w,new Set([...v]))),O(Vx(x,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:y}={})=>{const{edges:w,nodes:x,nodeLookup:O,triggerNodeChanges:k,triggerEdgeChanges:S}=g(),C=v||x,E=y||w,j=[];for(const R of C){if(!R.selected)continue;const A=O.get(R.id);A&&(A.selected=!1),j.push(vy(R.id,!1))}const T=[];for(const R of E)R.selected&&T.push(vy(R.id,!1));k(j),S(T)},setMinZoom:v=>{const{panZoom:y,maxZoom:w}=g();y==null||y.setScaleExtent([v,w]),m({minZoom:v})},setMaxZoom:v=>{const{panZoom:y,minZoom:w}=g();y==null||y.setScaleExtent([w,v]),m({maxZoom:v})},setTranslateExtent:v=>{var y;(y=g().panZoom)==null||y.setTranslateExtent(v),m({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:y,triggerNodeChanges:w,triggerEdgeChanges:x,elementsSelectable:O}=g();if(!O)return;const k=y.reduce((C,E)=>E.selected?[...C,vy(E.id,!1)]:C,[]),S=v.reduce((C,E)=>E.selected?[...C,vy(E.id,!1)]:C,[]);w(k),x(S)},setNodeExtent:v=>{const{nodes:y,nodeLookup:w,parentLookup:x,nodeOrigin:O,elevateNodesOnSelect:k,nodeExtent:S,zIndexMode:C}=g();v[0][0]===S[0][0]&&v[0][1]===S[0][1]&&v[1][0]===S[1][0]&&v[1][1]===S[1][1]||($7(y,w,x,{nodeOrigin:O,nodeExtent:v,elevateNodesOnSelect:k,checkEquality:!1,zIndexMode:C}),m({nodeExtent:v}))},panBy:v=>{const{transform:y,width:w,height:x,panZoom:O,translateExtent:k}=g();return fVt({delta:v,panZoom:O,transform:y,translateExtent:k,width:w,height:x})},setCenter:async(v,y,w)=>{const{width:x,height:O,maxZoom:k,panZoom:S}=g();if(!S)return!1;const C=typeof(w==null?void 0:w.zoom)<"u"?w.zoom:k;return await S.setViewport({x:x/2-v*C,y:O/2-y*C,zoom:C},{duration:w==null?void 0:w.duration,ease:w==null?void 0:w.ease,interpolate:w==null?void 0:w.interpolate}),!0},cancelConnection:()=>{m({connection:{...v8e}})},updateConnection:v=>{m({connection:v})},reset:()=>m({...moe()})}},Object.is);function kBe({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:i,initialWidth:r,initialHeight:s,initialMinZoom:o,initialMaxZoom:l,initialFitViewOptions:c,fitView:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:m}){const[g]=p.useState(()=>Eqt({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:u,minZoom:o,maxZoom:l,fitViewOptions:c,nodeOrigin:d,nodeExtent:f,zIndexMode:h}));return a.jsx(UVt,{value:g,children:a.jsx(fHt,{children:m})})}function Cqt({children:e,nodes:t,edges:n,defaultNodes:i,defaultEdges:r,width:s,height:o,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:m}){return p.useContext(EL)?a.jsx(a.Fragment,{children:e}):a.jsx(kBe,{initialNodes:t,initialEdges:n,defaultNodes:i,defaultEdges:r,initialWidth:s,initialHeight:o,fitView:l,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:m,children:e})}const Aqt={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Tqt({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,className:r,nodeTypes:s,edgeTypes:o,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:h,onConnect:m,onConnectStart:g,onConnectEnd:b,onClickConnectStart:v,onClickConnectEnd:y,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:O,onNodeContextMenu:k,onNodeDoubleClick:S,onNodeDragStart:C,onNodeDrag:E,onNodeDragStop:j,onNodesDelete:T,onEdgesDelete:R,onDelete:A,onSelectionChange:N,onSelectionDragStart:D,onSelectionDrag:I,onSelectionDragStop:P,onSelectionContextMenu:_,onSelectionStart:L,onSelectionEnd:F,onBeforeDelete:M,connectionMode:V,connectionLineType:q=cg.Bezier,connectionLineStyle:U,connectionLineComponent:Z,connectionLineContainerStyle:z,deleteKeyCode:ee="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:W=!1,selectionMode:X=lA.Full,panActivationKeyCode:H="Space",multiSelectionKeyCode:ae=dA()?"Meta":"Control",zoomActivationKeyCode:Y=dA()?"Meta":"Control",snapToGrid:K,snapGrid:ie,onlyRenderVisibleElements:J=!1,selectNodesOnDrag:ye,nodesDraggable:de,autoPanOnNodeFocus:ge,nodesConnectable:Ee,nodesFocusable:xe,nodeOrigin:Ne=G8e,edgesFocusable:We,edgesReconnectable:Xe,elementsSelectable:Re=!0,defaultViewport:se=eHt,minZoom:ce=.5,maxZoom:ve=2,translateExtent:Se=oA,preventScrolling:oe=!0,nodeExtent:$e,defaultMarkerColor:Ue="#b1b1b7",zoomOnScroll:me=!0,zoomOnPinch:ke=!0,panOnScroll:Ae=!1,panOnScrollSpeed:He=.5,panOnScrollMode:Qe=n0.Free,zoomOnDoubleClick:jt=!0,panOnDrag:Pt=!0,onPaneClick:Kt,onPaneMouseEnter:Ct,onPaneMouseMove:xt,onPaneMouseLeave:tt,onPaneScroll:mt,onPaneContextMenu:_e,paneClickDistance:Ot=1,nodeClickDistance:Nt=0,children:Yt,onReconnect:xn,onReconnectStart:Ke,onReconnectEnd:St,onEdgeContextMenu:qe,onEdgeDoubleClick:nt,onEdgeMouseEnter:et,onEdgeMouseMove:ft,onEdgeMouseLeave:Et,reconnectRadius:At=10,onNodesChange:It,onEdgesChange:Gt,noDragClassName:Ye="nodrag",noWheelClassName:wt="nowheel",noPanClassName:vt="nopan",fitView:tn,fitViewOptions:Qt,connectOnClick:un,attributionPosition:De,proOptions:on,defaultEdgeOptions:On,elevateNodesOnSelect:Sn=!0,elevateEdgesOnSelect:zi=!1,disableKeyboardA11y:dn=!1,autoPanOnConnect:lr,autoPanOnNodeDrag:Mn,autoPanOnSelection:ei=!0,autoPanSpeed:Bn,connectionRadius:ki,isValidConnection:zn,onError:Rn,style:di,id:rt,nodeDragThreshold:zt,connectionDragThreshold:ze,viewport:bt,onViewportChange:Ht,width:_n,height:jr,colorMode:Hs="light",debug:qs,onScroll:Dr,ariaLabelConfig:ti,zIndexMode:Si="basic",...Zr},Jr){const ga=rt||"1",go=rHt(Hs),us=p.useCallback(pe=>{pe.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Dr==null||Dr(pe)},[Dr]);return a.jsx("div",{"data-testid":"rf__wrapper",...Zr,onScroll:us,style:{...di,...Aqt},ref:Jr,className:eo(["react-flow",r,go]),id:rt,role:"application",children:a.jsxs(Cqt,{nodes:e,edges:t,width:_n,height:jr,fitView:tn,fitViewOptions:Qt,minZoom:ce,maxZoom:ve,nodeOrigin:Ne,nodeExtent:$e,zIndexMode:Si,children:[a.jsx(iHt,{nodes:e,edges:t,defaultNodes:n,defaultEdges:i,onConnect:m,onConnectStart:g,onConnectEnd:b,onClickConnectStart:v,onClickConnectEnd:y,nodesDraggable:de,autoPanOnNodeFocus:ge,nodesConnectable:Ee,nodesFocusable:xe,edgesFocusable:We,edgesReconnectable:Xe,elementsSelectable:Re,elevateNodesOnSelect:Sn,elevateEdgesOnSelect:zi,minZoom:ce,maxZoom:ve,nodeExtent:$e,onNodesChange:It,onEdgesChange:Gt,snapToGrid:K,snapGrid:ie,connectionMode:V,translateExtent:Se,connectOnClick:un,defaultEdgeOptions:On,fitView:tn,fitViewOptions:Qt,onNodesDelete:T,onEdgesDelete:R,onDelete:A,onNodeDragStart:C,onNodeDrag:E,onNodeDragStop:j,onSelectionDrag:I,onSelectionDragStart:D,onSelectionDragStop:P,onMove:d,onMoveStart:f,onMoveEnd:h,noPanClassName:vt,nodeOrigin:Ne,rfId:ga,autoPanOnConnect:lr,autoPanOnNodeDrag:Mn,autoPanSpeed:Bn,onError:Rn,connectionRadius:ki,isValidConnection:zn,selectNodesOnDrag:ye,nodeDragThreshold:zt,connectionDragThreshold:ze,onBeforeDelete:M,debug:qs,ariaLabelConfig:ti,zIndexMode:Si}),a.jsx(kqt,{onInit:u,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:O,onNodeContextMenu:k,onNodeDoubleClick:S,nodeTypes:s,edgeTypes:o,connectionLineType:q,connectionLineStyle:U,connectionLineComponent:Z,connectionLineContainerStyle:z,selectionKeyCode:ne,selectionOnDrag:W,selectionMode:X,deleteKeyCode:ee,multiSelectionKeyCode:ae,panActivationKeyCode:H,zoomActivationKeyCode:Y,onlyRenderVisibleElements:J,defaultViewport:se,translateExtent:Se,minZoom:ce,maxZoom:ve,preventScrolling:oe,zoomOnScroll:me,zoomOnPinch:ke,zoomOnDoubleClick:jt,panOnScroll:Ae,panOnScrollSpeed:He,panOnScrollMode:Qe,panOnDrag:Pt,autoPanOnSelection:ei,onPaneClick:Kt,onPaneMouseEnter:Ct,onPaneMouseMove:xt,onPaneMouseLeave:tt,onPaneScroll:mt,onPaneContextMenu:_e,paneClickDistance:Ot,nodeClickDistance:Nt,onSelectionContextMenu:_,onSelectionStart:L,onSelectionEnd:F,onReconnect:xn,onReconnectStart:Ke,onReconnectEnd:St,onEdgeContextMenu:qe,onEdgeDoubleClick:nt,onEdgeMouseEnter:et,onEdgeMouseMove:ft,onEdgeMouseLeave:Et,reconnectRadius:At,defaultMarkerColor:Ue,noDragClassName:Ye,noWheelClassName:wt,noPanClassName:vt,rfId:ga,disableKeyboardA11y:dn,nodeExtent:$e,viewport:bt,onViewportChange:Ht}),a.jsx(JVt,{onSelectionChange:N}),Yt,a.jsx(KVt,{proOptions:on,position:De}),a.jsx(WVt,{rfId:ga,disableKeyboardA11y:dn})]})})}var _qt=J8e(Tqt);const jqt=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function Nqt({children:e}){const t=ir(jqt);return t?yi.createPortal(e,t):null}function Rqt(e){const[t,n]=p.useState(e),i=p.useCallback(r=>n(s=>Y8e(r,s)),[]);return[t,n,i]}function Iqt(e){const[t,n]=p.useState(e),i=p.useCallback(r=>n(s=>Z8e(r,s)),[]);return[t,n,i]}const Pqt=e=>t=>{if(!e.includeHiddenNodes)return t.nodesInitialized;if(t.nodeLookup.size===0)return!1;for(const[,{internals:n}]of t.nodeLookup)if(n.handleBounds===void 0||!nK(n.userNode))return!1;return!0};function Dqt(e={includeHiddenNodes:!1}){return ir(Pqt(e))}function Mqt({dimensions:e,lineWidth:t,variant:n,className:i}){return a.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:eo(["react-flow__background-pattern",n,i])})}function Lqt({radius:e,className:t}){return a.jsx("circle",{cx:e,cy:e,r:e,className:eo(["react-flow__background-pattern","dots",t])})}var Ug;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Ug||(Ug={}));const $qt={[Ug.Dots]:1,[Ug.Lines]:1,[Ug.Cross]:6},Fqt=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function SBe({id:e,variant:t=Ug.Dots,gap:n=20,size:i,lineWidth:r=1,offset:s=0,color:o,bgColor:l,style:c,className:u,patternClassName:d}){const f=p.useRef(null),{transform:h,patternId:m}=ir(Fqt,zs),g=i||$qt[t],b=t===Ug.Dots,v=t===Ug.Cross,y=Array.isArray(n)?n:[n,n],w=[y[0]*h[2]||1,y[1]*h[2]||1],x=g*h[2],O=Array.isArray(s)?s:[s,s],k=v?[x,x]:w,S=[O[0]*h[2]||1+k[0]/2,O[1]*h[2]||1+k[1]/2],C=`${m}${e||""}`;return a.jsxs("svg",{className:eo(["react-flow__background",u]),style:{...c,...TL,"--xy-background-color-props":l,"--xy-background-pattern-color-props":o},ref:f,"data-testid":"rf__background",children:[a.jsx("pattern",{id:C,x:h[0]%w[0],y:h[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${S[0]},-${S[1]})`,children:b?a.jsx(Lqt,{radius:x/2,className:d}):a.jsx(Mqt,{dimensions:k,lineWidth:r,variant:t,className:d})}),a.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${C})`})]})}SBe.displayName="Background";const Bqt=p.memo(SBe);function Uqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:a.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Qqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:a.jsx("path",{d:"M0 0h32v4.2H0z"})})}function zqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:a.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function Vqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:a.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function Hqt(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:a.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function xj({children:e,className:t,...n}){return a.jsx("button",{type:"button",className:eo(["react-flow__controls-button",t]),...n,children:e})}const qqt=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function EBe({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:i=!0,fitViewOptions:r,onZoomIn:s,onZoomOut:o,onFitView:l,onInteractiveChange:c,className:u,children:d,position:f="bottom-left",orientation:h="vertical","aria-label":m}){const g=Vs(),{isInteractive:b,minZoomReached:v,maxZoomReached:y,ariaLabelConfig:w}=ir(qqt,zs),{zoomIn:x,zoomOut:O,fitView:k}=AL(),S=()=>{x(),s==null||s()},C=()=>{O(),o==null||o()},E=()=>{k(r),l==null||l()},j=()=>{g.setState({nodesDraggable:!b,nodesConnectable:!b,elementsSelectable:!b}),c==null||c(!b)},T=h==="horizontal"?"horizontal":"vertical";return a.jsxs(CL,{className:eo(["react-flow__controls",T,u]),position:f,style:e,"data-testid":"rf__controls","aria-label":m??w["controls.ariaLabel"],children:[t&&a.jsxs(a.Fragment,{children:[a.jsx(xj,{onClick:S,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:y,children:a.jsx(Uqt,{})}),a.jsx(xj,{onClick:C,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:v,children:a.jsx(Qqt,{})})]}),n&&a.jsx(xj,{className:"react-flow__controls-fitview",onClick:E,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:a.jsx(zqt,{})}),i&&a.jsx(xj,{className:"react-flow__controls-interactive",onClick:j,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:b?a.jsx(Hqt,{}):a.jsx(Vqt,{})}),d]})}EBe.displayName="Controls";const Wqt=p.memo(EBe);function Kqt({id:e,x:t,y:n,width:i,height:r,style:s,color:o,strokeColor:l,strokeWidth:c,className:u,borderRadius:d,shapeRendering:f,selected:h,onClick:m}){const{background:g,backgroundColor:b}=s||{},v=o||g||b;return a.jsx("rect",{className:eo(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:d,ry:d,width:i,height:r,style:{fill:v,stroke:l,strokeWidth:c},shapeRendering:f,onClick:m?y=>m(y,e):void 0})}const Gqt=p.memo(Kqt),Xqt=e=>e.nodes.map(t=>t.id),n6=e=>e instanceof Function?e:()=>e;function Yqt({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:r,nodeComponent:s=Gqt,onClick:o}){const l=ir(Xqt,zs),c=n6(t),u=n6(e),d=n6(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return a.jsx(a.Fragment,{children:l.map(h=>a.jsx(Jqt,{id:h,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:i,nodeStrokeWidth:r,NodeComponent:s,onClick:o,shapeRendering:f},h))})}function Zqt({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:i,nodeBorderRadius:r,nodeStrokeWidth:s,shapeRendering:o,NodeComponent:l,onClick:c}){const{node:u,x:d,y:f,width:h,height:m}=ir(g=>{const b=g.nodeLookup.get(e);if(!b)return{node:void 0,x:0,y:0,width:0,height:0};const v=b.internals.userNode,{x:y,y:w}=b.internals.positionAbsolute,{width:x,height:O}=wm(v);return{node:v,x:y,y:w,width:x,height:O}},zs);return!u||u.hidden||!nK(u)?null:a.jsx(l,{x:d,y:f,width:h,height:m,style:u.style,selected:!!u.selected,className:i(u),color:t(u),borderRadius:r,strokeColor:n(u),strokeWidth:s,shapeRendering:o,onClick:c,id:u.id})}const Jqt=p.memo(Zqt);var eWt=p.memo(Yqt);const tWt=200,nWt=150,iWt=e=>!e.hidden,rWt=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?S8e(VT(e.nodeLookup,{filter:iWt}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},sWt="react-flow__minimap-desc";function CBe({style:e,className:t,nodeStrokeColor:n,nodeColor:i,nodeClassName:r="",nodeBorderRadius:s=5,nodeStrokeWidth:o,nodeComponent:l,bgColor:c,maskColor:u,maskStrokeColor:d,maskStrokeWidth:f,position:h="bottom-right",onClick:m,onNodeClick:g,pannable:b=!1,zoomable:v=!1,ariaLabel:y,inversePan:w,zoomStep:x=1,offsetScale:O=5}){const k=Vs(),S=p.useRef(null),{boundingRect:C,viewBB:E,rfId:j,panZoom:T,translateExtent:R,flowWidth:A,flowHeight:N,ariaLabelConfig:D}=ir(rWt,zs),I=(e==null?void 0:e.width)??tWt,P=(e==null?void 0:e.height)??nWt,_=C.width/I,L=C.height/P,F=Math.max(_,L),M=F*I,V=F*P,q=O*F,U=C.x-(M-C.width)/2-q,Z=C.y-(V-C.height)/2-q,z=M+q*2,ee=V+q*2,ne=`${sWt}-${j}`,W=p.useRef(0),X=p.useRef();W.current=F,p.useEffect(()=>{if(S.current&&T)return X.current=wVt({domNode:S.current,panZoom:T,getTransform:()=>k.getState().transform,getViewScale:()=>W.current}),()=>{var K;(K=X.current)==null||K.destroy()}},[T]),p.useEffect(()=>{var K;(K=X.current)==null||K.update({translateExtent:R,width:A,height:N,inversePan:w,pannable:b,zoomStep:x,zoomable:v})},[b,v,w,x,R,A,N]);const H=m?K=>{var ye;const[ie,J]=((ye=X.current)==null?void 0:ye.pointer(K))||[0,0];m(K,{x:ie,y:J})}:void 0,ae=g?p.useCallback((K,ie)=>{const J=k.getState().nodeLookup.get(ie).internals.userNode;g(K,J)},[]):void 0,Y=y??D["minimap.ariaLabel"];return a.jsx(CL,{position:h,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*F:void 0,"--xy-minimap-node-background-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o=="number"?o:void 0},className:eo(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:a.jsxs("svg",{width:I,height:P,viewBox:`${U} ${Z} ${z} ${ee}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ne,ref:S,onClick:H,children:[Y&&a.jsx("title",{id:ne,children:Y}),a.jsx(eWt,{onClick:ae,nodeColor:i,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:r,nodeStrokeWidth:o,nodeComponent:l}),a.jsx("path",{className:"react-flow__minimap-mask",d:`M${U-q},${Z-q}h${z+q*2}v${ee+q*2}h${-z-q*2}z + M${E.x},${E.y}h${E.width}v${E.height}h${-E.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}CBe.displayName="MiniMap";p.memo(CBe);const aWt=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,oWt={[A1.Line]:"right",[A1.Handle]:"bottom-right"};function lWt({nodeId:e,position:t,variant:n=A1.Handle,className:i,style:r=void 0,children:s,color:o,minWidth:l=10,minHeight:c=10,maxWidth:u=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:h,autoScale:m=!0,shouldResize:g,onResizeStart:b,onResize:v,onResizeEnd:y}){const w=iBe(),x=typeof e=="string"?e:w,O=Vs(),k=p.useRef(null),S=n===A1.Handle,C=ir(p.useCallback(aWt(S&&m),[S,m]),zs),E=p.useRef(null),j=t??oWt[n];p.useEffect(()=>{if(!(!k.current||!x))return E.current||(E.current=PVt({domNode:k.current,nodeId:x,getStoreItems:()=>{const{nodeLookup:R,transform:A,snapGrid:N,snapToGrid:D,nodeOrigin:I,domNode:P}=O.getState();return{nodeLookup:R,transform:A,snapGrid:N,snapToGrid:D,nodeOrigin:I,paneDomNode:P}},onChange:(R,A)=>{const{triggerNodeChanges:N,nodeLookup:D,parentLookup:I,nodeOrigin:P}=O.getState(),_=[],L={x:R.x,y:R.y},F=D.get(x);if(F&&F.expandParent&&F.parentId){const M=F.origin??P,V=R.width??F.measured.width??0,q=R.height??F.measured.height??0,U={id:F.id,parentId:F.parentId,rect:{width:V,height:q,...C8e({x:R.x??F.position.x,y:R.y??F.position.y},{width:V,height:q},F.parentId,D,M)}},Z=lK([U],D,I,P);_.push(...Z),L.x=R.x?Math.max(M[0]*V,R.x):void 0,L.y=R.y?Math.max(M[1]*q,R.y):void 0}if(L.x!==void 0&&L.y!==void 0){const M={id:x,type:"position",position:{...L}};_.push(M)}if(R.width!==void 0&&R.height!==void 0){const V={id:x,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:R.width,height:R.height}};_.push(V)}for(const M of A){const V={...M,type:"position"};_.push(V)}N(_)},onEnd:({width:R,height:A})=>{const N={id:x,type:"dimensions",resizing:!1,dimensions:{width:R,height:A}};O.getState().triggerNodeChanges([N])}})),E.current.update({controlPosition:j,boundaries:{minWidth:l,minHeight:c,maxWidth:u,maxHeight:d},keepAspectRatio:f,resizeDirection:h,onResizeStart:b,onResize:v,onResizeEnd:y,shouldResize:g}),()=>{var R;(R=E.current)==null||R.destroy()}},[j,l,c,u,d,f,b,v,y,g]);const T=j.split("-");return a.jsx("div",{className:eo(["react-flow__resize-control","nodrag",...T,n,i]),ref:k,style:{...r,scale:C,...o&&{[S?"backgroundColor":"borderColor"]:o}},children:s})}p.memo(lWt);var ABe=Object.defineProperty,cWt=(e,t,n)=>t in e?ABe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,uWt=(e,t)=>{for(var n in t)ABe(e,n,{get:t[n],enumerable:!0})},dWt=(e,t,n)=>cWt(e,t+"",n),TBe={};uWt(TBe,{Graph:()=>Md,alg:()=>uK,json:()=>jBe,version:()=>pWt});var fWt=Object.defineProperty,_Be=(e,t)=>{for(var n in t)fWt(e,n,{get:t[n],enumerable:!0})},Md=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected="directed"in e?e.directed:!0,this._isMultigraph="multigraph"in e?e.multigraph:!1,this._isCompound="compound"in e?e.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return typeof e!="function"?this._defaultNodeLabelFn=()=>e:this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(n=>{t!==void 0?this.setNode(n,t):this.setNode(n)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]="\0",this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(n=>{this.setParent(n)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(t===void 0)t="\0";else{t+="";for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!=="\0")return t}}children(e="\0"){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e==="\0")return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t);for(let i of this.successors(e))n.add(i);return Array.from(n.values())}}isLeaf(e){let t;return this.isDirected()?t=this.successors(e):t=this.neighbors(e),t.length===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([r,s])=>{e(r)&&t.setNode(r,s)}),Object.values(this._edgeObjs).forEach(r=>{t.hasNode(r.v)&&t.hasNode(r.w)&&t.setEdge(r,this.edge(r))});let n={},i=r=>{let s=this.parent(r);return!s||t.hasNode(s)?(n[r]=s??void 0,s??void 0):s in n?n[s]:i(s)};return this._isCompound&&t.nodes().forEach(r=>t.setParent(r,i(r))),t}setDefaultEdgeLabel(e){return typeof e!="function"?this._defaultEdgeLabelFn=()=>e:this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((n,i)=>(t!==void 0?this.setEdge(n,i,t):this.setEdge(n,i),i)),this}setEdge(e,t,n,i){let r,s,o,l,c=!1;typeof e=="object"&&e!==null&&"v"in e?(r=e.v,s=e.w,o=e.name,arguments.length===2&&(l=t,c=!0)):(r=e,s=t,o=i,arguments.length>2&&(l=n,c=!0)),r=""+r,s=""+s,o!==void 0&&(o=""+o);let u=SS(this._isDirected,r,s,o);if(u in this._edgeLabels)return c&&(this._edgeLabels[u]=l),this;if(o!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(r),this.setNode(s),this._edgeLabels[u]=c?l:this._defaultEdgeLabelFn(r,s,o);let d=hWt(this._isDirected,r,s,o);return r=d.v,s=d.w,Object.freeze(d),this._edgeObjs[u]=d,goe(this._preds[s],r),goe(this._sucs[r],s),this._in[s][u]=d,this._out[r][u]=d,this._edgeCount++,this}edge(e,t,n){let i=arguments.length===1?i6(this._isDirected,e):SS(this._isDirected,e,t,n);return this._edgeLabels[i]}edgeAsObj(e,t,n){let i=arguments.length===1?this.edge(e):this.edge(e,t,n);return typeof i!="object"?{label:i}:i}hasEdge(e,t,n){return(arguments.length===1?i6(this._isDirected,e):SS(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let i=arguments.length===1?i6(this._isDirected,e):SS(this._isDirected,e,t,n),r=this._edgeObjs[i];if(r){let s=r.v,o=r.w;delete this._edgeLabels[i],delete this._edgeObjs[i],boe(this._preds[o],s),boe(this._sucs[s],o),delete this._in[o][i],delete this._out[s][i],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,n){if(!e)return;let i=Object.values(e);return n?i.filter(r=>r.v===t&&r.w===n||r.v===n&&r.w===t):i}};function goe(e,t){e[t]?e[t]++:e[t]=1}function boe(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function SS(e,t,n,i){let r=""+t,s=""+n;if(!e&&r>s){let o=r;r=s,s=o}return r+""+s+""+(i===void 0?"\0":i)}function hWt(e,t,n,i){let r=""+t,s=""+n;if(!e&&r>s){let l=r;r=s,s=l}let o={v:r,w:s};return i&&(o.name=i),o}function i6(e,t){return SS(e,t.v,t.w,t.name)}var pWt="4.0.1",jBe={};_Be(jBe,{read:()=>yWt,write:()=>mWt});function mWt(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:gWt(e),edges:bWt(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function gWt(e){return e.nodes().map(t=>{let n=e.node(t),i=e.parent(t),r={v:t};return n!==void 0&&(r.value=n),i!==void 0&&(r.parent=i),r})}function bWt(e){return e.edges().map(t=>{let n=e.edge(t),i={v:t.v,w:t.w};return t.name!==void 0&&(i.name=t.name),n!==void 0&&(i.value=n),i})}function yWt(e){let t=new Md(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(n=>{t.setNode(n.v,n.value),n.parent&&t.setParent(n.v,n.parent)}),e.edges.forEach(n=>{t.setEdge({v:n.v,w:n.w,name:n.name},n.value)}),t}var uK={};_Be(uK,{CycleException:()=>NP,bellmanFord:()=>NBe,components:()=>wWt,dijkstra:()=>jP,dijkstraAll:()=>SWt,findCycles:()=>EWt,floydWarshall:()=>AWt,isAcyclic:()=>_Wt,postorder:()=>NWt,preorder:()=>RWt,prim:()=>IWt,shortestPaths:()=>PWt,tarjan:()=>IBe,topsort:()=>PBe});var vWt=()=>1;function NBe(e,t,n,i){return xWt(e,String(t),n||vWt,i||function(r){return e.outEdges(r)})}function xWt(e,t,n,i){let r={},s,o=0,l=e.nodes(),c=function(f){let h=n(f);r[f.v].distance+he.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(e,t){let n=this._keyIndices,i=String(e);if(!(i in n)){let r=this._arr,s=r.length;return n[i]=s,r.push({key:i,priority:t}),this._decrease(s),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw new Error(`Key not found: ${e}`);let i=this._arr[n].priority;if(t>i)throw new Error(`New priority is greater than current priority. Key: ${e} Old: ${i} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,i=n+1,r=e;n>1,!(t[i].priority1;function jP(e,t,n,i){let r=function(s){return e.outEdges(s)};return kWt(e,String(t),n||OWt,i||r)}function kWt(e,t,n,i){let r={},s=new RBe,o,l,c=function(u){let d=u.v!==o?u.v:u.w,f=r[d],h=n(u),m=l.distance+h;if(h<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+u+" Weight: "+h);m0&&(o=s.removeMin(),l=r[o],l.distance!==Number.POSITIVE_INFINITY);)i(o).forEach(c);return r}function SWt(e,t,n){return e.nodes().reduce(function(i,r){return i[r]=jP(e,r,t,n),i},{})}function IBe(e){let t=0,n=[],i={},r=[];function s(o){let l=i[o]={onStack:!0,lowlink:t,index:t++};if(n.push(o),e.successors(o).forEach(function(c){c in i?i[c].onStack&&(l.lowlink=Math.min(l.lowlink,i[c].index)):(s(c),l.lowlink=Math.min(l.lowlink,i[c].lowlink))}),l.lowlink===l.index){let c=[],u;do u=n.pop(),i[u].onStack=!1,c.push(u);while(o!==u);r.push(c)}}return e.nodes().forEach(function(o){o in i||s(o)}),r}function EWt(e){return IBe(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var CWt=()=>1;function AWt(e,t,n){return TWt(e,t||CWt,n||function(i){return e.outEdges(i)})}function TWt(e,t,n){let i={},r=e.nodes();return r.forEach(function(s){i[s]={},i[s][s]={distance:0,predecessor:""},r.forEach(function(o){s!==o&&(i[s][o]={distance:Number.POSITIVE_INFINITY,predecessor:""})}),n(s).forEach(function(o){let l=o.v===s?o.w:o.v,c=t(o);i[s][l]={distance:c,predecessor:s}})}),r.forEach(function(s){let o=i[s];r.forEach(function(l){let c=i[l];r.forEach(function(u){let d=c[s],f=o[u],h=c[u],m=d.distance+f.distance;m{var c;return(c=e.isDirected()?e.successors(l):e.neighbors(l))!=null?c:[]},o={};return t.forEach(function(l){if(!e.hasNode(l))throw new Error("Graph does not have node: "+l);r=DBe(e,l,n==="post",o,s,i,r)}),r}function DBe(e,t,n,i,r,s,o){return t in i||(i[t]=!0,n||(o=s(o,t)),r(t).forEach(function(l){o=DBe(e,l,n,i,r,s,o)}),n&&(o=s(o,t))),o}function MBe(e,t,n){return jWt(e,t,n,function(i,r){return i.push(r),i},[])}function NWt(e,t){return MBe(e,t,"post")}function RWt(e,t){return MBe(e,t,"pre")}function IWt(e,t){let n=new Md,i={},r=new RBe,s;function o(c){let u=c.v===s?c.w:c.v,d=r.priority(u);if(d!==void 0){let f=t(c);f0;){if(s=r.removeMin(),s in i)n.setEdge(s,i[s]);else{if(l)throw new Error("Input graph is not connected: "+e);l=!0}e.nodeEdges(s).forEach(o)}return n}function PWt(e,t,n,i){return DWt(e,t,n,i??(r=>{let s=e.outEdges(r);return s??[]}))}function DWt(e,t,n,i){if(n===void 0)return jP(e,t,n,i);let r=!1,s=e.nodes();for(let o=0;ot.setNode(n,e.node(n))),e.edges().forEach(n=>{let i=t.edge(n.v,n.w)||{weight:0,minlen:1},r=e.edge(n);t.setEdge(n.v,n.w,{weight:i.weight+r.weight,minlen:Math.max(i.minlen,r.minlen)})}),t}function LBe(e){let t=new Md({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function yoe(e,t){let n=e.x,i=e.y,r=t.x-n,s=t.y-i,o=e.width/2,l=e.height/2;if(!r&&!s)throw new Error("Not possible to find intersection inside of the rectangle");let c,u;return Math.abs(s)*o>Math.abs(r)*l?(s<0&&(l=-l),c=l*r/s,u=l):(r<0&&(o=-o),c=o,u=o*s/r),{x:n+c,y:i+u}}function WT(e){let t=hA(FBe(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let i=e.node(n),r=i.rank;r!==void 0&&(t[r]||(t[r]=[]),t[r][i.order]=n)}),t}function LWt(e){let t=e.nodes().map(i=>{let r=e.node(i).rank;return r===void 0?Number.MAX_VALUE:r}),n=fh(Math.min,t);e.nodes().forEach(i=>{let r=e.node(i);Object.hasOwn(r,"rank")&&(r.rank-=n)})}function $Wt(e){let t=e.nodes().map(o=>e.node(o).rank).filter(o=>o!==void 0),n=fh(Math.min,t),i=[];e.nodes().forEach(o=>{let l=e.node(o).rank-n;i[l]||(i[l]=[]),i[l].push(o)});let r=0,s=e.graph().nodeRankFactor;Array.from(i).forEach((o,l)=>{o===void 0&&l%s!==0?--r:o!==void 0&&r&&o.forEach(c=>e.node(c).rank+=r)})}function voe(e,t,n,i){let r={width:0,height:0};return arguments.length>=4&&(r.rank=n,r.order=i),OO(e,"border",r,t)}function FWt(e,t=$Be){let n=[];for(let i=0;i$Be){let n=FWt(t);return e(...n.map(i=>e(...i)))}else return e(...t)}function FBe(e){let t=e.nodes().map(n=>{let i=e.node(n).rank;return i===void 0?Number.MIN_VALUE:i});return fh(Math.max,t)}function BWt(e,t){let n={lhs:[],rhs:[]};return e.forEach(i=>{t(i)?n.lhs.push(i):n.rhs.push(i)}),n}function BBe(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}}function UBe(e,t){return t()}var UWt=0;function dK(e){let t=++UWt;return e+(""+t)}function hA(e,t,n=1){t==null&&(t=e,e=0);let i=s=>sti[t]:n=t,Object.entries(e).reduce((i,[r,s])=>(i[r]=n(s,r),i),{})}function QWt(e,t){return e.reduce((n,i,r)=>(n[i]=t[r],n),{})}var jL="\0",zWt="3.0.0",VWt=class{constructor(){dWt(this,"_sentinel");let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return xoe(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&xoe(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,HWt)),n=n._prev;return"["+e.join(", ")+"]"}};function xoe(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function HWt(e,t){if(e!=="_next"&&e!=="_prev")return t}var qWt=VWt,WWt=()=>1;function KWt(e,t){if(e.nodeCount()<=1)return[];let n=XWt(e,t||WWt);return GWt(n.graph,n.buckets,n.zeroIdx).flatMap(i=>e.outEdges(i.v,i.w)||[])}function GWt(e,t,n){var i;let r=[],s=t[t.length-1],o=t[0],l;for(;e.nodeCount();){for(;l=o.dequeue();)r6(e,t,n,l);for(;l=s.dequeue();)r6(e,t,n,l);if(e.nodeCount()){for(let c=t.length-2;c>0;--c)if(l=(i=t[c])==null?void 0:i.dequeue(),l){r=r.concat(r6(e,t,n,l,!0)||[]);break}}}return r}function r6(e,t,n,i,r){let s=[],o=r?s:void 0;return(e.inEdges(i.v)||[]).forEach(l=>{let c=e.edge(l),u=e.node(l.v);r&&s.push({v:l.v,w:l.w}),u.out-=c,U7(t,n,u)}),(e.outEdges(i.v)||[]).forEach(l=>{let c=e.edge(l),u=l.w,d=e.node(u);d.in-=c,U7(t,n,d)}),e.removeNode(i.v),o}function XWt(e,t){let n=new Md,i=0,r=0;e.nodes().forEach(l=>{n.setNode(l,{v:l,in:0,out:0})}),e.edges().forEach(l=>{let c=n.edge(l.v,l.w)||0,u=t(l),d=c+u;n.setEdge(l.v,l.w,d);let f=n.node(l.v),h=n.node(l.w);r=Math.max(r,f.out+=u),i=Math.max(i,h.in+=u)});let s=YWt(r+i+3).map(()=>new qWt),o=i+1;return n.nodes().forEach(l=>{U7(s,o,n.node(l))}),{graph:n,buckets:s,zeroIdx:o}}function U7(e,t,n){var i,r,s;n.out?n.in?(s=e[n.out-n.in+t])==null||s.enqueue(n):(r=e[e.length-1])==null||r.enqueue(n):(i=e[0])==null||i.enqueue(n)}function YWt(e){let t=[];for(let n=0;n{let i=e.edge(n);e.removeEdge(n),i.forwardName=n.name,i.reversed=!0,e.setEdge(n.w,n.v,i,dK("rev"))});function t(n){return i=>n.edge(i).weight}}function JWt(e){let t=[],n={},i={};function r(s){Object.hasOwn(i,s)||(i[s]=!0,n[s]=!0,e.outEdges(s).forEach(o=>{Object.hasOwn(n,o.w)?t.push(o):r(o.w)}),delete n[s])}return e.nodes().forEach(r),t}function eKt(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let i=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,i)}})}function tKt(e){e.graph().dummyChains=[],e.edges().forEach(t=>nKt(e,t))}function nKt(e,t){let n=t.v,i=e.node(n).rank,r=t.w,s=e.node(r).rank,o=t.name,l=e.edge(t),c=l.labelRank;if(s===i+1)return;e.removeEdge(t);let u,d,f;for(f=0,++i;i{let n=e.node(t),i=n.edgeLabel,r;for(e.setEdge(n.edgeObj,i);n.dummy;)r=e.successors(t)[0],e.removeNode(t),i.points.push({x:n.x,y:n.y}),n.dummy==="edge-label"&&(i.x=n.x,i.y=n.y,i.width=n.width,i.height=n.height),t=r,n=e.node(t)})}function fK(e){let t={};function n(i){let r=e.node(i);if(Object.hasOwn(t,i))return r.rank;t[i]=!0;let s=e.outEdges(i),o=s?s.map(c=>c==null?Number.POSITIVE_INFINITY:n(c.w)-e.edge(c).minlen):[],l=fh(Math.min,o);return l===Number.POSITIVE_INFINITY&&(l=0),r.rank=l}e.sources().forEach(n)}function T1(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var QBe=rKt;function rKt(e){let t=new Md({directed:!1}),n=e.nodes();if(n.length===0)throw new Error("Graph must have at least one node");let i=n[0],r=e.nodeCount();t.setNode(i,{});let s,o;for(;sKt(t,e){let o=s.v,l=i===o?s.w:o;!e.hasNode(l)&&!T1(t,s)&&(e.setNode(l,{}),e.setEdge(i,l,{}),n(l))})}return e.nodes().forEach(n),e.nodeCount()}function aKt(e,t){return t.edges().reduce((n,i)=>{let r=Number.POSITIVE_INFINITY;return e.hasNode(i.v)!==e.hasNode(i.w)&&(r=T1(t,i)),rt.node(i).rank+=n)}var{preorder:lKt,postorder:cKt}=uK,uKt=ov;ov.initLowLimValues=pK;ov.initCutValues=hK;ov.calcCutValue=zBe;ov.leaveEdge=HBe;ov.enterEdge=qBe;ov.exchangeEdges=WBe;function ov(e){e=MWt(e),fK(e);let t=QBe(e);pK(t),hK(t,e);let n,i;for(;n=HBe(t);)i=qBe(t,e,n),WBe(t,e,n,i)}function hK(e,t){let n=cKt(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(i=>dKt(e,t,i))}function dKt(e,t,n){let i=e.node(n).parent,r=e.edge(n,i);r.cutvalue=zBe(e,t,n)}function zBe(e,t,n){let i=e.node(n).parent,r=!0,s=t.edge(n,i),o=0;s||(r=!1,s=t.edge(i,n)),o=s.weight;let l=t.nodeEdges(n);return l&&l.forEach(c=>{let u=c.v===n,d=u?c.w:c.v;if(d!==i){let f=u===r,h=t.edge(c).weight;if(o+=f?h:-h,hKt(e,n,d)){let m=e.edge(n,d).cutvalue;o+=f?-m:m}}}),o}function pK(e,t){arguments.length<2&&(t=e.nodes()[0]),VBe(e,{},1,t)}function VBe(e,t,n,i,r){let s=n,o=e.node(i);t[i]=!0;let l=e.neighbors(i);return l&&l.forEach(c=>{Object.hasOwn(t,c)||(n=VBe(e,t,n,c,i))}),o.low=s,o.lim=n++,r?o.parent=r:delete o.parent,n}function HBe(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function qBe(e,t,n){let i=n.v,r=n.w;t.hasEdge(i,r)||(i=n.w,r=n.v);let s=e.node(i),o=e.node(r),l=s,c=!1;return s.lim>o.lim&&(l=o,c=!0),t.edges().filter(u=>c===woe(e,e.node(u.v),l)&&c!==woe(e,e.node(u.w),l)).reduce((u,d)=>T1(t,d)!e.node(r).parent);if(!n)return;let i=lKt(e,[n]);i=i.slice(1),i.forEach(r=>{let s=e.node(r).parent,o=t.edge(r,s),l=!1;o||(o=t.edge(s,r),l=!0),t.node(r).rank=t.node(s).rank+(l?o.minlen:-o.minlen)})}function hKt(e,t,n){return e.hasEdge(t,n)}function woe(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var pKt=mKt;function mKt(e){let t=e.graph().ranker;if(typeof t=="function")return t(e);switch(t){case"network-simplex":Ooe(e);break;case"tight-tree":bKt(e);break;case"longest-path":gKt(e);break;case"none":break;default:Ooe(e)}}var gKt=fK;function bKt(e){fK(e),QBe(e)}function Ooe(e){uKt(e)}var yKt=vKt;function vKt(e){let t=wKt(e);e.graph().dummyChains.forEach(n=>{let i=e.node(n),r=i.edgeObj,s=xKt(e,t,r.v,r.w),o=s.path,l=s.lca,c=0,u=o[c],d=!0;for(;n!==r.w;){if(i=e.node(n),d){for(;(u=o[c])!==l&&e.node(u).maxRanko||l>t[c].lim));let u=c,d=i;for(;(d=e.parent(d))!==u;)s.push(d);return{path:r.concat(s.reverse()),lca:u}}function wKt(e){let t={},n=0;function i(r){let s=n;e.children(r).forEach(i),t[r]={low:s,lim:n++}}return e.children(jL).forEach(i),t}function OKt(e){let t=OO(e,"root",{},"_root"),n=kKt(e),i=Object.values(n),r=fh(Math.max,i)-1,s=2*r+1;e.graph().nestingRoot=t,e.edges().forEach(l=>e.edge(l).minlen*=s);let o=SKt(e)+1;e.children(jL).forEach(l=>KBe(e,t,s,o,r,n,l)),e.graph().nodeRankFactor=s}function KBe(e,t,n,i,r,s,o){var l;let c=e.children(o);if(!c.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}let u=voe(e,"_bt"),d=voe(e,"_bb"),f=e.node(o);e.setParent(u,o),f.borderTop=u,e.setParent(d,o),f.borderBottom=d,c.forEach(h=>{var m;KBe(e,t,n,i,r,s,h);let g=e.node(h),b=g.borderTop?g.borderTop:h,v=g.borderBottom?g.borderBottom:h,y=g.borderTop?i:2*i,w=b!==v?1:r-((m=s[o])!=null?m:0)+1;e.setEdge(u,b,{weight:y,minlen:w,nestingEdge:!0}),e.setEdge(v,d,{weight:y,minlen:w,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,u,{weight:0,minlen:r+((l=s[o])!=null?l:0)})}function kKt(e){let t={};function n(i,r){let s=e.children(i);s&&s.length&&s.forEach(o=>n(o,r+1)),t[i]=r}return e.children(jL).forEach(i=>n(i,1)),t}function SKt(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function EKt(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(n=>{e.edge(n).nestingEdge&&e.removeEdge(n)})}var CKt=AKt;function AKt(e){function t(n){let i=e.children(n),r=e.node(n);if(i.length&&i.forEach(t),Object.hasOwn(r,"minRank")){r.borderLeft=[],r.borderRight=[];for(let s=r.minRank,o=r.maxRank+1;sSoe(e.node(t))),e.edges().forEach(t=>Soe(e.edge(t)))}function Soe(e){let t=e.width;e.width=e.height,e.height=t}function jKt(e){e.nodes().forEach(t=>s6(e.node(t))),e.edges().forEach(t=>{var n;let i=e.edge(t);(n=i.points)==null||n.forEach(s6),Object.hasOwn(i,"y")&&s6(i)})}function s6(e){e.y=-e.y}function NKt(e){e.nodes().forEach(t=>a6(e.node(t))),e.edges().forEach(t=>{var n;let i=e.edge(t);(n=i.points)==null||n.forEach(a6),Object.hasOwn(i,"x")&&a6(i)})}function a6(e){let t=e.x;e.x=e.y,e.y=t}function RKt(e){let t={},n=e.nodes().filter(l=>!e.children(l).length),i=n.map(l=>e.node(l).rank),r=fh(Math.max,i),s=hA(r+1).map(()=>[]);function o(l){if(t[l])return;t[l]=!0;let c=e.node(l);s[c.rank].push(l);let u=e.successors(l);u&&u.forEach(o)}return n.sort((l,c)=>e.node(l).rank-e.node(c).rank).forEach(o),s}function IKt(e,t){let n=0;for(let i=1;id)),r=t.flatMap(u=>{let d=e.outEdges(u);return d?d.map(f=>({pos:i[f.w],weight:e.edge(f).weight})).sort((f,h)=>f.pos-h.pos):[]}),s=1;for(;s{let d=u.pos+s;l[d]+=u.weight;let f=0;for(;d>0;)d%2&&(f+=l[d+1]),d=d-1>>1,l[d]+=u.weight;c+=u.weight*f}),c}function DKt(e,t=[]){return t.map(n=>{let i=e.inEdges(n);if(!i||!i.length)return{v:n};{let r=i.reduce((s,o)=>{let l=e.edge(o),c=e.node(o.v);return{sum:s.sum+l.weight*c.order,weight:s.weight+l.weight}},{sum:0,weight:0});return{v:n,barycenter:r.sum/r.weight,weight:r.weight}}})}function MKt(e,t){let n={};e.forEach((r,s)=>{let o={indegree:0,in:[],out:[],vs:[r.v],i:s};r.barycenter!==void 0&&(o.barycenter=r.barycenter,o.weight=r.weight),n[r.v]=o}),t.edges().forEach(r=>{let s=n[r.v],o=n[r.w];s!==void 0&&o!==void 0&&(o.indegree++,s.out.push(o))});let i=Object.values(n).filter(r=>!r.indegree);return LKt(i)}function LKt(e){let t=[];function n(r){return s=>{s.merged||(s.barycenter===void 0||r.barycenter===void 0||s.barycenter>=r.barycenter)&&$Kt(r,s)}}function i(r){return s=>{s.in.push(r),--s.indegree===0&&e.push(s)}}for(;e.length;){let r=e.pop();t.push(r),r.in.reverse().forEach(n(r)),r.out.forEach(i(r))}return t.filter(r=>!r.merged).map(r=>RP(r,["vs","i","barycenter","weight"]))}function $Kt(e,t){let n=0,i=0;e.weight&&(n+=e.barycenter*e.weight,i+=e.weight),t.weight&&(n+=t.barycenter*t.weight,i+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/i,e.weight=i,e.i=Math.min(t.i,e.i),t.merged=!0}function FKt(e,t){let n=BWt(e,d=>Object.hasOwn(d,"barycenter")),i=n.lhs,r=n.rhs.sort((d,f)=>f.i-d.i),s=[],o=0,l=0,c=0;i.sort(BKt(!!t)),c=Eoe(s,r,c),i.forEach(d=>{c+=d.vs.length,s.push(d.vs),o+=d.barycenter*d.weight,l+=d.weight,c=Eoe(s,r,c)});let u={vs:s.flat(1)};return l&&(u.barycenter=o/l,u.weight=l),u}function Eoe(e,t,n){let i;for(;t.length&&(i=t[t.length-1]).i<=n;)t.pop(),e.push(i.vs),n++;return n}function BKt(e){return(t,n)=>t.barycentern.barycenter?1:e?n.i-t.i:t.i-n.i}function XBe(e,t,n,i){let r=e.children(t),s=e.node(t),o=s?s.borderLeft:void 0,l=s?s.borderRight:void 0,c={};o&&(r=r.filter(h=>h!==o&&h!==l));let u=DKt(e,r);u.forEach(h=>{if(e.children(h.v).length){let m=XBe(e,h.v,n,i);c[h.v]=m,Object.hasOwn(m,"barycenter")&&QKt(h,m)}});let d=MKt(u,n);UKt(d,c);let f=FKt(d,i);if(o&&l){f.vs=[o,f.vs,l].flat(1);let h=e.predecessors(o);if(h&&h.length){let m=e.node(h[0]),g=e.predecessors(l),b=e.node(g[0]);Object.hasOwn(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+m.order+b.order)/(f.weight+2),f.weight+=2}}return f}function UKt(e,t){e.forEach(n=>{n.vs=n.vs.flatMap(i=>t[i]?t[i].vs:i)})}function QKt(e,t){e.barycenter!==void 0?(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight):(e.barycenter=t.barycenter,e.weight=t.weight)}function zKt(e,t,n,i){i||(i=e.nodes());let r=VKt(e),s=new Md({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(o=>e.node(o));return i.forEach(o=>{let l=e.node(o),c=e.parent(o);if(l.rank===t||l.minRank<=t&&t<=l.maxRank){s.setNode(o),s.setParent(o,c||r);let u=e[n](o);u&&u.forEach(d=>{let f=d.v===o?d.w:d.v,h=s.edge(f,o),m=h!==void 0?h.weight:0;s.setEdge(f,o,{weight:e.edge(d).weight+m})}),Object.hasOwn(l,"minRank")&&s.setNode(o,{borderLeft:l.borderLeft[t],borderRight:l.borderRight[t]})}}),s}function VKt(e){let t;for(;e.hasNode(t=dK("_root")););return t}function HKt(e,t,n){let i={},r;n.forEach(s=>{let o=e.parent(s),l,c;for(;o;){if(l=e.parent(o),l?(c=i[l],i[l]=o):(c=r,r=o),c&&c!==o){t.setEdge(c,o);return}o=l}})}function YBe(e,t={}){if(typeof t.customOrder=="function"){t.customOrder(e,YBe);return}let n=FBe(e),i=Coe(e,hA(1,n+1),"inEdges"),r=Coe(e,hA(n-1,-1,-1),"outEdges"),s=RKt(e);if(Aoe(e,s),t.disableOptimalOrderHeuristic)return;let o=Number.POSITIVE_INFINITY,l,c=t.constraints||[];for(let u=0,d=0;d<4;++u,++d){qKt(u%2?i:r,u%4>=2,c),s=WT(e);let f=IKt(e,s);f{i.has(s)||i.set(s,[]),i.get(s).push(o)};for(let s of e.nodes()){let o=e.node(s);if(typeof o.rank=="number"&&r(o.rank,s),typeof o.minRank=="number"&&typeof o.maxRank=="number")for(let l=o.minRank;l<=o.maxRank;l++)l!==o.rank&&r(l,s)}return t.map(function(s){return zKt(e,s,n,i.get(s)||[])})}function qKt(e,t,n){let i=new Md;e.forEach(function(r){n.forEach(l=>i.setEdge(l.left,l.right));let s=r.graph().root,o=XBe(r,s,i,t);o.vs.forEach((l,c)=>r.node(l).order=c),HKt(r,i,o.vs)})}function Aoe(e,t){Object.values(t).forEach(n=>n.forEach((i,r)=>e.node(i).order=r))}function WKt(e,t){let n={};function i(r,s){let o=0,l=0,c=r.length,u=s[s.length-1];return s.forEach((d,f)=>{let h=GKt(e,d),m=h?e.node(h).order:c;(h||d===u)&&(s.slice(l,f+1).forEach(g=>{let b=e.predecessors(g);b&&b.forEach(v=>{let y=e.node(v),w=y.order;(w{let f=s[d];if(f!==void 0&&e.node(f).dummy){let h=e.predecessors(f);h&&h.forEach(m=>{if(m===void 0)return;let g=e.node(m);g.dummy&&(g.orderu)&&ZBe(n,m,f)})}})}function r(s,o){let l=-1,c=-1,u=0;return o.forEach((d,f)=>{if(e.node(d).dummy==="border"){let h=e.predecessors(d);if(h&&h.length){let m=h[0];if(m===void 0)return;c=e.node(m).order,i(o,u,f,l,c),u=f,l=c}}i(o,u,o.length,c,s.length)}),o}return t.length&&t.reduce(r),n}function GKt(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(i=>e.node(i).dummy)}}function ZBe(e,t,n){if(t>n){let r=t;t=n,n=r}let i=e[t];i||(e[t]=i={}),i[n]=!0}function XKt(e,t,n){if(t>n){let r=t;t=n,n=r}let i=e[t];return i!==void 0&&Object.hasOwn(i,n)}function YKt(e,t,n,i){let r={},s={},o={};return t.forEach(l=>{l.forEach((c,u)=>{r[c]=c,s[c]=c,o[c]=u})}),t.forEach(l=>{let c=-1;l.forEach(u=>{let d=i(u);if(d&&d.length){let f=d.sort((m,g)=>{let b=o[m],v=o[g];return(b!==void 0?b:0)-(v!==void 0?v:0)}),h=(f.length-1)/2;for(let m=Math.floor(h),g=Math.ceil(h);m<=g;++m){let b=f[m];if(b===void 0)continue;let v=o[b];if(v!==void 0&&s[u]===u&&c{var y;let w=(y=s[v.v])!=null?y:0,x=o.edge(v);return Math.max(b,w+(x!==void 0?x:0))},0):s[m]=0}function d(m){let g=o.outEdges(m),b=Number.POSITIVE_INFINITY;g&&(b=g.reduce((y,w)=>{let x=s[w.w],O=o.edge(w);return Math.min(y,(x!==void 0?x:0)-(O!==void 0?O:0))},Number.POSITIVE_INFINITY));let v=e.node(m);b!==Number.POSITIVE_INFINITY&&v.borderType!==l&&(s[m]=Math.max(s[m]!==void 0?s[m]:0,b))}function f(m){return o.predecessors(m)||[]}function h(m){return o.successors(m)||[]}return c(u,f),c(d,h),Object.keys(i).forEach(m=>{var g;let b=n[m];b!==void 0&&(s[m]=(g=s[b])!=null?g:0)}),s}function JKt(e,t,n,i){let r=new Md,s=e.graph(),o=rGt(s.nodesep,s.edgesep,i);return t.forEach(l=>{let c;l.forEach(u=>{let d=n[u];if(d!==void 0){if(r.setNode(d),c!==void 0){let f=n[c];if(f!==void 0){let h=r.edge(f,d);r.setEdge(f,d,Math.max(o(e,u,c),h||0))}}c=u}})}),r}function eGt(e,t){return Object.values(t).reduce((n,i)=>{let r=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY;Object.entries(i).forEach(([l,c])=>{let u=sGt(e,l)/2;r=Math.max(c+u,r),s=Math.min(c-u,s)});let o=r-s;return o{["l","r"].forEach(o=>{let l=s+o,c=e[l];if(!c||c===t)return;let u=Object.values(c),d=i-fh(Math.min,u);o!=="l"&&(d=r-fh(Math.max,u)),d&&(e[l]=_L(c,f=>f+d))})})}function nGt(e,t=void 0){let n=e.ul;return n?_L(n,(i,r)=>{var s,o;if(t){let c=t.toLowerCase(),u=e[c];if(u&&u[r]!==void 0)return u[r]}let l=Object.values(e).map(c=>{let u=c[r];return u!==void 0?u:0}).sort((c,u)=>c-u);return(((s=l[1])!=null?s:0)+((o=l[2])!=null?o:0))/2}):{}}function iGt(e){let t=WT(e),n=Object.assign(WKt(e,t),KKt(e,t)),i={},r;["u","d"].forEach(o=>{r=o==="u"?t:Object.values(t).reverse(),["l","r"].forEach(l=>{l==="r"&&(r=r.map(d=>Object.values(d).reverse()));let c=YKt(e,r,n,d=>(o==="u"?e.predecessors(d):e.successors(d))||[]),u=ZKt(e,r,c.root,c.align,l==="r");l==="r"&&(u=_L(u,d=>-d)),i[o+l]=u})});let s=eGt(e,i);return tGt(i,s),nGt(i,e.graph().align)}function rGt(e,t,n){return(i,r,s)=>{let o=i.node(r),l=i.node(s),c=0,u;if(c+=o.width/2,Object.hasOwn(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":u=-o.width/2;break;case"r":u=o.width/2;break}if(u&&(c+=n?u:-u),u=void 0,c+=(o.dummy?t:e)/2,c+=(l.dummy?t:e)/2,c+=l.width/2,Object.hasOwn(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":u=l.width/2;break;case"r":u=-l.width/2;break}return u&&(c+=n?u:-u),c}}function sGt(e,t){return e.node(t).width}function aGt(e){e=LBe(e),oGt(e),Object.entries(iGt(e)).forEach(([t,n])=>e.node(t).x=n)}function oGt(e){let t=WT(e),n=e.graph(),i=n.ranksep,r=n.rankalign,s=0;t.forEach(o=>{let l=o.reduce((c,u)=>{var d;let f=(d=e.node(u).height)!=null?d:0;return c>f?c:f},0);o.forEach(c=>{let u=e.node(c);r==="top"?u.y=s+u.height/2:r==="bottom"?u.y=s+l-u.height/2:u.y=s+l/2}),s+=l+i})}function lGt(e,t={}){let n=t.debugTiming?BBe:UBe;return n("layout",()=>{let i=n(" buildLayoutGraph",()=>yGt(e));return n(" runLayout",()=>cGt(i,n,t)),n(" updateInputGraph",()=>uGt(e,i)),i})}function cGt(e,t,n){t(" makeSpaceForEdgeLabels",()=>vGt(e)),t(" removeSelfEdges",()=>TGt(e)),t(" acyclic",()=>ZWt(e)),t(" nestingGraph.run",()=>OKt(e)),t(" rank",()=>pKt(LBe(e))),t(" injectEdgeLabelProxies",()=>xGt(e)),t(" removeEmptyRanks",()=>$Wt(e)),t(" nestingGraph.cleanup",()=>EKt(e)),t(" normalizeRanks",()=>LWt(e)),t(" assignRankMinMax",()=>wGt(e)),t(" removeEdgeLabelProxies",()=>OGt(e)),t(" normalize.run",()=>tKt(e)),t(" parentDummyChains",()=>yKt(e)),t(" addBorderSegments",()=>CKt(e)),t(" order",()=>YBe(e,n)),t(" insertSelfEdges",()=>_Gt(e)),t(" adjustCoordinateSystem",()=>TKt(e)),t(" position",()=>aGt(e)),t(" positionSelfEdges",()=>jGt(e)),t(" removeBorderNodes",()=>AGt(e)),t(" normalize.undo",()=>iKt(e)),t(" fixupEdgeLabelCoords",()=>EGt(e)),t(" undoCoordinateSystem",()=>_Kt(e)),t(" translateGraph",()=>kGt(e)),t(" assignNodeIntersects",()=>SGt(e)),t(" reversePoints",()=>CGt(e)),t(" acyclic.undo",()=>eKt(e))}function uGt(e,t){e.nodes().forEach(n=>{let i=e.node(n),r=t.node(n);i&&(i.x=r.x,i.y=r.y,i.order=r.order,i.rank=r.rank,t.children(n).length&&(i.width=r.width,i.height=r.height))}),e.edges().forEach(n=>{let i=e.edge(n),r=t.edge(n);i.points=r.points,Object.hasOwn(r,"x")&&(i.x=r.x,i.y=r.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var dGt=["nodesep","edgesep","ranksep","marginx","marginy"],fGt={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},hGt=["acyclicer","ranker","rankdir","align","rankalign"],pGt=["width","height","rank"],Toe={width:0,height:0},mGt=["minlen","weight","width","height","labeloffset"],gGt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},bGt=["labelpos"];function yGt(e){let t=new Md({multigraph:!0,compound:!0}),n=l6(e.graph());return t.setGraph(Object.assign({},fGt,o6(n,dGt),RP(n,hGt))),e.nodes().forEach(i=>{let r=l6(e.node(i)),s=o6(r,pGt);Object.keys(Toe).forEach(l=>{s[l]===void 0&&(s[l]=Toe[l])}),t.setNode(i,s);let o=e.parent(i);o!==void 0&&t.setParent(i,o)}),e.edges().forEach(i=>{let r=l6(e.edge(i));t.setEdge(i,Object.assign({},gGt,o6(r,mGt),RP(r,bGt)))}),t}function vGt(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let i=e.edge(n);i.minlen*=2,i.labelpos.toLowerCase()!=="c"&&(t.rankdir==="TB"||t.rankdir==="BT"?i.width+=i.labeloffset:i.height+=i.labeloffset)})}function xGt(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let i=e.node(t.v),r={rank:(e.node(t.w).rank-i.rank)/2+i.rank,e:t};OO(e,"edge-proxy",r,"_ep")}})}function wGt(e){let t=0;e.nodes().forEach(n=>{let i=e.node(n);i.borderTop&&(i.minRank=e.node(i.borderTop).rank,i.maxRank=e.node(i.borderBottom).rank,t=Math.max(t,i.maxRank))}),e.graph().maxRank=t}function OGt(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy==="edge-proxy"){let i=n;e.edge(i.e).labelRank=n.rank,e.removeNode(t)}})}function kGt(e){let t=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,r=0,s=e.graph(),o=s.marginx||0,l=s.marginy||0;function c(u){let d=u.x,f=u.y,h=u.width,m=u.height;t=Math.min(t,d-h/2),n=Math.max(n,d+h/2),i=Math.min(i,f-m/2),r=Math.max(r,f+m/2)}e.nodes().forEach(u=>c(e.node(u))),e.edges().forEach(u=>{let d=e.edge(u);Object.hasOwn(d,"x")&&c(d)}),t-=o,i-=l,e.nodes().forEach(u=>{let d=e.node(u);d.x-=t,d.y-=i}),e.edges().forEach(u=>{let d=e.edge(u);d.points.forEach(f=>{f.x-=t,f.y-=i}),Object.hasOwn(d,"x")&&(d.x-=t),Object.hasOwn(d,"y")&&(d.y-=i)}),s.width=n-t+o,s.height=r-i+l}function SGt(e){e.edges().forEach(t=>{let n=e.edge(t),i=e.node(t.v),r=e.node(t.w),s,o;n.points?(s=n.points[0],o=n.points[n.points.length-1]):(n.points=[],s=r,o=i),n.points.unshift(yoe(i,s)),n.points.push(yoe(r,o))})}function EGt(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,"x"))switch((n.labelpos==="l"||n.labelpos==="r")&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}})}function CGt(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function AGt(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),i=e.node(n.borderTop),r=e.node(n.borderBottom),s=e.node(n.borderLeft[n.borderLeft.length-1]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-s.x),n.height=Math.abs(r.y-i.y),n.x=s.x+n.width/2,n.y=i.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy==="border"&&e.removeNode(t)})}function TGt(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function _Gt(e){WT(e).forEach(t=>{let n=0;t.forEach((i,r)=>{let s=e.node(i);s.order=r+n,(s.selfEdges||[]).forEach(o=>{OO(e,"selfedge",{width:o.label.width,height:o.label.height,rank:s.rank,order:r+ ++n,e:o.e,label:o.label},"_se")}),delete s.selfEdges})})}function jGt(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy==="selfedge"){let i=n,r=e.node(i.e.v),s=r.x+r.width/2,o=r.y,l=n.x-s,c=r.height/2;e.setEdge(i.e,i.label),e.removeNode(t),i.label.points=[{x:s+2*l/3,y:o-c},{x:s+5*l/6,y:o-c},{x:s+l,y:o},{x:s+5*l/6,y:o+c},{x:s+2*l/3,y:o+c}],i.label.x=n.x,i.label.y=n.y}})}function o6(e,t){return _L(RP(e,t),Number)}function l6(e){let t={};return e&&Object.entries(e).forEach(([n,i])=>{typeof n=="string"&&(n=n.toLowerCase()),t[n]=i}),t}function NGt(e){let t=WT(e),n=new Md({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(i=>{n.setNode(i,{label:i}),n.setParent(i,"layer"+e.node(i).rank)}),e.edges().forEach(i=>n.setEdge(i.v,i.w,{},i.name)),t.forEach((i,r)=>{let s="layer"+r;n.setNode(s,{rank:"same"}),i.reduce((o,l)=>(n.setEdge(o,l,{style:"invis"}),l))}),n}var RGt={graphlib:TBe,version:zWt,layout:lGt,debug:NGt,util:{time:BBe,notime:UBe}},_oe=RGt;/*! For license information please see dagre.esm.js.LEGAL.txt */const ES={llm:{labelKey:"buildCanvas.patterns.llm.label",descriptionKey:"buildCanvas.patterns.llm.description",icon:$je},sequential:{labelKey:"buildCanvas.patterns.sequential.label",descriptionKey:"buildCanvas.patterns.sequential.description",icon:Qat},parallel:{labelKey:"buildCanvas.patterns.parallel.label",descriptionKey:"buildCanvas.patterns.parallel.description",icon:Oat},loop:{labelKey:"buildCanvas.patterns.loop.label",descriptionKey:"buildCanvas.patterns.loop.description",icon:zje},a2a:{labelKey:"buildCanvas.patterns.a2a.label",descriptionKey:"buildCanvas.patterns.a2a.description",icon:nM}},Q7=220,z7=88,joe=96,Noe=34,NE=64,c6=310,Hx=24,JBe=56,V7=40,Roe=40,IGt=18,PGt=58,DGt=!1,MGt=e=>e==="sequential"||e==="parallel"||e==="loop";function H7(e,t){const n=e.agentType??"llm";return MGt(n)||n==="llm"&&(t.length===0||e.subAgents.length>0)}function q7(e,t=[],n="horizontal",i=!1){const r=e.agentType??"llm";if(!H7(e,t))return{width:Q7,height:z7};if(i&&e.subAgents.length===0)return{width:c6,height:NE};const s=e.subAgents.map((f,h)=>q7(f,[...t,h],n,i)),o=s.length?Math.max(...s.map(f=>f.width)):0,l=s.length?Math.max(...s.map(f=>f.height)):0,c=s.length&&r!=="parallel"?JBe:Hx,u=n==="horizontal"?r!=="parallel":r==="parallel",d=s.length?r==="parallel"?IGt+Roe:r==="loop"?PGt:0:Roe;return u?{width:Math.max(c6,s.reduce((f,h)=>f+h.width,0)+V7*Math.max(0,s.length-1)+c*2),height:NE+Hx+l+d+Hx}:{width:Math.max(c6,o+Hx*2),height:NE+c+s.reduce((f,h)=>f+h.height,0)+V7*Math.max(0,s.length-1)+d+c}}function Ik(e){return e.length===0?"agent-root":`agent-${e.join("-")}`}function LGt(e,t){return e.length===t.length&&e.every((n,i)=>n===t[i])}function Ioe(e){const t=n=>[n.agentType??"llm",n.subAgents.map(t)];return JSON.stringify(t(e))}function Pk(e,t,n,i){const r=(i==null?void 0:i.tone)==="sequential"?"hsl(213 40% 40%)":(i==null?void 0:i.tone)==="loop"?"hsl(151 34% 34%)":"hsl(220 9% 38%)";return{id:`${e}-${t}${i!=null&&i.loop?"-loop":""}`,source:e,target:t,sourceHandle:i!=null&&i.loop?"loop-source":void 0,targetHandle:i!=null&&i.loop?"loop-target":void 0,label:n,type:"insertStep",data:i?{insert:i.insert,loop:i.loop,tone:i.tone}:void 0,animated:i==null?void 0:i.loop,markerEnd:{type:cA.ArrowClosed,width:16,height:16,color:r},style:{stroke:r,strokeWidth:1.5},labelStyle:{fill:"hsl(215 14% 42%)",fontSize:10,fontWeight:600},labelBgStyle:{fill:"hsl(var(--background))",fillOpacity:.92}}}function Poe(e,t,n=!1,i){const r=[{id:"terminal-input",type:"terminal",position:{x:0,y:0},data:{kind:"terminal",title:i("buildCanvas.terminals.input")},selectable:!1,draggable:!1},{id:"terminal-output",type:"terminal",position:{x:0,y:0},data:{kind:"terminal",title:i("buildCanvas.terminals.output")},selectable:!1,draggable:!1}],s=[];function o(f,h,m,g,b){const v=f.agentType??"llm",y=Ik(h);return H7(f,h)?(l(f,h,m,g,b),y):(r.push({id:y,type:"agent",parentId:m,extent:"parent",position:g,data:{kind:"agent",path:h,agent:f,title:v==="a2a"?i("buildCanvas.patterns.a2a.label"):f.name.trim()||(h.length===0?i("buildCanvas.rootAgent"):i("buildCanvas.unnamedStep")),pattern:v,description:f.description.trim()||i(ES[v].descriptionKey),childCount:f.subAgents.length,containedIn:b}}),y)}function l(f,h,m,g={x:0,y:0},b){const v=f.agentType??"sequential",y=Ik(h),w=q7(f,h,t,n);r.push({id:y,type:"group",parentId:m,extent:m?"parent":void 0,position:g,style:{width:w.width,height:w.height},data:{kind:"agent",path:h,agent:f,title:f.name.trim()||(h.length===0?i("buildCanvas.rootAgent"):i(ES[v].labelKey)),pattern:v,description:f.description.trim()||i(ES[v].descriptionKey),childCount:f.subAgents.length,containedIn:b,layoutWidth:w.width,layoutHeight:w.height,compactEmptyGroup:n&&f.subAgents.length===0}});const x=f.subAgents.map((E,j)=>q7(E,[...h,j],t,n)),O=x.length&&v!=="parallel"?JBe:Hx,k=t==="horizontal"?v!=="parallel":v==="parallel";let S=O;const C=f.subAgents.map((E,j)=>{const T=x[j],R=k?{x:S,y:NE+Hx}:{x:(w.width-T.width)/2,y:NE+S};return S+=(k?T.width:T.height)+V7,o(E,[...h,j],y,R,v)});if(v==="sequential"||v==="loop"){for(let E=0;E1&&s.push(Pk(C[C.length-1],C[0],i("buildCanvas.edges.continueLoop"),{loop:!0,tone:"loop"}))}return y}const c=(f,h)=>{const m=f.agentType??"llm",g=Ik(h);if(H7(f,h))return l(f,h),[g];if(r.push({id:g,type:"agent",position:{x:0,y:0},data:{kind:"agent",path:h,agent:f,title:m==="a2a"?i("buildCanvas.patterns.a2a.label"):f.name.trim()||(h.length===0?i("buildCanvas.rootAgent"):i("buildCanvas.unnamedStep")),pattern:m,description:f.description.trim()||i(ES[m].descriptionKey),childCount:f.subAgents.length}}),f.subAgents.length===0)return[g];const b=[];return f.subAgents.forEach((v,y)=>{const w=[...h,y],x=Ik(w);s.push(Pk(g,x,i("buildCanvas.edges.call"),{insert:{parentPath:h,index:y}})),b.push(...c(v,w))}),b},u=Ik([]),d=c(e,[]);return s.push(Pk("terminal-input",u)),d.forEach(f=>s.push(Pk(f,"terminal-output"))),$Gt(r,s,t)}function $Gt(e,t,n){const i=new _oe.graphlib.Graph().setDefaultEdgeLabel(()=>({}));i.setGraph({rankdir:n==="vertical"?"TB":"LR",ranksep:50,nodesep:34,edgesep:14,marginx:24,marginy:24});const r=new Set(e.filter(s=>!s.parentId).map(s=>s.id));return e.filter(s=>!s.parentId).forEach(s=>{const o=s.data.kind==="terminal";i.setNode(s.id,{width:o?joe:s.data.layoutWidth??Q7,height:o?Noe:s.data.layoutHeight??z7})}),t.filter(s=>r.has(s.source)&&r.has(s.target)).forEach(s=>i.setEdge(s.source,s.target)),_oe.layout(i),{nodes:e.map(s=>{if(s.parentId)return s;const o=i.node(s.id),l=s.data.kind==="terminal",c=l?joe:s.data.layoutWidth??Q7,u=l?Noe:s.data.layoutHeight??z7;return{...s,position:{x:o.x-c/2,y:o.y-u/2}}}),edges:t}}const NL=p.createContext(null),RL=p.createContext("horizontal");function FGt({id:e,sourceX:t,sourceY:n,targetX:i,targetY:r,sourcePosition:s,targetPosition:o,markerEnd:l,style:c,label:u,data:d}){const{t:f}=Te("create"),h=p.useContext(NL),[m,g]=p.useState(!1),[b,v,y]=TP({sourceX:t,sourceY:n,targetX:i,targetY:r,sourcePosition:s,targetPosition:o,offset:d!=null&&d.loop?28:20});return a.jsxs(a.Fragment,{children:[a.jsx(qT,{id:e,path:b,markerEnd:l,style:c}),h&&(d==null?void 0:d.insert)&&a.jsx("path",{d:b,className:"abc-edge-hover-path",onPointerEnter:()=>g(!0),onPointerLeave:()=>g(!1)}),(u||h&&(d==null?void 0:d.insert))&&a.jsx(Nqt,{children:a.jsxs("div",{className:`abc-edge-tools${h&&(d!=null&&d.insert)?" can-insert":""}${m?" is-visible":""}`,style:{transform:`translate(-50%, -50%) translate(${v}px, ${y}px)`},onPointerEnter:()=>g(!0),onPointerLeave:()=>g(!1),children:[u&&a.jsx("span",{className:"abc-edge-label",children:u}),h&&(d==null?void 0:d.insert)&&a.jsx("button",{type:"button",className:"abc-edge-add nodrag nopan","aria-label":f("buildCanvas.actions.insertHere"),title:f("buildCanvas.actions.insertHere"),onClick:w=>{w.stopPropagation(),h==null||h.onInsert(d.insert.parentPath,d.insert.index)},children:a.jsx(ic,{})})]})})]})}function BGt({data:e,selected:t}){const{t:n}=Te("create"),i=p.useContext(NL),r=p.useContext(RL),s=r==="vertical"?vn.Top:vn.Left,o=r==="vertical"?vn.Bottom:vn.Right,l=r==="vertical"?vn.Right:vn.Bottom,c=e.pattern??"llm",u=ES[c],d=u.icon;return a.jsxs("div",{className:`abc-node is-${c}${e.containedIn?` is-contained-in-${e.containedIn}`:""}${t?" is-selected":""}`,children:[a.jsx(Fc,{type:"target",position:s,className:"abc-handle"}),c!=="llm"&&a.jsx("span",{className:"abc-node-icon",children:a.jsx(d,{})}),a.jsxs("span",{className:"abc-node-copy",children:[a.jsx("span",{className:"abc-node-meta",children:a.jsx("span",{children:n(u.labelKey)})}),a.jsx("strong",{children:e.title}),a.jsx("small",{children:e.description})]}),i&&e.path!==void 0&&e.path.length>0&&a.jsx("button",{type:"button",className:"abc-node-delete nodrag nopan","aria-label":n("buildCanvas.actions.deleteNamed",{name:e.title}),title:n("buildCanvas.actions.deleteNode"),onClick:f=>{f.stopPropagation(),i==null||i.onDelete(e.path)},children:a.jsx(eb,{})}),a.jsx(Fc,{type:"source",position:o,className:"abc-handle"}),e.containedIn==="loop"&&a.jsxs(a.Fragment,{children:[a.jsx(Fc,{id:"loop-target",type:"target",position:l,className:"abc-handle abc-loop-handle"}),a.jsx(Fc,{id:"loop-source",type:"source",position:l,className:"abc-handle abc-loop-handle"})]})]})}function UGt({data:e,selected:t}){const{t:n}=Te("create"),i=p.useContext(NL),r=p.useContext(RL),s=r==="vertical"?vn.Top:vn.Left,o=r==="vertical"?vn.Bottom:vn.Right,l=r==="vertical"?vn.Right:vn.Bottom,c=e.pattern??"sequential",u=e.childCount??0,d=n(c==="llm"?"buildCanvas.actions.addSubagent":c==="parallel"?"buildCanvas.actions.addParallelStep":c==="loop"?"buildCanvas.actions.addLoopStep":"buildCanvas.actions.addNextStep");return a.jsxs("div",{className:`abc-group is-${c}${e.compactEmptyGroup?" is-compact-empty":""}${t?" is-selected":""}`,children:[a.jsx(Fc,{type:"target",position:s,className:"abc-handle"}),a.jsx("header",{className:"abc-group-head",children:a.jsxs("span",{children:[a.jsx("strong",{title:e.title,children:e.title}),a.jsx("small",{children:e.description})]})}),i&&e.path!==void 0&&u>0&&c!=="parallel"&&a.jsxs("div",{className:"abc-group-boundary-actions",children:[a.jsx("button",{type:"button",className:"abc-group-boundary-add is-start nodrag nopan","aria-label":n("buildCanvas.actions.addFirst"),title:n("buildCanvas.actions.addFirst"),onClick:f=>{f.stopPropagation(),i.onInsert(e.path,0)},children:a.jsx(ic,{})}),a.jsx("button",{type:"button",className:"abc-group-boundary-add is-end nodrag nopan","aria-label":n("buildCanvas.actions.addLast"),title:n("buildCanvas.actions.addLast"),onClick:f=>{f.stopPropagation(),i.onAdd(e.path)},children:a.jsx(ic,{})})]}),i&&e.path!==void 0&&u>0&&c==="parallel"&&a.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-bottom nodrag nopan",onClick:f=>{f.stopPropagation(),i.onAdd(e.path)},children:[a.jsx(ic,{}),a.jsx("span",{children:d})]}),i&&e.path!==void 0&&u===0&&a.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-empty nodrag nopan",onClick:f=>{f.stopPropagation(),i.onAdd(e.path)},children:[a.jsx(ic,{}),a.jsx("span",{children:d})]}),i&&e.path!==void 0&&e.path.length>0&&a.jsx("button",{type:"button",className:"abc-node-delete nodrag nopan","aria-label":n("buildCanvas.actions.deleteNamed",{name:e.title}),title:n("buildCanvas.actions.deleteNode"),onClick:f=>{f.stopPropagation(),i==null||i.onDelete(e.path)},children:a.jsx(eb,{})}),a.jsx(Fc,{type:"source",position:o,className:"abc-handle"}),e.containedIn==="loop"&&a.jsxs(a.Fragment,{children:[a.jsx(Fc,{id:"loop-target",type:"target",position:l,className:"abc-handle abc-loop-handle"}),a.jsx(Fc,{id:"loop-source",type:"source",position:l,className:"abc-handle abc-loop-handle"})]})]})}function QGt({data:e}){const t=p.useContext(RL);return a.jsxs("div",{className:"abc-terminal",children:[a.jsx(Fc,{type:"target",position:t==="vertical"?vn.Top:vn.Left,className:"abc-handle"}),a.jsx("span",{children:e.title}),a.jsx(Fc,{type:"source",position:t==="vertical"?vn.Bottom:vn.Right,className:"abc-handle"})]})}const zGt={agent:BGt,group:UGt,terminal:QGt},VGt={insertStep:FGt};function HGt({draft:e,selectedPath:t,onSelect:n,onAdd:i,onInsert:r,onDelete:s,readOnly:o=!1,interactivePreview:l=!1,direction:c="horizontal"}){const{t:u}=Te("create"),d=p.useMemo(()=>Poe(e,c,o,u),[]),[f,h,m]=Rqt(d.nodes),[g,b,v]=Iqt(d.edges),y=Dqt(),w=p.useRef(`${c}:${o?"readonly":"editable"}:${Ioe(e)}`),x=p.useRef(null),{fitView:O}=AL(),k=p.useMemo(()=>Poe(e,c,o,u),[c,e,o,u]),[S,C]=p.useState(()=>window.matchMedia("(max-width: 860px)").matches),E=p.useMemo(()=>o?{padding:.16,minZoom:.05,maxZoom:.9}:S?{padding:.08,minZoom:.35,maxZoom:.9}:{padding:.14,minZoom:.42,maxZoom:1.1},[S,o]),j=p.useCallback((R=0)=>{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{const A=x.current;if(A&&(A.clientWidth===0||A.clientHeight===0)&&R<8){j(R+1);return}O(E)})})},[E,O]);p.useEffect(()=>{const R=window.matchMedia("(max-width: 860px)"),A=N=>C(N.matches);return R.addEventListener("change",A),()=>R.removeEventListener("change",A)},[]),p.useEffect(()=>{const R=`${c}:${o?"readonly":"editable"}:${Ioe(e)}`,A=R!==w.current;w.current=R,b(k.edges),h(N=>{const D=new Map(N.map(I=>[I.id,I]));return k.nodes.map(I=>{const P=D.get(I.id);return{...I,measured:!A&&P&&P.type===I.type?P.measured:void 0,position:!A&&P?P.position:I.position,selected:I.data.kind==="agent"&&!!I.data.path&&LGt(I.data.path,t)}})}),A&&j()},[k,e,j,t,b,h]),p.useEffect(()=>{j()},[S,j]),p.useEffect(()=>{y&&j()},[k,j,y]),p.useEffect(()=>{if(!o||!x.current)return;const R=new ResizeObserver(()=>j());return R.observe(x.current),j(),()=>R.disconnect()},[j,o]);const T=p.useMemo(()=>o?null:{onAdd:i,onInsert:r,onDelete:s},[i,s,r,o]);return a.jsx(RL.Provider,{value:c,children:a.jsx(NL.Provider,{value:T,children:a.jsx("section",{className:`abc-root is-${c}${o?" is-readonly":""}`,"aria-label":u(o?"buildCanvas.readOnlyLabel":"buildCanvas.label"),children:a.jsx("div",{ref:x,className:"abc-canvas",children:a.jsxs(_qt,{nodes:f,edges:g,nodeTypes:zGt,edgeTypes:VGt,onNodesChange:m,onEdgesChange:v,onNodeClick:(R,A)=>{!o&&A.data.kind==="agent"&&A.data.path&&n(A.data.path)},nodesDraggable:!o,nodesConnectable:!1,nodesFocusable:!o,elementsSelectable:!o,edgesFocusable:!1,edgesReconnectable:!1,panOnDrag:!o||l,zoomOnDoubleClick:l,zoomOnPinch:!o||l,zoomOnScroll:!o||l,fitView:!0,fitViewOptions:E,onInit:()=>j(),minZoom:o?.05:.35,maxZoom:1.6,proOptions:{hideAttribution:!0},ariaLabelConfig:{"controls.ariaLabel":u("buildCanvas.controls.ariaLabel"),"controls.zoomIn.ariaLabel":u("buildCanvas.controls.zoomIn"),"controls.zoomOut.ariaLabel":u("buildCanvas.controls.zoomOut"),"controls.fitView.ariaLabel":u("buildCanvas.controls.fitView")},children:[a.jsx(Bqt,{gap:20,size:1.2,color:"hsl(34 20% 82%)"}),(!o||l)&&a.jsx(Wqt,{showInteractive:!1}),DGt]})})})})})}function IP(e){return a.jsx(kBe,{children:a.jsx(HGt,{...e})})}function qGt(e){return[{id:"case-1",itemKey:"case-1",kind:"good",input:e("agentWorkspace.defaultCases.weeklyFeedback.input"),output:e("agentWorkspace.defaultCases.weeklyFeedback.output"),referenceOutput:e("agentWorkspace.defaultCases.weeklyFeedback.output"),comment:"",agentName:e("agentWorkspace.defaultCases.agentName"),sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T09:12:00+08:00",evaluationSetId:"",evaluationSetName:e("agentWorkspace.defaultCases.goodSetName"),workspaceId:"",tag:e("agentWorkspace.defaultCases.weeklyFeedback.tag"),source:"auto",score:.92,reason:e("agentWorkspace.defaultCases.weeklyFeedback.reason")},{id:"case-2",itemKey:"case-2",kind:"good",input:e("agentWorkspace.defaultCases.research.input"),output:e("agentWorkspace.defaultCases.research.output"),referenceOutput:e("agentWorkspace.defaultCases.research.output"),comment:"",agentName:e("agentWorkspace.defaultCases.agentName"),sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T08:47:00+08:00",evaluationSetId:"",evaluationSetName:e("agentWorkspace.defaultCases.goodSetName"),workspaceId:"",tag:e("agentWorkspace.defaultCases.research.tag"),source:"user"},{id:"case-3",itemKey:"case-3",kind:"bad",input:e("agentWorkspace.defaultCases.uncertainConclusion.input"),output:e("agentWorkspace.defaultCases.uncertainConclusion.output"),referenceOutput:"",comment:"",agentName:e("agentWorkspace.defaultCases.agentName"),sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T07:35:00+08:00",evaluationSetId:"",evaluationSetName:e("agentWorkspace.defaultCases.badSetName"),workspaceId:"",tag:e("agentWorkspace.defaultCases.uncertainConclusion.tag"),source:"auto",score:.28,reason:e("agentWorkspace.defaultCases.uncertainConclusion.reason")},{id:"case-4",itemKey:"case-4",kind:"bad",input:e("agentWorkspace.defaultCases.repeatedTool.input"),output:e("agentWorkspace.defaultCases.repeatedTool.output"),referenceOutput:"",comment:"",agentName:e("agentWorkspace.defaultCases.agentName"),sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T06:58:00+08:00",evaluationSetId:"",evaluationSetName:e("agentWorkspace.defaultCases.badSetName"),workspaceId:"",tag:e("agentWorkspace.defaultCases.repeatedTool.tag"),source:"user"}]}const WGt=[{id:"eval-regression",name:"核心能力回归",agentIds:[],caseSet:"核心回归集",evaluator:"综合质量评估器",metrics:["回答质量","工具调用"],concurrency:"4",history:[{id:"run-1",createdAt:"今天 10:32",score:88,status:"completed"},{id:"run-2",createdAt:"昨天 16:08",score:84,status:"completed"}]},{id:"eval-safety",name:"安全与幻觉检查",agentIds:[],caseSet:"安全边界集",evaluator:"事实一致性评估器",metrics:["事实准确性","拒答合理性"],concurrency:"2",history:[{id:"run-3",createdAt:"7 月 25 日 14:20",score:91,status:"completed"}]}],KGt={核心能力回归:"agentWorkspace.evaluationDefaults.coreRegression",安全与幻觉检查:"agentWorkspace.evaluationDefaults.safetyCheck",核心回归集:"agentWorkspace.evaluationDefaults.coreSet",安全边界集:"agentWorkspace.evaluationDefaults.safetySet",工具调用集:"agentWorkspace.evaluationDefaults.toolSet",综合质量评估器:"agentWorkspace.evaluationDefaults.qualityEvaluator",事实一致性评估器:"agentWorkspace.evaluationDefaults.factualEvaluator",工具调用评估器:"agentWorkspace.evaluationDefaults.toolEvaluator",回答质量:"agentWorkspace.evaluationDefaults.responseQuality",事实准确性:"agentWorkspace.evaluationDefaults.factualAccuracy",工具调用:"agentWorkspace.evaluationDefaults.toolUse",响应效率:"agentWorkspace.evaluationDefaults.responseEfficiency","今天 10:32":"agentWorkspace.evaluationDefaults.todayTime","昨天 16:08":"agentWorkspace.evaluationDefaults.yesterdayTime","7 月 25 日 14:20":"agentWorkspace.evaluationDefaults.julyTime",刚刚:"agentWorkspace.evaluationDefaults.justNow"};function CS(e,t){const n=KGt[e];return n?t(n):e}const GGt=["basic","profileConfig","sessionConfig","usage","diagnostics","evaluations","optimizations","integrations","versions"],XGt=20;function e9e(e,t,n){const i=Date.parse(e);return Number.isNaN(i)?n("agentWorkspace.notProvided"):new Intl.DateTimeFormat(t,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).format(i)}const Dk=[{id:"api-server",label:"API Server"},{id:"a2a",label:"A2A"}];function t9e(e){if(!e||typeof e!="object")return"";const t=e.id;return typeof t=="string"?t:""}function px(e){var t;return t9e((t=e==null?void 0:e.effectiveRefs)==null?void 0:t.model)}function Doe(e,t){var r;const n=(r=e==null?void 0:e.overrides)==null?void 0:r[t];if(!n||typeof n!="object")return"";const i=n.mode;return i==="replace"||i==="clear"||i==="inherit"?i:""}function n9e(e){var n;const t=(n=e==null?void 0:e.effectiveRefs)==null?void 0:n.mcpServers;return Array.isArray(t)?t.map(t9e).filter(Boolean):[]}function YGt(e,t){switch(e){case"active_operation":return t("agentWorkspace.mpaDeleteBlockerActiveOperation");case"active_sessions":return t("agentWorkspace.mpaDeleteBlockerActiveSessions");case"binding_ambiguous":return t("agentWorkspace.mpaDeleteBlockerBindingAmbiguous");case"runtime_missing":return t("agentWorkspace.mpaDeleteBlockerRuntimeMissing");case"orphan_runtime":return t("agentWorkspace.mpaDeleteBlockerOrphanRuntime");default:return e}}function ZGt(e,t){switch(e){case"runtime_legacy_auth_unsupported":return t("agentWorkspace.mpaRuntimeLegacyAuthUnsupported");case"profile_not_found":return t("agentWorkspace.mpaRuntimeOrphan");case"binding_ambiguous":return t("agentWorkspace.mpaRuntimeBindingAmbiguous");case"runtime_missing":return t("agentWorkspace.mpaRuntimeMissing");default:return e??""}}function JGt({preview:e,t}){const n=e.blockers.map(i=>YGt(i,t));return a.jsxs("div",{className:"aw-mpa-delete-preview",children:[a.jsx("p",{children:t("agentWorkspace.mpaDeletePreviewSummary")}),a.jsxs("dl",{className:"aw-mpa-delete-preview__stats",children:[a.jsxs("div",{children:[a.jsx("dt",{children:t("agentWorkspace.mpaDeletePreviewSessions")}),a.jsx("dd",{children:e.sessionCounts.total})]}),a.jsxs("div",{children:[a.jsx("dt",{children:t("agentWorkspace.mpaDeletePreviewActiveSessions")}),a.jsx("dd",{children:e.sessionCounts.active})]}),a.jsxs("div",{children:[a.jsx("dt",{children:t("agentWorkspace.mpaDeletePreviewIdleSessions")}),a.jsx("dd",{children:e.sessionCounts.idle})]})]}),n.length>0?a.jsxs("div",{className:"aw-mpa-delete-preview__blockers",role:"status",children:[a.jsx("strong",{children:t("agentWorkspace.mpaDeleteBlocked")}),a.jsx("ul",{children:n.map(i=>a.jsx("li",{children:i},i))})]}):a.jsx("ol",{className:"aw-mpa-delete-preview__plan",children:e.cleanupPlan.map(i=>a.jsx("li",{children:t(`agentWorkspace.mpaDeleteStage.${i.stage}`,{count:i.count})},i.stage))})]})}function u6(e,t){return e instanceof iw&&e.status===412?t:e instanceof Error?e.message:String(e)}function eXt(e){return n9e(e).length}function Moe(e,t){const n=n9e(e);return n.length?n.join(", "):t("agentWorkspace.none")}function Loe(e,t){var n;return!!((n=e==null?void 0:e.overrides)!=null&&n[t])}function tXt(e,t,n){return`mpa-session-profile-upgrade:${e}:${t}:${n}`}function d6(e,t){return e?`${e.replace(/\/+$/,"")}${t}`:""}function nXt(e,t){const n=e.trim();if(!n||!t)return n;try{const i=new URL(n),r=i.hostname.replace(/^\[|\]$/g,"").toLowerCase();if(!["localhost","127.0.0.1","::1"].includes(r))return n;const s=new URL(t);return i.protocol=s.protocol,i.hostname=s.hostname,i.port=s.port,i.toString()}catch{return n}}function $oe(e,t){return e==="key_auth"?"API Key":e==="custom_jwt"?"OAuth / JWT":t(e==="none"?"agentWorkspace.noAuthentication":"agentWorkspace.notAvailable")}function Foe(e,t){return t(e==="published"?"agentWorkspace.githubStatus.published":e==="publishing"?"agentWorkspace.githubStatus.publishing":e==="failed"?"agentWorkspace.githubStatus.failed":e==="pending"?"agentWorkspace.githubStatus.pending":"agentWorkspace.githubStatus.unknown")}function iXt(e,t){return e.changeType==="rollback"?t("agentWorkspace.rollbackEvent"):e.version}function W7(e){return JSON.stringify(e)}function i9e(e){return e==="key_auth"?`API_KEY = "" HEADERS = {"Authorization": f"Bearer {API_KEY}"}`:e==="custom_jwt"?`ACCESS_TOKEN = "" HEADERS = {"Authorization": f"Bearer {ACCESS_TOKEN}"}`:e==="none"?"HEADERS = {}":`AUTH_TOKEN = "" -HEADERS = {"Authorization": f"Bearer {AUTH_TOKEN}"}`}function nXt(e,t,n){const i=e.replace(/\/+$/,"");return`\`\`\`python +HEADERS = {"Authorization": f"Bearer {AUTH_TOKEN}"}`}function rXt(e,t,n){const i=e.replace(/\/+$/,"");return`\`\`\`python import uuid import requests -BASE_URL = ${q7(i)} -APP_NAME = ${q7(t)} +BASE_URL = ${W7(i)} +APP_NAME = ${W7(t)} USER_ID = "demo-user" SESSION_ID = str(uuid.uuid4()) -${n9e(n)} +${i9e(n)} session_response = requests.post( f"{BASE_URL}/apps/{APP_NAME}/users/{USER_ID}/sessions/{SESSION_ID}", @@ -819,13 +819,13 @@ with requests.post( for line in response.iter_lines(): if line: print(line.decode("utf-8")) -\`\`\``}function iXt(e,t){return`\`\`\`python +\`\`\``}function sXt(e,t){return`\`\`\`python import uuid import requests -AGENT_URL = ${q7(e)} -${n9e(t)} +AGENT_URL = ${W7(e)} +${i9e(t)} response = requests.post( AGENT_URL, @@ -846,23 +846,23 @@ response = requests.post( ) response.raise_for_status() print(response.json()) -\`\`\``}function rXt({visible:e}){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M2.8 12s3.3-5.4 9.2-5.4 9.2 5.4 9.2 5.4-3.3 5.4-9.2 5.4S2.8 12 2.8 12Z"}),a.jsx("circle",{cx:"12",cy:"12",r:"2.4"}),!e&&a.jsx("path",{d:"m4.2 4.2 15.6 15.6"})]})}function Foe({available:e,authType:t,value:n,visible:i,loading:r,error:s,onToggle:o}){const{t:l}=Te("ui");return e?t==="none"?l("agentWorkspace.noApiKeyRequired"):t==="custom_jwt"?l("agentWorkspace.usesOauthJwt"):t!=="key_auth"?l("agentWorkspace.notAvailable"):a.jsxs("span",{className:"aw-integration-secret",children:[a.jsx("span",{className:"aw-integration-secret-value","aria-live":"polite",children:i&&n?n:"****"}),a.jsx("button",{type:"button",className:"aw-integration-secret-toggle","aria-label":l(i?"agentWorkspace.hideApiKey":"agentWorkspace.showApiKey"),title:l(i?"agentWorkspace.hideApiKey":"agentWorkspace.showApiKey"),disabled:r,onClick:o,children:r?a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}):a.jsx(rXt,{visible:i})}),s&&a.jsx("span",{className:"aw-integration-secret-error",role:"alert",children:s})]}):l("agentWorkspace.notAvailable")}function Boe({protocol:e,title:t,available:n,fields:i,example:r}){const{t:s}=Te("ui");return a.jsxs("section",{className:`aw-integration-panel${n&&r?" has-example":""}`,id:`integration-${e}-panel`,role:"tabpanel","aria-labelledby":`integration-${e}-tab`,children:[a.jsx("header",{children:a.jsx("h3",{children:t})}),a.jsx("dl",{children:i.map(o=>a.jsxs("div",{children:[a.jsx("dt",{children:o.label}),a.jsx("dd",{children:o.value||s("agentWorkspace.notAvailable")})]},o.label))}),n&&r&&a.jsxs("section",{className:"aw-integration-example",children:[a.jsx("h4",{children:s("agentWorkspace.pythonExample")}),a.jsx(Td,{text:r,className:"aw-integration-example-code",allowRawHtml:!1})]})]})}function Hv(e,t){const n=(e??[]).flatMap(i=>{const r=i.name??i.id??i.skillId??i.source;return typeof r=="string"&&r.trim()?[r.trim()]:[]});return n.length?n.join(", "):t}function W7(e){return Array.isArray(e)?`[${e.map(W7).join(",")}]`:e&&typeof e=="object"?`{${Object.entries(e).filter(([,n])=>n!==void 0).sort(([n],[i])=>n.localeCompare(i)).map(([n,i])=>`${JSON.stringify(n)}:${W7(i)}`).join(",")}}`:JSON.stringify(e)}async function sXt(e,t,n){const i=new TextEncoder().encode(W7(n)),r=await crypto.subtle.digest("SHA-256",i),s=Array.from(new Uint8Array(r),o=>o.toString(16).padStart(2,"0")).join("");return`mpa-profile:${e}:${t}:${s}`}function aXt({profile:e,profileStatus:t,runtimeReady:n,disabledReason:i,saving:r,error:s,notice:o,onApply:l,onEditProfile:c,onRefresh:u}){var m;const{t:d}=Te("ui"),f=(t==null?void 0:t.status)==="applied",h=n&&!r;return a.jsxs("section",{className:"aw-session-config aw-profile-config","aria-busy":r,children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:d("agentWorkspace.profileConfigTitle")}),a.jsx("p",{children:d("agentWorkspace.profileConfigDescription")})]}),i?a.jsx("div",{className:"aw-session-config-state",children:i}):a.jsxs(a.Fragment,{children:[s&&a.jsxs("div",{className:"aw-session-config-state is-error",role:"alert",children:[a.jsx("span",{children:s}),a.jsx("button",{type:"button",onClick:u,disabled:r,children:d("common.retry")})]}),o&&!s&&a.jsx("div",{className:"aw-session-config-notice",role:"status",children:o}),a.jsxs("div",{className:"aw-session-config-actions",children:[a.jsx("button",{type:"button",onClick:c,disabled:r,children:d("agentWorkspace.editProfile")}),a.jsx("button",{type:"button",onClick:u,disabled:r,children:d("common.refresh")})]}),a.jsxs("dl",{className:"aw-session-config-grid",children:[a.jsxs("div",{children:[a.jsx("dt",{children:d("agentWorkspace.profileStatus")}),a.jsx("dd",{children:d(f?"agentWorkspace.profileApplied":"agentWorkspace.profileNotApplied")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:d("agentWorkspace.latestProfileRevision")}),a.jsx("dd",{children:(t==null?void 0:t.profileRevision)??d("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:d("agentWorkspace.modelId")}),a.jsx("dd",{children:String(((m=e.model)==null?void 0:m.id)||d("agentWorkspace.notAvailable"))})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"ETag"}),a.jsx("dd",{children:(t==null?void 0:t.etag)||d("agentWorkspace.notAvailable")})]})]}),!f&&a.jsxs("div",{className:"aw-session-config-upgrade",role:"status",children:[a.jsx("span",{children:d("agentWorkspace.profileNotAppliedDescription")}),a.jsx("button",{type:"button",onClick:l,disabled:!h,children:d(r?"agentWorkspace.profileApplying":"agentWorkspace.applyProfile")})]}),f&&a.jsx("div",{className:"aw-session-config-actions",children:a.jsx("button",{type:"button",onClick:l,disabled:!h,children:d(r?"agentWorkspace.profileApplying":"agentWorkspace.reapplyProfile")})}),a.jsx("div",{className:"aw-session-config-card",children:a.jsxs("div",{children:[a.jsx("h4",{children:d("agentWorkspace.profilePrompt")}),a.jsx("p",{children:e.system||d("agentWorkspace.notAvailable")})]})}),a.jsxs("div",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:d("agentWorkspace.profileResources")}),a.jsx("p",{children:d("agentWorkspace.profileResourceSummary",{tools:e.tools.length,skills:e.skills.length,mcp:e.mcpServers.length})})]}),a.jsxs("div",{className:"aw-profile-config-list",children:[a.jsxs("span",{title:Hv(e.tools,d("agentWorkspace.notAvailable")),children:[d("agentSelector.tools"),": ",Hv(e.tools,d("agentWorkspace.notAvailable"))]}),a.jsxs("span",{title:Hv(e.skills,d("agentWorkspace.notAvailable")),children:[d("agentSelector.skills"),": ",Hv(e.skills,d("agentWorkspace.notAvailable"))]}),a.jsxs("span",{title:Hv(e.mcpServers,d("agentWorkspace.notAvailable")),children:["MCP: ",Hv(e.mcpServers,d("agentWorkspace.notAvailable"))]})]})]})]})]})}function oXt({config:e,profileStatus:t,loadable:n,disabledReason:i,loading:r,saving:s,upgrading:o,error:l,notice:c,modelValue:u,modelDirty:d,profileUpgradeAvailable:f,onModelChange:h,onSaveModel:m,onInheritModel:g,onClearMcp:b,onInheritMcp:v,onUpgradeProfile:y,onRefresh:w}){const{t:x}=Te("ui"),O=r||s||o,k=Poe(e,"model"),S=Poe(e,"mcpServers"),C=hx(e),E=(t==null?void 0:t.status)==="applied"?t.profileRevision:null;return a.jsxs("section",{className:"aw-session-config","aria-busy":O,children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:x("agentWorkspace.sessionConfigTitle")}),a.jsx("p",{children:x("agentWorkspace.sessionConfigDescription")})]}),n?r&&!e?a.jsxs("div",{className:"aw-session-config-state",role:"status",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsx("span",{children:x("agentWorkspace.loadingSessionConfig")})]}):a.jsxs(a.Fragment,{children:[l&&a.jsxs("div",{className:"aw-session-config-state is-error",role:"alert",children:[a.jsx("span",{children:l}),a.jsx("button",{type:"button",onClick:w,disabled:O,children:x("common.retry")})]}),c&&!l&&a.jsx("div",{className:"aw-session-config-notice",role:"status",children:c}),e&&a.jsxs(a.Fragment,{children:[a.jsxs("dl",{className:"aw-session-config-grid",children:[a.jsxs("div",{children:[a.jsx("dt",{children:x("agentWorkspace.sessionConfigRevision")}),a.jsx("dd",{children:e.revision})]}),a.jsxs("div",{children:[a.jsx("dt",{children:x("agentWorkspace.sessionProfileRevision")}),a.jsx("dd",{children:e.profileRevision})]}),a.jsxs("div",{children:[a.jsx("dt",{children:x("agentWorkspace.latestProfileRevision")}),a.jsx("dd",{children:E??x("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"ETag"}),a.jsx("dd",{children:e.etag||x("agentWorkspace.notAvailable")})]})]}),f&&E!=null&&a.jsxs("div",{className:"aw-session-config-upgrade",role:"status",children:[a.jsx("span",{children:x("agentWorkspace.sessionProfileUpgradeAvailable",{current:e.profileRevision,target:E})}),a.jsx("button",{type:"button",onClick:y,disabled:O,children:x(o?"agentWorkspace.sessionProfileUpgrading":"agentWorkspace.upgradeSessionProfile")})]}),a.jsxs("div",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:x("agentWorkspace.sessionModelOverride")}),a.jsx("p",{children:x(k?`agentWorkspace.executionConfigMode.${k}`:"agentWorkspace.executionConfigMode.inherit")})]}),a.jsxs("label",{className:"aw-session-config-field",children:[a.jsx("span",{children:x("agentWorkspace.modelId")}),a.jsx("input",{type:"text",value:u,onChange:j=>h(j.currentTarget.value),placeholder:C||x("agentWorkspace.inheritProfileDefault"),disabled:O})]}),a.jsxs("div",{className:"aw-session-config-actions",children:[a.jsx("button",{type:"button",onClick:m,disabled:O||!d,children:x(s?"common.saving":"common.save")}),a.jsx("button",{type:"button",onClick:g,disabled:O||!Moe(e,"model"),children:x("agentWorkspace.inheritProfileDefault")})]})]}),a.jsxs("div",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:x("agentWorkspace.sessionMcpServers")}),a.jsx("p",{children:x(S?`agentWorkspace.executionConfigMode.${S}`:"agentWorkspace.executionConfigMode.inherit")})]}),a.jsxs("div",{className:"aw-session-config-value",children:[a.jsx("span",{children:x("agentWorkspace.mcpServerCount",{count:ZGt(e)})}),a.jsx("small",{title:Doe(e,x),children:Doe(e,x)})]}),a.jsxs("div",{className:"aw-session-config-actions",children:[a.jsx("button",{type:"button",onClick:b,disabled:O||S==="clear",children:x("agentWorkspace.clearSessionMcp")}),a.jsx("button",{type:"button",onClick:v,disabled:O||!Moe(e,"mcpServers"),children:x("agentWorkspace.inheritProfileDefault")})]})]})]})]}):a.jsx("div",{className:"aw-session-config-state",children:i})]})}function Uoe(e,t){const n=e==null?void 0:e[t];return n==null||n===""?"":String(n)}function lXt(e,t){const n=e==null?void 0:e.worker;if(!n||typeof n!="object")return"";const i=n[t];return i==null||i===""?"":String(i)}function cXt(e,t){return typeof e!="number"||!Number.isFinite(e)?t("agentWorkspace.notAvailable"):`${Math.round(e)} ms`}function uXt({data:e,loadable:t,disabledReason:n,loading:i,error:r,onRefresh:s,locale:o}){const{t:l}=Te("ui"),c=(e==null?void 0:e.runs)??[],u=(e==null?void 0:e.trace)??null,d=c[0],f=(u==null?void 0:u.correlation)??{},h=[["mpaInstanceId",l("agentWorkspace.mpaInstanceId")],["profileRevision",l("agentWorkspace.sessionProfileRevision")],["executionConfigRevision",l("agentWorkspace.sessionConfigRevision")],["turnId",l("agentWorkspace.turnId")],["taskId",l("agentWorkspace.taskId")],["runtimeId","Runtime ID"],["runtimeVersion",l("systemInfo.currentVersion")]],m=[["kind",l("agentWorkspace.workerKind")],["sessionId",l("agentWorkspace.workerSession")],["turnId",l("agentWorkspace.workerTurn")],["profileId",l("agentWorkspace.workerProfile")],["profileVersion",l("agentWorkspace.workerProfileVersion")]];return a.jsxs("section",{className:"aw-mpa-diagnostics","aria-busy":i,children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:l("agentWorkspace.mpaDiagnosticsTitle")}),a.jsx("p",{children:l("agentWorkspace.mpaDiagnosticsDescription")})]}),t?i&&!e?a.jsxs("div",{className:"aw-session-config-state",role:"status",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsx("span",{children:l("agentWorkspace.loadingMpaDiagnostics")})]}):r?a.jsxs("div",{className:"aw-session-config-state is-error",role:"alert",children:[a.jsx("span",{children:r}),a.jsx("button",{type:"button",onClick:s,disabled:i,children:l("common.retry")})]}):d?a.jsxs(a.Fragment,{children:[a.jsxs("dl",{className:"aw-session-config-grid",children:[a.jsxs("div",{children:[a.jsx("dt",{children:l("agentWorkspace.latestRun")}),a.jsx("dd",{children:d.invocationId})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("agentSelector.status")}),a.jsx("dd",{children:d.status})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("agentWorkspace.lastUsed")}),a.jsx("dd",{children:JBe(d.startedAt,o,l)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("agentWorkspace.stepCount")}),a.jsx("dd",{children:d.stepCount})]})]}),a.jsxs("section",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:l("agentWorkspace.traceCorrelation")}),a.jsx("p",{children:l("agentWorkspace.traceCorrelationDescription")})]}),a.jsxs("dl",{className:"aw-mpa-correlation",children:[h.map(([g,b])=>a.jsxs("div",{children:[a.jsx("dt",{children:b}),a.jsx("dd",{children:Uoe(f,g)||l("agentWorkspace.notAvailable")})]},g)),m.map(([g,b])=>a.jsxs("div",{children:[a.jsx("dt",{children:b}),a.jsx("dd",{children:lXt(f,g)||l("agentWorkspace.notAvailable")})]},`worker-${g}`))]})]}),a.jsxs("section",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:l("agentWorkspace.traceSteps")}),a.jsx("p",{children:l("agentWorkspace.traceStepsDescription")})]}),u!=null&&u.steps.length?a.jsx("div",{className:"aw-usage-table-wrap",children:a.jsxs("table",{className:"aw-usage-table aw-mpa-trace-table",children:[a.jsx("caption",{children:l("agentWorkspace.traceSteps")}),a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:l("agentWorkspace.step")}),a.jsx("th",{scope:"col",children:l("agentSelector.status")}),a.jsx("th",{scope:"col",children:l("agentWorkspace.duration")}),a.jsx("th",{scope:"col",children:l("agentWorkspace.turnId")})]})}),a.jsx("tbody",{children:u.steps.slice(0,20).map(g=>a.jsxs("tr",{children:[a.jsxs("td",{children:[a.jsx("strong",{children:g.title||g.kind}),a.jsx("small",{children:g.kind})]}),a.jsx("td",{children:g.status}),a.jsx("td",{children:cXt(g.durationMs,l)}),a.jsx("td",{children:Uoe(g.correlation,"turnId")||l("agentWorkspace.notAvailable")})]},g.stepId))})]})}):a.jsx("div",{className:"aw-session-config-value",children:a.jsx("span",{children:l("agentWorkspace.noTraceSteps")})})]})]}):a.jsx("div",{className:"aw-session-config-state",children:l("agentWorkspace.noMpaDiagnostics")}):a.jsx("div",{className:"aw-session-config-state",children:n})]})}function dXt(e,t,n){var i;return fH({appName:((i=e==null?void 0:e.appName)==null?void 0:i.trim())||t,name:e==null?void 0:e.name,description:e==null?void 0:e.description,type:e==null?void 0:e.type,model:e==null?void 0:e.model,tools:e==null?void 0:e.tools,skills:e==null?void 0:e.skills,graph:e==null?void 0:e.graph,draft:e==null?void 0:e.draft},n)}function i9e(e){return e?1+e.children.reduce((t,n)=>t+i9e(n),0):1}function r9e(e){return 1+e.subAgents.reduce((t,n)=>t+r9e(n),0)}function K7(e){if(!e)return 0;const t=Number(e);if(Number.isFinite(t))return t<1e12?t*1e3:t;const n=Date.parse(e);return Number.isFinite(n)?n:0}function fXt(e,t,n){const i=K7(e);return i?new Intl.DateTimeFormat(t,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(i)):n("agentWorkspace.unknownTime")}function hXt(e,t){return typeof e.score!="number"||!Number.isFinite(e.score)?"—":t("agentWorkspace.scoreValue",{score:Math.round(e.score*100)})}function pXt(e,t){return t(`agentWorkspace.priority.${e}`)}const mXt={agent_structure:"agentWorkspace.modules.agentStructure",prompt:"agentWorkspace.modules.prompt",tool:"agentWorkspace.modules.tool",knowledge:"agentWorkspace.modules.knowledge",memory:"agentWorkspace.modules.memory",workflow:"agentWorkspace.modules.workflow",other:"agentWorkspace.modules.other"};function gXt(e,t){var n;return e.module==="other"?((n=e.customModule)==null?void 0:n.trim())||t("agentWorkspace.modules.other"):t(mXt[e.module])}function bXt(e,t){return e.find(n=>n.kind===t)}function Qoe(e,t){return e.items.map(n=>({...n,tag:t(n.kind==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")})).sort((n,i)=>K7(i.createdAt)-K7(n.createdAt))}function yXt(e){const t=n=>[n.name,n.description,n.agentType??"llm",n.modelName??"",n.tools??[],n.builtinTools??[],(n.customTools??[]).map(i=>i.name),(n.mcpTools??[]).map(i=>i.name),n.skills??[],(n.selectedSkills??[]).map(i=>i.name),(n.subAgents??[]).map(t)];return JSON.stringify(t(e))}function vXt(e){return[{phase:"prepare",label:e("agentWorkspace.deploymentSteps.prepare.label"),description:e("agentWorkspace.deploymentSteps.prepare.description")},{phase:"build",label:e("agentWorkspace.deploymentSteps.build.label"),description:e("agentWorkspace.deploymentSteps.build.description")},{phase:"deploy",label:e("agentWorkspace.deploymentSteps.deploy.label"),description:e("agentWorkspace.deploymentSteps.deploy.description")},{phase:"publish",label:e("agentWorkspace.deploymentSteps.publish.label"),description:e("agentWorkspace.deploymentSteps.publish.description")},{phase:"complete",label:e("agentWorkspace.deploymentSteps.complete.label"),description:e("agentWorkspace.deploymentSteps.complete.description")}]}function xXt(e,t){return{phase:"update",label:t("agentWorkspace.deploymentSteps.update.label"),description:t("agentWorkspace.deploymentSteps.update.description",e)}}function s9e(e,t){const n=vXt(t),i=[...n.slice(0,-1)];return e.instanceRange&&i.push(xXt(e.instanceRange,t)),e.createEvaluationSets&&i.push({phase:"evaluation",label:t("agentWorkspace.deploymentSteps.evaluation.label"),description:t("agentWorkspace.deploymentSteps.evaluation.description")}),e.mpaProfile&&(i.push({phase:"profile_applying",label:t("agentWorkspace.deploymentSteps.profileApplying.label"),description:t("agentWorkspace.deploymentSteps.profileApplying.description")}),e.mpaSmoke&&(i.push({phase:"smoke_running",label:t("agentWorkspace.deploymentSteps.smokeRunning.label"),description:t("agentWorkspace.deploymentSteps.smokeRunning.description")}),i.push({phase:"runnable",label:t("agentWorkspace.deploymentSteps.runnable.label"),description:t("agentWorkspace.deploymentSteps.runnable.description")}))),e.githubDelivery&&i.push({phase:"github",label:t("agentWorkspace.deploymentSteps.github.label"),description:t("agentWorkspace.deploymentSteps.github.description")}),i.push(n[n.length-1]),i}function a9e(e,t){const n=s9e(e,t);if(e.status==="success")return n.length-1;const i=e.phase??{准备部署:"prepare",构建镜像:"build",部署:"deploy",发布:"publish",创建评测集:"evaluation","应用 MPA Profile":"profile_applying","验证 MPA Runtime":"smoke_running","MPA Runtime 可运行":"runnable","挂载 GitHub 持续交付":"github",部署完成:"complete"}[e.label],r=n.findIndex(s=>s.phase===i);return r<0?0:r}function wXt(e,t){if(!e)return"";try{return new Intl.DateTimeFormat(t,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(new Date(e))}catch{return""}}function o9e({log:e,autoExpand:t,title:n,ariaLabel:i,copyLabel:r,defaultPendingMessage:s}){const{t:o,i18n:l}=Te("ui"),c=p.useRef(null),u=!!((e==null?void 0:e.status)!=="complete"&&t),[d,f]=p.useState(u),[h,m]=p.useState(!1),g=!!(e!=null&&e.text||e!=null&&e.error),b=(e==null?void 0:e.text)||(e==null?void 0:e.error)||"",v=b.split(` +\`\`\``}function aXt({visible:e}){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M2.8 12s3.3-5.4 9.2-5.4 9.2 5.4 9.2 5.4-3.3 5.4-9.2 5.4S2.8 12 2.8 12Z"}),a.jsx("circle",{cx:"12",cy:"12",r:"2.4"}),!e&&a.jsx("path",{d:"m4.2 4.2 15.6 15.6"})]})}function Boe({available:e,authType:t,value:n,visible:i,loading:r,error:s,onToggle:o}){const{t:l}=Te("ui");return e?t==="none"?l("agentWorkspace.noApiKeyRequired"):t==="custom_jwt"?l("agentWorkspace.usesOauthJwt"):t!=="key_auth"?l("agentWorkspace.notAvailable"):a.jsxs("span",{className:"aw-integration-secret",children:[a.jsx("span",{className:"aw-integration-secret-value","aria-live":"polite",children:i&&n?n:"****"}),a.jsx("button",{type:"button",className:"aw-integration-secret-toggle","aria-label":l(i?"agentWorkspace.hideApiKey":"agentWorkspace.showApiKey"),title:l(i?"agentWorkspace.hideApiKey":"agentWorkspace.showApiKey"),disabled:r,onClick:o,children:r?a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}):a.jsx(aXt,{visible:i})}),s&&a.jsx("span",{className:"aw-integration-secret-error",role:"alert",children:s})]}):l("agentWorkspace.notAvailable")}function Uoe({protocol:e,title:t,available:n,fields:i,example:r}){const{t:s}=Te("ui");return a.jsxs("section",{className:`aw-integration-panel${n&&r?" has-example":""}`,id:`integration-${e}-panel`,role:"tabpanel","aria-labelledby":`integration-${e}-tab`,children:[a.jsx("header",{children:a.jsx("h3",{children:t})}),a.jsx("dl",{children:i.map(o=>a.jsxs("div",{children:[a.jsx("dt",{children:o.label}),a.jsx("dd",{children:o.value||s("agentWorkspace.notAvailable")})]},o.label))}),n&&r&&a.jsxs("section",{className:"aw-integration-example",children:[a.jsx("h4",{children:s("agentWorkspace.pythonExample")}),a.jsx(jd,{text:r,className:"aw-integration-example-code",allowRawHtml:!1})]})]})}function qv(e,t){const n=(e??[]).flatMap(i=>{const r=i.name??i.id??i.skillId??i.source;return typeof r=="string"&&r.trim()?[r.trim()]:[]});return n.length?n.join(", "):t}function K7(e){return Array.isArray(e)?`[${e.map(K7).join(",")}]`:e&&typeof e=="object"?`{${Object.entries(e).filter(([,n])=>n!==void 0).sort(([n],[i])=>n.localeCompare(i)).map(([n,i])=>`${JSON.stringify(n)}:${K7(i)}`).join(",")}}`:JSON.stringify(e)}async function oXt(e,t,n){const i=new TextEncoder().encode(K7(n)),r=await crypto.subtle.digest("SHA-256",i),s=Array.from(new Uint8Array(r),o=>o.toString(16).padStart(2,"0")).join("");return`mpa-profile:${e}:${t}:${s}`}function lXt({profile:e,profileStatus:t,runtimeReady:n,disabledReason:i,saving:r,error:s,notice:o,onApply:l,onEditProfile:c,onRefresh:u}){var m;const{t:d}=Te("ui"),f=(t==null?void 0:t.status)==="applied",h=n&&!r;return a.jsxs("section",{className:"aw-session-config aw-profile-config","aria-busy":r,children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:d("agentWorkspace.profileConfigTitle")}),a.jsx("p",{children:d("agentWorkspace.profileConfigDescription")})]}),i?a.jsx("div",{className:"aw-session-config-state",children:i}):a.jsxs(a.Fragment,{children:[s&&a.jsxs("div",{className:"aw-session-config-state is-error",role:"alert",children:[a.jsx("span",{children:s}),a.jsx("button",{type:"button",onClick:u,disabled:r,children:d("common.retry")})]}),o&&!s&&a.jsx("div",{className:"aw-session-config-notice",role:"status",children:o}),a.jsxs("div",{className:"aw-session-config-actions",children:[a.jsx("button",{type:"button",onClick:c,disabled:r,children:d("agentWorkspace.editProfile")}),a.jsx("button",{type:"button",onClick:u,disabled:r,children:d("common.refresh")})]}),a.jsxs("dl",{className:"aw-session-config-grid",children:[a.jsxs("div",{children:[a.jsx("dt",{children:d("agentWorkspace.profileStatus")}),a.jsx("dd",{children:d(f?"agentWorkspace.profileApplied":"agentWorkspace.profileNotApplied")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:d("agentWorkspace.latestProfileRevision")}),a.jsx("dd",{children:(t==null?void 0:t.profileRevision)??d("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:d("agentWorkspace.modelId")}),a.jsx("dd",{children:String(((m=e.model)==null?void 0:m.id)||d("agentWorkspace.notAvailable"))})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"ETag"}),a.jsx("dd",{children:(t==null?void 0:t.etag)||d("agentWorkspace.notAvailable")})]})]}),!f&&a.jsxs("div",{className:"aw-session-config-upgrade",role:"status",children:[a.jsx("span",{children:d("agentWorkspace.profileNotAppliedDescription")}),a.jsx("button",{type:"button",onClick:l,disabled:!h,children:d(r?"agentWorkspace.profileApplying":"agentWorkspace.applyProfile")})]}),f&&a.jsx("div",{className:"aw-session-config-actions",children:a.jsx("button",{type:"button",onClick:l,disabled:!h,children:d(r?"agentWorkspace.profileApplying":"agentWorkspace.reapplyProfile")})}),a.jsx("div",{className:"aw-session-config-card",children:a.jsxs("div",{children:[a.jsx("h4",{children:d("agentWorkspace.profilePrompt")}),a.jsx("p",{children:e.system||d("agentWorkspace.notAvailable")})]})}),a.jsxs("div",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:d("agentWorkspace.profileResources")}),a.jsx("p",{children:d("agentWorkspace.profileResourceSummary",{tools:e.tools.length,skills:e.skills.length,mcp:e.mcpServers.length})})]}),a.jsxs("div",{className:"aw-profile-config-list",children:[a.jsxs("span",{title:qv(e.tools,d("agentWorkspace.notAvailable")),children:[d("agentSelector.tools"),": ",qv(e.tools,d("agentWorkspace.notAvailable"))]}),a.jsxs("span",{title:qv(e.skills,d("agentWorkspace.notAvailable")),children:[d("agentSelector.skills"),": ",qv(e.skills,d("agentWorkspace.notAvailable"))]}),a.jsxs("span",{title:qv(e.mcpServers,d("agentWorkspace.notAvailable")),children:["MCP: ",qv(e.mcpServers,d("agentWorkspace.notAvailable"))]})]})]})]})]})}function cXt({config:e,profileStatus:t,loadable:n,disabledReason:i,loading:r,saving:s,upgrading:o,error:l,notice:c,modelValue:u,modelDirty:d,profileUpgradeAvailable:f,onModelChange:h,onSaveModel:m,onInheritModel:g,onClearMcp:b,onInheritMcp:v,onUpgradeProfile:y,onRefresh:w}){const{t:x}=Te("ui"),O=r||s||o,k=Doe(e,"model"),S=Doe(e,"mcpServers"),C=px(e),E=(t==null?void 0:t.status)==="applied"?t.profileRevision:null;return a.jsxs("section",{className:"aw-session-config","aria-busy":O,children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:x("agentWorkspace.sessionConfigTitle")}),a.jsx("p",{children:x("agentWorkspace.sessionConfigDescription")})]}),n?r&&!e?a.jsxs("div",{className:"aw-session-config-state",role:"status",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsx("span",{children:x("agentWorkspace.loadingSessionConfig")})]}):a.jsxs(a.Fragment,{children:[l&&a.jsxs("div",{className:"aw-session-config-state is-error",role:"alert",children:[a.jsx("span",{children:l}),a.jsx("button",{type:"button",onClick:w,disabled:O,children:x("common.retry")})]}),c&&!l&&a.jsx("div",{className:"aw-session-config-notice",role:"status",children:c}),e&&a.jsxs(a.Fragment,{children:[a.jsxs("dl",{className:"aw-session-config-grid",children:[a.jsxs("div",{children:[a.jsx("dt",{children:x("agentWorkspace.sessionConfigRevision")}),a.jsx("dd",{children:e.revision})]}),a.jsxs("div",{children:[a.jsx("dt",{children:x("agentWorkspace.sessionProfileRevision")}),a.jsx("dd",{children:e.profileRevision})]}),a.jsxs("div",{children:[a.jsx("dt",{children:x("agentWorkspace.latestProfileRevision")}),a.jsx("dd",{children:E??x("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"ETag"}),a.jsx("dd",{children:e.etag||x("agentWorkspace.notAvailable")})]})]}),f&&E!=null&&a.jsxs("div",{className:"aw-session-config-upgrade",role:"status",children:[a.jsx("span",{children:x("agentWorkspace.sessionProfileUpgradeAvailable",{current:e.profileRevision,target:E})}),a.jsx("button",{type:"button",onClick:y,disabled:O,children:x(o?"agentWorkspace.sessionProfileUpgrading":"agentWorkspace.upgradeSessionProfile")})]}),a.jsxs("div",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:x("agentWorkspace.sessionModelOverride")}),a.jsx("p",{children:x(k?`agentWorkspace.executionConfigMode.${k}`:"agentWorkspace.executionConfigMode.inherit")})]}),a.jsxs("label",{className:"aw-session-config-field",children:[a.jsx("span",{children:x("agentWorkspace.modelId")}),a.jsx("input",{type:"text",value:u,onChange:j=>h(j.currentTarget.value),placeholder:C||x("agentWorkspace.inheritProfileDefault"),disabled:O})]}),a.jsxs("div",{className:"aw-session-config-actions",children:[a.jsx("button",{type:"button",onClick:m,disabled:O||!d,children:x(s?"common.saving":"common.save")}),a.jsx("button",{type:"button",onClick:g,disabled:O||!Loe(e,"model"),children:x("agentWorkspace.inheritProfileDefault")})]})]}),a.jsxs("div",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:x("agentWorkspace.sessionMcpServers")}),a.jsx("p",{children:x(S?`agentWorkspace.executionConfigMode.${S}`:"agentWorkspace.executionConfigMode.inherit")})]}),a.jsxs("div",{className:"aw-session-config-value",children:[a.jsx("span",{children:x("agentWorkspace.mcpServerCount",{count:eXt(e)})}),a.jsx("small",{title:Moe(e,x),children:Moe(e,x)})]}),a.jsxs("div",{className:"aw-session-config-actions",children:[a.jsx("button",{type:"button",onClick:b,disabled:O||S==="clear",children:x("agentWorkspace.clearSessionMcp")}),a.jsx("button",{type:"button",onClick:v,disabled:O||!Loe(e,"mcpServers"),children:x("agentWorkspace.inheritProfileDefault")})]})]})]})]}):a.jsx("div",{className:"aw-session-config-state",children:i})]})}function Qoe(e,t){const n=e==null?void 0:e[t];return n==null||n===""?"":String(n)}function uXt(e,t){const n=e==null?void 0:e.worker;if(!n||typeof n!="object")return"";const i=n[t];return i==null||i===""?"":String(i)}function dXt(e,t){return typeof e!="number"||!Number.isFinite(e)?t("agentWorkspace.notAvailable"):`${Math.round(e)} ms`}function fXt({data:e,loadable:t,disabledReason:n,loading:i,error:r,onRefresh:s,locale:o}){const{t:l}=Te("ui"),c=(e==null?void 0:e.runs)??[],u=(e==null?void 0:e.trace)??null,d=c[0],f=(u==null?void 0:u.correlation)??{},h=[["mpaInstanceId",l("agentWorkspace.mpaInstanceId")],["profileRevision",l("agentWorkspace.sessionProfileRevision")],["executionConfigRevision",l("agentWorkspace.sessionConfigRevision")],["turnId",l("agentWorkspace.turnId")],["taskId",l("agentWorkspace.taskId")],["runtimeId","Runtime ID"],["runtimeVersion",l("systemInfo.currentVersion")]],m=[["kind",l("agentWorkspace.workerKind")],["sessionId",l("agentWorkspace.workerSession")],["turnId",l("agentWorkspace.workerTurn")],["profileId",l("agentWorkspace.workerProfile")],["profileVersion",l("agentWorkspace.workerProfileVersion")]];return a.jsxs("section",{className:"aw-mpa-diagnostics","aria-busy":i,children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:l("agentWorkspace.mpaDiagnosticsTitle")}),a.jsx("p",{children:l("agentWorkspace.mpaDiagnosticsDescription")})]}),t?i&&!e?a.jsxs("div",{className:"aw-session-config-state",role:"status",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsx("span",{children:l("agentWorkspace.loadingMpaDiagnostics")})]}):r?a.jsxs("div",{className:"aw-session-config-state is-error",role:"alert",children:[a.jsx("span",{children:r}),a.jsx("button",{type:"button",onClick:s,disabled:i,children:l("common.retry")})]}):d?a.jsxs(a.Fragment,{children:[a.jsxs("dl",{className:"aw-session-config-grid",children:[a.jsxs("div",{children:[a.jsx("dt",{children:l("agentWorkspace.latestRun")}),a.jsx("dd",{children:d.invocationId})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("agentSelector.status")}),a.jsx("dd",{children:d.status})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("agentWorkspace.lastUsed")}),a.jsx("dd",{children:e9e(d.startedAt,o,l)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:l("agentWorkspace.stepCount")}),a.jsx("dd",{children:d.stepCount})]})]}),a.jsxs("section",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:l("agentWorkspace.traceCorrelation")}),a.jsx("p",{children:l("agentWorkspace.traceCorrelationDescription")})]}),a.jsxs("dl",{className:"aw-mpa-correlation",children:[h.map(([g,b])=>a.jsxs("div",{children:[a.jsx("dt",{children:b}),a.jsx("dd",{children:Qoe(f,g)||l("agentWorkspace.notAvailable")})]},g)),m.map(([g,b])=>a.jsxs("div",{children:[a.jsx("dt",{children:b}),a.jsx("dd",{children:uXt(f,g)||l("agentWorkspace.notAvailable")})]},`worker-${g}`))]})]}),a.jsxs("section",{className:"aw-session-config-card",children:[a.jsxs("div",{children:[a.jsx("h4",{children:l("agentWorkspace.traceSteps")}),a.jsx("p",{children:l("agentWorkspace.traceStepsDescription")})]}),u!=null&&u.steps.length?a.jsx("div",{className:"aw-usage-table-wrap",children:a.jsxs("table",{className:"aw-usage-table aw-mpa-trace-table",children:[a.jsx("caption",{children:l("agentWorkspace.traceSteps")}),a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:l("agentWorkspace.step")}),a.jsx("th",{scope:"col",children:l("agentSelector.status")}),a.jsx("th",{scope:"col",children:l("agentWorkspace.duration")}),a.jsx("th",{scope:"col",children:l("agentWorkspace.turnId")})]})}),a.jsx("tbody",{children:u.steps.slice(0,20).map(g=>a.jsxs("tr",{children:[a.jsxs("td",{children:[a.jsx("strong",{children:g.title||g.kind}),a.jsx("small",{children:g.kind})]}),a.jsx("td",{children:g.status}),a.jsx("td",{children:dXt(g.durationMs,l)}),a.jsx("td",{children:Qoe(g.correlation,"turnId")||l("agentWorkspace.notAvailable")})]},g.stepId))})]})}):a.jsx("div",{className:"aw-session-config-value",children:a.jsx("span",{children:l("agentWorkspace.noTraceSteps")})})]})]}):a.jsx("div",{className:"aw-session-config-state",children:l("agentWorkspace.noMpaDiagnostics")}):a.jsx("div",{className:"aw-session-config-state",children:n})]})}function hXt(e,t,n){var i;return hH({appName:((i=e==null?void 0:e.appName)==null?void 0:i.trim())||t,name:e==null?void 0:e.name,description:e==null?void 0:e.description,type:e==null?void 0:e.type,model:e==null?void 0:e.model,tools:e==null?void 0:e.tools,skills:e==null?void 0:e.skills,graph:e==null?void 0:e.graph,draft:e==null?void 0:e.draft},n)}function r9e(e){return e?1+e.children.reduce((t,n)=>t+r9e(n),0):1}function s9e(e){return 1+e.subAgents.reduce((t,n)=>t+s9e(n),0)}function G7(e){if(!e)return 0;const t=Number(e);if(Number.isFinite(t))return t<1e12?t*1e3:t;const n=Date.parse(e);return Number.isFinite(n)?n:0}function pXt(e,t,n){const i=G7(e);return i?new Intl.DateTimeFormat(t,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(i)):n("agentWorkspace.unknownTime")}function mXt(e,t){return typeof e.score!="number"||!Number.isFinite(e.score)?"—":t("agentWorkspace.scoreValue",{score:Math.round(e.score*100)})}function gXt(e,t){return t(`agentWorkspace.priority.${e}`)}const bXt={agent_structure:"agentWorkspace.modules.agentStructure",prompt:"agentWorkspace.modules.prompt",tool:"agentWorkspace.modules.tool",knowledge:"agentWorkspace.modules.knowledge",memory:"agentWorkspace.modules.memory",workflow:"agentWorkspace.modules.workflow",other:"agentWorkspace.modules.other"};function yXt(e,t){var n;return e.module==="other"?((n=e.customModule)==null?void 0:n.trim())||t("agentWorkspace.modules.other"):t(bXt[e.module])}function vXt(e,t){return e.find(n=>n.kind===t)}function zoe(e,t){return e.items.map(n=>({...n,tag:t(n.kind==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")})).sort((n,i)=>G7(i.createdAt)-G7(n.createdAt))}function xXt(e){const t=n=>[n.name,n.description,n.agentType??"llm",n.modelName??"",n.tools??[],n.builtinTools??[],(n.customTools??[]).map(i=>i.name),(n.mcpTools??[]).map(i=>i.name),n.skills??[],(n.selectedSkills??[]).map(i=>i.name),(n.subAgents??[]).map(t)];return JSON.stringify(t(e))}function wXt(e){return[{phase:"prepare",label:e("agentWorkspace.deploymentSteps.prepare.label"),description:e("agentWorkspace.deploymentSteps.prepare.description")},{phase:"build",label:e("agentWorkspace.deploymentSteps.build.label"),description:e("agentWorkspace.deploymentSteps.build.description")},{phase:"deploy",label:e("agentWorkspace.deploymentSteps.deploy.label"),description:e("agentWorkspace.deploymentSteps.deploy.description")},{phase:"publish",label:e("agentWorkspace.deploymentSteps.publish.label"),description:e("agentWorkspace.deploymentSteps.publish.description")},{phase:"complete",label:e("agentWorkspace.deploymentSteps.complete.label"),description:e("agentWorkspace.deploymentSteps.complete.description")}]}function OXt(e,t){return{phase:"update",label:t("agentWorkspace.deploymentSteps.update.label"),description:t("agentWorkspace.deploymentSteps.update.description",e)}}function a9e(e,t){const n=wXt(t),i=[...n.slice(0,-1)];return e.instanceRange&&i.push(OXt(e.instanceRange,t)),e.createEvaluationSets&&i.push({phase:"evaluation",label:t("agentWorkspace.deploymentSteps.evaluation.label"),description:t("agentWorkspace.deploymentSteps.evaluation.description")}),e.mpaProfile&&(i.push({phase:"profile_applying",label:t("agentWorkspace.deploymentSteps.profileApplying.label"),description:t("agentWorkspace.deploymentSteps.profileApplying.description")}),e.mpaSmoke&&(i.push({phase:"smoke_running",label:t("agentWorkspace.deploymentSteps.smokeRunning.label"),description:t("agentWorkspace.deploymentSteps.smokeRunning.description")}),i.push({phase:"runnable",label:t("agentWorkspace.deploymentSteps.runnable.label"),description:t("agentWorkspace.deploymentSteps.runnable.description")}))),e.githubDelivery&&i.push({phase:"github",label:t("agentWorkspace.deploymentSteps.github.label"),description:t("agentWorkspace.deploymentSteps.github.description")}),i.push(n[n.length-1]),i}function o9e(e,t){const n=a9e(e,t);if(e.status==="success")return n.length-1;const i=e.phase??{准备部署:"prepare",构建镜像:"build",部署:"deploy",发布:"publish",创建评测集:"evaluation","应用 MPA Profile":"profile_applying","验证 MPA Runtime":"smoke_running","MPA Runtime 可运行":"runnable","挂载 GitHub 持续交付":"github",部署完成:"complete"}[e.label],r=n.findIndex(s=>s.phase===i);return r<0?0:r}function kXt(e,t){if(!e)return"";try{return new Intl.DateTimeFormat(t,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(new Date(e))}catch{return""}}function l9e({log:e,autoExpand:t,title:n,ariaLabel:i,copyLabel:r,defaultPendingMessage:s}){const{t:o,i18n:l}=Te("ui"),c=p.useRef(null),u=!!((e==null?void 0:e.status)!=="complete"&&t),[d,f]=p.useState(u),[h,m]=p.useState(!1),g=!!(e!=null&&e.text||e!=null&&e.error),b=(e==null?void 0:e.text)||(e==null?void 0:e.error)||"",v=b.split(` `),y=d?b:v.slice(-36).join(` -`),w=(e==null?void 0:e.pendingMessage)||s;if(p.useEffect(()=>{e&&f(u)},[e==null?void 0:e.status,u]),p.useEffect(()=>{if(!d||!g)return;const E=c.current;E&&(E.scrollTop=E.scrollHeight)},[d,g,y]),!e||!e.text&&e.status!=="error"&&!e.pendingMessage)return null;const x=wXt(e.updatedAt,l.resolvedLanguage??l.language),O=e.status==="complete"?o("agentWorkspace.logStatus.synced"):e.status==="error"?o("agentWorkspace.logStatus.failed"):o("agentWorkspace.logStatus.syncing"),k=e.omittedEarly?o("agentWorkspace.logStatus.earlyOmitted"):e.snapshotTruncated?o("agentWorkspace.logStatus.recentOnly"):e.truncated?o("agentWorkspace.logStatus.partiallyOmitted"):"",S=[O,e.lineCount?o("agentWorkspace.logLines",{count:e.lineCount}):"",k,x].filter(Boolean).join(" · ");async function C(){try{await navigator.clipboard.writeText(b),m(!0),window.setTimeout(()=>m(!1),1500)}catch{m(!1)}}return a.jsxs("section",{className:`aw-deploy-log is-${e.status}${d?"":" is-collapsed"}`,"aria-label":i,children:[a.jsxs("header",{children:[a.jsxs("div",{children:[a.jsx("strong",{children:n}),a.jsx("span",{children:S})]}),a.jsxs("div",{className:"aw-deploy-log-actions",children:[g&&a.jsx("button",{type:"button",onClick:()=>f(E=>!E),children:o(d?"common.collapse":"common.expand")}),g&&a.jsxs("button",{type:"button",onClick:()=>void C(),"aria-label":h?o("agentWorkspace.copiedLabel",{label:r}):o("agentWorkspace.copyLabel",{label:r}),title:h?o("agentWorkspace.copied"):o("agentWorkspace.copyLabel",{label:r}),children:[h?a.jsx(Ef,{"aria-hidden":!0}):a.jsx(eM,{"aria-hidden":!0}),a.jsx("span",{children:o(h?"agentWorkspace.copied":"agentWorkspace.copy")})]})]})]}),d&&(g?a.jsx("pre",{ref:c,children:y}):a.jsx("div",{className:"aw-deploy-log-empty",children:w}))]})}function OXt({task:e}){var n;const{t}=Te("ui");return a.jsx(o9e,{log:e.buildLog,autoExpand:((n=e.buildLog)==null?void 0:n.status)!=="complete"&&(e.status==="running"||e.status==="error")&&a9e(e,t)===1,title:t("agentWorkspace.buildLog"),ariaLabel:t("agentWorkspace.buildLog"),copyLabel:t("agentWorkspace.buildLog"),defaultPendingMessage:t("agentWorkspace.waitingBuildLog")})}function kXt({task:e}){var n;const{t}=Te("ui");return a.jsx(o9e,{log:e.githubLog,autoExpand:((n=e.githubLog)==null?void 0:n.status)!=="complete"&&(e.status==="running"||e.status==="error")&&e.phase==="github",title:t("agentWorkspace.githubMountLog"),ariaLabel:t("agentWorkspace.githubDeliveryMountLog"),copyLabel:t("agentWorkspace.githubMountLog"),defaultPendingMessage:t("agentWorkspace.waitingGithubMountLog")})}function SXt({task:e,onReturnToEdit:t}){const{t:n}=Te("ui"),[i,r]=p.useState(!1),s=s9e(e,n),o=a9e(e,n),l=e.status==="success"?100:Math.max(6,Math.min(100,e.pct??6)),c=e.status==="running"&&e.statusUnconfirmed?n("agentWorkspace.deployStatus.unconfirmed"):e.status==="running"?n("agentWorkspace.deployStatus.running"):e.status==="success"?n("agentWorkspace.deployStatus.success"):e.status==="error"?n("agentWorkspace.deployStatus.error"):n("agentWorkspace.deployStatus.cancelled"),u=()=>{i||!e.retry||(r(!0),e.retry().catch(()=>{}).finally(()=>r(!1)))};return a.jsxs("section",{className:`aw-deploy-progress-card is-${e.status}`,"aria-live":"polite",children:[a.jsxs("div",{className:"aw-deploy-progress-head",children:[a.jsxs("div",{children:[a.jsx("span",{className:"aw-deploy-progress-icon","aria-hidden":!0,children:e.status==="running"&&e.statusUnconfirmed?a.jsx(gN,{}):e.status==="running"?a.jsx(Fi,{className:"spin"}):e.status==="success"?a.jsx(Cat,{}):e.status==="error"?a.jsx(gN,{}):a.jsx(oB,{})}),a.jsxs("div",{children:[a.jsx("h3",{children:c}),a.jsx("p",{children:e.runtimeName})]})]}),a.jsx("strong",{children:e.status==="running"&&!e.statusUnconfirmed?`${Math.round(l)}%`:e.label})]}),a.jsx("div",{className:"aw-deploy-progress-track",role:"progressbar","aria-label":n("agentWorkspace.deploymentProgress"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(l),children:a.jsx("span",{style:{width:`${l}%`}})}),a.jsx("ol",{className:"aw-deploy-steps",children:s.map((d,f)=>{const h=e.status==="success"||fnew Set),[lr,Mn]=p.useState(()=>new Set),[ei,Bn]=p.useState(!1),[ki,zn]=p.useState(""),[Rn,di]=p.useState(null),[rt,zt]=p.useState([]),[Qe,bt]=p.useState([]),[Ht,_n]=p.useState(!1),[jr,Hs]=p.useState(""),[qs,Dr]=p.useState(""),[ti,Si]=p.useState(0),[Zr,Jr]=p.useState([]),[ga,go]=p.useState(!1),[us,he]=p.useState(""),[pr,bo]=p.useState(0),[to,fl]=p.useState(null),[no,ws]=p.useState(1),[Ws,Ai]=p.useState(!1),[rr,Ds]=p.useState(""),[Pl,hl]=p.useState(0),[mr,Mr]=p.useState(null),[pl,Mo]=p.useState(null),[Nr,Lo]=p.useState(null),[es,ba]=p.useState(!1),[Di,Ms]=p.useState(""),[zr,ds]=p.useState(null),[ml,na]=p.useState(!1),[gi,Dl]=p.useState(""),[$o,Ks]=p.useState(0),[gl,Fo]=p.useState(""),[Pa,bl]=p.useState(!1),[Uu,Bo]=p.useState(!1),[hc,Dd]=p.useState(!1),[Md,yo]=p.useState(""),[Ld,yl]=p.useState(""),[Ml,Da]=p.useState(0),[Uo,Qo]=p.useState({saving:!1,error:"",notice:""}),[Qu,vl]=p.useState(!1),[Ll,Ls]=p.useState(()=>new Set),[Ma,rn]=p.useState(!1),[$l,Os]=p.useState(""),[ts,ns]=p.useState(""),[$d,Fl]=p.useState(()=>new Set),zo=p.useRef(!1),Bl=p.useRef(""),Kc=p.useRef(null),vo=p.useRef(0),ia=p.useRef(0),io=p.useRef(0),Re=p.useRef(0),[lt,Lt]=p.useState(HGt),[Ln,wn]=p.useState("");p.useEffect(()=>{e.length!==0&&Lt(ce=>ce.map(($e,Ge)=>Ge===0&&$e.agentIds.length===0?{...$e,agentIds:e.slice(0,2).map(pt=>pt.id)}:$e))},[e]);const pn=p.useMemo(()=>{const ce=new Map;for(const $e of e)$e.runtimeId&&ce.set($e.runtimeId,$e);return ce},[e]),jn=p.useMemo(()=>{var $e;const ce=new Map;for(const Ge of t){const pt=($e=Ge.deploymentTarget)==null?void 0:$e.runtimeId;if(!pt||!pn.has(pt))continue;const ln=ce.get(pt);(!ln||Ge.updatedAt>ln.updatedAt)&&ce.set(pt,Ge)}return ce},[pn,t]),Wt=p.useMemo(()=>{const ce=new Map;for(const $e of f){if(!$e.runtimeId)continue;const Ge=ce.get($e.runtimeId);(!Ge||$e.startedAt>Ge.startedAt)&&ce.set($e.runtimeId,$e)}return ce},[f]),gn=p.useMemo(()=>{const ce=et.trim().toLowerCase();return ce?e.filter($e=>{const Ge=$e.runtimeId?jn.get($e.runtimeId):void 0,pt=$e.runtimeId?Wt.get($e.runtimeId):void 0;return[$e.label,$e.app,$e.host??"",(Ge==null?void 0:Ge.draft.name)??"",(Ge==null?void 0:Ge.draft.description)??"",(pt==null?void 0:pt.runtimeName)??""].join(" ").toLowerCase().includes(ce)}):e},[e,Wt,et,jn]),$n=p.useMemo(()=>{const ce=et.trim().toLowerCase();return t.filter($e=>{var pt;const Ge=(pt=$e.deploymentTarget)==null?void 0:pt.runtimeId;return Ge&&pn.has(Ge)?!1:ce?`${$e.draft.name} ${$e.draft.description}`.toLowerCase().includes(ce):!0})},[pn,t,et]),ai=p.useMemo(()=>t.filter(ce=>{var Ge;const $e=(Ge=ce.deploymentTarget)==null?void 0:Ge.runtimeId;return!$e||!pn.has($e)}).length,[pn,t]),is=p.useMemo(()=>{const ce=et.trim().toLowerCase();return ce?lt.filter($e=>$e.name.toLowerCase().includes(ce)):lt},[lt,et]),re=e.find(ce=>ce.id===U),Vn=t.find(ce=>ce.id===z),bi=h?f.find(ce=>ce.id===h):void 0,La=re!=null&&re.runtimeId?jn.get(re.runtimeId):void 0,oe=x?xt:U&&r===U?i:null,Le=(oe==null?void 0:oe.appName)||(re==null?void 0:re.runtimeApp)||(re==null?void 0:re.app)||"",st=(re==null?void 0:re.agentCategory)??"general",Fe=st==="mpa"?"basic":V,de=(ne==null?void 0:ne.runtimeId)===(re==null?void 0:re.runtimeId)?ne:null,Be=de==null?void 0:de.mpaInstanceId,at=(re==null?void 0:re.mpaInstanceId)??Be??(re==null?void 0:re.runtimeId)??"",$t=WGt.filter(ce=>st==="mpa"?ce==="basic":ce==="profileConfig"?!1:ce==="usage"?c&&(re==null?void 0:re.runtimeId):!(ce==="sessionConfig"||ce==="diagnostics")).map(ce=>({id:ce,label:_(`agentWorkspace.sections.${ce}`)})),kn=JSON.stringify([(re==null?void 0:re.runtimeId)??"",(re==null?void 0:re.region)??"cn-beijing",Le,no]),Ti=(to==null?void 0:to.requestKey)===kn?to.value:null,sn=`${(re==null?void 0:re.region)??"cn-beijing"}:${(re==null?void 0:re.runtimeId)??""}`,oi=JSON.stringify([(re==null?void 0:re.runtimeId)??"",at,(re==null?void 0:re.region)??"cn-beijing",y]),Vt=JSON.stringify([(re==null?void 0:re.runtimeId)??"",at,(re==null?void 0:re.region)??"cn-beijing"]),fi=Vt,Un=JSON.stringify([(re==null?void 0:re.runtimeId)??"",(re==null?void 0:re.region)??"cn-beijing",y]),sr=(ke==null?void 0:ke.requestKey)===sn?ke.value:"",Hn=(G==null?void 0:G.requestKey)===sn?G:null,gr=(mr==null?void 0:mr.requestKey)===oi&&y?mr.value:null,ks=(Nr==null?void 0:Nr.requestKey)===Vt?Nr.value:null,zi=(pl==null?void 0:pl.requestKey)===fi?pl.value:(ks==null?void 0:ks.profile)??null,wr=(ks==null?void 0:ks.bindingStatus)??"",Fd=XGt((d2=ks==null?void 0:ks.safeError)==null?void 0:d2.code,_),Db=(ks==null?void 0:ks.capabilities.canWrite)===!0,dv=(zr==null?void 0:zr.requestKey)===Un?zr:null,fv=!!(re!=null&&re.runtimeId&&st==="mpa"&&wr!=="runtime_missing"&&wr!=="binding_ambiguous"),Lh=!!((re==null?void 0:re.agentCategory)==="mpa"&&(re!=null&&re.runtimeId)&&(re==null?void 0:re.runtimeId)===w&&wr==="bound"&&y),Pf=(zi==null?void 0:zi.status)==="applied"?zi.profileRevision:null,Rr=!!(Lh&&gr&&Pf!=null&&Pf>gr.profileRevision),xl=hx(gr),zu=gl.trim()!==xl,pc=!!((bc=Hn==null?void 0:Hn.apiApps)!=null&&bc.length),$a=!!(Hn!=null&&Hn.a2a),Om=((vv=Hn==null?void 0:Hn.apiApps)==null?void 0:vv[0])??Le,Vu=(ne==null?void 0:ne.endpoint)??"",Df=eXt(((Qd=Hn==null?void 0:Hn.a2a)==null?void 0:Qd.endpoint)??"",Vu),Ul=(re==null?void 0:re.runtimeApp)||"",ro=JSON.stringify([(re==null?void 0:re.runtimeId)??"",(re==null?void 0:re.region)??"",(re==null?void 0:re.currentVersion)??null,Ul]),mc=l&&(re!=null&&re.runtimeId)&&re.region&&qe===0?H8({runtimeId:re.runtimeId,region:re.region,appName:Ul,currentVersion:re.currentVersion}):null,yt=(He==null?void 0:He.requestKey)===ro?He.value:mc,Vo=yt!=null&&yt.reason?So(yt.reason,L.resolvedLanguage||L.language):"",Xi=(yt==null?void 0:yt.warnings.filter(ce=>So(ce,L.resolvedLanguage||L.language)))??[],Fa=st!=="mpa";p.useEffect(()=>{const ce=vo.current+1;vo.current=ce,Ue(null),Ct("");const $e=(re==null?void 0:re.runtimeId)??"",Ge=(re==null?void 0:re.region)??"";if(!Fa||!l||!$e||!Ge){Pt(!1);return}const pt=qe===0?H8({runtimeId:$e,region:Ge,appName:Ul,currentVersion:re==null?void 0:re.currentVersion}):null;if(pt){Ue({requestKey:ro,value:pt}),Pt(!1);return}const ln=new AbortController;let Ze,En=0;const Lr=60;Pt(!0);const Ri=hs=>{PD({runtimeId:$e,region:Ge,appName:Ul,currentVersion:re==null?void 0:re.currentVersion,signal:ln.signal,force:hs&&qe>0}).then(sa=>{var FO,Ub;if(ce!==vo.current)return;const Uh=sa.recoveryStatus==="preparing";if(sa.runtime.runtimeId!==$e||sa.runtime.region!==Ge||!Uh&&Ul&&((FO=sa.agent)==null?void 0:FO.appName)!==Ul||sa.canUpdate&&!((Ub=sa.agent)!=null&&Ub.appName)){Ct(_("agentWorkspace.errors.updateCapabilityMismatch"));return}if(Ue({requestKey:ro,value:sa}),Pt(!1),!!Uh){if(En+=1,En>=Lr){Ct(_("agentWorkspace.errors.updateConfigRestoring"));return}Ze=window.setTimeout(()=>Ri(!1),1e3)}}).catch(()=>{ce!==vo.current||ln.signal.aborted||Ct(_("agentWorkspace.errors.checkUpdateCapability"))}).finally(()=>{ce===vo.current&&!ln.signal.aborted&&Pt(!1)})};return Ri(!0),()=>{ln.abort(),Ze!=null&&window.clearTimeout(Ze)}},[l,Ul,qe,re==null?void 0:re.currentVersion,re==null?void 0:re.region,re==null?void 0:re.runtimeId,Fa,ro]);const Nn=p.useMemo(()=>{const ce=new Map(e.map((Ge,pt)=>[Ge.id,pt])),$e=new Map(n.map((Ge,pt)=>[Ge,pt]));return[...gn].sort((Ge,pt)=>{const ln=Ge.runtimeId?Wt.get(Ge.runtimeId):void 0,Ze=pt.runtimeId?Wt.get(pt.runtimeId):void 0,En=(ln==null?void 0:ln.status)==="running"?ln.startedAt:0,Lr=(Ze==null?void 0:Ze.status)==="running"?Ze.startedAt:0;if(En!==Lr)return Lr-En;const Ri=$e.get(Ge.id),hs=$e.get(pt.id);return Ri!=null&&hs!=null?Ri-hs:Ri!=null?-1:hs!=null?1:(ce.get(Ge.id)??0)-(ce.get(pt.id)??0)})},[n,e,gn,Wt]),Bd=(re==null?void 0:re.label)||(oe==null?void 0:oe.name)||(Vn==null?void 0:Vn.draft.name)||(bi==null?void 0:bi.agentName)||(($O=bi==null?void 0:bi.agentDraft)==null?void 0:$O.name)||_("agentWorkspace.noAgentSelected"),TO=lt.find(ce=>ce.id===Ln),hv=Nn.filter(ce=>ce.canDelete===!0),Mb=Nn.filter(ce=>Qi.has(ce.id)&&ce.canDelete===!0),gc=$n.filter(ce=>lr.has(ce.id)),JT=hv.length+$n.length,Mf=Mb.length+gc.length,Ba=p.useMemo(()=>{var $e;if(bi!=null&&bi.agentDraft)return bi.agentDraft;if(Vn!=null&&Vn.draft)return Vn.draft;const ce=($e=re==null?void 0:re.region)!=null&&$e.startsWith("ap-")?"byteplus":"volcengine";return yt!=null&&yt.agent&&(yt.recoveryStatus==="complete"||yt.recoveryStatus==="draft-only")?fH(yt.agent,ce,yt.runtime.configuredEnvKeys):dXt(oe,Le||(re==null?void 0:re.label)||"agent",ce)},[oe,Le,re==null?void 0:re.label,re==null?void 0:re.region,Vn==null?void 0:Vn.draft,bi==null?void 0:bi.agentDraft,yt]),Dn=((ra=oe==null?void 0:oe.draft)==null?void 0:ra.harnessSidecar)??lmt(ne==null?void 0:ne.envs),e2=Dn?Z1.filter(ce=>Dn.componentOverrides[ce]):[],t2=p.useMemo(()=>FA(Ba),[Ba]),$h=Vn?o?"":_("agentWorkspace.errors.noCreatePermission"):st==="mpa"?"":l?re!=null&&re.runtimeId?re.region?jt?_("agentWorkspace.errors.checkingUpdateConfig"):Kt||(yt?yt.recoveryStatus!=="complete"&&yt.recoveryStatus!=="draft-only"?Vo||_("agentWorkspace.errors.originalConfigUnavailable"):yt.canUpdate?(f2=yt.agent)!=null&&f2.appName?"":_("agentWorkspace.errors.agentInfoMissing"):Vo||_("agentWorkspace.errors.updateUnsupported"):_("agentWorkspace.errors.updateCapabilityPending")):_("agentWorkspace.errors.runtimeRegionMissing"):_("agentWorkspace.errors.cloudOnlyUpdate"):_("agentWorkspace.errors.noManagePermission"),Lb="aw-update-disabled-reason",qL=re?st!=="mpa"?_("agentWorkspace.sessionConfigNonMpa"):es?_("agentWorkspace.loadingMpaAgentView"):Di||Fd||(wr==="runtime_missing"?_("agentWorkspace.mpaRuntimeMissing"):wr==="binding_ambiguous"?_("agentWorkspace.mpaRuntimeBindingAmbiguous"):wr&&!fv?_("agentWorkspace.mpaRuntimeMissing"):Db?"":_("agentWorkspace.errors.noManagePermission")):_("agentWorkspace.sessionConfigNoAgent"),$b=re?st!=="mpa"?_("agentWorkspace.sessionConfigNonMpa"):es?_("agentWorkspace.loadingMpaAgentView"):Di||Fd||(wr==="runtime_missing"?_("agentWorkspace.mpaRuntimeMissing"):wr==="binding_ambiguous"?_("agentWorkspace.mpaRuntimeBindingAmbiguous"):wr==="orphan_runtime"?_("agentWorkspace.mpaRuntimeOrphan"):y?re.runtimeId!==w?_("agentWorkspace.sessionConfigDifferentRuntime"):"":_("agentWorkspace.sessionConfigNoSession")):_("agentWorkspace.sessionConfigNoAgent"),n2=re?st!=="mpa"?_("agentWorkspace.sessionConfigNonMpa"):es?_("agentWorkspace.loadingMpaAgentView"):Di||(wr!=="bound"?$b:y?re.runtimeId!==w?_("agentWorkspace.sessionConfigDifferentRuntime"):"":_("agentWorkspace.sessionConfigNoSession")):_("agentWorkspace.sessionConfigNoAgent"),km=p.useMemo(()=>{if(oe)return oe.tools;const ce=(Ba.builtinTools??[]).map($e=>{var Ge;return((Ge=rT.find(pt=>pt.id===$e))==null?void 0:Ge.label)??$e});return Array.from(new Set([...Ba.tools,...ce,...(Ba.customTools??[]).map($e=>$e.name),...(Ba.mcpTools??[]).map($e=>$e.name)].filter(Boolean)))},[Ba,oe]),Fb=p.useMemo(()=>oe?oe.skillsPreviewSupported?oe.skills.map(ce=>ce.name):null:Array.from(new Set([...(Ba.selectedSkills??[]).map(ce=>ce.name),...Ba.skills].filter(Boolean))),[Ba,oe]),Vr=p.useMemo(()=>{if(bi)return bi;if(Vn){const ce=f.filter($e=>$e.draftId===Vn.id).sort(($e,Ge)=>Ge.startedAt-$e.startedAt)[0];return ce||f.filter($e=>{var Ge,pt;return((Ge=$e.agentDraft)==null?void 0:Ge.name)===Vn.draft.name||$e.agentName===Vn.draft.name||!!((pt=Vn.deploymentTarget)!=null&&pt.runtimeId)&&$e.runtimeId===Vn.deploymentTarget.runtimeId}).sort(($e,Ge)=>Ge.startedAt-$e.startedAt)[0]}if(re)return f.filter(ce=>!!re.runtimeId&&ce.runtimeId===re.runtimeId||ce.agentName===re.label).sort((ce,$e)=>$e.startedAt-ce.startedAt)[0]},[f,re,Vn,bi]),i2=!!(h&&Vr&&Vr.id===h),pv=!!(Vr&&(Vr.status!=="success"||i2)),Hu=(Vr==null?void 0:Vr.status)==="running",Sm=Vr!=null&&Vr.draftId?t.find(ce=>ce.id===Vr.draftId)??(Vr.agentDraft?{id:Vr.draftId,draft:Vr.agentDraft,updatedAt:Vr.startedAt}:void 0):void 0,Gc=p.useMemo(()=>yXt(Ba),[Ba]),Fh=(re==null?void 0:re.currentVersion)??(ne==null?void 0:ne.currentVersion)??null,Lf=Fh??(bi==null?void 0:bi.startedAt)??"unknown",Pi=oe?`runtime:${(re==null?void 0:re.runtimeId)??oe.name}:v${Lf}:${Gc}`:`draft:${(bi==null?void 0:bi.id)??(Vn==null?void 0:Vn.id)??(re==null?void 0:re.id)??Bd}:${Gc}`;p.useEffect(()=>{let ce=!1;const $e=(re==null?void 0:re.runtimeId)??"",Ge=at||$e,pt=(re==null?void 0:re.region)??"cn-beijing",ln=Vt;if(Ms(""),st!=="mpa"||!$e||Fe!=="profileConfig"&&Fe!=="sessionConfig"){Lo(null),ba(!1);return}const Ze=new AbortController;return ba(!0),ETe({mpaInstanceId:Ge,runtimeId:$e,region:pt,signal:Ze.signal}).then(En=>{ce||(Lo({requestKey:ln,value:En}),Mo(En.profile?{requestKey:fi,value:En.profile}:null))}).catch(En=>{ce||Ze.signal.aborted||(Lo(null),Ms(En instanceof Error?En.message:_("agentWorkspace.errors.loadMpaAgentView")))}).finally(()=>{ce||ba(!1)}),()=>{ce=!0,Ze.abort()}},[qe,Vt,Fe,at,re==null?void 0:re.region,re==null?void 0:re.runtimeId,st,fi,_]),p.useEffect(()=>{Fe==="usage"&&!c&&q("basic")},[c,Fe]),p.useEffect(()=>{Fe==="sessionConfig"&&(!(re!=null&&re.runtimeId)||st!=="mpa")&&q("basic")},[Fe,re==null?void 0:re.runtimeId,st]),p.useEffect(()=>{Fe==="diagnostics"&&(!(re!=null&&re.runtimeId)||st!=="mpa")&&q("basic")},[Fe,re==null?void 0:re.runtimeId,st]),p.useEffect(()=>{if(!h)return;const ce=f.find(Ge=>Ge.id===h),$e=ce!=null&&ce.runtimeId?pn.get(ce.runtimeId):void 0;if($e){Z(""),J($e.id),q("basic");return}J(""),Z(""),q("basic")},[pn,f,h]),p.useEffect(()=>{if(!m){Bl.current="";return}const ce=`${m}:${g}:${b}:${c}`;Bl.current!==ce&&e.some($e=>$e.id===m)&&(Bl.current=ce,Z(""),J(m),q(g==="usage"&&!c?"basic":g),g==="evaluations"&&(At(b),Gt("")))},[e,c,m,g,b]),p.useEffect(()=>{for(const ce of Nn.slice(0,8)){if(!ce.runtimeId)continue;const $e=ce.region??"cn-beijing";A2e(ce.runtimeId,$e),vTe(ce.runtimeId,$e,ce.runtimeApp??"")}},[Nn]),p.useEffect(()=>{let ce=!1;const $e=(re==null?void 0:re.runtimeId)??"",Ge=(re==null?void 0:re.region)??"cn-beijing",pt=(re==null?void 0:re.runtimeApp)??"",ln=$e?yTe($e,Ge,pt):null;if(tt(ln),Nt(""),xn(!1),Ne(!!ln||!x||!$e),!(!x||!$e))return Cz($e,Ge,pt,{force:!0}).then(Ze=>{ce||tt(Ze)}).catch(Ze=>{!ce&&!ln&&tt(null),ce||(xn(Ze instanceof Oa&&Ze.unsupported),Nt(_("agentWorkspace.errors.loadAgentInfo")))}).finally(()=>{ce||Ne(!0)}),()=>{ce=!0}},[x,qe,re==null?void 0:re.currentVersion,re==null?void 0:re.region,re==null?void 0:re.runtimeApp,re==null?void 0:re.runtimeId]),p.useEffect(()=>{let ce=!1;const $e=(re==null?void 0:re.runtimeId)??"",Ge=(re==null?void 0:re.region)??"cn-beijing";if(Jr([]),he(""),Fe!=="optimizations"||!$e){go(!1);return}if(x&&!Le){go(!mt);return}return go(!0),rTe({runtimeId:$e,region:Ge,appName:Le}).then(pt=>{ce||Jr(pt.groups)}).catch(()=>{ce||he(_("agentWorkspace.errors.loadOptimizations"))}).finally(()=>{ce||go(!1)}),()=>{ce=!0}},[mt,x,pr,Fe,Le,re==null?void 0:re.region,re==null?void 0:re.runtimeId]),p.useEffect(()=>{ws(1)},[re==null?void 0:re.runtimeId,Le]),p.useEffect(()=>{const ce=io.current+1;io.current=ce;const $e=(re==null?void 0:re.runtimeId)??"",Ge=(re==null?void 0:re.region)??"cn-beijing",pt=Le;if(Ds(""),Fe!=="usage"||!$e){Ai(!1);return}if(!pt){Ai(x&&!mt);return}const ln=new AbortController;return Ai(!0),h2e({runtimeId:$e,region:Ge,appName:pt,page:no,pageSize:KGt,signal:ln.signal}).then(Ze=>{if(ce===io.current){if(Ze.runtimeId!==$e||Ze.appName!==pt||Ze.page!==no){Ds(_("agentWorkspace.errors.usageMismatch"));return}fl({requestKey:kn,value:Ze})}}).catch(()=>{ce!==io.current||ln.signal.aborted||Ds(_("agentWorkspace.errors.loadUsage"))}).finally(()=>{ce===io.current&&Ai(!1)}),()=>{ln.abort()}},[no,Pl,kn,mt,x,Fe,Le,re==null?void 0:re.region,re==null?void 0:re.runtimeId]),p.useEffect(()=>{ia.current+=1,je(null),Ee(!1),_e(!1),le(""),pe("api-server")},[sn,Fe]),p.useEffect(()=>{const ce=(re==null?void 0:re.runtimeId)??"",$e=(re==null?void 0:re.region)??"cn-beijing",Ge=Un;if(Dl(""),Fe!=="diagnostics"||st!=="mpa"||wr!=="bound"||!ce||!y||ce!==w){na(!1),Fe!=="diagnostics"&&ds(null);return}const pt=new AbortController;let ln=!1;return na(!0),ATe({runtimeId:ce,region:$e,sessionId:y,signal:pt.signal}).then(async Ze=>{const En=Ze.runs[0],Lr=En?await TTe({runtimeId:ce,region:$e,sessionId:y,invocationId:En.invocationId,signal:pt.signal}):null;return{runs:Ze.runs,trace:Lr}}).then(Ze=>{ln||ds({requestKey:Ge,...Ze})}).catch(Ze=>{ln||pt.signal.aborted||(ds(null),Dl(Ze instanceof Error?Ze.message:_("agentWorkspace.errors.loadMpaDiagnostics")))}).finally(()=>{ln||na(!1)}),()=>{ln=!0,pt.abort()}},[w,y,$o,Un,Fe,re==null?void 0:re.region,re==null?void 0:re.runtimeId,st,wr,_]);function so(){ia.current+=1,je(null),Ee(!1),_e(!1),le("")}function fs(ce){ce!==ue&&(so(),pe(ce))}async function _O(){if(Pe){so();return}const ce=(re==null?void 0:re.runtimeId)??"",$e=(re==null?void 0:re.region)??"cn-beijing";if(!ce)return;const Ge=ia.current+1;ia.current=Ge,_e(!0),le("");try{const pt=await k2e(ce,$e);if(Ge!==ia.current)return;je({requestKey:sn,value:pt}),Ee(!0)}catch(pt){if(Ge!==ia.current)return;je(null),Ee(!1),le(pt instanceof Error?pt.message:_("agentWorkspace.errors.loadApiKey"))}finally{Ge===ia.current&&_e(!1)}}p.useEffect(()=>{let ce=!1;const $e=(re==null?void 0:re.runtimeId)??"",Ge=(re==null?void 0:re.region)??"cn-beijing",pt=$e?C2e($e,Ge):null;if(W(pt),St(""),!!$e)return DD($e,Ge,{force:!0}).then(ln=>{ce||W(ln)}).catch(()=>{!ce&&!pt&&W(null),ce||St(_("agentWorkspace.errors.loadRuntimeDetails"))}),()=>{ce=!0}},[qe,re==null?void 0:re.currentVersion,re==null?void 0:re.region,re==null?void 0:re.runtimeId]),p.useEffect(()=>{const ce=Re.current+1;if(Re.current=ce,yo(""),yl(""),Bo(!1),Dd(!1),Fe!=="sessionConfig"||!Lh||!(re!=null&&re.runtimeId)){bl(!1),Mr(null),Fo("");return}const $e=re.runtimeId,Ge=at||$e,pt=re.region??"cn-beijing",ln=oi,Ze=new AbortController;return bl(!0),Promise.all([Rz({runtimeId:$e,region:pt,sessionId:y,signal:Ze.signal}),STe({runtimeId:$e,region:pt,mpaInstanceId:Ge,signal:Ze.signal}).catch(()=>null)]).then(([En,Lr])=>{ce===Re.current&&(Mr({requestKey:ln,value:En}),Fo(hx(En)),Mo(Lr?{requestKey:fi,value:Lr}:null))}).catch(En=>{ce!==Re.current||Ze.signal.aborted||(En==null?void 0:En.name)==="AbortError"||(Mr(null),Fo(""),yo(En instanceof Error?En.message:_("agentWorkspace.errors.loadSessionConfig")))}).finally(()=>{ce===Re.current&&!Ze.signal.aborted&&bl(!1)}),()=>{Ze.abort()}},[y,Ml,oi,Lh,Fe,fi,at,re==null?void 0:re.region,re==null?void 0:re.runtimeId,_]),p.useEffect(()=>{let ce=!1;const $e=(re==null?void 0:re.runtimeId)??"";if(ye(""),Fe!=="versions"||!$e){We(!1),$e||Oe(null);return}return We(!0),dN($e).then(Ge=>{ce||Oe(Ge)}).catch(()=>{ce||(Oe(null),ye(_("agentWorkspace.errors.loadGithubVersions")))}).finally(()=>{ce||We(!1)}),()=>{ce=!0}},[Fe,re==null?void 0:re.currentVersion,re==null?void 0:re.runtimeId]),p.useEffect(()=>{let ce=!1;const $e=(re==null?void 0:re.runtimeId)??"",Ge=(re==null?void 0:re.region)??"cn-beijing",pt=`${Ge}:${$e}`;if(ie(""),Fe!=="integrations"||!$e){Y(!1),$e||H(null);return}Y(!0);const ln=Ww($e,Ge,{retryProbe:!0}).catch(Ze=>{if(Ze instanceof Oa&&Ze.unsupported)return null;throw Ze});return Promise.all([ln,O2e($e,Ge,{retryProbe:!0})]).then(([Ze,En])=>{ce||H({requestKey:pt,apiApps:Ze,a2a:En})}).catch(()=>{ce||(H(null),ie(_("agentWorkspace.errors.probeIntegration")))}).finally(()=>{ce||Y(!1)}),()=>{ce=!0}},[ee,Fe,re==null?void 0:re.currentVersion,re==null?void 0:re.region,re==null?void 0:re.runtimeId]),p.useEffect(()=>{let ce=!1;const $e=(re==null?void 0:re.runtimeId)??"",Ge=(re==null?void 0:re.region)??"cn-beijing",pt=$e&&Le?sTe({runtimeId:$e,region:Ge,appName:Le,pageSize:100}):null;if(zt(pt?Qoe(pt,_):[]),bt((pt==null?void 0:pt.sets)??[]),Hs(""),Dr((pt==null?void 0:pt.unsupportedMessage)??""),Fe!=="evaluations"||!$e){_n(!1);return}if(x&&!Le){_n(!mt);return}return _n(!pt),_D({runtimeId:$e,region:Ge,appName:Le,pageSize:100},{force:!0}).then(ln=>{ce||(bt(ln.sets),zt(Qoe(ln,_)),Dr(ln.unsupportedMessage??""))}).catch(()=>{ce||(Hs(_("agentWorkspace.errors.loadEvaluations")),Dr(""))}).finally(()=>{ce||_n(!1)}),()=>{ce=!0}},[mt,x,ti,Fe,Le,oe==null?void 0:oe.appName,re==null?void 0:re.region,re==null?void 0:re.runtimeId,_]);async function jO(ce){const $e=(re==null?void 0:re.runtimeId)??"",Ge=ce.commitSha??"";if(!(!$e||!Ge||we)){Ae(Ge),ye("");try{await r2e({runtimeId:$e,targetCommitSha:Ge,region:re==null?void 0:re.region,agentCategory:st});const pt=await dN($e);Oe(pt)}catch(pt){ye(pt instanceof Error?pt.message:_("agentWorkspace.errors.rollbackVersion"))}finally{Ae("")}}}function NO(ce,$e){return!(ce instanceof nw)||ce.status!==412||!ce.currentState?!1:(Mr({requestKey:oi,value:ce.currentState}),Fo(hx(ce.currentState)),yo($e),!0)}async function r2(ce="replace"){if(!(re!=null&&re.runtimeId)||!gr)return;const $e=re.runtimeId,Ge=re.region??"cn-beijing",pt=gl.trim(),ln=ce==="inherit"?{category:"model",mode:ce}:pt?{category:"model",mode:ce,value:{id:pt}}:{category:"model",mode:"inherit"};Bo(!0),yo(""),yl("");try{const Ze=await B8({runtimeId:$e,region:Ge,sessionId:y,etag:gr.etag,changes:[ln]});Mr({requestKey:oi,value:Ze}),Fo(hx(Ze)),yl(_("agentWorkspace.sessionConfigSaved"))}catch(Ze){NO(Ze,_("agentWorkspace.sessionConfigStale"))||yo(c6(Ze,_("agentWorkspace.sessionConfigStale")))}finally{Bo(!1)}}async function RO(ce){if(!(re!=null&&re.runtimeId)||!gr)return;const $e=re.runtimeId,Ge=re.region??"cn-beijing";Bo(!0),yo(""),yl("");try{const pt=await B8({runtimeId:$e,region:Ge,sessionId:y,etag:gr.etag,changes:[{category:"mcpServers",mode:ce}]});Mr({requestKey:oi,value:pt}),yl(_("agentWorkspace.sessionConfigSaved"))}catch(pt){NO(pt,_("agentWorkspace.sessionConfigStale"))||yo(c6(pt,_("agentWorkspace.sessionConfigStale")))}finally{Bo(!1)}}async function WL(){if(!(re!=null&&re.runtimeId)||!gr||!Pf)return;const ce=re.runtimeId,$e=re.region??"cn-beijing";Dd(!0),yo(""),yl("");try{const Ge=await _Te({runtimeId:ce,region:$e,sessionId:y,etag:gr.etag,idempotencyKey:JGt(ce,y,Pf),targetProfileRevision:Pf});Mr({requestKey:oi,value:Ge}),Fo(hx(Ge)),yl(_("agentWorkspace.sessionProfileUpgraded"))}catch(Ge){NO(Ge,_("agentWorkspace.sessionConfigStale"))||yo(c6(Ge,_("agentWorkspace.sessionProfileUpgradeFailed")))}finally{Dd(!1)}}async function mv(){if(!(re!=null&&re.runtimeId))return;const ce=re.runtimeId,$e=re.region??"cn-beijing",Ge=at||ce,pt=(zi==null?void 0:zi.status)==="applied"?"update":"create",ln=(zi==null?void 0:zi.runtimeRevision)||(zi==null?void 0:zi.etag)||"",Ze=await sXt(ce,pt,t2);Qo({saving:!0,error:"",notice:""});try{const En=await jz({operationKind:pt,runtimeId:ce,region:$e,mpaInstanceId:Ge,sourceProfileId:`studio-runtime:${ce}:${Le||"a2a-default"}`,targetKey:pt==="update"?Ge:`runtime:${$e}:${ce}`,runtimeRevision:pt==="update"?ln:void 0,draft:Ba,idempotencyKey:Ze});Qo({saving:!1,error:En.status==="succeeded"?"":En.safeErrorCode||_("agentWorkspace.profileApplyIncomplete"),notice:En.status==="succeeded"?_("agentWorkspace.profileAppliedNotice",{revision:En.profileRevision??_("agentWorkspace.notAvailable")}):""}),nt(Lr=>Lr+1),Da(Lr=>Lr+1)}catch(En){Qo({saving:!1,error:En instanceof Error?En.message:_("agentWorkspace.profileApplyFailed"),notice:""})}}function s2(){!(re!=null&&re.runtimeId)||st!=="mpa"||I==null||I({draft:Ba,runtimeId:re.runtimeId,mpaInstanceId:at||re.runtimeId,name:Bd,region:re.region??"cn-beijing",appName:Le||"a2a-default",currentVersion:re.currentVersion??(ne==null?void 0:ne.currentVersion),runtimeRevision:(zi==null?void 0:zi.runtimeRevision)||(zi==null?void 0:zi.etag)||void 0})}p.useEffect(()=>{Qo({saving:!1,error:"",notice:""})},[Vt]),p.useEffect(()=>{const ce=new Set(rt.map($e=>$e.id));Ls($e=>{const Ge=new Set([...$e].filter(pt=>ce.has(pt)));return Ge.size===$e.size?$e:Ge}),Fl($e=>{const Ge=new Set([...$e].filter(pt=>ce.has(pt)));return Ge.size===$e.size?$e:Ge}),ts&&!ce.has(ts)&&ns("")},[rt,ts]),p.useEffect(()=>{vl(!1),Ls(new Set),Fl(new Set),Os(""),ns("")},[re==null?void 0:re.runtimeId]),p.useEffect(()=>{const ce=new Set(Nn.filter($e=>$e.canDelete===!0).map($e=>$e.id));un($e=>{const Ge=new Set([...$e].filter(pt=>ce.has(pt)));return Ge.size===$e.size?$e:Ge})},[Nn]),p.useEffect(()=>{const ce=new Set($n.map($e=>$e.id));Mn($e=>{const Ge=new Set([...$e].filter(pt=>ce.has(pt)));return Ge.size===$e.size?$e:Ge})},[$n]);const Em=p.useMemo(()=>!v||!(re!=null&&re.runtimeId)||v.runtimeId!==re.runtimeId||Le&&v.agentName&&v.agentName!==Le?null:{...v,tag:_(v.kind==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")},[v,re==null?void 0:re.runtimeId,Le,_]),xo=p.useMemo(()=>VGt(_),[_]),In=p.useMemo(()=>re!=null&&re.runtimeId?Em?[Em,...rt.filter(ce=>ce.id!==Em.id&&(!ce.messageId||ce.messageId!==Em.messageId))]:rt:xo,[xo,rt,Em,re==null?void 0:re.runtimeId]),Cm=In.filter(ce=>{if(ce.kind!==Et||(ce.source==="auto"?"auto":"user")!==Xe)return!1;const Ge=It.trim().toLowerCase();return Ge?[ce.input,ce.output,ce.referenceOutput,ce.comment,ce.tag??"",ce.sessionId,ce.messageId,ce.userId,ce.evaluationSetName].join(" ").toLowerCase().includes(Ge):!0}),IO=Cm.filter(ce=>Ll.has(ce.id)),PO=!!(re!=null&&re.runtimeId),a2=ce=>{At(ce),Gt(""),Os("");const $e=In.find(Ge=>Ge.kind===ce);ns(($e==null?void 0:$e.id)??""),window.setTimeout(()=>{var Ge;(Ge=Kc.current)==null||Ge.scrollIntoView({behavior:"smooth",block:"start"})},0)},KL=ce=>{Os(""),Ls($e=>{const Ge=new Set($e);return Ge.has(ce.id)?Ge.delete(ce.id):Ge.add(ce.id),Ge})},DO=()=>{Os(""),Ls(new Set(Cm.map(ce=>ce.id)))},Ud=()=>{Os(""),Ls(new Set),vl(!1)},o2=ce=>{Fl($e=>{const Ge=new Set($e);return Ge.has(ce)?Ge.delete(ce):Ge.add(ce),Ge})},MO=ce=>{ns(ce.id),Os(""),!(!ce.sessionId||!ce.messageId)&&(R==null||R(ce))},l2=async ce=>{if(!(re!=null&&re.runtimeId)||!Le||Ma||ce.length===0)return;const $e=ce.length===1?_("agentWorkspace.deleteOneCaseConfirm"):_("agentWorkspace.deleteCasesConfirm",{count:ce.length});if(!window.confirm($e))return;const Ge=ce.map(ln=>ln.id),pt=new Set(Ge);rn(!0),Os("");try{await lTe({runtimeId:re.runtimeId,region:re.region??"cn-beijing",appName:Le,itemIds:Ge});const ln=new Map;for(const Ze of ce)ln.set(Ze.kind,(ln.get(Ze.kind)??0)+1);zt(Ze=>Ze.filter(En=>!pt.has(En.id))),bt(Ze=>Ze.map(En=>({...En,itemCount:Math.max(0,En.itemCount-(ln.get(En.kind)??0))}))),Ls(Ze=>new Set([...Ze].filter(En=>!pt.has(En)))),Fl(Ze=>new Set([...Ze].filter(En=>!pt.has(En)))),ts&&pt.has(ts)&&ns(""),ce.length>1&&vl(!1),A==null||A(ce)}catch(ln){Os(ln instanceof Error?ln.message:String(ln))}finally{rn(!1)}},c2=ce=>{Lt($e=>$e.map(Ge=>Ge.id===ce.id?ce:Ge))},Bh=()=>{const ce=new Set(e.map(pt=>pt.id)),$e=n.filter(pt=>ce.has(pt)),Ge=new Set($e);return[...$e,...e.filter(pt=>!Ge.has(pt.id)).map(pt=>pt.id)]},Ss=(ce,$e,Ge)=>{if(!S||ce===$e)return;const pt=Bh().filter(En=>En!==ce),ln=pt.indexOf($e),Ze=ln<0?pt.length:Ge==="after"?ln+1:ln;pt.splice(Ze,0,ce),S(pt)},u2=(ce,$e)=>{if(!vt||vt===$e)return;const Ge=ce.currentTarget.getBoundingClientRect();cn($e),on(ce.clientY>Ge.top+Ge.height/2?"after":"before")},gv=(ce,$e)=>{if(!S)return;const Ge=Bh(),pt=Ge.indexOf(ce),ln=Math.max(0,Math.min(Ge.length-1,pt+$e));pt<0||pt===ln||(Ge.splice(pt,1),Ge.splice(ln,0,ce),S(Ge))},bv=ce=>{ce.canDelete===!0&&(zn(""),un($e=>{const Ge=new Set($e);return Ge.has(ce.id)?Ge.delete(ce.id):Ge.add(ce.id),Ge}))},LO=ce=>{zn(""),Mn($e=>{const Ge=new Set($e);return Ge.has(ce.id)?Ge.delete(ce.id):Ge.add(ce.id),Ge})},GL=()=>{zn(""),un(new Set(hv.map(ce=>ce.id))),Mn(new Set($n.map(ce=>ce.id)))},XL=()=>{zn(""),un(new Set),Mn(new Set),Sn(!1)},YL=()=>{if(Mf===0||ei)return;const ce=Mb.length,$e=gc.length;if(ce===1&&$e===0){Bb(Mb[0]);return}zn(""),di({kind:"selection",title:_(ce===1&&$e===0?"agentWorkspace.deleteAgentTitle":ce===0&&$e===1?"myAgents.deleteDraftTitle":"agentWorkspace.deleteSelectedTitle"),description:ce===1&&$e===0?_("agentWorkspace.deleteAgentDescription",{name:Mb[0].label}):ce===0&&$e===1?_("agentWorkspace.deleteDraftDescription",{name:gc[0].draft.name||_("agentSelector.unnamedAgent")}):_("agentWorkspace.deleteSelectionDescription",{count:Mf,warning:ce>0?_("agentWorkspace.runtimeDeletionWarning",{count:ce}):_("agentWorkspace.draftDeletionWarning")}),confirmLabel:_(ce===0&&$e===1?"myAgents.deleteDraft":"agentWorkspace.deleteSelected"),agents:Mb,drafts:gc})},yv=async()=>{if(!(!Rn||ei)){Bn(!0),zn("");try{if(Rn.kind==="selection"){const{agents:ce,drafts:$e}=Rn;if(ce.length>0){if(!C)throw new Error(_("agentWorkspace.errors.deleteDeployedUnsupported"));await C(ce)}$e.length>0&&(E==null||E($e)),un(new Set),Mn(new Set),Sn(!1),ce.some(Ge=>Ge.id===U)&&J(""),$e.some(Ge=>Ge.id===z)&&Z("")}else if(Rn.kind==="agent"){if(!C)throw new Error(_("agentWorkspace.errors.deleteDeployedUnsupported"));await C([Rn.agent]),U===Rn.agent.id&&J("")}else{if(!E)throw new Error(_("agentWorkspace.errors.deleteDraftUnsupported"));E([Rn.draft]),z===Rn.draft.id&&Z("")}di(null)}catch(ce){zn(ce instanceof Error?ce.message:String(ce))}finally{Bn(!1)}}},Bb=async ce=>{if(!C||ce.canDelete!==!0||ei)return;zn("");let $e=null;if(ce.agentCategory==="mpa"){if(!ce.runtimeId||!ce.region){zn(_("agentWorkspace.errors.loadMpaDeletePreview"));return}try{$e=await CTe({mpaInstanceId:ce.mpaInstanceId??ce.runtimeId,runtimeId:ce.runtimeId,region:ce.region})}catch(Ge){zn(Ge instanceof Error?Ge.message:String(Ge));return}}di({kind:"agent",title:_("agentWorkspace.deleteAgentTitle"),description:$e?a.jsx(YGt,{preview:$e,t:_}):_("agentWorkspace.deleteAgentDescription",{name:ce.label}),confirmLabel:_("agentWorkspace.deleteAgent"),canConfirm:$e?$e.canDelete:!0,agent:ce})},rs=ce=>{if(!E||ei)return;const $e=ce.draft.name||_("agentSelector.unnamedAgent");zn(""),di({kind:"draft",title:_("myAgents.deleteDraftTitle"),description:_("agentWorkspace.deleteDraftDescription",{name:$e}),confirmLabel:_("myAgents.deleteDraft"),draft:ce})},Am=()=>{const ce=`eval-${Date.now()}`,$e={id:ce,name:_("agentWorkspace.newEvaluationGroupName",{count:lt.length+1}),agentIds:[],caseSet:"核心回归集",evaluator:"综合质量评估器",metrics:["回答质量"],concurrency:"4",history:[]};Lt(Ge=>[$e,...Ge]),wn(ce)},mi=ce=>{c2({...ce,history:[{id:`run-${Date.now()}`,createdAt:_("agentWorkspace.evaluationDefaults.justNow"),score:86+ce.history.length%7,status:"completed"},...ce.history]})};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`aw-root${x?" is-detail-only":""}`,children:[a.jsxs("nav",{className:"aw-view-tabs","aria-label":_("agentWorkspace.workspace"),children:[a.jsx("button",{type:"button",className:F==="library"?"is-active":"","aria-pressed":F==="library",onClick:()=>{M("library"),ft("")},children:_("agentWorkspace.library")}),a.jsx("button",{type:"button",className:F==="evaluation"?"is-active":"","aria-pressed":F==="evaluation",onClick:()=>{M("evaluation"),ft("")},children:_("agentWorkspace.evaluation")})]}),a.jsxs("div",{className:"aw-workspace-frame",children:[a.jsxs("div",{className:"aw-workspace","aria-hidden":F==="evaluation"||void 0,ref:ce=>{ce==null||ce.toggleAttribute("inert",F==="evaluation")},children:[a.jsxs("aside",{className:"aw-sidebar","aria-label":_(F==="library"?"agentWorkspace.agentList":"agentWorkspace.evaluationGroupList"),children:[a.jsxs("label",{className:"aw-search",children:[a.jsx(fI,{"aria-hidden":!0}),a.jsx("input",{value:et,onChange:ce=>ft(ce.currentTarget.value),placeholder:_(F==="library"?"myAgents.searchAgents":"agentWorkspace.searchEvaluationGroups"),"aria-label":_(F==="library"?"myAgents.searchAgents":"agentWorkspace.searchEvaluationGroups")})]}),a.jsxs("button",{type:"button",className:"aw-create-card",onClick:F==="library"?N:Am,disabled:F==="library"&&!o,children:[a.jsx(ic,{"aria-hidden":!0}),a.jsx("span",{children:_(F==="library"?"agentWorkspace.newAgent":"agentWorkspace.newEvaluationGroup")})]}),F==="library"&&(C||E)&&a.jsx("div",{className:`aw-selection-toolbar${On?" is-active":""}`,children:On?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"aw-selection-count",children:_("agentWorkspace.selectedCount",{count:Mf})}),a.jsx("button",{type:"button",onClick:GL,disabled:JT===0||ei,children:_("agentWorkspace.selectAll")}),a.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void YL(),disabled:Mf===0||ei,children:_(ei?"common.deleting":"agentWorkspace.deleteSelected")}),a.jsx("button",{type:"button",onClick:XL,disabled:ei,children:_("common.cancel")})]}):a.jsx("button",{type:"button",onClick:()=>{zn(""),Sn(!0)},disabled:JT===0,children:_("common.select")})}),F==="library"&&ki&&a.jsx("div",{className:"aw-delete-error",role:"alert",children:ki}),a.jsx("div",{className:"aw-agent-list",children:F==="evaluation"?is.length===0?a.jsx("div",{className:"aw-list-empty",children:_("agentWorkspace.noMatchingEvaluationGroups")}):is.map(ce=>a.jsxs("button",{type:"button",className:`aw-agent-item${ce.id===Ln?" is-active":""}`,onClick:()=>wn(ce.id),children:[a.jsxs("span",{className:"aw-agent-copy aw-eval-group-copy",children:[a.jsx("strong",{children:ES(ce.name,_)}),a.jsx("small",{children:_("agentWorkspace.groupStats",{agents:ce.agentIds.length,runs:ce.history.length})})]}),a.jsx(nE,{"aria-hidden":!0})]},ce.id)):u&&Nn.length===0&&$n.length===0?a.jsx("div",{className:"aw-list-empty",children:_("agentWorkspace.loadingCloudAgents")}):d&&Nn.length===0&&$n.length===0?a.jsxs("div",{className:"aw-list-empty aw-list-error",children:[a.jsx("span",{children:d}),k&&a.jsx("button",{type:"button",onClick:k,children:_("common.retry")})]}):Nn.length===0&&$n.length===0?a.jsx("div",{className:"aw-list-empty",children:_("myAgents.noMatchingAgents")}):a.jsxs(a.Fragment,{children:[$n.map(ce=>{const Ge=f.filter(ln=>ln.draftId===ce.id).sort((ln,Ze)=>Ze.startedAt-ln.startedAt)[0]??f.filter(ln=>{var Ze,En;return((Ze=ln.agentDraft)==null?void 0:Ze.name)===ce.draft.name||ln.agentName===ce.draft.name||!!((En=ce.deploymentTarget)!=null&&En.runtimeId)&&ln.runtimeId===ce.deploymentTarget.runtimeId}).sort((ln,Ze)=>Ze.startedAt-ln.startedAt)[0],pt=lr.has(ce.id);return a.jsxs("button",{type:"button",className:["aw-agent-item",On?"is-selecting":"",pt?"is-selected-for-delete":"",ce.id===z?"is-active":""].filter(Boolean).join(" "),"aria-pressed":On?pt:void 0,onClick:()=>{if(On){LO(ce);return}J(""),Z(ce.id),q("basic")},children:[On&&a.jsx("span",{className:`aw-select-marker${pt?" is-checked":""}`,"aria-hidden":"true"}),a.jsxs("span",{className:"aw-agent-copy",children:[a.jsxs("span",{className:"aw-agent-name-row",children:[a.jsx("strong",{children:ce.draft.name||_("agentSelector.unnamedAgent")}),a.jsx("span",{className:`aw-draft-badge${(Ge==null?void 0:Ge.status)==="running"?" is-deploying":""}`,children:(Ge==null?void 0:Ge.status)==="running"?_("myAgents.deploying"):_("myAgents.draft")})]}),a.jsx("small",{children:ce.deploymentTarget?_("agentWorkspace.updatePending"):_("agentWorkspace.notPublished")})]}),a.jsx(nE,{"aria-hidden":!0})]},ce.id)}),Nn.map(ce=>{const $e=ce.runtimeId?Wt.get(ce.runtimeId):void 0,Ge=ce.runtimeId?jn.get(ce.runtimeId):void 0,pt=Qi.has(ce.id),ln=ce.canDelete===!0,Ze=($e==null?void 0:$e.status)==="running"?{label:_("myAgents.deploying"),className:" is-deploying"}:($e==null?void 0:$e.status)==="error"?{label:_("agentWorkspace.failed"),className:" is-error"}:($e==null?void 0:$e.status)==="cancelled"?{label:_("agentWorkspace.cancelled"),className:" is-muted"}:Ge?{label:_("agentWorkspace.updatePending"),className:""}:null,En=($e==null?void 0:$e.status)==="running"?_("agentWorkspace.updatingDeployment"):Ge?_("agentWorkspace.updatePending"):ce.remote?ce.host||_("agentWorkspace.remoteAgent"):_("agentWorkspace.localAgent"),Lr=["aw-agent-item","aw-agent-item--sortable",ce.id===U?"is-active":"",On?"is-selecting":"",pt?"is-selected-for-delete":"",On&&!ln?"is-selection-disabled":"",ce.id===vt?"is-dragging":"",ce.id===Qt&&ce.id!==vt?`is-drop-target is-drop-${Me}`:""].filter(Boolean).join(" ");return a.jsxs("button",{type:"button",draggable:!!S&&!On,className:Lr,"aria-pressed":On?pt:void 0,"aria-keyshortcuts":S?"Alt+ArrowUp Alt+ArrowDown":void 0,onDragStart:Ri=>{S&&(zo.current=!0,tn(ce.id),Ri.dataTransfer.effectAllowed="move",Ri.dataTransfer.setData("text/plain",ce.id))},onDragEnter:Ri=>{u2(Ri,ce.id)},onDragOver:Ri=>{!vt||vt===ce.id||(Ri.preventDefault(),Ri.dataTransfer.dropEffect="move",u2(Ri,ce.id))},onDragLeave:Ri=>{const hs=Ri.relatedTarget;hs instanceof Node&&Ri.currentTarget.contains(hs)||Qt===ce.id&&cn("")},onDrop:Ri=>{Ri.preventDefault();const hs=Ri.dataTransfer.getData("text/plain")||vt;Ss(hs,ce.id,Me),tn(""),cn(""),on("before")},onDragEnd:()=>{tn(""),cn(""),on("before"),window.setTimeout(()=>{zo.current=!1},0)},onKeyDown:Ri=>{Ri.altKey&&(Ri.key==="ArrowUp"?(Ri.preventDefault(),gv(ce.id,-1)):Ri.key==="ArrowDown"&&(Ri.preventDefault(),gv(ce.id,1)))},onClick:Ri=>{if(On){Ri.preventDefault(),bv(ce);return}if(zo.current){Ri.preventDefault(),zo.current=!1;return}Z(""),J(ce.id),q("basic"),j(ce.id)},children:[On&&a.jsx("span",{className:`aw-select-marker${pt?" is-checked":""}`,"aria-hidden":"true"}),a.jsxs("span",{className:"aw-agent-copy",children:[a.jsxs("span",{className:"aw-agent-name-row",children:[a.jsx("strong",{children:ce.label}),ce.currentVersion!=null&&a.jsxs("span",{className:"aw-version-badge",children:["v",ce.currentVersion]}),Ze&&a.jsx("span",{className:`aw-draft-badge${Ze.className}`,children:Ze.label})]}),a.jsx("small",{children:En})]}),a.jsx(nE,{"aria-hidden":!0})]},ce.id)})]})}),a.jsx("div",{className:"aw-list-count",children:_("agentWorkspace.totalCount",{count:F==="library"?e.length+ai:lt.length})})]}),F==="evaluation"&&TO?a.jsx(_Xt,{group:TO,agents:e,cases:In,onChange:c2,onRun:mi}):F==="evaluation"?a.jsx("main",{className:"aw-main aw-empty-selection",children:a.jsx("p",{children:_("agentWorkspace.noEvaluationGroupSelected")})}):!re&&!Vn&&!bi?a.jsx("main",{className:"aw-main aw-empty-selection",children:a.jsx("p",{children:_("agentWorkspace.noAgentSelected")})}):a.jsxs("main",{className:`aw-main${Hu?" is-deploying":""}${x?" resource-page":""}`,children:[re&&!oe&&s&&a.jsx("div",{className:"aw-detail-loading",role:"status","aria-live":"polite",children:a.jsxs("div",{className:"aw-detail-loading-card",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsxs("span",{children:[a.jsx("strong",{children:_("agentWorkspace.loadingAgent")}),a.jsx("small",{children:_("agentWorkspace.loadingAgentDescription")})]})]})}),Fe==="integrations"&&se&&a.jsx("div",{className:"aw-detail-loading",role:"status","aria-live":"polite",children:a.jsxs("div",{className:"aw-detail-loading-card",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsxs("span",{children:[a.jsx("strong",{children:_("agentWorkspace.probingIntegration")}),a.jsx("small",{children:_("agentWorkspace.probingIntegrationDescription")})]})]})}),a.jsx(oT,{className:"aw-agent-detail",title:Bd,description:Ba.description||_(s||x&&!mt?"agentWorkspace.loadingAgentInfo":"common.noDescription"),identitySeed:Bd,backLabel:_("agentWorkspace.backToAgentList"),onBack:x?O:void 0,meta:a.jsxs(a.Fragment,{children:[Fh!=null&&a.jsxs("span",{className:"aw-agent-meta",children:["v",Fh]}),Vn&&a.jsx("span",{className:"aw-agent-meta",children:_("myAgents.draft")}),La&&a.jsx("span",{className:"aw-agent-meta",children:_("agentWorkspace.updatePending")}),!re&&!Vn&&bi&&a.jsx("span",{className:"aw-agent-meta",children:bi.label})]}),actionsClassName:"aw-head-actions",bodyClassName:"aw-agent-detail__body",actions:Vn||La||re!=null&&re.canDelete?a.jsxs(a.Fragment,{children:[(Vn||La)&&a.jsxs(_t,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>{const ce=Vn??La;ce&&rs(ce)},disabled:ei,"aria-label":_("myAgents.deleteDraft"),title:_("myAgents.deleteDraft"),children:[a.jsx(Jg,{"aria-hidden":!0}),a.jsx("span",{children:_("myAgents.deleteDraft")})]}),(re==null?void 0:re.canDelete)&&a.jsxs(_t,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>void Bb(re),disabled:ei,"aria-label":_("agentWorkspace.deleteAgent"),title:_("agentWorkspace.deleteAgent"),children:[a.jsx(Jg,{"aria-hidden":!0}),a.jsx("span",{children:_(ei?"common.deleting":"agentWorkspace.deleteAgent")})]})]}):void 0,sections:$t.map(ce=>{var $e,Ge,pt,ln;return{key:ce.id,label:ce.label,disabled:Hu,content:ce.id===Fe?a.jsxs(a.Fragment,{children:[Vr&&pv&&a.jsx("div",{className:`aw-detail-deployment${Hu?" is-running":""}`,children:a.jsx(SXt,{task:Vr,onReturnToEdit:Sm&&D?()=>D(Sm):void 0})}),a.jsxs("div",{className:"aw-content",children:[Fe==="basic"&&a.jsxs("div",{className:"aw-basic-stack",children:[Yt&&a.jsx(Mg,{className:"aw-detail-fetch-alert",color:"warning",variant:"soft",title:_("agentWorkspace.partialInfoUnavailable"),description:_("agentWorkspace.upgradeRuntimeForDetails")}),(Ot&&!Yt||Ke)&&a.jsx(Mg,{className:"aw-detail-fetch-alert",color:"danger",variant:"soft",title:_("agentWorkspace.detailLoadFailed"),description:_("agentWorkspace.detailLoadFailedDescription"),actions:a.jsx(_t,{type:"button",color:"danger",variant:"soft",size:"sm",pill:!1,onClick:()=>nt(Ze=>Ze+1),children:_("common.retry")})}),st==="mpa"&&(es||Di||wr)&&a.jsx(Mg,{className:"aw-detail-fetch-alert",color:wr==="bound"&&!Di?"success":"warning",variant:"soft",title:_("agentWorkspace.mpaControlPlane"),description:es?_("agentWorkspace.loadingMpaAgentView"):Di||Fd||_(wr==="bound"?"agentWorkspace.mpaRuntimeBound":wr==="binding_ambiguous"?"agentWorkspace.mpaRuntimeBindingAmbiguous":wr==="orphan_runtime"?"agentWorkspace.mpaRuntimeOrphan":"agentWorkspace.mpaRuntimeMissing")}),re&&st!=="mpa"&&yt&&!yt.canUpdate&&a.jsxs("div",{className:"aw-update-recovery-notice",role:yt.recoveryStatus==="preparing"?"status":"alert",children:[a.jsx("strong",{children:yt.recoveryStatus==="preparing"?_("agentWorkspace.restoringUpdateConfig"):_("agentWorkspace.updateConfigUnavailable")}),Vo&&a.jsx("span",{children:Vo}),Xi.map(Ze=>a.jsx("span",{children:Ze},Ze))]}),a.jsxs("section",{className:"aw-deployment-panel aw-settings-card",children:[a.jsx("div",{className:"aw-section-head",children:a.jsxs("div",{children:[a.jsx("h3",{children:_("agentWorkspace.deploymentConfig")}),a.jsx("p",{children:_("agentWorkspace.deploymentConfigDescription")})]})}),a.jsxs("dl",{className:"aw-readonly-config",children:[a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.runtimeStatus")}),a.jsxs("dd",{className:(ne==null?void 0:ne.status.toLowerCase())==="ready"?"is-ready":void 0,children:[(ne==null?void 0:ne.status.toLowerCase())==="ready"&&a.jsx("span",{className:"aw-status-dot"}),(ne==null?void 0:ne.status)||_("agentWorkspace.loading")]})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.deploymentRegion")}),a.jsx("dd",{children:(ne==null?void 0:ne.region)||(re==null?void 0:re.region)||(Vr==null?void 0:Vr.region)||_("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.networkAccess")}),a.jsx("dd",{children:ne!=null&&ne.networkTypes.length?ne.networkTypes.join(" / "):_("agentWorkspace.notAvailable")})]})]})]}),a.jsxs("section",{className:"aw-canvas-card",children:[a.jsx("div",{className:"aw-card-head",children:a.jsx("strong",{children:_("agentWorkspace.executionFlow")})}),a.jsx("div",{className:"aw-canvas",children:a.jsx(IP,{draft:Ba,direction:"horizontal",selectedPath:[],onSelect:()=>{},onAdd:()=>{},onInsert:()=>{},onDelete:()=>{},readOnly:!0,interactivePreview:!0},Pi)})]}),a.jsxs("section",{className:"aw-details-card",children:[a.jsx("div",{className:"aw-card-head",children:a.jsx("strong",{children:_("agentWorkspace.details")})}),a.jsxs("dl",{className:"aw-facts",children:[a.jsxs("div",{children:[a.jsx("dt",{children:_("agentSelector.model")}),a.jsx("dd",{children:dH(oe==null?void 0:oe.model)||Ba.modelName||_("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.agentCountLabel")}),a.jsx("dd",{children:oe!=null&&oe.graph?i9e(oe.graph):r9e(Ba)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentSelector.tools")}),a.jsx("dd",{className:"aw-fact-badges",children:km.length?km.map(Ze=>a.jsx("span",{children:Ze},Ze)):_("agentWorkspace.none")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentSelector.skills")}),a.jsx("dd",{className:"aw-fact-badges",children:Fb===null?_("agentSelector.previewUnsupported"):Fb.length?Fb.map(Ze=>a.jsx("span",{children:Ze},Ze)):_("agentWorkspace.none")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("systemInfo.currentVersion")}),a.jsx("dd",{children:Fh!=null?`v${Fh}`:_("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentSelector.status")}),a.jsx("dd",{children:Vn?_("myAgents.draft"):(Vr==null?void 0:Vr.status)==="error"?_("agentWorkspace.deploymentFailed"):(Vr==null?void 0:Vr.status)==="cancelled"?_("agentWorkspace.cancelled"):La?_("agentWorkspace.updatePending"):a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"aw-status-dot"}),_("skillCenter.status.available")]})})]})]})]}),a.jsxs("section",{className:"aw-sidecar-panel aw-settings-card","aria-label":_("agentWorkspace.selectedOptimizations"),children:[a.jsx("div",{className:"aw-section-head",children:a.jsxs("div",{children:[a.jsx("h3",{children:_("agentWorkspace.selectedOptimizations")}),a.jsx("p",{children:_("agentWorkspace.selectedOptimizationsDescription")})]})}),a.jsxs("dl",{className:"aw-readonly-config",children:[a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.configurationStatus")}),a.jsx("dd",{className:Dn!=null&&Dn.enabled?"is-ready":void 0,children:Dn?Dn.enabled?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"aw-status-dot"}),_("skillCenter.status.enabled")]}):_("skillCenter.status.inactive"):_("agentWorkspace.notRecorded")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.optimizationProfile")}),a.jsx("dd",{children:Dn?amt(Dn.profile):_("agentWorkspace.legacyConfigMissing")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.selectedOptimizations")}),a.jsx("dd",{className:"aw-fact-badges",children:Dn?e2.length?e2.map(Ze=>a.jsx("span",{children:SN(Ze)},Ze)):_("agentWorkspace.noneSelected"):_("agentWorkspace.legacyConfigMissing")})]})]})]})]}),Fe==="usage"&&(re==null?void 0:re.runtimeId)&&a.jsxs("section",{className:"aw-usage","aria-busy":Ws,children:[a.jsx("div",{className:"aw-usage-intro",children:a.jsx("h3",{children:_("agentWorkspace.usageOverview")})}),Ws&&!Ti&&a.jsx("div",{className:"aw-usage-state",role:"status","aria-live":"polite",children:a.jsx(fn,{as:"span",children:_("agentWorkspace.loadingUsage")})}),rr&&a.jsxs("div",{className:"aw-usage-state is-error",role:"alert",children:[a.jsx("span",{children:rr}),a.jsx("button",{type:"button",onClick:()=>hl(Ze=>Ze+1),children:_("common.retry")})]}),!Ws&&!rr&&!Ti&&!Le&&a.jsx("div",{className:"aw-usage-state",children:_("agentWorkspace.usageUnavailable")}),Ti&&a.jsxs(a.Fragment,{children:[a.jsxs("dl",{className:"aw-usage-summary","aria-label":_("agentWorkspace.usageSummary"),children:[a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.totalCalls")}),a.jsx("dd",{children:Ti.totalInvocations.toLocaleString(L.resolvedLanguage??L.language)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.userCount")}),a.jsx("dd",{children:Ti.totalUsers.toLocaleString(L.resolvedLanguage??L.language)})]})]}),a.jsxs("div",{className:"aw-usage-users-head",children:[a.jsx("h3",{children:_("agentWorkspace.userDetails")}),Ws&&a.jsx(fn,{as:"span",role:"status","aria-live":"polite",children:_("agentWorkspace.refreshing")})]}),Ti.users.length===0?a.jsx("div",{className:"aw-usage-state",children:_("agentWorkspace.noUsage")}):a.jsx("div",{className:"aw-usage-table-wrap",children:a.jsxs("table",{className:"aw-usage-table",children:[a.jsx("caption",{children:_("agentWorkspace.usageUserList")}),a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:_("agentWorkspace.user")}),a.jsx("th",{scope:"col",children:_("agentWorkspace.callCount")}),a.jsx("th",{scope:"col",children:_("agentWorkspace.lastUsed")})]})}),a.jsx("tbody",{children:Ti.users.map(Ze=>a.jsxs("tr",{children:[a.jsxs("td",{children:[a.jsx("strong",{children:Ze.displayName||Ze.userId||_("agentWorkspace.unknownUser")}),Ze.displayName&&Ze.userId&&a.jsx("small",{title:Ze.userId,children:Ze.userId})]}),a.jsx("td",{children:Ze.invocationCount.toLocaleString(L.resolvedLanguage??L.language)}),a.jsx("td",{children:a.jsx("time",{dateTime:Ze.lastUsedAt,children:JBe(Ze.lastUsedAt,L.resolvedLanguage??L.language,_)})})]},Ze.userId))})]})}),Ti.totalPages>1&&a.jsxs("nav",{className:"aw-usage-pagination","aria-label":_("agentWorkspace.usagePagination"),children:[a.jsx("button",{type:"button",disabled:Ws||Ti.page<=1,onClick:()=>ws(Ze=>Math.max(1,Ze-1)),children:_("common.previousPage")}),a.jsx("span",{"aria-live":"polite",children:_("agentWorkspace.pageOf",{page:Ti.page,total:Ti.totalPages})}),a.jsx("button",{type:"button",disabled:Ws||Ti.page>=Ti.totalPages,onClick:()=>ws(Ze=>Ze+1),children:_("common.nextPage")})]})]})]}),Fe==="sessionConfig"&&a.jsx(oXt,{config:gr,profileStatus:zi,loadable:Lh,disabledReason:$b,loading:Pa,saving:Uu,upgrading:hc,error:Md,notice:Ld,modelValue:gl,modelDirty:zu,profileUpgradeAvailable:Rr,onModelChange:Fo,onSaveModel:()=>void r2(),onInheritModel:()=>void r2("inherit"),onClearMcp:()=>void RO("clear"),onInheritMcp:()=>void RO("inherit"),onUpgradeProfile:()=>void WL(),onRefresh:()=>Da(Ze=>Ze+1)}),Fe==="profileConfig"&&a.jsx(aXt,{profile:t2,profileStatus:zi,runtimeReady:Db,disabledReason:qL,saving:Uo.saving,error:Uo.error,notice:Uo.notice,onApply:()=>void mv(),onEditProfile:s2,onRefresh:()=>nt(Ze=>Ze+1)}),Fe==="diagnostics"&&a.jsx(uXt,{data:dv,loadable:!n2,disabledReason:n2,loading:ml,error:gi,onRefresh:()=>Ks(Ze=>Ze+1),locale:L.resolvedLanguage??L.language}),Fe==="versions"&&a.jsxs("section",{className:"aw-version-stack",children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:_("agentWorkspace.githubVersions")}),a.jsx("p",{children:($e=ge==null?void 0:ge.cicd)!=null&&$e.enabled?_("agentWorkspace.githubVersionsDescription"):_("agentWorkspace.currentVersionOnly")})]}),Se&&a.jsx("div",{className:"aw-case-empty",children:_("agentWorkspace.loadingVersions")}),Ye&&a.jsxs("div",{className:"aw-integration-error",role:"alert",children:[a.jsx("span",{children:Ye}),(re==null?void 0:re.runtimeId)&&a.jsx("button",{type:"button",onClick:()=>void dN(re.runtimeId??"").then(Oe),children:_("common.retry")})]}),!Se&&!Ye&&a.jsxs("div",{className:"aw-version-list",children:[(ge==null?void 0:ge.githubSyncError)&&a.jsx("div",{className:"aw-integration-error",role:"alert",children:a.jsx("span",{children:ge.githubSyncError})}),(ge==null?void 0:ge.latestSourceRuntimeStatus)&&ge.latestSourceRuntimeStatus!=="published"&&((Ge=ge.versions[0])==null?void 0:Ge.commitSha)&&ge.versions[0].commitSha!==ge.currentCommitSha&&a.jsx("div",{className:"aw-integration-notice",role:"status",children:a.jsxs("span",{children:[_("agentWorkspace.sourceMergedRuntimeStill"),$oe(ge.latestSourceRuntimeStatus,_),_("agentWorkspace.currentProductionVersionHint")]})}),ge!=null&&ge.versions.length?ge.versions.map(Ze=>{var sa;const En=Ze.commitSha??"",Lr=Ze.runtimeStatus??Ze.status,Ri=Ze.changeType==="rollback",hs=!!((sa=ge.cicd)!=null&&sa.enabled)&&!!En&&!Ri&&En!==ge.currentCommitSha;return a.jsxs("article",{className:"aw-version-row",children:[a.jsxs("div",{children:[a.jsx("strong",{children:tXt(Ze,_)}),a.jsx("small",{children:Ze.createdAt||_("agentWorkspace.noTime")})]}),a.jsxs("div",{children:[a.jsx("span",{children:_("agentWorkspace.prLink")}),Ze.pullRequestUrl?a.jsx("a",{href:Ze.pullRequestUrl,target:"_blank",rel:"noopener noreferrer",children:_("agentWorkspace.viewPr")}):a.jsx("em",{children:_("agentWorkspace.noPr")})]}),a.jsxs("div",{children:[a.jsx("span",{children:_("agentWorkspace.author")}),a.jsx("em",{children:Ze.author||"Studio"})]}),a.jsxs("div",{children:[a.jsx("span",{children:_("agentWorkspace.publishStatus")}),a.jsx("em",{children:$oe(Lr,_)})]}),a.jsxs("div",{className:"aw-version-actions",children:[a.jsx("button",{type:"button",disabled:!hs||we===En,onClick:()=>void jO(Ze),children:_(we===En?"agentWorkspace.rollingBack":"agentWorkspace.rollbackToVersion")}),Ze.workflowRunUrl&&a.jsx("a",{href:Ze.workflowRunUrl,target:"_blank",rel:"noopener noreferrer",children:_("agentWorkspace.viewRelease")})]})]},`${Ze.version}-${En||Ze.createdAt}`)}):a.jsxs("article",{className:"aw-version-row",children:[a.jsxs("div",{children:[a.jsx("strong",{children:Fh!=null?`v${Fh}`:_("agentWorkspace.noVersion")}),a.jsx("small",{children:(ne==null?void 0:ne.updatedAt)||_("agentWorkspace.noTime")})]}),a.jsx("p",{children:_("agentWorkspace.currentVersionOnly")})]})]})]}),Fe==="integrations"&&a.jsxs("div",{className:"aw-integration-stack",children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:_("agentWorkspace.integrationMethods")}),a.jsx("p",{children:_("agentWorkspace.integrationDescription")})]}),X&&a.jsxs("div",{className:"aw-integration-error",role:"alert",children:[a.jsx("span",{children:X}),a.jsx("button",{type:"button",onClick:()=>be(Ze=>Ze+1),children:_("common.retry")})]}),!X&&a.jsxs("div",{className:"aw-integration-body",children:[a.jsxs("div",{className:`aw-integration-protocol-tabs${ue==="a2a"?" is-a2a":""}`,role:"tablist","aria-label":_("agentWorkspace.integrationProtocol"),children:[a.jsx("span",{className:"aw-integration-protocol-slider","aria-hidden":"true"}),Pk.map((Ze,En)=>a.jsx("button",{type:"button",id:`integration-${Ze.id}-tab`,role:"tab","aria-selected":ue===Ze.id,"aria-controls":`integration-${Ze.id}-panel`,tabIndex:ue===Ze.id?0:-1,onClick:()=>fs(Ze.id),onKeyDown:Lr=>{var sa;if(!["ArrowLeft","ArrowRight","Home","End"].includes(Lr.key))return;Lr.preventDefault();const Ri=Lr.key==="Home"?0:Lr.key==="End"?Pk.length-1:(En+(Lr.key==="ArrowRight"?1:-1)+Pk.length)%Pk.length,hs=Pk[Ri];fs(hs.id),(sa=document.getElementById(`integration-${hs.id}-tab`))==null||sa.focus()},children:Ze.label},Ze.id))]}),ue==="api-server"?a.jsx(Boe,{protocol:"api-server",title:"API Server",available:pc,fields:[{label:"Agent",value:pc?((pt=Hn==null?void 0:Hn.apiApps)==null?void 0:pt.join("、"))??"":""},{label:_("agentWorkspace.discoveryEndpoint"),value:pc?u6(Vu,"/list-apps"):""},{label:_("agentWorkspace.invocationEndpoint"),value:pc?u6(Vu,"/run_sse"):""},{label:_("agentWorkspace.authentication"),value:pc?Loe(ne==null?void 0:ne.authType,_):""},{label:"API Key",value:a.jsx(Foe,{available:pc,authType:ne==null?void 0:ne.authType,value:sr,visible:Pe&&!!sr,loading:ze,error:ae,onToggle:()=>void _O()})}],example:pc?nXt(Vu,Om,ne==null?void 0:ne.authType):""}):a.jsx(Boe,{protocol:"a2a",title:"A2A",available:$a,fields:[{label:"Agent",value:((ln=Hn==null?void 0:Hn.a2a)==null?void 0:ln.name)??""},{label:"Agent Card",value:$a?u6(Vu,"/.well-known/agent-card.json"):""},{label:_("agentWorkspace.invocationUrl"),value:Df},{label:_("agentWorkspace.authentication"),value:$a?Loe(ne==null?void 0:ne.authType,_):""},{label:"API Key",value:a.jsx(Foe,{available:$a,authType:ne==null?void 0:ne.authType,value:sr,visible:Pe&&!!sr,loading:ze,error:ae,onToggle:()=>void _O()})}],example:$a?iXt(Df,ne==null?void 0:ne.authType):""})]})]}),Fe==="evaluations"&&a.jsxs("section",{className:"aw-cases",children:[(re==null?void 0:re.runtimeId)&&a.jsx("div",{className:"aw-case-summary",children:["good","bad"].map(Ze=>{const En=bXt(Qe,Ze),Lr=In.filter(hs=>hs.kind===Ze).length,Ri=Em?Lr:(En==null?void 0:En.itemCount)??Lr;return a.jsxs("button",{type:"button",onClick:()=>a2(Ze),children:[a.jsx("strong",{children:Ri}),a.jsx("span",{children:_(Ze==="good"?"agentWorkspace.goodCases":"agentWorkspace.badCases")})]},Ze)})}),a.jsxs("div",{className:"aw-case-filter-bar",children:[a.jsxs("div",{className:"aw-case-filter-stack",children:[a.jsx("div",{className:"aw-case-filters","aria-label":_("agentWorkspace.caseResultFilter"),children:["good","bad"].map(Ze=>a.jsx("button",{type:"button",className:Et===Ze?"is-active":"","aria-pressed":Et===Ze,onClick:()=>At(Ze),children:_(Ze==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")},Ze))}),a.jsx("div",{className:"aw-case-source-filters","aria-label":_("agentWorkspace.feedbackSourceFilter"),children:["auto","user"].map(Ze=>a.jsx("button",{type:"button",className:Xe===Ze?"is-active":"","aria-pressed":Xe===Ze,onClick:()=>wt(Ze),children:_(Ze==="auto"?"agentWorkspace.automaticFeedback":"agentWorkspace.manualFeedback")},Ze))})]}),a.jsxs("label",{className:"aw-case-search",children:[a.jsx(fI,{"aria-hidden":!0}),a.jsx("input",{type:"search",value:It,onChange:Ze=>Gt(Ze.currentTarget.value),placeholder:_("agentWorkspace.searchCasesPlaceholder"),"aria-label":_("agentWorkspace.searchCases")})]})]}),PO&&a.jsx("div",{className:`aw-case-toolbar${Qu?" is-active":""}`,children:Qu?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"aw-selection-count",children:_("agentWorkspace.selectedCaseCount",{count:IO.length})}),a.jsx("button",{type:"button",onClick:DO,disabled:Cm.length===0||Ma,children:_("agentWorkspace.selectAllVisible")}),a.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void l2(IO),disabled:IO.length===0||Ma,children:_(Ma?"common.deleting":"agentWorkspace.deleteSelected")}),a.jsx("button",{type:"button",onClick:Ud,disabled:Ma,children:_("common.cancel")})]}):a.jsx("button",{type:"button",onClick:()=>{Os(""),vl(!0)},disabled:Cm.length===0||Ma,children:_("agentWorkspace.selectCases")})}),$l&&a.jsx("div",{className:"aw-delete-error",role:"alert",children:$l}),a.jsx("div",{ref:Kc,children:a.jsx(TXt,{cases:Cm,loading:Ht&&Cm.length===0,error:jr,notice:qs,runtimeBacked:!!(re!=null&&re.runtimeId),selectionMode:Qu,selectedCaseIds:Ll,focusedCaseId:ts,expandedCaseIds:$d,deleting:Ma,canDelete:PO,onOpenCase:MO,onToggleCase:KL,onToggleExpanded:o2,onDeleteCase:Ze=>void l2([Ze]),onRetry:()=>Si(Ze=>Ze+1)})})]}),Fe==="optimizations"&&a.jsxs("section",{className:"aw-optimizations",children:[a.jsxs("div",{className:"aw-optimization-intro",children:[a.jsx("h3",{children:_("agentWorkspace.optimizations")}),a.jsx("p",{children:_("agentWorkspace.optimizationsDescription")})]}),ga?a.jsxs("div",{className:"aw-optimization-state",role:"status",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsx("span",{children:_("agentWorkspace.loadingOptimizations")})]}):us?a.jsxs("div",{className:"aw-optimization-state is-error",role:"alert",children:[a.jsx("span",{children:us}),a.jsx("button",{type:"button",onClick:()=>bo(Ze=>Ze+1),children:_("common.retry")})]}):Zr.length>0?a.jsx(CXt,{groups:Zr}):a.jsx("div",{className:"aw-optimization-state",children:_("agentWorkspace.noOptimizations")})]})]}),Fe==="basic"&&(re||Vn)&&a.jsxs("div",{className:"aw-basic-actions",children:[re&&a.jsxs("button",{type:"button",className:"aw-talk studio-update-action",onClick:()=>T==null?void 0:T(re),children:[a.jsx(zat,{"aria-hidden":!0}),a.jsx("span",{children:_("agentWorkspace.chat")})]}),st!=="mpa"&&a.jsxs("span",{className:`aw-update-wrap${$h?" is-disabled":""}`,tabIndex:$h?0:void 0,"aria-describedby":$h?Lb:void 0,children:[a.jsx("button",{type:"button",className:"aw-update studio-update-action",disabled:!!$h,"aria-busy":jt||void 0,"aria-describedby":$h?Lb:void 0,onClick:()=>{if(Vn){D==null||D(Vn);return}yt&&P(yt)},children:jt?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"loading-gap-spinner aw-update-spinner","aria-hidden":"true"}),a.jsx("span",{children:_("agentWorkspace.preparing")})]}):_(Vn||La?"agentWorkspace.continueEditing":"agentWorkspace.update")}),$h&&a.jsx("span",{id:Lb,className:"aw-update-disabled-reason",role:"tooltip",children:$h})]})]})]}):null}}),activeSectionKey:Fe,navigationLabel:_("agentWorkspace.agentDetails"),onSectionChange:q})]})]}),F==="evaluation"&&a.jsx("div",{className:"aw-evaluation-glass",role:"status",children:a.jsx("span",{children:_("agentWorkspace.comingSoon")})})]})]}),Rn&&a.jsx(Cd,{variant:"danger",title:Rn.title,description:Rn.description,confirmLabel:ei?_("common.deleting"):Rn.confirmLabel,closeLabel:_("agentWorkspace.closeDeleteConfirmation"),busy:ei,confirmDisabled:Rn.canConfirm===!1,onCancel:()=>di(null),onConfirm:()=>void yv()})]})}function CXt({groups:e}){const{t}=Te("ui");return a.jsx("div",{className:"aw-optimization-table-wrap",children:a.jsxs("table",{className:"aw-optimization-table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:t("agentWorkspace.fixPriority")}),a.jsx("th",{scope:"col",children:t("agentWorkspace.suggestedModule")}),a.jsx("th",{scope:"col",children:t("agentWorkspace.suggestionAndReason")})]})}),a.jsx("tbody",{children:e.map(n=>a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx("span",{className:`aw-priority is-${n.priority}`,children:pXt(n.priority,t)})}),a.jsx("td",{children:a.jsx("span",{className:"aw-optimization-module",children:gXt(n,t)})}),a.jsx("td",{children:a.jsx("ul",{className:"aw-optimization-list",children:n.items.map(i=>a.jsxs("li",{children:[a.jsx("strong",{children:i.suggestion}),a.jsx("p",{children:i.reason})]},`${i.suggestion}:${i.reason}`))})})]},`${n.priority}:${n.module}:${n.customModule??""}`))})]})})}function AXt(){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M4.5 7h15"}),a.jsx("path",{d:"M9 7V4.8h6V7"}),a.jsx("path",{d:"m6.5 7 .8 12h9.4l.8-12"}),a.jsx("path",{d:"M10 10.5v5M14 10.5v5"})]})}function TXt({cases:e,loading:t=!1,error:n="",notice:i="",runtimeBacked:r=!1,selectionMode:s=!1,selectedCaseIds:o,focusedCaseId:l="",expandedCaseIds:c,deleting:u=!1,canDelete:d=!1,onOpenCase:f,onToggleCase:h,onToggleExpanded:m,onDeleteCase:g,onRetry:b}){const{t:v,i18n:y}=Te("ui");return a.jsxs("div",{className:"aw-case-table",children:[a.jsxs("div",{className:"aw-case-row aw-case-row-head",children:[a.jsx("span",{children:v("agentWorkspace.userInput")}),a.jsx("span",{children:v("agentWorkspace.agentOutput")}),a.jsx("span",{children:v("agentWorkspace.score")}),a.jsx("span",{children:v("agentWorkspace.scoreReason")}),a.jsx("span",{className:"aw-case-action-head",children:v("skillCenter.actions")})]}),t?a.jsx("div",{className:"aw-case-empty",children:v("agentWorkspace.loadingEvaluationSet")}):n?a.jsxs("div",{className:"aw-case-empty aw-case-error",children:[a.jsx("span",{children:n}),b&&a.jsx("button",{type:"button",onClick:b,children:v("common.retry")})]}):i?a.jsx("div",{className:"aw-case-empty",children:i}):e.length===0?a.jsx("div",{className:"aw-case-empty",children:v(r?"agentWorkspace.noFeedbackCases":"agentWorkspace.noMatchingCases")}):e.map(w=>{var T,R;const x=w.id.startsWith("local:"),O=(o==null?void 0:o.has(w.id))??!1,k=(c==null?void 0:c.has(w.id))??!1,C=w.output.length+w.referenceOutput.length>220||(((T=w.reason)==null?void 0:T.length)??0)>120,E=d&&!x,j=!!(w.comment&&w.comment.trim()!==((R=w.reason)==null?void 0:R.trim()));return a.jsxs("div",{className:["aw-case-row",l===w.id?"is-focused":"",s?"is-selecting":"",O?"is-selected-for-delete":""].filter(Boolean).join(" "),role:"row",tabIndex:0,"aria-selected":s?O:void 0,onClick:()=>{if(s){E&&(h==null||h(w));return}f==null||f(w)},onKeyDown:A=>{A.target===A.currentTarget&&(A.key!=="Enter"&&A.key!==" "||(A.preventDefault(),s?E&&(h==null||h(w)):f==null||f(w)))},children:[a.jsxs("div",{className:"aw-case-text aw-case-cell","data-label":v("agentWorkspace.userInput"),children:[a.jsxs("span",{className:"aw-case-title-line",children:[s&&E&&a.jsx("span",{className:`aw-select-marker${O?" is-checked":""}`,"aria-hidden":"true"}),a.jsx("strong",{title:w.input,children:w.input||v("agentWorkspace.noUserInput")})]}),j&&a.jsxs("small",{title:w.comment,children:[v("agentWorkspace.note"),w.comment]}),a.jsx("small",{className:"aw-case-time",children:fXt(w.createdAt,y.resolvedLanguage??y.language,v)}),(w.userId||w.sessionId)&&a.jsx("small",{title:[w.userId,w.sessionId].filter(Boolean).join(" · "),children:[w.userId,w.sessionId].filter(Boolean).join(" · ")})]}),a.jsxs("div",{className:`aw-case-output aw-case-cell${k?" is-expanded":""}`,"data-label":v("agentWorkspace.agentOutput"),children:[a.jsx("p",{className:"aw-case-output-preview",title:w.output,children:w.output||v("agentWorkspace.noVisibleResponse")}),w.referenceOutput&&a.jsxs("small",{className:"aw-case-output-preview",title:w.referenceOutput,children:[v("agentWorkspace.reference"),": ",w.referenceOutput]}),C&&a.jsx("button",{type:"button",className:"aw-case-expand",onClick:A=>{A.stopPropagation(),m==null||m(w.id)},children:v(k?"common.collapse":"common.expand")})]}),a.jsx("div",{className:"aw-case-score aw-case-cell","data-label":v("agentWorkspace.score"),children:hXt(w,v)}),a.jsx("div",{className:`aw-case-reason aw-case-cell${k?" is-expanded":""}`,"data-label":v("agentWorkspace.scoreReason"),children:a.jsx("p",{title:w.reason||void 0,children:w.reason||"—"})}),a.jsx("div",{className:"aw-case-actions aw-case-cell","data-label":v("skillCenter.actions"),children:E&&a.jsx("button",{type:"button",className:"aw-case-delete",onClick:A=>{A.stopPropagation(),g==null||g(w)},disabled:u,title:v("agentWorkspace.deleteFeedbackCase"),"aria-label":v("agentWorkspace.deleteFeedbackCase"),children:a.jsx(AXt,{})})})]},w.id)})]})}function _Xt({group:e,agents:t,cases:n,onChange:i,onRun:r}){const{t:s}=Te("ui"),[o,l]=p.useState("config"),c=e.agentIds.map(h=>t.find(m=>m.id===h)).filter(h=>!!h),u=["回答质量","事实准确性","工具调用","响应效率"];p.useEffect(()=>l("config"),[e.id]);const d=h=>{i({...e,agentIds:e.agentIds.includes(h)?e.agentIds.filter(m=>m!==h):[...e.agentIds,h]})},f=h=>{i({...e,metrics:e.metrics.includes(h)?e.metrics.filter(m=>m!==h):[...e.metrics,h]})};return a.jsxs("main",{className:"aw-main",children:[a.jsxs("div",{className:"aw-eval-head",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"aw-agent-title-row",children:[a.jsx("h2",{children:ES(e.name,s)}),a.jsx("span",{children:s("agentWorkspace.evaluationGroup")})]}),a.jsx("p",{children:s("agentWorkspace.evaluationGroupStats",{agents:c.length,caseSet:ES(e.caseSet,s),runs:e.history.length})})]}),a.jsxs("button",{type:"button",className:"aw-run",onClick:()=>r(e),disabled:!0,children:[a.jsx(Mat,{"aria-hidden":!0}),s("agentWorkspace.startEvaluation")]})]}),a.jsxs("nav",{className:"aw-agent-tabs","aria-label":s("agentWorkspace.evaluationGroupDetails"),children:[a.jsx("button",{type:"button",className:o==="config"?"is-active":"","aria-pressed":o==="config",onClick:()=>l("config"),disabled:!0,children:s("agentWorkspace.evaluationConfig")}),a.jsx("button",{type:"button",className:o==="history"?"is-active":"","aria-pressed":o==="history",onClick:()=>l("history"),disabled:!0,children:s("agentWorkspace.historyResults")})]}),a.jsx("div",{className:"aw-content",children:o==="config"?a.jsxs("div",{className:"aw-eval-setup",children:[a.jsxs("section",{className:"aw-eval-block",children:[a.jsxs("div",{className:"aw-card-head",children:[a.jsx("strong",{children:s("agentWorkspace.participatingAgents")}),a.jsx("span",{children:s("agentWorkspace.selectedCount",{count:c.length})})]}),a.jsx("div",{className:"aw-eval-agent-grid",children:t.map(h=>a.jsxs("label",{children:[a.jsx("input",{type:"checkbox",checked:e.agentIds.includes(h.id),onChange:()=>d(h.id)}),a.jsxs("span",{children:[a.jsx("strong",{children:h.label}),a.jsx("small",{children:h.remote?s("agentWorkspace.remote"):s("agentWorkspace.local")})]})]},h.id))})]}),a.jsxs("div",{className:"aw-eval-setting-grid",children:[a.jsxs("section",{className:"aw-eval-block",children:[a.jsx("div",{className:"aw-card-head",children:a.jsx("strong",{children:s("agentWorkspace.evaluationResources")})}),a.jsxs("div",{className:"aw-eval-fields",children:[a.jsxs("label",{children:[a.jsx("span",{children:s("agentWorkspace.evaluationSet")}),a.jsxs("select",{value:e.caseSet,onChange:h=>i({...e,caseSet:h.currentTarget.value}),children:[a.jsx("option",{value:"核心回归集",children:s("agentWorkspace.evaluationDefaults.coreSet")}),a.jsx("option",{value:"安全边界集",children:s("agentWorkspace.evaluationDefaults.safetySet")}),a.jsx("option",{value:"工具调用集",children:s("agentWorkspace.evaluationDefaults.toolSet")})]}),a.jsx("small",{children:s("agentWorkspace.caseCount",{count:n.length})})]}),a.jsxs("label",{children:[a.jsx("span",{children:s("agentWorkspace.evaluator")}),a.jsxs("select",{value:e.evaluator,onChange:h=>i({...e,evaluator:h.currentTarget.value}),children:[a.jsx("option",{value:"综合质量评估器",children:s("agentWorkspace.evaluationDefaults.qualityEvaluator")}),a.jsx("option",{value:"事实一致性评估器",children:s("agentWorkspace.evaluationDefaults.factualEvaluator")}),a.jsx("option",{value:"工具调用评估器",children:s("agentWorkspace.evaluationDefaults.toolEvaluator")})]})]}),a.jsxs("label",{children:[a.jsx("span",{children:s("agentWorkspace.concurrency")}),a.jsxs("select",{value:e.concurrency,onChange:h=>i({...e,concurrency:h.currentTarget.value}),children:[a.jsx("option",{value:"2",children:"2"}),a.jsx("option",{value:"4",children:"4"}),a.jsx("option",{value:"8",children:"8"})]})]})]})]}),a.jsxs("section",{className:"aw-eval-block",children:[a.jsxs("div",{className:"aw-card-head",children:[a.jsx("strong",{children:s("agentWorkspace.evaluationMetrics")}),a.jsx("span",{children:s("agentWorkspace.selectedMetricCount",{count:e.metrics.length})})]}),a.jsx("div",{className:"aw-metric-list",children:u.map(h=>a.jsxs("label",{children:[a.jsx("input",{type:"checkbox",checked:e.metrics.includes(h),onChange:()=>f(h)}),a.jsx("span",{children:ES(h,s)})]},h))})]})]})]}):a.jsxs("section",{className:"aw-eval-history",children:[a.jsx("div",{className:"aw-section-head",children:a.jsxs("div",{children:[a.jsx("h3",{children:s("agentWorkspace.historyResults")}),a.jsx("p",{children:s("agentWorkspace.historyDescription")})]})}),e.history.length===0?a.jsxs("div",{className:"aw-results-empty",children:[a.jsx("strong",{children:s("agentWorkspace.noHistory")}),a.jsx("span",{children:s("agentWorkspace.noHistoryDescription")})]}):a.jsx("div",{className:"aw-history-list",children:e.history.map((h,m)=>a.jsxs("button",{type:"button",children:[a.jsxs("span",{children:[a.jsx("strong",{children:s("agentWorkspace.evaluationRun",{index:e.history.length-m})}),a.jsx("small",{children:s("agentWorkspace.evaluationRunMeta",{time:ES(h.createdAt,s),agents:c.length})})]}),a.jsxs("span",{className:"aw-history-score",children:[a.jsx("strong",{children:h.score}),a.jsx("small",{children:s("agentWorkspace.overallScore")})]}),a.jsxs("span",{className:"aw-complete",children:[a.jsx(Ef,{}),s("agentWorkspace.completed")]}),a.jsx(nE,{"aria-hidden":!0})]},h.id))})]})})]})}async function pK(e,t={}){const n=await fetch(Ta(`/web/agent-reviews${e}`),{...t,headers:ul(uc({"Content-Type":"application/json"})),signal:po(t.signal??void 0,6e4)});if(!n.ok)throw new Error(await n.text());return n.json()}function jXt(e,t){return pK(`?${new URLSearchParams({region:e})}`,{signal:t})}function NXt(e,t,n){return pK(`/${encodeURIComponent(e)}?${new URLSearchParams({region:t})}`,{signal:n})}function RXt(e,t,n){return pK(`/${encodeURIComponent(e)}/${t}`,{method:"POST",body:JSON.stringify(n)})}const IXt=20,zoe=256;function d6({label:e,value:t,onChange:n,limit:i,disabled:r,required:s=!1}){const{t:o}=Te("agentReviews");return a.jsxs("label",{children:[e,a.jsx("textarea",{"aria-label":e,value:t,onChange:l=>n(Array.from(l.target.value).slice(0,i).join("")),maxLength:i*2,disabled:r,required:s,rows:3}),a.jsx("span",{className:"agent-review-text-count",children:o("textCount",{count:Array.from(t).length,limit:i})})]})}function PP({person:e}){return a.jsxs("span",{className:"agent-review-person",title:e.email||e.name,children:[e.avatarUrl?a.jsx("img",{src:e.avatarUrl,alt:"",referrerPolicy:"no-referrer",onError:t=>{t.currentTarget.hidden=!0}}):null,a.jsx("span",{children:e.name||e.id})]})}function l9e({runtimeId:e,region:t,name:n,canPublish:i,onClose:r,onChanged:s}){const{t:o,i18n:l}=Te("agentReviews"),[c,u]=p.useState(null),[d,f]=p.useState(!0),[h,m]=p.useState(!1),[g,b]=p.useState(""),[v,y]=p.useState(""),[w,x]=p.useState(""),[O,k]=p.useState(""),[S,C]=p.useState(0),[E,j]=p.useState(!1),[T,R]=p.useState(null);p.useEffect(()=>{const _=new AbortController;return f(!0),b(""),NXt(e,t,_.signal).then(L=>{_.signal.aborted||u(L.application)}).catch(L=>{_.signal.aborted||b(L instanceof Error?L.message:String(L))}).finally(()=>{_.signal.aborted||f(!1)}),()=>_.abort()},[e,t,S]);async function A(_,L){if(!h){m(!0),b("");try{const F=await RXt(e,_,{region:t,..._==="submit"?{message:v}:{},..._==="publish"||_==="decision"?{comment:w}:{},..._==="decision"?{applicationId:c==null?void 0:c.id,decision:L,reason:O}:{}});u(F),x(""),k(""),j(!1),R(null),s()}catch(F){b(F instanceof Error?F.message:String(F))}finally{m(!1)}}}const N=(c==null?void 0:c.status)==="pending",P=!!(c!=null&&c.published),I=!N&&!P,D=_=>new Date(_).toLocaleString(l.language);return a.jsx(sv,{open:!0,onOpenChange:_=>{!_&&!h&&r()},children:a.jsxs(rv,{children:[a.jsx(nv,{className:"agent-review-backdrop"}),a.jsxs(iv,{className:"agent-review-dialog",children:[a.jsxs("header",{className:"agent-review-dialog-header",children:[a.jsxs("div",{children:[a.jsx(yO,{children:n}),a.jsx(LT,{children:o("dialogDescription")})]}),a.jsx(hL,{className:"agent-review-close",disabled:h,"aria-label":o("close"),children:a.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m6 6 12 12M6 18 18 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})})]}),a.jsxs("div",{className:"agent-review-dialog-body",children:[d?a.jsx(cl,{}):null,g?a.jsxs("div",{className:"agent-review-error",role:"alert",children:[a.jsx("p",{children:g}),a.jsx("button",{type:"button",disabled:h||d,onClick:()=>C(_=>_+1),children:o("refresh")})]}):null,!d&&c?a.jsxs(a.Fragment,{children:[a.jsxs("dl",{className:"agent-review-facts",children:[a.jsxs("div",{children:[a.jsx("dt",{children:o("statusTitle")}),a.jsxs("dd",{children:[o(`status.${c.status}`),c.status==="approved"&&!P?` · ${o("private")}`:""]})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("submitter")}),a.jsx("dd",{children:a.jsx(PP,{person:c.submitter})})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("submittedAt")}),a.jsx("dd",{children:D(c.submittedAt)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("version")}),a.jsx("dd",{children:c.agent.version??"—"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("model")}),a.jsx("dd",{children:c.agent.model||"—"})]}),c.reviewer?a.jsxs("div",{children:[a.jsx("dt",{children:o(c.status==="returned"?"returnedBy":"approvedBy")}),a.jsx("dd",{children:a.jsx(PP,{person:c.reviewer})})]}):null,c.reviewedAt?a.jsxs("div",{children:[a.jsx("dt",{children:o("reviewedAt")}),a.jsx("dd",{children:D(c.reviewedAt)})]}):null]}),a.jsxs("section",{children:[a.jsx("h3",{children:o("description")}),a.jsx("p",{children:c.agent.description||"—"})]}),c.message?a.jsxs("section",{children:[a.jsx("h3",{children:o("message")}),a.jsx("p",{children:c.message})]}):null,c.reason?a.jsxs("section",{children:[a.jsx("h3",{children:o("reason")}),a.jsx("p",{children:c.reason})]}):null,c.comment?a.jsxs("section",{children:[a.jsx("h3",{children:o("comment")}),a.jsx("p",{children:c.comment})]}):null,c.contentChanged?a.jsx("p",{role:"alert",className:"agent-review-warning",children:o("contentChanged")}):null]}):null,!d&&!g&&I&&!i?a.jsx(d6,{label:o("message"),value:v,onChange:y,limit:IXt,disabled:h}):null,!d&&!g&&i&&(N||I)?a.jsx(d6,{label:o("comment"),value:w,onChange:x,limit:zoe,disabled:h}):null,E?a.jsx(d6,{label:o("reasonRequired"),value:O,onChange:k,limit:zoe,disabled:h,required:!0}):null,T?a.jsx("p",{role:"status",children:o(`${T}Confirm`)}):null]}),a.jsxs("footer",{className:"agent-review-dialog-footer",children:[h?a.jsx("span",{role:"status",children:o("saving")}):null,!d&&(!g||c)?T?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",disabled:h,onClick:()=>R(null),children:o("cancel")}),a.jsx("button",{type:"button",disabled:h,onClick:()=>void A(T),children:o("confirm")})]}):E?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",disabled:h,onClick:()=>j(!1),children:o("cancel")}),a.jsx("button",{type:"button",disabled:h||!O.trim(),onClick:()=>void A("decision","returned"),children:o("return")})]}):a.jsxs(a.Fragment,{children:[P?a.jsx("button",{type:"button",disabled:h,onClick:()=>R("unpublish"),children:o("unpublish")}):null,N?a.jsx("button",{type:"button",disabled:h,onClick:()=>R("withdraw"),children:o("withdraw")}):null,N&&i?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",disabled:h,onClick:()=>j(!0),children:o("return")}),a.jsx("button",{type:"button",className:"is-primary",disabled:h||(c==null?void 0:c.contentChanged),onClick:()=>void A("decision","approved"),children:o("approve")})]}):null,I?a.jsx("button",{type:"button",className:"is-primary",disabled:h,onClick:()=>void A(i?"publish":"submit"),children:o(i?"publish":"submit")}):null]}):null]})]})]})})}const PXt=5e3,DXt=4;let f6=0;const Voe=[];function Hoe(e){return e instanceof Error&&e.name==="AbortError"}function MXt(e){return e instanceof Error&&e.name==="TimeoutError"}function LXt(e){return MXt(e)||e instanceof ID&&[500,502,503,504].includes(e.status)}function $Xt(e,t){return t!=null&&t.aborted?Promise.reject(t.reason??new DOMException("Request aborted","AbortError")):new Promise((n,i)=>{const r=()=>{globalThis.clearTimeout(s),i((t==null?void 0:t.reason)??new DOMException("Request aborted","AbortError"))},s=globalThis.setTimeout(()=>{t==null||t.removeEventListener("abort",r),n()},e);t==null||t.addEventListener("abort",r,{once:!0})})}async function FXt(e={},t={}){const n=t.request??Q0,i=t.wait??$Xt;try{return await n(e)}catch(r){if(!LXt(r))throw r;return await i(PXt,e.signal),n(e)}}async function c9e(e){var t;f6>=DXt&&await new Promise(n=>Voe.push(n)),f6+=1;try{return await e()}finally{f6-=1,(t=Voe.shift())==null||t()}}async function BXt(e,t){await Promise.allSettled(e.map(n=>c9e(()=>t(n))))}function Ey(e,t,n){const i=e instanceof Error?`${e.name}: ${e.message}`:String(e||Q("common.unknownError"));return[Q("requestError.actionFailed",{action:t}),Q("requestError.detail",{detail:i}),n?Q("requestError.request",{request:n}):""].filter(Boolean).join(` -`)}function Ap({className:e="icon"}){return a.jsxs("svg",{className:`${e} sidebar-agent-face`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("rect",{x:"4.25",y:"5.25",width:"15.5",height:"13.5",rx:"4.75"}),a.jsx("path",{className:"sidebar-agent-face__eye",d:"M8.5 10.7v2"}),a.jsx("path",{className:"sidebar-agent-face__eye",d:"M15.5 10.7v2"})]})}function UXt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M8.4 18.4H7.2a4.2 4.2 0 0 1-.65-8.35A5.7 5.7 0 0 1 17.3 8.2a4.6 4.6 0 0 1-.4 9.2h-3.2"}),a.jsx("path",{d:"m7.8 12.3 2 2-2 2M12.2 16.3h3.2"})]})}function QXt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M18.9 6.25A8.4 8.4 0 1 0 19.6 16"}),a.jsx("path",{d:"M19 6.2c.1 2.1-.65 3.75-2.25 4.95-1.2.9-2.75 1.25-4.2.9"}),a.jsx("circle",{cx:"10.6",cy:"12.8",r:"2.45"}),a.jsx("path",{d:"m5.25 18.6 3.65-3.9M14.8 17.9c1.9-.45 3.55-1.65 4.65-3.35"})]})}function zXt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6.2 20c.55-2.15.75-4.1.75-6.7V9.8A5.35 5.35 0 0 1 12.35 4c3.35 0 5.65 2.35 5.65 5.65v4.6c0 2.35.35 4.25 1.15 5.75"}),a.jsx("path",{d:"M8.05 10.2c1.35-.6 2.2-1.65 2.55-3.15.45 1.55 1.35 2.55 2.7 3.05.1-1 .4-1.95.85-2.75.45 1.25 1.2 2.2 2.15 2.75"}),a.jsx("path",{d:"M9.3 12.65h.01M14.9 12.65h.01M10.8 15.55c.8.5 1.65.5 2.45 0"}),a.jsx("path",{d:"M8.45 19.85c.95-.85 1.45-1.95 1.5-3.25M15.1 16.65c.05 1.2.55 2.3 1.55 3.2"})]})}function VXt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5.2 17.2V8.1a3 3 0 0 1 3-3h7.6a3 3 0 0 1 3 3v9.1"}),a.jsx("path",{d:"M7.4 17.2h9.2M9 19.9h6"}),a.jsx("path",{d:"M9.1 9.25h5.8M9.1 12h3.1"}),a.jsx("path",{d:"m14.1 12.4 2 2.1M16.2 12.4l-2.1 2.1"})]})}function hA({kind:e,...t}){return e==="codex"?a.jsx(UXt,{...t}):e==="deepseek-harness"?a.jsx(VXt,{...t}):e==="openclaw"?a.jsx(QXt,{...t}):a.jsx(zXt,{...t})}const HXt="data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20overflow='visible'%20style='display:%20block;'%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Icon%20Frame'%3e%3cpath%20id='Vector%208798'%20d='M5%205L15%2015'%20stroke='white'%20stroke-opacity='0.15'%20stroke-width='1.25'%20stroke-linecap='round'/%3e%3cpath%20id='Vector%208800'%20d='M15%205L5%2015'%20stroke='white'%20stroke-opacity='0.15'%20stroke-width='1.25'%20stroke-linecap='round'/%3e%3c/g%3e%3c/svg%3e";function u9e({title:e,topGlow:t=!0,children:n,footer:i,cancelLabel:r="Cancel",confirmLabel:s="Confirm",closeLabel:o="Close",onClose:l,onCancel:c,onConfirm:u,className:d="",...f}){const h=p.useId();return a.jsxs("div",{role:"dialog","aria-labelledby":h,...f,className:`studio-modal-layout ${t?"studio-modal-layout--glow":""} ${d}`.trim(),children:[a.jsxs("header",{className:"studio-modal-layout__header",children:[a.jsx("h3",{id:h,children:e}),a.jsx(Wi,{variant:"ghost",size:"compact",iconOnly:!0,className:"studio-modal-layout__close","aria-label":o,onClick:l,startIcon:a.jsx("img",{src:HXt,alt:""})})]}),a.jsx("div",{className:"studio-modal-layout__body",children:n}),i!==null&&a.jsx("footer",{className:"studio-modal-layout__footer",children:i===void 0?a.jsxs(a.Fragment,{children:[a.jsx(Wi,{variant:"outline",className:"studio-modal-layout__cancel",onClick:c,children:r}),a.jsx(Wi,{className:"studio-modal-layout__confirm",onClick:u,children:s})]}):i})]})}class d9e extends Error{constructor(t,n){super(n),this.status=t,this.name="MpaCreationRequestError"}}async function IL(e,t,n){const i=await fetch(Ta(`/web/mpa-creation/${e}`),{method:n===void 0?"GET":"POST",headers:ul(uc({"Content-Type":"application/json"})),body:n===void 0?void 0:JSON.stringify(n),signal:po(t,ho)});if(!i.ok){const r=await i.json().catch(()=>({}));throw new d9e(i.status,typeof r.detail=="string"?r.detail:`HTTP ${i.status}`)}return i.json()}const qXt=(e,t)=>IL(`config?region=${encodeURIComponent(e)}`,t),WXt=(e,t)=>IL("tasks",t,e),KXt=(e,t)=>IL(`tasks/${encodeURIComponent(e)}`,t),GXt=(e,t)=>IL(`tasks/${encodeURIComponent(e)}/cancel`,t,{}),XXt=/^[A-Za-z0-9_-]+$/,f9e=4,DP=64,MP=6,qoe="agent-runtime";function h9e(e){const t=e.trim();if(!t)return qoe;let n=t.replace(/[^A-Za-z0-9_-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").slice(0,DP);return n?(n.lengthXt(`validation.runtimeName.${n}`)){return e?XXt.test(e)?e.lengthDP?t("length"):null:t("characters"):t("required")}function JXt(e="",t=""){const n=e.trim(),i=t.trim();return!n&&!i||n.length<=255&&/^[A-Za-z0-9][A-Za-z0-9.-]*$/.test(n)&&!n.includes("..")&&/^[0-9]{1,5}$/.test(i)&&Number(i)>=1&&Number(i)<=65535}function eYt(e="",t="",n=""){const i=e.trim(),r=t.trim();if(!i&&!r&&!n)return!0;if(!i||!r||!n.trim()||i.length>1024||/\s/.test(i)||i.replace(/^https:\/\//,"").split("/",1)[0].includes(":"))return!1;try{const o=new URL(i);return o.protocol==="https:"&&!!o.hostname&&!o.username&&!o.password&&!o.port&&!o.search&&!o.hash&&r.length<=128&&/^ov-[a-zA-Z0-9_-]+$/.test(r)}catch{return!1}}const tYt="https://console.volcengine.com/aidap/region:aidap+cn-beijing/",nYt="https://console.volcengine.com/vikingdb/openviking/region:openviking+cn-beijing/ov-6689fabdf032294/context-management?accountId=default&userId=default&projectName=default";function p9e(e){return{region:e,requestId:crypto.randomUUID(),name:"",description:""}}function LP(e){return{...e,tosAccessKey:void 0,tosSecretKey:void 0}}function iYt(e){var t;try{const n=JSON.parse(sessionStorage.getItem(`mpa-create:${e}`)||"null");if(((t=n==null?void 0:n.input)==null?void 0:t.region)===e&&typeof n.input.requestId=="string"){if(n.submitted||n.taskId)return{...n,input:LP(n.input)};const i={...n.input,name:typeof n.input.name=="string"?n.input.name:""};return delete i.agentId,delete i.runtimeImage,delete i.workerImage,{...n,input:LP(i)}}}catch{}return{input:p9e(e)}}function rYt({region:e,onClose:t,onCreated:n}){var X,ie;const{t:i}=Te("ui"),r=ee=>`myAgents.mpaCreate.${ee}`,[s]=p.useState(()=>iYt(e)),[o,l]=p.useState(s.input),[c,u]=p.useState(""),[d,f]=p.useState(s.submitted||s.taskId?2:Math.min(2,Math.max(0,s.step??0))),[h,m]=p.useState(s.taskId),[g,b]=p.useState(!!(s.submitted||s.taskId)),[v,y]=p.useState(null),[w,x]=p.useState(null),[O,k]=p.useState(!0),[S,C]=p.useState(!1),[E,j]=p.useState(""),[T,R]=p.useState(0),[A,N]=p.useState(!1),P=p.useRef(!1),I=p.useRef(!1),D=p.useRef(!0),_=p.useRef(null),L=p.useRef(n);L.current=n;const F=(v==null?void 0:v.state)==="running"||(v==null?void 0:v.state)==="cancelling",V=g&&o.name===void 0&&!!o.agentId?null:ov((o.name??"").trim(),ee=>i(`validation.runtimeName.${ee}`,{ns:"create"})),q=!V,U=(w==null?void 0:w.postgresMode)==="auto",J=U?!o.pgHost&&!o.pgPort:JXt(o.pgHost,o.pgPort),z=eYt(o.openvikingUrl,o.openvikingResourceId,c),Z=[o.tosAccessKey,o.tosSecretKey,o.tosBucket].map(ee=>(ee==null?void 0:ee.trim())??""),ne=Z.every(Boolean)||Z.every(ee=>!ee),W=S||g&&(!v||F||v.state==="succeeded");p.useEffect(()=>{if(!(g||h))try{sessionStorage.setItem(`mpa-create:${e}`,JSON.stringify({input:LP(o),step:d}))}catch{}},[o,d,e,g,h]);function G(ee){try{sessionStorage.setItem(`mpa-create:${e}`,JSON.stringify({input:LP(o),taskId:ee,submitted:!0,step:2}))}catch{}}p.useEffect(()=>(D.current=!0,()=>{var ee;D.current=!1,(ee=_.current)==null||ee.abort()}),[]),p.useEffect(()=>{const ee=new AbortController;return k(!0),qXt(e,ee.signal).then(be=>{ee.signal.aborted||(x(be),be.configured&&!s.submitted&&!s.taskId&&!P.current&&l(ue=>({...ue,pgHost:be.postgresMode==="auto"?"":ue.pgHost??be.pgHost??"",pgPort:be.postgresMode==="auto"?"":ue.pgPort??be.pgPort??""})))}).catch(()=>{ee.signal.aborted||j(i(r("loadFailed")))}).finally(()=>{ee.signal.aborted||k(!1)}),()=>ee.abort()},[e,T,i]),p.useEffect(()=>{if(!h)return;const ee=new AbortController;let be;async function ue(){try{const pe=await KXt(h,ee.signal);if(ee.signal.aborted)return;if(y(pe),j(""),pe.state==="succeeded"&&!I.current){I.current=!0;try{sessionStorage.removeItem(`mpa-create:${e}`)}catch{}L.current()}if(pe.state!=="running"&&pe.state!=="cancelling")return}catch{if(ee.signal.aborted)return;j(i(r("pollFailed")))}be=setTimeout(ue,2e3)}return ue(),()=>{ee.abort(),clearTimeout(be)}},[h,e,T,i]);async function H(){if(P.current||!(w!=null&&w.configured)||!q||!J||!z||!ne||d!==2||F||(v==null?void 0:v.state)==="succeeded")return;P.current=!0,C(!0),b(!0),j(""),G(h);const ee=new AbortController;_.current=ee;try{const be=await WXt({...o,...o.name===void 0?{}:{name:o.name.trim()},openvikingApiKey:c},ee.signal);if(!D.current||ee.signal.aborted)return;G(be.taskId),m(be.taskId),y(be),R(ue=>ue+1)}catch(be){D.current&&!ee.signal.aborted&&(be instanceof d9e&&(be.status===400||be.status===422)&&b(!1),j(be instanceof Error?be.message:i(r("creationFailed"))))}finally{P.current=!1,D.current&&C(!1)}}async function se(){if(!h||P.current)return;N(!1),P.current=!0,C(!0);const ee=new AbortController;_.current=ee;try{const be=await GXt(h,ee.signal);D.current&&!ee.signal.aborted&&y(be)}catch{D.current&&!ee.signal.aborted&&j(i(r("cancelFailed")))}finally{P.current=!1,D.current&&C(!1)}}function Y(){const ee={...p9e(e),pgHost:U?"":(w==null?void 0:w.pgHost)??"",pgPort:U?"":(w==null?void 0:w.pgPort)??""};try{sessionStorage.setItem(`mpa-create:${e}`,JSON.stringify({input:ee,step:0}))}catch{}l(ee),u(""),f(0),m(void 0),b(!1),y(null),j(""),N(!1),I.current=!1}return a.jsx(a.Fragment,{children:a.jsx(sv,{open:!0,onOpenChange:ee=>{!ee&&!S&&(A?N(!1):t())},children:a.jsxs(rv,{children:[a.jsx(nv,{className:"studio-modal-button__backdrop mpa-create-backdrop"}),a.jsx(iv,{className:"mpa-create-popup","aria-label":i(r("title")),children:a.jsx(u9e,{className:"mpa-create-dialog",title:i(r("title")),topGlow:!1,footer:null,onClose:()=>{S||t()},closeLabel:i(r("close")),children:a.jsxs("div",{className:"mpa-create-body",children:[a.jsx("ol",{className:"mpa-create-steps","aria-label":i(r("stepsLabel")),children:["basics","postgres","openviking"].map((ee,be)=>a.jsx("li",{"aria-current":d===be?"step":void 0,children:a.jsxs("button",{type:"button",disabled:S||be>d&&!g&&(!q||be===2&&!J),onClick:()=>f(be),children:[a.jsx("span",{children:be+1}),i(r(`steps.${ee==="postgres"&&U?"autoPostgres":ee}`))]})},ee))}),d===0&&a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[i(r("region")),":",e]}),a.jsxs("label",{children:[i(r("name")),a.jsx("input",{name:"name",placeholder:i(r("namePlaceholder")),value:o.name??o.agentId??"",maxLength:64,disabled:S||g,required:!0,autoComplete:"off","aria-invalid":!!V,"aria-describedby":"mpa-name-help",onChange:ee=>l({...o,name:ee.target.value})}),a.jsx("p",{id:"mpa-name-help",role:V?"alert":void 0,children:V||i(r("nameHelp"))})]}),a.jsxs("label",{children:[i(r("description")),a.jsx(EIe,{className:"mpa-create-description",value:o.description,maxLength:512,disabled:S||g,onChange:ee=>l({...o,description:ee.target.value})})]}),a.jsxs("section",{className:"mpa-create-plan","aria-label":i(r("plan")),children:[a.jsx("strong",{children:i(r("plan"))}),a.jsxs("ul",{children:[a.jsx("li",{children:i(r("sharedResources"))}),a.jsx("li",{children:i(r("agentResources"))}),a.jsx("li",{children:i(r("readiness"))})]})]})]}),d===1&&a.jsxs(a.Fragment,{children:[a.jsx("p",{children:i(r(U?"pgAutoDescription":(w==null?void 0:w.postgresLayout)==="split-workspaces"?"pgSplitDescription":"pgDescription"))}),a.jsx("a",{href:tYt,target:"_blank",rel:"noopener noreferrer",children:i(r("pgConsole"))}),!U&&a.jsxs(a.Fragment,{children:[a.jsxs("label",{children:[i(r("pgHost")),a.jsx("input",{name:"pgHost",value:o.pgHost??"",maxLength:255,disabled:S||g,"aria-invalid":!J,onChange:ee=>l(be=>({...be,pgHost:ee.target.value}))})]}),a.jsxs("label",{children:[i(r("pgPort")),a.jsx("input",{name:"pgPort",value:o.pgPort??"",inputMode:"numeric",maxLength:5,disabled:S||g,"aria-invalid":!J,onChange:ee=>l(be=>({...be,pgPort:ee.target.value}))})]}),!J&&a.jsx("p",{role:"alert",children:i(r("pgInvalid"))}),a.jsx("p",{children:i(r("pgCredentials"))})]})]}),d===2&&a.jsxs(a.Fragment,{children:[a.jsx("p",{children:i(r("openvikingDescription"))}),a.jsx("a",{href:nYt,target:"_blank",rel:"noopener noreferrer",children:i(r("openvikingConsole"))}),a.jsxs("label",{children:[i(r("openvikingUrl")),a.jsx("input",{name:"openvikingUrl",value:o.openvikingUrl??"",maxLength:1024,disabled:S||g,autoComplete:"off",spellCheck:!1,"aria-invalid":!z,onChange:ee=>l(be=>({...be,openvikingUrl:ee.target.value}))})]}),a.jsxs("label",{children:[i(r("openvikingResourceId")),a.jsx("input",{name:"openvikingResourceId",value:o.openvikingResourceId??"",maxLength:128,disabled:S||g,autoComplete:"off",spellCheck:!1,"aria-invalid":!z,onChange:ee=>l(be=>({...be,openvikingResourceId:ee.target.value}))})]}),a.jsxs("label",{children:[i(r("openvikingApiKey")),a.jsx("input",{type:"password",name:"openvikingApiKey",value:c,maxLength:512,disabled:S||F||(v==null?void 0:v.state)==="succeeded",autoComplete:"off",spellCheck:!1,onChange:ee=>u(ee.target.value)})]}),!z&&a.jsx("p",{role:"alert",children:i(r("openvikingInvalid"))}),a.jsx("p",{children:i(r("openvikingCredentials"))}),a.jsxs("fieldset",{className:"mpa-create-tos",children:[a.jsx("legend",{children:i(r("tosTitle"))}),a.jsx("p",{children:i(r("tosDescription"))}),["tosAccessKey","tosSecretKey","tosBucket"].map(ee=>a.jsxs("label",{children:[i(r(ee)),a.jsx("input",{name:ee,type:ee==="tosBucket"?"text":"password",value:o[ee]??"",maxLength:256,disabled:W,autoComplete:ee==="tosBucket"?"off":"new-password",spellCheck:!1,"aria-invalid":!ne,onChange:be=>l(ue=>({...ue,[ee]:be.target.value}))})]},ee)),!ne&&a.jsx("p",{role:"alert",children:i(r("tosInvalid"))}),a.jsx("p",{children:i(r("tosCredentials"))})]})]}),O?a.jsx("p",{role:"status",children:i(r("checking"))}):w!=null&&w.configured?a.jsx("p",{children:i(r("configured"))}):a.jsxs("div",{role:"alert",children:[a.jsx("p",{children:i(r("notConfigured"))}),a.jsx("p",{children:w!=null&&w.postgresMigrationRequired?i(r("pgMigrationRequired")):w==null?void 0:w.error}),a.jsx(Wi,{variant:"outline",onClick:()=>R(ee=>ee+1),children:i(r("reload"))})]}),v&&a.jsxs("section",{"aria-live":"polite",children:[a.jsx("strong",{children:i(r(`states.${v.state}`))}),v.state!=="succeeded"&&a.jsx("p",{children:i(r(`stages.${v.stage}`),{defaultValue:v.stage})}),v.state==="failed"||v.state==="cancelled"?a.jsx("p",{children:i(r(v.error||"creationFailed"))}):null,((X=v.result)==null?void 0:X.runtime_id)&&a.jsxs("p",{children:["Runtime ID:",v.result.runtime_id]}),((ie=v.result)==null?void 0:ie.skill_space_id)&&a.jsxs("p",{children:[i(r("skillSpace")),":",v.result.skill_space_id]})]}),U&&!J&&a.jsx("p",{role:"alert",children:i(r("pgModeChanged"))}),E&&a.jsx("p",{role:"alert",children:E}),F&&a.jsx("p",{children:i(r("background"))}),g&&a.jsx("p",{children:i(r("newAgentDescription"))}),A?a.jsxs("section",{role:"alertdialog","aria-label":i(r("cancel")),className:"mpa-create-plan",children:[a.jsx("p",{children:i(r("cancelDescription"))}),a.jsxs("div",{className:"mpa-create-actions",children:[a.jsx(Wi,{autoFocus:!0,variant:"outline",onClick:()=>N(!1),children:i(r("back"))}),a.jsx(Wi,{onClick:()=>void se(),children:i(r("confirmCancel"))})]})]}):a.jsxs("div",{className:"mpa-create-actions",children:[a.jsx(Wi,{variant:"outline",disabled:S,onClick:t,children:i(r("close"))}),g&&a.jsx(Wi,{variant:"outline",disabled:S||O,onClick:Y,children:i(r("newAgent"))}),d>0&&a.jsx(Wi,{variant:"outline",disabled:S,onClick:()=>f(ee=>ee-1),children:i(r("previousStep"))}),F?a.jsx(Wi,{variant:"outline",disabled:S||(v==null?void 0:v.state)==="cancelling",onClick:()=>N(!0),children:i(r("cancel"))}):(v==null?void 0:v.state)!=="succeeded"&&d<2?a.jsx(Wi,{disabled:S||d===0&&!q||d===1&&!J,onClick:()=>f(ee=>ee+1),children:i(r("next"))}):(v==null?void 0:v.state)!=="succeeded"?a.jsx(Wi,{loading:S,disabled:O||!(w!=null&&w.configured)||!q||!J||!z||!ne,onClick:()=>void H(),children:i(r(v?"retry":"submit"))}):null]})]})})})]})})})}const sYt=["general","mpa","codex","deepseek-harness","openclaw","hermes"];function aYt(e){return e!=="general"&&e!=="mpa"}const oYt=24,lYt=3e4,cYt=7e3,uYt=2e4,dYt=6,fYt=2,hYt=250,Og=new Map,Aw=new Map,pYt=new Set;function ty(e){const t=e.runtime;return t?`${t.region}:${t.runtimeId}:${t.currentVersion??""}`:""}function Woe(e,t){const n=e instanceof Error&&e.message.trim()?e.message.trim():t("myAgents.compatibility.unknownError");return{status:e instanceof Oa&&e.unsupported?"unsupported":"error",message:n}}function Zm(e){if(!e){Og.clear(),Aw.clear(),W8();return}const t=new Set(e);if(t.size!==0){for(const[n,i]of Aw)i.page.runtimes.some(r=>t.has(r.runtimeId))&&Aw.delete(n);for(const n of t)W8(n);Og.clear()}}function mYt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function gYt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M8.313 3.646a.5.5 0 0 1 .707 0l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 1 1-.707-.708L11.46 8.5H3.333a.5.5 0 0 1 0-1h8.127L8.313 4.354a.5.5 0 0 1 0-.708Z",fill:"currentColor"})})}function bYt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M2.75 5.25h8.75m0 0-2-2m2 2-2 2M13.25 10.75H4.5m0 0 2 2m-2-2 2-2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function yYt({type:e}){return e==="general"||e==="mpa"?a.jsx(Ap,{}):a.jsx(hA,{kind:e})}function vYt(e,t=Date.now(),n){const i=Date.parse(e);if(!Number.isFinite(i)||i-t<6e4)return n("myAgents.expiringSoon");const r=Math.ceil((i-t)/6e4),s=Math.floor(r/60),o=r%60;return n("myAgents.sandboxRemaining",{hours:s,minutes:o})}function Koe(e,t,n="general"){var r;const i=e.agentCategory??n;return{id:e.runtimeId,name:e.name,description:((r=e.description)==null?void 0:r.trim())||t("common.noDescription"),createdAt:e.createdAt??"",specificationLabel:t("myAgents.creator"),specification:GMe(e.author),isMine:e.isMine,agentCategory:i,runtime:{runtimeId:e.runtimeId,mpaInstanceId:e.mpaInstanceId,region:e.region,currentVersion:e.currentVersion,agentCategory:e.agentCategory??n,canDelete:e.canDelete,canManage:e.canManage,canPublish:e.canPublish,visibility:e.visibility,reviewStatus:e.reviewStatus}}}function xYt(e,t){const n=MD(e.status);return{id:e.id,name:e.displayName||t("myAgents.namedAgent",{name:e.toolName}),description:t(`myAgents.sandboxStatus.${n}`,{defaultValue:t("myAgents.sandboxStatus.unknown")}),createdAt:e.createdAt,specificationLabel:t("myAgents.creator"),specification:GMe(e.createdBy),isMine:e.isMine,region:e.region,sandbox:e}}function wYt(e,t){var n,i;return{id:e.id,name:e.draft.name||t("agentSelector.unnamedAgent"),description:((n=e.draft.description)==null?void 0:n.trim())||t("common.noDescription"),createdAt:new Date(e.updatedAt).toISOString(),specificationLabel:t("myAgents.storageLocation"),specification:t("myAgents.currentBrowser"),isMine:!0,region:(i=e.deploymentTarget)==null?void 0:i.region,draft:e}}function OYt(e,t,n){if(!e.draft)return e;const i=e.draft.deploymentTarget;return i?t.find(r=>{var s;return((s=r.runtime)==null?void 0:s.runtimeId)===i.runtimeId&&r.runtime.region===i.region})??{id:i.runtimeId,appName:i.appName,name:i.name||e.name,description:e.description,createdAt:e.createdAt,specificationLabel:n("myAgents.region"),specification:i.region,isMine:!0,runtime:{runtimeId:i.runtimeId,mpaInstanceId:i.mpaInstanceId,region:i.region,currentVersion:i.currentVersion,canDelete:!1}}:null}function kYt(e,t){return e.trim()||Zi(t)}async function SYt(e,t,n,i,r,s,o){const l=`${e}:${t}:${n}:${i}`,c=Aw.get(l);if(c&&c.expiresAt>Date.now())return r(c.page.runtimes.map(f=>Koe(f,s,e))),c.page.nextToken;c&&Aw.delete(l);let u=Og.get(l);u||(u=FXt({agentCategory:e,scope:t,region:n,pageSize:oYt,nextToken:i,signal:o}),Og.set(l,u),u.then(()=>Og.delete(l),()=>Og.delete(l)));const d=await u;return Aw.set(l,{page:d,expiresAt:Date.now()+lYt}),r(d.runtimes.map(f=>Koe(f,s,e))),d.nextToken}function EYt({agent:e,onReview:t,onUse:n,onViewDetails:i,onPrepareUpdate:r,compatibility:s,onRetryCompatibility:o,connecting:l,connectError:c,connected:u,deploymentTask:d,nowMs:f,onViewDeploymentTask:h,onEditDraft:m,onDeleteDraft:g}){var R,A,N,P;const{t:b,i18n:v}=Te("ui"),y=(R=e.sandbox)==null?void 0:R.status.toLowerCase(),w=((A=e.sandbox)==null?void 0:A.resourceType)==="snapshot",x=!!(e.runtime||y==="ready"||y==="wakeable"),O=(s==null?void 0:s.status)==="checking",k=(s==null?void 0:s.status)==="unsupported",S=(s==null?void 0:s.status)==="error",C=((N=e.sandbox)==null?void 0:N.resourceType)==="snapshot"?e.sandbox.sourceSessionId||e.sandbox.snapshotId:(P=e.sandbox)==null?void 0:P.id,E=()=>{if(e.draft){d?h==null||h(d):i==null||i(e);return}!x&&!e.sandbox||(d?h==null||h(d):i==null||i(e))},j=(e.draft||x||!!e.sandbox)&&!!(d?h:i),T=e.draft?d?b("myAgents.viewDeploymentProgress",{name:e.name}):b("myAgents.viewRuntimeDetails",{name:e.name}):d?b("myAgents.viewDeploymentProgress",{name:e.name}):b("myAgents.viewDetails",{name:e.name});return a.jsxs(vH,{className:`my-agent-card${l?" is-connecting":""}${e.runtime?" has-review":""}`,activateLabel:j?T:void 0,onActivate:j?E:void 0,onPointerEnter:()=>r==null?void 0:r(e),onFocusCapture:()=>r==null?void 0:r(e),footer:a.jsxs("div",{className:"my-agent-card-footer",children:[a.jsx(YIe,{className:"my-agent-meta",items:[{label:e.specificationLabel,value:e.specification,hideLabel:!0,className:"my-agent-region"},{label:b("myAgents.time"),value:FT(e.createdAt,f,v.resolvedLanguage??v.language),hideLabel:!0,className:"my-agent-created-at"},...e.sandbox?[{label:b("myAgents.remainingTime"),value:e.sandbox.resourceType==="snapshot"||e.sandbox.persistent?b("myAgents.neverExpires"):vYt(e.sandbox.expireAt,f,b),className:`my-agent-expiry${e.sandbox.resourceType==="snapshot"||e.sandbox.persistent?"":" is-expiring"}`}]:[]]}),e.runtime?a.jsxs("div",{className:"agent-review-card-controls",children:[a.jsx("span",{className:"agent-review-card-status",children:b(e.runtime.visibility==="enterprise"?"enterprise":"private",{ns:"agentReviews"})}),e.runtime.canManage?a.jsxs(CN,{className:"agent-review-card-action",onClick:I=>{I.stopPropagation(),t==null||t(e)},children:[b(e.runtime.reviewStatus?"details":e.runtime.canPublish?"publish":"submit",{ns:"agentReviews"}),e.runtime.reviewStatus?` · ${b(`status.${e.runtime.reviewStatus}`,{ns:"agentReviews"})}`:""]}):null]}):null]}),actions:e.draft?a.jsxs(a.Fragment,{children:[a.jsx(CN,{"aria-label":d?b("myAgents.viewDeploymentProgress",{name:e.name}):b("myAgents.editDraftNamed",{name:e.name}),onClick:()=>d?h==null?void 0:h(d):m==null?void 0:m(e.draft),children:b(d?"myAgents.viewProgress":"common.edit")}),a.jsx(CN,{tone:"danger","aria-label":b("myAgents.deleteDraftNamed",{name:e.name}),onClick:()=>g==null?void 0:g(e.draft),children:b("common.delete")})]}):S||k?a.jsxs(_t,{type:"button",color:"primary",size:"sm",pill:!1,"aria-label":b("myAgents.recheckCompatibility",{name:e.name}),onClick:()=>o==null?void 0:o(e),children:[a.jsx(JD,{}),b("common.retry")]}):a.jsx(MB,{className:u?"my-agent-use is-connected":"my-agent-use",disabled:!x||O||k||l||u,"aria-busy":l||void 0,label:u?b("myAgents.connectedNamed",{name:e.name}):w?b("myAgents.wakeAndChat",{name:e.name}):b("myAgents.chatWith",{name:e.name}),onClick:()=>void(n==null?void 0:n(e)),children:l?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"my-agent-use-spinner","aria-hidden":"true"}),a.jsx("span",{className:"sr-only",children:b(w?"myAgents.waking":"agentSelector.connecting")})]}):a.jsx(gYt,{})}),children:[a.jsx(xH,{leading:a.jsx(t1,{seed:e.name}),title:e.name,subtitle:e.sandbox?a.jsx("span",{className:"my-agent-session-id",title:C,children:C}):void 0,status:e.draft?d?a.jsx("span",{className:"my-agent-deploying-badge",children:b("myAgents.deploying")}):a.jsx("span",{className:"my-agent-draft-badge",children:b("myAgents.draft")}):e.sandbox?a.jsx("span",{className:"my-agent-status-label","data-ready":MD(e.sandbox.status)==="ready"||void 0,children:e.description}):e.runtime&&d?a.jsx("span",{className:"my-agent-deploying-badge",children:b("myAgents.deploying")}):O?a.jsx(ka,{content:s==null?void 0:s.message,contentClassName:"my-agent-compatibility-tooltip",maxWidth:360,align:"end",interactive:!0,preventUnintentionalClickToClose:!0,children:a.jsx("span",{className:"my-agent-compatibility-trigger",tabIndex:0,children:a.jsxs(Ya,{className:"my-agent-compatibility-status",color:"secondary",variant:"soft",size:"sm",pill:!0,children:[a.jsx("span",{className:"my-agent-compatibility-spinner","aria-hidden":"true"}),a.jsx("span",{children:b("myAgents.checking")})]})})}):k?a.jsx(ka,{content:s==null?void 0:s.message,contentClassName:"my-agent-compatibility-tooltip",maxWidth:360,align:"end",interactive:!0,preventUnintentionalClickToClose:!0,children:a.jsx("span",{className:"my-agent-compatibility-trigger",tabIndex:0,children:a.jsx(Ya,{className:"my-agent-compatibility-status",color:"warning",variant:"soft",size:"sm",pill:!0,children:b("myAgents.chatUnsupported")})})}):S?a.jsx(ka,{content:s==null?void 0:s.message,contentClassName:"my-agent-compatibility-tooltip",maxWidth:360,align:"end",interactive:!0,preventUnintentionalClickToClose:!0,children:a.jsx("span",{className:"my-agent-compatibility-trigger",tabIndex:0,children:a.jsx(Ya,{className:"my-agent-compatibility-status",color:"danger",variant:"soft",size:"sm",pill:!0,children:b("myAgents.checkFailed")})})}):null}),c?a.jsx(ka,{content:c,contentClassName:"my-agent-error-tooltip",maxWidth:360,interactive:!0,children:a.jsx("p",{className:"my-agent-wake-note",role:"alert",tabIndex:0,children:c})}):null,w&&l?a.jsx("p",{className:"my-agent-wake-note",role:"status",children:a.jsx(fn,{children:b("myAgents.wakingHint")})}):null,e.sandbox?null:a.jsx(wH,{children:e.description})]})}function CYt({cloudProvider:e,studioRegion:t,canCreateRuntimeAgents:n,canCreatePersonalAgents:i,canUpdate:r,runtimeScope:s,onCreateAgent:o,onOpenCodexProjectUpload:l,onUseAgent:c,onViewAgentDetails:u,onCreateSandboxAgent:d,onUseSandboxAgent:f,onViewSandboxAgentDetails:h,activeType:m,onActiveTypeChange:g,sandboxRefreshKey:b=0,connectedRuntimeId:v="",hiddenRuntimeIds:y=pYt,drafts:w=[],deploymentTasks:x=[],draftDeploymentTaskIds:O={},onViewDeploymentTask:k,onEditDraft:S,onDeleteDraft:C}){const{t:E}=Te("ui"),j=p.useRef(null),T=p.useRef(null),R=p.useRef(0),A=p.useRef(null),N=p.useRef(0),P=p.useRef(null),I=p.useRef(new Map),D=kYt(t,e),[_,L]=p.useState(null),[F,M]=p.useState(""),[V,q]=p.useState(s==="mine"?"mine":"all"),[U,J]=p.useState(D),[z,Z]=p.useState(null),[ne,W]=p.useState([]),[G,H]=p.useState(""),[se,Y]=p.useState(!0),[X,ie]=p.useState(""),[ee,be]=p.useState([]),[ue,pe]=p.useState(!1),[ke,je]=p.useState(""),[Pe,Ee]=p.useState(""),[ze,_e]=p.useState({}),[ae,le]=p.useState({}),[ge,Oe]=p.useState(null),[Se,We]=p.useState(()=>Date.now()),Ye=p.useMemo(()=>sYt.map(qe=>({value:qe,label:E(`myAgents.agentTypes.${qe}`)})),[E]),ye=p.useMemo(()=>{const qe=_u(e);return qe.some(nt=>nt.value===D)?qe:[{value:D,label:D},...qe]},[e,D]);p.useEffect(()=>{s==="mine"&&q("mine")},[s]),p.useEffect(()=>{J(D)},[D]),p.useEffect(()=>{We(Date.now());const qe=window.setInterval(()=>We(Date.now()),1e3);return()=>window.clearInterval(qe)},[]);const we=p.useMemo(()=>w.map(qe=>wYt(qe,E)),[w,E]),Ae=p.useMemo(()=>{const qe=new Map,nt=new Map,et=new Map;for(const ft of x){if(ft.status!=="running")continue;if(qe.set(ft.id,ft),ft.draftId){const At=nt.get(ft.draftId);(!At||ft.startedAt>At.startedAt)&&nt.set(ft.draftId,ft)}if(!ft.runtimeId)continue;const Et=et.get(ft.runtimeId);(!Et||ft.startedAt>Et.startedAt)&&et.set(ft.runtimeId,ft)}return{byId:qe,byDraftId:nt,byRuntimeId:et}},[x]),He=p.useCallback(qe=>{var et;if(qe.draft){const ft=O[qe.draft.id];return Ae.byDraftId.get(qe.draft.id)??(ft?Ae.byId.get(ft):void 0)}const nt=(et=qe.runtime)==null?void 0:et.runtimeId;return nt?Ae.byRuntimeId.get(nt):void 0},[Ae,O]),Ue=p.useCallback((qe,nt)=>{var At;(At=A.current)==null||At.abort(),Og.clear();const et=new AbortController;A.current=et;const ft=++R.current;return Y(!0),ie(""),SYt(m==="mpa"?"mpa":"general",V,U,qe,It=>{R.current===ft&&W(Gt=>nt?It:[...Gt,...It])},E,et.signal).then(It=>{R.current===ft&&H(It)}).catch(It=>{R.current===ft&&(Hoe(It)||ie(Ey(It,E("myAgents.loadGeneralAgents"),"GET /web/runtimes")))}).finally(()=>{R.current===ft&&Y(!1),A.current===et&&(A.current=null)})},[m,V,U,E]);p.useEffect(()=>{if(!(m!=="general"&&m!=="mpa"))return W([]),H(""),Ue("",!0),()=>{var qe;(qe=A.current)==null||qe.abort(),A.current=null,Og.clear(),R.current+=1}},[m,Ue]),p.useEffect(()=>{if(m!=="general"&&m!=="mpa"){for(const et of I.current.values())et.abort();I.current.clear();return}const qe=new Set(ne.filter(et=>{var ft,Et;return((ft=et.runtime)==null?void 0:ft.runtimeId)!==v&&((Et=et.runtime)==null?void 0:Et.region)===U}).map(ty).filter(Boolean));for(const[et,ft]of I.current)qe.has(et)||(ft.abort(),I.current.delete(et));const nt=ne.filter(et=>{var It,Gt,Xe;const ft=(It=et.runtime)==null?void 0:It.runtimeId;if(!ft||ft===v||((Gt=et.runtime)==null?void 0:Gt.region)!==U)return!1;const Et=ty(et),At=(Xe=ae[Et])==null?void 0:Xe.status;return!I.current.has(Et)&&(!At||At==="checking")});for(const et of nt)I.current.set(ty(et),new AbortController);le(et=>{var At,It;let ft=!1;const Et={...et};for(const Gt of ne){const Xe=ty(Gt);if(!Xe)continue;const wt=((At=Gt.runtime)==null?void 0:At.runtimeId)===v;wt&&((It=Et[Xe])==null?void 0:It.status)!=="compatible"?(Et[Xe]={status:"compatible",message:E("myAgents.compatibility.supported")},ft=!0):!wt&&!Et[Xe]&&(Et[Xe]={status:"checking",message:E("myAgents.compatibility.checking")},ft=!0)}return ft?Et:et}),BXt(nt,async et=>{const ft=et.runtime;if(!ft)return;const Et=ty(et),At=I.current.get(Et);if(At)try{const It=await Ww(ft.runtimeId,ft.region,{signal:At.signal,preferCached:!0,timeoutMs:cYt,currentVersion:ft.currentVersion});if(At.signal.aborted)return;le(Gt=>({...Gt,[Et]:It&&It.length>0?{status:"compatible",message:E("myAgents.compatibility.supported")}:{status:"unsupported",message:E("myAgents.compatibility.empty")}}))}catch(It){if(At.signal.aborted||(It==null?void 0:It.name)==="AbortError")return;le(Gt=>({...Gt,[Et]:Woe(It,E)}))}finally{I.current.get(Et)===At&&I.current.delete(Et)}})},[m,v,U,ne,E]),p.useEffect(()=>()=>{var qe;(qe=A.current)==null||qe.abort();for(const nt of I.current.values())nt.abort();I.current.clear()},[]);const jt=p.useCallback(async qe=>{var ft;(ft=P.current)==null||ft.abort();const nt=new AbortController;P.current=nt;const et=++N.current;pe(!0),je(""),be([]);try{const Et=qe==="codex"?await Br.listSessions({signal:nt.signal,autoResumeSnapshots:!1}):await Br.listAgentSessions(qe,{signal:nt.signal,autoResumeSnapshots:!1});if(N.current!==et)return;be(Et.map(At=>xYt(At,E)))}catch(Et){if((Et==null?void 0:Et.name)==="AbortError"||N.current!==et)return;je(Ey(Et,E("myAgents.loadAgentType",{type:E(`myAgents.agentTypes.${qe}`)}),`GET /web/${qe==="codex"?"sandbox":qe}/sessions`))}finally{P.current===nt&&(P.current=null),N.current===et&&pe(!1)}},[E]);function Pt(qe){var nt;qe!==m&&(qe==="general"||qe==="mpa"?(R.current+=1,W([]),H(""),ie(""),Y(!0)):((nt=P.current)==null||nt.abort(),P.current=null,N.current+=1,be([]),je(""),pe(!0)),g(qe))}function Kt(){m!=="general"&&m!=="mpa"||(R.current+=1,W([]),H(""),ie(""),Y(!0))}function Ct(qe){qe!==V&&(Kt(),q(qe))}function xt(qe){qe!==U&&(Kt(),J(qe))}p.useEffect(()=>{var qe;if(m==="general"||m==="mpa"){(qe=P.current)==null||qe.abort(),P.current=null,N.current+=1;return}return jt(m),()=>{var nt;(nt=P.current)==null||nt.abort(),P.current=null,N.current+=1}},[m,jt,b]),p.useEffect(()=>{const qe=T.current,nt=j.current;if(!qe||!nt||m!=="general"&&m!=="mpa"||!G||se)return;const et=new IntersectionObserver(([ft])=>{ft.isIntersecting&&Ue(G,!1)},{root:nt,rootMargin:"240px 0px",threshold:.01});return et.observe(qe),()=>et.disconnect()},[m,Ue,se,G]);const tt=p.useCallback(async qe=>{if(!Pe){Ee(qe.id),_e(nt=>({...nt,[qe.id]:""}));try{await new Promise(nt=>requestAnimationFrame(()=>nt())),qe.sandbox?await f(qe.sandbox):await c(qe)}catch(nt){_e(et=>({...et,[qe.id]:nt instanceof Error?nt.message:String(nt)}))}finally{Ee("")}}},[Pe,c,f]),mt=p.useCallback(async qe=>{var Et;const nt=qe.runtime;if(!nt)return;const et=ty(qe);le(At=>({...At,[et]:{status:"checking",message:E("myAgents.compatibility.checking")}})),(Et=I.current.get(et))==null||Et.abort();const ft=new AbortController;I.current.set(et,ft);try{const At=await c9e(()=>Ww(nt.runtimeId,nt.region,{retryProbe:!0,signal:ft.signal,timeoutMs:uYt,currentVersion:nt.currentVersion}));if(ft.signal.aborted)return;le(It=>({...It,[et]:At&&At.length>0?{status:"compatible",message:E("myAgents.compatibility.supported")}:{status:"unsupported",message:E("myAgents.compatibility.empty")}}))}catch(At){if(ft.signal.aborted||Hoe(At))return;le(It=>({...It,[et]:Woe(At,E)}))}finally{I.current.get(et)===ft&&I.current.delete(et)}},[E]),Ne=p.useCallback(qe=>{const nt=qe.runtime;!r||!nt||He(qe)||q8({runtimeId:nt.runtimeId,region:nt.region,appName:qe.appName,currentVersion:nt.currentVersion})},[r,He]),Ot=p.useMemo(()=>{const qe=F.trim().toLocaleLowerCase(),nt=m==="general"||m==="mpa"?[...we,...ne]:ee,ft=(V==="mine"?nt.filter(Gt=>Gt.isMine):nt).filter(Gt=>{var wt;const Xe=((wt=Gt.runtime)==null?void 0:wt.region)??Gt.region;return!Xe||Xe===U}),Et=qe?ft.filter(Gt=>Gt.name.toLocaleLowerCase().includes(qe)):ft;if(m!=="general"&&m!=="mpa")return Et;const At=y.size>0?Et.filter(Gt=>!Gt.runtime||!y.has(Gt.runtime.runtimeId)):Et,It=At.findIndex(Gt=>{var Xe;return((Xe=Gt.runtime)==null?void 0:Xe.runtimeId)===v});return It<=0?At:[At[It],...At.slice(0,It),...At.slice(It+1)]},[m,v,we,y,F,V,U,ne,ee]);p.useEffect(()=>{if(!r||m!=="general"&&m!=="mpa")return;const qe=Ot.filter(At=>!!At.runtime).filter(At=>!He(At)).slice(0,dYt);if(qe.length===0)return;let nt=!1,et=0;const ft=async()=>{for(;!nt;){const At=qe[et];if(et+=1,!(At!=null&&At.runtime)||(await q8({runtimeId:At.runtime.runtimeId,region:At.runtime.region,appName:At.appName,currentVersion:At.runtime.currentVersion}),nt))return}},Et=window.setTimeout(()=>{for(let At=0;At{nt=!0,window.clearTimeout(Et)}},[m,r,He,Ot]);const Nt=E(`myAgents.agentTypes.${m}`,{defaultValue:E("myAgents.agent")}),Yt=m==="general"||m==="mpa"?se&&ne.length===0&&we.length===0:ue&&ee.length===0,xn=!Yt&&Ot.length===0;let Ke;m==="general"&&n?Ke=()=>o(U,"general"):m==="mpa"&&n&&e==="volcengine"?Ke=()=>Z(U):aYt(m)&&i&&(Ke=()=>d(m));const St=m==="codex"&&i&&!!l;return a.jsxs(kh,{className:"my-agents-page","aria-label":E("myAgents.agent"),children:[a.jsx(q0,{title:E("myAgents.agent"),className:"my-agents-header"}),a.jsxs(sb,{className:"my-agent-toolbar",children:[a.jsx(ab,{idPrefix:"my-agent-ownership",ariaLabel:E("myAgents.creatorFilter"),value:V,items:[{id:"all",label:E("common.all"),disabled:s==="mine"},{id:"mine",label:E("agentSelector.createdByMe")}],onChange:Ct}),a.jsxs("div",{className:"resource-toolbar__actions",children:[a.jsx(ob,{id:"my-agent-type-filter",ariaLabel:E("myAgents.agentType"),value:m,options:Ye,onChange:Pt}),a.jsx(ob,{id:"my-agent-region-filter",ariaLabel:E("myAgents.region"),value:U,options:ye,onChange:xt}),a.jsx(Zp,{className:"my-agent-search","aria-label":E("myAgents.searchAgents"),value:F,onChange:qe=>M(qe.target.value),placeholder:E("common.search")}),St?a.jsxs("button",{type:"button",className:"my-agent-create-secondary",onClick:l,children:[a.jsx(bYt,{}),a.jsx("span",{children:E("myAgents.handoff")})]}):null]})]}),a.jsxs(Jp,{className:"my-agent-results",ref:j,"aria-label":E("myAgents.agentList",{type:Nt}),children:[Yt?a.jsx(cl,{}):(m==="general"||m==="mpa"?X:ke)&&Ot.length===0?a.jsxs("div",{className:"my-agent-empty",role:"alert",children:[a.jsx("p",{children:m==="general"||m==="mpa"?X:ke}),a.jsx("button",{type:"button",onClick:()=>{m==="general"||m==="mpa"?Ue("",!0):jt(m)},children:E("common.reload")})]}):xn&&!Ke?F.trim()||V==="mine"||U!==D?a.jsx("div",{className:"my-agent-empty-message",children:a.jsxs(Wn,{fill:"none",children:[a.jsx(Wn.Icon,{children:a.jsx(rat,{})}),a.jsx(Wn.Title,{children:E("myAgents.noMatchingAgents")}),a.jsx(Wn.Description,{children:E("myAgents.adjustSearch")})]})}):m!=="general"?a.jsx("div",{className:"my-agent-empty-message",children:a.jsxs(Wn,{fill:"none",children:[a.jsx(Wn.Icon,{children:a.jsx(yYt,{type:m})}),a.jsx(Wn.Title,{className:"my-agent-sandbox-empty-title",children:E("myAgents.noAgentType",{type:Nt})})]})}):a.jsx("div",{className:"my-agent-empty-message",children:a.jsxs(Wn,{fill:"none",children:[a.jsx(Wn.Icon,{children:a.jsx(Ap,{})}),a.jsx(Wn.Title,{children:E("myAgents.noGeneralAgents")}),a.jsx(Wn.Description,{children:E("myAgents.createGeneralAgentDescription")})]})}):a.jsxs(a.Fragment,{children:[(m==="general"||m==="mpa")&&X?a.jsxs("div",{className:"my-agent-inline-error",role:"alert",children:[a.jsx("span",{children:X}),a.jsx("button",{type:"button",onClick:()=>void Ue("",!0),children:E("common.reload")})]}):null,a.jsxs(W0,{className:"my-agent-grid",children:[Ke?a.jsx(lb,{className:"my-agent-create-card","aria-label":E("myAgents.createAgentType",{type:Nt}),onClick:Ke,icon:a.jsx(mYt,{}),children:E(m==="mpa"?"myAgents.mpaCreate.title":"myAgents.createAgent")}):null,Ot.map(qe=>{var et,ft,Et,At,It;const nt=OYt(qe,ne,E);return a.jsx(EYt,{agent:qe,onReview:L,deploymentTask:He(qe),nowMs:Se,onViewDeploymentTask:k,onUse:tt,compatibility:qe.runtime?ae[ty(qe)]??{status:"checking",message:E("myAgents.compatibility.checking")}:void 0,onRetryCompatibility:mt,onPrepareUpdate:((et=qe.runtime)==null?void 0:et.canManage)===!1||((ft=qe.runtime)==null?void 0:ft.visibility)==="enterprise"||((Et=qe.runtime)==null?void 0:Et.reviewStatus)==="pending"?void 0:Ne,onViewDetails:nt&&((At=qe.runtime)==null?void 0:At.canManage)!==!1?()=>{nt.sandbox?h(nt.sandbox):u(nt)}:void 0,connecting:qe.id===Pe,connectError:ze[qe.id],connected:((It=qe.runtime)==null?void 0:It.runtimeId)===v,onEditDraft:S,onDeleteDraft:Oe},qe.id)})]})]}),(m==="general"||m==="mpa")&&!X&&!Yt&&(Ot.length>0||!!G)&&a.jsx("div",{className:"my-agent-load-more",ref:T,"aria-live":"polite",children:se?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),a.jsx("span",{children:E("myAgents.loadingMore")})]}):G?a.jsx("span",{children:E("myAgents.scrollForMore")}):a.jsx("span",{children:E("myAgents.allLoaded")})})]}),z&&a.jsx(rYt,{region:z,onClose:()=>Z(null),onCreated:()=>{Zm(),U===z&&m==="mpa"&&Ue("",!0)}},z),_!=null&&_.runtime?a.jsx(l9e,{runtimeId:_.runtime.runtimeId,region:_.runtime.region,name:_.name,canPublish:_.runtime.canPublish===!0,onClose:()=>L(null),onChanged:()=>{Zm(),Ue("",!0)}},`${_.runtime.region}:${_.runtime.runtimeId}`):null,ge?a.jsx(Cd,{title:E("myAgents.deleteDraftTitle"),description:E("myAgents.deleteDraftDescription",{name:ge.draft.name||E("agentSelector.unnamedAgent")}),confirmLabel:E("myAgents.deleteDraft"),variant:"danger",onCancel:()=>Oe(null),onConfirm:()=>{C==null||C(ge),Oe(null)}}):null]})}function gK({section:e,onWorkspace:t,onEnvironment:n,onProjects:i,actions:r,children:s,className:o=""}){const{t:l}=Te("ui"),c=l(e==="workspaces"?"workspace.title":e==="environments"?"common.environment":"workspace.codeProjects");return a.jsxs(kh,{className:`workspace-center ${o}`,"aria-label":c,children:[a.jsx(q0,{title:c}),a.jsxs(sb,{children:[(t||n)&&a.jsx(ab,{items:[{id:"workspaces",label:l("workspace.title")},{id:"environments",label:l("common.environment")},...i?[{id:"projects",label:l("workspace.codeProjects")}]:[]],value:e,onChange:u=>{u==="workspaces"&&(t==null||t()),u==="environments"&&(n==null||n()),u==="projects"&&(i==null||i())},ariaLabel:l("workspace.resourceType"),idPrefix:"workspace-center"}),a.jsx("div",{className:"resource-toolbar__actions",children:r})]}),s]})}const AYt="_Container_13560_1",TYt="_Textarea_13560_174",Goe={Container:AYt,Textarea:TYt},vb=e=>{const t=p.useRef(null),i=`search-ui-input-${p.useId()}`,{id:r,name:s,variant:o="outline",size:l="md",gutterSize:c,className:u,autoComplete:d,disabled:f=!1,readOnly:h=!1,invalid:m=!1,allowAutofillExtensions:g=!!s,onFocus:b,onBlur:v,onAnimationStart:y,onAutofill:w,autoSelect:x,rows:O=3,maxRows:k,autoResize:S,ref:C,onChange:E,...j}=e,[T,R]=p.useState(!1),A=S?Math.max(k??10,O):O;p.useEffect(()=>{var I;x&&((I=t.current)==null||I.select())},[x]);const N=I=>{y==null||y(I),I.animationName==="native-autofill-in"&&(w==null||w())},P=p.useCallback(()=>{if(!S||!t.current||A===void 0)return;t.current.style.height="0px";const I=t.current.scrollHeight;t.current.style.height=I+"px"},[S,A]);return p.useEffect(()=>{P()},[e.value,O,P]),a.jsx("div",{className:Ui(Goe.Container,u),"data-variant":o,"data-size":l,"data-gutter-size":c,"data-focused":T,"data-disabled":f?"":void 0,"data-readonly":h?"":void 0,"data-invalid":m?"":void 0,style:z0({"textarea-min-rows":`${O}`,"textarea-max-rows":`${A}`}),children:a.jsx("textarea",{...j,onChange:I=>{E==null||E(I),P()},ref:eT([t,C]),id:r||(g?void 0:i),className:Goe.Textarea,name:s,readOnly:h,disabled:f,rows:O,onFocus:I=>{R(!0),b==null||b(I)},onBlur:I=>{R(!1),v==null||v(I)},onAnimationStart:N,"data-lpignore":g?void 0:!0,"data-1p-ignore":g?void 0:!0})})},PL="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2048%2048'%3e%3cimage%20width='48'%20height='48'%20href='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAMKADAAQAAAABAAAAMAAAAADbN2wMAAAH7UlEQVRoBdVZWWwbVRQ9492Onc1xTfaWLukq9oSqLKnYBZRSNgn6AagsAgmJRfzxg4SEEDtiER8IBKKAChK0FS1tKYWW0lZQKKV0gxCVJm3ikDiO17EdzrUzSdw4jj1OpeQqNzO237vvnHfvu/e9GWVwcBBDYue1mrqE2kI1UqeSJAnmIHUzNUCNUmGiKtQy6oPUR6geqnw/FSVOUH9R36KupfaDHnBQn6MGqEnqVJcEAfZTBbNL4b+lZPI1VbwwnaSfYO8z8N+TVMd0Qj6EVdbs3eIBP29cVFkL00kk+wSEwHAamgh9bDAJSQWTITZFnF+85J1tBPyOUC9OqqnsVdTIRkVBi70Msy125uriHJ8XAXFRfzKBTQM+rO0/hc54cSQE8iyzAx/XLcEltjIU44uCQijOaHvPfxIv97TjWCzEcMo7+sZ4TGa+2V6KT2rPQ73ZptsPBZE30fVrymvxTvUCtDoqYC0ijhMk/3MkgDd62xFheOqVggjIIAbOVaujEh/ULsaNzioUsxhVAv/A34GD0YBubxZMQJupWpMNr58zHytcHth1ekICsDcRx4u+fxBK6vOCbgKyEIXEK975WOmaoZuErKv1QR8ORQd0eUE3Ac0TNSYrXvI24fZSLxwGfebiDKW3e08gln9J0oYvKoMNG6kmiRdmzMOtTi8sOsJJJfANA93oiseGbeZ7k1EHZAKCEcApu4wCxUsSz3rm4HQiim3B/wpOsBJA2yP/4cZIJYIBFcGwCjWeSKEwm4wosZtR7rKizGXJQJZRB1TuttftAprnAbOrM9rl9UHqwg+s1o+eOow/GNN5CaPOklSgdKq4us+Ji7pt6Dw1AF9vBOGImjJht5lRVWFDY7UL58/3wOt2YPEcN2xWVpPRe6EQC+y9rwINPNKsuRaYX5cXhIxGkks+Y7V+6vQRdLBi5yx1bGwicFebivj+ARgOhZGMJMFyQyWpoV2GRIa2ZXOX2bDyqnPxzEPNKC+1Zj957eDBTbz34PXAwvoMfBN+kGV8Bxf00VgQz/vaEB6nSCnRQVj2h2DZG4TyZwQWlSils3m8RDDEhk2uaqlHaYklVb3Ha42dh4B3eMzZ//eEmMc0kGL3cEU9WksqU4XvzAYKZ9n6fQCOz3thORCGkhgCf2bDMz4bjQpW39yE65Y1QO5FxiUgP+76E3hzI7D1VyBcwP5NTFcZzXjaPRMNZmvGPkfA23YMwLHRD0Mf3ZwTgaBIi8GgYMGsSjx2z3kEP9Jp5E5rOeoqQH75C3htPfDpD4CskXxFvHC5vQKPVjSwPqQfcKTAfxuA/Ws/lBAXwEhUTGjWSAL3r1qYykSju+UkIFbZDx09wPvb0iH1W9uEYw03MHAV3ltew1CqgDkyCNtWgt/cnwY/3GriG5n9hbMrccNljRmzLz0nJCCNJBsEwsCH24E3NgDr96brhfyWS2Sm3EYLVsOL0i0DsG8h+LDkqcLExHhfc9siVDDrjJ59sZJRyHKZFRKybiSkTtIjR08CrXwEdtGcXL2A4+192LOuDeatfqg6wMvsL5lbhWuWysIdO995E9BgSkh19THX7wQOtANXLgKWLQSaarUWI9dNP7bjo68OY9uef6GqhcW8ZkViX2a/nBWYQ4+RggmIBfFGnHgOcD0c7wD2HgOW0xuXk0xN5SDaOwL4cnsb1m05joPHejKK0hgEOb4Q8Muba3H1pXUwZZl96aqLgHSU2RCbEe6/9hzh875OYPdhYF5NDLt/Oohd+46gNxBjm2zzJhZyi/RyV5TggdsvRJnTOm5j3QQ0i9ra6OHj1u9+B/YdNcLXVQdDmYNPy9oZ971IcIPHjUHadVrHHFfZNphtTtx508W4eJEHsg7Gk6IJaIZlDEn3EdUEl7sBg4la2MtqkYgNIOz/F9FgF6IhX6p5mozcjgbGasw/xWCCs7IeN7U24b4VddwZj26jjTZynTQCmknxSBqIETanh7ceWEpmpIiokT7E6JFosBvxaD/iJCeNDQYzTFYnzHY3SsobmfM9eOyucjTO0KyOf510AqOHkl2kiMlSQoAlsPLAk4hHSCaIJMMqmUgfYBQeggxGK4xmOxprXHh8lYK51em+E/0/qwQyBh8iY+Q52pjlOZD8XFcFPHELcGlT3stlbBaymtOROTReBoZJ+0DjZ9pv4SFq9fL0YWqcjJl1+AwP8OSGS+amq6y4P/fyyWqvoC9lDAG7ainPEJcBs7xMBGOLbU6bGQTMJHAnDUlG2biPFZevEM4GCZl9sSsnPgG+bAHfa+l8vZJxpNSo+oPp/c4XP6bPBN0kog2qtdFz1WzIkfXmZuAKVm6JewlbvZKVgGZMilMPwW9ngdr5B3CEG7iEbCY5ffl6RgPtYDGdybS4ogW4YDbgLefTD5s2kv5rTgKaWdlKi1fau4BDJ3jM5I70NDd0J7grzfZEUMg5CM5Tmg4TiW3ZtVYxTKpcgM2iWS7+mhcBbRiZ/TBTd4jPjtSEVF3AxxdUPgkxTrUUMTcBykKUmLZwhQlYPhWBeCBV5DRjk3QtiEC2McUDsjPVCEhWEQ8Umk2y2c7nOyEwrV/ySdbdQo3nw3aKtRHM3wiBtVQu02knISJ+SQh8Q32TyqTJJ6xTXyQzyzb2LeoBWQOy5pjwcDf1YSqzNIooLex99kTCppsq4N+l+oUArylhoku9sb+O18VU8c5UEiZu7KGyrKKTmgr7/wGxhy03aZIycwAAAABJRU5ErkJggg=='%20/%3e%3c/svg%3e",_Yt="data:image/svg+xml,%3c?xml%20version='1.0'?%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20100%20100'%3e%3ctitle%3ePandoc%20Icon%3c/title%3e%3cdesc%20property='dc:creator'%3eAlbert%20Krewinkel%3c/desc%3e%3cmetadata%20id='license'%20xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23'%20xmlns:dc='http://purl.org/dc/elements/1.1/'%20xmlns:cc='http://creativecommons.org/ns%23'%3e%3crdf:RDF%3e%3ccc:Work%20rdf:about=''%3e%3cdc:format%3eimage/svg+xml%3c/dc:format%3e%3cdc:type%20rdf:resource='http://purl.org/dc/dcmitype/StillImage'%20/%3e%3ccc:license%20rdf:resource='http://creativecommons.org/licenses/by-sa/4.0/'%20/%3e%3c/cc:Work%3e%3ccc:License%20rdf:about='http://creativecommons.org/licenses/by-sa/4.0/'%3e%3ccc:permits%20rdf:resource='http://creativecommons.org/ns%23Reproduction'%20/%3e%3ccc:permits%20rdf:resource='http://creativecommons.org/ns%23Distribution'%20/%3e%3ccc:requires%20rdf:resource='http://creativecommons.org/ns%23Notice'%20/%3e%3ccc:requires%20rdf:resource='http://creativecommons.org/ns%23Attribution'%20/%3e%3ccc:permits%20rdf:resource='http://creativecommons.org/ns%23DerivativeWorks'%20/%3e%3ccc:requires%20rdf:resource='http://creativecommons.org/ns%23ShareAlike'%20/%3e%3c/cc:License%3e%3c/rdf:RDF%3e%3c/metadata%3e%3crect%20fill='%23fed'%20stroke='%23fed'%20width='100'%20height='100'/%3e%3cg%20fill='none'%20stroke='%234093da'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='8'%20transform='skewX(-6)%20translate(8%201)'%3e%3cpath%20d='M%2030,10%20l%200,80%20M%2045,10%20l%200,80%20M%2020,10%20l%2040,0%20l%2018,18%20l%200,25%20l%20-33,0'%20/%3e%3cpath%20fill='%234093da'%20stroke-width='6'%20d='M%2061,10%20l%2017,17%20l%20-17,0%20l%200,-17'%20/%3e%3c/g%3e%3c/svg%3e",jYt="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%20100%20100'%20version='1.1'%20id='svg4'%20sodipodi:docname='favicon.svg'%20inkscape:version='1.4.4%20(dcaf3e7,%202026-05-05)'%20xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape'%20xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:svg='http://www.w3.org/2000/svg'%3e%3csodipodi:namedview%20id='namedview4'%20pagecolor='%23ffffff'%20bordercolor='%23000000'%20borderopacity='0.25'%20inkscape:showpageshadow='2'%20inkscape:pageopacity='0.0'%20inkscape:pagecheckerboard='0'%20inkscape:deskcolor='%23d1d1d1'%20showgrid='true'%20inkscape:zoom='8.2236519'%20inkscape:cx='34.534536'%20inkscape:cy='45.174577'%20inkscape:window-width='1881'%20inkscape:window-height='1382'%20inkscape:window-x='1512'%20inkscape:window-y='30'%20inkscape:window-maximized='0'%20inkscape:current-layer='svg4'%3e%3cinkscape:grid%20type='axonomgrid'%20id='grid4'%20units='px'%20originx='0'%20originy='0'%20spacingx='3.7795276'%20spacingy='3.7795276'%20empcolor='%230099e5'%20empopacity='0.30196078'%20color='%230099e5'%20opacity='0.14901961'%20empspacing='0'%20dotted='false'%20gridanglex='40'%20gridanglez='40'%20enabled='true'%20visible='true'%20/%3e%3c/sodipodi:namedview%3e%3cdefs%20id='defs1'%3e%3cfilter%20id='shadow'%20x='0'%20y='0'%20width='1'%20height='1'%3e%3cfeDropShadow%20dx='0'%20dy='2'%20stdDeviation='3'%20flood-color='rgba(50,%2050,%2093,%200.18)'%20/%3e%3c/filter%3e%3c/defs%3e%3crect%20x='4'%20y='4'%20width='92'%20height='92'%20rx='22.08'%20fill='%23e8efff'%20filter='url(%23shadow)'%20id='rect1'%20transform='matrix(1.0869565,0,0,1.0869565,-4.347826,-4.347826)'%20style='stroke-width:0.92'%20ry='22.08'%20/%3e%3cpath%20style='fill:%230a2540;fill-opacity:1;stroke-width:1.88976'%20d='M%2049.999999,6.535431%204.9573423,44.330708%2049.999999,82.125984%2092.790523,46.220471%2095.042656,44.330708%20Z'%20id='path1'%20/%3e%3cpath%20style='fill:%23425466;fill-opacity:1;stroke-width:1.88976'%20d='M%204.9573423,44.330708%20V%2055.669291%20L%2049.999999,93.464567%20V%2082.125984%20Z'%20id='path2'%20/%3e%3cpath%20style='fill:%231a3550;fill-opacity:1;stroke-width:1.88976'%20d='M%2049.999999,82.125984%2095.042656,44.330708%20V%2055.669291%20L%2049.999999,93.464567%20Z'%20id='path3'%20/%3e%3cpath%20style='fill:%234ade80;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;fill-opacity:1'%20d='m%2045.042657,30.236221%209.008531,-7.559055%2022.521328,18.897638%20-9.008531,7.559056%20z'%20id='path5'%20/%3e%3cpath%20style='fill:none;fill-opacity:1;stroke:%234ade80;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1'%20d='M%2027.025594,49.133859%2047.29479,47.244096%2045.042657,64.25197'%20id='path6'%20/%3e%3c/svg%3e",NYt="data:image/svg+xml,%3csvg%20fill='%23261230'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eAstral%3c/title%3e%3cpath%20d='M1.44%200C.6422%200%200%20.6422%200%201.44v21.12C0%2023.3578.6422%2024%201.44%2024h21.12c.7978%200%201.44-.6422%201.44-1.44V1.44C24%20.6422%2023.3578%200%2022.56%200Zm4.7998%204.8h11.5199c.7953%200%201.44.6447%201.44%201.44V19.2h-6.624v-4.32h-1.152v4.32H4.8V6.24c0-.7953.6446-1.44%201.4398-1.44m4.032%205.472v1.152h3.456v-1.152z'/%3e%3c/svg%3e",RYt="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='1.34em'%20height='1em'%20viewBox='0%200%20256%20192'%3e%3cpath%20fill='%232d4552'%20d='M84.38%20108.352c-9.556%202.712-15.826%207.467-19.956%2012.218c3.956-3.461%209.255-6.639%2016.402-8.665c7.311-2.072%2013.548-2.057%2018.702-1.062v-4.03c-4.397-.402-9.437-.082-15.148%201.539M63.987%2074.475l-35.49%209.35s.646.914%201.844%202.133l30.092-7.93s-.427%205.495-4.13%2010.41c7.005-5.299%207.684-13.963%207.684-13.963m29.709%2083.41c-49.946%2013.452-76.37-44.43-84.37-74.472c-3.696-13.868-5.31-24.37-5.74-31.148a11.5%2011.5%200%200%201%20.025-1.84C1.021%2050.58-.22%2051.927.032%2055.82c.43%206.773%202.044%2017.275%205.74%2031.147c7.997%2030.038%2034.424%2087.92%2084.37%2074.468c10.871-2.929%2019.038-8.263%2025.17-15.073c-5.652%205.104-12.724%209.123-21.616%2011.523M103.08%2039.05v3.555h19.59c-.401-1.259-.806-2.393-1.208-3.555z'/%3e%3cpath%20fill='%232d4552'%20d='M127.05%2068.325c8.81%202.503%2013.47%208.68%2015.933%2014.146l9.824%202.79s-1.34-19.132-18.645-24.047c-16.189-4.6-26.151%208.995-27.363%2010.754c4.71-3.355%2011.586-6.102%2020.251-3.643m78.197%2014.234c-16.204-4.62-26.162%209.003-27.356%2010.737c4.713-3.351%2011.586-6.099%2020.247-3.629c8.797%202.506%2013.452%208.676%2015.923%2014.146l9.837%202.8s-1.361-19.135-18.651-24.054m-9.76%2050.443l-81.718-22.845s.885%204.485%204.279%2010.293l68.803%2019.234c5.664-3.277%208.636-6.682%208.636-6.682m-56.655%2049.174C74.127%20164.828%2081.949%2082.386%2092.419%2043.32c4.311-16.1%208.743-28.066%2012.419-36.088c-2.193-.451-4.01.704-5.804%204.354C95.13%2019.5%2090.14%2032.387%2085.312%2050.427c-10.467%2039.066-18.29%20121.506%2046.412%20138.854c30.497%208.17%2054.256-4.247%2071.966-23.749c-16.81%2015.226-38.274%2023.763-64.858%2016.644'/%3e%3cpath%20fill='%23e2574c'%20d='M103.081%20138.565v-16.637l-46.223%2013.108s3.415-19.846%2027.522-26.684c7.311-2.072%2013.549-2.058%2018.701-1.063V39.05h23.145c-2.52-7.787-4.958-13.782-7.006-17.948c-3.387-6.895-6.859-2.324-14.741%204.269c-5.552%204.638-19.583%2014.533-40.698%2020.222c-21.114%205.694-38.185%204.184-45.307%202.95c-10.097-1.742-15.378-3.96-14.884%203.721c.43%206.774%202.043%2017.277%205.74%2031.148c7.996%2030.039%2034.424%2087.92%2084.37%2074.468c13.046-3.515%2022.254-10.464%2028.637-19.32h-19.256zm-74.588-54.74l35.494-9.35s-1.034%2013.654-14.34%2017.162c-13.31%203.504-21.154-7.812-21.154-7.812'/%3e%3cpath%20fill='%232ead33'%20d='M236.664%2039.84c-9.226%201.617-31.361%203.632-58.716-3.7c-27.363-7.328-45.517-20.144-52.71-26.168c-10.197-8.54-14.682-14.476-19.096-5.498c-3.902%207.918-8.893%2020.805-13.723%2038.846c-10.466%2039.066-18.289%20121.505%2046.413%20138.853c64.687%2017.333%2099.126-57.978%20109.593-97.047c4.83-18.037%206.948-31.695%207.53-40.502c.665-9.976-6.187-7.08-19.29-4.784M106.668%2072.161s10.196-15.859%2027.49-10.943c17.305%204.915%2018.645%2024.046%2018.645%2024.046zm42.215%2071.163c-30.419-8.91-35.11-33.167-35.11-33.167l81.714%2022.846c0-.004-16.494%2019.12-46.604%2010.32m28.89-49.85s10.183-15.847%2027.474-10.918c17.29%204.923%2018.651%2024.054%2018.651%2024.054z'/%3e%3cpath%20fill='%23d65348'%20d='m86.928%20126.51l-30.07%208.522s3.266-18.609%2025.418-25.983L65.25%2045.147l-1.471.447c-21.115%205.694-38.185%204.184-45.307%202.95c-10.097-1.741-15.379-3.96-14.885%203.722c.43%206.774%202.044%2017.276%205.74%2031.147c7.997%2030.039%2034.425%2087.92%2084.37%2074.468l1.471-.462zM28.493%2083.825l35.494-9.351s-1.034%2013.654-14.34%2017.162c-13.31%203.504-21.154-7.811-21.154-7.811'/%3e%3cpath%20fill='%231d8d22'%20d='m150.255%20143.658l-1.376-.335c-30.419-8.91-35.11-33.166-35.11-33.166l42.137%2011.778l22.308-85.724l-.27-.07c-27.362-7.329-45.516-20.145-52.71-26.17c-10.196-8.54-14.682-14.475-19.096-5.497c-3.898%207.918-8.889%2020.805-13.719%2038.846c-10.466%2039.066-18.289%20121.505%2046.413%20138.852l1.326.3zM106.668%2072.16s10.196-15.859%2027.49-10.943c17.305%204.915%2018.645%2024.046%2018.645%2024.046z'/%3e%3cpath%20fill='%23c04b41'%20d='m88.46%20126.072l-8.064%202.289c1.906%2010.74%205.264%2021.047%2010.534%2030.152c.918-.202%201.828-.376%202.762-.632c2.449-.66%204.72-1.479%206.906-2.371c-5.89-8.74-9.785-18.804-12.137-29.438m-3.148-75.644c-4.144%2015.467-7.852%2037.73-6.831%2060.06c1.826-.793%203.756-1.532%205.9-2.14l1.492-.334c-1.82-23.852%202.114-48.157%206.546-64.694a323%20323%200%200%201%203.373-11.704a105%20105%200%200%201-5.974%203.547a307%20307%200%200%200-4.506%2015.265'/%3e%3c/svg%3e",IYt="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='512'%20height='512'%20version='1.1'%20viewBox='0%200%20135.47%20135.47'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m67.733%2067.733%2029.33%2016.933-29.33%2050.8c37.408%200%2067.733-30.325%2067.733-67.733%200-12.341-3.3168-23.901-9.0837-33.867h-58.65z'%20fill='%23afccf9'/%3e%3cpath%20d='m67.733-1e-6c-25.07%200-46.942%2013.63-58.654%2033.875l29.324%2050.792%2029.33-16.933v-33.867h58.65c-11.714-20.24-33.583-33.867-58.65-33.867z'%20fill='%231767d1'/%3e%3cpath%20d='m0%2067.733c0%2037.408%2030.324%2067.733%2067.733%2067.733l29.33-50.8-29.33-16.933-29.33%2016.933-29.324-50.792c-5.7637%209.9632-9.0794%2021.519-9.0794%2033.858'%20fill='%23679ef5'/%3e%3cpath%20d='m101.6%2067.733c0%2018.704-15.163%2033.867-33.867%2033.867-18.704%200-33.867-15.163-33.867-33.867s15.163-33.867%2033.867-33.867c18.704%200%2033.867%2015.163%2033.867%2033.867'%20fill='%23fff'/%3e%3cpath%20d='m95.25%2067.733c0%2015.197-12.32%2027.517-27.517%2027.517-15.197%200-27.517-12.32-27.517-27.517%200-15.197%2012.32-27.517%2027.517-27.517%2015.197%200%2027.517%2012.32%2027.517%2027.517'%20fill='%231a74e7'/%3e%3c/svg%3e",PYt="data:image/svg+xml,%3csvg%20fill='%23F03C2E'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGit%3c/title%3e%3cpath%20d='M13.09%2023.549a1.54%201.54%200%200%201-2.18%200L.451%2013.089a1.54%201.54%200%200%201%200-2.179l7.191-7.19%202.733%202.733a1.85%201.85%200%200%200%20.964%202.326v6.66a1.849%201.849%200%201%200%201.54%200V8.957l2.508%202.508a1.85%201.85%200%201%200%201.09-1.09l-2.634-2.634a1.85%201.85%200%200%200-2.378-2.377L8.73%202.63%2010.91.451a1.54%201.54%200%200%201%202.179%200l10.459%2010.46a1.54%201.54%200%200%201%200%202.179z'/%3e%3c/svg%3e",DYt="data:image/svg+xml,%3csvg%20fill='%23073551'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3ecurl%3c/title%3e%3cpath%20d='M.803%2014.8169c0-.5342.433-.9665.9665-.9665.5335%200%20.9665.4323.9665.9665%200%20.5335-.433.9657-.9665.9657-.5335%200-.9666-.4322-.9666-.9657m2.736%200c0-.1963-.0532-.376-.1119-.5525-.2344-.7024-.876-1.2169-1.6575-1.2169-.1249%200-.2344.0465-.3524.0708C.6149%2013.2865%200%2013.9646%200%2014.817c0%20.9764.7923%201.7694%201.7695%201.7694.9772%200%201.7694-.793%201.7694-1.7694m-1.7694-7.149c.5335%200%20.9665.433.9665.9665%200%20.5335-.433.9665-.9665.9665-.5343%200-.9666-.433-.9666-.9665%200-.5335.4323-.9665.9666-.9665m0%202.7359c.9772%200%201.7694-.7923%201.7694-1.7694%200-.1956-.0532-.376-.1119-.5525-.2344-.7024-.8767-1.2169-1.6575-1.2169-.1249%200-.2344.0465-.3524.0716C.6149%207.104%200%207.782%200%208.6344c0%20.9771.7923%201.7694%201.7695%201.7694m13.221-5.694c-.5342%200-.9665-.433-.9665-.9664a.966.966%200%2001.9666-.9665c.5335%200%20.9658.4322.9658.9665%200%20.5334-.4323.9664-.9658.9664m-9.6%2016.5133c-.5335%200-.9666-.433-.9666-.9665%200-.5342.433-.9665.9666-.9665a.966.966%200%2001.9665.9665c0%20.5335-.4323.9665-.9665.9665m9.6-19.2491c-.978%200-1.7695.7922-1.7695%201.7694%200%20.2085.0525.4025.1187.5882L5.039%2018.5581c-.803.1681-1.4179.8462-1.4179%201.6985%200%20.9772.7923%201.7694%201.7695%201.7694.9772%200%201.7694-.7922%201.7694-1.7694%200-.1963-.0525-.3759-.111-.5525l8.3427-14.2728c.7778-.1865%201.3683-.8531%201.3683-1.688%200-.977-.793-1.7693-1.7694-1.7693m7.24%202.7359c-.5343%200-.9666-.433-.9666-.9665a.966.966%200%2001.9665-.9665c.5335%200%20.9666.4322.9666.9665%200%20.5334-.433.9665-.9666.9665M12.6313%2021.223c-.5343%200-.9665-.433-.9665-.9665a.966.966%200%2001.9665-.9665c.5335%200%20.9658.4323.9658.9665%200%20.5335-.4323.9665-.9658.9665M22.2305%201.974c-.9772%200-1.7694.7922-1.7694%201.7694%200%20.2085.0525.4025.1187.5882l-8.3009%2014.2265c-.8021.1681-1.417.8462-1.417%201.6985%200%20.9772.7922%201.7694%201.7694%201.7694.9764%200%201.7687-.7922%201.7687-1.7694%200-.1963-.0525-.3759-.1111-.5525l8.3427-14.2728C23.4094%205.2448%2024%204.5782%2024%203.7433c0-.977-.7923-1.7693-1.7695-1.7693'/%3e%3c/svg%3e",MYt="data:image/svg+xml,%3csvg%20fill='%23007808'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eFFmpeg%3c/title%3e%3cpath%20d='M21.72%2017.91V6.5l-.53-.49L9.05%2018.52l-1.29-.06L24%201.53l-.33-.95-11.93%201-5.75%206.6v-.23l4.7-5.39-1.38-.77-9.11.77v2.85l1.91.46v.01l.19-.01-.56.66v10.6c.609-.126%201.22-.241%201.83-.36L14.12%205.22l.83-.04L0%2021.44l9.67.82%201.35-.77%206.82-6.74v2.15l-5.72%205.57%2011.26.95.35-.94v-3.16l-3.29-.18c.434-.403.858-.816%201.28-1.23z'/%3e%3c/svg%3e",LYt="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%201080%201080'%3e%3c!--%20Generator:%20Adobe%20Illustrator%2030.3.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.3%20Build%20182)%20--%3e%3cdefs%3e%3cstyle%3e%20.st0%20{%20fill:%20%23ff0;%20}%20.st1%20{%20fill:%20%23333;%20}%20%3c/style%3e%3c/defs%3e%3cpath%20class='st0'%20d='M660.52,419.49l-195.15-52.98c-15.84-4.3-19.16-25.29-5.43-34.28l169.23-110.7-9.91-201.97c-.8-16.39,18.13-26.04,30.92-15.76l157.57,126.74,189.03-71.84c15.34-5.83,30.37,9.2,24.54,24.54l-71.84,189.03,126.74,157.57c10.29,12.79.64,31.73-15.76,30.92l-201.97-9.91-110.7,169.23c-8.98,13.73-29.98,10.41-34.28-5.43l-52.98-195.15h-.01Z'/%3e%3cpath%20class='st1'%20d='M603.34,476.66l32.94,121.68,4.45,16.23-429.11,429.11c-48.45,48.45-126.85,48.45-175.3,0C12.16,1019.51,0,987.89,0,956.15s12.02-63.48,36.31-87.77l429.11-429.11,16.35,4.33,121.56,33.06h0Z'/%3e%3c/svg%3e";function bK(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 .5C5.65.5.5 5.65.5 12c0 5.08 3.29 9.39 7.86 10.91 .58 .11 .79-.25.79-.56v-2.02c-3.2.7-3.88-1.36-3.88-1.36-.52-1.33-1.28-1.69-1.28-1.69-1.05-.72.08-.7.08-.7 1.16.08 1.77 1.19 1.77 1.19 1.03 1.77 2.71 1.26 3.37.96.1-.75.4-1.26.73-1.55-2.56-.29-5.25-1.28-5.25-5.7 0-1.26.45-2.29 1.19-3.1-.12-.29-.52-1.47.11-3.06 0 0 .97-.31 3.16 1.18A10.98 10.98 0 0 1 12 6.11c.98 0 1.96.13 2.87.39 2.19-1.49 3.16-1.18 3.16-1.18.63 1.59.23 2.77.11 3.06.74.81 1.19 1.84 1.19 3.1 0 4.43-2.7 5.4-5.27 5.69.42.36.78 1.06.78 2.14v3.04c0 .31.21.67.8.56A11.51 11.51 0 0 0 23.5 12C23.5 5.65 18.35.5 12 .5Z"})})}al.registerLanguage("bash",EM);const $Yt=48;function FYt(e,t=$Yt){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}function BYt(e){return al.highlight(e,{language:"bash",ignoreIllegals:!0}).value}function UYt({status:e}){return e==="succeeded"?a.jsx(Ef,{"aria-hidden":!0}):e==="failed"?a.jsx(oB,{"aria-hidden":!0}):e==="running"?a.jsx(Fi,{className:"studio-build-progress__spinner","aria-hidden":!0}):a.jsx(Aat,{"aria-hidden":!0})}function Xoe(e,t){if(!e)return"";const n=Date.parse(e);return Number.isNaN(n)?"":new Intl.DateTimeFormat(t,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(n)}function QYt({steps:e,log:t,logError:n="",logTruncated:i=!1,logUpdatedAt:r,loading:s=!1}){const{t:o,i18n:l}=Te("ui"),c=p.useRef(null),u=p.useRef(!0),[d,f]=p.useState(!1),h=p.useMemo(()=>BYt(t),[t]);p.useEffect(()=>{const g=c.current;g&&t&&u.current&&(g.scrollTop=g.scrollHeight)},[t]);const m=async()=>{try{await navigator.clipboard.writeText(t),f(!0),window.setTimeout(()=>f(!1),1500)}catch{f(!1)}};return a.jsxs("div",{className:"studio-build-progress",children:[a.jsx("ol",{className:"studio-build-progress__steps","aria-label":o("studioBuildProgress.steps"),children:e.map(g=>a.jsxs("li",{className:`is-${g.status}`,children:[a.jsx("span",{className:"studio-build-progress__step-icon",children:a.jsx(UYt,{status:g.status})}),a.jsx("span",{children:g.label})]},g.key))}),a.jsxs("section",{className:"studio-build-progress__log","aria-label":o("studioBuildProgress.log"),children:[a.jsxs("header",{children:[a.jsxs("div",{children:[a.jsx("strong",{children:o("studioBuildProgress.log")}),a.jsxs("span",{children:[o(s?"studioBuildProgress.syncing":n?"studioBuildProgress.loadFailed":"studioBuildProgress.synced"),i?o("studioBuildProgress.recentOnly"):"",Xoe(r,l.resolvedLanguage??l.language)?` · ${Xoe(r,l.resolvedLanguage??l.language)}`:""]})]}),a.jsxs(_t,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:!t,onClick:()=>void m(),"aria-label":o(d?"studioBuildProgress.copiedLog":"studioBuildProgress.copyLog"),children:[d?a.jsx(Ef,{"aria-hidden":!0}):a.jsx(eM,{"aria-hidden":!0}),o(d?"studioBuildProgress.copied":"studioBuildProgress.copy")]})]}),t?a.jsx("pre",{ref:c,tabIndex:0,"aria-label":o("studioBuildProgress.logContent"),onScroll:g=>{u.current=FYt(g.currentTarget)},children:a.jsx("code",{className:"hljs language-bash",dangerouslySetInnerHTML:{__html:h}})}):a.jsx("div",{className:`studio-build-progress__log-empty${n?" is-error":""}`,children:n||o(s?"studioBuildProgress.waiting":"studioBuildProgress.empty")})]})]})}function Yoe({name:e,description:t,icon:n,selected:i,disabled:r=!1,onChange:s,className:o=""}){return a.jsxs("button",{type:"button",className:`studio-package-option${i?" is-selected":""}${o?` ${o}`:""}`,"aria-pressed":i,disabled:r,onClick:()=>s(!i),children:[a.jsx("span",{className:"studio-package-option__icon","aria-hidden":"true",children:n}),a.jsxs("span",{className:"studio-package-option__content",children:[a.jsx("strong",{children:e}),t?a.jsx("span",{children:t}):null]}),a.jsx("span",{className:"studio-package-option__action","aria-hidden":"true",children:i?a.jsx(oat,{}):a.jsx(uat,{})})]})}function ny(e,t){return e[t]|e[t+1]<<8}function qv(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}async function zYt(e){const t=new DecompressionStream("deflate-raw"),n=new Blob([new Uint8Array(e)]).stream().pipeThrough(t);return new Uint8Array(await new Response(n).arrayBuffer())}async function m9e(e,t={}){let i=-1;for(let u=e.length-22;u>=0&&u>e.length-65557;u--)if(qv(e,u)===101010256){i=u;break}if(i<0)throw new Error(Xt("helpers.zip.invalid"));const r=ny(e,i+10);if(t.maxEntries!==void 0&&r>t.maxEntries)throw new Error(Xt("helpers.zip.tooManyFiles",{count:t.maxEntries}));let s=qv(e,i+16);const o=new TextDecoder("utf-8"),l=[];let c=0;for(let u=0;ut.maxUncompressedBytes)throw new Error(Xt("helpers.zip.tooLarge"));const w=ny(e,v+26),x=ny(e,v+28),O=v+30+w+x,k=e.subarray(O,O+f);let S;if(d===0)S=k;else if(d===8)S=await zYt(k);else{s+=46+m+g+b;continue}l.push({name:y,text:o.decode(S)}),s+=46+m+g+b}return l}const G7=/(^|\/)skill\.md$/i;function VYt(e){const t=(e??"").replace(/\r\n?/g,` +`),w=(e==null?void 0:e.pendingMessage)||s;if(p.useEffect(()=>{e&&f(u)},[e==null?void 0:e.status,u]),p.useEffect(()=>{if(!d||!g)return;const E=c.current;E&&(E.scrollTop=E.scrollHeight)},[d,g,y]),!e||!e.text&&e.status!=="error"&&!e.pendingMessage)return null;const x=kXt(e.updatedAt,l.resolvedLanguage??l.language),O=e.status==="complete"?o("agentWorkspace.logStatus.synced"):e.status==="error"?o("agentWorkspace.logStatus.failed"):o("agentWorkspace.logStatus.syncing"),k=e.omittedEarly?o("agentWorkspace.logStatus.earlyOmitted"):e.snapshotTruncated?o("agentWorkspace.logStatus.recentOnly"):e.truncated?o("agentWorkspace.logStatus.partiallyOmitted"):"",S=[O,e.lineCount?o("agentWorkspace.logLines",{count:e.lineCount}):"",k,x].filter(Boolean).join(" · ");async function C(){try{await navigator.clipboard.writeText(b),m(!0),window.setTimeout(()=>m(!1),1500)}catch{m(!1)}}return a.jsxs("section",{className:`aw-deploy-log is-${e.status}${d?"":" is-collapsed"}`,"aria-label":i,children:[a.jsxs("header",{children:[a.jsxs("div",{children:[a.jsx("strong",{children:n}),a.jsx("span",{children:S})]}),a.jsxs("div",{className:"aw-deploy-log-actions",children:[g&&a.jsx("button",{type:"button",onClick:()=>f(E=>!E),children:o(d?"common.collapse":"common.expand")}),g&&a.jsxs("button",{type:"button",onClick:()=>void C(),"aria-label":h?o("agentWorkspace.copiedLabel",{label:r}):o("agentWorkspace.copyLabel",{label:r}),title:h?o("agentWorkspace.copied"):o("agentWorkspace.copyLabel",{label:r}),children:[h?a.jsx(Cf,{"aria-hidden":!0}):a.jsx(eM,{"aria-hidden":!0}),a.jsx("span",{children:o(h?"agentWorkspace.copied":"agentWorkspace.copy")})]})]})]}),d&&(g?a.jsx("pre",{ref:c,children:y}):a.jsx("div",{className:"aw-deploy-log-empty",children:w}))]})}function SXt({task:e}){var n;const{t}=Te("ui");return a.jsx(l9e,{log:e.buildLog,autoExpand:((n=e.buildLog)==null?void 0:n.status)!=="complete"&&(e.status==="running"||e.status==="error")&&o9e(e,t)===1,title:t("agentWorkspace.buildLog"),ariaLabel:t("agentWorkspace.buildLog"),copyLabel:t("agentWorkspace.buildLog"),defaultPendingMessage:t("agentWorkspace.waitingBuildLog")})}function EXt({task:e}){var n;const{t}=Te("ui");return a.jsx(l9e,{log:e.githubLog,autoExpand:((n=e.githubLog)==null?void 0:n.status)!=="complete"&&(e.status==="running"||e.status==="error")&&e.phase==="github",title:t("agentWorkspace.githubMountLog"),ariaLabel:t("agentWorkspace.githubDeliveryMountLog"),copyLabel:t("agentWorkspace.githubMountLog"),defaultPendingMessage:t("agentWorkspace.waitingGithubMountLog")})}function CXt({task:e,onReturnToEdit:t}){const{t:n}=Te("ui"),[i,r]=p.useState(!1),s=a9e(e,n),o=o9e(e,n),l=e.status==="success"?100:Math.max(6,Math.min(100,e.pct??6)),c=e.status==="running"&&e.statusUnconfirmed?n("agentWorkspace.deployStatus.unconfirmed"):e.status==="running"?n("agentWorkspace.deployStatus.running"):e.status==="success"?n("agentWorkspace.deployStatus.success"):e.status==="error"?n("agentWorkspace.deployStatus.error"):n("agentWorkspace.deployStatus.cancelled"),u=()=>{i||!e.retry||(r(!0),e.retry().catch(()=>{}).finally(()=>r(!1)))};return a.jsxs("section",{className:`aw-deploy-progress-card is-${e.status}`,"aria-live":"polite",children:[a.jsxs("div",{className:"aw-deploy-progress-head",children:[a.jsxs("div",{children:[a.jsx("span",{className:"aw-deploy-progress-icon","aria-hidden":!0,children:e.status==="running"&&e.statusUnconfirmed?a.jsx(bN,{}):e.status==="running"?a.jsx(Bi,{className:"spin"}):e.status==="success"?a.jsx(Tat,{}):e.status==="error"?a.jsx(bN,{}):a.jsx(lB,{})}),a.jsxs("div",{children:[a.jsx("h3",{children:c}),a.jsx("p",{children:e.runtimeName})]})]}),a.jsx("strong",{children:e.status==="running"&&!e.statusUnconfirmed?`${Math.round(l)}%`:e.label})]}),a.jsx("div",{className:"aw-deploy-progress-track",role:"progressbar","aria-label":n("agentWorkspace.deploymentProgress"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(l),children:a.jsx("span",{style:{width:`${l}%`}})}),a.jsx("ol",{className:"aw-deploy-steps",children:s.map((d,f)=>{const h=e.status==="success"||fnew Set),[lr,Mn]=p.useState(()=>new Set),[ei,Bn]=p.useState(!1),[ki,zn]=p.useState(""),[Rn,di]=p.useState(null),[rt,zt]=p.useState([]),[ze,bt]=p.useState([]),[Ht,_n]=p.useState(!1),[jr,Hs]=p.useState(""),[qs,Dr]=p.useState(""),[ti,Si]=p.useState(0),[Zr,Jr]=p.useState([]),[ga,go]=p.useState(!1),[us,pe]=p.useState(""),[pr,bo]=p.useState(0),[to,fl]=p.useState(null),[no,ws]=p.useState(1),[Ws,Ti]=p.useState(!1),[rr,Ds]=p.useState(""),[Pl,hl]=p.useState(0),[mr,Mr]=p.useState(null),[pl,Mo]=p.useState(null),[Nr,Lo]=p.useState(null),[es,ba]=p.useState(!1),[Mi,Ms]=p.useState(""),[zr,ds]=p.useState(null),[ml,na]=p.useState(!1),[gi,Dl]=p.useState(""),[$o,Ks]=p.useState(0),[gl,Fo]=p.useState(""),[Pa,bl]=p.useState(!1),[Qu,Bo]=p.useState(!1),[hc,Ld]=p.useState(!1),[$d,yo]=p.useState(""),[Fd,yl]=p.useState(""),[Ml,Da]=p.useState(0),[Uo,Qo]=p.useState({saving:!1,error:"",notice:""}),[zu,vl]=p.useState(!1),[Ll,Ls]=p.useState(()=>new Set),[Ma,rn]=p.useState(!1),[$l,Os]=p.useState(""),[ts,ns]=p.useState(""),[Bd,Fl]=p.useState(()=>new Set),zo=p.useRef(!1),Bl=p.useRef(""),Gc=p.useRef(null),vo=p.useRef(0),ia=p.useRef(0),io=p.useRef(0),je=p.useRef(0),[lt,Lt]=p.useState(WGt),[Ln,wn]=p.useState("");p.useEffect(()=>{e.length!==0&&Lt(ue=>ue.map((Le,Ge)=>Ge===0&&Le.agentIds.length===0?{...Le,agentIds:e.slice(0,2).map(pt=>pt.id)}:Le))},[e]);const pn=p.useMemo(()=>{const ue=new Map;for(const Le of e)Le.runtimeId&&ue.set(Le.runtimeId,Le);return ue},[e]),jn=p.useMemo(()=>{var Le;const ue=new Map;for(const Ge of t){const pt=(Le=Ge.deploymentTarget)==null?void 0:Le.runtimeId;if(!pt||!pn.has(pt))continue;const ln=ue.get(pt);(!ln||Ge.updatedAt>ln.updatedAt)&&ue.set(pt,Ge)}return ue},[pn,t]),Wt=p.useMemo(()=>{const ue=new Map;for(const Le of f){if(!Le.runtimeId)continue;const Ge=ue.get(Le.runtimeId);(!Ge||Le.startedAt>Ge.startedAt)&&ue.set(Le.runtimeId,Le)}return ue},[f]),gn=p.useMemo(()=>{const ue=et.trim().toLowerCase();return ue?e.filter(Le=>{const Ge=Le.runtimeId?jn.get(Le.runtimeId):void 0,pt=Le.runtimeId?Wt.get(Le.runtimeId):void 0;return[Le.label,Le.app,Le.host??"",(Ge==null?void 0:Ge.draft.name)??"",(Ge==null?void 0:Ge.draft.description)??"",(pt==null?void 0:pt.runtimeName)??""].join(" ").toLowerCase().includes(ue)}):e},[e,Wt,et,jn]),$n=p.useMemo(()=>{const ue=et.trim().toLowerCase();return t.filter(Le=>{var pt;const Ge=(pt=Le.deploymentTarget)==null?void 0:pt.runtimeId;return Ge&&pn.has(Ge)?!1:ue?`${Le.draft.name} ${Le.draft.description}`.toLowerCase().includes(ue):!0})},[pn,t,et]),ai=p.useMemo(()=>t.filter(ue=>{var Ge;const Le=(Ge=ue.deploymentTarget)==null?void 0:Ge.runtimeId;return!Le||!pn.has(Le)}).length,[pn,t]),is=p.useMemo(()=>{const ue=et.trim().toLowerCase();return ue?lt.filter(Le=>Le.name.toLowerCase().includes(ue)):lt},[lt,et]),re=e.find(ue=>ue.id===U),Vn=t.find(ue=>ue.id===z),bi=h?f.find(ue=>ue.id===h):void 0,La=re!=null&&re.runtimeId?jn.get(re.runtimeId):void 0,le=x?xt:U&&r===U?i:null,Me=(le==null?void 0:le.appName)||(re==null?void 0:re.runtimeApp)||(re==null?void 0:re.app)||"",st=(re==null?void 0:re.agentCategory)??"general",Fe=st==="mpa"?"basic":V,fe=(ne==null?void 0:ne.runtimeId)===(re==null?void 0:re.runtimeId)?ne:null,Be=fe==null?void 0:fe.mpaInstanceId,at=(re==null?void 0:re.mpaInstanceId)??Be??(re==null?void 0:re.runtimeId)??"",$t=GGt.filter(ue=>st==="mpa"?ue==="basic":ue==="profileConfig"?!1:ue==="usage"?c&&(re==null?void 0:re.runtimeId):!(ue==="sessionConfig"||ue==="diagnostics")).map(ue=>({id:ue,label:_(`agentWorkspace.sections.${ue}`)})),kn=JSON.stringify([(re==null?void 0:re.runtimeId)??"",(re==null?void 0:re.region)??"cn-beijing",Me,no]),_i=(to==null?void 0:to.requestKey)===kn?to.value:null,sn=`${(re==null?void 0:re.region)??"cn-beijing"}:${(re==null?void 0:re.runtimeId)??""}`,oi=JSON.stringify([(re==null?void 0:re.runtimeId)??"",at,(re==null?void 0:re.region)??"cn-beijing",y]),Vt=JSON.stringify([(re==null?void 0:re.runtimeId)??"",at,(re==null?void 0:re.region)??"cn-beijing"]),fi=Vt,Un=JSON.stringify([(re==null?void 0:re.runtimeId)??"",(re==null?void 0:re.region)??"cn-beijing",y]),sr=(Ee==null?void 0:Ee.requestKey)===sn?Ee.value:"",Hn=(X==null?void 0:X.requestKey)===sn?X:null,gr=(mr==null?void 0:mr.requestKey)===oi&&y?mr.value:null,ks=(Nr==null?void 0:Nr.requestKey)===Vt?Nr.value:null,Vi=(pl==null?void 0:pl.requestKey)===fi?pl.value:(ks==null?void 0:ks.profile)??null,wr=(ks==null?void 0:ks.bindingStatus)??"",Ud=ZGt((f2=ks==null?void 0:ks.safeError)==null?void 0:f2.code,_),Mb=(ks==null?void 0:ks.capabilities.canWrite)===!0,fv=(zr==null?void 0:zr.requestKey)===Un?zr:null,hv=!!(re!=null&&re.runtimeId&&st==="mpa"&&wr!=="runtime_missing"&&wr!=="binding_ambiguous"),$h=!!((re==null?void 0:re.agentCategory)==="mpa"&&(re!=null&&re.runtimeId)&&(re==null?void 0:re.runtimeId)===w&&wr==="bound"&&y),Df=(Vi==null?void 0:Vi.status)==="applied"?Vi.profileRevision:null,Rr=!!($h&&gr&&Df!=null&&Df>gr.profileRevision),xl=px(gr),Vu=gl.trim()!==xl,pc=!!((bc=Hn==null?void 0:Hn.apiApps)!=null&&bc.length),$a=!!(Hn!=null&&Hn.a2a),km=((xv=Hn==null?void 0:Hn.apiApps)==null?void 0:xv[0])??Me,Hu=(ne==null?void 0:ne.endpoint)??"",Mf=nXt(((Vd=Hn==null?void 0:Hn.a2a)==null?void 0:Vd.endpoint)??"",Hu),Ul=(re==null?void 0:re.runtimeApp)||"",ro=JSON.stringify([(re==null?void 0:re.runtimeId)??"",(re==null?void 0:re.region)??"",(re==null?void 0:re.currentVersion)??null,Ul]),mc=l&&(re!=null&&re.runtimeId)&&re.region&&qe===0?q8({runtimeId:re.runtimeId,region:re.region,appName:Ul,currentVersion:re.currentVersion}):null,yt=(He==null?void 0:He.requestKey)===ro?He.value:mc,Vo=yt!=null&&yt.reason?So(yt.reason,L.resolvedLanguage||L.language):"",Xi=(yt==null?void 0:yt.warnings.filter(ue=>So(ue,L.resolvedLanguage||L.language)))??[],Fa=st!=="mpa";p.useEffect(()=>{const ue=vo.current+1;vo.current=ue,Qe(null),Ct("");const Le=(re==null?void 0:re.runtimeId)??"",Ge=(re==null?void 0:re.region)??"";if(!Fa||!l||!Le||!Ge){Pt(!1);return}const pt=qe===0?q8({runtimeId:Le,region:Ge,appName:Ul,currentVersion:re==null?void 0:re.currentVersion}):null;if(pt){Qe({requestKey:ro,value:pt}),Pt(!1);return}const ln=new AbortController;let Ze,En=0;const Lr=60;Pt(!0);const Ii=hs=>{PD({runtimeId:Le,region:Ge,appName:Ul,currentVersion:re==null?void 0:re.currentVersion,signal:ln.signal,force:hs&&qe>0}).then(sa=>{var BO,Qb;if(ue!==vo.current)return;const Qh=sa.recoveryStatus==="preparing";if(sa.runtime.runtimeId!==Le||sa.runtime.region!==Ge||!Qh&&Ul&&((BO=sa.agent)==null?void 0:BO.appName)!==Ul||sa.canUpdate&&!((Qb=sa.agent)!=null&&Qb.appName)){Ct(_("agentWorkspace.errors.updateCapabilityMismatch"));return}if(Qe({requestKey:ro,value:sa}),Pt(!1),!!Qh){if(En+=1,En>=Lr){Ct(_("agentWorkspace.errors.updateConfigRestoring"));return}Ze=window.setTimeout(()=>Ii(!1),1e3)}}).catch(()=>{ue!==vo.current||ln.signal.aborted||Ct(_("agentWorkspace.errors.checkUpdateCapability"))}).finally(()=>{ue===vo.current&&!ln.signal.aborted&&Pt(!1)})};return Ii(!0),()=>{ln.abort(),Ze!=null&&window.clearTimeout(Ze)}},[l,Ul,qe,re==null?void 0:re.currentVersion,re==null?void 0:re.region,re==null?void 0:re.runtimeId,Fa,ro]);const Nn=p.useMemo(()=>{const ue=new Map(e.map((Ge,pt)=>[Ge.id,pt])),Le=new Map(n.map((Ge,pt)=>[Ge,pt]));return[...gn].sort((Ge,pt)=>{const ln=Ge.runtimeId?Wt.get(Ge.runtimeId):void 0,Ze=pt.runtimeId?Wt.get(pt.runtimeId):void 0,En=(ln==null?void 0:ln.status)==="running"?ln.startedAt:0,Lr=(Ze==null?void 0:Ze.status)==="running"?Ze.startedAt:0;if(En!==Lr)return Lr-En;const Ii=Le.get(Ge.id),hs=Le.get(pt.id);return Ii!=null&&hs!=null?Ii-hs:Ii!=null?-1:hs!=null?1:(ue.get(Ge.id)??0)-(ue.get(pt.id)??0)})},[n,e,gn,Wt]),Qd=(re==null?void 0:re.label)||(le==null?void 0:le.name)||(Vn==null?void 0:Vn.draft.name)||(bi==null?void 0:bi.agentName)||((FO=bi==null?void 0:bi.agentDraft)==null?void 0:FO.name)||_("agentWorkspace.noAgentSelected"),_O=lt.find(ue=>ue.id===Ln),pv=Nn.filter(ue=>ue.canDelete===!0),Lb=Nn.filter(ue=>zi.has(ue.id)&&ue.canDelete===!0),gc=$n.filter(ue=>lr.has(ue.id)),e2=pv.length+$n.length,Lf=Lb.length+gc.length,Ba=p.useMemo(()=>{var Le;if(bi!=null&&bi.agentDraft)return bi.agentDraft;if(Vn!=null&&Vn.draft)return Vn.draft;const ue=(Le=re==null?void 0:re.region)!=null&&Le.startsWith("ap-")?"byteplus":"volcengine";return yt!=null&&yt.agent&&(yt.recoveryStatus==="complete"||yt.recoveryStatus==="draft-only")?hH(yt.agent,ue,yt.runtime.configuredEnvKeys):hXt(le,Me||(re==null?void 0:re.label)||"agent",ue)},[le,Me,re==null?void 0:re.label,re==null?void 0:re.region,Vn==null?void 0:Vn.draft,bi==null?void 0:bi.agentDraft,yt]),Dn=((ra=le==null?void 0:le.draft)==null?void 0:ra.harnessSidecar)??umt(ne==null?void 0:ne.envs),t2=Dn?J1.filter(ue=>Dn.componentOverrides[ue]):[],n2=p.useMemo(()=>BA(Ba),[Ba]),Fh=Vn?o?"":_("agentWorkspace.errors.noCreatePermission"):st==="mpa"?"":l?re!=null&&re.runtimeId?re.region?jt?_("agentWorkspace.errors.checkingUpdateConfig"):Kt||(yt?yt.recoveryStatus!=="complete"&&yt.recoveryStatus!=="draft-only"?Vo||_("agentWorkspace.errors.originalConfigUnavailable"):yt.canUpdate?(h2=yt.agent)!=null&&h2.appName?"":_("agentWorkspace.errors.agentInfoMissing"):Vo||_("agentWorkspace.errors.updateUnsupported"):_("agentWorkspace.errors.updateCapabilityPending")):_("agentWorkspace.errors.runtimeRegionMissing"):_("agentWorkspace.errors.cloudOnlyUpdate"):_("agentWorkspace.errors.noManagePermission"),$b="aw-update-disabled-reason",WL=re?st!=="mpa"?_("agentWorkspace.sessionConfigNonMpa"):es?_("agentWorkspace.loadingMpaAgentView"):Mi||Ud||(wr==="runtime_missing"?_("agentWorkspace.mpaRuntimeMissing"):wr==="binding_ambiguous"?_("agentWorkspace.mpaRuntimeBindingAmbiguous"):wr&&!hv?_("agentWorkspace.mpaRuntimeMissing"):Mb?"":_("agentWorkspace.errors.noManagePermission")):_("agentWorkspace.sessionConfigNoAgent"),Fb=re?st!=="mpa"?_("agentWorkspace.sessionConfigNonMpa"):es?_("agentWorkspace.loadingMpaAgentView"):Mi||Ud||(wr==="runtime_missing"?_("agentWorkspace.mpaRuntimeMissing"):wr==="binding_ambiguous"?_("agentWorkspace.mpaRuntimeBindingAmbiguous"):wr==="orphan_runtime"?_("agentWorkspace.mpaRuntimeOrphan"):y?re.runtimeId!==w?_("agentWorkspace.sessionConfigDifferentRuntime"):"":_("agentWorkspace.sessionConfigNoSession")):_("agentWorkspace.sessionConfigNoAgent"),i2=re?st!=="mpa"?_("agentWorkspace.sessionConfigNonMpa"):es?_("agentWorkspace.loadingMpaAgentView"):Mi||(wr!=="bound"?Fb:y?re.runtimeId!==w?_("agentWorkspace.sessionConfigDifferentRuntime"):"":_("agentWorkspace.sessionConfigNoSession")):_("agentWorkspace.sessionConfigNoAgent"),Sm=p.useMemo(()=>{if(le)return le.tools;const ue=(Ba.builtinTools??[]).map(Le=>{var Ge;return((Ge=sT.find(pt=>pt.id===Le))==null?void 0:Ge.label)??Le});return Array.from(new Set([...Ba.tools,...ue,...(Ba.customTools??[]).map(Le=>Le.name),...(Ba.mcpTools??[]).map(Le=>Le.name)].filter(Boolean)))},[Ba,le]),Bb=p.useMemo(()=>le?le.skillsPreviewSupported?le.skills.map(ue=>ue.name):null:Array.from(new Set([...(Ba.selectedSkills??[]).map(ue=>ue.name),...Ba.skills].filter(Boolean))),[Ba,le]),Vr=p.useMemo(()=>{if(bi)return bi;if(Vn){const ue=f.filter(Le=>Le.draftId===Vn.id).sort((Le,Ge)=>Ge.startedAt-Le.startedAt)[0];return ue||f.filter(Le=>{var Ge,pt;return((Ge=Le.agentDraft)==null?void 0:Ge.name)===Vn.draft.name||Le.agentName===Vn.draft.name||!!((pt=Vn.deploymentTarget)!=null&&pt.runtimeId)&&Le.runtimeId===Vn.deploymentTarget.runtimeId}).sort((Le,Ge)=>Ge.startedAt-Le.startedAt)[0]}if(re)return f.filter(ue=>!!re.runtimeId&&ue.runtimeId===re.runtimeId||ue.agentName===re.label).sort((ue,Le)=>Le.startedAt-ue.startedAt)[0]},[f,re,Vn,bi]),r2=!!(h&&Vr&&Vr.id===h),mv=!!(Vr&&(Vr.status!=="success"||r2)),qu=(Vr==null?void 0:Vr.status)==="running",Em=Vr!=null&&Vr.draftId?t.find(ue=>ue.id===Vr.draftId)??(Vr.agentDraft?{id:Vr.draftId,draft:Vr.agentDraft,updatedAt:Vr.startedAt}:void 0):void 0,Xc=p.useMemo(()=>xXt(Ba),[Ba]),Bh=(re==null?void 0:re.currentVersion)??(ne==null?void 0:ne.currentVersion)??null,$f=Bh??(bi==null?void 0:bi.startedAt)??"unknown",Di=le?`runtime:${(re==null?void 0:re.runtimeId)??le.name}:v${$f}:${Xc}`:`draft:${(bi==null?void 0:bi.id)??(Vn==null?void 0:Vn.id)??(re==null?void 0:re.id)??Qd}:${Xc}`;p.useEffect(()=>{let ue=!1;const Le=(re==null?void 0:re.runtimeId)??"",Ge=at||Le,pt=(re==null?void 0:re.region)??"cn-beijing",ln=Vt;if(Ms(""),st!=="mpa"||!Le||Fe!=="profileConfig"&&Fe!=="sessionConfig"){Lo(null),ba(!1);return}const Ze=new AbortController;return ba(!0),CTe({mpaInstanceId:Ge,runtimeId:Le,region:pt,signal:Ze.signal}).then(En=>{ue||(Lo({requestKey:ln,value:En}),Mo(En.profile?{requestKey:fi,value:En.profile}:null))}).catch(En=>{ue||Ze.signal.aborted||(Lo(null),Ms(En instanceof Error?En.message:_("agentWorkspace.errors.loadMpaAgentView")))}).finally(()=>{ue||ba(!1)}),()=>{ue=!0,Ze.abort()}},[qe,Vt,Fe,at,re==null?void 0:re.region,re==null?void 0:re.runtimeId,st,fi,_]),p.useEffect(()=>{Fe==="usage"&&!c&&q("basic")},[c,Fe]),p.useEffect(()=>{Fe==="sessionConfig"&&(!(re!=null&&re.runtimeId)||st!=="mpa")&&q("basic")},[Fe,re==null?void 0:re.runtimeId,st]),p.useEffect(()=>{Fe==="diagnostics"&&(!(re!=null&&re.runtimeId)||st!=="mpa")&&q("basic")},[Fe,re==null?void 0:re.runtimeId,st]),p.useEffect(()=>{if(!h)return;const ue=f.find(Ge=>Ge.id===h),Le=ue!=null&&ue.runtimeId?pn.get(ue.runtimeId):void 0;if(Le){ee(""),Z(Le.id),q("basic");return}Z(""),ee(""),q("basic")},[pn,f,h]),p.useEffect(()=>{if(!m){Bl.current="";return}const ue=`${m}:${g}:${b}:${c}`;Bl.current!==ue&&e.some(Le=>Le.id===m)&&(Bl.current=ue,ee(""),Z(m),q(g==="usage"&&!c?"basic":g),g==="evaluations"&&(At(b),Gt("")))},[e,c,m,g,b]),p.useEffect(()=>{for(const ue of Nn.slice(0,8)){if(!ue.runtimeId)continue;const Le=ue.region??"cn-beijing";T2e(ue.runtimeId,Le),xTe(ue.runtimeId,Le,ue.runtimeApp??"")}},[Nn]),p.useEffect(()=>{let ue=!1;const Le=(re==null?void 0:re.runtimeId)??"",Ge=(re==null?void 0:re.region)??"cn-beijing",pt=(re==null?void 0:re.runtimeApp)??"",ln=Le?vTe(Le,Ge,pt):null;if(tt(ln),Nt(""),xn(!1),_e(!!ln||!x||!Le),!(!x||!Le))return Az(Le,Ge,pt,{force:!0}).then(Ze=>{ue||tt(Ze)}).catch(Ze=>{!ue&&!ln&&tt(null),ue||(xn(Ze instanceof Oa&&Ze.unsupported),Nt(_("agentWorkspace.errors.loadAgentInfo")))}).finally(()=>{ue||_e(!0)}),()=>{ue=!0}},[x,qe,re==null?void 0:re.currentVersion,re==null?void 0:re.region,re==null?void 0:re.runtimeApp,re==null?void 0:re.runtimeId]),p.useEffect(()=>{let ue=!1;const Le=(re==null?void 0:re.runtimeId)??"",Ge=(re==null?void 0:re.region)??"cn-beijing";if(Jr([]),pe(""),Fe!=="optimizations"||!Le){go(!1);return}if(x&&!Me){go(!mt);return}return go(!0),sTe({runtimeId:Le,region:Ge,appName:Me}).then(pt=>{ue||Jr(pt.groups)}).catch(()=>{ue||pe(_("agentWorkspace.errors.loadOptimizations"))}).finally(()=>{ue||go(!1)}),()=>{ue=!0}},[mt,x,pr,Fe,Me,re==null?void 0:re.region,re==null?void 0:re.runtimeId]),p.useEffect(()=>{ws(1)},[re==null?void 0:re.runtimeId,Me]),p.useEffect(()=>{const ue=io.current+1;io.current=ue;const Le=(re==null?void 0:re.runtimeId)??"",Ge=(re==null?void 0:re.region)??"cn-beijing",pt=Me;if(Ds(""),Fe!=="usage"||!Le){Ti(!1);return}if(!pt){Ti(x&&!mt);return}const ln=new AbortController;return Ti(!0),p2e({runtimeId:Le,region:Ge,appName:pt,page:no,pageSize:XGt,signal:ln.signal}).then(Ze=>{if(ue===io.current){if(Ze.runtimeId!==Le||Ze.appName!==pt||Ze.page!==no){Ds(_("agentWorkspace.errors.usageMismatch"));return}fl({requestKey:kn,value:Ze})}}).catch(()=>{ue!==io.current||ln.signal.aborted||Ds(_("agentWorkspace.errors.loadUsage"))}).finally(()=>{ue===io.current&&Ti(!1)}),()=>{ln.abort()}},[no,Pl,kn,mt,x,Fe,Me,re==null?void 0:re.region,re==null?void 0:re.runtimeId]),p.useEffect(()=>{ia.current+=1,xe(null),We(!1),Re(!1),ce(""),ge("api-server")},[sn,Fe]),p.useEffect(()=>{const ue=(re==null?void 0:re.runtimeId)??"",Le=(re==null?void 0:re.region)??"cn-beijing",Ge=Un;if(Dl(""),Fe!=="diagnostics"||st!=="mpa"||wr!=="bound"||!ue||!y||ue!==w){na(!1),Fe!=="diagnostics"&&ds(null);return}const pt=new AbortController;let ln=!1;return na(!0),TTe({runtimeId:ue,region:Le,sessionId:y,signal:pt.signal}).then(async Ze=>{const En=Ze.runs[0],Lr=En?await _Te({runtimeId:ue,region:Le,sessionId:y,invocationId:En.invocationId,signal:pt.signal}):null;return{runs:Ze.runs,trace:Lr}}).then(Ze=>{ln||ds({requestKey:Ge,...Ze})}).catch(Ze=>{ln||pt.signal.aborted||(ds(null),Dl(Ze instanceof Error?Ze.message:_("agentWorkspace.errors.loadMpaDiagnostics")))}).finally(()=>{ln||na(!1)}),()=>{ln=!0,pt.abort()}},[w,y,$o,Un,Fe,re==null?void 0:re.region,re==null?void 0:re.runtimeId,st,wr,_]);function so(){ia.current+=1,xe(null),We(!1),Re(!1),ce("")}function fs(ue){ue!==de&&(so(),ge(ue))}async function jO(){if(Ne){so();return}const ue=(re==null?void 0:re.runtimeId)??"",Le=(re==null?void 0:re.region)??"cn-beijing";if(!ue)return;const Ge=ia.current+1;ia.current=Ge,Re(!0),ce("");try{const pt=await S2e(ue,Le);if(Ge!==ia.current)return;xe({requestKey:sn,value:pt}),We(!0)}catch(pt){if(Ge!==ia.current)return;xe(null),We(!1),ce(pt instanceof Error?pt.message:_("agentWorkspace.errors.loadApiKey"))}finally{Ge===ia.current&&Re(!1)}}p.useEffect(()=>{let ue=!1;const Le=(re==null?void 0:re.runtimeId)??"",Ge=(re==null?void 0:re.region)??"cn-beijing",pt=Le?A2e(Le,Ge):null;if(W(pt),St(""),!!Le)return DD(Le,Ge,{force:!0}).then(ln=>{ue||W(ln)}).catch(()=>{!ue&&!pt&&W(null),ue||St(_("agentWorkspace.errors.loadRuntimeDetails"))}),()=>{ue=!0}},[qe,re==null?void 0:re.currentVersion,re==null?void 0:re.region,re==null?void 0:re.runtimeId]),p.useEffect(()=>{const ue=je.current+1;if(je.current=ue,yo(""),yl(""),Bo(!1),Ld(!1),Fe!=="sessionConfig"||!$h||!(re!=null&&re.runtimeId)){bl(!1),Mr(null),Fo("");return}const Le=re.runtimeId,Ge=at||Le,pt=re.region??"cn-beijing",ln=oi,Ze=new AbortController;return bl(!0),Promise.all([Iz({runtimeId:Le,region:pt,sessionId:y,signal:Ze.signal}),ETe({runtimeId:Le,region:pt,mpaInstanceId:Ge,signal:Ze.signal}).catch(()=>null)]).then(([En,Lr])=>{ue===je.current&&(Mr({requestKey:ln,value:En}),Fo(px(En)),Mo(Lr?{requestKey:fi,value:Lr}:null))}).catch(En=>{ue!==je.current||Ze.signal.aborted||(En==null?void 0:En.name)==="AbortError"||(Mr(null),Fo(""),yo(En instanceof Error?En.message:_("agentWorkspace.errors.loadSessionConfig")))}).finally(()=>{ue===je.current&&!Ze.signal.aborted&&bl(!1)}),()=>{Ze.abort()}},[y,Ml,oi,$h,Fe,fi,at,re==null?void 0:re.region,re==null?void 0:re.runtimeId,_]),p.useEffect(()=>{let ue=!1;const Le=(re==null?void 0:re.runtimeId)??"";if(me(""),Fe!=="versions"||!Le){$e(!1),Le||Se(null);return}return $e(!0),fN(Le).then(Ge=>{ue||Se(Ge)}).catch(()=>{ue||(Se(null),me(_("agentWorkspace.errors.loadGithubVersions")))}).finally(()=>{ue||$e(!1)}),()=>{ue=!0}},[Fe,re==null?void 0:re.currentVersion,re==null?void 0:re.runtimeId]),p.useEffect(()=>{let ue=!1;const Le=(re==null?void 0:re.runtimeId)??"",Ge=(re==null?void 0:re.region)??"cn-beijing",pt=`${Ge}:${Le}`;if(ie(""),Fe!=="integrations"||!Le){Y(!1),Le||H(null);return}Y(!0);const ln=Kw(Le,Ge,{retryProbe:!0}).catch(Ze=>{if(Ze instanceof Oa&&Ze.unsupported)return null;throw Ze});return Promise.all([ln,k2e(Le,Ge,{retryProbe:!0})]).then(([Ze,En])=>{ue||H({requestKey:pt,apiApps:Ze,a2a:En})}).catch(()=>{ue||(H(null),ie(_("agentWorkspace.errors.probeIntegration")))}).finally(()=>{ue||Y(!1)}),()=>{ue=!0}},[J,Fe,re==null?void 0:re.currentVersion,re==null?void 0:re.region,re==null?void 0:re.runtimeId]),p.useEffect(()=>{let ue=!1;const Le=(re==null?void 0:re.runtimeId)??"",Ge=(re==null?void 0:re.region)??"cn-beijing",pt=Le&&Me?aTe({runtimeId:Le,region:Ge,appName:Me,pageSize:100}):null;if(zt(pt?zoe(pt,_):[]),bt((pt==null?void 0:pt.sets)??[]),Hs(""),Dr((pt==null?void 0:pt.unsupportedMessage)??""),Fe!=="evaluations"||!Le){_n(!1);return}if(x&&!Me){_n(!mt);return}return _n(!pt),_D({runtimeId:Le,region:Ge,appName:Me,pageSize:100},{force:!0}).then(ln=>{ue||(bt(ln.sets),zt(zoe(ln,_)),Dr(ln.unsupportedMessage??""))}).catch(()=>{ue||(Hs(_("agentWorkspace.errors.loadEvaluations")),Dr(""))}).finally(()=>{ue||_n(!1)}),()=>{ue=!0}},[mt,x,ti,Fe,Me,le==null?void 0:le.appName,re==null?void 0:re.region,re==null?void 0:re.runtimeId,_]);async function NO(ue){const Le=(re==null?void 0:re.runtimeId)??"",Ge=ue.commitSha??"";if(!(!Le||!Ge||ke)){Ae(Ge),me("");try{await s2e({runtimeId:Le,targetCommitSha:Ge,region:re==null?void 0:re.region,agentCategory:st});const pt=await fN(Le);Se(pt)}catch(pt){me(pt instanceof Error?pt.message:_("agentWorkspace.errors.rollbackVersion"))}finally{Ae("")}}}function RO(ue,Le){return!(ue instanceof iw)||ue.status!==412||!ue.currentState?!1:(Mr({requestKey:oi,value:ue.currentState}),Fo(px(ue.currentState)),yo(Le),!0)}async function s2(ue="replace"){if(!(re!=null&&re.runtimeId)||!gr)return;const Le=re.runtimeId,Ge=re.region??"cn-beijing",pt=gl.trim(),ln=ue==="inherit"?{category:"model",mode:ue}:pt?{category:"model",mode:ue,value:{id:pt}}:{category:"model",mode:"inherit"};Bo(!0),yo(""),yl("");try{const Ze=await U8({runtimeId:Le,region:Ge,sessionId:y,etag:gr.etag,changes:[ln]});Mr({requestKey:oi,value:Ze}),Fo(px(Ze)),yl(_("agentWorkspace.sessionConfigSaved"))}catch(Ze){RO(Ze,_("agentWorkspace.sessionConfigStale"))||yo(u6(Ze,_("agentWorkspace.sessionConfigStale")))}finally{Bo(!1)}}async function IO(ue){if(!(re!=null&&re.runtimeId)||!gr)return;const Le=re.runtimeId,Ge=re.region??"cn-beijing";Bo(!0),yo(""),yl("");try{const pt=await U8({runtimeId:Le,region:Ge,sessionId:y,etag:gr.etag,changes:[{category:"mcpServers",mode:ue}]});Mr({requestKey:oi,value:pt}),yl(_("agentWorkspace.sessionConfigSaved"))}catch(pt){RO(pt,_("agentWorkspace.sessionConfigStale"))||yo(u6(pt,_("agentWorkspace.sessionConfigStale")))}finally{Bo(!1)}}async function KL(){if(!(re!=null&&re.runtimeId)||!gr||!Df)return;const ue=re.runtimeId,Le=re.region??"cn-beijing";Ld(!0),yo(""),yl("");try{const Ge=await jTe({runtimeId:ue,region:Le,sessionId:y,etag:gr.etag,idempotencyKey:tXt(ue,y,Df),targetProfileRevision:Df});Mr({requestKey:oi,value:Ge}),Fo(px(Ge)),yl(_("agentWorkspace.sessionProfileUpgraded"))}catch(Ge){RO(Ge,_("agentWorkspace.sessionConfigStale"))||yo(u6(Ge,_("agentWorkspace.sessionProfileUpgradeFailed")))}finally{Ld(!1)}}async function gv(){if(!(re!=null&&re.runtimeId))return;const ue=re.runtimeId,Le=re.region??"cn-beijing",Ge=at||ue,pt=(Vi==null?void 0:Vi.status)==="applied"?"update":"create",ln=(Vi==null?void 0:Vi.runtimeRevision)||(Vi==null?void 0:Vi.etag)||"",Ze=await oXt(ue,pt,n2);Qo({saving:!0,error:"",notice:""});try{const En=await Nz({operationKind:pt,runtimeId:ue,region:Le,mpaInstanceId:Ge,sourceProfileId:`studio-runtime:${ue}:${Me||"a2a-default"}`,targetKey:pt==="update"?Ge:`runtime:${Le}:${ue}`,runtimeRevision:pt==="update"?ln:void 0,draft:Ba,idempotencyKey:Ze});Qo({saving:!1,error:En.status==="succeeded"?"":En.safeErrorCode||_("agentWorkspace.profileApplyIncomplete"),notice:En.status==="succeeded"?_("agentWorkspace.profileAppliedNotice",{revision:En.profileRevision??_("agentWorkspace.notAvailable")}):""}),nt(Lr=>Lr+1),Da(Lr=>Lr+1)}catch(En){Qo({saving:!1,error:En instanceof Error?En.message:_("agentWorkspace.profileApplyFailed"),notice:""})}}function a2(){!(re!=null&&re.runtimeId)||st!=="mpa"||I==null||I({draft:Ba,runtimeId:re.runtimeId,mpaInstanceId:at||re.runtimeId,name:Qd,region:re.region??"cn-beijing",appName:Me||"a2a-default",currentVersion:re.currentVersion??(ne==null?void 0:ne.currentVersion),runtimeRevision:(Vi==null?void 0:Vi.runtimeRevision)||(Vi==null?void 0:Vi.etag)||void 0})}p.useEffect(()=>{Qo({saving:!1,error:"",notice:""})},[Vt]),p.useEffect(()=>{const ue=new Set(rt.map(Le=>Le.id));Ls(Le=>{const Ge=new Set([...Le].filter(pt=>ue.has(pt)));return Ge.size===Le.size?Le:Ge}),Fl(Le=>{const Ge=new Set([...Le].filter(pt=>ue.has(pt)));return Ge.size===Le.size?Le:Ge}),ts&&!ue.has(ts)&&ns("")},[rt,ts]),p.useEffect(()=>{vl(!1),Ls(new Set),Fl(new Set),Os(""),ns("")},[re==null?void 0:re.runtimeId]),p.useEffect(()=>{const ue=new Set(Nn.filter(Le=>Le.canDelete===!0).map(Le=>Le.id));dn(Le=>{const Ge=new Set([...Le].filter(pt=>ue.has(pt)));return Ge.size===Le.size?Le:Ge})},[Nn]),p.useEffect(()=>{const ue=new Set($n.map(Le=>Le.id));Mn(Le=>{const Ge=new Set([...Le].filter(pt=>ue.has(pt)));return Ge.size===Le.size?Le:Ge})},[$n]);const Cm=p.useMemo(()=>!v||!(re!=null&&re.runtimeId)||v.runtimeId!==re.runtimeId||Me&&v.agentName&&v.agentName!==Me?null:{...v,tag:_(v.kind==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")},[v,re==null?void 0:re.runtimeId,Me,_]),xo=p.useMemo(()=>qGt(_),[_]),In=p.useMemo(()=>re!=null&&re.runtimeId?Cm?[Cm,...rt.filter(ue=>ue.id!==Cm.id&&(!ue.messageId||ue.messageId!==Cm.messageId))]:rt:xo,[xo,rt,Cm,re==null?void 0:re.runtimeId]),Am=In.filter(ue=>{if(ue.kind!==Et||(ue.source==="auto"?"auto":"user")!==Ye)return!1;const Ge=It.trim().toLowerCase();return Ge?[ue.input,ue.output,ue.referenceOutput,ue.comment,ue.tag??"",ue.sessionId,ue.messageId,ue.userId,ue.evaluationSetName].join(" ").toLowerCase().includes(Ge):!0}),PO=Am.filter(ue=>Ll.has(ue.id)),DO=!!(re!=null&&re.runtimeId),o2=ue=>{At(ue),Gt(""),Os("");const Le=In.find(Ge=>Ge.kind===ue);ns((Le==null?void 0:Le.id)??""),window.setTimeout(()=>{var Ge;(Ge=Gc.current)==null||Ge.scrollIntoView({behavior:"smooth",block:"start"})},0)},GL=ue=>{Os(""),Ls(Le=>{const Ge=new Set(Le);return Ge.has(ue.id)?Ge.delete(ue.id):Ge.add(ue.id),Ge})},MO=()=>{Os(""),Ls(new Set(Am.map(ue=>ue.id)))},zd=()=>{Os(""),Ls(new Set),vl(!1)},l2=ue=>{Fl(Le=>{const Ge=new Set(Le);return Ge.has(ue)?Ge.delete(ue):Ge.add(ue),Ge})},LO=ue=>{ns(ue.id),Os(""),!(!ue.sessionId||!ue.messageId)&&(R==null||R(ue))},c2=async ue=>{if(!(re!=null&&re.runtimeId)||!Me||Ma||ue.length===0)return;const Le=ue.length===1?_("agentWorkspace.deleteOneCaseConfirm"):_("agentWorkspace.deleteCasesConfirm",{count:ue.length});if(!window.confirm(Le))return;const Ge=ue.map(ln=>ln.id),pt=new Set(Ge);rn(!0),Os("");try{await cTe({runtimeId:re.runtimeId,region:re.region??"cn-beijing",appName:Me,itemIds:Ge});const ln=new Map;for(const Ze of ue)ln.set(Ze.kind,(ln.get(Ze.kind)??0)+1);zt(Ze=>Ze.filter(En=>!pt.has(En.id))),bt(Ze=>Ze.map(En=>({...En,itemCount:Math.max(0,En.itemCount-(ln.get(En.kind)??0))}))),Ls(Ze=>new Set([...Ze].filter(En=>!pt.has(En)))),Fl(Ze=>new Set([...Ze].filter(En=>!pt.has(En)))),ts&&pt.has(ts)&&ns(""),ue.length>1&&vl(!1),A==null||A(ue)}catch(ln){Os(ln instanceof Error?ln.message:String(ln))}finally{rn(!1)}},u2=ue=>{Lt(Le=>Le.map(Ge=>Ge.id===ue.id?ue:Ge))},Uh=()=>{const ue=new Set(e.map(pt=>pt.id)),Le=n.filter(pt=>ue.has(pt)),Ge=new Set(Le);return[...Le,...e.filter(pt=>!Ge.has(pt.id)).map(pt=>pt.id)]},Ss=(ue,Le,Ge)=>{if(!S||ue===Le)return;const pt=Uh().filter(En=>En!==ue),ln=pt.indexOf(Le),Ze=ln<0?pt.length:Ge==="after"?ln+1:ln;pt.splice(Ze,0,ue),S(pt)},d2=(ue,Le)=>{if(!vt||vt===Le)return;const Ge=ue.currentTarget.getBoundingClientRect();un(Le),on(ue.clientY>Ge.top+Ge.height/2?"after":"before")},bv=(ue,Le)=>{if(!S)return;const Ge=Uh(),pt=Ge.indexOf(ue),ln=Math.max(0,Math.min(Ge.length-1,pt+Le));pt<0||pt===ln||(Ge.splice(pt,1),Ge.splice(ln,0,ue),S(Ge))},yv=ue=>{ue.canDelete===!0&&(zn(""),dn(Le=>{const Ge=new Set(Le);return Ge.has(ue.id)?Ge.delete(ue.id):Ge.add(ue.id),Ge}))},$O=ue=>{zn(""),Mn(Le=>{const Ge=new Set(Le);return Ge.has(ue.id)?Ge.delete(ue.id):Ge.add(ue.id),Ge})},XL=()=>{zn(""),dn(new Set(pv.map(ue=>ue.id))),Mn(new Set($n.map(ue=>ue.id)))},YL=()=>{zn(""),dn(new Set),Mn(new Set),Sn(!1)},ZL=()=>{if(Lf===0||ei)return;const ue=Lb.length,Le=gc.length;if(ue===1&&Le===0){Ub(Lb[0]);return}zn(""),di({kind:"selection",title:_(ue===1&&Le===0?"agentWorkspace.deleteAgentTitle":ue===0&&Le===1?"myAgents.deleteDraftTitle":"agentWorkspace.deleteSelectedTitle"),description:ue===1&&Le===0?_("agentWorkspace.deleteAgentDescription",{name:Lb[0].label}):ue===0&&Le===1?_("agentWorkspace.deleteDraftDescription",{name:gc[0].draft.name||_("agentSelector.unnamedAgent")}):_("agentWorkspace.deleteSelectionDescription",{count:Lf,warning:ue>0?_("agentWorkspace.runtimeDeletionWarning",{count:ue}):_("agentWorkspace.draftDeletionWarning")}),confirmLabel:_(ue===0&&Le===1?"myAgents.deleteDraft":"agentWorkspace.deleteSelected"),agents:Lb,drafts:gc})},vv=async()=>{if(!(!Rn||ei)){Bn(!0),zn("");try{if(Rn.kind==="selection"){const{agents:ue,drafts:Le}=Rn;if(ue.length>0){if(!C)throw new Error(_("agentWorkspace.errors.deleteDeployedUnsupported"));await C(ue)}Le.length>0&&(E==null||E(Le)),dn(new Set),Mn(new Set),Sn(!1),ue.some(Ge=>Ge.id===U)&&Z(""),Le.some(Ge=>Ge.id===z)&&ee("")}else if(Rn.kind==="agent"){if(!C)throw new Error(_("agentWorkspace.errors.deleteDeployedUnsupported"));await C([Rn.agent]),U===Rn.agent.id&&Z("")}else{if(!E)throw new Error(_("agentWorkspace.errors.deleteDraftUnsupported"));E([Rn.draft]),z===Rn.draft.id&&ee("")}di(null)}catch(ue){zn(ue instanceof Error?ue.message:String(ue))}finally{Bn(!1)}}},Ub=async ue=>{if(!C||ue.canDelete!==!0||ei)return;zn("");let Le=null;if(ue.agentCategory==="mpa"){if(!ue.runtimeId||!ue.region){zn(_("agentWorkspace.errors.loadMpaDeletePreview"));return}try{Le=await ATe({mpaInstanceId:ue.mpaInstanceId??ue.runtimeId,runtimeId:ue.runtimeId,region:ue.region})}catch(Ge){zn(Ge instanceof Error?Ge.message:String(Ge));return}}di({kind:"agent",title:_("agentWorkspace.deleteAgentTitle"),description:Le?a.jsx(JGt,{preview:Le,t:_}):_("agentWorkspace.deleteAgentDescription",{name:ue.label}),confirmLabel:_("agentWorkspace.deleteAgent"),canConfirm:Le?Le.canDelete:!0,agent:ue})},rs=ue=>{if(!E||ei)return;const Le=ue.draft.name||_("agentSelector.unnamedAgent");zn(""),di({kind:"draft",title:_("myAgents.deleteDraftTitle"),description:_("agentWorkspace.deleteDraftDescription",{name:Le}),confirmLabel:_("myAgents.deleteDraft"),draft:ue})},Tm=()=>{const ue=`eval-${Date.now()}`,Le={id:ue,name:_("agentWorkspace.newEvaluationGroupName",{count:lt.length+1}),agentIds:[],caseSet:"核心回归集",evaluator:"综合质量评估器",metrics:["回答质量"],concurrency:"4",history:[]};Lt(Ge=>[Le,...Ge]),wn(ue)},mi=ue=>{u2({...ue,history:[{id:`run-${Date.now()}`,createdAt:_("agentWorkspace.evaluationDefaults.justNow"),score:86+ue.history.length%7,status:"completed"},...ue.history]})};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`aw-root${x?" is-detail-only":""}`,children:[a.jsxs("nav",{className:"aw-view-tabs","aria-label":_("agentWorkspace.workspace"),children:[a.jsx("button",{type:"button",className:F==="library"?"is-active":"","aria-pressed":F==="library",onClick:()=>{M("library"),ft("")},children:_("agentWorkspace.library")}),a.jsx("button",{type:"button",className:F==="evaluation"?"is-active":"","aria-pressed":F==="evaluation",onClick:()=>{M("evaluation"),ft("")},children:_("agentWorkspace.evaluation")})]}),a.jsxs("div",{className:"aw-workspace-frame",children:[a.jsxs("div",{className:"aw-workspace","aria-hidden":F==="evaluation"||void 0,ref:ue=>{ue==null||ue.toggleAttribute("inert",F==="evaluation")},children:[a.jsxs("aside",{className:"aw-sidebar","aria-label":_(F==="library"?"agentWorkspace.agentList":"agentWorkspace.evaluationGroupList"),children:[a.jsxs("label",{className:"aw-search",children:[a.jsx(fI,{"aria-hidden":!0}),a.jsx("input",{value:et,onChange:ue=>ft(ue.currentTarget.value),placeholder:_(F==="library"?"myAgents.searchAgents":"agentWorkspace.searchEvaluationGroups"),"aria-label":_(F==="library"?"myAgents.searchAgents":"agentWorkspace.searchEvaluationGroups")})]}),a.jsxs("button",{type:"button",className:"aw-create-card",onClick:F==="library"?N:Tm,disabled:F==="library"&&!o,children:[a.jsx(ic,{"aria-hidden":!0}),a.jsx("span",{children:_(F==="library"?"agentWorkspace.newAgent":"agentWorkspace.newEvaluationGroup")})]}),F==="library"&&(C||E)&&a.jsx("div",{className:`aw-selection-toolbar${On?" is-active":""}`,children:On?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"aw-selection-count",children:_("agentWorkspace.selectedCount",{count:Lf})}),a.jsx("button",{type:"button",onClick:XL,disabled:e2===0||ei,children:_("agentWorkspace.selectAll")}),a.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void ZL(),disabled:Lf===0||ei,children:_(ei?"common.deleting":"agentWorkspace.deleteSelected")}),a.jsx("button",{type:"button",onClick:YL,disabled:ei,children:_("common.cancel")})]}):a.jsx("button",{type:"button",onClick:()=>{zn(""),Sn(!0)},disabled:e2===0,children:_("common.select")})}),F==="library"&&ki&&a.jsx("div",{className:"aw-delete-error",role:"alert",children:ki}),a.jsx("div",{className:"aw-agent-list",children:F==="evaluation"?is.length===0?a.jsx("div",{className:"aw-list-empty",children:_("agentWorkspace.noMatchingEvaluationGroups")}):is.map(ue=>a.jsxs("button",{type:"button",className:`aw-agent-item${ue.id===Ln?" is-active":""}`,onClick:()=>wn(ue.id),children:[a.jsxs("span",{className:"aw-agent-copy aw-eval-group-copy",children:[a.jsx("strong",{children:CS(ue.name,_)}),a.jsx("small",{children:_("agentWorkspace.groupStats",{agents:ue.agentIds.length,runs:ue.history.length})})]}),a.jsx(iE,{"aria-hidden":!0})]},ue.id)):u&&Nn.length===0&&$n.length===0?a.jsx("div",{className:"aw-list-empty",children:_("agentWorkspace.loadingCloudAgents")}):d&&Nn.length===0&&$n.length===0?a.jsxs("div",{className:"aw-list-empty aw-list-error",children:[a.jsx("span",{children:d}),k&&a.jsx("button",{type:"button",onClick:k,children:_("common.retry")})]}):Nn.length===0&&$n.length===0?a.jsx("div",{className:"aw-list-empty",children:_("myAgents.noMatchingAgents")}):a.jsxs(a.Fragment,{children:[$n.map(ue=>{const Ge=f.filter(ln=>ln.draftId===ue.id).sort((ln,Ze)=>Ze.startedAt-ln.startedAt)[0]??f.filter(ln=>{var Ze,En;return((Ze=ln.agentDraft)==null?void 0:Ze.name)===ue.draft.name||ln.agentName===ue.draft.name||!!((En=ue.deploymentTarget)!=null&&En.runtimeId)&&ln.runtimeId===ue.deploymentTarget.runtimeId}).sort((ln,Ze)=>Ze.startedAt-ln.startedAt)[0],pt=lr.has(ue.id);return a.jsxs("button",{type:"button",className:["aw-agent-item",On?"is-selecting":"",pt?"is-selected-for-delete":"",ue.id===z?"is-active":""].filter(Boolean).join(" "),"aria-pressed":On?pt:void 0,onClick:()=>{if(On){$O(ue);return}Z(""),ee(ue.id),q("basic")},children:[On&&a.jsx("span",{className:`aw-select-marker${pt?" is-checked":""}`,"aria-hidden":"true"}),a.jsxs("span",{className:"aw-agent-copy",children:[a.jsxs("span",{className:"aw-agent-name-row",children:[a.jsx("strong",{children:ue.draft.name||_("agentSelector.unnamedAgent")}),a.jsx("span",{className:`aw-draft-badge${(Ge==null?void 0:Ge.status)==="running"?" is-deploying":""}`,children:(Ge==null?void 0:Ge.status)==="running"?_("myAgents.deploying"):_("myAgents.draft")})]}),a.jsx("small",{children:ue.deploymentTarget?_("agentWorkspace.updatePending"):_("agentWorkspace.notPublished")})]}),a.jsx(iE,{"aria-hidden":!0})]},ue.id)}),Nn.map(ue=>{const Le=ue.runtimeId?Wt.get(ue.runtimeId):void 0,Ge=ue.runtimeId?jn.get(ue.runtimeId):void 0,pt=zi.has(ue.id),ln=ue.canDelete===!0,Ze=(Le==null?void 0:Le.status)==="running"?{label:_("myAgents.deploying"),className:" is-deploying"}:(Le==null?void 0:Le.status)==="error"?{label:_("agentWorkspace.failed"),className:" is-error"}:(Le==null?void 0:Le.status)==="cancelled"?{label:_("agentWorkspace.cancelled"),className:" is-muted"}:Ge?{label:_("agentWorkspace.updatePending"),className:""}:null,En=(Le==null?void 0:Le.status)==="running"?_("agentWorkspace.updatingDeployment"):Ge?_("agentWorkspace.updatePending"):ue.remote?ue.host||_("agentWorkspace.remoteAgent"):_("agentWorkspace.localAgent"),Lr=["aw-agent-item","aw-agent-item--sortable",ue.id===U?"is-active":"",On?"is-selecting":"",pt?"is-selected-for-delete":"",On&&!ln?"is-selection-disabled":"",ue.id===vt?"is-dragging":"",ue.id===Qt&&ue.id!==vt?`is-drop-target is-drop-${De}`:""].filter(Boolean).join(" ");return a.jsxs("button",{type:"button",draggable:!!S&&!On,className:Lr,"aria-pressed":On?pt:void 0,"aria-keyshortcuts":S?"Alt+ArrowUp Alt+ArrowDown":void 0,onDragStart:Ii=>{S&&(zo.current=!0,tn(ue.id),Ii.dataTransfer.effectAllowed="move",Ii.dataTransfer.setData("text/plain",ue.id))},onDragEnter:Ii=>{d2(Ii,ue.id)},onDragOver:Ii=>{!vt||vt===ue.id||(Ii.preventDefault(),Ii.dataTransfer.dropEffect="move",d2(Ii,ue.id))},onDragLeave:Ii=>{const hs=Ii.relatedTarget;hs instanceof Node&&Ii.currentTarget.contains(hs)||Qt===ue.id&&un("")},onDrop:Ii=>{Ii.preventDefault();const hs=Ii.dataTransfer.getData("text/plain")||vt;Ss(hs,ue.id,De),tn(""),un(""),on("before")},onDragEnd:()=>{tn(""),un(""),on("before"),window.setTimeout(()=>{zo.current=!1},0)},onKeyDown:Ii=>{Ii.altKey&&(Ii.key==="ArrowUp"?(Ii.preventDefault(),bv(ue.id,-1)):Ii.key==="ArrowDown"&&(Ii.preventDefault(),bv(ue.id,1)))},onClick:Ii=>{if(On){Ii.preventDefault(),yv(ue);return}if(zo.current){Ii.preventDefault(),zo.current=!1;return}ee(""),Z(ue.id),q("basic"),j(ue.id)},children:[On&&a.jsx("span",{className:`aw-select-marker${pt?" is-checked":""}`,"aria-hidden":"true"}),a.jsxs("span",{className:"aw-agent-copy",children:[a.jsxs("span",{className:"aw-agent-name-row",children:[a.jsx("strong",{children:ue.label}),ue.currentVersion!=null&&a.jsxs("span",{className:"aw-version-badge",children:["v",ue.currentVersion]}),Ze&&a.jsx("span",{className:`aw-draft-badge${Ze.className}`,children:Ze.label})]}),a.jsx("small",{children:En})]}),a.jsx(iE,{"aria-hidden":!0})]},ue.id)})]})}),a.jsx("div",{className:"aw-list-count",children:_("agentWorkspace.totalCount",{count:F==="library"?e.length+ai:lt.length})})]}),F==="evaluation"&&_O?a.jsx(NXt,{group:_O,agents:e,cases:In,onChange:u2,onRun:mi}):F==="evaluation"?a.jsx("main",{className:"aw-main aw-empty-selection",children:a.jsx("p",{children:_("agentWorkspace.noEvaluationGroupSelected")})}):!re&&!Vn&&!bi?a.jsx("main",{className:"aw-main aw-empty-selection",children:a.jsx("p",{children:_("agentWorkspace.noAgentSelected")})}):a.jsxs("main",{className:`aw-main${qu?" is-deploying":""}${x?" resource-page":""}`,children:[re&&!le&&s&&a.jsx("div",{className:"aw-detail-loading",role:"status","aria-live":"polite",children:a.jsxs("div",{className:"aw-detail-loading-card",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsxs("span",{children:[a.jsx("strong",{children:_("agentWorkspace.loadingAgent")}),a.jsx("small",{children:_("agentWorkspace.loadingAgentDescription")})]})]})}),Fe==="integrations"&&ae&&a.jsx("div",{className:"aw-detail-loading",role:"status","aria-live":"polite",children:a.jsxs("div",{className:"aw-detail-loading-card",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsxs("span",{children:[a.jsx("strong",{children:_("agentWorkspace.probingIntegration")}),a.jsx("small",{children:_("agentWorkspace.probingIntegrationDescription")})]})]})}),a.jsx(lT,{className:"aw-agent-detail",title:Qd,description:Ba.description||_(s||x&&!mt?"agentWorkspace.loadingAgentInfo":"common.noDescription"),identitySeed:Qd,backLabel:_("agentWorkspace.backToAgentList"),onBack:x?O:void 0,meta:a.jsxs(a.Fragment,{children:[Bh!=null&&a.jsxs("span",{className:"aw-agent-meta",children:["v",Bh]}),Vn&&a.jsx("span",{className:"aw-agent-meta",children:_("myAgents.draft")}),La&&a.jsx("span",{className:"aw-agent-meta",children:_("agentWorkspace.updatePending")}),!re&&!Vn&&bi&&a.jsx("span",{className:"aw-agent-meta",children:bi.label})]}),actionsClassName:"aw-head-actions",bodyClassName:"aw-agent-detail__body",actions:Vn||La||re!=null&&re.canDelete?a.jsxs(a.Fragment,{children:[(Vn||La)&&a.jsxs(_t,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>{const ue=Vn??La;ue&&rs(ue)},disabled:ei,"aria-label":_("myAgents.deleteDraft"),title:_("myAgents.deleteDraft"),children:[a.jsx(eb,{"aria-hidden":!0}),a.jsx("span",{children:_("myAgents.deleteDraft")})]}),(re==null?void 0:re.canDelete)&&a.jsxs(_t,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>void Ub(re),disabled:ei,"aria-label":_("agentWorkspace.deleteAgent"),title:_("agentWorkspace.deleteAgent"),children:[a.jsx(eb,{"aria-hidden":!0}),a.jsx("span",{children:_(ei?"common.deleting":"agentWorkspace.deleteAgent")})]})]}):void 0,sections:$t.map(ue=>{var Le,Ge,pt,ln;return{key:ue.id,label:ue.label,disabled:qu,content:ue.id===Fe?a.jsxs(a.Fragment,{children:[Vr&&mv&&a.jsx("div",{className:`aw-detail-deployment${qu?" is-running":""}`,children:a.jsx(CXt,{task:Vr,onReturnToEdit:Em&&P?()=>P(Em):void 0})}),a.jsxs("div",{className:"aw-content",children:[Fe==="basic"&&a.jsxs("div",{className:"aw-basic-stack",children:[Yt&&a.jsx(Lg,{className:"aw-detail-fetch-alert",color:"warning",variant:"soft",title:_("agentWorkspace.partialInfoUnavailable"),description:_("agentWorkspace.upgradeRuntimeForDetails")}),(Ot&&!Yt||Ke)&&a.jsx(Lg,{className:"aw-detail-fetch-alert",color:"danger",variant:"soft",title:_("agentWorkspace.detailLoadFailed"),description:_("agentWorkspace.detailLoadFailedDescription"),actions:a.jsx(_t,{type:"button",color:"danger",variant:"soft",size:"sm",pill:!1,onClick:()=>nt(Ze=>Ze+1),children:_("common.retry")})}),st==="mpa"&&(es||Mi||wr)&&a.jsx(Lg,{className:"aw-detail-fetch-alert",color:wr==="bound"&&!Mi?"success":"warning",variant:"soft",title:_("agentWorkspace.mpaControlPlane"),description:es?_("agentWorkspace.loadingMpaAgentView"):Mi||Ud||_(wr==="bound"?"agentWorkspace.mpaRuntimeBound":wr==="binding_ambiguous"?"agentWorkspace.mpaRuntimeBindingAmbiguous":wr==="orphan_runtime"?"agentWorkspace.mpaRuntimeOrphan":"agentWorkspace.mpaRuntimeMissing")}),re&&st!=="mpa"&&yt&&!yt.canUpdate&&a.jsxs("div",{className:"aw-update-recovery-notice",role:yt.recoveryStatus==="preparing"?"status":"alert",children:[a.jsx("strong",{children:yt.recoveryStatus==="preparing"?_("agentWorkspace.restoringUpdateConfig"):_("agentWorkspace.updateConfigUnavailable")}),Vo&&a.jsx("span",{children:Vo}),Xi.map(Ze=>a.jsx("span",{children:Ze},Ze))]}),a.jsxs("section",{className:"aw-deployment-panel aw-settings-card",children:[a.jsx("div",{className:"aw-section-head",children:a.jsxs("div",{children:[a.jsx("h3",{children:_("agentWorkspace.deploymentConfig")}),a.jsx("p",{children:_("agentWorkspace.deploymentConfigDescription")})]})}),a.jsxs("dl",{className:"aw-readonly-config",children:[a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.runtimeStatus")}),a.jsxs("dd",{className:(ne==null?void 0:ne.status.toLowerCase())==="ready"?"is-ready":void 0,children:[(ne==null?void 0:ne.status.toLowerCase())==="ready"&&a.jsx("span",{className:"aw-status-dot"}),(ne==null?void 0:ne.status)||_("agentWorkspace.loading")]})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.deploymentRegion")}),a.jsx("dd",{children:(ne==null?void 0:ne.region)||(re==null?void 0:re.region)||(Vr==null?void 0:Vr.region)||_("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.networkAccess")}),a.jsx("dd",{children:ne!=null&&ne.networkTypes.length?ne.networkTypes.join(" / "):_("agentWorkspace.notAvailable")})]})]})]}),a.jsxs("section",{className:"aw-canvas-card",children:[a.jsx("div",{className:"aw-card-head",children:a.jsx("strong",{children:_("agentWorkspace.executionFlow")})}),a.jsx("div",{className:"aw-canvas",children:a.jsx(IP,{draft:Ba,direction:"horizontal",selectedPath:[],onSelect:()=>{},onAdd:()=>{},onInsert:()=>{},onDelete:()=>{},readOnly:!0,interactivePreview:!0},Di)})]}),a.jsxs("section",{className:"aw-details-card",children:[a.jsx("div",{className:"aw-card-head",children:a.jsx("strong",{children:_("agentWorkspace.details")})}),a.jsxs("dl",{className:"aw-facts",children:[a.jsxs("div",{children:[a.jsx("dt",{children:_("agentSelector.model")}),a.jsx("dd",{children:fH(le==null?void 0:le.model)||Ba.modelName||_("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.agentCountLabel")}),a.jsx("dd",{children:le!=null&&le.graph?r9e(le.graph):s9e(Ba)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentSelector.tools")}),a.jsx("dd",{className:"aw-fact-badges",children:Sm.length?Sm.map(Ze=>a.jsx("span",{children:Ze},Ze)):_("agentWorkspace.none")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentSelector.skills")}),a.jsx("dd",{className:"aw-fact-badges",children:Bb===null?_("agentSelector.previewUnsupported"):Bb.length?Bb.map(Ze=>a.jsx("span",{children:Ze},Ze)):_("agentWorkspace.none")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("systemInfo.currentVersion")}),a.jsx("dd",{children:Bh!=null?`v${Bh}`:_("agentWorkspace.notAvailable")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentSelector.status")}),a.jsx("dd",{children:Vn?_("myAgents.draft"):(Vr==null?void 0:Vr.status)==="error"?_("agentWorkspace.deploymentFailed"):(Vr==null?void 0:Vr.status)==="cancelled"?_("agentWorkspace.cancelled"):La?_("agentWorkspace.updatePending"):a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"aw-status-dot"}),_("skillCenter.status.available")]})})]})]})]}),a.jsxs("section",{className:"aw-sidecar-panel aw-settings-card","aria-label":_("agentWorkspace.selectedOptimizations"),children:[a.jsx("div",{className:"aw-section-head",children:a.jsxs("div",{children:[a.jsx("h3",{children:_("agentWorkspace.selectedOptimizations")}),a.jsx("p",{children:_("agentWorkspace.selectedOptimizationsDescription")})]})}),a.jsxs("dl",{className:"aw-readonly-config",children:[a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.configurationStatus")}),a.jsx("dd",{className:Dn!=null&&Dn.enabled?"is-ready":void 0,children:Dn?Dn.enabled?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"aw-status-dot"}),_("skillCenter.status.enabled")]}):_("skillCenter.status.inactive"):_("agentWorkspace.notRecorded")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.optimizationProfile")}),a.jsx("dd",{children:Dn?lmt(Dn.profile):_("agentWorkspace.legacyConfigMissing")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.selectedOptimizations")}),a.jsx("dd",{className:"aw-fact-badges",children:Dn?t2.length?t2.map(Ze=>a.jsx("span",{children:EN(Ze)},Ze)):_("agentWorkspace.noneSelected"):_("agentWorkspace.legacyConfigMissing")})]})]})]})]}),Fe==="usage"&&(re==null?void 0:re.runtimeId)&&a.jsxs("section",{className:"aw-usage","aria-busy":Ws,children:[a.jsx("div",{className:"aw-usage-intro",children:a.jsx("h3",{children:_("agentWorkspace.usageOverview")})}),Ws&&!_i&&a.jsx("div",{className:"aw-usage-state",role:"status","aria-live":"polite",children:a.jsx(cn,{as:"span",children:_("agentWorkspace.loadingUsage")})}),rr&&a.jsxs("div",{className:"aw-usage-state is-error",role:"alert",children:[a.jsx("span",{children:rr}),a.jsx("button",{type:"button",onClick:()=>hl(Ze=>Ze+1),children:_("common.retry")})]}),!Ws&&!rr&&!_i&&!Me&&a.jsx("div",{className:"aw-usage-state",children:_("agentWorkspace.usageUnavailable")}),_i&&a.jsxs(a.Fragment,{children:[a.jsxs("dl",{className:"aw-usage-summary","aria-label":_("agentWorkspace.usageSummary"),children:[a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.totalCalls")}),a.jsx("dd",{children:_i.totalInvocations.toLocaleString(L.resolvedLanguage??L.language)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:_("agentWorkspace.userCount")}),a.jsx("dd",{children:_i.totalUsers.toLocaleString(L.resolvedLanguage??L.language)})]})]}),a.jsxs("div",{className:"aw-usage-users-head",children:[a.jsx("h3",{children:_("agentWorkspace.userDetails")}),Ws&&a.jsx(cn,{as:"span",role:"status","aria-live":"polite",children:_("agentWorkspace.refreshing")})]}),_i.users.length===0?a.jsx("div",{className:"aw-usage-state",children:_("agentWorkspace.noUsage")}):a.jsx("div",{className:"aw-usage-table-wrap",children:a.jsxs("table",{className:"aw-usage-table",children:[a.jsx("caption",{children:_("agentWorkspace.usageUserList")}),a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:_("agentWorkspace.user")}),a.jsx("th",{scope:"col",children:_("agentWorkspace.callCount")}),a.jsx("th",{scope:"col",children:_("agentWorkspace.lastUsed")})]})}),a.jsx("tbody",{children:_i.users.map(Ze=>a.jsxs("tr",{children:[a.jsxs("td",{children:[a.jsx("strong",{children:Ze.displayName||Ze.userId||_("agentWorkspace.unknownUser")}),Ze.displayName&&Ze.userId&&a.jsx("small",{title:Ze.userId,children:Ze.userId})]}),a.jsx("td",{children:Ze.invocationCount.toLocaleString(L.resolvedLanguage??L.language)}),a.jsx("td",{children:a.jsx("time",{dateTime:Ze.lastUsedAt,children:e9e(Ze.lastUsedAt,L.resolvedLanguage??L.language,_)})})]},Ze.userId))})]})}),_i.totalPages>1&&a.jsxs("nav",{className:"aw-usage-pagination","aria-label":_("agentWorkspace.usagePagination"),children:[a.jsx("button",{type:"button",disabled:Ws||_i.page<=1,onClick:()=>ws(Ze=>Math.max(1,Ze-1)),children:_("common.previousPage")}),a.jsx("span",{"aria-live":"polite",children:_("agentWorkspace.pageOf",{page:_i.page,total:_i.totalPages})}),a.jsx("button",{type:"button",disabled:Ws||_i.page>=_i.totalPages,onClick:()=>ws(Ze=>Ze+1),children:_("common.nextPage")})]})]})]}),Fe==="sessionConfig"&&a.jsx(cXt,{config:gr,profileStatus:Vi,loadable:$h,disabledReason:Fb,loading:Pa,saving:Qu,upgrading:hc,error:$d,notice:Fd,modelValue:gl,modelDirty:Vu,profileUpgradeAvailable:Rr,onModelChange:Fo,onSaveModel:()=>void s2(),onInheritModel:()=>void s2("inherit"),onClearMcp:()=>void IO("clear"),onInheritMcp:()=>void IO("inherit"),onUpgradeProfile:()=>void KL(),onRefresh:()=>Da(Ze=>Ze+1)}),Fe==="profileConfig"&&a.jsx(lXt,{profile:n2,profileStatus:Vi,runtimeReady:Mb,disabledReason:WL,saving:Uo.saving,error:Uo.error,notice:Uo.notice,onApply:()=>void gv(),onEditProfile:a2,onRefresh:()=>nt(Ze=>Ze+1)}),Fe==="diagnostics"&&a.jsx(fXt,{data:fv,loadable:!i2,disabledReason:i2,loading:ml,error:gi,onRefresh:()=>Ks(Ze=>Ze+1),locale:L.resolvedLanguage??L.language}),Fe==="versions"&&a.jsxs("section",{className:"aw-version-stack",children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:_("agentWorkspace.githubVersions")}),a.jsx("p",{children:(Le=ve==null?void 0:ve.cicd)!=null&&Le.enabled?_("agentWorkspace.githubVersionsDescription"):_("agentWorkspace.currentVersionOnly")})]}),oe&&a.jsx("div",{className:"aw-case-empty",children:_("agentWorkspace.loadingVersions")}),Ue&&a.jsxs("div",{className:"aw-integration-error",role:"alert",children:[a.jsx("span",{children:Ue}),(re==null?void 0:re.runtimeId)&&a.jsx("button",{type:"button",onClick:()=>void fN(re.runtimeId??"").then(Se),children:_("common.retry")})]}),!oe&&!Ue&&a.jsxs("div",{className:"aw-version-list",children:[(ve==null?void 0:ve.githubSyncError)&&a.jsx("div",{className:"aw-integration-error",role:"alert",children:a.jsx("span",{children:ve.githubSyncError})}),(ve==null?void 0:ve.latestSourceRuntimeStatus)&&ve.latestSourceRuntimeStatus!=="published"&&((Ge=ve.versions[0])==null?void 0:Ge.commitSha)&&ve.versions[0].commitSha!==ve.currentCommitSha&&a.jsx("div",{className:"aw-integration-notice",role:"status",children:a.jsxs("span",{children:[_("agentWorkspace.sourceMergedRuntimeStill"),Foe(ve.latestSourceRuntimeStatus,_),_("agentWorkspace.currentProductionVersionHint")]})}),ve!=null&&ve.versions.length?ve.versions.map(Ze=>{var sa;const En=Ze.commitSha??"",Lr=Ze.runtimeStatus??Ze.status,Ii=Ze.changeType==="rollback",hs=!!((sa=ve.cicd)!=null&&sa.enabled)&&!!En&&!Ii&&En!==ve.currentCommitSha;return a.jsxs("article",{className:"aw-version-row",children:[a.jsxs("div",{children:[a.jsx("strong",{children:iXt(Ze,_)}),a.jsx("small",{children:Ze.createdAt||_("agentWorkspace.noTime")})]}),a.jsxs("div",{children:[a.jsx("span",{children:_("agentWorkspace.prLink")}),Ze.pullRequestUrl?a.jsx("a",{href:Ze.pullRequestUrl,target:"_blank",rel:"noopener noreferrer",children:_("agentWorkspace.viewPr")}):a.jsx("em",{children:_("agentWorkspace.noPr")})]}),a.jsxs("div",{children:[a.jsx("span",{children:_("agentWorkspace.author")}),a.jsx("em",{children:Ze.author||"Studio"})]}),a.jsxs("div",{children:[a.jsx("span",{children:_("agentWorkspace.publishStatus")}),a.jsx("em",{children:Foe(Lr,_)})]}),a.jsxs("div",{className:"aw-version-actions",children:[a.jsx("button",{type:"button",disabled:!hs||ke===En,onClick:()=>void NO(Ze),children:_(ke===En?"agentWorkspace.rollingBack":"agentWorkspace.rollbackToVersion")}),Ze.workflowRunUrl&&a.jsx("a",{href:Ze.workflowRunUrl,target:"_blank",rel:"noopener noreferrer",children:_("agentWorkspace.viewRelease")})]})]},`${Ze.version}-${En||Ze.createdAt}`)}):a.jsxs("article",{className:"aw-version-row",children:[a.jsxs("div",{children:[a.jsx("strong",{children:Bh!=null?`v${Bh}`:_("agentWorkspace.noVersion")}),a.jsx("small",{children:(ne==null?void 0:ne.updatedAt)||_("agentWorkspace.noTime")})]}),a.jsx("p",{children:_("agentWorkspace.currentVersionOnly")})]})]})]}),Fe==="integrations"&&a.jsxs("div",{className:"aw-integration-stack",children:[a.jsxs("div",{className:"aw-integration-intro",children:[a.jsx("h3",{children:_("agentWorkspace.integrationMethods")}),a.jsx("p",{children:_("agentWorkspace.integrationDescription")})]}),K&&a.jsxs("div",{className:"aw-integration-error",role:"alert",children:[a.jsx("span",{children:K}),a.jsx("button",{type:"button",onClick:()=>ye(Ze=>Ze+1),children:_("common.retry")})]}),!K&&a.jsxs("div",{className:"aw-integration-body",children:[a.jsxs("div",{className:`aw-integration-protocol-tabs${de==="a2a"?" is-a2a":""}`,role:"tablist","aria-label":_("agentWorkspace.integrationProtocol"),children:[a.jsx("span",{className:"aw-integration-protocol-slider","aria-hidden":"true"}),Dk.map((Ze,En)=>a.jsx("button",{type:"button",id:`integration-${Ze.id}-tab`,role:"tab","aria-selected":de===Ze.id,"aria-controls":`integration-${Ze.id}-panel`,tabIndex:de===Ze.id?0:-1,onClick:()=>fs(Ze.id),onKeyDown:Lr=>{var sa;if(!["ArrowLeft","ArrowRight","Home","End"].includes(Lr.key))return;Lr.preventDefault();const Ii=Lr.key==="Home"?0:Lr.key==="End"?Dk.length-1:(En+(Lr.key==="ArrowRight"?1:-1)+Dk.length)%Dk.length,hs=Dk[Ii];fs(hs.id),(sa=document.getElementById(`integration-${hs.id}-tab`))==null||sa.focus()},children:Ze.label},Ze.id))]}),de==="api-server"?a.jsx(Uoe,{protocol:"api-server",title:"API Server",available:pc,fields:[{label:"Agent",value:pc?((pt=Hn==null?void 0:Hn.apiApps)==null?void 0:pt.join("、"))??"":""},{label:_("agentWorkspace.discoveryEndpoint"),value:pc?d6(Hu,"/list-apps"):""},{label:_("agentWorkspace.invocationEndpoint"),value:pc?d6(Hu,"/run_sse"):""},{label:_("agentWorkspace.authentication"),value:pc?$oe(ne==null?void 0:ne.authType,_):""},{label:"API Key",value:a.jsx(Boe,{available:pc,authType:ne==null?void 0:ne.authType,value:sr,visible:Ne&&!!sr,loading:Xe,error:se,onToggle:()=>void jO()})}],example:pc?rXt(Hu,km,ne==null?void 0:ne.authType):""}):a.jsx(Uoe,{protocol:"a2a",title:"A2A",available:$a,fields:[{label:"Agent",value:((ln=Hn==null?void 0:Hn.a2a)==null?void 0:ln.name)??""},{label:"Agent Card",value:$a?d6(Hu,"/.well-known/agent-card.json"):""},{label:_("agentWorkspace.invocationUrl"),value:Mf},{label:_("agentWorkspace.authentication"),value:$a?$oe(ne==null?void 0:ne.authType,_):""},{label:"API Key",value:a.jsx(Boe,{available:$a,authType:ne==null?void 0:ne.authType,value:sr,visible:Ne&&!!sr,loading:Xe,error:se,onToggle:()=>void jO()})}],example:$a?sXt(Mf,ne==null?void 0:ne.authType):""})]})]}),Fe==="evaluations"&&a.jsxs("section",{className:"aw-cases",children:[(re==null?void 0:re.runtimeId)&&a.jsx("div",{className:"aw-case-summary",children:["good","bad"].map(Ze=>{const En=vXt(ze,Ze),Lr=In.filter(hs=>hs.kind===Ze).length,Ii=Cm?Lr:(En==null?void 0:En.itemCount)??Lr;return a.jsxs("button",{type:"button",onClick:()=>o2(Ze),children:[a.jsx("strong",{children:Ii}),a.jsx("span",{children:_(Ze==="good"?"agentWorkspace.goodCases":"agentWorkspace.badCases")})]},Ze)})}),a.jsxs("div",{className:"aw-case-filter-bar",children:[a.jsxs("div",{className:"aw-case-filter-stack",children:[a.jsx("div",{className:"aw-case-filters","aria-label":_("agentWorkspace.caseResultFilter"),children:["good","bad"].map(Ze=>a.jsx("button",{type:"button",className:Et===Ze?"is-active":"","aria-pressed":Et===Ze,onClick:()=>At(Ze),children:_(Ze==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")},Ze))}),a.jsx("div",{className:"aw-case-source-filters","aria-label":_("agentWorkspace.feedbackSourceFilter"),children:["auto","user"].map(Ze=>a.jsx("button",{type:"button",className:Ye===Ze?"is-active":"","aria-pressed":Ye===Ze,onClick:()=>wt(Ze),children:_(Ze==="auto"?"agentWorkspace.automaticFeedback":"agentWorkspace.manualFeedback")},Ze))})]}),a.jsxs("label",{className:"aw-case-search",children:[a.jsx(fI,{"aria-hidden":!0}),a.jsx("input",{type:"search",value:It,onChange:Ze=>Gt(Ze.currentTarget.value),placeholder:_("agentWorkspace.searchCasesPlaceholder"),"aria-label":_("agentWorkspace.searchCases")})]})]}),DO&&a.jsx("div",{className:`aw-case-toolbar${zu?" is-active":""}`,children:zu?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"aw-selection-count",children:_("agentWorkspace.selectedCaseCount",{count:PO.length})}),a.jsx("button",{type:"button",onClick:MO,disabled:Am.length===0||Ma,children:_("agentWorkspace.selectAllVisible")}),a.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void c2(PO),disabled:PO.length===0||Ma,children:_(Ma?"common.deleting":"agentWorkspace.deleteSelected")}),a.jsx("button",{type:"button",onClick:zd,disabled:Ma,children:_("common.cancel")})]}):a.jsx("button",{type:"button",onClick:()=>{Os(""),vl(!0)},disabled:Am.length===0||Ma,children:_("agentWorkspace.selectCases")})}),$l&&a.jsx("div",{className:"aw-delete-error",role:"alert",children:$l}),a.jsx("div",{ref:Gc,children:a.jsx(jXt,{cases:Am,loading:Ht&&Am.length===0,error:jr,notice:qs,runtimeBacked:!!(re!=null&&re.runtimeId),selectionMode:zu,selectedCaseIds:Ll,focusedCaseId:ts,expandedCaseIds:Bd,deleting:Ma,canDelete:DO,onOpenCase:LO,onToggleCase:GL,onToggleExpanded:l2,onDeleteCase:Ze=>void c2([Ze]),onRetry:()=>Si(Ze=>Ze+1)})})]}),Fe==="optimizations"&&a.jsxs("section",{className:"aw-optimizations",children:[a.jsxs("div",{className:"aw-optimization-intro",children:[a.jsx("h3",{children:_("agentWorkspace.optimizations")}),a.jsx("p",{children:_("agentWorkspace.optimizationsDescription")})]}),ga?a.jsxs("div",{className:"aw-optimization-state",role:"status",children:[a.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),a.jsx("span",{children:_("agentWorkspace.loadingOptimizations")})]}):us?a.jsxs("div",{className:"aw-optimization-state is-error",role:"alert",children:[a.jsx("span",{children:us}),a.jsx("button",{type:"button",onClick:()=>bo(Ze=>Ze+1),children:_("common.retry")})]}):Zr.length>0?a.jsx(TXt,{groups:Zr}):a.jsx("div",{className:"aw-optimization-state",children:_("agentWorkspace.noOptimizations")})]})]}),Fe==="basic"&&(re||Vn)&&a.jsxs("div",{className:"aw-basic-actions",children:[re&&a.jsxs("button",{type:"button",className:"aw-talk studio-update-action",onClick:()=>T==null?void 0:T(re),children:[a.jsx(Hat,{"aria-hidden":!0}),a.jsx("span",{children:_("agentWorkspace.chat")})]}),st!=="mpa"&&a.jsxs("span",{className:`aw-update-wrap${Fh?" is-disabled":""}`,tabIndex:Fh?0:void 0,"aria-describedby":Fh?$b:void 0,children:[a.jsx("button",{type:"button",className:"aw-update studio-update-action",disabled:!!Fh,"aria-busy":jt||void 0,"aria-describedby":Fh?$b:void 0,onClick:()=>{if(Vn){P==null||P(Vn);return}yt&&D(yt)},children:jt?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"loading-gap-spinner aw-update-spinner","aria-hidden":"true"}),a.jsx("span",{children:_("agentWorkspace.preparing")})]}):_(Vn||La?"agentWorkspace.continueEditing":"agentWorkspace.update")}),Fh&&a.jsx("span",{id:$b,className:"aw-update-disabled-reason",role:"tooltip",children:Fh})]})]})]}):null}}),activeSectionKey:Fe,navigationLabel:_("agentWorkspace.agentDetails"),onSectionChange:q})]})]}),F==="evaluation"&&a.jsx("div",{className:"aw-evaluation-glass",role:"status",children:a.jsx("span",{children:_("agentWorkspace.comingSoon")})})]})]}),Rn&&a.jsx(Td,{variant:"danger",title:Rn.title,description:Rn.description,confirmLabel:ei?_("common.deleting"):Rn.confirmLabel,closeLabel:_("agentWorkspace.closeDeleteConfirmation"),busy:ei,confirmDisabled:Rn.canConfirm===!1,onCancel:()=>di(null),onConfirm:()=>void vv()})]})}function TXt({groups:e}){const{t}=Te("ui");return a.jsx("div",{className:"aw-optimization-table-wrap",children:a.jsxs("table",{className:"aw-optimization-table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",children:t("agentWorkspace.fixPriority")}),a.jsx("th",{scope:"col",children:t("agentWorkspace.suggestedModule")}),a.jsx("th",{scope:"col",children:t("agentWorkspace.suggestionAndReason")})]})}),a.jsx("tbody",{children:e.map(n=>a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx("span",{className:`aw-priority is-${n.priority}`,children:gXt(n.priority,t)})}),a.jsx("td",{children:a.jsx("span",{className:"aw-optimization-module",children:yXt(n,t)})}),a.jsx("td",{children:a.jsx("ul",{className:"aw-optimization-list",children:n.items.map(i=>a.jsxs("li",{children:[a.jsx("strong",{children:i.suggestion}),a.jsx("p",{children:i.reason})]},`${i.suggestion}:${i.reason}`))})})]},`${n.priority}:${n.module}:${n.customModule??""}`))})]})})}function _Xt(){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M4.5 7h15"}),a.jsx("path",{d:"M9 7V4.8h6V7"}),a.jsx("path",{d:"m6.5 7 .8 12h9.4l.8-12"}),a.jsx("path",{d:"M10 10.5v5M14 10.5v5"})]})}function jXt({cases:e,loading:t=!1,error:n="",notice:i="",runtimeBacked:r=!1,selectionMode:s=!1,selectedCaseIds:o,focusedCaseId:l="",expandedCaseIds:c,deleting:u=!1,canDelete:d=!1,onOpenCase:f,onToggleCase:h,onToggleExpanded:m,onDeleteCase:g,onRetry:b}){const{t:v,i18n:y}=Te("ui");return a.jsxs("div",{className:"aw-case-table",children:[a.jsxs("div",{className:"aw-case-row aw-case-row-head",children:[a.jsx("span",{children:v("agentWorkspace.userInput")}),a.jsx("span",{children:v("agentWorkspace.agentOutput")}),a.jsx("span",{children:v("agentWorkspace.score")}),a.jsx("span",{children:v("agentWorkspace.scoreReason")}),a.jsx("span",{className:"aw-case-action-head",children:v("skillCenter.actions")})]}),t?a.jsx("div",{className:"aw-case-empty",children:v("agentWorkspace.loadingEvaluationSet")}):n?a.jsxs("div",{className:"aw-case-empty aw-case-error",children:[a.jsx("span",{children:n}),b&&a.jsx("button",{type:"button",onClick:b,children:v("common.retry")})]}):i?a.jsx("div",{className:"aw-case-empty",children:i}):e.length===0?a.jsx("div",{className:"aw-case-empty",children:v(r?"agentWorkspace.noFeedbackCases":"agentWorkspace.noMatchingCases")}):e.map(w=>{var T,R;const x=w.id.startsWith("local:"),O=(o==null?void 0:o.has(w.id))??!1,k=(c==null?void 0:c.has(w.id))??!1,C=w.output.length+w.referenceOutput.length>220||(((T=w.reason)==null?void 0:T.length)??0)>120,E=d&&!x,j=!!(w.comment&&w.comment.trim()!==((R=w.reason)==null?void 0:R.trim()));return a.jsxs("div",{className:["aw-case-row",l===w.id?"is-focused":"",s?"is-selecting":"",O?"is-selected-for-delete":""].filter(Boolean).join(" "),role:"row",tabIndex:0,"aria-selected":s?O:void 0,onClick:()=>{if(s){E&&(h==null||h(w));return}f==null||f(w)},onKeyDown:A=>{A.target===A.currentTarget&&(A.key!=="Enter"&&A.key!==" "||(A.preventDefault(),s?E&&(h==null||h(w)):f==null||f(w)))},children:[a.jsxs("div",{className:"aw-case-text aw-case-cell","data-label":v("agentWorkspace.userInput"),children:[a.jsxs("span",{className:"aw-case-title-line",children:[s&&E&&a.jsx("span",{className:`aw-select-marker${O?" is-checked":""}`,"aria-hidden":"true"}),a.jsx("strong",{title:w.input,children:w.input||v("agentWorkspace.noUserInput")})]}),j&&a.jsxs("small",{title:w.comment,children:[v("agentWorkspace.note"),w.comment]}),a.jsx("small",{className:"aw-case-time",children:pXt(w.createdAt,y.resolvedLanguage??y.language,v)}),(w.userId||w.sessionId)&&a.jsx("small",{title:[w.userId,w.sessionId].filter(Boolean).join(" · "),children:[w.userId,w.sessionId].filter(Boolean).join(" · ")})]}),a.jsxs("div",{className:`aw-case-output aw-case-cell${k?" is-expanded":""}`,"data-label":v("agentWorkspace.agentOutput"),children:[a.jsx("p",{className:"aw-case-output-preview",title:w.output,children:w.output||v("agentWorkspace.noVisibleResponse")}),w.referenceOutput&&a.jsxs("small",{className:"aw-case-output-preview",title:w.referenceOutput,children:[v("agentWorkspace.reference"),": ",w.referenceOutput]}),C&&a.jsx("button",{type:"button",className:"aw-case-expand",onClick:A=>{A.stopPropagation(),m==null||m(w.id)},children:v(k?"common.collapse":"common.expand")})]}),a.jsx("div",{className:"aw-case-score aw-case-cell","data-label":v("agentWorkspace.score"),children:mXt(w,v)}),a.jsx("div",{className:`aw-case-reason aw-case-cell${k?" is-expanded":""}`,"data-label":v("agentWorkspace.scoreReason"),children:a.jsx("p",{title:w.reason||void 0,children:w.reason||"—"})}),a.jsx("div",{className:"aw-case-actions aw-case-cell","data-label":v("skillCenter.actions"),children:E&&a.jsx("button",{type:"button",className:"aw-case-delete",onClick:A=>{A.stopPropagation(),g==null||g(w)},disabled:u,title:v("agentWorkspace.deleteFeedbackCase"),"aria-label":v("agentWorkspace.deleteFeedbackCase"),children:a.jsx(_Xt,{})})})]},w.id)})]})}function NXt({group:e,agents:t,cases:n,onChange:i,onRun:r}){const{t:s}=Te("ui"),[o,l]=p.useState("config"),c=e.agentIds.map(h=>t.find(m=>m.id===h)).filter(h=>!!h),u=["回答质量","事实准确性","工具调用","响应效率"];p.useEffect(()=>l("config"),[e.id]);const d=h=>{i({...e,agentIds:e.agentIds.includes(h)?e.agentIds.filter(m=>m!==h):[...e.agentIds,h]})},f=h=>{i({...e,metrics:e.metrics.includes(h)?e.metrics.filter(m=>m!==h):[...e.metrics,h]})};return a.jsxs("main",{className:"aw-main",children:[a.jsxs("div",{className:"aw-eval-head",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"aw-agent-title-row",children:[a.jsx("h2",{children:CS(e.name,s)}),a.jsx("span",{children:s("agentWorkspace.evaluationGroup")})]}),a.jsx("p",{children:s("agentWorkspace.evaluationGroupStats",{agents:c.length,caseSet:CS(e.caseSet,s),runs:e.history.length})})]}),a.jsxs("button",{type:"button",className:"aw-run",onClick:()=>r(e),disabled:!0,children:[a.jsx($at,{"aria-hidden":!0}),s("agentWorkspace.startEvaluation")]})]}),a.jsxs("nav",{className:"aw-agent-tabs","aria-label":s("agentWorkspace.evaluationGroupDetails"),children:[a.jsx("button",{type:"button",className:o==="config"?"is-active":"","aria-pressed":o==="config",onClick:()=>l("config"),disabled:!0,children:s("agentWorkspace.evaluationConfig")}),a.jsx("button",{type:"button",className:o==="history"?"is-active":"","aria-pressed":o==="history",onClick:()=>l("history"),disabled:!0,children:s("agentWorkspace.historyResults")})]}),a.jsx("div",{className:"aw-content",children:o==="config"?a.jsxs("div",{className:"aw-eval-setup",children:[a.jsxs("section",{className:"aw-eval-block",children:[a.jsxs("div",{className:"aw-card-head",children:[a.jsx("strong",{children:s("agentWorkspace.participatingAgents")}),a.jsx("span",{children:s("agentWorkspace.selectedCount",{count:c.length})})]}),a.jsx("div",{className:"aw-eval-agent-grid",children:t.map(h=>a.jsxs("label",{children:[a.jsx("input",{type:"checkbox",checked:e.agentIds.includes(h.id),onChange:()=>d(h.id)}),a.jsxs("span",{children:[a.jsx("strong",{children:h.label}),a.jsx("small",{children:h.remote?s("agentWorkspace.remote"):s("agentWorkspace.local")})]})]},h.id))})]}),a.jsxs("div",{className:"aw-eval-setting-grid",children:[a.jsxs("section",{className:"aw-eval-block",children:[a.jsx("div",{className:"aw-card-head",children:a.jsx("strong",{children:s("agentWorkspace.evaluationResources")})}),a.jsxs("div",{className:"aw-eval-fields",children:[a.jsxs("label",{children:[a.jsx("span",{children:s("agentWorkspace.evaluationSet")}),a.jsxs("select",{value:e.caseSet,onChange:h=>i({...e,caseSet:h.currentTarget.value}),children:[a.jsx("option",{value:"核心回归集",children:s("agentWorkspace.evaluationDefaults.coreSet")}),a.jsx("option",{value:"安全边界集",children:s("agentWorkspace.evaluationDefaults.safetySet")}),a.jsx("option",{value:"工具调用集",children:s("agentWorkspace.evaluationDefaults.toolSet")})]}),a.jsx("small",{children:s("agentWorkspace.caseCount",{count:n.length})})]}),a.jsxs("label",{children:[a.jsx("span",{children:s("agentWorkspace.evaluator")}),a.jsxs("select",{value:e.evaluator,onChange:h=>i({...e,evaluator:h.currentTarget.value}),children:[a.jsx("option",{value:"综合质量评估器",children:s("agentWorkspace.evaluationDefaults.qualityEvaluator")}),a.jsx("option",{value:"事实一致性评估器",children:s("agentWorkspace.evaluationDefaults.factualEvaluator")}),a.jsx("option",{value:"工具调用评估器",children:s("agentWorkspace.evaluationDefaults.toolEvaluator")})]})]}),a.jsxs("label",{children:[a.jsx("span",{children:s("agentWorkspace.concurrency")}),a.jsxs("select",{value:e.concurrency,onChange:h=>i({...e,concurrency:h.currentTarget.value}),children:[a.jsx("option",{value:"2",children:"2"}),a.jsx("option",{value:"4",children:"4"}),a.jsx("option",{value:"8",children:"8"})]})]})]})]}),a.jsxs("section",{className:"aw-eval-block",children:[a.jsxs("div",{className:"aw-card-head",children:[a.jsx("strong",{children:s("agentWorkspace.evaluationMetrics")}),a.jsx("span",{children:s("agentWorkspace.selectedMetricCount",{count:e.metrics.length})})]}),a.jsx("div",{className:"aw-metric-list",children:u.map(h=>a.jsxs("label",{children:[a.jsx("input",{type:"checkbox",checked:e.metrics.includes(h),onChange:()=>f(h)}),a.jsx("span",{children:CS(h,s)})]},h))})]})]})]}):a.jsxs("section",{className:"aw-eval-history",children:[a.jsx("div",{className:"aw-section-head",children:a.jsxs("div",{children:[a.jsx("h3",{children:s("agentWorkspace.historyResults")}),a.jsx("p",{children:s("agentWorkspace.historyDescription")})]})}),e.history.length===0?a.jsxs("div",{className:"aw-results-empty",children:[a.jsx("strong",{children:s("agentWorkspace.noHistory")}),a.jsx("span",{children:s("agentWorkspace.noHistoryDescription")})]}):a.jsx("div",{className:"aw-history-list",children:e.history.map((h,m)=>a.jsxs("button",{type:"button",children:[a.jsxs("span",{children:[a.jsx("strong",{children:s("agentWorkspace.evaluationRun",{index:e.history.length-m})}),a.jsx("small",{children:s("agentWorkspace.evaluationRunMeta",{time:CS(h.createdAt,s),agents:c.length})})]}),a.jsxs("span",{className:"aw-history-score",children:[a.jsx("strong",{children:h.score}),a.jsx("small",{children:s("agentWorkspace.overallScore")})]}),a.jsxs("span",{className:"aw-complete",children:[a.jsx(Cf,{}),s("agentWorkspace.completed")]}),a.jsx(iE,{"aria-hidden":!0})]},h.id))})]})})]})}async function mK(e,t={}){const n=await fetch(Ta(`/web/agent-reviews${e}`),{...t,headers:ul(uc({"Content-Type":"application/json"})),signal:po(t.signal??void 0,6e4)});if(!n.ok)throw new Error(await n.text());return n.json()}function RXt(e,t){return mK(`?${new URLSearchParams({region:e})}`,{signal:t})}function IXt(e,t,n){return mK(`/${encodeURIComponent(e)}?${new URLSearchParams({region:t})}`,{signal:n})}function PXt(e,t,n){return mK(`/${encodeURIComponent(e)}/${t}`,{method:"POST",body:JSON.stringify(n)})}const DXt=20,Voe=256;function f6({label:e,value:t,onChange:n,limit:i,disabled:r,required:s=!1}){const{t:o}=Te("agentReviews");return a.jsxs("label",{children:[e,a.jsx("textarea",{"aria-label":e,value:t,onChange:l=>n(Array.from(l.target.value).slice(0,i).join("")),maxLength:i*2,disabled:r,required:s,rows:3}),a.jsx("span",{className:"agent-review-text-count",children:o("textCount",{count:Array.from(t).length,limit:i})})]})}function PP({person:e}){return a.jsxs("span",{className:"agent-review-person",title:e.email||e.name,children:[e.avatarUrl?a.jsx("img",{src:e.avatarUrl,alt:"",referrerPolicy:"no-referrer",onError:t=>{t.currentTarget.hidden=!0}}):null,a.jsx("span",{children:e.name||e.id})]})}function c9e({runtimeId:e,region:t,name:n,canPublish:i,onClose:r,onChanged:s}){const{t:o,i18n:l}=Te("agentReviews"),[c,u]=p.useState(null),[d,f]=p.useState(!0),[h,m]=p.useState(!1),[g,b]=p.useState(""),[v,y]=p.useState(""),[w,x]=p.useState(""),[O,k]=p.useState(""),[S,C]=p.useState(0),[E,j]=p.useState(!1),[T,R]=p.useState(null);p.useEffect(()=>{const _=new AbortController;return f(!0),b(""),IXt(e,t,_.signal).then(L=>{_.signal.aborted||u(L.application)}).catch(L=>{_.signal.aborted||b(L instanceof Error?L.message:String(L))}).finally(()=>{_.signal.aborted||f(!1)}),()=>_.abort()},[e,t,S]);async function A(_,L){if(!h){m(!0),b("");try{const F=await PXt(e,_,{region:t,..._==="submit"?{message:v}:{},..._==="publish"||_==="decision"?{comment:w}:{},..._==="decision"?{applicationId:c==null?void 0:c.id,decision:L,reason:O}:{}});u(F),x(""),k(""),j(!1),R(null),s()}catch(F){b(F instanceof Error?F.message:String(F))}finally{m(!1)}}}const N=(c==null?void 0:c.status)==="pending",D=!!(c!=null&&c.published),I=!N&&!D,P=_=>new Date(_).toLocaleString(l.language);return a.jsx(av,{open:!0,onOpenChange:_=>{!_&&!h&&r()},children:a.jsxs(sv,{children:[a.jsx(iv,{className:"agent-review-backdrop"}),a.jsxs(rv,{className:"agent-review-dialog",children:[a.jsxs("header",{className:"agent-review-dialog-header",children:[a.jsxs("div",{children:[a.jsx(vO,{children:n}),a.jsx($T,{children:o("dialogDescription")})]}),a.jsx(hL,{className:"agent-review-close",disabled:h,"aria-label":o("close"),children:a.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m6 6 12 12M6 18 18 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})})]}),a.jsxs("div",{className:"agent-review-dialog-body",children:[d?a.jsx(cl,{}):null,g?a.jsxs("div",{className:"agent-review-error",role:"alert",children:[a.jsx("p",{children:g}),a.jsx("button",{type:"button",disabled:h||d,onClick:()=>C(_=>_+1),children:o("refresh")})]}):null,!d&&c?a.jsxs(a.Fragment,{children:[a.jsxs("dl",{className:"agent-review-facts",children:[a.jsxs("div",{children:[a.jsx("dt",{children:o("statusTitle")}),a.jsxs("dd",{children:[o(`status.${c.status}`),c.status==="approved"&&!D?` · ${o("private")}`:""]})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("submitter")}),a.jsx("dd",{children:a.jsx(PP,{person:c.submitter})})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("submittedAt")}),a.jsx("dd",{children:P(c.submittedAt)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("version")}),a.jsx("dd",{children:c.agent.version??"—"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("model")}),a.jsx("dd",{children:c.agent.model||"—"})]}),c.reviewer?a.jsxs("div",{children:[a.jsx("dt",{children:o(c.status==="returned"?"returnedBy":"approvedBy")}),a.jsx("dd",{children:a.jsx(PP,{person:c.reviewer})})]}):null,c.reviewedAt?a.jsxs("div",{children:[a.jsx("dt",{children:o("reviewedAt")}),a.jsx("dd",{children:P(c.reviewedAt)})]}):null]}),a.jsxs("section",{children:[a.jsx("h3",{children:o("description")}),a.jsx("p",{children:c.agent.description||"—"})]}),c.message?a.jsxs("section",{children:[a.jsx("h3",{children:o("message")}),a.jsx("p",{children:c.message})]}):null,c.reason?a.jsxs("section",{children:[a.jsx("h3",{children:o("reason")}),a.jsx("p",{children:c.reason})]}):null,c.comment?a.jsxs("section",{children:[a.jsx("h3",{children:o("comment")}),a.jsx("p",{children:c.comment})]}):null,c.contentChanged?a.jsx("p",{role:"alert",className:"agent-review-warning",children:o("contentChanged")}):null]}):null,!d&&!g&&I&&!i?a.jsx(f6,{label:o("message"),value:v,onChange:y,limit:DXt,disabled:h}):null,!d&&!g&&i&&(N||I)?a.jsx(f6,{label:o("comment"),value:w,onChange:x,limit:Voe,disabled:h}):null,E?a.jsx(f6,{label:o("reasonRequired"),value:O,onChange:k,limit:Voe,disabled:h,required:!0}):null,T?a.jsx("p",{role:"status",children:o(`${T}Confirm`)}):null]}),a.jsxs("footer",{className:"agent-review-dialog-footer",children:[h?a.jsx("span",{role:"status",children:o("saving")}):null,!d&&(!g||c)?T?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",disabled:h,onClick:()=>R(null),children:o("cancel")}),a.jsx("button",{type:"button",disabled:h,onClick:()=>void A(T),children:o("confirm")})]}):E?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",disabled:h,onClick:()=>j(!1),children:o("cancel")}),a.jsx("button",{type:"button",disabled:h||!O.trim(),onClick:()=>void A("decision","returned"),children:o("return")})]}):a.jsxs(a.Fragment,{children:[D?a.jsx("button",{type:"button",disabled:h,onClick:()=>R("unpublish"),children:o("unpublish")}):null,N?a.jsx("button",{type:"button",disabled:h,onClick:()=>R("withdraw"),children:o("withdraw")}):null,N&&i?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",disabled:h,onClick:()=>j(!0),children:o("return")}),a.jsx("button",{type:"button",className:"is-primary",disabled:h||(c==null?void 0:c.contentChanged),onClick:()=>void A("decision","approved"),children:o("approve")})]}):null,I?a.jsx("button",{type:"button",className:"is-primary",disabled:h,onClick:()=>void A(i?"publish":"submit"),children:o(i?"publish":"submit")}):null]}):null]})]})]})})}const MXt=5e3,LXt=4;let h6=0;const Hoe=[];function qoe(e){return e instanceof Error&&e.name==="AbortError"}function $Xt(e){return e instanceof Error&&e.name==="TimeoutError"}function FXt(e){return $Xt(e)||e instanceof ID&&[500,502,503,504].includes(e.status)}function BXt(e,t){return t!=null&&t.aborted?Promise.reject(t.reason??new DOMException("Request aborted","AbortError")):new Promise((n,i)=>{const r=()=>{globalThis.clearTimeout(s),i((t==null?void 0:t.reason)??new DOMException("Request aborted","AbortError"))},s=globalThis.setTimeout(()=>{t==null||t.removeEventListener("abort",r),n()},e);t==null||t.addEventListener("abort",r,{once:!0})})}async function UXt(e={},t={}){const n=t.request??z0,i=t.wait??BXt;try{return await n(e)}catch(r){if(!FXt(r))throw r;return await i(MXt,e.signal),n(e)}}async function u9e(e){var t;h6>=LXt&&await new Promise(n=>Hoe.push(n)),h6+=1;try{return await e()}finally{h6-=1,(t=Hoe.shift())==null||t()}}async function QXt(e,t){await Promise.allSettled(e.map(n=>u9e(()=>t(n))))}function Cy(e,t,n){const i=e instanceof Error?`${e.name}: ${e.message}`:String(e||Q("common.unknownError"));return[Q("requestError.actionFailed",{action:t}),Q("requestError.detail",{detail:i}),n?Q("requestError.request",{request:n}):""].filter(Boolean).join(` +`)}function Tp({className:e="icon"}){return a.jsxs("svg",{className:`${e} sidebar-agent-face`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("rect",{x:"4.25",y:"5.25",width:"15.5",height:"13.5",rx:"4.75"}),a.jsx("path",{className:"sidebar-agent-face__eye",d:"M8.5 10.7v2"}),a.jsx("path",{className:"sidebar-agent-face__eye",d:"M15.5 10.7v2"})]})}function zXt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M8.4 18.4H7.2a4.2 4.2 0 0 1-.65-8.35A5.7 5.7 0 0 1 17.3 8.2a4.6 4.6 0 0 1-.4 9.2h-3.2"}),a.jsx("path",{d:"m7.8 12.3 2 2-2 2M12.2 16.3h3.2"})]})}function VXt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M18.9 6.25A8.4 8.4 0 1 0 19.6 16"}),a.jsx("path",{d:"M19 6.2c.1 2.1-.65 3.75-2.25 4.95-1.2.9-2.75 1.25-4.2.9"}),a.jsx("circle",{cx:"10.6",cy:"12.8",r:"2.45"}),a.jsx("path",{d:"m5.25 18.6 3.65-3.9M14.8 17.9c1.9-.45 3.55-1.65 4.65-3.35"})]})}function HXt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M6.2 20c.55-2.15.75-4.1.75-6.7V9.8A5.35 5.35 0 0 1 12.35 4c3.35 0 5.65 2.35 5.65 5.65v4.6c0 2.35.35 4.25 1.15 5.75"}),a.jsx("path",{d:"M8.05 10.2c1.35-.6 2.2-1.65 2.55-3.15.45 1.55 1.35 2.55 2.7 3.05.1-1 .4-1.95.85-2.75.45 1.25 1.2 2.2 2.15 2.75"}),a.jsx("path",{d:"M9.3 12.65h.01M14.9 12.65h.01M10.8 15.55c.8.5 1.65.5 2.45 0"}),a.jsx("path",{d:"M8.45 19.85c.95-.85 1.45-1.95 1.5-3.25M15.1 16.65c.05 1.2.55 2.3 1.55 3.2"})]})}function qXt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5.2 17.2V8.1a3 3 0 0 1 3-3h7.6a3 3 0 0 1 3 3v9.1"}),a.jsx("path",{d:"M7.4 17.2h9.2M9 19.9h6"}),a.jsx("path",{d:"M9.1 9.25h5.8M9.1 12h3.1"}),a.jsx("path",{d:"m14.1 12.4 2 2.1M16.2 12.4l-2.1 2.1"})]})}function pA({kind:e,...t}){return e==="codex"?a.jsx(zXt,{...t}):e==="deepseek-harness"?a.jsx(qXt,{...t}):e==="openclaw"?a.jsx(VXt,{...t}):a.jsx(HXt,{...t})}const WXt="data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20overflow='visible'%20style='display:%20block;'%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Icon%20Frame'%3e%3cpath%20id='Vector%208798'%20d='M5%205L15%2015'%20stroke='white'%20stroke-opacity='0.15'%20stroke-width='1.25'%20stroke-linecap='round'/%3e%3cpath%20id='Vector%208800'%20d='M15%205L5%2015'%20stroke='white'%20stroke-opacity='0.15'%20stroke-width='1.25'%20stroke-linecap='round'/%3e%3c/g%3e%3c/svg%3e";function d9e({title:e,topGlow:t=!0,children:n,footer:i,cancelLabel:r="Cancel",confirmLabel:s="Confirm",closeLabel:o="Close",onClose:l,onCancel:c,onConfirm:u,className:d="",...f}){const h=p.useId();return a.jsxs("div",{role:"dialog","aria-labelledby":h,...f,className:`studio-modal-layout ${t?"studio-modal-layout--glow":""} ${d}`.trim(),children:[a.jsxs("header",{className:"studio-modal-layout__header",children:[a.jsx("h3",{id:h,children:e}),a.jsx(Ci,{variant:"ghost",size:"compact",iconOnly:!0,className:"studio-modal-layout__close","aria-label":o,onClick:l,startIcon:a.jsx("img",{src:WXt,alt:""})})]}),a.jsx("div",{className:"studio-modal-layout__body",children:n}),i!==null&&a.jsx("footer",{className:"studio-modal-layout__footer",children:i===void 0?a.jsxs(a.Fragment,{children:[a.jsx(Ci,{variant:"outline",className:"studio-modal-layout__cancel",onClick:c,children:r}),a.jsx(Ci,{className:"studio-modal-layout__confirm",onClick:u,children:s})]}):i})]})}class f9e extends Error{constructor(t,n){super(n),this.status=t,this.name="MpaCreationRequestError"}}async function IL(e,t,n){const i=await fetch(Ta(`/web/mpa-creation/${e}`),{method:n===void 0?"GET":"POST",headers:ul(uc({"Content-Type":"application/json"})),body:n===void 0?void 0:JSON.stringify(n),signal:po(t,ho)});if(!i.ok){const r=await i.json().catch(()=>({}));throw new f9e(i.status,typeof r.detail=="string"?r.detail:`HTTP ${i.status}`)}return i.json()}const KXt=(e,t)=>IL(`config?region=${encodeURIComponent(e)}`,t),GXt=(e,t)=>IL("tasks",t,e),XXt=(e,t)=>IL(`tasks/${encodeURIComponent(e)}`,t),YXt=(e,t)=>IL(`tasks/${encodeURIComponent(e)}/cancel`,t,{}),ZXt=/^[A-Za-z0-9_-]+$/,h9e=4,DP=64,MP=6,Woe="agent-runtime";function p9e(e){const t=e.trim();if(!t)return Woe;let n=t.replace(/[^A-Za-z0-9_-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").slice(0,DP);return n?(n.lengthXt(`validation.runtimeName.${n}`)){return e?ZXt.test(e)?e.lengthDP?t("length"):null:t("characters"):t("required")}function tYt(e="",t=""){const n=e.trim(),i=t.trim();return!n&&!i||n.length<=255&&/^[A-Za-z0-9][A-Za-z0-9.-]*$/.test(n)&&!n.includes("..")&&/^[0-9]{1,5}$/.test(i)&&Number(i)>=1&&Number(i)<=65535}function nYt(e="",t="",n=""){const i=e.trim(),r=t.trim();if(!i&&!r&&!n)return!0;if(!i||!r||!n.trim()||i.length>1024||/\s/.test(i)||i.replace(/^https:\/\//,"").split("/",1)[0].includes(":"))return!1;try{const o=new URL(i);return o.protocol==="https:"&&!!o.hostname&&!o.username&&!o.password&&!o.port&&!o.search&&!o.hash&&r.length<=128&&/^ov-[a-zA-Z0-9_-]+$/.test(r)}catch{return!1}}const iYt="https://console.volcengine.com/aidap/region:aidap+cn-beijing/",rYt="https://console.volcengine.com/vikingdb/openviking/region:openviking+cn-beijing/ov-6689fabdf032294/context-management?accountId=default&userId=default&projectName=default";function m9e(e){return{region:e,requestId:crypto.randomUUID(),name:"",description:""}}function LP(e){return{...e,tosAccessKey:void 0,tosSecretKey:void 0}}function sYt(e){var t;try{const n=JSON.parse(sessionStorage.getItem(`mpa-create:${e}`)||"null");if(((t=n==null?void 0:n.input)==null?void 0:t.region)===e&&typeof n.input.requestId=="string"){if(n.submitted||n.taskId)return{...n,input:LP(n.input)};const i={...n.input,name:typeof n.input.name=="string"?n.input.name:""};return delete i.agentId,delete i.runtimeImage,delete i.workerImage,{...n,input:LP(i)}}}catch{}return{input:m9e(e)}}function aYt({region:e,onClose:t,onCreated:n}){var K,ie;const{t:i}=Te("ui"),r=J=>`myAgents.mpaCreate.${J}`,[s]=p.useState(()=>sYt(e)),[o,l]=p.useState(s.input),[c,u]=p.useState(""),[d,f]=p.useState(s.submitted||s.taskId?2:Math.min(2,Math.max(0,s.step??0))),[h,m]=p.useState(s.taskId),[g,b]=p.useState(!!(s.submitted||s.taskId)),[v,y]=p.useState(null),[w,x]=p.useState(null),[O,k]=p.useState(!0),[S,C]=p.useState(!1),[E,j]=p.useState(""),[T,R]=p.useState(0),[A,N]=p.useState(!1),D=p.useRef(!1),I=p.useRef(!1),P=p.useRef(!0),_=p.useRef(null),L=p.useRef(n);L.current=n;const F=(v==null?void 0:v.state)==="running"||(v==null?void 0:v.state)==="cancelling",V=g&&o.name===void 0&&!!o.agentId?null:lv((o.name??"").trim(),J=>i(`validation.runtimeName.${J}`,{ns:"create"})),q=!V,U=(w==null?void 0:w.postgresMode)==="auto",Z=U?!o.pgHost&&!o.pgPort:tYt(o.pgHost,o.pgPort),z=nYt(o.openvikingUrl,o.openvikingResourceId,c),ee=[o.tosAccessKey,o.tosSecretKey,o.tosBucket].map(J=>(J==null?void 0:J.trim())??""),ne=ee.every(Boolean)||ee.every(J=>!J),W=S||g&&(!v||F||v.state==="succeeded");p.useEffect(()=>{if(!(g||h))try{sessionStorage.setItem(`mpa-create:${e}`,JSON.stringify({input:LP(o),step:d}))}catch{}},[o,d,e,g,h]);function X(J){try{sessionStorage.setItem(`mpa-create:${e}`,JSON.stringify({input:LP(o),taskId:J,submitted:!0,step:2}))}catch{}}p.useEffect(()=>(P.current=!0,()=>{var J;P.current=!1,(J=_.current)==null||J.abort()}),[]),p.useEffect(()=>{const J=new AbortController;return k(!0),KXt(e,J.signal).then(ye=>{J.signal.aborted||(x(ye),ye.configured&&!s.submitted&&!s.taskId&&!D.current&&l(de=>({...de,pgHost:ye.postgresMode==="auto"?"":de.pgHost??ye.pgHost??"",pgPort:ye.postgresMode==="auto"?"":de.pgPort??ye.pgPort??""})))}).catch(()=>{J.signal.aborted||j(i(r("loadFailed")))}).finally(()=>{J.signal.aborted||k(!1)}),()=>J.abort()},[e,T,i]),p.useEffect(()=>{if(!h)return;const J=new AbortController;let ye;async function de(){try{const ge=await XXt(h,J.signal);if(J.signal.aborted)return;if(y(ge),j(""),ge.state==="succeeded"&&!I.current){I.current=!0;try{sessionStorage.removeItem(`mpa-create:${e}`)}catch{}L.current()}if(ge.state!=="running"&&ge.state!=="cancelling")return}catch{if(J.signal.aborted)return;j(i(r("pollFailed")))}ye=setTimeout(de,2e3)}return de(),()=>{J.abort(),clearTimeout(ye)}},[h,e,T,i]);async function H(){if(D.current||!(w!=null&&w.configured)||!q||!Z||!z||!ne||d!==2||F||(v==null?void 0:v.state)==="succeeded")return;D.current=!0,C(!0),b(!0),j(""),X(h);const J=new AbortController;_.current=J;try{const ye=await GXt({...o,...o.name===void 0?{}:{name:o.name.trim()},openvikingApiKey:c},J.signal);if(!P.current||J.signal.aborted)return;X(ye.taskId),m(ye.taskId),y(ye),R(de=>de+1)}catch(ye){P.current&&!J.signal.aborted&&(ye instanceof f9e&&(ye.status===400||ye.status===422)&&b(!1),j(ye instanceof Error?ye.message:i(r("creationFailed"))))}finally{D.current=!1,P.current&&C(!1)}}async function ae(){if(!h||D.current)return;N(!1),D.current=!0,C(!0);const J=new AbortController;_.current=J;try{const ye=await YXt(h,J.signal);P.current&&!J.signal.aborted&&y(ye)}catch{P.current&&!J.signal.aborted&&j(i(r("cancelFailed")))}finally{D.current=!1,P.current&&C(!1)}}function Y(){const J={...m9e(e),pgHost:U?"":(w==null?void 0:w.pgHost)??"",pgPort:U?"":(w==null?void 0:w.pgPort)??""};try{sessionStorage.setItem(`mpa-create:${e}`,JSON.stringify({input:J,step:0}))}catch{}l(J),u(""),f(0),m(void 0),b(!1),y(null),j(""),N(!1),I.current=!1}return a.jsx(a.Fragment,{children:a.jsx(av,{open:!0,onOpenChange:J=>{!J&&!S&&(A?N(!1):t())},children:a.jsxs(sv,{children:[a.jsx(iv,{className:"studio-modal-button__backdrop mpa-create-backdrop"}),a.jsx(rv,{className:"mpa-create-popup","aria-label":i(r("title")),children:a.jsx(d9e,{className:"mpa-create-dialog",title:i(r("title")),topGlow:!1,footer:null,onClose:()=>{S||t()},closeLabel:i(r("close")),children:a.jsxs("div",{className:"mpa-create-body",children:[a.jsx("ol",{className:"mpa-create-steps","aria-label":i(r("stepsLabel")),children:["basics","postgres","openviking"].map((J,ye)=>a.jsx("li",{"aria-current":d===ye?"step":void 0,children:a.jsxs("button",{type:"button",disabled:S||ye>d&&!g&&(!q||ye===2&&!Z),onClick:()=>f(ye),children:[a.jsx("span",{children:ye+1}),i(r(`steps.${J==="postgres"&&U?"autoPostgres":J}`))]})},J))}),d===0&&a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:[i(r("region")),":",e]}),a.jsxs("label",{children:[i(r("name")),a.jsx("input",{name:"name",placeholder:i(r("namePlaceholder")),value:o.name??o.agentId??"",maxLength:64,disabled:S||g,required:!0,autoComplete:"off","aria-invalid":!!V,"aria-describedby":"mpa-name-help",onChange:J=>l({...o,name:J.target.value})}),a.jsx("p",{id:"mpa-name-help",role:V?"alert":void 0,children:V||i(r("nameHelp"))})]}),a.jsxs("label",{children:[i(r("description")),a.jsx(CIe,{className:"mpa-create-description",value:o.description,maxLength:512,disabled:S||g,onChange:J=>l({...o,description:J.target.value})})]}),a.jsxs("section",{className:"mpa-create-plan","aria-label":i(r("plan")),children:[a.jsx("strong",{children:i(r("plan"))}),a.jsxs("ul",{children:[a.jsx("li",{children:i(r("sharedResources"))}),a.jsx("li",{children:i(r("agentResources"))}),a.jsx("li",{children:i(r("readiness"))})]})]})]}),d===1&&a.jsxs(a.Fragment,{children:[a.jsx("p",{children:i(r(U?"pgAutoDescription":(w==null?void 0:w.postgresLayout)==="split-workspaces"?"pgSplitDescription":"pgDescription"))}),a.jsx("a",{href:iYt,target:"_blank",rel:"noopener noreferrer",children:i(r("pgConsole"))}),!U&&a.jsxs(a.Fragment,{children:[a.jsxs("label",{children:[i(r("pgHost")),a.jsx("input",{name:"pgHost",value:o.pgHost??"",maxLength:255,disabled:S||g,"aria-invalid":!Z,onChange:J=>l(ye=>({...ye,pgHost:J.target.value}))})]}),a.jsxs("label",{children:[i(r("pgPort")),a.jsx("input",{name:"pgPort",value:o.pgPort??"",inputMode:"numeric",maxLength:5,disabled:S||g,"aria-invalid":!Z,onChange:J=>l(ye=>({...ye,pgPort:J.target.value}))})]}),!Z&&a.jsx("p",{role:"alert",children:i(r("pgInvalid"))}),a.jsx("p",{children:i(r("pgCredentials"))})]})]}),d===2&&a.jsxs(a.Fragment,{children:[a.jsx("p",{children:i(r("openvikingDescription"))}),a.jsx("a",{href:rYt,target:"_blank",rel:"noopener noreferrer",children:i(r("openvikingConsole"))}),a.jsxs("label",{children:[i(r("openvikingUrl")),a.jsx("input",{name:"openvikingUrl",value:o.openvikingUrl??"",maxLength:1024,disabled:S||g,autoComplete:"off",spellCheck:!1,"aria-invalid":!z,onChange:J=>l(ye=>({...ye,openvikingUrl:J.target.value}))})]}),a.jsxs("label",{children:[i(r("openvikingResourceId")),a.jsx("input",{name:"openvikingResourceId",value:o.openvikingResourceId??"",maxLength:128,disabled:S||g,autoComplete:"off",spellCheck:!1,"aria-invalid":!z,onChange:J=>l(ye=>({...ye,openvikingResourceId:J.target.value}))})]}),a.jsxs("label",{children:[i(r("openvikingApiKey")),a.jsx("input",{type:"password",name:"openvikingApiKey",value:c,maxLength:512,disabled:S||F||(v==null?void 0:v.state)==="succeeded",autoComplete:"off",spellCheck:!1,onChange:J=>u(J.target.value)})]}),!z&&a.jsx("p",{role:"alert",children:i(r("openvikingInvalid"))}),a.jsx("p",{children:i(r("openvikingCredentials"))}),a.jsxs("fieldset",{className:"mpa-create-tos",children:[a.jsx("legend",{children:i(r("tosTitle"))}),a.jsx("p",{children:i(r("tosDescription"))}),["tosAccessKey","tosSecretKey","tosBucket"].map(J=>a.jsxs("label",{children:[i(r(J)),a.jsx("input",{name:J,type:J==="tosBucket"?"text":"password",value:o[J]??"",maxLength:256,disabled:W,autoComplete:J==="tosBucket"?"off":"new-password",spellCheck:!1,"aria-invalid":!ne,onChange:ye=>l(de=>({...de,[J]:ye.target.value}))})]},J)),!ne&&a.jsx("p",{role:"alert",children:i(r("tosInvalid"))}),a.jsx("p",{children:i(r("tosCredentials"))})]})]}),O?a.jsx("p",{role:"status",children:i(r("checking"))}):w!=null&&w.configured?a.jsx("p",{children:i(r("configured"))}):a.jsxs("div",{role:"alert",children:[a.jsx("p",{children:i(r("notConfigured"))}),a.jsx("p",{children:w!=null&&w.postgresMigrationRequired?i(r("pgMigrationRequired")):w==null?void 0:w.error}),a.jsx(Ci,{variant:"outline",onClick:()=>R(J=>J+1),children:i(r("reload"))})]}),v&&a.jsxs("section",{"aria-live":"polite",children:[a.jsx("strong",{children:i(r(`states.${v.state}`))}),v.state!=="succeeded"&&a.jsx("p",{children:i(r(`stages.${v.stage}`),{defaultValue:v.stage})}),v.state==="failed"||v.state==="cancelled"?a.jsx("p",{children:i(r(v.error||"creationFailed"))}):null,((K=v.result)==null?void 0:K.runtime_id)&&a.jsxs("p",{children:["Runtime ID:",v.result.runtime_id]}),((ie=v.result)==null?void 0:ie.skill_space_id)&&a.jsxs("p",{children:[i(r("skillSpace")),":",v.result.skill_space_id]})]}),U&&!Z&&a.jsx("p",{role:"alert",children:i(r("pgModeChanged"))}),E&&a.jsx("p",{role:"alert",children:E}),F&&a.jsx("p",{children:i(r("background"))}),g&&a.jsx("p",{children:i(r("newAgentDescription"))}),A?a.jsxs("section",{role:"alertdialog","aria-label":i(r("cancel")),className:"mpa-create-plan",children:[a.jsx("p",{children:i(r("cancelDescription"))}),a.jsxs("div",{className:"mpa-create-actions",children:[a.jsx(Ci,{autoFocus:!0,variant:"outline",onClick:()=>N(!1),children:i(r("back"))}),a.jsx(Ci,{onClick:()=>void ae(),children:i(r("confirmCancel"))})]})]}):a.jsxs("div",{className:"mpa-create-actions",children:[a.jsx(Ci,{variant:"outline",disabled:S,onClick:t,children:i(r("close"))}),g&&a.jsx(Ci,{variant:"outline",disabled:S||O,onClick:Y,children:i(r("newAgent"))}),d>0&&a.jsx(Ci,{variant:"outline",disabled:S,onClick:()=>f(J=>J-1),children:i(r("previousStep"))}),F?a.jsx(Ci,{variant:"outline",disabled:S||(v==null?void 0:v.state)==="cancelling",onClick:()=>N(!0),children:i(r("cancel"))}):(v==null?void 0:v.state)!=="succeeded"&&d<2?a.jsx(Ci,{disabled:S||d===0&&!q||d===1&&!Z,onClick:()=>f(J=>J+1),children:i(r("next"))}):(v==null?void 0:v.state)!=="succeeded"?a.jsx(Ci,{loading:S,disabled:O||!(w!=null&&w.configured)||!q||!Z||!z||!ne,onClick:()=>void H(),children:i(r(v?"retry":"submit"))}):null]})]})})})]})})})}const oYt=["general","mpa","codex","deepseek-harness","openclaw","hermes"];function lYt(e){return e!=="general"&&e!=="mpa"}const cYt=24,uYt=3e4,dYt=7e3,fYt=2e4,hYt=6,pYt=2,mYt=250,kg=new Map,Tw=new Map,gYt=new Set;function ny(e){const t=e.runtime;return t?`${t.region}:${t.runtimeId}:${t.currentVersion??""}`:""}function Koe(e,t){const n=e instanceof Error&&e.message.trim()?e.message.trim():t("myAgents.compatibility.unknownError");return{status:e instanceof Oa&&e.unsupported?"unsupported":"error",message:n}}function Jm(e){if(!e){kg.clear(),Tw.clear(),K8();return}const t=new Set(e);if(t.size!==0){for(const[n,i]of Tw)i.page.runtimes.some(r=>t.has(r.runtimeId))&&Tw.delete(n);for(const n of t)K8(n);kg.clear()}}function bYt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function yYt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M8.313 3.646a.5.5 0 0 1 .707 0l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 1 1-.707-.708L11.46 8.5H3.333a.5.5 0 0 1 0-1h8.127L8.313 4.354a.5.5 0 0 1 0-.708Z",fill:"currentColor"})})}function vYt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M2.75 5.25h8.75m0 0-2-2m2 2-2 2M13.25 10.75H4.5m0 0 2 2m-2-2 2-2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function xYt({type:e}){return e==="general"||e==="mpa"?a.jsx(Tp,{}):a.jsx(pA,{kind:e})}function wYt(e,t=Date.now(),n){const i=Date.parse(e);if(!Number.isFinite(i)||i-t<6e4)return n("myAgents.expiringSoon");const r=Math.ceil((i-t)/6e4),s=Math.floor(r/60),o=r%60;return n("myAgents.sandboxRemaining",{hours:s,minutes:o})}function Goe(e,t,n="general"){var r;const i=e.agentCategory??n;return{id:e.runtimeId,name:e.name,description:((r=e.description)==null?void 0:r.trim())||t("common.noDescription"),createdAt:e.createdAt??"",specificationLabel:t("myAgents.creator"),specification:XMe(e.author),isMine:e.isMine,agentCategory:i,runtime:{runtimeId:e.runtimeId,mpaInstanceId:e.mpaInstanceId,region:e.region,currentVersion:e.currentVersion,agentCategory:e.agentCategory??n,canDelete:e.canDelete,canManage:e.canManage,canPublish:e.canPublish,visibility:e.visibility,reviewStatus:e.reviewStatus}}}function OYt(e,t){const n=MD(e.status);return{id:e.id,name:e.displayName||t("myAgents.namedAgent",{name:e.toolName}),description:t(`myAgents.sandboxStatus.${n}`,{defaultValue:t("myAgents.sandboxStatus.unknown")}),createdAt:e.createdAt,specificationLabel:t("myAgents.creator"),specification:XMe(e.createdBy),isMine:e.isMine,region:e.region,sandbox:e}}function kYt(e,t){var n,i;return{id:e.id,name:e.draft.name||t("agentSelector.unnamedAgent"),description:((n=e.draft.description)==null?void 0:n.trim())||t("common.noDescription"),createdAt:new Date(e.updatedAt).toISOString(),specificationLabel:t("myAgents.storageLocation"),specification:t("myAgents.currentBrowser"),isMine:!0,region:(i=e.deploymentTarget)==null?void 0:i.region,draft:e}}function SYt(e,t,n){if(!e.draft)return e;const i=e.draft.deploymentTarget;return i?t.find(r=>{var s;return((s=r.runtime)==null?void 0:s.runtimeId)===i.runtimeId&&r.runtime.region===i.region})??{id:i.runtimeId,appName:i.appName,name:i.name||e.name,description:e.description,createdAt:e.createdAt,specificationLabel:n("myAgents.region"),specification:i.region,isMine:!0,runtime:{runtimeId:i.runtimeId,mpaInstanceId:i.mpaInstanceId,region:i.region,currentVersion:i.currentVersion,canDelete:!1}}:null}function EYt(e,t){return e.trim()||Zi(t)}async function CYt(e,t,n,i,r,s,o){const l=`${e}:${t}:${n}:${i}`,c=Tw.get(l);if(c&&c.expiresAt>Date.now())return r(c.page.runtimes.map(f=>Goe(f,s,e))),c.page.nextToken;c&&Tw.delete(l);let u=kg.get(l);u||(u=UXt({agentCategory:e,scope:t,region:n,pageSize:cYt,nextToken:i,signal:o}),kg.set(l,u),u.then(()=>kg.delete(l),()=>kg.delete(l)));const d=await u;return Tw.set(l,{page:d,expiresAt:Date.now()+uYt}),r(d.runtimes.map(f=>Goe(f,s,e))),d.nextToken}function AYt({agent:e,onReview:t,onUse:n,onViewDetails:i,onPrepareUpdate:r,compatibility:s,onRetryCompatibility:o,connecting:l,connectError:c,connected:u,deploymentTask:d,nowMs:f,onViewDeploymentTask:h,onEditDraft:m,onDeleteDraft:g}){var R,A,N,D;const{t:b,i18n:v}=Te("ui"),y=(R=e.sandbox)==null?void 0:R.status.toLowerCase(),w=((A=e.sandbox)==null?void 0:A.resourceType)==="snapshot",x=!!(e.runtime||y==="ready"||y==="wakeable"),O=(s==null?void 0:s.status)==="checking",k=(s==null?void 0:s.status)==="unsupported",S=(s==null?void 0:s.status)==="error",C=((N=e.sandbox)==null?void 0:N.resourceType)==="snapshot"?e.sandbox.sourceSessionId||e.sandbox.snapshotId:(D=e.sandbox)==null?void 0:D.id,E=()=>{if(e.draft){d?h==null||h(d):i==null||i(e);return}!x&&!e.sandbox||(d?h==null||h(d):i==null||i(e))},j=(e.draft||x||!!e.sandbox)&&!!(d?h:i),T=e.draft?d?b("myAgents.viewDeploymentProgress",{name:e.name}):b("myAgents.viewRuntimeDetails",{name:e.name}):d?b("myAgents.viewDeploymentProgress",{name:e.name}):b("myAgents.viewDetails",{name:e.name});return a.jsxs(xH,{className:`my-agent-card${l?" is-connecting":""}${e.runtime?" has-review":""}`,activateLabel:j?T:void 0,onActivate:j?E:void 0,onPointerEnter:()=>r==null?void 0:r(e),onFocusCapture:()=>r==null?void 0:r(e),footer:a.jsxs("div",{className:"my-agent-card-footer",children:[a.jsx(ZIe,{className:"my-agent-meta",items:[{label:e.specificationLabel,value:e.specification,hideLabel:!0,className:"my-agent-region"},{label:b("myAgents.time"),value:BT(e.createdAt,f,v.resolvedLanguage??v.language),hideLabel:!0,className:"my-agent-created-at"},...e.sandbox?[{label:b("myAgents.remainingTime"),value:e.sandbox.resourceType==="snapshot"||e.sandbox.persistent?b("myAgents.neverExpires"):wYt(e.sandbox.expireAt,f,b),className:`my-agent-expiry${e.sandbox.resourceType==="snapshot"||e.sandbox.persistent?"":" is-expiring"}`}]:[]]}),e.runtime?a.jsxs("div",{className:"agent-review-card-controls",children:[a.jsx("span",{className:"agent-review-card-status",children:b(e.runtime.visibility==="enterprise"?"enterprise":"private",{ns:"agentReviews"})}),e.runtime.canManage?a.jsxs(AN,{className:"agent-review-card-action",onClick:I=>{I.stopPropagation(),t==null||t(e)},children:[b(e.runtime.reviewStatus?"details":e.runtime.canPublish?"publish":"submit",{ns:"agentReviews"}),e.runtime.reviewStatus?` · ${b(`status.${e.runtime.reviewStatus}`,{ns:"agentReviews"})}`:""]}):null]}):null]}),actions:e.draft?a.jsxs(a.Fragment,{children:[a.jsx(AN,{"aria-label":d?b("myAgents.viewDeploymentProgress",{name:e.name}):b("myAgents.editDraftNamed",{name:e.name}),onClick:()=>d?h==null?void 0:h(d):m==null?void 0:m(e.draft),children:b(d?"myAgents.viewProgress":"common.edit")}),a.jsx(AN,{tone:"danger","aria-label":b("myAgents.deleteDraftNamed",{name:e.name}),onClick:()=>g==null?void 0:g(e.draft),children:b("common.delete")})]}):S||k?a.jsxs(_t,{type:"button",color:"primary",size:"sm",pill:!1,"aria-label":b("myAgents.recheckCompatibility",{name:e.name}),onClick:()=>o==null?void 0:o(e),children:[a.jsx(JD,{}),b("common.retry")]}):a.jsx(LB,{className:u?"my-agent-use is-connected":"my-agent-use",disabled:!x||O||k||l||u,"aria-busy":l||void 0,label:u?b("myAgents.connectedNamed",{name:e.name}):w?b("myAgents.wakeAndChat",{name:e.name}):b("myAgents.chatWith",{name:e.name}),onClick:()=>void(n==null?void 0:n(e)),children:l?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"my-agent-use-spinner","aria-hidden":"true"}),a.jsx("span",{className:"sr-only",children:b(w?"myAgents.waking":"agentSelector.connecting")})]}):a.jsx(yYt,{})}),children:[a.jsx(wH,{leading:a.jsx(n1,{seed:e.name}),title:e.name,subtitle:e.sandbox?a.jsx("span",{className:"my-agent-session-id",title:C,children:C}):void 0,status:e.draft?d?a.jsx("span",{className:"my-agent-deploying-badge",children:b("myAgents.deploying")}):a.jsx("span",{className:"my-agent-draft-badge",children:b("myAgents.draft")}):e.sandbox?a.jsx("span",{className:"my-agent-status-label","data-ready":MD(e.sandbox.status)==="ready"||void 0,children:e.description}):e.runtime&&d?a.jsx("span",{className:"my-agent-deploying-badge",children:b("myAgents.deploying")}):O?a.jsx(ka,{content:s==null?void 0:s.message,contentClassName:"my-agent-compatibility-tooltip",maxWidth:360,align:"end",interactive:!0,preventUnintentionalClickToClose:!0,children:a.jsx("span",{className:"my-agent-compatibility-trigger",tabIndex:0,children:a.jsxs(Ya,{className:"my-agent-compatibility-status",color:"secondary",variant:"soft",size:"sm",pill:!0,children:[a.jsx("span",{className:"my-agent-compatibility-spinner","aria-hidden":"true"}),a.jsx("span",{children:b("myAgents.checking")})]})})}):k?a.jsx(ka,{content:s==null?void 0:s.message,contentClassName:"my-agent-compatibility-tooltip",maxWidth:360,align:"end",interactive:!0,preventUnintentionalClickToClose:!0,children:a.jsx("span",{className:"my-agent-compatibility-trigger",tabIndex:0,children:a.jsx(Ya,{className:"my-agent-compatibility-status",color:"warning",variant:"soft",size:"sm",pill:!0,children:b("myAgents.chatUnsupported")})})}):S?a.jsx(ka,{content:s==null?void 0:s.message,contentClassName:"my-agent-compatibility-tooltip",maxWidth:360,align:"end",interactive:!0,preventUnintentionalClickToClose:!0,children:a.jsx("span",{className:"my-agent-compatibility-trigger",tabIndex:0,children:a.jsx(Ya,{className:"my-agent-compatibility-status",color:"danger",variant:"soft",size:"sm",pill:!0,children:b("myAgents.checkFailed")})})}):null}),c?a.jsx(ka,{content:c,contentClassName:"my-agent-error-tooltip",maxWidth:360,interactive:!0,children:a.jsx("p",{className:"my-agent-wake-note",role:"alert",tabIndex:0,children:c})}):null,w&&l?a.jsx("p",{className:"my-agent-wake-note",role:"status",children:a.jsx(cn,{children:b("myAgents.wakingHint")})}):null,e.sandbox?null:a.jsx(OH,{children:e.description})]})}function TYt({cloudProvider:e,studioRegion:t,canCreateRuntimeAgents:n,canCreatePersonalAgents:i,canUpdate:r,runtimeScope:s,onCreateAgent:o,onOpenCodexProjectUpload:l,onUseAgent:c,onViewAgentDetails:u,onCreateSandboxAgent:d,onUseSandboxAgent:f,onViewSandboxAgentDetails:h,activeType:m,onActiveTypeChange:g,sandboxRefreshKey:b=0,connectedRuntimeId:v="",hiddenRuntimeIds:y=gYt,drafts:w=[],deploymentTasks:x=[],draftDeploymentTaskIds:O={},onViewDeploymentTask:k,onEditDraft:S,onDeleteDraft:C}){const{t:E}=Te("ui"),j=p.useRef(null),T=p.useRef(null),R=p.useRef(0),A=p.useRef(null),N=p.useRef(0),D=p.useRef(null),I=p.useRef(new Map),P=EYt(t,e),[_,L]=p.useState(null),[F,M]=p.useState(""),[V,q]=p.useState(s==="mine"?"mine":"all"),[U,Z]=p.useState(P),[z,ee]=p.useState(null),[ne,W]=p.useState([]),[X,H]=p.useState(""),[ae,Y]=p.useState(!0),[K,ie]=p.useState(""),[J,ye]=p.useState([]),[de,ge]=p.useState(!1),[Ee,xe]=p.useState(""),[Ne,We]=p.useState(""),[Xe,Re]=p.useState({}),[se,ce]=p.useState({}),[ve,Se]=p.useState(null),[oe,$e]=p.useState(()=>Date.now()),Ue=p.useMemo(()=>oYt.map(qe=>({value:qe,label:E(`myAgents.agentTypes.${qe}`)})),[E]),me=p.useMemo(()=>{const qe=ju(e);return qe.some(nt=>nt.value===P)?qe:[{value:P,label:P},...qe]},[e,P]);p.useEffect(()=>{s==="mine"&&q("mine")},[s]),p.useEffect(()=>{Z(P)},[P]),p.useEffect(()=>{$e(Date.now());const qe=window.setInterval(()=>$e(Date.now()),1e3);return()=>window.clearInterval(qe)},[]);const ke=p.useMemo(()=>w.map(qe=>kYt(qe,E)),[w,E]),Ae=p.useMemo(()=>{const qe=new Map,nt=new Map,et=new Map;for(const ft of x){if(ft.status!=="running")continue;if(qe.set(ft.id,ft),ft.draftId){const At=nt.get(ft.draftId);(!At||ft.startedAt>At.startedAt)&&nt.set(ft.draftId,ft)}if(!ft.runtimeId)continue;const Et=et.get(ft.runtimeId);(!Et||ft.startedAt>Et.startedAt)&&et.set(ft.runtimeId,ft)}return{byId:qe,byDraftId:nt,byRuntimeId:et}},[x]),He=p.useCallback(qe=>{var et;if(qe.draft){const ft=O[qe.draft.id];return Ae.byDraftId.get(qe.draft.id)??(ft?Ae.byId.get(ft):void 0)}const nt=(et=qe.runtime)==null?void 0:et.runtimeId;return nt?Ae.byRuntimeId.get(nt):void 0},[Ae,O]),Qe=p.useCallback((qe,nt)=>{var At;(At=A.current)==null||At.abort(),kg.clear();const et=new AbortController;A.current=et;const ft=++R.current;return Y(!0),ie(""),CYt(m==="mpa"?"mpa":"general",V,U,qe,It=>{R.current===ft&&W(Gt=>nt?It:[...Gt,...It])},E,et.signal).then(It=>{R.current===ft&&H(It)}).catch(It=>{R.current===ft&&(qoe(It)||ie(Cy(It,E("myAgents.loadGeneralAgents"),"GET /web/runtimes")))}).finally(()=>{R.current===ft&&Y(!1),A.current===et&&(A.current=null)})},[m,V,U,E]);p.useEffect(()=>{if(!(m!=="general"&&m!=="mpa"))return W([]),H(""),Qe("",!0),()=>{var qe;(qe=A.current)==null||qe.abort(),A.current=null,kg.clear(),R.current+=1}},[m,Qe]),p.useEffect(()=>{if(m!=="general"&&m!=="mpa"){for(const et of I.current.values())et.abort();I.current.clear();return}const qe=new Set(ne.filter(et=>{var ft,Et;return((ft=et.runtime)==null?void 0:ft.runtimeId)!==v&&((Et=et.runtime)==null?void 0:Et.region)===U}).map(ny).filter(Boolean));for(const[et,ft]of I.current)qe.has(et)||(ft.abort(),I.current.delete(et));const nt=ne.filter(et=>{var It,Gt,Ye;const ft=(It=et.runtime)==null?void 0:It.runtimeId;if(!ft||ft===v||((Gt=et.runtime)==null?void 0:Gt.region)!==U)return!1;const Et=ny(et),At=(Ye=se[Et])==null?void 0:Ye.status;return!I.current.has(Et)&&(!At||At==="checking")});for(const et of nt)I.current.set(ny(et),new AbortController);ce(et=>{var At,It;let ft=!1;const Et={...et};for(const Gt of ne){const Ye=ny(Gt);if(!Ye)continue;const wt=((At=Gt.runtime)==null?void 0:At.runtimeId)===v;wt&&((It=Et[Ye])==null?void 0:It.status)!=="compatible"?(Et[Ye]={status:"compatible",message:E("myAgents.compatibility.supported")},ft=!0):!wt&&!Et[Ye]&&(Et[Ye]={status:"checking",message:E("myAgents.compatibility.checking")},ft=!0)}return ft?Et:et}),QXt(nt,async et=>{const ft=et.runtime;if(!ft)return;const Et=ny(et),At=I.current.get(Et);if(At)try{const It=await Kw(ft.runtimeId,ft.region,{signal:At.signal,preferCached:!0,timeoutMs:dYt,currentVersion:ft.currentVersion});if(At.signal.aborted)return;ce(Gt=>({...Gt,[Et]:It&&It.length>0?{status:"compatible",message:E("myAgents.compatibility.supported")}:{status:"unsupported",message:E("myAgents.compatibility.empty")}}))}catch(It){if(At.signal.aborted||(It==null?void 0:It.name)==="AbortError")return;ce(Gt=>({...Gt,[Et]:Koe(It,E)}))}finally{I.current.get(Et)===At&&I.current.delete(Et)}})},[m,v,U,ne,E]),p.useEffect(()=>()=>{var qe;(qe=A.current)==null||qe.abort();for(const nt of I.current.values())nt.abort();I.current.clear()},[]);const jt=p.useCallback(async qe=>{var ft;(ft=D.current)==null||ft.abort();const nt=new AbortController;D.current=nt;const et=++N.current;ge(!0),xe(""),ye([]);try{const Et=qe==="codex"?await Br.listSessions({signal:nt.signal,autoResumeSnapshots:!1}):await Br.listAgentSessions(qe,{signal:nt.signal,autoResumeSnapshots:!1});if(N.current!==et)return;ye(Et.map(At=>OYt(At,E)))}catch(Et){if((Et==null?void 0:Et.name)==="AbortError"||N.current!==et)return;xe(Cy(Et,E("myAgents.loadAgentType",{type:E(`myAgents.agentTypes.${qe}`)}),`GET /web/${qe==="codex"?"sandbox":qe}/sessions`))}finally{D.current===nt&&(D.current=null),N.current===et&&ge(!1)}},[E]);function Pt(qe){var nt;qe!==m&&(qe==="general"||qe==="mpa"?(R.current+=1,W([]),H(""),ie(""),Y(!0)):((nt=D.current)==null||nt.abort(),D.current=null,N.current+=1,ye([]),xe(""),ge(!0)),g(qe))}function Kt(){m!=="general"&&m!=="mpa"||(R.current+=1,W([]),H(""),ie(""),Y(!0))}function Ct(qe){qe!==V&&(Kt(),q(qe))}function xt(qe){qe!==U&&(Kt(),Z(qe))}p.useEffect(()=>{var qe;if(m==="general"||m==="mpa"){(qe=D.current)==null||qe.abort(),D.current=null,N.current+=1;return}return jt(m),()=>{var nt;(nt=D.current)==null||nt.abort(),D.current=null,N.current+=1}},[m,jt,b]),p.useEffect(()=>{const qe=T.current,nt=j.current;if(!qe||!nt||m!=="general"&&m!=="mpa"||!X||ae)return;const et=new IntersectionObserver(([ft])=>{ft.isIntersecting&&Qe(X,!1)},{root:nt,rootMargin:"240px 0px",threshold:.01});return et.observe(qe),()=>et.disconnect()},[m,Qe,ae,X]);const tt=p.useCallback(async qe=>{if(!Ne){We(qe.id),Re(nt=>({...nt,[qe.id]:""}));try{await new Promise(nt=>requestAnimationFrame(()=>nt())),qe.sandbox?await f(qe.sandbox):await c(qe)}catch(nt){Re(et=>({...et,[qe.id]:nt instanceof Error?nt.message:String(nt)}))}finally{We("")}}},[Ne,c,f]),mt=p.useCallback(async qe=>{var Et;const nt=qe.runtime;if(!nt)return;const et=ny(qe);ce(At=>({...At,[et]:{status:"checking",message:E("myAgents.compatibility.checking")}})),(Et=I.current.get(et))==null||Et.abort();const ft=new AbortController;I.current.set(et,ft);try{const At=await u9e(()=>Kw(nt.runtimeId,nt.region,{retryProbe:!0,signal:ft.signal,timeoutMs:fYt,currentVersion:nt.currentVersion}));if(ft.signal.aborted)return;ce(It=>({...It,[et]:At&&At.length>0?{status:"compatible",message:E("myAgents.compatibility.supported")}:{status:"unsupported",message:E("myAgents.compatibility.empty")}}))}catch(At){if(ft.signal.aborted||qoe(At))return;ce(It=>({...It,[et]:Koe(At,E)}))}finally{I.current.get(et)===ft&&I.current.delete(et)}},[E]),_e=p.useCallback(qe=>{const nt=qe.runtime;!r||!nt||He(qe)||W8({runtimeId:nt.runtimeId,region:nt.region,appName:qe.appName,currentVersion:nt.currentVersion})},[r,He]),Ot=p.useMemo(()=>{const qe=F.trim().toLocaleLowerCase(),nt=m==="general"||m==="mpa"?[...ke,...ne]:J,ft=(V==="mine"?nt.filter(Gt=>Gt.isMine):nt).filter(Gt=>{var wt;const Ye=((wt=Gt.runtime)==null?void 0:wt.region)??Gt.region;return!Ye||Ye===U}),Et=qe?ft.filter(Gt=>Gt.name.toLocaleLowerCase().includes(qe)):ft;if(m!=="general"&&m!=="mpa")return Et;const At=y.size>0?Et.filter(Gt=>!Gt.runtime||!y.has(Gt.runtime.runtimeId)):Et,It=At.findIndex(Gt=>{var Ye;return((Ye=Gt.runtime)==null?void 0:Ye.runtimeId)===v});return It<=0?At:[At[It],...At.slice(0,It),...At.slice(It+1)]},[m,v,ke,y,F,V,U,ne,J]);p.useEffect(()=>{if(!r||m!=="general"&&m!=="mpa")return;const qe=Ot.filter(At=>!!At.runtime).filter(At=>!He(At)).slice(0,hYt);if(qe.length===0)return;let nt=!1,et=0;const ft=async()=>{for(;!nt;){const At=qe[et];if(et+=1,!(At!=null&&At.runtime)||(await W8({runtimeId:At.runtime.runtimeId,region:At.runtime.region,appName:At.appName,currentVersion:At.runtime.currentVersion}),nt))return}},Et=window.setTimeout(()=>{for(let At=0;At{nt=!0,window.clearTimeout(Et)}},[m,r,He,Ot]);const Nt=E(`myAgents.agentTypes.${m}`,{defaultValue:E("myAgents.agent")}),Yt=m==="general"||m==="mpa"?ae&&ne.length===0&&ke.length===0:de&&J.length===0,xn=!Yt&&Ot.length===0;let Ke;m==="general"&&n?Ke=()=>o(U,"general"):m==="mpa"&&n&&e==="volcengine"?Ke=()=>ee(U):lYt(m)&&i&&(Ke=()=>d(m));const St=m==="codex"&&i&&!!l;return a.jsxs(Sh,{className:"my-agents-page","aria-label":E("myAgents.agent"),children:[a.jsx(W0,{title:E("myAgents.agent"),className:"my-agents-header"}),a.jsxs(ab,{className:"my-agent-toolbar",children:[a.jsx(ob,{idPrefix:"my-agent-ownership",ariaLabel:E("myAgents.creatorFilter"),value:V,items:[{id:"all",label:E("common.all"),disabled:s==="mine"},{id:"mine",label:E("agentSelector.createdByMe")}],onChange:Ct}),a.jsxs("div",{className:"resource-toolbar__actions",children:[a.jsx(lb,{id:"my-agent-type-filter",ariaLabel:E("myAgents.agentType"),value:m,options:Ue,onChange:Pt}),a.jsx(lb,{id:"my-agent-region-filter",ariaLabel:E("myAgents.region"),value:U,options:me,onChange:xt}),a.jsx(Jp,{className:"my-agent-search","aria-label":E("myAgents.searchAgents"),value:F,onChange:qe=>M(qe.target.value),placeholder:E("common.search")}),St?a.jsxs("button",{type:"button",className:"my-agent-create-secondary",onClick:l,children:[a.jsx(vYt,{}),a.jsx("span",{children:E("myAgents.handoff")})]}):null]})]}),a.jsxs(em,{className:"my-agent-results",ref:j,"aria-label":E("myAgents.agentList",{type:Nt}),children:[Yt?a.jsx(cl,{}):(m==="general"||m==="mpa"?K:Ee)&&Ot.length===0?a.jsxs("div",{className:"my-agent-empty",role:"alert",children:[a.jsx("p",{children:m==="general"||m==="mpa"?K:Ee}),a.jsx("button",{type:"button",onClick:()=>{m==="general"||m==="mpa"?Qe("",!0):jt(m)},children:E("common.reload")})]}):xn&&!Ke?F.trim()||V==="mine"||U!==P?a.jsx("div",{className:"my-agent-empty-message",children:a.jsxs(Wn,{fill:"none",children:[a.jsx(Wn.Icon,{children:a.jsx(aat,{})}),a.jsx(Wn.Title,{children:E("myAgents.noMatchingAgents")}),a.jsx(Wn.Description,{children:E("myAgents.adjustSearch")})]})}):m!=="general"?a.jsx("div",{className:"my-agent-empty-message",children:a.jsxs(Wn,{fill:"none",children:[a.jsx(Wn.Icon,{children:a.jsx(xYt,{type:m})}),a.jsx(Wn.Title,{className:"my-agent-sandbox-empty-title",children:E("myAgents.noAgentType",{type:Nt})})]})}):a.jsx("div",{className:"my-agent-empty-message",children:a.jsxs(Wn,{fill:"none",children:[a.jsx(Wn.Icon,{children:a.jsx(Tp,{})}),a.jsx(Wn.Title,{children:E("myAgents.noGeneralAgents")}),a.jsx(Wn.Description,{children:E("myAgents.createGeneralAgentDescription")})]})}):a.jsxs(a.Fragment,{children:[(m==="general"||m==="mpa")&&K?a.jsxs("div",{className:"my-agent-inline-error",role:"alert",children:[a.jsx("span",{children:K}),a.jsx("button",{type:"button",onClick:()=>void Qe("",!0),children:E("common.reload")})]}):null,a.jsxs(K0,{className:"my-agent-grid",children:[Ke?a.jsx(cb,{className:"my-agent-create-card","aria-label":E("myAgents.createAgentType",{type:Nt}),onClick:Ke,icon:a.jsx(bYt,{}),children:E(m==="mpa"?"myAgents.mpaCreate.title":"myAgents.createAgent")}):null,Ot.map(qe=>{var et,ft,Et,At,It;const nt=SYt(qe,ne,E);return a.jsx(AYt,{agent:qe,onReview:L,deploymentTask:He(qe),nowMs:oe,onViewDeploymentTask:k,onUse:tt,compatibility:qe.runtime?se[ny(qe)]??{status:"checking",message:E("myAgents.compatibility.checking")}:void 0,onRetryCompatibility:mt,onPrepareUpdate:((et=qe.runtime)==null?void 0:et.canManage)===!1||((ft=qe.runtime)==null?void 0:ft.visibility)==="enterprise"||((Et=qe.runtime)==null?void 0:Et.reviewStatus)==="pending"?void 0:_e,onViewDetails:nt&&((At=qe.runtime)==null?void 0:At.canManage)!==!1?()=>{nt.sandbox?h(nt.sandbox):u(nt)}:void 0,connecting:qe.id===Ne,connectError:Xe[qe.id],connected:((It=qe.runtime)==null?void 0:It.runtimeId)===v,onEditDraft:S,onDeleteDraft:Se},qe.id)})]})]}),(m==="general"||m==="mpa")&&!K&&!Yt&&(Ot.length>0||!!X)&&a.jsx("div",{className:"my-agent-load-more",ref:T,"aria-live":"polite",children:ae?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),a.jsx("span",{children:E("myAgents.loadingMore")})]}):X?a.jsx("span",{children:E("myAgents.scrollForMore")}):a.jsx("span",{children:E("myAgents.allLoaded")})})]}),z&&a.jsx(aYt,{region:z,onClose:()=>ee(null),onCreated:()=>{Jm(),U===z&&m==="mpa"&&Qe("",!0)}},z),_!=null&&_.runtime?a.jsx(c9e,{runtimeId:_.runtime.runtimeId,region:_.runtime.region,name:_.name,canPublish:_.runtime.canPublish===!0,onClose:()=>L(null),onChanged:()=>{Jm(),Qe("",!0)}},`${_.runtime.region}:${_.runtime.runtimeId}`):null,ve?a.jsx(Td,{title:E("myAgents.deleteDraftTitle"),description:E("myAgents.deleteDraftDescription",{name:ve.draft.name||E("agentSelector.unnamedAgent")}),confirmLabel:E("myAgents.deleteDraft"),variant:"danger",onCancel:()=>Se(null),onConfirm:()=>{C==null||C(ve),Se(null)}}):null]})}function bK({section:e,onWorkspace:t,onEnvironment:n,onProjects:i,actions:r,children:s,className:o=""}){const{t:l}=Te("ui"),c=l(e==="workspaces"?"workspace.title":e==="environments"?"common.environment":"workspace.codeProjects");return a.jsxs(Sh,{className:`workspace-center ${o}`,"aria-label":c,children:[a.jsx(W0,{title:c}),a.jsxs(ab,{children:[(t||n)&&a.jsx(ob,{items:[{id:"workspaces",label:l("workspace.title")},{id:"environments",label:l("common.environment")},...i?[{id:"projects",label:l("workspace.codeProjects")}]:[]],value:e,onChange:u=>{u==="workspaces"&&(t==null||t()),u==="environments"&&(n==null||n()),u==="projects"&&(i==null||i())},ariaLabel:l("workspace.resourceType"),idPrefix:"workspace-center"}),a.jsx("div",{className:"resource-toolbar__actions",children:r})]}),s]})}const _Yt="_Container_13560_1",jYt="_Textarea_13560_174",Xoe={Container:_Yt,Textarea:jYt},xb=e=>{const t=p.useRef(null),i=`search-ui-input-${p.useId()}`,{id:r,name:s,variant:o="outline",size:l="md",gutterSize:c,className:u,autoComplete:d,disabled:f=!1,readOnly:h=!1,invalid:m=!1,allowAutofillExtensions:g=!!s,onFocus:b,onBlur:v,onAnimationStart:y,onAutofill:w,autoSelect:x,rows:O=3,maxRows:k,autoResize:S,ref:C,onChange:E,...j}=e,[T,R]=p.useState(!1),A=S?Math.max(k??10,O):O;p.useEffect(()=>{var I;x&&((I=t.current)==null||I.select())},[x]);const N=I=>{y==null||y(I),I.animationName==="native-autofill-in"&&(w==null||w())},D=p.useCallback(()=>{if(!S||!t.current||A===void 0)return;t.current.style.height="0px";const I=t.current.scrollHeight;t.current.style.height=I+"px"},[S,A]);return p.useEffect(()=>{D()},[e.value,O,D]),a.jsx("div",{className:Qi(Xoe.Container,u),"data-variant":o,"data-size":l,"data-gutter-size":c,"data-focused":T,"data-disabled":f?"":void 0,"data-readonly":h?"":void 0,"data-invalid":m?"":void 0,style:V0({"textarea-min-rows":`${O}`,"textarea-max-rows":`${A}`}),children:a.jsx("textarea",{...j,onChange:I=>{E==null||E(I),D()},ref:tT([t,C]),id:r||(g?void 0:i),className:Xoe.Textarea,name:s,readOnly:h,disabled:f,rows:O,onFocus:I=>{R(!0),b==null||b(I)},onBlur:I=>{R(!1),v==null||v(I)},onAnimationStart:N,"data-lpignore":g?void 0:!0,"data-1p-ignore":g?void 0:!0})})},PL="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2048%2048'%3e%3cimage%20width='48'%20height='48'%20href='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAMKADAAQAAAABAAAAMAAAAADbN2wMAAAH7UlEQVRoBdVZWWwbVRQ9492Onc1xTfaWLukq9oSqLKnYBZRSNgn6AagsAgmJRfzxg4SEEDtiER8IBKKAChK0FS1tKYWW0lZQKKV0gxCVJm3ikDiO17EdzrUzSdw4jj1OpeQqNzO237vvnHfvu/e9GWVwcBBDYue1mrqE2kI1UqeSJAnmIHUzNUCNUmGiKtQy6oPUR6geqnw/FSVOUH9R36KupfaDHnBQn6MGqEnqVJcEAfZTBbNL4b+lZPI1VbwwnaSfYO8z8N+TVMd0Qj6EVdbs3eIBP29cVFkL00kk+wSEwHAamgh9bDAJSQWTITZFnF+85J1tBPyOUC9OqqnsVdTIRkVBi70Msy125uriHJ8XAXFRfzKBTQM+rO0/hc54cSQE8iyzAx/XLcEltjIU44uCQijOaHvPfxIv97TjWCzEcMo7+sZ4TGa+2V6KT2rPQ73ZptsPBZE30fVrymvxTvUCtDoqYC0ijhMk/3MkgDd62xFheOqVggjIIAbOVaujEh/ULsaNzioUsxhVAv/A34GD0YBubxZMQJupWpMNr58zHytcHth1ekICsDcRx4u+fxBK6vOCbgKyEIXEK975WOmaoZuErKv1QR8ORQd0eUE3Ac0TNSYrXvI24fZSLxwGfebiDKW3e08gln9J0oYvKoMNG6kmiRdmzMOtTi8sOsJJJfANA93oiseGbeZ7k1EHZAKCEcApu4wCxUsSz3rm4HQiim3B/wpOsBJA2yP/4cZIJYIBFcGwCjWeSKEwm4wosZtR7rKizGXJQJZRB1TuttftAprnAbOrM9rl9UHqwg+s1o+eOow/GNN5CaPOklSgdKq4us+Ji7pt6Dw1AF9vBOGImjJht5lRVWFDY7UL58/3wOt2YPEcN2xWVpPRe6EQC+y9rwINPNKsuRaYX5cXhIxGkks+Y7V+6vQRdLBi5yx1bGwicFebivj+ARgOhZGMJMFyQyWpoV2GRIa2ZXOX2bDyqnPxzEPNKC+1Zj957eDBTbz34PXAwvoMfBN+kGV8Bxf00VgQz/vaEB6nSCnRQVj2h2DZG4TyZwQWlSils3m8RDDEhk2uaqlHaYklVb3Ha42dh4B3eMzZ//eEmMc0kGL3cEU9WksqU4XvzAYKZ9n6fQCOz3thORCGkhgCf2bDMz4bjQpW39yE65Y1QO5FxiUgP+76E3hzI7D1VyBcwP5NTFcZzXjaPRMNZmvGPkfA23YMwLHRD0Mf3ZwTgaBIi8GgYMGsSjx2z3kEP9Jp5E5rOeoqQH75C3htPfDpD4CskXxFvHC5vQKPVjSwPqQfcKTAfxuA/Ws/lBAXwEhUTGjWSAL3r1qYykSju+UkIFbZDx09wPvb0iH1W9uEYw03MHAV3ltew1CqgDkyCNtWgt/cnwY/3GriG5n9hbMrccNljRmzLz0nJCCNJBsEwsCH24E3NgDr96brhfyWS2Sm3EYLVsOL0i0DsG8h+LDkqcLExHhfc9siVDDrjJ59sZJRyHKZFRKybiSkTtIjR08CrXwEdtGcXL2A4+192LOuDeatfqg6wMvsL5lbhWuWysIdO995E9BgSkh19THX7wQOtANXLgKWLQSaarUWI9dNP7bjo68OY9uef6GqhcW8ZkViX2a/nBWYQ4+RggmIBfFGnHgOcD0c7wD2HgOW0xuXk0xN5SDaOwL4cnsb1m05joPHejKK0hgEOb4Q8Muba3H1pXUwZZl96aqLgHSU2RCbEe6/9hzh875OYPdhYF5NDLt/Oohd+46gNxBjm2zzJhZyi/RyV5TggdsvRJnTOm5j3QQ0i9ra6OHj1u9+B/YdNcLXVQdDmYNPy9oZ971IcIPHjUHadVrHHFfZNphtTtx508W4eJEHsg7Gk6IJaIZlDEn3EdUEl7sBg4la2MtqkYgNIOz/F9FgF6IhX6p5mozcjgbGasw/xWCCs7IeN7U24b4VddwZj26jjTZynTQCmknxSBqIETanh7ceWEpmpIiokT7E6JFosBvxaD/iJCeNDQYzTFYnzHY3SsobmfM9eOyucjTO0KyOf510AqOHkl2kiMlSQoAlsPLAk4hHSCaIJMMqmUgfYBQeggxGK4xmOxprXHh8lYK51em+E/0/qwQyBh8iY+Q52pjlOZD8XFcFPHELcGlT3stlbBaymtOROTReBoZJ+0DjZ9pv4SFq9fL0YWqcjJl1+AwP8OSGS+amq6y4P/fyyWqvoC9lDAG7ainPEJcBs7xMBGOLbU6bGQTMJHAnDUlG2biPFZevEM4GCZl9sSsnPgG+bAHfa+l8vZJxpNSo+oPp/c4XP6bPBN0kog2qtdFz1WzIkfXmZuAKVm6JewlbvZKVgGZMilMPwW9ngdr5B3CEG7iEbCY5ffl6RgPtYDGdybS4ogW4YDbgLefTD5s2kv5rTgKaWdlKi1fau4BDJ3jM5I70NDd0J7grzfZEUMg5CM5Tmg4TiW3ZtVYxTKpcgM2iWS7+mhcBbRiZ/TBTd4jPjtSEVF3AxxdUPgkxTrUUMTcBykKUmLZwhQlYPhWBeCBV5DRjk3QtiEC2McUDsjPVCEhWEQ8Umk2y2c7nOyEwrV/ySdbdQo3nw3aKtRHM3wiBtVQu02knISJ+SQh8Q32TyqTJJ6xTXyQzyzb2LeoBWQOy5pjwcDf1YSqzNIooLex99kTCppsq4N+l+oUArylhoku9sb+O18VU8c5UEiZu7KGyrKKTmgr7/wGxhy03aZIycwAAAABJRU5ErkJggg=='%20/%3e%3c/svg%3e",NYt="data:image/svg+xml,%3c?xml%20version='1.0'?%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20100%20100'%3e%3ctitle%3ePandoc%20Icon%3c/title%3e%3cdesc%20property='dc:creator'%3eAlbert%20Krewinkel%3c/desc%3e%3cmetadata%20id='license'%20xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23'%20xmlns:dc='http://purl.org/dc/elements/1.1/'%20xmlns:cc='http://creativecommons.org/ns%23'%3e%3crdf:RDF%3e%3ccc:Work%20rdf:about=''%3e%3cdc:format%3eimage/svg+xml%3c/dc:format%3e%3cdc:type%20rdf:resource='http://purl.org/dc/dcmitype/StillImage'%20/%3e%3ccc:license%20rdf:resource='http://creativecommons.org/licenses/by-sa/4.0/'%20/%3e%3c/cc:Work%3e%3ccc:License%20rdf:about='http://creativecommons.org/licenses/by-sa/4.0/'%3e%3ccc:permits%20rdf:resource='http://creativecommons.org/ns%23Reproduction'%20/%3e%3ccc:permits%20rdf:resource='http://creativecommons.org/ns%23Distribution'%20/%3e%3ccc:requires%20rdf:resource='http://creativecommons.org/ns%23Notice'%20/%3e%3ccc:requires%20rdf:resource='http://creativecommons.org/ns%23Attribution'%20/%3e%3ccc:permits%20rdf:resource='http://creativecommons.org/ns%23DerivativeWorks'%20/%3e%3ccc:requires%20rdf:resource='http://creativecommons.org/ns%23ShareAlike'%20/%3e%3c/cc:License%3e%3c/rdf:RDF%3e%3c/metadata%3e%3crect%20fill='%23fed'%20stroke='%23fed'%20width='100'%20height='100'/%3e%3cg%20fill='none'%20stroke='%234093da'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='8'%20transform='skewX(-6)%20translate(8%201)'%3e%3cpath%20d='M%2030,10%20l%200,80%20M%2045,10%20l%200,80%20M%2020,10%20l%2040,0%20l%2018,18%20l%200,25%20l%20-33,0'%20/%3e%3cpath%20fill='%234093da'%20stroke-width='6'%20d='M%2061,10%20l%2017,17%20l%20-17,0%20l%200,-17'%20/%3e%3c/g%3e%3c/svg%3e",RYt="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%20100%20100'%20version='1.1'%20id='svg4'%20sodipodi:docname='favicon.svg'%20inkscape:version='1.4.4%20(dcaf3e7,%202026-05-05)'%20xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape'%20xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:svg='http://www.w3.org/2000/svg'%3e%3csodipodi:namedview%20id='namedview4'%20pagecolor='%23ffffff'%20bordercolor='%23000000'%20borderopacity='0.25'%20inkscape:showpageshadow='2'%20inkscape:pageopacity='0.0'%20inkscape:pagecheckerboard='0'%20inkscape:deskcolor='%23d1d1d1'%20showgrid='true'%20inkscape:zoom='8.2236519'%20inkscape:cx='34.534536'%20inkscape:cy='45.174577'%20inkscape:window-width='1881'%20inkscape:window-height='1382'%20inkscape:window-x='1512'%20inkscape:window-y='30'%20inkscape:window-maximized='0'%20inkscape:current-layer='svg4'%3e%3cinkscape:grid%20type='axonomgrid'%20id='grid4'%20units='px'%20originx='0'%20originy='0'%20spacingx='3.7795276'%20spacingy='3.7795276'%20empcolor='%230099e5'%20empopacity='0.30196078'%20color='%230099e5'%20opacity='0.14901961'%20empspacing='0'%20dotted='false'%20gridanglex='40'%20gridanglez='40'%20enabled='true'%20visible='true'%20/%3e%3c/sodipodi:namedview%3e%3cdefs%20id='defs1'%3e%3cfilter%20id='shadow'%20x='0'%20y='0'%20width='1'%20height='1'%3e%3cfeDropShadow%20dx='0'%20dy='2'%20stdDeviation='3'%20flood-color='rgba(50,%2050,%2093,%200.18)'%20/%3e%3c/filter%3e%3c/defs%3e%3crect%20x='4'%20y='4'%20width='92'%20height='92'%20rx='22.08'%20fill='%23e8efff'%20filter='url(%23shadow)'%20id='rect1'%20transform='matrix(1.0869565,0,0,1.0869565,-4.347826,-4.347826)'%20style='stroke-width:0.92'%20ry='22.08'%20/%3e%3cpath%20style='fill:%230a2540;fill-opacity:1;stroke-width:1.88976'%20d='M%2049.999999,6.535431%204.9573423,44.330708%2049.999999,82.125984%2092.790523,46.220471%2095.042656,44.330708%20Z'%20id='path1'%20/%3e%3cpath%20style='fill:%23425466;fill-opacity:1;stroke-width:1.88976'%20d='M%204.9573423,44.330708%20V%2055.669291%20L%2049.999999,93.464567%20V%2082.125984%20Z'%20id='path2'%20/%3e%3cpath%20style='fill:%231a3550;fill-opacity:1;stroke-width:1.88976'%20d='M%2049.999999,82.125984%2095.042656,44.330708%20V%2055.669291%20L%2049.999999,93.464567%20Z'%20id='path3'%20/%3e%3cpath%20style='fill:%234ade80;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;fill-opacity:1'%20d='m%2045.042657,30.236221%209.008531,-7.559055%2022.521328,18.897638%20-9.008531,7.559056%20z'%20id='path5'%20/%3e%3cpath%20style='fill:none;fill-opacity:1;stroke:%234ade80;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1'%20d='M%2027.025594,49.133859%2047.29479,47.244096%2045.042657,64.25197'%20id='path6'%20/%3e%3c/svg%3e",IYt="data:image/svg+xml,%3csvg%20fill='%23261230'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eAstral%3c/title%3e%3cpath%20d='M1.44%200C.6422%200%200%20.6422%200%201.44v21.12C0%2023.3578.6422%2024%201.44%2024h21.12c.7978%200%201.44-.6422%201.44-1.44V1.44C24%20.6422%2023.3578%200%2022.56%200Zm4.7998%204.8h11.5199c.7953%200%201.44.6447%201.44%201.44V19.2h-6.624v-4.32h-1.152v4.32H4.8V6.24c0-.7953.6446-1.44%201.4398-1.44m4.032%205.472v1.152h3.456v-1.152z'/%3e%3c/svg%3e",PYt="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='1.34em'%20height='1em'%20viewBox='0%200%20256%20192'%3e%3cpath%20fill='%232d4552'%20d='M84.38%20108.352c-9.556%202.712-15.826%207.467-19.956%2012.218c3.956-3.461%209.255-6.639%2016.402-8.665c7.311-2.072%2013.548-2.057%2018.702-1.062v-4.03c-4.397-.402-9.437-.082-15.148%201.539M63.987%2074.475l-35.49%209.35s.646.914%201.844%202.133l30.092-7.93s-.427%205.495-4.13%2010.41c7.005-5.299%207.684-13.963%207.684-13.963m29.709%2083.41c-49.946%2013.452-76.37-44.43-84.37-74.472c-3.696-13.868-5.31-24.37-5.74-31.148a11.5%2011.5%200%200%201%20.025-1.84C1.021%2050.58-.22%2051.927.032%2055.82c.43%206.773%202.044%2017.275%205.74%2031.147c7.997%2030.038%2034.424%2087.92%2084.37%2074.468c10.871-2.929%2019.038-8.263%2025.17-15.073c-5.652%205.104-12.724%209.123-21.616%2011.523M103.08%2039.05v3.555h19.59c-.401-1.259-.806-2.393-1.208-3.555z'/%3e%3cpath%20fill='%232d4552'%20d='M127.05%2068.325c8.81%202.503%2013.47%208.68%2015.933%2014.146l9.824%202.79s-1.34-19.132-18.645-24.047c-16.189-4.6-26.151%208.995-27.363%2010.754c4.71-3.355%2011.586-6.102%2020.251-3.643m78.197%2014.234c-16.204-4.62-26.162%209.003-27.356%2010.737c4.713-3.351%2011.586-6.099%2020.247-3.629c8.797%202.506%2013.452%208.676%2015.923%2014.146l9.837%202.8s-1.361-19.135-18.651-24.054m-9.76%2050.443l-81.718-22.845s.885%204.485%204.279%2010.293l68.803%2019.234c5.664-3.277%208.636-6.682%208.636-6.682m-56.655%2049.174C74.127%20164.828%2081.949%2082.386%2092.419%2043.32c4.311-16.1%208.743-28.066%2012.419-36.088c-2.193-.451-4.01.704-5.804%204.354C95.13%2019.5%2090.14%2032.387%2085.312%2050.427c-10.467%2039.066-18.29%20121.506%2046.412%20138.854c30.497%208.17%2054.256-4.247%2071.966-23.749c-16.81%2015.226-38.274%2023.763-64.858%2016.644'/%3e%3cpath%20fill='%23e2574c'%20d='M103.081%20138.565v-16.637l-46.223%2013.108s3.415-19.846%2027.522-26.684c7.311-2.072%2013.549-2.058%2018.701-1.063V39.05h23.145c-2.52-7.787-4.958-13.782-7.006-17.948c-3.387-6.895-6.859-2.324-14.741%204.269c-5.552%204.638-19.583%2014.533-40.698%2020.222c-21.114%205.694-38.185%204.184-45.307%202.95c-10.097-1.742-15.378-3.96-14.884%203.721c.43%206.774%202.043%2017.277%205.74%2031.148c7.996%2030.039%2034.424%2087.92%2084.37%2074.468c13.046-3.515%2022.254-10.464%2028.637-19.32h-19.256zm-74.588-54.74l35.494-9.35s-1.034%2013.654-14.34%2017.162c-13.31%203.504-21.154-7.812-21.154-7.812'/%3e%3cpath%20fill='%232ead33'%20d='M236.664%2039.84c-9.226%201.617-31.361%203.632-58.716-3.7c-27.363-7.328-45.517-20.144-52.71-26.168c-10.197-8.54-14.682-14.476-19.096-5.498c-3.902%207.918-8.893%2020.805-13.723%2038.846c-10.466%2039.066-18.289%20121.505%2046.413%20138.853c64.687%2017.333%2099.126-57.978%20109.593-97.047c4.83-18.037%206.948-31.695%207.53-40.502c.665-9.976-6.187-7.08-19.29-4.784M106.668%2072.161s10.196-15.859%2027.49-10.943c17.305%204.915%2018.645%2024.046%2018.645%2024.046zm42.215%2071.163c-30.419-8.91-35.11-33.167-35.11-33.167l81.714%2022.846c0-.004-16.494%2019.12-46.604%2010.32m28.89-49.85s10.183-15.847%2027.474-10.918c17.29%204.923%2018.651%2024.054%2018.651%2024.054z'/%3e%3cpath%20fill='%23d65348'%20d='m86.928%20126.51l-30.07%208.522s3.266-18.609%2025.418-25.983L65.25%2045.147l-1.471.447c-21.115%205.694-38.185%204.184-45.307%202.95c-10.097-1.741-15.379-3.96-14.885%203.722c.43%206.774%202.044%2017.276%205.74%2031.147c7.997%2030.039%2034.425%2087.92%2084.37%2074.468l1.471-.462zM28.493%2083.825l35.494-9.351s-1.034%2013.654-14.34%2017.162c-13.31%203.504-21.154-7.811-21.154-7.811'/%3e%3cpath%20fill='%231d8d22'%20d='m150.255%20143.658l-1.376-.335c-30.419-8.91-35.11-33.166-35.11-33.166l42.137%2011.778l22.308-85.724l-.27-.07c-27.362-7.329-45.516-20.145-52.71-26.17c-10.196-8.54-14.682-14.475-19.096-5.497c-3.898%207.918-8.889%2020.805-13.719%2038.846c-10.466%2039.066-18.289%20121.505%2046.413%20138.852l1.326.3zM106.668%2072.16s10.196-15.859%2027.49-10.943c17.305%204.915%2018.645%2024.046%2018.645%2024.046z'/%3e%3cpath%20fill='%23c04b41'%20d='m88.46%20126.072l-8.064%202.289c1.906%2010.74%205.264%2021.047%2010.534%2030.152c.918-.202%201.828-.376%202.762-.632c2.449-.66%204.72-1.479%206.906-2.371c-5.89-8.74-9.785-18.804-12.137-29.438m-3.148-75.644c-4.144%2015.467-7.852%2037.73-6.831%2060.06c1.826-.793%203.756-1.532%205.9-2.14l1.492-.334c-1.82-23.852%202.114-48.157%206.546-64.694a323%20323%200%200%201%203.373-11.704a105%20105%200%200%201-5.974%203.547a307%20307%200%200%200-4.506%2015.265'/%3e%3c/svg%3e",DYt="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='512'%20height='512'%20version='1.1'%20viewBox='0%200%20135.47%20135.47'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m67.733%2067.733%2029.33%2016.933-29.33%2050.8c37.408%200%2067.733-30.325%2067.733-67.733%200-12.341-3.3168-23.901-9.0837-33.867h-58.65z'%20fill='%23afccf9'/%3e%3cpath%20d='m67.733-1e-6c-25.07%200-46.942%2013.63-58.654%2033.875l29.324%2050.792%2029.33-16.933v-33.867h58.65c-11.714-20.24-33.583-33.867-58.65-33.867z'%20fill='%231767d1'/%3e%3cpath%20d='m0%2067.733c0%2037.408%2030.324%2067.733%2067.733%2067.733l29.33-50.8-29.33-16.933-29.33%2016.933-29.324-50.792c-5.7637%209.9632-9.0794%2021.519-9.0794%2033.858'%20fill='%23679ef5'/%3e%3cpath%20d='m101.6%2067.733c0%2018.704-15.163%2033.867-33.867%2033.867-18.704%200-33.867-15.163-33.867-33.867s15.163-33.867%2033.867-33.867c18.704%200%2033.867%2015.163%2033.867%2033.867'%20fill='%23fff'/%3e%3cpath%20d='m95.25%2067.733c0%2015.197-12.32%2027.517-27.517%2027.517-15.197%200-27.517-12.32-27.517-27.517%200-15.197%2012.32-27.517%2027.517-27.517%2015.197%200%2027.517%2012.32%2027.517%2027.517'%20fill='%231a74e7'/%3e%3c/svg%3e",MYt="data:image/svg+xml,%3csvg%20fill='%23F03C2E'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGit%3c/title%3e%3cpath%20d='M13.09%2023.549a1.54%201.54%200%200%201-2.18%200L.451%2013.089a1.54%201.54%200%200%201%200-2.179l7.191-7.19%202.733%202.733a1.85%201.85%200%200%200%20.964%202.326v6.66a1.849%201.849%200%201%200%201.54%200V8.957l2.508%202.508a1.85%201.85%200%201%200%201.09-1.09l-2.634-2.634a1.85%201.85%200%200%200-2.378-2.377L8.73%202.63%2010.91.451a1.54%201.54%200%200%201%202.179%200l10.459%2010.46a1.54%201.54%200%200%201%200%202.179z'/%3e%3c/svg%3e",LYt="data:image/svg+xml,%3csvg%20fill='%23073551'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3ecurl%3c/title%3e%3cpath%20d='M.803%2014.8169c0-.5342.433-.9665.9665-.9665.5335%200%20.9665.4323.9665.9665%200%20.5335-.433.9657-.9665.9657-.5335%200-.9666-.4322-.9666-.9657m2.736%200c0-.1963-.0532-.376-.1119-.5525-.2344-.7024-.876-1.2169-1.6575-1.2169-.1249%200-.2344.0465-.3524.0708C.6149%2013.2865%200%2013.9646%200%2014.817c0%20.9764.7923%201.7694%201.7695%201.7694.9772%200%201.7694-.793%201.7694-1.7694m-1.7694-7.149c.5335%200%20.9665.433.9665.9665%200%20.5335-.433.9665-.9665.9665-.5343%200-.9666-.433-.9666-.9665%200-.5335.4323-.9665.9666-.9665m0%202.7359c.9772%200%201.7694-.7923%201.7694-1.7694%200-.1956-.0532-.376-.1119-.5525-.2344-.7024-.8767-1.2169-1.6575-1.2169-.1249%200-.2344.0465-.3524.0716C.6149%207.104%200%207.782%200%208.6344c0%20.9771.7923%201.7694%201.7695%201.7694m13.221-5.694c-.5342%200-.9665-.433-.9665-.9664a.966.966%200%2001.9666-.9665c.5335%200%20.9658.4322.9658.9665%200%20.5334-.4323.9664-.9658.9664m-9.6%2016.5133c-.5335%200-.9666-.433-.9666-.9665%200-.5342.433-.9665.9666-.9665a.966.966%200%2001.9665.9665c0%20.5335-.4323.9665-.9665.9665m9.6-19.2491c-.978%200-1.7695.7922-1.7695%201.7694%200%20.2085.0525.4025.1187.5882L5.039%2018.5581c-.803.1681-1.4179.8462-1.4179%201.6985%200%20.9772.7923%201.7694%201.7695%201.7694.9772%200%201.7694-.7922%201.7694-1.7694%200-.1963-.0525-.3759-.111-.5525l8.3427-14.2728c.7778-.1865%201.3683-.8531%201.3683-1.688%200-.977-.793-1.7693-1.7694-1.7693m7.24%202.7359c-.5343%200-.9666-.433-.9666-.9665a.966.966%200%2001.9665-.9665c.5335%200%20.9666.4322.9666.9665%200%20.5334-.433.9665-.9666.9665M12.6313%2021.223c-.5343%200-.9665-.433-.9665-.9665a.966.966%200%2001.9665-.9665c.5335%200%20.9658.4323.9658.9665%200%20.5335-.4323.9665-.9658.9665M22.2305%201.974c-.9772%200-1.7694.7922-1.7694%201.7694%200%20.2085.0525.4025.1187.5882l-8.3009%2014.2265c-.8021.1681-1.417.8462-1.417%201.6985%200%20.9772.7922%201.7694%201.7694%201.7694.9764%200%201.7687-.7922%201.7687-1.7694%200-.1963-.0525-.3759-.1111-.5525l8.3427-14.2728C23.4094%205.2448%2024%204.5782%2024%203.7433c0-.977-.7923-1.7693-1.7695-1.7693'/%3e%3c/svg%3e",$Yt="data:image/svg+xml,%3csvg%20fill='%23007808'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eFFmpeg%3c/title%3e%3cpath%20d='M21.72%2017.91V6.5l-.53-.49L9.05%2018.52l-1.29-.06L24%201.53l-.33-.95-11.93%201-5.75%206.6v-.23l4.7-5.39-1.38-.77-9.11.77v2.85l1.91.46v.01l.19-.01-.56.66v10.6c.609-.126%201.22-.241%201.83-.36L14.12%205.22l.83-.04L0%2021.44l9.67.82%201.35-.77%206.82-6.74v2.15l-5.72%205.57%2011.26.95.35-.94v-3.16l-3.29-.18c.434-.403.858-.816%201.28-1.23z'/%3e%3c/svg%3e",FYt="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%201080%201080'%3e%3c!--%20Generator:%20Adobe%20Illustrator%2030.3.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.3%20Build%20182)%20--%3e%3cdefs%3e%3cstyle%3e%20.st0%20{%20fill:%20%23ff0;%20}%20.st1%20{%20fill:%20%23333;%20}%20%3c/style%3e%3c/defs%3e%3cpath%20class='st0'%20d='M660.52,419.49l-195.15-52.98c-15.84-4.3-19.16-25.29-5.43-34.28l169.23-110.7-9.91-201.97c-.8-16.39,18.13-26.04,30.92-15.76l157.57,126.74,189.03-71.84c15.34-5.83,30.37,9.2,24.54,24.54l-71.84,189.03,126.74,157.57c10.29,12.79.64,31.73-15.76,30.92l-201.97-9.91-110.7,169.23c-8.98,13.73-29.98,10.41-34.28-5.43l-52.98-195.15h-.01Z'/%3e%3cpath%20class='st1'%20d='M603.34,476.66l32.94,121.68,4.45,16.23-429.11,429.11c-48.45,48.45-126.85,48.45-175.3,0C12.16,1019.51,0,987.89,0,956.15s12.02-63.48,36.31-87.77l429.11-429.11,16.35,4.33,121.56,33.06h0Z'/%3e%3c/svg%3e";function yK(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...e,children:a.jsx("path",{d:"M12 .5C5.65.5.5 5.65.5 12c0 5.08 3.29 9.39 7.86 10.91 .58 .11 .79-.25.79-.56v-2.02c-3.2.7-3.88-1.36-3.88-1.36-.52-1.33-1.28-1.69-1.28-1.69-1.05-.72.08-.7.08-.7 1.16.08 1.77 1.19 1.77 1.19 1.03 1.77 2.71 1.26 3.37.96.1-.75.4-1.26.73-1.55-2.56-.29-5.25-1.28-5.25-5.7 0-1.26.45-2.29 1.19-3.1-.12-.29-.52-1.47.11-3.06 0 0 .97-.31 3.16 1.18A10.98 10.98 0 0 1 12 6.11c.98 0 1.96.13 2.87.39 2.19-1.49 3.16-1.18 3.16-1.18.63 1.59.23 2.77.11 3.06.74.81 1.19 1.84 1.19 3.1 0 4.43-2.7 5.4-5.27 5.69.42.36.78 1.06.78 2.14v3.04c0 .31.21.67.8.56A11.51 11.51 0 0 0 23.5 12C23.5 5.65 18.35.5 12 .5Z"})})}al.registerLanguage("bash",EM);const BYt=48;function UYt(e,t=BYt){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}function QYt(e){return al.highlight(e,{language:"bash",ignoreIllegals:!0}).value}function zYt({status:e}){return e==="succeeded"?a.jsx(Cf,{"aria-hidden":!0}):e==="failed"?a.jsx(lB,{"aria-hidden":!0}):e==="running"?a.jsx(Bi,{className:"studio-build-progress__spinner","aria-hidden":!0}):a.jsx(_at,{"aria-hidden":!0})}function Yoe(e,t){if(!e)return"";const n=Date.parse(e);return Number.isNaN(n)?"":new Intl.DateTimeFormat(t,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(n)}function VYt({steps:e,log:t,logError:n="",logTruncated:i=!1,logUpdatedAt:r,loading:s=!1}){const{t:o,i18n:l}=Te("ui"),c=p.useRef(null),u=p.useRef(!0),[d,f]=p.useState(!1),h=p.useMemo(()=>QYt(t),[t]);p.useEffect(()=>{const g=c.current;g&&t&&u.current&&(g.scrollTop=g.scrollHeight)},[t]);const m=async()=>{try{await navigator.clipboard.writeText(t),f(!0),window.setTimeout(()=>f(!1),1500)}catch{f(!1)}};return a.jsxs("div",{className:"studio-build-progress",children:[a.jsx("ol",{className:"studio-build-progress__steps","aria-label":o("studioBuildProgress.steps"),children:e.map(g=>a.jsxs("li",{className:`is-${g.status}`,children:[a.jsx("span",{className:"studio-build-progress__step-icon",children:a.jsx(zYt,{status:g.status})}),a.jsx("span",{children:g.label})]},g.key))}),a.jsxs("section",{className:"studio-build-progress__log","aria-label":o("studioBuildProgress.log"),children:[a.jsxs("header",{children:[a.jsxs("div",{children:[a.jsx("strong",{children:o("studioBuildProgress.log")}),a.jsxs("span",{children:[o(s?"studioBuildProgress.syncing":n?"studioBuildProgress.loadFailed":"studioBuildProgress.synced"),i?o("studioBuildProgress.recentOnly"):"",Yoe(r,l.resolvedLanguage??l.language)?` · ${Yoe(r,l.resolvedLanguage??l.language)}`:""]})]}),a.jsxs(_t,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:!t,onClick:()=>void m(),"aria-label":o(d?"studioBuildProgress.copiedLog":"studioBuildProgress.copyLog"),children:[d?a.jsx(Cf,{"aria-hidden":!0}):a.jsx(eM,{"aria-hidden":!0}),o(d?"studioBuildProgress.copied":"studioBuildProgress.copy")]})]}),t?a.jsx("pre",{ref:c,tabIndex:0,"aria-label":o("studioBuildProgress.logContent"),onScroll:g=>{u.current=UYt(g.currentTarget)},children:a.jsx("code",{className:"hljs language-bash",dangerouslySetInnerHTML:{__html:h}})}):a.jsx("div",{className:`studio-build-progress__log-empty${n?" is-error":""}`,children:n||o(s?"studioBuildProgress.waiting":"studioBuildProgress.empty")})]})]})}function Zoe({name:e,description:t,icon:n,selected:i,disabled:r=!1,onChange:s,className:o=""}){return a.jsxs("button",{type:"button",className:`studio-package-option${i?" is-selected":""}${o?` ${o}`:""}`,"aria-pressed":i,disabled:r,onClick:()=>s(!i),children:[a.jsx("span",{className:"studio-package-option__icon","aria-hidden":"true",children:n}),a.jsxs("span",{className:"studio-package-option__content",children:[a.jsx("strong",{children:e}),t?a.jsx("span",{children:t}):null]}),a.jsx("span",{className:"studio-package-option__action","aria-hidden":"true",children:i?a.jsx(cat,{}):a.jsx(fat,{})})]})}function iy(e,t){return e[t]|e[t+1]<<8}function Wv(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}async function HYt(e){const t=new DecompressionStream("deflate-raw"),n=new Blob([new Uint8Array(e)]).stream().pipeThrough(t);return new Uint8Array(await new Response(n).arrayBuffer())}async function g9e(e,t={}){let i=-1;for(let u=e.length-22;u>=0&&u>e.length-65557;u--)if(Wv(e,u)===101010256){i=u;break}if(i<0)throw new Error(Xt("helpers.zip.invalid"));const r=iy(e,i+10);if(t.maxEntries!==void 0&&r>t.maxEntries)throw new Error(Xt("helpers.zip.tooManyFiles",{count:t.maxEntries}));let s=Wv(e,i+16);const o=new TextDecoder("utf-8"),l=[];let c=0;for(let u=0;ut.maxUncompressedBytes)throw new Error(Xt("helpers.zip.tooLarge"));const w=iy(e,v+26),x=iy(e,v+28),O=v+30+w+x,k=e.subarray(O,O+f);let S;if(d===0)S=k;else if(d===8)S=await HYt(k);else{s+=46+m+g+b;continue}l.push({name:y,text:o.decode(S)}),s+=46+m+g+b}return l}const X7=/(^|\/)skill\.md$/i;function qYt(e){const t=(e??"").replace(/\r\n?/g,` `).split(` -`);if(!t.length||t[0].trim()!=="---")return{name:"",description:""};let n=-1;for(let r=1;r=2&&(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))}function qYt(...e){var t;for(const n of e){const i=(t=n.trim().replace(/\\/g,"/").split("/").filter(Boolean).pop())==null?void 0:t.replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"");if(i)return i.slice(0,64)}return"local-skill"}function WYt(e,t){return t.trim()||e}function g9e(e){const t=e.map(i=>({path:i.path.replace(/\\/g,"/").replace(/^\.\//,""),text:i.text})).filter(i=>i.path.length>0&&!i.path.endsWith("/")),n=new Set(t.map(i=>i.path.split("/")[0]));if(n.size===1&&t.every(i=>i.path.includes("/"))){const i=[...n][0]+"/";return t.map(r=>({path:r.path.slice(i.length),text:r.text}))}return t}function KYt(e){const t=new Map,n=new Set;for(const i of e)if(G7.test("/"+i.path)){const r=i.path.split("/");n.add(r.slice(0,-1).join("/"))}for(const i of e){const r=i.path.split("/");let s="";for(let u=r.length-1;u>=0;u--){const d=r.slice(0,u).join("/");if(n.has(d)){s=d;break}}const o=G7.test("/"+i.path);if(!s&&!o&&!n.has("")||!n.has(s)&&!o)continue;const l=s?i.path.slice(s.length+1):i.path,c=t.get(s)||[];c.push({path:l,text:i.text}),t.set(s,c)}return t}function GYt(e,t,n){const i=`${n}${e?"/"+e:""}`,r=t.find(c=>G7.test("/"+c.path));if(!r)return{hit:null,error:Xt("helpers.skills.missingManifest",{location:i})};const s=VYt(r.text),o=qYt(s.name,e,n.replace(/\.[^.]+$/,"")),l=[];for(const c of t){if(c.path.split("/").some(f=>f===".."))return{hit:null,error:Xt("helpers.skills.invalidParentPath",{location:i,path:c.path})};const d=`skills/${o}/${c.path}`;if(!d.startsWith(`skills/${o}/`))return{hit:null,error:Xt("helpers.skills.invalidPath",{location:i,path:c.path})};l.push({path:d,content:c.text})}return{hit:{source:"local",id:`local:${o}:${t.length}`,name:WYt(o,s.name),description:s.description||Xt("helpers.skills.localDescription"),folder:o,localFiles:l},error:null}}async function XYt(e){const t=new Uint8Array(await e.arrayBuffer()),i=(await m9e(t)).map(r=>({path:r.name,text:r.text}));return b9e(g9e(i),e.name)}async function YYt(e,t=new Map){const n=[];for(let i=0;ie.file(t,n))}async function JYt(e){const t=e.createReader(),n=[];for(;;){const i=await new Promise((r,s)=>t.readEntries(r,s));if(i.length===0)return n;n.push(...i)}}async function y9e(e,t=""){const n=t?`${t}/${e.name}`:e.name;if(e.isFile)return[{file:await ZYt(e),path:n}];if(!e.isDirectory)return[];const i=await JYt(e);return(await Promise.all(i.map(r=>y9e(r,n)))).flat()}function eZt({selected:e,onChange:t}){const{t:n}=Te("create"),[i,r]=p.useState([]),[s,o]=p.useState([]),[l,c]=p.useState(!1),[u,d]=p.useState(!1),f=p.useRef(0),h=O=>e.some(k=>k.source==="local"&&k.folder===O),m=O=>{O.localFiles&&(h(O.folder||O.name)?t(e.filter(k=>!(k.source==="local"&&k.folder===(O.folder||O.name)))):t([...e,{source:"local",folder:O.folder||O.name,name:O.name,description:O.description,localFiles:O.localFiles}]))},g=p.useRef([]),b=p.useRef(e);p.useEffect(()=>{g.current=s},[s]),p.useEffect(()=>{b.current=e},[e]);const v=O=>{const k=new Set([...g.current.map(j=>j.folder||j.name),...b.current.filter(j=>j.source==="local").map(j=>j.folder)]),S=[],C=[];for(const j of O.hits){const T=j.folder||j.name;if(k.has(T)){S.push(j.name);continue}k.add(T),C.push(j)}o(j=>[...j,...C]);const E=[...O.errors];if(S.length>0&&E.push(n("skills.local.duplicatesSkipped",{names:S.join(", ")})),r(E),C.length===1&&O.errors.length===0&&S.length===0){const j=C[0];j.localFiles&&t([...b.current,{source:"local",folder:j.folder||j.name,name:j.name,description:j.description,localFiles:j.localFiles}])}},y=O=>{O.preventDefault(),f.current+=1,d(!0)},w=O=>{O.preventDefault(),f.current=Math.max(0,f.current-1),f.current===0&&d(!1)},x=async O=>{if(O.preventDefault(),f.current=0,d(!1),l)return;const k=Array.from(O.dataTransfer.items).map(S=>{var C;return(C=S.webkitGetAsEntry)==null?void 0:C.call(S)}).filter(S=>S!==null);if(k.length===0){r([n("skills.local.invalidDrop")]);return}c(!0);try{const S=(await Promise.all(k.map(j=>y9e(j)))).flat(),C=k.some(j=>j.isDirectory);if(!C&&S.length===1&&S[0].file.name.toLowerCase().endsWith(".zip")){v(await XYt(S[0].file));return}if(!C){r([n("skills.local.invalidDrop")]);return}const E=new Map(S.map(({file:j,path:T})=>[j,T]));v(await YYt(S.map(({file:j})=>j),E))}catch(S){r([n("skills.local.readError",{detail:S instanceof Error?S.message:String(S)})])}finally{c(!1)}};return a.jsxs("div",{className:"cw-local",children:[a.jsxs("div",{className:`cw-local-dropzone ${u?"is-dragging":""}`,role:"group","aria-label":n("skills.local.dropLabel"),onDragEnter:y,onDragOver:O=>O.preventDefault(),onDragLeave:w,onDrop:O=>void x(O),children:[a.jsx(gV,{className:"cw-local-drop-icon","aria-hidden":!0}),a.jsx("p",{className:"cw-local-drop-hint",children:n("skills.local.dropLabel")})]}),a.jsx("p",{className:"cw-local-hint",children:n("skills.local.hint")}),l&&a.jsx("p",{className:"cw-empty-line",children:n("skills.local.reading")}),i.length>0&&a.jsxs("div",{className:"cw-banner",children:[a.jsx(pm,{className:"cw-i"}),a.jsx("span",{children:i.join(";")})]}),s.length>0&&a.jsx("div",{className:"cw-skill-results",children:s.map(O=>{var S;const k=h(O.folder||O.name);return a.jsxs("button",{type:"button",className:`cw-skill-result ${k?"is-on":""}`,onClick:()=>m(O),"aria-pressed":k,children:[a.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:k?a.jsx(Ef,{className:"cw-i cw-i-sm"}):a.jsx(ic,{className:"cw-i cw-i-sm"})}),a.jsxs("span",{className:"cw-skill-result-meta",children:[a.jsx("span",{className:"cw-skill-result-name",children:O.name}),O.description&&a.jsx("span",{className:"cw-skill-result-desc",children:vC(O.description)}),a.jsx("span",{className:"cw-skill-result-repo",children:n("skills.local.fileCount",{count:((S=O.localFiles)==null?void 0:S.length)??0})})]})]},O.id)})})]})}const tZt="/harness/skills/findskill";async function nZt(e,t="public"){const n=e.trim(),i=new URLSearchParams({query:n,page_number:"1",page_size:"20"}),r=`${tZt}?${i.toString()}`,s=await fetch(r,{headers:{accept:"application/json"},signal:po(void 0,ho)});if(!s.ok)throw new Error(Xt("helpers.skills.searchFailed",{status:s.status}));return((await s.json()).items??[]).map(l=>({source:"skillhub",id:l.slug??l.name??"",slug:l.slug??"",name:l.name??l.slug??"",description:l.description??"",namespace:t,sourceRepo:l.sourceRepo,downloadCount:l.downloadCount,version:l.version}))}function iZt({selected:e,onChange:t}){const{t:n}=Te("create"),[i,r]=p.useState(""),[s,o]=p.useState([]),[l,c]=p.useState(!1),[u,d]=p.useState(null),[f,h]=p.useState(!1),m=v=>e.some(y=>y.source==="skillhub"&&y.slug===v),g=v=>{v.slug&&(m(v.slug)?t(e.filter(y=>!(y.source==="skillhub"&&y.slug===v.slug))):t([...e,{source:"skillhub",slug:v.slug,name:v.name,folder:v.slug.split("/").pop()||v.name,namespace:v.namespace||"public",description:v.description}]))},b=async v=>{c(!0),d(null),h(!0);try{const y=await nZt(v);o(y)}catch(y){d(y instanceof Error?y.message:n("skills.hub.searchError")),o([])}finally{c(!1)}};return p.useEffect(()=>{const v=i.trim();if(!v){o([]),h(!1),d(null);return}const y=setTimeout(()=>b(v),300);return()=>clearTimeout(y)},[i,n]),a.jsxs("div",{className:"cw-skillhub",children:[a.jsxs("div",{className:"cw-skill-searchrow",children:[a.jsxs("div",{className:"cw-skill-searchbox",children:[a.jsx(fI,{className:"cw-i cw-skill-searchicon","aria-hidden":!0}),a.jsx("input",{className:"cw-input cw-skill-input",value:i,placeholder:n("skills.hub.searchPlaceholder"),onChange:v=>r(v.target.value),onKeyDown:v=>{v.key==="Enter"&&(v.preventDefault(),i.trim()&&b(i))}})]}),a.jsxs("button",{type:"button",className:"cw-btn cw-btn-soft",onClick:()=>i.trim()&&b(i),disabled:!i.trim()||l,children:[l?a.jsx(Fi,{className:"cw-i cw-spin"}):a.jsx(fI,{className:"cw-i"}),n("skills.hub.search")]})]}),u&&a.jsxs("div",{className:"cw-banner",children:[a.jsx(pm,{className:"cw-i"}),a.jsx("span",{children:u})]}),l&&s.length===0?a.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[a.jsx(Fi,{className:"cw-i cw-spin"})," ",n("skills.hub.searching")]}):s.length>0?a.jsx("div",{className:"cw-skill-results",children:s.map(v=>{const y=m(v.slug||"");return a.jsxs("button",{type:"button",className:`cw-skill-result ${y?"is-on":""}`,onClick:()=>g(v),"aria-pressed":y,children:[a.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:y?a.jsx(Ef,{className:"cw-i cw-i-sm"}):a.jsx(ic,{className:"cw-i cw-i-sm"})}),a.jsxs("span",{className:"cw-skill-result-meta",children:[a.jsx("span",{className:"cw-skill-result-name",children:v.name}),v.description&&a.jsx("span",{className:"cw-skill-result-desc",children:vC(v.description)}),v.sourceRepo&&a.jsx("span",{className:"cw-skill-result-repo",children:v.sourceRepo})]})]},v.id||v.slug)})}):f&&!u?a.jsx("p",{className:"cw-empty-line",children:n("skills.hub.noResults")}):!f&&a.jsx("p",{className:"cw-empty-line",children:n("skills.hub.hint")})]})}function v9e({className:e}){return a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M5.5 7.5h10.75a2 2 0 0 1 2 2v7.75a2 2 0 0 1-2 2H5.5a2 2 0 0 1-2-2V9.5a2 2 0 0 1 2-2Z"}),a.jsx("path",{d:"M7 4.75h9.5a2 2 0 0 1 2 2",opacity:".58"}),a.jsx("path",{d:"m11 10.25.72 1.48 1.63.24-1.18 1.15.28 1.62-1.45-.77-1.45.77.28-1.62-1.18-1.15 1.63-.24.72-1.48Z"}),a.jsx("path",{d:"M19.25 11.25h1.5M20 10.5V12",opacity:".72"})]})}function h6(e){return e.source==="runtime"?`runtime:${e.folder}`:e.source==="skillhub"?`hub:${e.namespace}/${e.slug}`:e.source==="local"?`local:${e.folder}`:`ss:${e.skillSpaceId}/${e.skillId}/${e.version||""}`}function rZt(e){return e.source==="runtime"?"skillSourcePicker.sources.runtime":e.source==="local"?"skillSourcePicker.sources.local":e.source==="skillspace"?"skillSourcePicker.sources.skillspace":"skillSourcePicker.sources.skillhub"}function sZt({skill:e,onRemove:t,disabled:n}){const{t:i}=Te("ui");let r=hC;e.source==="local"||e.source==="runtime"?r=gV:e.source==="skillspace"&&(r=v9e);const s=`${i(rZt(e))}${e.description?` · ${vC(e.description)}`:""}`;return a.jsxs(Cr.div,{className:"cw-selected-skill-row",layout:!0,initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.16},children:[a.jsx("span",{className:"cw-selected-skill-icon","aria-hidden":"true",children:a.jsx(r,{className:"cw-i cw-i-sm"})}),a.jsxs("span",{className:"cw-selected-skill-meta",children:[a.jsx("span",{className:"cw-selected-skill-name",children:e.name}),a.jsx("span",{className:"cw-selected-skill-detail",tabIndex:0,title:s,children:s})]}),a.jsx("button",{type:"button",className:"cw-selected-skill-remove",onClick:t,disabled:n,"aria-label":i("skillSourcePicker.remove",{name:e.name}),title:i("skillSourcePicker.remove",{name:e.name}),children:a.jsx(Do,{className:"cw-i cw-i-sm"})})]})}const p6=[{id:"local",labelKey:"skillSourcePicker.tabs.local",shortLabelKey:"skillSourcePicker.tabs.localShort",icon:gV},{id:"skillspace",labelKey:"skillSourcePicker.tabs.skillspace",shortLabelKey:"skillSourcePicker.tabs.skillspaceShort",icon:v9e},{id:"skillhub",labelKey:"skillSourcePicker.tabs.skillhub",shortLabelKey:"skillSourcePicker.tabs.skillhubShort",icon:nM}];function yK({selected:e,onChange:t,cloudProvider:n,disabled:i=!1,addLabel:r,showSelectedCount:s=!0}){const{t:o}=Te("ui"),[l,c]=p.useState("local"),[u,d]=p.useState(!1),f=p.useId(),h=p.useId(),m=p.useRef(null),g=p6.findIndex(w=>w.id===l),b=r??o("skillSourcePicker.addSkill");p.useEffect(()=>{var k;if(!u)return;const w=document.body.style.overflow,x=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(k=m.current)==null||k.focus();const O=S=>{S.key==="Escape"&&d(!1)};return window.addEventListener("keydown",O),()=>{document.body.style.overflow=w,window.removeEventListener("keydown",O),x!=null&&x.isConnected&&x.focus()}},[u]);const v=(w,x)=>{x.source==="runtime"&&!window.confirm(o("skillSourcePicker.confirmRemoveRuntime",{name:x.name}))||t(e.filter(O=>h6(O)!==w))},y=w=>{const x=new Set(w.filter(O=>O.source!=="runtime").map(O=>O.folder));t(w.filter(O=>O.source!=="runtime"||!x.has(O.folder)))};return a.jsxs("div",{className:"cw-skillspane",children:[a.jsxs("button",{type:"button",className:"cw-skill-add","aria-haspopup":"dialog",disabled:i,onClick:()=>d(!0),children:[a.jsx("span",{className:"cw-skill-add-icon","aria-hidden":"true",children:a.jsx(ic,{className:"cw-i"})}),a.jsx("span",{children:b})]}),e.length>0&&a.jsxs("div",{className:"cw-skill-selected",children:[s?a.jsx("span",{className:"cw-skill-selected-label",children:o("skillSourcePicker.selectedCount",{count:e.length})}):null,a.jsx("div",{className:"cw-selected-skill-list",children:a.jsx(ff,{initial:!1,children:e.map(w=>a.jsx(sZt,{skill:w,disabled:i,onRemove:()=>v(h6(w),w)},h6(w)))})})]}),yi.createPortal(a.jsx(ff,{children:u&&a.jsx(Cr.div,{className:"cw-skill-dialog-backdrop",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16},onMouseDown:w=>{w.target===w.currentTarget&&d(!1)},children:a.jsxs(Cr.section,{className:"cw-skill-dialog",role:"dialog","aria-modal":"true","aria-labelledby":f,initial:{opacity:0,y:10,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:6,scale:.99},transition:{duration:.18,ease:"easeOut"},children:[a.jsxs("header",{className:"cw-skill-dialog-head",children:[a.jsx("h3",{id:f,children:b}),a.jsx("button",{ref:m,type:"button",className:"cw-skill-dialog-close","aria-label":o("skillSourcePicker.close",{label:b}),onClick:()=>d(!1),children:a.jsx(Do,{className:"cw-i"})})]}),a.jsxs("div",{className:"cw-skill-dialog-body",children:[a.jsxs("div",{className:"cw-skill-sourcetabs",role:"tablist",style:{"--cw-skill-tab-slider-width":`calc((100% - 16px) / ${p6.length})`,"--cw-active-skill-tab-offset":`calc(${g*100}% + ${g*4}px)`},children:[a.jsx("span",{className:"cw-skill-tab-slider","aria-hidden":"true"}),p6.map(({id:w,labelKey:x,shortLabelKey:O,icon:k})=>a.jsxs("button",{type:"button",role:"tab",id:`${h}-${w}`,"aria-controls":h,"aria-selected":l===w,className:`cw-skill-pickertab ${l===w?"is-on":""}`,onClick:()=>c(w),children:[a.jsx(k,{className:"cw-i cw-i-sm"}),a.jsx("span",{className:"cw-skill-tab-label-full",children:o(x)}),a.jsx("span",{className:"cw-skill-tab-label-short",children:o(O)})]},w))]}),a.jsxs("div",{id:h,className:"cw-skill-tabbody",role:"tabpanel","aria-labelledby":`${h}-${l}`,children:[l==="skillhub"&&a.jsx(iZt,{selected:e,onChange:y}),l==="local"&&a.jsx(eZt,{selected:e,onChange:y}),l==="skillspace"&&a.jsx(AIe,{selected:e,onChange:y,cloudProvider:n})]})]})]})})}),document.body)]})}const x9e=128*1024,aZt={baseImageRequired:"请填写基础镜像。",duplicateFrom:"基础镜像已固定在第一行,请删除 Dockerfile 正文中的 FROM 指令。",tooLarge:"Dockerfile 不能超过 128 KiB。",empty:"Dockerfile 内容不能为空。",missingFrom:"Dockerfile 缺少 FROM 指令。"};function Tw(e,t){return(t==null?void 0:t(`environmentCenter.dockerfileValidation.${e}`))??aZt[e]}function DL(e){return e.replace(/^\uFEFF/,"").replace(/\r\n?/g,` -`)}function w9e(e){return new TextEncoder().encode(e).byteLength}function oZt(e,t="ubuntu:22.04"){const n=DL(e).match(/^\s*FROM(?:\s+--platform=\S+)?\s+(\S+)/im);return(n==null?void 0:n[1])??t}function lZt(e){const t=DL(e).split(` +`);if(!t.length||t[0].trim()!=="---")return{name:"",description:""};let n=-1;for(let r=1;r=2&&(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))}function KYt(...e){var t;for(const n of e){const i=(t=n.trim().replace(/\\/g,"/").split("/").filter(Boolean).pop())==null?void 0:t.replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"");if(i)return i.slice(0,64)}return"local-skill"}function GYt(e,t){return t.trim()||e}function b9e(e){const t=e.map(i=>({path:i.path.replace(/\\/g,"/").replace(/^\.\//,""),text:i.text})).filter(i=>i.path.length>0&&!i.path.endsWith("/")),n=new Set(t.map(i=>i.path.split("/")[0]));if(n.size===1&&t.every(i=>i.path.includes("/"))){const i=[...n][0]+"/";return t.map(r=>({path:r.path.slice(i.length),text:r.text}))}return t}function XYt(e){const t=new Map,n=new Set;for(const i of e)if(X7.test("/"+i.path)){const r=i.path.split("/");n.add(r.slice(0,-1).join("/"))}for(const i of e){const r=i.path.split("/");let s="";for(let u=r.length-1;u>=0;u--){const d=r.slice(0,u).join("/");if(n.has(d)){s=d;break}}const o=X7.test("/"+i.path);if(!s&&!o&&!n.has("")||!n.has(s)&&!o)continue;const l=s?i.path.slice(s.length+1):i.path,c=t.get(s)||[];c.push({path:l,text:i.text}),t.set(s,c)}return t}function YYt(e,t,n){const i=`${n}${e?"/"+e:""}`,r=t.find(c=>X7.test("/"+c.path));if(!r)return{hit:null,error:Xt("helpers.skills.missingManifest",{location:i})};const s=qYt(r.text),o=KYt(s.name,e,n.replace(/\.[^.]+$/,"")),l=[];for(const c of t){if(c.path.split("/").some(f=>f===".."))return{hit:null,error:Xt("helpers.skills.invalidParentPath",{location:i,path:c.path})};const d=`skills/${o}/${c.path}`;if(!d.startsWith(`skills/${o}/`))return{hit:null,error:Xt("helpers.skills.invalidPath",{location:i,path:c.path})};l.push({path:d,content:c.text})}return{hit:{source:"local",id:`local:${o}:${t.length}`,name:GYt(o,s.name),description:s.description||Xt("helpers.skills.localDescription"),folder:o,localFiles:l},error:null}}async function ZYt(e){const t=new Uint8Array(await e.arrayBuffer()),i=(await g9e(t)).map(r=>({path:r.name,text:r.text}));return y9e(b9e(i),e.name)}async function JYt(e,t=new Map){const n=[];for(let i=0;ie.file(t,n))}async function tZt(e){const t=e.createReader(),n=[];for(;;){const i=await new Promise((r,s)=>t.readEntries(r,s));if(i.length===0)return n;n.push(...i)}}async function v9e(e,t=""){const n=t?`${t}/${e.name}`:e.name;if(e.isFile)return[{file:await eZt(e),path:n}];if(!e.isDirectory)return[];const i=await tZt(e);return(await Promise.all(i.map(r=>v9e(r,n)))).flat()}function nZt({selected:e,onChange:t}){const{t:n}=Te("create"),[i,r]=p.useState([]),[s,o]=p.useState([]),[l,c]=p.useState(!1),[u,d]=p.useState(!1),f=p.useRef(0),h=O=>e.some(k=>k.source==="local"&&k.folder===O),m=O=>{O.localFiles&&(h(O.folder||O.name)?t(e.filter(k=>!(k.source==="local"&&k.folder===(O.folder||O.name)))):t([...e,{source:"local",folder:O.folder||O.name,name:O.name,description:O.description,localFiles:O.localFiles}]))},g=p.useRef([]),b=p.useRef(e);p.useEffect(()=>{g.current=s},[s]),p.useEffect(()=>{b.current=e},[e]);const v=O=>{const k=new Set([...g.current.map(j=>j.folder||j.name),...b.current.filter(j=>j.source==="local").map(j=>j.folder)]),S=[],C=[];for(const j of O.hits){const T=j.folder||j.name;if(k.has(T)){S.push(j.name);continue}k.add(T),C.push(j)}o(j=>[...j,...C]);const E=[...O.errors];if(S.length>0&&E.push(n("skills.local.duplicatesSkipped",{names:S.join(", ")})),r(E),C.length===1&&O.errors.length===0&&S.length===0){const j=C[0];j.localFiles&&t([...b.current,{source:"local",folder:j.folder||j.name,name:j.name,description:j.description,localFiles:j.localFiles}])}},y=O=>{O.preventDefault(),f.current+=1,d(!0)},w=O=>{O.preventDefault(),f.current=Math.max(0,f.current-1),f.current===0&&d(!1)},x=async O=>{if(O.preventDefault(),f.current=0,d(!1),l)return;const k=Array.from(O.dataTransfer.items).map(S=>{var C;return(C=S.webkitGetAsEntry)==null?void 0:C.call(S)}).filter(S=>S!==null);if(k.length===0){r([n("skills.local.invalidDrop")]);return}c(!0);try{const S=(await Promise.all(k.map(j=>v9e(j)))).flat(),C=k.some(j=>j.isDirectory);if(!C&&S.length===1&&S[0].file.name.toLowerCase().endsWith(".zip")){v(await ZYt(S[0].file));return}if(!C){r([n("skills.local.invalidDrop")]);return}const E=new Map(S.map(({file:j,path:T})=>[j,T]));v(await JYt(S.map(({file:j})=>j),E))}catch(S){r([n("skills.local.readError",{detail:S instanceof Error?S.message:String(S)})])}finally{c(!1)}};return a.jsxs("div",{className:"cw-local",children:[a.jsxs("div",{className:`cw-local-dropzone ${u?"is-dragging":""}`,role:"group","aria-label":n("skills.local.dropLabel"),onDragEnter:y,onDragOver:O=>O.preventDefault(),onDragLeave:w,onDrop:O=>void x(O),children:[a.jsx(bV,{className:"cw-local-drop-icon","aria-hidden":!0}),a.jsx("p",{className:"cw-local-drop-hint",children:n("skills.local.dropLabel")})]}),a.jsx("p",{className:"cw-local-hint",children:n("skills.local.hint")}),l&&a.jsx("p",{className:"cw-empty-line",children:n("skills.local.reading")}),i.length>0&&a.jsxs("div",{className:"cw-banner",children:[a.jsx(mm,{className:"cw-i"}),a.jsx("span",{children:i.join(";")})]}),s.length>0&&a.jsx("div",{className:"cw-skill-results",children:s.map(O=>{var S;const k=h(O.folder||O.name);return a.jsxs("button",{type:"button",className:`cw-skill-result ${k?"is-on":""}`,onClick:()=>m(O),"aria-pressed":k,children:[a.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:k?a.jsx(Cf,{className:"cw-i cw-i-sm"}):a.jsx(ic,{className:"cw-i cw-i-sm"})}),a.jsxs("span",{className:"cw-skill-result-meta",children:[a.jsx("span",{className:"cw-skill-result-name",children:O.name}),O.description&&a.jsx("span",{className:"cw-skill-result-desc",children:xC(O.description)}),a.jsx("span",{className:"cw-skill-result-repo",children:n("skills.local.fileCount",{count:((S=O.localFiles)==null?void 0:S.length)??0})})]})]},O.id)})})]})}const iZt="/harness/skills/findskill";async function rZt(e,t="public"){const n=e.trim(),i=new URLSearchParams({query:n,page_number:"1",page_size:"20"}),r=`${iZt}?${i.toString()}`,s=await fetch(r,{headers:{accept:"application/json"},signal:po(void 0,ho)});if(!s.ok)throw new Error(Xt("helpers.skills.searchFailed",{status:s.status}));return((await s.json()).items??[]).map(l=>({source:"skillhub",id:l.slug??l.name??"",slug:l.slug??"",name:l.name??l.slug??"",description:l.description??"",namespace:t,sourceRepo:l.sourceRepo,downloadCount:l.downloadCount,version:l.version}))}function sZt({selected:e,onChange:t}){const{t:n}=Te("create"),[i,r]=p.useState(""),[s,o]=p.useState([]),[l,c]=p.useState(!1),[u,d]=p.useState(null),[f,h]=p.useState(!1),m=v=>e.some(y=>y.source==="skillhub"&&y.slug===v),g=v=>{v.slug&&(m(v.slug)?t(e.filter(y=>!(y.source==="skillhub"&&y.slug===v.slug))):t([...e,{source:"skillhub",slug:v.slug,name:v.name,folder:v.slug.split("/").pop()||v.name,namespace:v.namespace||"public",description:v.description}]))},b=async v=>{c(!0),d(null),h(!0);try{const y=await rZt(v);o(y)}catch(y){d(y instanceof Error?y.message:n("skills.hub.searchError")),o([])}finally{c(!1)}};return p.useEffect(()=>{const v=i.trim();if(!v){o([]),h(!1),d(null);return}const y=setTimeout(()=>b(v),300);return()=>clearTimeout(y)},[i,n]),a.jsxs("div",{className:"cw-skillhub",children:[a.jsxs("div",{className:"cw-skill-searchrow",children:[a.jsxs("div",{className:"cw-skill-searchbox",children:[a.jsx(fI,{className:"cw-i cw-skill-searchicon","aria-hidden":!0}),a.jsx("input",{className:"cw-input cw-skill-input",value:i,placeholder:n("skills.hub.searchPlaceholder"),onChange:v=>r(v.target.value),onKeyDown:v=>{v.key==="Enter"&&(v.preventDefault(),i.trim()&&b(i))}})]}),a.jsxs("button",{type:"button",className:"cw-btn cw-btn-soft",onClick:()=>i.trim()&&b(i),disabled:!i.trim()||l,children:[l?a.jsx(Bi,{className:"cw-i cw-spin"}):a.jsx(fI,{className:"cw-i"}),n("skills.hub.search")]})]}),u&&a.jsxs("div",{className:"cw-banner",children:[a.jsx(mm,{className:"cw-i"}),a.jsx("span",{children:u})]}),l&&s.length===0?a.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[a.jsx(Bi,{className:"cw-i cw-spin"})," ",n("skills.hub.searching")]}):s.length>0?a.jsx("div",{className:"cw-skill-results",children:s.map(v=>{const y=m(v.slug||"");return a.jsxs("button",{type:"button",className:`cw-skill-result ${y?"is-on":""}`,onClick:()=>g(v),"aria-pressed":y,children:[a.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:y?a.jsx(Cf,{className:"cw-i cw-i-sm"}):a.jsx(ic,{className:"cw-i cw-i-sm"})}),a.jsxs("span",{className:"cw-skill-result-meta",children:[a.jsx("span",{className:"cw-skill-result-name",children:v.name}),v.description&&a.jsx("span",{className:"cw-skill-result-desc",children:xC(v.description)}),v.sourceRepo&&a.jsx("span",{className:"cw-skill-result-repo",children:v.sourceRepo})]})]},v.id||v.slug)})}):f&&!u?a.jsx("p",{className:"cw-empty-line",children:n("skills.hub.noResults")}):!f&&a.jsx("p",{className:"cw-empty-line",children:n("skills.hub.hint")})]})}function x9e({className:e}){return a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M5.5 7.5h10.75a2 2 0 0 1 2 2v7.75a2 2 0 0 1-2 2H5.5a2 2 0 0 1-2-2V9.5a2 2 0 0 1 2-2Z"}),a.jsx("path",{d:"M7 4.75h9.5a2 2 0 0 1 2 2",opacity:".58"}),a.jsx("path",{d:"m11 10.25.72 1.48 1.63.24-1.18 1.15.28 1.62-1.45-.77-1.45.77.28-1.62-1.18-1.15 1.63-.24.72-1.48Z"}),a.jsx("path",{d:"M19.25 11.25h1.5M20 10.5V12",opacity:".72"})]})}function p6(e){return e.source==="runtime"?`runtime:${e.folder}`:e.source==="skillhub"?`hub:${e.namespace}/${e.slug}`:e.source==="local"?`local:${e.folder}`:`ss:${e.skillSpaceId}/${e.skillId}/${e.version||""}`}function aZt(e){return e.source==="runtime"?"skillSourcePicker.sources.runtime":e.source==="local"?"skillSourcePicker.sources.local":e.source==="skillspace"?"skillSourcePicker.sources.skillspace":"skillSourcePicker.sources.skillhub"}function oZt({skill:e,onRemove:t,disabled:n}){const{t:i}=Te("ui");let r=pC;e.source==="local"||e.source==="runtime"?r=bV:e.source==="skillspace"&&(r=x9e);const s=`${i(aZt(e))}${e.description?` · ${xC(e.description)}`:""}`;return a.jsxs(Cr.div,{className:"cw-selected-skill-row",layout:!0,initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.16},children:[a.jsx("span",{className:"cw-selected-skill-icon","aria-hidden":"true",children:a.jsx(r,{className:"cw-i cw-i-sm"})}),a.jsxs("span",{className:"cw-selected-skill-meta",children:[a.jsx("span",{className:"cw-selected-skill-name",children:e.name}),a.jsx("span",{className:"cw-selected-skill-detail",tabIndex:0,title:s,children:s})]}),a.jsx("button",{type:"button",className:"cw-selected-skill-remove",onClick:t,disabled:n,"aria-label":i("skillSourcePicker.remove",{name:e.name}),title:i("skillSourcePicker.remove",{name:e.name}),children:a.jsx(Do,{className:"cw-i cw-i-sm"})})]})}const m6=[{id:"local",labelKey:"skillSourcePicker.tabs.local",shortLabelKey:"skillSourcePicker.tabs.localShort",icon:bV},{id:"skillspace",labelKey:"skillSourcePicker.tabs.skillspace",shortLabelKey:"skillSourcePicker.tabs.skillspaceShort",icon:x9e},{id:"skillhub",labelKey:"skillSourcePicker.tabs.skillhub",shortLabelKey:"skillSourcePicker.tabs.skillhubShort",icon:nM}];function vK({selected:e,onChange:t,cloudProvider:n,disabled:i=!1,addLabel:r,showSelectedCount:s=!0}){const{t:o}=Te("ui"),[l,c]=p.useState("local"),[u,d]=p.useState(!1),f=p.useId(),h=p.useId(),m=p.useRef(null),g=m6.findIndex(w=>w.id===l),b=r??o("skillSourcePicker.addSkill");p.useEffect(()=>{var k;if(!u)return;const w=document.body.style.overflow,x=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(k=m.current)==null||k.focus();const O=S=>{S.key==="Escape"&&d(!1)};return window.addEventListener("keydown",O),()=>{document.body.style.overflow=w,window.removeEventListener("keydown",O),x!=null&&x.isConnected&&x.focus()}},[u]);const v=(w,x)=>{x.source==="runtime"&&!window.confirm(o("skillSourcePicker.confirmRemoveRuntime",{name:x.name}))||t(e.filter(O=>p6(O)!==w))},y=w=>{const x=new Set(w.filter(O=>O.source!=="runtime").map(O=>O.folder));t(w.filter(O=>O.source!=="runtime"||!x.has(O.folder)))};return a.jsxs("div",{className:"cw-skillspane",children:[a.jsxs("button",{type:"button",className:"cw-skill-add","aria-haspopup":"dialog",disabled:i,onClick:()=>d(!0),children:[a.jsx("span",{className:"cw-skill-add-icon","aria-hidden":"true",children:a.jsx(ic,{className:"cw-i"})}),a.jsx("span",{children:b})]}),e.length>0&&a.jsxs("div",{className:"cw-skill-selected",children:[s?a.jsx("span",{className:"cw-skill-selected-label",children:o("skillSourcePicker.selectedCount",{count:e.length})}):null,a.jsx("div",{className:"cw-selected-skill-list",children:a.jsx(hf,{initial:!1,children:e.map(w=>a.jsx(oZt,{skill:w,disabled:i,onRemove:()=>v(p6(w),w)},p6(w)))})})]}),yi.createPortal(a.jsx(hf,{children:u&&a.jsx(Cr.div,{className:"cw-skill-dialog-backdrop",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16},onMouseDown:w=>{w.target===w.currentTarget&&d(!1)},children:a.jsxs(Cr.section,{className:"cw-skill-dialog",role:"dialog","aria-modal":"true","aria-labelledby":f,initial:{opacity:0,y:10,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:6,scale:.99},transition:{duration:.18,ease:"easeOut"},children:[a.jsxs("header",{className:"cw-skill-dialog-head",children:[a.jsx("h3",{id:f,children:b}),a.jsx("button",{ref:m,type:"button",className:"cw-skill-dialog-close","aria-label":o("skillSourcePicker.close",{label:b}),onClick:()=>d(!1),children:a.jsx(Do,{className:"cw-i"})})]}),a.jsxs("div",{className:"cw-skill-dialog-body",children:[a.jsxs("div",{className:"cw-skill-sourcetabs",role:"tablist",style:{"--cw-skill-tab-slider-width":`calc((100% - 16px) / ${m6.length})`,"--cw-active-skill-tab-offset":`calc(${g*100}% + ${g*4}px)`},children:[a.jsx("span",{className:"cw-skill-tab-slider","aria-hidden":"true"}),m6.map(({id:w,labelKey:x,shortLabelKey:O,icon:k})=>a.jsxs("button",{type:"button",role:"tab",id:`${h}-${w}`,"aria-controls":h,"aria-selected":l===w,className:`cw-skill-pickertab ${l===w?"is-on":""}`,onClick:()=>c(w),children:[a.jsx(k,{className:"cw-i cw-i-sm"}),a.jsx("span",{className:"cw-skill-tab-label-full",children:o(x)}),a.jsx("span",{className:"cw-skill-tab-label-short",children:o(O)})]},w))]}),a.jsxs("div",{id:h,className:"cw-skill-tabbody",role:"tabpanel","aria-labelledby":`${h}-${l}`,children:[l==="skillhub"&&a.jsx(sZt,{selected:e,onChange:y}),l==="local"&&a.jsx(nZt,{selected:e,onChange:y}),l==="skillspace"&&a.jsx(TIe,{selected:e,onChange:y,cloudProvider:n})]})]})]})})}),document.body)]})}const w9e=128*1024,lZt={baseImageRequired:"请填写基础镜像。",duplicateFrom:"基础镜像已固定在第一行,请删除 Dockerfile 正文中的 FROM 指令。",tooLarge:"Dockerfile 不能超过 128 KiB。",empty:"Dockerfile 内容不能为空。",missingFrom:"Dockerfile 缺少 FROM 指令。"};function _w(e,t){return(t==null?void 0:t(`environmentCenter.dockerfileValidation.${e}`))??lZt[e]}function DL(e){return e.replace(/^\uFEFF/,"").replace(/\r\n?/g,` +`)}function O9e(e){return new TextEncoder().encode(e).byteLength}function cZt(e,t="ubuntu:22.04"){const n=DL(e).match(/^\s*FROM(?:\s+--platform=\S+)?\s+(\S+)/im);return(n==null?void 0:n[1])??t}function uZt(e){const t=DL(e).split(` `),n=t.findIndex(i=>/^\s*FROM(?:\s|$)/i.test(i));return(n>=0?t.slice(n+1):t).join(` -`).replace(/^\n+/,"")}function nR(e,t){const n=`FROM ${e.trim()}`,i=DL(t).replace(/^\n+/,"");return i?`${n} -${i}`:n}function cZt(e,t,n){return t.trim()?/^\s*FROM(?:\s|$)/im.test(e)?Tw("duplicateFrom",n):vK(nR(t,e),void 0,n):Tw("baseImageRequired",n)}function vK(e,t=w9e(e),n){return t>x9e?Tw("tooLarge",n):e.trim()?/^\s*FROM\s+\S+/im.test(e)?"":Tw("missingFrom",n):Tw("empty",n)}async function uZt(e,t){if(e.size>x9e)return{content:"",error:Tw("tooLarge",t)};const n=DL(await e.text());return{content:n,error:vK(n,e.size,t)}}function dZt(e){return qM(e,{lineWidth:0})}function fZt(e){return[{value:"auto",label:e("deploymentResources.mode.auto"),description:e("deploymentResources.mode.autoDescription"),badge:e("deploymentResources.mode.recommended")},{value:"create",label:e("deploymentResources.mode.create"),description:e("deploymentResources.mode.createDescription")},{value:"existing",label:e("deploymentResources.mode.existing"),description:e("deploymentResources.mode.existingDescription")}]}const O9e={tos:{mode:"auto"},cr:{mode:"auto"},codePipeline:{mode:"auto"}};function mp(e){const[t,n]=p.useState([]),[i,r]=p.useState(""),[s,o]=p.useState(1),[l,c]=p.useState(0),[u,d]=p.useState(!1),[f,h]=p.useState(!1),[m,g]=p.useState(null),[b,v]=p.useState(""),[y,w]=p.useState(""),[x,O]=p.useState(""),[k,S]=p.useState(0),C=p.useRef(!1),E=p.useRef(null),j=e?JSON.stringify(e):"",T=e?JSON.stringify({...e,search:y}):"";p.useEffect(()=>{const I=window.setTimeout(()=>{w(b.trim())},250);return()=>window.clearTimeout(I)},[b]),p.useEffect(()=>{v(""),w("")},[j]);const R=p.useCallback((I,D)=>{var F;if(!T)return;(F=E.current)==null||F.abort();const _=new AbortController;E.current=_;const L=JSON.parse(T);D&&n([]),C.current=!0,h(!0),g(null),jTe({...L,pageNumber:I,pageSize:100},_.signal).then(M=>{n(V=>{if(D)return M.items;const q=new Set(V.map(U=>`${U.id}\0${U.name}`));return[...V,...M.items.filter(U=>!q.has(`${U.id}\0${U.name}`))]}),r(M.serviceRegion),o(M.pageNumber),c(M.totalCount),d(M.hasMore),O(T)}).catch(M=>{M instanceof DOMException&&M.name==="AbortError"||(O(T),g(M instanceof Error?M.message:String(M)))}).finally(()=>{E.current===_&&(E.current=null,C.current=!1,h(!1))})},[T]);p.useEffect(()=>{var I;if(!T){(I=E.current)==null||I.abort(),E.current=null,C.current=!1,n([]),r(""),o(1),c(0),d(!1),O(""),h(!1),g(null);return}return R(1,!0),()=>{var D;return(D=E.current)==null?void 0:D.abort()}},[R,T,k]);const A=!!T&&x===T&&b.trim()===y,N=p.useCallback(()=>{O(""),S(I=>I+1)},[]),P=p.useCallback(()=>{!A||C.current||!u||R(s+1,!1)},[u,R,s,A]);return{items:t,serviceRegion:i,totalCount:l,hasMore:A?u:!1,loading:!!T&&(!A||f),error:m,search:b,setSearch:v,reload:N,loadMore:P}}function hZt(e,t){return e.map(n=>({value:n[t],label:n.name,description:[n.status,n.region,n.id].filter(Boolean).join(" · ")}))}function gp({ariaLabel:e,value:t,valueLabel:n,state:i,disabled:r,disabledMessage:s,valueField:o="id",onChange:l}){const{t:c}=Te("ui"),u=p.useMemo(()=>hZt(i.items,o),[i.items,o]);return a.jsxs("div",{className:"pp-resource-picker",children:[a.jsx(vf,{ariaLabel:e,value:t,valueLabel:n,placeholder:i.loading?c("common.loading"):c("deploymentResources.selectExisting"),options:u,disabled:r||!!i.error,searchValue:i.search,searchPlaceholder:c("deploymentResources.searchResource"),loading:i.loading,hasMore:i.hasMore,emptyMessage:i.search.trim()?c("deploymentResources.noMatch"):c("deploymentResources.noAvailable"),onSearchChange:i.setSearch,onLoadMore:i.loadMore,onChange:d=>{const f=i.items.find(h=>h[o]===d);f&&l(f)}}),s?a.jsx("span",{className:"pp-resource-status",children:s}):i.error?a.jsxs("div",{className:"pp-resource-error",role:"alert",children:[a.jsx("span",{children:i.error}),a.jsx("button",{type:"button",onClick:i.reload,children:c("common.retry")})]}):i.loading&&i.items.length===0?a.jsx("span",{className:"pp-resource-status","aria-live":"polite",children:i.search.trim()?c("deploymentResources.searching"):c("deploymentResources.loading")}):i.items.length===0?a.jsx("span",{className:"pp-resource-status",children:i.search.trim()?c("deploymentResources.noMatchSentence"):c("deploymentResources.noAvailableSentence")}):i.serviceRegion?a.jsx("span",{className:"pp-resource-status",children:c("deploymentResources.loadedSummary",{region:i.serviceRegion,loaded:i.items.length,total:i.totalCount>0?`/${i.totalCount}`:""})}):null]})}function k9e({region:e,value:t,disabled:n=!1,onChange:i}){const{t:r}=Te("ui"),s=mp(e?{kind:"cr-registry",region:e}:null),o=mp(e&&(t!=null&&t.registry)?{kind:"cr-namespace",region:e,registry:t.registry}:null),l=mp(e&&(t!=null&&t.registry)&&t.namespace?{kind:"cr-repository",region:e,registry:t.registry,namespace:t.namespace}:null),c=t??{region:e,registry:"",namespace:"",repository:""};return a.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three environment-repository-fields",children:[a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:r("deploymentResources.registryInstance")}),a.jsx(gp,{ariaLabel:r("deploymentResources.registryAriaLabel"),value:c.registry,valueLabel:c.registry,state:s,disabled:n||!e,valueField:"name",onChange:u=>i({region:e,registry:u.name,namespace:"",repository:""})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:r("deploymentResources.namespace")}),a.jsx(gp,{ariaLabel:r("deploymentResources.namespaceAriaLabel"),value:c.namespace,valueLabel:c.namespace,state:o,disabled:n||!c.registry,disabledMessage:c.registry?void 0:r("deploymentResources.selectRegistryFirst"),valueField:"name",onChange:u=>i({...c,region:e,namespace:u.name,repository:""})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:r("deploymentResources.repository")}),a.jsx(gp,{ariaLabel:r("deploymentResources.existingRepository"),value:c.repository,valueLabel:c.repository,state:l,disabled:n||!c.registry||!c.namespace,disabledMessage:c.registry?c.namespace?void 0:r("deploymentResources.selectNamespaceFirst"):r("deploymentResources.selectRegistryFirst"),valueField:"name",onChange:u=>i({...c,region:e,repository:u.name})})]})]})}function m6({resource:e,value:t,disabled:n,onChange:i}){const{t:r}=Te("ui");return a.jsxs("label",{className:"pp-resource-field pp-resource-mode",children:[a.jsx("span",{children:r("deploymentResources.configurationMode")}),a.jsx(vf,{ariaLabel:r("deploymentResources.configurationModeAriaLabel",{resource:e}),value:t,placeholder:r("deploymentResources.selectConfigurationMode"),options:fZt(r),disabled:n,onChange:s=>i(s)})]})}function Wv({label:e,value:t,placeholder:n,disabled:i,onChange:r}){return a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:e}),a.jsx("input",{value:t,placeholder:n,disabled:i,autoComplete:"off",onChange:s=>r(s.currentTarget.value)})]})}function g6({items:e,note:t}){const{t:n}=Te("ui");return a.jsxs("div",{className:"pp-resource-auto-names",children:[a.jsx("span",{children:n("deploymentResources.automaticNames")}),a.jsx("dl",{children:e.map(i=>a.jsxs("div",{children:[a.jsx("dt",{children:i.label}),a.jsx("dd",{title:i.name,children:i.name})]},i.label))}),t&&a.jsx("small",{children:t})]})}function S9e(e){var t,n,i,r,s,o,l,c;return e.tos.mode!=="auto"&&!((t=e.tos.bucket)!=null&&t.trim())?bn.t("ui:deploymentResources.validation.tos"):e.cr.mode!=="auto"&&(!((n=e.cr.instance)!=null&&n.trim())||!((i=e.cr.namespace)!=null&&i.trim())||!((r=e.cr.repository)!=null&&r.trim()))?bn.t("ui:deploymentResources.validation.cr"):e.codePipeline.mode!=="auto"&&(!((s=e.codePipeline.workspaceName)!=null&&s.trim())||!((o=e.codePipeline.pipelineName)!=null&&o.trim()))?bn.t("ui:deploymentResources.validation.codePipeline"):e.codePipeline.mode==="existing"&&(!((l=e.codePipeline.workspaceId)!=null&&l.trim())||!((c=e.codePipeline.pipelineId)!=null&&c.trim()))?bn.t("ui:deploymentResources.validation.existingCodePipeline"):null}function E9e({value:e,agentName:t,runtimeName:n,region:i,disabled:r,validationError:s,onChange:o}){const{t:l}=Te("ui"),c=t.trim()||"agentkit-app",u=n.trim()||c,d=i&&i!=="cn-beijing"?l("deploymentResources.autoBucketWithRegion",{region:i.startsWith("cn-")?i.slice(3):i}):l("deploymentResources.autoBucket"),f=mp(e.tos.mode==="existing"?{kind:"tos-bucket",region:i}:null),h=mp(e.cr.mode==="existing"?{kind:"cr-registry",region:i}:null),m=mp(e.cr.mode==="existing"&&e.cr.instance?{kind:"cr-namespace",region:i,registry:e.cr.instance}:null),g=mp(e.cr.mode==="existing"&&e.cr.instance&&e.cr.namespace?{kind:"cr-repository",region:i,registry:e.cr.instance,namespace:e.cr.namespace}:null),b=mp(e.codePipeline.mode==="existing"?{kind:"cp-workspace",region:i}:null),v=mp(e.codePipeline.mode==="existing"&&e.codePipeline.workspaceId?{kind:"cp-pipeline",region:i,workspaceId:e.codePipeline.workspaceId}:null),y=w=>o({...e,...w});return a.jsxs("div",{className:"pp-resource-list",children:[a.jsxs("div",{className:"pp-resource-item",children:[a.jsx("div",{className:"pp-resource-name",children:l("deploymentResources.tosBucket")}),a.jsxs("div",{className:"pp-resource-grid",children:[a.jsx(m6,{resource:l("deploymentResources.tosBucket"),value:e.tos.mode,disabled:r,onChange:w=>y({tos:{mode:w}})}),e.tos.mode==="create"&&a.jsx(Wv,{label:l("deploymentResources.bucketName"),value:e.tos.bucket??"",placeholder:l("deploymentResources.bucketNamePlaceholder"),disabled:r,onChange:w=>y({tos:{...e.tos,bucket:w}})}),e.tos.mode==="existing"&&a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.existingBucket")}),a.jsx(gp,{ariaLabel:l("deploymentResources.existingTosBucket"),value:e.tos.bucket??"",valueLabel:e.tos.bucket,state:f,disabled:r,onChange:w=>y({tos:{...e.tos,bucket:w.name}})})]}),e.tos.mode==="auto"&&a.jsx(g6,{items:[{label:l("deploymentResources.bucket"),name:d}],note:l("deploymentResources.accountIdResolved")})]})]}),a.jsxs("div",{className:"pp-resource-item",children:[a.jsx("div",{className:"pp-resource-name",children:l("deploymentResources.containerRegistry")}),a.jsxs("div",{className:"pp-resource-grid",children:[a.jsx(m6,{resource:"CR",value:e.cr.mode,disabled:r,onChange:w=>y({cr:{mode:w}})}),e.cr.mode==="create"&&a.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three",children:[a.jsx(Wv,{label:l("deploymentResources.instanceName"),value:e.cr.instance??"",placeholder:l("deploymentResources.crInstance"),disabled:r,onChange:w=>y({cr:{...e.cr,instance:w}})}),a.jsx(Wv,{label:l("deploymentResources.namespace"),value:e.cr.namespace??"",placeholder:l("deploymentResources.namespace"),disabled:r,onChange:w=>y({cr:{...e.cr,namespace:w}})}),a.jsx(Wv,{label:l("deploymentResources.repository"),value:e.cr.repository??"",placeholder:l("deploymentResources.repository"),disabled:r,onChange:w=>y({cr:{...e.cr,repository:w}})})]}),e.cr.mode==="existing"&&a.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three",children:[a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.crInstance")}),a.jsx(gp,{ariaLabel:l("deploymentResources.existingCrInstance"),value:e.cr.instance??"",valueLabel:e.cr.instance,state:h,disabled:r,valueField:"name",onChange:w=>y({cr:{mode:"existing",instance:w.name}})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.namespace")}),a.jsx(gp,{ariaLabel:l("deploymentResources.existingCrNamespace"),value:e.cr.namespace??"",valueLabel:e.cr.namespace,state:m,disabled:r||!e.cr.instance,valueField:"name",onChange:w=>y({cr:{...e.cr,namespace:w.name,repository:void 0}})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.repository")}),a.jsx(gp,{ariaLabel:l("deploymentResources.existingCrRepository"),value:e.cr.repository??"",valueLabel:e.cr.repository,state:g,disabled:r||!e.cr.namespace,valueField:"name",onChange:w=>y({cr:{...e.cr,repository:w.name}})})]})]}),e.cr.mode==="auto"&&a.jsx(g6,{items:[{label:l("deploymentResources.crInstance"),name:l("deploymentResources.autoRegistry")},{label:l("deploymentResources.namespace"),name:"agentkit"},{label:l("deploymentResources.repository"),name:l("deploymentResources.autoRepositoryName",{name:c})}],note:l("deploymentResources.registryNameNote")})]})]}),a.jsxs("div",{className:"pp-resource-item",children:[a.jsx("div",{className:"pp-resource-name",children:"CodePipeline"}),a.jsxs("div",{className:"pp-resource-grid",children:[a.jsx(m6,{resource:"CodePipeline",value:e.codePipeline.mode,disabled:r,onChange:w=>y({codePipeline:{mode:w}})}),e.codePipeline.mode==="create"&&a.jsxs("div",{className:"pp-resource-fields",children:[a.jsx(Wv,{label:l("deploymentResources.workspaceName"),value:e.codePipeline.workspaceName??"",placeholder:l("deploymentResources.workspaceName"),disabled:r,onChange:w=>y({codePipeline:{...e.codePipeline,workspaceName:w}})}),a.jsx(Wv,{label:l("deploymentResources.pipelineName"),value:e.codePipeline.pipelineName??"",placeholder:l("deploymentResources.pipelineName"),disabled:r,onChange:w=>y({codePipeline:{...e.codePipeline,pipelineName:w}})})]}),e.codePipeline.mode==="existing"&&a.jsxs("div",{className:"pp-resource-fields",children:[a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.workspace")}),a.jsx(gp,{ariaLabel:l("deploymentResources.existingWorkspace"),value:e.codePipeline.workspaceId??"",valueLabel:e.codePipeline.workspaceName,state:b,disabled:r,onChange:w=>y({codePipeline:{mode:"existing",workspaceId:w.id,workspaceName:w.name}})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.compatiblePipeline")}),a.jsx(gp,{ariaLabel:l("deploymentResources.existingPipeline"),value:e.codePipeline.pipelineId??"",valueLabel:e.codePipeline.pipelineName,state:v,disabled:r||!e.codePipeline.workspaceId,onChange:w=>y({codePipeline:{...e.codePipeline,pipelineId:w.id,pipelineName:w.name}})})]})]}),e.codePipeline.mode==="auto"&&a.jsx(g6,{items:[{label:l("deploymentResources.workspace"),name:"agentkit-cli-workspace"},{label:l("deploymentResources.pipeline"),name:u}],note:l("deploymentResources.pipelineNameNote")})]})]}),s&&a.jsx("p",{className:"pp-resource-validation",role:"alert",children:s})]})}function pZt(e){return[{value:"custom",label:e("environmentCenter.creation.custom.label"),description:e("environmentCenter.creation.custom.description")},{value:"dockerfile",label:e("environmentCenter.creation.dockerfile.label"),description:e("environmentCenter.creation.dockerfile.description")},{value:"git",label:e("environmentCenter.creation.git.label"),description:e("environmentCenter.creation.git.description")},{value:"image",label:e("environmentCenter.creation.image.label"),description:e("environmentCenter.creation.image.description")}]}const mZt=DIe.map(e=>({value:e.id,label:e.label,description:e.description}));function gZt(e){return[{value:"none",label:e("common.none"),description:e("environmentCenter.presets.none")},{value:"aio-sandbox",label:"AIO Sandbox",description:e("environmentCenter.presets.aio")},{value:"codex-sandbox",label:"Codex Sandbox",description:e("environmentCenter.presets.codex")}]}function bZt(e){const t=oZt(e,"");return t===hH?"aio-sandbox":t.includes("/codexenv:")?"codex-sandbox":"none"}const yZt=vI.map(e=>({value:e.id,label:e.label})),Zoe=LIe.map(e=>({value:e.id,label:e.label}));function vZt(e){return[{value:"managed",label:e("environmentCenter.repository.managed")},{value:"existing",label:e("environmentCenter.repository.existing")}]}const X7=20,Joe=new Set;function xZt(e){const t=e instanceof Error?e.message:String(e??"");return t.includes("HTTP 503")&&(t.includes("未配置持久化存储")||t.includes("storage is not configured"))}async function wZt(){var e;if(typeof navigator>"u"||!((e=navigator.permissions)!=null&&e.query))return!1;try{return(await navigator.permissions.query({name:"clipboard-read"})).state==="denied"}catch{return!1}}const OZt={opencli:jYt,uv:NYt,playwright:RYt,chromium:IYt,git:PYt,curl:DYt,ffmpeg:MYt,imagemagick:LYt};function kZt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function af(){return a.jsx("span",{className:"environment-required-mark","aria-hidden":"true",children:"*"})}function SZt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M12 3v11m0 0 4-4m-4 4-4-4"}),a.jsx("path",{d:"M5 16v2.5A2.5 2.5 0 0 0 7.5 21h9a2.5 2.5 0 0 0 2.5-2.5V16"})]})}function Y7(e,t){const n=e.trim();if(!n)return t("environmentCenter.errors.repositoryRequired");try{const i=new URL(n);if(i.protocol!=="https:"||!i.hostname)return t("environmentCenter.errors.repositoryHttps")}catch{return t("environmentCenter.errors.repositoryInvalid")}return""}function ele(e){return!!(e!=null&&e.region&&e.registry&&e.namespace&&e.repository)}function C9e(e,t){const n=e.trim();return n?/\s/.test(n)?t("environmentCenter.errors.imageReferenceWhitespace"):n.startsWith("sha256:")?/^sha256:[0-9a-fA-F]{64}$/.test(n)?"":t("environmentCenter.errors.imageDigestInvalid"):/[@/]/.test(n)?t("environmentCenter.errors.imageTagOnly"):"":""}function EZt(e){return(e instanceof Error?e.message:String(e)).split(` -原始响应:`,1)[0].trim()}function CZt(e){return a.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5.5 10.5 16 5l10.5 5.5L16 16 5.5 10.5Z"}),a.jsx("path",{d:"M5.5 16 16 21.5 26.5 16M5.5 21.5 16 27l10.5-5.5"})]})}function AZt({label:e}){return a.jsx("span",{className:"environment-package-fallback",children:e.slice(0,1).toUpperCase()})}function TZt({option:e}){if(e.id==="lark-cli")return a.jsx("img",{src:PL,alt:""});if(e.id==="pandoc")return a.jsx("img",{src:_Yt,alt:""});if(e.id==="github-cli")return a.jsx(bK,{});const t=OZt[e.id];return t?a.jsx("img",{src:t,alt:""}):a.jsx(AZt,{label:e.label})}function _Zt(e,t){return e?{name:e.name,description:e.description,baseEnvironment:e.baseEnvironment,operatingSystem:e.operatingSystem,language:e.language,optionIds:[...e.optionIds],selectedSkills:[...e.selectedSkills],dockerfile:e.dockerfile===mH(e,t)?void 0:e.dockerfile,gitSource:e.gitSource,containerRepository:e.containerRepository,imageSource:e.imageSource}:{...a4,optionIds:[...a4.optionIds],selectedSkills:[...a4.selectedSkills]}}const $y=new Set(["preparing","queued","building","scanning"]),tle=3e3,b6={preparing:"environmentCenter.buildStatus.preparing",queued:"environmentCenter.buildStatus.queued",building:"environmentCenter.buildStatus.building",scanning:"environmentCenter.buildStatus.scanning",available:"environmentCenter.buildStatus.available",failed:"environmentCenter.buildStatus.failed"};function A9e(e,t){var i;const n=(i=e.latestVersion)==null?void 0:i.status;return n?n==="available"?{label:t(b6[n]),color:"success"}:n==="failed"?{label:t(b6[n]),color:"danger"}:{label:t(b6[n]),color:"warning"}:{label:t("environmentCenter.buildStatus.notBuilt"),color:"secondary"}}function jZt(e,t){return FT(e,Date.now(),t)}function NZt(e,t){const n=Date.parse(e);return Number.isNaN(n)?e:new Intl.DateTimeFormat(t,{dateStyle:"medium",timeStyle:"medium"}).format(n)}function RZt(e,t,n=Date.now()){const i=Date.parse(e.createdAt),s=$y.has(e.status)?n:Date.parse(e.updatedAt);if(Number.isNaN(i)||Number.isNaN(s))return"";const o=Math.max(0,Math.floor((s-i)/1e3));if(o<60)return t("environmentCenter.duration.seconds",{count:o});const l=Math.floor(o/60),c=o%60;return l<60?t("environmentCenter.duration.minutesSeconds",{minutes:l,seconds:c}):t("environmentCenter.duration.hoursMinutes",{hours:Math.floor(l/60),minutes:l%60})}function IZt({environment:e,onClose:t}){var x;const{t:n}=Te("ui"),i=((x=e.latestVersion)==null?void 0:x.versionId)??"",r=p.useId(),s=p.useRef(null),o=p.useRef(t),[l,c]=p.useState(null),[u,d]=p.useState(!0),[f,h]=p.useState(""),[m,g]=p.useState(0),[b,v]=p.useState("idle"),y=p.useMemo(()=>l?dZt(l):"",[l]);o.current=t,p.useEffect(()=>{var C;const O=document.body.style.overflow,k=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(C=s.current)==null||C.focus();const S=E=>{if(E.key==="Escape"){E.preventDefault(),o.current();return}if(E.key!=="Tab"||!s.current)return;const j=Array.from(s.current.querySelectorAll('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])')).filter(A=>A.getClientRects().length>0);if(!j.length)return;const T=j[0],R=j[j.length-1];E.shiftKey&&document.activeElement===T?(E.preventDefault(),R.focus()):!E.shiftKey&&document.activeElement===R&&(E.preventDefault(),T.focus())};return window.addEventListener("keydown",S),()=>{document.body.style.overflow=O,window.removeEventListener("keydown",S),k!=null&&k.isConnected&&k.focus()}},[]),p.useEffect(()=>{const O=new AbortController;return d(!0),h(""),ZTe(e.id,i,O.signal).then(c).catch(k=>{(k==null?void 0:k.name)!=="AbortError"&&h(k instanceof Error?k.message:String(k))}).finally(()=>{O.signal.aborted||d(!1)}),()=>O.abort()},[e.id,m,i]),p.useEffect(()=>{if(b!=="copied")return;const O=window.setTimeout(()=>v("idle"),1500);return()=>window.clearTimeout(O)},[b]);const w=async()=>{try{await navigator.clipboard.writeText(y),v("copied")}catch{v("error")}};return yi.createPortal(a.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:O=>{O.target===O.currentTarget&&t()},children:a.jsxs("section",{ref:s,className:"environment-build-dialog environment-manifest-dialog",role:"dialog","aria-modal":"true","aria-labelledby":r,"aria-busy":u||void 0,tabIndex:-1,children:[a.jsxs("header",{className:"environment-build-dialog__header",children:[a.jsxs("div",{children:[a.jsx("div",{className:"environment-build-dialog__title-row",children:a.jsx("h2",{id:r,children:n("environmentCenter.manifest.title")})}),a.jsxs("p",{children:[e.name," / ",i]})]}),a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,onClick:t,"aria-label":n("environmentCenter.manifest.closeLabel"),children:a.jsx(Do,{"aria-hidden":!0})})]}),a.jsx("div",{className:"environment-manifest-dialog__body",children:u?a.jsx("div",{className:"environment-manifest-dialog__state",role:"status",children:a.jsx(fn,{as:"span",children:n("environmentCenter.manifest.loading")})}):f?a.jsxs("div",{className:"environment-manifest-dialog__state is-error",role:"alert",children:[a.jsx("p",{children:f}),a.jsx(_t,{type:"button",color:"secondary",variant:"soft",size:"sm",onClick:()=>g(O=>O+1),children:n("common.reload")})]}):a.jsx("div",{className:"environment-manifest-dialog__editor","aria-label":n("environmentCenter.manifest.editorLabel"),children:a.jsx(MT,{value:y,path:"environment.yaml",readOnly:!0,onChange:()=>{}})})}),a.jsxs("footer",{className:"environment-build-dialog__actions",children:[b==="error"?a.jsx("span",{className:"environment-manifest-dialog__copy-error",role:"alert",children:n("environmentCenter.manifest.copyFailed")}):null,a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"sm",onClick:t,children:n("common.close")}),a.jsx(_t,{type:"button",color:"info",size:"sm",disabled:!y,onClick:()=>void w(),children:n(b==="copied"?"environmentCenter.manifest.copied":"environmentCenter.manifest.copy")})]})]})}),document.body)}function PZt({environment:e,onClose:t,onBuildUpdate:n,onRebuild:i}){var S,C;const{t:r}=Te("ui"),s=e.latestVersion,[o,l]=p.useState(s),[c,u]=p.useState(!!s),[d,f]=p.useState(""),[h,m]=p.useState(Date.now()),[g,b]=p.useState(!1),v=p.useId(),y=p.useRef(null),w=p.useRef(t),x=p.useRef(n);p.useEffect(()=>{w.current=t,x.current=n},[n,t]),p.useEffect(()=>{var R;const E=document.body.style.overflow,j=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(R=y.current)==null||R.focus();const T=A=>{var D;if(A.key==="Escape"&&w.current(),A.key!=="Tab")return;const N=Array.from(((D=y.current)==null?void 0:D.querySelectorAll('button:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])'))??[]).filter(_=>_.getClientRects().length>0);if(!N.length)return;const P=N[0],I=N[N.length-1];A.shiftKey&&document.activeElement===P?(A.preventDefault(),I.focus()):!A.shiftKey&&document.activeElement===I&&(A.preventDefault(),P.focus())};return window.addEventListener("keydown",T),()=>{document.body.style.overflow=E,window.removeEventListener("keydown",T),j!=null&&j.isConnected&&j.focus()}},[]),p.useEffect(()=>{if(!s)return;let E=0;const j=new AbortController,T=async()=>{u(!0);try{const R=await YTe(e.id,s.versionId,{includeLogs:!0,signal:j.signal});l(R),f(""),x.current(R),$y.has(R.status)&&(E=window.setTimeout(T,tle))}catch(R){if((R==null?void 0:R.name)==="AbortError")return;f(R instanceof Error?R.message:String(R)),E=window.setTimeout(T,tle)}finally{j.signal.aborted||u(!1)}};return T(),()=>{j.abort(),window.clearTimeout(E)}},[e.id,s==null?void 0:s.versionId]),p.useEffect(()=>{if(!o||!$y.has(o.status))return;const E=window.setInterval(()=>m(Date.now()),1e3);return()=>window.clearInterval(E)},[o==null?void 0:o.status]);const O=o?A9e({...e,latestVersion:o},r):{label:r("environmentCenter.buildStatus.notBuilt"),color:"secondary"},k=e.imageSource||(C=(S=o==null?void 0:o.resources)==null?void 0:S.codePipeline)==null?void 0:C.consoleUrl;return yi.createPortal(a.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:E=>{E.target===E.currentTarget&&t()},children:a.jsxs("section",{ref:y,className:"environment-build-dialog",role:"dialog","aria-modal":"true","aria-labelledby":v,tabIndex:-1,children:[a.jsxs("header",{className:"environment-build-dialog__header",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"environment-build-dialog__title-row",children:[a.jsx("h2",{id:v,children:r("environmentCenter.buildDetails.title")}),a.jsx(Ya,{color:O.color,size:"sm",children:O.label})]}),a.jsx("p",{children:e.name})]}),a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,onClick:t,"aria-label":r("environmentCenter.buildDetails.closeLabel"),children:a.jsx(Do,{"aria-hidden":!0})})]}),a.jsxs("div",{className:"environment-build-dialog__summary",children:[a.jsxs("div",{children:[a.jsx("span",{children:r("environmentCenter.buildDetails.currentStep")}),a.jsx("strong",{children:(o==null?void 0:o.currentStep)||r("environmentCenter.buildDetails.waiting")})]}),a.jsxs("div",{children:[a.jsx("span",{children:r("environmentCenter.buildDetails.elapsed")}),a.jsx("strong",{children:o?RZt(o,r,h):"-"})]}),o!=null&&o.sourceCommitSha?a.jsxs("div",{children:[a.jsx("span",{children:r("environmentCenter.buildDetails.sourceCommit")}),a.jsx("strong",{title:o.sourceCommitSha,children:o.sourceCommitSha.slice(0,12)})]}):null,k?a.jsxs("a",{href:k,target:"_blank",rel:"noreferrer",children:[r("environmentCenter.buildDetails.openCodePipeline")," ",a.jsx(p0,{"aria-hidden":!0})]}):null]}),a.jsxs("div",{className:"environment-build-dialog__body",children:[d?a.jsx("p",{className:"environment-build-dialog__error",role:"alert",children:d}):null,o!=null&&o.progressError?a.jsx("p",{className:"environment-build-dialog__notice",children:o.progressError}):null,a.jsx(QYt,{steps:(o==null?void 0:o.steps)??[],log:(o==null?void 0:o.logTail)??"",logError:o==null?void 0:o.logError,logTruncated:o==null?void 0:o.logTruncated,logUpdatedAt:o==null?void 0:o.logUpdatedAt,loading:c&&!!(o&&$y.has(o.status))}),(o==null?void 0:o.status)==="failed"&&o.error?a.jsx("p",{className:"environment-build-dialog__failure",role:"alert",children:o.error}):null]}),a.jsxs("footer",{className:"environment-build-dialog__actions",children:[a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"sm",onClick:t,children:r("common.close")}),o&&!e.imageSource&&!$y.has(o.status)?a.jsx(_t,{type:"button",color:"info",size:"sm",disabled:g,onClick:()=>{b(!0),i().then(t).finally(()=>b(!1))},children:r(g?"environmentCenter.buildDetails.starting":"environmentCenter.buildDetails.rebuild")}):null]})]})}),document.body)}function T9e({cloudProvider:e,value:t,disabled:n,onChange:i}){const{t:r}=Te("ui"),s=_u(e).map(o=>({value:o.value,label:o.label}));return a.jsxs("label",{className:"environment-field environment-region-field",children:[a.jsxs("span",{children:[r("environmentCenter.region"),a.jsx(af,{})]}),a.jsx(ha,{id:"environment-region",value:t,options:s,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:n,triggerClassName:"environment-select-trigger",onChange:o=>i(o.value)})]})}function DZt({repositoryUrl:e,gitRef:t,dockerfilePath:n,inspection:i,inspectedKey:r,disabled:s,onRepositoryUrlChange:o,onGitRefChange:l,onDockerfilePathChange:c,onInspectionChange:u,onInspectedKeyChange:d}){const{t:f}=Te("ui"),[h,m]=p.useState(!1),[g,b]=p.useState(""),v=p.useRef(null),y=p.useRef(""),w=`${e.trim()}\0${t.trim()}`,x=r===w;p.useEffect(()=>()=>{const C=v.current;v.current=null,C==null||C.abort()},[]);const O=()=>{var C;(C=v.current)==null||C.abort(),v.current=null,m(!1),b(""),u(null),d(""),c(""),y.current=""},k=p.useCallback(async()=>{var j;const C=Y7(e,f);if(C){b(C);return}y.current=w,(j=v.current)==null||j.abort();const E=new AbortController;v.current=E,m(!0),b("");try{const T=await zTe({repositoryUrl:e.trim(),...t.trim()?{ref:t.trim()}:{}},E.signal);if(v.current!==E)return;u(T),d(w),c(T.dockerfiles.length===1?T.dockerfiles[0]:"")}catch(T){if((T==null?void 0:T.name)==="AbortError")return;b(EZt(T)),u(null),d(""),c("")}finally{v.current===E&&(v.current=null,m(!1))}},[w,t,c,d,u,e,f]);p.useEffect(()=>{if(s||x||y.current===w||Y7(e,f))return;const C=window.setTimeout(()=>void k(),600);return()=>window.clearTimeout(C)},[w,s,k,x,e,f]);const S=x?(i==null?void 0:i.dockerfiles)??[]:[];return a.jsxs("section",{className:"environment-source-section","aria-label":f("environmentCenter.git.sectionLabel"),children:[a.jsxs("div",{className:"environment-form-grid environment-git-fields",children:[a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[f("environmentCenter.git.address"),a.jsx(af,{})]}),a.jsx(_s,{size:"lg",type:"url",required:!0,value:e,placeholder:"https://github.com/owner/repository.git",autoComplete:"url",disabled:s,"aria-invalid":!!g,onChange:C=>{O(),o(C.currentTarget.value)}})]}),a.jsxs("label",{className:"environment-field",children:[a.jsx("span",{children:f("environmentCenter.git.ref")}),a.jsx(_s,{size:"lg",value:t,placeholder:f("environmentCenter.git.defaultBranch"),autoComplete:"off",disabled:s,onChange:C=>{O(),l(C.currentTarget.value)}})]})]}),a.jsxs("div",{className:"environment-inspection-status environment-form-feedback","aria-live":"polite",children:[h?a.jsx(fn,{as:"span",children:f("environmentCenter.git.inspecting")}):null,g?a.jsxs("div",{className:"environment-source-error",role:"alert",children:[a.jsx("span",{children:g}),a.jsxs(_t,{type:"button",color:"primary",size:"sm",pill:!1,disabled:s,onClick:()=>void k(),children:[a.jsx(JD,{}),f("common.retry")]})]}):null,!h&&!g&&x&&i?S.length>0?a.jsx("span",{children:i.commitSha?f("environmentCenter.git.foundDockerfiles",{commit:i.commitSha.slice(0,12),count:S.length}):f("environmentCenter.git.savedDockerfileLoaded")}):a.jsxs("div",{className:"environment-source-error",role:"alert",children:[a.jsx("span",{children:f("environmentCenter.git.noDockerfile")}),a.jsx("button",{type:"button",disabled:s,onClick:()=>void k(),children:f("environmentCenter.git.inspectAgain")})]}):null]}),S.length>0?a.jsxs("label",{className:"environment-field environment-dockerfile-picker",children:[a.jsxs("span",{children:["Dockerfile",a.jsx(af,{})]}),a.jsx(vf,{ariaLabel:f("environmentCenter.git.selectDockerfile"),value:n,valueLabel:n,placeholder:f("environmentCenter.git.selectDockerfile"),options:S.map(C=>({value:C,label:C})),disabled:s||h,onChange:c})]}):null]})}function MZt({cloudProvider:e,mode:t,region:n,value:i,disabled:r,onModeChange:s,onRegionChange:o,onChange:l}){const{t:c}=Te("ui");return a.jsx("section",{className:"environment-source-section","aria-label":c("environmentCenter.repository.outputSection"),children:a.jsxs("div",{className:"environment-form-grid",children:[a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[c("environmentCenter.repository.type"),a.jsx(af,{})]}),a.jsx(ha,{id:"environment-repository-mode",value:t,options:vZt(c),optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:r,triggerClassName:"environment-select-trigger",onChange:u=>s(u.value)})]}),a.jsx(T9e,{cloudProvider:e,value:n,disabled:r,onChange:o}),t==="existing"?a.jsx(k9e,{region:n,value:i,disabled:r,onChange:l}):a.jsx("p",{className:"environment-source-note environment-form-feedback",children:c("environmentCenter.repository.managedHint")})]})})}function LZt({cloudProvider:e,region:t,repository:n,reference:i,disabled:r,onRegionChange:s,onRepositoryChange:o,onReferenceChange:l}){const{t:c}=Te("ui"),u=C9e(i,c);return a.jsx("section",{className:"environment-source-section","aria-label":c("environmentCenter.existingImage.sectionLabel"),children:a.jsxs("div",{className:"environment-form-grid",children:[a.jsx(T9e,{cloudProvider:e,value:t,disabled:r,onChange:s}),a.jsx(k9e,{region:t,value:n,disabled:r,onChange:o}),a.jsxs("label",{className:"environment-field environment-image-reference",children:[a.jsxs("span",{children:[c("environmentCenter.existingImage.reference"),a.jsx(af,{})]}),a.jsx(_s,{size:"lg",value:i,required:!0,placeholder:c("environmentCenter.existingImage.placeholder"),autoComplete:"off",disabled:r,"aria-invalid":!!u,onChange:d=>l(d.currentTarget.value)}),u?a.jsx("small",{className:"environment-source-field__error",role:"alert",children:u}):a.jsx("small",{children:c("environmentCenter.existingImage.hint")})]})]})})}function _9e(e,t,n,i){const r=p.useRef(n),s=p.useRef(i);r.current=n,s.current=i,p.useEffect(()=>{const o=document.body.style.overflow,l=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden";const c=window.requestAnimationFrame(()=>{var d;return(d=t.current)==null?void 0:d.focus()}),u=d=>{var g;if(d.key==="Escape"&&!s.current){d.preventDefault(),r.current();return}if(d.key!=="Tab")return;const f=Array.from(((g=e.current)==null?void 0:g.querySelectorAll('button:not([disabled]), textarea:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])'))??[]).filter(b=>b.getClientRects().length>0);if(!f.length)return;const h=f[0],m=f[f.length-1];d.shiftKey&&document.activeElement===h?(d.preventDefault(),m.focus()):!d.shiftKey&&document.activeElement===m&&(d.preventDefault(),h.focus())};return window.addEventListener("keydown",u),()=>{window.cancelAnimationFrame(c),document.body.style.overflow=o,window.removeEventListener("keydown",u),l!=null&&l.isConnected&&l.focus()}},[e,t])}function $Zt({environment:e,onClose:t}){const{t:n}=Te("ui"),i=p.useId(),r=p.useId(),s=p.useRef(null),o=p.useRef(null),[l,c]=p.useState(""),[u,d]=p.useState("loading"),[f,h]=p.useState(""),m=u==="loading";_9e(s,o,t,m);const g=async(b="",v)=>{d("loading"),h("");try{const y=b||(await VTe(e.id,v)).shareCode;c(y),await ITe(y),v!=null&&v.aborted||d("copied")}catch(y){if((y==null?void 0:y.name)==="AbortError")return;h(y instanceof Error?y.message:String(y)),d("error")}};return p.useEffect(()=>{const b=new AbortController;return g("",b.signal),()=>b.abort()},[e.id]),yi.createPortal(a.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:b=>{b.target===b.currentTarget&&!m&&t()},children:a.jsxs("section",{ref:s,className:"environment-share-dialog",role:"dialog","aria-modal":"true","aria-labelledby":i,"aria-describedby":r,"aria-busy":m||void 0,children:[a.jsxs("header",{className:"environment-build-dialog__header",children:[a.jsxs("div",{children:[a.jsx("h2",{id:i,children:n("environmentCenter.share.title")}),a.jsx("p",{id:r,children:e.name})]}),a.jsx(_t,{ref:o,type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,disabled:m,onClick:t,"aria-label":n("environmentCenter.share.closeLabel"),children:a.jsx(Do,{"aria-hidden":!0})})]}),a.jsx("div",{className:"environment-share-dialog__body",children:u==="loading"?a.jsx(fn,{as:"p",children:n("environmentCenter.share.generating")}):a.jsxs("div",{className:"environment-share-dialog__result",children:[u==="copied"?a.jsx("p",{className:"environment-share-dialog__success",role:"status","aria-live":"polite",children:n("environmentCenter.share.copied")}):a.jsxs("div",{className:"environment-share-dialog__error",role:"alert",children:[a.jsx("strong",{children:n("environmentCenter.share.failed")}),a.jsx("span",{children:f})]}),l?a.jsxs("label",{className:"environment-share-dialog__field environment-share-dialog__manual-code",children:[a.jsx("span",{children:n("environmentCenter.share.code")}),a.jsx(vb,{size:"lg",rows:4,value:l,readOnly:!0,"aria-label":n("environmentCenter.share.fullCode"),onFocus:b=>b.currentTarget.select(),onClick:b=>b.currentTarget.select()}),a.jsx("small",{children:n(u==="copied"?"environmentCenter.share.copiedHint":"environmentCenter.share.copyFailedHint")})]}):null,a.jsx("p",{className:"environment-share-dialog__safety",children:n("environmentCenter.share.safety")})]})}),a.jsxs("footer",{className:"environment-build-dialog__actions",children:[a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:m,onClick:t,children:n("common.close")}),u==="error"?a.jsx(_t,{type:"button",color:"info",size:"sm",onClick:()=>void g(l),children:n("common.retry")}):u==="copied"?a.jsx(_t,{type:"button",color:"info",size:"sm",onClick:()=>void g(l),children:n("environmentCenter.share.copyAgain")}):null]})]})}),document.body)}function FZt({initialValue:e,autoInspect:t,onClose:n,onImported:i}){const{t:r}=Te("ui"),s=p.useId(),o=p.useId(),l=p.useId(),c=p.useRef(null),u=p.useRef(null),d=p.useRef(!1),[f,h]=p.useState(e),[m,g]=p.useState("editing"),[b,v]=p.useState([]),[y,w]=p.useState(""),[x,O]=p.useState([]),k=p.useMemo(()=>Iz(f),[f]),S=k.length>X7,C=m==="inspecting"||m==="importing",E=b.filter(P=>P.status==="valid"),j=b.filter(P=>P.status==="invalid"),T=m==="ready"&&E.length>0;_9e(c,u,n,C);const R=p.useCallback(async()=>{if(!(!k.length||S)){g("inspecting"),w(""),O([]);try{const P=await HTe(k);v([...P].sort((I,D)=>I.index-D.index)),g("ready")}catch(P){w(P instanceof Error?P.message:String(P)),g("editing")}}},[k,S]);p.useEffect(()=>{!t||d.current||(d.current=!0,R())},[t,R]);const A=async()=>{if(T){g("importing"),w(""),O([]);try{const P=E.map(U=>({code:k[U.index],name:U.name})).filter(U=>!!U.code),I=await qTe(P.map(U=>U.code)),D=I.filter(U=>U.status==="created").length,_=I.filter(U=>U.status==="duplicate").length,L=new Map(I.map(U=>[U.index,U])),F=P.flatMap(({code:U,name:J},z)=>{const Z=L.get(z);return!Z||Z.status==="failed"?[{code:U,name:J,status:"valid",error:(Z==null?void 0:Z.error)||r("environmentCenter.import.noResult")}]:[]}),V=[...j.flatMap(U=>{const J=k[U.index];return J?[{code:J,name:"",status:"invalid",error:U.error||r("environmentCenter.import.invalidCode")}]:[]}),...F],q=new Map;if(I.forEach(U=>{U.environment&&q.set(U.environment.id,U.environment)}),i([...q.values()],D,_,V.length),!V.length){n();return}h(V.map(U=>U.code).join(` -`)),O(F),v(V.map((U,J)=>({index:J,status:U.status,name:U.name,error:U.status==="invalid"?U.error:""}))),w(r("environmentCenter.import.partial",{created:D,remaining:V.length})),g("ready")}catch(P){w(P instanceof Error?P.message:String(P)),g("ready")}}},N=m==="inspecting"?r("environmentCenter.import.inspecting"):m==="importing"?r("environmentCenter.import.importing"):T?x.length?r("environmentCenter.import.retryImport"):r("environmentCenter.import.confirm"):r("environmentCenter.import.inspectCodes");return yi.createPortal(a.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:P=>{P.target===P.currentTarget&&!C&&n()},children:a.jsxs("section",{ref:c,className:"environment-share-dialog environment-import-dialog",role:"dialog","aria-modal":"true","aria-labelledby":s,"aria-describedby":o,"aria-busy":C||void 0,children:[a.jsxs("header",{className:"environment-build-dialog__header",children:[a.jsxs("div",{children:[a.jsx("h2",{id:s,children:r("environmentCenter.import.title")}),a.jsx("p",{id:o,children:r("environmentCenter.import.description")})]}),a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,disabled:C,onClick:n,"aria-label":r("environmentCenter.import.closeLabel"),children:a.jsx(Do,{"aria-hidden":!0})})]}),a.jsxs("div",{className:"environment-share-dialog__body",children:[a.jsxs("label",{className:"environment-share-dialog__field",children:[a.jsx("span",{children:r("environmentCenter.import.code")}),a.jsx(vb,{ref:u,size:"lg",rows:6,value:f,disabled:C,"aria-invalid":S||j.length>0||void 0,"aria-describedby":l,placeholder:"akenv://v1/...",onChange:P=>{h(P.currentTarget.value),g("editing"),v([]),w(""),O([])}})]}),a.jsx("p",{id:l,className:`environment-share-dialog__help${S?" is-error":""}`,children:S?r("environmentCenter.import.tooMany",{max:X7,count:k.length}):r("environmentCenter.import.multipleHint")}),a.jsx("p",{className:"environment-share-dialog__safety",children:r("environmentCenter.import.safety")}),m==="inspecting"?a.jsx(fn,{as:"p",children:r("environmentCenter.import.inspectingCodes")}):E.length?a.jsx("p",{className:"environment-share-dialog__summary",role:"status","aria-live":"polite",children:r("environmentCenter.import.found",{count:E.length,names:E.map(P=>P.name||r("environmentCenter.unnamed")).join(r("environmentCenter.listSeparator"))})}):null,j.length?a.jsx("ul",{className:"environment-share-dialog__failures",role:"alert",children:j.map(P=>a.jsx("li",{children:r("environmentCenter.import.itemError",{index:P.index+1,error:P.error||r("environmentCenter.import.invalidCode")})},P.index))}):null,x.length?a.jsx("ul",{className:"environment-share-dialog__failures",role:"alert",children:x.map((P,I)=>a.jsx("li",{children:r("environmentCenter.import.itemError",{index:I+1,error:P.error})},`${P.code}:${I}`))}):null,y?a.jsx("p",{className:"environment-share-dialog__error-text",role:"alert",children:y}):null]}),a.jsxs("footer",{className:"environment-build-dialog__actions",children:[a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:C,onClick:n,children:r("common.cancel")}),a.jsx(_t,{type:"button",color:"info",size:"sm",loading:C,disabled:C||!k.length||S||m==="ready"&&!T,onClick:()=>T?void A():void R(),children:N})]})]})}),document.body)}function BZt({environment:e,cloudProvider:t,onCancel:n,onDelete:i,onShare:r,onSave:s}){var He,Ue,jt,Pt,Kt,Ct,xt;const{t:o,i18n:l}=Te("ui"),c=pZt(o),u=_Zt(e,t),d=u.dockerfile!==void 0,[f,h]=p.useState(()=>({...u,dockerfile:d?void 0:u.dockerfile})),[m,g]=p.useState(u.gitSource?"git":u.imageSource?"image":d?"dockerfile":"custom"),[b,v]=p.useState(d?(e==null?void 0:e.dockerfile)??"":""),[y,w]=p.useState(""),x=p.useRef(null),[O,k]=p.useState(()=>d?bZt((e==null?void 0:e.dockerfile)??""):u.baseEnvironment==="aio-sandbox"||u.baseEnvironment==="codex-sandbox"?u.baseEnvironment:"none"),[S,C]=p.useState(((He=u.gitSource)==null?void 0:He.repositoryUrl)??""),[E,j]=p.useState(((Ue=u.gitSource)==null?void 0:Ue.ref)??""),[T,R]=p.useState(((jt=u.gitSource)==null?void 0:jt.dockerfilePath)??""),[A,N]=p.useState(u.gitSource?{repositoryUrl:u.gitSource.repositoryUrl,ref:u.gitSource.ref??"",commitSha:"",dockerfiles:[u.gitSource.dockerfilePath]}:null),[P,I]=p.useState(u.gitSource?`${u.gitSource.repositoryUrl}\0${u.gitSource.ref??""}`:""),[D,_]=p.useState(u.containerRepository?"existing":"managed"),[L,F]=p.useState(((Pt=u.containerRepository)==null?void 0:Pt.region)??Zi(t)),[M,V]=p.useState(u.containerRepository??void 0),[q,U]=p.useState(((Kt=u.imageSource)==null?void 0:Kt.region)??Zi(t)),[J,z]=p.useState(u.imageSource?{region:u.imageSource.region,registry:u.imageSource.registry,namespace:u.imageSource.namespace,repository:u.imageSource.repository}:void 0),[Z,ne]=p.useState(((Ct=u.imageSource)==null?void 0:Ct.reference)??""),[W,G]=p.useState(!1),H=p.useMemo(()=>mH(f,t),[t,f.baseEnvironment,f.operatingSystem,f.language,f.optionIds]),se=f.dockerfile??H,Y=O!=="none",X=O==="aio-sandbox"?hH:O==="codex-sandbox"?MIe[t]:"",ie=Y?lZt(b):b,ee=Y?nR(X,""):"",be=Y?nR(X,ie):b,ue=y||(Y?cZt(ie,X,o):vK(b,void 0,o)),pe=!!e,ke="environment-editor-form",[je,Pe]=p.useState(!1),[Ee,ze]=p.useState(""),_e=!!be.trim()&&!ue,ae=`${S.trim()}\0${E.trim()}`,le=!Y7(S,o)&&P===ae&&!!T&&(D==="managed"||ele(M)),ge=ele(J)&&!!Z.trim()&&!C9e(Z,o),Oe=!!f.name.trim()&&!je&&(m==="custom"||m==="dockerfile"&&_e||m==="git"&&le||m==="image"&&ge),Se=(tt,mt)=>{h(Ne=>({...Ne,optionIds:mt?[...Ne.optionIds,tt]:Ne.optionIds.filter(Ot=>Ot!==tt)}))},We=tt=>{w(""),v(Y?nR(X,tt):tt)},Ye=async tt=>{if(!tt)return;const mt=await uZt(tt,o);w(mt.error),mt.content&&v(mt.content)},ye=()=>{w(""),v(ee)},we=async tt=>{if(tt.preventDefault(),!!Oe){Pe(!0),ze("");try{const mt=Cmt(be);await s({...f,name:f.name.trim(),description:f.description.trim(),optionIds:m==="custom"?f.optionIds:[],selectedSkills:m==="custom"?f.selectedSkills:[],dockerfile:m==="dockerfile"?be:m==="custom"?se:"",gitSource:m==="git"?{repositoryUrl:S.trim(),...E.trim()?{ref:E.trim()}:{},dockerfilePath:T}:null,containerRepository:m==="git"&&D==="existing"?M:null,imageSource:m==="image"&&J?{...J,reference:Z.trim()}:null,...m==="dockerfile"?mt:{}})}catch(mt){ze(mt instanceof Error?mt.message:String(mt)),Pe(!1)}}},Ae=f.name.trim()||(pe?(e==null?void 0:e.name)||o("environmentCenter.configure"):o("environmentCenter.create"));return a.jsx(kh,{className:"environment-editor","aria-label":o(pe?"environmentCenter.details":"environmentCenter.create"),children:a.jsx(oT,{title:Ae,description:o("environmentCenter.editorDescription"),identitySeed:Ae,backLabel:o("environmentCenter.backToList"),onBack:n,actions:a.jsxs(a.Fragment,{children:[i?a.jsx(_t,{type:"button",color:"danger",variant:"ghost",size:"sm",onClick:i,disabled:je,children:o("common.delete")}):null,r?a.jsx(_t,{color:"secondary",variant:"soft",size:"sm",onClick:r,disabled:je,children:o("environmentCenter.share.action")}):null,a.jsx(_t,{color:"secondary",variant:"soft",size:"sm",onClick:n,disabled:je,children:o("common.cancel")}),a.jsx(_t,{color:"info",size:"sm",type:"submit",form:ke,disabled:!Oe,children:o(je?"common.saving":m==="image"?pe?"environmentCenter.save":"environmentCenter.create":pe?"environmentCenter.saveAndBuild":"environmentCenter.createAndBuild")})]}),children:a.jsxs("form",{id:ke,className:"environment-form",onSubmit:we,children:[a.jsxs("div",{className:"environment-fields",children:[a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[o("environmentCenter.name"),a.jsx(af,{})]}),a.jsx(_s,{className:"environment-text-input",type:"text",size:"lg",required:!0,value:f.name,maxLength:60,placeholder:o("environmentCenter.namePlaceholder"),onChange:tt=>h(mt=>({...mt,name:tt.target.value}))})]}),a.jsxs("label",{className:"environment-field",children:[a.jsx("span",{children:o("common.description")}),a.jsx(vb,{className:"environment-description-input",size:"lg",rows:3,value:f.description,maxLength:180,placeholder:o("environmentCenter.descriptionPlaceholder"),onChange:tt=>h(mt=>({...mt,description:tt.target.value}))})]})]}),a.jsxs("label",{className:"environment-field environment-creation-method",children:[a.jsxs("span",{children:[o("environmentCenter.creationMethod"),a.jsx(af,{})]}),a.jsx(ha,{id:"environment-creation-method",value:m,options:c,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:tt=>{const mt=tt.value;g(mt),mt==="dockerfile"&&!b.trim()&&v(ee),ze("")}}),a.jsx("small",{children:(xt=c.find(tt=>tt.value===m))==null?void 0:xt.description})]}),Ee?a.jsx("p",{className:"environment-form-error",role:"alert",children:Ee}):null,m==="custom"?a.jsxs("div",{className:"environment-configuration",children:[a.jsx("section",{className:"environment-section environment-form-section","aria-label":o("environmentCenter.baseConfiguration"),children:a.jsxs("div",{className:"environment-form-grid",children:[a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[o("environmentCenter.baseEnvironment"),a.jsx(af,{})]}),a.jsx(ha,{id:"environment-base-environment",value:f.baseEnvironment,options:mZt.map(tt=>({...tt,description:o(`environmentCenter.baseDescriptions.${tt.value}`)})),optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:tt=>{const mt=tt.value,Ne=mt==="aio-sandbox"||mt==="codex-sandbox";h(Ot=>({...Ot,baseEnvironment:mt,operatingSystem:Ne?"ubuntu-22.04":Ot.operatingSystem,language:Ne?"python-3.12":Ot.language}))}}),a.jsx("small",{children:o(`environmentCenter.baseDescriptions.${f.baseEnvironment}`)})]}),a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[o("environmentCenter.operatingSystem"),a.jsx(af,{})]}),a.jsx(ha,{id:"environment-operating-system",value:f.operatingSystem,options:yZt,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:f.baseEnvironment!=="ubuntu",triggerClassName:"environment-select-trigger",onChange:tt=>h(mt=>({...mt,operatingSystem:tt.value}))}),a.jsx("small",{children:f.baseEnvironment!=="ubuntu"?o("environmentCenter.fixedByBase",{base:IB(f.baseEnvironment),value:"Ubuntu 22.04"}):o("environmentCenter.selectUbuntuVersion")})]}),a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[o("environmentCenter.pythonVersion"),a.jsx(af,{})]}),a.jsx(ha,{id:"environment-python-version",value:f.language,options:f.baseEnvironment!=="ubuntu"?Zoe.filter(tt=>tt.value==="python-3.12"):Zoe,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:f.baseEnvironment!=="ubuntu",triggerClassName:"environment-select-trigger",onChange:tt=>h(mt=>({...mt,language:tt.value}))}),a.jsx("small",{children:f.baseEnvironment!=="ubuntu"?o("environmentCenter.fixedByBase",{base:IB(f.baseEnvironment),value:"Python 3.12"}):o("environmentCenter.selectPythonVersion")})]})]})}),a.jsxs("section",{className:"environment-section","aria-labelledby":"environment-skills-title",children:[a.jsx("h2",{id:"environment-skills-title",children:o("environmentCenter.skills")}),a.jsxs("div",{className:"environment-skill-grid",children:[a.jsx(Yoe,{name:"VeADK",description:o("environmentCenter.veadkDescription"),selected:W,disabled:je,onChange:G,icon:a.jsx("img",{src:pM,alt:""})}),a.jsx(yK,{selected:f.selectedSkills,onChange:tt=>h(mt=>({...mt,selectedSkills:tt})),cloudProvider:t,disabled:je,addLabel:o("environmentCenter.addSkill"),showSelectedCount:!1})]})]}),pH.map(tt=>a.jsxs("section",{className:"environment-section","aria-labelledby":`environment-${tt.id}-title`,children:[a.jsx("h2",{id:`environment-${tt.id}-title`,children:o(`environmentCenter.categories.${tt.id}`)}),a.jsx("div",{className:"environment-option-grid",children:tt.options.map(mt=>{const Ne=f.optionIds.includes(mt.id);return a.jsx(Yoe,{name:mt.label,description:o(`environmentCenter.options.${mt.id}`,{defaultValue:mt.description}),selected:Ne,onChange:Ot=>Se(mt.id,Ot),icon:a.jsx(TZt,{option:mt})},mt.id)})})]},tt.id))]}):m==="dockerfile"?a.jsxs("section",{className:"environment-upload","aria-label":o("environmentCenter.customDockerfile"),children:[a.jsx("div",{className:"environment-dockerfile-settings environment-form-grid",children:a.jsxs("label",{className:"environment-field",children:[a.jsx("span",{children:o("environmentCenter.presetEnvironment")}),a.jsx(ha,{id:"environment-dockerfile-base-environment",value:O,options:gZt(o),optionClassName:"environment-select-option",size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:tt=>{w(""),k(tt.value)}}),a.jsx("small",{children:o("environmentCenter.presetHint")})]})}),a.jsxs("div",{className:"environment-upload__preview",children:[a.jsxs("div",{children:[a.jsxs("h3",{children:["Dockerfile",a.jsx(af,{})]}),a.jsxs("div",{className:"environment-upload__actions",children:[a.jsx("span",{className:"environment-upload__size",children:o("environmentCenter.dockerfileSize",{size:w9e(be).toLocaleString(l.resolvedLanguage??l.language),max:131072 .toLocaleString(l.resolvedLanguage??l.language)})}),a.jsx("input",{ref:x,className:"environment-upload__file-input",type:"file",accept:".dockerfile,text/plain",tabIndex:-1,hidden:!0,onChange:tt=>{var Ne;const mt=tt.currentTarget;Ye((Ne=mt.files)==null?void 0:Ne[0]).finally(()=>{mt.value=""})}}),a.jsx(_t,{className:"environment-upload__action",type:"button",color:"secondary",variant:"soft",size:"sm",pill:!1,disabled:je,onClick:()=>{var tt;return(tt=x.current)==null?void 0:tt.click()},children:o("environmentCenter.upload")}),a.jsx(_t,{className:"environment-upload__action",type:"button",color:"secondary",variant:"ghost",size:"sm",pill:!1,disabled:je||!ie,onClick:ye,children:o("environmentCenter.reset")})]})]}),a.jsxs("div",{className:`environment-dockerfile-editor${Y?" has-fixed-base":""}${ue?" is-invalid":""}`,children:[Y?a.jsxs("div",{className:"environment-dockerfile-from","aria-label":o("environmentCenter.dockerfileBaseImage"),children:[a.jsx("span",{className:"environment-dockerfile-from__line","aria-hidden":"true",children:"1"}),a.jsxs("code",{children:[a.jsx("span",{className:"environment-dockerfile-from__keyword",children:"FROM"}),a.jsx("span",{title:X,children:X})]})]}):null,a.jsx("div",{className:"environment-dockerfile__editor environment-upload__editor","aria-label":o("environmentCenter.dockerfileContent"),children:a.jsx(MT,{value:ie,path:"Dockerfile",lineNumberStart:Y?2:1,height:"auto",minHeight:"28px",maxHeight:"var(--environment-dockerfile-editor-max-height)",onChange:We})})]})]}),ue?a.jsx("p",{className:"environment-upload__error environment-upload__error--below",role:"alert",children:ue}):null]}):m==="git"?a.jsxs("div",{className:"environment-source-workflow",children:[a.jsx(DZt,{repositoryUrl:S,gitRef:E,dockerfilePath:T,inspection:A,inspectedKey:P,disabled:je,onRepositoryUrlChange:C,onGitRefChange:j,onDockerfilePathChange:R,onInspectionChange:N,onInspectedKeyChange:I}),a.jsx(MZt,{cloudProvider:t,mode:D,region:L,value:M,disabled:je,onModeChange:tt=>{_(tt),ze("")},onRegionChange:tt=>{F(tt),V(void 0),ze("")},onChange:V})]}):a.jsx(LZt,{cloudProvider:t,region:q,repository:J,reference:Z,disabled:je,onRegionChange:tt=>{U(tt),z(void 0),ze("")},onRepositoryChange:z,onReferenceChange:ne})]})})})}function j9e({cloudProvider:e="volcengine",onWorkspace:t,onProjects:n,clipboardImport:i=null,clipboardReadError:r=""}){const{t:s,i18n:o}=Te("ui"),[l,c]=p.useState([]),[u,d]=p.useState({kind:"list"}),[f,h]=p.useState(""),[m,g]=p.useState(null),[b,v]=p.useState(null),[y,w]=p.useState(null),[x,O]=p.useState(null),[k,S]=p.useState(null),C=p.useRef(0),[E,j]=p.useState(""),[T,R]=p.useState(!1),[A,N]=p.useState(r),[P,I]=p.useState(!0),[D,_]=p.useState(""),[L,F]=p.useState(0),[M,V]=p.useState(()=>new Set),q=p.useDeferredValue(f),U=p.useMemo(()=>{const Y=q.trim().toLocaleLowerCase();return Y?l.filter(X=>`${X.name} ${X.description} ${RB(X.operatingSystem)} ${Lp(X.language)} ${IB(X.baseEnvironment)}`.toLocaleLowerCase().includes(Y)):l},[q,l]),J=p.useCallback((Y="",X=!1)=>{C.current+=1,S({key:C.current,initialValue:Y,autoInspect:X})},[]),z=p.useCallback((Y,X=!1)=>{const ie=Y.trim();if(!ie.startsWith("akenv://")||!X&&Joe.has(ie))return!1;const ee=Iz(ie);return!ee.length||ee.length>X7?!1:(Joe.add(ie),N(""),J(ie,!0),!0)},[J]),Z=p.useCallback(async()=>{var Y;if(!(u.kind!=="list"||k)){if(typeof navigator>"u"||!((Y=navigator.clipboard)!=null&&Y.readText)){N(s("environmentCenter.clipboardUnsupported"));return}try{const X=await navigator.clipboard.readText();!z(X)&&!X.trim()&&await wZt()&&N(s("environmentCenter.clipboardReadError"))}catch{N(s("environmentCenter.clipboardReadError"))}}},[k,z,s,u.kind]);p.useEffect(()=>{const Y=new AbortController;return l.length===0&&I(!0),_(""),BA(Y.signal).then(X=>{c(X)}).catch(X=>{(X==null?void 0:X.name)!=="AbortError"&&(xZt(X)?(c([]),R(!1),j(s("environmentCenter.storageUnavailable"))):_(X instanceof Error?X.message:String(X)))}).finally(()=>{Y.signal.aborted||I(!1)}),()=>Y.abort()},[L]),p.useEffect(()=>{if(!l.some(X=>X.latestVersion&&$y.has(X.latestVersion.status)))return;const Y=window.setTimeout(()=>F(X=>X+1),2500);return()=>window.clearTimeout(Y)},[l]),p.useEffect(()=>{if(!E||T)return;const Y=window.setTimeout(()=>j(""),2800);return()=>window.clearTimeout(Y)},[T,E]),p.useEffect(()=>{r&&N(r)},[r]),p.useEffect(()=>{i&&z(i.text)},[i,z]),p.useEffect(()=>{if(u.kind!=="list")return;const Y=()=>void Z(),X=()=>{document.visibilityState==="visible"&&Z()},ie=ee=>{var pe;const be=ee.target;if(be instanceof HTMLInputElement||be instanceof HTMLTextAreaElement||be instanceof HTMLElement&&be.isContentEditable)return;const ue=((pe=ee.clipboardData)==null?void 0:pe.getData("text/plain"))??"";z(ue,!0)&&ee.preventDefault()};return window.addEventListener("focus",Y),document.addEventListener("visibilitychange",X),window.addEventListener("paste",ie),()=>{window.removeEventListener("focus",Y),document.removeEventListener("visibilitychange",X),window.removeEventListener("paste",ie)}},[z,Z,u.kind]);const ne=u.kind==="editor"&&u.environmentId?l.find(Y=>Y.id===u.environmentId):void 0,W=async Y=>{const X={...Y,dockerfile:Y.dockerfile??mH(Y,e)},ie=ne?await GTe(ne.id,X):await KTe(X);if(c(ee=>[ie,...ee.filter(be=>be.id!==ie.id)]),d({kind:"list"}),R(!1),X.imageSource){j(s("environmentCenter.status.boundImage",{name:ie.name}));return}try{const ee=await U8(ie.id);c(be=>be.map(ue=>ue.id===ie.id?{...ue,latestVersion:ee}:ue)),j(s("environmentCenter.status.queued",{name:ie.name}))}catch(ee){R(!0),j(s("environmentCenter.status.savedBuildFailed",{error:ee instanceof Error?ee.message:String(ee)}))}},G=async Y=>{if(!M.has(Y.id)){V(X=>new Set(X).add(Y.id)),R(!1);try{const X=await U8(Y.id);c(ie=>ie.map(ee=>ee.id===Y.id?{...ee,latestVersion:X}:ee)),j(s("environmentCenter.status.queued",{name:Y.name}))}catch(X){R(!0),j(X instanceof Error?X.message:String(X))}finally{V(X=>{const ie=new Set(X);return ie.delete(Y.id),ie})}}},H=(Y,X,ie,ee)=>{Y.length&&c(be=>{const ue=new Set(Y.map(pe=>pe.id));return[...Y,...be.filter(pe=>!ue.has(pe.id))]}),R(ee>0),j(ee>0?s("environmentCenter.status.importedFailed",{created:X,failed:ee}):ie>0?s("environmentCenter.status.importedDuplicate",{created:X,duplicate:ie}):s("environmentCenter.status.imported",{count:X}))},se=m?a.jsx(Cd,{title:s("environmentCenter.deleteTitle"),description:s("environmentCenter.deleteDescription",{name:m.name}),confirmLabel:s("common.delete"),variant:"danger",onCancel:()=>g(null),onConfirm:()=>{const Y=m;g(null),d({kind:"list"}),XTe(Y.id).then(()=>{c(X=>X.filter(ie=>ie.id!==Y.id)),R(!1),j(s("environmentCenter.status.deleted",{name:Y.name}))}).catch(X=>{R(!0),j(X instanceof Error?X.message:String(X))})}}):null;return u.kind==="editor"?a.jsxs(a.Fragment,{children:[a.jsx(BZt,{environment:ne,cloudProvider:e,onCancel:()=>d({kind:"list"}),onDelete:ne?()=>g(ne):void 0,onShare:ne?()=>O(ne):void 0,onSave:W},u.environmentId??"new"),x?a.jsx($Zt,{environment:x,onClose:()=>O(null)}):null,se]}):a.jsxs(gK,{section:"environments",className:"environment-center",onWorkspace:t,onProjects:n,actions:a.jsxs(a.Fragment,{children:[E?a.jsx("span",{className:`environment-status${T?" is-error":""}`,role:T?"alert":"status","aria-live":"polite",children:E}):null,a.jsx(Zp,{"aria-label":s("environmentCenter.search"),value:f,onChange:Y=>h(Y.target.value),placeholder:s("environmentCenter.search")})]}),children:[A?a.jsxs("div",{className:"environment-clipboard-notice",role:"alert",children:[a.jsx("span",{children:A}),a.jsx(_t,{type:"button",color:"secondary",variant:"soft",size:"sm",onClick:()=>{N(""),J()},children:s("environmentCenter.manualImport")})]}):null,a.jsx(Jp,{"aria-live":"polite",children:P?a.jsx(cl,{}):D?a.jsxs("div",{className:"environment-load-error",role:"alert",children:[a.jsx("p",{children:So(D,o.resolvedLanguage||o.language)||s("environmentCenter.loadFailed")}),a.jsx(_t,{color:"secondary",variant:"soft",size:"sm",onClick:()=>F(Y=>Y+1),children:s("common.reload")})]}):U.length===0&&f.trim()?a.jsx("div",{className:"environment-empty",children:a.jsxs(Wn,{fill:"none",children:[a.jsx(Wn.Icon,{children:a.jsx(CZt,{})}),a.jsx(Wn.Title,{children:s("environmentCenter.noMatches")}),a.jsx(Wn.Description,{children:s("environmentCenter.tryAnotherName")})]})}):a.jsxs(W0,{children:[f.trim()?null:a.jsxs(a.Fragment,{children:[a.jsx(lb,{"aria-label":s("environmentCenter.create"),icon:a.jsx(kZt,{}),onClick:()=>d({kind:"editor",environmentId:null}),children:s("environmentCenter.create")}),a.jsx(lb,{"aria-label":s("environmentCenter.import.title"),icon:a.jsx(SZt,{}),onClick:()=>J(),children:s("environmentCenter.import.title")})]}),U.map(Y=>{var be,ue;const X=A9e(Y,s),ie=!!(Y.latestVersion&&$y.has(Y.latestVersion.status)),ee=M.has(Y.id);return a.jsx(G0,{className:"environment-card",title:Y.name,status:a.jsx(Ya,{color:X.color,size:"sm",children:X.label}),description:((be=Y.latestVersion)==null?void 0:be.error)||(ie?(ue=Y.latestVersion)==null?void 0:ue.currentStep:"")||Y.description||s("common.noDescription"),metadata:[{label:s("workspace.updated"),value:jZt(Y.updatedAt,o.resolvedLanguage??o.language),title:NZt(Y.updatedAt,o.resolvedLanguage??o.language)}],action:{label:Y.latestVersion?s("environmentCenter.buildDetails.title"):s(ee?"environmentCenter.buildDetails.starting":"environmentCenter.startBuild"),icon:"play",title:s("environmentCenter.build"),disabled:ee,onClick:()=>Y.latestVersion?v(Y.id):void G(Y)},auxiliaryAction:{label:s("environmentCenter.manifest.view"),icon:a.jsx(sat,{}),title:Y.latestVersion?s("environmentCenter.manifest.viewShort"):s("environmentCenter.manifest.unavailable"),disabled:!Y.latestVersion,onClick:()=>w(Y)},detailAction:{label:s("environmentCenter.configure"),onClick:()=>d({kind:"editor",environmentId:Y.id})}},Y.id)})]})}),b?(()=>{const Y=l.find(X=>X.id===b);return Y?a.jsx(PZt,{environment:Y,onClose:()=>v(null),onBuildUpdate:X=>{c(ie=>ie.map(ee=>ee.id===Y.id?{...ee,latestVersion:X}:ee))},onRebuild:()=>G(Y)}):null})():null,y!=null&&y.latestVersion?a.jsx(IZt,{environment:y,onClose:()=>w(null)}):null,se,k?a.jsx(FZt,{initialValue:k.initialValue,autoInspect:k.autoInspect,onClose:()=>S(null),onImported:H},k.key):null]})}function UZt(e){const t=e instanceof Error?e.message:String(e??"");return t.includes("HTTP 503")&&(t.includes("未配置持久化存储")||t.includes("storage is not configured"))}function QZt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function zZt(e){return a.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"4.5",y:"7",width:"23",height:"18",rx:"3"}),a.jsx("path",{d:"M10 7V5.5A1.5 1.5 0 0 1 11.5 4h4A1.5 1.5 0 0 1 17 5.5V7M9 13h5v5H9zM18 13h5M18 17h5M9 22h14"})]})}function Z7(e,t){const n=Date.parse(e);return Number.isNaN(n)?e:new Intl.DateTimeFormat(t,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(n)}function VZt(e,t){return e.environmentIds.reduce((n,i)=>{var r,s;return((s=(r=t.get(i))==null?void 0:r.latestVersion)==null?void 0:s.status)==="available"?n+1:n},0)}function HZt({workspace:e,environments:t,onBack:n,onSave:i,onDelete:r}){const{t:s,i18n:o}=Te("ui"),[l,c]=p.useState((e==null?void 0:e.name)??""),[u,d]=p.useState((e==null?void 0:e.description)??""),[f,h]=p.useState((e==null?void 0:e.environmentIds)??[]),[m,g]=p.useState(""),[b,v]=p.useState(!1),[y,w]=p.useState(""),x=m.trim().toLocaleLowerCase(),O=t.filter(S=>`${S.name} ${S.description} ${Lp(S.language)}`.toLocaleLowerCase().includes(x)),k=async S=>{if(S.preventDefault(),!(!l.trim()||b)){v(!0),w("");try{await i({name:l.trim(),description:u.trim(),environmentIds:f})}catch(C){w(C instanceof Error?C.message:String(C)),v(!1)}}};return a.jsx(kh,{className:"workspace-center","aria-label":s(e?"workspace.detail":"workspace.create"),children:a.jsxs(oT,{title:e?e.name:s("workspace.create"),description:s("workspace.editorDescription"),identitySeed:(e==null?void 0:e.name)||s("workspace.create"),backLabel:s("workspace.backToList"),onBack:n,actions:a.jsxs(a.Fragment,{children:[r?a.jsx("button",{type:"button",className:"is-danger",onClick:r,children:s("common.delete")}):null,a.jsx("button",{type:"submit",form:"workspace-form",disabled:b||!l.trim(),children:s(b?"common.saving":"common.save")})]}),children:[e?a.jsxs(bH,{children:[a.jsxs("div",{children:[a.jsx("dt",{children:s("common.environment")}),a.jsx("dd",{children:s("workspace.environmentCount",{count:f.length})})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("workspace.createdAt")}),a.jsx("dd",{children:Z7(e.createdAt,o.resolvedLanguage??o.language)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("workspace.updatedAt")}),a.jsx("dd",{children:Z7(e.updatedAt,o.resolvedLanguage??o.language)})]})]}):null,a.jsxs("form",{id:"workspace-form",className:"workspace-form",onSubmit:k,children:[a.jsxs("section",{className:"workspace-fields","aria-label":s("workspace.basicInfo"),children:[a.jsxs("label",{children:[a.jsx("span",{children:s("common.name")}),a.jsx(_s,{value:l,maxLength:128,autoFocus:!0,onChange:S=>c(S.target.value),placeholder:s("workspace.namePlaceholder")})]}),a.jsxs("label",{children:[a.jsx("span",{children:s("common.description")}),a.jsx(vb,{value:u,maxLength:2e3,onChange:S=>d(S.target.value),placeholder:s("workspace.descriptionPlaceholder")})]})]}),a.jsxs("section",{className:"workspace-environments",children:[a.jsx(XIe,{title:s("common.environment"),description:s("workspace.selectedEnvironmentCount",{count:f.length}),actions:a.jsx(Zp,{"aria-label":s("workspace.searchAvailableEnvironments"),value:m,onChange:S=>g(S.target.value),placeholder:s("workspace.searchEnvironments")})}),t.length===0?a.jsxs("div",{className:"workspace-environment-empty",children:[a.jsx("p",{children:s("workspace.noAvailableEnvironments")}),a.jsx("span",{children:s("workspace.createEnvironmentFirst")})]}):O.length===0?a.jsxs("div",{className:"workspace-environment-empty",children:[a.jsx("p",{children:s("workspace.noMatchingEnvironments")}),a.jsx("span",{children:s("workspace.tryAnotherName")})]}):a.jsx("div",{className:"workspace-environment-list",children:O.map(S=>{var j;const C=f.includes(S.id),E=((j=S.latestVersion)==null?void 0:j.status)==="available"?s("workspace.environmentStatus.available"):S.latestVersion?s("workspace.environmentStatus.building"):s("workspace.environmentStatus.notBuilt");return a.jsxs("label",{className:`workspace-environment-option${C?" is-selected":""}`,children:[a.jsx("input",{type:"checkbox",checked:C,onChange:()=>h(T=>C?T.filter(R=>R!==S.id):[...T,S.id])}),a.jsxs("span",{className:"workspace-environment-option__copy",children:[a.jsx("strong",{title:S.name,children:S.name}),a.jsxs("span",{children:[Lp(S.language)," · ",E]})]}),a.jsx("span",{className:"workspace-environment-option__action",children:s(C?"workspace.added":"common.add")})]},S.id)})})]}),y?a.jsx("p",{className:"workspace-form-error",role:"alert",children:y}):null]})]})})}function qZt({onEnvironment:e,onProjects:t}){const{t:n,i18n:i}=Te("ui"),[r,s]=p.useState([]),[o,l]=p.useState([]),[c,u]=p.useState({kind:"list"}),[d,f]=p.useState(""),[h,m]=p.useState(!0),[g,b]=p.useState(""),[v,y]=p.useState(""),[w,x]=p.useState(!1),[O,k]=p.useState(null),[S,C]=p.useState(0),E=p.useDeferredValue(d);p.useEffect(()=>{const A=new AbortController;return m(!0),b(""),Promise.all([Mz(A.signal),BA(A.signal)]).then(([N,P])=>{s(N),l(P)}).catch(N=>{(N==null?void 0:N.name)!=="AbortError"&&(UZt(N)?(s([]),l([]),x(!1),y(n("workspace.storageUnavailable"))):(console.warn("Unable to load Studio workspaces",N),b(n("workspace.loadFailed"))))}).finally(()=>{A.signal.aborted||m(!1)}),()=>A.abort()},[S,n]),p.useEffect(()=>{if(!v||w)return;const A=window.setTimeout(()=>y(""),2800);return()=>window.clearTimeout(A)},[w,v]);const j=p.useMemo(()=>new Map(o.map(A=>[A.id,A])),[o]),T=p.useMemo(()=>{const A=E.trim().toLocaleLowerCase();return A?r.filter(N=>{const P=N.environmentIds.map(I=>{var D;return((D=j.get(I))==null?void 0:D.name)??""}).join(" ");return`${N.name} ${N.description} ${P}`.toLocaleLowerCase().includes(A)}):r},[E,j,r]),R=c.kind==="detail"&&c.workspaceId?r.find(A=>A.id===c.workspaceId):void 0;return c.kind==="detail"?a.jsx(HZt,{workspace:R,environments:o,onBack:()=>u({kind:"list"}),onDelete:R?()=>k(R):null,onSave:async A=>{const N=R?await UTe(R.id,A):await BTe(A);s(P=>[N,...P.filter(I=>I.id!==N.id)]),x(!1),y(n("workspace.saved",{name:N.name})),u({kind:"list"})}},c.workspaceId??"new"):a.jsxs(gK,{section:"workspaces",onEnvironment:e,onProjects:t,actions:a.jsxs(a.Fragment,{children:[v?a.jsx("span",{className:`workspace-status${w?" is-error":""}`,role:w?"alert":"status","aria-live":"polite",children:v}):null,a.jsx(Zp,{"aria-label":n("workspace.searchWorkspaces"),value:d,onChange:A=>f(A.target.value),placeholder:n("workspace.searchWorkspaces")})]}),children:[a.jsx(Jp,{"aria-live":"polite",children:h?a.jsx(cl,{}):g?a.jsxs("div",{className:"workspace-load-error",role:"alert",children:[a.jsx("p",{children:g}),a.jsx(_t,{color:"secondary",variant:"soft",size:"sm",onClick:()=>C(A=>A+1),children:n("common.reload")})]}):T.length===0&&d.trim()?a.jsx("div",{className:"workspace-empty",children:a.jsxs(Wn,{fill:"none",children:[a.jsx(Wn.Icon,{children:a.jsx(zZt,{})}),a.jsx(Wn.Title,{children:n("workspace.noMatchingWorkspaces")}),a.jsx(Wn.Description,{children:n("workspace.tryAnotherNameOrEnvironment")})]})}):a.jsxs(W0,{children:[d.trim()?null:a.jsx(lb,{"aria-label":n("workspace.create"),icon:a.jsx(QZt,{}),onClick:()=>u({kind:"detail",workspaceId:null}),children:n("workspace.create")}),T.map(A=>{const N=VZt(A,j),P=A.environmentIds.filter(I=>!j.has(I)).length;return a.jsx(G0,{className:"workspace-card",title:A.name,status:a.jsx(Ya,{color:P?"danger":N===A.environmentIds.length&&N>0?"success":"secondary",size:"sm",children:A.environmentIds.length===0?n("workspace.noEnvironmentAdded"):P?n("workspace.environmentMissing"):n("workspace.availableFraction",{available:N,total:A.environmentIds.length})}),description:A.description||n("common.noDescription"),metadata:[{label:n("common.environment"),value:n("workspace.environmentCount",{count:A.environmentIds.length})},{label:n("workspace.available"),value:n("workspace.availableCount",{count:N})},{label:n("workspace.updated"),value:Z7(A.updatedAt,i.resolvedLanguage??i.language)}],detailAction:{label:n("common.manage"),onClick:()=>u({kind:"detail",workspaceId:A.id})},action:{label:n("workspace.addEnvironment"),icon:"plus",onClick:()=>u({kind:"detail",workspaceId:A.id})}},A.id)})]})}),O?a.jsx(Cd,{title:n("workspace.deleteTitle"),description:n("workspace.deleteDescription",{name:O.name}),confirmLabel:n("common.delete"),variant:"danger",onCancel:()=>k(null),onConfirm:()=>{const A=O;k(null),QTe(A.id).then(()=>{s(N=>N.filter(P=>P.id!==A.id)),x(!1),y(n("workspace.deleted",{name:A.name})),u({kind:"list"})}).catch(N=>{x(!0),y(N instanceof Error?N.message:String(N))})}}):null]})}function WZt({cloudProvider:e,onProjects:t,initialSection:n="workspaces"}){const[i,r]=p.useState(n),{t:s}=Te("ui"),[o,l]=p.useState(null),[c,u]=p.useState(""),d=p.useRef(0),f=()=>{var g;d.current+=1;const h=d.current;u("");let m=null;if(typeof navigator<"u"&&((g=navigator.clipboard)!=null&&g.readText))try{m=navigator.clipboard.readText()}catch{u(s("workspace.clipboardPermissionError"))}else u(s("workspace.clipboardUnsupported"));r("environments"),m&&m.then(async b=>{var v;if(d.current===h){if(b.trim()){l({key:h,text:b});return}try{const y=await((v=navigator.permissions)==null?void 0:v.query({name:"clipboard-read"}));d.current===h&&(y==null?void 0:y.state)==="denied"&&u(s("workspace.clipboardPermissionError"))}catch{}}}).catch(()=>{d.current===h&&u(s("workspace.clipboardPermissionError"))})};return i==="environments"?a.jsx(j9e,{cloudProvider:e,onWorkspace:()=>r("workspaces"),onProjects:t,clipboardImport:o,clipboardReadError:c}):a.jsx(qZt,{onEnvironment:f,onProjects:t})}const KZt={id:"mpa-channels",kind:"mpa-channels",category:"channels",icon:"mpa-channels",name:"MPA agent messaging channels",description:"Connect an existing MPA agent to Feishu, WeCom and DingTalk."};function GZt(e){return e==="127.0.0.1"}const XZt={id:"coding-agents",kind:"coding-agent",category:"development",icon:"coding-agents",name:"Configure coding agents",badge:"Local",badgeTone:"success",description:"Install built-in VeADK and AgentKit skills globally for Trae, Claude Code, or Codex."},YZt={id:"feishu",kind:"feishu",category:"channels",icon:"feishu",name:"Feishu bot",badge:"Beta",description:"Create a Feishu bot and connect its messages directly to AgentKit Runtime."},ZZt={id:"gitlab-review",kind:"gitlab",category:"development",icon:"gitlab",name:"GitLab MR review",description:"Use a GitLab integration to review merge requests in an isolated Sandbox."};bn.hasResourceBundle("en-US","automations")||bn.addResourceBundle("en-US","automations",xfe,!0,!0);bn.hasResourceBundle("zh-CN","automations")||bn.addResourceBundle("zh-CN","automations",C0e,!0,!0);function Ch(e,t={}){return bn.t(e,{...t,ns:"automations"})}const N9e={name:"repository",label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL",required:!0},R9e={name:"baseBranch",label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base",required:!1},I9e={name:"runtimeName",label:"Runtime name",placeholder:"support-agent",help:"Used by the AgentKit delivery configuration",required:!0},P9e={name:"runtimeId",label:"Runtime ID",placeholder:"rt-xxxxxxxx",help:"The AgentKit Runtime that will receive continuous updates",required:!0},JZt="https://ark.cn-beijing.volces.com/api/coding/v3";function eJt(e){return e==="byteplus"?Po(e):JZt}function xK(e){return e==="byteplus"?{accessKey:"BYTEPLUS_ACCESS_KEY",secretKey:"BYTEPLUS_SECRET_KEY",sessionToken:"BYTEPLUS_SESSION_TOKEN"}:{accessKey:"VOLCENGINE_ACCESS_KEY",secretKey:"VOLCENGINE_SECRET_KEY",sessionToken:"VOLCENGINE_SESSION_TOKEN"}}function D9e(e){const t=xK(e);return[Ch("github.secretPair",{accessKey:t.accessKey,secretKey:t.secretKey}),Ch("github.sessionToken",{sessionToken:t.sessionToken})]}function wK(e){return e==="byteplus"?"BytePlus":"Volcengine"}function OK(e,t={}){return{repository:"",baseBranch:"main",projectPath:".",runtimeName:"",runtimeId:"",modelName:"",modelBaseUrl:eJt(e),region:Zi(e),token:"",...t}}function M9e(e){return{repository:e.repository.trim(),baseBranch:e.baseBranch.trim()||"main",region:e.region,token:e.token.trim()}}const tJt={id:"review",kind:"github",category:"development",icon:"github",name:"Automated PR review",description:"Use a GitHub App to review pull requests in an isolated Sandbox.",title:"Automated PR review",subtitle:"Trigger Sandbox reviews through the GitHub App and publish results to pull requests",panel:"Install the GitHub App to target repositories, then enable automated review for each repository.",submitLabel:"Install GitHub App",fields:[],initialValues:({cloudProvider:e})=>OK(e),regionHelp:"",secrets:()=>[],async submit(){throw new Error("PR 自动评审已切换为 GitHub App 授权模式。")}},nJt="https://api.github.com",iJt=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,nle=/^[A-Za-z0-9][A-Za-z0-9._/-]{0,199}$/,rJt=/^[A-Za-z0-9._/-]+$/;function sJt(e,t,n){const i=String((t==null?void 0:t.message)||"");return e===403&&/workflow/i.test(i)?"GitHub Token 缺少 Workflows 写权限,无法创建或更新 .github/workflows 下的文件":e===401||e===403?Q("github.invalidToken"):e===404?Q("github.notFound"):e===422?Q("github.rejectedCommit"):i.split(n).join("***").trim().slice(0,240)||Q("github.requestFailed",{status:e})}async function iy(e,t){const n={Accept:"application/vnd.github+json",Authorization:`Bearer ${t.token}`,"X-GitHub-Api-Version":"2022-11-28"};t.body&&(n["Content-Type"]="application/json");let i;try{i=await fetch(`${nJt}${e}`,{method:t.method||"GET",headers:n,body:t.body?JSON.stringify(t.body):void 0,signal:t.signal})}catch(s){throw t.signal.aborted?s:new Error(Q("github.networkFailed"))}const r=await i.json().catch(()=>null);if(!t.expected.includes(i.status))throw new Error(sJt(i.status,r,t.token));return{status:i.status,payload:r}}function y6(e){return e.split("/").map(encodeURIComponent).join("/")}function aJt(e){const t=new TextEncoder().encode(e);let n="";const i=32768;for(let r=0;r({...h,path:SK(h.path,"")})),s=AbortSignal.any([t,AbortSignal.timeout(6e4)]),o=`/repos/${n}`;await iy(`${o}`,{token:e.token,expected:[200],signal:s});const c=(f=(await iy(`${o}/git/ref/heads/${y6(i)}`,{token:e.token,expected:[200],signal:s})).payload.object)==null?void 0:f.sha;if(!c)throw new Error(Q("github.missingBaseSha"));const u=oJt(e.branchPrefix);await iy(`${o}/git/refs`,{token:e.token,expected:[201],signal:s,method:"POST",body:{ref:`refs/heads/${u}`,sha:c}});let d=!0;try{for(const m of r){const g=y6(m.path),b=await iy(`${o}/contents/${g}?ref=${encodeURIComponent(i)}`,{token:e.token,expected:[200,404],signal:s});if(m.mustBeNew&&b.status===200)throw new Error(Q("github.fileAlreadyExists",{path:m.path}));if(b.status===200&&!b.payload.sha)throw new Error(Q("github.pathNotUpdatable",{path:m.path}));await iy(`${o}/contents/${g}`,{token:e.token,expected:[200,201],signal:s,method:"PUT",body:{message:m.commitMessage,content:aJt(m.content),branch:u,...b.payload.sha?{sha:b.payload.sha}:{}}})}const h=await iy(`${o}/pulls`,{token:e.token,expected:[201],signal:s,method:"POST",body:{title:e.title,head:u,base:i,body:e.description}});if(!h.payload.number||!h.payload.html_url)throw new Error(Q("github.invalidPullRequest"));return d=!1,{number:h.payload.number,url:h.payload.html_url,branch:u}}finally{d&&await iy(`${o}/git/refs/heads/${y6(u)}`,{token:e.token,expected:[204],signal:AbortSignal.timeout(15e3),method:"DELETE"}).catch(()=>{})}}async function lJt(e,t){const n=await yn("/web/github/pull-request-reviews",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e),signal:t});if(!n.ok)throw await WT(n);const i=await n.json();if(i.status!=="started"||typeof i.sessionId!="string"||!i.sessionId||typeof i.displayName!="string")throw new Error("PR 评审服务返回了无效结果。");return i}async function cJt(e){const t=await yn("/web/github/app/config",{method:"GET",headers:{Accept:"application/json"},signal:e});if(!t.ok)throw await WT(t);const n=await t.json();if(typeof n.configured!="boolean"||typeof n.appSlug!="string"||typeof n.installUrl!="string"||typeof n.reason!="string")throw new Error("GitHub App 配置响应格式无效。");return n}async function uJt(e,t){var s;const n=new URLSearchParams({page:String(t.page),pageSize:String(t.pageSize)});(s=t.query)!=null&&s.trim()&&n.set("q",t.query.trim());const i=await yn(`/web/github/app/repositories?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await WT(i);const r=await i.json();if(!Array.isArray(r.repositories)||typeof r.page!="number"||typeof r.pageSize!="number"||typeof r.hasNextPage!="boolean"||typeof r.reviewSettingsConfigured!="boolean"||typeof r.reviewSettingsReason!="string"||r.repositories.some(o=>typeof o!="object"||o===null||typeof o.installationId!="number"||typeof o.account!="string"||typeof o.fullName!="string"||typeof o.htmlUrl!="string"||typeof o.private!="boolean"||typeof o.reviewEnabled!="boolean"))throw new Error("GitHub App 仓库列表响应格式无效。");return r}async function dJt(e,t){const n=new URLSearchParams({page:String(t.page),pageSize:String(t.pageSize)}),i=await yn(`/web/github/app/review-records?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await WT(i);const r=await i.json();if(!Array.isArray(r.records)||typeof r.page!="number"||typeof r.pageSize!="number"||typeof r.hasNextPage!="boolean"||typeof r.reviewSettingsConfigured!="boolean"||typeof r.reviewSettingsReason!="string"||r.records.some(s=>typeof s!="object"||s===null||typeof s.id!="string"||typeof s.repository!="string"||typeof s.pullRequestUrl!="string"||typeof s.pullRequestNumber!="number"||!["started","completed","ignored","failed"].includes(String(s.status))||!["manual","webhook"].includes(String(s.trigger))||typeof s.createdAt!="string"||typeof s.deliveryId!="string"||typeof s.action!="string"||typeof s.sessionId!="string"||typeof s.displayName!="string"||typeof s.reason!="string"))throw new Error("PR 评审记录响应格式无效。");return r}async function fJt(e,t){const n=await yn("/web/github/app/review-repositories",{method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e),signal:t});if(!n.ok)throw await WT(n);const i=await n.json();if(!Array.isArray(i.repositories)||i.repositories.some(r=>typeof r!="string"))throw new Error("GitHub App 评审仓库保存响应格式无效。");return i.repositories}async function WT(e){const t=await e.text().catch(()=>"");try{const n=JSON.parse(t),i=typeof n.detail=="object"&&n.detail?n.detail.message:n.detail??n.message??n.error,r=typeof i=="string"?i:"";return new Error(r||`PR 评审发起失败(HTTP ${e.status})`)}catch{return new Error(t||`PR 评审发起失败(HTTP ${e.status})`)}}const hJt=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/,pJt="cn-hongkong";function mJt(e){const t=ov(e.runtimeName,n=>Ch(`github.validation.runtimeName.${n}`));if(t)throw new Error(t);if(!hJt.test(e.runtimeId))throw new Error(Ch("github.validation.runtimeId"))}function $9e(e){mJt(e);const t=e.cloudProvider??"volcengine",n=xK(t),i=t==="byteplus"?` +`).replace(/^\n+/,"")}function iR(e,t){const n=`FROM ${e.trim()}`,i=DL(t).replace(/^\n+/,"");return i?`${n} +${i}`:n}function dZt(e,t,n){return t.trim()?/^\s*FROM(?:\s|$)/im.test(e)?_w("duplicateFrom",n):xK(iR(t,e),void 0,n):_w("baseImageRequired",n)}function xK(e,t=O9e(e),n){return t>w9e?_w("tooLarge",n):e.trim()?/^\s*FROM\s+\S+/im.test(e)?"":_w("missingFrom",n):_w("empty",n)}async function fZt(e,t){if(e.size>w9e)return{content:"",error:_w("tooLarge",t)};const n=DL(await e.text());return{content:n,error:xK(n,e.size,t)}}function hZt(e){return qM(e,{lineWidth:0})}function pZt(e){return[{value:"auto",label:e("deploymentResources.mode.auto"),description:e("deploymentResources.mode.autoDescription"),badge:e("deploymentResources.mode.recommended")},{value:"create",label:e("deploymentResources.mode.create"),description:e("deploymentResources.mode.createDescription")},{value:"existing",label:e("deploymentResources.mode.existing"),description:e("deploymentResources.mode.existingDescription")}]}const k9e={tos:{mode:"auto"},cr:{mode:"auto"},codePipeline:{mode:"auto"}};function gp(e){const[t,n]=p.useState([]),[i,r]=p.useState(""),[s,o]=p.useState(1),[l,c]=p.useState(0),[u,d]=p.useState(!1),[f,h]=p.useState(!1),[m,g]=p.useState(null),[b,v]=p.useState(""),[y,w]=p.useState(""),[x,O]=p.useState(""),[k,S]=p.useState(0),C=p.useRef(!1),E=p.useRef(null),j=e?JSON.stringify(e):"",T=e?JSON.stringify({...e,search:y}):"";p.useEffect(()=>{const I=window.setTimeout(()=>{w(b.trim())},250);return()=>window.clearTimeout(I)},[b]),p.useEffect(()=>{v(""),w("")},[j]);const R=p.useCallback((I,P)=>{var F;if(!T)return;(F=E.current)==null||F.abort();const _=new AbortController;E.current=_;const L=JSON.parse(T);P&&n([]),C.current=!0,h(!0),g(null),NTe({...L,pageNumber:I,pageSize:100},_.signal).then(M=>{n(V=>{if(P)return M.items;const q=new Set(V.map(U=>`${U.id}\0${U.name}`));return[...V,...M.items.filter(U=>!q.has(`${U.id}\0${U.name}`))]}),r(M.serviceRegion),o(M.pageNumber),c(M.totalCount),d(M.hasMore),O(T)}).catch(M=>{M instanceof DOMException&&M.name==="AbortError"||(O(T),g(M instanceof Error?M.message:String(M)))}).finally(()=>{E.current===_&&(E.current=null,C.current=!1,h(!1))})},[T]);p.useEffect(()=>{var I;if(!T){(I=E.current)==null||I.abort(),E.current=null,C.current=!1,n([]),r(""),o(1),c(0),d(!1),O(""),h(!1),g(null);return}return R(1,!0),()=>{var P;return(P=E.current)==null?void 0:P.abort()}},[R,T,k]);const A=!!T&&x===T&&b.trim()===y,N=p.useCallback(()=>{O(""),S(I=>I+1)},[]),D=p.useCallback(()=>{!A||C.current||!u||R(s+1,!1)},[u,R,s,A]);return{items:t,serviceRegion:i,totalCount:l,hasMore:A?u:!1,loading:!!T&&(!A||f),error:m,search:b,setSearch:v,reload:N,loadMore:D}}function mZt(e,t){return e.map(n=>({value:n[t],label:n.name,description:[n.status,n.region,n.id].filter(Boolean).join(" · ")}))}function bp({ariaLabel:e,value:t,valueLabel:n,state:i,disabled:r,disabledMessage:s,valueField:o="id",onChange:l}){const{t:c}=Te("ui"),u=p.useMemo(()=>mZt(i.items,o),[i.items,o]);return a.jsxs("div",{className:"pp-resource-picker",children:[a.jsx(xf,{ariaLabel:e,value:t,valueLabel:n,placeholder:i.loading?c("common.loading"):c("deploymentResources.selectExisting"),options:u,disabled:r||!!i.error,searchValue:i.search,searchPlaceholder:c("deploymentResources.searchResource"),loading:i.loading,hasMore:i.hasMore,emptyMessage:i.search.trim()?c("deploymentResources.noMatch"):c("deploymentResources.noAvailable"),onSearchChange:i.setSearch,onLoadMore:i.loadMore,onChange:d=>{const f=i.items.find(h=>h[o]===d);f&&l(f)}}),s?a.jsx("span",{className:"pp-resource-status",children:s}):i.error?a.jsxs("div",{className:"pp-resource-error",role:"alert",children:[a.jsx("span",{children:i.error}),a.jsx("button",{type:"button",onClick:i.reload,children:c("common.retry")})]}):i.loading&&i.items.length===0?a.jsx("span",{className:"pp-resource-status","aria-live":"polite",children:i.search.trim()?c("deploymentResources.searching"):c("deploymentResources.loading")}):i.items.length===0?a.jsx("span",{className:"pp-resource-status",children:i.search.trim()?c("deploymentResources.noMatchSentence"):c("deploymentResources.noAvailableSentence")}):i.serviceRegion?a.jsx("span",{className:"pp-resource-status",children:c("deploymentResources.loadedSummary",{region:i.serviceRegion,loaded:i.items.length,total:i.totalCount>0?`/${i.totalCount}`:""})}):null]})}function S9e({region:e,value:t,disabled:n=!1,onChange:i}){const{t:r}=Te("ui"),s=gp(e?{kind:"cr-registry",region:e}:null),o=gp(e&&(t!=null&&t.registry)?{kind:"cr-namespace",region:e,registry:t.registry}:null),l=gp(e&&(t!=null&&t.registry)&&t.namespace?{kind:"cr-repository",region:e,registry:t.registry,namespace:t.namespace}:null),c=t??{region:e,registry:"",namespace:"",repository:""};return a.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three environment-repository-fields",children:[a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:r("deploymentResources.registryInstance")}),a.jsx(bp,{ariaLabel:r("deploymentResources.registryAriaLabel"),value:c.registry,valueLabel:c.registry,state:s,disabled:n||!e,valueField:"name",onChange:u=>i({region:e,registry:u.name,namespace:"",repository:""})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:r("deploymentResources.namespace")}),a.jsx(bp,{ariaLabel:r("deploymentResources.namespaceAriaLabel"),value:c.namespace,valueLabel:c.namespace,state:o,disabled:n||!c.registry,disabledMessage:c.registry?void 0:r("deploymentResources.selectRegistryFirst"),valueField:"name",onChange:u=>i({...c,region:e,namespace:u.name,repository:""})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:r("deploymentResources.repository")}),a.jsx(bp,{ariaLabel:r("deploymentResources.existingRepository"),value:c.repository,valueLabel:c.repository,state:l,disabled:n||!c.registry||!c.namespace,disabledMessage:c.registry?c.namespace?void 0:r("deploymentResources.selectNamespaceFirst"):r("deploymentResources.selectRegistryFirst"),valueField:"name",onChange:u=>i({...c,region:e,repository:u.name})})]})]})}function g6({resource:e,value:t,disabled:n,onChange:i}){const{t:r}=Te("ui");return a.jsxs("label",{className:"pp-resource-field pp-resource-mode",children:[a.jsx("span",{children:r("deploymentResources.configurationMode")}),a.jsx(xf,{ariaLabel:r("deploymentResources.configurationModeAriaLabel",{resource:e}),value:t,placeholder:r("deploymentResources.selectConfigurationMode"),options:pZt(r),disabled:n,onChange:s=>i(s)})]})}function Kv({label:e,value:t,placeholder:n,disabled:i,onChange:r}){return a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:e}),a.jsx("input",{value:t,placeholder:n,disabled:i,autoComplete:"off",onChange:s=>r(s.currentTarget.value)})]})}function b6({items:e,note:t}){const{t:n}=Te("ui");return a.jsxs("div",{className:"pp-resource-auto-names",children:[a.jsx("span",{children:n("deploymentResources.automaticNames")}),a.jsx("dl",{children:e.map(i=>a.jsxs("div",{children:[a.jsx("dt",{children:i.label}),a.jsx("dd",{title:i.name,children:i.name})]},i.label))}),t&&a.jsx("small",{children:t})]})}function E9e(e){var t,n,i,r,s,o,l,c;return e.tos.mode!=="auto"&&!((t=e.tos.bucket)!=null&&t.trim())?bn.t("ui:deploymentResources.validation.tos"):e.cr.mode!=="auto"&&(!((n=e.cr.instance)!=null&&n.trim())||!((i=e.cr.namespace)!=null&&i.trim())||!((r=e.cr.repository)!=null&&r.trim()))?bn.t("ui:deploymentResources.validation.cr"):e.codePipeline.mode!=="auto"&&(!((s=e.codePipeline.workspaceName)!=null&&s.trim())||!((o=e.codePipeline.pipelineName)!=null&&o.trim()))?bn.t("ui:deploymentResources.validation.codePipeline"):e.codePipeline.mode==="existing"&&(!((l=e.codePipeline.workspaceId)!=null&&l.trim())||!((c=e.codePipeline.pipelineId)!=null&&c.trim()))?bn.t("ui:deploymentResources.validation.existingCodePipeline"):null}function C9e({value:e,agentName:t,runtimeName:n,region:i,disabled:r,validationError:s,onChange:o}){const{t:l}=Te("ui"),c=t.trim()||"agentkit-app",u=n.trim()||c,d=i&&i!=="cn-beijing"?l("deploymentResources.autoBucketWithRegion",{region:i.startsWith("cn-")?i.slice(3):i}):l("deploymentResources.autoBucket"),f=gp(e.tos.mode==="existing"?{kind:"tos-bucket",region:i}:null),h=gp(e.cr.mode==="existing"?{kind:"cr-registry",region:i}:null),m=gp(e.cr.mode==="existing"&&e.cr.instance?{kind:"cr-namespace",region:i,registry:e.cr.instance}:null),g=gp(e.cr.mode==="existing"&&e.cr.instance&&e.cr.namespace?{kind:"cr-repository",region:i,registry:e.cr.instance,namespace:e.cr.namespace}:null),b=gp(e.codePipeline.mode==="existing"?{kind:"cp-workspace",region:i}:null),v=gp(e.codePipeline.mode==="existing"&&e.codePipeline.workspaceId?{kind:"cp-pipeline",region:i,workspaceId:e.codePipeline.workspaceId}:null),y=w=>o({...e,...w});return a.jsxs("div",{className:"pp-resource-list",children:[a.jsxs("div",{className:"pp-resource-item",children:[a.jsx("div",{className:"pp-resource-name",children:l("deploymentResources.tosBucket")}),a.jsxs("div",{className:"pp-resource-grid",children:[a.jsx(g6,{resource:l("deploymentResources.tosBucket"),value:e.tos.mode,disabled:r,onChange:w=>y({tos:{mode:w}})}),e.tos.mode==="create"&&a.jsx(Kv,{label:l("deploymentResources.bucketName"),value:e.tos.bucket??"",placeholder:l("deploymentResources.bucketNamePlaceholder"),disabled:r,onChange:w=>y({tos:{...e.tos,bucket:w}})}),e.tos.mode==="existing"&&a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.existingBucket")}),a.jsx(bp,{ariaLabel:l("deploymentResources.existingTosBucket"),value:e.tos.bucket??"",valueLabel:e.tos.bucket,state:f,disabled:r,onChange:w=>y({tos:{...e.tos,bucket:w.name}})})]}),e.tos.mode==="auto"&&a.jsx(b6,{items:[{label:l("deploymentResources.bucket"),name:d}],note:l("deploymentResources.accountIdResolved")})]})]}),a.jsxs("div",{className:"pp-resource-item",children:[a.jsx("div",{className:"pp-resource-name",children:l("deploymentResources.containerRegistry")}),a.jsxs("div",{className:"pp-resource-grid",children:[a.jsx(g6,{resource:"CR",value:e.cr.mode,disabled:r,onChange:w=>y({cr:{mode:w}})}),e.cr.mode==="create"&&a.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three",children:[a.jsx(Kv,{label:l("deploymentResources.instanceName"),value:e.cr.instance??"",placeholder:l("deploymentResources.crInstance"),disabled:r,onChange:w=>y({cr:{...e.cr,instance:w}})}),a.jsx(Kv,{label:l("deploymentResources.namespace"),value:e.cr.namespace??"",placeholder:l("deploymentResources.namespace"),disabled:r,onChange:w=>y({cr:{...e.cr,namespace:w}})}),a.jsx(Kv,{label:l("deploymentResources.repository"),value:e.cr.repository??"",placeholder:l("deploymentResources.repository"),disabled:r,onChange:w=>y({cr:{...e.cr,repository:w}})})]}),e.cr.mode==="existing"&&a.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three",children:[a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.crInstance")}),a.jsx(bp,{ariaLabel:l("deploymentResources.existingCrInstance"),value:e.cr.instance??"",valueLabel:e.cr.instance,state:h,disabled:r,valueField:"name",onChange:w=>y({cr:{mode:"existing",instance:w.name}})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.namespace")}),a.jsx(bp,{ariaLabel:l("deploymentResources.existingCrNamespace"),value:e.cr.namespace??"",valueLabel:e.cr.namespace,state:m,disabled:r||!e.cr.instance,valueField:"name",onChange:w=>y({cr:{...e.cr,namespace:w.name,repository:void 0}})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.repository")}),a.jsx(bp,{ariaLabel:l("deploymentResources.existingCrRepository"),value:e.cr.repository??"",valueLabel:e.cr.repository,state:g,disabled:r||!e.cr.namespace,valueField:"name",onChange:w=>y({cr:{...e.cr,repository:w.name}})})]})]}),e.cr.mode==="auto"&&a.jsx(b6,{items:[{label:l("deploymentResources.crInstance"),name:l("deploymentResources.autoRegistry")},{label:l("deploymentResources.namespace"),name:"agentkit"},{label:l("deploymentResources.repository"),name:l("deploymentResources.autoRepositoryName",{name:c})}],note:l("deploymentResources.registryNameNote")})]})]}),a.jsxs("div",{className:"pp-resource-item",children:[a.jsx("div",{className:"pp-resource-name",children:"CodePipeline"}),a.jsxs("div",{className:"pp-resource-grid",children:[a.jsx(g6,{resource:"CodePipeline",value:e.codePipeline.mode,disabled:r,onChange:w=>y({codePipeline:{mode:w}})}),e.codePipeline.mode==="create"&&a.jsxs("div",{className:"pp-resource-fields",children:[a.jsx(Kv,{label:l("deploymentResources.workspaceName"),value:e.codePipeline.workspaceName??"",placeholder:l("deploymentResources.workspaceName"),disabled:r,onChange:w=>y({codePipeline:{...e.codePipeline,workspaceName:w}})}),a.jsx(Kv,{label:l("deploymentResources.pipelineName"),value:e.codePipeline.pipelineName??"",placeholder:l("deploymentResources.pipelineName"),disabled:r,onChange:w=>y({codePipeline:{...e.codePipeline,pipelineName:w}})})]}),e.codePipeline.mode==="existing"&&a.jsxs("div",{className:"pp-resource-fields",children:[a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.workspace")}),a.jsx(bp,{ariaLabel:l("deploymentResources.existingWorkspace"),value:e.codePipeline.workspaceId??"",valueLabel:e.codePipeline.workspaceName,state:b,disabled:r,onChange:w=>y({codePipeline:{mode:"existing",workspaceId:w.id,workspaceName:w.name}})})]}),a.jsxs("label",{className:"pp-resource-field",children:[a.jsx("span",{children:l("deploymentResources.compatiblePipeline")}),a.jsx(bp,{ariaLabel:l("deploymentResources.existingPipeline"),value:e.codePipeline.pipelineId??"",valueLabel:e.codePipeline.pipelineName,state:v,disabled:r||!e.codePipeline.workspaceId,onChange:w=>y({codePipeline:{...e.codePipeline,pipelineId:w.id,pipelineName:w.name}})})]})]}),e.codePipeline.mode==="auto"&&a.jsx(b6,{items:[{label:l("deploymentResources.workspace"),name:"agentkit-cli-workspace"},{label:l("deploymentResources.pipeline"),name:u}],note:l("deploymentResources.pipelineNameNote")})]})]}),s&&a.jsx("p",{className:"pp-resource-validation",role:"alert",children:s})]})}function gZt(e){return[{value:"custom",label:e("environmentCenter.creation.custom.label"),description:e("environmentCenter.creation.custom.description")},{value:"dockerfile",label:e("environmentCenter.creation.dockerfile.label"),description:e("environmentCenter.creation.dockerfile.description")},{value:"git",label:e("environmentCenter.creation.git.label"),description:e("environmentCenter.creation.git.description")},{value:"image",label:e("environmentCenter.creation.image.label"),description:e("environmentCenter.creation.image.description")}]}const bZt=MIe.map(e=>({value:e.id,label:e.label,description:e.description}));function yZt(e){return[{value:"none",label:e("common.none"),description:e("environmentCenter.presets.none")},{value:"aio-sandbox",label:"AIO Sandbox",description:e("environmentCenter.presets.aio")},{value:"codex-sandbox",label:"Codex Sandbox",description:e("environmentCenter.presets.codex")}]}function vZt(e){const t=cZt(e,"");return t===pH?"aio-sandbox":t.includes("/codexenv:")?"codex-sandbox":"none"}const xZt=vI.map(e=>({value:e.id,label:e.label})),Joe=$Ie.map(e=>({value:e.id,label:e.label}));function wZt(e){return[{value:"managed",label:e("environmentCenter.repository.managed")},{value:"existing",label:e("environmentCenter.repository.existing")}]}const Y7=20,ele=new Set;function OZt(e){const t=e instanceof Error?e.message:String(e??"");return t.includes("HTTP 503")&&(t.includes("未配置持久化存储")||t.includes("storage is not configured"))}async function kZt(){var e;if(typeof navigator>"u"||!((e=navigator.permissions)!=null&&e.query))return!1;try{return(await navigator.permissions.query({name:"clipboard-read"})).state==="denied"}catch{return!1}}const SZt={opencli:RYt,uv:IYt,playwright:PYt,chromium:DYt,git:MYt,curl:LYt,ffmpeg:$Yt,imagemagick:FYt};function EZt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function of(){return a.jsx("span",{className:"environment-required-mark","aria-hidden":"true",children:"*"})}function CZt(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M12 3v11m0 0 4-4m-4 4-4-4"}),a.jsx("path",{d:"M5 16v2.5A2.5 2.5 0 0 0 7.5 21h9a2.5 2.5 0 0 0 2.5-2.5V16"})]})}function Z7(e,t){const n=e.trim();if(!n)return t("environmentCenter.errors.repositoryRequired");try{const i=new URL(n);if(i.protocol!=="https:"||!i.hostname)return t("environmentCenter.errors.repositoryHttps")}catch{return t("environmentCenter.errors.repositoryInvalid")}return""}function tle(e){return!!(e!=null&&e.region&&e.registry&&e.namespace&&e.repository)}function A9e(e,t){const n=e.trim();return n?/\s/.test(n)?t("environmentCenter.errors.imageReferenceWhitespace"):n.startsWith("sha256:")?/^sha256:[0-9a-fA-F]{64}$/.test(n)?"":t("environmentCenter.errors.imageDigestInvalid"):/[@/]/.test(n)?t("environmentCenter.errors.imageTagOnly"):"":""}function AZt(e){return(e instanceof Error?e.message:String(e)).split(` +原始响应:`,1)[0].trim()}function TZt(e){return a.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M5.5 10.5 16 5l10.5 5.5L16 16 5.5 10.5Z"}),a.jsx("path",{d:"M5.5 16 16 21.5 26.5 16M5.5 21.5 16 27l10.5-5.5"})]})}function _Zt({label:e}){return a.jsx("span",{className:"environment-package-fallback",children:e.slice(0,1).toUpperCase()})}function jZt({option:e}){if(e.id==="lark-cli")return a.jsx("img",{src:PL,alt:""});if(e.id==="pandoc")return a.jsx("img",{src:NYt,alt:""});if(e.id==="github-cli")return a.jsx(yK,{});const t=SZt[e.id];return t?a.jsx("img",{src:t,alt:""}):a.jsx(_Zt,{label:e.label})}function NZt(e,t){return e?{name:e.name,description:e.description,baseEnvironment:e.baseEnvironment,operatingSystem:e.operatingSystem,language:e.language,optionIds:[...e.optionIds],selectedSkills:[...e.selectedSkills],dockerfile:e.dockerfile===gH(e,t)?void 0:e.dockerfile,gitSource:e.gitSource,containerRepository:e.containerRepository,imageSource:e.imageSource}:{...o4,optionIds:[...o4.optionIds],selectedSkills:[...o4.selectedSkills]}}const Fy=new Set(["preparing","queued","building","scanning"]),nle=3e3,y6={preparing:"environmentCenter.buildStatus.preparing",queued:"environmentCenter.buildStatus.queued",building:"environmentCenter.buildStatus.building",scanning:"environmentCenter.buildStatus.scanning",available:"environmentCenter.buildStatus.available",failed:"environmentCenter.buildStatus.failed"};function T9e(e,t){var i;const n=(i=e.latestVersion)==null?void 0:i.status;return n?n==="available"?{label:t(y6[n]),color:"success"}:n==="failed"?{label:t(y6[n]),color:"danger"}:{label:t(y6[n]),color:"warning"}:{label:t("environmentCenter.buildStatus.notBuilt"),color:"secondary"}}function RZt(e,t){return BT(e,Date.now(),t)}function IZt(e,t){const n=Date.parse(e);return Number.isNaN(n)?e:new Intl.DateTimeFormat(t,{dateStyle:"medium",timeStyle:"medium"}).format(n)}function PZt(e,t,n=Date.now()){const i=Date.parse(e.createdAt),s=Fy.has(e.status)?n:Date.parse(e.updatedAt);if(Number.isNaN(i)||Number.isNaN(s))return"";const o=Math.max(0,Math.floor((s-i)/1e3));if(o<60)return t("environmentCenter.duration.seconds",{count:o});const l=Math.floor(o/60),c=o%60;return l<60?t("environmentCenter.duration.minutesSeconds",{minutes:l,seconds:c}):t("environmentCenter.duration.hoursMinutes",{hours:Math.floor(l/60),minutes:l%60})}function DZt({environment:e,onClose:t}){var x;const{t:n}=Te("ui"),i=((x=e.latestVersion)==null?void 0:x.versionId)??"",r=p.useId(),s=p.useRef(null),o=p.useRef(t),[l,c]=p.useState(null),[u,d]=p.useState(!0),[f,h]=p.useState(""),[m,g]=p.useState(0),[b,v]=p.useState("idle"),y=p.useMemo(()=>l?hZt(l):"",[l]);o.current=t,p.useEffect(()=>{var C;const O=document.body.style.overflow,k=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(C=s.current)==null||C.focus();const S=E=>{if(E.key==="Escape"){E.preventDefault(),o.current();return}if(E.key!=="Tab"||!s.current)return;const j=Array.from(s.current.querySelectorAll('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])')).filter(A=>A.getClientRects().length>0);if(!j.length)return;const T=j[0],R=j[j.length-1];E.shiftKey&&document.activeElement===T?(E.preventDefault(),R.focus()):!E.shiftKey&&document.activeElement===R&&(E.preventDefault(),T.focus())};return window.addEventListener("keydown",S),()=>{document.body.style.overflow=O,window.removeEventListener("keydown",S),k!=null&&k.isConnected&&k.focus()}},[]),p.useEffect(()=>{const O=new AbortController;return d(!0),h(""),JTe(e.id,i,O.signal).then(c).catch(k=>{(k==null?void 0:k.name)!=="AbortError"&&h(k instanceof Error?k.message:String(k))}).finally(()=>{O.signal.aborted||d(!1)}),()=>O.abort()},[e.id,m,i]),p.useEffect(()=>{if(b!=="copied")return;const O=window.setTimeout(()=>v("idle"),1500);return()=>window.clearTimeout(O)},[b]);const w=async()=>{try{await navigator.clipboard.writeText(y),v("copied")}catch{v("error")}};return yi.createPortal(a.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:O=>{O.target===O.currentTarget&&t()},children:a.jsxs("section",{ref:s,className:"environment-build-dialog environment-manifest-dialog",role:"dialog","aria-modal":"true","aria-labelledby":r,"aria-busy":u||void 0,tabIndex:-1,children:[a.jsxs("header",{className:"environment-build-dialog__header",children:[a.jsxs("div",{children:[a.jsx("div",{className:"environment-build-dialog__title-row",children:a.jsx("h2",{id:r,children:n("environmentCenter.manifest.title")})}),a.jsxs("p",{children:[e.name," / ",i]})]}),a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,onClick:t,"aria-label":n("environmentCenter.manifest.closeLabel"),children:a.jsx(Do,{"aria-hidden":!0})})]}),a.jsx("div",{className:"environment-manifest-dialog__body",children:u?a.jsx("div",{className:"environment-manifest-dialog__state",role:"status",children:a.jsx(cn,{as:"span",children:n("environmentCenter.manifest.loading")})}):f?a.jsxs("div",{className:"environment-manifest-dialog__state is-error",role:"alert",children:[a.jsx("p",{children:f}),a.jsx(_t,{type:"button",color:"secondary",variant:"soft",size:"sm",onClick:()=>g(O=>O+1),children:n("common.reload")})]}):a.jsx("div",{className:"environment-manifest-dialog__editor","aria-label":n("environmentCenter.manifest.editorLabel"),children:a.jsx(LT,{value:y,path:"environment.yaml",readOnly:!0,onChange:()=>{}})})}),a.jsxs("footer",{className:"environment-build-dialog__actions",children:[b==="error"?a.jsx("span",{className:"environment-manifest-dialog__copy-error",role:"alert",children:n("environmentCenter.manifest.copyFailed")}):null,a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"sm",onClick:t,children:n("common.close")}),a.jsx(_t,{type:"button",color:"info",size:"sm",disabled:!y,onClick:()=>void w(),children:n(b==="copied"?"environmentCenter.manifest.copied":"environmentCenter.manifest.copy")})]})]})}),document.body)}function MZt({environment:e,onClose:t,onBuildUpdate:n,onRebuild:i}){var S,C;const{t:r}=Te("ui"),s=e.latestVersion,[o,l]=p.useState(s),[c,u]=p.useState(!!s),[d,f]=p.useState(""),[h,m]=p.useState(Date.now()),[g,b]=p.useState(!1),v=p.useId(),y=p.useRef(null),w=p.useRef(t),x=p.useRef(n);p.useEffect(()=>{w.current=t,x.current=n},[n,t]),p.useEffect(()=>{var R;const E=document.body.style.overflow,j=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(R=y.current)==null||R.focus();const T=A=>{var P;if(A.key==="Escape"&&w.current(),A.key!=="Tab")return;const N=Array.from(((P=y.current)==null?void 0:P.querySelectorAll('button:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])'))??[]).filter(_=>_.getClientRects().length>0);if(!N.length)return;const D=N[0],I=N[N.length-1];A.shiftKey&&document.activeElement===D?(A.preventDefault(),I.focus()):!A.shiftKey&&document.activeElement===I&&(A.preventDefault(),D.focus())};return window.addEventListener("keydown",T),()=>{document.body.style.overflow=E,window.removeEventListener("keydown",T),j!=null&&j.isConnected&&j.focus()}},[]),p.useEffect(()=>{if(!s)return;let E=0;const j=new AbortController,T=async()=>{u(!0);try{const R=await ZTe(e.id,s.versionId,{includeLogs:!0,signal:j.signal});l(R),f(""),x.current(R),Fy.has(R.status)&&(E=window.setTimeout(T,nle))}catch(R){if((R==null?void 0:R.name)==="AbortError")return;f(R instanceof Error?R.message:String(R)),E=window.setTimeout(T,nle)}finally{j.signal.aborted||u(!1)}};return T(),()=>{j.abort(),window.clearTimeout(E)}},[e.id,s==null?void 0:s.versionId]),p.useEffect(()=>{if(!o||!Fy.has(o.status))return;const E=window.setInterval(()=>m(Date.now()),1e3);return()=>window.clearInterval(E)},[o==null?void 0:o.status]);const O=o?T9e({...e,latestVersion:o},r):{label:r("environmentCenter.buildStatus.notBuilt"),color:"secondary"},k=e.imageSource||(C=(S=o==null?void 0:o.resources)==null?void 0:S.codePipeline)==null?void 0:C.consoleUrl;return yi.createPortal(a.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:E=>{E.target===E.currentTarget&&t()},children:a.jsxs("section",{ref:y,className:"environment-build-dialog",role:"dialog","aria-modal":"true","aria-labelledby":v,tabIndex:-1,children:[a.jsxs("header",{className:"environment-build-dialog__header",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"environment-build-dialog__title-row",children:[a.jsx("h2",{id:v,children:r("environmentCenter.buildDetails.title")}),a.jsx(Ya,{color:O.color,size:"sm",children:O.label})]}),a.jsx("p",{children:e.name})]}),a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,onClick:t,"aria-label":r("environmentCenter.buildDetails.closeLabel"),children:a.jsx(Do,{"aria-hidden":!0})})]}),a.jsxs("div",{className:"environment-build-dialog__summary",children:[a.jsxs("div",{children:[a.jsx("span",{children:r("environmentCenter.buildDetails.currentStep")}),a.jsx("strong",{children:(o==null?void 0:o.currentStep)||r("environmentCenter.buildDetails.waiting")})]}),a.jsxs("div",{children:[a.jsx("span",{children:r("environmentCenter.buildDetails.elapsed")}),a.jsx("strong",{children:o?PZt(o,r,h):"-"})]}),o!=null&&o.sourceCommitSha?a.jsxs("div",{children:[a.jsx("span",{children:r("environmentCenter.buildDetails.sourceCommit")}),a.jsx("strong",{title:o.sourceCommitSha,children:o.sourceCommitSha.slice(0,12)})]}):null,k?a.jsxs("a",{href:k,target:"_blank",rel:"noreferrer",children:[r("environmentCenter.buildDetails.openCodePipeline")," ",a.jsx(m0,{"aria-hidden":!0})]}):null]}),a.jsxs("div",{className:"environment-build-dialog__body",children:[d?a.jsx("p",{className:"environment-build-dialog__error",role:"alert",children:d}):null,o!=null&&o.progressError?a.jsx("p",{className:"environment-build-dialog__notice",children:o.progressError}):null,a.jsx(VYt,{steps:(o==null?void 0:o.steps)??[],log:(o==null?void 0:o.logTail)??"",logError:o==null?void 0:o.logError,logTruncated:o==null?void 0:o.logTruncated,logUpdatedAt:o==null?void 0:o.logUpdatedAt,loading:c&&!!(o&&Fy.has(o.status))}),(o==null?void 0:o.status)==="failed"&&o.error?a.jsx("p",{className:"environment-build-dialog__failure",role:"alert",children:o.error}):null]}),a.jsxs("footer",{className:"environment-build-dialog__actions",children:[a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"sm",onClick:t,children:r("common.close")}),o&&!e.imageSource&&!Fy.has(o.status)?a.jsx(_t,{type:"button",color:"info",size:"sm",disabled:g,onClick:()=>{b(!0),i().then(t).finally(()=>b(!1))},children:r(g?"environmentCenter.buildDetails.starting":"environmentCenter.buildDetails.rebuild")}):null]})]})}),document.body)}function _9e({cloudProvider:e,value:t,disabled:n,onChange:i}){const{t:r}=Te("ui"),s=ju(e).map(o=>({value:o.value,label:o.label}));return a.jsxs("label",{className:"environment-field environment-region-field",children:[a.jsxs("span",{children:[r("environmentCenter.region"),a.jsx(of,{})]}),a.jsx(ha,{id:"environment-region",value:t,options:s,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:n,triggerClassName:"environment-select-trigger",onChange:o=>i(o.value)})]})}function LZt({repositoryUrl:e,gitRef:t,dockerfilePath:n,inspection:i,inspectedKey:r,disabled:s,onRepositoryUrlChange:o,onGitRefChange:l,onDockerfilePathChange:c,onInspectionChange:u,onInspectedKeyChange:d}){const{t:f}=Te("ui"),[h,m]=p.useState(!1),[g,b]=p.useState(""),v=p.useRef(null),y=p.useRef(""),w=`${e.trim()}\0${t.trim()}`,x=r===w;p.useEffect(()=>()=>{const C=v.current;v.current=null,C==null||C.abort()},[]);const O=()=>{var C;(C=v.current)==null||C.abort(),v.current=null,m(!1),b(""),u(null),d(""),c(""),y.current=""},k=p.useCallback(async()=>{var j;const C=Z7(e,f);if(C){b(C);return}y.current=w,(j=v.current)==null||j.abort();const E=new AbortController;v.current=E,m(!0),b("");try{const T=await VTe({repositoryUrl:e.trim(),...t.trim()?{ref:t.trim()}:{}},E.signal);if(v.current!==E)return;u(T),d(w),c(T.dockerfiles.length===1?T.dockerfiles[0]:"")}catch(T){if((T==null?void 0:T.name)==="AbortError")return;b(AZt(T)),u(null),d(""),c("")}finally{v.current===E&&(v.current=null,m(!1))}},[w,t,c,d,u,e,f]);p.useEffect(()=>{if(s||x||y.current===w||Z7(e,f))return;const C=window.setTimeout(()=>void k(),600);return()=>window.clearTimeout(C)},[w,s,k,x,e,f]);const S=x?(i==null?void 0:i.dockerfiles)??[]:[];return a.jsxs("section",{className:"environment-source-section","aria-label":f("environmentCenter.git.sectionLabel"),children:[a.jsxs("div",{className:"environment-form-grid environment-git-fields",children:[a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[f("environmentCenter.git.address"),a.jsx(of,{})]}),a.jsx(_s,{size:"lg",type:"url",required:!0,value:e,placeholder:"https://github.com/owner/repository.git",autoComplete:"url",disabled:s,"aria-invalid":!!g,onChange:C=>{O(),o(C.currentTarget.value)}})]}),a.jsxs("label",{className:"environment-field",children:[a.jsx("span",{children:f("environmentCenter.git.ref")}),a.jsx(_s,{size:"lg",value:t,placeholder:f("environmentCenter.git.defaultBranch"),autoComplete:"off",disabled:s,onChange:C=>{O(),l(C.currentTarget.value)}})]})]}),a.jsxs("div",{className:"environment-inspection-status environment-form-feedback","aria-live":"polite",children:[h?a.jsx(cn,{as:"span",children:f("environmentCenter.git.inspecting")}):null,g?a.jsxs("div",{className:"environment-source-error",role:"alert",children:[a.jsx("span",{children:g}),a.jsxs(_t,{type:"button",color:"primary",size:"sm",pill:!1,disabled:s,onClick:()=>void k(),children:[a.jsx(JD,{}),f("common.retry")]})]}):null,!h&&!g&&x&&i?S.length>0?a.jsx("span",{children:i.commitSha?f("environmentCenter.git.foundDockerfiles",{commit:i.commitSha.slice(0,12),count:S.length}):f("environmentCenter.git.savedDockerfileLoaded")}):a.jsxs("div",{className:"environment-source-error",role:"alert",children:[a.jsx("span",{children:f("environmentCenter.git.noDockerfile")}),a.jsx("button",{type:"button",disabled:s,onClick:()=>void k(),children:f("environmentCenter.git.inspectAgain")})]}):null]}),S.length>0?a.jsxs("label",{className:"environment-field environment-dockerfile-picker",children:[a.jsxs("span",{children:["Dockerfile",a.jsx(of,{})]}),a.jsx(xf,{ariaLabel:f("environmentCenter.git.selectDockerfile"),value:n,valueLabel:n,placeholder:f("environmentCenter.git.selectDockerfile"),options:S.map(C=>({value:C,label:C})),disabled:s||h,onChange:c})]}):null]})}function $Zt({cloudProvider:e,mode:t,region:n,value:i,disabled:r,onModeChange:s,onRegionChange:o,onChange:l}){const{t:c}=Te("ui");return a.jsx("section",{className:"environment-source-section","aria-label":c("environmentCenter.repository.outputSection"),children:a.jsxs("div",{className:"environment-form-grid",children:[a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[c("environmentCenter.repository.type"),a.jsx(of,{})]}),a.jsx(ha,{id:"environment-repository-mode",value:t,options:wZt(c),optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:r,triggerClassName:"environment-select-trigger",onChange:u=>s(u.value)})]}),a.jsx(_9e,{cloudProvider:e,value:n,disabled:r,onChange:o}),t==="existing"?a.jsx(S9e,{region:n,value:i,disabled:r,onChange:l}):a.jsx("p",{className:"environment-source-note environment-form-feedback",children:c("environmentCenter.repository.managedHint")})]})})}function FZt({cloudProvider:e,region:t,repository:n,reference:i,disabled:r,onRegionChange:s,onRepositoryChange:o,onReferenceChange:l}){const{t:c}=Te("ui"),u=A9e(i,c);return a.jsx("section",{className:"environment-source-section","aria-label":c("environmentCenter.existingImage.sectionLabel"),children:a.jsxs("div",{className:"environment-form-grid",children:[a.jsx(_9e,{cloudProvider:e,value:t,disabled:r,onChange:s}),a.jsx(S9e,{region:t,value:n,disabled:r,onChange:o}),a.jsxs("label",{className:"environment-field environment-image-reference",children:[a.jsxs("span",{children:[c("environmentCenter.existingImage.reference"),a.jsx(of,{})]}),a.jsx(_s,{size:"lg",value:i,required:!0,placeholder:c("environmentCenter.existingImage.placeholder"),autoComplete:"off",disabled:r,"aria-invalid":!!u,onChange:d=>l(d.currentTarget.value)}),u?a.jsx("small",{className:"environment-source-field__error",role:"alert",children:u}):a.jsx("small",{children:c("environmentCenter.existingImage.hint")})]})]})})}function j9e(e,t,n,i){const r=p.useRef(n),s=p.useRef(i);r.current=n,s.current=i,p.useEffect(()=>{const o=document.body.style.overflow,l=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden";const c=window.requestAnimationFrame(()=>{var d;return(d=t.current)==null?void 0:d.focus()}),u=d=>{var g;if(d.key==="Escape"&&!s.current){d.preventDefault(),r.current();return}if(d.key!=="Tab")return;const f=Array.from(((g=e.current)==null?void 0:g.querySelectorAll('button:not([disabled]), textarea:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])'))??[]).filter(b=>b.getClientRects().length>0);if(!f.length)return;const h=f[0],m=f[f.length-1];d.shiftKey&&document.activeElement===h?(d.preventDefault(),m.focus()):!d.shiftKey&&document.activeElement===m&&(d.preventDefault(),h.focus())};return window.addEventListener("keydown",u),()=>{window.cancelAnimationFrame(c),document.body.style.overflow=o,window.removeEventListener("keydown",u),l!=null&&l.isConnected&&l.focus()}},[e,t])}function BZt({environment:e,onClose:t}){const{t:n}=Te("ui"),i=p.useId(),r=p.useId(),s=p.useRef(null),o=p.useRef(null),[l,c]=p.useState(""),[u,d]=p.useState("loading"),[f,h]=p.useState(""),m=u==="loading";j9e(s,o,t,m);const g=async(b="",v)=>{d("loading"),h("");try{const y=b||(await HTe(e.id,v)).shareCode;c(y),await PTe(y),v!=null&&v.aborted||d("copied")}catch(y){if((y==null?void 0:y.name)==="AbortError")return;h(y instanceof Error?y.message:String(y)),d("error")}};return p.useEffect(()=>{const b=new AbortController;return g("",b.signal),()=>b.abort()},[e.id]),yi.createPortal(a.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:b=>{b.target===b.currentTarget&&!m&&t()},children:a.jsxs("section",{ref:s,className:"environment-share-dialog",role:"dialog","aria-modal":"true","aria-labelledby":i,"aria-describedby":r,"aria-busy":m||void 0,children:[a.jsxs("header",{className:"environment-build-dialog__header",children:[a.jsxs("div",{children:[a.jsx("h2",{id:i,children:n("environmentCenter.share.title")}),a.jsx("p",{id:r,children:e.name})]}),a.jsx(_t,{ref:o,type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,disabled:m,onClick:t,"aria-label":n("environmentCenter.share.closeLabel"),children:a.jsx(Do,{"aria-hidden":!0})})]}),a.jsx("div",{className:"environment-share-dialog__body",children:u==="loading"?a.jsx(cn,{as:"p",children:n("environmentCenter.share.generating")}):a.jsxs("div",{className:"environment-share-dialog__result",children:[u==="copied"?a.jsx("p",{className:"environment-share-dialog__success",role:"status","aria-live":"polite",children:n("environmentCenter.share.copied")}):a.jsxs("div",{className:"environment-share-dialog__error",role:"alert",children:[a.jsx("strong",{children:n("environmentCenter.share.failed")}),a.jsx("span",{children:f})]}),l?a.jsxs("label",{className:"environment-share-dialog__field environment-share-dialog__manual-code",children:[a.jsx("span",{children:n("environmentCenter.share.code")}),a.jsx(xb,{size:"lg",rows:4,value:l,readOnly:!0,"aria-label":n("environmentCenter.share.fullCode"),onFocus:b=>b.currentTarget.select(),onClick:b=>b.currentTarget.select()}),a.jsx("small",{children:n(u==="copied"?"environmentCenter.share.copiedHint":"environmentCenter.share.copyFailedHint")})]}):null,a.jsx("p",{className:"environment-share-dialog__safety",children:n("environmentCenter.share.safety")})]})}),a.jsxs("footer",{className:"environment-build-dialog__actions",children:[a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:m,onClick:t,children:n("common.close")}),u==="error"?a.jsx(_t,{type:"button",color:"info",size:"sm",onClick:()=>void g(l),children:n("common.retry")}):u==="copied"?a.jsx(_t,{type:"button",color:"info",size:"sm",onClick:()=>void g(l),children:n("environmentCenter.share.copyAgain")}):null]})]})}),document.body)}function UZt({initialValue:e,autoInspect:t,onClose:n,onImported:i}){const{t:r}=Te("ui"),s=p.useId(),o=p.useId(),l=p.useId(),c=p.useRef(null),u=p.useRef(null),d=p.useRef(!1),[f,h]=p.useState(e),[m,g]=p.useState("editing"),[b,v]=p.useState([]),[y,w]=p.useState(""),[x,O]=p.useState([]),k=p.useMemo(()=>Pz(f),[f]),S=k.length>Y7,C=m==="inspecting"||m==="importing",E=b.filter(D=>D.status==="valid"),j=b.filter(D=>D.status==="invalid"),T=m==="ready"&&E.length>0;j9e(c,u,n,C);const R=p.useCallback(async()=>{if(!(!k.length||S)){g("inspecting"),w(""),O([]);try{const D=await qTe(k);v([...D].sort((I,P)=>I.index-P.index)),g("ready")}catch(D){w(D instanceof Error?D.message:String(D)),g("editing")}}},[k,S]);p.useEffect(()=>{!t||d.current||(d.current=!0,R())},[t,R]);const A=async()=>{if(T){g("importing"),w(""),O([]);try{const D=E.map(U=>({code:k[U.index],name:U.name})).filter(U=>!!U.code),I=await WTe(D.map(U=>U.code)),P=I.filter(U=>U.status==="created").length,_=I.filter(U=>U.status==="duplicate").length,L=new Map(I.map(U=>[U.index,U])),F=D.flatMap(({code:U,name:Z},z)=>{const ee=L.get(z);return!ee||ee.status==="failed"?[{code:U,name:Z,status:"valid",error:(ee==null?void 0:ee.error)||r("environmentCenter.import.noResult")}]:[]}),V=[...j.flatMap(U=>{const Z=k[U.index];return Z?[{code:Z,name:"",status:"invalid",error:U.error||r("environmentCenter.import.invalidCode")}]:[]}),...F],q=new Map;if(I.forEach(U=>{U.environment&&q.set(U.environment.id,U.environment)}),i([...q.values()],P,_,V.length),!V.length){n();return}h(V.map(U=>U.code).join(` +`)),O(F),v(V.map((U,Z)=>({index:Z,status:U.status,name:U.name,error:U.status==="invalid"?U.error:""}))),w(r("environmentCenter.import.partial",{created:P,remaining:V.length})),g("ready")}catch(D){w(D instanceof Error?D.message:String(D)),g("ready")}}},N=m==="inspecting"?r("environmentCenter.import.inspecting"):m==="importing"?r("environmentCenter.import.importing"):T?x.length?r("environmentCenter.import.retryImport"):r("environmentCenter.import.confirm"):r("environmentCenter.import.inspectCodes");return yi.createPortal(a.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:D=>{D.target===D.currentTarget&&!C&&n()},children:a.jsxs("section",{ref:c,className:"environment-share-dialog environment-import-dialog",role:"dialog","aria-modal":"true","aria-labelledby":s,"aria-describedby":o,"aria-busy":C||void 0,children:[a.jsxs("header",{className:"environment-build-dialog__header",children:[a.jsxs("div",{children:[a.jsx("h2",{id:s,children:r("environmentCenter.import.title")}),a.jsx("p",{id:o,children:r("environmentCenter.import.description")})]}),a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,disabled:C,onClick:n,"aria-label":r("environmentCenter.import.closeLabel"),children:a.jsx(Do,{"aria-hidden":!0})})]}),a.jsxs("div",{className:"environment-share-dialog__body",children:[a.jsxs("label",{className:"environment-share-dialog__field",children:[a.jsx("span",{children:r("environmentCenter.import.code")}),a.jsx(xb,{ref:u,size:"lg",rows:6,value:f,disabled:C,"aria-invalid":S||j.length>0||void 0,"aria-describedby":l,placeholder:"akenv://v1/...",onChange:D=>{h(D.currentTarget.value),g("editing"),v([]),w(""),O([])}})]}),a.jsx("p",{id:l,className:`environment-share-dialog__help${S?" is-error":""}`,children:S?r("environmentCenter.import.tooMany",{max:Y7,count:k.length}):r("environmentCenter.import.multipleHint")}),a.jsx("p",{className:"environment-share-dialog__safety",children:r("environmentCenter.import.safety")}),m==="inspecting"?a.jsx(cn,{as:"p",children:r("environmentCenter.import.inspectingCodes")}):E.length?a.jsx("p",{className:"environment-share-dialog__summary",role:"status","aria-live":"polite",children:r("environmentCenter.import.found",{count:E.length,names:E.map(D=>D.name||r("environmentCenter.unnamed")).join(r("environmentCenter.listSeparator"))})}):null,j.length?a.jsx("ul",{className:"environment-share-dialog__failures",role:"alert",children:j.map(D=>a.jsx("li",{children:r("environmentCenter.import.itemError",{index:D.index+1,error:D.error||r("environmentCenter.import.invalidCode")})},D.index))}):null,x.length?a.jsx("ul",{className:"environment-share-dialog__failures",role:"alert",children:x.map((D,I)=>a.jsx("li",{children:r("environmentCenter.import.itemError",{index:I+1,error:D.error})},`${D.code}:${I}`))}):null,y?a.jsx("p",{className:"environment-share-dialog__error-text",role:"alert",children:y}):null]}),a.jsxs("footer",{className:"environment-build-dialog__actions",children:[a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:C,onClick:n,children:r("common.cancel")}),a.jsx(_t,{type:"button",color:"info",size:"sm",loading:C,disabled:C||!k.length||S||m==="ready"&&!T,onClick:()=>T?void A():void R(),children:N})]})]})}),document.body)}function QZt({environment:e,cloudProvider:t,onCancel:n,onDelete:i,onShare:r,onSave:s}){var He,Qe,jt,Pt,Kt,Ct,xt;const{t:o,i18n:l}=Te("ui"),c=gZt(o),u=NZt(e,t),d=u.dockerfile!==void 0,[f,h]=p.useState(()=>({...u,dockerfile:d?void 0:u.dockerfile})),[m,g]=p.useState(u.gitSource?"git":u.imageSource?"image":d?"dockerfile":"custom"),[b,v]=p.useState(d?(e==null?void 0:e.dockerfile)??"":""),[y,w]=p.useState(""),x=p.useRef(null),[O,k]=p.useState(()=>d?vZt((e==null?void 0:e.dockerfile)??""):u.baseEnvironment==="aio-sandbox"||u.baseEnvironment==="codex-sandbox"?u.baseEnvironment:"none"),[S,C]=p.useState(((He=u.gitSource)==null?void 0:He.repositoryUrl)??""),[E,j]=p.useState(((Qe=u.gitSource)==null?void 0:Qe.ref)??""),[T,R]=p.useState(((jt=u.gitSource)==null?void 0:jt.dockerfilePath)??""),[A,N]=p.useState(u.gitSource?{repositoryUrl:u.gitSource.repositoryUrl,ref:u.gitSource.ref??"",commitSha:"",dockerfiles:[u.gitSource.dockerfilePath]}:null),[D,I]=p.useState(u.gitSource?`${u.gitSource.repositoryUrl}\0${u.gitSource.ref??""}`:""),[P,_]=p.useState(u.containerRepository?"existing":"managed"),[L,F]=p.useState(((Pt=u.containerRepository)==null?void 0:Pt.region)??Zi(t)),[M,V]=p.useState(u.containerRepository??void 0),[q,U]=p.useState(((Kt=u.imageSource)==null?void 0:Kt.region)??Zi(t)),[Z,z]=p.useState(u.imageSource?{region:u.imageSource.region,registry:u.imageSource.registry,namespace:u.imageSource.namespace,repository:u.imageSource.repository}:void 0),[ee,ne]=p.useState(((Ct=u.imageSource)==null?void 0:Ct.reference)??""),[W,X]=p.useState(!1),H=p.useMemo(()=>gH(f,t),[t,f.baseEnvironment,f.operatingSystem,f.language,f.optionIds]),ae=f.dockerfile??H,Y=O!=="none",K=O==="aio-sandbox"?pH:O==="codex-sandbox"?LIe[t]:"",ie=Y?uZt(b):b,J=Y?iR(K,""):"",ye=Y?iR(K,ie):b,de=y||(Y?dZt(ie,K,o):xK(b,void 0,o)),ge=!!e,Ee="environment-editor-form",[xe,Ne]=p.useState(!1),[We,Xe]=p.useState(""),Re=!!ye.trim()&&!de,se=`${S.trim()}\0${E.trim()}`,ce=!Z7(S,o)&&D===se&&!!T&&(P==="managed"||tle(M)),ve=tle(Z)&&!!ee.trim()&&!A9e(ee,o),Se=!!f.name.trim()&&!xe&&(m==="custom"||m==="dockerfile"&&Re||m==="git"&&ce||m==="image"&&ve),oe=(tt,mt)=>{h(_e=>({..._e,optionIds:mt?[..._e.optionIds,tt]:_e.optionIds.filter(Ot=>Ot!==tt)}))},$e=tt=>{w(""),v(Y?iR(K,tt):tt)},Ue=async tt=>{if(!tt)return;const mt=await fZt(tt,o);w(mt.error),mt.content&&v(mt.content)},me=()=>{w(""),v(J)},ke=async tt=>{if(tt.preventDefault(),!!Se){Ne(!0),Xe("");try{const mt=Tmt(ye);await s({...f,name:f.name.trim(),description:f.description.trim(),optionIds:m==="custom"?f.optionIds:[],selectedSkills:m==="custom"?f.selectedSkills:[],dockerfile:m==="dockerfile"?ye:m==="custom"?ae:"",gitSource:m==="git"?{repositoryUrl:S.trim(),...E.trim()?{ref:E.trim()}:{},dockerfilePath:T}:null,containerRepository:m==="git"&&P==="existing"?M:null,imageSource:m==="image"&&Z?{...Z,reference:ee.trim()}:null,...m==="dockerfile"?mt:{}})}catch(mt){Xe(mt instanceof Error?mt.message:String(mt)),Ne(!1)}}},Ae=f.name.trim()||(ge?(e==null?void 0:e.name)||o("environmentCenter.configure"):o("environmentCenter.create"));return a.jsx(Sh,{className:"environment-editor","aria-label":o(ge?"environmentCenter.details":"environmentCenter.create"),children:a.jsx(lT,{title:Ae,description:o("environmentCenter.editorDescription"),identitySeed:Ae,backLabel:o("environmentCenter.backToList"),onBack:n,actions:a.jsxs(a.Fragment,{children:[i?a.jsx(_t,{type:"button",color:"danger",variant:"ghost",size:"sm",onClick:i,disabled:xe,children:o("common.delete")}):null,r?a.jsx(_t,{color:"secondary",variant:"soft",size:"sm",onClick:r,disabled:xe,children:o("environmentCenter.share.action")}):null,a.jsx(_t,{color:"secondary",variant:"soft",size:"sm",onClick:n,disabled:xe,children:o("common.cancel")}),a.jsx(_t,{color:"info",size:"sm",type:"submit",form:Ee,disabled:!Se,children:o(xe?"common.saving":m==="image"?ge?"environmentCenter.save":"environmentCenter.create":ge?"environmentCenter.saveAndBuild":"environmentCenter.createAndBuild")})]}),children:a.jsxs("form",{id:Ee,className:"environment-form",onSubmit:ke,children:[a.jsxs("div",{className:"environment-fields",children:[a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[o("environmentCenter.name"),a.jsx(of,{})]}),a.jsx(_s,{className:"environment-text-input",type:"text",size:"lg",required:!0,value:f.name,maxLength:60,placeholder:o("environmentCenter.namePlaceholder"),onChange:tt=>h(mt=>({...mt,name:tt.target.value}))})]}),a.jsxs("label",{className:"environment-field",children:[a.jsx("span",{children:o("common.description")}),a.jsx(xb,{className:"environment-description-input",size:"lg",rows:3,value:f.description,maxLength:180,placeholder:o("environmentCenter.descriptionPlaceholder"),onChange:tt=>h(mt=>({...mt,description:tt.target.value}))})]})]}),a.jsxs("label",{className:"environment-field environment-creation-method",children:[a.jsxs("span",{children:[o("environmentCenter.creationMethod"),a.jsx(of,{})]}),a.jsx(ha,{id:"environment-creation-method",value:m,options:c,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:tt=>{const mt=tt.value;g(mt),mt==="dockerfile"&&!b.trim()&&v(J),Xe("")}}),a.jsx("small",{children:(xt=c.find(tt=>tt.value===m))==null?void 0:xt.description})]}),We?a.jsx("p",{className:"environment-form-error",role:"alert",children:We}):null,m==="custom"?a.jsxs("div",{className:"environment-configuration",children:[a.jsx("section",{className:"environment-section environment-form-section","aria-label":o("environmentCenter.baseConfiguration"),children:a.jsxs("div",{className:"environment-form-grid",children:[a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[o("environmentCenter.baseEnvironment"),a.jsx(of,{})]}),a.jsx(ha,{id:"environment-base-environment",value:f.baseEnvironment,options:bZt.map(tt=>({...tt,description:o(`environmentCenter.baseDescriptions.${tt.value}`)})),optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:tt=>{const mt=tt.value,_e=mt==="aio-sandbox"||mt==="codex-sandbox";h(Ot=>({...Ot,baseEnvironment:mt,operatingSystem:_e?"ubuntu-22.04":Ot.operatingSystem,language:_e?"python-3.12":Ot.language}))}}),a.jsx("small",{children:o(`environmentCenter.baseDescriptions.${f.baseEnvironment}`)})]}),a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[o("environmentCenter.operatingSystem"),a.jsx(of,{})]}),a.jsx(ha,{id:"environment-operating-system",value:f.operatingSystem,options:xZt,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:f.baseEnvironment!=="ubuntu",triggerClassName:"environment-select-trigger",onChange:tt=>h(mt=>({...mt,operatingSystem:tt.value}))}),a.jsx("small",{children:f.baseEnvironment!=="ubuntu"?o("environmentCenter.fixedByBase",{base:PB(f.baseEnvironment),value:"Ubuntu 22.04"}):o("environmentCenter.selectUbuntuVersion")})]}),a.jsxs("label",{className:"environment-field",children:[a.jsxs("span",{children:[o("environmentCenter.pythonVersion"),a.jsx(of,{})]}),a.jsx(ha,{id:"environment-python-version",value:f.language,options:f.baseEnvironment!=="ubuntu"?Joe.filter(tt=>tt.value==="python-3.12"):Joe,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:f.baseEnvironment!=="ubuntu",triggerClassName:"environment-select-trigger",onChange:tt=>h(mt=>({...mt,language:tt.value}))}),a.jsx("small",{children:f.baseEnvironment!=="ubuntu"?o("environmentCenter.fixedByBase",{base:PB(f.baseEnvironment),value:"Python 3.12"}):o("environmentCenter.selectPythonVersion")})]})]})}),a.jsxs("section",{className:"environment-section","aria-labelledby":"environment-skills-title",children:[a.jsx("h2",{id:"environment-skills-title",children:o("environmentCenter.skills")}),a.jsxs("div",{className:"environment-skill-grid",children:[a.jsx(Zoe,{name:"VeADK",description:o("environmentCenter.veadkDescription"),selected:W,disabled:xe,onChange:X,icon:a.jsx("img",{src:pM,alt:""})}),a.jsx(vK,{selected:f.selectedSkills,onChange:tt=>h(mt=>({...mt,selectedSkills:tt})),cloudProvider:t,disabled:xe,addLabel:o("environmentCenter.addSkill"),showSelectedCount:!1})]})]}),mH.map(tt=>a.jsxs("section",{className:"environment-section","aria-labelledby":`environment-${tt.id}-title`,children:[a.jsx("h2",{id:`environment-${tt.id}-title`,children:o(`environmentCenter.categories.${tt.id}`)}),a.jsx("div",{className:"environment-option-grid",children:tt.options.map(mt=>{const _e=f.optionIds.includes(mt.id);return a.jsx(Zoe,{name:mt.label,description:o(`environmentCenter.options.${mt.id}`,{defaultValue:mt.description}),selected:_e,onChange:Ot=>oe(mt.id,Ot),icon:a.jsx(jZt,{option:mt})},mt.id)})})]},tt.id))]}):m==="dockerfile"?a.jsxs("section",{className:"environment-upload","aria-label":o("environmentCenter.customDockerfile"),children:[a.jsx("div",{className:"environment-dockerfile-settings environment-form-grid",children:a.jsxs("label",{className:"environment-field",children:[a.jsx("span",{children:o("environmentCenter.presetEnvironment")}),a.jsx(ha,{id:"environment-dockerfile-base-environment",value:O,options:yZt(o),optionClassName:"environment-select-option",size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:tt=>{w(""),k(tt.value)}}),a.jsx("small",{children:o("environmentCenter.presetHint")})]})}),a.jsxs("div",{className:"environment-upload__preview",children:[a.jsxs("div",{children:[a.jsxs("h3",{children:["Dockerfile",a.jsx(of,{})]}),a.jsxs("div",{className:"environment-upload__actions",children:[a.jsx("span",{className:"environment-upload__size",children:o("environmentCenter.dockerfileSize",{size:O9e(ye).toLocaleString(l.resolvedLanguage??l.language),max:131072 .toLocaleString(l.resolvedLanguage??l.language)})}),a.jsx("input",{ref:x,className:"environment-upload__file-input",type:"file",accept:".dockerfile,text/plain",tabIndex:-1,hidden:!0,onChange:tt=>{var _e;const mt=tt.currentTarget;Ue((_e=mt.files)==null?void 0:_e[0]).finally(()=>{mt.value=""})}}),a.jsx(_t,{className:"environment-upload__action",type:"button",color:"secondary",variant:"soft",size:"sm",pill:!1,disabled:xe,onClick:()=>{var tt;return(tt=x.current)==null?void 0:tt.click()},children:o("environmentCenter.upload")}),a.jsx(_t,{className:"environment-upload__action",type:"button",color:"secondary",variant:"ghost",size:"sm",pill:!1,disabled:xe||!ie,onClick:me,children:o("environmentCenter.reset")})]})]}),a.jsxs("div",{className:`environment-dockerfile-editor${Y?" has-fixed-base":""}${de?" is-invalid":""}`,children:[Y?a.jsxs("div",{className:"environment-dockerfile-from","aria-label":o("environmentCenter.dockerfileBaseImage"),children:[a.jsx("span",{className:"environment-dockerfile-from__line","aria-hidden":"true",children:"1"}),a.jsxs("code",{children:[a.jsx("span",{className:"environment-dockerfile-from__keyword",children:"FROM"}),a.jsx("span",{title:K,children:K})]})]}):null,a.jsx("div",{className:"environment-dockerfile__editor environment-upload__editor","aria-label":o("environmentCenter.dockerfileContent"),children:a.jsx(LT,{value:ie,path:"Dockerfile",lineNumberStart:Y?2:1,height:"auto",minHeight:"28px",maxHeight:"var(--environment-dockerfile-editor-max-height)",onChange:$e})})]})]}),de?a.jsx("p",{className:"environment-upload__error environment-upload__error--below",role:"alert",children:de}):null]}):m==="git"?a.jsxs("div",{className:"environment-source-workflow",children:[a.jsx(LZt,{repositoryUrl:S,gitRef:E,dockerfilePath:T,inspection:A,inspectedKey:D,disabled:xe,onRepositoryUrlChange:C,onGitRefChange:j,onDockerfilePathChange:R,onInspectionChange:N,onInspectedKeyChange:I}),a.jsx($Zt,{cloudProvider:t,mode:P,region:L,value:M,disabled:xe,onModeChange:tt=>{_(tt),Xe("")},onRegionChange:tt=>{F(tt),V(void 0),Xe("")},onChange:V})]}):a.jsx(FZt,{cloudProvider:t,region:q,repository:Z,reference:ee,disabled:xe,onRegionChange:tt=>{U(tt),z(void 0),Xe("")},onRepositoryChange:z,onReferenceChange:ne})]})})})}function N9e({cloudProvider:e="volcengine",onWorkspace:t,onProjects:n,clipboardImport:i=null,clipboardReadError:r=""}){const{t:s,i18n:o}=Te("ui"),[l,c]=p.useState([]),[u,d]=p.useState({kind:"list"}),[f,h]=p.useState(""),[m,g]=p.useState(null),[b,v]=p.useState(null),[y,w]=p.useState(null),[x,O]=p.useState(null),[k,S]=p.useState(null),C=p.useRef(0),[E,j]=p.useState(""),[T,R]=p.useState(!1),[A,N]=p.useState(r),[D,I]=p.useState(!0),[P,_]=p.useState(""),[L,F]=p.useState(0),[M,V]=p.useState(()=>new Set),q=p.useDeferredValue(f),U=p.useMemo(()=>{const Y=q.trim().toLocaleLowerCase();return Y?l.filter(K=>`${K.name} ${K.description} ${IB(K.operatingSystem)} ${$p(K.language)} ${PB(K.baseEnvironment)}`.toLocaleLowerCase().includes(Y)):l},[q,l]),Z=p.useCallback((Y="",K=!1)=>{C.current+=1,S({key:C.current,initialValue:Y,autoInspect:K})},[]),z=p.useCallback((Y,K=!1)=>{const ie=Y.trim();if(!ie.startsWith("akenv://")||!K&&ele.has(ie))return!1;const J=Pz(ie);return!J.length||J.length>Y7?!1:(ele.add(ie),N(""),Z(ie,!0),!0)},[Z]),ee=p.useCallback(async()=>{var Y;if(!(u.kind!=="list"||k)){if(typeof navigator>"u"||!((Y=navigator.clipboard)!=null&&Y.readText)){N(s("environmentCenter.clipboardUnsupported"));return}try{const K=await navigator.clipboard.readText();!z(K)&&!K.trim()&&await kZt()&&N(s("environmentCenter.clipboardReadError"))}catch{N(s("environmentCenter.clipboardReadError"))}}},[k,z,s,u.kind]);p.useEffect(()=>{const Y=new AbortController;return l.length===0&&I(!0),_(""),UA(Y.signal).then(K=>{c(K)}).catch(K=>{(K==null?void 0:K.name)!=="AbortError"&&(OZt(K)?(c([]),R(!1),j(s("environmentCenter.storageUnavailable"))):_(K instanceof Error?K.message:String(K)))}).finally(()=>{Y.signal.aborted||I(!1)}),()=>Y.abort()},[L]),p.useEffect(()=>{if(!l.some(K=>K.latestVersion&&Fy.has(K.latestVersion.status)))return;const Y=window.setTimeout(()=>F(K=>K+1),2500);return()=>window.clearTimeout(Y)},[l]),p.useEffect(()=>{if(!E||T)return;const Y=window.setTimeout(()=>j(""),2800);return()=>window.clearTimeout(Y)},[T,E]),p.useEffect(()=>{r&&N(r)},[r]),p.useEffect(()=>{i&&z(i.text)},[i,z]),p.useEffect(()=>{if(u.kind!=="list")return;const Y=()=>void ee(),K=()=>{document.visibilityState==="visible"&&ee()},ie=J=>{var ge;const ye=J.target;if(ye instanceof HTMLInputElement||ye instanceof HTMLTextAreaElement||ye instanceof HTMLElement&&ye.isContentEditable)return;const de=((ge=J.clipboardData)==null?void 0:ge.getData("text/plain"))??"";z(de,!0)&&J.preventDefault()};return window.addEventListener("focus",Y),document.addEventListener("visibilitychange",K),window.addEventListener("paste",ie),()=>{window.removeEventListener("focus",Y),document.removeEventListener("visibilitychange",K),window.removeEventListener("paste",ie)}},[z,ee,u.kind]);const ne=u.kind==="editor"&&u.environmentId?l.find(Y=>Y.id===u.environmentId):void 0,W=async Y=>{const K={...Y,dockerfile:Y.dockerfile??gH(Y,e)},ie=ne?await XTe(ne.id,K):await GTe(K);if(c(J=>[ie,...J.filter(ye=>ye.id!==ie.id)]),d({kind:"list"}),R(!1),K.imageSource){j(s("environmentCenter.status.boundImage",{name:ie.name}));return}try{const J=await Q8(ie.id);c(ye=>ye.map(de=>de.id===ie.id?{...de,latestVersion:J}:de)),j(s("environmentCenter.status.queued",{name:ie.name}))}catch(J){R(!0),j(s("environmentCenter.status.savedBuildFailed",{error:J instanceof Error?J.message:String(J)}))}},X=async Y=>{if(!M.has(Y.id)){V(K=>new Set(K).add(Y.id)),R(!1);try{const K=await Q8(Y.id);c(ie=>ie.map(J=>J.id===Y.id?{...J,latestVersion:K}:J)),j(s("environmentCenter.status.queued",{name:Y.name}))}catch(K){R(!0),j(K instanceof Error?K.message:String(K))}finally{V(K=>{const ie=new Set(K);return ie.delete(Y.id),ie})}}},H=(Y,K,ie,J)=>{Y.length&&c(ye=>{const de=new Set(Y.map(ge=>ge.id));return[...Y,...ye.filter(ge=>!de.has(ge.id))]}),R(J>0),j(J>0?s("environmentCenter.status.importedFailed",{created:K,failed:J}):ie>0?s("environmentCenter.status.importedDuplicate",{created:K,duplicate:ie}):s("environmentCenter.status.imported",{count:K}))},ae=m?a.jsx(Td,{title:s("environmentCenter.deleteTitle"),description:s("environmentCenter.deleteDescription",{name:m.name}),confirmLabel:s("common.delete"),variant:"danger",onCancel:()=>g(null),onConfirm:()=>{const Y=m;g(null),d({kind:"list"}),YTe(Y.id).then(()=>{c(K=>K.filter(ie=>ie.id!==Y.id)),R(!1),j(s("environmentCenter.status.deleted",{name:Y.name}))}).catch(K=>{R(!0),j(K instanceof Error?K.message:String(K))})}}):null;return u.kind==="editor"?a.jsxs(a.Fragment,{children:[a.jsx(QZt,{environment:ne,cloudProvider:e,onCancel:()=>d({kind:"list"}),onDelete:ne?()=>g(ne):void 0,onShare:ne?()=>O(ne):void 0,onSave:W},u.environmentId??"new"),x?a.jsx(BZt,{environment:x,onClose:()=>O(null)}):null,ae]}):a.jsxs(bK,{section:"environments",className:"environment-center",onWorkspace:t,onProjects:n,actions:a.jsxs(a.Fragment,{children:[E?a.jsx("span",{className:`environment-status${T?" is-error":""}`,role:T?"alert":"status","aria-live":"polite",children:E}):null,a.jsx(Jp,{"aria-label":s("environmentCenter.search"),value:f,onChange:Y=>h(Y.target.value),placeholder:s("environmentCenter.search")})]}),children:[A?a.jsxs("div",{className:"environment-clipboard-notice",role:"alert",children:[a.jsx("span",{children:A}),a.jsx(_t,{type:"button",color:"secondary",variant:"soft",size:"sm",onClick:()=>{N(""),Z()},children:s("environmentCenter.manualImport")})]}):null,a.jsx(em,{"aria-live":"polite",children:D?a.jsx(cl,{}):P?a.jsxs("div",{className:"environment-load-error",role:"alert",children:[a.jsx("p",{children:So(P,o.resolvedLanguage||o.language)||s("environmentCenter.loadFailed")}),a.jsx(_t,{color:"secondary",variant:"soft",size:"sm",onClick:()=>F(Y=>Y+1),children:s("common.reload")})]}):U.length===0&&f.trim()?a.jsx("div",{className:"environment-empty",children:a.jsxs(Wn,{fill:"none",children:[a.jsx(Wn.Icon,{children:a.jsx(TZt,{})}),a.jsx(Wn.Title,{children:s("environmentCenter.noMatches")}),a.jsx(Wn.Description,{children:s("environmentCenter.tryAnotherName")})]})}):a.jsxs(K0,{children:[f.trim()?null:a.jsxs(a.Fragment,{children:[a.jsx(cb,{"aria-label":s("environmentCenter.create"),icon:a.jsx(EZt,{}),onClick:()=>d({kind:"editor",environmentId:null}),children:s("environmentCenter.create")}),a.jsx(cb,{"aria-label":s("environmentCenter.import.title"),icon:a.jsx(CZt,{}),onClick:()=>Z(),children:s("environmentCenter.import.title")})]}),U.map(Y=>{var ye,de;const K=T9e(Y,s),ie=!!(Y.latestVersion&&Fy.has(Y.latestVersion.status)),J=M.has(Y.id);return a.jsx(X0,{className:"environment-card",title:Y.name,status:a.jsx(Ya,{color:K.color,size:"sm",children:K.label}),description:((ye=Y.latestVersion)==null?void 0:ye.error)||(ie?(de=Y.latestVersion)==null?void 0:de.currentStep:"")||Y.description||s("common.noDescription"),metadata:[{label:s("workspace.updated"),value:RZt(Y.updatedAt,o.resolvedLanguage??o.language),title:IZt(Y.updatedAt,o.resolvedLanguage??o.language)}],action:{label:Y.latestVersion?s("environmentCenter.buildDetails.title"):s(J?"environmentCenter.buildDetails.starting":"environmentCenter.startBuild"),icon:"play",title:s("environmentCenter.build"),disabled:J,onClick:()=>Y.latestVersion?v(Y.id):void X(Y)},auxiliaryAction:{label:s("environmentCenter.manifest.view"),icon:a.jsx(oat,{}),title:Y.latestVersion?s("environmentCenter.manifest.viewShort"):s("environmentCenter.manifest.unavailable"),disabled:!Y.latestVersion,onClick:()=>w(Y)},detailAction:{label:s("environmentCenter.configure"),onClick:()=>d({kind:"editor",environmentId:Y.id})}},Y.id)})]})}),b?(()=>{const Y=l.find(K=>K.id===b);return Y?a.jsx(MZt,{environment:Y,onClose:()=>v(null),onBuildUpdate:K=>{c(ie=>ie.map(J=>J.id===Y.id?{...J,latestVersion:K}:J))},onRebuild:()=>X(Y)}):null})():null,y!=null&&y.latestVersion?a.jsx(DZt,{environment:y,onClose:()=>w(null)}):null,ae,k?a.jsx(UZt,{initialValue:k.initialValue,autoInspect:k.autoInspect,onClose:()=>S(null),onImported:H},k.key):null]})}function zZt(e){const t=e instanceof Error?e.message:String(e??"");return t.includes("HTTP 503")&&(t.includes("未配置持久化存储")||t.includes("storage is not configured"))}function VZt(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",...e,children:a.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function HZt(e){return a.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"4.5",y:"7",width:"23",height:"18",rx:"3"}),a.jsx("path",{d:"M10 7V5.5A1.5 1.5 0 0 1 11.5 4h4A1.5 1.5 0 0 1 17 5.5V7M9 13h5v5H9zM18 13h5M18 17h5M9 22h14"})]})}function J7(e,t){const n=Date.parse(e);return Number.isNaN(n)?e:new Intl.DateTimeFormat(t,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(n)}function qZt(e,t){return e.environmentIds.reduce((n,i)=>{var r,s;return((s=(r=t.get(i))==null?void 0:r.latestVersion)==null?void 0:s.status)==="available"?n+1:n},0)}function WZt({workspace:e,environments:t,onBack:n,onSave:i,onDelete:r}){const{t:s,i18n:o}=Te("ui"),[l,c]=p.useState((e==null?void 0:e.name)??""),[u,d]=p.useState((e==null?void 0:e.description)??""),[f,h]=p.useState((e==null?void 0:e.environmentIds)??[]),[m,g]=p.useState(""),[b,v]=p.useState(!1),[y,w]=p.useState(""),x=m.trim().toLocaleLowerCase(),O=t.filter(S=>`${S.name} ${S.description} ${$p(S.language)}`.toLocaleLowerCase().includes(x)),k=async S=>{if(S.preventDefault(),!(!l.trim()||b)){v(!0),w("");try{await i({name:l.trim(),description:u.trim(),environmentIds:f})}catch(C){w(C instanceof Error?C.message:String(C)),v(!1)}}};return a.jsx(Sh,{className:"workspace-center","aria-label":s(e?"workspace.detail":"workspace.create"),children:a.jsxs(lT,{title:e?e.name:s("workspace.create"),description:s("workspace.editorDescription"),identitySeed:(e==null?void 0:e.name)||s("workspace.create"),backLabel:s("workspace.backToList"),onBack:n,actions:a.jsxs(a.Fragment,{children:[r?a.jsx("button",{type:"button",className:"is-danger",onClick:r,children:s("common.delete")}):null,a.jsx("button",{type:"submit",form:"workspace-form",disabled:b||!l.trim(),children:s(b?"common.saving":"common.save")})]}),children:[e?a.jsxs(yH,{children:[a.jsxs("div",{children:[a.jsx("dt",{children:s("common.environment")}),a.jsx("dd",{children:s("workspace.environmentCount",{count:f.length})})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("workspace.createdAt")}),a.jsx("dd",{children:J7(e.createdAt,o.resolvedLanguage??o.language)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("workspace.updatedAt")}),a.jsx("dd",{children:J7(e.updatedAt,o.resolvedLanguage??o.language)})]})]}):null,a.jsxs("form",{id:"workspace-form",className:"workspace-form",onSubmit:k,children:[a.jsxs("section",{className:"workspace-fields","aria-label":s("workspace.basicInfo"),children:[a.jsxs("label",{children:[a.jsx("span",{children:s("common.name")}),a.jsx(_s,{value:l,maxLength:128,autoFocus:!0,onChange:S=>c(S.target.value),placeholder:s("workspace.namePlaceholder")})]}),a.jsxs("label",{children:[a.jsx("span",{children:s("common.description")}),a.jsx(xb,{value:u,maxLength:2e3,onChange:S=>d(S.target.value),placeholder:s("workspace.descriptionPlaceholder")})]})]}),a.jsxs("section",{className:"workspace-environments",children:[a.jsx(YIe,{title:s("common.environment"),description:s("workspace.selectedEnvironmentCount",{count:f.length}),actions:a.jsx(Jp,{"aria-label":s("workspace.searchAvailableEnvironments"),value:m,onChange:S=>g(S.target.value),placeholder:s("workspace.searchEnvironments")})}),t.length===0?a.jsxs("div",{className:"workspace-environment-empty",children:[a.jsx("p",{children:s("workspace.noAvailableEnvironments")}),a.jsx("span",{children:s("workspace.createEnvironmentFirst")})]}):O.length===0?a.jsxs("div",{className:"workspace-environment-empty",children:[a.jsx("p",{children:s("workspace.noMatchingEnvironments")}),a.jsx("span",{children:s("workspace.tryAnotherName")})]}):a.jsx("div",{className:"workspace-environment-list",children:O.map(S=>{var j;const C=f.includes(S.id),E=((j=S.latestVersion)==null?void 0:j.status)==="available"?s("workspace.environmentStatus.available"):S.latestVersion?s("workspace.environmentStatus.building"):s("workspace.environmentStatus.notBuilt");return a.jsxs("label",{className:`workspace-environment-option${C?" is-selected":""}`,children:[a.jsx("input",{type:"checkbox",checked:C,onChange:()=>h(T=>C?T.filter(R=>R!==S.id):[...T,S.id])}),a.jsxs("span",{className:"workspace-environment-option__copy",children:[a.jsx("strong",{title:S.name,children:S.name}),a.jsxs("span",{children:[$p(S.language)," · ",E]})]}),a.jsx("span",{className:"workspace-environment-option__action",children:s(C?"workspace.added":"common.add")})]},S.id)})})]}),y?a.jsx("p",{className:"workspace-form-error",role:"alert",children:y}):null]})]})})}function KZt({onEnvironment:e,onProjects:t}){const{t:n,i18n:i}=Te("ui"),[r,s]=p.useState([]),[o,l]=p.useState([]),[c,u]=p.useState({kind:"list"}),[d,f]=p.useState(""),[h,m]=p.useState(!0),[g,b]=p.useState(""),[v,y]=p.useState(""),[w,x]=p.useState(!1),[O,k]=p.useState(null),[S,C]=p.useState(0),E=p.useDeferredValue(d);p.useEffect(()=>{const A=new AbortController;return m(!0),b(""),Promise.all([Lz(A.signal),UA(A.signal)]).then(([N,D])=>{s(N),l(D)}).catch(N=>{(N==null?void 0:N.name)!=="AbortError"&&(zZt(N)?(s([]),l([]),x(!1),y(n("workspace.storageUnavailable"))):(console.warn("Unable to load Studio workspaces",N),b(n("workspace.loadFailed"))))}).finally(()=>{A.signal.aborted||m(!1)}),()=>A.abort()},[S,n]),p.useEffect(()=>{if(!v||w)return;const A=window.setTimeout(()=>y(""),2800);return()=>window.clearTimeout(A)},[w,v]);const j=p.useMemo(()=>new Map(o.map(A=>[A.id,A])),[o]),T=p.useMemo(()=>{const A=E.trim().toLocaleLowerCase();return A?r.filter(N=>{const D=N.environmentIds.map(I=>{var P;return((P=j.get(I))==null?void 0:P.name)??""}).join(" ");return`${N.name} ${N.description} ${D}`.toLocaleLowerCase().includes(A)}):r},[E,j,r]),R=c.kind==="detail"&&c.workspaceId?r.find(A=>A.id===c.workspaceId):void 0;return c.kind==="detail"?a.jsx(WZt,{workspace:R,environments:o,onBack:()=>u({kind:"list"}),onDelete:R?()=>k(R):null,onSave:async A=>{const N=R?await QTe(R.id,A):await UTe(A);s(D=>[N,...D.filter(I=>I.id!==N.id)]),x(!1),y(n("workspace.saved",{name:N.name})),u({kind:"list"})}},c.workspaceId??"new"):a.jsxs(bK,{section:"workspaces",onEnvironment:e,onProjects:t,actions:a.jsxs(a.Fragment,{children:[v?a.jsx("span",{className:`workspace-status${w?" is-error":""}`,role:w?"alert":"status","aria-live":"polite",children:v}):null,a.jsx(Jp,{"aria-label":n("workspace.searchWorkspaces"),value:d,onChange:A=>f(A.target.value),placeholder:n("workspace.searchWorkspaces")})]}),children:[a.jsx(em,{"aria-live":"polite",children:h?a.jsx(cl,{}):g?a.jsxs("div",{className:"workspace-load-error",role:"alert",children:[a.jsx("p",{children:g}),a.jsx(_t,{color:"secondary",variant:"soft",size:"sm",onClick:()=>C(A=>A+1),children:n("common.reload")})]}):T.length===0&&d.trim()?a.jsx("div",{className:"workspace-empty",children:a.jsxs(Wn,{fill:"none",children:[a.jsx(Wn.Icon,{children:a.jsx(HZt,{})}),a.jsx(Wn.Title,{children:n("workspace.noMatchingWorkspaces")}),a.jsx(Wn.Description,{children:n("workspace.tryAnotherNameOrEnvironment")})]})}):a.jsxs(K0,{children:[d.trim()?null:a.jsx(cb,{"aria-label":n("workspace.create"),icon:a.jsx(VZt,{}),onClick:()=>u({kind:"detail",workspaceId:null}),children:n("workspace.create")}),T.map(A=>{const N=qZt(A,j),D=A.environmentIds.filter(I=>!j.has(I)).length;return a.jsx(X0,{className:"workspace-card",title:A.name,status:a.jsx(Ya,{color:D?"danger":N===A.environmentIds.length&&N>0?"success":"secondary",size:"sm",children:A.environmentIds.length===0?n("workspace.noEnvironmentAdded"):D?n("workspace.environmentMissing"):n("workspace.availableFraction",{available:N,total:A.environmentIds.length})}),description:A.description||n("common.noDescription"),metadata:[{label:n("common.environment"),value:n("workspace.environmentCount",{count:A.environmentIds.length})},{label:n("workspace.available"),value:n("workspace.availableCount",{count:N})},{label:n("workspace.updated"),value:J7(A.updatedAt,i.resolvedLanguage??i.language)}],detailAction:{label:n("common.manage"),onClick:()=>u({kind:"detail",workspaceId:A.id})},action:{label:n("workspace.addEnvironment"),icon:"plus",onClick:()=>u({kind:"detail",workspaceId:A.id})}},A.id)})]})}),O?a.jsx(Td,{title:n("workspace.deleteTitle"),description:n("workspace.deleteDescription",{name:O.name}),confirmLabel:n("common.delete"),variant:"danger",onCancel:()=>k(null),onConfirm:()=>{const A=O;k(null),zTe(A.id).then(()=>{s(N=>N.filter(D=>D.id!==A.id)),x(!1),y(n("workspace.deleted",{name:A.name})),u({kind:"list"})}).catch(N=>{x(!0),y(N instanceof Error?N.message:String(N))})}}):null]})}function GZt({cloudProvider:e,onProjects:t,initialSection:n="workspaces"}){const[i,r]=p.useState(n),{t:s}=Te("ui"),[o,l]=p.useState(null),[c,u]=p.useState(""),d=p.useRef(0),f=()=>{var g;d.current+=1;const h=d.current;u("");let m=null;if(typeof navigator<"u"&&((g=navigator.clipboard)!=null&&g.readText))try{m=navigator.clipboard.readText()}catch{u(s("workspace.clipboardPermissionError"))}else u(s("workspace.clipboardUnsupported"));r("environments"),m&&m.then(async b=>{var v;if(d.current===h){if(b.trim()){l({key:h,text:b});return}try{const y=await((v=navigator.permissions)==null?void 0:v.query({name:"clipboard-read"}));d.current===h&&(y==null?void 0:y.state)==="denied"&&u(s("workspace.clipboardPermissionError"))}catch{}}}).catch(()=>{d.current===h&&u(s("workspace.clipboardPermissionError"))})};return i==="environments"?a.jsx(N9e,{cloudProvider:e,onWorkspace:()=>r("workspaces"),onProjects:t,clipboardImport:o,clipboardReadError:c}):a.jsx(KZt,{onEnvironment:f,onProjects:t})}const XZt={id:"mpa-channels",kind:"mpa-channels",category:"channels",icon:"mpa-channels",name:"MPA agent messaging channels",description:"Connect an existing MPA agent to Feishu, WeCom and DingTalk."};function YZt(e){return e==="127.0.0.1"}const ZZt={id:"coding-agents",kind:"coding-agent",category:"development",icon:"coding-agents",name:"Configure coding agents",badge:"Local",badgeTone:"success",description:"Install built-in VeADK and AgentKit skills globally for Trae, Claude Code, or Codex."},JZt={id:"feishu",kind:"feishu",category:"channels",icon:"feishu",name:"Feishu bot",badge:"Beta",description:"Create a Feishu bot and connect its messages directly to AgentKit Runtime."},eJt={id:"gitlab-review",kind:"gitlab",category:"development",icon:"gitlab",name:"GitLab MR review",description:"Use a GitLab integration to review merge requests in an isolated Sandbox."};bn.hasResourceBundle("en-US","automations")||bn.addResourceBundle("en-US","automations",wfe,!0,!0);bn.hasResourceBundle("zh-CN","automations")||bn.addResourceBundle("zh-CN","automations",A0e,!0,!0);function Ah(e,t={}){return bn.t(e,{...t,ns:"automations"})}const R9e={name:"repository",label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL",required:!0},I9e={name:"baseBranch",label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base",required:!1},P9e={name:"runtimeName",label:"Runtime name",placeholder:"support-agent",help:"Used by the AgentKit delivery configuration",required:!0},D9e={name:"runtimeId",label:"Runtime ID",placeholder:"rt-xxxxxxxx",help:"The AgentKit Runtime that will receive continuous updates",required:!0},tJt="https://ark.cn-beijing.volces.com/api/coding/v3";function nJt(e){return e==="byteplus"?Po(e):tJt}function wK(e){return e==="byteplus"?{accessKey:"BYTEPLUS_ACCESS_KEY",secretKey:"BYTEPLUS_SECRET_KEY",sessionToken:"BYTEPLUS_SESSION_TOKEN"}:{accessKey:"VOLCENGINE_ACCESS_KEY",secretKey:"VOLCENGINE_SECRET_KEY",sessionToken:"VOLCENGINE_SESSION_TOKEN"}}function M9e(e){const t=wK(e);return[Ah("github.secretPair",{accessKey:t.accessKey,secretKey:t.secretKey}),Ah("github.sessionToken",{sessionToken:t.sessionToken})]}function OK(e){return e==="byteplus"?"BytePlus":"Volcengine"}function kK(e,t={}){return{repository:"",baseBranch:"main",projectPath:".",runtimeName:"",runtimeId:"",modelName:"",modelBaseUrl:nJt(e),region:Zi(e),token:"",...t}}function L9e(e){return{repository:e.repository.trim(),baseBranch:e.baseBranch.trim()||"main",region:e.region,token:e.token.trim()}}const iJt={id:"review",kind:"github",category:"development",icon:"github",name:"Automated PR review",description:"Use a GitHub App to review pull requests in an isolated Sandbox.",title:"Automated PR review",subtitle:"Trigger Sandbox reviews through the GitHub App and publish results to pull requests",panel:"Install the GitHub App to target repositories, then enable automated review for each repository.",submitLabel:"Install GitHub App",fields:[],initialValues:({cloudProvider:e})=>kK(e),regionHelp:"",secrets:()=>[],async submit(){throw new Error("PR 自动评审已切换为 GitHub App 授权模式。")}},rJt="https://api.github.com",sJt=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,ile=/^[A-Za-z0-9][A-Za-z0-9._/-]{0,199}$/,aJt=/^[A-Za-z0-9._/-]+$/;function oJt(e,t,n){const i=String((t==null?void 0:t.message)||"");return e===403&&/workflow/i.test(i)?"GitHub Token 缺少 Workflows 写权限,无法创建或更新 .github/workflows 下的文件":e===401||e===403?Q("github.invalidToken"):e===404?Q("github.notFound"):e===422?Q("github.rejectedCommit"):i.split(n).join("***").trim().slice(0,240)||Q("github.requestFailed",{status:e})}async function ry(e,t){const n={Accept:"application/vnd.github+json",Authorization:`Bearer ${t.token}`,"X-GitHub-Api-Version":"2022-11-28"};t.body&&(n["Content-Type"]="application/json");let i;try{i=await fetch(`${rJt}${e}`,{method:t.method||"GET",headers:n,body:t.body?JSON.stringify(t.body):void 0,signal:t.signal})}catch(s){throw t.signal.aborted?s:new Error(Q("github.networkFailed"))}const r=await i.json().catch(()=>null);if(!t.expected.includes(i.status))throw new Error(oJt(i.status,r,t.token));return{status:i.status,payload:r}}function v6(e){return e.split("/").map(encodeURIComponent).join("/")}function lJt(e){const t=new TextEncoder().encode(e);let n="";const i=32768;for(let r=0;r({...h,path:EK(h.path,"")})),s=AbortSignal.any([t,AbortSignal.timeout(6e4)]),o=`/repos/${n}`;await ry(`${o}`,{token:e.token,expected:[200],signal:s});const c=(f=(await ry(`${o}/git/ref/heads/${v6(i)}`,{token:e.token,expected:[200],signal:s})).payload.object)==null?void 0:f.sha;if(!c)throw new Error(Q("github.missingBaseSha"));const u=cJt(e.branchPrefix);await ry(`${o}/git/refs`,{token:e.token,expected:[201],signal:s,method:"POST",body:{ref:`refs/heads/${u}`,sha:c}});let d=!0;try{for(const m of r){const g=v6(m.path),b=await ry(`${o}/contents/${g}?ref=${encodeURIComponent(i)}`,{token:e.token,expected:[200,404],signal:s});if(m.mustBeNew&&b.status===200)throw new Error(Q("github.fileAlreadyExists",{path:m.path}));if(b.status===200&&!b.payload.sha)throw new Error(Q("github.pathNotUpdatable",{path:m.path}));await ry(`${o}/contents/${g}`,{token:e.token,expected:[200,201],signal:s,method:"PUT",body:{message:m.commitMessage,content:lJt(m.content),branch:u,...b.payload.sha?{sha:b.payload.sha}:{}}})}const h=await ry(`${o}/pulls`,{token:e.token,expected:[201],signal:s,method:"POST",body:{title:e.title,head:u,base:i,body:e.description}});if(!h.payload.number||!h.payload.html_url)throw new Error(Q("github.invalidPullRequest"));return d=!1,{number:h.payload.number,url:h.payload.html_url,branch:u}}finally{d&&await ry(`${o}/git/refs/heads/${v6(u)}`,{token:e.token,expected:[204],signal:AbortSignal.timeout(15e3),method:"DELETE"}).catch(()=>{})}}async function uJt(e,t){const n=await yn("/web/github/pull-request-reviews",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e),signal:t});if(!n.ok)throw await KT(n);const i=await n.json();if(i.status!=="started"||typeof i.sessionId!="string"||!i.sessionId||typeof i.displayName!="string")throw new Error("PR 评审服务返回了无效结果。");return i}async function dJt(e){const t=await yn("/web/github/app/config",{method:"GET",headers:{Accept:"application/json"},signal:e});if(!t.ok)throw await KT(t);const n=await t.json();if(typeof n.configured!="boolean"||typeof n.appSlug!="string"||typeof n.installUrl!="string"||typeof n.reason!="string")throw new Error("GitHub App 配置响应格式无效。");return n}async function fJt(e,t){var s;const n=new URLSearchParams({page:String(t.page),pageSize:String(t.pageSize)});(s=t.query)!=null&&s.trim()&&n.set("q",t.query.trim());const i=await yn(`/web/github/app/repositories?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await KT(i);const r=await i.json();if(!Array.isArray(r.repositories)||typeof r.page!="number"||typeof r.pageSize!="number"||typeof r.hasNextPage!="boolean"||typeof r.reviewSettingsConfigured!="boolean"||typeof r.reviewSettingsReason!="string"||r.repositories.some(o=>typeof o!="object"||o===null||typeof o.installationId!="number"||typeof o.account!="string"||typeof o.fullName!="string"||typeof o.htmlUrl!="string"||typeof o.private!="boolean"||typeof o.reviewEnabled!="boolean"))throw new Error("GitHub App 仓库列表响应格式无效。");return r}async function hJt(e,t){const n=new URLSearchParams({page:String(t.page),pageSize:String(t.pageSize)}),i=await yn(`/web/github/app/review-records?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await KT(i);const r=await i.json();if(!Array.isArray(r.records)||typeof r.page!="number"||typeof r.pageSize!="number"||typeof r.hasNextPage!="boolean"||typeof r.reviewSettingsConfigured!="boolean"||typeof r.reviewSettingsReason!="string"||r.records.some(s=>typeof s!="object"||s===null||typeof s.id!="string"||typeof s.repository!="string"||typeof s.pullRequestUrl!="string"||typeof s.pullRequestNumber!="number"||!["started","completed","ignored","failed"].includes(String(s.status))||!["manual","webhook"].includes(String(s.trigger))||typeof s.createdAt!="string"||typeof s.deliveryId!="string"||typeof s.action!="string"||typeof s.sessionId!="string"||typeof s.displayName!="string"||typeof s.reason!="string"))throw new Error("PR 评审记录响应格式无效。");return r}async function pJt(e,t){const n=await yn("/web/github/app/review-repositories",{method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e),signal:t});if(!n.ok)throw await KT(n);const i=await n.json();if(!Array.isArray(i.repositories)||i.repositories.some(r=>typeof r!="string"))throw new Error("GitHub App 评审仓库保存响应格式无效。");return i.repositories}async function KT(e){const t=await e.text().catch(()=>"");try{const n=JSON.parse(t),i=typeof n.detail=="object"&&n.detail?n.detail.message:n.detail??n.message??n.error,r=typeof i=="string"?i:"";return new Error(r||`PR 评审发起失败(HTTP ${e.status})`)}catch{return new Error(t||`PR 评审发起失败(HTTP ${e.status})`)}}const mJt=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/,gJt="cn-hongkong";function bJt(e){const t=lv(e.runtimeName,n=>Ah(`github.validation.runtimeName.${n}`));if(t)throw new Error(t);if(!mJt.test(e.runtimeId))throw new Error(Ah("github.validation.runtimeId"))}function F9e(e){bJt(e);const t=e.cloudProvider??"volcengine",n=wK(t),i=t==="byteplus"?` VOLCENGINE_ACCESS_KEY: \${{ secrets.${n.accessKey} }} VOLCENGINE_SECRET_KEY: \${{ secrets.${n.secretKey} }} VOLCENGINE_SESSION_TOKEN: \${{ secrets.${n.sessionToken} }} BYTEPLUS_REGION: ${JSON.stringify(e.region)}`:"",r=t==="byteplus"?` - "DATABASE_VIKING_REGION": ${JSON.stringify(pJt)},`:"",s=`name: Publish to AgentKit Runtime + "DATABASE_VIKING_REGION": ${JSON.stringify(gJt)},`:"",s=`name: Publish to AgentKit Runtime on: push: @@ -969,8 +969,8 @@ jobs: if not result.success: raise SystemExit(f"AgentKit publish failed: {result.error}") PY -`,o={__BASE_BRANCH__:JSON.stringify(e.baseBranch),__PROJECT_PATH__:JSON.stringify(e.projectPath),__RUNTIME_NAME__:JSON.stringify(e.runtimeName),__RUNTIME_ID__:JSON.stringify(e.runtimeId),__REGION__:JSON.stringify(e.region),__CLOUD_PROVIDER__:JSON.stringify(t),__ACCESS_KEY_SECRET__:n.accessKey,__SECRET_KEY_SECRET__:n.secretKey,__SESSION_TOKEN_SECRET__:n.sessionToken,__BYTEPLUS_ENV__:i,__BYTEPLUS_RUNTIME_ENV__:r,__CONCURRENCY_GROUP__:JSON.stringify(`agentkit-runtime-${e.runtimeId}`)};return Object.entries(o).reduce((l,[c,u])=>l.split(c).join(u),s)}const gJt={id:"delivery",kind:"github",category:"development",icon:"github",name:"AgentKit Runtime delivery",description:"Add a workflow that continuously delivers your repository to AgentKit Runtime.",title:"AgentKit Runtime delivery",subtitle:"Add continuous delivery to the repository through a pull request",panel:"This creates a release branch and opens a pull request containing the GitHub Actions workflow.",submitLabel:"Confirm and create PR",fields:[N9e,R9e,{name:"projectPath",label:"Agent project directory",placeholder:".",help:"Defaults to the repository root; the directory must contain an app.py that mounts the complete Studio App Server",required:!1},I9e,P9e],initialValues:({cloudProvider:e})=>OK(e),regionHelp:"Must match the target Runtime region",secrets:({cloudProvider:e})=>D9e(e),submit(e,t,n){const i=M9e(e),r=SK(e.projectPath,"."),s=wK(t.cloudProvider);return L9e({...i,files:[{path:".github/workflows/publish-agentkit.yml",content:$9e({baseBranch:i.baseBranch,projectPath:r,runtimeName:e.runtimeName.trim(),runtimeId:e.runtimeId.trim(),region:i.region,cloudProvider:t.cloudProvider}),commitMessage:"feat: publish Agent to AgentKit Runtime"}],branchPrefix:"feat/agentkit-release",title:Ch("cards.delivery.pullRequest.title"),description:Ch("cards.delivery.pullRequest.description",{provider:s})},n)}};function bJt(e,t){return e==="."?t:`${e}/${t}`}function yJt(e){return`.github/workflows/publish-agentkit-${e.replace(/[^A-Za-z0-9]+/g,"-").replace(/^-|-$/g,"").toLowerCase()||"root"}.yml`}const vJt={volcengine:"agentkit-prod-public-cn-beijing.cr.volces.com/base/py-simple:python3.12-bookworm-slim-latest",byteplus:"agentkit-prod-public-ap-southeast-1.cr.bytepluses.com/base/py-simple:python3.12-bookworm-slim-latest"},xJt="1.1.13",wJt=["https://mirrors.cloud.tencent.com/pypi/simple","https://pypi.mirrors.ustc.edu.cn/simple","https://pypi.org/simple"];function OJt(e){return e!=="volcengine"?"RUN uv pip install -r requirements.txt":`RUN ${wJt.map(n=>`uv pip install --index-url ${n} -r requirements.txt`).join(` || \\ - `)}`}function kJt(e){const t=xK(e);return`# Local ${wK(e)} credentials. Never commit real values. +`,o={__BASE_BRANCH__:JSON.stringify(e.baseBranch),__PROJECT_PATH__:JSON.stringify(e.projectPath),__RUNTIME_NAME__:JSON.stringify(e.runtimeName),__RUNTIME_ID__:JSON.stringify(e.runtimeId),__REGION__:JSON.stringify(e.region),__CLOUD_PROVIDER__:JSON.stringify(t),__ACCESS_KEY_SECRET__:n.accessKey,__SECRET_KEY_SECRET__:n.secretKey,__SESSION_TOKEN_SECRET__:n.sessionToken,__BYTEPLUS_ENV__:i,__BYTEPLUS_RUNTIME_ENV__:r,__CONCURRENCY_GROUP__:JSON.stringify(`agentkit-runtime-${e.runtimeId}`)};return Object.entries(o).reduce((l,[c,u])=>l.split(c).join(u),s)}const yJt={id:"delivery",kind:"github",category:"development",icon:"github",name:"AgentKit Runtime delivery",description:"Add a workflow that continuously delivers your repository to AgentKit Runtime.",title:"AgentKit Runtime delivery",subtitle:"Add continuous delivery to the repository through a pull request",panel:"This creates a release branch and opens a pull request containing the GitHub Actions workflow.",submitLabel:"Confirm and create PR",fields:[R9e,I9e,{name:"projectPath",label:"Agent project directory",placeholder:".",help:"Defaults to the repository root; the directory must contain an app.py that mounts the complete Studio App Server",required:!1},P9e,D9e],initialValues:({cloudProvider:e})=>kK(e),regionHelp:"Must match the target Runtime region",secrets:({cloudProvider:e})=>M9e(e),submit(e,t,n){const i=L9e(e),r=EK(e.projectPath,"."),s=OK(t.cloudProvider);return $9e({...i,files:[{path:".github/workflows/publish-agentkit.yml",content:F9e({baseBranch:i.baseBranch,projectPath:r,runtimeName:e.runtimeName.trim(),runtimeId:e.runtimeId.trim(),region:i.region,cloudProvider:t.cloudProvider}),commitMessage:"feat: publish Agent to AgentKit Runtime"}],branchPrefix:"feat/agentkit-release",title:Ah("cards.delivery.pullRequest.title"),description:Ah("cards.delivery.pullRequest.description",{provider:s})},n)}};function vJt(e,t){return e==="."?t:`${e}/${t}`}function xJt(e){return`.github/workflows/publish-agentkit-${e.replace(/[^A-Za-z0-9]+/g,"-").replace(/^-|-$/g,"").toLowerCase()||"root"}.yml`}const wJt={volcengine:"agentkit-prod-public-cn-beijing.cr.volces.com/base/py-simple:python3.12-bookworm-slim-latest",byteplus:"agentkit-prod-public-ap-southeast-1.cr.bytepluses.com/base/py-simple:python3.12-bookworm-slim-latest"},OJt="1.1.13",kJt=["https://mirrors.cloud.tencent.com/pypi/simple","https://pypi.mirrors.ustc.edu.cn/simple","https://pypi.org/simple"];function SJt(e){return e!=="volcengine"?"RUN uv pip install -r requirements.txt":`RUN ${kJt.map(n=>`uv pip install --index-url ${n} -r requirements.txt`).join(` || \\ + `)}`}function EJt(e){const t=wK(e);return`# Local ${OK(e)} credentials. Never commit real values. ${t.accessKey}= ${t.secretKey}= # ${t.sessionToken}= @@ -980,14 +980,14 @@ AGENTKIT_CLOUD_PROVIDER=${e} # Optional model overrides. # MODEL_AGENT_PROVIDER=openai -# MODEL_AGENT_NAME=${Kp(e)} +# MODEL_AGENT_NAME=${Gp(e)} # MODEL_AGENT_API_BASE=${Po(e)} # MODEL_AGENT_API_KEY= # Optional Feishu Channel credentials. Studio can create and bind these. FEISHU_APP_ID= FEISHU_APP_SECRET= -`}function SJt(e,t="volcengine"){const n={"app.py":`"""__PROJECT_NAME__ — a VeADK agent with the full Studio App Server.""" +`}function CJt(e,t="volcengine"){const n={"app.py":`"""__PROJECT_NAME__ — a VeADK agent with the full Studio App Server.""" from assistant import root_agent from veadk.integrations.agentkit import create_agentkit_app, run_agentkit_app @@ -1031,19 +1031,19 @@ root_agent = Agent( instruction="You are a helpful assistant. Use your tools when relevant.", tools=[get_city_weather], ) -`,"requirements.txt":`veadk-python==${xJt} +`,"requirements.txt":`veadk-python==${OJt} agentkit-sdk-python==0.8.4 google-adk==2.1.0 lark-channel-sdk==1.2.0 lark-oapi==1.7.3 starlette==0.52.1 -`,Dockerfile:`FROM ${vJt[t]} +`,Dockerfile:`FROM ${wJt[t]} ENV UV_SYSTEM_PYTHON=1 UV_COMPILE_BYTECODE=1 PYTHONUNBUFFERED=1 WORKDIR /app COPY requirements.txt ./ -${OJt(t)} +${SJt(t)} COPY . . @@ -1068,7 +1068,7 @@ and local short-term memory fallback. Pushes to the configured target branch are continuously published by the GitHub Actions workflow added with this project. -`,".env.example":kJt(t),".gitignore":`__pycache__/ +`,".env.example":EJt(t),".gitignore":`__pycache__/ *.pyc .venv/ .env @@ -1082,34 +1082,34 @@ __pycache__/ Dockerfile .dockerignore README.md -`};return Object.fromEntries(Object.entries(n).map(([i,r])=>[i,r.split("__PROJECT_NAME__").join(e)]))}const EJt={id:"template",kind:"github",category:"development",icon:"github",name:"Import starter project",description:"Create a minimal Agent project in your repository with continuous delivery to AgentKit Runtime.",title:"Import starter project",subtitle:"Add a ready-to-run basic Agent and continuous delivery configuration to your repository",panel:"This creates a pull request containing the basic project and AgentKit Runtime delivery workflow.",submitLabel:"Import template and create PR",fields:[N9e,R9e,{name:"projectPath",label:"Agent project directory",placeholder:"agentkit-basic-agent",help:"The basic project will be added here; app.py mounts the complete Studio App Server and serves as the entry point",required:!0},I9e,P9e],initialValues:({cloudProvider:e})=>OK(e,{projectPath:"agentkit-basic-agent"}),regionHelp:"Must match the target Runtime region",secrets:({cloudProvider:e})=>D9e(e),submit(e,t,n){const i=M9e(e),r=kK(i.repository),s=SK(e.projectPath,"agentkit-basic-agent"),o=s==="."?r.split("/").slice(-1)[0]||"agentkit-basic-agent":s.split("/").slice(-1)[0]||"agentkit-basic-agent",l=Object.entries(SJt(o,t.cloudProvider)).map(([c,u])=>({path:bJt(s,c),content:u,commitMessage:"feat: import AgentKit basic template",mustBeNew:!0}));return l.push({path:yJt(s),content:$9e({baseBranch:i.baseBranch,projectPath:s,runtimeName:e.runtimeName.trim(),runtimeId:e.runtimeId.trim(),region:i.region,cloudProvider:t.cloudProvider}),commitMessage:"feat: add AgentKit Runtime delivery",mustBeNew:!0}),L9e({...i,repository:r,files:l,branchPrefix:"feat/agentkit-basic-template",title:Ch("cards.template.pullRequest.title"),description:Ch("cards.template.pullRequest.description",{provider:wK(t.cloudProvider)})},n)}},CJt={id:"website-integration",kind:"website-integration",category:"channels",icon:"website-integration",name:"Website integration",description:"Embed an AgentKit Runtime on your website as a floating chat window."},rle=[{id:"development",label:"Development"},{id:"channels",label:"Messaging channels"}],F9e=[XZt,EJt,gJt,tJt,ZZt,YZt,KZt,CJt],AJt=new Map(F9e.map(e=>[e.id,e]));function TJt(e){const t=AJt.get(e);if(!t)throw new Error(`Unknown automation: ${e}`);return t}function _Jt(e){const t=TJt(e);if(t.kind!=="github")throw new Error(`Automation is not backed by GitHub: ${e}`);return t}function B9e(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"8",y:"3",width:"8",height:"6",rx:"2"}),a.jsx("path",{d:"M12 9v4M5 16v-1a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v1M12 13v3"}),a.jsx("rect",{x:"2",y:"16",width:"6",height:"5",rx:"1.5"}),a.jsx("rect",{x:"9",y:"16",width:"6",height:"5",rx:"1.5"}),a.jsx("rect",{x:"16",y:"16",width:"6",height:"5",rx:"1.5"})]})}function sle(e){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:[a.jsx("circle",{cx:"10.8",cy:"10.8",r:"6.2",stroke:"currentColor",strokeWidth:"1.7"}),a.jsx("path",{d:"m15.4 15.4 4 4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function jJt(e){return a.jsxs("svg",{viewBox:"0 0 36 36",fill:"none","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"5",width:"18",height:"18",rx:"5",fill:"currentColor",opacity:"0.1"}),a.jsx("rect",{x:"3.5",y:"5",width:"18",height:"18",rx:"5",stroke:"currentColor",strokeWidth:"1.6"}),a.jsx("path",{d:"m9.2 11.2-2.8 2.7 2.8 2.7M12.1 17.4h4.3",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),a.jsx("circle",{cx:"26.5",cy:"12",r:"3",fill:"hsl(var(--background))",stroke:"currentColor",strokeWidth:"1.6"}),a.jsx("circle",{cx:"27",cy:"26.5",r:"3",fill:"hsl(var(--background))",stroke:"currentColor",strokeWidth:"1.6"}),a.jsx("path",{d:"M21.5 12h2M19.3 21l5.6 3.8M27 15v8.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}function NJt(e){return a.jsxs("svg",{viewBox:"0 0 36 36",fill:"none","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"5",width:"22",height:"18",rx:"4",stroke:"currentColor",strokeWidth:"1.6"}),a.jsx("path",{d:"M4.5 10h20M9 7.5h.1M12 7.5h.1",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),a.jsx("path",{d:"M18 18.5c0-3 2.5-5.5 5.5-5.5h3c3 0 5.5 2.5 5.5 5.5v5c0 3-2.5 5.5-5.5 5.5H25l-4 3v-3.6a5.5 5.5 0 0 1-3-4.9v-5Z",fill:"hsl(var(--background))",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),a.jsx("path",{d:"M22 19.5h6M22 23h4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}function RJt(e){return a.jsxs("svg",{viewBox:"0 0 36 36",fill:"none","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M18 31 5.5 21.8 8.7 6.5 14 17.1h8L27.3 6.5l3.2 15.3L18 31Z",fill:"currentColor",opacity:"0.12"}),a.jsx("path",{d:"M18 31 5.5 21.8 8.7 6.5 14 17.1h8L27.3 6.5l3.2 15.3L18 31Z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),a.jsx("path",{d:"m14 17.1 4 13.9 4-13.9M5.5 21.8h25",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"})]})}function IJt({onOpen:e,initialCategory:t="development",onCategoryChange:n}){var h;const{t:i}=Te("automations"),[r,s]=p.useState(t),[o,l]=p.useState(""),c=p.useDeferredValue(o),u=p.useMemo(()=>{const m=c.trim().toLocaleLowerCase();return F9e.filter(g=>g.category===r).filter(g=>!m||`${i(`cards.${g.id}.name`)} ${i(`cards.${g.id}.description`)}`.toLocaleLowerCase().includes(m))},[r,c,i]),d=(h=rle.find(m=>m.id===r))==null?void 0:h.id,f=GZt(window.location.hostname);return a.jsxs("div",{className:"applications-page",children:[a.jsxs("header",{className:"applications-header",children:[a.jsxs("div",{children:[a.jsx("h1",{children:i("title")}),a.jsx("p",{children:i("description")})]}),a.jsxs("label",{className:"applications-search",children:[a.jsx(sle,{}),a.jsx("input",{type:"search","aria-label":i("search"),value:o,onChange:m=>l(m.target.value),placeholder:i("search")})]})]}),a.jsx("nav",{className:"applications-categories","aria-label":i("categoriesLabel"),children:rle.map(m=>a.jsx("button",{type:"button",className:r===m.id?"is-active":"","aria-pressed":r===m.id,onClick:()=>{s(m.id),n==null||n(m.id)},children:i(`categories.${m.id}`)},m.id))}),a.jsx("section",{className:"applications-results","aria-label":i("resultsLabel",{category:i(`categories.${d}`)}),children:u.length?a.jsx("div",{className:"applications-grid",children:u.map(m=>{const g=m.id==="coding-agents"&&!f,b=g?"coding-agents-local-only-tooltip":void 0;return a.jsxs("div",{className:`application-card-wrap${g?" is-disabled":""}`,tabIndex:g?0:void 0,"aria-describedby":b,children:[a.jsxs("button",{type:"button",className:"application-card",onClick:()=>e(m.id),"aria-label":i("open",{name:i(`cards.${m.id}.name`)}),disabled:g,children:[m.icon==="feishu"?a.jsx("img",{className:"application-card-icon application-card-brand-icon",src:PL,alt:"","aria-hidden":"true"}):m.icon==="mpa-channels"?a.jsx(B9e,{className:"application-card-icon"}):m.icon==="coding-agents"?a.jsx(jJt,{className:"application-card-icon"}):m.icon==="website-integration"?a.jsx(NJt,{className:"application-card-icon"}):m.icon==="gitlab"?a.jsx(RJt,{className:"application-card-icon"}):a.jsx(bK,{className:"application-card-icon"}),a.jsxs("div",{className:"application-card-copy",children:[a.jsxs("div",{className:"application-card-title",children:[a.jsx("h2",{children:i(`cards.${m.id}.name`)}),m.badge?a.jsx("span",{className:`application-card-badge is-${m.badgeTone||"default"}`,children:i(`cards.${m.id}.badge`,{defaultValue:m.badge})}):null]}),a.jsx("p",{children:i(`cards.${m.id}.description`)})]})]}),g?a.jsx("span",{id:b,className:"application-card-tooltip",role:"tooltip",children:i("localOnly")}):null]},m.id)})}):a.jsxs("div",{className:"applications-empty",role:"status",children:[a.jsx(sle,{}),a.jsx("h2",{children:i("emptyTitle")}),a.jsx("p",{children:i("emptyDescription")})]})})]})}function Dh({open:e,keepMounted:t=!1,title:n,subtitle:i,icon:r,className:s="",busy:o=!1,initialFocusRef:l,onClose:c,children:u}){const{t:d}=Te("sandbox"),f=p.useId(),h=p.useRef(null),m=p.useRef(null),g=p.useRef(c);g.current=c;const b=p.useRef(o);return b.current=o,p.useEffect(()=>{var w;if(!e)return;m.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const v=document.body.style.overflow;document.body.style.overflow="hidden",(w=(l==null?void 0:l.current)??h.current)==null||w.focus();const y=x=>{var E;if(x.key==="Escape"){x.preventDefault(),b.current||g.current();return}if(x.key!=="Tab")return;const O=(E=h.current)==null?void 0:E.closest("[role=dialog]"),k=Array.from((O==null?void 0:O.querySelectorAll('button:not(:disabled), input:not(:disabled), iframe, [tabindex]:not([tabindex="-1"])'))??[]);if(k.length===0){x.preventDefault();return}const S=k[0],C=k[k.length-1];x.shiftKey&&document.activeElement===S?(x.preventDefault(),C.focus()):!x.shiftKey&&document.activeElement===C&&(x.preventDefault(),S.focus())};return window.addEventListener("keydown",y),()=>{var x;document.body.style.overflow=v,window.removeEventListener("keydown",y),(x=m.current)==null||x.focus()}},[e,l]),!e&&!t?null:yi.createPortal(a.jsx("div",{className:"sandbox-control-backdrop",hidden:!e,onMouseDown:v=>{v.target===v.currentTarget&&!o&&c()},children:a.jsxs("section",{className:`sandbox-control-dialog ${s}`.trim(),role:"dialog","aria-modal":"true","aria-labelledby":f,"aria-busy":o||void 0,children:[a.jsxs("header",{className:"sandbox-control-head",children:[a.jsx("span",{className:"sandbox-control-head-icon","aria-hidden":"true",children:r}),a.jsxs("div",{children:[a.jsx("h2",{id:f,children:n}),i?a.jsx("p",{children:i}):null]}),a.jsx("button",{ref:h,type:"button",className:"sandbox-control-close","aria-label":d("common.closeDialog",{title:n}),title:d("common.closeDialog",{title:n}),disabled:o,onClick:c,children:a.jsx($Ae,{})})]}),u]})}),document.body)}function PJt({open:e,kind:t,launch:n,loading:i,error:r,onReload:s,onClose:o}){const{t:l}=Te("sandbox"),c=t==="terminal",u=l(c?"tool.terminalTitle":"tool.browserTitle");return a.jsxs(Dh,{open:e,title:u,subtitle:l(c?"tool.terminalSubtitle":"tool.browserSubtitle"),icon:c?a.jsx(c0,{}):a.jsx(LAe,{}),className:`sandbox-tool-dialog sandbox-tool-dialog--${t}`,onClose:o,children:[a.jsx("div",{className:"sandbox-tool-toolbar",children:a.jsxs("span",{children:[a.jsx("i",{className:i?"is-loading":n?"is-ready":""}),l(i?"tool.connecting":n?"tool.connected":"tool.notConnected")]})}),a.jsx("div",{className:"sandbox-tool-surface",children:i?a.jsxs("div",{className:"sandbox-control-state",children:[a.jsx(Rc,{className:"spin"}),a.jsx("strong",{children:l("tool.opening",{title:u})}),a.jsx("span",{children:l("tool.connectingSession")})]}):r?a.jsxs("div",{className:"sandbox-control-state is-error",children:[a.jsx("strong",{children:l("tool.openFailed",{title:u})}),a.jsx("span",{children:r}),a.jsx("button",{type:"button",onClick:s,children:l("common.retry")})]}):n?a.jsx("iframe",{src:n.url,title:u,allow:"clipboard-read; clipboard-write",sandbox:"allow-downloads allow-forms allow-modals allow-popups allow-pointer-lock allow-same-origin allow-scripts"}):null})]})}function DJt({open:e,threads:t,currentThreadId:n,loading:i,error:r,onSelect:s,onClose:o}){const{t:l,i18n:c}=Te("sandbox");return a.jsx(Dh,{open:e,title:l("threads.title"),subtitle:l("threads.subtitle"),icon:a.jsx(tet,{}),className:"sandbox-threads-dialog",onClose:o,children:a.jsx("div",{className:"sandbox-thread-list",children:i?a.jsxs("div",{className:"sandbox-control-state",children:[a.jsx(Rc,{className:"spin"}),a.jsx("strong",{children:l("threads.loading")})]}):r?a.jsxs("div",{className:"sandbox-control-state is-error",children:[a.jsx("strong",{children:l("threads.loadFailed")}),a.jsx("span",{children:r})]}):t.length===0?a.jsx("div",{className:"sandbox-control-state",children:a.jsx("strong",{children:l("threads.empty")})}):t.map(u=>{const d=u.id===n,f=u.name||u.preview||`Thread ${u.id.slice(0,8)}`;return a.jsxs("button",{type:"button",className:d?"is-active":"",disabled:d,onClick:()=>s(u.id),children:[a.jsxs("span",{children:[a.jsx("strong",{children:f}),a.jsx("small",{children:u.preview||u.cwd||u.id})]}),a.jsx("time",{children:u.updatedAt?new Date(u.updatedAt*1e3).toLocaleString(c.resolvedLanguage??c.language):""}),a.jsx(_8,{})]},u.id)})})})}const MJt=[{value:"read-only",labelKey:"permissions.sandboxChoices.readOnly.label",detailKey:"permissions.sandboxChoices.readOnly.detail"},{value:"workspace-write",labelKey:"permissions.sandboxChoices.workspaceWrite.label",detailKey:"permissions.sandboxChoices.workspaceWrite.detail"},{value:"danger-full-access",labelKey:"permissions.sandboxChoices.fullAccess.label",detailKey:"permissions.sandboxChoices.fullAccess.detail",danger:!0}],LJt=[{value:"untrusted",labelKey:"permissions.approvalChoices.untrusted.label",detailKey:"permissions.approvalChoices.untrusted.detail"},{value:"on-request",labelKey:"permissions.approvalChoices.onRequest.label",detailKey:"permissions.approvalChoices.onRequest.detail"},{value:"never",labelKey:"permissions.approvalChoices.never.label",detailKey:"permissions.approvalChoices.never.detail",danger:!0}],$Jt=[{value:"user",labelKey:"permissions.reviewerChoices.user.label",detailKey:"permissions.reviewerChoices.user.detail"},{value:"auto_review",labelKey:"permissions.reviewerChoices.autoReview.label",detailKey:"permissions.reviewerChoices.autoReview.detail"}];function FJt({open:e,value:t,busy:n,error:i,onSave:r,onClose:s}){const{t:o}=Te("sandbox"),[l,c]=p.useState(t);return p.useEffect(()=>{e&&c(t)},[e,t]),a.jsxs(Dh,{open:e,title:o("permissions.title"),subtitle:o("permissions.subtitle"),icon:a.jsx(hz,{}),className:"sandbox-settings-dialog",onClose:s,children:[a.jsxs("div",{className:"sandbox-control-body",children:[a.jsx(v6,{label:o("permissions.sandboxMode"),choices:MJt.map(u=>({...u,label:o(u.labelKey),detail:o(u.detailKey)})),value:l.sandboxMode,disabled:n,onChange:u=>c(d=>({...d,sandboxMode:u,networkAccess:u==="danger-full-access"?!0:d.networkAccess}))}),a.jsx(v6,{label:o("permissions.approvalPolicy"),choices:LJt.map(u=>({...u,label:o(u.labelKey),detail:o(u.detailKey)})),value:l.approvalPolicy,disabled:n,onChange:u=>c(d=>({...d,approvalPolicy:u}))}),a.jsx(v6,{label:o("permissions.approvalMethod"),choices:$Jt.map(u=>({...u,label:o(u.labelKey),detail:o(u.detailKey)})),value:l.approvalsReviewer,disabled:n,onChange:u=>c(d=>({...d,approvalsReviewer:u}))}),a.jsxs("label",{className:`sandbox-network-toggle${l.sandboxMode==="danger-full-access"?" is-disabled":""}`,children:[a.jsxs("span",{children:[a.jsx("strong",{children:o("permissions.networkAccess")}),a.jsx("small",{children:o("permissions.networkAccessHelp")})]}),a.jsx("input",{type:"checkbox",checked:l.networkAccess,disabled:n||l.sandboxMode==="danger-full-access",onChange:u=>c(d=>({...d,networkAccess:u.target.checked}))})]}),l.sandboxMode==="danger-full-access"?a.jsx("div",{className:"sandbox-control-note is-danger",children:o("permissions.fullAccessWarning")}):null,i?a.jsx("div",{className:"sandbox-control-error",children:i}):null]}),a.jsxs("footer",{className:"sandbox-control-actions",children:[a.jsx("button",{type:"button",onClick:s,disabled:n,children:o("common.cancel")}),a.jsxs("button",{type:"button",className:"is-primary",disabled:n,onClick:()=>r(l),children:[n?a.jsx(Rc,{className:"spin"}):null,o("permissions.save")]})]})]})}function v6({label:e,choices:t,value:n,disabled:i,onChange:r}){return a.jsxs("fieldset",{className:"sandbox-choice-group",disabled:i,role:"radiogroup","aria-label":e,children:[a.jsx("legend",{children:e}),a.jsx("div",{className:"sandbox-choice-list",children:t.map(s=>a.jsxs("button",{type:"button",role:"radio",className:`${n===s.value?"is-active":""}${s.danger?" is-danger":""}`.trim(),"aria-checked":n===s.value,onClick:()=>r(s.value),onKeyDown:o=>{var d,f;const l=t.findIndex(h=>h.value===s.value);let c=l;if(o.key==="ArrowRight"||o.key==="ArrowDown")c=(l+1)%t.length;else if(o.key==="ArrowLeft"||o.key==="ArrowUp")c=(l-1+t.length)%t.length;else if(o.key==="Home")c=0;else if(o.key==="End")c=t.length-1;else return;o.preventDefault(),r(t[c].value);const u=(d=o.currentTarget.parentElement)==null?void 0:d.querySelectorAll('[role="radio"]');(f=u==null?void 0:u[c])==null||f.focus()},children:[a.jsx("i",{}),a.jsxs("span",{children:[a.jsx("strong",{children:s.label}),a.jsx("small",{children:s.detail})]})]},s.value))})]})}function BJt({open:e,cwd:t,locked:n,busy:i,error:r,browse:s,onSave:o,onClose:l}){const{t:c}=Te("sandbox"),[u,d]=p.useState(t||"/"),[f,h]=p.useState(null),[m,g]=p.useState(!1),[b,v]=p.useState("");p.useEffect(()=>{if(!e)return;const w=t||"/";d(w),y(w)},[t,e]);async function y(w){g(!0),v("");try{const x=await s(w);h(x),d(x.path)}catch(x){v(x instanceof Error?x.message:String(x))}finally{g(!1)}}return a.jsxs(Dh,{open:e,title:c("workspace.title"),subtitle:c("workspace.subtitle"),icon:a.jsx(aN,{}),className:"sandbox-workspace-dialog",onClose:l,children:[a.jsxs("div",{className:"sandbox-control-body",children:[a.jsxs("label",{className:"sandbox-workspace-input",children:[a.jsx("span",{children:c("workspace.absolutePath")}),a.jsxs("div",{children:[a.jsx("input",{value:u,disabled:i||n,spellCheck:!1,onChange:w=>d(w.target.value),onKeyDown:w=>{w.key==="Enter"&&u.startsWith("/")&&(w.preventDefault(),y(u))}}),a.jsx("button",{type:"button",disabled:i||m||!u.startsWith("/"),onClick:()=>void y(u),children:c("workspace.browse")})]})]}),a.jsxs("div",{className:"sandbox-directory-browser",children:[a.jsxs("div",{className:"sandbox-directory-head",children:[a.jsx("span",{title:f==null?void 0:f.path,children:(f==null?void 0:f.path)??u}),m?a.jsx(Rc,{className:"spin"}):null]}),a.jsxs("div",{className:"sandbox-directory-list",children:[f!=null&&f.parent?a.jsxs("button",{type:"button",disabled:m,onClick:()=>void y(f.parent??"/"),children:[a.jsx(aN,{}),a.jsx("span",{children:c("workspace.parent")}),a.jsx("small",{children:f.parent}),a.jsx(_8,{})]}):null,f==null?void 0:f.directories.map(w=>a.jsxs("button",{type:"button",disabled:m,onClick:()=>void y(w.path),children:[a.jsx(aN,{}),a.jsx("span",{children:w.name}),a.jsx(_8,{})]},w.path)),!m&&(f==null?void 0:f.directories.length)===0?a.jsx("div",{className:"sandbox-directory-empty",children:c("workspace.empty")}):null]})]}),n?a.jsx("div",{className:"sandbox-control-note",children:c("workspace.locked")}):null,b||r?a.jsx("div",{className:"sandbox-control-error",children:b||r}):null]}),a.jsxs("footer",{className:"sandbox-control-actions",children:[a.jsx("button",{type:"button",onClick:l,disabled:i,children:c("common.cancel")}),a.jsxs("button",{type:"button",className:"is-primary",disabled:i||n||!u.startsWith("/"),onClick:()=>o(u),children:[i?a.jsx(Rc,{className:"spin"}):null,c("workspace.useDirectory")]})]})]})}function UJt({approval:e,busy:t,error:n,onDecision:i}){var l;const{t:r}=Te("sandbox"),s=(l=e==null?void 0:e.command)==null?void 0:l.trim(),o=(e==null?void 0:e.changes)===void 0?"":JSON.stringify(e.changes,null,2);return a.jsxs(Dh,{open:e!==null,title:(e==null?void 0:e.kind)==="file"?r("approval.fileTitle"):r("approval.commandTitle"),subtitle:r("approval.subtitle"),icon:a.jsx(hz,{}),className:"sandbox-approval-dialog",onClose:()=>{t||i("cancel")},children:[a.jsxs("div",{className:"sandbox-control-body",children:[e!=null&&e.reason?a.jsx("div",{className:"sandbox-approval-reason",children:e.reason}):null,s?a.jsx("pre",{children:s}):null,o?a.jsx("pre",{children:o}):null,e!=null&&e.cwd?a.jsxs("div",{className:"sandbox-approval-meta",children:[r("approval.workingDirectory")," ",a.jsx("code",{children:e.cwd})]}):null,n?a.jsx("div",{className:"sandbox-control-error",children:n}):null]}),a.jsxs("footer",{className:"sandbox-control-actions sandbox-approval-actions",children:[a.jsx("button",{type:"button",disabled:t,onClick:()=>i("decline"),children:r("approval.decline")}),a.jsx("button",{type:"button",disabled:t,onClick:()=>i("accept"),children:r("approval.acceptOnce")}),a.jsxs("button",{type:"button",className:"is-primary",disabled:t,onClick:()=>i("acceptForSession"),children:[t?a.jsx(Rc,{className:"spin"}):null,r("approval.acceptSession")]})]})]})}const QJt=["Once","Interval","Daily","Weekly","Monthly","Cron"],zJt=["Queued","Running","Succeeded","Failed","TimedOut","Cancelled","Skipped"];function Dk(e){return e.runningAt?"Running":e.lastRunStatus||"Pending"}function $P(e,t,n){return typeof e!="string"||!Number.isFinite(Date.parse(e))?"—":new Intl.DateTimeFormat(t,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",timeZone:n}).format(new Date(e))}function J7(e,t,n){const i=e.schedule,r=typeof i.timezone=="string"?i.timezone:"Asia/Shanghai",s=i.type,o=s==="Once"?$P(i.runAt,n,r):s==="Interval"?`${i.intervalSeconds} ${t("seconds")}`:s==="Cron"?String(i.cronExpression):`${i.time}${s==="Weekly"?` · ${String(i.weekdays)}`:s==="Monthly"?` · ${String(i.monthDays)}`:""}`;return`${t(s)} · ${o} (${r})`}function VJt(e){const t=new Date(e.getFullYear(),e.getMonth(),1);return t.setDate(t.getDate()-(t.getDay()+6)%7),Array.from({length:42},(n,i)=>new Date(t.getFullYear(),t.getMonth(),t.getDate()+i))}const eU=(e,t)=>Object.fromEntries(new Intl.DateTimeFormat("en-US",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).formatToParts(e).map(n=>[n.type,n.value]));function HJt(e,t,n,i,r,s){const o=Date.UTC(e,t-1,n,i,r),l=new Set;for(const c of[-864e5,0,864e5]){const u=o+c,d=eU(new Date(u),s),f=Date.UTC(+d.year,+d.month-1,+d.day,+d.hour,+d.minute)-u,h=o-f,m=eU(new Date(h),s);+m.year===e&&+m.month===t&&+m.day===n&&+m.hour===i&&+m.minute===r&&l.add(h)}return[...l]}function qJt(e,t){const n=t.getTime(),i=new Date(t.getFullYear(),t.getMonth(),t.getDate()+1).getTime(),r=e.schedule,s=String(r.timezone||"Asia/Shanghai"),o=Date.parse(e.createdAt||"")||-1/0,l=b=>b>=Math.max(n,o)&&b59||!/^\d+$/.test(b[1])||+b[1]>23||b[3]!=="*"||!/^(\*|\d+(,\d+)*)$/.test(b[2])||!/^(\*|\d+(,\d+)*)$/.test(b[4])||b[2]!=="*"&&b[4]!=="*"){const v=Date.parse(e.nextRunAt||"");return l(v)?{at:v,count:1,nextOnly:!0}:null}c=`${b[1]}:${b[0]}`,d=b[2]==="*"?void 0:b[2].split(",").map(Number),u=b[4]==="*"?void 0:b[4].split(",").map(v=>+v==0?7:+v)}const[f,h]=c.split(":").map(Number);if(!Number.isFinite(f)||!Number.isFinite(h))return null;const m=[];for(let b=-1;b<=1;b++){const v=eU(new Date(n+b*864e5),s),y=+v.year,w=+v.month,x=+v.day,O=new Date(Date.UTC(y,w-1,x)).getUTCDay()||7;u&&!u.includes(O)||d&&!d.includes(x)||m.push(...HJt(y,w,x,f,h,s).filter(l))}const g=[...new Set(m)].sort((b,v)=>b-v);return g.length?{at:g[0],count:g.length,nextOnly:!1}:null}function Jm({kind:e}){const t={filter:"M4 5h16l-6 7v7l-4-2v-5Z",plus:"M12 5v14M5 12h14",play:"M8 5l11 7-11 7Z",edit:"m15 4 5 5-11 11H4v-5ZM13 6l5 5",more:"M5 12h.01M12 12h.01M19 12h.01",detail:"M7 3h10l3 3v15H4V3ZM8 9h8M8 13h8M8 17h5",copy:"M9 8V3h12v13h-5M3 8h13v13H3Z",delete:"M3 6h18M9 6V3h6v3M5 6l1 15h12l1-15M10 10v7M14 10v7"};return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:"icon","aria-hidden":"true",children:a.jsx("path",{d:t[e]})})}function WJt({task:e,copy:t,busy:n,error:i,onClose:r,onSave:s}){var J,z;const{t:o}=Te("cronjobs"),l=Z=>o(`mpa.manage.${Z}`),c=e==null?void 0:e.schedule,[u,d]=p.useState(e?e.name+(t?` (${l("copy")})`:""):""),[f,h]=p.useState((e==null?void 0:e.prompt)||""),[m,g]=p.useState((c==null?void 0:c.type)||"Daily"),[b,v]=p.useState(String((c==null?void 0:c.timezone)||"Asia/Shanghai")),[y,w]=p.useState(String((c==null?void 0:c.time)||"09:00")),[x,O]=p.useState(()=>{if(!(c!=null&&c.runAt))return"";const Z=new Date(String(c.runAt));return new Date(Z.getTime()-Z.getTimezoneOffset()*6e4).toISOString().slice(0,16)}),[k,S]=p.useState(String((c==null?void 0:c.intervalSeconds)||3600)),[C,E]=p.useState(String((c==null?void 0:c.weekdays)||"1,2,3,4,5")),[j,T]=p.useState(String((c==null?void 0:c.monthDays)||"1")),[R,A]=p.useState(String((c==null?void 0:c.cronExpression)||"0 9 * * *")),[N,P]=p.useState((e==null?void 0:e.enabled)??!0),[I,D]=p.useState(String(((J=e==null?void 0:e.delivery)==null?void 0:J.channel)||"Web")),[_,L]=p.useState(String(((z=e==null?void 0:e.delivery)==null?void 0:z.targetId)||"")),[F,M]=p.useState(""),V=p.useRef(!1),q=p.useRef(null);function U(){var W;if(n||V.current)return;try{new Intl.DateTimeFormat("en-US",{timeZone:b})}catch{M(l("timezoneInvalid"));return}const Z={type:m,timezone:b};if(m==="Once"){const G=Date.parse(x);if(!Number.isFinite(G)||G<=Date.now()){M(l("futureTime"));return}Z.runAt=new Date(G).toISOString()}else if(m==="Interval"){const G=Number(k);if(!Number.isInteger(G)||G<30||G>31536e3){M(l("intervalInvalid"));return}Z.intervalSeconds=G,(c==null?void 0:c.type)===m&&c.anchorAt&&(Z.anchorAt=c.anchorAt)}else if(m==="Cron"){if(R.trim().split(/\s+/).length!==5){M(o("validation.cronFields"));return}Z.cronExpression=R.trim()}else if(Z.time=y,m==="Weekly"||m==="Monthly"){const G=(m==="Weekly"?C:j).split(",").map(Number),H=m==="Weekly"?7:31;if(!G.length||G.some(se=>!Number.isInteger(se)||se<1||se>H)||new Set(G).size!==G.length){M(l("daysInvalid"));return}Z[m==="Weekly"?"weekdays":"monthDays"]=G}if(!u.trim()||!f.trim()||I==="Feishu"&&!_.trim()){M(l("required"));return}const ne=((W=e==null?void 0:e.delivery)==null?void 0:W.channel)===I&&String(e.delivery.targetId||"")===_?e.delivery:{channel:I,targetId:I==="Web"?null:_.trim(),receiveIdType:"chat_id",bestEffort:!0};M(""),s({name:u.trim(),...e!=null&&e.agentId?{agentId:e.agentId}:{},prompt:f.trim(),enabled:N,schedule:Z,delivery:ne,jitterSeconds:(e==null?void 0:e.jitterSeconds)??0,timeoutSeconds:(e==null?void 0:e.timeoutSeconds)??3600})}return a.jsx(Dh,{open:!0,title:l(e&&!t?"edit":"create"),icon:a.jsx(Jm,{kind:"edit"}),className:"mpa-dialog",initialFocusRef:q,busy:n,onClose:r,children:a.jsxs("form",{onSubmit:Z=>{Z.preventDefault(),U()},onCompositionStart:()=>{V.current=!0},onCompositionEnd:()=>{V.current=!1},onKeyDown:Z=>{Z.key==="Enter"&&(V.current||Z.nativeEvent.isComposing||Z.keyCode===229)&&Z.preventDefault()},children:[a.jsxs("div",{className:"sandbox-control-body mpa-editor",children:[a.jsxs("fieldset",{disabled:n,children:[a.jsxs("label",{children:[l("name"),a.jsx("input",{ref:q,className:"cw-input",required:!0,maxLength:128,value:u,onChange:Z=>d(Z.target.value)})]}),a.jsxs("label",{children:[l("prompt"),a.jsx("textarea",{className:"cw-input",required:!0,maxLength:4e3,rows:5,value:f,onChange:Z=>h(Z.target.value)})]}),a.jsxs("div",{className:"mpa-fields",children:[a.jsxs("div",{children:[a.jsx("span",{children:l("schedule")}),a.jsx(vf,{ariaLabel:l("schedule"),placeholder:"",value:m,options:QJt.map(Z=>({value:Z,label:l(Z)})),onChange:g})]}),a.jsxs("label",{children:[l("timezone"),a.jsx("input",{className:"cw-input",required:!0,value:b,onChange:Z=>v(Z.target.value)})]})]}),m==="Once"?a.jsxs("label",{children:[l("localTime"),a.jsx("input",{className:"cw-input",required:!0,type:"datetime-local",value:x,onChange:Z=>O(Z.target.value)})]}):m==="Interval"?a.jsxs("label",{children:[l("interval"),a.jsx("input",{className:"cw-input",required:!0,type:"number",min:30,max:31536e3,value:k,onChange:Z=>S(Z.target.value)})]}):m==="Cron"?a.jsxs("label",{children:[l("Cron"),a.jsx("input",{className:"cw-input",required:!0,value:R,maxLength:128,onChange:Z=>A(Z.target.value)})]}):a.jsxs("label",{children:[l("time"),a.jsx("input",{className:"cw-input",type:"time",required:!0,value:y,onChange:Z=>w(Z.target.value)})]}),m==="Weekly"&&a.jsxs("label",{children:[l("weekdays"),a.jsx("input",{className:"cw-input",required:!0,value:C,onChange:Z=>E(Z.target.value)})]}),m==="Monthly"&&a.jsxs("label",{children:[l("monthDays"),a.jsx("input",{className:"cw-input",required:!0,value:j,onChange:Z=>T(Z.target.value)})]}),a.jsxs("div",{children:[a.jsx("span",{children:l("delivery")}),a.jsx(vf,{ariaLabel:l("delivery"),placeholder:"",value:I,options:["Web","Feishu"].map(Z=>({value:Z,label:l(Z)})),onChange:D})]}),I==="Feishu"&&a.jsxs("label",{children:[l("target"),a.jsx("input",{className:"cw-input",required:!0,maxLength:512,value:_,onChange:Z=>L(Z.target.value)})]}),a.jsxs("label",{className:"mpa-checkbox",children:[a.jsx("input",{type:"checkbox",checked:N,onChange:Z=>P(Z.target.checked)}),l("enabled")]})]}),(F||i)&&a.jsx("p",{role:"alert",className:"cw-error-text",children:F||i})]}),a.jsxs("footer",{className:"sandbox-control-actions",children:[a.jsx("button",{type:"button",className:"cw-btn cw-btn-ghost",disabled:n,onClick:r,children:l("cancel")}),a.jsx("button",{className:"cw-btn cw-btn-primary is-primary",disabled:n,type:"submit",children:l(n?"saving":"save")})]})]})})}function tU(e){const t=e instanceof Error?e.message:"";return{MPA_HTTP_401:"mpa.authRequired",MPA_HTTP_403:"mpa.forbidden",MPA_HTTP_404:"mpa.unsupported",MPA_HTTP_409:"mpa.manage.conflict",MPA_HTTP_422:"mpa.manage.invalid",MPA_INVALID_RESPONSE:"mpa.invalidResponse"}[t]||"mpa.loadFailed"}function KJt({task:e,runtime:t,onClose:n}){const{t:i,i18n:r}=Te("cronjobs"),s=v=>i(`mpa.manage.${v}`),[o,l]=p.useState(0),[c,u]=p.useState(0),[d,f]=p.useState(null),[h,m]=p.useState(""),[g,b]=p.useState(!0);return p.useEffect(()=>{const v=new AbortController;return b(!0),m(""),f(null),L2e(t,e.id,o,v.signal).then(y=>{v.signal.aborted||f(y)}).catch(y=>{v.signal.aborted||m(tU(y))}).finally(()=>{v.signal.aborted||b(!1)}),()=>v.abort()},[t.runtimeId,t.region,e.id,o,c]),a.jsx(Dh,{open:!0,title:e.name,icon:a.jsx(Jm,{kind:"detail"}),className:"mpa-dialog mpa-detail",onClose:n,children:a.jsxs("div",{className:"sandbox-control-body",children:[a.jsxs("dl",{className:"mpa-details",children:[a.jsx("dt",{children:s("agent")}),a.jsx("dd",{children:e.agentId||"—"}),a.jsx("dt",{children:s("schedule")}),a.jsx("dd",{children:J7(e,s,r.language)}),a.jsx("dt",{children:i("mpa.columns.next")}),a.jsx("dd",{children:$P(e.nextRunAt,r.language)}),a.jsx("dt",{children:s("prompt")}),a.jsx("dd",{className:"mpa-prompt",children:e.prompt})]}),a.jsxs("div",{className:"mpa-history-title",children:[a.jsx("h3",{children:s("history")}),a.jsx("button",{className:"cw-btn cw-btn-ghost",disabled:g,onClick:()=>u(v=>v+1),children:i("mpa.refresh")})]}),h&&a.jsx("p",{className:"cw-error-text",role:"alert",children:i(h)}),g&&a.jsx(fn,{children:i("mpa.loading")}),d&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"mpa-cron-table",children:a.jsxs("table",{children:[a.jsx("thead",{children:a.jsx("tr",{children:["lastRun","lastStatus","duration","result"].map(v=>a.jsx("th",{children:s(v)},v))})}),a.jsx("tbody",{children:d.items.map(v=>a.jsxs("tr",{children:[a.jsx("td",{children:$P(v.startedAt||v.scheduledAt,r.language)}),a.jsx("td",{children:s(v.status)}),a.jsx("td",{children:v.durationMs==null?"—":`${v.durationMs} ms`}),a.jsx("td",{children:v.errorMessage||v.sessionId||"—"})]},v.id))})]})}),d.items.length===0&&a.jsx("p",{children:s("noRuns")}),a.jsxs("nav",{className:"mpa-cron-pages",children:[a.jsx("span",{children:i("mpa.total",{total:d.total})}),a.jsx("button",{className:"cw-btn cw-btn-ghost",disabled:o===0,onClick:()=>l(Math.max(0,o-20)),children:i("mpa.previous")}),a.jsx("button",{className:"cw-btn cw-btn-ghost",disabled:!d.hasMore,onClick:()=>l(d.nextOffset),children:i("mpa.next")})]})]})]})})}function GJt({runtime:e}){const{t}=Te("cronjobs");return e?a.jsx(XJt,{runtime:e},`${e.region}:${e.runtimeId}`):a.jsx("p",{role:"status",children:t("mpa.selectRuntime")})}function XJt({runtime:e}){const{t,i18n:n}=Te("cronjobs"),i=se=>t(`mpa.manage.${se}`),[r,s]=p.useState(""),[o,l]=p.useState(""),[c,u]=p.useState(0),[d,f]=p.useState(0),[h,m]=p.useState(null),[g,b]=p.useState(!0),[v,y]=p.useState(""),[w,x]=p.useState(""),[O,k]=p.useState("list"),[S,C]=p.useState("all"),[E,j]=p.useState(()=>new Date),[T,R]=p.useState(null),[A,N]=p.useState(null),[P,I]=p.useState(null),[D,_]=p.useState(!1),[L,F]=p.useState(""),M=p.useRef(!1),V=p.useRef(!1),q=p.useRef(new AbortController),U=p.useRef(new Map);p.useEffect(()=>{const se=new AbortController;return q.current=se,()=>se.abort()},[]),p.useEffect(()=>{const se=new AbortController;return b(!0),y(""),m(null),(async()=>{const Y=await K8(e,0,o,se.signal),X=[...Y.items];let ie=Y,ee=0;for(;ie.hasMore;){if(se.signal.aborted)return;if(ie.nextOffset===null||ie.nextOffset<=ee||X.length>1e5)throw new Error("MPA_INVALID_RESPONSE");ee=ie.nextOffset,ie=await K8(e,ee,o,se.signal),X.push(...ie.items)}se.signal.aborted||m({...Y,items:[...new Map(X.map(be=>[be.id,be])).values()],hasMore:!1,nextOffset:null})})().catch(Y=>{se.signal.aborted||y(tU(Y))}).finally(()=>{se.signal.aborted||b(!1)}),()=>se.abort()},[e.runtimeId,e.region,o,d]);const J=p.useMemo(()=>(h==null?void 0:h.items.filter(se=>S==="all"||Dk(se)===S))||[],[h,S]),z=p.useMemo(()=>VJt(E),[E]),Z=p.useMemo(()=>z.map(se=>({day:se,tasks:J.flatMap(Y=>{const X=qJt(Y,se);return X?[{task:Y,...X}]:[]})})),[z,J]),ne=J.slice(c,c+10);function W(se){let Y=U.current.get(se);return Y||(Y=crypto.randomUUID(),U.current.set(se,Y)),Y}async function G(se,Y,X){if(M.current)return;M.current=!0,_(!0),F(""),x("");const ie=q.current,ee=se==="create"?JSON.stringify(X):`${se}:${Y==null?void 0:Y.id}`;try{const be=Y?`/${encodeURIComponent(Y.id)}${se==="run"?"/run":""}`:"";if((se==="edit"||se==="toggle")&&(!Number.isInteger(Y==null?void 0:Y.version)||Number(Y==null?void 0:Y.version)<1))throw new Error("MPA_INVALID_RESPONSE");const ue=se==="delete"?void 0:se==="run"?{clientToken:W(ee),mode:"Force"}:se==="create"?{...X,clientToken:W(ee)}:{...se==="toggle"?{enabled:!Y.enabled}:X,expectedVersion:Y.version},pe=await M2e(e,se==="delete"?"DELETE":"POST",be,ue,ie.signal);if(se==="delete"?pe.removed!==!0:se==="run"?!pe.run:!pe.task)throw new Error("MPA_INVALID_RESPONSE");U.current.delete(ee),ie.signal.aborted||(R(null),I(null),N(null),x(i(se==="run"?"queued":"saved")),u(0),f(ke=>ke+1))}catch(be){ie.signal.aborted||F(t(tU(be)))}finally{M.current=!1,ie.signal.aborted||_(!1)}}function H(se,Y=!1){F(""),R({task:se,copy:Y})}return a.jsxs("section",{className:"mpa-cron","aria-label":t("mpa.title"),children:[a.jsxs("div",{className:"mpa-cron-target",children:[a.jsx("strong",{children:e.name}),a.jsxs("span",{children:[e.runtimeId," · ",e.region]})]}),a.jsxs("div",{className:"mpa-cron-heading",children:[a.jsx("div",{className:"mpa-segment",role:"group","aria-label":i("view"),children:["list","calendar"].map(se=>a.jsx("button",{"aria-pressed":O===se,onClick:()=>k(se),children:i(se)},se))}),a.jsxs("button",{className:"cw-btn cw-btn-primary mpa-create",disabled:D,onClick:()=>H(),children:[a.jsx(Jm,{kind:"plus"}),i("create")]})]}),a.jsxs("div",{className:"mpa-toolbar",children:[a.jsxs("form",{className:"mpa-cron-search",onSubmit:se=>{se.preventDefault(),!V.current&&(u(0),l(r),f(Y=>Y+1))},children:[a.jsx("input",{"aria-label":t("mpa.search"),placeholder:t("mpa.search"),type:"search",maxLength:200,value:r,onChange:se=>s(se.target.value),onCompositionStart:()=>{V.current=!0},onCompositionEnd:()=>{V.current=!1},onKeyDown:se=>{se.key==="Enter"&&(V.current||se.nativeEvent.isComposing||se.keyCode===229)&&se.preventDefault()}}),a.jsx("button",{className:"cw-btn cw-btn-ghost",disabled:g,type:"submit",children:t("mpa.search")}),a.jsx("button",{className:"cw-btn cw-btn-ghost",disabled:g,type:"button",onClick:()=>f(se=>se+1),children:t("mpa.refresh")})]}),(h==null?void 0:h.overview)&&a.jsxs("div",{className:"mpa-cron-overview",children:[a.jsx("span",{children:i("overview")}),a.jsxs("span",{children:[t("mpa.successRate")," ",a.jsxs("strong",{children:[Math.round(h.overview.successRate*100),"%"]})]}),a.jsxs("span",{children:[t("mpa.executionCount")," ",a.jsx("strong",{children:h.overview.executionCount})]})]})]}),v&&a.jsx("p",{role:"alert",className:"mpa-cron-error",children:t(v)}),L&&!T&&!P&&a.jsx("p",{role:"alert",className:"mpa-cron-error",children:L}),w&&a.jsx("p",{role:"status",children:w}),g&&a.jsx("div",{className:"mpa-state",role:"status",children:a.jsx(fn,{children:t("mpa.loading")})}),!g&&!v&&h&&a.jsx(a.Fragment,{children:O==="list"?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mpa-cron-table",tabIndex:0,role:"region","aria-label":t("mpa.title"),children:[a.jsxs("table",{children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:i("name")}),a.jsx("th",{children:i("lastRun")}),a.jsx("th",{children:i("schedule")}),a.jsx("th",{children:a.jsxs(er,{children:[a.jsx(er.Trigger,{children:a.jsxs("button",{className:"mpa-status-filter","aria-label":i("lastStatus"),children:[i(S==="all"?"lastStatus":S),a.jsx(Jm,{kind:"filter"})]})}),a.jsx(er.Content,{side:"bottom",align:"start",children:["all","Pending",...zJt].map(se=>a.jsx(er.Item,{onSelect:()=>{C(se),u(0)},children:i(se)},se))})]})}),a.jsx("th",{children:i("agent")}),a.jsx("th",{children:i("actions")})]})}),a.jsx("tbody",{children:ne.map(se=>a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx("button",{className:"mpa-task-link",title:se.name,onClick:()=>N(se),children:se.name})}),a.jsx("td",{children:$P(se.lastRunAt,n.language)}),a.jsx("td",{children:J7(se,i,n.language)}),a.jsx("td",{children:a.jsx("span",{className:`mpa-status mpa-status-${Dk(se)}`,children:i(Dk(se))})}),a.jsx("td",{children:se.agentId||"—"}),a.jsx("td",{children:a.jsxs("div",{className:"mpa-actions",children:[a.jsx("button",{role:"switch","aria-checked":se.enabled,"aria-label":`${i("enabled")} ${se.name}`,disabled:D,className:"mpa-switch",onClick:()=>void G("toggle",se),children:a.jsx("span",{})}),a.jsx("button",{className:"mpa-icon-button",title:i("run"),"aria-label":`${i("run")} ${se.name}`,disabled:D||Dk(se)==="Running"||Dk(se)==="Queued",onClick:()=>void G("run",se),children:a.jsx(Jm,{kind:"play"})}),a.jsxs(er,{children:[a.jsx(er.Trigger,{children:a.jsx("button",{className:"mpa-icon-button",disabled:D,"aria-label":`${i("actions")} ${se.name}`,children:a.jsx(Jm,{kind:"more"})})}),a.jsx(er.Content,{side:"bottom",align:"end",minWidth:148,children:["detail","edit","copy","delete"].map(Y=>a.jsxs(er.Item,{onSelect:()=>{Y==="detail"?N(se):Y==="delete"?(F(""),I(se)):H(se,Y==="copy")},children:[a.jsx(Jm,{kind:Y}),a.jsx("span",{children:i(Y)})]},Y))})]})]})})]},se.id))})]}),J.length===0&&a.jsx("div",{className:"mpa-state",role:"status",children:t("mpa.empty")})]}),a.jsxs("nav",{className:"mpa-cron-pages","aria-label":t("mpa.pagination"),children:[a.jsx("span",{children:t("mpa.total",{total:J.length})}),a.jsx("button",{className:"cw-btn cw-btn-ghost",disabled:c===0,onClick:()=>u(Math.max(0,c-10)),children:t("mpa.previous")}),a.jsx("button",{className:"cw-btn cw-btn-ghost",disabled:c+10>=J.length,onClick:()=>u(c+10),children:t("mpa.next")})]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mpa-calendar-bar",children:[a.jsx("strong",{children:new Intl.DateTimeFormat(n.language,{year:"numeric",month:"long"}).format(E)}),a.jsxs("span",{children:[i("calendarZone")," ",Intl.DateTimeFormat().resolvedOptions().timeZone]}),a.jsx("button",{className:"cw-btn cw-btn-ghost",onClick:()=>j(new Date(E.getFullYear(),E.getMonth()-1,1)),children:i("prevMonth")}),a.jsx("button",{className:"cw-btn cw-btn-ghost",onClick:()=>j(new Date),children:i("today")}),a.jsx("button",{className:"cw-btn cw-btn-ghost",onClick:()=>j(new Date(E.getFullYear(),E.getMonth()+1,1)),children:i("nextMonth")})]}),a.jsxs("div",{className:"mpa-calendar",children:[z.slice(0,7).map(se=>a.jsx("div",{className:"mpa-calendar-weekday",children:new Intl.DateTimeFormat(n.language,{weekday:"short"}).format(se)},se.toISOString())),Z.map(({day:se,tasks:Y})=>a.jsxs("div",{className:`mpa-calendar-day ${se.getMonth()!==E.getMonth()?"is-outside":""}`,children:[a.jsx("time",{dateTime:se.toISOString(),children:se.getDate()}),Y.map(({task:X,at:ie,count:ee,nextOnly:be})=>a.jsxs("button",{className:"mpa-calendar-task",onClick:()=>N(X),title:`${X.name} · ${J7(X,i,n.language)}`,children:[a.jsxs("span",{children:[new Intl.DateTimeFormat(n.language,{hour:"2-digit",minute:"2-digit"}).format(ie)," ",X.name]}),ee>1&&a.jsxs("small",{children:[" × ",ee]}),be&&a.jsx("small",{children:i("nextOnly")})]},X.id))]},se.toISOString()))]}),a.jsx("p",{children:i("calendarHint")})]})}),T&&a.jsx(WJt,{task:T.task,copy:T.copy,busy:D,error:L,onClose:()=>R(null),onSave:se=>void G(T.task&&!T.copy?"edit":"create",T.copy?void 0:T.task,se)}),A&&a.jsx(KJt,{runtime:e,task:A,onClose:()=>N(null)},A.id),P&&a.jsxs(Dh,{open:!0,title:i("delete"),icon:a.jsx(Jm,{kind:"delete"}),busy:D,onClose:()=>I(null),children:[a.jsxs("div",{className:"sandbox-control-body",children:[a.jsx("p",{children:t("mpa.manage.deleteConfirm",{name:P.name})}),L&&a.jsx("p",{role:"alert",className:"cw-error-text",children:L})]}),a.jsxs("footer",{className:"sandbox-control-actions",children:[a.jsx("button",{className:"cw-btn cw-btn-ghost",disabled:D,onClick:()=>I(null),children:i("cancel")}),a.jsx("button",{className:"cw-btn cw-btn-primary",disabled:D,onClick:()=>void G("delete",P),children:i("delete")})]})]})]})}const YJt="_Container_1bl61_1",ZJt="_Track_1bl61_16",JJt="_Thumb_1bl61_56",een="_Label_1bl61_78",xj={Container:YJt,Track:ZJt,Thumb:JJt,Label:een},nU=({className:e,label:t,id:n,disabled:i,labelPosition:r="end",...s})=>{const o=p.useId(),l=n??o;return a.jsxs("div",{className:Ui(xj.Container,e),"data-disabled":i?"":void 0,"data-has-label":t?"":void 0,"data-label-position":r,children:[a.jsx(uft,{id:l,className:xj.Track,disabled:i,...s,children:a.jsx(fft,{className:xj.Thumb})}),t&&a.jsx("label",{htmlFor:l,className:xj.Label,children:t})]})};function xb({message:e,className:t="",onRetry:n,retryLabel:i,defaultExpanded:r=!0}){const{t:s}=Te("ui"),o=i??s("deploymentError.retryDeployment"),[l,c]=p.useState(r),[u,d]=p.useState(!1),f=async()=>{if(!(!n||u)){d(!0);try{await n()}finally{d(!1)}}};return a.jsxs("div",{className:`deploy-error-message${l?" is-expanded":""}${t?` ${t}`:""}`,role:"alert",children:[a.jsx("p",{className:"deploy-error-message-text",children:e}),a.jsxs("div",{className:"deploy-error-message-actions",children:[n&&a.jsxs(_t,{type:"button",className:"deploy-error-retry",color:"danger",variant:"soft",size:"sm",pill:!1,loading:u,onClick:()=>void f(),children:[!u&&a.jsx(Wst,{}),u?s("deploymentError.retrying"):o]}),a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,pill:!1,title:s(l?"deploymentError.collapse":"deploymentError.expand"),"aria-label":s(l?"deploymentError.collapse":"deploymentError.expand"),onClick:()=>c(h=>!h),children:l?a.jsx(Zst,{}):a.jsx(iat,{})}),a.jsx(sH,{copyValue:e,color:"secondary",variant:"ghost",size:"sm",uniform:!0,pill:!1,title:s("deploymentError.copy"),"aria-label":s("deploymentError.copy")})]})]})}const ten={queued:"status.queued",pending:"status.pending",running:"status.running",retrying:"status.retrying",success:"status.success",failed:"status.failed",cancelled:"status.cancelled",skipped:"status.skipped"},U9e=["weekdays.sunday","weekdays.monday","weekdays.tuesday","weekdays.wednesday","weekdays.thursday","weekdays.friday","weekdays.saturday"];function iU(e){if(!e)return"-";const t=new Date(e);return Number.isNaN(t.getTime())?e:new Intl.DateTimeFormat(bn.resolvedLanguage,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).format(t).replace(/\//g,"-")}function nen(e){if(!e.startedAt)return"-";const t=Date.parse(e.startedAt),n=e.finishedAt?Date.parse(e.finishedAt):Date.now();if(!Number.isFinite(t)||!Number.isFinite(n)||n{const d=i.current;!d||r.current||c(d.scrollHeight>d.clientHeight+1)},[]);return p.useLayoutEffect(()=>{r.current=s,s||u()},[s,u,e]),p.useEffect(()=>{const d=i.current;if(!d||typeof ResizeObserver>"u")return;const f=new ResizeObserver(u);return f.observe(d),()=>f.disconnect()},[u]),a.jsxs("div",{className:`cronjobs-run-output-body${s?" is-expanded":""}`,children:[a.jsx("p",{id:n,ref:i,children:e}),l?a.jsx(_t,{type:"button",className:"cronjobs-run-output-toggle",color:"secondary",variant:"ghost",size:"sm",pill:!1,"aria-expanded":s,"aria-controls":n,onClick:()=>o(d=>!d),children:t(s?"actions.collapse":"actions.expand")}):null]})}const sU="Asia/Shanghai",ren=3e3,sen=["Asia/Shanghai","Asia/Singapore","Asia/Tokyo","Europe/London","America/Los_Angeles","America/New_York","UTC"];function Dt(e,t){return bn.t(e,{ns:"cronjobs",...t})}function aen(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||sU}catch{return sU}}function oen(){const e=aen(),t=new Date(Date.now()+24*60*60*1e3);return t.setSeconds(0,0),{name:"",runtimeId:"",prompt:"",scheduleType:"daily",onceAt:new Date(t.getTime()-t.getTimezoneOffset()*6e4).toISOString().slice(0,16),time:"09:00",weekday:1,cron:"0 9 * * *",timezone:e,enabled:!0}}function len(e){return{name:e.name,runtimeId:e.runtimeId,prompt:e.prompt,scheduleType:e.schedule.type,onceAt:e.schedule.onceAt??"",time:e.schedule.time??"09:00",weekday:e.schedule.weekday??1,cron:e.schedule.cron??"0 9 * * *",timezone:e.schedule.timezone||sU,enabled:e.enabled}}function cen({run:e}){const t=e?e.status==="success"?"success":e.status==="failed"?"danger":["queued","pending","running","retrying"].includes(e.status)?"info":"secondary":"secondary";return a.jsx(Ya,{className:"cronjobs-status",color:t,variant:"soft",size:"sm",pill:!0,children:Dt(e?ten[e.status]:"status.notRun")})}function ale({job:e,runtimes:t,cloudProvider:n,busy:i,onClose:r,onSubmit:s}){const[o,l]=p.useState(()=>e?len(e):oen()),[c,u]=p.useState(""),[d,f]=p.useState(!1),h=p.useRef(null),m=p.useRef(null),g=p.useRef(null),b=i||d,v=p.useRef(b),y=p.useRef(r),w=p.useMemo(()=>Array.from(new Set([o.timezone,...sen])),[o.timezone]),x=p.useMemo(()=>t.map(C=>({value:C.runtimeId,label:C.name,description:wh(C.region,n)})),[n,t]),O=p.useMemo(()=>U9e.map((C,E)=>({value:String(E),label:Dt(C)})),[]),k=p.useMemo(()=>w.map(C=>({value:C,label:C})),[w]);p.useEffect(()=>{v.current=b,y.current=r},[b,r]),p.useEffect(()=>{var T;const C=document.body.style.overflow,E=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(T=m.current)==null||T.focus();const j=R=>{var D,_;if(R.key==="Escape"&&!v.current){y.current();return}if(R.key!=="Tab")return;const A=Array.from(((D=h.current)==null?void 0:D.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'))??[]).filter(L=>!L.hidden&&L.getClientRects().length>0);if(A.length===0){R.preventDefault();return}const N=A[0],P=A[A.length-1],I=document.activeElement;R.shiftKey&&(I===N||!((_=h.current)!=null&&_.contains(I)))?(R.preventDefault(),P.focus()):!R.shiftKey&&I===P&&(R.preventDefault(),N.focus())};return window.addEventListener("keydown",j),()=>{document.body.style.overflow=C,window.removeEventListener("keydown",j),E!=null&&E.isConnected&&E.focus()}},[]);const S=async C=>{C.preventDefault();const E=o.name.trim(),j=o.prompt.trim(),T=t.find(A=>A.runtimeId===o.runtimeId);if(!E)return u(Dt("validation.nameRequired"));if(!T)return u(Dt("validation.runtimeRequired"));if(!j)return u(Dt("validation.promptRequired"));if(o.scheduleType==="once"&&!o.onceAt||(o.scheduleType==="daily"||o.scheduleType==="weekly")&&!o.time)return u(Dt("validation.timeRequired"));const R=o.cron.trim().split(/\s+/);if(o.scheduleType==="cron"&&R.length!==5)return u(Dt("validation.cronFields"));u(""),f(!0);try{let A=(e==null?void 0:e.runtimeId)===T.runtimeId?e.agentName.trim():"";if(!A){const[N]=await $A("","",{runtimeId:T.runtimeId,region:T.region});A=(N==null?void 0:N.trim())??""}if(!A)throw new Error(Dt("validation.runtimeAppMissing"));await s({name:E,runtimeId:T.runtimeId,runtimeName:T.name,agentName:A,region:T.region,prompt:j,enabled:o.enabled,schedule:{type:o.scheduleType,timezone:o.timezone,...o.scheduleType==="once"?{onceAt:o.onceAt}:{},...o.scheduleType==="daily"?{time:o.time}:{},...o.scheduleType==="weekly"?{time:o.time,weekday:o.weekday}:{},...o.scheduleType==="cron"?{cron:o.cron.trim()}:{}}})}catch(A){u(A instanceof Error?A.message:String(A)),window.requestAnimationFrame(()=>{var N;return(N=g.current)==null?void 0:N.focus()})}finally{f(!1)}};return a.jsx("div",{className:"cronjobs-drawer-backdrop",onMouseDown:C=>{C.target===C.currentTarget&&!b&&r()},children:a.jsxs("aside",{ref:h,className:"cronjobs-drawer",role:"dialog","aria-modal":"true","aria-labelledby":"cronjobs-drawer-title",children:[a.jsxs("header",{className:"cronjobs-drawer-head",children:[a.jsxs("div",{children:[a.jsx("h2",{id:"cronjobs-drawer-title",children:Dt(e?"drawer.editTitle":"drawer.createTitle")}),a.jsx("p",{children:Dt("drawer.description")})]}),a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"lg",uniform:!0,pill:!1,onClick:r,disabled:b,"aria-label":Dt("actions.closeDrawer"),children:a.jsx(pV,{})})]}),a.jsxs("form",{className:"cronjobs-form",onSubmit:C=>void S(C),children:[a.jsxs("div",{className:"cronjobs-form-scroll",children:[a.jsxs("label",{className:"cronjobs-field",children:[a.jsx("span",{children:Dt("fields.name")}),a.jsx(_s,{ref:m,size:"lg",value:o.name,maxLength:80,invalid:!!c&&!o.name.trim(),onChange:C=>l({...o,name:C.target.value}),placeholder:Dt("fields.namePlaceholder")})]}),a.jsxs("label",{className:"cronjobs-field",children:[a.jsx("span",{children:Dt("fields.runtimeAgent")}),a.jsx(ha,{value:o.runtimeId,options:x,size:"lg",disabled:t.length===0,placeholder:Dt(t.length?"fields.runtimePlaceholder":"fields.noRuntime"),onChange:C=>l({...o,runtimeId:C.value})}),a.jsx("small",{children:Dt("fields.runtimeHelp")})]}),a.jsxs("label",{className:"cronjobs-field",children:[a.jsx("span",{children:Dt("fields.prompt")}),a.jsx(vb,{value:o.prompt,rows:5,maxRows:10,autoResize:!0,maxLength:2e4,invalid:!!c&&!o.prompt.trim(),onChange:C=>l({...o,prompt:C.target.value}),placeholder:Dt("fields.promptPlaceholder")}),a.jsxs("small",{className:"cronjobs-character-count",children:[o.prompt.length.toLocaleString()," / 20,000"]})]}),a.jsxs("fieldset",{className:"cronjobs-fieldset",children:[a.jsx("legend",{children:Dt("fields.schedule")}),a.jsxs(ld,{className:"cronjobs-schedule-types",value:o.scheduleType,size:"lg",block:!0,"aria-label":Dt("fields.scheduleType"),onChange:C=>l({...o,scheduleType:C}),children:[a.jsx(ld.Option,{value:"once",children:Dt("scheduleTypes.once")}),a.jsx(ld.Option,{value:"daily",children:Dt("scheduleTypes.daily")}),a.jsx(ld.Option,{value:"weekly",children:Dt("scheduleTypes.weekly")}),a.jsx(ld.Option,{value:"cron",children:"Cron"})]}),o.scheduleType==="once"?a.jsxs("label",{className:"cronjobs-field",children:[a.jsx("span",{children:Dt("fields.runAt")}),a.jsx(_s,{size:"lg",type:"datetime-local",value:o.onceAt,onChange:C=>l({...o,onceAt:C.target.value})})]}):null,o.scheduleType==="daily"?a.jsxs("label",{className:"cronjobs-field",children:[a.jsx("span",{children:Dt("fields.dailyTime")}),a.jsx(_s,{size:"lg",type:"time",value:o.time,onChange:C=>l({...o,time:C.target.value})})]}):null,o.scheduleType==="weekly"?a.jsxs("div",{className:"cronjobs-inline-fields",children:[a.jsxs("label",{className:"cronjobs-field",children:[a.jsx("span",{children:Dt("fields.weekday")}),a.jsx(ha,{value:String(o.weekday),options:O,size:"lg",onChange:C=>l({...o,weekday:Number(C.value)})})]}),a.jsxs("label",{className:"cronjobs-field",children:[a.jsx("span",{children:Dt("fields.runAt")}),a.jsx(_s,{size:"lg",type:"time",value:o.time,onChange:C=>l({...o,time:C.target.value})})]})]}):null,o.scheduleType==="cron"?a.jsxs("label",{className:"cronjobs-field",children:[a.jsx("span",{children:Dt("fields.cronExpression")}),a.jsx(_s,{size:"lg",value:o.cron,onChange:C=>l({...o,cron:C.target.value}),placeholder:"0 9 * * *"}),a.jsx("small",{children:Dt("fields.cronHelp")})]}):null,a.jsxs("label",{className:"cronjobs-field",children:[a.jsx("span",{children:Dt("fields.timezone")}),a.jsx(ha,{value:o.timezone,options:k,size:"lg",onChange:C=>l({...o,timezone:C.value})})]})]}),a.jsxs("div",{className:"cronjobs-switch-row",children:[a.jsxs("span",{children:[a.jsx("strong",{children:Dt("fields.enableAfterCreate")}),a.jsx("small",{children:Dt("fields.enableHelp")})]}),a.jsx(nU,{checked:o.enabled,onCheckedChange:C=>l({...o,enabled:C}),"aria-label":Dt("fields.enableAfterCreate")})]}),c?a.jsx("div",{ref:g,className:"cronjobs-inline-error",tabIndex:-1,children:a.jsx(Mg,{color:"danger",variant:"soft",description:c})}):null]}),a.jsxs("footer",{className:"cronjobs-drawer-actions",children:[a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"lg",pill:!1,onClick:r,disabled:b,children:Dt("actions.cancel")}),a.jsx(_t,{type:"submit",color:"primary",size:"lg",pill:!1,loading:b,disabled:t.length===0,"aria-busy":b||void 0,children:Dt(d?"actions.connectingRuntime":i?"actions.saving":e?"actions.saveChanges":"actions.createTask")})]})]})]})})}function uen({jobs:e,canCreate:t,onCreate:n,onSelect:i}){return a.jsxs(W0,{children:[a.jsx(lb,{icon:a.jsx(Nje,{}),onClick:n,disabled:!t,title:Dt(t?"actions.createScheduledTask":"fields.noRuntime"),children:Dt("actions.createScheduledTask")}),e.map(r=>{const s=Q9e(r.schedule);return a.jsx(G0,{className:"cronjobs-card",title:r.name,status:a.jsx(Ya,{color:r.enabled?"success":"secondary",variant:"soft",size:"sm",pill:!0,children:Dt(r.enabled?"status.enabled":"status.paused")}),description:r.prompt,metadata:[{label:Dt("fields.schedule"),value:s,title:s}],detailAction:{label:Dt("actions.viewDetails"),onClick:()=>i(r)}},r.jobId)})]})}function den({job:e,runs:t,runsLoading:n,runsError:i,busyAction:r,onBack:s,onEdit:o,onToggle:l,onRun:c,onDelete:u,onCancel:d,onRetryRun:f,onRetryRuns:h}){const m=t.find(b=>b.status==="queued"||b.status==="running"||b.status==="retrying"||b.status==="pending")??(rU(e)?e.latestRun:void 0),g=r.includes(e.jobId);return a.jsxs("div",{className:"cronjobs-detail",children:[a.jsxs("header",{className:"cronjobs-detail-head",children:[a.jsxs("div",{className:"cronjobs-detail-title",children:[a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"lg",uniform:!0,pill:!1,onClick:s,"aria-label":Dt("actions.backToList"),children:a.jsx(Hst,{})}),a.jsxs("div",{children:[a.jsx("h1",{children:e.name}),a.jsxs("p",{children:[e.runtimeName||e.agentName," · ",Q9e(e.schedule)]})]})]}),a.jsxs("div",{className:"cronjobs-detail-actions",children:[a.jsxs(_t,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:o,disabled:g,children:[a.jsx(nat,{}),Dt("actions.edit")]}),a.jsxs(_t,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:l,disabled:g,children:[e.enabled?a.jsx(lat,{}):a.jsx(WJ,{}),Dt(e.enabled?"actions.pause":"actions.enable")]}),m?a.jsxs(_t,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>d(m),disabled:g||!!m.cancellationRequestedAt,children:[a.jsx(hat,{}),Dt(m.cancellationRequestedAt?m.status==="queued"?"actions.cancelling":"actions.stopping":m.status==="queued"?"actions.cancelQueue":"actions.stopRun")]}):a.jsxs(_t,{type:"button",color:"primary",size:"lg",pill:!1,onClick:c,disabled:g||!e.enabled,children:[a.jsx(WJ,{}),Dt("actions.runNow")]}),a.jsx(ka,{compact:!0,content:Dt(m?m.status==="queued"?"actions.cancelQueueFirst":"actions.stopRunFirst":"actions.deleteTask"),children:a.jsxs(_t,{type:"button",color:"danger",variant:"ghost",size:"lg",pill:!1,onClick:u,disabled:g||!!m,"aria-label":Dt("actions.deleteTask"),children:[a.jsx(Jst,{}),Dt("actions.delete")]})})]})]}),a.jsxs("div",{className:"cronjobs-detail-scroll",children:[a.jsxs("section",{className:"cronjobs-summary-grid","aria-label":Dt("detail.configuration"),children:[a.jsxs("dl",{children:[a.jsxs("div",{children:[a.jsx("dt",{children:Dt("detail.status")}),a.jsx("dd",{children:Dt(e.enabled?"status.enabled":"status.paused")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:Dt("detail.nextRun")}),a.jsx("dd",{children:e.enabled?iU(e.nextRunAt):"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:Dt("detail.runtime")}),a.jsx("dd",{title:e.runtimeName,children:e.runtimeName})]}),a.jsxs("div",{children:[a.jsx("dt",{children:Dt("detail.region")}),a.jsx("dd",{children:e.region})]})]}),a.jsxs("div",{className:"cronjobs-prompt",children:[a.jsx("span",{children:Dt("fields.prompt")}),a.jsx("p",{children:e.prompt})]})]}),a.jsxs("section",{className:"cronjobs-history",children:[a.jsxs("header",{children:[a.jsxs("div",{children:[a.jsx("h2",{children:Dt("history.title")}),a.jsx("p",{children:Dt("history.description")})]}),a.jsx(ka,{compact:!0,content:Dt("actions.refresh"),children:a.jsx(_t,{type:"button",color:"secondary",variant:"ghost",size:"lg",uniform:!0,pill:!1,onClick:h,disabled:n,"aria-label":Dt("actions.refreshHistory"),children:a.jsx(JD,{})})})]}),n&&t.length===0?a.jsx(cl,{}):i?a.jsx(Mg,{className:"cronjobs-history-alert",color:"danger",variant:"soft",title:Dt("history.loadFailed"),description:i,actions:a.jsx(_t,{type:"button",color:"danger",variant:"soft",size:"sm",pill:!1,onClick:h,children:Dt("actions.retry")})}):t.length===0?a.jsxs(Wn,{className:"cronjobs-history-state",fill:"none",children:[a.jsx(Wn.Icon,{children:a.jsx(hV,{})}),a.jsx(Wn.Title,{children:Dt("history.emptyTitle")}),a.jsx(Wn.Description,{children:Dt("history.emptyDescription")})]}):a.jsx("div",{className:"cronjobs-runs",children:t.map(b=>a.jsxs("article",{className:"cronjobs-run",children:[a.jsxs("div",{className:"cronjobs-run-main",children:[a.jsx(cen,{run:b}),a.jsxs("div",{children:[a.jsx("strong",{children:iU(b.startedAt||b.scheduledAt)}),a.jsxs("span",{children:[Dt("history.duration",{duration:nen(b)}),b.runtimeVersion?` · Runtime v${b.runtimeVersion}`:""]})]})]}),b.sessionId?a.jsxs("div",{className:"cronjobs-run-meta",children:[a.jsx("span",{children:Dt("history.session")}),a.jsx("strong",{title:b.sessionId,children:b.sessionId})]}):null,b.output?a.jsxs("div",{className:"cronjobs-run-output",children:[a.jsx("span",{children:Dt("history.finalAnswer")}),a.jsx(ien,{output:b.output})]}):null,b.error?a.jsxs("div",{className:"cronjobs-run-output is-error",children:[a.jsx("span",{children:Dt("history.errorDetails")}),a.jsx(xb,{message:b.error,className:"cronjobs-run-error-detail",defaultExpanded:!1,onRetry:b.status==="failed"?f:void 0,retryLabel:Dt("actions.rerun")})]}):null,b.status==="queued"||b.status==="running"||b.status==="retrying"||b.status==="pending"?a.jsx(_t,{type:"button",className:"cronjobs-run-cancel",color:"danger",variant:"soft",size:"sm",pill:!1,onClick:()=>d(b),disabled:g||!!b.cancellationRequestedAt,loading:!!b.cancellationRequestedAt,children:Dt(b.cancellationRequestedAt?"actions.stopping":b.status==="queued"?"actions.cancelQueue":"actions.stop")}):null]},b.runId))})]})]})]})}function fen({cloudProvider:e,selectedRuntime:t}){const[n,i]=p.useState("studio");Te("cronjobs");const[r,s]=p.useState([]),[o,l]=p.useState([]),[c,u]=p.useState(!0),[d,f]=p.useState(""),[h,m]=p.useState(""),[g,b]=p.useState(void 0),[v,y]=p.useState([]),[w,x]=p.useState(!1),[O,k]=p.useState(""),[S,C]=p.useState(""),[E,j]=p.useState("all"),[T,R]=p.useState(""),[A,N]=p.useState(null),[P,I]=p.useState(""),D=r.find(W=>W.jobId===h),_=E==="all"?r:r.filter(W=>E==="enabled"?W.enabled:!W.enabled),L=p.useCallback(async W=>{u(!0),f("");try{const[G,H]=await Promise.all([z8(W),Q0({scope:"all",region:"all",pageSize:100})]);if(W!=null&&W.aborted)return;s(G),l(H.runtimes.filter(se=>se.status.toLowerCase()==="ready"))}catch(G){if(W!=null&&W.aborted)return;console.warn("Unable to load scheduled tasks",G),f(Dt("page.loadFailedDescription"))}finally{W!=null&&W.aborted||u(!1)}},[]);p.useEffect(()=>{const W=new AbortController;return L(W.signal),()=>W.abort()},[L]);const F=p.useCallback(async(W,G)=>{x(!0),k("");try{const H=await V8(W,G);G!=null&&G.aborted||y(H)}catch(H){G!=null&&G.aborted||(console.warn("Unable to load scheduled-task history",H),k(Dt("history.loadFailedDescription")))}finally{G!=null&&G.aborted||x(!1)}},[]);p.useEffect(()=>{if(!h){y([]),k("");return}const W=new AbortController;return F(h,W.signal),()=>W.abort()},[F,h]);const M=r.some(rU);p.useEffect(()=>{!M&&T===Dt("notices.queued")&&R("")},[M,T]),p.useEffect(()=>{if(!M)return;const W=new AbortController,G=async()=>{try{const[se,Y]=await Promise.all([z8(W.signal),h?V8(h,W.signal):Promise.resolve(null)]);if(W.signal.aborted)return;s(se),Y&&y(Y),se.some(rU)||R("")}catch(se){W.signal.aborted||R(se instanceof Error?se.message:String(se))}},H=window.setInterval(()=>void G(),ren);return()=>{window.clearInterval(H),W.abort()}},[M,h]);const V=W=>s(G=>G.some(H=>H.jobId===W.jobId)?G.map(H=>H.jobId===W.jobId?W:H):[W,...G]),q=async(W,G,H,se=!1)=>{C(W),R("");try{await G(),R(H)}catch(Y){const X=Y instanceof Error?Y.message:String(Y);if(se)throw new Error(X);R(X)}finally{C("")}},U=async W=>{const G=g??null;await q(`${(G==null?void 0:G.jobId)??"new"}:save`,async()=>{const H=G?await m2e(G.jobId,W):await p2e(W);V(H),b(void 0),G&&m(H.jobId)},Dt(G?"notices.updated":"notices.created"),!0)},J=W=>void q(`${W.jobId}:toggle`,async()=>V(await g2e(W.jobId,!W.enabled)),Dt(W.enabled?"notices.paused":"notices.enabled")),z=(W,G)=>q(`${W.jobId}:run`,async()=>{const H=await b2e(W.jobId);V({...W,latestRun:H}),h===W.jobId&&y(se=>[H,...se.filter(Y=>Y.runId!==H.runId)])},G),Z=W=>void z(W,Dt("notices.queued")),ne=()=>{if(!A)return;I("");const W=A;W.kind==="delete"?q(`${W.job.jobId}:delete`,async()=>{await v2e(W.job.jobId),s(G=>G.filter(H=>H.jobId!==W.job.jobId)),m(""),N(null)},Dt("notices.deleted"),!0).catch(G=>{I(G instanceof Error?G.message:String(G))}):q(`${W.job.jobId}:cancel`,async()=>{var H;const G=await y2e(W.job.jobId,W.run.runId);y(se=>se.map(Y=>Y.runId===G.runId?G:Y)),V({...W.job,latestRun:((H=W.job.latestRun)==null?void 0:H.runId)===G.runId?G:W.job.latestRun}),N(null)},Dt("notices.cancelRequested"),!0).catch(G=>{I(G instanceof Error?G.message:String(G))})};return D?a.jsxs(kh,{className:"cronjobs-page","aria-label":Dt("detail.pageLabel"),children:[a.jsx(den,{job:D,runs:v,runsLoading:w,runsError:O,busyAction:S,onBack:()=>m(""),onEdit:()=>b(D),onToggle:()=>J(D),onRun:()=>Z(D),onDelete:()=>{I(""),N({kind:"delete",job:D})},onCancel:W=>{I(""),N({kind:"cancel",job:D,run:W})},onRetryRun:()=>z(D,Dt("notices.requeued")),onRetryRuns:()=>void F(D.jobId)}),T?a.jsx("div",{className:"cronjobs-notice",role:"status",children:a.jsx(Mg,{color:"info",variant:"soft",description:T})}):null,g!==void 0?a.jsx(ale,{job:g,runtimes:o,cloudProvider:e,busy:S.endsWith(":save"),onClose:()=>b(void 0),onSubmit:U}):null,A?a.jsx(Cd,{title:Dt(A.kind==="delete"?"confirm.deleteTitle":"confirm.cancelTitle"),description:A.kind==="delete"?Dt("confirm.deleteDescription",{name:A.job.name}):Dt("confirm.cancelDescription"),error:P,confirmLabel:Dt(A.kind==="delete"?"actions.deleteTask":"actions.stop"),variant:"danger",busy:S.endsWith(A.kind),onCancel:()=>{I(""),N(null)},onConfirm:ne}):null]}):a.jsxs(kh,{className:"cronjobs-page","aria-label":Dt("page.title"),children:[a.jsx(q0,{className:"cronjobs-page-head",title:Dt("page.title")}),a.jsx(sb,{children:a.jsx(ab,{idPrefix:"cronjobs-source",ariaLabel:Dt("mpa.source"),value:n,items:[{id:"studio",label:Dt("mpa.studio")},{id:"runtime",label:Dt("mpa.title")}],onChange:i})}),n==="runtime"?a.jsx(Jp,{children:a.jsx(GJt,{runtime:t})}):a.jsxs(a.Fragment,{children:[a.jsx(sb,{children:a.jsx(ab,{idPrefix:"cronjobs-filter",ariaLabel:Dt("page.filterLabel"),value:E,items:[{id:"all",label:Dt("filters.all")},{id:"enabled",label:Dt("status.enabled")},{id:"paused",label:Dt("status.paused")}],onChange:j})}),T?a.jsx("div",{className:"cronjobs-banner",role:"status",children:a.jsx(Mg,{color:"info",variant:"soft",description:T})}):null,a.jsx(Jp,{"aria-label":Dt("page.listLabel"),children:c&&r.length===0?a.jsx(cl,{}):d?a.jsxs(Wn,{className:"cronjobs-state",fill:"none",children:[a.jsx(Wn.Icon,{color:"danger",children:a.jsx(hV,{})}),a.jsx(Wn.Title,{color:"danger",children:Dt("page.loadFailed")}),a.jsx(Wn.Description,{children:d}),a.jsx(Wn.ActionRow,{children:a.jsxs(_t,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:()=>void L(),children:[a.jsx(JD,{}),Dt("actions.retry")]})})]}):a.jsx(uen,{jobs:_,canCreate:!c&&o.length>0,onCreate:()=>b(null),onSelect:W=>m(W.jobId)})})]}),g!==void 0?a.jsx(ale,{job:g,runtimes:o,cloudProvider:e,busy:S.endsWith(":save"),onClose:()=>b(void 0),onSubmit:U}):null]})}const hen={volcengine:"https://console.volcengine.com",byteplus:"https://console.byteplus.com"};function pA(e){return e.trim()}function EK(e){return hen[e]}function pen(e){const t=pA(e);if(!t)return null;let n=t;try{n=new URL(t.includes("://")?t:`https://${t}`).hostname}catch{return null}const i=n.match(/^(.+)\.tos-([a-z0-9-]+)\.(?:volces|bytepluses)\.com$/i);return i?{bucket:i[1],region:i[2]}:null}function men(e,t){const n=pen(t);if(!n)return null;const i=new URLSearchParams({id:n.bucket,region:n.region,type:"objects"});return`${EK(e)}/tos/bucket/setting?${i.toString()}`}function gen(e,t,n){const i=pA(t),r=pA(n);return!i||!r?null:`${EK(e)}/agentkit/region:agentkit+${encodeURIComponent(i)}/builtintools/${encodeURIComponent(r)}/detail`}function ben(e,t,n){const i=pA(t),r=pA(n);return!i||!r?null:`${EK(e)}/identity/region:identity+${encodeURIComponent(i)}/user-pools/${encodeURIComponent(r)}/info`}function Mk({href:e,label:t,children:n}){return e?a.jsxs("a",{className:"system-info-resource-link",href:e,target:"_blank",rel:"noreferrer","aria-label":t,title:t,children:[a.jsx("span",{children:n}),a.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[a.jsx("path",{d:"M7.75 5.25h-2.5a1.5 1.5 0 0 0-1.5 1.5v8a1.5 1.5 0 0 0 1.5 1.5h8a1.5 1.5 0 0 0 1.5-1.5v-2.5"}),a.jsx("path",{d:"M10.25 3.75h6v6M16 4 9 11"})]})]}):a.jsx("span",{children:n})}function yen(e){return e instanceof Error&&e.message.includes("Volcengine credentials not found")}function ven({spinning:e}){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e?"is-spinning":"",children:a.jsx("path",{d:"M19.5 9A8 8 0 0 0 5 6L3 9m0-5v5h5M4.5 15A8 8 0 0 0 19 18l2-3m0 5v-5h-5"})})}function xen(){return{busy:!1,error:"",message:""}}function wen({version:e,localMode:t,role:n,provider:i,region:r,onBack:s}){const{t:o}=Te("ui"),l=n==="admin"||n==="super_admin",[c,u]=p.useState(""),[d,f]=p.useState([]),[h,m]=p.useState([]),[g,b]=p.useState(null),[v,y]=p.useState(!0),[w,x]=p.useState(""),[O,k]=p.useState(!0),[S,C]=p.useState(""),[E,j]=p.useState(!0),[T,R]=p.useState(""),[A,N]=p.useState(0),[P,I]=p.useState(0),[D,_]=p.useState(0),L=p.useRef(!1),[F,M]=p.useState({}),[V,q]=p.useState({}),[U,J]=p.useState(""),[z,Z]=p.useState(!0),ne=p.useRef(new Set),W=p.useRef(0),G=`${i}:${r}`,H=p.useRef(G);H.current=G,p.useEffect(()=>{q({}),M({})},[G]),p.useEffect(()=>(L.current=!0,()=>{L.current=!1}),[]);function se(X,ie){M(ee=>({...ee,[X]:{...xen(),...ee[X],...ie}}))}async function Y(X){if(!X.toolId||ne.current.has(X.toolId))return;const ie=G;ne.current.add(X.toolId),W.current+=1,se(X.toolId,{busy:!0,error:"",message:""});try{const ee=await D2e(X.kind);if(!L.current||H.current!==ie)return;W.current+=1,q(be=>({...be,[X.toolId]:ee.state})),se(X.toolId,{busy:!1,error:"",message:ee.updated?o("systemInfo.modelEnvUpdated"):o("systemInfo.modelEnvAlreadyCurrent")})}catch{if(!L.current||H.current!==ie)return;W.current+=1,se(X.toolId,{busy:!1,error:o("systemInfo.sandboxUpdateError"),message:""})}finally{ne.current.delete(X.toolId)}}return p.useEffect(()=>{if(!l)return;const X=new AbortController,ie=++W.current;return J(""),Z(!0),P2e(X.signal).then(ee=>{X.signal.aborted||ie!==W.current||q(Object.fromEntries(ee.map(be=>[be.toolId,be])))}).catch(()=>{!X.signal.aborted&&ie===W.current&&J(o("systemInfo.versionCheckError"))}).finally(()=>{X.signal.aborted||Z(!1)}),()=>X.abort()},[l,i,r,A]),p.useEffect(()=>{if(!Object.values(V).some(ie=>ie.status==="Updating"||ie.status==="Creating"))return;const X=window.setTimeout(()=>N(ie=>ie+1),5e3);return()=>window.clearTimeout(X)},[V]),p.useEffect(()=>{if(!l){u(""),f([]),y(!1),x("");return}const X=new AbortController;return y(!0),x(""),PTe(X.signal).then(ie=>{X.signal.aborted||(u(ie.storage.tosAddress),f(ie.sandboxTools))}).catch(ie=>{(ie==null?void 0:ie.name)!=="AbortError"&&x(o("systemInfo.sandboxInfoError"))}).finally(()=>{X.signal.aborted||y(!1)}),()=>X.abort()},[l,i,r,A]),p.useEffect(()=>{if(!l){m([]),k(!1),C("");return}const X=new AbortController;return k(!0),C(""),RD(X.signal).then(ie=>{m(ie.filter(ee=>ee.isCurrent))}).catch(ie=>{if((ie==null?void 0:ie.name)!=="AbortError"){if(t&¥(ie)){m([]);return}C(o("systemInfo.userPoolError"))}}).finally(()=>{X.signal.aborted||k(!1)}),()=>X.abort()},[l,t,P]),p.useEffect(()=>{if(!l){b(null),j(!1),R("");return}const X=new AbortController;return j(!0),R(""),JTe(X.signal).then(b).catch(ie=>{(ie==null?void 0:ie.name)!=="AbortError"&&R(o("systemInfo.environmentResourcesError"))}).finally(()=>{X.signal.aborted||j(!1)}),()=>X.abort()},[l,D]),a.jsxs("div",{className:"system-info-page",children:[a.jsxs("header",{className:"system-info-page-header",children:[a.jsx(ZD,{label:o("common.back"),onClick:s}),a.jsxs("div",{children:[a.jsx("h1",{children:o("systemInfo.title")}),a.jsx("p",{children:o("systemInfo.description")})]})]}),a.jsxs("div",{className:"system-info-scroll",children:[a.jsxs("section",{className:"system-info-section","aria-labelledby":"studio-info-title",children:[a.jsx("h2",{id:"studio-info-title",children:o("systemInfo.general")}),a.jsx("dl",{className:"system-info-summary",children:a.jsxs("div",{children:[a.jsx("dt",{children:o("systemInfo.currentVersion")}),a.jsx("dd",{children:e||"—"})]})})]}),l?a.jsxs(a.Fragment,{children:[a.jsxs("section",{className:"system-info-section","aria-labelledby":"storage-info-title",children:[a.jsx("h2",{id:"storage-info-title",children:o("systemInfo.storage")}),v?a.jsx("div",{className:"system-info-loading",role:"status","aria-live":"polite",children:a.jsx(fn,{as:"span",children:o("systemInfo.loadingStorage")})}):w?a.jsxs("div",{className:"system-info-error",role:"alert",children:[a.jsx("p",{children:w}),a.jsx("button",{type:"button",onClick:()=>N(X=>X+1),children:o("common.reload")})]}):a.jsx("dl",{className:"system-info-summary",children:a.jsxs("div",{className:"system-info-resource-row",children:[a.jsx("dt",{children:o("systemInfo.tosAddress")}),a.jsx("dd",{className:`system-info-resource-value${c?"":" is-empty"}`,children:a.jsx(Mk,{href:men(i,c),label:o("systemInfo.openTosConsole"),children:c||o("common.notConfigured")})})]})})]}),a.jsxs("section",{className:"system-info-section","aria-labelledby":"environment-build-info-title",children:[a.jsx("h2",{id:"environment-build-info-title",children:o("systemInfo.environmentBuild")}),E?a.jsx("div",{className:"system-info-loading",role:"status","aria-live":"polite",children:a.jsx(fn,{as:"span",children:o("systemInfo.loadingEnvironmentResources")})}):T?a.jsxs("div",{className:"system-info-error",role:"alert",children:[a.jsx("p",{children:T}),a.jsx("button",{type:"button",onClick:()=>_(X=>X+1),children:o("common.reload")})]}):g?a.jsxs("dl",{className:"system-info-summary",children:[a.jsxs("div",{className:"system-info-resource-row",children:[a.jsx("dt",{children:o("systemInfo.codePipelineWorkspace")}),a.jsx("dd",{className:"system-info-resource-value",children:a.jsx(Mk,{href:g.codePipeline.consoleUrl||null,label:o("systemInfo.openCodePipelineWorkspace"),children:g.codePipeline.workspaceName||g.codePipeline.workspaceId||o("systemInfo.createdOnFirstBuild")})})]}),a.jsxs("div",{className:"system-info-resource-row",children:[a.jsx("dt",{children:o("systemInfo.codePipelinePipeline")}),a.jsx("dd",{className:"system-info-resource-value",children:g.codePipeline.pipelineName||g.codePipeline.pipelineId||o("systemInfo.createdOnFirstBuild")})]}),a.jsxs("div",{className:"system-info-resource-row",children:[a.jsx("dt",{children:o("systemInfo.containerRegistryRepository")}),a.jsx("dd",{className:"system-info-resource-value",children:a.jsx(Mk,{href:g.containerRegistry.consoleUrl||null,label:o("systemInfo.openContainerRegistryRepository"),children:g.containerRegistry.imageRepository||[g.containerRegistry.registry,g.containerRegistry.namespace,g.containerRegistry.repository].filter(Boolean).join("/")||o("systemInfo.createdOnFirstBuild")})})]})]}):null]}),a.jsxs("section",{className:"system-info-section","aria-labelledby":"sandbox-tool-title",children:[a.jsx("h2",{id:"sandbox-tool-title",children:o("systemInfo.sandboxInfo")}),a.jsx("button",{type:"button",className:"system-info-refresh",disabled:z,onClick:()=>N(X=>X+1),children:o(z?"systemInfo.checkingVersions":"systemInfo.checkUpdates")}),v?a.jsx("div",{className:"system-info-loading",role:"status","aria-live":"polite",children:a.jsx(fn,{as:"span",children:o("systemInfo.loadingSandboxInfo")})}):w?a.jsxs("div",{className:"system-info-error",role:"alert",children:[a.jsx("p",{children:w}),a.jsx("button",{type:"button",onClick:()=>N(X=>X+1),children:o("common.reload")})]}):a.jsxs("div",{className:"system-info-tool-list",children:[U?a.jsx("span",{className:"system-info-inline-error",role:"alert",children:U}):null,d.map(X=>{var pe;const ie=V[X.toolId],ee=F[X.toolId],be=!!X.toolId&&!!(ie!=null&&ie.canUpdate),ue=(ee==null?void 0:ee.error)||(ie!=null&&ie.error?o("systemInfo.versionCheckError"):ie!=null&&ie.modelEnvError?o("systemInfo.modelEnvRepairUnavailable"):"");return a.jsx("dl",{className:"system-info-tool",children:a.jsxs("div",{className:"system-info-resource-row",children:[a.jsxs("dt",{className:"system-info-tool-label",children:[a.jsx("span",{children:X.label}),X.snapshot?a.jsx("span",{className:"system-info-tool-badge",children:o("systemInfo.snapshot")}):null]}),a.jsxs("dd",{className:`system-info-resource-value${X.toolId?"":" is-empty"}`,children:[a.jsx(Mk,{href:gen(i,(ie==null?void 0:ie.region)||r,X.toolId),label:o("systemInfo.openToolConsole",{name:X.label}),children:X.toolId||o("common.notConfigured")}),be?a.jsx("button",{type:"button",className:"system-info-resource-update",disabled:ee==null?void 0:ee.busy,"aria-busy":(ee==null?void 0:ee.busy)||void 0,"aria-label":o("systemInfo.updateSandbox",{name:X.label,variant:X.snapshot?o("systemInfo.snapshotWithSpace"):""}),title:o("systemInfo.updateSandbox",{name:X.label,variant:X.snapshot?o("systemInfo.snapshotWithSpace"):""}),onClick:()=>void Y(X),children:a.jsx(ven,{spinning:(ee==null?void 0:ee.busy)||!1})}):null,ie!=null&&ie.currentImage?a.jsxs("span",{className:"system-info-inline-status",title:`${ie.currentImage} → ${ie.latestImage}`,children:[ie.currentImage.split(":").pop(),ie.needsImageUpdate?` → ${(pe=ie.latestImage)==null?void 0:pe.split(":").pop()}`:"",ie.status==="Updating"?` · ${o("systemInfo.updatingSandbox")}`:""]}):null,ee!=null&&ee.message?a.jsx("span",{className:"system-info-inline-status",role:"status",children:ee.message}):null,ue?a.jsx("span",{className:"system-info-inline-error",role:"alert",children:ue}):null]})]})},X.kind)})]})]}),a.jsxs("section",{className:"system-info-section","aria-labelledby":"user-pool-title",children:[a.jsx("h2",{id:"user-pool-title",children:o("systemInfo.userPool")}),O?a.jsx("div",{className:"system-info-loading",role:"status","aria-live":"polite",children:a.jsx(fn,{as:"span",children:o("systemInfo.loadingUserPool")})}):S?a.jsxs("div",{className:"system-info-error",role:"alert",children:[a.jsx("p",{children:S}),a.jsx("button",{type:"button",onClick:()=>I(X=>X+1),children:o("common.reload")})]}):h.length>0?a.jsx("div",{className:"system-info-pool-list",children:h.map(X=>a.jsxs("dl",{className:"system-info-pool",children:[a.jsxs("div",{children:[a.jsx("dt",{children:o("common.name")}),a.jsx("dd",{className:"system-info-resource-value",children:a.jsx(Mk,{href:ben(i,X.region||r,X.uid),label:o("systemInfo.openUserPoolConsole",{name:X.name||""}),children:X.name||o("systemInfo.unnamedUserPool")})})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("systemInfo.id")}),a.jsx("dd",{children:X.uid||"—"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("systemInfo.domain")}),a.jsx("dd",{children:X.domain||"—"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("systemInfo.region")}),a.jsx("dd",{children:X.region||"—"})]})]},X.uid))}):a.jsx("p",{className:"system-info-empty",children:o(t?"systemInfo.noLocalUserPool":"systemInfo.noUserPool")})]})]}):null]})]})}const Oen="_TextLink_16uec_1",ken={TextLink:Oen},wj=e=>{const{children:t,primary:n=!1,underline:i=!n,className:r,target:s,forceExternal:o,as:l,href:c,to:u,...d}=e,f=o??/^https?:\/\//.test(c??u??""),h=aIe(),m=l||(f?"a":h),g={...d,className:Ui(ken.TextLink,r),"data-primary":n?"":void 0,"data-underline":i?"":void 0};if(!c&&!u)return a.jsx("span",{...g,role:"button",children:t});const b={...f?{target:"_blank",rel:"noopener noreferrer",href:c??u}:{href:c,to:u},...g};return a.jsx(m,{...b,children:t})},Sen="/assets/media/article-agent-workflow-GXPkXUjV.webp",Een="/assets/media/article-tool-debugging-BxiMDz_8.webp",Cen="/assets/media/showcase-a2ui-BgBnE9RT.webp",Aen="/assets/media/showcase-customer-service-DNw0mUH1.webp",Ten="/assets/media/showcase-multimodal-BRTl8NLI.webp",_en="/assets/media/showcase-research-assistant-CbfMFfhS.webp",jen="/assets/media/showcase-web-search-D2kl1imN.webp",Nen={volcengine:{console:"https://console.volcengine.com/agentkit",docs:"https://www.volcengine.com/docs/86681/1844823"},byteplus:{console:"https://console.byteplus.com/agentkit",docs:"https://docs.byteplus.com/en/docs/AgentKit"}};function Ren(e){return Nen[e]}const Ien=[{id:"documentation",titleKey:"developerResources.sections.documentation.title",descriptionKey:"developerResources.sections.documentation.description"},{id:"best-practices",titleKey:"developerResources.sections.bestPractices.title",descriptionKey:"developerResources.sections.bestPractices.description"},{id:"showcases",titleKey:"developerResources.sections.showcases.title",descriptionKey:"developerResources.sections.showcases.description"}],Pen="https://volcengine.github.io/veadk-python/",Den="https://volcengine.github.io/agentkit-sdk-python/content/2.agentkit-cli/1.overview.html",Men=[{id:"veadk-development",titleKey:"developerResources.articles.veadkDevelopment.title",descriptionKey:"developerResources.articles.veadkDevelopment.description",meta:"AgentKit · VeADK",image:Sen,href:"https://docs.volcengine.com/docs/86681/2155817?lang=zh"},{id:"agentkit-cli-development",titleKey:"developerResources.articles.cliDevelopment.title",descriptionKey:"developerResources.articles.cliDevelopment.description",meta:"AgentKit · CLI",image:Een,href:"https://docs.volcengine.com/docs/86681/1844871?lang=zh"}],Len=[{id:"research-assistant",titleKey:"developerResources.showcases.researchAssistant.title",descriptionKey:"developerResources.showcases.researchAssistant.description",image:_en,href:"https://github.com/volcengine/veadk-python/tree/main/examples/06_multi_agent"},{id:"multimodal-analysis",titleKey:"developerResources.showcases.multimodalAnalysis.title",descriptionKey:"developerResources.showcases.multimodalAnalysis.description",image:Ten,href:"https://github.com/volcengine/veadk-python/tree/main/examples/multimodal_agent"},{id:"customer-service",titleKey:"developerResources.showcases.customerService.title",descriptionKey:"developerResources.showcases.customerService.description",image:Aen,href:"https://github.com/volcengine/veadk-python/tree/main/examples/basic-app"},{id:"web-search",titleKey:"developerResources.showcases.webSearch.title",descriptionKey:"developerResources.showcases.webSearch.description",image:jen,href:"https://github.com/volcengine/veadk-python/tree/main/examples/04_web_search"},{id:"a2ui-app",titleKey:"developerResources.showcases.a2uiApp.title",descriptionKey:"developerResources.showcases.a2uiApp.description",image:Cen,href:"https://github.com/volcengine/veadk-python/tree/main/examples/a2ui_agent"}];function $en({cloudProvider:e}){const{t}=Te("workspaceTools"),n=Ren(e);return a.jsxs(kh,{className:"developer-resources","aria-label":t("developerResources.title"),children:[a.jsx(q0,{title:t("developerResources.title")}),a.jsx("div",{className:"developer-resources__content",children:Ien.map(i=>a.jsxs("section",{className:"developer-resources__section","aria-labelledby":`developer-resources-${i.id}`,children:[a.jsxs("header",{className:"developer-resources__section-header",children:[a.jsx("h2",{id:`developer-resources-${i.id}`,children:t(i.titleKey)}),a.jsx("p",{children:t(i.descriptionKey)})]}),i.id==="documentation"?a.jsxs("ul",{className:"developer-resources__links",children:[a.jsx("li",{children:a.jsxs(wj,{className:"developer-resources__link",primary:!0,underline:!0,href:Pen,target:"_blank",rel:"noreferrer",children:[t("developerResources.links.veadkDocs"),a.jsx(s_,{"aria-hidden":"true"})]})}),a.jsx("li",{children:a.jsxs(wj,{className:"developer-resources__link",primary:!0,underline:!0,href:Den,target:"_blank",rel:"noreferrer",children:[t("developerResources.links.cliDocs"),a.jsx(s_,{"aria-hidden":"true"})]})}),a.jsx("li",{children:a.jsxs(wj,{className:"developer-resources__link",primary:!0,underline:!0,href:n.docs,target:"_blank",rel:"noreferrer",children:[t("developerResources.links.platformDocs"),a.jsx(s_,{"aria-hidden":"true"})]})}),a.jsx("li",{children:a.jsxs(wj,{className:"developer-resources__link",primary:!0,underline:!0,href:n.console,target:"_blank",rel:"noreferrer",children:[t("developerResources.links.console"),a.jsx(s_,{"aria-hidden":"true"})]})})]}):i.id==="best-practices"?a.jsx("div",{className:"developer-resources__articles",children:Men.map(r=>a.jsxs("a",{className:"developer-resources__article",href:r.href,target:"_blank",rel:"noreferrer",children:[a.jsx("img",{src:r.image,alt:t("developerResources.articles.coverAlt",{title:t(r.titleKey)}),loading:"lazy"}),a.jsxs("span",{className:"developer-resources__article-copy",children:[a.jsx("strong",{children:t(r.titleKey)}),a.jsx("span",{children:t(r.descriptionKey)}),a.jsx("small",{children:r.meta})]})]},r.id))}):i.id==="showcases"?a.jsx("div",{className:"developer-resources__showcases",children:Len.map(r=>a.jsxs("a",{className:"developer-resources__showcase",href:r.href,target:"_blank",rel:"noreferrer",children:[a.jsx("span",{className:"developer-resources__showcase-media",children:a.jsx("img",{src:r.image,alt:t("developerResources.showcases.previewAlt",{title:t(r.titleKey)}),loading:"lazy"})}),a.jsx("strong",{children:t(r.titleKey)}),a.jsx("span",{children:t(r.descriptionKey)})]},r.id))}):null]},i.id))})]})}function Fen({cloudProvider:e,onPendingCountChange:t,onChanged:n}){const{t:i,i18n:r}=Te("agentReviews"),[s,o]=p.useState(Zi(e)),[l,c]=p.useState([]),[u,d]=p.useState(!0),[f,h]=p.useState(""),[m,g]=p.useState(""),[b,v]=p.useState("all"),[y,w]=p.useState(0),[x,O]=p.useState(null);p.useEffect(()=>{o(Zi(e))},[e]),p.useEffect(()=>{const C=new AbortController;return d(!0),h(""),jXt(s,C.signal).then(E=>{C.signal.aborted||(c(E.items),t(E.items.filter(j=>j.status==="pending").length))}).catch(E=>{C.signal.aborted||h(E instanceof Error?E.message:String(E))}).finally(()=>{C.signal.aborted||d(!1)}),()=>C.abort()},[s,y,t]);const k=p.useMemo(()=>l.filter(C=>(b==="all"||C.status===b)&&`${C.agent.name} ${C.submitter.name}`.toLocaleLowerCase().includes(m.trim().toLocaleLowerCase())),[l,m,b]),S=[{key:"name",header:i("agent"),className:"review-column-name",render:C=>a.jsx("button",{type:"button",className:"agent-review-name",onClick:()=>O(C),children:C.agent.name})},{key:"submitter",header:i("submitter"),render:C=>a.jsx(PP,{person:C.submitter})},{key:"version",header:i("version"),render:C=>C.agent.version??"—"},{key:"submittedAt",header:i("submittedAt"),render:C=>a.jsx("time",{dateTime:C.submittedAt,children:new Date(C.submittedAt).toLocaleString(r.language)})},{key:"status",header:i("statusTitle"),render:C=>a.jsxs("div",{children:[i(`status.${C.status}`),C.reviewer?a.jsx(PP,{person:C.reviewer}):null]})},{key:"actions",header:i("actions"),render:C=>a.jsx("button",{type:"button",onClick:()=>O(C),children:i(C.status==="pending"?"review":"details")})}];return a.jsxs("div",{className:"agent-review-center","aria-label":i("title"),children:[f?a.jsxs("div",{className:"agent-review-error",role:"alert",children:[a.jsx("p",{children:f}),a.jsx("button",{type:"button",onClick:()=>w(C=>C+1),children:i("refresh")})]}):null,a.jsx(yH,{rows:k,rowKey:C=>`${C.region}:${C.id}`,columns:S,searchValue:m,onSearchChange:g,searchPlaceholder:i("search"),searchLabel:i("search"),toolbarActions:a.jsxs(a.Fragment,{children:[a.jsx(ob,{id:"agent-review-region",ariaLabel:i("region"),value:s,options:_u(e),onChange:C=>{o(C),c([]),O(null)}}),a.jsx(ob,{id:"agent-review-status",ariaLabel:i("statusTitle"),value:b,options:["all","pending","approved","returned","withdrawn"].map(C=>({value:C,label:i(C==="all"?"all":`status.${C}`)})),onChange:v}),a.jsx("button",{type:"button",disabled:u,onClick:()=>w(C=>C+1),children:i("refresh")})]}),emptyLabel:u?a.jsx(cl,{}):f?null:a.jsx("p",{className:"agent-review-empty",children:i(m||b!=="all"?"noMatches":"empty")})}),x?a.jsx(l9e,{runtimeId:x.runtimeId,region:x.region,name:x.agent.name,canPublish:!0,onClose:()=>O(null),onChanged:()=>{n==null||n(),w(C=>C+1)}},`${x.region}:${x.id}`):null]})}function Ben({application:e,decision:t,onClose:n,onDecided:i}){const{t:r}=Te("reviews"),[s,o]=p.useState(""),[l,c]=p.useState(e.status==="approving"&&e.comment||""),[u,d]=p.useState(!1),[f,h]=p.useState(!1),m=p.useRef(!1),[g,b]=p.useState(null),v=t==="returned",y=v&&!s.trim(),w=p.useRef(document.activeElement instanceof HTMLElement?document.activeElement:null),x=async()=>{if(!m.current&&(d(!0),!y)){m.current=!0,h(!0),b(null);try{const O=await Ppt({id:e.id,region:e.region,decision:t,reason:s.trim(),comment:l.trim()});i(O)}catch(O){b(Pr(O,r("decision.failed")))}finally{m.current=!1,h(!1)}}};return a.jsx(sv,{open:!0,onOpenChange:O=>{!O&&!m.current&&n()},children:a.jsxs(rv,{children:[a.jsx(nv,{className:"review-backdrop"}),a.jsxs(iv,{className:"confirm-box review-decision",finalFocus:()=>{var O;return(O=w.current)!=null&&O.isConnected?w.current:document.getElementById("review-skill-tab")},children:[a.jsx(yO,{className:"confirm-title",children:r(v?"decision.returnTitle":"decision.approveTitle")}),a.jsx(LT,{className:"confirm-text",children:r(v?"decision.returnDescription":"decision.approveDescription",{name:e.name,version:e.version})}),v?a.jsxs("div",{className:"review-decision__field",children:[a.jsx("label",{className:"cw-label",htmlFor:"review-return-reason",children:r("decision.reason")}),a.jsx("textarea",{id:"review-return-reason",className:"cw-input",rows:4,maxLength:256,required:!0,disabled:f,value:s,onChange:O=>o(O.target.value),onBlur:()=>d(!0),"aria-invalid":u&&y,"aria-describedby":"review-return-help"}),a.jsx("span",{id:"review-return-help",className:u&&y?"cw-error-text":"cw-help",role:u&&y?"alert":void 0,children:r(u&&y?"decision.reasonRequired":"decision.reasonHelp")})]}):null,a.jsxs("div",{className:"review-decision__field",children:[a.jsx("label",{className:"cw-label",htmlFor:"review-decision-comment",children:r("decision.comment")}),a.jsx("textarea",{id:"review-decision-comment",className:"cw-input",rows:3,maxLength:256,disabled:f||e.status==="approving",value:l,onChange:O=>c(O.target.value),"aria-describedby":"review-comment-help"}),a.jsx("span",{id:"review-comment-help",className:"cw-help",children:r("decision.commentHelp")})]}),g?a.jsx("div",{role:"alert",className:"review-decision__error",children:a.jsx(Ns,{error:g})}):null,a.jsxs("div",{className:"confirm-actions",children:[a.jsx(_t,{color:"secondary",variant:"outline",size:"md",pill:!1,disabled:f,onClick:n,children:r("actions.cancel")}),a.jsx(_t,{color:"primary",size:"md",pill:!1,disabled:f||y,onClick:()=>void x(),children:r(f?"decision.saving":v?"actions.confirmReturn":"actions.confirmApprove")})]})]})]})})}const Uen=p.lazy(()=>Zs(()=>Promise.resolve().then(()=>t9t),void 0).then(e=>({default:e.SkillFileTree})));function Qen({application:e,cloudProvider:t,onClose:n,onDecision:i,onScoreChanged:r}){var O;const{t:s,i18n:o}=Te("reviews"),[l,c]=p.useState("overview"),[u,d]=p.useState([]),[f,h]=p.useState(!1),[m,g]=p.useState(null),[b,v]=p.useState(0),y=p.useRef(document.activeElement instanceof HTMLElement?document.activeElement:null);p.useEffect(()=>{if(l!=="files")return;const k=new AbortController;return h(!0),g(null),Ipt({id:e.id,region:e.region,signal:k.signal}).then(S=>{k.signal.aborted||d(S.files)}).catch(S=>{k.signal.aborted||g(Pr(S,s("detail.filesFailed")))}).finally(()=>{k.signal.aborted||h(!1)}),()=>k.abort()},[e.id,e.region,l,b,s]);const w=e.reviewedAt?new Date(e.reviewedAt).toLocaleString(o.language,{hour12:!1}):"—",x=e.submittedAt?new Date(e.submittedAt).toLocaleString(o.language,{hour12:!1}):"—";return a.jsx(sv,{open:!0,onOpenChange:k=>{k||n()},children:a.jsxs(rv,{children:[a.jsx(nv,{className:"review-backdrop"}),a.jsxs(iv,{className:"review-drawer",finalFocus:()=>{var k;return(k=y.current)!=null&&k.isConnected?y.current:document.getElementById("review-skill-tab")},children:[a.jsxs("header",{className:"review-drawer__header",children:[a.jsxs("div",{children:[a.jsx(yO,{children:s("detail.title")}),a.jsx(LT,{children:s("detail.versionFixed")})]}),a.jsx(hL,{className:"review-icon-button","aria-label":s("actions.close"),children:a.jsx(xT,{})})]}),a.jsxs("div",{className:"review-drawer__identity",children:[a.jsx("span",{className:"review-resource-icon",children:a.jsx(gIe,{})}),a.jsxs("div",{children:[a.jsx("h2",{children:e.name}),a.jsxs("span",{children:[s("kind.skill")," · ",e.version]})]}),a.jsx($T,{status:e.status})]}),a.jsx(ab,{className:"review-drawer__tabs",idPrefix:"review-detail",ariaLabel:s("detail.sections"),value:l,items:[{id:"overview",label:s("detail.overview"),panelId:"review-detail-panel"},{id:"files",label:s("detail.filesTab"),panelId:"review-detail-panel"},{id:"score",label:s("score.title"),panelId:"review-detail-panel"}],onChange:c}),a.jsx("div",{className:"review-drawer__body",id:"review-detail-panel",role:"tabpanel","aria-labelledby":`review-detail-${l}-tab`,children:l==="score"?a.jsx(NFe,{application:e,canRetry:!0,onScoreChanged:r},`${e.region}:${e.id}`):l==="files"?f?a.jsx(cl,{}):m?a.jsxs("div",{role:"alert",children:[a.jsx(Ns,{error:m}),a.jsx("button",{type:"button",onClick:()=>v(k=>k+1),children:s("space.retry")})]}):a.jsx("div",{className:"review-files",children:a.jsx(p.Suspense,{fallback:a.jsx(cl,{}),children:a.jsx(Uen,{files:u})})}):a.jsxs(a.Fragment,{children:[a.jsxs("dl",{className:"review-facts",children:[a.jsxs("div",{children:[a.jsx("dt",{children:s("columns.submitter")}),a.jsx("dd",{children:e.author||s("detail.unknownAuthor")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("columns.submittedAt")}),a.jsx("dd",{children:x})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("columns.version")}),a.jsx("dd",{children:e.version})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("detail.source")}),a.jsx("dd",{children:s("detail.source_skill",{name:e.author})})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("detail.destination")}),a.jsx("dd",{children:s("detail.destination_skill")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("detail.region")}),a.jsx("dd",{children:wh(e.region,t)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:s("detail.visibility")}),a.jsx("dd",{children:s("detail.shared")})]})]}),a.jsxs("section",{className:"review-detail-section",children:[a.jsx("h3",{children:s("detail.description")}),a.jsx("p",{children:e.description||"—"})]}),a.jsxs("section",{className:"review-detail-section",children:[a.jsx("h3",{children:s("detail.result")}),a.jsx(QW,{application:e})]}),a.jsxs("section",{className:"review-detail-section review-history",children:[a.jsx("h3",{children:s("detail.history")}),a.jsxs("div",{children:[a.jsx("span",{className:"review-history__dot","aria-hidden":"true"}),a.jsxs("p",{children:[a.jsx("strong",{children:s("detail.submitted",{name:e.author})}),a.jsx("span",{children:x})]})]}),e.reviewedAt?a.jsxs("div",{children:[a.jsx("span",{className:"review-history__dot","aria-hidden":"true"}),a.jsxs("p",{children:[a.jsx("strong",{children:s(`detail.${e.status==="approved"?"approved":e.status==="returned"?"returned":"approving"}`,{name:((O=e.reviewer)==null?void 0:O.name)||e.reviewedBy||s("detail.unknownReviewer")})}),a.jsx("span",{children:w})]})]}):null]})]})}),a.jsxs("footer",{className:"review-drawer__footer",children:[e.status==="pending"?a.jsx(_t,{color:"secondary",variant:"outline",size:"md",pill:!1,onClick:()=>i("returned"),children:s("actions.return")}):null,e.status==="pending"||e.status==="approving"?a.jsx(_t,{color:"primary",size:"md",pill:!1,onClick:()=>i("approved"),children:s(e.status==="approving"?"actions.resumeApproval":"actions.approve")}):a.jsx("span",{children:s(`status.${e.status}`)})]})]})]})})}function zen({cloudProvider:e,onAgentChanged:t}){const{t:n,i18n:i}=Te("reviews"),[r,s]=p.useState([]),[o,l]=p.useState(null),[c,u]=p.useState("skill"),[d,f]=p.useState(Zi(e)),[h,m]=p.useState(!0),[g,b]=p.useState(null),[v,y]=p.useState(0),[w,x]=p.useState("all"),[O,k]=p.useState(""),[S,C]=p.useState(null),[E,j]=p.useState(null),[T,R]=p.useState(""),A=(D,_,L=!1)=>{C(null),R(""),j({application:D,value:_,fromDetails:L})};p.useEffect(()=>{if(c!=="skill")return;const D=new AbortController;let _,L=!1,F=!1;m(!0),b(null);const M=async()=>{if(!(L||D.signal.aborted)){L=!0;try{const q=await Rpt({region:d,signal:D.signal});if(D.signal.aborted)return;s(q.items),C(U=>U&&q.items.find(J=>J.id===U.id)||null),F=q.items.some(U=>jFe(U.aiReview)),F&&document.visibilityState!=="hidden"&&(_=setTimeout(()=>void M(),5e3))}catch(q){D.signal.aborted||b(Pr(q,n("space.failed"))),F=!1}finally{L=!1,D.signal.aborted||m(!1)}}},V=()=>{clearTimeout(_),F&&document.visibilityState!=="hidden"&&M()};return M(),document.addEventListener("visibilitychange",V),()=>{D.abort(),clearTimeout(_),document.removeEventListener("visibilitychange",V)}},[d,c,v,n]);const N=h9t(r,c,w,O),P=!!O.trim()||w!=="all",I=[{key:"name",header:n("columns.application"),className:"review-column-name",render:D=>a.jsxs("div",{className:"review-name",children:[a.jsx("span",{className:"review-resource-icon",children:a.jsx(gIe,{})}),a.jsx("div",{children:a.jsx("button",{type:"button",title:D.name,onClick:()=>C(D),children:D.name})})]})},{key:"submitter",header:n("columns.submitter"),className:"review-column-submitter",render:D=>D.author||n("detail.unknownAuthor")},{key:"version",header:n("columns.version"),className:"review-column-version",render:D=>D.version},{key:"submitted",header:n("columns.submittedAt"),className:"review-column-time",render:D=>D.submittedAt?a.jsx("time",{dateTime:D.submittedAt,title:new Date(D.submittedAt).toLocaleString(i.language),children:new Date(D.submittedAt).toLocaleString(i.language,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1})}):"—"},{key:"status",header:n("columns.status"),className:"review-column-status",render:D=>a.jsxs("div",{className:"review-table-outcome",children:[a.jsx($T,{status:D.status}),D.reviewer||D.reviewedBy?a.jsx(UW,{compact:!0,person:D.reviewer,fallback:D.reviewedBy}):null]})},{key:"score",header:n("score.title"),className:"review-column-score",render:D=>a.jsx(BW,{score:D.aiReview})},{key:"actions",header:n("columns.actions"),className:"review-column-actions",render:D=>a.jsxs("div",{className:"review-row-actions",children:[a.jsx("button",{type:"button",onClick:()=>C(D),"aria-label":n("actions.detailsFor",{name:D.name}),children:n("actions.details")}),D.status==="pending"||D.status==="approving"?a.jsx("button",{type:"button",onClick:()=>A(D,"approved"),children:n(D.status==="approving"?"actions.resumeApproval":"actions.approve")}):null,D.status==="pending"?a.jsx("button",{type:"button",onClick:()=>A(D,"returned"),children:n("actions.return")}):null]})}];return a.jsxs(kh,{className:"review-center","aria-label":n("title"),children:[a.jsx(q0,{title:n("title")}),a.jsx(sb,{children:a.jsx(ab,{idPrefix:"review",ariaLabel:n("category"),value:c,items:["skill","agent"].map(D=>({id:D,label:a.jsxs(a.Fragment,{children:[n(`kind.${D}`),D==="agent"?o===null?null:a.jsx("span",{className:"review-tab-count",children:o}):a.jsx("span",{className:"review-tab-count",children:r.filter(_=>_.kind===D&&(_.status==="pending"||_.status==="approving")).length})]}),panelId:"review-requests-panel"})),onChange:D=>{u(D),x("all"),k(""),C(null)}})}),a.jsx("div",{className:"review-center__panel",id:"review-requests-panel",role:"tabpanel","aria-labelledby":`review-${c}-tab`,children:c==="agent"?a.jsx(Fen,{cloudProvider:e,onPendingCountChange:l,onChanged:t}):a.jsxs(a.Fragment,{children:[c==="skill"&&g?a.jsxs("div",{role:"alert",children:[a.jsx(Ns,{error:g}),a.jsx("button",{type:"button",onClick:()=>y(D=>D+1),children:n("space.retry")})]}):null,T?a.jsx("p",{role:"status",className:"review-notice",children:T}):null,a.jsx(yH,{rows:N,rowKey:D=>D.id,columns:I,searchValue:O,onSearchChange:k,searchPlaceholder:n("search"),searchLabel:n("search"),toolbarActions:a.jsxs(a.Fragment,{children:[c==="skill"?a.jsxs(a.Fragment,{children:[a.jsx(ob,{id:"review-region",ariaLabel:n("detail.region"),value:d,options:_u(e),onChange:D=>{s([]),C(null),f(D)}}),a.jsx("button",{type:"button",disabled:h,onClick:()=>y(D=>D+1),children:n("actions.refresh")})]}):null,a.jsx(ob,{id:"review-status",ariaLabel:n("filterStatus"),value:w,options:["all","pending","approving","approved","returned"].map(D=>({value:D,label:n(`status.${D}`)})),onChange:x})]}),emptyLabel:c==="skill"&&h?a.jsx(cl,{}):c==="skill"&&g?null:a.jsxs("div",{className:"review-empty",children:[a.jsx("strong",{children:n(P?"empty.filteredTitle":"empty.title")}),a.jsx("span",{children:n(P?"empty.filteredDescription":"empty.description")}),P?a.jsx("button",{type:"button",onClick:()=>{k(""),x("all")},children:n("actions.clearFilters")}):null]})}),a.jsx("div",{className:"review-center__count",children:n("total",{count:N.length})})]})}),S?a.jsx(Qen,{application:S,cloudProvider:e,onClose:()=>C(null),onDecision:D=>A(S,D,!0),onScoreChanged:(D,_)=>{const L=E9t(D);s(F=>F.map(M=>M.id===S.id?{...M,aiReview:L}:M)),_&&y(F=>F+1)}},S.id):null,E?a.jsx(Ben,{application:E.application,decision:E.value,onClose:()=>{E.fromDetails&&C(E.application),j(null),y(D=>D+1)},onDecided:D=>{s(_=>_.map(L=>L.id===D.id?D:L)),E.fromDetails&&C(D),R(n(D.status==="approved"?"decision.approved":"decision.returned",{name:D.name})),j(null)}},`${E.application.id}:${E.value}`):null]})}function Ven({role:e,cloudProvider:t,onAgentChanged:n}){const{t:i}=Te("reviews");return e!=="admin"&&e!=="super_admin"?a.jsxs(kh,{className:"review-center",children:[a.jsx(q0,{title:i("title")}),a.jsx("p",{role:"status",children:i("adminOnly")})]}):a.jsx(zen,{cloudProvider:t,onAgentChanged:n},t)}const Oj=10;function Hen(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"m9.8 3.5-4.5 4.5 4.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function qen({hidden:e,...t}){return a.jsxs("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[a.jsx("path",{d:"M2.5 10s2.6-4 7.5-4 7.5 4 7.5 4-2.6 4-7.5 4-7.5-4-7.5-4Z"}),a.jsx("circle",{cx:"10",cy:"10",r:"1.8"}),e?a.jsx("path",{d:"m4 4 12 12"}):null]})}function ry(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M6.5 4H4.8A1.8 1.8 0 0 0 3 5.8v5.4A1.8 1.8 0 0 0 4.8 13h5.4a1.8 1.8 0 0 0 1.8-1.8V9.5M9 3h4v4M12.5 3.5 7.2 8.8",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function Wen(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"m4 6 4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ken(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"m3.5 8.2 2.8 2.8 6.2-6.2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Lk(e,t,n){const i=t.trim();if(!i)return n?"github.validation.required":"";if(e==="repository"&&!/^(?:https:\/\/github\.com\/)?[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+(?:\.git)?$/.test(i))return"github.validation.repository";if(e==="baseBranch"&&(!/^[A-Za-z0-9][A-Za-z0-9._/-]*$/.test(i)||i.includes("..")))return"github.validation.baseBranch";if(e==="projectPath"&&(i.startsWith("/")||i.split("/").includes("..")))return"github.validation.projectPath";if(e==="runtimeName")return ov(i,r=>`github.validation.runtimeName.${r}`)??"";if(e==="runtimeId"&&!/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/.test(i))return"github.validation.runtimeId";if(e==="modelName"&&!/^[A-Za-z0-9][A-Za-z0-9._:/-]{0,127}$/.test(i))return"github.validation.modelName";if(e==="modelBaseUrl")try{const r=new URL(i);if(r.protocol!=="https:"||r.username||r.password||r.search||r.hash)return"github.validation.modelBaseUrlSafe"}catch{return"github.validation.modelBaseUrl"}return e==="pullRequestUrl"&&!/^https:\/\/github\.com\/[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+\/pull\/[1-9][0-9]*\/?$/.test(i)?"请输入完整的 GitHub Pull Request URL":""}function Gen(e){try{return`https://github.com/${kK(e)}`}catch{return""}}function Xen(e){return e==="started"?"评审中":e==="completed"?"已完成":e==="ignored"?"已忽略":"失败"}function Yen(e){return e==="webhook"?"自动触发":"手动发起"}function Zen(e){return e.reason?e.status!=="ignored"?e.reason:e.reason==="repository-review-disabled"?"忽略原因:仓库未开启自动评审":e.reason==="pull-request-not-reviewable"?"忽略原因:该 PR 事件不需要评审,仅评审新建、更新、重新打开和转为可评审的非 Draft、非 fork PR":e.reason==="review-settings-unavailable"?"忽略原因:自动评审设置不可用":e.reason==="unsupported-event"?"忽略原因:不是 Pull Request 事件":`忽略原因:${e.reason}`:""}function Jen(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}function ole(e,t,n,i){if(n===0)return`第 ${e} 页`;const r=(e-1)*t+1,s=r+n-1;return`第 ${e} 页 · ${r}-${s}${i?"+":""}`}function etn({automation:e,cloudProvider:t,onBack:n,onOpenSandboxSession:i}){const{t:r}=Te("automations"),s=_Jt(e),o=e==="review",l=_u(t),c=s.secrets({cloudProvider:t}),[u,d]=p.useState(()=>({...s.initialValues({cloudProvider:t})})),f=l.find(Xe=>Xe.value===u.region),[h,m]=p.useState({}),[g,b]=p.useState(""),[v,y]=p.useState(!1),[w,x]=p.useState(!1),[O,k]=p.useState(!1),[S,C]=p.useState(null),[E,j]=p.useState(""),[T,R]=p.useState(null),[A,N]=p.useState(""),[P,I]=p.useState(!1),[D,_]=p.useState(null),[L,F]=p.useState(""),[M,V]=p.useState(o),[q,U]=p.useState([]),[J,z]=p.useState(o),[Z,ne]=p.useState(""),[W,G]=p.useState(null),[H,se]=p.useState(1),[Y,X]=p.useState(!1),[ie,ee]=p.useState(""),[be,ue]=p.useState(""),[pe,ke]=p.useState(""),[je,Pe]=p.useState([]),[Ee,ze]=p.useState(o),[_e,ae]=p.useState(""),[le,ge]=p.useState(null),[Oe,Se]=p.useState(1),[We,Ye]=p.useState(!1),ye=p.useRef(null),we=p.useRef(null),Ae=p.useRef(null),He=p.useRef(null),Ue=p.useRef(null),jt=Gen(u.repository),Pt=jt.replace("https://github.com/",""),Kt=jt?`${jt}/settings/secrets/actions`:"",Ct=(D==null?void 0:D.appSlug)||"agentkit-veadk-studio",xt=(D==null?void 0:D.installUrl)||`https://github.com/apps/${Ct}/installations/new`,tt=ile(E),mt=q.filter(Xe=>Xe.reviewEnabled),Ne=tt?q.find(Xe=>Xe.fullName.toLowerCase()===tt.toLowerCase()):void 0,Ot=H>1||Y,Nt=Oe>1||We;p.useEffect(()=>()=>{var Xe,wt,vt,tn,Qt;(Xe=ye.current)==null||Xe.abort(),(wt=we.current)==null||wt.abort(),(vt=Ae.current)==null||vt.abort(),(tn=He.current)==null||tn.abort(),(Qt=Ue.current)==null||Qt.abort()},[]),p.useEffect(()=>{var Xe,wt,vt;d({...s.initialValues({cloudProvider:t})}),m({}),b(""),C(null),k(!1),(Xe=ye.current)==null||Xe.abort(),(wt=we.current)==null||wt.abort(),(vt=Ue.current)==null||vt.abort(),R(null),N(""),Pe([]),ae(""),ge(null),se(1),X(!1),ee(""),ue(""),Se(1),Ye(!1)},[e,t,s]),p.useEffect(()=>{var wt;if(!o)return;(wt=Ae.current)==null||wt.abort();const Xe=new AbortController;Ae.current=Xe,V(!0),F(""),cJt(Xe.signal).then(vt=>{Ae.current===Xe&&(_(vt),vt.configured||(z(!1),ze(!1)))}).catch(vt=>{Xe.signal.aborted||Ae.current!==Xe||(F(vt instanceof Error?vt.message:String(vt)),z(!1),ze(!1))}).finally(()=>{Ae.current===Xe&&(Ae.current=null,V(!1))})},[o]);const Yt=(Xe=H,wt=be)=>{var tn;(tn=He.current)==null||tn.abort();const vt=new AbortController;He.current=vt,z(!0),ne(""),uJt(vt.signal,{page:Xe,pageSize:Oj,query:wt}).then(Qt=>{if(He.current===vt){if(Qt.repositories.length===0&&Qt.page>1){se(Qt.page-1),Yt(Qt.page-1);return}U(Qt.repositories),se(Qt.page),X(Qt.hasNextPage),G({reviewSettingsConfigured:Qt.reviewSettingsConfigured,reviewSettingsReason:Qt.reviewSettingsReason})}}).catch(Qt=>{vt.signal.aborted||He.current!==vt||ne(Qt instanceof Error?Qt.message:String(Qt))}).finally(()=>{He.current===vt&&(He.current=null,z(!1))})},xn=(Xe=Oe)=>{var vt;(vt=Ue.current)==null||vt.abort();const wt=new AbortController;Ue.current=wt,ze(!0),ae(""),dJt(wt.signal,{page:Xe,pageSize:Oj}).then(tn=>{if(Ue.current===wt){if(tn.records.length===0&&tn.page>1){Se(tn.page-1),xn(tn.page-1);return}Pe(tn.records),Se(tn.page),Ye(tn.hasNextPage),ge({reviewSettingsConfigured:tn.reviewSettingsConfigured,reviewSettingsReason:tn.reviewSettingsReason})}}).catch(tn=>{wt.signal.aborted||Ue.current!==wt||ae(tn instanceof Error?tn.message:String(tn))}).finally(()=>{Ue.current===wt&&(Ue.current=null,ze(!1))})};p.useEffect(()=>{!o||(D==null?void 0:D.configured)!==!0||(Yt(1),xn(1))},[D==null?void 0:D.configured,o]);const Ke=()=>{const Xe=ie.trim();ue(Xe),se(1),Yt(1,Xe)},St=()=>{ee(""),ue(""),se(1),Yt(1,"")},qe=(Xe,wt)=>{if(!(wt<1)){if(Xe==="repositories"){se(wt),Yt(wt,be);return}Se(wt),xn(wt)}},nt=async Xe=>{if((W==null?void 0:W.reviewSettingsConfigured)!==!0||pe)return;const wt=new AbortController;ke(Xe.fullName),ne("");try{const vt=await fJt({repository:Xe.fullName,reviewEnabled:!Xe.reviewEnabled},wt.signal),tn=new Set(vt.map(Qt=>Qt.toLowerCase()));U(Qt=>Qt.map(cn=>({...cn,reviewEnabled:tn.has(cn.fullName.toLowerCase())})))}catch(vt){ne(vt instanceof Error?vt.message:String(vt))}finally{ke("")}},et=(Xe,wt)=>{d(vt=>({...vt,[Xe]:wt})),h[Xe]&&m(vt=>({...vt,[Xe]:""}))},ft=Xe=>{var Qt;const wt=!o&&Xe==="token"||Xe==="pullRequestUrl"||((Qt=s.fields.find(cn=>cn.name===Xe))==null?void 0:Qt.required)===!0,vt=Xe==="pullRequestUrl"?E:u[Xe],tn=Lk(Xe,vt,wt);m(cn=>({...cn,[Xe]:tn}))},Et=async Xe=>{var tn;if(Xe.preventDefault(),o)return;const wt={};for(const Qt of s.fields){const cn=Lk(Qt.name,u[Qt.name],Qt.required);cn&&(wt[Qt.name]=cn)}if(!o){const Qt=Lk("token",u.token,!0);Qt&&(wt.token=Qt)}if(m(wt),Object.keys(wt).length)return;(tn=ye.current)==null||tn.abort();const vt=new AbortController;ye.current=vt,y(!0),b(""),C(null);try{const Qt=await s.submit(u,{cloudProvider:t},vt.signal);if(ye.current!==vt)return;C(Qt),d(cn=>({...cn,token:""}))}catch(Qt){if(vt.signal.aborted||ye.current!==vt)return;b(Qt instanceof Error?Qt.message:String(Qt))}finally{ye.current===vt&&(ye.current=null,y(!1))}},At=Xe=>{Xe.key==="Enter"&&(Xe.nativeEvent.isComposing||Xe.nativeEvent.keyCode===229)&&Xe.preventDefault()},It=async()=>{var tn;const Xe={},wt=Lk("pullRequestUrl",E,!0);if(wt&&(Xe.pullRequestUrl=wt),!wt){const Qt=ile(E),cn=q.find(Me=>Me.fullName.toLowerCase()===Qt.toLowerCase());cn?cn.reviewEnabled||(Xe.pullRequestUrl=`请先在下方开启 ${cn.fullName} 的评审`):Xe.pullRequestUrl="PR URL 所属仓库尚未安装 GitHub App"}if(m(Xe),Object.keys(Xe).length)return;(tn=we.current)==null||tn.abort();const vt=new AbortController;we.current=vt,I(!0),N(""),R(null);try{const Qt=await lJt({pullRequestUrl:E.trim()},vt.signal);if(we.current!==vt)return;R(Qt),d(cn=>({...cn,token:""})),xn(),i==null||i(Qt.sessionId)}catch(Qt){if(vt.signal.aborted||we.current!==vt)return;N(Qt instanceof Error?Qt.message:String(Qt))}finally{we.current===vt&&(we.current=null,I(!1))}},Gt=Xe=>{const{name:wt,placeholder:vt,required:tn}=Xe,Qt=wt==="repository",cn=`cards.${e}.fields.${wt}`;return a.jsxs("div",{className:"github-field",children:[a.jsxs("div",{className:"github-field-label-row",children:[a.jsxs("label",{htmlFor:`github-${wt}`,children:[a.jsx("span",{children:r(`${cn}.label`)}),a.jsx("span",{className:`github-field-requirement${tn?" is-required":""}`,children:r(tn?"github.required":"github.optional")})]}),Qt?a.jsxs("a",{className:"github-field-action",href:"https://github.com/",target:"_blank",rel:"noreferrer",children:["https://github.com/",a.jsx(ry,{})]}):null]}),a.jsx("input",{id:`github-${wt}`,value:u[wt],onChange:Me=>et(wt,Me.target.value),onBlur:()=>ft(wt),placeholder:r(`${cn}.placeholder`,{defaultValue:vt}),required:tn,"aria-invalid":!!h[wt],"aria-describedby":`github-${wt}-help${h[wt]?` github-${wt}-error`:""}`}),a.jsx("span",{id:`github-${wt}-help`,className:"github-field-help",children:Qt&&Pt?o?r("github.repositoryReviewHelp",{repository:Pt}):r("github.repositoryConfigHelp",{repository:Pt}):r(`${cn}.help`)}),h[wt]?a.jsx("span",{id:`github-${wt}-error`,className:"github-field-error",role:"alert",children:r(h[wt])}):null]},wt)};return a.jsxs("div",{className:"github-integration-page",children:[a.jsxs("header",{className:"github-integration-header",children:[a.jsx("button",{type:"button",className:"github-back",onClick:n,"aria-label":r("backToAutomations"),children:a.jsx(Hen,{})}),a.jsx(bK,{className:"github-integration-logo"}),a.jsxs("div",{children:[a.jsx("h1",{children:r(`cards.${e}.title`)}),a.jsx("p",{children:r(`cards.${e}.subtitle`)})]})]}),a.jsx("div",{className:"github-integration-layout",children:a.jsxs("section",{id:`github-panel-${e}`,className:"github-section-panel",children:[a.jsx("div",{className:"github-panel-heading",children:a.jsx("p",{children:r(`cards.${e}.panel`)})}),a.jsxs("form",{className:"github-release-form",onSubmit:Et,onKeyDown:At,noValidate:!0,children:[o?null:a.jsxs("div",{className:"github-field-grid",children:[s.fields.map(Gt),a.jsxs("div",{className:"github-field",children:[a.jsxs("label",{id:"github-region-label",children:[a.jsx("span",{children:r("github.region")}),a.jsx("span",{className:"github-field-requirement is-required",children:r("github.required")})]}),a.jsxs("div",{className:"pp-network-region github-region-picker",onKeyDown:Xe=>{Xe.key==="Escape"&&k(!1)},children:[a.jsxs("button",{type:"button",className:"pp-region-trigger","aria-labelledby":"github-region-label","aria-haspopup":"listbox","aria-expanded":O,onClick:()=>k(Xe=>!Xe),children:[a.jsx("span",{children:(f==null?void 0:f.label)??u.region}),a.jsx(Wen,{className:`pp-region-chevron${O?" is-open":""}`})]}),O?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"menu-scrim",onClick:()=>k(!1)}),a.jsx("div",{className:"pp-region-menu",role:"listbox","aria-label":r("github.region"),children:l.map(Xe=>{const wt=Xe.value===u.region;return a.jsxs("button",{type:"button",role:"option","aria-selected":wt,className:`pp-region-option${wt?" is-selected":""}`,onClick:()=>{et("region",Xe.value),k(!1)},children:[a.jsx("span",{children:Xe.label}),wt?a.jsx(Ken,{}):null]},Xe.value)})})]}):null]}),a.jsx("span",{className:"github-field-help",children:r(`cards.${e}.regionHelp`)})]})]}),o?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`github-app-card${D!=null&&D.configured?" is-ready":""}`,children:[a.jsxs("div",{children:[a.jsx("strong",{children:"GitHub App 授权"}),a.jsx("span",{children:M?"正在检查中心服务配置...":D!=null&&D.configured?`安装 ${Ct} 到目标仓库后,可在下方开启自动评审。`:L||(D==null?void 0:D.reason)||"管理员未配置 GitHub App。"})]}),a.jsxs("a",{className:"github-app-install-link",href:xt,target:"_blank",rel:"noreferrer",children:["安装 GitHub App",a.jsx(ry,{})]})]}),a.jsxs("section",{className:"github-review-section github-app-repositories","aria-labelledby":"github-app-repositories-title",children:[a.jsxs("div",{className:"github-review-section-header",children:[a.jsxs("div",{children:[a.jsx("h2",{id:"github-app-repositories-title",children:"已安装仓库"}),a.jsx("p",{children:"只有开启评审的仓库会响应 GitHub webhook 自动触发。"})]}),a.jsx("button",{type:"button",onClick:()=>Yt(),disabled:!(D!=null&&D.configured)||J,children:J?"刷新中...":"刷新"})]}),Z?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:Z}):null,(W==null?void 0:W.reviewSettingsConfigured)===!1&&!Z?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:W.reviewSettingsReason||"管理员未配置 Studio 持久化存储,无法保存启用评审设置。"}):null,a.jsxs("div",{className:"github-app-repository-search",children:[a.jsx("input",{type:"search",value:ie,onChange:Xe=>ee(Xe.target.value),onKeyDown:Xe=>{Xe.key==="Enter"&&(Xe.preventDefault(),Ke())},placeholder:"搜索 owner 或仓库名","aria-label":"搜索已安装仓库"}),a.jsx("button",{type:"button",onClick:Ke,disabled:!(D!=null&&D.configured)||J,children:"搜索"}),be?a.jsx("button",{type:"button",onClick:St,disabled:J,children:"清除"}):null]}),J&&q.length===0?a.jsx("div",{className:"github-app-repository-empty",children:"正在读取 GitHub App 安装仓库..."}):null,!J&&q.length===0&&!Z?a.jsx("div",{className:"github-app-repository-empty",children:be?`没有匹配 “${be}” 的已安装仓库。`:"GitHub App 尚未安装到任何仓库。"}):null,q.length>0?a.jsx("div",{className:"github-app-repository-list",children:q.map(Xe=>{const wt=pe===Xe.fullName,vt=(W==null?void 0:W.reviewSettingsConfigured)!==!0||!!pe;return a.jsxs("div",{className:"github-app-repository-row",children:[a.jsxs("div",{className:"github-app-repository-main",children:[a.jsxs("a",{href:Xe.htmlUrl,target:"_blank",rel:"noreferrer",title:Xe.fullName,children:[Xe.fullName,a.jsx(ry,{})]}),a.jsxs("span",{children:[Xe.private?"Private":"Public"," · Installation ",Xe.installationId]})]}),a.jsx("button",{type:"button",className:`github-review-switch${Xe.reviewEnabled?" is-on":""}`,role:"switch","aria-checked":Xe.reviewEnabled,disabled:vt,onClick:()=>{nt(Xe)},children:a.jsx("span",{children:wt?"保存中":Xe.reviewEnabled?"已启用":"未启用"})})]},Xe.fullName)})}):null,Ot?a.jsxs("div",{className:"github-list-pagination","aria-label":"已安装仓库分页",children:[a.jsx("span",{children:ole(H,Oj,q.length,Y)}),a.jsxs("div",{children:[a.jsx("button",{type:"button",onClick:()=>qe("repositories",H-1),disabled:H<=1||J,children:"上一页"}),a.jsx("button",{type:"button",onClick:()=>qe("repositories",H+1),disabled:!Y||J,children:"下一页"})]})]}):null]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"github-field github-token-field",children:[a.jsxs("div",{className:"github-token-label-row",children:[a.jsxs("label",{htmlFor:"github-token",children:[a.jsx("span",{children:r("github.tokenLabel")}),a.jsx("span",{className:"github-field-requirement is-required",children:r("github.required")})]}),a.jsxs("a",{className:"github-field-action",href:"https://github.com/settings/personal-access-tokens/new?name=VeADK%20Studio&description=Create%20a%20GitHub%20automation%20pull%20request&contents=write&pull_requests=write&workflows=write",target:"_blank",rel:"noreferrer",children:[r("github.createToken"),a.jsx(ry,{})]})]}),a.jsxs("div",{className:"github-token-input",children:[a.jsx("input",{id:"github-token",type:w?"text":"password",value:u.token,onChange:Xe=>et("token",Xe.target.value),onBlur:()=>ft("token"),autoComplete:"off",required:!0,placeholder:r("github.tokenWorkflowPlaceholder"),"aria-invalid":!!h.token,"aria-describedby":`github-token-help${h.token?" github-token-error":""}`}),a.jsx("button",{type:"button",onClick:()=>x(Xe=>!Xe),"aria-label":r(w?"github.hideToken":"github.showToken"),title:r(w?"github.hideToken":"github.showToken"),children:a.jsx(qen,{hidden:w})})]}),a.jsx("span",{id:"github-token-help",className:"github-field-help",children:r("github.tokenWorkflowHelp")}),h.token?a.jsx("span",{id:"github-token-error",className:"github-field-error",role:"alert",children:r(h.token)}):null]}),g?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:g}):null,S?a.jsxs("div",{className:"github-submit-message is-success github-result-message",role:"status",children:[a.jsxs("div",{children:[a.jsx("strong",{children:r("github.configPrCreated",{number:S.number})}),a.jsx("span",{children:r("github.configPrNextStep")})]}),a.jsxs("a",{className:"github-result-link",href:S.url,target:"_blank",rel:"noreferrer",children:[r("github.viewConfigPr"),a.jsx(ry,{})]})]}):null,a.jsxs("div",{className:"github-form-actions",children:[a.jsxs("div",{className:"github-secrets-note",children:[a.jsxs("div",{className:"github-secrets-header",children:[a.jsx("strong",{children:r("github.secretsConfigHeading")}),Kt?a.jsxs("a",{className:"github-secrets-link",href:Kt,target:"_blank",rel:"noreferrer",children:[r("github.openSecrets"),a.jsx(ry,{})]}):null]}),a.jsx("span",{className:"github-secrets-path",children:r("github.secretsPath")}),a.jsx("ul",{children:c.map(Xe=>{const[wt,...vt]=Xe.split(":");return a.jsxs("li",{children:[a.jsx("code",{children:wt}),vt.length?a.jsx("span",{children:vt.join(":")}):null]},Xe)})})]}),a.jsx("button",{type:"submit",disabled:v,children:r(v?"github.submitting":`cards.${e}.submitLabel`)})]})]})]}),o?a.jsxs("div",{className:"github-pr-review-sections",children:[a.jsxs("section",{className:"github-review-section github-review-now","aria-labelledby":"github-review-now-title",children:[a.jsx("div",{className:"github-review-section-header",children:a.jsxs("div",{children:[a.jsx("h2",{id:"github-review-now-title",children:"立刻评审"}),a.jsx("p",{children:"输入已安装且已启用仓库的 PR URL,立即创建 Sandbox 评审任务。"})]})}),a.jsxs("div",{className:"github-review-section-body",children:[a.jsxs("div",{className:"github-field",children:[a.jsx("input",{id:"github-pull-request-url","aria-label":"Pull Request URL",value:E,onChange:Xe=>{j(Xe.target.value),h.pullRequestUrl&&m(wt=>({...wt,pullRequestUrl:""}))},onBlur:()=>m(Xe=>({...Xe,pullRequestUrl:Lk("pullRequestUrl",E,!0)})),placeholder:"https://github.com/owner/repository/pull/123","aria-invalid":!!h.pullRequestUrl,"aria-describedby":h.pullRequestUrl?"github-pull-request-url-error":void 0}),h.pullRequestUrl?a.jsx("span",{id:"github-pull-request-url-error",className:"github-field-error",role:"alert",children:h.pullRequestUrl}):null,!h.pullRequestUrl&&tt?a.jsx("span",{className:"github-field-help",children:Ne!=null&&Ne.reviewEnabled?`将使用 GitHub App 评审 ${Ne.fullName}`:Ne?`请先在下方开启 ${Ne.fullName} 的评审`:`PR URL 所属仓库 ${tt} 尚未安装 GitHub App`}):null,!h.pullRequestUrl&&!tt&&mt.length>0?a.jsxs("span",{className:"github-field-help",children:["已启用仓库:",mt.map(Xe=>Xe.fullName).join("、")]}):null]}),A?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:A}):null,T?a.jsx("div",{className:"github-submit-message is-success",role:"status",children:a.jsxs("span",{children:["已发起评审,Session ",T.sessionId," 正在运行。"]})}):null,a.jsx("div",{className:"github-review-section-actions",children:a.jsx("button",{type:"button",onClick:It,disabled:P,children:P?"发起评审中…":"立即发起评审"})})]})]}),a.jsxs("section",{className:"github-review-section github-review-records","aria-labelledby":"github-review-records-title",children:[a.jsxs("div",{className:"github-review-section-header",children:[a.jsxs("div",{children:[a.jsx("h2",{id:"github-review-records-title",children:"评审记录"}),a.jsx("p",{children:"展示最近自动触发和手动发起的评审任务。"})]}),a.jsx("button",{type:"button",onClick:()=>xn(),disabled:!(D!=null&&D.configured)||Ee,children:Ee?"刷新中...":"刷新"})]}),_e?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:_e}):null,(le==null?void 0:le.reviewSettingsConfigured)===!1&&!_e?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:le.reviewSettingsReason||"管理员未配置 Studio 持久化存储,无法读取评审记录。"}):null,Ee&&je.length===0?a.jsx("div",{className:"github-app-repository-empty",children:"正在读取 PR 评审记录..."}):null,!Ee&&je.length===0&&!_e?a.jsx("div",{className:"github-app-repository-empty",children:"暂无 PR 评审记录。"}):null,je.length>0?a.jsx("div",{className:"github-review-record-list",children:je.map(Xe=>{const wt=Zen(Xe),vt=Xe.status==="completed"?"":Xe.sessionId;return a.jsxs("div",{className:"github-review-record-row",children:[a.jsxs("div",{className:"github-review-record-main",children:[a.jsxs("div",{className:"github-review-record-title",children:[a.jsxs("a",{href:Xe.pullRequestUrl,target:"_blank",rel:"noreferrer",children:[Xe.repository,"#",Xe.pullRequestNumber,a.jsx(ry,{})]}),a.jsx("span",{className:`github-review-record-status is-${Xe.status}`,children:Xen(Xe.status)})]}),a.jsxs("span",{children:[Yen(Xe.trigger),Xe.action?` · ${Xe.action}`:""," · ",Jen(Xe.createdAt),wt?` · ${wt}`:""]})]}),a.jsx("div",{className:"github-review-record-actions",children:vt&&i?a.jsx("button",{type:"button",onClick:()=>i(vt),children:"打开 Session"}):null})]},Xe.id)})}):null,Nt?a.jsxs("div",{className:"github-list-pagination","aria-label":"评审记录分页",children:[a.jsx("span",{children:ole(Oe,Oj,je.length,We)}),a.jsxs("div",{children:[a.jsx("button",{type:"button",onClick:()=>qe("records",Oe-1),disabled:Oe<=1||Ee,children:"上一页"}),a.jsx("button",{type:"button",onClick:()=>qe("records",Oe+1),disabled:!We||Ee,children:"下一页"})]})]}):null]})]}):null]})})]})}async function lv(e){var i;const t=await e.json().catch(()=>null),n=(i=t==null?void 0:t.detail)==null?void 0:i.message;return new Error(n||`GitLab MR 评审请求失败(HTTP ${e.status})。`)}function lle(e,t){const n=e.trim().replace(/\/+$/,"");if(!n)return"";const i=`${n}/`,r=t.trim();if(!r.startsWith(i))return"";const s=r.slice(i.length).replace(/\/+$/,""),o="/-/merge_requests/",l=s.indexOf(o);if(l<=0)return"";const c=s.slice(l+o.length);return/^[1-9][0-9]*$/.test(c)?s.slice(0,l):""}async function cle(e){const t=await yn("/web/gitlab/app/config",{method:"GET",headers:{Accept:"application/json"},signal:e});if(!t.ok)throw await lv(t);const n=await t.json();if(typeof n.configured!="boolean"||typeof n.baseUrl!="string"||typeof n.webhookUrl!="string"||typeof n.reason!="string"||typeof n.oauthConfigured!="boolean"||typeof n.oauthConnected!="boolean"||n.oauthUser!==null&&n.oauthUser!==void 0&&(typeof n.oauthUser!="object"||typeof n.oauthUser.credentialId!="string"||typeof n.oauthUser.ownerId!="string"||typeof n.oauthUser.baseUrl!="string"||typeof n.oauthUser.gitlabUserId!="number"||typeof n.oauthUser.gitlabUsername!="string"||typeof n.oauthUser.gitlabName!="string"||typeof n.oauthUser.expiresAt!="number"))throw new Error("GitLab 集成配置响应格式无效。");return n}async function ttn(e,t){var s;const n=new URLSearchParams({page:String(t.page),pageSize:String(t.pageSize)});(s=t.query)!=null&&s.trim()&&n.set("q",t.query.trim());const i=await yn(`/web/gitlab/app/projects?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await lv(i);const r=await i.json();if(!Array.isArray(r.projects)||typeof r.page!="number"||typeof r.pageSize!="number"||typeof r.hasNextPage!="boolean"||typeof r.reviewSettingsConfigured!="boolean"||typeof r.reviewSettingsReason!="string"||r.projects.some(o=>typeof o!="object"||o===null||typeof o.instanceId!="string"||typeof o.baseUrl!="string"||typeof o.projectId!="number"||typeof o.pathWithNamespace!="string"||typeof o.name!="string"||typeof o.namespace!="string"||typeof o.webUrl!="string"||typeof o.private!="boolean"||typeof o.reviewEnabled!="boolean"||typeof o.permissionsNote!="string"||typeof o.accessLevel!="number"||typeof o.canManageWebhooks!="boolean"||typeof o.reviewBindingStatus!="string"||typeof o.reviewBindingReason!="string"||typeof o.reviewCredentialOwner!="string"||typeof o.reviewCredentialType!="string"))throw new Error("GitLab 集成项目列表响应格式无效。");return r}async function ntn(e,t){const n=await yn("/web/gitlab/app/review-projects",{method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e),signal:t});if(!n.ok)throw await lv(n);const i=await n.json();if(!Array.isArray(i.projects)||i.projects.some(r=>typeof r!="object"||r===null||typeof r.projectId!="number"))throw new Error("GitLab 集成评审项目保存响应格式无效。");return i.projects}async function itn(e){const t=await yn("/web/gitlab/oauth/disconnect",{method:"POST",headers:{Accept:"application/json"},signal:e});if(!t.ok)throw await lv(t)}async function rtn(e){const t=await yn("/web/gitlab/oauth/start-url",{method:"GET",headers:{Accept:"application/json"},signal:e});if(!t.ok)throw await lv(t);const n=await t.json();if(typeof n.authorizationUrl!="string"||!n.authorizationUrl)throw new Error("GitLab OAuth 授权地址响应格式无效。");return n.authorizationUrl}async function stn(e,t){const n=new URLSearchParams({page:String(t.page),pageSize:String(t.pageSize)}),i=await yn(`/web/gitlab/app/review-records?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await lv(i);const r=await i.json();if(!Array.isArray(r.records)||typeof r.page!="number"||typeof r.pageSize!="number"||typeof r.hasNextPage!="boolean"||typeof r.reviewSettingsConfigured!="boolean"||typeof r.reviewSettingsReason!="string"||r.records.some(s=>typeof s!="object"||s===null||typeof s.id!="string"||typeof s.projectId!="number"||typeof s.pathWithNamespace!="string"||typeof s.mergeRequestUrl!="string"||typeof s.mergeRequestIid!="number"||!["started","completed","ignored","failed"].includes(String(s.status))||!["manual","webhook"].includes(String(s.trigger))||typeof s.createdAt!="string"||typeof s.deliveryId!="string"||typeof s.action!="string"||typeof s.sessionId!="string"||typeof s.displayName!="string"||typeof s.reason!="string"))throw new Error("GitLab MR 评审记录响应格式无效。");return r}async function atn(e,t){const n=await yn("/web/gitlab/merge-request-reviews",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e),signal:t});if(!n.ok)throw await lv(n);const i=await n.json();if(i.status!=="started"||typeof i.sessionId!="string"||!i.sessionId||typeof i.displayName!="string")throw new Error("GitLab MR 评审服务返回了无效结果。");return i}const kj=10;function Sj(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[a.jsx("path",{d:"M6.5 4H4a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h7a1 1 0 0 0 1-1V9.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),a.jsx("path",{d:"M9 3h4v4M8.5 7.5 13 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function otn(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"m9.8 3.5-4.5 4.5 4.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function ltn(e){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...e,children:a.jsx("path",{d:"m22.54 9.64-.03-.08-2.2-6.81a.76.76 0 0 0-1.43-.08l-2.1 4.31H7.22l-2.1-4.31a.76.76 0 0 0-1.43.08l-2.2 6.81-.03.08a5.15 5.15 0 0 0 1.7 5.79l.01.01.02.01 8.81 6.58 8.81-6.58.02-.01.01-.01a5.15 5.15 0 0 0 1.7-5.79ZM12 20.08 8.65 8.59h6.7L12 20.08Z"})})}function ctn(e){return e==="started"?"进行中":e==="completed"?"已完成":e==="ignored"?"已忽略":"失败"}function utn(e){return e==="webhook"?"自动触发":"手动发起"}function dtn(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function ftn(e){return e.reason==="project-review-disabled"?"项目未启用":e.reason==="merge-request-not-reviewable"?"MR 不满足评审条件":e.reason}function ule(e,t,n,i){const r=(e-1)*t+1,s=(e-1)*t+n;return i?`${r}-${s}`:`${r}-${s} / ${s}`}function htn({onBack:e,onOpenSandboxSession:t}){const[n,i]=p.useState(null),[r,s]=p.useState(""),[o,l]=p.useState(!0),[c,u]=p.useState([]),[d,f]=p.useState(!0),[h,m]=p.useState(""),[g,b]=p.useState(null),[v,y]=p.useState(1),[w,x]=p.useState(!1),[O,k]=p.useState(""),[S,C]=p.useState(""),[E,j]=p.useState(null),[T,R]=p.useState(""),[A,N]=p.useState(!1),[P,I]=p.useState(""),[D,_]=p.useState(null),[L,F]=p.useState([]),[M,V]=p.useState(!0),[q,U]=p.useState(""),[J,z]=p.useState(1),[Z,ne]=p.useState(!1),[W,G]=p.useState(null),[H,se]=p.useState(!1),[Y,X]=p.useState(!1),ie=p.useRef(null),ee=p.useRef(null),be=p.useRef(null),ue=n?lle(n.baseUrl,T):"",pe=ue?c.find(Se=>Se.pathWithNamespace.toLowerCase()===ue.toLowerCase()):void 0,ke=v>1||w,je=J>1||Z,Pe=(n==null?void 0:n.configured)===!0&&n.oauthConnected,Ee=(Se=v,We=S)=>{var ye;(ye=ee.current)==null||ye.abort();const Ye=new AbortController;ee.current=Ye,f(!0),m(""),ttn(Ye.signal,{page:Se,pageSize:kj,query:We}).then(we=>{if(ee.current===Ye){if(we.projects.length===0&&we.page>1){y(we.page-1),Ee(we.page-1,We);return}u(we.projects),y(we.page),x(we.hasNextPage),b({reviewSettingsConfigured:we.reviewSettingsConfigured,reviewSettingsReason:we.reviewSettingsReason})}}).catch(we=>{Ye.signal.aborted||ee.current!==Ye||m(we instanceof Error?we.message:String(we))}).finally(()=>{ee.current===Ye&&(ee.current=null,f(!1))})},ze=(Se=J)=>{var Ye;(Ye=be.current)==null||Ye.abort();const We=new AbortController;be.current=We,V(!0),U(""),stn(We.signal,{page:Se,pageSize:kj}).then(ye=>{if(be.current===We){if(ye.records.length===0&&ye.page>1){z(ye.page-1),ze(ye.page-1);return}F(ye.records),z(ye.page),ne(ye.hasNextPage),G({reviewSettingsConfigured:ye.reviewSettingsConfigured,reviewSettingsReason:ye.reviewSettingsReason})}}).catch(ye=>{We.signal.aborted||be.current!==We||U(ye instanceof Error?ye.message:String(ye))}).finally(()=>{be.current===We&&(be.current=null,V(!1))})};p.useEffect(()=>{var We;(We=ie.current)==null||We.abort();const Se=new AbortController;return ie.current=Se,l(!0),s(""),cle(Se.signal).then(Ye=>{ie.current===Se&&(i(Ye),(!Ye.configured||Ye.oauthConfigured&&!Ye.oauthConnected)&&(f(!1),V(!1)))}).catch(Ye=>{Se.signal.aborted||ie.current!==Se||(s(Ye instanceof Error?Ye.message:String(Ye)),f(!1),V(!1))}).finally(()=>{ie.current===Se&&(ie.current=null,l(!1))}),()=>{var Ye,ye;Se.abort(),(Ye=ee.current)==null||Ye.abort(),(ye=be.current)==null||ye.abort()}},[]),p.useEffect(()=>{Pe&&(Ee(1,""),ze(1))},[Pe]);const _e=()=>{const Se=O.trim();C(Se),y(1),Ee(1,Se)},ae=async Se=>{if((g==null?void 0:g.reviewSettingsConfigured)!==!0||E!==null)return;if(!Se.reviewEnabled&&!Pe){m("请先连接 GitLab 后再启用自动评审。");return}const We=new AbortController;j(Se.projectId),m("");try{await ntn({projectId:Se.projectId,reviewEnabled:!Se.reviewEnabled},We.signal),u(Ye=>Ye.map(ye=>ye.projectId===Se.projectId?{...ye,reviewEnabled:!Se.reviewEnabled}:ye))}catch(Ye){m(Ye instanceof Error?Ye.message:String(Ye))}finally{j(null)}},le=async()=>{const Se=new AbortController;X(!0),s("");try{await itn(Se.signal);const We=await cle(Se.signal);i(We),u([]),b(null)}catch(We){s(We instanceof Error?We.message:String(We))}finally{X(!1)}},ge=async()=>{const Se=new AbortController;se(!0),s("");try{window.location.href=await rtn(Se.signal)}catch(We){s(We instanceof Error?We.message:String(We)),se(!1)}},Oe=async()=>{const Se=T.trim();if(!Se){I("请输入 GitLab Merge Request URL。");return}if(!(n!=null&&n.configured)){I("管理员未配置 GitLab OAuth。");return}if(!Pe){I("请先连接 GitLab 后再发起评审。");return}if(!lle(n.baseUrl,Se)){I("请输入当前 GitLab 实例下的完整 Merge Request URL。");return}N(!0),I(""),_(null);const We=new AbortController;try{const Ye=await atn({mergeRequestUrl:Se},We.signal);_(Ye),ze(1)}catch(Ye){I(Ye instanceof Error?Ye.message:String(Ye))}finally{N(!1)}};return a.jsxs("div",{className:"github-integration-page",children:[a.jsxs("header",{className:"github-integration-header",children:[a.jsx("button",{type:"button",className:"github-back",onClick:e,"aria-label":"返回自动化",children:a.jsx(otn,{})}),a.jsx(ltn,{className:"github-integration-logo"}),a.jsxs("div",{children:[a.jsx("h1",{children:"GitLab MR Review"}),a.jsx("p",{children:"通过 GitLab webhook 触发 Sandbox 评审,并将结果写回 Merge Request。"})]})]}),a.jsx("div",{className:"github-integration-layout",children:a.jsxs("section",{className:"github-section-panel",children:[a.jsx("div",{className:"github-panel-heading",children:a.jsx("p",{children:"请先为目标项目开启自动评审,再通过 webhook 或手动 URL 发起 MR 评审。"})}),a.jsxs("div",{className:"github-release-form",children:[a.jsxs("div",{className:`github-app-card${n!=null&&n.configured?" is-ready":""}`,children:[a.jsxs("div",{children:[a.jsx("strong",{children:"GitLab 集成配置"}),a.jsx("span",{children:o?"正在检查中心服务配置...":n!=null&&n.configured?n.oauthConnected&&n.oauthUser?`已连接 ${n.oauthUser.gitlabName||n.oauthUser.gitlabUsername} · ${n.baseUrl}`:`当前实例:${n.baseUrl}`:r||(n==null?void 0:n.reason)||"管理员未配置 GitLab OAuth。"})]}),n!=null&&n.oauthConfigured&&!n.oauthConnected?a.jsxs("button",{type:"button",className:"github-app-install-link",onClick:()=>{ge()},disabled:H,children:[H?"连接中...":"连接 GitLab",a.jsx(Sj,{})]}):n!=null&&n.oauthConnected?a.jsx("button",{type:"button",className:"github-app-install-link",onClick:()=>{le()},disabled:Y,children:Y?"断开中...":"断开授权"}):n!=null&&n.webhookUrl?a.jsxs("a",{className:"github-app-install-link",href:n.webhookUrl,target:"_blank",rel:"noreferrer",children:["Webhook",a.jsx(Sj,{})]}):null]}),a.jsxs("section",{className:"github-review-section github-app-repositories","aria-labelledby":"gitlab-projects-title",children:[a.jsxs("div",{className:"github-review-section-header",children:[a.jsxs("div",{children:[a.jsx("h2",{id:"gitlab-projects-title",children:"可访问项目"}),a.jsx("p",{children:"只有开启评审的项目会响应 GitLab webhook 自动触发。"})]}),a.jsx("button",{type:"button",onClick:()=>Ee(),disabled:!Pe||d,children:d?"刷新中...":"刷新"})]}),h?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:h}):null,(g==null?void 0:g.reviewSettingsConfigured)===!1&&!h?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:g.reviewSettingsReason||"管理员未配置 Studio 持久化存储,无法保存启用评审设置。"}):null,a.jsxs("div",{className:"github-app-repository-search",children:[a.jsx("input",{type:"search",value:O,onChange:Se=>k(Se.target.value),onKeyDown:Se=>{Se.key==="Enter"&&(Se.preventDefault(),_e())},placeholder:"搜索 group 或项目名","aria-label":"搜索 GitLab 项目"}),a.jsx("button",{type:"button",onClick:_e,disabled:!Pe||d,children:"搜索"}),S?a.jsx("button",{type:"button",onClick:()=>{k(""),C(""),y(1),Ee(1,"")},disabled:d||!Pe,children:"清除"}):null]}),!Pe&&!o?a.jsx("div",{className:"github-app-repository-empty",children:"请先连接 GitLab。"}):null,d&&c.length===0&&Pe?a.jsx("div",{className:"github-app-repository-empty",children:"正在读取 GitLab 项目..."}):null,!d&&c.length===0&&!h&&Pe?a.jsx("div",{className:"github-app-repository-empty",children:S?`没有匹配 “${S}” 的 GitLab 项目。`:"GitLab 集成暂无可访问项目。"}):null,c.length>0?a.jsx("div",{className:"github-app-repository-list",children:c.map(Se=>{const We=E===Se.projectId,Ye=(g==null?void 0:g.reviewSettingsConfigured)!==!0||E!==null||!Se.reviewEnabled&&!Pe;return a.jsxs("div",{className:"github-app-repository-row",children:[a.jsxs("div",{className:"github-app-repository-main",children:[a.jsxs("a",{href:Se.webUrl,target:"_blank",rel:"noreferrer",title:Se.pathWithNamespace,children:[Se.pathWithNamespace,a.jsx(Sj,{})]}),a.jsxs("span",{children:[Se.private?"Private":"Public"," · Project ",Se.projectId,Se.permissionsNote?` · ${Se.permissionsNote}`:"",Se.reviewBindingStatus&&Se.reviewBindingStatus!=="active"&&Se.reviewBindingStatus!=="disabled"?` · ${Se.reviewBindingReason||"授权失效"}`:""]})]}),a.jsx("button",{type:"button",className:`github-review-switch${Se.reviewEnabled?" is-on":""}`,role:"switch","aria-checked":Se.reviewEnabled,disabled:Ye,onClick:()=>{ae(Se)},children:a.jsx("span",{children:We?"保存中":Se.reviewEnabled?"已启用":"未启用"})})]},`${Se.instanceId}:${Se.projectId}`)})}):null,ke?a.jsxs("div",{className:"github-list-pagination","aria-label":"GitLab 项目分页",children:[a.jsx("span",{children:ule(v,kj,c.length,w)}),a.jsxs("div",{children:[a.jsx("button",{type:"button",onClick:()=>{y(v-1),Ee(v-1,S)},disabled:v<=1||d,children:"上一页"}),a.jsx("button",{type:"button",onClick:()=>{y(v+1),Ee(v+1,S)},disabled:!w||d,children:"下一页"})]})]}):null]})]}),a.jsxs("div",{className:"github-pr-review-sections",children:[a.jsxs("section",{className:"github-review-section github-review-now","aria-labelledby":"gitlab-review-now-title",children:[a.jsx("div",{className:"github-review-section-header",children:a.jsxs("div",{children:[a.jsx("h2",{id:"gitlab-review-now-title",children:"立刻评审"}),a.jsx("p",{children:"输入当前 GitLab 实例下的 MR URL,立即创建 Sandbox 评审任务。"})]})}),a.jsxs("div",{className:"github-review-section-body",children:[a.jsxs("div",{className:"github-field",children:[a.jsx("input",{"aria-label":"Merge Request URL",value:T,onChange:Se=>R(Se.target.value),placeholder:`${(n==null?void 0:n.baseUrl)||"https://gitlab.example.com"}/group/project/-/merge_requests/123`}),ue?a.jsx("span",{className:"github-field-help",children:pe?`将使用 GitLab 授权评审 ${pe.pathWithNamespace}`:`MR URL 所属项目 ${ue} 不在当前项目列表中`}):null]}),P?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:P}):null,D?a.jsx("div",{className:"github-submit-message is-success",role:"status",children:a.jsxs("span",{children:["已发起评审,Session ",D.sessionId," 正在运行。"]})}):null,a.jsx("div",{className:"github-review-section-actions",children:a.jsx("button",{type:"button",onClick:Oe,disabled:A||!Pe,children:A?"发起评审中...":"立即发起评审"})})]})]}),a.jsxs("section",{className:"github-review-section github-review-records","aria-labelledby":"gitlab-review-records-title",children:[a.jsxs("div",{className:"github-review-section-header",children:[a.jsxs("div",{children:[a.jsx("h2",{id:"gitlab-review-records-title",children:"评审记录"}),a.jsx("p",{children:"展示最近自动触发和手动发起的评审任务。"})]}),a.jsx("button",{type:"button",onClick:()=>ze(),disabled:!Pe||M,children:M?"刷新中...":"刷新"})]}),q?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:q}):null,(W==null?void 0:W.reviewSettingsConfigured)===!1&&!q?a.jsx("div",{className:"github-submit-message is-error",role:"alert",children:W.reviewSettingsReason||"管理员未配置 Studio 持久化存储,无法读取评审记录。"}):null,M&&L.length===0?a.jsx("div",{className:"github-app-repository-empty",children:"正在读取 MR 评审记录..."}):null,!M&&L.length===0&&!q?a.jsx("div",{className:"github-app-repository-empty",children:"暂无 MR 评审记录。"}):null,L.length>0?a.jsx("div",{className:"github-review-record-list",children:L.map(Se=>{const We=ftn(Se),Ye=Se.status==="completed"?"":Se.sessionId;return a.jsxs("div",{className:"github-review-record-row",children:[a.jsxs("div",{className:"github-review-record-main",children:[a.jsxs("div",{className:"github-review-record-title",children:[a.jsxs("a",{href:Se.mergeRequestUrl,target:"_blank",rel:"noreferrer",children:[Se.pathWithNamespace,"!",Se.mergeRequestIid,a.jsx(Sj,{})]}),a.jsx("span",{className:`github-review-record-status is-${Se.status}`,children:ctn(Se.status)})]}),a.jsxs("span",{children:[utn(Se.trigger),Se.action?` · ${Se.action}`:""," · ",dtn(Se.createdAt),We?` · ${We}`:""]})]}),a.jsx("div",{className:"github-review-record-actions",children:Ye&&t?a.jsx("button",{type:"button",onClick:()=>t(Ye),children:"打开 Session"}):null})]},Se.id)})}):null,je?a.jsxs("div",{className:"github-list-pagination","aria-label":"GitLab 评审记录分页",children:[a.jsx("span",{children:ule(J,kj,L.length,Z)}),a.jsxs("div",{children:[a.jsx("button",{type:"button",onClick:()=>{z(J-1),ze(J-1)},disabled:J<=1||M,children:"上一页"}),a.jsx("button",{type:"button",onClick:()=>{z(J+1),ze(J+1)},disabled:!Z||M,children:"下一页"})]})]}):null]})]})]})})]})}const ptn=1050062,dle="1.0",mtn="https://lf-static.applogcdn.com/obj/applog-sdk-static/log-sdk/collect/5/collect.js";class gtn{constructor(){Zt(this,"enabled",!1);Zt(this,"initialized",!1);Zt(this,"pending",[]);Zt(this,"userUniqueId","");Zt(this,"initPromise")}init(t){return this.enabled=t.enabled,this.enabled?this.initPromise?this.initPromise:(this.initPromise=Promise.resolve().then(()=>{const n=this.bootstrapCollector();n("init",{app_id:ptn,channel:"cn",disable_auto_pv:1}),this.userUniqueId&&n("config",{user_unique_id:this.userUniqueId}),n("config",{_staging_flag:t.environment==="prod"?0:1}),n("start"),this.initialized=!0;const i=this.pending;this.pending=[];for(const[r,s]of i)this.collect(r,s)}),this.initPromise):(this.pending=[],Promise.resolve())}identify(t){this.userUniqueId=t,this.initialized&&this.collect("config",{user_unique_id:t})}emit(t,n){if(this.enabled){if(this.initialized){this.collect(t,n);return}this.pending=[...this.pending.slice(-49),[t,n]]}}bootstrapCollector(){if(window.collectEvent)return window.collectEvent;window.LogAnalyticsObject="collectEvent";const t=function(){var r;(r=t.q)==null||r.push(arguments)};t.q=[],t.l=Date.now(),window.collectEvent=t;const n=document.createElement("script");return n.async=!0,n.src=mtn,n.onerror=()=>{this.enabled=!1,t.q=[],console.warn("[telemetry] TEA SDK script failed to load")},document.head.appendChild(n),t}collect(t,n){var i;(i=window.collectEvent)==null||i.call(window,t,n)}}const btn=256,z9e=1024,x6="[REDACTED]";function ytn(e){if(typeof e!="string"&&typeof e!="number")return;const t=String(e).trim();return/^[A-Za-z0-9_.:-]{1,64}$/.test(t)?t:void 0}function Jh(e,t){return t===void 0?{errorKind:e}:{errorKind:e,errorCode:t}}function V9e(e,t,n={}){if(e.length<=t)return e;if(n.preserveEnd){const r="[truncated] ...";return`${r}${e.slice(-Math.max(0,t-r.length))}`}const i="... [truncated]";return`${e.slice(0,Math.max(0,t-i.length))}${i}`}function vtn(e){return e.replace(/\b(Authorization\s*[:=]\s*)(Bearer\s+)?[^\s"',;&]+/gi,(t,n,i)=>`${n}${i??""}${x6}`).replace(/\bBearer\s+[A-Za-z0-9._~+/=-]+/gi,`Bearer ${x6}`).replace(/\b([\w.-]*(?:token|password|passwd|secret|api[_-]?key|access[_-]?key|secret[_-]?key|cookie)[\w.-]*\s*[:=]\s*)(["']?)[^\s"',;&]+/gi,(t,n,i)=>`${n}${i}${x6}`)}function Fy(e,t={}){const n=e!==null&&typeof e=="object"?e:{},r=(typeof n.message=="string"?n.message:typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):"").replace(/\s+/g," ").trim();if(r)return V9e(vtn(r),z9e,t)}function Xo(e,t={}){const n=e!==null&&typeof e=="object"?e:{},i=ytn(n.code),r=typeof n.name=="string"?n.name:"";if(r==="RuntimeProbeError")return Jh("runtime_probe_error",i);if(r==="AbortError")return Jh("abort",i);if(r==="RuntimeAccessDeniedError"||r==="AuthError")return Jh("auth",i);if(t.phase==="build")return Jh("build_failed",i);if(r==="TimeoutError")return Jh("timeout",i);if(r==="NetworkError"||r==="TypeError")return Jh("network",i);if(r==="ValidationError")return Jh("validation",i);if(r==="ServerError")return Jh("server",i);const s=typeof n.status=="number"&&Number.isInteger(n.status)?n.status:void 0;if(s===void 0||s<400||s>599)return Jh("unknown",i);const o=String(s);return s===401||s===403?{errorKind:"auth",errorCode:o}:s===400||s===409||s===422?{errorKind:"validation",errorCode:o}:s>=500?{errorKind:"server",errorCode:o}:{errorKind:"unknown",errorCode:o}}const xtn=["schema_version","event_id","operation_id","user_pool_id","studio_deploy_id","vefaas_application_id","vefaas_function_id","studio_region","studio_project","studio_version","environment","cloud_provider","account_id","account_id_resolution_error","user_role","user_source","page_instance_id"],wtn={studio_entry_viewed:["auth_state"],studio_session_started:["agents_source"],studio_agent_deploy:["status","agent_id","deploy_action","deploy_source","create_mode","ai_assisted","deploy_region","runtime_network_type","feishu_enabled","runtime_id","duration_ms","failed_phase","error_kind","error_code","error_message"],studio_sandbox_create:["status","sandbox_kind","sandbox_source","sandbox_id","duration_ms","error_kind","error_code"],studio_agent_debug:["status","agent_id","variant_type","debug_run_id","duration_ms","failed_phase","error_kind","error_code"],studio_agent_connect:["status","target_id","agent_kind","connect_source","runtime_region","runtime_is_mine","sandbox_status","duration_ms","error_kind","error_code"],studio_agent_message:["status","agent_id","agent_kind","message_source","session_state","session_id","duration_ms","failed_phase","error_kind","error_code"],studio_agent_source_download:["status","agent_id","deploy_action","deploy_source","create_mode","ai_assisted","duration_ms","file_count","zip_size_bytes","error_kind","error_code"]};function Otn(e){return typeof e=="string"||typeof e=="number"&&Number.isFinite(e)}function fle(e,t){const n=new Set([...xtn,...wtn[e]]),i={};for(const[r,s]of Object.entries(t))!n.has(r)||!Otn(s)||(typeof s=="string"?i[r]=V9e(s,r==="error_message"?z9e:btn):i[r]=s);return i}function ktn(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`}function Stn(){return typeof performance<"u"?performance.now():Date.now()}function Kv(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}class Etn{constructor(t){Zt(this,"sink");Zt(this,"createId");Zt(this,"now");Zt(this,"pageInstanceId");Zt(this,"context");Zt(this,"identity");Zt(this,"entryViewed",!1);Zt(this,"sessionStarted",!1);this.sink=t.sink,this.createId=t.createId??ktn,this.now=t.now??Stn,this.pageInstanceId=this.createId()}setContext(t){var n,i;this.context={...t,accountId:((n=t.accountId)==null?void 0:n.trim())??"",accountIdResolutionError:((i=t.accountIdResolutionError)==null?void 0:i.trim())??""}}identify(t){var i,r,s;const n=t.userUniqueId.trim();n&&(this.identity&&this.identity.userUniqueId!==n&&(this.pageInstanceId=this.createId(),this.sessionStarted=!1),this.identity={...t,userUniqueId:n,accountId:((i=t.accountId)==null?void 0:i.trim())??""},(s=(r=this.sink).identify)==null||s.call(r,n))}trackStudioSessionStarted(t){this.sessionStarted||!this.context||!this.identity||(this.sessionStarted=!0,this.emit("studio_session_started",{agents_source:t.agentsSource}))}trackStudioEntryViewed(t){if(this.entryViewed||!this.context)return;this.entryViewed=!0;const n=fle("studio_entry_viewed",Kv({schema_version:dle,event_id:this.createId(),user_pool_id:this.context.userPoolId,studio_deploy_id:this.context.studioDeployId,vefaas_application_id:this.context.applicationId,vefaas_function_id:this.context.functionId,studio_region:this.context.studioRegion,studio_project:this.context.studioProject,studio_version:this.context.studioVersion,environment:this.context.environment,cloud_provider:this.context.cloudProvider,account_id:this.context.accountId,account_id_resolution_error:this.context.accountIdResolutionError||void 0,page_instance_id:this.pageInstanceId,auth_state:t.authState}));this.sink.emit("studio_entry_viewed",n)}beginAgentDeploy(t){return this.beginOperation("studio_agent_deploy",{agent_id:t.agentId,deploy_action:t.deployAction,deploy_source:t.deploySource,create_mode:t.createMode,ai_assisted:t.aiAssisted,deploy_region:t.deployRegion,runtime_network_type:t.runtimeNetworkType,feishu_enabled:t.feishuEnabled},n=>({runtime_id:n.runtimeId}),n=>({failed_phase:n.failedPhase,error_kind:n.errorKind,error_code:n.errorCode,error_message:n.errorMessage}))}beginSandboxCreate(t){return this.beginOperation("studio_sandbox_create",{sandbox_kind:t.sandboxKind,sandbox_source:t.sandboxSource},n=>({sandbox_id:n.sandboxId}),n=>({error_kind:n.errorKind,error_code:n.errorCode}))}beginAgentDebug(t){return this.beginOperation("studio_agent_debug",{agent_id:t.agentId,variant_type:t.variantType},n=>({debug_run_id:n.debugRunId}),n=>({failed_phase:n.failedPhase,error_kind:n.errorKind,error_code:n.errorCode}))}beginAgentConnect(t){return this.beginOperation("studio_agent_connect",{target_id:t.targetId,agent_kind:t.agentKind,connect_source:t.connectSource},n=>Kv({runtime_region:n.runtimeRegion,runtime_is_mine:n.runtimeIsMine,sandbox_status:n.sandboxStatus}),n=>Kv({error_kind:n.errorKind,error_code:n.errorCode}))}beginAgentMessage(t){return this.beginOperation("studio_agent_message",Kv({agent_id:t.agentId,agent_kind:t.agentKind,message_source:t.messageSource,session_state:t.sessionState,session_id:t.sessionId}),n=>({session_id:n.sessionId}),n=>Kv({session_id:n.sessionId,failed_phase:n.failedPhase,error_kind:n.errorKind,error_code:n.errorCode}))}beginAgentSourceDownload(t){return this.beginOperation("studio_agent_source_download",{agent_id:t.agentId,deploy_action:t.deployAction,deploy_source:t.deploySource,create_mode:t.createMode,ai_assisted:t.aiAssisted},n=>({file_count:n.fileCount,zip_size_bytes:n.zipSizeBytes}),n=>({file_count:n.fileCount,error_kind:n.errorKind,error_code:n.errorCode}))}beginOperation(t,n,i,r){const s=this.createId(),o=this.now(),l=!!(this.context&&this.identity);let c=!1;l&&this.emit(t,{...n,status:"started"},s);const u=(d,f)=>{c||(c=!0,l&&this.emit(t,{...n,...f,status:d,duration_ms:Math.max(0,this.now()-o)},s))};return{operationId:s,succeed:d=>u("succeeded",i(d)),fail:d=>u("failed",r(d))}}emit(t,n,i){if(!this.context||!this.identity)return;const r=fle(t,Kv({schema_version:dle,event_id:this.createId(),operation_id:i,user_pool_id:this.context.userPoolId,studio_deploy_id:this.context.studioDeployId,vefaas_application_id:this.context.applicationId,vefaas_function_id:this.context.functionId,studio_region:this.context.studioRegion,studio_project:this.context.studioProject,studio_version:this.context.studioVersion,environment:this.context.environment,cloud_provider:this.context.cloudProvider,account_id:this.identity.accountId,account_id_resolution_error:this.context.accountIdResolutionError||void 0,user_role:this.identity.userRole,user_source:this.identity.userSource,page_instance_id:this.pageInstanceId,...n}));this.sink.emit(t,r)}}const H9e=new gtn,Mh=new Etn({sink:H9e});function Ctn(e){return H9e.init(e)}function Atn(e){Mh.setContext(e)}function Ttn(e){Mh.identify(e)}function _tn(e){Mh.trackStudioEntryViewed(e)}function jtn(e){Mh.trackStudioSessionStarted(e)}function q9e(e){return Mh.beginAgentDeploy(e)}function Ntn(e){return Mh.beginSandboxCreate(e)}function Rtn(e){return Mh.beginAgentDebug(e)}function Ej(e){return Mh.beginAgentConnect(e)}function hle(e){return Mh.beginAgentMessage(e)}function W9e(e){return Mh.beginAgentSourceDownload(e)}const Itn=/^[A-Za-z_][A-Za-z0-9_]*$/;function KT(e,t=n=>Xt(`validation.agentName.${n}`)){return e.trim().length===0?t("required"):e==="user"?t("reserved"):Itn.test(e)?null:t("characters")}function Ptn(e){const t=new Set,n=new Set,i=r=>{KT(r.name)===null&&(t.has(r.name)?n.add(r.name):t.add(r.name)),r.subAgents.forEach(i)};return i(e),n}function Dtn(e){return{...wd(),name:e,description:Ch("feishu.generatedAgent.description"),instruction:Ch("feishu.generatedAgent.instruction"),deployment:{feishuEnabled:!0}}}async function Mtn(e){const t=Dtn(e.agentName),n=await eE(t);return U0(n.name,n.files,{region:e.region,projectName:"default"},{taskId:e.taskId,sessionStorage:"in-memory",minInstance:1,maxInstance:1,description:t.description,im:{feishu:{enabled:!0}},envs:[{key:"FEISHU_APP_ID",value:e.appId},{key:"FEISHU_APP_SECRET",value:e.appSecret}],onStage:e.onStage})}const Hf=["cn-beijing","cn-shanghai"],K9e=["prepare","build","deploy","publish"];function Ltn(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"m9.8 3.5-4.5 4.5 4.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function $tn(e){return a.jsx("svg",{viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"m5 7 4 4 4-4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function ple(e){return a.jsx("svg",{viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"m4 9.2 3.1 3.1L14 5.8",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ftn(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"M6.5 4H4.8A1.8 1.8 0 0 0 3 5.8v5.4A1.8 1.8 0 0 0 4.8 13h5.4a1.8 1.8 0 0 0 1.8-1.8V9.5M9 3h4v4M12.5 3.5 7.2 8.8",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function Btn(e){if(!e||e==="upload")return 0;const t=K9e.findIndex(n=>n===e);return t<0?0:t}function w6(e){switch(e){case"prepare":case"upload":case"build":case"deploy":case"publish":case"update":case"evaluation":return e;default:return"unknown"}}function mle(e){const t=KT(e,n=>n);return t?`feishu.validation.agentName.${t}`:""}function Utn({onBack:e}){const{t}=Te("automations"),[n,i]=p.useState("feishu_assistant"),[r,s]=p.useState(""),[o,l]=p.useState(""),[c,u]=p.useState(!1),[d,f]=p.useState("cn-beijing"),[h,m]=p.useState(!1),[g,b]=p.useState(""),[v,y]=p.useState(""),[w,x]=p.useState(""),[O,k]=p.useState("idle"),[S,C]=p.useState(null),[E,j]=p.useState(""),[T,R]=p.useState(null),A=p.useRef(null),N=p.useRef(null),P=p.useRef([]),I=p.useRef(0),D=p.useRef(null),_=p.useRef(null),L=p.useRef("prepare"),F=p.useRef(!1),M=p.useRef(!0),V=["preparing","running","cancelling"].includes(O);p.useEffect(()=>(M.current=!0,()=>{M.current=!1}),[]),p.useEffect(()=>{var se;if(!h)return;(se=P.current[I.current])==null||se.focus();const G=Y=>{Y.target instanceof Node&&A.current&&!A.current.contains(Y.target)&&m(!1)},H=Y=>{var X;Y.key==="Escape"&&(m(!1),(X=N.current)==null||X.focus())};return window.addEventListener("pointerdown",G),window.addEventListener("keydown",H),()=>{window.removeEventListener("pointerdown",G),window.removeEventListener("keydown",H)}},[h]);const q=G=>{G.key==="Enter"&&(G.nativeEvent.isComposing||G.nativeEvent.keyCode===229)&&G.preventDefault()},U=()=>{const G=mle(n.trim()),H=r.trim()?"":"feishu.validation.appId",se=o.trim()?"":"feishu.validation.appSecret";return b(G),y(H),x(se),!G&&!H&&!se},J=async G=>{if(G.preventDefault(),!U()||V)return;const H=crypto.randomUUID();D.current=H,L.current="prepare",F.current=!1,k("preparing"),C(null),j(""),R(null);const se=q9e({agentId:String(n.trim()),deployAction:"create",deploySource:"feishu_automation",createMode:"feishu_template",aiAssisted:0,deployRegion:String(d),runtimeNetworkType:"public",feishuEnabled:1});_.current=se;try{const Y=await Mtn({agentName:n.trim(),appId:r.trim(),appSecret:o.trim(),region:d,taskId:H,onStage:X=>{L.current=X.phase||"deploy",!(!M.current||F.current)&&(k("running"),C(X))}});if(F.current){se.fail({failedPhase:w6(L.current),errorKind:"abort",errorMessage:Fy("User cancelled deployment")});return}if(se.succeed({runtimeId:String(Y.runtimeId||"")}),!M.current)return;R(Y),l(""),u(!1),k("succeeded")}catch(Y){if(se.fail({failedPhase:w6(L.current),...F.current?{errorKind:"abort"}:Xo(Y,{phase:L.current}),errorMessage:Fy(Y)}),!M.current||F.current)return;k("failed"),j(Y instanceof Error?Y.message:String(Y))}finally{D.current===H&&(D.current=null),_.current===se&&(_.current=null)}},z=async()=>{var H;const G=D.current;if(!(!G||O!=="running")&&window.confirm(t("feishu.confirmCancel"))){F.current=!0,k("cancelling"),j("");try{await a2e(G),(H=_.current)==null||H.fail({failedPhase:w6(L.current),errorKind:"abort",errorMessage:Fy("User cancelled deployment")}),M.current&&k("cancelled")}catch(se){if(F.current=!1,!M.current)return;k("failed"),j(se instanceof Error?se.message:String(se))}}},Z=Btn((S==null?void 0:S.phase)??null),ne=!!(n.trim()&&r.trim()&&o.trim()&&!V),W=t(`feishu.regions.${d}`);return a.jsxs("div",{className:"feishu-integration-page",children:[a.jsxs("header",{className:"feishu-integration-header",children:[a.jsx("button",{type:"button",className:"feishu-back",onClick:e,"aria-label":t("backToAutomations"),disabled:V,children:a.jsx(Ltn,{})}),a.jsx("img",{className:"feishu-integration-logo",src:PL,alt:"","aria-hidden":"true"}),a.jsxs("div",{children:[a.jsx("h1",{children:t("feishu.title")}),a.jsx("p",{children:t("feishu.description")})]})]}),a.jsx("div",{className:"feishu-integration-layout",children:a.jsxs("section",{className:"feishu-section-panel",children:[a.jsx("p",{className:"feishu-panel-description",children:t("feishu.panel")}),a.jsxs("form",{className:"feishu-form",onSubmit:J,onKeyDown:q,noValidate:!0,children:[a.jsxs("div",{className:"feishu-field-grid",children:[a.jsxs("div",{className:"feishu-field",children:[a.jsx("label",{htmlFor:"feishu-agent-name",children:t("feishu.agentName")}),a.jsx("input",{id:"feishu-agent-name",value:n,maxLength:64,disabled:V,onChange:G=>{i(G.target.value),g&&b("")},onBlur:()=>b(mle(n.trim())),"aria-invalid":!!g,"aria-describedby":`feishu-agent-name-help${g?" feishu-agent-name-error":""}`}),a.jsx("span",{id:"feishu-agent-name-help",className:"feishu-field-help",children:t("feishu.agentNameHelp")}),g?a.jsx("span",{id:"feishu-agent-name-error",className:"feishu-field-error",role:"alert",children:t(g)}):null]}),a.jsxs("div",{className:"feishu-field",children:[a.jsx("label",{id:"feishu-region-label",children:t("feishu.region")}),a.jsxs("div",{className:"feishu-region-picker",ref:A,children:[a.jsxs("button",{ref:N,type:"button",className:"feishu-region-trigger",disabled:V,"aria-haspopup":"listbox","aria-expanded":h,"aria-labelledby":"feishu-region-label feishu-region-value",onClick:()=>{I.current=Hf.findIndex(G=>G===d),m(G=>!G)},onKeyDown:G=>{G.key!=="ArrowDown"&&G.key!=="ArrowUp"||(G.preventDefault(),I.current=G.key==="ArrowUp"?Hf.length-1:Hf.findIndex(H=>H===d),m(!0))},children:[a.jsx("span",{id:"feishu-region-value",children:W}),a.jsx($tn,{})]}),h?a.jsx("div",{className:"feishu-region-menu",role:"listbox","aria-label":t("feishu.region"),onKeyDown:G=>{var Y;const H=P.current.findIndex(X=>X===document.activeElement);let se=null;G.key==="ArrowDown"?se=(H+1)%Hf.length:G.key==="ArrowUp"?se=(H-1+Hf.length)%Hf.length:G.key==="Home"?se=0:G.key==="End"?se=Hf.length-1:G.key==="Tab"&&m(!1),se!==null&&(G.preventDefault(),(Y=P.current[se])==null||Y.focus())},children:Hf.map(G=>a.jsx("button",{ref:H=>{const se=Hf.findIndex(Y=>Y===G);P.current[se]=H},type:"button",role:"option","aria-selected":d===G,className:`feishu-region-option${d===G?" is-selected":""}`,onClick:()=>{var H;f(G),m(!1),(H=N.current)==null||H.focus()},children:t(`feishu.regions.${G}`)},G))}):null]}),a.jsx("span",{className:"feishu-field-help",children:t("feishu.regionHelp")})]}),a.jsxs("div",{className:"feishu-field",children:[a.jsx("label",{htmlFor:"feishu-app-id",children:t("feishu.appId")}),a.jsx("input",{id:"feishu-app-id",value:r,maxLength:128,autoComplete:"off",disabled:V,placeholder:"cli_xxxxxxxxxxxxxxxx",onChange:G=>{s(G.target.value),v&&y("")},onBlur:()=>y(r.trim()?"":"feishu.validation.appId"),"aria-invalid":!!v,"aria-describedby":`feishu-app-id-help${v?" feishu-app-id-error":""}`}),a.jsx("span",{id:"feishu-app-id-help",className:"feishu-field-help",children:t("feishu.appIdHelp")}),v?a.jsx("span",{id:"feishu-app-id-error",className:"feishu-field-error",role:"alert",children:t(v)}):null]}),a.jsxs("div",{className:"feishu-field",children:[a.jsx("label",{htmlFor:"feishu-app-secret",children:t("feishu.appSecret")}),a.jsxs("div",{className:"feishu-secret-input",children:[a.jsx("input",{id:"feishu-app-secret",type:c?"text":"password",value:o,maxLength:256,autoComplete:"off",disabled:V,placeholder:t("feishu.appSecretPlaceholder"),onChange:G=>{l(G.target.value),w&&x("")},onBlur:()=>x(o.trim()?"":"feishu.validation.appSecret"),"aria-invalid":!!w,"aria-describedby":`feishu-app-secret-help${w?" feishu-app-secret-error":""}`}),a.jsx("button",{type:"button",disabled:V,onClick:()=>u(G=>!G),"aria-label":t(c?"feishu.hideSecret":"feishu.showSecret"),children:t(c?"feishu.hide":"feishu.show")})]}),a.jsx("span",{id:"feishu-app-secret-help",className:"feishu-field-help",children:t("feishu.appSecretHelp")}),w?a.jsx("span",{id:"feishu-app-secret-error",className:"feishu-field-error",role:"alert",children:t(w)}):null]})]}),O!=="idle"?a.jsxs("div",{className:`feishu-deployment-status is-${O}`,role:O==="failed"?"alert":"status",children:[a.jsxs("div",{className:"feishu-deployment-heading",children:[O==="preparing"?a.jsx(fn,{as:"strong",children:t("feishu.status.preparing")}):null,O==="running"?a.jsx(fn,{as:"strong",children:S?mL(S):t("feishu.status.running")}):null,O==="cancelling"?a.jsx(fn,{as:"strong",children:t("feishu.status.cancelling")}):null,O==="succeeded"?a.jsxs("strong",{children:[a.jsx(ple,{}),t("feishu.status.succeeded")]}):null,O==="cancelled"?a.jsx("strong",{children:t("feishu.status.cancelled")}):null,O==="failed"?a.jsx("strong",{children:t("feishu.status.failed")}):null]}),O==="preparing"||O==="running"||O==="cancelling"?a.jsx("ol",{className:"feishu-deployment-steps",children:K9e.map((G,H)=>{const se=O==="running"&&Hvoid z(),children:t("feishu.cancelDeployment")}):null,a.jsx("button",{type:"submit",className:"feishu-submit",disabled:!ne,children:t(V?"feishu.creating":"feishu.create")})]})]})]})]})})]})}async function CK(e,t,n,i=ho){var s;const r=await yn(e,{...t,headers:{accept:"application/json",...t.headers},signal:n},i);if(!r.ok){let o="";try{o=((s=(await r.json()).detail)==null?void 0:s.trim())||""}catch{}throw new Error(o||Q("common.requestFailed",{status:r.status}))}return r.json()}function Qtn(e){return CK("/web/coding-agents/capabilities",{method:"GET"},e,pz)}function ztn(e,t){return CK(`/web/coding-agents/skills/${encodeURIComponent(e)}/preview`,{method:"GET"},t)}function Vtn(e,t){return CK("/web/coding-agents/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)},t)}const Htn="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='16'%20height='16'%20rx='3.692'%20fill='%231A1B1D'/%3e%3cpath%20d='M13.235%205.829V4.332H2.758v5.987h1.496v1.496h8.981V5.828Zm-1.497%204.49H4.254V5.83h7.484v4.49Z'%20fill='%2332F08C'/%3e%3cpath%20d='M6.937%206.993%205.88%208.051%206.937%209.11%207.995%208.05%206.937%206.993ZM9.931%206.992%208.873%208.05%209.931%209.11%2010.99%208.05%209.93%206.992Z'%20fill='%2332F08C'/%3e%3c/svg%3e";function qtn(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m4 4 8 8m0-8-8 8",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function gle(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[a.jsx("path",{d:"M4 1.8h5l3 3V14H4z",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),a.jsx("path",{d:"M9 1.8V5h3M6 8h4M6 10.5h4",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function ble(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M1.8 4.5h4l1.2-1.3h2.2l1.2 1.3h3.8v8H1.8z",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"})})}function Wtn(e){return e instanceof DOMException&&e.name==="AbortError"}function Ktn(e){return e instanceof Error&&e.message?e.message:""}function Gtn(e){return e<1024?`${e} B`:`${(e/1024).toFixed(e<10*1024?1:0)} KB`}function Xtn(e){const t=e.split("/");return t[t.length-1]??e}function Ytn(e){const t=new Map;for(const n of e){const i=n.path.split("/"),r=i.length>1?i.slice(0,-1).join("/"):"";t.set(r,[...t.get(r)??[],n])}return Array.from(t,([n,i])=>({directory:n,files:i})).sort((n,i)=>n.directory?i.directory?n.directory.localeCompare(i.directory):1:-1)}function Ztn({skill:e,onClose:t}){const{t:n}=Te("automations"),i=p.useRef(null),r=p.useRef(null),s=p.useId(),o=p.useId(),[l,c]=p.useState(null),[u,d]=p.useState(""),[f,h]=p.useState(!0),[m,g]=p.useState(""),[b,v]=p.useState(0);p.useEffect(()=>{r.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const O=i.current;return O&&!O.open&&O.showModal(),()=>{var k;O!=null&&O.open&&O.close(),(k=r.current)==null||k.focus()}},[]),p.useEffect(()=>{const O=new AbortController;return h(!0),g(""),c(null),d(""),ztn(e.id,O.signal).then(k=>{if(O.signal.aborted)return;c(k);const S=k.files.find(C=>C.path==="SKILL.md")??k.files[0];d((S==null?void 0:S.path)??"")}).catch(k=>{!O.signal.aborted&&!Wtn(k)&&g(Ktn(k))}).finally(()=>{O.signal.aborted||h(!1)}),()=>O.abort()},[b,e.id]);const y=p.useMemo(()=>Ytn((l==null?void 0:l.files)??[]),[l]),w=(l==null?void 0:l.files.find(O=>O.path===u))??null,x=n(`codingAgents.skills.items.${e.id}.name`,{defaultValue:e.name});return a.jsxs("dialog",{ref:i,className:"coding-agents-preview-dialog","aria-labelledby":s,"aria-describedby":o,onCancel:O=>{O.preventDefault(),t()},onMouseDown:O=>{const k=O.currentTarget.getBoundingClientRect();(O.clientXk.right||O.clientYk.bottom)&&t()},children:[a.jsxs("header",{className:"coding-agents-preview-header",children:[a.jsx("span",{className:"coding-agents-preview-mark",children:a.jsx(ble,{})}),a.jsxs("div",{children:[a.jsx("h2",{id:s,children:x}),a.jsx("p",{id:o,children:n("codingAgents.preview.description")})]}),a.jsx("button",{type:"button",autoFocus:!0,"aria-label":n("codingAgents.preview.close"),onClick:t,children:a.jsx(qtn,{})})]}),f?a.jsxs("div",{className:"coding-agents-preview-state",children:[a.jsx("i",{}),n("codingAgents.preview.loading")]}):m?a.jsxs("div",{className:"coding-agents-preview-state is-error",role:"alert",children:[a.jsx("span",{children:m||n("codingAgents.preview.error")}),a.jsx("button",{type:"button",onClick:()=>v(O=>O+1),children:n("codingAgents.retry")})]}):a.jsxs("div",{className:"coding-agents-preview-layout",children:[a.jsxs("nav",{className:"coding-agents-preview-tree","aria-label":n("codingAgents.preview.skillFiles",{name:x}),children:[a.jsxs("div",{className:"coding-agents-preview-tree-title",children:[a.jsx("span",{children:n("codingAgents.preview.files")}),a.jsx("small",{children:(l==null?void 0:l.files.length)??0})]}),a.jsx("div",{className:"coding-agents-preview-tree-scroll",children:y.map(O=>O.directory?a.jsxs("details",{open:!0,children:[a.jsxs("summary",{children:[a.jsx(ble,{}),a.jsx("span",{children:O.directory})]}),a.jsx("div",{children:O.files.map(k=>a.jsxs("button",{type:"button",className:u===k.path?"is-selected":"","aria-current":u===k.path?"true":void 0,onClick:()=>d(k.path),children:[a.jsx(gle,{}),a.jsx("span",{children:Xtn(k.path)})]},k.path))})]},O.directory):O.files.map(k=>a.jsxs("button",{type:"button",className:u===k.path?"is-selected":"","aria-current":u===k.path?"true":void 0,onClick:()=>d(k.path),children:[a.jsx(gle,{}),a.jsx("span",{children:k.path})]},k.path)))})]}),a.jsx("section",{className:"coding-agents-preview-file","aria-label":n("codingAgents.preview.fileContent"),children:w?a.jsxs(a.Fragment,{children:[a.jsxs("header",{children:[a.jsx("strong",{children:w.path}),a.jsx("span",{children:Gtn(w.size)})]}),w.previewable&&w.content!==null?a.jsx("pre",{tabIndex:0,children:a.jsx("code",{children:w.content})}):a.jsx("div",{className:"coding-agents-preview-unavailable",children:n("codingAgents.preview.notPreviewable")})]}):a.jsx("div",{className:"coding-agents-preview-unavailable",children:n("codingAgents.preview.noFiles")})})]})]})}function Jtn(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"m9.8 3.5-4.5 4.5 4.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function enn(e){return a.jsxs("svg",{viewBox:"0 0 32 32",fill:"none","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"5",width:"16",height:"16",rx:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),a.jsx("path",{d:"m8.5 11-2.4 2.4 2.4 2.4M11 16.5h3.8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),a.jsx("circle",{cx:"24.5",cy:"10.5",r:"2.5",stroke:"currentColor",strokeWidth:"1.5"}),a.jsx("circle",{cx:"24.5",cy:"24.5",r:"2.5",stroke:"currentColor",strokeWidth:"1.5"}),a.jsx("path",{d:"M19.5 10.5H22M18.2 19l4.3 3.7M24.5 13v9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function tnn(e){return a.jsx("svg",{viewBox:"0 0 32 32",fill:"none","aria-hidden":"true",...e,children:a.jsxs("g",{stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",children:[a.jsx("path",{d:"M16 4.5v7M16 20.5v7"}),a.jsx("path",{d:"m9.3 6.3 3.5 6.1M19.2 19.6l3.5 6.1"}),a.jsx("path",{d:"m5.9 11.1 6.2 3.5M19.9 17.4l6.2 3.5"}),a.jsx("path",{d:"M4.7 16h7M20.3 16h7"}),a.jsx("path",{d:"m5.9 20.9 6.2-3.5M19.9 14.6l6.2-3.5"}),a.jsx("path",{d:"m9.3 25.7 3.5-6.1M19.2 12.4l3.5-6.1"})]})})}function nnn(e){return a.jsxs("svg",{viewBox:"0 0 32 32",fill:"none","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M15.8 4.2c2.4 0 4.5 1.2 5.7 3.1 2.2-.3 4.5.8 5.6 2.9 1.1 2 .8 4.4-.5 6.1 1.2 1.8 1.3 4.3.1 6.2-1.2 2-3.4 3-5.6 2.6-1.3 1.8-3.5 2.9-5.8 2.7-2.2-.2-4.1-1.5-5.1-3.4-2.2.1-4.4-1-5.4-3.1-1-2-.6-4.4.8-6.1-1.1-1.9-1.1-4.3.2-6.1 1.3-1.9 3.6-2.7 5.7-2.2 1.1-1.7 2.6-2.7 4.3-2.7Z",stroke:"currentColor",strokeWidth:"1.7",strokeLinejoin:"round"}),a.jsx("path",{d:"m10.7 12.2 3.1 3.8-3.1 3.8M17.1 20h4.3",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})}function yle(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"m3.4 8.2 3 3L12.8 5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function inn(e){return a.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",...e,children:[a.jsx("path",{d:"M2.8 6.3h14.4v8.3a1.6 1.6 0 0 1-1.6 1.6H4.4a1.6 1.6 0 0 1-1.6-1.6V6.3Z",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round"}),a.jsx("path",{d:"M2.8 6.3V5.1a1.4 1.4 0 0 1 1.4-1.4h3.4l1.5 1.6h6.5a1.6 1.6 0 0 1 1.6 1.6",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round"})]})}function rnn({agentId:e}){return e==="trae"?a.jsx("img",{src:Htn,alt:"","aria-hidden":"true"}):e==="claude-code"?a.jsx(tnn,{}):a.jsx(nnn,{})}function vle(e){return e instanceof DOMException&&e.name==="AbortError"}function xle(e,t){return e instanceof Error&&e.message?e.message:t}function snn({onBack:e}){var R;const{t}=Te("automations"),[n,i]=p.useState(null),[r,s]=p.useState(!0),[o,l]=p.useState(null),[c,u]=p.useState(0),[d,f]=p.useState(new Set),[h,m]=p.useState(new Set),[g,b]=p.useState(null),[v,y]=p.useState(!1),[w,x]=p.useState(null),O=p.useRef(null);p.useEffect(()=>{const A=new AbortController;return s(!0),l(null),Qtn(A.signal).then(N=>{if(A.signal.aborted)return;i(N);const P=N.agents.filter(I=>I.available);f(I=>{const D=P.filter(_=>I.has(_.id));return new Set((D.length?D:P.slice(0,1)).map(_=>_.id))}),m(I=>{const D=N.skills.filter(_=>I.has(_.id));return new Set((D.length?D:N.skills).map(_=>_.id))})}).catch(N=>{!vle(N)&&!A.signal.aborted&&(i(null),l(xle(N,"")))}).finally(()=>{A.signal.aborted||s(!1)}),()=>A.abort()},[c]),p.useEffect(()=>()=>{var A;return(A=O.current)==null?void 0:A.abort()},[]);const k=p.useMemo(()=>(n==null?void 0:n.agents.filter(A=>A.available&&d.has(A.id)))||[],[n,d]),S=p.useMemo(()=>(n==null?void 0:n.skills.filter(A=>h.has(A.id)))||[],[n,h]),C=!!(!v&&k.length&&S.length),E=(A,N)=>{!N||v||(x(null),f(P=>{const I=new Set(P);return I.has(A)?I.delete(A):I.add(A),I}))},j=A=>{v||(x(null),m(N=>{const P=new Set(N);return P.has(A)?P.delete(A):P.add(A),P}))},T=async()=>{var N;if(!C)return;(N=O.current)==null||N.abort();const A=new AbortController;O.current=A,y(!0),x(null);try{const P=await Vtn({agents:k.map(D=>D.id),skills:S.map(D=>D.id)},A.signal);if(A.signal.aborted)return;const I=P.installations;x({tone:"success",agentCount:k.length,skillCount:S.length,installations:I})}catch(P){!vle(P)&&!A.signal.aborted&&x({tone:"error",message:xle(P,"")})}finally{O.current===A&&(O.current=null),A.signal.aborted||y(!1)}};return a.jsxs("section",{className:"coding-agents-page",children:[a.jsxs("header",{className:"coding-agents-header",children:[a.jsx("button",{type:"button",className:"coding-agents-back",onClick:e,disabled:v,"aria-label":t("backToAutomations"),children:a.jsx(Jtn,{})}),a.jsx(enn,{className:"coding-agents-logo"}),a.jsxs("div",{children:[a.jsx("h1",{children:t("codingAgents.title")}),a.jsx("p",{children:t("codingAgents.description")})]})]}),a.jsx("div",{className:"coding-agents-scroll",children:a.jsxs("div",{className:"coding-agents-content",children:[a.jsxs("section",{className:"coding-agents-section","aria-label":t("codingAgents.clients.ariaLabel"),children:[a.jsxs("div",{className:"coding-agents-section-heading",children:[a.jsxs("div",{children:[a.jsx("span",{children:"1"}),a.jsx("h2",{children:t("codingAgents.clients.title")})]}),a.jsx("button",{type:"button",onClick:()=>u(A=>A+1),disabled:r||v,children:t("codingAgents.clients.detectAgain")})]}),r?a.jsxs("div",{className:"coding-agents-inline-state",children:[a.jsx("i",{}),t("codingAgents.clients.detecting")]}):o!==null?a.jsxs("div",{className:"coding-agents-error-row",role:"alert",children:[a.jsx("span",{children:o||t("codingAgents.errors.detect")}),a.jsx("button",{type:"button",onClick:()=>u(A=>A+1),children:t("codingAgents.retry")})]}):a.jsx("div",{className:"coding-agents-agent-grid",children:n==null?void 0:n.agents.map(A=>a.jsxs("button",{type:"button",className:`coding-agents-agent ${d.has(A.id)?"is-selected":""}`,"aria-pressed":d.has(A.id),disabled:!A.available||v,onClick:()=>E(A.id,A.available),title:A.available?A.name:A.reason,children:[a.jsx("span",{className:`coding-agents-agent-mark is-${A.id}`,children:a.jsx(rnn,{agentId:A.id})}),a.jsxs("span",{className:"coding-agents-agent-copy",children:[a.jsx("strong",{children:A.name}),a.jsx("small",{children:A.available?A.version||t("codingAgents.clients.detected"):A.reason})]}),a.jsx("span",{className:`coding-agents-status ${A.available?"is-ready":""}`,children:A.available?t("codingAgents.clients.available"):t("codingAgents.clients.unavailable")}),a.jsx("span",{className:"coding-agents-check",children:a.jsx(yle,{})})]},A.id))})]}),a.jsxs("section",{className:"coding-agents-section","aria-label":t("codingAgents.skills.ariaLabel"),children:[a.jsx("div",{className:"coding-agents-section-heading",children:a.jsxs("div",{children:[a.jsx("span",{children:"2"}),a.jsx("h2",{children:t("codingAgents.skills.title")})]})}),a.jsx("div",{className:"coding-agents-skill-list",children:n==null?void 0:n.skills.map(A=>a.jsxs("div",{className:`coding-agents-skill ${h.has(A.id)?"is-selected":""}`,children:[a.jsxs("label",{children:[a.jsx("input",{type:"checkbox",checked:h.has(A.id),onChange:()=>j(A.id),disabled:v}),a.jsx("span",{className:"coding-agents-skill-check","aria-hidden":"true",children:a.jsx(yle,{})}),a.jsxs("span",{children:[a.jsx("strong",{children:t(`codingAgents.skills.items.${A.id}.name`,{defaultValue:A.name})}),a.jsx("small",{children:t(`codingAgents.skills.items.${A.id}.description`,{defaultValue:A.description})})]})]}),a.jsx("button",{type:"button",onClick:()=>b(A),children:t("codingAgents.skills.viewFiles")})]},A.id))}),a.jsxs("div",{className:"coding-agents-global","aria-label":t("codingAgents.global.ariaLabel"),children:[a.jsxs("div",{className:"coding-agents-global-heading",children:[a.jsx(inn,{}),a.jsxs("div",{children:[a.jsx("strong",{children:t("codingAgents.global.title")}),a.jsx("span",{children:t("codingAgents.global.description")})]})]}),k.length?a.jsx("dl",{children:k.map(A=>a.jsxs("div",{children:[a.jsx("dt",{children:A.name}),a.jsx("dd",{children:A.globalSkillsPath})]},A.id))}):a.jsx("p",{children:t("codingAgents.global.empty")})]})]}),w?a.jsxs("div",{className:`coding-agents-result is-${w.tone}`,role:w.tone==="error"?"alert":"status",children:[a.jsx("strong",{children:w.tone==="success"?t("codingAgents.success",{agentCount:w.agentCount,skillCount:w.skillCount}):w.message||t("codingAgents.errors.configure")}),(R=w.installations)!=null&&R.length?a.jsx("ul",{children:w.installations.map(A=>a.jsxs("li",{children:[A.agentName," · ",t(`codingAgents.skills.items.${A.skillId}.name`,{defaultValue:A.skill})," → ",A.displayPath]},`${A.agent}:${A.skillId}`))}):null]}):null,a.jsxs("div",{className:"coding-agents-actions",children:[a.jsx("span",{children:k.length?t("codingAgents.selection",{agentCount:k.length,skillCount:S.length}):t("codingAgents.selectClient")}),a.jsx("button",{type:"button",onClick:()=>void T(),disabled:!C,children:t(v?"codingAgents.configuring":"codingAgents.configure")})]})]})}),g?a.jsx(Ztn,{skill:g,onClose:()=>b(null)}):null]})}const ann="data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20overflow='visible'%20style='display:%20block;'%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='down'%3e%3cpath%20id='&%23229;&%23189;&%23162;&%23231;&%23138;&%23182;'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.46129%203.67509C3.22783%203.44164%202.84933%203.44164%202.61587%203.67509L2.19316%204.0978C1.9597%204.33126%201.9597%204.70977%202.19316%204.94322L5.57484%208.32491C5.6922%208.44226%205.8462%208.50062%206.00001%208.49999C6.15382%208.50062%206.30782%208.44226%206.42518%208.32491L9.80686%204.94322C10.0403%204.70977%2010.0403%204.33126%209.80686%204.0978L9.38415%203.67509C9.15069%203.44164%208.77219%203.44164%208.53873%203.67509L6.00001%206.21381L3.46129%203.67509Z'%20fill='%23737A87'/%3e%3c/g%3e%3c/svg%3e";function G9e({options:e,value:t,defaultValue:n,onChange:i,className:r="",style:s,disabled:o,id:l,ref:c,tabIndex:u,"aria-label":d,"aria-labelledby":f,...h}){var D;const m=p.useId(),g=`${m}-list`,b=p.useRef(null),v=p.useRef(null),y=p.useRef(null);p.useImperativeHandle(c,()=>v.current);const[w,x]=p.useState(n??((D=e.find(_=>!_.disabled))==null?void 0:D.value)??""),O=t??w,k=e.find(_=>_.value===O),[S,C]=p.useState(!1),[E,j]=p.useState(0),[T,R]=p.useState({left:0,top:0,width:0,maxHeight:240}),A=p.useRef({text:"",time:0});function N(){if(o)return;const _=e.findIndex(L=>L.value===O&&!L.disabled);j(_>=0?_:e.findIndex(L=>!L.disabled)),C(!0)}function P(_){var F;const L=e[_];!L||L.disabled||(v.current&&O!==L.value&&(v.current.value=L.value,v.current.dispatchEvent(new Event("change",{bubbles:!0}))),C(!1),(F=b.current)==null||F.focus())}function I(_){if(["ArrowDown","ArrowUp","Home","End"].includes(_.key)){if(_.preventDefault(),!S){N();return}const L=e.map((M,V)=>M.disabled?-1:V).filter(M=>M>=0);if(!L.length)return;const F=L.indexOf(E);j(_.key==="Home"?L[0]:_.key==="End"?L[L.length-1]:L[(F+(_.key==="ArrowDown"?1:-1)+L.length)%L.length])}else if(_.key==="Enter"||_.key===" ")_.preventDefault(),S?P(E):N();else if(_.key==="Escape")S&&_.preventDefault(),C(!1);else if(_.key==="Tab")C(!1);else if(_.key.length===1&&!_.ctrlKey&&!_.metaKey&&!_.altKey){const L=Date.now();A.current={text:(L-A.current.time<600?A.current.text:"")+_.key.toLowerCase(),time:L};const F=e.findIndex(M=>!M.disabled&&M.label.toLowerCase().startsWith(A.current.text));F>=0&&(j(F),C(!0))}}return p.useLayoutEffect(()=>{if(!S)return;function _(){var z;const L=(z=b.current)==null?void 0:z.getBoundingClientRect();if(!L)return;const F=window.innerHeight-L.bottom-12,M=L.top-12,V=e.reduce((Z,ne)=>Z+(ne.description?48:28),0),q=Math.min(240,V+Math.max(0,e.length-1)*4+10),U=FF,J=Math.max(28,Math.min(240,U?M:F));R({left:Math.max(8,Math.min(L.left,window.innerWidth-L.width-8)),top:U?L.top-Math.min(q,J)-6:L.bottom+6,width:L.width,maxHeight:J})}return _(),window.addEventListener("resize",_),window.addEventListener("scroll",_,!0),()=>{window.removeEventListener("resize",_),window.removeEventListener("scroll",_,!0)}},[S,e]),p.useEffect(()=>{if(!S)return;function _(L){var F,M;L.target instanceof Node&&!((F=b.current)!=null&&F.contains(L.target))&&!((M=y.current)!=null&&M.contains(L.target))&&C(!1)}return document.addEventListener("pointerdown",_),()=>document.removeEventListener("pointerdown",_)},[S]),p.useEffect(()=>{o&&C(!1)},[o]),p.useEffect(()=>{var _,L,F;S&&((F=(L=(_=y.current)==null?void 0:_.querySelector(`[data-index="${E}"]`))==null?void 0:L.scrollIntoView)==null||F.call(L,{block:"nearest"}))},[E,S]),a.jsxs("span",{className:`studio-select ${r}`.trim(),style:s,"data-disabled":o||void 0,children:[a.jsxs("button",{ref:b,id:l,type:"button",role:"combobox",className:"studio-select__display",disabled:o,tabIndex:u,"aria-label":d,"aria-labelledby":f,"aria-expanded":S,"aria-haspopup":"listbox","aria-controls":S?g:void 0,"aria-activedescendant":S&&E>=0?`${m}-option-${E}`:void 0,"aria-required":h.required,onClick:()=>S?C(!1):N(),onKeyDown:I,children:[a.jsxs("span",{className:"studio-select__content",children:[(k==null?void 0:k.icon)&&a.jsx("span",{className:"studio-select__icon","aria-hidden":"true",children:k.icon}),a.jsx("span",{className:"studio-select__label",children:k==null?void 0:k.label})]}),a.jsx("img",{className:"studio-select__arrow","data-open":S,src:ann,alt:""})]}),a.jsx("select",{...h,ref:v,className:"studio-select__native","aria-hidden":"true",tabIndex:-1,disabled:o,value:O,onChange:_=>{t===void 0&&x(_.target.value),i==null||i(_)},children:e.map(_=>a.jsx("option",{value:_.value,disabled:_.disabled,children:_.label},_.value))}),S&&yi.createPortal(a.jsx(yf,{ref:y,id:g,role:"listbox","aria-label":d??"选项","aria-labelledby":f,className:"studio-select-menu",contentClassName:"studio-select-menu__items",style:T,children:e.map((_,L)=>a.jsxs("div",{id:`${m}-option-${L}`,role:"option","aria-label":_.label,"aria-describedby":_.description?`${m}-description-${L}`:void 0,"aria-selected":_.value===O,"aria-disabled":_.disabled||void 0,"data-active":L===E,"data-index":L,"data-description":!!_.description||void 0,className:"studio-select-menu__option",onPointerMove:()=>!_.disabled&&j(L),onMouseDown:F=>F.preventDefault(),onClick:()=>P(L),children:[_.icon&&a.jsx("span",{className:"studio-select__icon","aria-hidden":"true",children:_.icon}),_.description?a.jsxs("span",{className:"studio-select-menu__text",children:[a.jsx("span",{className:"studio-select__label",children:_.label}),a.jsx("span",{id:`${m}-description-${L}`,className:"studio-select-menu__description",title:_.description,children:_.description})]}):a.jsx("span",{className:"studio-select__label",children:_.label}),_.value===O&&a.jsx("svg",{className:"studio-select-menu__check",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m3 8 3 3 7-7",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})]},_.value))}),document.body)]})}function onn(e){return a.jsxs("span",{className:"studio-radio__control",children:[a.jsx("input",{...e,className:"studio-radio__input",type:"radio"}),a.jsx("span",{className:"studio-radio__box","aria-hidden":"true",children:a.jsx("span",{className:"studio-radio__dot"})})]})}function lnn({label:e,className:t="",...n}){return a.jsxs("label",{className:`studio-radio ${t}`.trim(),children:[a.jsx(onn,{...n}),e!=null&&a.jsx("span",{className:"studio-radio__label",children:e})]})}const $k={QR_CODE_READY:"QR_CODE_READY",AUTH_SUCCESS:"AUTH_SUCCESS",AUTH_ERROR:"AUTH_ERROR",AUTH_CANCEL:"AUTH_CANCEL",WINDOW_CLOSE:"WINDOW_CLOSE"},wle={WINDOW_BLOCKED:"WINDOW_BLOCKED",CANCELLED:"CANCELLED"},cnn={authOrigin:"https://work.weixin.qq.com",width:950,height:640,debug:!1},unn=500;class dnn{constructor(){this.handlers=new Map}on(t,n){const i=this.handlers.get(t)||[];return i.push(n),this.handlers.set(t,i),this}off(t,n){if(!n)return this.handlers.delete(t),this;const i=this.handlers.get(t);if(i){const r=i.filter(s=>s!==n);r.length>0?this.handlers.set(t,r):this.handlers.delete(t)}return this}emit(t,...n){const i=this.handlers.get(t);i&&i.forEach(r=>{try{r(...n)}catch(s){console.error(`[WecomAIBotSDK] Event handler error for "${t}":`,s)}})}removeAll(){this.handlers.clear()}listenerCount(t){var n,i;return(i=(n=this.handlers.get(t))===null||n===void 0?void 0:n.length)!==null&&i!==void 0?i:0}}class X9e{constructor(){this.authWindow=null,this.pollingTimer=null,this.messageListener=null,this.config={...cnn},this.emitter=new dnn,this.setupMessageListener()}openBotInfoAuthWindow(t){var n;this.validateOptions(t),this.mergeConfig(t);const i=t.state||this.generateState(),r=this.buildAuthUrl(t.source,i),s=this.buildWindowFeatures();if(this.authWindow=window.open(r,"WecomAIBotAuthWindow",s),!this.authWindow){const o={code:wle.WINDOW_BLOCKED,message:"弹窗被拦截,请允许弹窗或点击手动打开"};return this.emitter.emit("error",o),(n=t.onError)===null||n===void 0||n.call(t,o),Promise.reject(o)}return this.startPolling(),new Promise((o,l)=>{const c=()=>{this.emitter.off("success",u),this.emitter.off("error",d),this.emitter.off("cancel",f)},u=h=>{c(),o(h)},d=h=>{c(),l(h)},f=()=>{c(),l({code:wle.CANCELLED,message:"用户取消授权"})};this.emitter.on("success",u),this.emitter.on("error",d),this.emitter.on("cancel",f),t.onCreated&&this.emitter.on("success",t.onCreated),t.onError&&this.emitter.on("error",t.onError)})}closeWindow(){this.authWindow&&!this.authWindow.closed&&this.authWindow.close(),this.authWindow=null,this.stopPolling()}destroy(){this.closeWindow(),this.removeMessageListener(),this.emitter.removeAll(),this.log("SDK destroyed")}on(t,n){return this.emitter.on(t,n),this}off(t,n){return this.emitter.off(t,n),this}validateOptions(t){if(!t.source)throw new Error("[WecomAIBotSDK] source is required")}mergeConfig(t){t.authOrigin&&(this.config.authOrigin=t.authOrigin),t.width!=null&&(this.config.width=t.width),t.height!=null&&(this.config.height=t.height),t.debug!=null&&(this.config.debug=t.debug)}buildAuthUrl(t,n){const i=new URLSearchParams({source:t,state:n,timestamp:String(Date.now())});return`${this.config.authOrigin}/ai/qc/gen?${i.toString()}`}buildWindowFeatures(){const{width:t,height:n}=this.config,i=(window.screen.width-t)/2,r=(window.screen.height-n)/2;return[`width=${t}`,`height=${n}`,`left=${i}`,`top=${r}`,"resizable=false","scrollbars=false","status=no","toolbar=no","menubar=no","location=no"].join(",")}generateState(){return`state_${Math.random().toString(36).substring(2,11)}_${Date.now()}`}setupMessageListener(){this.messageListener=t=>{var n;if(t.origin!==this.config.authOrigin){this.log("Message from unknown origin:",t.origin);return}const i=t.data;if(!(!i||!i.type))switch(this.log("Message received:",i.type,i.payload),i.type){case $k.QR_CODE_READY:{this.emitter.emit("ready",i.payload);break}case $k.AUTH_SUCCESS:{this.emitter.emit("success",i.payload),this.closeWindow();break}case $k.AUTH_ERROR:{const r=((n=i.payload)===null||n===void 0?void 0:n.error)||i.payload;this.emitter.emit("error",r),this.closeWindow();break}case $k.AUTH_CANCEL:{this.emitter.emit("cancel",null),this.closeWindow();break}case $k.WINDOW_CLOSE:{this.closeWindow();break}}},window.addEventListener("message",this.messageListener)}removeMessageListener(){this.messageListener&&(window.removeEventListener("message",this.messageListener),this.messageListener=null)}startPolling(){this.stopPolling(),this.pollingTimer=setInterval(()=>{var t;!((t=this.authWindow)===null||t===void 0)&&t.closed&&(this.stopPolling(),this.authWindow=null,this.emitter.emit("cancel",null))},unn)}stopPolling(){this.pollingTimer&&(clearInterval(this.pollingTimer),this.pollingTimer=null)}log(...t){this.config.debug&&console.log("[WecomAIBotSDK]",...t)}}const Y9e=new X9e;typeof window<"u"&&(window.WecomAIBotSDK=Y9e);Y9e.destroy();class CS extends Error{constructor(t){super("WeCom authorization failed"),this.code=t}}function fnn(e){if(e.aborted)return Promise.reject(new DOMException("Cancelled","AbortError"));const t=new X9e;return new Promise((n,i)=>{let r=!1;const s=()=>{r=!0,clearTimeout(c),e.removeEventListener("abort",l),t.destroy()},o=u=>{r||(s(),i(u))},l=()=>o(new DOMException("Cancelled","AbortError")),c=setTimeout(()=>o(new CS("AUTH_TIMEOUT")),3e5);e.addEventListener("abort",l,{once:!0});try{t.openBotInfoAuthWindow({source:"mpa-agent",state:crypto.randomUUID(),debug:!1}).then(u=>{if(!r){if(typeof(u==null?void 0:u.botid)!="string"||!u.botid.trim()||typeof(u==null?void 0:u.secret)!="string"||!u.secret.trim()){o(new CS("INVALID_RESULT"));return}s(),n({botId:u.botid.trim(),secret:u.secret.trim()})}},u=>{const d=u&&typeof u=="object"&&"code"in u&&typeof u.code=="string"?u.code:"FAILED";o(new CS(d))})}catch{o(new CS("FAILED"))}})}const Gv=["feishu","wecom","dingtalk"];function hnn(e){const{t}=Te("ui"),[n,i]=p.useState("feishu"),r=p.useId(),s=p.useRef([]);return a.jsxs("div",{className:"message-channels",children:[e.showHeader!==!1&&a.jsxs("div",{className:"message-channels-header",children:[a.jsx("h2",{children:t("channels.workspaceTitle")}),a.jsx("p",{children:t("channels.workspaceDescription")})]}),a.jsx("div",{className:"message-channels-tabs",role:"tablist","aria-label":t("channels.workspaceTitle"),children:Gv.map((o,l)=>a.jsx("button",{ref:c=>{s.current[l]=c},type:"button",role:"tab",id:`${r}-${o}`,"aria-controls":`${r}-panel`,"aria-selected":n===o,tabIndex:n===o?0:-1,onClick:()=>i(o),onKeyDown:c=>{var d;let u;if(c.key==="ArrowRight")u=(l+1)%Gv.length;else if(c.key==="ArrowLeft")u=(l+Gv.length-1)%Gv.length;else if(c.key==="Home")u=0;else if(c.key==="End")u=Gv.length-1;else return;c.preventDefault(),i(Gv[u]),(d=s.current[u])==null||d.focus()},children:t(`channels.provider_${o}`)},o))}),a.jsx("div",{role:"tabpanel",id:`${r}-panel`,"aria-labelledby":`${r}-${n}`,tabIndex:0,children:a.jsx(mnn,{...e,provider:n},`${e.region}:${e.runtimeId}:${n}`)})]})}function O6({label:e,value:t,complete:n,description:i}){return a.jsxs("div",{className:"runtime-channels-status-card",children:[a.jsx("dt",{children:e}),a.jsxs("dd",{children:[a.jsxs("span",{className:`runtime-channels-status-value${n?" is-complete":""}`,children:[a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"12",cy:"12",r:"9"}),n?a.jsx("path",{d:"m8 12 3 3 5-6"}):a.jsx("path",{d:"M12 7v5l3 2"})]}),t]}),a.jsx("p",{children:i})]})]})}const Cj=new Set(["BOUND","FAILED","EXPIRED"]),pnn=["group_sender","group","group_topic_sender","group_topic"];function mnn({runtimeId:e,region:t,provider:n}){var Pe;const{t:i}=Te("ui"),r=p.useMemo(()=>({runtimeId:e,region:t}),[e,t]),s=p.useId(),[o,l]=p.useState("quick"),[c,u]=p.useState(null),[d,f]=p.useState(null),[h,m]=p.useState([]),[g,b]=p.useState(!1),[v,y]=p.useState(null),[w,x]=p.useState(""),[O,k]=p.useState(""),[S,C]=p.useState(!1),[E,j]=p.useState(!1),[T,R]=p.useState(!1),[A,N]=p.useState(""),[P,I]=p.useState("group_sender"),[D,_]=p.useState(""),[L,F]=p.useState(!1),[M,V]=p.useState(!0),[q,U]=p.useState(0),J=p.useRef(!0),z=p.useRef(null),Z=p.useRef(null),ne=p.useRef(!1),W=`mpa-${n}-binding:${t}:${e}`,G=Ee=>{if(!J.current)return;if(Ee instanceof CS){const _e={WINDOW_BLOCKED:"wecomPopupBlocked",CANCELLED:"wecomAuthCancelled",AUTH_TIMEOUT:"wecomAuthTimeout",INVALID_RESULT:"wecomInvalidResult"}[Ee.code]||"wecomAuthFailed";_(i(`channels.${_e}`));return}const ze=Ee instanceof tI?Ee.status:0;ze===409&&R(!0),_(i(`channels.${ze===409?"uncertain":ze===404?"unsupported":ze===401||ze===403?"unauthorized":ze===503?"configurationError":"requestFailed"}`))};async function H(Ee){const[ze,_e]=await Promise.all([Xd(r,`/${n}/diagnostics`,{signal:Ee}),n==="feishu"?Xd(r,"/chat-permissions?channel=feishu",{signal:Ee}):Promise.resolve({permissions:[]})]);!Ee.aborted&&J.current&&(f(ze),m(_e.permissions))}p.useEffect(()=>{J.current=!0;try{sessionStorage.removeItem(W)}catch{}return()=>{var Ee,ze;J.current=!1,(Ee=z.current)==null||Ee.abort(),(ze=Z.current)==null||ze.abort()}},[]),p.useEffect(()=>{var ze;const Ee=new AbortController;return V(!0),_(""),u(null),y(null),b(!1),j(!1),(ze=Z.current)==null||ze.abort(),(async()=>{try{const _e=await Xd(r,"/capabilities",{signal:Ee.signal});if(Ee.signal.aborted)return;if(!_e.serverSideBinding||!(_e.channels??["feishu"]).includes(n))throw new tI(404);u(_e),await H(Ee.signal)}catch(_e){Ee.signal.aborted||G(_e)}finally{Ee.signal.aborted||V(!1)}})(),()=>Ee.abort()},[r,q]),p.useEffect(()=>{if(o!=="quick"||!v||Cj.has(v.status)||L)return;const Ee=new AbortController;Z.current=Ee;const ze=window.setTimeout(()=>{Xd(r,`/${n}/bindings/${encodeURIComponent(v.id)}`,{signal:Ee.signal}).then(async _e=>{Ee.signal.aborted||(y(_e),_e.lastErrorCode==="REGISTRATION_UNCERTAIN"&&R(!0),_e.status==="BOUND"&&await H(Ee.signal))}).catch(_e=>{Ee.signal.aborted||G(_e)})},Math.max(1,v.pollAfterSeconds)*1e3);return()=>{window.clearTimeout(ze),Ee.abort()}},[v,r,L,q,o]);async function se(Ee){var _e;if(z.current)return;const ze=new AbortController;z.current=ze,F(!0),_(""),(_e=Z.current)==null||_e.abort();try{await Ee(ze.signal)}catch(ae){ze.signal.aborted||G(ae)}finally{z.current===ze&&(z.current=null,J.current&&F(!1))}}function Y(Ee=!1){se(async ze=>{b(!0),Ee||y(null);const _e=await Xd(r,Ee&&v?`/${n}/bindings/${encodeURIComponent(v.id)}/retry`:`/${n}/bindings`,{method:"POST",body:"{}",signal:ze});ze.aborted||(y(_e),_e.lastErrorCode==="REGISTRATION_UNCERTAIN"&&R(!0),_e.status==="BOUND"&&await H(ze))})}function X(){se(async Ee=>{b(!0),j(!1),C(!0),ne.current=!0;try{const ze=await fnn(Ee);if(Ee.aborted)return;ne.current=!1,C(!1),await Xd(r,"/wecom/bindings",{method:"POST",body:JSON.stringify(ze),signal:Ee}),Ee.aborted||(j(!0),k(""),x(""),await H(Ee))}finally{J.current&&!Ee.aborted&&(ne.current=!1,C(!1))}})}const ie=n==="wecom"||!!((Pe=c==null?void 0:c.credentialBindingChannels)!=null&&Pe.includes(n)),ee=!!v&&!Cj.has(v.status),be=L||M||T||ee,ue=M||L&&!S;function pe(Ee){var ze,_e;Ee===o||M||z.current&&!ne.current||((ze=z.current)==null||ze.abort(),z.current=null,ne.current=!1,(_e=Z.current)==null||_e.abort(),F(!1),C(!1),y(null),b(!1),j(!1),x(""),k(""),_(""),l(Ee))}const ke=Ee=>{try{const ze=new URL(Ee||"");return ze.protocol==="https:"?ze.href:void 0}catch{return}},je=n==="wecom"&&c&&a.jsxs(a.Fragment,{children:[a.jsx(_t,{color:"primary",size:"sm",disabled:L||M||T||!c.bindingReady,onClick:X,children:i(d!=null&&d.configured?"channels.newQr":"channels.bind")}),S&&a.jsxs(a.Fragment,{children:[a.jsx("span",{role:"status",children:i("channels.wecomAuthorizing")}),a.jsx(_t,{color:"secondary",variant:"outline",size:"sm",onClick:()=>{var Ee;(Ee=z.current)==null||Ee.abort(),ne.current=!1,C(!1)},children:i("channels.cancelAuthorization")})]})]});return a.jsxs("section",{className:"runtime-channels","aria-label":i(`channels.provider_${n}`),"aria-busy":M||L,children:[a.jsxs("div",{className:"runtime-channels-heading",children:[a.jsx("h3",{children:i("channels.providerBindingTitle",{name:i(`channels.provider_${n}`)})}),a.jsx(_t,{color:"secondary",variant:"outline",size:"sm",disabled:L||M,onClick:()=>U(Ee=>Ee+1),children:i("channels.refresh")})]}),M&&a.jsx("p",{role:"status",children:a.jsx(fn,{children:i("channels.loading")})}),D&&a.jsxs("div",{className:"aw-integration-error",role:"alert",children:[a.jsx("span",{children:D}),a.jsx(_t,{color:"secondary",variant:"outline",size:"sm",disabled:L||M,onClick:()=>U(Ee=>Ee+1),children:i("common.retry")})]}),c&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"runtime-channels-binding-summary",children:[a.jsx("span",{className:`runtime-channels-badge${d!=null&&d.configured?" is-bound":""}`,children:i(d!=null&&d.configured?"channels.connected":"channels.notBound")}),a.jsx("p",{children:d!=null&&d.configured?i("channels.bound",{name:d.appName||d.appId}):i("channels.providerUnbound",{name:i(`channels.provider_${n}`)})})]}),!c.bindingReady&&a.jsx("p",{role:"alert",children:i("channels.keyRequired")}),d&&a.jsxs("dl",{className:"runtime-channels-diagnostics",children:[a.jsx(O6,{label:i("channels.gateway"),value:i(d.gatewayConfigured?"channels.configured":"channels.missing"),complete:d.gatewayConfigured,description:i("channels.gatewayDescription")}),a.jsx(O6,{label:i("channels.route"),value:i(d.routeConfigured?"channels.configured":"channels.missing"),complete:d.routeConfigured,description:i("channels.routeDescription")}),a.jsx(O6,{label:i("channels.delivery"),value:i(`channels.delivery_${d.deliveryHealth}`,{defaultValue:i("channels.delivery_not_observed")}),complete:d.deliveryHealth==="delivered",description:i("channels.deliveryDescription")})]}),!!(d!=null&&d.missingConfiguration.length)&&a.jsx("p",{role:"alert",children:i("channels.missingConfig",{fields:d.missingConfiguration.join(", ")})}),a.jsxs("fieldset",{className:"runtime-channels-methods",children:[a.jsx("legend",{children:i("channels.configurationMethod")}),a.jsx("div",{children:["quick","manual"].map(Ee=>a.jsx(lnn,{name:`${s}-method`,value:Ee,checked:o===Ee,disabled:ue,label:a.jsx("span",{className:"runtime-channels-method-label","data-selected":o===Ee,children:i(`channels.${Ee}Setup`)}),onChange:()=>pe(Ee)},Ee))})]}),a.jsx("p",{children:i(o==="quick"?"channels.qrGuidance":"channels.manualGuidance",{name:i(`channels.provider_${n}`)})}),o==="manual"&&(d==null?void 0:d.configured)&&a.jsx("p",{children:i("channels.manualReplacement")}),o==="manual"&&!ie&&a.jsx("p",{children:i("channels.manualUpgrade",{name:i(`channels.provider_${n}`)})}),o==="manual"&&ie&&a.jsxs("form",{className:"runtime-channels-form","data-channel-binding":!0,onSubmit:Ee=>{Ee.preventDefault(),!(!w.trim()||!O.trim()||be||!c.bindingReady)&&se(async ze=>{await Xd(r,n==="wecom"?"/wecom/bindings":`/${n}/bindings/manual`,{method:"POST",body:JSON.stringify(n==="wecom"?{botId:w.trim(),secret:O.trim()}:n==="feishu"?{appId:w.trim(),appSecret:O.trim()}:{clientId:w.trim(),clientSecret:O.trim()}),signal:ze}),ze.aborted||(k(""),x(""),await H(ze))})},children:[a.jsxs("label",{children:[i(n==="wecom"?"channels.wecomBotId":n==="feishu"?"channels.feishuAppId":"channels.dingtalkClientId"),a.jsx("input",{name:n==="wecom"?"botId":n==="feishu"?"appId":"clientId",value:w,required:!0,autoComplete:"off",disabled:be,onChange:Ee=>x(Ee.target.value),onKeyDown:Ee=>{Ee.key==="Enter"&&(Ee.nativeEvent.isComposing||Ee.nativeEvent.keyCode===229)&&Ee.preventDefault()}})]}),a.jsxs("label",{children:[i(n==="wecom"?"channels.wecomSecret":n==="feishu"?"channels.feishuAppSecret":"channels.dingtalkClientSecret"),a.jsx("input",{name:"secret",type:"password",value:O,required:!0,autoComplete:"new-password",disabled:be,onChange:Ee=>k(Ee.target.value),onKeyDown:Ee=>{Ee.key==="Enter"&&(Ee.nativeEvent.isComposing||Ee.nativeEvent.keyCode===229)&&Ee.preventDefault()}})]}),a.jsx(_t,{color:"primary",size:"sm",type:"submit",disabled:be||!c.bindingReady||!w.trim()||!O.trim()||T,children:i("channels.bindCredentials")})]}),T&&a.jsx("p",{role:"alert",children:i("channels.uncertain")}),a.jsxs("div",{className:"runtime-channels-actions",children:[o==="quick"&&je,o==="quick"&&n!=="wecom"&&a.jsx(_t,{color:"primary",size:"sm",disabled:L||M||!c.bindingReady||T||!!v&&!Cj.has(v.status),onClick:()=>Y(),children:i(v||d!=null&&d.configured||g?"channels.newQr":"channels.bind")}),(d==null?void 0:d.configured)&&a.jsx(_t,{color:"danger",variant:"outline",size:"sm",disabled:L,onClick:()=>{window.confirm(i("channels.confirmUnbind"))&&se(async Ee=>{await Xd(r,`?channel=${n}&appId=${encodeURIComponent(d.appId||"")}`,{method:"DELETE",signal:Ee}),Ee.aborted||(y(null),b(!1),j(!1),R(!1),await H(Ee))})},children:i("channels.unbind")})]}),o==="quick"&&(v||g)&&a.jsxs("div",{className:"runtime-channels-binding-progress",role:"status","aria-live":"polite",children:[a.jsx("h3",{children:i("channels.pairingTitle")}),n==="feishu"&&a.jsx("p",{children:i("channels.feishuPairingDescription")}),n==="wecom"&&a.jsx("p",{children:i("channels.wecomPairingDescription")}),n==="wecom"&&E&&a.jsx("p",{children:i("channels.status_BOUND")}),!v&&L&&a.jsx("p",{children:a.jsx(fn,{children:i(n==="wecom"?S?"channels.wecomAuthorizing":"channels.status_REGISTERING":"channels.generatingQr")})}),v&&a.jsxs(a.Fragment,{children:[v.status!=="PENDING"&&a.jsx("p",{children:i(`channels.status_${v.status}`)}),!Cj.has(v.status)&&a.jsx(a.Fragment,{children:ke(v.qrCodeImage)&&a.jsx("img",{className:"runtime-channels-qr",src:ke(v.qrCodeImage),alt:i("channels.qrAlt"),referrerPolicy:"no-referrer"})}),v.lastErrorCode&&a.jsx("p",{children:v.lastErrorCode==="REGISTRATION_UNCERTAIN"?i("channels.uncertain"):i("channels.bindingFailed")}),v.status==="FAILED"&&v.lastErrorCode!=="REGISTRATION_UNCERTAIN"&&a.jsx(_t,{color:"secondary",variant:"outline",size:"sm",disabled:L,onClick:()=>Y(!0),children:i("common.retry")})]})]}),n==="feishu"&&a.jsxs("section",{className:"runtime-channels-permissions","aria-label":i("channels.groupsTitle"),children:[a.jsxs("div",{className:"runtime-channels-heading",children:[a.jsx("h3",{children:i("channels.groupsTitle")}),a.jsx("span",{className:"runtime-channels-count",children:h.length})]}),a.jsx("p",{children:i("channels.groupsDescription")}),a.jsxs("form",{className:"runtime-channels-form",onSubmit:Ee=>{Ee.preventDefault(),!(!A.trim()||L)&&se(async ze=>{await Xd(r,"/chat-permissions",{method:"POST",body:JSON.stringify({channel:n,chatId:A.trim(),groupSessionScope:P}),signal:ze}),ze.aborted||(N(""),await H(ze))})},children:[a.jsxs("label",{children:[i("channels.chatId"),a.jsx("input",{value:A,required:!0,disabled:L,onChange:Ee=>N(Ee.target.value),onKeyDown:Ee=>{Ee.key==="Enter"&&(Ee.nativeEvent.isComposing||Ee.nativeEvent.keyCode===229)&&Ee.preventDefault()}})]}),a.jsxs("label",{children:[i("channels.scope"),a.jsx(G9e,{style:{width:"100%",minWidth:0,background:"hsl(var(--background))",color:"hsl(var(--foreground))",border:"1px solid hsl(var(--border))"},value:P,disabled:L,options:pnn.map(Ee=>({value:Ee,label:i(`channels.scope_${Ee}`)})),onChange:Ee=>I(Ee.target.value)})]}),a.jsx(_t,{color:"primary",size:"sm",type:"submit",disabled:L||!A.trim(),children:i("channels.saveGroup")})]}),!h.length&&a.jsx("p",{className:"runtime-channels-empty",children:i("channels.noGroups")}),a.jsx("ul",{className:"runtime-channels-groups",children:h.map(Ee=>a.jsxs("li",{children:[a.jsxs("span",{children:[Ee.chatName||Ee.chatId," ·"," ",i(`channels.scope_${Ee.groupSessionScope||"group"}`)]}),a.jsx(_t,{color:"danger",variant:"ghost",size:"sm",className:"runtime-channels-remove-group",disabled:L,"aria-label":i("channels.removeGroup",{name:Ee.chatName||Ee.chatId}),onClick:()=>void se(async ze=>{await Xd(r,`/chat-permissions?channel=${n}&chat_id=${encodeURIComponent(Ee.chatId)}`,{method:"DELETE",signal:ze}),await H(ze)}),children:a.jsx(xT,{})})]},Ee.chatId))})]})]})]})}const Fk=e=>`${e.region}:${e.runtimeId}`;function gnn({role:e,runtimeScope:t,onBack:n}){const{t:i}=Te("automations"),r=e==="admin"||e==="super_admin";return a.jsxs("div",{className:"mpa-channels-page",children:[a.jsxs("header",{className:"mpa-channels-header",children:[a.jsx("button",{type:"button",className:"mpa-channels-back","aria-label":i("backToAutomations"),onClick:n,children:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"m14 6-6 6 6 6"})})}),a.jsx(B9e,{className:"mpa-channels-icon"}),a.jsxs("div",{children:[a.jsx("h1",{children:i("cards.mpa-channels.name")}),a.jsx("p",{children:i("cards.mpa-channels.description")})]})]}),a.jsx("div",{className:"mpa-channels-scroll",children:r?a.jsx(bnn,{runtimeScope:t},`${e}:${t}`):a.jsx("p",{className:"mpa-channels-notice",role:"status",children:i("mpaChannels.unauthorized")})})]})}function bnn({runtimeScope:e}){const{t,i18n:n}=Te("automations"),[i,r]=p.useState([]),[s,o]=p.useState(""),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(!0),[m,g]=p.useState(!1),[b,v]=p.useState(null),y=p.useRef(null),w=p.useRef("");async function x(C=""){var j;(j=y.current)==null||j.abort();const E=new AbortController;y.current=E,h(!0),v(null),w.current=C;try{const T=await Q0({agentCategory:"mpa",scope:e,region:"all",pageSize:100,nextToken:C||void 0,signal:E.signal});if(E.signal.aborted)return;const R=T.runtimes.filter(A=>A.runtimeId&&A.region&&(A.agentCategory==="mpa"||A.agentCategory===void 0));r(A=>[...new Map((C?[...A,...R]:R).map(N=>[Fk(N),N])).values()]),C||o(A=>R.some(N=>Fk(N)===A)?A:""),d(T.nextToken),g(!0)}catch(T){if(E.signal.aborted)return;const R=T instanceof ID&&(T.status===401||T.status===403);v(R?"unauthorized":"loadFailed"),R&&(r([]),o(""),d(""),g(!1),w.current="")}finally{E.signal.aborted||h(!1)}}p.useEffect(()=>(x(),()=>{var C;return(C=y.current)==null?void 0:C.abort()}),[]);const O=i.find(C=>Fk(C)===s),k=l.trim().toLocaleLowerCase(),S=i.filter(C=>`${C.name} ${C.runtimeId} ${C.region}`.toLocaleLowerCase().includes(k)).map(C=>{var j,T;const E=FT(C.createdAt,Date.now(),n.resolvedLanguage||n.language);return{value:Fk(C),label:C.name||C.runtimeId,description:((j=C.description)==null?void 0:j.trim())||t("mpaChannels.noDescription"),metadata:`${t("mpaChannels.optionMetadata",{creator:((T=C.author)==null?void 0:T.trim())||t("mpaChannels.unknownCreator"),createdAt:E})} -${C.region} · ${C.runtimeId}`}});return a.jsxs("div",{className:"mpa-channels-content",children:[a.jsxs("section",{className:"mpa-channels-picker","aria-label":t("mpaChannels.selectAgent"),children:[a.jsxs("div",{className:"mpa-channels-picker-heading",children:[a.jsx("h2",{children:t("mpaChannels.selectAgent")}),a.jsx("button",{type:"button",className:"mpa-channels-action",disabled:f,onClick:()=>void x(),children:t("mpaChannels.refresh")})]}),a.jsx(vf,{ariaLabel:t("mpaChannels.selectAgent"),placeholder:t("mpaChannels.chooseAgent"),value:s,valueLabel:(O==null?void 0:O.name)||(O==null?void 0:O.runtimeId),options:S,disabled:!i.length,searchValue:l,searchPlaceholder:t("mpaChannels.search"),emptyMessage:t("mpaChannels.noMatches"),onSearchChange:c,onChange:o}),O&&a.jsxs("p",{className:"mpa-channels-target",children:[O.region," · ",O.runtimeId]}),f&&a.jsx(fn,{as:"p",role:"status",children:t("mpaChannels.loading")}),b&&a.jsxs("div",{className:"mpa-channels-error",role:"alert",children:[a.jsx("p",{children:t(`mpaChannels.${b}`)}),a.jsx("button",{type:"button",className:"mpa-channels-action",onClick:()=>void x(w.current),children:t("mpaChannels.retry")})]}),!f&&!b&&m&&!i.length&&!u&&a.jsx("p",{role:"status",children:t("mpaChannels.empty")}),u&&a.jsxs("div",{className:"mpa-channels-pagination",children:[a.jsx("p",{children:t("mpaChannels.moreAvailable")}),a.jsx("button",{type:"button",className:"mpa-channels-action",disabled:f,onClick:()=>void x(u),children:t("mpaChannels.loadMore")})]})]}),O?a.jsx(hnn,{runtimeId:O.runtimeId,region:O.region,showHeader:!1},Fk(O)):m&&i.length>0?a.jsx("p",{className:"mpa-channels-notice",role:"status",children:t("mpaChannels.chooseHint")}):null]})}async function AK(e,t){const n=await e.json().catch(()=>null),i=typeof(n==null?void 0:n.detail)=="string"?n.detail:"";return new Error(i||Q("common.fallbackWithHttpStatus",{fallback:t,status:e.status}))}async function ynn(e){const t=await yn("/web/website-integrations",{cache:"no-store",signal:e});if(!t.ok)throw await AK(t,Q("websiteIntegration.listFailed"));return(await t.json()).integrations??[]}async function vnn(e){const t=await yn("/web/website-integrations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await AK(t,Q("websiteIntegration.createFailed"));return t.json()}async function xnn(e){const t=await yn(`/web/website-integrations/${encodeURIComponent(e)}`,{method:"DELETE"});if(!t.ok)throw await AK(t,Q("websiteIntegration.deleteFailed"))}function wnn(e){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:a.jsx("path",{d:"m9.8 3.5-4.5 4.5 4.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ole(e){return a.jsxs("svg",{viewBox:"0 0 32 32",fill:"none","aria-hidden":"true",...e,children:[a.jsx("rect",{x:"3.5",y:"5",width:"20",height:"17",rx:"3.5",stroke:"currentColor",strokeWidth:"1.5"}),a.jsx("path",{d:"M4.5 10h18M8.5 7.5h.1M11.5 7.5h.1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),a.jsx("path",{d:"M17 18.5a5 5 0 0 1 5-5h1.5a5 5 0 0 1 5 5V23a5 5 0 0 1-5 5H22l-3.5 2.5v-3.3A5 5 0 0 1 17 23v-4.5Z",fill:"hsl(var(--background))",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),a.jsx("path",{d:"M21 19h4M21 22.5h3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function Onn(e,t){const n=new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleString(t,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}async function knn(e){const t=[];let n="";for(let i=0;i<10;i+=1){const r=await Q0({nextToken:n||void 0,pageSize:100,region:"all",scope:"all"});if(e.aborted)return[];if(t.push(...r.runtimes),n=r.nextToken,!n)break}return t}function Snn({onBack:e}){const{t,i18n:n}=Te("websiteIntegration"),[i,r]=p.useState([]),[s,o]=p.useState([]),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(""),[m,g]=p.useState(!0),[b,v]=p.useState(!1),[y,w]=p.useState(""),[x,O]=p.useState("");p.useEffect(()=>{const R=new AbortController;return g(!0),O(""),Promise.all([ynn(R.signal),knn(R.signal)]).then(([A,N])=>{var I;if(R.signal.aborted)return;r(A),o(N),d(((I=A[0])==null?void 0:I.id)??"");const P=N[0];P&&c(`${P.region}::${P.runtimeId}`)}).catch(A=>{R.signal.aborted||O(A instanceof Error?A.message:t("errors.load"))}).finally(()=>{R.signal.aborted||g(!1)}),()=>R.abort()},[t]);const k=p.useMemo(()=>s.map(R=>({value:`${R.region}::${R.runtimeId}`,label:R.name||R.runtimeId,description:`${R.region} · ${R.status}`,runtime:R})),[s]),S=p.useMemo(()=>new Map(k.map(R=>[R.value,R.runtime])),[k]),C=i.find(R=>R.id===u)??i[0],E=C?` - + +
    diff --git a/veadk/webui/website-integration.js b/veadk/webui/website-integration.js index 5f716ec6f..7d1875327 100644 --- a/veadk/webui/website-integration.js +++ b/veadk/webui/website-integration.js @@ -63,12 +63,12 @@ Your goal is to understand the user's request accurately and provide clear, conc Guidelines: - Ask clarifying questions when information is missing. Do not invent facts. - Use available tools when appropriate and explain key conclusions. -- Maintain a polite, professional tone.`},d$e={requestFailed:"Request failed ({{status}}){{detail}}",a2aSpaces:{credentialsMissing:"The server does not have cloud provider credentials configured, so AgentKit agent centers are unavailable",loginRequired:"Sign in to access AgentKit agent centers"},vikingKnowledge:{credentialsMissing:"The server does not have cloud provider credentials configured, so VikingDB knowledge bases are unavailable",loginRequired:"Sign in to access VikingDB knowledge bases"},vikingMemory:{credentialsMissing:"The server does not have cloud provider credentials configured, so VikingDB memory stores are unavailable",loginRequired:"Sign in to access VikingDB memory stores"},mcpGateway:{missingHttpTool:"Go back to Add MCP tool and add at least one HTTP MCP service. MCP resilience does not support stdio services.",missingUrl:"An HTTP MCP tool is missing a valid service URL. Go back to Add MCP tool and complete it before publishing."},customModel:{fallbackName:"Custom model",apiKeyLabel:"{{name}} model API Key",fallbackApiKeyLabel:"{{name}} fallback model {{model}} API Key"},deploymentEnv:{serverInjected:"Provided by the server",selectedApiKeyPlaceholder:"Provided by the selected API Key",mcpInjectedComment:"Provided by the added MCP tools",restoredPlaceholder:"Securely restored by the Studio server",generatedMcpPlaceholder:"Generated from the added HTTP MCP tools",restoredHelp:"When updating, the Studio server merges MCP addresses and authentication without returning existing secrets to the browser.",mergedMcpHelp:"The Studio server merges MCP addresses and optional authentication without returning existing secrets to the browser.",listSeparator:", ",requirementHint:"Required by the following optimizations: {{labels}}.",requiredBy:"Required by the following optimizations: {{labels}}. Enter {{key}}.",required:"Enter {{label}} ({{key}}).",invalidJson:"Invalid JSON format"},drafts:{unsupportedVersion:"This local draft version is not supported. Upgrade Studio and try again.",invalidFormat:"The local draft data is invalid.",readFailed:"Could not read local drafts. The browser data may be corrupted.",quotaExceeded:"Browser storage is full, so the draft was not saved. Delete unused drafts or clear this site's storage, then try again.",writeRejected:"The browser blocked saving this draft. Check the site's storage permissions and try again."},skills:{searchFailed:"Search failed ({{status}})",downloadFailed:"Skill download failed ({{status}})",agentKitRequestFailed:"AgentKit Skills request failed",missingManifest:"{{location}} is missing SKILL.md",invalidParentPath:"{{location}} contains an invalid parent path (..): {{path}}",invalidPath:"{{location}} contains an invalid path: {{path}}",localDescription:"Local skill",folderSource:"Folder",noManifest:"No SKILL.md was found in {{location}}"},zip:{invalid:"Invalid zip: EOCD was not found",tooManyFiles:"A zip file cannot contain more than {{count}} files",tooLarge:"The extracted zip content is too large"}},h$e={back:"Back to development session",runtimeName:"Runtime name",runtimeNameExists:"This Runtime name already exists. Choose another name.",checkingRuntimeName:"Checking Runtime name",verifiedSource:"Verified source",deployableSource:"Deployable source",verifiedByCodex:"Verified by Codex in the cloud",entryPoint:"Entry point",files:"Files",artifact:"Artifact",validationReport:"Validation report",verifiedHint:"The server materializes source from the verified artifact. Browser files cannot replace it.",unverifiedHint:"The server securely materialized the source. Confirm the Runtime configuration before deploying.",env:{requiredPlaceholder:"Enter {{key}}",optionalPlaceholder:"Optional: {{key}}"}},f$e={name:"Code package",back:"Back to creation methods",reading:"Reading the code package",readingEllipsis:"Reading the code package…",uploadFirst:"Upload a code package first",uploadAriaLabel:"Code package upload",upload:"Upload code package",reupload:"Upload a different code package",uploadPrompt:"Upload a code package",filesRecognized:"{{count}} files found. Select this area to upload a different package.",dropHint:"Select or drop a .zip file up to 50 MB. Use app.py or declare an entry point in agentkit.yaml.",viewFiles:"View files",chooseFile:"Choose code package",errors:{invalidFormat:"Choose a .zip code package.",tooLarge:"The code package must be 50 MB or smaller.",invalidPath:"The archive contains an invalid path: {{name}}",empty:"The archive does not contain any deployable files.",tooManyFiles:"A code package cannot contain more than {{count}} files.",duplicateFile:"The code package contains a duplicate file: {{path}}",manifestParse:"Could not parse agentkit.yaml: {{detail}}",manifestRoot:"The root of agentkit.yaml must be an object.",manifestCommon:"common in agentkit.yaml must be an object.",entryPointType:"common.entry_point in agentkit.yaml must be a file path.",entryPointInvalid:"common.entry_point in agentkit.yaml is not a valid file path.",entryPointMissing:"The entry point declared in agentkit.yaml is missing from the code package: {{entryPoint}}",defaultEntryPointMissing:"The code package root must contain app.py, or common.entry_point in agentkit.yaml must declare an existing entry point."}},p$e={label:"Agent execution canvas",readOnlyLabel:"Read-only agent execution canvas",minimapLabel:"Execution flow minimap",controls:{ariaLabel:"Execution flow controls",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Fit view"},rootAgent:"Main agent",unnamedStep:"Unnamed step",terminals:{input:"User request",output:"Final response"},edges:{then:"Then",continueLoop:"Continue loop",call:"Call"},patterns:{llm:{label:"Agent",description:"Understand a task and complete one specific job"},sequential:{label:"Sequential",description:"Run internal steps one after another"},parallel:{label:"Parallel",description:"Run internal steps together, then combine their results"},loop:{label:"Loop",description:"Repeat internal steps until the stop condition is met"},a2a:{label:"Remote agent",description:"Call an existing remote agent"}},actions:{insertHere:"Insert a step here",deleteNamed:"Delete {{name}}",deleteNode:"Delete node",addSubagent:"Add subagent",addParallelStep:"Add a parallel step",addLoopStep:"Add a loop step",addNextStep:"Add next step",addFirst:"Add at the beginning",addLast:"Add at the end"}},g$e={title:"Intelligent build",subtitle:"Describe what you need. Build, debug, and validate your agent.",model:{label:"Model",placeholder:"Select a model",retiring:"Retiring soon",currentConfiguration:"Current configuration",loadError:"Failed to load models"},availability:{checking:"Checking intelligent development availability…",unavailable:"Intelligent mode is currently unavailable. Go back and try again."},goal:{title:"Start with a goal",continueTitle:"Continue improving the project",hint:"Describe the problem your agent should solve. We will ask about any details that could affect the result.",continueHint:"Describe what you want to change. The result will be saved as a new version.",basedOn:"Based on",clearSelection:"Clear selection",label:"Goal",optimizationLabel:"Optimization goal",placeholder:"For example: Build an agent that reads sales data, creates weekly reports, and validates the output format",optimizationPlaceholder:"For example: Cite data sources and ask the user when information is incomplete"},actions:{preparing:"Preparing…",build:"Start building",optimize:"Start optimizing"},preparation:{accepted:"Goal received. Implementation is starting now.",preparing:"Creating the task environment…",starting:"Environment ready. Starting Codex…",next:"Next, Codex will plan the approach, then build, run, and validate the agent."},tasks:{title:"Tasks in progress",hint:"Work continues when you leave. Return to follow progress or add instructions.",refresh:"Refresh tasks",loading:"Loading tasks…",empty:"No tasks in progress",emptyHint:"Once a build starts, you can return to it here.",loadError:"Unable to load tasks. Please retry.",openError:"Unable to open this task. Please retry.",startedAt:"Started {{time}}",open:"Open task",opening:"Connecting…",states:{queued:"Queued",running:"Building",recovering:"Reconnecting",waiting_user:"Awaiting your reply",stopping:"Stopping",succeeded:"Completed",failed:"Incomplete",cancelled:"Stopped"}}},m$e={title:"Saved projects",description:"Continue improving an existing version, or view, download, and deploy its source.",refresh:"Refresh projects",checkingStorage:"Checking project storage…",unavailableTitle:"Projects are temporarily unavailable",storageCheckError:"Could not confirm project storage status. Try again shortly.",storageNotConfigured:"Project storage is not configured.",loadingMigrated:"Loading migrated projects…",loadingSaved:"Loading saved projects…",loadingVersions:"Loading project versions…",unknownTime:"Unknown time",sourceDownloaded:"Source downloaded.",projectSummary_one:"{{count}} version · Updated {{time}}",projectSummary_other:"{{count}} versions · Updated {{time}}",versionSummary_one:"{{time}} · {{count}} file",versionSummary_other:"{{time}} · {{count}} files",noVersionDescription:"No version description",latestVersion:"Latest version",defaultVersionName:"Version · {{time}}",rename:{projectTitle:"Edit project name",versionTitle:"Edit version name",projectLabel:"Project name",versionLabel:"Version name",hint:"Use letters, numbers and common punctuation, up to {{max}} characters.",required:"Enter a name.",tooLong:"Names can contain up to {{max}} characters.",invalidCharacters:"Names cannot contain line breaks, control or invisible formatting characters, or < >.",save:"Save name",saving:"Saving…",updated:"Name updated.",failed:"Unable to save the name. Try again."},verified:"Verified",pendingVerification:"Needs review",viewSource:"View source",download:"Download",downloading:"Downloading…",optimize:"Optimize",optimizeUnavailable:"Optimize, not supported",errors:{projects:"Could not load saved projects.",source:"Could not load project source.",versions:"Could not load project versions.",download:"Could not download the source.",prepareDeployment:"Could not prepare the source for deployment.",deleteVersion:"Could not delete the project version.",migrated:"Could not load migrated projects",saved:"Could not load saved projects"},empty:{migratedTitle:"No migrated projects yet",savedTitle:"No saved projects yet",migratedDescription:"Source will be saved here after your first migration.",savedDescription:"Source will be saved here after your first build.",noVersions:"This project has no available versions."},compare:{selected:"{{count}}/2 selected",selectedLabel:"Selected",select:"Select",view:"View comparison",start:"Compare versions"},delete:{title:"Delete this version?",onlyVersion:"“{{name}}” has only one version. Deleting it will also remove the project. This cannot be undone.",description:"This version's source and validation records will be permanently deleted. Other versions are not affected.",confirm:"Delete version"}},v$e={title:"Choose how to create",subtitle:"Build your agent with the workflow that fits your needs",features:"Features",quick:{title:"Quick mode",description:"Delegate tasks to dynamically created subagents",features:{dynamicSubagents:"Dynamic subagents",autonomousPlanning:"Autonomous planning",collaboration:"Multi-agent collaboration",summary:"Automatic result summaries",skills:"Skills on demand",trace:"Traceable task execution"}},traditional:{title:"Advanced mode",description:"Customize your agent structure in detail",features:{visualConfig:"Visual configuration",migration:"Existing agent migration",debugging:"Live debugging",optimization:"Optional optimization",parameters:"Fine-grained controls"}}},y$e={placeholder:"Enter a system prompt. Type ## followed by a space to add a level-two heading…",toolbar:{undo:"Undo {{shortcut}}",redo:"Redo {{shortcut}}",paragraph:"Paragraph",quote:"Quote",heading:"Heading {{level}}",selectBlockType:"Select text style",blockType:"Text style",bold:"Bold",removeBold:"Remove bold",italic:"Italic",removeItalic:"Remove italic",bulletedList:"Bulleted list",numberedList:"Numbered list"}},b$e={local:{duplicatesSkipped:"Skipped duplicate skills: {{names}}",invalidDrop:"Drop a folder containing SKILL.md or a .zip file",readError:"Could not read the files: {{detail}}",dropLabel:"Drop a folder or ZIP file to detect skills automatically",hint:"Each skill must contain a SKILL.md file. Directories can contain multiple skills.",reading:"Reading files…",fileCount:"Local · {{count}} files"},hub:{searchError:"Search failed. Try again shortly.",searchPlaceholder:"Search Volcano Find Skill, such as data analysis or PDF",search:"Search",searching:"Searching…",noResults:"No matching skills found. Try another keyword.",hint:"Search Volcano Find Skill by keyword. Selected skills are downloaded to the skills/ directory when the project is generated."},space:{loadError:"Failed to load",loadingSpaces:"Loading AgentKit Skills centers…",noSpaces:"This account has no AgentKit Skills centers.",selectSpace:"Select an AgentKit Skills center",openConsole:"Open in the Volcano Engine console",loadingSkills:"Loading skills…",noSkills:"This AgentKit Skills center has no skills."}},x$e={unnamedNode:"Unnamed node",editInstruction:"Select to edit instructions…",controls:{ariaLabel:"Workflow canvas controls",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Fit view"},sections:{info:"Workflow information",execution:"Execution mode",nodes:"Nodes",nodeConfig:"Node configuration"},types:{sequential:{label:"Sequential",description:"Run nodes one after another"},parallel:{label:"Parallel",description:"Run nodes at the same time"},loop:{label:"Loop",description:"Run nodes repeatedly"}},placeholders:{description:"Describe what this workflow does…",agentDescription:"Describe what this agent does…",instruction:"You are…"},errors:{workflowNameUnique:"The workflow name must be unique among agent node names",agentNameUnique:"Agent names must be unique within this workflow"},dragHint:"Drag onto the canvas, or use the button below",agentNode:"Agent node",addNode:"Add node",connectHint:"Drag between node handles to define the execution order.",create:"Create workflow",deleteNode:"Delete node",nameHelp:"Use only letters, numbers, and underscores. Names must be unique.",instruction:"Instructions",tools:"Tools (comma-separated)",nodeId:"Node ID",empty:{selectNode:"Select a node to edit its configuration",summary:"{{nodes}} nodes · {{edges}} connections"}},w$e={ariaLabel:"Quick mode creation",progress:"Quick mode creation progress",steps:{agent:{label:"Agent",title:"Basic information",description:"Set the agent's name, purpose, behavior, and capabilities"},environment:{label:"Environment",title:"Configure the environment",description:"Choose the default environment or a custom environment you have built"},deployment:{label:"Deployment",title:"Deployment preferences",description:"Configure AgentKit cloud settings"}},model:{label:"Model",source:"Model source",name:"Model name",fallbacks:"Fallback models",fallbackPlaceholder:"Fallback model name",addFallback:"Add fallback model",addProviderFallback:"Add other provider",removeFallback:"Remove",fallbackType:"Fallback model type",fallbackSameProvider:"Same provider",fallbackOtherProvider:"Other provider",apiKeyEnv:"API Key environment variable",invalidApiKeyEnv:"Use letters, numbers, and underscores only, and do not start with a number.",fallbackHelp:"Same-provider fallbacks reuse the primary connection. Other providers use separate provider, API base, and API Key settings.",fallbackIgnored:"Empty, duplicate, or primary-model entries will be ignored.",provider:"Provider",invalidApiBase:"Enter a valid http:// or https:// URL.",volcengineArk:"Volcano Ark",custom:"Custom",gateway:"Model gateway",comingSoon:"Coming soon",currentApiKey:"Current API Key",currentConfiguration:"Current configuration",loadingApiKeys:"Loading API Keys",selectApiKey:"Select an API Key",searchApiKeys:"Search API Key names",noApiKeys:"No API Keys available",loadingModels:"Loading models",selectModel:"Select a model",searchModels:"Search by name, Model ID, or provider",noModels:"No models available",apiKeyPlaceholder:"Enter a model API Key",credentialsLoadError:"Failed to load model credentials",modelsLoadError:"Failed to load models"},identity:{unnamedPool:"Unnamed user pool",currentPool:"{{value}} (current user pool)",userPool:"User pool",loading:"Loading user pools",placeholder:"Select a user pool",search:"Search user pools",empty:"This account has no Identity user pools",currentHint:"This Studio's login JWT will be forwarded to the Runtime",mismatchHint:"The selected user pool is not used by this Studio, so the Studio will not be able to call the Runtime after deployment",selectionHint:"The user pool used by this Studio is marked in the list"},agent:{namePlaceholder:"Enter an agent name",descriptionPlaceholder:"Describe what this agent can do",prompt:"Prompt",promptPlaceholder:"Define the role, goals, and behavior boundaries",skills:"Skills",addSkill:"Add skills"},validation:{descriptionRequired:"Enter a description",promptRequired:"Enter a prompt",modelRequired:"Select a model",apiKeyRequired:"Enter or select the model API Key",instanceIntegers:"Minimum instances must be an integer of 0 or greater, and maximum instances must be an integer greater than 0",instanceOrder:"Minimum instances cannot exceed maximum instances",userPoolRequired:"Select a user pool for Runtime authentication"},deployment:{runtimeName:"Runtime name",runtimeNameUpdateHint:"The existing Runtime name is preserved during updates",runtimeNameHint:"Use only letters, numbers, underscores, and hyphens",region:"Deployment region",authentication:"Authentication",apiKeyDescription:"Default: access with the Runtime API Key",userPoolDescription:"Use a JWT issued by an Identity user pool",sessionStorage:"Session storage",inMemoryStorage:"Temporary in-memory storage",backends:{sqlite:"SQLite file",mysql:"MySQL",postgresql:"PostgreSQL"},instances:"Instance settings",minInstances:"Minimum instances",maxInstances:"Maximum instances",inMemoryHint:"To prevent session loss across instances, keep the Runtime at 1–1 instances",networkMode:"Network mode",network:{public:"Public",private:"Private",both:"Public and private"},subnetIds:"Subnet IDs (optional, comma-separated)",sharedInternet:"Shared public egress in the VPC",sharedInternetHint:"Allow private Runtimes to access the public internet through shared egress",evaluationSets:"Evaluation sets",createEvaluationSets:"Create evaluation sets automatically",evaluationSetsHint:"Create Good Case and Bad Case evaluation sets after deployment",resources:"Resource configuration",complete:"Deployment complete",preparing:"Preparing deployment…"},environmentVariables:{title:"Environment variables",add:"Add variable",nameAriaLabel:"Environment variable name",valueAriaLabel:"Value for {{name}}",deleteNamed:"Delete {{name}}"},actions:{updateAgain:"Update again",deployAgain:"Deploy again",updateAndPublish:"Update and publish",applyProfile:"Apply Profile",applyProfileAgain:"Apply Profile again"}},A$e={actions:{addSubagent:"Add subagent",clearRoot:"Clear main agent",clearRootConfirmation:"Clear all settings and subagents from the main agent? This cannot be undone."},workspace:{progress:"Agent creation progress",modes:{build:"Build",validate:"Debug",optimize:"Optimize",environment:"Environment",publish:"Publish"},titles:{build:"Customize your agent architecture",validate:"Debug your agent",optimize:"Choose optimizations for your agent",environment:"Configure the cloud environment",publish:"Prepare your agent for deployment"}},sections:{type:{label:"Agent type",hint:"Choose an agent type"},basic:{label:"Basic information",hint:"Name, description, and system prompt"},model:{label:"Model",hint:"Model and service (optional)"},tools:{label:"Tools",hint:"Callable capabilities"},skills:{label:"Skills",hint:"Declarative skills"},knowledge:{label:"Knowledge base",hint:"External knowledge retrieval"},memory:{label:"Memory",hint:"Short-term and long-term memory"},subagents:{label:"Subagents",hint:"Nested collaboration"},review:{label:"Finish",hint:"Preview and create"}},agentTypes:{ariaLabel:"Agent type",remoteChildOnly:"Remote agents can only be used as child steps",llm:{label:"Agent",fullLabel:"LLM agent",description:"Uses an LLM to complete tasks autonomously"},sequential:{label:"Sequential",fullLabel:"Sequential agent",description:"Runs subagents one after another"},parallel:{label:"Parallel",fullLabel:"Parallel agent",description:"Runs subagents in parallel, then combines their results"},loop:{label:"Loop",fullLabel:"Loop agent",description:"Repeats subagents until the stop condition is met"},a2a:{label:"Remote agent",fullLabel:"Remote agent",description:"Calls a remote agent through the A2A protocol"}},basic:{agentName:"Agent name",name:"Name",agentDescription:"Agent description",descriptionPlaceholder:"Briefly describe what this agent does so your team can identify it…",nameHelp:"Follow Google ADK naming rules and keep the name unique in the execution flow.",rootDescriptionHelp:"The full description is preserved and converted to a Runtime-compatible single line during deployment.",descriptionHelp:"The description appears in agent lists and selectors.",orchestratorHelp:"This is a collaboration container and does not answer directly. Add task steps on the canvas and drag them to reorder.",maxIterations:"Maximum iterations",maxIterationsHelp:"The loop repeats its subagents until the condition is met or this limit is reached.",agentCenter:"AgentKit agent center",agentCenterHelp:"The remote agent's name, description, and capabilities come from the Agent Card returned by the center. The system discovers and attaches matching agents for each task.",moreOptions:"More options",systemPrompt:"System prompt",loadingMarkdown:"Loading Markdown editor…",markdownHelp:"Markdown shortcuts are supported. For example, type ## followed by a space to create a level-two heading.",unnamed:"Unnamed",unnamedAgent:"Unnamed agent"},validation:{remoteRoot:"A remote agent can only be a subagent",missingRegistry:"Select an AgentKit agent center",name:{required:"Name is required",reserved:"user is reserved by Google ADK. Choose another name.",characters:"Start with a letter or underscore and use only letters, numbers, and underscores"},duplicateName:"Agent names must be unique within this structure",missingDescription:"Description is required",mcpDuplicateName:"MCP names must be unique",mcpDuplicateUrl:"Remove the duplicate MCP endpoint before publishing",missingSubagent:"A subagent is required",missingPrompt:"System prompt is required",apiKeyRequired:"Enter or select the model API Key",missingSubagentDetail:"Add at least one subagent to {{type}} before debugging or publishing.",problem:"{{name}}: {{problem}}"},ai:{ariaLabel:"Fill agent configuration with AI",minimumLength:"Enter at least {{count}} characters.",replaceConfirmation:"The generated configuration will replace the current canvas and settings. Continue?",placeholder:"Describe your goal and use {{model}} to generate the configuration",generate:"Generate",generating:"Generating",success:"Configuration generated",regenerate:"Generate again",failed:"Generation failed"},debug:{ariaLabel:"Agent debugging workspace",unavailable:"This backend does not currently support generated-agent debug runs.",baseline:"Baseline",comparison:"Variant {{count}}",selectModel:"Select a model",enterDescription:"Enter a description",enterPrompt:"Enter a system prompt",duplicateConfiguration:"Test configurations must be unique",starting:"Starting…",applyAndRestart:"Apply and restart",restart:"Restart",start:"Start environment",defaultModel:"Default model",testConfiguration:"Test configuration",deleteVariant:"Delete {{name}}",deleteVariantGroup:"Delete comparison variant",creatingEnvironment:"Creating the test environment…",configurationChanged:"The configuration changed. Restart the environment.",ready:"Environment ready",readyHint:"Send a message to compare agent responses.",startHint:"Complete the configuration, then start the environment.",viewTraceNamed:"View the trace for {{name}}",traceUnavailable:"Send a message to view its trace",trace:"Trace",useConfiguration:"Use this configuration",finishConfiguration:"Finish configuration",finishAndStart:"Finish and start",currentAgentModel:"Current agent model",configurationHint:"Changes apply only to this comparison. Select this configuration to continue to deployment.",messagePlaceholder:"Send a message to the running test environments…",startOneFirst:"Start at least one test environment first",addVariant:"Add variant",traceTitle:"Trace · {{name}}",leaveTitle:"Leave debugging?",leaveDescription:"The current environments will be removed when you leave. You can start new environments when you return.",cleaning:"Cleaning up…",confirmLeave:"Leave",closeLeaveConfirmation:"Close leave-debugging confirmation"},optimization:{ariaLabel:"Agent optimization options",scenario:"Optimization scenario",components:"Optimization components",bytePlusUnavailable:"Harness Sidecar optimizations are not available for BytePlus accounts yet. Leave all optimizations unselected to continue; regular BytePlus agents are not affected.",releaseScenario:"Optimization scenario: {{profile}}",profiles:{default:{label:"Custom",description:"Choose components as needed. The Sidecar stays off when none are selected."},ops:{label:"Operations",description:"For operations diagnostics, databases, logs, and monitoring MCP servers."}},groups:{quality:"Improve response quality",cost:"Reduce runtime cost",stability:"Improve runtime stability"},options:{context_engine:{label:"Context management",description:"Manage context assembly, task anchoring, and context budgets."},compressor:{label:"Context and result compression",description:"Compress long context and large tool results to reduce token usage."},verifier:{label:"Response verification and repair",description:"Verify evidence and responses, then repair or alert on failure."},long_run_control:{label:"Goal task control",description:"Manage progress, continuation, and completion conditions for Goal tasks."},mcp_resilience:{label:"MCP resilience",description:"Manage connections, timeouts, empty results, large responses, and call budgets. Includes read-only SQL protection by default."}}},model:{label:"Model",source:"Model source",volcanoArk:"Volcano Ark",volcengineArk:"Volcano Ark",bytePlusModelArk:"BytePlus ModelArk",custom:"Custom",gateway:"Model gateway",comingSoon:"Coming soon",configuration:"Model configuration",name:"Model name",fallbacks:"Fallback models",fallbackPlaceholder:"Fallback model name",addFallback:"Add fallback model",addProviderFallback:"Add other provider",removeFallback:"Remove",fallbackType:"Fallback model type",fallbackSameProvider:"Same provider",fallbackOtherProvider:"Other provider",apiKeyEnv:"API Key environment variable",invalidApiKeyEnv:"Use letters, numbers, and underscores only, and do not start with a number.",fallbackHelp:"Same-provider fallbacks reuse the primary connection. Other providers use separate provider, API base, and API Key settings.",fallbackIgnored:"Empty, duplicate, or primary-model entries will be ignored.",provider:"Provider",invalidApiBase:"Enter a valid http:// or https:// URL.",liteLlmProviders:"LiteLLM providers",apiKeyPlaceholder:"Enter the model API Key",available:"Available",retiring:"Retiring soon",notActivated:"Not activated",unavailable:"Unavailable",apiKeyLoadError:"Failed to load Ark API Keys",loadingApiKeys:"Loading API Keys…",selectApiKey:"Select an API Key",currentApiKey:"Current API Key",apiKeyList:"API Key list",searchApiKey:"Search API Keys",searchApiKeyName:"Search API Key names",noApiKeys:"No API Keys available",noMatchingApiKey:"No matching API Keys",loading:"Loading models…",loaded:"{{count}} models loaded",loadError:"Failed to load models",selectModel:"Select a model",selectProviderModel:"Select a provider model",providerModels:"Provider models",search:"Search models",searchPlaceholder:"Search by name, Model ID, or provider",noMatches:"No matching models",empty:"No models available",unknownStatus:"Unknown status",refresh:"Refresh",refreshing:"Refreshing…",activate:"Activate",activateAction:"Open activation",currentConfiguration:"Current configuration"},tools:{builtIn:"Built-in tools",builtInHelp:"Select VeADK capabilities. Imports and required environment variables are added automatically.",codeExecution:"Code execution configuration",codeExecutionHelp:"Select the AgentKit code execution sandbox.",mcp:"MCP tools"},catalog:{web_search:{label:"Web search",description:"Get real-time information with Volcengine Web Search."},parallel_web_search:{label:"Parallel web search",description:"Run multiple search queries in parallel and combine the results faster."},link_reader:{label:"Link reader",description:"Fetch and read the main content from a URL."},web_scraper:{label:"Web scraper",description:"Crawl webpages into structured data. Requires the Scraper service."},image_generate:{label:"Image generation",description:"Generate images from text with Doubao Seedream."},image_edit:{label:"Image editing",description:"Edit or transform images with Doubao SeedEdit."},video_generate:{label:"Video generation",description:"Generate videos from text or images with Doubao Seedance, including task status queries."},text_to_speech:{label:"Text to speech (TTS)",description:"Convert text to speech with Volcengine Speech."},run_code:{label:"Code execution",description:"Run code in a sandbox."},vesearch:{label:"VeSearch",description:"Search with Volcengine VeSearch. Requires a bot endpoint."},links:{console:"Console",documentation:"Documentation"},env:{modelAgentName:{comment:"Model name"},embeddingModelName:{comment:"Embedding model required by memory and knowledge bases"},vikingMemoryProject:{comment:"VikingDB memory project"},vikingMemoryRegion:{comment:"VikingDB memory region"},vikingMemoryType:{comment:"Memory types"},feishuAppId:{comment:"Feishu app ID"},feishuAppSecret:{comment:"Feishu app secret",placeholder:"Enter the app secret"},registrySpaceId:{comment:"AgentKit agent center",placeholder:"Select an agent center"},registryTopK:{comment:"Number of agents to retrieve"},registryRegion:{comment:"AgentKit agent center region"},registryEndpoint:{comment:"AgentKit agent center OpenAPI endpoint"},agentKitToolId:{comment:"Code execution sandbox ID"},agentKitToolRegion:{comment:"AgentKit Tools region"},openVikingUrl:{comment:"OpenViking service URL"},openVikingMemoryUserId:{comment:"Memory owner ID",help:"The user segment in viking://user//peers//memories. Use it to isolate agents, tenants, or business scenarios. The default is default."},openVikingMemoryPolicy:{comment:"Memory policy",help:"Controls memory extraction and isolation. Leave it blank to use the official default policy."},openVikingKnowledgeUserId:{comment:"Knowledge base owner ID",help:"Used in the default path viking://user//resources// when no resource directory is configured. The default is default."},openVikingTargetUri:{comment:"Knowledge base resource directory",help:"Leave blank to generate it from the KnowledgeBase index. When provided, this OpenViking resource directory takes precedence."},tlsServiceName:{comment:"TLS topic_id. Leave blank to create one automatically"}}},backends:{shortTerm:{local:{label:"In-memory",description:"Stored in the process without persistence. Best for development and debugging."},sqlite:{label:"SQLite file",description:"Persist data to a local .db file."},mysql:{label:"MySQL",description:"Persist data to MySQL."},postgresql:{label:"PostgreSQL",description:"Persist data to PostgreSQL."}},longTerm:{local:{label:"Local vector store",description:"In-process llama-index vector store."},opensearch:{label:"OpenSearch",description:"Vector retrieval with OpenSearch."},redis:{label:"Redis",description:"Vector retrieval with Redis."},viking:{label:"VikingDB Memory",description:"VikingDB memory with user profile support."},openviking:{label:"OpenViking Memory",description:"Long-term memory that stores and retrieves preferences, events, and entities per user."},mem0:{label:"Mem0",description:"Managed memory from Mem0."}},knowledge:{viking:{label:"VikingDB Knowledge",description:"VikingDB knowledge base."},opensearch:{label:"OpenSearch",description:"Vector retrieval with OpenSearch."},context_search:{label:"Context Search",description:"Volcengine Context Search without embedding configuration."},openviking:{label:"OpenViking Knowledge",description:"OpenViking resource-directory knowledge base without embedding configuration."}}},exporters:{apmplus:{label:"APMPlus",description:"Volcengine APMPlus application performance monitoring."},cozeloop:{label:"CozeLoop",description:"Distributed tracing with CozeLoop."},tls:{label:"TLS (Log Service)",description:"Export logs to Volcengine TLS."}},knowledge:{title:"Knowledge base",description:"Enable external knowledge retrieval (RAG) so the agent can answer from your data.",backend:"Knowledge base backend",vikingDatabase:"VikingDB knowledge base"},memory:{shortTerm:"Short-term memory",shortTermDescription:"Store context for one session",shortTermBackend:"Short-term memory backend",longTerm:"Long-term memory",longTermDescription:"Store context across sessions, usually with vector retrieval",longTermBackend:"Long-term memory backend",vikingDatabase:"VikingDB memory",autoSave:"Save sessions to long-term memory automatically",autoSaveDescription:"Write session content to long-term memory when a session ends."},mcp:{removeTool:"Remove MCP tool",namePlaceholder:"Name (optional)",urlPlaceholder:"MCP service URL",pathWarning:"This is a gateway root address. Use it only when the root path is the MCP endpoint; otherwise include the complete service path.",tokenPlaceholder:"Bearer token (optional)",showToken:"Show Bearer token",hideToken:"Hide Bearer token",commandPlaceholder:"Command, such as npx",argsPlaceholder:"Arguments separated by spaces",stdioHint:"The stdio tool starts in the deployment environment. Make sure its command and dependencies are available.",addTool:"Add MCP tool"},resources:{unnamedAgentCenter:"Unnamed agent center",unnamedKnowledgeBase:"Unnamed knowledge base",unnamedMemory:"Unnamed memory store",loadError:"Failed to load",loadingAgentCenters:"Loading agent centers…",agentCentersLoaded:"{{count}} agent centers loaded",noAgentCenters:"No agent centers available",noMatchingAgentCenters:"No matching agent centers",searchAgentKitCenter:"Search AgentKit agent centers",searchNameOrId:"Search by name or ID",selectAgentCenter:"Select an agent center",selectAgentKitCenter:"Select an AgentKit agent center",selectedAgentCenter:"Selected agent center",agentKitCenter:"AgentKit agent center",refreshAgentCenters:"Refresh agent centers",knowledgeBaseList:"Knowledge base list",knowledgeBasePlaceholder:"Select a knowledge base",loadingKnowledgeBases:"Loading knowledge bases…",knowledgeBasesLoaded:"{{count}} knowledge bases loaded",noKnowledgeBases:"No knowledge bases available",noMatchingKnowledgeBases:"No matching knowledge bases",searchKnowledgeBase:"Search knowledge bases",selectKnowledgeBase:"Select a knowledge base",refreshKnowledgeBases:"Refresh knowledge bases",memoryList:"Memory store list",memoryPlaceholder:"Select a memory store",loadingMemories:"Loading memory stores…",memoriesLoaded:"{{count}} memory stores loaded",noMemories:"No memory stores available",noMatchingMemories:"No matching memory stores",searchMemory:"Search memory stores",selectMemory:"Select a memory store",refreshMemories:"Refresh memory stores"},env:{noAdditionalParameters:"This backend needs no additional runtime parameters.",invalidJson:"Enter valid JSON.",helpAriaLabel:"Help for {{label}}: {{help}}",openOpenViking:"Open OpenViking {{label}}",valuePlaceholder:"Enter a value",openVikingIndex:"OpenViking resource index",openVikingIndexHelp:"Leave blank to generate an index from the agent name, such as my_agent_kb. Without DATABASE_OPENVIKING_TARGET_URI, the default URI is viking://user/{knowledge base owner ID, or default}/resources/{resource index}/. When DATABASE_OPENVIKING_TARGET_URI is set, that complete URI is used instead.",openVikingIndexAriaLabel:"OpenViking resource index help: {{help}}"},deployment:{vpcRequired:"Enter a VPC ID when using VPC networking.",apiKeyRequired:"Select the API Key used by the model.",invalidEnvName:"Invalid environment variable name: {{key}}",requiredEnv:"{{name}}: enter this required environment variable",generatingConfiguration:"Generating deployment configuration",runtimeNameExists:"This Runtime name already exists. Choose another name and try again.",preparing:"Preparing deployment",applyingMpaProfile:"Applying the Agent profile to MPA Runtime",mpaProfileApplied:"MPA Runtime profile applied",runningMpaSmoke:"Verifying the MPA Runtime execution path",mpaReady:"MPA Runtime is ready",mpaOperationIncomplete:"MPA Runtime setup did not complete. Retry this deployment task.",complete:"Deployment complete",failed:"Deployment failed",updateAndPublish:"Update and publish",stages:{build:"Build image",deploy:"Deploy Runtime",publish:"Publish service",applyMpaProfile:"Apply MPA profile",verifyMpaRuntime:"Verify MPA Runtime",mpaReady:"MPA Runtime ready",running:"Deploying"}},publish:{generating:"Generating publish configuration",validating:"Validating the agent structure and preparing the deployment snapshot…"}},S$e={presets:{support:{name:"Customer support assistant",description:"Answer questions around the clock using your knowledge base and conversation history, with consistent and considerate responses.",instruction:"You are a professional and patient customer support assistant. Always use a courteous, friendly tone. Base answers on the knowledge base whenever possible. When the available information is insufficient, say so clearly and ask for the details you need instead of inventing an answer. Keep responses concise and well structured, and provide steps when useful.",subagents:{}},analyst:{name:"Data analyst",description:"Run code for statistics and visualization with tracing enabled, so every analysis is observable and reproducible.",instruction:"You are a rigorous data analyst. Clarify the objective and definitions before cleaning, analyzing, and visualizing data with executable code. Explain assumptions and methods at each step, support conclusions with key evidence, and identify possible bias or limitations.",subagents:{}},translator:{name:"Translation assistant",description:"Translate between Chinese and English accurately and naturally while preserving tone and terminology.",instruction:"You are a professional translator fluent in Chinese and English. Preserve the meaning of the source while producing natural language for the target audience. Keep proper nouns and technical terminology accurate and reflect the original tone and style. Return only the translation unless the user asks for an explanation.",subagents:{}},coder:{name:"Coding assistant",description:"Write, debug, and refactor code, validate it by running tests, and produce clear, maintainable implementations.",instruction:"You are a senior software engineer. Write correct, clear, maintainable code that follows the conventions and best practices of the target language. When uncertain, run the code to validate the implementation, cover important edge cases, and add concise comments for complex logic.",subagents:{}},researcher:{name:"Researcher",description:"Search primary sources online and combine them with knowledge and long-term memory to produce evidence-backed findings.",instruction:"You are a rigorous researcher. Break each question into key subproblems, collect multiple credible primary sources through web search, and cross-check the evidence before drawing conclusions. Cite sources, state uncertainty, distinguish facts from inference, and avoid overgeneralization.",subagents:{}},"research-team":{name:"Multi-agent research team",description:"Coordinate a researcher, analyst, and writer to produce an end-to-end research report.",instruction:"You coordinate a research team. Break down the user's research task, delegate search, analysis, and writing to the appropriate subagents, synthesize their work, and deliver a clear, evidence-backed report.",subagents:{0:{name:"Researcher",description:"Collect primary sources and data related to the topic online.",instruction:"You are the team's researcher. Find multiple credible sources about the topic, organize the key facts, data, and original citations, and hand them to the analyst without adding unsupported conclusions."},1:{name:"Analyst",description:"Cross-check and synthesize the collected material.",instruction:"You are the team's analyst. Cross-check, compare, and synthesize the research material. Extract insights, identify contradictions and uncertainty, and produce a structured set of findings."},2:{name:"Writer",description:"Turn the analysis into a clear report with reliable citations.",instruction:"You are the team's writer. Turn the analyst's findings into a clear, well-written report with consistent citations, ensuring every conclusion can be traced to a source."}}}},tags:{tools:"Tools",memory:"Memory",knowledgeBase:"Knowledge base",tracing:"Tracing",subagents:"{{count}} subagents"},gallery:{title:"Create from a template",subtitle:"Choose a prebuilt agent template and customize it to fit your needs."},detail:{back:"Back to templates",name:"Name",systemPrompt:"System prompt",model:"Model",tools:"Tools",memory:"Memory",knowledgeBase:"Knowledge base",tracing:"Tracing",subagents:"Subagents ({{count}})",create:"Create from this template",shortTermMemory:"Short-term",longTermMemory:"Long-term"}},T$e={checkingExpiry:"Checking expiry",waitingRecovery:"Waiting for recovery",listFailed:"Could not load projects",recoveryFailed:"Could not restore the workspace. Try again",operationFailed:"Project operation failed. Try again",title:"Code projects",back:"Back to code projects",restart:"This development environment will restart in {{countdown}}. Save your work regularly",expiresAt:"Expires at {{date}}",exitFullscreen:"Exit full screen",fullscreen:"Full screen",exitFullscreenHint:"Exit full screen (Esc)",recovering:"Restoring your workspace. Your project will reopen automatically",retry:"Retry connection",search:"Search code projects",newTitle:"New code project",new:"New project",readingStats:"Loading project details",createdAt:"Created",opening:"Opening",unknownCreatedAt:"Creation time unknown",open:"Open project",empty:"No matching code projects",close:"Close new project",name:"Project name",placeholder:"e.g. my-agent",nameHelp:"Start with a letter and use letters, numbers, underscores or hyphens, up to 64 characters",cancel:"Cancel",create:"Create project",files_one:"{{count}} file",files_other:"{{count}} files",directories_one:"{{count}} directory",directories_other:"{{count}} directories",separator:", "},C$e={enabled:"Enabled",disabled:"Disabled",unknownStatus:"Unknown status",allPermissions:"All permissions",customPermissions:"Custom permissions",unknownPermissions:"Unknown permissions",unnamed:"Unnamed API Key",search:"Search name, status or permissions",noMatches:"No matching API Keys",noModelPermission:"Not permitted by this API Key",modelAvailable:"Available",permissionState:{Available:"Available for chat",Shutdown:"Shut down",VideoGeneration:"Video generation model",Unsupported:"Not a chat model",NotActivated:"Not activated",Unknown:"Model status unavailable"}},idr=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:p$e,codePackage:f$e,common:s$e,default:{common:s$e,yaml:l$e,validation:c$e,defaults:u$e,helpers:d$e,intelligentDeployment:h$e,codePackage:f$e,buildCanvas:p$e,intelligent:g$e,projectLibrary:m$e,modePicker:v$e,promptEditor:y$e,skills:b$e,workflow:x$e,workbench:w$e,traditional:A$e,template:S$e,workspace:T$e,modelApiKey:C$e},defaults:u$e,helpers:d$e,intelligent:g$e,intelligentDeployment:h$e,modePicker:v$e,modelApiKey:C$e,projectLibrary:m$e,promptEditor:y$e,skills:b$e,template:S$e,traditional:A$e,validation:c$e,workbench:w$e,workflow:x$e,workspace:T$e,yaml:l$e},Symbol.toStringTag,{value:"Module"})),k$e={source:"Task source",studio:"Studio scheduled tasks",title:"Runtime scheduled tasks",selectRuntime:"Select a cloud Runtime from the Agent list first.",scope:"Scheduled tasks for the current Studio user in this Runtime.",refresh:"Refresh",loading:"Loading Runtime tasks",empty:"No matching scheduled tasks in this Runtime.",authRequired:"Runtime rejected the request. Check gateway access and the Runtime authentication setting.",forbidden:"The current user cannot access this Runtime.",unsupported:"This Runtime does not provide the MPA scheduled tasks API.",invalidResponse:"The tasks API returned unrecognized data. Check the Runtime version.",loadFailed:"Could not load tasks. Check the network and Runtime status, then refresh.",pagination:"Runtime task pagination",total:"{{total}} tasks",previous:"Previous",next:"Next",columns:{name:"Task name",enabled:"Status",schedule:"Schedule",next:"Next run",last:"Latest result"},schedule:{once:"Once",interval:"Interval",daily:"Daily",weekly:"Weekly",monthly:"Monthly",cron:"Cron"},search:"Search tasks",executionCount:"Executions",successRate:"Success rate",prompt:"Task content",manage:{view:"Task view",list:"List",calendar:"Calendar",create:"Create scheduled task",edit:"Edit task",copy:"Copy",delete:"Delete",detail:"Details",run:"Run now",name:"Task",lastRun:"Last execution",schedule:"Schedule",lastStatus:"Last execution status",agent:"Executing Agent",actions:"Actions",all:"All statuses",Pending:"Not run yet",Queued:"Queued",Running:"Running",Succeeded:"Succeeded",Failed:"Failed",TimedOut:"Timed out",Cancelled:"Cancelled",Skipped:"Skipped",overview:"Execution statistics:",prompt:"Task content",timezone:"Time zone",localTime:"Execution time (device time zone)",time:"Time",Once:"Once",Interval:"Interval",Daily:"Daily",Weekly:"Weekly",Monthly:"Monthly",Cron:"Cron expression",seconds:"seconds",interval:"Interval in seconds",weekdays:"Weekdays (1 = Monday, 7 = Sunday; comma separated)",monthDays:"Days of month (1–31; comma separated)",delivery:"Delivery",Web:"Web",Feishu:"Feishu",target:"Feishu recipient ID",enabled:"Enable task",cancel:"Cancel",save:"Save",saving:"Saving",required:"Enter a task name, Agent ID, prompt and delivery target.",timezoneInvalid:"Enter a valid IANA time zone, such as Asia/Shanghai.",futureTime:"Choose a future execution time.",intervalInvalid:"Interval must be an integer between 30 and 31536000 seconds.",daysInvalid:"Enter valid, unique days.",history:"Execution history",duration:"Duration",result:"Result / session",noRuns:"No executions yet.",conflict:"The task changed or the request conflicts. Close the dialog, refresh and retry.",invalid:"Request validation failed. Check user identity, execution time, Agent ID and task settings.",queued:"Execution request submitted.",saved:"Task updated.",deleteConfirm:"Delete “{{name}}”? It will no longer be scheduled.",calendarZone:"Display time zone:",prevMonth:"Previous month",nextMonth:"Next month",today:"Today",nextOnly:"Next only",calendarHint:"The calendar shows expected executions. Complex Cron expressions show only the next execution returned by the server."}},O$e={backToList:"Back to scheduled tasks",cancel:"Cancel",cancelQueue:"Cancel queued run",cancelQueueFirst:"Cancel the queued run first",cancelling:"Cancelling…",closeDrawer:"Close panel",collapse:"Collapse",connectingRuntime:"Connecting to Runtime…",createScheduledTask:"Create scheduled task",createTask:"Create task",delete:"Delete",deleteTask:"Delete task",edit:"Edit",enable:"Enable",expand:"Expand",pause:"Pause",refresh:"Refresh",refreshHistory:"Refresh run history",rerun:"Run again",retry:"Retry",runNow:"Run now",saveChanges:"Save changes",saving:"Saving…",stop:"Stop run",stopRun:"Stop this run",stopRunFirst:"Stop the current run first",stopping:"Stopping…",viewDetails:"View details"},E$e={cancelDescription:"This Session will be cancelled. Future scheduled runs will remain enabled.",cancelTitle:"Stop this run?",deleteDescription:"“{{name}}” and its complete run history will be permanently deleted.",deleteTitle:"Delete scheduled task?"},_$e={configuration:"Task configuration",nextRun:"Next run",pageLabel:"Scheduled task details",region:"Region",runtime:"Runtime",status:"Task status"},R$e={createTitle:"Create scheduled task",description:"Each trigger creates a separate Session for the Runtime Agent.",editTitle:"Edit scheduled task"},D$e={minutesSeconds:"{{minutes}} min {{seconds}} sec",seconds:"{{count}} sec"},L$e={cronExpression:"Cron expression",cronHelp:"Enter minute, hour, day of month, month, and day of week.",dailyTime:"Daily run time",enableAfterCreate:"Enable after creation",enableHelp:"The task will run at its next scheduled time after it is enabled.",name:"Task name",namePlaceholder:"For example: Generate a daily operations summary",noRuntime:"No Runtime available",prompt:"Execution prompt",promptPlaceholder:"Enter the text to send to the Agent on every run",runAt:"Run time",runtimeAgent:"Runtime Agent",runtimeHelp:"The task always uses the Runtime's currently active version.",runtimePlaceholder:"Select a Runtime Agent",schedule:"Schedule",scheduleType:"Schedule type",timezone:"Time zone",weekday:"Day of week"},M$e={all:"All"},I$e={description:"Each run uses a separate Session. Results and errors are retained.",duration:"Duration: {{duration}}",emptyDescription:"Runs will appear here after the task is triggered or run manually.",emptyTitle:"No runs yet",errorDetails:"Error details",finalAnswer:"Final answer",loadFailed:"Unable to load run history",loadFailedDescription:"Check the Studio service and try again.",session:"Session",title:"Run history"},P$e={cancelRequested:"Stop request submitted.",created:"Task created.",deleted:"The task and its run history were deleted.",enabled:"Task enabled.",paused:"Task paused.",queued:"Task queued and will start within one minute.",requeued:"Task queued again and will start within one minute.",updated:"Task updated."},N$e={filterLabel:"Filter scheduled tasks by status",listLabel:"Scheduled task list",loadFailed:"Unable to load scheduled tasks",loadFailedDescription:"Check the Studio service and try again.",title:"Cronjob"},B$e={cron:"Cron {{cron}}{{zone}}",daily:"Daily at {{time}}{{zone}}",once:"Once · {{date}}{{zone}}",weekly:"{{weekday}} at {{time}}{{zone}}"},$$e={daily:"Daily",once:"Once",weekly:"Weekly"},F$e={cancelled:"Cancelled",enabled:"Enabled",failed:"Failed",notRun:"Not run yet",paused:"Paused",pending:"Preparing",queued:"Queued",retrying:"Retrying",running:"Running",skipped:"Skipped",success:"Succeeded"},z$e={cronFields:"A Cron expression must contain five fields, for example 0 9 * * *.",nameRequired:"Enter a task name.",promptRequired:"Enter the text to send to the Agent on each run.",runtimeAppMissing:"The Runtime Agent did not return an appName. Confirm that the Runtime is ready and compatible.",runtimeRequired:"Select an available Runtime Agent.",timeRequired:"Select a run time."},U$e={friday:"Friday",monday:"Monday",saturday:"Saturday",sunday:"Sunday",thursday:"Thursday",tuesday:"Tuesday",wednesday:"Wednesday"},adr=Object.freeze(Object.defineProperty({__proto__:null,actions:O$e,confirm:E$e,default:{mpa:k$e,actions:O$e,confirm:E$e,detail:_$e,drawer:R$e,duration:D$e,fields:L$e,filters:M$e,history:I$e,notices:P$e,page:N$e,schedule:B$e,scheduleTypes:$$e,status:F$e,validation:z$e,weekdays:U$e},detail:_$e,drawer:R$e,duration:D$e,fields:L$e,filters:M$e,history:I$e,mpa:k$e,notices:P$e,page:N$e,schedule:B$e,scheduleTypes:$$e,status:F$e,validation:z$e,weekdays:U$e},Symbol.toStringTag,{value:"Module"})),V$e="Quick-create Agent",G$e="Agent type",Q$e="Close",H$e="Deploy",W$e="Preview",Y$e="Configuration download started",q$e="Download failed — try again",j$e="Review {{count}} configuration issues",X$e="Custom",K$e="Custom {{field}}",Z$e="Enter a custom value",J$e="This model declares no reasoning levels; the service settings apply",eFe="Add a model to this provider first",tFe="Select a provider first",rFe="Select an option",nFe="Optional",iFe="Default model, Agent preset and permissions apply to new sessions. The preset must exist in the deployed Harness",aFe="Enter an environment variable name only; supply its secret value at deployment",oFe="read-only allows reading; workspace-write allows workspace edits; danger-full-access allows full access without approval",sFe="allowedModels lists the models sub-agents may select. Enabling selection requires at least one provider/model pair",lFe="Add a custom model service using its endpoint, protocol and model IDs, including compatible Volcengine and BytePlus services",cFe="Covers common native settings. Other plugin parameters and preset files are not included yet",uFe="Native configuration reference",dFe="Provider {{index}}",hFe="Model {{index}}",fFe="Add provider",pFe="Remove provider {{index}}",gFe="Add model",mFe="Remove model {{index}}",vFe="Add allowed model",yFe="Remove allowed model {{index}}",bFe="Remove",xFe="Enter the service’s model ID",wFe={provider:"Provider {{index}}",model:"Model {{index}}"},AFe={defaults:"Session defaults",deepseek:"DeepSeek model service",providers:"Custom model providers",shell:"Command execution",loop:"Tool calls",subagents:"Sub-agent model selection",search:"DeepSeek web search"},SFe={id:"Provider ID",displayName:"Display name",baseURL:"Base URL",api:"API protocol",apiKeyEnv:"API key environment variable"},TFe={id:"e.g. company-models",displayName:"Optional; defaults to the provider ID",baseURL:"https://…/v1",api:"Select a protocol",apiKeyEnv:"e.g. MODEL_API_KEY"},CFe={id:"Model ID",name:"Display name",contextWindow:"Context capacity",maxTokens:"Maximum output capacity"},kFe={positive:"Enter a number greater than zero",integer:"Enter a valid positive integer",env:"Use letters, digits and underscores; do not start with a digit",url:"Enter an HTTP or HTTPS URL without credentials",option:"Select a supported native option",required:"Complete this field",duplicate:"This ID or model pair already exists",providerId:"Start with a lowercase letter; use lowercase letters, digits, dots, underscores or hyphens; reserved IDs are unavailable",routes:"Add at least one complete provider/model pair",modelPair:"Enter a model ID for this custom provider",unknownProvider:"Add this custom provider first",unknownModel:"Enter a model ID configured for this provider",timer:"Enter a timeout greater than 0 and no more than 2147483647 ms"},OFe={"agent-default-model_provider":"Default provider","agent-default-model_model":"Default model","agent-default-model_reasoningEffort":"Default reasoning effort","agent-presets_default":"Default Agent preset",permission_defaultPreset:"Default permission preset","llm-deepseek_apiKeyEnv":"API key environment variable","llm-deepseek_baseURL":"Base URL","llm-deepseek_thinking":"Thinking mode","llm-deepseek_reasoningEffort":"Reasoning effort","llm-deepseek_maxTokens":"Output limit per request","llm-deepseek_defaultContextWindow":"Default context capacity","llm-deepseek_streamIdleTimeoutMs":"Stream idle timeout (ms)",bash_timeoutMs:"Default execution timeout (ms)",bash_maxTimeoutMs:"Maximum execution timeout (ms)",bash_maxOutputBytes:"Output limit (bytes)","agent-loop_maxParallelToolCalls":"Parallel tool-call limit","subagent-model-selection_enabled":"Enable model selection","web-search-deepseek_apiKeyEnv":"API key environment variable","web-search-deepseek_baseURL":"Search base URL","web-search-deepseek_model":"Search model","web-search-deepseek_apiVersion":"API version","web-search-deepseek_maxTokens":"Search output limit","web-search-deepseek_maxUses":"Maximum search uses"},EFe="Cancel",_Fe="Back to creation methods",RFe="DeepSeek Harness configuration",odr=Object.freeze(Object.defineProperty({__proto__:null,addModel:gFe,addProvider:fFe,addRoute:vFe,agentType:G$e,back:_Fe,cancel:EFe,close:Q$e,coverage:cFe,credentialHelp:aFe,customField:K$e,customValue:X$e,default:{title:V$e,agentType:G$e,close:Q$e,continue:"Continue",deploy:H$e,preview:W$e,export:"Export configuration",downloaded:Y$e,downloadFailed:q$e,validationSummary:j$e,customValue:X$e,customField:K$e,enterCustomValue:Z$e,reasoningUnavailable:J$e,modelsUnavailable:eFe,selectProviderFirst:tFe,selectOption:rFe,optional:nFe,defaultsHelp:iFe,credentialHelp:aFe,permissionHelp:oFe,routesHelp:sFe,providersHelp:lFe,coverage:cFe,source:uFe,provider:dFe,model:hFe,addProvider:fFe,removeProvider:pFe,addModel:gFe,removeModel:mFe,addRoute:vFe,removeRoute:yFe,remove:bFe,modelIdPlaceholder:xFe,route:wFe,sections:AFe,providerFields:SFe,providerPlaceholders:TFe,modelFields:CFe,errors:kFe,fields:OFe,cancel:EFe,back:_Fe,pageTitle:RFe},defaultsHelp:iFe,deploy:H$e,downloadFailed:q$e,downloaded:Y$e,enterCustomValue:Z$e,errors:kFe,fields:OFe,model:hFe,modelFields:CFe,modelIdPlaceholder:xFe,modelsUnavailable:eFe,optional:nFe,pageTitle:RFe,permissionHelp:oFe,preview:W$e,provider:dFe,providerFields:SFe,providerPlaceholders:TFe,providersHelp:lFe,reasoningUnavailable:J$e,remove:bFe,removeModel:mFe,removeProvider:pFe,removeRoute:yFe,route:wFe,routesHelp:sFe,sections:AFe,selectOption:rFe,selectProviderFirst:tFe,source:uFe,title:V$e,validationSummary:j$e},Symbol.toStringTag,{value:"Module"})),DFe="Report an issue",LFe="Description",MFe="Common issues",IFe="Cancel",PFe="Done",NFe="Submit feedback",BFe="Submitting…",$Fe={title:"Feedback submitted. Thank you.",description:"The AgentKit team will review your report as soon as possible."},FFe={close:"Close issue report",intro:"Select the issues you encountered and add any useful details.",privacy:"Your conversation data will be shared with the AgentKit team. Please protect sensitive information.",descriptionPlaceholder:"Describe what happened (optional)",issues:{slow:"Slow execution",crash:"Runtime crash",incorrect:"Inaccurate result",tool_error:"Tool call failed",other:"Other issue"}},zFe={description:"Tell us about a problem you encountered while using AgentKit Studio.",module:"Area",modules:{conversation:"Conversation",agents:"Agents",applications:"Automations",search:"Search",other:"Other"},commonIssuesMultiple:"Common issues (select all that apply)",issueTypes:"Issue types",issues:{page_slow:"Page loads slowly",feature_unavailable:"Feature unavailable",display_error:"Display issue",no_response:"Action has no response",other:"Other issue"},descriptionPlaceholder:"Describe the page, action, and what happened",quickAdd:"Quick add",suggestionsLabel:"Suggested descriptions",suggestions:{noResponse:"Nothing happens after I click",loading:"The page remains in a loading state",incomplete:"Some content is missing or clipped",error:"An error appears after the action"},privacy:"Your data will be shared with the AgentKit team. Please protect sensitive information."},sdr=Object.freeze(Object.defineProperty({__proto__:null,cancel:IFe,commonIssues:MFe,default:{title:DFe,descriptionLabel:LFe,commonIssues:MFe,cancel:IFe,done:PFe,submit:NFe,submitting:BFe,success:$Fe,dialog:FFe,page:zFe},descriptionLabel:LFe,dialog:FFe,done:PFe,page:zFe,submit:NFe,submitting:BFe,success:$Fe,title:DFe},Symbol.toStringTag,{value:"Module"})),UFe={back:"Back",close:"Close"},VFe={title:"Optimize migrated project",closeAria:"Close optimization dialog"},GFe={title:"Migrated projects",description:"Manage migrated source versions or continue optimizing any version.",libraryTitle:"Projects and versions",libraryDescription:"View, download, deploy, or compare source versions, or continue optimizing any version.",emptyTitle:"No migrated projects yet",emptyDescription:"Migrated source code will be saved here automatically."},QFe={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any (universal migration)"},HFe={awaitingUpload:"Awaiting upload",analyzing:"Analyzing",needsInput:"Needs input",analysisReady:"Awaiting confirmation",migrating:"Migrating",validating:"Validating",packaging:"Packaging",succeeded:"Completed",succeededWithWarnings:"Completed with notices",partial:"Partially completed",failed:"Failed",cancelled:"Stopped",expired:"Expired"},WFe={evaluationPending:"Evaluation pending",evaluationRunning:"Evaluating",waitingDataset:"Evaluation cases pending",waitingEnvironment:"Environment variables required",evaluationFailed:"Migrated, evaluation incomplete",evaluationBlocked:"Migrated, evaluation needs attention",evaluationCancelled:"Migrated, evaluation cancelled",resultUnavailable:"Result unavailable",environmentExpired:"Environment expired"},YFe={partialReady:"Migration output is ready, but delivery is incomplete. Review the migration notices.",readyWithWarnings:"Migration output is ready. Review the migration notices.",ready:"Migration output is ready."},qFe={passed:"Output verification passed",failed:"Output verification failed",degraded:"Output verification incomplete"},jFe={session:"Create migration environment",upload:"Upload project",analysis:"Analyze project"},XFe={agentNameRequired:"Enter an Agent name",agentNameInvalid:"Agent names must be 1–63 characters, contain only lowercase letters, numbers, and hyphens, and start and end with a letter or number"},KFe={seconds:"{{seconds}} sec",minutesSeconds:"{{minutes}} min {{seconds}} sec"},ZFe={savedUnaffected:"Saved projects are unaffected",savingUnaffected:"Source is being saved and will be unaffected once complete",activeDetail:"Task history and temporary output will become unavailable after expiration",oneHour:"Temporary migration environment is retained for 1 hour",ended:"Temporary migration environment has ended",savedAvailable:"Saved projects remain available to view, download, deploy, or optimize",unavailable:"Task history and temporary output are no longer available",countdown:"Temporary migration environment ends in {{minutes}} min {{seconds}} sec",expiredSavedMessage:"The temporary migration environment has ended. Saved projects are unaffected.",expiredMessage:"The temporary migration environment has ended. Task history and temporary output are no longer available."},JFe={recommended:"Recommended migration method",scope:"Migration scope",excluded:"Out of scope",viewEvidence:"View analysis evidence",viewAssumptions:"View key assumptions",viewSourceEvidence:"View source evidence"},e9e={ariaLabel:"Codex activity",title:"Codex activity",startingAnalysis:"Codex is starting the analysis…",startingMigration:"Codex is starting the migration…",loadError:"Codex activity is temporarily unavailable. The current task is unaffected.",liveAnalyzing:"Analyzing the project",liveMigrating:"Running the migration",liveValidating:"Verifying the migration",livePackaging:"Packaging the migration",liveDelivery:"Reviewing the delivery"},t9e={title:"Migration output",fileTooLarge:"This file exceeds 2 MiB. Download the complete output to view it.",unsupportedPreview:"This file cannot be previewed here. Download the complete output to view it.",filesAria:"Migration output files",searchAria:"Search output files",searchPlaceholder:"Search files",limit:"Showing the first {{count}} items. Search for a specific file.",noSelection:"No file selected",noPreview:"No files available to preview.",loadingFile:"Loading output file…",startupFile:"Startup file",fileCountLabel:"Files",saved:"Source has been saved. You can view, download, deploy, or optimize it.",saving:"Output is ready and the source version is being saved.",deployReady:"Output is available to preview, download, and deploy. Waiting for source save status.",deployUnavailable:"Output is available to preview and download, but its current delivery status does not support deployment.",viewProjects:"View migrated projects",downloading:"Downloading…",downloadZip:"Download ZIP",deployTitle:"Deploy migration output",deployUnavailableTitle:"Current delivery status does not support deployment",deployRuntime:"Deploy to Runtime",fileCount:"{{count}} files",startup:"Startup file {{module}}",loading:"Loading migration output…"},r9e={retiring:"Retiring soon",currentDefault:"Current default model",loadError:"Failed to load models",label:"Model",placeholder:"Select a model"},n9e={zipOnly:"Select a local project in .zip format.",invalidName:"The ZIP file name is invalid. Rename the file and select it again.",tooLarge:"The project ZIP cannot exceed {{size}}.",empty:"The project ZIP cannot be empty.",removeAria:"Remove project ZIP",reselectPrompt:"Select the project ZIP again",selectPrompt:"Select or drop a local project ZIP",reselect:"Select again",selectZip:"Select ZIP",continue:"Continue upload",start:"Upload and analyze",inputAria:"Select a local project ZIP",retention:"The temporary migration environment is retained for 1 hour after creation. Successfully saved source versions are unaffected.",uploading:"Uploading…",sizeHint:"Project ZIP, up to {{size}}"},i9e={requiredPlaceholder:"Enter {{key}}",optionalPlaceholder:"Optional: {{key}}",notReady:"Migration output is not ready yet.",back:"Back to migration results"},a9e={backToAddAgent:"Back to Add Agent",title:"Migrate existing project",newMigration:"New migration",recent:"Recent migrations",loadingSessions:"Loading migration sessions…",noSessions:"No migration sessions",heading:"Migrate an existing Agent project",intro:"Upload a local project ZIP. Codex will first perform a read-only analysis, then ask you to confirm the migration method.",backToHome:"Migration home",navigation:"Migration navigation",showMore:"Show more",showLess:"Show less",projectName:"Project name",status:"Status",createdAt:"Created",actions:"Actions",openTask:"Open migration {{name}}",continueTask:"Continue",viewTask:"View"},o9e={stop:"Stop migration",stopping:"Stopping…",cancel:"Cancel",reload:"Reload",refreshStatus:"Refresh status"},s9e={unavailable:"Migration is currently unavailable",defaultReason:"Dev Sandbox is currently unavailable. Contact your administrator to check the configuration."},l9e={creatingSandbox:"Creating Dev Sandbox",initializing:"Initializing the migration workspace and checking AgentKit CLI, Codex, and migration capabilities. The project will upload automatically when the environment is ready.",elapsed:"Elapsed: {{duration}}",uploadThenAnalyze:"Read-only analysis will start automatically after the ZIP upload completes.",analyzing:"Codex is identifying the framework, entry point, and migration boundaries. No migration changes are being made.",migrationLocked:"Attachments and migration settings cannot be changed while migration is running. Wait for the task to finish or stop it.",analysisPaused:"Read-only analysis is paused. Answer only the questions below. After submission, analysis will continue in the same environment without starting the migration.",analysisComplete:"Read-only analysis is complete. Review the recommendation and confirm the final migration method.",awaitingUpload:"The migration environment is ready. Select the local ZIP again to continue uploading.",expiredTitle:"Migration environment expired",expiredDescription:"Migration content and output can no longer be previewed, downloaded, or deployed. If the Runtime deployment completed, return to the Agents page to continue using it.",unsupportedTitle:"This ZIP cannot be migrated yet",unsupportedHint:"Update the project as instructed, then create a new migration and upload it again.",failedTitle:"Migration incomplete",cancelled:"This migration was stopped. Create a new migration and upload the project again."},c9e={ariaLabel:"Provide project analysis details",title:"Additional information needed for analysis",description:"The attachment stays locked; submitting continues read-only analysis only",submitting:"Continuing analysis…",submit:"Submit and continue analysis"},u9e={ariaLabel:"Answer the questions the migration needs you to decide",title:"The migration needs your answer",description:"Your answer continues the current step instead of restarting it",other:"Other",otherPlaceholder:"Or type your own answer",submitting:"Submitting your answer…",submit:"Submit answer and continue"},d9e={ariaLabel:"Confirm migration method",title:"Confirm migration method",framework:"Migration method",frameworkPlaceholder:"Select a migration method",agentName:"Agent name",entry:"Project entry point",entryPlaceholder:"Select a project entry point",entryExample:"For example, agent.py:agent",consent:"By selecting “Confirm and start migration,” you confirm the migration scope, exclusions, and key assumptions above.",starting:"Starting migration…",start:"Confirm and start migration"},h9e={setup:{title:"Migration effect evaluation",description:"Evaluation cases run automatically after migration.",on:"On",off:"Off",unavailable:"Migration effect evaluation is unavailable in this environment.",casesTitle:"Evaluation cases",casesDescription:"Add at least one case. Expected outcomes and criteria are optional.",configuredSummary:"{{count}} cases · {{preset}} · {{dimensions}}",incompleteSummary:"{{count}} cases need content · {{preset}} · {{dimensions}}",dimensionSummary:"{{count}} dimensions",editSettings:"Edit settings",viewSettings:"View settings",lockedTitle:"Evaluation cases",lockedDescription:"Cases cannot change after upload starts.",closeAria:"Close evaluation settings",done:"Finish setup",close:"Close"},tabs:{label:"Migration task content",migration:"Migration",evaluation:"Evaluation",waitingMigration:"Waiting for migration",waitingConfiguration:"Setup required",running:"Running",completed:"Completed",issue:"Needs attention"},bulk:{open:"Paste multiple",label:"Enter one case per line",placeholder:`Check the status of today's orders +- Maintain a polite, professional tone.`},d$e={requestFailed:"Request failed ({{status}}){{detail}}",a2aSpaces:{credentialsMissing:"The server does not have cloud provider credentials configured, so AgentKit agent centers are unavailable",loginRequired:"Sign in to access AgentKit agent centers"},vikingKnowledge:{credentialsMissing:"The server does not have cloud provider credentials configured, so VikingDB knowledge bases are unavailable",loginRequired:"Sign in to access VikingDB knowledge bases"},vikingMemory:{credentialsMissing:"The server does not have cloud provider credentials configured, so VikingDB memory stores are unavailable",loginRequired:"Sign in to access VikingDB memory stores"},mcpGateway:{missingHttpTool:"Go back to Add MCP tool and add at least one HTTP MCP service. MCP resilience does not support stdio services.",missingUrl:"An HTTP MCP tool is missing a valid service URL. Go back to Add MCP tool and complete it before publishing."},customModel:{fallbackName:"Custom model",apiKeyLabel:"{{name}} model API Key",fallbackApiKeyLabel:"{{name}} fallback model {{model}} API Key"},deploymentEnv:{serverInjected:"Provided by the server",selectedApiKeyPlaceholder:"Provided by the selected API Key",mcpInjectedComment:"Provided by the added MCP tools",restoredPlaceholder:"Securely restored by the Studio server",generatedMcpPlaceholder:"Generated from the added HTTP MCP tools",restoredHelp:"When updating, the Studio server merges MCP addresses and authentication without returning existing secrets to the browser.",mergedMcpHelp:"The Studio server merges MCP addresses and optional authentication without returning existing secrets to the browser.",listSeparator:", ",requirementHint:"Required by the following optimizations: {{labels}}.",requiredBy:"Required by the following optimizations: {{labels}}. Enter {{key}}.",required:"Enter {{label}} ({{key}}).",invalidJson:"Invalid JSON format"},drafts:{unsupportedVersion:"This local draft version is not supported. Upgrade Studio and try again.",invalidFormat:"The local draft data is invalid.",readFailed:"Could not read local drafts. The browser data may be corrupted.",quotaExceeded:"Browser storage is full, so the draft was not saved. Delete unused drafts or clear this site's storage, then try again.",writeRejected:"The browser blocked saving this draft. Check the site's storage permissions and try again."},skills:{searchFailed:"Search failed ({{status}})",downloadFailed:"Skill download failed ({{status}})",agentKitRequestFailed:"AgentKit Skills request failed",missingManifest:"{{location}} is missing SKILL.md",invalidParentPath:"{{location}} contains an invalid parent path (..): {{path}}",invalidPath:"{{location}} contains an invalid path: {{path}}",localDescription:"Local skill",folderSource:"Folder",noManifest:"No SKILL.md was found in {{location}}"},zip:{invalid:"Invalid zip: EOCD was not found",tooManyFiles:"A zip file cannot contain more than {{count}} files",tooLarge:"The extracted zip content is too large"}},h$e={back:"Back to development session",runtimeName:"Runtime name",runtimeNameExists:"This Runtime name already exists. Choose another name.",checkingRuntimeName:"Checking Runtime name",verifiedSource:"Verified source",deployableSource:"Deployable source",verifiedByCodex:"Verified by Codex in the cloud",entryPoint:"Entry point",files:"Files",artifact:"Artifact",validationReport:"Validation report",verifiedHint:"The server materializes source from the verified artifact. Browser files cannot replace it.",unverifiedHint:"The server securely materialized the source. Confirm the Runtime configuration before deploying.",env:{requiredPlaceholder:"Enter {{key}}",optionalPlaceholder:"Optional: {{key}}"}},f$e={name:"Code package",back:"Back to creation methods",reading:"Reading the code package",readingEllipsis:"Reading the code package…",uploadFirst:"Upload a code package first",uploadAriaLabel:"Code package upload",upload:"Upload code package",reupload:"Upload a different code package",uploadPrompt:"Upload a code package",filesRecognized:"{{count}} files found. Select this area to upload a different package.",dropHint:"Select or drop a .zip file up to 50 MB. Use app.py or declare an entry point in agentkit.yaml.",viewFiles:"View files",chooseFile:"Choose code package",errors:{invalidFormat:"Choose a .zip code package.",tooLarge:"The code package must be 50 MB or smaller.",invalidPath:"The archive contains an invalid path: {{name}}",empty:"The archive does not contain any deployable files.",tooManyFiles:"A code package cannot contain more than {{count}} files.",duplicateFile:"The code package contains a duplicate file: {{path}}",manifestParse:"Could not parse agentkit.yaml: {{detail}}",manifestRoot:"The root of agentkit.yaml must be an object.",manifestCommon:"common in agentkit.yaml must be an object.",entryPointType:"common.entry_point in agentkit.yaml must be a file path.",entryPointInvalid:"common.entry_point in agentkit.yaml is not a valid file path.",entryPointMissing:"The entry point declared in agentkit.yaml is missing from the code package: {{entryPoint}}",defaultEntryPointMissing:"The code package root must contain app.py, or common.entry_point in agentkit.yaml must declare an existing entry point."}},p$e={label:"Agent execution canvas",readOnlyLabel:"Read-only agent execution canvas",minimapLabel:"Execution flow minimap",controls:{ariaLabel:"Execution flow controls",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Fit view"},rootAgent:"Main agent",unnamedStep:"Unnamed step",terminals:{input:"User request",output:"Final response"},edges:{then:"Then",continueLoop:"Continue loop",call:"Call"},patterns:{llm:{label:"Agent",description:"Understand a task and complete one specific job"},sequential:{label:"Sequential",description:"Run internal steps one after another"},parallel:{label:"Parallel",description:"Run internal steps together, then combine their results"},loop:{label:"Loop",description:"Repeat internal steps until the stop condition is met"},a2a:{label:"Remote agent",description:"Call an existing remote agent"}},actions:{insertHere:"Insert a step here",deleteNamed:"Delete {{name}}",deleteNode:"Delete node",addSubagent:"Add subagent",addParallelStep:"Add a parallel step",addLoopStep:"Add a loop step",addNextStep:"Add next step",addFirst:"Add at the beginning",addLast:"Add at the end"}},g$e={title:"Intelligent build",subtitle:"Describe what you need. Build, debug, and validate your agent.",model:{label:"Model",placeholder:"Select a model",retiring:"Retiring soon",currentConfiguration:"Current configuration",loadError:"Failed to load models"},availability:{checking:"Checking intelligent development availability…",unavailable:"Intelligent mode is currently unavailable. Go back and try again."},goal:{title:"Start with a goal",continueTitle:"Continue improving the project",hint:"Describe the problem your agent should solve. We will ask about any details that could affect the result.",continueHint:"Describe what you want to change. The result will be saved as a new version.",basedOn:"Based on",clearSelection:"Clear selection",label:"Goal",optimizationLabel:"Optimization goal",placeholder:"For example: Build an agent that reads sales data, creates weekly reports, and validates the output format",optimizationPlaceholder:"For example: Cite data sources and ask the user when information is incomplete"},actions:{preparing:"Preparing…",build:"Start building",optimize:"Start optimizing"},preparation:{accepted:"Goal received. Implementation is starting now.",preparing:"Creating the task environment…",starting:"Environment ready. Starting Codex…",next:"Next, Codex will plan the approach, then build, run, and validate the agent."},tasks:{title:"Tasks in progress",hint:"Work continues when you leave. Return to follow progress or add instructions.",refresh:"Refresh tasks",loading:"Loading tasks…",empty:"No tasks in progress",emptyHint:"Once a build starts, you can return to it here.",loadError:"Unable to load tasks. Please retry.",openError:"Unable to open this task. Please retry.",startedAt:"Started {{time}}",open:"Open task",opening:"Connecting…",states:{queued:"Queued",running:"Building",recovering:"Reconnecting",waiting_user:"Awaiting your reply",stopping:"Stopping",succeeded:"Completed",failed:"Incomplete",cancelled:"Stopped"}}},m$e={title:"Saved projects",description:"Continue improving an existing version, or view, download, and deploy its source.",refresh:"Refresh projects",checkingStorage:"Checking project storage…",unavailableTitle:"Projects are temporarily unavailable",storageCheckError:"Could not confirm project storage status. Try again shortly.",storageNotConfigured:"Project storage is not configured.",loadingMigrated:"Loading migrated projects…",loadingSaved:"Loading saved projects…",loadingVersions:"Loading project versions…",unknownTime:"Unknown time",sourceDownloaded:"Source downloaded.",projectSummary_one:"{{count}} version · Updated {{time}}",projectSummary_other:"{{count}} versions · Updated {{time}}",versionSummary_one:"{{time}} · {{count}} file",versionSummary_other:"{{time}} · {{count}} files",noVersionDescription:"No version description",latestVersion:"Latest version",defaultVersionName:"Version · {{time}}",rename:{projectTitle:"Edit project name",versionTitle:"Edit version name",projectLabel:"Project name",versionLabel:"Version name",hint:"Use letters, numbers and common punctuation, up to {{max}} characters.",required:"Enter a name.",tooLong:"Names can contain up to {{max}} characters.",invalidCharacters:"Names cannot contain line breaks, control or invisible formatting characters, or < >.",save:"Save name",saving:"Saving…",updated:"Name updated.",failed:"Unable to save the name. Try again."},verified:"Verified",pendingVerification:"Needs review",viewSource:"View source",download:"Download",downloading:"Downloading…",optimize:"Optimize",optimizeUnavailable:"Optimize, not supported",errors:{projects:"Could not load saved projects.",source:"Could not load project source.",versions:"Could not load project versions.",download:"Could not download the source.",prepareDeployment:"Could not prepare the source for deployment.",deleteVersion:"Could not delete the project version.",migrated:"Could not load migrated projects",saved:"Could not load saved projects"},empty:{migratedTitle:"No migrated projects yet",savedTitle:"No saved projects yet",migratedDescription:"Source will be saved here after your first migration.",savedDescription:"Source will be saved here after your first build.",noVersions:"This project has no available versions."},compare:{selected:"{{count}}/2 selected",selectedLabel:"Selected",select:"Select",view:"View comparison",start:"Compare versions"},delete:{title:"Delete this version?",onlyVersion:"“{{name}}” has only one version. Deleting it will also remove the project. This cannot be undone.",description:"This version's source and validation records will be permanently deleted. Other versions are not affected.",confirm:"Delete version"}},v$e={title:"Choose how to create",subtitle:"Build your agent with the workflow that fits your needs",features:"Features",quick:{title:"Quick mode",description:"Delegate tasks to dynamically created subagents",features:{dynamicSubagents:"Dynamic subagents",autonomousPlanning:"Autonomous planning",collaboration:"Multi-agent collaboration",summary:"Automatic result summaries",skills:"Skills on demand",trace:"Traceable task execution"}},traditional:{title:"Advanced mode",description:"Customize your agent structure in detail",features:{visualConfig:"Visual configuration",migration:"Existing agent migration",debugging:"Live debugging",optimization:"Optional optimization",parameters:"Fine-grained controls"}}},y$e={placeholder:"Enter a system prompt. Type ## followed by a space to add a level-two heading…",toolbar:{undo:"Undo {{shortcut}}",redo:"Redo {{shortcut}}",paragraph:"Paragraph",quote:"Quote",heading:"Heading {{level}}",selectBlockType:"Select text style",blockType:"Text style",bold:"Bold",removeBold:"Remove bold",italic:"Italic",removeItalic:"Remove italic",bulletedList:"Bulleted list",numberedList:"Numbered list"}},b$e={local:{duplicatesSkipped:"Skipped duplicate skills: {{names}}",invalidDrop:"Drop a folder containing SKILL.md or a .zip file",readError:"Could not read the files: {{detail}}",dropLabel:"Drop a folder or ZIP file to detect skills automatically",hint:"Each skill must contain a SKILL.md file. Directories can contain multiple skills.",reading:"Reading files…",fileCount:"Local · {{count}} files"},hub:{searchError:"Search failed. Try again shortly.",searchPlaceholder:"Search Volcano Find Skill, such as data analysis or PDF",search:"Search",searching:"Searching…",noResults:"No matching skills found. Try another keyword.",hint:"Search Volcano Find Skill by keyword. Selected skills are downloaded to the skills/ directory when the project is generated."},space:{loadError:"Failed to load",loadingSpaces:"Loading AgentKit Skills centers…",noSpaces:"This account has no AgentKit Skills centers.",selectSpace:"Select an AgentKit Skills center",openConsole:"Open in the Volcano Engine console",loadingSkills:"Loading skills…",noSkills:"This AgentKit Skills center has no skills."}},x$e={unnamedNode:"Unnamed node",editInstruction:"Select to edit instructions…",controls:{ariaLabel:"Workflow canvas controls",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Fit view"},sections:{info:"Workflow information",execution:"Execution mode",nodes:"Nodes",nodeConfig:"Node configuration"},types:{sequential:{label:"Sequential",description:"Run nodes one after another"},parallel:{label:"Parallel",description:"Run nodes at the same time"},loop:{label:"Loop",description:"Run nodes repeatedly"}},placeholders:{description:"Describe what this workflow does…",agentDescription:"Describe what this agent does…",instruction:"You are…"},errors:{workflowNameUnique:"The workflow name must be unique among agent node names",agentNameUnique:"Agent names must be unique within this workflow"},dragHint:"Drag onto the canvas, or use the button below",agentNode:"Agent node",addNode:"Add node",connectHint:"Drag between node handles to define the execution order.",create:"Create workflow",deleteNode:"Delete node",nameHelp:"Use only letters, numbers, and underscores. Names must be unique.",instruction:"Instructions",tools:"Tools (comma-separated)",nodeId:"Node ID",empty:{selectNode:"Select a node to edit its configuration",summary:"{{nodes}} nodes · {{edges}} connections"}},w$e={ariaLabel:"Quick mode creation",progress:"Quick mode creation progress",steps:{agent:{label:"Agent",title:"Basic information",description:"Set the agent's name, purpose, behavior, and capabilities"},environment:{label:"Environment",title:"Configure the environment",description:"Choose the default environment or a custom environment you have built"},deployment:{label:"Deployment",title:"Deployment preferences",description:"Configure AgentKit cloud settings"}},model:{label:"Model",source:"Model source",name:"Model name",fallbacks:"Fallback models",fallbackPlaceholder:"Fallback model name",addFallback:"Add fallback model",addProviderFallback:"Add other provider",removeFallback:"Remove",fallbackType:"Fallback model type",fallbackSameProvider:"Same provider",fallbackOtherProvider:"Other provider",apiKeyEnv:"API Key environment variable",invalidApiKeyEnv:"Use letters, numbers, and underscores only, and do not start with a number.",fallbackHelp:"Same-provider fallbacks reuse the primary connection. Other providers use separate provider, API base, and API Key settings.",fallbackIgnored:"Empty, duplicate, or primary-model entries will be ignored.",provider:"Provider",invalidApiBase:"Enter a valid http:// or https:// URL.",volcengineArk:"Volcano Ark",custom:"Custom",gateway:"Model gateway",comingSoon:"Coming soon",currentApiKey:"Current API Key",currentConfiguration:"Current configuration",loadingApiKeys:"Loading API Keys",selectApiKey:"Select an API Key",searchApiKeys:"Search API Key names",noApiKeys:"No API Keys available",loadingModels:"Loading models",selectModel:"Select a model",searchModels:"Search by name, Model ID, or provider",noModels:"No models available",apiKeyPlaceholder:"Enter a model API Key",credentialsLoadError:"Failed to load model credentials",modelsLoadError:"Failed to load models"},identity:{unnamedPool:"Unnamed user pool",currentPool:"{{value}} (current user pool)",userPool:"User pool",loading:"Loading user pools",placeholder:"Select a user pool",search:"Search user pools",empty:"This account has no Identity user pools",currentHint:"This Studio's login JWT will be forwarded to the Runtime",mismatchHint:"The selected user pool is not used by this Studio, so the Studio will not be able to call the Runtime after deployment",selectionHint:"The user pool used by this Studio is marked in the list"},agent:{namePlaceholder:"Enter an agent name",descriptionPlaceholder:"Describe what this agent can do",prompt:"Prompt",promptPlaceholder:"Define the role, goals, and behavior boundaries",skills:"Skills",addSkill:"Add skills"},validation:{descriptionRequired:"Enter a description",promptRequired:"Enter a prompt",modelRequired:"Select a model",apiKeyRequired:"Enter or select the model API Key",instanceIntegers:"Minimum instances must be an integer of 0 or greater, and maximum instances must be an integer greater than 0",instanceOrder:"Minimum instances cannot exceed maximum instances",userPoolRequired:"Select a user pool for Runtime authentication"},deployment:{runtimeName:"Runtime name",runtimeNameUpdateHint:"The existing Runtime name is preserved during updates",runtimeNameHint:"Use only letters, numbers, underscores, and hyphens",region:"Deployment region",authentication:"Authentication",apiKeyDescription:"Default: access with the Runtime API Key",userPoolDescription:"Use a JWT issued by an Identity user pool",sessionStorage:"Session storage",inMemoryStorage:"Temporary in-memory storage",backends:{sqlite:"SQLite file",mysql:"MySQL",postgresql:"PostgreSQL"},instances:"Instance settings",minInstances:"Minimum instances",maxInstances:"Maximum instances",inMemoryHint:"To prevent session loss across instances, keep the Runtime at 1–1 instances",networkMode:"Network mode",network:{public:"Public",private:"Private",both:"Public and private"},subnetIds:"Subnet IDs (optional, comma-separated)",sharedInternet:"Shared public egress in the VPC",sharedInternetHint:"Allow private Runtimes to access the public internet through shared egress",evaluationSets:"Evaluation sets",createEvaluationSets:"Create evaluation sets automatically",evaluationSetsHint:"Create Good Case and Bad Case evaluation sets after deployment",resources:"Resource configuration",complete:"Deployment complete",preparing:"Preparing deployment…"},environmentVariables:{title:"Environment variables",add:"Add variable",nameAriaLabel:"Environment variable name",valueAriaLabel:"Value for {{name}}",deleteNamed:"Delete {{name}}"},actions:{updateAgain:"Update again",deployAgain:"Deploy again",updateAndPublish:"Update and publish",applyProfile:"Apply Profile",applyProfileAgain:"Apply Profile again"}},A$e={actions:{addSubagent:"Add subagent",clearRoot:"Clear main agent",clearRootConfirmation:"Clear all settings and subagents from the main agent? This cannot be undone."},workspace:{progress:"Agent creation progress",modes:{build:"Build",validate:"Debug",optimize:"Optimize",environment:"Environment",publish:"Publish"},titles:{build:"Customize your agent architecture",validate:"Debug your agent",optimize:"Choose optimizations for your agent",environment:"Configure the cloud environment",publish:"Prepare your agent for deployment"}},sections:{type:{label:"Agent type",hint:"Choose an agent type"},basic:{label:"Basic information",hint:"Name, description, and system prompt"},model:{label:"Model",hint:"Model and service (optional)"},tools:{label:"Tools",hint:"Callable capabilities"},skills:{label:"Skills",hint:"Declarative skills"},knowledge:{label:"Knowledge base",hint:"External knowledge retrieval"},memory:{label:"Memory",hint:"Short-term and long-term memory"},subagents:{label:"Subagents",hint:"Nested collaboration"},review:{label:"Finish",hint:"Preview and create"}},agentTypes:{ariaLabel:"Agent type",remoteChildOnly:"Remote agents can only be used as child steps",llm:{label:"Agent",fullLabel:"LLM agent",description:"Uses an LLM to complete tasks autonomously"},sequential:{label:"Sequential",fullLabel:"Sequential agent",description:"Runs subagents one after another"},parallel:{label:"Parallel",fullLabel:"Parallel agent",description:"Runs subagents in parallel, then combines their results"},loop:{label:"Loop",fullLabel:"Loop agent",description:"Repeats subagents until the stop condition is met"},a2a:{label:"Remote agent",fullLabel:"Remote agent",description:"Calls a remote agent through the A2A protocol"}},basic:{agentName:"Agent name",name:"Name",agentDescription:"Agent description",descriptionPlaceholder:"Briefly describe what this agent does so your team can identify it…",nameHelp:"Follow Google ADK naming rules and keep the name unique in the execution flow.",rootDescriptionHelp:"The full description is preserved and converted to a Runtime-compatible single line during deployment.",descriptionHelp:"The description appears in agent lists and selectors.",orchestratorHelp:"This is a collaboration container and does not answer directly. Add task steps on the canvas and drag them to reorder.",maxIterations:"Maximum iterations",maxIterationsHelp:"The loop repeats its subagents until the condition is met or this limit is reached.",agentCenter:"AgentKit agent center",agentCenterHelp:"The remote agent's name, description, and capabilities come from the Agent Card returned by the center. The system discovers and attaches matching agents for each task.",moreOptions:"More options",systemPrompt:"System prompt",loadingMarkdown:"Loading Markdown editor…",markdownHelp:"Markdown shortcuts are supported. For example, type ## followed by a space to create a level-two heading.",unnamed:"Unnamed",unnamedAgent:"Unnamed agent"},validation:{remoteRoot:"A remote agent can only be a subagent",missingRegistry:"Select an AgentKit agent center",name:{required:"Name is required",reserved:"user is reserved by Google ADK. Choose another name.",characters:"Start with a letter or underscore and use only letters, numbers, and underscores"},duplicateName:"Agent names must be unique within this structure",missingDescription:"Description is required",mcpDuplicateName:"MCP names must be unique",mcpDuplicateUrl:"Remove the duplicate MCP endpoint before publishing",missingSubagent:"A subagent is required",missingPrompt:"System prompt is required",apiKeyRequired:"Enter or select the model API Key",missingSubagentDetail:"Add at least one subagent to {{type}} before debugging or publishing.",problem:"{{name}}: {{problem}}"},ai:{ariaLabel:"Fill agent configuration with AI",minimumLength:"Enter at least {{count}} characters.",replaceConfirmation:"The generated configuration will replace the current canvas and settings. Continue?",placeholder:"Describe your goal and use {{model}} to generate the configuration",generate:"Generate",generating:"Generating",success:"Configuration generated",regenerate:"Generate again",failed:"Generation failed"},debug:{ariaLabel:"Agent debugging workspace",unavailable:"This backend does not currently support generated-agent debug runs.",baseline:"Baseline",comparison:"Variant {{count}}",selectModel:"Select a model",enterDescription:"Enter a description",enterPrompt:"Enter a system prompt",duplicateConfiguration:"Test configurations must be unique",starting:"Starting…",applyAndRestart:"Apply and restart",restart:"Restart",start:"Start environment",defaultModel:"Default model",testConfiguration:"Test configuration",deleteVariant:"Delete {{name}}",deleteVariantGroup:"Delete comparison variant",creatingEnvironment:"Creating the test environment…",configurationChanged:"The configuration changed. Restart the environment.",ready:"Environment ready",readyHint:"Send a message to compare agent responses.",startHint:"Complete the configuration, then start the environment.",viewTraceNamed:"View the trace for {{name}}",traceUnavailable:"Send a message to view its trace",trace:"Trace",useConfiguration:"Use this configuration",finishConfiguration:"Finish configuration",finishAndStart:"Finish and start",currentAgentModel:"Current agent model",configurationHint:"Changes apply only to this comparison. Select this configuration to continue to deployment.",messagePlaceholder:"Send a message to the running test environments…",startOneFirst:"Start at least one test environment first",addVariant:"Add variant",traceTitle:"Trace · {{name}}",leaveTitle:"Leave debugging?",leaveDescription:"The current environments will be removed when you leave. You can start new environments when you return.",cleaning:"Cleaning up…",confirmLeave:"Leave",closeLeaveConfirmation:"Close leave-debugging confirmation"},optimization:{ariaLabel:"Agent optimization options",scenario:"Optimization scenario",components:"Optimization components",bytePlusUnavailable:"Harness Sidecar optimizations are not available for BytePlus accounts yet. Leave all optimizations unselected to continue; regular BytePlus agents are not affected.",releaseScenario:"Optimization scenario: {{profile}}",profiles:{default:{label:"Custom",description:"Choose components as needed. The Sidecar stays off when none are selected."},ops:{label:"Operations",description:"For operations diagnostics, databases, logs, and monitoring MCP servers."}},groups:{quality:"Improve response quality",cost:"Reduce runtime cost",stability:"Improve runtime stability"},options:{context_engine:{label:"Context management",description:"Manage context assembly, task anchoring, and context budgets."},compressor:{label:"Context and result compression",description:"Compress long context and large tool results to reduce token usage."},verifier:{label:"Response verification and repair",description:"Verify evidence and responses, then repair or alert on failure."},long_run_control:{label:"Goal task control",description:"Manage progress, continuation, and completion conditions for Goal tasks."},mcp_resilience:{label:"MCP resilience",description:"Manage connections, timeouts, empty results, large responses, and call budgets. Includes read-only SQL protection by default."}}},model:{label:"Model",source:"Model source",volcanoArk:"Volcano Ark",volcengineArk:"Volcano Ark",bytePlusModelArk:"BytePlus ModelArk",custom:"Custom",gateway:"Model gateway",comingSoon:"Coming soon",configuration:"Model configuration",name:"Model name",fallbacks:"Fallback models",fallbackPlaceholder:"Fallback model name",addFallback:"Add fallback model",addProviderFallback:"Add other provider",removeFallback:"Remove",fallbackType:"Fallback model type",fallbackSameProvider:"Same provider",fallbackOtherProvider:"Other provider",apiKeyEnv:"API Key environment variable",invalidApiKeyEnv:"Use letters, numbers, and underscores only, and do not start with a number.",fallbackHelp:"Same-provider fallbacks reuse the primary connection. Other providers use separate provider, API base, and API Key settings.",fallbackIgnored:"Empty, duplicate, or primary-model entries will be ignored.",provider:"Provider",invalidApiBase:"Enter a valid http:// or https:// URL.",liteLlmProviders:"LiteLLM providers",apiKeyPlaceholder:"Enter the model API Key",available:"Available",retiring:"Retiring soon",notActivated:"Not activated",unavailable:"Unavailable",apiKeyLoadError:"Failed to load Ark API Keys",loadingApiKeys:"Loading API Keys…",selectApiKey:"Select an API Key",currentApiKey:"Current API Key",apiKeyList:"API Key list",searchApiKey:"Search API Keys",searchApiKeyName:"Search API Key names",noApiKeys:"No API Keys available",noMatchingApiKey:"No matching API Keys",loading:"Loading models…",loaded:"{{count}} models loaded",loadError:"Failed to load models",selectModel:"Select a model",selectProviderModel:"Select a provider model",providerModels:"Provider models",search:"Search models",searchPlaceholder:"Search by name, Model ID, or provider",noMatches:"No matching models",empty:"No models available",unknownStatus:"Unknown status",refresh:"Refresh",refreshing:"Refreshing…",activate:"Activate",activateAction:"Open activation",currentConfiguration:"Current configuration"},tools:{builtIn:"Built-in tools",builtInHelp:"Select VeADK capabilities. Imports and required environment variables are added automatically.",codeExecution:"Code execution configuration",codeExecutionHelp:"Select the AgentKit code execution sandbox.",mcp:"MCP tools"},catalog:{web_search:{label:"Web search",description:"Get real-time information with Volcengine Web Search."},parallel_web_search:{label:"Parallel web search",description:"Run multiple search queries in parallel and combine the results faster."},link_reader:{label:"Link reader",description:"Fetch and read the main content from a URL."},web_scraper:{label:"Web scraper",description:"Crawl webpages into structured data. Requires the Scraper service."},image_generate:{label:"Image generation",description:"Generate images from text with Doubao Seedream."},image_edit:{label:"Image editing",description:"Edit or transform images with Doubao SeedEdit."},video_generate:{label:"Video generation",description:"Generate videos from text or images with Doubao Seedance, including task status queries."},text_to_speech:{label:"Text to speech (TTS)",description:"Convert text to speech with Volcengine Speech."},run_code:{label:"Code execution",description:"Run code in a sandbox."},vesearch:{label:"VeSearch",description:"Search with Volcengine VeSearch. Requires a bot endpoint."},links:{console:"Console",documentation:"Documentation"},env:{modelAgentName:{comment:"Model name"},embeddingModelName:{comment:"Embedding model required by memory and knowledge bases"},vikingMemoryProject:{comment:"VikingDB memory project"},vikingMemoryRegion:{comment:"VikingDB memory region"},vikingMemoryType:{comment:"Memory types"},feishuAppId:{comment:"Feishu app ID"},feishuAppSecret:{comment:"Feishu app secret",placeholder:"Enter the app secret"},registrySpaceId:{comment:"AgentKit agent center",placeholder:"Select an agent center"},registryTopK:{comment:"Number of agents to retrieve"},registryRegion:{comment:"AgentKit agent center region"},registryEndpoint:{comment:"AgentKit agent center OpenAPI endpoint"},agentKitToolId:{comment:"Code execution sandbox ID"},agentKitToolRegion:{comment:"AgentKit Tools region"},openVikingUrl:{comment:"OpenViking service URL"},openVikingMemoryUserId:{comment:"Memory owner ID",help:"The user segment in viking://user//peers//memories. Use it to isolate agents, tenants, or business scenarios. The default is default."},openVikingMemoryPolicy:{comment:"Memory policy",help:"Controls memory extraction and isolation. Leave it blank to use the official default policy."},openVikingKnowledgeUserId:{comment:"Knowledge base owner ID",help:"Used in the default path viking://user//resources// when no resource directory is configured. The default is default."},openVikingTargetUri:{comment:"Knowledge base resource directory",help:"Leave blank to generate it from the KnowledgeBase index. When provided, this OpenViking resource directory takes precedence."},tlsServiceName:{comment:"TLS topic_id. Leave blank to create one automatically"}}},backends:{shortTerm:{local:{label:"In-memory",description:"Stored in the process without persistence. Best for development and debugging."},sqlite:{label:"SQLite file",description:"Persist data to a local .db file."},mysql:{label:"MySQL",description:"Persist data to MySQL."},postgresql:{label:"PostgreSQL",description:"Persist data to PostgreSQL."}},longTerm:{local:{label:"Local vector store",description:"In-process llama-index vector store."},opensearch:{label:"OpenSearch",description:"Vector retrieval with OpenSearch."},redis:{label:"Redis",description:"Vector retrieval with Redis."},viking:{label:"VikingDB Memory",description:"VikingDB memory with user profile support."},openviking:{label:"OpenViking Memory",description:"Long-term memory that stores and retrieves preferences, events, and entities per user."},mem0:{label:"Mem0",description:"Managed memory from Mem0."}},knowledge:{viking:{label:"VikingDB Knowledge",description:"VikingDB knowledge base."},opensearch:{label:"OpenSearch",description:"Vector retrieval with OpenSearch."},context_search:{label:"Context Search",description:"Volcengine Context Search without embedding configuration."},openviking:{label:"OpenViking Knowledge",description:"OpenViking resource-directory knowledge base without embedding configuration."}}},exporters:{apmplus:{label:"APMPlus",description:"Volcengine APMPlus application performance monitoring."},cozeloop:{label:"CozeLoop",description:"Distributed tracing with CozeLoop."},tls:{label:"TLS (Log Service)",description:"Export logs to Volcengine TLS."}},knowledge:{title:"Knowledge base",description:"Enable external knowledge retrieval (RAG) so the agent can answer from your data.",backend:"Knowledge base backend",vikingDatabase:"VikingDB knowledge base"},memory:{shortTerm:"Short-term memory",shortTermDescription:"Store context for one session",shortTermBackend:"Short-term memory backend",longTerm:"Long-term memory",longTermDescription:"Store context across sessions, usually with vector retrieval",longTermBackend:"Long-term memory backend",vikingDatabase:"VikingDB memory",autoSave:"Save sessions to long-term memory automatically",autoSaveDescription:"Write session content to long-term memory when a session ends."},mcp:{removeTool:"Remove MCP tool",namePlaceholder:"Name (optional)",urlPlaceholder:"MCP service URL",pathWarning:"This is a gateway root address. Use it only when the root path is the MCP endpoint; otherwise include the complete service path.",tokenPlaceholder:"Bearer token (optional)",showToken:"Show Bearer token",hideToken:"Hide Bearer token",commandPlaceholder:"Command, such as npx",argsPlaceholder:"Arguments separated by spaces",stdioHint:"The stdio tool starts in the deployment environment. Make sure its command and dependencies are available.",addTool:"Add MCP tool"},resources:{unnamedAgentCenter:"Unnamed agent center",unnamedKnowledgeBase:"Unnamed knowledge base",unnamedMemory:"Unnamed memory store",loadError:"Failed to load",loadingAgentCenters:"Loading agent centers…",agentCentersLoaded:"{{count}} agent centers loaded",noAgentCenters:"No agent centers available",noMatchingAgentCenters:"No matching agent centers",searchAgentKitCenter:"Search AgentKit agent centers",searchNameOrId:"Search by name or ID",selectAgentCenter:"Select an agent center",selectAgentKitCenter:"Select an AgentKit agent center",selectedAgentCenter:"Selected agent center",agentKitCenter:"AgentKit agent center",refreshAgentCenters:"Refresh agent centers",knowledgeBaseList:"Knowledge base list",knowledgeBasePlaceholder:"Select a knowledge base",loadingKnowledgeBases:"Loading knowledge bases…",knowledgeBasesLoaded:"{{count}} knowledge bases loaded",noKnowledgeBases:"No knowledge bases available",noMatchingKnowledgeBases:"No matching knowledge bases",searchKnowledgeBase:"Search knowledge bases",selectKnowledgeBase:"Select a knowledge base",refreshKnowledgeBases:"Refresh knowledge bases",memoryList:"Memory store list",memoryPlaceholder:"Select a memory store",loadingMemories:"Loading memory stores…",memoriesLoaded:"{{count}} memory stores loaded",noMemories:"No memory stores available",noMatchingMemories:"No matching memory stores",searchMemory:"Search memory stores",selectMemory:"Select a memory store",refreshMemories:"Refresh memory stores"},env:{noAdditionalParameters:"This backend needs no additional runtime parameters.",invalidJson:"Enter valid JSON.",helpAriaLabel:"Help for {{label}}: {{help}}",openOpenViking:"Open OpenViking {{label}}",valuePlaceholder:"Enter a value",openVikingIndex:"OpenViking resource index",openVikingIndexHelp:"Leave blank to generate an index from the agent name, such as my_agent_kb. Without DATABASE_OPENVIKING_TARGET_URI, the default URI is viking://user/{knowledge base owner ID, or default}/resources/{resource index}/. When DATABASE_OPENVIKING_TARGET_URI is set, that complete URI is used instead.",openVikingIndexAriaLabel:"OpenViking resource index help: {{help}}"},deployment:{vpcRequired:"Enter a VPC ID when using VPC networking.",apiKeyRequired:"Select the API Key used by the model.",invalidEnvName:"Invalid environment variable name: {{key}}",requiredEnv:"{{name}}: enter this required environment variable",generatingConfiguration:"Generating deployment configuration",runtimeNameExists:"This Runtime name already exists. Choose another name and try again.",preparing:"Preparing deployment",applyingMpaProfile:"Applying the Agent profile to MPA Runtime",mpaProfileApplied:"MPA Runtime profile applied",runningMpaSmoke:"Verifying the MPA Runtime execution path",mpaReady:"MPA Runtime is ready",mpaOperationIncomplete:"MPA Runtime setup did not complete. Retry this deployment task.",complete:"Deployment complete",failed:"Deployment failed",updateAndPublish:"Update and publish",stages:{build:"Build image",deploy:"Deploy Runtime",publish:"Publish service",applyMpaProfile:"Apply MPA profile",verifyMpaRuntime:"Verify MPA Runtime",mpaReady:"MPA Runtime ready",running:"Deploying"}},publish:{generating:"Generating publish configuration",validating:"Validating the agent structure and preparing the deployment snapshot…"}},S$e={presets:{support:{name:"Customer support assistant",description:"Answer questions around the clock using your knowledge base and conversation history, with consistent and considerate responses.",instruction:"You are a professional and patient customer support assistant. Always use a courteous, friendly tone. Base answers on the knowledge base whenever possible. When the available information is insufficient, say so clearly and ask for the details you need instead of inventing an answer. Keep responses concise and well structured, and provide steps when useful.",subagents:{}},analyst:{name:"Data analyst",description:"Run code for statistics and visualization with tracing enabled, so every analysis is observable and reproducible.",instruction:"You are a rigorous data analyst. Clarify the objective and definitions before cleaning, analyzing, and visualizing data with executable code. Explain assumptions and methods at each step, support conclusions with key evidence, and identify possible bias or limitations.",subagents:{}},translator:{name:"Translation assistant",description:"Translate between Chinese and English accurately and naturally while preserving tone and terminology.",instruction:"You are a professional translator fluent in Chinese and English. Preserve the meaning of the source while producing natural language for the target audience. Keep proper nouns and technical terminology accurate and reflect the original tone and style. Return only the translation unless the user asks for an explanation.",subagents:{}},coder:{name:"Coding assistant",description:"Write, debug, and refactor code, validate it by running tests, and produce clear, maintainable implementations.",instruction:"You are a senior software engineer. Write correct, clear, maintainable code that follows the conventions and best practices of the target language. When uncertain, run the code to validate the implementation, cover important edge cases, and add concise comments for complex logic.",subagents:{}},researcher:{name:"Researcher",description:"Search primary sources online and combine them with knowledge and long-term memory to produce evidence-backed findings.",instruction:"You are a rigorous researcher. Break each question into key subproblems, collect multiple credible primary sources through web search, and cross-check the evidence before drawing conclusions. Cite sources, state uncertainty, distinguish facts from inference, and avoid overgeneralization.",subagents:{}},"research-team":{name:"Multi-agent research team",description:"Coordinate a researcher, analyst, and writer to produce an end-to-end research report.",instruction:"You coordinate a research team. Break down the user's research task, delegate search, analysis, and writing to the appropriate subagents, synthesize their work, and deliver a clear, evidence-backed report.",subagents:{0:{name:"Researcher",description:"Collect primary sources and data related to the topic online.",instruction:"You are the team's researcher. Find multiple credible sources about the topic, organize the key facts, data, and original citations, and hand them to the analyst without adding unsupported conclusions."},1:{name:"Analyst",description:"Cross-check and synthesize the collected material.",instruction:"You are the team's analyst. Cross-check, compare, and synthesize the research material. Extract insights, identify contradictions and uncertainty, and produce a structured set of findings."},2:{name:"Writer",description:"Turn the analysis into a clear report with reliable citations.",instruction:"You are the team's writer. Turn the analyst's findings into a clear, well-written report with consistent citations, ensuring every conclusion can be traced to a source."}}}},tags:{tools:"Tools",memory:"Memory",knowledgeBase:"Knowledge base",tracing:"Tracing",subagents:"{{count}} subagents"},gallery:{title:"Create from a template",subtitle:"Choose a prebuilt agent template and customize it to fit your needs."},detail:{back:"Back to templates",name:"Name",systemPrompt:"System prompt",model:"Model",tools:"Tools",memory:"Memory",knowledgeBase:"Knowledge base",tracing:"Tracing",subagents:"Subagents ({{count}})",create:"Create from this template",shortTermMemory:"Short-term",longTermMemory:"Long-term"}},T$e={checkingExpiry:"Checking expiry",waitingRecovery:"Waiting for recovery",listFailed:"Could not load projects",recoveryFailed:"Could not restore the workspace. Try again",operationFailed:"Project operation failed. Try again",title:"Code projects",back:"Back to code projects",restart:"This development environment will restart in {{countdown}}. Save your work regularly",expiresAt:"Expires at {{date}}",exitFullscreen:"Exit full screen",fullscreen:"Full screen",exitFullscreenHint:"Exit full screen (Esc)",recovering:"Restoring your workspace. Your project will reopen automatically",retry:"Retry connection",search:"Search code projects",newTitle:"New code project",new:"New project",readingStats:"Loading project details",createdAt:"Created",opening:"Opening",unknownCreatedAt:"Creation time unknown",open:"Open project",empty:"No matching code projects",close:"Close new project",name:"Project name",placeholder:"e.g. my-agent",nameHelp:"Start with a letter and use letters, numbers, underscores or hyphens, up to 64 characters",cancel:"Cancel",create:"Create project",files_one:"{{count}} file",files_other:"{{count}} files",directories_one:"{{count}} directory",directories_other:"{{count}} directories",separator:", "},C$e={enabled:"Enabled",disabled:"Disabled",unknownStatus:"Unknown status",allPermissions:"All permissions",customPermissions:"Custom permissions",unknownPermissions:"Unknown permissions",unnamed:"Unnamed API Key",search:"Search name, status or permissions",noMatches:"No matching API Keys",noModelPermission:"Not permitted by this API Key",modelAvailable:"Available",permissionState:{Available:"Available for chat",Shutdown:"Shut down",VideoGeneration:"Video generation model",Unsupported:"Not a chat model",NotActivated:"Not activated",Unknown:"Model status unavailable"}},idr=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:p$e,codePackage:f$e,common:s$e,default:{common:s$e,yaml:l$e,validation:c$e,defaults:u$e,helpers:d$e,intelligentDeployment:h$e,codePackage:f$e,buildCanvas:p$e,intelligent:g$e,projectLibrary:m$e,modePicker:v$e,promptEditor:y$e,skills:b$e,workflow:x$e,workbench:w$e,traditional:A$e,template:S$e,workspace:T$e,modelApiKey:C$e},defaults:u$e,helpers:d$e,intelligent:g$e,intelligentDeployment:h$e,modePicker:v$e,modelApiKey:C$e,projectLibrary:m$e,promptEditor:y$e,skills:b$e,template:S$e,traditional:A$e,validation:c$e,workbench:w$e,workflow:x$e,workspace:T$e,yaml:l$e},Symbol.toStringTag,{value:"Module"})),k$e={source:"Task source",studio:"Studio scheduled tasks",title:"Runtime scheduled tasks",selectRuntime:"Select a cloud Runtime from the Agent list first.",scope:"Scheduled tasks for the current Studio user in this Runtime.",refresh:"Refresh",loading:"Loading Runtime tasks",empty:"No matching scheduled tasks in this Runtime.",authRequired:"Runtime rejected the request. Check gateway access and the Runtime authentication setting.",forbidden:"The current user cannot access this Runtime.",unsupported:"This Runtime does not provide the MPA scheduled tasks API.",invalidResponse:"The tasks API returned unrecognized data. Check the Runtime version.",loadFailed:"Could not load tasks. Check the network and Runtime status, then refresh.",pagination:"Runtime task pagination",total:"{{total}} tasks",previous:"Previous",next:"Next",columns:{name:"Task name",enabled:"Status",schedule:"Schedule",next:"Next run",last:"Latest result"},schedule:{once:"Once",interval:"Interval",daily:"Daily",weekly:"Weekly",monthly:"Monthly",cron:"Cron"},search:"Search tasks",executionCount:"Executions",successRate:"Success rate",prompt:"Task content",manage:{view:"Task view",list:"List",calendar:"Calendar",create:"Create scheduled task",edit:"Edit task",copy:"Copy",delete:"Delete",detail:"Details",run:"Run now",name:"Task",lastRun:"Last execution",schedule:"Schedule",lastStatus:"Last execution status",agent:"Executing Agent",actions:"Actions",all:"All statuses",Pending:"Not run yet",Queued:"Queued",Running:"Running",Succeeded:"Succeeded",Failed:"Failed",TimedOut:"Timed out",Cancelled:"Cancelled",Skipped:"Skipped",overview:"Execution statistics:",prompt:"Task content",timezone:"Time zone",localTime:"Execution time (device time zone)",time:"Time",Once:"Once",Interval:"Interval",Daily:"Daily",Weekly:"Weekly",Monthly:"Monthly",Cron:"Cron expression",seconds:"seconds",interval:"Interval in seconds",weekdays:"Weekdays (1 = Monday, 7 = Sunday; comma separated)",monthDays:"Days of month (1–31; comma separated)",delivery:"Delivery",Web:"Web",Feishu:"Feishu",target:"Feishu recipient ID",enabled:"Enable task",cancel:"Cancel",save:"Save",saving:"Saving",required:"Enter a task name, Agent ID, prompt and delivery target.",timezoneInvalid:"Enter a valid IANA time zone, such as Asia/Shanghai.",futureTime:"Choose a future execution time.",intervalInvalid:"Interval must be an integer between 30 and 31536000 seconds.",daysInvalid:"Enter valid, unique days.",history:"Execution history",duration:"Duration",result:"Result / session",noRuns:"No executions yet.",conflict:"The task changed or the request conflicts. Close the dialog, refresh and retry.",invalid:"Request validation failed. Check user identity, execution time, Agent ID and task settings.",queued:"Execution request submitted.",saved:"Task updated.",deleteConfirm:"Delete “{{name}}”? It will no longer be scheduled.",calendarZone:"Display time zone:",prevMonth:"Previous month",nextMonth:"Next month",today:"Today",nextOnly:"Next only",calendarHint:"The calendar shows expected executions. Complex Cron expressions show only the next execution returned by the server.",botAccount:"Delivery bot",selectBot:"Select an enabled delivery bot.",botsLoading:"Loading Feishu bots…",botsFailed:"Could not load delivery bots. Try again.",botsUnauthorized:"You cannot read Feishu bots. Contact an administrator to configure delivery.",retryBots:"Reload bots",botDisabled:"Disabled"}},O$e={backToList:"Back to scheduled tasks",cancel:"Cancel",cancelQueue:"Cancel queued run",cancelQueueFirst:"Cancel the queued run first",cancelling:"Cancelling…",closeDrawer:"Close panel",collapse:"Collapse",connectingRuntime:"Connecting to Runtime…",createScheduledTask:"Create scheduled task",createTask:"Create task",delete:"Delete",deleteTask:"Delete task",edit:"Edit",enable:"Enable",expand:"Expand",pause:"Pause",refresh:"Refresh",refreshHistory:"Refresh run history",rerun:"Run again",retry:"Retry",runNow:"Run now",saveChanges:"Save changes",saving:"Saving…",stop:"Stop run",stopRun:"Stop this run",stopRunFirst:"Stop the current run first",stopping:"Stopping…",viewDetails:"View details"},E$e={cancelDescription:"This Session will be cancelled. Future scheduled runs will remain enabled.",cancelTitle:"Stop this run?",deleteDescription:"“{{name}}” and its complete run history will be permanently deleted.",deleteTitle:"Delete scheduled task?"},_$e={configuration:"Task configuration",nextRun:"Next run",pageLabel:"Scheduled task details",region:"Region",runtime:"Runtime",status:"Task status"},R$e={createTitle:"Create scheduled task",description:"Each trigger creates a separate Session for the Runtime Agent.",editTitle:"Edit scheduled task"},D$e={minutesSeconds:"{{minutes}} min {{seconds}} sec",seconds:"{{count}} sec"},L$e={cronExpression:"Cron expression",cronHelp:"Enter minute, hour, day of month, month, and day of week.",dailyTime:"Daily run time",enableAfterCreate:"Enable after creation",enableHelp:"The task will run at its next scheduled time after it is enabled.",name:"Task name",namePlaceholder:"For example: Generate a daily operations summary",noRuntime:"No Runtime available",prompt:"Execution prompt",promptPlaceholder:"Enter the text to send to the Agent on every run",runAt:"Run time",runtimeAgent:"Runtime Agent",runtimeHelp:"The task always uses the Runtime's currently active version.",runtimePlaceholder:"Select a Runtime Agent",schedule:"Schedule",scheduleType:"Schedule type",timezone:"Time zone",weekday:"Day of week"},M$e={all:"All"},I$e={description:"Each run uses a separate Session. Results and errors are retained.",duration:"Duration: {{duration}}",emptyDescription:"Runs will appear here after the task is triggered or run manually.",emptyTitle:"No runs yet",errorDetails:"Error details",finalAnswer:"Final answer",loadFailed:"Unable to load run history",loadFailedDescription:"Check the Studio service and try again.",session:"Session",title:"Run history"},P$e={cancelRequested:"Stop request submitted.",created:"Task created.",deleted:"The task and its run history were deleted.",enabled:"Task enabled.",paused:"Task paused.",queued:"Task queued and will start within one minute.",requeued:"Task queued again and will start within one minute.",updated:"Task updated."},N$e={filterLabel:"Filter scheduled tasks by status",listLabel:"Scheduled task list",loadFailed:"Unable to load scheduled tasks",loadFailedDescription:"Check the Studio service and try again.",title:"Cronjob"},B$e={cron:"Cron {{cron}}{{zone}}",daily:"Daily at {{time}}{{zone}}",once:"Once · {{date}}{{zone}}",weekly:"{{weekday}} at {{time}}{{zone}}"},$$e={daily:"Daily",once:"Once",weekly:"Weekly"},F$e={cancelled:"Cancelled",enabled:"Enabled",failed:"Failed",notRun:"Not run yet",paused:"Paused",pending:"Preparing",queued:"Queued",retrying:"Retrying",running:"Running",skipped:"Skipped",success:"Succeeded"},z$e={cronFields:"A Cron expression must contain five fields, for example 0 9 * * *.",nameRequired:"Enter a task name.",promptRequired:"Enter the text to send to the Agent on each run.",runtimeAppMissing:"The Runtime Agent did not return an appName. Confirm that the Runtime is ready and compatible.",runtimeRequired:"Select an available Runtime Agent.",timeRequired:"Select a run time."},U$e={friday:"Friday",monday:"Monday",saturday:"Saturday",sunday:"Sunday",thursday:"Thursday",tuesday:"Tuesday",wednesday:"Wednesday"},adr=Object.freeze(Object.defineProperty({__proto__:null,actions:O$e,confirm:E$e,default:{mpa:k$e,actions:O$e,confirm:E$e,detail:_$e,drawer:R$e,duration:D$e,fields:L$e,filters:M$e,history:I$e,notices:P$e,page:N$e,schedule:B$e,scheduleTypes:$$e,status:F$e,validation:z$e,weekdays:U$e},detail:_$e,drawer:R$e,duration:D$e,fields:L$e,filters:M$e,history:I$e,mpa:k$e,notices:P$e,page:N$e,schedule:B$e,scheduleTypes:$$e,status:F$e,validation:z$e,weekdays:U$e},Symbol.toStringTag,{value:"Module"})),V$e="Quick-create Agent",G$e="Agent type",Q$e="Close",H$e="Deploy",W$e="Preview",Y$e="Configuration download started",q$e="Download failed — try again",j$e="Review {{count}} configuration issues",X$e="Custom",K$e="Custom {{field}}",Z$e="Enter a custom value",J$e="This model declares no reasoning levels; the service settings apply",eFe="Add a model to this provider first",tFe="Select a provider first",rFe="Select an option",nFe="Optional",iFe="Default model, Agent preset and permissions apply to new sessions. The preset must exist in the deployed Harness",aFe="Enter an environment variable name only; supply its secret value at deployment",oFe="read-only allows reading; workspace-write allows workspace edits; danger-full-access allows full access without approval",sFe="allowedModels lists the models sub-agents may select. Enabling selection requires at least one provider/model pair",lFe="Add a custom model service using its endpoint, protocol and model IDs, including compatible Volcengine and BytePlus services",cFe="Covers common native settings. Other plugin parameters and preset files are not included yet",uFe="Native configuration reference",dFe="Provider {{index}}",hFe="Model {{index}}",fFe="Add provider",pFe="Remove provider {{index}}",gFe="Add model",mFe="Remove model {{index}}",vFe="Add allowed model",yFe="Remove allowed model {{index}}",bFe="Remove",xFe="Enter the service’s model ID",wFe={provider:"Provider {{index}}",model:"Model {{index}}"},AFe={defaults:"Session defaults",deepseek:"DeepSeek model service",providers:"Custom model providers",shell:"Command execution",loop:"Tool calls",subagents:"Sub-agent model selection",search:"DeepSeek web search"},SFe={id:"Provider ID",displayName:"Display name",baseURL:"Base URL",api:"API protocol",apiKeyEnv:"API key environment variable"},TFe={id:"e.g. company-models",displayName:"Optional; defaults to the provider ID",baseURL:"https://…/v1",api:"Select a protocol",apiKeyEnv:"e.g. MODEL_API_KEY"},CFe={id:"Model ID",name:"Display name",contextWindow:"Context capacity",maxTokens:"Maximum output capacity"},kFe={positive:"Enter a number greater than zero",integer:"Enter a valid positive integer",env:"Use letters, digits and underscores; do not start with a digit",url:"Enter an HTTP or HTTPS URL without credentials",option:"Select a supported native option",required:"Complete this field",duplicate:"This ID or model pair already exists",providerId:"Start with a lowercase letter; use lowercase letters, digits, dots, underscores or hyphens; reserved IDs are unavailable",routes:"Add at least one complete provider/model pair",modelPair:"Enter a model ID for this custom provider",unknownProvider:"Add this custom provider first",unknownModel:"Enter a model ID configured for this provider",timer:"Enter a timeout greater than 0 and no more than 2147483647 ms"},OFe={"agent-default-model_provider":"Default provider","agent-default-model_model":"Default model","agent-default-model_reasoningEffort":"Default reasoning effort","agent-presets_default":"Default Agent preset",permission_defaultPreset:"Default permission preset","llm-deepseek_apiKeyEnv":"API key environment variable","llm-deepseek_baseURL":"Base URL","llm-deepseek_thinking":"Thinking mode","llm-deepseek_reasoningEffort":"Reasoning effort","llm-deepseek_maxTokens":"Output limit per request","llm-deepseek_defaultContextWindow":"Default context capacity","llm-deepseek_streamIdleTimeoutMs":"Stream idle timeout (ms)",bash_timeoutMs:"Default execution timeout (ms)",bash_maxTimeoutMs:"Maximum execution timeout (ms)",bash_maxOutputBytes:"Output limit (bytes)","agent-loop_maxParallelToolCalls":"Parallel tool-call limit","subagent-model-selection_enabled":"Enable model selection","web-search-deepseek_apiKeyEnv":"API key environment variable","web-search-deepseek_baseURL":"Search base URL","web-search-deepseek_model":"Search model","web-search-deepseek_apiVersion":"API version","web-search-deepseek_maxTokens":"Search output limit","web-search-deepseek_maxUses":"Maximum search uses"},EFe="Cancel",_Fe="Back to creation methods",RFe="DeepSeek Harness configuration",odr=Object.freeze(Object.defineProperty({__proto__:null,addModel:gFe,addProvider:fFe,addRoute:vFe,agentType:G$e,back:_Fe,cancel:EFe,close:Q$e,coverage:cFe,credentialHelp:aFe,customField:K$e,customValue:X$e,default:{title:V$e,agentType:G$e,close:Q$e,continue:"Continue",deploy:H$e,preview:W$e,export:"Export configuration",downloaded:Y$e,downloadFailed:q$e,validationSummary:j$e,customValue:X$e,customField:K$e,enterCustomValue:Z$e,reasoningUnavailable:J$e,modelsUnavailable:eFe,selectProviderFirst:tFe,selectOption:rFe,optional:nFe,defaultsHelp:iFe,credentialHelp:aFe,permissionHelp:oFe,routesHelp:sFe,providersHelp:lFe,coverage:cFe,source:uFe,provider:dFe,model:hFe,addProvider:fFe,removeProvider:pFe,addModel:gFe,removeModel:mFe,addRoute:vFe,removeRoute:yFe,remove:bFe,modelIdPlaceholder:xFe,route:wFe,sections:AFe,providerFields:SFe,providerPlaceholders:TFe,modelFields:CFe,errors:kFe,fields:OFe,cancel:EFe,back:_Fe,pageTitle:RFe},defaultsHelp:iFe,deploy:H$e,downloadFailed:q$e,downloaded:Y$e,enterCustomValue:Z$e,errors:kFe,fields:OFe,model:hFe,modelFields:CFe,modelIdPlaceholder:xFe,modelsUnavailable:eFe,optional:nFe,pageTitle:RFe,permissionHelp:oFe,preview:W$e,provider:dFe,providerFields:SFe,providerPlaceholders:TFe,providersHelp:lFe,reasoningUnavailable:J$e,remove:bFe,removeModel:mFe,removeProvider:pFe,removeRoute:yFe,route:wFe,routesHelp:sFe,sections:AFe,selectOption:rFe,selectProviderFirst:tFe,source:uFe,title:V$e,validationSummary:j$e},Symbol.toStringTag,{value:"Module"})),DFe="Report an issue",LFe="Description",MFe="Common issues",IFe="Cancel",PFe="Done",NFe="Submit feedback",BFe="Submitting…",$Fe={title:"Feedback submitted. Thank you.",description:"The AgentKit team will review your report as soon as possible."},FFe={close:"Close issue report",intro:"Select the issues you encountered and add any useful details.",privacy:"Your conversation data will be shared with the AgentKit team. Please protect sensitive information.",descriptionPlaceholder:"Describe what happened (optional)",issues:{slow:"Slow execution",crash:"Runtime crash",incorrect:"Inaccurate result",tool_error:"Tool call failed",other:"Other issue"}},zFe={description:"Tell us about a problem you encountered while using AgentKit Studio.",module:"Area",modules:{conversation:"Conversation",agents:"Agents",applications:"Automations",search:"Search",other:"Other"},commonIssuesMultiple:"Common issues (select all that apply)",issueTypes:"Issue types",issues:{page_slow:"Page loads slowly",feature_unavailable:"Feature unavailable",display_error:"Display issue",no_response:"Action has no response",other:"Other issue"},descriptionPlaceholder:"Describe the page, action, and what happened",quickAdd:"Quick add",suggestionsLabel:"Suggested descriptions",suggestions:{noResponse:"Nothing happens after I click",loading:"The page remains in a loading state",incomplete:"Some content is missing or clipped",error:"An error appears after the action"},privacy:"Your data will be shared with the AgentKit team. Please protect sensitive information."},sdr=Object.freeze(Object.defineProperty({__proto__:null,cancel:IFe,commonIssues:MFe,default:{title:DFe,descriptionLabel:LFe,commonIssues:MFe,cancel:IFe,done:PFe,submit:NFe,submitting:BFe,success:$Fe,dialog:FFe,page:zFe},descriptionLabel:LFe,dialog:FFe,done:PFe,page:zFe,submit:NFe,submitting:BFe,success:$Fe,title:DFe},Symbol.toStringTag,{value:"Module"})),UFe={back:"Back",close:"Close"},VFe={title:"Optimize migrated project",closeAria:"Close optimization dialog"},GFe={title:"Migrated projects",description:"Manage migrated source versions or continue optimizing any version.",libraryTitle:"Projects and versions",libraryDescription:"View, download, deploy, or compare source versions, or continue optimizing any version.",emptyTitle:"No migrated projects yet",emptyDescription:"Migrated source code will be saved here automatically."},QFe={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any (universal migration)"},HFe={awaitingUpload:"Awaiting upload",analyzing:"Analyzing",needsInput:"Needs input",analysisReady:"Awaiting confirmation",migrating:"Migrating",validating:"Validating",packaging:"Packaging",succeeded:"Completed",succeededWithWarnings:"Completed with notices",partial:"Partially completed",failed:"Failed",cancelled:"Stopped",expired:"Expired"},WFe={evaluationPending:"Evaluation pending",evaluationRunning:"Evaluating",waitingDataset:"Evaluation cases pending",waitingEnvironment:"Environment variables required",evaluationFailed:"Migrated, evaluation incomplete",evaluationBlocked:"Migrated, evaluation needs attention",evaluationCancelled:"Migrated, evaluation cancelled",resultUnavailable:"Result unavailable",environmentExpired:"Environment expired"},YFe={partialReady:"Migration output is ready, but delivery is incomplete. Review the migration notices.",readyWithWarnings:"Migration output is ready. Review the migration notices.",ready:"Migration output is ready."},qFe={passed:"Output verification passed",failed:"Output verification failed",degraded:"Output verification incomplete"},jFe={session:"Create migration environment",upload:"Upload project",analysis:"Analyze project"},XFe={agentNameRequired:"Enter an Agent name",agentNameInvalid:"Agent names must be 1–63 characters, contain only lowercase letters, numbers, and hyphens, and start and end with a letter or number"},KFe={seconds:"{{seconds}} sec",minutesSeconds:"{{minutes}} min {{seconds}} sec"},ZFe={savedUnaffected:"Saved projects are unaffected",savingUnaffected:"Source is being saved and will be unaffected once complete",activeDetail:"Task history and temporary output will become unavailable after expiration",oneHour:"Temporary migration environment is retained for 1 hour",ended:"Temporary migration environment has ended",savedAvailable:"Saved projects remain available to view, download, deploy, or optimize",unavailable:"Task history and temporary output are no longer available",countdown:"Temporary migration environment ends in {{minutes}} min {{seconds}} sec",expiredSavedMessage:"The temporary migration environment has ended. Saved projects are unaffected.",expiredMessage:"The temporary migration environment has ended. Task history and temporary output are no longer available."},JFe={recommended:"Recommended migration method",scope:"Migration scope",excluded:"Out of scope",viewEvidence:"View analysis evidence",viewAssumptions:"View key assumptions",viewSourceEvidence:"View source evidence"},e9e={ariaLabel:"Codex activity",title:"Codex activity",startingAnalysis:"Codex is starting the analysis…",startingMigration:"Codex is starting the migration…",loadError:"Codex activity is temporarily unavailable. The current task is unaffected.",liveAnalyzing:"Analyzing the project",liveMigrating:"Running the migration",liveValidating:"Verifying the migration",livePackaging:"Packaging the migration",liveDelivery:"Reviewing the delivery"},t9e={title:"Migration output",fileTooLarge:"This file exceeds 2 MiB. Download the complete output to view it.",unsupportedPreview:"This file cannot be previewed here. Download the complete output to view it.",filesAria:"Migration output files",searchAria:"Search output files",searchPlaceholder:"Search files",limit:"Showing the first {{count}} items. Search for a specific file.",noSelection:"No file selected",noPreview:"No files available to preview.",loadingFile:"Loading output file…",startupFile:"Startup file",fileCountLabel:"Files",saved:"Source has been saved. You can view, download, deploy, or optimize it.",saving:"Output is ready and the source version is being saved.",deployReady:"Output is available to preview, download, and deploy. Waiting for source save status.",deployUnavailable:"Output is available to preview and download, but its current delivery status does not support deployment.",viewProjects:"View migrated projects",downloading:"Downloading…",downloadZip:"Download ZIP",deployTitle:"Deploy migration output",deployUnavailableTitle:"Current delivery status does not support deployment",deployRuntime:"Deploy to Runtime",fileCount:"{{count}} files",startup:"Startup file {{module}}",loading:"Loading migration output…"},r9e={retiring:"Retiring soon",currentDefault:"Current default model",loadError:"Failed to load models",label:"Model",placeholder:"Select a model"},n9e={zipOnly:"Select a local project in .zip format.",invalidName:"The ZIP file name is invalid. Rename the file and select it again.",tooLarge:"The project ZIP cannot exceed {{size}}.",empty:"The project ZIP cannot be empty.",removeAria:"Remove project ZIP",reselectPrompt:"Select the project ZIP again",selectPrompt:"Select or drop a local project ZIP",reselect:"Select again",selectZip:"Select ZIP",continue:"Continue upload",start:"Upload and analyze",inputAria:"Select a local project ZIP",retention:"The temporary migration environment is retained for 1 hour after creation. Successfully saved source versions are unaffected.",uploading:"Uploading…",sizeHint:"Project ZIP, up to {{size}}"},i9e={requiredPlaceholder:"Enter {{key}}",optionalPlaceholder:"Optional: {{key}}",notReady:"Migration output is not ready yet.",back:"Back to migration results"},a9e={backToAddAgent:"Back to Add Agent",title:"Migrate existing project",newMigration:"New migration",recent:"Recent migrations",loadingSessions:"Loading migration sessions…",noSessions:"No migration sessions",heading:"Migrate an existing Agent project",intro:"Upload a local project ZIP. Codex will first perform a read-only analysis, then ask you to confirm the migration method.",backToHome:"Migration home",navigation:"Migration navigation",showMore:"Show more",showLess:"Show less",projectName:"Project name",status:"Status",createdAt:"Created",actions:"Actions",openTask:"Open migration {{name}}",continueTask:"Continue",viewTask:"View"},o9e={stop:"Stop migration",stopping:"Stopping…",cancel:"Cancel",reload:"Reload",refreshStatus:"Refresh status"},s9e={unavailable:"Migration is currently unavailable",defaultReason:"Dev Sandbox is currently unavailable. Contact your administrator to check the configuration."},l9e={creatingSandbox:"Creating Dev Sandbox",initializing:"Initializing the migration workspace and checking AgentKit CLI, Codex, and migration capabilities. The project will upload automatically when the environment is ready.",elapsed:"Elapsed: {{duration}}",uploadThenAnalyze:"Read-only analysis will start automatically after the ZIP upload completes.",analyzing:"Codex is identifying the framework, entry point, and migration boundaries. No migration changes are being made.",migrationLocked:"Attachments and migration settings cannot be changed while migration is running. Wait for the task to finish or stop it.",analysisPaused:"Read-only analysis is paused. Answer only the questions below. After submission, analysis will continue in the same environment without starting the migration.",analysisComplete:"Read-only analysis is complete. Review the recommendation and confirm the final migration method.",awaitingUpload:"The migration environment is ready. Select the local ZIP again to continue uploading.",expiredTitle:"Migration environment expired",expiredDescription:"Migration content and output can no longer be previewed, downloaded, or deployed. If the Runtime deployment completed, return to the Agents page to continue using it.",unsupportedTitle:"This ZIP cannot be migrated yet",unsupportedHint:"Update the project as instructed, then create a new migration and upload it again.",failedTitle:"Migration incomplete",cancelled:"This migration was stopped. Create a new migration and upload the project again."},c9e={ariaLabel:"Provide project analysis details",title:"Additional information needed for analysis",description:"The attachment stays locked; submitting continues read-only analysis only",submitting:"Continuing analysis…",submit:"Submit and continue analysis"},u9e={ariaLabel:"Answer the questions the migration needs you to decide",title:"The migration needs your answer",description:"Your answer continues the current step instead of restarting it",other:"Other",otherPlaceholder:"Or type your own answer",submitting:"Submitting your answer…",submit:"Submit answer and continue"},d9e={ariaLabel:"Confirm migration method",title:"Confirm migration method",framework:"Migration method",frameworkPlaceholder:"Select a migration method",agentName:"Agent name",entry:"Project entry point",entryPlaceholder:"Select a project entry point",entryExample:"For example, agent.py:agent",consent:"By selecting “Confirm and start migration,” you confirm the migration scope, exclusions, and key assumptions above.",starting:"Starting migration…",start:"Confirm and start migration"},h9e={setup:{title:"Migration effect evaluation",description:"Evaluation cases run automatically after migration.",on:"On",off:"Off",unavailable:"Migration effect evaluation is unavailable in this environment.",casesTitle:"Evaluation cases",casesDescription:"Add at least one case. Expected outcomes and criteria are optional.",configuredSummary:"{{count}} cases · {{preset}} · {{dimensions}}",incompleteSummary:"{{count}} cases need content · {{preset}} · {{dimensions}}",dimensionSummary:"{{count}} dimensions",editSettings:"Edit settings",viewSettings:"View settings",lockedTitle:"Evaluation cases",lockedDescription:"Cases cannot change after upload starts.",closeAria:"Close evaluation settings",done:"Finish setup",close:"Close"},tabs:{label:"Migration task content",migration:"Migration",evaluation:"Evaluation",waitingMigration:"Waiting for migration",waitingConfiguration:"Setup required",running:"Running",completed:"Completed",issue:"Needs attention"},bulk:{open:"Paste multiple",label:"Enter one case per line",placeholder:`Check the status of today's orders Summarize the result in three points`,preview:"{{count}} cases will be added",confirm:"Add cases"},case:{title:"Case {{index}}",add:"Add case",moveUp:"Move case {{index}} up",moveDown:"Move case {{index}} down",copy:"Duplicate",delete:"Delete",userInput:"User input",userInputPlaceholder:"For example: Check the status of today's orders",expectedOutcome:"Expected outcome (optional)",expectedOutcomePlaceholder:"Describe what the Agent should accomplish; exact wording is not required",criteria:"Requirements (optional)",addCriterion:"Add requirement",criterionLabel:"Requirement {{index}}",criterionPlaceholder:"For example: Include the order ID and current status",removeCriterion:"Remove requirement {{index}}"},advanced:{title:"Advanced settings",standard:"Standard evaluation",standardDescription:"Uses 3 dimensions by default: semantic fidelity, output constraints, and workflow/tool fidelity.",custom:"Custom dimensions",customDescription:"Select one or more dimensions based on business risk.",lockedDescription:"The evaluation method and dimensions cannot change after upload starts."},dimension:{semantic_fidelity:"Semantic fidelity",output_contract:"Output contract",workflow_tool_fidelity:"Workflow and tool fidelity",context_memory_fidelity:"Context and memory fidelity",boundary_error_fidelity:"Boundary and error fidelity",safety_refusal_fidelity:"Safety and refusal fidelity"},dimensionDescription:{semantic_fidelity:"Checks whether intent, conclusions, and key facts remain consistent.",output_contract:"Checks required fields, structure, language, and formatting constraints.",workflow_tool_fidelity:"Checks observable workflow branches and tool-driven behavior.",context_memory_fidelity:"Checks supported multi-turn context and memory behavior.",boundary_error_fidelity:"Checks invalid input, missing information, and dependency failures.",safety_refusal_fidelity:"Checks existing authorization, refusal, and sensitive-data boundaries."},validation:{caseCount:"Keep between 1 and {{count}} cases.",dimensionRequired:"Select at least one evaluation dimension.",userInputRequired:"Enter case input.",userInputBytes:"A case cannot exceed 32 KiB.",expectedOutcomeBytes:"The expected outcome cannot exceed 16 KiB.",criteriaCount:"A case can contain at most {{count}} requirements.",criterionRequired:"Requirements cannot be empty.",criterionBytes:"One requirement cannot exceed 2 KiB.",datasetBytes:"All evaluation cases cannot exceed 10 MiB."},dataset:{invalidLockResponse:"The service did not confirm that evaluation cases were saved. Try again.",loadingSettings:"Loading evaluation settings…",loadSettingsFailed:"Evaluation settings could not be loaded.",retryLoadSettings:"Reload",missing:"No saved evaluation cases were found. Enter and save them again.",saveWarning:"Evaluation cases were not saved. Migration continues.",retrySave:"Save evaluation cases again",saving:"Saving…"},state:{disabled:"Evaluation is off",waiting_dataset:"Waiting for evaluation cases",pending:"Evaluation starts automatically after migration",preparing:"Preparing the evaluation environment…",waiting_environment:"Runtime environment variables are required",deploying:"Deploying a temporary Runtime…",executing:"Running evaluation cases…",judging:"Running evaluation analysis…",aggregating:"Aggregating evaluation results…",completed:"Evaluation completed",failed:"Evaluation incomplete",blocked:"Evaluation requires attention before it can continue",cancelled:"Evaluation cancelled"},progress:{label:"Migration and migration effect evaluation progress",migration:"Migration",evaluation:"Migration effect evaluation",notStarted:"Not started",inProgress:"In progress",completed:"Complete",waitingConfiguration:"Waiting for setup",issue:"Needs attention"},environment:{description:"Enter the environment variables required by the temporary Runtime.",security:"Used only for this evaluation.",optional:"Optional",submit:"Submit and continue evaluation",submitting:"Submitting…"},execution:{preparing:"Prepare evaluation",preparingDetail:"Validate migration output and {{count}} evaluation cases",deploying:"Start Runtime",deployingDetail:"Prepare {{runtime}}",runtimeFallback:"isolated runtime",executing:"Run cases",executingDetail:"Run {{count}} cases and capture output",judging:"Run evaluation analysis",judgingDetail:"Evaluate {{cases}} cases · {{dimensions}} dimensions",aggregating:"Generate evaluation report",aggregatingDetail:"Aggregate scores and evidence into an HTML report",waiting:"Waiting",running:"Running",failed:"Failed",complete:"Completed"},result:{title:"Execution progress",attempt:"Evaluation attempt {{attempt}}",pending:"Waiting for migration to complete",retry:"Run evaluation again",retrying:"Retrying…",failureStage:"Failed at",errorCode:"Error code",taskId:"Task ID",diagnosticAttempt:"Evaluation attempt",runtime:"Runtime",errorDetails:"Error details",diagnosticField:"{{label}}: {{value}}",diagnosticHeading:"{{label}}:",loadingReport:"Loading the evaluation report…",reportTitle:"HTML evaluation report",reportHtmlDescription:"View or download the HTML report.",viewReport:"View report",reportDrawerDescription:"Scores, differences, and evidence",closeReport:"Close",closeReportAria:"Close evaluation report",reportPreviewTitle:"Migration effect evaluation report preview",reportSummary:"Evaluation summary",reportVersion:"Dataset {{version}} · Prompt v{{prompt}}",downloadReport:"Download full report",downloadingReport:"Downloading…",overallScore:"Overall fidelity",scoreScale:"0–100; N/A when evidence is insufficient",evidenceCoverage:"Evidence coverage",coverageDetail:"{{scored}} of {{total}} dimensions evidenced",executionSuccess:"Execution success",executionDetail:"{{succeeded}} of {{total}} cases completed",naCount:"N/A count",naDescription:"Insufficient evidence; excluded from scores",gapDescription:"Migration gap summary",lowestScoringCases:"Lowest-scoring cases",executionFailures:"Execution issues",criticalEvidence:"Critical evidence",limitations:"Evaluation limitations",viewEvidence:"View results and evidence for {{count}} cases",outputTruncated:"Long output was truncated",executionState:{succeeded:"Execution completed",failed:"Execution issue"},severityLabel:"Severity: {{severity}}",severity:{none:"None",low:"Low",medium:"Medium",high:"High",critical:"Critical",unknown:"Unknown"},evidenceSource:{user_reference:"Expected outcome",user_criteria:"Provided requirements",source_contract:"Source contract",observed_output:"Observed output",runtime_observation:"Raw Runtime data",deterministic_assertion:"Deterministic assertion"},listSeparator:", "}},f9e={closeAria:"Dismiss error",loadFailed:"Could not load migration data. Try again.",refreshFailed:"Could not refresh the migration status. Try again."},p9e={title:"Stop the current migration?",description:"Stopping ends the current analysis or migration process. Completed steps will not continue."},ldr=Object.freeze(Object.defineProperty({__proto__:null,actions:o9e,activity:e9e,analysis:JFe,artifact:t9e,capability:s9e,common:UFe,confirmation:d9e,conversation:l9e,default:{common:UFe,optimization:VFe,projects:GFe,framework:QFe,state:HFe,historyStatus:WFe,task:YFe,verification:qFe,transfer:jFe,validation:XFe,duration:KFe,expiry:ZFe,analysis:JFe,activity:e9e,artifact:t9e,model:r9e,upload:n9e,deployment:i9e,workspace:a9e,actions:o9e,capability:s9e,conversation:l9e,questions:c9e,pendingInput:u9e,confirmation:d9e,evaluation:h9e,errors:f9e,stopDialog:p9e},deployment:i9e,duration:KFe,errors:f9e,evaluation:h9e,expiry:ZFe,framework:QFe,historyStatus:WFe,model:r9e,optimization:VFe,pendingInput:u9e,projects:GFe,questions:c9e,state:HFe,stopDialog:p9e,task:YFe,transfer:jFe,upload:n9e,validation:XFe,verification:qFe,workspace:a9e},Symbol.toStringTag,{value:"Module"})),g9e={loading:"Loading…",searchLabel:"Search {{label}}",searchPlaceholder:"Search {{label}}",retry:"Retry",noMatches:"No matches",noOptions:"No options available",selection:"{{label}}: {{value}}"},m9e={badge:"All new",view:"See what's new",title:"What's new",defaultNotes:{multiRegion:"Multi-region agents: load Beijing and Shanghai Runtimes in parallel, with more available as you scroll.",switchAgent:"Switch in conversation: choose an agent beside the composer and start a new conversation immediately.",visualCanvas:"Visual execution canvas: inspect multi-agent structures on a horizontal canvas with fullscreen support."}},v9e={label:"New conversation workspace",agent:"Agent",skill:"Skill customization",video:"Video creation"},y9e={select:"Select conversation mode",agent:{label:"Agent",description:"Chat with the selected Agent"},builtin:{label:"Built-in Agent",description:"Use an Agent provided by the platform"},codex:{label:"Codex Agent",description:"Run tasks in a sandbox"},deepseekHarness:{label:"DeepSeek Harness",description:"Open the DeepSeek Harness workspace"},arkClaw:"ArkClaw",hermes:"Hermes Agent",checking:"Checking configuration",notConfigured:"Not configured by an administrator",unavailable:"Unavailable"},b9e={select:"Select Agent",typesLabel:"Agent types",listLabel:"{{type}} list",types:{agent:"Agent",general:"General Agent",mpa:"MPA Agent",codex:"Codex Agent",deepseekHarness:"DeepSeek Harness",openclaw:"OpenClaw Agent",hermes:"Hermes Agent"},loading:"Loading Agents",reload:"Reload",empty:"No {{type}} yet",emptyLocal:"No local Agents yet",emptyGeneral:"No General Agents yet",createHint:"Create one from the Agents page",localHint:"Check the directory where Studio was started",waking:"Waking up",opening:"Opening",connecting:"Connecting",loadingMore:"Loading",loadMore:"Load more",runtimeTimeout:"Loading Agents timed out after 15 seconds. Check the network or Runtime service and retry.",loadGeneral:"Load General Agents",loadType:"Load {{type}}",connectGeneral:"Connect to General Agent",openLocal:"Open local Agent",openType:"Open {{type}}",wakingHint:"Waking the agent. This may take some time."},x9e={spaceAria:"Skill spaces",configuration:"Skill customization settings",actions:{create:"Generate Skill",optimize:"Optimize Skill"},selectAction:"Select a Skill customization action",actionList:"Skill customization actions",style:"Style",selectStyle:"Select style",model:"Model",selectModel:"Select model",styles:{concise:"Concise and practical",strict:"Rigorous and reliable",tutorial:"Tutorial-friendly",automation:"Automation-first"},modelLoadFailed:"Failed to load model configuration",spaceLoadFailed:"Failed to load Skill Spaces",skillLoadFailed:"Failed to load Skills",unnamedSpace:"Unnamed Skill Space",space:"Skill Space",select:"Select Skill",selectAria:"Select Skill: {{skill}}",loadingSpaces:"Loading Skill Spaces",reload:"Reload",emptySpaces:"No Skill Spaces yet",skillList:"{{space}} Skill list",loadingSkills:"Loading Skills",emptySkills:"No Skills yet"},w9e={modes:{auto:"Auto detect",text_to_video:"Text to video",reference_to_video:"Reference to video",video_editing:"Video editing",video_extension:"Video extension",first_last_frame:"First and last frames"},taskNames:{auto:"Video generation",text_to_video:"Text-to-video",reference_to_video:"Reference-to-video",video_editing:"Video editing",video_extension:"Video extension",first_last_frame:"First-and-last-frame generation"},controls:{label:"Video creation settings",aspectRatio:"Aspect ratio",selectAspectRatio:"Select aspect ratio",resolution:"Resolution",selectResolution:"Select resolution",duration:"Duration",durationShort:"{{count}}s",durationAria:"Video duration: {{count}} seconds",lastFrame:"Last frame",lastFrameHelper:"Add the video's ending frame",assistImage:"Supporting image",referenceImage:"Reference image",assistImageHelper:"Add visual guidance",imageHelper:"Supports common image formats",referenceVideo:"Reference video",videoHelper:"Supports common video formats",optional:"Optional",replace:"Replace",add:"Add",upload:"Upload {{label}}",replaceFile:"Replace {{label}}: {{name}}",removeFile:"Remove {{label}} {{name}}",storageUnavailable:"Persistent storage is not configured",loadingEnhancer:"Loading prompt enhancement model",enhancerHint:"Uses {{model}} for intent recognition and prompt enhancement",enhancerUnavailable:"Prompt enhancement model unavailable"},task:{title:"Video generation task",closeAria:"Close video generation task dialog",progressAria:"Video generation progress",optimizedPrompt:"Optimized prompt",processingAria:"{{task}} progress",waitingAria:"{{status}}, elapsed {{elapsed}}",elapsed:"Elapsed {{elapsed}}",previewAria:"Generated video preview",close:"Close",download:"Download video",retryOptimization:"Retry prompt optimization",retryGeneration:"Retry video generation",providerQueued:"Waiting for model scheduling",providerRunning:"Model generating",providerSubmitting:"Submitting task",queuedHint:"The task was submitted. Its status will update automatically when processing begins.",runningHint:"This may take several minutes. The video preview will appear here when complete.",backgroundHint:"You can close this dialog. The task will continue in the background.",successHint:"Your video is ready to preview or download.",activationHint:"Activate the service in the model console, then retry generation.",retryHint:"Fix the issue and retry the current step.",steps:{optimizationFailed:"Prompt optimization failed",optimizationDone:"Prompt optimization complete",optimizationActive:"Optimizing prompt",generationDone:"{{task}} complete",generationFailed:"{{task}} failed",generationQueued:"{{task}} queued",generationRunning:"Generating {{task}}",generationActive:"{{task}} in progress",generationPending:"Waiting for video generation",generationComplete:"Video generation complete"},elapsedHours:"{{hours}}h {{minutes}}m",elapsedMinutes:"{{minutes}}m {{seconds}}s",elapsedSeconds:"{{seconds}}s"}},cdr=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:b9e,compactSelect:g9e,default:{compactSelect:g9e,featureNotice:m9e,workspace:v9e,mode:y9e,agentPicker:b9e,skill:x9e,video:w9e},featureNotice:m9e,mode:y9e,skill:x9e,video:w9e,workspace:v9e},Symbol.toStringTag,{value:"Module"})),A9e="Review center",S9e="Resource type to review",T9e="Only administrators can access the review center",C9e="Search name, submitter or version",k9e="Review status",O9e="Pending: {{count}}",E9e="Requests: {{count}}",_9e={skill:"Skills",agent:"Agents"},R9e={all:"All statuses",pending:"Pending",approved:"Approved",returned:"Returned",approving:"Publishing"},D9e={application:"Request",submitter:"Submitter",version:"Version",submittedAt:"Submitted at",status:"Status",actions:"Actions"},L9e={details:"Details",detailsFor:"View request for {{name}}",approve:"Approve",approveFor:"Approve request for {{name}}",return:"Return",returnFor:"Return request for {{name}}",close:"Close",backToDetails:"Back to details",confirmApprove:"Confirm approval",confirmReturn:"Confirm return",clearFilters:"Clear filters",refresh:"Refresh",cancel:"Cancel",resumeApproval:"Resume publishing"},M9e={title:"No review requests yet",description:"Submitted review requests will appear here",filteredTitle:"No matching requests",filteredDescription:"Try another search or change the review status"},I9e={title:"Request details",sections:"Request detail sections",overview:"Overview",files:"Submitted files · {{count}}",requestType:"Request type",update:"Version update",firstRelease:"First release",source:"Source",source_skill:"{{name}}’s personal skill space",source_agent:"{{name}}’s development environment",destination:"Publication target",destination_skill:"Shared skill space",destination_agent:"Shared agent",region:"Region",visibility:"Visibility after publication",shared:"Visible to everyone",description:"Description",changes:"Submission notes",example:"Usage example",history:"Review history",submitted:"{{name}} submitted this request",versionFixed:"Reviewing the submitted version only",instructions:"Instructions",filesTab:"Submitted files",filesFailed:"Could not load submitted files",unknownAuthor:"Unknown submitter",reviewer:"Reviewed by",reviewedAt:"Reviewed at",approved:"{{name}} approved the request",returned:"{{name}} returned the request",unknownReviewer:"Unknown reviewer",approvedBy:"Approved by",returnedBy:"Returned by",comment:"Review comment",result:"Review result",noHistory:"This skill has not been submitted for review",pendingHint:"Waiting for an administrator to review",approvingHint:"Approval is confirmed and publishing to the shared space is in progress",approving:"{{name}} confirmed approval; publishing is in progress"},P9e={failed:"The review space is unavailable",retry:"Retry"},N9e={approveTitle:"Approve request",returnTitle:"Return request",approveDescription:"Approving {{name}} {{version}} makes this version available to everyone in the enterprise shared space",returnDescription:"Return {{name}} {{version}} and explain what the applicant should change",reason:"Return reason",reasonRequired:"Enter a return reason",reasonHelp:"Up to 256 characters, visible to the applicant",saving:"Saving…",failed:"Review failed, please try again",approved:"{{name}} was approved and shared",returned:"{{name}} was returned",comment:"Comment (optional)",commentHelp:"Up to 256 characters, visible to the applicant"},B9e={title:"AI score",points:"{{score}} / 100",insufficient:"Insufficient evidence",status:{unscored:"Not scored",not_requested:"Not scored",queued:"Queued",running:"Scoring",completed:"Scored",failed:"Scoring failed"},loading:"Loading score…",starting:"Submitting for scoring…",loadFailed:"Could not load score",retryFailed:"Could not request scoring",failed:"Scoring failed, ask an administrator to retry",retry:"Score again",start:"Start scoring",reload:"Reload",download:"Download JSON",expand:"Expand",collapse:"Collapse",hint:"Scores apply to this submitted version and inform the administrator’s decision",dimensions:{safety:"Safety",usability:"Usability",completeness:"Completeness",reliability:"Reliability",maintainability:"Maintainability"},risks:"Risk flags",suggestions:"Suggestions",model:"Scoring model",rubric:"Rubric version",time:"Scored at",severity:{low:"Low risk",medium:"Medium risk",high:"High risk",critical:"Critical risk"},coverage:"Review coverage",coverageCount:"Reviewed {{included}} of {{total}} files",coverageIncomplete:"Some content was excluded, so scoring evidence is incomplete",omittedFile:"Not reviewed {{path}}: {{reason}}",truncatedFile:"Partially reviewed {{path}}: {{reason}}",originalError:"Original cloud error"},udr=Object.freeze(Object.defineProperty({__proto__:null,actions:L9e,adminOnly:T9e,category:S9e,columns:D9e,decision:N9e,default:{title:A9e,category:S9e,adminOnly:T9e,search:C9e,filterStatus:k9e,pendingCount:O9e,total:E9e,kind:_9e,status:R9e,columns:D9e,actions:L9e,empty:M9e,detail:I9e,space:P9e,decision:N9e,score:B9e},detail:I9e,empty:M9e,filterStatus:k9e,kind:_9e,pendingCount:O9e,score:B9e,search:C9e,space:P9e,status:R9e,title:A9e,total:E9e},Symbol.toStringTag,{value:"Module"})),$9e={cancel:"Cancel",close:"Close",retry:"Retry",tryAgain:"Try again",closeDialog:"Close {{title}}",agentFallback:"{{agent}} Agent",unknownSource:"Unknown source"},F9e={terminalTitle:"Terminal",browserTitle:"Sandbox browser",terminalSubtitle:"Connect to the interactive terminal for the current AgentKit Session",browserSubtitle:"View and control the browser in the current AgentKit Session",connecting:"Connecting…",connected:"Connected",notConnected:"Not connected",opening:"Opening {{title}}",connectingSession:"Connecting the tool to the current AgentKit Session.",openFailed:"Failed to open {{title}}"},z9e={title:"Resume Codex conversation",subtitle:"Select a recently updated Thread from the current Sandbox Session",loading:"Loading conversation history",loadFailed:"Failed to load conversation history",empty:"No conversations to resume"},U9e={title:"Codex permissions",subtitle:"Settings are saved to the current Sandbox Session and applied to all of its Threads",sandboxMode:"Sandbox mode",approvalPolicy:"Approval policy",approvalMethod:"Approval method",networkAccess:"Allow network access",networkAccessHelp:"Control external network access in workspace-write and read-only modes.",fullAccessWarning:"Full access disables file system and network isolation. Use it only for trusted tasks.",save:"Save permissions",sandboxChoices:{readOnly:{label:"Read only",detail:"Allow reading files without writing to the workspace."},workspaceWrite:{label:"Workspace write",detail:"Allow reading and modifying files in the current workspace."},fullAccess:{label:"Full access",detail:"Disable sandbox isolation for explicitly trusted tasks."}},approvalChoices:{untrusted:{label:"Untrusted commands only",detail:"Request approval only for operations Codex considers untrusted."},onRequest:{label:"On request",detail:"Allow Codex to ask you to approve commands or file changes when needed."},never:{label:"Never ask",detail:"Codex will not pause to request manual approval."}},reviewerChoices:{user:{label:"Ask me",detail:"Approval requests appear in Studio for you to decide."},autoReview:{label:"Automatic review",detail:"Use the Codex automatic review flow to handle approval requests."}}},V9e={title:"Workspace",subtitle:"Choose the directory where the current Codex Thread runs commands and modifies files",absolutePath:"Absolute path",browse:"Browse",parent:"Parent directory",empty:"This directory has no subdirectories",locked:"The conversation has started and the workspace is locked. Start a new Sandbox Session to choose another workspace.",useDirectory:"Use this directory"},G9e={fileTitle:"Allow file changes?",commandTitle:"Allow command execution?",subtitle:"Codex is waiting for your decision",workingDirectory:"Working directory",decline:"Decline",acceptOnce:"Allow once",acceptSession:"Allow for session"},Q9e={availableSkills:"Available Skills",selectModel:"Select model",commands:"Codex shortcuts",currentModel:"Current: {{model}}",loadingSkills:"Discovering Skills in the current workspace…",loadingModels:"Loading models…",noSkillMatches:"No matching Skills in the current workspace",noModelMatches:"No matching models. You can also enter a model ID directly",noCommandMatches:"No matching shortcuts",skillFallback:"Load and run this Skill",add:"Add",uploadImage:"Upload image",uploadDocument:"Upload document or PDF",uploadVideo:"Upload video",openTerminal:"Open terminal",viewBrowser:"View browser",permissions:"Codex permissions",workspaceLocked:"The conversation has started and the workspace is locked",selectWorkspace:"Select workspace",workspace:"Codex workspace",endpointCopied:"Endpoint copied",copyEndpoint:"Copy Sandbox Endpoint",continuePlaceholder:"Describe what you want to implement or adjust next",messagePlaceholder:"Message the AgentKit Sandbox. Type / for commands or $ to invoke a Skill…",stop:"Stop generating",send:"Send",stopping:"Confirming stop…",resume:"Resume task",steer:"Add instructions",steerPlaceholder:"Add instructions, or stop the task at any time…"},H9e={defaultName:"My Agent",namedDefault:"My {{agent}}",creatingTitle:"Creating {{agent}} Agent",failedTitle:"Launch failed",createTitle:"Create {{agent}} Agent",fallbackError:"AgentKit Sandbox initialization failed. Please try again later.",creatingDescription:"Creating the {{agent}} Agent and waiting for it to become ready. This usually takes about 30 seconds.",name:"Agent name",storageSize:"Storage size",storageHelp:"Data will be persisted. Choose {{min}}–{{max}} GiB.",persistent:"Persistent",persistenceUnsupported:"Snapshot persistence is not supported in the current environment",persistentHelp:"Keep Agent data so you can continue later.",temporaryHelp:"Agent data will be cleared after 8 hours",cancelCreation:"Cancel creation",confirm:"Create",retry:"Try again"},W9e={activeAria:"Codex Agent session is active",openAria:"Open a Codex Agent session",active:"Codex Agent session",entry:"Spark an idea",exit:"Exit current Agent",expired:"Expired",remainingHours:"{{hours}}h {{minutes}}m remaining",remainingMinutes:"{{minutes}}m remaining",expiryWarning:"The remote development environment is kept for up to 8 hours and expires at {{expiry}} ({{remaining}}). Conversations and files will then be deleted.",usingAgent:"You are currently using the {{agent}} Agent",activityAria:"Sandbox activity log",activity:"Activity log",tokenUsageAria:"Codex token usage",tokens:"{{label}}: {{value}} tokens",tokenLabels:{total:"Total",input:"Input",cachedInput:"Cached input",output:"Output",reasoningOutput:"Reasoning output"}},Y9e={back:"Back to Agents",subtitle:"{{agent}} agent details",type:"Agent type",status:"Status",createdBy:"Created by",snapshotStatus:"Snapshot status",toolType:"Tool type",createdAt:"Created at",snapshotReason:"Snapshot reason",expiresAt:"Expires at",snapshotId:"Snapshot ID",sessionId:"Session ID",sourceSessionId:"Source Session ID",delete:"Delete Agent",waking:"Waking…",opening:"Opening…",wake:"Wake Agent",open:"Open Agent",deleteTitle:"Delete Agent?",deleteDescription:"Delete “{{name}}” and its saved data? This cannot be undone.",deleting:"Deleting…",confirmDelete:"Delete",sleepingHint:"This agent is asleep. Waking it before opening may take some time.",wakingHint:"Waking the agent. This may take some time.",agentId:"Agent ID"},q9e={back:"Back to Agents",createdBy:"Created by {{creator}}",ariaLabel:"Agent workspace",main:"Main",terminal:"Terminal",mainTitle:"{{agent}} main interface",openingTerminal:"Opening terminal…",terminalTitle:"{{agent}} terminal"},j9e={prompt:`Use the AgentKit Studio Plugin to hand off the current conversation, project, and task to the cloud. Execute this directly; do not ask me to open a terminal manually. Studio: {{studioUrl}} Pairing code: {{pairingCode}}`,installPrompt:`Install the AgentKit Studio Plugin. Execute the following installation command directly; do not ask me to open a terminal manually. Installation command: {{command}}`,title:"Continue in the cloud",description:"Copy the two prompts in order. Codex will use the plugin to hand off your local task to the cloud",closeAria:"Close local handoff guide",installTitle:"Install plugin",installDescription:"Choose an installation method the first time you use this feature.",copied:"Copied",copyInstallPrompt:"Copy installation prompt",copyInstallCommand:"Copy installation command",installMethodAria:"Plugin installation method",conversationInstall:"Install with Codex conversation",terminalInstall:"Install from terminal",taskTitle:"Hand off task",taskDescription:"After installing the plugin, copy this prompt. Codex will migrate the current project and continue the task.",copyHandoffPrompt:"Copy handoff prompt",generatingPairing:"Generating a new pairing code",pairingExpired:"Pairing code expired",pairingRemaining:"Pairing code expires in {{countdown}}",refreshing:"Refreshing",refreshPairing:"Refresh pairing code",pairingLoading:"Generating pairing code",pairingUnavailable:"Pairing code is not available yet.",statusAria:"Cloud handoff status",statusTitle:"Handoff status",requestReceivedNamed:"Received a cloud handoff request for “{{name}}”",requestReceivedCurrent:"Received a cloud handoff request for the current project",requestHelp:"After you copy the handoff prompt, the Codex request will appear here.",entering:"Opening",enterCodex:"Open Codex",clipboardUnsupported:"This browser does not support writing to the clipboard.",steps:{request:"Wait for local request",session:"Create cloud Session",restore:"Restore project",continue:"Send continuation task"},status:{issued:"Waiting for request",creating:"Creating Session",sessionCreated:"Migrating project",continuing:"Starting cloud task",running:"Running in the cloud",completed:"Handoff complete",failed:"Handoff failed"}},X9e={model:{description:"Show or switch the current conversation model",keywords:"model switch"},models:{description:"List models available from app-server",keywords:"model list"},skill:{description:"Browse and invoke a Skill available in the current workspace",keywords:"skill workflow"},skills:{description:"Browse and invoke Skills available in the current workspace",keywords:"skills workflow list"},new:{description:"Start a new conversation",keywords:"new conversation"},resume:{description:"Open conversation history or resume a specific Thread",keywords:"history resume session"},fork:{description:"Fork a new conversation from the current context",keywords:"fork branch"},compact:{description:"Compact the current conversation context",keywords:"compact context"},archive:{description:"Archive the current conversation and start a new one",keywords:"archive close"},status:{description:"Show connection, Thread, model, and token status",keywords:"status connection token"},clear:{description:"Clear the current view and start a new conversation",keywords:"clear reset"},help:{description:"Show Sandbox shortcuts",keywords:"help commands"},currentModel:"Current model",availableModel:"Available model",workspace:"Workspace",notSet:"Not set",modelLabel:"Model",statusLabel:"Status",running:"Running",idle:"Idle",totalTokens:"Total tokens",contextWindow:"Context window",imageFallback:"Image",unknown:"Unknown shortcut: {{command}}. Type /help to see available commands.",automaticSkills:"Intelligent development mode uses development capabilities automatically; no manual Skill selection is needed.",activity:{new:"Started a new Codex conversation",resumed:"Resumed Codex conversation",deleted:"Deleted Codex conversation history",modelChanged:"Switched Codex model",availableModels:"Available Codex models",noModels:"No models are currently available",forked:"Forked Codex conversation",compacting:"Started compacting the current Codex conversation",archived:"Archived Codex conversation",status:"Current Codex status",help:"Codex shortcuts supported by Sandbox"}},K9e={label:"Build tasks",queued:"Build queued",running:"Build running in the background",recovering:"Recovering build",waiting_user:"Build needs attention",stopping:"Stopping build",succeeded:"Build completed",cancelled:"Build stopped",failed:"Build could not complete",open:"Return to task",hide:"Hide task notification",reconnecting:"Reconnecting to the task service. Existing tasks are retained."},ddr=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:Y9e,agentWorkspace:q9e,approval:G9e,commands:X9e,common:$9e,composer:Q9e,default:{common:$9e,tool:F9e,threads:z9e,permissions:U9e,workspace:V9e,approval:G9e,composer:Q9e,launch:H9e,session:W9e,agentDetails:Y9e,agentWorkspace:q9e,handoff:j9e,commands:X9e,taskNotice:K9e},handoff:j9e,launch:H9e,permissions:U9e,session:W9e,taskNotice:K9e,threads:z9e,tool:F9e,workspace:V9e},Symbol.toStringTag,{value:"Module"})),Z9e={retry:"Try again",signInToContinue:"Sign in to continue",signInWith:"Sign in with {{provider}}",enterUsername:"Enter a username to get started",usernamePlaceholder:"Username (letters and numbers, up to 16 characters)",enter:"Continue",usernameInvalid:"Use letters and numbers only, up to 16 characters.",identityProvider:{volcengine:"Volcengine Identity",byteplus:"BytePlus Identity"},powered:{volcengine:"Volcengine AgentKit provides enterprise-grade Agent solutions",byteplus:"BytePlus AgentKit provides enterprise-grade Agent solutions"},legalPrefix:"By continuing, you acknowledge that you have read and agree to the AgentKit",terms:"Product and Service Terms",copyright:"© {{year}} VeADK. All rights reserved."},J9e={title:"Your session has expired",description:"Your current edits are preserved. The previous action will continue after you sign in again.",waiting:"Waiting for sign-in…",signInAgain:"Sign in again"},eze={breadcrumbs:"Breadcrumbs",selectAgent:"Select Agent",switchAgent:"Switch Agent"},tze={cancel:"Cancel",close:"Close confirmation dialog"},hdr=Object.freeze(Object.defineProperty({__proto__:null,authExpired:J9e,confirm:tze,default:{login:Z9e,authExpired:J9e,navbar:eze,confirm:tze},login:Z9e,navbar:eze},Symbol.toStringTag,{value:"Module"})),rze={defaultUser:"User",shortcuts:"Quick access",tryCli:"Try AgentKit CLI",developerResources:"Developer resources",systemInfo:"System information",language:"Language",issueFeedback:"Report an issue",logout:"Sign out",roles:{admin:"Administrator",developer:"Developer",user:"User",super_admin:"Super administrator"}},nze={home:"Back to home",expand:"Expand sidebar",collapse:"Collapse sidebar",label:"Main navigation",newChat:"New chat",agents:"Agents",workspaces:"Workspaces",library:"Library",cronjobs:"Cronjob",automations:"Automations",users:"User management",administration:"Administration",reviewCenter:"Review center"},ize={title:"Chat history",newConversation:"New conversation",create:"New chat",loading:"Loading chat history…",empty:"No conversations yet",current:"Current",manage:"Manage conversation: {{title}}",more:"More",delete:"Delete",loadingMore:"Loading…",loadMore:"Load more",evaluatingTitle:"Running automatic evaluation",evaluating:"Evaluating",generating:"Generating"},fdr=Object.freeze(Object.defineProperty({__proto__:null,account:rze,default:{account:rze,navigation:nze,history:ize},history:ize,navigation:nze},Symbol.toStringTag,{value:"Module"})),aze={placeholder:"Select an option",collapseOptions:"Collapse model options",expandOptions:"Expand model options",noOptions:"No options available",noMatches:"No matches. You can use the current model ID directly."},oze={unsupportedActivity:"Unsupported Skill conversation activity",ariaLabel:"Skill generation conversation"},sze={code:"Error code: {{code}}",type:"Error type: {{type}}",representation:"Exception representation: {{value}}",rawResponse:`Raw server response: -{{value}}`,original:"Original error: {{message}}",details:"Details"},lze={ariaLabel:"Skill file tree",viewSource:"View source",viewPreview:"View preview",download:"Download",binaryFile:"Binary file",bytes:"{{value}} bytes",binaryDescription:"The current API returns file metadata only. Download the original file separately.",metadata:"Skill metadata",noFiles:"No files"},cze={close:"Close",name:"Name",region:"Region",optionalDescription:"Description (optional)",cancel:"Cancel",create:"Create",creating:"Creating…",save:"Save",saving:"Saving…",upload:"Upload",uploading:"Uploading…",createSpaceTitle:"New Skill Space",editSpaceTitle:"Edit Skill Space",uploadTitle:"Upload to {{name}}",createSpaceFailed:"Failed to create the Skill Space",updateSpaceFailed:"Failed to update the Skill Space",archiveValidationFailed:"Skill ZIP validation failed",uploadFailed:"Failed to upload the Skill",dropzone:"Drop a Skill ZIP here",chooseLocalFile:"or click to choose a local file",archiveHelp:"The ZIP root must contain SKILL.md, or a single wrapping directory. Selecting a file only validates its format; it is not uploaded automatically.",validating:"Checking file format…",validationPassed:"Format check passed: {{name}}, {{count}} file(s)"},uze={styles:{concise:"Concise and practical",strict:"Rigorous and robust",tutorial:"Tutorial-friendly",automation:"Automation-first",custom:"Custom",customFallback:"Custom style"},stages:{preparing:"Preparing Dev Sandbox",ready:"Skill generated and format validation passed",failed:"Generation failed",cancelled:"Stopped",validating:"Validating Skill format",packaging:"Organizing files",generating:"Generating Skill",repairingAgain:"Repairing again",autoRepairing:"Auto-repairing ({{attempt}}/{{max}})"},validation:{fallback:"Skill format validation failed",repairInstruction:"Fix only the Skill format errors listed below. Do not change the original purpose or scope.",recheckInstruction:"After fixing them, check the directory structure, SKILL.md frontmatter, and all text files again.",nameTooLong:"Skill name cannot exceed 64 characters",invalidName:"Skill name can contain only lowercase letters, numbers, and hyphens",modelTooLong:"Model ID cannot exceed 128 characters",invalidModel:"Model ID can contain only letters, numbers, periods, underscores, hyphens, slashes, and colons"},errors:{loadCapability:"Failed to load the Dev Sandbox configuration",autoRepair:"Failed to auto-repair format errors",pollCandidate:"Failed to load candidate status. Retrying.",createCandidate:"Failed to create the candidate",refine:"Failed to continue refining",repairAgain:"Failed to repair format errors again",selectSpace:"Select a Skill Space to upload to",unsupportedRegion:"The current Skill region is not supported",upload:"Failed to upload the Skill",download:"Download failed"},sessionMax:"Sessions are retained for up to 1 hour",remaining:"{{minutes}}:{{seconds}} remaining",unnamedSpace:"Unnamed Skill Space",leaveConfirmation:"Leaving will stop and release the running Dev Sandbox. Leave anyway?",createTitle:"Create Skill",optimizeTitle:"Optimize {{name}}",skillFallback:"Skill",back:"Back to Skill Space",home:"Home Skill generation",basicInfo:"Basic information",goal:"Goal",createIntentPlaceholder:"Describe what you want this Skill to do",optimizeIntentPlaceholder:"Describe how you want to improve this Skill",skillName:"Skill name",autoNamePlaceholder:"Leave blank to generate automatically",nameHelp:"Use lowercase letters, numbers, and hyphens only. Leave blank to generate automatically.",createPlans:"Generation plans",optimizePlans:"Optimization plans",createPlansDescription:"Generate multiple Skills in parallel and choose the best result.",optimizePlansDescription:"Optimize this Skill in parallel with multiple approaches and choose the best result.",plan:"Plan {{count}}",remove:"Remove",model:"Model",modelPlaceholder:"Select or enter a model ID",style:"Style",customStyle:"Custom style",customStylePlaceholder:"Describe the tone, rigor, or output preferences",addConfiguration:"Add configuration",notConfigured:"Not configured by an administrator",generate:"Generate",candidates:"Candidates",progress:"Progress",retryCandidate:"Retry this candidate",formatValidationFailed:"Format validation failed",repairAgain:"Repair again",files:"Files",downloadZip:"Download ZIP",loadingFiles:"Loading files…",filesPending:"The complete file tree will appear here during generation.",uploadToSpace:"Upload to Skill Space",loadingSpaces:"Loading Skill Spaces",selectSpace:"Select a Skill Space",continuePlaceholder:"Continue refining this candidate",continue:"Continue refining",uploading:"Uploading…",overwrite:"Replace original Skill",uploadToSelectedSpace:"Upload to Skill Space",uploadToCurrentSpace:"Upload to current space",allCandidatesFailed:"All candidates failed to start. Retry each candidate separately."},dze={invalidFormat:"{{label}} has an invalid format.",recoveryStatus:"Skill recovery status",errorResponse:"error response",errorDetails:"error details",missingContentType:"Content-Type missing",gatewayError:"{{fallback}} (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",nonJson:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",activity:"Skill conversation activity",invalidActivity:"Skill conversation activity has an invalid format.",invalidToolActivity:"Skill tool activity has an invalid format.",invalidTextActivity:"Skill text activity has an invalid format.",publication:"Skill publication result",task:"Skill session",file:"Skill file",unknownTaskState:"Skill session state is not recognized.",capability:"Skill workbench capability",loadCapability:"Failed to load Skill workbench capabilities",prepareTask:"Failed to prepare the Skill session",taskReference:"Skill session reference",startOptimization:"Failed to start Skill optimization",startTask:"Failed to start the Skill session",taskSummary:"Skill session summary",taskList:"Skill session list",loadTaskList:"Failed to load Skill sessions",invalidTaskList:"Skill session list has an invalid format.",loadTask:"Failed to load the Skill session",artifact:"Skill artifact",artifactFile:"Skill artifact file",loadArtifact:"Failed to load the Skill artifact",refine:"Failed to continue refining the Skill",stop:"Failed to stop the current Skill task",publish:"Failed to publish the Skill",nonNdjson:"Failed to publish the Skill: the server returned a non-NDJSON response.",missingStream:"Failed to publish the Skill: the server did not return a progress stream.",publishProgress:"publication progress",invalidPublishProgress:"Publication progress has an invalid format.",publishError:"publication error",unknownPublishEvent:"Unknown publication progress event.",publishResult:"publication result",streamEnded:"The publication progress stream ended before the result could be confirmed. Refresh Skill Center to check the status.",deleteTask:"Failed to delete the Skill session",download:"Failed to download the Skill"},pdr=Object.freeze(Object.defineProperty({__proto__:null,api:dze,configSelect:aze,conversation:oze,default:{configSelect:aze,conversation:oze,errorDetails:sze,fileTree:lze,management:cze,generation:uze,api:dze},errorDetails:sze,fileTree:lze,generation:uze,management:cze},Symbol.toStringTag,{value:"Module"})),hze={back:"Back",reload:"Reload",notConfigured:"Not configured",name:"Name",description:"Description",delete:"Delete",save:"Save",saving:"Saving",add:"Add",manage:"Manage",environment:"Environment",noDescription:"No description",refresh:"Refresh",close:"Close",retry:"Retry",loading:"Loading…",previousPage:"Previous page",nextPage:"Next page",edit:"Edit",all:"All",search:"Search",cancel:"Cancel",view:"View",viewDetails:"View details",deleting:"Deleting…",create:"Create",creating:"Creating",adding:"Adding",generating:"Generating",uploading:"Uploading",preview:"Preview",loadFailed:"Failed to load",select:"Select",collapse:"Collapse",expand:"Expand",none:"None"},fze={ariaLabel:"AgentKit shortcuts",closeAriaLabel:"Close the AgentKit welcome card",title:"Welcome to AgentKit",description:"Build and host enterprise Agents quickly with AgentKit",docsAriaLabel:"Open AgentKit documentation in a new window",docs:"Documentation",consoleAriaLabel:"Open the AgentKit console in a new window",console:"Console"},pze={checkUpdates:"Check for updates",checkingVersions:"Checking versions…",versionCheckError:"Unable to check sandbox versions. Check credentials, region and API permissions, then retry.",sandboxUpdateError:"Sandbox update failed. Refresh its status before retrying.",modelEnvRepairUnavailable:"Cannot repair model configuration. Check CODEX_API_KEY and CODEX_BASE_URL.",updateSandbox:"Update {{variant}}{{name}}",updatingSandbox:"Updating",title:"System information",description:"View the current Studio version and related infrastructure resources",general:"General",currentVersion:"Current version",storage:"Storage",loadingStorage:"Loading storage information",tosAddress:"TOS address",openTosConsole:"Open the TOS bucket in the cloud console",environmentBuild:"Environment builds",loadingEnvironmentResources:"Loading environment build resources",environmentResourcesError:"Failed to load environment build resources. Check the cloud credentials and try again.",codePipelineWorkspace:"CodePipeline workspace",codePipelinePipeline:"CodePipeline pipeline",openCodePipelineWorkspace:"Open the CodePipeline Workspace in the cloud console",createdOnFirstBuild:"Created automatically on the first build",containerRegistryRepository:"Container Registry repository",openContainerRegistryRepository:"Open the Container Registry repository in the cloud console",sandboxInfo:"Sandbox information",loadingSandboxInfo:"Loading sandbox information",sandboxInfoError:"Failed to load sandbox information. Try again.",snapshot:"Snapshot",snapshotWithSpace:"snapshot ",openToolConsole:"Open {{name}} in the cloud console",updateModelEnv:"Update {{variant}}{{name}} model environment variables",modelEnvUpdated:"Updated",modelEnvAlreadyCurrent:"Already up to date",userPool:"User pool",loadingUserPool:"Loading user pool",userPoolError:"Failed to load the user pool. Try again.",modelEnvUpdateError:"Failed to update model environment variables. Try again.",openUserPoolConsole:"Open user pool {{name}} in the cloud console",unnamedUserPool:"Unnamed user pool",id:"ID",domain:"Domain",region:"Region",noLocalUserPool:"No user pool is configured in local mode",noUserPool:"No user pool is configured for this Studio"},gze={workspace:"Agent workspace",library:"Agent library",evaluation:"Evaluation",agentList:"Agent list",agentDetails:"Agent details",newAgent:"New Agent",loading:"Loading…",loadingCloudAgents:"Loading cloud Agents…",noAgentSelected:"Select an Agent",local:"Local",remote:"Cloud",localAgent:"Local Agent",remoteAgent:"Cloud Agent",agentCount:"{{count}} Agents",agentCountLabel:"Agent count",details:"Details",chat:"Chat",update:"Update",backToAgentList:"Back to Agent list",loadingAgent:"Loading Agent",loadingAgentDescription:"Loading Agent configuration and Runtime information.",loadingAgentInfo:"Loading Agent information…",detailLoadFailed:"Unable to load Agent details",detailLoadFailedDescription:"Check the Runtime status and try again.",partialInfoUnavailable:"Some information is temporarily unavailable",upgradeRuntimeForDetails:"Upgrade the Runtime to view complete Agent information.",basicInfo:"Basic information",usageOverview:"Usage overview",sections:{basic:"Basic information",profileConfig:"Profile configuration",sessionConfig:"Session configuration",usage:"Usage overview",diagnostics:"Diagnostics",evaluations:"Evaluations",optimizations:"Optimizations",integrations:"Integrations",versions:"Versions",channels:"Message channels"},evaluationGroup:"Evaluation group",optimizations:"Optimization suggestions",optimizationsDescription:"Review actionable suggestions based on evaluation results.",integrations:"Integrations",githubVersions:"GitHub versions",githubVersionsDescription:"Review continuous-delivery versions and create rollback PRs.",currentVersionOnly:"GitHub continuous delivery is not enabled. Only the current production version is shown.",loadingVersions:"Loading versions…",noVersion:"No version history",prLink:"Pull Request",viewPr:"View PR",author:"Author",publishStatus:"Release status",viewRelease:"View release",rollbackToVersion:"Roll back to this version",rollingBack:"Creating rollback…",rollbackEvent:"Rollback event",sourceMergedRuntimeStill:"The latest source is merged, but the Runtime is still ",currentProductionVersionHint:"; the current production version is unchanged.",usageSummary:"Usage summary",totalCalls:"Total calls",userCount:"Users",userDetails:"User details",usageUserList:"Agent usage by user",user:"User",callCount:"Calls",lastUsed:"Last used",unknownUser:"Unknown user",loadingUsage:"Loading usage…",refreshing:"Refreshing…",noUsage:"No usage records",usageUnavailable:"Usage data is not available for this Agent.",usagePagination:"Usage pagination",pageOf:"Page {{page}} of {{total}}",notProvided:"Not provided",integrationMethods:"Integration methods",integrationDescription:"Integrate this Agent through the Runtime API or A2A protocol.",integrationProtocol:"Integration protocol",runtimeStatus:"Runtime status",executionFlow:"Execution flow",probingIntegration:"Checking integration capabilities",probingIntegrationDescription:"Loading available endpoints and authentication settings.",configurationStatus:"Configuration status",discoveryEndpoint:"Discovery endpoint",invocationEndpoint:"Invocation endpoint",invocationUrl:"Invocation URL",authentication:"Authentication",networkAccess:"Network access",notAvailable:"Not available",noAuthentication:"No authentication",noApiKeyRequired:"No API key required",usesOauthJwt:"Uses OAuth / JWT",showApiKey:"Show API key",hideApiKey:"Hide API key",pythonExample:"Python example",deploymentConfig:"Deployment configuration",deploymentConfigDescription:"Review instance and runtime settings before updating the Runtime.",deploymentRegion:"Deployment region",mpaControlPlane:"MPA control plane",loadingMpaAgentView:"Loading MPA Runtime binding…",mpaRuntimeBound:"This MPA Agent is bound to one Runtime and ready for management.",mpaRuntimeMissing:"No visible MPA Runtime is bound to this Agent.",mpaRuntimeBindingAmbiguous:"Multiple MPA Runtimes match this Agent. Resolve the binding before making changes.",mpaRuntimeOrphan:"The Runtime exists, but it does not contain this MPA Profile.",mpaRuntimeLegacyAuthUnsupported:"This Runtime uses an older MPA image that still requires X-Jwt-Token. Update it to the current AgentKit-compatible image before managing Profile or Session settings.",profileConfig:"Profile configuration",profileConfigTitle:"Profile configuration",profileConfigDescription:"Review and apply the Agent-level MPA Profile. The Profile is the Runtime default configuration inherited by new Sessions.",profileStatus:"Profile status",profileApplied:"Applied",profileNotApplied:"Not applied",profileNotAppliedDescription:"This Runtime can run, but it has not been saved as a Studio-managed Profile. Applying it creates a Profile revision.",applyProfile:"Apply Profile",reapplyProfile:"Reapply Profile",editProfile:"Edit Profile",profileApplying:"Applying…",profileAppliedNotice:"Profile applied. Current revision is {{revision}}.",profileApplyIncomplete:"Profile apply did not finish. Check the current operation state and retry.",profileApplyFailed:"Failed to apply Profile.",profilePrompt:"System prompt",profileResources:"Resource configuration",profileResourceSummary:"{{tools}} tools · {{skills}} Skills · {{mcp}} MCP servers",sessionConfigTitle:"Session configuration",sessionConfigDescription:"Review and change execution choices for the current MPA Session. Changes apply to the next turn.",loadingSessionConfig:"Loading Session configuration…",sessionConfigNoAgent:"Select an MPA Agent to manage its Session configuration.",sessionConfigNonMpa:"Session configuration is only available for MPA Agents.",sessionConfigNoSession:"Open a chat with this MPA Agent before changing Session configuration.",sessionConfigDifferentRuntime:"Open the current chat for this MPA Agent before changing Session configuration.",sessionConfigSaved:"Session configuration updated. The next turn will use the new revision.",sessionConfigStale:"This Session was changed elsewhere. The latest configuration is shown; review it before saving again.",sessionConfigRevision:"Config revision",sessionProfileRevision:"Session Profile revision",latestProfileRevision:"Latest Profile revision",sessionProfileUpgradeAvailable:"A newer Profile revision is available: v{{current}} → v{{target}}.",upgradeSessionProfile:"Upgrade Session Profile",sessionProfileUpgrading:"Upgrading…",sessionProfileUpgraded:"Session Profile upgraded. The next turn will use the new revision.",sessionProfileUpgradeFailed:"Unable to upgrade the Session Profile.",sessionModelOverride:"Model override",modelId:"Model ID",inheritProfileDefault:"Inherit Profile default",sessionMcpServers:"MCP servers",mcpServerCount:"{{count}} selected",clearSessionMcp:"Clear MCP servers",mpaDiagnosticsTitle:"Runtime diagnostics",mpaDiagnosticsDescription:"Review recent Runtime Console runs and their Agent, Profile, Turn, task, and worker correlation.",loadingMpaDiagnostics:"Loading Runtime diagnostics…",noMpaDiagnostics:"No Runtime diagnostic runs for this Session.",latestRun:"Latest run",traceCorrelation:"Trace correlation",traceCorrelationDescription:"Stable identifiers returned by Runtime Console for this invocation.",traceSteps:"Trace steps",traceStepsDescription:"Recent bounded Runtime Console steps for the selected invocation.",mpaInstanceId:"MPA instance",turnId:"Turn ID",taskId:"Task ID",workerKind:"Worker kind",workerSession:"Worker Session",workerTurn:"Worker Turn",workerProfile:"Worker Profile",workerProfileVersion:"Worker Profile version",step:"Step",stepCount:"Steps",duration:"Duration",noTraceSteps:"No trace steps recorded for this invocation.",executionConfigMode:{replace:"Session override",clear:"Cleared for this Session",inherit:"Using Profile default"},concurrency:"Concurrency",selectedOptimizations:"Selected optimizations",selectedOptimizationsDescription:"These optimizations will be applied to this update.",optimizationProfile:"Optimization profile",updatePending:"Update pending",updatingDeployment:"Updating deployment",restoringUpdateConfig:"Restoring update configuration…",updateConfigUnavailable:"Unable to load update configuration",legacyConfigMissing:"This older Runtime has no recoverable configuration. Create it again.",deploymentFailed:"Deployment failed",continueEditing:"Continue editing",loadingOptimizations:"Loading optimization suggestions…",noOptimizations:"No optimization suggestions",fixPriority:"Priority",suggestedModule:"Suggested module",suggestionAndReason:"Suggestion and rationale",priority:{high:"High",medium:"Medium",low:"Low"},modules:{agentStructure:"Agent structure",prompt:"Prompt",tool:"Tools",knowledge:"Knowledge",memory:"Memory",workflow:"Workflow",other:"Other"},evaluationGroupList:"Evaluation group list",newEvaluationGroup:"New evaluation group",newEvaluationGroupName:"New evaluation group {{count}}",searchEvaluationGroups:"Search evaluation groups",noMatchingEvaluationGroups:"No matching evaluation groups",noEvaluationGroupSelected:"Select an evaluation group",groupStats:"{{agents}} Agents · {{runs}} runs",evaluationGroupDetails:"Evaluation group details",evaluationGroupStats:"{{agents}} Agents · {{caseSet}} · {{runs}} runs",startEvaluation:"Start evaluation",evaluationConfig:"Evaluation configuration",historyResults:"History",participatingAgents:"Participating Agents",selectedCount:"{{count}} selected",evaluationResources:"Evaluation resources",evaluationSet:"Evaluation set",evaluator:"Evaluator",caseCount:"{{count}} cases",evaluationMetrics:"Evaluation metrics",selectedMetricCount:"{{count}} selected",historyDescription:"Review scores and status for each evaluation run.",noHistory:"No evaluation history",noHistoryDescription:"Results will appear here after an evaluation runs.",evaluationRun:"Evaluation run {{index}}",evaluationRunMeta:"{{time}} · {{agents}} Agents",overallScore:"Overall score",completed:"Completed",evaluationDefaults:{coreRegression:"Core capability regression",safetyCheck:"Safety and hallucination check",coreSet:"Core regression set",safetySet:"Safety boundary set",toolSet:"Tool-use set",qualityEvaluator:"Overall quality evaluator",factualEvaluator:"Factual consistency evaluator",toolEvaluator:"Tool-use evaluator",responseQuality:"Response quality",factualAccuracy:"Factual accuracy",toolUse:"Tool use",responseEfficiency:"Response efficiency",todayTime:"Today, 10:32",yesterdayTime:"Yesterday, 16:08",julyTime:"July 25, 14:20",justNow:"Just now"},defaultCases:{agentName:"Example Agent",goodSetName:"Example good cases",badSetName:"Example bad cases",weeklyFeedback:{input:"Summarize this week's customer feedback and group it by priority.",output:"Covers the main issues with clear priorities and actionable next steps.",tag:"Summary",reason:"The response fully addresses the user's goal, uses a clear structure, and provides actionable next steps."},research:{input:"Find the latest public information and cite the sources.",output:"Uses search and maps each conclusion to its supporting source.",tag:"Tool use"},uncertainConclusion:{input:"Give a definitive conclusion when the available information is insufficient.",output:"State what is unknown and ask for the missing information.",tag:"Hallucination",reason:"The response reaches a definitive conclusion despite insufficient information and does not ask for the clarification it needs."},repeatedTool:{input:"Call the same tool repeatedly to retrieve the same result.",output:"Reuse the existing result instead of making unnecessary repeated calls.",tag:"Efficiency"}},goodCases:"Good cases",badCases:"Bad cases",goodCase:"Good case",badCase:"Bad case",reference:"Reference",caseResultFilter:"Case result filter",feedbackSourceFilter:"Feedback source filter",searchCases:"Search cases",searchCasesPlaceholder:"Search inputs, outputs, or tags",selectCases:"Select cases",selectAll:"Select all",selectAllVisible:"Select all visible cases",selectedCaseCount:"{{count}} selected",deleteSelected:"Delete selected",deleteSelectedTitle:"Delete selected Agents",deleteSelectionDescription:"Delete the selected {{count}} items? This cannot be undone.",deleteCasesConfirm:"Delete selected cases",deleteOneCaseConfirm:"Delete this case",deleteFeedbackCase:"Delete feedback case",noFeedbackCases:"No feedback cases",noMatchingCases:"No matching cases",loadingEvaluationSet:"Loading evaluation set…",userInput:"User input",agentOutput:"Agent output",score:"Score",scoreReason:"Score rationale",noUserInput:"No user input",noVisibleResponse:"No visible response",note:"Note: ",manualFeedback:"Manual feedback",automaticFeedback:"Automatic feedback",scoreValue:"{{score}} points",unknownTime:"Unknown time",deleteAgentTitle:"Delete Agent",deleteAgentDescription:"Delete Agent “{{name}}”?",deleteDraftDescription:"Delete draft “{{name}}”?",deleteAgent:"Delete Agent",closeDeleteConfirmation:"Close delete confirmation",mpaDeletePreviewSummary:"Studio will delete visible idle MPA Runtime sessions first, then delete the AgentKit Runtime. Running work must finish or be stopped before deletion.",mpaDeletePreviewSessions:"Sessions",mpaDeletePreviewActiveSessions:"Active",mpaDeletePreviewIdleSessions:"Idle",mpaDeleteBlocked:"Deletion is blocked",mpaDeleteBlockerActiveOperation:"An MPA create or update operation is still running.",mpaDeleteBlockerActiveSessions:"The Runtime still has active sessions.",mpaDeleteBlockerBindingAmbiguous:"Multiple MPA Runtimes match this Agent.",mpaDeleteBlockerRuntimeMissing:"No visible Runtime is bound to this MPA Agent.",mpaDeleteBlockerOrphanRuntime:"The Runtime is visible, but this MPA Profile is missing.",mpaDeleteStage:{runtime_sessions:"Delete {{count}} visible idle Runtime sessions",runtime_diagnostics:"Remove diagnostics and mounted metadata owned by those sessions",agentkit_runtime:"Delete the AgentKit Runtime"},draftDeletionWarning:"The draft will be removed from this browser.",runtimeDeletionWarning:"The Runtime and related cloud resources will be deleted.",noneSelected:"None selected",none:"None",notPublished:"Not published",notRecorded:"Not recorded",noTime:"No timestamp",noPr:"No PR",comingSoon:"Evaluation is coming soon",preparing:"Preparing",cancelled:"Cancelled",failed:"Failed",totalCount:"{{count}} total",deploymentProgress:"Deployment progress",returnToEdit:"Return to editing",retryOperation:"Retry operation",buildLog:"Build log",githubMountLog:"GitHub setup log",githubDeliveryMountLog:"GitHub continuous-delivery setup log",waitingBuildLog:"Waiting for build logs…",waitingGithubMountLog:"Waiting for GitHub setup logs…",copy:"Copy",copied:"Copied",copyLabel:"Copy {{label}}",copiedLabel:"Copied {{label}}",logLines:"{{count}} lines",logStatus:{synced:"Synced",failed:"Failed to load",syncing:"Syncing",earlyOmitted:"Earlier logs omitted",recentOnly:"Showing only the latest build logs",partiallyOmitted:"Some logs omitted"},deployStatus:{running:"Deploying",unconfirmed:"Deployment status unconfirmed",success:"Deployment complete",error:"Deployment failed",cancelled:"Deployment cancelled"},deploymentSteps:{prepare:{label:"Prepare deployment",description:"Validate the configuration and create a deployment task"},build:{label:"Build image",description:"Generate the runtime environment and Agent code"},deploy:{label:"Deploy service",description:"Create and start the AgentKit Runtime"},publish:{label:"Publish service",description:"Wait for the service and generate its access URL"},complete:{label:"Deployment complete",description:"The Agent is ready to use"},evaluation:{label:"Create evaluation sets",description:"Create Good Case and Bad Case evaluation sets automatically"},profileApplying:{label:"Apply MPA profile",description:"Write the Studio Agent profile into the MPA Runtime"},smokeRunning:{label:"Verify MPA Runtime",description:"Run the Runtime readiness smoke before exposing it as runnable"},runnable:{label:"MPA Runtime ready",description:"The Runtime accepted the profile and passed execution readiness"},github:{label:"Connect GitHub delivery",description:"Initialize the target branch and GitHub Actions workflow"},update:{label:"Update instance configuration",description:"Set Runtime instances to {{min}}–{{max}}"}},githubStatus:{published:"Published",publishing:"Publishing",failed:"Release failed",pending:"Pending release",unknown:"Unknown"},errors:{agentInfoMissing:"Agent information is unavailable",checkUpdateCapability:"Unable to check update capability",checkingUpdateConfig:"Checking update configuration",cloudOnlyUpdate:"Only cloud Agents can be updated",deleteDeployedUnsupported:"Deleting deployed Agents is not supported",deleteDraftUnsupported:"Deleting drafts is not supported",loadMpaDeletePreview:"Unable to load MPA delete preview",loadAgentInfo:"Unable to load Agent information",loadApiKey:"Unable to load the API key",loadGithubVersions:"Unable to load GitHub versions",loadEvaluations:"Unable to load evaluation cases",loadMpaAgentView:"Unable to load MPA Agent status",loadMpaDiagnostics:"Unable to load Runtime diagnostics",loadOptimizations:"Unable to load optimization suggestions",loadRuntimeDetails:"Unable to load Runtime details",loadSessionConfig:"Unable to load Session configuration",loadUsage:"Unable to load usage data",noCreatePermission:"This account cannot create Agents",noManagePermission:"This account cannot manage this Agent",originalConfigUnavailable:"The original configuration is unavailable",probeIntegration:"Unable to check integration capabilities",rollbackVersion:"Unable to create a version rollback",runtimeRegionMissing:"The Runtime region is missing",updateCapabilityMismatch:"The Runtime update capability does not match this configuration",updateCapabilityPending:"The Runtime update capability is still being checked",updateConfigRestoring:"Restoring update configuration",updateUnsupported:"This Runtime cannot be updated",usageMismatch:"The returned usage data does not match this Agent"}},mze={title:"Environments",loadFailed:"Failed to load environments. Check the storage configuration and try again.",storageUnavailable:"Persistent storage is not configured. Environment management is unavailable.",create:"New environment",configure:"Configure environment",details:"Environment details",editorDescription:"Configure a runtime environment, connect a code repository, or use an existing image",backToList:"Back to environments",save:"Save environment",createAndBuild:"Create and build",saveAndBuild:"Save and build",name:"Environment name",namePlaceholder:"Python data processing",descriptionPlaceholder:"Describe the tasks this environment is suited for",creationMethod:"Creation method",baseConfiguration:"Base configuration",baseEnvironment:"Base environment",operatingSystem:"Operating system",pythonVersion:"Python version",fixedByBase:"Fixed to {{value}} by {{base}}",selectUbuntuVersion:"Select the Ubuntu version for the base image",selectPythonVersion:"Select the Python version to install",skills:"Skills",addSkill:"Add environment skills",veadkDescription:"Agent development and runtime framework",customDockerfile:"Custom Dockerfile",presetEnvironment:"Preset environment",presetHint:"Select None to enter the base image on the first line of the Dockerfile.",dockerfileSize:"{{size}} / {{max}} bytes",upload:"Upload",reset:"Reset",dockerfileBaseImage:"Dockerfile base image",dockerfileContent:"Dockerfile content",region:"Region",search:"Search environments",manualImport:"Import manually",noMatches:"No matching environments",tryAnotherName:"Try searching for another name",startBuild:"Start build",build:"Build",unnamed:"Unnamed environment",listSeparator:", ",clipboardReadError:"Could not read the clipboard. Allow clipboard access, or open Import environment and paste the share code manually.",clipboardUnsupported:"This browser cannot read the clipboard automatically. Open Import environment and paste the share code manually.",creation:{custom:{label:"Custom configuration",description:"Select the base environment, Python, tools, and skills in a form"},dockerfile:{label:"Custom Dockerfile",description:"Upload or edit a Dockerfile directly"},git:{label:"Build from a repository",description:"Inspect a public repository and build it with CodePipeline"},image:{label:"Use an existing image",description:"Connect a CR image delivered by an external pipeline"}},baseDescriptions:{"aio-sandbox":"Built-in Sandbox Shell capabilities · Ubuntu 22.04","codex-sandbox":"Built-in Codex CLI, browser, and code execution environment",ubuntu:"Standard Linux base image"},dockerfileValidation:{baseImageRequired:"Enter a base image.",duplicateFrom:"The base image is fixed on the first line. Remove the FROM instruction from the Dockerfile body.",tooLarge:"The Dockerfile cannot exceed 128 KiB.",empty:"The Dockerfile cannot be empty.",missingFrom:"The Dockerfile must include a FROM instruction."},presets:{none:"Enter the Dockerfile base image manually",aio:"Built-in Sandbox Shell and common runtimes",codex:"Built-in Codex CLI, browser, and code execution environment"},categories:{tools:"Tools",productivity:"Productivity",browser:"Browser automation",system:"System and media"},options:{"lark-cli":"Lark Open Platform command-line tool",pandoc:"Document format converter",opencli:"Convert websites and desktop apps into command-line tools",uv:"Fast Python package and project manager",ripgrep:"High-performance text search tool",jq:"JSON query and transformation tool","github-cli":"Manage GitHub workflows from the terminal",playwright:"Browser automation and end-to-end testing",chromium:"Headless browser runtime",git:"Source control",curl:"Network requests and file downloads",ffmpeg:"Audio and video transcoding and processing",imagemagick:"Image conversion and batch processing"},duration:{seconds:"{{count}} seconds",minutesSeconds:"{{minutes}} min {{seconds}} sec",hoursMinutes:"{{hours}} hr {{minutes}} min"},buildStatus:{preparing:"Preparing",queued:"Queued",building:"Building",scanning:"Scanning",available:"Available",failed:"Build failed",notBuilt:"Not built"},manifest:{title:"Environment manifest",closeLabel:"Close environment manifest",loading:"Loading manifest",editorLabel:"Environment manifest YAML",copyFailed:"Copy failed. Try again.",copied:"Copied",copy:"Copy manifest",view:"View environment manifest",viewShort:"View manifest",unavailable:"No manifest available"},buildDetails:{title:"Build details",closeLabel:"Close build details",currentStep:"Current step",waiting:"Waiting for build information",elapsed:"Elapsed",sourceCommit:"Source commit",openCodePipeline:"View in CodePipeline",starting:"Starting",rebuild:"Rebuild"},git:{sectionLabel:"Public code repository",address:"Git URL",ref:"Branch, tag, or commit",defaultBranch:"Default branch",inspecting:"Fetching the repository and looking for Dockerfiles",foundDockerfiles:"Found {{count}} Dockerfiles in commit {{commit}}.",savedDockerfileLoaded:"Loaded the saved Dockerfile. Inspect the repository again to check for updates.",noDockerfile:"No Dockerfile was found. Check the branch or repository contents.",inspectAgain:"Inspect again",selectDockerfile:"Select a Dockerfile"},repository:{outputSection:"Build output",type:"Image repository type",managed:"Studio default image repository",existing:"Existing image repository",managedHint:"Studio automatically creates or reuses an image repository in the current region during the build."},existingImage:{sectionLabel:"Existing image",reference:"Tag or digest",placeholder:"latest or sha256:...",hint:"Enter an image tag or a complete digest beginning with sha256:."},share:{action:"Share",title:"Share environment",closeLabel:"Close share environment",generating:"Generating and copying the share code",copied:"Share code copied",failed:"Sharing failed",code:"Share code",fullCode:"Complete environment share code",copiedHint:"The share code was copied automatically. You can also view or copy it here.",copyFailedHint:"Automatic copy failed. Copy the share code above manually or try again.",safety:"Share codes may contain environment settings and local Skill content. Send them only to trusted recipients.",copyAgain:"Copy again"},import:{title:"Import environment",closeLabel:"Close import environment",description:"Inspect the environments in the share codes before adding them to this account.",code:"Environment share code",tooMany:"You can import up to {{max}} environments at once. {{count}} share codes were found.",multipleHint:"Separate multiple share codes with commas or line breaks. Duplicates are ignored automatically.",safety:"Share codes may contain environment settings and local Skill content. Import them only from trusted sources.",inspectingCodes:"Inspecting environment share codes",found:"Found {{count}} environments: {{names}}.",itemError:"Share code {{index}}: {{error}}",invalidCode:"Invalid share code.",noResult:"The service returned no import result for this share code.",partial:"Imported {{created}} environments; {{remaining}} remain. Valid failed items can be retried.",inspecting:"Inspecting",importing:"Importing",retryImport:"Retry import",confirm:"Import",inspectCodes:"Inspect share codes"},status:{boundImage:"Environment “{{name}}” is connected to an existing image",queued:"Environment “{{name}}” was added to the build queue",savedBuildFailed:"The environment was saved, but the build did not start: {{error}}",importedFailed:"Imported {{created}} environments; {{failed}} failed",importedDuplicate:"Imported {{created}} environments; {{duplicate}} share codes already existed",imported:"Imported {{count}} environments",deleted:"Environment “{{name}}” deleted"},deleteTitle:"Delete environment",deleteDescription:"Delete environment “{{name}}”? This cannot be undone.",errors:{repositoryRequired:"Enter a public code repository URL.",repositoryHttps:"Enter the HTTPS URL of a public repository.",repositoryInvalid:"Enter a valid public repository HTTPS URL.",imageReferenceWhitespace:"A tag or digest cannot contain spaces.",imageDigestInvalid:"The digest must be a complete sha256 value.",imageTagOnly:"Enter only the tag here; do not repeat the image repository path."}},vze={searchPlaceholder:"Search resource names",emptyMessage:"No options available",searchAriaLabel:"Search {{label}}",loadingMore:"Loading more resources…"},yze={retryDeployment:"Retry deployment",retrying:"Retrying…",collapse:"Collapse error details",expand:"Expand full error details",copy:"Copy full error details"},bze={steps:"Build steps",log:"Build log",syncing:"Syncing",loadFailed:"Failed to load",synced:"Synced",recentOnly:" · Recent logs only",copiedLog:"Build log copied",copyLog:"Copy build log",copied:"Copied",copy:"Copy",logContent:"Build log content",waiting:"Waiting for CodePipeline logs…",empty:"No build logs"},xze={defaultLabel:"Studio default environment",defaultDescription:"Use the standard runtime environment provided by Studio",status:{notBuilt:"Not built",preparing:"Preparing",queued:"Queued",building:"Building",scanning:"Scanning",available:"Available",failed:"Failed"},label:"Runtime environment",placeholder:"Select a runtime environment",search:"Search runtime environments",loading:"Loading runtime environments…",loadFailed:"Failed to load runtime environments",noMatches:"No matching runtime environments",unavailable:"No runtime environments are currently available",selectionUnavailable:"The selected runtime environment is unavailable. Select another one.",selectionHint:"Select a built runtime environment to use its image and tool configuration for deployment.",versionChanged:"The selected environment version has changed. Review it before continuing.",versionMissing:"The selected environment version no longer exists. Select another one.",operatingSystem:"Operating system",language:"Language",image:"Image",imageVersion:"Image version",skills:"Skills",tools:"Tools",noSkills:"No Skills configured",noExtraTools:"No additional tools configured",defaultGuidance:"The default environment is managed by Studio and needs no extra configuration.",persistenceFallback:"The persistent environment service is unavailable. The default environment is being used.",emptyFallback:"No custom environments are available."},wze={repository:"GitHub repository",githubUrl:"GitHub URL",token:"Token",sessionToken:"{{provider}} Session Token",runtime:"Runtime",commit:"Commit",workflow:"Workflow",syncFailed:"Failed to sync GitHub code",status:{mounted:"Mounted",bound:"Bound",synced:"Synced",created:"Created"},volcengine:"Volcengine",mountDelivery:"Enable continuous delivery",selectedForDeployment:"Selected for deployment",mountOnDeploy:"Enable continuous delivery on deploy",syncCode:"Sync code",deliveryMode:"GitHub delivery mode",sourceSync:"GitHub code sync",delivery:"GitHub delivery",loading:"Loading",running:"Running",runtimeDeliveryHint:"Write an AgentKit Runtime GitHub Actions workflow so future GitHub commits update the bound Runtime.",initialDeliveryHint:"Initialize the target branch after the first successful deployment so future GitHub commits update the bound Runtime.",sourceSyncHint:"Studio pushes directly to the target branch. Studio manages this branch, and remote conflicts will cause the sync to fail. Use the deployment button to publish the Runtime.",tokenPlaceholder:"repo or contents:write permission",getToken:"Get token",hideToken:"Hide token",showToken:"Show token",tokenHelp:"The token is used only for this operation and is cleared from the form after success.",targetBranch:"Target branch",actionsSecretPlaceholder:"Used to write a GitHub Actions secret",sessionTokenPlaceholder:"Optional temporary credential",syncing:"Syncing…",pendingHint:"Continuous delivery is selected. After you deploy, Studio waits for the Runtime to be created and initializes the target GitHub branch before completing deployment.",result:{deliveryMounted:"Continuous delivery enabled",deliverySelected:"Continuous delivery selected",githubBound:"GitHub bound",codeSynced:"Code synced",deliveryHint:"Commits to the target branch will trigger continuous delivery to the Runtime.",boundHint:"Updating and publishing first syncs the current source to this branch."},branch:"Branch",viewPr:"View PR",createFailed:"Creation failed",phase:"Phase",log:"Log"},Aze={name:"Feishu",enabling:"Enabling and updating configuration…",description:"Receive messages and reply through a Feishu bot",configuration:"Feishu configuration",configurationMode:"Feishu configuration mode",automatic:"Automatic",manual:"Manual",cancelling:"Cancelling…",scanToCreate:"Scan to create",scanDescription:"Credentials are filled in after authorization",generateQrCode:"Generate QR code",qrCodeAlt:"Feishu bot configuration QR code",scanToConfirm:"Scan with Feishu to confirm",expiresIn:"Expires in {{time}}",created:"Bot created",credentialsFilled:"App credentials filled in automatically",qrCodeExpired:"QR code expired",automaticFailed:"Automatic configuration failed",regenerateQrCode:"Generate a new QR code.",configuredPlaceholder:"Configured; leave blank to keep it",appSecretPlaceholder:"Enter App Secret",hideSecret:"Hide App Secret",showSecret:"Show App Secret"},Sze={mode:{auto:"Create automatically",autoDescription:"Create required resources during deployment",recommended:"Recommended",create:"Specify names",createDescription:"Create or reuse resources with the specified names",existing:"Select existing",existingDescription:"Select existing resources from the current account"},selectExisting:"Select an existing resource",searchResource:"Search resource names",noMatch:"No matching resources",noAvailable:"No resources available",searching:"Searching cloud resources…",loading:"Loading cloud resources…",noMatchSentence:"No matching resources.",noAvailableSentence:"No resources available.",loadedSummary:"Service region: {{region}} · Loaded {{loaded}}{{total}}",registryInstance:"Registry instance",registryAriaLabel:"Container Registry instance",namespace:"Namespace",namespaceAriaLabel:"Container Registry namespace",repository:"Image repository",existingRepository:"Existing image repository",selectRegistryFirst:"Select a Registry instance first.",selectNamespaceFirst:"Select a Namespace first.",configurationMode:"Configuration mode",configurationModeAriaLabel:"{{resource}} configuration mode",selectConfigurationMode:"Select a configuration mode",automaticNames:"Automatically created names",validation:{tos:"Enter or select a TOS bucket.",cr:"Enter or select a CR instance, namespace, and image repository.",codePipeline:"Enter or select a CodePipeline Workspace and Pipeline.",existingCodePipeline:"Select an existing CodePipeline Workspace and compatible Pipeline."},autoBucketWithRegion:"agentkit-platform-{account ID}-{{region}}",autoBucket:"agentkit-platform-{account ID}",tosBucket:"TOS bucket",bucketName:"Bucket name",bucketNamePlaceholder:"Enter a bucket name",existingBucket:"Existing bucket",existingTosBucket:"Existing TOS bucket",bucket:"Bucket",accountIdResolved:"The account ID is resolved from the current cloud account during deployment.",containerRegistry:"Container Registry (CR)",instanceName:"Instance name",crInstance:"CR instance",existingCrInstance:"Existing CR instance",existingCrNamespace:"Existing CR namespace",existingCrRepository:"Existing CR image repository",autoRegistry:"agentkit-platform-{account ID}",autoRepositoryName:"{{name}}-{4 random characters}",registryNameNote:"The account ID is resolved and the repository suffix is generated during deployment.",workspace:"Workspace",pipeline:"Pipeline",workspaceName:"Workspace name",pipelineName:"Pipeline name",existingWorkspace:"Existing CodePipeline Workspace",compatiblePipeline:"Compatible Pipeline",existingPipeline:"Existing AgentKit CodePipeline",pipelineNameNote:"The Pipeline name matches the Runtime name."},Tze={commit:"Commit",steps:{permissions:"Preflight OTA permissions",resolving:"Resolve target version",downloading:"Download and verify the full update package",preparing:"Prepare VeFaaS Function code",provisioning:"Check and provision Studio cloud resources",scheduler:"Update the scheduled task service",submitting:"Submit the Function update",publishing:"Publish a new Revision and restart the service"},stages:{permissions:"Preflight OTA permissions",resolving:"Resolve version details",downloading:"Download update package",preparing:"Prepare Function code",provisioning:"Provision Studio cloud resources",scheduler:"Update scheduled task service",submitting:"Submit Function update",publishing:"Publish Revision",checking:"Check for updates",unknown:"Unknown stage"},duration:{seconds:"{{count}} seconds",minutesSeconds:"{{minutes}} min {{seconds}} sec"},logPermissionPrefix:"Unable to read VeFaaS release logs. The Function role lacks ",logPermissionSuffix:"; the update will continue.",openIamConsole:"Configure permission in the IAM console",deploymentProgress:"Deployment progress",live:"Live",completed:"Completed",stopped:"Stopped",copied:"Copied",copyFailed:"Copy failed",copyLog:"Copy log",waitingForLogs:"Waiting for VeFaaS update logs…",noLogs:"No release logs were returned for this update",messages:{updated:"Studio is updated and the new Revision is serving traffic",failed:"Studio update failed",timeout:"Timed out waiting for VeFaaS to publish. Check for updates again later.",submitted:"Update submitted. Waiting for VeFaaS to publish the new version.",connectionSwitched:"The connection changed. Confirming the new version status."},checkingPermissions:"Checking OTA permissions",authorizationRequired:"IAM authorization required",updating:"Updating Studio",updated:"Studio updated",updateToVersion:"Update Studio to {{version}}",checkPermissions:"Check update permissions",authorizationNeeded:"Authorization required",updatingShort:"Updating",refreshForNewVersion:"Refresh to use the new version",updateFailed:"Update failed",updateNow:"Update now",newVersionAvailable:"New version available",dialog:{failed:"Studio update failed",checkingPermissions:"Checking update permissions",authorizationRequired:"IAM authorization required",updating:"Updating Studio",completed:"Studio update complete",newVersion:"New version available"},permissionCheck:"Checking every IAM permission required by OTA and scheduled tasks…",permissionCheckHint:"Downloads and cloud-resource updates begin only after all permissions are available.",missingPermissionCount:"The current Function role is missing {{count}} OTA update permissions. No cloud resources have been changed.",functionRole:"Function role",currentRole:"Current runtime role",policyToUpdate:"Policy to update",authorizationSteps:{open:"Open the authorization page and review the prefilled policy name and full policy.",debug:"Select “Start debugging” on the page to apply the policy update.",return:"Return to this window and select “Authorized, check again”."},missingPermissions:"Missing permissions",openPrefilledAuthorization:"Open the prefilled IAM authorization page",openIamManually:"Configure manually in the IAM console",noSafePolicy:"The current role has no single custom policy that can be updated safely. Ask an administrator to add the permissions above to this role.",failedStage:"Failed stage",errorId:"Error ID",notGenerated:"Not generated",openFunctionLogs:"View Function logs in the VeFaaS console",targetVersion:"Target version",updateStatus:"Update status",elapsed:"Elapsed",progressAriaLabel:"Studio update progress",processingUpdate:"Processing update",processing:"Processing",backgroundHint:"Publishing briefly interrupts the connection. Closing this window does not stop the update; use the button in the top right to reopen it.",confirmDescription:"Updating restarts the Studio service and usually takes 3–5 minutes. Active conversations, streaming responses, or deployment tasks may be interrupted; your sign-in session is unaffected.",selectVersion:"Select version",currentVersion:"Current version",changelog:"What's new",noChangelog:"No release notes",runInBackground:"Run in background",authorizedRecheck:"Authorized, check again",tryAgain:"Try again"},Cze={deploy:"Deploy",update:"Update",planHash:"Plan hash",backToConfiguration:"Back to configuration",releaseRegion:"Release region",deployRegion:"Deployment region",regionPreserved:"The existing Runtime deployment region is preserved during updates and cannot be changed.",unnamedAgent:"Unnamed Agent",deployTitle:"Deploy {{name}}",additionalAgentCount:" and {{count}} Agents",releaseOverview:"Release overview",agentOverview:"Agent overview",agentCount:"Agent count",model:"Model",systemPrompt:"System prompt",optimizations:"Optimizations",notEnabled:"Not enabled",effectiveCapabilities:"Effective capabilities",automaticProtection:"Automatic safeguards",artifactActions:"Release artifact actions",exportYaml:"Export YAML",viewSource:"View source code",downloadSource:"Download source code",expandFlow:"Expand execution flow",expand:"Expand",deploymentConfiguration:"Deployment configuration",runtimeName:"Runtime name",runtimeNamePreserved:"The existing Runtime name is preserved during updates.",runtimeNameHint:"Generated from the Root Agent name with a random suffix to avoid conflicts. Use 4–64 letters, numbers, hyphens, or underscores.",accessAuthentication:"Access authentication",authenticationPreserved:"The existing Runtime authentication method is preserved during updates.",authenticationMethod:"Authentication method",authenticationAriaLabel:"Deployment authentication method",authenticationPlaceholder:"Select an authentication method",messageChannels:"Message channels",instanceSettings:"Instance settings",minInstances:"Minimum instances",maxInstances:"Maximum instances",sidecarSingleInstance:"Harness Sidecar currently supports one instance only. The Runtime is fixed at 1–1.",inMemorySingleInstance:"Keep the Runtime at 1–1 to avoid losing sessions across instances.",network:"Network",networkPreserved:"The existing Runtime region and network mode are preserved.",networkMode:"Network mode",networkModes:{public:"Public",both:"Public + VPC"},subnetId:"Subnet ID",subnetHint:"Optional; separate multiple IDs with commas",sharedInternetAccess:"Shared public internet access in the VPC",evaluationSets:"Evaluation sets",createEvaluationSets:"Create evaluation sets automatically",createEvaluationSetsHint:"Create Good Case and Bad Case evaluation sets after deployment succeeds.",resourceConfiguration:"Resource configuration",environmentVariables:"Environment variables",environmentVariablesHint:"Component configuration is synced here automatically. Review the final values before deployment.",itemCount:"{{count}} items",addVariable:"Add variable",componentGenerated:"Generated from components",injectedByApiKey:"Injected from the selected API key",envNameAriaLabel:"{{key}} environment variable name",envDescriptionAriaLabel:"{{key}} description: {{description}}",openOpenViking:"Open OpenViking {{label}}",openOpenVikingAriaLabel:"{{key}}: open OpenViking {{label}}",requiredEmpty:"Required; no value entered",optionalEmpty:"Optional; no value entered",envValueAriaLabel:"{{key}} environment variable value",automatic:"Automatic",synced:"Synced",customModelCredentials:"Custom model credentials",releaseOnlySecret:"Required; used only for this release",thisRelease:"This release",customVariables:"Custom variables",value:"Value",deleteVariable:"Delete variable",deploymentProgress:"Deployment progress",retryUpdate:"Retry update",retryDeploy:"Retry deployment",updateSucceeded:"Update succeeded",deploySucceeded:"Deployment succeeded",region:"Region",agentName:"Agent name",apiEndpoint:"API endpoint",connecting:"Connecting…",chatNow:"Chat now",console:"Console",actionInProgress:"{{action}} in progress…",checkingName:"Checking name…",retryAction:"Retry {{action}}",flowPreview:"Execution flow preview",executionFlow:"Execution flow",flowPreviewHint:"Read-only preview; zoom and pan the canvas",closeFlowPreview:"Close execution flow preview",agentAdded:'Agent "{{name}}" was added to the selector in the top left.',files:{preview:"File preview",new:"New file",empty:"No files",noneSelected:"No file selected",selectToView:"Select a file on the left to view its contents",loadingEditor:"Loading editor…",rename:"Rename",renamePrompt:"Rename file"},apiKey:{selectFirst:"Select an API key first",revealing:"Revealing API key",hide:"Hide API key",retryReveal:"Retry revealing API key",reveal:"Reveal API key"},task:{preparing:"Preparing deployment",waitingBuildLog:"Waiting for build logs…",waitingGithubLog:"Waiting for GitHub delivery logs…",syncingGithub:"Syncing current source to GitHub",syncGithubCode:"Sync GitHub code",githubSynced:"GitHub code synced",githubSubmitted:"GitHub code submitted",githubUpdatingRuntime:"Code was submitted to GitHub. GitHub Actions is updating the same Runtime.",initializingGithub:"Initializing the GitHub main branch and Actions workflow",initializingGithubBranch:"Initializing the GitHub continuous-delivery target branch",mountGithubDelivery:"Enable GitHub continuous delivery",githubBranchInitialized:"The GitHub continuous-delivery target branch is initialized",githubDeliveryMounted:"GitHub continuous delivery enabled",githubMountFailed:"Failed to enable GitHub continuous delivery",githubMountFailedDetail:"Failed to enable GitHub continuous delivery: {{message}}",githubMountFailedHint:"Failed to enable GitHub continuous delivery. See the GitHub log for details.",applyingMpaProfile:"Applying the Agent profile to MPA Runtime",mpaProfileApplied:"MPA Runtime profile applied",runningMpaSmoke:"Verifying the MPA Runtime execution path",mpaReady:"MPA Runtime is ready",deploymentComplete:"Deployment complete",deployedNotConnected:"Deployed, not connected yet",cancelled:"Cancelled",cancelledHint:"Deployment was cancelled and the Runtime resources were requested for deletion.",deploymentStatusUnconfirmed:"Deployment status unconfirmed",deploymentFailed:"Deployment failed",buildFailedHint:"Image build failed. See the build log for details."},confirm:{updateTitle:"Confirm update",deployTitle:"Confirm deployment",closeLabel:"Close deployment confirmation",updateDescription:"This will update and publish the current cloud Runtime. It may take a few minutes. Continue?",deployDescription:"This will create a new cloud Runtime. Deployment may take a few minutes. Continue?",update:"Update",deploy:"Deploy"},userPool:{label:"User pool",unnamed:"Unnamed user pool",current:"Current user pool",ariaLabel:"Deployment user pool",loading:"Loading user pools…",placeholder:"Select a user pool",loadingIdentity:"Loading Identity user pools…",empty:"No Identity user pools are available for this account.",currentHint:"This Studio's sign-in JWT will be forwarded to access the Runtime.",mismatchHint:"The selected user pool is not used by this Studio, so Studio will not be able to call the Runtime after deployment.",markedHint:"The user pool used by this Studio is marked in the list."},authentication:{apiKeyDescription:"Default method using the Runtime API key",userPool:"User pool",userPoolDescription:"Use a JWT issued by an Identity user pool"},steps:{buildImage:"Build image",deploy:"Deploy",publish:"Publish",syncCode:"Sync code",uploadPackage:"Upload code package",packageImage:"Package image",createRuntime:"Create Runtime",publishService:"Publish service",updateInstances:"Update instance configuration",createEvaluationSets:"Create evaluation sets",applyMpaProfile:"Apply MPA profile",verifyMpaRuntime:"Verify MPA Runtime",mpaReady:"MPA Runtime ready"},errors:{instanceRangeInteger:"Minimum instances must be an integer of 0 or more, and maximum instances must be an integer greater than 0.",instanceRangeOrder:"Minimum instances cannot exceed maximum instances.",selectApiKey:"Select an API key in the model configuration first.",loadApiKey:"Failed to load the API key. Try again.",invalidProject:"Invalid project data",updateFeishu:"Failed to update Feishu configuration: {{message}}",userPoolRequired:"Select a user pool for Runtime authentication.",vpcRequired:"Enter a VPC ID when using a VPC network.",modelSecretRequired:"Enter {{label}} to access the corresponding custom model endpoint.",managedApiKeyRequired:"{{requirement}}. Return to model configuration and select an API key first.",feishuEnvRequired:"Enter {{field}} after enabling Feishu.",runtimeNameExists:"This Runtime name already exists. Change it and try again.",deployedButGithubMountFailed:"Deployment succeeded, but enabling GitHub continuous delivery failed: {{message}}",deployedButGithubBindFailed:"Deployment succeeded, but binding GitHub failed: {{message}}",mpaRuntimeIdMissing:"Deployment succeeded, but the Runtime ID is missing, so the MPA profile cannot be applied.",mpaOperationIncomplete:"MPA Runtime setup did not complete. Retry this deployment task.",deploymentStatusUnconfirmed:"The connection was interrupted, so the final deployment status cannot be confirmed. The task may still be running in the cloud. Check the same task in AgentKit or CodePipeline and avoid a duplicate deployment.",failedAtStage:"{{action}} failed during {{stage}}: {{message}}",noAgentAtEndpoint:"Connected successfully, but no Agents were found at this endpoint (/list-apps is empty).",addAgent:"Failed to add Agent: {{message}}",modelApiKeyRequired:"Enter the API key for this model endpoint."}},kze={title:"Workspaces",storageUnavailable:"Persistent storage is not configured. Workspace management is unavailable.",detail:"Workspace details",create:"New workspace",editorDescription:"Group frequently used environments. An environment can belong to multiple workspaces.",backToList:"Back to workspaces",environmentCount_one:"{{count}} environment",environmentCount_other:"{{count}} environments",createdAt:"Created",updatedAt:"Last updated",basicInfo:"Basic information",namePlaceholder:"For example: Content production",descriptionPlaceholder:"Describe what this workspace is for",selectedEnvironmentCount:"{{count}} selected; they can also be reused in other workspaces",searchAvailableEnvironments:"Search available environments",searchEnvironments:"Search environments",noAvailableEnvironments:"No environments are available to add",createEnvironmentFirst:"Create and build an environment on the Environments page first.",noMatchingEnvironments:"No matching environments",tryAnotherName:"Try searching for another name.",environmentStatus:{available:"Available",building:"Building",notBuilt:"Not built"},added:"Added",saved:"Workspace “{{name}}” saved",resourceType:"Workspace resource type",searchWorkspaces:"Search workspaces",loadFailed:"Unable to load workspaces",noMatchingWorkspaces:"No matching workspaces",tryAnotherNameOrEnvironment:"Try another name or environment",noEnvironmentAdded:"No environments added",environmentMissing:"Environment missing",availableFraction:"{{available}}/{{total}} available",available:"Available",availableCount:"{{count}} available",updated:"Updated",addEnvironment:"Add environment",deleteTitle:"Delete workspace",deleteDescription:"Delete workspace “{{name}}”? Its environments will not be deleted.",deleted:"Workspace “{{name}}” deleted",clipboardPermissionError:"Could not read the clipboard. Allow clipboard access, or open Import environment and paste the share code manually.",clipboardUnsupported:"This browser cannot read the clipboard automatically. Open Import environment and paste the share code manually.",codeProjects:"Code projects"},Oze={back:"Back",detailNavigation:"Detail navigation",noData:"No data",actions:"Actions",moreActions:"More actions for {{label}}",actionsFor:"Actions for {{label}}",loading:"Loading resources…"},Eze={addSkill:"Add Skill",remove:"Remove {{name}}",confirmRemoveRuntime:"Remove the running Skill “{{name}}” from the new version?",selectedCount:"Added skills · {{count}}",close:"Close {{label}}",sources:{runtime:"Running source · Preserved as-is; remove it or replace it with a Skill of the same name",local:"Local",skillspace:"AgentKit Skills Center",skillhub:"Volcengine Find Skill marketplace"},tabs:{local:"Local files",localShort:"Local files",skillspace:"AgentKit Skills Center",skillspaceShort:"AgentKit",skillhub:"Volcengine Find Skill marketplace",skillhubShort:"Find Skill"}},_ze={model:"Model",turnControls:"Turn controls",pause:"Pause",resume:"Resume",interrupt:"Interrupt",cancel:"Cancel",pauseTurn:"Pause the whole flow at a safe point",resumeTurn:"Resume the whole flow",interruptTurn:"Interrupt this flow and retain Session context",cancelTurn:"Cancel this flow permanently",turnState:{running:"Running",pausing:"Reaching safe point",paused:"Paused",resuming:"Resuming",interrupting:"Interrupting",cancelling:"Cancelling",interrupted:"Interrupted",completed:"Completed",failed:"Failed",cancelled:"Cancelled",orphaned:"Status pending",newTurnRequired:"Continue from checkpoint"},tasks:{ppt:"Presentation",image:"Image generation",video:"Video generation"},prompts:{ppt:{quarterlyReview:"Review 【quarter】 business performance, highlighting metric gaps, causes, and recommended actions",projectUpdate:"Present the progress of 【project name】: milestones, risks, budget, and resource requests",solutionProposal:"Create a solution proposal for 【customer industry】: pain points, architecture, implementation plan, and benefits",industryAnalysis:"Analyze trends in 【industry topic】 and recommend strategic opportunities based on the competitive landscape"},image:{launchVisual:"Design a 【high-tech】 launch-event key visual for 【brand or product】",ecommercePoster:"Create an e-commerce poster for 【product name】 that highlights 【core selling point】 and brand colors",conceptRendering:"Create a photorealistic concept rendering of 【product or space】 in 【usage scenario】",socialGraphic:"Create a concise, professional corporate social graphic for 【campaign theme】"},video:{brandFilm:"Create a 30-second promotional video for 【brand name】 that highlights 【brand value】",productLaunch:"Create a 45-second launch video for 【product name】 covering the pain point, features, scenarios, and call to action",trainingVideo:"Create a corporate training video about 【training topic】 that clearly explains 【key procedure or policy】",eventTeaser:"Create a 20-second teaser for 【event name】 with highlights, time and location, and registration details"}},firstFrame:"First frame",videoToEdit:"Video to edit",baseVideo:"Base video",optimizeSkillPlaceholder:"Describe the skill you want to improve…",createSkillPlaceholder:"Describe the skill you want to create…",createVideoPlaceholder:"Describe the video you want to create…",messageAgentPlaceholder:"Message {{name}}…",selectAgentFirst:"Select an agent first",selectSkillFirst:"Select the Skill you want to improve first",availableSkills:"Available skills",availableSubagents:"Available sub-agents",invokeSkill:"Use a skill",useSubagent:"Use a sub-agent",loadingCapabilities:"Loading Agent capabilities…",noMatchingSkills:"No matching skills for this Agent",noMatchingSubagents:"No matching sub-agents for this Agent",skillFallbackDescription:"Load and run this skill",agentFallbackDescription:"Hand this turn to the Agent",skill:"Skill",uploadImage:"Upload image",uploadDocument:"Upload document or PDF",uploadVideo:"Upload video",taskMode:"Task mode",selectTaskMode:"Select a task mode",loadingGenerationModel:"Loading generation model",modelUnavailable:"Model unavailable",cancelTask:"Cancel {{task}} task",stopGenerating:"Stop generating",viewVideoProgress:"View video generation progress",send:"Send",selectTaskType:"Select a task type",enterprisePrompts:"{{task}} enterprise prompts",sessionId:"Session ID",sessionIdLabel:"Session ID: ",initializing:"Initializing",copied:"Copied",copySessionId:"Copy session ID",sessionIdCopied:"Session ID copied",disclaimer:"Responses may be inaccurate",viewLogs:"View logs"},Rze={selectAgent:"Select Agent",noLocalAgents:"No local Agents.",searchRuntime:"Search Runtime names",mineOnly:"Created by me",noRuntimes:"No Runtimes.",unsupported:"Unsupported",createdByMe:"Created by me",connecting:"Connecting…",connected:"Connected",connect:"Connect",viewInfoFor:"View information for {{name}}",viewInfo:"View information",agentAndRuntimeInfo:"Agent and Runtime information",detailType:"Detail type",agentInfo:"Agent information",runtimeInfo:"Runtime information",loadingAgentInfo:"Loading Agent information…",cannotLoadAgentInfo:"Agent information is temporarily unavailable",unnamedAgent:"Unnamed Agent",subagents:"Sub-agents",tools:"Tools",skills:"Skills",previewUnsupported:"Preview unavailable",mountedComponents:"Mounted components",noMoreAgentInfo:"No additional Agent configuration information.",local:"Local",model:"Model",status:"Status",memoryMb:"Memory {{value}} MB",instances:"Instances {{min}}–{{max}}",resources:"Resources",version:"Version",loadingDetails:"Loading details…",environmentVariables:"Environment variables",errors:{notFound:"This Runtime no longer exists or the list is out of date. Refresh the list and try again.",accessDenied:"This account cannot access the Runtime. Check its Project and access permissions.",previewUnsupported:"This Agent Server version does not support information previews.",unavailable:"This Runtime is temporarily unavailable. Confirm that its status is Ready and try again.",timeout:"Loading timed out. Try again."},componentKinds:{knowledgebase:"Knowledge base",memory:"Memory",prompt_manager:"Prompt manager",example_store:"Example store",run_processor:"Run processor",tracer:"Trace",toolset:"Toolset",plugin:"Plugin",other:"Other"},runtimeStatus:{ready:"Ready",unreleased:"Unreleased",running:"Running",active:"Running",creating:"Creating",pending:"Pending",deploying:"Deploying",updating:"Updating",failed:"Failed",error:"Error",stopping:"Stopping",stopped:"Stopped",deleting:"Deleting",deleted:"Deleted"}},Dze={agent:"Agents",agentTypes:{general:"General Agents",mpa:"MPA Agents",codex:"Codex","deepseek-harness":"DeepSeek",openclaw:"OpenClaw",hermes:"Hermes"},creator:"Created by",namedAgent:"{{name}} Agent",storageLocation:"Storage location",currentBrowser:"Current browser",region:"Region",viewDeploymentProgress:"View deployment progress for {{name}}",viewRuntimeDetails:"View Runtime details for {{name}}",viewDetails:"View details for {{name}}",time:"Time",remainingTime:"Time remaining",expiringSoon:"Expiring soon",sandboxRemaining:"{{hours}} hr {{minutes}} min",wakeable:"Asleep",neverExpires:"Never expires",editDraftNamed:"Edit draft {{name}}",viewProgress:"View progress",deleteDraftNamed:"Delete draft {{name}}",recheckCompatibility:"Check chat compatibility for {{name}} again",connectedNamed:"{{name}} is connected",wakeAndChat:"Wake {{name}} and start chatting",chatWith:"Chat with {{name}}",waking:"Waking…",deploying:"Deploying",draft:"Draft",checking:"Checking",chatUnsupported:"Chat unsupported",checkFailed:"Check failed",creatorFilter:"Creator filter",agentType:"Agent type",searchAgents:"Search Agents",handoff:"Handoff",agentList:"{{type}} list",noMatchingAgents:"No matching Agents",adjustSearch:"Try adjusting the search or filters",noAgentType:"No {{type}}",noGeneralAgents:"No General Agents",createGeneralAgentDescription:"Create a General Agent to start building and chatting",createAgentType:"Create {{type}}",createAgent:"Create Agent",loadingMore:"Loading more Agents",scrollForMore:"Scroll down to load more",allLoaded:"All Agents loaded",deleteDraftTitle:"Delete draft?",deleteDraftDescription:"“{{name}}” cannot be recovered after deletion.",deleteDraft:"Delete draft",loadGeneralAgents:"Load General Agents",loadAgentType:"Load {{type}}",compatibility:{checking:"Requesting Runtime /list-apps to confirm that this Agent supports Studio chat.",empty:"Runtime /list-apps returned no available Agents, so chat is currently unavailable.",supported:"This Runtime supports Studio chat.",unknownError:"The Runtime /list-apps request failed without a recognizable error."},sandboxStatus:{ready:"Ready",wakeable:"Asleep",creating:"Creating",starting:"Starting",initializing:"Starting",pending:"Pending",running:"Running",failed:"Error",error:"Error",stopped:"Stopped",expired:"Expired",deleting:"Deleting",deleted:"Deleted",unknown:"Unknown status"},wakingHint:"Waking the agent. This may take some time.",mpaCreate:{name:"Name",namePlaceholder:"e.g. test-agent",nameHelp:"Used as the Runtime name. Use 4–64 letters, numbers, underscores or hyphens.",stepsLabel:"Creation steps",steps:{basics:"Basics",postgres:"PostgreSQL",openviking:"OpenViking",autoPostgres:"Database"},next:"Next",previousStep:"Previous",pgDescription:"Choose an existing PostgreSQL instance. Creation prepares an isolated database for this agent on that instance.",pgSplitDescription:"Use the configured business PG Workspace. Agents share this Workspace, each with its own database. Shared resource records are stored separately in mpa_admin_workspace / mpa_admin_db, configured by the administrator.",pgConsole:"Create or inspect an AIDAP PG Workspace in Volcengine",pgHost:"PG host",pgPort:"PG port",pgInvalid:"Enter a valid PG host and port.",pgCredentials:"The deployment service provides the PG login and password; host and port must match its configuration.",openvikingDescription:"Optional. Enter all three fields to enable OpenViking, or leave all blank to omit OpenViking settings from the new agent.",openvikingConsole:"Inspect OpenViking resources in Volcengine",openvikingUrl:"OpenViking service URL",openvikingResourceId:"OpenViking resource ID",openvikingApiKey:"OpenViking API Key",openvikingInvalid:"Enter a valid HTTPS service URL, resource ID and API Key together, or leave all blank.",openvikingCredentials:"The API Key is used only for this creation and is not saved in browser drafts; re-enter it after a refresh.",tosTitle:"Session output storage",tosDescription:"Optional. Enter complete TOS credentials and a bucket to mount an isolated output directory for every Session. Leave all three blank to use the server defaults; TOS mounting is disabled if no defaults are configured.",tosAccessKey:"TOS Access Key",tosSecretKey:"TOS Secret Key",tosBucket:"TOS bucket",tosInvalid:"TOS Access Key, Secret Key, and bucket are all required together.",tosCredentials:"Credentials are used only for this creation and are not saved in browser recovery data or creation task records.",runtimeImage:"MPA image",workerImage:"Worker image",imageDefault:"Leave blank to use the configured image",imageInvalid:"Enter a valid container image reference without URLs, spaces or credentials.",title:"Create MPA agent",agentId:"Agent ID",description:"Description",region:"Deployment region",plan:"Creation plan",sharedResources:"Prepare or reuse the account VPC, subnets and APIG message gateway",agentResources:"Prepare an isolated database, Skill Space and worker, then deploy the agent",readiness:"Verify gateway and agent readiness before adding the agent to the list",checking:"Checking creation configuration…",configured:"Creation configuration is ready. Submission checks cloud resources and starts provisioning.",notConfigured:"Creation prerequisites are not configured. Ask an administrator to configure them, then retry.",loadFailed:"Could not check creation configuration. Please retry.",reload:"Check again",submit:"Start creation",retry:"Retry creation",newAgent:"Create another agent",newAgentDescription:"Create another agent opens an editable new request and replaces this recovery draft. It does not cancel the old task. If the old task is still running, wait for it to finish before submitting.",close:"Close",cancel:"Cancel creation",confirmCancel:"Confirm cancellation",cancelDescription:"Cancellation stops subsequent steps. Created databases, Skill Spaces, gateways and other registered resources are retained. Retry using the same agent ID.",background:"Creation continues after closing this window. Open it again to view progress.",pollFailed:"Progress is temporarily unavailable. Reconnecting; avoid creating another agent.",iamPermissionDenied:"The deployment service lacks IAM permissions to prepare the runtime role. Ask an administrator to grant access, then retry.",iamTrustConflict:"The runtime role trust is incompatible. Ask an administrator to check VeFaaS and APIG access, then retry.",iamPolicyConflict:"An existing runtime policy with the required name has conflicting contents. Ask an administrator to check it, then retry.",iamOwnershipConflict:"The runtime role does not belong to the deployment account. Ask an administrator to check it, then retry.",iamVerificationFailed:"Runtime role permissions could not be confirmed. Check IAM availability and policies, then retry.",iamConfigurationConflict:"Automatic runtime role preparation requires the default MPA role. Check the server creation configuration.",creationFailed:"This step failed. Check its resources, server configuration and permissions, then retry the same agent ID.",cancelFailed:"Cancellation failed. Check the current progress and retry.",cancelled:"Creation cancelled. Registered resources are retained for retry.",timeout:"Creation timed out. Registered resources are retained. Inspect them before retrying.",interrupted:"Creation was interrupted. Retry the same agent ID to recover registered resources.",skillSpace:"Skill Space",states:{running:"Creating",cancelling:"Cancelling",succeeded:"Created",failed:"Creation failed",cancelled:"Cancelled"},stages:{queued:"Queued",iam_role:"Prepare runtime role",checking:"Checking account and configuration",network:"Preparing VPC and subnets",gateway:"Preparing APIG and IM Gateway",database:"Preparing business database",skills:"Preparing Skill Space",worker:"Preparing worker",deploying:"Preparing database, skills and Runtime",verifying:"Waiting for agent readiness",admin_workspace:"Prepare management PG Workspace",business_workspace:"Prepare business PG Workspace",admin_database:"Initialize shared management database"},back:"Keep creating",pgAutoDescription:"VeADK uses its deployment account to create or reuse two PG Workspaces. mpa_admin_workspace / mpa_admin_db stores shared resource records; the business Workspace hosts an independent database for each agent. No PG connection input is needed. Preparation starts after submission.",pgModeChanged:"This submitted task uses previous PG settings and cannot be retried in automatic mode. Ask an administrator to reconcile its resources and task before starting a new creation.",pgMigrationRequired:"An existing shared registry is configured. Migrate its resource records to mpa_admin_workspace / mpa_admin_db and coordinate the registry URL cutover for existing Runtimes, then recheck this configuration."}},Lze={library:"Skill library",skill:"Skill",skills:"Skills",skillSpace:"Skill space",sandboxNotConfigured:"Dev Sandbox is not configured by an administrator",adminNotConfigured:"Not configured by an administrator",totalItems:"{{count}} items",cannotLoadSpaces:"Unable to load Skill spaces",someSpacesFailed:"Some Skill spaces failed to load",degradedRelationWarning:"Some relations are invalid. Readable skills have been restored.",downloadZip:"Download ZIP",optimize:"Optimize",closeSkillDetails:"Close Skill details",skillId:"Skill ID",allFiles:"All files",loadingSkillContent:"Loading Skill content…",noSkillContent:"This Skill has no SKILL.md content",addSkill:"Add Skill",localUpload:"Upload locally",localUploadDescription:"Select a ZIP file and upload it to the Skill space after validation",autoCreate:"Create automatically",autoCreateDescription:"Choose a model and style, then create a Skill through conversation",createSkill:"Create Skill",optimizeNamed:"Optimize {{name}}",deleteSkillConfirm:"Delete the entire Skill “{{name}}”? This affects every space that references it.",deleteSpaceConfirm:"Delete Skill space “{{name}}”? Make sure its Skills have been deleted first.",manageSpaceDescription:"Manage Skills in this space and create new versions",backToSpaces:"Back to Skill spaces",overview:"Overview",skillCount:"Skills",skillCountValue_one:"{{count}} Skill",skillCountValue_other:"{{count}} Skills",updatedAt:"Updated",skillsInSpace:"Skills in {{name}}",searchSkills:"Search Skills",cannotLoadSkills:"Unable to load Skills",noMatchingSkills:"No matching Skills",noSkills:"No Skills",tryAnotherName:"Try searching for another name",emptySkillsDescription:"Upload a Skill locally or create one automatically",actions:"Actions",spaceDetails:"Skill space details",editSpace:"Edit space",deleteSpace:"Delete space",searchSpaces:"Search Skill spaces",spaceList:"Skill space list",noMatchingSpaces:"No matching Skill spaces",createSpace:"Create Skill space",newSpace:"New space",loadingMoreSpaces:"Loading more Skill spaces",scrollForMore:"Scroll down to load more",allSpacesLoaded:"All Skill spaces loaded",errors:{loadSpaces:"Unable to load Skill spaces. Try again later.",loadSkills:"Unable to load Skills. Try again later.",loadSkillDetails:"Unable to load Skill details. Try again later.",deleteSkill:"Unable to delete the Skill",deleteSpace:"Unable to delete the Skill space",downloadSkill:"Unable to download the Skill"},status:{active:"Available",available:"Available",creating:"Creating",disabled:"Disabled",enabled:"Enabled",failed:"Error",inactive:"Inactive",pending:"Pending",published:"Published",ready:"Ready",released:"Published",running:"Running",success:"Healthy",unavailable:"Unavailable",unreleased:"Unreleased",updating:"Updating",unknown:"Unknown"},sharedSpace:"Enterprise shared space",sharedDescription:"Skills available to everyone, published and maintained by administrators",sharedVisibility:"Everyone",sharedPreparing:"Preparing shared space",sharedLoadFailed:"Shared space unavailable",sharedEmpty:"No shared skills yet. Skills published by administrators will appear here",requestPublication:"Request publication",reviewSubmitting:"Submitting…",reviewSubmitted:"Submitted",reviewFailed:"Could not submit the publication request",reviewStatusFailed:"Failed to load review status",reviewRetry:"Apply again",reviewPending:"Pending review",reviewApproving:"Publishing",reviewApproved:"Shared",reviewReturned:"Returned",reviewHistory:"Review history",skillDetailSections:"Skill detail sections",versions:{title:"Version management",refresh:"Refresh",uploading:"Uploading…",upload:"Upload new version",close:"Close",hint:"New versions become public after approval and do not replace published versions; the skill name in the ZIP must match the original",loading:"Loading versions…",loadFailed:"Unable to load versions",filesFailed:"Unable to load version files",uploadFailed:"Unable to upload the new version",submitFailed:"Unable to submit for review",retry:"Retry",empty:"No versions yet",current:"Current version",notSubmitted:"Not submitted",submitting:"Submitting…",submit:"Request publication",processing:"Version status: {{status}}",filesLoading:"Loading files…",filesEmpty:"No files",history:"Review history",shared:"Published"},author:"Author",authorName:"Author: {{name}}"},Mze={library:"Knowledge bases",createBase:"New knowledge base",editBase:"Edit knowledge base",invalidName:"The name must start with a letter and contain only letters, numbers, and underscores.",nameHelp:"Start with a letter. Use up to 48 letters, numbers, or underscores.",optionalDescription:"Description (optional)",descriptionOnly:"AgentKit currently supports updating only the knowledge base description.",previewWeb:"Preview web content",addData:"Add data",openOriginalWeb:"Open original page",backToEdit:"Back to edit",confirmAdd:"Confirm and add",source:"Knowledge source",image:"Image",documentFile:"Document file",webPage:"Web page",webUrl:"Web page URL",generatingWebPreview:"Fetching the page and generating a Markdown preview",selectFile:"Select knowledge file",selectOrDropFile:"Select a file or drag it here",selectedFile:"{{size}} · Click to select another file",imageFileHelp:"PNG, JPG, and JPEG up to 200 MB",documentFileHelp:"PDF, PPTX, DOCX, XLSX, and TXT up to 200 MB",uploadingFile:"Uploading the file and adding it to the knowledge base",optionalName:"Name (optional)",optionalType:"Type (optional)",generatePreview:"Generate preview",uploadFile:"Upload file",editMetadata:"Edit knowledge metadata",knowledge:"Knowledge item",field:"Field",value:"Value",backToList:"Back to knowledge bases",metadataJson:"Metadata (JSON)",provider:"Provider",knowledgeId:"Knowledge ID",project:"Project",creator:"Created by",data:"Data",deleteInvalidAssociation:"Delete invalid association",noData:"This knowledge base has no data",addFirstData:"Add the first data item",format:"Format",size:"Size",searchData:"Search data",searchLibraryData:"Search knowledge base data",associationInvalid:"Association invalid",providerMissing:"The underlying Provider knowledge base no longer exists",noMatchingData:"No matching data",loadingMoreData:"Loading more data",retryLoading:"Retry loading",details:"Knowledge base details",searchBases:"Search knowledge bases",someBasesFailed:"Some knowledge bases are temporarily unavailable. Other available content is shown.",noMatchingBases:"No matching knowledge bases",noManagePermission:"You do not have permission to manage this knowledge base",loadingMoreBases:"Loading more knowledge bases",deleteBaseTitle:"Delete knowledge base?",deleteBaseDescription:"This removes the AgentKit association for {{name}}. If Studio created it, the Provider resource is also deleted. This cannot be undone.",deleteDocumentTitle:"Delete knowledge item?",deleteDocumentDescription:"This removes {{name}} from the Provider knowledge base. This cannot be undone.",preview:{processingTitle:"Data is being processed",processingDetail:"A preview will be available after parsing. Reload later.",failedTitle:"Data parsing failed",failedDetail:"Check the source file or page URL and add it again, or reload the latest status.",noParsedTitle:"No parsed content is available yet",noParsedDetail:"Text, tables, or page images will appear after the knowledge base finishes parsing this file.",noMediaTitle:"No media preview is available yet",noMediaDetail:"The knowledge base has not returned an accessible media preview. Reload later.",noDataTitle:"No data is available to preview",noDataDetail:"The knowledge base has not returned parsed results. Reload later.",attachmentError:"The attachment cannot be previewed. Try again later.",imageAlt:"Knowledge data image",audioUnsupported:"This browser does not support audio previews.",videoUnsupported:"This browser does not support video previews.",namedPdf:"{{name}} PDF preview",pdf:"PDF preview",openPdf:"If it cannot be displayed, open the PDF in a new window",fileUnsupported:"This format cannot be previewed directly online. Parsed content is shown when available.",openOriginalFile:"Open original file",loading:"Loading data preview",openOriginalHint:"You can open the original page to view the source content.",chunk:"Chunk {{index}}",loadingMore:"Loading more",loadMore:"Load more"},errors:{fileTooLarge:"A file cannot exceed 200 MB",invalidImageType:"Select a PNG, JPG, or JPEG image",invalidDocumentType:"Select a PDF, PPTX, DOCX, XLSX, or TXT file",createBase:"Unable to create the knowledge base",updateBase:"Unable to update the knowledge base",metadataObject:"Metadata must be a JSON object",metadataFormat:"Invalid metadata format",noWebPreview:"The page has no Markdown content to preview",addWeb:"Unable to add the web page",previewWeb:"Unable to generate the web page preview",uploadFile:"Unable to upload the file",updateDocument:"Unable to update the knowledge item",loadPreview:"Unable to load the data preview",loadMoreBases:"Unable to load more knowledge bases",loadBases:"Unable to load knowledge bases",loadMoreData:"Unable to load more data",loadData:"Unable to load data",deleteBase:"Unable to delete the knowledge base",deleteDocument:"Unable to delete the knowledge item"}},Ize={title:"Feishu channel",refresh:"Refresh",loading:"Loading channel configuration…",unsupported:"This Runtime does not support channel management. Upgrade its MPA image.",unauthorized:"Channel management requires a Studio administrator and an authorized Runtime credential.",configurationError:"Channel management configuration is incomplete. Check the Runtime metadata and encryption key.",requestFailed:"Channel request failed. Check the Runtime connection and retry.",bound:"Bound: {{name}}",unbound:"No Feishu bot is bound.",guidance:"Private chats use separate conversations. In allowed groups, mention this bot to start a conversation.",keyRequired:"Configure a persistent CHANNEL_STATE_ENCRYPTION_KEY in the Runtime before binding.",gateway:"Message gateway",route:"Inbound route",delivery:"Reply delivery",configured:"Configured",missing:"Missing",delivery_not_observed:"Not observed",delivery_delivered:"Delivered",delivery_retrying:"Retrying",missingConfig:"Missing Runtime configuration: {{fields}}",bind:"Bind with QR code",newQr:"Generate a new QR code",unbind:"Unbind",confirmUnbind:"Disconnect this bot? It will stop receiving new messages.",qrAlt:"Bot authorization QR code",openQr:"Open authorization page",uncertain:"Registration was interrupted. Check the bot binding and Gateway before starting again.",bindingFailed:"Binding failed. Check Gateway configuration and retry.",chatId:"Allowed group ID",scope:"Group conversation scope",saveGroup:"Save group",noGroups:"No groups allowed yet. Private chats do not need this permission.",edit:"Edit",remove:"Remove",removeGroup:"Remove {{name}}",scope_group_sender:"Separate by sender",scope_group:"Shared by group",scope_group_topic_sender:"Separate by topic and sender",scope_group_topic:"Shared by topic",status_PENDING:"Waiting for scan",status_SCANNED:"Scanned; waiting for authorization",status_AUTHORIZED:"Authorized; preparing registration",status_REGISTERING:"Registering bot",status_BOUND:"Bot bound",status_FAILED:"Binding failed",status_EXPIRED:"QR code expired",workspaceTitle:"Message channels",workspaceDescription:"Connect messaging apps to this Agent and manage access.",provider_feishu:"Feishu",provider_wecom:"WeCom",provider_dingtalk:"DingTalk",comingSoon:"Not available yet",unavailableDescription:"Binding and message settings for {{name}} are not available yet.",runtimeRequired:"Deploy this Agent to a Runtime before configuring message channels.",bindingTitle:"Bot connection",connected:"Bound",notBound:"Not bound",gatewayDescription:"Gateway configuration for receiving channel messages.",routeDescription:"Routing configuration for delivering messages to this Agent.",deliveryDescription:"Observed reply delivery; configuration alone does not confirm delivery.",groupsTitle:"Group access",groupsDescription:"Allow specific groups and choose how conversations are shared.",providerBindingTitle:"Connect {{name}}",providerUnbound:"Connect a {{name}} bot to let users message this agent.",qrGuidance:"Authorize with {{name}}. The Runtime saves the bot credentials and configures the message gateway.",wecomGuidance:"Authorize with WeCom QR code, or enter a Bot ID and Secret to bind an existing bot.",wecomBotId:"Bot ID",wecomSecret:"Secret",bindCredentials:"Connect bot",wecomScan:"Bind with QR code",wecomAuthorizing:"Waiting for WeCom authorization…",cancelAuthorization:"Cancel authorization",wecomPopupBlocked:"Allow popups in your browser, then try authorizing again.",wecomAuthCancelled:"WeCom authorization was cancelled. You can scan again.",wecomAuthTimeout:"WeCom authorization timed out. Please scan again.",wecomInvalidResult:"Authorization did not return a Bot ID and Secret. Authorize again or enter them manually.",wecomAuthFailed:"WeCom authorization failed. Try again or enter credentials manually.",dingtalkClientId:"Client ID",dingtalkClientSecret:"Client Secret",manualUpgrade:"Upgrade this Runtime image to configure {{name}} manually. Quick setup is still available.",pairingTitle:"Message channel QR pairing",feishuPairingDescription:"If a bot is already connected, it will be replaced after successful Feishu authorization and binding. In the authorization flow, you can bind an existing bot or create a new one.",generatingQr:"Generating pairing QR code…",dingtalkGuidance:"Authorize with DingTalk QR code, or enter a Client ID and Client Secret to bind an existing bot.",wecomPairingDescription:"Pair again in the WeCom authorization window. The new bot replaces the current connection after binding succeeds. Cancelling authorization or a failed binding does not disconnect the existing bot.",configurationMethod:"Configuration method",quickSetup:"Quick setup",manualSetup:"Manual setup",feishuAppId:"App ID",feishuAppSecret:"App Secret",manualGuidance:"Enter the credentials of an existing {{name}} bot to connect it to this agent.",manualReplacement:"Successful binding replaces the current bot. Cancelling or a failed binding does not disconnect the existing bot."},gdr=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:fze,agentSelector:Rze,agentWorkspace:gze,channels:Ize,cloudEnvironment:xze,common:hze,composer:_ze,default:{common:hze,agentKitPromo:fze,systemInfo:pze,agentWorkspace:gze,environmentCenter:mze,deploymentSelect:vze,deploymentError:yze,studioBuildProgress:bze,cloudEnvironment:xze,githubCicd:wze,feishuDeployment:Aze,deploymentResources:Sze,studioUpdate:Tze,projectPreview:Cze,workspace:kze,resourceCollection:Oze,skillSourcePicker:Eze,composer:_ze,agentSelector:Rze,myAgents:Dze,skillCenter:Lze,knowledge:Mze,channels:Ize},deploymentError:yze,deploymentResources:Sze,deploymentSelect:vze,environmentCenter:mze,feishuDeployment:Aze,githubCicd:wze,knowledge:Mze,myAgents:Dze,projectPreview:Cze,resourceCollection:Oze,skillCenter:Lze,skillSourcePicker:Eze,studioBuildProgress:bze,studioUpdate:Tze,systemInfo:pze,workspace:kze},Symbol.toStringTag,{value:"Module"})),Pze="User management",Nze="{{count}} members",Bze="User",$ze="Role",Fze="Account status",zze="Last sign-in",Uze="Actions",Vze="Change role",Gze="Close",Qze="Save role",Hze="Saving…",Wze="Cancel",Yze="Back",qze="User pool",jze="Volcengine Identity",Xze="Search name, email or user ID",Kze="Search",Zze="Filter by role",Jze="All roles",eUe="Refresh",tUe="Loading users…",rUe="Updated at {{time}}",nUe="{{name}} is now {{role}}",iUe="Retry",aUe="You",oUe="Initial super administrator",sUe="The initial super administrator cannot be demoted here",lUe="The new permissions apply when the user refreshes Studio",cUe="Role needs confirmation",uUe="No matching users",dUe="Try another search or role",hUe="Users appear here after signing in or joining this user pool",fUe="{{count}} users",pUe="Previous",gUe="Next",mUe="Not signed in yet",vUe="Not provided",yUe={super_admin:"Super administrator",admin:"Administrator",developer:"Developer",user:"User"},bUe={super_admin:"Manage all resources, users and role assignments",admin:"Manage Studio resources",developer:"Develop agents and manage your own resources",user:"Use agents and personal features"},xUe={EXTERNAL_PROVIDER:"Active",CONFIRMED:"Active",NORMAL:"Active",ENABLED:"Active",ACTIVE:"Active",UNCONFIRMED:"Unverified",DISABLED:"Disabled",FORBIDDEN:"Disabled",LOCKED:"Locked",SUSPENDED:"Suspended",FORCE_CHANGE_PASSWORD:"Password change required"},wUe={request_failed:"The request did not finish. Refresh the list to confirm its current state before retrying",invalid_response:"The user service returned an invalid response. Refresh and try again",identity_unavailable:"Identity is unavailable. Try again later or check service permissions",identity_resource_missing:"The user or user pool no longer exists. Refresh the list",super_administrator_required:"Only super administrators can manage users",sign_in_required:"Sign in and try again",user_not_in_pool:"Your account does not belong to this user pool",user_disabled:"Your account is disabled",protected_administrator:"The initial super administrator cannot be demoted",cannot_demote_self:"You cannot demote your own super administrator role",role_change_conflict:"The role has changed. Close this dialog and refresh the list before retrying",cross_origin_request:"Change roles from the current Studio page"},mdr=Object.freeze(Object.defineProperty({__proto__:null,actions:Uze,allRoles:Jze,back:Yze,cancel:Wze,changeRole:Vze,close:Gze,default:{title:Pze,memberCount:Nze,user:Bze,role:$ze,status:Fze,lastLogin:zze,actions:Uze,changeRole:Vze,close:Gze,save:Qze,saving:Hze,cancel:Wze,back:Yze,pool:qze,volcengineIdentity:jze,searchPlaceholder:Xze,search:Kze,filterRole:Zze,allRoles:Jze,refresh:eUe,loading:tUe,updatedAt:rUe,saved:nUe,retry:iUe,you:aUe,initialAdministrator:oUe,protectedExplanation:sUe,effectiveAfterRefresh:lUe,roleConflict:cUe,noUsers:uUe,tryAnotherSearch:dUe,poolEmpty:hUe,resultCount:fUe,previous:pUe,next:gUe,neverLoggedIn:mUe,unknown:vUe,roles:yUe,descriptions:bUe,states:xUe,errors:wUe},descriptions:bUe,effectiveAfterRefresh:lUe,errors:wUe,filterRole:Zze,initialAdministrator:oUe,lastLogin:zze,loading:tUe,memberCount:Nze,neverLoggedIn:mUe,next:gUe,noUsers:uUe,pool:qze,poolEmpty:hUe,previous:pUe,protectedExplanation:sUe,refresh:eUe,resultCount:fUe,retry:iUe,role:$ze,roleConflict:cUe,roles:yUe,save:Qze,saved:nUe,saving:Hze,search:Kze,searchPlaceholder:Xze,states:xUe,status:Fze,title:Pze,tryAnotherSearch:dUe,unknown:vUe,updatedAt:rUe,user:Bze,volcengineIdentity:jze,you:aUe},Symbol.toStringTag,{value:"Module"})),AUe="Website integration",SUe="Embed an AgentKit Runtime on your website as a floating chat window",TUe="Back to automations",CUe="Add website",kUe="Loading Runtime",OUe="Select Runtime",EUe="Website domain",_Ue="For example, xxxx.com or localhost:5173",RUe="Generating",DUe="Generate token",LUe="Added websites",MUe="{{count}} website",IUe="{{count}} websites",PUe="Loading website integrations",NUe="No website integrations yet",BUe="Select a Runtime and enter a website domain to generate a token",$Ue="Embed instructions",FUe="Place this code before the closing body tag on your website",zUe="Copied",UUe="Copy code",VUe="Embed code will appear here after you add a website.",GUe="Delete the website integration for {{domain}}?",QUe={load:"Failed to load website integrations",create:"Failed to create website integration",delete:"Failed to delete website integration",noConversationalAgent:"No conversational Agent was found in this Runtime"},HUe={requestFailed:"Request failed ({{status}})",greeting:"Hello. How can I help?",sessionFailed:"Could not start a chat session",unauthorized:"This website is not authorized to start a chat",conversationFailed:"The chat request failed. Try again shortly.",open:"Open Agent chat",close:"Close Agent chat",panelLabel:"Agent chat panel",assistant:"Agent assistant",online:"Online"},vdr=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:CUe,addedWebsites:LUe,backToAutomations:TUe,confirmDelete:GUe,copied:zUe,copyCode:UUe,default:{title:AUe,description:SUe,backToAutomations:TUe,addWebsite:CUe,loadingRuntime:kUe,selectRuntime:OUe,websiteDomain:EUe,domainPlaceholder:_Ue,generating:RUe,generateToken:DUe,addedWebsites:LUe,websiteCount_one:MUe,websiteCount_other:IUe,loadingIntegrations:PUe,delete:"Delete",emptyTitle:NUe,emptyDescription:BUe,embedMethod:$Ue,embedInstructions:FUe,copied:zUe,copyCode:UUe,embedHint:VUe,confirmDelete:GUe,errors:QUe,widget:HUe},description:SUe,domainPlaceholder:_Ue,embedHint:VUe,embedInstructions:FUe,embedMethod:$Ue,emptyDescription:BUe,emptyTitle:NUe,errors:QUe,generateToken:DUe,generating:RUe,loadingIntegrations:PUe,loadingRuntime:kUe,selectRuntime:OUe,title:AUe,websiteCount_one:MUe,websiteCount_other:IUe,websiteDomain:EUe,widget:HUe},Symbol.toStringTag,{value:"Module"})),WUe={types:{all:"All types",document:"Documents",image:"Images",video:"Videos"},previewArtifact:"Preview {{name}}",moreActions:"More actions for {{name}}",actionMenu:"Actions for {{name}}",download:"Download",downloading:"Downloading",edit:"Edit details",delete:"Delete artifact",previewFailed:"Could not preview “{{name}}”: {{message}}",downloadStarted:"Download started for {{name}}",downloadFailed:"Could not download “{{name}}”: {{message}}",updated:"Updated {{name}}",deleted:"Deleted {{name}}",deleteFailed:"Could not delete “{{name}}”: {{message}}",typeFilter:"Artifact type",searchAria:"Search artifacts",searchPlaceholder:"Search artifacts or sessions",retry:"Retry",close:"Close",listAria:"Artifact list",loadFailed:"Could not load artifacts",loadDetailFallback:"Check the storage configuration and try again.",reload:"Reload",noMatch:"No matching artifacts",noArtifacts:"You do not have any artifacts yet",searchHint:"Try another search or artifact type",emptyHint:"Artifacts created in chats will appear here automatically",columns:{name:"Name",source:"Source",updatedAt:"Modified",actions:"Actions"},loadingMore:"Loading more artifacts",unknownTime:"Unknown time",preview:{close:"Close preview",meta:"{{type}} / Version {{version}}",loading:"Loading preview",alt:"Preview of {{name}}",loadFailed:"The preview could not be loaded. Try again later or download the file.",unsupported:"This format cannot be previewed online. Download the file to view it.",sourceAria:"Artifact source",agent:"Agent",session:"Session",tool:"Generated by",createdAt:"Created",fileSize:"File size",tags:"Tags",viewSession:"View session"},deleteDialog:{title:"Delete artifact?",description:"“{{name}}” will be permanently removed from the artifact library. The chat history will not be affected.",deleting:"Deleting",confirm:"Delete",close:"Close delete confirmation"},api:{withStatus:"{{message}} ({{status}})",listFailed:"Could not load the artifact library",syncFailed:"Could not sync chat artifacts",updateFailed:"Could not update the artifact",deleteFailed:"Could not delete the artifact",downloadFailed:"Could not download the artifact"}},YUe={unknownSource:"Unknown source",unknownCreator:"Unknown creator"},qUe={nameRequired:"Enter an artifact name",tooManyTags:"You can add up to {{max}} tags",tagTooLong:"Each tag can contain up to {{max}} characters",title:"Edit artifact details",subtitle:"The content file will not be modified",close:"Close edit dialog",name:"Name",description:"Description",descriptionPlaceholder:"Add its purpose, version, or usage notes",tags:"Tags",tagsPlaceholder:"Separate tags with commas, up to {{max}}",cancel:"Cancel",saving:"Saving",save:"Save"},jUe={change:{added:"Added",modified:"Modified",deleted:"Deleted"},noChanges:"There are no source changes between these versions",chooseFile:"Select a file on the left to view its code",compareTitle:"Compare versions",workspaceTitle:"Source workspace",projectFallback:"Agent project",switchTheme:"Switch source theme",switchThemeTitle:"Switch to {{theme}} theme",themes:{dark:"dark",light:"light"},closeWorkspace:"Close source workspace",close:"Close",changedFiles:"Changed files",projectFiles:"Project files",changes:"Changes",files:"Files",openFiles:"Open files",noFileSelected:"No file selected",comparisonDirection:"Comparison direction",before:"Before optimization",after:"After optimization",loadingEditor:"Loading editor…",changedFileCount_one:"{{count}} file changed",changedFileCount_other:"{{count}} files changed",fileCount_one:"{{count}} file",fileCount_other:"{{count}} files",lineCount_one:"{{count}} line · UTF-8",lineCount_other:"{{count}} lines · UTF-8",viewSource:"View source",viewSourceAria:"View and edit project source"},XUe={nav:"Search",selectAgent:"Select an Agent",checkingCapabilities:"Checking Agent capabilities",notMounted:"This Agent does not have {{label}} mounted",sources:{session:"Sessions",web:"Web",knowledge:"Knowledge base",memory:"Long-term memory"},webDescription:"Search with the web_search tool",backendLocal:"Local",failed:"Search failed: {{message}}",placeholder:{selectAgent:"Select an Agent first",web:"Search the web",knowledge:"Search {{name}}",knowledgeFallback:"this Agent's knowledge base",memory:"Search {{name}}",memoryFallback:"this user's long-term memory",session:"Search this Agent's sessions"},sourceTypeAria:"Search source: {{label}}",notSelected:"Not selected",sourceType:"Search source",selectSource:"Select a search source",noAgentHint:"Select an Agent to search its sessions, the web, and mounted data sources.",loadingCapabilities:"Loading this Agent's search capabilities…",sourceUnavailable:"This Agent does not have this data source mounted",instructions:{web:"Enter keywords and press Enter or select the button to search with web_search.",knowledge:"Enter a question to search this Agent's knowledge base.",memory:"Enter a clue to search long-term memories saved across this user's sessions.",session:"Enter keywords and press Enter or select the button to search this Agent's sessions."},noResults:"No results found for “{{query}}”.",knowledgeFragment:"Knowledge excerpt {{index}}",memoryFragment:"Memory excerpt {{index}}"},KUe={title:"Developer Resources",sections:{documentation:{title:"Related links",description:"Open development documentation and common AgentKit destinations"},bestPractices:{title:"Best practices",description:"Learn from practical development, debugging, and deployment guidance"},showcases:{title:"Showcases",description:"Explore applications built with AgentKit"}},links:{veadkDocs:"VeADK documentation",cliDocs:"AgentKit CLI documentation",platformDocs:"AgentKit platform documentation",console:"AgentKit console"},articles:{veadkDevelopment:{title:"Develop and deploy an Agent with VeADK",description:"Build an Agent with VeADK and deploy it to AgentKit Runtime."},cliDevelopment:{title:"Develop and deploy an Agent with AgentKit CLI",description:"Create a project, debug an Agent, and deploy it with AgentKit CLI."},coverAlt:"Cover image for {{title}}"},showcases:{researchAssistant:{title:"Multi-agent research assistant",description:"Specialized Agents work together to research, analyze, and summarize findings."},multimodalAnalysis:{title:"Multimodal content analysis",description:"Understand images, documents, and video in a single session."},customerService:{title:"Customer service workspace",description:"Combine knowledge retrieval and tool calls to handle complex support requests."},webSearch:{title:"Web search Agent",description:"Search current web content and organize it into traceable answers."},a2uiApp:{title:"A2UI interactive app",description:"Let an Agent generate interactive interfaces as it works through a task."},previewAlt:"Interface preview for {{title}}"}},ZUe={title:"Library",untitledSession:"Untitled session",categoryAria:"Library categories",regionAria:"Region",tabs:{skills:"Skills",knowledge:"Knowledge",artifacts:"Artifacts"}},JUe={title:"Manage Agents",subtitle:"Agents in AgentKit Runtime that you can manage",mainAgentOnly:"Only the main Agent is shown (control-plane information).",deleteConfirm:'Delete Agent "{{name}}"? Its Runtime will be permanently deleted.',regionFilterTitle:"Filter by region",regionFilterAria:"Region filter",regionAria:"Region",refresh:"Refresh",loading:"Loading…",empty:"You have not deployed any Agents.",connected:"Connected",connect:"Connect to this Agent",deleteRuntime:"Delete this Runtime",loadingDetail:"Loading details…",agentStructure:"Agent structure",secretHidden:"Sensitive value is never shown. Copy it with an authorized request.",revealSecret:"Sensitive value for {{key}}",copySecret:"Copy the value of {{key}}",copy:"Copy",copied:"Copied",copyFailed:"Copy failed",notConfigured:"Not configured",fields:{model:"Model",description:"Description",status:"Status details",project:"Project",version:"Version",resources:"Resources",memory:"Memory",tool:"Tool",knowledge:"Knowledge",mcpToolset:"MCP Toolset",updatedAt:"Updated"},resource:{memory:"Memory {{value}} MB",instances:"Instances {{min}}-{{max}}",concurrency:"Concurrency {{value}}"},environmentVariables:"Environment variables",unnamed:"(Unnamed)"},eVe={mainAgent:"Main Agent",subAgent:"Sub-agent {{index}}",itemCount_one:"{{count}} item",itemCount_other:"{{count}} items",info:"Agent information",infoAndTopology:"Agent information and settings",loadingInfo:"Loading Agent information…",unnamedAgent:"Unnamed Agent",agentsMd:"AGENTS.md",tools:"Tools",toolList:"Tool list",studioTool:"Studio Tool",removeTool:"Remove tool {{name}}",remove:"Remove",notConfigured:"Not configured",addStudioTool:"Add Studio tools",addStudioToolHere:"Add Studio tools to this chat",skills:"Skills",skillList:"Skill list",addSkill:"Add Skill Space skills",addSkillHere:"Add Skill Space skills to this Session",skillMountNextTurn:"Mounted versions are frozen when the next Turn starts.",previewUnsupported:"Preview is not supported",sessionEnvironment:"Session environment",environment:"Environment",agentCanvas:"Agent canvas",topology:"Structure",nodeKinds:{agent:"Agent",sandbox:"Sandbox","worker-session":"Worker Session","skill-space":"Skill Space",skill:"Skill","studio-tool":"Studio Tool",mcp:"MCP",environment:"Environment",knowledge:"Knowledge","sub-agent":"Sub-agent"},nodeStatuses:{configured:"Configured",mounted:"Mounted",running:"Running",paused:"Paused"},viewCanvasFullscreen:"View Agent canvas in full screen",viewFullscreen:"View full screen",executionCanvas:"Agent execution canvas",fullscreenExecutionCanvas:"Full-screen Agent execution canvas",closeFullscreenCanvas:"Close full-screen canvas",close:"Close",capabilitiesSubtitle:"Capabilities and collaboration topology",closeInfo:"Close Agent information",infoUnavailable:"Agent information is temporarily unavailable.",refresh:"Refresh information",loadingSkills:"Loading bound skills…",sessionSkills:"Temporary session skills",noBoundSpace:"This agent has no bound Skill Space.",noBoundSkills:"The bound Skill Space has no skills.",loadFailed:"Could not load this information. Refresh to retry.",accessDenied:"You do not have permission to read this information.",documentUnsupported:"Upgrade the Runtime image to enable Studio to read AGENTS.md.",skillsUnsupported:"This Runtime does not provide Skill Space bindings.",skillsDegraded:"Skill information is incomplete. Refresh to retry.",documentEditHint:"Edit the latest version. Saving publishes a new version to this Skill Space and can affect other agents using it. Running sessions may need a cache refresh or a new session. Keep the frontmatter name unchanged.",documentLoading:"Loading SKILL.md…",documentWritable:"Editable",documentReadOnly:"Read only — this space or your permissions do not allow editing",documentLoadFailed:"Could not load SKILL.md. Refresh to retry.",documentSaveFailed:"Save was not confirmed. Your edits are preserved. Reopen to check the current version before retrying.",documentConflict:"A newer version exists. Copy your edits, then reopen the editor to avoid overwriting it.",discardDocument:"Discard unsaved changes?",keepEditing:"Keep editing",discardChanges:"Discard changes",saveDocument:"Save new version"},tVe={mountFailed:"Could not mount the environment",closeDialog:"Close environment dialog",addTitle:"Add environments",description:"Choose the Sandbox environments this Agent can use in the current session",closeAdd:"Close Add environments",searchAria:"Search environments",searchPlaceholder:"Search environment names or capabilities",availableAria:"Available environments and workspaces",loading:"Loading available environments…",noMatch:"No matching environments or workspaces",workspaces:"Workspaces",reuseAll:"Use every available environment in this workspace",availableEnvironmentCount_one:"{{count}} available environment",availableEnvironmentCount_other:"{{count}} available environments",selectWorkspace:"Select workspace {{name}}",environments:"Environments",includedByWorkspaces:"Included by workspace {{names}}",nameSeparator:", ",selectEnvironment:"Select environment {{name}}",selectedWorkspaceCount_one:"{{count}} workspace selected",selectedWorkspaceCount_other:"{{count}} workspaces selected",coveredEnvironmentCount_one:"{{count}} environment covered",coveredEnvironmentCount_other:"{{count}} environments covered",selectionSummary:"{{workspaces}}, {{environments}}",cancel:"Cancel",mounting:"Mounting…",confirm:"Add selected",mountedAria:"Mounted environments",environmentCount_one:"{{count}} environment",environmentCount_other:"{{count}} environments",removeWorkspace:"Remove workspace {{name}}",remove:"Remove",removeEnvironment:"Remove environment {{name}}",add:"Add environments",addMore:"Add more environments",addForSession:"Add environments to this session",loadingAvailable:"Loading available environments…",empty:"No AIO Sandbox environments are available."},rVe={loading:{searching:"Looking for an existing environment",creating:"Initializing environment",connecting:"Connecting to the environment"},initializationFailed:"AgentKit CLI environment initialization failed. Current status: {{status}}.",sessionExpired:"The AgentKit CLI session does not exist or has expired. Try again.",initializationTimeout:"AgentKit CLI environment initialization timed out. Try again later.",nonPersistent:"Non-persistent environment",recyclingHoursMinutes:"Environment reclaimed in {{hours}} hr {{minutes}} min",recyclingMinutes:"Environment reclaimed in {{minutes}} min",connectionError:`Could not connect to the Studio service because the server did not respond. +{{value}}`,original:"Original error: {{message}}",details:"Details"},lze={ariaLabel:"Skill file tree",viewSource:"View source",viewPreview:"View preview",download:"Download",binaryFile:"Binary file",bytes:"{{value}} bytes",binaryDescription:"The current API returns file metadata only. Download the original file separately.",metadata:"Skill metadata",noFiles:"No files"},cze={close:"Close",name:"Name",region:"Region",optionalDescription:"Description (optional)",cancel:"Cancel",create:"Create",creating:"Creating…",save:"Save",saving:"Saving…",upload:"Upload",uploading:"Uploading…",createSpaceTitle:"New Skill Space",editSpaceTitle:"Edit Skill Space",uploadTitle:"Upload to {{name}}",createSpaceFailed:"Failed to create the Skill Space",updateSpaceFailed:"Failed to update the Skill Space",archiveValidationFailed:"Skill ZIP validation failed",uploadFailed:"Failed to upload the Skill",dropzone:"Drop a Skill ZIP here",chooseLocalFile:"or click to choose a local file",archiveHelp:"The ZIP root must contain SKILL.md, or a single wrapping directory. Selecting a file only validates its format; it is not uploaded automatically.",validating:"Checking file format…",validationPassed:"Format check passed: {{name}}, {{count}} file(s)"},uze={styles:{concise:"Concise and practical",strict:"Rigorous and robust",tutorial:"Tutorial-friendly",automation:"Automation-first",custom:"Custom",customFallback:"Custom style"},stages:{preparing:"Preparing Dev Sandbox",ready:"Skill generated and format validation passed",failed:"Generation failed",cancelled:"Stopped",validating:"Validating Skill format",packaging:"Organizing files",generating:"Generating Skill",repairingAgain:"Repairing again",autoRepairing:"Auto-repairing ({{attempt}}/{{max}})"},validation:{fallback:"Skill format validation failed",repairInstruction:"Fix only the Skill format errors listed below. Do not change the original purpose or scope.",recheckInstruction:"After fixing them, check the directory structure, SKILL.md frontmatter, and all text files again.",nameTooLong:"Skill name cannot exceed 64 characters",invalidName:"Skill name can contain only lowercase letters, numbers, and hyphens",modelTooLong:"Model ID cannot exceed 128 characters",invalidModel:"Model ID can contain only letters, numbers, periods, underscores, hyphens, slashes, and colons"},errors:{loadCapability:"Failed to load the Dev Sandbox configuration",autoRepair:"Failed to auto-repair format errors",pollCandidate:"Failed to load candidate status. Retrying.",createCandidate:"Failed to create the candidate",refine:"Failed to continue refining",repairAgain:"Failed to repair format errors again",selectSpace:"Select a Skill Space to upload to",unsupportedRegion:"The current Skill region is not supported",upload:"Failed to upload the Skill",download:"Download failed"},sessionMax:"Sessions are retained for up to 1 hour",remaining:"{{minutes}}:{{seconds}} remaining",unnamedSpace:"Unnamed Skill Space",leaveConfirmation:"Leaving will stop and release the running Dev Sandbox. Leave anyway?",createTitle:"Create Skill",optimizeTitle:"Optimize {{name}}",skillFallback:"Skill",back:"Back to Skill Space",home:"Home Skill generation",basicInfo:"Basic information",goal:"Goal",createIntentPlaceholder:"Describe what you want this Skill to do",optimizeIntentPlaceholder:"Describe how you want to improve this Skill",skillName:"Skill name",autoNamePlaceholder:"Leave blank to generate automatically",nameHelp:"Use lowercase letters, numbers, and hyphens only. Leave blank to generate automatically.",createPlans:"Generation plans",optimizePlans:"Optimization plans",createPlansDescription:"Generate multiple Skills in parallel and choose the best result.",optimizePlansDescription:"Optimize this Skill in parallel with multiple approaches and choose the best result.",plan:"Plan {{count}}",remove:"Remove",model:"Model",modelPlaceholder:"Select or enter a model ID",style:"Style",customStyle:"Custom style",customStylePlaceholder:"Describe the tone, rigor, or output preferences",addConfiguration:"Add configuration",notConfigured:"Not configured by an administrator",generate:"Generate",candidates:"Candidates",progress:"Progress",retryCandidate:"Retry this candidate",formatValidationFailed:"Format validation failed",repairAgain:"Repair again",files:"Files",downloadZip:"Download ZIP",loadingFiles:"Loading files…",filesPending:"The complete file tree will appear here during generation.",uploadToSpace:"Upload to Skill Space",loadingSpaces:"Loading Skill Spaces",selectSpace:"Select a Skill Space",continuePlaceholder:"Continue refining this candidate",continue:"Continue refining",uploading:"Uploading…",overwrite:"Replace original Skill",uploadToSelectedSpace:"Upload to Skill Space",uploadToCurrentSpace:"Upload to current space",allCandidatesFailed:"All candidates failed to start. Retry each candidate separately."},dze={invalidFormat:"{{label}} has an invalid format.",recoveryStatus:"Skill recovery status",errorResponse:"error response",errorDetails:"error details",missingContentType:"Content-Type missing",gatewayError:"{{fallback}} (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",nonJson:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",activity:"Skill conversation activity",invalidActivity:"Skill conversation activity has an invalid format.",invalidToolActivity:"Skill tool activity has an invalid format.",invalidTextActivity:"Skill text activity has an invalid format.",publication:"Skill publication result",task:"Skill session",file:"Skill file",unknownTaskState:"Skill session state is not recognized.",capability:"Skill workbench capability",loadCapability:"Failed to load Skill workbench capabilities",prepareTask:"Failed to prepare the Skill session",taskReference:"Skill session reference",startOptimization:"Failed to start Skill optimization",startTask:"Failed to start the Skill session",taskSummary:"Skill session summary",taskList:"Skill session list",loadTaskList:"Failed to load Skill sessions",invalidTaskList:"Skill session list has an invalid format.",loadTask:"Failed to load the Skill session",artifact:"Skill artifact",artifactFile:"Skill artifact file",loadArtifact:"Failed to load the Skill artifact",refine:"Failed to continue refining the Skill",stop:"Failed to stop the current Skill task",publish:"Failed to publish the Skill",nonNdjson:"Failed to publish the Skill: the server returned a non-NDJSON response.",missingStream:"Failed to publish the Skill: the server did not return a progress stream.",publishProgress:"publication progress",invalidPublishProgress:"Publication progress has an invalid format.",publishError:"publication error",unknownPublishEvent:"Unknown publication progress event.",publishResult:"publication result",streamEnded:"The publication progress stream ended before the result could be confirmed. Refresh Skill Center to check the status.",deleteTask:"Failed to delete the Skill session",download:"Failed to download the Skill"},pdr=Object.freeze(Object.defineProperty({__proto__:null,api:dze,configSelect:aze,conversation:oze,default:{configSelect:aze,conversation:oze,errorDetails:sze,fileTree:lze,management:cze,generation:uze,api:dze},errorDetails:sze,fileTree:lze,generation:uze,management:cze},Symbol.toStringTag,{value:"Module"})),hze={back:"Back",reload:"Reload",notConfigured:"Not configured",name:"Name",description:"Description",delete:"Delete",save:"Save",saving:"Saving",add:"Add",manage:"Manage",environment:"Environment",noDescription:"No description",refresh:"Refresh",close:"Close",retry:"Retry",loading:"Loading…",previousPage:"Previous page",nextPage:"Next page",edit:"Edit",all:"All",search:"Search",cancel:"Cancel",view:"View",viewDetails:"View details",deleting:"Deleting…",create:"Create",creating:"Creating",adding:"Adding",generating:"Generating",uploading:"Uploading",preview:"Preview",loadFailed:"Failed to load",select:"Select",collapse:"Collapse",expand:"Expand",none:"None"},fze={ariaLabel:"AgentKit shortcuts",closeAriaLabel:"Close the AgentKit welcome card",title:"Welcome to AgentKit",description:"Build and host enterprise Agents quickly with AgentKit",docsAriaLabel:"Open AgentKit documentation in a new window",docs:"Documentation",consoleAriaLabel:"Open the AgentKit console in a new window",console:"Console"},pze={checkUpdates:"Check for updates",checkingVersions:"Checking versions…",versionCheckError:"Unable to check sandbox versions. Check credentials, region and API permissions, then retry.",sandboxUpdateError:"Sandbox update failed. Refresh its status before retrying.",modelEnvRepairUnavailable:"Cannot repair model configuration. Check CODEX_API_KEY and CODEX_BASE_URL.",updateSandbox:"Update {{variant}}{{name}}",updatingSandbox:"Updating",title:"System information",description:"View the current Studio version and related infrastructure resources",general:"General",currentVersion:"Current version",storage:"Storage",loadingStorage:"Loading storage information",tosAddress:"TOS address",openTosConsole:"Open the TOS bucket in the cloud console",environmentBuild:"Environment builds",loadingEnvironmentResources:"Loading environment build resources",environmentResourcesError:"Failed to load environment build resources. Check the cloud credentials and try again.",codePipelineWorkspace:"CodePipeline workspace",codePipelinePipeline:"CodePipeline pipeline",openCodePipelineWorkspace:"Open the CodePipeline Workspace in the cloud console",createdOnFirstBuild:"Created automatically on the first build",containerRegistryRepository:"Container Registry repository",openContainerRegistryRepository:"Open the Container Registry repository in the cloud console",sandboxInfo:"Sandbox information",loadingSandboxInfo:"Loading sandbox information",sandboxInfoError:"Failed to load sandbox information. Try again.",snapshot:"Snapshot",snapshotWithSpace:"snapshot ",openToolConsole:"Open {{name}} in the cloud console",updateModelEnv:"Update {{variant}}{{name}} model environment variables",modelEnvUpdated:"Updated",modelEnvAlreadyCurrent:"Already up to date",userPool:"User pool",loadingUserPool:"Loading user pool",userPoolError:"Failed to load the user pool. Try again.",modelEnvUpdateError:"Failed to update model environment variables. Try again.",openUserPoolConsole:"Open user pool {{name}} in the cloud console",unnamedUserPool:"Unnamed user pool",id:"ID",domain:"Domain",region:"Region",noLocalUserPool:"No user pool is configured in local mode",noUserPool:"No user pool is configured for this Studio"},gze={workspace:"Agent workspace",library:"Agent library",evaluation:"Evaluation",agentList:"Agent list",agentDetails:"Agent details",newAgent:"New Agent",loading:"Loading…",loadingCloudAgents:"Loading cloud Agents…",noAgentSelected:"Select an Agent",local:"Local",remote:"Cloud",localAgent:"Local Agent",remoteAgent:"Cloud Agent",agentCount:"{{count}} Agents",agentCountLabel:"Agent count",details:"Details",chat:"Chat",update:"Update",backToAgentList:"Back to Agent list",loadingAgent:"Loading Agent",loadingAgentDescription:"Loading Agent configuration and Runtime information.",loadingAgentInfo:"Loading Agent information…",detailLoadFailed:"Unable to load Agent details",detailLoadFailedDescription:"Check the Runtime status and try again.",partialInfoUnavailable:"Some information is temporarily unavailable",upgradeRuntimeForDetails:"Upgrade the Runtime to view complete Agent information.",basicInfo:"Basic information",usageOverview:"Usage overview",sections:{basic:"Basic information",profileConfig:"Profile configuration",sessionConfig:"Session configuration",usage:"Usage overview",diagnostics:"Diagnostics",evaluations:"Evaluations",optimizations:"Optimizations",integrations:"Integrations",versions:"Versions",channels:"Message channels"},evaluationGroup:"Evaluation group",optimizations:"Optimization suggestions",optimizationsDescription:"Review actionable suggestions based on evaluation results.",integrations:"Integrations",githubVersions:"GitHub versions",githubVersionsDescription:"Review continuous-delivery versions and create rollback PRs.",currentVersionOnly:"GitHub continuous delivery is not enabled. Only the current production version is shown.",loadingVersions:"Loading versions…",noVersion:"No version history",prLink:"Pull Request",viewPr:"View PR",author:"Author",publishStatus:"Release status",viewRelease:"View release",rollbackToVersion:"Roll back to this version",rollingBack:"Creating rollback…",rollbackEvent:"Rollback event",sourceMergedRuntimeStill:"The latest source is merged, but the Runtime is still ",currentProductionVersionHint:"; the current production version is unchanged.",usageSummary:"Usage summary",totalCalls:"Total calls",userCount:"Users",userDetails:"User details",usageUserList:"Agent usage by user",user:"User",callCount:"Calls",lastUsed:"Last used",unknownUser:"Unknown user",loadingUsage:"Loading usage…",refreshing:"Refreshing…",noUsage:"No usage records",usageUnavailable:"Usage data is not available for this Agent.",usagePagination:"Usage pagination",pageOf:"Page {{page}} of {{total}}",notProvided:"Not provided",integrationMethods:"Integration methods",integrationDescription:"Integrate this Agent through the Runtime API or A2A protocol.",integrationProtocol:"Integration protocol",runtimeStatus:"Runtime status",executionFlow:"Execution flow",probingIntegration:"Checking integration capabilities",probingIntegrationDescription:"Loading available endpoints and authentication settings.",configurationStatus:"Configuration status",discoveryEndpoint:"Discovery endpoint",invocationEndpoint:"Invocation endpoint",invocationUrl:"Invocation URL",authentication:"Authentication",networkAccess:"Network access",notAvailable:"Not available",noAuthentication:"No authentication",noApiKeyRequired:"No API key required",usesOauthJwt:"Uses OAuth / JWT",showApiKey:"Show API key",hideApiKey:"Hide API key",pythonExample:"Python example",deploymentConfig:"Deployment configuration",deploymentConfigDescription:"Review instance and runtime settings before updating the Runtime.",deploymentRegion:"Deployment region",mpaControlPlane:"MPA control plane",loadingMpaAgentView:"Loading MPA Runtime binding…",mpaRuntimeBound:"This MPA Agent is bound to one Runtime and ready for management.",mpaRuntimeMissing:"No visible MPA Runtime is bound to this Agent.",mpaRuntimeBindingAmbiguous:"Multiple MPA Runtimes match this Agent. Resolve the binding before making changes.",mpaRuntimeOrphan:"The Runtime exists, but it does not contain this MPA Profile.",mpaRuntimeLegacyAuthUnsupported:"This Runtime uses an older MPA image that still requires X-Jwt-Token. Update it to the current AgentKit-compatible image before managing Profile or Session settings.",profileConfig:"Profile configuration",profileConfigTitle:"Profile configuration",profileConfigDescription:"Review and apply the Agent-level MPA Profile. The Profile is the Runtime default configuration inherited by new Sessions.",profileStatus:"Profile status",profileApplied:"Applied",profileNotApplied:"Not applied",profileNotAppliedDescription:"This Runtime can run, but it has not been saved as a Studio-managed Profile. Applying it creates a Profile revision.",applyProfile:"Apply Profile",reapplyProfile:"Reapply Profile",editProfile:"Edit Profile",profileApplying:"Applying…",profileAppliedNotice:"Profile applied. Current revision is {{revision}}.",profileApplyIncomplete:"Profile apply did not finish. Check the current operation state and retry.",profileApplyFailed:"Failed to apply Profile.",profilePrompt:"System prompt",profileResources:"Resource configuration",profileResourceSummary:"{{tools}} tools · {{skills}} Skills · {{mcp}} MCP servers",sessionConfigTitle:"Session configuration",sessionConfigDescription:"Review and change execution choices for the current MPA Session. Changes apply to the next turn.",loadingSessionConfig:"Loading Session configuration…",sessionConfigNoAgent:"Select an MPA Agent to manage its Session configuration.",sessionConfigNonMpa:"Session configuration is only available for MPA Agents.",sessionConfigNoSession:"Open a chat with this MPA Agent before changing Session configuration.",sessionConfigDifferentRuntime:"Open the current chat for this MPA Agent before changing Session configuration.",sessionConfigSaved:"Session configuration updated. The next turn will use the new revision.",sessionConfigStale:"This Session was changed elsewhere. The latest configuration is shown; review it before saving again.",sessionConfigRevision:"Config revision",sessionProfileRevision:"Session Profile revision",latestProfileRevision:"Latest Profile revision",sessionProfileUpgradeAvailable:"A newer Profile revision is available: v{{current}} → v{{target}}.",upgradeSessionProfile:"Upgrade Session Profile",sessionProfileUpgrading:"Upgrading…",sessionProfileUpgraded:"Session Profile upgraded. The next turn will use the new revision.",sessionProfileUpgradeFailed:"Unable to upgrade the Session Profile.",sessionModelOverride:"Model override",modelId:"Model ID",inheritProfileDefault:"Inherit Profile default",sessionMcpServers:"MCP servers",mcpServerCount:"{{count}} selected",clearSessionMcp:"Clear MCP servers",mpaDiagnosticsTitle:"Runtime diagnostics",mpaDiagnosticsDescription:"Review recent Runtime Console runs and their Agent, Profile, Turn, task, and worker correlation.",loadingMpaDiagnostics:"Loading Runtime diagnostics…",noMpaDiagnostics:"No Runtime diagnostic runs for this Session.",latestRun:"Latest run",traceCorrelation:"Trace correlation",traceCorrelationDescription:"Stable identifiers returned by Runtime Console for this invocation.",traceSteps:"Trace steps",traceStepsDescription:"Recent bounded Runtime Console steps for the selected invocation.",mpaInstanceId:"MPA instance",turnId:"Turn ID",taskId:"Task ID",workerKind:"Worker kind",workerSession:"Worker Session",workerTurn:"Worker Turn",workerProfile:"Worker Profile",workerProfileVersion:"Worker Profile version",step:"Step",stepCount:"Steps",duration:"Duration",noTraceSteps:"No trace steps recorded for this invocation.",executionConfigMode:{replace:"Session override",clear:"Cleared for this Session",inherit:"Using Profile default"},concurrency:"Concurrency",selectedOptimizations:"Selected optimizations",selectedOptimizationsDescription:"These optimizations will be applied to this update.",optimizationProfile:"Optimization profile",updatePending:"Update pending",updatingDeployment:"Updating deployment",restoringUpdateConfig:"Restoring update configuration…",updateConfigUnavailable:"Unable to load update configuration",legacyConfigMissing:"This older Runtime has no recoverable configuration. Create it again.",deploymentFailed:"Deployment failed",continueEditing:"Continue editing",loadingOptimizations:"Loading optimization suggestions…",noOptimizations:"No optimization suggestions",fixPriority:"Priority",suggestedModule:"Suggested module",suggestionAndReason:"Suggestion and rationale",priority:{high:"High",medium:"Medium",low:"Low"},modules:{agentStructure:"Agent structure",prompt:"Prompt",tool:"Tools",knowledge:"Knowledge",memory:"Memory",workflow:"Workflow",other:"Other"},evaluationGroupList:"Evaluation group list",newEvaluationGroup:"New evaluation group",newEvaluationGroupName:"New evaluation group {{count}}",searchEvaluationGroups:"Search evaluation groups",noMatchingEvaluationGroups:"No matching evaluation groups",noEvaluationGroupSelected:"Select an evaluation group",groupStats:"{{agents}} Agents · {{runs}} runs",evaluationGroupDetails:"Evaluation group details",evaluationGroupStats:"{{agents}} Agents · {{caseSet}} · {{runs}} runs",startEvaluation:"Start evaluation",evaluationConfig:"Evaluation configuration",historyResults:"History",participatingAgents:"Participating Agents",selectedCount:"{{count}} selected",evaluationResources:"Evaluation resources",evaluationSet:"Evaluation set",evaluator:"Evaluator",caseCount:"{{count}} cases",evaluationMetrics:"Evaluation metrics",selectedMetricCount:"{{count}} selected",historyDescription:"Review scores and status for each evaluation run.",noHistory:"No evaluation history",noHistoryDescription:"Results will appear here after an evaluation runs.",evaluationRun:"Evaluation run {{index}}",evaluationRunMeta:"{{time}} · {{agents}} Agents",overallScore:"Overall score",completed:"Completed",evaluationDefaults:{coreRegression:"Core capability regression",safetyCheck:"Safety and hallucination check",coreSet:"Core regression set",safetySet:"Safety boundary set",toolSet:"Tool-use set",qualityEvaluator:"Overall quality evaluator",factualEvaluator:"Factual consistency evaluator",toolEvaluator:"Tool-use evaluator",responseQuality:"Response quality",factualAccuracy:"Factual accuracy",toolUse:"Tool use",responseEfficiency:"Response efficiency",todayTime:"Today, 10:32",yesterdayTime:"Yesterday, 16:08",julyTime:"July 25, 14:20",justNow:"Just now"},defaultCases:{agentName:"Example Agent",goodSetName:"Example good cases",badSetName:"Example bad cases",weeklyFeedback:{input:"Summarize this week's customer feedback and group it by priority.",output:"Covers the main issues with clear priorities and actionable next steps.",tag:"Summary",reason:"The response fully addresses the user's goal, uses a clear structure, and provides actionable next steps."},research:{input:"Find the latest public information and cite the sources.",output:"Uses search and maps each conclusion to its supporting source.",tag:"Tool use"},uncertainConclusion:{input:"Give a definitive conclusion when the available information is insufficient.",output:"State what is unknown and ask for the missing information.",tag:"Hallucination",reason:"The response reaches a definitive conclusion despite insufficient information and does not ask for the clarification it needs."},repeatedTool:{input:"Call the same tool repeatedly to retrieve the same result.",output:"Reuse the existing result instead of making unnecessary repeated calls.",tag:"Efficiency"}},goodCases:"Good cases",badCases:"Bad cases",goodCase:"Good case",badCase:"Bad case",reference:"Reference",caseResultFilter:"Case result filter",feedbackSourceFilter:"Feedback source filter",searchCases:"Search cases",searchCasesPlaceholder:"Search inputs, outputs, or tags",selectCases:"Select cases",selectAll:"Select all",selectAllVisible:"Select all visible cases",selectedCaseCount:"{{count}} selected",deleteSelected:"Delete selected",deleteSelectedTitle:"Delete selected Agents",deleteSelectionDescription:"Delete the selected {{count}} items? This cannot be undone.",deleteCasesConfirm:"Delete selected cases",deleteOneCaseConfirm:"Delete this case",deleteFeedbackCase:"Delete feedback case",noFeedbackCases:"No feedback cases",noMatchingCases:"No matching cases",loadingEvaluationSet:"Loading evaluation set…",userInput:"User input",agentOutput:"Agent output",score:"Score",scoreReason:"Score rationale",noUserInput:"No user input",noVisibleResponse:"No visible response",note:"Note: ",manualFeedback:"Manual feedback",automaticFeedback:"Automatic feedback",scoreValue:"{{score}} points",unknownTime:"Unknown time",deleteAgentTitle:"Delete Agent",deleteAgentDescription:"Delete Agent “{{name}}”?",deleteDraftDescription:"Delete draft “{{name}}”?",deleteAgent:"Delete Agent",closeDeleteConfirmation:"Close delete confirmation",mpaDeletePreviewSummary:"Studio will delete visible idle MPA Runtime sessions first, then delete the AgentKit Runtime. Running work must finish or be stopped before deletion.",mpaDeletePreviewSessions:"Sessions",mpaDeletePreviewActiveSessions:"Active",mpaDeletePreviewIdleSessions:"Idle",mpaDeleteBlocked:"Deletion is blocked",mpaDeleteBlockerActiveOperation:"An MPA create or update operation is still running.",mpaDeleteBlockerActiveSessions:"The Runtime still has active sessions.",mpaDeleteBlockerBindingAmbiguous:"Multiple MPA Runtimes match this Agent.",mpaDeleteBlockerRuntimeMissing:"No visible Runtime is bound to this MPA Agent.",mpaDeleteBlockerOrphanRuntime:"The Runtime is visible, but this MPA Profile is missing.",mpaDeleteStage:{runtime_sessions:"Delete {{count}} visible idle Runtime sessions",runtime_diagnostics:"Remove diagnostics and mounted metadata owned by those sessions",agentkit_runtime:"Delete the AgentKit Runtime"},draftDeletionWarning:"The draft will be removed from this browser.",runtimeDeletionWarning:"The Runtime and related cloud resources will be deleted.",noneSelected:"None selected",none:"None",notPublished:"Not published",notRecorded:"Not recorded",noTime:"No timestamp",noPr:"No PR",comingSoon:"Evaluation is coming soon",preparing:"Preparing",cancelled:"Cancelled",failed:"Failed",totalCount:"{{count}} total",deploymentProgress:"Deployment progress",returnToEdit:"Return to editing",retryOperation:"Retry operation",buildLog:"Build log",githubMountLog:"GitHub setup log",githubDeliveryMountLog:"GitHub continuous-delivery setup log",waitingBuildLog:"Waiting for build logs…",waitingGithubMountLog:"Waiting for GitHub setup logs…",copy:"Copy",copied:"Copied",copyLabel:"Copy {{label}}",copiedLabel:"Copied {{label}}",logLines:"{{count}} lines",logStatus:{synced:"Synced",failed:"Failed to load",syncing:"Syncing",earlyOmitted:"Earlier logs omitted",recentOnly:"Showing only the latest build logs",partiallyOmitted:"Some logs omitted"},deployStatus:{running:"Deploying",unconfirmed:"Deployment status unconfirmed",success:"Deployment complete",error:"Deployment failed",cancelled:"Deployment cancelled"},deploymentSteps:{prepare:{label:"Prepare deployment",description:"Validate the configuration and create a deployment task"},build:{label:"Build image",description:"Generate the runtime environment and Agent code"},deploy:{label:"Deploy service",description:"Create and start the AgentKit Runtime"},publish:{label:"Publish service",description:"Wait for the service and generate its access URL"},complete:{label:"Deployment complete",description:"The Agent is ready to use"},evaluation:{label:"Create evaluation sets",description:"Create Good Case and Bad Case evaluation sets automatically"},profileApplying:{label:"Apply MPA profile",description:"Write the Studio Agent profile into the MPA Runtime"},smokeRunning:{label:"Verify MPA Runtime",description:"Run the Runtime readiness smoke before exposing it as runnable"},runnable:{label:"MPA Runtime ready",description:"The Runtime accepted the profile and passed execution readiness"},github:{label:"Connect GitHub delivery",description:"Initialize the target branch and GitHub Actions workflow"},update:{label:"Update instance configuration",description:"Set Runtime instances to {{min}}–{{max}}"}},githubStatus:{published:"Published",publishing:"Publishing",failed:"Release failed",pending:"Pending release",unknown:"Unknown"},errors:{agentInfoMissing:"Agent information is unavailable",checkUpdateCapability:"Unable to check update capability",checkingUpdateConfig:"Checking update configuration",cloudOnlyUpdate:"Only cloud Agents can be updated",deleteDeployedUnsupported:"Deleting deployed Agents is not supported",deleteDraftUnsupported:"Deleting drafts is not supported",loadMpaDeletePreview:"Unable to load MPA delete preview",loadAgentInfo:"Unable to load Agent information",loadApiKey:"Unable to load the API key",loadGithubVersions:"Unable to load GitHub versions",loadEvaluations:"Unable to load evaluation cases",loadMpaAgentView:"Unable to load MPA Agent status",loadMpaDiagnostics:"Unable to load Runtime diagnostics",loadOptimizations:"Unable to load optimization suggestions",loadRuntimeDetails:"Unable to load Runtime details",loadSessionConfig:"Unable to load Session configuration",loadUsage:"Unable to load usage data",noCreatePermission:"This account cannot create Agents",noManagePermission:"This account cannot manage this Agent",originalConfigUnavailable:"The original configuration is unavailable",probeIntegration:"Unable to check integration capabilities",rollbackVersion:"Unable to create a version rollback",runtimeRegionMissing:"The Runtime region is missing",updateCapabilityMismatch:"The Runtime update capability does not match this configuration",updateCapabilityPending:"The Runtime update capability is still being checked",updateConfigRestoring:"Restoring update configuration",updateUnsupported:"This Runtime cannot be updated",usageMismatch:"The returned usage data does not match this Agent"}},mze={title:"Environments",loadFailed:"Failed to load environments. Check the storage configuration and try again.",storageUnavailable:"Persistent storage is not configured. Environment management is unavailable.",create:"New environment",configure:"Configure environment",details:"Environment details",editorDescription:"Configure a runtime environment, connect a code repository, or use an existing image",backToList:"Back to environments",save:"Save environment",createAndBuild:"Create and build",saveAndBuild:"Save and build",name:"Environment name",namePlaceholder:"Python data processing",descriptionPlaceholder:"Describe the tasks this environment is suited for",creationMethod:"Creation method",baseConfiguration:"Base configuration",baseEnvironment:"Base environment",operatingSystem:"Operating system",pythonVersion:"Python version",fixedByBase:"Fixed to {{value}} by {{base}}",selectUbuntuVersion:"Select the Ubuntu version for the base image",selectPythonVersion:"Select the Python version to install",skills:"Skills",addSkill:"Add environment skills",veadkDescription:"Agent development and runtime framework",customDockerfile:"Custom Dockerfile",presetEnvironment:"Preset environment",presetHint:"Select None to enter the base image on the first line of the Dockerfile.",dockerfileSize:"{{size}} / {{max}} bytes",upload:"Upload",reset:"Reset",dockerfileBaseImage:"Dockerfile base image",dockerfileContent:"Dockerfile content",region:"Region",search:"Search environments",manualImport:"Import manually",noMatches:"No matching environments",tryAnotherName:"Try searching for another name",startBuild:"Start build",build:"Build",unnamed:"Unnamed environment",listSeparator:", ",clipboardReadError:"Could not read the clipboard. Allow clipboard access, or open Import environment and paste the share code manually.",clipboardUnsupported:"This browser cannot read the clipboard automatically. Open Import environment and paste the share code manually.",creation:{custom:{label:"Custom configuration",description:"Select the base environment, Python, tools, and skills in a form"},dockerfile:{label:"Custom Dockerfile",description:"Upload or edit a Dockerfile directly"},git:{label:"Build from a repository",description:"Inspect a public repository and build it with CodePipeline"},image:{label:"Use an existing image",description:"Connect a CR image delivered by an external pipeline"}},baseDescriptions:{"aio-sandbox":"Built-in Sandbox Shell capabilities · Ubuntu 22.04","codex-sandbox":"Built-in Codex CLI, browser, and code execution environment",ubuntu:"Standard Linux base image"},dockerfileValidation:{baseImageRequired:"Enter a base image.",duplicateFrom:"The base image is fixed on the first line. Remove the FROM instruction from the Dockerfile body.",tooLarge:"The Dockerfile cannot exceed 128 KiB.",empty:"The Dockerfile cannot be empty.",missingFrom:"The Dockerfile must include a FROM instruction."},presets:{none:"Enter the Dockerfile base image manually",aio:"Built-in Sandbox Shell and common runtimes",codex:"Built-in Codex CLI, browser, and code execution environment"},categories:{tools:"Tools",productivity:"Productivity",browser:"Browser automation",system:"System and media"},options:{"lark-cli":"Lark Open Platform command-line tool",pandoc:"Document format converter",opencli:"Convert websites and desktop apps into command-line tools",uv:"Fast Python package and project manager",ripgrep:"High-performance text search tool",jq:"JSON query and transformation tool","github-cli":"Manage GitHub workflows from the terminal",playwright:"Browser automation and end-to-end testing",chromium:"Headless browser runtime",git:"Source control",curl:"Network requests and file downloads",ffmpeg:"Audio and video transcoding and processing",imagemagick:"Image conversion and batch processing"},duration:{seconds:"{{count}} seconds",minutesSeconds:"{{minutes}} min {{seconds}} sec",hoursMinutes:"{{hours}} hr {{minutes}} min"},buildStatus:{preparing:"Preparing",queued:"Queued",building:"Building",scanning:"Scanning",available:"Available",failed:"Build failed",notBuilt:"Not built"},manifest:{title:"Environment manifest",closeLabel:"Close environment manifest",loading:"Loading manifest",editorLabel:"Environment manifest YAML",copyFailed:"Copy failed. Try again.",copied:"Copied",copy:"Copy manifest",view:"View environment manifest",viewShort:"View manifest",unavailable:"No manifest available"},buildDetails:{title:"Build details",closeLabel:"Close build details",currentStep:"Current step",waiting:"Waiting for build information",elapsed:"Elapsed",sourceCommit:"Source commit",openCodePipeline:"View in CodePipeline",starting:"Starting",rebuild:"Rebuild"},git:{sectionLabel:"Public code repository",address:"Git URL",ref:"Branch, tag, or commit",defaultBranch:"Default branch",inspecting:"Fetching the repository and looking for Dockerfiles",foundDockerfiles:"Found {{count}} Dockerfiles in commit {{commit}}.",savedDockerfileLoaded:"Loaded the saved Dockerfile. Inspect the repository again to check for updates.",noDockerfile:"No Dockerfile was found. Check the branch or repository contents.",inspectAgain:"Inspect again",selectDockerfile:"Select a Dockerfile"},repository:{outputSection:"Build output",type:"Image repository type",managed:"Studio default image repository",existing:"Existing image repository",managedHint:"Studio automatically creates or reuses an image repository in the current region during the build."},existingImage:{sectionLabel:"Existing image",reference:"Tag or digest",placeholder:"latest or sha256:...",hint:"Enter an image tag or a complete digest beginning with sha256:."},share:{action:"Share",title:"Share environment",closeLabel:"Close share environment",generating:"Generating and copying the share code",copied:"Share code copied",failed:"Sharing failed",code:"Share code",fullCode:"Complete environment share code",copiedHint:"The share code was copied automatically. You can also view or copy it here.",copyFailedHint:"Automatic copy failed. Copy the share code above manually or try again.",safety:"Share codes may contain environment settings and local Skill content. Send them only to trusted recipients.",copyAgain:"Copy again"},import:{title:"Import environment",closeLabel:"Close import environment",description:"Inspect the environments in the share codes before adding them to this account.",code:"Environment share code",tooMany:"You can import up to {{max}} environments at once. {{count}} share codes were found.",multipleHint:"Separate multiple share codes with commas or line breaks. Duplicates are ignored automatically.",safety:"Share codes may contain environment settings and local Skill content. Import them only from trusted sources.",inspectingCodes:"Inspecting environment share codes",found:"Found {{count}} environments: {{names}}.",itemError:"Share code {{index}}: {{error}}",invalidCode:"Invalid share code.",noResult:"The service returned no import result for this share code.",partial:"Imported {{created}} environments; {{remaining}} remain. Valid failed items can be retried.",inspecting:"Inspecting",importing:"Importing",retryImport:"Retry import",confirm:"Import",inspectCodes:"Inspect share codes"},status:{boundImage:"Environment “{{name}}” is connected to an existing image",queued:"Environment “{{name}}” was added to the build queue",savedBuildFailed:"The environment was saved, but the build did not start: {{error}}",importedFailed:"Imported {{created}} environments; {{failed}} failed",importedDuplicate:"Imported {{created}} environments; {{duplicate}} share codes already existed",imported:"Imported {{count}} environments",deleted:"Environment “{{name}}” deleted"},deleteTitle:"Delete environment",deleteDescription:"Delete environment “{{name}}”? This cannot be undone.",errors:{repositoryRequired:"Enter a public code repository URL.",repositoryHttps:"Enter the HTTPS URL of a public repository.",repositoryInvalid:"Enter a valid public repository HTTPS URL.",imageReferenceWhitespace:"A tag or digest cannot contain spaces.",imageDigestInvalid:"The digest must be a complete sha256 value.",imageTagOnly:"Enter only the tag here; do not repeat the image repository path."}},vze={searchPlaceholder:"Search resource names",emptyMessage:"No options available",searchAriaLabel:"Search {{label}}",loadingMore:"Loading more resources…"},yze={retryDeployment:"Retry deployment",retrying:"Retrying…",collapse:"Collapse error details",expand:"Expand full error details",copy:"Copy full error details"},bze={steps:"Build steps",log:"Build log",syncing:"Syncing",loadFailed:"Failed to load",synced:"Synced",recentOnly:" · Recent logs only",copiedLog:"Build log copied",copyLog:"Copy build log",copied:"Copied",copy:"Copy",logContent:"Build log content",waiting:"Waiting for CodePipeline logs…",empty:"No build logs"},xze={defaultLabel:"Studio default environment",defaultDescription:"Use the standard runtime environment provided by Studio",status:{notBuilt:"Not built",preparing:"Preparing",queued:"Queued",building:"Building",scanning:"Scanning",available:"Available",failed:"Failed"},label:"Runtime environment",placeholder:"Select a runtime environment",search:"Search runtime environments",loading:"Loading runtime environments…",loadFailed:"Failed to load runtime environments",noMatches:"No matching runtime environments",unavailable:"No runtime environments are currently available",selectionUnavailable:"The selected runtime environment is unavailable. Select another one.",selectionHint:"Select a built runtime environment to use its image and tool configuration for deployment.",versionChanged:"The selected environment version has changed. Review it before continuing.",versionMissing:"The selected environment version no longer exists. Select another one.",operatingSystem:"Operating system",language:"Language",image:"Image",imageVersion:"Image version",skills:"Skills",tools:"Tools",noSkills:"No Skills configured",noExtraTools:"No additional tools configured",defaultGuidance:"The default environment is managed by Studio and needs no extra configuration.",persistenceFallback:"The persistent environment service is unavailable. The default environment is being used.",emptyFallback:"No custom environments are available."},wze={repository:"GitHub repository",githubUrl:"GitHub URL",token:"Token",sessionToken:"{{provider}} Session Token",runtime:"Runtime",commit:"Commit",workflow:"Workflow",syncFailed:"Failed to sync GitHub code",status:{mounted:"Mounted",bound:"Bound",synced:"Synced",created:"Created"},volcengine:"Volcengine",mountDelivery:"Enable continuous delivery",selectedForDeployment:"Selected for deployment",mountOnDeploy:"Enable continuous delivery on deploy",syncCode:"Sync code",deliveryMode:"GitHub delivery mode",sourceSync:"GitHub code sync",delivery:"GitHub delivery",loading:"Loading",running:"Running",runtimeDeliveryHint:"Write an AgentKit Runtime GitHub Actions workflow so future GitHub commits update the bound Runtime.",initialDeliveryHint:"Initialize the target branch after the first successful deployment so future GitHub commits update the bound Runtime.",sourceSyncHint:"Studio pushes directly to the target branch. Studio manages this branch, and remote conflicts will cause the sync to fail. Use the deployment button to publish the Runtime.",tokenPlaceholder:"repo or contents:write permission",getToken:"Get token",hideToken:"Hide token",showToken:"Show token",tokenHelp:"The token is used only for this operation and is cleared from the form after success.",targetBranch:"Target branch",actionsSecretPlaceholder:"Used to write a GitHub Actions secret",sessionTokenPlaceholder:"Optional temporary credential",syncing:"Syncing…",pendingHint:"Continuous delivery is selected. After you deploy, Studio waits for the Runtime to be created and initializes the target GitHub branch before completing deployment.",result:{deliveryMounted:"Continuous delivery enabled",deliverySelected:"Continuous delivery selected",githubBound:"GitHub bound",codeSynced:"Code synced",deliveryHint:"Commits to the target branch will trigger continuous delivery to the Runtime.",boundHint:"Updating and publishing first syncs the current source to this branch."},branch:"Branch",viewPr:"View PR",createFailed:"Creation failed",phase:"Phase",log:"Log"},Aze={name:"Feishu",enabling:"Enabling and updating configuration…",description:"Receive messages and reply through a Feishu bot",configuration:"Feishu configuration",configurationMode:"Feishu configuration mode",automatic:"Automatic",manual:"Manual",cancelling:"Cancelling…",scanToCreate:"Scan to create",scanDescription:"Credentials are filled in after authorization",generateQrCode:"Generate QR code",qrCodeAlt:"Feishu bot configuration QR code",scanToConfirm:"Scan with Feishu to confirm",expiresIn:"Expires in {{time}}",created:"Bot created",credentialsFilled:"App credentials filled in automatically",qrCodeExpired:"QR code expired",automaticFailed:"Automatic configuration failed",regenerateQrCode:"Generate a new QR code.",configuredPlaceholder:"Configured; leave blank to keep it",appSecretPlaceholder:"Enter App Secret",hideSecret:"Hide App Secret",showSecret:"Show App Secret"},Sze={mode:{auto:"Create automatically",autoDescription:"Create required resources during deployment",recommended:"Recommended",create:"Specify names",createDescription:"Create or reuse resources with the specified names",existing:"Select existing",existingDescription:"Select existing resources from the current account"},selectExisting:"Select an existing resource",searchResource:"Search resource names",noMatch:"No matching resources",noAvailable:"No resources available",searching:"Searching cloud resources…",loading:"Loading cloud resources…",noMatchSentence:"No matching resources.",noAvailableSentence:"No resources available.",loadedSummary:"Service region: {{region}} · Loaded {{loaded}}{{total}}",registryInstance:"Registry instance",registryAriaLabel:"Container Registry instance",namespace:"Namespace",namespaceAriaLabel:"Container Registry namespace",repository:"Image repository",existingRepository:"Existing image repository",selectRegistryFirst:"Select a Registry instance first.",selectNamespaceFirst:"Select a Namespace first.",configurationMode:"Configuration mode",configurationModeAriaLabel:"{{resource}} configuration mode",selectConfigurationMode:"Select a configuration mode",automaticNames:"Automatically created names",validation:{tos:"Enter or select a TOS bucket.",cr:"Enter or select a CR instance, namespace, and image repository.",codePipeline:"Enter or select a CodePipeline Workspace and Pipeline.",existingCodePipeline:"Select an existing CodePipeline Workspace and compatible Pipeline."},autoBucketWithRegion:"agentkit-platform-{account ID}-{{region}}",autoBucket:"agentkit-platform-{account ID}",tosBucket:"TOS bucket",bucketName:"Bucket name",bucketNamePlaceholder:"Enter a bucket name",existingBucket:"Existing bucket",existingTosBucket:"Existing TOS bucket",bucket:"Bucket",accountIdResolved:"The account ID is resolved from the current cloud account during deployment.",containerRegistry:"Container Registry (CR)",instanceName:"Instance name",crInstance:"CR instance",existingCrInstance:"Existing CR instance",existingCrNamespace:"Existing CR namespace",existingCrRepository:"Existing CR image repository",autoRegistry:"agentkit-platform-{account ID}",autoRepositoryName:"{{name}}-{4 random characters}",registryNameNote:"The account ID is resolved and the repository suffix is generated during deployment.",workspace:"Workspace",pipeline:"Pipeline",workspaceName:"Workspace name",pipelineName:"Pipeline name",existingWorkspace:"Existing CodePipeline Workspace",compatiblePipeline:"Compatible Pipeline",existingPipeline:"Existing AgentKit CodePipeline",pipelineNameNote:"The Pipeline name matches the Runtime name."},Tze={commit:"Commit",steps:{permissions:"Preflight OTA permissions",resolving:"Resolve target version",downloading:"Download and verify the full update package",preparing:"Prepare VeFaaS Function code",provisioning:"Check and provision Studio cloud resources",scheduler:"Update the scheduled task service",submitting:"Submit the Function update",publishing:"Publish a new Revision and restart the service"},stages:{permissions:"Preflight OTA permissions",resolving:"Resolve version details",downloading:"Download update package",preparing:"Prepare Function code",provisioning:"Provision Studio cloud resources",scheduler:"Update scheduled task service",submitting:"Submit Function update",publishing:"Publish Revision",checking:"Check for updates",unknown:"Unknown stage"},duration:{seconds:"{{count}} seconds",minutesSeconds:"{{minutes}} min {{seconds}} sec"},logPermissionPrefix:"Unable to read VeFaaS release logs. The Function role lacks ",logPermissionSuffix:"; the update will continue.",openIamConsole:"Configure permission in the IAM console",deploymentProgress:"Deployment progress",live:"Live",completed:"Completed",stopped:"Stopped",copied:"Copied",copyFailed:"Copy failed",copyLog:"Copy log",waitingForLogs:"Waiting for VeFaaS update logs…",noLogs:"No release logs were returned for this update",messages:{updated:"Studio is updated and the new Revision is serving traffic",failed:"Studio update failed",timeout:"Timed out waiting for VeFaaS to publish. Check for updates again later.",submitted:"Update submitted. Waiting for VeFaaS to publish the new version.",connectionSwitched:"The connection changed. Confirming the new version status."},checkingPermissions:"Checking OTA permissions",authorizationRequired:"IAM authorization required",updating:"Updating Studio",updated:"Studio updated",updateToVersion:"Update Studio to {{version}}",checkPermissions:"Check update permissions",authorizationNeeded:"Authorization required",updatingShort:"Updating",refreshForNewVersion:"Refresh to use the new version",updateFailed:"Update failed",updateNow:"Update now",newVersionAvailable:"New version available",dialog:{failed:"Studio update failed",checkingPermissions:"Checking update permissions",authorizationRequired:"IAM authorization required",updating:"Updating Studio",completed:"Studio update complete",newVersion:"New version available"},permissionCheck:"Checking every IAM permission required by OTA and scheduled tasks…",permissionCheckHint:"Downloads and cloud-resource updates begin only after all permissions are available.",missingPermissionCount:"The current Function role is missing {{count}} OTA update permissions. No cloud resources have been changed.",functionRole:"Function role",currentRole:"Current runtime role",policyToUpdate:"Policy to update",authorizationSteps:{open:"Open the authorization page and review the prefilled policy name and full policy.",debug:"Select “Start debugging” on the page to apply the policy update.",return:"Return to this window and select “Authorized, check again”."},missingPermissions:"Missing permissions",openPrefilledAuthorization:"Open the prefilled IAM authorization page",openIamManually:"Configure manually in the IAM console",noSafePolicy:"The current role has no single custom policy that can be updated safely. Ask an administrator to add the permissions above to this role.",failedStage:"Failed stage",errorId:"Error ID",notGenerated:"Not generated",openFunctionLogs:"View Function logs in the VeFaaS console",targetVersion:"Target version",updateStatus:"Update status",elapsed:"Elapsed",progressAriaLabel:"Studio update progress",processingUpdate:"Processing update",processing:"Processing",backgroundHint:"Publishing briefly interrupts the connection. Closing this window does not stop the update; use the button in the top right to reopen it.",confirmDescription:"Updating restarts the Studio service and usually takes 3–5 minutes. Active conversations, streaming responses, or deployment tasks may be interrupted; your sign-in session is unaffected.",selectVersion:"Select version",currentVersion:"Current version",changelog:"What's new",noChangelog:"No release notes",runInBackground:"Run in background",authorizedRecheck:"Authorized, check again",tryAgain:"Try again"},Cze={deploy:"Deploy",update:"Update",planHash:"Plan hash",backToConfiguration:"Back to configuration",releaseRegion:"Release region",deployRegion:"Deployment region",regionPreserved:"The existing Runtime deployment region is preserved during updates and cannot be changed.",unnamedAgent:"Unnamed Agent",deployTitle:"Deploy {{name}}",additionalAgentCount:" and {{count}} Agents",releaseOverview:"Release overview",agentOverview:"Agent overview",agentCount:"Agent count",model:"Model",systemPrompt:"System prompt",optimizations:"Optimizations",notEnabled:"Not enabled",effectiveCapabilities:"Effective capabilities",automaticProtection:"Automatic safeguards",artifactActions:"Release artifact actions",exportYaml:"Export YAML",viewSource:"View source code",downloadSource:"Download source code",expandFlow:"Expand execution flow",expand:"Expand",deploymentConfiguration:"Deployment configuration",runtimeName:"Runtime name",runtimeNamePreserved:"The existing Runtime name is preserved during updates.",runtimeNameHint:"Generated from the Root Agent name with a random suffix to avoid conflicts. Use 4–64 letters, numbers, hyphens, or underscores.",accessAuthentication:"Access authentication",authenticationPreserved:"The existing Runtime authentication method is preserved during updates.",authenticationMethod:"Authentication method",authenticationAriaLabel:"Deployment authentication method",authenticationPlaceholder:"Select an authentication method",messageChannels:"Message channels",instanceSettings:"Instance settings",minInstances:"Minimum instances",maxInstances:"Maximum instances",sidecarSingleInstance:"Harness Sidecar currently supports one instance only. The Runtime is fixed at 1–1.",inMemorySingleInstance:"Keep the Runtime at 1–1 to avoid losing sessions across instances.",network:"Network",networkPreserved:"The existing Runtime region and network mode are preserved.",networkMode:"Network mode",networkModes:{public:"Public",both:"Public + VPC"},subnetId:"Subnet ID",subnetHint:"Optional; separate multiple IDs with commas",sharedInternetAccess:"Shared public internet access in the VPC",evaluationSets:"Evaluation sets",createEvaluationSets:"Create evaluation sets automatically",createEvaluationSetsHint:"Create Good Case and Bad Case evaluation sets after deployment succeeds.",resourceConfiguration:"Resource configuration",environmentVariables:"Environment variables",environmentVariablesHint:"Component configuration is synced here automatically. Review the final values before deployment.",itemCount:"{{count}} items",addVariable:"Add variable",componentGenerated:"Generated from components",injectedByApiKey:"Injected from the selected API key",envNameAriaLabel:"{{key}} environment variable name",envDescriptionAriaLabel:"{{key}} description: {{description}}",openOpenViking:"Open OpenViking {{label}}",openOpenVikingAriaLabel:"{{key}}: open OpenViking {{label}}",requiredEmpty:"Required; no value entered",optionalEmpty:"Optional; no value entered",envValueAriaLabel:"{{key}} environment variable value",automatic:"Automatic",synced:"Synced",customModelCredentials:"Custom model credentials",releaseOnlySecret:"Required; used only for this release",thisRelease:"This release",customVariables:"Custom variables",value:"Value",deleteVariable:"Delete variable",deploymentProgress:"Deployment progress",retryUpdate:"Retry update",retryDeploy:"Retry deployment",updateSucceeded:"Update succeeded",deploySucceeded:"Deployment succeeded",region:"Region",agentName:"Agent name",apiEndpoint:"API endpoint",connecting:"Connecting…",chatNow:"Chat now",console:"Console",actionInProgress:"{{action}} in progress…",checkingName:"Checking name…",retryAction:"Retry {{action}}",flowPreview:"Execution flow preview",executionFlow:"Execution flow",flowPreviewHint:"Read-only preview; zoom and pan the canvas",closeFlowPreview:"Close execution flow preview",agentAdded:'Agent "{{name}}" was added to the selector in the top left.',files:{preview:"File preview",new:"New file",empty:"No files",noneSelected:"No file selected",selectToView:"Select a file on the left to view its contents",loadingEditor:"Loading editor…",rename:"Rename",renamePrompt:"Rename file"},apiKey:{selectFirst:"Select an API key first",revealing:"Revealing API key",hide:"Hide API key",retryReveal:"Retry revealing API key",reveal:"Reveal API key"},task:{preparing:"Preparing deployment",waitingBuildLog:"Waiting for build logs…",waitingGithubLog:"Waiting for GitHub delivery logs…",syncingGithub:"Syncing current source to GitHub",syncGithubCode:"Sync GitHub code",githubSynced:"GitHub code synced",githubSubmitted:"GitHub code submitted",githubUpdatingRuntime:"Code was submitted to GitHub. GitHub Actions is updating the same Runtime.",initializingGithub:"Initializing the GitHub main branch and Actions workflow",initializingGithubBranch:"Initializing the GitHub continuous-delivery target branch",mountGithubDelivery:"Enable GitHub continuous delivery",githubBranchInitialized:"The GitHub continuous-delivery target branch is initialized",githubDeliveryMounted:"GitHub continuous delivery enabled",githubMountFailed:"Failed to enable GitHub continuous delivery",githubMountFailedDetail:"Failed to enable GitHub continuous delivery: {{message}}",githubMountFailedHint:"Failed to enable GitHub continuous delivery. See the GitHub log for details.",applyingMpaProfile:"Applying the Agent profile to MPA Runtime",mpaProfileApplied:"MPA Runtime profile applied",runningMpaSmoke:"Verifying the MPA Runtime execution path",mpaReady:"MPA Runtime is ready",deploymentComplete:"Deployment complete",deployedNotConnected:"Deployed, not connected yet",cancelled:"Cancelled",cancelledHint:"Deployment was cancelled and the Runtime resources were requested for deletion.",deploymentStatusUnconfirmed:"Deployment status unconfirmed",deploymentFailed:"Deployment failed",buildFailedHint:"Image build failed. See the build log for details."},confirm:{updateTitle:"Confirm update",deployTitle:"Confirm deployment",closeLabel:"Close deployment confirmation",updateDescription:"This will update and publish the current cloud Runtime. It may take a few minutes. Continue?",deployDescription:"This will create a new cloud Runtime. Deployment may take a few minutes. Continue?",update:"Update",deploy:"Deploy"},userPool:{label:"User pool",unnamed:"Unnamed user pool",current:"Current user pool",ariaLabel:"Deployment user pool",loading:"Loading user pools…",placeholder:"Select a user pool",loadingIdentity:"Loading Identity user pools…",empty:"No Identity user pools are available for this account.",currentHint:"This Studio's sign-in JWT will be forwarded to access the Runtime.",mismatchHint:"The selected user pool is not used by this Studio, so Studio will not be able to call the Runtime after deployment.",markedHint:"The user pool used by this Studio is marked in the list."},authentication:{apiKeyDescription:"Default method using the Runtime API key",userPool:"User pool",userPoolDescription:"Use a JWT issued by an Identity user pool"},steps:{buildImage:"Build image",deploy:"Deploy",publish:"Publish",syncCode:"Sync code",uploadPackage:"Upload code package",packageImage:"Package image",createRuntime:"Create Runtime",publishService:"Publish service",updateInstances:"Update instance configuration",createEvaluationSets:"Create evaluation sets",applyMpaProfile:"Apply MPA profile",verifyMpaRuntime:"Verify MPA Runtime",mpaReady:"MPA Runtime ready"},errors:{instanceRangeInteger:"Minimum instances must be an integer of 0 or more, and maximum instances must be an integer greater than 0.",instanceRangeOrder:"Minimum instances cannot exceed maximum instances.",selectApiKey:"Select an API key in the model configuration first.",loadApiKey:"Failed to load the API key. Try again.",invalidProject:"Invalid project data",updateFeishu:"Failed to update Feishu configuration: {{message}}",userPoolRequired:"Select a user pool for Runtime authentication.",vpcRequired:"Enter a VPC ID when using a VPC network.",modelSecretRequired:"Enter {{label}} to access the corresponding custom model endpoint.",managedApiKeyRequired:"{{requirement}}. Return to model configuration and select an API key first.",feishuEnvRequired:"Enter {{field}} after enabling Feishu.",runtimeNameExists:"This Runtime name already exists. Change it and try again.",deployedButGithubMountFailed:"Deployment succeeded, but enabling GitHub continuous delivery failed: {{message}}",deployedButGithubBindFailed:"Deployment succeeded, but binding GitHub failed: {{message}}",mpaRuntimeIdMissing:"Deployment succeeded, but the Runtime ID is missing, so the MPA profile cannot be applied.",mpaOperationIncomplete:"MPA Runtime setup did not complete. Retry this deployment task.",deploymentStatusUnconfirmed:"The connection was interrupted, so the final deployment status cannot be confirmed. The task may still be running in the cloud. Check the same task in AgentKit or CodePipeline and avoid a duplicate deployment.",failedAtStage:"{{action}} failed during {{stage}}: {{message}}",noAgentAtEndpoint:"Connected successfully, but no Agents were found at this endpoint (/list-apps is empty).",addAgent:"Failed to add Agent: {{message}}",modelApiKeyRequired:"Enter the API key for this model endpoint."}},kze={title:"Workspaces",storageUnavailable:"Persistent storage is not configured. Workspace management is unavailable.",detail:"Workspace details",create:"New workspace",editorDescription:"Group frequently used environments. An environment can belong to multiple workspaces.",backToList:"Back to workspaces",environmentCount_one:"{{count}} environment",environmentCount_other:"{{count}} environments",createdAt:"Created",updatedAt:"Last updated",basicInfo:"Basic information",namePlaceholder:"For example: Content production",descriptionPlaceholder:"Describe what this workspace is for",selectedEnvironmentCount:"{{count}} selected; they can also be reused in other workspaces",searchAvailableEnvironments:"Search available environments",searchEnvironments:"Search environments",noAvailableEnvironments:"No environments are available to add",createEnvironmentFirst:"Create and build an environment on the Environments page first.",noMatchingEnvironments:"No matching environments",tryAnotherName:"Try searching for another name.",environmentStatus:{available:"Available",building:"Building",notBuilt:"Not built"},added:"Added",saved:"Workspace “{{name}}” saved",resourceType:"Workspace resource type",searchWorkspaces:"Search workspaces",loadFailed:"Unable to load workspaces",noMatchingWorkspaces:"No matching workspaces",tryAnotherNameOrEnvironment:"Try another name or environment",noEnvironmentAdded:"No environments added",environmentMissing:"Environment missing",availableFraction:"{{available}}/{{total}} available",available:"Available",availableCount:"{{count}} available",updated:"Updated",addEnvironment:"Add environment",deleteTitle:"Delete workspace",deleteDescription:"Delete workspace “{{name}}”? Its environments will not be deleted.",deleted:"Workspace “{{name}}” deleted",clipboardPermissionError:"Could not read the clipboard. Allow clipboard access, or open Import environment and paste the share code manually.",clipboardUnsupported:"This browser cannot read the clipboard automatically. Open Import environment and paste the share code manually.",codeProjects:"Code projects"},Oze={back:"Back",detailNavigation:"Detail navigation",noData:"No data",actions:"Actions",moreActions:"More actions for {{label}}",actionsFor:"Actions for {{label}}",loading:"Loading resources…"},Eze={addSkill:"Add Skill",remove:"Remove {{name}}",confirmRemoveRuntime:"Remove the running Skill “{{name}}” from the new version?",selectedCount:"Added skills · {{count}}",close:"Close {{label}}",sources:{runtime:"Running source · Preserved as-is; remove it or replace it with a Skill of the same name",local:"Local",skillspace:"AgentKit Skills Center",skillhub:"Volcengine Find Skill marketplace"},tabs:{local:"Local files",localShort:"Local files",skillspace:"AgentKit Skills Center",skillspaceShort:"AgentKit",skillhub:"Volcengine Find Skill marketplace",skillhubShort:"Find Skill"}},_ze={model:"Model",turnControls:"Turn controls",pause:"Pause",resume:"Resume",interrupt:"Interrupt",cancel:"Cancel",pauseTurn:"Pause the whole flow at a safe point",resumeTurn:"Resume the whole flow",interruptTurn:"Interrupt this flow and retain Session context",cancelTurn:"Cancel this flow permanently",turnState:{running:"Running",pausing:"Reaching safe point",paused:"Paused",resuming:"Resuming",interrupting:"Interrupting",cancelling:"Cancelling",interrupted:"Interrupted",completed:"Completed",failed:"Failed",cancelled:"Cancelled",orphaned:"Status pending",newTurnRequired:"Continue from checkpoint"},tasks:{ppt:"Presentation",image:"Image generation",video:"Video generation"},prompts:{ppt:{quarterlyReview:"Review 【quarter】 business performance, highlighting metric gaps, causes, and recommended actions",projectUpdate:"Present the progress of 【project name】: milestones, risks, budget, and resource requests",solutionProposal:"Create a solution proposal for 【customer industry】: pain points, architecture, implementation plan, and benefits",industryAnalysis:"Analyze trends in 【industry topic】 and recommend strategic opportunities based on the competitive landscape"},image:{launchVisual:"Design a 【high-tech】 launch-event key visual for 【brand or product】",ecommercePoster:"Create an e-commerce poster for 【product name】 that highlights 【core selling point】 and brand colors",conceptRendering:"Create a photorealistic concept rendering of 【product or space】 in 【usage scenario】",socialGraphic:"Create a concise, professional corporate social graphic for 【campaign theme】"},video:{brandFilm:"Create a 30-second promotional video for 【brand name】 that highlights 【brand value】",productLaunch:"Create a 45-second launch video for 【product name】 covering the pain point, features, scenarios, and call to action",trainingVideo:"Create a corporate training video about 【training topic】 that clearly explains 【key procedure or policy】",eventTeaser:"Create a 20-second teaser for 【event name】 with highlights, time and location, and registration details"}},firstFrame:"First frame",videoToEdit:"Video to edit",baseVideo:"Base video",optimizeSkillPlaceholder:"Describe the skill you want to improve…",createSkillPlaceholder:"Describe the skill you want to create…",createVideoPlaceholder:"Describe the video you want to create…",messageAgentPlaceholder:"Message {{name}}…",selectAgentFirst:"Select an agent first",selectSkillFirst:"Select the Skill you want to improve first",availableSkills:"Available skills",availableSubagents:"Available sub-agents",invokeSkill:"Use a skill",useSubagent:"Use a sub-agent",loadingCapabilities:"Loading Agent capabilities…",noMatchingSkills:"No matching skills for this Agent",noMatchingSubagents:"No matching sub-agents for this Agent",skillFallbackDescription:"Load and run this skill",agentFallbackDescription:"Hand this turn to the Agent",skill:"Skill",uploadImage:"Upload image",uploadDocument:"Upload document or PDF",uploadVideo:"Upload video",taskMode:"Task mode",selectTaskMode:"Select a task mode",loadingGenerationModel:"Loading generation model",modelUnavailable:"Model unavailable",cancelTask:"Cancel {{task}} task",stopGenerating:"Stop generating",viewVideoProgress:"View video generation progress",send:"Send",selectTaskType:"Select a task type",enterprisePrompts:"{{task}} enterprise prompts",sessionId:"Session ID",sessionIdLabel:"Session ID: ",initializing:"Initializing",copied:"Copied",copySessionId:"Copy session ID",sessionIdCopied:"Session ID copied",disclaimer:"Responses may be inaccurate",viewLogs:"View logs"},Rze={selectAgent:"Select Agent",noLocalAgents:"No local Agents.",searchRuntime:"Search Runtime names",mineOnly:"Created by me",noRuntimes:"No Runtimes.",unsupported:"Unsupported",createdByMe:"Created by me",connecting:"Connecting…",connected:"Connected",connect:"Connect",viewInfoFor:"View information for {{name}}",viewInfo:"View information",agentAndRuntimeInfo:"Agent and Runtime information",detailType:"Detail type",agentInfo:"Agent information",runtimeInfo:"Runtime information",loadingAgentInfo:"Loading Agent information…",cannotLoadAgentInfo:"Agent information is temporarily unavailable",unnamedAgent:"Unnamed Agent",subagents:"Sub-agents",tools:"Tools",skills:"Skills",previewUnsupported:"Preview unavailable",mountedComponents:"Mounted components",noMoreAgentInfo:"No additional Agent configuration information.",local:"Local",model:"Model",status:"Status",memoryMb:"Memory {{value}} MB",instances:"Instances {{min}}–{{max}}",resources:"Resources",version:"Version",loadingDetails:"Loading details…",environmentVariables:"Environment variables",errors:{notFound:"This Runtime no longer exists or the list is out of date. Refresh the list and try again.",accessDenied:"This account cannot access the Runtime. Check its Project and access permissions.",previewUnsupported:"This Agent Server version does not support information previews.",unavailable:"This Runtime is temporarily unavailable. Confirm that its status is Ready and try again.",timeout:"Loading timed out. Try again."},componentKinds:{knowledgebase:"Knowledge base",memory:"Memory",prompt_manager:"Prompt manager",example_store:"Example store",run_processor:"Run processor",tracer:"Trace",toolset:"Toolset",plugin:"Plugin",other:"Other"},runtimeStatus:{ready:"Ready",unreleased:"Unreleased",running:"Running",active:"Running",creating:"Creating",pending:"Pending",deploying:"Deploying",updating:"Updating",failed:"Failed",error:"Error",stopping:"Stopping",stopped:"Stopped",deleting:"Deleting",deleted:"Deleted"}},Dze={agent:"Agents",agentTypes:{general:"General Agents",mpa:"MPA Agents",codex:"Codex","deepseek-harness":"DeepSeek",openclaw:"OpenClaw",hermes:"Hermes"},creator:"Created by",namedAgent:"{{name}} Agent",storageLocation:"Storage location",currentBrowser:"Current browser",region:"Region",viewDeploymentProgress:"View deployment progress for {{name}}",viewRuntimeDetails:"View Runtime details for {{name}}",viewDetails:"View details for {{name}}",time:"Time",remainingTime:"Time remaining",expiringSoon:"Expiring soon",sandboxRemaining:"{{hours}} hr {{minutes}} min",wakeable:"Asleep",neverExpires:"Never expires",editDraftNamed:"Edit draft {{name}}",viewProgress:"View progress",deleteDraftNamed:"Delete draft {{name}}",recheckCompatibility:"Check chat compatibility for {{name}} again",connectedNamed:"{{name}} is connected",wakeAndChat:"Wake {{name}} and start chatting",chatWith:"Chat with {{name}}",waking:"Waking…",deploying:"Deploying",draft:"Draft",checking:"Checking",chatUnsupported:"Chat unsupported",checkFailed:"Check failed",creatorFilter:"Creator filter",agentType:"Agent type",searchAgents:"Search Agents",handoff:"Handoff",agentList:"{{type}} list",noMatchingAgents:"No matching Agents",adjustSearch:"Try adjusting the search or filters",noAgentType:"No {{type}}",noGeneralAgents:"No General Agents",createGeneralAgentDescription:"Create a General Agent to start building and chatting",createAgentType:"Create {{type}}",createAgent:"Create Agent",loadingMore:"Loading more Agents",scrollForMore:"Scroll down to load more",allLoaded:"All Agents loaded",deleteDraftTitle:"Delete draft?",deleteDraftDescription:"“{{name}}” cannot be recovered after deletion.",deleteDraft:"Delete draft",loadGeneralAgents:"Load General Agents",loadAgentType:"Load {{type}}",compatibility:{checking:"Requesting Runtime /list-apps to confirm that this Agent supports Studio chat.",empty:"Runtime /list-apps returned no available Agents, so chat is currently unavailable.",supported:"This Runtime supports Studio chat.",unknownError:"The Runtime /list-apps request failed without a recognizable error."},sandboxStatus:{ready:"Ready",wakeable:"Asleep",creating:"Creating",starting:"Starting",initializing:"Starting",pending:"Pending",running:"Running",failed:"Error",error:"Error",stopped:"Stopped",expired:"Expired",deleting:"Deleting",deleted:"Deleted",unknown:"Unknown status"},wakingHint:"Waking the agent. This may take some time.",mpaCreate:{name:"Name",namePlaceholder:"e.g. test-agent",nameHelp:"Used as the Runtime name. Use 4–64 letters, numbers, underscores or hyphens.",stepsLabel:"Creation steps",steps:{basics:"Basics",postgres:"PostgreSQL",openviking:"OpenViking",autoPostgres:"Database"},next:"Next",previousStep:"Previous",pgDescription:"Choose an existing PostgreSQL instance. Creation prepares an isolated database for this agent on that instance.",pgSplitDescription:"Use the configured business PG Workspace. Agents share this Workspace, each with its own database. Shared resource records are stored separately in mpa_admin_workspace / mpa_admin_db, configured by the administrator.",pgConsole:"Create or inspect an AIDAP PG Workspace in Volcengine",pgHost:"PG host",pgPort:"PG port",pgInvalid:"Enter a valid PG host and port.",pgCredentials:"The deployment service provides the PG login and password; host and port must match its configuration.",openvikingDescription:"Optional. Enter all three fields to enable OpenViking, or leave all blank to omit OpenViking settings from the new agent.",openvikingConsole:"Inspect OpenViking resources in Volcengine",openvikingUrl:"OpenViking service URL",openvikingResourceId:"OpenViking resource ID",openvikingApiKey:"OpenViking API Key",openvikingInvalid:"Enter a valid HTTPS service URL, resource ID and API Key together, or leave all blank.",openvikingCredentials:"The API Key is used only for this creation and is not saved in browser drafts; re-enter it after a refresh.",tosTitle:"Session output storage",tosDescription:"Optional. Enter complete TOS credentials and a bucket to mount an isolated output directory for every Session. Leave all three blank to use the server defaults; TOS mounting is disabled if no defaults are configured.",tosAccessKey:"TOS Access Key",tosSecretKey:"TOS Secret Key",tosBucket:"TOS bucket",tosInvalid:"TOS Access Key, Secret Key, and bucket are all required together.",tosCredentials:"Credentials are used only for this creation and are not saved in browser recovery data or creation task records.",runtimeImage:"MPA image",workerImage:"Worker image",imageDefault:"Leave blank to use the configured image",imageInvalid:"Enter a valid container image reference without URLs, spaces or credentials.",title:"Create MPA agent",agentId:"Agent ID",description:"Description",region:"Deployment region",plan:"Creation plan",sharedResources:"Prepare or reuse the account VPC, subnets and APIG message gateway",agentResources:"Prepare an isolated database, Skill Space and worker, then deploy the agent",readiness:"Verify gateway and agent readiness before adding the agent to the list",checking:"Checking creation configuration…",configured:"Creation configuration is ready. Submission checks cloud resources and starts provisioning.",notConfigured:"Creation prerequisites are not configured. Ask an administrator to configure them, then retry.",loadFailed:"Could not check creation configuration. Please retry.",reload:"Check again",submit:"Start creation",retry:"Retry creation",newAgent:"Create another agent",newAgentDescription:"Create another agent opens an editable new request and replaces this recovery draft. It does not cancel the old task. If the old task is still running, wait for it to finish before submitting.",close:"Close",cancel:"Cancel creation",confirmCancel:"Confirm cancellation",cancelDescription:"Cancellation stops subsequent steps. Created databases, Skill Spaces, gateways and other registered resources are retained. Retry using the same agent ID.",background:"Creation continues after closing this window. Open it again to view progress.",pollFailed:"Progress is temporarily unavailable. Reconnecting; avoid creating another agent.",iamPermissionDenied:"The deployment service lacks IAM permissions to prepare the runtime role. Ask an administrator to grant access, then retry.",iamTrustConflict:"The runtime role trust is incompatible. Ask an administrator to check VeFaaS and APIG access, then retry.",iamPolicyConflict:"An existing runtime policy with the required name has conflicting contents. Ask an administrator to check it, then retry.",iamOwnershipConflict:"The runtime role does not belong to the deployment account. Ask an administrator to check it, then retry.",iamVerificationFailed:"Runtime role permissions could not be confirmed. Check IAM availability and policies, then retry.",iamConfigurationConflict:"Automatic runtime role preparation requires the default MPA role. Check the server creation configuration.",creationFailed:"This step failed. Check its resources, server configuration and permissions, then retry the same agent ID.",cancelFailed:"Cancellation failed. Check the current progress and retry.",cancelled:"Creation cancelled. Registered resources are retained for retry.",timeout:"Creation timed out. Registered resources are retained. Inspect them before retrying.",interrupted:"Creation was interrupted. Retry the same agent ID to recover registered resources.",skillSpace:"Skill Space",states:{running:"Creating",cancelling:"Cancelling",succeeded:"Created",failed:"Creation failed",cancelled:"Cancelled"},stages:{queued:"Queued",iam_role:"Prepare runtime role",checking:"Checking account and configuration",network:"Preparing VPC and subnets",gateway:"Preparing APIG and IM Gateway",database:"Preparing business database",skills:"Preparing Skill Space",worker:"Preparing worker",deploying:"Preparing database, skills and Runtime",verifying:"Waiting for agent readiness",admin_workspace:"Prepare management PG Workspace",business_workspace:"Prepare business PG Workspace",admin_database:"Initialize shared management database"},back:"Keep creating",pgAutoDescription:"VeADK uses its deployment account to create or reuse two PG Workspaces. mpa_admin_workspace / mpa_admin_db stores shared resource records; the business Workspace hosts an independent database for each agent. No PG connection input is needed. Preparation starts after submission.",pgModeChanged:"This submitted task uses previous PG settings and cannot be retried in automatic mode. Ask an administrator to reconcile its resources and task before starting a new creation.",pgMigrationRequired:"An existing shared registry is configured. Migrate its resource records to mpa_admin_workspace / mpa_admin_db and coordinate the registry URL cutover for existing Runtimes, then recheck this configuration."}},Lze={library:"Skill library",skill:"Skill",skills:"Skills",skillSpace:"Skill space",sandboxNotConfigured:"Dev Sandbox is not configured by an administrator",adminNotConfigured:"Not configured by an administrator",totalItems:"{{count}} items",cannotLoadSpaces:"Unable to load Skill spaces",someSpacesFailed:"Some Skill spaces failed to load",degradedRelationWarning:"Some relations are invalid. Readable skills have been restored.",downloadZip:"Download ZIP",optimize:"Optimize",closeSkillDetails:"Close Skill details",skillId:"Skill ID",allFiles:"All files",loadingSkillContent:"Loading Skill content…",noSkillContent:"This Skill has no SKILL.md content",addSkill:"Add Skill",localUpload:"Upload locally",localUploadDescription:"Select a ZIP file and upload it to the Skill space after validation",autoCreate:"Create automatically",autoCreateDescription:"Choose a model and style, then create a Skill through conversation",createSkill:"Create Skill",optimizeNamed:"Optimize {{name}}",deleteSkillConfirm:"Delete the entire Skill “{{name}}”? This affects every space that references it.",deleteSpaceConfirm:"Delete Skill space “{{name}}”? Make sure its Skills have been deleted first.",manageSpaceDescription:"Manage Skills in this space and create new versions",backToSpaces:"Back to Skill spaces",overview:"Overview",skillCount:"Skills",skillCountValue_one:"{{count}} Skill",skillCountValue_other:"{{count}} Skills",updatedAt:"Updated",skillsInSpace:"Skills in {{name}}",searchSkills:"Search Skills",cannotLoadSkills:"Unable to load Skills",noMatchingSkills:"No matching Skills",noSkills:"No Skills",tryAnotherName:"Try searching for another name",emptySkillsDescription:"Upload a Skill locally or create one automatically",actions:"Actions",spaceDetails:"Skill space details",editSpace:"Edit space",deleteSpace:"Delete space",searchSpaces:"Search Skill spaces",spaceList:"Skill space list",noMatchingSpaces:"No matching Skill spaces",createSpace:"Create Skill space",newSpace:"New space",loadingMoreSpaces:"Loading more Skill spaces",scrollForMore:"Scroll down to load more",allSpacesLoaded:"All Skill spaces loaded",errors:{loadSpaces:"Unable to load Skill spaces. Try again later.",loadSkills:"Unable to load Skills. Try again later.",loadSkillDetails:"Unable to load Skill details. Try again later.",deleteSkill:"Unable to delete the Skill",deleteSpace:"Unable to delete the Skill space",downloadSkill:"Unable to download the Skill"},status:{active:"Available",available:"Available",creating:"Creating",disabled:"Disabled",enabled:"Enabled",failed:"Error",inactive:"Inactive",pending:"Pending",published:"Published",ready:"Ready",released:"Published",running:"Running",success:"Healthy",unavailable:"Unavailable",unreleased:"Unreleased",updating:"Updating",unknown:"Unknown"},sharedSpace:"Enterprise shared space",sharedDescription:"Skills available to everyone, published and maintained by administrators",sharedVisibility:"Everyone",sharedPreparing:"Preparing shared space",sharedLoadFailed:"Shared space unavailable",sharedEmpty:"No shared skills yet. Skills published by administrators will appear here",requestPublication:"Request publication",reviewSubmitting:"Submitting…",reviewSubmitted:"Submitted",reviewFailed:"Could not submit the publication request",reviewStatusFailed:"Failed to load review status",reviewRetry:"Apply again",reviewPending:"Pending review",reviewApproving:"Publishing",reviewApproved:"Shared",reviewReturned:"Returned",reviewHistory:"Review history",skillDetailSections:"Skill detail sections",versions:{title:"Version management",refresh:"Refresh",uploading:"Uploading…",upload:"Upload new version",close:"Close",hint:"New versions become public after approval and do not replace published versions; the skill name in the ZIP must match the original",loading:"Loading versions…",loadFailed:"Unable to load versions",filesFailed:"Unable to load version files",uploadFailed:"Unable to upload the new version",submitFailed:"Unable to submit for review",retry:"Retry",empty:"No versions yet",current:"Current version",notSubmitted:"Not submitted",submitting:"Submitting…",submit:"Request publication",processing:"Version status: {{status}}",filesLoading:"Loading files…",filesEmpty:"No files",history:"Review history",shared:"Published"},author:"Author",authorName:"Author: {{name}}"},Mze={library:"Knowledge bases",createBase:"New knowledge base",editBase:"Edit knowledge base",invalidName:"The name must start with a letter and contain only letters, numbers, and underscores.",nameHelp:"Start with a letter. Use up to 48 letters, numbers, or underscores.",optionalDescription:"Description (optional)",descriptionOnly:"AgentKit currently supports updating only the knowledge base description.",previewWeb:"Preview web content",addData:"Add data",openOriginalWeb:"Open original page",backToEdit:"Back to edit",confirmAdd:"Confirm and add",source:"Knowledge source",image:"Image",documentFile:"Document file",webPage:"Web page",webUrl:"Web page URL",generatingWebPreview:"Fetching the page and generating a Markdown preview",selectFile:"Select knowledge file",selectOrDropFile:"Select a file or drag it here",selectedFile:"{{size}} · Click to select another file",imageFileHelp:"PNG, JPG, and JPEG up to 200 MB",documentFileHelp:"PDF, PPTX, DOCX, XLSX, and TXT up to 200 MB",uploadingFile:"Uploading the file and adding it to the knowledge base",optionalName:"Name (optional)",optionalType:"Type (optional)",generatePreview:"Generate preview",uploadFile:"Upload file",editMetadata:"Edit knowledge metadata",knowledge:"Knowledge item",field:"Field",value:"Value",backToList:"Back to knowledge bases",metadataJson:"Metadata (JSON)",provider:"Provider",knowledgeId:"Knowledge ID",project:"Project",creator:"Created by",data:"Data",deleteInvalidAssociation:"Delete invalid association",noData:"This knowledge base has no data",addFirstData:"Add the first data item",format:"Format",size:"Size",searchData:"Search data",searchLibraryData:"Search knowledge base data",associationInvalid:"Association invalid",providerMissing:"The underlying Provider knowledge base no longer exists",noMatchingData:"No matching data",loadingMoreData:"Loading more data",retryLoading:"Retry loading",details:"Knowledge base details",searchBases:"Search knowledge bases",someBasesFailed:"Some knowledge bases are temporarily unavailable. Other available content is shown.",noMatchingBases:"No matching knowledge bases",noManagePermission:"You do not have permission to manage this knowledge base",loadingMoreBases:"Loading more knowledge bases",deleteBaseTitle:"Delete knowledge base?",deleteBaseDescription:"This removes the AgentKit association for {{name}}. If Studio created it, the Provider resource is also deleted. This cannot be undone.",deleteDocumentTitle:"Delete knowledge item?",deleteDocumentDescription:"This removes {{name}} from the Provider knowledge base. This cannot be undone.",preview:{processingTitle:"Data is being processed",processingDetail:"A preview will be available after parsing. Reload later.",failedTitle:"Data parsing failed",failedDetail:"Check the source file or page URL and add it again, or reload the latest status.",noParsedTitle:"No parsed content is available yet",noParsedDetail:"Text, tables, or page images will appear after the knowledge base finishes parsing this file.",noMediaTitle:"No media preview is available yet",noMediaDetail:"The knowledge base has not returned an accessible media preview. Reload later.",noDataTitle:"No data is available to preview",noDataDetail:"The knowledge base has not returned parsed results. Reload later.",attachmentError:"The attachment cannot be previewed. Try again later.",imageAlt:"Knowledge data image",audioUnsupported:"This browser does not support audio previews.",videoUnsupported:"This browser does not support video previews.",namedPdf:"{{name}} PDF preview",pdf:"PDF preview",openPdf:"If it cannot be displayed, open the PDF in a new window",fileUnsupported:"This format cannot be previewed directly online. Parsed content is shown when available.",openOriginalFile:"Open original file",loading:"Loading data preview",openOriginalHint:"You can open the original page to view the source content.",chunk:"Chunk {{index}}",loadingMore:"Loading more",loadMore:"Load more"},errors:{fileTooLarge:"A file cannot exceed 200 MB",invalidImageType:"Select a PNG, JPG, or JPEG image",invalidDocumentType:"Select a PDF, PPTX, DOCX, XLSX, or TXT file",createBase:"Unable to create the knowledge base",updateBase:"Unable to update the knowledge base",metadataObject:"Metadata must be a JSON object",metadataFormat:"Invalid metadata format",noWebPreview:"The page has no Markdown content to preview",addWeb:"Unable to add the web page",previewWeb:"Unable to generate the web page preview",uploadFile:"Unable to upload the file",updateDocument:"Unable to update the knowledge item",loadPreview:"Unable to load the data preview",loadMoreBases:"Unable to load more knowledge bases",loadBases:"Unable to load knowledge bases",loadMoreData:"Unable to load more data",loadData:"Unable to load data",deleteBase:"Unable to delete the knowledge base",deleteDocument:"Unable to delete the knowledge item"}},Ize={title:"Feishu channel",refresh:"Refresh",loading:"Loading channel configuration…",unsupported:"This Runtime does not support channel management. Upgrade its MPA image.",unauthorized:"Channel management requires a Studio administrator and an authorized Runtime credential.",configurationError:"Channel management configuration is incomplete. Check the Runtime metadata and encryption key.",requestFailed:"Channel request failed. Check the Runtime connection and retry.",bound:"Bound: {{name}}",unbound:"No Feishu bot is bound.",guidance:"Private chats use separate conversations. In allowed groups, mention this bot to start a conversation.",keyRequired:"Configure a persistent CHANNEL_STATE_ENCRYPTION_KEY in the Runtime before binding.",gateway:"Message gateway",route:"Inbound route",delivery:"Reply delivery",configured:"Configured",missing:"Missing",delivery_not_observed:"Not observed",delivery_delivered:"Delivered",delivery_retrying:"Retrying",missingConfig:"Missing Runtime configuration: {{fields}}",bind:"Bind with QR code",newQr:"Generate a new QR code",unbind:"Unbind",confirmUnbind:"Disconnect this bot? It will stop receiving new messages.",qrAlt:"Bot authorization QR code",openQr:"Open authorization page",uncertain:"Registration was interrupted. Check the bot binding and Gateway before starting again.",bindingFailed:"Binding failed. Check Gateway configuration and retry.",chatId:"Allowed group ID",scope:"Group conversation scope",saveGroup:"Save group",noGroups:"No groups allowed yet. Private chats do not need this permission.",edit:"Edit",remove:"Remove",removeGroup:"Remove {{name}}",scope_group_sender:"Separate by sender",scope_group:"Shared by group",scope_group_topic_sender:"Separate by topic and sender",scope_group_topic:"Shared by topic",status_PENDING:"Waiting for scan",status_SCANNED:"Scanned; waiting for authorization",status_AUTHORIZED:"Authorized; preparing registration",status_REGISTERING:"Registering bot",status_BOUND:"Bot bound",status_FAILED:"Binding failed",status_EXPIRED:"QR code expired",workspaceTitle:"Message channels",workspaceDescription:"Connect messaging apps to this Agent and manage access.",provider_feishu:"Feishu",provider_wecom:"WeCom",provider_dingtalk:"DingTalk",comingSoon:"Not available yet",unavailableDescription:"Binding and message settings for {{name}} are not available yet.",runtimeRequired:"Deploy this Agent to a Runtime before configuring message channels.",bindingTitle:"Bot connection",connected:"Bound",notBound:"Not bound",gatewayDescription:"Gateway configuration for receiving channel messages.",routeDescription:"Routing configuration for delivering messages to this Agent.",deliveryDescription:"Observed reply delivery; configuration alone does not confirm delivery.",groupsTitle:"Group access",groupsDescription:"Allow specific groups and choose how conversations are shared.",providerBindingTitle:"Connect {{name}}",providerUnbound:"Connect a {{name}} bot to let users message this agent.",qrGuidance:"Authorize with {{name}}. The Runtime saves the bot credentials and configures the message gateway.",wecomGuidance:"Authorize with WeCom QR code, or enter a Bot ID and Secret to bind an existing bot.",wecomBotId:"Bot ID",wecomSecret:"Secret",bindCredentials:"Connect bot",wecomScan:"Bind with QR code",wecomAuthorizing:"Waiting for WeCom authorization…",cancelAuthorization:"Cancel authorization",wecomPopupBlocked:"Allow popups in your browser, then try authorizing again.",wecomAuthCancelled:"WeCom authorization was cancelled. You can scan again.",wecomAuthTimeout:"WeCom authorization timed out. Please scan again.",wecomInvalidResult:"Authorization did not return a Bot ID and Secret. Authorize again or enter them manually.",wecomAuthFailed:"WeCom authorization failed. Try again or enter credentials manually.",dingtalkClientId:"Client ID",dingtalkClientSecret:"Client Secret",manualUpgrade:"Upgrade this Runtime image to configure {{name}} manually. Quick setup is still available.",pairingTitle:"Message channel QR pairing",feishuPairingDescription:"If a bot is already connected, it will be replaced after successful Feishu authorization and binding. In the authorization flow, you can bind an existing bot or create a new one.",generatingQr:"Generating pairing QR code…",dingtalkGuidance:"Authorize with DingTalk QR code, or enter a Client ID and Client Secret to bind an existing bot.",wecomPairingDescription:"Pair again in the WeCom authorization window. The new bot replaces the current connection after binding succeeds. Cancelling authorization or a failed binding does not disconnect the existing bot.",configurationMethod:"Configuration method",quickSetup:"Quick setup",manualSetup:"Manual setup",feishuAppId:"App ID",feishuAppSecret:"App Secret",manualGuidance:"Enter the credentials of an existing {{name}} bot to connect it to this agent.",manualReplacement:"Successful binding replaces the current bot. Cancelling or a failed binding does not disconnect the existing bot.",accountsTitle:"Feishu bots",account:"Bot",selectAccount:"Select a bot",accountEnabled:"Enabled",accountDisabled:"Disabled",addAccount:"Add bot",cancelAddAccount:"Cancel adding",enableAccount:"Enable bot",disableAccount:"Disable bot",noAccounts:"No Feishu bots are bound.",accountsFailed:"Could not load bots. Try again.",accountConflict:"The bot account is ambiguous or conflicts with its configuration. Refresh and select a bot.",multiBotPairingDescription:"Binding a new Feishu app adds a bot. Binding the same App ID updates that bot."},gdr=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:fze,agentSelector:Rze,agentWorkspace:gze,channels:Ize,cloudEnvironment:xze,common:hze,composer:_ze,default:{common:hze,agentKitPromo:fze,systemInfo:pze,agentWorkspace:gze,environmentCenter:mze,deploymentSelect:vze,deploymentError:yze,studioBuildProgress:bze,cloudEnvironment:xze,githubCicd:wze,feishuDeployment:Aze,deploymentResources:Sze,studioUpdate:Tze,projectPreview:Cze,workspace:kze,resourceCollection:Oze,skillSourcePicker:Eze,composer:_ze,agentSelector:Rze,myAgents:Dze,skillCenter:Lze,knowledge:Mze,channels:Ize},deploymentError:yze,deploymentResources:Sze,deploymentSelect:vze,environmentCenter:mze,feishuDeployment:Aze,githubCicd:wze,knowledge:Mze,myAgents:Dze,projectPreview:Cze,resourceCollection:Oze,skillCenter:Lze,skillSourcePicker:Eze,studioBuildProgress:bze,studioUpdate:Tze,systemInfo:pze,workspace:kze},Symbol.toStringTag,{value:"Module"})),Pze="User management",Nze="{{count}} members",Bze="User",$ze="Role",Fze="Account status",zze="Last sign-in",Uze="Actions",Vze="Change role",Gze="Close",Qze="Save role",Hze="Saving…",Wze="Cancel",Yze="Back",qze="User pool",jze="Volcengine Identity",Xze="Search name, email or user ID",Kze="Search",Zze="Filter by role",Jze="All roles",eUe="Refresh",tUe="Loading users…",rUe="Updated at {{time}}",nUe="{{name}} is now {{role}}",iUe="Retry",aUe="You",oUe="Initial super administrator",sUe="The initial super administrator cannot be demoted here",lUe="The new permissions apply when the user refreshes Studio",cUe="Role needs confirmation",uUe="No matching users",dUe="Try another search or role",hUe="Users appear here after signing in or joining this user pool",fUe="{{count}} users",pUe="Previous",gUe="Next",mUe="Not signed in yet",vUe="Not provided",yUe={super_admin:"Super administrator",admin:"Administrator",developer:"Developer",user:"User"},bUe={super_admin:"Manage all resources, users and role assignments",admin:"Manage Studio resources",developer:"Develop agents and manage your own resources",user:"Use agents and personal features"},xUe={EXTERNAL_PROVIDER:"Active",CONFIRMED:"Active",NORMAL:"Active",ENABLED:"Active",ACTIVE:"Active",UNCONFIRMED:"Unverified",DISABLED:"Disabled",FORBIDDEN:"Disabled",LOCKED:"Locked",SUSPENDED:"Suspended",FORCE_CHANGE_PASSWORD:"Password change required"},wUe={request_failed:"The request did not finish. Refresh the list to confirm its current state before retrying",invalid_response:"The user service returned an invalid response. Refresh and try again",identity_unavailable:"Identity is unavailable. Try again later or check service permissions",identity_resource_missing:"The user or user pool no longer exists. Refresh the list",super_administrator_required:"Only super administrators can manage users",sign_in_required:"Sign in and try again",user_not_in_pool:"Your account does not belong to this user pool",user_disabled:"Your account is disabled",protected_administrator:"The initial super administrator cannot be demoted",cannot_demote_self:"You cannot demote your own super administrator role",role_change_conflict:"The role has changed. Close this dialog and refresh the list before retrying",cross_origin_request:"Change roles from the current Studio page"},mdr=Object.freeze(Object.defineProperty({__proto__:null,actions:Uze,allRoles:Jze,back:Yze,cancel:Wze,changeRole:Vze,close:Gze,default:{title:Pze,memberCount:Nze,user:Bze,role:$ze,status:Fze,lastLogin:zze,actions:Uze,changeRole:Vze,close:Gze,save:Qze,saving:Hze,cancel:Wze,back:Yze,pool:qze,volcengineIdentity:jze,searchPlaceholder:Xze,search:Kze,filterRole:Zze,allRoles:Jze,refresh:eUe,loading:tUe,updatedAt:rUe,saved:nUe,retry:iUe,you:aUe,initialAdministrator:oUe,protectedExplanation:sUe,effectiveAfterRefresh:lUe,roleConflict:cUe,noUsers:uUe,tryAnotherSearch:dUe,poolEmpty:hUe,resultCount:fUe,previous:pUe,next:gUe,neverLoggedIn:mUe,unknown:vUe,roles:yUe,descriptions:bUe,states:xUe,errors:wUe},descriptions:bUe,effectiveAfterRefresh:lUe,errors:wUe,filterRole:Zze,initialAdministrator:oUe,lastLogin:zze,loading:tUe,memberCount:Nze,neverLoggedIn:mUe,next:gUe,noUsers:uUe,pool:qze,poolEmpty:hUe,previous:pUe,protectedExplanation:sUe,refresh:eUe,resultCount:fUe,retry:iUe,role:$ze,roleConflict:cUe,roles:yUe,save:Qze,saved:nUe,saving:Hze,search:Kze,searchPlaceholder:Xze,states:xUe,status:Fze,title:Pze,tryAnotherSearch:dUe,unknown:vUe,updatedAt:rUe,user:Bze,volcengineIdentity:jze,you:aUe},Symbol.toStringTag,{value:"Module"})),AUe="Website integration",SUe="Embed an AgentKit Runtime on your website as a floating chat window",TUe="Back to automations",CUe="Add website",kUe="Loading Runtime",OUe="Select Runtime",EUe="Website domain",_Ue="For example, xxxx.com or localhost:5173",RUe="Generating",DUe="Generate token",LUe="Added websites",MUe="{{count}} website",IUe="{{count}} websites",PUe="Loading website integrations",NUe="No website integrations yet",BUe="Select a Runtime and enter a website domain to generate a token",$Ue="Embed instructions",FUe="Place this code before the closing body tag on your website",zUe="Copied",UUe="Copy code",VUe="Embed code will appear here after you add a website.",GUe="Delete the website integration for {{domain}}?",QUe={load:"Failed to load website integrations",create:"Failed to create website integration",delete:"Failed to delete website integration",noConversationalAgent:"No conversational Agent was found in this Runtime"},HUe={requestFailed:"Request failed ({{status}})",greeting:"Hello. How can I help?",sessionFailed:"Could not start a chat session",unauthorized:"This website is not authorized to start a chat",conversationFailed:"The chat request failed. Try again shortly.",open:"Open Agent chat",close:"Close Agent chat",panelLabel:"Agent chat panel",assistant:"Agent assistant",online:"Online"},vdr=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:CUe,addedWebsites:LUe,backToAutomations:TUe,confirmDelete:GUe,copied:zUe,copyCode:UUe,default:{title:AUe,description:SUe,backToAutomations:TUe,addWebsite:CUe,loadingRuntime:kUe,selectRuntime:OUe,websiteDomain:EUe,domainPlaceholder:_Ue,generating:RUe,generateToken:DUe,addedWebsites:LUe,websiteCount_one:MUe,websiteCount_other:IUe,loadingIntegrations:PUe,delete:"Delete",emptyTitle:NUe,emptyDescription:BUe,embedMethod:$Ue,embedInstructions:FUe,copied:zUe,copyCode:UUe,embedHint:VUe,confirmDelete:GUe,errors:QUe,widget:HUe},description:SUe,domainPlaceholder:_Ue,embedHint:VUe,embedInstructions:FUe,embedMethod:$Ue,emptyDescription:BUe,emptyTitle:NUe,errors:QUe,generateToken:DUe,generating:RUe,loadingIntegrations:PUe,loadingRuntime:kUe,selectRuntime:OUe,title:AUe,websiteCount_one:MUe,websiteCount_other:IUe,websiteDomain:EUe,widget:HUe},Symbol.toStringTag,{value:"Module"})),WUe={types:{all:"All types",document:"Documents",image:"Images",video:"Videos"},previewArtifact:"Preview {{name}}",moreActions:"More actions for {{name}}",actionMenu:"Actions for {{name}}",download:"Download",downloading:"Downloading",edit:"Edit details",delete:"Delete artifact",previewFailed:"Could not preview “{{name}}”: {{message}}",downloadStarted:"Download started for {{name}}",downloadFailed:"Could not download “{{name}}”: {{message}}",updated:"Updated {{name}}",deleted:"Deleted {{name}}",deleteFailed:"Could not delete “{{name}}”: {{message}}",typeFilter:"Artifact type",searchAria:"Search artifacts",searchPlaceholder:"Search artifacts or sessions",retry:"Retry",close:"Close",listAria:"Artifact list",loadFailed:"Could not load artifacts",loadDetailFallback:"Check the storage configuration and try again.",reload:"Reload",noMatch:"No matching artifacts",noArtifacts:"You do not have any artifacts yet",searchHint:"Try another search or artifact type",emptyHint:"Artifacts created in chats will appear here automatically",columns:{name:"Name",source:"Source",updatedAt:"Modified",actions:"Actions"},loadingMore:"Loading more artifacts",unknownTime:"Unknown time",preview:{close:"Close preview",meta:"{{type}} / Version {{version}}",loading:"Loading preview",alt:"Preview of {{name}}",loadFailed:"The preview could not be loaded. Try again later or download the file.",unsupported:"This format cannot be previewed online. Download the file to view it.",sourceAria:"Artifact source",agent:"Agent",session:"Session",tool:"Generated by",createdAt:"Created",fileSize:"File size",tags:"Tags",viewSession:"View session"},deleteDialog:{title:"Delete artifact?",description:"“{{name}}” will be permanently removed from the artifact library. The chat history will not be affected.",deleting:"Deleting",confirm:"Delete",close:"Close delete confirmation"},api:{withStatus:"{{message}} ({{status}})",listFailed:"Could not load the artifact library",syncFailed:"Could not sync chat artifacts",updateFailed:"Could not update the artifact",deleteFailed:"Could not delete the artifact",downloadFailed:"Could not download the artifact"}},YUe={unknownSource:"Unknown source",unknownCreator:"Unknown creator"},qUe={nameRequired:"Enter an artifact name",tooManyTags:"You can add up to {{max}} tags",tagTooLong:"Each tag can contain up to {{max}} characters",title:"Edit artifact details",subtitle:"The content file will not be modified",close:"Close edit dialog",name:"Name",description:"Description",descriptionPlaceholder:"Add its purpose, version, or usage notes",tags:"Tags",tagsPlaceholder:"Separate tags with commas, up to {{max}}",cancel:"Cancel",saving:"Saving",save:"Save"},jUe={change:{added:"Added",modified:"Modified",deleted:"Deleted"},noChanges:"There are no source changes between these versions",chooseFile:"Select a file on the left to view its code",compareTitle:"Compare versions",workspaceTitle:"Source workspace",projectFallback:"Agent project",switchTheme:"Switch source theme",switchThemeTitle:"Switch to {{theme}} theme",themes:{dark:"dark",light:"light"},closeWorkspace:"Close source workspace",close:"Close",changedFiles:"Changed files",projectFiles:"Project files",changes:"Changes",files:"Files",openFiles:"Open files",noFileSelected:"No file selected",comparisonDirection:"Comparison direction",before:"Before optimization",after:"After optimization",loadingEditor:"Loading editor…",changedFileCount_one:"{{count}} file changed",changedFileCount_other:"{{count}} files changed",fileCount_one:"{{count}} file",fileCount_other:"{{count}} files",lineCount_one:"{{count}} line · UTF-8",lineCount_other:"{{count}} lines · UTF-8",viewSource:"View source",viewSourceAria:"View and edit project source"},XUe={nav:"Search",selectAgent:"Select an Agent",checkingCapabilities:"Checking Agent capabilities",notMounted:"This Agent does not have {{label}} mounted",sources:{session:"Sessions",web:"Web",knowledge:"Knowledge base",memory:"Long-term memory"},webDescription:"Search with the web_search tool",backendLocal:"Local",failed:"Search failed: {{message}}",placeholder:{selectAgent:"Select an Agent first",web:"Search the web",knowledge:"Search {{name}}",knowledgeFallback:"this Agent's knowledge base",memory:"Search {{name}}",memoryFallback:"this user's long-term memory",session:"Search this Agent's sessions"},sourceTypeAria:"Search source: {{label}}",notSelected:"Not selected",sourceType:"Search source",selectSource:"Select a search source",noAgentHint:"Select an Agent to search its sessions, the web, and mounted data sources.",loadingCapabilities:"Loading this Agent's search capabilities…",sourceUnavailable:"This Agent does not have this data source mounted",instructions:{web:"Enter keywords and press Enter or select the button to search with web_search.",knowledge:"Enter a question to search this Agent's knowledge base.",memory:"Enter a clue to search long-term memories saved across this user's sessions.",session:"Enter keywords and press Enter or select the button to search this Agent's sessions."},noResults:"No results found for “{{query}}”.",knowledgeFragment:"Knowledge excerpt {{index}}",memoryFragment:"Memory excerpt {{index}}"},KUe={title:"Developer Resources",sections:{documentation:{title:"Related links",description:"Open development documentation and common AgentKit destinations"},bestPractices:{title:"Best practices",description:"Learn from practical development, debugging, and deployment guidance"},showcases:{title:"Showcases",description:"Explore applications built with AgentKit"}},links:{veadkDocs:"VeADK documentation",cliDocs:"AgentKit CLI documentation",platformDocs:"AgentKit platform documentation",console:"AgentKit console"},articles:{veadkDevelopment:{title:"Develop and deploy an Agent with VeADK",description:"Build an Agent with VeADK and deploy it to AgentKit Runtime."},cliDevelopment:{title:"Develop and deploy an Agent with AgentKit CLI",description:"Create a project, debug an Agent, and deploy it with AgentKit CLI."},coverAlt:"Cover image for {{title}}"},showcases:{researchAssistant:{title:"Multi-agent research assistant",description:"Specialized Agents work together to research, analyze, and summarize findings."},multimodalAnalysis:{title:"Multimodal content analysis",description:"Understand images, documents, and video in a single session."},customerService:{title:"Customer service workspace",description:"Combine knowledge retrieval and tool calls to handle complex support requests."},webSearch:{title:"Web search Agent",description:"Search current web content and organize it into traceable answers."},a2uiApp:{title:"A2UI interactive app",description:"Let an Agent generate interactive interfaces as it works through a task."},previewAlt:"Interface preview for {{title}}"}},ZUe={title:"Library",untitledSession:"Untitled session",categoryAria:"Library categories",regionAria:"Region",tabs:{skills:"Skills",knowledge:"Knowledge",artifacts:"Artifacts"}},JUe={title:"Manage Agents",subtitle:"Agents in AgentKit Runtime that you can manage",mainAgentOnly:"Only the main Agent is shown (control-plane information).",deleteConfirm:'Delete Agent "{{name}}"? Its Runtime will be permanently deleted.',regionFilterTitle:"Filter by region",regionFilterAria:"Region filter",regionAria:"Region",refresh:"Refresh",loading:"Loading…",empty:"You have not deployed any Agents.",connected:"Connected",connect:"Connect to this Agent",deleteRuntime:"Delete this Runtime",loadingDetail:"Loading details…",agentStructure:"Agent structure",secretHidden:"Sensitive value is never shown. Copy it with an authorized request.",revealSecret:"Sensitive value for {{key}}",copySecret:"Copy the value of {{key}}",copy:"Copy",copied:"Copied",copyFailed:"Copy failed",notConfigured:"Not configured",fields:{model:"Model",description:"Description",status:"Status details",project:"Project",version:"Version",resources:"Resources",memory:"Memory",tool:"Tool",knowledge:"Knowledge",mcpToolset:"MCP Toolset",updatedAt:"Updated"},resource:{memory:"Memory {{value}} MB",instances:"Instances {{min}}-{{max}}",concurrency:"Concurrency {{value}}"},environmentVariables:"Environment variables",unnamed:"(Unnamed)"},eVe={mainAgent:"Main Agent",subAgent:"Sub-agent {{index}}",itemCount_one:"{{count}} item",itemCount_other:"{{count}} items",info:"Agent information",infoAndTopology:"Agent information and settings",loadingInfo:"Loading Agent information…",unnamedAgent:"Unnamed Agent",agentsMd:"AGENTS.md",tools:"Tools",toolList:"Tool list",studioTool:"Studio Tool",removeTool:"Remove tool {{name}}",remove:"Remove",notConfigured:"Not configured",addStudioTool:"Add Studio tools",addStudioToolHere:"Add Studio tools to this chat",skills:"Skills",skillList:"Skill list",addSkill:"Add Skill Space skills",addSkillHere:"Add Skill Space skills to this Session",skillMountNextTurn:"Mounted versions are frozen when the next Turn starts.",previewUnsupported:"Preview is not supported",sessionEnvironment:"Session environment",environment:"Environment",agentCanvas:"Agent canvas",topology:"Structure",nodeKinds:{agent:"Agent",sandbox:"Sandbox","worker-session":"Worker Session","skill-space":"Skill Space",skill:"Skill","studio-tool":"Studio Tool",mcp:"MCP",environment:"Environment",knowledge:"Knowledge","sub-agent":"Sub-agent"},nodeStatuses:{configured:"Configured",mounted:"Mounted",running:"Running",paused:"Paused"},viewCanvasFullscreen:"View Agent canvas in full screen",viewFullscreen:"View full screen",executionCanvas:"Agent execution canvas",fullscreenExecutionCanvas:"Full-screen Agent execution canvas",closeFullscreenCanvas:"Close full-screen canvas",close:"Close",capabilitiesSubtitle:"Capabilities and collaboration topology",closeInfo:"Close Agent information",infoUnavailable:"Agent information is temporarily unavailable.",refresh:"Refresh information",loadingSkills:"Loading bound skills…",sessionSkills:"Temporary session skills",noBoundSpace:"This agent has no bound Skill Space.",noBoundSkills:"The bound Skill Space has no skills.",loadFailed:"Could not load this information. Refresh to retry.",accessDenied:"You do not have permission to read this information.",documentUnsupported:"Upgrade the Runtime image to enable Studio to read AGENTS.md.",skillsUnsupported:"This Runtime does not provide Skill Space bindings.",skillsDegraded:"Skill information is incomplete. Refresh to retry.",documentEditHint:"Edit the latest version. Saving publishes a new version to this Skill Space and can affect other agents using it. Running sessions may need a cache refresh or a new session. Keep the frontmatter name unchanged.",documentLoading:"Loading SKILL.md…",documentWritable:"Editable",documentReadOnly:"Read only — this space or your permissions do not allow editing",documentLoadFailed:"Could not load SKILL.md. Refresh to retry.",documentSaveFailed:"Save was not confirmed. Your edits are preserved. Reopen to check the current version before retrying.",documentConflict:"A newer version exists. Copy your edits, then reopen the editor to avoid overwriting it.",discardDocument:"Discard unsaved changes?",keepEditing:"Keep editing",discardChanges:"Discard changes",saveDocument:"Save new version"},tVe={mountFailed:"Could not mount the environment",closeDialog:"Close environment dialog",addTitle:"Add environments",description:"Choose the Sandbox environments this Agent can use in the current session",closeAdd:"Close Add environments",searchAria:"Search environments",searchPlaceholder:"Search environment names or capabilities",availableAria:"Available environments and workspaces",loading:"Loading available environments…",noMatch:"No matching environments or workspaces",workspaces:"Workspaces",reuseAll:"Use every available environment in this workspace",availableEnvironmentCount_one:"{{count}} available environment",availableEnvironmentCount_other:"{{count}} available environments",selectWorkspace:"Select workspace {{name}}",environments:"Environments",includedByWorkspaces:"Included by workspace {{names}}",nameSeparator:", ",selectEnvironment:"Select environment {{name}}",selectedWorkspaceCount_one:"{{count}} workspace selected",selectedWorkspaceCount_other:"{{count}} workspaces selected",coveredEnvironmentCount_one:"{{count}} environment covered",coveredEnvironmentCount_other:"{{count}} environments covered",selectionSummary:"{{workspaces}}, {{environments}}",cancel:"Cancel",mounting:"Mounting…",confirm:"Add selected",mountedAria:"Mounted environments",environmentCount_one:"{{count}} environment",environmentCount_other:"{{count}} environments",removeWorkspace:"Remove workspace {{name}}",remove:"Remove",removeEnvironment:"Remove environment {{name}}",add:"Add environments",addMore:"Add more environments",addForSession:"Add environments to this session",loadingAvailable:"Loading available environments…",empty:"No AIO Sandbox environments are available."},rVe={loading:{searching:"Looking for an existing environment",creating:"Initializing environment",connecting:"Connecting to the environment"},initializationFailed:"AgentKit CLI environment initialization failed. Current status: {{status}}.",sessionExpired:"The AgentKit CLI session does not exist or has expired. Try again.",initializationTimeout:"AgentKit CLI environment initialization timed out. Try again later.",nonPersistent:"Non-persistent environment",recyclingHoursMinutes:"Environment reclaimed in {{hours}} hr {{minutes}} min",recyclingMinutes:"Environment reclaimed in {{minutes}} min",connectionError:`Could not connect to the Studio service because the server did not respond. Original error: {{message}}`,unavailable:"Connection unavailable",requestFailed:"AgentKit CLI request failed",retry:"Retry",terminalTitle:"AgentKit CLI terminal"},nVe={labels:{coding:"Coding",get_city_weather:"City weather",get_location_weather:"Location weather",web_fetch:"Fetch web content",studio_write_artifact:"Save session artifact"},closeDialog:"Close dialog",title:"Add Studio tools",description:"Studio BFF runs these tools for {{agentName}} in the current session. No Runtime installation is required.",close:"Close Add Studio tools",searchAria:"Search Studio tools",searchPlaceholder:"Search by name or tool ID",availableAria:"Available Studio tools",loading:"Loading Studio tools…",noMatch:"No matching Studio tools",remove:"Remove",add:"Add"},iVe={artifactLibrary:WUe,resourceMetadata:YUe,artifactEdit:qUe,codeBrowser:jUe,search:XUe,developerResources:KUe,library:ZUe,manageAgents:JUe,agentTopology:eVe,sessionEnvironment:tVe,agentKitCli:rVe,studioTools:nVe},ydr=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:rVe,agentTopology:eVe,artifactEdit:qUe,artifactLibrary:WUe,codeBrowser:jUe,default:iVe,developerResources:KUe,library:ZUe,manageAgents:JUe,resourceMetadata:YUe,search:XUe,sessionEnvironment:tVe,studioTools:nVe},Symbol.toStringTag,{value:"Module"})),aVe={requestFailed:"请求失败 ({{status}})",unknownError:"未知错误",contentTypeMissing:"Content-Type 缺失",response:"响应:{{response}}",fallbackWithDetail:"{{fallback}}:{{detail}}",fallbackWithHttpStatus:"{{fallback}}(HTTP {{status}})",nonJsonResponse:"{{fallback}}:服务端返回非 JSON 响应({{contentType}})"},oVe={unconfigured:"管理员未配置 AgentKit Dev Sandbox,请配置后再使用",invalidSession:"AgentKit CLI 返回了无效的 Session。",loadCapabilitiesFailed:"无法读取 AgentKit CLI 配置。",invalidCapabilities:"AgentKit CLI 返回了无效的配置状态。",listSessionsFailed:"无法读取 AgentKit CLI Session。",invalidSessionList:"AgentKit CLI 返回了无效的 Session 列表。",createSessionFailed:"无法创建 AgentKit CLI Session。",openSessionFailed:"无法打开 AgentKit CLI Session。",openTerminalFailed:"无法打开 AgentKit CLI 终端。",invalidTerminalUrl:"AgentKit CLI 返回了无效的终端地址。"},sVe={cnBeijing:"华北 2(北京)",cnShanghai:"华东 2(上海)"},lVe={runtimeUnsupported:"该 Runtime 暂不支持连接,请确认服务已正常运行。"},cVe={autoConfigureFailed:"飞书机器人自动配置失败"},uVe={actionFailed:"{{action}}失败",detail:"详细信息:{{detail}}",request:"请求:{{request}}"},dVe={persistentMemoryHint:"提示:会话已不存在。使用 in-memory 或 SQLite 短期记忆时,多实例、进程重启或滚动发布都可能导致会话丢失;建议改用基于数据库的持久化短期记忆存储。",unsupportedRouteHint:"提示:该 Runtime 未提供会话能力运行接口,可能是 Runtime 版本与当前 Studio 不兼容。",toolArgumentHint:"提示:模型生成的工具参数格式不完整,请重新发送一次。",resourceCollectionExpiredHint:"提示:本次资源清单已失效,请重新发送任务;系统会重新收集资源后再创建 Agent。",networkConfigurationHint:"提示:请稍后重试,查看 Runtime、模型或网关日志。",modelQuotaHint:"提示:模型当前触发了 TPM/RPM 配额限制,请稍后重试或提高模型配额。",rawResponseLabel:"原始响应:",copySecretFailed:"复制敏感值失败"},hVe={httpStatus:"HTTP 状态码:{{status}}",errorCode:"错误码:{{code}}",cloudResponseBody:`云端响应正文: {{body}}`,loadFailedWithDetail:"读取实例日志失败:{{detail}}",invalidFormat:"读取实例日志失败:服务返回格式无效"},fVe={untitledSession:"未命名会话",webUnavailable:"网络搜索接口未就绪(后端未启用 /web/search)。",webFailed:"网络搜索失败:{{message}}",webNotMounted:"当前 Agent 未挂载 web_search 工具。",knowledgeNotMounted:"该 Agent 未挂载知识库。",memoryNotMounted:"该 Agent 未挂载长期记忆。",knowledge:"知识库",longTermMemory:"长期记忆"},pVe={listSpacesFailed:"读取 Skill 空间失败",createSpaceFailed:"创建 Skill 空间失败",updateSpaceFailed:"更新 Skill 空间失败",deleteSpaceFailed:"删除 Skill 空间失败",uploadFailed:"上传 Skill 失败",validateFailed:"校验 Skill 失败",deleteFailed:"删除 Skill 失败",listFilesFailed:"读取 Skill 文件失败",downloadFailed:"下载 Skill 失败",sharedSpaceFailed:"共享空间加载失败",reservedSpaceName:"此名称由系统空间保留,请使用其他名称",reviewSpaceFailed:"待审核空间暂不可用",submitReviewFailed:"申请公开失败",listReviewsFailed:"加载审核申请失败",reviewFilesFailed:"加载提交文件失败",decideReviewFailed:"审批失败,请重试",listVersionsFailed:"无法加载技能版本",uploadVersionFailed:"上传技能新版本失败"},gVe={truncatedData:"{{data}}…(已截断,共 {{count}} 个字符)",incompleteEvent:"SSE 流在事件完整返回前已结束。原始数据:{{data}}",invalidEventJson:"无法解析 SSE 事件中的 JSON。原始数据:{{data}}"},mVe={loadConfigNetworkFailed:"无法加载登录配置,请检查网络后重试。",configServiceFailed:"登录配置服务异常(HTTP {{status}}),请稍后重试。",invalidConfigResponse:"登录配置服务返回了无法解析的响应,请稍后重试。",serviceNetworkFailed:"无法连接身份服务,请检查网络后重试。",invalidServiceResponse:"身份服务返回了无法解析的响应,请稍后重试。",serviceFailed:"身份服务异常(HTTP {{status}}),请稍后重试。"},vVe={invalidToken:"GitHub Token 无效或没有仓库写入权限",notFound:"仓库、分支或文件不存在,或 Token 无权访问",rejectedCommit:"GitHub 拒绝了提交,请检查分支和文件状态",requestFailed:"GitHub 请求失败(HTTP {{status}})",networkFailed:"连接 GitHub 失败,请检查网络后重试",invalidRepositoryFormat:"GitHub Repo 格式应为 owner/repository",insecureRepositoryUrl:"仅支持安全的 github.com 仓库地址",unsafeProjectPath:"Agent 项目目录必须是仓库内的安全相对路径",tokenRequired:"GitHub Token 不能为空",invalidBaseBranch:"目标分支格式不正确",invalidPublishBranch:"发布分支格式不正确",noFiles:"没有需要提交的文件",missingBaseSha:"目标分支缺少有效 Git SHA",fileAlreadyExists:"目标仓库中已存在 {{path}},未覆盖现有文件",pathNotUpdatable:"目标路径 {{path}} 不是可更新的文件",invalidPullRequest:"GitHub 未返回有效的 Pull Request"},yVe={loadCapabilitiesFailed:"加载视频模型能力失败",uploadAssetFailed:"上传{{fileName}}失败",enhancePromptFailed:"提示词优化失败",createTaskFailed:"创建视频生成任务失败",getTaskFailed:"查询视频生成任务失败",downloadFailed:"下载生成视频失败"},bVe={listFailed:"加载网站集成失败",createFailed:"创建网站集成失败",deleteFailed:"删除网站集成失败"},xVe={loadFailed:"读取知识库失败",htmlHidden:"[HTML 内容已隐藏]",redacted:"[已脱敏]",depthTruncated:"[内容过深,已截断]",circularReference:"[循环引用]",diagnosticsUnavailable:"[诊断信息无法显示]",statusCode:"状态码:{{status}}",errorCode:"错误码:{{code}}",requestId:"请求 ID:{{requestId}}",diagnostics:"诊断:{{diagnostics}}",detail:"详情:{{detail}}",signInRequired:"请先登录后再访问知识库",forbidden:"你没有权限操作这个知识库",notFound:"知识库或知识内容不存在",conflict:"知识库当前状态不允许执行此操作",requestFailed:"知识库请求失败 ({{status}})"},wVe={invalidName:"名称须为 1~128 个字符,不能包含控制字符、不可见格式字符或 < >。",renameProjectFailed:"修改项目名称失败",renameVersionFailed:"修改版本名称失败",invalidNameUpdateResponse:"名称更新响应与请求不一致,请刷新后重试。",invalidSourceSnapshot:"源码快照的响应格式无效。",invalidProjectList:"项目列表的响应格式无效。",invalidProjectVersion:"项目版本的响应格式无效。",loadProjectsFailed:"无法读取已保存项目",loadVersionsFailed:"无法读取项目版本",deleteVersionFailed:"删除项目版本失败",invalidDeleteVersionResponse:"删除项目版本的响应格式无效。",loadProjectSourceFailed:"无法读取项目源码",loadSnapshotFailed:"无法读取源码快照",restoreSnapshotFailed:"无法恢复当前源码快照",downloadSourceFailed:"下载源码失败",downloadNotZip:"源码下载响应不是 ZIP 文件。",downloadSizeMismatch:"源码压缩包大小与发布记录不一致,请重试。"},AVe={invalidFormat:"{{label}}格式错误。",validationSeparator:";",invalidAnalysisResult:"迁移分析结果格式错误。",invalidFrameworkCandidate:"框架候选格式错误。",invalidAnalysisEvidence:"分析证据格式错误。",invalidEntryCandidate:"入口候选格式错误。",invalidQuestion:"待确认问题格式错误。",invalidPendingInput:"分析问题无法读取",invalidTask:"迁移会话格式错误。",invalidAnalysisReference:"分析结果引用格式错误。",invalidSourcePersistence:"迁移源码保存状态格式错误。",invalidActivity:"迁移执行动态格式错误。",invalidActivityItem:"迁移执行动态项格式错误。",invalidActivityTool:"迁移执行工具项格式错误。",invalidActivityPlan:"迁移执行计划格式错误。",invalidActivityPlanItem:"迁移执行计划项格式错误。",invalidArtifact:"迁移产物格式错误。",invalidEnvironmentDefaults:"环境变量默认值格式错误。",invalidArtifactFile:"迁移产物文件格式错误。",invalidVerificationCheck:"迁移校验项格式错误。",requestValidationFailed:"请求参数校验失败:{{detail}}",gatewayError:"{{fallback}}(HTTP {{status}},Content-Type: {{contentType}})。请检查代理或网关配置。",nonJsonResponse:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}})。请检查代理或网关配置。",loadCapabilitiesFailed:"读取迁移能力失败",invalidCapabilities:"迁移能力格式错误。",invalidModelCapabilities:"迁移模型能力格式错误。",loadTasksFailed:"读取迁移会话失败",invalidTaskList:"迁移会话列表格式错误。",createTaskFailed:"创建迁移会话失败",uploadProjectFailed:"上传迁移项目失败",loadActivityFailed:"读取迁移执行动态失败",loadEventsFailed:"订阅迁移进度流失败",invalidEventsResponse:"迁移进度流返回了非法数据帧。",reconnecting:"连接已断开,正在重新连接迁移进度流…",startFailed:"启动迁移失败",submitAnswersFailed:"提交分析补充信息失败",submitInputFailed:"提交分析回答失败",stopFailed:"终止迁移失败",deleteTaskFailed:"删除迁移会话失败",loadArtifactFailed:"读取迁移产物失败",loadArtifactFileFailed:"读取迁移产物文件失败",downloadArtifactFailed:"下载迁移产物失败",evaluation:{datasetSaveFailed:"保存评测用例失败",datasetLoadFailed:"读取评测用例失败",statusLoadFailed:"读取评测状态失败",resumeFailed:"继续评测失败",retryFailed:"重新评测失败",reportLoadFailed:"读取评测报告失败",reportDownloadFailed:"下载评测报告失败"},labels:{analysisResult:"迁移分析结果",recommendation:"迁移建议",boundary:"迁移边界",frameworkCandidate:"框架候选",analysisEvidence:"分析证据",recommendedFramework:"推荐框架",entryCandidate:"入口候选",entryFramework:"入口框架",includeScope:"迁移包含范围",excludeScope:"迁移排除范围",assumptions:"分析假设",question:"待确认问题",analysisWarnings:"迁移警告",task:"迁移会话",artifactStatus:"迁移产物状态",analysisReference:"分析结果引用",confirmation:"迁移确认",confirmedFramework:"确认框架",error:"迁移错误",sourcePersistence:"迁移源码保存状态",activity:"迁移执行动态",activityItem:"迁移执行动态项",activityTool:"迁移执行工具项",activityPlanItem:"迁移执行计划项",artifact:"迁移产物",cli:"CLI 信息",migration:"迁移信息",startup:"启动信息",environment:"环境变量信息",verification:"校验信息",report:"迁移报告",archive:"产物归档",environmentDefaults:"环境变量默认值",requiredEnvironment:"必需环境变量",optionalEnvironment:"可选环境变量",artifactFile:"迁移产物文件",verificationCheck:"迁移校验项",artifactWarnings:"迁移产物警告",errorResponse:"错误响应",errorDetail:"错误详情",capabilities:"迁移能力",framework:"迁移框架",modelCapabilities:"迁移模型能力",taskList:"迁移会话列表",evaluationAsset:"评测资产",evaluation:"评测状态",evaluationCapabilities:"评测能力",evaluationDimension:"评测维度",evaluationCase:"评测用例",evaluationCriteria:"评测标准",evaluationMessage:"评测对话",evaluationDataset:"评测数据集",evaluationDimensionResult:"评测维度结果",evaluationEvidence:"评测证据",evaluationReport:"评测报告",evaluationSummary:"评测汇总",evaluationCaseResult:"评测用例结果",evaluationOutput:"评测输出",evaluationLimitations:"评测限制",pendingInput:"分析提问",pendingQuestion:"分析问题项",pendingOption:"分析问题选项"}},SVe={status:{ready:"就绪",wakeable:"已休眠",creating:"创建中",starting:"启动中",pending:"等待中",running:"运行中",failed:"异常",stopped:"已停止",expired:"已过期",deleting:"删除中",deleted:"已删除",unknown:"未知状态"},developmentTimeout:"等待开发环境响应超时。任务可能仍在运行,请稍后重新进入当前会话查看状态。",developmentDisconnected:"与开发环境的连接已中断。任务可能仍在运行,请稍后重新进入当前会话查看状态。",developmentFailed:"开发任务未能继续,开发环境已保留。请在当前会话重试。",invalidStudioResponse:"{{fallback}} Studio 服务响应异常,请刷新后重试。",invalidSession:"AgentKit 沙箱返回了无效的 Session 信息。",invalidSnapshot:"AgentKit 沙箱返回了无效的 Snapshot 信息。",invalidSettings:"Sandbox 返回了无效设置。",invalidThreadSnapshot:"Sandbox 返回了无效 Thread 快照。",emptyConversationResponse:"沙箱对话服务未返回内容。",invalidConversationResponse:"沙箱对话服务返回了无法解析的响应。",conversationFailed:"沙箱对话失败,请稍后重试。",emptyReply:"沙箱未返回有效回复,请重试。",missingSession:"缺少要操作的 AgentKit Session。",listCodexFailed:"无法读取 Codex 智能体,请稍后重试。",invalidSessionList:"AgentKit 沙箱返回了无效的 Session 列表。",invalidSnapshotList:"AgentKit 沙箱返回了无效的 Snapshot 列表。",startFailed:"无法启动 AgentKit 沙箱,请稍后重试。",listAgentFailed:"无法读取 {{kind}} 智能体,请稍后重试。",invalidKindSessionList:"AgentKit 返回了无效的 {{kind}} Session 列表。",invalidKindSnapshotList:"AgentKit 返回了无效的 {{kind}} Snapshot 列表。",createAgentFailed:"无法创建 {{kind}} 智能体,请稍后重试。",missingSessionToOpen:"缺少要打开的 AgentKit Session。",openAgentFailed:"无法打开 {{kind}} 智能体。",invalidAgentHomeUrl:"{{kind}} 智能体返回了无效的主页面地址。",missingSessionForTerminal:"缺少要打开 Terminal 的 AgentKit Session。",openTerminalFailed:"无法打开 {{kind}} Terminal。",deleteAgentFailed:"无法删除 {{kind}} 智能体。",missingSnapshot:"未找到要唤醒的智能体。",resumeSnapshotFailed:"无法唤醒智能体,请稍后重试。",deleteSnapshotFailed:"无法删除智能体,请稍后重试。",missingSessionToConnect:"缺少要连接的 AgentKit Session。",connectCodexFailed:"无法连接 Codex 智能体,请稍后重试。",sessionNotReady:"AgentKit Session 尚未就绪,当前状态:{{status}}。",invalidMessage:"内置智能体会话缺少有效的消息内容。",interruptFailed:"无法停止当前任务。",getStatusFailed:"无法读取 Codex 状态。",getEndpointFailed:"无法读取 Sandbox Endpoint。",invalidEndpoint:"Sandbox 返回了无效 Endpoint。",createHandoffPairingFailed:"无法生成 Codex 云端接力配对码。",invalidHandoffPairing:"Studio 返回了无效的 Codex 云端接力配对码。",getHandoffStatusFailed:"无法读取端云接力状态。",invalidHandoffStatus:"Studio 返回了无效的端云接力状态。",listModelsFailed:"无法读取 Codex 模型列表。",invalidModelList:"Sandbox 返回了无效模型列表。",setModelFailed:"无法切换 Codex 模型。",invalidModel:"Sandbox 返回了无效模型。",listSkillsFailed:"无法读取 Codex Skills。",invalidSkillList:"Sandbox 返回了无效 Skill 列表。",listThreadsFailed:"无法读取 Codex Thread 列表。",invalidThreadList:"Sandbox 返回了无效 Thread 列表。",createThreadFailed:"无法创建新的 Codex Thread。",missingThread:"缺少要读取的 Codex Thread。",readThreadFailed:"无法读取 Codex 历史消息。",resumeThreadFailed:"无法恢复 Codex Thread。",forkThreadFailed:"无法分叉 Codex Thread。",archiveThreadFailed:"无法归档 Codex Thread。",invalidArchiveResult:"Sandbox 返回了无效归档结果。",deleteThreadFailed:"无法删除 Codex Thread。",invalidDeleteResult:"Sandbox 返回了无效删除结果。",compactThreadFailed:"无法压缩 Codex Thread。",getSettingsFailed:"无法读取 Codex 权限与工作空间。",updatePermissionsFailed:"无法更新 Codex 权限。",updateWorkspaceFailed:"无法更新 Codex 工作空间。",invalidWorkingDirectory:"Sandbox 返回了无效工作目录。",listDirectoriesFailed:"无法读取 Sandbox 目录。",invalidDirectoryList:"Sandbox 返回了无效目录列表。",resolveApprovalFailed:"无法提交 Codex 审批决定。",uploadFileFailed:"无法上传文件到 Sandbox。",invalidUploadResult:"Sandbox 返回了无效上传结果。",disconnectCodexFailed:"无法断开 Codex 智能体连接。",deleteCodexFailed:"无法删除 Codex 智能体。",openSandboxTerminalFailed:"无法打开 Sandbox Terminal。",openSandboxBrowserFailed:"无法打开 Sandbox Browser。",toolLabel:"Sandbox 工具",invalidToolUrl:"{{label}} 返回了无效地址。",unsafeToolUrl:"{{label}} 返回了不安全的地址。"},TVe={invalidSandboxVersion:"沙箱版本响应格式无效",loadSandboxVersionsFailed:"查询沙箱版本失败",updateSandboxFailed:"更新 Sandbox 失败",invalidSandboxUpdate:"沙箱更新响应格式无效",errorWithDetailAndRawResponse:`{{context}} {{detail}} @@ -86,12 +86,12 @@ Original error: {{message}}`,unavailable:"Connection unavailable",requestFailed: 约束: - 信息不足时主动提问澄清,不要臆造事实。 - 需要时合理调用可用的工具,并说明关键结论。 -- 保持礼貌、专业的语气。`},fQe={requestFailed:"请求失败 ({{status}}){{detail}}",a2aSpaces:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 AgentKit 智能体中心",loginRequired:"请先登录以访问 AgentKit 智能体中心"},vikingKnowledge:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 VikingDB 知识库",loginRequired:"请先登录以访问 VikingDB 知识库"},vikingMemory:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 VikingDB 记忆库",loginRequired:"请先登录以访问 VikingDB 记忆库"},mcpGateway:{missingHttpTool:"请返回“添加 MCP 工具”并添加至少一个 HTTP MCP 服务;MCP 稳定性治理不支持 stdio 服务。",missingUrl:"已添加的 HTTP MCP 工具缺少有效服务地址,请返回“添加 MCP 工具”补充后再发布。"},customModel:{fallbackName:"自定义模型",apiKeyLabel:"{{name}} 模型 API Key",fallbackApiKeyLabel:"{{name}} 的备用模型 {{model}} API Key"},deploymentEnv:{serverInjected:"由服务端注入",selectedApiKeyPlaceholder:"由所选 API Key 注入",mcpInjectedComment:"由已添加的 MCP 工具注入",restoredPlaceholder:"由 Studio 服务端安全恢复",generatedMcpPlaceholder:"由已添加的 HTTP MCP 工具自动生成",restoredHelp:"更新时由 Studio 服务端合并 MCP 地址与认证,不向浏览器返回旧密钥。",mergedMcpHelp:"Studio 服务端自动合并 MCP 地址与可选认证,不向浏览器返回旧密钥。",listSeparator:"、",requirementHint:"优化项“{{labels}}”依赖此配置。",requiredBy:"优化项“{{labels}}”依赖此配置,请填写 {{key}}。",required:"请填写 {{label}}({{key}})。",invalidJson:"JSON 格式不正确"},drafts:{unsupportedVersion:"本机草稿版本暂不受支持,请升级 Studio 后重试。",invalidFormat:"本机草稿数据格式无效。",readFailed:"无法读取本机草稿,浏览器中的草稿数据可能已损坏。",quotaExceeded:"浏览器存储空间不足,草稿未保存。请删除不需要的草稿或清理此站点的浏览器存储后重试。",writeRejected:"浏览器拒绝保存草稿,请检查站点存储权限后重试。"},skills:{searchFailed:"搜索失败 ({{status}})",downloadFailed:"下载技能失败 ({{status}})",agentKitRequestFailed:"AgentKit Skills 请求失败",missingManifest:"{{location}} 缺少 SKILL.md",invalidParentPath:"{{location}} 包含非法路径(..):{{path}}",invalidPath:"{{location}} 包含非法路径:{{path}}",localDescription:"本地 Skill",folderSource:"文件夹",noManifest:"{{location}} 中未发现 SKILL.md"},zip:{invalid:"无效的 zip:找不到 EOCD",tooManyFiles:"zip 文件数不能超过 {{count}} 个",tooLarge:"zip 解压后的内容过大"}},pQe={back:"返回开发会话",runtimeName:"Runtime 名称",runtimeNameExists:"Runtime 名称已存在,请更换后重试",checkingRuntimeName:"正在检查 Runtime 名称",verifiedSource:"已验证源码",deployableSource:"可部署源码",verifiedByCodex:"已通过 Codex 云端验证",entryPoint:"入口",files:"文件",artifact:"构建产物",validationReport:"验证报告",verifiedHint:"源码由服务端从已验证交付物物化,浏览器文件不能替换。",unverifiedHint:"源码已由服务端安全物化,部署前请确认 Runtime 配置。",env:{requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}"}},gQe={name:"代码包",back:"返回创建方式",reading:"正在读取代码包",readingEllipsis:"正在读取代码包…",uploadFirst:"请先上传代码包",uploadAriaLabel:"代码包上传",upload:"上传代码包",reupload:"重新上传代码包",uploadPrompt:"请上传代码包",filesRecognized:"已识别 {{count}} 个文件,点击区域可重新上传",dropHint:"点击或拖拽上传,支持 .zip 格式,最大 50 MB;可使用 app.py,或由 agentkit.yaml 声明入口",viewFiles:"查看文件",chooseFile:"选择代码包",errors:{invalidFormat:"请选择 .zip 格式的代码包。",tooLarge:"代码包不能超过 50 MB。",invalidPath:"压缩包包含非法路径:{{name}}",empty:"压缩包中没有可部署的文件。",tooManyFiles:"代码包文件数不能超过 {{count}} 个。",duplicateFile:"代码包包含重复文件:{{path}}",manifestParse:"agentkit.yaml 无法解析:{{detail}}",manifestRoot:"agentkit.yaml 根节点必须是对象。",manifestCommon:"agentkit.yaml 的 common 必须是对象。",entryPointType:"agentkit.yaml 的 common.entry_point 必须是文件路径。",entryPointInvalid:"agentkit.yaml 的 common.entry_point 不是有效文件路径。",entryPointMissing:"代码包中不存在 agentkit.yaml 声明的启动入口:{{entryPoint}}",defaultEntryPointMissing:"代码包根目录必须包含 app.py,或在 agentkit.yaml 的 common.entry_point 中声明已有入口。"}},mQe={label:"Agent 执行画布",readOnlyLabel:"只读 Agent 执行画布",minimapLabel:"执行流程缩略图",controls:{ariaLabel:"执行流程控制",zoomIn:"放大",zoomOut:"缩小",fitView:"适应视图"},rootAgent:"主 Agent",unnamedStep:"未命名步骤",terminals:{input:"用户请求",output:"最终回复"},edges:{then:"然后",continueLoop:"继续循环",call:"调用"},patterns:{llm:{label:"智能体",description:"理解任务并直接完成一个具体工作"},sequential:{label:"分步协作",description:"内部步骤按照顺序依次执行"},parallel:{label:"同时处理",description:"内部步骤同时工作,完成后统一汇总"},loop:{label:"循环执行",description:"重复执行内部步骤,直到满足停止条件"},a2a:{label:"远程智能体",description:"调用已经存在的远程 Agent"}},actions:{insertHere:"在这里插入步骤",deleteNamed:"删除 {{name}}",deleteNode:"删除节点",addSubagent:"添加子 Agent",addParallelStep:"添加一个同时处理的步骤",addLoopStep:"添加循环步骤",addNextStep:"添加下一个步骤",addFirst:"添加到最前",addLast:"添加到最后"}},vQe={title:"智能构建",subtitle:"描述需求,完成 Agent 的构建、调试与验证。",model:{label:"模型",placeholder:"选择模型",retiring:"即将下线",currentConfiguration:"当前配置",loadError:"加载模型列表失败"},availability:{checking:"正在检查智能开发能力…",unavailable:"当前无法使用智能模式,请返回后重试。"},goal:{title:"从目标开始",continueTitle:"继续优化项目",hint:"只需说明 Agent 要解决的问题;如有影响结果的关键信息,会在开始前向你确认。",continueHint:"说明这次要调整的内容,完成后会保存为新版本。",basedOn:"基于",clearSelection:"取消选择",label:"目标描述",optimizationLabel:"优化目标",placeholder:"例如:创建一个能读取销售数据、生成周报并校验输出格式的 Agent",optimizationPlaceholder:"例如:增加数据来源标注,并在信息不足时先向用户确认"},actions:{preparing:"准备中…",build:"开始构建",optimize:"开始优化"},preparation:{accepted:"目标已收到,马上开始实现",preparing:"正在创建任务环境…",starting:"环境已就绪,正在启动 Codex…",next:"接下来会先梳理目标和实现方式,再编写、运行和验证 Agent。"},tasks:{title:"进行中的任务",hint:"离开页面后仍会继续,可随时回来查看和补充要求。",refresh:"刷新任务列表",loading:"正在读取任务…",empty:"暂无进行中的任务",emptyHint:"开始构建后,可以从这里回到任务。",loadError:"暂时无法读取任务,请重试。",openError:"暂时无法打开任务,请重试。",startedAt:"开始于 {{time}}",open:"查看任务",opening:"正在连接…",states:{queued:"等待开始",running:"构建中",recovering:"正在重连",waiting_user:"等待你的回复",stopping:"正在停止",succeeded:"已完成",failed:"未完成",cancelled:"已停止"}}},yQe={title:"已保存项目",description:"选择已有版本继续优化,或查看、下载和部署源码。",refresh:"刷新项目列表",checkingStorage:"正在检查项目存储…",unavailableTitle:"暂时无法读取项目",storageCheckError:"无法确认项目存储状态,请稍后重试。",storageNotConfigured:"项目存储尚未配置。",loadingMigrated:"正在读取已迁移项目…",loadingSaved:"正在读取已保存项目…",loadingVersions:"正在读取项目版本…",unknownTime:"时间未知",sourceDownloaded:"源码已下载。",projectSummary_one:"{{count}} 个版本 · 更新于 {{time}}",projectSummary_other:"{{count}} 个版本 · 更新于 {{time}}",versionSummary_one:"{{time}} · {{count}} 个文件",versionSummary_other:"{{time}} · {{count}} 个文件",noVersionDescription:"暂无版本描述",latestVersion:"最新版本",defaultVersionName:"版本 · {{time}}",rename:{projectTitle:"修改项目名称",versionTitle:"修改版本名称",projectLabel:"项目名称",versionLabel:"版本名称",hint:"支持中英文、数字和常见标点,最多 {{max}} 个字符。",required:"请输入名称。",tooLong:"名称不能超过 {{max}} 个字符。",invalidCharacters:"名称不能包含换行、控制字符、不可见格式字符或 < >。",save:"保存名称",saving:"保存中…",updated:"名称已更新。",failed:"名称保存失败,请重试。"},verified:"已验证",pendingVerification:"待确认",viewSource:"查看源码",download:"下载",downloading:"下载中…",optimize:"去优化",optimizeUnavailable:"去优化,暂不支持",errors:{projects:"无法读取已保存项目。",source:"无法读取项目源码。",versions:"无法读取项目版本。",download:"下载源码失败。",prepareDeployment:"无法准备部署源码。",deleteVersion:"删除项目版本失败。",migrated:"无法读取已迁移项目",saved:"无法读取已保存项目"},empty:{migratedTitle:"还没有已迁移的项目",savedTitle:"还没有已保存的项目",migratedDescription:"完成首次迁移后,源码会自动保存在这里。",savedDescription:"完成首次构建后,源码会自动保存在这里。",noVersions:"这个项目还没有可用版本。"},compare:{selected:"已选择 {{count}}/2",selectedLabel:"已选择",select:"选择",view:"查看对比",start:"对比版本"},delete:{title:"删除这个版本?",onlyVersion:"“{{name}}”只有这一个版本,删除后项目也会移除。此操作无法撤销。",description:"该版本的源码和验证记录将永久删除,其他版本不受影响。",confirm:"删除版本"}},bQe={title:"选择创建方式",subtitle:"以不同模式构建您的智能体",features:"特性",quick:{title:"快速模式",description:"动态派生子智能体自主完成任务",features:{dynamicSubagents:"动态派生子智能体",autonomousPlanning:"自主规划执行",collaboration:"多智能体协作",summary:"自动汇总结果",skills:"按需调用技能",trace:"任务过程可追踪"}},traditional:{title:"传统模式",description:"高度自定义您的智能体结构",features:{visualConfig:"可视化配置",migration:"存量智能体迁移",debugging:"实时调试",optimization:"可选性能优化",parameters:"精细参数控制"}}},xQe={placeholder:"输入系统提示词;键入 ## 加空格可创建二级标题…",toolbar:{undo:"撤销 {{shortcut}}",redo:"重做 {{shortcut}}",paragraph:"正文",quote:"引用",heading:"标题 {{level}}",selectBlockType:"选择文本类型",blockType:"文本类型",bold:"加粗",removeBold:"取消加粗",italic:"斜体",removeItalic:"取消斜体",bulletedList:"无序列表",numberedList:"有序列表"}},wQe={local:{duplicatesSkipped:"已跳过重复技能:{{names}}",invalidDrop:"请拖入包含 SKILL.md 的文件夹或一个 .zip 文件",readError:"读取失败:{{detail}}",dropLabel:"拖入文件夹或 ZIP,自动识别 Skill",hint:"每个技能需包含 SKILL.md。支持包含多个技能的目录。",reading:"正在读取文件…",fileCount:"本地 · {{count}} 个文件"},hub:{searchError:"搜索失败,请稍后重试。",searchPlaceholder:"搜索火山 Find Skill 技能广场,例如 数据分析、PDF…",search:"搜索",searching:"正在搜索…",noResults:"没有找到匹配的技能,换个关键词试试。",hint:"输入关键词搜索火山 Find Skill 技能广场,所选技能会在生成项目时下载到 skills/ 目录。"},space:{loadError:"加载失败",loadingSpaces:"正在加载 AgentKit Skills 中心…",noSpaces:"此账号下没有 AgentKit Skills 中心。",selectSpace:"选择 AgentKit Skills 中心",openConsole:"在火山引擎控制台打开",loadingSkills:"正在加载技能列表…",noSkills:"此 AgentKit Skills 中心暂无技能。"}},AQe={unnamedNode:"未命名节点",editInstruction:"点击编辑指令…",controls:{ariaLabel:"工作流画布控制",zoomIn:"放大",zoomOut:"缩小",fitView:"适应视图"},sections:{info:"工作流信息",execution:"执行方式",nodes:"节点",nodeConfig:"节点配置"},types:{sequential:{label:"顺序",description:"节点依次执行"},parallel:{label:"并行",description:"节点同时执行"},loop:{label:"循环",description:"节点循环执行"}},placeholders:{description:"这个工作流做什么…",agentDescription:"这个 Agent 做什么…",instruction:"你是一个…"},errors:{workflowNameUnique:"名称须与 Agent 节点名称保持唯一",agentNameUnique:"Agent 名称在当前工作流中必须唯一"},dragHint:"拖拽到画布,或点击下方按钮添加",agentNode:"Agent 节点",addNode:"添加节点",connectHint:"拖拽节点的圆点连线以表达执行顺序。",create:"创建工作流",deleteNode:"删除节点",nameHelp:"仅使用英文字母、数字和下划线,且名称保持唯一。",instruction:"指令 (instruction)",tools:"工具 (逗号分隔)",nodeId:"节点 ID",empty:{selectNode:"选择一个节点以编辑其配置",summary:"共 {{nodes}} 个节点 · {{edges}} 条连线"}},SQe={ariaLabel:"快速模式创建",progress:"快速模式创建进度",steps:{agent:{label:"智能体",title:"基本信息",description:"设置智能体的名称、用途、行为方式与能力"},environment:{label:"执行环境",title:"配置执行环境",description:"选择默认环境或已构建的自定义环境"},deployment:{label:"部署偏好",title:"部署偏好",description:"定义 AgentKit 云上参数"}},model:{label:"模型",source:"模型来源",name:"模型名称",fallbacks:"Fallback 模型",fallbackPlaceholder:"备用模型名称",addFallback:"添加备用模型",addProviderFallback:"添加其他服务商",removeFallback:"移除",fallbackType:"备用模型类型",fallbackSameProvider:"同服务商",fallbackOtherProvider:"其他服务商",apiKeyEnv:"API Key 环境变量",invalidApiKeyEnv:"环境变量名只能包含字母、数字和下划线,且不能以数字开头。",fallbackHelp:"同服务商备用模型复用主模型连接;其他服务商会使用单独的 provider、API Base 和 API Key。",fallbackIgnored:"空值、重复值或与主模型相同的模型会被忽略。",provider:"服务商 Provider",invalidApiBase:"请输入合法的 http:// 或 https:// 链接。",volcengineArk:"火山方舟",custom:"自定义",gateway:"模型网关",comingSoon:"待上线",currentApiKey:"当前 API Key",currentConfiguration:"当前配置",loadingApiKeys:"正在加载 API Key",selectApiKey:"选择 API Key",searchApiKeys:"搜索 API Key 名称",noApiKeys:"暂无可用 API Key",loadingModels:"正在加载模型",selectModel:"选择模型",searchModels:"搜索名称、Model ID 或服务商",noModels:"没有可用的模型",apiKeyPlaceholder:"请输入模型 API Key",credentialsLoadError:"模型凭据加载失败",modelsLoadError:"模型列表加载失败"},identity:{unnamedPool:"未命名用户池",currentPool:"{{value}}(当前用户池)",userPool:"用户池",loading:"正在加载用户池",placeholder:"请选择用户池",search:"搜索用户池",empty:"当前账号下暂无 Identity 用户池",currentHint:"当前 Studio 的登录 JWT 将透传访问此 Runtime",mismatchHint:"所选用户池不是当前 Studio 使用的用户池,部署后无法从 Studio 调用此 Runtime",selectionHint:"当前 Studio 使用的用户池已在列表中标注"},agent:{namePlaceholder:"输入智能体名称",descriptionPlaceholder:"说明这个智能体可以做什么",prompt:"提示词",promptPlaceholder:"定义角色、目标和行为边界",skills:"技能",addSkill:"添加技能"},validation:{descriptionRequired:"请输入描述",promptRequired:"请输入提示词",modelRequired:"请选择模型",apiKeyRequired:"请先填写或选择模型 API Key",instanceIntegers:"最小实例数必须为大于等于 0 的整数,最大实例数必须为大于 0 的整数",instanceOrder:"最小实例数不能大于最大实例数",userPoolRequired:"请选择用于 Runtime 鉴权的用户池"},deployment:{runtimeName:"Runtime 名称",runtimeNameUpdateHint:"更新时保持现有 Runtime 名称不变",runtimeNameHint:"仅支持英文字母、数字、下划线和连字符",region:"发布区域",authentication:"鉴权方式",apiKeyDescription:"默认方式,使用 Runtime API Key 访问",userPoolDescription:"使用 Identity 用户池签发的 JWT",sessionStorage:"会话存储",inMemoryStorage:"In-memory 临时存储",backends:{sqlite:"SQLite 文件",mysql:"MySQL",postgresql:"PostgreSQL"},instances:"实例设置",minInstances:"最小实例数",maxInstances:"最大实例数",inMemoryHint:"为避免多实例间会话丢失,推荐将 Runtime 固定为 1~1",networkMode:"网络模式",network:{public:"公网",private:"私网",both:"公网与私网"},subnetIds:"子网 ID(可选,多个用逗号分隔)",sharedInternet:"VPC 内共享公网出口",sharedInternetHint:"允许私网 Runtime 通过共享出口访问公网",evaluationSets:"评测集",createEvaluationSets:"自动创建评测集",evaluationSetsHint:"部署成功后自动创建 Good Case 和 Bad Case 评测集",resources:"资源配置",complete:"部署已完成",preparing:"正在准备部署…"},environmentVariables:{title:"环境变量",add:"添加变量",nameAriaLabel:"环境变量名称",valueAriaLabel:"{{name}} 的值",deleteNamed:"删除 {{name}}"},actions:{updateAgain:"再次更新",deployAgain:"重新部署",updateAndPublish:"更新并发布",applyProfile:"应用 Profile",applyProfileAgain:"再次应用 Profile"}},TQe={actions:{addSubagent:"添加子 Agent",clearRoot:"清空根 Agent",clearRootConfirmation:"清空根 Agent 的全部配置和子 Agent?此操作无法撤销。"},workspace:{progress:"Agent 创建进度",modes:{build:"架构",validate:"调试",optimize:"优化",environment:"环境",publish:"发布"},titles:{build:"个性化您的智能体架构",validate:"调试您的智能体",optimize:"为您的智能体选择优化项",environment:"配置云上环境",publish:"准备好部署您的智能体"}},sections:{type:{label:"Agent 类型",hint:"选择 Agent 类型"},basic:{label:"基本信息",hint:"名称、描述与系统提示词"},model:{label:"模型配置",hint:"模型与服务(可选)"},tools:{label:"工具",hint:"可调用的能力"},skills:{label:"技能",hint:"声明式技能"},knowledge:{label:"知识库",hint:"外部知识检索"},memory:{label:"记忆",hint:"短期与长期记忆"},subagents:{label:"子 Agent",hint:"嵌套协作"},review:{label:"完成",hint:"预览并创建"}},agentTypes:{ariaLabel:"Agent 类型",remoteChildOnly:"远程智能体只能作为子步骤使用",llm:{label:"智能体",fullLabel:"LLM 智能体",description:"大模型驱动,自主完成任务"},sequential:{label:"分步协作",fullLabel:"顺序型智能体",description:"子 Agent 按顺序依次执行"},parallel:{label:"同时处理",fullLabel:"并行型智能体",description:"子 Agent 并行执行后汇总"},loop:{label:"循环执行",fullLabel:"循环型智能体",description:"子 Agent 循环执行到满足条件"},a2a:{label:"远程智能体",fullLabel:"远程 Agent",description:"通过 A2A 协议调用远程 Agent"}},basic:{agentName:"Agent 名称",name:"名称",agentDescription:"智能体描述",descriptionPlaceholder:"简要描述这个 Agent 的用途,便于团队识别…",nameHelp:"遵循 Google ADK 命名规则,且在执行流程中保持唯一。",rootDescriptionHelp:"完整描述会保留;部署时会自动整理为符合 Runtime 规范的单行描述。",descriptionHelp:"描述会显示在 Agent 列表与选择器中。",orchestratorHelp:"这是一个协作容器,本身不生成回答。请在左侧画布中添加任务步骤,并通过拖拽调整它们的位置。",maxIterations:"最大轮次",maxIterationsHelp:"循环编排反复执行子 Agent,直到满足条件或达到该轮次上限。",agentCenter:"AgentKit 智能体中心",agentCenterHelp:"远程 Agent 的名称、描述和能力来自中心返回的 Agent Card。系统会根据每轮任务动态发现并挂载匹配的 Agent。",moreOptions:"更多选项",systemPrompt:"系统提示词",loadingMarkdown:"正在加载 Markdown 编辑器…",markdownHelp:"支持 Markdown 快捷输入,例如键入 ## 加空格创建二级标题。",unnamed:"未命名",unnamedAgent:"未命名智能体"},validation:{remoteRoot:"远程 Agent 只能作为子 Agent",missingRegistry:"请选择 AgentKit 智能体中心",name:{required:"名称为必填项",reserved:"user 是 Google ADK 保留名称,请使用其他名称",characters:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"},duplicateName:"Agent 名称在当前结构中必须唯一",missingDescription:"描述为必填项",mcpDuplicateName:"MCP 名称重复,请为每个服务使用唯一名称",mcpDuplicateUrl:"MCP 地址重复,请删除重复服务后再发布",missingSubagent:"缺少子 Agent",missingPrompt:"系统提示词为必填项",apiKeyRequired:"请先填写或选择模型 API Key",missingSubagentDetail:"{{type}}至少需要添加一个子 Agent 后才能调试或发布。",problem:"{{name}}:{{problem}}"},ai:{ariaLabel:"AI 自动填写 Agent 配置",minimumLength:"请至少输入 {{count}} 个字符。",replaceConfirmation:"生成的新配置会替换当前画布和属性,确定继续吗?",placeholder:"描述目标,使用 {{model}} 模型一键生成配置",generate:"智能生成",generating:"正在智能生成",success:"生成成功",regenerate:"重新生成",failed:"智能生成失败"},debug:{ariaLabel:"智能体调试工作区",unavailable:"当前后端暂不支持生成 Agent 调试运行。",baseline:"基准组",comparison:"对照组 {{count}}",selectModel:"请选择模型",enterDescription:"请输入描述",enterPrompt:"请输入系统提示词",duplicateConfiguration:"测试配置不能重复",starting:"启动中…",applyAndRestart:"应用并重启",restart:"重新启动",start:"启动环境",defaultModel:"默认模型",testConfiguration:"测试配置",deleteVariant:"删除 {{name}}",deleteVariantGroup:"删除对照组",creatingEnvironment:"正在创建测试环境…",configurationChanged:"配置已变更,请重新启动环境。",ready:"环境已就绪",readyHint:"发送消息以比较智能体回复。",startHint:"先完善配置,再启动环境。",viewTraceNamed:"查看 {{name}} 的调用链路",traceUnavailable:"发送消息后可查看调用链路",trace:"调用链路",useConfiguration:"使用此配置",finishConfiguration:"完成配置",finishAndStart:"完成并启动",currentAgentModel:"当前 Agent 模型",configurationHint:"修改仅用于本次对比,选择使用后才会进入部署流程。",messagePlaceholder:"向已启动的测试环境发送消息…",startOneFirst:"请先启动至少一个测试环境",addVariant:"添加对照组",traceTitle:"调用链路 · {{name}}",leaveTitle:"离开调试?",leaveDescription:"离开调试页面后,当前环境将被清理。您可以通过重新启动环境进行新的测试。",cleaning:"清理中…",confirmLeave:"确定离开",closeLeaveConfirmation:"关闭离开调试确认"},optimization:{ariaLabel:"智能体优化选项",scenario:"优化场景",components:"优化组件",bytePlusUnavailable:"BytePlus 账号暂不支持 Harness Sidecar 优化项。请保持优化项为空后继续部署,普通 BytePlus 智能体不受影响。",releaseScenario:"优化场景:{{profile}}",profiles:{default:{label:"自定义",description:"按需选择组件,不勾选时不启动 Sidecar。"},ops:{label:"运维场景",description:"适用于运维诊断、数据库、日志和监控 MCP。"}},groups:{quality:"提升回答质量",cost:"降低运行成本",stability:"增强运行稳定性"},options:{context_engine:{label:"上下文治理",description:"治理上下文组装、任务锚定和上下文预算。"},compressor:{label:"上下文与结果压缩",description:"压缩长上下文和大型工具结果,降低 Token 成本。"},verifier:{label:"回答校验与修复",description:"校验证据和回答,在失败时执行修复或告警。"},long_run_control:{label:"Goal 任务控制",description:"管理 Goal 任务的进度、续跑和结束条件。"},mcp_resilience:{label:"MCP 稳定性治理",description:"治理连接、超时、空结果、大返回和调用预算;默认包含 SQL 只读保护。"}}},model:{label:"模型",source:"模型来源",volcanoArk:"火山方舟",volcengineArk:"火山方舟",bytePlusModelArk:"BytePlus ModelArk",custom:"自定义",gateway:"模型网关",comingSoon:"待上线",configuration:"模型配置",name:"模型名称",fallbacks:"Fallback 模型",fallbackPlaceholder:"备用模型名称",addFallback:"添加备用模型",addProviderFallback:"添加其他服务商",removeFallback:"移除",fallbackType:"备用模型类型",fallbackSameProvider:"同服务商",fallbackOtherProvider:"其他服务商",apiKeyEnv:"API Key 环境变量",invalidApiKeyEnv:"环境变量名只能包含字母、数字和下划线,且不能以数字开头。",fallbackHelp:"同服务商备用模型复用主模型连接;其他服务商会使用单独的 provider、API Base 和 API Key。",fallbackIgnored:"空值、重复值或与主模型相同的模型会被忽略。",provider:"服务商 Provider",invalidApiBase:"请输入合法的 http:// 或 https:// 链接。",liteLlmProviders:"LiteLLM 支持列表",apiKeyPlaceholder:"请输入模型 API Key",available:"已开通",retiring:"即将下线",notActivated:"未开通",unavailable:"暂不可用",apiKeyLoadError:"加载 Ark API Key 失败",loadingApiKeys:"正在加载 API Key…",selectApiKey:"选择 API Key",currentApiKey:"当前 API Key",apiKeyList:"API Key 列表",searchApiKey:"搜索 API Key",searchApiKeyName:"搜索 API Key 名称",noApiKeys:"暂无可用 API Key",noMatchingApiKey:"没有匹配的 API Key",loading:"正在加载模型…",loaded:"已加载 {{count}} 个模型",loadError:"加载模型失败",selectModel:"选择模型",selectProviderModel:"选择服务商模型",providerModels:"服务商模型",search:"搜索模型",searchPlaceholder:"搜索名称、Model ID 或服务商",noMatches:"没有匹配的模型",empty:"暂无可用模型",unknownStatus:"未知状态",refresh:"刷新",refreshing:"刷新中…",activate:"开通",activateAction:"前往开通",currentConfiguration:"当前配置"},tools:{builtIn:"内置工具",builtInHelp:"勾选 VeADK 提供的内置能力,生成时会自动补全 import 与所需环境变量。",codeExecution:"代码执行配置",codeExecutionHelp:"指定 AgentKit 代码执行沙箱。",mcp:"MCP 工具"},catalog:{web_search:{label:"联网搜索",description:"火山引擎 Web Search,获取实时信息。"},parallel_web_search:{label:"并行联网搜索",description:"并行发起多条搜索查询,更快汇总。"},link_reader:{label:"网页读取",description:"抓取并阅读给定链接的正文内容。"},web_scraper:{label:"网页爬取",description:"结构化爬取网页(需要 Scraper 服务)。"},image_generate:{label:"图像生成",description:"文生图(Doubao Seedream)。"},image_edit:{label:"图像编辑",description:"图生图 / 编辑(Doubao SeedEdit)。"},video_generate:{label:"视频生成",description:"文/图生视频(Doubao Seedance),含任务查询。"},text_to_speech:{label:"语音合成 (TTS)",description:"把文本转成语音(火山语音)。"},run_code:{label:"代码执行",description:"在沙箱中执行代码。"},vesearch:{label:"VeSearch 智能搜索",description:"火山 VeSearch(需要 bot 端点)。"},links:{console:"控制台",documentation:"文档"},env:{modelAgentName:{comment:"模型名称"},embeddingModelName:{comment:"向量化模型(记忆/知识库需要)"},vikingMemoryProject:{comment:"VikingDB 记忆库项目"},vikingMemoryRegion:{comment:"VikingDB 记忆库地域"},vikingMemoryType:{comment:"记忆类型"},feishuAppId:{comment:"飞书应用 App ID"},feishuAppSecret:{comment:"飞书应用 App Secret",placeholder:"输入 App Secret"},registrySpaceId:{comment:"AgentKit 智能体中心",placeholder:"请选择智能体中心"},registryTopK:{comment:"召回 Agent 数量"},registryRegion:{comment:"AgentKit 智能体中心地域"},registryEndpoint:{comment:"AgentKit 智能体中心 OpenAPI 地址"},agentKitToolId:{comment:"代码执行沙箱 ID"},agentKitToolRegion:{comment:"AgentKit Tools 地域"},openVikingUrl:{comment:"OpenViking 服务地址"},openVikingMemoryUserId:{comment:"记忆归属 ID",help:"对应 viking://user/<此值>/peers/<请求用户>/memories 中的 user 段;用于隔离 Agent、租户或业务场景,默认 default。"},openVikingMemoryPolicy:{comment:"记忆策略",help:"记忆的抽取策略和隔离策略,不填写时使用官方默认策略。"},openVikingKnowledgeUserId:{comment:"知识库归属 ID",help:"未配置资源目录时用于默认路径 viking://user/<此值>/resources/<知识库索引>/,默认 default。"},openVikingTargetUri:{comment:"知识库资源目录",help:"留空时由 KnowledgeBase index 自动生成;填写后直接检索该 OpenViking 资源目录,优先级最高。"},tlsServiceName:{comment:"TLS topic_id,留空自动创建"}}},backends:{shortTerm:{local:{label:"本地内存",description:"进程内,不持久化。适合开发调试。"},sqlite:{label:"SQLite 文件",description:"持久化到本地 .db 文件。"},mysql:{label:"MySQL",description:"持久化到 MySQL。"},postgresql:{label:"PostgreSQL",description:"持久化到 PostgreSQL。"}},longTerm:{local:{label:"本地向量库",description:"进程内 llama-index 向量库。"},opensearch:{label:"OpenSearch",description:"OpenSearch 向量检索。"},redis:{label:"Redis",description:"Redis 向量检索。"},viking:{label:"VikingDB Memory",description:"VikingDB 记忆库(支持用户画像)。"},openviking:{label:"OpenViking Memory",description:"OpenViking 长期记忆,按用户维度保存和检索偏好、事件与实体。"},mem0:{label:"Mem0",description:"Mem0 托管记忆服务。"}},knowledge:{viking:{label:"VikingDB Knowledge",description:"VikingDB 知识库。"},opensearch:{label:"OpenSearch",description:"OpenSearch 向量检索。"},context_search:{label:"Context Search",description:"火山 Context Search 引擎(无需向量化)。"},openviking:{label:"OpenViking Knowledge",description:"OpenViking 资源目录知识库,无需向量化模型配置。"}}},exporters:{apmplus:{label:"APMPlus",description:"火山 APMPlus 应用性能监控。"},cozeloop:{label:"CozeLoop",description:"扣子 CozeLoop 链路观测。"},tls:{label:"TLS (日志服务)",description:"火山 TLS 日志服务导出。"}},knowledge:{title:"知识库",description:"启用外部知识检索(RAG),让 Agent 基于你的资料作答。",backend:"知识库后端",vikingDatabase:"VikingDB 知识库"},memory:{shortTerm:"短期记忆",shortTermDescription:"存储单会话上下文",shortTermBackend:"短期记忆后端",longTerm:"长期记忆",longTermDescription:"存储跨会话上下文,通常使用向量化检索",longTermBackend:"长期记忆后端",vikingDatabase:"VikingDB 记忆库",autoSave:"自动保存会话到长期记忆",autoSaveDescription:"会话结束时自动把内容写入长期记忆,无需手动调用。"},mcp:{removeTool:"删除 MCP 工具",namePlaceholder:"名称(可选)",urlPlaceholder:"MCP 服务地址",pathWarning:"当前填写的是网关根地址。仅当根路径就是 MCP Endpoint 时可直接使用;否则请补充完整服务路径。",tokenPlaceholder:"Bearer Token(可选)",showToken:"显示 Bearer Token",hideToken:"隐藏 Bearer Token",commandPlaceholder:"命令,例如 npx",argsPlaceholder:"参数,以空格分隔",stdioHint:"stdio 工具在部署环境中启动,请确保命令和依赖可用。",addTool:"添加 MCP 工具"},resources:{unnamedAgentCenter:"未命名智能体中心",unnamedKnowledgeBase:"未命名知识库",unnamedMemory:"未命名记忆库",loadError:"加载失败",loadingAgentCenters:"正在加载智能体中心…",agentCentersLoaded:"已加载 {{count}} 个智能体中心",noAgentCenters:"暂无智能体中心",noMatchingAgentCenters:"没有匹配的智能体中心",searchAgentKitCenter:"搜索 AgentKit 智能体中心",searchNameOrId:"搜索名称或 ID",selectAgentCenter:"选择智能体中心",selectAgentKitCenter:"选择 AgentKit 智能体中心",selectedAgentCenter:"已选智能体中心",agentKitCenter:"AgentKit 智能体中心",refreshAgentCenters:"刷新智能体中心",knowledgeBaseList:"知识库列表",knowledgeBasePlaceholder:"选择知识库",loadingKnowledgeBases:"正在加载知识库…",knowledgeBasesLoaded:"已加载 {{count}} 个知识库",noKnowledgeBases:"暂无知识库",noMatchingKnowledgeBases:"没有匹配的知识库",searchKnowledgeBase:"搜索知识库",selectKnowledgeBase:"选择知识库",refreshKnowledgeBases:"刷新知识库",memoryList:"记忆库列表",memoryPlaceholder:"选择记忆库",loadingMemories:"正在加载记忆库…",memoriesLoaded:"已加载 {{count}} 个记忆库",noMemories:"暂无记忆库",noMatchingMemories:"没有匹配的记忆库",searchMemory:"搜索记忆库",selectMemory:"选择记忆库",refreshMemories:"刷新记忆库"},env:{noAdditionalParameters:"此后端无需额外运行参数。",invalidJson:"请输入有效的 JSON。",helpAriaLabel:"{{label}}说明:{{help}}",openOpenViking:"打开 OpenViking {{label}}",valuePlaceholder:"请输入参数值",openVikingIndex:"OpenViking 资源索引",openVikingIndexHelp:"默认值:留空;生成项目时使用 Agent 名自动生成,例如 my_agent_kb。未配置 DATABASE_OPENVIKING_TARGET_URI 时,默认 URI 拼接为 viking://user/{知识库归属 ID,未填则 default}/resources/{资源索引}/;如果填写了 DATABASE_OPENVIKING_TARGET_URI,则直接使用该完整 URI。",openVikingIndexAriaLabel:"OpenViking 资源索引说明:{{help}}"},deployment:{vpcRequired:"使用 VPC 网络时,请填写 VPC ID。",apiKeyRequired:"请先选择模型使用的 API Key。",invalidEnvName:"环境变量名称不合法:{{key}}",requiredEnv:"{{name}}:请填写必填环境变量",generatingConfiguration:"正在生成部署配置",runtimeNameExists:"Runtime 名称已存在,请修改后重试。",preparing:"准备部署",applyingMpaProfile:"正在将 Agent 配置应用到 MPA Runtime",mpaProfileApplied:"MPA Runtime 配置已应用",runningMpaSmoke:"正在验证 MPA Runtime 执行链路",mpaReady:"MPA Runtime 已可运行",mpaOperationIncomplete:"MPA Runtime 初始化未完成,请重试此部署任务。",complete:"部署完成",failed:"部署失败",updateAndPublish:"更新并发布",stages:{build:"构建镜像",deploy:"部署 Runtime",publish:"发布服务",applyMpaProfile:"应用 MPA 配置",verifyMpaRuntime:"验证 MPA Runtime",mpaReady:"MPA Runtime 可运行",running:"部署中"}},publish:{generating:"正在生成发布配置",validating:"校验 Agent 结构并准备部署快照…"}},CQe={presets:{support:{name:"客服助手",description:"7×24 在线答疑,结合知识库与历史对话,稳定、礼貌地解决用户问题。",instruction:"你是一名专业、耐心的客服助手。请始终保持礼貌、友好的语气,优先依据知识库中的资料回答用户问题;当资料不足以确定答案时,如实告知用户并主动引导其提供更多信息,切勿编造。回答尽量简洁、分点清晰,必要时给出操作步骤。",subagents:{}},analyst:{name:"数据分析师",description:"运行代码完成统计与可视化,开启链路追踪,分析过程可观测、可复现。",instruction:"你是一名严谨的数据分析师。面对数据问题时,先厘清分析目标与口径,再通过编写并运行代码完成清洗、统计与可视化。每一步都要说明你的假设与方法,给出结论时附上关键数据支撑,并指出潜在的偏差与局限。",subagents:{}},translator:{name:"翻译助手",description:"中英互译,忠实、通顺、地道,保留原文语气与专业术语。",instruction:"你是一名专业的翻译助手,精通中英互译。请在忠实于原文含义的前提下,使译文自然、地道、符合目标语言表达习惯;保留专有名词与专业术语的准确性,并尽量贴合原文的语气与风格。仅输出译文,除非用户额外要求解释。",subagents:{}},coder:{name:"代码助手",description:"编写、调试与重构代码,可运行代码验证结果,给出清晰可维护的实现。",instruction:"你是一名资深软件工程师。请根据需求编写正确、清晰、可维护的代码,遵循目标语言的惯用风格与最佳实践。在不确定时通过运行代码验证你的实现,给出关键的边界条件与测试思路,并对复杂逻辑附上简要注释。",subagents:{}},researcher:{name:"研究员",description:"联网检索一手资料,结合知识库与长期记忆,输出有据可查的研究结论。",instruction:"你是一名严谨的研究员。面对研究问题时,先拆解关键子问题,再通过联网检索收集多个一手、可信的来源,交叉验证后再下结论。结论需注明出处与不确定性,区分事实与推断,避免以偏概全。",subagents:{}},"research-team":{name:"多智能体研究团队",description:"由检索员、分析员、撰写员协作的研究编排,分工完成端到端调研报告。",instruction:"你是一支研究团队的总协调者。负责拆解用户的研究任务,将检索、分析、撰写分别委派给对应的子 Agent,汇总各子 Agent 的产出,把控整体质量,最终输出结构清晰、有据可查的研究报告。",subagents:{0:{name:"检索员",description:"联网搜集与课题相关的一手资料与数据。",instruction:"你是研究团队中的检索员。根据课题联网检索多个可信来源,整理出关键事实、数据与原文出处,交付给分析员,不做主观结论。"},1:{name:"分析员",description:"对检索到的材料做交叉验证与归纳分析。",instruction:"你是研究团队中的分析员。对检索员提供的材料做交叉验证、归纳与对比,提炼洞见、识别矛盾与不确定性,形成结构化的分析要点。"},2:{name:"撰写员",description:"将分析结论组织为结构清晰、引用规范的报告。",instruction:"你是研究团队中的撰写员。把分析员的要点组织成结构清晰、语言通顺、引用规范的研究报告,确保每个结论都能追溯到来源。"}}}},tags:{tools:"工具",memory:"记忆",knowledgeBase:"知识库",tracing:"观测",subagents:"子 Agent {{count}}"},gallery:{title:"从模板新建",subtitle:"选择一个预制 Agent 模板,按需微调后即可创建。"},detail:{back:"返回模板列表",name:"名称",systemPrompt:"系统提示词",model:"模型",tools:"工具",memory:"记忆",knowledgeBase:"知识库",tracing:"观测追踪",subagents:"子 Agent({{count}})",create:"使用此模板创建",shortTermMemory:"短期",longTermMemory:"长期"}},kQe={checkingExpiry:"确认有效期中",waitingRecovery:"等待恢复",listFailed:"读取项目列表失败",recoveryFailed:"工作区恢复失败,请重试",operationFailed:"项目操作失败,请重试",title:"代码项目",back:"返回代码项目",restart:"本开发环境将在 {{countdown}} 后重启,请随时保存数据",expiresAt:"有效期至 {{date}}",exitFullscreen:"退出全屏",fullscreen:"全屏",exitFullscreenHint:"退出全屏(Esc)",recovering:"正在恢复工作区,完成后将自动返回项目",retry:"重试连接",search:"搜索代码项目",newTitle:"新建代码项目",new:"新建项目",readingStats:"正在读取项目统计",createdAt:"创建时间",opening:"正在打开",unknownCreatedAt:"创建时间未知",open:"打开项目",empty:"没有匹配的代码项目",close:"关闭新建项目",name:"项目名称",placeholder:"例如 my-agent",nameHelp:"以英文字母开头,可包含字母、数字、下划线和连字符,最多 64 个字符",cancel:"取消",create:"创建项目",files_one:"{{count}} 个文件",files_other:"{{count}} 个文件",directories_one:"{{count}} 个目录",directories_other:"{{count}} 个目录",separator:","},OQe={enabled:"已启用",disabled:"已禁用",unknownStatus:"状态未知",allPermissions:"全部权限",customPermissions:"自定义权限",unknownPermissions:"权限未知",unnamed:"未命名 API Key",search:"搜索名称、状态或权限",noMatches:"没有匹配的 API Key",noModelPermission:"当前 API Key 无权限",modelAvailable:"可用",permissionState:{Available:"可用于对话",Shutdown:"已下线",VideoGeneration:"视频生成模型",Unsupported:"不支持作为对话模型",NotActivated:"尚未开通",Unknown:"未获取到模型状态"}},Cdr=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:mQe,codePackage:gQe,common:cQe,default:{common:cQe,yaml:uQe,validation:dQe,defaults:hQe,helpers:fQe,intelligentDeployment:pQe,codePackage:gQe,buildCanvas:mQe,intelligent:vQe,projectLibrary:yQe,modePicker:bQe,promptEditor:xQe,skills:wQe,workflow:AQe,workbench:SQe,traditional:TQe,template:CQe,workspace:kQe,modelApiKey:OQe},defaults:hQe,helpers:fQe,intelligent:vQe,intelligentDeployment:pQe,modePicker:bQe,modelApiKey:OQe,projectLibrary:yQe,promptEditor:xQe,skills:wQe,template:CQe,traditional:TQe,validation:dQe,workbench:SQe,workflow:AQe,workspace:kQe,yaml:uQe},Symbol.toStringTag,{value:"Module"})),EQe={source:"任务来源",studio:"Studio 定时任务",title:"Runtime 定时任务",selectRuntime:"请先在 Agent 列表中选择一个云端 Runtime。",scope:"展示当前 Studio 用户在此 Runtime 中的定时任务。",refresh:"刷新",loading:"正在获取 Runtime 任务",empty:"此 Runtime 中没有符合条件的定时任务。",authRequired:"Runtime 拒绝了请求,请检查网关访问权限及 Runtime 的鉴权开关。",forbidden:"当前用户没有此 Runtime 的访问权限。",unsupported:"此 Runtime 未提供 mpa 定时任务接口。",invalidResponse:"任务接口返回了无法识别的数据,请检查 Runtime 版本。",loadFailed:"获取任务失败,请检查网络和 Runtime 状态后刷新。",pagination:"Runtime 任务分页",total:"共 {{total}} 条",previous:"上一页",next:"下一页",columns:{name:"任务名称",enabled:"状态",schedule:"执行计划",next:"下次执行",last:"最近结果"},schedule:{once:"单次",interval:"间隔",daily:"每天",weekly:"每周",monthly:"每月",cron:"Cron"},search:"搜索任务",executionCount:"执行次数",successRate:"成功率",prompt:"任务内容",manage:{view:"任务视图",list:"列表",calendar:"日历",create:"创建定时任务",edit:"编辑任务",copy:"复制",delete:"删除",detail:"详情",run:"立即执行",name:"任务",lastRun:"上次执行",schedule:"执行周期",lastStatus:"上次执行状态",agent:"执行 Agent",actions:"操作",all:"全部状态",Pending:"尚未执行",Queued:"已排队",Running:"执行中",Succeeded:"执行成功",Failed:"执行失败",TimedOut:"执行超时",Cancelled:"已取消",Skipped:"已跳过",overview:"执行统计:",prompt:"任务内容",timezone:"时区",localTime:"执行时间(当前设备时区)",time:"执行时间",Once:"单次",Interval:"间隔",Daily:"每天",Weekly:"每周",Monthly:"每月",Cron:"Cron 表达式",seconds:"秒",interval:"间隔秒数",weekdays:"星期(1 为周一,7 为周日,逗号分隔)",monthDays:"每月日期(1–31,逗号分隔)",delivery:"结果投递",Web:"Web",Feishu:"飞书",target:"飞书接收 ID",enabled:"启用任务",cancel:"取消",save:"保存",saving:"保存中",required:"请填写任务名称、Agent ID、任务内容和投递目标。",timezoneInvalid:"请输入有效的 IANA 时区,例如 Asia/Shanghai。",futureTime:"请选择未来的执行时间。",intervalInvalid:"间隔需要为 30–31536000 的整数秒。",daysInvalid:"请输入有效且不重复的日期或星期。",history:"执行记录",duration:"耗时",result:"结果 / 会话",noRuns:"暂无执行记录。",conflict:"任务已被修改或请求发生冲突,请关闭弹窗并刷新后重试。",invalid:"请求校验失败,请检查用户身份、执行时间、Agent ID 和任务配置。",queued:"已提交执行请求。",saved:"任务已更新。",deleteConfirm:"确定删除“{{name}}”?删除后将不再调度此任务。",calendarZone:"显示时区:",prevMonth:"上个月",nextMonth:"下个月",today:"今天",nextOnly:"仅下次",calendarHint:"日历展示预计执行安排;复杂 Cron 仅显示服务端给出的下一次执行时间。"}},_Qe={backToList:"返回定时任务列表",cancel:"取消",cancelQueue:"取消排队",cancelQueueFirst:"请先取消排队",cancelling:"取消中…",closeDrawer:"关闭抽屉",collapse:"收起",connectingRuntime:"正在连接 Runtime…",createScheduledTask:"创建定时任务",createTask:"创建任务",delete:"删除",deleteTask:"删除任务",edit:"编辑",enable:"启用",expand:"展开",pause:"暂停",refresh:"刷新",refreshHistory:"刷新执行历史",rerun:"重新执行",retry:"重试",runNow:"立即执行",saveChanges:"保存更改",saving:"保存中…",stop:"终止执行",stopRun:"终止本次执行",stopRunFirst:"请先终止当前执行",stopping:"终止中…",viewDetails:"查看详情"},RQe={cancelDescription:"本次 Session 将被取消,后续计划不会暂停。",cancelTitle:"终止本次执行?",deleteDescription:"“{{name}}”及其全部执行历史将被永久删除。",deleteTitle:"删除定时任务?"},DQe={configuration:"任务配置",nextRun:"下次执行",pageLabel:"定时任务详情",region:"地域",runtime:"运行时",status:"任务状态"},LQe={createTitle:"创建定时任务",description:"每次触发都会为 Runtime Agent 创建独立 Session。",editTitle:"编辑定时任务"},MQe={minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",seconds:"{{count}} 秒"},IQe={cronExpression:"Cron 表达式",cronHelp:"依次填写分钟、小时、日期、月份、星期。",dailyTime:"每天执行时间",enableAfterCreate:"创建后启用",enableHelp:"启用后会从下一个计划时间开始执行。",name:"任务名称",namePlaceholder:"例如:每日生成运营摘要",noRuntime:"暂无可用 Runtime",prompt:"执行文本",promptPlaceholder:"输入每次执行时发送给 Agent 的固定文本",runAt:"执行时间",runtimeAgent:"运行时智能体",runtimeHelp:"任务始终跟随该 Runtime 当前生效版本。",runtimePlaceholder:"选择 Runtime Agent",schedule:"执行计划",scheduleType:"执行计划类型",timezone:"时区",weekday:"星期"},PQe={all:"全部"},NQe={description:"每次运行均使用独立 Session,结果与错误会永久保留。",duration:"耗时 {{duration}}",emptyDescription:"任务触发或立即执行后,记录会显示在这里。",emptyTitle:"暂无执行记录",errorDetails:"错误详情",finalAnswer:"最终回答",loadFailed:"无法加载执行历史",loadFailedDescription:"请检查 Studio 服务后重试。",session:"会话",title:"执行历史"},BQe={cancelRequested:"已提交终止请求。",created:"任务已创建。",deleted:"任务及其执行历史已删除。",enabled:"任务已启用。",paused:"任务已暂停。",queued:"任务已排队,将在一分钟内开始执行。",requeued:"任务已重新排队,将在一分钟内开始执行。",updated:"任务已更新。"},$Qe={filterLabel:"定时任务状态筛选",listLabel:"定时任务列表",loadFailed:"无法加载定时任务",loadFailedDescription:"请检查 Studio 服务后重试。",title:"定时任务"},FQe={cron:"Cron {{cron}}{{zone}}",daily:"每天 {{time}}{{zone}}",once:"一次 · {{date}}{{zone}}",weekly:"{{weekday}} {{time}}{{zone}}"},zQe={daily:"每天",once:"一次性",weekly:"每周"},UQe={cancelled:"已取消",enabled:"已启用",failed:"失败",notRun:"尚未执行",paused:"已暂停",pending:"准备中",queued:"已排队",retrying:"自动重试中",running:"执行中",skipped:"已跳过",success:"成功"},VQe={cronFields:"Cron 表达式需要包含 5 个字段,例如 0 9 * * *。",nameRequired:"请输入任务名称。",promptRequired:"请输入每次执行时发送给 Agent 的文本。",runtimeAppMissing:"Runtime Agent 未返回可调用的 appName,请确认 Runtime 已就绪且版本兼容。",runtimeRequired:"请选择可用的 Runtime Agent。",timeRequired:"请选择执行时间。"},GQe={friday:"周五",monday:"周一",saturday:"周六",sunday:"周日",thursday:"周四",tuesday:"周二",wednesday:"周三"},kdr=Object.freeze(Object.defineProperty({__proto__:null,actions:_Qe,confirm:RQe,default:{mpa:EQe,actions:_Qe,confirm:RQe,detail:DQe,drawer:LQe,duration:MQe,fields:IQe,filters:PQe,history:NQe,notices:BQe,page:$Qe,schedule:FQe,scheduleTypes:zQe,status:UQe,validation:VQe,weekdays:GQe},detail:DQe,drawer:LQe,duration:MQe,fields:IQe,filters:PQe,history:NQe,mpa:EQe,notices:BQe,page:$Qe,schedule:FQe,scheduleTypes:zQe,status:UQe,validation:VQe,weekdays:GQe},Symbol.toStringTag,{value:"Module"})),QQe="快速创建 Agent",HQe="Agent 类型",WQe="关闭",YQe="部署",qQe="预览配置",jQe="已发起配置包下载",XQe="下载失败,请重试",KQe="有 {{count}} 处配置需要修改",ZQe="自定义",JQe="自定义{{field}}",eHe="输入自定义值",tHe="该模型未声明推理强度,使用服务端设置",rHe="请先为该提供方添加模型",nHe="请先选择提供方",iHe="请选择",aHe="可选",oHe="默认模型、Agent 预设和权限用于新会话;预设需要存在于部署的 Harness 中",sHe="仅填写环境变量名称,实际密钥由部署环境提供",lHe="read-only 为只读,workspace-write 可写工作区,danger-full-access 允许完整访问且不请求确认",cHe="allowedModels 是子 Agent 可选择的模型列表,启用后至少填写一组提供方和模型",uHe="添加自定义模型服务,填写它的端点、协议和模型 ID,支持火山引擎和 BytePlus 等兼容服务",dHe="当前覆盖常用原生设置,其他插件参数与预设文件尚未接入",hHe="查看原生配置文档",fHe="模型提供方 {{index}}",pHe="模型 {{index}}",gHe="添加模型提供方",mHe="移除提供方 {{index}}",vHe="添加模型",yHe="移除模型 {{index}}",bHe="添加可选模型",xHe="移除可选模型 {{index}}",wHe="移除",AHe="填写服务端的模型 ID",SHe={provider:"提供方 {{index}}",model:"模型 {{index}}"},THe={defaults:"会话默认设置",deepseek:"DeepSeek 模型服务",providers:"自定义模型提供方",shell:"命令执行",loop:"工具调用",subagents:"子 Agent 模型选择",search:"DeepSeek 网络搜索"},CHe={id:"提供方 ID",displayName:"显示名称",baseURL:"服务地址",api:"接口协议",apiKeyEnv:"密钥环境变量"},kHe={id:"例如 company-models",displayName:"可选,默认使用提供方 ID",baseURL:"https://…/v1",api:"选择接口协议",apiKeyEnv:"例如 MODEL_API_KEY"},OHe={id:"模型 ID",name:"显示名称",contextWindow:"上下文容量",maxTokens:"最大输出容量"},EHe={positive:"请输入大于 0 的数值",integer:"请输入有效的正整数",env:"请输入环境变量名,只能包含字母、数字和下划线,且不能以数字开头",url:"请输入 HTTP 或 HTTPS 地址,不要在地址中包含凭据",option:"请选择受支持的原生选项",required:"请补全此项",duplicate:"该 ID 或模型组合已存在",providerId:"以小写字母开头,可包含小写字母、数字、点、下划线和连字符,不能使用保留 ID",routes:"请至少填写一组完整的提供方和模型",modelPair:"请填写该自定义提供方下的模型 ID",unknownProvider:"请先添加该自定义模型提供方",unknownModel:"请填写该提供方下已配置的模型 ID",timer:"请输入大于 0 且不超过 2147483647 的毫秒数"},_He={"agent-default-model_provider":"默认提供方","agent-default-model_model":"默认模型","agent-default-model_reasoningEffort":"默认推理强度","agent-presets_default":"默认 Agent 预设",permission_defaultPreset:"默认权限预设","llm-deepseek_apiKeyEnv":"密钥环境变量","llm-deepseek_baseURL":"服务地址","llm-deepseek_thinking":"思考模式","llm-deepseek_reasoningEffort":"推理强度","llm-deepseek_maxTokens":"每次请求的输出上限","llm-deepseek_defaultContextWindow":"默认上下文容量","llm-deepseek_streamIdleTimeoutMs":"流式空闲超时(毫秒)",bash_timeoutMs:"默认执行超时(毫秒)",bash_maxTimeoutMs:"最大执行超时(毫秒)",bash_maxOutputBytes:"输出上限(字节)","agent-loop_maxParallelToolCalls":"并行工具调用上限","subagent-model-selection_enabled":"启用模型选择","web-search-deepseek_apiKeyEnv":"密钥环境变量","web-search-deepseek_baseURL":"搜索服务地址","web-search-deepseek_model":"搜索模型","web-search-deepseek_apiVersion":"接口版本","web-search-deepseek_maxTokens":"搜索输出上限","web-search-deepseek_maxUses":"搜索次数上限"},RHe="取消",DHe="返回创建方式",LHe="DeepSeek Harness 配置",Odr=Object.freeze(Object.defineProperty({__proto__:null,addModel:vHe,addProvider:gHe,addRoute:bHe,agentType:HQe,back:DHe,cancel:RHe,close:WQe,coverage:dHe,credentialHelp:sHe,customField:JQe,customValue:ZQe,default:{title:QQe,agentType:HQe,close:WQe,continue:"继续配置",deploy:YQe,preview:qQe,export:"导出配置",downloaded:jQe,downloadFailed:XQe,validationSummary:KQe,customValue:ZQe,customField:JQe,enterCustomValue:eHe,reasoningUnavailable:tHe,modelsUnavailable:rHe,selectProviderFirst:nHe,selectOption:iHe,optional:aHe,defaultsHelp:oHe,credentialHelp:sHe,permissionHelp:lHe,routesHelp:cHe,providersHelp:uHe,coverage:dHe,source:hHe,provider:fHe,model:pHe,addProvider:gHe,removeProvider:mHe,addModel:vHe,removeModel:yHe,addRoute:bHe,removeRoute:xHe,remove:wHe,modelIdPlaceholder:AHe,route:SHe,sections:THe,providerFields:CHe,providerPlaceholders:kHe,modelFields:OHe,errors:EHe,fields:_He,cancel:RHe,back:DHe,pageTitle:LHe},defaultsHelp:oHe,deploy:YQe,downloadFailed:XQe,downloaded:jQe,enterCustomValue:eHe,errors:EHe,fields:_He,model:pHe,modelFields:OHe,modelIdPlaceholder:AHe,modelsUnavailable:rHe,optional:aHe,pageTitle:LHe,permissionHelp:lHe,preview:qQe,provider:fHe,providerFields:CHe,providerPlaceholders:kHe,providersHelp:uHe,reasoningUnavailable:tHe,remove:wHe,removeModel:yHe,removeProvider:mHe,removeRoute:xHe,route:SHe,routesHelp:cHe,sections:THe,selectOption:iHe,selectProviderFirst:nHe,source:hHe,title:QQe,validationSummary:KQe},Symbol.toStringTag,{value:"Module"})),MHe="问题反馈",IHe="问题描述",PHe="常见问题",NHe="取消",BHe="完成",$He="提交反馈",FHe="正在上报…",zHe={title:"上报成功,感谢您的反馈",description:"AgentKit 团队会尽快查看您提交的问题。"},UHe={close:"关闭问题反馈",intro:"请选择遇到的问题,也可以补充具体表现。",privacy:"您的对话数据将会上报到 AgentKit 团队,请注意隐私保护。",descriptionPlaceholder:"请描述问题发生时的表现(选填)",issues:{slow:"执行速度慢",crash:"运行崩溃",incorrect:"结果不准确",tool_error:"工具调用失败",other:"其他问题"}},VHe={description:"告诉我们您在使用 AgentKit Studio 时遇到的问题。",module:"所属模块",modules:{conversation:"对话",agents:"智能体",applications:"自动化",search:"搜索",other:"其他"},commonIssuesMultiple:"常见问题(可多选)",issueTypes:"问题类型",issues:{page_slow:"页面加载慢",feature_unavailable:"功能无法使用",display_error:"页面显示异常",no_response:"操作无响应",other:"其他问题"},descriptionPlaceholder:"请描述问题发生时的页面、操作和表现",quickAdd:"快捷补充",suggestionsLabel:"问题描述推荐",suggestions:{noResponse:"点击后没有反应",loading:"页面一直处于加载状态",incomplete:"部分内容显示不完整",error:"操作后出现错误提示"},privacy:"您的数据将会上报到 AgentKit 团队,请注意隐私保护。"},Edr=Object.freeze(Object.defineProperty({__proto__:null,cancel:NHe,commonIssues:PHe,default:{title:MHe,descriptionLabel:IHe,commonIssues:PHe,cancel:NHe,done:BHe,submit:$He,submitting:FHe,success:zHe,dialog:UHe,page:VHe},descriptionLabel:IHe,dialog:UHe,done:BHe,page:VHe,submit:$He,submitting:FHe,success:zHe,title:MHe},Symbol.toStringTag,{value:"Module"})),GHe={back:"返回",close:"关闭"},QHe={title:"优化迁移项目",closeAria:"关闭优化窗口"},HHe={title:"已迁移项目",description:"管理迁移后的源码版本,也可以选择任一版本继续优化。",libraryTitle:"项目与版本",libraryDescription:"查看、下载、部署或对比源码版本,也可以基于任一版本继续优化。",emptyTitle:"还没有已迁移的项目",emptyDescription:"迁移完成后,源码会自动保存在这里。"},WHe={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any(通用迁移)"},YHe={awaitingUpload:"待上传",analyzing:"分析中",needsInput:"待补充",analysisReady:"待确认",migrating:"迁移中",validating:"校验中",packaging:"打包中",succeeded:"已完成",succeededWithWarnings:"已完成,有提示",partial:"部分完成",failed:"失败",cancelled:"已终止",expired:"已过期"},qHe={evaluationPending:"待评测",evaluationRunning:"评测中",waitingDataset:"待保存评测用例",waitingEnvironment:"待补充环境变量",evaluationFailed:"迁移完成,评测未完成",evaluationBlocked:"迁移完成,评测待处理",evaluationCancelled:"迁移完成,评测已取消",resultUnavailable:"结果不可用",environmentExpired:"环境已过期"},jHe={partialReady:"迁移产物已生成,但交付不完整,请查看迁移提示。",readyWithWarnings:"迁移产物已生成,请查看迁移提示。",ready:"迁移产物已生成。"},XHe={passed:"产物校验通过",failed:"产物校验未通过",degraded:"产物校验未完成"},KHe={session:"创建迁移环境",upload:"上传项目",analysis:"分析项目"},ZHe={agentNameRequired:"请输入 Agent 名称",agentNameInvalid:"Agent 名称必须为 1-63 位,只能包含小写字母、数字和连字符,且必须以字母或数字开头和结尾"},JHe={seconds:"{{seconds}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},eWe={savedUnaffected:"已保存项目不受影响",savingUnaffected:"源码正在保存,完成后不受环境期限影响",activeDetail:"到期后任务记录和临时产物将无法访问",oneHour:"临时迁移环境保留 1 小时",ended:"临时迁移环境已结束",savedAvailable:"已保存项目仍可查看、下载、部署或优化",unavailable:"任务记录和临时产物已无法访问",countdown:"临时迁移环境将在 {{minutes}} 分 {{seconds}} 秒后结束",expiredSavedMessage:"临时迁移环境已结束,已保存项目不受影响。",expiredMessage:"临时迁移环境已结束,任务记录和临时产物无法继续访问。"},tWe={recommended:"建议迁移方式",scope:"迁移范围",excluded:"不在本次范围",viewEvidence:"查看分析证据",viewAssumptions:"查看关键假设",viewSourceEvidence:"查看源码证据"},rWe={ariaLabel:"Codex 执行动态",title:"Codex 执行动态",startingAnalysis:"Codex 正在开始分析…",startingMigration:"Codex 正在开始迁移…",loadError:"暂时无法读取 Codex 执行动态,不影响当前任务。",liveAnalyzing:"正在分析项目",liveMigrating:"正在执行迁移",liveValidating:"正在校验迁移结果",livePackaging:"正在整理迁移产物",liveDelivery:"正在核对交付产物"},nWe={title:"迁移产物",fileTooLarge:"该文件超过 2 MiB,请下载完整产物后查看。",unsupportedPreview:"该文件不支持在线预览,请下载完整产物后查看。",filesAria:"迁移产物文件",searchAria:"搜索产物文件",searchPlaceholder:"搜索文件",limit:"仅展示前 {{count}} 项,请搜索具体文件。",noSelection:"未选择文件",noPreview:"暂无可预览文件。",loadingFile:"正在读取产物文件…",startupFile:"启动文件",fileCountLabel:"文件数",saved:"源码已保存,可继续查看、下载、部署或优化。",saving:"产物已生成,正在保存源码版本。",deployReady:"产物可预览、下载和部署,正在等待源码保存状态。",deployUnavailable:"产物可预览和下载,但当前交付状态不支持部署。",viewProjects:"查看已迁移项目",downloading:"下载中…",downloadZip:"下载 ZIP",deployTitle:"部署迁移产物",deployUnavailableTitle:"当前交付状态不支持部署",deployRuntime:"部署到 Runtime",fileCount:"{{count}} 个文件",startup:"启动文件 {{module}}",loading:"正在读取迁移产物…"},iWe={retiring:"即将下线",currentDefault:"当前默认模型",loadError:"加载模型列表失败",label:"模型",placeholder:"选择模型"},aWe={zipOnly:"请选择 .zip 格式的本地项目文件。",invalidName:"ZIP 文件名无效,请重命名后重新选择。",tooLarge:"项目 ZIP 不能超过 {{size}}。",empty:"项目 ZIP 不能为空。",removeAria:"移除项目 ZIP",reselectPrompt:"重新选择项目 ZIP",selectPrompt:"选择或拖入本地项目 ZIP",reselect:"重新选择",selectZip:"选择 ZIP",continue:"继续上传",start:"上传并分析",inputAria:"选择本地项目 ZIP",retention:"临时迁移环境从创建完成起保留 1 小时;保存成功的源码版本不受影响。",uploading:"上传中…",sizeHint:"支持项目 ZIP,最大 {{size}}"},oWe={requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}",notReady:"迁移产物尚未准备完成。",back:"返回迁移结果"},sWe={backToAddAgent:"返回添加 Agent",title:"从存量迁移",newMigration:"新建迁移",recent:"最近迁移",loadingSessions:"正在读取迁移会话…",noSessions:"暂无迁移会话",heading:"迁移存量 Agent 项目",intro:"上传本地项目 ZIP,Codex 将先进行只读分析,再由你确认迁移方式。",backToHome:"迁移首页",navigation:"迁移导航",showMore:"查看更多",showLess:"收起",projectName:"项目名称",status:"状态",createdAt:"创建时间",actions:"操作",openTask:"查看迁移 {{name}}",continueTask:"继续",viewTask:"查看"},lWe={stop:"终止迁移",stopping:"正在终止…",cancel:"取消",reload:"重新读取",refreshStatus:"刷新状态"},cWe={unavailable:"迁移能力暂不可用",defaultReason:"Dev Sandbox 暂不可用,请联系管理员检查配置。"},uWe={creatingSandbox:"正在创建 Dev Sandbox",initializing:"正在初始化迁移工作目录,并检查 AgentKit CLI、Codex 和迁移能力。环境就绪后将自动上传项目。",elapsed:"已等待 {{duration}}",uploadThenAnalyze:"ZIP 上传完成后将自动开始只读分析。",analyzing:"Codex 正在识别框架、入口和迁移边界,不会执行实际迁移。",migrationLocked:"迁移执行中不能修改附件或迁移方式。你可以等待当前任务结束,或主动终止。",analysisPaused:"只读分析已暂停。请仅回答下面列出的问题,提交后会在同一迁移环境中重新分析,不会开始实际迁移。",analysisComplete:"只读分析已完成。请检查建议,并确认最终迁移方式。",awaitingUpload:"迁移环境已创建,请重新选择本地 ZIP 继续上传。",expiredTitle:"迁移环境已过期",expiredDescription:"迁移内容和产物已无法预览、下载或部署。如已完成 Runtime 部署,可返回智能体页面继续使用。",unsupportedTitle:"当前 ZIP 暂时无法迁移",unsupportedHint:"请按提示整理项目后,新建迁移并重新上传。",failedTitle:"迁移未完成",cancelled:"当前迁移已终止。你可以新建迁移并重新上传项目。"},dWe={ariaLabel:"补充项目分析信息",title:"补充分析所需信息",description:"附件保持锁定,提交后仅继续只读分析",submitting:"正在继续分析…",submit:"提交并继续分析"},hWe={ariaLabel:"回答迁移需要你决定的问题",title:"迁移需要你的回答",description:"回答后会在当前这一步里继续,不需要重新开始",other:"其他",otherPlaceholder:"也可以直接输入你的答案",submitting:"正在提交回答…",submit:"提交回答并继续"},fWe={ariaLabel:"确认迁移方式",title:"确认迁移方式",framework:"迁移方式",frameworkPlaceholder:"选择迁移方式",agentName:"Agent 名称",entry:"项目入口",entryPlaceholder:"选择项目入口",entryExample:"例如 agent.py:agent",consent:"点击“确认并开始迁移”即确认上述迁移范围、排除项和关键假设。",starting:"正在启动迁移…",start:"确认并开始迁移"},pWe={setup:{title:"迁移效果评测",description:"迁移完成后自动执行评测用例。",on:"已开启",off:"未开启",unavailable:"当前环境暂不支持迁移效果评测。",casesTitle:"评测用例",casesDescription:"至少添加一个用例。期望结果和评测标准可选。",configuredSummary:"{{count}} 个用例 · {{preset}} · {{dimensions}}",incompleteSummary:"{{count}} 个用例待填写 · {{preset}} · {{dimensions}}",dimensionSummary:"{{count}} 个维度",editSettings:"编辑设置",viewSettings:"查看设置",lockedTitle:"评测用例",lockedDescription:"上传开始后不可修改。",closeAria:"关闭评测设置",done:"完成配置",close:"关闭"},tabs:{label:"迁移任务内容",migration:"迁移",evaluation:"效果评测",waitingMigration:"等待迁移",waitingConfiguration:"待配置",running:"评测中",completed:"已完成",issue:"需处理"},bulk:{open:"批量粘贴",label:"每行输入一个用例",placeholder:`帮我查询今天的订单状态 +- 保持礼貌、专业的语气。`},fQe={requestFailed:"请求失败 ({{status}}){{detail}}",a2aSpaces:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 AgentKit 智能体中心",loginRequired:"请先登录以访问 AgentKit 智能体中心"},vikingKnowledge:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 VikingDB 知识库",loginRequired:"请先登录以访问 VikingDB 知识库"},vikingMemory:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 VikingDB 记忆库",loginRequired:"请先登录以访问 VikingDB 记忆库"},mcpGateway:{missingHttpTool:"请返回“添加 MCP 工具”并添加至少一个 HTTP MCP 服务;MCP 稳定性治理不支持 stdio 服务。",missingUrl:"已添加的 HTTP MCP 工具缺少有效服务地址,请返回“添加 MCP 工具”补充后再发布。"},customModel:{fallbackName:"自定义模型",apiKeyLabel:"{{name}} 模型 API Key",fallbackApiKeyLabel:"{{name}} 的备用模型 {{model}} API Key"},deploymentEnv:{serverInjected:"由服务端注入",selectedApiKeyPlaceholder:"由所选 API Key 注入",mcpInjectedComment:"由已添加的 MCP 工具注入",restoredPlaceholder:"由 Studio 服务端安全恢复",generatedMcpPlaceholder:"由已添加的 HTTP MCP 工具自动生成",restoredHelp:"更新时由 Studio 服务端合并 MCP 地址与认证,不向浏览器返回旧密钥。",mergedMcpHelp:"Studio 服务端自动合并 MCP 地址与可选认证,不向浏览器返回旧密钥。",listSeparator:"、",requirementHint:"优化项“{{labels}}”依赖此配置。",requiredBy:"优化项“{{labels}}”依赖此配置,请填写 {{key}}。",required:"请填写 {{label}}({{key}})。",invalidJson:"JSON 格式不正确"},drafts:{unsupportedVersion:"本机草稿版本暂不受支持,请升级 Studio 后重试。",invalidFormat:"本机草稿数据格式无效。",readFailed:"无法读取本机草稿,浏览器中的草稿数据可能已损坏。",quotaExceeded:"浏览器存储空间不足,草稿未保存。请删除不需要的草稿或清理此站点的浏览器存储后重试。",writeRejected:"浏览器拒绝保存草稿,请检查站点存储权限后重试。"},skills:{searchFailed:"搜索失败 ({{status}})",downloadFailed:"下载技能失败 ({{status}})",agentKitRequestFailed:"AgentKit Skills 请求失败",missingManifest:"{{location}} 缺少 SKILL.md",invalidParentPath:"{{location}} 包含非法路径(..):{{path}}",invalidPath:"{{location}} 包含非法路径:{{path}}",localDescription:"本地 Skill",folderSource:"文件夹",noManifest:"{{location}} 中未发现 SKILL.md"},zip:{invalid:"无效的 zip:找不到 EOCD",tooManyFiles:"zip 文件数不能超过 {{count}} 个",tooLarge:"zip 解压后的内容过大"}},pQe={back:"返回开发会话",runtimeName:"Runtime 名称",runtimeNameExists:"Runtime 名称已存在,请更换后重试",checkingRuntimeName:"正在检查 Runtime 名称",verifiedSource:"已验证源码",deployableSource:"可部署源码",verifiedByCodex:"已通过 Codex 云端验证",entryPoint:"入口",files:"文件",artifact:"构建产物",validationReport:"验证报告",verifiedHint:"源码由服务端从已验证交付物物化,浏览器文件不能替换。",unverifiedHint:"源码已由服务端安全物化,部署前请确认 Runtime 配置。",env:{requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}"}},gQe={name:"代码包",back:"返回创建方式",reading:"正在读取代码包",readingEllipsis:"正在读取代码包…",uploadFirst:"请先上传代码包",uploadAriaLabel:"代码包上传",upload:"上传代码包",reupload:"重新上传代码包",uploadPrompt:"请上传代码包",filesRecognized:"已识别 {{count}} 个文件,点击区域可重新上传",dropHint:"点击或拖拽上传,支持 .zip 格式,最大 50 MB;可使用 app.py,或由 agentkit.yaml 声明入口",viewFiles:"查看文件",chooseFile:"选择代码包",errors:{invalidFormat:"请选择 .zip 格式的代码包。",tooLarge:"代码包不能超过 50 MB。",invalidPath:"压缩包包含非法路径:{{name}}",empty:"压缩包中没有可部署的文件。",tooManyFiles:"代码包文件数不能超过 {{count}} 个。",duplicateFile:"代码包包含重复文件:{{path}}",manifestParse:"agentkit.yaml 无法解析:{{detail}}",manifestRoot:"agentkit.yaml 根节点必须是对象。",manifestCommon:"agentkit.yaml 的 common 必须是对象。",entryPointType:"agentkit.yaml 的 common.entry_point 必须是文件路径。",entryPointInvalid:"agentkit.yaml 的 common.entry_point 不是有效文件路径。",entryPointMissing:"代码包中不存在 agentkit.yaml 声明的启动入口:{{entryPoint}}",defaultEntryPointMissing:"代码包根目录必须包含 app.py,或在 agentkit.yaml 的 common.entry_point 中声明已有入口。"}},mQe={label:"Agent 执行画布",readOnlyLabel:"只读 Agent 执行画布",minimapLabel:"执行流程缩略图",controls:{ariaLabel:"执行流程控制",zoomIn:"放大",zoomOut:"缩小",fitView:"适应视图"},rootAgent:"主 Agent",unnamedStep:"未命名步骤",terminals:{input:"用户请求",output:"最终回复"},edges:{then:"然后",continueLoop:"继续循环",call:"调用"},patterns:{llm:{label:"智能体",description:"理解任务并直接完成一个具体工作"},sequential:{label:"分步协作",description:"内部步骤按照顺序依次执行"},parallel:{label:"同时处理",description:"内部步骤同时工作,完成后统一汇总"},loop:{label:"循环执行",description:"重复执行内部步骤,直到满足停止条件"},a2a:{label:"远程智能体",description:"调用已经存在的远程 Agent"}},actions:{insertHere:"在这里插入步骤",deleteNamed:"删除 {{name}}",deleteNode:"删除节点",addSubagent:"添加子 Agent",addParallelStep:"添加一个同时处理的步骤",addLoopStep:"添加循环步骤",addNextStep:"添加下一个步骤",addFirst:"添加到最前",addLast:"添加到最后"}},vQe={title:"智能构建",subtitle:"描述需求,完成 Agent 的构建、调试与验证。",model:{label:"模型",placeholder:"选择模型",retiring:"即将下线",currentConfiguration:"当前配置",loadError:"加载模型列表失败"},availability:{checking:"正在检查智能开发能力…",unavailable:"当前无法使用智能模式,请返回后重试。"},goal:{title:"从目标开始",continueTitle:"继续优化项目",hint:"只需说明 Agent 要解决的问题;如有影响结果的关键信息,会在开始前向你确认。",continueHint:"说明这次要调整的内容,完成后会保存为新版本。",basedOn:"基于",clearSelection:"取消选择",label:"目标描述",optimizationLabel:"优化目标",placeholder:"例如:创建一个能读取销售数据、生成周报并校验输出格式的 Agent",optimizationPlaceholder:"例如:增加数据来源标注,并在信息不足时先向用户确认"},actions:{preparing:"准备中…",build:"开始构建",optimize:"开始优化"},preparation:{accepted:"目标已收到,马上开始实现",preparing:"正在创建任务环境…",starting:"环境已就绪,正在启动 Codex…",next:"接下来会先梳理目标和实现方式,再编写、运行和验证 Agent。"},tasks:{title:"进行中的任务",hint:"离开页面后仍会继续,可随时回来查看和补充要求。",refresh:"刷新任务列表",loading:"正在读取任务…",empty:"暂无进行中的任务",emptyHint:"开始构建后,可以从这里回到任务。",loadError:"暂时无法读取任务,请重试。",openError:"暂时无法打开任务,请重试。",startedAt:"开始于 {{time}}",open:"查看任务",opening:"正在连接…",states:{queued:"等待开始",running:"构建中",recovering:"正在重连",waiting_user:"等待你的回复",stopping:"正在停止",succeeded:"已完成",failed:"未完成",cancelled:"已停止"}}},yQe={title:"已保存项目",description:"选择已有版本继续优化,或查看、下载和部署源码。",refresh:"刷新项目列表",checkingStorage:"正在检查项目存储…",unavailableTitle:"暂时无法读取项目",storageCheckError:"无法确认项目存储状态,请稍后重试。",storageNotConfigured:"项目存储尚未配置。",loadingMigrated:"正在读取已迁移项目…",loadingSaved:"正在读取已保存项目…",loadingVersions:"正在读取项目版本…",unknownTime:"时间未知",sourceDownloaded:"源码已下载。",projectSummary_one:"{{count}} 个版本 · 更新于 {{time}}",projectSummary_other:"{{count}} 个版本 · 更新于 {{time}}",versionSummary_one:"{{time}} · {{count}} 个文件",versionSummary_other:"{{time}} · {{count}} 个文件",noVersionDescription:"暂无版本描述",latestVersion:"最新版本",defaultVersionName:"版本 · {{time}}",rename:{projectTitle:"修改项目名称",versionTitle:"修改版本名称",projectLabel:"项目名称",versionLabel:"版本名称",hint:"支持中英文、数字和常见标点,最多 {{max}} 个字符。",required:"请输入名称。",tooLong:"名称不能超过 {{max}} 个字符。",invalidCharacters:"名称不能包含换行、控制字符、不可见格式字符或 < >。",save:"保存名称",saving:"保存中…",updated:"名称已更新。",failed:"名称保存失败,请重试。"},verified:"已验证",pendingVerification:"待确认",viewSource:"查看源码",download:"下载",downloading:"下载中…",optimize:"去优化",optimizeUnavailable:"去优化,暂不支持",errors:{projects:"无法读取已保存项目。",source:"无法读取项目源码。",versions:"无法读取项目版本。",download:"下载源码失败。",prepareDeployment:"无法准备部署源码。",deleteVersion:"删除项目版本失败。",migrated:"无法读取已迁移项目",saved:"无法读取已保存项目"},empty:{migratedTitle:"还没有已迁移的项目",savedTitle:"还没有已保存的项目",migratedDescription:"完成首次迁移后,源码会自动保存在这里。",savedDescription:"完成首次构建后,源码会自动保存在这里。",noVersions:"这个项目还没有可用版本。"},compare:{selected:"已选择 {{count}}/2",selectedLabel:"已选择",select:"选择",view:"查看对比",start:"对比版本"},delete:{title:"删除这个版本?",onlyVersion:"“{{name}}”只有这一个版本,删除后项目也会移除。此操作无法撤销。",description:"该版本的源码和验证记录将永久删除,其他版本不受影响。",confirm:"删除版本"}},bQe={title:"选择创建方式",subtitle:"以不同模式构建您的智能体",features:"特性",quick:{title:"快速模式",description:"动态派生子智能体自主完成任务",features:{dynamicSubagents:"动态派生子智能体",autonomousPlanning:"自主规划执行",collaboration:"多智能体协作",summary:"自动汇总结果",skills:"按需调用技能",trace:"任务过程可追踪"}},traditional:{title:"传统模式",description:"高度自定义您的智能体结构",features:{visualConfig:"可视化配置",migration:"存量智能体迁移",debugging:"实时调试",optimization:"可选性能优化",parameters:"精细参数控制"}}},xQe={placeholder:"输入系统提示词;键入 ## 加空格可创建二级标题…",toolbar:{undo:"撤销 {{shortcut}}",redo:"重做 {{shortcut}}",paragraph:"正文",quote:"引用",heading:"标题 {{level}}",selectBlockType:"选择文本类型",blockType:"文本类型",bold:"加粗",removeBold:"取消加粗",italic:"斜体",removeItalic:"取消斜体",bulletedList:"无序列表",numberedList:"有序列表"}},wQe={local:{duplicatesSkipped:"已跳过重复技能:{{names}}",invalidDrop:"请拖入包含 SKILL.md 的文件夹或一个 .zip 文件",readError:"读取失败:{{detail}}",dropLabel:"拖入文件夹或 ZIP,自动识别 Skill",hint:"每个技能需包含 SKILL.md。支持包含多个技能的目录。",reading:"正在读取文件…",fileCount:"本地 · {{count}} 个文件"},hub:{searchError:"搜索失败,请稍后重试。",searchPlaceholder:"搜索火山 Find Skill 技能广场,例如 数据分析、PDF…",search:"搜索",searching:"正在搜索…",noResults:"没有找到匹配的技能,换个关键词试试。",hint:"输入关键词搜索火山 Find Skill 技能广场,所选技能会在生成项目时下载到 skills/ 目录。"},space:{loadError:"加载失败",loadingSpaces:"正在加载 AgentKit Skills 中心…",noSpaces:"此账号下没有 AgentKit Skills 中心。",selectSpace:"选择 AgentKit Skills 中心",openConsole:"在火山引擎控制台打开",loadingSkills:"正在加载技能列表…",noSkills:"此 AgentKit Skills 中心暂无技能。"}},AQe={unnamedNode:"未命名节点",editInstruction:"点击编辑指令…",controls:{ariaLabel:"工作流画布控制",zoomIn:"放大",zoomOut:"缩小",fitView:"适应视图"},sections:{info:"工作流信息",execution:"执行方式",nodes:"节点",nodeConfig:"节点配置"},types:{sequential:{label:"顺序",description:"节点依次执行"},parallel:{label:"并行",description:"节点同时执行"},loop:{label:"循环",description:"节点循环执行"}},placeholders:{description:"这个工作流做什么…",agentDescription:"这个 Agent 做什么…",instruction:"你是一个…"},errors:{workflowNameUnique:"名称须与 Agent 节点名称保持唯一",agentNameUnique:"Agent 名称在当前工作流中必须唯一"},dragHint:"拖拽到画布,或点击下方按钮添加",agentNode:"Agent 节点",addNode:"添加节点",connectHint:"拖拽节点的圆点连线以表达执行顺序。",create:"创建工作流",deleteNode:"删除节点",nameHelp:"仅使用英文字母、数字和下划线,且名称保持唯一。",instruction:"指令 (instruction)",tools:"工具 (逗号分隔)",nodeId:"节点 ID",empty:{selectNode:"选择一个节点以编辑其配置",summary:"共 {{nodes}} 个节点 · {{edges}} 条连线"}},SQe={ariaLabel:"快速模式创建",progress:"快速模式创建进度",steps:{agent:{label:"智能体",title:"基本信息",description:"设置智能体的名称、用途、行为方式与能力"},environment:{label:"执行环境",title:"配置执行环境",description:"选择默认环境或已构建的自定义环境"},deployment:{label:"部署偏好",title:"部署偏好",description:"定义 AgentKit 云上参数"}},model:{label:"模型",source:"模型来源",name:"模型名称",fallbacks:"Fallback 模型",fallbackPlaceholder:"备用模型名称",addFallback:"添加备用模型",addProviderFallback:"添加其他服务商",removeFallback:"移除",fallbackType:"备用模型类型",fallbackSameProvider:"同服务商",fallbackOtherProvider:"其他服务商",apiKeyEnv:"API Key 环境变量",invalidApiKeyEnv:"环境变量名只能包含字母、数字和下划线,且不能以数字开头。",fallbackHelp:"同服务商备用模型复用主模型连接;其他服务商会使用单独的 provider、API Base 和 API Key。",fallbackIgnored:"空值、重复值或与主模型相同的模型会被忽略。",provider:"服务商 Provider",invalidApiBase:"请输入合法的 http:// 或 https:// 链接。",volcengineArk:"火山方舟",custom:"自定义",gateway:"模型网关",comingSoon:"待上线",currentApiKey:"当前 API Key",currentConfiguration:"当前配置",loadingApiKeys:"正在加载 API Key",selectApiKey:"选择 API Key",searchApiKeys:"搜索 API Key 名称",noApiKeys:"暂无可用 API Key",loadingModels:"正在加载模型",selectModel:"选择模型",searchModels:"搜索名称、Model ID 或服务商",noModels:"没有可用的模型",apiKeyPlaceholder:"请输入模型 API Key",credentialsLoadError:"模型凭据加载失败",modelsLoadError:"模型列表加载失败"},identity:{unnamedPool:"未命名用户池",currentPool:"{{value}}(当前用户池)",userPool:"用户池",loading:"正在加载用户池",placeholder:"请选择用户池",search:"搜索用户池",empty:"当前账号下暂无 Identity 用户池",currentHint:"当前 Studio 的登录 JWT 将透传访问此 Runtime",mismatchHint:"所选用户池不是当前 Studio 使用的用户池,部署后无法从 Studio 调用此 Runtime",selectionHint:"当前 Studio 使用的用户池已在列表中标注"},agent:{namePlaceholder:"输入智能体名称",descriptionPlaceholder:"说明这个智能体可以做什么",prompt:"提示词",promptPlaceholder:"定义角色、目标和行为边界",skills:"技能",addSkill:"添加技能"},validation:{descriptionRequired:"请输入描述",promptRequired:"请输入提示词",modelRequired:"请选择模型",apiKeyRequired:"请先填写或选择模型 API Key",instanceIntegers:"最小实例数必须为大于等于 0 的整数,最大实例数必须为大于 0 的整数",instanceOrder:"最小实例数不能大于最大实例数",userPoolRequired:"请选择用于 Runtime 鉴权的用户池"},deployment:{runtimeName:"Runtime 名称",runtimeNameUpdateHint:"更新时保持现有 Runtime 名称不变",runtimeNameHint:"仅支持英文字母、数字、下划线和连字符",region:"发布区域",authentication:"鉴权方式",apiKeyDescription:"默认方式,使用 Runtime API Key 访问",userPoolDescription:"使用 Identity 用户池签发的 JWT",sessionStorage:"会话存储",inMemoryStorage:"In-memory 临时存储",backends:{sqlite:"SQLite 文件",mysql:"MySQL",postgresql:"PostgreSQL"},instances:"实例设置",minInstances:"最小实例数",maxInstances:"最大实例数",inMemoryHint:"为避免多实例间会话丢失,推荐将 Runtime 固定为 1~1",networkMode:"网络模式",network:{public:"公网",private:"私网",both:"公网与私网"},subnetIds:"子网 ID(可选,多个用逗号分隔)",sharedInternet:"VPC 内共享公网出口",sharedInternetHint:"允许私网 Runtime 通过共享出口访问公网",evaluationSets:"评测集",createEvaluationSets:"自动创建评测集",evaluationSetsHint:"部署成功后自动创建 Good Case 和 Bad Case 评测集",resources:"资源配置",complete:"部署已完成",preparing:"正在准备部署…"},environmentVariables:{title:"环境变量",add:"添加变量",nameAriaLabel:"环境变量名称",valueAriaLabel:"{{name}} 的值",deleteNamed:"删除 {{name}}"},actions:{updateAgain:"再次更新",deployAgain:"重新部署",updateAndPublish:"更新并发布",applyProfile:"应用 Profile",applyProfileAgain:"再次应用 Profile"}},TQe={actions:{addSubagent:"添加子 Agent",clearRoot:"清空根 Agent",clearRootConfirmation:"清空根 Agent 的全部配置和子 Agent?此操作无法撤销。"},workspace:{progress:"Agent 创建进度",modes:{build:"架构",validate:"调试",optimize:"优化",environment:"环境",publish:"发布"},titles:{build:"个性化您的智能体架构",validate:"调试您的智能体",optimize:"为您的智能体选择优化项",environment:"配置云上环境",publish:"准备好部署您的智能体"}},sections:{type:{label:"Agent 类型",hint:"选择 Agent 类型"},basic:{label:"基本信息",hint:"名称、描述与系统提示词"},model:{label:"模型配置",hint:"模型与服务(可选)"},tools:{label:"工具",hint:"可调用的能力"},skills:{label:"技能",hint:"声明式技能"},knowledge:{label:"知识库",hint:"外部知识检索"},memory:{label:"记忆",hint:"短期与长期记忆"},subagents:{label:"子 Agent",hint:"嵌套协作"},review:{label:"完成",hint:"预览并创建"}},agentTypes:{ariaLabel:"Agent 类型",remoteChildOnly:"远程智能体只能作为子步骤使用",llm:{label:"智能体",fullLabel:"LLM 智能体",description:"大模型驱动,自主完成任务"},sequential:{label:"分步协作",fullLabel:"顺序型智能体",description:"子 Agent 按顺序依次执行"},parallel:{label:"同时处理",fullLabel:"并行型智能体",description:"子 Agent 并行执行后汇总"},loop:{label:"循环执行",fullLabel:"循环型智能体",description:"子 Agent 循环执行到满足条件"},a2a:{label:"远程智能体",fullLabel:"远程 Agent",description:"通过 A2A 协议调用远程 Agent"}},basic:{agentName:"Agent 名称",name:"名称",agentDescription:"智能体描述",descriptionPlaceholder:"简要描述这个 Agent 的用途,便于团队识别…",nameHelp:"遵循 Google ADK 命名规则,且在执行流程中保持唯一。",rootDescriptionHelp:"完整描述会保留;部署时会自动整理为符合 Runtime 规范的单行描述。",descriptionHelp:"描述会显示在 Agent 列表与选择器中。",orchestratorHelp:"这是一个协作容器,本身不生成回答。请在左侧画布中添加任务步骤,并通过拖拽调整它们的位置。",maxIterations:"最大轮次",maxIterationsHelp:"循环编排反复执行子 Agent,直到满足条件或达到该轮次上限。",agentCenter:"AgentKit 智能体中心",agentCenterHelp:"远程 Agent 的名称、描述和能力来自中心返回的 Agent Card。系统会根据每轮任务动态发现并挂载匹配的 Agent。",moreOptions:"更多选项",systemPrompt:"系统提示词",loadingMarkdown:"正在加载 Markdown 编辑器…",markdownHelp:"支持 Markdown 快捷输入,例如键入 ## 加空格创建二级标题。",unnamed:"未命名",unnamedAgent:"未命名智能体"},validation:{remoteRoot:"远程 Agent 只能作为子 Agent",missingRegistry:"请选择 AgentKit 智能体中心",name:{required:"名称为必填项",reserved:"user 是 Google ADK 保留名称,请使用其他名称",characters:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"},duplicateName:"Agent 名称在当前结构中必须唯一",missingDescription:"描述为必填项",mcpDuplicateName:"MCP 名称重复,请为每个服务使用唯一名称",mcpDuplicateUrl:"MCP 地址重复,请删除重复服务后再发布",missingSubagent:"缺少子 Agent",missingPrompt:"系统提示词为必填项",apiKeyRequired:"请先填写或选择模型 API Key",missingSubagentDetail:"{{type}}至少需要添加一个子 Agent 后才能调试或发布。",problem:"{{name}}:{{problem}}"},ai:{ariaLabel:"AI 自动填写 Agent 配置",minimumLength:"请至少输入 {{count}} 个字符。",replaceConfirmation:"生成的新配置会替换当前画布和属性,确定继续吗?",placeholder:"描述目标,使用 {{model}} 模型一键生成配置",generate:"智能生成",generating:"正在智能生成",success:"生成成功",regenerate:"重新生成",failed:"智能生成失败"},debug:{ariaLabel:"智能体调试工作区",unavailable:"当前后端暂不支持生成 Agent 调试运行。",baseline:"基准组",comparison:"对照组 {{count}}",selectModel:"请选择模型",enterDescription:"请输入描述",enterPrompt:"请输入系统提示词",duplicateConfiguration:"测试配置不能重复",starting:"启动中…",applyAndRestart:"应用并重启",restart:"重新启动",start:"启动环境",defaultModel:"默认模型",testConfiguration:"测试配置",deleteVariant:"删除 {{name}}",deleteVariantGroup:"删除对照组",creatingEnvironment:"正在创建测试环境…",configurationChanged:"配置已变更,请重新启动环境。",ready:"环境已就绪",readyHint:"发送消息以比较智能体回复。",startHint:"先完善配置,再启动环境。",viewTraceNamed:"查看 {{name}} 的调用链路",traceUnavailable:"发送消息后可查看调用链路",trace:"调用链路",useConfiguration:"使用此配置",finishConfiguration:"完成配置",finishAndStart:"完成并启动",currentAgentModel:"当前 Agent 模型",configurationHint:"修改仅用于本次对比,选择使用后才会进入部署流程。",messagePlaceholder:"向已启动的测试环境发送消息…",startOneFirst:"请先启动至少一个测试环境",addVariant:"添加对照组",traceTitle:"调用链路 · {{name}}",leaveTitle:"离开调试?",leaveDescription:"离开调试页面后,当前环境将被清理。您可以通过重新启动环境进行新的测试。",cleaning:"清理中…",confirmLeave:"确定离开",closeLeaveConfirmation:"关闭离开调试确认"},optimization:{ariaLabel:"智能体优化选项",scenario:"优化场景",components:"优化组件",bytePlusUnavailable:"BytePlus 账号暂不支持 Harness Sidecar 优化项。请保持优化项为空后继续部署,普通 BytePlus 智能体不受影响。",releaseScenario:"优化场景:{{profile}}",profiles:{default:{label:"自定义",description:"按需选择组件,不勾选时不启动 Sidecar。"},ops:{label:"运维场景",description:"适用于运维诊断、数据库、日志和监控 MCP。"}},groups:{quality:"提升回答质量",cost:"降低运行成本",stability:"增强运行稳定性"},options:{context_engine:{label:"上下文治理",description:"治理上下文组装、任务锚定和上下文预算。"},compressor:{label:"上下文与结果压缩",description:"压缩长上下文和大型工具结果,降低 Token 成本。"},verifier:{label:"回答校验与修复",description:"校验证据和回答,在失败时执行修复或告警。"},long_run_control:{label:"Goal 任务控制",description:"管理 Goal 任务的进度、续跑和结束条件。"},mcp_resilience:{label:"MCP 稳定性治理",description:"治理连接、超时、空结果、大返回和调用预算;默认包含 SQL 只读保护。"}}},model:{label:"模型",source:"模型来源",volcanoArk:"火山方舟",volcengineArk:"火山方舟",bytePlusModelArk:"BytePlus ModelArk",custom:"自定义",gateway:"模型网关",comingSoon:"待上线",configuration:"模型配置",name:"模型名称",fallbacks:"Fallback 模型",fallbackPlaceholder:"备用模型名称",addFallback:"添加备用模型",addProviderFallback:"添加其他服务商",removeFallback:"移除",fallbackType:"备用模型类型",fallbackSameProvider:"同服务商",fallbackOtherProvider:"其他服务商",apiKeyEnv:"API Key 环境变量",invalidApiKeyEnv:"环境变量名只能包含字母、数字和下划线,且不能以数字开头。",fallbackHelp:"同服务商备用模型复用主模型连接;其他服务商会使用单独的 provider、API Base 和 API Key。",fallbackIgnored:"空值、重复值或与主模型相同的模型会被忽略。",provider:"服务商 Provider",invalidApiBase:"请输入合法的 http:// 或 https:// 链接。",liteLlmProviders:"LiteLLM 支持列表",apiKeyPlaceholder:"请输入模型 API Key",available:"已开通",retiring:"即将下线",notActivated:"未开通",unavailable:"暂不可用",apiKeyLoadError:"加载 Ark API Key 失败",loadingApiKeys:"正在加载 API Key…",selectApiKey:"选择 API Key",currentApiKey:"当前 API Key",apiKeyList:"API Key 列表",searchApiKey:"搜索 API Key",searchApiKeyName:"搜索 API Key 名称",noApiKeys:"暂无可用 API Key",noMatchingApiKey:"没有匹配的 API Key",loading:"正在加载模型…",loaded:"已加载 {{count}} 个模型",loadError:"加载模型失败",selectModel:"选择模型",selectProviderModel:"选择服务商模型",providerModels:"服务商模型",search:"搜索模型",searchPlaceholder:"搜索名称、Model ID 或服务商",noMatches:"没有匹配的模型",empty:"暂无可用模型",unknownStatus:"未知状态",refresh:"刷新",refreshing:"刷新中…",activate:"开通",activateAction:"前往开通",currentConfiguration:"当前配置"},tools:{builtIn:"内置工具",builtInHelp:"勾选 VeADK 提供的内置能力,生成时会自动补全 import 与所需环境变量。",codeExecution:"代码执行配置",codeExecutionHelp:"指定 AgentKit 代码执行沙箱。",mcp:"MCP 工具"},catalog:{web_search:{label:"联网搜索",description:"火山引擎 Web Search,获取实时信息。"},parallel_web_search:{label:"并行联网搜索",description:"并行发起多条搜索查询,更快汇总。"},link_reader:{label:"网页读取",description:"抓取并阅读给定链接的正文内容。"},web_scraper:{label:"网页爬取",description:"结构化爬取网页(需要 Scraper 服务)。"},image_generate:{label:"图像生成",description:"文生图(Doubao Seedream)。"},image_edit:{label:"图像编辑",description:"图生图 / 编辑(Doubao SeedEdit)。"},video_generate:{label:"视频生成",description:"文/图生视频(Doubao Seedance),含任务查询。"},text_to_speech:{label:"语音合成 (TTS)",description:"把文本转成语音(火山语音)。"},run_code:{label:"代码执行",description:"在沙箱中执行代码。"},vesearch:{label:"VeSearch 智能搜索",description:"火山 VeSearch(需要 bot 端点)。"},links:{console:"控制台",documentation:"文档"},env:{modelAgentName:{comment:"模型名称"},embeddingModelName:{comment:"向量化模型(记忆/知识库需要)"},vikingMemoryProject:{comment:"VikingDB 记忆库项目"},vikingMemoryRegion:{comment:"VikingDB 记忆库地域"},vikingMemoryType:{comment:"记忆类型"},feishuAppId:{comment:"飞书应用 App ID"},feishuAppSecret:{comment:"飞书应用 App Secret",placeholder:"输入 App Secret"},registrySpaceId:{comment:"AgentKit 智能体中心",placeholder:"请选择智能体中心"},registryTopK:{comment:"召回 Agent 数量"},registryRegion:{comment:"AgentKit 智能体中心地域"},registryEndpoint:{comment:"AgentKit 智能体中心 OpenAPI 地址"},agentKitToolId:{comment:"代码执行沙箱 ID"},agentKitToolRegion:{comment:"AgentKit Tools 地域"},openVikingUrl:{comment:"OpenViking 服务地址"},openVikingMemoryUserId:{comment:"记忆归属 ID",help:"对应 viking://user/<此值>/peers/<请求用户>/memories 中的 user 段;用于隔离 Agent、租户或业务场景,默认 default。"},openVikingMemoryPolicy:{comment:"记忆策略",help:"记忆的抽取策略和隔离策略,不填写时使用官方默认策略。"},openVikingKnowledgeUserId:{comment:"知识库归属 ID",help:"未配置资源目录时用于默认路径 viking://user/<此值>/resources/<知识库索引>/,默认 default。"},openVikingTargetUri:{comment:"知识库资源目录",help:"留空时由 KnowledgeBase index 自动生成;填写后直接检索该 OpenViking 资源目录,优先级最高。"},tlsServiceName:{comment:"TLS topic_id,留空自动创建"}}},backends:{shortTerm:{local:{label:"本地内存",description:"进程内,不持久化。适合开发调试。"},sqlite:{label:"SQLite 文件",description:"持久化到本地 .db 文件。"},mysql:{label:"MySQL",description:"持久化到 MySQL。"},postgresql:{label:"PostgreSQL",description:"持久化到 PostgreSQL。"}},longTerm:{local:{label:"本地向量库",description:"进程内 llama-index 向量库。"},opensearch:{label:"OpenSearch",description:"OpenSearch 向量检索。"},redis:{label:"Redis",description:"Redis 向量检索。"},viking:{label:"VikingDB Memory",description:"VikingDB 记忆库(支持用户画像)。"},openviking:{label:"OpenViking Memory",description:"OpenViking 长期记忆,按用户维度保存和检索偏好、事件与实体。"},mem0:{label:"Mem0",description:"Mem0 托管记忆服务。"}},knowledge:{viking:{label:"VikingDB Knowledge",description:"VikingDB 知识库。"},opensearch:{label:"OpenSearch",description:"OpenSearch 向量检索。"},context_search:{label:"Context Search",description:"火山 Context Search 引擎(无需向量化)。"},openviking:{label:"OpenViking Knowledge",description:"OpenViking 资源目录知识库,无需向量化模型配置。"}}},exporters:{apmplus:{label:"APMPlus",description:"火山 APMPlus 应用性能监控。"},cozeloop:{label:"CozeLoop",description:"扣子 CozeLoop 链路观测。"},tls:{label:"TLS (日志服务)",description:"火山 TLS 日志服务导出。"}},knowledge:{title:"知识库",description:"启用外部知识检索(RAG),让 Agent 基于你的资料作答。",backend:"知识库后端",vikingDatabase:"VikingDB 知识库"},memory:{shortTerm:"短期记忆",shortTermDescription:"存储单会话上下文",shortTermBackend:"短期记忆后端",longTerm:"长期记忆",longTermDescription:"存储跨会话上下文,通常使用向量化检索",longTermBackend:"长期记忆后端",vikingDatabase:"VikingDB 记忆库",autoSave:"自动保存会话到长期记忆",autoSaveDescription:"会话结束时自动把内容写入长期记忆,无需手动调用。"},mcp:{removeTool:"删除 MCP 工具",namePlaceholder:"名称(可选)",urlPlaceholder:"MCP 服务地址",pathWarning:"当前填写的是网关根地址。仅当根路径就是 MCP Endpoint 时可直接使用;否则请补充完整服务路径。",tokenPlaceholder:"Bearer Token(可选)",showToken:"显示 Bearer Token",hideToken:"隐藏 Bearer Token",commandPlaceholder:"命令,例如 npx",argsPlaceholder:"参数,以空格分隔",stdioHint:"stdio 工具在部署环境中启动,请确保命令和依赖可用。",addTool:"添加 MCP 工具"},resources:{unnamedAgentCenter:"未命名智能体中心",unnamedKnowledgeBase:"未命名知识库",unnamedMemory:"未命名记忆库",loadError:"加载失败",loadingAgentCenters:"正在加载智能体中心…",agentCentersLoaded:"已加载 {{count}} 个智能体中心",noAgentCenters:"暂无智能体中心",noMatchingAgentCenters:"没有匹配的智能体中心",searchAgentKitCenter:"搜索 AgentKit 智能体中心",searchNameOrId:"搜索名称或 ID",selectAgentCenter:"选择智能体中心",selectAgentKitCenter:"选择 AgentKit 智能体中心",selectedAgentCenter:"已选智能体中心",agentKitCenter:"AgentKit 智能体中心",refreshAgentCenters:"刷新智能体中心",knowledgeBaseList:"知识库列表",knowledgeBasePlaceholder:"选择知识库",loadingKnowledgeBases:"正在加载知识库…",knowledgeBasesLoaded:"已加载 {{count}} 个知识库",noKnowledgeBases:"暂无知识库",noMatchingKnowledgeBases:"没有匹配的知识库",searchKnowledgeBase:"搜索知识库",selectKnowledgeBase:"选择知识库",refreshKnowledgeBases:"刷新知识库",memoryList:"记忆库列表",memoryPlaceholder:"选择记忆库",loadingMemories:"正在加载记忆库…",memoriesLoaded:"已加载 {{count}} 个记忆库",noMemories:"暂无记忆库",noMatchingMemories:"没有匹配的记忆库",searchMemory:"搜索记忆库",selectMemory:"选择记忆库",refreshMemories:"刷新记忆库"},env:{noAdditionalParameters:"此后端无需额外运行参数。",invalidJson:"请输入有效的 JSON。",helpAriaLabel:"{{label}}说明:{{help}}",openOpenViking:"打开 OpenViking {{label}}",valuePlaceholder:"请输入参数值",openVikingIndex:"OpenViking 资源索引",openVikingIndexHelp:"默认值:留空;生成项目时使用 Agent 名自动生成,例如 my_agent_kb。未配置 DATABASE_OPENVIKING_TARGET_URI 时,默认 URI 拼接为 viking://user/{知识库归属 ID,未填则 default}/resources/{资源索引}/;如果填写了 DATABASE_OPENVIKING_TARGET_URI,则直接使用该完整 URI。",openVikingIndexAriaLabel:"OpenViking 资源索引说明:{{help}}"},deployment:{vpcRequired:"使用 VPC 网络时,请填写 VPC ID。",apiKeyRequired:"请先选择模型使用的 API Key。",invalidEnvName:"环境变量名称不合法:{{key}}",requiredEnv:"{{name}}:请填写必填环境变量",generatingConfiguration:"正在生成部署配置",runtimeNameExists:"Runtime 名称已存在,请修改后重试。",preparing:"准备部署",applyingMpaProfile:"正在将 Agent 配置应用到 MPA Runtime",mpaProfileApplied:"MPA Runtime 配置已应用",runningMpaSmoke:"正在验证 MPA Runtime 执行链路",mpaReady:"MPA Runtime 已可运行",mpaOperationIncomplete:"MPA Runtime 初始化未完成,请重试此部署任务。",complete:"部署完成",failed:"部署失败",updateAndPublish:"更新并发布",stages:{build:"构建镜像",deploy:"部署 Runtime",publish:"发布服务",applyMpaProfile:"应用 MPA 配置",verifyMpaRuntime:"验证 MPA Runtime",mpaReady:"MPA Runtime 可运行",running:"部署中"}},publish:{generating:"正在生成发布配置",validating:"校验 Agent 结构并准备部署快照…"}},CQe={presets:{support:{name:"客服助手",description:"7×24 在线答疑,结合知识库与历史对话,稳定、礼貌地解决用户问题。",instruction:"你是一名专业、耐心的客服助手。请始终保持礼貌、友好的语气,优先依据知识库中的资料回答用户问题;当资料不足以确定答案时,如实告知用户并主动引导其提供更多信息,切勿编造。回答尽量简洁、分点清晰,必要时给出操作步骤。",subagents:{}},analyst:{name:"数据分析师",description:"运行代码完成统计与可视化,开启链路追踪,分析过程可观测、可复现。",instruction:"你是一名严谨的数据分析师。面对数据问题时,先厘清分析目标与口径,再通过编写并运行代码完成清洗、统计与可视化。每一步都要说明你的假设与方法,给出结论时附上关键数据支撑,并指出潜在的偏差与局限。",subagents:{}},translator:{name:"翻译助手",description:"中英互译,忠实、通顺、地道,保留原文语气与专业术语。",instruction:"你是一名专业的翻译助手,精通中英互译。请在忠实于原文含义的前提下,使译文自然、地道、符合目标语言表达习惯;保留专有名词与专业术语的准确性,并尽量贴合原文的语气与风格。仅输出译文,除非用户额外要求解释。",subagents:{}},coder:{name:"代码助手",description:"编写、调试与重构代码,可运行代码验证结果,给出清晰可维护的实现。",instruction:"你是一名资深软件工程师。请根据需求编写正确、清晰、可维护的代码,遵循目标语言的惯用风格与最佳实践。在不确定时通过运行代码验证你的实现,给出关键的边界条件与测试思路,并对复杂逻辑附上简要注释。",subagents:{}},researcher:{name:"研究员",description:"联网检索一手资料,结合知识库与长期记忆,输出有据可查的研究结论。",instruction:"你是一名严谨的研究员。面对研究问题时,先拆解关键子问题,再通过联网检索收集多个一手、可信的来源,交叉验证后再下结论。结论需注明出处与不确定性,区分事实与推断,避免以偏概全。",subagents:{}},"research-team":{name:"多智能体研究团队",description:"由检索员、分析员、撰写员协作的研究编排,分工完成端到端调研报告。",instruction:"你是一支研究团队的总协调者。负责拆解用户的研究任务,将检索、分析、撰写分别委派给对应的子 Agent,汇总各子 Agent 的产出,把控整体质量,最终输出结构清晰、有据可查的研究报告。",subagents:{0:{name:"检索员",description:"联网搜集与课题相关的一手资料与数据。",instruction:"你是研究团队中的检索员。根据课题联网检索多个可信来源,整理出关键事实、数据与原文出处,交付给分析员,不做主观结论。"},1:{name:"分析员",description:"对检索到的材料做交叉验证与归纳分析。",instruction:"你是研究团队中的分析员。对检索员提供的材料做交叉验证、归纳与对比,提炼洞见、识别矛盾与不确定性,形成结构化的分析要点。"},2:{name:"撰写员",description:"将分析结论组织为结构清晰、引用规范的报告。",instruction:"你是研究团队中的撰写员。把分析员的要点组织成结构清晰、语言通顺、引用规范的研究报告,确保每个结论都能追溯到来源。"}}}},tags:{tools:"工具",memory:"记忆",knowledgeBase:"知识库",tracing:"观测",subagents:"子 Agent {{count}}"},gallery:{title:"从模板新建",subtitle:"选择一个预制 Agent 模板,按需微调后即可创建。"},detail:{back:"返回模板列表",name:"名称",systemPrompt:"系统提示词",model:"模型",tools:"工具",memory:"记忆",knowledgeBase:"知识库",tracing:"观测追踪",subagents:"子 Agent({{count}})",create:"使用此模板创建",shortTermMemory:"短期",longTermMemory:"长期"}},kQe={checkingExpiry:"确认有效期中",waitingRecovery:"等待恢复",listFailed:"读取项目列表失败",recoveryFailed:"工作区恢复失败,请重试",operationFailed:"项目操作失败,请重试",title:"代码项目",back:"返回代码项目",restart:"本开发环境将在 {{countdown}} 后重启,请随时保存数据",expiresAt:"有效期至 {{date}}",exitFullscreen:"退出全屏",fullscreen:"全屏",exitFullscreenHint:"退出全屏(Esc)",recovering:"正在恢复工作区,完成后将自动返回项目",retry:"重试连接",search:"搜索代码项目",newTitle:"新建代码项目",new:"新建项目",readingStats:"正在读取项目统计",createdAt:"创建时间",opening:"正在打开",unknownCreatedAt:"创建时间未知",open:"打开项目",empty:"没有匹配的代码项目",close:"关闭新建项目",name:"项目名称",placeholder:"例如 my-agent",nameHelp:"以英文字母开头,可包含字母、数字、下划线和连字符,最多 64 个字符",cancel:"取消",create:"创建项目",files_one:"{{count}} 个文件",files_other:"{{count}} 个文件",directories_one:"{{count}} 个目录",directories_other:"{{count}} 个目录",separator:","},OQe={enabled:"已启用",disabled:"已禁用",unknownStatus:"状态未知",allPermissions:"全部权限",customPermissions:"自定义权限",unknownPermissions:"权限未知",unnamed:"未命名 API Key",search:"搜索名称、状态或权限",noMatches:"没有匹配的 API Key",noModelPermission:"当前 API Key 无权限",modelAvailable:"可用",permissionState:{Available:"可用于对话",Shutdown:"已下线",VideoGeneration:"视频生成模型",Unsupported:"不支持作为对话模型",NotActivated:"尚未开通",Unknown:"未获取到模型状态"}},Cdr=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:mQe,codePackage:gQe,common:cQe,default:{common:cQe,yaml:uQe,validation:dQe,defaults:hQe,helpers:fQe,intelligentDeployment:pQe,codePackage:gQe,buildCanvas:mQe,intelligent:vQe,projectLibrary:yQe,modePicker:bQe,promptEditor:xQe,skills:wQe,workflow:AQe,workbench:SQe,traditional:TQe,template:CQe,workspace:kQe,modelApiKey:OQe},defaults:hQe,helpers:fQe,intelligent:vQe,intelligentDeployment:pQe,modePicker:bQe,modelApiKey:OQe,projectLibrary:yQe,promptEditor:xQe,skills:wQe,template:CQe,traditional:TQe,validation:dQe,workbench:SQe,workflow:AQe,workspace:kQe,yaml:uQe},Symbol.toStringTag,{value:"Module"})),EQe={source:"任务来源",studio:"Studio 定时任务",title:"Runtime 定时任务",selectRuntime:"请先在 Agent 列表中选择一个云端 Runtime。",scope:"展示当前 Studio 用户在此 Runtime 中的定时任务。",refresh:"刷新",loading:"正在获取 Runtime 任务",empty:"此 Runtime 中没有符合条件的定时任务。",authRequired:"Runtime 拒绝了请求,请检查网关访问权限及 Runtime 的鉴权开关。",forbidden:"当前用户没有此 Runtime 的访问权限。",unsupported:"此 Runtime 未提供 mpa 定时任务接口。",invalidResponse:"任务接口返回了无法识别的数据,请检查 Runtime 版本。",loadFailed:"获取任务失败,请检查网络和 Runtime 状态后刷新。",pagination:"Runtime 任务分页",total:"共 {{total}} 条",previous:"上一页",next:"下一页",columns:{name:"任务名称",enabled:"状态",schedule:"执行计划",next:"下次执行",last:"最近结果"},schedule:{once:"单次",interval:"间隔",daily:"每天",weekly:"每周",monthly:"每月",cron:"Cron"},search:"搜索任务",executionCount:"执行次数",successRate:"成功率",prompt:"任务内容",manage:{view:"任务视图",list:"列表",calendar:"日历",create:"创建定时任务",edit:"编辑任务",copy:"复制",delete:"删除",detail:"详情",run:"立即执行",name:"任务",lastRun:"上次执行",schedule:"执行周期",lastStatus:"上次执行状态",agent:"执行 Agent",actions:"操作",all:"全部状态",Pending:"尚未执行",Queued:"已排队",Running:"执行中",Succeeded:"执行成功",Failed:"执行失败",TimedOut:"执行超时",Cancelled:"已取消",Skipped:"已跳过",overview:"执行统计:",prompt:"任务内容",timezone:"时区",localTime:"执行时间(当前设备时区)",time:"执行时间",Once:"单次",Interval:"间隔",Daily:"每天",Weekly:"每周",Monthly:"每月",Cron:"Cron 表达式",seconds:"秒",interval:"间隔秒数",weekdays:"星期(1 为周一,7 为周日,逗号分隔)",monthDays:"每月日期(1–31,逗号分隔)",delivery:"结果投递",Web:"Web",Feishu:"飞书",target:"飞书接收 ID",enabled:"启用任务",cancel:"取消",save:"保存",saving:"保存中",required:"请填写任务名称、Agent ID、任务内容和投递目标。",timezoneInvalid:"请输入有效的 IANA 时区,例如 Asia/Shanghai。",futureTime:"请选择未来的执行时间。",intervalInvalid:"间隔需要为 30–31536000 的整数秒。",daysInvalid:"请输入有效且不重复的日期或星期。",history:"执行记录",duration:"耗时",result:"结果 / 会话",noRuns:"暂无执行记录。",conflict:"任务已被修改或请求发生冲突,请关闭弹窗并刷新后重试。",invalid:"请求校验失败,请检查用户身份、执行时间、Agent ID 和任务配置。",queued:"已提交执行请求。",saved:"任务已更新。",deleteConfirm:"确定删除“{{name}}”?删除后将不再调度此任务。",calendarZone:"显示时区:",prevMonth:"上个月",nextMonth:"下个月",today:"今天",nextOnly:"仅下次",calendarHint:"日历展示预计执行安排;复杂 Cron 仅显示服务端给出的下一次执行时间。",botAccount:"投递机器人",selectBot:"请选择已启用的投递机器人。",botsLoading:"正在读取飞书机器人…",botsFailed:"读取投递机器人失败,请重试。",botsUnauthorized:"无权读取飞书机器人,请联系管理员配置投递。",retryBots:"重新读取机器人",botDisabled:"已停用"}},_Qe={backToList:"返回定时任务列表",cancel:"取消",cancelQueue:"取消排队",cancelQueueFirst:"请先取消排队",cancelling:"取消中…",closeDrawer:"关闭抽屉",collapse:"收起",connectingRuntime:"正在连接 Runtime…",createScheduledTask:"创建定时任务",createTask:"创建任务",delete:"删除",deleteTask:"删除任务",edit:"编辑",enable:"启用",expand:"展开",pause:"暂停",refresh:"刷新",refreshHistory:"刷新执行历史",rerun:"重新执行",retry:"重试",runNow:"立即执行",saveChanges:"保存更改",saving:"保存中…",stop:"终止执行",stopRun:"终止本次执行",stopRunFirst:"请先终止当前执行",stopping:"终止中…",viewDetails:"查看详情"},RQe={cancelDescription:"本次 Session 将被取消,后续计划不会暂停。",cancelTitle:"终止本次执行?",deleteDescription:"“{{name}}”及其全部执行历史将被永久删除。",deleteTitle:"删除定时任务?"},DQe={configuration:"任务配置",nextRun:"下次执行",pageLabel:"定时任务详情",region:"地域",runtime:"运行时",status:"任务状态"},LQe={createTitle:"创建定时任务",description:"每次触发都会为 Runtime Agent 创建独立 Session。",editTitle:"编辑定时任务"},MQe={minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",seconds:"{{count}} 秒"},IQe={cronExpression:"Cron 表达式",cronHelp:"依次填写分钟、小时、日期、月份、星期。",dailyTime:"每天执行时间",enableAfterCreate:"创建后启用",enableHelp:"启用后会从下一个计划时间开始执行。",name:"任务名称",namePlaceholder:"例如:每日生成运营摘要",noRuntime:"暂无可用 Runtime",prompt:"执行文本",promptPlaceholder:"输入每次执行时发送给 Agent 的固定文本",runAt:"执行时间",runtimeAgent:"运行时智能体",runtimeHelp:"任务始终跟随该 Runtime 当前生效版本。",runtimePlaceholder:"选择 Runtime Agent",schedule:"执行计划",scheduleType:"执行计划类型",timezone:"时区",weekday:"星期"},PQe={all:"全部"},NQe={description:"每次运行均使用独立 Session,结果与错误会永久保留。",duration:"耗时 {{duration}}",emptyDescription:"任务触发或立即执行后,记录会显示在这里。",emptyTitle:"暂无执行记录",errorDetails:"错误详情",finalAnswer:"最终回答",loadFailed:"无法加载执行历史",loadFailedDescription:"请检查 Studio 服务后重试。",session:"会话",title:"执行历史"},BQe={cancelRequested:"已提交终止请求。",created:"任务已创建。",deleted:"任务及其执行历史已删除。",enabled:"任务已启用。",paused:"任务已暂停。",queued:"任务已排队,将在一分钟内开始执行。",requeued:"任务已重新排队,将在一分钟内开始执行。",updated:"任务已更新。"},$Qe={filterLabel:"定时任务状态筛选",listLabel:"定时任务列表",loadFailed:"无法加载定时任务",loadFailedDescription:"请检查 Studio 服务后重试。",title:"定时任务"},FQe={cron:"Cron {{cron}}{{zone}}",daily:"每天 {{time}}{{zone}}",once:"一次 · {{date}}{{zone}}",weekly:"{{weekday}} {{time}}{{zone}}"},zQe={daily:"每天",once:"一次性",weekly:"每周"},UQe={cancelled:"已取消",enabled:"已启用",failed:"失败",notRun:"尚未执行",paused:"已暂停",pending:"准备中",queued:"已排队",retrying:"自动重试中",running:"执行中",skipped:"已跳过",success:"成功"},VQe={cronFields:"Cron 表达式需要包含 5 个字段,例如 0 9 * * *。",nameRequired:"请输入任务名称。",promptRequired:"请输入每次执行时发送给 Agent 的文本。",runtimeAppMissing:"Runtime Agent 未返回可调用的 appName,请确认 Runtime 已就绪且版本兼容。",runtimeRequired:"请选择可用的 Runtime Agent。",timeRequired:"请选择执行时间。"},GQe={friday:"周五",monday:"周一",saturday:"周六",sunday:"周日",thursday:"周四",tuesday:"周二",wednesday:"周三"},kdr=Object.freeze(Object.defineProperty({__proto__:null,actions:_Qe,confirm:RQe,default:{mpa:EQe,actions:_Qe,confirm:RQe,detail:DQe,drawer:LQe,duration:MQe,fields:IQe,filters:PQe,history:NQe,notices:BQe,page:$Qe,schedule:FQe,scheduleTypes:zQe,status:UQe,validation:VQe,weekdays:GQe},detail:DQe,drawer:LQe,duration:MQe,fields:IQe,filters:PQe,history:NQe,mpa:EQe,notices:BQe,page:$Qe,schedule:FQe,scheduleTypes:zQe,status:UQe,validation:VQe,weekdays:GQe},Symbol.toStringTag,{value:"Module"})),QQe="快速创建 Agent",HQe="Agent 类型",WQe="关闭",YQe="部署",qQe="预览配置",jQe="已发起配置包下载",XQe="下载失败,请重试",KQe="有 {{count}} 处配置需要修改",ZQe="自定义",JQe="自定义{{field}}",eHe="输入自定义值",tHe="该模型未声明推理强度,使用服务端设置",rHe="请先为该提供方添加模型",nHe="请先选择提供方",iHe="请选择",aHe="可选",oHe="默认模型、Agent 预设和权限用于新会话;预设需要存在于部署的 Harness 中",sHe="仅填写环境变量名称,实际密钥由部署环境提供",lHe="read-only 为只读,workspace-write 可写工作区,danger-full-access 允许完整访问且不请求确认",cHe="allowedModels 是子 Agent 可选择的模型列表,启用后至少填写一组提供方和模型",uHe="添加自定义模型服务,填写它的端点、协议和模型 ID,支持火山引擎和 BytePlus 等兼容服务",dHe="当前覆盖常用原生设置,其他插件参数与预设文件尚未接入",hHe="查看原生配置文档",fHe="模型提供方 {{index}}",pHe="模型 {{index}}",gHe="添加模型提供方",mHe="移除提供方 {{index}}",vHe="添加模型",yHe="移除模型 {{index}}",bHe="添加可选模型",xHe="移除可选模型 {{index}}",wHe="移除",AHe="填写服务端的模型 ID",SHe={provider:"提供方 {{index}}",model:"模型 {{index}}"},THe={defaults:"会话默认设置",deepseek:"DeepSeek 模型服务",providers:"自定义模型提供方",shell:"命令执行",loop:"工具调用",subagents:"子 Agent 模型选择",search:"DeepSeek 网络搜索"},CHe={id:"提供方 ID",displayName:"显示名称",baseURL:"服务地址",api:"接口协议",apiKeyEnv:"密钥环境变量"},kHe={id:"例如 company-models",displayName:"可选,默认使用提供方 ID",baseURL:"https://…/v1",api:"选择接口协议",apiKeyEnv:"例如 MODEL_API_KEY"},OHe={id:"模型 ID",name:"显示名称",contextWindow:"上下文容量",maxTokens:"最大输出容量"},EHe={positive:"请输入大于 0 的数值",integer:"请输入有效的正整数",env:"请输入环境变量名,只能包含字母、数字和下划线,且不能以数字开头",url:"请输入 HTTP 或 HTTPS 地址,不要在地址中包含凭据",option:"请选择受支持的原生选项",required:"请补全此项",duplicate:"该 ID 或模型组合已存在",providerId:"以小写字母开头,可包含小写字母、数字、点、下划线和连字符,不能使用保留 ID",routes:"请至少填写一组完整的提供方和模型",modelPair:"请填写该自定义提供方下的模型 ID",unknownProvider:"请先添加该自定义模型提供方",unknownModel:"请填写该提供方下已配置的模型 ID",timer:"请输入大于 0 且不超过 2147483647 的毫秒数"},_He={"agent-default-model_provider":"默认提供方","agent-default-model_model":"默认模型","agent-default-model_reasoningEffort":"默认推理强度","agent-presets_default":"默认 Agent 预设",permission_defaultPreset:"默认权限预设","llm-deepseek_apiKeyEnv":"密钥环境变量","llm-deepseek_baseURL":"服务地址","llm-deepseek_thinking":"思考模式","llm-deepseek_reasoningEffort":"推理强度","llm-deepseek_maxTokens":"每次请求的输出上限","llm-deepseek_defaultContextWindow":"默认上下文容量","llm-deepseek_streamIdleTimeoutMs":"流式空闲超时(毫秒)",bash_timeoutMs:"默认执行超时(毫秒)",bash_maxTimeoutMs:"最大执行超时(毫秒)",bash_maxOutputBytes:"输出上限(字节)","agent-loop_maxParallelToolCalls":"并行工具调用上限","subagent-model-selection_enabled":"启用模型选择","web-search-deepseek_apiKeyEnv":"密钥环境变量","web-search-deepseek_baseURL":"搜索服务地址","web-search-deepseek_model":"搜索模型","web-search-deepseek_apiVersion":"接口版本","web-search-deepseek_maxTokens":"搜索输出上限","web-search-deepseek_maxUses":"搜索次数上限"},RHe="取消",DHe="返回创建方式",LHe="DeepSeek Harness 配置",Odr=Object.freeze(Object.defineProperty({__proto__:null,addModel:vHe,addProvider:gHe,addRoute:bHe,agentType:HQe,back:DHe,cancel:RHe,close:WQe,coverage:dHe,credentialHelp:sHe,customField:JQe,customValue:ZQe,default:{title:QQe,agentType:HQe,close:WQe,continue:"继续配置",deploy:YQe,preview:qQe,export:"导出配置",downloaded:jQe,downloadFailed:XQe,validationSummary:KQe,customValue:ZQe,customField:JQe,enterCustomValue:eHe,reasoningUnavailable:tHe,modelsUnavailable:rHe,selectProviderFirst:nHe,selectOption:iHe,optional:aHe,defaultsHelp:oHe,credentialHelp:sHe,permissionHelp:lHe,routesHelp:cHe,providersHelp:uHe,coverage:dHe,source:hHe,provider:fHe,model:pHe,addProvider:gHe,removeProvider:mHe,addModel:vHe,removeModel:yHe,addRoute:bHe,removeRoute:xHe,remove:wHe,modelIdPlaceholder:AHe,route:SHe,sections:THe,providerFields:CHe,providerPlaceholders:kHe,modelFields:OHe,errors:EHe,fields:_He,cancel:RHe,back:DHe,pageTitle:LHe},defaultsHelp:oHe,deploy:YQe,downloadFailed:XQe,downloaded:jQe,enterCustomValue:eHe,errors:EHe,fields:_He,model:pHe,modelFields:OHe,modelIdPlaceholder:AHe,modelsUnavailable:rHe,optional:aHe,pageTitle:LHe,permissionHelp:lHe,preview:qQe,provider:fHe,providerFields:CHe,providerPlaceholders:kHe,providersHelp:uHe,reasoningUnavailable:tHe,remove:wHe,removeModel:yHe,removeProvider:mHe,removeRoute:xHe,route:SHe,routesHelp:cHe,sections:THe,selectOption:iHe,selectProviderFirst:nHe,source:hHe,title:QQe,validationSummary:KQe},Symbol.toStringTag,{value:"Module"})),MHe="问题反馈",IHe="问题描述",PHe="常见问题",NHe="取消",BHe="完成",$He="提交反馈",FHe="正在上报…",zHe={title:"上报成功,感谢您的反馈",description:"AgentKit 团队会尽快查看您提交的问题。"},UHe={close:"关闭问题反馈",intro:"请选择遇到的问题,也可以补充具体表现。",privacy:"您的对话数据将会上报到 AgentKit 团队,请注意隐私保护。",descriptionPlaceholder:"请描述问题发生时的表现(选填)",issues:{slow:"执行速度慢",crash:"运行崩溃",incorrect:"结果不准确",tool_error:"工具调用失败",other:"其他问题"}},VHe={description:"告诉我们您在使用 AgentKit Studio 时遇到的问题。",module:"所属模块",modules:{conversation:"对话",agents:"智能体",applications:"自动化",search:"搜索",other:"其他"},commonIssuesMultiple:"常见问题(可多选)",issueTypes:"问题类型",issues:{page_slow:"页面加载慢",feature_unavailable:"功能无法使用",display_error:"页面显示异常",no_response:"操作无响应",other:"其他问题"},descriptionPlaceholder:"请描述问题发生时的页面、操作和表现",quickAdd:"快捷补充",suggestionsLabel:"问题描述推荐",suggestions:{noResponse:"点击后没有反应",loading:"页面一直处于加载状态",incomplete:"部分内容显示不完整",error:"操作后出现错误提示"},privacy:"您的数据将会上报到 AgentKit 团队,请注意隐私保护。"},Edr=Object.freeze(Object.defineProperty({__proto__:null,cancel:NHe,commonIssues:PHe,default:{title:MHe,descriptionLabel:IHe,commonIssues:PHe,cancel:NHe,done:BHe,submit:$He,submitting:FHe,success:zHe,dialog:UHe,page:VHe},descriptionLabel:IHe,dialog:UHe,done:BHe,page:VHe,submit:$He,submitting:FHe,success:zHe,title:MHe},Symbol.toStringTag,{value:"Module"})),GHe={back:"返回",close:"关闭"},QHe={title:"优化迁移项目",closeAria:"关闭优化窗口"},HHe={title:"已迁移项目",description:"管理迁移后的源码版本,也可以选择任一版本继续优化。",libraryTitle:"项目与版本",libraryDescription:"查看、下载、部署或对比源码版本,也可以基于任一版本继续优化。",emptyTitle:"还没有已迁移的项目",emptyDescription:"迁移完成后,源码会自动保存在这里。"},WHe={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any(通用迁移)"},YHe={awaitingUpload:"待上传",analyzing:"分析中",needsInput:"待补充",analysisReady:"待确认",migrating:"迁移中",validating:"校验中",packaging:"打包中",succeeded:"已完成",succeededWithWarnings:"已完成,有提示",partial:"部分完成",failed:"失败",cancelled:"已终止",expired:"已过期"},qHe={evaluationPending:"待评测",evaluationRunning:"评测中",waitingDataset:"待保存评测用例",waitingEnvironment:"待补充环境变量",evaluationFailed:"迁移完成,评测未完成",evaluationBlocked:"迁移完成,评测待处理",evaluationCancelled:"迁移完成,评测已取消",resultUnavailable:"结果不可用",environmentExpired:"环境已过期"},jHe={partialReady:"迁移产物已生成,但交付不完整,请查看迁移提示。",readyWithWarnings:"迁移产物已生成,请查看迁移提示。",ready:"迁移产物已生成。"},XHe={passed:"产物校验通过",failed:"产物校验未通过",degraded:"产物校验未完成"},KHe={session:"创建迁移环境",upload:"上传项目",analysis:"分析项目"},ZHe={agentNameRequired:"请输入 Agent 名称",agentNameInvalid:"Agent 名称必须为 1-63 位,只能包含小写字母、数字和连字符,且必须以字母或数字开头和结尾"},JHe={seconds:"{{seconds}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},eWe={savedUnaffected:"已保存项目不受影响",savingUnaffected:"源码正在保存,完成后不受环境期限影响",activeDetail:"到期后任务记录和临时产物将无法访问",oneHour:"临时迁移环境保留 1 小时",ended:"临时迁移环境已结束",savedAvailable:"已保存项目仍可查看、下载、部署或优化",unavailable:"任务记录和临时产物已无法访问",countdown:"临时迁移环境将在 {{minutes}} 分 {{seconds}} 秒后结束",expiredSavedMessage:"临时迁移环境已结束,已保存项目不受影响。",expiredMessage:"临时迁移环境已结束,任务记录和临时产物无法继续访问。"},tWe={recommended:"建议迁移方式",scope:"迁移范围",excluded:"不在本次范围",viewEvidence:"查看分析证据",viewAssumptions:"查看关键假设",viewSourceEvidence:"查看源码证据"},rWe={ariaLabel:"Codex 执行动态",title:"Codex 执行动态",startingAnalysis:"Codex 正在开始分析…",startingMigration:"Codex 正在开始迁移…",loadError:"暂时无法读取 Codex 执行动态,不影响当前任务。",liveAnalyzing:"正在分析项目",liveMigrating:"正在执行迁移",liveValidating:"正在校验迁移结果",livePackaging:"正在整理迁移产物",liveDelivery:"正在核对交付产物"},nWe={title:"迁移产物",fileTooLarge:"该文件超过 2 MiB,请下载完整产物后查看。",unsupportedPreview:"该文件不支持在线预览,请下载完整产物后查看。",filesAria:"迁移产物文件",searchAria:"搜索产物文件",searchPlaceholder:"搜索文件",limit:"仅展示前 {{count}} 项,请搜索具体文件。",noSelection:"未选择文件",noPreview:"暂无可预览文件。",loadingFile:"正在读取产物文件…",startupFile:"启动文件",fileCountLabel:"文件数",saved:"源码已保存,可继续查看、下载、部署或优化。",saving:"产物已生成,正在保存源码版本。",deployReady:"产物可预览、下载和部署,正在等待源码保存状态。",deployUnavailable:"产物可预览和下载,但当前交付状态不支持部署。",viewProjects:"查看已迁移项目",downloading:"下载中…",downloadZip:"下载 ZIP",deployTitle:"部署迁移产物",deployUnavailableTitle:"当前交付状态不支持部署",deployRuntime:"部署到 Runtime",fileCount:"{{count}} 个文件",startup:"启动文件 {{module}}",loading:"正在读取迁移产物…"},iWe={retiring:"即将下线",currentDefault:"当前默认模型",loadError:"加载模型列表失败",label:"模型",placeholder:"选择模型"},aWe={zipOnly:"请选择 .zip 格式的本地项目文件。",invalidName:"ZIP 文件名无效,请重命名后重新选择。",tooLarge:"项目 ZIP 不能超过 {{size}}。",empty:"项目 ZIP 不能为空。",removeAria:"移除项目 ZIP",reselectPrompt:"重新选择项目 ZIP",selectPrompt:"选择或拖入本地项目 ZIP",reselect:"重新选择",selectZip:"选择 ZIP",continue:"继续上传",start:"上传并分析",inputAria:"选择本地项目 ZIP",retention:"临时迁移环境从创建完成起保留 1 小时;保存成功的源码版本不受影响。",uploading:"上传中…",sizeHint:"支持项目 ZIP,最大 {{size}}"},oWe={requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}",notReady:"迁移产物尚未准备完成。",back:"返回迁移结果"},sWe={backToAddAgent:"返回添加 Agent",title:"从存量迁移",newMigration:"新建迁移",recent:"最近迁移",loadingSessions:"正在读取迁移会话…",noSessions:"暂无迁移会话",heading:"迁移存量 Agent 项目",intro:"上传本地项目 ZIP,Codex 将先进行只读分析,再由你确认迁移方式。",backToHome:"迁移首页",navigation:"迁移导航",showMore:"查看更多",showLess:"收起",projectName:"项目名称",status:"状态",createdAt:"创建时间",actions:"操作",openTask:"查看迁移 {{name}}",continueTask:"继续",viewTask:"查看"},lWe={stop:"终止迁移",stopping:"正在终止…",cancel:"取消",reload:"重新读取",refreshStatus:"刷新状态"},cWe={unavailable:"迁移能力暂不可用",defaultReason:"Dev Sandbox 暂不可用,请联系管理员检查配置。"},uWe={creatingSandbox:"正在创建 Dev Sandbox",initializing:"正在初始化迁移工作目录,并检查 AgentKit CLI、Codex 和迁移能力。环境就绪后将自动上传项目。",elapsed:"已等待 {{duration}}",uploadThenAnalyze:"ZIP 上传完成后将自动开始只读分析。",analyzing:"Codex 正在识别框架、入口和迁移边界,不会执行实际迁移。",migrationLocked:"迁移执行中不能修改附件或迁移方式。你可以等待当前任务结束,或主动终止。",analysisPaused:"只读分析已暂停。请仅回答下面列出的问题,提交后会在同一迁移环境中重新分析,不会开始实际迁移。",analysisComplete:"只读分析已完成。请检查建议,并确认最终迁移方式。",awaitingUpload:"迁移环境已创建,请重新选择本地 ZIP 继续上传。",expiredTitle:"迁移环境已过期",expiredDescription:"迁移内容和产物已无法预览、下载或部署。如已完成 Runtime 部署,可返回智能体页面继续使用。",unsupportedTitle:"当前 ZIP 暂时无法迁移",unsupportedHint:"请按提示整理项目后,新建迁移并重新上传。",failedTitle:"迁移未完成",cancelled:"当前迁移已终止。你可以新建迁移并重新上传项目。"},dWe={ariaLabel:"补充项目分析信息",title:"补充分析所需信息",description:"附件保持锁定,提交后仅继续只读分析",submitting:"正在继续分析…",submit:"提交并继续分析"},hWe={ariaLabel:"回答迁移需要你决定的问题",title:"迁移需要你的回答",description:"回答后会在当前这一步里继续,不需要重新开始",other:"其他",otherPlaceholder:"也可以直接输入你的答案",submitting:"正在提交回答…",submit:"提交回答并继续"},fWe={ariaLabel:"确认迁移方式",title:"确认迁移方式",framework:"迁移方式",frameworkPlaceholder:"选择迁移方式",agentName:"Agent 名称",entry:"项目入口",entryPlaceholder:"选择项目入口",entryExample:"例如 agent.py:agent",consent:"点击“确认并开始迁移”即确认上述迁移范围、排除项和关键假设。",starting:"正在启动迁移…",start:"确认并开始迁移"},pWe={setup:{title:"迁移效果评测",description:"迁移完成后自动执行评测用例。",on:"已开启",off:"未开启",unavailable:"当前环境暂不支持迁移效果评测。",casesTitle:"评测用例",casesDescription:"至少添加一个用例。期望结果和评测标准可选。",configuredSummary:"{{count}} 个用例 · {{preset}} · {{dimensions}}",incompleteSummary:"{{count}} 个用例待填写 · {{preset}} · {{dimensions}}",dimensionSummary:"{{count}} 个维度",editSettings:"编辑设置",viewSettings:"查看设置",lockedTitle:"评测用例",lockedDescription:"上传开始后不可修改。",closeAria:"关闭评测设置",done:"完成配置",close:"关闭"},tabs:{label:"迁移任务内容",migration:"迁移",evaluation:"效果评测",waitingMigration:"等待迁移",waitingConfiguration:"待配置",running:"评测中",completed:"已完成",issue:"需处理"},bulk:{open:"批量粘贴",label:"每行输入一个用例",placeholder:`帮我查询今天的订单状态 把结果整理成三点`,preview:"将添加 {{count}} 个用例",confirm:"添加用例"},case:{title:"用例 {{index}}",add:"添加用例",moveUp:"上移用例 {{index}}",moveDown:"下移用例 {{index}}",copy:"复制",delete:"删除",userInput:"用户输入",userInputPlaceholder:"例如:请帮我查询今天的订单状态",expectedOutcome:"期望结果(可选)",expectedOutcomePlaceholder:"描述希望 Agent 完成什么,不要求逐字一致",criteria:"必须满足的要求(可选)",addCriterion:"添加要求",criterionLabel:"必须满足的要求 {{index}}",criterionPlaceholder:"例如:必须包含订单号和当前状态",removeCriterion:"删除要求 {{index}}"},advanced:{title:"高级设置",standard:"标准评测",standardDescription:"默认包含语义一致性、输出约束、工作流与工具一致性 3 个维度,适合多数迁移。",custom:"自定义维度",customDescription:"按业务风险选择一个或多个评测维度。",lockedDescription:"项目开始上传后,评测方式和维度不再修改。"},dimension:{semantic_fidelity:"语义一致性",output_contract:"输出约束",workflow_tool_fidelity:"工作流与工具一致性",context_memory_fidelity:"上下文与记忆一致性",boundary_error_fidelity:"边界与异常一致性",safety_refusal_fidelity:"安全与拒答一致性"},dimensionDescription:{semantic_fidelity:"检查意图理解、结论和关键事实是否保持一致。",output_contract:"检查字段、结构、语言和格式约束是否保持。",workflow_tool_fidelity:"检查可观察的工作流分支和工具行为是否保持。",context_memory_fidelity:"检查可验证的多轮上下文和记忆行为。",boundary_error_fidelity:"检查无效输入、信息缺失和依赖失败时的行为。",safety_refusal_fidelity:"检查已有授权、拒答和敏感信息边界是否保持。"},validation:{caseCount:"请保留 1–{{count}} 个用例。",dimensionRequired:"请至少选择一个评测维度。",userInputRequired:"请输入用例内容。",userInputBytes:"单个用例不能超过 32 KiB。",expectedOutcomeBytes:"期望结果不能超过 16 KiB。",criteriaCount:"单个用例最多包含 {{count}} 条要求。",criterionRequired:"要求不能为空。",criterionBytes:"单条要求不能超过 2 KiB。",datasetBytes:"全部评测用例不能超过 10 MiB。"},dataset:{invalidLockResponse:"服务未确认评测用例已保存,请重试。",loadingSettings:"正在读取评测设置…",loadSettingsFailed:"评测设置读取失败。",retryLoadSettings:"重新读取",missing:"未找到已保存的评测用例,请重新填写并保存。",saveWarning:"评测用例暂未保存,不影响迁移。",retrySave:"重新保存评测用例",saving:"正在保存…"},state:{disabled:"未开启评测",waiting_dataset:"等待填写评测用例",pending:"迁移完成后自动开始评测",preparing:"正在准备评测环境…",waiting_environment:"需要补充运行所需的环境变量",deploying:"正在部署临时 Runtime…",executing:"正在执行评测用例…",judging:"正在执行评测分析…",aggregating:"正在汇总评测结果…",completed:"评测已完成",failed:"评测未完成",blocked:"评测需要处理后才能继续",cancelled:"评测已取消"},progress:{label:"迁移与迁移效果评测进度",migration:"迁移",evaluation:"迁移效果评测",notStarted:"未开始",inProgress:"进行中",completed:"完成",waitingConfiguration:"等待配置",issue:"有问题"},environment:{description:"填写临时 Runtime 所需的环境变量。",security:"仅用于本次评测。",optional:"可选",submit:"提交并继续评测",submitting:"正在提交…"},execution:{preparing:"准备评测",preparingDetail:"校验迁移产物和 {{count}} 个评测用例",deploying:"启动 Runtime",deployingDetail:"准备 {{runtime}}",runtimeFallback:"隔离运行环境",executing:"执行用例",executingDetail:"执行 {{count}} 个用例并记录输出",judging:"执行评测分析",judgingDetail:"评测 {{cases}} 个用例 · {{dimensions}} 个维度",aggregating:"生成评测报告",aggregatingDetail:"汇总评分与证据,生成 HTML 报告",waiting:"等待中",running:"执行中",failed:"失败",complete:"已完成"},result:{title:"执行进度",attempt:"第 {{attempt}} 次评测",pending:"等待迁移完成",retry:"重新评测",retrying:"正在重试…",failureStage:"失败阶段",errorCode:"错误码",taskId:"任务 ID",diagnosticAttempt:"评测轮次",runtime:"Runtime",errorDetails:"错误详情",diagnosticField:"{{label}}:{{value}}",diagnosticHeading:"{{label}}:",loadingReport:"正在读取评测报告…",reportTitle:"HTML 评测报告",reportHtmlDescription:"查看或下载 HTML 报告。",viewReport:"查看报告",reportDrawerDescription:"评分、差异与证据",closeReport:"关闭",closeReportAria:"关闭评测报告",reportPreviewTitle:"迁移效果评测报告预览",reportSummary:"评测摘要",reportVersion:"评测集 {{version}} · Prompt v{{prompt}}",downloadReport:"下载完整报告",downloadingReport:"正在下载…",overallScore:"综合一致性",scoreScale:"0–100;证据不足时显示 N/A",evidenceCoverage:"证据覆盖率",coverageDetail:"{{scored}} / {{total}} 个维度有证据",executionSuccess:"执行成功率",executionDetail:"{{succeeded}} / {{total}} 个用例完成",naCount:"N/A 数量",naDescription:"证据不足,不计入分数",gapDescription:"迁移差距说明",lowestScoringCases:"低分用例",executionFailures:"执行异常",criticalEvidence:"Critical 证据",limitations:"评测限制",viewEvidence:"查看 {{count}} 个用例的结果与证据",outputTruncated:"输出过长,已截断",executionState:{succeeded:"执行完成",failed:"执行异常"},severityLabel:"严重度:{{severity}}",severity:{none:"无",low:"低",medium:"中",high:"高",critical:"Critical",unknown:"未知"},evidenceSource:{user_reference:"期望结果",user_criteria:"填写的要求",source_contract:"源项目约束",observed_output:"实际输出",runtime_observation:"Runtime 原始数据",deterministic_assertion:"确定性断言"},listSeparator:"、"}},gWe={closeAria:"关闭错误提示",loadFailed:"无法读取迁移数据,请重试。",refreshFailed:"无法刷新迁移状态,请重试。"},mWe={title:"终止当前迁移?",description:"终止后,当前分析或迁移进程将停止,已执行的步骤不会继续。"},_dr=Object.freeze(Object.defineProperty({__proto__:null,actions:lWe,activity:rWe,analysis:tWe,artifact:nWe,capability:cWe,common:GHe,confirmation:fWe,conversation:uWe,default:{common:GHe,optimization:QHe,projects:HHe,framework:WHe,state:YHe,historyStatus:qHe,task:jHe,verification:XHe,transfer:KHe,validation:ZHe,duration:JHe,expiry:eWe,analysis:tWe,activity:rWe,artifact:nWe,model:iWe,upload:aWe,deployment:oWe,workspace:sWe,actions:lWe,capability:cWe,conversation:uWe,questions:dWe,pendingInput:hWe,confirmation:fWe,evaluation:pWe,errors:gWe,stopDialog:mWe},deployment:oWe,duration:JHe,errors:gWe,evaluation:pWe,expiry:eWe,framework:WHe,historyStatus:qHe,model:iWe,optimization:QHe,pendingInput:hWe,projects:HHe,questions:dWe,state:YHe,stopDialog:mWe,task:jHe,transfer:KHe,upload:aWe,validation:ZHe,verification:XHe,workspace:sWe},Symbol.toStringTag,{value:"Module"})),vWe={loading:"加载中…",searchLabel:"搜索{{label}}",searchPlaceholder:"搜索{{label}}",retry:"重试",noMatches:"没有匹配项",noOptions:"暂无可选项",selection:"{{label}}:{{value}}"},yWe={badge:"焕然一新",view:"查看新特性",title:"本次更新",defaultNotes:{multiRegion:"多地域智能体:并行加载北京与上海 Runtime,列表下滑即可继续加载。",switchAgent:"会话内切换:在输入框旁选择智能体,并直接开启一段新会话。",visualCanvas:"可视化执行画布:通过横向画布查看多智能体结构,并支持全屏浏览。"}},bWe={label:"新会话模式",agent:"智能体",skill:"技能定制",video:"视频创作"},xWe={select:"选择新会话模式",agent:{label:"Agent",description:"与当前选择的 Agent 对话"},builtin:{label:"内置智能体",description:"使用平台提供的智能体"},codex:{label:"Codex 智能体",description:"在沙箱中执行任务"},deepseekHarness:{label:"DeepSeek Harness",description:"打开 DeepSeek Harness 工作区"},arkClaw:"ArkClaw",hermes:"Hermes 智能体",checking:"正在检查配置",notConfigured:"管理员未配置",unavailable:"暂不可用"},wWe={select:"选择智能体",typesLabel:"智能体类型",listLabel:"{{type}}列表",types:{agent:"智能体",general:"通用智能体",mpa:"MPA 智能体",codex:"Codex 智能体",deepseekHarness:"DeepSeek Harness",openclaw:"OpenClaw 智能体",hermes:"Hermes 智能体"},loading:"正在加载智能体",reload:"重新加载",empty:"暂无{{type}}",emptyLocal:"暂无本地智能体",emptyGeneral:"暂无通用智能体",createHint:"请前往智能体页创建",localHint:"请检查当前 Studio 启动目录",waking:"正在唤醒",opening:"正在打开",connecting:"正在连接",loadingMore:"加载中",loadMore:"加载更多",runtimeTimeout:"加载智能体超时(15 秒),请检查网络或 Runtime 服务后重试",loadGeneral:"加载通用智能体",loadType:"加载 {{type}}",connectGeneral:"连接通用智能体",openLocal:"打开本地智能体",openType:"打开 {{type}}",wakingHint:"正在唤醒智能体,可能需要一些时间。"},AWe={spaceAria:"技能空间",configuration:"技能定制配置",actions:{create:"技能生成",optimize:"技能优化"},selectAction:"选择技能定制方式",actionList:"技能定制方式",style:"风格",selectStyle:"选择风格",model:"模型",selectModel:"选择模型",styles:{concise:"简洁实用",strict:"严谨稳健",tutorial:"教程友好",automation:"自动化优先"},modelLoadFailed:"模型配置加载失败",spaceLoadFailed:"Skill Space 加载失败",skillLoadFailed:"Skill 加载失败",unnamedSpace:"未命名 Skill Space",space:"技能空间",select:"选择 Skill",selectAria:"选择 Skill:{{skill}}",loadingSpaces:"正在加载 Skill Space",reload:"重新加载",emptySpaces:"暂无 Skill Space",skillList:"{{space}} Skill 列表",loadingSkills:"正在加载 Skill",emptySkills:"暂无 Skill"},SWe={modes:{auto:"自动识别",text_to_video:"文生视频",reference_to_video:"参考素材生视频",video_editing:"视频编辑",video_extension:"视频续写",first_last_frame:"首尾帧生成"},taskNames:{auto:"视频生成",text_to_video:"文生视频",reference_to_video:"参考素材生视频",video_editing:"视频编辑",video_extension:"视频续写",first_last_frame:"首尾帧生成"},controls:{label:"视频创作配置",aspectRatio:"比例",selectAspectRatio:"选择比例",resolution:"清晰度",selectResolution:"选择清晰度",duration:"时长",durationShort:"{{count}} 秒",durationAria:"视频时长:{{count}} 秒",lastFrame:"尾帧",lastFrameHelper:"添加视频结束画面",assistImage:"辅助图片",referenceImage:"参考图片",assistImageHelper:"用于补充画面参考",imageHelper:"支持常见图片格式",referenceVideo:"参考视频",videoHelper:"支持常见视频格式",optional:"可选",replace:"更换",add:"添加",upload:"上传{{label}}",replaceFile:"更换{{label}}:{{name}}",removeFile:"移除{{label}} {{name}}",storageUnavailable:"管理员未配置持久化存储",loadingEnhancer:"正在加载增强模型",enhancerHint:"使用 {{model}} 模型进行意图识别和提示词增强",enhancerUnavailable:"增强模型不可用"},task:{title:"视频生成任务",closeAria:"关闭视频生成任务弹窗",progressAria:"视频生成进度",optimizedPrompt:"优化后的提示词",processingAria:"{{task}}处理进度",waitingAria:"{{status}},已等待{{elapsed}}",elapsed:"已等待 {{elapsed}}",previewAria:"生成结果预览",close:"关闭",download:"下载视频",retryOptimization:"重试提示词优化",retryGeneration:"重试视频生成",providerQueued:"等待模型调度",providerRunning:"模型生成中",providerSubmitting:"正在提交任务",queuedHint:"任务已提交,模型开始处理后状态会自动更新",runningHint:"这可能持续数分钟,完成后将在这里显示视频预览",backgroundHint:"可以关闭弹窗,任务会继续在后台运行",successHint:"视频已生成,可预览或下载",activationHint:"请先在模型控制台开通服务,再重试生成",retryHint:"修正问题后可重试当前步骤",steps:{optimizationFailed:"提示词优化失败",optimizationDone:"提示词优化完成",optimizationActive:"提示词优化中",generationDone:"{{task}}已完成",generationFailed:"{{task}}失败",generationQueued:"{{task}}排队中",generationRunning:"{{task}}生成中",generationActive:"{{task}}进行中",generationPending:"等待视频生成",generationComplete:"视频生成完成"},elapsedHours:"{{hours}}小时{{minutes}}分",elapsedMinutes:"{{minutes}}分{{seconds}}秒",elapsedSeconds:"{{seconds}}秒"}},Rdr=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:wWe,compactSelect:vWe,default:{compactSelect:vWe,featureNotice:yWe,workspace:bWe,mode:xWe,agentPicker:wWe,skill:AWe,video:SWe},featureNotice:yWe,mode:xWe,skill:AWe,video:SWe,workspace:bWe},Symbol.toStringTag,{value:"Module"})),TWe="审核中心",CWe="审核资源类型",kWe="仅管理员可以访问审核中心",OWe="搜索申请名称、提交人或版本",EWe="审核状态",_We="{{count}} 条待审核",RWe="共 {{count}} 条申请",DWe={skill:"技能",agent:"智能体"},LWe={all:"全部状态",pending:"待审核",approved:"已通过",returned:"已退回",approving:"发布中"},MWe={application:"申请名称",submitter:"提交人",version:"版本",submittedAt:"提交时间",status:"状态",actions:"操作"},IWe={details:"详情",detailsFor:"查看 {{name}} 的申请详情",approve:"通过",approveFor:"通过 {{name}} 的申请",return:"退回",returnFor:"退回 {{name}} 的申请",close:"关闭",backToDetails:"返回详情",confirmApprove:"确认通过",confirmReturn:"确认退回",clearFilters:"清除筛选",refresh:"刷新",cancel:"取消",resumeApproval:"继续发布"},PWe={title:"暂无审核申请",description:"提交的审核申请会显示在这里",filteredTitle:"没有匹配的申请",filteredDescription:"试试其他关键词,或调整审核状态"},NWe={title:"申请详情",sections:"申请详情内容",overview:"申请信息",files:"提交文件 · {{count}}",requestType:"申请类型",update:"版本更新",firstRelease:"首次发布",source:"来源",source_skill:"{{name}}的个人技能空间",source_agent:"{{name}}的开发环境",destination:"发布目标",destination_skill:"企业共享技能空间",destination_agent:"全员共享智能体",region:"区域",visibility:"发布后可见范围",shared:"全员可见",description:"功能说明",changes:"本次提交说明",example:"使用示例",history:"审核记录",submitted:"{{name}}提交申请",versionFixed:"仅审核本次提交的版本",instructions:"使用说明",filesTab:"提交文件",filesFailed:"加载提交文件失败",unknownAuthor:"未知申请人",reviewer:"审批人",reviewedAt:"审批时间",approved:"{{name}}通过申请",returned:"{{name}}退回申请",unknownReviewer:"未知审批人",approvedBy:"通过人",returnedBy:"退回人",comment:"审批评论",result:"审批结果",noHistory:"此技能尚未提交审核",pendingHint:"等待管理员审核",approvingHint:"管理员已确认通过,正在发布到企业共享空间",approving:"{{name}}确认通过,等待完成发布"},BWe={failed:"待审核空间暂不可用",retry:"重试"},$We={approveTitle:"通过申请",returnTitle:"退回申请",approveDescription:"通过后,{{name}} 的 {{version}} 版本将在企业共享空间中向全员公开",returnDescription:"退回 {{name}} 的 {{version}} 版本,并向申请人说明原因",reason:"退回理由",reasonRequired:"请填写退回理由",reasonHelp:"最多 256 个字符,申请人可以看到此理由",saving:"处理中…",failed:"审批失败,请重试",approved:"{{name}} 已通过并公开",returned:"{{name}} 已退回",comment:"评论(可选)",commentHelp:"最多 256 个字符,申请人可以看到此评论"},FWe={title:"AI 评分",points:"{{score}} 分",insufficient:"依据不足",status:{unscored:"尚未评分",not_requested:"尚未评分",queued:"等待评分",running:"评分中",completed:"已评分",failed:"评分失败"},loading:"加载评分…",starting:"正在提交评分…",loadFailed:"加载评分失败",retryFailed:"提交评分失败",failed:"评分未完成,请管理员重试",retry:"重新评分",start:"开始评分",reload:"重新加载",download:"下载 JSON",expand:"展开",collapse:"收起",hint:"评分针对本次提交版本,供人工审批参考",dimensions:{safety:"安全性",usability:"易用性",completeness:"完整性",reliability:"可靠性",maintainability:"可维护性"},risks:"风险提示",suggestions:"改进建议",model:"评分模型",rubric:"评分标准版本",time:"评分时间",severity:{low:"低风险",medium:"中风险",high:"高风险",critical:"严重风险"},coverage:"评审范围",coverageCount:"已评审 {{included}} / {{total}} 个文件",coverageIncomplete:"部分内容未纳入评审,评分依据不完整",omittedFile:"未评审 {{path}}:{{reason}}",truncatedFile:"仅评审部分内容 {{path}}:{{reason}}",originalError:"云端原始错误"},Ddr=Object.freeze(Object.defineProperty({__proto__:null,actions:IWe,adminOnly:kWe,category:CWe,columns:MWe,decision:$We,default:{title:TWe,category:CWe,adminOnly:kWe,search:OWe,filterStatus:EWe,pendingCount:_We,total:RWe,kind:DWe,status:LWe,columns:MWe,actions:IWe,empty:PWe,detail:NWe,space:BWe,decision:$We,score:FWe},detail:NWe,empty:PWe,filterStatus:EWe,kind:DWe,pendingCount:_We,score:FWe,search:OWe,space:BWe,status:LWe,title:TWe,total:RWe},Symbol.toStringTag,{value:"Module"})),zWe={cancel:"取消",close:"关闭",retry:"重试",tryAgain:"重新尝试",closeDialog:"关闭{{title}}",agentFallback:"{{agent}} 智能体",unknownSource:"未知来源"},UWe={terminalTitle:"终端",browserTitle:"沙箱浏览器",terminalSubtitle:"连接当前 AgentKit Session 的交互式终端",browserSubtitle:"在当前 AgentKit Session 中查看与操作浏览器",connecting:"正在连接…",connected:"已连接",notConnected:"尚未连接",opening:"正在打开 {{title}}",connectingSession:"工具正在连接当前 AgentKit Session。",openFailed:"{{title}} 打开失败"},VWe={title:"恢复 Codex 对话",subtitle:"选择当前 Sandbox Session 中最近更新的 Thread",loading:"正在读取历史对话",loadFailed:"历史对话读取失败",empty:"暂无可恢复的对话"},GWe={title:"Codex 权限",subtitle:"设置会保存到当前 Sandbox Session,并同步到其中的所有 Thread",sandboxMode:"沙箱模式",approvalPolicy:"审批策略",approvalMethod:"审批方式",networkAccess:"允许网络访问",networkAccessHelp:"控制 workspace-write 与只读模式中的外部网络访问。",fullAccessWarning:"完全访问会关闭文件系统与网络隔离,请只在可信任务中使用。",save:"保存权限",sandboxChoices:{readOnly:{label:"只读",detail:"允许读取文件,不允许写入工作空间。"},workspaceWrite:{label:"工作区写入",detail:"允许在当前工作空间内读取与修改文件。"},fullAccess:{label:"完全访问",detail:"不启用沙箱隔离,适合明确可信的任务。"}},approvalChoices:{untrusted:{label:"仅不可信命令",detail:"只对 Codex 判断为不可信的操作发起审批。"},onRequest:{label:"按需审批",detail:"Codex 可在必要时请求你确认命令或文件修改。"},never:{label:"不审批",detail:"Codex 不会暂停并请求人工批准。"}},reviewerChoices:{user:{label:"由我审批",detail:"审批请求会显示在 Studio 中,由你决定。"},autoReview:{label:"自动审查",detail:"使用 Codex 自动审查流程处理审批请求。"}}},QWe={title:"工作空间",subtitle:"选择当前 Codex Thread 执行命令与修改文件的目录",absolutePath:"绝对路径",browse:"浏览",parent:"上一级",empty:"当前目录没有子目录",locked:"当前对话已经开始,工作空间已锁定。新建 Sandbox 会话后可重新选择。",useDirectory:"使用此目录"},HWe={fileTitle:"允许修改文件?",commandTitle:"允许执行命令?",subtitle:"Codex 正在等待你的决定",workingDirectory:"执行目录",decline:"拒绝",acceptOnce:"仅本次允许",acceptSession:"本会话允许"},WWe={availableSkills:"可用 Skills",selectModel:"选择模型",commands:"Codex 快捷命令",currentModel:"当前:{{model}}",loadingSkills:"正在发现当前工作区的 Skills…",loadingModels:"正在读取模型…",noSkillMatches:"当前工作区没有匹配的 Skill",noModelMatches:"没有匹配模型,也可以直接输入模型 ID",noCommandMatches:"没有匹配的快捷命令",skillFallback:"加载并执行该 Skill",add:"添加",uploadImage:"上传图片",uploadDocument:"上传文档或 PDF",uploadVideo:"上传视频",openTerminal:"进入终端",viewBrowser:"查看浏览器",permissions:"Codex 权限",workspaceLocked:"对话已开始,工作空间已锁定",selectWorkspace:"选择工作空间",workspace:"Codex 工作空间",endpointCopied:"Endpoint 已复制",copyEndpoint:"复制 Sandbox Endpoint",continuePlaceholder:"继续说明你想实现或调整的内容",messagePlaceholder:"向 AgentKit 沙箱发送消息,输入 / 查看命令,输入 $ 调用 Skill…",stop:"停止生成",send:"发送",stopping:"正在确认停止…",resume:"恢复任务",steer:"追加要求",steerPlaceholder:"可继续追加要求,或随时停止任务…"},YWe={defaultName:"我的智能体",namedDefault:"我的 {{agent}}",creatingTitle:"正在创建 {{agent}} 智能体",failedTitle:"启动失败",createTitle:"创建 {{agent}} 智能体",fallbackError:"AgentKit 沙箱初始化失败,请稍后重新尝试。",creatingDescription:"正在创建并等待 {{agent}} 智能体就绪,这通常需要半分钟",name:"智能体名称",storageSize:"存储大小",storageHelp:"数据将持久化保存,可设置 {{min}}–{{max}} GiB。",persistent:"持久化",persistenceUnsupported:"当前环境不支持快照持久化",persistentHelp:"保留智能体数据,后续可继续使用。",temporaryHelp:"智能体将在 8 小时后清空",cancelCreation:"取消创建",confirm:"确认创建",retry:"重新尝试"},qWe={activeAria:"Codex 智能体会话已开启",openAria:"开启 Codex 智能体会话",active:"Codex 智能体会话中",entry:"灵光一现",exit:"退出当前智能体",expired:"已到期",remainingHours:"剩余 {{hours}} 小时 {{minutes}} 分钟",remainingMinutes:"剩余 {{minutes}} 分钟",expiryWarning:"远端开发环境最长保留 8 小时,将于 {{expiry}} 到期({{remaining}});到期后清除对话和文件。",usingAgent:"当前您在使用 {{agent}} 智能体",activityAria:"Sandbox 操作记录",activity:"操作记录",tokenUsageAria:"Codex Token 用量",tokens:"{{label}}:{{value}} tokens",tokenLabels:{total:"总计",input:"输入",cachedInput:"缓存输入",output:"输出",reasoningOutput:"推理输出"}},jWe={back:"返回智能体列表",subtitle:"{{agent}} 智能体详情",type:"智能体类型",status:"状态",createdBy:"创建人",snapshotStatus:"快照状态",toolType:"工具类型",createdAt:"创建时间",snapshotReason:"快照原因",expiresAt:"过期时间",snapshotId:"快照 ID",sessionId:"会话 ID",sourceSessionId:"来源 Session ID",delete:"删除智能体",waking:"唤醒中…",opening:"打开中…",wake:"唤醒智能体",open:"打开智能体",deleteTitle:"删除智能体?",deleteDescription:"将删除“{{name}}”及其保存的数据,此操作无法撤销。",deleting:"删除中…",confirmDelete:"确认删除",sleepingHint:"该智能体已休眠,进入时需要唤醒,可能需要一些时间。",wakingHint:"正在唤醒智能体,可能需要一些时间。",agentId:"智能体 ID"},XWe={back:"返回智能体列表",createdBy:"创建人 {{creator}}",ariaLabel:"智能体工作区",main:"主界面",terminal:"终端",mainTitle:"{{agent}} 主界面",openingTerminal:"正在打开终端…",terminalTitle:"{{agent}} 终端"},KWe={prompt:`使用 AgentKit Studio Plugin 端云接力当前会话、项目和任务。请直接执行,不要让我手动打开终端。 Studio:{{studioUrl}} 配对码:{{pairingCode}}`,installPrompt:`请安装 AgentKit Studio Plugin。请直接执行以下安装命令,不要让我手动打开终端。 安装命令:{{command}}`,title:"接力到云端继续执行",description:"按顺序复制两段提示词,Codex 会通过插件将您的本地任务接力到云端",closeAria:"关闭本地迁移引导",installTitle:"安装插件",installDescription:"首次使用时,请选择一种安装方式。",copied:"已复制",copyInstallPrompt:"复制安装提示词",copyInstallCommand:"复制安装命令",installMethodAria:"插件安装方式",conversationInstall:"与 Codex 对话安装",terminalInstall:"从终端安装",taskTitle:"任务接力",taskDescription:"插件安装完成后复制,Codex 会迁移当前项目并继续执行任务。",copyHandoffPrompt:"复制接力提示词",generatingPairing:"正在生成新的配对码",pairingExpired:"配对码已过期",pairingRemaining:"配对码有效期剩余 {{countdown}}",refreshing:"刷新中",refreshPairing:"刷新配对码",pairingLoading:"正在生成配对码",pairingUnavailable:"配对码尚未生成。",statusAria:"端云接力状态",statusTitle:"接力状态",requestReceivedNamed:"已收到“{{name}}”的端云接力请求",requestReceivedCurrent:"已收到当前项目的端云接力请求",requestHelp:"复制接力提示词后,Codex 的请求会显示在这里。",entering:"正在进入",enterCodex:"进入 Codex",clipboardUnsupported:"当前浏览器不支持写入剪贴板。",steps:{request:"等待端侧请求",session:"创建云端 Session",restore:"恢复项目",continue:"发送续跑任务"},status:{issued:"等待请求",creating:"正在创建 Session",sessionCreated:"正在迁移项目",continuing:"正在启动云端任务",running:"云端执行中",completed:"接力完成",failed:"接力失败"}},ZWe={model:{description:"显示或切换当前对话模型",keywords:"模型 switch"},models:{description:"列出 app-server 可用模型",keywords:"模型列表 list"},skill:{description:"浏览并调用当前工作区可用的 Skill",keywords:"技能 workflow"},skills:{description:"浏览并调用当前工作区可用的 Skills",keywords:"技能列表 workflow list"},new:{description:"开始一个新对话",keywords:"新建 对话"},resume:{description:"打开历史会话或恢复指定 Thread",keywords:"历史 恢复 session"},fork:{description:"从当前上下文分叉一个新对话",keywords:"分叉 branch"},compact:{description:"压缩当前对话上下文",keywords:"压缩 上下文"},archive:{description:"归档当前对话并新建对话",keywords:"归档 关闭"},status:{description:"显示当前连接、Thread、模型与 Token 状态",keywords:"状态 连接 token"},clear:{description:"清空当前视图并开始新对话",keywords:"清空 重置"},help:{description:"显示 Sandbox 支持的快捷命令",keywords:"帮助 命令"},currentModel:"当前模型",availableModel:"可用模型",workspace:"工作空间",notSet:"未设置",modelLabel:"模型",statusLabel:"状态",running:"运行中",idle:"空闲",totalTokens:"累计 Token",contextWindow:"上下文窗口",imageFallback:"图片",unknown:"未知快捷命令:{{command}}。输入 /help 查看可用命令。",automaticSkills:"智能开发模式会自动使用开发能力,无需手动选择 Skill。",activity:{new:"已新建 Codex 对话",resumed:"已恢复 Codex 对话",deleted:"已删除 Codex 历史会话",modelChanged:"已切换 Codex 模型",availableModels:"Codex 可用模型",noModels:"当前没有可用模型",forked:"已分叉 Codex 对话",compacting:"已开始压缩当前 Codex 对话",archived:"已归档 Codex 对话",status:"Codex 当前状态",help:"Sandbox 支持的 Codex 快捷命令"}},JWe={label:"智能构建任务",queued:"构建任务已排队",running:"构建任务正在后台运行",recovering:"正在恢复构建任务",waiting_user:"构建任务需要继续处理",stopping:"正在停止构建任务",succeeded:"构建任务已完成",cancelled:"构建任务已停止",failed:"构建任务未完成",open:"返回任务",hide:"隐藏任务通知",reconnecting:"正在重新连接任务服务,已有任务继续保留。"},Ldr=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:jWe,agentWorkspace:XWe,approval:HWe,commands:ZWe,common:zWe,composer:WWe,default:{common:zWe,tool:UWe,threads:VWe,permissions:GWe,workspace:QWe,approval:HWe,composer:WWe,launch:YWe,session:qWe,agentDetails:jWe,agentWorkspace:XWe,handoff:KWe,commands:ZWe,taskNotice:JWe},handoff:KWe,launch:YWe,permissions:GWe,session:qWe,taskNotice:JWe,threads:VWe,tool:UWe,workspace:QWe},Symbol.toStringTag,{value:"Module"})),eYe={retry:"重试",signInToContinue:"登录以继续使用",signInWith:"使用 {{provider}} 登录",enterUsername:"输入一个用户名即可开始",usernamePlaceholder:"用户名(字母 + 数字,最多 16 位)",enter:"进入",usernameInvalid:"只能包含大小写字母和数字,最多 16 位。",identityProvider:{volcengine:"火山引擎 Identity",byteplus:"BytePlus Identity"},powered:{volcengine:"火山引擎 AgentKit 提供企业级 Agent 解决方案",byteplus:"BytePlus AgentKit 提供企业级 Agent 解决方案"},legalPrefix:"继续即表示你已阅读并同意 AgentKit",terms:"产品和服务条款",copyright:"© {{year}} VeADK。保留所有权利。"},tYe={title:"登录状态已过期",description:"当前编辑内容会保留。重新登录后,刚才的操作将自动继续。",waiting:"等待登录完成…",signInAgain:"重新登录"},rYe={breadcrumbs:"面包屑",selectAgent:"选择 Agent",switchAgent:"切换智能体"},nYe={cancel:"取消",close:"关闭确认框"},Mdr=Object.freeze(Object.defineProperty({__proto__:null,authExpired:tYe,confirm:nYe,default:{login:eYe,authExpired:tYe,navbar:rYe,confirm:nYe},login:eYe,navbar:rYe},Symbol.toStringTag,{value:"Module"})),iYe={defaultUser:"用户",shortcuts:"快捷入口",tryCli:"体验 AgentKit CLI",developerResources:"开发者资源",systemInfo:"系统信息",language:"语言",issueFeedback:"问题反馈",logout:"退出登录",roles:{admin:"管理员",developer:"开发者",user:"普通用户",super_admin:"超级管理员"}},aYe={home:"返回首页",expand:"展开侧边栏",collapse:"收起侧边栏",label:"主导航",newChat:"新会话",agents:"智能体",workspaces:"工作区",library:"资源库",cronjobs:"定时任务",automations:"自动化",users:"用户管理",administration:"管控",reviewCenter:"审核中心"},oYe={title:"历史会话",newConversation:"新会话",create:"新建会话",loading:"正在加载历史会话…",empty:"暂无会话",current:"当前",manage:"管理历史会话:{{title}}",more:"更多",delete:"删除",loadingMore:"加载中…",loadMore:"加载更多",evaluatingTitle:"正在自动评测",evaluating:"评测中",generating:"正在生成"},Idr=Object.freeze(Object.defineProperty({__proto__:null,account:iYe,default:{account:iYe,navigation:aYe,history:oYe},history:oYe,navigation:aYe},Symbol.toStringTag,{value:"Module"})),sYe={placeholder:"请选择",collapseOptions:"收起模型选项",expandOptions:"展开模型选项",noOptions:"暂无可用选项",noMatches:"没有匹配项,可直接使用当前模型 ID"},lYe={unsupportedActivity:"不支持的 Skill 对话活动",ariaLabel:"Skill 生成对话"},cYe={code:"错误码:{{code}}",type:"错误类型:{{type}}",representation:"异常表示:{{value}}",rawResponse:`服务端原始响应: -{{value}}`,original:"原始错误:{{message}}",details:"详细信息"},uYe={ariaLabel:"Skill 文件树",viewSource:"查看源码",viewPreview:"查看预览",download:"下载",binaryFile:"二进制文件",bytes:"{{value}} 字节",binaryDescription:"当前接口仅返回文件元数据,可单独下载原文件。",metadata:"Skill 元数据",noFiles:"暂无文件"},dYe={close:"关闭",name:"名称",region:"地域",optionalDescription:"描述(可选)",cancel:"取消",create:"创建",creating:"创建中…",save:"保存",saving:"保存中…",upload:"上传",uploading:"上传中…",createSpaceTitle:"新建 Skill 空间",editSpaceTitle:"编辑 Skill 空间",uploadTitle:"上传到 {{name}}",createSpaceFailed:"创建 Skill 空间失败",updateSpaceFailed:"更新 Skill 空间失败",archiveValidationFailed:"Skill ZIP 格式校验失败",uploadFailed:"上传 Skill 失败",dropzone:"拖拽 Skill ZIP 到这里",chooseLocalFile:"或点击选择本地文件",archiveHelp:"ZIP 根目录需要包含 SKILL.md,也可以只包含一层包装目录。选择后仅检查格式,不会自动上传。",validating:"正在检查文件格式…",validationPassed:"格式检查通过:{{name}},共 {{count}} 个文件"},hYe={styles:{concise:"简洁实用",strict:"严谨稳健",tutorial:"教程友好",automation:"自动化优先",custom:"自定义",customFallback:"自定义风格"},stages:{preparing:"正在准备 Dev Sandbox",ready:"Skill 已生成并通过格式校验",failed:"生成失败",cancelled:"已停止",validating:"正在校验 Skill 格式",packaging:"正在整理文件",generating:"正在生成 Skill",repairingAgain:"正在再次修复",autoRepairing:"正在自动修复({{attempt}}/{{max}})"},validation:{fallback:"Skill 格式校验未通过",repairInstruction:"只修复下面列出的 Skill 格式错误,不要改变原有用途和内容范围。",recheckInstruction:"修复后重新检查目录结构、SKILL.md frontmatter 和所有文本文件。",nameTooLong:"Skill 名称不能超过 64 个字符",invalidName:"Skill 名称只能包含小写字母、数字和连字符",modelTooLong:"模型 ID 不能超过 128 个字符",invalidModel:"模型 ID 只能包含字母、数字、点、下划线、连字符、斜杠和冒号"},errors:{loadCapability:"读取 Dev Sandbox 配置失败",autoRepair:"自动修复格式错误失败",pollCandidate:"读取候选方案状态失败,正在重试",createCandidate:"创建候选方案失败",refine:"继续调整失败",repairAgain:"再次修复格式错误失败",selectSpace:"请选择上传的 Skill Space",unsupportedRegion:"当前 Skill 地域不受支持",upload:"上传 Skill 失败",download:"下载失败"},sessionMax:"Session 最长保留 1 小时",remaining:"剩余 {{minutes}}:{{seconds}}",unnamedSpace:"未命名 Skill Space",leaveConfirmation:"离开后将停止并释放正在运行的 Dev Sandbox,确定离开吗?",createTitle:"创建技能",optimizeTitle:"优化 {{name}}",skillFallback:"技能",back:"返回技能空间",home:"主页技能生成",basicInfo:"基本信息",goal:"目标",createIntentPlaceholder:"描述希望这个 Skill 完成什么任务",optimizeIntentPlaceholder:"描述希望如何优化当前 Skill",skillName:"Skill 名称",autoNamePlaceholder:"留空时自动生成",nameHelp:"仅支持小写字母、数字和连字符;留空时自动生成。",createPlans:"生成方案",optimizePlans:"优化方案",createPlansDescription:"按不同方案并行生成多个技能,您可以选择最佳结果",optimizePlansDescription:"按不同方案并行优化当前技能,您可以选择最佳结果",plan:"方案 {{count}}",remove:"移除",model:"模型",modelPlaceholder:"选择或输入模型 ID",style:"风格",customStyle:"自定义风格",customStylePlaceholder:"描述表达方式、严谨程度或输出偏好",addConfiguration:"添加配置",notConfigured:"管理员未配置",generate:"生成",candidates:"候选方案",progress:"进度",retryCandidate:"重试此方案",formatValidationFailed:"格式校验未通过",repairAgain:"再次修复",files:"文件",downloadZip:"下载 ZIP",loadingFiles:"正在读取文件…",filesPending:"生成过程中会在这里显示完整文件树",uploadToSpace:"上传到 Skill Space",loadingSpaces:"正在加载 Skill Space",selectSpace:"选择 Skill Space",continuePlaceholder:"继续调整这个候选方案",continue:"继续调整",uploading:"上传中…",overwrite:"覆盖原 Skill",uploadToSelectedSpace:"上传到 Skill Space",uploadToCurrentSpace:"上传到当前空间",allCandidatesFailed:"所有方案均创建失败,可分别重试。"},fYe={invalidFormat:"{{label}}格式错误。",recoveryStatus:"Skill 恢复点状态",errorResponse:"错误响应",errorDetails:"错误详情",missingContentType:"Content-Type 缺失",gatewayError:"{{fallback}}(HTTP {{status}},Content-Type: {{contentType}})。请检查代理或网关配置。",nonJson:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}},Content-Type: {{contentType}}),请检查代理或网关配置。",activity:"Skill 会话活动",invalidActivity:"Skill 会话活动格式错误。",invalidToolActivity:"Skill 工具活动格式错误。",invalidTextActivity:"Skill 文本活动格式错误。",publication:"Skill 发布结果",task:"Skill 会话",file:"Skill 文件",unknownTaskState:"Skill 会话状态无法识别。",capability:"Skill 工作台能力",loadCapability:"读取 Skill 工作台能力失败",prepareTask:"准备 Skill 会话失败",taskReference:"Skill 会话引用",startOptimization:"开始优化 Skill 失败",startTask:"开始 Skill 会话失败",taskSummary:"Skill 会话摘要",taskList:"Skill 会话列表",loadTaskList:"读取 Skill 会话列表失败",invalidTaskList:"Skill 会话列表格式错误。",loadTask:"读取 Skill 会话失败",artifact:"Skill 产物",artifactFile:"Skill 产物文件",loadArtifact:"读取 Skill 产物失败",refine:"继续调整 Skill 失败",stop:"停止当前 Skill 任务失败",publish:"发布 Skill 失败",nonNdjson:"发布 Skill 失败:服务端返回了非 NDJSON 响应。",missingStream:"发布 Skill 失败:服务端没有返回进度流。",publishProgress:"发布进度",invalidPublishProgress:"发布进度格式错误。",publishError:"发布错误",unknownPublishEvent:"未知的发布进度事件。",publishResult:"发布结果",streamEnded:"发布进度流提前结束,无法确认发布结果。请刷新技能中心确认状态。",deleteTask:"删除 Skill 会话失败",download:"下载 Skill 失败"},Pdr=Object.freeze(Object.defineProperty({__proto__:null,api:fYe,configSelect:sYe,conversation:lYe,default:{configSelect:sYe,conversation:lYe,errorDetails:cYe,fileTree:uYe,management:dYe,generation:hYe,api:fYe},errorDetails:cYe,fileTree:uYe,generation:hYe,management:dYe},Symbol.toStringTag,{value:"Module"})),pYe={back:"返回上一页",reload:"重新加载",notConfigured:"未配置",name:"名称",description:"描述",delete:"删除",save:"保存",saving:"保存中",add:"添加",manage:"管理",environment:"环境",noDescription:"暂无描述",refresh:"刷新",close:"关闭",retry:"重试",loading:"加载中…",previousPage:"上一页",nextPage:"下一页",edit:"编辑",all:"全部",search:"搜索",cancel:"取消",view:"查看",viewDetails:"查看详情",deleting:"删除中…",create:"创建",creating:"创建中",adding:"添加中",generating:"生成中",uploading:"上传中",preview:"预览",loadFailed:"加载失败",select:"选择",collapse:"收起",expand:"展开",none:"无"},gYe={ariaLabel:"AgentKit 快速入口",closeAriaLabel:"关闭 AgentKit 欢迎卡片",title:"欢迎使用 AgentKit",description:"通过 AgentKit 平台快速构建与托管您的企业级智能体",docsAriaLabel:"打开 AgentKit 文档,在新窗口打开",docs:"文档",consoleAriaLabel:"打开 AgentKit 控制台,在新窗口打开",console:"控制台"},mYe={checkUpdates:"检查更新",checkingVersions:"正在检查版本…",versionCheckError:"查询沙箱版本失败,请检查凭据、区域及接口权限后重试",sandboxUpdateError:"Sandbox 更新失败,请刷新检查实际状态后重试",modelEnvRepairUnavailable:"无法补齐模型环境变量,请检查 CODEX_API_KEY 和 CODEX_BASE_URL",updateSandbox:"更新{{variant}}{{name}}",updatingSandbox:"更新中",title:"系统信息",description:"查看当前 Studio 版本及关联的基础资源",general:"通用",currentVersion:"当前版本",storage:"存储",loadingStorage:"正在加载存储信息",tosAddress:"TOS 地址",openTosConsole:"在云控制台中打开 TOS 存储桶",environmentBuild:"环境构建",loadingEnvironmentResources:"正在加载环境构建资源",environmentResourcesError:"环境构建资源加载失败,请检查云凭据后重试。",codePipelineWorkspace:"CodePipeline 工作空间",codePipelinePipeline:"CodePipeline 流水线",openCodePipelineWorkspace:"在云控制台中打开 CodePipeline Workspace",createdOnFirstBuild:"首次构建时自动创建",containerRegistryRepository:"Container Registry 仓库",openContainerRegistryRepository:"在云控制台中打开 Container Registry 仓库",sandboxInfo:"沙箱信息",loadingSandboxInfo:"正在加载沙箱信息",sandboxInfoError:"沙箱信息加载失败,请重试。",snapshot:"快照版",snapshotWithSpace:"快照版 ",openToolConsole:"在云控制台中打开{{name}}",updateModelEnv:"更新{{variant}}{{name}}模型环境变量",modelEnvUpdated:"已更新",modelEnvAlreadyCurrent:"无需更新",userPool:"用户池",loadingUserPool:"正在加载用户池",userPoolError:"用户池加载失败,请重试。",modelEnvUpdateError:"模型环境变量更新失败,请重试。",openUserPoolConsole:"在云控制台中打开用户池{{name}}",unnamedUserPool:"未命名用户池",id:"ID",domain:"域名",region:"区域",noLocalUserPool:"本地模式未配置用户池",noUserPool:"当前 Studio 未配置用户池"},vYe={workspace:"Agent 工作区",library:"Agent 库",evaluation:"评测",agentList:"Agent 列表",agentDetails:"Agent 详情",newAgent:"新建 Agent",loading:"加载中…",loadingCloudAgents:"正在加载云端 Agent…",noAgentSelected:"请选择一个 Agent",local:"本地",remote:"云端",localAgent:"本地 Agent",remoteAgent:"云端 Agent",agentCount:"{{count}} 个 Agent",agentCountLabel:"Agent 数量",details:"详情",chat:"对话",update:"更新",backToAgentList:"返回 Agent 列表",loadingAgent:"正在加载 Agent",loadingAgentDescription:"正在读取 Agent 配置和 Runtime 信息。",loadingAgentInfo:"正在加载 Agent 信息…",detailLoadFailed:"无法加载 Agent 详情",detailLoadFailedDescription:"请检查 Runtime 状态后重试。",partialInfoUnavailable:"部分信息暂时不可用",upgradeRuntimeForDetails:"请升级 Runtime 以查看完整 Agent 信息。",basicInfo:"基本信息",usageOverview:"使用概览",sections:{basic:"基本信息",profileConfig:"Profile 配置",sessionConfig:"会话配置",usage:"使用概览",diagnostics:"诊断",evaluations:"评测",optimizations:"优化建议",integrations:"集成",versions:"版本",channels:"消息渠道"},evaluationGroup:"评测组",optimizations:"优化建议",optimizationsDescription:"根据评测结果查看可执行的优化建议。",integrations:"集成",githubVersions:"GitHub 版本",githubVersionsDescription:"查看持续交付产生的版本并创建回退 PR。",currentVersionOnly:"当前未启用 GitHub 持续交付,仅展示当前生产版本。",loadingVersions:"正在加载版本…",noVersion:"暂无版本记录",prLink:"Pull Request",viewPr:"查看 PR",author:"提交人",publishStatus:"发布状态",viewRelease:"查看发布记录",rollbackToVersion:"回退到此版本",rollingBack:"正在创建回退…",rollbackEvent:"回退事件",sourceMergedRuntimeStill:"最新源码已合并,但 Runtime 仍处于",currentProductionVersionHint:";当前生产版本保持不变。",usageSummary:"使用统计",totalCalls:"总调用次数",userCount:"用户数",userDetails:"用户明细",usageUserList:"Agent 使用用户列表",user:"用户",callCount:"调用次数",lastUsed:"最近使用",unknownUser:"未知用户",loadingUsage:"正在加载使用数据…",refreshing:"刷新中…",noUsage:"暂无使用记录",usageUnavailable:"当前 Agent 暂无可用的使用统计。",usagePagination:"使用记录分页",pageOf:"第 {{page}} / {{total}} 页",notProvided:"暂未提供",integrationMethods:"集成方式",integrationDescription:"通过 Runtime API 或 A2A 协议集成当前 Agent。",integrationProtocol:"集成协议",runtimeStatus:"Runtime 状态",executionFlow:"执行流程",probingIntegration:"正在检测集成能力",probingIntegrationDescription:"正在读取可用端点和鉴权配置。",configurationStatus:"配置状态",discoveryEndpoint:"发现端点",invocationEndpoint:"调用端点",invocationUrl:"调用地址",authentication:"鉴权方式",networkAccess:"网络访问",notAvailable:"暂无",noAuthentication:"无需鉴权",noApiKeyRequired:"无需 API Key",usesOauthJwt:"使用 OAuth / JWT",showApiKey:"显示 API Key",hideApiKey:"隐藏 API Key",pythonExample:"Python 示例",deploymentConfig:"部署配置",deploymentConfigDescription:"确认实例和运行配置后更新 Runtime。",deploymentRegion:"部署区域",mpaControlPlane:"MPA 控制面",loadingMpaAgentView:"正在读取 MPA Runtime 绑定…",mpaRuntimeBound:"该 MPA Agent 已绑定唯一 Runtime,可继续管理。",mpaRuntimeMissing:"当前 Agent 没有可见的 MPA Runtime 绑定。",mpaRuntimeBindingAmbiguous:"多个 MPA Runtime 匹配当前 Agent,请先修复绑定后再修改。",mpaRuntimeOrphan:"Runtime 存在,但其中没有当前 MPA Profile。",mpaRuntimeLegacyAuthUnsupported:"该 Runtime 使用旧版 MPA 镜像,仍要求 X-Jwt-Token。请先更新到当前 AgentKit 兼容镜像,再管理 Profile 或 Session 配置。",profileConfig:"Profile 配置",profileConfigTitle:"Profile 配置",profileConfigDescription:"查看并应用 Agent 级 MPA Profile。Profile 是 Runtime 的长期默认配置,新会话默认继承它。",profileStatus:"Profile 状态",profileApplied:"已应用",profileNotApplied:"未应用",profileNotAppliedDescription:"当前 Runtime 可运行,但尚未保存为 Studio 可管理的 Profile。应用后会生成 Profile revision。",applyProfile:"应用 Profile",reapplyProfile:"重新应用 Profile",editProfile:"编辑 Profile",profileApplying:"应用中…",profileAppliedNotice:"Profile 已应用,当前 revision 为 {{revision}}。",profileApplyIncomplete:"Profile 应用未完成,请查看当前操作状态后重试。",profileApplyFailed:"Profile 应用失败。",profilePrompt:"系统提示词",profileResources:"资源配置",profileResourceSummary:"{{tools}} 个工具 · {{skills}} 个 Skill · {{mcp}} 个 MCP 服务",sessionConfigTitle:"会话配置",sessionConfigDescription:"查看和调整当前 MPA Session 的执行配置。变更只对下一轮对话生效。",loadingSessionConfig:"正在加载会话配置…",sessionConfigNoAgent:"请选择一个 MPA Agent 后再管理会话配置。",sessionConfigNonMpa:"会话配置仅适用于 MPA Agent。",sessionConfigNoSession:"请先打开这个 MPA Agent 的对话,再修改会话配置。",sessionConfigDifferentRuntime:"请先切回这个 MPA Agent 的当前对话,再修改会话配置。",sessionConfigSaved:"会话配置已更新,下一轮对话将使用新 revision。",sessionConfigStale:"该 Session 已被其他位置修改,已展示最新配置,请确认后再保存。",sessionConfigRevision:"配置 revision",sessionProfileRevision:"Session Profile revision",latestProfileRevision:"最新 Profile revision",sessionProfileUpgradeAvailable:"检测到新的 Profile revision:v{{current}} → v{{target}}。",upgradeSessionProfile:"升级 Session Profile",sessionProfileUpgrading:"升级中…",sessionProfileUpgraded:"Session Profile 已升级,下一轮对话将使用新 revision。",sessionProfileUpgradeFailed:"Session Profile 升级失败。",sessionModelOverride:"模型覆盖",modelId:"模型 ID",inheritProfileDefault:"继承 Profile 默认值",sessionMcpServers:"MCP 服务",mcpServerCount:"已选择 {{count}} 个",clearSessionMcp:"清空 MCP 服务",mpaDiagnosticsTitle:"Runtime 诊断",mpaDiagnosticsDescription:"查看最近的 Runtime Console 运行记录,以及 Agent、Profile、Turn、task 和 worker 关联。",loadingMpaDiagnostics:"正在加载 Runtime 诊断…",noMpaDiagnostics:"当前 Session 暂无 Runtime 诊断运行记录。",latestRun:"最近运行",traceCorrelation:"Trace 关联",traceCorrelationDescription:"Runtime Console 为本次 invocation 返回的稳定标识。",traceSteps:"Trace 步骤",traceStepsDescription:"当前 invocation 最近的有界 Runtime Console 步骤。",mpaInstanceId:"MPA 实例",turnId:"Turn ID",taskId:"Task ID",workerKind:"Worker 类型",workerSession:"Worker Session",workerTurn:"Worker Turn",workerProfile:"Worker Profile",workerProfileVersion:"Worker Profile 版本",step:"步骤",stepCount:"步骤数",duration:"耗时",noTraceSteps:"本次 invocation 暂无 trace 步骤。",executionConfigMode:{replace:"Session 覆盖",clear:"本 Session 已清空",inherit:"使用 Profile 默认值"},concurrency:"并发数",selectedOptimizations:"已选优化项",selectedOptimizationsDescription:"这些优化会应用到本次更新。",optimizationProfile:"优化方案",updatePending:"等待更新",updatingDeployment:"正在更新部署",restoringUpdateConfig:"正在恢复更新配置…",updateConfigUnavailable:"无法读取更新配置",legacyConfigMissing:"旧版本 Runtime 缺少可恢复的配置,请重新创建。",deploymentFailed:"部署失败",continueEditing:"继续编辑",loadingOptimizations:"正在加载优化建议…",noOptimizations:"暂无优化建议",fixPriority:"优先级",suggestedModule:"建议模块",suggestionAndReason:"建议与原因",priority:{high:"高",medium:"中",low:"低"},modules:{agentStructure:"Agent 结构",prompt:"提示词",tool:"工具",knowledge:"知识库",memory:"记忆",workflow:"工作流",other:"其他"},evaluationGroupList:"评测组列表",newEvaluationGroup:"新建评测组",newEvaluationGroupName:"新评测组 {{count}}",searchEvaluationGroups:"搜索评测组",noMatchingEvaluationGroups:"没有匹配的评测组",noEvaluationGroupSelected:"请选择一个评测组",groupStats:"{{agents}} 个 Agent · {{runs}} 次运行",evaluationGroupDetails:"评测组详情",evaluationGroupStats:"{{agents}} 个 Agent · {{caseSet}} · {{runs}} 次运行",startEvaluation:"开始评测",evaluationConfig:"评测配置",historyResults:"历史结果",participatingAgents:"参与 Agent",selectedCount:"已选择 {{count}} 个",evaluationResources:"评测资源",evaluationSet:"评测集",evaluator:"评估器",caseCount:"{{count}} 条案例",evaluationMetrics:"评测指标",selectedMetricCount:"已选择 {{count}} 项",historyDescription:"查看每次评测的分数和运行状态。",noHistory:"暂无评测历史",noHistoryDescription:"运行一次评测后,结果会显示在这里。",evaluationRun:"第 {{index}} 次评测",evaluationRunMeta:"{{time}} · {{agents}} 个 Agent",overallScore:"综合分",completed:"已完成",evaluationDefaults:{coreRegression:"核心能力回归",safetyCheck:"安全与幻觉检查",coreSet:"核心回归集",safetySet:"安全边界集",toolSet:"工具调用集",qualityEvaluator:"综合质量评估器",factualEvaluator:"事实一致性评估器",toolEvaluator:"工具调用评估器",responseQuality:"回答质量",factualAccuracy:"事实准确性",toolUse:"工具调用",responseEfficiency:"响应效率",todayTime:"今天 10:32",yesterdayTime:"昨天 16:08",julyTime:"7 月 25 日 14:20",justNow:"刚刚"},defaultCases:{agentName:"示例 Agent",goodSetName:"示例正向案例集",badSetName:"示例负向案例集",weeklyFeedback:{input:"总结本周客户反馈,并按优先级归类。",output:"覆盖主要问题,给出清晰的优先级与下一步动作。",tag:"总结",reason:"任务完整覆盖了用户目标,输出结构清晰,并给出了可执行的下一步动作。"},research:{input:"查询最新公开资料并附上来源。",output:"调用搜索工具,结论与引用一一对应。",tag:"工具调用"},uncertainConclusion:{input:"在信息不足时直接给出确定结论。",output:"应明确说明未知,并主动询问缺失信息。",tag:"幻觉",reason:"信息不足时仍给出了确定结论,缺少必要的澄清步骤与不确定性说明。"},repeatedTool:{input:"连续重复调用相同工具获取同一结果。",output:"复用已有结果,避免无意义的重复调用。",tag:"效率"}},goodCases:"正向案例",badCases:"负向案例",goodCase:"正向案例",badCase:"负向案例",reference:"参考答案",caseResultFilter:"案例结果筛选",feedbackSourceFilter:"反馈来源筛选",searchCases:"搜索案例",searchCasesPlaceholder:"搜索输入、输出或标签",selectCases:"选择案例",selectAll:"全选",selectAllVisible:"选择当前可见案例",selectedCaseCount:"已选择 {{count}} 条",deleteSelected:"删除所选",deleteSelectedTitle:"删除所选 Agent",deleteSelectionDescription:"确定删除所选的 {{count}} 个项目吗?此操作无法撤销。",deleteCasesConfirm:"删除所选案例",deleteOneCaseConfirm:"删除这个案例",deleteFeedbackCase:"删除反馈案例",noFeedbackCases:"暂无反馈案例",noMatchingCases:"没有匹配的案例",loadingEvaluationSet:"正在加载评测集…",userInput:"用户输入",agentOutput:"Agent 输出",score:"得分",scoreReason:"评分原因",noUserInput:"暂无用户输入",noVisibleResponse:"暂无可见回复",note:"备注:",manualFeedback:"人工反馈",automaticFeedback:"自动反馈",scoreValue:"{{score}} 分",unknownTime:"时间未知",deleteAgentTitle:"删除 Agent",deleteAgentDescription:"确定删除 Agent“{{name}}”吗?",deleteDraftDescription:"确定删除草稿“{{name}}”吗?",deleteAgent:"删除 Agent",closeDeleteConfirmation:"关闭删除确认",mpaDeletePreviewSummary:"Studio 会先删除可见的空闲 MPA Runtime 会话,再删除 AgentKit Runtime。运行中的任务需要先结束或停止后才能删除。",mpaDeletePreviewSessions:"会话",mpaDeletePreviewActiveSessions:"运行中",mpaDeletePreviewIdleSessions:"空闲",mpaDeleteBlocked:"当前无法删除",mpaDeleteBlockerActiveOperation:"仍有 MPA 创建或更新操作在执行。",mpaDeleteBlockerActiveSessions:"Runtime 中仍有运行中的会话。",mpaDeleteBlockerBindingAmbiguous:"当前 Agent 匹配到多个 MPA Runtime。",mpaDeleteBlockerRuntimeMissing:"当前 MPA Agent 没有可见的 Runtime 绑定。",mpaDeleteBlockerOrphanRuntime:"Runtime 可见,但其中缺少当前 MPA Profile。",mpaDeleteStage:{runtime_sessions:"删除 {{count}} 个可见空闲 Runtime 会话",runtime_diagnostics:"清理这些会话关联的诊断数据和挂载元信息",agentkit_runtime:"删除 AgentKit Runtime"},draftDeletionWarning:"草稿将从当前浏览器中删除。",runtimeDeletionWarning:"Runtime 和相关云端资源将被删除。",noneSelected:"尚未选择",none:"无",notPublished:"未发布",notRecorded:"未记录",noTime:"暂无时间",noPr:"暂无 PR",comingSoon:"评测能力即将开放",preparing:"准备中",cancelled:"已取消",failed:"失败",totalCount:"共 {{count}} 条",deploymentProgress:"部署进度",returnToEdit:"返回编辑",retryOperation:"重试操作",buildLog:"构建日志",githubMountLog:"GitHub 挂载日志",githubDeliveryMountLog:"GitHub 持续交付挂载日志",waitingBuildLog:"正在等待构建日志…",waitingGithubMountLog:"正在等待 GitHub 挂载日志…",copy:"复制",copied:"已复制",copyLabel:"复制{{label}}",copiedLabel:"已复制{{label}}",logLines:"{{count}} 行",logStatus:{synced:"已同步",failed:"读取失败",syncing:"同步中",earlyOmitted:"已省略早期日志",recentOnly:"仅显示最近的构建日志",partiallyOmitted:"已省略部分日志"},deployStatus:{running:"正在部署",unconfirmed:"部署状态待确认",success:"部署完成",error:"部署失败",cancelled:"部署已取消"},deploymentSteps:{prepare:{label:"准备部署",description:"校验配置并创建部署任务"},build:{label:"构建镜像",description:"生成运行环境与智能体代码"},deploy:{label:"部署服务",description:"创建并启动 AgentKit Runtime"},publish:{label:"发布服务",description:"等待服务就绪并生成访问地址"},complete:{label:"部署完成",description:"智能体已可以正常使用"},evaluation:{label:"创建评测集",description:"自动创建 Good Case 和 Bad Case 评测集"},profileApplying:{label:"应用 MPA 配置",description:"将 Studio Agent 配置写入 MPA Runtime"},smokeRunning:{label:"验证 MPA Runtime",description:"在标记可运行前执行 Runtime 就绪验证"},runnable:{label:"MPA Runtime 可运行",description:"Runtime 已接受配置并通过执行就绪验证"},github:{label:"挂载 GitHub 持续交付",description:"初始化目标分支与 GitHub Actions workflow"},update:{label:"更新实例配置",description:"将 Runtime 实例数调整为 {{min}}~{{max}}"}},githubStatus:{published:"已发布",publishing:"发布中",failed:"发布失败",pending:"等待发布",unknown:"未知"},errors:{agentInfoMissing:"Agent 信息不可用",checkUpdateCapability:"无法检查更新能力",checkingUpdateConfig:"正在检查更新配置",cloudOnlyUpdate:"仅云端 Agent 支持更新",deleteDeployedUnsupported:"当前不支持删除已部署 Agent",deleteDraftUnsupported:"当前不支持删除草稿",loadMpaDeletePreview:"无法加载 MPA 删除预览",loadAgentInfo:"无法加载 Agent 信息",loadApiKey:"无法读取 API Key",loadGithubVersions:"无法加载 GitHub 版本",loadEvaluations:"无法加载评测案例",loadMpaAgentView:"无法加载 MPA Agent 状态",loadMpaDiagnostics:"无法加载 Runtime 诊断",loadOptimizations:"无法加载优化建议",loadRuntimeDetails:"无法加载 Runtime 详情",loadSessionConfig:"无法加载会话配置",loadUsage:"无法加载使用数据",noCreatePermission:"当前账号没有创建 Agent 的权限",noManagePermission:"当前账号没有管理此 Agent 的权限",originalConfigUnavailable:"原始配置不可用",probeIntegration:"无法检测集成能力",rollbackVersion:"无法创建版本回退",runtimeRegionMissing:"Runtime 区域信息缺失",updateCapabilityMismatch:"Runtime 更新能力与当前配置不匹配",updateCapabilityPending:"Runtime 更新能力仍在确认中",updateConfigRestoring:"正在恢复更新配置",updateUnsupported:"当前 Runtime 不支持更新",usageMismatch:"返回的使用数据与当前 Agent 不匹配"}},yYe={title:"环境",loadFailed:"环境加载失败,请检查存储配置后重试。",storageUnavailable:"管理员未配置持久化存储,环境管理暂不可用。",create:"新建环境",configure:"配置环境",details:"环境详情",editorDescription:"配置运行环境,或接入代码仓库和已有镜像",backToList:"返回环境列表",save:"保存环境",createAndBuild:"创建并构建",saveAndBuild:"保存并构建",name:"环境名称",namePlaceholder:"Python 数据处理",descriptionPlaceholder:"说明这个环境适合处理的任务",creationMethod:"创建方式",baseConfiguration:"基础配置",baseEnvironment:"基础环境",operatingSystem:"操作系统",pythonVersion:"Python 版本",fixedByBase:"由 {{base}} 固定为 {{value}}",selectUbuntuVersion:"选择基础镜像的 Ubuntu 版本",selectPythonVersion:"选择需要安装的 Python 版本",skills:"技能",addSkill:"添加环境技能",veadkDescription:"Agent 开发与运行框架",customDockerfile:"自定义 Dockerfile",presetEnvironment:"预制环境",presetHint:"选择“无”可自行填写 Dockerfile 第一行的基础镜像。",dockerfileSize:"{{size}} / {{max}} 字节",upload:"上传",reset:"重置",dockerfileBaseImage:"Dockerfile 基础镜像",dockerfileContent:"Dockerfile 内容",region:"区域",search:"搜索环境",manualImport:"手动导入",noMatches:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称",startBuild:"开始构建",build:"构建",unnamed:"未命名环境",listSeparator:"、",clipboardReadError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。",creation:{custom:{label:"自定义配置",description:"通过表单选择基础环境、Python、工具和技能"},dockerfile:{label:"自定义 Dockerfile",description:"上传或直接编辑 Dockerfile"},git:{label:"从代码仓库构建",description:"探查公开仓库并通过 CodePipeline 构建"},image:{label:"使用已有镜像",description:"绑定由外部流水线交付的 CR 镜像"}},baseDescriptions:{"aio-sandbox":"内置 Sandbox Shell 能力 · Ubuntu 22.04","codex-sandbox":"内置 Codex CLI、浏览器与代码执行环境",ubuntu:"标准 Linux 基础镜像"},dockerfileValidation:{baseImageRequired:"请填写基础镜像。",duplicateFrom:"基础镜像已固定在第一行,请删除 Dockerfile 正文中的 FROM 指令。",tooLarge:"Dockerfile 不能超过 128 KiB。",empty:"Dockerfile 内容不能为空。",missingFrom:"Dockerfile 缺少 FROM 指令。"},presets:{none:"自行填写 Dockerfile 基础镜像",aio:"内置 Sandbox Shell 与常用运行时",codex:"内置 Codex CLI、浏览器与代码执行环境"},categories:{tools:"工具",productivity:"效率",browser:"浏览器自动化",system:"系统与媒体"},options:{"lark-cli":"飞书开放平台命令行工具",pandoc:"文档格式转换工具",opencli:"将网站与桌面应用转换为命令行工具",uv:"快速 Python 包与项目管理器",ripgrep:"高性能文本检索工具",jq:"JSON 查询与转换工具","github-cli":"在终端中管理 GitHub 工作流",playwright:"浏览器自动化与端到端测试",chromium:"无头浏览器运行时",git:"代码版本管理",curl:"网络请求与文件下载",ffmpeg:"音视频转码与处理",imagemagick:"图片转换与批处理"},duration:{seconds:"{{count}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",hoursMinutes:"{{hours}} 小时 {{minutes}} 分"},buildStatus:{preparing:"准备中",queued:"排队中",building:"构建中",scanning:"扫描中",available:"可用",failed:"构建失败",notBuilt:"未构建"},manifest:{title:"环境 Manifest",closeLabel:"关闭环境 Manifest",loading:"正在加载 Manifest",editorLabel:"环境 Manifest YAML",copyFailed:"复制失败,请重试",copied:"已复制",copy:"复制 Manifest",view:"查看环境 Manifest",viewShort:"查看 Manifest",unavailable:"尚无可用 Manifest"},buildDetails:{title:"构建详情",closeLabel:"关闭构建详情",currentStep:"当前步骤",waiting:"等待构建信息",elapsed:"已用时",sourceCommit:"源码提交",openCodePipeline:"在 CodePipeline 中查看",starting:"正在启动",rebuild:"重新构建"},git:{sectionLabel:"公开代码仓库",address:"Git 地址",ref:"Branch、Tag 或 Commit",defaultBranch:"默认分支",inspecting:"正在拉取仓库并查找 Dockerfile",foundDockerfiles:"已在提交 {{commit}} 中找到 {{count}} 个 Dockerfile。",savedDockerfileLoaded:"已载入保存的 Dockerfile,可重新探查仓库更新。",noDockerfile:"仓库中未找到 Dockerfile,请检查分支或仓库内容。",inspectAgain:"重新探查",selectDockerfile:"选择 Dockerfile"},repository:{outputSection:"构建输出",type:"镜像仓库类型",managed:"Studio 默认镜像仓库",existing:"已有镜像仓库",managedHint:"构建时自动创建或复用当前区域的 Studio 镜像仓库。"},existingImage:{sectionLabel:"已有镜像",reference:"Tag 或 Digest",placeholder:"latest 或 sha256:...",hint:"填写镜像 Tag,或以 sha256: 开头的完整 Digest。"},share:{action:"分享",title:"分享环境",closeLabel:"关闭分享环境",generating:"正在生成并复制分享码",copied:"分享码已复制",failed:"分享失败",code:"分享码",fullCode:"完整环境分享码",copiedHint:"分享码已自动复制,也可在这里查看或手动复制。",copyFailedHint:"自动复制失败,可手动复制上方分享码,或重试。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅发送给可信对象。",copyAgain:"再次复制"},import:{title:"导入环境",closeLabel:"关闭导入环境",description:"先检测分享码中的环境,再确认添加到当前账号。",code:"环境分享码",tooMany:"最多可一次导入 {{max}} 个环境,当前检测到 {{count}} 个分享码。",multipleHint:"多个分享码可使用英文逗号、中文逗号或换行分隔,重复项会自动忽略。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅导入可信来源的分享码。",inspectingCodes:"正在检测环境分享码",found:"检测到 {{count}} 个环境:{{names}}。",itemError:"第 {{index}} 个分享码:{{error}}",invalidCode:"分享码无效。",noResult:"服务未返回该分享码的导入结果。",partial:"已导入 {{created}} 个环境,{{remaining}} 个未完成,可重试有效失败项。",inspecting:"正在检测",importing:"正在导入",retryImport:"重试导入",confirm:"确认导入",inspectCodes:"检测分享码"},status:{boundImage:"环境“{{name}}”已绑定已有镜像",queued:"环境“{{name}}”已进入构建队列",savedBuildFailed:"环境已保存,但构建未启动:{{error}}",importedFailed:"已导入 {{created}} 个环境,{{failed}} 个失败",importedDuplicate:"已导入 {{created}} 个环境,{{duplicate}} 个分享码已存在",imported:"已导入 {{count}} 个环境",deleted:"已删除环境“{{name}}”"},deleteTitle:"删除环境",deleteDescription:"确定删除环境“{{name}}”吗?删除后无法恢复。",errors:{repositoryRequired:"请输入公开代码仓库地址。",repositoryHttps:"请输入公开仓库的 HTTPS 地址。",repositoryInvalid:"请输入有效的公开仓库 HTTPS 地址。",imageReferenceWhitespace:"Tag 或 Digest 不能包含空格。",imageDigestInvalid:"Digest 必须是完整的 sha256 值。",imageTagOnly:"这里只填写 Tag,不要重复填写镜像仓库路径。"}},bYe={searchPlaceholder:"搜索资源名称",emptyMessage:"暂无可用选项",searchAriaLabel:"搜索{{label}}",loadingMore:"正在加载更多资源…"},xYe={retryDeployment:"重试部署",retrying:"正在重试…",collapse:"收起错误信息",expand:"展开完整错误信息",copy:"复制完整错误信息"},wYe={steps:"构建步骤",log:"构建日志",syncing:"同步中",loadFailed:"读取失败",synced:"已同步",recentOnly:" · 仅显示最近日志",copiedLog:"已复制构建日志",copyLog:"复制构建日志",copied:"已复制",copy:"复制",logContent:"构建日志内容",waiting:"正在等待 CodePipeline 输出日志…",empty:"暂无构建日志"},AYe={defaultLabel:"Studio 默认环境",defaultDescription:"使用 Studio 预置的标准运行环境",status:{notBuilt:"未构建",preparing:"准备中",queued:"排队中",building:"构建中",scanning:"扫描中",available:"可用",failed:"失败"},label:"运行环境",placeholder:"请选择运行环境",search:"搜索运行环境",loading:"正在加载运行环境…",loadFailed:"加载运行环境失败",noMatches:"未找到匹配的运行环境",unavailable:"当前没有可用的运行环境",selectionUnavailable:"所选运行环境当前不可用,请重新选择。",selectionHint:"选择构建完成的运行环境后,部署将使用其镜像和工具配置。",versionChanged:"所选环境版本已更新,请确认后继续。",versionMissing:"所选环境版本已不存在,请重新选择。",operatingSystem:"操作系统",language:"语言",image:"镜像",imageVersion:"镜像版本",skills:"技能",tools:"工具",noSkills:"未配置 Skill",noExtraTools:"未配置额外工具",defaultGuidance:"默认环境由 Studio 管理,无需额外配置。",persistenceFallback:"持久化环境服务暂不可用,当前使用默认环境。",emptyFallback:"当前没有可选择的自定义环境。"},SYe={repository:"GitHub 仓库",githubUrl:"GitHub 地址",token:"访问令牌",sessionToken:"{{provider}} 临时令牌",runtime:"Runtime",commit:"提交",workflow:"工作流",syncFailed:"同步 GitHub 代码失败",status:{mounted:"已挂载",bound:"已绑定",synced:"已同步",created:"已创建"},volcengine:"火山引擎",mountDelivery:"挂载持续交付",selectedForDeployment:"已选择,部署时挂载",mountOnDeploy:"部署时挂载持续交付",syncCode:"同步代码",deliveryMode:"GitHub 交付模式",sourceSync:"GitHub 代码同步",delivery:"GitHub 交付",loading:"读取中",running:"执行中",runtimeDeliveryHint:"写入 AgentKit Runtime GitHub Actions workflow,后续 GitHub 提交会更新绑定 Runtime。",initialDeliveryHint:"首次部署成功后初始化目标分支,后续 GitHub 提交会更新绑定 Runtime。",sourceSyncHint:"Studio 会直接 push 到目标分支;该分支由 Studio 管理,远端冲突时同步会失败。Runtime 仍由部署按钮发布。",tokenPlaceholder:"repo 或 contents write 权限",getToken:"获取 Token",hideToken:"隐藏 Token",showToken:"显示 Token",tokenHelp:"Token 仅用于本次操作,成功后不会保留在表单中。",targetBranch:"目标分支",actionsSecretPlaceholder:"用于写入 GitHub Actions Secret",sessionTokenPlaceholder:"临时凭证可选",syncing:"同步中…",pendingHint:"已选择挂载持续交付。点击部署后,Studio 会等待 Runtime 创建完成并初始化 GitHub 目标分支,初始化成功后才完成部署流程。",result:{deliveryMounted:"已挂载持续交付",deliverySelected:"已选择挂载持续交付",githubBound:"已绑定 GitHub",codeSynced:"代码已同步",deliveryHint:"目标分支提交会触发 Runtime 持续交付。",boundHint:"更新并发布时会先同步当前源码到这个分支。"},branch:"分支",viewPr:"查看 PR",createFailed:"创建失败",phase:"阶段",log:"日志"},TYe={name:"飞书",enabling:"正在启用并更新配置…",description:"接收消息并通过飞书机器人回复",configuration:"飞书配置",configurationMode:"飞书配置方式",automatic:"自动配置",manual:"手动配置",cancelling:"取消中…",scanToCreate:"扫码创建",scanDescription:"授权后自动回填凭据",generateQrCode:"生成二维码",qrCodeAlt:"飞书机器人配置二维码",scanToConfirm:"飞书扫码确认",expiresIn:"{{time}} 后失效",created:"机器人已创建",credentialsFilled:"应用凭据已自动回填",qrCodeExpired:"二维码已失效",automaticFailed:"自动配置失败",regenerateQrCode:"请重新生成二维码。",configuredPlaceholder:"已配置,留空沿用",appSecretPlaceholder:"请输入 App Secret",hideSecret:"隐藏 App Secret",showSecret:"显示 App Secret"},CYe={mode:{auto:"自动创建",autoDescription:"部署时自动创建所需资源",recommended:"推荐",create:"指定名称",createDescription:"使用指定名称创建或复用资源",existing:"选择已有",existingDescription:"从当前账号的已有资源中选择"},selectExisting:"请选择已有资源",searchResource:"搜索资源名称",noMatch:"未找到匹配资源",noAvailable:"暂无可用资源",searching:"正在搜索云资源…",loading:"正在加载云资源…",noMatchSentence:"未找到匹配资源。",noAvailableSentence:"暂无可用资源。",loadedSummary:"实际服务区域:{{region}} · 已加载 {{loaded}}{{total}}",registryInstance:"Registry 实例",registryAriaLabel:"镜像仓库 Registry 实例",namespace:"命名空间",namespaceAriaLabel:"镜像仓库 Namespace",repository:"镜像仓库",existingRepository:"已有镜像仓库",selectRegistryFirst:"请先选择 Registry 实例。",selectNamespaceFirst:"请先选择 Namespace。",configurationMode:"配置方式",configurationModeAriaLabel:"{{resource}}配置方式",selectConfigurationMode:"请选择配置方式",automaticNames:"自动创建名称",validation:{tos:"请填写或选择 TOS 存储桶。",cr:"请完整填写或选择 CR 实例、命名空间和镜像仓库。",codePipeline:"请完整填写或选择 CodePipeline Workspace 和 Pipeline。",existingCodePipeline:"请选择已有的 CodePipeline Workspace 和兼容 Pipeline。"},autoBucketWithRegion:"agentkit-platform-{账号 ID}-{{region}}",autoBucket:"agentkit-platform-{账号 ID}",tosBucket:"TOS 存储桶",bucketName:"存储桶名称",bucketNamePlaceholder:"输入存储桶名称",existingBucket:"已有存储桶",existingTosBucket:"已有 TOS 存储桶",bucket:"存储桶",accountIdResolved:"账号 ID 在部署时按当前云账号解析。",containerRegistry:"容器镜像仓库(CR)",instanceName:"实例名称",crInstance:"CR 实例",existingCrInstance:"已有 CR 实例",existingCrNamespace:"已有 CR 命名空间",existingCrRepository:"已有 CR 镜像仓库",autoRegistry:"agentkit-platform-{账号 ID}",autoRepositoryName:"{{name}}-{4 位随机字符}",registryNameNote:"账号 ID 在部署时解析,镜像仓库的随机字符在部署时生成。",workspace:"工作空间",pipeline:"流水线",workspaceName:"Workspace 名称",pipelineName:"Pipeline 名称",existingWorkspace:"已有 CodePipeline Workspace",compatiblePipeline:"兼容 Pipeline",existingPipeline:"已有 AgentKit CodePipeline",pipelineNameNote:"Pipeline 与 Runtime 名称一致。"},kYe={commit:"提交",steps:{permissions:"预检 OTA 所需权限",resolving:"读取目标版本信息",downloading:"下载并校验完整更新包",preparing:"准备 VeFaaS Function 代码",provisioning:"检查并补齐 Studio 云资源",scheduler:"更新定时任务调度服务",submitting:"提交 Function 更新",publishing:"发布新 Revision 并重启服务"},stages:{permissions:"预检 OTA 权限",resolving:"读取版本信息",downloading:"下载更新包",preparing:"准备 Function 代码",provisioning:"补齐 Studio 云资源",scheduler:"更新定时任务调度服务",submitting:"提交 Function 更新",publishing:"发布 Revision",checking:"检查更新",unknown:"未知阶段"},duration:{seconds:"{{count}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},logPermissionPrefix:"无法读取 VeFaaS 发布日志。Function 角色缺少 ",logPermissionSuffix:" 权限,更新会继续。",openIamConsole:"前往 IAM 控制台配置权限",deploymentProgress:"部署进度",live:"实时",completed:"已完成",stopped:"已停止",copied:"已复制",copyFailed:"复制失败",copyLog:"复制日志",waitingForLogs:"等待 VeFaaS 返回更新日志…",noLogs:"本次更新未返回发布日志",messages:{updated:"Studio 已更新,新 Revision 已接管服务",failed:"Studio 更新失败",timeout:"等待 VeFaaS 发布超时,请稍后重新检查版本",submitted:"更新已提交,正在等待 VeFaaS 发布新版本",connectionSwitched:"连接已切换,正在确认新版本状态"},checkingPermissions:"正在检查 OTA 权限",authorizationRequired:"需要 IAM 授权",updating:"正在更新 Studio",updated:"Studio 已更新",updateToVersion:"更新 Studio 至 {{version}}",checkPermissions:"检查更新权限",authorizationNeeded:"需要授权",updatingShort:"正在更新",refreshForNewVersion:"刷新使用新版",updateFailed:"更新失败",updateNow:"立即更新",newVersionAvailable:"有新版更新",dialog:{failed:"Studio 更新失败",checkingPermissions:"正在检查更新权限",authorizationRequired:"需要 IAM 授权",updating:"正在更新 Studio",completed:"Studio 更新完成",newVersion:"发现新版本"},permissionCheck:"正在核对 OTA 与定时任务所需的全部 IAM 权限…",permissionCheckHint:"权限全部满足后才会开始下载、更新或发布云资源。",missingPermissionCount:"当前 Function 角色缺少 {{count}} 项 OTA 更新权限,尚未执行任何云资源变更。",functionRole:"Function 角色",currentRole:"当前运行角色",policyToUpdate:"将更新策略",authorizationSteps:{open:"打开授权页面,确认已预填的策略名称和完整策略内容。",debug:"点击页面中的“发起调试”,完成策略更新。",return:"返回此窗口,点击“我已授权,重新检查”。"},missingPermissions:"缺少的权限",openPrefilledAuthorization:"打开已预填的 IAM 授权页面",openIamManually:"前往 IAM 控制台手动配置",noSafePolicy:"当前角色没有唯一可安全更新的自定义策略,请由管理员将上述权限加入该角色。",failedStage:"失败阶段",errorId:"错误 ID",notGenerated:"未生成",openFunctionLogs:"前往 VeFaaS 控制台查看 Function 日志",targetVersion:"目标版本",updateStatus:"更新状态",elapsed:"已用时",progressAriaLabel:"Studio 更新进度",processingUpdate:"正在处理更新",processing:"正在处理",backgroundHint:"发布阶段会短暂中断连接;关闭此窗口不会停止更新,可随时点击右上角按钮重新查看。",confirmDescription:"更新会重启 Studio 服务,预计约 3–5 分钟完成更新与发布。期间正在进行的对话、流式响应或部署任务可能中断,登录态不会受到影响。",selectVersion:"选择版本",currentVersion:"当前版本",changelog:"更新内容",noChangelog:"暂无更新说明",runInBackground:"后台运行",authorizedRecheck:"我已授权,重新检查",tryAgain:"重新尝试"},OYe={deploy:"部署",update:"更新",planHash:"方案哈希",backToConfiguration:"返回配置",releaseRegion:"发布区域",deployRegion:"部署区域",regionPreserved:"更新时沿用现有 Runtime 的部署区域,无法修改。",unnamedAgent:"未命名 Agent",deployTitle:"部署 {{name}}",additionalAgentCount:" 等 {{count}} 个智能体",releaseOverview:"发布概览",agentOverview:"Agent 概览",agentCount:"Agent 数量",model:"模型",systemPrompt:"系统提示词",optimizations:"优化选项",notEnabled:"未启用",effectiveCapabilities:"生效能力",automaticProtection:"自动保护",artifactActions:"发布产物操作",exportYaml:"导出 YAML",viewSource:"查看源代码",downloadSource:"下载源代码",expandFlow:"放大查看执行流程",expand:"放大查看",deploymentConfiguration:"部署配置",runtimeName:"Runtime 名称",runtimeNamePreserved:"更新时保持现有 Runtime 名称不变。",runtimeNameHint:"默认根据 Root Agent 名称生成,并添加随机后缀避免重名;支持 4-64 位字母、数字、连字符和下划线",accessAuthentication:"访问鉴权",authenticationPreserved:"更新时保持现有 Runtime 的鉴权方式不变。",authenticationMethod:"鉴权方式",authenticationAriaLabel:"部署鉴权方式",authenticationPlaceholder:"请选择鉴权方式",messageChannels:"消息渠道",instanceSettings:"实例设置",minInstances:"最小实例数",maxInstances:"最大实例数",sidecarSingleInstance:"Harness Sidecar 首期仅支持单实例,Runtime 固定为 1~1",inMemorySingleInstance:"为避免多实例间会话丢失,推荐将 Runtime 固定为 1~1",network:"网络",networkPreserved:"现有 Runtime 的区域与网络模式保持不变。",networkMode:"网络模式",networkModes:{public:"公网",both:"公网 + VPC"},subnetId:"子网 ID",subnetHint:"可选,多个用逗号分隔",sharedInternetAccess:"VPC 内共享公网出口",evaluationSets:"评测集",createEvaluationSets:"自动创建评测集",createEvaluationSetsHint:"部署成功后,自动创建 Good Case 和 Bad Case 评测集。",resourceConfiguration:"资源配置",environmentVariables:"环境变量",environmentVariablesHint:"组件配置会自动同步到这里,部署前可核对最终值。",itemCount:"{{count}} 项",addVariable:"添加变量",componentGenerated:"组件自动生成",injectedByApiKey:"由所选 API Key 注入",envNameAriaLabel:"{{key}} 环境变量名",envDescriptionAriaLabel:"{{key}}说明:{{description}}",openOpenViking:"打开 OpenViking {{label}}",openOpenVikingAriaLabel:"{{key}}:打开 OpenViking {{label}}",requiredEmpty:"必填,尚未填写",optionalEmpty:"可选,尚未填写",envValueAriaLabel:"{{key}} 环境变量值",automatic:"自动",synced:"同步",customModelCredentials:"自定义模型凭据",releaseOnlySecret:"必填,仅用于本次发布",thisRelease:"本次发布",customVariables:"自定义变量",value:"值",deleteVariable:"删除变量",deploymentProgress:"部署进度",retryUpdate:"重试更新",retryDeploy:"重试部署",updateSucceeded:"更新成功",deploySucceeded:"部署成功",region:"区域",agentName:"Agent 名称",apiEndpoint:"API 端点",connecting:"连接中…",chatNow:"立即对话",console:"控制台",actionInProgress:"{{action}}中…",checkingName:"正在检查名称…",retryAction:"重试{{action}}",flowPreview:"执行流程预览",executionFlow:"执行流程",flowPreviewHint:"只读预览,可缩放与拖动画布",closeFlowPreview:"关闭执行流程预览",agentAdded:'Agent "{{name}}" 已添加到左上角下拉列表!',files:{preview:"文件预览",new:"新建文件",empty:"暂无文件",noneSelected:"未选择文件",selectToView:"选择左侧文件以查看内容",loadingEditor:"加载编辑器…",rename:"重命名",renamePrompt:"重命名文件"},apiKey:{selectFirst:"请先选择 API Key",revealing:"正在显示 API Key",hide:"隐藏 API Key",retryReveal:"重试显示 API Key",reveal:"显示 API Key"},task:{preparing:"准备部署",waitingBuildLog:"正在等待构建日志…",waitingGithubLog:"正在等待 GitHub 挂载日志…",syncingGithub:"正在同步当前源码到 GitHub",syncGithubCode:"同步 GitHub 代码",githubSynced:"GitHub 代码已同步",githubSubmitted:"GitHub 代码已提交",githubUpdatingRuntime:"代码已提交到 GitHub,GitHub Actions 正在更新同一个 Runtime",initializingGithub:"开始初始化 GitHub main 分支与 Actions workflow",initializingGithubBranch:"正在初始化 GitHub 持续交付目标分支",mountGithubDelivery:"挂载 GitHub 持续交付",githubBranchInitialized:"GitHub 持续交付已初始化目标分支",githubDeliveryMounted:"GitHub 持续交付已挂载",githubMountFailed:"挂载 GitHub 持续交付失败",githubMountFailedDetail:"GitHub 持续交付挂载失败:{{message}}",githubMountFailedHint:"挂载 GitHub 持续交付失败,详见 GitHub 日志。",applyingMpaProfile:"正在将 Agent 配置应用到 MPA Runtime",mpaProfileApplied:"MPA Runtime 配置已应用",runningMpaSmoke:"正在验证 MPA Runtime 执行链路",mpaReady:"MPA Runtime 已可运行",deploymentComplete:"部署完成",deployedNotConnected:"部署完成,暂未连接",cancelled:"已取消",cancelledHint:"部署已取消,相关 Runtime 资源已请求销毁。",deploymentStatusUnconfirmed:"部署状态待确认",deploymentFailed:"部署失败",buildFailedHint:"构建镜像失败,详见构建日志。"},confirm:{updateTitle:"确认更新",deployTitle:"确认部署",closeLabel:"关闭部署确认",updateDescription:"将更新并发布到当前云端 Runtime,过程可能需要几分钟。确定继续吗?",deployDescription:"将创建新的云端 Runtime,部署过程可能需要几分钟。确定继续吗?",update:"确定更新",deploy:"确定部署"},userPool:{label:"用户池",unnamed:"未命名用户池",current:"当前用户池",ariaLabel:"部署用户池",loading:"正在加载用户池…",placeholder:"请选择用户池",loadingIdentity:"正在加载 Identity 用户池…",empty:"当前账号下暂无 Identity 用户池。",currentHint:"当前 Studio 的登录 JWT 将透传访问此 Runtime。",mismatchHint:"所选用户池不是当前 Studio 使用的用户池,部署后无法从 Studio 调用此 Runtime。",markedHint:"当前 Studio 使用的用户池已在列表中标注。"},authentication:{apiKeyDescription:"默认方式,使用 Runtime API Key 访问",userPool:"用户池",userPoolDescription:"使用 Identity 用户池签发的 JWT"},steps:{buildImage:"构建镜像",deploy:"部署",publish:"发布",syncCode:"同步代码",uploadPackage:"上传代码包",packageImage:"镜像打包",createRuntime:"创建 Runtime",publishService:"发布服务",updateInstances:"更新实例配置",createEvaluationSets:"创建评测集",applyMpaProfile:"应用 MPA 配置",verifyMpaRuntime:"验证 MPA Runtime",mpaReady:"MPA Runtime 可运行"},errors:{instanceRangeInteger:"最小实例数必须为大于等于 0 的整数,最大实例数必须为大于 0 的整数。",instanceRangeOrder:"最小实例数不能大于最大实例数。",selectApiKey:"请先在模型配置中选择 API Key。",loadApiKey:"加载 API Key 失败,请重试。",invalidProject:"项目数据无效",updateFeishu:"更新飞书配置失败:{{message}}",userPoolRequired:"请选择用于 Runtime 鉴权的用户池。",vpcRequired:"使用 VPC 网络时,请填写 VPC ID。",modelSecretRequired:"请填写 {{label}},用于访问对应的自定义模型地址。",managedApiKeyRequired:"{{requirement}},请先返回模型配置选择 API Key。",feishuEnvRequired:"启用飞书后,请填写{{field}}。",runtimeNameExists:"Runtime 名称已存在,请修改后重试。",deployedButGithubMountFailed:"部署成功,但挂载 GitHub 持续交付失败:{{message}}",deployedButGithubBindFailed:"部署成功,但绑定 GitHub 失败:{{message}}",mpaRuntimeIdMissing:"部署成功,但返回缺少 Runtime ID,无法应用 MPA 配置。",mpaOperationIncomplete:"MPA Runtime 初始化未完成,请重试此部署任务。",deploymentStatusUnconfirmed:"连接已中断,当前无法确认部署最终状态。任务可能仍在云端运行,请到 AgentKit 或 Code Pipeline 查看同一任务,避免重复部署。",failedAtStage:"{{action}}失败({{stage}}阶段):{{message}}",noAgentAtEndpoint:"连接成功,但该地址未发现任何 Agent(/list-apps 为空)。",addAgent:"添加 Agent 失败:{{message}}",modelApiKeyRequired:"请填写此模型地址对应的 API Key。"}},EYe={title:"工作区",storageUnavailable:"管理员未配置持久化存储,工作区管理暂不可用。",detail:"工作区详情",create:"新建工作区",editorDescription:"将常用环境组合在一起;同一个环境可以加入多个工作区。",backToList:"返回工作区列表",environmentCount_one:"{{count}} 个环境",environmentCount_other:"{{count}} 个环境",createdAt:"创建时间",updatedAt:"最近更新",basicInfo:"基本信息",namePlaceholder:"例如:内容生产",descriptionPlaceholder:"说明这个工作区的用途",selectedEnvironmentCount:"已选择 {{count}} 个,可在其他工作区中继续复用",searchAvailableEnvironments:"搜索可用环境",searchEnvironments:"搜索环境",noAvailableEnvironments:"还没有可添加的环境",createEnvironmentFirst:"请先在“环境”页面创建并构建环境。",noMatchingEnvironments:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称。",environmentStatus:{available:"可用",building:"构建中",notBuilt:"未构建"},added:"已添加",saved:"已保存工作区“{{name}}”",resourceType:"工作区资源类型",searchWorkspaces:"搜索工作区",loadFailed:"无法加载工作区",noMatchingWorkspaces:"没有匹配的工作区",tryAnotherNameOrEnvironment:"请尝试搜索其他名称或环境",noEnvironmentAdded:"未添加环境",environmentMissing:"环境缺失",availableFraction:"{{available}}/{{total}} 可用",available:"可用",availableCount:"{{count}} 个可用",updated:"更新",addEnvironment:"添加环境",deleteTitle:"删除工作区",deleteDescription:"确定删除工作区“{{name}}”吗?环境本身不会被删除。",deleted:"已删除工作区“{{name}}”",clipboardPermissionError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。",codeProjects:"代码项目"},_Ye={back:"返回",detailNavigation:"详情导航",noData:"暂无数据",actions:"操作",moreActions:"更多操作 {{label}}",actionsFor:"{{label}} 操作",loading:"资源加载中,请稍候"},RYe={addSkill:"添加 Skill",remove:"移除 {{name}}",confirmRemoveRuntime:"从新版本中移除运行中的 Skill「{{name}}」?",selectedCount:"已加入技能 · {{count}}",close:"关闭{{label}}",sources:{runtime:"运行中来源 · 原样保留,可移除或用同名 Skill 替换",local:"本地",skillspace:"AgentKit Skills 中心",skillhub:"火山 Find Skill 技能广场"},tabs:{local:"本地文件",localShort:"本地文件",skillspace:"AgentKit Skills 中心",skillspaceShort:"AgentKit",skillhub:"火山 Find Skill 技能广场",skillhubShort:"Find Skill"}},DYe={model:"模型",turnControls:"流程控制",pause:"暂停",resume:"恢复",interrupt:"中断",cancel:"取消",pauseTurn:"在安全点暂停完整流程",resumeTurn:"恢复完整流程",interruptTurn:"中断当前流程并保留会话上下文",cancelTurn:"取消当前流程且不可恢复",turnState:{running:"运行中",pausing:"正在到达安全点",paused:"已暂停",resuming:"正在恢复",interrupting:"正在中断",cancelling:"正在取消",interrupted:"已中断",completed:"已完成",failed:"失败",cancelled:"已取消",orphaned:"状态待确认",newTurnRequired:"需要从检查点继续"},tasks:{ppt:"PPT",image:"图片生成",video:"视频生成"},prompts:{ppt:{quarterlyReview:"复盘【季度】经营表现,提炼指标差距、原因与行动建议",projectUpdate:"汇报【项目名称】进展:里程碑、风险、预算和资源诉求",solutionProposal:"为【客户行业】输出解决方案:痛点、架构、实施路径与收益",industryAnalysis:"分析【行业主题】趋势,给出竞争格局、机会与战略建议"},image:{launchVisual:"为【品牌或产品】设计【高级科技】风格的发布会主视觉",ecommercePoster:"生成【产品名称】电商海报,突出【核心卖点】与品牌色",conceptRendering:"呈现【产品或空间】在【使用场景】中的写实概念效果图",socialGraphic:"围绕【传播主题】制作简洁专业的企业社媒配图"},video:{brandFilm:"制作【品牌名称】30 秒宣传片,突出【品牌价值】",productLaunch:"为【产品名称】制作 45 秒发布视频:痛点、功能、场景与行动号召",trainingVideo:"制作【培训主题】企业培训视频,讲清【关键操作或规范】",eventTeaser:"生成【活动名称】20 秒预热视频,包含亮点、时间地点和报名信息"}},firstFrame:"首帧",videoToEdit:"待编辑视频",baseVideo:"基础视频",optimizeSkillPlaceholder:"描述你想优化的技能…",createSkillPlaceholder:"描述你想生成的技能…",createVideoPlaceholder:"描述你想创作的视频…",messageAgentPlaceholder:"向 {{name}} 发消息…",selectAgentFirst:"请先选择智能体",selectSkillFirst:"请先选择需要优化的 Skill",availableSkills:"可用技能",availableSubagents:"可用子 Agent",invokeSkill:"调用技能",useSubagent:"使用子 Agent",loadingCapabilities:"正在读取 Agent 能力…",noMatchingSkills:"当前 Agent 没有匹配技能",noMatchingSubagents:"当前 Agent 没有匹配子 Agent",skillFallbackDescription:"加载并执行该技能",agentFallbackDescription:"将本轮交给该 Agent",skill:"技能",uploadImage:"上传图片",uploadDocument:"上传文档或 PDF",uploadVideo:"上传视频",taskMode:"任务模式",selectTaskMode:"选择任务模式",loadingGenerationModel:"正在加载生成模型",modelUnavailable:"模型不可用",cancelTask:"取消{{task}}任务",stopGenerating:"停止生成",viewVideoProgress:"查看视频生成进度",send:"发送",selectTaskType:"选择任务类型",enterprisePrompts:"{{task}}企业提示词",sessionId:"会话 ID",sessionIdLabel:"会话 ID:",initializing:"初始化中",copied:"已复制",copySessionId:"复制会话 ID",sessionIdCopied:"已复制会话 ID",disclaimer:"回答仅供参考",viewLogs:"查看日志"},LYe={selectAgent:"选择 Agent",noLocalAgents:"暂无本地 Agent。",searchRuntime:"搜索 Runtime 名称",mineOnly:"只看我创建的",noRuntimes:"暂无 Runtime。",unsupported:"不支持",createdByMe:"我创建的",connecting:"连接中…",connected:"已连接",connect:"连接",viewInfoFor:"查看 {{name}} 信息",viewInfo:"查看信息",agentAndRuntimeInfo:"Agent 与 Runtime 信息",detailType:"详情类型",agentInfo:"Agent 信息",runtimeInfo:"Runtime 信息",loadingAgentInfo:"读取 Agent 信息…",cannotLoadAgentInfo:"暂时无法读取 Agent 信息",unnamedAgent:"未命名 Agent",subagents:"子 Agent",tools:"工具",skills:"技能",previewUnsupported:"暂不支持预览",mountedComponents:"挂载组件",noMoreAgentInfo:"暂无更多 Agent 配置信息。",local:"本地",model:"模型",status:"状态",memoryMb:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",resources:"资源",version:"版本",loadingDetails:"读取详情…",environmentVariables:"环境变量",errors:{notFound:"该 Runtime 已不存在或列表信息已过期,请刷新列表后重试。",accessDenied:"当前账号无权访问该 Runtime,请检查所属 Project 和访问权限。",previewUnsupported:"该 Agent Server 版本暂不支持信息预览。",unavailable:"该 Runtime 暂时无法访问,请确认其状态为“就绪”后重试。",timeout:"加载超时,请重试"},componentKinds:{knowledgebase:"知识库",memory:"记忆",prompt_manager:"提示词管理",example_store:"样例库",run_processor:"运行处理器",tracer:"链路追踪",toolset:"工具集",plugin:"插件",other:"其他"},runtimeStatus:{ready:"就绪",unreleased:"未发布",running:"运行中",active:"运行中",creating:"创建中",pending:"等待中",deploying:"部署中",updating:"更新中",failed:"失败",error:"异常",stopping:"停止中",stopped:"已停止",deleting:"删除中",deleted:"已删除"}},MYe={agent:"智能体",agentTypes:{general:"通用智能体",mpa:"MPA 智能体",codex:"Codex","deepseek-harness":"DeepSeek",openclaw:"OpenClaw",hermes:"Hermes"},creator:"创建人",namedAgent:"{{name}} 智能体",storageLocation:"存储位置",currentBrowser:"当前浏览器",region:"地域",viewDeploymentProgress:"查看 {{name}} 部署进度",viewRuntimeDetails:"查看 {{name}} Runtime 详情",viewDetails:"查看 {{name}} 详情",time:"时间",remainingTime:"剩余时间",expiringSoon:"即将清空",sandboxRemaining:"{{hours}} 小时 {{minutes}} 分钟",wakeable:"已休眠",neverExpires:"永不过期",editDraftNamed:"编辑草稿 {{name}}",viewProgress:"查看进度",deleteDraftNamed:"删除草稿 {{name}}",recheckCompatibility:"重新检测 {{name}} 的对话兼容性",connectedNamed:"{{name}} 已连接",wakeAndChat:"唤醒 {{name}} 并开始对话",chatWith:"与 {{name}} 对话",waking:"唤醒中",deploying:"部署中",draft:"草稿",checking:"检测中",chatUnsupported:"不支持对话",checkFailed:"检测失败",creatorFilter:"创建人筛选",agentType:"智能体类型",searchAgents:"搜索智能体",handoff:"接力",agentList:"{{type}}列表",noMatchingAgents:"没有匹配的智能体",adjustSearch:"请尝试调整搜索或筛选条件",noAgentType:"暂无 {{type}}",noGeneralAgents:"暂无通用智能体",createGeneralAgentDescription:"创建一个通用智能体,开始构建和对话",createAgentType:"创建{{type}}",createAgent:"创建智能体",loadingMore:"正在加载更多智能体",scrollForMore:"继续下滑加载更多",allLoaded:"已加载全部智能体",deleteDraftTitle:"删除草稿?",deleteDraftDescription:"删除后将无法恢复“{{name}}”。",deleteDraft:"删除草稿",loadGeneralAgents:"加载通用智能体",loadAgentType:"加载 {{type}}",compatibility:{checking:"正在请求 Runtime /list-apps,以确认该智能体是否支持 Studio 对话。",empty:"Runtime /list-apps 未返回可用的 Agent,暂时无法连接对话。",supported:"Runtime 支持 Studio 对话。",unknownError:"Runtime /list-apps 请求失败,未返回可识别的错误信息。"},sandboxStatus:{ready:"就绪",wakeable:"已休眠",creating:"创建中",starting:"启动中",initializing:"启动中",pending:"等待中",running:"运行中",failed:"异常",error:"异常",stopped:"已停止",expired:"已过期",deleting:"删除中",deleted:"已删除",unknown:"未知状态"},wakingHint:"正在唤醒智能体,可能需要一些时间。",mpaCreate:{name:"名称",namePlaceholder:"例如 test-agent",nameHelp:"作为 Runtime 名称,支持 4–64 位字母、数字、下划线或连字符。",stepsLabel:"创建步骤",steps:{basics:"基本信息",postgres:"PostgreSQL",openviking:"OpenViking",autoPostgres:"数据库"},next:"下一步",previousStep:"上一步",pgDescription:"选择已有的 PostgreSQL 实例。创建流程会在该实例中准备智能体的独立业务库。",pgSplitDescription:"使用已配置的业务 PG Workspace。多个智能体共用此 Workspace,每个智能体拥有独立业务库。共享资源记录单独存放在 mpa_admin_workspace / mpa_admin_db,由管理员配置。",pgConsole:"前往火山引擎 AIDAP 创建或查看 PG Workspace",pgHost:"PG 主机地址",pgPort:"PG 端口",pgInvalid:"请填写有效的 PG 主机地址和端口。",pgCredentials:"PG 连接账号和密码由部署服务配置;主机和端口须与服务端配置一致。",openvikingDescription:"可选。三项全部填写才启用 OpenViking;全部留空则不向新智能体注入 OpenViking 配置。",openvikingConsole:"前往火山引擎查看 OpenViking 资源",openvikingUrl:"OpenViking 服务地址",openvikingResourceId:"OpenViking 资源 ID",openvikingApiKey:"OpenViking API Key",openvikingInvalid:"请同时填写有效的 HTTPS 服务地址、资源 ID 和 API Key,或全部留空。",openvikingCredentials:"API Key 仅用于本次创建,不保存到浏览器草稿;刷新页面后需重新填写。",tosTitle:"会话输出存储",tosDescription:"可选。填写完整的 TOS 凭证和存储桶,为新智能体的每个会话挂载独立输出目录。三项均留空时使用服务端预设;服务端未配置时,不启用 TOS 挂载。",tosAccessKey:"TOS Access Key",tosSecretKey:"TOS Secret Key",tosBucket:"TOS 存储桶",tosInvalid:"TOS Access Key、Secret Key 和存储桶必须同时填写。",tosCredentials:"凭证仅用于本次创建,不会保存在浏览器恢复数据或创建任务记录中。",runtimeImage:"MPA 镜像",workerImage:"Worker 镜像",imageDefault:"留空使用配置文件中的默认镜像",imageInvalid:"请输入有效的镜像地址,不要包含网址、空格或登录凭据。",title:"创建 MPA 智能体",agentId:"智能体 ID",description:"描述",region:"部署地域",plan:"创建计划",sharedResources:"准备或复用账号共享 VPC、子网和 APIG 消息网关",agentResources:"准备独立业务库、技能空间和执行环境,部署智能体",readiness:"检查网关和智能体就绪状态,成功后加入列表",checking:"正在检查创建配置…",configured:"创建配置已就绪。提交后会检查云资源并开始准备。",notConfigured:"尚未配置创建所需的资源参数,请联系管理员配置后重试。",loadFailed:"检查创建配置失败,请重试。",reload:"重新检查",submit:"开始创建",retry:"重试创建",newAgent:"新建另一个智能体",newAgentDescription:"新建另一个智能体将开启可编辑的新请求,替换当前恢复草稿,但不会取消旧任务。旧任务仍在运行时,请等待其结束后再提交。",close:"关闭",cancel:"取消创建",confirmCancel:"确认取消",cancelDescription:"取消后会停止后续步骤。已创建的数据库、技能空间、网关和其他已登记资源会保留,可使用同一智能体 ID 重试。",background:"关闭窗口后创建会继续。再次打开可查看进度。",pollFailed:"暂时无法获取进度,正在重新连接。请勿重复创建其他智能体。",iamPermissionDenied:"部署服务没有准备运行角色所需的 IAM 权限,请联系管理员授权后重试。",iamTrustConflict:"运行角色的信任关系不符合要求,请管理员检查对 VeFaaS 和 APIG 的授权后重试。",iamPolicyConflict:"运行角色所需的同名权限策略内容冲突,请管理员检查后重试。",iamOwnershipConflict:"运行角色与当前部署账号不匹配,请管理员检查后重试。",iamVerificationFailed:"尚未确认运行角色的权限已就绪,请检查 IAM 服务及策略可用性后重试。",iamConfigurationConflict:"自动准备运行角色仅支持默认 MPA 角色,请检查服务端创建配置。",creationFailed:"当前步骤未完成,请检查对应资源、服务端配置及权限后,用同一智能体 ID 重试。",cancelFailed:"取消请求失败,请重新查询进度后重试。",cancelled:"创建已取消,已登记资源保留供重试。",timeout:"创建超时,已登记资源保留。请检查对应资源后重试。",interrupted:"创建任务中断。请用同一智能体 ID 重试以恢复已登记资源。",skillSpace:"技能空间",states:{running:"正在创建",cancelling:"正在取消",succeeded:"创建成功",failed:"创建失败",cancelled:"已取消"},stages:{queued:"等待开始",iam_role:"准备运行角色",checking:"检查账号与配置",network:"准备 VPC 和子网",gateway:"准备 APIG 和 IM Gateway",database:"准备业务数据库",skills:"准备技能空间",worker:"准备执行环境",deploying:"准备数据库、技能空间和 Runtime",verifying:"等待智能体就绪",admin_workspace:"准备管理 PG Workspace",business_workspace:"准备业务 PG Workspace",admin_database:"初始化共享管理库"},back:"继续创建",pgAutoDescription:"使用 VeADK 部署账号自动创建或复用两个 PG Workspace:mpa_admin_workspace / mpa_admin_db 存放共享资源记录,业务 Workspace 供多个智能体共用,每个智能体拥有独立业务库。无需填写 PG 连接信息,提交创建后开始准备。",pgModeChanged:"此创建任务使用旧的 PG 配置,不能直接切换为自动模式重试。请联系管理员确认已有资源和任务后重新创建。",pgMigrationRequired:"检测到旧共享注册库。请先将共享资源记录迁移到 mpa_admin_workspace / mpa_admin_db,并完成现有 Runtime 的注册库地址切换;完成后点击“重新检查”。"}},IYe={library:"技能库",skill:"技能",skills:"技能",skillSpace:"技能空间",sandboxNotConfigured:"管理员未配置 Dev Sandbox",adminNotConfigured:"管理员未配置",totalItems:"共 {{count}} 项",cannotLoadSpaces:"无法加载技能空间",someSpacesFailed:"部分技能空间加载失败",degradedRelationWarning:"部分关联异常,已恢复可读取技能",downloadZip:"下载 ZIP",optimize:"优化",closeSkillDetails:"关闭技能详情",skillId:"技能 ID",allFiles:"完整文件",loadingSkillContent:"正在读取技能内容…",noSkillContent:"该技能暂无 SKILL.md 内容",addSkill:"添加技能",localUpload:"本地上传",localUploadDescription:"选择 ZIP 文件,校验通过后上传到技能空间",autoCreate:"自动创建",autoCreateDescription:"选择模型和风格,通过对话生成技能",createSkill:"创建技能",optimizeNamed:"优化 {{name}}",deleteSkillConfirm:"确定删除整个 Skill“{{name}}”吗?此操作会影响所有引用它的空间。",deleteSpaceConfirm:"确定删除 Skill 空间“{{name}}”吗?请先确认空间中的技能已删除。",manageSpaceDescription:"管理空间中的技能并创建新的版本",backToSpaces:"返回技能空间列表",overview:"概览",skillCount:"技能数量",skillCountValue_one:"{{count}} 技能",skillCountValue_other:"{{count}} 技能",updatedAt:"更新时间",skillsInSpace:"{{name}}中的技能",searchSkills:"搜索技能",cannotLoadSkills:"无法加载技能",noMatchingSkills:"没有匹配的技能",noSkills:"暂无技能",tryAnotherName:"请尝试搜索其他名称",emptySkillsDescription:"本地上传 Skill,或自动创建",actions:"操作",spaceDetails:"技能空间详情",editSpace:"编辑空间",deleteSpace:"删除空间",searchSpaces:"搜索技能空间",spaceList:"技能空间列表",noMatchingSpaces:"没有匹配的技能空间",createSpace:"新建技能空间",newSpace:"新建空间",loadingMoreSpaces:"正在加载更多技能空间",scrollForMore:"继续下滑加载更多",allSpacesLoaded:"已加载全部技能空间",errors:{loadSpaces:"读取技能空间失败,请稍后重试",loadSkills:"读取技能失败,请稍后重试",loadSkillDetails:"读取技能详情失败,请稍后重试",deleteSkill:"删除 Skill 失败",deleteSpace:"删除 Skill 空间失败",downloadSkill:"下载 Skill 失败"},status:{active:"可用",available:"可用",creating:"创建中",disabled:"已停用",enabled:"已启用",failed:"异常",inactive:"未启用",pending:"等待中",published:"已发布",ready:"就绪",released:"已发布",running:"运行中",success:"正常",unavailable:"不可用",unreleased:"未发布",updating:"更新中",unknown:"未知"},sharedSpace:"企业共享空间",sharedDescription:"面向企业全员开放的技能,由管理员统一发布和维护",sharedVisibility:"全员可见",sharedPreparing:"正在准备共享空间",sharedLoadFailed:"共享空间加载失败",sharedEmpty:"暂无共享技能,管理员发布后会显示在这里",requestPublication:"申请公开",reviewSubmitting:"提交中…",reviewSubmitted:"已申请",reviewFailed:"申请公开失败",reviewStatusFailed:"审核状态加载失败",reviewRetry:"重新申请",reviewPending:"待审核",reviewApproving:"发布中",reviewApproved:"已公开",reviewReturned:"已退回",reviewHistory:"审核记录",skillDetailSections:"技能详情内容",versions:{title:"版本管理",refresh:"刷新",uploading:"上传中…",upload:"上传新版本",close:"关闭",hint:"新版本不会替换已公开版本,审核通过后才会公开;ZIP 中的技能名称需与原技能一致",loading:"正在加载版本…",loadFailed:"无法加载版本",filesFailed:"无法加载版本文件",uploadFailed:"上传新版本失败",submitFailed:"提交申请失败",retry:"重试",empty:"暂无版本",current:"当前版本",notSubmitted:"未申请公开",submitting:"提交中…",submit:"申请公开",processing:"版本状态:{{status}}",filesLoading:"正在加载文件…",filesEmpty:"暂无文件",history:"历史审核记录",shared:"已公开"},author:"作者",authorName:"作者:{{name}}"},PYe={library:"知识库",createBase:"新建知识库",editBase:"编辑知识库",invalidName:"名称必须以字母开头,且只能包含字母、数字和下划线。",nameHelp:"以字母开头,仅支持字母、数字和下划线,最多 48 个字符。",optionalDescription:"描述(可选)",descriptionOnly:"AgentKit 当前仅支持更新知识库描述。",previewWeb:"预览网页内容",addData:"添加数据",openOriginalWeb:"打开原网页",backToEdit:"返回修改",confirmAdd:"确认添加",source:"知识来源",image:"图片",documentFile:"文档文件",webPage:"在线网页",webUrl:"网页 URL",generatingWebPreview:"正在抓取网页并生成 Markdown 预览",selectFile:"选择知识文件",selectOrDropFile:"选择文件或拖拽到这里",selectedFile:"{{size}} · 点击可重新选择",imageFileHelp:"支持 PNG、JPG 和 JPEG,单个文件不超过 200 MB",documentFileHelp:"支持 PDF、PPTX、DOCX、XLSX 和 TXT,单个文件不超过 200 MB",uploadingFile:"正在上传文件并添加到知识库",optionalName:"名称(可选)",optionalType:"类型(可选)",generatePreview:"生成预览",uploadFile:"上传文件",editMetadata:"编辑知识 Metadata",knowledge:"知识",field:"字段",value:"值",backToList:"返回知识库列表",metadataJson:"元数据(JSON)",provider:"服务提供方",knowledgeId:"知识库 ID",project:"项目",creator:"创建者",data:"数据",deleteInvalidAssociation:"删除失效关联",noData:"这个知识库还没有数据",addFirstData:"添加第一项数据",format:"格式",size:"大小",searchData:"搜索数据",searchLibraryData:"搜索知识库数据",associationInvalid:"关联已失效",providerMissing:"底层 Provider 知识库已不存在",noMatchingData:"没有匹配的数据",loadingMoreData:"正在加载更多数据",retryLoading:"重试加载",details:"知识库详情",searchBases:"搜索知识库",someBasesFailed:"部分知识库暂时无法加载,已展示其余可用内容。",noMatchingBases:"没有匹配的知识库",noManagePermission:"您没有管理此知识库的权限",loadingMoreBases:"正在加载更多知识库",deleteBaseTitle:"删除知识库?",deleteBaseDescription:"将删除 {{name}} 的 AgentKit 关联;如果它由 Studio 创建,也会同时删除 Provider 资源。此操作无法撤销。",deleteDocumentTitle:"删除知识?",deleteDocumentDescription:"将从 Provider 知识库中删除 {{name}},此操作无法撤销。",preview:{processingTitle:"数据正在处理中",processingDetail:"知识库完成解析后即可预览,请稍后重新加载。",failedTitle:"数据解析失败",failedDetail:"请检查源文件或网页地址后重新添加,也可以重新加载最新状态。",noParsedTitle:"暂时没有可预览的解析内容",noParsedDetail:"此类文件会在知识库完成解析后显示文本、表格或页面图片。",noMediaTitle:"暂时没有可预览的媒体内容",noMediaDetail:"知识库尚未返回可访问的媒体预览,请稍后重新加载。",noDataTitle:"暂无可预览的数据内容",noDataDetail:"知识库尚未返回解析结果,请稍后重新加载。",attachmentError:"附件无法预览,请稍后重试。",imageAlt:"知识数据图片",audioUnsupported:"当前浏览器不支持音频预览。",videoUnsupported:"当前浏览器不支持视频预览。",namedPdf:"{{name}} PDF 预览",pdf:"PDF 预览",openPdf:"无法显示时,在新窗口打开 PDF",fileUnsupported:"当前格式暂不支持直接在线预览,已优先显示解析后的内容。",openOriginalFile:"打开原文件",loading:"正在加载数据预览",openOriginalHint:"您可以打开原网页查看来源内容。",chunk:"片段 {{index}}",loadingMore:"正在加载更多",loadMore:"加载更多"},errors:{fileTooLarge:"单个文件不能超过 200 MB",invalidImageType:"请选择 PNG、JPG 或 JPEG 图片",invalidDocumentType:"请选择 PDF、PPTX、DOCX、XLSX 或 TXT 文件",createBase:"创建知识库失败",updateBase:"更新知识库失败",metadataObject:"Metadata 必须是 JSON 对象",metadataFormat:"Metadata 格式错误",noWebPreview:"网页没有可预览的 Markdown 内容",addWeb:"添加网页失败",previewWeb:"生成网页预览失败",uploadFile:"上传文件失败",updateDocument:"更新知识失败",loadPreview:"加载数据预览失败",loadMoreBases:"加载更多知识库失败",loadBases:"加载知识库失败",loadMoreData:"加载更多数据失败",loadData:"加载数据失败",deleteBase:"删除知识库失败",deleteDocument:"删除知识失败"}},NYe={title:"飞书渠道",refresh:"刷新",loading:"正在加载渠道配置…",unsupported:"此 Runtime 不支持渠道管理,请升级 MPA 镜像。",unauthorized:"渠道管理需要 Studio 管理员身份及有效的 Runtime 凭据。",configurationError:"渠道管理配置不完整,请检查 Runtime 元数据及加密密钥。",requestFailed:"渠道请求失败,请检查 Runtime 连接后重试。",bound:"已绑定:{{name}}",unbound:"尚未绑定飞书机器人。",guidance:"私聊使用独立会话。在已授权群内 @ 当前机器人即可对话。",keyRequired:"绑定前请在 Runtime 配置持久的 CHANNEL_STATE_ENCRYPTION_KEY。",gateway:"消息网关",route:"入站路由",delivery:"回复投递",configured:"已配置",missing:"未配置",delivery_not_observed:"尚未观测",delivery_delivered:"已投递",delivery_retrying:"重试中",missingConfig:"缺少 Runtime 配置:{{fields}}",bind:"扫码绑定",newQr:"重新生成二维码",unbind:"解除绑定",confirmUnbind:"确认解绑此机器人?解绑后将停止接收新消息。",qrAlt:"机器人绑定二维码",openQr:"打开授权页面",uncertain:"注册过程已中断。重新开始前,请检查机器人绑定与 Gateway 状态。",bindingFailed:"绑定失败,请检查 Gateway 配置后重试。",chatId:"允许的群 ID",scope:"群会话策略",saveGroup:"保存群权限",noGroups:"尚未授权任何群。私聊无需群权限。",edit:"编辑",remove:"移除",removeGroup:"移除 {{name}}",scope_group_sender:"按发言人隔离",scope_group:"全群共享",scope_group_topic_sender:"按话题和发言人隔离",scope_group_topic:"按话题共享",status_PENDING:"等待扫码",status_SCANNED:"已扫码,等待授权",status_AUTHORIZED:"已授权,准备注册",status_REGISTERING:"正在注册机器人",status_BOUND:"机器人已绑定",status_FAILED:"绑定失败",status_EXPIRED:"二维码已过期",workspaceTitle:"消息渠道",workspaceDescription:"连接消息平台,让用户直接与此智能体对话,并管理访问权限。",provider_feishu:"飞书",provider_wecom:"企业微信",provider_dingtalk:"钉钉",comingSoon:"暂未开放",unavailableDescription:"{{name}}的绑定与消息配置暂未开放。",runtimeRequired:"请先将此智能体部署到 Runtime,再配置消息渠道。",bindingTitle:"机器人绑定",connected:"已绑定",notBound:"未绑定",gatewayDescription:"用于接收渠道消息的网关配置。",routeDescription:"将渠道消息转发给当前智能体的路由配置。",deliveryDescription:"实际观测到的回复投递状态,完成配置不代表已成功投递。",groupsTitle:"群聊权限",groupsDescription:"添加允许访问的群,并设置群内对话的共享范围。",providerBindingTitle:"绑定{{name}}",providerUnbound:"绑定{{name}}机器人,让用户通过消息与此智能体对话。",qrGuidance:"使用{{name}}扫码授权,Runtime 将保存机器人凭据并配置消息网关。",wecomGuidance:"使用企业微信扫码授权,或手动填写 Bot ID 和 Secret 绑定已有机器人。",wecomBotId:"Bot ID",wecomSecret:"Secret",bindCredentials:"绑定机器人",wecomScan:"扫码绑定",wecomAuthorizing:"等待企业微信授权…",cancelAuthorization:"取消授权",wecomPopupBlocked:"授权窗口被浏览器拦截,请允许弹窗后重试。",wecomAuthCancelled:"已取消企业微信授权,可以重新扫码。",wecomAuthTimeout:"企业微信授权已超时,请重新扫码。",wecomInvalidResult:"授权结果缺少 Bot ID 或 Secret,请重新授权或手动填写。",wecomAuthFailed:"企业微信授权失败,请重试或手动填写凭据。",dingtalkClientId:"Client ID",dingtalkClientSecret:"Client Secret",manualUpgrade:"当前镜像尚不支持{{name}}手动配置,请升级后使用;仍可使用极速配置。",pairingTitle:"消息渠道扫码配对",feishuPairingDescription:"如果已有连接机器人,飞书扫码并绑定成功后原有机器人会被替换,可选绑定存量机器人或新建机器人。",generatingQr:"正在生成配对二维码…",dingtalkGuidance:"使用钉钉扫码授权,或手动填写 Client ID 和 Client Secret 绑定已有机器人。",wecomPairingDescription:"将在企业微信授权窗口中重新扫码配对。新机器人绑定成功后会替换当前连接;取消授权或绑定失败不会解绑原机器人。",configurationMethod:"配置方式",quickSetup:"极速配置",manualSetup:"手动配置",feishuAppId:"App ID",feishuAppSecret:"App Secret",manualGuidance:"填写已有{{name}}机器人的应用凭据,连接到当前智能体。",manualReplacement:"绑定成功后将替换当前机器人;取消或绑定失败不会解除现有绑定。"},Ndr=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:gYe,agentSelector:LYe,agentWorkspace:vYe,channels:NYe,cloudEnvironment:AYe,common:pYe,composer:DYe,default:{common:pYe,agentKitPromo:gYe,systemInfo:mYe,agentWorkspace:vYe,environmentCenter:yYe,deploymentSelect:bYe,deploymentError:xYe,studioBuildProgress:wYe,cloudEnvironment:AYe,githubCicd:SYe,feishuDeployment:TYe,deploymentResources:CYe,studioUpdate:kYe,projectPreview:OYe,workspace:EYe,resourceCollection:_Ye,skillSourcePicker:RYe,composer:DYe,agentSelector:LYe,myAgents:MYe,skillCenter:IYe,knowledge:PYe,channels:NYe},deploymentError:xYe,deploymentResources:CYe,deploymentSelect:bYe,environmentCenter:yYe,feishuDeployment:TYe,githubCicd:SYe,knowledge:PYe,myAgents:MYe,projectPreview:OYe,resourceCollection:_Ye,skillCenter:IYe,skillSourcePicker:RYe,studioBuildProgress:wYe,studioUpdate:kYe,systemInfo:mYe,workspace:EYe},Symbol.toStringTag,{value:"Module"})),BYe="用户管理",$Ye="{{count}} 位成员",FYe="用户",zYe="角色",UYe="账号状态",VYe="最近登录",GYe="操作",QYe="更改角色",HYe="关闭",WYe="保存角色",YYe="正在保存…",qYe="取消",jYe="返回",XYe="用户池",KYe="火山引擎 Identity",ZYe="搜索姓名、邮箱或用户 ID",JYe="搜索",eqe="筛选角色",tqe="全部角色",rqe="刷新",nqe="正在读取用户…",iqe="更新于 {{time}}",aqe="已将 {{name}} 设置为{{role}}",oqe="重试",sqe="你",lqe="初始超级管理员",cqe="初始超级管理员受保护,不能在此降级",uqe="保存后,对方刷新 Studio 即可使用新的权限",dqe="角色需要重新确认",hqe="没有匹配的用户",fqe="尝试其他关键词或角色",pqe="用户登录或加入当前用户池后会显示在这里",gqe="共 {{count}} 位用户",mqe="上一页",vqe="下一页",yqe="尚未登录",bqe="未提供",xqe={super_admin:"超级管理员",admin:"管理员",developer:"开发者",user:"普通用户"},wqe={super_admin:"管理所有资源,并管理用户和分配角色",admin:"管理 Studio 资源",developer:"开发智能体并管理自己的资源",user:"使用智能体和个人功能"},Aqe={EXTERNAL_PROVIDER:"正常",CONFIRMED:"正常",NORMAL:"正常",ENABLED:"正常",ACTIVE:"正常",UNCONFIRMED:"待验证",DISABLED:"已停用",FORBIDDEN:"已禁用",LOCKED:"已锁定",SUSPENDED:"已暂停",FORCE_CHANGE_PASSWORD:"需要修改密码"},Sqe={request_failed:"请求未完成,请刷新列表确认当前状态后重试",invalid_response:"用户服务返回异常,请刷新后重试",identity_unavailable:"暂时无法访问 Identity,请稍后重试或检查服务权限",identity_resource_missing:"用户或用户池已不存在,请刷新列表",super_administrator_required:"只有超级管理员可以管理用户",sign_in_required:"请登录后重试",user_not_in_pool:"当前账号不属于此用户池",user_disabled:"当前账号已停用",protected_administrator:"不能降低初始超级管理员的权限",cannot_demote_self:"不能降低自己的超级管理员权限",role_change_conflict:"角色已发生变化,请关闭弹窗并刷新列表后重试",cross_origin_request:"请在当前 Studio 页面内修改角色"},Bdr=Object.freeze(Object.defineProperty({__proto__:null,actions:GYe,allRoles:tqe,back:jYe,cancel:qYe,changeRole:QYe,close:HYe,default:{title:BYe,memberCount:$Ye,user:FYe,role:zYe,status:UYe,lastLogin:VYe,actions:GYe,changeRole:QYe,close:HYe,save:WYe,saving:YYe,cancel:qYe,back:jYe,pool:XYe,volcengineIdentity:KYe,searchPlaceholder:ZYe,search:JYe,filterRole:eqe,allRoles:tqe,refresh:rqe,loading:nqe,updatedAt:iqe,saved:aqe,retry:oqe,you:sqe,initialAdministrator:lqe,protectedExplanation:cqe,effectiveAfterRefresh:uqe,roleConflict:dqe,noUsers:hqe,tryAnotherSearch:fqe,poolEmpty:pqe,resultCount:gqe,previous:mqe,next:vqe,neverLoggedIn:yqe,unknown:bqe,roles:xqe,descriptions:wqe,states:Aqe,errors:Sqe},descriptions:wqe,effectiveAfterRefresh:uqe,errors:Sqe,filterRole:eqe,initialAdministrator:lqe,lastLogin:VYe,loading:nqe,memberCount:$Ye,neverLoggedIn:yqe,next:vqe,noUsers:hqe,pool:XYe,poolEmpty:pqe,previous:mqe,protectedExplanation:cqe,refresh:rqe,resultCount:gqe,retry:oqe,role:zYe,roleConflict:dqe,roles:xqe,save:WYe,saved:aqe,saving:YYe,search:JYe,searchPlaceholder:ZYe,states:Aqe,status:UYe,title:BYe,tryAnotherSearch:fqe,unknown:bqe,updatedAt:iqe,user:FYe,volcengineIdentity:KYe,you:sqe},Symbol.toStringTag,{value:"Module"})),Tqe="网站集成",Cqe="将 AgentKit Runtime 以悬浮聊天窗口嵌入网站",kqe="返回自动化列表",Oqe="添加网站",Eqe="正在加载 Runtime",_qe="选择 Runtime",Rqe="网站域名",Dqe="例如 xxxx.com 或 localhost:5173",Lqe="正在生成",Mqe="生成 Token",Iqe="已添加网站",Pqe="{{count}} 个",Nqe="{{count}} 个",Bqe="正在加载网站集成",$qe="还没有网站集成",Fqe="选择 Runtime 并输入网站域名即可生成 Token",zqe="引入方法",Uqe="将下面代码放到网页的 body 结束标签前",Vqe="已复制",Gqe="复制代码",Qqe="添加网站后会在这里生成引入代码。",Hqe="确定删除 {{domain}} 的网站集成吗?",Wqe={load:"加载网站集成失败",create:"创建网站集成失败",delete:"删除网站集成失败",noConversationalAgent:"该 Runtime 暂未发现可对话的 Agent"},Yqe={requestFailed:"请求失败 ({{status}})",greeting:"您好,有什么可以帮您?",sessionFailed:"无法建立对话会话",unauthorized:"当前网站未获得对话授权",conversationFailed:"对话请求失败,请稍后重试",open:"打开智能体对话",close:"关闭智能体对话",panelLabel:"智能体对话面板",assistant:"智能体助手",online:"在线对话"},$dr=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:Oqe,addedWebsites:Iqe,backToAutomations:kqe,confirmDelete:Hqe,copied:Vqe,copyCode:Gqe,default:{title:Tqe,description:Cqe,backToAutomations:kqe,addWebsite:Oqe,loadingRuntime:Eqe,selectRuntime:_qe,websiteDomain:Rqe,domainPlaceholder:Dqe,generating:Lqe,generateToken:Mqe,addedWebsites:Iqe,websiteCount_one:Pqe,websiteCount_other:Nqe,loadingIntegrations:Bqe,delete:"删除",emptyTitle:$qe,emptyDescription:Fqe,embedMethod:zqe,embedInstructions:Uqe,copied:Vqe,copyCode:Gqe,embedHint:Qqe,confirmDelete:Hqe,errors:Wqe,widget:Yqe},description:Cqe,domainPlaceholder:Dqe,embedHint:Qqe,embedInstructions:Uqe,embedMethod:zqe,emptyDescription:Fqe,emptyTitle:$qe,errors:Wqe,generateToken:Mqe,generating:Lqe,loadingIntegrations:Bqe,loadingRuntime:Eqe,selectRuntime:_qe,title:Tqe,websiteCount_one:Pqe,websiteCount_other:Nqe,websiteDomain:Rqe,widget:Yqe},Symbol.toStringTag,{value:"Module"})),qqe={types:{all:"全部类型",document:"文档",image:"图片",video:"视频"},previewArtifact:"预览 {{name}}",moreActions:"更多操作 {{name}}",actionMenu:"{{name}} 操作",download:"下载",downloading:"下载中",edit:"编辑信息",delete:"删除产物",previewFailed:"无法预览“{{name}}”:{{message}}",downloadStarted:"已开始下载 {{name}}",downloadFailed:"无法下载“{{name}}”:{{message}}",updated:"已更新 {{name}}",deleted:"已删除 {{name}}",deleteFailed:"无法删除“{{name}}”:{{message}}",typeFilter:"产物类型",searchAria:"搜索产物",searchPlaceholder:"搜索产物或会话",retry:"重试",close:"关闭",listAria:"产物列表",loadFailed:"产物加载失败",loadDetailFallback:"请检查存储配置后重试。",reload:"重新加载",noMatch:"没有找到匹配的产物",noArtifacts:"您还没有任何产物",searchHint:"请尝试搜索其他名称或切换类型",emptyHint:"聊天中生成的产物会自动显示在这里",columns:{name:"名称",source:"来源",updatedAt:"修改时间",actions:"操作"},loadingMore:"正在加载更多产物",unknownTime:"时间未知",preview:{close:"关闭预览",meta:"{{type}} / 版本 {{version}}",loading:"正在加载预览",alt:"{{name}} 预览",loadFailed:"预览加载失败,请稍后重试或下载查看",unsupported:"当前格式暂不支持在线预览,请下载查看",sourceAria:"产物来源",agent:"智能体",session:"会话",tool:"生成工具",createdAt:"生成时间",fileSize:"文件大小",tags:"标签",viewSession:"查看会话"},deleteDialog:{title:"删除产物?",description:"“{{name}}”将从产物库永久删除,聊天记录不会受到影响。",deleting:"删除中",confirm:"删除",close:"关闭删除确认框"},api:{withStatus:"{{message}}({{status}})",listFailed:"读取产物库失败",syncFailed:"同步聊天产物失败",updateFailed:"更新产物失败",deleteFailed:"删除产物失败",downloadFailed:"下载产物失败"}},jqe={unknownSource:"未知来源",unknownCreator:"未知创建者"},Xqe={nameRequired:"请输入产物名称",tooManyTags:"标签最多 {{max}} 个",tagTooLong:"单个标签不能超过 {{max}} 个字符",title:"编辑产物信息",subtitle:"内容文件不会被修改",close:"关闭编辑框",name:"名称",description:"描述",descriptionPlaceholder:"补充用途、版本或使用说明",tags:"标签",tagsPlaceholder:"使用逗号分隔,最多 {{max}} 个",cancel:"取消",saving:"保存中",save:"保存"},Kqe={change:{added:"新增",modified:"修改",deleted:"删除"},noChanges:"两个版本的源码没有差异",chooseFile:"从左侧选择文件以查看代码",compareTitle:"版本对比",workspaceTitle:"源码工作区",projectFallback:"Agent 项目",switchTheme:"切换源码主题",switchThemeTitle:"切换为{{theme}}主题",themes:{dark:"深色",light:"浅色"},closeWorkspace:"关闭源码工作区",close:"关闭",changedFiles:"变更文件",projectFiles:"项目文件",changes:"变更",files:"文件",openFiles:"打开的文件",noFileSelected:"未选择文件",comparisonDirection:"对比方向",before:"优化前",after:"优化后",loadingEditor:"正在加载编辑器…",changedFileCount_one:"{{count}} 个文件有变更",changedFileCount_other:"{{count}} 个文件有变更",fileCount_one:"{{count}} 个文件",fileCount_other:"{{count}} 个文件",lineCount_one:"{{count}} 行 · UTF-8",lineCount_other:"{{count}} 行 · UTF-8",viewSource:"查看源码",viewSourceAria:"查看和编辑项目源码"},Zqe={nav:"搜索",selectAgent:"请选择 Agent",checkingCapabilities:"正在检测 Agent 能力",notMounted:"当前 Agent 未挂载{{label}}",sources:{session:"会话",web:"网络",knowledge:"知识库",memory:"长期记忆"},webDescription:"通过 web_search 工具检索",backendLocal:"本地",failed:"搜索失败:{{message}}",placeholder:{selectAgent:"请先选择 Agent",web:"在网络中检索",knowledge:"在 {{name}} 中检索",knowledgeFallback:"当前 Agent 的知识库",memory:"在 {{name}} 中检索",memoryFallback:"当前用户的长期记忆",session:"在当前 Agent 的会话中检索"},sourceTypeAria:"搜索类型:{{label}}",notSelected:"未选择",sourceType:"搜索类型",selectSource:"选择搜索类型",noAgentHint:"选择一个 Agent 后,即可检索会话、网络及其挂载的数据源。",loadingCapabilities:"正在读取当前 Agent 的检索能力…",sourceUnavailable:"当前 Agent 未挂载该数据源",instructions:{web:"输入关键词后回车或点击按钮,通过 web_search 工具检索。",knowledge:"输入问题,检索当前 Agent 挂载的知识库。",memory:"输入线索,检索当前用户跨会话保存的长期记忆。",session:"输入关键词后回车或点击按钮,搜索当前 Agent 的会话。"},noResults:"未找到匹配“{{query}}”的结果。",knowledgeFragment:"知识片段 {{index}}",memoryFragment:"记忆片段 {{index}}"},Jqe={title:"开发者资源",sections:{documentation:{title:"相关链接",description:"查看开发文档与 AgentKit 常用入口"},bestPractices:{title:"最佳实践",description:"参考开发、调试与部署经验"},showcases:{title:"案例展示",description:"探索 AgentKit 应用案例"}},links:{veadkDocs:"VeADK 文档",cliDocs:"AgentKit CLI 文档",platformDocs:"AgentKit 平台文档",console:"AgentKit 控制台"},articles:{veadkDevelopment:{title:"使用 VeADK 开发并部署智能体",description:"使用 VeADK 构建 Agent,并部署至 AgentKit 智能体运行时。"},cliDevelopment:{title:"使用 AgentKit CLI 开发并部署智能体",description:"通过 AgentKit CLI 创建项目、调试 Agent,并完成部署。"},coverAlt:"{{title}}文章封面"},showcases:{researchAssistant:{title:"多智能体研究助手",description:"由多个专业 Agent 协同完成资料检索、分析和结论整理。"},multimodalAnalysis:{title:"多模态内容分析",description:"在统一会话中理解图片、文档和视频内容。"},customerService:{title:"智能客服工作台",description:"结合知识检索与工具调用处理复杂的客户服务任务。"},webSearch:{title:"联网搜索 Agent",description:"检索实时网页内容,并将信息整理为可追溯的回答。"},a2uiApp:{title:"A2UI 交互应用",description:"让 Agent 根据任务过程生成可交互的前端界面。"},previewAlt:"{{title}}界面预览"}},eje={title:"资源库",untitledSession:"未命名会话",categoryAria:"资源库分类",regionAria:"区域",tabs:{skills:"技能库",knowledge:"知识库",artifacts:"产物"}},tje={title:"管理 Agent",subtitle:"列出你有权管理的 AgentKit Runtime",mainAgentOnly:"仅显示主 Agent(控制面信息)。",deleteConfirm:'确定删除 Agent "{{name}}"?该 Runtime 将被永久删除。',regionFilterTitle:"按区域筛选",regionFilterAria:"区域筛选",regionAria:"区域",refresh:"刷新",loading:"加载中…",empty:"暂无你部署的 Agent。",connected:"已连接",connect:"连接到此 Agent",deleteRuntime:"删除该 Runtime",loadingDetail:"读取详情…",agentStructure:"Agent 结构",secretHidden:"敏感值不展示,可通过授权请求直接复制",revealSecret:"{{key}} 的敏感值",copySecret:"复制 {{key}} 的值",copy:"复制",copied:"已复制",copyFailed:"复制失败",notConfigured:"未配置",fields:{model:"模型",description:"描述",status:"状态信息",project:"项目",version:"版本",resources:"资源",memory:"记忆",tool:"工具",knowledge:"知识",mcpToolset:"MCP 工具集",updatedAt:"更新时间"},resource:{memory:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",concurrency:"并发 {{value}}"},environmentVariables:"环境变量",unnamed:"(未命名)"},rje={mainAgent:"主 Agent",subAgent:"子 Agent {{index}}",itemCount_one:"{{count}} 项",itemCount_other:"{{count}} 项",info:"Agent 信息",infoAndTopology:"Agent 信息与设置",loadingInfo:"正在读取 Agent 信息…",unnamedAgent:"未命名 Agent",agentsMd:"AGENTS.md",tools:"工具",toolList:"工具列表",studioTool:"Studio Tool",removeTool:"移除工具 {{name}}",remove:"移除",notConfigured:"未配置",addStudioTool:"添加 Studio 工具",addStudioToolHere:"在此对话中添加 Studio 工具",skills:"技能",skillList:"技能列表",addSkill:"添加技能空间技能",addSkillHere:"向此会话添加技能空间技能",skillMountNextTurn:"挂载的版本将在下一 Turn 开始时冻结。",previewUnsupported:"暂不支持预览",sessionEnvironment:"会话环境",environment:"环境",agentCanvas:"Agent 画布",topology:"结构拓扑",nodeKinds:{agent:"Agent",sandbox:"沙箱","worker-session":"Worker 会话","skill-space":"技能空间",skill:"技能","studio-tool":"Studio 工具",mcp:"MCP",environment:"环境",knowledge:"知识库","sub-agent":"子 Agent"},nodeStatuses:{configured:"已配置",mounted:"已挂载",running:"运行中",paused:"已暂停"},viewCanvasFullscreen:"全屏查看 Agent 画布",viewFullscreen:"全屏查看",executionCanvas:"Agent 执行画布",fullscreenExecutionCanvas:"全屏 Agent 执行画布",closeFullscreenCanvas:"关闭全屏画布",close:"关闭",capabilitiesSubtitle:"能力与协作拓扑",closeInfo:"关闭 Agent 信息",infoUnavailable:"暂时无法读取 Agent 信息。",refresh:"刷新信息",loadingSkills:"正在加载绑定技能…",sessionSkills:"本会话临时技能",noBoundSpace:"当前智能体未绑定技能空间。",noBoundSkills:"绑定的技能空间暂无技能。",loadFailed:"加载失败,请刷新重试。",accessDenied:"无权读取此信息。",documentUnsupported:"当前 Runtime 不支持 Studio 读取 AGENTS.md,请升级 Runtime 镜像。",skillsUnsupported:"当前 Runtime 未提供技能空间绑定信息。",skillsDegraded:"技能信息不完整,请刷新重试。",documentEditHint:"编辑最新版本。保存会发布新版本到此技能空间,可能影响使用它的其他智能体。运行中的会话可能需要等待缓存刷新或新建会话后生效。请保留 frontmatter 中的 name。",documentLoading:"正在加载 SKILL.md…",documentWritable:"可编辑",documentReadOnly:"只读:此空间或当前权限不允许编辑",documentLoadFailed:"无法加载 SKILL.md,请刷新重试。",documentSaveFailed:"未确认保存成功,已保留编辑内容。重试前请重新打开,检查当前版本。",documentConflict:"技能已有新版本。请复制当前修改,再重新打开编辑器,避免覆盖。",discardDocument:"放弃未保存的修改?",keepEditing:"继续编辑",discardChanges:"放弃修改",saveDocument:"保存为新版本"},nje={mountFailed:"挂载环境失败",closeDialog:"关闭环境弹窗",addTitle:"添加环境",description:"选择当前会话允许 Agent 使用的 Sandbox 环境",closeAdd:"关闭添加环境",searchAria:"搜索环境",searchPlaceholder:"搜索环境名称或能力",availableAria:"可用环境与工作区",loading:"正在读取可用环境…",noMatch:"没有匹配的环境或工作区",workspaces:"工作区",reuseAll:"复用工作区中的全部可用环境",availableEnvironmentCount_one:"{{count}} 个可用环境",availableEnvironmentCount_other:"{{count}} 个可用环境",selectWorkspace:"选择工作区 {{name}}",environments:"环境",includedByWorkspaces:"已由工作区 {{names}} 包含",nameSeparator:"、",selectEnvironment:"选择环境 {{name}}",selectedWorkspaceCount_one:"{{count}} 个工作区",selectedWorkspaceCount_other:"{{count}} 个工作区",coveredEnvironmentCount_one:"{{count}} 个环境",coveredEnvironmentCount_other:"{{count}} 个环境",selectionSummary:"已选择 {{workspaces}},覆盖 {{environments}}",cancel:"取消",mounting:"正在挂载…",confirm:"确认添加",mountedAria:"已挂载环境",environmentCount_one:"{{count}} 个环境",environmentCount_other:"{{count}} 个环境",removeWorkspace:"移除工作区 {{name}}",remove:"移除",removeEnvironment:"移除环境 {{name}}",add:"添加环境",addMore:"添加更多环境",addForSession:"为当前 Session 添加环境",loadingAvailable:"正在加载可用环境…",empty:"暂无可用的 AIO Sandbox 环境。"},ije={loading:{searching:"正在查找已有环境",creating:"环境初始化中",connecting:"正在连接已有环境"},initializationFailed:"AgentKit CLI 环境初始化失败,当前状态:{{status}}。",sessionExpired:"AgentKit CLI Session 不存在或已过期,请重试。",initializationTimeout:"AgentKit CLI 环境初始化超时,请稍后重试。",nonPersistent:"非持久化环境",recyclingHoursMinutes:"{{hours}} 小时 {{minutes}} 分钟后环境回收",recyclingMinutes:"{{minutes}} 分钟后环境回收",connectionError:`无法连接 Studio 服务,未收到服务端响应。 +{{value}}`,original:"原始错误:{{message}}",details:"详细信息"},uYe={ariaLabel:"Skill 文件树",viewSource:"查看源码",viewPreview:"查看预览",download:"下载",binaryFile:"二进制文件",bytes:"{{value}} 字节",binaryDescription:"当前接口仅返回文件元数据,可单独下载原文件。",metadata:"Skill 元数据",noFiles:"暂无文件"},dYe={close:"关闭",name:"名称",region:"地域",optionalDescription:"描述(可选)",cancel:"取消",create:"创建",creating:"创建中…",save:"保存",saving:"保存中…",upload:"上传",uploading:"上传中…",createSpaceTitle:"新建 Skill 空间",editSpaceTitle:"编辑 Skill 空间",uploadTitle:"上传到 {{name}}",createSpaceFailed:"创建 Skill 空间失败",updateSpaceFailed:"更新 Skill 空间失败",archiveValidationFailed:"Skill ZIP 格式校验失败",uploadFailed:"上传 Skill 失败",dropzone:"拖拽 Skill ZIP 到这里",chooseLocalFile:"或点击选择本地文件",archiveHelp:"ZIP 根目录需要包含 SKILL.md,也可以只包含一层包装目录。选择后仅检查格式,不会自动上传。",validating:"正在检查文件格式…",validationPassed:"格式检查通过:{{name}},共 {{count}} 个文件"},hYe={styles:{concise:"简洁实用",strict:"严谨稳健",tutorial:"教程友好",automation:"自动化优先",custom:"自定义",customFallback:"自定义风格"},stages:{preparing:"正在准备 Dev Sandbox",ready:"Skill 已生成并通过格式校验",failed:"生成失败",cancelled:"已停止",validating:"正在校验 Skill 格式",packaging:"正在整理文件",generating:"正在生成 Skill",repairingAgain:"正在再次修复",autoRepairing:"正在自动修复({{attempt}}/{{max}})"},validation:{fallback:"Skill 格式校验未通过",repairInstruction:"只修复下面列出的 Skill 格式错误,不要改变原有用途和内容范围。",recheckInstruction:"修复后重新检查目录结构、SKILL.md frontmatter 和所有文本文件。",nameTooLong:"Skill 名称不能超过 64 个字符",invalidName:"Skill 名称只能包含小写字母、数字和连字符",modelTooLong:"模型 ID 不能超过 128 个字符",invalidModel:"模型 ID 只能包含字母、数字、点、下划线、连字符、斜杠和冒号"},errors:{loadCapability:"读取 Dev Sandbox 配置失败",autoRepair:"自动修复格式错误失败",pollCandidate:"读取候选方案状态失败,正在重试",createCandidate:"创建候选方案失败",refine:"继续调整失败",repairAgain:"再次修复格式错误失败",selectSpace:"请选择上传的 Skill Space",unsupportedRegion:"当前 Skill 地域不受支持",upload:"上传 Skill 失败",download:"下载失败"},sessionMax:"Session 最长保留 1 小时",remaining:"剩余 {{minutes}}:{{seconds}}",unnamedSpace:"未命名 Skill Space",leaveConfirmation:"离开后将停止并释放正在运行的 Dev Sandbox,确定离开吗?",createTitle:"创建技能",optimizeTitle:"优化 {{name}}",skillFallback:"技能",back:"返回技能空间",home:"主页技能生成",basicInfo:"基本信息",goal:"目标",createIntentPlaceholder:"描述希望这个 Skill 完成什么任务",optimizeIntentPlaceholder:"描述希望如何优化当前 Skill",skillName:"Skill 名称",autoNamePlaceholder:"留空时自动生成",nameHelp:"仅支持小写字母、数字和连字符;留空时自动生成。",createPlans:"生成方案",optimizePlans:"优化方案",createPlansDescription:"按不同方案并行生成多个技能,您可以选择最佳结果",optimizePlansDescription:"按不同方案并行优化当前技能,您可以选择最佳结果",plan:"方案 {{count}}",remove:"移除",model:"模型",modelPlaceholder:"选择或输入模型 ID",style:"风格",customStyle:"自定义风格",customStylePlaceholder:"描述表达方式、严谨程度或输出偏好",addConfiguration:"添加配置",notConfigured:"管理员未配置",generate:"生成",candidates:"候选方案",progress:"进度",retryCandidate:"重试此方案",formatValidationFailed:"格式校验未通过",repairAgain:"再次修复",files:"文件",downloadZip:"下载 ZIP",loadingFiles:"正在读取文件…",filesPending:"生成过程中会在这里显示完整文件树",uploadToSpace:"上传到 Skill Space",loadingSpaces:"正在加载 Skill Space",selectSpace:"选择 Skill Space",continuePlaceholder:"继续调整这个候选方案",continue:"继续调整",uploading:"上传中…",overwrite:"覆盖原 Skill",uploadToSelectedSpace:"上传到 Skill Space",uploadToCurrentSpace:"上传到当前空间",allCandidatesFailed:"所有方案均创建失败,可分别重试。"},fYe={invalidFormat:"{{label}}格式错误。",recoveryStatus:"Skill 恢复点状态",errorResponse:"错误响应",errorDetails:"错误详情",missingContentType:"Content-Type 缺失",gatewayError:"{{fallback}}(HTTP {{status}},Content-Type: {{contentType}})。请检查代理或网关配置。",nonJson:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}},Content-Type: {{contentType}}),请检查代理或网关配置。",activity:"Skill 会话活动",invalidActivity:"Skill 会话活动格式错误。",invalidToolActivity:"Skill 工具活动格式错误。",invalidTextActivity:"Skill 文本活动格式错误。",publication:"Skill 发布结果",task:"Skill 会话",file:"Skill 文件",unknownTaskState:"Skill 会话状态无法识别。",capability:"Skill 工作台能力",loadCapability:"读取 Skill 工作台能力失败",prepareTask:"准备 Skill 会话失败",taskReference:"Skill 会话引用",startOptimization:"开始优化 Skill 失败",startTask:"开始 Skill 会话失败",taskSummary:"Skill 会话摘要",taskList:"Skill 会话列表",loadTaskList:"读取 Skill 会话列表失败",invalidTaskList:"Skill 会话列表格式错误。",loadTask:"读取 Skill 会话失败",artifact:"Skill 产物",artifactFile:"Skill 产物文件",loadArtifact:"读取 Skill 产物失败",refine:"继续调整 Skill 失败",stop:"停止当前 Skill 任务失败",publish:"发布 Skill 失败",nonNdjson:"发布 Skill 失败:服务端返回了非 NDJSON 响应。",missingStream:"发布 Skill 失败:服务端没有返回进度流。",publishProgress:"发布进度",invalidPublishProgress:"发布进度格式错误。",publishError:"发布错误",unknownPublishEvent:"未知的发布进度事件。",publishResult:"发布结果",streamEnded:"发布进度流提前结束,无法确认发布结果。请刷新技能中心确认状态。",deleteTask:"删除 Skill 会话失败",download:"下载 Skill 失败"},Pdr=Object.freeze(Object.defineProperty({__proto__:null,api:fYe,configSelect:sYe,conversation:lYe,default:{configSelect:sYe,conversation:lYe,errorDetails:cYe,fileTree:uYe,management:dYe,generation:hYe,api:fYe},errorDetails:cYe,fileTree:uYe,generation:hYe,management:dYe},Symbol.toStringTag,{value:"Module"})),pYe={back:"返回上一页",reload:"重新加载",notConfigured:"未配置",name:"名称",description:"描述",delete:"删除",save:"保存",saving:"保存中",add:"添加",manage:"管理",environment:"环境",noDescription:"暂无描述",refresh:"刷新",close:"关闭",retry:"重试",loading:"加载中…",previousPage:"上一页",nextPage:"下一页",edit:"编辑",all:"全部",search:"搜索",cancel:"取消",view:"查看",viewDetails:"查看详情",deleting:"删除中…",create:"创建",creating:"创建中",adding:"添加中",generating:"生成中",uploading:"上传中",preview:"预览",loadFailed:"加载失败",select:"选择",collapse:"收起",expand:"展开",none:"无"},gYe={ariaLabel:"AgentKit 快速入口",closeAriaLabel:"关闭 AgentKit 欢迎卡片",title:"欢迎使用 AgentKit",description:"通过 AgentKit 平台快速构建与托管您的企业级智能体",docsAriaLabel:"打开 AgentKit 文档,在新窗口打开",docs:"文档",consoleAriaLabel:"打开 AgentKit 控制台,在新窗口打开",console:"控制台"},mYe={checkUpdates:"检查更新",checkingVersions:"正在检查版本…",versionCheckError:"查询沙箱版本失败,请检查凭据、区域及接口权限后重试",sandboxUpdateError:"Sandbox 更新失败,请刷新检查实际状态后重试",modelEnvRepairUnavailable:"无法补齐模型环境变量,请检查 CODEX_API_KEY 和 CODEX_BASE_URL",updateSandbox:"更新{{variant}}{{name}}",updatingSandbox:"更新中",title:"系统信息",description:"查看当前 Studio 版本及关联的基础资源",general:"通用",currentVersion:"当前版本",storage:"存储",loadingStorage:"正在加载存储信息",tosAddress:"TOS 地址",openTosConsole:"在云控制台中打开 TOS 存储桶",environmentBuild:"环境构建",loadingEnvironmentResources:"正在加载环境构建资源",environmentResourcesError:"环境构建资源加载失败,请检查云凭据后重试。",codePipelineWorkspace:"CodePipeline 工作空间",codePipelinePipeline:"CodePipeline 流水线",openCodePipelineWorkspace:"在云控制台中打开 CodePipeline Workspace",createdOnFirstBuild:"首次构建时自动创建",containerRegistryRepository:"Container Registry 仓库",openContainerRegistryRepository:"在云控制台中打开 Container Registry 仓库",sandboxInfo:"沙箱信息",loadingSandboxInfo:"正在加载沙箱信息",sandboxInfoError:"沙箱信息加载失败,请重试。",snapshot:"快照版",snapshotWithSpace:"快照版 ",openToolConsole:"在云控制台中打开{{name}}",updateModelEnv:"更新{{variant}}{{name}}模型环境变量",modelEnvUpdated:"已更新",modelEnvAlreadyCurrent:"无需更新",userPool:"用户池",loadingUserPool:"正在加载用户池",userPoolError:"用户池加载失败,请重试。",modelEnvUpdateError:"模型环境变量更新失败,请重试。",openUserPoolConsole:"在云控制台中打开用户池{{name}}",unnamedUserPool:"未命名用户池",id:"ID",domain:"域名",region:"区域",noLocalUserPool:"本地模式未配置用户池",noUserPool:"当前 Studio 未配置用户池"},vYe={workspace:"Agent 工作区",library:"Agent 库",evaluation:"评测",agentList:"Agent 列表",agentDetails:"Agent 详情",newAgent:"新建 Agent",loading:"加载中…",loadingCloudAgents:"正在加载云端 Agent…",noAgentSelected:"请选择一个 Agent",local:"本地",remote:"云端",localAgent:"本地 Agent",remoteAgent:"云端 Agent",agentCount:"{{count}} 个 Agent",agentCountLabel:"Agent 数量",details:"详情",chat:"对话",update:"更新",backToAgentList:"返回 Agent 列表",loadingAgent:"正在加载 Agent",loadingAgentDescription:"正在读取 Agent 配置和 Runtime 信息。",loadingAgentInfo:"正在加载 Agent 信息…",detailLoadFailed:"无法加载 Agent 详情",detailLoadFailedDescription:"请检查 Runtime 状态后重试。",partialInfoUnavailable:"部分信息暂时不可用",upgradeRuntimeForDetails:"请升级 Runtime 以查看完整 Agent 信息。",basicInfo:"基本信息",usageOverview:"使用概览",sections:{basic:"基本信息",profileConfig:"Profile 配置",sessionConfig:"会话配置",usage:"使用概览",diagnostics:"诊断",evaluations:"评测",optimizations:"优化建议",integrations:"集成",versions:"版本",channels:"消息渠道"},evaluationGroup:"评测组",optimizations:"优化建议",optimizationsDescription:"根据评测结果查看可执行的优化建议。",integrations:"集成",githubVersions:"GitHub 版本",githubVersionsDescription:"查看持续交付产生的版本并创建回退 PR。",currentVersionOnly:"当前未启用 GitHub 持续交付,仅展示当前生产版本。",loadingVersions:"正在加载版本…",noVersion:"暂无版本记录",prLink:"Pull Request",viewPr:"查看 PR",author:"提交人",publishStatus:"发布状态",viewRelease:"查看发布记录",rollbackToVersion:"回退到此版本",rollingBack:"正在创建回退…",rollbackEvent:"回退事件",sourceMergedRuntimeStill:"最新源码已合并,但 Runtime 仍处于",currentProductionVersionHint:";当前生产版本保持不变。",usageSummary:"使用统计",totalCalls:"总调用次数",userCount:"用户数",userDetails:"用户明细",usageUserList:"Agent 使用用户列表",user:"用户",callCount:"调用次数",lastUsed:"最近使用",unknownUser:"未知用户",loadingUsage:"正在加载使用数据…",refreshing:"刷新中…",noUsage:"暂无使用记录",usageUnavailable:"当前 Agent 暂无可用的使用统计。",usagePagination:"使用记录分页",pageOf:"第 {{page}} / {{total}} 页",notProvided:"暂未提供",integrationMethods:"集成方式",integrationDescription:"通过 Runtime API 或 A2A 协议集成当前 Agent。",integrationProtocol:"集成协议",runtimeStatus:"Runtime 状态",executionFlow:"执行流程",probingIntegration:"正在检测集成能力",probingIntegrationDescription:"正在读取可用端点和鉴权配置。",configurationStatus:"配置状态",discoveryEndpoint:"发现端点",invocationEndpoint:"调用端点",invocationUrl:"调用地址",authentication:"鉴权方式",networkAccess:"网络访问",notAvailable:"暂无",noAuthentication:"无需鉴权",noApiKeyRequired:"无需 API Key",usesOauthJwt:"使用 OAuth / JWT",showApiKey:"显示 API Key",hideApiKey:"隐藏 API Key",pythonExample:"Python 示例",deploymentConfig:"部署配置",deploymentConfigDescription:"确认实例和运行配置后更新 Runtime。",deploymentRegion:"部署区域",mpaControlPlane:"MPA 控制面",loadingMpaAgentView:"正在读取 MPA Runtime 绑定…",mpaRuntimeBound:"该 MPA Agent 已绑定唯一 Runtime,可继续管理。",mpaRuntimeMissing:"当前 Agent 没有可见的 MPA Runtime 绑定。",mpaRuntimeBindingAmbiguous:"多个 MPA Runtime 匹配当前 Agent,请先修复绑定后再修改。",mpaRuntimeOrphan:"Runtime 存在,但其中没有当前 MPA Profile。",mpaRuntimeLegacyAuthUnsupported:"该 Runtime 使用旧版 MPA 镜像,仍要求 X-Jwt-Token。请先更新到当前 AgentKit 兼容镜像,再管理 Profile 或 Session 配置。",profileConfig:"Profile 配置",profileConfigTitle:"Profile 配置",profileConfigDescription:"查看并应用 Agent 级 MPA Profile。Profile 是 Runtime 的长期默认配置,新会话默认继承它。",profileStatus:"Profile 状态",profileApplied:"已应用",profileNotApplied:"未应用",profileNotAppliedDescription:"当前 Runtime 可运行,但尚未保存为 Studio 可管理的 Profile。应用后会生成 Profile revision。",applyProfile:"应用 Profile",reapplyProfile:"重新应用 Profile",editProfile:"编辑 Profile",profileApplying:"应用中…",profileAppliedNotice:"Profile 已应用,当前 revision 为 {{revision}}。",profileApplyIncomplete:"Profile 应用未完成,请查看当前操作状态后重试。",profileApplyFailed:"Profile 应用失败。",profilePrompt:"系统提示词",profileResources:"资源配置",profileResourceSummary:"{{tools}} 个工具 · {{skills}} 个 Skill · {{mcp}} 个 MCP 服务",sessionConfigTitle:"会话配置",sessionConfigDescription:"查看和调整当前 MPA Session 的执行配置。变更只对下一轮对话生效。",loadingSessionConfig:"正在加载会话配置…",sessionConfigNoAgent:"请选择一个 MPA Agent 后再管理会话配置。",sessionConfigNonMpa:"会话配置仅适用于 MPA Agent。",sessionConfigNoSession:"请先打开这个 MPA Agent 的对话,再修改会话配置。",sessionConfigDifferentRuntime:"请先切回这个 MPA Agent 的当前对话,再修改会话配置。",sessionConfigSaved:"会话配置已更新,下一轮对话将使用新 revision。",sessionConfigStale:"该 Session 已被其他位置修改,已展示最新配置,请确认后再保存。",sessionConfigRevision:"配置 revision",sessionProfileRevision:"Session Profile revision",latestProfileRevision:"最新 Profile revision",sessionProfileUpgradeAvailable:"检测到新的 Profile revision:v{{current}} → v{{target}}。",upgradeSessionProfile:"升级 Session Profile",sessionProfileUpgrading:"升级中…",sessionProfileUpgraded:"Session Profile 已升级,下一轮对话将使用新 revision。",sessionProfileUpgradeFailed:"Session Profile 升级失败。",sessionModelOverride:"模型覆盖",modelId:"模型 ID",inheritProfileDefault:"继承 Profile 默认值",sessionMcpServers:"MCP 服务",mcpServerCount:"已选择 {{count}} 个",clearSessionMcp:"清空 MCP 服务",mpaDiagnosticsTitle:"Runtime 诊断",mpaDiagnosticsDescription:"查看最近的 Runtime Console 运行记录,以及 Agent、Profile、Turn、task 和 worker 关联。",loadingMpaDiagnostics:"正在加载 Runtime 诊断…",noMpaDiagnostics:"当前 Session 暂无 Runtime 诊断运行记录。",latestRun:"最近运行",traceCorrelation:"Trace 关联",traceCorrelationDescription:"Runtime Console 为本次 invocation 返回的稳定标识。",traceSteps:"Trace 步骤",traceStepsDescription:"当前 invocation 最近的有界 Runtime Console 步骤。",mpaInstanceId:"MPA 实例",turnId:"Turn ID",taskId:"Task ID",workerKind:"Worker 类型",workerSession:"Worker Session",workerTurn:"Worker Turn",workerProfile:"Worker Profile",workerProfileVersion:"Worker Profile 版本",step:"步骤",stepCount:"步骤数",duration:"耗时",noTraceSteps:"本次 invocation 暂无 trace 步骤。",executionConfigMode:{replace:"Session 覆盖",clear:"本 Session 已清空",inherit:"使用 Profile 默认值"},concurrency:"并发数",selectedOptimizations:"已选优化项",selectedOptimizationsDescription:"这些优化会应用到本次更新。",optimizationProfile:"优化方案",updatePending:"等待更新",updatingDeployment:"正在更新部署",restoringUpdateConfig:"正在恢复更新配置…",updateConfigUnavailable:"无法读取更新配置",legacyConfigMissing:"旧版本 Runtime 缺少可恢复的配置,请重新创建。",deploymentFailed:"部署失败",continueEditing:"继续编辑",loadingOptimizations:"正在加载优化建议…",noOptimizations:"暂无优化建议",fixPriority:"优先级",suggestedModule:"建议模块",suggestionAndReason:"建议与原因",priority:{high:"高",medium:"中",low:"低"},modules:{agentStructure:"Agent 结构",prompt:"提示词",tool:"工具",knowledge:"知识库",memory:"记忆",workflow:"工作流",other:"其他"},evaluationGroupList:"评测组列表",newEvaluationGroup:"新建评测组",newEvaluationGroupName:"新评测组 {{count}}",searchEvaluationGroups:"搜索评测组",noMatchingEvaluationGroups:"没有匹配的评测组",noEvaluationGroupSelected:"请选择一个评测组",groupStats:"{{agents}} 个 Agent · {{runs}} 次运行",evaluationGroupDetails:"评测组详情",evaluationGroupStats:"{{agents}} 个 Agent · {{caseSet}} · {{runs}} 次运行",startEvaluation:"开始评测",evaluationConfig:"评测配置",historyResults:"历史结果",participatingAgents:"参与 Agent",selectedCount:"已选择 {{count}} 个",evaluationResources:"评测资源",evaluationSet:"评测集",evaluator:"评估器",caseCount:"{{count}} 条案例",evaluationMetrics:"评测指标",selectedMetricCount:"已选择 {{count}} 项",historyDescription:"查看每次评测的分数和运行状态。",noHistory:"暂无评测历史",noHistoryDescription:"运行一次评测后,结果会显示在这里。",evaluationRun:"第 {{index}} 次评测",evaluationRunMeta:"{{time}} · {{agents}} 个 Agent",overallScore:"综合分",completed:"已完成",evaluationDefaults:{coreRegression:"核心能力回归",safetyCheck:"安全与幻觉检查",coreSet:"核心回归集",safetySet:"安全边界集",toolSet:"工具调用集",qualityEvaluator:"综合质量评估器",factualEvaluator:"事实一致性评估器",toolEvaluator:"工具调用评估器",responseQuality:"回答质量",factualAccuracy:"事实准确性",toolUse:"工具调用",responseEfficiency:"响应效率",todayTime:"今天 10:32",yesterdayTime:"昨天 16:08",julyTime:"7 月 25 日 14:20",justNow:"刚刚"},defaultCases:{agentName:"示例 Agent",goodSetName:"示例正向案例集",badSetName:"示例负向案例集",weeklyFeedback:{input:"总结本周客户反馈,并按优先级归类。",output:"覆盖主要问题,给出清晰的优先级与下一步动作。",tag:"总结",reason:"任务完整覆盖了用户目标,输出结构清晰,并给出了可执行的下一步动作。"},research:{input:"查询最新公开资料并附上来源。",output:"调用搜索工具,结论与引用一一对应。",tag:"工具调用"},uncertainConclusion:{input:"在信息不足时直接给出确定结论。",output:"应明确说明未知,并主动询问缺失信息。",tag:"幻觉",reason:"信息不足时仍给出了确定结论,缺少必要的澄清步骤与不确定性说明。"},repeatedTool:{input:"连续重复调用相同工具获取同一结果。",output:"复用已有结果,避免无意义的重复调用。",tag:"效率"}},goodCases:"正向案例",badCases:"负向案例",goodCase:"正向案例",badCase:"负向案例",reference:"参考答案",caseResultFilter:"案例结果筛选",feedbackSourceFilter:"反馈来源筛选",searchCases:"搜索案例",searchCasesPlaceholder:"搜索输入、输出或标签",selectCases:"选择案例",selectAll:"全选",selectAllVisible:"选择当前可见案例",selectedCaseCount:"已选择 {{count}} 条",deleteSelected:"删除所选",deleteSelectedTitle:"删除所选 Agent",deleteSelectionDescription:"确定删除所选的 {{count}} 个项目吗?此操作无法撤销。",deleteCasesConfirm:"删除所选案例",deleteOneCaseConfirm:"删除这个案例",deleteFeedbackCase:"删除反馈案例",noFeedbackCases:"暂无反馈案例",noMatchingCases:"没有匹配的案例",loadingEvaluationSet:"正在加载评测集…",userInput:"用户输入",agentOutput:"Agent 输出",score:"得分",scoreReason:"评分原因",noUserInput:"暂无用户输入",noVisibleResponse:"暂无可见回复",note:"备注:",manualFeedback:"人工反馈",automaticFeedback:"自动反馈",scoreValue:"{{score}} 分",unknownTime:"时间未知",deleteAgentTitle:"删除 Agent",deleteAgentDescription:"确定删除 Agent“{{name}}”吗?",deleteDraftDescription:"确定删除草稿“{{name}}”吗?",deleteAgent:"删除 Agent",closeDeleteConfirmation:"关闭删除确认",mpaDeletePreviewSummary:"Studio 会先删除可见的空闲 MPA Runtime 会话,再删除 AgentKit Runtime。运行中的任务需要先结束或停止后才能删除。",mpaDeletePreviewSessions:"会话",mpaDeletePreviewActiveSessions:"运行中",mpaDeletePreviewIdleSessions:"空闲",mpaDeleteBlocked:"当前无法删除",mpaDeleteBlockerActiveOperation:"仍有 MPA 创建或更新操作在执行。",mpaDeleteBlockerActiveSessions:"Runtime 中仍有运行中的会话。",mpaDeleteBlockerBindingAmbiguous:"当前 Agent 匹配到多个 MPA Runtime。",mpaDeleteBlockerRuntimeMissing:"当前 MPA Agent 没有可见的 Runtime 绑定。",mpaDeleteBlockerOrphanRuntime:"Runtime 可见,但其中缺少当前 MPA Profile。",mpaDeleteStage:{runtime_sessions:"删除 {{count}} 个可见空闲 Runtime 会话",runtime_diagnostics:"清理这些会话关联的诊断数据和挂载元信息",agentkit_runtime:"删除 AgentKit Runtime"},draftDeletionWarning:"草稿将从当前浏览器中删除。",runtimeDeletionWarning:"Runtime 和相关云端资源将被删除。",noneSelected:"尚未选择",none:"无",notPublished:"未发布",notRecorded:"未记录",noTime:"暂无时间",noPr:"暂无 PR",comingSoon:"评测能力即将开放",preparing:"准备中",cancelled:"已取消",failed:"失败",totalCount:"共 {{count}} 条",deploymentProgress:"部署进度",returnToEdit:"返回编辑",retryOperation:"重试操作",buildLog:"构建日志",githubMountLog:"GitHub 挂载日志",githubDeliveryMountLog:"GitHub 持续交付挂载日志",waitingBuildLog:"正在等待构建日志…",waitingGithubMountLog:"正在等待 GitHub 挂载日志…",copy:"复制",copied:"已复制",copyLabel:"复制{{label}}",copiedLabel:"已复制{{label}}",logLines:"{{count}} 行",logStatus:{synced:"已同步",failed:"读取失败",syncing:"同步中",earlyOmitted:"已省略早期日志",recentOnly:"仅显示最近的构建日志",partiallyOmitted:"已省略部分日志"},deployStatus:{running:"正在部署",unconfirmed:"部署状态待确认",success:"部署完成",error:"部署失败",cancelled:"部署已取消"},deploymentSteps:{prepare:{label:"准备部署",description:"校验配置并创建部署任务"},build:{label:"构建镜像",description:"生成运行环境与智能体代码"},deploy:{label:"部署服务",description:"创建并启动 AgentKit Runtime"},publish:{label:"发布服务",description:"等待服务就绪并生成访问地址"},complete:{label:"部署完成",description:"智能体已可以正常使用"},evaluation:{label:"创建评测集",description:"自动创建 Good Case 和 Bad Case 评测集"},profileApplying:{label:"应用 MPA 配置",description:"将 Studio Agent 配置写入 MPA Runtime"},smokeRunning:{label:"验证 MPA Runtime",description:"在标记可运行前执行 Runtime 就绪验证"},runnable:{label:"MPA Runtime 可运行",description:"Runtime 已接受配置并通过执行就绪验证"},github:{label:"挂载 GitHub 持续交付",description:"初始化目标分支与 GitHub Actions workflow"},update:{label:"更新实例配置",description:"将 Runtime 实例数调整为 {{min}}~{{max}}"}},githubStatus:{published:"已发布",publishing:"发布中",failed:"发布失败",pending:"等待发布",unknown:"未知"},errors:{agentInfoMissing:"Agent 信息不可用",checkUpdateCapability:"无法检查更新能力",checkingUpdateConfig:"正在检查更新配置",cloudOnlyUpdate:"仅云端 Agent 支持更新",deleteDeployedUnsupported:"当前不支持删除已部署 Agent",deleteDraftUnsupported:"当前不支持删除草稿",loadMpaDeletePreview:"无法加载 MPA 删除预览",loadAgentInfo:"无法加载 Agent 信息",loadApiKey:"无法读取 API Key",loadGithubVersions:"无法加载 GitHub 版本",loadEvaluations:"无法加载评测案例",loadMpaAgentView:"无法加载 MPA Agent 状态",loadMpaDiagnostics:"无法加载 Runtime 诊断",loadOptimizations:"无法加载优化建议",loadRuntimeDetails:"无法加载 Runtime 详情",loadSessionConfig:"无法加载会话配置",loadUsage:"无法加载使用数据",noCreatePermission:"当前账号没有创建 Agent 的权限",noManagePermission:"当前账号没有管理此 Agent 的权限",originalConfigUnavailable:"原始配置不可用",probeIntegration:"无法检测集成能力",rollbackVersion:"无法创建版本回退",runtimeRegionMissing:"Runtime 区域信息缺失",updateCapabilityMismatch:"Runtime 更新能力与当前配置不匹配",updateCapabilityPending:"Runtime 更新能力仍在确认中",updateConfigRestoring:"正在恢复更新配置",updateUnsupported:"当前 Runtime 不支持更新",usageMismatch:"返回的使用数据与当前 Agent 不匹配"}},yYe={title:"环境",loadFailed:"环境加载失败,请检查存储配置后重试。",storageUnavailable:"管理员未配置持久化存储,环境管理暂不可用。",create:"新建环境",configure:"配置环境",details:"环境详情",editorDescription:"配置运行环境,或接入代码仓库和已有镜像",backToList:"返回环境列表",save:"保存环境",createAndBuild:"创建并构建",saveAndBuild:"保存并构建",name:"环境名称",namePlaceholder:"Python 数据处理",descriptionPlaceholder:"说明这个环境适合处理的任务",creationMethod:"创建方式",baseConfiguration:"基础配置",baseEnvironment:"基础环境",operatingSystem:"操作系统",pythonVersion:"Python 版本",fixedByBase:"由 {{base}} 固定为 {{value}}",selectUbuntuVersion:"选择基础镜像的 Ubuntu 版本",selectPythonVersion:"选择需要安装的 Python 版本",skills:"技能",addSkill:"添加环境技能",veadkDescription:"Agent 开发与运行框架",customDockerfile:"自定义 Dockerfile",presetEnvironment:"预制环境",presetHint:"选择“无”可自行填写 Dockerfile 第一行的基础镜像。",dockerfileSize:"{{size}} / {{max}} 字节",upload:"上传",reset:"重置",dockerfileBaseImage:"Dockerfile 基础镜像",dockerfileContent:"Dockerfile 内容",region:"区域",search:"搜索环境",manualImport:"手动导入",noMatches:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称",startBuild:"开始构建",build:"构建",unnamed:"未命名环境",listSeparator:"、",clipboardReadError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。",creation:{custom:{label:"自定义配置",description:"通过表单选择基础环境、Python、工具和技能"},dockerfile:{label:"自定义 Dockerfile",description:"上传或直接编辑 Dockerfile"},git:{label:"从代码仓库构建",description:"探查公开仓库并通过 CodePipeline 构建"},image:{label:"使用已有镜像",description:"绑定由外部流水线交付的 CR 镜像"}},baseDescriptions:{"aio-sandbox":"内置 Sandbox Shell 能力 · Ubuntu 22.04","codex-sandbox":"内置 Codex CLI、浏览器与代码执行环境",ubuntu:"标准 Linux 基础镜像"},dockerfileValidation:{baseImageRequired:"请填写基础镜像。",duplicateFrom:"基础镜像已固定在第一行,请删除 Dockerfile 正文中的 FROM 指令。",tooLarge:"Dockerfile 不能超过 128 KiB。",empty:"Dockerfile 内容不能为空。",missingFrom:"Dockerfile 缺少 FROM 指令。"},presets:{none:"自行填写 Dockerfile 基础镜像",aio:"内置 Sandbox Shell 与常用运行时",codex:"内置 Codex CLI、浏览器与代码执行环境"},categories:{tools:"工具",productivity:"效率",browser:"浏览器自动化",system:"系统与媒体"},options:{"lark-cli":"飞书开放平台命令行工具",pandoc:"文档格式转换工具",opencli:"将网站与桌面应用转换为命令行工具",uv:"快速 Python 包与项目管理器",ripgrep:"高性能文本检索工具",jq:"JSON 查询与转换工具","github-cli":"在终端中管理 GitHub 工作流",playwright:"浏览器自动化与端到端测试",chromium:"无头浏览器运行时",git:"代码版本管理",curl:"网络请求与文件下载",ffmpeg:"音视频转码与处理",imagemagick:"图片转换与批处理"},duration:{seconds:"{{count}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",hoursMinutes:"{{hours}} 小时 {{minutes}} 分"},buildStatus:{preparing:"准备中",queued:"排队中",building:"构建中",scanning:"扫描中",available:"可用",failed:"构建失败",notBuilt:"未构建"},manifest:{title:"环境 Manifest",closeLabel:"关闭环境 Manifest",loading:"正在加载 Manifest",editorLabel:"环境 Manifest YAML",copyFailed:"复制失败,请重试",copied:"已复制",copy:"复制 Manifest",view:"查看环境 Manifest",viewShort:"查看 Manifest",unavailable:"尚无可用 Manifest"},buildDetails:{title:"构建详情",closeLabel:"关闭构建详情",currentStep:"当前步骤",waiting:"等待构建信息",elapsed:"已用时",sourceCommit:"源码提交",openCodePipeline:"在 CodePipeline 中查看",starting:"正在启动",rebuild:"重新构建"},git:{sectionLabel:"公开代码仓库",address:"Git 地址",ref:"Branch、Tag 或 Commit",defaultBranch:"默认分支",inspecting:"正在拉取仓库并查找 Dockerfile",foundDockerfiles:"已在提交 {{commit}} 中找到 {{count}} 个 Dockerfile。",savedDockerfileLoaded:"已载入保存的 Dockerfile,可重新探查仓库更新。",noDockerfile:"仓库中未找到 Dockerfile,请检查分支或仓库内容。",inspectAgain:"重新探查",selectDockerfile:"选择 Dockerfile"},repository:{outputSection:"构建输出",type:"镜像仓库类型",managed:"Studio 默认镜像仓库",existing:"已有镜像仓库",managedHint:"构建时自动创建或复用当前区域的 Studio 镜像仓库。"},existingImage:{sectionLabel:"已有镜像",reference:"Tag 或 Digest",placeholder:"latest 或 sha256:...",hint:"填写镜像 Tag,或以 sha256: 开头的完整 Digest。"},share:{action:"分享",title:"分享环境",closeLabel:"关闭分享环境",generating:"正在生成并复制分享码",copied:"分享码已复制",failed:"分享失败",code:"分享码",fullCode:"完整环境分享码",copiedHint:"分享码已自动复制,也可在这里查看或手动复制。",copyFailedHint:"自动复制失败,可手动复制上方分享码,或重试。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅发送给可信对象。",copyAgain:"再次复制"},import:{title:"导入环境",closeLabel:"关闭导入环境",description:"先检测分享码中的环境,再确认添加到当前账号。",code:"环境分享码",tooMany:"最多可一次导入 {{max}} 个环境,当前检测到 {{count}} 个分享码。",multipleHint:"多个分享码可使用英文逗号、中文逗号或换行分隔,重复项会自动忽略。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅导入可信来源的分享码。",inspectingCodes:"正在检测环境分享码",found:"检测到 {{count}} 个环境:{{names}}。",itemError:"第 {{index}} 个分享码:{{error}}",invalidCode:"分享码无效。",noResult:"服务未返回该分享码的导入结果。",partial:"已导入 {{created}} 个环境,{{remaining}} 个未完成,可重试有效失败项。",inspecting:"正在检测",importing:"正在导入",retryImport:"重试导入",confirm:"确认导入",inspectCodes:"检测分享码"},status:{boundImage:"环境“{{name}}”已绑定已有镜像",queued:"环境“{{name}}”已进入构建队列",savedBuildFailed:"环境已保存,但构建未启动:{{error}}",importedFailed:"已导入 {{created}} 个环境,{{failed}} 个失败",importedDuplicate:"已导入 {{created}} 个环境,{{duplicate}} 个分享码已存在",imported:"已导入 {{count}} 个环境",deleted:"已删除环境“{{name}}”"},deleteTitle:"删除环境",deleteDescription:"确定删除环境“{{name}}”吗?删除后无法恢复。",errors:{repositoryRequired:"请输入公开代码仓库地址。",repositoryHttps:"请输入公开仓库的 HTTPS 地址。",repositoryInvalid:"请输入有效的公开仓库 HTTPS 地址。",imageReferenceWhitespace:"Tag 或 Digest 不能包含空格。",imageDigestInvalid:"Digest 必须是完整的 sha256 值。",imageTagOnly:"这里只填写 Tag,不要重复填写镜像仓库路径。"}},bYe={searchPlaceholder:"搜索资源名称",emptyMessage:"暂无可用选项",searchAriaLabel:"搜索{{label}}",loadingMore:"正在加载更多资源…"},xYe={retryDeployment:"重试部署",retrying:"正在重试…",collapse:"收起错误信息",expand:"展开完整错误信息",copy:"复制完整错误信息"},wYe={steps:"构建步骤",log:"构建日志",syncing:"同步中",loadFailed:"读取失败",synced:"已同步",recentOnly:" · 仅显示最近日志",copiedLog:"已复制构建日志",copyLog:"复制构建日志",copied:"已复制",copy:"复制",logContent:"构建日志内容",waiting:"正在等待 CodePipeline 输出日志…",empty:"暂无构建日志"},AYe={defaultLabel:"Studio 默认环境",defaultDescription:"使用 Studio 预置的标准运行环境",status:{notBuilt:"未构建",preparing:"准备中",queued:"排队中",building:"构建中",scanning:"扫描中",available:"可用",failed:"失败"},label:"运行环境",placeholder:"请选择运行环境",search:"搜索运行环境",loading:"正在加载运行环境…",loadFailed:"加载运行环境失败",noMatches:"未找到匹配的运行环境",unavailable:"当前没有可用的运行环境",selectionUnavailable:"所选运行环境当前不可用,请重新选择。",selectionHint:"选择构建完成的运行环境后,部署将使用其镜像和工具配置。",versionChanged:"所选环境版本已更新,请确认后继续。",versionMissing:"所选环境版本已不存在,请重新选择。",operatingSystem:"操作系统",language:"语言",image:"镜像",imageVersion:"镜像版本",skills:"技能",tools:"工具",noSkills:"未配置 Skill",noExtraTools:"未配置额外工具",defaultGuidance:"默认环境由 Studio 管理,无需额外配置。",persistenceFallback:"持久化环境服务暂不可用,当前使用默认环境。",emptyFallback:"当前没有可选择的自定义环境。"},SYe={repository:"GitHub 仓库",githubUrl:"GitHub 地址",token:"访问令牌",sessionToken:"{{provider}} 临时令牌",runtime:"Runtime",commit:"提交",workflow:"工作流",syncFailed:"同步 GitHub 代码失败",status:{mounted:"已挂载",bound:"已绑定",synced:"已同步",created:"已创建"},volcengine:"火山引擎",mountDelivery:"挂载持续交付",selectedForDeployment:"已选择,部署时挂载",mountOnDeploy:"部署时挂载持续交付",syncCode:"同步代码",deliveryMode:"GitHub 交付模式",sourceSync:"GitHub 代码同步",delivery:"GitHub 交付",loading:"读取中",running:"执行中",runtimeDeliveryHint:"写入 AgentKit Runtime GitHub Actions workflow,后续 GitHub 提交会更新绑定 Runtime。",initialDeliveryHint:"首次部署成功后初始化目标分支,后续 GitHub 提交会更新绑定 Runtime。",sourceSyncHint:"Studio 会直接 push 到目标分支;该分支由 Studio 管理,远端冲突时同步会失败。Runtime 仍由部署按钮发布。",tokenPlaceholder:"repo 或 contents write 权限",getToken:"获取 Token",hideToken:"隐藏 Token",showToken:"显示 Token",tokenHelp:"Token 仅用于本次操作,成功后不会保留在表单中。",targetBranch:"目标分支",actionsSecretPlaceholder:"用于写入 GitHub Actions Secret",sessionTokenPlaceholder:"临时凭证可选",syncing:"同步中…",pendingHint:"已选择挂载持续交付。点击部署后,Studio 会等待 Runtime 创建完成并初始化 GitHub 目标分支,初始化成功后才完成部署流程。",result:{deliveryMounted:"已挂载持续交付",deliverySelected:"已选择挂载持续交付",githubBound:"已绑定 GitHub",codeSynced:"代码已同步",deliveryHint:"目标分支提交会触发 Runtime 持续交付。",boundHint:"更新并发布时会先同步当前源码到这个分支。"},branch:"分支",viewPr:"查看 PR",createFailed:"创建失败",phase:"阶段",log:"日志"},TYe={name:"飞书",enabling:"正在启用并更新配置…",description:"接收消息并通过飞书机器人回复",configuration:"飞书配置",configurationMode:"飞书配置方式",automatic:"自动配置",manual:"手动配置",cancelling:"取消中…",scanToCreate:"扫码创建",scanDescription:"授权后自动回填凭据",generateQrCode:"生成二维码",qrCodeAlt:"飞书机器人配置二维码",scanToConfirm:"飞书扫码确认",expiresIn:"{{time}} 后失效",created:"机器人已创建",credentialsFilled:"应用凭据已自动回填",qrCodeExpired:"二维码已失效",automaticFailed:"自动配置失败",regenerateQrCode:"请重新生成二维码。",configuredPlaceholder:"已配置,留空沿用",appSecretPlaceholder:"请输入 App Secret",hideSecret:"隐藏 App Secret",showSecret:"显示 App Secret"},CYe={mode:{auto:"自动创建",autoDescription:"部署时自动创建所需资源",recommended:"推荐",create:"指定名称",createDescription:"使用指定名称创建或复用资源",existing:"选择已有",existingDescription:"从当前账号的已有资源中选择"},selectExisting:"请选择已有资源",searchResource:"搜索资源名称",noMatch:"未找到匹配资源",noAvailable:"暂无可用资源",searching:"正在搜索云资源…",loading:"正在加载云资源…",noMatchSentence:"未找到匹配资源。",noAvailableSentence:"暂无可用资源。",loadedSummary:"实际服务区域:{{region}} · 已加载 {{loaded}}{{total}}",registryInstance:"Registry 实例",registryAriaLabel:"镜像仓库 Registry 实例",namespace:"命名空间",namespaceAriaLabel:"镜像仓库 Namespace",repository:"镜像仓库",existingRepository:"已有镜像仓库",selectRegistryFirst:"请先选择 Registry 实例。",selectNamespaceFirst:"请先选择 Namespace。",configurationMode:"配置方式",configurationModeAriaLabel:"{{resource}}配置方式",selectConfigurationMode:"请选择配置方式",automaticNames:"自动创建名称",validation:{tos:"请填写或选择 TOS 存储桶。",cr:"请完整填写或选择 CR 实例、命名空间和镜像仓库。",codePipeline:"请完整填写或选择 CodePipeline Workspace 和 Pipeline。",existingCodePipeline:"请选择已有的 CodePipeline Workspace 和兼容 Pipeline。"},autoBucketWithRegion:"agentkit-platform-{账号 ID}-{{region}}",autoBucket:"agentkit-platform-{账号 ID}",tosBucket:"TOS 存储桶",bucketName:"存储桶名称",bucketNamePlaceholder:"输入存储桶名称",existingBucket:"已有存储桶",existingTosBucket:"已有 TOS 存储桶",bucket:"存储桶",accountIdResolved:"账号 ID 在部署时按当前云账号解析。",containerRegistry:"容器镜像仓库(CR)",instanceName:"实例名称",crInstance:"CR 实例",existingCrInstance:"已有 CR 实例",existingCrNamespace:"已有 CR 命名空间",existingCrRepository:"已有 CR 镜像仓库",autoRegistry:"agentkit-platform-{账号 ID}",autoRepositoryName:"{{name}}-{4 位随机字符}",registryNameNote:"账号 ID 在部署时解析,镜像仓库的随机字符在部署时生成。",workspace:"工作空间",pipeline:"流水线",workspaceName:"Workspace 名称",pipelineName:"Pipeline 名称",existingWorkspace:"已有 CodePipeline Workspace",compatiblePipeline:"兼容 Pipeline",existingPipeline:"已有 AgentKit CodePipeline",pipelineNameNote:"Pipeline 与 Runtime 名称一致。"},kYe={commit:"提交",steps:{permissions:"预检 OTA 所需权限",resolving:"读取目标版本信息",downloading:"下载并校验完整更新包",preparing:"准备 VeFaaS Function 代码",provisioning:"检查并补齐 Studio 云资源",scheduler:"更新定时任务调度服务",submitting:"提交 Function 更新",publishing:"发布新 Revision 并重启服务"},stages:{permissions:"预检 OTA 权限",resolving:"读取版本信息",downloading:"下载更新包",preparing:"准备 Function 代码",provisioning:"补齐 Studio 云资源",scheduler:"更新定时任务调度服务",submitting:"提交 Function 更新",publishing:"发布 Revision",checking:"检查更新",unknown:"未知阶段"},duration:{seconds:"{{count}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},logPermissionPrefix:"无法读取 VeFaaS 发布日志。Function 角色缺少 ",logPermissionSuffix:" 权限,更新会继续。",openIamConsole:"前往 IAM 控制台配置权限",deploymentProgress:"部署进度",live:"实时",completed:"已完成",stopped:"已停止",copied:"已复制",copyFailed:"复制失败",copyLog:"复制日志",waitingForLogs:"等待 VeFaaS 返回更新日志…",noLogs:"本次更新未返回发布日志",messages:{updated:"Studio 已更新,新 Revision 已接管服务",failed:"Studio 更新失败",timeout:"等待 VeFaaS 发布超时,请稍后重新检查版本",submitted:"更新已提交,正在等待 VeFaaS 发布新版本",connectionSwitched:"连接已切换,正在确认新版本状态"},checkingPermissions:"正在检查 OTA 权限",authorizationRequired:"需要 IAM 授权",updating:"正在更新 Studio",updated:"Studio 已更新",updateToVersion:"更新 Studio 至 {{version}}",checkPermissions:"检查更新权限",authorizationNeeded:"需要授权",updatingShort:"正在更新",refreshForNewVersion:"刷新使用新版",updateFailed:"更新失败",updateNow:"立即更新",newVersionAvailable:"有新版更新",dialog:{failed:"Studio 更新失败",checkingPermissions:"正在检查更新权限",authorizationRequired:"需要 IAM 授权",updating:"正在更新 Studio",completed:"Studio 更新完成",newVersion:"发现新版本"},permissionCheck:"正在核对 OTA 与定时任务所需的全部 IAM 权限…",permissionCheckHint:"权限全部满足后才会开始下载、更新或发布云资源。",missingPermissionCount:"当前 Function 角色缺少 {{count}} 项 OTA 更新权限,尚未执行任何云资源变更。",functionRole:"Function 角色",currentRole:"当前运行角色",policyToUpdate:"将更新策略",authorizationSteps:{open:"打开授权页面,确认已预填的策略名称和完整策略内容。",debug:"点击页面中的“发起调试”,完成策略更新。",return:"返回此窗口,点击“我已授权,重新检查”。"},missingPermissions:"缺少的权限",openPrefilledAuthorization:"打开已预填的 IAM 授权页面",openIamManually:"前往 IAM 控制台手动配置",noSafePolicy:"当前角色没有唯一可安全更新的自定义策略,请由管理员将上述权限加入该角色。",failedStage:"失败阶段",errorId:"错误 ID",notGenerated:"未生成",openFunctionLogs:"前往 VeFaaS 控制台查看 Function 日志",targetVersion:"目标版本",updateStatus:"更新状态",elapsed:"已用时",progressAriaLabel:"Studio 更新进度",processingUpdate:"正在处理更新",processing:"正在处理",backgroundHint:"发布阶段会短暂中断连接;关闭此窗口不会停止更新,可随时点击右上角按钮重新查看。",confirmDescription:"更新会重启 Studio 服务,预计约 3–5 分钟完成更新与发布。期间正在进行的对话、流式响应或部署任务可能中断,登录态不会受到影响。",selectVersion:"选择版本",currentVersion:"当前版本",changelog:"更新内容",noChangelog:"暂无更新说明",runInBackground:"后台运行",authorizedRecheck:"我已授权,重新检查",tryAgain:"重新尝试"},OYe={deploy:"部署",update:"更新",planHash:"方案哈希",backToConfiguration:"返回配置",releaseRegion:"发布区域",deployRegion:"部署区域",regionPreserved:"更新时沿用现有 Runtime 的部署区域,无法修改。",unnamedAgent:"未命名 Agent",deployTitle:"部署 {{name}}",additionalAgentCount:" 等 {{count}} 个智能体",releaseOverview:"发布概览",agentOverview:"Agent 概览",agentCount:"Agent 数量",model:"模型",systemPrompt:"系统提示词",optimizations:"优化选项",notEnabled:"未启用",effectiveCapabilities:"生效能力",automaticProtection:"自动保护",artifactActions:"发布产物操作",exportYaml:"导出 YAML",viewSource:"查看源代码",downloadSource:"下载源代码",expandFlow:"放大查看执行流程",expand:"放大查看",deploymentConfiguration:"部署配置",runtimeName:"Runtime 名称",runtimeNamePreserved:"更新时保持现有 Runtime 名称不变。",runtimeNameHint:"默认根据 Root Agent 名称生成,并添加随机后缀避免重名;支持 4-64 位字母、数字、连字符和下划线",accessAuthentication:"访问鉴权",authenticationPreserved:"更新时保持现有 Runtime 的鉴权方式不变。",authenticationMethod:"鉴权方式",authenticationAriaLabel:"部署鉴权方式",authenticationPlaceholder:"请选择鉴权方式",messageChannels:"消息渠道",instanceSettings:"实例设置",minInstances:"最小实例数",maxInstances:"最大实例数",sidecarSingleInstance:"Harness Sidecar 首期仅支持单实例,Runtime 固定为 1~1",inMemorySingleInstance:"为避免多实例间会话丢失,推荐将 Runtime 固定为 1~1",network:"网络",networkPreserved:"现有 Runtime 的区域与网络模式保持不变。",networkMode:"网络模式",networkModes:{public:"公网",both:"公网 + VPC"},subnetId:"子网 ID",subnetHint:"可选,多个用逗号分隔",sharedInternetAccess:"VPC 内共享公网出口",evaluationSets:"评测集",createEvaluationSets:"自动创建评测集",createEvaluationSetsHint:"部署成功后,自动创建 Good Case 和 Bad Case 评测集。",resourceConfiguration:"资源配置",environmentVariables:"环境变量",environmentVariablesHint:"组件配置会自动同步到这里,部署前可核对最终值。",itemCount:"{{count}} 项",addVariable:"添加变量",componentGenerated:"组件自动生成",injectedByApiKey:"由所选 API Key 注入",envNameAriaLabel:"{{key}} 环境变量名",envDescriptionAriaLabel:"{{key}}说明:{{description}}",openOpenViking:"打开 OpenViking {{label}}",openOpenVikingAriaLabel:"{{key}}:打开 OpenViking {{label}}",requiredEmpty:"必填,尚未填写",optionalEmpty:"可选,尚未填写",envValueAriaLabel:"{{key}} 环境变量值",automatic:"自动",synced:"同步",customModelCredentials:"自定义模型凭据",releaseOnlySecret:"必填,仅用于本次发布",thisRelease:"本次发布",customVariables:"自定义变量",value:"值",deleteVariable:"删除变量",deploymentProgress:"部署进度",retryUpdate:"重试更新",retryDeploy:"重试部署",updateSucceeded:"更新成功",deploySucceeded:"部署成功",region:"区域",agentName:"Agent 名称",apiEndpoint:"API 端点",connecting:"连接中…",chatNow:"立即对话",console:"控制台",actionInProgress:"{{action}}中…",checkingName:"正在检查名称…",retryAction:"重试{{action}}",flowPreview:"执行流程预览",executionFlow:"执行流程",flowPreviewHint:"只读预览,可缩放与拖动画布",closeFlowPreview:"关闭执行流程预览",agentAdded:'Agent "{{name}}" 已添加到左上角下拉列表!',files:{preview:"文件预览",new:"新建文件",empty:"暂无文件",noneSelected:"未选择文件",selectToView:"选择左侧文件以查看内容",loadingEditor:"加载编辑器…",rename:"重命名",renamePrompt:"重命名文件"},apiKey:{selectFirst:"请先选择 API Key",revealing:"正在显示 API Key",hide:"隐藏 API Key",retryReveal:"重试显示 API Key",reveal:"显示 API Key"},task:{preparing:"准备部署",waitingBuildLog:"正在等待构建日志…",waitingGithubLog:"正在等待 GitHub 挂载日志…",syncingGithub:"正在同步当前源码到 GitHub",syncGithubCode:"同步 GitHub 代码",githubSynced:"GitHub 代码已同步",githubSubmitted:"GitHub 代码已提交",githubUpdatingRuntime:"代码已提交到 GitHub,GitHub Actions 正在更新同一个 Runtime",initializingGithub:"开始初始化 GitHub main 分支与 Actions workflow",initializingGithubBranch:"正在初始化 GitHub 持续交付目标分支",mountGithubDelivery:"挂载 GitHub 持续交付",githubBranchInitialized:"GitHub 持续交付已初始化目标分支",githubDeliveryMounted:"GitHub 持续交付已挂载",githubMountFailed:"挂载 GitHub 持续交付失败",githubMountFailedDetail:"GitHub 持续交付挂载失败:{{message}}",githubMountFailedHint:"挂载 GitHub 持续交付失败,详见 GitHub 日志。",applyingMpaProfile:"正在将 Agent 配置应用到 MPA Runtime",mpaProfileApplied:"MPA Runtime 配置已应用",runningMpaSmoke:"正在验证 MPA Runtime 执行链路",mpaReady:"MPA Runtime 已可运行",deploymentComplete:"部署完成",deployedNotConnected:"部署完成,暂未连接",cancelled:"已取消",cancelledHint:"部署已取消,相关 Runtime 资源已请求销毁。",deploymentStatusUnconfirmed:"部署状态待确认",deploymentFailed:"部署失败",buildFailedHint:"构建镜像失败,详见构建日志。"},confirm:{updateTitle:"确认更新",deployTitle:"确认部署",closeLabel:"关闭部署确认",updateDescription:"将更新并发布到当前云端 Runtime,过程可能需要几分钟。确定继续吗?",deployDescription:"将创建新的云端 Runtime,部署过程可能需要几分钟。确定继续吗?",update:"确定更新",deploy:"确定部署"},userPool:{label:"用户池",unnamed:"未命名用户池",current:"当前用户池",ariaLabel:"部署用户池",loading:"正在加载用户池…",placeholder:"请选择用户池",loadingIdentity:"正在加载 Identity 用户池…",empty:"当前账号下暂无 Identity 用户池。",currentHint:"当前 Studio 的登录 JWT 将透传访问此 Runtime。",mismatchHint:"所选用户池不是当前 Studio 使用的用户池,部署后无法从 Studio 调用此 Runtime。",markedHint:"当前 Studio 使用的用户池已在列表中标注。"},authentication:{apiKeyDescription:"默认方式,使用 Runtime API Key 访问",userPool:"用户池",userPoolDescription:"使用 Identity 用户池签发的 JWT"},steps:{buildImage:"构建镜像",deploy:"部署",publish:"发布",syncCode:"同步代码",uploadPackage:"上传代码包",packageImage:"镜像打包",createRuntime:"创建 Runtime",publishService:"发布服务",updateInstances:"更新实例配置",createEvaluationSets:"创建评测集",applyMpaProfile:"应用 MPA 配置",verifyMpaRuntime:"验证 MPA Runtime",mpaReady:"MPA Runtime 可运行"},errors:{instanceRangeInteger:"最小实例数必须为大于等于 0 的整数,最大实例数必须为大于 0 的整数。",instanceRangeOrder:"最小实例数不能大于最大实例数。",selectApiKey:"请先在模型配置中选择 API Key。",loadApiKey:"加载 API Key 失败,请重试。",invalidProject:"项目数据无效",updateFeishu:"更新飞书配置失败:{{message}}",userPoolRequired:"请选择用于 Runtime 鉴权的用户池。",vpcRequired:"使用 VPC 网络时,请填写 VPC ID。",modelSecretRequired:"请填写 {{label}},用于访问对应的自定义模型地址。",managedApiKeyRequired:"{{requirement}},请先返回模型配置选择 API Key。",feishuEnvRequired:"启用飞书后,请填写{{field}}。",runtimeNameExists:"Runtime 名称已存在,请修改后重试。",deployedButGithubMountFailed:"部署成功,但挂载 GitHub 持续交付失败:{{message}}",deployedButGithubBindFailed:"部署成功,但绑定 GitHub 失败:{{message}}",mpaRuntimeIdMissing:"部署成功,但返回缺少 Runtime ID,无法应用 MPA 配置。",mpaOperationIncomplete:"MPA Runtime 初始化未完成,请重试此部署任务。",deploymentStatusUnconfirmed:"连接已中断,当前无法确认部署最终状态。任务可能仍在云端运行,请到 AgentKit 或 Code Pipeline 查看同一任务,避免重复部署。",failedAtStage:"{{action}}失败({{stage}}阶段):{{message}}",noAgentAtEndpoint:"连接成功,但该地址未发现任何 Agent(/list-apps 为空)。",addAgent:"添加 Agent 失败:{{message}}",modelApiKeyRequired:"请填写此模型地址对应的 API Key。"}},EYe={title:"工作区",storageUnavailable:"管理员未配置持久化存储,工作区管理暂不可用。",detail:"工作区详情",create:"新建工作区",editorDescription:"将常用环境组合在一起;同一个环境可以加入多个工作区。",backToList:"返回工作区列表",environmentCount_one:"{{count}} 个环境",environmentCount_other:"{{count}} 个环境",createdAt:"创建时间",updatedAt:"最近更新",basicInfo:"基本信息",namePlaceholder:"例如:内容生产",descriptionPlaceholder:"说明这个工作区的用途",selectedEnvironmentCount:"已选择 {{count}} 个,可在其他工作区中继续复用",searchAvailableEnvironments:"搜索可用环境",searchEnvironments:"搜索环境",noAvailableEnvironments:"还没有可添加的环境",createEnvironmentFirst:"请先在“环境”页面创建并构建环境。",noMatchingEnvironments:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称。",environmentStatus:{available:"可用",building:"构建中",notBuilt:"未构建"},added:"已添加",saved:"已保存工作区“{{name}}”",resourceType:"工作区资源类型",searchWorkspaces:"搜索工作区",loadFailed:"无法加载工作区",noMatchingWorkspaces:"没有匹配的工作区",tryAnotherNameOrEnvironment:"请尝试搜索其他名称或环境",noEnvironmentAdded:"未添加环境",environmentMissing:"环境缺失",availableFraction:"{{available}}/{{total}} 可用",available:"可用",availableCount:"{{count}} 个可用",updated:"更新",addEnvironment:"添加环境",deleteTitle:"删除工作区",deleteDescription:"确定删除工作区“{{name}}”吗?环境本身不会被删除。",deleted:"已删除工作区“{{name}}”",clipboardPermissionError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。",codeProjects:"代码项目"},_Ye={back:"返回",detailNavigation:"详情导航",noData:"暂无数据",actions:"操作",moreActions:"更多操作 {{label}}",actionsFor:"{{label}} 操作",loading:"资源加载中,请稍候"},RYe={addSkill:"添加 Skill",remove:"移除 {{name}}",confirmRemoveRuntime:"从新版本中移除运行中的 Skill「{{name}}」?",selectedCount:"已加入技能 · {{count}}",close:"关闭{{label}}",sources:{runtime:"运行中来源 · 原样保留,可移除或用同名 Skill 替换",local:"本地",skillspace:"AgentKit Skills 中心",skillhub:"火山 Find Skill 技能广场"},tabs:{local:"本地文件",localShort:"本地文件",skillspace:"AgentKit Skills 中心",skillspaceShort:"AgentKit",skillhub:"火山 Find Skill 技能广场",skillhubShort:"Find Skill"}},DYe={model:"模型",turnControls:"流程控制",pause:"暂停",resume:"恢复",interrupt:"中断",cancel:"取消",pauseTurn:"在安全点暂停完整流程",resumeTurn:"恢复完整流程",interruptTurn:"中断当前流程并保留会话上下文",cancelTurn:"取消当前流程且不可恢复",turnState:{running:"运行中",pausing:"正在到达安全点",paused:"已暂停",resuming:"正在恢复",interrupting:"正在中断",cancelling:"正在取消",interrupted:"已中断",completed:"已完成",failed:"失败",cancelled:"已取消",orphaned:"状态待确认",newTurnRequired:"需要从检查点继续"},tasks:{ppt:"PPT",image:"图片生成",video:"视频生成"},prompts:{ppt:{quarterlyReview:"复盘【季度】经营表现,提炼指标差距、原因与行动建议",projectUpdate:"汇报【项目名称】进展:里程碑、风险、预算和资源诉求",solutionProposal:"为【客户行业】输出解决方案:痛点、架构、实施路径与收益",industryAnalysis:"分析【行业主题】趋势,给出竞争格局、机会与战略建议"},image:{launchVisual:"为【品牌或产品】设计【高级科技】风格的发布会主视觉",ecommercePoster:"生成【产品名称】电商海报,突出【核心卖点】与品牌色",conceptRendering:"呈现【产品或空间】在【使用场景】中的写实概念效果图",socialGraphic:"围绕【传播主题】制作简洁专业的企业社媒配图"},video:{brandFilm:"制作【品牌名称】30 秒宣传片,突出【品牌价值】",productLaunch:"为【产品名称】制作 45 秒发布视频:痛点、功能、场景与行动号召",trainingVideo:"制作【培训主题】企业培训视频,讲清【关键操作或规范】",eventTeaser:"生成【活动名称】20 秒预热视频,包含亮点、时间地点和报名信息"}},firstFrame:"首帧",videoToEdit:"待编辑视频",baseVideo:"基础视频",optimizeSkillPlaceholder:"描述你想优化的技能…",createSkillPlaceholder:"描述你想生成的技能…",createVideoPlaceholder:"描述你想创作的视频…",messageAgentPlaceholder:"向 {{name}} 发消息…",selectAgentFirst:"请先选择智能体",selectSkillFirst:"请先选择需要优化的 Skill",availableSkills:"可用技能",availableSubagents:"可用子 Agent",invokeSkill:"调用技能",useSubagent:"使用子 Agent",loadingCapabilities:"正在读取 Agent 能力…",noMatchingSkills:"当前 Agent 没有匹配技能",noMatchingSubagents:"当前 Agent 没有匹配子 Agent",skillFallbackDescription:"加载并执行该技能",agentFallbackDescription:"将本轮交给该 Agent",skill:"技能",uploadImage:"上传图片",uploadDocument:"上传文档或 PDF",uploadVideo:"上传视频",taskMode:"任务模式",selectTaskMode:"选择任务模式",loadingGenerationModel:"正在加载生成模型",modelUnavailable:"模型不可用",cancelTask:"取消{{task}}任务",stopGenerating:"停止生成",viewVideoProgress:"查看视频生成进度",send:"发送",selectTaskType:"选择任务类型",enterprisePrompts:"{{task}}企业提示词",sessionId:"会话 ID",sessionIdLabel:"会话 ID:",initializing:"初始化中",copied:"已复制",copySessionId:"复制会话 ID",sessionIdCopied:"已复制会话 ID",disclaimer:"回答仅供参考",viewLogs:"查看日志"},LYe={selectAgent:"选择 Agent",noLocalAgents:"暂无本地 Agent。",searchRuntime:"搜索 Runtime 名称",mineOnly:"只看我创建的",noRuntimes:"暂无 Runtime。",unsupported:"不支持",createdByMe:"我创建的",connecting:"连接中…",connected:"已连接",connect:"连接",viewInfoFor:"查看 {{name}} 信息",viewInfo:"查看信息",agentAndRuntimeInfo:"Agent 与 Runtime 信息",detailType:"详情类型",agentInfo:"Agent 信息",runtimeInfo:"Runtime 信息",loadingAgentInfo:"读取 Agent 信息…",cannotLoadAgentInfo:"暂时无法读取 Agent 信息",unnamedAgent:"未命名 Agent",subagents:"子 Agent",tools:"工具",skills:"技能",previewUnsupported:"暂不支持预览",mountedComponents:"挂载组件",noMoreAgentInfo:"暂无更多 Agent 配置信息。",local:"本地",model:"模型",status:"状态",memoryMb:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",resources:"资源",version:"版本",loadingDetails:"读取详情…",environmentVariables:"环境变量",errors:{notFound:"该 Runtime 已不存在或列表信息已过期,请刷新列表后重试。",accessDenied:"当前账号无权访问该 Runtime,请检查所属 Project 和访问权限。",previewUnsupported:"该 Agent Server 版本暂不支持信息预览。",unavailable:"该 Runtime 暂时无法访问,请确认其状态为“就绪”后重试。",timeout:"加载超时,请重试"},componentKinds:{knowledgebase:"知识库",memory:"记忆",prompt_manager:"提示词管理",example_store:"样例库",run_processor:"运行处理器",tracer:"链路追踪",toolset:"工具集",plugin:"插件",other:"其他"},runtimeStatus:{ready:"就绪",unreleased:"未发布",running:"运行中",active:"运行中",creating:"创建中",pending:"等待中",deploying:"部署中",updating:"更新中",failed:"失败",error:"异常",stopping:"停止中",stopped:"已停止",deleting:"删除中",deleted:"已删除"}},MYe={agent:"智能体",agentTypes:{general:"通用智能体",mpa:"MPA 智能体",codex:"Codex","deepseek-harness":"DeepSeek",openclaw:"OpenClaw",hermes:"Hermes"},creator:"创建人",namedAgent:"{{name}} 智能体",storageLocation:"存储位置",currentBrowser:"当前浏览器",region:"地域",viewDeploymentProgress:"查看 {{name}} 部署进度",viewRuntimeDetails:"查看 {{name}} Runtime 详情",viewDetails:"查看 {{name}} 详情",time:"时间",remainingTime:"剩余时间",expiringSoon:"即将清空",sandboxRemaining:"{{hours}} 小时 {{minutes}} 分钟",wakeable:"已休眠",neverExpires:"永不过期",editDraftNamed:"编辑草稿 {{name}}",viewProgress:"查看进度",deleteDraftNamed:"删除草稿 {{name}}",recheckCompatibility:"重新检测 {{name}} 的对话兼容性",connectedNamed:"{{name}} 已连接",wakeAndChat:"唤醒 {{name}} 并开始对话",chatWith:"与 {{name}} 对话",waking:"唤醒中",deploying:"部署中",draft:"草稿",checking:"检测中",chatUnsupported:"不支持对话",checkFailed:"检测失败",creatorFilter:"创建人筛选",agentType:"智能体类型",searchAgents:"搜索智能体",handoff:"接力",agentList:"{{type}}列表",noMatchingAgents:"没有匹配的智能体",adjustSearch:"请尝试调整搜索或筛选条件",noAgentType:"暂无 {{type}}",noGeneralAgents:"暂无通用智能体",createGeneralAgentDescription:"创建一个通用智能体,开始构建和对话",createAgentType:"创建{{type}}",createAgent:"创建智能体",loadingMore:"正在加载更多智能体",scrollForMore:"继续下滑加载更多",allLoaded:"已加载全部智能体",deleteDraftTitle:"删除草稿?",deleteDraftDescription:"删除后将无法恢复“{{name}}”。",deleteDraft:"删除草稿",loadGeneralAgents:"加载通用智能体",loadAgentType:"加载 {{type}}",compatibility:{checking:"正在请求 Runtime /list-apps,以确认该智能体是否支持 Studio 对话。",empty:"Runtime /list-apps 未返回可用的 Agent,暂时无法连接对话。",supported:"Runtime 支持 Studio 对话。",unknownError:"Runtime /list-apps 请求失败,未返回可识别的错误信息。"},sandboxStatus:{ready:"就绪",wakeable:"已休眠",creating:"创建中",starting:"启动中",initializing:"启动中",pending:"等待中",running:"运行中",failed:"异常",error:"异常",stopped:"已停止",expired:"已过期",deleting:"删除中",deleted:"已删除",unknown:"未知状态"},wakingHint:"正在唤醒智能体,可能需要一些时间。",mpaCreate:{name:"名称",namePlaceholder:"例如 test-agent",nameHelp:"作为 Runtime 名称,支持 4–64 位字母、数字、下划线或连字符。",stepsLabel:"创建步骤",steps:{basics:"基本信息",postgres:"PostgreSQL",openviking:"OpenViking",autoPostgres:"数据库"},next:"下一步",previousStep:"上一步",pgDescription:"选择已有的 PostgreSQL 实例。创建流程会在该实例中准备智能体的独立业务库。",pgSplitDescription:"使用已配置的业务 PG Workspace。多个智能体共用此 Workspace,每个智能体拥有独立业务库。共享资源记录单独存放在 mpa_admin_workspace / mpa_admin_db,由管理员配置。",pgConsole:"前往火山引擎 AIDAP 创建或查看 PG Workspace",pgHost:"PG 主机地址",pgPort:"PG 端口",pgInvalid:"请填写有效的 PG 主机地址和端口。",pgCredentials:"PG 连接账号和密码由部署服务配置;主机和端口须与服务端配置一致。",openvikingDescription:"可选。三项全部填写才启用 OpenViking;全部留空则不向新智能体注入 OpenViking 配置。",openvikingConsole:"前往火山引擎查看 OpenViking 资源",openvikingUrl:"OpenViking 服务地址",openvikingResourceId:"OpenViking 资源 ID",openvikingApiKey:"OpenViking API Key",openvikingInvalid:"请同时填写有效的 HTTPS 服务地址、资源 ID 和 API Key,或全部留空。",openvikingCredentials:"API Key 仅用于本次创建,不保存到浏览器草稿;刷新页面后需重新填写。",tosTitle:"会话输出存储",tosDescription:"可选。填写完整的 TOS 凭证和存储桶,为新智能体的每个会话挂载独立输出目录。三项均留空时使用服务端预设;服务端未配置时,不启用 TOS 挂载。",tosAccessKey:"TOS Access Key",tosSecretKey:"TOS Secret Key",tosBucket:"TOS 存储桶",tosInvalid:"TOS Access Key、Secret Key 和存储桶必须同时填写。",tosCredentials:"凭证仅用于本次创建,不会保存在浏览器恢复数据或创建任务记录中。",runtimeImage:"MPA 镜像",workerImage:"Worker 镜像",imageDefault:"留空使用配置文件中的默认镜像",imageInvalid:"请输入有效的镜像地址,不要包含网址、空格或登录凭据。",title:"创建 MPA 智能体",agentId:"智能体 ID",description:"描述",region:"部署地域",plan:"创建计划",sharedResources:"准备或复用账号共享 VPC、子网和 APIG 消息网关",agentResources:"准备独立业务库、技能空间和执行环境,部署智能体",readiness:"检查网关和智能体就绪状态,成功后加入列表",checking:"正在检查创建配置…",configured:"创建配置已就绪。提交后会检查云资源并开始准备。",notConfigured:"尚未配置创建所需的资源参数,请联系管理员配置后重试。",loadFailed:"检查创建配置失败,请重试。",reload:"重新检查",submit:"开始创建",retry:"重试创建",newAgent:"新建另一个智能体",newAgentDescription:"新建另一个智能体将开启可编辑的新请求,替换当前恢复草稿,但不会取消旧任务。旧任务仍在运行时,请等待其结束后再提交。",close:"关闭",cancel:"取消创建",confirmCancel:"确认取消",cancelDescription:"取消后会停止后续步骤。已创建的数据库、技能空间、网关和其他已登记资源会保留,可使用同一智能体 ID 重试。",background:"关闭窗口后创建会继续。再次打开可查看进度。",pollFailed:"暂时无法获取进度,正在重新连接。请勿重复创建其他智能体。",iamPermissionDenied:"部署服务没有准备运行角色所需的 IAM 权限,请联系管理员授权后重试。",iamTrustConflict:"运行角色的信任关系不符合要求,请管理员检查对 VeFaaS 和 APIG 的授权后重试。",iamPolicyConflict:"运行角色所需的同名权限策略内容冲突,请管理员检查后重试。",iamOwnershipConflict:"运行角色与当前部署账号不匹配,请管理员检查后重试。",iamVerificationFailed:"尚未确认运行角色的权限已就绪,请检查 IAM 服务及策略可用性后重试。",iamConfigurationConflict:"自动准备运行角色仅支持默认 MPA 角色,请检查服务端创建配置。",creationFailed:"当前步骤未完成,请检查对应资源、服务端配置及权限后,用同一智能体 ID 重试。",cancelFailed:"取消请求失败,请重新查询进度后重试。",cancelled:"创建已取消,已登记资源保留供重试。",timeout:"创建超时,已登记资源保留。请检查对应资源后重试。",interrupted:"创建任务中断。请用同一智能体 ID 重试以恢复已登记资源。",skillSpace:"技能空间",states:{running:"正在创建",cancelling:"正在取消",succeeded:"创建成功",failed:"创建失败",cancelled:"已取消"},stages:{queued:"等待开始",iam_role:"准备运行角色",checking:"检查账号与配置",network:"准备 VPC 和子网",gateway:"准备 APIG 和 IM Gateway",database:"准备业务数据库",skills:"准备技能空间",worker:"准备执行环境",deploying:"准备数据库、技能空间和 Runtime",verifying:"等待智能体就绪",admin_workspace:"准备管理 PG Workspace",business_workspace:"准备业务 PG Workspace",admin_database:"初始化共享管理库"},back:"继续创建",pgAutoDescription:"使用 VeADK 部署账号自动创建或复用两个 PG Workspace:mpa_admin_workspace / mpa_admin_db 存放共享资源记录,业务 Workspace 供多个智能体共用,每个智能体拥有独立业务库。无需填写 PG 连接信息,提交创建后开始准备。",pgModeChanged:"此创建任务使用旧的 PG 配置,不能直接切换为自动模式重试。请联系管理员确认已有资源和任务后重新创建。",pgMigrationRequired:"检测到旧共享注册库。请先将共享资源记录迁移到 mpa_admin_workspace / mpa_admin_db,并完成现有 Runtime 的注册库地址切换;完成后点击“重新检查”。"}},IYe={library:"技能库",skill:"技能",skills:"技能",skillSpace:"技能空间",sandboxNotConfigured:"管理员未配置 Dev Sandbox",adminNotConfigured:"管理员未配置",totalItems:"共 {{count}} 项",cannotLoadSpaces:"无法加载技能空间",someSpacesFailed:"部分技能空间加载失败",degradedRelationWarning:"部分关联异常,已恢复可读取技能",downloadZip:"下载 ZIP",optimize:"优化",closeSkillDetails:"关闭技能详情",skillId:"技能 ID",allFiles:"完整文件",loadingSkillContent:"正在读取技能内容…",noSkillContent:"该技能暂无 SKILL.md 内容",addSkill:"添加技能",localUpload:"本地上传",localUploadDescription:"选择 ZIP 文件,校验通过后上传到技能空间",autoCreate:"自动创建",autoCreateDescription:"选择模型和风格,通过对话生成技能",createSkill:"创建技能",optimizeNamed:"优化 {{name}}",deleteSkillConfirm:"确定删除整个 Skill“{{name}}”吗?此操作会影响所有引用它的空间。",deleteSpaceConfirm:"确定删除 Skill 空间“{{name}}”吗?请先确认空间中的技能已删除。",manageSpaceDescription:"管理空间中的技能并创建新的版本",backToSpaces:"返回技能空间列表",overview:"概览",skillCount:"技能数量",skillCountValue_one:"{{count}} 技能",skillCountValue_other:"{{count}} 技能",updatedAt:"更新时间",skillsInSpace:"{{name}}中的技能",searchSkills:"搜索技能",cannotLoadSkills:"无法加载技能",noMatchingSkills:"没有匹配的技能",noSkills:"暂无技能",tryAnotherName:"请尝试搜索其他名称",emptySkillsDescription:"本地上传 Skill,或自动创建",actions:"操作",spaceDetails:"技能空间详情",editSpace:"编辑空间",deleteSpace:"删除空间",searchSpaces:"搜索技能空间",spaceList:"技能空间列表",noMatchingSpaces:"没有匹配的技能空间",createSpace:"新建技能空间",newSpace:"新建空间",loadingMoreSpaces:"正在加载更多技能空间",scrollForMore:"继续下滑加载更多",allSpacesLoaded:"已加载全部技能空间",errors:{loadSpaces:"读取技能空间失败,请稍后重试",loadSkills:"读取技能失败,请稍后重试",loadSkillDetails:"读取技能详情失败,请稍后重试",deleteSkill:"删除 Skill 失败",deleteSpace:"删除 Skill 空间失败",downloadSkill:"下载 Skill 失败"},status:{active:"可用",available:"可用",creating:"创建中",disabled:"已停用",enabled:"已启用",failed:"异常",inactive:"未启用",pending:"等待中",published:"已发布",ready:"就绪",released:"已发布",running:"运行中",success:"正常",unavailable:"不可用",unreleased:"未发布",updating:"更新中",unknown:"未知"},sharedSpace:"企业共享空间",sharedDescription:"面向企业全员开放的技能,由管理员统一发布和维护",sharedVisibility:"全员可见",sharedPreparing:"正在准备共享空间",sharedLoadFailed:"共享空间加载失败",sharedEmpty:"暂无共享技能,管理员发布后会显示在这里",requestPublication:"申请公开",reviewSubmitting:"提交中…",reviewSubmitted:"已申请",reviewFailed:"申请公开失败",reviewStatusFailed:"审核状态加载失败",reviewRetry:"重新申请",reviewPending:"待审核",reviewApproving:"发布中",reviewApproved:"已公开",reviewReturned:"已退回",reviewHistory:"审核记录",skillDetailSections:"技能详情内容",versions:{title:"版本管理",refresh:"刷新",uploading:"上传中…",upload:"上传新版本",close:"关闭",hint:"新版本不会替换已公开版本,审核通过后才会公开;ZIP 中的技能名称需与原技能一致",loading:"正在加载版本…",loadFailed:"无法加载版本",filesFailed:"无法加载版本文件",uploadFailed:"上传新版本失败",submitFailed:"提交申请失败",retry:"重试",empty:"暂无版本",current:"当前版本",notSubmitted:"未申请公开",submitting:"提交中…",submit:"申请公开",processing:"版本状态:{{status}}",filesLoading:"正在加载文件…",filesEmpty:"暂无文件",history:"历史审核记录",shared:"已公开"},author:"作者",authorName:"作者:{{name}}"},PYe={library:"知识库",createBase:"新建知识库",editBase:"编辑知识库",invalidName:"名称必须以字母开头,且只能包含字母、数字和下划线。",nameHelp:"以字母开头,仅支持字母、数字和下划线,最多 48 个字符。",optionalDescription:"描述(可选)",descriptionOnly:"AgentKit 当前仅支持更新知识库描述。",previewWeb:"预览网页内容",addData:"添加数据",openOriginalWeb:"打开原网页",backToEdit:"返回修改",confirmAdd:"确认添加",source:"知识来源",image:"图片",documentFile:"文档文件",webPage:"在线网页",webUrl:"网页 URL",generatingWebPreview:"正在抓取网页并生成 Markdown 预览",selectFile:"选择知识文件",selectOrDropFile:"选择文件或拖拽到这里",selectedFile:"{{size}} · 点击可重新选择",imageFileHelp:"支持 PNG、JPG 和 JPEG,单个文件不超过 200 MB",documentFileHelp:"支持 PDF、PPTX、DOCX、XLSX 和 TXT,单个文件不超过 200 MB",uploadingFile:"正在上传文件并添加到知识库",optionalName:"名称(可选)",optionalType:"类型(可选)",generatePreview:"生成预览",uploadFile:"上传文件",editMetadata:"编辑知识 Metadata",knowledge:"知识",field:"字段",value:"值",backToList:"返回知识库列表",metadataJson:"元数据(JSON)",provider:"服务提供方",knowledgeId:"知识库 ID",project:"项目",creator:"创建者",data:"数据",deleteInvalidAssociation:"删除失效关联",noData:"这个知识库还没有数据",addFirstData:"添加第一项数据",format:"格式",size:"大小",searchData:"搜索数据",searchLibraryData:"搜索知识库数据",associationInvalid:"关联已失效",providerMissing:"底层 Provider 知识库已不存在",noMatchingData:"没有匹配的数据",loadingMoreData:"正在加载更多数据",retryLoading:"重试加载",details:"知识库详情",searchBases:"搜索知识库",someBasesFailed:"部分知识库暂时无法加载,已展示其余可用内容。",noMatchingBases:"没有匹配的知识库",noManagePermission:"您没有管理此知识库的权限",loadingMoreBases:"正在加载更多知识库",deleteBaseTitle:"删除知识库?",deleteBaseDescription:"将删除 {{name}} 的 AgentKit 关联;如果它由 Studio 创建,也会同时删除 Provider 资源。此操作无法撤销。",deleteDocumentTitle:"删除知识?",deleteDocumentDescription:"将从 Provider 知识库中删除 {{name}},此操作无法撤销。",preview:{processingTitle:"数据正在处理中",processingDetail:"知识库完成解析后即可预览,请稍后重新加载。",failedTitle:"数据解析失败",failedDetail:"请检查源文件或网页地址后重新添加,也可以重新加载最新状态。",noParsedTitle:"暂时没有可预览的解析内容",noParsedDetail:"此类文件会在知识库完成解析后显示文本、表格或页面图片。",noMediaTitle:"暂时没有可预览的媒体内容",noMediaDetail:"知识库尚未返回可访问的媒体预览,请稍后重新加载。",noDataTitle:"暂无可预览的数据内容",noDataDetail:"知识库尚未返回解析结果,请稍后重新加载。",attachmentError:"附件无法预览,请稍后重试。",imageAlt:"知识数据图片",audioUnsupported:"当前浏览器不支持音频预览。",videoUnsupported:"当前浏览器不支持视频预览。",namedPdf:"{{name}} PDF 预览",pdf:"PDF 预览",openPdf:"无法显示时,在新窗口打开 PDF",fileUnsupported:"当前格式暂不支持直接在线预览,已优先显示解析后的内容。",openOriginalFile:"打开原文件",loading:"正在加载数据预览",openOriginalHint:"您可以打开原网页查看来源内容。",chunk:"片段 {{index}}",loadingMore:"正在加载更多",loadMore:"加载更多"},errors:{fileTooLarge:"单个文件不能超过 200 MB",invalidImageType:"请选择 PNG、JPG 或 JPEG 图片",invalidDocumentType:"请选择 PDF、PPTX、DOCX、XLSX 或 TXT 文件",createBase:"创建知识库失败",updateBase:"更新知识库失败",metadataObject:"Metadata 必须是 JSON 对象",metadataFormat:"Metadata 格式错误",noWebPreview:"网页没有可预览的 Markdown 内容",addWeb:"添加网页失败",previewWeb:"生成网页预览失败",uploadFile:"上传文件失败",updateDocument:"更新知识失败",loadPreview:"加载数据预览失败",loadMoreBases:"加载更多知识库失败",loadBases:"加载知识库失败",loadMoreData:"加载更多数据失败",loadData:"加载数据失败",deleteBase:"删除知识库失败",deleteDocument:"删除知识失败"}},NYe={title:"飞书渠道",refresh:"刷新",loading:"正在加载渠道配置…",unsupported:"此 Runtime 不支持渠道管理,请升级 MPA 镜像。",unauthorized:"渠道管理需要 Studio 管理员身份及有效的 Runtime 凭据。",configurationError:"渠道管理配置不完整,请检查 Runtime 元数据及加密密钥。",requestFailed:"渠道请求失败,请检查 Runtime 连接后重试。",bound:"已绑定:{{name}}",unbound:"尚未绑定飞书机器人。",guidance:"私聊使用独立会话。在已授权群内 @ 当前机器人即可对话。",keyRequired:"绑定前请在 Runtime 配置持久的 CHANNEL_STATE_ENCRYPTION_KEY。",gateway:"消息网关",route:"入站路由",delivery:"回复投递",configured:"已配置",missing:"未配置",delivery_not_observed:"尚未观测",delivery_delivered:"已投递",delivery_retrying:"重试中",missingConfig:"缺少 Runtime 配置:{{fields}}",bind:"扫码绑定",newQr:"重新生成二维码",unbind:"解除绑定",confirmUnbind:"确认解绑此机器人?解绑后将停止接收新消息。",qrAlt:"机器人绑定二维码",openQr:"打开授权页面",uncertain:"注册过程已中断。重新开始前,请检查机器人绑定与 Gateway 状态。",bindingFailed:"绑定失败,请检查 Gateway 配置后重试。",chatId:"允许的群 ID",scope:"群会话策略",saveGroup:"保存群权限",noGroups:"尚未授权任何群。私聊无需群权限。",edit:"编辑",remove:"移除",removeGroup:"移除 {{name}}",scope_group_sender:"按发言人隔离",scope_group:"全群共享",scope_group_topic_sender:"按话题和发言人隔离",scope_group_topic:"按话题共享",status_PENDING:"等待扫码",status_SCANNED:"已扫码,等待授权",status_AUTHORIZED:"已授权,准备注册",status_REGISTERING:"正在注册机器人",status_BOUND:"机器人已绑定",status_FAILED:"绑定失败",status_EXPIRED:"二维码已过期",workspaceTitle:"消息渠道",workspaceDescription:"连接消息平台,让用户直接与此智能体对话,并管理访问权限。",provider_feishu:"飞书",provider_wecom:"企业微信",provider_dingtalk:"钉钉",comingSoon:"暂未开放",unavailableDescription:"{{name}}的绑定与消息配置暂未开放。",runtimeRequired:"请先将此智能体部署到 Runtime,再配置消息渠道。",bindingTitle:"机器人绑定",connected:"已绑定",notBound:"未绑定",gatewayDescription:"用于接收渠道消息的网关配置。",routeDescription:"将渠道消息转发给当前智能体的路由配置。",deliveryDescription:"实际观测到的回复投递状态,完成配置不代表已成功投递。",groupsTitle:"群聊权限",groupsDescription:"添加允许访问的群,并设置群内对话的共享范围。",providerBindingTitle:"绑定{{name}}",providerUnbound:"绑定{{name}}机器人,让用户通过消息与此智能体对话。",qrGuidance:"使用{{name}}扫码授权,Runtime 将保存机器人凭据并配置消息网关。",wecomGuidance:"使用企业微信扫码授权,或手动填写 Bot ID 和 Secret 绑定已有机器人。",wecomBotId:"Bot ID",wecomSecret:"Secret",bindCredentials:"绑定机器人",wecomScan:"扫码绑定",wecomAuthorizing:"等待企业微信授权…",cancelAuthorization:"取消授权",wecomPopupBlocked:"授权窗口被浏览器拦截,请允许弹窗后重试。",wecomAuthCancelled:"已取消企业微信授权,可以重新扫码。",wecomAuthTimeout:"企业微信授权已超时,请重新扫码。",wecomInvalidResult:"授权结果缺少 Bot ID 或 Secret,请重新授权或手动填写。",wecomAuthFailed:"企业微信授权失败,请重试或手动填写凭据。",dingtalkClientId:"Client ID",dingtalkClientSecret:"Client Secret",manualUpgrade:"当前镜像尚不支持{{name}}手动配置,请升级后使用;仍可使用极速配置。",pairingTitle:"消息渠道扫码配对",feishuPairingDescription:"如果已有连接机器人,飞书扫码并绑定成功后原有机器人会被替换,可选绑定存量机器人或新建机器人。",generatingQr:"正在生成配对二维码…",dingtalkGuidance:"使用钉钉扫码授权,或手动填写 Client ID 和 Client Secret 绑定已有机器人。",wecomPairingDescription:"将在企业微信授权窗口中重新扫码配对。新机器人绑定成功后会替换当前连接;取消授权或绑定失败不会解绑原机器人。",configurationMethod:"配置方式",quickSetup:"极速配置",manualSetup:"手动配置",feishuAppId:"App ID",feishuAppSecret:"App Secret",manualGuidance:"填写已有{{name}}机器人的应用凭据,连接到当前智能体。",manualReplacement:"绑定成功后将替换当前机器人;取消或绑定失败不会解除现有绑定。",accountsTitle:"飞书机器人",account:"机器人",selectAccount:"请选择机器人",accountEnabled:"已启用",accountDisabled:"已停用",addAccount:"添加机器人",cancelAddAccount:"取消添加",enableAccount:"启用机器人",disableAccount:"停用机器人",noAccounts:"尚未绑定飞书机器人。",accountsFailed:"读取机器人列表失败,请重试。",accountConflict:"机器人账号存在歧义或配置冲突,请刷新并选择机器人。",multiBotPairingDescription:"绑定新的飞书应用会添加机器人;绑定相同 App ID 会更新对应机器人。"},Ndr=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:gYe,agentSelector:LYe,agentWorkspace:vYe,channels:NYe,cloudEnvironment:AYe,common:pYe,composer:DYe,default:{common:pYe,agentKitPromo:gYe,systemInfo:mYe,agentWorkspace:vYe,environmentCenter:yYe,deploymentSelect:bYe,deploymentError:xYe,studioBuildProgress:wYe,cloudEnvironment:AYe,githubCicd:SYe,feishuDeployment:TYe,deploymentResources:CYe,studioUpdate:kYe,projectPreview:OYe,workspace:EYe,resourceCollection:_Ye,skillSourcePicker:RYe,composer:DYe,agentSelector:LYe,myAgents:MYe,skillCenter:IYe,knowledge:PYe,channels:NYe},deploymentError:xYe,deploymentResources:CYe,deploymentSelect:bYe,environmentCenter:yYe,feishuDeployment:TYe,githubCicd:SYe,knowledge:PYe,myAgents:MYe,projectPreview:OYe,resourceCollection:_Ye,skillCenter:IYe,skillSourcePicker:RYe,studioBuildProgress:wYe,studioUpdate:kYe,systemInfo:mYe,workspace:EYe},Symbol.toStringTag,{value:"Module"})),BYe="用户管理",$Ye="{{count}} 位成员",FYe="用户",zYe="角色",UYe="账号状态",VYe="最近登录",GYe="操作",QYe="更改角色",HYe="关闭",WYe="保存角色",YYe="正在保存…",qYe="取消",jYe="返回",XYe="用户池",KYe="火山引擎 Identity",ZYe="搜索姓名、邮箱或用户 ID",JYe="搜索",eqe="筛选角色",tqe="全部角色",rqe="刷新",nqe="正在读取用户…",iqe="更新于 {{time}}",aqe="已将 {{name}} 设置为{{role}}",oqe="重试",sqe="你",lqe="初始超级管理员",cqe="初始超级管理员受保护,不能在此降级",uqe="保存后,对方刷新 Studio 即可使用新的权限",dqe="角色需要重新确认",hqe="没有匹配的用户",fqe="尝试其他关键词或角色",pqe="用户登录或加入当前用户池后会显示在这里",gqe="共 {{count}} 位用户",mqe="上一页",vqe="下一页",yqe="尚未登录",bqe="未提供",xqe={super_admin:"超级管理员",admin:"管理员",developer:"开发者",user:"普通用户"},wqe={super_admin:"管理所有资源,并管理用户和分配角色",admin:"管理 Studio 资源",developer:"开发智能体并管理自己的资源",user:"使用智能体和个人功能"},Aqe={EXTERNAL_PROVIDER:"正常",CONFIRMED:"正常",NORMAL:"正常",ENABLED:"正常",ACTIVE:"正常",UNCONFIRMED:"待验证",DISABLED:"已停用",FORBIDDEN:"已禁用",LOCKED:"已锁定",SUSPENDED:"已暂停",FORCE_CHANGE_PASSWORD:"需要修改密码"},Sqe={request_failed:"请求未完成,请刷新列表确认当前状态后重试",invalid_response:"用户服务返回异常,请刷新后重试",identity_unavailable:"暂时无法访问 Identity,请稍后重试或检查服务权限",identity_resource_missing:"用户或用户池已不存在,请刷新列表",super_administrator_required:"只有超级管理员可以管理用户",sign_in_required:"请登录后重试",user_not_in_pool:"当前账号不属于此用户池",user_disabled:"当前账号已停用",protected_administrator:"不能降低初始超级管理员的权限",cannot_demote_self:"不能降低自己的超级管理员权限",role_change_conflict:"角色已发生变化,请关闭弹窗并刷新列表后重试",cross_origin_request:"请在当前 Studio 页面内修改角色"},Bdr=Object.freeze(Object.defineProperty({__proto__:null,actions:GYe,allRoles:tqe,back:jYe,cancel:qYe,changeRole:QYe,close:HYe,default:{title:BYe,memberCount:$Ye,user:FYe,role:zYe,status:UYe,lastLogin:VYe,actions:GYe,changeRole:QYe,close:HYe,save:WYe,saving:YYe,cancel:qYe,back:jYe,pool:XYe,volcengineIdentity:KYe,searchPlaceholder:ZYe,search:JYe,filterRole:eqe,allRoles:tqe,refresh:rqe,loading:nqe,updatedAt:iqe,saved:aqe,retry:oqe,you:sqe,initialAdministrator:lqe,protectedExplanation:cqe,effectiveAfterRefresh:uqe,roleConflict:dqe,noUsers:hqe,tryAnotherSearch:fqe,poolEmpty:pqe,resultCount:gqe,previous:mqe,next:vqe,neverLoggedIn:yqe,unknown:bqe,roles:xqe,descriptions:wqe,states:Aqe,errors:Sqe},descriptions:wqe,effectiveAfterRefresh:uqe,errors:Sqe,filterRole:eqe,initialAdministrator:lqe,lastLogin:VYe,loading:nqe,memberCount:$Ye,neverLoggedIn:yqe,next:vqe,noUsers:hqe,pool:XYe,poolEmpty:pqe,previous:mqe,protectedExplanation:cqe,refresh:rqe,resultCount:gqe,retry:oqe,role:zYe,roleConflict:dqe,roles:xqe,save:WYe,saved:aqe,saving:YYe,search:JYe,searchPlaceholder:ZYe,states:Aqe,status:UYe,title:BYe,tryAnotherSearch:fqe,unknown:bqe,updatedAt:iqe,user:FYe,volcengineIdentity:KYe,you:sqe},Symbol.toStringTag,{value:"Module"})),Tqe="网站集成",Cqe="将 AgentKit Runtime 以悬浮聊天窗口嵌入网站",kqe="返回自动化列表",Oqe="添加网站",Eqe="正在加载 Runtime",_qe="选择 Runtime",Rqe="网站域名",Dqe="例如 xxxx.com 或 localhost:5173",Lqe="正在生成",Mqe="生成 Token",Iqe="已添加网站",Pqe="{{count}} 个",Nqe="{{count}} 个",Bqe="正在加载网站集成",$qe="还没有网站集成",Fqe="选择 Runtime 并输入网站域名即可生成 Token",zqe="引入方法",Uqe="将下面代码放到网页的 body 结束标签前",Vqe="已复制",Gqe="复制代码",Qqe="添加网站后会在这里生成引入代码。",Hqe="确定删除 {{domain}} 的网站集成吗?",Wqe={load:"加载网站集成失败",create:"创建网站集成失败",delete:"删除网站集成失败",noConversationalAgent:"该 Runtime 暂未发现可对话的 Agent"},Yqe={requestFailed:"请求失败 ({{status}})",greeting:"您好,有什么可以帮您?",sessionFailed:"无法建立对话会话",unauthorized:"当前网站未获得对话授权",conversationFailed:"对话请求失败,请稍后重试",open:"打开智能体对话",close:"关闭智能体对话",panelLabel:"智能体对话面板",assistant:"智能体助手",online:"在线对话"},$dr=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:Oqe,addedWebsites:Iqe,backToAutomations:kqe,confirmDelete:Hqe,copied:Vqe,copyCode:Gqe,default:{title:Tqe,description:Cqe,backToAutomations:kqe,addWebsite:Oqe,loadingRuntime:Eqe,selectRuntime:_qe,websiteDomain:Rqe,domainPlaceholder:Dqe,generating:Lqe,generateToken:Mqe,addedWebsites:Iqe,websiteCount_one:Pqe,websiteCount_other:Nqe,loadingIntegrations:Bqe,delete:"删除",emptyTitle:$qe,emptyDescription:Fqe,embedMethod:zqe,embedInstructions:Uqe,copied:Vqe,copyCode:Gqe,embedHint:Qqe,confirmDelete:Hqe,errors:Wqe,widget:Yqe},description:Cqe,domainPlaceholder:Dqe,embedHint:Qqe,embedInstructions:Uqe,embedMethod:zqe,emptyDescription:Fqe,emptyTitle:$qe,errors:Wqe,generateToken:Mqe,generating:Lqe,loadingIntegrations:Bqe,loadingRuntime:Eqe,selectRuntime:_qe,title:Tqe,websiteCount_one:Pqe,websiteCount_other:Nqe,websiteDomain:Rqe,widget:Yqe},Symbol.toStringTag,{value:"Module"})),qqe={types:{all:"全部类型",document:"文档",image:"图片",video:"视频"},previewArtifact:"预览 {{name}}",moreActions:"更多操作 {{name}}",actionMenu:"{{name}} 操作",download:"下载",downloading:"下载中",edit:"编辑信息",delete:"删除产物",previewFailed:"无法预览“{{name}}”:{{message}}",downloadStarted:"已开始下载 {{name}}",downloadFailed:"无法下载“{{name}}”:{{message}}",updated:"已更新 {{name}}",deleted:"已删除 {{name}}",deleteFailed:"无法删除“{{name}}”:{{message}}",typeFilter:"产物类型",searchAria:"搜索产物",searchPlaceholder:"搜索产物或会话",retry:"重试",close:"关闭",listAria:"产物列表",loadFailed:"产物加载失败",loadDetailFallback:"请检查存储配置后重试。",reload:"重新加载",noMatch:"没有找到匹配的产物",noArtifacts:"您还没有任何产物",searchHint:"请尝试搜索其他名称或切换类型",emptyHint:"聊天中生成的产物会自动显示在这里",columns:{name:"名称",source:"来源",updatedAt:"修改时间",actions:"操作"},loadingMore:"正在加载更多产物",unknownTime:"时间未知",preview:{close:"关闭预览",meta:"{{type}} / 版本 {{version}}",loading:"正在加载预览",alt:"{{name}} 预览",loadFailed:"预览加载失败,请稍后重试或下载查看",unsupported:"当前格式暂不支持在线预览,请下载查看",sourceAria:"产物来源",agent:"智能体",session:"会话",tool:"生成工具",createdAt:"生成时间",fileSize:"文件大小",tags:"标签",viewSession:"查看会话"},deleteDialog:{title:"删除产物?",description:"“{{name}}”将从产物库永久删除,聊天记录不会受到影响。",deleting:"删除中",confirm:"删除",close:"关闭删除确认框"},api:{withStatus:"{{message}}({{status}})",listFailed:"读取产物库失败",syncFailed:"同步聊天产物失败",updateFailed:"更新产物失败",deleteFailed:"删除产物失败",downloadFailed:"下载产物失败"}},jqe={unknownSource:"未知来源",unknownCreator:"未知创建者"},Xqe={nameRequired:"请输入产物名称",tooManyTags:"标签最多 {{max}} 个",tagTooLong:"单个标签不能超过 {{max}} 个字符",title:"编辑产物信息",subtitle:"内容文件不会被修改",close:"关闭编辑框",name:"名称",description:"描述",descriptionPlaceholder:"补充用途、版本或使用说明",tags:"标签",tagsPlaceholder:"使用逗号分隔,最多 {{max}} 个",cancel:"取消",saving:"保存中",save:"保存"},Kqe={change:{added:"新增",modified:"修改",deleted:"删除"},noChanges:"两个版本的源码没有差异",chooseFile:"从左侧选择文件以查看代码",compareTitle:"版本对比",workspaceTitle:"源码工作区",projectFallback:"Agent 项目",switchTheme:"切换源码主题",switchThemeTitle:"切换为{{theme}}主题",themes:{dark:"深色",light:"浅色"},closeWorkspace:"关闭源码工作区",close:"关闭",changedFiles:"变更文件",projectFiles:"项目文件",changes:"变更",files:"文件",openFiles:"打开的文件",noFileSelected:"未选择文件",comparisonDirection:"对比方向",before:"优化前",after:"优化后",loadingEditor:"正在加载编辑器…",changedFileCount_one:"{{count}} 个文件有变更",changedFileCount_other:"{{count}} 个文件有变更",fileCount_one:"{{count}} 个文件",fileCount_other:"{{count}} 个文件",lineCount_one:"{{count}} 行 · UTF-8",lineCount_other:"{{count}} 行 · UTF-8",viewSource:"查看源码",viewSourceAria:"查看和编辑项目源码"},Zqe={nav:"搜索",selectAgent:"请选择 Agent",checkingCapabilities:"正在检测 Agent 能力",notMounted:"当前 Agent 未挂载{{label}}",sources:{session:"会话",web:"网络",knowledge:"知识库",memory:"长期记忆"},webDescription:"通过 web_search 工具检索",backendLocal:"本地",failed:"搜索失败:{{message}}",placeholder:{selectAgent:"请先选择 Agent",web:"在网络中检索",knowledge:"在 {{name}} 中检索",knowledgeFallback:"当前 Agent 的知识库",memory:"在 {{name}} 中检索",memoryFallback:"当前用户的长期记忆",session:"在当前 Agent 的会话中检索"},sourceTypeAria:"搜索类型:{{label}}",notSelected:"未选择",sourceType:"搜索类型",selectSource:"选择搜索类型",noAgentHint:"选择一个 Agent 后,即可检索会话、网络及其挂载的数据源。",loadingCapabilities:"正在读取当前 Agent 的检索能力…",sourceUnavailable:"当前 Agent 未挂载该数据源",instructions:{web:"输入关键词后回车或点击按钮,通过 web_search 工具检索。",knowledge:"输入问题,检索当前 Agent 挂载的知识库。",memory:"输入线索,检索当前用户跨会话保存的长期记忆。",session:"输入关键词后回车或点击按钮,搜索当前 Agent 的会话。"},noResults:"未找到匹配“{{query}}”的结果。",knowledgeFragment:"知识片段 {{index}}",memoryFragment:"记忆片段 {{index}}"},Jqe={title:"开发者资源",sections:{documentation:{title:"相关链接",description:"查看开发文档与 AgentKit 常用入口"},bestPractices:{title:"最佳实践",description:"参考开发、调试与部署经验"},showcases:{title:"案例展示",description:"探索 AgentKit 应用案例"}},links:{veadkDocs:"VeADK 文档",cliDocs:"AgentKit CLI 文档",platformDocs:"AgentKit 平台文档",console:"AgentKit 控制台"},articles:{veadkDevelopment:{title:"使用 VeADK 开发并部署智能体",description:"使用 VeADK 构建 Agent,并部署至 AgentKit 智能体运行时。"},cliDevelopment:{title:"使用 AgentKit CLI 开发并部署智能体",description:"通过 AgentKit CLI 创建项目、调试 Agent,并完成部署。"},coverAlt:"{{title}}文章封面"},showcases:{researchAssistant:{title:"多智能体研究助手",description:"由多个专业 Agent 协同完成资料检索、分析和结论整理。"},multimodalAnalysis:{title:"多模态内容分析",description:"在统一会话中理解图片、文档和视频内容。"},customerService:{title:"智能客服工作台",description:"结合知识检索与工具调用处理复杂的客户服务任务。"},webSearch:{title:"联网搜索 Agent",description:"检索实时网页内容,并将信息整理为可追溯的回答。"},a2uiApp:{title:"A2UI 交互应用",description:"让 Agent 根据任务过程生成可交互的前端界面。"},previewAlt:"{{title}}界面预览"}},eje={title:"资源库",untitledSession:"未命名会话",categoryAria:"资源库分类",regionAria:"区域",tabs:{skills:"技能库",knowledge:"知识库",artifacts:"产物"}},tje={title:"管理 Agent",subtitle:"列出你有权管理的 AgentKit Runtime",mainAgentOnly:"仅显示主 Agent(控制面信息)。",deleteConfirm:'确定删除 Agent "{{name}}"?该 Runtime 将被永久删除。',regionFilterTitle:"按区域筛选",regionFilterAria:"区域筛选",regionAria:"区域",refresh:"刷新",loading:"加载中…",empty:"暂无你部署的 Agent。",connected:"已连接",connect:"连接到此 Agent",deleteRuntime:"删除该 Runtime",loadingDetail:"读取详情…",agentStructure:"Agent 结构",secretHidden:"敏感值不展示,可通过授权请求直接复制",revealSecret:"{{key}} 的敏感值",copySecret:"复制 {{key}} 的值",copy:"复制",copied:"已复制",copyFailed:"复制失败",notConfigured:"未配置",fields:{model:"模型",description:"描述",status:"状态信息",project:"项目",version:"版本",resources:"资源",memory:"记忆",tool:"工具",knowledge:"知识",mcpToolset:"MCP 工具集",updatedAt:"更新时间"},resource:{memory:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",concurrency:"并发 {{value}}"},environmentVariables:"环境变量",unnamed:"(未命名)"},rje={mainAgent:"主 Agent",subAgent:"子 Agent {{index}}",itemCount_one:"{{count}} 项",itemCount_other:"{{count}} 项",info:"Agent 信息",infoAndTopology:"Agent 信息与设置",loadingInfo:"正在读取 Agent 信息…",unnamedAgent:"未命名 Agent",agentsMd:"AGENTS.md",tools:"工具",toolList:"工具列表",studioTool:"Studio Tool",removeTool:"移除工具 {{name}}",remove:"移除",notConfigured:"未配置",addStudioTool:"添加 Studio 工具",addStudioToolHere:"在此对话中添加 Studio 工具",skills:"技能",skillList:"技能列表",addSkill:"添加技能空间技能",addSkillHere:"向此会话添加技能空间技能",skillMountNextTurn:"挂载的版本将在下一 Turn 开始时冻结。",previewUnsupported:"暂不支持预览",sessionEnvironment:"会话环境",environment:"环境",agentCanvas:"Agent 画布",topology:"结构拓扑",nodeKinds:{agent:"Agent",sandbox:"沙箱","worker-session":"Worker 会话","skill-space":"技能空间",skill:"技能","studio-tool":"Studio 工具",mcp:"MCP",environment:"环境",knowledge:"知识库","sub-agent":"子 Agent"},nodeStatuses:{configured:"已配置",mounted:"已挂载",running:"运行中",paused:"已暂停"},viewCanvasFullscreen:"全屏查看 Agent 画布",viewFullscreen:"全屏查看",executionCanvas:"Agent 执行画布",fullscreenExecutionCanvas:"全屏 Agent 执行画布",closeFullscreenCanvas:"关闭全屏画布",close:"关闭",capabilitiesSubtitle:"能力与协作拓扑",closeInfo:"关闭 Agent 信息",infoUnavailable:"暂时无法读取 Agent 信息。",refresh:"刷新信息",loadingSkills:"正在加载绑定技能…",sessionSkills:"本会话临时技能",noBoundSpace:"当前智能体未绑定技能空间。",noBoundSkills:"绑定的技能空间暂无技能。",loadFailed:"加载失败,请刷新重试。",accessDenied:"无权读取此信息。",documentUnsupported:"当前 Runtime 不支持 Studio 读取 AGENTS.md,请升级 Runtime 镜像。",skillsUnsupported:"当前 Runtime 未提供技能空间绑定信息。",skillsDegraded:"技能信息不完整,请刷新重试。",documentEditHint:"编辑最新版本。保存会发布新版本到此技能空间,可能影响使用它的其他智能体。运行中的会话可能需要等待缓存刷新或新建会话后生效。请保留 frontmatter 中的 name。",documentLoading:"正在加载 SKILL.md…",documentWritable:"可编辑",documentReadOnly:"只读:此空间或当前权限不允许编辑",documentLoadFailed:"无法加载 SKILL.md,请刷新重试。",documentSaveFailed:"未确认保存成功,已保留编辑内容。重试前请重新打开,检查当前版本。",documentConflict:"技能已有新版本。请复制当前修改,再重新打开编辑器,避免覆盖。",discardDocument:"放弃未保存的修改?",keepEditing:"继续编辑",discardChanges:"放弃修改",saveDocument:"保存为新版本"},nje={mountFailed:"挂载环境失败",closeDialog:"关闭环境弹窗",addTitle:"添加环境",description:"选择当前会话允许 Agent 使用的 Sandbox 环境",closeAdd:"关闭添加环境",searchAria:"搜索环境",searchPlaceholder:"搜索环境名称或能力",availableAria:"可用环境与工作区",loading:"正在读取可用环境…",noMatch:"没有匹配的环境或工作区",workspaces:"工作区",reuseAll:"复用工作区中的全部可用环境",availableEnvironmentCount_one:"{{count}} 个可用环境",availableEnvironmentCount_other:"{{count}} 个可用环境",selectWorkspace:"选择工作区 {{name}}",environments:"环境",includedByWorkspaces:"已由工作区 {{names}} 包含",nameSeparator:"、",selectEnvironment:"选择环境 {{name}}",selectedWorkspaceCount_one:"{{count}} 个工作区",selectedWorkspaceCount_other:"{{count}} 个工作区",coveredEnvironmentCount_one:"{{count}} 个环境",coveredEnvironmentCount_other:"{{count}} 个环境",selectionSummary:"已选择 {{workspaces}},覆盖 {{environments}}",cancel:"取消",mounting:"正在挂载…",confirm:"确认添加",mountedAria:"已挂载环境",environmentCount_one:"{{count}} 个环境",environmentCount_other:"{{count}} 个环境",removeWorkspace:"移除工作区 {{name}}",remove:"移除",removeEnvironment:"移除环境 {{name}}",add:"添加环境",addMore:"添加更多环境",addForSession:"为当前 Session 添加环境",loadingAvailable:"正在加载可用环境…",empty:"暂无可用的 AIO Sandbox 环境。"},ije={loading:{searching:"正在查找已有环境",creating:"环境初始化中",connecting:"正在连接已有环境"},initializationFailed:"AgentKit CLI 环境初始化失败,当前状态:{{status}}。",sessionExpired:"AgentKit CLI Session 不存在或已过期,请重试。",initializationTimeout:"AgentKit CLI 环境初始化超时,请稍后重试。",nonPersistent:"非持久化环境",recyclingHoursMinutes:"{{hours}} 小时 {{minutes}} 分钟后环境回收",recyclingMinutes:"{{minutes}} 分钟后环境回收",connectionError:`无法连接 Studio 服务,未收到服务端响应。 原始错误:{{message}}`,unavailable:"连接不可用",requestFailed:"AgentKit CLI 请求失败",retry:"重试",terminalTitle:"AgentKit CLI 终端"},aje={labels:{coding:"智能编程",get_city_weather:"城市天气查询",get_location_weather:"位置天气查询",web_fetch:"网页内容获取",studio_write_artifact:"保存会话产物"},closeDialog:"关闭弹窗",title:"添加 Studio 工具",description:"由 Studio BFF 为 {{agentName}} 的当前会话执行,Runtime 无需预装",close:"关闭添加 Studio 工具",searchAria:"搜索 Studio 工具",searchPlaceholder:"搜索名称或工具标识",availableAria:"可用 Studio 工具",loading:"正在读取 Studio 工具…",noMatch:"没有匹配的 Studio 工具",remove:"移除",add:"添加"},oje={artifactLibrary:qqe,resourceMetadata:jqe,artifactEdit:Xqe,codeBrowser:Kqe,search:Zqe,developerResources:Jqe,library:eje,manageAgents:tje,agentTopology:rje,sessionEnvironment:nje,agentKitCli:ije,studioTools:aje},Fdr=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:ije,agentTopology:rje,artifactEdit:Xqe,artifactLibrary:qqe,codeBrowser:Kqe,default:oje,developerResources:Jqe,library:eje,manageAgents:tje,resourceMetadata:jqe,search:Zqe,sessionEnvironment:nje,studioTools:aje},Symbol.toStringTag,{value:"Module"})),sje=["zh-CN","en-US"],nle="en-US",zdr="agentkit.studio.locale",Udr={"zh-CN":{dir:"ltr",nativeName:"简体中文"},"en-US":{dir:"ltr",nativeName:"English"}};function ile(t){if(!t)return null;const e=t.trim().replace(/_/g,"-").toLowerCase(),r=sje.find(n=>n.toLowerCase()===e);return r||(e==="zh"||e.startsWith("zh-")?"zh-CN":e==="en"||e.startsWith("en-")?"en-US":null)}function Vdr(){if(typeof window>"u")return null;try{return ile(window.localStorage.getItem(zdr))}catch{return null}}function Gdr(){if(typeof window>"u")return[];const t=window.navigator;return t?t.languages.length>0?t.languages:t.language?[t.language]:[]:[]}function Qdr(){const t=Vdr();if(t)return t;for(const e of Gdr()){const r=ile(e);if(r)return r}return nle}function lje(t){typeof document>"u"||(document.documentElement.lang=t,document.documentElement.dir=Udr[t].dir)}const vn=t=>typeof t=="string",R6=()=>{let t,e;const r=new Promise((n,i)=>{t=n,e=i});return r.resolve=t,r.reject=e,r},ale=t=>t==null?"":String(t),Hdr=(t,e,r)=>{t.forEach(n=>{e[n]&&(r[n]=e[n])})},Wdr=/###/g,cje=t=>t&&t.includes("###")?t.replace(Wdr,"."):t,uje=t=>!t||vn(t),D6=(t,e,r)=>{const n=vn(e)?e.split("."):e;let i=0;for(;i{const{obj:n,k:i}=D6(t,e,Object);if(n!==void 0||e.length===1){n[i]=r;return}let a=e[e.length-1],o=e.slice(0,e.length-1),s=D6(t,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=D6(t,o,Object),s!=null&&s.obj&&typeof s.obj[`${s.k}.${a}`]<"u"&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=r},Ydr=(t,e,r,n)=>{const{obj:i,k:a}=D6(t,e,Object);i[a]=i[a]||[],i[a].push(r)},tG=(t,e)=>{const{obj:r,k:n}=D6(t,e);if(r&&Object.prototype.hasOwnProperty.call(r,n))return r[n]},qdr=(t,e,r)=>{const n=tG(t,r);return n!==void 0?n:tG(e,r)},hje=(t,e,r)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(Object.prototype.hasOwnProperty.call(t,n)?vn(t[n])||t[n]instanceof String||vn(e[n])||e[n]instanceof String?r&&(t[n]=e[n]):hje(t[n],e[n],r):t[n]=e[n]);return t},qv=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),jdr={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},Xdr=t=>vn(t)?t.replace(/[&<>"'\/]/g,e=>jdr[e]):t;class Kdr{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const r=this.regExpMap.get(e);if(r!==void 0)return r;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}const Zdr=[" ",",","?","!",";"],Jdr=new Kdr(20),ehr=(t,e,r)=>{e=e||"",r=r||"";const n=Zdr.filter(o=>!e.includes(o)&&!r.includes(o));if(n.length===0)return!0;const i=Jdr.getRegExp(`(${n.map(o=>o==="?"?"\\?":o).join("|")})`);let a=!i.test(t);if(!a){const o=t.indexOf(r);o>0&&!i.test(t.substring(0,o))&&(a=!0)}return a},ole=(t,e,r=".")=>{if(!t)return;if(t[e])return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;const n=e.split(r);let i=t;for(let a=0;at==null?void 0:t.replace(/_/g,"-"),thr={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){var r,n;(n=(r=console==null?void 0:console[t])==null?void 0:r.apply)==null||n.call(r,console,e)}};class rG{constructor(e,r={}){this.init(e,r)}init(e,r={}){this.prefix=r.prefix||"i18next:",this.logger=e||thr,this.options=r,this.debug=r.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,r,n,i){return i&&!this.debug?null:(e=e.map(a=>vn(a)?a.replace(/[\r\n\x00-\x1F\x7F]/g," "):a),vn(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[r](e))}create(e){return new rG(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new rG(this.logger,e)}}var mm=new rG;class nG{constructor(){this.observers={}}on(e,r){return e.split(" ").forEach(n=>{this.observers[n]||(this.observers[n]=new Map);const i=this.observers[n].get(r)||0;this.observers[n].set(r,i+1)}),this}off(e,r){if(this.observers[e]){if(!r){delete this.observers[e];return}this.observers[e].delete(r)}}once(e,r){const n=(...i)=>{r(...i),this.off(e,n)};return this.on(e,n),this}emit(e,...r){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([i,a])=>{for(let o=0;o{for(let o=0;o-1&&this.options.ns.splice(r,1)}getResource(e,r,n,i={}){var u,d;const a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,o=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;e.includes(".")?s=e.split("."):(s=[e,r],n&&(Array.isArray(n)?s.push(...n):vn(n)&&a?s.push(...n.split(a)):s.push(n)));const l=tG(this.data,s);return!l&&!r&&!n&&e.includes(".")&&(e=s[0],r=s[1],n=s.slice(2).join(".")),l||!o||!vn(n)?l:ole((d=(u=this.data)==null?void 0:u[e])==null?void 0:d[r],n,a)}addResource(e,r,n,i,a={silent:!1}){const o=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let s=[e,r];n&&(s=s.concat(o?n.split(o):n)),e.includes(".")&&(s=e.split("."),i=r,r=s[1]),this.addNamespaces(r),dje(this.data,s,i),a.silent||this.emit("added",e,r,n,i)}addResources(e,r,n,i={silent:!1}){for(const a in n)(vn(n[a])||Array.isArray(n[a]))&&this.addResource(e,r,a,n[a],{silent:!0});i.silent||this.emit("added",e,r,n)}addResourceBundle(e,r,n,i,a,o={silent:!1,skipCopy:!1}){let s=[e,r];e.includes(".")&&(s=e.split("."),i=n,n=r,r=s[1]),this.addNamespaces(r);let l=tG(this.data,s)||{};o.skipCopy||(n=JSON.parse(JSON.stringify(n))),i?hje(l,n,a):l={...l,...n},dje(this.data,s,l),o.silent||this.emit("added",e,r,n)}removeResourceBundle(e,r){this.hasResourceBundle(e,r)&&delete this.data[e][r],this.removeNamespaces(r),this.emit("removed",e,r)}hasResourceBundle(e,r){return this.getResource(e,r)!==void 0}getResourceBundle(e,r){return r||(r=this.options.defaultNS),this.getResource(e,r)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const r=this.getDataByLanguage(e);return!!(r&&Object.keys(r)||[]).find(i=>r[i]&&Object.keys(r[i]).length>0)}toJSON(){return this.data}}var pje={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,r,n,i){return t.forEach(a=>{var o;e=((o=this.processors[a])==null?void 0:o.process(e,r,n,i))??e}),e}};const gje=Symbol("i18next/PATH_KEY");function rhr(){const t=[],e=Object.create(null);let r;return e.get=(n,i)=>{var a;return(a=r==null?void 0:r.revoke)==null||a.call(r),i===gje?t:(t.push(i),r=Proxy.revocable(n,e),r.proxy)},Proxy.revocable(Object.create(null),e).proxy}function bA(t,e){const{[gje]:r}=t(rhr()),n=(e==null?void 0:e.keySeparator)??".",i=(e==null?void 0:e.nsSeparator)??":",a=(e==null?void 0:e.enableSelector)==="strict";if(r.length>1&&i){const o=e==null?void 0:e.ns,s=a?Array.isArray(o)?o:o?[o]:null:Array.isArray(o)?o:null;if(s&&(a?s:s.length>1?s.slice(1):[]).includes(r[0]))return`${r[0]}${i}${r.slice(1).join(n)}`}return r.join(n)}const sle=t=>!vn(t)&&typeof t!="boolean"&&typeof t!="number";class iG extends nG{constructor(e,r={}){super(),Hdr(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=mm.create("translator"),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,r={interpolation:{}}){const n={...r};if(e==null)return!1;const i=this.resolve(e,n);if((i==null?void 0:i.res)===void 0)return!1;const a=sle(i.res);return!(n.returnObjects===!1&&a)}extractFromKey(e,r){let n=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const i=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let a=r.ns||this.options.defaultNS||[];const o=n&&e.includes(n),s=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!ehr(e,n,i);if(o&&!s){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:vn(a)?[a]:a};const u=e.split(n);(n!==i||n===i&&this.options.ns.includes(u[0]))&&(a=u.shift()),e=u.join(i)}return{key:e,namespaces:vn(a)?[a]:a}}translate(e,r,n){let i=typeof r=="object"?{...r}:r;if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i=="object"&&(i={...i}),i||(i={}),e==null)return"";typeof e=="function"&&(e=bA(e,{...this.options,...i})),Array.isArray(e)||(e=[String(e)]),e=e.map(L=>typeof L=="function"?bA(L,{...this.options,...i}):String(L));const a=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:s,namespaces:l}=this.extractFromKey(e[e.length-1],i),u=l[l.length-1];let d=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;d===void 0&&(d=":");const h=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((h==null?void 0:h.toLowerCase())==="cimode")return f?a?{res:`${u}${d}${s}`,usedKey:s,exactUsedKey:s,usedLng:h,usedNS:u,usedParams:this.getUsedParamsDetails(i)}:`${u}${d}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:h,usedNS:u,usedParams:this.getUsedParamsDetails(i)}:s;const p=this.resolve(e,i);let g=p==null?void 0:p.res;const m=(p==null?void 0:p.usedKey)||s,v=(p==null?void 0:p.exactUsedKey)||s,y=["[object Number]","[object Function]","[object RegExp]"],b=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,w=i.count!==void 0&&!vn(i.count),A=iG.hasDefaultValue(i),S=w?this.pluralResolver.getSuffix(h,i.count,i):"",T=i.ordinal&&w?this.pluralResolver.getSuffix(h,i.count,{ordinal:!1}):"",C=w&&!i.ordinal&&i.count===0,O=C&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${S}`]||i[`defaultValue${T}`]||i.defaultValue;let E=g;x&&!g&&A&&(E=O);const _=sle(E),P=Object.prototype.toString.apply(E);if(x&&E&&_&&!y.includes(P)&&!(vn(b)&&Array.isArray(E))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const L=this.options.returnedObjectHandler?this.options.returnedObjectHandler(m,E,{...i,ns:l}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=L,p.usedParams=this.getUsedParamsDetails(i),p):L}if(o){const L=Array.isArray(E),R=L?[]:{},D=L?v:m;for(const M in E)if(Object.prototype.hasOwnProperty.call(E,M)){const I=`${D}${o}${M}`;A&&!g?R[M]=this.translate(I,{...i,defaultValue:sle(O)?O[M]:void 0,joinArrays:!1,ns:l}):R[M]=this.translate(I,{...i,joinArrays:!1,ns:l}),R[M]===I&&(R[M]=E[M])}g=R}}else if(x&&vn(b)&&Array.isArray(g))g=g.join(b),g&&(g=this.extendTranslation(g,e,i,n));else{let L=!1,R=!1;!this.isValidLookup(g)&&A&&(L=!0,g=O),this.isValidLookup(g)||(R=!0,g=s);const M=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&R?void 0:g,I=A&&O!==g&&this.options.updateMissing;if(R||L||I){if(this.logger.log(I?"updateKey":"missingKey",h,u,w&&!I?`${s}${this.pluralResolver.getSuffix(h,i.count,i)}`:s,I?O:g),o){const V=this.resolve(s,{...i,keySeparator:!1});V&&V.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let N=[];const F=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&F&&F[0])for(let V=0;V{var H;const G=A&&U!==g?U:M;this.options.missingKeyHandler?this.options.missingKeyHandler(V,u,z,G,I,i):(H=this.backendConnector)!=null&&H.saveMissing&&this.backendConnector.saveMissing(V,u,z,G,I,i),this.emit("missingKey",V,u,z,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&w?N.forEach(V=>{const z=this.pluralResolver.getSuffixes(V,i);C&&i[`defaultValue${this.options.pluralSeparator}zero`]&&!z.includes(`${this.options.pluralSeparator}zero`)&&z.push(`${this.options.pluralSeparator}zero`),z.forEach(U=>{B([V],s+U,i[`defaultValue${U}`]||O)})}):B(N,s,O))}g=this.extendTranslation(g,e,i,p,n),R&&g===s&&this.options.appendNamespaceToMissingKey&&(g=`${u}${d}${s}`),(R||L)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${d}${s}`:s,L?g:void 0,i))}return a?(p.res=g,p.usedParams=this.getUsedParamsDetails(i),p):g}extendTranslation(e,r,n,i,a){var l,u;if((l=this.i18nFormat)!=null&&l.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const d=vn(e)&&(((u=n==null?void 0:n.interpolation)==null?void 0:u.skipOnVariables)!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(d){const p=e.match(this.interpolator.nestingRegexp);h=p&&p.length}let f=n.replace&&!vn(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(f={...this.options.interpolation.defaultVariables,...f}),e=this.interpolator.interpolate(e,f,n.lng||this.language||i.usedLng,n),d){const p=e.match(this.interpolator.nestingRegexp),g=p&&p.length;h(a==null?void 0:a[0])===p[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${p[0]} in key: ${r[0]}`),null):this.translate(...p,r),n)),n.interpolation&&this.interpolator.reset()}const o=n.postProcess||this.options.postProcess,s=vn(o)?[o]:o;return e!=null&&(s!=null&&s.length)&&n.applyPostProcessor!==!1&&(e=pje.handle(s,e,r,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,r={}){let n,i,a,o,s;return vn(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(l=>typeof l=="function"?bA(l,{...this.options,...r}):l)),e.forEach(l=>{if(this.isValidLookup(n))return;const u=this.extractFromKey(l,r),d=u.key;i=d;let h=u.namespaces;this.options.fallbackNS&&(h=h.concat(this.options.fallbackNS));const f=r.count!==void 0&&!vn(r.count),p=f&&!r.ordinal&&r.count===0,g=r.context!==void 0&&(vn(r.context)||typeof r.context=="number")&&r.context!=="",m=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);h.forEach(v=>{var y,b;this.isValidLookup(n)||(s=v,!this.checkedLoadedFor[`${m[0]}-${v}`]&&((y=this.utils)!=null&&y.hasLoadedNamespace)&&!((b=this.utils)!=null&&b.hasLoadedNamespace(s))&&(this.checkedLoadedFor[`${m[0]}-${v}`]=!0,this.logger.warn(`key "${i}" for languages "${m.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),m.forEach(x=>{var S;if(this.isValidLookup(n))return;o=x;const w=[d];if((S=this.i18nFormat)!=null&&S.addLookupKeys)this.i18nFormat.addLookupKeys(w,d,x,v,r);else{let T;f&&(T=this.pluralResolver.getSuffix(x,r.count,r));const C=`${this.options.pluralSeparator}zero`,O=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(r.ordinal&&T.startsWith(O)&&w.push(d+T.replace(O,this.options.pluralSeparator)),w.push(d+T),p&&w.push(d+C)),g){const E=`${d}${this.options.contextSeparator||"_"}${r.context}`;w.push(E),f&&(r.ordinal&&T.startsWith(O)&&w.push(E+T.replace(O,this.options.pluralSeparator)),w.push(E+T),p&&w.push(E+C))}}let A;for(;A=w.pop();)this.isValidLookup(n)||(a=A,n=this.getResource(x,v,A,r))}))})}),{res:n,usedKey:i,exactUsedKey:a,usedLng:o,usedNS:s}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,r,n,i={}){var a;return(a=this.i18nFormat)!=null&&a.getResource?this.i18nFormat.getResource(e,r,n,i):this.resourceStore.getResource(e,r,n,i)}getUsedParamsDetails(e={}){const r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!vn(e.replace);let i=n?e.replace:e;if(n&&typeof e.count<"u"&&(i={...i,count:e.count}),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!n){i={...i};for(const a of r)delete i[a]}return i}static hasDefaultValue(e){const r="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&n.startsWith(r)&&e[n]!==void 0)return!0;return!1}}class mje{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=mm.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(e){if(e=L6(e),!e||!e.includes("-"))return null;const r=e.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(e){if(e=L6(e),!e||!e.includes("-"))return e;const r=e.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(e){if(vn(e)&&e.includes("-")){let r;try{r=Intl.getCanonicalLocales(e)[0]}catch{}return r&&this.options.lowerCaseLng&&(r=r.toLowerCase()),r||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let r;return e.forEach(n=>{if(r)return;const i=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(i))&&(r=i)}),!r&&this.options.supportedLngs&&e.forEach(n=>{if(r)return;const i=this.getScriptPartFromCode(n);if(this.isSupportedCode(i))return r=i;const a=this.getLanguagePartFromCode(n);if(this.isSupportedCode(a))return r=a;r=this.options.supportedLngs.find(o=>o===a?!0:!o.includes("-")&&!a.includes("-")?!1:!!(o.includes("-")&&!a.includes("-")&&o.slice(0,o.indexOf("-"))===a||o.startsWith(a)&&a.length>1))}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(e,r){if(!e)return[];if(typeof e=="function"&&(e=e(r)),vn(e)&&(e=[e]),Array.isArray(e))return e;if(!r)return e.default||[];let n=e[r];return n||(n=e[this.getScriptPartFromCode(r)]),n||(n=e[this.formatLanguageCode(r)]),n||(n=e[this.getLanguagePartFromCode(r)]),n||(n=e.default),n||[]}toResolveHierarchy(e,r){const n=this.options.fallbackLng,i=Array.isArray(n)?n.join("|"):n;i!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=i);const a=r===void 0||r===!1||vn(r),o=r===void 0&&typeof this.options.fallbackLng=="function",s=vn(e)&&a&&!o;let l=null;if(s){let f;r===void 0?f="undefined":r===!1?f="boolean:false":f=`string:${r}`,l=`${e.length}:${e}|${f}`}if(l!==null){const f=this.resolveHierarchyCache[l];if(f!==void 0)return f.slice()}const u=this.getFallbackCodes((r===!1?[]:r)||this.options.fallbackLng||[],e),d=[],h=f=>{f&&(this.isSupportedCode(f)?d.push(f):this.logger.warn(`rejecting language code not found in supportedLngs: ${f}`))};return vn(e)&&(e.includes("-")||e.includes("_"))?(this.options.load!=="languageOnly"&&h(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&h(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&h(this.getLanguagePartFromCode(e))):vn(e)&&h(this.formatLanguageCode(e)),u.forEach(f=>{d.includes(f)||h(this.formatLanguageCode(f))}),l!==null?(this.resolveHierarchyCache[l]=d,d.slice()):d}}const vje={zero:0,one:1,two:2,few:3,many:4,other:5},yje={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class nhr{constructor(e,r={}){this.languageUtils=e,this.options=r,this.logger=mm.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,r={}){const n=L6(e==="dev"?"en":e),i=r.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:n,type:i});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];let o;try{o=new Intl.PluralRules(n,{type:i})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),yje;if(!e.match(/-|_/))return yje;const l=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(l,r)}return this.pluralRulesCache[a]=o,o}needsPlural(e,r={}){let n=this.getRule(e,r);return n||(n=this.getRule("dev",r)),(n==null?void 0:n.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,r,n={}){return this.getSuffixes(e,n).map(i=>`${r}${i}`)}getSuffixes(e,r={}){let n=this.getRule(e,r);return n||(n=this.getRule("dev",r)),n?n.resolvedOptions().pluralCategories.sort((i,a)=>vje[i]-vje[a]).map(i=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(e,r,n={}){const i=this.getRule(e,n);return i?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i.select(r)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",r,n))}}const bje=(t,e,r,n=".",i=!0)=>{let a=qdr(t,e,r);return!a&&i&&vn(r)&&(a=ole(t,r,n),a===void 0&&(a=ole(e,r,n))),a},xje=t=>t.replace(/\$/g,"$$$$");class wje{constructor(e={}){var r;this.logger=mm.create("interpolator"),this.options=e,this.format=((r=e==null?void 0:e.interpolation)==null?void 0:r.format)||(n=>n),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:r,escapeValue:n,useRawValueToEscape:i,prefix:a,prefixEscaped:o,suffix:s,suffixEscaped:l,formatSeparator:u,unescapeSuffix:d,unescapePrefix:h,nestingPrefix:f,nestingPrefixEscaped:p,nestingSuffix:g,nestingSuffixEscaped:m,nestingOptionsSeparator:v,maxReplaces:y,alwaysFormat:b}=e.interpolation;this.escape=r!==void 0?r:Xdr,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=a?qv(a):o||"{{",this.suffix=s?qv(s):l||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":h?qv(h):"-",this.unescapeSuffix=this.unescapePrefix?"":d?qv(d):"",this.nestingPrefix=f?qv(f):p||qv("$t("),this.nestingSuffix=g?qv(g):m||qv(")"),this.nestingOptionsSeparator=v||",",this.maxReplaces=y||1e3,this.alwaysFormat=b!==void 0?b:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(r,n)=>(r==null?void 0:r.source)===n?(r.lastIndex=0,r):new RegExp(n,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,r,n,i){var p;let a,o,s;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=g=>{if(!g.includes(this.formatSeparator)){const b=bje(r,l,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(b,void 0,n,{...i,...r,interpolationkey:g}):b}const m=g.split(this.formatSeparator),v=m.shift().trim(),y=m.join(this.formatSeparator).trim();return this.format(bje(r,l,v,this.options.keySeparator,this.options.ignoreJSONStructure),y,n,{...i,...r,interpolationkey:v})};this.resetRegExp(),!this.escapeValue&&typeof e=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const d=(i==null?void 0:i.missingInterpolationHandler)||this.options.missingInterpolationHandler,h=((p=i==null?void 0:i.interpolation)==null?void 0:p.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>g},{regex:this.regexp,safeValue:g=>this.escapeValue?this.escape(g):g}].forEach(g=>{for(s=0;a=g.regex.exec(e);){const m=a[1].trim();if(o=u(m),o===void 0)if(typeof d=="function"){const y=d(e,a,i);o=vn(y)?y:""}else if(i&&Object.prototype.hasOwnProperty.call(i,m))o="";else if(h){o=a[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${e}`),o="";else!vn(o)&&!this.useRawValueToEscape&&(o=ale(o));const v=g.safeValue(o);if(e=e.replace(a[0],xje(v)),h?(g.regex.lastIndex+=v.length,g.regex.lastIndex-=a[0].length):g.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),e}nest(e,r,n={}){let i,a,o;const s=(l,u)=>{const d=this.nestingOptionsSeparator;if(!l.includes(d))return l;const h=l.split(new RegExp(`${qv(d)}[ ]*{`));let f=`{${h[1]}`;l=h[0],f=this.interpolate(f,o);const p=f.match(/'/g),g=f.match(/"/g);(((p==null?void 0:p.length)??0)%2===0&&!g||((g==null?void 0:g.length)??0)%2!==0)&&(f=f.replace(/'/g,'"'));try{o=JSON.parse(f),u&&(o={...u,...o})}catch(m){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,m),`${l}${d}${f}`}return o.defaultValue&&o.defaultValue.includes(this.prefix)&&delete o.defaultValue,l};for(;i=this.nestingRegexp.exec(e);){let l=[];o={...n},o=o.replace&&!vn(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;const u=/{.*}/s.test(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(u!==-1&&(l=i[1].slice(u).split(this.formatSeparator).map(d=>d.trim()).filter(Boolean),i[1]=i[1].slice(0,u)),a=r(s.call(this,i[1].trim(),o),o),a&&i[0]===e&&!vn(a))return a;vn(a)||(a=ale(a)),a||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),a=""),l.length&&(a=l.reduce((d,h)=>this.format(d,h,n.lng,{...n,interpolationkey:i[1].trim()}),a.trim())),e=e.replace(i[0],xje(ale(a))),this.regexp.lastIndex=0}return e}}const ihr=t=>{let e=t.toLowerCase().trim();const r={};if(t.includes("(")){const n=t.split("(");e=n[0].toLowerCase().trim();const i=n[1].slice(0,-1);e==="currency"&&!i.includes(":")?r.currency||(r.currency=i.trim()):e==="relativetime"&&!i.includes(":")?r.range||(r.range=i.trim()):i.split(";").forEach(o=>{if(o){const[s,...l]=o.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,""),d=s.trim();r[d]||(r[d]=u),u==="false"&&(r[d]=!1),u==="true"&&(r[d]=!0),isNaN(u)||(r[d]=parseInt(u,10))}})}return{formatName:e,formatOptions:r}},Aje=t=>{const e={};return(r,n,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});const o=n+JSON.stringify(a);let s=e[o];return s||(s=t(L6(n),i),e[o]=s),s(r)}},ahr=t=>(e,r,n)=>t(L6(r),n)(e);class ohr{constructor(e={}){this.logger=mm.create("formatter"),this.options=e,this.init(e)}init(e,r={interpolation:{}}){this.formatSeparator=r.interpolation.formatSeparator||",";const n=r.cacheInBuiltFormats?Aje:ahr;this.formats={number:n((i,a)=>{const o=new Intl.NumberFormat(i,{...a});return s=>o.format(s)}),currency:n((i,a)=>{const o=new Intl.NumberFormat(i,{...a,style:"currency"});return s=>o.format(s)}),datetime:n((i,a)=>{const o=new Intl.DateTimeFormat(i,{...a});return s=>o.format(s)}),relativetime:n((i,a)=>{const o=new Intl.RelativeTimeFormat(i,{...a});return s=>o.format(s,a.range||"day")}),list:n((i,a)=>{const o=new Intl.ListFormat(i,{...a});return s=>o.format(s)})}}add(e,r){this.formats[e.toLowerCase().trim()]=r}addCached(e,r){this.formats[e.toLowerCase().trim()]=Aje(r)}format(e,r,n,i={}){if(!r||e==null)return e;const a=r.split(this.formatSeparator),o=[];for(let l=0;l-1&&!u.includes(")")&&l+1{var f;const{formatName:d,formatOptions:h}=ihr(u);if(this.formats[d]){let p=l;try{const g=((f=i==null?void 0:i.formatParams)==null?void 0:f[i.interpolationkey])||{},m=g.locale||g.lng||i.locale||i.lng||n;p=this.formats[d](l,m,{...h,...i,...g})}catch(g){this.logger.warn(g)}return p}else this.logger.warn(`there was no format function for ${d}`);return l},e)}}const shr=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class lhr extends nG{constructor(e,r,n,i={}){var a,o;super(),this.backend=e,this.store=r,this.services=n,this.languageUtils=n.languageUtils,this.options=i,this.logger=mm.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],(o=(a=this.backend)==null?void 0:a.init)==null||o.call(a,n,i.backend,i)}queueLoad(e,r,n,i){const a={},o={},s={},l={};return e.forEach(u=>{let d=!0;r.forEach(h=>{const f=`${u}|${h}`;!n.reload&&this.store.hasResourceBundle(u,h)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?o[f]===void 0&&(o[f]=!0):(this.state[f]=1,d=!1,o[f]===void 0&&(o[f]=!0),a[f]===void 0&&(a[f]=!0),l[h]===void 0&&(l[h]=!0)))}),d||(s[u]=!0)}),(Object.keys(a).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(a),pending:Object.keys(o),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}loaded(e,r,n){const i=e.split("|"),a=i[0],o=i[1];r&&this.emit("failedLoading",a,o,r),!r&&n&&this.store.addResourceBundle(a,o,n,void 0,void 0,{skipCopy:!0}),this.state[e]=r?-1:2,r&&n&&(this.state[e]=0);const s={};this.queue.forEach(l=>{Ydr(l.loaded,[a],o),shr(l,e),r&&l.errors.push(r),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{s[u]||(s[u]={});const d=l.loaded[u];d.length&&d.forEach(h=>{s[u][h]===void 0&&(s[u][h]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(l=>!l.done)}read(e,r,n,i=0,a=this.retryTimeout,o){if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:r,fcName:n,tried:i,wait:a,callback:o});return}this.readingCalls++;const s=(u,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const h=this.waitingReads.shift();this.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}if(u&&d&&i{this.read(e,r,n,i+1,a*2,o)},a);return}o(u,d)},l=this.backend[n].bind(this.backend);if(l.length===2){try{const u=l(e,r);u&&typeof u.then=="function"?u.then(d=>s(null,d)).catch(s):s(null,u)}catch(u){s(u)}return}return l(e,r,s)}prepareLoading(e,r,n={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();vn(e)&&(e=this.languageUtils.toResolveHierarchy(e)),vn(r)&&(r=[r]);const a=this.queueLoad(e,r,n,i);if(!a.toLoad.length)return a.pending.length||i(),null;a.toLoad.forEach(o=>{this.loadOne(o)})}load(e,r,n){this.prepareLoading(e,r,{},n)}reload(e,r,n){this.prepareLoading(e,r,{reload:!0},n)}loadOne(e,r=""){const n=e.split("|"),i=n[0],a=n[1];this.read(i,a,"read",void 0,void 0,(o,s)=>{o&&this.logger.warn(`${r}loading namespace ${a} for language ${i} failed`,o),!o&&s&&this.logger.log(`${r}loaded namespace ${a} for language ${i}`,s),this.loaded(e,o,s)})}saveMissing(e,r,n,i,a,o={},s=()=>{}){var l,u,d,h,f;if((u=(l=this.services)==null?void 0:l.utils)!=null&&u.hasLoadedNamespace&&!((h=(d=this.services)==null?void 0:d.utils)!=null&&h.hasLoadedNamespace(r))){this.logger.warn(`did not save key "${n}" as the namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if((f=this.backend)!=null&&f.create){const p={...o,isUpdate:a},g=this.backend.create.bind(this.backend);if(g.length<6)try{let m;g.length===5?m=g(e,r,n,i,p):m=g(e,r,n,i),m&&typeof m.then=="function"?m.then(v=>s(null,v)).catch(s):s(null,m)}catch(m){s(m)}else g(e,r,n,i,s,p)}!e||!e[0]||this.store.addResource(e[0],r,n,i)}}}const lle=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),vn(t[1])&&(e.defaultValue=t[1]),vn(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const r=t[3]||t[2];Object.keys(r).forEach(n=>{e[n]=r[n]})}return e},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Sje=t=>(vn(t.ns)&&(t.ns=[t.ns]),vn(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),vn(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&!t.supportedLngs.includes("cimode")&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t),aG=()=>{},chr=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(r=>{typeof t[r]=="function"&&(t[r]=t[r].bind(t))})};class M6 extends nG{constructor(e={},r){if(super(),this.options=Sje(e),this.services={},this.logger=mm,this.modules={external:[]},chr(this),r&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,r),this;setTimeout(()=>{this.init(e,r)},0)}}init(e={},r){this.isInitializing=!0,typeof e=="function"&&(r=e,e={}),e.defaultNS==null&&e.ns&&(vn(e.ns)?e.defaultNS=e.ns:e.ns.includes("translation")||(e.defaultNS=e.ns[0]));const n=lle();this.options={...n,...this.options,...Sje(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler);const i=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?mm.init(i(this.modules.logger),this.options):mm.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=ohr;const d=new mje(this.options);this.store=new fje(this.options.resources,this.options);const h=this.services;h.logger=mm,h.resourceStore=this.store,h.languageUtils=d,h.pluralResolver=new nhr(d,{prepend:this.options.pluralSeparator}),u&&(h.formatter=i(u),h.formatter.init&&h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new wje(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new lhr(i(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",(f,...p)=>{this.emit(f,...p)}),this.modules.languageDetector&&(h.languageDetector=i(this.modules.languageDetector),h.languageDetector.init&&h.languageDetector.init(h,this.options.detection,this.options)),this.modules.i18nFormat&&(h.i18nFormat=i(this.modules.i18nFormat),h.i18nFormat.init&&h.i18nFormat.init(this)),this.translator=new iG(this.services,this.options),this.translator.on("*",(f,...p)=>{this.emit(f,...p)}),this.modules.external.forEach(f=>{f.init&&f.init(this)})}if(this.format=this.options.interpolation.format,r||(r=aG),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=(...d)=>this.store[u](...d)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...d)=>(this.store[u](...d),this)});const s=R6(),l=()=>{const u=(d,h)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),s.resolve(h),r(d,h)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),s}loadResources(e,r=aG){var a,o;let n=r;const i=vn(e)?e:this.language;if(typeof e=="function"&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if((i==null?void 0:i.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const s=[],l=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(h=>{h!=="cimode"&&(s.includes(h)||s.push(h))})};i?l(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>l(d)),(o=(a=this.options.preload)==null?void 0:a.forEach)==null||o.call(a,u=>l(u)),this.services.backendConnector.load(s,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(u)})}else n(null)}reloadResources(e,r,n){const i=R6();return typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r=void 0),e||(e=this.languages),r||(r=this.options.ns),n||(n=aG),this.services.backendConnector.reload(e,r,a=>{i.resolve(),n(a)}),i}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&pje.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!["cimode","dev"].includes(e)){for(let r=0;r{this.language=s,this.languages=this.services.languageUtils.toResolveHierarchy(s),this.resolvedLanguage=void 0,this.setResolvedLanguage(s)},a=(s,l)=>{l?this.isLanguageChangingTo===e&&(i(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,n.resolve((...u)=>this.t(...u)),r&&r(s,(...u)=>this.t(...u))},o=s=>{var d,h;!e&&!s&&this.services.languageDetector&&(s=[]);const l=vn(s)?s:s&&s[0],u=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(vn(s)?[s]:s);u&&(this.language||i(u),this.translator.language||this.translator.changeLanguage(u),(h=(d=this.services.languageDetector)==null?void 0:d.cacheUserLanguage)==null||h.call(d,u)),this.loadResources(u,f=>{a(f,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e),n}getFixedT(e,r,n,i){const a=i==null?void 0:i.scopeNs,o=(s,l,...u)=>{let d;typeof l!="object"?d=this.options.overloadTranslationOptionHandler([s,l].concat(u)):d={...l},d.lng=d.lng||o.lng,d.lngs=d.lngs||o.lngs;const h=d.ns!==void 0&&d.ns!==null;d.ns=d.ns||o.ns,d.keyPrefix!==""&&(d.keyPrefix=d.keyPrefix||n||o.keyPrefix);const f={...this.options,...d};Array.isArray(a)&&!h&&(f.ns=a),typeof d.keyPrefix=="function"&&(d.keyPrefix=bA(d.keyPrefix,f));const p=this.options.keySeparator||".";let g;return d.keyPrefix&&Array.isArray(s)?g=s.map(m=>(typeof m=="function"&&(m=bA(m,f)),`${d.keyPrefix}${p}${m}`)):(typeof s=="function"&&(s=bA(s,f)),g=d.keyPrefix?`${d.keyPrefix}${p}${s}`:s),this.t(g,d)};return vn(e)?o.lng=e:o.lngs=e,o.ns=r,o.keyPrefix=n,o}t(...e){var r;return(r=this.translator)==null?void 0:r.translate(...e)}exists(...e){var r;return(r=this.translator)==null?void 0:r.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,r={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=r.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const o=(s,l)=>{const u=this.services.backendConnector.state[`${s}|${l}`];return u===-1||u===0||u===2};if(r.precheck){const s=r.precheck(this,o);if(s!==void 0)return s}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(n,e)&&(!i||o(a,e)))}loadNamespaces(e,r){const n=R6();return this.options.ns?(vn(e)&&(e=[e]),e.forEach(i=>{this.options.ns.includes(i)||this.options.ns.push(i)}),this.loadResources(i=>{n.resolve(),r&&r(i)}),n):(r&&r(),Promise.resolve())}loadLanguages(e,r){const n=R6();vn(e)&&(e=[e]);const i=this.options.preload||[],a=e.filter(o=>!i.includes(o)&&this.services.languageUtils.isSupportedCode(o));return a.length?(this.options.preload=i.concat(a),this.loadResources(o=>{n.resolve(),r&&r(o)}),n):(r&&r(),Promise.resolve())}dir(e){var i,a;if(e||(e=this.resolvedLanguage||(((i=this.languages)==null?void 0:i.length)>0?this.languages[0]:this.language)),!e)return"rtl";try{const o=new Intl.Locale(e);if(o&&o.getTextInfo){const s=o.getTextInfo();if(s&&s.direction)return s.direction}}catch{}const r=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=((a=this.services)==null?void 0:a.languageUtils)||new mje(lle());return e.toLowerCase().indexOf("-latn")>1?"ltr":r.includes(n.getLanguagePartFromCode(e))||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},r){const n=new M6(e,r);return n.createInstance=M6.createInstance,n}cloneInstance(e={},r=aG){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},a=new M6(i);if((e.debug!==void 0||e.prefix!==void 0)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(s=>{a[s]=this[s]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},n){const s=Object.keys(this.store.data).reduce((l,u)=>(l[u]={...this.store.data[u]},l[u]=Object.keys(l[u]).reduce((d,h)=>(d[h]={...l[u][h]},d),l[u]),l),{});a.store=new fje(s,i),a.services.resourceStore=a.store}if(e.interpolation){const l={...lle().interpolation,...this.options.interpolation,...e.interpolation},u={...i,interpolation:l};a.services.interpolator=new wje(u)}return a.translator=new iG(a.services,i),a.translator.on("*",(s,...l)=>{a.emit(s,...l)}),a.init(i,r),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Su=M6.createInstance();Su.createInstance,Su.dir,Su.init,Su.loadResources,Su.reloadResources,Su.use,Su.changeLanguage,Su.getFixedT,Su.t,Su.exists,Su.setDefaultNamespace,Su.hasLoadedNamespace,Su.loadNamespaces,Su.loadLanguages;const uhr={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,"!doctype":!0,"!DOCTYPE":!0},dhr=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?("[^"]*"|'[^']*')/g;function Tje(t){const e={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},r=t.match(/<\/?([^\s]+?)[/\s>]/);if(r&&(e.name=r[1],(uhr[r[1]]||t.charAt(t.length-2)==="/")&&(e.voidElement=!0),e.name.startsWith("!--"))){const a=t.indexOf("-->");return{type:"comment",comment:a!==-1?t.slice(4,a):""}}const n=new RegExp(dhr);let i=null;for(;i=n.exec(t),i!==null;)if(i[0].trim())if(i[1]){const a=i[1].trim();let o=[a,null];const s=a.indexOf("=");s>-1&&(o=[a.slice(0,s),a.slice(s+1)]),e.attrs[o[0]]=o[1],n.lastIndex--}else i[2]&&(e.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return e}const oG=/|<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,hhr=/<\/?([^\s]+?)[/\s>]/,fhr=/^\s*$/,phr=/^(script|style)$/i,I6="\0",ghr=Object.create(null);function Cje(t){t.forEach(function(e){if(e.type==="text"){e.content=e.content.split(I6).join("<");return}if(e.type==="comment"){e.comment=e.comment.split(I6).join("<");return}for(const r in e.attrs){const n=e.attrs[r];typeof n=="string"&&n.indexOf(I6)>-1&&(e.attrs[r]=n.split(I6).join("<"))}e.children.length&&Cje(e.children)})}function mhr(t,e){const r=e&&e.components||ghr,n=e&&e.allowedTags;let i=!1;if(n){const g=typeof n=="function"?n:function(b){return n.indexOf(b)>-1};let m="",v=0;oG.lastIndex=0;let y;for(;y=oG.exec(t);){const b=y[0];m+=t.slice(v,y.index);const x=b.match(hhr);b.startsWith("",t}}function yhr(t){return t.reduce(function(e,r){return e+kje("",r)},"")}var bhr={parse:mhr,stringify:yhr};const sG=(t,e,r,n)=>{var a,o,s,l;const i=[r,{code:e,...n||{}}];if((o=(a=t==null?void 0:t.services)==null?void 0:a.logger)!=null&&o.forward)return t.services.logger.forward(i,"warn","react-i18next::",!0);Rd(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),(l=(s=t==null?void 0:t.services)==null?void 0:s.logger)!=null&&l.warn?t.services.logger.warn(...i):console!=null&&console.warn&&console.warn(...i)},Oje={},wE=(t,e,r,n)=>{Rd(r)&&Oje[r]||(Rd(r)&&(Oje[r]=new Date),sG(t,e,r,n))},Eje=(t,e)=>()=>{if(t.isInitialized)e();else{const r=()=>{setTimeout(()=>{t.off("initialized",r)},0),e()};t.on("initialized",r)}},cle=(t,e,r)=>{t.loadNamespaces(e,Eje(t,r))},_je=(t,e,r,n)=>{if(Rd(r)&&(r=[r]),t.options.preload&&t.options.preload.indexOf(e)>-1)return cle(t,r,n);r.forEach(i=>{t.options.ns.indexOf(i)<0&&t.options.ns.push(i)}),t.loadLanguages(e,Eje(t,n))},xhr=(t,e,r={})=>!e.languages||!e.languages.length?(wE(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(t,{lng:r.lng,precheck:(n,i)=>{if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&n.services.backendConnector.backend&&n.isLanguageChangingTo&&!i(n.isLanguageChangingTo,t))return!1}}),Rd=t=>typeof t=="string",jv=t=>typeof t=="object"&&t!==null,whr=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Ahr={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},Shr=t=>Ahr[t],Rje=t=>t.replace(whr,Shr);let ule={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Rje,transDefaultProps:void 0};const Thr=(t={})=>{ule={...ule,...t}},dle=()=>ule;let Dje;const Chr=t=>{Dje=t},hle=()=>Dje,lG=(t,e)=>{var n;if(!t)return!1;const r=((n=t.props)==null?void 0:n.children)??t.children;return e?r.length>0:!!r},P6=t=>{var r,n;if(!t)return[];const e=((r=t.props)==null?void 0:r.children)??t.children;return(n=t.props)!=null&&n.i18nIsDynamicList?nx(e):e},khr=t=>Array.isArray(t)&&t.every(Y.isValidElement),nx=t=>Array.isArray(t)?t:[t],Ohr=(t,e)=>{const r={...e};return r.props={...e.props,...t.props},r},Ehr=t=>{const e={};if(!t)return e;const r=n=>{nx(n).forEach(a=>{Rd(a)||(lG(a)?r(P6(a)):jv(a)&&!Y.isValidElement(a)&&Object.assign(e,a))})};return r(t),e},fle=(t,e,r,n)=>{if(!t)return"";let i="";const a=nx(t),o=e!=null&&e.transSupportBasicHtmlNodes?e.transKeepBasicHtmlNodesFor??[]:[];return a.forEach((s,l)=>{if(Rd(s)){i+=`${s}`;return}if(Y.isValidElement(s)){const{props:u,type:d}=s,h=Object.keys(u).length,f=o.indexOf(d)>-1,p=u.children;if(!p&&f&&!h){i+=`<${d}/>`;return}if(!p&&(!f||h)||u.i18nIsDynamicList){i+=`<${l}>`;return}if(f&&h<=1){const m=Rd(p)?p:fle(p,e,r,n);i+=`<${d}>${m}`;return}const g=fle(p,e,r,n);i+=`<${l}>${g}`;return}if(s===null){sG(r,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:n});return}if(jv(s)){const{format:u,...d}=s,h=Object.keys(d);if(h.length===1){const f=u?`${h[0]}, ${u}`:h[0];i+=`{{${f}}}`;return}sG(r,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:n,child:s});return}sG(r,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:n,child:s})}),i},_hr=(t,e,r,n,i,a,o)=>{if(r==="")return[];const s=i.transKeepBasicHtmlNodesFor||[],l=r&&new RegExp(s.map(x=>`<${x}`).join("|")).test(r);if(!t&&!e&&!l&&!o)return[r];const u=e??{},d=x=>{nx(x).forEach(A=>{Rd(A)||(lG(A)?d(P6(A)):jv(A)&&!Y.isValidElement(A)&&Object.assign(u,A))})};d(t);const h=Object.keys(u),f=x=>/^\d+$/.test(x)||s.indexOf(x)>-1||h.indexOf(x)>-1,p=bhr.parse(`<0>${r}`,{allowedTags:f}),g={...u,...a},m=(x,w,A)=>{var C;const S=P6(x),T=y(S,w.children,A);return khr(S)&&T.length===0||(C=x.props)!=null&&C.i18nIsDynamicList?S:T},v=(x,w,A,S,T)=>{x.dummy?(x.children=w,A.push(Y.cloneElement(x,{key:S},T?void 0:w))):A.push(...Y.Children.map([x],C=>{var E;if(C.type===Y.Fragment||((E=C.props)==null?void 0:E.i18nIsDynamicList)!==void 0){const _={key:S};return C&&C.props&&Object.keys(C.props).forEach(P=>{P==="children"||P==="i18nIsDynamicList"||(_[P]=C.props[P])}),Y.createElement(C.type,_,T?null:w)}const O={key:S};return C&&C.props&&Object.keys(C.props).forEach(_=>{_==="ref"||_==="children"||(O[_]=C.props[_])}),Y.cloneElement(C,O,T?null:w)}))},y=(x,w,A)=>{const S=nx(x),T=nx(w),C={};return T.reduce((O,E,_)=>{var L,R;const P=((R=(L=E.children)==null?void 0:L[0])==null?void 0:R.content)&&n.services.interpolator.interpolate(E.children[0].content,g,n.language);if(E.type==="tag"){let D=S[parseInt(E.name,10)];!D&&e&&(D=e[E.name]),A.length===1&&!D&&(D=A[0][E.name]),D||(D={});const M={...E.attrs};o&&Object.keys(M).forEach(z=>{const U=M[z];Rd(U)&&(M[z]=Rje(U))});const I=Object.keys(M).length!==0?Ohr({props:M},D):D,N=Y.isValidElement(I),F=N&&lG(E,!0)&&!E.voidElement,B=l&&jv(I)&&I.dummy&&!N,V=jv(e)&&Object.hasOwnProperty.call(e,E.name);if(Rd(I)){const z=n.services.interpolator.interpolate(I,g,n.language);O.push(z)}else if(lG(I)||F){const z=m(I,E,A);v(I,z,O,_)}else if(B){const z=y(S,E.children,A);v(I,z,O,_)}else if(Number.isNaN(parseFloat(E.name)))if(V){const z=m(I,E,A);v(I,z,O,_,E.voidElement)}else if(i.transSupportBasicHtmlNodes&&s.indexOf(E.name)>-1)if(E.voidElement)O.push(Y.createElement(E.name,{key:`${E.name}-${_}`}));else{const z=C[E.name]||0;C[E.name]=z+1;let U,G=0;for(let q=0;q`);else{const z=y(S,E.children,A);O.push(`<${E.name}>${z}`)}else if(jv(I)&&!N){const z=E.children[0]?P:null;z&&O.push(z)}else v(I,P,O,_,E.children.length!==1||!P)}else if(E.type==="text"){const D=i.transWrapTextNodes,M=typeof i.unescape=="function"?i.unescape:dle().unescape,I=o?M(n.services.interpolator.interpolate(E.content,g,n.language)):n.services.interpolator.interpolate(E.content,g,n.language);D?O.push(Y.createElement(D,{key:`${E.name}-${_}`},I)):O.push(I)}return O},[])},b=y([{dummy:!0,children:t||[]}],p,nx(t||[]));return P6(b[0])},Lje=(t,e,r)=>{const n=t.key||e,i=Y.cloneElement(t,{key:n});if(!i.props||!i.props.children||r.indexOf(`${e}/>`)<0&&r.indexOf(`${e} />`)<0)return i;function a(){return Y.createElement(Y.Fragment,null,i)}return Y.createElement(a,{key:n})},Rhr=(t,e)=>t.map((r,n)=>Lje(r,n,e)),Dhr=(t,e)=>{const r={};return Object.keys(t).forEach(n=>{Object.assign(r,{[n]:Lje(t[n],n,e)})}),r},Lhr=(t,e,r,n)=>t?Array.isArray(t)?Rhr(t,e):jv(t)?Dhr(t,e):(wE(r,"TRANS_INVALID_COMPONENTS",' "components" prop expects an object or array',{i18nKey:n}),null):null,Mhr=t=>!jv(t)||Array.isArray(t)?!1:Object.keys(t).reduce((e,r)=>e&&Number.isNaN(Number.parseFloat(r)),!0);function Ihr({children:t,count:e,parent:r,i18nKey:n,context:i,tOptions:a={},values:o,defaults:s,components:l,ns:u,i18n:d,t:h,shouldUnescape:f,...p}){var B,V,z,U,G,H;const g=d||hle();if(!g)return wE(g,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.",{i18nKey:n}),t;const m=h||g.t.bind(g)||(j=>j),v={...dle(),...(B=g.options)==null?void 0:B.react};let y=u||m.ns||((V=g.options)==null?void 0:V.defaultNS);y=Rd(y)?[y]:y||["translation"];const{transDefaultProps:b}=v,x=b!=null&&b.tOptions?{...b.tOptions,...a}:a,w=f??(b==null?void 0:b.shouldUnescape),A=b!=null&&b.values?{...b.values,...o}:o,S=b!=null&&b.components?{...b.components,...l}:l,T=fle(t,v,g,n),C=s||(x==null?void 0:x.defaultValue)||T||v.transEmptyNodeValue||(typeof n=="function"?bA(n):n),{hashTransKey:O}=v,E=n||(O?O(T||C):T||C);(U=(z=g.options)==null?void 0:z.interpolation)!=null&&U.defaultVariables?o=A&&Object.keys(A).length>0?{...A,...g.options.interpolation.defaultVariables}:{...g.options.interpolation.defaultVariables}:o=A;const _=Ehr(t);_&&typeof _.count=="number"&&e===void 0&&(e=_.count);const P=o||e!==void 0&&!((H=(G=g.options)==null?void 0:G.interpolation)!=null&&H.alwaysFormat)||!t?x.interpolation:{interpolation:{...x.interpolation,prefix:"#$?",suffix:"?$#"}},L={...x,context:i||x.context,count:e,...o,...P,defaultValue:C,ns:y};let R=E?m(E,L):C;R===E&&C&&(R=C);const D=Lhr(S,R,g,n);let M=D||t,I=null;Mhr(D)&&(I=D,M=t);const N=_hr(M,I,R,g,v,L,w),F=r??v.defaultTransParent;return F?Y.createElement(F,p,N):N}const Phr={type:"3rdParty",init(t){Thr(t.options.react),Chr(t)}},Mje=Y.createContext();class Nhr{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function cG({children:t,count:e,parent:r,i18nKey:n,context:i,tOptions:a={},values:o,defaults:s,components:l,ns:u,i18n:d,t:h,shouldUnescape:f,...p}){var b;const{i18n:g,defaultNS:m}=Y.useContext(Mje)||{},v=d||g||hle(),y=h||(v==null?void 0:v.t.bind(v));return Ihr({children:t,count:e,parent:r,i18nKey:n,context:i,tOptions:a,values:o,defaults:s,components:l,ns:u||(y==null?void 0:y.ns)||m||((b=v==null?void 0:v.options)==null?void 0:b.defaultNS),i18n:v,t:h,shouldUnescape:f,...p})}var Ije={exports:{}},Pje={};/** * @license React * use-sync-external-store-shim.production.js From 507ca8632c1f89c36ddfe22b90ddec09b5d37d0f Mon Sep 17 00:00:00 2001 From: "zhangmengqiu.zmq" Date: Sat, 10 Oct 2026 17:55:58 +0800 Subject: [PATCH 4/5] feat(mpa): support BytePlus creation and recover failed PG bootstrap --- frontend/server/mpa_creation.py | 39 +- frontend/src/i18n/resources/en-US/ui.json | 2 + frontend/src/i18n/resources/zh-CN/ui.json | 2 + frontend/src/ui/MyAgents.tsx | 4 +- .../src/ui/mpa-create/MpaCreateDialog.tsx | 31 +- frontend/tests/mpaCreation.test.tsx | 71 +++ .../2026-10-10-terminal-create-failure.md | 73 +++ .../2026-10-10-terminal-create-failure.zh.md | 73 +++ .../2026-10-10-byteplus-creation.md | 94 +++ .../2026-10-10-byteplus-creation.zh.md | 95 +++ specs/studio-mpa-creation/README.md | 14 +- specs/studio-mpa-creation/README.zh.md | 14 +- .../integrations/mpa_managed/test_auto_pg.py | 443 ++++++++++++++ .../integrations/mpa_managed/test_byteplus.py | 571 ++++++++++++++++++ veadk/cli/cli_frontend.py | 4 +- veadk/integrations/mpa/managed/README.md | 8 + veadk/integrations/mpa/managed/README.zh.md | 8 + veadk/integrations/mpa/managed/config.py | 36 +- veadk/integrations/mpa/managed/credentials.py | 21 +- .../integrations/mpa/managed/gateway_cloud.py | 16 +- veadk/integrations/mpa/managed/iam.py | 7 + veadk/integrations/mpa/managed/model_key.py | 4 +- veadk/integrations/mpa/managed/network.py | 14 +- .../integrations/mpa/managed/network_cloud.py | 9 +- .../integrations/mpa/managed/pg_bootstrap.py | 210 ++++--- veadk/integrations/mpa/managed/pg_cloud.py | 7 +- veadk/integrations/mpa/managed/provider.py | 85 +++ veadk/integrations/mpa/managed/runner.py | 6 +- veadk/integrations/mpa/managed/runtime.py | 40 +- veadk/integrations/mpa/managed/service.py | 11 +- .../mpa/managed/studio_profile.py | 64 +- veadk/integrations/mpa/managed/tasks.py | 2 + veadk/integrations/mpa/managed/worker.py | 25 +- .../{index-Djxxd5-6.js => index-ClHtQ9mm.js} | 184 +++--- ...2mGXDZcj.js => CodeDiffEditor-Bg6VpuGF.js} | 2 +- ...fuU3.js => FileExplorerEditor-CIq-90TZ.js} | 2 +- ...9l.js => MarkdownPromptEditor-BNeSUDlW.js} | 2 +- ....js => QuickAgentCreateDialog-Dsg-kvw3.js} | 2 +- .../{arc-DdYsJafX.js => arc-d3LDLPxC.js} | 2 +- ...hannel-BJ4cgerF.js => channel-BpLQg6NR.js} | 2 +- ...ex.es-DJ1yvv7D.js => index.es-Be7SFkKc.js} | 2 +- ...n-Cv2aSRRE.js => jspdf.es.min-DaBspz3M.js} | 6 +- ...{linear-DCiqxKKj.js => linear-Dzhy84P9.js} | 2 +- ...y1.js => abnfDiagram-N423BO3Z-CXnaXCW8.js} | 2 +- ... architectureDiagram-T3A2C74G-D58-dAWx.js} | 2 +- ...y.js => blockDiagram-VBNYF7ZC-Qq44t_0z.js} | 2 +- ...QaFR.js => c4Diagram-5PPSVZJV-BQt3hdKU.js} | 2 +- ...DVigIiB1.js => chunk-2GRJ4B5K-CCrGLs4n.js} | 2 +- ...bNgRmewe.js => chunk-2Q5K7J3B-DOh_N0Na.js} | 2 +- ...DFE6wckU.js => chunk-5RXB4S5H-Df5o_TII.js} | 2 +- ...CgRpFncl.js => chunk-5VM5RSS4-CuwnYbky.js} | 2 +- ...DE8UpuKY.js => chunk-6Q2QTUOP-CShubTss.js} | 2 +- ...CbACP9V4.js => chunk-GF5L2VYU-2AlTvpSO.js} | 2 +- ...ClXuzEQk.js => chunk-JWPE2WC7-CHh-HstL.js} | 2 +- ...DMzKyXpN.js => chunk-KBJHAD2P-DSLhjlnw.js} | 2 +- ...DCh12h03.js => chunk-RYQCIY6F-CKOZ7s3L.js} | 2 +- ...wn9IfPq9.js => chunk-XXDRQBXY-wlYdb1JF.js} | 2 +- .../mermaid/classDiagram-JCYQIIEL-DPu-vvln.js | 1 - .../mermaid/classDiagram-JCYQIIEL-Q4Fp3MrW.js | 1 + .../classDiagram-v2-OCEON4UE-DPu-vvln.js | 1 - .../classDiagram-v2-OCEON4UE-Q4Fp3MrW.js | 1 + ...5.js => cose-bilkent-JH36ORCC-Cundp15r.js} | 2 +- ...uWD4o5.js => cynefin-OW5HDTMX-D_41mNq_.js} | 2 +- ...js => cynefinDiagram-MW4NZA55-Bsca95gv.js} | 2 +- ...B6BfkqqY.js => dagre-VZM6K2ZE-BuG73iLk.js} | 2 +- ...uarRCR.js => diagram-7IWD3JNH-CGbLjvMN.js} | 2 +- ...ReKMiI.js => diagram-B4RE2ZJO-MQ054xkJ.js} | 2 +- ...tB4Cta.js => diagram-LBJQPF4R-Bb6AGrII.js} | 2 +- ...hZAMIw.js => diagram-Q27KOJAE-C_CFJvbx.js} | 2 +- ...LebdvG.js => diagram-UB23O5K3-_JsG1xHa.js} | 2 +- ...2U.js => ebnfDiagram-BXEA7PRR-kePPm_G4.js} | 2 +- ...K9Hg.js => erDiagram-JOGREHBK-BYwzuuGT.js} | 2 +- ...gI.js => flowDiagram-UKHOOZJN-DKjXakdk.js} | 2 +- ...2.js => ganttDiagram-PKOTCBZU-pEBHDWv2.js} | 2 +- ...s => gitGraphDiagram-DS77QQ5N-Ct-auQ_T.js} | 2 +- ...YM.js => infoDiagram-6WML65LV-WoM_Brqp.js} | 2 +- ...s => ishikawaDiagram-WSZJBQD7-PyTPgkr0.js} | 2 +- ...js => journeyDiagram-NVQOT4AX-BuLG_5bb.js} | 2 +- ...=> kanban-definition-27J2QSJJ-yg3q15gx.js} | 2 +- ...e-CgV8Rw9c.js => mermaid.core-BCOT9Ja2.js} | 8 +- ...> mindmap-definition-FAOFIHXS-DuNkqxqm.js} | 2 +- ...Sje.js => pegDiagram-VL7TDLO6-DDlBzCJm.js} | 2 +- ...Ldj.js => pieDiagram-7S7Q4E2Y-BNchVEli.js} | 2 +- ...s => quadrantDiagram-CIZ2JOQS-RaOULba1.js} | 2 +- ...s => railroadDiagram-AXF67PYL-C1Pmexsr.js} | 2 +- ...> requirementDiagram-LRYGKXZP-CAWD-4hG.js} | 2 +- ....js => sankeyDiagram-W5VNT64P-B0kptpAu.js} | 2 +- ...s => sequenceDiagram-SI44F4Z6-DxJr_OrV.js} | 2 +- ...Vz.js => sizeCapture-X5ZJPWSS-Cccwsr__.js} | 2 +- ...i.js => stateDiagram-OKZ733FA-CuyrYUa7.js} | 2 +- .../stateDiagram-v2-UEYNNEHI-CVG1bHIn.js | 1 + .../stateDiagram-v2-UEYNNEHI-HWzGwZhJ.js | 1 - ...H9aV.js => swimlanes-SLNWSIFB-Csb_AeKm.js} | 4 +- .../swimlanesDiagram-ULZ7WXOC-Dk4f75vA.js | 8 - .../swimlanesDiagram-ULZ7WXOC-mCTeAlco.js | 8 + ... timeline-definition-Z64GVDOM-BUN-mmM8.js} | 2 +- ...qZ.js => vennDiagram-T6HMQDX7-BDMbYYJ1.js} | 2 +- ...js => wardleyDiagram-T6FBY63Y-Bq_oSpZX.js} | 2 +- ...js => xychartDiagram-ELKLHX3M-BwllaV3a.js} | 2 +- veadk/webui/index.html | 2 +- veadk/webui/website-integration.js | 4 +- 101 files changed, 2126 insertions(+), 315 deletions(-) create mode 100644 prd-spec/bugfixes/mpa-pg-recovery/2026-10-10-terminal-create-failure.md create mode 100644 prd-spec/bugfixes/mpa-pg-recovery/2026-10-10-terminal-create-failure.zh.md create mode 100644 prd-spec/features/mpa-byteplus/2026-10-10-byteplus-creation.md create mode 100644 prd-spec/features/mpa-byteplus/2026-10-10-byteplus-creation.zh.md create mode 100644 tests/integrations/mpa_managed/test_byteplus.py create mode 100644 veadk/integrations/mpa/managed/provider.py rename veadk/webui/assets/app/{index-Djxxd5-6.js => index-ClHtQ9mm.js} (71%) rename veadk/webui/assets/chunks/{CodeDiffEditor-2mGXDZcj.js => CodeDiffEditor-Bg6VpuGF.js} (99%) rename veadk/webui/assets/chunks/{FileExplorerEditor-DU76fuU3.js => FileExplorerEditor-CIq-90TZ.js} (96%) rename veadk/webui/assets/chunks/{MarkdownPromptEditor-DC-LvA9l.js => MarkdownPromptEditor-BNeSUDlW.js} (99%) rename veadk/webui/assets/chunks/{QuickAgentCreateDialog-BDjHgo6h.js => QuickAgentCreateDialog-Dsg-kvw3.js} (97%) rename veadk/webui/assets/chunks/{arc-DdYsJafX.js => arc-d3LDLPxC.js} (98%) rename veadk/webui/assets/chunks/{channel-BJ4cgerF.js => channel-BpLQg6NR.js} (53%) rename veadk/webui/assets/chunks/{index.es-DJ1yvv7D.js => index.es-Be7SFkKc.js} (99%) rename veadk/webui/assets/chunks/{jspdf.es.min-Cv2aSRRE.js => jspdf.es.min-DaBspz3M.js} (99%) rename veadk/webui/assets/chunks/{linear-DCiqxKKj.js => linear-Dzhy84P9.js} (98%) rename veadk/webui/assets/visualizations/mermaid/{abnfDiagram-N423BO3Z-BMYLL6y1.js => abnfDiagram-N423BO3Z-CXnaXCW8.js} (86%) rename veadk/webui/assets/visualizations/mermaid/{architectureDiagram-T3A2C74G-BYtAu2kQ.js => architectureDiagram-T3A2C74G-D58-dAWx.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{blockDiagram-VBNYF7ZC-CuJEX67y.js => blockDiagram-VBNYF7ZC-Qq44t_0z.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{c4Diagram-5PPSVZJV-DTNYQaFR.js => c4Diagram-5PPSVZJV-BQt3hdKU.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{chunk-2GRJ4B5K-DVigIiB1.js => chunk-2GRJ4B5K-CCrGLs4n.js} (93%) rename veadk/webui/assets/visualizations/mermaid/{chunk-2Q5K7J3B-bNgRmewe.js => chunk-2Q5K7J3B-DOh_N0Na.js} (66%) rename veadk/webui/assets/visualizations/mermaid/{chunk-5RXB4S5H-DFE6wckU.js => chunk-5RXB4S5H-Df5o_TII.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{chunk-5VM5RSS4-CgRpFncl.js => chunk-5VM5RSS4-CuwnYbky.js} (83%) rename veadk/webui/assets/visualizations/mermaid/{chunk-6Q2QTUOP-DE8UpuKY.js => chunk-6Q2QTUOP-CShubTss.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{chunk-GF5L2VYU-CbACP9V4.js => chunk-GF5L2VYU-2AlTvpSO.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{chunk-JWPE2WC7-ClXuzEQk.js => chunk-JWPE2WC7-CHh-HstL.js} (78%) rename veadk/webui/assets/visualizations/mermaid/{chunk-KBJHAD2P-DMzKyXpN.js => chunk-KBJHAD2P-DSLhjlnw.js} (87%) rename veadk/webui/assets/visualizations/mermaid/{chunk-RYQCIY6F-DCh12h03.js => chunk-RYQCIY6F-CKOZ7s3L.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{chunk-XXDRQBXY-wn9IfPq9.js => chunk-XXDRQBXY-wlYdb1JF.js} (53%) delete mode 100644 veadk/webui/assets/visualizations/mermaid/classDiagram-JCYQIIEL-DPu-vvln.js create mode 100644 veadk/webui/assets/visualizations/mermaid/classDiagram-JCYQIIEL-Q4Fp3MrW.js delete mode 100644 veadk/webui/assets/visualizations/mermaid/classDiagram-v2-OCEON4UE-DPu-vvln.js create mode 100644 veadk/webui/assets/visualizations/mermaid/classDiagram-v2-OCEON4UE-Q4Fp3MrW.js rename veadk/webui/assets/visualizations/mermaid/{cose-bilkent-JH36ORCC-Dv12PbG5.js => cose-bilkent-JH36ORCC-Cundp15r.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{cynefin-OW5HDTMX-D8uWD4o5.js => cynefin-OW5HDTMX-D_41mNq_.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{cynefinDiagram-MW4NZA55-DVSBOcOr.js => cynefinDiagram-MW4NZA55-Bsca95gv.js} (98%) rename veadk/webui/assets/visualizations/mermaid/{dagre-VZM6K2ZE-B6BfkqqY.js => dagre-VZM6K2ZE-BuG73iLk.js} (97%) rename veadk/webui/assets/visualizations/mermaid/{diagram-7IWD3JNH-BuuarRCR.js => diagram-7IWD3JNH-CGbLjvMN.js} (96%) rename veadk/webui/assets/visualizations/mermaid/{diagram-B4RE2ZJO-DIReKMiI.js => diagram-B4RE2ZJO-MQ054xkJ.js} (97%) rename veadk/webui/assets/visualizations/mermaid/{diagram-LBJQPF4R-C_tB4Cta.js => diagram-LBJQPF4R-Bb6AGrII.js} (94%) rename veadk/webui/assets/visualizations/mermaid/{diagram-Q27KOJAE-4HhZAMIw.js => diagram-Q27KOJAE-C_CFJvbx.js} (98%) rename veadk/webui/assets/visualizations/mermaid/{diagram-UB23O5K3-DqLebdvG.js => diagram-UB23O5K3-_JsG1xHa.js} (95%) rename veadk/webui/assets/visualizations/mermaid/{ebnfDiagram-BXEA7PRR-B4iZkk2U.js => ebnfDiagram-BXEA7PRR-kePPm_G4.js} (87%) rename veadk/webui/assets/visualizations/mermaid/{erDiagram-JOGREHBK-t9NEK9Hg.js => erDiagram-JOGREHBK-BYwzuuGT.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{flowDiagram-UKHOOZJN-DraWW3gI.js => flowDiagram-UKHOOZJN-DKjXakdk.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{ganttDiagram-PKOTCBZU-DX5ZND82.js => ganttDiagram-PKOTCBZU-pEBHDWv2.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{gitGraphDiagram-DS77QQ5N-467I1PmL.js => gitGraphDiagram-DS77QQ5N-Ct-auQ_T.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{infoDiagram-6WML65LV-BBYK-cYM.js => infoDiagram-6WML65LV-WoM_Brqp.js} (69%) rename veadk/webui/assets/visualizations/mermaid/{ishikawaDiagram-WSZJBQD7-C9qfY6lB.js => ishikawaDiagram-WSZJBQD7-PyTPgkr0.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{journeyDiagram-NVQOT4AX-CSbB9UN0.js => journeyDiagram-NVQOT4AX-BuLG_5bb.js} (98%) rename veadk/webui/assets/visualizations/mermaid/{kanban-definition-27J2QSJJ-Deby2slT.js => kanban-definition-27J2QSJJ-yg3q15gx.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{mermaid.core-CgV8Rw9c.js => mermaid.core-BCOT9Ja2.js} (98%) rename veadk/webui/assets/visualizations/mermaid/{mindmap-definition-FAOFIHXS-CuaRzmUt.js => mindmap-definition-FAOFIHXS-DuNkqxqm.js} (98%) rename veadk/webui/assets/visualizations/mermaid/{pegDiagram-VL7TDLO6-zvEgQSje.js => pegDiagram-VL7TDLO6-DDlBzCJm.js} (87%) rename veadk/webui/assets/visualizations/mermaid/{pieDiagram-7S7Q4E2Y-D9sGiLdj.js => pieDiagram-7S7Q4E2Y-BNchVEli.js} (96%) rename veadk/webui/assets/visualizations/mermaid/{quadrantDiagram-CIZ2JOQS-DNx35DHe.js => quadrantDiagram-CIZ2JOQS-RaOULba1.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{railroadDiagram-AXF67PYL-DWqWcScv.js => railroadDiagram-AXF67PYL-C1Pmexsr.js} (84%) rename veadk/webui/assets/visualizations/mermaid/{requirementDiagram-LRYGKXZP-Dsa3hG3G.js => requirementDiagram-LRYGKXZP-CAWD-4hG.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{sankeyDiagram-W5VNT64P-DD2hnmxH.js => sankeyDiagram-W5VNT64P-B0kptpAu.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{sequenceDiagram-SI44F4Z6-N3MGxJM2.js => sequenceDiagram-SI44F4Z6-DxJr_OrV.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{sizeCapture-X5ZJPWSS-HrXfOyVz.js => sizeCapture-X5ZJPWSS-Cccwsr__.js} (87%) rename veadk/webui/assets/visualizations/mermaid/{stateDiagram-OKZ733FA-BZXqsJ9i.js => stateDiagram-OKZ733FA-CuyrYUa7.js} (96%) create mode 100644 veadk/webui/assets/visualizations/mermaid/stateDiagram-v2-UEYNNEHI-CVG1bHIn.js delete mode 100644 veadk/webui/assets/visualizations/mermaid/stateDiagram-v2-UEYNNEHI-HWzGwZhJ.js rename veadk/webui/assets/visualizations/mermaid/{swimlanes-SLNWSIFB-BmU_H9aV.js => swimlanes-SLNWSIFB-Csb_AeKm.js} (99%) delete mode 100644 veadk/webui/assets/visualizations/mermaid/swimlanesDiagram-ULZ7WXOC-Dk4f75vA.js create mode 100644 veadk/webui/assets/visualizations/mermaid/swimlanesDiagram-ULZ7WXOC-mCTeAlco.js rename veadk/webui/assets/visualizations/mermaid/{timeline-definition-Z64GVDOM-B3DCr6LN.js => timeline-definition-Z64GVDOM-BUN-mmM8.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{vennDiagram-T6HMQDX7-Eu0N_XqZ.js => vennDiagram-T6HMQDX7-BDMbYYJ1.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{wardleyDiagram-T6FBY63Y-DPwaQxTd.js => wardleyDiagram-T6FBY63Y-Bq_oSpZX.js} (99%) rename veadk/webui/assets/visualizations/mermaid/{xychartDiagram-ELKLHX3M-C64h7728.js => xychartDiagram-ELKLHX3M-BwllaV3a.js} (99%) diff --git a/frontend/server/mpa_creation.py b/frontend/server/mpa_creation.py index c03f7ed80..6d1b50766 100644 --- a/frontend/server/mpa_creation.py +++ b/frontend/server/mpa_creation.py @@ -37,22 +37,27 @@ ConfigurationError, load_studio_profile, validate_creation_resources, + validate_creation_tos, validate_image_reference, validate_runtime_name, - validate_creation_tos, with_creation_images, with_creation_resources, with_creation_tos, ) -from veadk.integrations.mpa.managed.credentials import load_volcengine_credentials +from veadk.integrations.mpa.managed.credentials import ( + load_provider_credentials, + load_volcengine_credentials, +) from veadk.integrations.mpa.managed.tasks import CreationTasks, TaskError, owner_key -def _studio_task_path() -> Path: +def _studio_task_path(provider="volcengine") -> Path: return Path( os.getenv( "VEADK_MPA_TASK_DB", - "/tmp/veadk-studio/mpa-creation.sqlite3", + "/tmp/veadk-studio/mpa-creation-byteplus.sqlite3" + if provider == "byteplus" + else "/tmp/veadk-studio/mpa-creation.sqlite3", ) ) @@ -63,7 +68,7 @@ class CreationRequest(BaseModel): agentId: str = Field(default="", pattern=r"^[a-z0-9][a-z0-9_-]{0,63}$") name: str = "" description: str = Field(default="", max_length=512) - region: str = Field(pattern=r"^cn-[a-z]+$", max_length=32) + region: str = Field(pattern=r"^(cn-[a-z]+|ap-southeast-1)$", max_length=32) runtimeImage: str = Field(default="", max_length=1024) workerImage: str = Field(default="", max_length=1024) pgHost: str = Field(default="", max_length=255) @@ -95,26 +100,36 @@ def validate_resources(self): def mount_mpa_creation_routes( - app: FastAPI, *, owner, service: CreationTasks | None = None, supported=True + app: FastAPI, + *, + owner, + service: CreationTasks | None = None, + supported=True, + provider="volcengine", ): tasks = service def get_tasks(): nonlocal tasks if tasks is None: - task_path = _studio_task_path() + task_path = _studio_task_path(provider) tasks = CreationTasks(task_path) return tasks def profile(region): if not supported: - raise ConfigurationError("MPA creation requires the Volcengine provider") - result = load_studio_profile(region=region) + raise ConfigurationError("MPA creation is unavailable for this provider") + result = load_studio_profile(region=region, provider=provider) try: - load_volcengine_credentials(result.managed.credential_file) + if provider == "volcengine": + load_volcengine_credentials(result.managed.credential_file) + else: + load_provider_credentials(provider, result.managed.credential_file) except ValueError: raise ConfigurationError( - "Configure server deployment credentials" + "Configure server BytePlus deployment credentials (BYTEPLUS_ACCESS_KEY/BYTEPLUS_SECRET_KEY or VEADK_MPA_BYTEPLUS_CREDENTIAL_FILE)" + if provider == "byteplus" + else "Configure server deployment credentials" ) from None return None, result @@ -143,6 +158,8 @@ async def create(request: Request): try: path, config = profile(body.region) payload = body.model_dump(mode="json") + if provider == "byteplus": + payload["provider"] = provider if not payload["agentId"]: payload["agentId"] = ( "mi-" diff --git a/frontend/src/i18n/resources/en-US/ui.json b/frontend/src/i18n/resources/en-US/ui.json index 261695c09..fc6ef3926 100644 --- a/frontend/src/i18n/resources/en-US/ui.json +++ b/frontend/src/i18n/resources/en-US/ui.json @@ -1608,12 +1608,14 @@ "previousStep": "Previous", "pgDescription": "Choose an existing PostgreSQL instance. Creation prepares an isolated database for this agent on that instance.", "pgSplitDescription": "Use the configured business PG Workspace. Agents share this Workspace, each with its own database. Shared resource records are stored separately in mpa_admin_workspace / mpa_admin_db, configured by the administrator.", + "pgConsoleByteplus": "Create or inspect an AIDAP PG Workspace in BytePlus", "pgConsole": "Create or inspect an AIDAP PG Workspace in Volcengine", "pgHost": "PG host", "pgPort": "PG port", "pgInvalid": "Enter a valid PG host and port.", "pgCredentials": "The deployment service provides the PG login and password; host and port must match its configuration.", "openvikingDescription": "Optional. Enter all three fields to enable OpenViking, or leave all blank to omit OpenViking settings from the new agent.", + "openvikingConsoleByteplus": "Inspect OpenViking resources in BytePlus", "openvikingConsole": "Inspect OpenViking resources in Volcengine", "openvikingUrl": "OpenViking service URL", "openvikingResourceId": "OpenViking resource ID", diff --git a/frontend/src/i18n/resources/zh-CN/ui.json b/frontend/src/i18n/resources/zh-CN/ui.json index 4dedf767c..24b5a5ab6 100644 --- a/frontend/src/i18n/resources/zh-CN/ui.json +++ b/frontend/src/i18n/resources/zh-CN/ui.json @@ -1608,12 +1608,14 @@ "previousStep": "上一步", "pgDescription": "选择已有的 PostgreSQL 实例。创建流程会在该实例中准备智能体的独立业务库。", "pgSplitDescription": "使用已配置的业务 PG Workspace。多个智能体共用此 Workspace,每个智能体拥有独立业务库。共享资源记录单独存放在 mpa_admin_workspace / mpa_admin_db,由管理员配置。", + "pgConsoleByteplus": "前往 BytePlus AIDAP 创建或查看 PG Workspace", "pgConsole": "前往火山引擎 AIDAP 创建或查看 PG Workspace", "pgHost": "PG 主机地址", "pgPort": "PG 端口", "pgInvalid": "请填写有效的 PG 主机地址和端口。", "pgCredentials": "PG 连接账号和密码由部署服务配置;主机和端口须与服务端配置一致。", "openvikingDescription": "可选。三项全部填写才启用 OpenViking;全部留空则不向新智能体注入 OpenViking 配置。", + "openvikingConsoleByteplus": "前往 BytePlus 查看 OpenViking 资源", "openvikingConsole": "前往火山引擎查看 OpenViking 资源", "openvikingUrl": "OpenViking 服务地址", "openvikingResourceId": "OpenViking 资源 ID", diff --git a/frontend/src/ui/MyAgents.tsx b/frontend/src/ui/MyAgents.tsx index 74a2fd025..b1b366756 100644 --- a/frontend/src/ui/MyAgents.tsx +++ b/frontend/src/ui/MyAgents.tsx @@ -1214,7 +1214,7 @@ export function MyAgents({ let createAgent: (() => void) | undefined; if (activeType === "general" && canCreateRuntimeAgents) { createAgent = () => onCreateAgent(region, "general"); - } else if (activeType === "mpa" && canCreateRuntimeAgents && cloudProvider === "volcengine") { + } else if (activeType === "mpa" && canCreateRuntimeAgents) { createAgent = () => setMpaCreateRegion(region); } else if (isSandboxMyAgentType(activeType) && canCreatePersonalAgents) { createAgent = () => onCreateSandboxAgent(activeType); @@ -1407,7 +1407,7 @@ export function MyAgents({
  • )} - {mpaCreateRegion && setMpaCreateRegion(null)} onCreated={() => { invalidateRuntimeAgentCache(); diff --git a/frontend/src/ui/mpa-create/MpaCreateDialog.tsx b/frontend/src/ui/mpa-create/MpaCreateDialog.tsx index f9b9d55a7..9a4e7f0f7 100644 --- a/frontend/src/ui/mpa-create/MpaCreateDialog.tsx +++ b/frontend/src/ui/mpa-create/MpaCreateDialog.tsx @@ -17,6 +17,7 @@ import { import "../../components/composites/ModalButton/ModalButton.css"; import "./MpaCreateDialog.css"; import { runtimeNameProblem } from "../../create/runtimeName"; +import type { CloudProvider } from "../../adk/cloudProvider"; import { validOpenViking, validPgTarget } from "../../adk/mpaCreationResources"; const PG_CONSOLE_URL = @@ -71,10 +72,12 @@ function initial(region: string): { export function MpaCreateDialog({ region, + cloudProvider = "volcengine", onClose, onCreated, }: { region: string; + cloudProvider?: CloudProvider; onClose: () => void; onCreated: () => void; }) { @@ -455,11 +458,21 @@ export function MpaCreateDialog({ )}

    - {t(key("pgConsole"))} + {t( + key( + cloudProvider === "byteplus" + ? "pgConsoleByteplus" + : "pgConsole", + ), + )} {!autoPg && ( <> @@ -506,11 +519,21 @@ export function MpaCreateDialog({ <>

    {t(key("openvikingDescription"))}

    - {t(key("openvikingConsole"))} + {t( + key( + cloudProvider === "byteplus" + ? "openvikingConsoleByteplus" + : "openvikingConsole", + ), + )}